WinXP-Examples: WinBase/Debug/Deb/DebMain.c File Reference

  • Main Page
  • Namespaces
  • Classes
  • Files
  • Directories
  • File List
  • File Members
  • WinBase
  • Debug
  • Deb
Defines | Functions | Variables

DebMain.c File Reference

#include <Windows.H>
#include <stdio.h>
#include <tchar.h>
#include <strsafe.h>
#include "StdLib.H"
#include "LinkList.H"
#include "DEBDebug.H"
#include "DEBMisc.H"
#include "DEBMain.H"

Go to the source code of this file.

Defines

#define | BOTTOM_BORDER 4
#define | MIN_HEIGHT 128
#define | NUM_ICONS 8
#define | SIDE_BORDER 4
#define | STRICT
#define | TIMEOUT_ANIMATED_ICON 150L
#define | TOP_BORDER 4

Functions

BOOL CALLBACK | AboutDlgProc (HWND, UINT, WPARAM, LPARAM)
BOOL CALLBACK | AttachDlgProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | NewListBoxWndProc (HWND, UINT, WPARAM, LPARAM)
BOOL CALLBACK | PreferencesDlgProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | ProcessCommandsWndProc (HWND, UINT, WPARAM, LPARAM)
VOID CALLBACK | TimerProc (HWND, UINT, UINT_PTR, DWORD)
INT WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, INT nCmdShow)

Variables

GLOBAL Global
PROFILE Profile
TCHAR | szExePathName [MAX_PATH]
TCHAR | szHelpPathName [MAX_PATH]
TCHAR | szIniPathName [MAX_PATH]
TCHAR | szPath [MAX_PATH]

Define Documentation

#define BOTTOM_BORDER 4
#define MIN_HEIGHT 128
#define NUM_ICONS 8
#define SIDE_BORDER 4
#define STRICT

Definition at line 30 of file DebMain.c.

#define TIMEOUT_ANIMATED_ICON 150L

Definition at line 49 of file DebMain.c.

#define TOP_BORDER 4

Function Documentation

BOOL CALLBACK AboutDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 876 of file DebMain.c.

{
  switch( uMsg ) {

    case WM_COMMAND:
      switch( LOWORD(wParam) ) {

        case IDOK:
          EndDialog( hDlg, TRUE );
          return( TRUE );

        case IDCANCEL:
          EndDialog( hDlg, FALSE );
          return( FALSE );

      }
      break;

    case WM_INITDIALOG:
      SetTimer( hDlg, 1, TIMEOUT_ANIMATED_ICON, TimerProc );
      return( TRUE );

    case WM_CLOSE:
      EndDialog( hDlg, TRUE );
      return( TRUE );

    case WM_DESTROY:
      KillTimer( hDlg, 1 );
      return( TRUE );
  }

  return( FALSE );
  UNREFERENCED_PARAMETER( lParam );
}

BOOL CALLBACK AttachDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 807 of file DebMain.c.

{
  static HWND hWndProcessList;

  switch( uMsg ) {

    case WM_COMMAND:
      switch( LOWORD(wParam) ) {

        case IDOK: {
          LONG  Index;
          DWORD dwProcessId;

          Index = (UINT) SendMessage( hWndProcessList, LB_GETCURSEL,
                         (WPARAM) 0L, (LPARAM) 0L );
          dwProcessId = (DWORD) SendMessage( hWndProcessList,
                                  LB_GETITEMDATA,
                                  (WPARAM) Index, (LPARAM) 0L );
          AttachToDebuggee( dwProcessId, Global.hWndListBox );
          EndDialog( hDlg, TRUE );
          return( TRUE );
        }

        case IDCANCEL:
          EndDialog( hDlg, FALSE );
          return( TRUE );

        case IDHELP:
          return( TRUE );

      }
      switch( HIWORD( wParam ) ) {
        case LBN_DBLCLK:
          SendMessage( hDlg, WM_COMMAND, (WPARAM) IDOK, (LPARAM) 0L );
          return( TRUE );
      }
      break;

    case WM_INITDIALOG:
      hWndProcessList = GetDlgItem( hDlg, IDC_PROCESSLIST );
      SendMessage( hWndProcessList, LB_RESETCONTENT, 0 , 0 );
      for(; !EnumWindows( (WNDENUMPROC) EnumProcessListFunc,
               (LPARAM) hWndProcessList ); )
        ; // continue looping until done
      return( TRUE );
  }

  return( FALSE );
  UNREFERENCED_PARAMETER( lParam );
}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 251 of file DebMain.c.

{
  #define TOP_BORDER      4
  #define BOTTOM_BORDER   4
  #define SIDE_BORDER     4
  #define MIN_HEIGHT    128

  static HDC hDC;

  switch( uMsg ) {

    //-- forward all WM_COMMANDS to separate handler function
    case WM_COMMAND:
      return( ProcessCommandsWndProc( hWnd, uMsg, wParam, lParam) );

    //-- create debug event listbox
    case UM_CREATE_LISTBOX: {
      TCHAR  szWindowName[64];
      HFONT  hFont;

      LoadString( Global.hInstance, IDS_DEBUG_EVENTS, szWindowName,
        sizeof(szWindowName)/sizeof(TCHAR) );

      Global.hWndListBox = CreateWindow(
                           TEXT( "ListBox" ),
                           szWindowName,
                           WS_CHILD             | WS_VISIBLE      |
                           WS_CAPTION           | WS_VSCROLL      |
                           WS_HSCROLL           | LBS_NOTIFY      |
                           LBS_DISABLENOSCROLL  | LBS_USETABSTOPS |
                           LBS_NOINTEGRALHEIGHT,
                           (INT) SIDE_BORDER,
                           (INT) (Profile.fToolBar
                             ? (Global.ToolBarHeight + TOP_BORDER)
                             : TOP_BORDER),
                           (INT) Global.ListBoxSize.cx,
                           (INT) Global.ListBoxSize.cy,
                           hWnd, (HMENU) 0L, Global.hInstance, 0L );

      //-- Subclass the listbox so the user cannot move it
      Global.OldListBoxWndProc = SubclassWindow( Global.hWndListBox,
        (WNDPROC) NewListBoxWndProc );

      //-- set listbox font & background color
      hDC = GetDC( Global.hWndListBox );
      hFont = CreateFontIndirect( &(Profile.LogFont) );
      SelectObject( hDC, hFont );
      SendMessage( Global.hWndListBox, WM_CTLCOLORLISTBOX, (WPARAM) hDC,
        (LPARAM) Global.hWndListBox );
      SendMessage( Global.hWndListBox, WM_SETFONT, (WPARAM) hFont, TRUE );
      ReleaseDC( Global.hWndListBox, hDC );

      //-- if command line contains a debuggee name then
      //   start and detach the debug event processing thread
      if( __argc == 2 )
        StartDebuggee( (LPTSTR) __argv[1], Global.hWndListBox );

      return( FALSE );
    }

    //-- create ToolBar & send message to create the Debug Events listbox
    case WM_CREATE:
      Global.hWndToolBar = CreateTextButtonBar( hWnd, &Global.ToolBarHeight );
      if( Profile.fToolBar )
        ShowWindow( Global.hWndToolBar, SW_SHOW );
      PostMessage( hWnd, UM_CREATE_LISTBOX, 0, 0 );
      return( FALSE );

    //-- resize the debug event listbox when the window size changes
    case WM_SIZE:
      Global.ClientSize.cx = LOWORD( lParam );
      Global.ClientSize.cy = HIWORD( lParam );
      Global.ListBoxSize.cx = Global.ClientSize.cx - ( 2*SIDE_BORDER );
      Global.ListBoxSize.cy = max( Global.ClientSize.cy, MIN_HEIGHT
                                + TOP_BORDER )
        - (TOP_BORDER + BOTTOM_BORDER);

      if( Profile.fToolBar )
        Global.ListBoxSize.cy -= Global.ToolBarHeight;

      if( Global.hWndListBox != 0L)
        MoveWindow( Global.hWndListBox,
          (INT) SIDE_BORDER,
          (INT) (Profile.fToolBar ? Global.ToolBarHeight + TOP_BORDER : TOP_BORDER),
          (INT) Global.ListBoxSize.cx, (INT) Global.ListBoxSize.cy, TRUE );

      switch( wParam ) {

        case SIZE_RESTORED: {
          RECT rect;

          Profile.fMaximized = FALSE;
          Profile.fMinimized = FALSE;
          GetWindowRect( Global.hWndMain, &rect );
          Profile.nWidth  = (INT) (rect.right - rect.left);
          Profile.nHeight = (INT) (rect.bottom - rect.top);
          return( FALSE );
        }

        case SIZE_MAXIMIZED:
          Profile.fMaximized = TRUE;
          Profile.fMinimized = FALSE;
          Profile.xPos       = Global.xPosOld;
          Profile.yPos       = Global.yPosOld;
          return( FALSE );

        case SIZE_MINIMIZED:
          Profile.fMinimized = TRUE;
          Profile.fMaximized = FALSE;
          Profile.xPos       = Global.xPosOld;
          Profile.yPos       = Global.yPosOld;
          return( FALSE );

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

    //-- keep track of window position so it can be saved
    case WM_MOVE: {
      RECT rect;

      GetWindowRect( Global.hWndMain, &rect );
      Global.xPosOld      = Profile.xPos;
      Global.yPosOld      = Profile.yPos;
      Profile.xPos = (INT) rect.left;
      Profile.yPos = (INT) rect.top;
      return( FALSE );
    }

    //-- colorize the debug event listbox
    case WM_CTLCOLORLISTBOX: {
      LOGBRUSH LogBrush;

      LogBrush.lbStyle = BS_SOLID;
      LogBrush.lbColor = Profile.rgbBackColor;
      LogBrush.lbHatch = 0L;

      SetTextColor( (HDC) wParam, Profile.rgbForeColor );
      SetBkColor( (HDC) wParam, Profile.rgbBackColor );

      return( (LPARAM) CreateBrushIndirect( &LogBrush ) );
    }

    //-- check if a debuggee is still active, save profile settings
    case WM_CLOSE:
      if( Global.dwActiveDebuggees ) {
        TCHAR  szExitBoxTitle[64];
        TCHAR  szExitBoxText[256];

        LoadString( Global.hInstance, IDS_EXIT_BOX_TITLE, szExitBoxTitle,
          sizeof(szExitBoxTitle)/sizeof(TCHAR) );
        LoadString( Global.hInstance, IDS_EXIT_BOX_TEXT, szExitBoxText,
          sizeof(szExitBoxText)/sizeof(TCHAR) );
        if ( MessageBox( hWnd, szExitBoxText, szExitBoxTitle,
               MB_YESNO | MB_ICONEXCLAMATION ) == IDNO )
          return( FALSE );
      }

      //-- store location information to private profile data
      WritePrivateProfileSettings( Global.szAppName, szIniPathName, &Profile );

      DestroyWindow( Global.hWndToolBar );
      DestroyWindow( Global.hWndListBox );
      DestroyWindow( Global.hWndMain );

      return( FALSE );

    case WM_DESTROY:
      if( Global.fHelpUsed )
        WinHelp( hWnd, szHelpPathName, (UINT) HELP_QUIT, 0L);
      PostQuitMessage( 0 );
      return( FALSE );

    default:               // Passes it on if unproccessed
      return( DefWindowProc(hWnd, uMsg, wParam, lParam) );
  }

  return( FALSE );
}

LRESULT CALLBACK NewListBoxWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 919 of file DebMain.c.

{
  switch( uMsg ) {

    case WM_NCLBUTTONDOWN:
      if( wParam == HTCAPTION ) {
        SetFocus( hWnd );
        return( FALSE );
      }
      else
        break;
  }

  return( CallWindowProc( Global.OldListBoxWndProc, hWnd, uMsg, wParam, lParam) );
}

BOOL CALLBACK PreferencesDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 633 of file DebMain.c.

{
  switch( uMsg ) {

    case WM_COMMAND:
      switch( LOWORD(wParam) ) {

        case IDOK:

          //-- Debugger Setting Group
          if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_PROCESS),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebugMode = DEBUG_PROCESS;
          if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_ONLY_THIS_PROCESS),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebugMode = DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS;

          //-- Debuggee Priority Group
          if( SendMessage( GetDlgItem( hDlg, IDC_IDLE_PRIORITY_CLASS),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebuggeePriority = IDLE_PRIORITY_CLASS;
          if( SendMessage( GetDlgItem( hDlg, IDC_NORMAL_PRIORITY_CLASS),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebuggeePriority = NORMAL_PRIORITY_CLASS;
          if( SendMessage( GetDlgItem( hDlg, IDC_HIGH_PRIORITY_CLASS),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebuggeePriority = HIGH_PRIORITY_CLASS;
          if( SendMessage( GetDlgItem( hDlg, IDC_REALTIME_PRIORITY_CLASS),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebuggeePriority = REALTIME_PRIORITY_CLASS;

          //-- Miscellaneous Options Group
          Profile.fClearOnNew  = (BOOL) SendMessage(
                                          GetDlgItem( hDlg, IDC_CLEAR_ON_NEW),
                                          BM_GETCHECK, 0 , 0 );
          Profile.fVerbose     = (BOOL) SendMessage(
                                          GetDlgItem( hDlg, IDC_VERBOSE),
                                          BM_GETCHECK, 0 , 0 );

#ifdef SHOW_SYMBOLS
          Profile.fShowSymbols = (BOOL) SendMessage(
                                          GetDlgItem( hDlg, IDC_SHOW_SYMBOLS),
                                          BM_GETCHECK, 0 , 0 );
#endif

          //- Debug Error Level Group
          if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_NONE),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebugErrorLevel = 0;
          if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_ERROR),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebugErrorLevel = SLE_ERROR;
          if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_MINORERROR),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebugErrorLevel = SLE_MINORERROR;
          if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_WARNING),
                BM_GETCHECK, 0, 0 ) )
            Profile.DebugErrorLevel = SLE_WARNING;

          Profile.fSavePreferences = (BOOL) SendMessage(
                                              GetDlgItem( hDlg,
                                                IDC_SAVE_PREFERENCES),
                                              BM_GETCHECK, 0 , 0 );
          EndDialog( hDlg, TRUE );
          return( TRUE );

        case IDCANCEL:
          EndDialog( hDlg, FALSE );
          return( TRUE );

        case IDHELP:
          return( TRUE );

      }
      break;

    case WM_INITDIALOG:

      //-- Debugger Setting Group
      switch( Profile.DebugMode ) {

        case DEBUG_PROCESS:
          SendMessage( GetDlgItem( hDlg, IDC_DEBUG_PROCESS),
            BM_SETCHECK, 1, 0);
          break;

        case ( DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS ):
          SendMessage( GetDlgItem( hDlg, IDC_DEBUG_ONLY_THIS_PROCESS),
            BM_SETCHECK, 1, 0);
          break;
      }

      //-- Debuggee Priority Group
      switch( Profile.DebuggeePriority ) {

        case IDLE_PRIORITY_CLASS:
          SendMessage( GetDlgItem( hDlg, IDC_IDLE_PRIORITY_CLASS),
            BM_SETCHECK, 1, 0);
          break;

        case NORMAL_PRIORITY_CLASS:
          SendMessage( GetDlgItem( hDlg, IDC_NORMAL_PRIORITY_CLASS),
            BM_SETCHECK, 1, 0);
          break;

        case HIGH_PRIORITY_CLASS:
          SendMessage( GetDlgItem( hDlg, IDC_HIGH_PRIORITY_CLASS),
            BM_SETCHECK, 1, 0);
          break;

        case REALTIME_PRIORITY_CLASS:
          SendMessage( GetDlgItem( hDlg, IDC_REALTIME_PRIORITY_CLASS),
            BM_SETCHECK, 1, 0);
          break;

      }

      //-- Miscellaneous Options Group
      SendMessage( GetDlgItem( hDlg, IDC_CLEAR_ON_NEW),     BM_SETCHECK,
        Profile.fClearOnNew, 0 );
      SendMessage( GetDlgItem( hDlg, IDC_VERBOSE),          BM_SETCHECK,
        Profile.fVerbose, 0 );
      SendMessage( GetDlgItem( hDlg, IDC_SAVE_PREFERENCES), BM_SETCHECK,
        Profile.fSavePreferences, 0 );

#ifdef SHOW_SYMBOLS
      SendMessage( GetDlgItem( hDlg, IDC_SHOW_SYMBOLS),     BM_SETCHECK,
        Profile.fShowSymbols, 0 );
#endif

      //- Debug Error Level Group
      switch( Profile.DebugErrorLevel ) {

        case 0:
          SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_NONE),
            BM_SETCHECK, 1, 0);
          break;

        case SLE_ERROR:
          SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_ERROR),
            BM_SETCHECK, 1, 0);
          break;

        case SLE_MINORERROR:
          SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_MINORERROR),
            BM_SETCHECK, 1, 0);
          break;

        case SLE_WARNING:
          SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_WARNING),
            BM_SETCHECK, 1, 0);
          break;

      }

      return( TRUE );
  }

  return( FALSE );
  UNREFERENCED_PARAMETER( lParam );
}

LRESULT CALLBACK ProcessCommandsWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 443 of file DebMain.c.

{
  static LPCTSTR  lpszAboutDlgBox       = TEXT( "AboutDlgBox"       );
  static LPCTSTR  lpszAttachDlgBox      = TEXT( "AttachDlgBox"      );
  static LPCTSTR  lpszPreferencesDlgBox = TEXT( "PreferencesDlgBox" );

  switch( LOWORD(wParam) ) {

    //-- user requests to open a new debuggee
    case IDM_FILE_OPEN: {
      static TCHAR szDebuggeeFileName[MAX_PATH];

      if( Global.dwActiveDebuggees ) {
        MaxDebuggeesMessageBox( Global.hWndMain );
        return( FALSE );
      }
      if( !GetDebuggeeFileName( szDebuggeeFileName, hWnd ) ) {
        return( FALSE );
      }
      else {
        if( Profile.fClearOnNew ) {
          SendMessage( Global.hWndListBox, LB_RESETCONTENT, 0, 0 );
          Global.MaxStrLen = 0;
        }
        StartDebuggee( szDebuggeeFileName, Global.hWndListBox );
      }
      return( FALSE );
    }

    //-- user requests to attach to an existing process
    case IDM_FILE_ATTACH:
      if( Global.dwActiveDebuggees ) {
        MaxDebuggeesMessageBox( Global.hWndMain );
        return( FALSE );
      }
      if( !DialogBox( Global.hInstance, lpszAttachDlgBox, hWnd,
            (DLGPROC) AttachDlgProc ) ) {
        // handle cancel condition...
      }
      else {
        if( Profile.fClearOnNew ) {
          SendMessage( Global.hWndListBox, LB_RESETCONTENT, 0, 0 );
          Global.MaxStrLen = 0;
        }
      }
      return( FALSE );

    //-- copy listbox contents to the clipboard and clear the listbox
    case IDM_EDIT_CUT:
      CopyListBoxToClipboard( Global.hWndListBox, Global.MaxStrLen );
      SendMessage( hWnd, WM_COMMAND, IDM_EDIT_DELETE, 0 );
      return( FALSE );

    //-- copy listbox contents to the clipboard
    case IDM_EDIT_COPY: {
      CopyListBoxToClipboard( Global.hWndListBox, Global.MaxStrLen );
      return( FALSE );
    }

    //-- clear the contents of the listbox
    case IDM_EDIT_DELETE:
      SendMessage( Global.hWndListBox, LB_RESETCONTENT, 0, 0 );
      Global.MaxStrLen = 0;
      return( FALSE );

    //-- user requests a new font for the listbox
    case IDM_OPTIONS_FONT:
      if( !ChooseNewFont( Global.hWndListBox ) ) {
        // handle cancel condition...
      }
      return( FALSE );

    //-- user requests a new background color for the listbox
    case IDM_OPTIONS_COLOR:
      ChooseNewBackColor( Global.hWndListBox );
      return( FALSE );

    //-- invoke the preferences dialog box
    case IDM_OPTIONS_PREFERENCES:
      DialogBox( Global.hInstance, lpszPreferencesDlgBox, hWnd,
        (DLGPROC) PreferencesDlgProc );
      return( FALSE );

    //-- toggle the toolbar on or off
    case IDM_OPTIONS_TOOLBAR:
      if( Profile.fToolBar ) {
        Profile.fToolBar = 0;
        CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_TOOLBAR,
          MF_UNCHECKED );
        ShowWindow( Global.hWndToolBar, SW_HIDE );
        SendWmSizeMessage( Global.hWndMain );
      }
      else {
        Profile.fToolBar = 1;
        CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_TOOLBAR,
          MF_CHECKED );
        ShowWindow( Global.hWndToolBar, SW_SHOW );
        SendWmSizeMessage( Global.hWndMain );
      }
      return( FALSE );

    //-- toggles whether the used directory is used for the 'open' command
    case IDM_OPTIONS_SAVEDDIR:
      if( Profile.fSavedDirectory ) {
        Profile.fSavedDirectory = 0;
        CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEDDIR,
          MF_UNCHECKED );
      }
      else {
        Profile.fSavedDirectory = 1;
        CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEDDIR,
          MF_CHECKED );
      }
      return( FALSE );

    //-- toggles the 'save on exit' feature
    case IDM_OPTIONS_SAVEONEXIT:
      if( Profile.fSaveOnExit ) {
        Profile.fSaveOnExit = 0;
        CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEONEXIT,
          MF_UNCHECKED );
      }
      else {
        Profile.fSaveOnExit = 1;
        CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEONEXIT,
          MF_CHECKED );
      }
      return( FALSE );

    //-- store location information to private profile data now
    case IDM_OPTIONS_SAVENOW: {
      BOOL fOldSaveOnExit = Profile.fSaveOnExit;
      BOOL fOldSavePreferences = Profile.fSavePreferences;

      Profile.fSaveOnExit = TRUE;
      Profile.fSavePreferences = TRUE;
      WritePrivateProfileSettings( Global.szAppName, szIniPathName, &Profile );
      Profile.fSaveOnExit = fOldSaveOnExit;
      Profile.fSavePreferences = fOldSavePreferences;
      return( FALSE );
    }

    //-- invoke help and display the contents panel
    case IDM_HELP_CONTENTS:
      Global.fHelpUsed = TRUE;
      WinHelp( hWnd, (LPCTSTR) szHelpPathName, HELP_CONTENTS, 0L );
      return( FALSE );

    //-- search the help indexes
    case IDM_HELP_SEARCH:
      Global.fHelpUsed = TRUE;
      WinHelp( hWnd, (LPCTSTR) szHelpPathName, HELP_PARTIALKEY,
        (DWORD_PTR) TEXT( "" ) );
      return( FALSE );

    //-- invoke the main 'how to use' help panel
    case IDM_HELP_HOWTOUSE:
      Global.fHelpUsed = TRUE;
      WinHelp( hWnd, (LPTSTR) 0L, HELP_HELPONHELP, 0L );
      return( FALSE );

    //-- display the product information dialog box
    case IDM_HELP_ABOUT:
      DialogBox( Global.hInstance, lpszAboutDlgBox, hWnd,
        (DLGPROC) AboutDlgProc );
      return( FALSE );

    //-- the usr requests to terminate the app
    case IDM_FILE_EXIT:
      SendMessage( Global.hWndMain, WM_CLOSE, 0, 0 );
      return( FALSE );

    default:
      return( DefWindowProc(hWnd, uMsg, wParam, lParam) );
  }

  return( FALSE );
}

VOID CALLBACK TimerProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | UINT_PTR | idEvent,
 |  | DWORD | dwTime
 | ) |  |

Definition at line 943 of file DebMain.c.

{
 #define NUM_ICONS 8

 static UINT    uIconNumber = 0;
 static HWND    hWndIcon    = 0L;
 static HWND    hWndIconOld = 0L;
 static LPCTSTR lpszIconNames[NUM_ICONS] = {
                  TEXT( "DebugIcon1" ), TEXT( "DebugIcon2" ),
                  TEXT( "DebugIcon3" ), TEXT( "DebugIcon4" ),
                  TEXT( "DebugIcon5" ), TEXT( "DebugIcon6" ),
                  TEXT( "DebugIcon7" ), TEXT( "DebugIcon8" ) };

 if( (++uIconNumber) >= NUM_ICONS )
   uIconNumber = 0;

 hWndIconOld = hWndIcon;
 hWndIcon = CreateIconWindow( hDlg, lpszIconNames[uIconNumber] );
 if( hWndIcon != 0L )
   DestroyWindow( hWndIconOld );

 return;
 UNREFERENCED_PARAMETER( uMsg );
 UNREFERENCED_PARAMETER( idEvent );
 UNREFERENCED_PARAMETER( dwTime );
}

INT WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInst,
 |  | LPSTR | lpCmdLine,
 |  | INT | nCmdShow
 | ) |  |

Definition at line 79 of file DebMain.c.

{
  MSG      Msg;
  WNDCLASS WndClass;
  HACCEL   hAccel;
  OSVERSIONINFO osvi;

  LPCTSTR lpszIconName    = TEXT( "DebugIcon"  );
  LPCTSTR lpszMenuName    = TEXT( "DebugMenu"  );
  LPCTSTR lpszClassName   = TEXT( "DebugClass" );
  LPCTSTR lpszAccelName   = TEXT( "DebugAccel" );
  LPCTSTR lpszIniFileExt  = TEXT( "INI"        );
  LPCTSTR lpszHelpFileExt = TEXT( "HLP"        );

  Global.hInstance = hInstance;
  Global.dwActiveDebuggees = 0;

  //-- Load the "A Windows API Failed" resource string
  {
    TCHAR szApiFailed[] = TEXT( "A Windows API Failed" );

    if( !LoadString( Global.hInstance, IDS_API_FAILED_MSG,
          Global.szApiFailed, sizeof(Global.szApiFailed)/sizeof(TCHAR) ) ) {
      ErrorMessageBox( TEXT( "First LoadString()" ),
        szApiFailed, szSourceFileName, __LINE__ );
      StringCbCopy( Global.szApiFailed, sizeof(Global.szApiFailed), szApiFailed );
    }
  }

  //-- Load all other resource strings
  if( !LoadString( Global.hInstance, IDS_APPNAME,  Global.szAppName,
         sizeof(Global.szAppName)/sizeof(TCHAR) ) )
    ErrorMessageBox( TEXT("LoadString()"),
      Global.szApiFailed, szSourceFileName, __LINE__ );
  if( !LoadString( Global.hInstance, IDS_SHORT_APPNAME,
         Global.szShortAppName, sizeof(Global.szShortAppName)/sizeof(TCHAR) ) )
    ErrorMessageBox( TEXT("LoadString()"),
      Global.szApiFailed, szSourceFileName, __LINE__ );

  //-- if compiled for Win32 (Unicode) and not Win32s then display
  //    notice and terminate

  //
  // Detect platform and exit gracefully if unsupported platform.
  //

  osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
  GetVersionEx (&osvi);
  if (osvi.dwPlatformId == VER_PLATFORM_WIN32s) {
    TCHAR szTitleBuffer[64];
    TCHAR szTextBuffer[256];

    if( !LoadString( Global.hInstance, IDS_WINDOWS_NT_REQUIRED_TITLE,
           szTitleBuffer, sizeof(szTitleBuffer)/sizeof(TCHAR) ) )
      ErrorMessageBox( TEXT("LoadString()"),
        Global.szApiFailed, szSourceFileName, __LINE__ );

    if( !LoadString( Global.hInstance, IDS_WINDOWS_NT_REQUIRED,
           szTextBuffer, sizeof(szTextBuffer)/sizeof(TCHAR) ) )
      ErrorMessageBox( TEXT("LoadString()"),
        Global.szApiFailed, szSourceFileName, __LINE__ );

    MessageBox( 0L, szTextBuffer, szTitleBuffer,
      MB_APPLMODAL | MB_ICONSTOP | MB_OK );
    return( -1 );
  }

  //-- register the debug event window class
  WndClass.style         = CS_DBLCLKS;
  WndClass.lpfnWndProc   = (WNDPROC) MainWndProc;
  WndClass.cbClsExtra    = 0L;
  WndClass.cbWndExtra    = 0L;
  WndClass.hInstance     = Global.hInstance;
  WndClass.hIcon         = LoadIcon( Global.hInstance, lpszIconName );
  WndClass.hCursor       = LoadCursor( 0L, (LPTSTR) IDC_ARROW );
  WndClass.hbrBackground = (HBRUSH) (COLOR_APPWORKSPACE+1);
  WndClass.lpszMenuName  = lpszMenuName;
  WndClass.lpszClassName = lpszClassName;

  if( !RegisterClass(&WndClass) ) {
    ErrorMessageBox( TEXT("RegisterClass()"),
      Global.szApiFailed, szSourceFileName, __LINE__ );
    return( FALSE );
  }

  //-- get application pathname and store the ini and help file pathname
  //   (which is located in the same directory as the application)
  GetModuleFileName( (HANDLE) 0L, szExePathName,
    sizeof(szExePathName)/sizeof(TCHAR) );
  GetPathFromFullPathName( szExePathName, szPath,
    sizeof(szPath)/sizeof(TCHAR) );
  if (StringCchPrintf( szIniPathName, sizeof(szIniPathName)/sizeof(TCHAR),
        TEXT( "%s\\%s.%s" ), szPath,
        Global.szShortAppName, lpszIniFileExt  ) < 0)
  {
    ErrorMessageBox( TEXT("_snprintf()"),
      Global.szApiFailed, szSourceFileName, __LINE__ );
    return( FALSE );
  }
  if (StringCchPrintf( szHelpPathName, sizeof(szHelpPathName)/sizeof(TCHAR),
        TEXT( "%s\\%s.%s" ), szPath,
        Global.szShortAppName, lpszHelpFileExt ) < 0)
  {
    ErrorMessageBox( TEXT("_snprintf()"),
      Global.szApiFailed, szSourceFileName, __LINE__ );
    return( FALSE );
  }

  //-- retrieve stored default location from private profile data
  GetPrivateProfileSettings( Global.szAppName, szIniPathName, &Profile );

  //-- Create a main window for this application instance
  Global.hWndMain = CreateWindow( lpszClassName, Global.szAppName,
                      WS_OVERLAPPEDWINDOW,
                      Profile.xPos, Profile.yPos,
                      Profile.nWidth, Profile.nHeight,
                      0L, 0L, Global.hInstance, 0L );

  //-- If window could not be created, return "failure"
  if( !Global.hWndMain ) {
    ErrorMessageBox( TEXT("CreateWindow()"),
      Global.szApiFailed, szSourceFileName, __LINE__ );
    return( FALSE );
  }

  //-- Load main menu accelerators
  if( !(hAccel = LoadAccelerators( Global.hInstance, lpszAccelName) ) ) {
    ErrorMessageBox( TEXT("LoadAccelerators()"),
      Global.szApiFailed, szSourceFileName, __LINE__ );
    return( FALSE );
  }

  //-- modify the menu to reflect saved settings
  UpdateMenuSettings( Global.hWndMain );

  //-- Make the window visible; update its client area; and return "success"
  if( Profile.fMaximized )
    ShowWindow( Global.hWndMain, SW_SHOWMAXIMIZED );
  else if ( Profile.fMinimized )
    ShowWindow( Global.hWndMain, SW_SHOWMINIMIZED );
  else
    ShowWindow( Global.hWndMain, SW_SHOWDEFAULT );
  UpdateWindow( Global.hWndMain );

  //-- Acquire and dispatch messages until a WM_QUIT message is received.
  while( GetMessage( &Msg, 0L, 0, 0 ) ) {
    if( !TranslateAccelerator( Global.hWndMain, hAccel, &Msg ) ) {
      TranslateMessage( &Msg );
      DispatchMessage( &Msg );
    }
  }

  return(int)( Msg.wParam );
  UNREFERENCED_PARAMETER( lpCmdLine );  // avoid warnings
  UNREFERENCED_PARAMETER( hPrevInst );  // always 0L under Windows NT
  UNREFERENCED_PARAMETER( nCmdShow  );  //
}

Variable Documentation

GLOBAL Global

Definition at line 44 of file DebMain.c.

PROFILE Profile

Definition at line 45 of file DebMain.c.

TCHAR szExePathName[MAX_PATH]

Definition at line 56 of file DebMain.c.

TCHAR szHelpPathName[MAX_PATH]

Definition at line 57 of file DebMain.c.

TCHAR szIniPathName[MAX_PATH]

Definition at line 59 of file DebMain.c.

TCHAR szPath[MAX_PATH]

Definition at line 54 of file DebMain.c.

Generated on Wed Nov 13 2024 16:55:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebMain.h File Reference

  • Files
  • Directories
  • File List
  • File Members
  • WinBase
  • Debug
  • Deb
Classes | Typedefs | Variables

DebMain.h File Reference

#include "DEB.H"

Go to the source code of this file.

Classes

struct | GLOBAL_STRUCT
struct | PROFILE_STRUCT

Typedefs

typedef struct GLOBAL_STRUCT | GLOBAL
typedef struct GLOBAL_STRUCT * | PGLOBAL
typedef struct PROFILE_STRUCT * | PPROFILE
typedef struct PROFILE_STRUCT | PROFILE

Variables

GLOBAL Global
PROFILE Profile

Typedef Documentation

typedef struct GLOBAL_STRUCT GLOBAL
typedef struct GLOBAL_STRUCT * PGLOBAL
typedef struct PROFILE_STRUCT * PPROFILE
typedef struct PROFILE_STRUCT PROFILE

Variable Documentation

GLOBAL Global

Definition at line 44 of file DebMain.c.

PROFILE Profile

Definition at line 45 of file DebMain.c.

Generated on Wed Nov 13 2024 16:55:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebMisc.c File Reference

  • File Members
  • WinBase
  • Debug
  • Deb
Defines | Functions

DebMisc.c File Reference

#include <Windows.H>
#include <stdio.h>
#include <tchar.h>
#include <strsafe.h>
#include <CommDlg.H>
#include <Dlgs.H>
#include <StdArg.H>
#include "LinkList.H"
#include "ToolBar.H"
#include "DEBMisc.H"

Go to the source code of this file.

Defines

#define | ERROR_BUFFER_SIZE 512
#define | STRICT

Functions

BOOL | AttachToDebuggee (DWORD dwProcessId, HWND hWndListBox)
LRESULT CALLBACK | ChooseFontHookProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL | ChooseNewBackColor (HWND hWndListBox)
BOOL | ChooseNewFont (HWND hWndListBox)
BOOL | CopyListBoxToClipboard (HWND hWndListBox, LONG MaxStrLen)
HWND | CreateIconWindow (HWND hDlg, LPCTSTR lpstrIcon)
HWND | CreateTextButtonBar (HWND hWndParent, LPINT lpTextButtonBarHeight)
BOOL CALLBACK | EnumProcessListFunc (HWND hWnd, LPARAM lParam)
BOOL | ErrorMessageBox (LPCTSTR lpszText, LPCTSTR lpszTitle, LPCTSTR lpszFile, INT Line)
BOOL | GetDebuggeeFileName (LPTSTR lpszDebuggeeFileName, HWND hWnd)
UINT | GetPathFromFullPathName (LPCTSTR lpFullPathName, LPTSTR lpPathBuffer, UINT nPathBufferLength)
BOOL | GetPrivateProfileSettings (LPCTSTR lpszAppTitle, LPCTSTR lpszIniPathName, PPROFILE pProfile)
LRESULT | ListBoxInsert (HWND hWndListBox, LPLONG lpMaxStrLen, LPCTSTR lpszString)
LRESULT | ListBoxPrintF (HWND hWndListBox, LPCTSTR szFormat,...)
BOOL | MakeCommonDebugEventString (LPTSTR lpszBuffer, DWORD cchBuffer, LPDEBUG_EVENT lpDebugEvent)
BOOL | MaxDebuggeesMessageBox (HWND hWndOwner)
BOOL | OutOfMemoryMessageBox (HWND hWndOwner)
LRESULT | SendWmSizeMessage (HWND hWnd)
BOOL | StartDebuggee (LPTSTR lpszDebuggeeFileName, HWND hWndListBox)
BOOL | StringAppendF (LPTSTR lpszBuffer, DWORD cchBuffer, LPCTSTR szFormat,...)
LPTSTR | StringPrintF (LPTSTR lpString, DWORD cchString, LPCTSTR szFormat,...)
WNDPROC | SubclassWindow (HWND hWnd, WNDPROC NewWndProc)
BOOL | UpdateMenuSettings (HWND hWnd)
BOOL | WritePrivateProfileInt (LPCTSTR lpAppName, LPCTSTR lpKeyName, INT Value, LPCTSTR lpFileName)
BOOL | WritePrivateProfileSettings (LPCTSTR lpszAppTitle, LPCTSTR lpszIniPathName, PPROFILE pProfile)

Define Documentation

#define ERROR_BUFFER_SIZE 512
#define STRICT

Definition at line 45 of file DebMisc.c.

Function Documentation

BOOL AttachToDebuggee | ( | DWORD | dwProcessId,
 |  | HWND | hWndListBox
 | ) |  |

Definition at line 139 of file DebMisc.c.

{
  static PDEB_STARTUP_INFO pDebStartupInfo;
  static BOOL              fFirstTime = TRUE;

  static TCHAR szDebuggeeTitle[128];

  HANDLE hDebugEventThread;
  DWORD  idDebugEventThread;

  //-- Load resource strings and init the OpenFileName struct
  //   (do this only one time)
  if( fFirstTime ) {
    fFirstTime = FALSE;
    LoadString( 0L, IDS_OFN_DEBUGGEE_TITLE, szDebuggeeTitle,
      sizeof(szDebuggeeTitle)/sizeof(TCHAR) );
  }

  //-- allocate the Debuggee Information structure
  pDebStartupInfo = 0L;
  pDebStartupInfo = (PDEB_STARTUP_INFO) VirtualAlloc(
                                    pDebStartupInfo,
                                    sizeof( DEB_STARTUP_INFO ),
                                    MEM_RESERVE | MEM_COMMIT,
                                    PAGE_READWRITE );

  //-- init the StartupInfo struct
  (pDebStartupInfo->StartupInfo).cb          = sizeof( STARTUPINFO );
  (pDebStartupInfo->StartupInfo).lpDesktop   = 0L;
  (pDebStartupInfo->StartupInfo).lpTitle     = szDebuggeeTitle;
  (pDebStartupInfo->StartupInfo).dwX         = 0;
  (pDebStartupInfo->StartupInfo).dwY         = 0;
  (pDebStartupInfo->StartupInfo).dwXSize     = 0;
  (pDebStartupInfo->StartupInfo).dwYSize     = 0;
  (pDebStartupInfo->StartupInfo).dwFlags     = 0L;
  (pDebStartupInfo->StartupInfo).wShowWindow = SW_SHOWDEFAULT;

  (pDebStartupInfo->ProcessInfo).hProcess = 0L;

  //-- init other debuggee info
  pDebStartupInfo->fActive       = TRUE;
  pDebStartupInfo->dwProcessId   = dwProcessId;
  pDebStartupInfo->lpstrFileName = 0L;
  pDebStartupInfo->lpstrPathName = 0L;
  pDebStartupInfo->hWndListBox   = hWndListBox;

  //-- now start and detach the debug event processing thread
  if( !( hDebugEventThread = CreateThread(
                               (LPSECURITY_ATTRIBUTES) 0L,
                               (DWORD) 0,
                               (LPTHREAD_START_ROUTINE) DebugEventThread,
                               (LPVOID) pDebStartupInfo,
                               0L,
                               (LPDWORD) &idDebugEventThread) ) ) {

    VirtualFree( pDebStartupInfo, 0, MEM_RELEASE );
    return( FALSE );
  }
  else{
    CloseHandle( hDebugEventThread );
  }

  return( TRUE );
}

LRESULT CALLBACK ChooseFontHookProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 318 of file DebMisc.c.

{
  UNREFERENCED_PARAMETER( lParam );
  UNREFERENCED_PARAMETER( wParam );

  switch( uMsg ) {

    case WM_INITDIALOG:
      ShowWindow( GetDlgItem(hDlg, grp1), SW_HIDE );
      ShowWindow( GetDlgItem(hDlg, chx1), SW_HIDE );
      ShowWindow( GetDlgItem(hDlg, chx2), SW_HIDE );
      break;

  }

  return( FALSE );
}

BOOL ChooseNewBackColor ( HWND hWndListBox )

Definition at line 395 of file DebMisc.c.

{
  static BOOL        fFirstTime = TRUE;
  static CHOOSECOLOR ChooseColorStruct;
  static DWORD       dwCustColors[16];

  if( fFirstTime ) {
    int i;

    fFirstTime = FALSE;

    //-- set the custom colors to white
    for( i = 0; i < 16; i++ )
      dwCustColors[i] = RGB(255,255,255);

    ChooseColorStruct.lStructSize    = sizeof( CHOOSECOLOR );
    ChooseColorStruct.hwndOwner      = hWndListBox;
    ChooseColorStruct.hInstance      = (HANDLE) 0L;
    ChooseColorStruct.rgbResult      = Profile.rgbBackColor;
    ChooseColorStruct.lpCustColors   = (LPDWORD) dwCustColors;
    ChooseColorStruct.Flags          = CC_RGBINIT;
    ChooseColorStruct.lCustData      = 0L;
    ChooseColorStruct.lpfnHook       = (LPCCHOOKPROC) 0L;
    ChooseColorStruct.lpTemplateName = (LPTSTR) 0L;
  }

  if( ChooseColor( &ChooseColorStruct ) ) {
    HDC    hDC;

    Profile.rgbBackColor = (COLORREF) ChooseColorStruct.rgbResult;
    hDC = GetDC( hWndListBox );
    SendMessage( hWndListBox, WM_CTLCOLORLISTBOX, (DWORD_PTR) hDC,
      (LONG_PTR) hWndListBox );
    ReleaseDC( hWndListBox, hDC );
    InvalidateRect( hWndListBox, 0L, TRUE );
  }

  return( TRUE );
}

BOOL ChooseNewFont ( HWND hWndListBox )

Definition at line 343 of file DebMisc.c.

{
  static CHOOSEFONT ChooseFontStruct;
  static BOOL       fFirstTime = TRUE;
  HFONT             hFont;

  if( fFirstTime ) {
    fFirstTime = FALSE;

    ChooseFontStruct.lStructSize    = sizeof( CHOOSEFONT );
    ChooseFontStruct.hwndOwner      = hWndListBox;
    ChooseFontStruct.hDC            = (HDC) 0L;
    ChooseFontStruct.lpLogFont      = &(Profile.LogFont);
    ChooseFontStruct.iPointSize     = (INT) 0L;
    ChooseFontStruct.Flags          = CF_INITTOLOGFONTSTRUCT |
                                      CF_SCREENFONTS | CF_EFFECTS |
                                      CF_ENABLEHOOK;
    ChooseFontStruct.rgbColors      = Profile.rgbForeColor;
    ChooseFontStruct.lCustData      = 0L;
    ChooseFontStruct.lpfnHook       = (LPCFHOOKPROC) ChooseFontHookProc;
    ChooseFontStruct.lpTemplateName = (LPTSTR) 0L;
    ChooseFontStruct.hInstance      = (HANDLE) 0L;
    ChooseFontStruct.lpszStyle      = (LPTSTR) 0L;
    ChooseFontStruct.nFontType      = SCREEN_FONTTYPE;
    ChooseFontStruct.nSizeMin       = (INT) 0L;
    ChooseFontStruct.nSizeMax       = (INT) 0L;
  }

  if( ChooseFont( &ChooseFontStruct ) ) {
    HDC    hDC;

    hFont = CreateFontIndirect( &(Profile.LogFont) );
    hDC = GetDC( hWndListBox );
    SelectObject( hDC, hFont );
    Profile.rgbForeColor = ChooseFontStruct.rgbColors;
    InvalidateRect( hWndListBox, 0L, TRUE );
    SendMessage( hWndListBox, WM_CTLCOLORLISTBOX, (DWORD_PTR) hDC,
      (LONG_PTR) hWndListBox );
    SendMessage( hWndListBox, WM_SETFONT, (DWORD_PTR) hFont, TRUE );
    ReleaseDC( hWndListBox, hDC );
  }

  return( TRUE );
}

BOOL CopyListBoxToClipboard | ( | HWND | hWndListBox,
 |  | LONG | MaxStrLen
 | ) |  |

Definition at line 848 of file DebMisc.c.

{
  LPTSTR  lpDataBuffer;
  HGLOBAL hDataBuffer;

  TCHAR  TempBuffer[256];
  DWORD  dwItemCount;
  DWORD  Count;
  LRESULT   StrLen;
  DWORD  dwMemSize;

  dwItemCount = (DWORD) SendMessage( hWndListBox, LB_GETCOUNT, 0 , 0 );
  dwMemSize = dwItemCount * (DWORD) MaxStrLen;

  //-- limit the size copied to the clipboard
  if( dwMemSize > 0xFFFFF )
    dwMemSize = 0xFFFFF;

  if( !(hDataBuffer = GlobalAlloc( GMEM_DDESHARE, dwMemSize ) ) ) {
    OutOfMemoryMessageBox( GetFocus() );
    return( FALSE );
  }
  if( !(lpDataBuffer = (LPTSTR) GlobalLock( hDataBuffer ) ) ) {
    GlobalFree( hDataBuffer );
    OutOfMemoryMessageBox( GetFocus() );
    return( FALSE );
  }

  *lpDataBuffer = '\0';

  for( Count = 0; Count < dwItemCount; Count++ ) {
    StrLen = SendMessage( hWndListBox, LB_GETTEXTLEN, Count, 0L );
    if( StrLen > (sizeof(TempBuffer)/sizeof(TCHAR)-3) )
      continue;
    if( lstrlen(lpDataBuffer) + StrLen > (dwMemSize/sizeof(TCHAR)-3))
        break;
    StrLen = SendMessage( hWndListBox, LB_GETTEXT, Count, (LPARAM) TempBuffer );
    TempBuffer[StrLen]   = '\r';
    TempBuffer[StrLen+1] = '\n';
    TempBuffer[StrLen+2] = '\0';
    StringCbCat( lpDataBuffer, sizeof(lpDataBuffer),TempBuffer );
  }

  GlobalUnlock( hDataBuffer );

  if( !OpenClipboard( hWndListBox ) ) {
    Sleep( 250 );  // wait a quarter second and try again.
    if( !OpenClipboard( hWndListBox ) ) {
      MessageBox( GetFocus(),
        TEXT( "Could not open the Clipboard!" ),
        TEXT( "Cannot Open Clipboard" ),
        MB_ICONSTOP | MB_APPLMODAL );
      GlobalFree( hDataBuffer );
      return( FALSE );
    }
  }
  if( !EmptyClipboard() ) {
    MessageBox( GetFocus(),
      TEXT( "Could not empty the Clipboard!" ),
      TEXT( "Cannot Empty Clipboard" ),
      MB_ICONSTOP | MB_APPLMODAL );
    GlobalFree( hDataBuffer );
    return( FALSE );
  }
  if( !SetClipboardData( CF_TEXT, hDataBuffer ) ) {
    MessageBox( GetFocus(),
      TEXT( "Could not copy data to the Clipboard!" ),
      TEXT( "Cannot Set Clipboard Data" ),
      MB_ICONSTOP | MB_APPLMODAL );
    GlobalFree( hDataBuffer );
    return( FALSE );
  }
  CloseClipboard();

  return( TRUE );
}

HWND CreateIconWindow | ( | HWND | hDlg,
 |  | LPCTSTR | lpstrIcon
 | ) |  |

Definition at line 521 of file DebMisc.c.

{
  return ( CreateWindow( TEXT( "static" ), lpstrIcon,
             WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_ICON,
             7, 5, 0, 0,
             hDlg, 0L, GetModuleHandle( 0L ), 0L ) );
}

HWND CreateTextButtonBar | ( | HWND | hWndParent,
 |  | LPINT | lpTextButtonBarHeight
 | ) |  |

Definition at line 458 of file DebMisc.c.

{
  TEXTBUTTON   TextButton[9];
  static TCHAR szButtonOpen[32];
  static TCHAR szButtonAttach[32];
  static TCHAR szButtonCut[32];
  static TCHAR szButtonCopy[32];
  static TCHAR szButtonDelete[32];
  static TCHAR szButtonHelp[32];

  LoadString( 0L, IDS_BUTTON_OPEN,   szButtonOpen,   sizeof(szButtonOpen)/sizeof(TCHAR)   );
  LoadString( 0L, IDS_BUTTON_ATTACH, szButtonAttach, sizeof(szButtonAttach)/sizeof(TCHAR) );
  LoadString( 0L, IDS_BUTTON_CUT,    szButtonCut,    sizeof(szButtonCut)/sizeof(TCHAR)    );
  LoadString( 0L, IDS_BUTTON_COPY,   szButtonCopy,   sizeof(szButtonCopy)/sizeof(TCHAR)   );
  LoadString( 0L, IDS_BUTTON_DELETE, szButtonDelete, sizeof(szButtonDelete)/sizeof(TCHAR) );
  LoadString( 0L, IDS_BUTTON_HELP,   szButtonHelp,   sizeof(szButtonHelp)/sizeof(TCHAR)   );

  TextButton[0].lpButtonText = szButtonOpen;
  TextButton[0].idButton     = IDM_FILE_OPEN;
  TextButton[0].hWndButton   = 0L;

  TextButton[1].lpButtonText = szButtonAttach;
  TextButton[1].idButton     = IDM_FILE_ATTACH;
  TextButton[1].hWndButton   = 0L;

  TextButton[2].lpButtonText = 0L;
  TextButton[2].idButton     = TB_SPACE;
  TextButton[2].hWndButton   = 0L;

  TextButton[3].lpButtonText = szButtonCut;
  TextButton[3].idButton     = IDM_EDIT_CUT;
  TextButton[3].hWndButton   = 0L;

  TextButton[4].lpButtonText = szButtonCopy;
  TextButton[4].idButton     = IDM_EDIT_COPY;
  TextButton[4].hWndButton   = 0L;

  TextButton[5].lpButtonText = szButtonDelete;
  TextButton[5].idButton     = IDM_EDIT_DELETE;
  TextButton[5].hWndButton   = 0L;

  TextButton[6].lpButtonText = 0L;
  TextButton[6].idButton     = TB_SPACE;
  TextButton[6].hWndButton   = 0L;

  TextButton[7].lpButtonText = szButtonHelp;
  TextButton[7].idButton     = IDM_HELP_CONTENTS;
  TextButton[7].hWndButton   = 0L;

  TextButton[8].lpButtonText = (LPTSTR) 0L;
  TextButton[8].idButton     = (INT)   0L;
  TextButton[8].hWndButton   = (HWND)  0L;

  return( TextButtonBar( hWndParent, TextButton, lpTextButtonBarHeight ) );
}

BOOL CALLBACK EnumProcessListFunc | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 212 of file DebMisc.c.

{
  static DWORD dwCurrentProcessId;
  static BOOL  fFirstTime = TRUE;
  static LONG  MaxStrLen  = 0;
  static TCHAR TextBuffer[256];

  if( fFirstTime ) {
    fFirstTime = FALSE;
    dwCurrentProcessId = GetCurrentProcessId();
  }

  if( hWnd ) {
    GetWindowText( hWnd, (LPTSTR) &TextBuffer, sizeof(TextBuffer)/sizeof(TCHAR) );
    if( *TextBuffer ) {
      DWORD  dwProcessId;

      GetWindowThreadProcessId( hWnd, &dwProcessId );
      if( dwProcessId != dwCurrentProcessId ) {
        LRESULT Index;
        HWND hWndListBox = (HWND) lParam;

        Index = ListBoxInsert( hWndListBox, &MaxStrLen, TextBuffer );
        SendMessage( hWndListBox, LB_SETITEMDATA, (WPARAM) Index,
          (LPARAM) dwProcessId );
      }
    }
  }

  return( TRUE );
}

BOOL ErrorMessageBox | ( | LPCTSTR | lpszText,
 |  | LPCTSTR | lpszTitle,
 |  | LPCTSTR | lpszFile,
 |  | INT | Line
 | ) |  |

Definition at line 715 of file DebMisc.c.

{
  #define ERROR_BUFFER_SIZE 512

  static TCHAR Format[] =
    TEXT( "%s\n\n"                                  )
    TEXT( "-- Error Information --\n"               )
    TEXT( "File : %s\n"                             )
    TEXT( "Line : %d\n"                             )
    TEXT( "Error Number : %d\n"                     )
    TEXT( "Error Message : %s\n"                    )
    TEXT( "\n"                                      )
    TEXT( "Press OK to terminate this application." );

  LPTSTR lpFormatMessageBuffer;
  DWORD  dwFormatMessage;
  DWORD  dwGetLastError;
  HLOCAL hMessageBoxBuffer;
  LPVOID lpMessageBoxBuffer;

  //-- perform a simple check on the needed buffer size
  if( lstrlen(lpszText) > (ERROR_BUFFER_SIZE - lstrlen(Format)) )
    return( FALSE );

  //-- allocate the message box buffer
  hMessageBoxBuffer  = LocalAlloc( LMEM_MOVEABLE, ERROR_BUFFER_SIZE );
  lpMessageBoxBuffer = LocalLock( hMessageBoxBuffer );

  //-- get the system error and system error message
  dwGetLastError = GetLastError();
  dwFormatMessage = FormatMessage(
                      FORMAT_MESSAGE_ALLOCATE_BUFFER
                      | FORMAT_MESSAGE_FROM_SYSTEM,
                      0L, dwGetLastError, LANG_NEUTRAL,
                      (LPTSTR) &lpFormatMessageBuffer, 0, 0L );
  if( !dwFormatMessage )
    lpFormatMessageBuffer = TEXT("FormatMessage() failed!");

  //-- format the error messge box string
  if (StringCbPrintf( lpMessageBoxBuffer, sizeof(lpMessageBoxBuffer), Format, lpszText, lpszFile, Line,
        dwGetLastError, lpFormatMessageBuffer ) > 0)
  {
    // -- display the error and allow the user to terminate or continue
    if( MessageBox( 0L, lpMessageBoxBuffer, lpszTitle,
          MB_APPLMODAL | MB_ICONSTOP | MB_OKCANCEL )
      == IDOK )
      ExitProcess( 0 );
  }

  //-- free all buffers
  if( dwFormatMessage )
    LocalFree( (HLOCAL) lpFormatMessageBuffer );
  LocalFree( (HLOCAL) hMessageBoxBuffer );

  return( TRUE );
}

BOOL GetDebuggeeFileName | ( | LPTSTR | lpszDebuggeeFileName,
 |  | HWND | hWnd
 | ) |  |

Definition at line 252 of file DebMisc.c.

{
  static BOOL  fFirstTime = TRUE;
  static TCHAR szFilter[128]         = TEXT("");
  static TCHAR szTitle[64]           = TEXT("");
  static TCHAR szFileTitle[MAX_PATH] = TEXT("");
  static TCHAR szFile[MAX_PATH]      = TEXT("");
  static TCHAR szDefExt[8]           = TEXT("");
  static OPENFILENAME OpenFileName;

  //-- Load resource strings and init the OpenFileName struct
  //   (do this only one time)
  if( fFirstTime ) {
    static UINT FilterNameLen;

    fFirstTime = FALSE;
    FilterNameLen = (UINT) LoadString( 0L, IDS_OFN_FILTERNAME,
                             szFilter, sizeof(szFilter)/sizeof(TCHAR) );
    FilterNameLen++;
    LoadString( 0L, IDS_OFN_FILTER, &szFilter[FilterNameLen],
      sizeof(szFilter)/sizeof(TCHAR)-FilterNameLen );
    LoadString( 0L, IDS_OFN_TITLE, szTitle, sizeof(szTitle)/sizeof(TCHAR) );

    OpenFileName.lStructSize       = sizeof(OPENFILENAME);
    OpenFileName.hwndOwner         = hWnd;
    OpenFileName.hInstance         = (HANDLE) 0L;
    OpenFileName.lpstrFilter       = szFilter;
    OpenFileName.lpstrCustomFilter = 0L;
    OpenFileName.nMaxCustFilter    = 0L;
    OpenFileName.nFilterIndex      = 1L;
    OpenFileName.lpstrFile         = szFile;
    OpenFileName.nMaxFile          = sizeof(szFile)/sizeof(TCHAR);
    OpenFileName.lpstrFileTitle    = szFileTitle;
    OpenFileName.nMaxFileTitle     = sizeof(szFileTitle)/sizeof(TCHAR);
    OpenFileName.lpstrInitialDir   = (Profile.fSavedDirectory ? Profile.szInitialDir : 0L);
    OpenFileName.lpstrTitle        = (LPTSTR) szTitle;
    OpenFileName.Flags             = OFN_HIDEREADONLY;
    OpenFileName.nFileOffset       = (WORD) 0L;
    OpenFileName.nFileExtension    = (WORD) 0L;
    OpenFileName.lpstrDefExt       = szDefExt;
    OpenFileName.lCustData         = 0L;
    OpenFileName.lpfnHook          = (LPOFNHOOKPROC) 0L;
    OpenFileName.lpTemplateName    = (LPTSTR) 0L;
  }

  if( !GetOpenFileName( &OpenFileName ) ) {
    return( FALSE );
  }

  //-- store recent directory by stripping off the EXE name from the full path
  GetPathFromFullPathName( (LPTSTR) OpenFileName.lpstrFile, Profile.szInitialDir,
    sizeof(Profile.szInitialDir)/sizeof(TCHAR) );

  //-- copy name to return buffer
  lstrcpyn( lpszDebuggeeFileName, OpenFileName.lpstrFile, MAX_PATH );

  return( TRUE );
}

UINT GetPathFromFullPathName | ( | LPCTSTR | lpFullPathName,
 |  | LPTSTR | lpPathBuffer,
 |  | UINT | nPathBufferLength
 | ) |  |

Definition at line 816 of file DebMisc.c.

{
  UINT nLength;
  int i, j;

  if( (nLength = (UINT) lstrlen( lpFullPathName ) ) >= nPathBufferLength )
    return( nLength );

  StringCbCopy( lpPathBuffer, sizeof(lpPathBuffer), lpFullPathName );

  for( j = 0, i = nLength; (UINT)j < nLength;
                  j += IsDBCSLeadByte(lpPathBuffer[j]) ? 2 : 1){
      if( lpPathBuffer[j] == '\\' || lpPathBuffer[j] == ':' ){
          i = j;
      }
  }
  if( lpPathBuffer[i] == ':' )
    lpPathBuffer[i+1] = '\0';
  else
    lpPathBuffer[i] = '\0';

  return( (UINT) i );
}

BOOL GetPrivateProfileSettings | ( | LPCTSTR | lpszAppTitle,
 |  | LPCTSTR | lpszIniPathName,
 |  | PPROFILE | pProfile
 | ) |  |

Definition at line 537 of file DebMisc.c.

{
  pProfile->xPos       = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "xPos" ),       CW_USEDEFAULT, lpszIniPathName );
  pProfile->yPos       = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "yPos" ),       CW_USEDEFAULT, lpszIniPathName );
  pProfile->nWidth     = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "nWidth" ),     CW_USEDEFAULT, lpszIniPathName );
  pProfile->nHeight    = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "nHeight" ),    CW_USEDEFAULT, lpszIniPathName );
  pProfile->fMaximized = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fMaximized" ), (INT) FALSE,   lpszIniPathName );
  pProfile->fMinimized = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fMinimized" ), (INT) FALSE,   lpszIniPathName );

  pProfile->fToolBar         = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fToolBar" ),         (INT) TRUE,  lpszIniPathName );
  pProfile->fSavedDirectory  = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fSavedDirectory" ),  (INT) TRUE,  lpszIniPathName );
  GetPrivateProfileString( lpszAppTitle, TEXT( "szInitialDir" ), 0L, pProfile->szInitialDir,
    sizeof( pProfile->szInitialDir )/sizeof(TCHAR), lpszIniPathName );

  pProfile->LogFont.lfHeight         = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfHeight" ),         (INT) 13   ,       lpszIniPathName );
  pProfile->LogFont.lfWidth          = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfWidth" ),          (INT) 0    ,       lpszIniPathName );
  pProfile->LogFont.lfWeight         = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfWeight" ),         (INT) 400  ,       lpszIniPathName );
  pProfile->LogFont.lfItalic         = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfItalic" ),         (INT) FALSE,       lpszIniPathName );
  pProfile->LogFont.lfUnderline      = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfUnderline" ),      (INT) FALSE,       lpszIniPathName );
  pProfile->LogFont.lfStrikeOut      = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfStrikeOut" ),      (INT) FALSE,       lpszIniPathName );
  pProfile->LogFont.lfPitchAndFamily = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfPitchAndFamily" ), (INT) FF_DONTCARE, lpszIniPathName );
  GetPrivateProfileString( lpszAppTitle, TEXT( "lfFaceName" ), TEXT( "System" ), pProfile->LogFont.lfFaceName,
    LF_FACESIZE, lpszIniPathName );
  pProfile->rgbForeColor = (COLORREF) GetPrivateProfileInt( lpszAppTitle, TEXT( "rgbForeColor" ),
                            (INT) GetSysColor(COLOR_WINDOWTEXT), lpszIniPathName );
  pProfile->rgbBackColor = (COLORREF) GetPrivateProfileInt( lpszAppTitle, TEXT( "rgbBackColor" ),
                            (INT) GetSysColor(COLOR_WINDOW), lpszIniPathName );

  pProfile->fClearOnNew      = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fClearOnNew" ),      (INT) TRUE,  lpszIniPathName );
  pProfile->fVerbose         = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fVerbose" ),         (INT) FALSE, lpszIniPathName );
  pProfile->fShowSymbols     = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fShowSymbols" ),     (INT) FALSE, lpszIniPathName );
  pProfile->DebugMode        = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "DebugMode" ),        (INT) DEBUG_PROCESS        , lpszIniPathName );
  pProfile->DebuggeePriority = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "DebuggeePriority" ), (INT) NORMAL_PRIORITY_CLASS, lpszIniPathName );
  pProfile->DebugErrorLevel  = (DWORD) GetPrivateProfileInt( lpszAppTitle, TEXT( "DebugErrorLevel" ), (INT) 0, lpszIniPathName );
  pProfile->fSavePreferences = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fSavePreferences" ), (INT) FALSE, lpszIniPathName );

  pProfile->fSaveOnExit      = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fSaveOnExit" ),      (INT) TRUE,  lpszIniPathName );

  return( TRUE );
}

LRESULT ListBoxInsert | ( | HWND | hWndListBox,
 |  | LPLONG | lpMaxStrLen,
 |  | LPCTSTR | lpszString
 | ) |  |

Definition at line 932 of file DebMisc.c.

{
  static LONG MaxTextExtent = 0;

  LRESULT     Index;

  if( lpszString == 0L ) {
    MaxTextExtent = 0;
    SendMessage( hWndListBox, LB_SETHORIZONTALEXTENT, 0, 0 );
    return( 0 );
  }

  if( hWndListBox != 0L ) {
    HDC  hDC;
    SIZE Size;
    LONG StrLen;

    if( (StrLen = lstrlen( lpszString)) > *lpMaxStrLen )
      *lpMaxStrLen = StrLen;
    hDC = GetDC( hWndListBox );
    GetTextExtentPoint( hDC, lpszString, StrLen, &Size );
    ReleaseDC( hWndListBox, hDC );
    if( Size.cx > MaxTextExtent ) {
      MaxTextExtent = Size.cx;
      SendMessage( hWndListBox, LB_SETHORIZONTALEXTENT, (WPARAM) (MaxTextExtent*1.1), 0 );
    }
    Index = SendMessage( hWndListBox, LB_ADDSTRING, 0, (LPARAM) lpszString );
    SendMessage( hWndListBox, LB_SETCURSEL, Index, 0 );
  }

  return( Index );
}

LRESULT ListBoxPrintF | ( | HWND | hWndListBox,
 |  | LPCTSTR | szFormat,
 |  |  | ...
 | ) |  |

Definition at line 972 of file DebMisc.c.

{
  static TCHAR szBuffer[ 1024 ];

  va_list  valist;
  LRESULT  Index;
  LPTSTR   lpCurrentString, lpCurrentChar;

  va_start( valist, szFormat );
  StringCchVPrintf( szBuffer, sizeof(szBuffer)/sizeof(TCHAR), szFormat, valist );
  szBuffer[sizeof(szBuffer)/sizeof(TCHAR) - 1] = 0;
  va_end( valist );

  //-- insert strings line-by-line
  for( lpCurrentString = lpCurrentChar = szBuffer; *lpCurrentChar != '\0'; ) {
    if( *lpCurrentChar == '\n' ) {
      LPTSTR lpNextChar = CharNext( lpCurrentChar );
      *lpCurrentChar = '\0';
      Index = ListBoxInsert( hWndListBox, &(Global.MaxStrLen), lpCurrentString );
      lpCurrentString = lpCurrentChar = lpNextChar;
    }
    else
      lpCurrentChar = CharNext( lpCurrentChar );
  }
  Index = ListBoxInsert( hWndListBox, &(Global.MaxStrLen), lpCurrentString );

  return( Index );
}

BOOL MakeCommonDebugEventString | ( | LPTSTR | lpszBuffer,
 |  | DWORD | cchBuffer,
 |  | LPDEBUG_EVENT | lpDebugEvent
 | ) |  |

Definition at line 443 of file DebMisc.c.

{
  StringPrintF( lpszBuffer, cchBuffer, TEXT( "PID:0x%X \t TID:0x%X \t " ),
    lpDebugEvent->dwProcessId, lpDebugEvent->dwThreadId );

  return( TRUE );
}

BOOL MaxDebuggeesMessageBox ( HWND hWndOwner )

Definition at line 688 of file DebMisc.c.

{
  MessageBox( hWndOwner,
    TEXT( "This build of the Debug Event Browser\n" )
    TEXT( "is limited to debugging only one debuggee\n" )
    TEXT( "at a time." ),
    TEXT( "Cannot Open Debuggee" ),
    MB_OK | MB_ICONEXCLAMATION );

  return( TRUE );
}

BOOL OutOfMemoryMessageBox ( HWND hWndOwner )

Definition at line 670 of file DebMisc.c.

{
  MessageBox(
    hWndOwner,
    TEXT( "Out of Memory" ),
    TEXT( "Memory Error" ),
    MB_ICONSTOP | MB_APPLMODAL );

  return( TRUE );
}

LRESULT SendWmSizeMessage ( HWND hWnd )

Definition at line 798 of file DebMisc.c.

{
  RECT Rect;

  if( !GetClientRect( hWnd, &Rect ) )
    return( FALSE );

  return( SendMessage( hWnd, WM_SIZE, SIZENORMAL,
            MAKELONG( Rect.right - Rect.left, Rect.bottom - Rect.top) ) );
}

BOOL StartDebuggee | ( | LPTSTR | lpszDebuggeeFileName,
 |  | HWND | hWndListBox
 | ) |  |

Definition at line 66 of file DebMisc.c.

{
  static PDEB_STARTUP_INFO pDebStartupInfo;
  static BOOL              fFirstTime = TRUE;

  static TCHAR szDebuggeeTitle[128];

  HANDLE hDebugEventThread;
  DWORD  idDebugEventThread;

  //-- Load resource strings and init the OpenFileName struct
  //   (do this only one time)
  if( fFirstTime ) {
    fFirstTime = FALSE;
    LoadString( 0L, IDS_OFN_DEBUGGEE_TITLE, szDebuggeeTitle,
      sizeof(szDebuggeeTitle)/sizeof(TCHAR) );
  }

  //-- allocate the Debuggee Information structure
  pDebStartupInfo = 0L;
  pDebStartupInfo = (PDEB_STARTUP_INFO) VirtualAlloc(
                                    pDebStartupInfo,
                                    sizeof( DEB_STARTUP_INFO ),
                                    MEM_RESERVE | MEM_COMMIT,
                                    PAGE_READWRITE );

  //-- init the StartupInfo struct
  (pDebStartupInfo->StartupInfo).cb          = sizeof( STARTUPINFO );
  (pDebStartupInfo->StartupInfo).lpDesktop   = 0L;
  (pDebStartupInfo->StartupInfo).lpTitle     = szDebuggeeTitle;
  (pDebStartupInfo->StartupInfo).dwX         = 0;
  (pDebStartupInfo->StartupInfo).dwY         = 0;
  (pDebStartupInfo->StartupInfo).dwXSize     = 0;
  (pDebStartupInfo->StartupInfo).dwYSize     = 0;
  (pDebStartupInfo->StartupInfo).dwFlags     = 0L;
  (pDebStartupInfo->StartupInfo).wShowWindow = SW_SHOWDEFAULT;

  (pDebStartupInfo->ProcessInfo).hProcess = 0L;

  //-- init other debuggee info
  pDebStartupInfo->fActive       = FALSE;
  pDebStartupInfo->dwProcessId   = 0L;
  pDebStartupInfo->lpstrFileName = 0L;
  pDebStartupInfo->lpstrPathName = lpszDebuggeeFileName;
  pDebStartupInfo->hWndListBox   = hWndListBox;

  //-- now start and detach the debug event processing thread
  if( !( hDebugEventThread = CreateThread(
                               (LPSECURITY_ATTRIBUTES) 0L,
                               (DWORD) 0,
                               (LPTHREAD_START_ROUTINE) DebugEventThread,
                               (LPVOID) pDebStartupInfo,
                               0L,
                               (LPDWORD) &idDebugEventThread) ) ) {

    VirtualFree( pDebStartupInfo, 0, MEM_RELEASE );
    return( FALSE );
  }
  else{
    CloseHandle( hDebugEventThread );
  }

  return( TRUE );
}

BOOL StringAppendF | ( | LPTSTR | lpszBuffer,
 |  | DWORD | cchBuffer,
 |  | LPCTSTR | szFormat,
 |  |  | ...
 | ) |  |

Definition at line 1031 of file DebMisc.c.

{
  static TCHAR szLgBuffer[1024];

  va_list valist;
  int n, cur, left;

  //-- add event specific information
  va_start( valist, szFormat );
  n = StringCchVPrintf( szLgBuffer, sizeof(szLgBuffer)/sizeof(TCHAR),
                   szFormat, valist );
  if (n < 1)
  {
      szLgBuffer[sizeof(szLgBuffer)/sizeof(TCHAR) - 1] = 0;
      n = sizeof(szLgBuffer)/sizeof(TCHAR);
  }
  va_end( valist );

  //-- append information to the string buffer
  cur = lstrlen(lpszBuffer);
  left = (int)cchBuffer - cur;
  if (n > left)
  {
      n = left;
  }
  lstrcpyn( lpszBuffer + cur, szLgBuffer, n );

  return( TRUE );
}

LPTSTR StringPrintF | ( | LPTSTR | lpString,
 |  | DWORD | cchString,
 |  | LPCTSTR | szFormat,
 |  |  | ...
 | ) |  |

Definition at line 1010 of file DebMisc.c.

{
  va_list valist;

  va_start( valist, szFormat );
  StringCchVPrintf( lpString, cchString, szFormat, valist );
  lpString[cchString - 1] = 0;
  va_end( valist );

  return( lpString );
}

WNDPROC SubclassWindow | ( | HWND | hWnd,
 |  | WNDPROC | NewWndProc
 | ) |  |

Definition at line 781 of file DebMisc.c.

{
  WNDPROC OldWndProc;

  OldWndProc = (WNDPROC) GetWindowLongPtr( hWnd, GWLP_WNDPROC );
  SetWindowLongPtr( hWnd, GWLP_WNDPROC, (LONG_PTR) NewWndProc );

  return OldWndProc;
}

BOOL UpdateMenuSettings ( HWND hWnd )

Definition at line 651 of file DebMisc.c.

{
  if( Profile.fToolBar )
    CheckMenuItem( GetMenu(hWnd), IDM_OPTIONS_TOOLBAR, MF_CHECKED );
  if( Profile.fSavedDirectory )
    CheckMenuItem( GetMenu(hWnd), IDM_OPTIONS_SAVEDDIR, MF_CHECKED );
  if( Profile.fSaveOnExit )
    CheckMenuItem( GetMenu(hWnd), IDM_OPTIONS_SAVEONEXIT, MF_CHECKED );

  return( TRUE );
}

BOOL WritePrivateProfileInt | ( | LPCTSTR | lpAppName,
 |  | LPCTSTR | lpKeyName,
 |  | INT | Value,
 |  | LPCTSTR | lpFileName
 | ) |  |

Definition at line 635 of file DebMisc.c.

{
  TCHAR ValBuf[16];

  StringCbPrintf( ValBuf,sizeof(ValBuf) ,TEXT( "%i" ), Value);

  return( WritePrivateProfileString( lpAppName, lpKeyName, ValBuf, lpFileName ) );
}

BOOL WritePrivateProfileSettings | ( | LPCTSTR | lpszAppTitle,
 |  | LPCTSTR | lpszIniPathName,
 |  | PPROFILE | pProfile
 | ) |  |

Definition at line 586 of file DebMisc.c.

{
  if( pProfile->fSaveOnExit ) {
    WritePrivateProfileInt( lpszAppTitle, TEXT( "xPos" ),       (INT) pProfile->xPos,       lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "yPos" ),       (INT) pProfile->yPos,       lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "nWidth" ),     (INT) pProfile->nWidth,     lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "nHeight" ),    (INT) pProfile->nHeight,    lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fMaximized" ), (INT) pProfile->fMaximized, lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fMinimized" ), (INT) pProfile->fMinimized, lpszIniPathName );

    WritePrivateProfileInt( lpszAppTitle, TEXT( "fToolBar" ),         (INT) pProfile->fToolBar,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fSavedDirectory" ),  (INT) pProfile->fSavedDirectory,  lpszIniPathName );
    WritePrivateProfileString( lpszAppTitle, TEXT( "szInitialDir" ), pProfile->szInitialDir, lpszIniPathName );

    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfHeight" ),         (INT) pProfile->LogFont.lfHeight,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfWidth" ),          (INT) pProfile->LogFont.lfWidth,          lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfWeight" ),         (INT) pProfile->LogFont.lfWeight,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfItalic" ),         (INT) pProfile->LogFont.lfItalic,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfUnderline" ),      (INT) pProfile->LogFont.lfUnderline,      lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfStrikeOut" ),      (INT) pProfile->LogFont.lfStrikeOut,      lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfPitchAndFamily" ), (INT) pProfile->LogFont.lfPitchAndFamily, lpszIniPathName );
    WritePrivateProfileString( lpszAppTitle, TEXT( "lfFaceName" ), pProfile->LogFont.lfFaceName, lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "rgbForeColor" ), (INT) pProfile->rgbForeColor, lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "rgbBackColor" ), (INT) pProfile->rgbBackColor, lpszIniPathName );

    if( pProfile->fSavePreferences ) {
      WritePrivateProfileInt( lpszAppTitle, TEXT( "fClearOnNew" ),  (INT) pProfile->fClearOnNew,  lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "fVerbose" ),     (INT) pProfile->fVerbose,     lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "fShowSymbols" ), (INT) pProfile->fShowSymbols, lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "DebugMode" ),        (INT) pProfile->DebugMode,        lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "DebuggeePriority" ), (INT) pProfile->DebuggeePriority, lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "DebugErrorLevel" ), (INT) pProfile->DebugErrorLevel, lpszIniPathName );
    }
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fSavePreferences" ), (INT) pProfile->fSavePreferences, lpszIniPathName );
  }
  WritePrivateProfileInt( lpszAppTitle, TEXT( "fSaveOnExit" ), (INT) pProfile->fSaveOnExit, lpszIniPathName );

  return( TRUE );
}

Generated on Wed Nov 13 2024 16:55:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebMisc.h File Reference

  • WinBase
  • Debug
  • Deb
Functions

DebMisc.h File Reference

#include "DEBDebug.H"
#include "DEBMain.H"

Go to the source code of this file.

Functions

BOOL | AttachToDebuggee (DWORD, HWND)
BOOL | ChooseNewBackColor (HWND)
BOOL | ChooseNewFont (HWND)
BOOL | CopyListBoxToClipboard (HWND, LONG)
HWND | CreateIconWindow (HWND, LPCTSTR)
HWND | CreateTextButtonBar (HWND, LPINT)
BOOL CALLBACK | EnumProcessListFunc (HWND, LPARAM)
BOOL | ErrorMessageBox (LPCTSTR, LPCTSTR, LPCTSTR, INT)
BOOL | GetDebuggeeFileName (LPTSTR, HWND)
UINT | GetPathFromFullPathName (LPCTSTR, LPTSTR, UINT)
BOOL | GetPrivateProfileSettings (LPCTSTR, LPCTSTR, PPROFILE)
LRESULT | ListBoxInsert (HWND, LPLONG, LPCTSTR)
LRESULT | ListBoxPrintF (HWND, LPCTSTR,...)
BOOL | MakeCommonDebugEventString (LPTSTR, DWORD, LPDEBUG_EVENT)
BOOL | MaxDebuggeesMessageBox (HWND)
BOOL | OutOfMemoryMessageBox (HWND)
LRESULT | SendWmSizeMessage (HWND)
BOOL | StartDebuggee (LPTSTR, HWND)
BOOL | StringAppendF (LPTSTR, DWORD, LPCTSTR,...)
LPTSTR | StringPrintF (LPTSTR, DWORD, LPCTSTR,...)
WNDPROC | SubclassWindow (HWND, WNDPROC)
BOOL | UpdateMenuSettings (HWND)
BOOL | WritePrivateProfileInt (LPCTSTR, LPCTSTR, INT, LPCTSTR)
BOOL | WritePrivateProfileSettings (LPCTSTR, LPCTSTR, PPROFILE)

Function Documentation

BOOL AttachToDebuggee | ( | DWORD | ,
 |  | HWND |
 | ) |  |

Definition at line 139 of file DebMisc.c.

{
  static PDEB_STARTUP_INFO pDebStartupInfo;
  static BOOL              fFirstTime = TRUE;

  static TCHAR szDebuggeeTitle[128];

  HANDLE hDebugEventThread;
  DWORD  idDebugEventThread;

  //-- Load resource strings and init the OpenFileName struct
  //   (do this only one time)
  if( fFirstTime ) {
    fFirstTime = FALSE;
    LoadString( 0L, IDS_OFN_DEBUGGEE_TITLE, szDebuggeeTitle,
      sizeof(szDebuggeeTitle)/sizeof(TCHAR) );
  }

  //-- allocate the Debuggee Information structure
  pDebStartupInfo = 0L;
  pDebStartupInfo = (PDEB_STARTUP_INFO) VirtualAlloc(
                                    pDebStartupInfo,
                                    sizeof( DEB_STARTUP_INFO ),
                                    MEM_RESERVE | MEM_COMMIT,
                                    PAGE_READWRITE );

  //-- init the StartupInfo struct
  (pDebStartupInfo->StartupInfo).cb          = sizeof( STARTUPINFO );
  (pDebStartupInfo->StartupInfo).lpDesktop   = 0L;
  (pDebStartupInfo->StartupInfo).lpTitle     = szDebuggeeTitle;
  (pDebStartupInfo->StartupInfo).dwX         = 0;
  (pDebStartupInfo->StartupInfo).dwY         = 0;
  (pDebStartupInfo->StartupInfo).dwXSize     = 0;
  (pDebStartupInfo->StartupInfo).dwYSize     = 0;
  (pDebStartupInfo->StartupInfo).dwFlags     = 0L;
  (pDebStartupInfo->StartupInfo).wShowWindow = SW_SHOWDEFAULT;

  (pDebStartupInfo->ProcessInfo).hProcess = 0L;

  //-- init other debuggee info
  pDebStartupInfo->fActive       = TRUE;
  pDebStartupInfo->dwProcessId   = dwProcessId;
  pDebStartupInfo->lpstrFileName = 0L;
  pDebStartupInfo->lpstrPathName = 0L;
  pDebStartupInfo->hWndListBox   = hWndListBox;

  //-- now start and detach the debug event processing thread
  if( !( hDebugEventThread = CreateThread(
                               (LPSECURITY_ATTRIBUTES) 0L,
                               (DWORD) 0,
                               (LPTHREAD_START_ROUTINE) DebugEventThread,
                               (LPVOID) pDebStartupInfo,
                               0L,
                               (LPDWORD) &idDebugEventThread) ) ) {

    VirtualFree( pDebStartupInfo, 0, MEM_RELEASE );
    return( FALSE );
  }
  else{
    CloseHandle( hDebugEventThread );
  }

  return( TRUE );
}

BOOL ChooseNewBackColor ( HWND )

Definition at line 395 of file DebMisc.c.

{
  static BOOL        fFirstTime = TRUE;
  static CHOOSECOLOR ChooseColorStruct;
  static DWORD       dwCustColors[16];

  if( fFirstTime ) {
    int i;

    fFirstTime = FALSE;

    //-- set the custom colors to white
    for( i = 0; i < 16; i++ )
      dwCustColors[i] = RGB(255,255,255);

    ChooseColorStruct.lStructSize    = sizeof( CHOOSECOLOR );
    ChooseColorStruct.hwndOwner      = hWndListBox;
    ChooseColorStruct.hInstance      = (HANDLE) 0L;
    ChooseColorStruct.rgbResult      = Profile.rgbBackColor;
    ChooseColorStruct.lpCustColors   = (LPDWORD) dwCustColors;
    ChooseColorStruct.Flags          = CC_RGBINIT;
    ChooseColorStruct.lCustData      = 0L;
    ChooseColorStruct.lpfnHook       = (LPCCHOOKPROC) 0L;
    ChooseColorStruct.lpTemplateName = (LPTSTR) 0L;
  }

  if( ChooseColor( &ChooseColorStruct ) ) {
    HDC    hDC;

    Profile.rgbBackColor = (COLORREF) ChooseColorStruct.rgbResult;
    hDC = GetDC( hWndListBox );
    SendMessage( hWndListBox, WM_CTLCOLORLISTBOX, (DWORD_PTR) hDC,
      (LONG_PTR) hWndListBox );
    ReleaseDC( hWndListBox, hDC );
    InvalidateRect( hWndListBox, 0L, TRUE );
  }

  return( TRUE );
}

BOOL ChooseNewFont ( HWND )

Definition at line 343 of file DebMisc.c.

{
  static CHOOSEFONT ChooseFontStruct;
  static BOOL       fFirstTime = TRUE;
  HFONT             hFont;

  if( fFirstTime ) {
    fFirstTime = FALSE;

    ChooseFontStruct.lStructSize    = sizeof( CHOOSEFONT );
    ChooseFontStruct.hwndOwner      = hWndListBox;
    ChooseFontStruct.hDC            = (HDC) 0L;
    ChooseFontStruct.lpLogFont      = &(Profile.LogFont);
    ChooseFontStruct.iPointSize     = (INT) 0L;
    ChooseFontStruct.Flags          = CF_INITTOLOGFONTSTRUCT |
                                      CF_SCREENFONTS | CF_EFFECTS |
                                      CF_ENABLEHOOK;
    ChooseFontStruct.rgbColors      = Profile.rgbForeColor;
    ChooseFontStruct.lCustData      = 0L;
    ChooseFontStruct.lpfnHook       = (LPCFHOOKPROC) ChooseFontHookProc;
    ChooseFontStruct.lpTemplateName = (LPTSTR) 0L;
    ChooseFontStruct.hInstance      = (HANDLE) 0L;
    ChooseFontStruct.lpszStyle      = (LPTSTR) 0L;
    ChooseFontStruct.nFontType      = SCREEN_FONTTYPE;
    ChooseFontStruct.nSizeMin       = (INT) 0L;
    ChooseFontStruct.nSizeMax       = (INT) 0L;
  }

  if( ChooseFont( &ChooseFontStruct ) ) {
    HDC    hDC;

    hFont = CreateFontIndirect( &(Profile.LogFont) );
    hDC = GetDC( hWndListBox );
    SelectObject( hDC, hFont );
    Profile.rgbForeColor = ChooseFontStruct.rgbColors;
    InvalidateRect( hWndListBox, 0L, TRUE );
    SendMessage( hWndListBox, WM_CTLCOLORLISTBOX, (DWORD_PTR) hDC,
      (LONG_PTR) hWndListBox );
    SendMessage( hWndListBox, WM_SETFONT, (DWORD_PTR) hFont, TRUE );
    ReleaseDC( hWndListBox, hDC );
  }

  return( TRUE );
}

BOOL CopyListBoxToClipboard | ( | HWND | ,
 |  | LONG |
 | ) |  |

Definition at line 848 of file DebMisc.c.

{
  LPTSTR  lpDataBuffer;
  HGLOBAL hDataBuffer;

  TCHAR  TempBuffer[256];
  DWORD  dwItemCount;
  DWORD  Count;
  LRESULT   StrLen;
  DWORD  dwMemSize;

  dwItemCount = (DWORD) SendMessage( hWndListBox, LB_GETCOUNT, 0 , 0 );
  dwMemSize = dwItemCount * (DWORD) MaxStrLen;

  //-- limit the size copied to the clipboard
  if( dwMemSize > 0xFFFFF )
    dwMemSize = 0xFFFFF;

  if( !(hDataBuffer = GlobalAlloc( GMEM_DDESHARE, dwMemSize ) ) ) {
    OutOfMemoryMessageBox( GetFocus() );
    return( FALSE );
  }
  if( !(lpDataBuffer = (LPTSTR) GlobalLock( hDataBuffer ) ) ) {
    GlobalFree( hDataBuffer );
    OutOfMemoryMessageBox( GetFocus() );
    return( FALSE );
  }

  *lpDataBuffer = '\0';

  for( Count = 0; Count < dwItemCount; Count++ ) {
    StrLen = SendMessage( hWndListBox, LB_GETTEXTLEN, Count, 0L );
    if( StrLen > (sizeof(TempBuffer)/sizeof(TCHAR)-3) )
      continue;
    if( lstrlen(lpDataBuffer) + StrLen > (dwMemSize/sizeof(TCHAR)-3))
        break;
    StrLen = SendMessage( hWndListBox, LB_GETTEXT, Count, (LPARAM) TempBuffer );
    TempBuffer[StrLen]   = '\r';
    TempBuffer[StrLen+1] = '\n';
    TempBuffer[StrLen+2] = '\0';
    StringCbCat( lpDataBuffer, sizeof(lpDataBuffer),TempBuffer );
  }

  GlobalUnlock( hDataBuffer );

  if( !OpenClipboard( hWndListBox ) ) {
    Sleep( 250 );  // wait a quarter second and try again.
    if( !OpenClipboard( hWndListBox ) ) {
      MessageBox( GetFocus(),
        TEXT( "Could not open the Clipboard!" ),
        TEXT( "Cannot Open Clipboard" ),
        MB_ICONSTOP | MB_APPLMODAL );
      GlobalFree( hDataBuffer );
      return( FALSE );
    }
  }
  if( !EmptyClipboard() ) {
    MessageBox( GetFocus(),
      TEXT( "Could not empty the Clipboard!" ),
      TEXT( "Cannot Empty Clipboard" ),
      MB_ICONSTOP | MB_APPLMODAL );
    GlobalFree( hDataBuffer );
    return( FALSE );
  }
  if( !SetClipboardData( CF_TEXT, hDataBuffer ) ) {
    MessageBox( GetFocus(),
      TEXT( "Could not copy data to the Clipboard!" ),
      TEXT( "Cannot Set Clipboard Data" ),
      MB_ICONSTOP | MB_APPLMODAL );
    GlobalFree( hDataBuffer );
    return( FALSE );
  }
  CloseClipboard();

  return( TRUE );
}

HWND CreateIconWindow | ( | HWND | ,
 |  | LPCTSTR |
 | ) |  |

Definition at line 521 of file DebMisc.c.

{
  return ( CreateWindow( TEXT( "static" ), lpstrIcon,
             WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | SS_ICON,
             7, 5, 0, 0,
             hDlg, 0L, GetModuleHandle( 0L ), 0L ) );
}

HWND CreateTextButtonBar | ( | HWND | ,
 |  | LPINT |
 | ) |  |

Definition at line 458 of file DebMisc.c.

{
  TEXTBUTTON   TextButton[9];
  static TCHAR szButtonOpen[32];
  static TCHAR szButtonAttach[32];
  static TCHAR szButtonCut[32];
  static TCHAR szButtonCopy[32];
  static TCHAR szButtonDelete[32];
  static TCHAR szButtonHelp[32];

  LoadString( 0L, IDS_BUTTON_OPEN,   szButtonOpen,   sizeof(szButtonOpen)/sizeof(TCHAR)   );
  LoadString( 0L, IDS_BUTTON_ATTACH, szButtonAttach, sizeof(szButtonAttach)/sizeof(TCHAR) );
  LoadString( 0L, IDS_BUTTON_CUT,    szButtonCut,    sizeof(szButtonCut)/sizeof(TCHAR)    );
  LoadString( 0L, IDS_BUTTON_COPY,   szButtonCopy,   sizeof(szButtonCopy)/sizeof(TCHAR)   );
  LoadString( 0L, IDS_BUTTON_DELETE, szButtonDelete, sizeof(szButtonDelete)/sizeof(TCHAR) );
  LoadString( 0L, IDS_BUTTON_HELP,   szButtonHelp,   sizeof(szButtonHelp)/sizeof(TCHAR)   );

  TextButton[0].lpButtonText = szButtonOpen;
  TextButton[0].idButton     = IDM_FILE_OPEN;
  TextButton[0].hWndButton   = 0L;

  TextButton[1].lpButtonText = szButtonAttach;
  TextButton[1].idButton     = IDM_FILE_ATTACH;
  TextButton[1].hWndButton   = 0L;

  TextButton[2].lpButtonText = 0L;
  TextButton[2].idButton     = TB_SPACE;
  TextButton[2].hWndButton   = 0L;

  TextButton[3].lpButtonText = szButtonCut;
  TextButton[3].idButton     = IDM_EDIT_CUT;
  TextButton[3].hWndButton   = 0L;

  TextButton[4].lpButtonText = szButtonCopy;
  TextButton[4].idButton     = IDM_EDIT_COPY;
  TextButton[4].hWndButton   = 0L;

  TextButton[5].lpButtonText = szButtonDelete;
  TextButton[5].idButton     = IDM_EDIT_DELETE;
  TextButton[5].hWndButton   = 0L;

  TextButton[6].lpButtonText = 0L;
  TextButton[6].idButton     = TB_SPACE;
  TextButton[6].hWndButton   = 0L;

  TextButton[7].lpButtonText = szButtonHelp;
  TextButton[7].idButton     = IDM_HELP_CONTENTS;
  TextButton[7].hWndButton   = 0L;

  TextButton[8].lpButtonText = (LPTSTR) 0L;
  TextButton[8].idButton     = (INT)   0L;
  TextButton[8].hWndButton   = (HWND)  0L;

  return( TextButtonBar( hWndParent, TextButton, lpTextButtonBarHeight ) );
}

BOOL CALLBACK EnumProcessListFunc | ( | HWND | ,
 |  | LPARAM |
 | ) |  |

Definition at line 212 of file DebMisc.c.

{
  static DWORD dwCurrentProcessId;
  static BOOL  fFirstTime = TRUE;
  static LONG  MaxStrLen  = 0;
  static TCHAR TextBuffer[256];

  if( fFirstTime ) {
    fFirstTime = FALSE;
    dwCurrentProcessId = GetCurrentProcessId();
  }

  if( hWnd ) {
    GetWindowText( hWnd, (LPTSTR) &TextBuffer, sizeof(TextBuffer)/sizeof(TCHAR) );
    if( *TextBuffer ) {
      DWORD  dwProcessId;

      GetWindowThreadProcessId( hWnd, &dwProcessId );
      if( dwProcessId != dwCurrentProcessId ) {
        LRESULT Index;
        HWND hWndListBox = (HWND) lParam;

        Index = ListBoxInsert( hWndListBox, &MaxStrLen, TextBuffer );
        SendMessage( hWndListBox, LB_SETITEMDATA, (WPARAM) Index,
          (LPARAM) dwProcessId );
      }
    }
  }

  return( TRUE );
}

BOOL ErrorMessageBox | ( | LPCTSTR | ,
 |  | LPCTSTR | ,
 |  | LPCTSTR | ,
 |  | INT |
 | ) |  |

Definition at line 715 of file DebMisc.c.

{
  #define ERROR_BUFFER_SIZE 512

  static TCHAR Format[] =
    TEXT( "%s\n\n"                                  )
    TEXT( "-- Error Information --\n"               )
    TEXT( "File : %s\n"                             )
    TEXT( "Line : %d\n"                             )
    TEXT( "Error Number : %d\n"                     )
    TEXT( "Error Message : %s\n"                    )
    TEXT( "\n"                                      )
    TEXT( "Press OK to terminate this application." );

  LPTSTR lpFormatMessageBuffer;
  DWORD  dwFormatMessage;
  DWORD  dwGetLastError;
  HLOCAL hMessageBoxBuffer;
  LPVOID lpMessageBoxBuffer;

  //-- perform a simple check on the needed buffer size
  if( lstrlen(lpszText) > (ERROR_BUFFER_SIZE - lstrlen(Format)) )
    return( FALSE );

  //-- allocate the message box buffer
  hMessageBoxBuffer  = LocalAlloc( LMEM_MOVEABLE, ERROR_BUFFER_SIZE );
  lpMessageBoxBuffer = LocalLock( hMessageBoxBuffer );

  //-- get the system error and system error message
  dwGetLastError = GetLastError();
  dwFormatMessage = FormatMessage(
                      FORMAT_MESSAGE_ALLOCATE_BUFFER
                      | FORMAT_MESSAGE_FROM_SYSTEM,
                      0L, dwGetLastError, LANG_NEUTRAL,
                      (LPTSTR) &lpFormatMessageBuffer, 0, 0L );
  if( !dwFormatMessage )
    lpFormatMessageBuffer = TEXT("FormatMessage() failed!");

  //-- format the error messge box string
  if (StringCbPrintf( lpMessageBoxBuffer, sizeof(lpMessageBoxBuffer), Format, lpszText, lpszFile, Line,
        dwGetLastError, lpFormatMessageBuffer ) > 0)
  {
    // -- display the error and allow the user to terminate or continue
    if( MessageBox( 0L, lpMessageBoxBuffer, lpszTitle,
          MB_APPLMODAL | MB_ICONSTOP | MB_OKCANCEL )
      == IDOK )
      ExitProcess( 0 );
  }

  //-- free all buffers
  if( dwFormatMessage )
    LocalFree( (HLOCAL) lpFormatMessageBuffer );
  LocalFree( (HLOCAL) hMessageBoxBuffer );

  return( TRUE );
}

BOOL GetDebuggeeFileName | ( | LPTSTR | ,
 |  | HWND |
 | ) |  |

Definition at line 252 of file DebMisc.c.

{
  static BOOL  fFirstTime = TRUE;
  static TCHAR szFilter[128]         = TEXT("");
  static TCHAR szTitle[64]           = TEXT("");
  static TCHAR szFileTitle[MAX_PATH] = TEXT("");
  static TCHAR szFile[MAX_PATH]      = TEXT("");
  static TCHAR szDefExt[8]           = TEXT("");
  static OPENFILENAME OpenFileName;

  //-- Load resource strings and init the OpenFileName struct
  //   (do this only one time)
  if( fFirstTime ) {
    static UINT FilterNameLen;

    fFirstTime = FALSE;
    FilterNameLen = (UINT) LoadString( 0L, IDS_OFN_FILTERNAME,
                             szFilter, sizeof(szFilter)/sizeof(TCHAR) );
    FilterNameLen++;
    LoadString( 0L, IDS_OFN_FILTER, &szFilter[FilterNameLen],
      sizeof(szFilter)/sizeof(TCHAR)-FilterNameLen );
    LoadString( 0L, IDS_OFN_TITLE, szTitle, sizeof(szTitle)/sizeof(TCHAR) );

    OpenFileName.lStructSize       = sizeof(OPENFILENAME);
    OpenFileName.hwndOwner         = hWnd;
    OpenFileName.hInstance         = (HANDLE) 0L;
    OpenFileName.lpstrFilter       = szFilter;
    OpenFileName.lpstrCustomFilter = 0L;
    OpenFileName.nMaxCustFilter    = 0L;
    OpenFileName.nFilterIndex      = 1L;
    OpenFileName.lpstrFile         = szFile;
    OpenFileName.nMaxFile          = sizeof(szFile)/sizeof(TCHAR);
    OpenFileName.lpstrFileTitle    = szFileTitle;
    OpenFileName.nMaxFileTitle     = sizeof(szFileTitle)/sizeof(TCHAR);
    OpenFileName.lpstrInitialDir   = (Profile.fSavedDirectory ? Profile.szInitialDir : 0L);
    OpenFileName.lpstrTitle        = (LPTSTR) szTitle;
    OpenFileName.Flags             = OFN_HIDEREADONLY;
    OpenFileName.nFileOffset       = (WORD) 0L;
    OpenFileName.nFileExtension    = (WORD) 0L;
    OpenFileName.lpstrDefExt       = szDefExt;
    OpenFileName.lCustData         = 0L;
    OpenFileName.lpfnHook          = (LPOFNHOOKPROC) 0L;
    OpenFileName.lpTemplateName    = (LPTSTR) 0L;
  }

  if( !GetOpenFileName( &OpenFileName ) ) {
    return( FALSE );
  }

  //-- store recent directory by stripping off the EXE name from the full path
  GetPathFromFullPathName( (LPTSTR) OpenFileName.lpstrFile, Profile.szInitialDir,
    sizeof(Profile.szInitialDir)/sizeof(TCHAR) );

  //-- copy name to return buffer
  lstrcpyn( lpszDebuggeeFileName, OpenFileName.lpstrFile, MAX_PATH );

  return( TRUE );
}

UINT GetPathFromFullPathName | ( | LPCTSTR | ,
 |  | LPTSTR | ,
 |  | UINT |
 | ) |  |

Definition at line 816 of file DebMisc.c.

{
  UINT nLength;
  int i, j;

  if( (nLength = (UINT) lstrlen( lpFullPathName ) ) >= nPathBufferLength )
    return( nLength );

  StringCbCopy( lpPathBuffer, sizeof(lpPathBuffer), lpFullPathName );

  for( j = 0, i = nLength; (UINT)j < nLength;
                  j += IsDBCSLeadByte(lpPathBuffer[j]) ? 2 : 1){
      if( lpPathBuffer[j] == '\\' || lpPathBuffer[j] == ':' ){
          i = j;
      }
  }
  if( lpPathBuffer[i] == ':' )
    lpPathBuffer[i+1] = '\0';
  else
    lpPathBuffer[i] = '\0';

  return( (UINT) i );
}

BOOL GetPrivateProfileSettings | ( | LPCTSTR | ,
 |  | LPCTSTR | ,
 |  | PPROFILE |
 | ) |  |

Definition at line 537 of file DebMisc.c.

{
  pProfile->xPos       = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "xPos" ),       CW_USEDEFAULT, lpszIniPathName );
  pProfile->yPos       = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "yPos" ),       CW_USEDEFAULT, lpszIniPathName );
  pProfile->nWidth     = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "nWidth" ),     CW_USEDEFAULT, lpszIniPathName );
  pProfile->nHeight    = (INT) GetPrivateProfileInt(  lpszAppTitle, TEXT( "nHeight" ),    CW_USEDEFAULT, lpszIniPathName );
  pProfile->fMaximized = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fMaximized" ), (INT) FALSE,   lpszIniPathName );
  pProfile->fMinimized = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fMinimized" ), (INT) FALSE,   lpszIniPathName );

  pProfile->fToolBar         = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fToolBar" ),         (INT) TRUE,  lpszIniPathName );
  pProfile->fSavedDirectory  = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fSavedDirectory" ),  (INT) TRUE,  lpszIniPathName );
  GetPrivateProfileString( lpszAppTitle, TEXT( "szInitialDir" ), 0L, pProfile->szInitialDir,
    sizeof( pProfile->szInitialDir )/sizeof(TCHAR), lpszIniPathName );

  pProfile->LogFont.lfHeight         = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfHeight" ),         (INT) 13   ,       lpszIniPathName );
  pProfile->LogFont.lfWidth          = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfWidth" ),          (INT) 0    ,       lpszIniPathName );
  pProfile->LogFont.lfWeight         = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfWeight" ),         (INT) 400  ,       lpszIniPathName );
  pProfile->LogFont.lfItalic         = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfItalic" ),         (INT) FALSE,       lpszIniPathName );
  pProfile->LogFont.lfUnderline      = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfUnderline" ),      (INT) FALSE,       lpszIniPathName );
  pProfile->LogFont.lfStrikeOut      = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfStrikeOut" ),      (INT) FALSE,       lpszIniPathName );
  pProfile->LogFont.lfPitchAndFamily = (BYTE) GetPrivateProfileInt( lpszAppTitle, TEXT( "lfPitchAndFamily" ), (INT) FF_DONTCARE, lpszIniPathName );
  GetPrivateProfileString( lpszAppTitle, TEXT( "lfFaceName" ), TEXT( "System" ), pProfile->LogFont.lfFaceName,
    LF_FACESIZE, lpszIniPathName );
  pProfile->rgbForeColor = (COLORREF) GetPrivateProfileInt( lpszAppTitle, TEXT( "rgbForeColor" ),
                            (INT) GetSysColor(COLOR_WINDOWTEXT), lpszIniPathName );
  pProfile->rgbBackColor = (COLORREF) GetPrivateProfileInt( lpszAppTitle, TEXT( "rgbBackColor" ),
                            (INT) GetSysColor(COLOR_WINDOW), lpszIniPathName );

  pProfile->fClearOnNew      = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fClearOnNew" ),      (INT) TRUE,  lpszIniPathName );
  pProfile->fVerbose         = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fVerbose" ),         (INT) FALSE, lpszIniPathName );
  pProfile->fShowSymbols     = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fShowSymbols" ),     (INT) FALSE, lpszIniPathName );
  pProfile->DebugMode        = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "DebugMode" ),        (INT) DEBUG_PROCESS        , lpszIniPathName );
  pProfile->DebuggeePriority = (LONG) GetPrivateProfileInt( lpszAppTitle, TEXT( "DebuggeePriority" ), (INT) NORMAL_PRIORITY_CLASS, lpszIniPathName );
  pProfile->DebugErrorLevel  = (DWORD) GetPrivateProfileInt( lpszAppTitle, TEXT( "DebugErrorLevel" ), (INT) 0, lpszIniPathName );
  pProfile->fSavePreferences = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fSavePreferences" ), (INT) FALSE, lpszIniPathName );

  pProfile->fSaveOnExit      = (BOOL) GetPrivateProfileInt( lpszAppTitle, TEXT( "fSaveOnExit" ),      (INT) TRUE,  lpszIniPathName );

  return( TRUE );
}

LRESULT ListBoxInsert | ( | HWND | ,
 |  | LPLONG | ,
 |  | LPCTSTR |
 | ) |  |

Definition at line 932 of file DebMisc.c.

{
  static LONG MaxTextExtent = 0;

  LRESULT     Index;

  if( lpszString == 0L ) {
    MaxTextExtent = 0;
    SendMessage( hWndListBox, LB_SETHORIZONTALEXTENT, 0, 0 );
    return( 0 );
  }

  if( hWndListBox != 0L ) {
    HDC  hDC;
    SIZE Size;
    LONG StrLen;

    if( (StrLen = lstrlen( lpszString)) > *lpMaxStrLen )
      *lpMaxStrLen = StrLen;
    hDC = GetDC( hWndListBox );
    GetTextExtentPoint( hDC, lpszString, StrLen, &Size );
    ReleaseDC( hWndListBox, hDC );
    if( Size.cx > MaxTextExtent ) {
      MaxTextExtent = Size.cx;
      SendMessage( hWndListBox, LB_SETHORIZONTALEXTENT, (WPARAM) (MaxTextExtent*1.1), 0 );
    }
    Index = SendMessage( hWndListBox, LB_ADDSTRING, 0, (LPARAM) lpszString );
    SendMessage( hWndListBox, LB_SETCURSEL, Index, 0 );
  }

  return( Index );
}

LRESULT ListBoxPrintF | ( | HWND | ,
 |  | LPCTSTR | ,
 |  |  | ...
 | ) |  |

Definition at line 972 of file DebMisc.c.

{
  static TCHAR szBuffer[ 1024 ];

  va_list  valist;
  LRESULT  Index;
  LPTSTR   lpCurrentString, lpCurrentChar;

  va_start( valist, szFormat );
  StringCchVPrintf( szBuffer, sizeof(szBuffer)/sizeof(TCHAR), szFormat, valist );
  szBuffer[sizeof(szBuffer)/sizeof(TCHAR) - 1] = 0;
  va_end( valist );

  //-- insert strings line-by-line
  for( lpCurrentString = lpCurrentChar = szBuffer; *lpCurrentChar != '\0'; ) {
    if( *lpCurrentChar == '\n' ) {
      LPTSTR lpNextChar = CharNext( lpCurrentChar );
      *lpCurrentChar = '\0';
      Index = ListBoxInsert( hWndListBox, &(Global.MaxStrLen), lpCurrentString );
      lpCurrentString = lpCurrentChar = lpNextChar;
    }
    else
      lpCurrentChar = CharNext( lpCurrentChar );
  }
  Index = ListBoxInsert( hWndListBox, &(Global.MaxStrLen), lpCurrentString );

  return( Index );
}

BOOL MakeCommonDebugEventString | ( | LPTSTR | ,
 |  | DWORD | ,
 |  | LPDEBUG_EVENT |
 | ) |  |

Definition at line 443 of file DebMisc.c.

{
  StringPrintF( lpszBuffer, cchBuffer, TEXT( "PID:0x%X \t TID:0x%X \t " ),
    lpDebugEvent->dwProcessId, lpDebugEvent->dwThreadId );

  return( TRUE );
}

BOOL MaxDebuggeesMessageBox ( HWND )

Definition at line 688 of file DebMisc.c.

{
  MessageBox( hWndOwner,
    TEXT( "This build of the Debug Event Browser\n" )
    TEXT( "is limited to debugging only one debuggee\n" )
    TEXT( "at a time." ),
    TEXT( "Cannot Open Debuggee" ),
    MB_OK | MB_ICONEXCLAMATION );

  return( TRUE );
}

BOOL OutOfMemoryMessageBox ( HWND )

Definition at line 670 of file DebMisc.c.

{
  MessageBox(
    hWndOwner,
    TEXT( "Out of Memory" ),
    TEXT( "Memory Error" ),
    MB_ICONSTOP | MB_APPLMODAL );

  return( TRUE );
}

LRESULT SendWmSizeMessage ( HWND )

Definition at line 798 of file DebMisc.c.

{
  RECT Rect;

  if( !GetClientRect( hWnd, &Rect ) )
    return( FALSE );

  return( SendMessage( hWnd, WM_SIZE, SIZENORMAL,
            MAKELONG( Rect.right - Rect.left, Rect.bottom - Rect.top) ) );
}

BOOL StartDebuggee | ( | LPTSTR | ,
 |  | HWND |
 | ) |  |

Definition at line 66 of file DebMisc.c.

{
  static PDEB_STARTUP_INFO pDebStartupInfo;
  static BOOL              fFirstTime = TRUE;

  static TCHAR szDebuggeeTitle[128];

  HANDLE hDebugEventThread;
  DWORD  idDebugEventThread;

  //-- Load resource strings and init the OpenFileName struct
  //   (do this only one time)
  if( fFirstTime ) {
    fFirstTime = FALSE;
    LoadString( 0L, IDS_OFN_DEBUGGEE_TITLE, szDebuggeeTitle,
      sizeof(szDebuggeeTitle)/sizeof(TCHAR) );
  }

  //-- allocate the Debuggee Information structure
  pDebStartupInfo = 0L;
  pDebStartupInfo = (PDEB_STARTUP_INFO) VirtualAlloc(
                                    pDebStartupInfo,
                                    sizeof( DEB_STARTUP_INFO ),
                                    MEM_RESERVE | MEM_COMMIT,
                                    PAGE_READWRITE );

  //-- init the StartupInfo struct
  (pDebStartupInfo->StartupInfo).cb          = sizeof( STARTUPINFO );
  (pDebStartupInfo->StartupInfo).lpDesktop   = 0L;
  (pDebStartupInfo->StartupInfo).lpTitle     = szDebuggeeTitle;
  (pDebStartupInfo->StartupInfo).dwX         = 0;
  (pDebStartupInfo->StartupInfo).dwY         = 0;
  (pDebStartupInfo->StartupInfo).dwXSize     = 0;
  (pDebStartupInfo->StartupInfo).dwYSize     = 0;
  (pDebStartupInfo->StartupInfo).dwFlags     = 0L;
  (pDebStartupInfo->StartupInfo).wShowWindow = SW_SHOWDEFAULT;

  (pDebStartupInfo->ProcessInfo).hProcess = 0L;

  //-- init other debuggee info
  pDebStartupInfo->fActive       = FALSE;
  pDebStartupInfo->dwProcessId   = 0L;
  pDebStartupInfo->lpstrFileName = 0L;
  pDebStartupInfo->lpstrPathName = lpszDebuggeeFileName;
  pDebStartupInfo->hWndListBox   = hWndListBox;

  //-- now start and detach the debug event processing thread
  if( !( hDebugEventThread = CreateThread(
                               (LPSECURITY_ATTRIBUTES) 0L,
                               (DWORD) 0,
                               (LPTHREAD_START_ROUTINE) DebugEventThread,
                               (LPVOID) pDebStartupInfo,
                               0L,
                               (LPDWORD) &idDebugEventThread) ) ) {

    VirtualFree( pDebStartupInfo, 0, MEM_RELEASE );
    return( FALSE );
  }
  else{
    CloseHandle( hDebugEventThread );
  }

  return( TRUE );
}

BOOL StringAppendF | ( | LPTSTR | ,
 |  | DWORD | ,
 |  | LPCTSTR | ,
 |  |  | ...
 | ) |  |

Definition at line 1031 of file DebMisc.c.

{
  static TCHAR szLgBuffer[1024];

  va_list valist;
  int n, cur, left;

  //-- add event specific information
  va_start( valist, szFormat );
  n = StringCchVPrintf( szLgBuffer, sizeof(szLgBuffer)/sizeof(TCHAR),
                   szFormat, valist );
  if (n < 1)
  {
      szLgBuffer[sizeof(szLgBuffer)/sizeof(TCHAR) - 1] = 0;
      n = sizeof(szLgBuffer)/sizeof(TCHAR);
  }
  va_end( valist );

  //-- append information to the string buffer
  cur = lstrlen(lpszBuffer);
  left = (int)cchBuffer - cur;
  if (n > left)
  {
      n = left;
  }
  lstrcpyn( lpszBuffer + cur, szLgBuffer, n );

  return( TRUE );
}

LPTSTR StringPrintF | ( | LPTSTR | ,
 |  | DWORD | ,
 |  | LPCTSTR | ,
 |  |  | ...
 | ) |  |

Definition at line 1010 of file DebMisc.c.

{
  va_list valist;

  va_start( valist, szFormat );
  StringCchVPrintf( lpString, cchString, szFormat, valist );
  lpString[cchString - 1] = 0;
  va_end( valist );

  return( lpString );
}

WNDPROC SubclassWindow | ( | HWND | ,
 |  | WNDPROC |
 | ) |  |

Definition at line 781 of file DebMisc.c.

{
  WNDPROC OldWndProc;

  OldWndProc = (WNDPROC) GetWindowLongPtr( hWnd, GWLP_WNDPROC );
  SetWindowLongPtr( hWnd, GWLP_WNDPROC, (LONG_PTR) NewWndProc );

  return OldWndProc;
}

BOOL UpdateMenuSettings ( HWND )

Definition at line 651 of file DebMisc.c.

{
  if( Profile.fToolBar )
    CheckMenuItem( GetMenu(hWnd), IDM_OPTIONS_TOOLBAR, MF_CHECKED );
  if( Profile.fSavedDirectory )
    CheckMenuItem( GetMenu(hWnd), IDM_OPTIONS_SAVEDDIR, MF_CHECKED );
  if( Profile.fSaveOnExit )
    CheckMenuItem( GetMenu(hWnd), IDM_OPTIONS_SAVEONEXIT, MF_CHECKED );

  return( TRUE );
}

BOOL WritePrivateProfileInt | ( | LPCTSTR | ,
 |  | LPCTSTR | ,
 |  | INT | ,
 |  | LPCTSTR |
 | ) |  |

Definition at line 635 of file DebMisc.c.

{
  TCHAR ValBuf[16];

  StringCbPrintf( ValBuf,sizeof(ValBuf) ,TEXT( "%i" ), Value);

  return( WritePrivateProfileString( lpAppName, lpKeyName, ValBuf, lpFileName ) );
}

BOOL WritePrivateProfileSettings | ( | LPCTSTR | ,
 |  | LPCTSTR | ,
 |  | PPROFILE |
 | ) |  |

Definition at line 586 of file DebMisc.c.

{
  if( pProfile->fSaveOnExit ) {
    WritePrivateProfileInt( lpszAppTitle, TEXT( "xPos" ),       (INT) pProfile->xPos,       lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "yPos" ),       (INT) pProfile->yPos,       lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "nWidth" ),     (INT) pProfile->nWidth,     lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "nHeight" ),    (INT) pProfile->nHeight,    lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fMaximized" ), (INT) pProfile->fMaximized, lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fMinimized" ), (INT) pProfile->fMinimized, lpszIniPathName );

    WritePrivateProfileInt( lpszAppTitle, TEXT( "fToolBar" ),         (INT) pProfile->fToolBar,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fSavedDirectory" ),  (INT) pProfile->fSavedDirectory,  lpszIniPathName );
    WritePrivateProfileString( lpszAppTitle, TEXT( "szInitialDir" ), pProfile->szInitialDir, lpszIniPathName );

    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfHeight" ),         (INT) pProfile->LogFont.lfHeight,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfWidth" ),          (INT) pProfile->LogFont.lfWidth,          lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfWeight" ),         (INT) pProfile->LogFont.lfWeight,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfItalic" ),         (INT) pProfile->LogFont.lfItalic,         lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfUnderline" ),      (INT) pProfile->LogFont.lfUnderline,      lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfStrikeOut" ),      (INT) pProfile->LogFont.lfStrikeOut,      lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "lfPitchAndFamily" ), (INT) pProfile->LogFont.lfPitchAndFamily, lpszIniPathName );
    WritePrivateProfileString( lpszAppTitle, TEXT( "lfFaceName" ), pProfile->LogFont.lfFaceName, lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "rgbForeColor" ), (INT) pProfile->rgbForeColor, lpszIniPathName );
    WritePrivateProfileInt( lpszAppTitle, TEXT( "rgbBackColor" ), (INT) pProfile->rgbBackColor, lpszIniPathName );

    if( pProfile->fSavePreferences ) {
      WritePrivateProfileInt( lpszAppTitle, TEXT( "fClearOnNew" ),  (INT) pProfile->fClearOnNew,  lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "fVerbose" ),     (INT) pProfile->fVerbose,     lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "fShowSymbols" ), (INT) pProfile->fShowSymbols, lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "DebugMode" ),        (INT) pProfile->DebugMode,        lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "DebuggeePriority" ), (INT) pProfile->DebuggeePriority, lpszIniPathName );
      WritePrivateProfileInt( lpszAppTitle, TEXT( "DebugErrorLevel" ), (INT) pProfile->DebugErrorLevel, lpszIniPathName );
    }
    WritePrivateProfileInt( lpszAppTitle, TEXT( "fSavePreferences" ), (INT) pProfile->fSavePreferences, lpszIniPathName );
  }
  WritePrivateProfileInt( lpszAppTitle, TEXT( "fSaveOnExit" ), (INT) pProfile->fSaveOnExit, lpszIniPathName );

  return( TRUE );
}

Generated on Wed Nov 13 2024 16:55:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/LinkList.c File Reference

  • WinBase
  • Debug
  • Deb
Defines | Functions

LinkList.c File Reference

#include <StdLib.H>
#include "LinkList.H"

Go to the source code of this file.

Defines

#define | CHECK_POINTER(ppNode)

Functions

BOOL | CreateList (PLIST *ppList, int(*OrderFunction)(PNODE pNodeOne, PNODE pNodeTwo))
BOOL | CreateNode (PNODE *ppNewNode)
BOOL | DeleteCurrentNode (PLIST pList)
BOOL | DestroyList (PLIST pList)
BOOL | DestroyNode (PNODE pNode)
BOOL | GetCurrentNode (PLIST pList, PNODE *ppNode)
BOOL | GetFirstNode (PLIST pList, PNODE *ppNode)
BOOL | GetLastNode (PLIST pList, PNODE *ppNode)
int | GetListError (PLIST pList)
BOOL | GetNextNode (PLIST pList, PNODE *ppNode)
BOOL | GetPrevNode (PLIST pList, PNODE *ppNode)
BOOL | InsertNode (PLIST pList, PNODE pNewNode)
BOOL | SetCurrentNode (PLIST pList, PNODE pKeyNode, int(*MatchFunction)(PNODE pNodeOne, PNODE pNodeTwo))
BOOL | SetCurrentNodeEx (PLIST pList, PNODE pKeyNode, int(*MatchFunction)(PNODE pNodeOne, PNODE pNodeTwo), int Occurence)

Define Documentation

#define CHECK_POINTER ( ppNode )
Value:
if( ppNode == 0L ) {                                      \
            return( pList->ListError = LIST_ERROR_DEREFERENCE_NULL ); \
          }

Definition at line 56 of file LinkList.c.

Function Documentation

BOOL CreateList | ( | PLIST * | ppList,
 |  | int(*)(PNODE pNodeOne, PNODE pNodeTwo) | OrderFunction
 | ) |  |

Definition at line 68 of file LinkList.c.

{
  *ppList = (PLIST) malloc( sizeof(LIST) );
  if( ppList == 0L ) {
    (*ppList)->ListError = LIST_NO_ERROR;
    return( FALSE );
  }

  //-- register the link list data ordering function
  (*ppList)->OrderFunction = OrderFunction;

  //-- initialize the general linked list node pointers to 0L
  (*ppList)->pFirstNode   = 0L;
  (*ppList)->pCurrentNode = 0L;
  (*ppList)->pLastNode    = 0L;

  //-- indicate no error
  (*ppList)->ListError  = LIST_NO_ERROR;

  return( TRUE );
}

BOOL CreateNode ( PNODE * ppNewNode )

Definition at line 97 of file LinkList.c.

{
  *ppNewNode = (PNODE) malloc( sizeof(NODE) );
  if( *ppNewNode == 0L ) {
    return( FALSE );
  }

  //-- initialize the node pointers to 0L
  (*ppNewNode)->pRightLink = 0L;
  (*ppNewNode)->pLeftLink  = 0L;

  return( TRUE );
}

BOOL DeleteCurrentNode ( PLIST pList )

Definition at line 448 of file LinkList.c.

{
  PNODE pOldCurrentNode;

  if( pList->pCurrentNode != 0L ) {
    pOldCurrentNode = pList->pCurrentNode;

    if( pOldCurrentNode == pList->pFirstNode ) {
      pList->pFirstNode   = pOldCurrentNode->pRightLink;
      pList->pCurrentNode = pOldCurrentNode->pRightLink;
    }
    else {
      pOldCurrentNode->pLeftLink->pRightLink = pOldCurrentNode->pRightLink;
      pList->pCurrentNode = pOldCurrentNode->pLeftLink;
    }

    if( pOldCurrentNode == pList->pLastNode )
      pList->pLastNode = pOldCurrentNode->pLeftLink;
    else
      pOldCurrentNode->pRightLink->pLeftLink = pOldCurrentNode->pLeftLink;

    DestroyNode( pOldCurrentNode );
    pList->ListError = LIST_NO_ERROR;
    return( TRUE );
  }
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL DestroyList ( PLIST pList )

Definition at line 499 of file LinkList.c.

{
  free( pList );
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL DestroyNode ( PNODE pNode )

Definition at line 485 of file LinkList.c.

{
  free( pNode );

  return( TRUE );
}

BOOL GetCurrentNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 330 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( pList->pCurrentNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = pList->pCurrentNode;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL GetFirstNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 353 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( pList->pFirstNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = pList->pFirstNode;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL GetLastNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 376 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( pList->pLastNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = pList->pLastNode;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

int GetListError ( PLIST pList )

Definition at line 514 of file LinkList.c.

{
  return( pList->ListError );
}

BOOL GetNextNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 399 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( (*ppNode)->pRightLink == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = (*ppNode)->pRightLink;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL GetPrevNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 422 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( (*ppNode)->pLeftLink == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = (*ppNode)->pLeftLink;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL InsertNode | ( | PLIST | pList,
 |  | PNODE | pNewNode
 | ) |  |

Definition at line 123 of file LinkList.c.

{
  int Position;
  int LastPosition;

  //-- if this is the first node in a new list
  if( pList->pFirstNode == 0L ) {
    pList->pFirstNode   = pNewNode;
    pList->pLastNode    = pNewNode;
    pList->pCurrentNode = pNewNode;
    pList->ListError    = LIST_NO_ERROR;
    return( TRUE );
  }

  Position = (*(pList->OrderFunction))( pNewNode, pList->pCurrentNode );

  //-- search for insertion point
  while( pList->pCurrentNode != 0L ) {

    LastPosition = Position;
    Position = (*(pList->OrderFunction))(pNewNode, pList->pCurrentNode);

    if( pList->pFirstNode == pList->pLastNode )
      break;

    if( Position != LastPosition )
      break;

    if( pList->pCurrentNode == pList->pFirstNode ) {
      if( Position == LIST_RIGHT_OF ) {
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
        continue;
      }
      break;
    }

    if( pList->pCurrentNode == pList->pLastNode ) {
      if( Position == LIST_LEFT_OF ) {
        pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
        continue;
      }
      break;
    }

    if( Position == LastPosition ) {
      if( Position == LIST_LEFT_OF) {
        pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
        continue;
      }
      if( Position == LIST_RIGHT_OF ) {
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
        continue;
      }
      break;
    }

  }

  //-- now, insert the pNewNode
  switch( Position ) {

    case LIST_LEFT_OF:
      pNewNode->pRightLink = pList->pCurrentNode;
      pNewNode->pLeftLink  = pList->pCurrentNode->pLeftLink;
      if( pList->pCurrentNode == pList->pFirstNode )
        pList->pFirstNode = pNewNode;
      else
        pList->pCurrentNode->pLeftLink->pRightLink = pNewNode;
      pList->pCurrentNode->pLeftLink = pNewNode;
      break;

  #if 1  // replace duplicates with new data

    case LIST_MATCH:
      pNewNode->pLeftLink  = pList->pCurrentNode->pLeftLink;
      pNewNode->pRightLink = pList->pCurrentNode->pRightLink;
      if( pList->pCurrentNode == pList->pLastNode )
        pList->pLastNode = pNewNode;
      else
        pList->pCurrentNode->pRightLink->pLeftLink = pNewNode;
      if( pList->pCurrentNode == pList->pFirstNode )
        pList->pFirstNode = pNewNode;
      else
        pList->pCurrentNode->pLeftLink->pRightLink = pNewNode;
      // note: doesn't destroy extra data associated with the node
      DestroyNode( pList->pCurrentNode );
      break;

  #else // or allow duplicates

    case LIST_MATCH:

  #endif

    case LIST_RIGHT_OF:
      pNewNode->pLeftLink  = pList->pCurrentNode;
      pNewNode->pRightLink = pList->pCurrentNode->pRightLink;
      if( pList->pCurrentNode == pList->pLastNode )
        pList->pLastNode = pNewNode;
      else
        pList->pCurrentNode->pRightLink->pLeftLink = pNewNode;
      pList->pCurrentNode->pRightLink = pNewNode;
      break;

  }
  pList->pCurrentNode = pNewNode;
  pList->ListError    = LIST_NO_ERROR;

  return( TRUE );
}

BOOL SetCurrentNode | ( | PLIST | pList,
 |  | PNODE | pKeyNode,
 |  | int(*)(PNODE pNodeOne, PNODE pNodeTwo) | MatchFunction
 | ) |  |

Definition at line 246 of file LinkList.c.

{
  return( SetCurrentNodeEx( pList, pKeyNode, MatchFunction, 1 ) );
}

BOOL SetCurrentNodeEx | ( | PLIST | pList,
 |  | PNODE | pKeyNode,
 |  | int(*)(PNODE pNodeOne, PNODE pNodeTwo) | MatchFunction,
 |  | int | Occurence
 | ) |  |

Definition at line 264 of file LinkList.c.

{
  int Position;

  //-- if list is empty, exit
  if( pList->pCurrentNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }

  //-- if match and order are same function
  if( MatchFunction == (pList->OrderFunction) ) {
    int  LastPosition;

    LastPosition = Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);

    while( Occurence ) {
      if( ( Position == LIST_LEFT_OF ) && ( LastPosition == LIST_LEFT_OF )
          && ( pList->pCurrentNode != pList->pFirstNode ) )
        pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
      else if( ( Position == LIST_RIGHT_OF ) && ( LastPosition == LIST_RIGHT_OF )
            && ( pList->pCurrentNode != pList->pLastNode ) )
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
      else {
        Occurence--;
        continue;
      }
      LastPosition = Position;
      Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);
    }

  }
  //-- match and order are not the same function, thus start
  //   the search at the front of the list
  else {
    pList->pCurrentNode = pList->pFirstNode;
    while( (Occurence > 0) && ( (pList->pCurrentNode) != 0L ) ) {
      Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);
      if( Position == LIST_MATCH )
        Occurence--;
      if( Occurence > 0 )
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
    }
  }

  if( ( Position == LIST_MATCH ) && ( Occurence == 0 ) ) {
    pList->ListError = LIST_NO_ERROR;
    return( TRUE );
  }
  pList->ListError = LIST_ERROR_NO_MATCH;

  return( FALSE );
}

Generated on Wed Nov 13 2024 16:55:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/LinkList.h File Reference

  • WinBase
  • Debug
  • Deb
Classes | Defines | Typedefs | Functions

LinkList.h File Reference

Go to the source code of this file.

Classes

struct | LIST_STRUCT
struct | NODE_STRUCT

Defines

#define | FALSE 0
#define | LIST_ERROR_DEREFERENCE_NULL -99
#define | LIST_ERROR_NO_FREE_MEM -3
#define | LIST_ERROR_NO_MATCH -2
#define | LIST_ERROR_NO_NODE -1
#define | LIST_LEFT_OF -1
#define | LIST_MATCH 0
#define | LIST_NO_ERROR 1
#define | LIST_RIGHT_OF 1
#define | TRUE 1

Typedefs

typedef int | BOOL
typedef struct LIST_STRUCT | LIST
typedef struct NODE_STRUCT | NODE
typedef struct LIST_STRUCT * | PLIST
typedef struct NODE_STRUCT * | PNODE
typedef void * | PVOID

Functions

BOOL | CreateList (PLIST *ppList, int(*OrderFunction)(PNODE pNodeOne, PNODE pNodeTwo))
BOOL | CreateNode (PNODE *ppNewNode)
BOOL | DeleteCurrentNode (PLIST pList)
BOOL | DestroyList (PLIST pList)
BOOL | DestroyNode (PNODE pNode)
BOOL | GetCurrentNode (PLIST pList, PNODE *ppNode)
BOOL | GetFirstNode (PLIST pList, PNODE *ppNode)
BOOL | GetLastNode (PLIST pList, PNODE *ppNode)
int | GetListError (PLIST pList)
BOOL | GetNextNode (PLIST pList, PNODE *ppNode)
BOOL | GetPrevNode (PLIST pList, PNODE *ppNode)
BOOL | InsertNode (PLIST pList, PNODE pNewNode)
BOOL | SetCurrentNode (PLIST pList, PNODE pKeyNode, int(*MatchFunction)(PNODE pNodeOne, PNODE pNodeTwo))
BOOL | SetCurrentNodeEx (PLIST pList, PNODE pKeyNode, int(*MatchFunction)(PNODE pNodeOne, PNODE pNodeTwo), int Occurence)

Define Documentation

#define FALSE 0

Definition at line 72 of file LinkList.h.

#define LIST_ERROR_DEREFERENCE_NULL -99

Definition at line 64 of file LinkList.h.

#define LIST_ERROR_NO_FREE_MEM -3

Definition at line 63 of file LinkList.h.

#define LIST_ERROR_NO_MATCH -2

Definition at line 62 of file LinkList.h.

#define LIST_ERROR_NO_NODE -1

Definition at line 61 of file LinkList.h.

#define LIST_LEFT_OF -1

Definition at line 66 of file LinkList.h.

#define LIST_MATCH 0

Definition at line 67 of file LinkList.h.

#define LIST_NO_ERROR 1

Definition at line 60 of file LinkList.h.

#define LIST_RIGHT_OF 1

Definition at line 68 of file LinkList.h.

#define TRUE 1

Definition at line 71 of file LinkList.h.

Typedef Documentation

typedef int BOOL

Definition at line 73 of file LinkList.h.

typedef struct LIST_STRUCT LIST
typedef struct NODE_STRUCT NODE
typedef struct LIST_STRUCT* PLIST

Definition at line 87 of file LinkList.h.

typedef struct NODE_STRUCT* PNODE

Definition at line 79 of file LinkList.h.

typedef void* PVOID

Definition at line 76 of file LinkList.h.

Function Documentation

BOOL CreateList | ( | PLIST * | ppList,
 |  | int(*)(PNODE pNodeOne, PNODE pNodeTwo) | OrderFunction
 | ) |  |

Definition at line 68 of file LinkList.c.

{
  *ppList = (PLIST) malloc( sizeof(LIST) );
  if( ppList == 0L ) {
    (*ppList)->ListError = LIST_NO_ERROR;
    return( FALSE );
  }

  //-- register the link list data ordering function
  (*ppList)->OrderFunction = OrderFunction;

  //-- initialize the general linked list node pointers to 0L
  (*ppList)->pFirstNode   = 0L;
  (*ppList)->pCurrentNode = 0L;
  (*ppList)->pLastNode    = 0L;

  //-- indicate no error
  (*ppList)->ListError  = LIST_NO_ERROR;

  return( TRUE );
}

BOOL CreateNode ( PNODE * ppNewNode )

Definition at line 97 of file LinkList.c.

{
  *ppNewNode = (PNODE) malloc( sizeof(NODE) );
  if( *ppNewNode == 0L ) {
    return( FALSE );
  }

  //-- initialize the node pointers to 0L
  (*ppNewNode)->pRightLink = 0L;
  (*ppNewNode)->pLeftLink  = 0L;

  return( TRUE );
}

BOOL DeleteCurrentNode ( PLIST pList )

Definition at line 448 of file LinkList.c.

{
  PNODE pOldCurrentNode;

  if( pList->pCurrentNode != 0L ) {
    pOldCurrentNode = pList->pCurrentNode;

    if( pOldCurrentNode == pList->pFirstNode ) {
      pList->pFirstNode   = pOldCurrentNode->pRightLink;
      pList->pCurrentNode = pOldCurrentNode->pRightLink;
    }
    else {
      pOldCurrentNode->pLeftLink->pRightLink = pOldCurrentNode->pRightLink;
      pList->pCurrentNode = pOldCurrentNode->pLeftLink;
    }

    if( pOldCurrentNode == pList->pLastNode )
      pList->pLastNode = pOldCurrentNode->pLeftLink;
    else
      pOldCurrentNode->pRightLink->pLeftLink = pOldCurrentNode->pLeftLink;

    DestroyNode( pOldCurrentNode );
    pList->ListError = LIST_NO_ERROR;
    return( TRUE );
  }
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL DestroyList ( PLIST pList )

Definition at line 499 of file LinkList.c.

{
  free( pList );
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL DestroyNode ( PNODE pNode )

Definition at line 485 of file LinkList.c.

{
  free( pNode );

  return( TRUE );
}

BOOL GetCurrentNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 330 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( pList->pCurrentNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = pList->pCurrentNode;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL GetFirstNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 353 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( pList->pFirstNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = pList->pFirstNode;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL GetLastNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 376 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( pList->pLastNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = pList->pLastNode;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

int GetListError ( PLIST pList )

Definition at line 514 of file LinkList.c.

{
  return( pList->ListError );
}

BOOL GetNextNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 399 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( (*ppNode)->pRightLink == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = (*ppNode)->pRightLink;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL GetPrevNode | ( | PLIST | pList,
 |  | PNODE * | ppNode
 | ) |  |

Definition at line 422 of file LinkList.c.

{
  CHECK_POINTER( ppNode );
  if( (*ppNode)->pLeftLink == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }
  *ppNode = (*ppNode)->pLeftLink;
  pList->ListError = LIST_NO_ERROR;

  return( TRUE );
}

BOOL InsertNode | ( | PLIST | pList,
 |  | PNODE | pNewNode
 | ) |  |

Definition at line 123 of file LinkList.c.

{
  int Position;
  int LastPosition;

  //-- if this is the first node in a new list
  if( pList->pFirstNode == 0L ) {
    pList->pFirstNode   = pNewNode;
    pList->pLastNode    = pNewNode;
    pList->pCurrentNode = pNewNode;
    pList->ListError    = LIST_NO_ERROR;
    return( TRUE );
  }

  Position = (*(pList->OrderFunction))( pNewNode, pList->pCurrentNode );

  //-- search for insertion point
  while( pList->pCurrentNode != 0L ) {

    LastPosition = Position;
    Position = (*(pList->OrderFunction))(pNewNode, pList->pCurrentNode);

    if( pList->pFirstNode == pList->pLastNode )
      break;

    if( Position != LastPosition )
      break;

    if( pList->pCurrentNode == pList->pFirstNode ) {
      if( Position == LIST_RIGHT_OF ) {
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
        continue;
      }
      break;
    }

    if( pList->pCurrentNode == pList->pLastNode ) {
      if( Position == LIST_LEFT_OF ) {
        pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
        continue;
      }
      break;
    }

    if( Position == LastPosition ) {
      if( Position == LIST_LEFT_OF) {
        pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
        continue;
      }
      if( Position == LIST_RIGHT_OF ) {
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
        continue;
      }
      break;
    }

  }

  //-- now, insert the pNewNode
  switch( Position ) {

    case LIST_LEFT_OF:
      pNewNode->pRightLink = pList->pCurrentNode;
      pNewNode->pLeftLink  = pList->pCurrentNode->pLeftLink;
      if( pList->pCurrentNode == pList->pFirstNode )
        pList->pFirstNode = pNewNode;
      else
        pList->pCurrentNode->pLeftLink->pRightLink = pNewNode;
      pList->pCurrentNode->pLeftLink = pNewNode;
      break;

  #if 1  // replace duplicates with new data

    case LIST_MATCH:
      pNewNode->pLeftLink  = pList->pCurrentNode->pLeftLink;
      pNewNode->pRightLink = pList->pCurrentNode->pRightLink;
      if( pList->pCurrentNode == pList->pLastNode )
        pList->pLastNode = pNewNode;
      else
        pList->pCurrentNode->pRightLink->pLeftLink = pNewNode;
      if( pList->pCurrentNode == pList->pFirstNode )
        pList->pFirstNode = pNewNode;
      else
        pList->pCurrentNode->pLeftLink->pRightLink = pNewNode;
      // note: doesn't destroy extra data associated with the node
      DestroyNode( pList->pCurrentNode );
      break;

  #else // or allow duplicates

    case LIST_MATCH:

  #endif

    case LIST_RIGHT_OF:
      pNewNode->pLeftLink  = pList->pCurrentNode;
      pNewNode->pRightLink = pList->pCurrentNode->pRightLink;
      if( pList->pCurrentNode == pList->pLastNode )
        pList->pLastNode = pNewNode;
      else
        pList->pCurrentNode->pRightLink->pLeftLink = pNewNode;
      pList->pCurrentNode->pRightLink = pNewNode;
      break;

  }
  pList->pCurrentNode = pNewNode;
  pList->ListError    = LIST_NO_ERROR;

  return( TRUE );
}

BOOL SetCurrentNode | ( | PLIST | pList,
 |  | PNODE | pKeyNode,
 |  | int(*)(PNODE pNodeOne, PNODE pNodeTwo) | MatchFunction
 | ) |  |

Definition at line 246 of file LinkList.c.

{
  return( SetCurrentNodeEx( pList, pKeyNode, MatchFunction, 1 ) );
}

BOOL SetCurrentNodeEx | ( | PLIST | pList,
 |  | PNODE | pKeyNode,
 |  | int(*)(PNODE pNodeOne, PNODE pNodeTwo) | MatchFunction,
 |  | int | Occurence
 | ) |  |

Definition at line 264 of file LinkList.c.

{
  int Position;

  //-- if list is empty, exit
  if( pList->pCurrentNode == 0L ) {
    pList->ListError = LIST_ERROR_NO_NODE;
    return( FALSE );
  }

  //-- if match and order are same function
  if( MatchFunction == (pList->OrderFunction) ) {
    int  LastPosition;

    LastPosition = Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);

    while( Occurence ) {
      if( ( Position == LIST_LEFT_OF ) && ( LastPosition == LIST_LEFT_OF )
          && ( pList->pCurrentNode != pList->pFirstNode ) )
        pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
      else if( ( Position == LIST_RIGHT_OF ) && ( LastPosition == LIST_RIGHT_OF )
            && ( pList->pCurrentNode != pList->pLastNode ) )
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
      else {
        Occurence--;
        continue;
      }
      LastPosition = Position;
      Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);
    }

  }
  //-- match and order are not the same function, thus start
  //   the search at the front of the list
  else {
    pList->pCurrentNode = pList->pFirstNode;
    while( (Occurence > 0) && ( (pList->pCurrentNode) != 0L ) ) {
      Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);
      if( Position == LIST_MATCH )
        Occurence--;
      if( Occurence > 0 )
        pList->pCurrentNode = pList->pCurrentNode->pRightLink;
    }
  }

  if( ( Position == LIST_MATCH ) && ( Occurence == 0 ) ) {
    pList->ListError = LIST_NO_ERROR;
    return( TRUE );
  }
  pList->ListError = LIST_ERROR_NO_MATCH;

  return( FALSE );
}

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/ToolBar.c File Reference

  • WinBase
  • Debug
  • Deb
Defines | Functions | Variables

ToolBar.c File Reference

#include <Windows.H>
#include "ToolBar.H"

Go to the source code of this file.

Defines

#define | BUTTON_BORDER 4
#define | BUTTONBAR_BORDER 4
#define | DKGRAY_PEN RGB(128, 128, 128)
#define | STRICT

Functions

BOOL WINAPI | DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
HWND | TextButtonBar (HWND hWndParent, LPTEXTBUTTON lpTextButton, LPINT lpHeight)
LRESULT CALLBACK | TextButtonBarProc (HWND, UINT, WPARAM, LPARAM)

Variables

HWND | hWndToolBarOwner

Define Documentation

#define BUTTON_BORDER 4
#define BUTTONBAR_BORDER 4
#define DKGRAY_PEN RGB(128, 128, 128)
#define STRICT

Definition at line 23 of file ToolBar.c.

Function Documentation

BOOL WINAPI DllMain | ( | HINSTANCE | hInstDLL,
 |  | DWORD | fdwReason,
 |  | LPVOID | lpvReserved
 | ) |  |

Definition at line 46 of file ToolBar.c.

{
  UNREFERENCED_PARAMETER( hInstDLL );
  UNREFERENCED_PARAMETER( fdwReason );
  UNREFERENCED_PARAMETER( lpvReserved );

  return( TRUE );
}

HWND TextButtonBar | ( | HWND | hWndParent,
 |  | LPTEXTBUTTON | lpTextButton,
 |  | LPINT | lpHeight
 | ) |  |

Definition at line 65 of file ToolBar.c.

{
  #define BUTTON_BORDER    4
  #define BUTTONBAR_BORDER 4

  static HWND         hWndTextButtonBar;

  HDC          hDC;
  WNDCLASS     WndClass;
  LONG         ButtonWidth;
  LONG         ButtonHeight;
  INT          xPosButton;
  INT          ButtonSpacing;
  INT          ButtonSpace;
  LPTSTR       lpButtonString;
  LPTEXTBUTTON lpTempTextButton;
  TEXTMETRIC   tm;
  SIZE         ButtonTextSize;
  RECT         rect;

  //-- store owner of Toolbar
  hWndToolBarOwner = hWndParent;

  //-- register the TestButtonBar window class
  WndClass.style         = (UINT) 0L;
  WndClass.lpfnWndProc   = (WNDPROC) TextButtonBarProc;
  WndClass.cbClsExtra    = 0;
  WndClass.cbWndExtra    = 0;
  WndClass.hInstance     = 0L;
  WndClass.hIcon         = 0L;
  WndClass.hCursor       = 0L;
  WndClass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
  WndClass.lpszMenuName  = 0L;
  WndClass.lpszClassName = TEXT( "TextButtonBarWClass" );

  if( !RegisterClass( &WndClass ) )
    return( FALSE );

  hDC = GetDC( hWndParent );
  GetTextMetrics( hDC, &tm );
  ButtonHeight = 2 * BUTTON_BORDER + tm.tmHeight;
  *lpHeight = 2 * BUTTONBAR_BORDER + ButtonHeight;

  GetWindowRect( GetDesktopWindow(), &rect );
  hWndTextButtonBar = CreateWindow(
                        TEXT( "TextButtonBarWClass" ), TEXT( "Toolbar" ),
                        WS_CHILD | WS_CLIPSIBLINGS,
                        0, 0, rect.right - rect.left, *lpHeight,
                        hWndToolBarOwner,
                        (HMENU) 0L, (HANDLE) 0L, 0L );

  SetWindowPos( hWndTextButtonBar, (HWND) 1, 0, 0, 0, 0,
    SWP_NOMOVE | SWP_NOSIZE );

  //-- button spacing information
  ButtonSpacing = BUTTON_BORDER / 2;
  ButtonSpace   = BUTTON_BORDER * 4;
  xPosButton    = BUTTON_BORDER * 2;

  //-- Create all the button windows
  for( lpTempTextButton = lpTextButton;
         !( (lpTempTextButton->lpButtonText) == '\0'
           && (lpTempTextButton->idButton) == (UINT) 0L);
         lpTempTextButton++ ) {

    //-- if TB_SPACE then adjust new xPos and continue
    if( lpTempTextButton->idButton == TB_SPACE ) {
      xPosButton += ButtonSpace;
      continue;
    }

    lpButtonString = lpTempTextButton->lpButtonText;
    GetTextExtentPoint( hDC, lpButtonString, lstrlen(lpButtonString), &ButtonTextSize );
    ButtonWidth = (4 * BUTTON_BORDER) + (LONG) ButtonTextSize.cx;

    (lpTempTextButton->hWndButton) = CreateWindow(
         TEXT( "BUTTON" ), lpButtonString,
         WS_VISIBLE | BS_PUSHBUTTON | WS_CHILD,
         xPosButton, BUTTONBAR_BORDER, ButtonWidth, ButtonHeight,
         hWndTextButtonBar,
         (HMENU)(INT_PTR) lpTempTextButton->idButton,
         (HANDLE) 0L, 0L );

    xPosButton += ButtonWidth + ButtonSpacing;
  }
  ReleaseDC( hWndParent, hDC );

  return( hWndTextButtonBar );
}

LRESULT CALLBACK TextButtonBarProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 165 of file ToolBar.c.

{
  static HDC         hDC;
  static RECT        rect;
  static PAINTSTRUCT ps;

  switch( uMsg ) {

    case WM_COMMAND:
      SendMessage( hWndToolBarOwner, uMsg, wParam, lParam );
      return( FALSE );

    case WM_PAINT:
      hDC = BeginPaint( hWnd, &ps );
      GetClientRect( hWnd, &rect );

      SelectObject( hDC, GetStockObject(WHITE_PEN) );
      MoveToEx( hDC, rect.left, rect.top, 0L );
      LineTo( hDC, rect.right+1, rect.top );

      #define DKGRAY_PEN RGB(128, 128, 128)
      SelectObject( hDC, (HANDLE) CreatePen( PS_SOLID, 1, DKGRAY_PEN ) );
      MoveToEx( hDC, rect.left, rect.bottom-2, 0L );
      LineTo( hDC, rect.right+1, rect.bottom-2 );

      SelectObject( hDC, (HANDLE) CreatePen( PS_SOLID, 1, BLACK_PEN ) );
      MoveToEx( hDC, rect.left, rect.bottom-1, 0L );
      LineTo( hDC, rect.right+1, rect.bottom-1 );

      DeleteObject( SelectObject( hDC, GetStockObject(BLACK_PEN) ) );
      EndPaint( hWnd, &ps );
      return( FALSE );

    default:
      return( DefWindowProc(hWnd, uMsg, wParam, lParam) );
  }
}

Variable Documentation

HWND hWndToolBarOwner

Definition at line 29 of file ToolBar.c.

Generated on Wed Nov 13 2024 16:54:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/ToolBar.h File Reference

  • WinBase
  • Debug
  • Deb
Classes | Defines | Typedefs | Functions

ToolBar.h File Reference

Go to the source code of this file.

Classes

struct | TEXTBUTTON_STRUCT

Defines

#define | TB_SPACE 0xFFFFFFFF

Typedefs

typedef struct TEXTBUTTON_STRUCT * | LPTEXTBUTTON
typedef struct TEXTBUTTON_STRUCT | TEXTBUTTON

Functions

HWND | TextButtonBar (HWND, LPTEXTBUTTON, LPINT)

Define Documentation

#define TB_SPACE 0xFFFFFFFF

Definition at line 20 of file ToolBar.h.

Typedef Documentation

typedef struct TEXTBUTTON_STRUCT * LPTEXTBUTTON
typedef struct TEXTBUTTON_STRUCT TEXTBUTTON

Function Documentation

HWND TextButtonBar | ( | HWND | ,
 |  | LPTEXTBUTTON | ,
 |  | LPINT |
 | ) |  |

Definition at line 65 of file ToolBar.c.

{
  #define BUTTON_BORDER    4
  #define BUTTONBAR_BORDER 4

  static HWND         hWndTextButtonBar;

  HDC          hDC;
  WNDCLASS     WndClass;
  LONG         ButtonWidth;
  LONG         ButtonHeight;
  INT          xPosButton;
  INT          ButtonSpacing;
  INT          ButtonSpace;
  LPTSTR       lpButtonString;
  LPTEXTBUTTON lpTempTextButton;
  TEXTMETRIC   tm;
  SIZE         ButtonTextSize;
  RECT         rect;

  //-- store owner of Toolbar
  hWndToolBarOwner = hWndParent;

  //-- register the TestButtonBar window class
  WndClass.style         = (UINT) 0L;
  WndClass.lpfnWndProc   = (WNDPROC) TextButtonBarProc;
  WndClass.cbClsExtra    = 0;
  WndClass.cbWndExtra    = 0;
  WndClass.hInstance     = 0L;
  WndClass.hIcon         = 0L;
  WndClass.hCursor       = 0L;
  WndClass.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
  WndClass.lpszMenuName  = 0L;
  WndClass.lpszClassName = TEXT( "TextButtonBarWClass" );

  if( !RegisterClass( &WndClass ) )
    return( FALSE );

  hDC = GetDC( hWndParent );
  GetTextMetrics( hDC, &tm );
  ButtonHeight = 2 * BUTTON_BORDER + tm.tmHeight;
  *lpHeight = 2 * BUTTONBAR_BORDER + ButtonHeight;

  GetWindowRect( GetDesktopWindow(), &rect );
  hWndTextButtonBar = CreateWindow(
                        TEXT( "TextButtonBarWClass" ), TEXT( "Toolbar" ),
                        WS_CHILD | WS_CLIPSIBLINGS,
                        0, 0, rect.right - rect.left, *lpHeight,
                        hWndToolBarOwner,
                        (HMENU) 0L, (HANDLE) 0L, 0L );

  SetWindowPos( hWndTextButtonBar, (HWND) 1, 0, 0, 0, 0,
    SWP_NOMOVE | SWP_NOSIZE );

  //-- button spacing information
  ButtonSpacing = BUTTON_BORDER / 2;
  ButtonSpace   = BUTTON_BORDER * 4;
  xPosButton    = BUTTON_BORDER * 2;

  //-- Create all the button windows
  for( lpTempTextButton = lpTextButton;
         !( (lpTempTextButton->lpButtonText) == '\0'
           && (lpTempTextButton->idButton) == (UINT) 0L);
         lpTempTextButton++ ) {

    //-- if TB_SPACE then adjust new xPos and continue
    if( lpTempTextButton->idButton == TB_SPACE ) {
      xPosButton += ButtonSpace;
      continue;
    }

    lpButtonString = lpTempTextButton->lpButtonText;
    GetTextExtentPoint( hDC, lpButtonString, lstrlen(lpButtonString), &ButtonTextSize );
    ButtonWidth = (4 * BUTTON_BORDER) + (LONG) ButtonTextSize.cx;

    (lpTempTextButton->hWndButton) = CreateWindow(
         TEXT( "BUTTON" ), lpButtonString,
         WS_VISIBLE | BS_PUSHBUTTON | WS_CHILD,
         xPosButton, BUTTONBAR_BORDER, ButtonWidth, ButtonHeight,
         hWndTextButtonBar,
         (HMENU)(INT_PTR) lpTempTextButton->idButton,
         (HANDLE) 0L, 0L );

    xPosButton += ButtonWidth + ButtonSpacing;
  }
  ReleaseDC( hWndParent, hDC );

  return( hWndTextButtonBar );
}

Generated on Wed Nov 13 2024 16:54:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/DebugHandler/DebugHandler.Cpp File Reference

  • WinBase
  • Debug
  • DebugHandler
Defines | Functions

DebugHandler.Cpp File Reference

#include <windows.h>
#include <stdio.h>
#include <dbghelp.h>
#include <tlhelp32.h>

Go to the source code of this file.

Defines

#define | MAX_THREADS 1024

Functions

DWORD DispatchDebugEventThread (DWORD pid, HANDLE hEvent)
void | InstallDebugger ()
DWORD | LogStackWalk (FILE *logFp, HANDLE hProcess, HANDLE hThread, DWORD exceptionAddress)
void | main (int argc, char **argv)
BOOL __stdcall | ReadProcessMemory64 (HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead)

Define Documentation

#define MAX_THREADS 1024

Function Documentation

DWORD DispatchDebugEventThread | ( | DWORD | pid,
 |  | HANDLE | hEvent
 | ) |  |

Definition at line 156 of file DebugHandler.Cpp.

{
#define MAX_THREADS   1024

    HANDLE hProcess = NULL;

    DWORD  dwThreadId[MAX_THREADS];
    HANDLE hThread[MAX_THREADS];

    FILE   *logFp = NULL;

    DEBUG_EVENT   de;
    DWORD         ContinueStatus;
    int           i;
    char          logFile[MAX_PATH + 64];
    BOOL          rc;
    DWORD64       base;

    /* Get the Windows directory for creating the log file */
    logFile[0] = 0;
    if(!GetWindowsDirectory(logFile, MAX_PATH))
    {
        // GetWindowsDirectory Failed
        return 0;
    }

    if (logFile[0])
    {
        strcat(logFile, "\\DebugHandler.log");
        logFp = fopen(logFile, "a");
        if (!logFp) return 0;
    }
    else
        return 0;

    /* Attach to the debuggee process */
    if (!DebugActiveProcess(pid))
    {
        fclose(logFp);
        logFp = 0;
        return 0;
    }

    ZeroMemory(hThread, sizeof(hThread));
    ZeroMemory(dwThreadId, sizeof(dwThreadId));

    while (TRUE)
    {
        /* Wait for a debug event */
        if (!WaitForDebugEvent(&de, 10000))
        {
            goto exit;
        }
        ContinueStatus = DBG_CONTINUE;

        switch (de.dwDebugEventCode)
        {
            case EXCEPTION_DEBUG_EVENT:
                /* The debugger process first initiates a breakpoint
                   in the debuggee. When this breakpoint debug event
                   is received by the debugger, we can set the event
                   handle here and break from the case to continue
                   the debuggee. When the debuggee continues, we will
                   get an exception debug event for the thread in the
                   debuggee. This event will be the exception that is
                   unhandled by the corresponding thread in the
                   debuggee */
                if (de.u.Exception.ExceptionRecord.ExceptionCode
                    == EXCEPTION_BREAKPOINT)
                {
                    if (hEvent)
                    {
                        SetEvent(hEvent);
                    }
                    break;
                }
                ContinueStatus = DBG_EXCEPTION_NOT_HANDLED;

                /* Search and find the handle to the thread
                   corresponding to the thread id. Then call
                   LogStackWalk for dumping the exception
                   stack trace of the corresponding thread
                   in the debuggee process */
                for (i = 0; i < MAX_THREADS; i++)
                {
                    if (dwThreadId[i] != de.dwThreadId) continue;
                    LogStackWalk(logFp,
                        hProcess,
                        hThread[i],
                        (DWORD)(de.u.Exception.
                        ExceptionRecord.ExceptionAddress));
                    break;
                }
                break;

            case CREATE_THREAD_DEBUG_EVENT:
                /* Store the thread handle and the thread id to be
                   used later in the EXCEPTION_DEBUG_EVENT */
                for (i = 0; i < MAX_THREADS; i++)
                {
                    if (dwThreadId[i]) continue;
                    dwThreadId[i] = de.dwThreadId;
                    hThread[i] = de.u.CreateThread.hThread;
                    break;
                }
                break;

            case CREATE_PROCESS_DEBUG_EVENT:
                /* Store the process handle to be used later in the
                   EXCEPTION_DEBUG_EVENT. Also the primary thread
                   handle and the corresponding thread id can be
                   stored here */

                hProcess = de.u.CreateProcessInfo.hProcess;

                /* We can initialize Symbol Handler functions of
                   dbghelp here and load the symbolic information
                   of the executable module */

                rc = SymInitialize(hProcess, 0, FALSE);
                if (!rc)
                {
                    printf("Error 0x%x calling SymInitialize()\n", GetLastError());
                    break;
                }
                base = SymLoadModuleEx(hProcess,
                                       de.u.CreateProcessInfo.hFile,
                                       0,
                                       0,
                                       0,
                                       0,
                                       NULL,
                                       0);
                if (!base)
                {
                    printf("Error 0x%x calling SymLoadModule(%s)\n",
                           GetLastError(),
                           de.u.CreateProcessInfo.hFile);
                    break;
                }
                for (i = 0; i < MAX_THREADS; i++)
                {
                    if (dwThreadId[i]) continue;
                    dwThreadId[i] = de.dwThreadId;
                    hThread[i] = de.u.CreateProcessInfo.hThread;
                    break;
                }
                break;

            case EXIT_THREAD_DEBUG_EVENT:
                /* Remove the thread handle and the thread id from
                   our data structures */
                for (i = 0; i < MAX_THREADS; i++)
                {
                    if (dwThreadId[i] != de.dwThreadId) continue;
                    dwThreadId[i] = 0;
                    hThread[i] = 0;
                    break;
                }
                break;

            case EXIT_PROCESS_DEBUG_EVENT:
                /* Remove the thread handle and the thread id from
                   our data structures */

                /* We can also cleanup Symbol Handler functions of
                   dbghelp here */

                SymCleanup(hProcess);
                hProcess = NULL;

                for (i = 0; i < MAX_THREADS; i++)
                {
                    if (dwThreadId[i] != de.dwThreadId) continue;
                    dwThreadId[i] = 0;
                    hThread[i] = 0;
                    break;
                }
                goto exit;
                break;

            case LOAD_DLL_DEBUG_EVENT:
                /* Load the symbolic information of the corresponding
                   DLL module */
                base = SymLoadModuleEx(hProcess,
                                       de.u.LoadDll.hFile,
                                       0,
                                       0,
                                       0,
                                       0,
                                       NULL,
                                       0);
                if (!base)
                    printf("Error 0x%x calling SymLoadModule(%s)\n",
                           GetLastError(),
                           de.u.CreateProcessInfo.hFile);
                break;

            case UNLOAD_DLL_DEBUG_EVENT:
                break;

            case OUTPUT_DEBUG_STRING_EVENT:
                break;

            case RIP_EVENT:
                break;

            default:
                break;
        }
        ContinueDebugEvent(de.dwProcessId, de.dwThreadId, ContinueStatus);
    }

exit:
    fclose(logFp);
    logFp = 0;
    return 0;
}

void InstallDebugger ( )

Definition at line 51 of file DebugHandler.Cpp.

{
    OSVERSIONINFO   osver;
    char            Auto[] = "0";
    char            Debugger[MAX_PATH + 64];
    int             n;

    Debugger[0] = '\"';

    /* Get the full path to the executable name */
    if (!GetModuleFileName(NULL, &Debugger[1], MAX_PATH))
    {
        printf("GetModuleFileName failed with error code : %d\n",
            GetLastError());
        Debugger[1] = '.';
        Debugger[2] = 0;
    }

    n = strlen(Debugger);
    Debugger[n] = '\"';

    /* Add -p and -e command line options */
    strcpy(&Debugger[n+1], " -p %ld -e %ld");

    /* Check to see if we are running under Windows 9x or Windows NT */

    osver.dwOSVersionInfoSize = sizeof(osver);
    if (!GetVersionEx(&osver))
    {
        printf("GetVersionEx failed with error code : %d\n",
            GetLastError());
        return;
    }

    if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT)
    {
        /* On Windows NT, create registry values under AeDebug */
        HKEY hRegKey;
        LONG lResult;

        lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
                "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug",
                0,
                KEY_SET_VALUE,
                &hRegKey);
        if (lResult != ERROR_SUCCESS)
        {
            printf("RegOpenKeyEx failed with error code : %d\n",
                lResult);
            return;
        }
        lResult = RegSetValueEx(hRegKey,
                        "Auto",
                        0,
                        REG_SZ,
                        (LPBYTE)Auto,
                        2);
        if (lResult != ERROR_SUCCESS)
        {
            printf("RegSetValueEx failed with error code : %d\n",
                lResult);
        }

        lResult = RegSetValueEx(hRegKey,
                        "Debugger",
                        0,
                        REG_SZ,
                        (LPBYTE)Debugger,
                        strlen(Debugger) + 1);
        if (lResult != ERROR_SUCCESS)
        {
            printf("RegSetValueEx failed with error code : %d\n",
                lResult);
        }

        RegCloseKey(hRegKey);
    }
    else if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
    {
        /* On Windows 9x, create appropriate section values in win.ini */
        if (!WritePrivateProfileString("AeDebug",
            "Auto",
            Auto,
            "win.ini"))
        {
            printf("WritePrivateProfileString failed with error code : %d\n",
                GetLastError());
        }

        if (!WritePrivateProfileString("AeDebug",
            "Debugger",
            Debugger,
            "win.ini"))
        {
            printf("WritePrivateProfileString failed with error code : %d\n",
                GetLastError());
        }
    }
}

DWORD LogStackWalk | ( | FILE * | logFp,
 |  | HANDLE | hProcess,
 |  | HANDLE | hThread,
 |  | DWORD | exceptionAddress
 | ) |  |

Definition at line 396 of file DebugHandler.Cpp.

{
    DWORD64           dwDisplacement = 0;
    DWORD             frames = 0;
    LPSTR             szSymName;
    IMAGEHLP_MODULE64 mi;
    DWORD             machType;
    CONTEXT           Context;
    STACKFRAME64      stk;
    char              buffer[1024];

    PIMAGEHLP_SYMBOL64  sym = (PIMAGEHLP_SYMBOL64)buffer;

    /* Get the thread context of hThread for calling StackWalk */
    Context.ContextFlags = CONTEXT_FULL;
    if (!GetThreadContext(hThread, &Context))
    {
        fprintf(logFp, "GetThreadContext returned error code : %d\n",
            GetLastError());
        return EXCEPTION_EXECUTE_HANDLER;
    }
    ZeroMemory(&stk, sizeof(stk));

    machType = IMAGE_FILE_MACHINE_I386;
    stk.AddrPC.Offset       = exceptionAddress;
    stk.AddrPC.Mode         = AddrModeFlat;
    stk.AddrStack.Offset    = Context.Esp;
    stk.AddrStack.Mode      = AddrModeFlat;
    stk.AddrFrame.Offset    = Context.Ebp;
    stk.AddrFrame.Mode      = AddrModeFlat;

    memset(buffer, 0, sizeof(buffer));
    sym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL);
    sym->MaxNameLength = sizeof(buffer) - sizeof(IMAGEHLP_SYMBOL);

    /* Call StackWalk to retrieve all the stack frames */
    while (StackWalk64(machType,
                        hProcess,
                        hThread,
                        &stk,
                        &Context,
                        ReadProcessMemory64,
                        SymFunctionTableAccess64,
                        SymGetModuleBase64,
                        0) && stk.AddrPC.Offset)
    {
        sym->Address = stk.AddrPC.Offset;
        dwDisplacement = 0;

        /* Get the function name corresponding to the code address */
        if (SymGetSymFromAddr64(hProcess,
                                stk.AddrPC.Offset,
                                &dwDisplacement,
                                sym))
        {
            szSymName = sym->Name;
        }
        else
        {

            szSymName = "<nosymbols>";
            fprintf(logFp, "SymGetSymFromAddr returned error code : %d\n",
                GetLastError());
        }
        fprintf(logFp, "%08x %08x %08x %08x %08x %08x ",
                  stk.AddrFrame.Offset,
                  stk.AddrReturn.Offset,
                  stk.Params[0],
                  stk.Params[1],
                  stk.Params[2],
                  stk.Params[3]);

        /* Get the module name corresponding to the code address */
        if (SymGetModuleInfo64(hProcess, stk.AddrPC.Offset, &mi))
        {
            fprintf(logFp, "%s!", mi.ModuleName);
        }

        fprintf(logFp, "%s\n", szSymName);

        if (!stk.AddrReturn.Offset)
        {
            break;
        }
    }

    fprintf(logFp, "\n");

    return EXCEPTION_EXECUTE_HANDLER;
}

void main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 490 of file DebugHandler.Cpp.

{
    DWORD   pid = 0;
    HANDLE  hEvent = 0;

    // This program will accept the following command line arguments similar
    // to all post mortem debuggers
    // -p <process id>
    // -e <event handle>

    if (argc > 1)
    {
        // If "-i" option is specified, then install the debugger
        if (!strcmpi(argv[1], "-i"))
        {
            InstallDebugger();
            return;
        }

        // If "-p" option is specified, get the process id value from
        // the next argument
        if (!strcmpi(argv[1], "-p"))
        {
            if (argc > 2)
            {
                pid = atoi(argv[2]);
            }
        }
    }

    if (argc > 3)
    {
        // If "-e" option is specified, get the event handle value from
        // the next argument
        if (!strcmpi(argv[3], "-e"))
        {
            if (argc > 4)
            {
                hEvent = (HANDLE)atoi(argv[4]);
            }
        }
    }

    if (pid)
    {
        DispatchDebugEventThread(pid, hEvent);
    }
}

BOOL __stdcall ReadProcessMemory64 | ( | HANDLE | hProcess,
 |  | DWORD64 | qwBaseAddress,
 |  | PVOID | lpBuffer,
 |  | DWORD | nSize,
 |  | LPDWORD | lpNumberOfBytesRead
 | ) |  |

Definition at line 378 of file DebugHandler.Cpp.

{
    return ReadProcessMemory(hProcess,
                             (LPCVOID)(ULONG_PTR)qwBaseAddress,
                             lpBuffer,
                             nSize,
                             lpNumberOfBytesRead);
}

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/eventlog/log.c File Reference

  • WinBase
  • Debug
  • eventlog
Defines | Functions

log.c File Reference

#include <stdio.h>
#include <windows.h>
#include <strsafe.h>
#include <string.h>
#include <stdlib.h>
#include <process.h>
#include "messages.h"

Go to the source code of this file.

Defines

#define | LOGNAME "Application"
#define | LOGSAMPVER 1.8
#define | LOGSOURCE "LogSample"
#define | MACHINE_NAME NULL
#define | MAX_MSG_LENGTH 3000
#define | MSG_ID_MASK 0x0000FFFF
#define | PARAM_SIZE (16)
#define | PERR(bSuccess, api) {if (!(bSuccess)) printf("\n%s: Error %d from %s \ on line %d\n", __FILE__, GetLastError(), api, __LINE__);}
#define | REG_ERR(lRegError, api) {if (lRegError!=ERROR_SUCCESS) printf("%s: \ Error %d from %s on line %d\n", __FILE__, lRegError, api, __LINE__);}
#define | REMOTE_MSG_DLL_PATH "\\\\ericsa2\\d$\\ntwork\\eventlog"
#define | SID_BUF_SIZE 1024

Functions

void | addSourceToRegistry (LPSTR pszLogName, LPSTR pszSrcName, LPSTR pszMsgDLL)
PTCHAR | insertMsgString (HKEY hk, PTCHAR szMsg, WORD wNumStrings, PTCHAR szInsStrings)
PTCHAR | lookupStringFromMsgDll (HKEY hk, DWORD dwEventID, WORD wNumStrings, PTCHAR szStrings, PTCHAR szMsgDllPath)
int | main (int argc, char *argv[])
void | notifyChange (LPCTSTR logSource)
void | queryEventLog (HANDLE hEventLog, LPCTSTR pszLogName, LPCTSTR pszSourceName)
void | reportAnEvent (LPSTR pszSrcName, DWORD dwIdEvent, WORD wCategory, WORD cStrings, LPTSTR *pszStrings)
void | usage ()

Define Documentation

#define LOGNAME "Application"

Definition at line 802 of file log.c.

#define LOGSAMPVER 1.8

Definition at line 55 of file log.c.

#define LOGSOURCE "LogSample"

Definition at line 803 of file log.c.

#define MACHINE_NAME NULL

Definition at line 65 of file log.c.

#define MAX_MSG_LENGTH 3000

Definition at line 61 of file log.c.

#define MSG_ID_MASK 0x0000FFFF

Definition at line 62 of file log.c.

#define PARAM_SIZE (16)

Definition at line 234 of file log.c.

#define PERR | ( | bSuccess,
 |  | api |
 | ) |  | {if (!(bSuccess)) printf("\n%s: Error %d from %s \ on line %d\n", __FILE__, GetLastError(), api, __LINE__);}

Definition at line 56 of file log.c.

#define REG_ERR | ( | lRegError,
 |  | api |
 | ) |  | {if (lRegError!=ERROR_SUCCESS) printf("%s: \ Error %d from %s on line %d\n", __FILE__, lRegError, api, __LINE__);}

Definition at line 58 of file log.c.

#define REMOTE_MSG_DLL_PATH "\\\\ericsa2\\d$\\ntwork\\eventlog"

Definition at line 69 of file log.c.

#define SID_BUF_SIZE 1024

Function Documentation

void addSourceToRegistry | ( | LPSTR | pszLogName,
 |  | LPSTR | pszSrcName,
 |  | LPSTR | pszMsgDLL
 | ) |  |

Definition at line 84 of file log.c.

{
  HKEY hk, hklm;          // registry key handle
  DWORD dwData;
  TCHAR szTemp[MAX_PATH];
  LONG lRegError;         // return value from registry APIs

  /* connect to remote registry (or local if MACHINE_NAME == NULL) */
  lRegError = RegConnectRegistry(MACHINE_NAME, HKEY_LOCAL_MACHINE, &hklm);
  REG_ERR(lRegError, "RegConnectRegistry");
  /* When a process uses the RegisterEventSource or OpenEventLog function to
     get a handle of an event log, the event logging service searches for the
     specified source name in the registry. You can add a new source name to
     the registry by opening a new registry subkey under the EventLog key and
     adding registry values to the new subkey. */
  // Create a new key for our source
  StringCbPrintf(szTemp,sizeof(szTemp), "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s\\%s",
      pszLogName, pszSrcName);
  lRegError = RegCreateKey(hklm, szTemp, &hk);
  REG_ERR(lRegError, "RegCreateKey");
  RegCloseKey(hklm);
  // Add the Event-ID message-file name to the subkey.
  lRegError = RegSetValueEx(hk,  // subkey handle
      "EventMessageFile",        // value name
      0,                         // must be zero
      REG_EXPAND_SZ,             // value type
      (LPBYTE) pszMsgDLL,        // address of value data
      (DWORD) strlen(pszMsgDLL) + 1);    // length of value data
  REG_ERR(lRegError, "RegSetValueEx");

  /* Add the Category message-file name to the subkey. These category strings
     correspond to the fwCategory parameter passed into ReportEvent(). */

  lRegError = RegSetValueEx(hk,  // subkey handle
      "CategoryMessageFile",     // value name
      0,                         // must be zero
      REG_EXPAND_SZ,             // value type
      (LPBYTE) pszMsgDLL,        // address of value data
      (DWORD) strlen(pszMsgDLL) + 1);    // length of value data
  REG_ERR(lRegError, "RegSetValueEx");

  /* Add the replaceable parameter message-file name to the subkey. This is
     used to replace %%nnn values in messages with the appropriate string */
  lRegError = RegSetValueEx(hk,  // subkey handle
      "ParameterMessageFile",    // value name
      0,                         // must be zero
      REG_EXPAND_SZ,             // value type
      (LPBYTE) pszMsgDLL,        // address of value data
      (DWORD) strlen(pszMsgDLL) + 1);    // length of value data
  REG_ERR(lRegError, "RegSetValueEx");

  // Set the supported types flags and add it to the subkey.
  dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |
    EVENTLOG_INFORMATION_TYPE;
  lRegError = RegSetValueEx(hk,  // subkey handle
      "TypesSupported",          // value name
      0,                         // must be zero
      REG_DWORD,                 // value type
      (LPBYTE) &dwData,          // address of value data
      sizeof(DWORD));            // length of value data
  REG_ERR(lRegError, "RegSetValueEx");

  // Set the number of categories supported
  dwData = 3;
  lRegError = RegSetValueEx(hk,  // subkey handle
      "CategoryCount",           // value name
      0,                         // must be zero
      REG_DWORD,                 // value type
      (LPBYTE) &dwData,          // address of value data
      sizeof(DWORD));            // length of value data
  REG_ERR(lRegError, "RegSetValueEx");
  RegCloseKey(hk);
  return;
} // addSourceToRegistry

PTCHAR insertMsgString | ( | HKEY | hk,
 |  | PTCHAR | szMsg,
 |  | WORD | wNumStrings,
 |  | PTCHAR | szInsStrings
 | ) |  |

Definition at line 236 of file log.c.

{
  BOOL bSuccess;
  DWORD dwType;    // for RegQueryValueEx
  LONG lRegError;  // return value from registry APIs
  // paths to ParameterMessageFile
  TCHAR szParamMsgPath[MAX_PATH], szTemp[MAX_PATH];
  DWORD dwcbData;
  HINSTANCE hLib;   // handle to DLL containing ParameterMessageFile
  DWORD dwID;       // message ID
  LPTSTR msgBuf;
  PTCHAR szTempMsg;  // the message with replaced "%" or "%%" insert strings
  PTCHAR p1 = szMsg, p2 = szMsg; // temp pointers to walk the string
  PTCHAR szInsStr;   // point to insert strings in the EVENTLOGRECORD struct
  DWORD cchDest;
  int i;

  szTempMsg = malloc(MAX_MSG_LENGTH);
  szTempMsg[0] = 0;
  while (p2)
  {
    p2 = strchr(p1, '%');
    if (!p2)  // "%" not found, just copy the rest of the string and quit
    {
      StringCbCat(szTempMsg,sizeof(szTempMsg), p1);
      continue;
    }
    strncat(szTempMsg, p1, p2 - p1);  // copy up to "%"
    /* is this a special "%%" string? If so, replace with language-dependant
       insert string from the ParameterMessageFile from registry. If it's not
       a "%%" string, skip down to else clause to replace as normal insert
       strings from the EVENTLOGRECORD structure */
    if (p2[1] == '%') // yup, it's a "%%" parameter string
    {
      p2 += 2;          // point to number, past the "%%"
      dwID = atoi(p2);  // get the message ID following the "%%"
      if (!dwID)        // it's not a number, copy "%%" as-is
      {
        StringCbCat(szTempMsg,sizeof(szTempMsg), "%%");
        p1 = p2;
        continue;
      }
      else
        p1 = p2 + strspn(p2, "0123456789"); // point past number

      /* now look up the string corresponding to the message ID and append
         it into our temp string */
      dwcbData = MAX_PATH;
      lRegError = RegQueryValueEx(hk,  // handle of key to query
          "ParameterMessageFile",      // value name
          NULL,                        // must be NULL
          &dwType,                     // address of type value
          (LPBYTE) szTemp,             // path to replaceable parameter message file
          &dwcbData);                  // length of value data
      REG_ERR(lRegError, "RegQueryValueEx");

      /* Expand environment variable strings in the message DLL path name, in
         case any are there */
      cchDest = ExpandEnvironmentStrings(szTemp, szParamMsgPath, MAX_PATH);
      PERR(cchDest != 0, "ExpandEnvironmentStrings");
      PERR(cchDest < MAX_PATH, "ExpandEnvironmentStrings");

      hLib = LoadLibraryEx(szParamMsgPath, NULL, DONT_RESOLVE_DLL_REFERENCES);
      PERR(hLib != NULL, "LoadLibraryEx");
      bSuccess = FormatMessage(
          FORMAT_MESSAGE_FROM_HMODULE |     // get the message from the DLL
          FORMAT_MESSAGE_ALLOCATE_BUFFER |  // allocate the msg buffer
          FORMAT_MESSAGE_ARGUMENT_ARRAY |   // lpArgs is an array of pointers
          FORMAT_MESSAGE_IGNORE_INSERTS |   // don't do any formatting
          70,                     // line length for the mesages
          hLib,                   // the messagetable DLL handle
          dwID,                   // message ID
          LANG_USER_DEFAULT,      // language ID
          (LPTSTR) &msgBuf,       // address of pointer to buffer for message
          PARAM_SIZE,             // maximum size of the message buffer
          NULL);                  // array of insert strings for the message
      PERR(bSuccess, "FormatMessage");
      FreeLibrary(hLib);
      StringCbCat(szTempMsg,sizeof(szTempMsg), msgBuf);
      LocalFree((HLOCAL) msgBuf);
    }
    else //a normal insert string, look up in EVENTLOGRECORD structure
    {
      p2++;            // point to number, past the "%"
      dwID = atoi(p2);  // get the message ID following the "%"
      if (!dwID)        // it's not a number, copy "%" as-is
      {
        StringCbCat(szTempMsg,sizeof(szTempMsg), "%");
        p1 = p2;
        continue;
      }
      else
        p1 = p2 + strspn(p2, "0123456789"); // point past number
      szInsStr = szInsStrings;
      for (i = 1; i < (int) dwID; i++) // find string number dwID
      {
        if (i > wNumStrings) // handle bogus string number
        {
          puts("**Error! Insert string ID too large");
          continue;
        }
        szInsStr += (strlen(szInsStr) + 1); // point to next string
      }
      StringCbCat(szTempMsg,sizeof(szTempMsg), szInsStr);
    } //else
  } //while
  return (szTempMsg);  // caller must free()!
} // insertMsgString

PTCHAR lookupStringFromMsgDll | ( | HKEY | hk,
 |  | DWORD | dwEventID,
 |  | WORD | wNumStrings,
 |  | PTCHAR | szStrings,
 |  | PTCHAR | szMsgDllPath
 | ) |  |

Definition at line 362 of file log.c.

{
  DWORD cchDest;
  PTCHAR pMsgDll;   // one of the message DLLs in the list
  PTCHAR pNextDll;  // pointer to next DLL in the list
  HINSTANCE hLib;  // handle to the messagetable DLL
  LPTSTR msgBuf;   // hold text of the error message that we build
  PTCHAR p = NULL;
  TCHAR szTempMsg[MAX_MSG_LENGTH];
  BOOL bSuccess;
  TCHAR szMsgDllPathEx[MAX_PATH];  // after environment string expansion

  /* Expand environment variable strings in the message DLL path name, in
     case any are there, such as %systemroot% */
  cchDest = ExpandEnvironmentStrings(szMsgDllPath, szMsgDllPathEx, MAX_PATH);
  PERR(cchDest != 0, "ExpandEnvironmentStrings");
  PERR(cchDest < MAX_PATH, "ExpandEnvironmentStrings");

  // The list is delimited by ';' chars, check each DLL for the message
  pMsgDll = szMsgDllPathEx;  // point to beginning of DLL list
  while (pMsgDll)
  {
    pNextDll = strchr(szMsgDllPathEx, ';');
    if (pNextDll)
    {
      *pNextDll = 0;  // replace ';' with 0 to null terminate the name
      pNextDll++;     // point to the next name in the list
    }

    // Now we've got a message DLL name, load the DLL.
    hLib = LoadLibraryEx(pMsgDll, NULL, DONT_RESOLVE_DLL_REFERENCES);
    PERR(hLib != NULL, "LoadLibraryEx");
    if (!hLib)
      continue;

    /* retrieve the message from the messagetable DLL. For the language
    identifier, use the values we defined in the LanguageNames statements in
    the .mc file. If no LanguageNames values were defined in the .mc file, as
    in this case, use the LANG_USER_DEFAULT macro defined in winnt.h */
    bSuccess = FormatMessage(
        FORMAT_MESSAGE_FROM_HMODULE |     // get the message from the DLL
        FORMAT_MESSAGE_ALLOCATE_BUFFER |  // allocate the msg buffer for us
        FORMAT_MESSAGE_ARGUMENT_ARRAY |   // lpArgs is an array of pointers
        FORMAT_MESSAGE_IGNORE_INSERTS |   // just get the message
        70,                 // line length for the mesages
        hLib,               // the messagetable DLL handle
        dwEventID,          // message ID
        LANG_USER_DEFAULT,  // language ID
        (LPTSTR) &msgBuf,   // address of pointer to buffer for message
        MAX_MSG_LENGTH,     // maximum size of the message buffer
        NULL);              // array of insert strings for the message
    // if the message was not found, try the next DLL in the list
    if (!bSuccess && GetLastError() == ERROR_MR_MID_NOT_FOUND && pNextDll)
    {
      FreeLibrary(hLib);
      pMsgDll = pNextDll;  // point to next DLL in list (or NULL if no more)
      continue;            /* if the msg doesn't exist, and we have more
                              DLL's to check, continue down the list */
    }
    if (!bSuccess && GetLastError() == ERROR_MR_MID_NOT_FOUND) //Msg ID not found, no more DLLs
      printf("**Error: Message ID not found in Messagetable resource in DLL: %s\n",
          pMsgDll);
    else
      PERR(bSuccess, "FormatMessage");

    // if everything is ok, continue on, otherwise proceed to next event
    if (bSuccess)
    {
      /* process insert strings. Call twice - insert strings may contain
         special "%%" language-dependant replaceable parameter strings */
      strncpy(szTempMsg, msgBuf,strlen(msgBuf));
      LocalFree((HLOCAL) msgBuf);
      p = insertMsgString(hk, szTempMsg, wNumStrings, szStrings);
      StringCbCopy(szTempMsg,sizeof(szTempMsg), p);
      free(p);  // free buffer allocated by insertParamString()
      p = insertMsgString(hk, szTempMsg, wNumStrings, szStrings);
      //we now have our formatted string, return it - we're done
      FreeLibrary(hLib);
      return(p);
      //don't free p again, it will be returned to the caller to free.
    } // if
    else
      p = NULL;
    pMsgDll = pNextDll;  // point to next DLL in list (or NULL if no more)
    // free the message DLL since we don't know if we'll need it again
    FreeLibrary(hLib);
  } // while
  return(p);  // p will be freed by our caller
} // lookupStringFromMsgDll

int main | ( | int | argc,
 |  | char * | argv[]
 | ) |  |

Definition at line 805 of file log.c.

{
  TCHAR szMsgPath[MAX_PATH];
  PTCHAR aInsertStrs[16];  // array of pointers to insert strings
  TCHAR szTemp[MAX_PATH];
  BOOL bSuccess;
  HANDLE hEventLog;
  OSVERSIONINFO osv;

  // Check to make sure we are running on Windows NT
  osv.dwOSVersionInfoSize = sizeof(osv);
  bSuccess = GetVersionEx(&osv);
  if (osv.dwPlatformId != VER_PLATFORM_WIN32_NT)
  {
    MessageBox(NULL, "Sorry, this application requires Windows NT.\n"
        "This application will now terminate.",
        "Error", MB_OK);
    return (1);
  }
  printf("Log.exe EventLog sample version %.2f\n", LOGSAMPVER);
  if (argc == 1)  // no args, use default defines
  {
    /* Set the Event-ID message-file name. For local logging, we assume that
       the message DLL is in the same directory as this application. For
       remote logging, this sample will access the message DLL over the net
       via a UNC name for simplicity. This will be very slow when reading a
       large number of events from the eventlog. */
    if (MACHINE_NAME == NULL)
      GetCurrentDirectory(sizeof(szMsgPath), szMsgPath);
    else
      StringCbCopy(szMsgPath,sizeof(szMsgPath), REMOTE_MSG_DLL_PATH);
    StringCbCat(szMsgPath, sizeof(szMsgPath), "\\messages.dll");
    addSourceToRegistry(LOGNAME, LOGSOURCE, szMsgPath);

    // clear the event log
    hEventLog = OpenEventLog(MACHINE_NAME,  // open on machine defined elsewhere
        LOGSOURCE);                 // event log source name
    PERR(hEventLog, "OpenEventLog");
    bSuccess = ClearEventLog(hEventLog, NULL);
    PERR(bSuccess, "ClearEventLog");
    // can't use the log handle now that it's been cleared, we must close it
    bSuccess = CloseEventLog(hEventLog);
    PERR(bSuccess, "CloseEventLog");

    /* set up a notification event thread that will print a message when the
       first message is added to LOGSOURCE. This will only work for local
       logging. */
    if (MACHINE_NAME == NULL)
    {
      _beginthread(notifyChange, 0, LOGSOURCE);
      Sleep(200); //give the thread time to initialize for this sample
    }
    // Set up our array of insert strings for our error message
    reportAnEvent(LOGSOURCE,  // source name
        MSG_BAD_COMMAND,      // the message to log
        CAT_1,                // category
        0,                    // number of insert strings
        aInsertStrs);         // the array of insert strings
    reportAnEvent(LOGSOURCE,  // source name
        MSG_BAD_PARM1,        // the message to log
        CAT_3,                // category
        0,                    // number of insert strings
        aInsertStrs);         // the array of insert strings
    reportAnEvent(LOGSOURCE,  // source name
        MSG_STRIKE_ANY_KEY,   // the message to log
        CAT_2,                // category
        0,                    // number of insert strings
        aInsertStrs);         // the array of insert strings
    aInsertStrs[0] = "2,567";
    aInsertStrs[1] = "10";
    reportAnEvent(LOGSOURCE,  // source name
        MSG_RETRYS,           // the message to log
        CAT_1,                // category
        2,                    // number of insert strings
        aInsertStrs);         // the array of insert strings
    StringCbCopy(szTemp,sizeof(szTemp), "%%");
    itoa(SPROCKETS, szTemp + 2, 10);  // concatenate the value
    aInsertStrs[0] = "foo.dat";
    aInsertStrs[1] = szTemp;
    reportAnEvent(LOGSOURCE,    // source name
        MSG_FILE_BAD_CONTENTS,  // the message to log
        CAT_1,                  // category
        2,                      // number of insert strings
        aInsertStrs);           // the array of insert strings
    aInsertStrs[0] = "a:";
    reportAnEvent(LOGSOURCE,    // source name
        MSG_INSERT_DISK,        // the message to log
        0,                      // category, 0 always means "none"
        1,                      // number of insert strings
        aInsertStrs);           // the array of insert strings
    queryEventLog(NULL, LOGNAME, LOGSOURCE);  // query the log
  }
  else
  {  // we've got parameters
    if (argc > 1 && !strcmpi(argv[1], "Application") ||
        !strcmpi(argv[1], "Security") || !strcmpi(argv[1], "System"))
    {
      if (argc > 2)  // got a backup log name
      {
        hEventLog = OpenBackupEventLog(NULL, argv[2]); // must be local
        if (hEventLog)
        {
          queryEventLog(hEventLog, argv[1], NULL);  // dump the backup log
          bSuccess = CloseEventLog(hEventLog);
          PERR(bSuccess, "CloseEventLog");
        }
        else
        {  // 2nd arg was bad
          printf("can't open backup eventlog %s\n", argv[2]);
          PERR(hEventLog, "OpenBackupEventLog");
          usage();
        }
      }
      else
      {  // only got logname, dump it
        HKEY hk, hklm;
        FILETIME ft;
        LONG lRegError;
        DWORD cchName = sizeof(szTemp);

        // get arbitrary subkey of param to be used to open event log
        StringCbPrintf(szTemp,sizeof(szTemp), "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s",
            argv[1]);
        lRegError = RegConnectRegistry(MACHINE_NAME, HKEY_LOCAL_MACHINE, &hklm);
        REG_ERR(lRegError, "RegConnectRegistry");
        lRegError = RegOpenKeyEx(hklm, szTemp, 0, KEY_READ, &hk);
        REG_ERR(lRegError, "RegOpenKeyEx");
        RegCloseKey(hklm);
        lRegError = RegEnumKeyEx(hk, 0, szTemp, &cchName, NULL,
            NULL, NULL, &ft);
        REG_ERR(lRegError, "RegEnumKeyEx");
        queryEventLog(NULL, argv[1], szTemp);  // query the log
      }
    }
    else  // first arg was bad
      usage();
  }  // else
  return (0);
}

void notifyChange ( LPCTSTR logSource )

Definition at line 769 of file log.c.

{
  BOOL bSuccess;
  HANDLE hEventLog, hEvent;
  DWORD dwWaitResult;

  hEvent = CreateEvent(NULL,    // address of security attributes
      FALSE,                    // no manual reset
      FALSE,                    // create as not signaled
      NULL);                    // event name
  hEventLog = OpenEventLog(MACHINE_NAME,  // open on machine defined elsewhere
      logSource);                 // event log source name
  PERR(hEventLog, "OpenEventLog");
  bSuccess = NotifyChangeEventLog(hEventLog,
      hEvent);
  PERR(bSuccess, "NotifyChangeEventLog");
  dwWaitResult = WaitForSingleObject(hEvent, INFINITE);
  if (dwWaitResult != WAIT_FAILED)
    printf("**Notification: %s has changed\n", logSource);
  else
    PERR(dwWaitResult == WAIT_FAILED, "WaitForSingleObject");
  CloseHandle(hEvent);
  //CloseHandle(hEventLog);
  return;
} // notifyChange

void queryEventLog | ( | HANDLE | hEventLog,
 |  | LPCTSTR | pszLogName,
 |  | LPCTSTR | pszSourceName
 | ) |  |

Definition at line 469 of file log.c.

{
  EVENTLOGRECORD *pevlr;
  PBYTE bBuffer;    // hold the event log record raw data
  DWORD dwRead, dwNeeded;
  HANDLE hLog;                // handle to the log
  BOOL bSuccess;
  DWORD cRecords, dwOldestRecord, dwNewestRecord, cLastRec = 0;
  LONG lRegError;
  DWORD dwType;
  DWORD dwcbData;
  HKEY hklm, hk;
  TCHAR szTemp[MAX_PATH];
  TCHAR szPrimaryMsgFile[64] = { 0 };  // name of primary (default) message file
  TCHAR szPrimaryCatFile[64] = { 0 };  // name of primary (default) category file
  PTCHAR p;

  // allocate memory on the heap for our buffer

  bBuffer = malloc(1024*64);
  if (NULL == bBuffer)
  {
      // malloc failed
      return;
  }

  if (!hEventLog)
  {
    HANDLE hToken;
    TOKEN_PRIVILEGES TokenPrivileges;

    //Enable the SE_SECURITY_NAME priv to allow us to view the security log
    bSuccess = OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken);
    PERR(bSuccess, "OpenProcessToken");
    bSuccess = LookupPrivilegeValue(NULL, SE_SECURITY_NAME,
        &(TokenPrivileges.Privileges[0].Luid));
    PERR(bSuccess, "LookupPrivilegeValue");
    TokenPrivileges.PrivilegeCount = 1;
    TokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
    bSuccess = AdjustTokenPrivileges(hToken, FALSE, &TokenPrivileges, 0, NULL,NULL);
    PERR(bSuccess, "AdjustTokenPrivileges");

    hLog = OpenEventLog(MACHINE_NAME,
        pszSourceName);        // source name - assumed to be valid
    PERR(hLog, "OpenEventLog");
  }
  else
    hLog = hEventLog;

  // Get the number of records in the log.
  bSuccess = GetNumberOfEventLogRecords(hLog, &cRecords);
  PERR(bSuccess, "GetNumberOfEventLogRecords");
  printf("There are %d records in the %s log.\n", cRecords, pszLogName);
  bSuccess = GetOldestEventLogRecord(hLog, &dwOldestRecord);
  PERR(bSuccess, "GetOldestEventLogRecord");
  /* the newest record may not be sequence #1 if the log is set to overwrite */
  dwNewestRecord = dwOldestRecord + cRecords - 1;
  printf("First record sequence number: %d, Last record sequence number: %d\n",
      dwOldestRecord, dwNewestRecord);
  /* If the eventlog key contains a PrimaryModule value, get the default
     messagefile from it. This is the default EventMessageFile if an
     EventMessageFile value doesn't exist for a given source. */
  StringCbPrintf(szTemp,sizeof(szTemp), "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s",
      pszLogName);
  lRegError = RegConnectRegistry(MACHINE_NAME, HKEY_LOCAL_MACHINE, &hklm);
  REG_ERR(lRegError, "RegConnectRegistry");
  lRegError = RegOpenKeyEx(hklm, szTemp, 0, KEY_READ, &hk);
  REG_ERR(lRegError, "RegOpenKeyEx");
  RegCloseKey(hklm);
  dwcbData = MAX_PATH;
  lRegError = RegQueryValueEx(hk,  // handle of key to query
      "PrimaryModule",             // value name
      NULL,                        // must be NULL
      &dwType,                     // address of type value
      (LPBYTE) szPrimaryMsgFile,   // path to primary (default) message DLL
      &dwcbData);                  // length of value data
  if (lRegError != ERROR_FILE_NOT_FOUND)  // the key doesn't exist, no default file
    REG_ERR(lRegError, "RegQueryValueEx");
  RegCloseKey(hk);
  /* if the key exists, get the default EventMessageFile and CategoryMessageFile
     from the specified subkey. Note that both keys may or may not exist. */
  if (lRegError == ERROR_SUCCESS)
  {
    StringCbCat(szTemp,sizeof(szTemp), "\\");
    StringCbCat(szTemp,sizeof(szTemp), szPrimaryMsgFile);
    lRegError = RegConnectRegistry(MACHINE_NAME, HKEY_LOCAL_MACHINE, &hklm);
    REG_ERR(lRegError, "RegConnectRegistry");
    lRegError = RegOpenKeyEx(hklm, szTemp, 0, KEY_READ, &hk);
    REG_ERR(lRegError, "RegOpenKeyEx");
    RegCloseKey(hklm);
    dwcbData = MAX_PATH;
    lRegError = RegQueryValueEx(hk,  // handle of key to query
        "EventMessageFile",          // value name
        NULL,                        // must be NULL
        &dwType,                     // address of type value
        (LPBYTE) szPrimaryMsgFile,   // path(s) to message DLL
        &dwcbData);                  // length of value data
    if (lRegError == ERROR_FILE_NOT_FOUND)
      szPrimaryMsgFile[0] = 0;       // no default; set it to NULL for later testing
    else
      REG_ERR(lRegError, "RegQueryValueEx");
    dwcbData = MAX_PATH;
    lRegError = RegQueryValueEx(hk,  // handle of key to query
        "CategoryMessageFile",       // value name
        NULL,                        // must be NULL
        &dwType,                     // address of type value
        (LPBYTE) szPrimaryCatFile,   // path(s) to message DLL
        &dwcbData);                  // length of value data
    if (lRegError == ERROR_FILE_NOT_FOUND)
      szPrimaryCatFile[0] = 0;       // no default; set it to NULL for later testing
    else
      REG_ERR(lRegError, "RegQueryValueEx");
    RegCloseKey(hk);
  }

  pevlr = (EVENTLOGRECORD *) bBuffer;
  /* Opening the log positions the file pointer for this handle at the
     beginning of the log. Read records sequentially until there are no more
     records. */
  while (bSuccess = ReadEventLog(hLog,  // event-log handle
          EVENTLOG_FORWARDS_READ |      // read forward
          EVENTLOG_SEQUENTIAL_READ,     // sequential read
          0,                            // ignored for sequential reads
          bBuffer,                      // address of buffer
          sizeof(bBuffer),              // size of buffer
          &dwRead,                      // count of bytes read
          &dwNeeded))                   // bytes in next record
  {
    while (dwRead > 0)
    {
      /* Print the event ID, type, source name, and category. The source name
         is just past the end of the formal structure. */
      printf("\n%03d  Event ID: 0x%08X  EventType: ", pevlr->RecordNumber,
          pevlr->EventID);
      cLastRec = pevlr->RecordNumber;
      switch (pevlr->EventType)
      {
        case EVENTLOG_ERROR_TYPE:
          printf("EVENTLOG_ERROR_TYPE");
          break;
        case EVENTLOG_WARNING_TYPE:
          printf("EVENTLOG_WARNING_TYPE");
          break;
        case EVENTLOG_INFORMATION_TYPE:
          printf("EVENTLOG_INFORMATION_TYPE");
          break;
        case EVENTLOG_AUDIT_SUCCESS:
          printf("EVENTLOG_AUDIT_SUCCESS");
          break;
        case EVENTLOG_AUDIT_FAILURE:
          printf("EVENTLOG_AUDIT_FAILURE");
          break;
        default:
          printf("UNKNOWN");
          break;
      }

      printf("\nSource: %s", (LPSTR) ((LPBYTE) pevlr + sizeof(EVENTLOGRECORD)));
      // mask off the actual message number and show it
      printf("  Message ID: %d", pevlr->EventID & MSG_ID_MASK);

      /* From the event log source name, we know the name of the registry key
         to look under for the list of the message DLLs that may contain the
         message we need to extract with FormatMessage. Get the event log
         source name list... */
      // The source name follows the EVENTLOGRECORD structure
      StringCbPrintf(szTemp,sizeof(szTemp), "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s\\%s",
          pszLogName, (PTCHAR) ((LPBYTE) pevlr + sizeof(EVENTLOGRECORD)));
      /* Now open this key and get the EventMessageFile value, which is the
         list of the message DLLs for that source */
      lRegError = RegConnectRegistry(MACHINE_NAME, HKEY_LOCAL_MACHINE, &hklm);
      REG_ERR(lRegError, "RegConnectRegistry");
      lRegError = RegOpenKeyEx(hklm, szTemp, 0, KEY_READ, &hk);
      REG_ERR(lRegError, "RegOpenKeyEx");
      RegCloseKey(hklm);

      // first, look up the path(s) to the category message DLL, use default if none
      dwcbData = MAX_PATH;
      lRegError = RegQueryValueEx(hk,  // handle of key to query
          "CategoryMessageFile",       // value name
          NULL,                        // must be NULL
          &dwType,                     // address of type value
          (LPBYTE) szTemp,             // path to category message DLL
          &dwcbData);                  // length of value data
      if (lRegError == ERROR_FILE_NOT_FOUND)
      {
        if (szPrimaryCatFile[0])
          StringCbCopy(szTemp,sizeof(szTemp), szPrimaryCatFile);
        else //must have been registered with NULL for source name
          szTemp[0] = 0; //no category DLL
      }
      else
        REG_ERR(lRegError, "RegQueryValueEx");
      // if we have a valid category DLL and the category is not 0 (none)
      if (szTemp[0] && pevlr->EventCategory)
      {
        // get the string from the category DLL
        p = lookupStringFromMsgDll(hk, pevlr->EventCategory, 0, NULL, szTemp);
        if (p)
        {
          printf("  Category: %s", p);
          free(p);
        }
      }
      else //category type is 0, no category DLL found, or no default category DLL
        printf("  Category: none");
      // print out the user's account name if the SID was logged in the record
      if (pevlr->UserSidLength)
      {
        TCHAR szAccountName[64], szDomainName[64];
        DWORD cbAccountSize, cbDomainSize;
        SID_NAME_USE snu;
        PSID psid;

        /* get the user name associated with the Security identifier (SID)
           in the event log record */
        psid = (PSID)((LPBYTE) pevlr + pevlr->UserSidOffset);
        cbAccountSize = sizeof(szAccountName);
        cbDomainSize = sizeof(szDomainName);
        bSuccess = LookupAccountSid(NULL, psid, szAccountName, &cbAccountSize,
            szDomainName, &cbDomainSize, &snu);
        PERR(bSuccess, "LookupAccountSid");
        printf("  User: %s", bSuccess ? szAccountName : "N/A");
      }

      // now look up the path(s) to the message DLL to get the message text
      dwcbData = MAX_PATH;
      lRegError = RegQueryValueEx(hk,  // handle of key to query
          "EventMessageFile",          // value name
          NULL,                        // must be NULL
          &dwType,                     // address of type value
          (LPBYTE) szTemp,             // path(s) to message DLL
          &dwcbData);                  // length of value data
      // if the message file isn't there, and a default exists, use default
      if (lRegError == ERROR_FILE_NOT_FOUND)
      {
        if (szPrimaryMsgFile[0])
          StringCbCopy(szTemp,sizeof(szTemp), szPrimaryMsgFile);
        else //must have been registered with NULL for source name
          szTemp[0] = 0; //no message DLL
      }
      else
        REG_ERR(lRegError, "RegQueryValueEx");
      if (szTemp[0])
      {
        /* get the message from the message DLL, replacing parameters and
           replaceable parameter strings as appropriate */
        p = lookupStringFromMsgDll(hk, pevlr->EventID, pevlr->NumStrings,
            (PTCHAR) ((LPBYTE) pevlr + pevlr->StringOffset), szTemp);
        if (p)
        {
          printf("\nMessage: %s\n", p);
          free(p);
        }
      }
      // Subtract the size of the event log record we just read
      dwRead -= pevlr->Length;
      // Point to the next event log record in the buffer
      pevlr = (EVENTLOGRECORD *) ((LPBYTE) pevlr + pevlr->Length);
      RegCloseKey(hk);  // close key for this event source
    } // while
    /* reset our event log record pointer back to the beginning of the buffer
       in preparation for reading the next record. */
    pevlr = (EVENTLOGRECORD *) bBuffer;
  } // while
  if (GetLastError() != ERROR_HANDLE_EOF)
    PERR(bSuccess, "ReadEventLog");
  /* If you're reading at the end of the eventlog and records are added, you may get
     ERROR_HANDLE_EOF if the write doesn't complete in time for the read. This is normal.
     If the write completes, the record will be read normally.
     If the eventlog is cleared while you're in the middle of reading it, then you'll
     get ERROR_EVENTLOG_FILE_CHANGED on the next ReadEventLog. */
  if (GetLastError() == ERROR_EVENTLOG_FILE_CHANGED)
    puts("The Eventlog has been changed by another process between reads.");
  /* If you want to check if new records have been added, perhaps before
     clearing the log, check the sequence number of most recent record */
  bSuccess = GetOldestEventLogRecord(hLog, &dwOldestRecord);
  PERR(bSuccess, "GetOldestEventLogRecord");
  bSuccess = GetNumberOfEventLogRecords(hLog, &cRecords);
  PERR(bSuccess, "GetNumberOfEventLogRecords");
  if (dwNewestRecord != dwOldestRecord + cRecords - 1)
    printf("New records have been added to the eventlog.\n"
        "Last record read was %d, newest record is %d\n", cLastRec, dwOldestRecord + cRecords - 1);
  if (!hEventLog)  // if we had to open the event log, close it
  {
    bSuccess = CloseEventLog(hLog);
    PERR(bSuccess, "CloseEventLog");
  }
  return;
} // queryEventLog

void reportAnEvent | ( | LPSTR | pszSrcName,
 |  | DWORD | dwIdEvent,
 |  | WORD | wCategory,
 |  | WORD | cStrings,
 |  | LPTSTR * | pszStrings
 | ) |  |

Definition at line 173 of file log.c.

{
  #define SID_BUF_SIZE 1024
  HANDLE hLog;
  HANDLE hAccessToken;
  PTOKEN_USER ptgUser;
  BYTE UserBuf[SID_BUF_SIZE];
  DWORD cbUserBufSize = SID_BUF_SIZE;
  BOOL bSuccess;

  // get the current process access token
  bSuccess = OpenProcessToken(GetCurrentProcess(),
            TOKEN_QUERY,
            &hAccessToken);
  PERR(bSuccess, "OpenProcessToken");
  ptgUser = (PTOKEN_USER) UserBuf;
  /* get the TOKEN_USER structure from the access token, which contains
     the Sid representing the caller */
  bSuccess = GetTokenInformation(hAccessToken,
            TokenUser,
            ptgUser,
            cbUserBufSize,
            &cbUserBufSize);
  PERR(bSuccess, "GetTokenInformation");
  CloseHandle(hAccessToken);
  // Get a handle to the event log
  hLog = RegisterEventSource(MACHINE_NAME,  // use machine defined elsewhere
      pszSrcName);                  // source name
  PERR(hLog, "RegisterEventSource");
  // Now report the event, which will add this event to the event log
  bSuccess = ReportEvent(hLog,  // event-log handle
      EVENTLOG_ERROR_TYPE,      // event type
      wCategory,                // category
      dwIdEvent,                // event ID
      ptgUser->User.Sid,        // Sid representing caller
      cStrings,                 // number of substitution strings
      0,                        // no binary data
      pszStrings,               // string array
      NULL);                    // address of data
  PERR(bSuccess, "ReportEvent");
  DeregisterEventSource(hLog);
  return;
} // reportAnEvent

void usage ( )

Definition at line 760 of file log.c.

{
  puts("log <[logname] [backuplog]>");
  puts("[logname] is an optional eventlog category such as Application, Security, or\n"
      "System. [backuplog] is the filename of a backup log file to view. If this\n"
      "parameter is specified, [logname] must be given as well.\n");
  return;
} // usage()

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceDmp/tracedmp.cpp File Reference

  • WinBase
  • EventTrace
  • TraceDmp
Functions | Variables

tracedmp.cpp File Reference

#include "tracedmp.h"

Go to the source code of this file.

Functions

ULONG WINAPI | BufferCallback (PEVENT_TRACE_LOGFILE pLog)
ULONG | CheckFile (LPTSTR fileName)
void | CleanupEventList (VOID)
void WINAPI | DumpEvent (PEVENT_TRACE pEvent)
PMOF_INFO | GetMofInfoHead (GUID Guid, SHORT nType, SHORT nVersion, CHAR nLevel)
void | GuidToString (PTCHAR s, LPGUID piid)
int __cdecl | main (int argc, LPTSTR *argv)
void | PrintDumpHeader ()
void | PrintEvent (PEVENT_TRACE pEvent, PMOF_INFO pMofInfo)
void | PrintHelpMessage ()
void | PrintSummary ()
void | RemoveMofInfo (PLIST_ENTRY pMofInfo)

Variables

BOOL | bUserMode = FALSE
FILE * | DumpFile = NULL
PLIST_ENTRY | EventListHead = NULL
PEVENT_TRACE_LOGFILE | EvmFile [MAXLOGFILES]
BOOLEAN | fSummaryOnly = FALSE
ULONG | LogFileCount = 0
ULONG | PointerSize = sizeof(PVOID) * 8
FILE * | SummaryFile = NULL

Function Documentation

ULONG WINAPI BufferCallback ( PEVENT_TRACE_LOGFILE pLog )

Definition at line 412 of file tracedmp.cpp.

                   :

    Callback method for processing a buffer. Does not do anything but
    updating global counters.

Arguments:

    pLog - Pointer to a log file.

Return Value:

    Always TRUE.

--*/
{
    TotalBuffersRead++;
    return (TRUE);
}

ULONG CheckFile ( LPTSTR fileName )

Definition at line 1120 of file tracedmp.cpp.

                   :

    Checks whether a file exists and is readable.

Arguments:

    fileName - File name.

Return Value:

    Non-zero if the file exists and is readable. Zero otherwise.

--*/
{
    HANDLE hFile;
    ULONG Status;

    hFile = CreateFile(
                fileName,
                GENERIC_READ,
                FILE_SHARE_READ | FILE_SHARE_WRITE,
                NULL,
                OPEN_EXISTING,
                FILE_ATTRIBUTE_NORMAL,
                NULL
                );
    Status = (hFile != INVALID_HANDLE_VALUE);
    CloseHandle(hFile);
    return Status;
}

void CleanupEventList ( VOID )

Definition at line 1220 of file tracedmp.cpp.

                   :

    Cleans up a global event list.

Arguments:

Return Value:

    None.

--*/
{
    PLIST_ENTRY Head, Next;
    PMOF_INFO pMofInfo;
    TCHAR s[256];
    TCHAR wstr[256];
    PTCHAR str;

    if (EventListHead == NULL) {
        return;
    }

    Head = EventListHead;
    Next = Head->Flink;
    while (Head != Next) {
        RtlZeroMemory(&wstr, 256);

        pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);

        if (pMofInfo->EventCount > 0) {
            GuidToString(&s[0], &pMofInfo->Guid);
            str = s;
            if( pMofInfo->strDescription != NULL ){
                _tcscpy( wstr, pMofInfo->strDescription );
            }

            _ftprintf(SummaryFile,_T("|%10d    %-20s %-10s  %36s|\n"),
                      pMofInfo->EventCount,
                      wstr,
                      pMofInfo->strType ? pMofInfo->strType : GUID_TYPE_DEFAULT,
                      str);
        }

        RemoveEntryList(&pMofInfo->Entry);
        RemoveMofInfo(pMofInfo->ItemHeader);
        free(pMofInfo->ItemHeader);

        if (pMofInfo->strDescription != NULL)
            free(pMofInfo->strDescription);
        if (pMofInfo->strType != NULL)
            free(pMofInfo->strType);

        Next = Next->Flink;
        free(pMofInfo);
    }

    free(EventListHead);
}

void WINAPI DumpEvent ( PEVENT_TRACE pEvent )

Definition at line 438 of file tracedmp.cpp.

                   :

    Callback method for processing an event. It obtains the layout
    information by calling GetMofInfoHead(), which returns the pointer
    to the PMOF_INFO corresponding to the event type. Then it writes
    to the output file.

    NOTE: Only character arrays are supported in this program.

Arguments:

    pEvent - Pointer to an event.

Return Value:

    None.

--*/
{
    PEVENT_TRACE_HEADER pHeader;
    PMOF_INFO pMofInfo;

    TotalEventCount++;

    if (pEvent == NULL) {
        _tprintf(_T("Warning: Null Event\n"));
        return;
    }

    pHeader = (PEVENT_TRACE_HEADER) &pEvent->Header;

    // Extrace log file information if the event is a log file header.
    if( IsEqualGUID(&(pEvent->Header.Guid), &EventTraceGuid) &&
        pEvent->Header.Class.Type == EVENT_TRACE_TYPE_INFO ) {

        PTRACE_LOGFILE_HEADER head = (PTRACE_LOGFILE_HEADER)pEvent->MofData;
        if( NULL != head ){
            if(head->TimerResolution > 0){
                TimerResolution = head->TimerResolution / 10000;
            }

            StartTime  = head->StartTime.QuadPart;
            EndTime    = head->EndTime.QuadPart;
            // If ProcessTrace() call was made on areal time logger or an trace file being
            // logged, EndTime amy be 0.
            fNoEndTime = (EndTime == 0);

            TotalEventsLost += head->EventsLost;

            // We use global flags for private logger and pointer size.
            // This may cause an error when trace files are from different environments.
            bUserMode = (head->LogFileMode & EVENT_TRACE_PRIVATE_LOGGER_MODE);

            // Set pointer size
            PointerSize =  head->PointerSize * 8;
            if (PointerSize != 64){
                PointerSize = 32;
            }
        }
    }

    // if EndTime is missing from one of the files, keep updating to get the largest value.
    if (fNoEndTime && EndTime < (ULONGLONG) pHeader->TimeStamp.QuadPart) {
        EndTime = pHeader->TimeStamp.QuadPart;
    }

    // Find the MOF information for this event. This will retrieve the layout
    // information from WMI fi we don't already have it in our list.
    pMofInfo = GetMofInfoHead (
            pEvent->Header.Guid,
            pEvent->Header.Class.Type,
            pEvent->Header.Class.Version,
            pEvent->Header.Class.Level
        );

    if( NULL == pMofInfo ){
        // Could not locate event layout information.
        return;
    }

    pMofInfo->EventCount++;

    if( fSummaryOnly == TRUE ){
        return;
    }
    // At this point, pEvent and pMofInfo are not NULL. No need to check in PrintEvent().
    PrintEvent(pEvent, pMofInfo);

}

PMOF_INFO GetMofInfoHead | ( | GUID | Guid,
 |  | SHORT | nType,
 |  | SHORT | nVersion,
 |  | CHAR | nLevel
 | ) |  |

Definition at line 92 of file tracewmi.cpp.

                   :

    Find a matching event layout in the global linked list. If it
    is not found in the list, it calls GetGuids() to examine the WBEM
    namespace.
    If the global list is empty, it first creates a header.

Arguments:

    Guid - GUID for the event under consideration.
    nType - Event Type
    nVersion - Event Version
    nLevel - Event Level (not supported in this program)

Return Value:

    Pointer to MOF_INFO for the current event. If the layout
    information is not found anywhere, GetMofInfoHead() creates
    a dummy and returns it.

--*/
{
    PLIST_ENTRY Head, Next;
    PMOF_INFO pMofInfo;
    PMOF_INFO pBestMatch = NULL;
    SHORT nMatchLevel = 0;
    SHORT nMatchCheck;

    // Search the eventList for this Guid and find the head

    if (EventListHead == NULL) {
        // Initialize the MOF List and add the global header guid to it
        EventListHead = (PLIST_ENTRY) malloc(sizeof(LIST_ENTRY));
        if (EventListHead == NULL)
            return NULL;
        InitializeListHead(EventListHead);

        pMofInfo = GetNewMofInfo( EventTraceGuid, EVENT_TYPE_DEFAULT, 0, 0 );
        if( pMofInfo != NULL ){
            InsertTailList( EventListHead, &pMofInfo->Entry );
            pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(GUID_TYPE_EVENTTRACE)+1)*sizeof(TCHAR));
            if( pMofInfo->strDescription != NULL ){
                _tcscpy( pMofInfo->strDescription, GUID_TYPE_EVENTTRACE );
            }
            pMofInfo->strType = (LPTSTR)malloc((_tcslen(GUID_TYPE_HEADER)+1)*sizeof(TCHAR));
            if( pMofInfo->strType != NULL ){
                _tcscpy( pMofInfo->strType, GUID_TYPE_HEADER );
            }
        }
    }

    // Traverse the list and look for the Mof info head for this Guid.

    Head = EventListHead;
    Next = Head->Flink;

    while (Head != Next) {

        nMatchCheck = 0;

        pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
        Next = Next->Flink;

        if( IsEqualGUID(&pMofInfo->Guid, &Guid) ){

            if( pMofInfo->TypeIndex == nType ){
                nMatchCheck++;
            }
            if( pMofInfo->Version == nVersion ){
                nMatchCheck++;
            }
            if( nMatchCheck == 2 ){ // Exact Match
                return  pMofInfo;
            }

            if( nMatchCheck > nMatchLevel ){ // Close Match
                nMatchLevel = nMatchCheck;
                pBestMatch = pMofInfo;
            }

            if( pMofInfo->TypeIndex == EVENT_TYPE_DEFAULT && // Total Guess
                pBestMatch == NULL ){
                pBestMatch = pMofInfo;
            }
        }

    }

    if(pBestMatch != NULL){
        return pBestMatch;
    }

    // If one does not exist in the list, look it up in the file.
    pMofInfo = GetGuids( Guid, nVersion, nLevel, nType );

    // If still not found, create a unknown place holder
    if( NULL == pMofInfo ){
        pMofInfo = GetNewMofInfo( Guid, nType, nVersion, nLevel );
        if( pMofInfo != NULL ){
            pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(GUID_TYPE_UNKNOWN)+1)*sizeof(TCHAR));
            if( pMofInfo->strDescription != NULL ){
                _tcscpy( pMofInfo->strDescription, GUID_TYPE_UNKNOWN );
            }
            InsertTailList( EventListHead, &pMofInfo->Entry );
        }
    }

    return pMofInfo;
}

void GuidToString | ( | PTCHAR | s,
 |  | LPGUID | piid
 | ) |  |

Definition at line 1157 of file tracedmp.cpp.

                   :

    Converts a GUID into a string.

Arguments:

    s - String that will have the converted GUID.
    piid - GUID

Return Value:

    None.

--*/
{
    _stprintf(s, _T("{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"),
               piid->Data1, piid->Data2,
               piid->Data3,
               piid->Data4[0], piid->Data4[1],
               piid->Data4[2], piid->Data4[3],
               piid->Data4[4], piid->Data4[5],
               piid->Data4[6], piid->Data4[7]);
    return;
}

int __cdecl main | ( | int | argc,
 |  | LPTSTR * | argv
 | ) |  |

Definition at line 133 of file tracedmp.cpp.

                   :

    It is the main function.

Arguments:
Usage: tracedmp [options]  <EtlFile1 EtlFile2 ...>| [-h | -? | -help]
        -o <file>          Output CSV file
        -rt [LoggerName]   Realtime tracedmp from the logger [LoggerName]
        -summary           Summary.txt only
        -h
        -help
        -?                 Display usage information

Return Value:

    Error Code defined in winerror.h : If the function succeeds,
                it returns ERROR_SUCCESS (== 0).

--*/
{
    TCHAR DumpFileName[MAXSTR];
    TCHAR SummaryFileName[MAXSTR];

    LPTSTR *targv;

#ifdef UNICODE
    LPTSTR *cmdargv;
#endif

    PEVENT_TRACE_LOGFILE pLogFile;
    ULONG Status = ERROR_SUCCESS;
    ULONG i, j;
    TRACEHANDLE HandleArray[MAXLOGFILES];

#ifdef UNICODE
    if ((cmdargv = CommandLineToArgvW(
                        GetCommandLineW(),  // pointer to a command-line string
                        &argc               // receives the argument count
                        )) == NULL)
    {
        return(GetLastError());
    };
    targv = cmdargv ;
#else
    targv = argv;
#endif

    _tcscpy(DumpFileName, DUMP_FILE_NAME);
    _tcscpy(SummaryFileName, SUMMARY_FILE_NAME);

    while (--argc > 0) {
        ++targv;
        if (**targv == '-' || **targv == '/') {  // argument found
            if( **targv == '/' ){
                **targv = '-';
            }

            if ( !_tcsicmp(targv[0], _T("-summary")) ) {
                fSummaryOnly = TRUE;
            }
            else if (targv[0][1] == 'h' || targv[0][1] == 'H'
                                       || targv[0][1] == '?')
            {
                PrintHelpMessage();
                return ERROR_SUCCESS;
            }
            else if ( !_tcsicmp(targv[0], _T("-rt")) ) {
                TCHAR LoggerName[MAXSTR];
                _tcscpy(LoggerName, KERNEL_LOGGER_NAME);
                if (argc > 1) {
                   if (targv[1][0] != '-' && targv[1][0] != '/') {
                       ++targv; --argc;
                       _tcscpy(LoggerName, targv[0]);
                   }
                }

                pLogFile = (PEVENT_TRACE_LOGFILE) malloc(sizeof(EVENT_TRACE_LOGFILE));
                if (pLogFile == NULL){
                    _tprintf(_T("Allocation Failure\n"));
                    Status = ERROR_OUTOFMEMORY;
                    goto cleanup;
                }
                RtlZeroMemory(pLogFile, sizeof(EVENT_TRACE_LOGFILE));
                EvmFile[LogFileCount] = pLogFile;

                EvmFile[LogFileCount]->LogFileName = NULL;
                EvmFile[LogFileCount]->LoggerName =
                    (LPTSTR) malloc(MAXSTR * sizeof(TCHAR));

                if (EvmFile[LogFileCount]->LoggerName == NULL) {
                    _tprintf(_T("Allocation Failure\n"));
                    Status = ERROR_OUTOFMEMORY;
                    goto cleanup;
                }
                _tcscpy(EvmFile[LogFileCount]->LoggerName, LoggerName);

                _tprintf(_T("Setting RealTime mode for  %s\n"),
                        EvmFile[LogFileCount]->LoggerName);

                EvmFile[LogFileCount]->Context = NULL;
                EvmFile[LogFileCount]->BufferCallback = BufferCallback;
                EvmFile[LogFileCount]->BuffersRead = 0;
                EvmFile[LogFileCount]->CurrentTime = 0;
                EvmFile[LogFileCount]->EventCallback = &DumpEvent;
                EvmFile[LogFileCount]->LogFileMode = EVENT_TRACE_REAL_TIME_MODE;
                LogFileCount++;
            }
            else if ( !_tcsicmp(targv[0], _T("-o")) ) {
                if (argc > 1) {
                    if (targv[1][0] != '-' && targv[1][0] != '/') {
                        TCHAR drive[10];
                        TCHAR path[MAXSTR];
                        TCHAR file[MAXSTR];
                        TCHAR ext[MAXSTR];
                        ++targv; --argc;

                        _tfullpath(DumpFileName, targv[0], MAXSTR);
                        _tsplitpath( DumpFileName, drive, path, file, ext );
                        _tcscpy(ext,_T("csv"));
                        _tmakepath( DumpFileName, drive, path, file, ext );
                        _tcscpy(ext,_T("txt"));
                        _tmakepath( SummaryFileName, drive, path, file, ext );
                    }
                }
            }
        }
        else {
            pLogFile = (PEVENT_TRACE_LOGFILE) malloc(sizeof(EVENT_TRACE_LOGFILE));
            if (pLogFile == NULL){
                _tprintf(_T("Allocation Failure\n"));
                Status = ERROR_OUTOFMEMORY;
                goto cleanup;
            }
            RtlZeroMemory(pLogFile, sizeof(EVENT_TRACE_LOGFILE));
            EvmFile[LogFileCount] = pLogFile;

            EvmFile[LogFileCount]->LoggerName = NULL;
            EvmFile[LogFileCount]->LogFileName =
                (LPTSTR) malloc(MAXSTR*sizeof(TCHAR));
            if (EvmFile[LogFileCount]->LogFileName == NULL) {
                _tprintf(_T("Allocation Failure\n"));
                Status = ERROR_OUTOFMEMORY;
                goto cleanup;
            }

            _tfullpath(EvmFile[LogFileCount]->LogFileName, targv[0], MAXSTR);
            _tprintf(_T("Setting log file to: %s\n"),
                     EvmFile[LogFileCount]->LogFileName);
            // If one of the log files is not readable, exit.
            if (!CheckFile(EvmFile[LogFileCount]->LogFileName)) {
                _tprintf(_T("Cannot open logfile for reading\n"));
                Status = ERROR_INVALID_PARAMETER;
                goto cleanup;
            }
            EvmFile[LogFileCount]->Context = NULL;
            EvmFile[LogFileCount]->BufferCallback = BufferCallback;
            EvmFile[LogFileCount]->BuffersRead = 0;
            EvmFile[LogFileCount]->CurrentTime = 0;
            EvmFile[LogFileCount]->EventCallback = &DumpEvent;
            LogFileCount++;
        }
    }

    if (LogFileCount <= 0) {
        PrintHelpMessage();
        return Status;
    }

    // OpenTrace calls
    for (i = 0; i < LogFileCount; i++) {
        TRACEHANDLE x;

        x = OpenTrace(EvmFile[i]);
        HandleArray[i] = x;
        if (HandleArray[i] == 0) {
            Status = GetLastError();
            _tprintf(_T("Error Opening Trace %d with status=%d\n"),
                                                           i, Status);

            for (j = 0; j < i; j++)
                CloseTrace(HandleArray[j]);
            goto cleanup;
        }
    }

    // Open files.
    if (!fSummaryOnly)
    {
        DumpFile = _tfopen(DumpFileName, _T("w"));
        if (DumpFile == NULL) {
            Status = ERROR_INVALID_PARAMETER;
            _tprintf(_T("DumpFile is NULL\n"));
            goto cleanup;
        }
    }
    SummaryFile = _tfopen(SummaryFileName, _T("w"));
    if (SummaryFile == NULL) {
        Status = ERROR_INVALID_PARAMETER;
        _tprintf(_T("SummaryFile is NULL\n"));
        goto cleanup;
    }

    if (!fSummaryOnly)
    {
        PrintDumpHeader();
    }

    // At this point, users can set a different trace callback function for
    // a specific GUID using SetTraceCallback(). Also RemoveTraceCallback() allows
    // users to remove a callback function for a specific GUID. In this way, users
    // can customize callbacks based on GUIDs.

    // Actual processing takes place here. EventCallback function will be invoked
    // for each event.
    // We do not use start and end time parameters in this sample.
    Status = ProcessTrace(
            HandleArray,
            LogFileCount,
            NULL,
            NULL
            );

    if (Status != ERROR_SUCCESS) {
        _tprintf(_T("Error processing with status=%dL (GetLastError=0x%x)\n"),
                Status, GetLastError());
    }

    for (j = 0; j < LogFileCount; j++){
        Status = CloseTrace(HandleArray[j]);
        if (Status != ERROR_SUCCESS) {
            _tprintf(_T("Error Closing Trace %d with status=%d\n"), j, Status);
        }
    }

    // Write summary.
    PrintSummary();

cleanup:
    if (!fSummaryOnly && DumpFile != NULL)  {
        _tprintf(_T("Event traces dumped to %s\n"), DumpFileName);
        fclose(DumpFile);
    }

    if(SummaryFile != NULL){
        _tprintf(_T("Event Summary dumped to %s\n"), SummaryFileName);
        fclose(SummaryFile);
    }

    for (i = 0; i < LogFileCount; i ++)
    {
        if (EvmFile[i]->LoggerName != NULL)
        {
            free(EvmFile[i]->LoggerName);
            EvmFile[i]->LoggerName = NULL;
        }
        if (EvmFile[i]->LogFileName != NULL)
        {
            free(EvmFile[i]->LogFileName);
            EvmFile[i]->LogFileName = NULL;
        }
        free(EvmFile[i]);
    }
#ifdef UNICODE
    GlobalFree(cmdargv);
#endif

    SetLastError(Status);
    if(Status != ERROR_SUCCESS ){
        _tprintf(_T("Exit Status: %d\n"), Status);
    }

    return Status;
}

void PrintDumpHeader ( )

Definition at line 537 of file tracedmp.cpp.

                   :

    Prints out column headers to a dump file.

Arguments:

    None

Return Value:

    None

--*/
{
    _ftprintf(DumpFile,
        _T("%12s, %10s,%7s,%21s,%11s,%11s, User Data\n"),
        _T("Event Name"), _T("Type"), _T("TID"), _T("Clock-Time"),
        _T("Kernel(ms)"), _T("User(ms)")
        );
}

void PrintEvent | ( | PEVENT_TRACE | pEvent,
 |  | PMOF_INFO | pMofInfo
 | ) |  |

Definition at line 619 of file tracedmp.cpp.

                   :

    Dumps event data into a dump file.

Arguments:

    None

Return Value:

    None

--*/
{
    PEVENT_TRACE_HEADER pHeader = (PEVENT_TRACE_HEADER) &pEvent->Header;
    ULONG   i;
    PITEM_DESC pItem;
    CHAR str[MOFSTR];
    WCHAR wstr[MOFWSTR];
    PCHAR ptr;
    ULONG ulongword;
    LONG  longword;
    USHORT ushortword;
    SHORT  shortword;
    CHAR iChar;
    WCHAR iwChar;
    ULONG MofDataUsed;
    PLIST_ENTRY Head, Next;

    // Print a general information on the event.
    if ( pMofInfo->strDescription != NULL ){
        _ftprintf( DumpFile, _T("%12s, "), pMofInfo->strDescription );
    }
    else {
        TCHAR strGuid[MAXSTR];
        GuidToString( strGuid, &pMofInfo->Guid );
        _ftprintf( DumpFile, _T("%12s, "), strGuid );
    }

    if (pMofInfo->strType != NULL && _tcslen(pMofInfo->strType) ){
        _ftprintf( DumpFile, _T("%10s, "), pMofInfo->strType );
    }
    else {
        _ftprintf( DumpFile, _T("%10d, "), pEvent->Header.Class.Type );
    }

    // Thread ID
    _ftprintf( DumpFile, _T("0x%04X, "), pHeader->ThreadId );

    // System Time
    _ftprintf( DumpFile, _T("%20I64u, "), pHeader->TimeStamp.QuadPart);

    if ( bUserMode == FALSE ){
        // Kernel Time
        _ftprintf(DumpFile, _T("%10lu, "), pHeader->KernelTime * TimerResolution);

        // User Time
        _ftprintf(DumpFile, _T("%10lu, "), pHeader->UserTime * TimerResolution);
    }
    else {
        // processor Time
        _ftprintf(DumpFile, _T("%I64u, "), pHeader->ProcessorTime);
    }

    if (NULL == pEvent->MofData && pEvent->MofLength != 0) {
        _tprintf(_T("Incorrect MOF size\n"));
        return;
    }

    Head = pMofInfo->ItemHeader;
    Next = Head->Flink;
    ptr = (PCHAR)(pEvent->MofData);

    // If we cannot locate layout information, just print the size.
    if ((Head == Next) && (pEvent->MofLength > 0)) {
         _ftprintf(DumpFile, _T("DataSize=%d, "), pEvent->MofLength);
    }

    // Print event-specific data.
    while (Head != Next) {
        pItem = CONTAINING_RECORD(Next, ITEM_DESC, Entry);
        Next = Next->Flink;

        MofDataUsed = (ULONG) (ptr - (PCHAR)(pEvent->MofData));

        if (MofDataUsed >= pEvent->MofLength){
            break;
        }

        switch (pItem->ItemType)
        {
        case ItemChar:      // char
        case ItemUChar:     // unsigned char
            for( i = 0; i < pItem->ArraySize; i++){
                iChar = *((PCHAR) ptr);
                _ftprintf(DumpFile,   _T("%c"), iChar);
                ptr += sizeof(CHAR);
            }
            _ftprintf(DumpFile, _T(", "));
            break;

        case ItemWChar:     // wide char
            for(i = 0;i < pItem->ArraySize; i++){
                iwChar = *((PWCHAR) ptr);
                _ftprintf(DumpFile, _T(",%wc"), iwChar);
                ptr += sizeof(WCHAR);
            }
            _ftprintf(DumpFile, _T(", "));
            break;

        case ItemCharShort: // char as a number
            iChar = *((PCHAR) ptr);
            _ftprintf(DumpFile, _T("%d, "), iChar);
            ptr += sizeof(CHAR);
            break;

        case ItemShort:     // short
            shortword = * ((PSHORT) ptr);
            _ftprintf(DumpFile, _T("%6d, "), shortword);
            ptr += sizeof (SHORT);
            break;

        case ItemUShort:    // unsigned short
            ushortword = *((PUSHORT) ptr);
            _ftprintf(DumpFile, _T("%6u, "), ushortword);
            ptr += sizeof (USHORT);
            break;

        case ItemLong:      // long
            longword = *((PLONG) ptr);
            _ftprintf(DumpFile, _T("%8d, "), longword);
            ptr += sizeof (LONG);
            break;

        case ItemULong:     // unsigned long
            ulongword = *((PULONG) ptr);
            _ftprintf(DumpFile, _T("%8lu, "), ulongword);
            ptr += sizeof (ULONG);
            break;

        case ItemULongX:    // unsinged long as hex
            ulongword = *((PULONG) ptr);
            _ftprintf(DumpFile, _T("0x%08X, "), ulongword);
            ptr += sizeof (ULONG);
            break;

        case ItemLongLong:
        {
            LONGLONG n64;   // longlong
            n64 = *((LONGLONG*) ptr);
            ptr += sizeof(LONGLONG);
            _ftprintf(DumpFile, _T("%16I64d, "), n64);
            break;
        }

        case ItemULongLong: // unsigned longlong
        {
            ULONGLONG n64;
            n64 = *((ULONGLONG*) ptr);
            ptr += sizeof(ULONGLONG);
            _ftprintf(DumpFile, _T("%16I64u, "), n64);
            break;
        }

        case ItemFloat:     // float
        {
            float f32;
            f32 = *((float*) ptr);
            ptr += sizeof(float);
            _ftprintf(DumpFile, _T("%f, "), f32);
            break;
        }

        case ItemDouble:    // double
        {
            double f64;
            f64 = *((double*) ptr);
            ptr += sizeof(double);
            _ftprintf(DumpFile, _T("%f, "), f64);
            break;
        }

        case ItemPtr :      // pointer
        {
            unsigned __int64 pointer;
            if (PointerSize == 64) {
                pointer = *((unsigned __int64 *) ptr);
                _ftprintf(DumpFile, _T("0x%X, "), pointer);
                ptr += 8;
            }
            else {      // assumes 32 bit otherwise
                ulongword = *((PULONG) ptr);
                _ftprintf(DumpFile, _T("0x%08X, "), ulongword);
                ptr += 4;
            }
            break;
        }

        case ItemIPAddr:    // IP address
        {
            ulongword = *((PULONG) ptr);

            // Convert it to readable form
            _ftprintf(DumpFile, _T("%03d.%03d.%03d.%03d, "),
                    (ulongword >>  0) & 0xff,
                    (ulongword >>  8) & 0xff,
                    (ulongword >> 16) & 0xff,
                    (ulongword >> 24) & 0xff);
            ptr += sizeof (ULONG);
            break;
        }

        case ItemPort:      // Port
        {
            _ftprintf(DumpFile, _T("%u, "), NTOHS(*((PUSHORT)ptr)));
            ptr += sizeof (USHORT);
            break;
        }

        case ItemString:    // NULL-terminated char string
        {
            USHORT pLen = (USHORT)strlen((CHAR*) ptr);

            if (pLen > 0)
            {
                strcpy(str, ptr);
                for (i = pLen-1; i > 0; i--) {
                    if (str[i] == 0xFF)
                        str[i] = 0;
                    else break;
                }
#ifdef UNICODE
                MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
                _ftprintf(DumpFile, _T("\"%ws\","), wstr);
#else
                _ftprintf(DumpFile, _T("\"%s\","), str);
#endif
            }
            ptr += (pLen + 1);
            break;
        }

        case ItemWString:   // NULL-terminated wide char string
        {
            size_t  pLen = 0;
            size_t     i;

            if (*(PWCHAR)ptr)
            {
                pLen = ((wcslen((PWCHAR)ptr) + 1) * sizeof(WCHAR));
                RtlCopyMemory(wstr, ptr, pLen);
                // Unused space in a buffer is filled with 0xFFFF.
                // Replace them with 0, just in case.
                for (i = (pLen / 2) - 1; i > 0; i--)
                {
                    if (((USHORT) wstr[i] == (USHORT) 0xFFFF))
                    {
                        wstr[i] = (USHORT) 0;
                    }
                    else break;
                }

                wstr[pLen / 2] = wstr[(pLen / 2) + 1]= '\0';
                _ftprintf(DumpFile, _T("\"%ws\","), wstr);
            }
            ptr += pLen;

            break;
        }

        case ItemDSString:   // Counted String
        {
            USHORT pLen = (USHORT)(256 * ((USHORT) * ptr) + ((USHORT) * (ptr + 1)));
            ptr += sizeof(USHORT);
            if (pLen > (pEvent->MofLength - MofDataUsed - 1)) {
                pLen = (USHORT) (pEvent->MofLength - MofDataUsed - 1);
            }
            if (pLen > 0)
            {
                strncpy(str, ptr, pLen);
                str[pLen] = '\0';
#ifdef UNICODE
                MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
                fwprintf(DumpFile, _T("\"%ws\","), wstr);
#else
                fprintf(DumpFile, _T("\"%s\","), str);
#endif
            }
            ptr += (pLen + 1);
            break;
        }

        case ItemPString:   // Counted String
        {
            USHORT pLen = * ((USHORT *) ptr);
            ptr += sizeof(USHORT);

            if (pLen > (pEvent->MofLength - MofDataUsed)) {
                pLen = (USHORT) (pEvent->MofLength - MofDataUsed);
            }

            if (pLen > MOFSTR * sizeof(CHAR)) {
                pLen = MOFSTR * sizeof(CHAR);
            }
            if (pLen > 0) {
                RtlCopyMemory(str, ptr, pLen);
                str[pLen] = '\0';
#ifdef UNICODE
                MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
                _ftprintf(DumpFile, _T("\"%ws\","), wstr);
#else
                _ftprintf(DumpFile, _T("\"%s\","), str);
#endif
            }
            ptr += pLen;
            break;
        }

        case ItemDSWString:  // DS Counted Wide Strings
        case ItemPWString:   // Counted Wide Strings
        {
            USHORT pLen = (USHORT)(( pItem->ItemType == ItemDSWString)
                        ? (256 * ((USHORT) * ptr) + ((USHORT) * (ptr + 1)))
                        : (* ((USHORT *) ptr)));

            ptr += sizeof(USHORT);
            if (pLen > (pEvent->MofLength - MofDataUsed)) {
                pLen = (USHORT) (pEvent->MofLength - MofDataUsed);
            }

            if (pLen > MOFWSTR * sizeof(WCHAR)) {
                pLen = MOFWSTR * sizeof(WCHAR);
            }
            if (pLen > 0) {
                RtlCopyMemory(wstr, ptr, pLen);
                wstr[pLen / sizeof(WCHAR)] = L'\0';
                _ftprintf(DumpFile, _T("\"%ws\","), wstr);
            }
            ptr += pLen;
            break;
        }

        case ItemNWString:   // Non Null Terminated String
        {
           USHORT Size;

           Size = (USHORT)(pEvent->MofLength - (ULONG)(ptr - (PCHAR)(pEvent->MofData)));
           if( Size > MOFSTR )
           {
               Size = MOFSTR;
           }
           if (Size > 0)
           {
               RtlCopyMemory(wstr, ptr, Size);
               wstr[Size / 2] = '\0';
               _ftprintf(DumpFile, _T("\"%ws\","), wstr);
           }
           ptr += Size;
           break;
        }

        case ItemMLString:  // Multi Line String
        {
            USHORT   pLen;
            char   * src, * dest;
            BOOL     inQ       = FALSE;
            BOOL     skip      = FALSE;
            UINT     lineCount = 0;

            ptr += sizeof(UCHAR) * 2;
            pLen = (USHORT)strlen(ptr);
            if (pLen > 0)
            {
                src = ptr;
                dest = str;
                while (* src != '\0'){
                    if (* src == '\n'){
                        if (!lineCount){
                            * dest++ = ' ';
                        }
                        lineCount++;
                    }else if (* src == '\"'){
                        if (inQ){
                            char   strCount[32];
                            char * cpy;

                            sprintf(strCount, "{%dx}", lineCount);
                            cpy = & strCount[0];
                            while (* cpy != '\0'){
                                * dest ++ = * cpy ++;
                            }
                        }
                        inQ = !inQ;
                    }else if (!skip){
                        *dest++ = *src;
                    }
                    skip = (lineCount > 1 && inQ);
                    src++;
                }
                *dest = '\0';
#ifdef UNICODE
                MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
                _ftprintf(DumpFile, _T("\"%ws\","), wstr);
#else
                _ftprintf(DumpFile, _T("\"%s\","), str);
#endif
            }
            ptr += (pLen);
            break;
        }

        case ItemSid:       // SID
        {
            WCHAR        UserName[64];
            WCHAR        Domain[64];
            WCHAR        FullName[256];
            ULONG        asize = 0;
            ULONG        bsize = 0;
            ULONG        SidMarker;
            SID_NAME_USE Se;
            ULONG        nSidLength;

            RtlCopyMemory(&SidMarker, ptr, sizeof(ULONG));
            if (SidMarker == 0){
                ptr += 4;
                fwprintf(DumpFile,   L"0, ");
            }
            else
            {
                if (PointerSize == 64) {
                    ptr += 16;           // skip the TOKEN_USER structure
                }
                else {
                    ptr += 8;            // skip the TOKEN_USER structure
                }
                nSidLength = 8 + (4*ptr[1]);

                asize = 64;
                bsize = 64;
                if (LookupAccountSidW(
                                NULL,
                               (PSID) ptr,
                               (LPWSTR) & UserName[0],
                               & asize,
                               (LPWSTR) & Domain[0],
                               & bsize,
                               & Se))
                {
                    LPWSTR pFullName = &FullName[0];
                    swprintf(pFullName, L"\\\\%s\\%s", Domain, UserName);
                    asize = (ULONG)  lstrlenW(pFullName);
                    if (asize > 0){
                         fwprintf(DumpFile,   L"\"%s\", ", pFullName);
                    }
                }
                else
                {
                     fwprintf(DumpFile,   L"\"System\", " );
                }
                SetLastError( ERROR_SUCCESS );
                ptr += nSidLength;
            }
            break;
        }

        case ItemGuid:      // GUID
        {
            TCHAR s[64];
            GuidToString(s, (LPGUID)ptr);
            _ftprintf(DumpFile,   _T("%s, "), s);
            ptr += sizeof(GUID);
            break;
        }
        case ItemBool:      // boolean
        {
            BOOL Flag = (BOOL)*ptr;
            _ftprintf(DumpFile, _T("%5s, "), (Flag) ? _T("TRUE") : _T("FALSE"));
            ptr += sizeof(BOOL);
            break;
        }

        default:
            ptr += sizeof (int);
        }
    }

    //Instance ID
    _ftprintf(DumpFile, _T("%d,"), pEvent->InstanceId);

    //Parent Instance ID
    _ftprintf(DumpFile, _T("%d\n"), pEvent->ParentInstanceId);

}

void PrintHelpMessage ( )

Definition at line 1189 of file tracedmp.cpp.

                   :

    Prints out help messages.

Arguments:

    None

Return Value:

    None

--*/
{
    _tprintf(
        _T("Usage: tracedmp [options]  <EtlFile1 EtlFile2 ...>| [-h | -? | -help]\n")
        _T("\t-o <file>          Output CSV file\n")
        _T("\t-rt [LoggerName]   Realtime tracedmp from the logger [LoggerName]\n")
        _T("\t-summary           Summary.txt only\n")
        _T("\t-h\n")
        _T("\t-help\n")
        _T("\t-?                 Display usage information\n")
        _T("\n")
        _T("\tDefault output file is dumpfile.csv\n")
    );
}

void PrintSummary ( )

Definition at line 561 of file tracedmp.cpp.

                   :

    Prints out a event summary into a dump file while cleaning the event list.

Arguments:

    None

Return Value:

    None

--*/
{
    ULONG i;

    _ftprintf(SummaryFile,_T("Files Processed:\n"));
    for (i = 0; i < LogFileCount; i++) {
        _ftprintf(SummaryFile, _T("\t%s\n"),EvmFile[i]->LogFileName);
    }

    ElapseTime = EndTime - StartTime;
    _ftprintf(SummaryFile,
              _T("Total Buffers Processed %d\n")
              _T("Total Events  Processed %d\n")
              _T("Total Events  Lost      %d\n")
              _T("Start Time              0x%016I64X\n")
              _T("End Time                0x%016I64X\n")
              _T("Elapsed Time            %I64d sec\n"),
              TotalBuffersRead,
              TotalEventCount,
              TotalEventsLost,
              StartTime,
              EndTime,
              (ElapseTime / 10000000) );

    _ftprintf(SummaryFile,
       _T("+-------------------------------------------------------------------------------------+\n")
       _T("|%10s    %-20s %-10s  %-36s  |\n")
       _T("+-------------------------------------------------------------------------------------+\n"),
       _T("EventCount"),
       _T("EventName"),
       _T("EventType"),
       _T("Guid")
        );

    // Print event GUIDs while cleaning up.
    CleanupEventList();

    _ftprintf(SummaryFile,
        _T("+-------------------------------------------------------------------------------------+\n")
         );
}

void RemoveMofInfo ( PLIST_ENTRY pMofInfo )

Definition at line 1352 of file tracewmi.cpp.

                   :

    Removes and frees data item structs from a given list.

Arguments:

    pMofInfo - Pointer to the MOF_INFO to be purged of data item structs.

Return Value:

    None.

--*/
{
    PLIST_ENTRY Head, Next;
    PITEM_DESC pItem;

    Head = pMofInfo;
    Next = Head->Flink;
    while (Head != Next) {
        pItem = CONTAINING_RECORD(Next, ITEM_DESC, Entry);
        Next = Next->Flink;
        RemoveEntryList(&pItem->Entry);
        free(pItem);
    }
}

Variable Documentation

BOOL bUserMode = FALSE

Definition at line 128 of file tracedmp.cpp.

FILE* DumpFile = NULL

Definition at line 104 of file tracedmp.cpp.

PLIST_ENTRY EventListHead = NULL

Definition at line 131 of file tracedmp.cpp.

PEVENT_TRACE_LOGFILE EvmFile[MAXLOGFILES]

Definition at line 124 of file tracedmp.cpp.

BOOLEAN fSummaryOnly = FALSE

Definition at line 118 of file tracedmp.cpp.

ULONG LogFileCount = 0

Definition at line 125 of file tracedmp.cpp.

ULONG PointerSize = sizeof(PVOID) * 8

Definition at line 121 of file tracedmp.cpp.

FILE* SummaryFile = NULL

Definition at line 105 of file tracedmp.cpp.

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceDmp/tracedmp.h File Reference

  • WinBase
  • EventTrace
  • TraceDmp
Classes | Defines | Typedefs | Enumerations

tracedmp.h File Reference

#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <wbemidl.h>
#include <shellapi.h>
#include <tchar.h>
#include <wmistr.h>
#include <objbase.h>
#include <initguid.h>
#include <evntrace.h>
#include <objidl.h>

Go to the source code of this file.

Classes

struct | _ITEM_DESC
struct | _MOF_INFO

Defines

#define | DEFAULT_NAMESPACE _T("root\\wmi")
#define | DUMP_FILE_NAME _T("DumpFile.csv")
#define | EVENT_LEVEL_DEFAULT (-1)
#define | EVENT_TYPE_DEFAULT (-1)
#define | EVENT_VERSION_DEFAULT (-1)
#define | GUID_TYPE_DEFAULT _T("Default")
#define | GUID_TYPE_EVENTTRACE _T("EventTrace")
#define | GUID_TYPE_HEADER _T("Header")
#define | GUID_TYPE_UNKNOWN _T("Unknown")
#define | InitializeListHead(ListHead)
#define | InsertTailList(ListHead, Entry)
#define | IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
#define | MAXLOGFILES 16
#define | MAXPROPS 256
#define | MAXSTR 1024
#define | MAXTYPE 256
#define | MOFSTR 2048
#define | MOFWSTR 1024
#define | NTOHS(x) ( (UC(x) * 256) + UC((x) >> 8) )
#define | RemoveEntryList(Entry)
#define | STR_ItemBool _T("ItemBool")
#define | STR_ItemChar _T("ItemChar")
#define | STR_ItemCharShort _T("ItemCharShort")
#define | STR_ItemDouble _T("ItemDouble");
#define | STR_ItemDSString _T("ItemDSString")
#define | STR_ItemDSWString _T("ItemDSWString")
#define | STR_ItemFloat _T("ItemFloat");
#define | STR_ItemGuid _T("ItemGuid")
#define | STR_ItemIPAddr _T("ItemIPAddr")
#define | STR_ItemLong _T("ItemLong")
#define | STR_ItemLongLong _T("ItemLongLong")
#define | STR_ItemMLString _T("ItemMLString")
#define | STR_ItemNWString _T("ItemNWString")
#define | STR_ItemPort _T("ItemPort")
#define | STR_ItemPString _T("ItemPString")
#define | STR_ItemPtr _T("ItemPtr")
#define | STR_ItemPWString _T("ItemPWString")
#define | STR_ItemShort _T("ItemShort")
#define | STR_ItemSid _T("ItemSid")
#define | STR_ItemString _T("ItemString")
#define | STR_ItemUChar _T("ItemUChar")
#define | STR_ItemULong _T("ItemULong")
#define | STR_ItemULongLong _T("ItemULongLong")
#define | STR_ItemULongX _T("ItemULongX")
#define | STR_ItemUShort _T("ItemUShort")
#define | STR_ItemWChar _T("ItemWChar")
#define | STR_ItemWString _T("ItemWString")
#define | SUMMARY_FILE_NAME _T("Summary.txt")
#define | UC(x) ( (UINT)((x) & 0xFF) )

Typedefs

typedef struct _ITEM_DESC | ITEM_DESC
typedef enum _ITEM_TYPE | ITEM_TYPE
typedef struct _MOF_INFO | MOF_INFO
typedef struct _ITEM_DESC * | PITEM_DESC
typedef struct _MOF_INFO * | PMOF_INFO

Enumerations

enum _ITEM_TYPE {
ItemChar, ItemWChar, ItemUChar, ItemCharShort,
ItemShort, ItemUShort, ItemLong, ItemULong,
ItemULongX, ItemLongLong, ItemULongLong, ItemFloat,
ItemDouble, ItemString, ItemWString, ItemPString,
ItemPWString, ItemDSString, ItemDSWString, ItemSid,
ItemIPAddr, ItemPort, ItemMLString, ItemNWString,
ItemPtr, ItemGuid, ItemBool, ItemUnknown
}

Define Documentation

#define DEFAULT_NAMESPACE _T("root\\wmi")

Definition at line 26 of file tracedmp.h.

#define DUMP_FILE_NAME _T("DumpFile.csv")

Definition at line 23 of file tracedmp.h.

#define EVENT_LEVEL_DEFAULT (-1)

Definition at line 61 of file tracedmp.h.

#define EVENT_TYPE_DEFAULT (-1)

Definition at line 60 of file tracedmp.h.

#define EVENT_VERSION_DEFAULT (-1)

Definition at line 62 of file tracedmp.h.

#define GUID_TYPE_DEFAULT _T("Default")

Definition at line 58 of file tracedmp.h.

#define GUID_TYPE_EVENTTRACE _T("EventTrace")

Definition at line 55 of file tracedmp.h.

#define GUID_TYPE_HEADER _T("Header")

Definition at line 56 of file tracedmp.h.

#define GUID_TYPE_UNKNOWN _T("Unknown")

Definition at line 57 of file tracedmp.h.

#define InitializeListHead ( ListHead )
Value:
(\
    (ListHead)->Flink = (ListHead)->Blink = (ListHead))

Definition at line 31 of file tracedmp.h.

#define InsertTailList | ( | ListHead,
 |  | Entry
 | ) |
Value:
{\
    PLIST_ENTRY _EX_Blink;\
    PLIST_ENTRY _EX_ListHead;\
    _EX_ListHead = (ListHead);\
    _EX_Blink = _EX_ListHead->Blink;\
    (Entry)->Flink = _EX_ListHead;\
    (Entry)->Blink = _EX_Blink;\
    _EX_Blink->Flink = (Entry);\
    _EX_ListHead->Blink = (Entry);\
    }

Definition at line 34 of file tracedmp.h.

#define IsEqualGUID | ( | rguid1,
 |  | rguid2 |
 | ) |  | (!memcmp(rguid1, rguid2, sizeof(GUID)))

Definition at line 28 of file tracedmp.h.

#define MAXLOGFILES 16

Definition at line 13 of file tracedmp.h.

#define MAXPROPS 256

Definition at line 21 of file tracedmp.h.

#define MAXSTR 1024

Definition at line 14 of file tracedmp.h.

#define MAXTYPE 256

Definition at line 17 of file tracedmp.h.

#define MOFSTR 2048

Definition at line 16 of file tracedmp.h.

#define MOFWSTR 1024

Definition at line 15 of file tracedmp.h.

#define NTOHS ( x ) ( (UC(x) * 256) + UC((x) >> 8) )

Definition at line 19 of file tracedmp.h.

#define RemoveEntryList ( Entry )
Value:
{\
    PLIST_ENTRY _EX_Blink;\
    PLIST_ENTRY _EX_Flink;\
    _EX_Flink = (Entry)->Flink;\
    _EX_Blink = (Entry)->Blink;\
    _EX_Blink->Flink = _EX_Flink;\
    _EX_Flink->Blink = _EX_Blink;\
    }

Definition at line 45 of file tracedmp.h.

#define STR_ItemBool _T("ItemBool")

Definition at line 92 of file tracedmp.h.

#define STR_ItemChar _T("ItemChar")

Definition at line 66 of file tracedmp.h.

#define STR_ItemCharShort _T("ItemCharShort")

Definition at line 69 of file tracedmp.h.

#define STR_ItemDouble _T("ItemDouble");

Definition at line 78 of file tracedmp.h.

#define STR_ItemDSString _T("ItemDSString")

Definition at line 83 of file tracedmp.h.

#define STR_ItemDSWString _T("ItemDSWString")

Definition at line 84 of file tracedmp.h.

#define STR_ItemFloat _T("ItemFloat");

Definition at line 77 of file tracedmp.h.

#define STR_ItemGuid _T("ItemGuid")

Definition at line 91 of file tracedmp.h.

#define STR_ItemIPAddr _T("ItemIPAddr")

Definition at line 87 of file tracedmp.h.

#define STR_ItemLong _T("ItemLong")

Definition at line 72 of file tracedmp.h.

#define STR_ItemLongLong _T("ItemLongLong")

Definition at line 75 of file tracedmp.h.

#define STR_ItemMLString _T("ItemMLString")

Definition at line 85 of file tracedmp.h.

#define STR_ItemNWString _T("ItemNWString")

Definition at line 89 of file tracedmp.h.

#define STR_ItemPort _T("ItemPort")

Definition at line 88 of file tracedmp.h.

#define STR_ItemPString _T("ItemPString")

Definition at line 81 of file tracedmp.h.

#define STR_ItemPtr _T("ItemPtr")

Definition at line 90 of file tracedmp.h.

#define STR_ItemPWString _T("ItemPWString")

Definition at line 82 of file tracedmp.h.

#define STR_ItemShort _T("ItemShort")

Definition at line 70 of file tracedmp.h.

#define STR_ItemSid _T("ItemSid")

Definition at line 86 of file tracedmp.h.

#define STR_ItemString _T("ItemString")

Definition at line 79 of file tracedmp.h.

#define STR_ItemUChar _T("ItemUChar")

Definition at line 68 of file tracedmp.h.

#define STR_ItemULong _T("ItemULong")

Definition at line 73 of file tracedmp.h.

#define STR_ItemULongLong _T("ItemULongLong")

Definition at line 76 of file tracedmp.h.

#define STR_ItemULongX _T("ItemULongX")

Definition at line 74 of file tracedmp.h.

#define STR_ItemUShort _T("ItemUShort")

Definition at line 71 of file tracedmp.h.

#define STR_ItemWChar _T("ItemWChar")

Definition at line 67 of file tracedmp.h.

#define STR_ItemWString _T("ItemWString")

Definition at line 80 of file tracedmp.h.

#define SUMMARY_FILE_NAME _T("Summary.txt")

Definition at line 24 of file tracedmp.h.

#define UC ( x ) ( (UINT)((x) & 0xFF) )

Definition at line 18 of file tracedmp.h.

Typedef Documentation

typedef struct _ITEM_DESC ITEM_DESC
typedef enum _ITEM_TYPE ITEM_TYPE
typedef struct _MOF_INFO MOF_INFO
typedef struct _ITEM_DESC * PITEM_DESC
typedef struct _MOF_INFO * PMOF_INFO

Enumeration Type Documentation

enum _ITEM_TYPE
Enumerator:
ItemChar
ItemWChar
ItemUChar
ItemCharShort
ItemShort
ItemUShort
ItemLong
ItemULong
ItemULongX
ItemLongLong
ItemULongLong
ItemFloat
ItemDouble
ItemString
ItemWString
ItemPString
ItemPWString
ItemDSString
ItemDSWString
ItemSid
ItemIPAddr
ItemPort
ItemMLString
ItemNWString
ItemPtr
ItemGuid
ItemBool
ItemUnknown

Definition at line 94 of file tracedmp.h.

                        {
    ItemChar,
    ItemWChar,
    ItemUChar,
    ItemCharShort,
    ItemShort,
    ItemUShort,
    ItemLong,
    ItemULong,
    ItemULongX,
    ItemLongLong,
    ItemULongLong,
    ItemFloat,
    ItemDouble,
    ItemString,
    ItemWString,
    ItemPString,
    ItemPWString,
    ItemDSString,
    ItemDSWString,
    ItemSid,
    ItemIPAddr,
    ItemPort,
    ItemMLString,
    ItemNWString,
    ItemPtr,
    ItemGuid,
    ItemBool,
    ItemUnknown
} ITEM_TYPE;

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceDmp/tracewmi.cpp File Reference

  • WinBase
  • EventTrace
  • TraceDmp
Functions | Variables

tracewmi.cpp File Reference

#include "tracedmp.h"

Go to the source code of this file.

Functions

void | AddMofInfo (PLIST_ENTRY List, LPTSTR strType, ITEM_TYPE nType, UINT ArraySize)
void | FlushMofList (PLIST_ENTRY ListHead)
ULONG | GetArraySize (IN IWbemQualifierSet *pQualSet)
PMOF_INFO | GetGuids (GUID Guid, SHORT nVersion, CHAR nLevel, SHORT nType)
ITEM_TYPE | GetItemType (IN CIMTYPE_ENUMERATION CimType, IN IWbemQualifierSet *pQualSet)
PMOF_INFO | GetMofInfoHead (GUID Guid, SHORT nType, SHORT nVersion, CHAR nLevel)
PMOF_INFO | GetNewMofInfo (GUID guid, SHORT nType, SHORT nVersion, CHAR nLevel)
PMOF_INFO | GetPropertiesFromWBEM (IWbemClassObject *pTraceSubClasses, GUID Guid, SHORT nVersion, CHAR nLevel, SHORT nType)
void | GuidToString (PTCHAR s, LPGUID piid)
void | RemoveMofInfo (PLIST_ENTRY pMofInfo)
HRESULT | WbemConnect (IWbemServices **pWbemServices)

Variables

PLIST_ENTRY | EventListHead
IWbemServices * | pWbemServices = NULL

Function Documentation

void AddMofInfo | ( | PLIST_ENTRY | List,
 |  | LPTSTR | strType,
 |  | ITEM_TYPE | nType,
 |  | UINT | ArraySize
 | ) |  |

Definition at line 211 of file tracewmi.cpp.

                   :

    Creates a data item information struct (ITEM_DESC) and appends
    it to all MOF_INFOs in the given list.
    GetPropertiesFromWBEM() creates a list of MOF_INFOs for multiple
    types, stores them in a temporary list and calls this function for
    each data item information it encounters.

Arguments:

    List - List of MOF_INFOs.
    strType - Item description in string.
    nType - ITEM_TYPE defined at the beginning of this file.
    ArraySize - Size of array of this type of items, if applicable.

Return Value:

    None.

--*/
{
    PITEM_DESC pItem;
    PMOF_INFO pMofInfo;

    PLIST_ENTRY Head = List;
    PLIST_ENTRY Next = Head->Flink;
    while (Head != Next) {

        pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
        Next = Next->Flink;

        if( NULL != pMofInfo ){

            pItem = (PITEM_DESC) malloc(sizeof(ITEM_DESC));
            if( NULL == pItem ){
                return;
            }
            ZeroMemory( pItem, sizeof(ITEM_DESC) );
            pItem->ItemType = nType;
            pItem->ArraySize = ArraySize;

            pItem->strDescription = (LPTSTR) malloc( (_tcslen(strType)+1)*sizeof(TCHAR));

            if( NULL == pItem->strDescription ){
                free( pItem );
                return;
            }
            _tcscpy(pItem->strDescription, strType);

            InsertTailList( (pMofInfo->ItemHeader), &pItem->Entry);
        }

    }
}

void FlushMofList ( PLIST_ENTRY ListHead )

Definition at line 330 of file tracewmi.cpp.

                   :

    Flushes MOF_INFOs in a temporary list into the global list.

Arguments:

    ListHead - Pointer to the head of a temporary list.

Return Value:

    None.

--*/
{
    PMOF_INFO pMofInfo;
    PLIST_ENTRY Head = ListHead;
    PLIST_ENTRY Next = Head->Flink;

    while( Head != Next ){
        pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
        Next = Next->Flink;

        RemoveEntryList(&pMofInfo->Entry);
        InsertTailList( EventListHead, &pMofInfo->Entry);
    }
}

ULONG GetArraySize ( IN IWbemQualifierSet * pQualSet )

Definition at line 433 of file tracewmi.cpp.

                   :

    Examines a given qualifier set and returns the array size.

    NOTE: WBEM stores the size of an array in "MAX" qualifier.

Arguments:

    pQualSet - Pointer to a qualifier set.

Return Value:

    The size of the array. The default is 1.

--*/
{
    ULONG ArraySize = 1;
    VARIANT pVal;
    BSTR bszMaxLen;
    HRESULT hRes;

    if (pQualSet == NULL){
        return ArraySize;
    }

    bszMaxLen = SysAllocString(L"MAX");
    VariantInit(&pVal);
    hRes = pQualSet->Get(bszMaxLen,
                            0,
                            &pVal,
                            0);
    SysFreeString(bszMaxLen);
    if (ERROR_SUCCESS == hRes && pVal.vt == VT_I4 ){
        ArraySize = pVal.lVal;
    }
    VariantClear(&pVal);
    return ArraySize;
}

PMOF_INFO GetGuids | ( | GUID | Guid,
 |  | SHORT | nVersion,
 |  | CHAR | nLevel,
 |  | SHORT | nType
 | ) |  |

Definition at line 1102 of file tracewmi.cpp.

                   :

    Aceesses the MOF data information from WBEM, creates a linked list,
    and returns a pointer that matches the passed event.
    This function finds the right subtree within the WBEM namespace,
    and calls GetPropertiesFromWBEM() to create the list.

Arguments:

    Guid - GUID of the passed event.
    nVersion - version of the passed event.
    nLevel - level of the passed event.
    nType - type of the passed event.

Return Value:

    PMOF_INFO to MOF_INFO structure that matches the passed event.
    NULL if no match is found.

--*/
{
    IEnumWbemClassObject    *pEnumTraceSubClasses = NULL, *pEnumTraceSubSubClasses = NULL;
    IWbemClassObject        *pTraceSubClasses = NULL, *pTraceSubSubClasses = NULL;
    IWbemQualifierSet       *pQualSet = NULL;

    BSTR bszInstance = NULL;
    BSTR bszPropertyName = NULL;
    BSTR bszSubClassName = NULL;
    BSTR bszGuid = NULL;
    BSTR bszVersion = NULL;

    WCHAR strGuid[MAXSTR], strTargetGuid[MAXSTR];

    HRESULT hRes;

    VARIANT pVal;
    VARIANT pGuidVal;
    VARIANT pVersionVal;

    UINT nCounter=0;
    BOOLEAN MatchFound;
    SHORT nEventVersion = EVENT_VERSION_DEFAULT;

    PMOF_INFO pMofLookup = NULL;

    VariantInit(&pVal);
    VariantInit(&pGuidVal);
    VariantInit(&pVersionVal);

    if (NULL == pWbemServices) {
        hRes = WbemConnect( &pWbemServices );
        if ( ERROR_SUCCESS != hRes ) {
            goto cleanup;
        }
    }

    // Convert traget GUID to string for later comparison
#ifdef UNICODE
    GuidToString(strTargetGuid, &Guid);
#else
    CHAR TempString[MAXSTR];
    GuidToString(TempString, &Guid);
    MultiByteToWideChar(CP_ACP, 0, TempString, -1, strTargetGuid, MAXSTR);
#endif

    bszInstance = SysAllocString(L"EventTrace");
    bszPropertyName = SysAllocString(L"__CLASS");
    bszGuid = SysAllocString(L"Guid");
    bszVersion = SysAllocString(L"EventVersion");
    pEnumTraceSubClasses = NULL;

    // Get an enumerator for all classes under "EventTace".
    hRes = pWbemServices->CreateClassEnum (
                bszInstance,
                WBEM_FLAG_SHALLOW | WBEM_FLAG_USE_AMENDED_QUALIFIERS,
                NULL,
                &pEnumTraceSubClasses );
    SysFreeString (bszInstance);

    if (ERROR_SUCCESS == hRes) {
        ULONG uReturned = 1;
        MatchFound = FALSE;
        while (uReturned == 1) {
            pTraceSubClasses = NULL;
            // Get the next ClassObject.
            hRes = pEnumTraceSubClasses->Next(5000,             // timeout in five seconds
                                            1,                  // return just one instance
                                            &pTraceSubClasses,  // pointer to Event Trace Sub Class
                                            &uReturned);        // number obtained: one or zero
            if (ERROR_SUCCESS == hRes && (uReturned == 1)) {
                // Get the class name
                hRes = pTraceSubClasses->Get(bszPropertyName,   // property name
                                                0L,
                                                &pVal,          // output to this variant
                                                NULL,
                                                NULL);
                if (ERROR_SUCCESS == hRes){
                    bszSubClassName = SysAllocString(pVal.bstrVal);
                    // Create an enumerator to find derived classes.
                    hRes = pWbemServices->CreateClassEnum (
                                            bszSubClassName,
                                            WBEM_FLAG_SHALLOW | WBEM_FLAG_USE_AMENDED_QUALIFIERS,
                                            NULL,
                                            &pEnumTraceSubSubClasses
                                            );
                    SysFreeString ( bszSubClassName );
                    bszSubClassName = NULL;
                    VariantClear(&pVal);

                    if (ERROR_SUCCESS == hRes) {

                        ULONG uReturnedSub = 1;
                        while(uReturnedSub == 1){

                            pTraceSubSubClasses = NULL;
                            // enumerate through the resultset.
                            hRes = pEnumTraceSubSubClasses->Next(5000,              // timeout in five seconds
                                                            1,                      // return just one instance
                                                            &pTraceSubSubClasses,   // pointer to a Sub class
                                                            &uReturnedSub);         // number obtained: one or zero
                            if (ERROR_SUCCESS == hRes && uReturnedSub == 1) {
                                // Get the subclass name
                                hRes = pTraceSubSubClasses->Get(bszPropertyName,    // Class name
                                                                0L,
                                                                &pVal,              // output to this variant
                                                                NULL,
                                                                NULL);
                                VariantClear(&pVal);

                                if (ERROR_SUCCESS == hRes){
                                    // Get Qualifier Set.
                                    if (pQualSet) {
                                        pQualSet->Release();
                                        pQualSet = NULL;
                                    }
                                    pTraceSubSubClasses->GetQualifierSet (&pQualSet );

                                    // Get GUID among Qualifiers
                                    hRes = pQualSet->Get(bszGuid,
                                                            0,
                                                            &pGuidVal,
                                                            0);
                                    if (ERROR_SUCCESS == hRes) {
                                        wcscpy(strGuid, (LPWSTR)V_BSTR(&pGuidVal));
                                        VariantClear ( &pGuidVal  );

                                        if (!wcsstr(strGuid, L"{"))
                                            swprintf(strGuid , L"{%s}", strGuid);

                                        if (!_wcsicmp(strTargetGuid, strGuid)) {
                                            hRes = pQualSet->Get(bszVersion,
                                                                    0,
                                                                    &pVersionVal,
                                                                    0);
                                            if (ERROR_SUCCESS == hRes) {
                                                hRes = VariantChangeType(&pVersionVal, &pVersionVal, 0, VT_I2);
                                                if (ERROR_SUCCESS == hRes)
                                                    nEventVersion = (SHORT)V_I2(&pVersionVal);
                                                else
                                                    nEventVersion = (SHORT)V_I4(&pVersionVal);
                                                VariantClear(&pVersionVal);

                                                if (nVersion == nEventVersion) {
                                                    // Match is found.
                                                    // Now put all events in this subtree into the list
                                                    MatchFound = TRUE;
                                                    pMofLookup = GetPropertiesFromWBEM( pTraceSubSubClasses,
                                                                                Guid,
                                                                                nVersion,
                                                                                nLevel,
                                                                                nType
                                                                                );
                                                    break;
                                                }
                                            }
                                            else {
                                                // if there is no version number for this event,
                                                // the current one is the only one
                                                // Now put all events in this subtree into the list
                                                MatchFound = TRUE;
                                                pMofLookup = GetPropertiesFromWBEM( pTraceSubSubClasses,
                                                                                Guid,
                                                                                EVENT_VERSION_DEFAULT,
                                                                                nLevel,
                                                                                nType
                                                                                );
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        } // end while enumerating sub classes
                        if (MatchFound) {
                            break;
                        }
                        if (pEnumTraceSubSubClasses) {
                            pEnumTraceSubSubClasses->Release();
                            pEnumTraceSubSubClasses = NULL;
                        }
                    }   // if creating enumeration was successful
                    else {
                        pEnumTraceSubSubClasses = NULL;
                    }
                }   // if getting class name was successful
            }
            nCounter++;
            // if match is found, break out of the top level search
            if (MatchFound)
                break;
        }   // end while enumerating top classes
        if( pEnumTraceSubClasses ){
            pEnumTraceSubClasses->Release();
            pEnumTraceSubClasses = NULL;
        }
    }   // if creating enumeration for top level is successful

cleanup:

    VariantClear(&pGuidVal);
    VariantClear(&pVersionVal);

    SysFreeString(bszGuid);
    SysFreeString(bszPropertyName);
    SysFreeString(bszVersion);

    if( pEnumTraceSubClasses ){
        pEnumTraceSubClasses->Release();
        pEnumTraceSubClasses = NULL;
    }
    if (pEnumTraceSubSubClasses){
        pEnumTraceSubSubClasses->Release();
        pEnumTraceSubSubClasses = NULL;
    }
    if (pQualSet) {
        pQualSet->Release();
        pQualSet = NULL;
    }

    return pMofLookup;
}

ITEM_TYPE GetItemType | ( | IN CIMTYPE_ENUMERATION | CimType,
 |  | IN IWbemQualifierSet * | pQualSet
 | ) |  |

Definition at line 478 of file tracewmi.cpp.

                   :

    Examines a given qualifier set for a property and returns the type.

Arguments:

    CimType - WBEM type (different from ITEM_TYPE) of a property.
    pQualSet - Pointer to a qualifier set for a property under consideration.

Return Value:

    The type (in ITEM_TYPE) of a property.

--*/
{
    ITEM_TYPE Type;
    VARIANT pVal;
    HRESULT hRes;
    BSTR bszQualName;
    WCHAR strFormat[10];
    WCHAR strTermination[30];
    WCHAR strTemp[30];
    BOOLEAN IsPointer = FALSE;

    strFormat[0] = '\0';
    strTermination[0] = '\0';
    strTemp[0] = '\0';

    if (pQualSet == NULL)
        return ItemUnknown;

    bszQualName = SysAllocString(L"format");
    VariantInit(&pVal);
    hRes = pQualSet->Get(bszQualName,
                            0,
                            &pVal,
                            0);
    SysFreeString(bszQualName);
    if (ERROR_SUCCESS == hRes && NULL != pVal.bstrVal)
        wcscpy(strFormat, pVal.bstrVal);

    bszQualName = SysAllocString(L"StringTermination");
    VariantClear(&pVal);
    hRes = pQualSet->Get(bszQualName,
                            0,
                            &pVal,
                            0);
    SysFreeString(bszQualName);
    if (ERROR_SUCCESS == hRes && NULL != pVal.bstrVal)
        wcscpy(strTermination, pVal.bstrVal);

    bszQualName = SysAllocString(L"pointer");
    VariantClear(&pVal);
    hRes = pQualSet->Get(bszQualName,
                            0,
                            &pVal,
                            0);
    SysFreeString(bszQualName);
    if (ERROR_SUCCESS == hRes)
        IsPointer = TRUE;
    // Major fix required to get rid of temp
    bszQualName = SysAllocString(L"extension");
    VariantClear(&pVal);
    hRes = pQualSet->Get(bszQualName,
                            0,
                            &pVal,
                            0);
    SysFreeString(bszQualName);
    if (ERROR_SUCCESS == hRes && NULL != pVal.bstrVal)
        wcscpy(strTemp, pVal.bstrVal);

    VariantClear(&pVal);

    CimType = (CIMTYPE_ENUMERATION)(CimType & (~CIM_FLAG_ARRAY));

    switch (CimType) {
        case CIM_EMPTY:
            Type = ItemUnknown;
            break;
        case CIM_SINT8:
            Type = ItemCharShort;
            if (!_wcsicmp(strFormat, L"c")){
                Type = ItemChar;
            }
            break;
        case CIM_UINT8:
            Type = ItemUChar;
            break;
        case CIM_SINT16:
            Type = ItemShort;
            break;
        case CIM_UINT16:
            Type = ItemUShort;
            break;
        case CIM_SINT32:
            Type = ItemLong;
            break;
        case CIM_UINT32:
            Type = ItemULong;
            if (!_wcsicmp(strFormat, L"x")){
                Type = ItemULongX;
            }
            break;
        case CIM_SINT64:
            Type = ItemLongLong;
            break;
        case CIM_UINT64:
            Type = ItemULongLong;
            break;
        case CIM_REAL32:
            Type = ItemFloat;
            break;
        case CIM_REAL64:
            Type = ItemDouble;
            break;
        case CIM_BOOLEAN:
            // ItemBool
            Type = ItemBool;
            break;
        case CIM_STRING:

            if (!_wcsicmp(strTermination, L"NullTerminated")) {
                if (!_wcsicmp(strFormat, L"w"))
                    Type = ItemWString;
                else
                    Type = ItemString;
            }
            else if (!_wcsicmp(strTermination, L"Counted")) {
                if (!_wcsicmp(strFormat, L"w"))
                    Type = ItemPWString;
                else
                    Type = ItemPString;
            }
            else if (!_wcsicmp(strTermination, L"ReverseCounted")) {
                if (!_wcsicmp(strFormat, L"w"))
                    Type = ItemDSWString;
                else
                    Type = ItemDSString;
            }
            else if (!_wcsicmp(strTermination, L"NotCounted")) {
                Type = ItemNWString;
            }else{
                Type = ItemString;
            }
            break;
        case CIM_CHAR16:
            // ItemWChar
            Type = ItemWChar;
            break;

        case CIM_OBJECT :
            if (!_wcsicmp(strTemp, L"Port"))
                Type = ItemPort;
            else if (!_wcsicmp(strTemp, L"IPAddr"))
                Type = ItemIPAddr;
            else if (!_wcsicmp(strTemp, L"Sid"))
                Type = ItemSid;
            else if (!_wcsicmp(strTemp, L"Guid"))
                Type = ItemGuid;
            break;

        case CIM_DATETIME:
        case CIM_REFERENCE:
        case CIM_ILLEGAL:
        default:
            Type = ItemUnknown;
            break;
    }

    if (IsPointer)
        Type = ItemPtr;
    return Type;
}

PMOF_INFO GetMofInfoHead | ( | GUID | Guid,
 |  | SHORT | nType,
 |  | SHORT | nVersion,
 |  | CHAR | nLevel
 | ) |  |

Definition at line 92 of file tracewmi.cpp.

                   :

    Find a matching event layout in the global linked list. If it
    is not found in the list, it calls GetGuids() to examine the WBEM
    namespace.
    If the global list is empty, it first creates a header.

Arguments:

    Guid - GUID for the event under consideration.
    nType - Event Type
    nVersion - Event Version
    nLevel - Event Level (not supported in this program)

Return Value:

    Pointer to MOF_INFO for the current event. If the layout
    information is not found anywhere, GetMofInfoHead() creates
    a dummy and returns it.

--*/
{
    PLIST_ENTRY Head, Next;
    PMOF_INFO pMofInfo;
    PMOF_INFO pBestMatch = NULL;
    SHORT nMatchLevel = 0;
    SHORT nMatchCheck;

    // Search the eventList for this Guid and find the head

    if (EventListHead == NULL) {
        // Initialize the MOF List and add the global header guid to it
        EventListHead = (PLIST_ENTRY) malloc(sizeof(LIST_ENTRY));
        if (EventListHead == NULL)
            return NULL;
        InitializeListHead(EventListHead);

        pMofInfo = GetNewMofInfo( EventTraceGuid, EVENT_TYPE_DEFAULT, 0, 0 );
        if( pMofInfo != NULL ){
            InsertTailList( EventListHead, &pMofInfo->Entry );
            pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(GUID_TYPE_EVENTTRACE)+1)*sizeof(TCHAR));
            if( pMofInfo->strDescription != NULL ){
                _tcscpy( pMofInfo->strDescription, GUID_TYPE_EVENTTRACE );
            }
            pMofInfo->strType = (LPTSTR)malloc((_tcslen(GUID_TYPE_HEADER)+1)*sizeof(TCHAR));
            if( pMofInfo->strType != NULL ){
                _tcscpy( pMofInfo->strType, GUID_TYPE_HEADER );
            }
        }
    }

    // Traverse the list and look for the Mof info head for this Guid.

    Head = EventListHead;
    Next = Head->Flink;

    while (Head != Next) {

        nMatchCheck = 0;

        pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
        Next = Next->Flink;

        if( IsEqualGUID(&pMofInfo->Guid, &Guid) ){

            if( pMofInfo->TypeIndex == nType ){
                nMatchCheck++;
            }
            if( pMofInfo->Version == nVersion ){
                nMatchCheck++;
            }
            if( nMatchCheck == 2 ){ // Exact Match
                return  pMofInfo;
            }

            if( nMatchCheck > nMatchLevel ){ // Close Match
                nMatchLevel = nMatchCheck;
                pBestMatch = pMofInfo;
            }

            if( pMofInfo->TypeIndex == EVENT_TYPE_DEFAULT && // Total Guess
                pBestMatch == NULL ){
                pBestMatch = pMofInfo;
            }
        }

    }

    if(pBestMatch != NULL){
        return pBestMatch;
    }

    // If one does not exist in the list, look it up in the file.
    pMofInfo = GetGuids( Guid, nVersion, nLevel, nType );

    // If still not found, create a unknown place holder
    if( NULL == pMofInfo ){
        pMofInfo = GetNewMofInfo( Guid, nType, nVersion, nLevel );
        if( pMofInfo != NULL ){
            pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(GUID_TYPE_UNKNOWN)+1)*sizeof(TCHAR));
            if( pMofInfo->strDescription != NULL ){
                _tcscpy( pMofInfo->strDescription, GUID_TYPE_UNKNOWN );
            }
            InsertTailList( EventListHead, &pMofInfo->Entry );
        }
    }

    return pMofInfo;
}

PMOF_INFO GetNewMofInfo | ( | GUID | guid,
 |  | SHORT | nType,
 |  | SHORT | nVersion,
 |  | CHAR | nLevel
 | ) |  |

Definition at line 276 of file tracewmi.cpp.

                   :

    Creates a new MOF_INFO with given data.

Arguments:

    guid - Event GUID.
    nType - Event type.
    nVersion - Event version.
    nLevel - Event level (not supported in this program).

Return Value:

    Pointer to the created MOF_INFO. NULL if malloc failed.

--*/
{
    PMOF_INFO pMofInfo;

    pMofInfo = (PMOF_INFO)malloc(sizeof(MOF_INFO));

    if( NULL == pMofInfo ){
        return NULL;
    }

    RtlZeroMemory(pMofInfo, sizeof(MOF_INFO));

    RtlCopyMemory(&pMofInfo->Guid, &guid, sizeof(GUID) );

    pMofInfo->ItemHeader = (PLIST_ENTRY)malloc(sizeof(LIST_ENTRY));

    if( NULL == pMofInfo->ItemHeader ){
        free( pMofInfo );
        return NULL;
    }

    InitializeListHead(pMofInfo->ItemHeader);

    pMofInfo->TypeIndex = nType;
    pMofInfo->Level = nLevel;
    pMofInfo->Version = nVersion;

    return pMofInfo;
}

PMOF_INFO GetPropertiesFromWBEM | ( | IWbemClassObject * | pTraceSubClasses,
 |  | GUID | Guid,
 |  | SHORT | nVersion,
 |  | CHAR | nLevel,
 |  | SHORT | nType
 | ) |  |

Definition at line 659 of file tracewmi.cpp.

                   :

    Constructs a linked list with the information read from the WBEM
    namespace, given the WBEM pointer to the version subtree. It enumerates
    through all type classes in WBEM, and constructs MOF_INFOs for all of
    them (for caching purpose). Meanwhile, it looks for the event layout
    that mathces the passed event, and returns the pointer to the matching
    MOF_INFO at the end.

Arguments:

    pTraceSubClasses - WBEM pointer to the version subtree.
    Guid - GUID of the passed event.
    nVersion - version of the passed event.
    nLevel - level of the passed event.
    nType - type of the passed event.

Return Value:

    Pointer to MOF_INFO corresponding to the passed event.
    If the right type is not found, it returns the pointer to
    the generic MOF_INFO for the event version.

--*/
{
    IEnumWbemClassObject    *pEnumTraceSubSubClasses = NULL;
    IWbemClassObject        *pTraceSubSubClasses = NULL;
    IWbemQualifierSet       *pQualSet = NULL;

    PMOF_INFO pMofInfo = NULL, pMofLookup = NULL, pMofTemplate = NULL;

    BSTR bszClassName = NULL;
    BSTR bszSubClassName = NULL;
    BSTR bszWmiDataId = NULL;
    BSTR bszEventType = NULL;
    BSTR bszEventTypeName = NULL;
    BSTR bszFriendlyName = NULL;
    BSTR bszPropName = NULL;

    TCHAR strClassName[MAXSTR];
    TCHAR strType[MAXSTR];
#ifndef UNICODE
    CHAR TempString[MAXSTR];
#endif
    LONG pVarType;
    SHORT nEventType = EVENT_TYPE_DEFAULT;

    LIST_ENTRY ListHead;
    HRESULT hRes;

    VARIANT pVal;
    VARIANT pTypeVal;
    VARIANT pTypeNameVal;
    VARIANT pClassName;
    ULONG lEventTypeWbem;
    ULONG HUGEP *pTypeData;
    BSTR HUGEP *pTypeNameData;

    SAFEARRAY *PropArray = NULL;
    SAFEARRAY *TypeArray = NULL;
    SAFEARRAY *TypeNameArray = NULL;

    long lLower, lUpper, lCount, IdIndex;
    long lTypeLower, lTypeUpper;
    long lTypeNameLower, lTypeNameUpper;

    ULONG ArraySize;

    ITEM_TYPE ItemType;

    InitializeListHead(&ListHead);

    VariantInit(&pVal);
    VariantInit(&pTypeVal);
    VariantInit(&pTypeNameVal);
    VariantInit(&pClassName);

    bszClassName = SysAllocString(L"__CLASS");
    bszWmiDataId = SysAllocString(L"WmiDataId");
    bszEventType = SysAllocString(L"EventType");
    bszEventTypeName = SysAllocString(L"EventTypeName");
    bszFriendlyName = SysAllocString(L"DisplayName");

    hRes = pTraceSubClasses->Get(bszClassName,          // property name
                                        0L,
                                        &pVal,          // output to this variant
                                        NULL,
                                        NULL);

    if (ERROR_SUCCESS == hRes){
        if (pQualSet) {
            pQualSet->Release();
            pQualSet = NULL;
        }
        // Get Qualifier Set to obtain the friendly name.
        pTraceSubClasses->GetQualifierSet(&pQualSet);
        hRes = pQualSet->Get(bszFriendlyName,
                                0,
                                &pClassName,
                                0);
        if (ERROR_SUCCESS == hRes && pClassName.bstrVal != NULL) {
#ifdef UNICODE
            wcscpy(strClassName, pClassName.bstrVal);
#else
            WideCharToMultiByte(CP_ACP,
                                0,
                                pClassName.bstrVal,
                                wcslen(pClassName.bstrVal),
                                TempString,
                                (MAXSTR * sizeof(CHAR)),
                                NULL,
                                NULL
                                );
            strcpy(strClassName, TempString);
            strClassName[wcslen(pClassName.bstrVal)] = '\0';
#endif
        }
        else {
#ifdef UNICODE
            strClassName[0] = L'\0';
#else
            strClassName[0] = '\0';
#endif
        }
        // Put Event Header
        pMofInfo = GetNewMofInfo(Guid,
                                    EVENT_TYPE_DEFAULT,
                                    EVENT_VERSION_DEFAULT,
                                    EVENT_LEVEL_DEFAULT
                                    );
        if (pMofInfo != NULL) {
            pMofTemplate = pMofInfo;
            pMofLookup = pMofInfo;
            InsertTailList(&ListHead, &pMofInfo->Entry);
            pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(strClassName) + 1) * sizeof(TCHAR));
            if (NULL != pMofInfo->strDescription) {
                _tcscpy(pMofInfo->strDescription, strClassName);
            }
        }
        else{
            goto cleanup;
        }

        // Create an enumerator to find derived classes.
        bszSubClassName = SysAllocString(pVal.bstrVal);
        hRes = pWbemServices->CreateClassEnum (
                                    bszSubClassName,                                                // class name
                                    WBEM_FLAG_SHALLOW | WBEM_FLAG_USE_AMENDED_QUALIFIERS,           // shallow search
                                    NULL,
                                    &pEnumTraceSubSubClasses
                                    );
        SysFreeString ( bszSubClassName );
        if (ERROR_SUCCESS == hRes) {
            ULONG uReturnedSub = 1;

            while(uReturnedSub == 1){
                // For each event in the subclass
                pTraceSubSubClasses = NULL;
                hRes = pEnumTraceSubSubClasses->Next(5000,                  // timeout in five seconds
                                                    1,                      // return just one instance
                                                    &pTraceSubSubClasses,   // pointer to a Sub class
                                                    &uReturnedSub);         // number obtained: one
                if (ERROR_SUCCESS == hRes && uReturnedSub == 1) {
                    if (pQualSet) {
                        pQualSet->Release();
                        pQualSet = NULL;
                    }
                    // Get Qualifier Set.
                    pTraceSubSubClasses->GetQualifierSet(&pQualSet);
                    // Get Type number among Qualifiers
                    VariantClear(&pTypeVal);
                    hRes = pQualSet->Get(bszEventType,
                                            0,
                                            &pTypeVal,
                                            0);

                    if (ERROR_SUCCESS == hRes) {
                        TypeArray = NULL;
                        TypeNameArray = NULL;
                        if (pTypeVal.vt & VT_ARRAY) {   // EventType is an array
                            TypeArray = pTypeVal.parray;
                            VariantClear(&pTypeNameVal);
                            hRes = pQualSet->Get(bszEventTypeName,
                                                    0,
                                                    &pTypeNameVal,
                                                    0);
                            if ((ERROR_SUCCESS == hRes) && (pTypeNameVal.vt & VT_ARRAY)) {
                                TypeNameArray = pTypeNameVal.parray;
                            }
                            if (TypeArray != NULL) {
                                hRes = SafeArrayGetLBound(TypeArray, 1, &lTypeLower);
                                if (ERROR_SUCCESS != hRes) {
                                    break;
                                }
                                hRes = SafeArrayGetUBound(TypeArray, 1, &lTypeUpper);
                                if (ERROR_SUCCESS != hRes) {
                                    break;
                                }
                                if (lTypeUpper < 0) {
                                    break;
                                }
                                SafeArrayAccessData(TypeArray, (void HUGEP **)&pTypeData );

                                if (TypeNameArray != NULL) {
                                    hRes = SafeArrayGetLBound(TypeNameArray, 1, &lTypeNameLower);
                                    if (ERROR_SUCCESS != hRes) {
                                        break;
                                    }
                                    hRes = SafeArrayGetUBound(TypeNameArray, 1, &lTypeNameUpper);
                                    if (ERROR_SUCCESS != hRes) {
                                        break;
                                    }
                                    if (lTypeNameUpper < 0)
                                        break;
                                    SafeArrayAccessData(TypeNameArray, (void HUGEP **)&pTypeNameData );
                                }

                                for (lCount = lTypeLower; lCount <= lTypeUpper; lCount++) {
                                    lEventTypeWbem = pTypeData[lCount];
                                    nEventType = (SHORT)lEventTypeWbem;
                                    pMofInfo = GetNewMofInfo(Guid, nEventType, nVersion, nLevel);
                                    if (pMofInfo != NULL) {
                                        InsertTailList(&ListHead, &pMofInfo->Entry);
                                        if (pMofTemplate != NULL && pMofTemplate->strDescription != NULL) {
                                            pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(pMofTemplate->strDescription) + 1) * sizeof(TCHAR));
                                            if (pMofInfo->strDescription != NULL) {
                                                _tcscpy(pMofInfo->strDescription, pMofTemplate->strDescription);
                                            }
                                        }
                                        if (nType == nEventType) {
                                            // Type matched
                                            pMofLookup = pMofInfo;
                                        }
                                        if (TypeNameArray != NULL) {
                                            if ((lCount >= lTypeNameLower) && (lCount <= lTypeNameUpper)) {
                                                pMofInfo->strType = (LPTSTR)malloc((wcslen((LPWSTR)pTypeNameData[lCount]) + 1) * sizeof(TCHAR));
                                                if (pMofInfo->strType != NULL){
#ifdef UNICODE
                                                    wcscpy(pMofInfo->strType, (LPWSTR)(pTypeNameData[lCount]));
#else
                                                    WideCharToMultiByte(CP_ACP,
                                                                        0,
                                                                        (LPWSTR)(pTypeNameData[lCount]),
                                                                        wcslen((LPWSTR)(pTypeNameData[lCount])),
                                                                        TempString,
                                                                        (MAXSTR * sizeof(CHAR)),
                                                                        NULL,
                                                                        NULL
                                                                        );
                                                    TempString[wcslen((LPWSTR)(pTypeNameData[lCount]))] = '\0';
                                                    strcpy(pMofInfo->strType, TempString);
#endif
                                                }
                                            }
                                        }
                                    }
                                }
                                SafeArrayUnaccessData(TypeArray);
                                SafeArrayDestroy(TypeArray);
                                VariantInit(&pTypeVal);
                                if (TypeNameArray != NULL) {
                                    SafeArrayUnaccessData(TypeNameArray);
                                    SafeArrayDestroy(TypeNameArray);
                                    VariantInit(&pTypeNameVal);
                                }
                            }
                            else {
                                // If the Types are not found, then bail
                                break;
                            }
                        }
                        else {                          // EventType is scalar
                            hRes = VariantChangeType(&pTypeVal, &pTypeVal, 0, VT_I2);
                            if (ERROR_SUCCESS == hRes)
                                nEventType = (SHORT)V_I2(&pTypeVal);
                            else
                                nEventType = (SHORT)V_I4(&pTypeVal);

                            VariantClear(&pTypeNameVal);
                            hRes = pQualSet->Get(bszEventTypeName,
                                                    0,
                                                    &pTypeNameVal,
                                                    0);
                            if (ERROR_SUCCESS == hRes) {
#ifdef UNICODE
                                wcscpy(strType, pTypeNameVal.bstrVal);
#else
                                WideCharToMultiByte(CP_ACP,
                                                    0,
                                                    pTypeNameVal.bstrVal,
                                                    wcslen(pTypeNameVal.bstrVal),
                                                    TempString,
                                                    (MAXSTR * sizeof(CHAR)),
                                                    NULL,
                                                    NULL
                                                    );
                                strcpy(strType, TempString);
                                strType[wcslen(pTypeNameVal.bstrVal)] = '\0';
#endif
                            }
                            else{
#ifdef UNICODE
                                strType[0] = L'\0';
#else
                                strType[0] = '\0';
#endif
                            }

                            pMofInfo = GetNewMofInfo(Guid, nEventType, nVersion, nLevel);
                            if (pMofInfo != NULL) {
                                InsertTailList(&ListHead, &pMofInfo->Entry);
                                if (pMofTemplate != NULL && pMofTemplate->strDescription != NULL) {
                                    pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(pMofTemplate->strDescription) + 1) * sizeof(TCHAR));
                                    if (pMofInfo->strDescription != NULL) {
                                        _tcscpy(pMofInfo->strDescription, pMofTemplate->strDescription);
                                    }
                                }
                                if (nType == nEventType) {
                                    // Type matched
                                    pMofLookup = pMofInfo;
                                }
                                pMofInfo->strType = (LPTSTR)malloc((_tcslen(strType) + 1) * sizeof(TCHAR));
                                if (pMofInfo->strType != NULL){
                                    _tcscpy(pMofInfo->strType, strType);
                                }
                            }
                        }

                        // Get event layout
                        VariantClear(&pVal);
                        IdIndex = 1;
                        V_VT(&pVal) = VT_I4;
                        V_I4(&pVal) = IdIndex;
                        // For each property
                        PropArray = NULL;
                        while (pTraceSubSubClasses->GetNames(bszWmiDataId,                  // only properties with WmiDataId qualifier
                                                            WBEM_FLAG_ONLY_IF_IDENTICAL,
                                                            &pVal,                          // WmiDataId number starting from 1
                                                            &PropArray) == WBEM_NO_ERROR) {

                            hRes = SafeArrayGetLBound(PropArray, 1, &lLower);
                            if (ERROR_SUCCESS != hRes) {
                                break;
                            }
                            hRes = SafeArrayGetUBound(PropArray, 1, &lUpper);
                            if (ERROR_SUCCESS != hRes) {
                                break;
                            }
                            if (lUpper < 0)
                                break;
                            // This loop will iterate just once.
                            for (lCount = lLower; lCount <= lUpper; lCount++) {
                                hRes = SafeArrayGetElement(PropArray, &lCount, &bszPropName);
                                if (ERROR_SUCCESS != hRes) {
                                    break;
                                }
                                hRes = pTraceSubSubClasses->Get(bszPropName,    // Property name
                                                                0L,
                                                                NULL,
                                                                &pVarType,      // CIMTYPE of the property
                                                                NULL);
                                if (ERROR_SUCCESS != hRes) {
                                    break;
                                }

                                // Get the Qualifier set for the property
                                if (pQualSet) {
                                    pQualSet->Release();
                                    pQualSet = NULL;
                                }
                                hRes = pTraceSubSubClasses->GetPropertyQualifierSet(bszPropName,
                                                                        &pQualSet);

                                if (ERROR_SUCCESS != hRes) {
                                    break;
                                }

                                ItemType = GetItemType((CIMTYPE_ENUMERATION)pVarType, pQualSet);

                                if( pVarType & CIM_FLAG_ARRAY ){
                                    ArraySize = GetArraySize(pQualSet);
                                }else{
                                    ArraySize = 1;
                                }
#ifdef UNICODE
                                AddMofInfo(&ListHead,
                                            bszPropName,
                                            ItemType,
                                            ArraySize);
#else
                                WideCharToMultiByte(CP_ACP,
                                                    0,
                                                    bszPropName,
                                                    wcslen(bszPropName),
                                                    TempString,
                                                    (MAXSTR * sizeof(CHAR)),
                                                    NULL,
                                                    NULL
                                                    );
                                TempString[wcslen(bszPropName)] = '\0';
                                AddMofInfo(&ListHead,
                                            TempString,
                                            ItemType,
                                            ArraySize);
#endif
                            }
                            SafeArrayDestroy(PropArray);
                            PropArray = NULL;
                            V_I4(&pVal) = ++IdIndex;
                        }   // end enumerating through WmiDataId
                        FlushMofList(&ListHead);
                    }   // if getting event type was successful
                }   // if enumeration returned a subclass successfully
            }   // end enumerating subclasses
        }   // if enumeration was created successfully
    }   // if getting class name was successful
cleanup:
    VariantClear(&pVal);
    VariantClear(&pTypeVal);
    VariantClear(&pClassName);

    SysFreeString(bszClassName);
    SysFreeString(bszWmiDataId);
    SysFreeString(bszEventType);
    SysFreeString(bszEventTypeName);
    SysFreeString(bszFriendlyName);
    // Should not free bszPropName becuase it is already freed by SafeArrayDestroy

    FlushMofList(&ListHead);

    return pMofLookup;
}

void GuidToString | ( | PTCHAR | s,
 |  | LPGUID | piid
 | ) |  |

Definition at line 1157 of file tracedmp.cpp.

                   :

    Converts a GUID into a string.

Arguments:

    s - String that will have the converted GUID.
    piid - GUID

Return Value:

    None.

--*/
{
    _stprintf(s, _T("{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"),
               piid->Data1, piid->Data2,
               piid->Data3,
               piid->Data4[0], piid->Data4[1],
               piid->Data4[2], piid->Data4[3],
               piid->Data4[4], piid->Data4[5],
               piid->Data4[6], piid->Data4[7]);
    return;
}

void RemoveMofInfo ( PLIST_ENTRY pMofInfo )

Definition at line 1352 of file tracewmi.cpp.

                   :

    Removes and frees data item structs from a given list.

Arguments:

    pMofInfo - Pointer to the MOF_INFO to be purged of data item structs.

Return Value:

    None.

--*/
{
    PLIST_ENTRY Head, Next;
    PITEM_DESC pItem;

    Head = pMofInfo;
    Next = Head->Flink;
    while (Head != Next) {
        pItem = CONTAINING_RECORD(Next, ITEM_DESC, Entry);
        Next = Next->Flink;
        RemoveEntryList(&pItem->Entry);
        free(pItem);
    }
}

HRESULT WbemConnect ( IWbemServices ** pWbemServices )

Definition at line 363 of file tracewmi.cpp.

                   :

    Connects to WBEM and returns a pointer to WbemServices.

Arguments:

    pWbemServices - Pointer to the connected WbemServices.

Return Value:

    ERROR_SUCCESS if successful. Error flag otherwise.

--*/
{
    IWbemLocator     *pLocator = NULL;

    BSTR bszNamespace = SysAllocString( L"root\\wmi" );

    HRESULT hr = CoInitialize(0);

    hr = CoCreateInstance(
                CLSID_WbemLocator,
                0,
                CLSCTX_INPROC_SERVER,
                IID_IWbemLocator,
                (LPVOID *) &pLocator
            );
    if ( ERROR_SUCCESS != hr )
        goto cleanup;

    hr = pLocator->ConnectServer(
                bszNamespace,
                NULL,
                NULL,
                NULL,
                0L,
                NULL,
                NULL,
                pWbemServices
            );
    if ( ERROR_SUCCESS != hr )
        goto cleanup;

    hr = CoSetProxyBlanket(
            *pWbemServices,
            RPC_C_AUTHN_WINNT,
            RPC_C_AUTHZ_NONE,
            NULL,
            RPC_C_AUTHN_LEVEL_PKT,
            RPC_C_IMP_LEVEL_IMPERSONATE,
            NULL,
            EOAC_NONE
        );

cleanup:
    SysFreeString( bszNamespace );

    if( pLocator ){
        pLocator->Release();
        pLocator = NULL;
    }

    return hr;
}

Variable Documentation

PLIST_ENTRY EventListHead

Definition at line 131 of file tracedmp.cpp.

IWbemServices* pWbemServices = NULL

Definition at line 33 of file tracewmi.cpp.

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/tracedp/TraceDp.c File Reference

  • WinBase
  • EventTrace
  • tracedp
Classes | Defines | Typedefs | Functions | Variables

TraceDp.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <shellapi.h>
#include <tchar.h>
#include <wmistr.h>
#include <guiddef.h>
#include <evntrace.h>

Go to the source code of this file.

Classes

struct | _USER_EVENT

Defines

#define | DEFAULT_EVENTS 5000
#define | MAXSTR 1024

Typedefs

typedef struct _USER_EVENT * | PUSER_EVENT
typedef struct _USER_EVENT | USER_EVENT

Functions

ULONG | ControlCallback (IN WMIDPREQUESTCODE RequestCode, IN PVOID Context, IN OUT ULONG *InOutBufferSize, IN OUT PVOID Buffer)
void | DoWork ()
__cdecl | main (int argc, char **argv)

Variables

GUID | ControlGuid
ULONG | EnableFlags = 0
ULONG | EnableLevel = 0
ULONG | EventCount = 0
TRACEHANDLE | LoggerHandle
ULONG | MaxEvents = DEFAULT_EVENTS
TRACEHANDLE | RegistrationHandle
TRACE_GUID_REGISTRATION | TraceGuidReg []
BOOLEAN | TraceOnFlag
GUID | TransactionGuid

Define Documentation

#define DEFAULT_EVENTS 5000

Definition at line 26 of file TraceDp.c.

#define MAXSTR 1024

Definition at line 27 of file TraceDp.c.

Typedef Documentation

typedef struct _USER_EVENT * PUSER_EVENT
typedef struct _USER_EVENT USER_EVENT

Function Documentation

ULONG ControlCallback | ( | IN WMIDPREQUESTCODE | RequestCode,
 |  | IN PVOID | Context,
 |  | IN OUT ULONG * | InOutBufferSize,
 |  | IN OUT PVOID | Buffer
 | ) |  |

Definition at line 179 of file TraceDp.c.

                   :

    Callback function when enabled.

Arguments:

    RequestCode - Flag for either enable or disable.
    Context - User-defined context.
    InOutBufferSize - not used.
    Buffer - WNODE_HEADER for the logger session.

Return Value:

    Error Status. ERROR_SUCCESS if successful.

--*/
{
    ULONG Status;
    ULONG RetSize;

    Status = ERROR_SUCCESS;

    switch (RequestCode)
    {
        case WMI_ENABLE_EVENTS:
        {
            RetSize = 0;
            LoggerHandle = GetTraceLoggerHandle( Buffer );
            EnableLevel = GetTraceEnableLevel(LoggerHandle);
            EnableFlags = GetTraceEnableFlags(LoggerHandle);
            _tprintf(_T("Logging enabled to 0x%016I64x(%d,%d,%d)\n"),
                    LoggerHandle, RequestCode, EnableLevel, EnableFlags);
            TraceOnFlag = TRUE;
            break;
        }
        case WMI_DISABLE_EVENTS:
        {
            TraceOnFlag = FALSE;
            RetSize = 0;
            LoggerHandle = 0;
            _tprintf(_T("\nLogging Disabled\n"));
            break;
        }
        default:
        {
            RetSize = 0;
            Status = ERROR_INVALID_PARAMETER;
            break;
        }

    }

    *InOutBufferSize = RetSize;
    return(Status);
}

void DoWork ( )

Definition at line 244 of file TraceDp.c.

                   :

    Logs events.

Arguments:

Return Value:

    None.

--*/
{
    USER_EVENT UserEvent;
    ULONG Status;

    RtlZeroMemory(&UserEvent, sizeof(UserEvent));
    UserEvent.Header.Size  = sizeof(USER_EVENT);
    UserEvent.Header.Flags = WNODE_FLAG_TRACED_GUID;
    UserEvent.Header.Guid  = TransactionGuid;

    // Log START event to indicate a start of a routine or activity.
    // We log EventCount as data.
    if (TraceOnFlag) {
        UserEvent.Header.Class.Type         = EVENT_TRACE_TYPE_START;
        UserEvent.EventInfo = ++EventCount;
        Status = TraceEvent(
                        LoggerHandle,
                        (PEVENT_TRACE_HEADER) & UserEvent);
        if (Status != ERROR_SUCCESS) {
            // TraceEvent() failed. This could happen when the logger
            // cannot keep up with too many events logged rapidly.
            // In such cases, the return valid is
            // ERROR_NOT_ENOUGH_MEMORY.
            _tprintf(_T("TraceEvent failed. Status=%d\n"), Status);
        }
    }

    //
    // Main body of the work in this routine comes here.
    //
    _sleep(1);

    // Log END event to indicate an end of a routine or activity.
    // We log EventCount as data.
    if (TraceOnFlag) {
        UserEvent.Header.Class.Type         = EVENT_TRACE_TYPE_END;
        UserEvent.EventInfo = ++EventCount;
        Status = TraceEvent(
                        LoggerHandle,
                        (PEVENT_TRACE_HEADER) & UserEvent);
        if (Status != ERROR_SUCCESS) {
            // TraceEvent() failed. This could happen when the logger
            // cannot keep up with too many events logged rapidly.
            // In such cases, the return valid is
            // ERROR_NOT_ENOUGH_MEMORY.
            _tprintf(_T("TraceEvent failed. Status=%d\n"), Status);
        }
    }
}

__cdecl main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 78 of file TraceDp.c.

                   :

    main() routine.

Arguments:

    Usage: TraceDp [number of events]
                [number of events] default is 5000

Return Value:

        Error Code defined in winerror.h : If the function succeeds,
                it returns ERROR_SUCCESS (== 0).

--*/
{
    ULONG Status, i;
    LPTSTR *targv, *utargv = NULL;

    TraceOnFlag = FALSE;

#ifdef UNICODE
    if ((targv = CommandLineToArgvW(
                      GetCommandLineW(),    // pointer to a command-line string
                      &argc                 // receives the argument count
                      )) == NULL)
    {
        return (GetLastError());
    };
    utargv = targv;
#else
    targv = argv;
#endif

    // process command line arguments to override defaults
    if (argc == 2) {
        targv ++;
        if (**targv >= _T('0') && **targv <= _T('9')) {
            MaxEvents = _ttoi(targv[0]);
        }
        else if (!_tcsicmp(targv[0], _T("/?")) || !_tcsicmp(targv[0], _T("-?"))) {
            printf("Usage: TraceDp [number of events]\n");
            printf("\t[number of events]        default is 5000\n");

            return ERROR_SUCCESS;
        }
    }

    // Free temporary argument buffer.
    if (utargv != NULL) {
        GlobalFree(utargv);
    }

    // Event provider registration.
    Status = RegisterTraceGuids(
                (WMIDPREQUEST)ControlCallback,   // callback function
                0,
                &ControlGuid,
                1,
                TraceGuidReg,
                NULL,
                NULL,
                &RegistrationHandle
             );

    if (Status != ERROR_SUCCESS) {
        _tprintf(_T("Trace registration failed. Status=%d\n"), Status);
        return(Status);
    }
    else {
        _tprintf(_T("Trace registered successfully\n"));
    }

    _tprintf(_T("Testing Logger with %d events\n"),
            MaxEvents);

    // Sleep until enabled by a trace controller. In this sample, we wait to be
    // enabled for tracing. However, normal applications should continue and log
    // events when enabled later on.
    while (!TraceOnFlag) {
        _sleep(1000);
    }

    // Do the work while logging events. We trace two events (START and END) for
    // each call to DoWork.
    for (i = 0; i < MaxEvents / 2; i++) {
        DoWork();
    }

    // Unregister.
    UnregisterTraceGuids(RegistrationHandle);

    return ERROR_SUCCESS;
}

Variable Documentation

GUID ControlGuid
Initial value:
    {0xd58c126f, 0xb309, 0x11d1, 0x96, 0x9e, 0x00, 0x00, 0xf8, 0x75, 0xa5, 0xbc}

Definition at line 32 of file TraceDp.c.

ULONG EnableFlags = 0

Definition at line 58 of file TraceDp.c.

ULONG EnableLevel = 0

Definition at line 57 of file TraceDp.c.

ULONG EventCount = 0

Definition at line 63 of file TraceDp.c.

TRACEHANDLE LoggerHandle

Definition at line 29 of file TraceDp.c.

ULONG MaxEvents = DEFAULT_EVENTS

Definition at line 61 of file TraceDp.c.

TRACEHANDLE RegistrationHandle

Definition at line 54 of file TraceDp.c.

TRACE_GUID_REGISTRATION TraceGuidReg[]
Initial value:
{
    { (LPGUID)&TransactionGuid,
      NULL
    }
}

Definition at line 40 of file TraceDp.c.

BOOLEAN TraceOnFlag

Definition at line 56 of file TraceDp.c.

GUID TransactionGuid
Initial value:

    {0xce5b1020, 0x8ea9, 0x11d0, 0xa4, 0xec, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10}

Definition at line 37 of file TraceDp.c.

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceLog/TraceLog.c File Reference

  • WinBase
  • EventTrace
  • TraceLog
Defines | Functions

TraceLog.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <shellapi.h>
#include <tchar.h>
#include <wmistr.h>
#include <initguid.h>
#include <guiddef.h>
#include <evntrace.h>

Go to the source code of this file.

Defines

#define | ACTION_ENABLE 5
#define | ACTION_HELP 6
#define | ACTION_LIST 4
#define | ACTION_QUERY 0
#define | ACTION_START 1
#define | ACTION_STOP 2
#define | ACTION_UNDEFINED 10
#define | ACTION_UPDATE 3
#define | DEFAULT_LOGFILE_NAME _T("C:\\LogFile.Etl")
#define | MAXIMUM_LOGGERS 32
#define | MAXSTR 1024

Functions

ULONG | ahextoi (IN TCHAR *s)
__cdecl | main (int argc, char **argv)
void | PrintHelpMessage ()
void | PrintLoggerStatus (IN PEVENT_TRACE_PROPERTIES LoggerInfo, IN ULONG Status)
void | StringToGuid (IN TCHAR *str, OUT LPGUID guid)
void | StringToGuid (IN TCHAR *str, IN OUT LPGUID guid)

Define Documentation

#define ACTION_ENABLE 5

Definition at line 42 of file TraceLog.c.

#define ACTION_HELP 6

Definition at line 43 of file TraceLog.c.

#define ACTION_LIST 4

Definition at line 41 of file TraceLog.c.

#define ACTION_QUERY 0

Definition at line 37 of file TraceLog.c.

#define ACTION_START 1

Definition at line 38 of file TraceLog.c.

#define ACTION_STOP 2

Definition at line 39 of file TraceLog.c.

#define ACTION_UNDEFINED 10

Definition at line 45 of file TraceLog.c.

#define ACTION_UPDATE 3

Definition at line 40 of file TraceLog.c.

#define DEFAULT_LOGFILE_NAME _T("C:\\LogFile.Etl")

Definition at line 28 of file TraceLog.c.

#define MAXIMUM_LOGGERS 32

Definition at line 31 of file TraceLog.c.

#define MAXSTR 1024

Definition at line 26 of file TraceLog.c.

Function Documentation

ULONG ahextoi ( IN TCHAR * s )

Definition at line 572 of file TraceLog.c.

                   :

    Converts a hex string into a number.

Arguments:

    s - A hex string in TCHAR.

Return Value:

    ULONG - The number in the string.

--*/
{
    int len;
    ULONG num, base, hex;

    len = _tcslen(s);
    hex = 0; base = 1; num = 0;
    while (--len >= 0) {
        if ( (s[len] == 'x' || s[len] == 'X') &&
             (s[len-1] == '0') )
            break;
        if (s[len] >= '0' && s[len] <= '9')
            num = s[len] - '0';
        else if (s[len] >= 'a' && s[len] <= 'f')
            num = (s[len] - 'a') + 10;
        else if (s[len] >= 'A' && s[len] <= 'F')
            num = (s[len] - 'A') + 10;
        else
            continue;

        hex += num * base;
        base = base * 16;
    }
    return hex;
}

__cdecl main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 71 of file TraceLog.c.

                   :

    It is the main function.

Arguments:

Return Value:

    Error Code defined in winerror.h : If the function succeeds,
                it returns ERROR_SUCCESS (== 0).

--*/{
    ULONG i, j;
    ULONG Status = ERROR_SUCCESS;
    LPTSTR *targv, *utargv = NULL;
    // Action to be taken
    USHORT Action = ACTION_UNDEFINED;

    LPTSTR LoggerName;
    LPTSTR LogFileName;
    PEVENT_TRACE_PROPERTIES pLoggerInfo;
    TRACEHANDLE LoggerHandle = 0;
    // Target GUID, level and flags for enable/disable
    GUID TargetGuid;
    ULONG bEnable = TRUE;

    ULONG SizeNeeded = 0;

    // We will enable Process, Thread, Disk, and Network events
    // if the Kernel Logger is requested.
    BOOL bKernelLogger = FALSE;

    // Allocate and initialize EVENT_TRACE_PROPERTIES structure first
    SizeNeeded = sizeof(EVENT_TRACE_PROPERTIES) + 2 * MAXSTR * sizeof(TCHAR);
    pLoggerInfo = (PEVENT_TRACE_PROPERTIES) malloc(SizeNeeded);
    if (pLoggerInfo == NULL) {
        return (ERROR_OUTOFMEMORY);
    }

    RtlZeroMemory(pLoggerInfo, SizeNeeded);

    pLoggerInfo->Wnode.BufferSize = SizeNeeded;
    pLoggerInfo->Wnode.Flags = WNODE_FLAG_TRACED_GUID;
    pLoggerInfo->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES);
    pLoggerInfo->LogFileNameOffset = pLoggerInfo->LoggerNameOffset + MAXSTR * sizeof(TCHAR);

    LoggerName = (LPTSTR)((char*)pLoggerInfo + pLoggerInfo->LoggerNameOffset);
    LogFileName = (LPTSTR)((char*)pLoggerInfo + pLoggerInfo->LogFileNameOffset);
    // If the logger name is not given, we will assume the kernel logger.
    _tcscpy(LoggerName, KERNEL_LOGGER_NAME);

#ifdef UNICODE
    if ((targv = CommandLineToArgvW(
                      GetCommandLineW(),    // pointer to a command-line string
                      &argc                 // receives the argument count
                      )) == NULL) {
        free(pLoggerInfo);
        return (GetLastError());
    };
    utargv = targv;
#else
    targv = argv;
#endif

    //
    // Parse the command line options to determine actions and parameters.
    //
    while (--argc > 0) {
        ++targv;
        if (**targv == '-' || **targv == '/') {  // argument found
            if (targv[0][0] == '/' ) {
                targv[0][0] = '-';
            }

            // Deterine actions.
            if (!_tcsicmp(targv[0], _T("-start"))) {
                Action = ACTION_START;
                if (argc > 1) {
                    if (targv[1][0] != '-' && targv[1][0] != '/') {
                        ++targv; --argc;
                        _tcscpy(LoggerName, targv[0]);
                    }
                }
            }
            else if (!_tcsicmp(targv[0], _T("-enable"))) {
                Action = ACTION_ENABLE;
                if (argc > 1) {
                    if (targv[1][0] != '-' && targv[1][0] != '/') {
                        ++targv; --argc;
                        _tcscpy(LoggerName, targv[0]);
                    }
                }
            }
            else if (!_tcsicmp(targv[0], _T("-disable"))) {
                Action = ACTION_ENABLE;
                bEnable = FALSE;
                if (argc > 1) {
                    if (targv[1][0] != '-' && targv[1][0] != '/') {
                        ++targv; --argc;
                        _tcscpy(LoggerName, targv[0]);
                    }
                }
            }
            else if (!_tcsicmp(targv[0], _T("-stop"))) {
                Action = ACTION_STOP;
                if (argc > 1) {
                    if (targv[1][0] != '-' && targv[1][0] != '/') {
                        ++targv; --argc;
                        _tcscpy(LoggerName, targv[0]);
                    }
                }
            }
            else if (!_tcsicmp(targv[0], _T("-update"))) {
                Action = ACTION_UPDATE;
                if (argc > 1) {
                    if (targv[1][0] != '-' && targv[1][0] != '/') {
                        ++targv; --argc;
                        _tcscpy(LoggerName, targv[0]);
                    }
                }
            }
            else if (!_tcsicmp(targv[0], _T("-query"))) {
                Action = ACTION_QUERY;
                if (argc > 1) {
                    if (targv[1][0] != '-' && targv[1][0] != '/') {
                        ++targv; --argc;
                        _tcscpy(LoggerName, targv[0]);
                    }
                }
            }
            else if (!_tcsicmp(targv[0], _T("-list"))) {
                Action  = ACTION_LIST;
            }

            // Get other parameters.
            // Users can customize logger settings further by adding/changing
            // values to pLoggerInfo. Refer to EVENT_TRACE_PROPERTIES documentation
            // for available options.
            // In this sample, we allow changing maximum number of buffers and
            // specifying user mode (private) logger.
            // We also take trace file name and guid for enable/disable.
            else if (!_tcsicmp(targv[0], _T("-f"))) {
                if (argc > 1) {
                    _tfullpath(LogFileName, targv[1], MAXSTR);
                    ++targv; --argc;
                }
            }
            else if (!_tcsicmp(targv[0], _T("-guid"))) {
                if (argc > 1) {
                    // -guid #00000000-0000-0000-0000-000000000000
                    if (targv[1][0] == _T('#')) {
                        StringToGuid(&targv[1][1], &TargetGuid);
                        ++targv; --argc;
                    }
                }
            }
            else if (!_tcsicmp(targv[0], _T("-max"))) {
                if (argc > 1) {
                    pLoggerInfo->MaximumBuffers = _ttoi(targv[1]);
                    ++targv; --argc;
                }
            }
            else if (!_tcsicmp(targv[0], _T("-um"))) {
                    pLoggerInfo->LogFileMode |= EVENT_TRACE_PRIVATE_LOGGER_MODE;
            }
            else if ( targv[0][1] == 'h' || targv[0][1] == 'H' || targv[0][1] == '?'){
                Action = ACTION_HELP;
                PrintHelpMessage();
                if (utargv != NULL) {
                    GlobalFree(utargv);
                }
                free(pLoggerInfo);

                return (ERROR_SUCCESS);
            }
            else Action = ACTION_UNDEFINED;
        }
        else {
            _tprintf(_T("Invalid option given: %s\n"), targv[0]);
            Status = ERROR_INVALID_PARAMETER;
            SetLastError(Status);
            if (utargv != NULL) {
                GlobalFree(utargv);
            }
            free(pLoggerInfo);

            return (Status);
        }
    }

    // Set the kernel logger parameters.
    if (!_tcscmp(LoggerName, KERNEL_LOGGER_NAME)) {
        // Set enable flags. Users can add options to add additional kernel events
        // or remove some of these events.
        pLoggerInfo->EnableFlags |= EVENT_TRACE_FLAG_PROCESS;
        pLoggerInfo->EnableFlags |= EVENT_TRACE_FLAG_THREAD;
        pLoggerInfo->EnableFlags |= EVENT_TRACE_FLAG_DISK_IO;
        pLoggerInfo->EnableFlags |= EVENT_TRACE_FLAG_NETWORK_TCPIP;

        pLoggerInfo->Wnode.Guid = SystemTraceControlGuid;
        bKernelLogger = TRUE;
    }
    else if (pLoggerInfo->LogFileMode & EVENT_TRACE_PRIVATE_LOGGER_MODE) {
        // We must provide a control GUID for a private logger.
        pLoggerInfo->Wnode.Guid = TargetGuid;
    }

    // Process the request.
    switch (Action) {
        case  ACTION_START:
        {
            // Use default file name if not given
            if (_tcslen(LogFileName) == 0) {
                _tcscpy(LogFileName, DEFAULT_LOGFILE_NAME);
            }

            Status = StartTrace(&LoggerHandle, LoggerName, pLoggerInfo);

            if (Status != ERROR_SUCCESS) {
                _tprintf(_T("Could not start logger: %s\n")
                         _T("Operation Status:       %uL\n"),
                         LoggerName,
                         Status);

                break;
            }
            _tprintf(_T("Logger Started...\n"));
        }
        case ACTION_ENABLE:
        {
            // We can allow enabling a GUID during START operation (Note no break in case ACTION_START).
            // In that case, we do not need to get LoggerHandle separately.
            if (Action == ACTION_ENABLE ){

                // Get Logger Handle though Query.
                Status = ControlTrace((TRACEHANDLE) 0, LoggerName, pLoggerInfo, EVENT_TRACE_CONTROL_QUERY);
                if( Status != ERROR_SUCCESS ){
                    _tprintf( _T("ERROR: Logger not started\n")
                              _T("Operation Status:    %uL\n"),
                              Status);
                    break;
                }
                LoggerHandle = pLoggerInfo->Wnode.HistoricalContext;
            }

            // We do not allow EnableTrace on the Kernel Logger in this sample,
            // users can use EnableFlags to enable/disable certain kernel events.
            if (!bKernelLogger) {
                _tprintf(_T("Enabling trace to logger %d\n"), LoggerHandle);
                // In this sample, we use EnableFlag = EnableLebel = 0
                Status = EnableTrace (
                                bEnable,
                                0,
                                0,
                                &TargetGuid,
                                LoggerHandle);

                if (Status != ERROR_SUCCESS) {
                    _tprintf(_T("ERROR: Failed to enable Guid...\n"));
                    _tprintf(_T("Operation Status:       %uL\n"), Status);
                    break;
                }
            }
            break;
        }
        case ACTION_STOP :
        {
            LoggerHandle = (TRACEHANDLE) 0;
            Status = ControlTrace(LoggerHandle, LoggerName, pLoggerInfo, EVENT_TRACE_CONTROL_STOP);
            break;
        }
        case ACTION_LIST :
        {
            ULONG returnCount;
            PEVENT_TRACE_PROPERTIES pLoggerInfo[MAXIMUM_LOGGERS];
            PEVENT_TRACE_PROPERTIES pStorage, pTempStorage;
            ULONG SizeForOneProperty = sizeof(EVENT_TRACE_PROPERTIES) +
                                       2 * MAXSTR * sizeof(TCHAR);

            // We need to prepare space to receieve the inforamtion on loggers.
            SizeNeeded = MAXIMUM_LOGGERS * SizeForOneProperty;

            pStorage =  (PEVENT_TRACE_PROPERTIES)malloc(SizeNeeded);
            if (pStorage == NULL) {
                Status = ERROR_OUTOFMEMORY;
                break;
            }
            RtlZeroMemory(pStorage, SizeNeeded);
            // Save the pointer for free() later.
            pTempStorage = pStorage;

            for (i = 0; i < MAXIMUM_LOGGERS; i++) {
                pStorage->Wnode.BufferSize = SizeForOneProperty;
                pStorage->LoggerNameOffset = sizeof(EVENT_TRACE_PROPERTIES);
                pStorage->LogFileNameOffset = sizeof(EVENT_TRACE_PROPERTIES)
                                        + MAXSTR * sizeof(TCHAR);
                pLoggerInfo[i] = pStorage;
                pStorage = (PEVENT_TRACE_PROPERTIES) (
                                 (PUCHAR)pStorage +
                                  pStorage->Wnode.BufferSize);
            }

            Status = QueryAllTraces(pLoggerInfo,
                                MAXIMUM_LOGGERS,
                                &returnCount);

            if (Status == ERROR_SUCCESS)
            {
                for (j= 0; j < returnCount; j++)
                {
                    PrintLoggerStatus(pLoggerInfo[j],
                                        Status);
                    _tprintf(_T("\n"));
                }
            }

            free(pTempStorage);
            break;
        }

        case ACTION_UPDATE :
        {
            // In this sample, users can only update MaximumBuffers and log file name.
            // User can add more options for other parameters as needed.
            Status = ControlTrace(LoggerHandle, LoggerName, pLoggerInfo, EVENT_TRACE_CONTROL_UPDATE);
            break;
        }
        case ACTION_QUERY  :
        {
            Status = ControlTrace(LoggerHandle, LoggerName, pLoggerInfo, EVENT_TRACE_CONTROL_QUERY);
            break;
        }
        case ACTION_HELP:
        {
            PrintHelpMessage();
            break;
        }
        default :
        {
            _tprintf(_T("Error: no action specified\n"));
            PrintHelpMessage();
            break;
        }
    }

    if ((Action != ACTION_HELP) &&
        (Action != ACTION_UNDEFINED) &&
        (Action != ACTION_LIST)) {
        PrintLoggerStatus(pLoggerInfo,
                            Status);
    }

    if (Status != ERROR_SUCCESS) {
        SetLastError(Status);
    }
    if (utargv != NULL) {
        GlobalFree(utargv);
    }
    free(pLoggerInfo);

    return (Status);
}

void PrintHelpMessage ( )

Definition at line 664 of file TraceLog.c.

                   :

    prints out a help message.

Arguments:

    None.

Return Value:

    None.

--*/
{
    _tprintf(_T("Usage: tracelog [actions] [options] | [-h | -help | -?]\n"));
    _tprintf(_T("\n    actions:\n"));
    _tprintf(_T("\t-start   [LoggerName] Starts up the [LoggerName] trace session\n"));
    _tprintf(_T("\t-stop    [LoggerName] Stops the [LoggerName] trace session\n"));
    _tprintf(_T("\t-update  [LoggerName] Updates the [LoggerName] trace session\n"));
    _tprintf(_T("\t-enable  [LoggerName] Enables providers for the [LoggerName] session\n"));
    _tprintf(_T("\t-disable [LoggerName] Disables providers for the [LoggerName] session\n"));
    _tprintf(_T("\t-query   [LoggerName] Query status of [LoggerName] trace session\n"));
    _tprintf(_T("\t-list                 List all trace sessions\n"));

    _tprintf(_T("\n    options:\n"));
    _tprintf(_T("\t-um                   Use Process Private tracing\n"));
    _tprintf(_T("\t-max <n>              Sets maximum buffers\n"));
    _tprintf(_T("\t-f <name>             Log to file <name>\n"));
    _tprintf(_T("\t-guid #<guid>         Provider GUID to enable/disable\n"));
    _tprintf(_T("\n"));
    _tprintf(_T("\t-h\n"));
    _tprintf(_T("\t-help\n"));
    _tprintf(_T("\t-?                    Display usage information\n"));
}

void PrintLoggerStatus | ( | IN PEVENT_TRACE_PROPERTIES | LoggerInfo,
 |  | IN ULONG | Status
 | ) |  |

Definition at line 442 of file TraceLog.c.

                   :

    Prints out the status of the specified logger.

Arguments:

    LoggerInfo - The pointer to the resident EVENT_TRACE_PROPERTIES that has
        the information about the current logger.
    Status - The operation status of the current logger.

Return Value:

    None

--*/
{
    LPTSTR LoggerName, LogFileName;

    if ((LoggerInfo->LoggerNameOffset > 0) &&
        (LoggerInfo->LoggerNameOffset  < LoggerInfo->Wnode.BufferSize)) {
        LoggerName = (LPTSTR) ((PUCHAR)LoggerInfo +
                                LoggerInfo->LoggerNameOffset);
    }
    else LoggerName = NULL;

    if ((LoggerInfo->LogFileNameOffset > 0) &&
        (LoggerInfo->LogFileNameOffset  < LoggerInfo->Wnode.BufferSize)) {
        LogFileName = (LPTSTR) ((PUCHAR)LoggerInfo +
                                LoggerInfo->LogFileNameOffset);
    }
    else LogFileName = NULL;

    _tprintf(_T("Operation Status:       %uL\n"), Status);

    _tprintf(_T("Logger Name:            %s\n"),
            (LoggerName == NULL) ?
            _T(" ") : LoggerName);
        _tprintf(_T("Logger Id:              %I64x\n"), LoggerInfo->Wnode.HistoricalContext);
        _tprintf(_T("Logger Thread Id:       %d\n"), LoggerInfo->LoggerThreadId);

    if (Status != 0)
        return;

    _tprintf(_T("Buffer Size:            %d Kb"), LoggerInfo->BufferSize);
    if (LoggerInfo->LogFileMode & EVENT_TRACE_USE_PAGED_MEMORY) {
        _tprintf(_T(" using paged memory\n"));
    }
    else {
        _tprintf(_T("\n"));
    }
    _tprintf(_T("Maximum Buffers:        %d\n"), LoggerInfo->MaximumBuffers);
    _tprintf(_T("Minimum Buffers:        %d\n"), LoggerInfo->MinimumBuffers);
    _tprintf(_T("Number of Buffers:      %d\n"), LoggerInfo->NumberOfBuffers);
    _tprintf(_T("Free Buffers:           %d\n"), LoggerInfo->FreeBuffers);
    _tprintf(_T("Buffers Written:        %d\n"), LoggerInfo->BuffersWritten);
    _tprintf(_T("Events Lost:            %d\n"), LoggerInfo->EventsLost);
    _tprintf(_T("Log Buffers Lost:       %d\n"), LoggerInfo->LogBuffersLost);
    _tprintf(_T("Real Time Buffers Lost: %d\n"), LoggerInfo->RealTimeBuffersLost);
    _tprintf(_T("AgeLimit:               %d\n"), LoggerInfo->AgeLimit);

    if (LogFileName == NULL) {
        _tprintf(_T("Buffering Mode:         "));
    }
    else {
        _tprintf(_T("Log File Mode:          "));
    }
    if (LoggerInfo->LogFileMode & EVENT_TRACE_FILE_MODE_APPEND) {
        _tprintf(_T("Append  "));
    }
    if (LoggerInfo->LogFileMode & EVENT_TRACE_FILE_MODE_CIRCULAR) {
        _tprintf(_T("Circular\n"));
    }
    else if (LoggerInfo->LogFileMode & EVENT_TRACE_FILE_MODE_SEQUENTIAL) {
        _tprintf(_T("Sequential\n"));
    }
    else {
        _tprintf(_T("Sequential\n"));
    }
    if (LoggerInfo->LogFileMode & EVENT_TRACE_REAL_TIME_MODE) {
        _tprintf(_T("Real Time mode enabled"));
        _tprintf(_T("\n"));
    }

    if (LoggerInfo->MaximumFileSize > 0)
        _tprintf(_T("Maximum File Size:      %d Mb\n"), LoggerInfo->MaximumFileSize);

    if (LoggerInfo->FlushTimer > 0)
        _tprintf(_T("Buffer Flush Timer:     %d secs\n"), LoggerInfo->FlushTimer);

    if (LoggerInfo->EnableFlags != 0) {
        _tprintf(_T("Enabled tracing:        "));

        if ((LoggerName != NULL) && (!_tcscmp(LoggerName, KERNEL_LOGGER_NAME))) {

            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_PROCESS)
                _tprintf(_T("Process "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_THREAD)
                _tprintf(_T("Thread "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_DISK_IO)
                _tprintf(_T("Disk "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_DISK_FILE_IO)
                _tprintf(_T("File "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS)
                _tprintf(_T("PageFaults "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS)
                _tprintf(_T("HardFaults "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_IMAGE_LOAD)
                _tprintf(_T("ImageLoad "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_NETWORK_TCPIP)
                _tprintf(_T("TcpIp "));
            if (LoggerInfo->EnableFlags & EVENT_TRACE_FLAG_REGISTRY)
                _tprintf(_T("Registry "));
        }else{
            _tprintf(_T("0x%08x"), LoggerInfo->EnableFlags );
        }
        _tprintf(_T("\n"));
    }
    if (LogFileName != NULL) {
        _tprintf(_T("Log Filename:           %s\n"), LogFileName);
    }

}

void StringToGuid | ( | IN TCHAR * | str,
 |  | OUT LPGUID | guid
 | ) |  |
void StringToGuid | ( | IN TCHAR * | str,
 |  | IN OUT LPGUID | guid
 | ) |  |

Definition at line 617 of file TraceLog.c.

                   :

    Converts a string into a GUID.

Arguments:

    str - A string in TCHAR.
    guid - The pointer to a GUID that will have the converted GUID.

Return Value:

    None.

--*/
{
    TCHAR temp[10];
    int i;

    _tcsncpy(temp, str, 8);
    temp[8] = 0;
    guid->Data1 = ahextoi(temp);
    _tcsncpy(temp, &str[9], 4);
    temp[4] = 0;
    guid->Data2 = (USHORT) ahextoi(temp);
    _tcsncpy(temp, &str[14], 4);
    temp[4] = 0;
    guid->Data3 = (USHORT) ahextoi(temp);

    for (i=0; i<2; i++) {
        _tcsncpy(temp, &str[19 + (i*2)], 2);
        temp[2] = 0;
        guid->Data4[i] = (UCHAR) ahextoi(temp);
    }
    for (i=2; i<8; i++) {
        _tcsncpy(temp, &str[20 + (i*2)], 2);
        temp[2] = 0;
        guid->Data4[i] = (UCHAR) ahextoi(temp);
    }
}

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/AdvQuery/AdvQuery.Cxx File Reference

  • WinBase
  • Indexing
  • AdvQuery
Classes | Defines | Functions

AdvQuery.Cxx File Reference

#include <stdio.h>
#include <windows.h>
#include <oledberr.h>
#include <oledb.h>
#include <cmdtree.h>
#include <olectl.h>
#include <ntquery.h>

Go to the source code of this file.

Classes

class | CAsynchNotify
class | XInterface< T >

Defines

#define | DBINITCONSTANTS
#define | OLEDBVER 0x0250

Functions

WCHAR * | AllocAndCopy (WCHAR const *pwcIn)
HRESULT | CreateICommand (ICommand **ppICommand)
HRESULT | CreateQueryTree (WCHAR const *pwcQueryRestriction, DBCOMMANDTREE **ppTree)
void | DisplayCommandTree (DBCOMMANDTREE *pNode, ULONG iLevel=0)
HRESULT | DoQuery (WCHAR const *pwcQueryScope, WCHAR const *pwcQueryCatalog, WCHAR const *pwcQueryMachine, WCHAR const *pwcQueryRestriction, BOOL fDisplayTree)
DBCOMMANDTREE * | NewTreeNode (DBCOMMANDOP op, WORD wKind)
HRESULT | SetCommandProperties (ICommand *pICommand)
HRESULT | SetScopeCatalogAndMachine (ICommand *pICommand, WCHAR const *pwcQueryScope, WCHAR const *pwcQueryCatalog, WCHAR const *pwcQueryMachine)
void | Usage ()
HRESULT | WaitForQueryToComplete (IRowset *pRowset)
int __cdecl | wmain (int argc, WCHAR *argv[])

Define Documentation

#define DBINITCONSTANTS

Definition at line 28 of file AdvQuery.Cxx.

#define OLEDBVER 0x0250

Definition at line 27 of file AdvQuery.Cxx.

Function Documentation

WCHAR* AllocAndCopy ( WCHAR const * pwcIn )

Definition at line 364 of file AdvQuery.Cxx.

{
    ULONG cwc = (ULONG) ( wcslen( pwcIn ) + 1 );

    // note: CoTaskMemAlloc can return 0 if out of memory, not checked

    WCHAR * pwc = (WCHAR *) CoTaskMemAlloc( cwc * sizeof WCHAR );
    wcscpy( pwc, pwcIn );
    return pwc;
} //AllocAndCopy

HRESULT CreateICommand ( ICommand ** ppICommand )

Definition at line 77 of file AdvQuery.Cxx.

{
    // Instantiate the data source object

    XInterface<IDBInitialize> xIDBInit;
    static const GUID guidIndexingServiceDSO = CLSID_INDEX_SERVER_DSO;
    HRESULT hr = CoCreateInstance( guidIndexingServiceDSO,
                                   0,
                                   CLSCTX_INPROC_SERVER,
                                   IID_IDBInitialize,
                                   xIDBInit.GetQIPointer() );
    if ( FAILED(hr) )
        return hr;

    // Initialize, verifying that we supplied the right variables

    hr = xIDBInit->Initialize();
    if ( FAILED(hr) )
        return hr;

    // Get a session object

    XInterface<IDBCreateSession> xIDBSess;
    hr = xIDBInit->QueryInterface( IID_IDBCreateSession,
                                   xIDBSess.GetQIPointer() );
    if ( FAILED(hr) )
        return hr;

    // Get a Create Command object

    XInterface<IDBCreateCommand> xICreateCommand;
    hr = xIDBSess->CreateSession( 0,
                                  IID_IDBCreateCommand,
                                  xICreateCommand.GetIUPointer() );
    if ( FAILED(hr) )
        return hr;

    // Create the ICommand

    XInterface<ICommand> xICommand;
    hr = xICreateCommand->CreateCommand( 0,
                                         IID_ICommand,
                                         xICommand.GetIUPointer() );
    if ( FAILED(hr) )
        return hr;

    *ppICommand = xICommand.Acquire();

    return hr;
} //CreateICommand

HRESULT CreateQueryTree | ( | WCHAR const * | pwcQueryRestriction,
 |  | DBCOMMANDTREE ** | ppTree
 | ) |  |

Definition at line 583 of file AdvQuery.Cxx.

{
    // These are the properties that'll be referenced below

    const DBID dbidContents = { PSGUID_STORAGE, DBKIND_GUID_PROPID,
                                (LPOLESTR) PID_STG_CONTENTS };
    const DBID dbidPath =     { PSGUID_STORAGE, DBKIND_GUID_PROPID,
                                (LPOLESTR) PID_STG_PATH };
    const DBID dbidSize =     { PSGUID_STORAGE, DBKIND_GUID_PROPID,
                                (LPOLESTR) PID_STG_SIZE };
    DBID dbidRank;
    dbidRank.uGuid.guid = PSGUID_QUERY;
    dbidRank.eKind = DBKIND_GUID_PROPID;
    dbidRank.uName.ulPropid = PROPID_QUERY_RANK ;

    // The restriction is a content node with either a word or a phrase.
    // This is the most simple possible query.  Other types of nodes include
    // AND, OR, NOT, etc.
    // The CITextToFullTree function is available for building more complex
    // queries given a text string.

    DBCOMMANDTREE *pRestriction = NewTreeNode( DBOP_content,
                                               DBVALUEKIND_CONTENT );
    DBCONTENT * pDBContent = (DBCONTENT *) CoTaskMemAlloc( sizeof DBCONTENT );
    memset( pDBContent, 0, sizeof DBCONTENT );
    pRestriction->value.pdbcntntValue = pDBContent;
    pDBContent->dwGenerateMethod = GENERATE_METHOD_EXACT;
    pDBContent->lWeight = 1000; // maximum possible weight
    pDBContent->lcid = GetSystemDefaultLCID();
    pDBContent->pwszPhrase = AllocAndCopy( pwcQueryRestriction );

    // This identifies "file contents" as the property for the restrition

    DBCOMMANDTREE *pPropID = NewTreeNode( DBOP_column_name, DBVALUEKIND_ID );
    pRestriction->pctFirstChild = pPropID;
    DBID *pDBID = (DBID *) CoTaskMemAlloc( sizeof DBID );
    *pDBID = dbidContents;
    pPropID->value.pdbidValue = pDBID;

    DBCOMMANDTREE *pSelect = NewTreeNode( DBOP_select, DBVALUEKIND_EMPTY );
    DBCOMMANDTREE *pTableId = NewTreeNode( DBOP_table_name, DBVALUEKIND_WSTR );
    pSelect->pctFirstChild = pTableId;
    pTableId->value.pwszValue = AllocAndCopy( L"Table" );
    pTableId->pctNextSibling = pRestriction;

    DBCOMMANDTREE *pProject = NewTreeNode( DBOP_project, DBVALUEKIND_EMPTY );
    pProject->pctFirstChild = pSelect;

    // The project anchor holds the list of columns that are retrieved

    DBCOMMANDTREE * pProjectAnchor = NewTreeNode( DBOP_project_list_anchor,
                                                  DBVALUEKIND_EMPTY );
    pSelect->pctNextSibling = pProjectAnchor;

    // Retrieve rank as column 1

    DBCOMMANDTREE * pProjectRank = NewTreeNode( DBOP_project_list_element,
                                                  DBVALUEKIND_EMPTY );
    pProjectAnchor->pctFirstChild = pProjectRank;

    DBCOMMANDTREE * pColumnRank = NewTreeNode( DBOP_column_name,
                                               DBVALUEKIND_ID );
    pProjectRank->pctFirstChild = pColumnRank;
    DBID *pDBIDRank = (DBID *) CoTaskMemAlloc( sizeof DBID );
    pColumnRank->value.pdbidValue = pDBIDRank;
    *pDBIDRank = dbidRank;

    // Retrieve file size as column 2

    DBCOMMANDTREE * pProjectSize = NewTreeNode( DBOP_project_list_element,
                                                DBVALUEKIND_EMPTY );
    pProjectRank->pctNextSibling = pProjectSize;

    DBCOMMANDTREE * pColumnSize = NewTreeNode( DBOP_column_name,
                                               DBVALUEKIND_ID );
    pProjectSize->pctFirstChild = pColumnSize;
    DBID *pDBIDSize = (DBID *) CoTaskMemAlloc( sizeof DBID );
    pColumnSize->value.pdbidValue = pDBIDSize;
    *pDBIDSize = dbidSize;

    // Retrieve file path as column 3

    DBCOMMANDTREE * pProjectPath = NewTreeNode( DBOP_project_list_element,
                                                DBVALUEKIND_EMPTY );
    pProjectSize->pctNextSibling = pProjectPath;

    DBCOMMANDTREE * pColumnPath = NewTreeNode( DBOP_column_name,
                                               DBVALUEKIND_ID );
    pProjectPath->pctFirstChild = pColumnPath;
    DBID *pDBIDPath = (DBID *) CoTaskMemAlloc( sizeof DBID );
    pColumnPath->value.pdbidValue = pDBIDPath;
    *pDBIDPath = dbidPath;

    // The sort node specifies the sort order for the results

    DBCOMMANDTREE * pSort = NewTreeNode( DBOP_sort, DBVALUEKIND_EMPTY );
    pSort->pctFirstChild = pProject;

    // The sort anchor is the start of the list of sort properties

    DBCOMMANDTREE * pSortAnchor = NewTreeNode( DBOP_sort_list_anchor,
                                               DBVALUEKIND_EMPTY );
    pProject->pctNextSibling = pSortAnchor;

    // The sort order is rank

    DBCOMMANDTREE * pSortRank = NewTreeNode( DBOP_sort_list_element,
                                             DBVALUEKIND_SORTINFO );
    pSortAnchor->pctFirstChild = pSortRank;

    DBSORTINFO * pSortInfo = (DBSORTINFO *) CoTaskMemAlloc( sizeof DBSORTINFO );
    memset( pSortInfo, 0, sizeof DBSORTINFO );
    pSortRank->value.pdbsrtinfValue = pSortInfo;
    pSortInfo->fDesc = TRUE; // descending, not ascending
    pSortInfo->lcid = GetSystemDefaultLCID();

    DBCOMMANDTREE * pSortColumnRank = NewTreeNode( DBOP_column_name,
                                                   DBVALUEKIND_ID );
    pSortRank->pctFirstChild = pSortColumnRank;
    DBID *pDBIDSortRank = (DBID *) CoTaskMemAlloc( sizeof DBID );
    pSortColumnRank->value.pdbidValue = pDBIDSortRank;
    *pDBIDSortRank = dbidRank;

    // The sort node is the head of the tree

    *ppTree = pSort;

    return S_OK;
} //CreateQueryTree

void DisplayCommandTree | ( | DBCOMMANDTREE * | pNode,
 |  | ULONG | iLevel = 0
 | ) |  |

Definition at line 215 of file DispTree.Cxx.

{
    PrintSpace( iLevel );
    printf( "op: (%d) ", pNode->op );
    switch ( pNode->op )
    {
        case DBOP_scalar_constant : printf( "DBOP_scalar_constant" ); break;
        case DBOP_DEFAULT : printf( "DBOP_DEFAULT" ); break;
        case DBOP_NULL : printf( "DBOP_NULL" ); break;
        case DBOP_bookmark_name : printf( "DBOP_bookmark_name" ); break;
        case DBOP_catalog_name : printf( "DBOP_catalog_name" ); break;
        case DBOP_column_name : printf( "DBOP_column_name" ); break;
        case DBOP_schema_name : printf( "DBOP_schema_name" ); break;
        case DBOP_outall_name : printf( "DBOP_outall_name" ); break;
        case DBOP_qualifier_name : printf( "DBOP_qualifier_name" ); break;
        case DBOP_qualified_column_name : printf( "DBOP_qualified_column_name" ); break;
        case DBOP_table_name : printf( "DBOP_table_name" ); break;
        case DBOP_nested_table_name : printf( "DBOP_nested_table_name" ); break;
        case DBOP_nested_column_name : printf( "DBOP_nested_column_name" ); break;
        case DBOP_row : printf( "DBOP_row" ); break;
        case DBOP_table : printf( "DBOP_table" ); break;
        case DBOP_sort : printf( "DBOP_sort" ); break;
        case DBOP_distinct : printf( "DBOP_distinct" ); break;
        case DBOP_distinct_order_preserving : printf( "DBOP_distinct_order_preserving" ); break;
        case DBOP_alias : printf( "DBOP_alias" ); break;
        case DBOP_cross_join : printf( "DBOP_cross_join" ); break;
        case DBOP_union_join : printf( "DBOP_union_join" ); break;
        case DBOP_inner_join : printf( "DBOP_inner_join" ); break;
        case DBOP_left_semi_join : printf( "DBOP_left_semi_join" ); break;
        case DBOP_right_semi_join : printf( "DBOP_right_semi_join" ); break;
        case DBOP_left_anti_semi_join : printf( "DBOP_left_anti_semi_join" ); break;
        case DBOP_right_anti_semi_join : printf( "DBOP_right_anti_semi_join" ); break;
        case DBOP_left_outer_join : printf( "DBOP_left_outer_join" ); break;
        case DBOP_right_outer_join : printf( "DBOP_right_outer_join" ); break;
        case DBOP_full_outer_join : printf( "DBOP_full_outer_join" ); break;
        case DBOP_natural_join : printf( "DBOP_natural_join" ); break;
        case DBOP_natural_left_outer_join : printf( "DBOP_natural_left_outer_join" ); break;
        case DBOP_natural_right_outer_join : printf( "DBOP_natural_right_outer_join" ); break;
        case DBOP_natural_full_outer_join : printf( "DBOP_natural_full_outer_join" ); break;
        case DBOP_set_intersection : printf( "DBOP_set_intersection" ); break;
        case DBOP_set_union : printf( "DBOP_set_union" ); break;
        case DBOP_set_left_difference : printf( "DBOP_set_left_difference" ); break;
        case DBOP_set_right_difference : printf( "DBOP_set_right_difference" ); break;
        case DBOP_set_anti_difference : printf( "DBOP_set_anti_difference" ); break;
        case DBOP_bag_intersection : printf( "DBOP_bag_intersection" ); break;
        case DBOP_bag_union : printf( "DBOP_bag_union" ); break;
        case DBOP_bag_left_difference : printf( "DBOP_bag_left_difference" ); break;
        case DBOP_bag_right_difference : printf( "DBOP_bag_right_difference" ); break;
        case DBOP_bag_anti_difference : printf( "DBOP_bag_anti_difference" ); break;
        case DBOP_division : printf( "DBOP_division" ); break;
        case DBOP_relative_sampling : printf( "DBOP_relative_sampling" ); break;
        case DBOP_absolute_sampling : printf( "DBOP_absolute_sampling" ); break;
        case DBOP_transitive_closure : printf( "DBOP_transitive_closure" ); break;
        case DBOP_recursive_union : printf( "DBOP_recursive_union" ); break;
        case DBOP_aggregate : printf( "DBOP_aggregate" ); break;
        case DBOP_remote_table : printf( "DBOP_remote_table" ); break;
        case DBOP_select : printf( "DBOP_select" ); break;
        case DBOP_order_preserving_select : printf( "DBOP_order_preserving_select" ); break;
        case DBOP_project : printf( "DBOP_project" ); break;
        case DBOP_project_order_preserving : printf( "DBOP_project_order_preserving" ); break;
        case DBOP_top : printf( "DBOP_top" ); break;
        case DBOP_top_percent : printf( "DBOP_top_percent" ); break;
        case DBOP_top_plus_ties : printf( "DBOP_top_plus_ties" ); break;
        case DBOP_top_percent_plus_ties : printf( "DBOP_top_percent_plus_ties" ); break;
        case DBOP_rank : printf( "DBOP_rank" ); break;
        case DBOP_rank_ties_equally : printf( "DBOP_rank_ties_equally" ); break;
        case DBOP_rank_ties_equally_and_skip : printf( "DBOP_rank_ties_equally_and_skip" ); break;
        case DBOP_navigate : printf( "DBOP_navigate" ); break;
        case DBOP_nesting : printf( "DBOP_nesting" ); break;
        case DBOP_unnesting : printf( "DBOP_unnesting" ); break;
        case DBOP_nested_apply : printf( "DBOP_nested_apply" ); break;
        case DBOP_cross_tab : printf( "DBOP_cross_tab" ); break;
        case DBOP_is_NULL : printf( "DBOP_is_NULL" ); break;
        case DBOP_is_NOT_NULL : printf( "DBOP_is_NOT_NULL" ); break;
        case DBOP_equal : printf( "DBOP_equal" ); break;
        case DBOP_not_equal : printf( "DBOP_not_equal" ); break;
        case DBOP_less : printf( "DBOP_less" ); break;
        case DBOP_less_equal : printf( "DBOP_less_equal" ); break;
        case DBOP_greater : printf( "DBOP_greater" ); break;
        case DBOP_greater_equal : printf( "DBOP_greater_equal" ); break;
        case DBOP_equal_all : printf( "DBOP_equal_all" ); break;
        case DBOP_not_equal_all : printf( "DBOP_not_equal_all" ); break;
        case DBOP_less_all : printf( "DBOP_less_all" ); break;
        case DBOP_less_equal_all : printf( "DBOP_less_equal_all" ); break;
        case DBOP_greater_all : printf( "DBOP_greater_all" ); break;
        case DBOP_greater_equal_all : printf( "DBOP_greater_equal_all" ); break;
        case DBOP_equal_any : printf( "DBOP_equal_any" ); break;
        case DBOP_not_equal_any : printf( "DBOP_not_equal_any" ); break;
        case DBOP_less_any : printf( "DBOP_less_any" ); break;
        case DBOP_less_equal_any : printf( "DBOP_less_equal_any" ); break;
        case DBOP_greater_any : printf( "DBOP_greater_any" ); break;
        case DBOP_greater_equal_any : printf( "DBOP_greater_equal_any" ); break;
        case DBOP_anybits : printf( "DBOP_anybits" ); break;
        case DBOP_allbits : printf( "DBOP_allbits" ); break;
        case DBOP_anybits_any : printf( "DBOP_anybits_any" ); break;
        case DBOP_allbits_any : printf( "DBOP_allbits_any" ); break;
        case DBOP_anybits_all : printf( "DBOP_anybits_all" ); break;
        case DBOP_allbits_all : printf( "DBOP_allbits_all" ); break;
        case DBOP_between : printf( "DBOP_between" ); break;
        case DBOP_between_unordered : printf( "DBOP_between_unordered" ); break;
        case DBOP_match : printf( "DBOP_match" ); break;
        case DBOP_match_unique : printf( "DBOP_match_unique" ); break;
        case DBOP_match_partial : printf( "DBOP_match_partial" ); break;
        case DBOP_match_partial_unique : printf( "DBOP_match_partial_unique" ); break;
        case DBOP_match_full : printf( "DBOP_match_full" ); break;
        case DBOP_match_full_unique : printf( "DBOP_match_full_unique" ); break;
        case DBOP_scalar_parameter : printf( "DBOP_scalar_parameter" ); break;
        case DBOP_scalar_function : printf( "DBOP_scalar_function" ); break;
        case DBOP_plus : printf( "DBOP_plus" ); break;
        case DBOP_minus : printf( "DBOP_minus" ); break;
        case DBOP_times : printf( "DBOP_times" ); break;
        case DBOP_over : printf( "DBOP_over" ); break;
        case DBOP_div : printf( "DBOP_div" ); break;
        case DBOP_modulo : printf( "DBOP_modulo" ); break;
        case DBOP_power : printf( "DBOP_power" ); break;
        case DBOP_like : printf( "DBOP_like" ); break;
        case DBOP_sounds_like : printf( "DBOP_sounds_like" ); break;
        case DBOP_like_any : printf( "DBOP_like_any" ); break;
        case DBOP_like_all : printf( "DBOP_like_all" ); break;
        case DBOP_is_INVALID : printf( "DBOP_is_INVALID" ); break;
        case DBOP_is_TRUE : printf( "DBOP_is_TRUE" ); break;
        case DBOP_is_FALSE : printf( "DBOP_is_FALSE" ); break;
        case DBOP_and : printf( "DBOP_and" ); break;
        case DBOP_or : printf( "DBOP_or" ); break;
        case DBOP_xor : printf( "DBOP_xor" ); break;
        case DBOP_equivalent : printf( "DBOP_equivalent" ); break;
        case DBOP_not : printf( "DBOP_not" ); break;
        case DBOP_implies : printf( "DBOP_implies" ); break;
        case DBOP_overlaps : printf( "DBOP_overlaps" ); break;
        case DBOP_case_condition : printf( "DBOP_case_condition" ); break;
        case DBOP_case_value : printf( "DBOP_case_value" ); break;
        case DBOP_nullif : printf( "DBOP_nullif" ); break;
        case DBOP_cast : printf( "DBOP_cast" ); break;
        case DBOP_coalesce : printf( "DBOP_coalesce" ); break;
        case DBOP_position : printf( "DBOP_position" ); break;
        case DBOP_extract : printf( "DBOP_extract" ); break;
        case DBOP_char_length : printf( "DBOP_char_length" ); break;
        case DBOP_octet_length : printf( "DBOP_octet_length" ); break;
        case DBOP_bit_length : printf( "DBOP_bit_length" ); break;
        case DBOP_substring : printf( "DBOP_substring" ); break;
        case DBOP_upper : printf( "DBOP_upper" ); break;
        case DBOP_lower : printf( "DBOP_lower" ); break;
        case DBOP_trim : printf( "DBOP_trim" ); break;
        case DBOP_translate : printf( "DBOP_translate" ); break;
        case DBOP_convert : printf( "DBOP_convert" ); break;
        case DBOP_string_concat : printf( "DBOP_string_concat" ); break;
        case DBOP_current_date : printf( "DBOP_current_date" ); break;
        case DBOP_current_time : printf( "DBOP_current_time" ); break;
        case DBOP_current_timestamp : printf( "DBOP_current_timestamp" ); break;
        case DBOP_content_select : printf( "DBOP_content_select" ); break;
        case DBOP_content : printf( "DBOP_content" ); break;
        case DBOP_content_freetext : printf( "DBOP_content_freetext" ); break;
        case DBOP_content_proximity : printf( "DBOP_content_proximity" ); break;
        case DBOP_content_vector_or : printf( "DBOP_content_vector_or" ); break;
        case DBOP_delete : printf( "DBOP_delete" ); break;
        case DBOP_update : printf( "DBOP_update" ); break;
        case DBOP_insert : printf( "DBOP_insert" ); break;
        case DBOP_min : printf( "DBOP_min" ); break;
        case DBOP_max : printf( "DBOP_max" ); break;
        case DBOP_count : printf( "DBOP_count" ); break;
        case DBOP_sum : printf( "DBOP_sum" ); break;
        case DBOP_avg : printf( "DBOP_avg" ); break;
        case DBOP_any_sample : printf( "DBOP_any_sample" ); break;
        case DBOP_stddev : printf( "DBOP_stddev" ); break;
        case DBOP_stddev_pop : printf( "DBOP_stddev_pop" ); break;
        case DBOP_var : printf( "DBOP_var" ); break;
        case DBOP_var_pop : printf( "DBOP_var_pop" ); break;
        case DBOP_first : printf( "DBOP_first" ); break;
        case DBOP_last : printf( "DBOP_last" ); break;
        case DBOP_in : printf( "DBOP_in" ); break;
        case DBOP_exists : printf( "DBOP_exists" ); break;
        case DBOP_unique : printf( "DBOP_unique" ); break;
        case DBOP_subset : printf( "DBOP_subset" ); break;
        case DBOP_proper_subset : printf( "DBOP_proper_subset" ); break;
        case DBOP_superset : printf( "DBOP_superset" ); break;
        case DBOP_proper_superset : printf( "DBOP_proper_superset" ); break;
        case DBOP_disjoint : printf( "DBOP_disjoint" ); break;
        case DBOP_pass_through : printf( "DBOP_pass_through" ); break;
        case DBOP_defined_by_GUID : printf( "DBOP_defined_by_GUID" ); break;
        case DBOP_text_command : printf( "DBOP_text_command" ); break;
        case DBOP_SQL_select : printf( "DBOP_SQL_select" ); break;
        case DBOP_prior_command_tree : printf( "DBOP_prior_command_tree" ); break;
        case DBOP_add_columns : printf( "DBOP_add_columns" ); break;
        case DBOP_column_list_anchor : printf( "DBOP_column_list_anchor" ); break;
        case DBOP_column_list_element : printf( "DBOP_column_list_element" ); break;
        case DBOP_command_list_anchor : printf( "DBOP_command_list_anchor" ); break;
        case DBOP_command_list_element : printf( "DBOP_command_list_element" ); break;
        case DBOP_from_list_anchor : printf( "DBOP_from_list_anchor" ); break;
        case DBOP_from_list_element : printf( "DBOP_from_list_element" ); break;
        case DBOP_project_list_anchor : printf( "DBOP_project_list_anchor" ); break;
        case DBOP_project_list_element : printf( "DBOP_project_list_element" ); break;
        case DBOP_row_list_anchor : printf( "DBOP_row_list_anchor" ); break;
        case DBOP_row_list_element : printf( "DBOP_row_list_element" ); break;
        case DBOP_scalar_list_anchor : printf( "DBOP_scalar_list_anchor" ); break;
        case DBOP_scalar_list_element : printf( "DBOP_scalar_list_element" ); break;
        case DBOP_set_list_anchor : printf( "DBOP_set_list_anchor" ); break;
        case DBOP_set_list_element : printf( "DBOP_set_list_element" ); break;
        case DBOP_sort_list_anchor : printf( "DBOP_sort_list_anchor" ); break;
        case DBOP_sort_list_element : printf( "DBOP_sort_list_element" ); break;
        case DBOP_alter_character_set : printf( "DBOP_alter_character_set" ); break;
        case DBOP_alter_collation : printf( "DBOP_alter_collation" ); break;
        case DBOP_alter_domain : printf( "DBOP_alter_domain" ); break;
        case DBOP_alter_index : printf( "DBOP_alter_index" ); break;
        case DBOP_alter_procedure : printf( "DBOP_alter_procedure" ); break;
        case DBOP_alter_schema : printf( "DBOP_alter_schema" ); break;
        case DBOP_alter_table : printf( "DBOP_alter_table" ); break;
        case DBOP_alter_trigger : printf( "DBOP_alter_trigger" ); break;
        case DBOP_alter_view : printf( "DBOP_alter_view" ); break;
        case DBOP_coldef_list_anchor : printf( "DBOP_coldef_list_anchor" ); break;
        case DBOP_coldef_list_element : printf( "DBOP_coldef_list_element" ); break;
        case DBOP_create_assertion : printf( "DBOP_create_assertion" ); break;
        case DBOP_create_character_set : printf( "DBOP_create_character_set" ); break;
        case DBOP_create_collation : printf( "DBOP_create_collation" ); break;
        case DBOP_create_domain : printf( "DBOP_create_domain" ); break;
        case DBOP_create_index : printf( "DBOP_create_index" ); break;
        case DBOP_create_procedure : printf( "DBOP_create_procedure" ); break;
        case DBOP_create_schema : printf( "DBOP_create_schema" ); break;
        case DBOP_create_synonym : printf( "DBOP_create_synonym" ); break;
        case DBOP_create_table : printf( "DBOP_create_table" ); break;
        case DBOP_create_temporary_table : printf( "DBOP_create_temporary_table" ); break;
        case DBOP_create_translation : printf( "DBOP_create_translation" ); break;
        case DBOP_create_trigger : printf( "DBOP_create_trigger" ); break;
        case DBOP_create_view : printf( "DBOP_create_view" ); break;
        case DBOP_drop_assertion : printf( "DBOP_drop_assertion" ); break;
        case DBOP_drop_character_set : printf( "DBOP_drop_character_set" ); break;
        case DBOP_drop_collation : printf( "DBOP_drop_collation" ); break;
        case DBOP_drop_domain : printf( "DBOP_drop_domain" ); break;
        case DBOP_drop_index : printf( "DBOP_drop_index" ); break;
        case DBOP_drop_procedure : printf( "DBOP_drop_procedure" ); break;
        case DBOP_drop_schema : printf( "DBOP_drop_schema" ); break;
        case DBOP_drop_synonym : printf( "DBOP_drop_synonym" ); break;
        case DBOP_drop_table : printf( "DBOP_drop_table" ); break;
        case DBOP_drop_translation : printf( "DBOP_drop_translation" ); break;
        case DBOP_drop_trigger : printf( "DBOP_drop_trigger" ); break;
        case DBOP_drop_view : printf( "DBOP_drop_view" ); break;
        case DBOP_foreign_key : printf( "DBOP_foreign_key" ); break;
        case DBOP_grant_privileges : printf( "DBOP_grant_privileges" ); break;
        case DBOP_index_list_anchor : printf( "DBOP_index_list_anchor" ); break;
        case DBOP_index_list_element : printf( "DBOP_index_list_element" ); break;
        case DBOP_primary_key : printf( "DBOP_primary_key" ); break;
        case DBOP_property_list_anchor : printf( "DBOP_property_list_anchor" ); break;
        case DBOP_property_list_element : printf( "DBOP_property_list_element" ); break;
        case DBOP_referenced_table : printf( "DBOP_referenced_table" ); break;
        case DBOP_rename_object : printf( "DBOP_rename_object" ); break;
        case DBOP_revoke_privileges : printf( "DBOP_revoke_privileges" ); break;
        case DBOP_schema_authorization : printf( "DBOP_schema_authorization" ); break;
        case DBOP_unique_key : printf( "DBOP_unique_key" ); break;
        case DBOP_scope_list_anchor : printf( "DBOP_scope_list_anchor" ); break;
        case DBOP_scope_list_element : printf( "DBOP_scope_list_element" ); break;
        case DBOP_content_table : printf( "DBOP_content_table" ); break;

        default : printf( "unknown DBOP" ); break;
    }

    printf( "\n" );

    PrintSpace( iLevel );
    printf( "wKind: (%d) ", pNode->wKind );
    switch( pNode->wKind )
    {
        case DBVALUEKIND_BYGUID :
        {
            printf( "DBVALUEKIND_BYGUID " );
            break;
        }
        case DBVALUEKIND_COLDESC :
        {
            printf( "DBVALUEKIND_COLDESC " );
            break;
        }
        case DBVALUEKIND_ID :
        {
            printf( "DBVALUEKIND_ID: " );
            if ( 0 == pNode->value.pdbidValue )
                printf( "NULL" );
            else
            {
                DBKIND kind = pNode->value.pdbidValue->eKind;

                if ( DBKIND_GUID        == kind ||
                     DBKIND_GUID_NAME   == kind ||
                     DBKIND_GUID_PROPID == kind )
                {
                    GUID &g = pNode->value.pdbidValue->uGuid.guid;
                    printf( "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-"
                            "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
                            g.Data1,g.Data2,g.Data3,g.Data4[0],
                            g.Data4[1],g.Data4[2],g.Data4[3],g.Data4[4],
                            g.Data4[5],g.Data4[6],g.Data4[7] );
                }
                if ( DBKIND_GUID_PROPID == kind ||
                     DBKIND_PROPID      == kind )
                    printf( " %d", pNode->value.pdbidValue->uName.ulPropid );
                if ( DBKIND_GUID_NAME == kind ||
                     DBKIND_NAME      == kind )
                    printf( " '%ws'", pNode->value.pdbidValue->uName.pwszName );
            }
            break;
        }
        case DBVALUEKIND_CONTENT :
        {
            printf( "DBVALUEKIND_CONTENT: " );
            if ( 0 == pNode->value.pdbcntntValue )
                printf( "NULL" );
            else
                printf( "'%ws', method %d, weight %d, lcid %#x",
                        pNode->value.pdbcntntValue->pwszPhrase,
                        pNode->value.pdbcntntValue->dwGenerateMethod,
                        pNode->value.pdbcntntValue->lWeight,
                        pNode->value.pdbcntntValue->lcid );
            break;
        }
        case DBVALUEKIND_CONTENTVECTOR :
        {
            printf( "DBVALUEKIND_CONTENTVECTOR: " );
            DBCONTENTVECTOR *p = pNode->value.pdbcntntvcValue;
            if ( 0 == p )
                printf( "NULL" );
            else
            {
                printf( "method %d, weight %d ",
                         p->dwRankingMethod,
                         p->lWeight );
            }
            break;
        }
        case DBVALUEKIND_GROUPINFO :
        {
            printf( "DBVALUEKIND_GROUPINFO " );
            break;
        }
        case DBVALUEKIND_PARAMETER :
        {
            printf( "DBVALUEKIND_PARAMETER " );
            break;
        }
        case DBVALUEKIND_PROPERTY :
        {
            printf( "DBVALUEKIND_PROPERTY " );
            break;
        }
        case DBVALUEKIND_SETFUNC :
        {
            printf( "DBVALUEKIND_SETFUNC " );
            break;
        }
        case DBVALUEKIND_SORTINFO :
        {
            printf( "DBVALUEKIND_SORTINFO: " );
            if ( 0 == pNode->value.pdbsrtinfValue )
                printf( "NULL" );
            else
                printf( "fDesc %d, lcid %#x",
                        pNode->value.pdbsrtinfValue->fDesc,
                        pNode->value.pdbsrtinfValue->lcid );
            break;
        }
        case DBVALUEKIND_TEXT :
        {
            printf( "DBVALUEKIND_TEXT " );
            break;
        }
        case DBVALUEKIND_COMMAND :
        {
            printf( "DBVALUEKIND_COMMAND " );
            break;
        }
        case DBVALUEKIND_MONIKER :
        {
            printf( "DBVALUEKIND_MONIKER " );
            break;
        }
        case DBVALUEKIND_ROWSET :
        {
            printf( "DBVALUEKIND_ROWSET " );
            break;
        }
        case DBVALUEKIND_LIKE :
        {
            printf( "DBVALUEKIND_LIKE " );
            break;
        }
        case DBVALUEKIND_CONTENTPROXIMITY :
        {
            printf( "DBVALUEKIND_CONTENTPROXIMITY " );
            break;
        }
        case DBVALUEKIND_CONTENTSCOPE :
        {
            printf( "DBVALUEKIND_CONTENTSCOPE " );
            if ( 0 == pNode->value.pdbcntntscpValue )
                printf( "NULL" );
            else
                printf( "dwFlags %#x, pwszElementValue %ws",
                        pNode->value.pdbcntntscpValue->dwFlags,
                        pNode->value.pdbcntntscpValue->pwszElementValue );
            break;
        }
        case DBVALUEKIND_CONTENTTABLE :
        {
            printf( "DBVALUEKIND_CONTENTTABLE " );
            if ( 0 == pNode->value.pdbcntnttblValue )
                printf( "NULL" );
            else
                printf( "machine %ws, catalog %ws",
                        pNode->value.pdbcntnttblValue->pwszMachine,
                        pNode->value.pdbcntnttblValue->pwszCatalog );
            break;
        }
        case DBVALUEKIND_IDISPATCH :
        {
            printf( "DBVALUEKIND_IDISPATCH " );
            break;
        }
        case DBVALUEKIND_IUNKNOWN :
        {
            printf( "DBVALUEKIND_IUNKNOWN " );
            break;
        }
        case DBVALUEKIND_EMPTY :
        {
            printf( "DBVALUEKIND_EMPTY " );
            break;
        }
        case DBVALUEKIND_NULL :
        {
            printf( "DBVALUEKIND_NULL " );
            break;
        }
        case DBVALUEKIND_I2 :
        {
            printf( "DBVALUEKIND_I2: %d", pNode->value.sValue );
            break;
        }
        case DBVALUEKIND_I4 :
        {
            printf( "DBVALUEKIND_I4: %d", pNode->value.lValue );
            break;
        }
        case DBVALUEKIND_R4 :
        {
            printf( "DBVALUEKIND_R4: %f", pNode->value.flValue );
            break;
        }
        case DBVALUEKIND_R8 :
        {
            printf( "DBVALUEKIND_R8: %lf", pNode->value.dblValue );
            break;
        }
        case DBVALUEKIND_CY :
        {
            printf( "DBVALUEKIND_CY " );
            break;
        }
        case DBVALUEKIND_DATE :
        {
            printf( "DBVALUEKIND_DATE " );
            break;
        }
        case DBVALUEKIND_BSTR :
        {
            printf( "DBVALUEKIND_BSTR: '%ws'", pNode->value.pbstrValue );
            break;
        }
        case DBVALUEKIND_ERROR :
        {
            printf( "DBVALUEKIND_ERROR: %d", pNode->value.scodeValue );
            break;
        }
        case DBVALUEKIND_BOOL :
        {
            printf( "DBVALUEKIND_BOOL: %d", pNode->value.fValue );
            break;
        }
        case DBVALUEKIND_VARIANT :
        {
            printf( "DBVALUEKIND_VARIANT " );

            // Indexing Service uses PROPVARIANTs (extended VARIANTs)

            DisplayVariant( (PROPVARIANT *) pNode->value.pvarValue );
            break;
        }
        case DBVALUEKIND_I1 :
        {
            printf( "DBVALUEKIND_I1: %d", pNode->value.schValue );
            break;
        }
        case DBVALUEKIND_UI1 :
        {
            printf( "DBVALUEKIND_UI1: %u", pNode->value.uchValue );
            break;
        }
        case DBVALUEKIND_UI2 :
        {
            printf( "DBVALUEKIND_UI2: %u", pNode->value.usValue );
            break;
        }
        case DBVALUEKIND_UI4 :
        {
            printf( "DBVALUEKIND_UI4: %u", pNode->value.ulValue );
            break;
        }
        case DBVALUEKIND_I8 :
        {
            printf( "DBVALUEKIND_I8: %I64d", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_UI8 :
        {
            printf( "DBVALUEKIND_UI8: %I64u", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_GUID :
        {
            printf( "DBVALUEKIND_GUID " );
            break;
        }
        case DBVALUEKIND_BYTES :
        {
            printf( "DBVALUEKIND_BYTES " );
            break;
        }
        case DBVALUEKIND_STR :
        {
            printf( "DBVALUEKIND_STR: '%s'", pNode->value.pzValue );
            break;
        }
        case DBVALUEKIND_WSTR :
        {
            printf( "DBVALUEKIND_WSTR: '%ws'", pNode->value.pwszValue );
            break;
        }
        case DBVALUEKIND_NUMERIC :
        {
            printf( "DBVALUEKIND_NUMERIC " );
            break;
        }
        case DBVALUEKIND_DBDATE :
        {
            printf( "DBVALUEKIND_DBDATE " );
            break;
        }
        case DBVALUEKIND_DBTIME :
        {
            printf( "DBVALUEKIND_DBTIME " );
            break;
        }
        case DBVALUEKIND_DBTIMESTAMP :
        {
            printf( "DBVALUEKIND_DBTIMESTAMP " );
            break;
        }
        default :
        {
            printf( "unknown DBVALUEKIND " );
            break;
        }
    }

    printf( "\n" );

    if ( pNode->pctFirstChild )
    {
        PrintSpace( iLevel );
        printf( "first child:\n" );
        DisplayCommandTree( pNode->pctFirstChild, iLevel + 1 );
    }

    if ( pNode->pctNextSibling )
    {
        PrintSpace( iLevel );
        printf( "next sibling:\n" );
        DisplayCommandTree( pNode->pctNextSibling, iLevel + 1 );
    }

    if ( 0 == iLevel )
        printf( "\n" );
} //DisplayCommandTree

HRESULT DoQuery | ( | WCHAR const * | pwcQueryScope,
 |  | WCHAR const * | pwcQueryCatalog,
 |  | WCHAR const * | pwcQueryMachine,
 |  | WCHAR const * | pwcQueryRestriction,
 |  | BOOL | fDisplayTree
 | ) |  |

Definition at line 920 of file AdvQuery.Cxx.

{
    // Create an ICommand object.  The default scope for the query is the
    // entire catalog.

    XInterface<ICommand> xICommand;
    HRESULT hr = CreateICommand( xICommand.GetPPointer() );
    if ( FAILED( hr ) )
        return hr;

    // Set the scope, catalog, and machine in the ICommand

    hr = SetScopeCatalogAndMachine( xICommand.GetPointer(),
                                    pwcQueryScope,
                                    pwcQueryCatalog,
                                    pwcQueryMachine );
    if ( FAILED( hr ) )
        return hr;

    // Set required properties on the ICommand

    hr = SetCommandProperties( xICommand.GetPointer() );
    if ( FAILED( hr ) )
        return hr;

    // Create an OLE DB query tree from a text restriction

    DBCOMMANDTREE * pTree;
    hr = CreateQueryTree( pwcQueryRestriction, // the input query
                          &pTree );            // the output tree
    if ( FAILED( hr ) )
        return hr;

    // If directed, display the command tree

    if ( fDisplayTree )
        DisplayCommandTree( pTree );

    // Set the tree in the ICommandTree

    XInterface<ICommandTree> xICommandTree;
    hr = xICommand->QueryInterface( IID_ICommandTree,
                                    xICommandTree.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    hr = xICommandTree->SetCommandTree( &pTree,
                                        DBCOMMANDREUSE_NONE,
                                        FALSE );
    if ( FAILED( hr ) )
        return hr;

    // Execute the query.  The query is asynchronously executed.

    XInterface<IRowset> xIRowset;
    hr = xICommand->Execute( 0,            // no aggregating IUnknown
                             IID_IRowset,  // IID for interface to return
                             0,            // no DBPARAMs
                             0,            // no rows affected
                             xIRowset.GetIUPointer() ); // result
    if ( FAILED( hr ) )
        return hr;

    // Wait for the query to complete, since DBPROP_IDBAsynchStatus was set
    // as a command property.  If DBPROP_IDBAsynchStatus isn't set, Execute()
    // is synchronous and there is no need to wait for completion here.

    hr = WaitForQueryToComplete( xIRowset.GetPointer() );
    if ( FAILED( hr ) )
        return hr;

    // Create an accessor, so data can be retrieved from the rowset

    XInterface<IAccessor> xIAccessor;
    hr = xIRowset->QueryInterface( IID_IAccessor,
                                   xIAccessor.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    // Column iOrdinals are parallel with those passed to CiTextToFullTree,
    // so MapColumnIDs isn't necessary.  These binding values for dwPart,
    // dwMemOwner, and wType are the most optimal bindings for Indexing
    // Service.

    const ULONG cColumns = 3; // 3 for Rank, Size, and Path
    DBBINDING aColumns[ cColumns ];
    memset( aColumns, 0, sizeof aColumns );

    aColumns[0].iOrdinal   = 1; // first column specified above (rank)
    aColumns[0].obValue    = 0; // offset where value is written in GetData
    aColumns[0].dwPart     = DBPART_VALUE;  // retrieve value, not status
    aColumns[0].dwMemOwner = DBMEMOWNER_PROVIDEROWNED; // Provider owned
    aColumns[0].wType      = DBTYPE_VARIANT | DBTYPE_BYREF; // VARIANT *

    aColumns[1] = aColumns[0];
    aColumns[1].iOrdinal   = 2; // second column specified above (size)
    aColumns[1].obValue    = sizeof (PROPVARIANT *); // offset for value

    aColumns[2] = aColumns[0];
    aColumns[2].iOrdinal   = 3; // third column specified above (path)
    aColumns[2].obValue    = 2 * sizeof (PROPVARIANT *); // offset for value

    HACCESSOR hAccessor;
    hr = xIAccessor->CreateAccessor( DBACCESSOR_ROWDATA, // rowdata accessor
                                     cColumns,           // # of columns
                                     aColumns,           // columns
                                     0,                  // ignored
                                     &hAccessor,         // result
                                     0 );                // no status
    if ( FAILED( hr ) )
        return hr;

    // Display the results of the query.  Print file size and file path.

    printf( " Rank       Size  Path\n" );

    DBCOUNTITEM cRowsSoFar = 0;

    do
    {
        DBCOUNTITEM cRowsReturned = 0;
        const ULONG cRowsAtATime = 10;
        HROW aHRow[cRowsAtATime];
        HROW * pgrHRows = aHRow;
        hr = xIRowset->GetNextRows( 0,              // no chapter
                                    0,              // no rows to skip
                                    cRowsAtATime,   // # rows to get
                                    &cRowsReturned, // # rows returned
                                    &pgrHRows);     // resulting hrows

        if ( FAILED( hr ) )
            break;

        for ( DBCOUNTITEM iRow = 0; iRow < cRowsReturned; iRow++ )
        {
            PROPVARIANT * aData[cColumns];
            hr = xIRowset->GetData( aHRow[iRow],  // hrow being accessed
                                    hAccessor,    // accessor to use
                                    &aData );     // resulting data
            if ( FAILED( hr ) )
                break;

            if ( VT_I4 ==     aData[0]->vt &&
                 VT_I8 ==     aData[1]->vt &&
                 VT_LPWSTR == aData[2]->vt )
                printf( "%5d %10I64d  %ws\n",
                        aData[0]->lVal,
                        aData[1]->hVal,
                        aData[2]->pwszVal );
            else
                printf( "could not retrieve a file's values\n" );
        }

        if ( 0 != cRowsReturned )
            xIRowset->ReleaseRows( cRowsReturned, // # of rows to release
                                   aHRow,         // rows to release
                                   0,             // no options
                                   0,             // no refcounts
                                   0 );           // no status

        if ( DB_S_ENDOFROWSET == hr || DB_S_ROWLIMITEXCEEDED == hr )
        {
            hr = S_OK; // succeeded, return S_OK from DoQuery
            break;
        }

        if ( FAILED( hr ) )
            break;

        cRowsSoFar += cRowsReturned;
    } while ( TRUE );

    printf( "%d files matched the query '%ws'\n",
            cRowsSoFar,
            pwcQueryRestriction );

    xIAccessor->ReleaseAccessor( hAccessor, 0 );

    return hr;
} //DoQuery

DBCOMMANDTREE* NewTreeNode | ( | DBCOMMANDOP | op,
 |  | WORD | wKind
 | ) |  |

Definition at line 388 of file AdvQuery.Cxx.

{
    DBCOMMANDTREE * pTree = (DBCOMMANDTREE *)
                             CoTaskMemAlloc( sizeof DBCOMMANDTREE );
    memset( pTree, 0, sizeof DBCOMMANDTREE );
    pTree->op = op;
    pTree->wKind = wKind;
    return pTree;
} //NewTreeNode

HRESULT SetCommandProperties ( ICommand * pICommand )

Definition at line 155 of file AdvQuery.Cxx.

{
    static const DBID dbcolNull = { { 0,0,0, { 0,0,0,0,0,0,0,0 } },
                                    DBKIND_GUID_PROPID, 0 };
    static const GUID guidQueryExt = DBPROPSET_QUERYEXT;
    static const GUID guidRowsetProps = DBPROPSET_ROWSET;

    DBPROP aProp[3];

    aProp[0].dwPropertyID = DBPROP_USEEXTENDEDDBTYPES;
    aProp[0].dwOptions = DBPROPOPTIONS_OPTIONAL;
    aProp[0].dwStatus = 0;
    aProp[0].colid = dbcolNull;
    aProp[0].vValue.vt = VT_BOOL;
    aProp[0].vValue.boolVal = VARIANT_TRUE;

    aProp[1] = aProp[0];
    aProp[1].dwPropertyID = DBPROP_USECONTENTINDEX;

    aProp[2] = aProp[0];
    aProp[2].dwOptions = DBPROPOPTIONS_REQUIRED;
    aProp[2].dwPropertyID = DBPROP_IDBAsynchStatus;

    DBPROPSET aPropSet[2];

    aPropSet[0].rgProperties = &aProp[0];
    aPropSet[0].cProperties = 2;
    aPropSet[0].guidPropertySet = guidQueryExt;

    aPropSet[1].rgProperties = &aProp[2];
    aPropSet[1].cProperties = 1;
    aPropSet[1].guidPropertySet = guidRowsetProps;

    XInterface<ICommandProperties> xICommandProperties;
    HRESULT hr = pICommand->QueryInterface( IID_ICommandProperties,
                                            xICommandProperties.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    return xICommandProperties->SetProperties( 2,          // 2 property sets
                                               aPropSet ); // the properties
} //SetCommandProperties

HRESULT SetScopeCatalogAndMachine | ( | ICommand * | pICommand,
 |  | WCHAR const * | pwcQueryScope,
 |  | WCHAR const * | pwcQueryCatalog,
 |  | WCHAR const * | pwcQueryMachine
 | ) |  |

Definition at line 214 of file AdvQuery.Cxx.

{
    // Get an ICommandProperties so we can set the properties

    XInterface<ICommandProperties> xICommandProperties;
    HRESULT hr = pICommand->QueryInterface( IID_ICommandProperties,
                                            xICommandProperties.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    const GUID guidCI = DBPROPSET_CIFRMWRKCORE_EXT;
    const GUID guidFSCI = DBPROPSET_FSCIFRMWRK_EXT;

    SAFEARRAY * pMachines = 0;
    SAFEARRAY * pCatalogs = 0;
    SAFEARRAY * pScopes = 0;
    SAFEARRAY * pFlags = 0;

    // note: SysAllocString, SafeArrayCreate, and SafeArrayPutElement can
    // fail, but this isn't checked here for brevity.

    SAFEARRAYBOUND rgBound[1];
    rgBound[0].lLbound = 0;
    rgBound[0].cElements = 1;
    pMachines = SafeArrayCreate( VT_BSTR, 1, rgBound );
    if ( 0 == pMachines )
    {
        hr = E_OUTOFMEMORY;
        goto cleanup;
    }

   {
    long i = 0;
    hr = SafeArrayPutElement( pMachines, &i, SysAllocString( pwcQueryMachine ) );
    if ( FAILED( hr ) )
        goto cleanup;

    pCatalogs = SafeArrayCreate( VT_BSTR, 1, rgBound );
    if ( 0 == pCatalogs )
    {
        hr = E_OUTOFMEMORY;
        goto cleanup;
    }

    hr = SafeArrayPutElement( pCatalogs, &i, SysAllocString( pwcQueryCatalog ) );
    if ( FAILED( hr ) )
        goto cleanup;

    pScopes = SafeArrayCreate( VT_BSTR, 1, rgBound );
    if ( 0 == pScopes )
    {
        hr = E_OUTOFMEMORY;
        goto cleanup;
    }

    hr = SafeArrayPutElement( pScopes, &i, SysAllocString( pwcQueryScope ) );
    if ( FAILED( hr ) )
        goto cleanup;

    LONG lFlags = QUERY_DEEP;
    pFlags = SafeArrayCreate( VT_I4, 1, rgBound );
    if ( 0 == pFlags )
    {
        hr = E_OUTOFMEMORY;
        goto cleanup;
    }

    hr = SafeArrayPutElement( pFlags, &i, &lFlags );
    if ( FAILED( hr ) )
        goto cleanup;

    DBPROP aScopeProperties[2];
    memset( aScopeProperties, 0, sizeof aScopeProperties );
    aScopeProperties[0].dwPropertyID = DBPROP_CI_INCLUDE_SCOPES;
    aScopeProperties[0].vValue.vt = VT_BSTR | VT_ARRAY;
    aScopeProperties[0].vValue.parray = pScopes;
    aScopeProperties[0].colid.eKind = DBKIND_GUID_PROPID;

    aScopeProperties[1].dwPropertyID = DBPROP_CI_SCOPE_FLAGS;
    aScopeProperties[1].vValue.vt = VT_I4 | VT_ARRAY;
    aScopeProperties[1].vValue.parray = pFlags;
    aScopeProperties[1].colid.eKind = DBKIND_GUID_PROPID;

    DBPROP aCatalogProperties[1];
    memset( aCatalogProperties, 0, sizeof aCatalogProperties );
    aCatalogProperties[0].dwPropertyID = DBPROP_CI_CATALOG_NAME;
    aCatalogProperties[0].vValue.vt = VT_BSTR | VT_ARRAY;
    aCatalogProperties[0].vValue.parray = pCatalogs;
    aCatalogProperties[0].colid.eKind = DBKIND_GUID_PROPID;

    DBPROP aMachineProperties[1];
    memset( aMachineProperties, 0, sizeof aMachineProperties );
    aMachineProperties[0].dwPropertyID = DBPROP_MACHINE;
    aMachineProperties[0].vValue.vt = VT_BSTR | VT_ARRAY;
    aMachineProperties[0].vValue.parray = pMachines;
    aMachineProperties[0].colid.eKind = DBKIND_GUID_PROPID;

    DBPROPSET aAllPropsets[3];
    aAllPropsets[0].rgProperties = aScopeProperties;
    aAllPropsets[0].cProperties = 2;
    aAllPropsets[0].guidPropertySet = guidFSCI;

    aAllPropsets[1].rgProperties = aCatalogProperties;
    aAllPropsets[1].cProperties = 1;
    aAllPropsets[1].guidPropertySet = guidFSCI;

    aAllPropsets[2].rgProperties = aMachineProperties;
    aAllPropsets[2].cProperties = 1;
    aAllPropsets[2].guidPropertySet = guidCI;

    const ULONG cPropertySets = sizeof aAllPropsets / sizeof aAllPropsets[0];

    hr = xICommandProperties->SetProperties( cPropertySets,  // # of propsets
                                             aAllPropsets ); // the propsets
   } // scope resolution to get rid of errors on stricter compilers

cleanup:

    if ( 0 != pScopes )
        SafeArrayDestroy( pScopes );

    if ( 0 != pFlags )
        SafeArrayDestroy( pFlags );

    if ( 0 != pCatalogs )
        SafeArrayDestroy( pCatalogs );

    if ( 0 != pMachines )
        SafeArrayDestroy( pMachines );

    return hr;
} //SetScopeCatalogAndMachine

void Usage ( void )

Definition at line 1114 of file AdvQuery.Cxx.

{
    printf( "usage: ADVQUERY query [/c:catalog] [/m:machine] [/s:scope] [/d]\n\n" );
    printf( "    query        word or phrase used for the search\n" );
    printf( "    /c:catalog   name of the catalog, default is SYSTEM\n" );
    printf( "    /m:machine   name of the machine, default is local machine\n" );
    printf( "    /s:scope     root path, default is entire catalog (\\) \n" );
    printf( "    /d           display the DBCOMMANDTREE, default is off\n" );
    exit( -1 );
} //Usage

HRESULT WaitForQueryToComplete ( IRowset * pRowset )

Definition at line 819 of file AdvQuery.Cxx.

{
    HRESULT hr;

    //
    // Both methods (notifications and polling) work.  It depends on the
    // application which is the best choice.
    //

#if 1

    // Register for notifications

    XInterface<IConnectionPointContainer> xCPC;
    hr = pRowset->QueryInterface( IID_IConnectionPointContainer,
                                  xCPC.GetQIPointer() );
    if (FAILED(hr))
        return hr;

    XInterface<IConnectionPoint> xCP;
    hr = xCPC->FindConnectionPoint( IID_IDBAsynchNotify,
                                    xCP.GetPPointer() );
    if (FAILED(hr) && CONNECT_E_NOCONNECTION != hr )
        return hr;

    CAsynchNotify Notify;

    if ( !Notify.IsValid() )
        return HRESULT_FROM_WIN32( GetLastError() );

    DWORD dwAdviseID;
    hr = xCP->Advise( (IUnknown *) &Notify, &dwAdviseID );
    if (FAILED(hr))
        return hr;

    //
    // In a real app, we'd be off doing other work rather than waiting
    // for the query to complete, but this will do.
    // MsgWaitForSingleObject is a good choice for a GUI app.  You could
    // also post a user-defined windows message when a notification is
    // received.
    //

    Notify.Wait();

    hr = xCP->Unadvise( dwAdviseID );
    if ( S_OK != hr )
        return hr;

    Notify.Release();

#else

    // Poll for query completion

    XInterface<IDBAsynchStatus> xIDBAsynch;
    hr = pRowset->QueryInterface( IID_IDBAsynchStatus,
                                  xIDBAsynch.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    do
    {
        DBCOUNTITEM Numerator, Denominator;
        DBASYNCHPHASE Phase;
        hr = xIDBAsynch->GetStatus( DB_NULL_HCHAPTER,
                                    DBASYNCHOP_OPEN,
                                    &Numerator,
                                    &Denominator,
                                    &Phase,
                                    0 );
        if ( FAILED( hr ) )
            return hr;

        if ( DBASYNCHPHASE_COMPLETE == Phase )
            break;

        Sleep( 50 );  // Give the query a chance to run
    } while ( TRUE );

#endif

    return hr;
} //WaitForQueryToComplete

int __cdecl wmain | ( | int | argc,
 |  | WCHAR * | argv[]
 | ) |  |

Definition at line 1137 of file AdvQuery.Cxx.

{
    WCHAR const * pwcScope       = L"\\";     // default scope: entire catalog
    WCHAR const * pwcCatalog     = L"system"; // default: system catalog
    WCHAR const * pwcMachine     = L".";      // default: local machine
    WCHAR const * pwcRestriction = 0;         // no default restriction
    BOOL fDisplayTree            = FALSE;     // don't display the tree

    // Parse command line parameters

    for ( int i = 1; i < argc; i++ )
    {
        if ( L'-' == argv[i][0] || L'/' == argv[i][0] )
        {
            WCHAR wc = towupper( argv[i][1] );

            if ( ':' != argv[i][2] && 'D' != wc )
                Usage();

            if ( 'C' == wc )
                pwcCatalog = argv[i] + 3;
            else if ( 'M' == wc )
                pwcMachine = argv[i] + 3;
            else if ( 'S' == wc )
                pwcScope = argv[i] + 3;
            else if ( 'D' == wc )
                fDisplayTree = TRUE;
            else
                Usage();
        }
        else if ( 0 != pwcRestriction )
            Usage();
        else
            pwcRestriction = argv[i];
    }

    // A query restriction is necessary.  Fail if none is given.

    if ( 0 == pwcRestriction )
        Usage();

    // Initialize COM

    HRESULT hr = CoInitialize( 0 );

    if ( SUCCEEDED( hr ) )
    {
        // Run the query

        hr = DoQuery( pwcScope,
                      pwcCatalog,
                      pwcMachine,
                      pwcRestriction,
                      fDisplayTree );

        CoUninitialize();
    }

    if ( FAILED( hr ) )
    {
        printf( "the query '%ws' failed with error %#x\n",
                pwcRestriction, hr );
        return -1;
    }

    return 0;
} //wmain

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/AdvQuery/DispTree.Cxx File Reference

  • WinBase
  • Indexing
  • AdvQuery
Defines | Functions

DispTree.Cxx File Reference

#include <stdio.h>
#include <windows.h>
#include <oledberr.h>
#include <oledb.h>
#include <cmdtree.h>

Go to the source code of this file.

Defines

#define | UNICODE

Functions

void | DisplayCommandTree (DBCOMMANDTREE *pNode, ULONG iLevel)
void | DisplayVariant (PROPVARIANT *pVar)
void | PrintSpace (ULONG cPlaces)
template<class T >
void | PrintVectorItems (T *pVal, ULONG cVals, char *pcFmt)

Define Documentation

#define UNICODE

Definition at line 18 of file DispTree.Cxx.

Function Documentation

void DisplayCommandTree | ( | DBCOMMANDTREE * | pNode,
 |  | ULONG | iLevel
 | ) |  |

Definition at line 215 of file DispTree.Cxx.

{
    PrintSpace( iLevel );
    printf( "op: (%d) ", pNode->op );
    switch ( pNode->op )
    {
        case DBOP_scalar_constant : printf( "DBOP_scalar_constant" ); break;
        case DBOP_DEFAULT : printf( "DBOP_DEFAULT" ); break;
        case DBOP_NULL : printf( "DBOP_NULL" ); break;
        case DBOP_bookmark_name : printf( "DBOP_bookmark_name" ); break;
        case DBOP_catalog_name : printf( "DBOP_catalog_name" ); break;
        case DBOP_column_name : printf( "DBOP_column_name" ); break;
        case DBOP_schema_name : printf( "DBOP_schema_name" ); break;
        case DBOP_outall_name : printf( "DBOP_outall_name" ); break;
        case DBOP_qualifier_name : printf( "DBOP_qualifier_name" ); break;
        case DBOP_qualified_column_name : printf( "DBOP_qualified_column_name" ); break;
        case DBOP_table_name : printf( "DBOP_table_name" ); break;
        case DBOP_nested_table_name : printf( "DBOP_nested_table_name" ); break;
        case DBOP_nested_column_name : printf( "DBOP_nested_column_name" ); break;
        case DBOP_row : printf( "DBOP_row" ); break;
        case DBOP_table : printf( "DBOP_table" ); break;
        case DBOP_sort : printf( "DBOP_sort" ); break;
        case DBOP_distinct : printf( "DBOP_distinct" ); break;
        case DBOP_distinct_order_preserving : printf( "DBOP_distinct_order_preserving" ); break;
        case DBOP_alias : printf( "DBOP_alias" ); break;
        case DBOP_cross_join : printf( "DBOP_cross_join" ); break;
        case DBOP_union_join : printf( "DBOP_union_join" ); break;
        case DBOP_inner_join : printf( "DBOP_inner_join" ); break;
        case DBOP_left_semi_join : printf( "DBOP_left_semi_join" ); break;
        case DBOP_right_semi_join : printf( "DBOP_right_semi_join" ); break;
        case DBOP_left_anti_semi_join : printf( "DBOP_left_anti_semi_join" ); break;
        case DBOP_right_anti_semi_join : printf( "DBOP_right_anti_semi_join" ); break;
        case DBOP_left_outer_join : printf( "DBOP_left_outer_join" ); break;
        case DBOP_right_outer_join : printf( "DBOP_right_outer_join" ); break;
        case DBOP_full_outer_join : printf( "DBOP_full_outer_join" ); break;
        case DBOP_natural_join : printf( "DBOP_natural_join" ); break;
        case DBOP_natural_left_outer_join : printf( "DBOP_natural_left_outer_join" ); break;
        case DBOP_natural_right_outer_join : printf( "DBOP_natural_right_outer_join" ); break;
        case DBOP_natural_full_outer_join : printf( "DBOP_natural_full_outer_join" ); break;
        case DBOP_set_intersection : printf( "DBOP_set_intersection" ); break;
        case DBOP_set_union : printf( "DBOP_set_union" ); break;
        case DBOP_set_left_difference : printf( "DBOP_set_left_difference" ); break;
        case DBOP_set_right_difference : printf( "DBOP_set_right_difference" ); break;
        case DBOP_set_anti_difference : printf( "DBOP_set_anti_difference" ); break;
        case DBOP_bag_intersection : printf( "DBOP_bag_intersection" ); break;
        case DBOP_bag_union : printf( "DBOP_bag_union" ); break;
        case DBOP_bag_left_difference : printf( "DBOP_bag_left_difference" ); break;
        case DBOP_bag_right_difference : printf( "DBOP_bag_right_difference" ); break;
        case DBOP_bag_anti_difference : printf( "DBOP_bag_anti_difference" ); break;
        case DBOP_division : printf( "DBOP_division" ); break;
        case DBOP_relative_sampling : printf( "DBOP_relative_sampling" ); break;
        case DBOP_absolute_sampling : printf( "DBOP_absolute_sampling" ); break;
        case DBOP_transitive_closure : printf( "DBOP_transitive_closure" ); break;
        case DBOP_recursive_union : printf( "DBOP_recursive_union" ); break;
        case DBOP_aggregate : printf( "DBOP_aggregate" ); break;
        case DBOP_remote_table : printf( "DBOP_remote_table" ); break;
        case DBOP_select : printf( "DBOP_select" ); break;
        case DBOP_order_preserving_select : printf( "DBOP_order_preserving_select" ); break;
        case DBOP_project : printf( "DBOP_project" ); break;
        case DBOP_project_order_preserving : printf( "DBOP_project_order_preserving" ); break;
        case DBOP_top : printf( "DBOP_top" ); break;
        case DBOP_top_percent : printf( "DBOP_top_percent" ); break;
        case DBOP_top_plus_ties : printf( "DBOP_top_plus_ties" ); break;
        case DBOP_top_percent_plus_ties : printf( "DBOP_top_percent_plus_ties" ); break;
        case DBOP_rank : printf( "DBOP_rank" ); break;
        case DBOP_rank_ties_equally : printf( "DBOP_rank_ties_equally" ); break;
        case DBOP_rank_ties_equally_and_skip : printf( "DBOP_rank_ties_equally_and_skip" ); break;
        case DBOP_navigate : printf( "DBOP_navigate" ); break;
        case DBOP_nesting : printf( "DBOP_nesting" ); break;
        case DBOP_unnesting : printf( "DBOP_unnesting" ); break;
        case DBOP_nested_apply : printf( "DBOP_nested_apply" ); break;
        case DBOP_cross_tab : printf( "DBOP_cross_tab" ); break;
        case DBOP_is_NULL : printf( "DBOP_is_NULL" ); break;
        case DBOP_is_NOT_NULL : printf( "DBOP_is_NOT_NULL" ); break;
        case DBOP_equal : printf( "DBOP_equal" ); break;
        case DBOP_not_equal : printf( "DBOP_not_equal" ); break;
        case DBOP_less : printf( "DBOP_less" ); break;
        case DBOP_less_equal : printf( "DBOP_less_equal" ); break;
        case DBOP_greater : printf( "DBOP_greater" ); break;
        case DBOP_greater_equal : printf( "DBOP_greater_equal" ); break;
        case DBOP_equal_all : printf( "DBOP_equal_all" ); break;
        case DBOP_not_equal_all : printf( "DBOP_not_equal_all" ); break;
        case DBOP_less_all : printf( "DBOP_less_all" ); break;
        case DBOP_less_equal_all : printf( "DBOP_less_equal_all" ); break;
        case DBOP_greater_all : printf( "DBOP_greater_all" ); break;
        case DBOP_greater_equal_all : printf( "DBOP_greater_equal_all" ); break;
        case DBOP_equal_any : printf( "DBOP_equal_any" ); break;
        case DBOP_not_equal_any : printf( "DBOP_not_equal_any" ); break;
        case DBOP_less_any : printf( "DBOP_less_any" ); break;
        case DBOP_less_equal_any : printf( "DBOP_less_equal_any" ); break;
        case DBOP_greater_any : printf( "DBOP_greater_any" ); break;
        case DBOP_greater_equal_any : printf( "DBOP_greater_equal_any" ); break;
        case DBOP_anybits : printf( "DBOP_anybits" ); break;
        case DBOP_allbits : printf( "DBOP_allbits" ); break;
        case DBOP_anybits_any : printf( "DBOP_anybits_any" ); break;
        case DBOP_allbits_any : printf( "DBOP_allbits_any" ); break;
        case DBOP_anybits_all : printf( "DBOP_anybits_all" ); break;
        case DBOP_allbits_all : printf( "DBOP_allbits_all" ); break;
        case DBOP_between : printf( "DBOP_between" ); break;
        case DBOP_between_unordered : printf( "DBOP_between_unordered" ); break;
        case DBOP_match : printf( "DBOP_match" ); break;
        case DBOP_match_unique : printf( "DBOP_match_unique" ); break;
        case DBOP_match_partial : printf( "DBOP_match_partial" ); break;
        case DBOP_match_partial_unique : printf( "DBOP_match_partial_unique" ); break;
        case DBOP_match_full : printf( "DBOP_match_full" ); break;
        case DBOP_match_full_unique : printf( "DBOP_match_full_unique" ); break;
        case DBOP_scalar_parameter : printf( "DBOP_scalar_parameter" ); break;
        case DBOP_scalar_function : printf( "DBOP_scalar_function" ); break;
        case DBOP_plus : printf( "DBOP_plus" ); break;
        case DBOP_minus : printf( "DBOP_minus" ); break;
        case DBOP_times : printf( "DBOP_times" ); break;
        case DBOP_over : printf( "DBOP_over" ); break;
        case DBOP_div : printf( "DBOP_div" ); break;
        case DBOP_modulo : printf( "DBOP_modulo" ); break;
        case DBOP_power : printf( "DBOP_power" ); break;
        case DBOP_like : printf( "DBOP_like" ); break;
        case DBOP_sounds_like : printf( "DBOP_sounds_like" ); break;
        case DBOP_like_any : printf( "DBOP_like_any" ); break;
        case DBOP_like_all : printf( "DBOP_like_all" ); break;
        case DBOP_is_INVALID : printf( "DBOP_is_INVALID" ); break;
        case DBOP_is_TRUE : printf( "DBOP_is_TRUE" ); break;
        case DBOP_is_FALSE : printf( "DBOP_is_FALSE" ); break;
        case DBOP_and : printf( "DBOP_and" ); break;
        case DBOP_or : printf( "DBOP_or" ); break;
        case DBOP_xor : printf( "DBOP_xor" ); break;
        case DBOP_equivalent : printf( "DBOP_equivalent" ); break;
        case DBOP_not : printf( "DBOP_not" ); break;
        case DBOP_implies : printf( "DBOP_implies" ); break;
        case DBOP_overlaps : printf( "DBOP_overlaps" ); break;
        case DBOP_case_condition : printf( "DBOP_case_condition" ); break;
        case DBOP_case_value : printf( "DBOP_case_value" ); break;
        case DBOP_nullif : printf( "DBOP_nullif" ); break;
        case DBOP_cast : printf( "DBOP_cast" ); break;
        case DBOP_coalesce : printf( "DBOP_coalesce" ); break;
        case DBOP_position : printf( "DBOP_position" ); break;
        case DBOP_extract : printf( "DBOP_extract" ); break;
        case DBOP_char_length : printf( "DBOP_char_length" ); break;
        case DBOP_octet_length : printf( "DBOP_octet_length" ); break;
        case DBOP_bit_length : printf( "DBOP_bit_length" ); break;
        case DBOP_substring : printf( "DBOP_substring" ); break;
        case DBOP_upper : printf( "DBOP_upper" ); break;
        case DBOP_lower : printf( "DBOP_lower" ); break;
        case DBOP_trim : printf( "DBOP_trim" ); break;
        case DBOP_translate : printf( "DBOP_translate" ); break;
        case DBOP_convert : printf( "DBOP_convert" ); break;
        case DBOP_string_concat : printf( "DBOP_string_concat" ); break;
        case DBOP_current_date : printf( "DBOP_current_date" ); break;
        case DBOP_current_time : printf( "DBOP_current_time" ); break;
        case DBOP_current_timestamp : printf( "DBOP_current_timestamp" ); break;
        case DBOP_content_select : printf( "DBOP_content_select" ); break;
        case DBOP_content : printf( "DBOP_content" ); break;
        case DBOP_content_freetext : printf( "DBOP_content_freetext" ); break;
        case DBOP_content_proximity : printf( "DBOP_content_proximity" ); break;
        case DBOP_content_vector_or : printf( "DBOP_content_vector_or" ); break;
        case DBOP_delete : printf( "DBOP_delete" ); break;
        case DBOP_update : printf( "DBOP_update" ); break;
        case DBOP_insert : printf( "DBOP_insert" ); break;
        case DBOP_min : printf( "DBOP_min" ); break;
        case DBOP_max : printf( "DBOP_max" ); break;
        case DBOP_count : printf( "DBOP_count" ); break;
        case DBOP_sum : printf( "DBOP_sum" ); break;
        case DBOP_avg : printf( "DBOP_avg" ); break;
        case DBOP_any_sample : printf( "DBOP_any_sample" ); break;
        case DBOP_stddev : printf( "DBOP_stddev" ); break;
        case DBOP_stddev_pop : printf( "DBOP_stddev_pop" ); break;
        case DBOP_var : printf( "DBOP_var" ); break;
        case DBOP_var_pop : printf( "DBOP_var_pop" ); break;
        case DBOP_first : printf( "DBOP_first" ); break;
        case DBOP_last : printf( "DBOP_last" ); break;
        case DBOP_in : printf( "DBOP_in" ); break;
        case DBOP_exists : printf( "DBOP_exists" ); break;
        case DBOP_unique : printf( "DBOP_unique" ); break;
        case DBOP_subset : printf( "DBOP_subset" ); break;
        case DBOP_proper_subset : printf( "DBOP_proper_subset" ); break;
        case DBOP_superset : printf( "DBOP_superset" ); break;
        case DBOP_proper_superset : printf( "DBOP_proper_superset" ); break;
        case DBOP_disjoint : printf( "DBOP_disjoint" ); break;
        case DBOP_pass_through : printf( "DBOP_pass_through" ); break;
        case DBOP_defined_by_GUID : printf( "DBOP_defined_by_GUID" ); break;
        case DBOP_text_command : printf( "DBOP_text_command" ); break;
        case DBOP_SQL_select : printf( "DBOP_SQL_select" ); break;
        case DBOP_prior_command_tree : printf( "DBOP_prior_command_tree" ); break;
        case DBOP_add_columns : printf( "DBOP_add_columns" ); break;
        case DBOP_column_list_anchor : printf( "DBOP_column_list_anchor" ); break;
        case DBOP_column_list_element : printf( "DBOP_column_list_element" ); break;
        case DBOP_command_list_anchor : printf( "DBOP_command_list_anchor" ); break;
        case DBOP_command_list_element : printf( "DBOP_command_list_element" ); break;
        case DBOP_from_list_anchor : printf( "DBOP_from_list_anchor" ); break;
        case DBOP_from_list_element : printf( "DBOP_from_list_element" ); break;
        case DBOP_project_list_anchor : printf( "DBOP_project_list_anchor" ); break;
        case DBOP_project_list_element : printf( "DBOP_project_list_element" ); break;
        case DBOP_row_list_anchor : printf( "DBOP_row_list_anchor" ); break;
        case DBOP_row_list_element : printf( "DBOP_row_list_element" ); break;
        case DBOP_scalar_list_anchor : printf( "DBOP_scalar_list_anchor" ); break;
        case DBOP_scalar_list_element : printf( "DBOP_scalar_list_element" ); break;
        case DBOP_set_list_anchor : printf( "DBOP_set_list_anchor" ); break;
        case DBOP_set_list_element : printf( "DBOP_set_list_element" ); break;
        case DBOP_sort_list_anchor : printf( "DBOP_sort_list_anchor" ); break;
        case DBOP_sort_list_element : printf( "DBOP_sort_list_element" ); break;
        case DBOP_alter_character_set : printf( "DBOP_alter_character_set" ); break;
        case DBOP_alter_collation : printf( "DBOP_alter_collation" ); break;
        case DBOP_alter_domain : printf( "DBOP_alter_domain" ); break;
        case DBOP_alter_index : printf( "DBOP_alter_index" ); break;
        case DBOP_alter_procedure : printf( "DBOP_alter_procedure" ); break;
        case DBOP_alter_schema : printf( "DBOP_alter_schema" ); break;
        case DBOP_alter_table : printf( "DBOP_alter_table" ); break;
        case DBOP_alter_trigger : printf( "DBOP_alter_trigger" ); break;
        case DBOP_alter_view : printf( "DBOP_alter_view" ); break;
        case DBOP_coldef_list_anchor : printf( "DBOP_coldef_list_anchor" ); break;
        case DBOP_coldef_list_element : printf( "DBOP_coldef_list_element" ); break;
        case DBOP_create_assertion : printf( "DBOP_create_assertion" ); break;
        case DBOP_create_character_set : printf( "DBOP_create_character_set" ); break;
        case DBOP_create_collation : printf( "DBOP_create_collation" ); break;
        case DBOP_create_domain : printf( "DBOP_create_domain" ); break;
        case DBOP_create_index : printf( "DBOP_create_index" ); break;
        case DBOP_create_procedure : printf( "DBOP_create_procedure" ); break;
        case DBOP_create_schema : printf( "DBOP_create_schema" ); break;
        case DBOP_create_synonym : printf( "DBOP_create_synonym" ); break;
        case DBOP_create_table : printf( "DBOP_create_table" ); break;
        case DBOP_create_temporary_table : printf( "DBOP_create_temporary_table" ); break;
        case DBOP_create_translation : printf( "DBOP_create_translation" ); break;
        case DBOP_create_trigger : printf( "DBOP_create_trigger" ); break;
        case DBOP_create_view : printf( "DBOP_create_view" ); break;
        case DBOP_drop_assertion : printf( "DBOP_drop_assertion" ); break;
        case DBOP_drop_character_set : printf( "DBOP_drop_character_set" ); break;
        case DBOP_drop_collation : printf( "DBOP_drop_collation" ); break;
        case DBOP_drop_domain : printf( "DBOP_drop_domain" ); break;
        case DBOP_drop_index : printf( "DBOP_drop_index" ); break;
        case DBOP_drop_procedure : printf( "DBOP_drop_procedure" ); break;
        case DBOP_drop_schema : printf( "DBOP_drop_schema" ); break;
        case DBOP_drop_synonym : printf( "DBOP_drop_synonym" ); break;
        case DBOP_drop_table : printf( "DBOP_drop_table" ); break;
        case DBOP_drop_translation : printf( "DBOP_drop_translation" ); break;
        case DBOP_drop_trigger : printf( "DBOP_drop_trigger" ); break;
        case DBOP_drop_view : printf( "DBOP_drop_view" ); break;
        case DBOP_foreign_key : printf( "DBOP_foreign_key" ); break;
        case DBOP_grant_privileges : printf( "DBOP_grant_privileges" ); break;
        case DBOP_index_list_anchor : printf( "DBOP_index_list_anchor" ); break;
        case DBOP_index_list_element : printf( "DBOP_index_list_element" ); break;
        case DBOP_primary_key : printf( "DBOP_primary_key" ); break;
        case DBOP_property_list_anchor : printf( "DBOP_property_list_anchor" ); break;
        case DBOP_property_list_element : printf( "DBOP_property_list_element" ); break;
        case DBOP_referenced_table : printf( "DBOP_referenced_table" ); break;
        case DBOP_rename_object : printf( "DBOP_rename_object" ); break;
        case DBOP_revoke_privileges : printf( "DBOP_revoke_privileges" ); break;
        case DBOP_schema_authorization : printf( "DBOP_schema_authorization" ); break;
        case DBOP_unique_key : printf( "DBOP_unique_key" ); break;
        case DBOP_scope_list_anchor : printf( "DBOP_scope_list_anchor" ); break;
        case DBOP_scope_list_element : printf( "DBOP_scope_list_element" ); break;
        case DBOP_content_table : printf( "DBOP_content_table" ); break;

        default : printf( "unknown DBOP" ); break;
    }

    printf( "\n" );

    PrintSpace( iLevel );
    printf( "wKind: (%d) ", pNode->wKind );
    switch( pNode->wKind )
    {
        case DBVALUEKIND_BYGUID :
        {
            printf( "DBVALUEKIND_BYGUID " );
            break;
        }
        case DBVALUEKIND_COLDESC :
        {
            printf( "DBVALUEKIND_COLDESC " );
            break;
        }
        case DBVALUEKIND_ID :
        {
            printf( "DBVALUEKIND_ID: " );
            if ( 0 == pNode->value.pdbidValue )
                printf( "NULL" );
            else
            {
                DBKIND kind = pNode->value.pdbidValue->eKind;

                if ( DBKIND_GUID        == kind ||
                     DBKIND_GUID_NAME   == kind ||
                     DBKIND_GUID_PROPID == kind )
                {
                    GUID &g = pNode->value.pdbidValue->uGuid.guid;
                    printf( "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-"
                            "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
                            g.Data1,g.Data2,g.Data3,g.Data4[0],
                            g.Data4[1],g.Data4[2],g.Data4[3],g.Data4[4],
                            g.Data4[5],g.Data4[6],g.Data4[7] );
                }
                if ( DBKIND_GUID_PROPID == kind ||
                     DBKIND_PROPID      == kind )
                    printf( " %d", pNode->value.pdbidValue->uName.ulPropid );
                if ( DBKIND_GUID_NAME == kind ||
                     DBKIND_NAME      == kind )
                    printf( " '%ws'", pNode->value.pdbidValue->uName.pwszName );
            }
            break;
        }
        case DBVALUEKIND_CONTENT :
        {
            printf( "DBVALUEKIND_CONTENT: " );
            if ( 0 == pNode->value.pdbcntntValue )
                printf( "NULL" );
            else
                printf( "'%ws', method %d, weight %d, lcid %#x",
                        pNode->value.pdbcntntValue->pwszPhrase,
                        pNode->value.pdbcntntValue->dwGenerateMethod,
                        pNode->value.pdbcntntValue->lWeight,
                        pNode->value.pdbcntntValue->lcid );
            break;
        }
        case DBVALUEKIND_CONTENTVECTOR :
        {
            printf( "DBVALUEKIND_CONTENTVECTOR: " );
            DBCONTENTVECTOR *p = pNode->value.pdbcntntvcValue;
            if ( 0 == p )
                printf( "NULL" );
            else
            {
                printf( "method %d, weight %d ",
                         p->dwRankingMethod,
                         p->lWeight );
            }
            break;
        }
        case DBVALUEKIND_GROUPINFO :
        {
            printf( "DBVALUEKIND_GROUPINFO " );
            break;
        }
        case DBVALUEKIND_PARAMETER :
        {
            printf( "DBVALUEKIND_PARAMETER " );
            break;
        }
        case DBVALUEKIND_PROPERTY :
        {
            printf( "DBVALUEKIND_PROPERTY " );
            break;
        }
        case DBVALUEKIND_SETFUNC :
        {
            printf( "DBVALUEKIND_SETFUNC " );
            break;
        }
        case DBVALUEKIND_SORTINFO :
        {
            printf( "DBVALUEKIND_SORTINFO: " );
            if ( 0 == pNode->value.pdbsrtinfValue )
                printf( "NULL" );
            else
                printf( "fDesc %d, lcid %#x",
                        pNode->value.pdbsrtinfValue->fDesc,
                        pNode->value.pdbsrtinfValue->lcid );
            break;
        }
        case DBVALUEKIND_TEXT :
        {
            printf( "DBVALUEKIND_TEXT " );
            break;
        }
        case DBVALUEKIND_COMMAND :
        {
            printf( "DBVALUEKIND_COMMAND " );
            break;
        }
        case DBVALUEKIND_MONIKER :
        {
            printf( "DBVALUEKIND_MONIKER " );
            break;
        }
        case DBVALUEKIND_ROWSET :
        {
            printf( "DBVALUEKIND_ROWSET " );
            break;
        }
        case DBVALUEKIND_LIKE :
        {
            printf( "DBVALUEKIND_LIKE " );
            break;
        }
        case DBVALUEKIND_CONTENTPROXIMITY :
        {
            printf( "DBVALUEKIND_CONTENTPROXIMITY " );
            break;
        }
        case DBVALUEKIND_CONTENTSCOPE :
        {
            printf( "DBVALUEKIND_CONTENTSCOPE " );
            if ( 0 == pNode->value.pdbcntntscpValue )
                printf( "NULL" );
            else
                printf( "dwFlags %#x, pwszElementValue %ws",
                        pNode->value.pdbcntntscpValue->dwFlags,
                        pNode->value.pdbcntntscpValue->pwszElementValue );
            break;
        }
        case DBVALUEKIND_CONTENTTABLE :
        {
            printf( "DBVALUEKIND_CONTENTTABLE " );
            if ( 0 == pNode->value.pdbcntnttblValue )
                printf( "NULL" );
            else
                printf( "machine %ws, catalog %ws",
                        pNode->value.pdbcntnttblValue->pwszMachine,
                        pNode->value.pdbcntnttblValue->pwszCatalog );
            break;
        }
        case DBVALUEKIND_IDISPATCH :
        {
            printf( "DBVALUEKIND_IDISPATCH " );
            break;
        }
        case DBVALUEKIND_IUNKNOWN :
        {
            printf( "DBVALUEKIND_IUNKNOWN " );
            break;
        }
        case DBVALUEKIND_EMPTY :
        {
            printf( "DBVALUEKIND_EMPTY " );
            break;
        }
        case DBVALUEKIND_NULL :
        {
            printf( "DBVALUEKIND_NULL " );
            break;
        }
        case DBVALUEKIND_I2 :
        {
            printf( "DBVALUEKIND_I2: %d", pNode->value.sValue );
            break;
        }
        case DBVALUEKIND_I4 :
        {
            printf( "DBVALUEKIND_I4: %d", pNode->value.lValue );
            break;
        }
        case DBVALUEKIND_R4 :
        {
            printf( "DBVALUEKIND_R4: %f", pNode->value.flValue );
            break;
        }
        case DBVALUEKIND_R8 :
        {
            printf( "DBVALUEKIND_R8: %lf", pNode->value.dblValue );
            break;
        }
        case DBVALUEKIND_CY :
        {
            printf( "DBVALUEKIND_CY " );
            break;
        }
        case DBVALUEKIND_DATE :
        {
            printf( "DBVALUEKIND_DATE " );
            break;
        }
        case DBVALUEKIND_BSTR :
        {
            printf( "DBVALUEKIND_BSTR: '%ws'", pNode->value.pbstrValue );
            break;
        }
        case DBVALUEKIND_ERROR :
        {
            printf( "DBVALUEKIND_ERROR: %d", pNode->value.scodeValue );
            break;
        }
        case DBVALUEKIND_BOOL :
        {
            printf( "DBVALUEKIND_BOOL: %d", pNode->value.fValue );
            break;
        }
        case DBVALUEKIND_VARIANT :
        {
            printf( "DBVALUEKIND_VARIANT " );

            // Indexing Service uses PROPVARIANTs (extended VARIANTs)

            DisplayVariant( (PROPVARIANT *) pNode->value.pvarValue );
            break;
        }
        case DBVALUEKIND_I1 :
        {
            printf( "DBVALUEKIND_I1: %d", pNode->value.schValue );
            break;
        }
        case DBVALUEKIND_UI1 :
        {
            printf( "DBVALUEKIND_UI1: %u", pNode->value.uchValue );
            break;
        }
        case DBVALUEKIND_UI2 :
        {
            printf( "DBVALUEKIND_UI2: %u", pNode->value.usValue );
            break;
        }
        case DBVALUEKIND_UI4 :
        {
            printf( "DBVALUEKIND_UI4: %u", pNode->value.ulValue );
            break;
        }
        case DBVALUEKIND_I8 :
        {
            printf( "DBVALUEKIND_I8: %I64d", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_UI8 :
        {
            printf( "DBVALUEKIND_UI8: %I64u", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_GUID :
        {
            printf( "DBVALUEKIND_GUID " );
            break;
        }
        case DBVALUEKIND_BYTES :
        {
            printf( "DBVALUEKIND_BYTES " );
            break;
        }
        case DBVALUEKIND_STR :
        {
            printf( "DBVALUEKIND_STR: '%s'", pNode->value.pzValue );
            break;
        }
        case DBVALUEKIND_WSTR :
        {
            printf( "DBVALUEKIND_WSTR: '%ws'", pNode->value.pwszValue );
            break;
        }
        case DBVALUEKIND_NUMERIC :
        {
            printf( "DBVALUEKIND_NUMERIC " );
            break;
        }
        case DBVALUEKIND_DBDATE :
        {
            printf( "DBVALUEKIND_DBDATE " );
            break;
        }
        case DBVALUEKIND_DBTIME :
        {
            printf( "DBVALUEKIND_DBTIME " );
            break;
        }
        case DBVALUEKIND_DBTIMESTAMP :
        {
            printf( "DBVALUEKIND_DBTIMESTAMP " );
            break;
        }
        default :
        {
            printf( "unknown DBVALUEKIND " );
            break;
        }
    }

    printf( "\n" );

    if ( pNode->pctFirstChild )
    {
        PrintSpace( iLevel );
        printf( "first child:\n" );
        DisplayCommandTree( pNode->pctFirstChild, iLevel + 1 );
    }

    if ( pNode->pctNextSibling )
    {
        PrintSpace( iLevel );
        printf( "next sibling:\n" );
        DisplayCommandTree( pNode->pctNextSibling, iLevel + 1 );
    }

    if ( 0 == iLevel )
        printf( "\n" );
} //DisplayCommandTree

void DisplayVariant ( PROPVARIANT * pVar )

Definition at line 68 of file DispTree.Cxx.

{
    if ( 0 == pVar )
    {
        printf( "NULL" );
        return;
    }

    PROPVARIANT & v = *pVar;

    switch ( v.vt )
    {
        case VT_I4 : printf( "VT_I4 %d", v.lVal ); break;
        case VT_UI1 : printf( "VT_UI1 %d", v.bVal ); break;
        case VT_I2 : printf( "VT_I2 %d", v.iVal ); break;
        case VT_R4 : printf( "VT_R4 %f", v.fltVal ); break;
        case VT_R8 : printf( "VT_R8 %lf", v.dblVal ); break;
        case VT_BOOL : printf( "VT_BOOL %d", v.boolVal ); break;
        case VT_ERROR : printf( "VT_ERROR %#x", v.scode ); break;
        case VT_CY :
        {
            double dbl;
            HRESULT hr = VarR8FromCy( pVar->cyVal, &dbl );

            if ( SUCCEEDED( hr ) )
                printf( "VT_CY %lf", dbl );
            break;
        }
        case VT_DATE : printf( "VT_DATE " ); break;
        case VT_FILETIME : printf( "VT_FILETIME %#I64x ", v.filetime ); break;
        case VT_BSTR : printf( "VT_BSTR '%ws'", v.bstrVal ); break;
        case VT_UNKNOWN : printf( "VT_UNKNOWN " ); break;
        case VT_DISPATCH : printf( "VT_DISPATCH " ); break;
        case VT_BYREF|VT_UI1 : printf( "VT_BYREF|VT_UI1 " ); break;
        case VT_BYREF|VT_I2 : printf( "VT_BYREF|VT_I2 " ); break;
        case VT_BYREF|VT_I4 : printf( "VT_BYREF|VT_I4 " ); break;
        case VT_BYREF|VT_R4 : printf( "VT_BYREF|VT_R4 " ); break;
        case VT_BYREF|VT_R8 : printf( "VT_BYREF|VT_R8 " ); break;
        case VT_BYREF|VT_BOOL : printf( "VT_BYREF|VT_BOOL " ); break;
        case VT_BYREF|VT_ERROR : printf( "VT_BYREF|VT_ERROR " ); break;
        case VT_BYREF|VT_CY : printf( "VT_BYREF|VT_CY " ); break;
        case VT_BYREF|VT_DATE : printf( "VT_BYREF|VT_DATE " ); break;
        case VT_BYREF|VT_BSTR : printf( "VT_BYREF|VT_BSTR " ); break;
        case VT_BYREF|VT_UNKNOWN : printf( "VT_BYREF|VT_UNKNOWN " ); break;
        case VT_BYREF|VT_DISPATCH : printf( "VT_BYREF|VT_DISPATCH " ); break;
        case VT_BYREF|VT_ARRAY : printf( "VT_BYREF|VT_ARRAY " ); break;
        case VT_BYREF|VT_VARIANT : printf( "VT_BYREF|VT_VARIANT " ); break;
        case VT_I1 : printf( "VT_I1 %d", v.bVal ); break;
        case VT_UI2 : printf( "VT_UI2 %u", v.uiVal ); break;
        case VT_UI4 : printf( "VT_UI4 %u", v.ulVal ); break;
        case VT_INT : printf( "VT_INT %d", v.lVal ); break;
        case VT_UINT : printf( "VT_UINT %u", v.ulVal ); break;
        case VT_BYREF|VT_DECIMAL : printf( "VT_BYREF|VT_DECIMAL " ); break;
        case VT_BYREF|VT_I1 : printf( "VT_BYREF|VT_I1 " ); break;
        case VT_BYREF|VT_UI2 : printf( "VT_BYREF|VT_UI2 " ); break;
        case VT_BYREF|VT_UI4 : printf( "VT_BYREF|VT_UI4 " ); break;
        case VT_BYREF|VT_INT : printf( "VT_BYREF|VT_INT " ); break;
        case VT_BYREF|VT_UINT : printf( "VT_BYREF|VT_UINT " ); break;
        case VT_LPSTR : printf( "VT_LPSTR '%s'", v.pszVal ); break;
        case VT_LPWSTR : printf( "VT_LPWSTR '%ws'", v.pwszVal ); break;
        case VT_I8 : printf( "VT_I8 %I64d", v.hVal ); break;
        case VT_UI8 : printf( "VT_I8 %I64u", v.hVal ); break;
        case VT_VECTOR | VT_I1:
            printf( "VT_VECTOR | VT_I1 " );
            PrintVectorItems( v.caub.pElems, v.caub.cElems, "%d" );
            break;
        case VT_VECTOR | VT_I2:
            printf( "VT_VECTOR | VT_I2 " );
            PrintVectorItems( v.cai.pElems, v.cai.cElems, "%d" );
            break;
        case VT_VECTOR | VT_I4:
            printf( "VT_VECTOR | VT_I4 " );
            PrintVectorItems( v.cal.pElems, v.cal.cElems, "%d" );
            break;
        case VT_VECTOR | VT_I8:
            printf( "VT_VECTOR | VT_I8 " );
            PrintVectorItems( v.cah.pElems, v.cah.cElems, "%I64d" );
            break;
        case VT_VECTOR | VT_UI1:
            printf( "VT_VECTOR | VT_UI1 " );
            PrintVectorItems( v.caub.pElems, v.caub.cElems, "%u" );
            break;
        case VT_VECTOR | VT_UI2:
            printf( "VT_VECTOR | VT_UI2 " );
            PrintVectorItems( v.caui.pElems, v.caui.cElems, "%u" );
            break;
        case VT_VECTOR | VT_UI4:
            printf( "VT_VECTOR | VT_UI4 " );
            PrintVectorItems( v.caul.pElems, v.caul.cElems, "%u" );
            break;
        case VT_VECTOR | VT_UI8:
            printf( "VT_VECTOR | VT_UI8 " );
            PrintVectorItems( v.cauh.pElems, v.cauh.cElems, "%I64u" );
            break;
        case VT_VECTOR | VT_BSTR:
            printf( "VT_VECTOR | VT_BSTR " );
            PrintVectorItems( v.cabstr.pElems, v.cabstr.cElems, "%ws" );
            break;
        case VT_VECTOR | VT_LPSTR:
            printf( "VT_VECTOR | VT_LPSTR " );
            PrintVectorItems( v.calpstr.pElems, v.calpstr.cElems, "%s" );
            break;
        case VT_VECTOR | VT_LPWSTR:
            printf( "VT_VECTOR | VT_LPWSTR " );
            PrintVectorItems( v.calpwstr.pElems, v.calpwstr.cElems, "%ws" );
            break;
        case VT_VECTOR | VT_R4:
            printf( "VT_VECTOR | VT_R4 " );
            PrintVectorItems( v.caflt.pElems, v.caflt.cElems, "%f" );
            break;
        case VT_VECTOR | VT_R8:
            printf( "VT_VECTOR | VT_R8 " );
            PrintVectorItems( v.cadbl.pElems, v.cadbl.cElems, "%lf" );
            break;
        default : printf( "unknown vt %#x", v.vt );
    }
} //DisplayVariant

void PrintSpace ( ULONG cPlaces )

Definition at line 196 of file DispTree.Cxx.

{
    for( ULONG iPlace = 0; iPlace < cPlaces; iPlace++ )
        printf( "  " );
} //PrintSpace

template<class T >
void PrintVectorItems | ( | T * | pVal,
 |  | ULONG | cVals,
 |  | char * | pcFmt
 | ) |  |

Definition at line 39 of file DispTree.Cxx.

{
    printf( "{ " );

    for( ULONG iVal = 0; iVal < cVals; iVal++ )
    {
        if ( 0 != iVal )
            printf( "," );
        printf( pcFmt, *pVal++ );
    }

    printf( " }" );
} //PrintVectorItems

Generated on Wed Nov 13 2024 16:55:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/ChgState/ChgState.Cxx File Reference

  • WinBase
  • Indexing
  • ChgState
Functions

ChgState.Cxx File Reference

#include <stdio.h>
#include <windows.h>
#include <ntquery.h>

Go to the source code of this file.

Functions

void | Usage ()
int __cdecl | wmain (int argc, WCHAR *argv[])

Function Documentation

void Usage ( void )

Definition at line 42 of file ChgState.Cxx.

{
    printf( "Usage: ChgState /a:<RO|RW|Stop|GetState> /c:<Catalog Name>\n" );
    printf( "    /m:<Machine Name>\n\n" );
    printf( "    ChgState            Change the state of a catalog\n" );
    printf( "    /a:<Action>         the action to be taken, default is RO\n" );
    printf( "    The three actions are states RO (Read Only), RW (Read\\Write) and Stop (Stopped)\n" );
    printf( "    You can also specify GetState to check the state of a catalog\n" );
    printf( "    /c:<Catalog Name>   name of the catalog, default is SYSTEM\n" );
    printf( "    /m:<Machine Name>   name of the machine, default is local machine\n" );
    exit( -1 );
} //Usage

int __cdecl wmain | ( | int | argc,
 |  | WCHAR * | argv[]
 | ) |  |

Definition at line 55 of file ChgState.Cxx.

{
    WCHAR const * pwcsCatalog     = L"system"; // default: system
    WCHAR const * pwcsMachine     = L".";      // default: local machine
    WCHAR const * pwcsAction      = L"RO";     // default: ReadOnly
    DWORD dwNewState              = CICAT_READONLY;
    DWORD dwOldState;

    SCODE sc = S_OK;

    // Parse the command for arguments
    if ( argc > 1 )
    {
        for ( int i = 1; i < argc; i++ )
        {
            if ( L'/' == argv[i][0] )
            {
                WCHAR wc = (WCHAR) toupper( argv[i][1] );

                if ( ':' != argv[i][2] )
                    Usage();

                if ( 'A' == wc )
                    pwcsAction = argv[i] + 3;
                else if ( 'C' == wc )
                    pwcsCatalog = argv[i] + 3;
                else if ( 'M' == wc )
                    pwcsMachine = argv[i] + 3;
                else
                    Usage();
            }
            else
                Usage();
        }
    }
    else
    {
        Usage();
    }

    if ( !wcscmp( pwcsAction, L"RO" ) )          // ReadOnly
        dwNewState = CICAT_READONLY;
    else if ( !wcscmp( pwcsAction, L"RW" ) )     // ReadWrite
        dwNewState = CICAT_WRITABLE;
    else if ( !wcscmp( pwcsAction, L"Stop" ) )   // Stop
        dwNewState = CICAT_STOPPED;
    else if ( !wcscmp( pwcsAction, L"GetState" ) ) // Get the current state
        dwNewState = CICAT_GET_STATE;
    else
    {
        fprintf( stderr, "Action undefined!\n" );
        exit(-1);
    }

    // call the API
    sc = SetCatalogState ( pwcsCatalog,
                           pwcsMachine,
                           dwNewState,
                           &dwOldState );

    if ( FAILED( sc ) )
    {
        printf( "ChangeState for catalog %ws failed with error %#x\n", pwcsCatalog ,sc );
        return -1;
    }

    printf(" Old State is " );
    if ( CICAT_STOPPED == dwOldState )
        printf( "CICAT_STOPPED.\n" );
    else
    {
        if ( CICAT_WRITABLE & dwOldState )
            printf( "CICAT_WRITABLE.\n" );
        else if ( CICAT_READONLY & dwOldState )
            printf( "CICAT_READONLY.\n" );
        else printf( "Error obtaining oldState. The return value is %d\n", dwOldState );
    }

    return 0;
} //wmain

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/HtmlProp/FiltReg.Hxx File Reference

  • WinBase
  • Indexing
  • HtmlProp
Classes | Defines | Functions

FiltReg.Hxx File Reference

#include <olectl.h>

Go to the source code of this file.

Classes

struct | SClassEntry
struct | SFilterEntry
struct | SHandlerEntry

Defines

#define | DEFINE_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_DLLREGISTERFILTER2(Handler, Filter, aClasses) DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )
#define | DEFINE_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \
#define | DEFINE_REGISTERFILTER2(Name, Handler, Filter, aClasses)
#define | DEFINE_REGISTERFILTERBASE(Name, Handler, Filter, aClasses, fBlastExistingPersistentHandler)
#define | DEFINE_SOFT_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_SOFT_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Functions

long | AddThreadingModel (WCHAR const *wszClsId, WCHAR const *wszThreadingModel)
long | BuildKeyValues (WCHAR const *const *awszKeyValues, unsigned cKeyValues)
long | DestroyKeyValues (WCHAR const *const *awszKeyValues, int cKeyValues)
long | RegisterAClass (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszShortName=0, BOOL fAppendOnly=FALSE)
long | RegisterAClassAndExt (SClassEntry const &Class, WCHAR const *pwszPHandler, BOOL fAppendOnly=FALSE, BOOL fBlastExistingPersistentHandler=TRUE)
long | RegisterACLSID (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszClassId=0, BOOL fAppendOnly=FALSE, BOOL fAppendDesc=TRUE)
long | RegisterAFilter (SFilterEntry const &Filter)
long | RegisterAHandler (SHandlerEntry const &Handler)
long | RemoveAClass (WCHAR *pwszClassId)
long | RemoveAClassName (WCHAR *pwszClass)
long | UnRegisterAFilter (SFilterEntry const &Filter)
long | UnRegisterAHandler (SHandlerEntry const &Handler)
long | UnRegisterAnExt (SClassEntry const &Class)

Define Documentation

#define DEFINE_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1573 of file FiltReg.Hxx.

#define DEFINE_DLLREGISTERFILTER2 | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )

Definition at line 1658 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \

Definition at line 1569 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTER2 | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses
 | ) |

Definition at line 1587 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTERBASE | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses,
 |  | fBlastExistingPersistentHandler
 | ) |

Definition at line 1500 of file FiltReg.Hxx.

#define DEFINE_SOFT_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1579 of file FiltReg.Hxx.

#define DEFINE_SOFT_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Definition at line 1576 of file FiltReg.Hxx.

Function Documentation

long AddThreadingModel | ( | WCHAR const * | wszClsId,
 |  | WCHAR const * | wszThreadingModel |
 | ) |  |  | [inline]

Definition at line 194 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, wszClsId );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, L"InprocServer32" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                             wcTemp,               // Sub key
                             0,                    // Reserved
                             KEY_ALL_ACCESS,       // Access
                             &hKey );              // Handle

    if ( ERROR_SUCCESS != dwError )
        return dwError;

    if ( 0 != wszThreadingModel )
        dwError = RegSetValueExW( hKey,                   // Key
                                  L"ThreadingModel",      // Name
                                  0,                      // Reserved
                                  REG_SZ,                 // Type
                                  (BYTE *) wszThreadingModel,  // Value
                                  (DWORD) ( (wcslen(wszThreadingModel) + 1) * sizeof WCHAR ) );
    else
        RegDeleteValueW( hKey,                   // Key
                         L"ThreadingModel" );    // Name

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long BuildKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | unsigned | cKeyValues |
 | ) |  |  | [inline]

Definition at line 121 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    do
    {
        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        DWORD  dwDisposition;

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;

        if ( 0 != awszKeyValues[i] )
            dwError = RegSetValueExW( hKey,                     // Key
                                      0,                        // Name
                                      0,                        // Reserved
                                      REG_SZ,                   // Type
                                      (BYTE *)awszKeyValues[i], // Value
                                      (DWORD) ( (1 + wcslen(awszKeyValues[i]) ) * sizeof(WCHAR) ) );

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;
    }
    while ( i < cKeyValues );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long DestroyKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | int | cKeyValues |
 | ) |  |  | [inline]

Definition at line 248 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    //
    // Build path to deepest component
    //

    wcscpy( wcTemp, L"CLSID" );
    int i = 0;

    do
    {
        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        i += 2;
    }
    while ( i < cKeyValues );

    //
    // Remove components in reverse order
    //

    long dwError = ERROR_SUCCESS;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;

    unsigned cc = (unsigned) wcslen( wcTemp );

    for ( i -= 2; i >= 0; i -= 2 )
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 wcTemp,               // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        #if 0  // Values deleted by RegDeleteKeyW
        //
        // Delete value, if there is one.
        //

        if ( 0 != awszKeyValues[i+1] )
            dwError = RegDeleteValueW( hKey, 0 );

        if ( ERROR_SUCCESS != dwError )
            break;
        #endif // 0

        //
        // Delete subkey, if there is one.
        //

        if ( i+2 < cKeyValues )
            dwError = RegDeleteKeyW( hKey, awszKeyValues[i+2] );

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Close key and truncate string to next component.
        //

        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        cc -= (unsigned) wcslen( awszKeyValues[i] );
        cc--;

        wcTemp[cc] = 0;
    }

    //
    // Remove the final top key
    //

    if ( ERROR_SUCCESS == dwError )
    {
        do
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key -- "CLSID"
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Delete subkey
            //

            dwError = RegDeleteKeyW( hKey, awszKeyValues[0] );

        } while ( FALSE );
    }

    return dwError;
}

long RegisterAClass | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszShortName = 0,
 |  | BOOL | fAppendOnly = FALSE |
 | ) |  |  | [inline]

Definition at line 552 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    if ( 0 == pwszShortName )
    {
        if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, Class.pwszShortName );
    }
    else
    {
        if ( wcslen( pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, pwszShortName );
    }

    do
    {
        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        //
        // Here, wcTemp contains the key name for the named entry (ex: Word.Document.8)
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        //
        // If needed, write the description, but only for non-overrides.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszShortName )
        {
            dwError = RegSetValueExW( hKey,                          // Key
                                      0,                             // Name
                                      0,                             // Reserved
                                      REG_SZ,                        // Type
                                      (BYTE *)Class.pwszDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszDescription) ) * sizeof(WCHAR) ) );

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Write or read ClassId
        //

        wcscat( wcTemp, L"\\CLSID" );

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        dwSize = sizeof(wcTemp);

        dwError = RegQueryValueExW( hKey,                // Key handle
                                    0,                   // Name
                                    0,                   // Reserved
                                    &dwType,             // Datatype
                                    (BYTE *)(wcTemp),    // Data returned here
                                    &dwSize );           // Size of data

        if ( ERROR_SUCCESS != dwError )
        {
            if ( ERROR_FILE_NOT_FOUND == dwError )
            {
                //
                // Don't set a class id in append mode.
                //

                if ( fAppendOnly )
                {
                    dwError = ERROR_SUCCESS;
                    break;
                }

                dwError = RegSetValueExW( hKey,                          // Key
                                          0,                             // Name
                                          0,                             // Reserved
                                          REG_SZ,                        // Type
                                          (BYTE *)Class.pwszClassId,     // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszClassId) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0; // Default to class from Class structure

                if ( ERROR_SUCCESS != dwError )
                    break;
            }
            else
                break;
        }
        else
        {
            if ( REG_SZ != dwType )
                dwError = E_FAIL;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp contains the {class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        dwError = RegisterACLSID( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAClassAndExt | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fBlastExistingPersistentHandler = TRUE |
 | ) |  |  | [inline]

Definition at line 371 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError = NO_ERROR;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    do
    {
        //
        // First, the optional extension entry
        //

        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        if ( 0 == Class.pwszExt )
        {
            //
            // Build up named entry
            //

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );
        }
        else
        {
            if ( wcslen( Class.pwszExt ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszExt );

            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write or read class association
            //

            BOOL fSetValue = TRUE;

            if ( REG_OPENED_EXISTING_KEY == dwDisposition )
            {
                dwSize = sizeof(wcTemp);

                dwError = RegQueryValueExW( hKey,            // Key handle
                                            0,               // Name
                                            0,               // Reserved
                                            &dwType,         // Datatype
                                            (BYTE *)wcTemp,  // Data returned here
                                            &dwSize );       // Size of data

                if ( ERROR_SUCCESS == dwError )
                {
                    fSetValue = FALSE;

                    if ( REG_SZ != dwType )
                        dwError = E_FAIL;
                }
                else if ( ERROR_FILE_NOT_FOUND == dwError )
                {
                    //
                    // This is ok, but we need to remember that the
                    // combination of wcTemp[0] == 0 && fAppendOnly means
                    // don't try to register the class.
                    //

                    wcTemp[0] = 0;
                    dwError = ERROR_SUCCESS;
                }
            }

            if ( fSetValue && !fAppendOnly )
            {
                dwError = RegSetValueExW( hKey,                        // Key
                                          0,                           // Name
                                          0,                           // Reserved
                                          REG_SZ,                      // Type
                                          (BYTE *)Class.pwszShortName, // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszShortName) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0;
            }

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write the persistent handler key
            //

            HKEY hKey2 = (HKEY)INVALID_HANDLE_VALUE;

            dwError = RegCreateKeyExW( hKey,                 // Root
                                       L"PersistentHandler", // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey2,               // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;

            if ( fBlastExistingPersistentHandler ||
                 ( REG_OPENED_EXISTING_KEY != dwDisposition ) )
                dwError = RegSetValueExW( hKey2,                 // Key
                                          0,                     // Name
                                          0,                     // Reserved
                                          REG_SZ,                // Type
                                          (BYTE *)pwszPHandler,  // Value
                                          (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

            if ( (HKEY)INVALID_HANDLE_VALUE != hKey2 )
            {
                RegCloseKey( hKey2 );
                hKey2 = (HKEY)INVALID_HANDLE_VALUE;
            }
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp may contain the key name for the named entry (ex: Word.Document.8)
        //

        if ( wcTemp[0] != 0 || !fAppendOnly )
            dwError = RegisterAClass( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterACLSID | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszClassId = 0,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fAppendDesc = TRUE |
 | ) |  |  | [inline]

Definition at line 787 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    wcscpy( wcTemp, L"CLSID\\" );

    if ( 0 == pwszClassId )
        wcscat( wcTemp, Class.pwszClassId );
    else
        wcscat( wcTemp, pwszClassId );

    do
    {
        DWORD dwDisposition;

        //
        // Here, wcTemp contains the CLSID\{class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // If needed, write the description, but not for override class.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszClassId && fAppendDesc )
        {
            dwError = RegSetValueExW( hKey,                                 // Key
                                      0,                                    // Name
                                      0,                                    // Reserved
                                      REG_SZ,                               // Type
                                      (BYTE *)Class.pwszClassIdDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszClassIdDescription) ) * sizeof(WCHAR) ) );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Always write persistent handler.
        //

        wcscat( wcTemp, L"\\PersistentHandler" );

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegSetValueExW( hKey,                  // Key
                                  0,                     // Name
                                  0,                     // Reserved
                                  REG_SZ,                // Type
                                  (BYTE *)pwszPHandler,  // Value
                                  (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1234 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    long retVal = BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    if ( ERROR_SUCCESS == retVal )
        retVal = AddThreadingModel( Filter.pwszClassId, Filter.pwszThreadingModel );

    return retVal;
}

long RegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1210 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    return BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long RemoveAClass ( WCHAR * pwszClassId ) [inline]

Definition at line 1059 of file FiltReg.Hxx.

{
    //
    // First, delete class entry.
    //

    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors
    long dwEnum = ERROR_SUCCESS;    // For enumerator

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  L"CLSID",             // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClassId );

        RegCloseKey( hKeyEnum );

        long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                      0,                    // Sub key
                                      0,                    // Reserved
                                      KEY_ALL_ACCESS,       // Access
                                      &hKeyEnum );          // Handle
    }

    if ( ERROR_SUCCESS == dwError )
    {
        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                wcscat( wcTemp, L"\\CLSID" );

                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClassId ) )
                    {
                        wcTemp[ wcslen(wcTemp) - wcslen( L"\\CLSID" ) ] = 0;

                        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                                 wcTemp,               // Sub key
                                                 0,                    // Reserved
                                                 KEY_ALL_ACCESS,       // Access
                                                 &hKey );              // Handle

                        if ( ERROR_SUCCESS == dwError )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKey, L"CLSID" );
                            else
                                RegDeleteKeyW( hKey, L"CLSID" );

                            dwIndex = 0;
                        }

                        //
                        // If there are no more entries, then the class name can be deleted
                        //

                        dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);

                        long dw2 = RegEnumKeyExW( hKey,               // Handle of key
                                                  0,                  // Index of registry subkey
                                                  wcTemp,             // Buffer for name
                                                  &dwSize,            // Size of buffer / key
                                                  0,                  // Reserved
                                                  0,                  // Class (unused)
                                                  0,                  // Class size (unused)
                                                  &ftUnused );        // Filetime (unused)

                        RegCloseKey( hKey );

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                            RemoveAClassName( wcTemp );
                    }
                }
                else
                    dwError = ERROR_SUCCESS;  // Just didn't have CLSID
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long RemoveAClassName ( WCHAR * pwszClass ) [inline]

Definition at line 923 of file FiltReg.Hxx.

{
    //
    // First, delete class name entry.
    //

    long dwEnum = ERROR_SUCCESS;    // The enumerator
    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  0,                    // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClass );

        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClass ) )
                    {
                        //
                        // Always delete the value
                        //

                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteValueW( hKey, 0 );
                        else
                            RegDeleteValueW( hKey, 0 );

                        //
                        // Any other key(s)?
                        //

                        dwSize = sizeof(wcTemp) / sizeof wcTemp[0];

                        DWORD dw2 = RegEnumKeyExW( hKey,                   // Handle of key
                                                   0,                      // Index of registry subkey
                                                   wcTemp,                 // Buffer for name
                                                   &dwSize,                // Size of buffer / key
                                                   0,                      // Reserved
                                                   0,                      // Class (unused)
                                                   0,                      // Class size (unused)
                                                   &ftUnused );            // Filetime (unused)

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKeyEnum, wcTemp );
                            else
                                RegDeleteKeyW( hKeyEnum, wcTemp );

                            dwIndex = 0;
                        }

                    }
                    else
                        dwError = ERROR_SUCCESS;  // Just didn't have a null key (or no match)
                }
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1470 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    return DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long UnRegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1260 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    //
    // dwIgnore is used to record non-fatal errors
    //

    long dwIgnore = DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    long dwError = ERROR_SUCCESS;

    //
    // Now, enumerate all classes and delete any persistent handler entries.
    //

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwEnum = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 L"CLSID",              // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKeyEnum );          // Handle

    DWORD dwIndex = 0;

    while ( ERROR_SUCCESS == dwEnum )
    {
        WCHAR wcTemp[MAX_PATH];

        wcscpy( wcTemp, L"CLSID\\" );
        unsigned cc = (unsigned) wcslen( wcTemp );

        DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]) - cc;
        FILETIME ftUnused;

        dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                dwIndex,                // Index of registry subkey
                                wcTemp + cc,            // Buffer for name
                                &dwSize,                // Size of buffer / key
                                0,                      // Reserved
                                0,                      // Class (unused)
                                0,                      // Class size (unused)
                                &ftUnused );            // Filetime (unused)

        dwIndex++;

        //
        // Does the key have a persistent handler?
        //

        if ( ERROR_SUCCESS == dwEnum )
        {
            wcscat( wcTemp, L"\\PersistentHandler" );

            HKEY hKey;

            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS == dwError )
            {
                //
                // Is this the persistent handler we're looking for?
                //

                WCHAR wcTemp2[MAX_PATH];
                DWORD dwType;

                dwSize = sizeof(wcTemp2);

                dwError = RegQueryValueExW( hKey,                // Key handle
                                            0,                   // Name
                                            0,                   // Reserved
                                            &dwType,             // Datatype
                                            (BYTE *)wcTemp2,     // Data returned here
                                            &dwSize );           // Size of data

                RegCloseKey( hKey );

                if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, Handler.pwszClassId ) )
                {
                    wcTemp[ wcslen(wcTemp) - wcslen( L"\\PersistentHandler" ) ] = 0;

                    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                             wcTemp,               // Sub key
                                             0,                    // Reserved
                                             KEY_ALL_ACCESS,       // Access
                                             &hKey );              // Handle

                    if ( ERROR_SUCCESS == dwError )
                    {
                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteKeyW( hKey, L"PersistentHandler" );
                        else
                            RegDeleteKeyW( hKey, L"PersistentHandler" );

                        dwIndex = 0; // Start over again
                    }

                    //
                    // If that was the *only* entry under the clsid, then the class can be
                    // removed.
                    //

                    dwSize = sizeof(wcTemp2)/sizeof(wcTemp2[0]);

                    long dw2 = RegEnumKeyExW( hKey,             // Handle of key
                                              0,                // Index of registry subkey
                                              wcTemp2,          // Buffer for name
                                              &dwSize,          // Size of buffer / key
                                              0,                // Reserved
                                              0,                // Class (unused)
                                              0,                // Class size (unused)
                                              &ftUnused );      // Filetime (unused)

                    RegCloseKey( hKey );

                    if ( ERROR_NO_MORE_ITEMS == dw2 )
                        RemoveAClass( wcTemp + wcslen( L"CLSID\\" ) );
                }
                else
                {
                    //
                    // Didn't have persistent handler null key.  Odd but not fatal.
                    // Or, key didn't match target.
                    //

                    dwIgnore = dwError;
                    dwError = ERROR_SUCCESS;
                }

            }
            else
                dwError = ERROR_SUCCESS;  // Just didn't have persistent handler
        }
    }

    if ( (HKEY)INVALID_HANDLE_VALUE != hKeyEnum )
        RegCloseKey( hKeyEnum );

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAnExt ( SClassEntry const & Class ) [inline]

Definition at line 1429 of file FiltReg.Hxx.

{
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    DWORD dwError;

    do
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 Class.pwszExt,        // Sub key -- "CLSID"
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegDeleteKeyW( hKey, L"PersistentHandler" );

    } while ( FALSE );

    if ( INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/HtmlProp/HtmlProp.Cxx File Reference

  • WinBase
  • Indexing
  • HtmlProp
Classes | Defines | Functions | Variables

HtmlProp.Cxx File Reference

#include <stdio.h>
#include <wchar.h>
#include <windows.h>
#include <oledb.h>
#include <cmdtree.h>
#include <filterr.h>
#include <filter.h>
#include "htmlprop.hxx"
#include "filtreg.hxx"

Go to the source code of this file.

Classes

struct | SPropertyEntry

Defines

#define | UNICODE

Functions

SCODE STDMETHODCALLTYPE | DllCanUnloadNow (void)
SCODE STDMETHODCALLTYPE | DllGetClassObject (REFCLSID cid, REFIID iid, void **ppvObj)
SCODE | ParseDateTime (WCHAR *pwcDate, FILETIME &ft)
void | ParsePropertyFile ()
SCODE | Translate (PROPVARIANT &v, DBTYPE dbType)

Variables

SClassEntry const | aHtmlPropClasses []
const SPropertyEntry | aTypeEntries []
CLSID CLSID_HtmlIFilter
CLSID CLSID_HtmlPropClass
CLSID CLSID_HtmlPropIFilter
CLSID CLSID_MetaProperty
const ULONG | cTypeEntries = sizeof aTypeEntries / sizeof aTypeEntries[0]
SPropertyEntry g_aEntries [maxEntries]
ULONG | g_cEntries = 0
long | g_cInstances = 0
HMODULE | g_hHtmlDll = 0
SFilterEntry const | HtmlPropFilter
SHandlerEntry const | HtmlPropHandler
const ULONG | maxEntries = 500
const WCHAR * | pwcHTMLFilter = "nlhtml.dll"
const WCHAR * | pwcHTMLPropertyFile = "htmlprop.ini"
const WCHAR * | pwcMetaProperty = "d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1"
CLSID TYPID_HtmlPropIFilter

Define Documentation

#define UNICODE

Definition at line 19 of file HtmlProp.Cxx.

Function Documentation

SCODE STDMETHODCALLTYPE DllCanUnloadNow ( void )

Definition at line 1102 of file HtmlProp.Cxx.

{
    if ( 0 == g_cInstances )
        return S_OK;
    else
        return S_FALSE;
} //DllCanUnloadNow

SCODE STDMETHODCALLTYPE DllGetClassObject | ( | REFCLSID | cid,
 |  | REFIID | iid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 1064 of file HtmlProp.Cxx.

{
    IUnknown * pUnk = 0;

    if ( CLSID_HtmlPropIFilter == cid ||
         CLSID_HtmlPropClass   == cid )
    {
        pUnk = new HtmlPropIFilterCF;

        if ( 0 == pUnk )
            return E_OUTOFMEMORY;
    }
    else
    {
        *ppvObj = 0;
        return E_NOINTERFACE;
    }

    SCODE sc = pUnk->QueryInterface( iid, ppvObj );

    pUnk->Release();

    return sc;
} //DllGetClassObject

SCODE ParseDateTime | ( | WCHAR * | pwcDate,
 |  | FILETIME & | ft
 | ) |  |

Definition at line 295 of file HtmlProp.Cxx.

{
    SCODE      scResult = S_OK;
    int        cItems = 0;
    SYSTEMTIME stValue = { 0, 0, 0, 0, 0, 0, 0, 0 };
    wchar_t    szMonthAbrv[1024] = {0};
    wchar_t    szMonthList[] = L"JanFebMarAprMayJunJulAugSepOctNovDec";
    wchar_t    *pDest = NULL;

    // Format: 1994/11/06 08:49:37:00, time optional, milliseconds optional

    cItems = swscanf( pwcDate,
                      L"%4hd/%2hd/%2hd %2hd:%2hd:%2hd:%3hd",
                      &stValue.wYear,
                      &stValue.wMonth,
                      &stValue.wDay,
                      &stValue.wHour,
                      &stValue.wMinute,
                      &stValue.wSecond,
                      &stValue.wMilliseconds );

    if (cItems == 3 || cItems == 6 || cItems == 7)
        goto prepdate;

    // Format: 1994-11-06 08:49:37:00, time optional, milliseconds optional

    cItems = swscanf( pwcDate,
                      L"%4hd-%2hd-%2hd %2hd:%2hd:%2hd:%3hd",
                      &stValue.wYear,
                      &stValue.wMonth,
                      &stValue.wDay,
                      &stValue.wHour,
                      &stValue.wMinute,
                      &stValue.wSecond,
                      &stValue.wMilliseconds );

    if (cItems == 3 || cItems == 6 || cItems == 7)
        goto prepdate;

    // Format: Sun, 06 Nov 1994 08:49:37 GMT

    cItems = swscanf( pwcDate,
                      L"%*Ls %2hd %3Ls %4hd %2hd:%2hd:%2hd GMT",
                                          &stValue.wDay,
                                          szMonthAbrv,
                      &stValue.wYear,
                      &stValue.wHour,
                      &stValue.wMinute,
                      &stValue.wSecond );

    if (cItems == 6)
    {
         pDest = wcsstr(szMonthList, szMonthAbrv);
         if (pDest != NULL)
         {
             stValue.wMonth = (WORD) ((pDest - szMonthList) / 3) + 1;
             goto prepdate;
         }
    }

    // Format: Sunday, 06-Nov-94 08:49:37 GMT

    cItems = swscanf( pwcDate,
                      L"%*Ls %2hd-%3Ls-%2hd %2hd:%2hd:%2hd GMT",
                      &stValue.wDay,
                      szMonthAbrv,
                      &stValue.wYear,
                      &stValue.wHour,
                      &stValue.wMinute,
                      &stValue.wSecond );

    if (cItems == 6)
    {
        pDest = wcsstr(szMonthList, szMonthAbrv);
        if (pDest != NULL)
        {
            stValue.wMonth = (WORD) ((pDest - szMonthList) / 3) + 1;
            goto prepdate;
        }
    }

        // Format: Sun Nov 6 08:49:37 1994
    cItems = swscanf( pwcDate,
                      L"%*Ls %3Ls %2hd %2hd:%2hd:%2hd %4hd",
                                          szMonthAbrv,
                                          &stValue.wDay,
                      &stValue.wHour,
                      &stValue.wMinute,
                      &stValue.wSecond,
                      &stValue.wYear );

    if (cItems == 6)
    {
        pDest = wcsstr(szMonthList, szMonthAbrv);
        if (pDest != NULL)
        {
            stValue.wMonth = (WORD) ((pDest - szMonthList) / 3) + 1;
            goto prepdate;
        }
    }

    // Format: 1994-11-06T08:49:37.000Z

    cItems = swscanf( pwcDate,
                      L"%4hd-%2hd-%2hdT%2hd:%2hd:%2hd.%3hdZ",
                      &stValue.wYear,
                      &stValue.wMonth,
                      &stValue.wDay,
                      &stValue.wHour,
                      &stValue.wMinute,
                      &stValue.wSecond,
                      &stValue.wMilliseconds );

    if (cItems == 7)
        goto prepdate;

    // Format: 1994-11-06T08:49:37.000 (like above, but without the Z at the end)

    cItems = swscanf( pwcDate,
                      L"%4hd-%2hd-%2hdT%2hd:%2hd:%2hd.%3hd",
                      &stValue.wYear,
                      &stValue.wMonth,
                      &stValue.wDay,
                      &stValue.wHour,
                      &stValue.wMinute,
                      &stValue.wSecond,
                      &stValue.wMilliseconds );

    if (cItems == 7)
        goto prepdate;

        // If we reach the next line, none of the formats were found.
    scResult = E_INVALIDARG;
        goto cleanup;

prepdate:

    // Make a sensible split for Year 2000

    if (stValue.wYear < 30)
        stValue.wYear += 2000;
    else if (stValue.wYear < 100)
        stValue.wYear += 1900;

        // Generate a filetime value to pass back to the caller.
    if (! SystemTimeToFileTime(&stValue, &ft))
    {
        scResult = HRESULT_FROM_WIN32(GetLastError());
        goto cleanup;
    }

    scResult = S_OK;

cleanup:
    return scResult;
} //ParseDateTime

void ParsePropertyFile ( )

Definition at line 766 of file HtmlProp.Cxx.

{
    // already parsed the file?

    if ( g_cEntries > 0 )
        return;

    // open the property file in the system32 directory

    WCHAR awcFile[ MAX_PATH ];
    GetSystemDirectory( awcFile, sizeof awcFile / sizeof WCHAR );

    wcscat( awcFile, L"\\" );
    wcscat( awcFile, pwcHTMLPropertyFile );

    FILE *file = _wfopen( awcFile, L"r" );

    if ( 0 != file )
    {
        WCHAR awc[ 500 ];
        BOOL fNames = FALSE;

        // for each line of the file

        while ( fgetws( awc, sizeof awc / sizeof awc[0], file ) )
        {
            int cwc = (int)wcslen( awc );
            if ( 0 == cwc )
                continue;

            // trim off trailing newline

            if ( awc[ cwc - 1 ] == '\n' )
            {
                cwc--;
                awc[cwc] = 0;
            }

            // is this a section line?

            if ( '[' == awc[0] )
            {
                fNames = !_wcsicmp( L"[names]", awc );
            }
            else if ( ( '#' != awc[0] ) && fNames )
            {
                // parse the data type

                WCHAR *pwcType = wcschr( awc, L'(' );

                if ( 0 != pwcType )
                {
                    pwcType++;
                    while ( ' ' == *pwcType )
                        pwcType++;

                    WCHAR *pwcX = wcstok( pwcType, L", )" );

                    if ( 0 != pwcType )
                    {
                        // lookup the type in the list of types

                        for ( ULONG i = 0; i < cTypeEntries; i++ )
                        {
                            if ( !_wcsicmp( aTypeEntries[i].awcName,
                                            pwcType ) )
                                break;
                        }

                        // got the type, so find the guid

                        if ( i < cTypeEntries )
                        {
                            // find the property guid

                            pwcType += 1 + wcslen( pwcType );

                            WCHAR *pwcName = wcschr( pwcType, '=' );

                            if ( pwcName )
                            {
                                pwcName++;
                                while ( ' ' == *pwcName )
                                    pwcName++;

                                // is this the html guid?

                                if ( !_wcsnicmp( pwcName,
                                                 pwcMetaProperty,
                                                 wcslen( pwcMetaProperty ) ) )
                                {
                                    // find the property name

                                    pwcName = wcschr( pwcName, ' ' );
                                    if ( pwcName )
                                    {
                                        // skip white space

                                        while ( ' ' == *pwcName )
                                            pwcName++;

                                        // got it -- save it away if it fits

                                        if ( ( wcslen( pwcName ) < cwcMaxName ) &&
                                             ( g_cEntries < maxEntries ) )
                                        {
                                            wcscpy( g_aEntries[g_cEntries].awcName,
                                                    pwcName );
                                            g_aEntries[g_cEntries++].dbType =
                                                aTypeEntries[i].dbType;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        fclose( file );
    }
} //ParsePropertyFile

SCODE Translate | ( | PROPVARIANT & | v,
 |  | DBTYPE | dbType
 | ) |  |

Definition at line 466 of file HtmlProp.Cxx.

{
    PROPVARIANT varCopy = v;
    BOOL fChange = TRUE;
    SCODE sc = S_OK;

    WCHAR *p = v.pwszVal;

    // The source must be a string variant

    if ( 0 == p || VT_LPWSTR != v.vt )
        return S_OK;

    v.vt = dbType;

    // Eat leading white space

    while ( ' ' == *p )
        p++;

    int base = 10;

    // Is this a hex number?

    if ( '0' == *p && ( 'x' == *(p+1) || 'X' == *(p+1) ) )
    {
        p += 2;
        base = 16;
    }

    WCHAR * pwc;

    // DBTYPE_I1 isn't an official OLE property type, so it isn't supported.
    //
    // Note: range checking could be added and a failure code could be
    // returned if the check failed.  That would put the file in the
    // unfiltered list.

    switch ( dbType )
    {
        case DBTYPE_UI1 :
            v.bVal = (BYTE) wcstoul( v.pwszVal, &pwc, base );
            break;
        case DBTYPE_I2 :
            v.iVal = (SHORT) wcstol( v.pwszVal, &pwc, base );
            break;
        case DBTYPE_UI2 :
            v.uiVal = (USHORT) wcstoul( v.pwszVal, &pwc, base );
            break;
        case DBTYPE_I4 :
            v.lVal = (LONG) wcstol( v.pwszVal, &pwc, base );
            break;
        case DBTYPE_UI4 :
            v.ulVal = (ULONG) wcstoul( v.pwszVal, &pwc, base );
            break;
        case DBTYPE_I8 :
            swscanf( v.pwszVal, L"%I64d", &v.fltVal );
            break;
        case DBTYPE_UI8 :
            swscanf( v.pwszVal, L"%I64u", &v.fltVal );
            break;
        case DBTYPE_R4 :
            swscanf( v.pwszVal, L"%f", &v.fltVal );
            break;
        case DBTYPE_R8 :
            swscanf( v.pwszVal, L"%lf", &v.dblVal );
            break;
        case DBTYPE_BOOL :

            // If the first character is t or 1, assume VARIANT_TRUE

            if ( 't' == *v.pwszVal ||
                 'T' == *v.pwszVal ||
                 '1' == *v.pwszVal )
                v.boolVal = VARIANT_TRUE;
            else
                v.boolVal = VARIANT_FALSE;
            break;
        case VT_FILETIME :
            sc = ParseDateTime( p, v.filetime );
            break;
        default :

            // leave the property as it was

            fChange = FALSE;
            v.vt = varCopy.vt;
            break;
    }

    // Free the memory for the (now converted) string value

    if ( fChange )
        PropVariantClear( &varCopy );

    return sc;
} //Translate

Variable Documentation

SClassEntry const aHtmlPropClasses[]
Initial value:
{
    { L".hhc",  L"hhcfile",       L"HHC file",      L"{7f73b8f6-c19c-11d0-aa66-00c04fc2eddc}", L"HHC file" },
    { L".htm",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".html", L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".htx",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".stm",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".htw",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".asp",  L"asp_auto_file", L"ASP auto file", L"{bd70c020-2d24-11d0-9110-00004c752752}", L"ASP auto file" },
}

Definition at line 1110 of file HtmlProp.Cxx.

const SPropertyEntry aTypeEntries[]
Initial value:
{
    { L"DBTYPE_I1",   DBTYPE_I1   },
    { L"DBTYPE_UI1",  DBTYPE_UI1  },
    { L"DBTYPE_I2",   DBTYPE_I2   },
    { L"DBTYPE_UI2",  DBTYPE_UI2  },
    { L"DBTYPE_I4",   DBTYPE_I4   },
    { L"DBTYPE_UI4",  DBTYPE_UI4  },
    { L"DBTYPE_I8",   DBTYPE_I8   },
    { L"DBTYPE_UI8",  DBTYPE_UI8  },
    { L"DBTYPE_R4",   DBTYPE_R4   },
    { L"DBTYPE_R8",   DBTYPE_R8   },
    { L"DBTYPE_BOOL", DBTYPE_BOOL },
    { L"DBTYPE_WSTR", DBTYPE_WSTR },
    { L"VT_FILETIME", VT_FILETIME }
}

Definition at line 84 of file HtmlProp.Cxx.

CLSID CLSID_HtmlIFilter
Initial value:
{
    0xe0ca5340, 0x4534, 0x11cf,
    { 0xb9, 0x52, 0x00, 0xaa, 0x00, 0x51, 0xfe, 0x20 }
}

Definition at line 60 of file HtmlProp.Cxx.

CLSID CLSID_HtmlPropClass
Initial value:
{
    0x4cbd1020, 0xa1db, 0x11d1,
    { 0xa8, 0xfb, 0x00, 0xe0, 0x98, 0x00, 0x6e, 0xd3 }
}

Definition at line 52 of file HtmlProp.Cxx.

CLSID CLSID_HtmlPropIFilter
Initial value:
{
    0xf4309e80, 0xa1db, 0x11d1,
    { 0xa8, 0xfb, 0x00, 0xe0, 0x98, 0x00, 0x6e, 0xd3 }
}

Definition at line 44 of file HtmlProp.Cxx.

CLSID CLSID_MetaProperty
Initial value:
{
    0xd1b5d3f0, 0xc0b3, 0x11cf,
    { 0x9a, 0x92, 0x00, 0xa0, 0xc9, 0x08, 0xdb, 0xf1 }
}

Definition at line 68 of file HtmlProp.Cxx.

const ULONG cTypeEntries = sizeof aTypeEntries / sizeof aTypeEntries[0]

Definition at line 101 of file HtmlProp.Cxx.

SPropertyEntry g_aEntries[maxEntries]

Definition at line 106 of file HtmlProp.Cxx.

ULONG g_cEntries = 0

Definition at line 107 of file HtmlProp.Cxx.

long g_cInstances = 0

Definition at line 109 of file HtmlProp.Cxx.

HMODULE g_hHtmlDll = 0

Definition at line 110 of file HtmlProp.Cxx.

SFilterEntry const HtmlPropFilter
Initial value:
{
    L"{f4309e80-a1db-11d1-a8fb-00e098006ed3}",
    L"html property filter",
    L"HtmlProp.dll",
    L"Both"
}

Definition at line 1128 of file HtmlProp.Cxx.

SHandlerEntry const HtmlPropHandler
Initial value:
{
    L"{c694d910-a439-11d1-a903-00e098006ed3}",
    L"html property persistent handler",
    L"{f4309e80-a1db-11d1-a8fb-00e098006ed3}",
}

Definition at line 1121 of file HtmlProp.Cxx.

const ULONG maxEntries = 500

Definition at line 105 of file HtmlProp.Cxx.

const WCHAR* pwcHTMLFilter = "nlhtml.dll"

Definition at line 114 of file HtmlProp.Cxx.

const WCHAR* pwcHTMLPropertyFile = "htmlprop.ini"

Definition at line 103 of file HtmlProp.Cxx.

const WCHAR* pwcMetaProperty = "d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1"

Definition at line 76 of file HtmlProp.Cxx.

CLSID TYPID_HtmlPropIFilter
Initial value:
{
    0xc8e2ab80, 0xa1db, 0x11d1,
    { 0xa8, 0xfb, 0x00, 0xe0, 0x98, 0x00, 0x6e, 0xd3 }
}

Definition at line 36 of file HtmlProp.Cxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/HtmlProp/HtmlProp.Hxx File Reference

  • WinBase
  • Indexing
  • HtmlProp
Classes | Functions | Variables

HtmlProp.Hxx File Reference

Go to the source code of this file.

Classes

class | HtmlPropIFilter
class | HtmlPropIFilterCF

Functions

SCODE STDMETHODCALLTYPE | DllCanUnloadNow (void)
SCODE STDMETHODCALLTYPE | DllGetClassObject (REFCLSID cid, REFIID iid, void **ppvObj)

Variables

const ULONG | cwcMaxName = 80

Function Documentation

SCODE STDMETHODCALLTYPE DllCanUnloadNow ( void )

Definition at line 53 of file ComSpyAudit.Cpp.

{
  return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

SCODE STDMETHODCALLTYPE DllGetClassObject | ( | REFCLSID | cid,
 |  | REFIID | iid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 1064 of file HtmlProp.Cxx.

{
    IUnknown * pUnk = 0;

    if ( CLSID_HtmlPropIFilter == cid ||
         CLSID_HtmlPropClass   == cid )
    {
        pUnk = new HtmlPropIFilterCF;

        if ( 0 == pUnk )
            return E_OUTOFMEMORY;
    }
    else
    {
        *ppvObj = 0;
        return E_NOINTERFACE;
    }

    SCODE sc = pUnk->QueryInterface( iid, ppvObj );

    pUnk->Release();

    return sc;
} //DllGetClassObject

Variable Documentation

const ULONG cwcMaxName = 80

Definition at line 31 of file HtmlProp.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Anchor.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

Anchor.Cxx File Reference

#include <pch.cxx>
#include <anchor.hxx>
#include <htmlguid.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Anchor.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Enumerations

Anchor.Hxx File Reference

#include <htmlelem.hxx>

Go to the source code of this file.

Classes

class | CAnchorTag

Enumerations

enum | AnchorTagState { StartAnchor, EndAnchor }

Enumeration Type Documentation

enum AnchorTagState
Enumerator:
StartAnchor
EndAnchor

Definition at line 17 of file Anchor.Hxx.

{
    StartAnchor,            // Start anchor tag
    EndAnchor               // End anchor tag
};

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Assert.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions

Assert.Cxx File Reference

#include <pch.cxx>

Go to the source code of this file.

Functions

void Win4AssertEx (char const *szFile, int iLine, char const *szMessage)

Function Documentation

void Win4AssertEx | ( | char const * | szFile,
 |  | int | iLine,
 |  | char const * | szMessage
 | ) |  |

Definition at line 22 of file Assert.Cxx.

{
     char acsString[200];

     sprintf( acsString, "%s, File: %s Line: %u\n", szMessage, szFile, iLine );
     OutputDebugStringA( acsString );

     DebugBreak();
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Bag.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

Bag.Cxx File Reference

#include <pch.cxx>
#include <bag.hxx>
#include <htmlelem.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Bag.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Variables

Bag.Hxx File Reference

Go to the source code of this file.

Classes

class | CHtmlElemBagEntry
class | CHtmlElementBag

Variables

const | COUNT_OF_HTML_ELEMENTS = 14

Variable Documentation

const COUNT_OF_HTML_ELEMENTS = 14

Definition at line 16 of file Bag.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/CharHash.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

CharHash.Cxx File Reference

#include <pch.cxx>
#include <charhash.hxx>
#include <htmlfilt.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/CharHash.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Variables

CharHash.Hxx File Reference

Go to the source code of this file.

Classes

class | CSpecialCharHashEntry
class | CSpecialCharHashTable

Variables

const | MAX_TAG_LENGTH = 50
const | PRIVATE_USE_MAPPING_FOR_GT = 0xe801
const | PRIVATE_USE_MAPPING_FOR_LT = 0xe800
const | SPECIAL_CHAR_HASH_TABLE_SIZE = 97

Variable Documentation

const MAX_TAG_LENGTH = 50

Definition at line 14 of file CharHash.Hxx.

const PRIVATE_USE_MAPPING_FOR_GT = 0xe801

Definition at line 19 of file CharHash.Hxx.

const PRIVATE_USE_MAPPING_FOR_LT = 0xe800

Definition at line 18 of file CharHash.Hxx.

const SPECIAL_CHAR_HASH_TABLE_SIZE = 97

Definition at line 16 of file CharHash.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/CodePage.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions

CodePage.Cxx File Reference

#include <pch.cxx>
#include <osv.hxx>
#include <codepage.hxx>

Go to the source code of this file.

Functions

ULONG LocaleToCodepage (LCID lcid)

Function Documentation

ULONG LocaleToCodepage ( LCID lcid )

Definition at line 29 of file CodePage.Cxx.

{
    const BUFFER_LENGTH = 10;
    WCHAR wcsCodePage[BUFFER_LENGTH];
    int cwc;

    if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
    {
        cwc = GetLocaleInfoW( lcid, LOCALE_IDEFAULTANSICODEPAGE, wcsCodePage, BUFFER_LENGTH );
    }
    else // win95
    {
        char *pszCodePage = new char[BUFFER_LENGTH*2];

        if ( pszCodePage == NULL )
        {
            cwc = 0;
            SetLastErrorEx( ERROR_INVALID_PARAMETER, SLE_ERROR );
        }
        else
        {
            cwc = GetLocaleInfoA( lcid,
                                  LOCALE_IDEFAULTANSICODEPAGE,
                                  pszCodePage,
                                  BUFFER_LENGTH );

            if ( cwc && mbstowcs( wcsCodePage, pszCodePage, cwc ) == -1 )
            {
                cwc = 0;
                SetLastErrorEx( ERROR_INVALID_PARAMETER, SLE_ERROR );
            }

            delete [] pszCodePage;
            pszCodePage = NULL;
        }
    }

    //
    // If error, return Ansi code page
    //
    if ( cwc == 0 )
    {
         htmlDebugOut(( DEB_ERROR, "GetLocaleInfoW for lcid %d returned %d\n", lcid, GetLastError() ));

         return CP_ACP;
    }

    return wcstoul( wcsCodePage, 0 , 10 );
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/CodePage.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions

CodePage.Hxx File Reference

Go to the source code of this file.

Functions

ULONG LocaleToCodepage (LCID lcid)

Function Documentation

ULONG LocaleToCodepage ( LCID lcid )

Definition at line 29 of file CodePage.Cxx.

{
    const BUFFER_LENGTH = 10;
    WCHAR wcsCodePage[BUFFER_LENGTH];
    int cwc;

    if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
    {
        cwc = GetLocaleInfoW( lcid, LOCALE_IDEFAULTANSICODEPAGE, wcsCodePage, BUFFER_LENGTH );
    }
    else // win95
    {
        char *pszCodePage = new char[BUFFER_LENGTH*2];

        if ( pszCodePage == NULL )
        {
            cwc = 0;
            SetLastErrorEx( ERROR_INVALID_PARAMETER, SLE_ERROR );
        }
        else
        {
            cwc = GetLocaleInfoA( lcid,
                                  LOCALE_IDEFAULTANSICODEPAGE,
                                  pszCodePage,
                                  BUFFER_LENGTH );

            if ( cwc && mbstowcs( wcsCodePage, pszCodePage, cwc ) == -1 )
            {
                cwc = 0;
                SetLastErrorEx( ERROR_INVALID_PARAMETER, SLE_ERROR );
            }

            delete [] pszCodePage;
            pszCodePage = NULL;
        }
    }

    //
    // If error, return Ansi code page
    //
    if ( cwc == 0 )
    {
         htmlDebugOut(( DEB_ERROR, "GetLocaleInfoW for lcid %d returned %d\n", lcid, GetLastError() ));

         return CP_ACP;
    }

    return wcstoul( wcsCodePage, 0 , 10 );
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Debug.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Defines

Debug.Hxx File Reference

Go to the source code of this file.

Defines

#define | DECLARE_DEBUG(comp)
#define | DECLARE_INFOLEVEL(comp)
#define | Win4Assert(x)

Define Documentation

#define DECLARE_DEBUG ( comp )

Definition at line 58 of file Debug.Hxx.

#define DECLARE_INFOLEVEL ( comp )

Definition at line 59 of file Debug.Hxx.

#define Win4Assert ( x )

Definition at line 57 of file Debug.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Except.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Typedefs | Functions

Except.Cxx File Reference

#include <pch.cxx>

Go to the source code of this file.

Typedefs

typedef LONG | NTSTATUS

Functions

SCODE | GetOleError (CException &e)
BOOL IsOleError (NTSTATUS sc)
void _cdecl | SystemExceptionTranslator (unsigned int uiWhat, struct _EXCEPTION_POINTERS *pexcept)

Typedef Documentation

typedef LONG NTSTATUS

Definition at line 14 of file Except.Cxx.

Function Documentation

SCODE GetOleError ( CException & e )

Definition at line 39 of file Except.Cxx.

{
    NTSTATUS scError = e.GetErrorCode();

    if (IsOleError(scError))
    {
        return scError;
    }
    else if ( STATUS_NO_MEMORY == scError )
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        return E_FAIL;
    }
}

BOOL IsOleError ( NTSTATUS sc ) [inline]

Definition at line 24 of file Except.Cxx.

{
    return ((sc & 0xFFF00000) == 0x80000000) ||
           (SUCCEEDED(sc) && (sc & 0xFFFFF000) != 0);
}

void _cdecl SystemExceptionTranslator | ( | unsigned int | uiWhat,
 |  | struct _EXCEPTION_POINTERS * | pexcept
 | ) |  |

Definition at line 57 of file Except.Cxx.

{
    throw CException( uiWhat ) ;
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Except.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Functions

Except.Hxx File Reference

Go to the source code of this file.

Classes

class | CException

Functions

SCODE | GetOleError (CException &e)
void _cdecl | SystemExceptionTranslator (unsigned int uiWhat, struct _EXCEPTION_POINTERS *pexcept)

Function Documentation

SCODE GetOleError ( CException & e )

Definition at line 39 of file Except.Cxx.

{
    NTSTATUS scError = e.GetErrorCode();

    if (IsOleError(scError))
    {
        return scError;
    }
    else if ( STATUS_NO_MEMORY == scError )
    {
        return E_OUTOFMEMORY;
    }
    else
    {
        return E_FAIL;
    }
}

void _cdecl SystemExceptionTranslator | ( | unsigned int | uiWhat,
 |  | struct _EXCEPTION_POINTERS * | pexcept
 | ) |  |

Definition at line 57 of file Except.Cxx.

{
    throw CException( uiWhat ) ;
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/FiltReg.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Defines | Functions

FiltReg.Hxx File Reference

#include <olectl.h>

Go to the source code of this file.

Classes

struct | SClassEntry
struct | SFilterEntry
struct | SHandlerEntry

Defines

#define | DEFINE_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_DLLREGISTERFILTER2(Handler, Filter, aClasses) DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )
#define | DEFINE_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \
#define | DEFINE_REGISTERFILTER2(Name, Handler, Filter, aClasses)
#define | DEFINE_REGISTERFILTERBASE(Name, Handler, Filter, aClasses, fBlastExistingPersistentHandler)
#define | DEFINE_SOFT_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_SOFT_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Functions

long | AddThreadingModel (WCHAR const *wszClsId, WCHAR const *wszThreadingModel)
long | BuildKeyValues (WCHAR const *const *awszKeyValues, unsigned cKeyValues)
long | DestroyKeyValues (WCHAR const *const *awszKeyValues, int cKeyValues)
long | RegisterAClass (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszShortName=0, BOOL fAppendOnly=FALSE)
long | RegisterAClassAndExt (SClassEntry const &Class, WCHAR const *pwszPHandler, BOOL fAppendOnly=FALSE, BOOL fBlastExistingPersistentHandler=TRUE)
long | RegisterACLSID (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszClassId=0, BOOL fAppendOnly=FALSE, BOOL fAppendDesc=TRUE)
long | RegisterAFilter (SFilterEntry const &Filter)
long | RegisterAHandler (SHandlerEntry const &Handler)
long | RemoveAClass (WCHAR *pwszClassId)
long | RemoveAClassName (WCHAR *pwszClass)
long | UnRegisterAFilter (SFilterEntry const &Filter)
long | UnRegisterAHandler (SHandlerEntry const &Handler)
long | UnRegisterAnExt (SClassEntry const &Class)

Define Documentation

#define DEFINE_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1573 of file FiltReg.Hxx.

#define DEFINE_DLLREGISTERFILTER2 | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )

Definition at line 1658 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \

Definition at line 1569 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTER2 | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses
 | ) |

Definition at line 1587 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTERBASE | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses,
 |  | fBlastExistingPersistentHandler
 | ) |

Definition at line 1500 of file FiltReg.Hxx.

#define DEFINE_SOFT_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1579 of file FiltReg.Hxx.

#define DEFINE_SOFT_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Definition at line 1576 of file FiltReg.Hxx.

Function Documentation

long AddThreadingModel | ( | WCHAR const * | wszClsId,
 |  | WCHAR const * | wszThreadingModel |
 | ) |  |  | [inline]

Definition at line 194 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, wszClsId );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, L"InprocServer32" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                             wcTemp,               // Sub key
                             0,                    // Reserved
                             KEY_ALL_ACCESS,       // Access
                             &hKey );              // Handle

    if ( ERROR_SUCCESS != dwError )
        return dwError;

    if ( 0 != wszThreadingModel )
        dwError = RegSetValueExW( hKey,                   // Key
                                  L"ThreadingModel",      // Name
                                  0,                      // Reserved
                                  REG_SZ,                 // Type
                                  (BYTE *) wszThreadingModel,  // Value
                                  (DWORD) ( (wcslen(wszThreadingModel) + 1) * sizeof WCHAR ) );
    else
        RegDeleteValueW( hKey,                   // Key
                         L"ThreadingModel" );    // Name

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long BuildKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | unsigned | cKeyValues |
 | ) |  |  | [inline]

Definition at line 121 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    do
    {
        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        DWORD  dwDisposition;

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;

        if ( 0 != awszKeyValues[i] )
            dwError = RegSetValueExW( hKey,                     // Key
                                      0,                        // Name
                                      0,                        // Reserved
                                      REG_SZ,                   // Type
                                      (BYTE *)awszKeyValues[i], // Value
                                      (DWORD) ( (1 + wcslen(awszKeyValues[i]) ) * sizeof(WCHAR) ) );

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;
    }
    while ( i < cKeyValues );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long DestroyKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | int | cKeyValues |
 | ) |  |  | [inline]

Definition at line 248 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    //
    // Build path to deepest component
    //

    wcscpy( wcTemp, L"CLSID" );
    int i = 0;

    do
    {
        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        i += 2;
    }
    while ( i < cKeyValues );

    //
    // Remove components in reverse order
    //

    long dwError = ERROR_SUCCESS;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;

    unsigned cc = (unsigned) wcslen( wcTemp );

    for ( i -= 2; i >= 0; i -= 2 )
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 wcTemp,               // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        #if 0  // Values deleted by RegDeleteKeyW
        //
        // Delete value, if there is one.
        //

        if ( 0 != awszKeyValues[i+1] )
            dwError = RegDeleteValueW( hKey, 0 );

        if ( ERROR_SUCCESS != dwError )
            break;
        #endif // 0

        //
        // Delete subkey, if there is one.
        //

        if ( i+2 < cKeyValues )
            dwError = RegDeleteKeyW( hKey, awszKeyValues[i+2] );

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Close key and truncate string to next component.
        //

        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        cc -= (unsigned) wcslen( awszKeyValues[i] );
        cc--;

        wcTemp[cc] = 0;
    }

    //
    // Remove the final top key
    //

    if ( ERROR_SUCCESS == dwError )
    {
        do
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key -- "CLSID"
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Delete subkey
            //

            dwError = RegDeleteKeyW( hKey, awszKeyValues[0] );

        } while ( FALSE );
    }

    return dwError;
}

long RegisterAClass | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszShortName = 0,
 |  | BOOL | fAppendOnly = FALSE |
 | ) |  |  | [inline]

Definition at line 552 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    if ( 0 == pwszShortName )
    {
        if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, Class.pwszShortName );
    }
    else
    {
        if ( wcslen( pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, pwszShortName );
    }

    do
    {
        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        //
        // Here, wcTemp contains the key name for the named entry (ex: Word.Document.8)
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        //
        // If needed, write the description, but only for non-overrides.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszShortName )
        {
            dwError = RegSetValueExW( hKey,                          // Key
                                      0,                             // Name
                                      0,                             // Reserved
                                      REG_SZ,                        // Type
                                      (BYTE *)Class.pwszDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszDescription) ) * sizeof(WCHAR) ) );

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Write or read ClassId
        //

        wcscat( wcTemp, L"\\CLSID" );

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        dwSize = sizeof(wcTemp);

        dwError = RegQueryValueExW( hKey,                // Key handle
                                    0,                   // Name
                                    0,                   // Reserved
                                    &dwType,             // Datatype
                                    (BYTE *)(wcTemp),    // Data returned here
                                    &dwSize );           // Size of data

        if ( ERROR_SUCCESS != dwError )
        {
            if ( ERROR_FILE_NOT_FOUND == dwError )
            {
                //
                // Don't set a class id in append mode.
                //

                if ( fAppendOnly )
                {
                    dwError = ERROR_SUCCESS;
                    break;
                }

                dwError = RegSetValueExW( hKey,                          // Key
                                          0,                             // Name
                                          0,                             // Reserved
                                          REG_SZ,                        // Type
                                          (BYTE *)Class.pwszClassId,     // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszClassId) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0; // Default to class from Class structure

                if ( ERROR_SUCCESS != dwError )
                    break;
            }
            else
                break;
        }
        else
        {
            if ( REG_SZ != dwType )
                dwError = E_FAIL;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp contains the {class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        dwError = RegisterACLSID( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAClassAndExt | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fBlastExistingPersistentHandler = TRUE |
 | ) |  |  | [inline]

Definition at line 371 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError = NO_ERROR;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    do
    {
        //
        // First, the optional extension entry
        //

        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        if ( 0 == Class.pwszExt )
        {
            //
            // Build up named entry
            //

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );
        }
        else
        {
            if ( wcslen( Class.pwszExt ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszExt );

            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write or read class association
            //

            BOOL fSetValue = TRUE;

            if ( REG_OPENED_EXISTING_KEY == dwDisposition )
            {
                dwSize = sizeof(wcTemp);

                dwError = RegQueryValueExW( hKey,            // Key handle
                                            0,               // Name
                                            0,               // Reserved
                                            &dwType,         // Datatype
                                            (BYTE *)wcTemp,  // Data returned here
                                            &dwSize );       // Size of data

                if ( ERROR_SUCCESS == dwError )
                {
                    fSetValue = FALSE;

                    if ( REG_SZ != dwType )
                        dwError = E_FAIL;
                }
                else if ( ERROR_FILE_NOT_FOUND == dwError )
                {
                    //
                    // This is ok, but we need to remember that the
                    // combination of wcTemp[0] == 0 && fAppendOnly means
                    // don't try to register the class.
                    //

                    wcTemp[0] = 0;
                    dwError = ERROR_SUCCESS;
                }
            }

            if ( fSetValue && !fAppendOnly )
            {
                dwError = RegSetValueExW( hKey,                        // Key
                                          0,                           // Name
                                          0,                           // Reserved
                                          REG_SZ,                      // Type
                                          (BYTE *)Class.pwszShortName, // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszShortName) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0;
            }

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write the persistent handler key
            //

            HKEY hKey2 = (HKEY)INVALID_HANDLE_VALUE;

            dwError = RegCreateKeyExW( hKey,                 // Root
                                       L"PersistentHandler", // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey2,               // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;

            if ( fBlastExistingPersistentHandler ||
                 ( REG_OPENED_EXISTING_KEY != dwDisposition ) )
                dwError = RegSetValueExW( hKey2,                 // Key
                                          0,                     // Name
                                          0,                     // Reserved
                                          REG_SZ,                // Type
                                          (BYTE *)pwszPHandler,  // Value
                                          (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

            if ( (HKEY)INVALID_HANDLE_VALUE != hKey2 )
            {
                RegCloseKey( hKey2 );
                hKey2 = (HKEY)INVALID_HANDLE_VALUE;
            }
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp may contain the key name for the named entry (ex: Word.Document.8)
        //

        if ( wcTemp[0] != 0 || !fAppendOnly )
            dwError = RegisterAClass( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterACLSID | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszClassId = 0,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fAppendDesc = TRUE |
 | ) |  |  | [inline]

Definition at line 787 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    wcscpy( wcTemp, L"CLSID\\" );

    if ( 0 == pwszClassId )
        wcscat( wcTemp, Class.pwszClassId );
    else
        wcscat( wcTemp, pwszClassId );

    do
    {
        DWORD dwDisposition;

        //
        // Here, wcTemp contains the CLSID\{class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // If needed, write the description, but not for override class.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszClassId && fAppendDesc )
        {
            dwError = RegSetValueExW( hKey,                                 // Key
                                      0,                                    // Name
                                      0,                                    // Reserved
                                      REG_SZ,                               // Type
                                      (BYTE *)Class.pwszClassIdDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszClassIdDescription) ) * sizeof(WCHAR) ) );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Always write persistent handler.
        //

        wcscat( wcTemp, L"\\PersistentHandler" );

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegSetValueExW( hKey,                  // Key
                                  0,                     // Name
                                  0,                     // Reserved
                                  REG_SZ,                // Type
                                  (BYTE *)pwszPHandler,  // Value
                                  (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1234 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    long retVal = BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    if ( ERROR_SUCCESS == retVal )
        retVal = AddThreadingModel( Filter.pwszClassId, Filter.pwszThreadingModel );

    return retVal;
}

long RegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1210 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    return BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long RemoveAClass ( WCHAR * pwszClassId ) [inline]

Definition at line 1059 of file FiltReg.Hxx.

{
    //
    // First, delete class entry.
    //

    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors
    long dwEnum = ERROR_SUCCESS;    // For enumerator

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  L"CLSID",             // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClassId );

        RegCloseKey( hKeyEnum );

        long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                      0,                    // Sub key
                                      0,                    // Reserved
                                      KEY_ALL_ACCESS,       // Access
                                      &hKeyEnum );          // Handle
    }

    if ( ERROR_SUCCESS == dwError )
    {
        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                wcscat( wcTemp, L"\\CLSID" );

                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClassId ) )
                    {
                        wcTemp[ wcslen(wcTemp) - wcslen( L"\\CLSID" ) ] = 0;

                        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                                 wcTemp,               // Sub key
                                                 0,                    // Reserved
                                                 KEY_ALL_ACCESS,       // Access
                                                 &hKey );              // Handle

                        if ( ERROR_SUCCESS == dwError )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKey, L"CLSID" );
                            else
                                RegDeleteKeyW( hKey, L"CLSID" );

                            dwIndex = 0;
                        }

                        //
                        // If there are no more entries, then the class name can be deleted
                        //

                        dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);

                        long dw2 = RegEnumKeyExW( hKey,               // Handle of key
                                                  0,                  // Index of registry subkey
                                                  wcTemp,             // Buffer for name
                                                  &dwSize,            // Size of buffer / key
                                                  0,                  // Reserved
                                                  0,                  // Class (unused)
                                                  0,                  // Class size (unused)
                                                  &ftUnused );        // Filetime (unused)

                        RegCloseKey( hKey );

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                            RemoveAClassName( wcTemp );
                    }
                }
                else
                    dwError = ERROR_SUCCESS;  // Just didn't have CLSID
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long RemoveAClassName ( WCHAR * pwszClass ) [inline]

Definition at line 923 of file FiltReg.Hxx.

{
    //
    // First, delete class name entry.
    //

    long dwEnum = ERROR_SUCCESS;    // The enumerator
    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  0,                    // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClass );

        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClass ) )
                    {
                        //
                        // Always delete the value
                        //

                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteValueW( hKey, 0 );
                        else
                            RegDeleteValueW( hKey, 0 );

                        //
                        // Any other key(s)?
                        //

                        dwSize = sizeof(wcTemp) / sizeof wcTemp[0];

                        DWORD dw2 = RegEnumKeyExW( hKey,                   // Handle of key
                                                   0,                      // Index of registry subkey
                                                   wcTemp,                 // Buffer for name
                                                   &dwSize,                // Size of buffer / key
                                                   0,                      // Reserved
                                                   0,                      // Class (unused)
                                                   0,                      // Class size (unused)
                                                   &ftUnused );            // Filetime (unused)

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKeyEnum, wcTemp );
                            else
                                RegDeleteKeyW( hKeyEnum, wcTemp );

                            dwIndex = 0;
                        }

                    }
                    else
                        dwError = ERROR_SUCCESS;  // Just didn't have a null key (or no match)
                }
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1470 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    return DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long UnRegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1260 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    //
    // dwIgnore is used to record non-fatal errors
    //

    long dwIgnore = DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    long dwError = ERROR_SUCCESS;

    //
    // Now, enumerate all classes and delete any persistent handler entries.
    //

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwEnum = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 L"CLSID",              // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKeyEnum );          // Handle

    DWORD dwIndex = 0;

    while ( ERROR_SUCCESS == dwEnum )
    {
        WCHAR wcTemp[MAX_PATH];

        wcscpy( wcTemp, L"CLSID\\" );
        unsigned cc = (unsigned) wcslen( wcTemp );

        DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]) - cc;
        FILETIME ftUnused;

        dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                dwIndex,                // Index of registry subkey
                                wcTemp + cc,            // Buffer for name
                                &dwSize,                // Size of buffer / key
                                0,                      // Reserved
                                0,                      // Class (unused)
                                0,                      // Class size (unused)
                                &ftUnused );            // Filetime (unused)

        dwIndex++;

        //
        // Does the key have a persistent handler?
        //

        if ( ERROR_SUCCESS == dwEnum )
        {
            wcscat( wcTemp, L"\\PersistentHandler" );

            HKEY hKey;

            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS == dwError )
            {
                //
                // Is this the persistent handler we're looking for?
                //

                WCHAR wcTemp2[MAX_PATH];
                DWORD dwType;

                dwSize = sizeof(wcTemp2);

                dwError = RegQueryValueExW( hKey,                // Key handle
                                            0,                   // Name
                                            0,                   // Reserved
                                            &dwType,             // Datatype
                                            (BYTE *)wcTemp2,     // Data returned here
                                            &dwSize );           // Size of data

                RegCloseKey( hKey );

                if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, Handler.pwszClassId ) )
                {
                    wcTemp[ wcslen(wcTemp) - wcslen( L"\\PersistentHandler" ) ] = 0;

                    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                             wcTemp,               // Sub key
                                             0,                    // Reserved
                                             KEY_ALL_ACCESS,       // Access
                                             &hKey );              // Handle

                    if ( ERROR_SUCCESS == dwError )
                    {
                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteKeyW( hKey, L"PersistentHandler" );
                        else
                            RegDeleteKeyW( hKey, L"PersistentHandler" );

                        dwIndex = 0; // Start over again
                    }

                    //
                    // If that was the *only* entry under the clsid, then the class can be
                    // removed.
                    //

                    dwSize = sizeof(wcTemp2)/sizeof(wcTemp2[0]);

                    long dw2 = RegEnumKeyExW( hKey,             // Handle of key
                                              0,                // Index of registry subkey
                                              wcTemp2,          // Buffer for name
                                              &dwSize,          // Size of buffer / key
                                              0,                // Reserved
                                              0,                // Class (unused)
                                              0,                // Class size (unused)
                                              &ftUnused );      // Filetime (unused)

                    RegCloseKey( hKey );

                    if ( ERROR_NO_MORE_ITEMS == dw2 )
                        RemoveAClass( wcTemp + wcslen( L"CLSID\\" ) );
                }
                else
                {
                    //
                    // Didn't have persistent handler null key.  Odd but not fatal.
                    // Or, key didn't match target.
                    //

                    dwIgnore = dwError;
                    dwError = ERROR_SUCCESS;
                }

            }
            else
                dwError = ERROR_SUCCESS;  // Just didn't have persistent handler
        }
    }

    if ( (HKEY)INVALID_HANDLE_VALUE != hKeyEnum )
        RegCloseKey( hKeyEnum );

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAnExt ( SClassEntry const & Class ) [inline]

Definition at line 1429 of file FiltReg.Hxx.

{
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    DWORD dwError;

    do
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 Class.pwszExt,        // Sub key -- "CLSID"
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegDeleteKeyW( hKey, L"PersistentHandler" );

    } while ( FALSE );

    if ( INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Global.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Defines | Enumerations | Functions

Global.Hxx File Reference

#include <debug.hxx>
#include <except.hxx>

Go to the source code of this file.

Defines

#define | htmlDebugOut(x)
#define | newk(Tag, pCounter) new

Enumerations

enum | HtmlNew { onDefault = 0x1e }

Functions

DECLARE_DEBUG (html)

Define Documentation

#define htmlDebugOut ( x )

Definition at line 25 of file Global.Hxx.

#define newk | ( | Tag,
 |  | pCounter |
 | ) |  | new

Definition at line 38 of file Global.Hxx.

Enumeration Type Documentation

enum HtmlNew
Enumerator:
onDefault

Definition at line 34 of file Global.Hxx.

             {
    onDefault = 0x1e,   // Just to force a different operator new signature
};

Function Documentation

DECLARE_DEBUG ( html )
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlElem.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

HtmlElem.Cxx File Reference

#include <pch.cxx>
#include <htmlelem.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlElem.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Variables

HtmlElem.Hxx File Reference

#include <htmlfilt.hxx>
#include <serstrm.hxx>

Go to the source code of this file.

Classes

class | CHtmlElement

Variables

const | MAX_PROPSPEC_STRING_LENGTH = 128
const | TEMP_BUFFER_SIZE = 50

Variable Documentation

const MAX_PROPSPEC_STRING_LENGTH = 128

Definition at line 18 of file HtmlElem.Hxx.

const TEMP_BUFFER_SIZE = 50

Definition at line 17 of file HtmlElem.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlFilt.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

HtmlFilt.Cxx File Reference

#include <pch.cxx>
#include <eh.h>
#include <htmlfilt.hxx>
#include <textelem.hxx>
#include <proptag.hxx>
#include <anchor.hxx>
#include <inputtag.hxx>
#include <start.hxx>
#include <titletag.hxx>
#include <imagetag.hxx>
#include <metatag.hxx>
#include <scriptag.hxx>
#include <htmlguid.hxx>
#include <ntquery.h>
#include <limits.h>
#include <regacc32.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlFilt.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

HtmlFilt.Hxx File Reference

#include <htmliflt.hxx>
#include <bag.hxx>

Go to the source code of this file.

Classes

class CHtmlIFilter
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlGuid.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Variables

HtmlGuid.Cxx File Reference

#include <pch.cxx>
#include <htmlguid.hxx>
#include <ntquery.h>

Go to the source code of this file.

Variables

GUID | CLSID_HtmlInformation
GUID | CLSID_Storage = PSGUID_STORAGE
GUID | CLSID_SummaryInformation

Variable Documentation

GUID CLSID_HtmlInformation
Initial value:
 {
    0x70eb7a10,
    0x55d9,
    0x11cf,
    { 0xb7, 0x5b, 0x00, 0xaa, 0x00, 0x51, 0xfe, 0x20 }
}

Definition at line 26 of file HtmlGuid.Cxx.

GUID CLSID_Storage = PSGUID_STORAGE

Definition at line 17 of file HtmlGuid.Cxx.

GUID CLSID_SummaryInformation
Initial value:
 {
    0xF29F85E0,
    0x4FF9,
    0x1068,
    { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 }
}

Definition at line 19 of file HtmlGuid.Cxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlGuid.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Variables

HtmlGuid.Hxx File Reference

Go to the source code of this file.

Variables

GUID | CLSID_HtmlInformation
GUID | CLSID_Storage
GUID | CLSID_SummaryInformation
const | PID_HEADING_1 = 3
const | PID_HEADING_2 = 4
const | PID_HEADING_3 = 5
const | PID_HEADING_4 = 6
const | PID_HEADING_5 = 7
const | PID_HEADING_6 = 8
const | PID_HREF = 2
const | PID_TITLE = 2

Variable Documentation

GUID CLSID_HtmlInformation

Definition at line 26 of file HtmlGuid.Cxx.

GUID CLSID_Storage

Definition at line 17 of file HtmlGuid.Cxx.

GUID CLSID_SummaryInformation

Definition at line 19 of file HtmlGuid.Cxx.

const PID_HEADING_1 = 3

Definition at line 21 of file HtmlGuid.Hxx.

const PID_HEADING_2 = 4

Definition at line 22 of file HtmlGuid.Hxx.

const PID_HEADING_3 = 5

Definition at line 23 of file HtmlGuid.Hxx.

const PID_HEADING_4 = 6

Definition at line 24 of file HtmlGuid.Hxx.

const PID_HEADING_5 = 7

Definition at line 25 of file HtmlGuid.Hxx.

const PID_HEADING_6 = 8

Definition at line 26 of file HtmlGuid.Hxx.

const PID_HREF = 2

Definition at line 20 of file HtmlGuid.Hxx.

const PID_TITLE = 2

Definition at line 17 of file HtmlGuid.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlIFlt.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions | Variables

HtmlIFlt.Cxx File Reference

#include <pch.cxx>
#include <eh.h>
#include <htmliflt.hxx>
#include <serstrm.hxx>
#include <bag.hxx>
#include <charhash.hxx>
#include <htmlfilt.hxx>

Go to the source code of this file.

Functions

SCODE STDMETHODCALLTYPE | DllCanUnloadNow (void)
SCODE STDMETHODCALLTYPE | DllGetClassObject (REFCLSID cid, REFIID iid, void **ppvObj)

Variables

GUID | CLSID_HtmlClass
GUID | CLSID_HtmlIFilter
long | gulcInstances = 0

Function Documentation

SCODE STDMETHODCALLTYPE DllCanUnloadNow ( void )

Definition at line 370 of file HtmlIFlt.Cxx.

{
    if ( 0 == gulcInstances )
        return( S_OK );
    else
        return( S_FALSE );
}

SCODE STDMETHODCALLTYPE DllGetClassObject | ( | REFCLSID | cid,
 |  | REFIID | iid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 322 of file HtmlIFlt.Cxx.

{
    IUnknown *  pResult = 0;
    SCODE       sc      = S_OK;

    _se_translator_function tf = _set_se_translator( SystemExceptionTranslator );

    try
    {
        if ( cid == CLSID_HtmlIFilter || cid == CLSID_HtmlClass )
            pResult = (IUnknown *) newk(mtNewX, NULL) CHtmlIFilterCF;
        else
            sc = E_NOINTERFACE;

        if ( pResult )
        {
            sc = pResult->QueryInterface( iid, ppvObj );
            pResult->Release();     // Release extra refcount from QueryInterface
        }
    }
    catch(CException& e)
    {
        if ( pResult )
            pResult->Release();

        htmlDebugOut(( DEB_ERROR,
                       "Exception 0x%x caught in CHtmlIFilterCF::CreateInstance",
                       e.GetErrorCode() ));
        sc = GetOleError( e );
    }

    _set_se_translator( tf );

    return (sc);
}

Variable Documentation

GUID CLSID_HtmlClass
Initial value:
 {
    0x6A7A7550,
    0x4535,
    0x11CF,
    { 0xB9, 0x52, 0x00, 0xAA, 0x00, 0x51, 0xFE, 0x20 }
}

Definition at line 42 of file HtmlIFlt.Cxx.

GUID CLSID_HtmlIFilter
Initial value:
 {
    0xE0CA5340,
    0x4534,
    0x11CF,
    { 0xB9, 0x52, 0x00, 0xAA, 0x00, 0x51, 0xFE, 0x20 }
}

Definition at line 27 of file HtmlIFlt.Cxx.

long gulcInstances = 0

Definition at line 25 of file HtmlIFlt.Cxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlIFlt.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Functions | Variables

HtmlIFlt.Hxx File Reference

Go to the source code of this file.

Classes

class | CHtmlIFilterBase
class | CHtmlIFilterCF

Functions

SCODE STDMETHODCALLTYPE | DllCanUnloadNow (void)
SCODE STDMETHODCALLTYPE | DllGetClassObject (REFCLSID cid, REFIID iid, void **ppvObj)

Variables

GUID | CLSID_HtmlIFilter

Function Documentation

SCODE STDMETHODCALLTYPE DllCanUnloadNow ( void )

Definition at line 53 of file ComSpyAudit.Cpp.

{
  return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

SCODE STDMETHODCALLTYPE DllGetClassObject | ( | REFCLSID | cid,
 |  | REFIID | iid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 1064 of file HtmlProp.Cxx.

{
    IUnknown * pUnk = 0;

    if ( CLSID_HtmlPropIFilter == cid ||
         CLSID_HtmlPropClass   == cid )
    {
        pUnk = new HtmlPropIFilterCF;

        if ( 0 == pUnk )
            return E_OUTOFMEMORY;
    }
    else
    {
        *ppvObj = 0;
        return E_NOINTERFACE;
    }

    SCODE sc = pUnk->QueryInterface( iid, ppvObj );

    pUnk->Release();

    return sc;
} //DllGetClassObject

Variable Documentation

GUID CLSID_HtmlIFilter

Definition at line 14 of file HtmlIFlt.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlScan.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

HtmlScan.Cxx File Reference

#include <pch.cxx>
#include <htmlguid.hxx>
#include <charhash.hxx>
#include <htmlfilt.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlScan.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Enumerations | Variables

HtmlScan.Hxx File Reference

#include <propspec.hxx>
#include <serstrm.hxx>

Go to the source code of this file.

Classes

class | CHtmlScanner
class | CToken

Enumerations

enum HtmlTokenType {
StartOfFileToken, EofToken, TextToken, BreakToken,
TitleToken, Heading1Token, Heading2Token, Heading3Token,
Heading4Token, Heading5Token, Heading6Token, AnchorToken,
InputToken, ImageToken, MetaToken, ScriptToken,
CommentToken, GenericToken
}

Variables

const | TAG_BUFFER_SIZE = 40

Enumeration Type Documentation

enum HtmlTokenType
Enumerator:
StartOfFileToken
EofToken
TextToken
BreakToken
TitleToken
Heading1Token
Heading2Token
Heading3Token
Heading4Token
Heading5Token
Heading6Token
AnchorToken
InputToken
ImageToken
MetaToken
ScriptToken
CommentToken
GenericToken

Definition at line 24 of file HtmlScan.Hxx.

{
    StartOfFileToken,   // Start of file
    EofToken,           // End of file
    TextToken,          // Vanilla text
    BreakToken,         // Forced line break
    TitleToken,         // Title tag
    Heading1Token,      // H1 tag
    Heading2Token,      // H2 tag
    Heading3Token,      // H3 tag
    Heading4Token,      // H4 tag
    Heading5Token,      // H5 tag
    Heading6Token,      // H6 tag
    AnchorToken,        // Anchor tag
    InputToken,         // Input tag
    ImageToken,         // Image tag
    MetaToken,          // Meta tag
    ScriptToken,        // Script tag
    CommentToken,       // Comment tag, i.e. !-- tag
    GenericToken,       // All other tags
};

Variable Documentation

const TAG_BUFFER_SIZE = 40

Definition at line 19 of file HtmlScan.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/ImageTag.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

ImageTag.Cxx File Reference

#include <pch.cxx>
#include <imagetag.hxx>
#include <htmlguid.hxx>
#include <ntquery.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/ImageTag.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

ImageTag.Hxx File Reference

#include <htmlelem.hxx>

Go to the source code of this file.

Classes

class CImageTag
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/InpStrm.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

InpStrm.Cxx File Reference

#include <pch.cxx>
#include <htmlfilt.hxx>
#include <codepage.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/InpStrm.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Variables

InpStrm.Hxx File Reference

#include <mmstrm.hxx>
#include <mmscbuf.hxx>
#include <stdio.h>

Go to the source code of this file.

Classes

class | CMemoryMappedInputStream

Variables

const | HTML_FILTER_CHUNK_SIZE = 0x10000
const | TRANSLATED_CHAR_BUFFER_LENGTH = 2048

Variable Documentation

const HTML_FILTER_CHUNK_SIZE = 0x10000

Definition at line 21 of file InpStrm.Hxx.

const TRANSLATED_CHAR_BUFFER_LENGTH = 2048

Definition at line 22 of file InpStrm.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/InputTag.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

InputTag.Cxx File Reference

#include <pch.cxx>
#include <inputtag.hxx>
#include <htmlguid.hxx>
#include <ntquery.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/InputTag.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

InputTag.Hxx File Reference

#include <htmlelem.hxx>

Go to the source code of this file.

Classes

class CInputTag
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Main.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Defines | Functions | Variables

Main.Cxx File Reference

#include <pch.cxx>
#include <process.h>
#include <osv.hxx>

Go to the source code of this file.

Defines

#define | _DECL_DLLMAIN 1
#define | UNINITIALIZED -1

Functions

BOOL WINAPI | DllMain (HANDLE hInstance, DWORD dwReason, void *lpReserved)
void | InitOSVersion ()

Variables

int | g_nOSWinNT = UNINITIALIZED

Define Documentation

#define _DECL_DLLMAIN 1

Definition at line 14 of file Main.Cxx.

#define UNINITIALIZED -1

Definition at line 20 of file Main.Cxx.

Function Documentation

BOOL WINAPI DllMain | ( | HANDLE | hInstance,
 |  | DWORD | dwReason,
 |  | void * | lpReserved
 | ) |  |

Definition at line 57 of file Main.Cxx.

{
    if ( DLL_PROCESS_ATTACH == dwReason )
    {
        DisableThreadLibraryCalls( (HINSTANCE)hInstance );

        InitOSVersion();
    }

    return TRUE;
}

void InitOSVersion ( )

Definition at line 31 of file Main.Cxx.

{
    if ( g_nOSWinNT == UNINITIALIZED )
    {
        OSVERSIONINFOA OSVersionInfo;
        OSVersionInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFOA );

        if ( GetVersionExA( &OSVersionInfo ) )
        {
            g_nOSWinNT = OSVersionInfo.dwPlatformId;
        }
    }
}

Variable Documentation

int g_nOSWinNT = UNINITIALIZED

Definition at line 21 of file Main.Cxx.

Generated on Wed Nov 13 2024 16:53:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MetaTag.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

MetaTag.Cxx File Reference

#include <pch.cxx>
#include <metatag.hxx>
#include <htmlguid.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MetaTag.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Enumerations

MetaTag.Hxx File Reference

#include <htmlelem.hxx>

Go to the source code of this file.

Classes

class | CMetaTag

Enumerations

enum | MetaTagState { FilteringValue, NoMoreValue }

Enumeration Type Documentation

enum MetaTagState
Enumerator:
FilteringValue
NoMoreValue

Definition at line 16 of file MetaTag.Hxx.

{
    FilteringValue,
    NoMoreValue,
};

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMbuf.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

MMbuf.Cxx File Reference

#include <pch.cxx>
#include <pmmstrm.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMScBuf.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

MMScBuf.Cxx File Reference

#include <pch.cxx>
#include "mmscbuf.hxx"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMScBuf.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

MMScBuf.Hxx File Reference

#include <pmmstrm.hxx>

Go to the source code of this file.

Classes

class CMmStreamConsecBuf
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMStrm.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions

MMStrm.Cxx File Reference

#include <pch.cxx>
#include <mmstrm.hxx>
#include <osv.hxx>

Go to the source code of this file.

Functions

BOOL IsCreateExisting (ULONG Error, ULONG modeAccess, ULONG modeCreate)

Function Documentation

BOOL IsCreateExisting | ( | ULONG | Error,
 |  | ULONG | modeAccess,
 |  | ULONG | modeCreate
 | ) |  |

Definition at line 253 of file MMStrm.Cxx.

{
    if ( (Error == ERROR_ALREADY_EXISTS || Error == ERROR_FILE_EXISTS) &&
         (modeAccess & GENERIC_WRITE) &&
         (modeCreate & CREATE_NEW) )
    {
       return TRUE;
    }
    else
    {
        return FALSE;
    }
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMStrm.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

MMStrm.Hxx File Reference

#include <pmmstrm.hxx>

Go to the source code of this file.

Classes

class CMmStream
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/osv.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions | Variables

osv.Hxx File Reference

Go to the source code of this file.

Functions

DWORD GetOSVersion ()
void | InitOSVersion ()

Variables

int | g_nOSWinNT

Function Documentation

DWORD GetOSVersion ( ) [inline]

Definition at line 18 of file osv.Hxx.

{
    return g_nOSWinNT;
}

void InitOSVersion ( )

Definition at line 31 of file Main.Cxx.

{
    if ( g_nOSWinNT == UNINITIALIZED )
    {
        OSVERSIONINFOA OSVersionInfo;
        OSVersionInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFOA );

        if ( GetVersionExA( &OSVersionInfo ) )
        {
            g_nOSWinNT = OSVersionInfo.dwPlatformId;
        }
    }
}

Variable Documentation

int g_nOSWinNT

Definition at line 21 of file Main.Cxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Pch.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

Pch.Cxx File Reference

#include <windows.h>
#include <filter.h>
#include <global.hxx>
#include <filterr.h>
#include <htmlscan.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PMMStrm.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Functions | Variables

PMMStrm.Hxx File Reference

Go to the source code of this file.

Classes

class | CMmStreamBuf
class | PMmStream
class | SMmStream

Functions

ULONG | CommonPageRound (ULONG cb)
void | CommonPageRound (ULONG &cbLow, ULONG &cbHigh)
ULONG | CommonPageTrunc (ULONG cb)
LONGLONG | llfromuls (IN const ULONG &ulLowPart, IN const ULONG &ulHighPart)

Variables

const ULONG | COMMON_PAGE_SIZE = 0x10000L

Function Documentation

ULONG CommonPageRound ( ULONG cb ) [inline]

Definition at line 32 of file PMMStrm.Hxx.

{
    return ( cb + (COMMON_PAGE_SIZE-1) ) & ~(COMMON_PAGE_SIZE-1);
}

void CommonPageRound | ( | ULONG & | cbLow,
 |  | ULONG & | cbHigh |
 | ) |  |  | [inline]

Definition at line 53 of file PMMStrm.Hxx.

{
    if (cbLow > ((0xffffffff & ~(COMMON_PAGE_SIZE-1)) + 1))
    {
        cbLow = 0;
        cbHigh++;
    }
    else
    {
        cbLow = (cbLow + (COMMON_PAGE_SIZE-1) ) & ~(COMMON_PAGE_SIZE-1);
    }
}

ULONG CommonPageTrunc ( ULONG cb ) [inline]

Definition at line 37 of file PMMStrm.Hxx.

{
    return( cb & ~(COMMON_PAGE_SIZE-1));
}

LONGLONG llfromuls | ( | IN const ULONG & | ulLowPart,
 |  | IN const ULONG & | ulHighPart |
 | ) |  |  | [inline]

Definition at line 68 of file PMMStrm.Hxx.

{
    LARGE_INTEGER li = {ulLowPart, ulHighPart};
    return li.QuadPart;

}

Variable Documentation

const ULONG COMMON_PAGE_SIZE = 0x10000L

Definition at line 20 of file PMMStrm.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PropSpec.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions

PropSpec.Cxx File Reference

#include <pch.cxx>
#include <propspec.hxx>

Go to the source code of this file.

Functions

void * operator new (size_t size, void *p)

Function Documentation

void* operator new | ( | size_t | size,
 |  | void * | p |
 | ) |  |  | [inline]

Definition at line 103 of file PropSpec.Cxx.

{
    return( p );
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PropSpec.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

PropSpec.Hxx File Reference

#include <windows.h>
#include <ole2.h>

Go to the source code of this file.

Classes

class CFullPropSpec
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PropTag.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

PropTag.Cxx File Reference

#include <pch.cxx>
#include <proptag.hxx>
#include <htmlguid.hxx>
#include <ntquery.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PropTag.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Enumerations | Variables

PropTag.Hxx File Reference

#include <htmlelem.hxx>
#include <htmlguid.hxx>

Go to the source code of this file.

Classes

class | CPropertyTag

Enumerations

enum PropTagState {
FilteringContent, NoMoreContent, FilteringProperty, FilteringPropertyButContentNotFiltered,
NoMoreProperty, FilteringValueProperty, NoMoreValueProperty
}

Variables

const | PROP_BUFFER_SLOP = 80

Enumeration Type Documentation

enum PropTagState
Enumerator:
FilteringContent
NoMoreContent
FilteringProperty
FilteringPropertyButContentNotFiltered
NoMoreProperty
FilteringValueProperty
NoMoreValueProperty

Definition at line 19 of file PropTag.Hxx.

{
    FilteringContent,                           // Filtering the content property
    NoMoreContent,                              // Done filtering the content property
    FilteringProperty,                          // Filtering the pseudo property
    FilteringPropertyButContentNotFiltered,     // Filtering the pseudo and actual property only
    NoMoreProperty,                             // Done filtering the pseudo property
    FilteringValueProperty,                     // Filtering the real property
    NoMoreValueProperty                       // Done filtering the real property
};

Variable Documentation

const PROP_BUFFER_SLOP = 80

Definition at line 17 of file PropTag.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/RegAcc32.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Functions

RegAcc32.Cxx File Reference

#include <pch.cxx>
#include <osv.hxx>
#include <regacc32.hxx>

Go to the source code of this file.

Functions

void StringToClsid (WCHAR *wszClass, GUID &guidClass)

Function Documentation

void StringToClsid | ( | WCHAR * | wszClass,
 |  | GUID & | guidClass
 | ) |  |

Definition at line 160 of file RegAcc32.Cxx.

{
    wszClass[9] = 0;
    guidClass.Data1 = wcstoul( &wszClass[1], 0, 16 );
    wszClass[14] = 0;
    guidClass.Data2 = (USHORT)wcstoul( &wszClass[10], 0, 16 );
    wszClass[19] = 0;
    guidClass.Data3 = (USHORT)wcstoul( &wszClass[15], 0, 16 );

    WCHAR wc = wszClass[22];
    wszClass[22] = 0;
    guidClass.Data4[0] = (unsigned char)wcstoul( &wszClass[20], 0, 16 );
    wszClass[22] = wc;
    wszClass[24] = 0;
    guidClass.Data4[1] = (unsigned char)wcstoul( &wszClass[22], 0, 16 );

    for ( int i = 0; i < 6; i++ )
    {
       wc = wszClass[27+i*2];
       wszClass[27+i*2] = 0;
       guidClass.Data4[2+i] = (unsigned char)wcstoul( &wszClass[25+i*2], 0, 16 );
       wszClass[27+i*2] = wc;
    }
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/RegAcc32.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Functions

RegAcc32.Hxx File Reference

Go to the source code of this file.

Classes

class | CRegAccess

Functions

void | StringToClsid (WCHAR *wszClass, GUID &guidClass)

Function Documentation

void StringToClsid | ( | WCHAR * | wszClass,
 |  | GUID & | guidClass
 | ) |  |

Definition at line 160 of file RegAcc32.Cxx.

{
    wszClass[9] = 0;
    guidClass.Data1 = wcstoul( &wszClass[1], 0, 16 );
    wszClass[14] = 0;
    guidClass.Data2 = (USHORT)wcstoul( &wszClass[10], 0, 16 );
    wszClass[19] = 0;
    guidClass.Data3 = (USHORT)wcstoul( &wszClass[15], 0, 16 );

    WCHAR wc = wszClass[22];
    wszClass[22] = 0;
    guidClass.Data4[0] = (unsigned char)wcstoul( &wszClass[20], 0, 16 );
    wszClass[22] = wc;
    wszClass[24] = 0;
    guidClass.Data4[1] = (unsigned char)wcstoul( &wszClass[22], 0, 16 );

    for ( int i = 0; i < 6; i++ )
    {
       wc = wszClass[27+i*2];
       wszClass[27+i*2] = 0;
       guidClass.Data4[2+i] = (unsigned char)wcstoul( &wszClass[25+i*2], 0, 16 );
       wszClass[27+i*2] = wc;
    }
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Register.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter
Variables

Register.Cxx File Reference

#include <pch.cxx>
#include <filtreg.hxx>

Go to the source code of this file.

Variables

SClassEntry const | aHtmlFiltClasses []
SFilterEntry const | HtmlFiltFilter
SHandlerEntry const | HtmlFiltHandler

Variable Documentation

SClassEntry const aHtmlFiltClasses[]
Initial value:
{
    { L".hhc",  L"hhcfile",       L"HHC file",      L"{7f73b8f6-c19c-11d0-aa66-00c04fc2eddc}", L"HHC file" },
    { L".htm",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".html", L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".htx",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".stm",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".htw",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
    { L".asp",  L"asp_auto_file", L"ASP auto file", L"{bd70c020-2d24-11d0-9110-00004c752752}", L"ASP auto file" },
}

Definition at line 16 of file Register.Cxx.

SFilterEntry const HtmlFiltFilter
Initial value:
{
    L"{e0ca5340-4534-11cf-b952-00aa0051fe20}",
    L"HTML Filter",
    L"HtmlFilt.dll",
    L"Both"
}

Definition at line 34 of file Register.Cxx.

SHandlerEntry const HtmlFiltHandler
Initial value:
{
    L"{eec97550-47a9-11cf-b952-00aa0051fe20}",
    L"HTML Persistent Handler",
    L"{e0ca5340-4534-11cf-b952-00aa0051fe20}",
}

Definition at line 27 of file Register.Cxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/ScripTag.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

ScripTag.Cxx File Reference

#include <pch.cxx>
#include <scriptag.hxx>
#include <htmlguid.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/ScripTag.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

ScripTag.Hxx File Reference

#include <htmlelem.hxx>
#include <proptag.hxx>

Go to the source code of this file.

Classes

class CScriptTag
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/SerStrm.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

SerStrm.Cxx File Reference

#include <pch.cxx>
#include <htmlfilt.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/SerStrm.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes | Variables

SerStrm.Hxx File Reference

#include <inpstrm.hxx>
#include <charhash.hxx>

Go to the source code of this file.

Classes

class | CSerialStream

Variables

const | MAX_SPECIAL_CHAR_LENGTH = 20

Variable Documentation

const MAX_SPECIAL_CHAR_LENGTH = 20

Definition at line 20 of file SerStrm.Hxx.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Start.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

Start.Cxx File Reference

#include <pch.cxx>
#include <start.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Start.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

Start.Hxx File Reference

#include <htmlelem.hxx>

Go to the source code of this file.

Classes

class CStartOfFileElement
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/TextElem.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

TextElem.Cxx File Reference

#include <pch.cxx>
#include <textelem.hxx>
#include <htmlguid.hxx>
#include <ntquery.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/TextElem.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

TextElem.Hxx File Reference

#include <htmlelem.hxx>

Go to the source code of this file.

Classes

class CTextElement
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/TitleTag.Cxx File Reference

  • WinBase
  • Indexing
  • IFilter

TitleTag.Cxx File Reference

#include <pch.cxx>
#include <titletag.hxx>
#include <htmlguid.hxx>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/TitleTag.Hxx File Reference

  • WinBase
  • Indexing
  • IFilter
Classes

TitleTag.Hxx File Reference

#include <proptag.hxx>

Go to the source code of this file.

Classes

class CTitleTag
Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IISSearch/AdoVbs.Inc File Reference

  • WinBase
  • Indexing
  • IISSearch

AdoVbs.Inc File Reference

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:53:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IISSearch/Is2Foot.Inc File Reference

  • WinBase
  • Indexing
  • IISSearch
Variables

Is2Foot.Inc File Reference

Go to the source code of this file.

Variables

<!--STANDARDMICROSOFTFOOTERFORQUERYPAGES-->
< hrwidth=500align=left >< p >< tableborder="0"cellpadding="0"cellspacing="0"width="500">< tr ><!--IISGIF-->< td >< ahref="http:</td><!--MicrosoftLegalInfo--><tdalign=center><fontstyle="font:arial;font-size:8pt"> & 		copy

Variable Documentation

<!--STANDARDMICROSOFTFOOTERFORQUERYPAGES--><hrwidth=500align=left><p><tableborder="0"cellpadding="0"cellspacing="0"width="500"><tr><!--IISGIF--><td><ahref="http:</td><!--MicrosoftLegalInfo--><tdalign=center><fontstyle="font:arial;font-size:8pt"> & copy

Definition at line 14 of file Is2Foot.Inc.

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/filtreg.hxx File Reference

  • WinBase
  • Indexing
  • lrsample
Classes | Defines | Functions

filtreg.hxx File Reference

#include <olectl.h>

Go to the source code of this file.

Classes

struct | SClassEntry
struct | SFilterEntry
struct | SHandlerEntry

Defines

#define | DEFINE_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_DLLREGISTERFILTER2(Handler, Filter, aClasses) DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )
#define | DEFINE_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \
#define | DEFINE_REGISTERFILTER2(Name, Handler, Filter, aClasses)
#define | DEFINE_REGISTERFILTERBASE(Name, Handler, Filter, aClasses, fBlastExistingPersistentHandler)
#define | DEFINE_SOFT_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_SOFT_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Functions

long | AddThreadingModel (WCHAR const *wszClsId, WCHAR const *wszThreadingModel)
long | BuildKeyValues (WCHAR const *const *awszKeyValues, unsigned cKeyValues)
long | DestroyKeyValues (WCHAR const *const *awszKeyValues, int cKeyValues)
long | RegisterAClass (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszShortName=0, BOOL fAppendOnly=FALSE)
long | RegisterAClassAndExt (SClassEntry const &Class, WCHAR const *pwszPHandler, BOOL fAppendOnly=FALSE, BOOL fBlastExistingPersistentHandler=TRUE)
long | RegisterACLSID (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszClassId=0, BOOL fAppendOnly=FALSE, BOOL fAppendDesc=TRUE)
long | RegisterAFilter (SFilterEntry const &Filter)
long | RegisterAHandler (SHandlerEntry const &Handler)
long | RemoveAClass (WCHAR *pwszClassId)
long | RemoveAClassName (WCHAR *pwszClass)
long | UnRegisterAFilter (SFilterEntry const &Filter)
long | UnRegisterAHandler (SHandlerEntry const &Handler)
long | UnRegisterAnExt (SClassEntry const &Class)

Define Documentation

#define DEFINE_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1573 of file filtreg.hxx.

#define DEFINE_DLLREGISTERFILTER2 | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )

Definition at line 1658 of file filtreg.hxx.

#define DEFINE_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \

Definition at line 1569 of file filtreg.hxx.

#define DEFINE_REGISTERFILTER2 | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses
 | ) |

Definition at line 1587 of file filtreg.hxx.

#define DEFINE_REGISTERFILTERBASE | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses,
 |  | fBlastExistingPersistentHandler
 | ) |

Definition at line 1500 of file filtreg.hxx.

#define DEFINE_SOFT_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1579 of file filtreg.hxx.

#define DEFINE_SOFT_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Definition at line 1576 of file filtreg.hxx.

Function Documentation

long AddThreadingModel | ( | WCHAR const * | wszClsId,
 |  | WCHAR const * | wszThreadingModel |
 | ) |  |  | [inline]

Definition at line 194 of file filtreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, wszClsId );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, L"InprocServer32" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                             wcTemp,               // Sub key
                             0,                    // Reserved
                             KEY_ALL_ACCESS,       // Access
                             &hKey );              // Handle

    if ( ERROR_SUCCESS != dwError )
        return dwError;

    if ( 0 != wszThreadingModel )
        dwError = RegSetValueExW( hKey,                   // Key
                                  L"ThreadingModel",      // Name
                                  0,                      // Reserved
                                  REG_SZ,                 // Type
                                  (BYTE *) wszThreadingModel,  // Value
                                  (DWORD) ( (wcslen(wszThreadingModel) + 1) * sizeof WCHAR ) );
    else
        RegDeleteValueW( hKey,                   // Key
                         L"ThreadingModel" );    // Name

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long BuildKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | unsigned | cKeyValues |
 | ) |  |  | [inline]

Definition at line 121 of file filtreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    do
    {
        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        DWORD  dwDisposition;

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;

        if ( 0 != awszKeyValues[i] )
            dwError = RegSetValueExW( hKey,                     // Key
                                      0,                        // Name
                                      0,                        // Reserved
                                      REG_SZ,                   // Type
                                      (BYTE *)awszKeyValues[i], // Value
                                      (DWORD) ( (1 + wcslen(awszKeyValues[i]) ) * sizeof(WCHAR) ) );

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;
    }
    while ( i < cKeyValues );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long DestroyKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | int | cKeyValues |
 | ) |  |  | [inline]

Definition at line 248 of file filtreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];

    //
    // Build path to deepest component
    //

    wcscpy( wcTemp, L"CLSID" );
    int i = 0;

    do
    {
        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        i += 2;
    }
    while ( i < cKeyValues );

    //
    // Remove components in reverse order
    //

    long dwError = ERROR_SUCCESS;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;

    unsigned cc = (unsigned) wcslen( wcTemp );

    for ( i -= 2; i >= 0; i -= 2 )
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 wcTemp,               // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        #if 0  // Values deleted by RegDeleteKeyW
        //
        // Delete value, if there is one.
        //

        if ( 0 != awszKeyValues[i+1] )
            dwError = RegDeleteValueW( hKey, 0 );

        if ( ERROR_SUCCESS != dwError )
            break;
        #endif // 0

        //
        // Delete subkey, if there is one.
        //

        if ( i+2 < cKeyValues )
            dwError = RegDeleteKeyW( hKey, awszKeyValues[i+2] );

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Close key and truncate string to next component.
        //

        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        cc -= (unsigned) wcslen( awszKeyValues[i] );
        cc--;

        wcTemp[cc] = 0;
    }

    //
    // Remove the final top key
    //

    if ( ERROR_SUCCESS == dwError )
    {
        do
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key -- "CLSID"
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Delete subkey
            //

            dwError = RegDeleteKeyW( hKey, awszKeyValues[0] );

        } while ( FALSE );
    }

    return dwError;
}

long RegisterAClass | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszShortName = 0,
 |  | BOOL | fAppendOnly = FALSE |
 | ) |  |  | [inline]

Definition at line 552 of file filtreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    if ( 0 == pwszShortName )
    {
        if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, Class.pwszShortName );
    }
    else
    {
        if ( wcslen( pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, pwszShortName );
    }

    do
    {
        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        //
        // Here, wcTemp contains the key name for the named entry (ex: Word.Document.8)
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        //
        // If needed, write the description, but only for non-overrides.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszShortName )
        {
            dwError = RegSetValueExW( hKey,                          // Key
                                      0,                             // Name
                                      0,                             // Reserved
                                      REG_SZ,                        // Type
                                      (BYTE *)Class.pwszDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszDescription) ) * sizeof(WCHAR) ) );

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Write or read ClassId
        //

        wcscat( wcTemp, L"\\CLSID" );

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        dwSize = sizeof(wcTemp);

        dwError = RegQueryValueExW( hKey,                // Key handle
                                    0,                   // Name
                                    0,                   // Reserved
                                    &dwType,             // Datatype
                                    (BYTE *)(wcTemp),    // Data returned here
                                    &dwSize );           // Size of data

        if ( ERROR_SUCCESS != dwError )
        {
            if ( ERROR_FILE_NOT_FOUND == dwError )
            {
                //
                // Don't set a class id in append mode.
                //

                if ( fAppendOnly )
                {
                    dwError = ERROR_SUCCESS;
                    break;
                }

                dwError = RegSetValueExW( hKey,                          // Key
                                          0,                             // Name
                                          0,                             // Reserved
                                          REG_SZ,                        // Type
                                          (BYTE *)Class.pwszClassId,     // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszClassId) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0; // Default to class from Class structure

                if ( ERROR_SUCCESS != dwError )
                    break;
            }
            else
                break;
        }
        else
        {
            if ( REG_SZ != dwType )
                dwError = E_FAIL;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp contains the {class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        dwError = RegisterACLSID( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAClassAndExt | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fBlastExistingPersistentHandler = TRUE |
 | ) |  |  | [inline]

Definition at line 371 of file filtreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError = NO_ERROR;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    do
    {
        //
        // First, the optional extension entry
        //

        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        if ( 0 == Class.pwszExt )
        {
            //
            // Build up named entry
            //

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );
        }
        else
        {
            if ( wcslen( Class.pwszExt ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszExt );

            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write or read class association
            //

            BOOL fSetValue = TRUE;

            if ( REG_OPENED_EXISTING_KEY == dwDisposition )
            {
                dwSize = sizeof(wcTemp);

                dwError = RegQueryValueExW( hKey,            // Key handle
                                            0,               // Name
                                            0,               // Reserved
                                            &dwType,         // Datatype
                                            (BYTE *)wcTemp,  // Data returned here
                                            &dwSize );       // Size of data

                if ( ERROR_SUCCESS == dwError )
                {
                    fSetValue = FALSE;

                    if ( REG_SZ != dwType )
                        dwError = E_FAIL;
                }
                else if ( ERROR_FILE_NOT_FOUND == dwError )
                {
                    //
                    // This is ok, but we need to remember that the
                    // combination of wcTemp[0] == 0 && fAppendOnly means
                    // don't try to register the class.
                    //

                    wcTemp[0] = 0;
                    dwError = ERROR_SUCCESS;
                }
            }

            if ( fSetValue && !fAppendOnly )
            {
                dwError = RegSetValueExW( hKey,                        // Key
                                          0,                           // Name
                                          0,                           // Reserved
                                          REG_SZ,                      // Type
                                          (BYTE *)Class.pwszShortName, // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszShortName) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0;
            }

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write the persistent handler key
            //

            HKEY hKey2 = (HKEY)INVALID_HANDLE_VALUE;

            dwError = RegCreateKeyExW( hKey,                 // Root
                                       L"PersistentHandler", // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey2,               // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;

            if ( fBlastExistingPersistentHandler ||
                 ( REG_OPENED_EXISTING_KEY != dwDisposition ) )
                dwError = RegSetValueExW( hKey2,                 // Key
                                          0,                     // Name
                                          0,                     // Reserved
                                          REG_SZ,                // Type
                                          (BYTE *)pwszPHandler,  // Value
                                          (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

            if ( (HKEY)INVALID_HANDLE_VALUE != hKey2 )
            {
                RegCloseKey( hKey2 );
                hKey2 = (HKEY)INVALID_HANDLE_VALUE;
            }
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp may contain the key name for the named entry (ex: Word.Document.8)
        //

        if ( wcTemp[0] != 0 || !fAppendOnly )
            dwError = RegisterAClass( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterACLSID | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszClassId = 0,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fAppendDesc = TRUE |
 | ) |  |  | [inline]

Definition at line 787 of file filtreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    wcscpy( wcTemp, L"CLSID\\" );

    if ( 0 == pwszClassId )
        wcscat( wcTemp, Class.pwszClassId );
    else
        wcscat( wcTemp, pwszClassId );

    do
    {
        DWORD dwDisposition;

        //
        // Here, wcTemp contains the CLSID\{class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // If needed, write the description, but not for override class.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszClassId && fAppendDesc )
        {
            dwError = RegSetValueExW( hKey,                                 // Key
                                      0,                                    // Name
                                      0,                                    // Reserved
                                      REG_SZ,                               // Type
                                      (BYTE *)Class.pwszClassIdDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszClassIdDescription) ) * sizeof(WCHAR) ) );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Always write persistent handler.
        //

        wcscat( wcTemp, L"\\PersistentHandler" );

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegSetValueExW( hKey,                  // Key
                                  0,                     // Name
                                  0,                     // Reserved
                                  REG_SZ,                // Type
                                  (BYTE *)pwszPHandler,  // Value
                                  (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1234 of file filtreg.hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    long retVal = BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    if ( ERROR_SUCCESS == retVal )
        retVal = AddThreadingModel( Filter.pwszClassId, Filter.pwszThreadingModel );

    return retVal;
}

long RegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1210 of file filtreg.hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    return BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long RemoveAClass ( WCHAR * pwszClassId ) [inline]

Definition at line 1059 of file filtreg.hxx.

{
    //
    // First, delete class entry.
    //

    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors
    long dwEnum = ERROR_SUCCESS;    // For enumerator

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  L"CLSID",             // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClassId );

        RegCloseKey( hKeyEnum );

        long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                      0,                    // Sub key
                                      0,                    // Reserved
                                      KEY_ALL_ACCESS,       // Access
                                      &hKeyEnum );          // Handle
    }

    if ( ERROR_SUCCESS == dwError )
    {
        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                wcscat( wcTemp, L"\\CLSID" );

                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClassId ) )
                    {
                        wcTemp[ wcslen(wcTemp) - wcslen( L"\\CLSID" ) ] = 0;

                        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                                 wcTemp,               // Sub key
                                                 0,                    // Reserved
                                                 KEY_ALL_ACCESS,       // Access
                                                 &hKey );              // Handle

                        if ( ERROR_SUCCESS == dwError )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKey, L"CLSID" );
                            else
                                RegDeleteKeyW( hKey, L"CLSID" );

                            dwIndex = 0;
                        }

                        //
                        // If there are no more entries, then the class name can be deleted
                        //

                        dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);

                        long dw2 = RegEnumKeyExW( hKey,               // Handle of key
                                                  0,                  // Index of registry subkey
                                                  wcTemp,             // Buffer for name
                                                  &dwSize,            // Size of buffer / key
                                                  0,                  // Reserved
                                                  0,                  // Class (unused)
                                                  0,                  // Class size (unused)
                                                  &ftUnused );        // Filetime (unused)

                        RegCloseKey( hKey );

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                            RemoveAClassName( wcTemp );
                    }
                }
                else
                    dwError = ERROR_SUCCESS;  // Just didn't have CLSID
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long RemoveAClassName ( WCHAR * pwszClass ) [inline]

Definition at line 923 of file filtreg.hxx.

{
    //
    // First, delete class name entry.
    //

    long dwEnum = ERROR_SUCCESS;    // The enumerator
    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  0,                    // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClass );

        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClass ) )
                    {
                        //
                        // Always delete the value
                        //

                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteValueW( hKey, 0 );
                        else
                            RegDeleteValueW( hKey, 0 );

                        //
                        // Any other key(s)?
                        //

                        dwSize = sizeof(wcTemp) / sizeof wcTemp[0];

                        DWORD dw2 = RegEnumKeyExW( hKey,                   // Handle of key
                                                   0,                      // Index of registry subkey
                                                   wcTemp,                 // Buffer for name
                                                   &dwSize,                // Size of buffer / key
                                                   0,                      // Reserved
                                                   0,                      // Class (unused)
                                                   0,                      // Class size (unused)
                                                   &ftUnused );            // Filetime (unused)

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKeyEnum, wcTemp );
                            else
                                RegDeleteKeyW( hKeyEnum, wcTemp );

                            dwIndex = 0;
                        }

                    }
                    else
                        dwError = ERROR_SUCCESS;  // Just didn't have a null key (or no match)
                }
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1470 of file filtreg.hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    return DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long UnRegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1260 of file filtreg.hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    //
    // dwIgnore is used to record non-fatal errors
    //

    long dwIgnore = DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    long dwError = ERROR_SUCCESS;

    //
    // Now, enumerate all classes and delete any persistent handler entries.
    //

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwEnum = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 L"CLSID",              // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKeyEnum );          // Handle

    DWORD dwIndex = 0;

    while ( ERROR_SUCCESS == dwEnum )
    {
        WCHAR wcTemp[MAX_PATH];

        wcscpy( wcTemp, L"CLSID\\" );
        unsigned cc = (unsigned) wcslen( wcTemp );

        DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]) - cc;
        FILETIME ftUnused;

        dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                dwIndex,                // Index of registry subkey
                                wcTemp + cc,            // Buffer for name
                                &dwSize,                // Size of buffer / key
                                0,                      // Reserved
                                0,                      // Class (unused)
                                0,                      // Class size (unused)
                                &ftUnused );            // Filetime (unused)

        dwIndex++;

        //
        // Does the key have a persistent handler?
        //

        if ( ERROR_SUCCESS == dwEnum )
        {
            wcscat( wcTemp, L"\\PersistentHandler" );

            HKEY hKey;

            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS == dwError )
            {
                //
                // Is this the persistent handler we're looking for?
                //

                WCHAR wcTemp2[MAX_PATH];
                DWORD dwType;

                dwSize = sizeof(wcTemp2);

                dwError = RegQueryValueExW( hKey,                // Key handle
                                            0,                   // Name
                                            0,                   // Reserved
                                            &dwType,             // Datatype
                                            (BYTE *)wcTemp2,     // Data returned here
                                            &dwSize );           // Size of data

                RegCloseKey( hKey );

                if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, Handler.pwszClassId ) )
                {
                    wcTemp[ wcslen(wcTemp) - wcslen( L"\\PersistentHandler" ) ] = 0;

                    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                             wcTemp,               // Sub key
                                             0,                    // Reserved
                                             KEY_ALL_ACCESS,       // Access
                                             &hKey );              // Handle

                    if ( ERROR_SUCCESS == dwError )
                    {
                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteKeyW( hKey, L"PersistentHandler" );
                        else
                            RegDeleteKeyW( hKey, L"PersistentHandler" );

                        dwIndex = 0; // Start over again
                    }

                    //
                    // If that was the *only* entry under the clsid, then the class can be
                    // removed.
                    //

                    dwSize = sizeof(wcTemp2)/sizeof(wcTemp2[0]);

                    long dw2 = RegEnumKeyExW( hKey,             // Handle of key
                                              0,                // Index of registry subkey
                                              wcTemp2,          // Buffer for name
                                              &dwSize,          // Size of buffer / key
                                              0,                // Reserved
                                              0,                // Class (unused)
                                              0,                // Class size (unused)
                                              &ftUnused );      // Filetime (unused)

                    RegCloseKey( hKey );

                    if ( ERROR_NO_MORE_ITEMS == dw2 )
                        RemoveAClass( wcTemp + wcslen( L"CLSID\\" ) );
                }
                else
                {
                    //
                    // Didn't have persistent handler null key.  Odd but not fatal.
                    // Or, key didn't match target.
                    //

                    dwIgnore = dwError;
                    dwError = ERROR_SUCCESS;
                }

            }
            else
                dwError = ERROR_SUCCESS;  // Just didn't have persistent handler
        }
    }

    if ( (HKEY)INVALID_HANDLE_VALUE != hKeyEnum )
        RegCloseKey( hKeyEnum );

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAnExt ( SClassEntry const & Class ) [inline]

Definition at line 1429 of file filtreg.hxx.

{
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    DWORD dwError;

    do
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 Class.pwszExt,        // Sub key -- "CLSID"
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegDeleteKeyW( hKey, L"PersistentHandler" );

    } while ( FALSE );

    if ( INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/langreg.hxx File Reference

  • WinBase
  • Indexing
  • lrsample
Classes | Functions

langreg.hxx File Reference

Go to the source code of this file.

Classes

struct | SLangClassEntry
struct | SLangRegistry

Functions

long | RegisterALanguageClass (SLangClassEntry const &LangClass)
long | RegisterALanguageResource (SLangRegistry const &LangRes)
long | UnRegisterALanguageClass (SLangClassEntry const &LangClass)
long | UnRegisterALanguageResource (SLangRegistry const &LangRes)

Function Documentation

long RegisterALanguageClass ( SLangClassEntry const & LangClass ) [inline]

Definition at line 304 of file langreg.hxx.

{
    WCHAR const * aKeyValues[4] = { LangClass.pwszClassId,
                                    LangClass.pwszClassIdDescription,
                                    L"InprocServer32",
                                    LangClass.pwszDLL };

    long retVal = BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    if ( ERROR_SUCCESS == retVal )
        retVal = AddThreadingModel( LangClass.pwszClassId, LangClass.pwszThreadingModel );

    return retVal;
}

long RegisterALanguageResource ( SLangRegistry const & LangRes ) [inline]

Definition at line 85 of file langreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    wcscpy( wcTemp, L"System\\CurrentControlSet\\Control\\ContentIndex\\Language\\" );

    if ( ( wcslen( wcTemp ) + wcslen( LangRes.pwszLangName ) ) >= MAX_PATH )
        return ERROR_INSUFFICIENT_BUFFER;

    wcscat( wcTemp, LangRes.pwszLangName );

    do
    {
        DWORD dwDisposition;

        dwError = RegCreateKeyExW( HKEY_LOCAL_MACHINE,   // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Write the locale ID
        //

        dwError = RegSetValueExW( hKey,                  // Key
                                  L"Locale",             // Name
                                  0,                     // Reserved
                                  REG_DWORD,             // Type
                                  (BYTE *)&LangRes.lcid, // Value
                                  sizeof DWORD );

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        //  Create the word breaker class description
        //
        if (LangRes.WordBreaker.pwszClassId != 0)
        {
            dwError = RegisterALanguageClass( LangRes.WordBreaker );
            if ( ERROR_SUCCESS != dwError )
                break;

            dwError = RegSetValueExW( hKey,              // Key
                                      L"WBreakerClass",  // Name
                                      0,                 // Reserved
                                      REG_SZ,            // Type
                                      (BYTE *)LangRes.WordBreaker.pwszClassId, // Value
                                      (DWORD) ( (1 + wcslen(LangRes.WordBreaker.pwszClassId) ) * sizeof(WCHAR) ) );
            if ( ERROR_SUCCESS != dwError )
                break;

        }

        //
        //  Create the stemmer class description
        //
        if (LangRes.Stemmer.pwszClassId != 0)
        {
            dwError = RegisterALanguageClass( LangRes.Stemmer );
            if ( ERROR_SUCCESS != dwError )
                break;

            dwError = RegSetValueExW( hKey,              // Key
                                      L"StemmerClass",   // Name
                                      0,                 // Reserved
                                      REG_SZ,            // Type
                                      (BYTE *)LangRes.Stemmer.pwszClassId, // Value
                                      (DWORD) ( (1 + wcslen(LangRes.Stemmer.pwszClassId) ) * sizeof(WCHAR) ) );
            if ( ERROR_SUCCESS != dwError )
                break;

        }

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long UnRegisterALanguageClass ( SLangClassEntry const & LangClass ) [inline]

Definition at line 331 of file langreg.hxx.

{
    WCHAR const * aKeyValues[4] = { LangClass.pwszClassId,
                                    LangClass.pwszClassIdDescription,
                                    L"InprocServer32",
                                    LangClass.pwszDLL };

    return DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long UnRegisterALanguageResource ( SLangRegistry const & LangRes ) [inline]

Definition at line 194 of file langreg.hxx.

{
    WCHAR wcTemp[MAX_PATH];

    wcscpy( wcTemp, L"System\\CurrentControlSet\\Control\\ContentIndex\\Language\\" );

    if ( ( wcslen( wcTemp ) + wcslen( LangRes.pwszLangName ) ) >= MAX_PATH )
        return ERROR_INSUFFICIENT_BUFFER;

    wcscat( wcTemp, LangRes.pwszLangName );

    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;
    long dwError = RegOpenKeyExW( HKEY_LOCAL_MACHINE,   // Root
                                  wcTemp,               // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKey );              // Handle

    //
    //  Delete the word breaker class description
    //
    if (LangRes.WordBreaker.pwszClassId != 0)
    {
        dwError = UnRegisterALanguageClass( LangRes.WordBreaker );

        if (hKey != INVALID_HANDLE_VALUE)
            dwError = RegDeleteValueW( hKey,                // Key
                                       L"WBreakerClass" );   // Name
    }

    //
    //  Create the stemmer class description
    //
    if (LangRes.Stemmer.pwszClassId != 0)
    {
        dwError = UnRegisterALanguageClass( LangRes.Stemmer );

        if (hKey != INVALID_HANDLE_VALUE)
            dwError = RegDeleteValueW( hKey,                // Key
                                       L"StemmerClass" );    // Name
    }

    if (hKey != INVALID_HANDLE_VALUE)
    {
        DWORD dwNumofKeys = 0;
        DWORD dwNumofValues = 0;
        dwError = RegQueryInfoKeyW( hKey,       // Hkey
                                    0,          // Buffer for class string
                                    0,          // Size of class string buffer
                                    0,          // reserved
                                   &dwNumofKeys,// number of subkeys
                                    0,          // longest subkey name length
                                    0,          // longest class string length
                                   &dwNumofValues,// number of value entries
                                    0,          // longest value name length
                                    0,          // longest value data length
                                    0,          // security descriptor length
                                    0 );        // last write time);

        if ( ERROR_SUCCESS == dwError )
        {
            if ( (dwNumofValues == 1) && (dwNumofKeys==0) )
            {

                //
                // There is only one value and no sub-keys under this key,
                // Delete the Locale value and then the sub-key for this Lang
                // if that succeeded.
                //

                RegDeleteValueW( hKey,        // Key
                                 L"Locale" );  // Name

                dwError = RegQueryInfoKeyW( hKey,       // Hkey
                                            0,          // class string
                                            0,          // Size of class string
                                            0,          // reserved
                                           &dwNumofKeys,
                                            0,          // max subkey name len
                                            0,          // max class string len
                                           &dwNumofValues,
                                            0,          // max value name len
                                            0,          // max value data len
                                            0,          // security desc len
                                            0 );        // last write time);
            }
        }
        RegCloseKey( hKey );

        if ( ERROR_SUCCESS == dwError &&
             (0 == dwNumofValues) &&
             (0 == dwNumofKeys) )
            dwError = RegDeleteKeyW( HKEY_LOCAL_MACHINE,   // Root
                                     wcTemp );             // Sub key
    }
    return dwError;
}

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/lrsample.CXX File Reference

  • WinBase
  • Indexing
  • lrsample
Classes | Functions | Variables

lrsample.CXX File Reference

#include <stdio.h>
#include <wchar.h>
#include <windows.h>
#include <objidl.h>
#include <indexsrv.h>
#include <cierror.h>
#include <filterr.h>
#include "lrsample.hxx"
#include "filtreg.hxx"
#include "langreg.hxx"

Go to the source code of this file.

Classes

struct | SStemForm

Functions

HRESULT STDMETHODCALLTYPE | DllCanUnloadNow (void)
HRESULT STDMETHODCALLTYPE | DllGetClassObject (REFCLSID cid, REFIID iid, void **ppvObj)
BOOL WINAPI | DllMain (HANDLE hInstance, DWORD dwReason, void *lpReserved)
STDAPI | DllRegisterServer ()
STDAPI | DllUnregisterServer ()
__forceinline BOOL | IsWordChar (WCHAR const *pwcChunk, int i, WORD const *pInfo1, WORD const *pInfo3)
HRESULT | ScanChunk (WCHAR const *pwcChunk, ULONG cwc, WORD *pInfo1, WORD *pInfo3)
int __cdecl | StemCompare (const void *p1, const void *p2)

Variables

const SStemForm | aStemForms []
const WCHAR * | aStems [][cMaxStemForms]
CLSID CLSID_SampleStemmer
CLSID CLSID_SampleWordBreaker
const ULONG | cMaxStemForms = 8
const ULONG | cStemForms = ArraySize( aStemForms )
SLangRegistry const | English_Sample_LangRes
long | g_cInstances = 0
HMODULE | g_hModule = 0

Function Documentation

HRESULT STDMETHODCALLTYPE DllCanUnloadNow ( void )

Definition at line 785 of file lrsample.CXX.

{
    if ( 0 == g_cInstances )
        return S_OK;

    return S_FALSE;
} //DllCanUnloadNow

HRESULT STDMETHODCALLTYPE DllGetClassObject | ( | REFCLSID | cid,
 |  | REFIID | iid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 745 of file lrsample.CXX.

{
    IUnknown * pUnk = 0;
    *ppvObj = 0;

    if ( CLSID_SampleWordBreaker == cid ||
         CLSID_SampleStemmer == cid )
    {
        pUnk = new CLanguageResourceSampleCF();

        if ( 0 == pUnk )
            return E_OUTOFMEMORY;
    }
    else
    {
        *ppvObj = 0;
        return E_NOINTERFACE;
    }

    HRESULT hr = pUnk->QueryInterface( iid, ppvObj );

    pUnk->Release();

    return hr;
} //DllGetClassObject

BOOL WINAPI DllMain | ( | HANDLE | hInstance,
 |  | DWORD | dwReason,
 |  | void * | lpReserved
 | ) |  |

Definition at line 801 of file lrsample.CXX.

{
    if ( DLL_PROCESS_ATTACH == dwReason )
    {
        g_hModule = (HMODULE) hInstance;
        DisableThreadLibraryCalls( (HINSTANCE) hInstance );
    }

    return TRUE;
} //DllMain

STDAPI DllRegisterServer ( void )

Definition at line 836 of file lrsample.CXX.

{
    return RegisterALanguageResource( English_Sample_LangRes );
} //DllRegisterServer

STDAPI DllUnregisterServer ( void )

Definition at line 849 of file lrsample.CXX.

{
    return UnRegisterALanguageResource( English_Sample_LangRes );
} //DllUnregisterServer

__forceinline BOOL IsWordChar | ( | WCHAR const * | pwcChunk,
 |  | int | i,
 |  | WORD const * | pInfo1,
 |  | WORD const * | pInfo3
 | ) |  |

Definition at line 173 of file lrsample.CXX.

{
    // Any alphabetic, digit, or non-spacing character is part of a word

    if ( ( 0 != ( pInfo1[i] & ( C1_ALPHA | C1_DIGIT ) ) ) ||
         ( 0 != ( pInfo3[i] & C3_NONSPACING ) ) )
        return TRUE;

    WCHAR c = pwcChunk[i];

    // Underscore is part of a word

    if ( L'_' == c )
        return TRUE;

    //
    // A non-breaking space followed by a non-spacing character should not
    // be a word breaker.
    //

    if ( 0xa0 == c ) // non breaking space
    {
        // followed by a non-spacing character (looking ahead is okay)

        if ( 0 != ( pInfo3[i+1] & C3_NONSPACING ) )
            return TRUE;
    }

    return FALSE;
} //IsWordChar

HRESULT ScanChunk | ( | WCHAR const * | pwcChunk,
 |  | ULONG | cwc,
 |  | WORD * | pInfo1,
 |  | WORD * | pInfo3
 | ) |  |

Definition at line 223 of file lrsample.CXX.

{
    if ( !GetStringTypeW( CT_CTYPE1,         // POSIX character typing
                          pwcChunk,          // Source
                          cwc,               // Size of source
                          pInfo1 ) )         // Character info 1
        return HRESULT_FROM_WIN32( GetLastError() );

    if ( !GetStringTypeW( CT_CTYPE3,         // Additional POSIX
                          pwcChunk,          // Source
                          cwc,               // Size of source
                          pInfo3 ) )         // Character info 3
        return HRESULT_FROM_WIN32( GetLastError() );

    return S_OK;
} //ScanChunk

int __cdecl StemCompare | ( | const void * | p1,
 |  | const void * | p2
 | ) |  |

Definition at line 149 of file lrsample.CXX.

{
    SStemForm const * pForm = (SStemForm const *) p2;
    WCHAR const * pwcWord = (WCHAR const *) p1;
    return wcscmp( pwcWord, aStems[ pForm->iList ][ pForm->iForm ] );
}

Variable Documentation

const SStemForm aStemForms[]

Definition at line 60 of file lrsample.CXX.

const WCHAR* aStems[][cMaxStemForms]
Initial value:
{
    { L"abide", L"abode", L"abided", L"abiding", L"abides" },
    { L"bat", L"bats", L"batted", L"batting" },
    { L"batch", L"batches", L"batched", L"batching" },
    { L"bear", L"bears", L"bore", L"borne", L"born" },
    { L"begin", L"began", L"begun", L"beginning", L"begins" },
    { L"dance", L"danced", L"dances", L"dancing" },
    { L"heave", L"heaved", L"hove", L"heaves", L"heaving" },
    { L"hero", L"heroes" },
    { L"keep", L"keeps", L"kept", L"keeping" },
    { L"misspell", L"misspelled", L"misspelt", L"misspelling",
      L"misspells" },
    { L"plead", L"pleaded", L"pled", L"pleading", L"pleads" },
    { L"run", L"runs", L"ran", L"running" },
    { L"swim", L"swam", L"swum", L"swimming", L"swims" },
    { L"underlie", L"underlay", L"underlain", L"underlying",
      L"underlies" },
}

Definition at line 129 of file lrsample.CXX.

CLSID CLSID_SampleStemmer
Initial value:

{
    0x0a275611, 0xaa4d, 0x4b39,
    {0x82, 0x90, 0x4b, 0xaf, 0x77, 0x70, 0x3f, 0x55}
}

Definition at line 41 of file lrsample.CXX.

CLSID CLSID_SampleWordBreaker
Initial value:

{
    0xd225281a,  0x7ca9, 0x4a46,
    {0xae, 0x7d, 0xc6, 0x3a, 0x9d, 0x48, 0x15, 0xd4}
}

Definition at line 33 of file lrsample.CXX.

const ULONG cMaxStemForms = 8

Definition at line 127 of file lrsample.CXX.

const ULONG cStemForms = ArraySize( aStemForms )

Definition at line 126 of file lrsample.CXX.

SLangRegistry const English_Sample_LangRes
Initial value:
{
    L"English_Sample", MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_SAMPLE ),
    { L"{d225281a-7ca9-4a46-ae7d-c63a9d4815d4}",
      L"English_Sample Word Breaker",
      L"lrsample.dll",
      L"both" },
    { L"{0a275611-aa4d-4b39-8290-4baf77703f55}",
      L"English_Sample Stemmer",
      L"lrsample.dll",
      L"both" }
}

Definition at line 815 of file lrsample.CXX.

long g_cInstances = 0

Definition at line 49 of file lrsample.CXX.

HMODULE g_hModule = 0

Definition at line 50 of file lrsample.CXX.

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/lrsample.HXX File Reference

  • WinBase
  • Indexing
  • lrsample
Classes | Functions | Variables

lrsample.HXX File Reference

#include "minici.hxx"

Go to the source code of this file.

Classes

class | CLanguageResourceSampleCF
class | CSampleStemmer
class | CSampleWordBreaker

Functions

HRESULT STDMETHODCALLTYPE | DllCanUnloadNow (void)
HRESULT STDMETHODCALLTYPE | DllGetClassObject (REFCLSID cid, REFIID iid, void **ppvObj)

Variables

long | g_cInstances
const ULONG | SUBLANG_ENGLISH_SAMPLE = 0x13
const WCHAR | ZERO_WIDTH_SPACE = 0x200B

Function Documentation

HRESULT STDMETHODCALLTYPE DllCanUnloadNow ( void )

Definition at line 53 of file ComSpyAudit.Cpp.

{
  return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

HRESULT STDMETHODCALLTYPE DllGetClassObject | ( | REFCLSID | cid,
 |  | REFIID | iid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 1064 of file HtmlProp.Cxx.

{
    IUnknown * pUnk = 0;

    if ( CLSID_HtmlPropIFilter == cid ||
         CLSID_HtmlPropClass   == cid )
    {
        pUnk = new HtmlPropIFilterCF;

        if ( 0 == pUnk )
            return E_OUTOFMEMORY;
    }
    else
    {
        *ppvObj = 0;
        return E_NOINTERFACE;
    }

    SCODE sc = pUnk->QueryInterface( iid, ppvObj );

    pUnk->Release();

    return sc;
} //DllGetClassObject

Variable Documentation

long g_cInstances

Definition at line 109 of file HtmlProp.Cxx.

const ULONG SUBLANG_ENGLISH_SAMPLE = 0x13

Definition at line 26 of file lrsample.HXX.

const WCHAR ZERO_WIDTH_SPACE = 0x200B

Definition at line 30 of file lrsample.HXX.

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/minici.hxx File Reference

  • WinBase
  • Indexing
  • lrsample
Classes | Defines | Functions

minici.hxx File Reference

#include <eh.h>
#include <limits.h>

Go to the source code of this file.

Classes

class | XBStr
class | XInterface< T >
class | XPtr< T >
class | XWindow

Defines

#define | ArraySize(x) ( sizeof( x ) / sizeof( x[0] ) )
#define | CiPtrToUint(p) CiPtrToUlong( p )

Functions

ULONG | CiPtrToUlong (ULONG_PTR p)
void __cdecl | operator delete (void *pv)
void *__cdecl | operator new (size_t st)

Define Documentation

#define ArraySize ( x ) ( sizeof( x ) / sizeof( x[0] ) )

Definition at line 139 of file minici.hxx.

#define CiPtrToUint ( p ) CiPtrToUlong( p )

Definition at line 137 of file minici.hxx.

Function Documentation

ULONG CiPtrToUlong ( ULONG_PTR p ) [inline]

Definition at line 132 of file minici.hxx.

{
    return PtrToUlong( (PVOID)p );
}

void __cdecl operator delete ( void * pv ) [inline]

Definition at line 28 of file minici.hxx.

{
    if ( 0 != pv )
        LocalFree( (HLOCAL) pv );
} //delete

void* __cdecl operator new ( size_t st ) [inline]

Definition at line 23 of file minici.hxx.

{
    return (void *) LocalAlloc( LMEM_FIXED, st );
} //new

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/Simple/DispTree.Cxx File Reference

  • WinBase
  • Indexing
  • Simple
Defines | Functions

DispTree.Cxx File Reference

#include <stdio.h>
#include <windows.h>
#include <oledberr.h>
#include <oledb.h>
#include <cmdtree.h>

Go to the source code of this file.

Defines

#define | UNICODE

Functions

void | DisplayCommandTree (DBCOMMANDTREE *pNode, ULONG iLevel)
void | DisplayVariant (PROPVARIANT *pVar)
void | PrintSpace (ULONG cPlaces)
template<class T >
void | PrintVectorItems (T *pVal, ULONG cVals, char *pcFmt)

Define Documentation

#define UNICODE

Definition at line 18 of file DispTree.Cxx.

Function Documentation

void DisplayCommandTree | ( | DBCOMMANDTREE * | pNode,
 |  | ULONG | iLevel
 | ) |  |

Definition at line 215 of file DispTree.Cxx.

{
    PrintSpace( iLevel );
    printf( "op: (%d) ", pNode->op );
    switch ( pNode->op )
    {
        case DBOP_scalar_constant : printf( "DBOP_scalar_constant" ); break;
        case DBOP_DEFAULT : printf( "DBOP_DEFAULT" ); break;
        case DBOP_NULL : printf( "DBOP_NULL" ); break;
        case DBOP_bookmark_name : printf( "DBOP_bookmark_name" ); break;
        case DBOP_catalog_name : printf( "DBOP_catalog_name" ); break;
        case DBOP_column_name : printf( "DBOP_column_name" ); break;
        case DBOP_schema_name : printf( "DBOP_schema_name" ); break;
        case DBOP_outall_name : printf( "DBOP_outall_name" ); break;
        case DBOP_qualifier_name : printf( "DBOP_qualifier_name" ); break;
        case DBOP_qualified_column_name : printf( "DBOP_qualified_column_name" ); break;
        case DBOP_table_name : printf( "DBOP_table_name" ); break;
        case DBOP_nested_table_name : printf( "DBOP_nested_table_name" ); break;
        case DBOP_nested_column_name : printf( "DBOP_nested_column_name" ); break;
        case DBOP_row : printf( "DBOP_row" ); break;
        case DBOP_table : printf( "DBOP_table" ); break;
        case DBOP_sort : printf( "DBOP_sort" ); break;
        case DBOP_distinct : printf( "DBOP_distinct" ); break;
        case DBOP_distinct_order_preserving : printf( "DBOP_distinct_order_preserving" ); break;
        case DBOP_alias : printf( "DBOP_alias" ); break;
        case DBOP_cross_join : printf( "DBOP_cross_join" ); break;
        case DBOP_union_join : printf( "DBOP_union_join" ); break;
        case DBOP_inner_join : printf( "DBOP_inner_join" ); break;
        case DBOP_left_semi_join : printf( "DBOP_left_semi_join" ); break;
        case DBOP_right_semi_join : printf( "DBOP_right_semi_join" ); break;
        case DBOP_left_anti_semi_join : printf( "DBOP_left_anti_semi_join" ); break;
        case DBOP_right_anti_semi_join : printf( "DBOP_right_anti_semi_join" ); break;
        case DBOP_left_outer_join : printf( "DBOP_left_outer_join" ); break;
        case DBOP_right_outer_join : printf( "DBOP_right_outer_join" ); break;
        case DBOP_full_outer_join : printf( "DBOP_full_outer_join" ); break;
        case DBOP_natural_join : printf( "DBOP_natural_join" ); break;
        case DBOP_natural_left_outer_join : printf( "DBOP_natural_left_outer_join" ); break;
        case DBOP_natural_right_outer_join : printf( "DBOP_natural_right_outer_join" ); break;
        case DBOP_natural_full_outer_join : printf( "DBOP_natural_full_outer_join" ); break;
        case DBOP_set_intersection : printf( "DBOP_set_intersection" ); break;
        case DBOP_set_union : printf( "DBOP_set_union" ); break;
        case DBOP_set_left_difference : printf( "DBOP_set_left_difference" ); break;
        case DBOP_set_right_difference : printf( "DBOP_set_right_difference" ); break;
        case DBOP_set_anti_difference : printf( "DBOP_set_anti_difference" ); break;
        case DBOP_bag_intersection : printf( "DBOP_bag_intersection" ); break;
        case DBOP_bag_union : printf( "DBOP_bag_union" ); break;
        case DBOP_bag_left_difference : printf( "DBOP_bag_left_difference" ); break;
        case DBOP_bag_right_difference : printf( "DBOP_bag_right_difference" ); break;
        case DBOP_bag_anti_difference : printf( "DBOP_bag_anti_difference" ); break;
        case DBOP_division : printf( "DBOP_division" ); break;
        case DBOP_relative_sampling : printf( "DBOP_relative_sampling" ); break;
        case DBOP_absolute_sampling : printf( "DBOP_absolute_sampling" ); break;
        case DBOP_transitive_closure : printf( "DBOP_transitive_closure" ); break;
        case DBOP_recursive_union : printf( "DBOP_recursive_union" ); break;
        case DBOP_aggregate : printf( "DBOP_aggregate" ); break;
        case DBOP_remote_table : printf( "DBOP_remote_table" ); break;
        case DBOP_select : printf( "DBOP_select" ); break;
        case DBOP_order_preserving_select : printf( "DBOP_order_preserving_select" ); break;
        case DBOP_project : printf( "DBOP_project" ); break;
        case DBOP_project_order_preserving : printf( "DBOP_project_order_preserving" ); break;
        case DBOP_top : printf( "DBOP_top" ); break;
        case DBOP_top_percent : printf( "DBOP_top_percent" ); break;
        case DBOP_top_plus_ties : printf( "DBOP_top_plus_ties" ); break;
        case DBOP_top_percent_plus_ties : printf( "DBOP_top_percent_plus_ties" ); break;
        case DBOP_rank : printf( "DBOP_rank" ); break;
        case DBOP_rank_ties_equally : printf( "DBOP_rank_ties_equally" ); break;
        case DBOP_rank_ties_equally_and_skip : printf( "DBOP_rank_ties_equally_and_skip" ); break;
        case DBOP_navigate : printf( "DBOP_navigate" ); break;
        case DBOP_nesting : printf( "DBOP_nesting" ); break;
        case DBOP_unnesting : printf( "DBOP_unnesting" ); break;
        case DBOP_nested_apply : printf( "DBOP_nested_apply" ); break;
        case DBOP_cross_tab : printf( "DBOP_cross_tab" ); break;
        case DBOP_is_NULL : printf( "DBOP_is_NULL" ); break;
        case DBOP_is_NOT_NULL : printf( "DBOP_is_NOT_NULL" ); break;
        case DBOP_equal : printf( "DBOP_equal" ); break;
        case DBOP_not_equal : printf( "DBOP_not_equal" ); break;
        case DBOP_less : printf( "DBOP_less" ); break;
        case DBOP_less_equal : printf( "DBOP_less_equal" ); break;
        case DBOP_greater : printf( "DBOP_greater" ); break;
        case DBOP_greater_equal : printf( "DBOP_greater_equal" ); break;
        case DBOP_equal_all : printf( "DBOP_equal_all" ); break;
        case DBOP_not_equal_all : printf( "DBOP_not_equal_all" ); break;
        case DBOP_less_all : printf( "DBOP_less_all" ); break;
        case DBOP_less_equal_all : printf( "DBOP_less_equal_all" ); break;
        case DBOP_greater_all : printf( "DBOP_greater_all" ); break;
        case DBOP_greater_equal_all : printf( "DBOP_greater_equal_all" ); break;
        case DBOP_equal_any : printf( "DBOP_equal_any" ); break;
        case DBOP_not_equal_any : printf( "DBOP_not_equal_any" ); break;
        case DBOP_less_any : printf( "DBOP_less_any" ); break;
        case DBOP_less_equal_any : printf( "DBOP_less_equal_any" ); break;
        case DBOP_greater_any : printf( "DBOP_greater_any" ); break;
        case DBOP_greater_equal_any : printf( "DBOP_greater_equal_any" ); break;
        case DBOP_anybits : printf( "DBOP_anybits" ); break;
        case DBOP_allbits : printf( "DBOP_allbits" ); break;
        case DBOP_anybits_any : printf( "DBOP_anybits_any" ); break;
        case DBOP_allbits_any : printf( "DBOP_allbits_any" ); break;
        case DBOP_anybits_all : printf( "DBOP_anybits_all" ); break;
        case DBOP_allbits_all : printf( "DBOP_allbits_all" ); break;
        case DBOP_between : printf( "DBOP_between" ); break;
        case DBOP_between_unordered : printf( "DBOP_between_unordered" ); break;
        case DBOP_match : printf( "DBOP_match" ); break;
        case DBOP_match_unique : printf( "DBOP_match_unique" ); break;
        case DBOP_match_partial : printf( "DBOP_match_partial" ); break;
        case DBOP_match_partial_unique : printf( "DBOP_match_partial_unique" ); break;
        case DBOP_match_full : printf( "DBOP_match_full" ); break;
        case DBOP_match_full_unique : printf( "DBOP_match_full_unique" ); break;
        case DBOP_scalar_parameter : printf( "DBOP_scalar_parameter" ); break;
        case DBOP_scalar_function : printf( "DBOP_scalar_function" ); break;
        case DBOP_plus : printf( "DBOP_plus" ); break;
        case DBOP_minus : printf( "DBOP_minus" ); break;
        case DBOP_times : printf( "DBOP_times" ); break;
        case DBOP_over : printf( "DBOP_over" ); break;
        case DBOP_div : printf( "DBOP_div" ); break;
        case DBOP_modulo : printf( "DBOP_modulo" ); break;
        case DBOP_power : printf( "DBOP_power" ); break;
        case DBOP_like : printf( "DBOP_like" ); break;
        case DBOP_sounds_like : printf( "DBOP_sounds_like" ); break;
        case DBOP_like_any : printf( "DBOP_like_any" ); break;
        case DBOP_like_all : printf( "DBOP_like_all" ); break;
        case DBOP_is_INVALID : printf( "DBOP_is_INVALID" ); break;
        case DBOP_is_TRUE : printf( "DBOP_is_TRUE" ); break;
        case DBOP_is_FALSE : printf( "DBOP_is_FALSE" ); break;
        case DBOP_and : printf( "DBOP_and" ); break;
        case DBOP_or : printf( "DBOP_or" ); break;
        case DBOP_xor : printf( "DBOP_xor" ); break;
        case DBOP_equivalent : printf( "DBOP_equivalent" ); break;
        case DBOP_not : printf( "DBOP_not" ); break;
        case DBOP_implies : printf( "DBOP_implies" ); break;
        case DBOP_overlaps : printf( "DBOP_overlaps" ); break;
        case DBOP_case_condition : printf( "DBOP_case_condition" ); break;
        case DBOP_case_value : printf( "DBOP_case_value" ); break;
        case DBOP_nullif : printf( "DBOP_nullif" ); break;
        case DBOP_cast : printf( "DBOP_cast" ); break;
        case DBOP_coalesce : printf( "DBOP_coalesce" ); break;
        case DBOP_position : printf( "DBOP_position" ); break;
        case DBOP_extract : printf( "DBOP_extract" ); break;
        case DBOP_char_length : printf( "DBOP_char_length" ); break;
        case DBOP_octet_length : printf( "DBOP_octet_length" ); break;
        case DBOP_bit_length : printf( "DBOP_bit_length" ); break;
        case DBOP_substring : printf( "DBOP_substring" ); break;
        case DBOP_upper : printf( "DBOP_upper" ); break;
        case DBOP_lower : printf( "DBOP_lower" ); break;
        case DBOP_trim : printf( "DBOP_trim" ); break;
        case DBOP_translate : printf( "DBOP_translate" ); break;
        case DBOP_convert : printf( "DBOP_convert" ); break;
        case DBOP_string_concat : printf( "DBOP_string_concat" ); break;
        case DBOP_current_date : printf( "DBOP_current_date" ); break;
        case DBOP_current_time : printf( "DBOP_current_time" ); break;
        case DBOP_current_timestamp : printf( "DBOP_current_timestamp" ); break;
        case DBOP_content_select : printf( "DBOP_content_select" ); break;
        case DBOP_content : printf( "DBOP_content" ); break;
        case DBOP_content_freetext : printf( "DBOP_content_freetext" ); break;
        case DBOP_content_proximity : printf( "DBOP_content_proximity" ); break;
        case DBOP_content_vector_or : printf( "DBOP_content_vector_or" ); break;
        case DBOP_delete : printf( "DBOP_delete" ); break;
        case DBOP_update : printf( "DBOP_update" ); break;
        case DBOP_insert : printf( "DBOP_insert" ); break;
        case DBOP_min : printf( "DBOP_min" ); break;
        case DBOP_max : printf( "DBOP_max" ); break;
        case DBOP_count : printf( "DBOP_count" ); break;
        case DBOP_sum : printf( "DBOP_sum" ); break;
        case DBOP_avg : printf( "DBOP_avg" ); break;
        case DBOP_any_sample : printf( "DBOP_any_sample" ); break;
        case DBOP_stddev : printf( "DBOP_stddev" ); break;
        case DBOP_stddev_pop : printf( "DBOP_stddev_pop" ); break;
        case DBOP_var : printf( "DBOP_var" ); break;
        case DBOP_var_pop : printf( "DBOP_var_pop" ); break;
        case DBOP_first : printf( "DBOP_first" ); break;
        case DBOP_last : printf( "DBOP_last" ); break;
        case DBOP_in : printf( "DBOP_in" ); break;
        case DBOP_exists : printf( "DBOP_exists" ); break;
        case DBOP_unique : printf( "DBOP_unique" ); break;
        case DBOP_subset : printf( "DBOP_subset" ); break;
        case DBOP_proper_subset : printf( "DBOP_proper_subset" ); break;
        case DBOP_superset : printf( "DBOP_superset" ); break;
        case DBOP_proper_superset : printf( "DBOP_proper_superset" ); break;
        case DBOP_disjoint : printf( "DBOP_disjoint" ); break;
        case DBOP_pass_through : printf( "DBOP_pass_through" ); break;
        case DBOP_defined_by_GUID : printf( "DBOP_defined_by_GUID" ); break;
        case DBOP_text_command : printf( "DBOP_text_command" ); break;
        case DBOP_SQL_select : printf( "DBOP_SQL_select" ); break;
        case DBOP_prior_command_tree : printf( "DBOP_prior_command_tree" ); break;
        case DBOP_add_columns : printf( "DBOP_add_columns" ); break;
        case DBOP_column_list_anchor : printf( "DBOP_column_list_anchor" ); break;
        case DBOP_column_list_element : printf( "DBOP_column_list_element" ); break;
        case DBOP_command_list_anchor : printf( "DBOP_command_list_anchor" ); break;
        case DBOP_command_list_element : printf( "DBOP_command_list_element" ); break;
        case DBOP_from_list_anchor : printf( "DBOP_from_list_anchor" ); break;
        case DBOP_from_list_element : printf( "DBOP_from_list_element" ); break;
        case DBOP_project_list_anchor : printf( "DBOP_project_list_anchor" ); break;
        case DBOP_project_list_element : printf( "DBOP_project_list_element" ); break;
        case DBOP_row_list_anchor : printf( "DBOP_row_list_anchor" ); break;
        case DBOP_row_list_element : printf( "DBOP_row_list_element" ); break;
        case DBOP_scalar_list_anchor : printf( "DBOP_scalar_list_anchor" ); break;
        case DBOP_scalar_list_element : printf( "DBOP_scalar_list_element" ); break;
        case DBOP_set_list_anchor : printf( "DBOP_set_list_anchor" ); break;
        case DBOP_set_list_element : printf( "DBOP_set_list_element" ); break;
        case DBOP_sort_list_anchor : printf( "DBOP_sort_list_anchor" ); break;
        case DBOP_sort_list_element : printf( "DBOP_sort_list_element" ); break;
        case DBOP_alter_character_set : printf( "DBOP_alter_character_set" ); break;
        case DBOP_alter_collation : printf( "DBOP_alter_collation" ); break;
        case DBOP_alter_domain : printf( "DBOP_alter_domain" ); break;
        case DBOP_alter_index : printf( "DBOP_alter_index" ); break;
        case DBOP_alter_procedure : printf( "DBOP_alter_procedure" ); break;
        case DBOP_alter_schema : printf( "DBOP_alter_schema" ); break;
        case DBOP_alter_table : printf( "DBOP_alter_table" ); break;
        case DBOP_alter_trigger : printf( "DBOP_alter_trigger" ); break;
        case DBOP_alter_view : printf( "DBOP_alter_view" ); break;
        case DBOP_coldef_list_anchor : printf( "DBOP_coldef_list_anchor" ); break;
        case DBOP_coldef_list_element : printf( "DBOP_coldef_list_element" ); break;
        case DBOP_create_assertion : printf( "DBOP_create_assertion" ); break;
        case DBOP_create_character_set : printf( "DBOP_create_character_set" ); break;
        case DBOP_create_collation : printf( "DBOP_create_collation" ); break;
        case DBOP_create_domain : printf( "DBOP_create_domain" ); break;
        case DBOP_create_index : printf( "DBOP_create_index" ); break;
        case DBOP_create_procedure : printf( "DBOP_create_procedure" ); break;
        case DBOP_create_schema : printf( "DBOP_create_schema" ); break;
        case DBOP_create_synonym : printf( "DBOP_create_synonym" ); break;
        case DBOP_create_table : printf( "DBOP_create_table" ); break;
        case DBOP_create_temporary_table : printf( "DBOP_create_temporary_table" ); break;
        case DBOP_create_translation : printf( "DBOP_create_translation" ); break;
        case DBOP_create_trigger : printf( "DBOP_create_trigger" ); break;
        case DBOP_create_view : printf( "DBOP_create_view" ); break;
        case DBOP_drop_assertion : printf( "DBOP_drop_assertion" ); break;
        case DBOP_drop_character_set : printf( "DBOP_drop_character_set" ); break;
        case DBOP_drop_collation : printf( "DBOP_drop_collation" ); break;
        case DBOP_drop_domain : printf( "DBOP_drop_domain" ); break;
        case DBOP_drop_index : printf( "DBOP_drop_index" ); break;
        case DBOP_drop_procedure : printf( "DBOP_drop_procedure" ); break;
        case DBOP_drop_schema : printf( "DBOP_drop_schema" ); break;
        case DBOP_drop_synonym : printf( "DBOP_drop_synonym" ); break;
        case DBOP_drop_table : printf( "DBOP_drop_table" ); break;
        case DBOP_drop_translation : printf( "DBOP_drop_translation" ); break;
        case DBOP_drop_trigger : printf( "DBOP_drop_trigger" ); break;
        case DBOP_drop_view : printf( "DBOP_drop_view" ); break;
        case DBOP_foreign_key : printf( "DBOP_foreign_key" ); break;
        case DBOP_grant_privileges : printf( "DBOP_grant_privileges" ); break;
        case DBOP_index_list_anchor : printf( "DBOP_index_list_anchor" ); break;
        case DBOP_index_list_element : printf( "DBOP_index_list_element" ); break;
        case DBOP_primary_key : printf( "DBOP_primary_key" ); break;
        case DBOP_property_list_anchor : printf( "DBOP_property_list_anchor" ); break;
        case DBOP_property_list_element : printf( "DBOP_property_list_element" ); break;
        case DBOP_referenced_table : printf( "DBOP_referenced_table" ); break;
        case DBOP_rename_object : printf( "DBOP_rename_object" ); break;
        case DBOP_revoke_privileges : printf( "DBOP_revoke_privileges" ); break;
        case DBOP_schema_authorization : printf( "DBOP_schema_authorization" ); break;
        case DBOP_unique_key : printf( "DBOP_unique_key" ); break;
        case DBOP_scope_list_anchor : printf( "DBOP_scope_list_anchor" ); break;
        case DBOP_scope_list_element : printf( "DBOP_scope_list_element" ); break;
        case DBOP_content_table : printf( "DBOP_content_table" ); break;

        default : printf( "unknown DBOP" ); break;
    }

    printf( "\n" );

    PrintSpace( iLevel );
    printf( "wKind: (%d) ", pNode->wKind );
    switch( pNode->wKind )
    {
        case DBVALUEKIND_BYGUID :
        {
            printf( "DBVALUEKIND_BYGUID " );
            break;
        }
        case DBVALUEKIND_COLDESC :
        {
            printf( "DBVALUEKIND_COLDESC " );
            break;
        }
        case DBVALUEKIND_ID :
        {
            printf( "DBVALUEKIND_ID: " );
            if ( 0 == pNode->value.pdbidValue )
                printf( "NULL" );
            else
            {
                DBKIND kind = pNode->value.pdbidValue->eKind;

                if ( DBKIND_GUID        == kind ||
                     DBKIND_GUID_NAME   == kind ||
                     DBKIND_GUID_PROPID == kind )
                {
                    GUID &g = pNode->value.pdbidValue->uGuid.guid;
                    printf( "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-"
                            "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
                            g.Data1,g.Data2,g.Data3,g.Data4[0],
                            g.Data4[1],g.Data4[2],g.Data4[3],g.Data4[4],
                            g.Data4[5],g.Data4[6],g.Data4[7] );
                }
                if ( DBKIND_GUID_PROPID == kind ||
                     DBKIND_PROPID      == kind )
                    printf( " %d", pNode->value.pdbidValue->uName.ulPropid );
                if ( DBKIND_GUID_NAME == kind ||
                     DBKIND_NAME      == kind )
                    printf( " '%ws'", pNode->value.pdbidValue->uName.pwszName );
            }
            break;
        }
        case DBVALUEKIND_CONTENT :
        {
            printf( "DBVALUEKIND_CONTENT: " );
            if ( 0 == pNode->value.pdbcntntValue )
                printf( "NULL" );
            else
                printf( "'%ws', method %d, weight %d, lcid %#x",
                        pNode->value.pdbcntntValue->pwszPhrase,
                        pNode->value.pdbcntntValue->dwGenerateMethod,
                        pNode->value.pdbcntntValue->lWeight,
                        pNode->value.pdbcntntValue->lcid );
            break;
        }
        case DBVALUEKIND_CONTENTVECTOR :
        {
            printf( "DBVALUEKIND_CONTENTVECTOR: " );
            DBCONTENTVECTOR *p = pNode->value.pdbcntntvcValue;
            if ( 0 == p )
                printf( "NULL" );
            else
            {
                printf( "method %d, weight %d ",
                         p->dwRankingMethod,
                         p->lWeight );
            }
            break;
        }
        case DBVALUEKIND_GROUPINFO :
        {
            printf( "DBVALUEKIND_GROUPINFO " );
            break;
        }
        case DBVALUEKIND_PARAMETER :
        {
            printf( "DBVALUEKIND_PARAMETER " );
            break;
        }
        case DBVALUEKIND_PROPERTY :
        {
            printf( "DBVALUEKIND_PROPERTY " );
            break;
        }
        case DBVALUEKIND_SETFUNC :
        {
            printf( "DBVALUEKIND_SETFUNC " );
            break;
        }
        case DBVALUEKIND_SORTINFO :
        {
            printf( "DBVALUEKIND_SORTINFO: " );
            if ( 0 == pNode->value.pdbsrtinfValue )
                printf( "NULL" );
            else
                printf( "fDesc %d, lcid %#x",
                        pNode->value.pdbsrtinfValue->fDesc,
                        pNode->value.pdbsrtinfValue->lcid );
            break;
        }
        case DBVALUEKIND_TEXT :
        {
            printf( "DBVALUEKIND_TEXT " );
            break;
        }
        case DBVALUEKIND_COMMAND :
        {
            printf( "DBVALUEKIND_COMMAND " );
            break;
        }
        case DBVALUEKIND_MONIKER :
        {
            printf( "DBVALUEKIND_MONIKER " );
            break;
        }
        case DBVALUEKIND_ROWSET :
        {
            printf( "DBVALUEKIND_ROWSET " );
            break;
        }
        case DBVALUEKIND_LIKE :
        {
            printf( "DBVALUEKIND_LIKE " );
            break;
        }
        case DBVALUEKIND_CONTENTPROXIMITY :
        {
            printf( "DBVALUEKIND_CONTENTPROXIMITY " );
            break;
        }
        case DBVALUEKIND_CONTENTSCOPE :
        {
            printf( "DBVALUEKIND_CONTENTSCOPE " );
            if ( 0 == pNode->value.pdbcntntscpValue )
                printf( "NULL" );
            else
                printf( "dwFlags %#x, pwszElementValue %ws",
                        pNode->value.pdbcntntscpValue->dwFlags,
                        pNode->value.pdbcntntscpValue->pwszElementValue );
            break;
        }
        case DBVALUEKIND_CONTENTTABLE :
        {
            printf( "DBVALUEKIND_CONTENTTABLE " );
            if ( 0 == pNode->value.pdbcntnttblValue )
                printf( "NULL" );
            else
                printf( "machine %ws, catalog %ws",
                        pNode->value.pdbcntnttblValue->pwszMachine,
                        pNode->value.pdbcntnttblValue->pwszCatalog );
            break;
        }
        case DBVALUEKIND_IDISPATCH :
        {
            printf( "DBVALUEKIND_IDISPATCH " );
            break;
        }
        case DBVALUEKIND_IUNKNOWN :
        {
            printf( "DBVALUEKIND_IUNKNOWN " );
            break;
        }
        case DBVALUEKIND_EMPTY :
        {
            printf( "DBVALUEKIND_EMPTY " );
            break;
        }
        case DBVALUEKIND_NULL :
        {
            printf( "DBVALUEKIND_NULL " );
            break;
        }
        case DBVALUEKIND_I2 :
        {
            printf( "DBVALUEKIND_I2: %d", pNode->value.sValue );
            break;
        }
        case DBVALUEKIND_I4 :
        {
            printf( "DBVALUEKIND_I4: %d", pNode->value.lValue );
            break;
        }
        case DBVALUEKIND_R4 :
        {
            printf( "DBVALUEKIND_R4: %f", pNode->value.flValue );
            break;
        }
        case DBVALUEKIND_R8 :
        {
            printf( "DBVALUEKIND_R8: %lf", pNode->value.dblValue );
            break;
        }
        case DBVALUEKIND_CY :
        {
            printf( "DBVALUEKIND_CY " );
            break;
        }
        case DBVALUEKIND_DATE :
        {
            printf( "DBVALUEKIND_DATE " );
            break;
        }
        case DBVALUEKIND_BSTR :
        {
            printf( "DBVALUEKIND_BSTR: '%ws'", pNode->value.pbstrValue );
            break;
        }
        case DBVALUEKIND_ERROR :
        {
            printf( "DBVALUEKIND_ERROR: %d", pNode->value.scodeValue );
            break;
        }
        case DBVALUEKIND_BOOL :
        {
            printf( "DBVALUEKIND_BOOL: %d", pNode->value.fValue );
            break;
        }
        case DBVALUEKIND_VARIANT :
        {
            printf( "DBVALUEKIND_VARIANT " );

            // Indexing Service uses PROPVARIANTs (extended VARIANTs)

            DisplayVariant( (PROPVARIANT *) pNode->value.pvarValue );
            break;
        }
        case DBVALUEKIND_I1 :
        {
            printf( "DBVALUEKIND_I1: %d", pNode->value.schValue );
            break;
        }
        case DBVALUEKIND_UI1 :
        {
            printf( "DBVALUEKIND_UI1: %u", pNode->value.uchValue );
            break;
        }
        case DBVALUEKIND_UI2 :
        {
            printf( "DBVALUEKIND_UI2: %u", pNode->value.usValue );
            break;
        }
        case DBVALUEKIND_UI4 :
        {
            printf( "DBVALUEKIND_UI4: %u", pNode->value.ulValue );
            break;
        }
        case DBVALUEKIND_I8 :
        {
            printf( "DBVALUEKIND_I8: %I64d", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_UI8 :
        {
            printf( "DBVALUEKIND_UI8: %I64u", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_GUID :
        {
            printf( "DBVALUEKIND_GUID " );
            break;
        }
        case DBVALUEKIND_BYTES :
        {
            printf( "DBVALUEKIND_BYTES " );
            break;
        }
        case DBVALUEKIND_STR :
        {
            printf( "DBVALUEKIND_STR: '%s'", pNode->value.pzValue );
            break;
        }
        case DBVALUEKIND_WSTR :
        {
            printf( "DBVALUEKIND_WSTR: '%ws'", pNode->value.pwszValue );
            break;
        }
        case DBVALUEKIND_NUMERIC :
        {
            printf( "DBVALUEKIND_NUMERIC " );
            break;
        }
        case DBVALUEKIND_DBDATE :
        {
            printf( "DBVALUEKIND_DBDATE " );
            break;
        }
        case DBVALUEKIND_DBTIME :
        {
            printf( "DBVALUEKIND_DBTIME " );
            break;
        }
        case DBVALUEKIND_DBTIMESTAMP :
        {
            printf( "DBVALUEKIND_DBTIMESTAMP " );
            break;
        }
        default :
        {
            printf( "unknown DBVALUEKIND " );
            break;
        }
    }

    printf( "\n" );

    if ( pNode->pctFirstChild )
    {
        PrintSpace( iLevel );
        printf( "first child:\n" );
        DisplayCommandTree( pNode->pctFirstChild, iLevel + 1 );
    }

    if ( pNode->pctNextSibling )
    {
        PrintSpace( iLevel );
        printf( "next sibling:\n" );
        DisplayCommandTree( pNode->pctNextSibling, iLevel + 1 );
    }

    if ( 0 == iLevel )
        printf( "\n" );
} //DisplayCommandTree

void DisplayVariant ( PROPVARIANT * pVar )

Definition at line 68 of file DispTree.Cxx.

{
    if ( 0 == pVar )
    {
        printf( "NULL" );
        return;
    }

    PROPVARIANT & v = *pVar;

    switch ( v.vt )
    {
        case VT_I4 : printf( "VT_I4 %d", v.lVal ); break;
        case VT_UI1 : printf( "VT_UI1 %d", v.bVal ); break;
        case VT_I2 : printf( "VT_I2 %d", v.iVal ); break;
        case VT_R4 : printf( "VT_R4 %f", v.fltVal ); break;
        case VT_R8 : printf( "VT_R8 %lf", v.dblVal ); break;
        case VT_BOOL : printf( "VT_BOOL %d", v.boolVal ); break;
        case VT_ERROR : printf( "VT_ERROR %#x", v.scode ); break;
        case VT_CY :
        {
            double dbl;
            HRESULT hr = VarR8FromCy( pVar->cyVal, &dbl );

            if ( SUCCEEDED( hr ) )
                printf( "VT_CY %lf", dbl );
            break;
        }
        case VT_DATE : printf( "VT_DATE " ); break;
        case VT_FILETIME : printf( "VT_FILETIME %#I64x ", v.filetime ); break;
        case VT_BSTR : printf( "VT_BSTR '%ws'", v.bstrVal ); break;
        case VT_UNKNOWN : printf( "VT_UNKNOWN " ); break;
        case VT_DISPATCH : printf( "VT_DISPATCH " ); break;
        case VT_BYREF|VT_UI1 : printf( "VT_BYREF|VT_UI1 " ); break;
        case VT_BYREF|VT_I2 : printf( "VT_BYREF|VT_I2 " ); break;
        case VT_BYREF|VT_I4 : printf( "VT_BYREF|VT_I4 " ); break;
        case VT_BYREF|VT_R4 : printf( "VT_BYREF|VT_R4 " ); break;
        case VT_BYREF|VT_R8 : printf( "VT_BYREF|VT_R8 " ); break;
        case VT_BYREF|VT_BOOL : printf( "VT_BYREF|VT_BOOL " ); break;
        case VT_BYREF|VT_ERROR : printf( "VT_BYREF|VT_ERROR " ); break;
        case VT_BYREF|VT_CY : printf( "VT_BYREF|VT_CY " ); break;
        case VT_BYREF|VT_DATE : printf( "VT_BYREF|VT_DATE " ); break;
        case VT_BYREF|VT_BSTR : printf( "VT_BYREF|VT_BSTR " ); break;
        case VT_BYREF|VT_UNKNOWN : printf( "VT_BYREF|VT_UNKNOWN " ); break;
        case VT_BYREF|VT_DISPATCH : printf( "VT_BYREF|VT_DISPATCH " ); break;
        case VT_BYREF|VT_ARRAY : printf( "VT_BYREF|VT_ARRAY " ); break;
        case VT_BYREF|VT_VARIANT : printf( "VT_BYREF|VT_VARIANT " ); break;
        case VT_I1 : printf( "VT_I1 %d", v.bVal ); break;
        case VT_UI2 : printf( "VT_UI2 %u", v.uiVal ); break;
        case VT_UI4 : printf( "VT_UI4 %u", v.ulVal ); break;
        case VT_INT : printf( "VT_INT %d", v.lVal ); break;
        case VT_UINT : printf( "VT_UINT %u", v.ulVal ); break;
        case VT_BYREF|VT_DECIMAL : printf( "VT_BYREF|VT_DECIMAL " ); break;
        case VT_BYREF|VT_I1 : printf( "VT_BYREF|VT_I1 " ); break;
        case VT_BYREF|VT_UI2 : printf( "VT_BYREF|VT_UI2 " ); break;
        case VT_BYREF|VT_UI4 : printf( "VT_BYREF|VT_UI4 " ); break;
        case VT_BYREF|VT_INT : printf( "VT_BYREF|VT_INT " ); break;
        case VT_BYREF|VT_UINT : printf( "VT_BYREF|VT_UINT " ); break;
        case VT_LPSTR : printf( "VT_LPSTR '%s'", v.pszVal ); break;
        case VT_LPWSTR : printf( "VT_LPWSTR '%ws'", v.pwszVal ); break;
        case VT_I8 : printf( "VT_I8 %I64d", v.hVal ); break;
        case VT_UI8 : printf( "VT_I8 %I64u", v.hVal ); break;
        case VT_VECTOR | VT_I1:
            printf( "VT_VECTOR | VT_I1 " );
            PrintVectorItems( v.caub.pElems, v.caub.cElems, "%d" );
            break;
        case VT_VECTOR | VT_I2:
            printf( "VT_VECTOR | VT_I2 " );
            PrintVectorItems( v.cai.pElems, v.cai.cElems, "%d" );
            break;
        case VT_VECTOR | VT_I4:
            printf( "VT_VECTOR | VT_I4 " );
            PrintVectorItems( v.cal.pElems, v.cal.cElems, "%d" );
            break;
        case VT_VECTOR | VT_I8:
            printf( "VT_VECTOR | VT_I8 " );
            PrintVectorItems( v.cah.pElems, v.cah.cElems, "%I64d" );
            break;
        case VT_VECTOR | VT_UI1:
            printf( "VT_VECTOR | VT_UI1 " );
            PrintVectorItems( v.caub.pElems, v.caub.cElems, "%u" );
            break;
        case VT_VECTOR | VT_UI2:
            printf( "VT_VECTOR | VT_UI2 " );
            PrintVectorItems( v.caui.pElems, v.caui.cElems, "%u" );
            break;
        case VT_VECTOR | VT_UI4:
            printf( "VT_VECTOR | VT_UI4 " );
            PrintVectorItems( v.caul.pElems, v.caul.cElems, "%u" );
            break;
        case VT_VECTOR | VT_UI8:
            printf( "VT_VECTOR | VT_UI8 " );
            PrintVectorItems( v.cauh.pElems, v.cauh.cElems, "%I64u" );
            break;
        case VT_VECTOR | VT_BSTR:
            printf( "VT_VECTOR | VT_BSTR " );
            PrintVectorItems( v.cabstr.pElems, v.cabstr.cElems, "%ws" );
            break;
        case VT_VECTOR | VT_LPSTR:
            printf( "VT_VECTOR | VT_LPSTR " );
            PrintVectorItems( v.calpstr.pElems, v.calpstr.cElems, "%s" );
            break;
        case VT_VECTOR | VT_LPWSTR:
            printf( "VT_VECTOR | VT_LPWSTR " );
            PrintVectorItems( v.calpwstr.pElems, v.calpwstr.cElems, "%ws" );
            break;
        case VT_VECTOR | VT_R4:
            printf( "VT_VECTOR | VT_R4 " );
            PrintVectorItems( v.caflt.pElems, v.caflt.cElems, "%f" );
            break;
        case VT_VECTOR | VT_R8:
            printf( "VT_VECTOR | VT_R8 " );
            PrintVectorItems( v.cadbl.pElems, v.cadbl.cElems, "%lf" );
            break;
        default : printf( "unknown vt %#x", v.vt );
    }
} //DisplayVariant

void PrintSpace ( ULONG cPlaces )

Definition at line 196 of file DispTree.Cxx.

{
    for( ULONG iPlace = 0; iPlace < cPlaces; iPlace++ )
        printf( "  " );
} //PrintSpace

template<class T >
void PrintVectorItems | ( | T * | pVal,
 |  | ULONG | cVals,
 |  | char * | pcFmt
 | ) |  |

Definition at line 39 of file DispTree.Cxx.

{
    printf( "{ " );

    for( ULONG iVal = 0; iVal < cVals; iVal++ )
    {
        if ( 0 != iVal )
            printf( "," );
        printf( pcFmt, *pVal++ );
    }

    printf( " }" );
} //PrintVectorItems

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/Simple/QSample.Cxx File Reference

  • WinBase
  • Indexing
  • Simple
Classes | Defines | Functions

QSample.Cxx File Reference

#include <stdio.h>
#include <wchar.h>
#include <windows.h>
#include <oledberr.h>
#include <oledb.h>
#include <cmdtree.h>
#include <ntquery.h>
#include <mlang.h>
#include "qsample.hxx"

Go to the source code of this file.

Classes

class | CResString
class | XBStr
class | XInterface< T >
class | XPtr< T >

Defines

#define | DBINITCONSTANTS
#define | UNICODE

Functions

void | DisplayCommandTree (DBCOMMANDTREE *pNode, ULONG iLevel=0)
void | DisplayError (UINT uiError, WCHAR const *pwcArgument, HRESULT hr, LCID lcid)
HRESULT | DisplayRowsetStatus (XInterface< IRowset > &xIRowset)
void | DisplayStat (DWORD dw, UINT uiMsg)
void | DisplayStat (WCHAR const *pwcMsg, UINT uiMsg)
void | DisplayStat (UINT uiMsg)
HRESULT | DisplayStatus (WCHAR const *pwcCatalog, WCHAR const *pwcMachine, LCID lcid)
HRESULT | DisplayUpToDate (WCHAR const *pwcCatalog, WCHAR const *pwcMachine, LCID lcid)
void | DisplayValue (PROPVARIANT const *pVar)
HRESULT | DisplayWin32Error (UINT uiError, WCHAR const *pwcArgument, LCID lcid)
HRESULT | DoQuery (WCHAR const *pwcCatalog, WCHAR const *pwcMachine, WCHAR const *pwcScope, DWORD dwScopeFlags, WCHAR const *pwcRestriction, WCHAR const *pwcColumns, WCHAR const *pwcSort, BOOL fDisplayTree, BOOL fQuiet, BOOL fForceUseContentIndex, BOOL fNoQuery, ULONG ulDialect, ULONG cMaxHits, LCID lcid)
HRESULT | DoQueryFile (WCHAR const *pwcQueryCatalog, WCHAR const *pwcQueryMachine, WCHAR const *pwcQueryScope, DWORD dwScopeFlags, WCHAR const *pwcColumns, WCHAR const *pwcSort, BOOL fDisplayTree, BOOL fQuiet, BOOL fForceUseContentIndex, BOOL fNoQuery, ULONG ulDialect, ULONG cMaxHits, LCID lcid, WCHAR const *pwcQueryFile)
void | FormatError (SCODE sc, WCHAR *pwc, ULONG cwc, LCID lcid)
WCHAR const * | GetLocaleString (LCID lcid)
HRESULT | GetOleDBErrorInfo (IUnknown *pErrSrc, REFIID riid, LCID lcid, ERRORINFO *pErrorInfo, IErrorInfo **ppIErrorInfo)
HRESULT | IssueQuery (WCHAR const *pwcQueryCatalog, WCHAR const *pwcQueryMachine, WCHAR const *pwcQueryScope, DWORD dwScopeFlags, WCHAR const *pwcQueryRestriction, WCHAR const *pwcColumns, WCHAR const *pwcSort, BOOL fDisplayTree, BOOL fQuiet, BOOL fForceUseContentIndex, BOOL fNoQuery, ULONG ulDialect, ULONG cMaxHits, LCID lcid)
LCID | LcidFromHttpAcceptLanguage (WCHAR const *pwc)
ULONG | LocaleToCodepage (LCID lcid)
HRESULT | LookupCatalog (WCHAR const *pwcScope, WCHAR *pwcMachine, ULONG &cwcMachine, WCHAR *pwcCatalog, ULONG &cwcCatalog, LCID lcid)
HRESULT | NormalizeScope (WCHAR const *pwcIn, WCHAR *pwcOut, BOOL fShallow, DWORD &dwScopeFlags)
void | PrintSafeArray (VARTYPE vt, LPSAFEARRAY pa)
template<class T >
void | PrintVectorItems (T *pVal, ULONG cVals, char *pcFmt)
void | Render (VARTYPE vt, void *pv)
HRESULT | SetCommandProperties (ICommand *pICommand, BOOL fForceUseContentIndex, LCID lcid, ULONG cMaxHits)
void | Usage ()
int __cdecl | wmain (int argc, WCHAR *argv[])

Define Documentation

#define DBINITCONSTANTS

Definition at line 20 of file QSample.Cxx.

#define UNICODE

Definition at line 19 of file QSample.Cxx.

Function Documentation

void DisplayCommandTree | ( | DBCOMMANDTREE * | pNode,
 |  | ULONG | iLevel = 0
 | ) |  |

Definition at line 215 of file DispTree.Cxx.

{
    PrintSpace( iLevel );
    printf( "op: (%d) ", pNode->op );
    switch ( pNode->op )
    {
        case DBOP_scalar_constant : printf( "DBOP_scalar_constant" ); break;
        case DBOP_DEFAULT : printf( "DBOP_DEFAULT" ); break;
        case DBOP_NULL : printf( "DBOP_NULL" ); break;
        case DBOP_bookmark_name : printf( "DBOP_bookmark_name" ); break;
        case DBOP_catalog_name : printf( "DBOP_catalog_name" ); break;
        case DBOP_column_name : printf( "DBOP_column_name" ); break;
        case DBOP_schema_name : printf( "DBOP_schema_name" ); break;
        case DBOP_outall_name : printf( "DBOP_outall_name" ); break;
        case DBOP_qualifier_name : printf( "DBOP_qualifier_name" ); break;
        case DBOP_qualified_column_name : printf( "DBOP_qualified_column_name" ); break;
        case DBOP_table_name : printf( "DBOP_table_name" ); break;
        case DBOP_nested_table_name : printf( "DBOP_nested_table_name" ); break;
        case DBOP_nested_column_name : printf( "DBOP_nested_column_name" ); break;
        case DBOP_row : printf( "DBOP_row" ); break;
        case DBOP_table : printf( "DBOP_table" ); break;
        case DBOP_sort : printf( "DBOP_sort" ); break;
        case DBOP_distinct : printf( "DBOP_distinct" ); break;
        case DBOP_distinct_order_preserving : printf( "DBOP_distinct_order_preserving" ); break;
        case DBOP_alias : printf( "DBOP_alias" ); break;
        case DBOP_cross_join : printf( "DBOP_cross_join" ); break;
        case DBOP_union_join : printf( "DBOP_union_join" ); break;
        case DBOP_inner_join : printf( "DBOP_inner_join" ); break;
        case DBOP_left_semi_join : printf( "DBOP_left_semi_join" ); break;
        case DBOP_right_semi_join : printf( "DBOP_right_semi_join" ); break;
        case DBOP_left_anti_semi_join : printf( "DBOP_left_anti_semi_join" ); break;
        case DBOP_right_anti_semi_join : printf( "DBOP_right_anti_semi_join" ); break;
        case DBOP_left_outer_join : printf( "DBOP_left_outer_join" ); break;
        case DBOP_right_outer_join : printf( "DBOP_right_outer_join" ); break;
        case DBOP_full_outer_join : printf( "DBOP_full_outer_join" ); break;
        case DBOP_natural_join : printf( "DBOP_natural_join" ); break;
        case DBOP_natural_left_outer_join : printf( "DBOP_natural_left_outer_join" ); break;
        case DBOP_natural_right_outer_join : printf( "DBOP_natural_right_outer_join" ); break;
        case DBOP_natural_full_outer_join : printf( "DBOP_natural_full_outer_join" ); break;
        case DBOP_set_intersection : printf( "DBOP_set_intersection" ); break;
        case DBOP_set_union : printf( "DBOP_set_union" ); break;
        case DBOP_set_left_difference : printf( "DBOP_set_left_difference" ); break;
        case DBOP_set_right_difference : printf( "DBOP_set_right_difference" ); break;
        case DBOP_set_anti_difference : printf( "DBOP_set_anti_difference" ); break;
        case DBOP_bag_intersection : printf( "DBOP_bag_intersection" ); break;
        case DBOP_bag_union : printf( "DBOP_bag_union" ); break;
        case DBOP_bag_left_difference : printf( "DBOP_bag_left_difference" ); break;
        case DBOP_bag_right_difference : printf( "DBOP_bag_right_difference" ); break;
        case DBOP_bag_anti_difference : printf( "DBOP_bag_anti_difference" ); break;
        case DBOP_division : printf( "DBOP_division" ); break;
        case DBOP_relative_sampling : printf( "DBOP_relative_sampling" ); break;
        case DBOP_absolute_sampling : printf( "DBOP_absolute_sampling" ); break;
        case DBOP_transitive_closure : printf( "DBOP_transitive_closure" ); break;
        case DBOP_recursive_union : printf( "DBOP_recursive_union" ); break;
        case DBOP_aggregate : printf( "DBOP_aggregate" ); break;
        case DBOP_remote_table : printf( "DBOP_remote_table" ); break;
        case DBOP_select : printf( "DBOP_select" ); break;
        case DBOP_order_preserving_select : printf( "DBOP_order_preserving_select" ); break;
        case DBOP_project : printf( "DBOP_project" ); break;
        case DBOP_project_order_preserving : printf( "DBOP_project_order_preserving" ); break;
        case DBOP_top : printf( "DBOP_top" ); break;
        case DBOP_top_percent : printf( "DBOP_top_percent" ); break;
        case DBOP_top_plus_ties : printf( "DBOP_top_plus_ties" ); break;
        case DBOP_top_percent_plus_ties : printf( "DBOP_top_percent_plus_ties" ); break;
        case DBOP_rank : printf( "DBOP_rank" ); break;
        case DBOP_rank_ties_equally : printf( "DBOP_rank_ties_equally" ); break;
        case DBOP_rank_ties_equally_and_skip : printf( "DBOP_rank_ties_equally_and_skip" ); break;
        case DBOP_navigate : printf( "DBOP_navigate" ); break;
        case DBOP_nesting : printf( "DBOP_nesting" ); break;
        case DBOP_unnesting : printf( "DBOP_unnesting" ); break;
        case DBOP_nested_apply : printf( "DBOP_nested_apply" ); break;
        case DBOP_cross_tab : printf( "DBOP_cross_tab" ); break;
        case DBOP_is_NULL : printf( "DBOP_is_NULL" ); break;
        case DBOP_is_NOT_NULL : printf( "DBOP_is_NOT_NULL" ); break;
        case DBOP_equal : printf( "DBOP_equal" ); break;
        case DBOP_not_equal : printf( "DBOP_not_equal" ); break;
        case DBOP_less : printf( "DBOP_less" ); break;
        case DBOP_less_equal : printf( "DBOP_less_equal" ); break;
        case DBOP_greater : printf( "DBOP_greater" ); break;
        case DBOP_greater_equal : printf( "DBOP_greater_equal" ); break;
        case DBOP_equal_all : printf( "DBOP_equal_all" ); break;
        case DBOP_not_equal_all : printf( "DBOP_not_equal_all" ); break;
        case DBOP_less_all : printf( "DBOP_less_all" ); break;
        case DBOP_less_equal_all : printf( "DBOP_less_equal_all" ); break;
        case DBOP_greater_all : printf( "DBOP_greater_all" ); break;
        case DBOP_greater_equal_all : printf( "DBOP_greater_equal_all" ); break;
        case DBOP_equal_any : printf( "DBOP_equal_any" ); break;
        case DBOP_not_equal_any : printf( "DBOP_not_equal_any" ); break;
        case DBOP_less_any : printf( "DBOP_less_any" ); break;
        case DBOP_less_equal_any : printf( "DBOP_less_equal_any" ); break;
        case DBOP_greater_any : printf( "DBOP_greater_any" ); break;
        case DBOP_greater_equal_any : printf( "DBOP_greater_equal_any" ); break;
        case DBOP_anybits : printf( "DBOP_anybits" ); break;
        case DBOP_allbits : printf( "DBOP_allbits" ); break;
        case DBOP_anybits_any : printf( "DBOP_anybits_any" ); break;
        case DBOP_allbits_any : printf( "DBOP_allbits_any" ); break;
        case DBOP_anybits_all : printf( "DBOP_anybits_all" ); break;
        case DBOP_allbits_all : printf( "DBOP_allbits_all" ); break;
        case DBOP_between : printf( "DBOP_between" ); break;
        case DBOP_between_unordered : printf( "DBOP_between_unordered" ); break;
        case DBOP_match : printf( "DBOP_match" ); break;
        case DBOP_match_unique : printf( "DBOP_match_unique" ); break;
        case DBOP_match_partial : printf( "DBOP_match_partial" ); break;
        case DBOP_match_partial_unique : printf( "DBOP_match_partial_unique" ); break;
        case DBOP_match_full : printf( "DBOP_match_full" ); break;
        case DBOP_match_full_unique : printf( "DBOP_match_full_unique" ); break;
        case DBOP_scalar_parameter : printf( "DBOP_scalar_parameter" ); break;
        case DBOP_scalar_function : printf( "DBOP_scalar_function" ); break;
        case DBOP_plus : printf( "DBOP_plus" ); break;
        case DBOP_minus : printf( "DBOP_minus" ); break;
        case DBOP_times : printf( "DBOP_times" ); break;
        case DBOP_over : printf( "DBOP_over" ); break;
        case DBOP_div : printf( "DBOP_div" ); break;
        case DBOP_modulo : printf( "DBOP_modulo" ); break;
        case DBOP_power : printf( "DBOP_power" ); break;
        case DBOP_like : printf( "DBOP_like" ); break;
        case DBOP_sounds_like : printf( "DBOP_sounds_like" ); break;
        case DBOP_like_any : printf( "DBOP_like_any" ); break;
        case DBOP_like_all : printf( "DBOP_like_all" ); break;
        case DBOP_is_INVALID : printf( "DBOP_is_INVALID" ); break;
        case DBOP_is_TRUE : printf( "DBOP_is_TRUE" ); break;
        case DBOP_is_FALSE : printf( "DBOP_is_FALSE" ); break;
        case DBOP_and : printf( "DBOP_and" ); break;
        case DBOP_or : printf( "DBOP_or" ); break;
        case DBOP_xor : printf( "DBOP_xor" ); break;
        case DBOP_equivalent : printf( "DBOP_equivalent" ); break;
        case DBOP_not : printf( "DBOP_not" ); break;
        case DBOP_implies : printf( "DBOP_implies" ); break;
        case DBOP_overlaps : printf( "DBOP_overlaps" ); break;
        case DBOP_case_condition : printf( "DBOP_case_condition" ); break;
        case DBOP_case_value : printf( "DBOP_case_value" ); break;
        case DBOP_nullif : printf( "DBOP_nullif" ); break;
        case DBOP_cast : printf( "DBOP_cast" ); break;
        case DBOP_coalesce : printf( "DBOP_coalesce" ); break;
        case DBOP_position : printf( "DBOP_position" ); break;
        case DBOP_extract : printf( "DBOP_extract" ); break;
        case DBOP_char_length : printf( "DBOP_char_length" ); break;
        case DBOP_octet_length : printf( "DBOP_octet_length" ); break;
        case DBOP_bit_length : printf( "DBOP_bit_length" ); break;
        case DBOP_substring : printf( "DBOP_substring" ); break;
        case DBOP_upper : printf( "DBOP_upper" ); break;
        case DBOP_lower : printf( "DBOP_lower" ); break;
        case DBOP_trim : printf( "DBOP_trim" ); break;
        case DBOP_translate : printf( "DBOP_translate" ); break;
        case DBOP_convert : printf( "DBOP_convert" ); break;
        case DBOP_string_concat : printf( "DBOP_string_concat" ); break;
        case DBOP_current_date : printf( "DBOP_current_date" ); break;
        case DBOP_current_time : printf( "DBOP_current_time" ); break;
        case DBOP_current_timestamp : printf( "DBOP_current_timestamp" ); break;
        case DBOP_content_select : printf( "DBOP_content_select" ); break;
        case DBOP_content : printf( "DBOP_content" ); break;
        case DBOP_content_freetext : printf( "DBOP_content_freetext" ); break;
        case DBOP_content_proximity : printf( "DBOP_content_proximity" ); break;
        case DBOP_content_vector_or : printf( "DBOP_content_vector_or" ); break;
        case DBOP_delete : printf( "DBOP_delete" ); break;
        case DBOP_update : printf( "DBOP_update" ); break;
        case DBOP_insert : printf( "DBOP_insert" ); break;
        case DBOP_min : printf( "DBOP_min" ); break;
        case DBOP_max : printf( "DBOP_max" ); break;
        case DBOP_count : printf( "DBOP_count" ); break;
        case DBOP_sum : printf( "DBOP_sum" ); break;
        case DBOP_avg : printf( "DBOP_avg" ); break;
        case DBOP_any_sample : printf( "DBOP_any_sample" ); break;
        case DBOP_stddev : printf( "DBOP_stddev" ); break;
        case DBOP_stddev_pop : printf( "DBOP_stddev_pop" ); break;
        case DBOP_var : printf( "DBOP_var" ); break;
        case DBOP_var_pop : printf( "DBOP_var_pop" ); break;
        case DBOP_first : printf( "DBOP_first" ); break;
        case DBOP_last : printf( "DBOP_last" ); break;
        case DBOP_in : printf( "DBOP_in" ); break;
        case DBOP_exists : printf( "DBOP_exists" ); break;
        case DBOP_unique : printf( "DBOP_unique" ); break;
        case DBOP_subset : printf( "DBOP_subset" ); break;
        case DBOP_proper_subset : printf( "DBOP_proper_subset" ); break;
        case DBOP_superset : printf( "DBOP_superset" ); break;
        case DBOP_proper_superset : printf( "DBOP_proper_superset" ); break;
        case DBOP_disjoint : printf( "DBOP_disjoint" ); break;
        case DBOP_pass_through : printf( "DBOP_pass_through" ); break;
        case DBOP_defined_by_GUID : printf( "DBOP_defined_by_GUID" ); break;
        case DBOP_text_command : printf( "DBOP_text_command" ); break;
        case DBOP_SQL_select : printf( "DBOP_SQL_select" ); break;
        case DBOP_prior_command_tree : printf( "DBOP_prior_command_tree" ); break;
        case DBOP_add_columns : printf( "DBOP_add_columns" ); break;
        case DBOP_column_list_anchor : printf( "DBOP_column_list_anchor" ); break;
        case DBOP_column_list_element : printf( "DBOP_column_list_element" ); break;
        case DBOP_command_list_anchor : printf( "DBOP_command_list_anchor" ); break;
        case DBOP_command_list_element : printf( "DBOP_command_list_element" ); break;
        case DBOP_from_list_anchor : printf( "DBOP_from_list_anchor" ); break;
        case DBOP_from_list_element : printf( "DBOP_from_list_element" ); break;
        case DBOP_project_list_anchor : printf( "DBOP_project_list_anchor" ); break;
        case DBOP_project_list_element : printf( "DBOP_project_list_element" ); break;
        case DBOP_row_list_anchor : printf( "DBOP_row_list_anchor" ); break;
        case DBOP_row_list_element : printf( "DBOP_row_list_element" ); break;
        case DBOP_scalar_list_anchor : printf( "DBOP_scalar_list_anchor" ); break;
        case DBOP_scalar_list_element : printf( "DBOP_scalar_list_element" ); break;
        case DBOP_set_list_anchor : printf( "DBOP_set_list_anchor" ); break;
        case DBOP_set_list_element : printf( "DBOP_set_list_element" ); break;
        case DBOP_sort_list_anchor : printf( "DBOP_sort_list_anchor" ); break;
        case DBOP_sort_list_element : printf( "DBOP_sort_list_element" ); break;
        case DBOP_alter_character_set : printf( "DBOP_alter_character_set" ); break;
        case DBOP_alter_collation : printf( "DBOP_alter_collation" ); break;
        case DBOP_alter_domain : printf( "DBOP_alter_domain" ); break;
        case DBOP_alter_index : printf( "DBOP_alter_index" ); break;
        case DBOP_alter_procedure : printf( "DBOP_alter_procedure" ); break;
        case DBOP_alter_schema : printf( "DBOP_alter_schema" ); break;
        case DBOP_alter_table : printf( "DBOP_alter_table" ); break;
        case DBOP_alter_trigger : printf( "DBOP_alter_trigger" ); break;
        case DBOP_alter_view : printf( "DBOP_alter_view" ); break;
        case DBOP_coldef_list_anchor : printf( "DBOP_coldef_list_anchor" ); break;
        case DBOP_coldef_list_element : printf( "DBOP_coldef_list_element" ); break;
        case DBOP_create_assertion : printf( "DBOP_create_assertion" ); break;
        case DBOP_create_character_set : printf( "DBOP_create_character_set" ); break;
        case DBOP_create_collation : printf( "DBOP_create_collation" ); break;
        case DBOP_create_domain : printf( "DBOP_create_domain" ); break;
        case DBOP_create_index : printf( "DBOP_create_index" ); break;
        case DBOP_create_procedure : printf( "DBOP_create_procedure" ); break;
        case DBOP_create_schema : printf( "DBOP_create_schema" ); break;
        case DBOP_create_synonym : printf( "DBOP_create_synonym" ); break;
        case DBOP_create_table : printf( "DBOP_create_table" ); break;
        case DBOP_create_temporary_table : printf( "DBOP_create_temporary_table" ); break;
        case DBOP_create_translation : printf( "DBOP_create_translation" ); break;
        case DBOP_create_trigger : printf( "DBOP_create_trigger" ); break;
        case DBOP_create_view : printf( "DBOP_create_view" ); break;
        case DBOP_drop_assertion : printf( "DBOP_drop_assertion" ); break;
        case DBOP_drop_character_set : printf( "DBOP_drop_character_set" ); break;
        case DBOP_drop_collation : printf( "DBOP_drop_collation" ); break;
        case DBOP_drop_domain : printf( "DBOP_drop_domain" ); break;
        case DBOP_drop_index : printf( "DBOP_drop_index" ); break;
        case DBOP_drop_procedure : printf( "DBOP_drop_procedure" ); break;
        case DBOP_drop_schema : printf( "DBOP_drop_schema" ); break;
        case DBOP_drop_synonym : printf( "DBOP_drop_synonym" ); break;
        case DBOP_drop_table : printf( "DBOP_drop_table" ); break;
        case DBOP_drop_translation : printf( "DBOP_drop_translation" ); break;
        case DBOP_drop_trigger : printf( "DBOP_drop_trigger" ); break;
        case DBOP_drop_view : printf( "DBOP_drop_view" ); break;
        case DBOP_foreign_key : printf( "DBOP_foreign_key" ); break;
        case DBOP_grant_privileges : printf( "DBOP_grant_privileges" ); break;
        case DBOP_index_list_anchor : printf( "DBOP_index_list_anchor" ); break;
        case DBOP_index_list_element : printf( "DBOP_index_list_element" ); break;
        case DBOP_primary_key : printf( "DBOP_primary_key" ); break;
        case DBOP_property_list_anchor : printf( "DBOP_property_list_anchor" ); break;
        case DBOP_property_list_element : printf( "DBOP_property_list_element" ); break;
        case DBOP_referenced_table : printf( "DBOP_referenced_table" ); break;
        case DBOP_rename_object : printf( "DBOP_rename_object" ); break;
        case DBOP_revoke_privileges : printf( "DBOP_revoke_privileges" ); break;
        case DBOP_schema_authorization : printf( "DBOP_schema_authorization" ); break;
        case DBOP_unique_key : printf( "DBOP_unique_key" ); break;
        case DBOP_scope_list_anchor : printf( "DBOP_scope_list_anchor" ); break;
        case DBOP_scope_list_element : printf( "DBOP_scope_list_element" ); break;
        case DBOP_content_table : printf( "DBOP_content_table" ); break;

        default : printf( "unknown DBOP" ); break;
    }

    printf( "\n" );

    PrintSpace( iLevel );
    printf( "wKind: (%d) ", pNode->wKind );
    switch( pNode->wKind )
    {
        case DBVALUEKIND_BYGUID :
        {
            printf( "DBVALUEKIND_BYGUID " );
            break;
        }
        case DBVALUEKIND_COLDESC :
        {
            printf( "DBVALUEKIND_COLDESC " );
            break;
        }
        case DBVALUEKIND_ID :
        {
            printf( "DBVALUEKIND_ID: " );
            if ( 0 == pNode->value.pdbidValue )
                printf( "NULL" );
            else
            {
                DBKIND kind = pNode->value.pdbidValue->eKind;

                if ( DBKIND_GUID        == kind ||
                     DBKIND_GUID_NAME   == kind ||
                     DBKIND_GUID_PROPID == kind )
                {
                    GUID &g = pNode->value.pdbidValue->uGuid.guid;
                    printf( "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-"
                            "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
                            g.Data1,g.Data2,g.Data3,g.Data4[0],
                            g.Data4[1],g.Data4[2],g.Data4[3],g.Data4[4],
                            g.Data4[5],g.Data4[6],g.Data4[7] );
                }
                if ( DBKIND_GUID_PROPID == kind ||
                     DBKIND_PROPID      == kind )
                    printf( " %d", pNode->value.pdbidValue->uName.ulPropid );
                if ( DBKIND_GUID_NAME == kind ||
                     DBKIND_NAME      == kind )
                    printf( " '%ws'", pNode->value.pdbidValue->uName.pwszName );
            }
            break;
        }
        case DBVALUEKIND_CONTENT :
        {
            printf( "DBVALUEKIND_CONTENT: " );
            if ( 0 == pNode->value.pdbcntntValue )
                printf( "NULL" );
            else
                printf( "'%ws', method %d, weight %d, lcid %#x",
                        pNode->value.pdbcntntValue->pwszPhrase,
                        pNode->value.pdbcntntValue->dwGenerateMethod,
                        pNode->value.pdbcntntValue->lWeight,
                        pNode->value.pdbcntntValue->lcid );
            break;
        }
        case DBVALUEKIND_CONTENTVECTOR :
        {
            printf( "DBVALUEKIND_CONTENTVECTOR: " );
            DBCONTENTVECTOR *p = pNode->value.pdbcntntvcValue;
            if ( 0 == p )
                printf( "NULL" );
            else
            {
                printf( "method %d, weight %d ",
                         p->dwRankingMethod,
                         p->lWeight );
            }
            break;
        }
        case DBVALUEKIND_GROUPINFO :
        {
            printf( "DBVALUEKIND_GROUPINFO " );
            break;
        }
        case DBVALUEKIND_PARAMETER :
        {
            printf( "DBVALUEKIND_PARAMETER " );
            break;
        }
        case DBVALUEKIND_PROPERTY :
        {
            printf( "DBVALUEKIND_PROPERTY " );
            break;
        }
        case DBVALUEKIND_SETFUNC :
        {
            printf( "DBVALUEKIND_SETFUNC " );
            break;
        }
        case DBVALUEKIND_SORTINFO :
        {
            printf( "DBVALUEKIND_SORTINFO: " );
            if ( 0 == pNode->value.pdbsrtinfValue )
                printf( "NULL" );
            else
                printf( "fDesc %d, lcid %#x",
                        pNode->value.pdbsrtinfValue->fDesc,
                        pNode->value.pdbsrtinfValue->lcid );
            break;
        }
        case DBVALUEKIND_TEXT :
        {
            printf( "DBVALUEKIND_TEXT " );
            break;
        }
        case DBVALUEKIND_COMMAND :
        {
            printf( "DBVALUEKIND_COMMAND " );
            break;
        }
        case DBVALUEKIND_MONIKER :
        {
            printf( "DBVALUEKIND_MONIKER " );
            break;
        }
        case DBVALUEKIND_ROWSET :
        {
            printf( "DBVALUEKIND_ROWSET " );
            break;
        }
        case DBVALUEKIND_LIKE :
        {
            printf( "DBVALUEKIND_LIKE " );
            break;
        }
        case DBVALUEKIND_CONTENTPROXIMITY :
        {
            printf( "DBVALUEKIND_CONTENTPROXIMITY " );
            break;
        }
        case DBVALUEKIND_CONTENTSCOPE :
        {
            printf( "DBVALUEKIND_CONTENTSCOPE " );
            if ( 0 == pNode->value.pdbcntntscpValue )
                printf( "NULL" );
            else
                printf( "dwFlags %#x, pwszElementValue %ws",
                        pNode->value.pdbcntntscpValue->dwFlags,
                        pNode->value.pdbcntntscpValue->pwszElementValue );
            break;
        }
        case DBVALUEKIND_CONTENTTABLE :
        {
            printf( "DBVALUEKIND_CONTENTTABLE " );
            if ( 0 == pNode->value.pdbcntnttblValue )
                printf( "NULL" );
            else
                printf( "machine %ws, catalog %ws",
                        pNode->value.pdbcntnttblValue->pwszMachine,
                        pNode->value.pdbcntnttblValue->pwszCatalog );
            break;
        }
        case DBVALUEKIND_IDISPATCH :
        {
            printf( "DBVALUEKIND_IDISPATCH " );
            break;
        }
        case DBVALUEKIND_IUNKNOWN :
        {
            printf( "DBVALUEKIND_IUNKNOWN " );
            break;
        }
        case DBVALUEKIND_EMPTY :
        {
            printf( "DBVALUEKIND_EMPTY " );
            break;
        }
        case DBVALUEKIND_NULL :
        {
            printf( "DBVALUEKIND_NULL " );
            break;
        }
        case DBVALUEKIND_I2 :
        {
            printf( "DBVALUEKIND_I2: %d", pNode->value.sValue );
            break;
        }
        case DBVALUEKIND_I4 :
        {
            printf( "DBVALUEKIND_I4: %d", pNode->value.lValue );
            break;
        }
        case DBVALUEKIND_R4 :
        {
            printf( "DBVALUEKIND_R4: %f", pNode->value.flValue );
            break;
        }
        case DBVALUEKIND_R8 :
        {
            printf( "DBVALUEKIND_R8: %lf", pNode->value.dblValue );
            break;
        }
        case DBVALUEKIND_CY :
        {
            printf( "DBVALUEKIND_CY " );
            break;
        }
        case DBVALUEKIND_DATE :
        {
            printf( "DBVALUEKIND_DATE " );
            break;
        }
        case DBVALUEKIND_BSTR :
        {
            printf( "DBVALUEKIND_BSTR: '%ws'", pNode->value.pbstrValue );
            break;
        }
        case DBVALUEKIND_ERROR :
        {
            printf( "DBVALUEKIND_ERROR: %d", pNode->value.scodeValue );
            break;
        }
        case DBVALUEKIND_BOOL :
        {
            printf( "DBVALUEKIND_BOOL: %d", pNode->value.fValue );
            break;
        }
        case DBVALUEKIND_VARIANT :
        {
            printf( "DBVALUEKIND_VARIANT " );

            // Indexing Service uses PROPVARIANTs (extended VARIANTs)

            DisplayVariant( (PROPVARIANT *) pNode->value.pvarValue );
            break;
        }
        case DBVALUEKIND_I1 :
        {
            printf( "DBVALUEKIND_I1: %d", pNode->value.schValue );
            break;
        }
        case DBVALUEKIND_UI1 :
        {
            printf( "DBVALUEKIND_UI1: %u", pNode->value.uchValue );
            break;
        }
        case DBVALUEKIND_UI2 :
        {
            printf( "DBVALUEKIND_UI2: %u", pNode->value.usValue );
            break;
        }
        case DBVALUEKIND_UI4 :
        {
            printf( "DBVALUEKIND_UI4: %u", pNode->value.ulValue );
            break;
        }
        case DBVALUEKIND_I8 :
        {
            printf( "DBVALUEKIND_I8: %I64d", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_UI8 :
        {
            printf( "DBVALUEKIND_UI8: %I64u", pNode->value.llValue );
            break;
        }
        case DBVALUEKIND_GUID :
        {
            printf( "DBVALUEKIND_GUID " );
            break;
        }
        case DBVALUEKIND_BYTES :
        {
            printf( "DBVALUEKIND_BYTES " );
            break;
        }
        case DBVALUEKIND_STR :
        {
            printf( "DBVALUEKIND_STR: '%s'", pNode->value.pzValue );
            break;
        }
        case DBVALUEKIND_WSTR :
        {
            printf( "DBVALUEKIND_WSTR: '%ws'", pNode->value.pwszValue );
            break;
        }
        case DBVALUEKIND_NUMERIC :
        {
            printf( "DBVALUEKIND_NUMERIC " );
            break;
        }
        case DBVALUEKIND_DBDATE :
        {
            printf( "DBVALUEKIND_DBDATE " );
            break;
        }
        case DBVALUEKIND_DBTIME :
        {
            printf( "DBVALUEKIND_DBTIME " );
            break;
        }
        case DBVALUEKIND_DBTIMESTAMP :
        {
            printf( "DBVALUEKIND_DBTIMESTAMP " );
            break;
        }
        default :
        {
            printf( "unknown DBVALUEKIND " );
            break;
        }
    }

    printf( "\n" );

    if ( pNode->pctFirstChild )
    {
        PrintSpace( iLevel );
        printf( "first child:\n" );
        DisplayCommandTree( pNode->pctFirstChild, iLevel + 1 );
    }

    if ( pNode->pctNextSibling )
    {
        PrintSpace( iLevel );
        printf( "next sibling:\n" );
        DisplayCommandTree( pNode->pctNextSibling, iLevel + 1 );
    }

    if ( 0 == iLevel )
        printf( "\n" );
} //DisplayCommandTree

void DisplayError | ( | UINT | uiError,
 |  | WCHAR const * | pwcArgument,
 |  | HRESULT | hr,
 |  | LCID | lcid
 | ) |  |

Definition at line 222 of file QSample.Cxx.

{
    WCHAR awcError[ 200 ];
    FormatError( hr, awcError, sizeof awcError / sizeof WCHAR, lcid );

    CResString str( uiError );
    wprintf( str.Get(), pwcArgument, hr, awcError );
} //DisplayError

HRESULT DisplayRowsetStatus ( XInterface< IRowset > & xIRowset )

Definition at line 1002 of file QSample.Cxx.

{
    XInterface<IRowsetInfo> xIRowsetInfo;
    HRESULT hr = xIRowset->QueryInterface( IID_IRowsetInfo,
                                           xIRowsetInfo.GetQIPointer() );

    if ( SUCCEEDED( hr ) )
    {
        // This rowset property is Indexing-Service specific

        DBPROPID propId = MSIDXSPROP_ROWSETQUERYSTATUS;
        DBPROPIDSET propSet;
        propSet.rgPropertyIDs = &propId;
        propSet.cPropertyIDs = 1;
        const GUID guidRowsetExt = DBPROPSET_MSIDXS_ROWSETEXT;
        propSet.guidPropertySet = guidRowsetExt;

        ULONG cPropertySets = 0;
        DBPROPSET * pPropertySets;

        hr = xIRowsetInfo->GetProperties( 1,
                                          &propSet,
                                          &cPropertySets,
                                          &pPropertySets );

        if ( SUCCEEDED( hr ) )
        {
            DWORD dwStatus = pPropertySets->rgProperties->vValue.ulVal;

            CoTaskMemFree( pPropertySets->rgProperties );
            CoTaskMemFree( pPropertySets );

            DWORD dwFill = QUERY_FILL_STATUS( dwStatus );

            if ( STAT_ERROR == dwFill )
                DisplayStat( IDS_ROWSET_STAT_ERROR );

            DWORD dwReliability = QUERY_RELIABILITY_STATUS( dwStatus );

            if ( 0 != ( STAT_PARTIAL_SCOPE & dwReliability ) )
                DisplayStat( IDS_ROWSET_STAT_PARTIAL_SCOPE );
            if ( 0 != ( STAT_NOISE_WORDS & dwReliability ) )
                DisplayStat( IDS_ROWSET_STAT_NOISE_WORDS );
            if ( 0 != ( STAT_CONTENT_OUT_OF_DATE & dwReliability ) )
                DisplayStat( IDS_ROWSET_STAT_CONTENT_OUT_OF_DATE );
            if ( 0 != ( STAT_REFRESH_INCOMPLETE & dwReliability ) )
                DisplayStat( IDS_ROWSET_STAT_REFRESH_INCOMPLETE );
            if ( 0 != ( STAT_CONTENT_QUERY_INCOMPLETE & dwReliability ) )
                DisplayStat( IDS_ROWSET_STAT_CONTENT_QUERY_INCOMPLETE );
            if ( 0 != ( STAT_TIME_LIMIT_EXCEEDED & dwReliability ) )
                DisplayStat( IDS_ROWSET_STAT_TIME_LIMIT_EXCEEDED );
            if ( 0 != ( STAT_SHARING_VIOLATION & dwReliability ) )
                DisplayStat( IDS_ROWSET_STAT_SHARING_VIOLATION );
        }
    }

    return hr;
} //DisplayRowsetStatus

void DisplayStat | ( | DWORD | dw,
 |  | UINT | uiMsg
 | ) |  |

Definition at line 257 of file QSample.Cxx.

{
    CResString str( uiMsg );
    wprintf( L"%8d %ws\n", dw, str.Get() );
} //DisplayStat

void DisplayStat | ( | WCHAR const * | pwcMsg,
 |  | UINT | uiMsg
 | ) |  |

Definition at line 263 of file QSample.Cxx.

{
    CResString str( uiMsg );
    wprintf( L"%ws: %ws\n", str.Get(), pwcMsg );
} //DisplayStat

void DisplayStat ( UINT uiMsg )

Definition at line 269 of file QSample.Cxx.

{
    CResString str( uiMsg );
    wprintf( L"%ws\n", str.Get() );
} //DisplayStat

HRESULT DisplayStatus | ( | WCHAR const * | pwcCatalog,
 |  | WCHAR const * | pwcMachine,
 |  | LCID | lcid
 | ) |  |

Definition at line 1749 of file QSample.Cxx.

{
    CI_STATE state;
    state.cbStruct = sizeof state;

    DisplayStat( pwcMachine, IDS_STAT_MACHINE );
    DisplayStat( pwcCatalog, IDS_STAT_CATALOG );

    HRESULT hr = CIState( pwcCatalog, pwcMachine, &state );

    if ( SUCCEEDED( hr ) )
    {
        DisplayStat( state.cTotalDocuments, IDS_STAT_TOTALDOCUMENTS );
        DisplayStat( state.cFreshTest, IDS_STAT_FRESHTEST );
        DisplayStat( state.cFilteredDocuments, IDS_STAT_FILTEREDDOCUMENTS );
        DisplayStat( state.cDocuments, IDS_STAT_DOCUMENTS );
        DisplayStat( state.cSecQDocuments, IDS_STAT_SECQDOCUMENTS );
        DisplayStat( state.cUniqueKeys, IDS_STAT_UNIQUEKEYS );
        DisplayStat( state.cWordList, IDS_STAT_WORDLIST );
        DisplayStat( state.cPersistentIndex, IDS_STAT_PERSISTENTINDEX );
        DisplayStat( state.cQueries, IDS_STAT_QUERIES );
        DisplayStat( state.dwIndexSize, IDS_STAT_INDEXSIZE );
        DisplayStat( state.dwPropCacheSize / 1024, IDS_STAT_PROPCACHESIZE );

        DisplayStat( ( state.eState & CI_STATE_SCANNING ) ?
                     state.cPendingScans : 0,
                     IDS_STAT_SCANS );

        const DWORD ALL_CI_MERGE = ( CI_STATE_SHADOW_MERGE |
                                     CI_STATE_ANNEALING_MERGE |
                                     CI_STATE_INDEX_MIGRATION_MERGE |
                                     CI_STATE_MASTER_MERGE |
                                     CI_STATE_MASTER_MERGE_PAUSED );

        if ( 0 != ( ALL_CI_MERGE & state.eState ) )
        {
            UINT idStr;
            if ( state.eState & CI_STATE_SHADOW_MERGE )
                idStr = IDS_STAT_MERGE_SHADOW;
            else if ( state.eState & CI_STATE_ANNEALING_MERGE )
                idStr = IDS_STAT_MERGE_ANNEALING;
            else if ( state.eState & CI_STATE_INDEX_MIGRATION_MERGE )
                idStr = IDS_STAT_MERGE_INDEX_MIGRATION;
            else if ( state.eState & CI_STATE_MASTER_MERGE )
                idStr = IDS_STAT_MERGE_MASTER;
            else
                idStr = IDS_STAT_MERGE_MASTER_PAUSED;

            DisplayStat( state.dwMergeProgress, idStr );
        }

        if ( CI_STATE_READ_ONLY & state.eState )
            DisplayStat( IDS_STAT_READ_ONLY );
        if ( CI_STATE_RECOVERING & state.eState )
            DisplayStat( IDS_STAT_RECOVERING );
        if ( CI_STATE_LOW_MEMORY & state.eState )
            DisplayStat( IDS_STAT_LOW_MEMORY );
        if ( CI_STATE_HIGH_IO & state.eState )
            DisplayStat( IDS_STAT_HIGH_IO );
        if ( CI_STATE_BATTERY_POWER & state.eState )
            DisplayStat( IDS_STAT_BATTERY_POWER );
        if ( CI_STATE_USER_ACTIVE & state.eState )
            DisplayStat( IDS_STAT_USER_ACTIVE );
        if ( CI_STATE_STARTING & state.eState )
            DisplayStat( IDS_STAT_STARTING );
        if ( CI_STATE_READING_USNS & state.eState )
            DisplayStat( IDS_STAT_READING_USNS );
    }
    else
    {
        DisplayError( IDS_CANTDISPLAYSTATUS, pwcCatalog, hr, lcid );
    }

    return hr;
} //DisplayStatus

HRESULT DisplayUpToDate | ( | WCHAR const * | pwcCatalog,
 |  | WCHAR const * | pwcMachine,
 |  | LCID | lcid
 | ) |  |

Definition at line 1840 of file QSample.Cxx.

{
    CI_STATE state;
    state.cbStruct = sizeof state;

    HRESULT hr = CIState( pwcCatalog, pwcMachine, &state );

    if ( SUCCEEDED( hr ) )
    {
        // It's up to date if there are no documents to filter, no scans or
        // usn activity, and the index isn't starting or recovering.

        BOOL fUpToDate = ( ( 0 == state.cDocuments ) &&
                           ( 0 == ( state.eState & CI_STATE_SCANNING ) ) &&
                           ( 0 == ( state.eState & CI_STATE_READING_USNS ) ) &&
                           ( 0 == ( state.eState & CI_STATE_STARTING ) ) &&
                           ( 0 == ( state.eState & CI_STATE_RECOVERING ) ) );

        DisplayStat( fUpToDate ? IDS_STAT_UP_TO_DATE :
                                 IDS_STAT_NOT_UP_TO_DATE );
    }
    else
    {
        DisplayError( IDS_CANTDISPLAYSTATUS, pwcCatalog, hr, lcid );
    }

    return hr;
} //DisplayUpToDate

void DisplayValue ( PROPVARIANT const * pVar )

Definition at line 762 of file QSample.Cxx.

{
    if ( 0 == pVar )
    {
        wprintf( L"NULL" );
        return;
    }

    // Display the most typical variant types

    PROPVARIANT const & v = *pVar;

    switch ( v.vt )
    {
        case VT_EMPTY : break;
        case VT_NULL : break;
        case VT_I4 : wprintf( L"%10d", v.lVal ); break;
        case VT_UI1 : wprintf( L"%10d", v.bVal ); break;
        case VT_I2 : wprintf( L"%10d", v.iVal ); break;
        case VT_R4 : wprintf( L"%10f", v.fltVal ); break;
        case VT_R8 : wprintf( L"%10lf", v.dblVal ); break;
        case VT_BOOL : wprintf( v.boolVal ? L"TRUE" : L"FALSE" ); break;
        case VT_I1 : wprintf( L"%10d", v.cVal ); break;
        case VT_UI2 : wprintf( L"%10u", v.uiVal ); break;
        case VT_UI4 : wprintf( L"%10u", v.ulVal ); break;
        case VT_INT : wprintf( L"%10d", v.lVal ); break;
        case VT_UINT : wprintf( L"%10u", v.ulVal ); break;
        case VT_I8 : wprintf( L"%20I64d", v.hVal ); break;
        case VT_UI8 : wprintf( L"%20I64u", v.hVal ); break;
        case VT_ERROR : wprintf( L"%#x", v.scode ); break;
        case VT_LPSTR : wprintf( L"%S", v.pszVal ); break;
        case VT_LPWSTR : wprintf( L"%ws", v.pwszVal ); break;
        case VT_BSTR : wprintf( L"%ws", v.bstrVal ); break;
        case VT_CY:
        {
            double dbl;
            HRESULT hr = VarR8FromCy( v.cyVal, &dbl );
            if ( SUCCEEDED( hr ) )
                wprintf( L"%lf", dbl );
            break;
        }
        case VT_DECIMAL :
        {
            double dbl;
            HRESULT hr = VarR8FromDec( (DECIMAL *) &v.decVal, &dbl );
            if ( SUCCEEDED( hr ) )
                wprintf( L"%lf", dbl );
            break;
        }
        case VT_FILETIME :
        case VT_DATE :
        {
            SYSTEMTIME st;
            ZeroMemory( &st, sizeof st );

            if ( VT_DATE == v.vt )
            {
                BOOL fOK = VariantTimeToSystemTime( v.date, &st );

                if ( !fOK )
                    break;
            }
            else
            {
                FILETIME ft;
                BOOL fOK = FileTimeToLocalFileTime( &v.filetime, &ft );

                if ( fOK )
                    fOK = FileTimeToSystemTime( &ft, &st );

                if ( !fOK )
                    break;
            }

            BOOL pm = st.wHour >= 12;

            if ( st.wHour > 12 )
                st.wHour -= 12;
            else if ( 0 == st.wHour )
                st.wHour = 12;

            wprintf( L"%2d-%02d-%04d %2d:%02d%wc",
                    (DWORD) st.wMonth,
                    (DWORD) st.wDay,
                    (DWORD) st.wYear,
                    (DWORD) st.wHour,
                    (DWORD) st.wMinute,
                    pm ? L'p' : L'a' );
            break;
        }
        case VT_VECTOR | VT_I1:
            PrintVectorItems( v.cac.pElems, v.cac.cElems, "%d" ); break;
        case VT_VECTOR | VT_I2:
            PrintVectorItems( v.cai.pElems, v.cai.cElems, "%d" ); break;
        case VT_VECTOR | VT_I4:
            PrintVectorItems( v.cal.pElems, v.cal.cElems, "%d" ); break;
        case VT_VECTOR | VT_I8:
            PrintVectorItems( v.cah.pElems, v.cah.cElems, "%I64d" ); break;
        case VT_VECTOR | VT_UI1:
            PrintVectorItems( v.caub.pElems, v.caub.cElems, "%u" ); break;
        case VT_VECTOR | VT_UI2:
            PrintVectorItems( v.caui.pElems, v.caui.cElems, "%u" ); break;
        case VT_VECTOR | VT_UI4:
            PrintVectorItems( v.caul.pElems, v.caul.cElems, "%u" ); break;
        case VT_VECTOR | VT_ERROR:
            PrintVectorItems( v.cascode.pElems, v.cascode.cElems, "%#x" ); break;
        case VT_VECTOR | VT_UI8:
            PrintVectorItems( v.cauh.pElems, v.cauh.cElems, "%I64u" ); break;
        case VT_VECTOR | VT_BSTR:
            PrintVectorItems( v.cabstr.pElems, v.cabstr.cElems, "%ws" ); break;
        case VT_VECTOR | VT_LPSTR:
            PrintVectorItems( v.calpstr.pElems, v.calpstr.cElems, "%S" ); break;
        case VT_VECTOR | VT_LPWSTR:
            PrintVectorItems( v.calpwstr.pElems, v.calpwstr.cElems, "%ws" ); break;
        case VT_VECTOR | VT_R4:
            PrintVectorItems( v.caflt.pElems, v.caflt.cElems, "%f" ); break;
        case VT_VECTOR | VT_R8:
            PrintVectorItems( v.cadbl.pElems, v.cadbl.cElems, "%lf" ); break;
        default :
        {
            if ( VT_ARRAY & v.vt )
                PrintSafeArray( (VARTYPE) ( v.vt - VT_ARRAY ), v.parray );
            else
                wprintf( L"vt 0x%05x", v.vt );
            break;
        }
    }
} //DisplayValue

HRESULT DisplayWin32Error | ( | UINT | uiError,
 |  | WCHAR const * | pwcArgument,
 |  | LCID | lcid
 | ) |  |

Definition at line 247 of file QSample.Cxx.

{
    HRESULT hr = HRESULT_FROM_WIN32( GetLastError() );
    DisplayError( uiError, pwcArgument, hr, lcid );
    return hr;
} //DisplayWin32Error

HRESULT DoQuery | ( | WCHAR const * | pwcCatalog,
 |  | WCHAR const * | pwcMachine,
 |  | WCHAR const * | pwcScope,
 |  | DWORD | dwScopeFlags,
 |  | WCHAR const * | pwcRestriction,
 |  | WCHAR const * | pwcColumns,
 |  | WCHAR const * | pwcSort,
 |  | BOOL | fDisplayTree,
 |  | BOOL | fQuiet,
 |  | BOOL | fForceUseContentIndex,
 |  | BOOL | fNoQuery,
 |  | ULONG | ulDialect,
 |  | ULONG | cMaxHits,
 |  | LCID | lcid
 | ) |  |

Definition at line 1422 of file QSample.Cxx.

{
    HRESULT hr = IssueQuery( pwcCatalog,
                             pwcMachine,
                             pwcScope,
                             dwScopeFlags,
                             pwcRestriction,
                             pwcColumns,
                             pwcSort,
                             fDisplayTree,
                             fQuiet,
                             fForceUseContentIndex,
                             fNoQuery,
                             ulDialect,
                             cMaxHits,
                             lcid );

    if ( FAILED( hr ) )
        DisplayError( IDS_QUERYFAILED, pwcRestriction, hr, lcid );

    return hr;
} //DoQuery

HRESULT DoQueryFile | ( | WCHAR const * | pwcQueryCatalog,
 |  | WCHAR const * | pwcQueryMachine,
 |  | WCHAR const * | pwcQueryScope,
 |  | DWORD | dwScopeFlags,
 |  | WCHAR const * | pwcColumns,
 |  | WCHAR const * | pwcSort,
 |  | BOOL | fDisplayTree,
 |  | BOOL | fQuiet,
 |  | BOOL | fForceUseContentIndex,
 |  | BOOL | fNoQuery,
 |  | ULONG | ulDialect,
 |  | ULONG | cMaxHits,
 |  | LCID | lcid,
 |  | WCHAR const * | pwcQueryFile
 | ) |  |

Definition at line 1486 of file QSample.Cxx.

{
    // Open and read the query file

    HANDLE hFile = CreateFile( pwcQueryFile,
                               FILE_GENERIC_READ,
                               FILE_SHARE_READ | FILE_SHARE_DELETE,
                               0,
                               OPEN_EXISTING,
                               0,
                               0 );

    if ( 0 == hFile || INVALID_HANDLE_VALUE == hFile )
        return DisplayWin32Error( IDS_CANTOPENFILE,
                                  pwcQueryFile,
                                  lcid );

    DWORD cbFile = GetFileSize( hFile, 0 );

    if ( 0xffffffff == cbFile )
    {
        CloseHandle( hFile );
        return DisplayWin32Error( IDS_CANTGETFILESIZE,
                                  pwcQueryFile,
                                  lcid );
    }

    // Allocate a buffer for the file

    XPtr<BYTE> xQueries( cbFile + sizeof WCHAR );
    if ( xQueries.IsNull() )
    {
        CloseHandle( hFile );
        SetLastError( ERROR_NOT_ENOUGH_MEMORY );
        return DisplayWin32Error( IDS_CANTGETMEMORY,
                                  pwcQueryFile,
                                  lcid );
    }

    // Read the file into the buffer

    DWORD cbRead;
    BOOL fRead = ReadFile( hFile, xQueries.Get(), cbFile, &cbRead, 0 );

    CloseHandle( hFile );

    if ( ! fRead )
        return DisplayWin32Error( IDS_CANTREADFROMFILE,
                                  pwcQueryFile,
                                  lcid );

    // Check if the file is Unicode already

    BOOL fUnicode = ( 0xfeff == ( * (WCHAR *) xQueries.Get() ) );

    WCHAR * pwcIn = 0;
    DWORD cwcIn = 0;

    if ( fUnicode )
    {
        pwcIn = (WCHAR *) xQueries.Get();

        // skip past the Unicode marker

        pwcIn++;
        cwcIn = ( cbFile / sizeof WCHAR ) - 1;
    }
    else
    {
        // Convert to Unicode.  Leave a little room for slack.

        DWORD cbTmp = cbFile * sizeof WCHAR + cbFile / 8;
        XPtr<BYTE> xTmp( cbTmp + sizeof WCHAR );
        if ( xTmp.IsNull() )
        {
            SetLastError( ERROR_NOT_ENOUGH_MEMORY );
            return DisplayWin32Error( IDS_CANTGETMEMORY,
                                      pwcQueryFile,
                                      lcid );
        }

        cwcIn = MultiByteToWideChar( LocaleToCodepage( lcid ),
                                     0,
                                     (const char *) xQueries.Get(),
                                     cbFile,
                                     (WCHAR *) xTmp.Get(),
                                     cbTmp );
        if ( 0 == cwcIn )
            return DisplayWin32Error( IDS_CANTCONVERTTOUNICODE,
                                      pwcQueryFile,
                                      lcid );

        pwcIn = (WCHAR *) xTmp.Get();
        xQueries.Free();
        xQueries.Set( xTmp.Acquire() );
    }

    // Read each line in the file and issue the query

    pwcIn[ cwcIn ] = 0;
    WCHAR * pwc = pwcIn;

    do
    {
        while ( 0     != *pwcIn &&
                L'\r' != *pwcIn &&
                L'\n' != *pwcIn )
            pwcIn++;

        BOOL fEOF = ( 0 == *pwcIn );

        *pwcIn = 0;

        if ( pwc != pwcIn )
        {
            DoQuery( pwcQueryCatalog,
                     pwcQueryMachine,
                     pwcQueryScope,
                     dwScopeFlags,
                     pwc,
                     pwcColumns,
                     pwcSort,
                     fDisplayTree,
                     fQuiet,
                     fForceUseContentIndex,
                     fNoQuery,
                     ulDialect,
                     cMaxHits,
                     lcid );
            wprintf( L"\n\n" );
        }

        if ( fEOF )
            break;

        pwcIn++;
        while ( '\r' == *pwcIn || '\n' == *pwcIn )
            pwcIn++;
        pwc = pwcIn;
    } while ( TRUE );

    return S_OK;
} //DoQueryFile

void FormatError | ( | SCODE | sc,
 |  | WCHAR * | pwc,
 |  | ULONG | cwc,
 |  | LCID | lcid
 | ) |  |

Definition at line 155 of file QSample.Cxx.

{
    // FormatMessage works best when based on thread locale.

    LCID SaveLCID = GetThreadLocale();
    BOOL fLocaleSet = SetThreadLocale( lcid );

    // Is this an Indexing Service error?  These errors are in query.dll.

    if ( ! FormatMessage( FORMAT_MESSAGE_FROM_HMODULE,
                          GetModuleHandle( L"query.dll" ),
                          sc,
                          0,
                          pwc,
                          cwc,
                          0 ) )
    {
        // Is this a Win32 error?  These are in kernel32.dll

        const ULONG facWin32 = ( FACILITY_WIN32 << 16 );
        ULONG Win32Error = sc;

        if ( (Win32Error & facWin32) == facWin32 )
            Win32Error &= ~( 0x80000000 | facWin32 );

        if ( ! FormatMessage( FORMAT_MESSAGE_FROM_HMODULE,
                              GetModuleHandle( L"kernel32.dll" ),
                              Win32Error,
                              0,
                              pwc,
                              cwc,
                              0 ) )
        {
            // It's not from Indexing Service or Win32; display a default error

            CResString str( IDS_UNKNOWNERROR );

            if ( wcslen( str.Get() ) >= cwc )
                pwc[0] = 0;
            else
                wcscpy( pwc, str.Get() );
        }
    }

    // Restore the original thread locale

    if ( fLocaleSet )
        SetThreadLocale( SaveLCID );
} //FormatError

WCHAR const* GetLocaleString ( LCID lcid )

Definition at line 345 of file QSample.Cxx.

{
    static WCHAR awcLocale[ 100 ];
    wcscpy( awcLocale, L"Neutral" );

    XInterface<IMultiLanguage> xMultiLang;

    HRESULT hr = CoCreateInstance( CLSID_CMultiLanguage,
                                   0,
                                   CLSCTX_INPROC_SERVER,
                                   IID_IMultiLanguage,
                                   xMultiLang.GetQIPointer() );

    if ( SUCCEEDED( hr ) )
    {
        BSTR bstrLocale;

        hr = xMultiLang->GetRfc1766FromLcid( lcid, &bstrLocale );
        if ( SUCCEEDED( hr ) )
        {
            wcscpy( awcLocale, bstrLocale );
            SysFreeString( bstrLocale );
        }
    }

    return awcLocale;
} //GetLocaleString

HRESULT GetOleDBErrorInfo | ( | IUnknown * | pErrSrc,
 |  | REFIID | riid,
 |  | LCID | lcid,
 |  | ERRORINFO * | pErrorInfo,
 |  | IErrorInfo ** | ppIErrorInfo
 | ) |  |

Definition at line 908 of file QSample.Cxx.

{
    *ppIErrorInfo = 0;

    // See if an error is available that is of interest to us.

    XInterface<ISupportErrorInfo> xSupportErrorInfo;
    HRESULT hr = pErrSrc->QueryInterface( IID_ISupportErrorInfo,
                                          xSupportErrorInfo.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    hr = xSupportErrorInfo->InterfaceSupportsErrorInfo( riid );
    if ( FAILED( hr ) )
        return hr;

    // Get the current error object. Return if none exists.

    XInterface<IErrorInfo> xErrorInfo;
    hr = GetErrorInfo( 0, xErrorInfo.GetPPointer() );
    if ( xErrorInfo.IsNull() )
        return hr;

    // Get the IErrorRecord interface and get the count of errors.

    XInterface<IErrorRecords> xErrorRecords;
    hr = xErrorInfo->QueryInterface( IID_IErrorRecords,
                                     xErrorRecords.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    ULONG cErrRecords;
    hr = xErrorRecords->GetRecordCount( &cErrRecords );
    if ( 0 == cErrRecords )
        return hr;

#if 1 // A good way to get the complete error message...

    XInterface<IErrorInfo> xErrorInfoRec;
    ERRORINFO ErrorInfo;
    for ( unsigned i=0; i<cErrRecords; i++ )
    {
        // Get basic error information.

        xErrorRecords->GetBasicErrorInfo( i, &ErrorInfo );

        // Get error description and source through the IErrorInfo interface
        // pointer on a particular record.

        xErrorRecords->GetErrorInfo( i, lcid, xErrorInfoRec.GetPPointer() );

        XBStr bstrDescriptionOfError;
        XBStr bstrSourceOfError;

        BSTR bstrDesc = bstrDescriptionOfError.GetPointer();
        BSTR bstrSrc = bstrSourceOfError.GetPointer();

        xErrorInfoRec->GetDescription( &bstrDesc );
        xErrorInfoRec->GetSource( &bstrSrc );

        // At this point, you could call GetCustomErrorObject and query for
        // additional interfaces to determine what else happened.

        wprintf( L"%s (%#x)\n%s\n", bstrDesc, ErrorInfo.hrError, bstrSrc );
    }
#endif

    // Get basic error information for the most recent error

    ULONG iRecord = cErrRecords - 1;
    hr = xErrorRecords->GetBasicErrorInfo( iRecord, pErrorInfo );
    if ( FAILED( hr ) )
        return hr;

    return xErrorRecords->GetErrorInfo( iRecord, lcid, ppIErrorInfo );
} //GetOleDBErrorInfo

HRESULT IssueQuery | ( | WCHAR const * | pwcQueryCatalog,
 |  | WCHAR const * | pwcQueryMachine,
 |  | WCHAR const * | pwcQueryScope,
 |  | DWORD | dwScopeFlags,
 |  | WCHAR const * | pwcQueryRestriction,
 |  | WCHAR const * | pwcColumns,
 |  | WCHAR const * | pwcSort,
 |  | BOOL | fDisplayTree,
 |  | BOOL | fQuiet,
 |  | BOOL | fForceUseContentIndex,
 |  | BOOL | fNoQuery,
 |  | ULONG | ulDialect,
 |  | ULONG | cMaxHits,
 |  | LCID | lcid
 | ) |  |

Definition at line 1087 of file QSample.Cxx.

{
    // Create an ICommand object.  CIMakeICommand is a shortcut for making an
    // ICommand.  The ADVQUERY sample shows the OLE DB equivalent.

    XInterface<ICommand> xICommand;
    HRESULT hr = CIMakeICommand( xICommand.GetPPointer(),  // result
                                 1,                        // 1 scope
                                 &dwScopeFlags,            // scope flags
                                 &pwcQueryScope,           // scope path
                                 &pwcQueryCatalog,         // catalog
                                 &pwcQueryMachine );       // machine
    if ( FAILED( hr ) )
        return hr;

    // Set required properties on the ICommand

    hr = SetCommandProperties( xICommand.GetPointer(),
                               fForceUseContentIndex,
                               lcid,
                               cMaxHits );
    if ( FAILED( hr ) )
        return hr;

    // Get a command tree object

    XInterface<ICommandTree> xICommandTree;
    hr = xICommand->QueryInterface( IID_ICommandTree,
                                    xICommandTree.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    if ( ulDialect < 3 )
    {
        // Create an OLE DB query tree based on query parameters.

        DBCOMMANDTREE * pTree;
        hr = CITextToFullTreeEx( pwcQueryRestriction, // the query itself
                                 ulDialect,           // query dialect
                                 pwcColumns,          // columns to return
                                 pwcSort,             // sort order, may be 0
                                 0,                   // reserved
                                 &pTree,              // resulting tree
                                 0,                   // no custom properties
                                 0,                   // no custom properties
                                 lcid );              // default locale
        if ( FAILED( hr ) )
            return hr;

        // If directed, display the command tree.

        if ( fDisplayTree )
        {
            wprintf( L"%ws\n", pwcQueryRestriction );
            DisplayCommandTree( pTree );
        }

        // If directed, don't issue the query.  Parsing it was sufficient.

        if ( fNoQuery )
        {
            xICommandTree->FreeCommandTree( &pTree );
            return S_OK;
        }

        // Set the tree in the ICommandTree.  Ownership of the tree is transferred.

        hr = xICommandTree->SetCommandTree( &pTree,
                                            DBCOMMANDREUSE_NONE,
                                            FALSE );
        if ( FAILED( hr ) )
        {
            xICommandTree->FreeCommandTree( &pTree );
            return hr;
        }
    }
    else
    {
        // Get a command text object

        XInterface<ICommandText> xICommandText;
        hr = xICommand->QueryInterface( IID_ICommandText,
                                        xICommandText.GetQIPointer() );
        if ( FAILED( hr ) )
            return hr;

        hr = xICommandText->SetCommandText( DBGUID_SQL, pwcQueryRestriction );
        if ( FAILED( hr ) )
            return hr;

        // If directed, display the command tree.

        if ( fDisplayTree )
        {
            DBCOMMANDTREE * pTree = 0;
            hr = xICommandTree->GetCommandTree( &pTree );
            if ( FAILED( hr ) )
                return hr;

            wprintf( L"%ws\n", pwcQueryRestriction );
            DisplayCommandTree( pTree );
        }

        // If directed, don't issue the query.  Parsing it was sufficient.

        if ( fNoQuery )
            return S_OK;
    }

    // Execute the query.  The query is complete when Execute() returns.

    XInterface<IRowset> xIRowset;
    hr = xICommand->Execute( 0,            // no aggregating IUnknown
                             IID_IRowset,  // IID for interface to return
                             0,            // no DBPARAMs
                             0,            // no rows affected
                             xIRowset.GetIUPointer() ); // result
    if ( FAILED( hr ) )
    {
        // Get the real error; OLE DB permits few Execute() return codes

        ERRORINFO ErrorInfo;
        XInterface<IErrorInfo> xErrorInfo;
        HRESULT hr2 = GetOleDBErrorInfo( xICommand.GetPointer(),
                                         IID_ICommand,
                                         lcid,
                                         &ErrorInfo,
                                         xErrorInfo.GetPPointer() );

        // Post IErrorInfo only if we have a valid pointer to it.

        if ( SUCCEEDED( hr2 ) && !xErrorInfo.IsNull() )
            hr = ErrorInfo.hrError;

        return hr;
    }

    // Get the count of columns

    XInterface<IColumnsInfo> xColumnsInfo;
    hr = xIRowset->QueryInterface( IID_IColumnsInfo, xColumnsInfo.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    DBCOLUMNINFO *pColumnInfo = 0;
    WCHAR *pColumnNames = 0;
    DBORDINAL cColumns = 0;

    hr = xColumnsInfo->GetColumnInfo( &cColumns,
                                      &pColumnInfo,
                                      &pColumnNames );
    if ( FAILED( hr ) )
        return hr;

    // If bookmark was added as column 0, ignore it

    if ( 0 != ( pColumnInfo[0].dwFlags & DBCOLUMNFLAGS_ISBOOKMARK ) )
        cColumns--;

    CoTaskMemFree( pColumnInfo );
    CoTaskMemFree( pColumnNames );

    // Create an accessor, so data can be retrieved from the rowset.

    XInterface<IAccessor> xIAccessor;
    hr = xIRowset->QueryInterface( IID_IAccessor,
                                   xIAccessor.GetQIPointer() );
    if ( FAILED( hr ) )
        return hr;

    // Column iOrdinals are parallel with those passed to CiTextToFullTree,
    // so MapColumnIDs isn't necessary.  These binding values for dwPart,
    // dwMemOwner, and wType are the most optimal bindings for Indexing
    // Service.

    XPtr<DBBINDING> xBindings( (ULONG) cColumns );
    if ( xBindings.IsNull() )
        return E_OUTOFMEMORY;

    memset( xBindings.Get(), 0, sizeof DBBINDING * cColumns );

    for ( ULONG i = 0; i < cColumns; i++ )
    {
        xBindings[i].iOrdinal   = 1 + i; // 1-based column number
        xBindings[i].obValue    = i * sizeof( PROPVARIANT * ); // offset
        xBindings[i].dwPart     = DBPART_VALUE; // retrieve value, not status
        xBindings[i].dwMemOwner = DBMEMOWNER_PROVIDEROWNED; // provider owned
        xBindings[i].wType      = DBTYPE_VARIANT | DBTYPE_BYREF; // VARIANT *
    }

    HACCESSOR hAccessor;
    hr = xIAccessor->CreateAccessor( DBACCESSOR_ROWDATA, // rowdata accessor
                                     cColumns,           // # of columns
                                     xBindings.Get(),    // columns
                                     0,                  // ignored
                                     &hAccessor,         // result
                                     0 );                // no status
    if ( FAILED( hr ) )
        return hr;

    // Display the results of the query.

    XPtr<PROPVARIANT *> xData( (ULONG) cColumns );
    if ( xData.IsNull() )
        hr = E_OUTOFMEMORY;
    else
    {
        DBCOUNTITEM cRowsSoFar = 0;

        do
        {
            DBCOUNTITEM cRowsReturned = 0;
            const ULONG cRowsAtATime = 20;
            HROW aHRow[cRowsAtATime];
            HROW * pgrHRows = aHRow;
            hr = xIRowset->GetNextRows( 0,              // no chapter
                                        0,              // no rows to skip
                                        cRowsAtATime,   // # rows to get
                                        &cRowsReturned, // # rows returned
                                        &pgrHRows);     // resulting hrows
            if ( FAILED( hr ) )
                break;

            for ( DBCOUNTITEM iRow = 0; iRow < cRowsReturned; iRow++ )
            {
                HRESULT hr2 = xIRowset->GetData( aHRow[iRow],   // hrow being accessed
                                                 hAccessor,     // accessor to use
                                                 xData.Get() ); // resulting data
                if ( FAILED( hr2 ) )
                {
                    hr = hr2;
                    break;
                }

                for ( ULONG iCol = 0; iCol < cColumns; iCol++ )
                {
                    if ( 0 != iCol )
                        wprintf( L"  " );
                    DisplayValue( xData[ iCol ] );
                }

                wprintf( L"\n" );
            }

            // Release the HROWs retrived in GetNextRows

            if ( 0 != cRowsReturned )
            {
                cRowsSoFar += cRowsReturned;
                xIRowset->ReleaseRows( cRowsReturned, // # of rows to release
                                       aHRow,         // rows to release
                                       0,             // no options
                                       0,             // no refcounts
                                       0 );           // no status
            }

            // Check if all rows are now retrieved.

            if ( DB_S_ENDOFROWSET == hr || DB_S_ROWLIMITEXCEEDED == hr )
            {
                hr = S_OK; // succeeded, return S_OK from DoQuery
                break;
            }

            // Check if the query aborted because it was too costly.

            if ( DB_S_STOPLIMITREACHED == hr )
            {
                CResString str( IDS_QUERYTIMEDOUT );
                wprintf( L"%ws\n", str.Get() );
                hr = S_OK;
                break;
            }

            if ( FAILED( hr ) )
                break;
        } while ( TRUE );

        if ( !fQuiet )
        {
            CResString str( IDS_QUERYDONE );
            wprintf( str.Get(), cRowsSoFar, pwcQueryRestriction );
        }
    }

    xIAccessor->ReleaseAccessor( hAccessor, 0 );

    // Get query status information

    if ( SUCCEEDED( hr ) && !fQuiet )
        hr = DisplayRowsetStatus( xIRowset );

    return hr;
} //IssueQuery

LCID LcidFromHttpAcceptLanguage ( WCHAR const * pwc )

Definition at line 385 of file QSample.Cxx.

{
    // Default to the system locale

    LCID lcid = GetSystemDefaultLCID();

    if ( 0 != pwc )
    {
        XInterface<IMultiLanguage> xMultiLang;

        HRESULT hr = CoCreateInstance( CLSID_CMultiLanguage,
                                       0,
                                       CLSCTX_INPROC_SERVER,
                                       IID_IMultiLanguage,
                                       xMultiLang.GetQIPointer() );

        if ( SUCCEEDED( hr ) )
        {
            BSTR bstr = SysAllocString( pwc );

            if ( 0 != bstr )
            {
                hr = xMultiLang->GetLcidFromRfc1766( &lcid, bstr );

                SysFreeString( bstr );

                if ( S_FALSE == hr ||
                     E_FAIL == hr )
                {
                    if ( !_wcsicmp( pwc, L"neutral" ) ||
                         !_wcsicmp( pwc, L"neutr" ) )
                        lcid = 0;
                    else
                        Usage();
                }
                else if ( FAILED( hr ) )
                {
                    Usage();
                }
            }
        }
    }

    return lcid;
} //LcidFromHttpAcceptLanguage

ULONG LocaleToCodepage ( LCID lcid )

Definition at line 315 of file QSample.Cxx.

{
    ULONG codepage;

    int cwc = GetLocaleInfo( lcid,
                             LOCALE_RETURN_NUMBER |
                                 LOCALE_IDEFAULTANSICODEPAGE,
                             (WCHAR *) &codepage,
                             sizeof ULONG / sizeof WCHAR );

    // If an error occurred, return the Ansi code page

    if ( 0 == cwc )
         return CP_ACP;

    return codepage;
} //LocaleToCodepage

HRESULT LookupCatalog | ( | WCHAR const * | pwcScope,
 |  | WCHAR * | pwcMachine,
 |  | ULONG & | cwcMachine,
 |  | WCHAR * | pwcCatalog,
 |  | ULONG & | cwcCatalog,
 |  | LCID | lcid
 | ) |  |

Definition at line 1659 of file QSample.Cxx.

{
    HRESULT hr = LocateCatalogs( pwcScope,       // scope to lookup
                                 0,              // go with the first match
                                 pwcMachine,     // returns the machine
                                 &cwcMachine,    // buffer size in/out
                                 pwcCatalog,     // returns the catalog
                                 &cwcCatalog );  // buffer size in/out

    if ( FAILED( hr ) || ( S_FALSE == hr ) )
    {
        DisplayError( IDS_CANTFINDCATALOG, pwcScope, hr, lcid );
        hr = E_FAIL;
    }

    return hr;
} //LookupCatalog

HRESULT NormalizeScope | ( | WCHAR const * | pwcIn,
 |  | WCHAR * | pwcOut,
 |  | BOOL | fShallow,
 |  | DWORD & | dwScopeFlags
 | ) |  |

Definition at line 1695 of file QSample.Cxx.

{
    if ( wcslen( pwcIn ) >= MAX_PATH )
        return E_INVALIDARG;

    if ( fShallow )
        dwScopeFlags = QUERY_SHALLOW;
    else
        dwScopeFlags = QUERY_DEEP;

    wcscpy( pwcOut, pwcIn );

    // Check if the scope is an IIS virtual scope.

    WCHAR wc = pwcIn[0];

    if ( L'/' == wc )
    {
        // Set the virtual scope flag and flip the slashes.

        dwScopeFlags |= QUERY_VIRTUAL_PATH;
        for ( WCHAR * pwc = pwcOut; *pwc; pwc++ )
            if ( '/' == *pwc )
                *pwc = '\\';
    }
    else if ( ( !( L'\\' == wc && L'\\' == pwcIn[1] ) ) &&
              ( !( L'\\' == wc && 0 == pwcIn[1] ) ) &&
              L':' != pwcIn[1] &&
              0 != wc )
    {
        // Turn the relative path into a full path based on the current dir.

        _wfullpath( pwcOut, pwcIn, MAX_PATH );
    }

    return S_OK;
} //NormalizeScope

void PrintSafeArray | ( | VARTYPE | vt,
 |  | LPSAFEARRAY | pa
 | ) |  |

Definition at line 647 of file QSample.Cxx.

{
    // Get the dimensions of the array

    UINT cDim = SafeArrayGetDim( pa );
    if ( 0 == cDim )
        return;

    XPtr<LONG> xDim( cDim );
    XPtr<LONG> xLo( cDim );
    XPtr<LONG> xUp( cDim );

    for ( UINT iDim = 0; iDim < cDim; iDim++ )
    {
        HRESULT hr = SafeArrayGetLBound( pa, iDim + 1, &xLo[iDim] );
        if ( FAILED( hr ) )
            return;

        xDim[ iDim ] = xLo[ iDim ];

        hr = SafeArrayGetUBound( pa, iDim + 1, &xUp[iDim] );
        if ( FAILED( hr ) )
            return;

        wprintf( L"{" );
    }

    // slog through the array

    UINT iLastDim = cDim - 1;
    BOOL fDone = FALSE;

    while ( !fDone )
    {
        // inter-element formatting

        if ( xDim[ iLastDim ] != xLo[ iLastDim ] )
            wprintf( L"," );

        // Get the element and render it

        void *pv;
        HRESULT hr = SafeArrayPtrOfIndex( pa, xDim.Get(), &pv );
        if ( FAILED( hr ) )
            return;

        Render( vt, pv );

        // Move to the next element and carry if necessary

        ULONG cOpen = 0;

        for ( LONG iDim = iLastDim; iDim >= 0; iDim-- )
        {
            if ( xDim[ iDim ] < xUp[ iDim ] )
            {
                xDim[ iDim ] = 1 + xDim[ iDim ];
                break;
            }

            wprintf( L"}" );

            if ( 0 == iDim )
                fDone = TRUE;
            else
            {
                cOpen++;
                xDim[ iDim ] = xLo[ iDim ];
            }
        }

        for ( ULONG i = 0; !fDone && i < cOpen; i++ )
            wprintf( L"{" );
    }
} //PrintSafeArray

template<class T >
void PrintVectorItems | ( | T * | pVal,
 |  | ULONG | cVals,
 |  | char * | pcFmt
 | ) |  |

Definition at line 735 of file QSample.Cxx.

{
    printf( "{ " );

    for( ULONG iVal = 0; iVal < cVals; iVal++ )
    {
        if ( 0 != iVal )
            printf( "," );
        printf( pcFmt, *pVal++ );
    }

    printf( " }" );
} //PrintVectorItems

void Render | ( | VARTYPE | vt,
 |  | void * | pv
 | ) |  |

Definition at line 553 of file QSample.Cxx.

{
    if ( VT_ARRAY & vt )
    {
        PrintSafeArray( (VARTYPE) ( vt - VT_ARRAY ), *(SAFEARRAY **) pv );
        return;
    }

    switch ( vt )
    {
        case VT_UI1: wprintf( L"%u", (unsigned) *(BYTE *)pv ); break;
        case VT_I1: wprintf( L"%d", (int) *(CHAR *)pv ); break;
        case VT_UI2: wprintf( L"%u", (unsigned) *(USHORT *)pv ); break;
        case VT_I2: wprintf( L"%d", (int) *(SHORT *)pv ); break;
        case VT_UI4:
        case VT_UINT: wprintf( L"%u", (unsigned) *(ULONG *)pv ); break;
        case VT_I4:
        case VT_ERROR:
        case VT_INT: wprintf( L"%d", *(LONG *)pv ); break;
        case VT_UI8: wprintf( L"%I64u", *(unsigned __int64 *)pv ); break;
        case VT_I8: wprintf( L"%I64d", *(__int64 *)pv ); break;
        case VT_R4: wprintf( L"%f", *(float *)pv ); break;
        case VT_R8: wprintf( L"%lf", *(double *)pv ); break;
        case VT_DECIMAL:
        {
            double dbl;
            HRESULT hr = VarR8FromDec( (DECIMAL *) pv, &dbl );
            if ( SUCCEEDED( hr ) )
                wprintf( L"%lf", dbl );
            break;
        }
        case VT_CY:
        {
            double dbl;
            HRESULT hr = VarR8FromCy( * (CY *) pv, &dbl );
            if ( SUCCEEDED( hr ) )
                wprintf( L"%lf", dbl );
            break;
        }
        case VT_BOOL: wprintf( *(VARIANT_BOOL *)pv ? L"TRUE" : L"FALSE" ); break;
        case VT_BSTR: wprintf( L"%ws", *(BSTR *) pv ); break;
        case VT_VARIANT:
        {
            PROPVARIANT * pVar = (PROPVARIANT *) pv;
            Render( pVar->vt, & pVar->lVal );
            break;
        }
        case VT_DATE:
        {
            SYSTEMTIME st;

            BOOL fOK = VariantTimeToSystemTime( *(DATE *)pv, &st );

            if ( !fOK )
                break;

            BOOL pm = st.wHour >= 12;

            if ( st.wHour > 12 )
                st.wHour -= 12;
            else if ( 0 == st.wHour )
                st.wHour = 12;

            wprintf( L"%2d-%02d-%04d %2d:%02d%wc",
                    (DWORD) st.wMonth,
                    (DWORD) st.wDay,
                    (DWORD) st.wYear,
                    (DWORD) st.wHour,
                    (DWORD) st.wMinute,
                    pm ? L'p' : L'a' );
            break;
        }
        case VT_EMPTY:
        case VT_NULL:
            break;
        default :
        {
            wprintf( L"(vt 0x%x)", (int) vt );
            break;
        }
    }
} //Render

HRESULT SetCommandProperties | ( | ICommand * | pICommand,
 |  | BOOL | fForceUseContentIndex,
 |  | LCID | lcid,
 |  | ULONG | cMaxHits
 | ) |  |

Definition at line 459 of file QSample.Cxx.

{
    static const DBID dbcolNull = { { 0,0,0, { 0,0,0,0,0,0,0,0 } },
                                    DBKIND_GUID_PROPID, 0 };
    static const GUID guidQueryExt = DBPROPSET_QUERYEXT;

    DBPROP aProp[2];

    // Use extened types in accessor bindings -- it's faster and more accurate

    aProp[0].dwPropertyID = DBPROP_USEEXTENDEDDBTYPES;
    aProp[0].dwOptions = DBPROPOPTIONS_OPTIONAL;
    aProp[0].dwStatus = 0;
    aProp[0].colid = dbcolNull;
    aProp[0].vValue.vt = VT_BOOL;
    aProp[0].vValue.boolVal = VARIANT_TRUE;

    // Should we force use of the index?  Otherwise, enumeration will be slow.

    aProp[1] = aProp[0];
    aProp[1].dwPropertyID = DBPROP_USECONTENTINDEX;
    aProp[1].vValue.boolVal = fForceUseContentIndex ? VARIANT_TRUE : VARIANT_FALSE;

    DBPROPSET aPropSet[3];

    aPropSet[0].rgProperties = &aProp[0];
    aPropSet[0].cProperties = 2;
    aPropSet[0].guidPropertySet = guidQueryExt;

    const GUID guidMSIDXS_ROWSETEXT = DBPROPSET_MSIDXS_ROWSETEXT;

    DBPROP aRowsetExtProp[1];

    aPropSet[1].rgProperties = &aRowsetExtProp[0];
    aPropSet[1].cProperties = 1;
    aPropSet[1].guidPropertySet = guidMSIDXS_ROWSETEXT;

    // Set the default locale of the query

    aRowsetExtProp[0] = aProp[0];
    aRowsetExtProp[0].dwPropertyID = MSIDXSPROP_COMMAND_LOCALE_STRING;
    aRowsetExtProp[0].vValue.vt = VT_BSTR;
    aRowsetExtProp[0].vValue.bstrVal = SysAllocString( GetLocaleString( lcid ) );
    if ( 0 == aRowsetExtProp[0].vValue.bstrVal )
        return E_OUTOFMEMORY;

    DBPROP aRowsetProp[1];
    aPropSet[2].rgProperties = &aRowsetProp[0];
    aPropSet[2].cProperties = 1;
    aPropSet[2].guidPropertySet = DBPROPSET_ROWSET;

    // Set the first or best maximum number of result rows

    aRowsetProp[0] = aProp[0];
    aRowsetProp[0].dwPropertyID = DBPROP_MAXROWS;
    aRowsetProp[0].vValue.vt = VT_I4;
    aRowsetProp[0].vValue.lVal = (LONG) cMaxHits;

    XInterface<ICommandProperties> xICommandProperties;
    HRESULT hr = pICommand->QueryInterface( IID_ICommandProperties,
                                            xICommandProperties.GetQIPointer() );
    if ( SUCCEEDED( hr ) )
    {
        hr = xICommandProperties->SetProperties( 3,
                                                 aPropSet ); // the properties
    }

    // Free the locale string

    HRESULT hr2 = VariantClear( &aRowsetExtProp[0].vValue );

    if ( SUCCEEDED( hr ) && FAILED( hr2 ) )
        hr = hr2;

    return hr;
} //SetCommandProperties

void Usage ( void )

Definition at line 283 of file QSample.Cxx.

{
    HRSRC hrc = FindResource( 0, (LPCWSTR) IDR_USAGE, RT_RCDATA );

    if ( 0 != hrc )
    {
        HGLOBAL hg = LoadResource( 0, hrc );

        if ( 0 != hg )
        {
            void * pv = LockResource( hg );

            if ( 0 != pv )
                wprintf( L"%ws\n", pv );
        }
    }

    exit( -1 );
} //Usage

int __cdecl wmain | ( | int | argc,
 |  | WCHAR * | argv[]
 | ) |  |

Definition at line 1884 of file QSample.Cxx.

{
    WCHAR const * pwcCatalog     = 0;        // default: lookup catalog
    WCHAR const * pwcMachine     = L".";     // default: local machine
    WCHAR const * pwcScope       = L"\\";    // default: entire catalog
    WCHAR const * pwcRestriction = 0;        // no default restriction
    WCHAR const * pwcColumns     = L"path";  // default output column(s)
    WCHAR const * pwcSort        = 0;        // no sort is the default
    WCHAR const * pwcQueryFile   = 0;        // no query file specified
    WCHAR const * pwcLocale      = 0;        // default: system locale
    BOOL fDisplayTree            = FALSE;    // don't display the tree
    BOOL fForceUseContentIndex   = TRUE;     // always use the index
    ULONG ulDialect              = 1;        // original query language dialect
    BOOL fQuiet                  = FALSE;    // show the hitcount
    ULONG cMaxHits               = 0;        // default: retrieve all hits
    BOOL fDisplayStatus          = FALSE;    // default: don't show status
    BOOL fDisplayUpToDate        = FALSE;    // default: don't show up to date
    ULONG cRepetitions           = 1;        // # of times to repeat command
    BOOL fShallow                = FALSE;    // default: all subdirectories
    BOOL fNoQuery                = FALSE;    // default: execute query

    // Parse command line parameters

    for ( int i = 1; i < argc; i++ )
    {
        if ( L'-' == argv[i][0] || L'/' == argv[i][0] )
        {
            WCHAR wc = towupper( argv[i][1] );

            if ( ':' != argv[i][2] &&
                 'D' != wc &&
                 'J' != wc &&
                 'N' != wc &&
                 'Q' != wc &&
                 'U' != wc &&
                 'T' != wc )
                Usage();

            if ( 'C' == wc )
                pwcCatalog = argv[i] + 3;
            else if ( 'M' == wc )
                pwcMachine = argv[i] + 3;
            else if ( 'P' == wc )
                pwcScope = argv[i] + 3;
            else if ( 'O' == wc )
                pwcColumns = argv[i] + 3;
            else if ( 'S' == wc )
                pwcSort = argv[i] + 3;
            else if ( 'X' == wc )
                cMaxHits = _wtoi( argv[i] + 3 );
            else if ( 'I' == wc )
            {
                if ( 0 != pwcRestriction )
                    Usage();
                pwcQueryFile = argv[i] + 3;
            }
            else if ( 'R' == wc)
            {
                // get the next arg as a number
                cRepetitions = _wtol(argv[i]+3);
            }
            else if ( 'D' == wc )
                fDisplayTree = TRUE;
            else if ( 'J' == wc )
                fShallow = TRUE;
            else if ( 'N' == wc )
                fNoQuery = TRUE;
            else if ( 'Q' == wc )
                fQuiet = TRUE;
            else if ( 'T' == wc )
                fDisplayStatus = TRUE;
            else if ( 'U' == wc )
                fDisplayUpToDate = TRUE;
            else if ( 'E' == wc )
                pwcLocale = argv[i] + 3;
            else if ( 'L' == wc )
            {
                if ( '1' == argv[i][3] )
                    ulDialect = 1;
                else if ( '2' == argv[i][3] )
                    ulDialect = 2;
                else if ( '3' == argv[i][3] )
                    ulDialect = 3;
                else
                    Usage();
            }
            else if ( 'F' == wc )
            {
                if ( '+' == argv[i][3] )
                    fForceUseContentIndex = TRUE;
                else if ( '-' == argv[i][3] )
                    fForceUseContentIndex = FALSE;
                else
                    Usage();
            }
            else
                Usage();
        }
        else if ( 0 != pwcRestriction || 0 != pwcQueryFile )
            Usage();
        else
            pwcRestriction = argv[i];
    }

    // A query restriction, query file, or status request is necessary.

    if ( 0 == pwcRestriction && 0 == pwcQueryFile &&
         !fDisplayStatus && !fDisplayUpToDate )
        Usage();

    // Normalize relative and virtual scopes

    WCHAR awcScope[ MAX_PATH ];
    DWORD dwScopeFlags;
    HRESULT hr = NormalizeScope( pwcScope, awcScope, fShallow, dwScopeFlags );

    // Initialize OLE

    BOOL fCoInit = FALSE;

    if ( SUCCEEDED( hr ) )
    {
        hr = CoInitialize( 0 );
        if ( SUCCEEDED( hr ) )
            fCoInit = TRUE;
    }

    if ( FAILED( hr ) )
        return -1;

    // Get the locale identifier to use for the query

    LCID lcid = LcidFromHttpAcceptLanguage( pwcLocale );

    // If no catalog was specified, infer one based on the scope

    WCHAR awcMachine[ MAX_PATH ], awcCatalog[ MAX_PATH ];

    if ( SUCCEEDED( hr ) && ( 0 == pwcCatalog ) && !fNoQuery )
    {
        ULONG cwcMachine = sizeof awcMachine / sizeof WCHAR;
        ULONG cwcCatalog = sizeof awcCatalog / sizeof WCHAR;
        hr = LookupCatalog( awcScope,
                            awcMachine,
                            cwcMachine,
                            awcCatalog,
                            cwcCatalog,
                            lcid );
        pwcMachine = awcMachine;
        pwcCatalog = awcCatalog;

        // Turn scopes like \\machine into \ now that the lookup is done
        // and we've found a catalog and machine name.

        if ( SUCCEEDED( hr ) &&
             L'\\' == awcScope[0] && L'\\' == awcScope[1] &&
             0 == wcschr( awcScope + 2, L'\\' ) )
            awcScope[1] = 0;
    }

    if ( SUCCEEDED( hr ) )
    {
        for (ULONG j = 0; j < cRepetitions; j++)
        {
            if ( 0 != pwcQueryFile )
                hr = DoQueryFile( fNoQuery ? L"::_noquery" : pwcCatalog,
                                  pwcMachine,
                                  awcScope,
                                  dwScopeFlags,
                                  pwcColumns,
                                  pwcSort,
                                  fDisplayTree,
                                  fQuiet,
                                  fForceUseContentIndex,
                                  fNoQuery,
                                  ulDialect,
                                  cMaxHits,
                                  lcid,
                                  pwcQueryFile );
            else if ( 0 != pwcRestriction )
                hr = DoQuery( fNoQuery ? L"::_noquery" : pwcCatalog,
                              pwcMachine,
                              awcScope,
                              dwScopeFlags,
                              pwcRestriction,
                              pwcColumns,
                              pwcSort,
                              fDisplayTree,
                              fQuiet,
                              fForceUseContentIndex,
                              fNoQuery,
                              ulDialect,
                              cMaxHits,
                              lcid );

            if ( SUCCEEDED( hr ) && fDisplayStatus )
                hr = DisplayStatus( pwcCatalog, pwcMachine, lcid );

            if ( SUCCEEDED( hr ) && fDisplayUpToDate )
                hr = DisplayUpToDate( pwcCatalog, pwcMachine, lcid );
        }
    }

    if ( fCoInit )
        CoUninitialize();

    if ( FAILED( hr ) )
        return -1;

    return 0;
} //wmain

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/Simple/QSample.Hxx File Reference

  • WinBase
  • Indexing
  • Simple
Defines

QSample.Hxx File Reference

Go to the source code of this file.

Defines

#define | IDR_USAGE 100
#define | IDS_CANTCONVERTTOUNICODE 207
#define | IDS_CANTDISPLAYSTATUS 210
#define | IDS_CANTFINDCATALOG 209
#define | IDS_CANTGETFILESIZE 204
#define | IDS_CANTGETMEMORY 205
#define | IDS_CANTOPENFILE 203
#define | IDS_CANTREADFROMFILE 206
#define | IDS_QUERYDONE 201
#define | IDS_QUERYFAILED 202
#define | IDS_QUERYTIMEDOUT 200
#define | IDS_ROWSET_STAT_CONTENT_OUT_OF_DATE 254
#define | IDS_ROWSET_STAT_CONTENT_QUERY_INCOMPLETE 256
#define | IDS_ROWSET_STAT_ERROR 250
#define | IDS_ROWSET_STAT_NOISE_WORDS 253
#define | IDS_ROWSET_STAT_PARTIAL_SCOPE 252
#define | IDS_ROWSET_STAT_REFRESH 251
#define | IDS_ROWSET_STAT_REFRESH_INCOMPLETE 255
#define | IDS_ROWSET_STAT_SHARING_VIOLATION 258
#define | IDS_ROWSET_STAT_TIME_LIMIT_EXCEEDED 257
#define | IDS_STAT_BATTERY_POWER 240
#define | IDS_STAT_CATALOG 248
#define | IDS_STAT_DOCUMENTS 223
#define | IDS_STAT_FILTEREDDOCUMENTS 222
#define | IDS_STAT_FRESHTEST 221
#define | IDS_STAT_HIGH_IO 239
#define | IDS_STAT_INDEXSIZE 229
#define | IDS_STAT_LOW_MEMORY 238
#define | IDS_STAT_MACHINE 249
#define | IDS_STAT_MERGE_ANNEALING 231
#define | IDS_STAT_MERGE_INDEX_MIGRATION 232
#define | IDS_STAT_MERGE_MASTER 233
#define | IDS_STAT_MERGE_MASTER_PAUSED 234
#define | IDS_STAT_MERGE_SHADOW 230
#define | IDS_STAT_NOT_UP_TO_DATE 246
#define | IDS_STAT_PENDINGSCANS 228
#define | IDS_STAT_PERSISTENTINDEX 227
#define | IDS_STAT_PROPCACHESIZE 242
#define | IDS_STAT_QUERIES 247
#define | IDS_STAT_READ_ONLY 236
#define | IDS_STAT_READING_USNS 244
#define | IDS_STAT_RECOVERING 237
#define | IDS_STAT_SCANS 235
#define | IDS_STAT_SECQDOCUMENTS 224
#define | IDS_STAT_STARTING 243
#define | IDS_STAT_TOTALDOCUMENTS 220
#define | IDS_STAT_UNIQUEKEYS 225
#define | IDS_STAT_UP_TO_DATE 245
#define | IDS_STAT_USER_ACTIVE 241
#define | IDS_STAT_WORDLIST 226
#define | IDS_UNKNOWNERROR 208

Define Documentation

#define IDR_USAGE 100

Definition at line 74 of file QSample.Hxx.

#define IDS_CANTCONVERTTOUNICODE 207

Definition at line 28 of file QSample.Hxx.

#define IDS_CANTDISPLAYSTATUS 210

Definition at line 31 of file QSample.Hxx.

#define IDS_CANTFINDCATALOG 209

Definition at line 30 of file QSample.Hxx.

#define IDS_CANTGETFILESIZE 204

Definition at line 25 of file QSample.Hxx.

#define IDS_CANTGETMEMORY 205

Definition at line 26 of file QSample.Hxx.

#define IDS_CANTOPENFILE 203

Definition at line 24 of file QSample.Hxx.

#define IDS_CANTREADFROMFILE 206

Definition at line 27 of file QSample.Hxx.

#define IDS_QUERYDONE 201

Definition at line 22 of file QSample.Hxx.

#define IDS_QUERYFAILED 202

Definition at line 23 of file QSample.Hxx.

#define IDS_QUERYTIMEDOUT 200

Definition at line 21 of file QSample.Hxx.

#define IDS_ROWSET_STAT_CONTENT_OUT_OF_DATE 254

Definition at line 68 of file QSample.Hxx.

#define IDS_ROWSET_STAT_CONTENT_QUERY_INCOMPLETE 256

Definition at line 70 of file QSample.Hxx.

#define IDS_ROWSET_STAT_ERROR 250

Definition at line 64 of file QSample.Hxx.

#define IDS_ROWSET_STAT_NOISE_WORDS 253

Definition at line 67 of file QSample.Hxx.

#define IDS_ROWSET_STAT_PARTIAL_SCOPE 252

Definition at line 66 of file QSample.Hxx.

#define IDS_ROWSET_STAT_REFRESH 251

Definition at line 65 of file QSample.Hxx.

#define IDS_ROWSET_STAT_REFRESH_INCOMPLETE 255

Definition at line 69 of file QSample.Hxx.

#define IDS_ROWSET_STAT_SHARING_VIOLATION 258

Definition at line 72 of file QSample.Hxx.

#define IDS_ROWSET_STAT_TIME_LIMIT_EXCEEDED 257

Definition at line 71 of file QSample.Hxx.

#define IDS_STAT_BATTERY_POWER 240

Definition at line 53 of file QSample.Hxx.

#define IDS_STAT_CATALOG 248

Definition at line 61 of file QSample.Hxx.

#define IDS_STAT_DOCUMENTS 223

Definition at line 36 of file QSample.Hxx.

#define IDS_STAT_FILTEREDDOCUMENTS 222

Definition at line 35 of file QSample.Hxx.

#define IDS_STAT_FRESHTEST 221

Definition at line 34 of file QSample.Hxx.

#define IDS_STAT_HIGH_IO 239

Definition at line 52 of file QSample.Hxx.

#define IDS_STAT_INDEXSIZE 229

Definition at line 42 of file QSample.Hxx.

#define IDS_STAT_LOW_MEMORY 238

Definition at line 51 of file QSample.Hxx.

#define IDS_STAT_MACHINE 249

Definition at line 62 of file QSample.Hxx.

#define IDS_STAT_MERGE_ANNEALING 231

Definition at line 44 of file QSample.Hxx.

#define IDS_STAT_MERGE_INDEX_MIGRATION 232

Definition at line 45 of file QSample.Hxx.

#define IDS_STAT_MERGE_MASTER 233

Definition at line 46 of file QSample.Hxx.

#define IDS_STAT_MERGE_MASTER_PAUSED 234

Definition at line 47 of file QSample.Hxx.

#define IDS_STAT_MERGE_SHADOW 230

Definition at line 43 of file QSample.Hxx.

#define IDS_STAT_NOT_UP_TO_DATE 246

Definition at line 59 of file QSample.Hxx.

#define IDS_STAT_PENDINGSCANS 228

Definition at line 41 of file QSample.Hxx.

#define IDS_STAT_PERSISTENTINDEX 227

Definition at line 40 of file QSample.Hxx.

#define IDS_STAT_PROPCACHESIZE 242

Definition at line 55 of file QSample.Hxx.

#define IDS_STAT_QUERIES 247

Definition at line 60 of file QSample.Hxx.

#define IDS_STAT_READ_ONLY 236

Definition at line 49 of file QSample.Hxx.

#define IDS_STAT_READING_USNS 244

Definition at line 57 of file QSample.Hxx.

#define IDS_STAT_RECOVERING 237

Definition at line 50 of file QSample.Hxx.

#define IDS_STAT_SCANS 235

Definition at line 48 of file QSample.Hxx.

#define IDS_STAT_SECQDOCUMENTS 224

Definition at line 37 of file QSample.Hxx.

#define IDS_STAT_STARTING 243

Definition at line 56 of file QSample.Hxx.

#define IDS_STAT_TOTALDOCUMENTS 220

Definition at line 33 of file QSample.Hxx.

#define IDS_STAT_UNIQUEKEYS 225

Definition at line 38 of file QSample.Hxx.

#define IDS_STAT_UP_TO_DATE 245

Definition at line 58 of file QSample.Hxx.

#define IDS_STAT_USER_ACTIVE 241

Definition at line 54 of file QSample.Hxx.

#define IDS_STAT_WORDLIST 226

Definition at line 39 of file QSample.Hxx.

#define IDS_UNKNOWNERROR 208

Definition at line 29 of file QSample.Hxx.

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/SmpFilt/FiltReg.Hxx File Reference

  • WinBase
  • Indexing
  • SmpFilt
Classes | Defines | Functions

FiltReg.Hxx File Reference

#include <olectl.h>

Go to the source code of this file.

Classes

struct | SClassEntry
struct | SFilterEntry
struct | SHandlerEntry

Defines

#define | DEFINE_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_DLLREGISTERFILTER2(Handler, Filter, aClasses) DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )
#define | DEFINE_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \
#define | DEFINE_REGISTERFILTER2(Name, Handler, Filter, aClasses)
#define | DEFINE_REGISTERFILTERBASE(Name, Handler, Filter, aClasses, fBlastExistingPersistentHandler)
#define | DEFINE_SOFT_DLLREGISTERFILTER(Handler, Filter, aClasses) DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )
#define | DEFINE_SOFT_REGISTERFILTER(Name, Handler, Filter, aClasses) DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Functions

long | AddThreadingModel (WCHAR const *wszClsId, WCHAR const *wszThreadingModel)
long | BuildKeyValues (WCHAR const *const *awszKeyValues, unsigned cKeyValues)
long | DestroyKeyValues (WCHAR const *const *awszKeyValues, int cKeyValues)
long | RegisterAClass (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszShortName=0, BOOL fAppendOnly=FALSE)
long | RegisterAClassAndExt (SClassEntry const &Class, WCHAR const *pwszPHandler, BOOL fAppendOnly=FALSE, BOOL fBlastExistingPersistentHandler=TRUE)
long | RegisterACLSID (SClassEntry const &Class, WCHAR const *pwszPHandler, WCHAR const *pwszClassId=0, BOOL fAppendOnly=FALSE, BOOL fAppendDesc=TRUE)
long | RegisterAFilter (SFilterEntry const &Filter)
long | RegisterAHandler (SHandlerEntry const &Handler)
long | RemoveAClass (WCHAR *pwszClassId)
long | RemoveAClassName (WCHAR *pwszClass)
long | UnRegisterAFilter (SFilterEntry const &Filter)
long | UnRegisterAHandler (SHandlerEntry const &Handler)
long | UnRegisterAnExt (SClassEntry const &Class)

Define Documentation

#define DEFINE_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1573 of file FiltReg.Hxx.

#define DEFINE_DLLREGISTERFILTER2 | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTER2( Dll, Handler, Filter, aClasses )

Definition at line 1658 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, TRUE ) \

Definition at line 1569 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTER2 | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses
 | ) |

Definition at line 1587 of file FiltReg.Hxx.

#define DEFINE_REGISTERFILTERBASE | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses,
 |  | fBlastExistingPersistentHandler
 | ) |

Definition at line 1500 of file FiltReg.Hxx.

#define DEFINE_SOFT_DLLREGISTERFILTER | ( | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_SOFT_REGISTERFILTER( Dll, Handler, Filter, aClasses )

Definition at line 1579 of file FiltReg.Hxx.

#define DEFINE_SOFT_REGISTERFILTER | ( | Name,
 |  | Handler,
 |  | Filter,
 |  | aClasses |
 | ) |  | DEFINE_REGISTERFILTERBASE( Name, Handler, Filter, aClasses, FALSE ) \

Definition at line 1576 of file FiltReg.Hxx.

Function Documentation

long AddThreadingModel | ( | WCHAR const * | wszClsId,
 |  | WCHAR const * | wszThreadingModel |
 | ) |  |  | [inline]

Definition at line 194 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, wszClsId );
    wcscat( wcTemp, L"\\" );
    wcscat( wcTemp, L"InprocServer32" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                             wcTemp,               // Sub key
                             0,                    // Reserved
                             KEY_ALL_ACCESS,       // Access
                             &hKey );              // Handle

    if ( ERROR_SUCCESS != dwError )
        return dwError;

    if ( 0 != wszThreadingModel )
        dwError = RegSetValueExW( hKey,                   // Key
                                  L"ThreadingModel",      // Name
                                  0,                      // Reserved
                                  REG_SZ,                 // Type
                                  (BYTE *) wszThreadingModel,  // Value
                                  (DWORD) ( (wcslen(wszThreadingModel) + 1) * sizeof WCHAR ) );
    else
        RegDeleteValueW( hKey,                   // Key
                         L"ThreadingModel" );    // Name

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long BuildKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | unsigned | cKeyValues |
 | ) |  |  | [inline]

Definition at line 121 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];
    wcscpy( wcTemp, L"CLSID" );

    long dwError;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    unsigned i = 0;

    do
    {
        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        DWORD  dwDisposition;

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;

        if ( 0 != awszKeyValues[i] )
            dwError = RegSetValueExW( hKey,                     // Key
                                      0,                        // Name
                                      0,                        // Reserved
                                      REG_SZ,                   // Type
                                      (BYTE *)awszKeyValues[i], // Value
                                      (DWORD) ( (1 + wcslen(awszKeyValues[i]) ) * sizeof(WCHAR) ) );

        if ( ERROR_SUCCESS != dwError )
            break;

        i++;
    }
    while ( i < cKeyValues );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        RegCloseKey( hKey );

    return dwError;
}

long DestroyKeyValues | ( | WCHAR const *const * | awszKeyValues,
 |  | int | cKeyValues |
 | ) |  |  | [inline]

Definition at line 248 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    //
    // Build path to deepest component
    //

    wcscpy( wcTemp, L"CLSID" );
    int i = 0;

    do
    {
        wcscat( wcTemp, L"\\" );
        wcscat( wcTemp, awszKeyValues[i] );

        i += 2;
    }
    while ( i < cKeyValues );

    //
    // Remove components in reverse order
    //

    long dwError = ERROR_SUCCESS;
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;

    unsigned cc = (unsigned) wcslen( wcTemp );

    for ( i -= 2; i >= 0; i -= 2 )
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 wcTemp,               // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        #if 0  // Values deleted by RegDeleteKeyW
        //
        // Delete value, if there is one.
        //

        if ( 0 != awszKeyValues[i+1] )
            dwError = RegDeleteValueW( hKey, 0 );

        if ( ERROR_SUCCESS != dwError )
            break;
        #endif // 0

        //
        // Delete subkey, if there is one.
        //

        if ( i+2 < cKeyValues )
            dwError = RegDeleteKeyW( hKey, awszKeyValues[i+2] );

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Close key and truncate string to next component.
        //

        if ( INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        cc -= (unsigned) wcslen( awszKeyValues[i] );
        cc--;

        wcTemp[cc] = 0;
    }

    //
    // Remove the final top key
    //

    if ( ERROR_SUCCESS == dwError )
    {
        do
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key -- "CLSID"
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Delete subkey
            //

            dwError = RegDeleteKeyW( hKey, awszKeyValues[0] );

        } while ( FALSE );
    }

    return dwError;
}

long RegisterAClass | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszShortName = 0,
 |  | BOOL | fAppendOnly = FALSE |
 | ) |  |  | [inline]

Definition at line 552 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    if ( 0 == pwszShortName )
    {
        if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, Class.pwszShortName );
    }
    else
    {
        if ( wcslen( pwszShortName ) >= MAX_PATH )
            return ERROR_INSUFFICIENT_BUFFER;

        wcscpy( wcTemp, pwszShortName );
    }

    do
    {
        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        //
        // Here, wcTemp contains the key name for the named entry (ex: Word.Document.8)
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        //
        // If needed, write the description, but only for non-overrides.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszShortName )
        {
            dwError = RegSetValueExW( hKey,                          // Key
                                      0,                             // Name
                                      0,                             // Reserved
                                      REG_SZ,                        // Type
                                      (BYTE *)Class.pwszDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszDescription) ) * sizeof(WCHAR) ) );

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Write or read ClassId
        //

        wcscat( wcTemp, L"\\CLSID" );

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        dwSize = sizeof(wcTemp);

        dwError = RegQueryValueExW( hKey,                // Key handle
                                    0,                   // Name
                                    0,                   // Reserved
                                    &dwType,             // Datatype
                                    (BYTE *)(wcTemp),    // Data returned here
                                    &dwSize );           // Size of data

        if ( ERROR_SUCCESS != dwError )
        {
            if ( ERROR_FILE_NOT_FOUND == dwError )
            {
                //
                // Don't set a class id in append mode.
                //

                if ( fAppendOnly )
                {
                    dwError = ERROR_SUCCESS;
                    break;
                }

                dwError = RegSetValueExW( hKey,                          // Key
                                          0,                             // Name
                                          0,                             // Reserved
                                          REG_SZ,                        // Type
                                          (BYTE *)Class.pwszClassId,     // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszClassId) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0; // Default to class from Class structure

                if ( ERROR_SUCCESS != dwError )
                    break;
            }
            else
                break;
        }
        else
        {
            if ( REG_SZ != dwType )
                dwError = E_FAIL;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp contains the {class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        dwError = RegisterACLSID( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAClassAndExt | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fBlastExistingPersistentHandler = TRUE |
 | ) |  |  | [inline]

Definition at line 371 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError = NO_ERROR;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    do
    {
        //
        // First, the optional extension entry
        //

        DWORD dwDisposition;
        DWORD dwType;
        DWORD dwSize;

        if ( 0 == Class.pwszExt )
        {
            //
            // Build up named entry
            //

            if ( wcslen( Class.pwszShortName ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszShortName );
        }
        else
        {
            if ( wcslen( Class.pwszExt ) >= MAX_PATH )
                return ERROR_INSUFFICIENT_BUFFER;

            wcscpy( wcTemp, Class.pwszExt );

            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write or read class association
            //

            BOOL fSetValue = TRUE;

            if ( REG_OPENED_EXISTING_KEY == dwDisposition )
            {
                dwSize = sizeof(wcTemp);

                dwError = RegQueryValueExW( hKey,            // Key handle
                                            0,               // Name
                                            0,               // Reserved
                                            &dwType,         // Datatype
                                            (BYTE *)wcTemp,  // Data returned here
                                            &dwSize );       // Size of data

                if ( ERROR_SUCCESS == dwError )
                {
                    fSetValue = FALSE;

                    if ( REG_SZ != dwType )
                        dwError = E_FAIL;
                }
                else if ( ERROR_FILE_NOT_FOUND == dwError )
                {
                    //
                    // This is ok, but we need to remember that the
                    // combination of wcTemp[0] == 0 && fAppendOnly means
                    // don't try to register the class.
                    //

                    wcTemp[0] = 0;
                    dwError = ERROR_SUCCESS;
                }
            }

            if ( fSetValue && !fAppendOnly )
            {
                dwError = RegSetValueExW( hKey,                        // Key
                                          0,                           // Name
                                          0,                           // Reserved
                                          REG_SZ,                      // Type
                                          (BYTE *)Class.pwszShortName, // Value
                                          (DWORD) ( (1 + wcslen(Class.pwszShortName) ) * sizeof(WCHAR) ) );

                wcTemp[0] = 0;
            }

            if ( ERROR_SUCCESS != dwError )
                break;

            //
            // Write the persistent handler key
            //

            HKEY hKey2 = (HKEY)INVALID_HANDLE_VALUE;

            dwError = RegCreateKeyExW( hKey,                 // Root
                                       L"PersistentHandler", // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey2,               // Handle
                                       &dwDisposition );     // Disposition

            if ( ERROR_SUCCESS != dwError )
                break;

            if ( fBlastExistingPersistentHandler ||
                 ( REG_OPENED_EXISTING_KEY != dwDisposition ) )
                dwError = RegSetValueExW( hKey2,                 // Key
                                          0,                     // Name
                                          0,                     // Reserved
                                          REG_SZ,                // Type
                                          (BYTE *)pwszPHandler,  // Value
                                          (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

            if ( (HKEY)INVALID_HANDLE_VALUE != hKey2 )
            {
                RegCloseKey( hKey2 );
                hKey2 = (HKEY)INVALID_HANDLE_VALUE;
            }
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // Here, wcTemp may contain the key name for the named entry (ex: Word.Document.8)
        //

        if ( wcTemp[0] != 0 || !fAppendOnly )
            dwError = RegisterAClass( Class, pwszPHandler, (0 == wcTemp[0]) ? 0 : wcTemp, fAppendOnly );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterACLSID | ( | SClassEntry const & | Class,
 |  | WCHAR const * | pwszPHandler,
 |  | WCHAR const * | pwszClassId = 0,
 |  | BOOL | fAppendOnly = FALSE,
 |  | BOOL | fAppendDesc = TRUE |
 | ) |  |  | [inline]

Definition at line 787 of file FiltReg.Hxx.

{
    WCHAR wcTemp[MAX_PATH];

    long dwError;
    HKEY  hKey = (HKEY)INVALID_HANDLE_VALUE;

    wcscpy( wcTemp, L"CLSID\\" );

    if ( 0 == pwszClassId )
        wcscat( wcTemp, Class.pwszClassId );
    else
        wcscat( wcTemp, pwszClassId );

    do
    {
        DWORD dwDisposition;

        //
        // Here, wcTemp contains the CLSID\{class id} (ex: CLSID\{00020906-0000-0000-C000-000000000046})
        //

        if ( fAppendOnly )
        {
            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS != dwError)
            {
                //
                // Not opening the key at all is legit.
                //

                if ( ERROR_FILE_NOT_FOUND == dwError )
                    dwError = ERROR_SUCCESS;

                break;
            }

            dwDisposition = REG_OPENED_EXISTING_KEY;
        }
        else
        {
            dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                       wcTemp,               // Sub key
                                       0,                    // Reserved
                                       0,                    // Class
                                       0,                    // Flags
                                       KEY_ALL_ACCESS,       // Access
                                       0,                    // Security
                                       &hKey,                // Handle
                                       &dwDisposition );     // Disposition
        }

        if ( ERROR_SUCCESS != dwError )
            break;

        //
        // If needed, write the description, but not for override class.
        //

        if ( REG_CREATED_NEW_KEY == dwDisposition && 0 == pwszClassId && fAppendDesc )
        {
            dwError = RegSetValueExW( hKey,                                 // Key
                                      0,                                    // Name
                                      0,                                    // Reserved
                                      REG_SZ,                               // Type
                                      (BYTE *)Class.pwszClassIdDescription, // Value
                                      (DWORD) ( (1 + wcslen(Class.pwszClassIdDescription) ) * sizeof(WCHAR) ) );

            if ( ERROR_SUCCESS != dwError )
                break;
        }

        if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
        {
            RegCloseKey( hKey );
            hKey = (HKEY)INVALID_HANDLE_VALUE;
        }

        //
        // Always write persistent handler.
        //

        wcscat( wcTemp, L"\\PersistentHandler" );

        dwError = RegCreateKeyExW( HKEY_CLASSES_ROOT,    // Root
                                   wcTemp,               // Sub key
                                   0,                    // Reserved
                                   0,                    // Class
                                   0,                    // Flags
                                   KEY_ALL_ACCESS,       // Access
                                   0,                    // Security
                                   &hKey,                // Handle
                                   &dwDisposition );     // Disposition

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegSetValueExW( hKey,                  // Key
                                  0,                     // Name
                                  0,                     // Reserved
                                  REG_SZ,                // Type
                                  (BYTE *)pwszPHandler,  // Value
                                  (DWORD) ( (1 + wcslen(pwszPHandler) ) * sizeof(WCHAR) ) );

    } while( FALSE );

    if ( (HKEY)INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

long RegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1234 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    long retVal = BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    if ( ERROR_SUCCESS == retVal )
        retVal = AddThreadingModel( Filter.pwszClassId, Filter.pwszThreadingModel );

    return retVal;
}

long RegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1210 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    return BuildKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long RemoveAClass ( WCHAR * pwszClassId ) [inline]

Definition at line 1059 of file FiltReg.Hxx.

{
    //
    // First, delete class entry.
    //

    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors
    long dwEnum = ERROR_SUCCESS;    // For enumerator

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  L"CLSID",             // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClassId );

        RegCloseKey( hKeyEnum );

        long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                      0,                    // Sub key
                                      0,                    // Reserved
                                      KEY_ALL_ACCESS,       // Access
                                      &hKeyEnum );          // Handle
    }

    if ( ERROR_SUCCESS == dwError )
    {
        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                wcscat( wcTemp, L"\\CLSID" );

                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClassId ) )
                    {
                        wcTemp[ wcslen(wcTemp) - wcslen( L"\\CLSID" ) ] = 0;

                        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                                 wcTemp,               // Sub key
                                                 0,                    // Reserved
                                                 KEY_ALL_ACCESS,       // Access
                                                 &hKey );              // Handle

                        if ( ERROR_SUCCESS == dwError )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKey, L"CLSID" );
                            else
                                RegDeleteKeyW( hKey, L"CLSID" );

                            dwIndex = 0;
                        }

                        //
                        // If there are no more entries, then the class name can be deleted
                        //

                        dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);

                        long dw2 = RegEnumKeyExW( hKey,               // Handle of key
                                                  0,                  // Index of registry subkey
                                                  wcTemp,             // Buffer for name
                                                  &dwSize,            // Size of buffer / key
                                                  0,                  // Reserved
                                                  0,                  // Class (unused)
                                                  0,                  // Class size (unused)
                                                  &ftUnused );        // Filetime (unused)

                        RegCloseKey( hKey );

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                            RemoveAClassName( wcTemp );
                    }
                }
                else
                    dwError = ERROR_SUCCESS;  // Just didn't have CLSID
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long RemoveAClassName ( WCHAR * pwszClass ) [inline]

Definition at line 923 of file FiltReg.Hxx.

{
    //
    // First, delete class name entry.
    //

    long dwEnum = ERROR_SUCCESS;    // The enumerator
    long dwIgnore = ERROR_SUCCESS;  // For non-fatal errors

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                  0,                    // Sub key
                                  0,                    // Reserved
                                  KEY_ALL_ACCESS,       // Access
                                  &hKeyEnum );          // Handle

    if ( ERROR_SUCCESS == dwError )
    {
        dwIgnore = RegDeleteKeyW( hKeyEnum, pwszClass );

        //
        // Now enumerate all classes entries, looking for the clsid
        //

        DWORD dwIndex = 0;

        while ( ERROR_SUCCESS == dwEnum )
        {
            WCHAR wcTemp[MAX_PATH];
            DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]);
            FILETIME ftUnused;

            dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                    dwIndex,                // Index of registry subkey
                                    wcTemp,                 // Buffer for name
                                    &dwSize,                // Size of buffer / key
                                    0,                      // Reserved
                                    0,                      // Class (unused)
                                    0,                      // Class size (unused)
                                    &ftUnused );            // Filetime (unused)

            dwIndex++;

            if ( ERROR_SUCCESS == dwEnum )
            {
                HKEY hKey;

                dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                         wcTemp,               // Sub key
                                         0,                    // Reserved
                                         KEY_ALL_ACCESS,       // Access
                                         &hKey );              // Handle

                if ( ERROR_SUCCESS == dwError )
                {
                    WCHAR wcTemp2[MAX_PATH];
                    DWORD dwType;

                    dwSize = sizeof(wcTemp2);

                    dwError = RegQueryValueExW( hKey,                // Key handle
                                                0,                   // Name
                                                0,                   // Reserved
                                                &dwType,             // Datatype
                                                (BYTE *)wcTemp2,     // Data returned here
                                                &dwSize );           // Size of data

                    RegCloseKey( hKey );

                    if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, pwszClass ) )
                    {
                        //
                        // Always delete the value
                        //

                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteValueW( hKey, 0 );
                        else
                            RegDeleteValueW( hKey, 0 );

                        //
                        // Any other key(s)?
                        //

                        dwSize = sizeof(wcTemp) / sizeof wcTemp[0];

                        DWORD dw2 = RegEnumKeyExW( hKey,                   // Handle of key
                                                   0,                      // Index of registry subkey
                                                   wcTemp,                 // Buffer for name
                                                   &dwSize,                // Size of buffer / key
                                                   0,                      // Reserved
                                                   0,                      // Class (unused)
                                                   0,                      // Class size (unused)
                                                   &ftUnused );            // Filetime (unused)

                        if ( ERROR_NO_MORE_ITEMS == dw2 )
                        {
                            if ( ERROR_SUCCESS == dwIgnore )
                                dwIgnore = RegDeleteKeyW( hKeyEnum, wcTemp );
                            else
                                RegDeleteKeyW( hKeyEnum, wcTemp );

                            dwIndex = 0;
                        }

                    }
                    else
                        dwError = ERROR_SUCCESS;  // Just didn't have a null key (or no match)
                }
            }
        }
    }

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAFilter ( SFilterEntry const & Filter ) [inline]

Definition at line 1470 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[4] = { Filter.pwszClassId,
                                    Filter.pwszClassIdDescription,
                                    L"InprocServer32",
                                    Filter.pwszDLL };

    return DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
}

long UnRegisterAHandler ( SHandlerEntry const & Handler ) [inline]

Definition at line 1260 of file FiltReg.Hxx.

{
    WCHAR const * aKeyValues[6] = { Handler.pwszClassId,
                                    Handler.pwszClassIdDescription,
                                    L"PersistentAddinsRegistered",
                                    0,
                                    L"{89BCB740-6119-101A-BCB7-00DD010655AF}",  // IID_IFilter
                                    Handler.pwszClassIdFilter };

    //
    // dwIgnore is used to record non-fatal errors
    //

    long dwIgnore = DestroyKeyValues( aKeyValues, sizeof(aKeyValues)/sizeof(aKeyValues[0]) );
    long dwError = ERROR_SUCCESS;

    //
    // Now, enumerate all classes and delete any persistent handler entries.
    //

    HKEY hKeyEnum = (HKEY)INVALID_HANDLE_VALUE;

    long dwEnum = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 L"CLSID",              // Sub key
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKeyEnum );          // Handle

    DWORD dwIndex = 0;

    while ( ERROR_SUCCESS == dwEnum )
    {
        WCHAR wcTemp[MAX_PATH];

        wcscpy( wcTemp, L"CLSID\\" );
        unsigned cc = (unsigned) wcslen( wcTemp );

        DWORD dwSize = sizeof(wcTemp)/sizeof(wcTemp[0]) - cc;
        FILETIME ftUnused;

        dwEnum = RegEnumKeyExW( hKeyEnum,               // Handle of key
                                dwIndex,                // Index of registry subkey
                                wcTemp + cc,            // Buffer for name
                                &dwSize,                // Size of buffer / key
                                0,                      // Reserved
                                0,                      // Class (unused)
                                0,                      // Class size (unused)
                                &ftUnused );            // Filetime (unused)

        dwIndex++;

        //
        // Does the key have a persistent handler?
        //

        if ( ERROR_SUCCESS == dwEnum )
        {
            wcscat( wcTemp, L"\\PersistentHandler" );

            HKEY hKey;

            dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                     wcTemp,               // Sub key
                                     0,                    // Reserved
                                     KEY_ALL_ACCESS,       // Access
                                     &hKey );              // Handle

            if ( ERROR_SUCCESS == dwError )
            {
                //
                // Is this the persistent handler we're looking for?
                //

                WCHAR wcTemp2[MAX_PATH];
                DWORD dwType;

                dwSize = sizeof(wcTemp2);

                dwError = RegQueryValueExW( hKey,                // Key handle
                                            0,                   // Name
                                            0,                   // Reserved
                                            &dwType,             // Datatype
                                            (BYTE *)wcTemp2,     // Data returned here
                                            &dwSize );           // Size of data

                RegCloseKey( hKey );

                if ( ERROR_SUCCESS == dwError && 0 == _wcsicmp( wcTemp2, Handler.pwszClassId ) )
                {
                    wcTemp[ wcslen(wcTemp) - wcslen( L"\\PersistentHandler" ) ] = 0;

                    dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                             wcTemp,               // Sub key
                                             0,                    // Reserved
                                             KEY_ALL_ACCESS,       // Access
                                             &hKey );              // Handle

                    if ( ERROR_SUCCESS == dwError )
                    {
                        if ( ERROR_SUCCESS == dwIgnore )
                            dwIgnore = RegDeleteKeyW( hKey, L"PersistentHandler" );
                        else
                            RegDeleteKeyW( hKey, L"PersistentHandler" );

                        dwIndex = 0; // Start over again
                    }

                    //
                    // If that was the *only* entry under the clsid, then the class can be
                    // removed.
                    //

                    dwSize = sizeof(wcTemp2)/sizeof(wcTemp2[0]);

                    long dw2 = RegEnumKeyExW( hKey,             // Handle of key
                                              0,                // Index of registry subkey
                                              wcTemp2,          // Buffer for name
                                              &dwSize,          // Size of buffer / key
                                              0,                // Reserved
                                              0,                // Class (unused)
                                              0,                // Class size (unused)
                                              &ftUnused );      // Filetime (unused)

                    RegCloseKey( hKey );

                    if ( ERROR_NO_MORE_ITEMS == dw2 )
                        RemoveAClass( wcTemp + wcslen( L"CLSID\\" ) );
                }
                else
                {
                    //
                    // Didn't have persistent handler null key.  Odd but not fatal.
                    // Or, key didn't match target.
                    //

                    dwIgnore = dwError;
                    dwError = ERROR_SUCCESS;
                }

            }
            else
                dwError = ERROR_SUCCESS;  // Just didn't have persistent handler
        }
    }

    if ( (HKEY)INVALID_HANDLE_VALUE != hKeyEnum )
        RegCloseKey( hKeyEnum );

    if ( ERROR_NO_MORE_ITEMS != dwEnum )
        dwError = dwEnum;

    if ( ERROR_SUCCESS != dwError )
        return dwError;
    else
        return dwIgnore;
}

long UnRegisterAnExt ( SClassEntry const & Class ) [inline]

Definition at line 1429 of file FiltReg.Hxx.

{
    HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
    DWORD dwError;

    do
    {
        dwError = RegOpenKeyExW( HKEY_CLASSES_ROOT,    // Root
                                 Class.pwszExt,        // Sub key -- "CLSID"
                                 0,                    // Reserved
                                 KEY_ALL_ACCESS,       // Access
                                 &hKey );              // Handle

        if ( ERROR_SUCCESS != dwError )
            break;

        dwError = RegDeleteKeyW( hKey, L"PersistentHandler" );

    } while ( FALSE );

    if ( INVALID_HANDLE_VALUE != hKey )
    {
        RegCloseKey( hKey );
        hKey = (HKEY)INVALID_HANDLE_VALUE;
    }

    return dwError;
}

Generated on Wed Nov 13 2024 16:55:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/SmpFilt/SmpFilt.Cxx File Reference

  • WinBase
  • Indexing
  • SmpFilt
Functions | Variables

SmpFilt.Cxx File Reference

#include <windows.h>
#include <filter.h>
#include <filterr.h>
#include <ntquery.h>
#include "filtreg.hxx"
#include "smpfilt.hxx"

Go to the source code of this file.

Functions

SCODE STDMETHODCALLTYPE | DllCanUnloadNow (void)
SCODE STDMETHODCALLTYPE | DllGetClassObject (REFCLSID cid, REFIID iid, void **ppvObj)
BOOL WINAPI | DllMain (HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
ULONG GetDefaultCodepage ()

Variables

SClassEntry const | asmpClasses []
SFilterEntry const | smpFilter
SHandlerEntry const | smpHandler

Function Documentation

SCODE STDMETHODCALLTYPE DllCanUnloadNow ( void )

Definition at line 1022 of file SmpFilt.Cxx.

{
    if ( 0 >= g_lInstances )
        return S_OK;
    else
        return S_FALSE;
}

SCODE STDMETHODCALLTYPE DllGetClassObject | ( | REFCLSID | cid,
 |  | REFIID | iid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 977 of file SmpFilt.Cxx.

{
    IUnknown *pResult = 0;

    if ( CLSID_CSmpFilter == cid )
        pResult = (IUnknown *) new CSmpFilterCF;
    else
        return CLASS_E_CLASSNOTAVAILABLE;

    if ( 0 != pResult )
    {
        if( SUCCEEDED( pResult->QueryInterface( iid, ppvObj ) ) )
            // Release extra refcount from QueryInterface
            pResult->Release();
        else
        {
            delete pResult;
            return E_UNEXPECTED;
        }
    }
    else
        return E_OUTOFMEMORY;

    return S_OK;
}

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | fdwReason,
 |  | LPVOID | lpvReserved
 | ) |  |

Definition at line 939 of file SmpFilt.Cxx.

{
   if ( DLL_PROCESS_ATTACH == fdwReason )
        DisableThreadLibraryCalls( hInstance );

    return TRUE;
}

ULONG GetDefaultCodepage ( )

Definition at line 56 of file SmpFilt.Cxx.

{
    ULONG codepage;

    int cwc = GetLocaleInfo( GetSystemDefaultLCID(),
                             LOCALE_RETURN_NUMBER |
                                 LOCALE_IDEFAULTANSICODEPAGE,
                             (LPWSTR) &codepage,
                             sizeof ULONG / sizeof WCHAR );

    // If an error occurred, return the Ansi code page

    if ( 0 == cwc )
         return CP_ACP;

    return codepage;
}

Variable Documentation

SClassEntry const asmpClasses[]
Initial value:
{
    { L".smp",
      L"SmpFilt.Document",
      L"Sample Filter Document",
      L"{8B0E5E72-3C30-11d1-8C0D-00AA00C26CD4}",
      L"Sample Filter Document"
    }
}

Definition at line 1077 of file SmpFilt.Cxx.

SFilterEntry const smpFilter
Initial value:
{
    L"{8B0E5E70-3C30-11d1-8C0D-00AA00C26CD4}",
    L"Sample Filter",
    L"smpfilt.dll",
    L"Both"
}

Definition at line 1094 of file SmpFilt.Cxx.

SHandlerEntry const smpHandler
Initial value:
{
    L"{8B0E5E73-3C30-11d1-8C0D-00AA00C26CD4}",
    L"SmpFilt Persistent Handler",
    L"{8B0E5E70-3C30-11d1-8C0D-00AA00C26CD4}"
}

Definition at line 1087 of file SmpFilt.Cxx.

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/SmpFilt/SmpFilt.Hxx File Reference

  • WinBase
  • Indexing
  • SmpFilt
Classes | Variables

SmpFilt.Hxx File Reference

Go to the source code of this file.

Classes

class | CSmpFilter
class | CSmpFilterCF

Variables

GUID const | CLSID_CSmpFilter
long | g_lInstances = 0
GUID const | guidStorage = PSGUID_STORAGE
const ULONG | TEXT_FILTER_CHUNK_SIZE = 10000L

Variable Documentation

GUID const CLSID_CSmpFilter
Initial value:
{
    0x8b0e5e70,
    0x3c30,
    0x11d1,
    { 0x8c, 0xd, 0x0, 0xaa, 0x0, 0xc2, 0x6c, 0xd4 }
}

Definition at line 41 of file SmpFilt.Hxx.

long g_lInstances = 0

Definition at line 27 of file SmpFilt.Hxx.

GUID const guidStorage = PSGUID_STORAGE

Definition at line 28 of file SmpFilt.Hxx.

const ULONG TEXT_FILTER_CHUNK_SIZE = 10000L

Definition at line 26 of file SmpFilt.Hxx.

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/VJQuery/Query.java File Reference

  • WinBase
  • Indexing
  • VJQuery
Classes

Query.java File Reference

Go to the source code of this file.

Classes

class Query
Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/VJQuery/VJQuery.java File Reference

  • WinBase
  • Indexing
  • VJQuery
Classes

VJQuery.java File Reference

Go to the source code of this file.

Classes

class VJQuery
This class can take a variable number of parameters on the command line. More...
Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/AsyncIO/AsyncIO.c File Reference

  • WinBase
  • IO
  • AsyncIO
Functions

AsyncIO.c File Reference

#include "AsyncIO.h"

Go to the source code of this file.

Functions

BOOL | CreateVirtualBuffer (OUT PVIRTUAL_BUFFER Buffer, IN SIZE_T CommitSize, IN SIZE_T ReserveSize OPTIONAL)
PWORK_QUEUE | CreateWorkQueue (IN DWORD NumberOfWorkerThreads, IN PWORKER_ROUTINE WorkerRoutine)
VOID | DestroyWorkQueue (IN OUT PWORK_QUEUE WorkQueue)
BOOL | EnumerateDirectoryTree (LPSTR DirectoryPath, PDIRECTORY_ENUMERATE_ROUTINE EnumerateRoutine, PVOID EnumerateParameter)
BOOL | ExtendVirtualBuffer (IN PVIRTUAL_BUFFER Buffer, IN LPVOID Address)
BOOL | FreeVirtualBuffer (IN PVIRTUAL_BUFFER Buffer)
int | main (int argc, char *argv[])
BOOL | ProcessCommandLineArguments (int argc, char *argv[])
VOID | ProcessReadFileCompletion (DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped)
VOID | ProcessRequest (IN PWORK_QUEUE_ITEM WorkItem)
VOID | ProcessSearchFile (IN PSEARCH_REQUEST SearchRequest, IN PSEARCH_REQUEST_STATE State)
VOID | QueueSearchFile (LPSTR Path, PWIN32_FIND_DATA FindFileData, PVOID EnumerateParameter)
BOOL | QueueWorkItem (IN OUT PWORK_QUEUE WorkQueue, IN PWORK_QUEUE_ITEM WorkItem)
BOOL | TrimVirtualBuffer (IN PVIRTUAL_BUFFER Buffer)
int | VirtualBufferExceptionFilter (IN DWORD ExceptionCode, IN PEXCEPTION_POINTERS ExceptionInfo, IN OUT PVIRTUAL_BUFFER Buffer)
VOID | WorkerThread (LPVOID lpThreadParameter)

Function Documentation

BOOL CreateVirtualBuffer | ( | OUT PVIRTUAL_BUFFER | Buffer,
 |  | IN SIZE_T | CommitSize,
 |  | IN SIZE_T ReserveSize | OPTIONAL
 | ) |  |

Definition at line 1447 of file AsyncIO.c.

                   :

    This function is called to create a virtual buffer.  A virtual
    buffer is a contiguous range of virtual memory, where some initial
    prefix portion of the memory is committed and the remainder is only
    reserved virtual address space.  A routine is provided to extend the
    size of the committed region incrementally or to trim the size of
    the committed region back to some specified amount.

Arguments:

    Buffer - Pointer to the virtual buffer control structure that is
        filled in by this function.

    CommitSize - Size of the initial committed portion of the buffer.
        May be zero.

    ReserveSize - Amount of virtual address space to reserve for the
        buffer.  May be zero, in which case amount reserved is the
        committed size plus one, rounded up to the next 64KB boundary.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   SYSTEM_INFO SystemInformation;

   //
   // Query the page size from the system for rounding
   // our memory allocations.
   //

   GetSystemInfo( &SystemInformation );
   Buffer->PageSize = SystemInformation.dwPageSize;

   //
   // If the reserve size was not specified, default it by
   // rounding up the initial committed size to a 64KB
   // boundary.  This is because the Win32 Virtual Memory
   // API calls always allocate virtual address space on
   // 64KB boundaries, so we might well have it available
   // for commitment.
   //

   if (!ARGUMENT_PRESENT( ReserveSize ))
   {
      ReserveSize = ROUND_UP( CommitSize + 1, 0x10000 );
   }

   //
   // Attempt to reserve the address space.
   //

   Buffer->Base = VirtualAlloc( NULL,
                                ReserveSize,
                                MEM_RESERVE,
                                PAGE_READWRITE
                              );
   if (Buffer->Base == NULL)
   {
      //
      // Unable to reserve address space, return failure.
      //

      return FALSE;
   }

   //
   // Attempt to commit some initial portion of the reserved region.
   //
   //

   CommitSize = ROUND_UP( CommitSize, Buffer->PageSize );
   if (CommitSize == 0 ||
       VirtualAlloc( Buffer->Base,
                     CommitSize,
                     MEM_COMMIT,
                     PAGE_READWRITE
                   ) != NULL
      )
   {
      //
      // Either the size of the committed region was zero or the
      // commitment succeeded.  In either case calculate the
      // address of the first byte after the committed region
      // and the address of the first byte after the reserved
      // region and return successs.
      //

      Buffer->CommitLimit = (LPVOID)
                            ((char *)Buffer->Base + CommitSize);

      Buffer->ReserveLimit = (LPVOID)
                             ((char *)Buffer->Base + ReserveSize);

      return TRUE;
   }

   //
   // If unable to commit the memory, release the virtual address
   // range allocated above and return failure.
   //

   VirtualFree( Buffer->Base, 0, MEM_RELEASE );
   return FALSE;
}

PWORK_QUEUE CreateWorkQueue | ( | IN DWORD | NumberOfWorkerThreads,
 |  | IN PWORKER_ROUTINE | WorkerRoutine
 | ) |  |

Definition at line 1019 of file AsyncIO.c.

                   :

    This function creates a work queue, with the specified number of
    threads to service work items placed in the queue.  Work items
    are removed from the queue in the same order that they are placed
    in the queue.

Arguments:

    NumberOfWorkerThreads - Specifies how many threads this function
        should create to process work items placed in the queue.
        The number must be no greater than MAXIMUM_WORKER_THREAD
        and greater than 0.

    WorkerRoutine - Specifies the address of a routine to call
        for each work item as it is removed from the queue.  The
        thread context the routine is called in is undefined.

Return Value:

    A pointer to the work queue.  Returns NULL if unable to create
    the work queue and its worker threads.  Extended error information
    is available from GetLastError()

--*/

{
   PWORK_QUEUE WorkQueue;
   HANDLE Thread;
   DWORD ThreadId;
   DWORD i;

   //
   // Allocate space for the work queue, which includes an
   // array of thread handles.
   //

   WorkQueue = LocalAlloc( LMEM_ZEROINIT,
                           sizeof( *WorkQueue ) +
                           (NumberOfWorkerThreads * sizeof( HANDLE ))
                         );
   if (WorkQueue == NULL)
   {
      return NULL;
   }

   //
   // Mutual exclusion between the worker threads accessing the work
   // queue is done with a critical section. Initialize the critical
   // section and preallocate the event that will be used later by
   // EnterCriticalSection(). Set spin count to 0, so when the critical
   // section is unavailable, a calling thread will not spin before wait.
   //

   if (!InitializeCriticalSectionAndSpinCount( &WorkQueue->CriticalSection, 0))
   {
      LocalFree( WorkQueue);
      return NULL;
   }

   //
   // The work queue is controlled by a counting semaphore that
   // is incremented each time a work item is placed in the queue
   // and decremented each time a worker thread wakes up to remove
   // an item from the queue.
   //

   if (WorkQueue->Semaphore = CreateSemaphore( NULL, 0, 100000, NULL ))
   {

      //
      // The queue itself is just a doubly linked list, where
      // items are placed in the queue at the tail of the list
      // and removed from the queue from the head of the list.
      //

      InitializeListHead( &WorkQueue->Queue );

      //
      // Capture the address of the supplied worker function in
      // the work queue structure.
      //

      WorkQueue->WorkerRoutine = WorkerRoutine;

      //
      // Now create the requested number of worker threads. The
      // handle to each thread is remembered in an array of thread
      // handles in the work queue structure.
      //

      for (i=0; i<NumberOfWorkerThreads; i++)
      {
         Thread = CreateThread( NULL,
                                0,
                                (LPTHREAD_START_ROUTINE) WorkerThread,
                                WorkQueue,
                                0,
                                &ThreadId
                              );
         if (Thread == NULL)
         {
            break;
         }
         else
         {
            WorkQueue->NumberOfWorkerThreads++;
            WorkQueue->WorkerThreads[ i ] = Thread;
            SetThreadPriority( Thread, THREAD_PRIORITY_ABOVE_NORMAL );
         }
      }

      //
      // If we successfully created all of the worker threads
      // then return the address of the work queue structure
      // to indicate success.
      //

      if (i == NumberOfWorkerThreads)
      {
         return WorkQueue;
      }
   }

   //
   // Failed for some reason.  Destroy whatever we managed
   // to create and return failure to the caller.
   //

   DestroyWorkQueue( WorkQueue );
   return NULL;
}

VOID DestroyWorkQueue ( IN OUT PWORK_QUEUE WorkQueue )

Definition at line 1162 of file AsyncIO.c.

                   :

    This function first sets the terminating flag of the specified work
    queue. It then shuts down the worker threads associated with work
    queue cleanly after the threads complete processing all the work
    items in the queue and exit. After all the threads have exited, the
    function destroys `the work queue.

Arguments:

    WorkQueue - Supplies a pointer to the work queue to destroy.

Return Value:

    None.

--*/

{
   DWORD i;
   DWORD rc;

   //
   // If the semaphore handle field is not NULL, then there
   // may be threads to terminate.
   //

   if (WorkQueue->Semaphore != NULL)
   {
      //
      // Set the terminating flag in the work queue and
      // signal the counting semaphore by the number of
      // worker threads so they will all wake up and
      // notice the terminating flag and exit.
      //

      EnterCriticalSection( &WorkQueue->CriticalSection );
      _try {
         WorkQueue->Terminating = TRUE;
         ReleaseSemaphore( WorkQueue->Semaphore,
                           WorkQueue->NumberOfWorkerThreads,
                           NULL
                         );
         //
         // The count of the semaphore at this time is equal to the
         // number of work items remaining in the work queue plus
         // the number of worker threads. This ensures that all threads
         // will be awakened to run.
         //
      }
      _finally {
         LeaveCriticalSection( &WorkQueue->CriticalSection );
      }

      //
      // Wait for all worker threads to run, see that the terminating
      // flag is set, and then exit when the work queue is empty. This
      // will occur eventually unless the system malfunctions. So do
      // not timeout.
      //

      while (TRUE)
      {
         rc = WaitForMultipleObjectsEx( WorkQueue->NumberOfWorkerThreads,
                                        WorkQueue->WorkerThreads,
                                        TRUE,
                                        INFINITE,    // No timeout
                                        TRUE         // Alertable
                                      );
         if (rc == WAIT_IO_COMPLETION)
         {
            //
            // If we came out of the wait because an I/O
            // completion routine was called, reissue the
            // wait.
            //
            continue;
         }
         else
         {
            break;
         }
      }

      //
      // Now all the worker threads have terminated. Close the thread
      // handles so the thread objects will eventually be deleted by
      // the object manager.
      //

      for (i=0; i<WorkQueue->NumberOfWorkerThreads; i++)
      {
         CloseHandle( WorkQueue->WorkerThreads[ i ] );
      }

      //
      // All threads stopped, all thread handles closed.  Now
      // delete the critical section and close the semaphore
      // handle.
      //

      DeleteCriticalSection( &WorkQueue->CriticalSection );
      CloseHandle( WorkQueue->Semaphore );
   }

   //
   // Everything is done, now free the memory used by the work queue.
   //

   LocalFree( WorkQueue );
   return;
}

BOOL EnumerateDirectoryTree | ( | LPSTR | DirectoryPath,
 |  | PDIRECTORY_ENUMERATE_ROUTINE | EnumerateRoutine,
 |  | PVOID | EnumerateParameter
 | ) |  |

Definition at line 1840 of file AsyncIO.c.

                   :

    This function walks a directory tree, depth first, calling the
    passed enumeration routine for each directory and file found
    in the tree.  The enumeration routine is passed the full path
    of the file, the directory information associated with the file
    and an enumeration parameter that is uninterpreted by this
    function.

Arguments:

    DirectoryPath - Absolute or relative path to the directory that
        is the root of the tree to enumerate.

    EnumerateRoutine - Pointer to an enumeration routine to call
        for each file and directory found.

    EnumerateParameter - Uninterpreted 32-bit value that is passed
        to the EnumerationRoutine each time it is called.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   BOOL Result;
   VIRTUAL_BUFFER Buffer;
   PENUMERATE_DIRECTORY_STATE State;
   PENUMERATE_DIRECTORY_STACK Stack;
   WIN32_FIND_DATA FindFileData;

   //
   // Create a virtual buffer with an initial committed size of
   // our directory state buffer, and a maximum reserved size of
   // the longest possible full path based on the maximum depth
   // we handle and the maximum length of each path component.
   //

   if (!CreateVirtualBuffer( &Buffer,
                             (SIZE_T)  sizeof( ENUMERATE_DIRECTORY_STATE ),
               (SIZE_T)  (sizeof( ENUMERATE_DIRECTORY_STATE ) +
                    MAX_DEPTH * MAX_PATH)
                           )
      )
   {
      return FALSE;
   }

   //
   // This buffer will be used to maintain a stack of directory
   // search handles, as well as accumulate the full path string
   // as we descend the directory tree.
   //

   State = (PENUMERATE_DIRECTORY_STATE)Buffer.Base;
   State->Depth = 0;
   Stack = &State->Stack[ 0 ];

   //
   // Enter a try ... finally block so we can insure that we clean
   // up after ourselves on exit.
   //

   _try {
      //
      // First translate the passed in DirectoryPath into a fully
      // qualified path.  This path will be the initial value in
      // our path buffer.  The initial allocation of the path buffer
      // is big enough for this initial request, so does not need
      // to be guarded by a try ... except clause.
      //

      if (GetFullPathName( DirectoryPath, MAX_PATH, State->Path, &Stack->PathEnd ))
      {
         //
         // Now enter a try ... except block that will be used to
         // manage the commitment of space in the path buffer as
         // we append subdirectory names and file names to it.
         // Using the virtual buffer allows us to handle full
         // path names up to 16KB in length, with an initial
         // allocation of 4KB.
         //

         _try {
            //
            // Walk the directory tree.  The outer loop is executed
            // once for each directory in the tree.
            //

            while (TRUE)
            {
               startDirectorySearch:
               //
               // Find the end of the current path, and make sure
               // there is a trailing path separator.
               //

               Stack->PathEnd = strchr( State->Path, '\0' );
               if (Stack->PathEnd > State->Path && Stack->PathEnd[ -1 ] != '\\')
               {
                  *(Stack->PathEnd)++ = '\\';
               }

               //
               // Now append the wild card specification that will
               // let us enumerate all the entries in this directory.
               // Call FindFirstFile to find the first entry in the
               // directory.
               //

               strcpy( Stack->PathEnd, "*.*" );
               Stack->FindHandle = FindFirstFile( State->Path,
                                                  &FindFileData
                                                );
               if (Stack->FindHandle != INVALID_HANDLE_VALUE)
               {
                  //
                  // Entry found.  Now loop through the entire
                  // directory processing each entry found,
                  // including the first one.
                  //
                  do
                  {
                     //
                     // Ignore bogus pseudo-directories that are
                     // returned by some file systems (e.g. FAT).
                     //

                     if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
                         (!strcmp( FindFileData.cFileName, "." ) ||
                          !strcmp( FindFileData.cFileName, ".." )
                         )
                        )
                     {
                        continue;
                     }

                     //
                     // Copy the file name portion from the current
                     // directory entry to the last component in the
                     // path buffer.
                     //
                     // We can use strcpy here because we know that
                     // the source is a null terminated string.
                     //

                     strcpy( Stack->PathEnd, FindFileData.cFileName );

                     //
                     // Call the supplied enumeration routine with the
                     // full path we have built up in the path buffer,
                     // the directory information for this directory
                     // entry and the supplied enumeration parameter.
                     //

                     (*EnumerateRoutine)( State->Path, &FindFileData, EnumerateParameter );

                     //
                     // If this entry is a subdirectory, then it is
                     // time to recurse.  Do this by incrementing the
                     // stack pointer and depth and jumping to the top
                     // of the outer loop to process current contents
                     // of the path buffer as a fully qualified name of
                     // a directory.
                     //

                     if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
                     {
                        Stack++;
                        State->Depth++;
                        goto startDirectorySearch;
                        restartDirectorySearch:         ;
                     }

                     //
                     // Here to find the next entry in the current directory.
                     //
                  }

                  while ( FindNextFile( Stack->FindHandle, &FindFileData ) );

                  //
                  // No more entries in the current directory, so close
                  // the search handle and fall into the code that will
                  // pop our stack of directory seacrh handles.

                  FindClose( Stack->FindHandle );
               }

               //
               // Here when done with a directory.  See if we are pushed
               // inside another directory.  If not, then we are done
               // enumerating the whole tree, so break out of the loop.
               //

               if (!State->Depth)
               {
                  Result = TRUE;
                  break;
               }

               //
               // We were pushed within another directory search,
               // so pop the stack to restore its search handle
               // and path buffer position and resume the search
               // within that directory.

               State->Depth--;
               --Stack;
               goto restartDirectorySearch;
            }
         }

         //
         // Any of the code that appends to the path buffer within
         // the above try ... except clause can cause an access
         // violation if the path buffer becomes longer than its
         // current committed size.  This exception filter
         // will dynamically commit additional pages as needed
         // and resume execution.
         //

         _except( VirtualBufferExceptionFilter( GetExceptionCode(),
                                                GetExceptionInformation(),
                                                &Buffer
                                              )
                )
         {
            //
            // We will get here if the exception filter was unable to
            // commit the memory.
            //

            Result = FALSE;
         }
      }
      else
      {
         //
         // Initial GetFullPathName failed, so return a failure.
         //

         Result = FALSE;
      }
   }
   _finally {
      //
      // Here on our way out of the outer try ... finally block.
      // Make sure all our search handles have been closed and then
      // free the virtual buffer.  The only way this code is not
      // executed is if code within the try ... finally block
      // called ExitThread or ExitProcess, or an external thread
      // or process terminated this thread or process.
      //
      // In the case of process death, this is not a problem, because
      // process terminate closes all open handles attached to the process
      // and frees all private virtual memory that is part of the address
      // space of the process.
      //
      // In the case ot thread death, the code below is not executed if
      // the thread terminates via ExitThread in the context of the
      // try .. finally or if an external thread, either in this process
      // or another process called TerminateThread on this thread.
      //

      while (State->Depth--)
      {
         --Stack;
         FindClose( Stack->FindHandle );
      }

      FreeVirtualBuffer( &Buffer );
   }

   return Result;
}

BOOL ExtendVirtualBuffer | ( | IN PVIRTUAL_BUFFER | Buffer,
 |  | IN LPVOID | Address
 | ) |  |

Definition at line 1569 of file AsyncIO.c.

                   :

    This function is called to extend the committed portion of a virtual
    buffer.

Arguments:

    Buffer - Pointer to the virtual buffer control structure.

    Address - Byte at this address is committed, along with all memory
        from the beginning of the buffer to this address.  If the
        address is already within the committed portion of the virtual
        buffer, then this routine does nothing.  If the address is
        outside the reserved portion of the virtual buffer, then this
        routine returns an error.

        Otherwise enough pages are committed so that the memory from the
        base of the buffer to the passed address is a contiguous region
        of committed memory.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   SIZE_T NewCommitSize;
   LPVOID NewCommitLimit;

   //
   // See if address is within the buffer.
   //

   if (Address >= Buffer->Base && Address < Buffer->ReserveLimit)
   {
      //
      // See if the address is within the committed portion of
      // the buffer.  If so return success immediately.
      //

      if (Address < Buffer->CommitLimit)
      {
         return TRUE;
      }

      //
      // Address is within the reserved portion.  Determine how many
      // bytes are between the address and the end of the committed
      // portion of the buffer.  Round this size to a multiple of
      // the page size and this is the amount we will attempt to
      // commit.
      //

      NewCommitSize =
    ROUND_UP( (SIZE_T) Address + 1, Buffer->PageSize ) - (SIZE_T) Buffer->CommitLimit;

      //
      // Attempt to commit the memory.
      //

      NewCommitLimit = VirtualAlloc( Buffer->CommitLimit,
                                     NewCommitSize,
                                     MEM_COMMIT,
                                     PAGE_READWRITE
                                   );
      if (NewCommitLimit != NULL)
      {
         //
         // Successful, so update the upper limit of the committed
         // region of the buffer and return success.
         //

         Buffer->CommitLimit = (LPVOID)
                               ((SIZE_T)NewCommitLimit + NewCommitSize);

         return TRUE;
      }
   }

   //
   // Address is outside of the buffer, return failure.
   //

   return FALSE;
}

BOOL FreeVirtualBuffer ( IN PVIRTUAL_BUFFER Buffer )

Definition at line 1697 of file AsyncIO.c.

                   :

    This function is called to free all the memory that is associated
    with this virtual buffer.

Arguments:

    Buffer - Pointer to the virtual buffer control structure.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   //
   // Decommit and release all virtual memory associated with
   // this virtual buffer.
   //

   return VirtualFree( Buffer->Base, 0, MEM_RELEASE );
}

int main | ( | int | argc,
 |  | char * | argv[]
 | ) |  |

Definition at line 94 of file AsyncIO.c.

                   :

    This is the main procedure for the AsyncIO program, and is called by
    the C Runtime startup code when the program starts.

Arguments:

    argc - number of argumments in the argv array.

    argv - pointer to an array of null terminated string pointers.

Return Value:

    Process exit status.  The value returned by this function will
    be used as the exit code parameter passed to ExitProcess.

--*/

{
   SYSTEM_INFO SystemInformation;
   PWORK_QUEUE WorkQueue;

   //
   // Query the number of processors from the system and set the default
   // number of worker threads to 4 times the number of processors or
   // MAXIMUM_WORKER_THREADS, whichever is smaller.
   //

   GetSystemInfo( &SystemInformation );
   NumberOfWorkerThreads = SystemInformation.dwNumberOfProcessors * 4;
   if (NumberOfWorkerThreads > MAXIMUM_WORKER_THREADS)
   {
       NumberOfWorkerThreads = MAXIMUM_WORKER_THREADS;
   }

   //
   // Process the arguments given on the command line.
   //

   if (!ProcessCommandLineArguments( argc, argv ))
   {
      exit( 1 );
   }

   //
   // Allocate a thread local storage slot for use by our worker
   // thread routine (ProcessRequest).  This call reserves a
   // 32-bit slot in the thread local storage array for every
   // thread in this process.  Remember the slot index in a global
   // variable for use by our worker thread routine.
   //

   TlsIndex = TlsAlloc();
   if (TlsIndex == TLS_OUT_OF_INDEXES)
   {
      fprintf( stderr, "AsyncIO: Unable to allocated thread local storage.\n" );
      exit( 1 );
   }

   //
   // If asynchronous I/O is used, create an event that will be signalled
   // when there are no more outstanding I/O requests. The event is a
   // manual reset event, that once signalled via SetEvent, will remain
   // signalled until ResetEvent is called.
   //

   if (ASyncIO)
   {
      IoCompletedEvent = CreateEvent( NULL,   // Not inherited
                                      TRUE,   // Manual reset
                                      FALSE,  // Initially reset
                                      NULL    // No name
                                     );
      if (IoCompletedEvent == NULL)
      {
         fprintf( stderr, "AsyncIO: Unable to create the event needed for asynchronous I/O.\n");
         exit( 1 );
      }
   }

   //
   // Create a work queue and the specified number of threads which will
   // process the work items in the queue and the routine which will do
   // the processing.
   //

   WorkQueue = CreateWorkQueue( NumberOfWorkerThreads, ProcessRequest );
   if (WorkQueue == NULL)
   {
      fprintf( stderr, "AsyncIO: Unable to create %u worker threads.\n", NumberOfWorkerThreads );
      exit( 1 );
   }

   //
   // Now walk the directory tree, which will call our procedure
   // QueueSearchFile for each directory and file in the tree.
   //

   if (EnumerateDirectoryTree( DirectoryPath,
                               QueueSearchFile,
                               WorkQueue
                             ) == FALSE)
   {
      //
      // The search failed for some reason. Destroy the work queue.
      // The system will close the IoCompletedEvent handle when we
      // exit.
      //

      DestroyWorkQueue ( WorkQueue );
      exit(1);
   }

   //
   // Done walking the tree.  If asynchronous I/O is used, wait for all
   // all the outstanding I/O requests to be completed.
   //

   if (ASyncIO)
   {
      //
      // We use an alertable wait in a loop. I/O completion will
      // terminate the wait, even through the event we are waiting
      // on is not signalled.
      //

      while (WaitForSingleObjectEx( IoCompletedEvent, // Event waited on
                                    INFINITE,         // No timeout
                                    TRUE              // Alertable
                                  ) == WAIT_IO_COMPLETION
            )
      {
         NOTHING;
      }
   }

   //
   // All done, destroy the work queue. This function will wait until
   // the work queue is empty and all the worker threads have exited
   // and then it will destroy the queue.
   //

   DestroyWorkQueue( WorkQueue );

   if (Verbose && MatchedLineCount)
   {
      fprintf( stderr,
               "Found %u lines with matches in %u files, out of %u files searched.\n",
               MatchedLineCount,
               MatchedFileCount,
               SearchedFileCount
             );
   }

   return 0;
}

BOOL ProcessCommandLineArguments | ( | int | argc,
 |  | char * | argv[]
 | ) |  |

Definition at line 2130 of file AsyncIO.c.

{
   BOOL Result;
   LPSTR s;

   Result = FALSE;
   _try {
      if (argc < 1)
      {
         return Result;
      }

      while (--argc)
      {
         s = *++argv;
         if (*s == '-' || *s == '/')
         {
            while (*++s)
            {
               switch ( tolower( *s ) )
               {
               case 'm':
                  MappedFileIO = TRUE;
                  break;

               case 'a':
                  ASyncIO = TRUE;
                  break;

               case 's':
                  SyncIO = TRUE;
                  break;

               case 'v':
                  Verbose = TRUE;
                  break;

               case 'y':
                  IgnoreCase = TRUE;
                  break;

               case 't':
                  if (--argc)
                  {
                     NumberOfWorkerThreads = atoi( *++argv );
                     if (NumberOfWorkerThreads > 0)
                     {
                        if (NumberOfWorkerThreads > MAXIMUM_WORKER_THREADS)
                        {
                           NumberOfWorkerThreads = MAXIMUM_WORKER_THREADS;
                        }
                        break;
                     }
                  }

                  // fall through if -t argument missing.

               case '?':
               case 'h':
               default:
                  return Result;
               }
            }
         }
         else
            if (SearchString == NULL)
         {
            SearchString = s;
         }
         else
            if (DirectoryPath == NULL)
         {
            DirectoryPath = s;
         }
         else
         {
            return Result;
         }
      }

      if (SearchString == NULL)
      {
         return Result;
      }

      SearchStringLength = (DWORD)strlen(SearchString);
      if (SearchStringLength == 0)
      {
         return Result;
      }

      if (IgnoreCase)
      {
         SearchFunction = _strnicmp;
      }
      else
      {
         SearchFunction = strncmp;
      }

      if (DirectoryPath == NULL)
      {
         DirectoryPath = ".";
      }

      //
      // If the command line specifies neither asynchronous nor
      // synchronous I/O, use mapped file I/O.
      //

      if (!(ASyncIO || SyncIO))
      {
         MappedFileIO = TRUE;

      } else {

         MappedFileIO = FALSE;
      }

      if (Verbose)
      {
         fprintf( stderr, "Directory Tree: %s\n", DirectoryPath );
         fprintf( stderr, "Search String: '%s'\n", SearchString );
         fprintf( stderr, "Case %ssensitive\n", IgnoreCase ? "in" : "" );
         fprintf( stderr, "Number of Worker Threads: %u\n", NumberOfWorkerThreads );

         if (MappedFileIO)
         {
            fprintf( stderr, "Using Mapped File I/O\n" );
         }
         else
            if (ASyncIO)
         {
            fprintf( stderr, "Using ASynchronous File I/O\n" );
         }
         else
            if (SyncIO)
         {
            fprintf( stderr, "Using Synchronous File I/O\n" );
         }
      }

      Result = TRUE;

   }
   _finally {
      if (!Result)
      {
         fprintf( stderr, "usage: AsyncIO [-h] [-v] [-y] [-a | -s | -m] [-t n] SearchString [DirectoryPath]\n" );
         fprintf( stderr, "Where...\n" );
         fprintf( stderr, "    -h - prints this message\n" );
         fprintf( stderr, "    -v - generates verbose output\n" );
         fprintf( stderr, "    -y - ignores case when doing comparision\n" );
         fprintf( stderr, "    -t - specifies the number of threads to use (defaults to 4 * number of processors)\n" );
         fprintf( stderr, "    -a - uses asynchronous file I/O\n" );
         fprintf( stderr, "    -s - uses synchronous file I/O\n" );
         fprintf( stderr, "    -m - uses mapped file I/O (default)\n" );
         fprintf( stderr, "    SearchString - specifies the text to search for\n" );
         fprintf( stderr, "    DirectoryPath - specifies the directory to start from (defaults to .)\n" );
      }
   }

   return Result;
}

VOID ProcessReadFileCompletion | ( | DWORD | dwErrorCode,
 |  | DWORD | dwNumberOfBytesTransfered,
 |  | LPOVERLAPPED | lpOverlapped
 | ) |  |

Definition at line 785 of file AsyncIO.c.

                   :

    This function is called whenever an asynchronous read operation,
    queued by the function QueueSearchFile, completes. This function
    calulates the address of the search request block and then
    queue the request to the work queue, now that the data is
    in memory.

Arguments:

    dwErrorCode - Supplies the error code that the I/O completed with.

    dwNumberOfBytesTransfered - Supplies the actual number of bytes
        transferred.

    lpOverlapped - Supplies a pointer to the structure given to
        ReadFileEx when the I/O operation was queued.

Return Value:

    None.

--*/

{
   PSEARCH_REQUEST SearchRequest;

   //
   // Since the data we need is now in memory, queue the search
   // request to the work queue.
   //

   SearchRequest = CONTAINING_RECORD( lpOverlapped, SEARCH_REQUEST, OverlappedIO );
   QueueWorkItem( SearchRequest->WorkItem.WorkQueue, &SearchRequest->WorkItem );
}

VOID ProcessRequest ( IN PWORK_QUEUE_ITEM WorkItem )

Definition at line 563 of file AsyncIO.c.

                   :

    This function is called whenever a work item is removed from
    the work queue by one of the worker threads.  Which worker
    thread context this function is called in is arbitrary.

    This functions keeps a pointer to state information in
    thread local storage.

    This function is called once at the beginning with a
    special initialization call.  During this call, this
    function allocates space for state information and
    remembers the pointer to the state information in
    a Thread Local Storage (TLS) slot.

    This function is called once at the end with a special
    termination call.  During this call, this function
    frees the state information allocated during the
    initialization call.

    In between these two calls are zero or more calls to
    handle a work item.  The work item is a search request
    which is handled by the ProcessSearchFile function.

Arguments:

    WorkItem - Supplies a pointer to the work item just removed
        from the work queue.  It is the responsibility of this
        routine to free the memory used to hold the work item.

Return Value:

    None.

--*/

{
   DWORD BytesWritten;
   PSEARCH_REQUEST_STATE State;
   PSEARCH_REQUEST SearchRequest;
   CHAR MessageBuffer[ 2 * MAX_PATH ];

   if (WorkItem->Reason == WORK_INITIALIZE_ITEM)
   {
      //
      // First time initialization call.  Allocate space for
      // state information.
      //

      State = LocalAlloc( LMEM_ZEROINIT,
                          sizeof( *State )
                        );

      if (State != NULL)
      {
         //
         // Now create a virtual buffer, with an initial commitment
         // of zero and a maximum commitment of 128KB.  This buffer
         // will be used to accumulate the matched strings output
         // during the search of a single file.  This is so the
         // output can be written to standard output with a single
         // write call, thus insuring that it remains contiguous
         // in the output stream, and is not intermingled with the
         // output of the other worker threads.
         //

         if (CreateVirtualBuffer( &State->Buffer, (SIZE_T) 0, (SIZE_T) (2 * 64 * 1024) ))
         {
            //
            // The CurrentOutput field of the state block is
            // a pointer to where the next output goes in the
            // buffer.  It is initialized here and reset each
            // time the buffer is flushed to standard output.
            //

            State->CurrentOutput = State->Buffer.Base;
         }
         else
         {
            LocalFree( State );
            State = NULL;
         }
      }

      //
      // Remember the pointer to the state information
      // thread local storage.
      //

      TlsSetValue( TlsIndex, State );
      return;
   }

   //
   // Here to handle a work item or special terminate call.
   // Get the state pointer from thread local storage.
   //

   State = (PSEARCH_REQUEST_STATE)TlsGetValue( TlsIndex );
   if (State == NULL)
   {
      return;
   }

   //
   // If this is the special terminate work item, free the virtual
   // buffer and state block allocated above and set the thread
   // local storage value to NULL.  Return to caller.
   //

   if (WorkItem->Reason == WORK_TERMINATE_ITEM)
   {
      FreeVirtualBuffer( &State->Buffer );
      LocalFree( State );
      TlsSetValue( TlsIndex, NULL );
      return;
   }

   //
   // If not an initialize or terminate work item, then must be a
   // search request.  Calculate the address of the search request
   // block, based on the position of the WorkItem field in the
   // SEARCH_REQUEST structure.
   //

   SearchRequest = CONTAINING_RECORD( WorkItem, SEARCH_REQUEST, WorkItem );

   //
   // Actual search operation is protected by a try ... except
   // block so that any attempts to store into the virtual buffer
   // will be handled correctly by extending the virtual buffer.
   //

   _try {
      //
      // Perform the search against this file.
      //

      ProcessSearchFile( SearchRequest, State );

      //
      // Done with this file.  If asynchronous I/O is used, decrement
      // the count of outstanding I/O operations. If the count becomes
      // zero, signal the IoCompletedEvent as there are no more outstanding
      // I/O operations.
      //

      if (ASyncIO && InterlockedDecrement( &OutstandingIOOperations ) == 0)
      {
         SetEvent( IoCompletedEvent );
      }

      //
      // If any output was written to the virtual buffer, flush the
      // output to standard output.  Trim the virtual buffer back to
      // zero committed pages.
      //

      if (State->CurrentOutput > (LPSTR)State->Buffer.Base)
      {
         WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ),
                    State->Buffer.Base,
                    (DWORD)(State->CurrentOutput - (LPSTR)State->Buffer.Base),
                    &BytesWritten,
                    NULL
                  );

         TrimVirtualBuffer( &State->Buffer );
         State->CurrentOutput = (LPSTR)State->Buffer.Base;
      }
   }

   _except( VirtualBufferExceptionFilter( GetExceptionCode(),
                                          GetExceptionInformation(),
                                          &State->Buffer
                                        )
          )
   {

      //
      // We will get here if the exception filter was unable to
      // commit the memory.
      //
      // Note that FullPathName was generated by our function
      // QuerySearchFile. It points to a null terminated path
      // name.
      //

      WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ),
                 MessageBuffer,
                 sprintf( MessageBuffer,
                          "%s(0) : error 0: too many matches for file\n",
                          SearchRequest->FullPathName
                        ),
                 &BytesWritten,
                 NULL
               );
   }

   //
   // Free the storage used by the SearchRequest
   //

   LocalFree( SearchRequest );

   //
   // All done with this request.  Return to the worker thread that
   // called us.
   //

   return;
}

VOID ProcessSearchFile | ( | IN PSEARCH_REQUEST | SearchRequest,
 |  | IN PSEARCH_REQUEST_STATE | State
 | ) |  |

Definition at line 832 of file AsyncIO.c.

                   :

    This function performs the actual search of the contents of the
    passed file for the search string given on the command line.
    If we are using synchronous I/O, then do the read operation
    now.

    Search the contents of the file for any matches, and accumulate
    the match output in the virtual buffer using sprintf, which is
    multi-thread safe, even with the single threaded version of
    the libraries.

    Note that this function is called within an exception block. Our
    function VirtualBufferExceptionFilter will be called if uncommitted
    memory is referenced. That function will either commit additional
    memory and then repeat the faulting instruction or execute the
    caller's exception handler, depending whether additional pages
    can be committed. Therefore, sprintf can be safely used here.

Arguments:

    SearchRequest - Supplies a pointer to the search request which
        contains the relevant information.

    State - Supplies a pointer to state information for the current
        thread.

Return Value:

    None.

--*/

{
   LPSTR FileData, s, s1, BegLine, EndLine, EndOfFile;
   DWORD LineNumber;
   DWORD MatchesFound;
   DWORD BytesRead;

   // Get a pointer to the beginning of the file data in memory
   // and calculate the address of the end of file point in
   // memory.
   //

   FileData = SearchRequest->FileData;
   EndOfFile = FileData + SearchRequest->FileSize;

   //
   // If synchronous I/O is used, then we have not read in the
   // file contents yet, so issue the synchronous read to get
   // the data into memory.
   //

   if (SyncIO)
   {
      if (!ReadFile( SearchRequest->File,
                     FileData,
                     SearchRequest->FileSize,
                     &BytesRead,
                     NULL
                   ) ||
          BytesRead != SearchRequest->FileSize
         )
      {

         State->CurrentOutput += sprintf( State->CurrentOutput,
                                          "%s(0) : error %u: Unable to read file contents.\n",
                                          SearchRequest->FullPathName,
                                          GetLastError()
                                        );

         CloseHandle( SearchRequest->File );
         return;
      }
   }

   //
   // Close any open file handle associated with this request.
   //

   if (SearchRequest->File != NULL)
   {
      CloseHandle( SearchRequest->File );
   }

   //
   // Search the file contents, keeping track of line breaks
   // so we can tell the line number of each match.
   //

   s = FileData;
   LineNumber = 0;
   MatchesFound = 0;
   while (s < EndOfFile)
   {
      BegLine = s;
      while (s < EndOfFile && *s != '\n')
      {
         s++;
      }

      if (*s == '\n')
      {
         LineNumber += 1;
         EndLine = s - 1;
         if (EndLine > BegLine && EndLine[ -1 ] == '\r')
         {
            EndLine -= 1;
         }

         s1 = BegLine;
         while (s1 < (EndLine - SearchStringLength))
         {
            if (!(SearchFunction)( s1, SearchString, SearchStringLength ))
            {
               //
               // We have a match for this line.  Append the
               // output to the virtual buffer and update the
               // current output pointer.
               //

               State->CurrentOutput += sprintf( State->CurrentOutput,
                                                "%s(%u) : %.*s\n",
                                                SearchRequest->FullPathName,
                                                LineNumber,
                                                EndLine - BegLine,
                                                BegLine
                                              );
               MatchesFound += 1;
               break;
            }

            s1++;
         }

         s++;
      }
   }

   if (MatchesFound)
   {

      //
      // Increment the global variables that summarize the result
      // of the search. Since these variables may be incremented
      // by multiple worker threads, use atomic add and increment.
      //

      InterlockedExchangeAdd( &MatchedLineCount, MatchesFound );
      InterlockedIncrement( &MatchedFileCount );
   }
   InterlockedIncrement( &SearchedFileCount );

   //
   // All done with the file contents.  Discard it either by
   // unmapping the view of the file in the case of mapped file
   // I/O or free the virtual memory for other types of I/O
   //

   if (MappedFileIO)
   {
      if (!UnmapViewOfFile( FileData ))
      {
         State->CurrentOutput += sprintf( State->CurrentOutput,
                                          "%s(%u) : UnmapViewOfFile( %p ) failed, error == %u\n",
                                          SearchRequest->FullPathName,
                                          LineNumber,
                                          FileData,
                                          GetLastError()
                                        );
      }
   }
   else
   {
      VirtualFree( FileData, 0, MEM_RELEASE );
   }
}

VOID QueueSearchFile | ( | LPSTR | Path,
 |  | PWIN32_FIND_DATA | FindFileData,
 |  | PVOID | EnumerateParameter
 | ) |  |

Definition at line 260 of file AsyncIO.c.

                   :

    This is the directory enumeration function.  It is called by the
    EnumerateDirectoryTree function once for each file and directory
    in the tree.

    This function, if it decides it wants to search the file, will
    open the file and then, depending upon the I/O method selected via
    the command line, will:

        - map the file PAGE_READONLY for mapped file I/O,

        - read the file into an allocated buffer for synchronous
          I/O, or

        - for asynchronous I/O, allocate a buffer and start a read
          operation to read the entire file into the buffer.  A
          completion routine will be invoked when the read completes,
          possibly in another thread context.

    Finally it will queue a search request to the work queue, with the
    relevant information contained in the request.  For asynchronous
    I/O, the search request is allocated and initialized here but is
    not actually queued to the work queue until the I/O completion
    routine has been called.

Arguments:

    Path - Supplies a pointer to a null terminated string that contains
        the fully qualified path of the file or directory.

    FindFileData - Supplies the directory information associated
        with the file or directory specified by the Path argument.

    EnumerateParameter - Uninterpreted 32-bit value.

Return Value:

    None.

--*/

{
   PWORK_QUEUE WorkQueue = (PWORK_QUEUE)EnumerateParameter;
   PSEARCH_REQUEST SearchRequest;
   HANDLE File;
   HANDLE Mapping;
   LPVOID FileData;
   DWORD FileSize;
   SIZE_T PathLength;

   //
   // Ignore directories or zero length files, as there
   // is nothing to search in these cases.
   //

   if ((FindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
       !(FileSize = FindFileData->nFileSizeLow)
      )
   {
      return;
   }

   //
   // Open the file using the fully qualified path.  Specify the
   // sequential scan hint to the cache manager and GENERIC_READ
   // access to the file. If asynchronous I/O is used, specify
   // file overlapped flag.
   //

   File = CreateFile( Path,
                      GENERIC_READ,
                      FILE_SHARE_READ,
                      NULL,
                      OPEN_EXISTING,
                      FILE_FLAG_SEQUENTIAL_SCAN |
                      (ASyncIO ? FILE_FLAG_OVERLAPPED : 0),
                      NULL
                    );

   //
   // Since NULL might be a valid file object handle, failure
   // is indicated by a special return value.
   //

   if (File == INVALID_HANDLE_VALUE)
   {
      fprintf( stderr, "%s(0) : error %u: Unable to open file.\n",
               Path,
               GetLastError()
             );

      return;
   }

   //
   // File successfully opened for read access.
   //

   if (MappedFileIO)
   {
      //
      // If mapped file I/O, create a file mapping object, backed by
      // the file we just opened.  Make the default page protection
      // for the mapping be read only.
      //

      Mapping = CreateFileMapping( File,
                                   NULL,
                                   PAGE_READONLY,
                                   0,
                                   0,
                                   NULL
                                 );

      //
      // Okay to close the file handle now, since the mapping object
      // has a reference to the file that will cause the open file
      // object to remain until the reference is destroyed. Note that
      // any sharing information is lost at this point, so somebody
      // could come in and open it for write access.
      //

      CloseHandle( File );

      //
      // Here, a null value indicates an error.
      //

      if (Mapping == NULL)
      {
         fprintf( stderr, "%s(0) : error %u: Unable to create mapping object.\n",
                  Path,
                  GetLastError()
                );
         return;
      }

      //
      // Finally, map a view of the file, using the mapping object
      // just created, into the address space of this process.
      // The offset and size are zero, which means to map the
      // entire file.
      //

      FileData = MapViewOfFile( Mapping,
                                FILE_MAP_READ,
                                0,
                                0,
                                0
                              );

      //
      // Okay to close the mapping object handle now, it will remained
      // referenced as long as the view remains mapped.
      //

      CloseHandle( Mapping );

      //
      // A null value indicates the map operation failed.
      //

      if (FileData == NULL)
      {
         fprintf( stderr, "%s(0) : error %u: Unable to map file.\n",
                  Path,
                  GetLastError()
                );
         return;
      }

      //
      // All done mapping the file.  Set the File handle to NULL as
      // it has been closed already.  Both the file object and mapping
      // objects created above will be freed when the map view is
      // unmapped.
      //

      File = NULL;
   }
   else
   {
      //
      // Mapped I/O will not be used. So allocate a buffer big enough
      // to contain the entire file.
      //

      FileData = VirtualAlloc( NULL,
                               FileSize,
                               MEM_COMMIT,
                               PAGE_READWRITE
                             );
      if (FileData == NULL)
      {
         fprintf( stderr, "%s(0) : error %u: Unable to allocate memory to contain file.\n",
                  Path,
                  GetLastError()
                );
         CloseHandle( File );
         return;
      }
   }

   //
   // Note that Path points to a null terminated string produced
   // by our function EnumerateDirectoryTree. We can find the
   // length of the string safely using strlen.
   //

   PathLength = strlen( Path );

   //
   // We have successfully opened the file and are ready to go.
   // Allocate space for a search request and fill it in with
   // the information needed by the ProcessSearchFile function
   // when it runs.
   //
   // The space for SearchRequest->FullNameName[0] is provided
   // within SearchRequest. An additional space of PathLength
   // characters suffices for Path and null termination.
   //

   SearchRequest = LocalAlloc( LMEM_ZEROINIT,
                               sizeof( *SearchRequest ) + PathLength
                             );
   if (SearchRequest == NULL)
   {
      fprintf( stderr, "AsyncIO: Out of memory\n" );
      exit( 1 );
   }

   SearchRequest->WorkItem.Reason = WORK_ITEM;
   SearchRequest->File = File;
   SearchRequest->FileSize = FileSize;
   SearchRequest->FileData = FileData;
   strncpy( SearchRequest->FullPathName, Path, PathLength );
   SearchRequest->FullPathName[ PathLength ] = '\0';

   if (!ASyncIO)
   {

      //
      // Asynchronous I/O is not used. Queue the search
      // request to the work queue.
      //

      QueueWorkItem( WorkQueue, &SearchRequest->WorkItem );
   }
   else
   {
      //
      // Asynchronous I/O is used. Queue the read operation.
      // The file handle must remain open while the read
      // operation is pending.
      //

      if (!ReadFileEx( File,
                       FileData,
                       FileSize,
                       &SearchRequest->OverlappedIO,
                       (LPOVERLAPPED_COMPLETION_ROUTINE) ProcessReadFileCompletion
                     )
         )
      {
         fprintf( stderr, "%s(0) : error %u: Unable to queue read of file.\n",
                  Path,
                  GetLastError()
                );

         VirtualFree( FileData, 0, MEM_RELEASE );
         CloseHandle( File );
         LocalFree( SearchRequest );
         return;
      }

      //
      // Successfully queued the read operation.  Keep a count
      // of outstanding read operations so we know when it is
      // okay to terminate.
      //

      OutstandingIOOperations += 1;
   }

   //
   // Return back to the EnumerateDirectoryTree function so that it
   // can call us with the next file or directrry.
   //

   return;
}

BOOL QueueWorkItem | ( | IN OUT PWORK_QUEUE | WorkQueue,
 |  | IN PWORK_QUEUE_ITEM | WorkItem
 | ) |  |

Definition at line 1284 of file AsyncIO.c.

                   :

    This function queues a work item to the passed work queue that is
    processed by one of the worker threads associated with the queue.

Arguments:

    WorkQueue - Supplies a pointer to the work queue that is to
        receive the work item.

    WorkItem - Supplies a pointer to the work item to add to the queue.
        The work item structure contains a doubly linked list entry, the
        address of a routine to call and a parameter to pass to that
        routine.  It is the routine's responsibility to reclaim the
        storage occupied by the WorkItem structure.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   BOOL Result;

   //
   // Acquire the work queue critical section and insert the work item
   // in the queue and release the semaphore if the work item is not
   // already in the list.
   //

   EnterCriticalSection( &WorkQueue->CriticalSection );
   Result = TRUE;
   _try {
      WorkItem->WorkQueue = WorkQueue;
      InsertTailList( &WorkQueue->Queue, &WorkItem->List );
      Result = ReleaseSemaphore( WorkQueue->Semaphore, 1, NULL );
   }
   _finally {
      LeaveCriticalSection( &WorkQueue->CriticalSection );
   }

   return Result;
}

BOOL TrimVirtualBuffer ( IN PVIRTUAL_BUFFER Buffer )

Definition at line 1667 of file AsyncIO.c.

                   :

    This function is called to decommit any memory that has been
    committed for this virtual buffer.

Arguments:

    Buffer - Pointer to the virtual buffer control structure.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   Buffer->CommitLimit = Buffer->Base;
   return VirtualFree( Buffer->Base, 0, MEM_DECOMMIT );
}

int VirtualBufferExceptionFilter | ( | IN DWORD | ExceptionCode,
 |  | IN PEXCEPTION_POINTERS | ExceptionInfo,
 |  | IN OUT PVIRTUAL_BUFFER | Buffer
 | ) |  |

Definition at line 1730 of file AsyncIO.c.

                   :

    This function is an exception filter that handles exceptions that
    referenced uncommitted but reserved memory contained in the passed
    virtual buffer.  It this filter routine is able to commit the
    additional pages needed to allow the memory reference to succeed,
    then it will re-execute the faulting instruction.  If it is unable
    to commit the pages, it will execute the callers exception handler.

    If the exception is not an access violation or is an access
    violation but does not reference memory contained in the reserved
    portion of the virtual buffer, then this filter passes the exception
    on up the exception chain.

Arguments:

    ExceptionCode - Reason for the exception.

    ExceptionInfo - Information about the exception and the context
        that it occurred in.

    Buffer - Points to a virtual buffer control structure that defines
        the reserved memory region that is to be committed whenever an
        attempt is made to access it.

Return Value:

    Exception disposition code that tells the exception dispatcher what
    to do with this exception.  One of three values is returned:

        EXCEPTION_EXECUTE_HANDLER - execute the exception handler
            associated with the exception clause that called this filter
            procedure.

        EXCEPTION_CONTINUE_SEARCH - Continue searching for an exception
            handler to handle this exception.

        EXCEPTION_CONTINUE_EXECUTION - Dismiss this exception and return
            control to the instruction that caused the exception.

--*/

{
   LPVOID FaultingAddress;

   //
   // If this is an access violation touching memory within
   // our reserved buffer, but outside of the committed portion
   // of the buffer, then we are going to take this exception.
   //

   if (ExceptionCode == STATUS_ACCESS_VIOLATION)
   {
      //
      // Get the virtual address that caused the access violation
      // from the exception record.  Determine if the address
      // references memory within the reserved but uncommitted
      // portion of the virtual buffer.
      //

      FaultingAddress = (LPVOID)ExceptionInfo->ExceptionRecord->ExceptionInformation[ 1 ];
      if (FaultingAddress >= Buffer->CommitLimit &&
          FaultingAddress <= Buffer->ReserveLimit
         )
      {
         //
         // This is our exception.  Try to extend the buffer
         // to including the faulting address.
         //

         if (ExtendVirtualBuffer( Buffer, FaultingAddress ))
         {
            //
            // Buffer successfully extended, so re-execute the
            // faulting instruction.
            //

            return EXCEPTION_CONTINUE_EXECUTION;
         }
         else
         {
            //
            // Unable to extend the buffer.  Stop searching
            // for exception handlers and execute the caller's
            // handler.
            //

            return EXCEPTION_EXECUTE_HANDLER;
         }
      }
   }

   //
   // Not an exception we care about, so pass it up the chain.
   //

   return EXCEPTION_CONTINUE_SEARCH;
}

VOID WorkerThread ( LPVOID lpThreadParameter )

Definition at line 1339 of file AsyncIO.c.

                   :

    This is the routine executed by each worker thread. Upon the
    creation of the thread, the routine allocates and initializes
    the state information and virtual buffer of the thread. It then
    continuously processes work items inserted in the queue whenever
    the thread is released to run. Upon termination, the routine
    calls ExitThread, which cleanly terminates the thread.

Arguments:

    lpThreadParameter - Supplies a pointer to the work queue
        associated with this thread.

Return Value:

    None

--*/

{
   PWORK_QUEUE WorkQueue = (PWORK_QUEUE)lpThreadParameter;
   DWORD rc;
   WORK_QUEUE_ITEM InitWorkItem;
   PWORK_QUEUE_ITEM WorkItem;

   //
   // Call the worker routine with an initialize work item
   // to give it a chance to initialize some per thread
   // state that will passed to it for each subsequent
   // work item.
   //

   InitWorkItem.Reason = WORK_INITIALIZE_ITEM;
   (WorkQueue->WorkerRoutine)( &InitWorkItem );
   while ( TRUE )
   {
      _try {

         //
         // Wait until something is put in the queue (semaphore is
         // released), remove the item from the queue, mark it not
         // inserted, and execute the specified routine.
         //

         rc = WaitForSingleObjectEx( WorkQueue->Semaphore, INFINITE, TRUE );
         if (rc == WAIT_IO_COMPLETION)
         {
            continue;
         }

         EnterCriticalSection( &WorkQueue->CriticalSection );
         _try {
            if (WorkQueue->Terminating && IsListEmpty( &WorkQueue->Queue ))
            {
               break;
            }

            WorkItem = (PWORK_QUEUE_ITEM)RemoveHeadList( &WorkQueue->Queue );
         }
         _finally {
            LeaveCriticalSection( &WorkQueue->CriticalSection );
         }

         //
         // Execute the worker routine for this work item.
         //

         (WorkQueue->WorkerRoutine)( WorkItem );
      }
      _except( EXCEPTION_EXECUTE_HANDLER )
      {
         //
         // Ignore any exceptions from worker routine.
         //

      }
   }

   //
   // We reach this point when the terminating flag of the work queue
   // is set and work queue is empty. Call the worker routine to free
   // the search request state and set the TlsIndex of the thread to
   // NULL.
   //

   InitWorkItem.Reason = WORK_TERMINATE_ITEM;
   (WorkQueue->WorkerRoutine)( &InitWorkItem );

   //
   // Call ExitThread to deallocate its own stack and then terminate.
   //

   ExitThread( 0 );

   //
   // The state of this thread becomes signaled.
   //
}

Generated on Wed Nov 13 2024 16:55:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/AsyncIO/AsyncIO.h File Reference

  • WinBase
  • IO
  • AsyncIO
Classes | Defines | Typedefs | Functions | Variables

AsyncIO.h File Reference

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <string.h>
#include <io.h>
#include <fcntl.h>
#include <malloc.h>
#include <sys\types.h>
#include <sys\stat.h>

Go to the source code of this file.

Classes

struct | _ENUMERATE_DIRECTORY_STACK
struct | _ENUMERATE_DIRECTORY_STATE
struct | _SEARCH_REQUEST
struct | _SEARCH_REQUEST_STATE
struct | _VIRTUAL_BUFFER
struct | _WORK_QUEUE
struct | _WORK_QUEUE_ITEM

Defines

#define | ARGUMENT_PRESENT(ArgumentPointer)
#define | IN
#define | InitializeListHead(ListHead)
#define | InsertHeadList(ListHead, Entry)
#define | InsertTailList(ListHead, Entry)
#define | IsListEmpty(ListHead)
#define | MAX_DEPTH 256
#define | MAXIMUM_WORKER_THREADS 128
#define | NOTHING
#define | OPTIONAL
#define | OUT
#define | RemoveEntryList(Entry)
#define | RemoveHeadList(ListHead)
#define | ROUND_DOWN(Size, Amount) ((SIZE_T)(Size) & ~((SIZE_T)(Amount) - 1))
#define | ROUND_UP(Size, Amount) (((SIZE_T)(Size) + ((SIZE_T)(Amount) - 1)) & ~((SIZE_T)(Amount) - 1))
#define | WORK_INITIALIZE_ITEM 0
#define | WORK_ITEM 1
#define | WORK_TERMINATE_ITEM 2

Typedefs

typedef struct
_ENUMERATE_DIRECTORY_STACK 		ENUMERATE_DIRECTORY_STACK
typedef struct
_ENUMERATE_DIRECTORY_STATE 		ENUMERATE_DIRECTORY_STATE
typedef int(__cdecl * | PCOMPARE_ROUTINE )(IN const char *, IN const char *, IN size_t)
typedef VOID(* | PDIRECTORY_ENUMERATE_ROUTINE )(LPSTR Path, PWIN32_FIND_DATA FindFileData, PVOID EnumerateParameter)
typedef struct
_ENUMERATE_DIRECTORY_STACK * 		PENUMERATE_DIRECTORY_STACK
typedef struct
_ENUMERATE_DIRECTORY_STATE * 		PENUMERATE_DIRECTORY_STATE
typedef struct _SEARCH_REQUEST * | PSEARCH_REQUEST
typedef struct
_SEARCH_REQUEST_STATE * 		PSEARCH_REQUEST_STATE
typedef struct _VIRTUAL_BUFFER * | PVIRTUAL_BUFFER
typedef struct _WORK_QUEUE * | PWORK_QUEUE
typedef struct _WORK_QUEUE_ITEM * | PWORK_QUEUE_ITEM
typedef VOID(* | PWORKER_ROUTINE )()
typedef struct _SEARCH_REQUEST | SEARCH_REQUEST
typedef struct
_SEARCH_REQUEST_STATE 		SEARCH_REQUEST_STATE
typedef struct _VIRTUAL_BUFFER | VIRTUAL_BUFFER
typedef struct _WORK_QUEUE | WORK_QUEUE
typedef struct _WORK_QUEUE_ITEM | WORK_QUEUE_ITEM

Functions

BOOL | CreateVirtualBuffer (OUT PVIRTUAL_BUFFER Buffer, IN SIZE_T CommitSize, IN SIZE_T ReserveSize OPTIONAL)
PWORK_QUEUE | CreateWorkQueue (IN DWORD NumberOfWorkerThreads, IN PWORKER_ROUTINE WorkerRoutine)
VOID | DestroyWorkQueue (IN OUT PWORK_QUEUE WorkQueue)
BOOL | EnumerateDirectoryTree (LPSTR DirectoryPath, PDIRECTORY_ENUMERATE_ROUTINE EnumerateRoutine, PVOID EnumerateParameter)
BOOL | ExtendVirtualBuffer (IN PVIRTUAL_BUFFER Buffer, IN LPVOID Address)
BOOL | FreeVirtualBuffer (IN PVIRTUAL_BUFFER Buffer)
BOOL | ProcessCommandLineArguments (int argc, char *argv[])
VOID | ProcessReadFileCompletion (DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped)
VOID | ProcessRequest (IN PWORK_QUEUE_ITEM WorkItem)
VOID | ProcessSearchFile (IN PSEARCH_REQUEST WorkerRequest, IN PSEARCH_REQUEST_STATE State)
VOID | QueueSearchFile (LPSTR Path, PWIN32_FIND_DATA FindFileData, PVOID EnumerateParameter)
BOOL | QueueWorkItem (IN OUT PWORK_QUEUE WorkQueue, IN PWORK_QUEUE_ITEM WorkItem)
BOOL | TrimVirtualBuffer (IN PVIRTUAL_BUFFER Buffer)
int | VirtualBufferExceptionFilter (IN DWORD ExceptionCode, IN PEXCEPTION_POINTERS ExceptionInfo, IN OUT PVIRTUAL_BUFFER Buffer)
VOID | WorkerThread (LPVOID lpThreadParameter)

Variables

BOOL ASyncIO
LPSTR DirectoryPath
BOOL IgnoreCase
HANDLE IoCompletedEvent
BOOL MappedFileIO
DWORD MatchedFileCount
DWORD MatchedLineCount
INT | NumberOfWorkerThreads
LONG | OutstandingIOOperations
DWORD SearchedFileCount
PCOMPARE_ROUTINE SearchFunction
LPSTR SearchString
DWORD SearchStringLength
BOOL SyncIO
DWORD TlsIndex
BOOL Verbose

Define Documentation

#define ARGUMENT_PRESENT ( ArgumentPointer )
Value:
(\
    (LPSTR)(ArgumentPointer) != (LPSTR)(NULL) )

Definition at line 67 of file AsyncIO.h.

#define IN

Definition at line 59 of file AsyncIO.h.

#define InitializeListHead ( ListHead )
Value:
(\
    (ListHead)->Flink = (ListHead)->Blink = (ListHead) )

Definition at line 167 of file AsyncIO.h.

#define InsertHeadList | ( | ListHead,
 |  | Entry
 | ) |
Value:
(Entry)->Flink = (ListHead)->Flink;\
    (Entry)->Blink = (ListHead);\
    (ListHead)->Flink->Blink = (Entry);\
    (ListHead)->Flink = (Entry)

Definition at line 232 of file AsyncIO.h.

#define InsertTailList | ( | ListHead,
 |  | Entry
 | ) |
Value:
(Entry)->Flink = (ListHead);\
    (Entry)->Blink = (ListHead)->Blink;\
    (ListHead)->Blink->Flink = (Entry);\
    (ListHead)->Blink = (Entry)

Definition at line 218 of file AsyncIO.h.

#define IsListEmpty ( ListHead )
Value:
(\
    ( ((ListHead)->Flink == (ListHead)) ? TRUE : FALSE ) )

Definition at line 177 of file AsyncIO.h.

#define MAX_DEPTH 256

Definition at line 145 of file AsyncIO.h.

#define MAXIMUM_WORKER_THREADS 128

Definition at line 265 of file AsyncIO.h.

#define NOTHING

Definition at line 74 of file AsyncIO.h.

#define OPTIONAL

Definition at line 61 of file AsyncIO.h.

#define OUT

Definition at line 60 of file AsyncIO.h.

#define RemoveEntryList ( Entry )
Value:
{\
        PLIST_ENTRY _EX_Entry;\
        _EX_Entry = (Entry);\
        _EX_Entry->Blink->Flink = _EX_Entry->Flink;\
        _EX_Entry->Flink->Blink = _EX_Entry->Blink;\
        }

Definition at line 203 of file AsyncIO.h.

#define RemoveHeadList ( ListHead )
Value:
(ListHead)->Flink;\
    {\
        PLIST_ENTRY FirstEntry;\
        FirstEntry = (ListHead)->Flink;\
        FirstEntry->Flink->Blink = (ListHead);\
        (ListHead)->Flink = FirstEntry->Flink;\
    }

Definition at line 187 of file AsyncIO.h.

#define ROUND_DOWN | ( | Size,
 |  | Amount |
 | ) |  | ((SIZE_T)(Size) & ~((SIZE_T)(Amount) - 1))

Definition at line 52 of file AsyncIO.h.

#define ROUND_UP | ( | Size,
 |  | Amount |
 | ) |  | (((SIZE_T)(Size) + ((SIZE_T)(Amount) - 1)) & ~((SIZE_T)(Amount) - 1))

Definition at line 53 of file AsyncIO.h.

#define WORK_INITIALIZE_ITEM 0

Definition at line 266 of file AsyncIO.h.

#define WORK_ITEM 1

Definition at line 267 of file AsyncIO.h.

#define WORK_TERMINATE_ITEM 2

Definition at line 268 of file AsyncIO.h.

Typedef Documentation

typedef struct _ENUMERATE_DIRECTORY_STACK ENUMERATE_DIRECTORY_STACK
typedef struct _ENUMERATE_DIRECTORY_STATE ENUMERATE_DIRECTORY_STATE
typedef int(__cdecl * PCOMPARE_ROUTINE)(IN const char *, IN const char *, IN size_t)

Definition at line 367 of file AsyncIO.h.

typedef VOID(* PDIRECTORY_ENUMERATE_ROUTINE)(LPSTR Path, PWIN32_FIND_DATA FindFileData, PVOID EnumerateParameter)

Definition at line 123 of file AsyncIO.h.

typedef struct _ENUMERATE_DIRECTORY_STACK * PENUMERATE_DIRECTORY_STACK
typedef struct _ENUMERATE_DIRECTORY_STATE * PENUMERATE_DIRECTORY_STATE
typedef struct _SEARCH_REQUEST * PSEARCH_REQUEST
typedef struct _SEARCH_REQUEST_STATE * PSEARCH_REQUEST_STATE
typedef struct _VIRTUAL_BUFFER * PVIRTUAL_BUFFER
typedef struct _WORK_QUEUE * PWORK_QUEUE
typedef struct _WORK_QUEUE_ITEM * PWORK_QUEUE_ITEM
typedef VOID(* PWORKER_ROUTINE)()

Definition at line 245 of file AsyncIO.h.

typedef struct _SEARCH_REQUEST SEARCH_REQUEST
typedef struct _SEARCH_REQUEST_STATE SEARCH_REQUEST_STATE
typedef struct _VIRTUAL_BUFFER VIRTUAL_BUFFER
typedef struct _WORK_QUEUE WORK_QUEUE
typedef struct _WORK_QUEUE_ITEM WORK_QUEUE_ITEM

Function Documentation

BOOL CreateVirtualBuffer | ( | OUT PVIRTUAL_BUFFER | Buffer,
 |  | IN SIZE_T | CommitSize,
 |  | IN SIZE_T ReserveSize | OPTIONAL
 | ) |  |

Definition at line 1447 of file AsyncIO.c.

                   :

    This function is called to create a virtual buffer.  A virtual
    buffer is a contiguous range of virtual memory, where some initial
    prefix portion of the memory is committed and the remainder is only
    reserved virtual address space.  A routine is provided to extend the
    size of the committed region incrementally or to trim the size of
    the committed region back to some specified amount.

Arguments:

    Buffer - Pointer to the virtual buffer control structure that is
        filled in by this function.

    CommitSize - Size of the initial committed portion of the buffer.
        May be zero.

    ReserveSize - Amount of virtual address space to reserve for the
        buffer.  May be zero, in which case amount reserved is the
        committed size plus one, rounded up to the next 64KB boundary.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   SYSTEM_INFO SystemInformation;

   //
   // Query the page size from the system for rounding
   // our memory allocations.
   //

   GetSystemInfo( &SystemInformation );
   Buffer->PageSize = SystemInformation.dwPageSize;

   //
   // If the reserve size was not specified, default it by
   // rounding up the initial committed size to a 64KB
   // boundary.  This is because the Win32 Virtual Memory
   // API calls always allocate virtual address space on
   // 64KB boundaries, so we might well have it available
   // for commitment.
   //

   if (!ARGUMENT_PRESENT( ReserveSize ))
   {
      ReserveSize = ROUND_UP( CommitSize + 1, 0x10000 );
   }

   //
   // Attempt to reserve the address space.
   //

   Buffer->Base = VirtualAlloc( NULL,
                                ReserveSize,
                                MEM_RESERVE,
                                PAGE_READWRITE
                              );
   if (Buffer->Base == NULL)
   {
      //
      // Unable to reserve address space, return failure.
      //

      return FALSE;
   }

   //
   // Attempt to commit some initial portion of the reserved region.
   //
   //

   CommitSize = ROUND_UP( CommitSize, Buffer->PageSize );
   if (CommitSize == 0 ||
       VirtualAlloc( Buffer->Base,
                     CommitSize,
                     MEM_COMMIT,
                     PAGE_READWRITE
                   ) != NULL
      )
   {
      //
      // Either the size of the committed region was zero or the
      // commitment succeeded.  In either case calculate the
      // address of the first byte after the committed region
      // and the address of the first byte after the reserved
      // region and return successs.
      //

      Buffer->CommitLimit = (LPVOID)
                            ((char *)Buffer->Base + CommitSize);

      Buffer->ReserveLimit = (LPVOID)
                             ((char *)Buffer->Base + ReserveSize);

      return TRUE;
   }

   //
   // If unable to commit the memory, release the virtual address
   // range allocated above and return failure.
   //

   VirtualFree( Buffer->Base, 0, MEM_RELEASE );
   return FALSE;
}

PWORK_QUEUE CreateWorkQueue | ( | IN DWORD | NumberOfWorkerThreads,
 |  | IN PWORKER_ROUTINE | WorkerRoutine
 | ) |  |

Definition at line 1019 of file AsyncIO.c.

                   :

    This function creates a work queue, with the specified number of
    threads to service work items placed in the queue.  Work items
    are removed from the queue in the same order that they are placed
    in the queue.

Arguments:

    NumberOfWorkerThreads - Specifies how many threads this function
        should create to process work items placed in the queue.
        The number must be no greater than MAXIMUM_WORKER_THREAD
        and greater than 0.

    WorkerRoutine - Specifies the address of a routine to call
        for each work item as it is removed from the queue.  The
        thread context the routine is called in is undefined.

Return Value:

    A pointer to the work queue.  Returns NULL if unable to create
    the work queue and its worker threads.  Extended error information
    is available from GetLastError()

--*/

{
   PWORK_QUEUE WorkQueue;
   HANDLE Thread;
   DWORD ThreadId;
   DWORD i;

   //
   // Allocate space for the work queue, which includes an
   // array of thread handles.
   //

   WorkQueue = LocalAlloc( LMEM_ZEROINIT,
                           sizeof( *WorkQueue ) +
                           (NumberOfWorkerThreads * sizeof( HANDLE ))
                         );
   if (WorkQueue == NULL)
   {
      return NULL;
   }

   //
   // Mutual exclusion between the worker threads accessing the work
   // queue is done with a critical section. Initialize the critical
   // section and preallocate the event that will be used later by
   // EnterCriticalSection(). Set spin count to 0, so when the critical
   // section is unavailable, a calling thread will not spin before wait.
   //

   if (!InitializeCriticalSectionAndSpinCount( &WorkQueue->CriticalSection, 0))
   {
      LocalFree( WorkQueue);
      return NULL;
   }

   //
   // The work queue is controlled by a counting semaphore that
   // is incremented each time a work item is placed in the queue
   // and decremented each time a worker thread wakes up to remove
   // an item from the queue.
   //

   if (WorkQueue->Semaphore = CreateSemaphore( NULL, 0, 100000, NULL ))
   {

      //
      // The queue itself is just a doubly linked list, where
      // items are placed in the queue at the tail of the list
      // and removed from the queue from the head of the list.
      //

      InitializeListHead( &WorkQueue->Queue );

      //
      // Capture the address of the supplied worker function in
      // the work queue structure.
      //

      WorkQueue->WorkerRoutine = WorkerRoutine;

      //
      // Now create the requested number of worker threads. The
      // handle to each thread is remembered in an array of thread
      // handles in the work queue structure.
      //

      for (i=0; i<NumberOfWorkerThreads; i++)
      {
         Thread = CreateThread( NULL,
                                0,
                                (LPTHREAD_START_ROUTINE) WorkerThread,
                                WorkQueue,
                                0,
                                &ThreadId
                              );
         if (Thread == NULL)
         {
            break;
         }
         else
         {
            WorkQueue->NumberOfWorkerThreads++;
            WorkQueue->WorkerThreads[ i ] = Thread;
            SetThreadPriority( Thread, THREAD_PRIORITY_ABOVE_NORMAL );
         }
      }

      //
      // If we successfully created all of the worker threads
      // then return the address of the work queue structure
      // to indicate success.
      //

      if (i == NumberOfWorkerThreads)
      {
         return WorkQueue;
      }
   }

   //
   // Failed for some reason.  Destroy whatever we managed
   // to create and return failure to the caller.
   //

   DestroyWorkQueue( WorkQueue );
   return NULL;
}

VOID DestroyWorkQueue ( IN OUT PWORK_QUEUE WorkQueue )

Definition at line 1162 of file AsyncIO.c.

                   :

    This function first sets the terminating flag of the specified work
    queue. It then shuts down the worker threads associated with work
    queue cleanly after the threads complete processing all the work
    items in the queue and exit. After all the threads have exited, the
    function destroys `the work queue.

Arguments:

    WorkQueue - Supplies a pointer to the work queue to destroy.

Return Value:

    None.

--*/

{
   DWORD i;
   DWORD rc;

   //
   // If the semaphore handle field is not NULL, then there
   // may be threads to terminate.
   //

   if (WorkQueue->Semaphore != NULL)
   {
      //
      // Set the terminating flag in the work queue and
      // signal the counting semaphore by the number of
      // worker threads so they will all wake up and
      // notice the terminating flag and exit.
      //

      EnterCriticalSection( &WorkQueue->CriticalSection );
      _try {
         WorkQueue->Terminating = TRUE;
         ReleaseSemaphore( WorkQueue->Semaphore,
                           WorkQueue->NumberOfWorkerThreads,
                           NULL
                         );
         //
         // The count of the semaphore at this time is equal to the
         // number of work items remaining in the work queue plus
         // the number of worker threads. This ensures that all threads
         // will be awakened to run.
         //
      }
      _finally {
         LeaveCriticalSection( &WorkQueue->CriticalSection );
      }

      //
      // Wait for all worker threads to run, see that the terminating
      // flag is set, and then exit when the work queue is empty. This
      // will occur eventually unless the system malfunctions. So do
      // not timeout.
      //

      while (TRUE)
      {
         rc = WaitForMultipleObjectsEx( WorkQueue->NumberOfWorkerThreads,
                                        WorkQueue->WorkerThreads,
                                        TRUE,
                                        INFINITE,    // No timeout
                                        TRUE         // Alertable
                                      );
         if (rc == WAIT_IO_COMPLETION)
         {
            //
            // If we came out of the wait because an I/O
            // completion routine was called, reissue the
            // wait.
            //
            continue;
         }
         else
         {
            break;
         }
      }

      //
      // Now all the worker threads have terminated. Close the thread
      // handles so the thread objects will eventually be deleted by
      // the object manager.
      //

      for (i=0; i<WorkQueue->NumberOfWorkerThreads; i++)
      {
         CloseHandle( WorkQueue->WorkerThreads[ i ] );
      }

      //
      // All threads stopped, all thread handles closed.  Now
      // delete the critical section and close the semaphore
      // handle.
      //

      DeleteCriticalSection( &WorkQueue->CriticalSection );
      CloseHandle( WorkQueue->Semaphore );
   }

   //
   // Everything is done, now free the memory used by the work queue.
   //

   LocalFree( WorkQueue );
   return;
}

BOOL EnumerateDirectoryTree | ( | LPSTR | DirectoryPath,
 |  | PDIRECTORY_ENUMERATE_ROUTINE | EnumerateRoutine,
 |  | PVOID | EnumerateParameter
 | ) |  |

Definition at line 1840 of file AsyncIO.c.

                   :

    This function walks a directory tree, depth first, calling the
    passed enumeration routine for each directory and file found
    in the tree.  The enumeration routine is passed the full path
    of the file, the directory information associated with the file
    and an enumeration parameter that is uninterpreted by this
    function.

Arguments:

    DirectoryPath - Absolute or relative path to the directory that
        is the root of the tree to enumerate.

    EnumerateRoutine - Pointer to an enumeration routine to call
        for each file and directory found.

    EnumerateParameter - Uninterpreted 32-bit value that is passed
        to the EnumerationRoutine each time it is called.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   BOOL Result;
   VIRTUAL_BUFFER Buffer;
   PENUMERATE_DIRECTORY_STATE State;
   PENUMERATE_DIRECTORY_STACK Stack;
   WIN32_FIND_DATA FindFileData;

   //
   // Create a virtual buffer with an initial committed size of
   // our directory state buffer, and a maximum reserved size of
   // the longest possible full path based on the maximum depth
   // we handle and the maximum length of each path component.
   //

   if (!CreateVirtualBuffer( &Buffer,
                             (SIZE_T)  sizeof( ENUMERATE_DIRECTORY_STATE ),
               (SIZE_T)  (sizeof( ENUMERATE_DIRECTORY_STATE ) +
                    MAX_DEPTH * MAX_PATH)
                           )
      )
   {
      return FALSE;
   }

   //
   // This buffer will be used to maintain a stack of directory
   // search handles, as well as accumulate the full path string
   // as we descend the directory tree.
   //

   State = (PENUMERATE_DIRECTORY_STATE)Buffer.Base;
   State->Depth = 0;
   Stack = &State->Stack[ 0 ];

   //
   // Enter a try ... finally block so we can insure that we clean
   // up after ourselves on exit.
   //

   _try {
      //
      // First translate the passed in DirectoryPath into a fully
      // qualified path.  This path will be the initial value in
      // our path buffer.  The initial allocation of the path buffer
      // is big enough for this initial request, so does not need
      // to be guarded by a try ... except clause.
      //

      if (GetFullPathName( DirectoryPath, MAX_PATH, State->Path, &Stack->PathEnd ))
      {
         //
         // Now enter a try ... except block that will be used to
         // manage the commitment of space in the path buffer as
         // we append subdirectory names and file names to it.
         // Using the virtual buffer allows us to handle full
         // path names up to 16KB in length, with an initial
         // allocation of 4KB.
         //

         _try {
            //
            // Walk the directory tree.  The outer loop is executed
            // once for each directory in the tree.
            //

            while (TRUE)
            {
               startDirectorySearch:
               //
               // Find the end of the current path, and make sure
               // there is a trailing path separator.
               //

               Stack->PathEnd = strchr( State->Path, '\0' );
               if (Stack->PathEnd > State->Path && Stack->PathEnd[ -1 ] != '\\')
               {
                  *(Stack->PathEnd)++ = '\\';
               }

               //
               // Now append the wild card specification that will
               // let us enumerate all the entries in this directory.
               // Call FindFirstFile to find the first entry in the
               // directory.
               //

               strcpy( Stack->PathEnd, "*.*" );
               Stack->FindHandle = FindFirstFile( State->Path,
                                                  &FindFileData
                                                );
               if (Stack->FindHandle != INVALID_HANDLE_VALUE)
               {
                  //
                  // Entry found.  Now loop through the entire
                  // directory processing each entry found,
                  // including the first one.
                  //
                  do
                  {
                     //
                     // Ignore bogus pseudo-directories that are
                     // returned by some file systems (e.g. FAT).
                     //

                     if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
                         (!strcmp( FindFileData.cFileName, "." ) ||
                          !strcmp( FindFileData.cFileName, ".." )
                         )
                        )
                     {
                        continue;
                     }

                     //
                     // Copy the file name portion from the current
                     // directory entry to the last component in the
                     // path buffer.
                     //
                     // We can use strcpy here because we know that
                     // the source is a null terminated string.
                     //

                     strcpy( Stack->PathEnd, FindFileData.cFileName );

                     //
                     // Call the supplied enumeration routine with the
                     // full path we have built up in the path buffer,
                     // the directory information for this directory
                     // entry and the supplied enumeration parameter.
                     //

                     (*EnumerateRoutine)( State->Path, &FindFileData, EnumerateParameter );

                     //
                     // If this entry is a subdirectory, then it is
                     // time to recurse.  Do this by incrementing the
                     // stack pointer and depth and jumping to the top
                     // of the outer loop to process current contents
                     // of the path buffer as a fully qualified name of
                     // a directory.
                     //

                     if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
                     {
                        Stack++;
                        State->Depth++;
                        goto startDirectorySearch;
                        restartDirectorySearch:         ;
                     }

                     //
                     // Here to find the next entry in the current directory.
                     //
                  }

                  while ( FindNextFile( Stack->FindHandle, &FindFileData ) );

                  //
                  // No more entries in the current directory, so close
                  // the search handle and fall into the code that will
                  // pop our stack of directory seacrh handles.

                  FindClose( Stack->FindHandle );
               }

               //
               // Here when done with a directory.  See if we are pushed
               // inside another directory.  If not, then we are done
               // enumerating the whole tree, so break out of the loop.
               //

               if (!State->Depth)
               {
                  Result = TRUE;
                  break;
               }

               //
               // We were pushed within another directory search,
               // so pop the stack to restore its search handle
               // and path buffer position and resume the search
               // within that directory.

               State->Depth--;
               --Stack;
               goto restartDirectorySearch;
            }
         }

         //
         // Any of the code that appends to the path buffer within
         // the above try ... except clause can cause an access
         // violation if the path buffer becomes longer than its
         // current committed size.  This exception filter
         // will dynamically commit additional pages as needed
         // and resume execution.
         //

         _except( VirtualBufferExceptionFilter( GetExceptionCode(),
                                                GetExceptionInformation(),
                                                &Buffer
                                              )
                )
         {
            //
            // We will get here if the exception filter was unable to
            // commit the memory.
            //

            Result = FALSE;
         }
      }
      else
      {
         //
         // Initial GetFullPathName failed, so return a failure.
         //

         Result = FALSE;
      }
   }
   _finally {
      //
      // Here on our way out of the outer try ... finally block.
      // Make sure all our search handles have been closed and then
      // free the virtual buffer.  The only way this code is not
      // executed is if code within the try ... finally block
      // called ExitThread or ExitProcess, or an external thread
      // or process terminated this thread or process.
      //
      // In the case of process death, this is not a problem, because
      // process terminate closes all open handles attached to the process
      // and frees all private virtual memory that is part of the address
      // space of the process.
      //
      // In the case ot thread death, the code below is not executed if
      // the thread terminates via ExitThread in the context of the
      // try .. finally or if an external thread, either in this process
      // or another process called TerminateThread on this thread.
      //

      while (State->Depth--)
      {
         --Stack;
         FindClose( Stack->FindHandle );
      }

      FreeVirtualBuffer( &Buffer );
   }

   return Result;
}

BOOL ExtendVirtualBuffer | ( | IN PVIRTUAL_BUFFER | Buffer,
 |  | IN LPVOID | Address
 | ) |  |

Definition at line 1569 of file AsyncIO.c.

                   :

    This function is called to extend the committed portion of a virtual
    buffer.

Arguments:

    Buffer - Pointer to the virtual buffer control structure.

    Address - Byte at this address is committed, along with all memory
        from the beginning of the buffer to this address.  If the
        address is already within the committed portion of the virtual
        buffer, then this routine does nothing.  If the address is
        outside the reserved portion of the virtual buffer, then this
        routine returns an error.

        Otherwise enough pages are committed so that the memory from the
        base of the buffer to the passed address is a contiguous region
        of committed memory.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   SIZE_T NewCommitSize;
   LPVOID NewCommitLimit;

   //
   // See if address is within the buffer.
   //

   if (Address >= Buffer->Base && Address < Buffer->ReserveLimit)
   {
      //
      // See if the address is within the committed portion of
      // the buffer.  If so return success immediately.
      //

      if (Address < Buffer->CommitLimit)
      {
         return TRUE;
      }

      //
      // Address is within the reserved portion.  Determine how many
      // bytes are between the address and the end of the committed
      // portion of the buffer.  Round this size to a multiple of
      // the page size and this is the amount we will attempt to
      // commit.
      //

      NewCommitSize =
    ROUND_UP( (SIZE_T) Address + 1, Buffer->PageSize ) - (SIZE_T) Buffer->CommitLimit;

      //
      // Attempt to commit the memory.
      //

      NewCommitLimit = VirtualAlloc( Buffer->CommitLimit,
                                     NewCommitSize,
                                     MEM_COMMIT,
                                     PAGE_READWRITE
                                   );
      if (NewCommitLimit != NULL)
      {
         //
         // Successful, so update the upper limit of the committed
         // region of the buffer and return success.
         //

         Buffer->CommitLimit = (LPVOID)
                               ((SIZE_T)NewCommitLimit + NewCommitSize);

         return TRUE;
      }
   }

   //
   // Address is outside of the buffer, return failure.
   //

   return FALSE;
}

BOOL FreeVirtualBuffer ( IN PVIRTUAL_BUFFER Buffer )

Definition at line 1697 of file AsyncIO.c.

                   :

    This function is called to free all the memory that is associated
    with this virtual buffer.

Arguments:

    Buffer - Pointer to the virtual buffer control structure.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   //
   // Decommit and release all virtual memory associated with
   // this virtual buffer.
   //

   return VirtualFree( Buffer->Base, 0, MEM_RELEASE );
}

BOOL ProcessCommandLineArguments | ( | int | argc,
 |  | char * | argv[]
 | ) |  |

Definition at line 2130 of file AsyncIO.c.

{
   BOOL Result;
   LPSTR s;

   Result = FALSE;
   _try {
      if (argc < 1)
      {
         return Result;
      }

      while (--argc)
      {
         s = *++argv;
         if (*s == '-' || *s == '/')
         {
            while (*++s)
            {
               switch ( tolower( *s ) )
               {
               case 'm':
                  MappedFileIO = TRUE;
                  break;

               case 'a':
                  ASyncIO = TRUE;
                  break;

               case 's':
                  SyncIO = TRUE;
                  break;

               case 'v':
                  Verbose = TRUE;
                  break;

               case 'y':
                  IgnoreCase = TRUE;
                  break;

               case 't':
                  if (--argc)
                  {
                     NumberOfWorkerThreads = atoi( *++argv );
                     if (NumberOfWorkerThreads > 0)
                     {
                        if (NumberOfWorkerThreads > MAXIMUM_WORKER_THREADS)
                        {
                           NumberOfWorkerThreads = MAXIMUM_WORKER_THREADS;
                        }
                        break;
                     }
                  }

                  // fall through if -t argument missing.

               case '?':
               case 'h':
               default:
                  return Result;
               }
            }
         }
         else
            if (SearchString == NULL)
         {
            SearchString = s;
         }
         else
            if (DirectoryPath == NULL)
         {
            DirectoryPath = s;
         }
         else
         {
            return Result;
         }
      }

      if (SearchString == NULL)
      {
         return Result;
      }

      SearchStringLength = (DWORD)strlen(SearchString);
      if (SearchStringLength == 0)
      {
         return Result;
      }

      if (IgnoreCase)
      {
         SearchFunction = _strnicmp;
      }
      else
      {
         SearchFunction = strncmp;
      }

      if (DirectoryPath == NULL)
      {
         DirectoryPath = ".";
      }

      //
      // If the command line specifies neither asynchronous nor
      // synchronous I/O, use mapped file I/O.
      //

      if (!(ASyncIO || SyncIO))
      {
         MappedFileIO = TRUE;

      } else {

         MappedFileIO = FALSE;
      }

      if (Verbose)
      {
         fprintf( stderr, "Directory Tree: %s\n", DirectoryPath );
         fprintf( stderr, "Search String: '%s'\n", SearchString );
         fprintf( stderr, "Case %ssensitive\n", IgnoreCase ? "in" : "" );
         fprintf( stderr, "Number of Worker Threads: %u\n", NumberOfWorkerThreads );

         if (MappedFileIO)
         {
            fprintf( stderr, "Using Mapped File I/O\n" );
         }
         else
            if (ASyncIO)
         {
            fprintf( stderr, "Using ASynchronous File I/O\n" );
         }
         else
            if (SyncIO)
         {
            fprintf( stderr, "Using Synchronous File I/O\n" );
         }
      }

      Result = TRUE;

   }
   _finally {
      if (!Result)
      {
         fprintf( stderr, "usage: AsyncIO [-h] [-v] [-y] [-a | -s | -m] [-t n] SearchString [DirectoryPath]\n" );
         fprintf( stderr, "Where...\n" );
         fprintf( stderr, "    -h - prints this message\n" );
         fprintf( stderr, "    -v - generates verbose output\n" );
         fprintf( stderr, "    -y - ignores case when doing comparision\n" );
         fprintf( stderr, "    -t - specifies the number of threads to use (defaults to 4 * number of processors)\n" );
         fprintf( stderr, "    -a - uses asynchronous file I/O\n" );
         fprintf( stderr, "    -s - uses synchronous file I/O\n" );
         fprintf( stderr, "    -m - uses mapped file I/O (default)\n" );
         fprintf( stderr, "    SearchString - specifies the text to search for\n" );
         fprintf( stderr, "    DirectoryPath - specifies the directory to start from (defaults to .)\n" );
      }
   }

   return Result;
}

VOID ProcessReadFileCompletion | ( | DWORD | dwErrorCode,
 |  | DWORD | dwNumberOfBytesTransfered,
 |  | LPOVERLAPPED | lpOverlapped
 | ) |  |

Definition at line 785 of file AsyncIO.c.

                   :

    This function is called whenever an asynchronous read operation,
    queued by the function QueueSearchFile, completes. This function
    calulates the address of the search request block and then
    queue the request to the work queue, now that the data is
    in memory.

Arguments:

    dwErrorCode - Supplies the error code that the I/O completed with.

    dwNumberOfBytesTransfered - Supplies the actual number of bytes
        transferred.

    lpOverlapped - Supplies a pointer to the structure given to
        ReadFileEx when the I/O operation was queued.

Return Value:

    None.

--*/

{
   PSEARCH_REQUEST SearchRequest;

   //
   // Since the data we need is now in memory, queue the search
   // request to the work queue.
   //

   SearchRequest = CONTAINING_RECORD( lpOverlapped, SEARCH_REQUEST, OverlappedIO );
   QueueWorkItem( SearchRequest->WorkItem.WorkQueue, &SearchRequest->WorkItem );
}

VOID ProcessRequest ( IN PWORK_QUEUE_ITEM WorkItem )

Definition at line 563 of file AsyncIO.c.

                   :

    This function is called whenever a work item is removed from
    the work queue by one of the worker threads.  Which worker
    thread context this function is called in is arbitrary.

    This functions keeps a pointer to state information in
    thread local storage.

    This function is called once at the beginning with a
    special initialization call.  During this call, this
    function allocates space for state information and
    remembers the pointer to the state information in
    a Thread Local Storage (TLS) slot.

    This function is called once at the end with a special
    termination call.  During this call, this function
    frees the state information allocated during the
    initialization call.

    In between these two calls are zero or more calls to
    handle a work item.  The work item is a search request
    which is handled by the ProcessSearchFile function.

Arguments:

    WorkItem - Supplies a pointer to the work item just removed
        from the work queue.  It is the responsibility of this
        routine to free the memory used to hold the work item.

Return Value:

    None.

--*/

{
   DWORD BytesWritten;
   PSEARCH_REQUEST_STATE State;
   PSEARCH_REQUEST SearchRequest;
   CHAR MessageBuffer[ 2 * MAX_PATH ];

   if (WorkItem->Reason == WORK_INITIALIZE_ITEM)
   {
      //
      // First time initialization call.  Allocate space for
      // state information.
      //

      State = LocalAlloc( LMEM_ZEROINIT,
                          sizeof( *State )
                        );

      if (State != NULL)
      {
         //
         // Now create a virtual buffer, with an initial commitment
         // of zero and a maximum commitment of 128KB.  This buffer
         // will be used to accumulate the matched strings output
         // during the search of a single file.  This is so the
         // output can be written to standard output with a single
         // write call, thus insuring that it remains contiguous
         // in the output stream, and is not intermingled with the
         // output of the other worker threads.
         //

         if (CreateVirtualBuffer( &State->Buffer, (SIZE_T) 0, (SIZE_T) (2 * 64 * 1024) ))
         {
            //
            // The CurrentOutput field of the state block is
            // a pointer to where the next output goes in the
            // buffer.  It is initialized here and reset each
            // time the buffer is flushed to standard output.
            //

            State->CurrentOutput = State->Buffer.Base;
         }
         else
         {
            LocalFree( State );
            State = NULL;
         }
      }

      //
      // Remember the pointer to the state information
      // thread local storage.
      //

      TlsSetValue( TlsIndex, State );
      return;
   }

   //
   // Here to handle a work item or special terminate call.
   // Get the state pointer from thread local storage.
   //

   State = (PSEARCH_REQUEST_STATE)TlsGetValue( TlsIndex );
   if (State == NULL)
   {
      return;
   }

   //
   // If this is the special terminate work item, free the virtual
   // buffer and state block allocated above and set the thread
   // local storage value to NULL.  Return to caller.
   //

   if (WorkItem->Reason == WORK_TERMINATE_ITEM)
   {
      FreeVirtualBuffer( &State->Buffer );
      LocalFree( State );
      TlsSetValue( TlsIndex, NULL );
      return;
   }

   //
   // If not an initialize or terminate work item, then must be a
   // search request.  Calculate the address of the search request
   // block, based on the position of the WorkItem field in the
   // SEARCH_REQUEST structure.
   //

   SearchRequest = CONTAINING_RECORD( WorkItem, SEARCH_REQUEST, WorkItem );

   //
   // Actual search operation is protected by a try ... except
   // block so that any attempts to store into the virtual buffer
   // will be handled correctly by extending the virtual buffer.
   //

   _try {
      //
      // Perform the search against this file.
      //

      ProcessSearchFile( SearchRequest, State );

      //
      // Done with this file.  If asynchronous I/O is used, decrement
      // the count of outstanding I/O operations. If the count becomes
      // zero, signal the IoCompletedEvent as there are no more outstanding
      // I/O operations.
      //

      if (ASyncIO && InterlockedDecrement( &OutstandingIOOperations ) == 0)
      {
         SetEvent( IoCompletedEvent );
      }

      //
      // If any output was written to the virtual buffer, flush the
      // output to standard output.  Trim the virtual buffer back to
      // zero committed pages.
      //

      if (State->CurrentOutput > (LPSTR)State->Buffer.Base)
      {
         WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ),
                    State->Buffer.Base,
                    (DWORD)(State->CurrentOutput - (LPSTR)State->Buffer.Base),
                    &BytesWritten,
                    NULL
                  );

         TrimVirtualBuffer( &State->Buffer );
         State->CurrentOutput = (LPSTR)State->Buffer.Base;
      }
   }

   _except( VirtualBufferExceptionFilter( GetExceptionCode(),
                                          GetExceptionInformation(),
                                          &State->Buffer
                                        )
          )
   {

      //
      // We will get here if the exception filter was unable to
      // commit the memory.
      //
      // Note that FullPathName was generated by our function
      // QuerySearchFile. It points to a null terminated path
      // name.
      //

      WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ),
                 MessageBuffer,
                 sprintf( MessageBuffer,
                          "%s(0) : error 0: too many matches for file\n",
                          SearchRequest->FullPathName
                        ),
                 &BytesWritten,
                 NULL
               );
   }

   //
   // Free the storage used by the SearchRequest
   //

   LocalFree( SearchRequest );

   //
   // All done with this request.  Return to the worker thread that
   // called us.
   //

   return;
}

VOID ProcessSearchFile | ( | IN PSEARCH_REQUEST | WorkerRequest,
 |  | IN PSEARCH_REQUEST_STATE | State
 | ) |  |

Definition at line 832 of file AsyncIO.c.

                   :

    This function performs the actual search of the contents of the
    passed file for the search string given on the command line.
    If we are using synchronous I/O, then do the read operation
    now.

    Search the contents of the file for any matches, and accumulate
    the match output in the virtual buffer using sprintf, which is
    multi-thread safe, even with the single threaded version of
    the libraries.

    Note that this function is called within an exception block. Our
    function VirtualBufferExceptionFilter will be called if uncommitted
    memory is referenced. That function will either commit additional
    memory and then repeat the faulting instruction or execute the
    caller's exception handler, depending whether additional pages
    can be committed. Therefore, sprintf can be safely used here.

Arguments:

    SearchRequest - Supplies a pointer to the search request which
        contains the relevant information.

    State - Supplies a pointer to state information for the current
        thread.

Return Value:

    None.

--*/

{
   LPSTR FileData, s, s1, BegLine, EndLine, EndOfFile;
   DWORD LineNumber;
   DWORD MatchesFound;
   DWORD BytesRead;

   // Get a pointer to the beginning of the file data in memory
   // and calculate the address of the end of file point in
   // memory.
   //

   FileData = SearchRequest->FileData;
   EndOfFile = FileData + SearchRequest->FileSize;

   //
   // If synchronous I/O is used, then we have not read in the
   // file contents yet, so issue the synchronous read to get
   // the data into memory.
   //

   if (SyncIO)
   {
      if (!ReadFile( SearchRequest->File,
                     FileData,
                     SearchRequest->FileSize,
                     &BytesRead,
                     NULL
                   ) ||
          BytesRead != SearchRequest->FileSize
         )
      {

         State->CurrentOutput += sprintf( State->CurrentOutput,
                                          "%s(0) : error %u: Unable to read file contents.\n",
                                          SearchRequest->FullPathName,
                                          GetLastError()
                                        );

         CloseHandle( SearchRequest->File );
         return;
      }
   }

   //
   // Close any open file handle associated with this request.
   //

   if (SearchRequest->File != NULL)
   {
      CloseHandle( SearchRequest->File );
   }

   //
   // Search the file contents, keeping track of line breaks
   // so we can tell the line number of each match.
   //

   s = FileData;
   LineNumber = 0;
   MatchesFound = 0;
   while (s < EndOfFile)
   {
      BegLine = s;
      while (s < EndOfFile && *s != '\n')
      {
         s++;
      }

      if (*s == '\n')
      {
         LineNumber += 1;
         EndLine = s - 1;
         if (EndLine > BegLine && EndLine[ -1 ] == '\r')
         {
            EndLine -= 1;
         }

         s1 = BegLine;
         while (s1 < (EndLine - SearchStringLength))
         {
            if (!(SearchFunction)( s1, SearchString, SearchStringLength ))
            {
               //
               // We have a match for this line.  Append the
               // output to the virtual buffer and update the
               // current output pointer.
               //

               State->CurrentOutput += sprintf( State->CurrentOutput,
                                                "%s(%u) : %.*s\n",
                                                SearchRequest->FullPathName,
                                                LineNumber,
                                                EndLine - BegLine,
                                                BegLine
                                              );
               MatchesFound += 1;
               break;
            }

            s1++;
         }

         s++;
      }
   }

   if (MatchesFound)
   {

      //
      // Increment the global variables that summarize the result
      // of the search. Since these variables may be incremented
      // by multiple worker threads, use atomic add and increment.
      //

      InterlockedExchangeAdd( &MatchedLineCount, MatchesFound );
      InterlockedIncrement( &MatchedFileCount );
   }
   InterlockedIncrement( &SearchedFileCount );

   //
   // All done with the file contents.  Discard it either by
   // unmapping the view of the file in the case of mapped file
   // I/O or free the virtual memory for other types of I/O
   //

   if (MappedFileIO)
   {
      if (!UnmapViewOfFile( FileData ))
      {
         State->CurrentOutput += sprintf( State->CurrentOutput,
                                          "%s(%u) : UnmapViewOfFile( %p ) failed, error == %u\n",
                                          SearchRequest->FullPathName,
                                          LineNumber,
                                          FileData,
                                          GetLastError()
                                        );
      }
   }
   else
   {
      VirtualFree( FileData, 0, MEM_RELEASE );
   }
}

VOID QueueSearchFile | ( | LPSTR | Path,
 |  | PWIN32_FIND_DATA | FindFileData,
 |  | PVOID | EnumerateParameter
 | ) |  |

Definition at line 260 of file AsyncIO.c.

                   :

    This is the directory enumeration function.  It is called by the
    EnumerateDirectoryTree function once for each file and directory
    in the tree.

    This function, if it decides it wants to search the file, will
    open the file and then, depending upon the I/O method selected via
    the command line, will:

        - map the file PAGE_READONLY for mapped file I/O,

        - read the file into an allocated buffer for synchronous
          I/O, or

        - for asynchronous I/O, allocate a buffer and start a read
          operation to read the entire file into the buffer.  A
          completion routine will be invoked when the read completes,
          possibly in another thread context.

    Finally it will queue a search request to the work queue, with the
    relevant information contained in the request.  For asynchronous
    I/O, the search request is allocated and initialized here but is
    not actually queued to the work queue until the I/O completion
    routine has been called.

Arguments:

    Path - Supplies a pointer to a null terminated string that contains
        the fully qualified path of the file or directory.

    FindFileData - Supplies the directory information associated
        with the file or directory specified by the Path argument.

    EnumerateParameter - Uninterpreted 32-bit value.

Return Value:

    None.

--*/

{
   PWORK_QUEUE WorkQueue = (PWORK_QUEUE)EnumerateParameter;
   PSEARCH_REQUEST SearchRequest;
   HANDLE File;
   HANDLE Mapping;
   LPVOID FileData;
   DWORD FileSize;
   SIZE_T PathLength;

   //
   // Ignore directories or zero length files, as there
   // is nothing to search in these cases.
   //

   if ((FindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
       !(FileSize = FindFileData->nFileSizeLow)
      )
   {
      return;
   }

   //
   // Open the file using the fully qualified path.  Specify the
   // sequential scan hint to the cache manager and GENERIC_READ
   // access to the file. If asynchronous I/O is used, specify
   // file overlapped flag.
   //

   File = CreateFile( Path,
                      GENERIC_READ,
                      FILE_SHARE_READ,
                      NULL,
                      OPEN_EXISTING,
                      FILE_FLAG_SEQUENTIAL_SCAN |
                      (ASyncIO ? FILE_FLAG_OVERLAPPED : 0),
                      NULL
                    );

   //
   // Since NULL might be a valid file object handle, failure
   // is indicated by a special return value.
   //

   if (File == INVALID_HANDLE_VALUE)
   {
      fprintf( stderr, "%s(0) : error %u: Unable to open file.\n",
               Path,
               GetLastError()
             );

      return;
   }

   //
   // File successfully opened for read access.
   //

   if (MappedFileIO)
   {
      //
      // If mapped file I/O, create a file mapping object, backed by
      // the file we just opened.  Make the default page protection
      // for the mapping be read only.
      //

      Mapping = CreateFileMapping( File,
                                   NULL,
                                   PAGE_READONLY,
                                   0,
                                   0,
                                   NULL
                                 );

      //
      // Okay to close the file handle now, since the mapping object
      // has a reference to the file that will cause the open file
      // object to remain until the reference is destroyed. Note that
      // any sharing information is lost at this point, so somebody
      // could come in and open it for write access.
      //

      CloseHandle( File );

      //
      // Here, a null value indicates an error.
      //

      if (Mapping == NULL)
      {
         fprintf( stderr, "%s(0) : error %u: Unable to create mapping object.\n",
                  Path,
                  GetLastError()
                );
         return;
      }

      //
      // Finally, map a view of the file, using the mapping object
      // just created, into the address space of this process.
      // The offset and size are zero, which means to map the
      // entire file.
      //

      FileData = MapViewOfFile( Mapping,
                                FILE_MAP_READ,
                                0,
                                0,
                                0
                              );

      //
      // Okay to close the mapping object handle now, it will remained
      // referenced as long as the view remains mapped.
      //

      CloseHandle( Mapping );

      //
      // A null value indicates the map operation failed.
      //

      if (FileData == NULL)
      {
         fprintf( stderr, "%s(0) : error %u: Unable to map file.\n",
                  Path,
                  GetLastError()
                );
         return;
      }

      //
      // All done mapping the file.  Set the File handle to NULL as
      // it has been closed already.  Both the file object and mapping
      // objects created above will be freed when the map view is
      // unmapped.
      //

      File = NULL;
   }
   else
   {
      //
      // Mapped I/O will not be used. So allocate a buffer big enough
      // to contain the entire file.
      //

      FileData = VirtualAlloc( NULL,
                               FileSize,
                               MEM_COMMIT,
                               PAGE_READWRITE
                             );
      if (FileData == NULL)
      {
         fprintf( stderr, "%s(0) : error %u: Unable to allocate memory to contain file.\n",
                  Path,
                  GetLastError()
                );
         CloseHandle( File );
         return;
      }
   }

   //
   // Note that Path points to a null terminated string produced
   // by our function EnumerateDirectoryTree. We can find the
   // length of the string safely using strlen.
   //

   PathLength = strlen( Path );

   //
   // We have successfully opened the file and are ready to go.
   // Allocate space for a search request and fill it in with
   // the information needed by the ProcessSearchFile function
   // when it runs.
   //
   // The space for SearchRequest->FullNameName[0] is provided
   // within SearchRequest. An additional space of PathLength
   // characters suffices for Path and null termination.
   //

   SearchRequest = LocalAlloc( LMEM_ZEROINIT,
                               sizeof( *SearchRequest ) + PathLength
                             );
   if (SearchRequest == NULL)
   {
      fprintf( stderr, "AsyncIO: Out of memory\n" );
      exit( 1 );
   }

   SearchRequest->WorkItem.Reason = WORK_ITEM;
   SearchRequest->File = File;
   SearchRequest->FileSize = FileSize;
   SearchRequest->FileData = FileData;
   strncpy( SearchRequest->FullPathName, Path, PathLength );
   SearchRequest->FullPathName[ PathLength ] = '\0';

   if (!ASyncIO)
   {

      //
      // Asynchronous I/O is not used. Queue the search
      // request to the work queue.
      //

      QueueWorkItem( WorkQueue, &SearchRequest->WorkItem );
   }
   else
   {
      //
      // Asynchronous I/O is used. Queue the read operation.
      // The file handle must remain open while the read
      // operation is pending.
      //

      if (!ReadFileEx( File,
                       FileData,
                       FileSize,
                       &SearchRequest->OverlappedIO,
                       (LPOVERLAPPED_COMPLETION_ROUTINE) ProcessReadFileCompletion
                     )
         )
      {
         fprintf( stderr, "%s(0) : error %u: Unable to queue read of file.\n",
                  Path,
                  GetLastError()
                );

         VirtualFree( FileData, 0, MEM_RELEASE );
         CloseHandle( File );
         LocalFree( SearchRequest );
         return;
      }

      //
      // Successfully queued the read operation.  Keep a count
      // of outstanding read operations so we know when it is
      // okay to terminate.
      //

      OutstandingIOOperations += 1;
   }

   //
   // Return back to the EnumerateDirectoryTree function so that it
   // can call us with the next file or directrry.
   //

   return;
}

BOOL QueueWorkItem | ( | IN OUT PWORK_QUEUE | WorkQueue,
 |  | IN PWORK_QUEUE_ITEM | WorkItem
 | ) |  |

Definition at line 1284 of file AsyncIO.c.

                   :

    This function queues a work item to the passed work queue that is
    processed by one of the worker threads associated with the queue.

Arguments:

    WorkQueue - Supplies a pointer to the work queue that is to
        receive the work item.

    WorkItem - Supplies a pointer to the work item to add to the queue.
        The work item structure contains a doubly linked list entry, the
        address of a routine to call and a parameter to pass to that
        routine.  It is the routine's responsibility to reclaim the
        storage occupied by the WorkItem structure.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   BOOL Result;

   //
   // Acquire the work queue critical section and insert the work item
   // in the queue and release the semaphore if the work item is not
   // already in the list.
   //

   EnterCriticalSection( &WorkQueue->CriticalSection );
   Result = TRUE;
   _try {
      WorkItem->WorkQueue = WorkQueue;
      InsertTailList( &WorkQueue->Queue, &WorkItem->List );
      Result = ReleaseSemaphore( WorkQueue->Semaphore, 1, NULL );
   }
   _finally {
      LeaveCriticalSection( &WorkQueue->CriticalSection );
   }

   return Result;
}

BOOL TrimVirtualBuffer ( IN PVIRTUAL_BUFFER Buffer )

Definition at line 1667 of file AsyncIO.c.

                   :

    This function is called to decommit any memory that has been
    committed for this virtual buffer.

Arguments:

    Buffer - Pointer to the virtual buffer control structure.

Return Value:

    TRUE if operation was successful.  Otherwise returns FALSE and
    extended error information is available from GetLastError()

--*/

{
   Buffer->CommitLimit = Buffer->Base;
   return VirtualFree( Buffer->Base, 0, MEM_DECOMMIT );
}

int VirtualBufferExceptionFilter | ( | IN DWORD | ExceptionCode,
 |  | IN PEXCEPTION_POINTERS | ExceptionInfo,
 |  | IN OUT PVIRTUAL_BUFFER | Buffer
 | ) |  |

Definition at line 1730 of file AsyncIO.c.

                   :

    This function is an exception filter that handles exceptions that
    referenced uncommitted but reserved memory contained in the passed
    virtual buffer.  It this filter routine is able to commit the
    additional pages needed to allow the memory reference to succeed,
    then it will re-execute the faulting instruction.  If it is unable
    to commit the pages, it will execute the callers exception handler.

    If the exception is not an access violation or is an access
    violation but does not reference memory contained in the reserved
    portion of the virtual buffer, then this filter passes the exception
    on up the exception chain.

Arguments:

    ExceptionCode - Reason for the exception.

    ExceptionInfo - Information about the exception and the context
        that it occurred in.

    Buffer - Points to a virtual buffer control structure that defines
        the reserved memory region that is to be committed whenever an
        attempt is made to access it.

Return Value:

    Exception disposition code that tells the exception dispatcher what
    to do with this exception.  One of three values is returned:

        EXCEPTION_EXECUTE_HANDLER - execute the exception handler
            associated with the exception clause that called this filter
            procedure.

        EXCEPTION_CONTINUE_SEARCH - Continue searching for an exception
            handler to handle this exception.

        EXCEPTION_CONTINUE_EXECUTION - Dismiss this exception and return
            control to the instruction that caused the exception.

--*/

{
   LPVOID FaultingAddress;

   //
   // If this is an access violation touching memory within
   // our reserved buffer, but outside of the committed portion
   // of the buffer, then we are going to take this exception.
   //

   if (ExceptionCode == STATUS_ACCESS_VIOLATION)
   {
      //
      // Get the virtual address that caused the access violation
      // from the exception record.  Determine if the address
      // references memory within the reserved but uncommitted
      // portion of the virtual buffer.
      //

      FaultingAddress = (LPVOID)ExceptionInfo->ExceptionRecord->ExceptionInformation[ 1 ];
      if (FaultingAddress >= Buffer->CommitLimit &&
          FaultingAddress <= Buffer->ReserveLimit
         )
      {
         //
         // This is our exception.  Try to extend the buffer
         // to including the faulting address.
         //

         if (ExtendVirtualBuffer( Buffer, FaultingAddress ))
         {
            //
            // Buffer successfully extended, so re-execute the
            // faulting instruction.
            //

            return EXCEPTION_CONTINUE_EXECUTION;
         }
         else
         {
            //
            // Unable to extend the buffer.  Stop searching
            // for exception handlers and execute the caller's
            // handler.
            //

            return EXCEPTION_EXECUTE_HANDLER;
         }
      }
   }

   //
   // Not an exception we care about, so pass it up the chain.
   //

   return EXCEPTION_CONTINUE_SEARCH;
}

VOID WorkerThread ( LPVOID lpThreadParameter )

Definition at line 2541 of file Handler.Cpp.

{
MSG msg;
HRESULT hr;
HRESULT hrCoInitialize;
WorkerThreadArgs *pThreadArgs = (WorkerThreadArgs *) lpArg;
HWND hwndWorker;

   pThreadArgs->hr = NOERROR;

   hrCoInitialize = CoInitialize(NULL);

   // need to do a PeekMessage and then set an event to make sure
   // a message loop is created before the first PostMessage is sent.

   PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);

   // initialize the dialog box before returning to main thread.
   if (FAILED(hrCoInitialize) )
   {
    pThreadArgs->hr = E_OUTOFMEMORY;
   }
   else
   {

    hwndWorker = CreateWindowEx(0,
              SZ_SAMPLESYNCMGRWORKERWNDCLASS,
              TEXT(""),
              // must use WS_POPUP so the window does not get
              // assigned a hot key by user.
              (WS_DISABLED | WS_POPUP),
              CW_USEDEFAULT,
              CW_USEDEFAULT,
              CW_USEDEFAULT,
              CW_USEDEFAULT,
              NULL,
              NULL,
              g_hmodThisDll,
              pThreadArgs->pThis);

        pThreadArgs->hwnd = hwndWorker;
    pThreadArgs->hr =  hwndWorker ? NOERROR : E_UNEXPECTED;
    }

   hr = pThreadArgs->hr;

   // let the caller know the thread is done initializing.
   if (pThreadArgs->hEvent)
     SetEvent(pThreadArgs->hEvent);

   if (NOERROR == hr)
   {
       // sit in loop receiving messages.
       while (GetMessage(&msg, NULL, 0, 0))
       {
         TranslateMessage(&msg);
         DispatchMessage(&msg);
    }
   }

   if (SUCCEEDED(hrCoInitialize))
       CoUninitialize();

   return 0;
}

Variable Documentation

BOOL ASyncIO

Definition at line 354 of file AsyncIO.h.

LPSTR DirectoryPath

Definition at line 356 of file AsyncIO.h.

BOOL IgnoreCase

Definition at line 352 of file AsyncIO.h.

HANDLE IoCompletedEvent

Definition at line 363 of file AsyncIO.h.

BOOL MappedFileIO

Definition at line 353 of file AsyncIO.h.

DWORD MatchedFileCount

Definition at line 360 of file AsyncIO.h.

DWORD MatchedLineCount

Definition at line 361 of file AsyncIO.h.

INT NumberOfWorkerThreads

Definition at line 350 of file AsyncIO.h.

LONG OutstandingIOOperations

Definition at line 362 of file AsyncIO.h.

DWORD SearchedFileCount

Definition at line 359 of file AsyncIO.h.

PCOMPARE_ROUTINE SearchFunction

Definition at line 373 of file AsyncIO.h.

LPSTR SearchString

Definition at line 357 of file AsyncIO.h.

DWORD SearchStringLength

Definition at line 358 of file AsyncIO.h.

BOOL SyncIO

Definition at line 355 of file AsyncIO.h.

DWORD TlsIndex

Definition at line 349 of file AsyncIO.h.

BOOL Verbose

Definition at line 351 of file AsyncIO.h.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/Commands.Cpp File Reference

  • WinBase
  • IO
  • DiskQuota
Defines | Functions

Commands.Cpp File Reference

#include <windows.h>
#include <stdio.h>
#include <dskquota.h>
#include "Commands.h"

Go to the source code of this file.

Defines

#define | WIN32_LEAN_AND_MEAN

Functions

BOOL | AddUser (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | DeleteUser (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | EnumerateUserQuotas (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | EnumerateUsers (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetDefaultHardLimit (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetDefaultQuota (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetDefaultThreshold (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetQuotaLogFlags (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetUserQuotaInfo (IDiskQuotaControl *lpDiskQuotaControl)
void | LfcrToNull (LPWSTR szString)
void | PrintError (HRESULT hr)
BOOL | SetDefaultHardLimit (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | SetDefaultThreshold (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | SetUserHardLimit (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | SetUserThreshold (IDiskQuotaControl *lpDiskQuotaControl)

Define Documentation

#define WIN32_LEAN_AND_MEAN

Definition at line 16 of file Commands.Cpp.

Function Documentation

BOOL AddUser ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 538 of file Commands.Cpp.

{
    HRESULT  hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR    szUser[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user (ie. DOMAIN\\USERNAME): ");

    // Get the user for which to track quota information
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szUser);

    // Add the user
    hr = lpDiskQuotaControl->AddUserName(szUser,
                                DISKQUOTA_USERNAME_RESOLVE_SYNC,
                                &lpDiskQuotaUser);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }
    lpDiskQuotaUser->Release();

    return TRUE;
}

BOOL DeleteUser ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 579 of file Commands.Cpp.

{
    HRESULT         hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR           szUser[MAX_PATH] = {0};
    DWORD           dwCharsRead;
    HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user (ie. DOMAIN\\USERNAME): ");

    // Get the user for which to track quota information
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);

    if (SUCCEEDED(hr))
    {
        // Delete the user
        hr = lpDiskQuotaControl->DeleteUser(lpDiskQuotaUser);

        if (FAILED(hr))
        {
            wprintf(L"\nCould not delete the user.");
        }

        lpDiskQuotaUser->Release();
    }
    else
    {
        PrintError(hr);
    }

    return SUCCEEDED(hr);
}

BOOL EnumerateUserQuotas ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 681 of file Commands.Cpp.

{
    HRESULT              hr;
    IEnumDiskQuotaUsers* lpEnumDiskQuotaUsers;

    // Create an enumerator object to enumerate quota users on the volume.
    hr = lpDiskQuotaControl->CreateEnumUsers(NULL, 0,
                                             DISKQUOTA_USERNAME_RESOLVE_SYNC,
                                             &lpEnumDiskQuotaUsers);
    if (SUCCEEDED(hr))
    {
        IDiskQuotaUser*      lpDiskQuotaUser;
        DWORD                dwUsersFetched;
        WCHAR                szLogonName[MAX_PATH];
        WCHAR                szQuotaUsedText[MAX_PATH];
        WCHAR                szQuotaLimitText[MAX_PATH];
        WCHAR                szQuotaThresholdText[MAX_PATH];
        DISKQUOTA_USER_INFORMATION dqUserInfo;

        wprintf(L"\n\nStatus               Logon Name  ");
        wprintf(L"Amount Used        Limit    Threshold\n");
        wprintf(L"------               ----------  ");
        wprintf(L"-----------        -----    ---------\n");

        // Enumerate through all of the quota users
        while(SUCCEEDED(hr) &&
              S_OK == lpEnumDiskQuotaUsers->
                        Next(1, &lpDiskQuotaUser, &dwUsersFetched))
        {
            if (SUCCEEDED(hr = lpDiskQuotaUser->
                    GetName(NULL, 0, szLogonName, MAX_PATH, NULL, 0))      &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaThresholdText(szQuotaThresholdText, MAX_PATH)) &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaLimitText(szQuotaLimitText, MAX_PATH))         &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaUsedText(szQuotaUsedText, MAX_PATH))           &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaInformation((LPVOID)&dqUserInfo,
                        sizeof(DISKQUOTA_USER_INFORMATION))))
            {
                szLogonName[MAX_PATH - 1] = L'\0'; // Make sure szLogonName is NULL terminated
                szQuotaUsedText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaUsedText is NULL terminated
                szQuotaLimitText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaLimitText is NULL terminated
                szQuotaThresholdText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaThresholdText is NULL terminated

                // Check if the user is exceeding their threshold
                if ((dqUserInfo.QuotaUsed > dqUserInfo.QuotaThreshold) &&
                    (dqUserInfo.QuotaThreshold >= 0))
                {
                    wprintf(L"Warning ");
                }
                else
                {
                    wprintf(L"OK      ");
                }

                wprintf(L"%23s", szLogonName);
                wprintf(L"   %10s", szQuotaUsedText);
                wprintf(L"   %10s", szQuotaLimitText);
                wprintf(L"   %10s", szQuotaThresholdText);
                wprintf(L"\n");
            }
            else
            {
                szLogonName[MAX_PATH - 1] = L'\0'; // Make sure szLogonName is NULL terminated

                wprintf(L"Could not retrieve %s's quota information\n",
                         szLogonName);
            }
            lpDiskQuotaUser->Release();
        }
        lpEnumDiskQuotaUsers->Release();
    }
    else
    {
        PrintError(hr);
    }

    WaitForKeyPress();

    return SUCCEEDED(hr);
}

BOOL EnumerateUsers ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 628 of file Commands.Cpp.

{
    HRESULT              hr;
    IEnumDiskQuotaUsers* lpEnumDiskQuotaUsers;
    IDiskQuotaUser*      lpDiskQuotaUser;
    DWORD                dwUsersFetched;

    // Create an enumerator object to enumerate quota users on the volume.
    hr = lpDiskQuotaControl->CreateEnumUsers(NULL, 0,
                                             DISKQUOTA_USERNAME_RESOLVE_SYNC,
                                             &lpEnumDiskQuotaUsers);
    if (SUCCEEDED(hr))
    {
        WCHAR szLogonName[MAX_PATH];

        wprintf(L"\n\nLogon name\n");
        wprintf(L"----------\n");

        // Enumerate through all of the quota users
        while(SUCCEEDED(hr) &&
              S_OK == lpEnumDiskQuotaUsers->
                      Next(1, &lpDiskQuotaUser, &dwUsersFetched))
        {
            // Retrieve the name strings associated with this disk quota user.
            if (SUCCEEDED(hr = lpDiskQuotaUser->GetName(NULL, 0, szLogonName,
                                                        MAX_PATH, NULL, 0)))
            {
                szLogonName[MAX_PATH-1] = L'\0'; // make sure szLogonName is NULL terminated
                wprintf(L"%s\n", szLogonName);
                lpDiskQuotaUser->Release();
            }
        }
        lpEnumDiskQuotaUsers->Release();
    }

    if (FAILED(hr)) PrintError(hr);
    WaitForKeyPress();

    return SUCCEEDED(hr);
}

BOOL GetDefaultHardLimit ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 163 of file Commands.Cpp.

{
    HRESULT hr;
    WCHAR   szDefaultHardLimitText[MAX_PATH];

    // Get the default hard quota limit in text format
    hr = lpDiskQuotaControl->
        GetDefaultQuotaLimitText(szDefaultHardLimitText, MAX_PATH);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    szDefaultHardLimitText[MAX_PATH - 1] = L'\0'; // Make sure szDefaultHardLimitText is NULL terminated

    wprintf(L"\n\nDefault Quota Hard Limit: %s\n", szDefaultHardLimitText);

    WaitForKeyPress();

    return TRUE;
}

BOOL GetDefaultQuota ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 37 of file Commands.Cpp.

{
    HRESULT hr;
    DWORD   dwState;

    // Get the default quota state
    hr = lpDiskQuotaControl->GetQuotaState(&dwState);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    wprintf(L"\n\nDefault Disk Quota State:\n");

    // Switch on the state of disk quota tracking
    switch(dwState & DISKQUOTA_STATE_MASK)
    {
    case DISKQUOTA_STATE_DISABLED:
        wprintf(L"Quota's are not enabled on the volume.\n");
        break;
    case DISKQUOTA_STATE_TRACK:
        wprintf(L"Quotas are enabled but the limit value is not being ");
        wprintf(L"enforced.\nUsers may exceed their quota limit.\n");
        break;
    case DISKQUOTA_STATE_ENFORCE:
        wprintf(L"Quotas are enabled and the limit value is enforced.");
        wprintf(L"\nUsers cannot exceed their quota limit.\n");
        break;
    default:
        wprintf(L"Unknown.\n");
        break;
    }

    wprintf(L"\nDefault Disk Quota File State:\n");

    switch(dwState & DISKQUOTA_FILESTATE_MASK)
    {
    case DISKQUOTA_FILESTATE_INCOMPLETE:
        wprintf(L"The volume's quota information is out of date.\n");
        wprintf(L"Quotas are probably disabled.\n");
        break;
    case DISKQUOTA_FILESTATE_REBUILDING:
        wprintf(L"The volume is rebuilding its quota information.\n");
        break;
    default:
        wprintf(L"Unknown.\n");
        break;
    }

    WaitForKeyPress();

    return TRUE;
}

BOOL GetDefaultThreshold ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 199 of file Commands.Cpp.

{
    HRESULT hr;
    WCHAR   szDefaultThresholdText[MAX_PATH];

    // Get the default threshold
    hr = lpDiskQuotaControl->
        GetDefaultQuotaThresholdText(szDefaultThresholdText, MAX_PATH);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    szDefaultThresholdText[MAX_PATH - 1] = L'\0'; // Make sure szDefaultThresholdText is NULL terminated

    wprintf(L"\n\nDefault Quota Threshold: %s\n", szDefaultThresholdText);

    WaitForKeyPress();

    return TRUE;
}

BOOL GetQuotaLogFlags ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 105 of file Commands.Cpp.

{
    HRESULT hr;
    DWORD   dwQuotaLogFlags;

    // Get the state log the quota log flags
    hr = lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    wprintf(L"\n\nDisk Quota Log State:\n");

    // Check if the system creates a log entry when a threshold limit
    // is exceeded
    if (DISKQUOTA_IS_LOGGED_USER_THRESHOLD(dwQuotaLogFlags))
    {
        wprintf(L"\nAn event log entry will be created when the user");
        wprintf(L"\nexceeds his assigned warning threshold.\n");
    }
    else
    {
        wprintf(L"\nAn event log entry will NOT be created when the");
        wprintf(L"\nuser exceeds his assigned warning threshold.\n");
    }

    // Check if the system creates a log entry when a hard limit
    // is exceeded
    if (DISKQUOTA_IS_LOGGED_USER_LIMIT(dwQuotaLogFlags))
    {
        wprintf(L"\nAn event log entry will be created when the user");
        wprintf(L"\nexceeds his assigned hard quota limit.\n");
    }
    else
    {
        wprintf(L"\nAn event log entry will NOT be created when the");
        wprintf(L"\nuser exceeds his assigned hard quota limit.\n");
    }
    WaitForKeyPress();

    return TRUE;
}

BOOL GetUserQuotaInfo ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 467 of file Commands.Cpp.

{
    WCHAR    szUser[MAX_PATH] = {0};
    IDiskQuotaUser* lpDiskQuotaUser;
    DWORD    dwCharsRead;
    HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);
    HRESULT  hr;

    wprintf(L"\n\nEnter the logon name of the user");
    wprintf(L"(ie. DOMAIN\\USERNAME): ");

    // Get the user for which to get quota information
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    szUser[MAX_PATH-1] = L'\0'; // make sure szUser is NULL terminated
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);
    if (SUCCEEDED(hr))
    {
        WCHAR    szQuotaUsedText[MAX_PATH] = {0};
        WCHAR    szQuotaLimitText[MAX_PATH] = {0};
        WCHAR    szQuotaThresholdText[MAX_PATH] = {0};

        if (SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaThresholdText(
                                    szQuotaThresholdText, MAX_PATH))         &&
            SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaLimitText(
                                    szQuotaLimitText, MAX_PATH))             &&
            SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaUsedText(
                                    szQuotaUsedText, MAX_PATH)))
        {
            szQuotaUsedText[MAX_PATH-1] = L'\0'; // make sure szQuotaUsedText is NULL terminated
            szQuotaLimitText[MAX_PATH-1] = L'\0'; // make sure szQuotaLimitText is NULL terminated
            szQuotaThresholdText[MAX_PATH-1] = L'\0'; // make sure szQuotaThresholdText is NULL terminated

            wprintf(L"Amount Used        Limit    Threshold\n");
            wprintf(L"-----------        -----    ---------\n");
            wprintf(L"   %10s", szQuotaUsedText);
            wprintf(L"   %10s", szQuotaLimitText);
            wprintf(L"   %10s", szQuotaThresholdText);
            wprintf(L"\n");
        }
        else
        {
            wprintf(L"\nCould not get the quota information for %s", szUser);
        }

        lpDiskQuotaUser->Release();
    }
    else
    {
        wprintf(L"\nCould not find quota data for %s\n", szUser);
    }

    WaitForKeyPress();

    return SUCCEEDED(hr);
}

void LfcrToNull ( LPWSTR szString )

Definition at line 813 of file Commands.Cpp.

{
    WCHAR* szLfcr;

    szLfcr = wcsstr(szString, L"\r\n");

    if (szLfcr) *szLfcr = L'\0';
}

void PrintError ( HRESULT hr )

Definition at line 775 of file Commands.Cpp.

{
    LPVOID lpMsgBuf;

    // Format the error message
    if (!FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                  FORMAT_MESSAGE_FROM_SYSTEM     |
                  FORMAT_MESSAGE_IGNORE_INSERTS,
                  NULL,
                  hr,
                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Defaut lang
                  (LPWSTR) &lpMsgBuf,
                  0,
                  NULL ))
    {
        wprintf(L"Unknown error occured\n");
        return;
    }

    // Display the string
    wprintf(L"\n%s", (LPCWSTR)lpMsgBuf);

    // Free the buffer
    LocalFree( lpMsgBuf );

    WaitForKeyPress();
}

BOOL SetDefaultHardLimit ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 235 of file Commands.Cpp.

{
    HRESULT  hr;
    DWORD    dwCharsRead;
    LONGLONG llLimit = 0;
    WCHAR    szLimit[MAX_PATH] = {0};
    HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the new default hard limit in Bytes ");
    wprintf(L"(-1 == No Limit): ");

    // Get the limit from the command prompt
    ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szLimit);
    llLimit = _wtoi64(szLimit);

    if (llLimit < -1)
    {
        wprintf(L"\nInvalid limit!");
        return FALSE;
    }

    // Set the default hard quota limit
    hr = lpDiskQuotaControl->SetDefaultQuotaLimit(llLimit);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    return TRUE;
}

BOOL SetDefaultThreshold ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 281 of file Commands.Cpp.

{
    HRESULT  hr;
    LONGLONG llLimit = 0;
    WCHAR    szLimit[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the new default threshold in Bytes ");
    wprintf(L"(-1 == No Limit): ");

    // Get the limit from the command prompt
    ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szLimit);
    llLimit = _wtoi64(szLimit);

    if (llLimit < -1)
    {
        wprintf(L"\nInvalid limit!");
        return FALSE;
    }

    // Set the default warning threshold
    hr = lpDiskQuotaControl->SetDefaultQuotaThreshold(llLimit);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    return TRUE;
}

BOOL SetUserHardLimit ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 327 of file Commands.Cpp.

{
    HRESULT  hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR    szUser[MAX_PATH] = {0};
    WCHAR    szLimit[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    LONGLONG llLimit = 0;
    HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user ");
    wprintf(L"(ie. DOMAIN\\USERNAME): ");

    // Get the user for which to set a hard limit
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    szUser[MAX_PATH-1] = L'\0'; // make sure szUSer is NULL terminated

    // Strip the line feed and carriage return
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);

    if (SUCCEEDED(hr))
    {
        wprintf(L"\nEnter the new hard limit in bytes (-1 == No Limit): ");

        // Read the new hard limit from the console
        ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
        LfcrToNull(szLimit);
        llLimit = _wtoi64(szLimit);

        if (llLimit >= -1)
        {
            // Set the hard quota limit for the user
            hr = lpDiskQuotaUser->SetQuotaLimit(llLimit, TRUE);

            if (FAILED(hr))
            {
                wprintf(L"\nCould not set the quota limit for ");
                wprintf(L"%s to %i64 bytes\n", szUser, llLimit);
            }
        }
        else
        {
            wprintf(L"\nInvalid limit!");
        }

        lpDiskQuotaUser->Release();
    }
    else
    {
        wprintf(L"\nCould not find quota data for %s\n", szUser);
    }

    return SUCCEEDED(hr);
}

BOOL SetUserThreshold ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 397 of file Commands.Cpp.

{
    HRESULT  hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR    szUser[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    LONGLONG llLimit = 0;
    HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user ");
    wprintf(L"(ie. DOMAIN\\USERNAME): ");

    // Get the user for which to set a hard limit
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);

    szUser[MAX_PATH-1] = L'\0'; // make sure szUSer is NULL terminated

    // Strip the line feed and carriage return
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);

    if (SUCCEEDED(hr))
    {
        WCHAR    szLimit[MAX_PATH] = {0};
        wprintf(L"\nEnter the new hard limit in bytes (-1 == No Limit): ");

        // Read the threshold from the console
        ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
        LfcrToNull(szLimit);
        llLimit = _wtoi64(szLimit);

        if (llLimit >= -1)
        {
            // Set the warning threshold for the user
            hr = lpDiskQuotaUser->SetQuotaThreshold(llLimit, TRUE);

            if (FAILED(hr))
            {
                wprintf(L"\nCould not set the quota limit for %s", szUser);
                wprintf(L"to %i64 bytes\n", llLimit);
            }
        }
        else
        {
            wprintf(L"\nInvalid limit!");
        }
        lpDiskQuotaUser->Release();
    }
    else
    {
        PrintError(hr);
    }

    return SUCCEEDED(hr);
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/Commands.h File Reference

  • WinBase
  • IO
  • DiskQuota
Functions

Commands.h File Reference

Go to the source code of this file.

Functions

BOOL | AddUser (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | DeleteUser (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | EnumerateUserQuotas (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | EnumerateUsers (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetDefaultHardLimit (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetDefaultQuota (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetDefaultThreshold (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetQuotaLogFlags (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | GetUserQuotaInfo (IDiskQuotaControl *lpDiskQuotaControl)
void | LfcrToNull (LPWSTR szString)
void | PrintError (HRESULT hr)
BOOL | SetDefaultHardLimit (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | SetDefaultThreshold (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | SetUserHardLimit (IDiskQuotaControl *lpDiskQuotaControl)
BOOL | SetUserThreshold (IDiskQuotaControl *lpDiskQuotaControl)

Function Documentation

BOOL AddUser ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 538 of file Commands.Cpp.

{
    HRESULT  hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR    szUser[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user (ie. DOMAIN\\USERNAME): ");

    // Get the user for which to track quota information
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szUser);

    // Add the user
    hr = lpDiskQuotaControl->AddUserName(szUser,
                                DISKQUOTA_USERNAME_RESOLVE_SYNC,
                                &lpDiskQuotaUser);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }
    lpDiskQuotaUser->Release();

    return TRUE;
}

BOOL DeleteUser ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 579 of file Commands.Cpp.

{
    HRESULT         hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR           szUser[MAX_PATH] = {0};
    DWORD           dwCharsRead;
    HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user (ie. DOMAIN\\USERNAME): ");

    // Get the user for which to track quota information
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);

    if (SUCCEEDED(hr))
    {
        // Delete the user
        hr = lpDiskQuotaControl->DeleteUser(lpDiskQuotaUser);

        if (FAILED(hr))
        {
            wprintf(L"\nCould not delete the user.");
        }

        lpDiskQuotaUser->Release();
    }
    else
    {
        PrintError(hr);
    }

    return SUCCEEDED(hr);
}

BOOL EnumerateUserQuotas ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 681 of file Commands.Cpp.

{
    HRESULT              hr;
    IEnumDiskQuotaUsers* lpEnumDiskQuotaUsers;

    // Create an enumerator object to enumerate quota users on the volume.
    hr = lpDiskQuotaControl->CreateEnumUsers(NULL, 0,
                                             DISKQUOTA_USERNAME_RESOLVE_SYNC,
                                             &lpEnumDiskQuotaUsers);
    if (SUCCEEDED(hr))
    {
        IDiskQuotaUser*      lpDiskQuotaUser;
        DWORD                dwUsersFetched;
        WCHAR                szLogonName[MAX_PATH];
        WCHAR                szQuotaUsedText[MAX_PATH];
        WCHAR                szQuotaLimitText[MAX_PATH];
        WCHAR                szQuotaThresholdText[MAX_PATH];
        DISKQUOTA_USER_INFORMATION dqUserInfo;

        wprintf(L"\n\nStatus               Logon Name  ");
        wprintf(L"Amount Used        Limit    Threshold\n");
        wprintf(L"------               ----------  ");
        wprintf(L"-----------        -----    ---------\n");

        // Enumerate through all of the quota users
        while(SUCCEEDED(hr) &&
              S_OK == lpEnumDiskQuotaUsers->
                        Next(1, &lpDiskQuotaUser, &dwUsersFetched))
        {
            if (SUCCEEDED(hr = lpDiskQuotaUser->
                    GetName(NULL, 0, szLogonName, MAX_PATH, NULL, 0))      &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaThresholdText(szQuotaThresholdText, MAX_PATH)) &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaLimitText(szQuotaLimitText, MAX_PATH))         &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaUsedText(szQuotaUsedText, MAX_PATH))           &&
                SUCCEEDED(hr = lpDiskQuotaUser->
                    GetQuotaInformation((LPVOID)&dqUserInfo,
                        sizeof(DISKQUOTA_USER_INFORMATION))))
            {
                szLogonName[MAX_PATH - 1] = L'\0'; // Make sure szLogonName is NULL terminated
                szQuotaUsedText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaUsedText is NULL terminated
                szQuotaLimitText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaLimitText is NULL terminated
                szQuotaThresholdText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaThresholdText is NULL terminated

                // Check if the user is exceeding their threshold
                if ((dqUserInfo.QuotaUsed > dqUserInfo.QuotaThreshold) &&
                    (dqUserInfo.QuotaThreshold >= 0))
                {
                    wprintf(L"Warning ");
                }
                else
                {
                    wprintf(L"OK      ");
                }

                wprintf(L"%23s", szLogonName);
                wprintf(L"   %10s", szQuotaUsedText);
                wprintf(L"   %10s", szQuotaLimitText);
                wprintf(L"   %10s", szQuotaThresholdText);
                wprintf(L"\n");
            }
            else
            {
                szLogonName[MAX_PATH - 1] = L'\0'; // Make sure szLogonName is NULL terminated

                wprintf(L"Could not retrieve %s's quota information\n",
                         szLogonName);
            }
            lpDiskQuotaUser->Release();
        }
        lpEnumDiskQuotaUsers->Release();
    }
    else
    {
        PrintError(hr);
    }

    WaitForKeyPress();

    return SUCCEEDED(hr);
}

BOOL EnumerateUsers ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 628 of file Commands.Cpp.

{
    HRESULT              hr;
    IEnumDiskQuotaUsers* lpEnumDiskQuotaUsers;
    IDiskQuotaUser*      lpDiskQuotaUser;
    DWORD                dwUsersFetched;

    // Create an enumerator object to enumerate quota users on the volume.
    hr = lpDiskQuotaControl->CreateEnumUsers(NULL, 0,
                                             DISKQUOTA_USERNAME_RESOLVE_SYNC,
                                             &lpEnumDiskQuotaUsers);
    if (SUCCEEDED(hr))
    {
        WCHAR szLogonName[MAX_PATH];

        wprintf(L"\n\nLogon name\n");
        wprintf(L"----------\n");

        // Enumerate through all of the quota users
        while(SUCCEEDED(hr) &&
              S_OK == lpEnumDiskQuotaUsers->
                      Next(1, &lpDiskQuotaUser, &dwUsersFetched))
        {
            // Retrieve the name strings associated with this disk quota user.
            if (SUCCEEDED(hr = lpDiskQuotaUser->GetName(NULL, 0, szLogonName,
                                                        MAX_PATH, NULL, 0)))
            {
                szLogonName[MAX_PATH-1] = L'\0'; // make sure szLogonName is NULL terminated
                wprintf(L"%s\n", szLogonName);
                lpDiskQuotaUser->Release();
            }
        }
        lpEnumDiskQuotaUsers->Release();
    }

    if (FAILED(hr)) PrintError(hr);
    WaitForKeyPress();

    return SUCCEEDED(hr);
}

BOOL GetDefaultHardLimit ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 163 of file Commands.Cpp.

{
    HRESULT hr;
    WCHAR   szDefaultHardLimitText[MAX_PATH];

    // Get the default hard quota limit in text format
    hr = lpDiskQuotaControl->
        GetDefaultQuotaLimitText(szDefaultHardLimitText, MAX_PATH);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    szDefaultHardLimitText[MAX_PATH - 1] = L'\0'; // Make sure szDefaultHardLimitText is NULL terminated

    wprintf(L"\n\nDefault Quota Hard Limit: %s\n", szDefaultHardLimitText);

    WaitForKeyPress();

    return TRUE;
}

BOOL GetDefaultQuota ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 37 of file Commands.Cpp.

{
    HRESULT hr;
    DWORD   dwState;

    // Get the default quota state
    hr = lpDiskQuotaControl->GetQuotaState(&dwState);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    wprintf(L"\n\nDefault Disk Quota State:\n");

    // Switch on the state of disk quota tracking
    switch(dwState & DISKQUOTA_STATE_MASK)
    {
    case DISKQUOTA_STATE_DISABLED:
        wprintf(L"Quota's are not enabled on the volume.\n");
        break;
    case DISKQUOTA_STATE_TRACK:
        wprintf(L"Quotas are enabled but the limit value is not being ");
        wprintf(L"enforced.\nUsers may exceed their quota limit.\n");
        break;
    case DISKQUOTA_STATE_ENFORCE:
        wprintf(L"Quotas are enabled and the limit value is enforced.");
        wprintf(L"\nUsers cannot exceed their quota limit.\n");
        break;
    default:
        wprintf(L"Unknown.\n");
        break;
    }

    wprintf(L"\nDefault Disk Quota File State:\n");

    switch(dwState & DISKQUOTA_FILESTATE_MASK)
    {
    case DISKQUOTA_FILESTATE_INCOMPLETE:
        wprintf(L"The volume's quota information is out of date.\n");
        wprintf(L"Quotas are probably disabled.\n");
        break;
    case DISKQUOTA_FILESTATE_REBUILDING:
        wprintf(L"The volume is rebuilding its quota information.\n");
        break;
    default:
        wprintf(L"Unknown.\n");
        break;
    }

    WaitForKeyPress();

    return TRUE;
}

BOOL GetDefaultThreshold ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 199 of file Commands.Cpp.

{
    HRESULT hr;
    WCHAR   szDefaultThresholdText[MAX_PATH];

    // Get the default threshold
    hr = lpDiskQuotaControl->
        GetDefaultQuotaThresholdText(szDefaultThresholdText, MAX_PATH);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    szDefaultThresholdText[MAX_PATH - 1] = L'\0'; // Make sure szDefaultThresholdText is NULL terminated

    wprintf(L"\n\nDefault Quota Threshold: %s\n", szDefaultThresholdText);

    WaitForKeyPress();

    return TRUE;
}

BOOL GetQuotaLogFlags ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 105 of file Commands.Cpp.

{
    HRESULT hr;
    DWORD   dwQuotaLogFlags;

    // Get the state log the quota log flags
    hr = lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    wprintf(L"\n\nDisk Quota Log State:\n");

    // Check if the system creates a log entry when a threshold limit
    // is exceeded
    if (DISKQUOTA_IS_LOGGED_USER_THRESHOLD(dwQuotaLogFlags))
    {
        wprintf(L"\nAn event log entry will be created when the user");
        wprintf(L"\nexceeds his assigned warning threshold.\n");
    }
    else
    {
        wprintf(L"\nAn event log entry will NOT be created when the");
        wprintf(L"\nuser exceeds his assigned warning threshold.\n");
    }

    // Check if the system creates a log entry when a hard limit
    // is exceeded
    if (DISKQUOTA_IS_LOGGED_USER_LIMIT(dwQuotaLogFlags))
    {
        wprintf(L"\nAn event log entry will be created when the user");
        wprintf(L"\nexceeds his assigned hard quota limit.\n");
    }
    else
    {
        wprintf(L"\nAn event log entry will NOT be created when the");
        wprintf(L"\nuser exceeds his assigned hard quota limit.\n");
    }
    WaitForKeyPress();

    return TRUE;
}

BOOL GetUserQuotaInfo ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 467 of file Commands.Cpp.

{
    WCHAR    szUser[MAX_PATH] = {0};
    IDiskQuotaUser* lpDiskQuotaUser;
    DWORD    dwCharsRead;
    HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);
    HRESULT  hr;

    wprintf(L"\n\nEnter the logon name of the user");
    wprintf(L"(ie. DOMAIN\\USERNAME): ");

    // Get the user for which to get quota information
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    szUser[MAX_PATH-1] = L'\0'; // make sure szUser is NULL terminated
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);
    if (SUCCEEDED(hr))
    {
        WCHAR    szQuotaUsedText[MAX_PATH] = {0};
        WCHAR    szQuotaLimitText[MAX_PATH] = {0};
        WCHAR    szQuotaThresholdText[MAX_PATH] = {0};

        if (SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaThresholdText(
                                    szQuotaThresholdText, MAX_PATH))         &&
            SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaLimitText(
                                    szQuotaLimitText, MAX_PATH))             &&
            SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaUsedText(
                                    szQuotaUsedText, MAX_PATH)))
        {
            szQuotaUsedText[MAX_PATH-1] = L'\0'; // make sure szQuotaUsedText is NULL terminated
            szQuotaLimitText[MAX_PATH-1] = L'\0'; // make sure szQuotaLimitText is NULL terminated
            szQuotaThresholdText[MAX_PATH-1] = L'\0'; // make sure szQuotaThresholdText is NULL terminated

            wprintf(L"Amount Used        Limit    Threshold\n");
            wprintf(L"-----------        -----    ---------\n");
            wprintf(L"   %10s", szQuotaUsedText);
            wprintf(L"   %10s", szQuotaLimitText);
            wprintf(L"   %10s", szQuotaThresholdText);
            wprintf(L"\n");
        }
        else
        {
            wprintf(L"\nCould not get the quota information for %s", szUser);
        }

        lpDiskQuotaUser->Release();
    }
    else
    {
        wprintf(L"\nCould not find quota data for %s\n", szUser);
    }

    WaitForKeyPress();

    return SUCCEEDED(hr);
}

void LfcrToNull ( LPWSTR szString )

Definition at line 813 of file Commands.Cpp.

{
    WCHAR* szLfcr;

    szLfcr = wcsstr(szString, L"\r\n");

    if (szLfcr) *szLfcr = L'\0';
}

void PrintError ( HRESULT hr )

Definition at line 775 of file Commands.Cpp.

{
    LPVOID lpMsgBuf;

    // Format the error message
    if (!FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                  FORMAT_MESSAGE_FROM_SYSTEM     |
                  FORMAT_MESSAGE_IGNORE_INSERTS,
                  NULL,
                  hr,
                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Defaut lang
                  (LPWSTR) &lpMsgBuf,
                  0,
                  NULL ))
    {
        wprintf(L"Unknown error occured\n");
        return;
    }

    // Display the string
    wprintf(L"\n%s", (LPCWSTR)lpMsgBuf);

    // Free the buffer
    LocalFree( lpMsgBuf );

    WaitForKeyPress();
}

BOOL SetDefaultHardLimit ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 235 of file Commands.Cpp.

{
    HRESULT  hr;
    DWORD    dwCharsRead;
    LONGLONG llLimit = 0;
    WCHAR    szLimit[MAX_PATH] = {0};
    HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the new default hard limit in Bytes ");
    wprintf(L"(-1 == No Limit): ");

    // Get the limit from the command prompt
    ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szLimit);
    llLimit = _wtoi64(szLimit);

    if (llLimit < -1)
    {
        wprintf(L"\nInvalid limit!");
        return FALSE;
    }

    // Set the default hard quota limit
    hr = lpDiskQuotaControl->SetDefaultQuotaLimit(llLimit);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    return TRUE;
}

BOOL SetDefaultThreshold ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 281 of file Commands.Cpp.

{
    HRESULT  hr;
    LONGLONG llLimit = 0;
    WCHAR    szLimit[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the new default threshold in Bytes ");
    wprintf(L"(-1 == No Limit): ");

    // Get the limit from the command prompt
    ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
    LfcrToNull(szLimit);
    llLimit = _wtoi64(szLimit);

    if (llLimit < -1)
    {
        wprintf(L"\nInvalid limit!");
        return FALSE;
    }

    // Set the default warning threshold
    hr = lpDiskQuotaControl->SetDefaultQuotaThreshold(llLimit);

    if (FAILED(hr))
    {
        PrintError(hr);
        return FALSE;
    }

    return TRUE;
}

BOOL SetUserHardLimit ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 327 of file Commands.Cpp.

{
    HRESULT  hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR    szUser[MAX_PATH] = {0};
    WCHAR    szLimit[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    LONGLONG llLimit = 0;
    HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user ");
    wprintf(L"(ie. DOMAIN\\USERNAME): ");

    // Get the user for which to set a hard limit
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
    szUser[MAX_PATH-1] = L'\0'; // make sure szUSer is NULL terminated

    // Strip the line feed and carriage return
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);

    if (SUCCEEDED(hr))
    {
        wprintf(L"\nEnter the new hard limit in bytes (-1 == No Limit): ");

        // Read the new hard limit from the console
        ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
        LfcrToNull(szLimit);
        llLimit = _wtoi64(szLimit);

        if (llLimit >= -1)
        {
            // Set the hard quota limit for the user
            hr = lpDiskQuotaUser->SetQuotaLimit(llLimit, TRUE);

            if (FAILED(hr))
            {
                wprintf(L"\nCould not set the quota limit for ");
                wprintf(L"%s to %i64 bytes\n", szUser, llLimit);
            }
        }
        else
        {
            wprintf(L"\nInvalid limit!");
        }

        lpDiskQuotaUser->Release();
    }
    else
    {
        wprintf(L"\nCould not find quota data for %s\n", szUser);
    }

    return SUCCEEDED(hr);
}

BOOL SetUserThreshold ( IDiskQuotaControl * lpDiskQuotaControl )

Definition at line 397 of file Commands.Cpp.

{
    HRESULT  hr;
    IDiskQuotaUser* lpDiskQuotaUser;
    WCHAR    szUser[MAX_PATH] = {0};
    DWORD    dwCharsRead;
    LONGLONG llLimit = 0;
    HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);

    wprintf(L"\n\nEnter the logon name of the user ");
    wprintf(L"(ie. DOMAIN\\USERNAME): ");

    // Get the user for which to set a hard limit
    ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);

    szUser[MAX_PATH-1] = L'\0'; // make sure szUSer is NULL terminated

    // Strip the line feed and carriage return
    LfcrToNull(szUser);

    // Check if the name is valid
    hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);

    if (SUCCEEDED(hr))
    {
        WCHAR    szLimit[MAX_PATH] = {0};
        wprintf(L"\nEnter the new hard limit in bytes (-1 == No Limit): ");

        // Read the threshold from the console
        ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
        LfcrToNull(szLimit);
        llLimit = _wtoi64(szLimit);

        if (llLimit >= -1)
        {
            // Set the warning threshold for the user
            hr = lpDiskQuotaUser->SetQuotaThreshold(llLimit, TRUE);

            if (FAILED(hr))
            {
                wprintf(L"\nCould not set the quota limit for %s", szUser);
                wprintf(L"to %i64 bytes\n", llLimit);
            }
        }
        else
        {
            wprintf(L"\nInvalid limit!");
        }
        lpDiskQuotaUser->Release();
    }
    else
    {
        PrintError(hr);
    }

    return SUCCEEDED(hr);
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/DskQuota.Cpp File Reference

  • WinBase
  • IO
  • DiskQuota
Defines | Functions

DskQuota.Cpp File Reference

#include <windows.h>
#include <stdio.h>
#include <dskquota.h>
#include "ProcessMenu.h"
#include "PrintMenu.h"
#include "Commands.h"

Go to the source code of this file.

Defines

#define | INITGUIDS
#define | WIN32_LEAN_AND_MEAN

Functions

int | wmain (int argc, WCHAR *argv[])

Define Documentation

#define INITGUIDS

Definition at line 22 of file DskQuota.Cpp.

#define WIN32_LEAN_AND_MEAN

Definition at line 18 of file DskQuota.Cpp.

Function Documentation

int wmain | ( | int | argc,
 |  | WCHAR * | argv[]
 | ) |  |

Definition at line 41 of file DskQuota.Cpp.

{
    HRESULT hr;

    // Get command line parameters
    if (argc != 2)
    {
        wprintf(L"\nUsage: %s <Path of Root Directory>\n", argv[0]);
        return 0;
    }

    // Initialize COM
    hr = CoInitialize(NULL);

    if (SUCCEEDED(hr))
    {
        IDiskQuotaControl* lpDiskQuotaControl;

        // Create an instance of the disk quota control
        hr = CoCreateInstance(CLSID_DiskQuotaControl,
                              NULL,
                              CLSCTX_INPROC_SERVER,
                              IID_IDiskQuotaControl,
                              (LPVOID*)&lpDiskQuotaControl);
        if (SUCCEEDED(hr))
        {
            // Initialize IDiskQuotaControl
            hr = lpDiskQuotaControl->Initialize(argv[1], TRUE);

            if (SUCCEEDED(hr))
            {
                // Print main menu stuff
                while (ProcessMainMenu(PrintMainMenu(), lpDiskQuotaControl));
            }

            // Release the IDiskQuotaControl COM object and Uninitialize COM
            lpDiskQuotaControl->Release();
        }
        CoUninitialize();
    }

    if (FAILED(hr)) PrintError(hr);

    return SUCCEEDED(hr) ? 1 : 0;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/PrintMenu.Cpp File Reference

  • WinBase
  • IO
  • DiskQuota
Defines | Functions

PrintMenu.Cpp File Reference

#include <windows.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define | WIN32_LEAN_AND_MEAN

Functions

WCHAR | PrintDefaultLimitsMenu ()
WCHAR | PrintDefaultQuotaMenu ()
WCHAR | PrintMainMenu ()
WCHAR | PrintQuotaLogFlagMenu ()
WCHAR | PrintQuotaManagerMenu ()
WCHAR | PrintUserManagerMenu ()

Define Documentation

#define WIN32_LEAN_AND_MEAN

Definition at line 17 of file PrintMenu.Cpp.

Function Documentation

WCHAR PrintDefaultLimitsMenu ( )

Definition at line 109 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nDefault Limits Menu\n");
    wprintf(L"-------------------\n");
    wprintf(L"A) Get default quota hard limit\n");
    wprintf(L"B) Get default quota threshold\n");
    wprintf(L"C) Set default quota hard limit\n");
    wprintf(L"D) Set default quota threshold\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintDefaultQuotaMenu ( )

Definition at line 60 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nDefault Quota Menu\n");
    wprintf(L"------------------\n");
    wprintf(L"A) Get default volume quota settings\n");
    wprintf(L"B) Disable disk quotas\n");
    wprintf(L"C) Track disk quotas\n");
    wprintf(L"D) Enforce disk quotas\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintMainMenu ( )

Definition at line 34 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nMain Menu\n");
    wprintf(L"---------\n");
    wprintf(L"A) Get/Set default volume quota settings\n");
    wprintf(L"B) Get/Set quota log flags\n");
    wprintf(L"C) Get/Set default quota limits\n");
    wprintf(L"D) Get/Set user quotas\n");
    wprintf(L"E) Add/Delete a user for which to keep track of disk quotas\n");
    wprintf(L"X) Exit \n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintQuotaLogFlagMenu ( )

Definition at line 84 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nQuota Log Flag Menu\n");
    wprintf(L"-------------------\n");
    wprintf(L"A) Get default volume log flags\n");
    wprintf(L"B) Enable logging of threshold violations\n");
    wprintf(L"C) Enable logging of hard quota limit violations\n");
    wprintf(L"D) Disable logging of threshold violations\n");
    wprintf(L"E) Disable logging of hard quota limit violations\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintQuotaManagerMenu ( )

Definition at line 158 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nQuota Manager Menu\n");
    wprintf(L"------------------\n");
    wprintf(L"A) Get the quota information for all users\n");
    wprintf(L"B) Set the quota hard limit for a user\n");
    wprintf(L"C) Set the quota threshold for a user\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintUserManagerMenu ( )

Definition at line 134 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nUser Manager Menu\n");
    wprintf(L"-----------------\n");
    wprintf(L"A) Add a user for which to keep track of quotas\n");
    wprintf(L"B) Delete a user for which you no longer which to track quotas\n");
    wprintf(L"C) Enumerate users for which quotas are tracked\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/PrintMenu.h File Reference

  • WinBase
  • IO
  • DiskQuota
Functions

PrintMenu.h File Reference

Go to the source code of this file.

Functions

WCHAR | PrintDefaultLimitsMenu ()
WCHAR | PrintDefaultQuotaMenu ()
WCHAR | PrintMainMenu ()
WCHAR | PrintQuotaLogFlagMenu ()
WCHAR | PrintQuotaManagerMenu ()
WCHAR | PrintUserManagerMenu ()

Function Documentation

WCHAR PrintDefaultLimitsMenu ( )

Definition at line 109 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nDefault Limits Menu\n");
    wprintf(L"-------------------\n");
    wprintf(L"A) Get default quota hard limit\n");
    wprintf(L"B) Get default quota threshold\n");
    wprintf(L"C) Set default quota hard limit\n");
    wprintf(L"D) Set default quota threshold\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintDefaultQuotaMenu ( )

Definition at line 60 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nDefault Quota Menu\n");
    wprintf(L"------------------\n");
    wprintf(L"A) Get default volume quota settings\n");
    wprintf(L"B) Disable disk quotas\n");
    wprintf(L"C) Track disk quotas\n");
    wprintf(L"D) Enforce disk quotas\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintMainMenu ( )

Definition at line 34 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nMain Menu\n");
    wprintf(L"---------\n");
    wprintf(L"A) Get/Set default volume quota settings\n");
    wprintf(L"B) Get/Set quota log flags\n");
    wprintf(L"C) Get/Set default quota limits\n");
    wprintf(L"D) Get/Set user quotas\n");
    wprintf(L"E) Add/Delete a user for which to keep track of disk quotas\n");
    wprintf(L"X) Exit \n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintQuotaLogFlagMenu ( )

Definition at line 84 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nQuota Log Flag Menu\n");
    wprintf(L"-------------------\n");
    wprintf(L"A) Get default volume log flags\n");
    wprintf(L"B) Enable logging of threshold violations\n");
    wprintf(L"C) Enable logging of hard quota limit violations\n");
    wprintf(L"D) Disable logging of threshold violations\n");
    wprintf(L"E) Disable logging of hard quota limit violations\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintQuotaManagerMenu ( )

Definition at line 158 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nQuota Manager Menu\n");
    wprintf(L"------------------\n");
    wprintf(L"A) Get the quota information for all users\n");
    wprintf(L"B) Set the quota hard limit for a user\n");
    wprintf(L"C) Set the quota threshold for a user\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

WCHAR PrintUserManagerMenu ( )

Definition at line 134 of file PrintMenu.Cpp.

{
    wprintf(L"\n\nUser Manager Menu\n");
    wprintf(L"-----------------\n");
    wprintf(L"A) Add a user for which to keep track of quotas\n");
    wprintf(L"B) Delete a user for which you no longer which to track quotas\n");
    wprintf(L"C) Enumerate users for which quotas are tracked\n");
    wprintf(L"X) Exit back to main menu\n");
    wprintf(L"Please enter your selection: ");

    return (GetUserInput());
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/ProcessMenu.Cpp File Reference

  • WinBase
  • IO
  • DiskQuota
Defines | Functions

ProcessMenu.Cpp File Reference

#include <windows.h>
#include <stdio.h>
#include <dskquota.h>
#include "ProcessMenu.h"
#include "PrintMenu.h"
#include "Commands.h"

Go to the source code of this file.

Defines

#define | WIN32_LEAN_AND_MEAN

Functions

BOOL | ProcessDefaultLimitsMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessDefaultQuotaMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessMainMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessQuotaLogFlagMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessQuotaManagerMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessUserManagerMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)

Define Documentation

#define WIN32_LEAN_AND_MEAN

Definition at line 17 of file ProcessMenu.Cpp.

Function Documentation

BOOL ProcessDefaultLimitsMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 212 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        GetDefaultHardLimit(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        GetDefaultThreshold(lpDiskQuotaControl);
        break;
    case L'C':
    case L'c':
        SetDefaultHardLimit(lpDiskQuotaControl);
        break;
    case L'D':
    case L'd':
        SetDefaultThreshold(lpDiskQuotaControl);
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessDefaultQuotaMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 98 of file ProcessMenu.Cpp.

{
    DWORD dwState = 0;

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        GetDefaultQuota(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_DISABLED(dwState));
        break;
    case L'C':
    case L'c':
        lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_TRACKED(dwState));
        break;
    case L'D':
    case L'd':
        lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_ENFORCED(dwState));
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessMainMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 40 of file ProcessMenu.Cpp.

{
    switch (wcMenuChoice)
    {
    case L'A':
    case L'a':
        // Print main menu stuff
        while (ProcessDefaultQuotaMenu(PrintDefaultQuotaMenu(),
                                       lpDiskQuotaControl));
        break;
    case L'B':
    case L'b':
        while (ProcessQuotaLogFlagMenu(PrintQuotaLogFlagMenu(),
                                       lpDiskQuotaControl));
        break;
    case L'C':
    case L'c':
        while (ProcessDefaultLimitsMenu(PrintDefaultLimitsMenu(),
                                        lpDiskQuotaControl));
        break;
    case L'D':
    case L'd':
        while (ProcessQuotaManagerMenu(PrintQuotaManagerMenu(),
                                       lpDiskQuotaControl));
        break;
    case L'E':
    case L'e':
        while (ProcessUserManagerMenu(PrintUserManagerMenu(),
                                      lpDiskQuotaControl));
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessQuotaLogFlagMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 148 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        GetQuotaLogFlags(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_THRESHOLD(dwQuotaLogFlags,
                                                              TRUE));
        break;
    case L'C':
    case L'c':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_LIMIT(dwQuotaLogFlags,
                                                          TRUE));
        break;
    case L'D':
    case L'd':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_THRESHOLD(dwQuotaLogFlags,
                                                              FALSE));
        break;
    case L'E':
    case L'e':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_LIMIT(dwQuotaLogFlags,
                                                          FALSE));
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessQuotaManagerMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 312 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        EnumerateUserQuotas(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        SetUserHardLimit(lpDiskQuotaControl);
        break;
    case L'C':
    case L'c':
        SetUserThreshold(lpDiskQuotaControl);
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessUserManagerMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 264 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        AddUser(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        DeleteUser(lpDiskQuotaControl);
        break;
    case L'C':
    case L'c':
        EnumerateUsers(lpDiskQuotaControl);
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/ProcessMenu.h File Reference

  • WinBase
  • IO
  • DiskQuota
Functions

ProcessMenu.h File Reference

Go to the source code of this file.

Functions

BOOL | ProcessDefaultLimitsMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessDefaultQuotaMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessMainMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessQuotaLogFlagMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessQuotaManagerMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)
BOOL | ProcessUserManagerMenu (WCHAR wcMenuChoice, IDiskQuotaControl *lpDiskQuotaControl)

Function Documentation

BOOL ProcessDefaultLimitsMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 212 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        GetDefaultHardLimit(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        GetDefaultThreshold(lpDiskQuotaControl);
        break;
    case L'C':
    case L'c':
        SetDefaultHardLimit(lpDiskQuotaControl);
        break;
    case L'D':
    case L'd':
        SetDefaultThreshold(lpDiskQuotaControl);
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessDefaultQuotaMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 98 of file ProcessMenu.Cpp.

{
    DWORD dwState = 0;

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        GetDefaultQuota(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_DISABLED(dwState));
        break;
    case L'C':
    case L'c':
        lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_TRACKED(dwState));
        break;
    case L'D':
    case L'd':
        lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_ENFORCED(dwState));
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessMainMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 40 of file ProcessMenu.Cpp.

{
    switch (wcMenuChoice)
    {
    case L'A':
    case L'a':
        // Print main menu stuff
        while (ProcessDefaultQuotaMenu(PrintDefaultQuotaMenu(),
                                       lpDiskQuotaControl));
        break;
    case L'B':
    case L'b':
        while (ProcessQuotaLogFlagMenu(PrintQuotaLogFlagMenu(),
                                       lpDiskQuotaControl));
        break;
    case L'C':
    case L'c':
        while (ProcessDefaultLimitsMenu(PrintDefaultLimitsMenu(),
                                        lpDiskQuotaControl));
        break;
    case L'D':
    case L'd':
        while (ProcessQuotaManagerMenu(PrintQuotaManagerMenu(),
                                       lpDiskQuotaControl));
        break;
    case L'E':
    case L'e':
        while (ProcessUserManagerMenu(PrintUserManagerMenu(),
                                      lpDiskQuotaControl));
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessQuotaLogFlagMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 148 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        GetQuotaLogFlags(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_THRESHOLD(dwQuotaLogFlags,
                                                              TRUE));
        break;
    case L'C':
    case L'c':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_LIMIT(dwQuotaLogFlags,
                                                          TRUE));
        break;
    case L'D':
    case L'd':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_THRESHOLD(dwQuotaLogFlags,
                                                              FALSE));
        break;
    case L'E':
    case L'e':
        lpDiskQuotaControl->
            SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_LIMIT(dwQuotaLogFlags,
                                                          FALSE));
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessQuotaManagerMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 312 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        EnumerateUserQuotas(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        SetUserHardLimit(lpDiskQuotaControl);
        break;
    case L'C':
    case L'c':
        SetUserThreshold(lpDiskQuotaControl);
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

BOOL ProcessUserManagerMenu | ( | WCHAR | wcMenuChoice,
 |  | IDiskQuotaControl * | lpDiskQuotaControl
 | ) |  |

Definition at line 264 of file ProcessMenu.Cpp.

{
    DWORD dwQuotaLogFlags = 0;
    lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);

    switch(wcMenuChoice)
    {
    case L'A':
    case L'a':
        AddUser(lpDiskQuotaControl);
        break;
    case L'B':
    case L'b':
        DeleteUser(lpDiskQuotaControl);
        break;
    case L'C':
    case L'c':
        EnumerateUsers(lpDiskQuotaControl);
        break;
    case L'X':
    case L'x':
        return FALSE;
        break;
    default:
        wprintf(L"\n\nInvalid selection.\n");
        break;
    }

    return TRUE;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DLEdit/DLEdit.Cpp File Reference

  • WinBase
  • IO
  • DLEdit
Classes | Defines | Typedefs | Functions | Variables

DLEdit.Cpp File Reference

#include <windows.h>
#include <winioctl.h>
#include <TCHAR.H>
#include <stdio.h>

Go to the source code of this file.

Classes

struct | _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION

Defines

#define | _UNICODE
#define | GPT_BASIC_DATA_ATTRIBUTE_HIDDEN (0x4000000000000000)
#define | HIDDEN_PARTITION_FLAG 0x10
#define | IOCTL_VOLUME_GET_GPT_ATTRIBUTES CTL_CODE(IOCTL_VOLUME_BASE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define | UNICODE
#define | WIN32_LEAN_AND_MEAN

Typedefs

typedef struct
_VOLUME_GET_GPT_ATTRIBUTES_INFORMATION * 		PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION
typedef struct
_VOLUME_GET_GPT_ATTRIBUTES_INFORMATION 		VOLUME_GET_GPT_ATTRIBUTES_INFORMATION

Functions

void | _tmain (int argc, TCHAR **argv)
BOOL WINAPI | AssignPersistentDriveLetter (LPCTSTR pszDriveLetter, LPCTSTR pszDeviceName)
BOOL WINAPI | AssignTemporaryDriveLetter (LPCTSTR pszDriveLetter, LPCTSTR pszDeviceName)
BOOL WINAPI | IsDriveLetter (LPCTSTR pszDriveLetter)
BOOL WINAPI | IsPartitionHidden (BYTE partitionType, ULONGLONG partitionAttribs)
BOOL WINAPI | IsWindowsXP_orLater (void)
BOOL WINAPI | RemovePersistentDriveLetter (LPCTSTR pszDriveLetter)
BOOL WINAPI | RemoveTemporaryDriveLetter (LPCTSTR pszDriveLetter)

Variables

const DWORD | PRIV_ERROR_DRIVE_LETTER_IN_USE = 0xE0000001
const DWORD | PRIV_ERROR_PARTITION_HIDDEN = 0x60000001
const DWORD | PRIV_ERROR_PARTITION_NOT_RECOGNIZED = 0x60000002

Define Documentation

#define _UNICODE

Definition at line 51 of file DLEdit.Cpp.

#define GPT_BASIC_DATA_ATTRIBUTE_HIDDEN (0x4000000000000000)

Definition at line 63 of file DLEdit.Cpp.

#define HIDDEN_PARTITION_FLAG 0x10

Definition at line 74 of file DLEdit.Cpp.

#define IOCTL_VOLUME_GET_GPT_ATTRIBUTES CTL_CODE(IOCTL_VOLUME_BASE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)

Definition at line 65 of file DLEdit.Cpp.

#define UNICODE

Definition at line 50 of file DLEdit.Cpp.

#define WIN32_LEAN_AND_MEAN

Definition at line 54 of file DLEdit.Cpp.

Typedef Documentation

typedef struct _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION * PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION
typedef struct _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION VOLUME_GET_GPT_ATTRIBUTES_INFORMATION

Function Documentation

void _tmain | ( | int | argc,
 |  | TCHAR ** | argv
 | ) |  |

Definition at line 112 of file DLEdit.Cpp.

{
   TCHAR * pszDriveLetter,
        * pszNTDevice,
        * pszOptions;

   /*
      Command-line parsing.
         1) Validate arguments
         2) Determine what user wants to do
   */
   if (3 == argc && !lstrcmpi (argv[1], _T("-r")) && IsDriveLetter (argv[2]))
   {
      /*
            User wants to remove the drive letter.  Command line should be:
               dledit -r <drive letter>
      */
      pszOptions       = argv[1];
      pszDriveLetter   = argv[2];
      pszNTDevice      = NULL;

      if (!RemovePersistentDriveLetter (pszDriveLetter))
      {
         if (!RemoveTemporaryDriveLetter (pszDriveLetter))
         {
            switch (GetLastError())
            {
            case ERROR_FILE_NOT_FOUND:
               _tprintf(_T("%s is not in use\n"), pszDriveLetter);
               break;

            default:
               _tprintf(_T("error %lu: couldn't remove %s\n"),
                     GetLastError(), pszDriveLetter);
            }
         }
      }

   } /* End if remove drive letter mapping */

   else if (3 == argc && IsDriveLetter (argv[1]))
   {
      /*
         User wants to add a persistent drive letter.  Command line should be:
            dledit <drive letter> <NT device name>
      */
      pszOptions       = NULL;
      pszDriveLetter   = argv[1];
      pszNTDevice      = argv[2];

      /*
         Try a persistent drive letter; if partition is hidden, the persistent
         mapping will fail--try a temporary mapping and tell user about it.

         Note: Hidden partitions can be assigned temporary drive letters.
         These are nothing more than symbolic links created with
         DefineDosDevice.  Temporary drive letters will be removed when the
         system is rebooted.
      */
      if (!AssignPersistentDriveLetter (pszDriveLetter, pszNTDevice))
      {
         switch (GetLastError())
         {
         case PRIV_ERROR_PARTITION_HIDDEN:
            if (AssignTemporaryDriveLetter (pszDriveLetter, pszNTDevice))
               _tprintf(_T("%s is hidden; mapped %s temporarily\n"),
                        pszNTDevice, pszDriveLetter);
            else
               _tprintf(_T("%s is hidden; couldn't map %s to it\n"),
                        pszNTDevice, pszDriveLetter);
            break;

         case PRIV_ERROR_DRIVE_LETTER_IN_USE:
            _tprintf(_T("%s is in use, can't map it to %s\n"),
                     pszDriveLetter, pszNTDevice);
            break;

         case ERROR_FILE_NOT_FOUND:
            _tprintf(_T("%s doesn't exist or can't be opened\n"),
                     pszNTDevice);
            break;

         case ERROR_INVALID_PARAMETER:
            _tprintf(_T("%s already has a drive letter; can't map %s to it\n"),
                     pszNTDevice, pszDriveLetter);
            break;

         default:
            _tprintf(_T("error %lu: couldn't map %s to %s\n"),
                  GetLastError(), pszDriveLetter, pszNTDevice);
         }
      }
   } /* End if add persistent drive letter mapping */

   else if (4 == argc && !lstrcmpi (argv[1], _T("-t")) && IsDriveLetter (argv[2]))
   {
      /*
         User wants to add a temporary drive letter.  Command line should be:
            dledit -t <drive letter> <NT device name>
      */
      pszOptions       = argv[1];
      pszDriveLetter   = argv[2];
      pszNTDevice      = argv[3];

      if (!AssignTemporaryDriveLetter (pszDriveLetter, pszNTDevice))
      {
         switch (GetLastError())
         {
          case ERROR_FILE_NOT_FOUND:
            _tprintf(_T("%s doesn't exist or can't be opened\n"),
                     pszNTDevice);
            break;

          case PRIV_ERROR_DRIVE_LETTER_IN_USE:
            _tprintf(_T("%s is in use, can't map it to %s\n"),
                     pszDriveLetter, pszNTDevice);
            break;

         default:
            _tprintf(_T("error %lu: couldn't map %s to %s\n"),
                     GetLastError(), pszDriveLetter, pszNTDevice);
         }
      }
   } /* End if add temporary drive letter mapping */

   else if (2 == argc && IsDriveLetter (argv[1]))
   {
      /*
         User wants to show what device is connected to the drive letter.
         Command line should be:
            dledit <drive letter>
      */
      pszOptions       = NULL;
      pszDriveLetter   = argv[1];
      pszNTDevice      = NULL;

      TCHAR szNtDeviceName[MAX_PATH];
      TCHAR szDriveLetter[3];

      /*
         Command-line argument for the drive letter could be in one of two
         formats:  C:\ or C:.  We normalize this to C: for QueryDosDevice.
      */
      szDriveLetter[0] = pszDriveLetter[0];
      szDriveLetter[1] = _T(':');
      szDriveLetter[2] = _T('\0');

      if (QueryDosDevice (szDriveLetter, szNtDeviceName, MAX_PATH))
      {
         _tprintf(_T("%s is mapped to %s\n"), szDriveLetter, szNtDeviceName);
      }
      else
      {
         switch (GetLastError())
         {
         case ERROR_FILE_NOT_FOUND:
            _tprintf(_T("%s is not in use\n"), pszDriveLetter);
            break;

         default:
            _tprintf(_T("error %lu: couldn't get mapping for %s\n"),
                     GetLastError(), pszDriveLetter);
         }
      }

   } /* End if show drive letter mapping */

   else if (2 == argc && !lstrcmpi (argv[1], _T("-a")))
   {
      /*
         User wants to show all mappings of drive letters to their respective
         devices.  Command line should be:
            dledit -a
      */
      pszOptions       = argv[1];
      pszDriveLetter   = NULL;
      pszNTDevice      = NULL;

      /*
         Largest possible array of drive strings is 26 drive letters
         times 4 chars per drive letter plus 1 for the terminating NULL
       */
      const DWORD MAX_DRIVE_STRING_LENGTH = 26 * 4 + 1;

      TCHAR szDriveStrings[MAX_DRIVE_STRING_LENGTH];
      DWORD cchDriveStrings;

      /*
         Get a list of all current drive letters, then for each, print the
         mapping.  Drive letters are returned in the form
         A:<NULL>B:<NULL>C:<NULL>...<NULL>.
      */
      cchDriveStrings = GetLogicalDriveStrings (MAX_DRIVE_STRING_LENGTH, szDriveStrings);
      if ( (0 != cchDriveStrings) && (cchDriveStrings <= MAX_DRIVE_STRING_LENGTH) )
      {
         TCHAR * pszCurrentDriveLetter;
         TCHAR szNtDeviceName[MAX_PATH];
         TCHAR szDriveLetter[3];

         _tprintf(_T("Drive     Device\n")
                  _T("-----     ------\n"));

         pszCurrentDriveLetter = szDriveStrings;
         while (_T('\0') != *pszCurrentDriveLetter)
         {
            /* QueryDosDevice requires drive letters in the format X: */
            szDriveLetter[0] = pszCurrentDriveLetter[0];
            szDriveLetter[1] = _T(':');
            szDriveLetter[2] = _T('\0');

            if (QueryDosDevice (szDriveLetter, szNtDeviceName, MAX_PATH))
               _tprintf(_T("%-10s%s\n"), szDriveLetter, szNtDeviceName);

            pszCurrentDriveLetter += 4; /* size of X:<NULL> */
         }
      }
      else
      {
         _tprintf(_T("couldn't list drive letters and their devices\n"));
      }
   }  /* End if show all drive letter mappings */

   else
   {
      /* User has selected an invalid operation--display help. */
      PrintHelp (argv[0]);
   }
}

BOOL WINAPI AssignPersistentDriveLetter | ( | LPCTSTR | pszDriveLetter,
 |  | LPCTSTR | pszDeviceName
 | ) |  |

Definition at line 391 of file DLEdit.Cpp.

{
   BOOL fResult;
   TCHAR szUniqueVolumeName[MAX_PATH];
   TCHAR szDriveLetterAndSlash[4];
   TCHAR szDriveLetter[3];

   /*
      Make sure we are passed a drive letter and a device name.  lstrlen
      is useful because it will return zero if the pointer points to memory
      that can't be read or a string that causes an invalid page fault before
      the terminating NULL.
   */
   if (0 == lstrlen(pszDriveLetter) ||
       0 == lstrlen(pszDeviceName)  ||
       !IsDriveLetter (pszDriveLetter))
   {
      SetLastError (ERROR_INVALID_PARAMETER);
      return FALSE;
   }

   /*
      GetVolumeNameForVolumeMountPoint, SetVolumeMountPoint, and
      DeleteVolumeMountPoint require drive letters to have a trailing backslash.
      However, DefineDosDevice and QueryDosDevice require that the trailing
      backslash be absent.  So, we'll set up the following variables:

       szDriveLetterAndSlash     for the mount point APIs
       szDriveLetter             for DefineDosDevice
   */
   szDriveLetterAndSlash[0] = pszDriveLetter[0];
   szDriveLetterAndSlash[1] = _T(':');
   szDriveLetterAndSlash[2] = _T('\\');
   szDriveLetterAndSlash[3] = _T('\0');

   szDriveLetter[0] = szDriveLetterAndSlash[0];
   szDriveLetter[1] = _T(':');
   szDriveLetter[2] = _T('\0');

   /*
      Determine if the drive letter is currently in use.  If so, return the
      error to the caller.  NOTE:  we temporarily reuse szUniqueVolumeName
      instead of allocating a large array for this one call.
   */
   fResult = QueryDosDevice (szDriveLetter, szUniqueVolumeName, MAX_PATH);
   if (fResult)
   {
      SetLastError (PRIV_ERROR_DRIVE_LETTER_IN_USE);
      return FALSE;
   }

   /*
      To map a persistent drive letter, we must make sure that the target
      device is one of the following:

         A recognized partition and is not hidden
         A dynamic volume
         A non-partitionable device such as CD-ROM

      Start by using the drive letter as a symbolic link to the device.  Then,
      open the device to gather the information necessary to determine if the
      drive can have a persistent drive letter.
   */
   fResult = DefineDosDevice (DDD_RAW_TARGET_PATH, szDriveLetter, pszDeviceName);
   if (fResult)
   {
      HANDLE       hDevice;
      DWORD        dwBytesReturned;
      BOOL         fResult;
      TCHAR        szDriveName[7]; // holds \\.\X: plus NULL.

      VOLUME_GET_GPT_ATTRIBUTES_INFORMATION volinfo;
      PARTITION_INFORMATION                 partinfo;

      lstrcpyn (szDriveName, _T("\\\\.\\"), 5);
      lstrcpyn (szDriveName + 4, szDriveLetter, 3);

      hDevice = CreateFile (szDriveName, GENERIC_READ,
                            FILE_SHARE_READ|FILE_SHARE_WRITE,
                            NULL, OPEN_EXISTING, 0, NULL);

      if (INVALID_HANDLE_VALUE != hDevice)
      {
         /*
            See if drive is partitionable and retrieve the partition type.
            If the device doesn't have a partition, note it by setting the
            partition type to unused.
         */
         fResult = DeviceIoControl (hDevice, IOCTL_DISK_GET_PARTITION_INFO,
                                    NULL, 0,
                                    &partinfo, sizeof(partinfo),
                                    &dwBytesReturned, NULL);
         if (!fResult)
         {
            partinfo.PartitionType = PARTITION_ENTRY_UNUSED;
         }

         /*
            On Windows XP, partition entries on GUID Partition Table drives
            have an attribute that determines whether partitions are hidden.
            Therefore, we must check this bit on the target partition.

            If we're running on Windows 2000, there are no GPT drives, so
            set flags to none.  This is important for the check for hidden
            partitions later.
         */
         if (IsWindowsXP_orLater())
         {
            fResult = DeviceIoControl (hDevice, IOCTL_VOLUME_GET_GPT_ATTRIBUTES,
                                       NULL, 0,
                                       &volinfo, sizeof(volinfo),
                                       &dwBytesReturned, NULL);
            if (!fResult)
               volinfo.GptAttributes = 0;
         }
         else
         {
            volinfo.GptAttributes = 0;
         }
         CloseHandle (hDevice);
      }
      else
      {
         /*
            Remove the drive letter symbolic link we created, let caller know
            we couldn't open the drive.
         */
         DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|
                          DDD_EXACT_MATCH_ON_REMOVE, szDriveLetter,
                          pszDeviceName);
         return (FALSE);
      }

      /*
         Now, make sure drive meets requirements for receiving a persistent
         drive letter.

         Note: on Windows XP, partitions that were hidden when the system
         booted are not assigned a unique volume name.  They will not be given
         one until they are marked as not hidden and the system rebooted.
         Therefore, we cannot create a mount point hidden partitions.

         On Windows 2000, hidden partitions are assigned unique volume names
         and so can have persistent drive letters.  However, we will not allow
         that behavior in this tool as hidden partitions should not be assigned
         drive letters.
      */
      if (IsPartitionHidden (partinfo.PartitionType, volinfo.GptAttributes))
      {
         // remove the drive letter we created, let caller know what happened.
         DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|
                           DDD_EXACT_MATCH_ON_REMOVE, szDriveLetter,
                           pszDeviceName);

         SetLastError (PRIV_ERROR_PARTITION_HIDDEN);
         return (FALSE);
      }

      /*
         Verify that the drive letter must refer to a recognized partition,
         a dynamic volume, or a non-partitionable device such as CD-ROM.
      */
      if (IsRecognizedPartition(partinfo.PartitionType) ||
          PARTITION_LDM == partinfo.PartitionType ||
          PARTITION_ENTRY_UNUSED == partinfo.PartitionType)
      {
         /*
            Now add the drive letter by calling on the volume mount manager.
            Once we have the unique volume name that the new drive letter
            will point to, delete the symbolic link because the Mount Manager
            allows only one reference to a device at a time (the new one to
            be added).
         */
         fResult = GetVolumeNameForVolumeMountPoint (szDriveLetterAndSlash,
                                                     szUniqueVolumeName,
                                                     MAX_PATH);

         DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|
                          DDD_EXACT_MATCH_ON_REMOVE, szDriveLetter,
                          pszDeviceName);

         if (fResult)
            fResult = SetVolumeMountPoint (szDriveLetterAndSlash,
                                           szUniqueVolumeName);

         return (fResult);
      }
      else
      {
         /*
            Device doesn't meet the criteria for persistent drive letter.
            Remove the drive letter symbolic link we created.
         */
         DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|
                          DDD_EXACT_MATCH_ON_REMOVE, szDriveLetter,
                          pszDeviceName);

         SetLastError (PRIV_ERROR_PARTITION_NOT_RECOGNIZED);
         return (FALSE);
      }

   }  /* end if DeviceIoControl to map symbolic link*/
   else
      return (FALSE);
}

BOOL WINAPI AssignTemporaryDriveLetter | ( | LPCTSTR | pszDriveLetter,
 |  | LPCTSTR | pszDeviceName
 | ) |  |

Definition at line 666 of file DLEdit.Cpp.

{
   TCHAR szDevice[MAX_PATH];
   TCHAR szDriveLetter[3];
   BOOL  fResult;

   /* Verify that caller passed a drive letter and device name. */
   if (0 == lstrlen(pszDriveLetter) ||
       0 == lstrlen(pszDeviceName)  ||
       !IsDriveLetter (pszDriveLetter))
   {
      SetLastError (ERROR_INVALID_PARAMETER);
      return (FALSE);
   }

   /*
      Make sure the drive letter isn't already in use.  If not in use,
      create the symbolic link to establish the temporary drive letter.

      pszDriveLetter could be in the format X: or X:\; QueryDosDevice and
      DefineDosDevice need X:
   */
   szDriveLetter[0] = pszDriveLetter[0];
   szDriveLetter[1] = _T(':');
   szDriveLetter[2] = _T('\0');

   if (!QueryDosDevice (szDriveLetter, szDevice, MAX_PATH))
   {
      /*
         If we can create the symbolic link, verify that it points to a real
         device.  If not, remove the link and return an error.  CreateFile sets
         the last error code to ERROR_FILE_NOT_FOUND.
      */
      fResult = DefineDosDevice (DDD_RAW_TARGET_PATH, szDriveLetter, pszDeviceName);
      if (fResult)
      {
         HANDLE hDevice;
         TCHAR  szDriveName[7]; // holds \\.\X: plus NULL.

         lstrcpyn (szDriveName, _T("\\\\.\\"), 5);
         lstrcpyn (szDriveName + 4, szDriveLetter, 3);

         hDevice = CreateFile (szDriveName, GENERIC_READ,
                               FILE_SHARE_READ|FILE_SHARE_WRITE,
                               NULL, OPEN_EXISTING, 0, NULL);

         if (INVALID_HANDLE_VALUE != hDevice)
         {
            fResult = TRUE;
            CloseHandle (hDevice);
         }
         else
         {
            DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|
                             DDD_EXACT_MATCH_ON_REMOVE, szDriveLetter,
                             pszDeviceName);
            fResult = FALSE;
         }
      }
   }
   else
   {
      SetLastError (PRIV_ERROR_DRIVE_LETTER_IN_USE);
      fResult = FALSE;
   }

   return (fResult);
}

BOOL WINAPI IsDriveLetter ( LPCTSTR pszDriveLetter )

Definition at line 846 of file DLEdit.Cpp.

{
    /*
       format must be: X:<null> or X:<NULL> where X is a letter.  lstrlen will
       return 0 if inaccessible pointer is supplied, or if reading bytes of
       string causes an access violation before reaching a terminating NULL.
    */
    if ( (0 < lstrlen (pszDriveLetter))      &&
         (IsCharAlpha (pszDriveLetter[0]))   &&
         (_T(':')   == pszDriveLetter[1])    &&
         ((_T('\0') == pszDriveLetter[2]) ||
          ((_T('\\') == pszDriveLetter[2]) && (_T('\0') == pszDriveLetter[3])))
       )
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}

BOOL WINAPI IsPartitionHidden | ( | BYTE | partitionType,
 |  | ULONGLONG | partitionAttribs
 | ) |  |

Definition at line 816 of file DLEdit.Cpp.

{
   if ((partitionAttribs & GPT_BASIC_DATA_ATTRIBUTE_HIDDEN) ||
       ((partitionType & HIDDEN_PARTITION_FLAG) &&
        IsRecognizedPartition (partitionType & ~HIDDEN_PARTITION_FLAG)))
   {
      return TRUE;
   }
   else
   {
      return FALSE;
   }
}

BOOL WINAPI IsWindowsXP_orLater ( void )

Definition at line 880 of file DLEdit.Cpp.

{
   OSVERSIONINFOEX osvi;
   ULONGLONG       comparisonMask;

   ZeroMemory (&osvi, sizeof(osvi));
   osvi.dwOSVersionInfoSize = sizeof(osvi);
   osvi.dwMajorVersion = 5;
   osvi.dwMinorVersion = 1;

   comparisonMask = 0;
   comparisonMask = VerSetConditionMask (comparisonMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
   comparisonMask = VerSetConditionMask (comparisonMask, VER_MINORVERSION, VER_GREATER_EQUAL);

   return (VerifyVersionInfo (&osvi, VER_MAJORVERSION|VER_MINORVERSION, comparisonMask));
}

BOOL WINAPI RemovePersistentDriveLetter ( LPCTSTR pszDriveLetter )

Definition at line 615 of file DLEdit.Cpp.

{
   BOOL fResult;
   TCHAR szDriveLetterAndSlash[4];

   /* Make sure we have a drive letter.   */
   if (0 == lstrlen(pszDriveLetter) || !IsDriveLetter (pszDriveLetter))
   {
      SetLastError (ERROR_INVALID_PARAMETER);
      fResult = FALSE;
   }

   /*
      pszDriveLetter could be in the format X: or X:\.  DeleteVolumeMountPoint
      requires X:\, so add a trailing backslash.
   */
   szDriveLetterAndSlash[0] = pszDriveLetter[0];
   szDriveLetterAndSlash[1] = _T(':');
   szDriveLetterAndSlash[2] = _T('\\');
   szDriveLetterAndSlash[3] = _T('\0');

   fResult = DeleteVolumeMountPoint (szDriveLetterAndSlash);
   return (fResult);
}

BOOL WINAPI RemoveTemporaryDriveLetter ( LPCTSTR pszDriveLetter )

Definition at line 749 of file DLEdit.Cpp.

{
   BOOL fResult;
   TCHAR szDriveLetter[3];
   TCHAR szDeviceName[MAX_PATH];

   /* Verify that caller passed a drive letter and device name. */

   if (0 == lstrlen(pszDriveLetter) || !IsDriveLetter (pszDriveLetter))
   {
      SetLastError (ERROR_INVALID_PARAMETER);
      fResult = FALSE;

   }

   /*
      pszDriveLetter could be in the format X: or X:\; DefineDosDevice
      needs X:
   */
   szDriveLetter[0] = pszDriveLetter[0];
   szDriveLetter[1] = _T(':');
   szDriveLetter[2] = _T('\0');

   fResult = QueryDosDevice (szDriveLetter, szDeviceName, MAX_PATH);
   if (fResult)
   {
      fResult = DefineDosDevice (DDD_RAW_TARGET_PATH|DDD_REMOVE_DEFINITION|
                                 DDD_EXACT_MATCH_ON_REMOVE, szDriveLetter,
                                 szDeviceName);
   }

   return (fResult);
}

Variable Documentation

const DWORD PRIV_ERROR_DRIVE_LETTER_IN_USE = 0xE0000001

Definition at line 78 of file DLEdit.Cpp.

const DWORD PRIV_ERROR_PARTITION_HIDDEN = 0x60000001

Definition at line 80 of file DLEdit.Cpp.

const DWORD PRIV_ERROR_PARTITION_NOT_RECOGNIZED = 0x60000002

Definition at line 81 of file DLEdit.Cpp.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumMount/EnumMountPoints.c File Reference

  • WinBase
  • IO
  • EnumMount
Functions

EnumMountPoints.c File Reference

#include <windows.h>
#include <stdio.h>
#include <tchar.h>

Go to the source code of this file.

Functions

void main ()

Function Documentation

void main ( void )

Definition at line 26 of file EnumMountPoints.c.

{
    EnumVolumes();
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumStreams/EnumStreams.c File Reference

  • WinBase
  • IO
  • EnumStreams
Functions

EnumStreams.c File Reference

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "findstream.h"

Go to the source code of this file.

Functions

int _tmain (int argc, TCHAR *argv[])

Function Documentation

int _tmain | ( | int | argc,
 |  | TCHAR * | argv[]
 | ) |  |

Definition at line 26 of file EnumStreams.c.

{
   HANDLE hFindStream;
   STREAM_FIND_DATA ffStream;

   if (argc < 2)
   {
      _tprintf(_T("usage: enumstreams file_name\n"));
      return 1;
   }

   hFindStream = FindFirstStream(argv[1], &ffStream);
   if (hFindStream == INVALID_HANDLE_VALUE)
   {
      _tprintf(_T("Cannot get list of streams.  LastError = %d\n"),
               GetLastError());
      return 2;
   }

   // Enumerate the streams
   while (1)
   {
      _tprintf(_T("stream '%s' of size %I64u\n"),
               ffStream.cStreamName,
               ffStream.Size);

      if (!FindNextStream(hFindStream, &ffStream))
         if (GetLastError() == ERROR_NO_MORE_FILES)
            break;
         else
         {
            _tprintf(_T("Error getting next stream data %u\n"),
                     GetLastError());
            break;
         }
   }

   // Close the handle
   FindCloseStream(hFindStream);

   return 0;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumStreams/FindStream.c File Reference

  • WinBase
  • IO
  • EnumStreams
Classes | Defines | Typedefs | Functions

FindStream.c File Reference

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "findstream.h"

Go to the source code of this file.

Classes

struct | _FFSTREAM

Defines

#define | DATASUFFIX _T(":$DATA")
#define | FFSTREAMMAGIC 0x54534646
#define | lenof(x) ((sizeof(x) / sizeof(TCHAR)) - 1)

Typedefs

typedef struct _FFSTREAM | FFSTREAM
typedef struct _FFSTREAM * | LPFFSTREAM

Functions

BOOL | FindCloseStream (HANDLE hFindStream)
HANDLE | FindFirstStream (LPCTSTR lpFileName, LPSTREAM_FIND_DATA lpFindStreamData)
BOOL | FindNextStream (HANDLE hFindStream, LPSTREAM_FIND_DATA lpFindStreamData)

Define Documentation

#define DATASUFFIX _T(":$DATA")

Definition at line 38 of file FindStream.c.

#define FFSTREAMMAGIC 0x54534646

Definition at line 25 of file FindStream.c.

#define lenof ( x ) ((sizeof(x) / sizeof(TCHAR)) - 1)

Definition at line 35 of file FindStream.c.

Typedef Documentation

typedef struct _FFSTREAM FFSTREAM
typedef struct _FFSTREAM * LPFFSTREAM

Function Documentation

BOOL FindCloseStream ( HANDLE hFindStream )

Definition at line 332 of file FindStream.c.

{
   LPFFSTREAM lpFFStream = (LPFFSTREAM)hFindStream;

   // verify that the passed structure is a FFSTREAM structure...
   if (lpFFStream->dwFFStreamMagic != FFSTREAMMAGIC)
   {
      SetLastError(ERROR_INVALID_HANDLE);
      return FALSE;
   }

   // Release the context memory
   BackupRead(0, NULL, 0, NULL, TRUE, FALSE, &(lpFFStream->lpContext));

   // Close the file handle
   CloseHandle(lpFFStream->hFile);

   // obliterate the magic number of handle making it invalid...
   lpFFStream->dwFFStreamMagic = 0;

   // Free the handle...
   HeapFree(GetProcessHeap(), 0, lpFFStream);

   return TRUE;
}

HANDLE FindFirstStream | ( | LPCTSTR | lpFileName,
 |  | LPSTREAM_FIND_DATA | lpFindStreamData
 | ) |  |

Definition at line 222 of file FindStream.c.

{
   LPFFSTREAM lpFFStream;

   if ((lpFFStream = HeapAlloc(GetProcessHeap(), 0, sizeof(FFSTREAM))) == NULL)
   {
      SetLastError(ERROR_OUTOFMEMORY);
      return INVALID_HANDLE_VALUE;
   }

   // set the magic number which mark the handle as valid...
   lpFFStream->dwFFStreamMagic = FFSTREAMMAGIC;
   lpFFStream->lpContext = NULL;

   if ((lpFFStream->hFile = CreateFile(lpFileName, GENERIC_READ,
                                       FILE_SHARE_READ | FILE_SHARE_WRITE,
                                       NULL, OPEN_EXISTING,
                                       FILE_FLAG_BACKUP_SEMANTICS, NULL)) ==
       INVALID_HANDLE_VALUE)
   {
      HeapFree(GetProcessHeap(), 0, lpFFStream);
      // pass on error from CreateFile...
      return INVALID_HANDLE_VALUE;
   }

   if (!ffproc(lpFFStream, lpFindStreamData))
   {
      // free resource on failure...
      CloseHandle(lpFFStream->hFile);

      HeapFree(GetProcessHeap(), 0, lpFFStream);

      // pass on error...
      if (GetLastError() == ERROR_NO_MORE_FILES)
         SetLastError(ERROR_FILE_NOT_FOUND);
      return INVALID_HANDLE_VALUE;
   }

   return (HANDLE)lpFFStream;
}

BOOL FindNextStream | ( | HANDLE | hFindStream,
 |  | LPSTREAM_FIND_DATA | lpFindStreamData
 | ) |  |

Definition at line 293 of file FindStream.c.

{
   LPFFSTREAM lpFFStream = (LPFFSTREAM)hFindStream;

   // verify that the passed structure is a FFSTREAM structure...
   if (lpFFStream->dwFFStreamMagic != FFSTREAMMAGIC)
   {
      SetLastError(ERROR_INVALID_HANDLE);
      return FALSE;
   }

   if (!ffproc(lpFFStream, lpFindStreamData))
   {
      // pass on error...
      return FALSE;
   }

   return TRUE;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumStreams/FindStream.h File Reference

  • WinBase
  • IO
  • EnumStreams
Classes | Typedefs | Functions

FindStream.h File Reference

Go to the source code of this file.

Classes

struct | _STREAM_FIND_DATA

Typedefs

typedef struct _STREAM_FIND_DATA * | LPSTREAM_FIND_DATA
typedef struct _STREAM_FIND_DATA | STREAM_FIND_DATA

Functions

BOOL | FindCloseStream (HANDLE hFindStream)
HANDLE | FindFirstStream (LPCTSTR lpFileName, LPSTREAM_FIND_DATA lpFindStreamData)
BOOL | FindNextStream (HANDLE hFindStream, LPSTREAM_FIND_DATA lpFindStreamData)

Typedef Documentation

typedef struct _STREAM_FIND_DATA * LPSTREAM_FIND_DATA
typedef struct _STREAM_FIND_DATA STREAM_FIND_DATA

Function Documentation

BOOL FindCloseStream ( HANDLE hFindStream )

Definition at line 332 of file FindStream.c.

{
   LPFFSTREAM lpFFStream = (LPFFSTREAM)hFindStream;

   // verify that the passed structure is a FFSTREAM structure...
   if (lpFFStream->dwFFStreamMagic != FFSTREAMMAGIC)
   {
      SetLastError(ERROR_INVALID_HANDLE);
      return FALSE;
   }

   // Release the context memory
   BackupRead(0, NULL, 0, NULL, TRUE, FALSE, &(lpFFStream->lpContext));

   // Close the file handle
   CloseHandle(lpFFStream->hFile);

   // obliterate the magic number of handle making it invalid...
   lpFFStream->dwFFStreamMagic = 0;

   // Free the handle...
   HeapFree(GetProcessHeap(), 0, lpFFStream);

   return TRUE;
}

HANDLE FindFirstStream | ( | LPCTSTR | lpFileName,
 |  | LPSTREAM_FIND_DATA | lpFindStreamData
 | ) |  |

Definition at line 222 of file FindStream.c.

{
   LPFFSTREAM lpFFStream;

   if ((lpFFStream = HeapAlloc(GetProcessHeap(), 0, sizeof(FFSTREAM))) == NULL)
   {
      SetLastError(ERROR_OUTOFMEMORY);
      return INVALID_HANDLE_VALUE;
   }

   // set the magic number which mark the handle as valid...
   lpFFStream->dwFFStreamMagic = FFSTREAMMAGIC;
   lpFFStream->lpContext = NULL;

   if ((lpFFStream->hFile = CreateFile(lpFileName, GENERIC_READ,
                                       FILE_SHARE_READ | FILE_SHARE_WRITE,
                                       NULL, OPEN_EXISTING,
                                       FILE_FLAG_BACKUP_SEMANTICS, NULL)) ==
       INVALID_HANDLE_VALUE)
   {
      HeapFree(GetProcessHeap(), 0, lpFFStream);
      // pass on error from CreateFile...
      return INVALID_HANDLE_VALUE;
   }

   if (!ffproc(lpFFStream, lpFindStreamData))
   {
      // free resource on failure...
      CloseHandle(lpFFStream->hFile);

      HeapFree(GetProcessHeap(), 0, lpFFStream);

      // pass on error...
      if (GetLastError() == ERROR_NO_MORE_FILES)
         SetLastError(ERROR_FILE_NOT_FOUND);
      return INVALID_HANDLE_VALUE;
   }

   return (HANDLE)lpFFStream;
}

BOOL FindNextStream | ( | HANDLE | hFindStream,
 |  | LPSTREAM_FIND_DATA | lpFindStreamData
 | ) |  |

Definition at line 293 of file FindStream.c.

{
   LPFFSTREAM lpFFStream = (LPFFSTREAM)hFindStream;

   // verify that the passed structure is a FFSTREAM structure...
   if (lpFFStream->dwFFStreamMagic != FFSTREAMMAGIC)
   {
      SetLastError(ERROR_INVALID_HANDLE);
      return FALSE;
   }

   if (!ffproc(lpFFStream, lpFindStreamData))
   {
      // pass on error...
      return FALSE;
   }

   return TRUE;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/FCopy/FCopy.Cpp File Reference

  • WinBase
  • IO
  • FCopy
Defines | Functions | Variables

FCopy.Cpp File Reference

#include <windows.h>
#include <stdio.h>
#include <crtdbg.h>

Go to the source code of this file.

Defines

#define | DEBUG_PRINT(X)
#define | WIN32_LEAN_AND_MEAN

Functions

int | main (int argc, char **argv)

Variables

const WORD | ALLOCATION_MULTIPLIER = 1
DWORD dwMaxViewSize
const int | FAILURE = 1
const int | SUCCESS = 0

Define Documentation

#define DEBUG_PRINT ( X )

Definition at line 33 of file FCopy.Cpp.

#define WIN32_LEAN_AND_MEAN

Definition at line 24 of file FCopy.Cpp.

Function Documentation

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 64 of file FCopy.Cpp.

{
   int   fResult = FAILURE;

   SYSTEM_INFO siSystemInfo ;
   DWORD dwMaxViewSize ;

   ULARGE_INTEGER liSrcFileSize,
                  liBytesRemaining,
                  liMapSize,
                  liOffset;

   HANDLE hSrcFile    = INVALID_HANDLE_VALUE,
          hDstFile    = INVALID_HANDLE_VALUE,
          hSrcMap     = 0,
          hDstMap     = 0;

   BYTE * pSrc = 0,
        * pDst = 0;

   char * pszSrcFileName = 0,
        * pszDstFileName = 0;

   if (argc != 3)
   {
      printf("usage: fcopy <srcfile> <dstfile>\n");
      return (FAILURE);
   }

   pszSrcFileName = argv[argc-2];  // Src is second to last argument
   pszDstFileName = argv[argc-1];  // Dst is the last argument

   // Obtain the system's allocation granularity, then multiply it by an
   // arbitrary factor to obtain the maximum view size
   GetSystemInfo(&siSystemInfo);
   dwMaxViewSize = siSystemInfo.dwAllocationGranularity * ALLOCATION_MULTIPLIER;

   /*
      Steps to open and access a file's contents:
         1) Open the file,
         2) Create a mapping of the file,
         3) Map a view of the file.

      This yields a pointer to the file's contents, which can then be used
      to access the file, just as if it's contents were in a memory buffer.

      For the source file, open and map it as read only; for the destination
      file, open and map it as read-write.  We allow other processes to read
      the source file while we're copying it, but do not allow access to the
      destination file since we're writing it.
   */

   // Open the source and destination files
   hSrcFile = CreateFile (pszSrcFileName, GENERIC_READ, FILE_SHARE_READ,
                          0, OPEN_EXISTING, 0, 0);
   if (INVALID_HANDLE_VALUE == hSrcFile)
   {
      printf("fcopy: couldn't open source file.\n");
      goto DONE;
   }

   hDstFile = CreateFile (pszDstFileName, GENERIC_READ|GENERIC_WRITE, 0,
                          0, CREATE_ALWAYS, 0, 0);
   if (INVALID_HANDLE_VALUE == hDstFile)
   {
      printf("fcopy: couldn't create destination file.\n");
      goto DONE;
   }

   // Need source file's size to know how big to make the destination mapping.
   liSrcFileSize.LowPart = GetFileSize(hSrcFile, &liSrcFileSize.HighPart);
   if ( (-1 == liSrcFileSize.LowPart) && (GetLastError() != NO_ERROR) )
   {
      DEBUG_PRINT("couldn't get size of source file.\n");
      goto DONE;
   }

   /*
      Special case:  If the source file is zero bytes, we don't map it because
      there's no need to and CreateFileMapping cannot map a zero-length file.
      But since we've created the destination, we've successfully "copied" the
      source.
   */
   if (0 == liSrcFileSize.QuadPart)
   {
      fResult = SUCCESS;
      goto DONE;
   }

   /*
      Map the source and destination files.  A mapping size of zero means the
      whole file will be mapped.
   */
   hSrcMap = CreateFileMapping (hSrcFile, 0, PAGE_READONLY, 0, 0, 0);
   if (!hSrcMap)
   {
      DEBUG_PRINT("couldn't map source file\n");
      goto DONE;
   }

   hDstMap = CreateFileMapping (hDstFile, 0, PAGE_READWRITE,
                                liSrcFileSize.HighPart,
                                liSrcFileSize.LowPart, 0);
   if (!hDstMap)
   {
      DEBUG_PRINT("couldn't map destination file.\n");
      goto DONE;
   }

   /*
      Now that we have the source and destination mapping objects, map views
      of the source and destination files, and do the file copy.

      To minimize the amount of memory consumed for large files and make it
      possible to copy files that couldn't be mapped into our virtual address
      space entirely (those over 2GB), we limit the source and destination
      views to the smaller of the file size or a specified maximum view size
      (dwMaxViewSize, which is ALLOCATION_MULTIPLIER times the system's
      allocation size).

      If the file is smaller than the max view size, we'll just map and copy
      it.  Otherwise, we'll map a portion of the file, copy it, then map the
      next portion, copy it, etc. until the entire file is copied.

      MAP_SIZE is 32 bits because MapViewOfFile requires a 32-bit value for
      the size of the view.  This makes sense because a Win32 process's
      address space is 4GB, of which only 2GB (2^31) bytes may be used by the
      process.  However, for the sake of making 64-bit arithmetic work below
      for file offets, we need to make sure that all 64 bits of liMapSize
      are initialized correctly.

      Note structured exception handling is used in case a MapViewOfFile call
      failed.  That should never happen in this program, but in case it does,
      we should handle it.  Since the possibility is so remote, it is faster
      to handle the exception when it occurs rather than test for failure in
      the loop.
   */
   __try
   {
      liBytesRemaining.QuadPart = liSrcFileSize.QuadPart;

      // stan bug fix
      liMapSize.QuadPart        = dwMaxViewSize;

      // Make sure that the arithmetic below is correct during debugging.
      _ASSERT(liMapSize.HighPart == 0);

      do
      {
         liMapSize.QuadPart = min(liBytesRemaining.QuadPart, liMapSize.QuadPart);

         liOffset.QuadPart = liSrcFileSize.QuadPart - liBytesRemaining.QuadPart;

         pSrc = (BYTE *)MapViewOfFile (hSrcMap, FILE_MAP_READ, liOffset.HighPart,
                                       liOffset.LowPart, liMapSize.LowPart);

         pDst = (BYTE *)MapViewOfFile (hDstMap, FILE_MAP_WRITE, liOffset.HighPart,
                                       liOffset.LowPart, liMapSize.LowPart);

         CopyMemory (pDst, pSrc, liMapSize.LowPart);

         UnmapViewOfFile (pSrc);
         UnmapViewOfFile (pDst);

         liBytesRemaining.QuadPart -= liMapSize.QuadPart;
      }
      while (liBytesRemaining.QuadPart > 0);

      fResult = SUCCESS;
   }
   __except (EXCEPTION_EXECUTE_HANDLER)
   {
      /*
         Only way we should get here is if a MapViewOfFile failed.  That
         shouldn't happen, but in case it does clean up the resources.
      */
      if (pSrc)
         UnmapViewOfFile (pSrc);

      if (pDst)
         UnmapViewOfFile (pDst);
   }

DONE:
   /* Clean up all outstanding resources.  Note views are already unmapped. */
   if (hDstMap)
      CloseHandle (hDstMap);

   if (hDstFile != INVALID_HANDLE_VALUE)
      CloseHandle (hDstFile);

   if (hSrcMap)
      CloseHandle (hSrcMap);

   if (hSrcFile != INVALID_HANDLE_VALUE)
      CloseHandle (hSrcFile);

   // Report to user only if a problem occurred.
   if (fResult != SUCCESS)
   {
      printf("fcopy: copying failed.\n");
      DeleteFile (pszDstFileName);
   }

   return (fResult);
}

Variable Documentation

const WORD ALLOCATION_MULTIPLIER = 1

Definition at line 43 of file FCopy.Cpp.

DWORD dwMaxViewSize

Definition at line 39 of file FCopy.Cpp.

const int FAILURE = 1

Definition at line 46 of file FCopy.Cpp.

const int SUCCESS = 0

Definition at line 45 of file FCopy.Cpp.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/Floppy/Mfmt.c File Reference

  • WinBase
  • IO
  • Floppy
Functions | Variables

Mfmt.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <winioctl.h>
#include <string.h>
#include <ctype.h>
#include <memory.h>

Go to the source code of this file.

Functions

BOOL | DismountVolume (HANDLE hDisk)
BOOL | GetDiskGeometry (HANDLE hDisk, PDISK_GEOMETRY lpGeometry)
DWORD | GetSupportedGeometrys (HANDLE hDisk)
BOOL | LockVolume (HANDLE hDisk)
BOOL | LowLevelFormat (HANDLE hDisk, PDISK_GEOMETRY lpGeometry)
DWORD _cdecl | main (int argc, char *argv[], char *envp[])
VOID | PrintGeometry (LPSTR lpDriveName, PDISK_GEOMETRY lpGeometry)
BOOL | UnlockVolume (HANDLE hDisk)

Variables

DISK_GEOMETRY | SupportedGeometry [20]
DWORD SupportedGeometryCount

Function Documentation

BOOL DismountVolume ( HANDLE hDisk )

Definition at line 240 of file Mfmt.c.

{
   DWORD ReturnedByteCount;

   return DeviceIoControl(
                         hDisk,
                         FSCTL_DISMOUNT_VOLUME,
                         NULL,
                         0,
                         NULL,
                         0,
                         &ReturnedByteCount,
                         NULL
                         );
}

BOOL GetDiskGeometry | ( | HANDLE | hDisk,
 |  | PDISK_GEOMETRY | lpGeometry
 | ) |  |

Definition at line 66 of file Mfmt.c.

{
   DWORD ReturnedByteCount;

   return DeviceIoControl(
                         hDisk,
                         IOCTL_DISK_GET_DRIVE_GEOMETRY,
                         NULL,
                         0,
                         lpGeometry,
                         sizeof(*lpGeometry),
                         &ReturnedByteCount,
                         NULL
                         );
}

DWORD GetSupportedGeometrys ( HANDLE hDisk )

Definition at line 87 of file Mfmt.c.

{
   DWORD ReturnedByteCount;
   BOOL b;
   DWORD NumberSupported;

   b = DeviceIoControl(
                      hDisk,
                      IOCTL_DISK_GET_MEDIA_TYPES,
                      NULL,
                      0,
                      SupportedGeometry,
                      sizeof(SupportedGeometry),
                      &ReturnedByteCount,
                      NULL
                      );
   if ( b )
   {
      NumberSupported = ReturnedByteCount / sizeof(DISK_GEOMETRY);
   }
   else
   {
      NumberSupported = 0;
   }
   SupportedGeometryCount = NumberSupported;

   return NumberSupported;
}

BOOL LockVolume ( HANDLE hDisk )

Definition at line 202 of file Mfmt.c.

{
   DWORD ReturnedByteCount;

   return DeviceIoControl(
                         hDisk,
                         FSCTL_LOCK_VOLUME,
                         NULL,
                         0,
                         NULL,
                         0,
                         &ReturnedByteCount,
                         NULL
                         );
}

BOOL LowLevelFormat | ( | HANDLE | hDisk,
 |  | PDISK_GEOMETRY | lpGeometry
 | ) |  |

Definition at line 156 of file Mfmt.c.

{
   FORMAT_PARAMETERS FormatParameters;
   PBAD_TRACK_NUMBER lpBadTrack;
   UINT i;
   BOOL b;
   DWORD ReturnedByteCount;

   FormatParameters.MediaType = lpGeometry->MediaType;
   FormatParameters.StartHeadNumber = 0;
   FormatParameters.EndHeadNumber = lpGeometry->TracksPerCylinder - 1;
   lpBadTrack = (PBAD_TRACK_NUMBER) LocalAlloc(LMEM_ZEROINIT,lpGeometry->TracksPerCylinder*sizeof(*lpBadTrack));

   for (i = 0; i < lpGeometry->Cylinders.LowPart; i++)
   {

      FormatParameters.StartCylinderNumber = i;
      FormatParameters.EndCylinderNumber = i;

      b = DeviceIoControl(
                         hDisk,
                         IOCTL_DISK_FORMAT_TRACKS,
                         &FormatParameters,
                         sizeof(FormatParameters),
                         lpBadTrack,
                         lpGeometry->TracksPerCylinder*sizeof(*lpBadTrack),
                         &ReturnedByteCount,
                         NULL
                         );

      if (!b )
      {
         LocalFree(lpBadTrack);
         return b;
      }
   }

   LocalFree(lpBadTrack);

   return TRUE;
}

DWORD _cdecl main | ( | int | argc,
 |  | char * | argv[],
 |  | char * | envp[]
 | ) |  |

Definition at line 260 of file Mfmt.c.

{
   char Drive[MAX_PATH];
   HANDLE hDrive, hDiskImage;
   DISK_GEOMETRY Geometry;
   UINT i;
   char c, *p;
   LPSTR DriveName;
   BOOL fUsage = TRUE;
   BOOL fShowGeometry = FALSE;
   BOOL fDiskImage = FALSE;
   BOOL SourceIsDrive;
   LPSTR Source, Destination, DiskImage;

   if ( argc > 1 )
   {
      fUsage = FALSE;
      while (--argc > 0 )
      {
         p = *++argv;
         if (*p == '/' || *p == '-')
         {
            while (c = *++p)
               switch (toupper( c ))
               {
               case '?':
                  fUsage = TRUE;
                  break;

               case 'C':
                  fDiskImage = TRUE;
                  argc--, argv++;
                  Source = *argv;
                  argc--, argv++;
                  Destination = *argv;
                  break;

               case 'G':
                  argc--, argv++;
                  if ( (DriveName = *argv ) && *DriveName &&
                       isalpha(*DriveName) )
                     fShowGeometry = TRUE;
                  else
                  {
                     printf( "MFMT: Missing drive letter after -G\n" );
                     DriveName = NULL;
                     fUsage = TRUE;
                  }
                  break;

               default:
                  printf("MFMT: Invalid switch - /%c\n", c );
                  fUsage = TRUE;
                  break;
               }
         }
      }
   }

   if ( fUsage )
   {
      printf("usage: MFMT switches \n" );
      printf("            [-?] display this message\n" );
      printf("            [-g drive] shows disk geometry\n" );
      printf("            [-c source destination] produce diskimage\n" );
      ExitProcess(1);
   }

   if ( fShowGeometry )
   {
      sprintf(Drive,"\\\\.\\%s",DriveName);
      hDrive = CreateFile(
                         Drive,
                         GENERIC_READ | GENERIC_WRITE,
                         FILE_SHARE_READ|FILE_SHARE_WRITE,
                         NULL,
                         OPEN_EXISTING,
                         0,
                         NULL
                         );
      if ( hDrive == INVALID_HANDLE_VALUE )
      {
         printf("MFMT: Open %s failed %d\n",DriveName,GetLastError());
         ExitProcess(1);
      }

      if ( LockVolume(hDrive) == FALSE )
      {
         printf("MFMT:Locking volume %s failed %d\n", DriveName, GetLastError());
         ExitProcess(1);
      }

      if ( !GetDiskGeometry(hDrive,&Geometry) )
      {
         printf("MFMT: GetDiskGeometry %s failed %d\n",DriveName,GetLastError());
         ExitProcess(1);
      }
      PrintGeometry(DriveName,&Geometry);

      if ( !GetSupportedGeometrys(hDrive) )
      {
         printf("MFMT: GetSupportedGeometrys %s failed %d\n",DriveName,GetLastError());
         ExitProcess(1);
      }
      printf("\nDrive %s supports the following disk geometries\n",DriveName);

      for (i=0;i<SupportedGeometryCount;i++)
      {
         printf("\n");
         PrintGeometry(NULL,&SupportedGeometry[i]);
      }

      printf("\n");
      ExitProcess(0);
   }

   if ( fDiskImage )
   {
      SourceIsDrive = FALSE;
      if ( Source[strlen(Source)-1] == ':' )
      {
         SourceIsDrive = TRUE;
         sprintf(Drive,"\\\\.\\%s",Source);
         DriveName=Source;
         DiskImage = Destination;
      }
      if ( Destination[strlen(Destination)-1] == ':' )
      {
         if ( SourceIsDrive )
         {
            printf("MFMT: Source and Destination cannot both be drives\n");
            ExitProcess(1);
         }
         SourceIsDrive = FALSE;
         sprintf(Drive,"\\\\.\\%s",Destination);
         DriveName=Destination;
         DiskImage = Source;
      }
      else
      {
         if ( !SourceIsDrive )
         {
            printf("MFMT: Either Source or Destination must be a drive\n");
            ExitProcess(1);
         }
      }

      //
      // Open and Lock the drive
      //

      hDrive = CreateFile(
                         Drive,
                         GENERIC_READ | GENERIC_WRITE,
                         FILE_SHARE_READ|FILE_SHARE_WRITE,
                         NULL,
                         OPEN_EXISTING,
                         0,
                         NULL
                         );
      if ( hDrive == INVALID_HANDLE_VALUE )
      {
         printf("MFMT: Open %s failed %d\n",DriveName,GetLastError());
         ExitProcess(1);
      }
      if ( LockVolume(hDrive) == FALSE )
      {
         printf("MFMT: LockVolume %s failed %d\n",DriveName,GetLastError());
         ExitProcess(1);
      }

      if ( !GetDiskGeometry(hDrive,&Geometry) )
      {
         printf("MFMT: GetDiskGeometry %s failed %d\n",DriveName,GetLastError());
         ExitProcess(1);
      }

      if ( !GetSupportedGeometrys(hDrive) )
      {
         printf("MFMT: GetSupportedGeometrys %s failed %d\n",DriveName,GetLastError());
         ExitProcess(1);
      }

      //
      // Open the disk image file
      //

      hDiskImage = CreateFile(
                             DiskImage,
                             GENERIC_READ | GENERIC_WRITE,
                             0,
                             NULL,
                             SourceIsDrive ? CREATE_ALWAYS : OPEN_EXISTING,
                             0,
                             NULL
                             );
      if ( hDiskImage == INVALID_HANDLE_VALUE )
      {
         printf("MFMT: Open %s failed %d\n",DiskImage,GetLastError());
         ExitProcess(1);
      }

      //
      // Now do the copy
      //
      {
         LPVOID IoBuffer;
         BOOL b;
         DWORD BytesRead, BytesWritten;
         DWORD FileSize;
         DWORD VirtBufSize;
         DWORD NumBufs;

         //
         // If we are copying from floppy to file, just do the copy
         // Otherwise, we might have to format the floppy first
         //

         if ( SourceIsDrive )
         {

            //
            // Device reads must be sector aligned. VirtualAlloc will
            // garuntee alignment
            //

            NumBufs = Geometry.Cylinders.LowPart;
            VirtBufSize =  Geometry.TracksPerCylinder *
                           Geometry.SectorsPerTrack *
                           Geometry.BytesPerSector;

            IoBuffer = VirtualAlloc(NULL,VirtBufSize,MEM_COMMIT,PAGE_READWRITE);

            if ( !IoBuffer )
            {
               printf("MFMT: Buffer Allocation Failed\n");
               ExitProcess(1);
            }

            for ( ;NumBufs > 0; NumBufs-- )
            {
               b = ReadFile(hDrive,IoBuffer, VirtBufSize, &BytesRead, NULL);
               if (b && BytesRead)
               {
                  b = WriteFile(hDiskImage,IoBuffer, BytesRead, &BytesWritten, NULL);
                  if ( !b || ( BytesRead != BytesWritten ) )
                  {
                     printf("MFMT: Fatal Write Error %d\n",GetLastError());
                     ExitProcess(1);
                  }
               }
               else
               {
                  printf("MFMT: Fatal Read Error %d\n",GetLastError());
                  ExitProcess(1);
               }
            }
         }
         else
         {

            //
            // Check to see if the image will fit on the floppy. If it
            // will, then LowLevelFormat the floppy and press on
            //

            FileSize = GetFileSize(hDiskImage,NULL);

            b = FALSE;
            for (i=0;i<SupportedGeometryCount;i++)
            {
               NumBufs = SupportedGeometry[i].Cylinders.LowPart;
               VirtBufSize =  SupportedGeometry[i].TracksPerCylinder *
                              SupportedGeometry[i].SectorsPerTrack *
                              SupportedGeometry[i].BytesPerSector;
               if ( VirtBufSize*NumBufs >= FileSize )
               {

                  IoBuffer = VirtualAlloc(NULL,VirtBufSize,MEM_COMMIT,PAGE_READWRITE);

                  if ( !IoBuffer )
                  {
                     printf("MFMT: Buffer Allocation Failed\n");
                     ExitProcess(1);
                  }

                  //
                  // Format the floppy
                  //

                  LowLevelFormat(hDrive,&SupportedGeometry[i]);

                  for ( ;NumBufs > 0; NumBufs-- )
                  {
                     b = ReadFile(hDiskImage,IoBuffer, VirtBufSize, &BytesRead, NULL);
                     if (b && BytesRead)
                     {
                        b = WriteFile(hDrive,IoBuffer, BytesRead, &BytesWritten, NULL);
                        if ( !b || ( BytesRead != BytesWritten ) )
                        {
                           printf("MFMT: Fatal Write Error %d\n",GetLastError());
                           ExitProcess(1);
                        }
                     }
                     else
                     {
                        printf("MFMT: Fatal Read Error %d\n",GetLastError());
                        ExitProcess(1);
                     }
                  }
                  b = TRUE;
                  break;
               }
            }

            if ( !b )
            {
               printf("MFMT: FileSize %d is not supported on drive %s\n",FileSize,DriveName);
               ExitProcess(1);
            }
         }
      }

      //
      // Dismounting forces the filesystem to re-evaluate the media id
      // and geometry. This is the same as popping the floppy in and out
      // of the disk drive
      //

      DismountVolume(hDrive);
      UnlockVolume(hDrive);

      ExitProcess(0);
   }
   return (0);
}

VOID PrintGeometry | ( | LPSTR | lpDriveName,
 |  | PDISK_GEOMETRY | lpGeometry
 | ) |  |

Definition at line 119 of file Mfmt.c.

{
   LPSTR MediaType;

   if (lpDriveName)
   {
      printf("Geometry for Drive %s\n",lpDriveName);
   }

   switch ( lpGeometry->MediaType )
   {
   case F5_1Pt2_512:  MediaType = "5.25, 1.2MB,  512 bytes/sector";break;
   case F3_1Pt44_512: MediaType = "3.5,  1.44MB, 512 bytes/sector";break;
   case F3_2Pt88_512: MediaType = "3.5,  2.88MB, 512 bytes/sector";break;
   case F3_20Pt8_512: MediaType = "3.5,  20.8MB, 512 bytes/sector";break;
   case F3_720_512:   MediaType = "3.5,  720KB,  512 bytes/sector";break;
   case F5_360_512:   MediaType = "5.25, 360KB,  512 bytes/sector";break;
   case F5_320_512:   MediaType = "5.25, 320KB,  512 bytes/sector";break;
   case F5_320_1024:  MediaType = "5.25, 320KB,  1024 bytes/sector";break;
   case F5_180_512:   MediaType = "5.25, 180KB,  512 bytes/sector";break;
   case F5_160_512:   MediaType = "5.25, 160KB,  512 bytes/sector";break;
   case RemovableMedia: MediaType = "Removable media other than floppy";break;
   case FixedMedia:   MediaType = "Fixed hard disk media";break;
   default:           MediaType = "Unknown";break;
   }
   printf("    Media Type %s\n",MediaType);
   printf("    Cylinders %d Tracks/Cylinder %d Sectors/Track %d\n",
          lpGeometry->Cylinders.LowPart,
          lpGeometry->TracksPerCylinder,
          lpGeometry->SectorsPerTrack
         );
}

BOOL UnlockVolume ( HANDLE hDisk )

Definition at line 221 of file Mfmt.c.

{
   DWORD ReturnedByteCount;

   return DeviceIoControl(
                         hDisk,
                         FSCTL_UNLOCK_VOLUME,
                         NULL,
                         0,
                         NULL,
                         0,
                         &ReturnedByteCount,
                         NULL
                         );
}

Variable Documentation

DISK_GEOMETRY SupportedGeometry[20]

Definition at line 62 of file Mfmt.c.

DWORD SupportedGeometryCount

Definition at line 63 of file Mfmt.c.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/Mount/Mount.Cpp File Reference

  • WinBase
  • IO
  • Mount
Defines | Functions

Mount.Cpp File Reference

#include <windows.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define | DEBUG_PRINT(pszMsg, dwErr) NULL

Functions

void | DebugPrint (LPCSTR pszMsg, DWORD dwErr)
int | main (int argc, char **argv)

Define Documentation

#define DEBUG_PRINT | ( | pszMsg,
 |  | dwErr |
 | ) |  | NULL

Definition at line 31 of file Mount.Cpp.

Function Documentation

void DebugPrint | ( | LPCSTR | pszMsg,
 |  | DWORD | dwErr
 | ) |  |

Definition at line 245 of file Mount.Cpp.

{
   if (dwErr)
      printf("%s: %lu\n", pszMsg, dwErr);
   else
      printf("%s\n", pszMsg);
}

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 35 of file Mount.Cpp.

{
   bool  bOverwriteMount;
   char *pszMountDir;
   char *pszDriveToMount;
   char *pszOptions;

   // Make sure user has supplied required number of command-line arguments.
   if (argc != 3 && argc != 4)
   {
      PrintHelp ();
      return (-1);
   }

   /*
      Since we have at least 3 args, we can initialize the pointers to them.
      We use pointers to explicitly refer to the arguments to make the rest
      of the code more understandable.
   */
   pszMountDir     = argv[argc-1];
   pszDriveToMount = argv[argc-2];
   pszOptions      = argv[argc-3];

   // See if "-o" is present in command line.  It must be the second argument.
   bOverwriteMount = (argc == 4 && !lstrcmpi (pszOptions, "-o"));

   /*
      If bOverwriteMount != TRUE (i.e. user wants to keep an existing
      mount point), then need to check destination to see if it exists and
      if it is a mount point. If so, don't create a volume mount point on it.

      The way to tell if a directory is a mount point is to:

       1) Call FindFirstFile().
       2) If WIN32_FIND_DATA.dwFileAttributes contains
          FILE_ATTRIBUTE_REPARSE_POINT see if WIN32_FIND_DATA.dwReserved0
          is IO_REPARSE_TAG_MOUNT_POINT.
       3) If so, then the directory is a mount point.
   */
   if (!bOverwriteMount)
   {
      WIN32_FIND_DATA fileInfo;
      HANDLE          hFind;

      hFind = FindFirstFile (pszMountDir, &fileInfo);
      if (INVALID_HANDLE_VALUE != hFind)
      {
         FindClose(hFind);  // Don't need the find handle anymore.

         /*
            If the destination is a mount point, tell user we're not going
            to replace it, and then exit.
         */
         if ((fileInfo.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) &&
             (fileInfo.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT))
         {
            printf("%s is already a mount point; it will not be replaced\n",
                   pszMountDir);
            return (0);
         }
      }
      /*
         If hFind == INVALID_HANDLE_VALUE here, we didn't find the directory
         to be the mount point. We could exit here, but we won't.  We'll
         just keep going because CreateMountPoint will fail the creation of
         the mount point on the non-existant directory.
      */
   }

   /*
      Create the mount point.  Report whether we succeeded or failed.
   */
   if (CreateMountPoint (pszDriveToMount, pszMountDir))
      printf("mounted %s to %s\n", pszDriveToMount, pszMountDir);
   else
   {
      printf("couldn't mount %s to %s\n", pszDriveToMount, pszMountDir);
      DEBUG_PRINT ("CreateMountPoint failed with error", GetLastError());
   }

   return (0);
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/Mount/UnMount.Cpp File Reference

  • WinBase
  • IO
  • Mount
Functions

UnMount.Cpp File Reference

#include <windows.h>
#include <stdio.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 23 of file UnMount.Cpp.

{
   char *pszMountToDelete;
   char *pszDirName = NULL;
   int   cchDirLen;

   // Make sure user suppled proper command-line arguments.
   if (argc != 2)
   {
      PrintHelp();
      return (-1);
   }

   /*
      Make sure there are enough command-line arguments before
      dereferencing argv[1].
   */
   pszMountToDelete = argv[1];

   /*
      Add trailing backslashes to the mount point directory name
      because volume mount point APIs require them.

      If the directory name doesn't already have a trailing backslash, we
      just copy it to a new buffer and add the trailing backslash.
   */
   cchDirLen = lstrlen(pszMountToDelete);
   if (pszMountToDelete[cchDirLen - 1] != '\\')
   {
      pszDirName = new char[cchDirLen + 2]; // +2 for backslash and NULL
      lstrcpy (pszDirName, pszMountToDelete);
      pszDirName[cchDirLen] = '\\';
      pszDirName[cchDirLen+1] = '\0';
   }
   else
      pszDirName = (char *)pszMountToDelete;  // Cast away const

   // Delete the mount point here.
   if (DeleteVolumeMountPoint (pszDirName))
      printf("unmounted %s\n", pszMountToDelete);
   else
      printf("couldn't unmount %s\n", pszMountToDelete);

   // Free pszDirName if it was allocated from free store
   if (pszDirName != pszMountToDelete)
      delete[] pszDirName;

   return (0);
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/app/app.cpp File Reference

  • WinBase
  • IO
  • RSM
  • app
Defines | Functions

app.cpp File Reference

#include <stdio.h>
#include <windows.h>
#include <strsafe.h>
#include <NtmsApi.h>
#include "..\inc\stl.h"

Go to the source code of this file.

Defines

#define | _UNICODE
#define | ADD_ACE_MASK_BITS 1
#define | ALLOCATE_WAIT 0
#define | DELETE_ACE 3
#define | LABEL_BUFFER_SIZE 1024
#define | MOUNT_WAIT INFINITE
#define | NO_CONTAINER NULL
#define | NULL_PARTID ((LPNTMS_NULLGUID)0)
#define | OUTPUT_BUFFER_WCHAR_SIZE NTMS_OBJECTNAME_LENGTH+5
#define | REMOVE_ACE_MASK_BITS 2
#define | REQUESTING_ONE_DISMOUNT REQUESTING_ONE_MOUNT
#define | REQUESTING_ONE_MOUNT 1
#define | SIZE_FOR_FIRST_TRY 5
#define | UNICODE

Functions

BOOL | EnumerateObjectType (HANDLE hSession, LPNTMS_GUID gContainer, DWORD dwType, LPNTMS_GUID &gList, DWORD &dwCount, DWORD &dwRetCode)
bool | findImportPool (HANDLE hSession, NTMS_GUID &gIpID, DWORD &dwRetCode)
bool | findLibrary (HANDLE hSession, NTMS_GUID &gLibID, DWORD &dwRetCode)
bool | findMediaType (HANDLE hSession, NTMS_GUID &gMediaID, DWORD &dwRetCode)
bool | GetOfflineLib (HANDLE hSession, NTMS_GUID &gLibID, DWORD &dwRetCode)
void | main ()
bool | OpenSessionWithWait (HANDLE &hSession, LPWSTR AppName, DWORD &dwRetCode)
void | persistMediaID (NTMS_GUID)
void | persistPoolID (NTMS_GUID)
NTMS_GUID | recallMediaID ()
NTMS_GUID | recallPoolID ()
void | SetNullGuid (NTMS_GUID *g)
DWORD | SetPoolDACL (HANDLE hSession, NTMS_GUID &gMediaPool, DWORD dwSubAuthority, DWORD dwAction, DWORD dwMask)
void | UseCase1 ()
void | UseCase2 ()
void | UseCase3 ()
void | UseCase4 ()
void | UseCase5 ()
void | UseCase6 ()
void | writeOmid (HANDLE, STL_LABEL *)

Define Documentation

#define _UNICODE

Definition at line 20 of file app.cpp.

#define ADD_ACE_MASK_BITS 1

Definition at line 37 of file app.cpp.

#define ALLOCATE_WAIT 0

Definition at line 31 of file app.cpp.

#define DELETE_ACE 3

Definition at line 39 of file app.cpp.

#define LABEL_BUFFER_SIZE 1024

Definition at line 35 of file app.cpp.

#define MOUNT_WAIT INFINITE

Definition at line 32 of file app.cpp.

#define NO_CONTAINER NULL

Definition at line 28 of file app.cpp.

#define NULL_PARTID ((LPNTMS_NULLGUID)0)

Definition at line 30 of file app.cpp.

#define OUTPUT_BUFFER_WCHAR_SIZE NTMS_OBJECTNAME_LENGTH+5

Definition at line 867 of file app.cpp.

#define REMOVE_ACE_MASK_BITS 2

Definition at line 38 of file app.cpp.

#define REQUESTING_ONE_DISMOUNT REQUESTING_ONE_MOUNT

Definition at line 34 of file app.cpp.

#define REQUESTING_ONE_MOUNT 1

Definition at line 33 of file app.cpp.

#define SIZE_FOR_FIRST_TRY 5

Definition at line 29 of file app.cpp.

#define UNICODE

Definition at line 21 of file app.cpp.

Function Documentation

BOOL EnumerateObjectType | ( | HANDLE | hSession,
 |  | LPNTMS_GUID | gContainer,
 |  | DWORD | dwType,
 |  | LPNTMS_GUID & | gList,
 |  | DWORD & | dwCount,
 |  | DWORD & | dwRetCode
 | ) |  |

Definition at line 162 of file app.cpp.

{

  // Get some memory for the buffer and try the enumerate.
  // If it succeeds then return, if the buffer isn't big
  // enough then free the memory and try again, if there is
  // some error then return.
  gList = NULL;
  dwCount = SIZE_FOR_FIRST_TRY;
  for(;;)
  {
    gList = (LPNTMS_GUID)malloc(dwCount*sizeof(NTMS_GUID));

    dwRetCode = EnumerateNtmsObject(hSession,
      gContainer,
      gList,
      &dwCount,
      dwType,
      0);

    if(dwRetCode == ERROR_SUCCESS)
      return TRUE;
    else if(dwRetCode == ERROR_INSUFFICIENT_BUFFER)
    {
      free(gList);
      continue;
    }
    else
    {
      free(gList);
      return FALSE;
    }
  }
}

bool findImportPool | ( | HANDLE | hSession,
 |  | NTMS_GUID & | gIpID,
 |  | DWORD & | dwRetCode
 | ) |  |

Definition at line 339 of file app.cpp.

{
  DWORD dwSize, i;
  NTMS_GUID *gPoolList = NULL, gTlPool, gMediaType, gAppPool;
  NTMS_OBJECTINFORMATION oiMediaPoolInfo;

  SetNullGuid(&gIpID);
  SetNullGuid(&gTlPool);

  // Get the list of top level pools
  if(!EnumerateObjectType(hSession, NO_CONTAINER, NTMS_MEDIA_POOL, gPoolList, dwSize, dwRetCode))
  {
    return(false);
  }

  // Go through the guid list and find the top level import pool
  oiMediaPoolInfo.dwSize = sizeof(oiMediaPoolInfo);
  oiMediaPoolInfo.dwType = NTMS_MEDIA_POOL;
  for (i=0; i < dwSize; ++i)
  {
    dwRetCode = GetNtmsObjectInformation(hSession,
      &(gPoolList[i]),
      &oiMediaPoolInfo);
    if(dwRetCode != ERROR_SUCCESS)
    {
      break;
    }
    if(oiMediaPoolInfo.Info.MediaPool.PoolType == NTMS_POOLTYPE_IMPORT)
    {
      gTlPool = gPoolList[i];
      break;
    }
  }

  free(gPoolList); // done with the list of top level pools

  // Did we find the import pool?
  if(!NTMS_IS_NULLGUID(gTlPool))
  {
    // Now we need to find the media-specific pool beneath the top level pool,
    // so get the list of pool GUIDS in the top level import pool
    if(!EnumerateObjectType(hSession, &gTlPool, NTMS_MEDIA_POOL, gPoolList, dwSize, dwRetCode))
      return(false);

    // Get the media type of the app pool
    gAppPool = recallPoolID();
    oiMediaPoolInfo.dwSize = sizeof(oiMediaPoolInfo);
    oiMediaPoolInfo.dwType = NTMS_MEDIA_POOL;
    dwRetCode = GetNtmsObjectInformation(hSession,
      &gAppPool,
      &oiMediaPoolInfo);
    if(dwRetCode == ERROR_SUCCESS)
    {
      gMediaType = oiMediaPoolInfo.Info.MediaPool.MediaType;

      // Go through the list of import pools and find subpool with proper media type
      for(i=0; i < dwSize; ++i)
      {
        dwRetCode = GetNtmsObjectInformation(hSession,
          &(gPoolList[i]),
          &oiMediaPoolInfo);
        if(dwRetCode != ERROR_SUCCESS)
        {
          break;
        }
        if(oiMediaPoolInfo.Info.MediaPool.MediaType == gMediaType)
        {
          gIpID = gPoolList[i];
          break;
        }
      }
    }
  }

  free(gPoolList); // done with the list of media specific import pools

  if(!NTMS_IS_NULLGUID(gIpID))
  {
    return(true);
  }
  else
  {
    if(dwRetCode == ERROR_SUCCESS)
    {
      dwRetCode = ERROR_NOT_FOUND; // nothing failed, just didn't find the pool
    }
    return(false);
  }
}

bool findLibrary | ( | HANDLE | hSession,
 |  | NTMS_GUID & | gLibID,
 |  | DWORD & | dwRetCode
 | ) |  |

Definition at line 246 of file app.cpp.

{
  DWORD dwSize, i;
  NTMS_GUID *gLibList = NULL;
  NTMS_OBJECTINFORMATION oiLibraryInfo;

  SetNullGuid(&gLibID);

  // Enumerate the libraries
  if(!EnumerateObjectType(hSession, NO_CONTAINER, NTMS_LIBRARY, gLibList, dwSize, dwRetCode))
  {
    return(false);
  }

  // Find the first online library
  oiLibraryInfo.dwSize = sizeof(oiLibraryInfo);
  oiLibraryInfo.dwType = NTMS_LIBRARY;
  for(i=0; i < dwSize; ++i)
  {
    dwRetCode = GetNtmsObjectInformation( hSession,
      &(gLibList[i]),
      &oiLibraryInfo);
    if(dwRetCode != ERROR_SUCCESS)
    {
      free(gLibList);
      return(false);
    }
    if(oiLibraryInfo.Info.Library.LibraryType == NTMS_LIBRARYTYPE_ONLINE)
    {
       gLibID = gLibList[i];
       free(gLibList);
       return(true);
    }
  }

  dwRetCode = ERROR_NOT_FOUND;
  free(gLibList);
  return(false);
}

bool findMediaType | ( | HANDLE | hSession,
 |  | NTMS_GUID & | gMediaID,
 |  | DWORD & | dwRetCode
 | ) |  |

Definition at line 289 of file app.cpp.

{
  DWORD dwSize, i;
  NTMS_GUID *gTypeList = NULL;
  NTMS_GUID gLibrary;
  NTMS_OBJECTINFORMATION oiMediaTypeInfo;

  SetNullGuid(&gMediaID);

  // Get the guid for the library
  if(!findLibrary(hSession, gLibrary, dwRetCode))
  {
    return(false);
  }

  // Get the list of media type guids in the library
  if(!EnumerateObjectType(hSession, &gLibrary, NTMS_MEDIA_TYPE, gTypeList, dwSize, dwRetCode))
  {
    return(false);
  }

  // Go through the guid list and find a rewritable media type
  oiMediaTypeInfo.dwSize = sizeof(oiMediaTypeInfo);
  oiMediaTypeInfo.dwType = NTMS_MEDIA_TYPE;
  for (i=0; i < dwSize; ++i)
  {
    dwRetCode = GetNtmsObjectInformation( hSession,
      &(gTypeList[i]),
      &oiMediaTypeInfo);
    if(dwRetCode != ERROR_SUCCESS)
    {
      free(gTypeList);
      return(false);
    }
    if(oiMediaTypeInfo.Info.MediaType.ReadWriteCharacteristics == NTMS_MEDIARW_REWRITABLE)
    {
      gMediaID = gTypeList[i];
      free(gTypeList);
      return (true);
    }
  }

  dwRetCode = ERROR_NOT_FOUND;
  free(gTypeList);
  return (false);
}

bool GetOfflineLib | ( | HANDLE | hSession,
 |  | NTMS_GUID & | gLibID,
 |  | DWORD & | dwRetCode
 | ) |  |

Definition at line 200 of file app.cpp.

{
  DWORD dwSize, i;
  NTMS_GUID *gLibList = NULL;
  NTMS_OBJECTINFORMATION oiLibraryInfo;

  SetNullGuid(&gLibID);

  // Get a list of the libraries
  if(!EnumerateObjectType(hSession, NO_CONTAINER, NTMS_LIBRARY, gLibList, dwSize, dwRetCode))
  {
    return(false);
  }

  // Find the offline library
  oiLibraryInfo.dwSize = sizeof(oiLibraryInfo);
  oiLibraryInfo.dwType = NTMS_LIBRARY;
  for(i=0; i < dwSize; ++i)
  {
    dwRetCode = GetNtmsObjectInformation( hSession,
      &(gLibList[i]),
      &oiLibraryInfo);
    if(dwRetCode != ERROR_SUCCESS)
    {
      free(gLibList);
      return(false);
    }
    if((oiLibraryInfo.Info.Library.LibraryType == NTMS_LIBRARYTYPE_OFFLINE) &&
      (oiLibraryInfo.Info.Library.dwFlags == NTMS_LIBRARYFLAG_FIXEDOFFLINE))
    {
       gLibID = gLibList[i];
       free(gLibList);
       return(true);

    }
  }

  free(gLibList);
  dwRetCode = ERROR_NOT_FOUND;
  return(false);
}

void main ( void )

Definition at line 917 of file app.cpp.

{

  /* Each of the following use cases performs a complete set of RSM operations an application
     might perform during an application invokation.  A backup application, for example, would
     do something like UseCase1 when it is installed, UseCase2 when a backup or restore is
     performed, UseCase3 when a user indicates that a backup set is to be discarded and so
     on
   */

  UseCase1(); // Typical app initialization

  UseCase2(); // Typical media allocation and use scenario

  UseCase3(); // Typical media deallocation scenario

  UseCase4(); // Find each piece of media in the import pool that
        //    belong to this app and move it to this
        //    app's media pool

  UseCase5(); // Announce changes to the contents of the CD-ROM drive

  UseCase6(); // Print the names of all the media in the off-line library
}

bool OpenSessionWithWait | ( | HANDLE & | hSession,
 |  | LPWSTR | AppName,
 |  | DWORD & | dwRetCode
 | ) |  |

Definition at line 48 of file app.cpp.

{

  for(DWORD i=0; i< 150; ++i)
  {
    // Start an RSM session
    hSession = OpenNtmsSession(L"", AppName, 0);
    if(hSession == INVALID_HANDLE_VALUE)
    {
      // If RSM isn't up yet it will return ERROR_BUSY,
      // which is a transient state so retry until either
      // a handle is returned, some other error occurs or
      // we've waited long enough
      dwRetCode = GetLastError();
      if(dwRetCode != ERROR_BUSY)
        return(false);
    }
    else
      return(true);

    Sleep(500);
  }

  return(false);
}

void persistMediaID ( NTMS_GUID )

Definition at line 45 of file app_utls.cpp.

{
  globalMediaID = guid;
}

void persistPoolID ( NTMS_GUID )

Definition at line 33 of file app_utls.cpp.

{
  globalPoolID = guid;
}

NTMS_GUID recallMediaID ( )

Definition at line 51 of file app_utls.cpp.

{
  return globalMediaID;
}

NTMS_GUID recallPoolID ( )

Definition at line 39 of file app_utls.cpp.

{
  return globalPoolID;
}

void SetNullGuid ( NTMS_GUID * g )

Definition at line 76 of file app.cpp.

{
  memset(g, 0, sizeof(NTMS_GUID));
}

DWORD SetPoolDACL | ( | HANDLE | hSession,
 |  | NTMS_GUID & | gMediaPool,
 |  | DWORD | dwSubAuthority,
 |  | DWORD | dwAction,
 |  | DWORD | dwMask
 | ) |  |

Definition at line 84 of file app.cpp.

{
  PSID psidAccount;
  PSECURITY_DESCRIPTOR psdRePoolSd;
  SID_IDENTIFIER_AUTHORITY ntauth = SECURITY_NT_AUTHORITY;
  DWORD dwRetCode, dwSizeTry, dwSizeReturned;
  PACL paclDis;
  BOOL OK;
  DWORD i;
  ACCESS_ALLOWED_ACE *pAce;
  BOOL bDaclPresent, bDaclDefaulted;

  // Get a SID for the well known, domain-relative account or group
  if(AllocateAndInitializeSid(
            &ntauth,
            2,
            SECURITY_BUILTIN_DOMAIN_RID,
            dwSubAuthority,
            0,
            0,
            0,
            0,
            0,
            0,
            &psidAccount
            ) == 0)
    return GetLastError();

  // Get the security descriptor for the pool
  dwSizeTry = 5;
  psdRePoolSd = NULL;
  for(;;)
  {
    if(psdRePoolSd != NULL)
      free(psdRePoolSd);
    psdRePoolSd = (PSID)malloc(dwSizeTry);

    dwRetCode = GetNtmsObjectSecurity(hSession, &gMediaPool, NTMS_MEDIA_POOL, DACL_SECURITY_INFORMATION,
      psdRePoolSd, dwSizeTry, &dwSizeReturned);

    if(dwRetCode == ERROR_SUCCESS) break;
    if(dwRetCode == ERROR_INSUFFICIENT_BUFFER)
    {
      dwSizeTry = dwSizeReturned;
      continue;
    }
    return ERROR_INVALID_FUNCTION;
  }

  //Get a pointer to the DACL
  OK = GetSecurityDescriptorDacl(psdRePoolSd, &bDaclPresent, &paclDis, &bDaclDefaulted);

  // Go through the DACL and change the mask of the ACE with the matching SID
  for(i=0; i < paclDis->AceCount; ++i)
  {
    OK = GetAce(paclDis, i, (LPVOID *)&pAce);
    if( EqualSid(psidAccount, &(pAce->SidStart)))
      if (dwAction == ADD_ACE_MASK_BITS)
        pAce->Mask |= dwMask;
      else if (dwAction == REMOVE_ACE_MASK_BITS)
        pAce->Mask &= ~dwMask;
      else if (dwAction == DELETE_ACE)
        DeleteAce(paclDis, i);
  }

  dwRetCode = SetNtmsObjectSecurity(hSession, &gMediaPool, NTMS_MEDIA_POOL, DACL_SECURITY_INFORMATION,
      psdRePoolSd);

  free(psdRePoolSd);

  FreeSid(psidAccount);

  return ERROR_SUCCESS;
}

void UseCase1 ( )

Definition at line 451 of file app.cpp.

{
  HANDLE hSession;
  DWORD dwRetCode;
  NTMS_GUID gMediaType;
  NTMS_GUID gMediaPool;
  NTMS_OBJECTINFORMATION oiInfoBuffer;

  // Start an RSM session
  if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase1", dwRetCode))
    return;

  // Get a GUID for a read/write media type
  if(!findMediaType(hSession, gMediaType, dwRetCode))
  {
    CloseNtmsSession(hSession);
    return;
  }

  // Create a pool for this app, returns a GUID
  dwRetCode = CreateNtmsMediaPool( hSession,
      L"API_Sample_Pool",
      &gMediaType,
      NTMS_OPEN_ALWAYS,
      NULL,
      &gMediaPool);

  // Set this new pool to automatically draw media from the scratch pool
  // when allocating. Do this by first reading the info associated with the
  // pool GUID, changing the "allocate from scratch" bit and then setting
  // the pool info
  oiInfoBuffer.dwSize = sizeof(oiInfoBuffer);
  oiInfoBuffer.dwType = NTMS_MEDIA_POOL;
  dwRetCode = GetNtmsObjectInformation(hSession,
      &gMediaPool,
      &oiInfoBuffer);

  oiInfoBuffer.Info.MediaPool.AllocationPolicy =
     NTMS_ALLOCATE_FROMSCRATCH;

  dwRetCode = SetNtmsObjectInformation(hSession,
      &gMediaPool,
      &oiInfoBuffer);

  // Change the permissions on the pool
  SetPoolDACL(hSession, gMediaPool, DOMAIN_ALIAS_RID_USERS,
    REMOVE_ACE_MASK_BITS, NTMS_MODIFY_ACCESS | NTMS_CONTROL_ACCESS);

  // Remember the pool GUID for future use
  persistPoolID(gMediaPool);

  CloseNtmsSession(hSession);
}

void UseCase2 ( )

Definition at line 521 of file app.cpp.

{
  HANDLE hSession, hDrive;
  DWORD dwRetCode, labelBytesWritten = LABEL_BUFFER_SIZE;
  NTMS_GUID gPoolID, gMediaID, gDriveID;
  NTMS_OBJECTINFORMATION oiDriveInfo;
  BYTE *labelBuffer;

  // Start an RSM session
  if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase2", dwRetCode))
    return;

  // We need to write some data, but don't have a piece of
  // media to write it to yet, so get a piece of media to
  // use and remember the guid
  gPoolID = recallPoolID();
  dwRetCode = AllocateNtmsMedia(hSession,
    &gPoolID,
    NULL,
    &gMediaID,
    NTMS_ALLOCATE_NEW,
    ALLOCATE_WAIT,
    NULL);
  persistMediaID(gMediaID);

  // Mount the piece of media in a drive, the mount returns a drive GUID
  dwRetCode = MountNtmsMedia(hSession,
    &gMediaID,
    &gDriveID,
    REQUESTING_ONE_MOUNT,
    NTMS_MOUNT_ERROR_NOT_AVAILABLE,
    NTMS_PRIORITY_NORMAL,
    MOUNT_WAIT,
    NULL);

  // Open the drive the media is in by getting the device name associated
  // with the drive GUID the mount request returned.
  oiDriveInfo.dwSize = sizeof(oiDriveInfo);
  oiDriveInfo.dwType = NTMS_DRIVE;
  dwRetCode = GetNtmsObjectInformation(hSession,
    &gDriveID,
    &oiDriveInfo);

  hDrive = CreateFile(oiDriveInfo.Info.Drive.szDeviceName,
                    GENERIC_READ | GENERIC_WRITE,
                    0,
                    NULL,
                    OPEN_EXISTING,
                    FILE_ATTRIBUTE_NORMAL,
                    NULL);

  // Write the OMID and tell RSM
  // Get a buffer that's big enough for the label and is an
  // integral number of blocks.
  labelBuffer = (BYTE *)malloc(((sizeof(STL_LABEL)/512)+1)*512);
  writeOmid(hDrive, (STL_LABEL *)labelBuffer);
  dwRetCode = UpdateNtmsOmidInfo(hSession,
    &gMediaID,
    NTMS_OMID_TYPE_RAW_LABEL,
    sizeof(STL_LABEL),
    (void *)labelBuffer);
  free(labelBuffer);

  // Write data via Win32 API calls, close device when done.

  // (insert whatever native WWin32 I/O calls here are needed to place
  // data on the media)

  CloseHandle(hDrive);

  // Dismount the media
  dwRetCode = DismountNtmsMedia( hSession,
    &gMediaID,
    REQUESTING_ONE_DISMOUNT,
    0);

  CloseNtmsSession(hSession);
}

void UseCase3 ( )

Definition at line 615 of file app.cpp.

{
  HANDLE hSession, hDrive;
  DWORD dwRetCode, labelBytesWritten = LABEL_BUFFER_SIZE;
  NTMS_GUID gMediaID, gDriveID;
  NTMS_OBJECTINFORMATION oiDriveInfo;

  // Start an RSM session
  if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase3", dwRetCode))
    return;

  // Mount the piece of media in a drive
  gMediaID = recallMediaID();
  dwRetCode = MountNtmsMedia(hSession,
    &gMediaID,
    &gDriveID,
    REQUESTING_ONE_MOUNT,
    NTMS_MOUNT_ERROR_NOT_AVAILABLE,
    NTMS_PRIORITY_NORMAL,
    MOUNT_WAIT,
    NULL);

  // Open the drive the media is in
  oiDriveInfo.dwSize = sizeof(oiDriveInfo);
  oiDriveInfo.dwType = NTMS_DRIVE;
  dwRetCode = GetNtmsObjectInformation(hSession,
    &gDriveID,
    &oiDriveInfo);

  hDrive = CreateFile(oiDriveInfo.Info.Drive.szDeviceName,
                    GENERIC_READ | GENERIC_WRITE,
                    0,
                    NULL,
                    OPEN_EXISTING,
                    FILE_ATTRIBUTE_NORMAL,
                    NULL);

  // (insert whatever native WWin32 I/O calls here are needed to place
  // data on the media)

  CloseHandle(hDrive);

  // Dismount the media
  dwRetCode = DismountNtmsMedia( hSession,
    &gMediaID,
    REQUESTING_ONE_DISMOUNT,
    0);

  // We've determined that we no longer need this piece of media and
  // the data it contains, so deallocate it.
  dwRetCode = DeallocateNtmsMedia( hSession,
    &gMediaID,
    0);

  CloseNtmsSession(hSession);
}

void UseCase4 ( )

Definition at line 686 of file app.cpp.

{
  HANDLE hSession;
  DWORD dwRetCode, i;
  NTMS_GUID gIpID, *gSideList = NULL, gPoolID;
  DWORD dwSize;
  NTMS_OBJECTINFORMATION oiSideInfo;

  // Start an RSM session
  if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase4", dwRetCode))
    return;

  // Get the GUID of the media-specific import pool
  if(findImportPool(hSession, gIpID, dwRetCode) == false)
  {
    CloseNtmsSession(hSession);
    return;
  }

  // Enumerate all the sides in the media-specific import pool
  if(!EnumerateObjectType(hSession, &gIpID, NTMS_PARTITION, gSideList, dwSize, dwRetCode))
  {
    CloseNtmsSession(hSession);
    return;
  }

  gPoolID = recallPoolID();

  // Look at the label on each piece of media & move it
  // to this app's pool if it was written by this
  // app.
  oiSideInfo.dwSize = sizeof(oiSideInfo);
  oiSideInfo.dwType = NTMS_PARTITION;
  for (i=0; i < dwSize; ++i)
  {
    if(GetNtmsObjectInformation( hSession,
      &(gSideList[i]),
      &oiSideInfo) != ERROR_SUCCESS)
    {
      CloseNtmsSession(hSession);
      free(gSideList);
      return;
    }
    if((wcsncmp(oiSideInfo.Info.Partition.szOmidLabelType,
      L"Simple Tape Label (STL)", 23)) == 0)
    {
      MoveToNtmsMediaPool(hSession,
        &(oiSideInfo.Info.Partition.PhysicalMedia), &gPoolID);
    }
  }

  free(gSideList);

  CloseNtmsSession(hSession);
}

void UseCase5 ( )

Definition at line 760 of file app.cpp.

{
  HANDLE hSession, hNotificationSession;
  DWORD dwRetCode, i;
  NTMS_GUID gDriveID, gLibID, *gDriveList = NULL;
  DWORD dwSize;
  NTMS_OBJECTINFORMATION oiDriveInfo, oiDTypeInfo, oiLibInfo;
  NTMS_NOTIFICATIONINFORMATION oiNotificationInfo;

  // Start an RSM session
  if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase5", dwRetCode))
    return;

  // Get a list of all the drives
  EnumerateObjectType(hSession, NO_CONTAINER, NTMS_DRIVE, gDriveList, dwSize, dwRetCode);

  // Find the CD-ROM drive
  oiDriveInfo.dwSize = sizeof(oiDriveInfo);
  oiDriveInfo.dwType = NTMS_DRIVE;
  oiDTypeInfo.dwSize = sizeof(oiDTypeInfo);
  oiDTypeInfo.dwType = NTMS_DRIVE_TYPE;
  oiLibInfo.dwSize = sizeof(oiLibInfo);
  oiLibInfo.dwType = NTMS_LIBRARY;

  for(i=0; i < dwSize; ++i)
  {

    // get the attributes of the drive
    dwRetCode = GetNtmsObjectInformation( hSession,
      &(gDriveList[i]),
      &oiDriveInfo);
    // get the attributes of the type of drive
    dwRetCode = GetNtmsObjectInformation( hSession,
        &(oiDriveInfo.Info.Drive.DriveType),
        &oiDTypeInfo);
    // get the attributes of the library that holds the drive
    dwRetCode = GetNtmsObjectInformation( hSession,
        &(oiDriveInfo.Info.Drive.Library),
        &oiLibInfo);

    // is it a stand-alone CD-ROM drive?
    if((oiDTypeInfo.Info.DriveType.DeviceType == FILE_DEVICE_CD_ROM) &&
      (oiLibInfo.Info.Library.LibraryType == NTMS_LIBRARYTYPE_STANDALONE))
    {
      // yes
       gDriveID = gDriveList[i];
       gLibID = oiDriveInfo.Info.Drive.Library;
       break;
    }
  }

  free(gDriveList);

  if(i == dwSize)
  {
    // No stand-alone CD drive
    CloseNtmsSession(hSession);
    return;
  }

  // Turn on database notifications so we'll be notified when RSM's
  // database is updated
  hNotificationSession = OpenNtmsNotification(hSession, NTMS_DRIVE);

  // Get the next 5 drive notifications, then quit
  for(i=0; i<5; ++i)
  {

    WaitForNtmsNotification(hNotificationSession,&oiNotificationInfo, INFINITE);

    if(!memcmp(&oiNotificationInfo.ObjectId,&gDriveID, sizeof(NTMS_GUID)))
    {
      switch(oiNotificationInfo.dwOperation)
      {
      case NTMS_OBJ_INSERT:
        break;
      case NTMS_OBJ_DELETE:
        break;
      case NTMS_OBJ_UPDATE:
        MessageBox(NULL, L"A drive changed state!", L"RSM API Sample", MB_OK);
        break;
      }
    }
  }

  CloseNtmsNotification( &hNotificationSession);

  CloseNtmsSession(hSession);

}

void UseCase6 ( )

Definition at line 869 of file app.cpp.

{
  DWORD dwRetCode, i;
  NTMS_GUID gLibID, *gMediaList;
  DWORD dwSize;
  NTMS_OBJECTINFORMATION oiMediaInfo;
  HANDLE hSession;

  // Start an RSM session
  if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase6", dwRetCode))
    return;

  // Get the GUID of the offline library
  if(!GetOfflineLib(hSession, gLibID, dwRetCode))
  {
    CloseNtmsSession(hSession);
    return;
  }

  // Get a list of GUIDs for media in offline library
  EnumerateObjectType(hSession, &gLibID, NTMS_PHYSICAL_MEDIA, gMediaList, dwSize, dwRetCode);

  // Print the name of each physical media
  wprintf(L"Media in the offline physical location:\n");
  oiMediaInfo.dwSize = sizeof(oiMediaInfo);
  oiMediaInfo.dwType = NTMS_PHYSICAL_MEDIA;
  for(i=0; i < dwSize; ++i)
  {
    WCHAR szOutputBuffer[OUTPUT_BUFFER_WCHAR_SIZE];

    dwRetCode = GetNtmsObjectInformation( hSession,
      &(gMediaList[i]),
      &oiMediaInfo);

    StringCchCopyW(szOutputBuffer, OUTPUT_BUFFER_WCHAR_SIZE, L"   ");
    StringCchCatW(szOutputBuffer, OUTPUT_BUFFER_WCHAR_SIZE, oiMediaInfo.szName);
    StringCchCatW(szOutputBuffer, OUTPUT_BUFFER_WCHAR_SIZE, L"\n");
    wprintf(szOutputBuffer);
  }

  free(gMediaList);

  CloseNtmsSession(hSession);
}

void writeOmid | ( | HANDLE | ,
 |  | STL_LABEL * |
 | ) |  |

Definition at line 33 of file stl_write.cpp.

{
  time_t CurrentTime;
  struct tm *GMTime;
  BOOL nRetCode, nError;
  DWORD nBytesWritten;

  // create and fill in the  fields in a STL structure that are used to recognize it as such
  // zero out whole buffer, then copy each string up until next to the last char, assuring each
  // string is null terminated.
  memset(LabelBuffer, 0, sizeof(STL_LABEL));
  wcsncpy((wchar_t *)LabelBuffer->LabelType, STL_LABEL_LabelType, (STL_LABEL_LabelTypeSize/sizeof(WCHAR))-1);

  wcsncpy((wchar_t *)LabelBuffer->LabelVersion, STL_LABEL_Version, (STL_LABEL_VersionSize/sizeof(WCHAR))-1);

  wcsncpy((wchar_t *)LabelBuffer->Vendor, STL_LABEL_Vendor, (STL_LABEL_VendorSize/sizeof(WCHAR))-1);

  wcsncpy((wchar_t *)LabelBuffer->Application, STL_LABEL_Application, (STL_LABEL_ApplicationSize/sizeof(WCHAR))-1);

  // fill in the other fields
  time(&CurrentTime);
  GMTime = gmtime(&CurrentTime) ;
  wcsftime ((wchar_t *)LabelBuffer->TimeStamp, 10, L"%m/%d/%y%I:%M:%S %p", GMTime);

    wcsncpy((wchar_t *)LabelBuffer->TapeName, L"A Tape Written by the RSM Sample APP",
    (STL_LABEL_TapeNameSize/sizeof(WCHAR))-1);

  GetTapeGUID((wchar_t *)&(LabelBuffer->MediaID), STL_LABEL_MediaIDSize);

  // write the label on the tape
  nRetCode = WriteFile (hDevice, (void *) LabelBuffer, 512 * ((sizeof(STL_LABEL) / 512) + 1),
    &nBytesWritten, NULL) ;
  if (nRetCode == FALSE)
  {
    nError = GetLastError() ;
  }

  return;
}

Generated on Wed Nov 13 2024 16:53:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/app/app_utls.cpp File Reference

  • WinBase
  • IO
  • RSM
  • app
Functions

app_utls.cpp File Reference

#include <stdio.h>
#include <windows.h>
#include <iostream.h>
#include <ntmsapi.h>

Go to the source code of this file.

Functions

void | persistMediaID (NTMS_GUID guid)
void | persistPoolID (NTMS_GUID guid)
NTMS_GUID | recallMediaID ()
NTMS_GUID | recallPoolID ()

Function Documentation

void persistMediaID ( NTMS_GUID guid )

Definition at line 45 of file app_utls.cpp.

{
  globalMediaID = guid;
}

void persistPoolID ( NTMS_GUID guid )

Definition at line 33 of file app_utls.cpp.

{
  globalPoolID = guid;
}

NTMS_GUID recallMediaID ( )

Definition at line 51 of file app_utls.cpp.

{
  return globalMediaID;
}

NTMS_GUID recallPoolID ( )

Definition at line 39 of file app_utls.cpp.

{
  return globalPoolID;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/app/stl_write.cpp File Reference

  • WinBase
  • IO
  • RSM
  • app
Functions

stl_write.cpp File Reference

#include <windows.h>
#include <iostream.h>
#include <stdio.h>
#include <time.h>
#include <rpc.h>
#include <NtmsMli.h>
#include "..\inc\stl.h"

Go to the source code of this file.

Functions

void | GetTapeGUID (wchar_t *MediaID, DWORD dwSize)
void | writeOmid (HANDLE hDevice, STL_LABEL *LabelBuffer)

Function Documentation

void GetTapeGUID | ( | wchar_t * | MediaID,
 |  | DWORD | dwSize
 | ) |  |

Definition at line 26 of file stl_write.cpp.

{
  // A real app would have a way of generating these, or at least
  // knowing what one to use
  wcsncpy(MediaID, L"{71ebde90-5172-11d2-a0f0-000000000000}", dwSize/sizeof(WCHAR));
}

void writeOmid | ( | HANDLE | hDevice,
 |  | STL_LABEL * | LabelBuffer
 | ) |  |

Definition at line 33 of file stl_write.cpp.

{
  time_t CurrentTime;
  struct tm *GMTime;
  BOOL nRetCode, nError;
  DWORD nBytesWritten;

  // create and fill in the  fields in a STL structure that are used to recognize it as such
  // zero out whole buffer, then copy each string up until next to the last char, assuring each
  // string is null terminated.
  memset(LabelBuffer, 0, sizeof(STL_LABEL));
  wcsncpy((wchar_t *)LabelBuffer->LabelType, STL_LABEL_LabelType, (STL_LABEL_LabelTypeSize/sizeof(WCHAR))-1);

  wcsncpy((wchar_t *)LabelBuffer->LabelVersion, STL_LABEL_Version, (STL_LABEL_VersionSize/sizeof(WCHAR))-1);

  wcsncpy((wchar_t *)LabelBuffer->Vendor, STL_LABEL_Vendor, (STL_LABEL_VendorSize/sizeof(WCHAR))-1);

  wcsncpy((wchar_t *)LabelBuffer->Application, STL_LABEL_Application, (STL_LABEL_ApplicationSize/sizeof(WCHAR))-1);

  // fill in the other fields
  time(&CurrentTime);
  GMTime = gmtime(&CurrentTime) ;
  wcsftime ((wchar_t *)LabelBuffer->TimeStamp, 10, L"%m/%d/%y%I:%M:%S %p", GMTime);

    wcsncpy((wchar_t *)LabelBuffer->TapeName, L"A Tape Written by the RSM Sample APP",
    (STL_LABEL_TapeNameSize/sizeof(WCHAR))-1);

  GetTapeGUID((wchar_t *)&(LabelBuffer->MediaID), STL_LABEL_MediaIDSize);

  // write the label on the tape
  nRetCode = WriteFile (hDevice, (void *) LabelBuffer, 512 * ((sizeof(STL_LABEL) / 512) + 1),
    &nBytesWritten, NULL) ;
  if (nRetCode == FALSE)
  {
    nError = GetLastError() ;
  }

  return;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/inc/stl.h File Reference

  • WinBase
  • IO
  • RSM
  • inc
Classes | Defines

stl.h File Reference

Go to the source code of this file.

Classes

struct | STL_LABEL

Defines

#define | STL_LABEL_Application L"RSM Sample App"
#define | STL_LABEL_ApplicationSize sizeof(STL_LABEL_Application)
#define | STL_LABEL_LabelType L"Simple Tape Label (STL)"
#define | STL_LABEL_LabelTypeSize sizeof (STL_LABEL_LabelType)
#define | STL_LABEL_MediaIDBlank L"{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
#define | STL_LABEL_MediaIDSize sizeof(STL_LABEL_MediaIDBlank)
#define | STL_LABEL_TapeNameSize 256
#define | STL_LABEL_TimeStampSize 40
#define | STL_LABEL_Vendor L"Microsoft Corporation"
#define | STL_LABEL_VendorSize sizeof(STL_LABEL_Vendor)
#define | STL_LABEL_Version L"2.60"
#define | STL_LABEL_VersionSize sizeof(STL_LABEL_Version)

Define Documentation

#define STL_LABEL_Application L"RSM Sample App"

Definition at line 42 of file stl.h.

#define STL_LABEL_ApplicationSize sizeof(STL_LABEL_Application)

Definition at line 43 of file stl.h.

#define STL_LABEL_LabelType L"Simple Tape Label (STL)"

Definition at line 31 of file stl.h.

#define STL_LABEL_LabelTypeSize sizeof (STL_LABEL_LabelType)

Definition at line 32 of file stl.h.

#define STL_LABEL_MediaIDBlank L"{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"

Definition at line 47 of file stl.h.

#define STL_LABEL_MediaIDSize sizeof(STL_LABEL_MediaIDBlank)

Definition at line 48 of file stl.h.

#define STL_LABEL_TapeNameSize 256

Definition at line 45 of file stl.h.

#define STL_LABEL_TimeStampSize 40

Definition at line 40 of file stl.h.

#define STL_LABEL_Vendor L"Microsoft Corporation"

Definition at line 37 of file stl.h.

#define STL_LABEL_VendorSize sizeof(STL_LABEL_Vendor)

Definition at line 38 of file stl.h.

#define STL_LABEL_Version L"2.60"

Definition at line 34 of file stl.h.

#define STL_LABEL_VersionSize sizeof(STL_LABEL_Version)

Definition at line 35 of file stl.h.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/mll/dllmain.cpp File Reference

  • WinBase
  • IO
  • RSM
  • mll
Functions

dllmain.cpp File Reference

#include <windows.h>

Go to the source code of this file.

Functions

BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)

Function Documentation

BOOL WINAPI DllMain | ( | HINSTANCE | hDLL,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 31 of file dllmain.cpp.

{
  return (TRUE);
}

Generated on Wed Nov 13 2024 16:54:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/mll/stl_mll.cpp File Reference

  • WinBase
  • IO
  • RSM
  • mll
Defines | Functions

stl_mll.cpp File Reference

#include <windows.h>
#include "..\inc\stl.h"
#include "STL_mll.h"

Go to the source code of this file.

Defines

#define | HEX_0 L'0'
#define | HEX_9 L'9'
#define | HEX_A L'A'
#define | HEX_F L'F'
#define | OUR_BAR L'|'
#define | OUR_BRACE L'{'
#define | OUR_STRING wchar_t*

Functions

RSM_APPSAMPLE_LABEL_EXPORT
DWORD WINAPI 		ClaimMediaLabel (const BYTE *const pBuffer, const DWORD nBufferSize, MediaLabelInfo *const pLabelInfo)
RSM_APPSAMPLE_LABEL_EXPORT
DWORD WINAPI 		MaxMediaLabel (DWORD *const pMaxSize)

Define Documentation

#define HEX_0 L'0'

Definition at line 87 of file stl_mll.cpp.

#define HEX_9 L'9'

Definition at line 88 of file stl_mll.cpp.

#define HEX_A L'A'

Definition at line 89 of file stl_mll.cpp.

#define HEX_F L'F'

Definition at line 90 of file stl_mll.cpp.

#define OUR_BAR L'|'

Definition at line 92 of file stl_mll.cpp.

#define OUR_BRACE L'{'

Definition at line 93 of file stl_mll.cpp.

#define OUR_STRING wchar_t*

Definition at line 91 of file stl_mll.cpp.

Function Documentation

RSM_APPSAMPLE_LABEL_EXPORT DWORD WINAPI ClaimMediaLabel | ( | const BYTE *const | pBuffer,
 |  | const DWORD | nBufferSize,
 |  | MediaLabelInfo *const | pLabelInfo
 | ) |  |

Definition at line 29 of file stl_mll.cpp.

{
  DWORD nError = NO_ERROR;
  STL_LABEL *pLabel;
  GUID gMediaGuid;

  // Go through the label and look at each field.  If something is seen that isn't STL, then bail
  // If this MLL is to recognize all instances of STL, then perhaps it should only check the first
  // two fields, since multiple applications and vendors could write STL.  If the intent is to
  // only recognize STL written by a particular app then the vendor and app fields are checked. That's
  // the way this sample is done.
  pLabel = (STL_LABEL *) pBuffer;
  if (wcsncmp ((wchar_t *)pLabel->LabelType, STL_LABEL_LabelType, STL_LABEL_LabelTypeSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  if(wcsncmp((wchar_t *)pLabel->LabelVersion, STL_LABEL_Version, STL_LABEL_VersionSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  if(wcsncmp((wchar_t *)pLabel->Vendor, STL_LABEL_Vendor, STL_LABEL_VendorSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  if(wcsncmp((wchar_t *)pLabel->Application, STL_LABEL_Application, STL_LABEL_ApplicationSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  // OK, found an instance of STL, now populate the MediaLabelInfo structure to pass back to RSM
  memset(pLabelInfo, 0, sizeof(MediaLabelInfo));
  wcsncpy(pLabelInfo->LabelType, (wchar_t *) pLabel->LabelType, (STL_LABEL_LabelTypeSize/sizeof(WCHAR))-1);

  if(GetMediaGuid((wchar_t *)pLabel->MediaID, STL_LABEL_MediaIDSize, gMediaGuid) == NO_ERROR)
  {
    pLabelInfo->LabelIDSize = sizeof(gMediaGuid);
    memcpy(pLabelInfo->LabelID, &gMediaGuid, sizeof(gMediaGuid));
  }
  else
    // Whoops, we got a valid STL instance, but the app screwed up the GUID
    // A real MLL could try to recover, or just bail.  Here we bail.
    return ERROR_BAD_FORMAT;

  wcsncpy(pLabelInfo->LabelAppDescr, (wchar_t *) pLabel->TapeName, (STL_LABEL_TapeNameSize/sizeof(WCHAR))-1);

  return NO_ERROR;
}

RSM_APPSAMPLE_LABEL_EXPORT DWORD WINAPI MaxMediaLabel ( DWORD *const pMaxSize )

Definition at line 76 of file stl_mll.cpp.

{
  // local variables
  DWORD nError = NO_ERROR ;

  // set the max size for the sample label in terms of 512 blocks
  *pMaxSize = 512 * ((sizeof(STL_LABEL) / 512)+1);

  return nError ;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/mll/stl_mll.h File Reference

  • WinBase
  • IO
  • RSM
  • mll
Defines | Functions

stl_mll.h File Reference

#include <ntmsmli.h>

Go to the source code of this file.

Defines

#define RSM_APPSAMPLE_LABEL_EXPORT __declspec(dllexport)

Functions

RSM_APPSAMPLE_LABEL_EXPORT
DWORD WINAPI 		ClaimMediaLabel (const BYTE *const pBuffer, const DWORD nBufferSize, MediaLabelInfo *const pLabelInfo)
RSM_APPSAMPLE_LABEL_EXPORT
DWORD WINAPI 		MaxMediaLabel (DWORD *const pMaxSize)

Define Documentation

#define RSM_APPSAMPLE_LABEL_EXPORT __declspec(dllexport)

Definition at line 19 of file stl_mll.h.

Function Documentation

RSM_APPSAMPLE_LABEL_EXPORT DWORD WINAPI ClaimMediaLabel | ( | const BYTE *const | pBuffer,
 |  | const DWORD | nBufferSize,
 |  | MediaLabelInfo *const | pLabelInfo
 | ) |  |

Definition at line 29 of file stl_mll.cpp.

{
  DWORD nError = NO_ERROR;
  STL_LABEL *pLabel;
  GUID gMediaGuid;

  // Go through the label and look at each field.  If something is seen that isn't STL, then bail
  // If this MLL is to recognize all instances of STL, then perhaps it should only check the first
  // two fields, since multiple applications and vendors could write STL.  If the intent is to
  // only recognize STL written by a particular app then the vendor and app fields are checked. That's
  // the way this sample is done.
  pLabel = (STL_LABEL *) pBuffer;
  if (wcsncmp ((wchar_t *)pLabel->LabelType, STL_LABEL_LabelType, STL_LABEL_LabelTypeSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  if(wcsncmp((wchar_t *)pLabel->LabelVersion, STL_LABEL_Version, STL_LABEL_VersionSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  if(wcsncmp((wchar_t *)pLabel->Vendor, STL_LABEL_Vendor, STL_LABEL_VendorSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  if(wcsncmp((wchar_t *)pLabel->Application, STL_LABEL_Application, STL_LABEL_ApplicationSize/sizeof(WCHAR)))
    return ERROR_BAD_FORMAT;

  // OK, found an instance of STL, now populate the MediaLabelInfo structure to pass back to RSM
  memset(pLabelInfo, 0, sizeof(MediaLabelInfo));
  wcsncpy(pLabelInfo->LabelType, (wchar_t *) pLabel->LabelType, (STL_LABEL_LabelTypeSize/sizeof(WCHAR))-1);

  if(GetMediaGuid((wchar_t *)pLabel->MediaID, STL_LABEL_MediaIDSize, gMediaGuid) == NO_ERROR)
  {
    pLabelInfo->LabelIDSize = sizeof(gMediaGuid);
    memcpy(pLabelInfo->LabelID, &gMediaGuid, sizeof(gMediaGuid));
  }
  else
    // Whoops, we got a valid STL instance, but the app screwed up the GUID
    // A real MLL could try to recover, or just bail.  Here we bail.
    return ERROR_BAD_FORMAT;

  wcsncpy(pLabelInfo->LabelAppDescr, (wchar_t *) pLabel->TapeName, (STL_LABEL_TapeNameSize/sizeof(WCHAR))-1);

  return NO_ERROR;
}

RSM_APPSAMPLE_LABEL_EXPORT DWORD WINAPI MaxMediaLabel ( DWORD *const pMaxSize )

Definition at line 76 of file stl_mll.cpp.

{
  // local variables
  DWORD nError = NO_ERROR ;

  // set the max size for the sample label in terms of 512 blocks
  *pMaxSize = 512 * ((sizeof(STL_LABEL) / 512)+1);

  return nError ;
}

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/UnBufCpy/UnBufCp1.c File Reference

  • WinBase
  • IO
  • UnBufCpy
Classes | Defines | Typedefs | Functions | Variables

UnBufCp1.c File Reference

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

Go to the source code of this file.

Classes

struct | _COPY_CHUNK

Defines

#define | BUFFER_SIZE (64*1024)
#define | MAX_CONCURRENT_IO 20
#define | ReadKey 0
#define | WriteKey 1

Typedefs

typedef struct _COPY_CHUNK | COPY_CHUNK
typedef struct _COPY_CHUNK * | PCOPY_CHUNK

Functions

VOID | CopyLoop (ULARGE_INTEGER FileSize)
int __cdecl | main (int argc, char *argv[], char *envp)

Variables

COPY_CHUNK | CopyChunk [MAX_CONCURRENT_IO]
HANDLE DestFile
HANDLE IoPort
DWORD PageSize
HANDLE SourceFile
OSVERSIONINFO | ver

Define Documentation

#define BUFFER_SIZE (64*1024)

Definition at line 98 of file UnBufCp1.c.

#define MAX_CONCURRENT_IO 20

Definition at line 85 of file UnBufCp1.c.

#define ReadKey 0

Definition at line 76 of file UnBufCp1.c.

#define WriteKey 1

Definition at line 77 of file UnBufCp1.c.

Typedef Documentation

typedef struct _COPY_CHUNK COPY_CHUNK
typedef struct _COPY_CHUNK * PCOPY_CHUNK

Function Documentation

VOID CopyLoop ( ULARGE_INTEGER FileSize )

Definition at line 365 of file UnBufCp1.c.

{
    ULARGE_INTEGER ReadPointer;
    BOOL Success;
    DWORD NumberBytes;
    LPOVERLAPPED CompletedOverlapped;
    DWORD_PTR Key;
    PCOPY_CHUNK Chunk;
    int PendingIO = 0;
    int i;

    //
    // Start reading the file. Kick off MAX_CONCURRENT_IO reads, then just
    // loop waiting for I/O to complete.
    //
    ReadPointer.QuadPart = 0;

    for (i=0; i < MAX_CONCURRENT_IO; i++) {
        if (ReadPointer.QuadPart >= FileSize.QuadPart) {
            break;
        }
        //
        // Use VirtualAlloc so we get a page-aligned buffer suitable
        // for unbuffered I/O.
        //
        CopyChunk[i].Buffer = VirtualAlloc(NULL,
                                           BUFFER_SIZE,
                                           MEM_COMMIT,
                                           PAGE_READWRITE);
        if (CopyChunk[i].Buffer == NULL) {
            fprintf(stderr, "VirtualAlloc %d failed, error %d\n",i, GetLastError());
            exit(1);
        }
        CopyChunk[i].Overlapped.Offset = ReadPointer.LowPart;
        CopyChunk[i].Overlapped.OffsetHigh = ReadPointer.HighPart;
        CopyChunk[i].Overlapped.hEvent = NULL;     // not needed

        Success = ReadFile(SourceFile,
                           CopyChunk[i].Buffer,
                           BUFFER_SIZE,
                           &NumberBytes,
                           &CopyChunk[i].Overlapped);

        if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
            fprintf(stderr,
                    "ReadFile at %lx failed, error %d\n",
                    ReadPointer.LowPart,
                    GetLastError());
            exit(1);
        } else {
            ReadPointer.QuadPart += BUFFER_SIZE;
            ++PendingIO;
        }
    }

    //
    // We have started the initial async. reads, enter the main loop.
    // This simply waits until an I/O completes, then issues the next
    // I/O.  When a write completes, the next read is issued. When a
    // read completes, the corresponding write is issued.
    //
    while (PendingIO) {
        Success = GetQueuedCompletionStatus(IoPort,
                                            &NumberBytes,
                                            &Key,
                                            &CompletedOverlapped,
                                            INFINITE);
        if (!Success) {
            //
            // Either the function failed to dequeue a completion packet
            // (CompletedOverlapped is not NULL) or it dequeued a completion
            // packet of a failed I/O operation (CompletedOverlapped is NULL).
            //
            fprintf(stderr,
                    "GetQueuedCompletionStatus on the IoPort failed, error %d\n",
                    GetLastError());
            exit(1);
        }

        Chunk = (PCOPY_CHUNK)CompletedOverlapped;

        if (Key == ReadKey) {

            //
            // A read has completed, issue the corresponding write.
            //

            //
            // Round the number of bytes to write up to a sector boundary.
            //
            NumberBytes = (NumberBytes + PageSize - 1) & ~(PageSize-1);

            Success = WriteFile(DestFile,
                                Chunk->Buffer,
                                NumberBytes,
                                &NumberBytes,
                                &Chunk->Overlapped);

            if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
                fprintf(stderr,
                        "WriteFile at %lx failed, error %d\n",
                        Chunk->Overlapped.Offset,
                        GetLastError());
                exit(1);
            }

            //
            // decrement pending I/O count
            //
            --PendingIO;

        } else if (Key == WriteKey) {

            //
            // A write has completed, issue the next read.
            //

            if (ReadPointer.QuadPart < FileSize.QuadPart) {
                Chunk->Overlapped.Offset = ReadPointer.LowPart;
                Chunk->Overlapped.OffsetHigh = ReadPointer.HighPart;
                ReadPointer.QuadPart += BUFFER_SIZE;
                Success = ReadFile(SourceFile,
                                   Chunk->Buffer,
                                   NumberBytes,
                                   &NumberBytes,
                                   &Chunk->Overlapped);
                if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
                    fprintf(stderr,
                            "ReadFile at %lx failed, error %d\n",
                            Chunk->Overlapped.Offset,
                            GetLastError());
                    exit(1);
                }
            } else {
                //
                // There are no more reads left to issue, just
                // wait for the pending writes to drain.
                //
                --PendingIO;
            }
        }
    }
    //
    // All done. There is no need to call VirtualFree() to free CopyChunk
    // buffers here. The buffers will be freed when this process exits.
    //
}

int __cdecl main | ( | int | argc,
 |  | char * | argv[],
 |  | char * | envp
 | ) |  |

Definition at line 117 of file UnBufCp1.c.

{
    ULARGE_INTEGER FileSize;
    ULARGE_INTEGER InitialSize;
    BOOL Success;
    DWORD Status;
    DWORD StartTime, EndTime;
    SYSTEM_INFO SystemInfo;
    HANDLE BufferedHandle;

    if (argc != 3) {
        fprintf(stderr, "Usage: %s SourceFile DestinationFile\n", argv[0]);
        exit(1);
    }

    //
    //confirm we are running on Windows NT 3.5 or greater, if not, display notice and
    //terminate.  Completion ports are only supported on Win32 & Win32s.  Creating a
    //Completion port with no handle specified is only supported on NT 3.51, so we need
    //to know what we're running on.  Note, Win32s does not support console apps, thats
    //why we exit here if we are not on Windows NT.
    //
    //
    //ver.dwOSVersionInfoSize needs to be set before calling GetVersionInfoEx()
    //
    ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

    //
    //Failure here could mean several things.  1. On an NT system,
    //it indicates NT version 3.1 because GetVersionEx() is only
    //implemented on NT 3.5.  2. On Windows 3.1 system, it means
    //either Win32s version 1.1 or 1.0 is installed.
    //
    Success = GetVersionEx((LPOSVERSIONINFO) &ver);

    if ( (!Success) ||                                   //GetVersionEx() failed - see above.
         (ver.dwPlatformId != VER_PLATFORM_WIN32_NT) )   //GetVersionEx() succeeded but we are not on NT.
      {
       MessageBox(NULL,
                  "This sample application can only be run on Windows NT. 3.5 or greater\n"
                  "This application will now terminate.",
                  "UnBufCp1",
                  MB_OK           |
                  MB_ICONSTOP     |
                  MB_SETFOREGROUND );
       exit( 1 );
      }

    //
    // Get the system's page size.
    //
    GetSystemInfo(&SystemInfo);
    PageSize = SystemInfo.dwPageSize;

    //
    // Open the source file and create the destination file.
    // Use FILE_FLAG_NO_BUFFERING to avoid polluting the
    // system cache with two copies of the same data.
    //

    SourceFile = CreateFile(argv[1],
                            GENERIC_READ | GENERIC_WRITE,
                            FILE_SHARE_READ,
                            NULL,
                            OPEN_EXISTING,
                            FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
                            NULL);
    if (SourceFile == INVALID_HANDLE_VALUE) {
        fprintf(stderr, "failed to open %s, error %d\n", argv[1], GetLastError());
        exit(1);
    }
    FileSize.LowPart = GetFileSize(SourceFile, &FileSize.HighPart);
    if ((FileSize.LowPart == 0xffffffff) && (GetLastError() != NO_ERROR)) {
        fprintf(stderr, "GetFileSize failed, error %d\n", GetLastError());
        exit(1);
    }

    DestFile = CreateFile(argv[2],
                          GENERIC_READ | GENERIC_WRITE,
                          FILE_SHARE_READ | FILE_SHARE_WRITE,
                          NULL,
                          CREATE_ALWAYS,
                          FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
                          SourceFile);
    if (DestFile == INVALID_HANDLE_VALUE) {
        fprintf(stderr, "failed to open %s, error %d\n", argv[2], GetLastError());
        exit(1);
    }

    //
    // Extend the destination file so that the filesystem does not
    // turn our asynchronous writes into synchronous ones.
    //
    InitialSize.QuadPart = (FileSize.QuadPart + PageSize - 1) & ~((DWORD_PTR)(PageSize-1));
    Status = SetFilePointer(DestFile,
                            InitialSize.LowPart,
                            (PLONG)&InitialSize.HighPart,
                            FILE_BEGIN);
    if ((Status == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) {
        fprintf(stderr, "initial SetFilePointer failed, error %d\n", GetLastError());
        exit(1);
    }
    Success = SetEndOfFile(DestFile);
    if (!Success) {
        fprintf(stderr, "SetEndOfFile failed, error %d\n", GetLastError());
        exit(1);
    }

    //
    //In NT 3.51 it is not necessary to specify the FileHandle parameter
    //of CreateIoCompletionPort()--It is legal to specify the FileHandle
    //as INVALID_HANDLE_VALUE.  However, for NT 3.5 an overlapped file
    //handle is needed.
    //
    //We know already that we are running on NT, or else we wouldn't have
    //gotten this far, so lets see what version we are running on.
    //
    if (ver.dwMajorVersion == 3 && ver.dwMinorVersion == 50)
        //
        //we're running on NT 3.5 - Completion Ports exists.
        //
        IoPort = CreateIoCompletionPort(SourceFile,            //file handle to associate with I/O completion port.
                                        NULL,                  //optional handle to existing I/O completion port.
                                        ReadKey,               //completion key.
                                        1);                    //# of threads allowed to execute concurrently.
    else
        {
          //
          //we are running on NT 3.51 or greater.
          //Create the I/O Completion Port
          //
          IoPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE,//file handle to associate with I/O completion port
                                          NULL,                //optional handle to existing I/O completion port
                                          ReadKey,             //completion key
                                          1);                  //# of threads allowed to execute concurrently

          if (IoPort == NULL) {
             fprintf(stderr, "failed to create ReadPort, error %d\n", GetLastError());
             exit(1);
          }

         //
         //If we need to, aka we're running on NT 3.51, let's associate a file handle with the
         //completion port.
         //

         IoPort = CreateIoCompletionPort(SourceFile,
                                         IoPort,
                                         ReadKey,
                                         1);

         if (IoPort == NULL)
           {
             fprintf(stderr,
                     "failed to create IoPort, error %d\n",
                     GetLastError());

             exit(1);

           }
        }

    //
    // Associate the destination file handle with the
    // I/O completion port.
    //

    IoPort = CreateIoCompletionPort(DestFile,
                                    IoPort,
                                    WriteKey,
                                    1);
    if (IoPort == NULL) {
        fprintf(stderr, "failed to create WritePort, error %d\n", GetLastError());
        exit(1);
    }

    StartTime = GetTickCount();

    //
    // Do the copy
    //
    CopyLoop(FileSize);

    EndTime = GetTickCount();

    CloseHandle(SourceFile);
    CloseHandle(DestFile);

    //
    // We need another handle to the destination file that is
    // opened without FILE_FLAG_NO_BUFFERING. This allows us to set
    // the end-of-file marker to a position that is not sector-aligned.
    //
    BufferedHandle = CreateFile(argv[2],
                                GENERIC_WRITE,
                                FILE_SHARE_READ | FILE_SHARE_WRITE,
                                NULL,
                                OPEN_EXISTING,
                                0,
                                NULL);
    if (BufferedHandle == INVALID_HANDLE_VALUE) {
        fprintf(stderr,
                "failed to open buffered handle to %s, error %d\n",
                argv[2],
                GetLastError());
        exit(1);
    }

    //
    // Set the destination's file size to the size of the
    // source file, in case the size of the source file was
    // not a multiple of the page size.
    //
    Status = SetFilePointer(BufferedHandle,
                            FileSize.LowPart,
                            (PLONG)&FileSize.HighPart,
                            FILE_BEGIN);
    if ((Status == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) {
        fprintf(stderr, "final SetFilePointer failed, error %d\n", GetLastError());
        exit(1);
    }
    Success = SetEndOfFile(BufferedHandle);
    if (!Success) {
        fprintf(stderr, "SetEndOfFile failed, error %d\n", GetLastError());
        exit(1);
    }
    CloseHandle(BufferedHandle);

    printf("%d bytes copied in %.3f seconds\n",
           FileSize.LowPart,
           (float)(EndTime-StartTime)/1000.0);
    printf("%.2f MB/sec\n",
           ((LONGLONG)FileSize.QuadPart/(1024.0*1024.0)) / (((float)(EndTime-StartTime)) / 1000.0));

    return(0);

}

Variable Documentation

COPY_CHUNK CopyChunk[MAX_CONCURRENT_IO]

Definition at line 92 of file UnBufCp1.c.

HANDLE DestFile

Definition at line 59 of file UnBufCp1.c.

HANDLE IoPort

Definition at line 70 of file UnBufCp1.c.

DWORD PageSize

Definition at line 104 of file UnBufCp1.c.

HANDLE SourceFile

Definition at line 58 of file UnBufCp1.c.

OSVERSIONINFO ver

Definition at line 64 of file UnBufCp1.c.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/UnBufCpy/UnBufCp2.c File Reference

  • WinBase
  • IO
  • UnBufCpy
Classes | Defines | Typedefs | Functions | Variables

UnBufCp2.c File Reference

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

Go to the source code of this file.

Classes

struct | _COPY_CHUNK

Defines

#define | BUFFER_SIZE (64*1024)
#define | MAX_CONCURRENT_IO 20

Typedefs

typedef struct _COPY_CHUNK | COPY_CHUNK
typedef struct _COPY_CHUNK * | PCOPY_CHUNK

Functions

int __cdecl | main (int argc, char *argv[], char *envp)
VOID | ReadLoop (ULARGE_INTEGER FileSize)
VOID WINAPI | WriteLoop (ULARGE_INTEGER FileSize)

Variables

COPY_CHUNK | CopyChunk [MAX_CONCURRENT_IO]
HANDLE DestFile
DWORD PageSize
HANDLE ReadPort
HANDLE SourceFile
OSVERSIONINFO | ver
HANDLE WritePort

Define Documentation

#define BUFFER_SIZE (64*1024)

Definition at line 94 of file UnBufCp2.c.

#define MAX_CONCURRENT_IO 20

Definition at line 81 of file UnBufCp2.c.

Typedef Documentation

typedef struct _COPY_CHUNK COPY_CHUNK
typedef struct _COPY_CHUNK * PCOPY_CHUNK

Function Documentation

int __cdecl main | ( | int | argc,
 |  | char * | argv[],
 |  | char * | envp
 | ) |  |

Definition at line 119 of file UnBufCp2.c.

{
    HANDLE WritingThread;
    DWORD ThreadId;
    ULARGE_INTEGER FileSize;
    ULARGE_INTEGER InitialFileSize;
    BOOL Success;
    DWORD Status;
    DWORD StartTime, EndTime;
    SYSTEM_INFO SystemInfo;
    HANDLE BufferedHandle;

    if (argc != 3) {
        fprintf(stderr, "Usage: %s SourceFile DestinationFile\n", argv[0]);
        exit(1);
    }

    //
    //confirm we are running on Windows NT 3.5 or greater, if not, display notice and
    //terminate.  Completion ports are only supported on Win32 & Win32s.  Creating a
    //Completion port with no handle specified is only supported on NT 3.51, so we need
    //to know what we're running on.  Note, Win32s does not support console apps, thats
    //why we exit here if we are not on Windows NT.
    //
    //
    //ver.dwOSVersionInfoSize needs to be set before calling GetVersionInfoEx()
    //
    ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

    //
    //Failure here could mean several things 1. On an NT system,
    //it indicates NT version 3.1 because GetVersionEx() is only
    //implemented on NT 3.5.  2. On Windows 3.1 system, it means
    //either Win32s version 1.1 or 1.0 is installed.
    //
    Success = GetVersionEx((LPOSVERSIONINFO) &ver);

    if ( (!Success) ||                                   //GetVersionEx() failed - see above.
         (ver.dwPlatformId != VER_PLATFORM_WIN32_NT) )   //GetVersionEx() succeeded but we are not on NT.
      {
       MessageBox(NULL,
                  "This sample application can only be run on Windows NT. 3.5 or greater\n"
                  "This application will now terminate.",
                  "UnBufCp2",
                  MB_OK           |
                  MB_ICONSTOP     |
                  MB_SETFOREGROUND );
       exit( 1 );
      }

    //
    // Get the system's page size.
    //
    GetSystemInfo(&SystemInfo);
    PageSize = SystemInfo.dwPageSize;

    //
    // Open the source file and create the destination file.
    // Use FILE_FLAG_NO_BUFFERING to avoid polluting the
    // system cache with two copies of the same data.
    //

    SourceFile = CreateFile(argv[1],
                            GENERIC_READ | GENERIC_WRITE,
                            FILE_SHARE_READ,
                            NULL,
                            OPEN_EXISTING,
                            FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
                            NULL);
    if (SourceFile == INVALID_HANDLE_VALUE) {
        fprintf(stderr, "failed to open %s, error %d\n", argv[1], GetLastError());
        exit(1);
    }
    FileSize.LowPart = GetFileSize(SourceFile, &FileSize.HighPart);
    if ((FileSize.LowPart == 0xffffffff) && (GetLastError() != NO_ERROR)) {
        fprintf(stderr, "GetFileSize failed, error %d\n", GetLastError());
        exit(1);
    }

    DestFile = CreateFile(argv[2],
                          GENERIC_READ | GENERIC_WRITE,
                          FILE_SHARE_READ | FILE_SHARE_WRITE,
                          NULL,
                          CREATE_ALWAYS,
                          FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
                          SourceFile);
    if (DestFile == INVALID_HANDLE_VALUE) {
        fprintf(stderr, "failed to open %s, error %d\n", argv[2], GetLastError());
        exit(1);
    }

    //
    // Extend the destination file so that the filesystem does not
    // turn our asynchronous writes into synchronous ones.
    //
    InitialFileSize.QuadPart = (FileSize.QuadPart + PageSize - 1) & ~((DWORD_PTR)(PageSize - 1));
    Status = SetFilePointer(DestFile,
                            InitialFileSize.LowPart,
                            (PLONG)&InitialFileSize.HighPart,
                            FILE_BEGIN);
    if ((Status == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) {
        fprintf(stderr, "SetFilePointer failed, error %d\n", GetLastError());
        exit(1);
    }
    Success = SetEndOfFile(DestFile);
    if (!Success) {
        fprintf(stderr, "SetEndOfFile failed, error %d\n", GetLastError());
        exit(1);
    }

    //
    //In NT 3.51 it is not necessary to specify the FileHandle parameter
    //of CreateIoCompletionPort()--It is legal to specify the FileHandle
    //as INVALID_HANDLE_VALUE.  However, for NT 3.5 an overlapped file
    //handle is needed.
    //
    //We know already that we are running on NT, or else we wouldn't have
    //gotten this far, so lets see what version we are running on.
    //
    if (ver.dwMajorVersion == 3 && ver.dwMinorVersion == 50)
        {
          //
          //we're running on NT 3.5 - Completion Ports exists
          //
          ReadPort = CreateIoCompletionPort(SourceFile,        //file handle to associate with I/O completion port
                                            NULL,              //optional handle to existing I/O completion port
                                            (DWORD_PTR)SourceFile, //completion key
                                            1);                //# of threads allowed to execute concurrently

          if (ReadPort == NULL) {
            fprintf(stderr, "failed to create ReadPort, error %d\n", GetLastError());
            exit(1);
          }
        }

    else
      //
      //We are running on NT 3.51 or greater.
      //
      //Create the I/O Completion Port.
      //
        {
          ReadPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, //file handle to associate with I/O completion port
                                            NULL,                 //optional handle to existing I/O completion port
                                            (DWORD_PTR)SourceFile,    //completion key
                                            1);                   //# of threads allowed to execute concurrently

         //
         //If we need to, aka we're running on NT 3.51, let's associate a file handle with the
         //completion port.
         //
         ReadPort = CreateIoCompletionPort(SourceFile,
                                           ReadPort,
                                           (DWORD_PTR)SourceFile,  //should be the previously specified key.
                                           1);

         if (ReadPort == NULL)
          {
            fprintf(stderr,
                    "failed to create ReadPort, error %d\n",
                    GetLastError());

            exit(1);

          }
        }

    WritePort = CreateIoCompletionPort(DestFile,
                                       NULL,
                                       (DWORD_PTR)DestFile,
                                       1);
    if (WritePort == NULL) {
        fprintf(stderr, "failed to create WritePort, error %d\n", GetLastError());
        exit(1);
    }

    //
    // Start the writing thread
    //
    WritingThread = CreateThread(NULL,
                                 0,
                                 (LPTHREAD_START_ROUTINE)WriteLoop,
                                 &FileSize,
                                 0,
                                 &ThreadId);
    if (WritingThread == NULL) {
        fprintf(stderr, "failed to create write thread, error %d\n", GetLastError());
        exit(1);
    }
    CloseHandle(WritingThread);

    StartTime = GetTickCount();

    //
    // Start the reads
    //
    ReadLoop(FileSize);

    EndTime = GetTickCount();

    //
    // We need another handle to the destination file that is
    // opened without FILE_FLAG_NO_BUFFERING. This allows us to set
    // the end-of-file marker to a position that is not sector-aligned.
    //
    BufferedHandle = CreateFile(argv[2],
                                GENERIC_WRITE,
                                FILE_SHARE_READ | FILE_SHARE_WRITE,
                                NULL,
                                OPEN_EXISTING,
                                0,
                                NULL);
    if (BufferedHandle == INVALID_HANDLE_VALUE) {
        fprintf(stderr,
                "failed to open buffered handle to %s, error %d\n",
                argv[2],
                GetLastError());
        exit(1);
    }

    //
    // Set the destination's file size to the size of the
    // source file, in case the size of the source file was
    // not a multiple of the page size.
    //
    Status = SetFilePointer(BufferedHandle,
                            FileSize.LowPart,
                            (PLONG)&FileSize.HighPart,
                            FILE_BEGIN);
    if ((Status == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) {
        fprintf(stderr, "final SetFilePointer failed, error %d\n", GetLastError());
        exit(1);
    }
    Success = SetEndOfFile(BufferedHandle);
    if (!Success) {
        fprintf(stderr, "SetEndOfFile failed, error %d\n", GetLastError());
        exit(1);
    }
    CloseHandle(BufferedHandle);
    CloseHandle(SourceFile);
    CloseHandle(DestFile);

    printf("\n\n%d bytes copied in %.3f seconds\n",
           FileSize.LowPart,
           (float)(EndTime-StartTime)/1000.0);
    printf("%.2f MB/sec\n",
           ((LONGLONG)FileSize.QuadPart/(1024.0*1024.0)) / (((float)(EndTime-StartTime)) / 1000.0));

    return(0);

}

VOID ReadLoop ( ULARGE_INTEGER FileSize )

Definition at line 379 of file UnBufCp2.c.

{
    ULARGE_INTEGER ReadPointer;
    BOOL Success;
    DWORD NumberBytes;
    LPOVERLAPPED CompletedOverlapped;
    DWORD_PTR Key;
    PCOPY_CHUNK Chunk;
    int PendingIO = 0;
    int i;

    //
    // Start reading the file. Kick off MAX_CONCURRENT_IO reads, then just
    // loop waiting for writes to complete.
    //
    ReadPointer.QuadPart = 0;

    for (i=0; i < MAX_CONCURRENT_IO; i++) {
        if (ReadPointer.QuadPart >= FileSize.QuadPart) {
            break;
        }
        //
        // Use VirtualAlloc so we get a page-aligned buffer suitable
        // for unbuffered I/O.
        //
        CopyChunk[i].Buffer = VirtualAlloc(NULL,
                                           BUFFER_SIZE,
                                           MEM_COMMIT,
                                           PAGE_READWRITE);
        if (CopyChunk[i].Buffer == NULL) {
            fprintf(stderr, "VirtualAlloc %d failed, error %d\n",i, GetLastError());
            exit(1);
        }
        CopyChunk[i].Overlapped.Offset = ReadPointer.LowPart;
        CopyChunk[i].Overlapped.OffsetHigh = ReadPointer.HighPart;
        CopyChunk[i].Overlapped.hEvent = NULL;     // not needed

        Success = ReadFile(SourceFile,
                           CopyChunk[i].Buffer,
                           BUFFER_SIZE,
                           &NumberBytes,
                           &CopyChunk[i].Overlapped);

        if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
            fprintf(stderr,
                    "ReadFile at %lx failed, error %d\n",
                    ReadPointer.LowPart,
                    GetLastError());
            exit(1);
        } else {
            ReadPointer.QuadPart += BUFFER_SIZE;
            ++PendingIO;

        }
    }

    //
    // We have started the initial async. reads, enter the main loop.
    // This simply waits until a write completes, then issues the next
    // read.
    //
    while (PendingIO) {
        Success = GetQueuedCompletionStatus(WritePort,
                                            &NumberBytes,
                                            &Key,
                                            &CompletedOverlapped,
                                            INFINITE);
        if (!Success) {
            //
            // Either the function failed to dequeue a completion packet
            // (CompletedOverlapped is not NULL) or it dequeued a completion
            // packet of a failed I/O operation (CompletedOverlapped is NULL).
            //
            fprintf(stderr,
                    "GetQueuedCompletionStatus on the IoPort failed, error %d\n",
                    GetLastError());
            exit(1);
        }
        //
        // Issue the next read using the buffer that has just completed.
        //
        if (ReadPointer.QuadPart < FileSize.QuadPart) {
            Chunk = (PCOPY_CHUNK)CompletedOverlapped;
            Chunk->Overlapped.Offset = ReadPointer.LowPart;
            Chunk->Overlapped.OffsetHigh = ReadPointer.HighPart;
            ReadPointer.QuadPart += BUFFER_SIZE;
            Success = ReadFile(SourceFile,
                               Chunk->Buffer,
                               BUFFER_SIZE,
                               &NumberBytes,
                               &Chunk->Overlapped);

            if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
                fprintf(stderr,
                        "ReadFile at %lx failed, error %d\n",
                        Chunk->Overlapped.Offset,
                        GetLastError());
                exit(1);
            }
        }
        else {
            //
            // There are no more reads left to issue, just wait
            // for the pending writes to drain.
            //
            --PendingIO;

        }
    }
    //
    // All done. There is no need to call VirtualFree() to free CopyChunk
    // buffers here. The buffers will be freed when this process exits.
    //
}

VOID WINAPI WriteLoop ( ULARGE_INTEGER FileSize )

Definition at line 498 of file UnBufCp2.c.

{
    BOOL Success;
    DWORD_PTR Key;
    LPOVERLAPPED CompletedOverlapped;
    PCOPY_CHUNK Chunk;
    DWORD NumberBytes;
    ULARGE_INTEGER TotalBytesWritten;

    TotalBytesWritten.QuadPart = 0;

    while (TRUE) {
        Success = GetQueuedCompletionStatus(ReadPort,
                                            &NumberBytes,
                                            &Key,
                                            &CompletedOverlapped,
                                            INFINITE);

        if (!Success) {
            //
            // Either the function failed to dequeue a completion packet
            // (CompletedOverlapped is not NULL) or it dequeued a completion
            // packet of a failed I/O operation (CompletedOverlapped is NULL).
            //
            fprintf(stderr,
                    "GetQueuedCompletionStatus on the IoPort failed, error %d\n",
                    GetLastError());
            exit(1);
        }

        //
        // Update the total number of bytes written.
        //
        TotalBytesWritten.QuadPart += NumberBytes;

        //
        // Issue the next write using the buffer that has just been read into.
        //
        Chunk = (PCOPY_CHUNK)CompletedOverlapped;

        //
        // Round the number of bytes to write up to a sector boundary
        //
        NumberBytes = (NumberBytes + PageSize - 1) & ~(PageSize-1);

        Success = WriteFile(DestFile,
                            Chunk->Buffer,
                            NumberBytes,
                            &NumberBytes,
                            &Chunk->Overlapped);

        if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
            fprintf(stderr,
                    "WriteFile at %lx failed, error %d\n",
                    Chunk->Overlapped.Offset,
                    GetLastError());
            exit(1);
        }

        //
        //Check to see if we've copied the complete file, if so return
        //
        if (TotalBytesWritten.QuadPart >= FileSize.QuadPart)
            return;
    }
}

Variable Documentation

COPY_CHUNK CopyChunk[MAX_CONCURRENT_IO]

Definition at line 88 of file UnBufCp2.c.

HANDLE DestFile

Definition at line 60 of file UnBufCp2.c.

DWORD PageSize

Definition at line 100 of file UnBufCp2.c.

HANDLE ReadPort

Definition at line 67 of file UnBufCp2.c.

HANDLE SourceFile

Definition at line 59 of file UnBufCp2.c.

OSVERSIONINFO ver

Definition at line 73 of file UnBufCp2.c.

HANDLE WritePort

Definition at line 68 of file UnBufCp2.c.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/Console/NmPipe.c File Reference

  • WinBase
  • IPC
  • NamePipe
  • Console
Classes | Defines | Functions

NmPipe.c File Reference

#include <windows.h>
#include <stdio.h>
#include <sddl.h>
#include <stdlib.h>
#include <process.h>

Go to the source code of this file.

Classes

struct | WRITER_PARAMS

Defines

#define | DEFNAME "\\\\.\\pipe\\nmpipe"
#define | OVERLAPPED_IO FALSE
#define | PERR(bSuccess, szApi) {if (!(bSuccess)) printf("%s: Error %d from %s \ on line %d\n", __FILE__, GetLastError(), szApi, __LINE__);}

Functions

BOOL | CreateMyDACL (SECURITY_ATTRIBUTES *pSA)
void | main (int argc, char *argv[])
BOOL | pipeCheck (HANDLE hPipe)
void | reader (HANDLE hPipe)
void | writer (WRITER_PARAMS *writer_params)

Define Documentation

#define DEFNAME "\\\\.\\pipe\\nmpipe"

Definition at line 26 of file NmPipe.c.

#define OVERLAPPED_IO FALSE

Definition at line 30 of file NmPipe.c.

#define PERR | ( | bSuccess,
 |  | szApi |
 | ) |  | {if (!(bSuccess)) printf("%s: Error %d from %s \ on line %d\n", __FILE__, GetLastError(), szApi, __LINE__);}

Definition at line 23 of file NmPipe.c.

Function Documentation

BOOL CreateMyDACL ( SECURITY_ATTRIBUTES * pSA )

Definition at line 56 of file NmPipe.c.

{
    // Define the SDDL for the DACL. This example sets
    // the following access:
    //     Built-in guests are denied all access.
    //     Anonymous Logon is denied all access.
    //     Authenticated Users are allowed read/write/execute access.
    //     Administrators are allowed full control.
    // Modify these values as needed to generate the proper
    // DACL for your application.
    TCHAR * szSD = "D:"                   // Discretionary ACL
                   "(D;OICI;GA;;;BG)"     // Deny access to Built-in Guests
                   "(D;OICI;GA;;;AN)"     // Deny access to Anonymous Logon
                   "(A;OICI;GRGWGX;;;AU)" // Allow read/write/execute to Authenticated Users
                   "(A;OICI;GA;;;BA)";    // Allow full control to Administrators

    if (NULL == pSA)
        return FALSE;

    return ConvertStringSecurityDescriptorToSecurityDescriptor(
                                                              szSD,
                                                              SDDL_REVISION_1,
                                                              &(pSA->lpSecurityDescriptor),
                                                              NULL);
}

void main | ( | int | argc,
 |  | char * | argv[]
 | ) |  |

Definition at line 203 of file NmPipe.c.

{
   HANDLE hPipe;
   BOOL bSuccess;
   BOOL bNotConnected;
   char *szPname;
   WRITER_PARAMS *writer_params;
   DWORD dwClients;
   SECURITY_ATTRIBUTES saPipe;
   OVERLAPPED ol;
   DWORD dwRead;

   if (argc < 3)
   {
      puts("nmpipe [/s|/c] <string> <pipename>");
      puts("'/s' to start as server, '/c' to start as client");
      puts("<string>: string to write to the pipe");
      puts("<pipename>: full UNC name of pipe (optional)");
      puts("example: nmpipe /s \"hello from server \" \\\\.\\pipe\\pipetst");
      return;
   }
   szPname = (argc > 3) ? argv[3] : DEFNAME;
   if (tolower(argv[1][1]) == 's')
   {
      if (OVERLAPPED_IO)
      {
         memset(&ol, 0, sizeof(ol));
         ol.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
         PERR(ol.hEvent, "CreateEvent");
      }
      SetConsoleTitle("SERVER: nmpipe sample");

      saPipe.nLength = sizeof(saPipe);
      saPipe.bInheritHandle = TRUE;

      if(!CreateMyDACL(&saPipe) )
      {
          // DACL creation FAILED!!
          return;
      }

      while (1)
      {
         /* Create a named pipe: duplex, type byte, readmode byte, unlimited
            instances, default timeout of 60s */
         hPipe = CreateNamedPipe(szPname, PIPE_ACCESS_DUPLEX |
                                 (OVERLAPPED_IO ? FILE_FLAG_OVERLAPPED : 0), PIPE_TYPE_BYTE |
                                 PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 0, 0,
                                 60000, &saPipe);
         PERR(hPipe != INVALID_HANDLE_VALUE, "CreateNamedPipe");
         puts("\n* pipe created, waiting for connection...");
         bSuccess = ConnectNamedPipe(hPipe, OVERLAPPED_IO ? &ol : NULL);
         if (!bSuccess && GetLastError() == ERROR_IO_PENDING)
            bSuccess = GetOverlappedResult(hPipe, &ol, &dwRead, TRUE);
         /* check return from either ConnectNamedPipe or GetOverlappedResult.
            If a client managed to connect between the CreateNamedPipe and
            ConnectNamedPipe calls, ERROR_PIPE_CONNECTED will result */
         if (!bSuccess && GetLastError() != ERROR_PIPE_CONNECTED)
         {
            /* something went wrong, report error, close instance and try again */
            PERR(bSuccess, "ConnectNamedPipe");
            CloseHandle(hPipe);
            continue;
         }
         /* find out how many pipe instances there currently are */
         bSuccess = GetNamedPipeHandleState(hPipe, NULL, &dwClients, NULL, NULL,
                                            NULL, 0);
         PERR(bSuccess, "GetNamedPipeHandleState");
         printf("\n* %d clients connected", dwClients);
         _beginthread(reader, 0, hPipe);
         writer_params = (WRITER_PARAMS *)malloc(sizeof(WRITER_PARAMS));
         if (NULL == writer_params)
         {
             // Malloc failed
             return;
         }
         writer_params->hPipe = hPipe;
         writer_params->szData = argv[2];
         writer_params->iDataSize = (int)strlen(argv[2]);
         /* WARNING! reading and writing at the same time to a non-overlapped
            pipe is a no-no! If not overlapped, server only reads and client
            only writes */
         if (OVERLAPPED_IO)
            _beginthread(writer, 0, writer_params);
      } /* while */
      CloseHandle(ol.hEvent);
      CloseHandle(hPipe);
    free(saPipe.lpSecurityDescriptor);
   }
   else /* no '/s', assume it's a client */
   {
      char szTemp[64];

      sprintf(szTemp, "Client %s", argv[2]);
      SetConsoleTitle(szTemp);
      bNotConnected = TRUE;
      while (bNotConnected)
      {
         /* attempt to connect to pipe instance */
         hPipe = CreateFile(szPname, GENERIC_READ | GENERIC_WRITE, 0, NULL,
                            OPEN_EXISTING, OVERLAPPED_IO ? FILE_FLAG_OVERLAPPED : 0, NULL);
         if (GetLastError() == ERROR_PIPE_BUSY)
         {
            puts("Pipe busy, waiting for a pipe instance...");
            bSuccess = WaitNamedPipe(szPname, NMPWAIT_USE_DEFAULT_WAIT);
            PERR(bSuccess, "WaitNamedPipe");
         }
         else
         {
            PERR(hPipe != INVALID_HANDLE_VALUE, "CreateFile");
            bNotConnected = (hPipe == INVALID_HANDLE_VALUE);
         }
      } /* while */
      puts("Connected to pipe...");
      if (OVERLAPPED_IO) /* if overlapped, start reader thread */
         _beginthread(reader, 0, hPipe);
      writer_params = malloc(sizeof(WRITER_PARAMS));
      writer_params->hPipe = hPipe;
      writer_params->szData = argv[2];
      writer_params->iDataSize = (int)strlen(argv[2]);
      writer(writer_params);

   } /* else */

   CloseHandle(hPipe);
   if (OVERLAPPED_IO) CloseHandle(ol.hEvent);
   return;
}

BOOL pipeCheck ( HANDLE hPipe )

Definition at line 94 of file NmPipe.c.

{
   DWORD dwLastError = GetLastError();

   if (dwLastError == ERROR_BROKEN_PIPE || dwLastError == ERROR_NO_DATA)
   {
      puts("\n* pipe broken, closing...");
      CloseHandle(hPipe);
      return (FALSE);
   }
   if (dwLastError == ERROR_INVALID_HANDLE) /* is handle already closed? */
      return (FALSE);
   return (TRUE);
} /* pipeCheck() */

void reader ( HANDLE hPipe )

Definition at line 119 of file NmPipe.c.

{
   char buf[64];
   DWORD dwRead;
   BOOL bSuccess;
   OVERLAPPED ol;

   if (OVERLAPPED_IO) /* if overlapped, prepare OVERLAPPED structure */
   {
      memset(&ol, 0, sizeof(ol));
      ol.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
      PERR(ol.hEvent, "CreateEvent");
   }
   while (1)
   {
      bSuccess = ReadFile(hPipe, buf, sizeof(buf), &dwRead,
                          OVERLAPPED_IO ? &ol : NULL);
      if (!bSuccess && GetLastError() == ERROR_IO_PENDING)
         bSuccess = GetOverlappedResult(hPipe, &ol, &dwRead, TRUE);
      /* If ReadFile or GetOverlappedResult fails, check pipe. If pipe is
         broken, fall out of loop */
      if (!bSuccess && !pipeCheck(hPipe))
         break;
      /* else check for any other kinds of errors that may have occurred */
      PERR(bSuccess, "ReadFile");
      printf("%.*s", dwRead, buf); /* print only number of chars read */
   } /* while */
   CloseHandle(ol.hEvent);
   _endthread();
} /* reader() */

void writer ( WRITER_PARAMS * writer_params )

Definition at line 161 of file NmPipe.c.

{
   DWORD dwWritten;
   BOOL bSuccess;
   OVERLAPPED ol;

   if (OVERLAPPED_IO)
   {
      memset(&ol, 0, sizeof(ol));
      ol.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
      PERR(ol.hEvent, "CreateEvent");
   }
   while (1)
   {
      bSuccess = WriteFile(writer_params->hPipe, writer_params->szData,
                           writer_params->iDataSize, &dwWritten, OVERLAPPED_IO ? &ol : NULL);
      if (!bSuccess && GetLastError() == ERROR_IO_PENDING)
         bSuccess = GetOverlappedResult(writer_params->hPipe, &ol, &dwWritten,
                                        TRUE);
      /* If ReadFile or GetOverlappedResult fails, check pipe. If pipe is
         broken, fall out of loop */
      if (!bSuccess && !pipeCheck(writer_params->hPipe))
         break;
      /* else check for any other kinds of errors that may have occurred */
      PERR(bSuccess, "WriteFile");
   } /* while */
   free(writer_params);
   CloseHandle(ol.hEvent);
   _endthread();
} /* writer() */

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/npClient/Client32.c File Reference

  • WinBase
  • IPC
  • NamePipe
  • npClient
Defines | Functions | Variables

Client32.c File Reference

#include <windows.h>
#include "client32.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Defines

#define | STRICT

Functions

LONG CALLBACK | ClientDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
LONG CALLBACK | InitDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
VOID | ReadPipe (HANDLE *hPipe)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

CHAR | ClntName [NAME_SIZE]
HANDLE hInst
HWND | hWndClient
CHAR | lpBuffer [255]
CHAR | ShrName [LINE_LEN]

Define Documentation

#define STRICT

Definition at line 30 of file Client32.c.

Function Documentation

LONG CALLBACK ClientDlgProc | ( | HWND | hDlg,
 |  | UINT | wMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 143 of file Client32.c.

  {
  DWORD  retCode;                      // Return code.
  CHAR   errorBuf[LINE_LEN] = "";      // Error message buffer.
  CHAR   outBuf[OUT_BUF_SIZE]  = "";   // Buffer trapping message to send.
  CHAR   sendBuf[OUT_BUF_SIZE] = "";   // Buffer used to modify message.
  DWORD  bytesWritten;                 // Used for WriteFile().
  DWORD  threadID;                     // Used for CreateThread().
  CHAR   fileName[LINE_LEN+NAME_SIZE+2]; // Used to modify pipe/file name.
  DWORD  lastError;                    // Used to get returns from GetLastError.

  static HANDLE hPipe;                 // File or Pipe handle.
  static OVERLAPPED OverLapWrt;        // Overlapped structure
  static HANDLE     hEventWrt;         // Event handle for overlapped writes.

  UNREFERENCED_PARAMETER( lParam );

  hWndClient = hDlg;

  switch (wMsg)
    {

    case WM_COMMAND:
      switch (LOWORD(wParam))
        {

        // When the user presses Send: capture the string from the edit
        // field, prepend it with the user name, and overlap write it to
        // the server instance of the named pipe.

        case IDB_SEND:                 // Get the text from the edit field.
          GetWindowText (GetDlgItem(hDlg,IDD_EDITWRITE),
                         outBuf, PLEASE_WRITE);

                                       // Prepend it with the user name, and
                                       // terminate it with a new line
                                       // character.

          //wsprintf (sendBuf, "%s%s %s\n", ClntName, ":", outBuf);
      // If you use wsprintf, you can't prevent a buffer-overflow when outBuf
      // is long. Instead, use strncpy and strncat to control how much gets
      // written to the buffer. If input is too long, it gets truncated.
          strncpy(sendBuf, ClntName, sizeof(sendBuf) - 1);
      strncat(sendBuf, ": ", sizeof(sendBuf) - strlen(sendBuf) - 1);
      strncat(sendBuf, outBuf, sizeof(sendBuf) - strlen(sendBuf) - 1);
      sendBuf[OUT_BUF_SIZE - 1] = '\0'; // null terminate it

                                       // Do the overlapped write.
          retCode = WriteFile (hPipe, sendBuf, PLEASE_WRITE,
                     &bytesWritten, &OverLapWrt);
          if (!retCode)
            {
            lastError = GetLastError();
                                       // If Error = IO_PENDING, wait til
                                       // the event signals success.
            if (lastError == ERROR_IO_PENDING)
              WaitForSingleObject (hEventWrt, (DWORD)-1);
            }

          return (0);

        default:
          return (0);

        }

    case WM_INITCLIENT:

       // On initialization, use the Init dialog box prompt the user for a
       // net share name and a client or user name.  A share name of "."
       // means that the named pipe is local to this machine.  Named pipe
       // names should have the form '\\.\PIPE<pipename>', for a local machine
       // or '\<machinename>\PIPE<pipename>' for remote machines.
       // Once the share name is captured from the Init dialog box,
       // convert the name into the proper form; then do a CreateFile()
       // to connect to the pipe.  Handle any error from the CreateFile().
       // Then write the user name to the server instance of the named
       // pipe.  Finally, create a thread to read the named pipe.

                                       // Launch Init dialog box to capture
                                       // share name and user name.
       DialogBox ((HANDLE)GetModuleHandle(NULL),
                  (LPCTSTR)"InitDialog",
                  (HWND)hDlg,
                  (DLGPROC)InitDlgProc);

                                       // Put captured user name in window
                                       // caption.
       SetWindowText (hDlg, ClntName);

                                       // Construct file/pipe name.
       wsprintf (fileName, "%s%s%s", "\\\\", ShrName, "\\PIPE\\test");

                                       // Do CreateFile() to connect to the
                                       // named pipe.
       hPipe = CreateFile (fileName,              // Pipe name.
                           GENERIC_WRITE          // Generic access, read/write.
                           | GENERIC_READ,
                           FILE_SHARE_READ        // Share both read and write.
                           | FILE_SHARE_WRITE ,
                           NULL,                  // No security.
                           OPEN_EXISTING,         // Fail if not existing.
                           FILE_FLAG_OVERLAPPED,  // Use overlap.
                           NULL);                 // No template.

                                       // Do some error checking.
       if ((DWORD)(DWORD_PTR)hPipe == 0xFFFFFFFF)
         {
         retCode = GetLastError();

                                       // This error means pipe wasn't found.
         if ((retCode == ERROR_SEEK_ON_DEVICE) ||
             (retCode == ERROR_FILE_NOT_FOUND)) {
             LoadString(hInst, IDS_CANTFINDPIPE, lpBuffer, sizeof(lpBuffer));
             MessageBox (hDlg, lpBuffer, "", MB_OK);
         }
         else
           {                           // Flagging unknown errors.
             LoadString(hInst, IDS_GENERALERROR, lpBuffer, sizeof(lpBuffer));
             wsprintf (errorBuf, lpBuffer, retCode);
             LoadString(hInst, IDS_DEBUGTITLE, lpBuffer, sizeof(lpBuffer));
             MessageBox (hDlg, errorBuf, lpBuffer,
                       MB_ICONINFORMATION | MB_OK | MB_APPLMODAL);
           }

         EndDialog (hDlg, 0);          // Kill app if pipe didn't connect.
         };

                                       // Create and init overlapped structure
                                       // for writes.
       hEventWrt = CreateEvent (NULL, TRUE, FALSE, NULL);
       OverLapWrt.hEvent = hEventWrt;

                                       // Write the client name to server.
       retCode = WriteFile (hPipe, ClntName, PLEASE_WRITE,
                            &bytesWritten, &OverLapWrt);

       if (!retCode)                   // Wait on overlapped if need be.
         {
         lastError = GetLastError();
         if (lastError == ERROR_IO_PENDING)
           WaitForSingleObject (hEventWrt, (DWORD)-1);
         }
                                       // Create a thread to read the pipe.
       CreateThread (NULL,
                     0,
                     (LPTHREAD_START_ROUTINE)ReadPipe,
                     (LPVOID)&hPipe,
                     0,
                     &threadID);
       return (0);

     case WM_INITDIALOG:
                                       // PostMessage() give time for the
                                       // dialog box to be created.
       PostMessage (hDlg, WM_INITCLIENT, 0, 0);
       return (0);

     case WM_GO_AWAY:
       CloseHandle (hPipe);
       CloseHandle (hEventWrt);
       EndDialog (hDlg, TRUE);
       return TRUE;

     case WM_SYSCOMMAND:
       if (wParam == SC_CLOSE)
         {
         CloseHandle (hPipe);
         CloseHandle (hEventWrt);
         EndDialog(hDlg, TRUE);
         return TRUE;
         }
       break;
     }
    return (FALSE);

  }

LONG CALLBACK InitDlgProc | ( | HWND | hDlg,
 |  | UINT | wMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 88 of file Client32.c.

  {

  UNREFERENCED_PARAMETER(lParam);

  switch (wMsg)
    {
    case WM_INITDIALOG:
      PostMessage (GetDlgItem (hDlg, IDD_SVREDIT),
                   EM_LIMITTEXT, LINE_LEN, 0);

      PostMessage (GetDlgItem (hDlg, IDD_CLNTEDIT),
                   EM_LIMITTEXT, NAME_SIZE, 0);
    case WM_COMMAND:
      switch (LOWORD(wParam))
        {                            // When the user clicks okay, get the
        case IDB_INITOK:             // share name and user name from the
                                     // edit fields.
          GetWindowText (GetDlgItem (hDlg, IDD_SVREDIT), ShrName, LINE_LEN);
          GetWindowText (GetDlgItem (hDlg, IDD_CLNTEDIT), ClntName, NAME_SIZE);
          EndDialog(hDlg, 0);
          return (0);

        default:
          return (0);
        }
    default:
      return (0);
    }
  return (0);
  }

VOID ReadPipe ( HANDLE * hPipe )

Definition at line 341 of file Client32.c.

  {
    CHAR       inBuf[IN_BUF_SIZE] = "";// Input buffer.
    DWORD      bytesRead;              // Used for ReadFile()
    DWORD      retCode;                // Used to trap return codes.
    CHAR       Buf[80];                // Message box buffer.
    DWORD      lastError;              // Used to trap returns from GetLastError.

    HANDLE     hEventRd;               // Event handle for overlapped reads.
    OVERLAPPED OverLapRd;              // Overlapped structure.
    DWORD      bytesTrans;             // Bytes transferred in read.

                                       // Create and init overlap structure.
    hEventRd = CreateEvent (NULL, TRUE, FALSE, NULL);
    memset (&OverLapRd, 0, sizeof(OVERLAPPED));
    OverLapRd.hEvent = hEventRd;

    // Loop, reading the named pipe until it is broken.  The ReadFile() uses
    // an overlapped structure.  When the event handle signals a completed
    // read, this loop writes the message to the larger edit field.

    do{
                                       // Read the pipe handle.
      retCode = ReadFile (*hPipe, inBuf, IN_BUF_SIZE, &bytesRead, &OverLapRd);

      if (!retCode) {                  // Do some error checking.

        lastError = GetLastError();
                                       // Check for 3 kinds of errors:
                                       // IO_PENDING, BROKEN_PIPE, or
                                       // other.
                                       // If Error = IO_PENDING, wait for
                                       // event handle to signal success.
        if (lastError == ERROR_IO_PENDING)
          {
          WaitForSingleObject (hEventRd, (DWORD)-1);

          }
        else {                         // If pipe is broken, tell user and break.

          if (lastError == (DWORD)ERROR_BROKEN_PIPE) {
            LoadString(hInst, IDS_CONNECTBROKEN, lpBuffer, sizeof(lpBuffer));
            MessageBox (hWndClient, lpBuffer, "", MB_OK);
          }
          else {                       // Or flag unknown errors, and break.
             LoadString(hInst, IDS_READFAILED, lpBuffer, sizeof(lpBuffer));
             wsprintf (Buf, lpBuffer, GetLastError());
             LoadString(hInst, IDS_CLIENTDBG, lpBuffer, sizeof(lpBuffer));
             MessageBox (hWndClient, Buf, lpBuffer, MB_OK);
          }
          break;
        }
      }
                                       // NULL terminate string.
      GetOverlappedResult (*hPipe, &OverLapRd, &bytesTrans, FALSE);
      inBuf[bytesTrans] = '\0';

                                       // Write message to larger edit field.
      SendMessage (GetDlgItem (hWndClient, IDD_EDITREAD),
                   EM_REPLACESEL,
                   0, (LONG_PTR)inBuf);
                                       // Add a new line.
      SendMessage (GetDlgItem (hWndClient, IDD_EDITREAD),
                   EM_REPLACESEL,
                   0, (LONG_PTR)"\r\n");
      }while(1);

                                       // When pipe is broken, send quit
                                       // messages to Client dialog box.
    PostMessage (hWndClient, WM_GO_AWAY, 0,0);
    ExitThread(0);
  }

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 55 of file Client32.c.

{

  UNREFERENCED_PARAMETER( nCmdShow );
  UNREFERENCED_PARAMETER( lpCmdLine );
  UNREFERENCED_PARAMETER( hPrevInstance );

  hInst   = hInstance;
  return (int)(DialogBox ((HANDLE)hInst, (LPCTSTR)"ClientDialog",
                       0L, (DLGPROC)ClientDlgProc));

}

Variable Documentation

CHAR ClntName[NAME_SIZE]

Definition at line 42 of file Client32.c.

HANDLE hInst

Definition at line 38 of file Client32.c.

HWND hWndClient

Definition at line 39 of file Client32.c.

CHAR lpBuffer[255]

Definition at line 43 of file Client32.c.

CHAR ShrName[LINE_LEN]

Definition at line 41 of file Client32.c.

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/npClient/Client32.h File Reference

  • WinBase
  • IPC
  • NamePipe
  • npClient
Defines | Functions

Client32.h File Reference

Go to the source code of this file.

Defines

#define | IDB_INITOK 705
#define | IDB_SEND 904
#define | IDD_CLNTEDIT 704
#define | IDD_EDITREAD 906
#define | IDD_EDITWRITE 905
#define | IDD_SVREDIT 701
#define | IDS_CANTFINDPIPE 100
#define | IDS_CLIENTDBG 105
#define | IDS_CONNECTBROKEN 103
#define | IDS_DEBUGTITLE 102
#define | IDS_GENERALERROR 101
#define | IDS_READFAILED 104
#define | IN_BUF_SIZE 1000
#define | LINE_LEN 80
#define | NAME_SIZE 25
#define | OUT_BUF_SIZE 1000
#define | PLEASE_READ 1000
#define | PLEASE_WRITE 1000
#define | WM_APP 0x8000
#define | WM_GO_AWAY WM_APP+1
#define | WM_INITCLIENT WM_APP

Functions

LONG CALLBACK | ClientDlgProc (HWND, UINT, WPARAM, LPARAM)
LONG CALLBACK | InitDlgProc (HWND, UINT, WPARAM, LPARAM)
LONG CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
VOID | ReadPipe (HANDLE *)

Define Documentation

#define IDB_INITOK 705

Definition at line 31 of file Client32.h.

#define IDB_SEND 904

Definition at line 25 of file Client32.h.

#define IDD_CLNTEDIT 704

Definition at line 32 of file Client32.h.

#define IDD_EDITREAD 906

Definition at line 27 of file Client32.h.

#define IDD_EDITWRITE 905

Definition at line 26 of file Client32.h.

#define IDD_SVREDIT 701

Definition at line 30 of file Client32.h.

#define IDS_CANTFINDPIPE 100

Definition at line 40 of file Client32.h.

#define IDS_CLIENTDBG 105

Definition at line 45 of file Client32.h.

#define IDS_CONNECTBROKEN 103

Definition at line 43 of file Client32.h.

#define IDS_DEBUGTITLE 102

Definition at line 42 of file Client32.h.

#define IDS_GENERALERROR 101

Definition at line 41 of file Client32.h.

#define IDS_READFAILED 104

Definition at line 44 of file Client32.h.

#define IN_BUF_SIZE 1000

Definition at line 17 of file Client32.h.

#define LINE_LEN 80

Definition at line 21 of file Client32.h.

#define NAME_SIZE 25

Definition at line 22 of file Client32.h.

#define OUT_BUF_SIZE 1000

Definition at line 18 of file Client32.h.

#define PLEASE_READ 1000

Definition at line 19 of file Client32.h.

#define PLEASE_WRITE 1000

Definition at line 20 of file Client32.h.

#define WM_APP 0x8000

Definition at line 35 of file Client32.h.

#define WM_GO_AWAY WM_APP+1

Definition at line 37 of file Client32.h.

#define WM_INITCLIENT WM_APP

Definition at line 36 of file Client32.h.

Function Documentation

LONG CALLBACK ClientDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 143 of file Client32.c.

  {
  DWORD  retCode;                      // Return code.
  CHAR   errorBuf[LINE_LEN] = "";      // Error message buffer.
  CHAR   outBuf[OUT_BUF_SIZE]  = "";   // Buffer trapping message to send.
  CHAR   sendBuf[OUT_BUF_SIZE] = "";   // Buffer used to modify message.
  DWORD  bytesWritten;                 // Used for WriteFile().
  DWORD  threadID;                     // Used for CreateThread().
  CHAR   fileName[LINE_LEN+NAME_SIZE+2]; // Used to modify pipe/file name.
  DWORD  lastError;                    // Used to get returns from GetLastError.

  static HANDLE hPipe;                 // File or Pipe handle.
  static OVERLAPPED OverLapWrt;        // Overlapped structure
  static HANDLE     hEventWrt;         // Event handle for overlapped writes.

  UNREFERENCED_PARAMETER( lParam );

  hWndClient = hDlg;

  switch (wMsg)
    {

    case WM_COMMAND:
      switch (LOWORD(wParam))
        {

        // When the user presses Send: capture the string from the edit
        // field, prepend it with the user name, and overlap write it to
        // the server instance of the named pipe.

        case IDB_SEND:                 // Get the text from the edit field.
          GetWindowText (GetDlgItem(hDlg,IDD_EDITWRITE),
                         outBuf, PLEASE_WRITE);

                                       // Prepend it with the user name, and
                                       // terminate it with a new line
                                       // character.

          //wsprintf (sendBuf, "%s%s %s\n", ClntName, ":", outBuf);
      // If you use wsprintf, you can't prevent a buffer-overflow when outBuf
      // is long. Instead, use strncpy and strncat to control how much gets
      // written to the buffer. If input is too long, it gets truncated.
          strncpy(sendBuf, ClntName, sizeof(sendBuf) - 1);
      strncat(sendBuf, ": ", sizeof(sendBuf) - strlen(sendBuf) - 1);
      strncat(sendBuf, outBuf, sizeof(sendBuf) - strlen(sendBuf) - 1);
      sendBuf[OUT_BUF_SIZE - 1] = '\0'; // null terminate it

                                       // Do the overlapped write.
          retCode = WriteFile (hPipe, sendBuf, PLEASE_WRITE,
                     &bytesWritten, &OverLapWrt);
          if (!retCode)
            {
            lastError = GetLastError();
                                       // If Error = IO_PENDING, wait til
                                       // the event signals success.
            if (lastError == ERROR_IO_PENDING)
              WaitForSingleObject (hEventWrt, (DWORD)-1);
            }

          return (0);

        default:
          return (0);

        }

    case WM_INITCLIENT:

       // On initialization, use the Init dialog box prompt the user for a
       // net share name and a client or user name.  A share name of "."
       // means that the named pipe is local to this machine.  Named pipe
       // names should have the form '\\.\PIPE<pipename>', for a local machine
       // or '\<machinename>\PIPE<pipename>' for remote machines.
       // Once the share name is captured from the Init dialog box,
       // convert the name into the proper form; then do a CreateFile()
       // to connect to the pipe.  Handle any error from the CreateFile().
       // Then write the user name to the server instance of the named
       // pipe.  Finally, create a thread to read the named pipe.

                                       // Launch Init dialog box to capture
                                       // share name and user name.
       DialogBox ((HANDLE)GetModuleHandle(NULL),
                  (LPCTSTR)"InitDialog",
                  (HWND)hDlg,
                  (DLGPROC)InitDlgProc);

                                       // Put captured user name in window
                                       // caption.
       SetWindowText (hDlg, ClntName);

                                       // Construct file/pipe name.
       wsprintf (fileName, "%s%s%s", "\\\\", ShrName, "\\PIPE\\test");

                                       // Do CreateFile() to connect to the
                                       // named pipe.
       hPipe = CreateFile (fileName,              // Pipe name.
                           GENERIC_WRITE          // Generic access, read/write.
                           | GENERIC_READ,
                           FILE_SHARE_READ        // Share both read and write.
                           | FILE_SHARE_WRITE ,
                           NULL,                  // No security.
                           OPEN_EXISTING,         // Fail if not existing.
                           FILE_FLAG_OVERLAPPED,  // Use overlap.
                           NULL);                 // No template.

                                       // Do some error checking.
       if ((DWORD)(DWORD_PTR)hPipe == 0xFFFFFFFF)
         {
         retCode = GetLastError();

                                       // This error means pipe wasn't found.
         if ((retCode == ERROR_SEEK_ON_DEVICE) ||
             (retCode == ERROR_FILE_NOT_FOUND)) {
             LoadString(hInst, IDS_CANTFINDPIPE, lpBuffer, sizeof(lpBuffer));
             MessageBox (hDlg, lpBuffer, "", MB_OK);
         }
         else
           {                           // Flagging unknown errors.
             LoadString(hInst, IDS_GENERALERROR, lpBuffer, sizeof(lpBuffer));
             wsprintf (errorBuf, lpBuffer, retCode);
             LoadString(hInst, IDS_DEBUGTITLE, lpBuffer, sizeof(lpBuffer));
             MessageBox (hDlg, errorBuf, lpBuffer,
                       MB_ICONINFORMATION | MB_OK | MB_APPLMODAL);
           }

         EndDialog (hDlg, 0);          // Kill app if pipe didn't connect.
         };

                                       // Create and init overlapped structure
                                       // for writes.
       hEventWrt = CreateEvent (NULL, TRUE, FALSE, NULL);
       OverLapWrt.hEvent = hEventWrt;

                                       // Write the client name to server.
       retCode = WriteFile (hPipe, ClntName, PLEASE_WRITE,
                            &bytesWritten, &OverLapWrt);

       if (!retCode)                   // Wait on overlapped if need be.
         {
         lastError = GetLastError();
         if (lastError == ERROR_IO_PENDING)
           WaitForSingleObject (hEventWrt, (DWORD)-1);
         }
                                       // Create a thread to read the pipe.
       CreateThread (NULL,
                     0,
                     (LPTHREAD_START_ROUTINE)ReadPipe,
                     (LPVOID)&hPipe,
                     0,
                     &threadID);
       return (0);

     case WM_INITDIALOG:
                                       // PostMessage() give time for the
                                       // dialog box to be created.
       PostMessage (hDlg, WM_INITCLIENT, 0, 0);
       return (0);

     case WM_GO_AWAY:
       CloseHandle (hPipe);
       CloseHandle (hEventWrt);
       EndDialog (hDlg, TRUE);
       return TRUE;

     case WM_SYSCOMMAND:
       if (wParam == SC_CLOSE)
         {
         CloseHandle (hPipe);
         CloseHandle (hEventWrt);
         EndDialog(hDlg, TRUE);
         return TRUE;
         }
       break;
     }
    return (FALSE);

  }

LONG CALLBACK InitDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 88 of file Client32.c.

  {

  UNREFERENCED_PARAMETER(lParam);

  switch (wMsg)
    {
    case WM_INITDIALOG:
      PostMessage (GetDlgItem (hDlg, IDD_SVREDIT),
                   EM_LIMITTEXT, LINE_LEN, 0);

      PostMessage (GetDlgItem (hDlg, IDD_CLNTEDIT),
                   EM_LIMITTEXT, NAME_SIZE, 0);
    case WM_COMMAND:
      switch (LOWORD(wParam))
        {                            // When the user clicks okay, get the
        case IDB_INITOK:             // share name and user name from the
                                     // edit fields.
          GetWindowText (GetDlgItem (hDlg, IDD_SVREDIT), ShrName, LINE_LEN);
          GetWindowText (GetDlgItem (hDlg, IDD_CLNTEDIT), ClntName, NAME_SIZE);
          EndDialog(hDlg, 0);
          return (0);

        default:
          return (0);
        }
    default:
      return (0);
    }
  return (0);
  }

LONG CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

VOID ReadPipe ( HANDLE * )

Definition at line 341 of file Client32.c.

  {
    CHAR       inBuf[IN_BUF_SIZE] = "";// Input buffer.
    DWORD      bytesRead;              // Used for ReadFile()
    DWORD      retCode;                // Used to trap return codes.
    CHAR       Buf[80];                // Message box buffer.
    DWORD      lastError;              // Used to trap returns from GetLastError.

    HANDLE     hEventRd;               // Event handle for overlapped reads.
    OVERLAPPED OverLapRd;              // Overlapped structure.
    DWORD      bytesTrans;             // Bytes transferred in read.

                                       // Create and init overlap structure.
    hEventRd = CreateEvent (NULL, TRUE, FALSE, NULL);
    memset (&OverLapRd, 0, sizeof(OVERLAPPED));
    OverLapRd.hEvent = hEventRd;

    // Loop, reading the named pipe until it is broken.  The ReadFile() uses
    // an overlapped structure.  When the event handle signals a completed
    // read, this loop writes the message to the larger edit field.

    do{
                                       // Read the pipe handle.
      retCode = ReadFile (*hPipe, inBuf, IN_BUF_SIZE, &bytesRead, &OverLapRd);

      if (!retCode) {                  // Do some error checking.

        lastError = GetLastError();
                                       // Check for 3 kinds of errors:
                                       // IO_PENDING, BROKEN_PIPE, or
                                       // other.
                                       // If Error = IO_PENDING, wait for
                                       // event handle to signal success.
        if (lastError == ERROR_IO_PENDING)
          {
          WaitForSingleObject (hEventRd, (DWORD)-1);

          }
        else {                         // If pipe is broken, tell user and break.

          if (lastError == (DWORD)ERROR_BROKEN_PIPE) {
            LoadString(hInst, IDS_CONNECTBROKEN, lpBuffer, sizeof(lpBuffer));
            MessageBox (hWndClient, lpBuffer, "", MB_OK);
          }
          else {                       // Or flag unknown errors, and break.
             LoadString(hInst, IDS_READFAILED, lpBuffer, sizeof(lpBuffer));
             wsprintf (Buf, lpBuffer, GetLastError());
             LoadString(hInst, IDS_CLIENTDBG, lpBuffer, sizeof(lpBuffer));
             MessageBox (hWndClient, Buf, lpBuffer, MB_OK);
          }
          break;
        }
      }
                                       // NULL terminate string.
      GetOverlappedResult (*hPipe, &OverLapRd, &bytesTrans, FALSE);
      inBuf[bytesTrans] = '\0';

                                       // Write message to larger edit field.
      SendMessage (GetDlgItem (hWndClient, IDD_EDITREAD),
                   EM_REPLACESEL,
                   0, (LONG_PTR)inBuf);
                                       // Add a new line.
      SendMessage (GetDlgItem (hWndClient, IDD_EDITREAD),
                   EM_REPLACESEL,
                   0, (LONG_PTR)"\r\n");
      }while(1);

                                       // When pipe is broken, send quit
                                       // messages to Client dialog box.
    PostMessage (hWndClient, WM_GO_AWAY, 0,0);
    ExitThread(0);
  }

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/NPServer/Server32.c File Reference

  • WinBase
  • IPC
  • NamePipe
  • NPServer
Defines | Functions | Variables

Server32.c File Reference

#include <windows.h>
#include <sddl.h>
#include "server32.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Defines

#define | STRICT

Functions

BOOL | CreateMyDACL (SECURITY_ATTRIBUTES *pSA)
VOID | DrawBranch (HDC hDC)
LRESULT CALLBACK | MainWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
VOID | ServerProc (HWND *hWnd)
VOID | TellAll (CHAR *buffer)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

DWORD | clientCount = 0
WRTHANDLE | clients [MAX_PIPE_INSTANCES]
HANDLE hInst
HWND | hWnd
CHAR | lpBuffer [255]

Define Documentation

#define STRICT

Definition at line 29 of file Server32.c.

Function Documentation

BOOL CreateMyDACL ( SECURITY_ATTRIBUTES * pSA )

Definition at line 68 of file Server32.c.

{
    // Define the SDDL for the DACL. This example sets
    // the following access:
    //     Built-in guests are denied all access.
    //     Anonymous Logon is denied all access.
    //     Authenticated Users are allowed read/write/execute access.
    //     Administrators are allowed full control.
    // Modify these values as needed to generate the proper
    // DACL for your application.
    TCHAR * szSD = "D:"                   // Discretionary ACL
                   "(D;OICI;GA;;;BG)"     // Deny access to Built-in Guests
                   "(D;OICI;GA;;;AN)"     // Deny access to Anonymous Logon
                   "(A;OICI;GRGWGX;;;AU)" // Allow read/write/execute to Authenticated Users
                   "(A;OICI;GA;;;BA)";    // Allow full control to Administrators

    if (NULL == pSA)
        return FALSE;

    return ConvertStringSecurityDescriptorToSecurityDescriptor(
                                                              szSD,
                                                              SDDL_REVISION_1,
                                                              &(pSA->lpSecurityDescriptor),
                                                              NULL);
}

VOID DrawBranch ( HDC hDC )

Definition at line 533 of file Server32.c.

{
                                       // Spool bitmaps.
  HBITMAP hEndLive, hEndDead, hMidLive, hMidDead, hBitMap;

  HDC hDCMem;
  int X, Y;
  BITMAP bm;
  POINT ptSize, ptOrg;
  DWORD index;

                                       // Load bitmaps: two red (live),
                                       // two dead (gray).  End = end
                                       // of tree (last client to connect),
                                       // mid means in the middle somewhere.
       hEndLive = LoadBitmap (hInst, "EndLive");
       hEndDead = LoadBitmap (hInst, "EndDead");

       hMidLive = LoadBitmap (hInst, "MidLive");
       hMidDead = LoadBitmap (hInst, "MidDead");

                                       // For each client, determine if
                                       // if alive or not, and position;
                                       // then blt appropriate map and
                                       // clients name.
    for (index = 0; index < clientCount; index++)
      {

      if (index < clientCount - 1)     // ClientCount - 1 = last (end) client.
       {
        if(clients[index].live)        // If live = red, else = gray.
         hBitMap = hMidLive;
        else
         hBitMap = hMidDead;
       }
      else
       {
        if(clients[index].live)        // If live = red, else = gray.
         hBitMap = hEndLive;
        else
         hBitMap = hEndDead;
       }
                                       // Calculate coordinates:
      X = BITMAP_X;                    // X position is constant.
      Y = index * BITMAP_Y;            // Y is based on index in the array.

                                       // Blt the chosen map.
      hDCMem = CreateCompatibleDC(hDC);
      SelectObject(hDCMem, hBitMap);
      SetMapMode(hDCMem, GetMapMode(hDC));

      GetObject(hBitMap, sizeof(BITMAP), &bm);

      ptSize.x = bm.bmWidth;
      ptSize.y = bm.bmHeight;
      DPtoLP (hDC, &ptSize, 1);

      ptOrg.x = 0;
      ptOrg.y = 0;
      DPtoLP (hDCMem, &ptOrg, 1);

      BitBlt(hDC, X, Y, ptSize.x, ptSize.y,
             hDCMem, ptOrg.x, ptOrg.y, SRCCOPY);

      X =  NAME_X;                     // Relocate X,Y for clients name.
      Y += NAME_Y;
                                       // Write name next to spool.
      TextOut (hDC, X, Y, clients[index].Name, (int)strlen(clients[index].Name));
      DeleteDC(hDCMem);
      }

}

LRESULT CALLBACK MainWndProc | ( | HWND | hwnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 183 of file Server32.c.

{

  LONG        lpServerThreadID;
  PAINTSTRUCT paintStruct;
  HDC         hDC;

  switch (message)
      {
        case WM_PAINT:
           // DrawBranch is used to paint the spools and text to the window.
           hDC = BeginPaint (hwnd, &paintStruct);
           DrawBranch (hDC);
           EndPaint (hwnd, &paintStruct);
           return(0);

        case WM_CREATE :
           // Create the first instance of a server side of the pipe.
           CreateThread ((LPSECURITY_ATTRIBUTES)NULL,       // No security.
                         (DWORD)0,                          // Same stack size.
                         (LPTHREAD_START_ROUTINE)ServerProc,// Thread procedure.
                         (LPVOID)&hwnd,                     // Parameter.
                         (DWORD)0,                          // Start immediatly.
                         (LPDWORD)&lpServerThreadID);       // Thread ID.
           return (0);

        case WM_DESTROY :
           PostQuitMessage (0);
           return (0);
       }
    return DefWindowProc (hwnd, message, wParam, lParam);
}

VOID ServerProc ( HWND * hWnd )

Definition at line 255 of file Server32.c.

 {
   HANDLE hThread;                       // Pipe handle.
   HANDLE hPipe;                       // Pipe handle.
   CHAR   inBuf[IN_BUF_SIZE] = "";     // Input buffer for pipe.
   DWORD  ServerThreadID;              // Used for CreateThread().

   CHAR   errorBuf[LINE_LEN] = "";     // Used for error messages.
   DWORD  bytesRead;                   // Used in ReadFile().
   DWORD  retCode;                     // Used to trap return codes.
   DWORD  clientIndex;                 // Index into global array, for this
                                       // instances client.
   DWORD  lastError;                   // Traps returns from GetLastError().
   BOOL   ExitLoop = FALSE;            // Boolean Flag to exit loop.

   OVERLAPPED OverLapWrt;              // Overlapped structure for writing.
   HANDLE     hEventWrt;               // Event handle for overlapped write.

   OVERLAPPED OverLapRd;               // Overlapped structure for reading.
   HANDLE     hEventRd;                // Event handle for overlapped reads.
   DWORD        bytesTransRd;          // Bytes transferred by overlapped.
   //PSECURITY_DESCRIPTOR    pSD;
   SECURITY_ATTRIBUTES     sa;

   if (!CreateMyDACL(&sa))
     {
     MessageBox (*hWnd, "CreateMyDACL Failed", "Debug: ServerProc()", MB_OK);
     return;
     }

   sa.nLength = sizeof(sa);
   sa.bInheritHandle = TRUE;

                                       // Create a local named pipe with
                                       // the name '\\.\PIPE\test'.  The
                                       // '.' signifies local pipe.
   hPipe = CreateNamedPipe ("\\\\.\\PIPE\\test", // Pipe name = 'test'.
               PIPE_ACCESS_DUPLEX                // 2 way pipe.
               | FILE_FLAG_OVERLAPPED,           // Use overlapped structure.
               PIPE_WAIT                         // Wait on messages.
               | PIPE_READMODE_MESSAGE           // Specify message mode pipe.
               | PIPE_TYPE_MESSAGE,
               MAX_PIPE_INSTANCES,               // Maximum instance limit.
               OUT_BUF_SIZE,                     // Buffer sizes.
               IN_BUF_SIZE,
               TIME_OUT,                         // Specify time out.
               &sa);                             // Security attributes.

                                       // Check Errors.
    if ((DWORD)(DWORD_PTR)hPipe == 0xFFFFFFFF)
     {

     retCode = GetLastError();         // Report any error, it should always succeed.
     LoadString(hInst, IDS_ERRORCODE, lpBuffer, sizeof(lpBuffer));
     wsprintf (errorBuf, lpBuffer, retCode);
     LoadString(hInst, IDS_DEBUGTITLE, lpBuffer, sizeof(lpBuffer));
     MessageBox (*hWnd, errorBuf, lpBuffer,
                 MB_ICONINFORMATION | MB_OK | MB_APPLMODAL);
     };

                                       // Block until a client connects.
   ConnectNamedPipe(hPipe, NULL);

                                       // Create and init overlap for writing.
   hEventWrt = CreateEvent (NULL, TRUE, FALSE, NULL);
   memset (&OverLapWrt, 0, sizeof(OVERLAPPED));
   OverLapWrt.hEvent = hEventWrt;

                                       // Set the clientIndex, then increment
                                       // the count.  Fill in the structure
                                       // for this client in the array.
   clientIndex = clientCount++;
   clients[clientIndex].hPipe   = hPipe;
   clients[clientIndex].live    = TRUE;
   clients[clientIndex].overLap = OverLapWrt;
   clients[clientIndex].hEvent  = hEventWrt;

                                       // Create and init overlap for reading.
   hEventRd = CreateEvent(NULL,TRUE,FALSE,NULL);
   memset (&OverLapRd, 0, sizeof(OVERLAPPED));
   OverLapRd.hEvent = hEventRd;

                                       // Read from the client, the first
                                       // first message should always be
                                       // the clients user name.
   retCode = ReadFile (hPipe, inBuf, PLEASE_READ, &bytesRead, &OverLapRd);

   if (!retCode)
    lastError = GetLastError();

   if (lastError == ERROR_IO_PENDING)  // Wait on read if need be.
     WaitForSingleObject (hEventRd, (DWORD)-1);

                                       // Put client's name in the array.
   strcpy (clients[clientIndex].Name, inBuf);

                                       // Create a thread which will make
                                       // another server instance of the
                                       // named pipe.
   hThread = CreateThread ((LPSECURITY_ATTRIBUTES)NULL,        // No security attributes.
                 (DWORD)0,                           // Use same stack size.
                 (LPTHREAD_START_ROUTINE)ServerProc, // Thread procedure.
                 (LPVOID)hWnd,                       // Parameter to pass.
                 (DWORD)0,                           // Run immediately.
                 (LPDWORD)&ServerThreadID);          // Thread identifier.

   clients[clientIndex].hThread   = hThread;

   TellAll("");                        // Forces a paint, draws a red spool
                                       // and name for this client.

                                       // Do loop which basically reads from
                                       // this specific client, and then
                                       // uses TellAll() to broadcast the
                                       // message to all the connected
                                       // clients.
   do{
                                       // Read the pipe.
      retCode = ReadFile (hPipe, inBuf, PLEASE_READ, &bytesRead, &OverLapRd);

                                       // Check for three kinds of errors:
                                       // If Error = IO_PENDING, wait til
                                       // the event handle signals success,
                                       // If BROKEN_PIPE, exit the do loop.
                                       // Any other error, flag it to the
                                       // user and exit the do loop.
      if (!retCode)
        {
        lastError = GetLastError();

        switch (lastError)
          {
                                       // IO_PENDING, wait on the event.
           case ERROR_IO_PENDING:
             WaitForSingleObject (hEventRd, (DWORD)-1);
             break;
                                       // Pipe is broken, exit the loop.
           case ERROR_BROKEN_PIPE:
             ExitLoop = TRUE;
             break;
                                       // Something else is wrong, exit the
                                       // the loop after telling the user.
           default:
             LoadString(hInst, IDS_READERROR, lpBuffer, sizeof(lpBuffer));
             wsprintf (errorBuf, lpBuffer, lastError);
             LoadString(hInst, IDS_DEBUGINFO, lpBuffer, sizeof(lpBuffer));
             MessageBox (*hWnd, errorBuf, lpBuffer, MB_OK);
             ExitLoop = TRUE;
             break;
          }
        }

      if (!ExitLoop)
        {
        GetOverlappedResult (hPipe, &OverLapRd, &bytesTransRd, FALSE);

                                       // Use TellAll to broadcast the message.
        if (bytesTransRd)
          TellAll(inBuf);
        else
          TellAll("");
        }

   }while(!ExitLoop);

   clients[clientIndex].live = FALSE;  // Turns spool gray.
   CloseHandle (hPipe);                // Close handles.
   CloseHandle (hEventRd);
   CloseHandle (hEventWrt);
   DisconnectNamedPipe (hPipe);        // Close pipe instance.
   ExitThread(0);                      // Clean up and die.
  }

VOID TellAll ( CHAR * buffer )

Definition at line 452 of file Server32.c.

  {
    DWORD i;                           // Index through array.
    DWORD bytesWritten;                // Used in WriteFile().
    DWORD retCode;                     // Traps return codes.
    CHAR  Buf[LINE_LEN];               // Message Buffer.
    DWORD lastError;                   // Traps returns from GetLastError().

    for(i=0; i < clientCount; i++)     // For all clients in the array.
      {
                                       // If client isn't alive, don't waste
                                       // time writing to it.
      if (clients[i].live)
        {
        retCode = WriteFile (clients[i].hPipe, buffer, (DWORD)strlen(buffer),
                             &bytesWritten, &clients[i].overLap);

                                       // Check 3 kinds of errors: IO_PENDING,
                                       // NO_DATA, or other.  Wait on event
                                       // handle if IO_PENDING, else, if it's
                                       // anything other than NO_DATA (pipe
                                       // client disconnected), flag the user.
                                       // In any case, if it's not IO_PENDING,
                                       // clients[i].live = FALSE, spool turns
                                       // gray.
        if (!retCode)
          {
          lastError = GetLastError();

                                       // IO_PENDING, wait on event handle.
          if (lastError == ERROR_IO_PENDING)
            {
            WaitForSingleObject (clients[i].hEvent, (DWORD)-1);
            }
          else
            {
                                       // If not NO_DATA, flag user.
            if (lastError != ERROR_NO_DATA)
              {
              LoadString(hInst, IDS_DEBUGLAST, lpBuffer, sizeof(lpBuffer));
              wsprintf (Buf, "%s = %d", buffer, GetLastError());
              MessageBox(hWnd, Buf, lpBuffer, MB_OK);
              }
            clients[i].live = FALSE;
            }
          }
        } //if client.live

        // Unused thread handles have to be cleaned up.
        // Otherwise, handle leakage will occur.
        if ((clients[i].hThread != NULL) && (clients[i].live == FALSE))
        {
          CloseHandle(clients[i].hThread);
          clients[i].hThread = NULL;
        }
      } // for loop
                                       // Paint window with new information.
    InvalidateRect(hWnd, NULL, TRUE);
  }

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 104 of file Server32.c.

{

  MSG  msg;
  WNDCLASS wc;

  UNREFERENCED_PARAMETER( lpCmdLine );
  UNREFERENCED_PARAMETER( hPrevInstance );

  //
  // Detect platform and exit gracefully if not Windows NT.
  //

  {
    OSVERSIONINFO osvi;
    osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);

    GetVersionEx (&osvi);
    if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT) {
          LoadString(hInst, IDS_WRONGOS, lpBuffer, sizeof(lpBuffer));
      MessageBox (NULL, lpBuffer, "SERVER32", MB_OK | MB_ICONSTOP);
      return 0;
    }
  }

  hInst = hInstance;

  wc.style = 0;
  wc.lpfnWndProc = (WNDPROC)MainWndProc;
  wc.cbClsExtra = 0;
  wc.cbWndExtra = 0;
  wc.hInstance = hInstance;
  wc.hIcon = LoadIcon (hInstance, "npserver");
  wc.hCursor = LoadCursor (NULL, IDC_ARROW);
  wc.hbrBackground = GetStockObject (WHITE_BRUSH);
  wc.lpszMenuName = "PipeMenu";
  wc.lpszClassName = "PipeWClass";

  RegisterClass(&wc);

  LoadString(hInst, IDS_WINDOWTITLE, lpBuffer, sizeof(lpBuffer));
  hWnd = CreateWindow ("PipeWClass",
                       lpBuffer,
                       WS_OVERLAPPEDWINDOW,
                       CW_USEDEFAULT,
                       CW_USEDEFAULT,
                       CW_USEDEFAULT,
                       CW_USEDEFAULT,
                       NULL,
                       NULL,
                       hInstance,
                       NULL);

  ShowWindow (hWnd, nCmdShow);

  while (GetMessage (&msg, NULL, 0, 0))
    DispatchMessage (&msg);

  return (int)(msg.wParam);

}

Variable Documentation

DWORD clientCount = 0

Definition at line 47 of file Server32.c.

WRTHANDLE clients[MAX_PIPE_INSTANCES]

Definition at line 46 of file Server32.c.

HANDLE hInst

Definition at line 50 of file Server32.c.

HWND hWnd

Definition at line 49 of file Server32.c.

CHAR lpBuffer[255]

Definition at line 51 of file Server32.c.

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/NPServer/Server32.h File Reference

  • WinBase
  • IPC
  • NamePipe
  • NPServer
Classes | Defines | Functions

Server32.h File Reference

Go to the source code of this file.

Classes

struct | WRTHANDLE

Defines

#define | BITMAP_X 20
#define | BITMAP_Y 32
#define | END_DEAD 2
#define | END_LIVE 1
#define | IDS_DEBUGINFO 105
#define | IDS_DEBUGLAST 106
#define | IDS_DEBUGTITLE 103
#define | IDS_ERRORCODE 102
#define | IDS_READERROR 104
#define | IDS_WINDOWTITLE 101
#define | IDS_WRONGOS 100
#define | IN_BUF_SIZE 1000
#define | LINE_LEN 80
#define | MAX_PIPE_INSTANCES 100
#define | MID_DEAD 4
#define | MID_LIVE 3
#define | NAME_SIZE 25
#define | NAME_X 60
#define | NAME_Y 10
#define | OUT_BUF_SIZE 1000
#define | PLEASE_READ 1000
#define | PLEASE_WRITE 1000
#define | TIME_OUT 0

Functions

VOID | DrawBranch (HDC)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
VOID | ServerProc (HWND *)
VOID | TellAll (CHAR *)

Define Documentation

#define BITMAP_X 20

Definition at line 26 of file Server32.h.

#define BITMAP_Y 32

Definition at line 27 of file Server32.h.

#define END_DEAD 2

Definition at line 23 of file Server32.h.

#define END_LIVE 1

Definition at line 22 of file Server32.h.

#define IDS_DEBUGINFO 105

Definition at line 44 of file Server32.h.

#define IDS_DEBUGLAST 106

Definition at line 45 of file Server32.h.

#define IDS_DEBUGTITLE 103

Definition at line 42 of file Server32.h.

#define IDS_ERRORCODE 102

Definition at line 41 of file Server32.h.

#define IDS_READERROR 104

Definition at line 43 of file Server32.h.

#define IDS_WINDOWTITLE 101

Definition at line 40 of file Server32.h.

#define IDS_WRONGOS 100

Definition at line 39 of file Server32.h.

#define IN_BUF_SIZE 1000

Definition at line 32 of file Server32.h.

#define LINE_LEN 80

Definition at line 18 of file Server32.h.

#define MAX_PIPE_INSTANCES 100

Definition at line 16 of file Server32.h.

#define MID_DEAD 4

Definition at line 25 of file Server32.h.

#define MID_LIVE 3

Definition at line 24 of file Server32.h.

#define NAME_SIZE 25

Definition at line 19 of file Server32.h.

#define NAME_X 60

Definition at line 28 of file Server32.h.

#define NAME_Y 10

Definition at line 29 of file Server32.h.

#define OUT_BUF_SIZE 1000

Definition at line 33 of file Server32.h.

#define PLEASE_READ 1000

Definition at line 35 of file Server32.h.

#define PLEASE_WRITE 1000

Definition at line 36 of file Server32.h.

#define TIME_OUT 0

Definition at line 34 of file Server32.h.

Function Documentation

VOID DrawBranch ( HDC )

Definition at line 533 of file Server32.c.

{
                                       // Spool bitmaps.
  HBITMAP hEndLive, hEndDead, hMidLive, hMidDead, hBitMap;

  HDC hDCMem;
  int X, Y;
  BITMAP bm;
  POINT ptSize, ptOrg;
  DWORD index;

                                       // Load bitmaps: two red (live),
                                       // two dead (gray).  End = end
                                       // of tree (last client to connect),
                                       // mid means in the middle somewhere.
       hEndLive = LoadBitmap (hInst, "EndLive");
       hEndDead = LoadBitmap (hInst, "EndDead");

       hMidLive = LoadBitmap (hInst, "MidLive");
       hMidDead = LoadBitmap (hInst, "MidDead");

                                       // For each client, determine if
                                       // if alive or not, and position;
                                       // then blt appropriate map and
                                       // clients name.
    for (index = 0; index < clientCount; index++)
      {

      if (index < clientCount - 1)     // ClientCount - 1 = last (end) client.
       {
        if(clients[index].live)        // If live = red, else = gray.
         hBitMap = hMidLive;
        else
         hBitMap = hMidDead;
       }
      else
       {
        if(clients[index].live)        // If live = red, else = gray.
         hBitMap = hEndLive;
        else
         hBitMap = hEndDead;
       }
                                       // Calculate coordinates:
      X = BITMAP_X;                    // X position is constant.
      Y = index * BITMAP_Y;            // Y is based on index in the array.

                                       // Blt the chosen map.
      hDCMem = CreateCompatibleDC(hDC);
      SelectObject(hDCMem, hBitMap);
      SetMapMode(hDCMem, GetMapMode(hDC));

      GetObject(hBitMap, sizeof(BITMAP), &bm);

      ptSize.x = bm.bmWidth;
      ptSize.y = bm.bmHeight;
      DPtoLP (hDC, &ptSize, 1);

      ptOrg.x = 0;
      ptOrg.y = 0;
      DPtoLP (hDCMem, &ptOrg, 1);

      BitBlt(hDC, X, Y, ptSize.x, ptSize.y,
             hDCMem, ptOrg.x, ptOrg.y, SRCCOPY);

      X =  NAME_X;                     // Relocate X,Y for clients name.
      Y += NAME_Y;
                                       // Write name next to spool.
      TextOut (hDC, X, Y, clients[index].Name, (int)strlen(clients[index].Name));
      DeleteDC(hDCMem);
      }

}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

VOID ServerProc ( HWND * )

Definition at line 255 of file Server32.c.

 {
   HANDLE hThread;                       // Pipe handle.
   HANDLE hPipe;                       // Pipe handle.
   CHAR   inBuf[IN_BUF_SIZE] = "";     // Input buffer for pipe.
   DWORD  ServerThreadID;              // Used for CreateThread().

   CHAR   errorBuf[LINE_LEN] = "";     // Used for error messages.
   DWORD  bytesRead;                   // Used in ReadFile().
   DWORD  retCode;                     // Used to trap return codes.
   DWORD  clientIndex;                 // Index into global array, for this
                                       // instances client.
   DWORD  lastError;                   // Traps returns from GetLastError().
   BOOL   ExitLoop = FALSE;            // Boolean Flag to exit loop.

   OVERLAPPED OverLapWrt;              // Overlapped structure for writing.
   HANDLE     hEventWrt;               // Event handle for overlapped write.

   OVERLAPPED OverLapRd;               // Overlapped structure for reading.
   HANDLE     hEventRd;                // Event handle for overlapped reads.
   DWORD        bytesTransRd;          // Bytes transferred by overlapped.
   //PSECURITY_DESCRIPTOR    pSD;
   SECURITY_ATTRIBUTES     sa;

   if (!CreateMyDACL(&sa))
     {
     MessageBox (*hWnd, "CreateMyDACL Failed", "Debug: ServerProc()", MB_OK);
     return;
     }

   sa.nLength = sizeof(sa);
   sa.bInheritHandle = TRUE;

                                       // Create a local named pipe with
                                       // the name '\\.\PIPE\test'.  The
                                       // '.' signifies local pipe.
   hPipe = CreateNamedPipe ("\\\\.\\PIPE\\test", // Pipe name = 'test'.
               PIPE_ACCESS_DUPLEX                // 2 way pipe.
               | FILE_FLAG_OVERLAPPED,           // Use overlapped structure.
               PIPE_WAIT                         // Wait on messages.
               | PIPE_READMODE_MESSAGE           // Specify message mode pipe.
               | PIPE_TYPE_MESSAGE,
               MAX_PIPE_INSTANCES,               // Maximum instance limit.
               OUT_BUF_SIZE,                     // Buffer sizes.
               IN_BUF_SIZE,
               TIME_OUT,                         // Specify time out.
               &sa);                             // Security attributes.

                                       // Check Errors.
    if ((DWORD)(DWORD_PTR)hPipe == 0xFFFFFFFF)
     {

     retCode = GetLastError();         // Report any error, it should always succeed.
     LoadString(hInst, IDS_ERRORCODE, lpBuffer, sizeof(lpBuffer));
     wsprintf (errorBuf, lpBuffer, retCode);
     LoadString(hInst, IDS_DEBUGTITLE, lpBuffer, sizeof(lpBuffer));
     MessageBox (*hWnd, errorBuf, lpBuffer,
                 MB_ICONINFORMATION | MB_OK | MB_APPLMODAL);
     };

                                       // Block until a client connects.
   ConnectNamedPipe(hPipe, NULL);

                                       // Create and init overlap for writing.
   hEventWrt = CreateEvent (NULL, TRUE, FALSE, NULL);
   memset (&OverLapWrt, 0, sizeof(OVERLAPPED));
   OverLapWrt.hEvent = hEventWrt;

                                       // Set the clientIndex, then increment
                                       // the count.  Fill in the structure
                                       // for this client in the array.
   clientIndex = clientCount++;
   clients[clientIndex].hPipe   = hPipe;
   clients[clientIndex].live    = TRUE;
   clients[clientIndex].overLap = OverLapWrt;
   clients[clientIndex].hEvent  = hEventWrt;

                                       // Create and init overlap for reading.
   hEventRd = CreateEvent(NULL,TRUE,FALSE,NULL);
   memset (&OverLapRd, 0, sizeof(OVERLAPPED));
   OverLapRd.hEvent = hEventRd;

                                       // Read from the client, the first
                                       // first message should always be
                                       // the clients user name.
   retCode = ReadFile (hPipe, inBuf, PLEASE_READ, &bytesRead, &OverLapRd);

   if (!retCode)
    lastError = GetLastError();

   if (lastError == ERROR_IO_PENDING)  // Wait on read if need be.
     WaitForSingleObject (hEventRd, (DWORD)-1);

                                       // Put client's name in the array.
   strcpy (clients[clientIndex].Name, inBuf);

                                       // Create a thread which will make
                                       // another server instance of the
                                       // named pipe.
   hThread = CreateThread ((LPSECURITY_ATTRIBUTES)NULL,        // No security attributes.
                 (DWORD)0,                           // Use same stack size.
                 (LPTHREAD_START_ROUTINE)ServerProc, // Thread procedure.
                 (LPVOID)hWnd,                       // Parameter to pass.
                 (DWORD)0,                           // Run immediately.
                 (LPDWORD)&ServerThreadID);          // Thread identifier.

   clients[clientIndex].hThread   = hThread;

   TellAll("");                        // Forces a paint, draws a red spool
                                       // and name for this client.

                                       // Do loop which basically reads from
                                       // this specific client, and then
                                       // uses TellAll() to broadcast the
                                       // message to all the connected
                                       // clients.
   do{
                                       // Read the pipe.
      retCode = ReadFile (hPipe, inBuf, PLEASE_READ, &bytesRead, &OverLapRd);

                                       // Check for three kinds of errors:
                                       // If Error = IO_PENDING, wait til
                                       // the event handle signals success,
                                       // If BROKEN_PIPE, exit the do loop.
                                       // Any other error, flag it to the
                                       // user and exit the do loop.
      if (!retCode)
        {
        lastError = GetLastError();

        switch (lastError)
          {
                                       // IO_PENDING, wait on the event.
           case ERROR_IO_PENDING:
             WaitForSingleObject (hEventRd, (DWORD)-1);
             break;
                                       // Pipe is broken, exit the loop.
           case ERROR_BROKEN_PIPE:
             ExitLoop = TRUE;
             break;
                                       // Something else is wrong, exit the
                                       // the loop after telling the user.
           default:
             LoadString(hInst, IDS_READERROR, lpBuffer, sizeof(lpBuffer));
             wsprintf (errorBuf, lpBuffer, lastError);
             LoadString(hInst, IDS_DEBUGINFO, lpBuffer, sizeof(lpBuffer));
             MessageBox (*hWnd, errorBuf, lpBuffer, MB_OK);
             ExitLoop = TRUE;
             break;
          }
        }

      if (!ExitLoop)
        {
        GetOverlappedResult (hPipe, &OverLapRd, &bytesTransRd, FALSE);

                                       // Use TellAll to broadcast the message.
        if (bytesTransRd)
          TellAll(inBuf);
        else
          TellAll("");
        }

   }while(!ExitLoop);

   clients[clientIndex].live = FALSE;  // Turns spool gray.
   CloseHandle (hPipe);                // Close handles.
   CloseHandle (hEventRd);
   CloseHandle (hEventWrt);
   DisconnectNamedPipe (hPipe);        // Close pipe instance.
   ExitThread(0);                      // Clean up and die.
  }

VOID TellAll ( CHAR * )

Definition at line 452 of file Server32.c.

  {
    DWORD i;                           // Index through array.
    DWORD bytesWritten;                // Used in WriteFile().
    DWORD retCode;                     // Traps return codes.
    CHAR  Buf[LINE_LEN];               // Message Buffer.
    DWORD lastError;                   // Traps returns from GetLastError().

    for(i=0; i < clientCount; i++)     // For all clients in the array.
      {
                                       // If client isn't alive, don't waste
                                       // time writing to it.
      if (clients[i].live)
        {
        retCode = WriteFile (clients[i].hPipe, buffer, (DWORD)strlen(buffer),
                             &bytesWritten, &clients[i].overLap);

                                       // Check 3 kinds of errors: IO_PENDING,
                                       // NO_DATA, or other.  Wait on event
                                       // handle if IO_PENDING, else, if it's
                                       // anything other than NO_DATA (pipe
                                       // client disconnected), flag the user.
                                       // In any case, if it's not IO_PENDING,
                                       // clients[i].live = FALSE, spool turns
                                       // gray.
        if (!retCode)
          {
          lastError = GetLastError();

                                       // IO_PENDING, wait on event handle.
          if (lastError == ERROR_IO_PENDING)
            {
            WaitForSingleObject (clients[i].hEvent, (DWORD)-1);
            }
          else
            {
                                       // If not NO_DATA, flag user.
            if (lastError != ERROR_NO_DATA)
              {
              LoadString(hInst, IDS_DEBUGLAST, lpBuffer, sizeof(lpBuffer));
              wsprintf (Buf, "%s = %d", buffer, GetLastError());
              MessageBox(hWnd, Buf, lpBuffer, MB_OK);
              }
            clients[i].live = FALSE;
            }
          }
        } //if client.live

        // Unused thread handles have to be cleaned up.
        // Otherwise, handle leakage will occur.
        if ((clients[i].hThread != NULL) && (clients[i].live == FALSE))
        {
          CloseHandle(clients[i].hThread);
          clients[i].hThread = NULL;
        }
      } // for loop
                                       // Paint window with new information.
    InvalidateRect(hWnd, NULL, TRUE);
  }

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Registry/Monkey.c File Reference

  • WinBase
  • Registry
Defines | Functions | Variables

Monkey.c File Reference

#include <windows.h>
#include <string.h>
#include <mbstring.h>
#include <stdlib.h>
#include <stdio.h>
#include "monkey.h"

Go to the source code of this file.

Defines

#define | _MBCS
#define | STRICT

Functions

VOID | DisplayKeyData (HWND hDlg, CHAR *RegPath, HANDLE hKeyRoot)
VOID | EnumerateLevel (HWND hDlg, LPTSTR NameLBSelect, LPTSTR RegPath, HKEY *hKeyRoot)
int APIENTRY | MonkeyDlgProc (HWND hDlg, WORD wMsg, LONG wParam, LONG lParam)
VOID | QueryKey (HWND hDlg, HANDLE hKey)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

HWND | hDlg
HANDLE hHeap
HANDLE hInst

Define Documentation

#define _MBCS

Definition at line 27 of file Monkey.c.

#define STRICT

Definition at line 24 of file Monkey.c.

Function Documentation

VOID DisplayKeyData | ( | HWND | hDlg,
 |  | CHAR * | RegPath,
 |  | HANDLE | hKeyRoot
 | ) |  |

Definition at line 612 of file Monkey.c.

{
    HKEY   hKey;
    DWORD  dwLBIndex;
    CHAR   Buf[LINE_LEN];
    CHAR   ValueName[MAX_VALUE_NAME];
    DWORD  cbValueName = MAX_VALUE_NAME;
    DWORD  dwType;
    DWORD  retCode;
    CHAR   lpBuffer[128];
    CHAR   lpBuffer2[128];

    CHAR   ClassName[MAX_PATH];
    DWORD  dwcClassLen = MAX_PATH;
    DWORD  dwcSubKeys;
    DWORD  dwcMaxSubKey;
    DWORD  dwcMaxClass;
    DWORD  dwcValues;
    DWORD  dwcMaxValueName;
    DWORD  dwcMaxValueData;
    DWORD  dwcSecDesc;
    FILETIME  ftLastWriteTime;

    BYTE   *bData;
    DWORD  cbData;

    CHAR   *outBuf;
    DWORD  i;
    DWORD  cStrLen;

    CHAR   *BinaryStrBuf;
    CHAR   ByteBuf[4];

    CHAR   *ptr;

    // OPEN THE KEY.

    // LBIndex should == value index.
    dwLBIndex = (DWORD)SendMessage (GetDlgItem (hDlg, IDL_LISTBOX2),
                                    LB_GETCURSEL, 0, 0);

    retCode = RegOpenKeyEx (hKeyRoot,    // Key handle at root level.
                            RegPath,     // Path name of child key.
                            0,           // Reserved.
                            KEY_EXECUTE, // Requesting read access.
                            &hKey);      // Address of key to be returned.

    if (retCode)
    {
        LoadString(hInst, IDS_REGOPENERR, lpBuffer, sizeof(lpBuffer));
        wsprintf (Buf, lpBuffer, retCode);
        MessageBox (hDlg, Buf, "DisplayKeyData()", MB_OK);
        return;
    }

// ADD A QUERY AND ALLOCATE A BUFFER FOR BDATA.

    retCode =
    RegQueryInfoKey (hKey,              // Key handle.
                     ClassName,         // Buffer for class name.
                     &dwcClassLen,      // Length of class string.
                     NULL,              // Reserved.
                     &dwcSubKeys,       // Number of sub keys.
                     &dwcMaxSubKey,     // Longest sub key size.
                     &dwcMaxClass,      // Longest class string.
                     &dwcValues,        // Number of values for this key.
                     &dwcMaxValueName,  // Longest Value name.
                     &dwcMaxValueData,  // Longest Value data.
                     &dwcSecDesc,       // Security descriptor.
                     &ftLastWriteTime); // Last write time.

    if (retCode)
    {
        LoadString(hInst, IDS_REGQUERYERR, lpBuffer, sizeof(lpBuffer));
        wsprintf (Buf, lpBuffer, retCode, __LINE__);
        MessageBox (hDlg, Buf, "", MB_OK);
    }

    bData = HeapAlloc (hHeap, 0, dwcMaxValueData);
    cbData = dwcMaxValueData;

    // ENUMERATE THE KEY.

    retCode = RegEnumValue (hKey,        // Key handle returned from RegOpenKeyEx.
                            dwLBIndex,   // Value index, taken from listbox.
                            ValueName,   // Name of value.
                            &cbValueName,// Size of value name.
                            NULL,        // Reserved, dword = NULL.
                            &dwType,     // Type of data.
                            bData,       // Data buffer.
                            &cbData);    // Size of data buffer.

    if (retCode != ERROR_SUCCESS)
    {

        if (dwType < REG_FULL_RESOURCE_DESCRIPTOR)
        {
            LoadString(hInst, IDS_REGENUMERR, lpBuffer, sizeof(lpBuffer));
            wsprintf (Buf, lpBuffer, retCode, cbData, __LINE__);
            MessageBox (hDlg, Buf, "", MB_OK);
        }
    }

    switch (dwType)
    {
//    REG_NONE                    ( 0 )   // No value type
//    REG_SZ                      ( 1 )   // Unicode nul terminated string
//    REG_EXPAND_SZ               ( 2 )   // Unicode nul terminated string
    // (with environment variable references)
//    REG_BINARY                  ( 3 )   // Free form binary
//    REG_DWORD                   ( 4 )   // 32-bit number
//    REG_DWORD_LITTLE_ENDIAN     ( 4 )   // 32-bit number (same as REG_DWORD)
//    REG_DWORD_BIG_ENDIAN        ( 5 )   // 32-bit number
//    REG_LINK                    ( 6 )   // Symbolic Link (unicode)
//    REG_MULTI_SZ                ( 7 )   // Multiple Unicode strings
//    REG_RESOURCE_LIST           ( 8 )   // Resource list in the resource map
//    REG_FULL_RESOURCE_DESCRIPTOR ( 9 )  // Resource list in the hardware description

    case REG_NONE:
        LoadString(hInst, IDS_REGNONE, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        break;

    case REG_SZ:
        LoadString(hInst, IDS_REGSZ, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);

        outBuf = HeapAlloc (hHeap, 0, cbData + 2);
        *outBuf = '\0';

        strncat (outBuf, "\"", 1);
        strncat (outBuf, bData, cbData);
        strncat (outBuf, "\"", 1);

        SetDlgItemText (hDlg, IDE_VALUE2, outBuf);
        HeapFree (hHeap, 0, outBuf);
        break;

    case REG_EXPAND_SZ:
        LoadString(hInst, IDS_REGEXPSZ, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        outBuf = HeapAlloc (hHeap, 0, cbData + 2);
        *outBuf = '\0';

        strncat (outBuf, "\"", 1);
        strncat (outBuf, bData, cbData);
        strncat (outBuf, "\"", 1);

        SetDlgItemText (hDlg, IDE_VALUE2, outBuf);
        HeapFree (hHeap, 0, outBuf);
        break;

    case REG_BINARY:
        LoadString(hInst, IDS_REGBIN, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        SetCursor (LoadCursor (NULL, IDC_WAIT));

        BinaryStrBuf = HeapAlloc (hHeap, 0, (3 * cbData) + 1);
        if (BinaryStrBuf)
        {
            *BinaryStrBuf = '\0';
            *ByteBuf = '\0';
            for (i = 0; i < cbData; i++)
            {
                sprintf (ByteBuf, "%02x ", (BYTE)bData[i]);
                strncat (BinaryStrBuf, ByteBuf,4);
            }
            SetDlgItemText (hDlg, IDE_VALUE2, BinaryStrBuf);
        }
        else
        {
            LoadString(hInst, IDS_MALLOCERR, lpBuffer, sizeof(lpBuffer));
            LoadString(hInst, IDS_DBGTITLE, lpBuffer2, sizeof(lpBuffer2));
            MessageBox (hDlg, lpBuffer, lpBuffer2, MB_OK);
        }
        SetDlgItemText (hDlg, IDL_LISTBOX2, BinaryStrBuf);
        HeapFree (hHeap, 0, BinaryStrBuf);
        SetCursor (LoadCursor (NULL, IDC_ARROW));

        break;

    case REG_DWORD:
        LoadString(hInst, IDS_REGDWORD, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        SetDlgItemInt (hDlg, IDE_VALUE2, *(UINT *)bData, FALSE);
        break;

    case REG_DWORD_BIG_ENDIAN:
        LoadString(hInst, IDS_REGBIGEND, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        SetDlgItemInt (hDlg, IDE_VALUE2, *(UINT *)bData, TRUE);
        break;

    case REG_LINK:
        LoadString(hInst, IDS_REGLINK, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        SetDlgItemText (hDlg, IDE_VALUE2, bData);
        break;

    case REG_MULTI_SZ:
        LoadString(hInst, IDS_REGMULTI, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        SetCursor (LoadCursor (NULL, IDC_WAIT));
        // Count the NULLs in the buffer to
        // find out how many strings there are.

        for (i=0, cStrLen=4; i < cbData; i++)
            if (!bData[i])
                cStrLen+=4;                  // Add room for two quotes and two
                                             // spaced per string.

        outBuf = HeapAlloc (hHeap, 0, cbData + cStrLen);

        ptr = bData;                     // Set ptr to beginning of buffer.
        *outBuf = '\0';                  // Initialize output string.

        strncat (outBuf, "{ ", 2);           // Do first bracket.
        while (*ptr)                     // Loop til you hit 2 NULLs in a row.
        {
            strncat (outBuf, "\"", 1);        // Put quotes around each string.
            strncat (outBuf, ptr, cbData);
            strncat (outBuf, "\"  ", 3);
            while(*ptr) ptr++;
            ptr++;
        }
        strncat (outBuf, "}", 1);            // Add final bracket.
        SetDlgItemText (hDlg, IDE_VALUE2, outBuf);

        SetCursor (LoadCursor (NULL, IDC_ARROW));
        HeapFree (hHeap, 0, outBuf);                 // free output string.
        break;

    case REG_RESOURCE_LIST:            // CM_RESOURCE_LIST is complex.  Print it
        // as a free formed binary data for now.

        LoadString(hInst, IDS_REGRESLST, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);

        BinaryStrBuf = HeapAlloc (hHeap, 0, (3 * cbData) + 1);
        if (BinaryStrBuf)
        {
            *BinaryStrBuf = '\0';
            *ByteBuf = '\0';
            for (i = 0; i < cbData; i++)
            {
                sprintf (ByteBuf, "%02x ", (BYTE)bData[i]);
                strncat (BinaryStrBuf, ByteBuf, 4);
            }
            SetDlgItemText (hDlg, IDE_VALUE2, BinaryStrBuf);
        }
        else
        {
            LoadString(hInst, IDS_MALLOCERR, lpBuffer, sizeof(lpBuffer));
            LoadString(hInst, IDS_DBGTITLE, lpBuffer2, sizeof(lpBuffer2));
            MessageBox (hDlg, lpBuffer, lpBuffer2, MB_OK);
        }
        SetDlgItemText (hDlg, IDL_LISTBOX2, BinaryStrBuf);
        HeapFree (hHeap, 0, BinaryStrBuf);

        break;

    case REG_FULL_RESOURCE_DESCRIPTOR:
        LoadString(hInst, IDS_REGFULLDESC, lpBuffer, sizeof(lpBuffer));
        SetDlgItemText (hDlg, IDE_VALUE1, lpBuffer);
        break;

    default:
        LoadString(hInst, IDS_REGUNDEFINE, lpBuffer, sizeof(lpBuffer));
        wsprintf (Buf, lpBuffer, dwType);
        SetDlgItemText (hDlg, IDE_VALUE1, Buf);
        break;

    } // end switch

    HeapFree (hHeap, 0, bData);
}

VOID EnumerateLevel | ( | HWND | hDlg,
 |  | LPTSTR | NameLBSelect,
 |  | LPTSTR | RegPath,
 |  | HKEY * | hKeyRoot
 | ) |  |

Definition at line 385 of file Monkey.c.

{

    HKEY hKey;
    DWORD  retCode;
    CHAR   Buf[MAX_PATH];
    CHAR   lpBuffer[128];
    size_t  ByteCount = MAX_PATH - 1;

    if (*hKeyRoot)
    {
        // If RegPath is not NULL, then
        // you have to add a backslash to the
        // path name before appending the next
        // level child name.
        if (strcmp (RegPath, "") != 0) {
            CHAR *pEndOfBuffer;
            strncat (RegPath, "\\",1);
            pEndOfBuffer = _mbsrchr (RegPath, '\\');
            ByteCount -= (pEndOfBuffer - RegPath);
        }

        // Add the next level child name.
        strncat (RegPath, NameLBSelect,ByteCount);

        // Use RegOpenKeyEx() with the new
        // Registry path to get an open handle
        // to the child key you want to
        // enumerate.
        retCode = RegOpenKeyEx (*hKeyRoot,
                                RegPath,
                                0,
                                KEY_ENUMERATE_SUB_KEYS |
                                KEY_EXECUTE |
                                KEY_QUERY_VALUE,
                                &hKey);

        if (retCode != ERROR_SUCCESS)
        {
            if (retCode == ERROR_ACCESS_DENIED)
            {
                LoadString(hInst, IDS_CANTOPENKEY, lpBuffer, sizeof(lpBuffer));
                wsprintf (Buf, lpBuffer);
            }
            else
            {
                LoadString(hInst, IDS_OPENKEYERR, lpBuffer, sizeof(lpBuffer));
                wsprintf (Buf, lpBuffer, retCode, __LINE__);
            }
            MessageBox (hDlg, Buf, "", MB_OK);
            PostMessage (hDlg, WM_COMMAND, IDB_BACK, 0);
            return;
        }

    }
    else
    {
        // Set the *hKeyRoot handle based
        // on the text taken from the ListBox.

        if (strcmp (NameLBSelect, "HKEY_CLASSES_ROOT") == 0)
            *hKeyRoot = HKEY_CLASSES_ROOT;

        if (strcmp (NameLBSelect, "HKEY_USERS") == 0)
            *hKeyRoot = HKEY_USERS;

        if (strcmp (NameLBSelect, "HKEY_LOCAL_MACHINE") == 0)
            *hKeyRoot = HKEY_LOCAL_MACHINE;

        if (strcmp (NameLBSelect, "HKEY_CURRENT_USER") == 0)
            *hKeyRoot = HKEY_CURRENT_USER;

        hKey = *hKeyRoot;     // hKey is used in RegEnumKey().

    }//end if/else *hKeyRoot

    QueryKey (hDlg, hKey);

    RegCloseKey (hKey);   // Close the key handle.

//      rect.top = 0; rect.left = 5; rect.right = 1200; rect.bottom = 25;
//      hDC = GetDC (hDlg);
//      FillRect (hDC, &rect, GetStockObject(WHITE_BRUSH));
//      TextOut (hDC, 5, 5, RegPath, strlen(RegPath));
//      ReleaseDC (hDlg, hDC);
    SetDlgItemText (hDlg, IDE_TEXTOUT, RegPath);

}

int APIENTRY MonkeyDlgProc | ( | HWND | hDlg,
 |  | WORD | wMsg,
 |  | LONG | wParam,
 |  | LONG | lParam
 | ) |  |

Definition at line 114 of file Monkey.c.

{
    ULONG    KeyClassLength = 256;
    ULONG    KeyNameLength = 256;
    LRESULT  indexLB;
    CHAR     *putNullAt;
    CHAR     lpBuffer1[128];
    CHAR     lpBuffer2[128];

    static   CHAR     RegPath[MAX_PATH]  = "";
    static   CHAR     NameLBSelect[256]  = "";
    static   HKEY     hKeyRoot;
    static   DWORD    RegLevel;
    static   BOOL     FullBranches = TRUE;

    static   HANDLE   hFile = INVALID_HANDLE_VALUE;
    static   HANDLE   hBootIni;

    UNREFERENCED_PARAMETER( lParam );

    switch (wMsg)
    {
    case WM_INITDIALOG:
        // Post a message to get the first 4 pre-defined keys, and set
        // Full Branches to be the print default.
        PostMessage (hDlg, WM_GETFIRSTKEY, 0, 0);
        CheckDlgButton (hDlg, IDR_FULL, TRUE);
        return(0);

    case WM_GETFIRSTKEY:
        // Initialize by putting the first 4 predefined keys of the
        // registry in the list box.

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_LOCAL_MACHINE");

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_CURRENT_USER");

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_USERS");

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_CLASSES_ROOT");

        hKeyRoot = 0;                   // Initialize hKeyRoot.
        return(0);

    case WM_SYSCOMMAND:
        if (wParam == SC_CLOSE)
        {
            EndDialog (hDlg, TRUE);
            if (hFile != INVALID_HANDLE_VALUE)
                CloseHandle (hFile);
            return(TRUE);
        }
        break;

    case WM_COMMAND:

        switch (LOWORD(wParam))
        {
        case IDR_FULL:
            // If Full Branches pressed, set global var to TRUE.
            FullBranches = TRUE;
            return(0);

        case IDR_TRIMMED:
            // If Trimmed Branches pressed, set global var to FALSE.
            FullBranches = FALSE;
            return(0);

        case IDL_LISTBOX:
            // If double click in left hand listbox, clear Value
            // edit fields, and execute Next functionality.
            if ( HIWORD (wParam) == LBN_DBLCLK)
            {
                SetDlgItemText (hDlg, IDE_VALUE1, "");
                SetDlgItemText (hDlg, IDE_VALUE2, "");
                PostMessage (hDlg, WM_COMMAND, IDB_NEXT, 0);
            }
            return(0);

        case IDL_LISTBOX2:
            // If double click right hand listbox, clear Value edit
            // fields, then display the key's data.
            if ( HIWORD (wParam) == LBN_DBLCLK)
            {
                SetDlgItemText (hDlg, IDE_VALUE1, "");
                SetDlgItemText (hDlg, IDE_VALUE2, "");
                DisplayKeyData (hDlg, RegPath, hKeyRoot);
            }
            return(0);

        case IDB_NEXT:
            // Get the index of the cursor selection
            // in the list box.
            indexLB = SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                                   LB_GETCURSEL, 0, 0);

            // If nothing is selected, flag user and return, otherwise
            // process the selected key.
            // LB_ERR indicates nothing selected.
            if (indexLB == LB_ERR)
            {
                LoadString(hInst, IDS_SELECTMSG, lpBuffer1, sizeof(lpBuffer1));
                LoadString(hInst, IDS_NAME, lpBuffer2, sizeof(lpBuffer2));
                MessageBox (hDlg, lpBuffer1, lpBuffer2, MB_OK);
                return(0);
            }

            // If listbox item 0 is pressed, user wants to move
            // back up.  Execute the Back functionality.
            if (indexLB == 0 && hKeyRoot)
            {
                PostMessage (hDlg, WM_COMMAND, IDB_BACK, 0);
                return(0);
            }

            // Get text from selection in LB.
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                         LB_GETTEXT, indexLB, (LPARAM)NameLBSelect);

            // Put name of chosen item in Name field.
            SetDlgItemText (hDlg, IDE_NAME, NameLBSelect);

            // Then clear ListBox entries.
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                         LB_RESETCONTENT, 0, 0);
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX2),
                         LB_RESETCONTENT, 0, 0);

            EnumerateLevel (hDlg, NameLBSelect, RegPath, &hKeyRoot);

            return(0);

        case IDB_BACK:

            // For this case (hRootKey = 0)you're at the top level already.
            // Tell the user, then return
            if (!hKeyRoot)
            {
                LoadString(hInst, IDS_TOPLEVEL, lpBuffer1, sizeof(lpBuffer1));
                LoadString(hInst, IDS_NAME, lpBuffer2, sizeof(lpBuffer2));
                MessageBox (hDlg, lpBuffer1, lpBuffer2, MB_OK);
                return(0);
            }

            //For all remaining cases, clear the listboxes.
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                         LB_RESETCONTENT, 0, 0);
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX2),
                         LB_RESETCONTENT, 0, 0);

            // If hRootKey has a value, but the pathname is blank,
            // then you must be 1 level deep, reset to level 0 by
            // posting WM_GETFIRSTKEY.
            if (strcmp (RegPath, "") == 0)
            {
                SetDlgItemText (hDlg, IDE_NAME, "");
                PostMessage (hDlg, WM_GETFIRSTKEY, 0, 0);
                return(0);
            }

            // Two cases left.  One in which the path has only one
            // key name in it, and no back slash character (meaning
            // strrchr() will return NULL); and one the other case
            // where there are more than one key name in the path (
            // and at least one back slash for strrchr().  If this
            // is the first case, we want to fakeout EnumerateLevel
            // into thinking we just picked one of the pre-defined keys,
            // and then re-enumerate it's child keys.
            if ((putNullAt = _mbsrchr (RegPath, '\\')) == NULL)
            {
                RegPath[0] = '\0';

                switch ((DWORD_PTR)hKeyRoot)
                {
                case (DWORD_PTR)HKEY_LOCAL_MACHINE:
                    strncpy (NameLBSelect, "HKEY_LOCAL_MACHINE",19);
                    break;

                case (DWORD_PTR)HKEY_USERS:
                    strncpy (NameLBSelect, "HKEY_USERS",11);
                    break;

                case (DWORD_PTR)HKEY_CURRENT_USER:
                    strncpy (NameLBSelect, "HKEY_CURRENT_USER",18);
                    break;

                case (DWORD_PTR)HKEY_CLASSES_ROOT:
                    strncpy (NameLBSelect, "HKEY_CLASSES_ROOT",18);
                    break;
                }
                SetDlgItemText (hDlg, IDE_NAME, NameLBSelect);
                hKeyRoot = 0;
                EnumerateLevel (hDlg, NameLBSelect, RegPath, &hKeyRoot);
            }
            else
            {
                // In the final case, we can just trim the last key
                // name off the path, and re-enumerate the level.
                CHAR *pEndOfBuffer = putNullAt;
                *putNullAt = '\0';
                putNullAt = _mbsrchr (RegPath, '\\');

                if (putNullAt)
                {
                    strncpy (NameLBSelect, putNullAt+1,pEndOfBuffer-putNullAt);
                    *putNullAt = '\0';
                }
                else
                {
                    strncpy (NameLBSelect, RegPath,pEndOfBuffer-RegPath+1);
                    *RegPath = '\0';
                }
                SetDlgItemText (hDlg, IDE_NAME, NameLBSelect);
                EnumerateLevel (hDlg, NameLBSelect, RegPath, &hKeyRoot);
            }
            return(0);

        default:
            return(0);

        }

    }
    return(FALSE);

}

VOID QueryKey | ( | HWND | hDlg,
 |  | HANDLE | hKey
 | ) |  |

Definition at line 488 of file Monkey.c.

{
    CHAR     KeyName[MAX_PATH];
    CHAR     ClassName[MAX_PATH] = ""; // Buffer for class name.
    DWORD    dwcClassLen = MAX_PATH;   // Length of class string.
    DWORD    dwcSubKeys;               // Number of sub keys.
    DWORD    dwcMaxSubKey;             // Longest sub key size.
    DWORD    dwcMaxClass;              // Longest class string.
    DWORD    dwcValues;                // Number of values for this key.
    DWORD    dwcMaxValueName;          // Longest Value name.
    DWORD    dwcMaxValueData;          // Longest Value data.
    DWORD    dwcSecDesc;               // Security descriptor.
    FILETIME ftLastWriteTime;          // Last write time.

    DWORD i;
    DWORD retCode;

    DWORD j;
    DWORD retValue;
    CHAR  ValueName[MAX_VALUE_NAME];
    DWORD dwcValueName = MAX_VALUE_NAME;
    CHAR  Buf[80];
    CHAR  lpBuffer[80];
    DWORD dwMaxPath;
    FILETIME ftFileTime;

    // Get Class name, Value count.

    RegQueryInfoKey (hKey,              // Key handle.
                     ClassName,         // Buffer for class name.
                     &dwcClassLen,      // Length of class string.
                     NULL,              // Reserved.
                     &dwcSubKeys,       // Number of sub keys.
                     &dwcMaxSubKey,     // Longest sub key size.
                     &dwcMaxClass,      // Longest class string.
                     &dwcValues,        // Number of values for this key.
                     &dwcMaxValueName,  // Longest Value name.
                     &dwcMaxValueData,  // Longest Value data.
                     &dwcSecDesc,       // Security descriptor.
                     &ftLastWriteTime); // Last write time.

    SetDlgItemText (hDlg, IDE_CLASS, ClassName);
    SetDlgItemInt  (hDlg, IDE_CVALUES, dwcValues, FALSE);

    SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                 LB_ADDSTRING, 0, (LPARAM)"..");

    // Loop until RegEnumKey fails, get
    // the name of each child and enter
    // it into the box.

    // Enumerate the Child Keys.

    SetCursor (LoadCursor (NULL, IDC_WAIT));
    for (i=0, retCode = ERROR_SUCCESS; retCode == ERROR_SUCCESS; i++)
    {

        dwMaxPath = MAX_PATH;
        retCode = RegEnumKeyEx( hKey,i, KeyName,
                                &dwMaxPath, NULL, NULL,
                                NULL,  &ftFileTime);

        if (retCode == (DWORD)ERROR_SUCCESS)
            SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                         LB_ADDSTRING, 0, (LPARAM)KeyName);
    }
    SetCursor (LoadCursor (NULL, IDC_ARROW));

    // Enumerate the Key Values
    SetCursor (LoadCursor (NULL, IDC_WAIT));

    if (dwcValues)
        for (j = 0, retValue = ERROR_SUCCESS; j < dwcValues; j++)
        {
            dwcValueName = MAX_VALUE_NAME;
            ValueName[0] = '\0';
            retValue = RegEnumValue (hKey, j, ValueName,
                                     &dwcValueName,
                                     NULL,
                                     NULL,               //&dwType,
                                     NULL,               //&bData,
                                     NULL);              //&bcData);
            if (retValue != (DWORD)ERROR_SUCCESS &&
                retValue != ERROR_INSUFFICIENT_BUFFER)
            {
                LoadString(hInst, IDS_REGERR, lpBuffer, sizeof(lpBuffer));
                wsprintf (Buf, lpBuffer, __LINE__, j, retValue, dwcValueName);
                LoadString(hInst, IDS_DEBUG, lpBuffer, sizeof(lpBuffer));
                MessageBox (hDlg, Buf, lpBuffer, MB_OK);
            }

            Buf[0] = '\0';
            if (ValueName[0] == '\0')
            {
                LoadString(hInst, IDS_NONAME, lpBuffer, sizeof(lpBuffer));
                strncpy (ValueName, lpBuffer,80);
            }
            wsprintf (Buf, "%d) %s ", j, ValueName);
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX2),
                         LB_ADDSTRING, 0, (LONG_PTR)Buf);

        }// end for(;;)

    SetCursor (LoadCursor (NULL, IDC_ARROW));

}

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 50 of file Monkey.c.

{
    DWORD retCode;

    UNREFERENCED_PARAMETER( nCmdShow );
    UNREFERENCED_PARAMETER( lpCmdLine );
    UNREFERENCED_PARAMETER( hPrevInstance );

    hInst   = hInstance;
    hHeap   = HeapCreate (0, 0, 0);

    retCode = (int)DialogBox ((HANDLE)hInst, (LPCSTR)"MonkeyDlg",
                              NULL, (DLGPROC)MonkeyDlgProc);

    HeapDestroy (hHeap);
    return(retCode);

}

Variable Documentation

HWND hDlg

Definition at line 35 of file Monkey.c.

HANDLE hHeap

Definition at line 37 of file Monkey.c.

HANDLE hInst

Definition at line 34 of file Monkey.c.

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Registry/Monkey.h File Reference

  • WinBase
  • Registry
Defines | Functions

Monkey.h File Reference

Go to the source code of this file.

Defines

#define | BOOT_INI "c:\\boot.ini"
#define | BRANCH 1
#define | CHILD 2
#define | IDB_BACK 112
#define | IDB_NEXT 111
#define | IDB_PRINT 114
#define | IDE_ACL 104
#define | IDE_CLASS 109
#define | IDE_CVALUES 113
#define | IDE_LASTWRT 105
#define | IDE_NAME 101
#define | IDE_TEXTOUT 116
#define | IDE_TITLEINDEX 102
#define | IDE_VALUE1 106
#define | IDE_VALUE2 107
#define | IDE_VALUE3 108
#define | IDL_LISTBOX 110
#define | IDL_LISTBOX2 103
#define | IDR_FULL 115
#define | IDR_TRIMMED 117
#define | IDS_CANTOPENKEY 204
#define | IDS_DBGTITLE 217
#define | IDS_DEBUG 207
#define | IDS_MALLOCERR 216
#define | IDS_NAME 202
#define | IDS_NONAME 208
#define | IDS_OPENKEYERR 205
#define | IDS_REGBIGEND 219
#define | IDS_REGBIN 215
#define | IDS_REGDWORD 218
#define | IDS_REGENUMERR 211
#define | IDS_REGERR 206
#define | IDS_REGEXPSZ 214
#define | IDS_REGFULLDESC 223
#define | IDS_REGLINK 220
#define | IDS_REGMULTI 221
#define | IDS_REGNONE 212
#define | IDS_REGOPENERR 209
#define | IDS_REGQUERYERR 210
#define | IDS_REGRESLST 222
#define | IDS_REGSZ 213
#define | IDS_REGUNDEFINE 224
#define | IDS_SELECTMSG 201
#define | IDS_TOPLEVEL 203
#define | LINE_LEN 80
#define | MAX_DATA_LEN 1024
#define | MAX_VALUE_NAME 128
#define | OTHER 3
#define | REGISTRY_TXT "registry.txt"
#define | WM_GETFIRSTKEY WM_APP

Functions

VOID | DisplayKeyData (HWND, LPTSTR, HANDLE)
VOID | EnumerateLevel (HWND hDlg, LPTSTR NameLBSelect, LPTSTR RegPath, HKEY *hKeyRoot)
int APIENTRY | MonkeyDlgProc (HWND, WORD, LONG, LONG)
VOID | QueryKey (HWND, HANDLE)

Define Documentation

#define BOOT_INI "c:\\boot.ini"

Definition at line 68 of file Monkey.h.

#define BRANCH 1

Definition at line 64 of file Monkey.h.

#define CHILD 2

Definition at line 65 of file Monkey.h.

#define IDB_BACK 112

Definition at line 24 of file Monkey.h.

#define IDB_NEXT 111

Definition at line 23 of file Monkey.h.

#define IDB_PRINT 114

Definition at line 28 of file Monkey.h.

#define IDE_ACL 104

Definition at line 17 of file Monkey.h.

#define IDE_CLASS 109

Definition at line 22 of file Monkey.h.

#define IDE_CVALUES 113

Definition at line 27 of file Monkey.h.

#define IDE_LASTWRT 105

Definition at line 18 of file Monkey.h.

#define IDE_NAME 101

Definition at line 15 of file Monkey.h.

#define IDE_TEXTOUT 116

Definition at line 30 of file Monkey.h.

#define IDE_TITLEINDEX 102

Definition at line 16 of file Monkey.h.

#define IDE_VALUE1 106

Definition at line 19 of file Monkey.h.

#define IDE_VALUE2 107

Definition at line 20 of file Monkey.h.

#define IDE_VALUE3 108

Definition at line 21 of file Monkey.h.

#define IDL_LISTBOX 110

Definition at line 25 of file Monkey.h.

#define IDL_LISTBOX2 103

Definition at line 26 of file Monkey.h.

#define IDR_FULL 115

Definition at line 29 of file Monkey.h.

#define IDR_TRIMMED 117

Definition at line 31 of file Monkey.h.

#define IDS_CANTOPENKEY 204

Definition at line 36 of file Monkey.h.

#define IDS_DBGTITLE 217

Definition at line 49 of file Monkey.h.

#define IDS_DEBUG 207

Definition at line 39 of file Monkey.h.

#define IDS_MALLOCERR 216

Definition at line 48 of file Monkey.h.

#define IDS_NAME 202

Definition at line 34 of file Monkey.h.

#define IDS_NONAME 208

Definition at line 40 of file Monkey.h.

#define IDS_OPENKEYERR 205

Definition at line 37 of file Monkey.h.

#define IDS_REGBIGEND 219

Definition at line 51 of file Monkey.h.

#define IDS_REGBIN 215

Definition at line 47 of file Monkey.h.

#define IDS_REGDWORD 218

Definition at line 50 of file Monkey.h.

#define IDS_REGENUMERR 211

Definition at line 43 of file Monkey.h.

#define IDS_REGERR 206

Definition at line 38 of file Monkey.h.

#define IDS_REGEXPSZ 214

Definition at line 46 of file Monkey.h.

#define IDS_REGFULLDESC 223

Definition at line 55 of file Monkey.h.

#define IDS_REGLINK 220

Definition at line 52 of file Monkey.h.

#define IDS_REGMULTI 221

Definition at line 53 of file Monkey.h.

#define IDS_REGNONE 212

Definition at line 44 of file Monkey.h.

#define IDS_REGOPENERR 209

Definition at line 41 of file Monkey.h.

#define IDS_REGQUERYERR 210

Definition at line 42 of file Monkey.h.

#define IDS_REGRESLST 222

Definition at line 54 of file Monkey.h.

#define IDS_REGSZ 213

Definition at line 45 of file Monkey.h.

#define IDS_REGUNDEFINE 224

Definition at line 56 of file Monkey.h.

#define IDS_SELECTMSG 201

Definition at line 33 of file Monkey.h.

#define IDS_TOPLEVEL 203

Definition at line 35 of file Monkey.h.

#define LINE_LEN 80

Definition at line 62 of file Monkey.h.

#define MAX_DATA_LEN 1024

Definition at line 60 of file Monkey.h.

#define MAX_VALUE_NAME 128

Definition at line 59 of file Monkey.h.

#define OTHER 3

Definition at line 66 of file Monkey.h.

#define REGISTRY_TXT "registry.txt"

Definition at line 69 of file Monkey.h.

#define WM_GETFIRSTKEY WM_APP

Definition at line 73 of file Monkey.h.

Function Documentation

VOID DisplayKeyData | ( | HWND | ,
 |  | LPTSTR | ,
 |  | HANDLE |
 | ) |  |
VOID EnumerateLevel | ( | HWND | hDlg,
 |  | LPTSTR | NameLBSelect,
 |  | LPTSTR | RegPath,
 |  | HKEY * | hKeyRoot
 | ) |  |

Definition at line 385 of file Monkey.c.

{

    HKEY hKey;
    DWORD  retCode;
    CHAR   Buf[MAX_PATH];
    CHAR   lpBuffer[128];
    size_t  ByteCount = MAX_PATH - 1;

    if (*hKeyRoot)
    {
        // If RegPath is not NULL, then
        // you have to add a backslash to the
        // path name before appending the next
        // level child name.
        if (strcmp (RegPath, "") != 0) {
            CHAR *pEndOfBuffer;
            strncat (RegPath, "\\",1);
            pEndOfBuffer = _mbsrchr (RegPath, '\\');
            ByteCount -= (pEndOfBuffer - RegPath);
        }

        // Add the next level child name.
        strncat (RegPath, NameLBSelect,ByteCount);

        // Use RegOpenKeyEx() with the new
        // Registry path to get an open handle
        // to the child key you want to
        // enumerate.
        retCode = RegOpenKeyEx (*hKeyRoot,
                                RegPath,
                                0,
                                KEY_ENUMERATE_SUB_KEYS |
                                KEY_EXECUTE |
                                KEY_QUERY_VALUE,
                                &hKey);

        if (retCode != ERROR_SUCCESS)
        {
            if (retCode == ERROR_ACCESS_DENIED)
            {
                LoadString(hInst, IDS_CANTOPENKEY, lpBuffer, sizeof(lpBuffer));
                wsprintf (Buf, lpBuffer);
            }
            else
            {
                LoadString(hInst, IDS_OPENKEYERR, lpBuffer, sizeof(lpBuffer));
                wsprintf (Buf, lpBuffer, retCode, __LINE__);
            }
            MessageBox (hDlg, Buf, "", MB_OK);
            PostMessage (hDlg, WM_COMMAND, IDB_BACK, 0);
            return;
        }

    }
    else
    {
        // Set the *hKeyRoot handle based
        // on the text taken from the ListBox.

        if (strcmp (NameLBSelect, "HKEY_CLASSES_ROOT") == 0)
            *hKeyRoot = HKEY_CLASSES_ROOT;

        if (strcmp (NameLBSelect, "HKEY_USERS") == 0)
            *hKeyRoot = HKEY_USERS;

        if (strcmp (NameLBSelect, "HKEY_LOCAL_MACHINE") == 0)
            *hKeyRoot = HKEY_LOCAL_MACHINE;

        if (strcmp (NameLBSelect, "HKEY_CURRENT_USER") == 0)
            *hKeyRoot = HKEY_CURRENT_USER;

        hKey = *hKeyRoot;     // hKey is used in RegEnumKey().

    }//end if/else *hKeyRoot

    QueryKey (hDlg, hKey);

    RegCloseKey (hKey);   // Close the key handle.

//      rect.top = 0; rect.left = 5; rect.right = 1200; rect.bottom = 25;
//      hDC = GetDC (hDlg);
//      FillRect (hDC, &rect, GetStockObject(WHITE_BRUSH));
//      TextOut (hDC, 5, 5, RegPath, strlen(RegPath));
//      ReleaseDC (hDlg, hDC);
    SetDlgItemText (hDlg, IDE_TEXTOUT, RegPath);

}

int APIENTRY MonkeyDlgProc | ( | HWND | ,
 |  | WORD | ,
 |  | LONG | ,
 |  | LONG |
 | ) |  |

Definition at line 114 of file Monkey.c.

{
    ULONG    KeyClassLength = 256;
    ULONG    KeyNameLength = 256;
    LRESULT  indexLB;
    CHAR     *putNullAt;
    CHAR     lpBuffer1[128];
    CHAR     lpBuffer2[128];

    static   CHAR     RegPath[MAX_PATH]  = "";
    static   CHAR     NameLBSelect[256]  = "";
    static   HKEY     hKeyRoot;
    static   DWORD    RegLevel;
    static   BOOL     FullBranches = TRUE;

    static   HANDLE   hFile = INVALID_HANDLE_VALUE;
    static   HANDLE   hBootIni;

    UNREFERENCED_PARAMETER( lParam );

    switch (wMsg)
    {
    case WM_INITDIALOG:
        // Post a message to get the first 4 pre-defined keys, and set
        // Full Branches to be the print default.
        PostMessage (hDlg, WM_GETFIRSTKEY, 0, 0);
        CheckDlgButton (hDlg, IDR_FULL, TRUE);
        return(0);

    case WM_GETFIRSTKEY:
        // Initialize by putting the first 4 predefined keys of the
        // registry in the list box.

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_LOCAL_MACHINE");

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_CURRENT_USER");

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_USERS");

        SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                     LB_ADDSTRING, 0, (LPARAM)"HKEY_CLASSES_ROOT");

        hKeyRoot = 0;                   // Initialize hKeyRoot.
        return(0);

    case WM_SYSCOMMAND:
        if (wParam == SC_CLOSE)
        {
            EndDialog (hDlg, TRUE);
            if (hFile != INVALID_HANDLE_VALUE)
                CloseHandle (hFile);
            return(TRUE);
        }
        break;

    case WM_COMMAND:

        switch (LOWORD(wParam))
        {
        case IDR_FULL:
            // If Full Branches pressed, set global var to TRUE.
            FullBranches = TRUE;
            return(0);

        case IDR_TRIMMED:
            // If Trimmed Branches pressed, set global var to FALSE.
            FullBranches = FALSE;
            return(0);

        case IDL_LISTBOX:
            // If double click in left hand listbox, clear Value
            // edit fields, and execute Next functionality.
            if ( HIWORD (wParam) == LBN_DBLCLK)
            {
                SetDlgItemText (hDlg, IDE_VALUE1, "");
                SetDlgItemText (hDlg, IDE_VALUE2, "");
                PostMessage (hDlg, WM_COMMAND, IDB_NEXT, 0);
            }
            return(0);

        case IDL_LISTBOX2:
            // If double click right hand listbox, clear Value edit
            // fields, then display the key's data.
            if ( HIWORD (wParam) == LBN_DBLCLK)
            {
                SetDlgItemText (hDlg, IDE_VALUE1, "");
                SetDlgItemText (hDlg, IDE_VALUE2, "");
                DisplayKeyData (hDlg, RegPath, hKeyRoot);
            }
            return(0);

        case IDB_NEXT:
            // Get the index of the cursor selection
            // in the list box.
            indexLB = SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                                   LB_GETCURSEL, 0, 0);

            // If nothing is selected, flag user and return, otherwise
            // process the selected key.
            // LB_ERR indicates nothing selected.
            if (indexLB == LB_ERR)
            {
                LoadString(hInst, IDS_SELECTMSG, lpBuffer1, sizeof(lpBuffer1));
                LoadString(hInst, IDS_NAME, lpBuffer2, sizeof(lpBuffer2));
                MessageBox (hDlg, lpBuffer1, lpBuffer2, MB_OK);
                return(0);
            }

            // If listbox item 0 is pressed, user wants to move
            // back up.  Execute the Back functionality.
            if (indexLB == 0 && hKeyRoot)
            {
                PostMessage (hDlg, WM_COMMAND, IDB_BACK, 0);
                return(0);
            }

            // Get text from selection in LB.
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                         LB_GETTEXT, indexLB, (LPARAM)NameLBSelect);

            // Put name of chosen item in Name field.
            SetDlgItemText (hDlg, IDE_NAME, NameLBSelect);

            // Then clear ListBox entries.
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                         LB_RESETCONTENT, 0, 0);
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX2),
                         LB_RESETCONTENT, 0, 0);

            EnumerateLevel (hDlg, NameLBSelect, RegPath, &hKeyRoot);

            return(0);

        case IDB_BACK:

            // For this case (hRootKey = 0)you're at the top level already.
            // Tell the user, then return
            if (!hKeyRoot)
            {
                LoadString(hInst, IDS_TOPLEVEL, lpBuffer1, sizeof(lpBuffer1));
                LoadString(hInst, IDS_NAME, lpBuffer2, sizeof(lpBuffer2));
                MessageBox (hDlg, lpBuffer1, lpBuffer2, MB_OK);
                return(0);
            }

            //For all remaining cases, clear the listboxes.
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                         LB_RESETCONTENT, 0, 0);
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX2),
                         LB_RESETCONTENT, 0, 0);

            // If hRootKey has a value, but the pathname is blank,
            // then you must be 1 level deep, reset to level 0 by
            // posting WM_GETFIRSTKEY.
            if (strcmp (RegPath, "") == 0)
            {
                SetDlgItemText (hDlg, IDE_NAME, "");
                PostMessage (hDlg, WM_GETFIRSTKEY, 0, 0);
                return(0);
            }

            // Two cases left.  One in which the path has only one
            // key name in it, and no back slash character (meaning
            // strrchr() will return NULL); and one the other case
            // where there are more than one key name in the path (
            // and at least one back slash for strrchr().  If this
            // is the first case, we want to fakeout EnumerateLevel
            // into thinking we just picked one of the pre-defined keys,
            // and then re-enumerate it's child keys.
            if ((putNullAt = _mbsrchr (RegPath, '\\')) == NULL)
            {
                RegPath[0] = '\0';

                switch ((DWORD_PTR)hKeyRoot)
                {
                case (DWORD_PTR)HKEY_LOCAL_MACHINE:
                    strncpy (NameLBSelect, "HKEY_LOCAL_MACHINE",19);
                    break;

                case (DWORD_PTR)HKEY_USERS:
                    strncpy (NameLBSelect, "HKEY_USERS",11);
                    break;

                case (DWORD_PTR)HKEY_CURRENT_USER:
                    strncpy (NameLBSelect, "HKEY_CURRENT_USER",18);
                    break;

                case (DWORD_PTR)HKEY_CLASSES_ROOT:
                    strncpy (NameLBSelect, "HKEY_CLASSES_ROOT",18);
                    break;
                }
                SetDlgItemText (hDlg, IDE_NAME, NameLBSelect);
                hKeyRoot = 0;
                EnumerateLevel (hDlg, NameLBSelect, RegPath, &hKeyRoot);
            }
            else
            {
                // In the final case, we can just trim the last key
                // name off the path, and re-enumerate the level.
                CHAR *pEndOfBuffer = putNullAt;
                *putNullAt = '\0';
                putNullAt = _mbsrchr (RegPath, '\\');

                if (putNullAt)
                {
                    strncpy (NameLBSelect, putNullAt+1,pEndOfBuffer-putNullAt);
                    *putNullAt = '\0';
                }
                else
                {
                    strncpy (NameLBSelect, RegPath,pEndOfBuffer-RegPath+1);
                    *RegPath = '\0';
                }
                SetDlgItemText (hDlg, IDE_NAME, NameLBSelect);
                EnumerateLevel (hDlg, NameLBSelect, RegPath, &hKeyRoot);
            }
            return(0);

        default:
            return(0);

        }

    }
    return(FALSE);

}

VOID QueryKey | ( | HWND | ,
 |  | HANDLE |
 | ) |  |

Definition at line 488 of file Monkey.c.

{
    CHAR     KeyName[MAX_PATH];
    CHAR     ClassName[MAX_PATH] = ""; // Buffer for class name.
    DWORD    dwcClassLen = MAX_PATH;   // Length of class string.
    DWORD    dwcSubKeys;               // Number of sub keys.
    DWORD    dwcMaxSubKey;             // Longest sub key size.
    DWORD    dwcMaxClass;              // Longest class string.
    DWORD    dwcValues;                // Number of values for this key.
    DWORD    dwcMaxValueName;          // Longest Value name.
    DWORD    dwcMaxValueData;          // Longest Value data.
    DWORD    dwcSecDesc;               // Security descriptor.
    FILETIME ftLastWriteTime;          // Last write time.

    DWORD i;
    DWORD retCode;

    DWORD j;
    DWORD retValue;
    CHAR  ValueName[MAX_VALUE_NAME];
    DWORD dwcValueName = MAX_VALUE_NAME;
    CHAR  Buf[80];
    CHAR  lpBuffer[80];
    DWORD dwMaxPath;
    FILETIME ftFileTime;

    // Get Class name, Value count.

    RegQueryInfoKey (hKey,              // Key handle.
                     ClassName,         // Buffer for class name.
                     &dwcClassLen,      // Length of class string.
                     NULL,              // Reserved.
                     &dwcSubKeys,       // Number of sub keys.
                     &dwcMaxSubKey,     // Longest sub key size.
                     &dwcMaxClass,      // Longest class string.
                     &dwcValues,        // Number of values for this key.
                     &dwcMaxValueName,  // Longest Value name.
                     &dwcMaxValueData,  // Longest Value data.
                     &dwcSecDesc,       // Security descriptor.
                     &ftLastWriteTime); // Last write time.

    SetDlgItemText (hDlg, IDE_CLASS, ClassName);
    SetDlgItemInt  (hDlg, IDE_CVALUES, dwcValues, FALSE);

    SendMessage (GetDlgItem (hDlg, IDL_LISTBOX),
                 LB_ADDSTRING, 0, (LPARAM)"..");

    // Loop until RegEnumKey fails, get
    // the name of each child and enter
    // it into the box.

    // Enumerate the Child Keys.

    SetCursor (LoadCursor (NULL, IDC_WAIT));
    for (i=0, retCode = ERROR_SUCCESS; retCode == ERROR_SUCCESS; i++)
    {

        dwMaxPath = MAX_PATH;
        retCode = RegEnumKeyEx( hKey,i, KeyName,
                                &dwMaxPath, NULL, NULL,
                                NULL,  &ftFileTime);

        if (retCode == (DWORD)ERROR_SUCCESS)
            SendMessage (GetDlgItem(hDlg, IDL_LISTBOX),
                         LB_ADDSTRING, 0, (LPARAM)KeyName);
    }
    SetCursor (LoadCursor (NULL, IDC_ARROW));

    // Enumerate the Key Values
    SetCursor (LoadCursor (NULL, IDC_WAIT));

    if (dwcValues)
        for (j = 0, retValue = ERROR_SUCCESS; j < dwcValues; j++)
        {
            dwcValueName = MAX_VALUE_NAME;
            ValueName[0] = '\0';
            retValue = RegEnumValue (hKey, j, ValueName,
                                     &dwcValueName,
                                     NULL,
                                     NULL,               //&dwType,
                                     NULL,               //&bData,
                                     NULL);              //&bcData);
            if (retValue != (DWORD)ERROR_SUCCESS &&
                retValue != ERROR_INSUFFICIENT_BUFFER)
            {
                LoadString(hInst, IDS_REGERR, lpBuffer, sizeof(lpBuffer));
                wsprintf (Buf, lpBuffer, __LINE__, j, retValue, dwcValueName);
                LoadString(hInst, IDS_DEBUG, lpBuffer, sizeof(lpBuffer));
                MessageBox (hDlg, Buf, lpBuffer, MB_OK);
            }

            Buf[0] = '\0';
            if (ValueName[0] == '\0')
            {
                LoadString(hInst, IDS_NONAME, lpBuffer, sizeof(lpBuffer));
                strncpy (ValueName, lpBuffer,80);
            }
            wsprintf (Buf, "%d) %s ", j, ValueName);
            SendMessage (GetDlgItem (hDlg, IDL_LISTBOX2),
                         LB_ADDSTRING, 0, (LONG_PTR)Buf);

        }// end for(;;)

    SetCursor (LoadCursor (NULL, IDC_ARROW));

}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/Client.c File Reference

  • WinBase
  • Service
Functions

Client.c File Reference

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

VOID __cdecl main (int argc, char *argv[])

Function Documentation

VOID __cdecl main | ( | int | argc,
 |  | char * | argv[]
 | ) |  |

Definition at line 21 of file Client.c.

{
   char    inbuf[80];
   char    outbuf[80];
   DWORD   bytesRead;
   BOOL    ret;
   LPSTR   lpszPipeName = "\\\\.\\pipe\\simple";
   LPSTR   lpszString = "World";
   int     ndx;

   // allow user to define pipe name
   for ( ndx = 1; ndx < argc; ndx++ )
   {
      if ( (*argv[ndx] == '-') || (*argv[ndx] == '/') )
      {
         if ( !(stricmp( "pipe", argv[ndx]+1 )) && ( (ndx + 1) < argc))
         {
            lpszPipeName = argv[++ndx];
         }
         else if ( !(stricmp( "string", argv[ndx]+1 )) && ( (ndx + 1) < argc))
         {
            lpszString = argv[++ndx];
         }
         else
         {
            printf("usage: client [-pipe <pipename>] [-string <string>]\n");
            exit(1);
         }
      }
      else
      {
         printf("usage: client [-pipe <pipename>] [-string <string>]\n");
         exit(1);
      }

   }

   ret = CallNamedPipeA(lpszPipeName,
                        inbuf, sizeof(inbuf),
                        outbuf, sizeof(outbuf),
                        &bytesRead, NMPWAIT_WAIT_FOREVER);

   if (!ret)
   {
      printf("client: CallNamedPipe failed, GetLastError = %d\n", GetLastError());
      exit(1);
   }

   printf("client: received: %s\n", outbuf);
}

Generated on Wed Nov 13 2024 16:53:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/Service.c File Reference

  • WinBase
  • Service
Functions | Variables

Service.c File Reference

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <tchar.h>
#include "service.h"

Go to the source code of this file.

Functions

VOID | AddToMessageLog (LPTSTR lpszMsg)
VOID | CmdDebugService (int argc, char **argv)
VOID | CmdInstallService ()
VOID | CmdRemoveService ()
BOOL WINAPI | ControlHandler (DWORD dwCtrlType)
LPTSTR | GetLastErrorText (LPTSTR lpszBuf, DWORD dwSize)
void __cdecl | main (int argc, char **argv)
BOOL | ReportStatusToSCMgr (DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint)
VOID WINAPI | service_ctrl (DWORD dwCtrlCode)
VOID WINAPI | service_main (DWORD dwArgc, LPTSTR *lpszArgv)

Variables

BOOL | bDebug = FALSE
DWORD | dwErr = 0
SERVICE_STATUS_HANDLE | sshStatusHandle
SERVICE_STATUS | ssStatus
TCHAR | szErr [256]

Function Documentation

VOID AddToMessageLog ( LPTSTR lpszMsg )

Definition at line 291 of file Service.c.

{
   TCHAR szMsg [(sizeof(SZSERVICENAME) / sizeof(TCHAR)) + 100 ];
   HANDLE  hEventSource;
   LPTSTR  lpszStrings[2];

   if ( !bDebug )
   {
      dwErr = GetLastError();

      // Use event logging to log the error.
      //
      hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));

      _stprintf(szMsg, TEXT("%s error: %d"), TEXT(SZSERVICENAME), dwErr);
      lpszStrings[0] = szMsg;
      lpszStrings[1] = lpszMsg;

      if (hEventSource != NULL)
      {
         ReportEvent(hEventSource, // handle of event source
                     EVENTLOG_ERROR_TYPE,  // event type
                     0,                    // event category
                     0,                    // event ID
                     NULL,                 // current user's SID
                     2,                    // strings in lpszStrings
                     0,                    // no bytes of raw data
                     lpszStrings,          // array of error strings
                     NULL);                // no raw data

         (VOID) DeregisterEventSource(hEventSource);
      }
   }
}

VOID CmdDebugService | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 495 of file Service.c.

{
   DWORD dwArgc;
   LPTSTR *lpszArgv;

#ifdef UNICODE
   lpszArgv = CommandLineToArgvW(GetCommandLineW(), &(dwArgc) );
   if (NULL == lpszArgv)
   {
       // CommandLineToArvW failed!!
       _tprintf(TEXT("CmdDebugService CommandLineToArgvW returned NULL\n"));
       return;
   }
#else
   dwArgc   = (DWORD) argc;
   lpszArgv = argv;
#endif

   _tprintf(TEXT("Debugging %s.\n"), TEXT(SZSERVICEDISPLAYNAME));

   SetConsoleCtrlHandler( ControlHandler, TRUE );

   ServiceStart( dwArgc, lpszArgv );

#ifdef UNICODE
// Must free memory allocated for arguments

   GlobalFree(lpszArgv);
#endif // UNICODE

}

VOID CmdInstallService ( )

Definition at line 348 of file Service.c.

{
   SC_HANDLE   schService;
   SC_HANDLE   schSCManager;

   TCHAR szPath[512];

   if ( GetModuleFileName( NULL, szPath, 512 ) == 0 )
   {
      _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(SZSERVICEDISPLAYNAME), GetLastErrorText(szErr, 256));
      return;
   }

   schSCManager = OpenSCManager(
                               NULL,                   // machine (NULL == local)
                               NULL,                   // database (NULL == default)
                               SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE  // access required
                               );
   if ( schSCManager )
   {
      schService = CreateService(
                                schSCManager,               // SCManager database
                                TEXT(SZSERVICENAME),        // name of service
                                TEXT(SZSERVICEDISPLAYNAME), // name to display
                                SERVICE_QUERY_STATUS,         // desired access
                                SERVICE_WIN32_OWN_PROCESS,  // service type
                                SERVICE_DEMAND_START,       // start type
                                SERVICE_ERROR_NORMAL,       // error control type
                                szPath,                     // service's binary
                                NULL,                       // no load ordering group
                                NULL,                       // no tag identifier
                                TEXT(SZDEPENDENCIES),       // dependencies
                                NULL,                       // LocalSystem account
                                NULL);                      // no password

      if ( schService )
      {
         _tprintf(TEXT("%s installed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
         CloseServiceHandle(schService);
      }
      else
      {
         _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(szErr, 256));
      }

      CloseServiceHandle(schSCManager);
   }
   else
      _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
}

VOID CmdRemoveService ( )

Definition at line 414 of file Service.c.

{
   SC_HANDLE   schService;
   SC_HANDLE   schSCManager;

   schSCManager = OpenSCManager(
                               NULL,                   // machine (NULL == local)
                               NULL,                   // database (NULL == default)
                               SC_MANAGER_CONNECT   // access required
                               );
   if ( schSCManager )
   {
      schService = OpenService(schSCManager, TEXT(SZSERVICENAME), DELETE | SERVICE_STOP | SERVICE_QUERY_STATUS);

      if (schService)
      {
         // try to stop the service
         if ( ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus ) )
         {
            _tprintf(TEXT("Stopping %s."), TEXT(SZSERVICEDISPLAYNAME));
            Sleep( 1000 );

            while ( QueryServiceStatus( schService, &ssStatus ) )
            {
               if ( ssStatus.dwCurrentState == SERVICE_STOP_PENDING )
               {
                  _tprintf(TEXT("."));
                  Sleep( 1000 );
               }
               else
                  break;
            }

            if ( ssStatus.dwCurrentState == SERVICE_STOPPED )
               _tprintf(TEXT("\n%s stopped.\n"), TEXT(SZSERVICEDISPLAYNAME) );
            else
               _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(SZSERVICEDISPLAYNAME) );

         }

         // now remove the service
         if ( DeleteService(schService) )
            _tprintf(TEXT("%s removed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
         else
            _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(szErr,256));

         CloseServiceHandle(schService);
      }
      else
         _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));

      CloseServiceHandle(schSCManager);
   }
   else
      _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
}

BOOL WINAPI ControlHandler ( DWORD dwCtrlType )

Definition at line 542 of file Service.c.

{
   switch ( dwCtrlType )
   {
   case CTRL_BREAK_EVENT:  // use Ctrl+C or Ctrl+Break to simulate
   case CTRL_C_EVENT:      // SERVICE_CONTROL_STOP in debug mode
      _tprintf(TEXT("Stopping %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
      ServiceStop();
      return TRUE;
      break;

   }
   return FALSE;
}

LPTSTR GetLastErrorText | ( | LPTSTR | lpszBuf,
 |  | DWORD | dwSize
 | ) |  |

Definition at line 571 of file Service.c.

{
   DWORD dwRet;
   LPTSTR lpszTemp = NULL;

   dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
                          NULL,
                          GetLastError(),
                          LANG_NEUTRAL,
                          (LPTSTR)&lpszTemp,
                          0,
                          NULL );

   // supplied buffer is not long enough
   if ( !dwRet || ( (long)dwSize < (long)dwRet+14 ) )
      lpszBuf[0] = TEXT('\0');
   else
   {
      lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0');  //remove cr and newline character
      _stprintf( lpszBuf, TEXT("%s (0x%x)"), lpszTemp, GetLastError() );
   }

   if ( lpszTemp )
      LocalFree((HLOCAL) lpszTemp );

   return lpszBuf;
}

void __cdecl main | ( | int | argc,
 |  | char ** | argv
 | ) |  |

Definition at line 67 of file Service.c.

{
   SERVICE_TABLE_ENTRY dispatchTable[] =
   {
      { TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main},
      { NULL, NULL}
   };

   if ( (argc > 1) &&
        ((*argv[1] == '-') || (*argv[1] == '/')) )
   {
      if ( _stricmp( "install", argv[1]+1 ) == 0 )
      {
         CmdInstallService();
      }
      else if ( _stricmp( "remove", argv[1]+1 ) == 0 )
      {
         CmdRemoveService();
      }
      else if ( _stricmp( "debug", argv[1]+1 ) == 0 )
      {
         bDebug = TRUE;
         CmdDebugService(argc, argv);
      }
      else
      {
         goto dispatch;
      }
      exit(0);
   }

   // if it doesn't match any of the above parameters
   // the service control manager may be starting the service
   // so we must call StartServiceCtrlDispatcher
   dispatch:
   // this is just to be friendly
   printf( "%s -install          to install the service\n", SZAPPNAME );
   printf( "%s -remove           to remove the service\n", SZAPPNAME );
   printf( "%s -debug <params>   to run as a console app for debugging\n", SZAPPNAME );
   printf( "\nStartServiceCtrlDispatcher being called.\n" );
   printf( "This may take several seconds.  Please wait.\n" );

   if (!StartServiceCtrlDispatcher(dispatchTable))
      AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
}

BOOL ReportStatusToSCMgr | ( | DWORD | dwCurrentState,
 |  | DWORD | dwWin32ExitCode,
 |  | DWORD | dwWaitHint
 | ) |  |

Definition at line 240 of file Service.c.

{
   static DWORD dwCheckPoint = 1;
   BOOL fResult = TRUE;

   if ( !bDebug ) // when debugging we don't report to the SCM
   {
      if (dwCurrentState == SERVICE_START_PENDING)
         ssStatus.dwControlsAccepted = 0;
      else
         ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;

      ssStatus.dwCurrentState = dwCurrentState;
      ssStatus.dwWin32ExitCode = dwWin32ExitCode;
      ssStatus.dwWaitHint = dwWaitHint;

      if ( ( dwCurrentState == SERVICE_RUNNING ) ||
           ( dwCurrentState == SERVICE_STOPPED ) )
         ssStatus.dwCheckPoint = 0;
      else
         ssStatus.dwCheckPoint = dwCheckPoint++;

      // Report the status of the service to the service control manager.
      //
      if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus)))
      {
         AddToMessageLog(TEXT("SetServiceStatus"));
      }
   }
   return fResult;
}

VOID WINAPI service_ctrl ( DWORD dwCtrlCode )

Definition at line 188 of file Service.c.

{
   // Handle the requested control code.
   //
   switch (dwCtrlCode)
   {
   // Stop the service.
   //
   // SERVICE_STOP_PENDING should be reported before
   // setting the Stop Event - hServerStopEvent - in
   // ServiceStop().  This avoids a race condition
   // which may result in a 1053 - The Service did not respond...
   // error.
   case SERVICE_CONTROL_STOP:
      ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 0);
      ServiceStop();
      return;

      // Update the service status.
      //
   case SERVICE_CONTROL_INTERROGATE:
      break;

      // invalid control code
      //
   default:
      break;

   }

   ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0);
}

VOID WINAPI service_main | ( | DWORD | dwArgc,
 |  | LPTSTR * | lpszArgv
 | ) |  |

Definition at line 132 of file Service.c.

{

   // register our service control handler:
   //
   sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SZSERVICENAME), service_ctrl);

   if (!sshStatusHandle)
      goto cleanup;

   // SERVICE_STATUS members that don't change in example
   //
   ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
   ssStatus.dwServiceSpecificExitCode = 0;

   // report the status to the service control manager.
   //
   if (!ReportStatusToSCMgr(
                           SERVICE_START_PENDING, // service state
                           NO_ERROR,              // exit code
                           3000))                 // wait hint
      goto cleanup;

   ServiceStart( dwArgc, lpszArgv );

   cleanup:

   // try to report the stopped status to the service control manager.
   //
   if (sshStatusHandle)
      (VOID)ReportStatusToSCMgr(
                               SERVICE_STOPPED,
                               dwErr,
                               0);

   return;
}

Variable Documentation

BOOL bDebug = FALSE

Definition at line 37 of file Service.c.

DWORD dwErr = 0

Definition at line 36 of file Service.c.

SERVICE_STATUS_HANDLE sshStatusHandle

Definition at line 35 of file Service.c.

SERVICE_STATUS ssStatus

Definition at line 34 of file Service.c.

TCHAR szErr[256]

Definition at line 38 of file Service.c.

Generated on Wed Nov 13 2024 16:54:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/Service.H File Reference

  • WinBase
  • Service
Defines | Functions

Service.H File Reference

Go to the source code of this file.

Defines

#define | SZAPPNAME "Simple"
#define | SZDEPENDENCIES ""
#define | SZSERVICEDISPLAYNAME "Simple Service"
#define | SZSERVICENAME "SimpleService"

Functions

void | AddToMessageLog (LPTSTR lpszMsg)
BOOL | ReportStatusToSCMgr (DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint)
VOID | ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
VOID | ServiceStop ()

Define Documentation

#define SZAPPNAME "Simple"

Definition at line 65 of file Service.H.

#define SZDEPENDENCIES ""

Definition at line 71 of file Service.H.

#define SZSERVICEDISPLAYNAME "Simple Service"

Definition at line 69 of file Service.H.

#define SZSERVICENAME "SimpleService"

Definition at line 67 of file Service.H.

Function Documentation

void AddToMessageLog ( LPTSTR lpszMsg )

Definition at line 598 of file Service.cpp.

                                    {
    TCHAR szMsg1[256];
    HANDLE hEventSource;
    LPTSTR lpszStrings[2];
    DWORD dwErr = 0;

    dwErr = GetLastError();

    // Use event logging to log the error.
    hEventSource = RegisterEventSource(NULL, SERVICENAME);

    _stprintf(szMsg1, TEXT("%s error: %d"), SERVICENAME, dwErr);
    lpszStrings[0] = szMsg1;
    lpszStrings[1] = szMsg2;

    if (hEventSource != NULL) {
        ReportEvent(hEventSource, // handle of event source
                    EVENTLOG_ERROR_TYPE, // event type
                    0, // event category
                    0, // event ID
                    NULL, // current user's SID
                    2, // strings in lpszStrings
                    0, // no bytes of raw data
                    (LPCTSTR *) lpszStrings, // array of error strings
                    NULL); // no raw data

        (VOID) DeregisterEventSource(hEventSource);
    }
}

BOOL ReportStatusToSCMgr | ( | DWORD | dwCurrentState,
 |  | DWORD | dwWin32ExitCode,
 |  | DWORD | dwWaitHint
 | ) |  |

Definition at line 242 of file Service.C.

{
    static DWORD dwCheckPoint = 1;
    BOOL fResult = TRUE;

    if ( !bDebug ) // when debugging we don't report to the SCM
    {
        if (dwCurrentState == SERVICE_START_PENDING)
            ssStatus.dwControlsAccepted = 0;
        else
            ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;

        ssStatus.dwCurrentState = dwCurrentState;
        ssStatus.dwWin32ExitCode = dwWin32ExitCode;
        ssStatus.dwWaitHint = dwWaitHint;

        if ( ( dwCurrentState == SERVICE_RUNNING ) ||
             ( dwCurrentState == SERVICE_STOPPED ) )
            ssStatus.dwCheckPoint = 0;
        else
            ssStatus.dwCheckPoint = dwCheckPoint++;

        // Report the status of the service to the service control manager.
        //
        if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus))) {
            AddToMessageLog(TEXT("SetServiceStatus"));
        }
    }
    return fResult;
}

VOID ServiceStart | ( | DWORD | dwArgc,
 |  | LPTSTR * | lpszArgv
 | ) |  |

Definition at line 195 of file FileRepService.cpp.

                                                   {
  RPC_STATUS status;

    // Report the status to the service control manager.
    if (!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_START_PENDING, NO_ERROR, 1000)) {
        AddToMessageLog(TEXT("ServiceStart: ReportStatusToSCMgr failed\n"));
        ServiceStop();
        return;
    }

    // Allow the user to override settings with command line switches.
    for (unsigned i = 1; i < dwArgc; i++) {
        // Well-formed argument switches start with '/' or '-' and are
        // two characters long.
        if (((*szArgList[i] == TEXT('-')) || (*szArgList[i] == TEXT('/'))) && _tcsclen(szArgList[i]) == 2) {

            switch (_totlower(*(szArgList[i]+1))) {

                case TEXT('f'):
      bNoFileIO = true;
      break;

                default:
      AddToMessageLog(TEXT("ServiceStart: bad arguments"));
      ServiceStop();
      return;
            }
        }
        else {
    AddToMessageLog(TEXT("ServiceStart: bad arguments"));
    ServiceStop();
    return;
        }
    }

    if (!StartFileRepServer()) {
      ServiceStop();
    }
    else {
      bServerListening = TRUE;

      // Tell The SCM that the service is running.
      if (!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_RUNNING, NO_ERROR, 0)){
        AddToMessageLog(TEXT("ServiceStart: ReportStatusToSCMgr failed"));
        ServiceStop();
        return;
      }

      // RpcMgmtWaitServerListen() will block until the server has
      // stopped listening.
      status = RpcMgmtWaitServerListen();
      if (status != RPC_S_OK){
        AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcMgmtWaitServerListen"), status);
        ServiceStop();
        return;
      }
    }

    return;
}

VOID ServiceStop ( )

Definition at line 610 of file filerepservice.cpp.

                   {
    RPC_STATUS status;

    // Stops the server, wakes up the main thread.
    if (bServerListening) {
        status = RpcMgmtStopServerListening(NULL);
        if(status != RPC_S_OK) {
                    AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcMgmtWaitServerListen"), status);
        }
        bServerListening = FALSE;
    }

    // Delete the binding vector.
    status = RpcServerUnregisterIf(NULL, NULL, FALSE);
    if(status != RPC_S_OK){
        AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerUnregisterIf"), status);
    }

    // Tell The SCM that the service is stopped.
    if(!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_STOPPED, NO_ERROR, 0)) {
        AddToMessageLogProcFailure(TEXT("ServiceStop: ReportStatusToSCMgr"), GetLastError());
    }

    // Wait for the client threads to finish so
    // that we do not deallocate active data structures.
    // We can accomplish this by waiting for the counters
    // to become zero.  Performing a check in this
    // order should prevent race conditions, since
    // pClientActiveReqCounters are incremented before
    // pClientReqCounters are decremented.
    if (fServerReqCountersCreated) {
        if (CountersCheckForNonzero(pServerReqCounters, NumPriGroups)) {
            Sleep(1000);
        }
    }
    if (fClientReqCountersCreated) {
        if (CountersCheckForNonzero(pClientReqCounters, NumPriGroups)) {
            Sleep(1000);
        }
    }
    if (fClientActiveReqCountersCreated) {
        if (CountersCheckForNonzero(pClientActiveReqCounters, NumPriGroups)) {
            Sleep(1000);
        }
    }

    DeleteWellKnownSids();

    // Delete queues and counters.
    if (fServerReqCountersCreated) {
        CountersDelete(pServerReqCounters, NumPriGroups);
        fServerReqCountersCreated = FALSE;
    }
    if (fClientReqCountersCreated) {
        CountersDelete(pClientReqCounters, NumPriGroups);
        fClientReqCountersCreated = FALSE;
    }
    if (fClientActiveReqCountersCreated) {
        CountersDelete(pClientActiveReqCounters, NumPriGroups);
        fClientActiveReqCountersCreated = FALSE;
    }
    if (fClientReqQueuesCreated) {
        QueuesDelete(ClientReqQueues, NumPriGroups);
        fClientReqQueuesCreated = FALSE;
    }
    if (fClientActiveReqHashQueuesCreated) {
        QueuesDelete(ClientActiveReqHashQueues, NumPriGroups);
        fClientActiveReqHashQueuesCreated = FALSE;
    }
    if (fClientActiveReqHashCountersCreated) {
        QueuesDelete(ClientActiveReqHashCounters, NumPriGroups);
        fClientActiveReqHashCountersCreated = FALSE;
    }

#ifdef PROF
    if (fProfOpenedLog) {
        ProfCloseLog();
        fProfOpenedLog = FALSE;
    }
#endif

#ifdef DEBUG
    if (fDbgMsgOpenedLog) {
        DbgMsgCloseLog();
        fDbgMsgOpenedLog = FALSE;
    }
#endif

}

Generated on Wed Nov 13 2024 16:54:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/Simple.c File Reference

  • WinBase
  • Service
Functions | Variables

Simple.c File Reference

#include <windows.h>
#include <sddl.h>
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <tchar.h>
#include "service.h"

Go to the source code of this file.

Functions

BOOL | CreateMyDACL (SECURITY_ATTRIBUTES *pSA)
VOID | ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
VOID | ServiceStop ()

Variables

HANDLE | hServerStopEvent = NULL

Function Documentation

BOOL CreateMyDACL ( SECURITY_ATTRIBUTES * pSA )

Definition at line 54 of file Simple.c.

{
    // Define the SDDL for the DACL. This example sets
    // the following access:
    //     Built-in guests are denied all access.
    //     Anonymous Logon is denied all access.
    //     Authenticated Users are allowed read/write/execute access.
    //     Administrators are allowed full control.
    // Modify these values as needed to generate the proper
    // DACL for your application.
    TCHAR * szSD = "D:"                   // Discretionary ACL
                   "(D;OICI;GA;;;BG)"     // Deny access to Built-in Guests
                   "(D;OICI;GA;;;AN)"     // Deny access to Anonymous Logon
                   "(A;OICI;GRGWGX;;;AU)" // Allow read/write/execute to Authenticated Users
                   "(A;OICI;GA;;;BA)";    // Allow full control to Administrators

    if (NULL == pSA)
        return FALSE;

    return ConvertStringSecurityDescriptorToSecurityDescriptor(
                                                              szSD,
                                                              SDDL_REVISION_1,
                                                              &(pSA->lpSecurityDescriptor),
                                                              NULL);
}

VOID ServiceStart | ( | DWORD | dwArgc,
 |  | LPTSTR * | lpszArgv
 | ) |  |

Definition at line 100 of file Simple.c.

{
   HANDLE                  hPipe = INVALID_HANDLE_VALUE;
   HANDLE                  hEvents[2] = {NULL, NULL};
   OVERLAPPED              os;
   PSECURITY_DESCRIPTOR    pSD = NULL;
   SECURITY_ATTRIBUTES     sa;
   TCHAR                   szIn[80];
   TCHAR                   szOut[ (sizeof(szIn) / sizeof(TCHAR) )  + 100];
   LPTSTR                  lpszPipeName = TEXT("\\\\.\\pipe\\simple");
   BOOL                    bRet;
   DWORD                   cbRead;
   DWORD                   cbWritten;
   DWORD                   dwWait;
   UINT                    ndx;

   ///////////////////////////////////////////////////
   //
   // Service initialization
   //

   // report the status to the service control manager.
   //
   if (!ReportStatusToSCMgr(
                           SERVICE_START_PENDING, // service state
                           NO_ERROR,              // exit code
                           3000))                 // wait hint
      goto cleanup;

   // create the event object. The control handler function signals
   // this event when it receives the "stop" control code.
   //
   hServerStopEvent = CreateEvent(
                                 NULL,    // no security attributes
                                 TRUE,    // manual reset event
                                 FALSE,   // not-signalled
                                 NULL);   // no name

   if ( hServerStopEvent == NULL)
      goto cleanup;

   hEvents[0] = hServerStopEvent;

   // report the status to the service control manager.
   //
   if (!ReportStatusToSCMgr(
                           SERVICE_START_PENDING, // service state
                           NO_ERROR,              // exit code
                           3000))                 // wait hint
      goto cleanup;

   // create the event object object use in overlapped i/o
   //
   hEvents[1] = CreateEvent(
                           NULL,    // no security attributes
                           TRUE,    // manual reset event
                           FALSE,   // not-signalled
                           NULL);   // no name

   if ( hEvents[1] == NULL)
      goto cleanup;

   // report the status to the service control manager.
   //
   if (!ReportStatusToSCMgr(
                           SERVICE_START_PENDING, // service state
                           NO_ERROR,              // exit code
                           3000))                 // wait hint
      goto cleanup;

   // create a security descriptor that allows anyone to write to
   //  the pipe...
   //
   pSD = (PSECURITY_DESCRIPTOR) malloc( SECURITY_DESCRIPTOR_MIN_LENGTH );

   if (pSD == NULL)
      goto cleanup;

   if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION))
      goto cleanup;

   sa.nLength = sizeof(sa);
   sa.bInheritHandle = TRUE;
   sa.lpSecurityDescriptor = pSD;

   if(!CreateMyDACL(&sa) )
   {
       // DACL creation FAILED!!
       return;
   }

   // report the status to the service control manager.
   //
   if (!ReportStatusToSCMgr(
                           SERVICE_START_PENDING, // service state
                           NO_ERROR,              // exit code
                           3000))                 // wait hint
      goto cleanup;

   // allow user tp define pipe name
   for ( ndx = 1; ndx < dwArgc-1; ndx++ )
   {

      if ( ( (*(lpszArgv[ndx]) == TEXT('-')) ||
             (*(lpszArgv[ndx]) == TEXT('/')) ) &&
           (!_tcsicmp( TEXT("pipe"), lpszArgv[ndx]+1 ) && ((ndx + 1) < dwArgc)) )
      {
         lpszPipeName = lpszArgv[++ndx];
      }

   }

   // open our named pipe...
   //
   hPipe = CreateNamedPipe(
                          lpszPipeName         ,  // name of pipe
                          FILE_FLAG_OVERLAPPED |
                          PIPE_ACCESS_DUPLEX,     // pipe open mode
                          PIPE_TYPE_MESSAGE |
                          PIPE_READMODE_MESSAGE |
                          PIPE_WAIT,              // pipe IO type
                          1,                      // number of instances
                          0,                      // size of outbuf (0 == allocate as necessary)
                          0,                      // size of inbuf
                          1000,                   // default time-out value
                          &sa);                   // security attributes

   if (hPipe == INVALID_HANDLE_VALUE)
   {
      AddToMessageLog(TEXT("Unable to create named pipe"));
      goto cleanup;
   }

   // report the status to the service control manager.
   //
   if (!ReportStatusToSCMgr(
                           SERVICE_RUNNING,       // service state
                           NO_ERROR,              // exit code
                           0))                    // wait hint
      goto cleanup;

   //
   // End of initialization
   //
   ////////////////////////////////////////////////////////

   ////////////////////////////////////////////////////////
   //
   // Service is now running, perform work until shutdown
   //

   while ( 1 )
   {
      // init the overlapped structure
      //
      memset( &os, 0, sizeof(OVERLAPPED) );
      os.hEvent = hEvents[1];
      ResetEvent( hEvents[1] );

      // wait for a connection...
      //
      ConnectNamedPipe(hPipe, &os);

      if ( GetLastError() == ERROR_IO_PENDING )
      {
         dwWait = WaitForMultipleObjects( 2, hEvents, FALSE, INFINITE );
         if ( dwWait != WAIT_OBJECT_0+1 )     // not overlapped i/o event - error occurred,
            break;                           // or server stop signaled
      }

      // init the overlapped structure
      //
      memset( &os, 0, sizeof(OVERLAPPED) );
      os.hEvent = hEvents[1];
      ResetEvent( hEvents[1] );

      // grab whatever's coming through the pipe...
      //
      bRet = ReadFile(
                     hPipe,          // file to read from
                     szIn,           // address of input buffer
                     sizeof(szIn),   // number of bytes to read
                     &cbRead,        // number of bytes read
                     &os);           // overlapped stuff, not needed

      if ( !bRet && ( GetLastError() == ERROR_IO_PENDING ) )
      {
         dwWait = WaitForMultipleObjects( 2, hEvents, FALSE, INFINITE );
         if ( dwWait != WAIT_OBJECT_0+1 )     // not overlapped i/o event - error occurred,
            break;                           // or server stop signaled
      }

      // munge the string
      //
      _stprintf(szOut, TEXT("Hello! [%s]"), szIn);

      // init the overlapped structure
      //
      memset( &os, 0, sizeof(OVERLAPPED) );
      os.hEvent = hEvents[1];
      ResetEvent( hEvents[1] );

      // send it back out...
      //
      bRet = WriteFile(
                      hPipe,          // file to write to
                      szOut,          // address of output buffer
                      sizeof(szOut),  // number of bytes to write
                      &cbWritten,     // number of bytes written
                      &os);           // overlapped stuff, not needed

      if ( !bRet && ( GetLastError() == ERROR_IO_PENDING ) )
      {
         dwWait = WaitForMultipleObjects( 2, hEvents, FALSE, INFINITE );
         if ( dwWait != WAIT_OBJECT_0+1 )     // not overlapped i/o event - error occurred,
            break;                           // or server stop signaled
      }

      // drop the connection...
      //
      DisconnectNamedPipe(hPipe);
   }

   cleanup:

   if (hPipe != INVALID_HANDLE_VALUE )
      CloseHandle(hPipe);

   if (hServerStopEvent)
      CloseHandle(hServerStopEvent);

   if (hEvents[1]) // overlapped i/o event
      CloseHandle(hEvents[1]);

   if ( pSD )
      free( pSD );

}

VOID ServiceStop ( )

Definition at line 361 of file Simple.c.

{
   if ( hServerStopEvent )
      SetEvent(hServerStopEvent);
}

Variable Documentation

HANDLE hServerStopEvent = NULL

Definition at line 37 of file Simple.c.

Generated on Wed Nov 13 2024 16:53:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/ProcList/ProcList.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • ProcList
Defines | Functions

ProcList.c File Reference

#include <windows.h>
#include <winperf.h>
#include <malloc.h>
#include <stdio.h>
#include <tchar.h>
#include <pdh.h>
#include <pdhmsg.h>

Go to the source code of this file.

Defines

#define | tmain main
#define | WIN32_LEAN_AND_MEAN 1

Functions

int | tmain ()

Define Documentation

#define tmain main

Definition at line 21 of file ProcList.c.

#define WIN32_LEAN_AND_MEAN 1

Definition at line 25 of file ProcList.c.

Function Documentation

int tmain ( )

Definition at line 35 of file ProcList.c.

{
   PDH_STATUS  pdhStatus               = ERROR_SUCCESS;
   LPTSTR      szCounterListBuffer     = NULL;
   DWORD       dwCounterListSize       = 0;
   LPTSTR      szInstanceListBuffer    = NULL;
   DWORD       dwInstanceListSize      = 0;
   LPTSTR      szThisInstance          = NULL;

   // call the function to determine the required buffer size for the data
   pdhStatus = PdhEnumObjectItems(
                                  NULL,                   // reserved
                                  NULL,                   // local machine
                                  TEXT("Process"),        // object to enumerate
                                  szCounterListBuffer,    // pass in NULL buffers
                                  &dwCounterListSize,     // an 0 length to get
                                  szInstanceListBuffer,   // required size
                                  &dwInstanceListSize,    // of the buffers in chars
                                  PERF_DETAIL_WIZARD,     // counter detail level
                                  0);
   if (pdhStatus == ERROR_SUCCESS || pdhStatus == PDH_MORE_DATA)
   {
      // allocate the buffers and try the call again
      // PdhEnum functions will return ERROR_SUCCESS in WIN2K, but PDH_MORE_DATA in XP and later.
      // In either case, dwCounterListSize and dwInstanceListSize should contain correct buffer size needed.
      //
      szCounterListBuffer = (LPTSTR)malloc (
                                           (dwCounterListSize * sizeof (TCHAR)));
      szInstanceListBuffer = (LPTSTR)malloc (
                                            (dwInstanceListSize * sizeof (TCHAR)));
      if ((szCounterListBuffer != NULL) &&
          (szInstanceListBuffer != NULL))
      {
         pdhStatus = PdhEnumObjectItems (
                                        NULL,   // reserved
                                        NULL,   // local machine
                                        TEXT("Process"), // object to enumerate
                                        szCounterListBuffer,    // pass in NULL buffers
                                        &dwCounterListSize,     // an 0 length to get
                                        szInstanceListBuffer,   // required size
                                        &dwInstanceListSize,    // of the buffers in chars
                                        PERF_DETAIL_WIZARD,     // counter detail level
                                        0);
         if (pdhStatus == ERROR_SUCCESS)
         {
            _tprintf (TEXT("\nRunning Processes:"));
            // walk the return instance list
            for (szThisInstance = szInstanceListBuffer;
                *szThisInstance != 0;
                szThisInstance += lstrlen(szThisInstance) + 1)
            {
               _tprintf (TEXT("\n  %s"), szThisInstance);
            }
         }
      }
      else
      {
         _tprintf (TEXT("\nPROCLIST: unable to allocate buffers"));
      }
      if (szCounterListBuffer != NULL) free (szCounterListBuffer);
      if (szInstanceListBuffer != NULL) free (szInstanceListBuffer);
   }
   else
   {
      _tprintf (TEXT("\nPROCLIST: unable to determine the necessary buffer size required"));
   }
   return 0;
}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/AboutDlg.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Defines | Functions

AboutDlg.c File Reference

#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include "statlist.h"
#include "winutils.h"
#include "aboutdlg.h"

Go to the source code of this file.

Defines

#define | WIN32_LEAN_AND_MEAN 1

Functions

LRESULT CALLBACK | About (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)

Define Documentation

#define WIN32_LEAN_AND_MEAN 1

Definition at line 18 of file AboutDlg.c.

Function Documentation

LRESULT CALLBACK About | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 42 of file AboutDlg.c.

{
   static  HFONT hfontDlg;    // Font for dialog text
   static   HFONT hFinePrint; // Font for 'fine print' in dialog
   DWORD   dwVerInfoSize;     // Size of version information block
   LPSTR   lpVersion;         // String pointer to 'version' text
   DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
   UINT    uVersionLen;
   BOOL    bRetCode;
   int     i;
   char    szFullPath[256];
   char    szResult[256];
   char    szGetName[256];
   DWORD dwVersion;
   char  szVersion[40];
   DWORD dwResult;

   switch (message)
   {
   case WM_INITDIALOG:
      // hide window while it's being constructed
      ShowWindow (hDlg, SW_HIDE);

      // crate and load the fonts to be used for the text
      hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            VARIABLE_PITCH | FF_SWISS, "");
      hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                              VARIABLE_PITCH | FF_SWISS, "");

      // position the window in the center of the parent
      CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));

      // get the .exe path
      GetModuleFileName ((HINSTANCE)(GetWindowLongPtr(hDlg, GWLP_HINSTANCE)),
                         szFullPath, sizeof(szFullPath));

      // Now lets dive in and pull out the version information:
      dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
      if (dwVerInfoSize)
      {
         LPSTR   lpstrVffInfo;
         HANDLE  hMem;
         hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
         lpstrVffInfo  = GlobalLock(hMem);
         GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
         // The below 'hex' value looks a little confusing, but
         // essentially what it is, is the hexidecimal representation
         // of a couple different values that represent the language
         // and character set that we are wanting string values for.
         // 040904E4 is a very common one, because it means:
         //   US English, Windows MultiLingual characterset
         // Or to pull it all apart:
         // 04------        = SUBLANG_ENGLISH_USA
         // --09----        = LANG_ENGLISH
         // --11----        = LANG_JAPANESE
         // ----04E4 = 1252 = Codepage for Windows:Multilingual

         _snprintf(szGetName, 256, "%sProductName", GetStringRes(IDS_VER_INFO_LANG));

         // Set the title of the dialog:
         bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
                                  (LPSTR)szGetName,
                                  (LPVOID)&lpVersion,
                                  (UINT *)&uVersionLen);

         // Notice order of version and string...
         _snprintf(szResult, 256, "About %s", lpVersion);

         // set dialog caption
         SetWindowText (hDlg, szResult);

         // Walk through the dialog items that we want to replace:
         for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)
         {
            GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
            _snprintf(szGetName, 256, "%s%s", GetStringRes(IDS_VER_INFO_LANG), szResult);
            uVersionLen   = 0;
            lpVersion     = NULL;
            bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
                                           (LPSTR)szGetName,
                                           (LPVOID)&lpVersion,
                                           (UINT *)&uVersionLen);

            if ( bRetCode && uVersionLen && lpVersion)
            {
               // Replace dialog item text with version info
               lstrcpyn(szResult, lpVersion, 256);
               SetDlgItemText(hDlg, i, szResult);
            }
            else
            {
               dwResult = GetLastError();

               _snprintf(szResult, 256, GetStringRes(IDS_VERSION_ERROR), dwResult);
               SetDlgItemText (hDlg, i, szResult);
            }
            SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
                         (UINT_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
                         TRUE);
         } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)

         GlobalUnlock(hMem);
         GlobalFree(hMem);

      }
      else
      {
         // No version information available.

      } // if (dwVerInfoSize)

      SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
                   (WPARAM)hfontDlg,(LPARAM)TRUE);

      // We are  using GetVersion rather then GetVersionEx
      // because earlier versions of Windows NT and Win32s
      // didn't include GetVersionEx:
      dwVersion = GetVersion();

      if (dwVersion < 0x80000000)
      {
         // Windows NT
         _snprintf(szVersion, 40, "Microsoft Windows NT %u.%u (Build: %u)",
                   (DWORD)(LOBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIWORD(dwVersion)) );
      }
      else if (LOBYTE(LOWORD(dwVersion))<4)
      {
         // Win32s
         _snprintf(szVersion, 40, "Microsoft Win32s %u.%u (Build: %u)",
                   (DWORD)(LOBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIWORD(dwVersion) & ~0x8000) );
      }
      else
      {
         // Windows 95
         _snprintf(szVersion, 40, "Microsoft Windows 95 %u.%u",
                   (DWORD)(LOBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIBYTE(LOWORD(dwVersion))) );
      }

      SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);

      // now display the finished product
      ShowWindow (hDlg, SW_SHOW);
      return (TRUE);

   case WM_COMMAND:
      if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
      {
         EndDialog(hDlg, TRUE);
         DeleteObject (hfontDlg);
         DeleteObject (hFinePrint);
         return (TRUE);
      }
      break;
   }

   return FALSE;
}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/AboutDlg.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Functions

AboutDlg.h File Reference

Go to the source code of this file.

Functions

LRESULT CALLBACK About (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)

Function Documentation

LRESULT CALLBACK About | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 445 of file Generic.C.

{
   static  HFONT hfontDlg;    // Font for dialog text
   static   HFONT hFinePrint; // Font for 'fine print' in dialog
   DWORD   dwVerInfoSize;     // Size of version information block
   LPSTR   lpVersion;         // String pointer to 'version' text
   DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
   UINT    uVersionLen;
   WORD    wRootLen;
   BOOL    bRetCode;
   int     i;
   char    szFullPath[BUFFSIZE];
   char    szResult[BUFFSIZE];
   char    szGetName[BUFFSIZE];
   DWORD dwVersion;
   char  szVersion[40];
   DWORD dwResult;
   HRESULT hRes;

   switch (message) {
        case WM_INITDIALOG:
         ShowWindow (hDlg, SW_HIDE);

         if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                  VARIABLE_PITCH | FF_DONTCARE, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                    VARIABLE_PITCH | FF_DONTCARE, "");
         }
         else
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                  VARIABLE_PITCH | FF_SWISS, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                    VARIABLE_PITCH | FF_SWISS, "");
         }

         CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
         GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));

         // Now lets dive in and pull out the version information:
         dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
         if (dwVerInfoSize) {
            LPSTR   lpstrVffInfo;
            HANDLE  hMem;
            hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
            lpstrVffInfo  = GlobalLock(hMem);
            GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
            // The below 'hex' value looks a little confusing, but
            // essentially what it is, is the hexidecimal representation
            // of a couple different values that represent the language
            // and character set that we are wanting string values for.
            // 040904E4 is a very common one, because it means:
            //   US English, Windows MultiLingual characterset
            // Or to pull it all apart:
            // 04------        = SUBLANG_ENGLISH_USA
            // --09----        = LANG_ENGLISH
            // --11----        = LANG_JAPANESE
            // ----04E4 = 1252 = Codepage for Windows:Multilingual

            // Use safe string handling
            szGetName[sizeof(szGetName) - 1] = '\0';
            lstrcpyn(szGetName, GetStringRes(IDS_VER_INFO_LANG), sizeof(szGetName) - 1);
            if (szGetName[sizeof(szGetName) - 1] != '\0') {
                return FALSE; // Buffer overflow error
            }

            wRootLen = (WORD) lstrlen(szGetName); // Save this position

            // Set the title of the dialog using safe string handling
            hRes = StringCchCatN(szGetName, sizeof(szGetName), "ProductName", sizeof("ProductName"));
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }

            bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
               (LPSTR)szGetName,
               (LPVOID)&lpVersion,
               (UINT *)&uVersionLen);

            // Notice order of version and string...
            if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), " ‚Ìƒo[ƒWƒ‡ƒ“î•ñ", sizeof(" ‚Ìƒo[ƒWƒ‡ƒ“î•ñ"));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }
            else
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), "About ", sizeof("About "));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }

            // -----------------------------------------------------

            SetWindowText (hDlg, szResult);

            // Walk through the dialog items that we want to replace:
            for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++) {
               GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
               szGetName[wRootLen] = (char)0;
               // Use safe sting handling
               hRes = StringCchCatN(szGetName, sizeof(szGetName), szResult, sizeof(szResult));
               if (FAILED(hRes)) {
                   return FALSE; // Buffer overflow error
               }
               uVersionLen   = 0;
               lpVersion     = NULL;
               bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
                  (LPSTR)szGetName,
                  (LPVOID)&lpVersion,
                  (UINT *)&uVersionLen);

               if ( bRetCode && uVersionLen && lpVersion) {
                   // Replace dialog item text with version info
                   // Use safe string handling
                   hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                   if (FAILED(hRes)) {
                       return FALSE; // Buffer overflow error
                   }
                   SetDlgItemText(hDlg, i, szResult);
               }
               else
               {
                  dwResult = GetLastError();

                  // Use safe string handling
                  hRes = StringCchPrintf(szResult, sizeof(szResult), GetStringRes(IDS_VERSION_ERROR), dwResult);
                  if (FAILED(hRes)) {
                      return FALSE; // Buffer overflow error
                  }

                  SetDlgItemText (hDlg, i, szResult);
               }
               SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
                  (ULONG_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
                  TRUE);
            } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)

            GlobalUnlock(hMem);
            GlobalFree(hMem);

         } else {
            // No version information available.
         } // if (dwVerInfoSize)

            SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
            (WPARAM)hfontDlg,(LPARAM)TRUE);

         // We are  using GetVersion rather then GetVersionEx
         // because earlier versions of Windows NT and Win32s
         // didn't include GetVersionEx:
         dwVersion = GetVersion();

         if (dwVersion < 0x80000000) {
            // Windows NT
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows NT %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion)) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else if (LOBYTE(LOWORD(dwVersion))<4) {
            // Win32s
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Win32s %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion) & ~0x8000) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else {
            // Windows 95
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows 95 %u.%u",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         }

          SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
         ShowWindow (hDlg, SW_SHOW);
         return (TRUE);

      case WM_COMMAND:
         if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
            EndDialog(hDlg, TRUE);
            DeleteObject (hfontDlg);
            DeleteObject (hFinePrint);
            return (TRUE);
         }
         break;
   }

    return FALSE;
}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/MainWnd.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Defines | Functions | Variables

MainWnd.c File Reference

#include <windows.h>
#include <winperf.h>
#include <stdio.h>
#include <pdh.h>
#include <pdhmsg.h>
#include "statlist.h"
#include "winutils.h"
#include "mainwnd.h"
#include "aboutdlg.h"

Go to the source code of this file.

Defines

#define | NUM_STAT_SAMPLES 100
#define | WIN32_LEAN_AND_MEAN 1

Functions

LRESULT CALLBACK | WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Variables

int | nNumTabStops = sizeof(nTabStops) / sizeof(int)
int | nTabStops [] = {300, 400, 500, 600, 700}

Define Documentation

#define NUM_STAT_SAMPLES 100

Definition at line 52 of file MainWnd.c.

#define WIN32_LEAN_AND_MEAN 1

Definition at line 28 of file MainWnd.c.

Function Documentation

LRESULT CALLBACK WndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 428 of file MainWnd.c.

{
   switch (message)
   {
   case WM_CREATE:
      return On_WM_CREATE (hWnd, wParam, lParam);

   case WM_COMMAND:
      return On_WM_COMMAND (hWnd, wParam, lParam);

   case WM_RBUTTONDOWN: // RightClick in windows client area...
      return On_WM_RBUTTONDOWN (hWnd, wParam, lParam);

   case WM_PAINT:
      return On_WM_PAINT (hWnd, wParam, lParam);

   case WM_DESTROY:
      return On_WM_DESTROY (hWnd, wParam, lParam);

   default:
      return (DefWindowProc(hWnd, message, wParam, lParam));
   }
   return (0);
}

Variable Documentation

int nNumTabStops = sizeof(nTabStops) / sizeof(int)

Definition at line 50 of file MainWnd.c.

int nTabStops[] = {300, 400, 500, 600, 700}

Definition at line 49 of file MainWnd.c.

Generated on Wed Nov 13 2024 16:53:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/MainWnd.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Classes | Defines | Typedefs | Functions

MainWnd.h File Reference

#include <pdh.h>

Go to the source code of this file.

Classes

struct | _CounterInfoBlock

Defines

#define | COUNTER_STRING_SIZE 1024

Typedefs

typedef struct _CounterInfoBlock | CIB
typedef struct _CounterInfoBlock * | PCIB

Functions

LRESULT CALLBACK | WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Define Documentation

#define COUNTER_STRING_SIZE 1024

Definition at line 15 of file MainWnd.h.

Typedef Documentation

typedef struct _CounterInfoBlock CIB
typedef struct _CounterInfoBlock * PCIB

Function Documentation

LRESULT CALLBACK WndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 290 of file Generic.C.

{
   int wmId, wmEvent;
   PAINTSTRUCT ps;
   HDC hdc;
      POINT pnt;
   HMENU hMenu;
      BOOL bGotHelp;

   switch (message) {

      case WM_COMMAND:
         wmId    = LOWORD(wParam); // Remember, these are...
         wmEvent = HIWORD(wParam); // ...different for Win32!

         //Parse the menu selections:
         switch (wmId) {

            case IDM_ABOUT:
               DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)About);
               break;

            case IDM_EXIT:
               DestroyWindow (hWnd);
               break;

            case IDM_HELPTOPICS: // Only called in Windows 95
               bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_FINDER,(DWORD)0);
               if (!bGotHelp)
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPCONTENTS: // Not called in Windows 95
               bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_CONTENTS,(DWORD)0);
               if (!bGotHelp)
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPSEARCH: // Not called in Windows 95
               if (!WinHelp(hWnd, APPNAME".HLP", HELP_PARTIALKEY,
                           (ULONG_PTR)(LPSTR)""))
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPHELP: // Not called in Windows 95
               if(!WinHelp(hWnd, (LPSTR)NULL, HELP_HELPONHELP, 0))
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            // Here are all the other possible menu options,
            // all of these are currently disabled:
            case IDM_NEW:
            case IDM_OPEN:
            case IDM_SAVE:
            case IDM_SAVEAS:
            case IDM_UNDO:
            case IDM_CUT:
            case IDM_COPY:
            case IDM_PASTE:
            case IDM_LINK:
            case IDM_LINKS:

            default:
               return (DefWindowProc(hWnd, message, wParam, lParam));
         }
         break;

      case WM_NCRBUTTONUP: // RightClick on windows non-client area...
         if (IS_WIN95 && SendMessage(hWnd, WM_NCHITTEST, 0, lParam) == HTSYSMENU)
         {
            // The user has clicked the right button on the applications
            // 'System Menu'. Here is where you would alter the default
            // system menu to reflect your application. Notice how the
            // explorer deals with this. For this app, we aren't doing
            // anything
            return (DefWindowProc(hWnd, message, wParam, lParam));
         } else {
            // Nothing we are interested in, allow default handling...
            return (DefWindowProc(hWnd, message, wParam, lParam));
         }
            break;

        case WM_RBUTTONDOWN: // RightClick in windows client area...
            pnt.x = LOWORD(lParam);
            pnt.y = HIWORD(lParam);
            ClientToScreen(hWnd, (LPPOINT) &pnt);
      // This is where you would determine the appropriate 'context'
      // menu to bring up. Since this app has no real functionality,
      // we will just bring up the 'Help' menu:
            hMenu = GetSubMenu (GetMenu (hWnd), 2);
            if (hMenu) {
                TrackPopupMenu (hMenu, 0, pnt.x, pnt.y, 0, hWnd, NULL);
            } else {
            // Couldn't find the menu...
                MessageBeep(0);
            }
            break;

      case WM_DISPLAYCHANGE: // Only comes through on plug'n'play systems
      {
         SIZE  szScreen;
         DWORD dwBitsPerPixel = (DWORD)wParam;

         szScreen.cx = LOWORD(lParam);
         szScreen.cy = HIWORD(lParam);

         MessageBox (GetFocus(), GetStringRes(IDS_DISPLAYCHANGED),
                     szAppName, 0);
      }
      break;

      case WM_PAINT:
         hdc = BeginPaint (hWnd, &ps);
         // Add any drawing code here...
         EndPaint (hWnd, &ps);
         break;

      case WM_DESTROY:
         // Tell WinHelp we don't need it any more...
               WinHelp (hWnd, APPNAME".HLP", HELP_QUIT,(DWORD)0);
         PostQuitMessage(0);
         break;

      default:
         return (DefWindowProc(hWnd, message, wParam, lParam));
   }
   return (0);
}

Generated on Wed Nov 13 2024 16:53:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/Resource.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList

Resource.h File Reference

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/StatList.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Defines | Functions | Variables

StatList.c File Reference

#include <windows.h>
#include <stdlib.h>
#include <memory.h>
#include "statlist.h"

Go to the source code of this file.

Defines

#define | WIN32_LEAN_AND_MEAN 1

Functions

LRESULT CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
BOOL | CenterWindow (HWND, HWND)
LPTSTR | GetStringRes (int id)
BOOL | InitApplication (HINSTANCE hInstance)
BOOL | InitInstance (HINSTANCE hInstance, int nCmdShow)
ATOM | MyRegisterClass (CONST WNDCLASS *lpwc)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
LRESULT CALLBACK | WndProc (HWND, UINT, WPARAM, LPARAM)

Variables

char | APPNAME [] = "Statlist"
HINSTANCE | hInst
char | szAppName [100]
char | szTitle [100]

Define Documentation

#define WIN32_LEAN_AND_MEAN 1

Definition at line 28 of file StatList.c.

Function Documentation

LRESULT CALLBACK About | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 445 of file Generic.C.

{
   static  HFONT hfontDlg;    // Font for dialog text
   static   HFONT hFinePrint; // Font for 'fine print' in dialog
   DWORD   dwVerInfoSize;     // Size of version information block
   LPSTR   lpVersion;         // String pointer to 'version' text
   DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
   UINT    uVersionLen;
   WORD    wRootLen;
   BOOL    bRetCode;
   int     i;
   char    szFullPath[BUFFSIZE];
   char    szResult[BUFFSIZE];
   char    szGetName[BUFFSIZE];
   DWORD dwVersion;
   char  szVersion[40];
   DWORD dwResult;
   HRESULT hRes;

   switch (message) {
        case WM_INITDIALOG:
         ShowWindow (hDlg, SW_HIDE);

         if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                  VARIABLE_PITCH | FF_DONTCARE, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                    VARIABLE_PITCH | FF_DONTCARE, "");
         }
         else
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                  VARIABLE_PITCH | FF_SWISS, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                    VARIABLE_PITCH | FF_SWISS, "");
         }

         CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
         GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));

         // Now lets dive in and pull out the version information:
         dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
         if (dwVerInfoSize) {
            LPSTR   lpstrVffInfo;
            HANDLE  hMem;
            hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
            lpstrVffInfo  = GlobalLock(hMem);
            GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
            // The below 'hex' value looks a little confusing, but
            // essentially what it is, is the hexidecimal representation
            // of a couple different values that represent the language
            // and character set that we are wanting string values for.
            // 040904E4 is a very common one, because it means:
            //   US English, Windows MultiLingual characterset
            // Or to pull it all apart:
            // 04------        = SUBLANG_ENGLISH_USA
            // --09----        = LANG_ENGLISH
            // --11----        = LANG_JAPANESE
            // ----04E4 = 1252 = Codepage for Windows:Multilingual

            // Use safe string handling
            szGetName[sizeof(szGetName) - 1] = '\0';
            lstrcpyn(szGetName, GetStringRes(IDS_VER_INFO_LANG), sizeof(szGetName) - 1);
            if (szGetName[sizeof(szGetName) - 1] != '\0') {
                return FALSE; // Buffer overflow error
            }

            wRootLen = (WORD) lstrlen(szGetName); // Save this position

            // Set the title of the dialog using safe string handling
            hRes = StringCchCatN(szGetName, sizeof(szGetName), "ProductName", sizeof("ProductName"));
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }

            bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
               (LPSTR)szGetName,
               (LPVOID)&lpVersion,
               (UINT *)&uVersionLen);

            // Notice order of version and string...
            if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), " ‚Ìƒo[ƒWƒ‡ƒ“î•ñ", sizeof(" ‚Ìƒo[ƒWƒ‡ƒ“î•ñ"));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }
            else
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), "About ", sizeof("About "));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }

            // -----------------------------------------------------

            SetWindowText (hDlg, szResult);

            // Walk through the dialog items that we want to replace:
            for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++) {
               GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
               szGetName[wRootLen] = (char)0;
               // Use safe sting handling
               hRes = StringCchCatN(szGetName, sizeof(szGetName), szResult, sizeof(szResult));
               if (FAILED(hRes)) {
                   return FALSE; // Buffer overflow error
               }
               uVersionLen   = 0;
               lpVersion     = NULL;
               bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
                  (LPSTR)szGetName,
                  (LPVOID)&lpVersion,
                  (UINT *)&uVersionLen);

               if ( bRetCode && uVersionLen && lpVersion) {
                   // Replace dialog item text with version info
                   // Use safe string handling
                   hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                   if (FAILED(hRes)) {
                       return FALSE; // Buffer overflow error
                   }
                   SetDlgItemText(hDlg, i, szResult);
               }
               else
               {
                  dwResult = GetLastError();

                  // Use safe string handling
                  hRes = StringCchPrintf(szResult, sizeof(szResult), GetStringRes(IDS_VERSION_ERROR), dwResult);
                  if (FAILED(hRes)) {
                      return FALSE; // Buffer overflow error
                  }

                  SetDlgItemText (hDlg, i, szResult);
               }
               SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
                  (ULONG_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
                  TRUE);
            } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)

            GlobalUnlock(hMem);
            GlobalFree(hMem);

         } else {
            // No version information available.
         } // if (dwVerInfoSize)

            SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
            (WPARAM)hfontDlg,(LPARAM)TRUE);

         // We are  using GetVersion rather then GetVersionEx
         // because earlier versions of Windows NT and Win32s
         // didn't include GetVersionEx:
         dwVersion = GetVersion();

         if (dwVersion < 0x80000000) {
            // Windows NT
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows NT %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion)) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else if (LOBYTE(LOWORD(dwVersion))<4) {
            // Win32s
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Win32s %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion) & ~0x8000) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else {
            // Windows 95
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows 95 %u.%u",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         }

          SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
         ShowWindow (hDlg, SW_SHOW);
         return (TRUE);

      case WM_COMMAND:
         if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
            EndDialog(hDlg, TRUE);
            DeleteObject (hfontDlg);
            DeleteObject (hFinePrint);
            return (TRUE);
         }
         break;
   }

    return FALSE;
}

BOOL CenterWindow | ( | HWND | ,
 |  | HWND |
 | ) |  |

Definition at line 676 of file Generic.C.

{
   RECT    rChild, rParent, rWorkArea;
   int     wChild, hChild, wParent, hParent;
   int     xNew, yNew;
   BOOL  bResult;

   // Get the Height and Width of the child window
   GetWindowRect (hwndChild, &rChild);
   wChild = rChild.right - rChild.left;
   hChild = rChild.bottom - rChild.top;

   // Get the Height and Width of the parent window
   GetWindowRect (hwndParent, &rParent);
   wParent = rParent.right - rParent.left;
   hParent = rParent.bottom - rParent.top;

   // Get the limits of the 'workarea'
   bResult = SystemParametersInfo(
      SPI_GETWORKAREA,  // system parameter to query or set
      sizeof(RECT),
      &rWorkArea,
      0);
   if (!bResult) {
      rWorkArea.left = rWorkArea.top = 0;
      rWorkArea.right = GetSystemMetrics(SM_CXSCREEN);
      rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
   }

   // Calculate new X position, then adjust for workarea
   xNew = rParent.left + ((wParent - wChild) /2);
   if (xNew < rWorkArea.left) {
      xNew = rWorkArea.left;
   } else if ((xNew+wChild) > rWorkArea.right) {
      xNew = rWorkArea.right - wChild;
   }

   // Calculate new Y position, then adjust for workarea
   yNew = rParent.top  + ((hParent - hChild) /2);
   if (yNew < rWorkArea.top) {
      yNew = rWorkArea.top;
   } else if ((yNew+hChild) > rWorkArea.bottom) {
      yNew = rWorkArea.bottom - hChild;
   }

   // Set it, and return
   return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}

LPTSTR GetStringRes ( int id )

Definition at line 736 of file Generic.C.

{
  static TCHAR buffer[MAX_PATH];

  buffer[0]=0;
  LoadString (GetModuleHandle (NULL), id, buffer, MAX_PATH);
  return buffer;
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 115 of file StatList.c.

{
    WNDCLASS  wc;
    HWND      hwnd;

    // Win32 will always set hPrevInstance to NULL, so lets check
    // things a little closer. This is because we only want a single
    // version of this app to run at a time
    hwnd = FindWindow (szAppName, NULL);
    if (hwnd) {
        // We found another version of ourself. Lets defer to it:
        if (IsIconic(hwnd)) {
            ShowWindow(hwnd, SW_RESTORE);
        }
        SetForegroundWindow (hwnd);

        // If this app actually had any functionality, we would
        // also want to communicate any action that our 'twin'
        // should now perform based on how the user tried to
        // execute us.
        return FALSE;
        }

        // Fill in window class structure with parameters that describe
        // the main window.
        wc.style         = CS_HREDRAW | CS_VREDRAW;
        wc.lpfnWndProc   = (WNDPROC)WndProc;
        wc.cbClsExtra    = 0;
        wc.cbWndExtra    = 0;
        wc.hInstance     = hInstance;
        wc.hIcon         = LoadIcon (hInstance, szAppName);
        wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
        wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);

        wc.lpszMenuName  = szAppName;
        wc.lpszClassName = szAppName;

        // Register the window class and return success/failure code.
        return RegisterClass(&wc);
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 166 of file StatList.c.

{
   HWND hWnd;
   DWORD dwStatus;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szAppName, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
      NULL, NULL, hInstance, NULL);

   if (!hWnd) {
      dwStatus = GetLastError();
      return (FALSE);
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return (TRUE);
}

ATOM MyRegisterClass ( CONST WNDCLASS * lpwc )

Definition at line 66 of file StatList.c.

{
   HANDLE  hMod;
   FARPROC proc;
   WNDCLASSEX wcex;

   hMod = GetModuleHandle ("USER32");
   if (hMod != NULL) {

#if defined (UNICODE)
      proc = GetProcAddress (hMod, "RegisterClassExW");
#else
      proc = GetProcAddress (hMod, "RegisterClassExA");
#endif

      if (proc != NULL) {

         wcex.style         = lpwc->style;
         wcex.lpfnWndProc   = lpwc->lpfnWndProc;
         wcex.cbClsExtra    = lpwc->cbClsExtra;
         wcex.cbWndExtra    = lpwc->cbWndExtra;
         wcex.hInstance     = lpwc->hInstance;
         wcex.hIcon         = lpwc->hIcon;
         wcex.hCursor       = lpwc->hCursor;
         wcex.hbrBackground = lpwc->hbrBackground;
         wcex.lpszMenuName  = lpwc->lpszMenuName;
         wcex.lpszClassName = lpwc->lpszClassName;

         // Added elements for Windows 95:
         wcex.cbSize = sizeof(WNDCLASSEX);
         wcex.hIconSm = LoadIcon(wcex.hInstance, "SMALL");

         return (*proc)(&wcex);//return RegisterClassEx(&wcex) with type ATOM;
      }
   }
   return (RegisterClass(lpwc));
}

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 198 of file StatList.c.

{
   MSG msg;
   HANDLE hAccelTable;

   // Initialize global strings
   lstrcpyn(szAppName, APPNAME, 99);
   szAppName[99] = '\0'; // ensure that szAppName is NULL terminated
   LoadString (hInstance, IDS_APP_TITLE, szTitle, 100);

   if (!hPrevInstance) {
      // Perform instance initialization:
      if (!InitApplication(hInstance)) {
         return (FALSE);
      }
   }

   // Perform application initialization:
   if (!InitInstance(hInstance, nCmdShow)) {
      return (FALSE);
   }

   hAccelTable = LoadAccelerators (hInstance, szAppName);

   // Main message loop:
   while (GetMessage(&msg, NULL, 0, 0)) {
      if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) {
         TranslateMessage(&msg);
         DispatchMessage(&msg);
      }
   }

   return (int) (msg.wParam);

   lpCmdLine; // This will prevent 'unused formal parameter' warnings
}

LRESULT CALLBACK WndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 290 of file Generic.C.

{
   int wmId, wmEvent;
   PAINTSTRUCT ps;
   HDC hdc;
      POINT pnt;
   HMENU hMenu;
      BOOL bGotHelp;

   switch (message) {

      case WM_COMMAND:
         wmId    = LOWORD(wParam); // Remember, these are...
         wmEvent = HIWORD(wParam); // ...different for Win32!

         //Parse the menu selections:
         switch (wmId) {

            case IDM_ABOUT:
               DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)About);
               break;

            case IDM_EXIT:
               DestroyWindow (hWnd);
               break;

            case IDM_HELPTOPICS: // Only called in Windows 95
               bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_FINDER,(DWORD)0);
               if (!bGotHelp)
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPCONTENTS: // Not called in Windows 95
               bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_CONTENTS,(DWORD)0);
               if (!bGotHelp)
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPSEARCH: // Not called in Windows 95
               if (!WinHelp(hWnd, APPNAME".HLP", HELP_PARTIALKEY,
                           (ULONG_PTR)(LPSTR)""))
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPHELP: // Not called in Windows 95
               if(!WinHelp(hWnd, (LPSTR)NULL, HELP_HELPONHELP, 0))
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            // Here are all the other possible menu options,
            // all of these are currently disabled:
            case IDM_NEW:
            case IDM_OPEN:
            case IDM_SAVE:
            case IDM_SAVEAS:
            case IDM_UNDO:
            case IDM_CUT:
            case IDM_COPY:
            case IDM_PASTE:
            case IDM_LINK:
            case IDM_LINKS:

            default:
               return (DefWindowProc(hWnd, message, wParam, lParam));
         }
         break;

      case WM_NCRBUTTONUP: // RightClick on windows non-client area...
         if (IS_WIN95 && SendMessage(hWnd, WM_NCHITTEST, 0, lParam) == HTSYSMENU)
         {
            // The user has clicked the right button on the applications
            // 'System Menu'. Here is where you would alter the default
            // system menu to reflect your application. Notice how the
            // explorer deals with this. For this app, we aren't doing
            // anything
            return (DefWindowProc(hWnd, message, wParam, lParam));
         } else {
            // Nothing we are interested in, allow default handling...
            return (DefWindowProc(hWnd, message, wParam, lParam));
         }
            break;

        case WM_RBUTTONDOWN: // RightClick in windows client area...
            pnt.x = LOWORD(lParam);
            pnt.y = HIWORD(lParam);
            ClientToScreen(hWnd, (LPPOINT) &pnt);
      // This is where you would determine the appropriate 'context'
      // menu to bring up. Since this app has no real functionality,
      // we will just bring up the 'Help' menu:
            hMenu = GetSubMenu (GetMenu (hWnd), 2);
            if (hMenu) {
                TrackPopupMenu (hMenu, 0, pnt.x, pnt.y, 0, hWnd, NULL);
            } else {
            // Couldn't find the menu...
                MessageBeep(0);
            }
            break;

      case WM_DISPLAYCHANGE: // Only comes through on plug'n'play systems
      {
         SIZE  szScreen;
         DWORD dwBitsPerPixel = (DWORD)wParam;

         szScreen.cx = LOWORD(lParam);
         szScreen.cy = HIWORD(lParam);

         MessageBox (GetFocus(), GetStringRes(IDS_DISPLAYCHANGED),
                     szAppName, 0);
      }
      break;

      case WM_PAINT:
         hdc = BeginPaint (hWnd, &ps);
         // Add any drawing code here...
         EndPaint (hWnd, &ps);
         break;

      case WM_DESTROY:
         // Tell WinHelp we don't need it any more...
               WinHelp (hWnd, APPNAME".HLP", HELP_QUIT,(DWORD)0);
         PostQuitMessage(0);
         break;

      default:
         return (DefWindowProc(hWnd, message, wParam, lParam));
   }
   return (0);
}

Variable Documentation

char APPNAME[] = "Statlist"

Definition at line 43 of file StatList.c.

HINSTANCE hInst

Definition at line 40 of file StatList.c.

char szAppName[100]

Definition at line 41 of file StatList.c.

char szTitle[100]

Definition at line 42 of file StatList.c.

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/StatList.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Defines | Variables

StatList.h File Reference

Go to the source code of this file.

Defines

#define | DLG_VERFIRST 1000
#define | DLG_VERLAST DLG_VERFIRST+5
#define | IDC_COMPANY DLG_VERFIRST
#define | IDC_COPYRIGHT DLG_VERFIRST+3
#define | IDC_FILEDESC DLG_VERFIRST+1
#define | IDC_LABEL DLG_VERLAST+1
#define | IDC_OSVERSION DLG_VERFIRST+4
#define | IDC_PRODVER DLG_VERFIRST+2
#define | IDC_STATIC -1
#define | IDC_TRADEMARK DLG_VERFIRST+5
#define | IDM_ABOUT 402
#define | IDM_ADD_COUNTERS 201
#define | IDM_CLEAR_ALL 203
#define | IDM_DELETE_COUNTER 202
#define | IDM_EXIT 105
#define | IDM_GET_DATA 300
#define | IDM_HELPTOPICS 401
#define | IDM_NEW 101
#define | IDM_OPEN 102
#define | IDM_SAVE 103
#define | IDM_SAVEAS 104
#define | IDM_SETTINGS 204
#define | IDS_APP_TITLE 500
#define | IDS_DISPLAYCHANGED 501
#define | IDS_NO_HELP 504
#define | IDS_VER_INFO_LANG 502
#define | IDS_VERSION_ERROR 503
#define | IS_NT IS_WIN32 && (BOOL)(GetVersion() < 0x80000000)
#define | IS_WIN32 TRUE
#define | IS_WIN32S IS_WIN32 && (BOOL)(!(IS_NT) && (LOBYTE(LOWORD(GetVersion()))<4))
#define | IS_WIN95 (BOOL)(!(IS_NT) && !(IS_WIN32S)) && IS_WIN32

Variables

char | APPNAME []

Define Documentation

#define DLG_VERFIRST 1000

Definition at line 36 of file StatList.h.

#define DLG_VERLAST DLG_VERFIRST+5

Definition at line 43 of file StatList.h.

#define IDC_COMPANY DLG_VERFIRST

Definition at line 37 of file StatList.h.

#define IDC_COPYRIGHT DLG_VERFIRST+3

Definition at line 40 of file StatList.h.

#define IDC_FILEDESC DLG_VERFIRST+1

Definition at line 38 of file StatList.h.

#define IDC_LABEL DLG_VERLAST+1

Definition at line 45 of file StatList.h.

#define IDC_OSVERSION DLG_VERFIRST+4

Definition at line 41 of file StatList.h.

#define IDC_PRODVER DLG_VERFIRST+2

Definition at line 39 of file StatList.h.

#define IDC_STATIC -1

Definition at line 34 of file StatList.h.

#define IDC_TRADEMARK DLG_VERFIRST+5

Definition at line 42 of file StatList.h.

#define IDM_ABOUT 402

Definition at line 32 of file StatList.h.

#define IDM_ADD_COUNTERS 201

Definition at line 24 of file StatList.h.

#define IDM_CLEAR_ALL 203

Definition at line 26 of file StatList.h.

#define IDM_DELETE_COUNTER 202

Definition at line 25 of file StatList.h.

#define IDM_EXIT 105

Definition at line 22 of file StatList.h.

#define IDM_GET_DATA 300

Definition at line 29 of file StatList.h.

#define IDM_HELPTOPICS 401

Definition at line 31 of file StatList.h.

#define IDM_NEW 101

Definition at line 18 of file StatList.h.

#define IDM_OPEN 102

Definition at line 19 of file StatList.h.

#define IDM_SAVE 103

Definition at line 20 of file StatList.h.

#define IDM_SAVEAS 104

Definition at line 21 of file StatList.h.

#define IDM_SETTINGS 204

Definition at line 27 of file StatList.h.

#define IDS_APP_TITLE 500

Definition at line 48 of file StatList.h.

#define IDS_DISPLAYCHANGED 501

Definition at line 49 of file StatList.h.

#define IDS_NO_HELP 504

Definition at line 52 of file StatList.h.

#define IDS_VER_INFO_LANG 502

Definition at line 50 of file StatList.h.

#define IDS_VERSION_ERROR 503

Definition at line 51 of file StatList.h.

#define IS_NT IS_WIN32 && (BOOL)(GetVersion() < 0x80000000)

Definition at line 14 of file StatList.h.

#define IS_WIN32 TRUE

Definition at line 13 of file StatList.h.

#define IS_WIN32S IS_WIN32 && (BOOL)(!(IS_NT) && (LOBYTE(LOWORD(GetVersion()))<4))

Definition at line 15 of file StatList.h.

#define IS_WIN95 (BOOL)(!(IS_NT) && !(IS_WIN32S)) && IS_WIN32

Definition at line 16 of file StatList.h.

Variable Documentation

char APPNAME[]

Definition at line 43 of file StatList.c.

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/WinUtils.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Defines | Functions

WinUtils.c File Reference

#include <windows.h>
#include "winutils.h"

Go to the source code of this file.

Defines

#define | WIN32_LEAN_AND_MEAN 1

Functions

BOOL | CenterWindow (HWND hwndChild, HWND hwndParent)
LPTSTR | GetStringRes (int id)

Define Documentation

#define WIN32_LEAN_AND_MEAN 1

Definition at line 22 of file WinUtils.c.

Function Documentation

BOOL CenterWindow | ( | HWND | hwndChild,
 |  | HWND | hwndParent
 | ) |  |

Definition at line 42 of file WinUtils.c.

{
   RECT    rChild, rParent, rWorkArea;
   int     wChild, hChild, wParent, hParent;
   int     xNew, yNew;
   BOOL  bResult;

   // Get the Height and Width of the child window
   GetWindowRect (hwndChild, &rChild);
   wChild = rChild.right - rChild.left;
   hChild = rChild.bottom - rChild.top;

   // Get the Height and Width of the parent window
   GetWindowRect (hwndParent, &rParent);
   wParent = rParent.right - rParent.left;
   hParent = rParent.bottom - rParent.top;

   // Get the limits of the 'workarea'
   bResult = SystemParametersInfo(
      SPI_GETWORKAREA,  // system parameter to query or set
      sizeof(RECT),
      &rWorkArea,
      0);
   if (!bResult) {
      rWorkArea.left = rWorkArea.top = 0;
      rWorkArea.right = GetSystemMetrics(SM_CXSCREEN);
      rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
   }

   // Calculate new X position, then adjust for workarea
   xNew = rParent.left + ((wParent - wChild) /2);
   if (xNew < rWorkArea.left) {
      xNew = rWorkArea.left;
   } else if ((xNew+wChild) > rWorkArea.right) {
      xNew = rWorkArea.right - wChild;
   }

   // Calculate new Y position, then adjust for workarea
   yNew = rParent.top  + ((hParent - hChild) /2);
   if (yNew < rWorkArea.top) {
      yNew = rWorkArea.top;
   } else if ((yNew+hChild) > rWorkArea.bottom) {
      yNew = rWorkArea.bottom - hChild;
   }

   // Set it, and return
   return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}

LPTSTR GetStringRes ( int id )

Definition at line 102 of file WinUtils.c.

{
  static TCHAR buffer[MAX_PATH];

  buffer[0]=0;
  LoadString (GetModuleHandle (NULL), id, buffer, MAX_PATH);
  return buffer;
}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/WinUtils.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList
Functions

WinUtils.h File Reference

Go to the source code of this file.

Functions

BOOL | CenterWindow (HWND hwndChild, HWND hwndParent)
LPTSTR | GetStringRes (int id)

Function Documentation

BOOL CenterWindow | ( | HWND | hwndChild,
 |  | HWND | hwndParent
 | ) |  |

Definition at line 676 of file Generic.C.

{
   RECT    rChild, rParent, rWorkArea;
   int     wChild, hChild, wParent, hParent;
   int     xNew, yNew;
   BOOL  bResult;

   // Get the Height and Width of the child window
   GetWindowRect (hwndChild, &rChild);
   wChild = rChild.right - rChild.left;
   hChild = rChild.bottom - rChild.top;

   // Get the Height and Width of the parent window
   GetWindowRect (hwndParent, &rParent);
   wParent = rParent.right - rParent.left;
   hParent = rParent.bottom - rParent.top;

   // Get the limits of the 'workarea'
   bResult = SystemParametersInfo(
      SPI_GETWORKAREA,  // system parameter to query or set
      sizeof(RECT),
      &rWorkArea,
      0);
   if (!bResult) {
      rWorkArea.left = rWorkArea.top = 0;
      rWorkArea.right = GetSystemMetrics(SM_CXSCREEN);
      rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
   }

   // Calculate new X position, then adjust for workarea
   xNew = rParent.left + ((wParent - wChild) /2);
   if (xNew < rWorkArea.left) {
      xNew = rWorkArea.left;
   } else if ((xNew+wChild) > rWorkArea.right) {
      xNew = rWorkArea.right - wChild;
   }

   // Calculate new Y position, then adjust for workarea
   yNew = rParent.top  + ((hParent - hChild) /2);
   if (yNew < rWorkArea.top) {
      yNew = rWorkArea.top;
   } else if ((yNew+hChild) > rWorkArea.bottom) {
      yNew = rWorkArea.bottom - hChild;
   }

   // Set it, and return
   return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}

LPTSTR GetStringRes ( int id )

Definition at line 736 of file Generic.C.

{
  static TCHAR buffer[MAX_PATH];

  buffer[0]=0;
  LoadString (GetModuleHandle (NULL), id, buffer, MAX_PATH);
  return buffer;
}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/appDll/AppMema.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • appDll
Functions

AppMema.c File Reference

#include <windows.h>
#include "appmema.h"
#include "..\pub\appmem.h"

Go to the source code of this file.

Functions

HGLOBAL | GlobalAllocP (UINT fuFlags, DWORD cbBytes)
HGLOBAL | GlobalFreeP (HGLOBAL hglbMem)
HGLOBAL | GlobalReAllocP (HGLOBAL hglbMem, DWORD cbBytes, UINT fuFlags)

Function Documentation

HGLOBAL GlobalAllocP | ( | UINT | fuFlags,
 |  | DWORD | cbBytes
 | ) |  |

Definition at line 27 of file AppMema.c.

{
   HGLOBAL hReturn;
   DWORD   dwSize;

   hReturn = GlobalAlloc(fuFlags, cbBytes);
   if (hReturn != NULL)
   {
      // only collect statistics on successful calls
      if (pAppData != NULL)
      {
         // only update data if data block is valid
         // update call count
         pAppData->dwAllocCalls ++;
         dwSize = (DWORD) GlobalSize(hReturn);
         pAppData->dwApplicationBytes += dwSize;
      }
   }
   return hReturn;
}

HGLOBAL GlobalFreeP ( HGLOBAL hglbMem )

Definition at line 52 of file AppMema.c.

{
   HGLOBAL hReturn;
   DWORD   dwSize;

   // get size of block before freeing it
   dwSize = (DWORD) GlobalSize(hglbMem);
   if (dwSize > 0)
   {
      // size was obtained OK so free the block
      hReturn = GlobalFree(hglbMem);
      if (hReturn == NULL)
      {
         // memory was freed
         if (pAppData != NULL)
         {
            // update call count
            pAppData->dwFreeCalls ++;
            pAppData->dwApplicationBytes -= dwSize;
         }
      }
      else
      {
         // memory was not freed so don't change data
      }
   }
   else
   {
      // unable to read memory size
   }
   return hReturn;
}

HGLOBAL GlobalReAllocP | ( | HGLOBAL | hglbMem,
 |  | DWORD | cbBytes,
 |  | UINT | fuFlags
 | ) |  |

Definition at line 88 of file AppMema.c.

{
   HGLOBAL hReturn;
   DWORD   dwBeforeSize = 0;
   DWORD   dwAfterSize  = 0;

   // get size of block before re-alloc-ing it
   dwBeforeSize = (DWORD) GlobalSize(hglbMem);
   if (dwBeforeSize > 0)
   {
      // size was obtained OK so realloc the block
      hReturn = GlobalReAlloc(hglbMem, cbBytes, fuFlags);
      if (hReturn != NULL)
      {
         // memory was re alloc'd so get the new size
         dwAfterSize = (DWORD) GlobalSize(hReturn);
      }
      else
      {
         // memory was not re-alloced so set after size to 0
      }
      if (pAppData != NULL)
      {
         // update call count
         pAppData->dwReAllocCalls ++;
         pAppData->dwApplicationBytes -= dwBeforeSize;
         pAppData->dwApplicationBytes += dwAfterSize;
      }
   }
   else
   {
      // unable to read memory size nothing has changed
      // return original pointer
      hReturn = hglbMem;
   }
   return hReturn;
}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/appDll/AppMema.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • appDll
Variables

AppMema.h File Reference

#include "..\inc\appmemi.h"

Go to the source code of this file.

Variables

struct _APPMEM_INSTANCE * | pAppData
struct _APPMEM_DATA_HEADER * | pDataHeader

Variable Documentation

struct _APPMEM_INSTANCE* pAppData

Definition at line 24 of file AppMema.h.

struct _APPMEM_DATA_HEADER* pDataHeader

Definition at line 23 of file AppMema.h.

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/appDll/DllInit.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • appDll
Functions | Variables

DllInit.c File Reference

#include <windows.h>
#include "appmema.h"

Go to the source code of this file.

Functions

BOOL __stdcall | DllMain (IN HANDLE DLLHandle, IN DWORD Reason, IN LPVOID ReservedAndUnused)

Variables

HANDLE | hAppMemSharedMemory = NULL
PAPPMEM_INSTANCE | pAppData = NULL
PAPPMEM_DATA_HEADER | pDataHeader = NULL
HANDLE | ThisDLLHandle = NULL

Function Documentation

BOOL __stdcall DllMain | ( | IN HANDLE | DLLHandle,
 |  | IN DWORD | Reason,
 |  | IN LPVOID | ReservedAndUnused
 | ) |  |

Definition at line 324 of file DllInit.c.

{
   ReservedAndUnused;

   switch (Reason)
   {
   case DLL_PROCESS_ATTACH:
      return DllProcessAttach(DLLHandle);

   case DLL_PROCESS_DETACH:
      return DllProcessDetach(DLLHandle);

   case DLL_THREAD_ATTACH:
   case DLL_THREAD_DETACH:
      return TRUE;
   }
   return TRUE;
}

Variable Documentation

HANDLE hAppMemSharedMemory = NULL

Definition at line 48 of file DllInit.c.

PAPPMEM_INSTANCE pAppData = NULL

Definition at line 50 of file DllInit.c.

PAPPMEM_DATA_HEADER pDataHeader = NULL

Definition at line 49 of file DllInit.c.

HANDLE ThisDLLHandle = NULL

Definition at line 47 of file DllInit.c.

Generated on Wed Nov 13 2024 16:53:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/Inc/AppMemi.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • Inc
Classes | Defines | Typedefs | Functions

AppMemi.h File Reference

Go to the source code of this file.

Classes

struct | _APPMEM_DATA_HEADER
struct | _APPMEM_INSTANCE

Defines

#define | APPMEM_INST(base, offset) ((PAPPMEM_INSTANCE)((LPBYTE)(base) + (DWORD)(offset)))
#define | FIRST_FREE(base) ((PAPPMEM_INSTANCE)((LPBYTE)(base) + ((PAPPMEM_DATA_HEADER)(base))->dwFirstFreeOffset))
#define | FIRST_INUSE(base) ((PAPPMEM_INSTANCE)((LPBYTE)(base) + ((PAPPMEM_DATA_HEADER)(base))->dwFirstInUseOffset))
#define | MAX_SIZEOF_INSTANCE_NAME 32
#define | SHARED_MEMORY_ITEM_COUNT 100
#define | SHARED_MEMORY_MUTEX_NAME (TEXT("APPMEM_PERF_DATA_MUTEX"))
#define | SHARED_MEMORY_MUTEX_TIMEOUT ((DWORD)1000L)
#define | SHARED_MEMORY_OBJECT_NAME (TEXT("APPMEM_PERF_DATA"))
#define | SHARED_MEMORY_OBJECT_SIZE (sizeof(PDWORD) + (sizeof(PAPPMEM_INSTANCE) * 2) + (SHARED_MEMORY_ITEM_COUNT * sizeof(APPMEM_INSTANCE)))

Typedefs

typedef struct _APPMEM_DATA_HEADER | APPMEM_DATA_HEADER
typedef struct _APPMEM_INSTANCE | APPMEM_INSTANCE
typedef struct
_APPMEM_DATA_HEADER * 		PAPPMEM_DATA_HEADER
typedef struct _APPMEM_INSTANCE * | PAPPMEM_INSTANCE

Functions

LONG _stdcall | GetSharedMemoryDataHeader (IN HANDLE *phAppMemSharedMemory, IN PAPPMEM_DATA_HEADER *pHeader, IN BOOL bReadOnlyAccess)

Define Documentation

#define APPMEM_INST | ( | base,
 |  | offset |
 | ) |  | ((PAPPMEM_INSTANCE)((LPBYTE)(base) + (DWORD)(offset)))

Definition at line 57 of file AppMemi.h.

#define FIRST_FREE ( base ) ((PAPPMEM_INSTANCE)((LPBYTE)(base) + ((PAPPMEM_DATA_HEADER)(base))->dwFirstFreeOffset))

Definition at line 55 of file AppMemi.h.

#define FIRST_INUSE ( base ) ((PAPPMEM_INSTANCE)((LPBYTE)(base) + ((PAPPMEM_DATA_HEADER)(base))->dwFirstInUseOffset))

Definition at line 56 of file AppMemi.h.

#define MAX_SIZEOF_INSTANCE_NAME 32

Definition at line 24 of file AppMemi.h.

#define SHARED_MEMORY_ITEM_COUNT 100

Definition at line 41 of file AppMemi.h.

#define SHARED_MEMORY_MUTEX_NAME (TEXT("APPMEM_PERF_DATA_MUTEX"))

Definition at line 45 of file AppMemi.h.

#define SHARED_MEMORY_MUTEX_TIMEOUT ((DWORD)1000L)

Definition at line 46 of file AppMemi.h.

#define SHARED_MEMORY_OBJECT_NAME (TEXT("APPMEM_PERF_DATA"))

Definition at line 43 of file AppMemi.h.

#define SHARED_MEMORY_OBJECT_SIZE (sizeof(PDWORD) + (sizeof(PAPPMEM_INSTANCE) * 2) + (SHARED_MEMORY_ITEM_COUNT * sizeof(APPMEM_INSTANCE)))

Definition at line 42 of file AppMemi.h.

Typedef Documentation

typedef struct _APPMEM_DATA_HEADER APPMEM_DATA_HEADER
typedef struct _APPMEM_INSTANCE APPMEM_INSTANCE
typedef struct _APPMEM_DATA_HEADER * PAPPMEM_DATA_HEADER
typedef struct _APPMEM_INSTANCE * PAPPMEM_INSTANCE

Function Documentation

LONG _stdcall GetSharedMemoryDataHeader | ( | IN HANDLE * | phAppMemSharedMemory,
 |  | IN PAPPMEM_DATA_HEADER * | pHeader,
 |  | IN BOOL | bReadOnlyAccess
 | ) |  |

Definition at line 26 of file ShareMem.c.

{
   LONG             Status, MemStatus;
   TCHAR            szMappedObject[] = SHARED_MEMORY_OBJECT_NAME;
   PAPPMEM_INSTANCE pLastItem;
   PAPPMEM_INSTANCE pAppData;
   DWORD            dwInstance;

   SetLastError(ERROR_SUCCESS);   // just to clear it out

   * phAppMemSharedMemory = CreateFileMapping(
                                              (HANDLE) INVALID_HANDLE_VALUE,
                                              NULL,                      // no security
                                              PAGE_READWRITE,            // to allow read & write access
                                              0,
                                              SHARED_MEMORY_OBJECT_SIZE, // file size
                                              szMappedObject);           // object name

   MemStatus = GetLastError();    // to see if this is the first opening

   // return error if unsuccessful
   if (* phAppMemSharedMemory == NULL)
   {
      Status = APPMEM_OPEN_FILE_MAPPING_ERROR;
      // this is fatal, if we can't get data then there's no
      // point in continuing.
   }
   else
   {
      if (MemStatus != ERROR_ALREADY_EXISTS)
      {
         // this is the first access to the file so initialize the
         // instance count
         * pHeader = (PAPPMEM_DATA_HEADER) MapViewOfFile(
                                                      * phAppMemSharedMemory,  // shared mem handle
                                                      FILE_MAP_WRITE,          // access desired
                                                      0,                       // starting offset
                                                      0,
                                                      0);                      // map the entire object
         if (* pHeader != NULL)
         {
            // if here, then pdwInstanceCount should be valid
            // so initialize the shared memory structure
            // clear memory block
            memset(* pHeader, 0, SHARED_MEMORY_OBJECT_SIZE);

            // initialize application data header
            (* pHeader)->dwInstanceCount    = 0;    // no instances
            (* pHeader)->dwFirstInUseOffset = 0;    // no busy items yet
            (* pHeader)->dwFirstFreeOffset  = (DWORD) ((LPBYTE) & (* pHeader)[1] - (LPBYTE) * pHeader);

            pLastItem = FIRST_FREE((* pHeader));

            // set pointers in each item of block
            pAppData = pLastItem + 1;
            for (dwInstance = (SHARED_MEMORY_ITEM_COUNT - 1); dwInstance > 0; dwInstance --)
            {
               pLastItem->dwOffsetOfNext = (DWORD)((LPBYTE) pAppData - (LPBYTE)(* pHeader));
               pLastItem = pAppData;
               pAppData ++;
            }
            pAppData->dwOffsetOfNext = 0; // end of list
            Status = ERROR_SUCCESS;
         }
         else
         {
            Status = APPMEM_UNABLE_MAP_VIEW_OF_FILE;
         }
      }
      else
      {
         // the status is ERROR_ALREADY_EXISTS which is successful
         Status = ERROR_SUCCESS;
      }
      // see if Read Only access is required
      if (Status == ERROR_SUCCESS)
      {
         // by now the shared memory has already been initialized so
         // we if we don't need write access any more or if it has
         // already been opened, then open with the desired access
         * pHeader = (PAPPMEM_DATA_HEADER) MapViewOfFile(
                         * phAppMemSharedMemory,                             // shared mem handle
                         (bReadOnlyAccess ? FILE_MAP_READ : FILE_MAP_WRITE), // access desired
                         0,                                                  // starting offset
                         0,
                         0);                                                 // map the entire object
         if (* pHeader == NULL)
         {
            Status = APPMEM_UNABLE_MAP_VIEW_OF_FILE;
            // this is fatal, if we can't get data then there's no
            // point in continuing.
         }
         else
         {
            Status = ERROR_SUCCESS;
         }
      }
   }
   return Status;
}

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/DataMem.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll
Variables

DataMem.c File Reference

#include <windows.h>
#include <winperf.h>
#include "..\pub\memctrnm.h"
#include "datamem.h"

Go to the source code of this file.

Variables

APPMEM_DATA_DEFINITION AppMemDataDefinition

Variable Documentation

APPMEM_DATA_DEFINITION AppMemDataDefinition

Definition at line 39 of file DataMem.c.

Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/DataMem.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll
Classes | Defines | Typedefs

DataMem.h File Reference

Go to the source code of this file.

Classes

struct | _APPMEM_COUNTERS
struct | _APPMEM_DATA_DEFINITION

Defines

#define | APP_MEM_NUM_PERF_OBJECT_TYPES 1

Typedefs

typedef struct _APPMEM_COUNTERS | APPMEM_COUNTERS
typedef struct
_APPMEM_DATA_DEFINITION 		APPMEM_DATA_DEFINITION
typedef struct _APPMEM_COUNTERS * | PAPPMEM_COUNTERS

Define Documentation

#define APP_MEM_NUM_PERF_OBJECT_TYPES 1

Definition at line 44 of file DataMem.h.

Typedef Documentation

typedef struct _APPMEM_COUNTERS APPMEM_COUNTERS
typedef struct _APPMEM_DATA_DEFINITION APPMEM_DATA_DEFINITION
typedef struct _APPMEM_COUNTERS * PAPPMEM_COUNTERS
Generated on Wed Nov 13 2024 16:55:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/Perfmem.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll
Functions | Variables

Perfmem.c File Reference

#include <windows.h>
#include <string.h>
#include <winperf.h>
#include "..\inc\appmemi.h"
#include "memctrs.h"
#include "perfmsg.h"
#include "perfutil.h"
#include "datamem.h"

Go to the source code of this file.

Functions

DWORD APIENTRY | CloseAppMemPerformanceData ()
DWORD APIENTRY | CollectAppMemPerformanceData (IN LPWSTR lpValueName, IN OUT LPVOID *lppData, IN OUT LPDWORD lpcbTotalBytes, IN OUT LPDWORD lpNumObjectTypes)
DWORD APIENTRY | OpenAppMemPerformanceData (LPWSTR lpDeviceNames)

Variables

APPMEM_DATA_DEFINITION AppMemDataDefinition
PM_CLOSE_PROC | CloseAppMemPerformanceData
PM_COLLECT_PROC | CollectAppMemPerformanceData
PM_OPEN_PROC | OpenAppMemPerformanceData

Function Documentation

DWORD APIENTRY CloseAppMemPerformanceData ( )

Definition at line 419 of file Perfmem.c.

                   :

    This routine closes the open handles to Application Memory
        usage performance counters

Arguments:

    None.

Return Value:

    ERROR_SUCCESS

--*/
{
   if ((-- dwOpenCount) == 0)
   { // when this is the last thread...
      if (hAppMemSharedMemory != NULL) CloseHandle(hAppMemSharedMemory);
      pDataHeader = NULL;
      MonCloseEventLog();
   }

   return ERROR_SUCCESS;

}

DWORD APIENTRY CollectAppMemPerformanceData | ( | IN LPWSTR | lpValueName,
 |  | IN OUT LPVOID * | lppData,
 |  | IN OUT LPDWORD | lpcbTotalBytes,
 |  | IN OUT LPDWORD | lpNumObjectTypes
 | ) |  |

Definition at line 227 of file Perfmem.c.

                   :

    This routine will return the data for the Application memory counters

Arguments:

   IN       LPWSTR   lpValueName
            pointer to a wide character string passed by registry.

   IN OUT   LPVOID   *lppData
         IN: pointer to the address of the buffer to receive the completed
            PerfDataBlock and subordinate structures. This routine will
            append its data to the buffer starting at the point referenced
            by *lppData.
         OUT: points to the first byte after the data structure added by this
            routine. This routine updated the value at lppdata after appending
            its data.

   IN OUT   LPDWORD  lpcbTotalBytes
         IN: the address of the DWORD that tells the size in bytes of the
            buffer referenced by the lppData argument
         OUT: the number of bytes added by this routine is writted to the
            DWORD pointed to by this argument

   IN OUT   LPDWORD  NumObjectTypes
         IN: the address of the DWORD to receive the number of objects added
            by this routine
         OUT: the number of objects added by this routine is writted to the
            DWORD pointed to by this argument

Return Value:

      ERROR_MORE_DATA if buffer passed is too small to hold data
         any error conditions encountered are reported to the event log if
         event logging is enabled.

      ERROR_SUCCESS  if success or any other error. Errors, however are
         also reported to the event log.

--*/
{
   //  Variables for reformating the data

   ULONG                       SpaceNeeded;
   PERF_INSTANCE_DEFINITION  * pPerfInstanceDef;
   APPMEM_DATA_DEFINITION    * pAppMemDataDefinition;
   DWORD                       dwQueryType;
   DWORD                       dwInstanceIndex;
   PAPPMEM_INSTANCE            pThisAppInstanceData = NULL;
   PAPPMEM_COUNTERS            pAC;

   //
   // before doing anything else, see if Open went OK
   //
   if ((!bInitOK) || (pDataHeader == NULL))
   {
      // unable to continue because open failed.
      * lpcbTotalBytes   = (DWORD) 0;
      * lpNumObjectTypes = (DWORD) 0;
      return ERROR_SUCCESS; // yes, this is a successful exit
   }

   // see if this is a foreign (i.e. non-NT) computer data request
   //
   dwQueryType = GetQueryType(lpValueName);
   if (dwQueryType == QUERY_FOREIGN)
   {
      // this routine does not service requests for data from
      // Non-NT computers
      * lpcbTotalBytes   = (DWORD) 0;
      * lpNumObjectTypes = (DWORD) 0;
      return ERROR_SUCCESS;
   }

   if (dwQueryType == QUERY_ITEMS)
   {
      if (! (IsNumberInUnicodeList (AppMemDataDefinition.AppMemObjectType.ObjectNameTitleIndex, lpValueName)))
      {
         // request received for data object not provided by this routine
         * lpcbTotalBytes   = (DWORD) 0;
         * lpNumObjectTypes = (DWORD) 0;
         return ERROR_SUCCESS;
      }
   }

   // if here, then this must be one for us so load data structures

   pAppMemDataDefinition = (APPMEM_DATA_DEFINITION *) *lppData;

   // always return an "instance sized" buffer after the definition blocks
   // to prevent perfmon from reading bogus data. This is strictly a hack
   // to accomodate how PERFMON handles the "0" instance case.
   //  By doing this, perfmon won't choke when there are no instances
   //  and the counter object & counters will be displayed in the
   //  list boxes, even though no instances will be listed.

   SpaceNeeded = sizeof(APPMEM_DATA_DEFINITION) +
                 ((pDataHeader->dwInstanceCount > 0 ? pDataHeader->dwInstanceCount : 1) * (
                         sizeof(PERF_INSTANCE_DEFINITION) + MAX_SIZEOF_INSTANCE_NAME + sizeof(APPMEM_COUNTERS)));

   if (* lpcbTotalBytes < SpaceNeeded)
   {
      // not enough room so return nothing.
      * lpcbTotalBytes   = (DWORD) 0;
      * lpNumObjectTypes = (DWORD) 0;
      return ERROR_MORE_DATA;
   }

   // copy the object & counter definition information

   memmove(pAppMemDataDefinition, & AppMemDataDefinition, sizeof(APPMEM_DATA_DEFINITION));

   // prepare to read the instance data
   pPerfInstanceDef = (PERF_INSTANCE_DEFINITION *) & pAppMemDataDefinition[1];

   // point to the first instance structure in the shared buffer
   pThisAppInstanceData = FIRST_INUSE(pDataHeader);

   // process each of the instances in the shared memory buffer
   dwInstanceIndex = 0;
   while ((dwInstanceIndex < pDataHeader->dwInstanceCount) && (pThisAppInstanceData != NULL))
   {
      // initialize this instance
      MonBuildInstanceDefinition(
                                pPerfInstanceDef,
                                & pAC, // pointer to first byte after instance def
                                0,     // no parent
                                0,     //  object to reference
                                (DWORD) PERF_NO_UNIQUE_ID,
                                pThisAppInstanceData->wcszInstanceName);
      //
      //    collect and format app memory perf data from shared memory
      //

      pAC->CounterBlock.ByteLength = sizeof(APPMEM_COUNTERS);

      // set pointer to first counter data field

      pAC->dwAppMemBytesAllocated = pThisAppInstanceData->dwApplicationBytes;
      pAC->dwAppMemAllocs = pThisAppInstanceData->dwAllocCalls;
      pAC->dwAppMemAllocsSec = pThisAppInstanceData->dwAllocCalls;
      pAC->dwAppMemReAllocs = pThisAppInstanceData->dwReAllocCalls;
      pAC->dwAppMemReAllocsSec = pThisAppInstanceData->dwReAllocCalls;
      pAC->dwAppMemFrees = pThisAppInstanceData->dwFreeCalls;
      pAC->dwAppMemFreesSec = pThisAppInstanceData->dwFreeCalls;

      // setup for the next instance
      dwInstanceIndex++;
      pThisAppInstanceData =
      APPMEM_INST(pDataHeader, pThisAppInstanceData->dwOffsetOfNext);
      pPerfInstanceDef =
      (PERF_INSTANCE_DEFINITION *)((LPBYTE)pAC + sizeof(APPMEM_COUNTERS));
   }

   if (dwInstanceIndex == 0)
   {
      // zero fill one instance sized block of data if there are no
      // data instances

      memset(pPerfInstanceDef, 0,
              (sizeof(PERF_INSTANCE_DEFINITION) + MAX_SIZEOF_INSTANCE_NAME + sizeof(APPMEM_COUNTERS)));

      // adjust pointer to point to end of zeroed block
      (BYTE *) pPerfInstanceDef += (sizeof(PERF_INSTANCE_DEFINITION)
                                 + MAX_SIZEOF_INSTANCE_NAME + sizeof(APPMEM_COUNTERS));
   }

   // done with the shared memory so free the mutex if one was
   // acquired

   * lppData = (PVOID) pPerfInstanceDef;

   // update arguments for return

   * lpNumObjectTypes = 1;
   pAppMemDataDefinition->AppMemObjectType.NumInstances = dwInstanceIndex;

   pAppMemDataDefinition->AppMemObjectType.TotalByteLength =
   * lpcbTotalBytes = (DWORD)((PBYTE) pPerfInstanceDef - (PBYTE) pAppMemDataDefinition);

   return ERROR_SUCCESS;
}

DWORD APIENTRY OpenAppMemPerformanceData ( LPWSTR lpDeviceNames )

Definition at line 59 of file Perfmem.c.

                   :

    This routine will open and map the memory used by the App Mem DLL to
    pass performance data in. This routine also initializes the data
    structures used to pass data back to the registry

Arguments:

    Pointer to object ID of each device to be opened

Return Value:

    None.

--*/

{
   LONG  status;
   HKEY  hKeyDriverPerf = NULL;
   DWORD size;
   DWORD type;
   DWORD dwFirstCounter;
   DWORD dwFirstHelp;
   APPMEM_COUNTERS     ac;

   //
   //  Since REGSVC is multi-threaded and will call this routine in
   //  order to service remote performance queries, this library
   //  must keep track of how many times it has been opened (i.e.
   //  how many threads have accessed it). the registry routines will
   //  limit access to the initialization routine to only one thread
   //  at a time so synchronization (i.e. reentrancy) should not be
   //  a problem
   //

   if (dwOpenCount == 0)
   { // do this only on the first instance of the DLL
      // open Eventlog interface

      hEventLog = MonOpenEventLog();

      // open/create shared memory used by the application to pass performance values
      status = GetSharedMemoryDataHeader(
                                        & hAppMemSharedMemory, & pDataHeader,
                                        TRUE); // only read access is required
      if (status != ERROR_SUCCESS)
      {
         REPORT_ERROR_DATA (status, LOG_USER, NULL, 0);
         goto OpenExitPoint;
      }

      // get counter and help index base values from registry
      //      Open key to registry entry
      //      read First Counter and First Help values
      //      update static data strucutures by adding base to
      //          offset value in structure.

      status = RegOpenKeyEx(
                           HKEY_LOCAL_MACHINE,
                           "SYSTEM\\CurrentControlSet\\Services\\AppMem\\Performance",
                           0L,
                           KEY_READ,
                           & hKeyDriverPerf);
      if (status != ERROR_SUCCESS)
      {
         REPORT_ERROR_DATA(APPMEM_UNABLE_OPEN_DRIVER_KEY, LOG_USER, & status, sizeof(status));
         // this is fatal, if we can't get the base values of the
         // counter or help names, then the names won't be available
         // to the requesting application  so there's not much
         // point in continuing.
         goto OpenExitPoint;
      }

      size   = sizeof(DWORD);
      status = RegQueryValueEx(
                              hKeyDriverPerf,
                              "First Counter",
                              0L,
                              & type,
                              (LPBYTE) & dwFirstCounter,
                              & size);
      if (status != ERROR_SUCCESS)
      {
         REPORT_ERROR_DATA(APPMEM_UNABLE_READ_FIRST_COUNTER, LOG_USER, & status, sizeof(status));
         // this is fatal, if we can't get the base values of the
         // counter or help names, then the names won't be available
         // to the requesting application  so there's not much
         // point in continuing.
         goto OpenExitPoint;
      }

      size   = sizeof(DWORD);
      status = RegQueryValueEx(
                              hKeyDriverPerf,
                              "First Help",
                              0L,
                              & type,
                              (LPBYTE) & dwFirstHelp,
                              & size);
      if (status != ERROR_SUCCESS)
      {
         REPORT_ERROR_DATA(APPMEM_UNABLE_READ_FIRST_HELP, LOG_USER, & status, sizeof(status));
         // this is fatal, if we can't get the base values of the
         // counter or help names, then the names won't be available
         // to the requesting application  so there's not much
         // point in continuing.
         goto OpenExitPoint;
      }

      //
      //  NOTE: the initialization program could also retrieve
      //      LastCounter and LastHelp if they wanted to do
      //      bounds checking on the new number. e.g.
      //
      //      counter->CounterNameTitleIndex += dwFirstCounter;
      //      if (counter->CounterNameTitleIndex > dwLastCounter) {
      //          LogErrorToEventLog (INDEX_OUT_OF_BOUNDS);
      //      }

      AppMemDataDefinition.AppMemObjectType.ObjectNameTitleIndex      += dwFirstCounter;
      AppMemDataDefinition.AppMemObjectType.ObjectHelpTitleIndex      += dwFirstHelp;
      AppMemDataDefinition.AppMemBytesAllocated.CounterNameTitleIndex += dwFirstCounter;
      AppMemDataDefinition.AppMemBytesAllocated.CounterHelpTitleIndex += dwFirstHelp;
      AppMemDataDefinition.AppMemBytesAllocated.CounterOffset         +=
                                      (DWORD) ((LPBYTE) & ac.dwAppMemBytesAllocated - (LPBYTE) & ac);
      AppMemDataDefinition.AppMemAllocs.CounterNameTitleIndex         += dwFirstCounter;
      AppMemDataDefinition.AppMemAllocs.CounterHelpTitleIndex         += dwFirstHelp;
      AppMemDataDefinition.AppMemAllocs.CounterOffset                  =
                                      (DWORD) ((LPBYTE) & ac.dwAppMemAllocs - (LPBYTE) & ac);
      AppMemDataDefinition.AppMemAllocsSec.CounterNameTitleIndex      += dwFirstCounter;
      AppMemDataDefinition.AppMemAllocsSec.CounterHelpTitleIndex      += dwFirstHelp;
      AppMemDataDefinition.AppMemAllocsSec.CounterOffset               =
                                      (DWORD) ((LPBYTE) & ac.dwAppMemAllocsSec - (LPBYTE) & ac);
      AppMemDataDefinition.AppMemReAllocs.CounterNameTitleIndex       += dwFirstCounter;
      AppMemDataDefinition.AppMemReAllocs.CounterHelpTitleIndex       += dwFirstCounter;
      AppMemDataDefinition.AppMemReAllocs.CounterOffset                =
                                      (DWORD) ((LPBYTE) & ac.dwAppMemReAllocs - (LPBYTE) & ac);
      AppMemDataDefinition.AppMemReAllocsSec.CounterNameTitleIndex    += dwFirstCounter;
      AppMemDataDefinition.AppMemReAllocsSec.CounterHelpTitleIndex    += dwFirstHelp;
      AppMemDataDefinition.AppMemReAllocsSec.CounterOffset             =
                                      (DWORD) ((LPBYTE) & ac.dwAppMemReAllocsSec - (LPBYTE) & ac);
      AppMemDataDefinition.AppMemFrees.CounterNameTitleIndex          += dwFirstCounter;
      AppMemDataDefinition.AppMemFrees.CounterHelpTitleIndex          += dwFirstHelp;
      AppMemDataDefinition.AppMemFrees.CounterOffset                   =
                                      (DWORD) ((LPBYTE) & ac.dwAppMemFrees - (LPBYTE) & ac);
      AppMemDataDefinition.AppMemFreesSec.CounterNameTitleIndex       += dwFirstCounter;
      AppMemDataDefinition.AppMemFreesSec.CounterHelpTitleIndex       += dwFirstHelp;
      AppMemDataDefinition.AppMemFreesSec.CounterOffset                =
                                      (DWORD) ((LPBYTE) & ac.dwAppMemFreesSec - (LPBYTE) & ac);

      bInitOK = TRUE; // ok to use this function
   }

   dwOpenCount ++;         // increment OPEN counter
   status = ERROR_SUCCESS; // for successful exit

OpenExitPoint:
   if (hKeyDriverPerf != NULL) RegCloseKey(hKeyDriverPerf); // close key to registry

   return status;
}

Variable Documentation

APPMEM_DATA_DEFINITION AppMemDataDefinition

Definition at line 39 of file DataMem.c.

PM_CLOSE_PROC CloseAppMemPerformanceData

Definition at line 56 of file Perfmem.c.

PM_COLLECT_PROC CollectAppMemPerformanceData

Definition at line 55 of file Perfmem.c.

PM_OPEN_PROC OpenAppMemPerformanceData

Definition at line 54 of file Perfmem.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/Perfmsg.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll
Defines | Variables

Perfmsg.h File Reference

Go to the source code of this file.

Defines

#define | APP_NAME "appmemry"
#define | LOG_DEBUG 2
#define | LOG_NONE 0
#define | LOG_USER 1
#define | LOG_VERBOSE 3
#define | MESSAGE_LEVEL_DEFAULT LOG_USER
#define | REPORT_ERROR(i, l)
#define | REPORT_ERROR_DATA(i, l, d, s)
#define | REPORT_INFORMATION(i, l)
#define | REPORT_INFORMATION_DATA(i, l, d, s)
#define | REPORT_SUCCESS(i, l)
#define | REPORT_WARNING(i, l)
#define | REPORT_WARNING_DATA(i, l, d, s)

Variables

DWORD dwLogUsers
HANDLE hEventLog
DWORD MESSAGE_LEVEL

Define Documentation

#define APP_NAME "appmemry"

Definition at line 26 of file Perfmsg.h.

#define LOG_DEBUG 2

Definition at line 45 of file Perfmsg.h.

#define LOG_NONE 0

Definition at line 43 of file Perfmsg.h.

#define LOG_USER 1

Definition at line 44 of file Perfmsg.h.

#define LOG_VERBOSE 3

Definition at line 46 of file Perfmsg.h.

#define MESSAGE_LEVEL_DEFAULT LOG_USER

Definition at line 48 of file Perfmsg.h.

#define REPORT_ERROR | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 85 of file Perfmsg.h.

#define REPORT_ERROR_DATA | ( | i,
 |  | l,
 |  | d,
 |  | s
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
   0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)

Definition at line 94 of file Perfmsg.h.

#define REPORT_INFORMATION | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 79 of file Perfmsg.h.

#define REPORT_INFORMATION_DATA | ( | i,
 |  | l,
 |  | d,
 |  | s
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
   0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)

Definition at line 88 of file Perfmsg.h.

#define REPORT_SUCCESS | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 76 of file Perfmsg.h.

#define REPORT_WARNING | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 82 of file Perfmsg.h.

#define REPORT_WARNING_DATA | ( | i,
 |  | l,
 |  | d,
 |  | s
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
   0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)

Definition at line 91 of file Perfmsg.h.

Variable Documentation

DWORD dwLogUsers

Definition at line 41 of file PerfUtil.c.

HANDLE hEventLog

Definition at line 40 of file PerfUtil.c.

DWORD MESSAGE_LEVEL

Definition at line 42 of file PerfUtil.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/PerfUtil.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll
Defines | Functions | Variables

PerfUtil.c File Reference

#include <windows.h>
#include <string.h>
#include <winperf.h>
#include "memctrs.h"
#include "perfmsg.h"
#include "perfutil.h"

Go to the source code of this file.

Defines

#define | DELIMITER 2
#define | DIGIT 1
#define | EvalThisChar(c, d)
#define | EXTEND_SIZE 1024L
#define | INITIAL_SIZE 1024L
#define | INVALID 3

Functions

DWORD | GetQueryType (IN LPWSTR lpValue)
BOOL | IsNumberInUnicodeList (IN DWORD dwNumber, IN LPWSTR lpwszUnicodeList)
BOOL | MonBuildInstanceDefinition (PERF_INSTANCE_DEFINITION *pBuffer, PVOID *pBufferNext, DWORD ParentObjectTitleIndex, DWORD ParentObjectInstance, DWORD UniqueID, LPWSTR Name)
VOID | MonCloseEventLog ()
HANDLE MonOpenEventLog ()

Variables

WCHAR | COSTLY_STRING [] = "Costly"
DWORD | dwLogUsers = 0
WCHAR | FOREIGN_STRING [] = "Foreign"
WCHAR | GLOBAL_STRING [] = "Global"
HANDLE | hEventLog = NULL
DWORD | MESSAGE_LEVEL = 0
WCHAR | NULL_STRING [] = "\0"
ULONG | ulInfoBufferSize = 0

Define Documentation

#define DELIMITER 2

Definition at line 52 of file PerfUtil.c.

#define DIGIT 1

Definition at line 51 of file PerfUtil.c.

#define EvalThisChar | ( | c,
 |  | d
 | ) |
Value:
( \
     (c == d) ? DELIMITER : \
     (c == 0) ? DELIMITER : \
     (c < (WCHAR)'0') ? INVALID : \
     (c > (WCHAR)'9') ? INVALID : \
     DIGIT)

Definition at line 55 of file PerfUtil.c.

#define EXTEND_SIZE 1024L

Definition at line 33 of file PerfUtil.c.

#define INITIAL_SIZE 1024L

Definition at line 32 of file PerfUtil.c.

#define INVALID 3

Definition at line 53 of file PerfUtil.c.

Function Documentation

DWORD GetQueryType ( IN LPWSTR lpValue )

Definition at line 239 of file PerfUtil.c.

             :

    QUERY_ITEMS

--*/
{
   WCHAR   *pwcArgChar, *pwcTypeChar;
   BOOL    bFound;

   if (lpValue == 0)
   {
      return QUERY_GLOBAL;
   }
   else if (* lpValue == 0)
   {
      return QUERY_GLOBAL;
   }

   // check for "Global" request

   pwcArgChar  = lpValue;
   pwcTypeChar = GLOBAL_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_GLOBAL;

   // check for "Foreign" request

   pwcArgChar  = lpValue;
   pwcTypeChar = FOREIGN_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_FOREIGN;

   // check for "Costly" request

   pwcArgChar  = lpValue;
   pwcTypeChar = COSTLY_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_COSTLY;

   // if not Global and not Foreign and not Costly,
   // then it must be an item list

   return QUERY_ITEMS;
}

BOOL IsNumberInUnicodeList | ( | IN DWORD | dwNumber,
 |  | IN LPWSTR | lpwszUnicodeList
 | ) |  |

Definition at line 349 of file PerfUtil.c.

         :

    IN dwNumber
        DWORD number to find in list

    IN lpwszUnicodeList
        Null terminated, Space delimited list of decimal numbers

Return Value:

    TRUE:
            dwNumber was found in the list of unicode number strings

    FALSE:
            dwNumber was not found in the list.

--*/
{
   DWORD   dwThisNumber;
   WCHAR * pwcThisChar;
   BOOL    bValidNumber;
   BOOL    bNewItem;
   WCHAR   wcDelimiter;    // could be an argument to be more flexible

   if (lpwszUnicodeList == 0) return FALSE;    // null pointer, # not founde

   pwcThisChar  = lpwszUnicodeList;
   dwThisNumber = 0;
   wcDelimiter  = (WCHAR)' ';
   bValidNumber = FALSE;
   bNewItem     = TRUE;

   while (TRUE)
   {
      switch (EvalThisChar(* pwcThisChar, wcDelimiter))
      {
      case DIGIT:
         // if this is the first digit after a delimiter, then
         // set flags to start computing the new number
         if (bNewItem)
         {
            bNewItem     = FALSE;
            bValidNumber = TRUE;
         }
         if (bValidNumber)
         {
            dwThisNumber *= 10;
            dwThisNumber += (* pwcThisChar - (WCHAR) '0');
         }
         break;

      case DELIMITER:
         // a delimter is either the delimiter character or the
         // end of the string ('\0') if when the delimiter has been
         // reached a valid number was found, then compare it to the
         // number from the argument list. if this is the end of the
         // string and no match was found, then return.
         //
         if (bValidNumber)
         {
            if (dwThisNumber == dwNumber) return TRUE;
            bValidNumber = FALSE;
         }
         if (* pwcThisChar == 0)
         {
            return FALSE;
         }
         else
         {
            bNewItem     = TRUE;
            dwThisNumber = 0;
         }
         break;

      case INVALID:
         // if an invalid character was encountered, ignore all
         // characters up to the next delimiter and then start fresh.
         // the invalid number is not compared.
         bValidNumber = FALSE;
         break;

      default:
         break;

      }
      pwcThisChar ++;
   }
}   // IsNumberInUnicodeList

BOOL MonBuildInstanceDefinition | ( | PERF_INSTANCE_DEFINITION * | pBuffer,
 |  | PVOID * | pBufferNext,
 |  | DWORD | ParentObjectTitleIndex,
 |  | DWORD | ParentObjectInstance,
 |  | DWORD | UniqueID,
 |  | LPWSTR | Name
 | ) |  |

Definition at line 63 of file PerfUtil.c.

              :

            pBuffer         -   pointer to buffer where instance is to
                                be constructed

            pBufferNext     -   pointer to a pointer which will contain
                                next available location, DWORD aligned

            ParentObjectTitleIndex
                            -   Title Index of parent object type; 0 if
                                no parent object

            ParentObjectInstance
                            -   Index into instances of parent object
                                type, starting at 0, for this instances
                                parent object instance

            UniqueID        -   a unique identifier which should be used
                                instead of the Name for identifying
                                this instance

            Name            -   Name of this instance
--*/
{
   DWORD NameLength = 0;
   WCHAR * pName;

   //
   //  Include trailing null in name size
   //

   NameLength = lstrlenW(Name) * sizeof(WCHAR);
   if (NameLength > 0)
   {
      NameLength += sizeof(WCHAR); // to include the terminating NULL
   }

   pBuffer->ByteLength             = sizeof(PERF_INSTANCE_DEFINITION) + DWORD_MULTIPLE(NameLength);
   pBuffer->ParentObjectTitleIndex = ParentObjectTitleIndex;
   pBuffer->ParentObjectInstance   = ParentObjectInstance;
   pBuffer->UniqueID               = UniqueID;
   pBuffer->NameOffset             = sizeof(PERF_INSTANCE_DEFINITION);
   pBuffer->NameLength             = NameLength;
   pName = (PWCHAR) & pBuffer[1];
   lstrcpynW(pName, Name, lstrlenW(Name) + 1);

   * pBufferNext = (PVOID) ((PCHAR) pBuffer + pBuffer->ByteLength);
   return TRUE;
}

VOID MonCloseEventLog ( )

Definition at line 209 of file PerfUtil.c.

                   :

      Closes the handle to the event logger if this is the last caller

Arguments:

      None

Return Value:

      None

--*/
{
   if (hEventLog != NULL)
   {
      dwLogUsers --;         // decrement usage
      if (dwLogUsers <= 0)
      {    // and if we're the last, then close up log
         REPORT_INFORMATION(UTIL_CLOSING_LOG, LOG_DEBUG);
         DeregisterEventSource(hEventLog);
      }
   }
}

HANDLE MonOpenEventLog ( )

Definition at line 126 of file PerfUtil.c.

                   :

    Reads the level of event logging from the registry and opens the
        channel to the event logger for subsequent event log entries.

Arguments:

      None

Return Value:

    Handle to the event log for reporting events.
    NULL if open not successful.

--*/
{
   HKEY  hAppKey;
   CHAR  LogLevelKeyName[]   = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib";
   CHAR  LogLevelValueName[] = "EventLogLevel";
   LONG  lStatus;
   DWORD dwLogLevel;
   DWORD dwValueType;
   DWORD dwValueSize;

   // if global value of the logging level not initialized or is disabled,
   //  check the registry to see if it should be updated.

   if (! MESSAGE_LEVEL)
   {

      lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
                             LogLevelKeyName,
                             0,
                             KEY_READ,
                             & hAppKey);
      if (lStatus == ERROR_SUCCESS)
      {
         dwValueSize = sizeof(dwLogLevel);
         lStatus = RegQueryValueEx(hAppKey,
                                   LogLevelValueName,
                                   (LPDWORD) NULL,
                                   & dwValueType,
                                   (LPBYTE) & dwLogLevel,
                                   & dwValueSize);
         if (lStatus == ERROR_SUCCESS)
         {
            MESSAGE_LEVEL = dwLogLevel;
         }
         else
         {
            MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
         }
         RegCloseKey(hAppKey);
      }
      else
      {
         MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
      }
   }

   if (hEventLog == NULL)
   {
      hEventLog = RegisterEventSource(
                                     (LPTSTR) NULL, // Use Local Machine
                                     APP_NAME);     // event log app name to find in registry
      if (hEventLog != NULL)
      {
         REPORT_INFORMATION(UTIL_LOG_OPEN, LOG_DEBUG);
      }
   }

   if (hEventLog != NULL)
   {
      dwLogUsers ++; // increment count of perfctr log users
   }
   return (hEventLog);
}

Variable Documentation

WCHAR COSTLY_STRING[] = "Costly"

Definition at line 45 of file PerfUtil.c.

DWORD dwLogUsers = 0

Definition at line 41 of file PerfUtil.c.

WCHAR FOREIGN_STRING[] = "Foreign"

Definition at line 44 of file PerfUtil.c.

WCHAR GLOBAL_STRING[] = "Global"

Definition at line 43 of file PerfUtil.c.

HANDLE hEventLog = NULL

Definition at line 40 of file PerfUtil.c.

DWORD MESSAGE_LEVEL = 0

Definition at line 42 of file PerfUtil.c.

WCHAR NULL_STRING[] = "\0"

Definition at line 46 of file PerfUtil.c.

ULONG ulInfoBufferSize = 0

Definition at line 39 of file PerfUtil.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/PerfUtil.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll
Defines | Functions | Variables

PerfUtil.h File Reference

Go to the source code of this file.

Defines

#define | ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))
#define | DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))
#define | QUERY_COSTLY 4
#define | QUERY_FOREIGN 3
#define | QUERY_GLOBAL 1
#define | QUERY_ITEMS 2

Functions

DWORD | GetQueryType (IN LPWSTR)
BOOL | IsNumberInUnicodeList (DWORD, LPWSTR)
BOOL | MonBuildInstanceDefinition (PERF_INSTANCE_DEFINITION *pBuffer, PVOID *pBufferNext, DWORD ParentObjectTitleIndex, DWORD ParentObjectInstance, DWORD UniqueID, LPWSTR Name)
VOID | MonCloseEventLog ()
HANDLE MonOpenEventLog ()

Variables

WCHAR | COSTLY_STRING []
WCHAR | FOREIGN_STRING []
WCHAR | GLOBAL_STRING []
WCHAR | NULL_STRING []

Define Documentation

#define ALIGN_ON_DWORD ( x ) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))

Definition at line 35 of file PerfUtil.h.

#define DWORD_MULTIPLE ( x ) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))

Definition at line 32 of file PerfUtil.h.

#define QUERY_COSTLY 4

Definition at line 45 of file PerfUtil.h.

#define QUERY_FOREIGN 3

Definition at line 44 of file PerfUtil.h.

#define QUERY_GLOBAL 1

Definition at line 42 of file PerfUtil.h.

#define QUERY_ITEMS 2

Definition at line 43 of file PerfUtil.h.

Function Documentation

DWORD GetQueryType ( IN LPWSTR )

Definition at line 239 of file PerfUtil.c.

             :

    QUERY_ITEMS

--*/
{
   WCHAR   *pwcArgChar, *pwcTypeChar;
   BOOL    bFound;

   if (lpValue == 0)
   {
      return QUERY_GLOBAL;
   }
   else if (* lpValue == 0)
   {
      return QUERY_GLOBAL;
   }

   // check for "Global" request

   pwcArgChar  = lpValue;
   pwcTypeChar = GLOBAL_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_GLOBAL;

   // check for "Foreign" request

   pwcArgChar  = lpValue;
   pwcTypeChar = FOREIGN_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_FOREIGN;

   // check for "Costly" request

   pwcArgChar  = lpValue;
   pwcTypeChar = COSTLY_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_COSTLY;

   // if not Global and not Foreign and not Costly,
   // then it must be an item list

   return QUERY_ITEMS;
}

BOOL IsNumberInUnicodeList | ( | DWORD | ,
 |  | LPWSTR |
 | ) |  |
BOOL MonBuildInstanceDefinition | ( | PERF_INSTANCE_DEFINITION * | pBuffer,
 |  | PVOID * | pBufferNext,
 |  | DWORD | ParentObjectTitleIndex,
 |  | DWORD | ParentObjectInstance,
 |  | DWORD | UniqueID,
 |  | LPWSTR | Name
 | ) |  |

Definition at line 63 of file PerfUtil.c.

              :

            pBuffer         -   pointer to buffer where instance is to
                                be constructed

            pBufferNext     -   pointer to a pointer which will contain
                                next available location, DWORD aligned

            ParentObjectTitleIndex
                            -   Title Index of parent object type; 0 if
                                no parent object

            ParentObjectInstance
                            -   Index into instances of parent object
                                type, starting at 0, for this instances
                                parent object instance

            UniqueID        -   a unique identifier which should be used
                                instead of the Name for identifying
                                this instance

            Name            -   Name of this instance
--*/
{
   DWORD NameLength = 0;
   WCHAR * pName;

   //
   //  Include trailing null in name size
   //

   NameLength = lstrlenW(Name) * sizeof(WCHAR);
   if (NameLength > 0)
   {
      NameLength += sizeof(WCHAR); // to include the terminating NULL
   }

   pBuffer->ByteLength             = sizeof(PERF_INSTANCE_DEFINITION) + DWORD_MULTIPLE(NameLength);
   pBuffer->ParentObjectTitleIndex = ParentObjectTitleIndex;
   pBuffer->ParentObjectInstance   = ParentObjectInstance;
   pBuffer->UniqueID               = UniqueID;
   pBuffer->NameOffset             = sizeof(PERF_INSTANCE_DEFINITION);
   pBuffer->NameLength             = NameLength;
   pName = (PWCHAR) & pBuffer[1];
   lstrcpynW(pName, Name, lstrlenW(Name) + 1);

   * pBufferNext = (PVOID) ((PCHAR) pBuffer + pBuffer->ByteLength);
   return TRUE;
}

VOID MonCloseEventLog ( )

Definition at line 209 of file PerfUtil.c.

                   :

      Closes the handle to the event logger if this is the last caller

Arguments:

      None

Return Value:

      None

--*/
{
   if (hEventLog != NULL)
   {
      dwLogUsers --;         // decrement usage
      if (dwLogUsers <= 0)
      {    // and if we're the last, then close up log
         REPORT_INFORMATION(UTIL_CLOSING_LOG, LOG_DEBUG);
         DeregisterEventSource(hEventLog);
      }
   }
}

HANDLE MonOpenEventLog ( )

Definition at line 126 of file PerfUtil.c.

                   :

    Reads the level of event logging from the registry and opens the
        channel to the event logger for subsequent event log entries.

Arguments:

      None

Return Value:

    Handle to the event log for reporting events.
    NULL if open not successful.

--*/
{
   HKEY  hAppKey;
   CHAR  LogLevelKeyName[]   = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib";
   CHAR  LogLevelValueName[] = "EventLogLevel";
   LONG  lStatus;
   DWORD dwLogLevel;
   DWORD dwValueType;
   DWORD dwValueSize;

   // if global value of the logging level not initialized or is disabled,
   //  check the registry to see if it should be updated.

   if (! MESSAGE_LEVEL)
   {

      lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
                             LogLevelKeyName,
                             0,
                             KEY_READ,
                             & hAppKey);
      if (lStatus == ERROR_SUCCESS)
      {
         dwValueSize = sizeof(dwLogLevel);
         lStatus = RegQueryValueEx(hAppKey,
                                   LogLevelValueName,
                                   (LPDWORD) NULL,
                                   & dwValueType,
                                   (LPBYTE) & dwLogLevel,
                                   & dwValueSize);
         if (lStatus == ERROR_SUCCESS)
         {
            MESSAGE_LEVEL = dwLogLevel;
         }
         else
         {
            MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
         }
         RegCloseKey(hAppKey);
      }
      else
      {
         MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
      }
   }

   if (hEventLog == NULL)
   {
      hEventLog = RegisterEventSource(
                                     (LPTSTR) NULL, // Use Local Machine
                                     APP_NAME);     // event log app name to find in registry
      if (hEventLog != NULL)
      {
         REPORT_INFORMATION(UTIL_LOG_OPEN, LOG_DEBUG);
      }
   }

   if (hEventLog != NULL)
   {
      dwLogUsers ++; // increment count of perfctr log users
   }
   return (hEventLog);
}

Variable Documentation

WCHAR COSTLY_STRING[]

Definition at line 45 of file PerfUtil.c.

WCHAR FOREIGN_STRING[]

Definition at line 44 of file PerfUtil.c.

WCHAR GLOBAL_STRING[]

Definition at line 43 of file PerfUtil.c.

WCHAR NULL_STRING[]

Definition at line 46 of file PerfUtil.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/ShareMem.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll
Functions

ShareMem.c File Reference

#include <windows.h>
#include <string.h>
#include <winperf.h>
#include "..\inc\appmemi.h"
#include "memctrs.h"

Go to the source code of this file.

Functions

LONG _stdcall GetSharedMemoryDataHeader (IN HANDLE *phAppMemSharedMemory, IN PAPPMEM_DATA_HEADER *pHeader, IN BOOL bReadOnlyAccess)

Function Documentation

LONG _stdcall GetSharedMemoryDataHeader | ( | IN HANDLE * | phAppMemSharedMemory,
 |  | IN PAPPMEM_DATA_HEADER * | pHeader,
 |  | IN BOOL | bReadOnlyAccess
 | ) |  |

Definition at line 26 of file ShareMem.c.

{
   LONG             Status, MemStatus;
   TCHAR            szMappedObject[] = SHARED_MEMORY_OBJECT_NAME;
   PAPPMEM_INSTANCE pLastItem;
   PAPPMEM_INSTANCE pAppData;
   DWORD            dwInstance;

   SetLastError(ERROR_SUCCESS);   // just to clear it out

   * phAppMemSharedMemory = CreateFileMapping(
                                              (HANDLE) INVALID_HANDLE_VALUE,
                                              NULL,                      // no security
                                              PAGE_READWRITE,            // to allow read & write access
                                              0,
                                              SHARED_MEMORY_OBJECT_SIZE, // file size
                                              szMappedObject);           // object name

   MemStatus = GetLastError();    // to see if this is the first opening

   // return error if unsuccessful
   if (* phAppMemSharedMemory == NULL)
   {
      Status = APPMEM_OPEN_FILE_MAPPING_ERROR;
      // this is fatal, if we can't get data then there's no
      // point in continuing.
   }
   else
   {
      if (MemStatus != ERROR_ALREADY_EXISTS)
      {
         // this is the first access to the file so initialize the
         // instance count
         * pHeader = (PAPPMEM_DATA_HEADER) MapViewOfFile(
                                                      * phAppMemSharedMemory,  // shared mem handle
                                                      FILE_MAP_WRITE,          // access desired
                                                      0,                       // starting offset
                                                      0,
                                                      0);                      // map the entire object
         if (* pHeader != NULL)
         {
            // if here, then pdwInstanceCount should be valid
            // so initialize the shared memory structure
            // clear memory block
            memset(* pHeader, 0, SHARED_MEMORY_OBJECT_SIZE);

            // initialize application data header
            (* pHeader)->dwInstanceCount    = 0;    // no instances
            (* pHeader)->dwFirstInUseOffset = 0;    // no busy items yet
            (* pHeader)->dwFirstFreeOffset  = (DWORD) ((LPBYTE) & (* pHeader)[1] - (LPBYTE) * pHeader);

            pLastItem = FIRST_FREE((* pHeader));

            // set pointers in each item of block
            pAppData = pLastItem + 1;
            for (dwInstance = (SHARED_MEMORY_ITEM_COUNT - 1); dwInstance > 0; dwInstance --)
            {
               pLastItem->dwOffsetOfNext = (DWORD)((LPBYTE) pAppData - (LPBYTE)(* pHeader));
               pLastItem = pAppData;
               pAppData ++;
            }
            pAppData->dwOffsetOfNext = 0; // end of list
            Status = ERROR_SUCCESS;
         }
         else
         {
            Status = APPMEM_UNABLE_MAP_VIEW_OF_FILE;
         }
      }
      else
      {
         // the status is ERROR_ALREADY_EXISTS which is successful
         Status = ERROR_SUCCESS;
      }
      // see if Read Only access is required
      if (Status == ERROR_SUCCESS)
      {
         // by now the shared memory has already been initialized so
         // we if we don't need write access any more or if it has
         // already been opened, then open with the desired access
         * pHeader = (PAPPMEM_DATA_HEADER) MapViewOfFile(
                         * phAppMemSharedMemory,                             // shared mem handle
                         (bReadOnlyAccess ? FILE_MAP_READ : FILE_MAP_WRITE), // access desired
                         0,                                                  // starting offset
                         0,
                         0);                                                 // map the entire object
         if (* pHeader == NULL)
         {
            Status = APPMEM_UNABLE_MAP_VIEW_OF_FILE;
            // this is fatal, if we can't get data then there's no
            // point in continuing.
         }
         else
         {
            Status = ERROR_SUCCESS;
         }
      }
   }
   return Status;
}

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/pub/AppMem.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • pub
Functions

AppMem.h File Reference

Go to the source code of this file.

Functions

HGLOBAL | GlobalAllocP (UINT fuFlags, DWORD cbBytes)
HGLOBAL | GlobalFreeP (HGLOBAL hglbMem)
HGLOBAL | GlobalReAllocP (HGLOBAL hglbMem, DWORD cbBytes, UINT fuFlags)

Function Documentation

HGLOBAL GlobalAllocP | ( | UINT | fuFlags,
 |  | DWORD | cbBytes
 | ) |  |

Definition at line 27 of file AppMema.c.

{
   HGLOBAL hReturn;
   DWORD   dwSize;

   hReturn = GlobalAlloc(fuFlags, cbBytes);
   if (hReturn != NULL)
   {
      // only collect statistics on successful calls
      if (pAppData != NULL)
      {
         // only update data if data block is valid
         // update call count
         pAppData->dwAllocCalls ++;
         dwSize = (DWORD) GlobalSize(hReturn);
         pAppData->dwApplicationBytes += dwSize;
      }
   }
   return hReturn;
}

HGLOBAL GlobalFreeP ( HGLOBAL hglbMem )

Definition at line 52 of file AppMema.c.

{
   HGLOBAL hReturn;
   DWORD   dwSize;

   // get size of block before freeing it
   dwSize = (DWORD) GlobalSize(hglbMem);
   if (dwSize > 0)
   {
      // size was obtained OK so free the block
      hReturn = GlobalFree(hglbMem);
      if (hReturn == NULL)
      {
         // memory was freed
         if (pAppData != NULL)
         {
            // update call count
            pAppData->dwFreeCalls ++;
            pAppData->dwApplicationBytes -= dwSize;
         }
      }
      else
      {
         // memory was not freed so don't change data
      }
   }
   else
   {
      // unable to read memory size
   }
   return hReturn;
}

HGLOBAL GlobalReAllocP | ( | HGLOBAL | hglbMem,
 |  | DWORD | cbBytes,
 |  | UINT | fuFlags
 | ) |  |

Definition at line 88 of file AppMema.c.

{
   HGLOBAL hReturn;
   DWORD   dwBeforeSize = 0;
   DWORD   dwAfterSize  = 0;

   // get size of block before re-alloc-ing it
   dwBeforeSize = (DWORD) GlobalSize(hglbMem);
   if (dwBeforeSize > 0)
   {
      // size was obtained OK so realloc the block
      hReturn = GlobalReAlloc(hglbMem, cbBytes, fuFlags);
      if (hReturn != NULL)
      {
         // memory was re alloc'd so get the new size
         dwAfterSize = (DWORD) GlobalSize(hReturn);
      }
      else
      {
         // memory was not re-alloced so set after size to 0
      }
      if (pAppData != NULL)
      {
         // update call count
         pAppData->dwReAllocCalls ++;
         pAppData->dwApplicationBytes -= dwBeforeSize;
         pAppData->dwApplicationBytes += dwAfterSize;
      }
   }
   else
   {
      // unable to read memory size nothing has changed
      // return original pointer
      hReturn = hglbMem;
   }
   return hReturn;
}

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/pub/MemCtrnm.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • pub
Defines

MemCtrnm.h File Reference

Go to the source code of this file.

Defines

#define | APPALLOCS 4
#define | APPALLOCSSEC 6
#define | APPFREES 12
#define | APPFREESSEC 14
#define | APPMEMALLOC 2
#define | APPMEMOBJ 0
#define | APPREALLOCS 8
#define | APPREALLOCSSEC 10

Define Documentation

#define APPALLOCS 4

Definition at line 18 of file MemCtrnm.h.

#define APPALLOCSSEC 6

Definition at line 19 of file MemCtrnm.h.

#define APPFREES 12

Definition at line 22 of file MemCtrnm.h.

#define APPFREESSEC 14

Definition at line 23 of file MemCtrnm.h.

#define APPMEMALLOC 2

Definition at line 17 of file MemCtrnm.h.

#define APPMEMOBJ 0

Definition at line 16 of file MemCtrnm.h.

#define APPREALLOCS 8

Definition at line 20 of file MemCtrnm.h.

#define APPREALLOCSSEC 10

Definition at line 21 of file MemCtrnm.h.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/LeakyBin/LeakyBin.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • LeakyBin
Defines | Functions | Variables

LeakyBin.c File Reference

#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <stdio.h>
#include "leakybin.h"

Go to the source code of this file.

Defines

#define | APPNAME "Leakybin"
#define | IS_NT IS_WIN32 && (BOOL)(GetVersion() < 0x80000000)
#define | IS_WIN32 TRUE

Functions

LRESULT CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
BOOL | CenterWindow (HWND, HWND)
void | FreeAllocatedMemory ()
LPTSTR | GetStringRes (int id)
BOOL | InitApplication (HINSTANCE)
BOOL | InitInstance (HINSTANCE, int)
ATOM | MyRegisterClass (CONST WNDCLASS *)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
LRESULT CALLBACK | WndProc (HWND, UINT, WPARAM, LPARAM)

Variables

HINSTANCE | hInst
char | szAppName [100]
char | szTitle [100]

Define Documentation

#define APPNAME "Leakybin"

Definition at line 26 of file LeakyBin.c.

#define IS_NT IS_WIN32 && (BOOL)(GetVersion() < 0x80000000)

Definition at line 42 of file LeakyBin.c.

#define IS_WIN32 TRUE

Definition at line 41 of file LeakyBin.c.

Function Documentation

LRESULT CALLBACK About | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 491 of file LeakyBin.c.

{
   static  HFONT hfontDlg;    // Font for dialog text
   static   HFONT hFinePrint; // Font for 'fine print' in dialog
   DWORD   dwVerInfoSize;     // Size of version information block
   LPSTR   lpVersion;         // String pointer to 'version' text
   DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
   UINT    uVersionLen;
   BOOL    bRetCode;
   int     i;
   char    szFullPath[256];
   char    szResult[256];
   char    szGetName[256];
   DWORD dwVersion;
   char  szVersion[40];
   DWORD dwResult;

   switch (message)
   {
   case WM_INITDIALOG:
      ShowWindow (hDlg, SW_HIDE);

      if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
      {
         hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                               VARIABLE_PITCH | FF_DONTCARE, "");
         hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                 VARIABLE_PITCH | FF_DONTCARE, "");
      }
      else
      {
         hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                               VARIABLE_PITCH | FF_SWISS, "");
         hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                 VARIABLE_PITCH | FF_SWISS, "");
      }

      CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
      GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));

      // Now lets dive in and pull out the version information:
      dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
      if (dwVerInfoSize)
      {
         LPSTR   lpstrVffInfo;
         HANDLE  hMem;
         hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
         lpstrVffInfo  = GlobalLock(hMem);
         GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
         // The below 'hex' value looks a little confusing, but
         // essentially what it is, is the hexidecimal representation
         // of a couple different values that represent the language
         // and character set that we are wanting string values for.
         // 040904E4 is a very common one, because it means:
         //   US English, Windows MultiLingual characterset
         // Or to pull it all apart:
         // 04------        = SUBLANG_ENGLISH_USA
         // --09----        = LANG_ENGLISH
         // --11----        = LANG_JAPANESE
         // ----04E4 = 1252 = Codepage for Windows:Multilingual

         _snprintf(szGetName, 256, "%sProductName", GetStringRes(IDS_VER_INFO_LANG));

         // Set the title of the dialog:
         bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
                                  (LPSTR)szGetName,
                                  (LPVOID)&lpVersion,
                                  (UINT *)&uVersionLen);

         // Notice order of version and string...
         if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
         {
            _snprintf(szResult, 256, "%s ‚Ìƒo[ƒWƒ‡ƒ“î•ñ", lpVersion);
         }
         else
         {
            _snprintf(szResult, 256, "About %s", lpVersion);
         }

         // -----------------------------------------------------

         SetWindowText (hDlg, szResult);

         // Walk through the dialog items that we want to replace:
         for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)
         {
            GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
            _snprintf(szGetName, 256, "%s%s", GetStringRes(IDS_VER_INFO_LANG), szResult);
            uVersionLen   = 0;
            lpVersion     = NULL;
            bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
                                           (LPSTR)szGetName,
                                           (LPVOID)&lpVersion,
                                           (UINT *)&uVersionLen);

            if ( bRetCode && uVersionLen && lpVersion)
            {
               // Replace dialog item text with version info
               lstrcpynA(szResult, lpVersion, 256);
               SetDlgItemText(hDlg, i, szResult);
            }
            else
            {
               dwResult = GetLastError();

               _snprintf(szResult, 256, GetStringRes(IDS_VERSION_ERROR), dwResult);
               SetDlgItemText (hDlg, i, szResult);
            }
            SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
                         (UINT_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
                         TRUE);
         } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)

         GlobalUnlock(hMem);
         GlobalFree(hMem);

      }
      else
      {
         // No version information available.

      } // if (dwVerInfoSize)

      SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
                   (WPARAM)hfontDlg,(LPARAM)TRUE);

      // We are  using GetVersion rather then GetVersionEx
      // because earlier versions of Windows NT and Win32s
      // didn't include GetVersionEx:
      dwVersion = GetVersion();

      if (dwVersion < 0x80000000)
      {
         // Windows NT
         _snprintf(szVersion, 40, "Microsoft Windows NT %u.%u (Build: %u)",
                   (DWORD)(LOBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIWORD(dwVersion)) );
      }
      else if (LOBYTE(LOWORD(dwVersion))<4)
      {
         // Win32s
         _snprintf(szVersion, 40, "Microsoft Win32s %u.%u (Build: %u)",
                   (DWORD)(LOBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIWORD(dwVersion) & ~0x8000) );
      }
      else
      {
         // Windows 95
         _snprintf(szVersion, 40, "Microsoft Windows 95 %u.%u",
                   (DWORD)(LOBYTE(LOWORD(dwVersion))),
                   (DWORD)(HIBYTE(LOWORD(dwVersion))) );
      }

      SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
      ShowWindow (hDlg, SW_SHOW);
      return (TRUE);

   case WM_COMMAND:
      if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
      {
         EndDialog(hDlg, TRUE);
         DeleteObject (hfontDlg);
         DeleteObject (hFinePrint);
         return (TRUE);
      }
      break;
   }

   return FALSE;
}

BOOL CenterWindow | ( | HWND | hwndChild,
 |  | HWND | hwndParent
 | ) |  |

Definition at line 679 of file LeakyBin.c.

{
   RECT    rChild, rParent, rWorkArea;
   int     wChild, hChild, wParent, hParent;
   int     xNew, yNew;
   BOOL  bResult;

   // Get the Height and Width of the child window
   GetWindowRect (hwndChild, &rChild);
   wChild = rChild.right - rChild.left;
   hChild = rChild.bottom - rChild.top;

   // Get the Height and Width of the parent window
   GetWindowRect (hwndParent, &rParent);
   wParent = rParent.right - rParent.left;
   hParent = rParent.bottom - rParent.top;

   // Get the limits of the 'workarea'
   bResult = SystemParametersInfo(
                                 SPI_GETWORKAREA,  // system parameter to query or set
                                 sizeof(RECT),
                                 &rWorkArea,
                                 0);
   if (!bResult)
   {
      rWorkArea.left = rWorkArea.top = 0;
      rWorkArea.right = GetSystemMetrics(SM_CXSCREEN);
      rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
   }

   // Calculate new X position, then adjust for workarea
   xNew = rParent.left + ((wParent - wChild) /2);
   if (xNew < rWorkArea.left)
   {
      xNew = rWorkArea.left;
   }
   else if ((xNew+wChild) > rWorkArea.right)
   {
      xNew = rWorkArea.right - wChild;
   }

   // Calculate new Y position, then adjust for workarea
   yNew = rParent.top  + ((hParent - hChild) /2);
   if (yNew < rWorkArea.top)
   {
      yNew = rWorkArea.top;
   }
   else if ((yNew+hChild) > rWorkArea.bottom)
   {
      yNew = rWorkArea.bottom - hChild;
   }

   // Set it, and return
   return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}

void FreeAllocatedMemory ( )

Definition at line 237 of file LeakyBin.c.

{
   {
      PMEMORY_ALLOC_BLOCK pNextMab, pMab;

      pMab = mabListHead.pNext;

      while (pMab != NULL)
      {
         pNextMab = pMab->pNext;
         G_FREE (pMab);
         pMab = pNextMab;
      }

      mabListHead.pNext = NULL;
   }
}

LPTSTR GetStringRes ( int id )

Definition at line 746 of file LeakyBin.c.

{
   static TCHAR buffer[MAX_PATH];

   buffer[0]=0;
   LoadString (GetModuleHandle (NULL), id, buffer, MAX_PATH);
   return buffer;
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 186 of file LeakyBin.c.

{
   WNDCLASS  wc;

   // Fill in window class structure with parameters that describe
   // the main window.
   wc.style         = CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc   = (WNDPROC)WndProc;
   wc.cbClsExtra    = 0;
   wc.cbWndExtra    = 0;
   wc.hInstance     = hInstance;
   wc.hIcon         = LoadIcon (hInstance, szAppName);
   wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
   wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
   wc.lpszMenuName  = szAppName;
   wc.lpszClassName = szAppName;

   // Register the window class and return success/failure code.
   return RegisterClass(&wc);
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 217 of file LeakyBin.c.

{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szAppName, szTitle, WS_OVERLAPPEDWINDOW,
                       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
                       NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return (FALSE);
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return (TRUE);
}

ATOM MyRegisterClass ( CONST WNDCLASS * lpwc )

Definition at line 134 of file LeakyBin.c.

{
   HANDLE  hMod;
   FARPROC proc;
   WNDCLASSEX wcex;

   hMod = GetModuleHandle ("USER32");
   if (hMod != NULL)
   {

#if defined (UNICODE)
      proc = GetProcAddress (hMod, "RegisterClassExW");
#else
      proc = GetProcAddress (hMod, "RegisterClassExA");
#endif

      if (proc != NULL)
      {

         wcex.style         = lpwc->style;
         wcex.lpfnWndProc   = lpwc->lpfnWndProc;
         wcex.cbClsExtra    = lpwc->cbClsExtra;
         wcex.cbWndExtra    = lpwc->cbWndExtra;
         wcex.hInstance     = lpwc->hInstance;
         wcex.hIcon         = lpwc->hIcon;
         wcex.hCursor       = lpwc->hCursor;
         wcex.hbrBackground = lpwc->hbrBackground;
         wcex.lpszMenuName  = lpwc->lpszMenuName;
         wcex.lpszClassName = lpwc->lpszClassName;

         // Added elements for Windows 95:
         wcex.cbSize = sizeof(WNDCLASSEX);
         wcex.hIconSm = LoadIcon(wcex.hInstance, "SMALL");

         return (ATOM)((*proc)(&wcex));//return RegisterClassEx(&wcex) with type ATOM;
      }
   }
   return (RegisterClass(lpwc));
}

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 76 of file LeakyBin.c.

{
   MSG msg;
   HANDLE hAccelTable;

   // Initialize global strings
   lstrcpynA(szAppName, APPNAME, 100);
   LoadString (hInstance, IDS_APP_TITLE, szTitle, 100);

   if (! hPrevInstance)
   {
      // Perform instance initialization:
      if (! InitApplication(hInstance))
      {
         return (FALSE);
      }
   }

   // Perform application initialization:
   if (! InitInstance(hInstance, nCmdShow))
   {
      return (FALSE);
   }

   hAccelTable = LoadAccelerators(hInstance, szAppName);

   // Main message loop:
   while (GetMessage(& msg, NULL, 0, 0))
   {
      if (! TranslateAccelerator(msg.hwnd, hAccelTable, & msg))
      {
         TranslateMessage(& msg);
         DispatchMessage(& msg);
      }
   }

   return (int) (msg.wParam);

   lpCmdLine; // This will prevent 'unused formal parameter' warnings
}

LRESULT CALLBACK WndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 269 of file LeakyBin.c.

{
   int wmId, wmEvent;
   PAINTSTRUCT ps;
   HDC hdc;
   POINT pnt;
   HMENU hMenu;
   BOOL bGotHelp;

   switch (message)
   {
   case WM_CREATE:
      // clear timer flags
      TimerID = 0;
      TimerRunning = FALSE;

      // enable "Start" menu selection
      hAppMenu = GetMenu (hWnd);
      hTestMenu  = GetSubMenu (hAppMenu, 1);
      EnableMenuItem (hTestMenu, IDM_STOP, MF_BYCOMMAND | MF_GRAYED);
      EnableMenuItem (hTestMenu, IDM_START, MF_BYCOMMAND | MF_ENABLED);
      break;

   case WM_COMMAND:
      wmId    = LOWORD(wParam); // Remember, these are...
      wmEvent = HIWORD(wParam); // ...different for Win32!

      //Parse the menu selections:
      switch (wmId)
      {

      case IDM_EXIT:
         DestroyWindow (hWnd);
         break;

      case IDM_START:
         if (!TimerRunning)
         {
            TimerID = SetTimer (hWnd, LEAK_TIMER, TIME_INTERVAL, NULL);
            if (TimerID != 0)
            {
               TimerRunning = TRUE;
               EnableMenuItem (hTestMenu, IDM_START,
                               MF_BYCOMMAND | MF_GRAYED);
               EnableMenuItem (hTestMenu, IDM_STOP,
                               MF_BYCOMMAND | MF_ENABLED);
            }
            else
            {
               //unable to start timer
               MessageBeep (MB_ICONEXCLAMATION);
            }
         }
         InvalidateRect (hWnd, NULL, TRUE);
         break;

      case IDM_STOP:
         if (TimerRunning)
         {
            KillTimer (hWnd, LEAK_TIMER);
            TimerID = 0;
            TimerRunning = FALSE;
            EnableMenuItem (hTestMenu, IDM_STOP,
                            MF_BYCOMMAND | MF_GRAYED);
            EnableMenuItem (hTestMenu, IDM_START,
                            MF_BYCOMMAND | MF_ENABLED);
         }
         InvalidateRect (hWnd, NULL, TRUE);
         break;

      case IDM_RESET:
         FreeAllocatedMemory();
         InvalidateRect (hWnd, NULL, TRUE);
         break;

      case IDM_ABOUT:
         DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)About);
         break;

      case IDM_HELPTOPICS: // Only called in Windows 95
         bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_FINDER,(DWORD)0);
         if (!bGotHelp)
         {
            MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                        szAppName, MB_OK|MB_ICONHAND);
         }
         break;

      default:
         return (DefWindowProc(hWnd, message, wParam, lParam));
      }
      break;

   case WM_TIMER:
      {
         PMEMORY_ALLOC_BLOCK     pMab, pNewMab;

         pNewMab = (PMEMORY_ALLOC_BLOCK)G_ALLOC (GPTR, ALLOCATION_SIZE);

         if (pNewMab != NULL)
         {
            // save this pointer
            pNewMab->pNext = NULL;
            if (mabListHead.pNext == NULL)
            {
               // this is the first entry
               mabListHead.pNext = pNewMab;
            }
            else
            {
               // go to end of list
               pMab = mabListHead.pNext;
               while (pMab->pNext != NULL) pMab = pMab->pNext;
               pMab->pNext = pNewMab;
            }
            InvalidateRect (hWnd, NULL, TRUE);
         }
      }
      break;

   case WM_RBUTTONDOWN: // RightClick in windows client area...
      pnt.x = LOWORD(lParam);
      pnt.y = HIWORD(lParam);
      ClientToScreen(hWnd, (LPPOINT) &pnt);
      // This is where you would determine the appropriate 'context'
      // menu to bring up. Since this app has no real functionality,
      // we will just bring up the 'Help' menu:
      hMenu = GetSubMenu (GetMenu (hWnd), 2);
      if (hMenu)
      {
         TrackPopupMenu (hMenu, 0, pnt.x, pnt.y, 0, hWnd, NULL);
      }
      else
      {
         // Couldn't find the menu...
         MessageBeep(0);
      }
      break;

   case WM_DISPLAYCHANGE: // Only comes through on plug'n'play systems
      {
         SIZE  szScreen;
         DWORD dwBitsPerPixel = (DWORD)wParam;

         szScreen.cx = LOWORD(lParam);
         szScreen.cy = HIWORD(lParam);

         MessageBox (GetFocus(), GetStringRes(IDS_DISPLAYCHANGED),
                     szAppName, 0);
      }
      break;

   case WM_PAINT:
      {
         MEMORYSTATUS    MemoryStatusData;
         LONGLONG            llInUse;
         DWORD                   dwPercentUsed;

         int     nX, nY;
         LONG    lTextOutReturn;
         int     nStringLength;
         CHAR            szOutputString[100];

         hdc = BeginPaint (hWnd, &ps);
         // Add any drawing code here...
         GlobalMemoryStatus (& MemoryStatusData);

         llInUse = (LONGLONG)(MemoryStatusData.dwTotalPageFile -
                              MemoryStatusData.dwAvailPageFile + 5 );
         llInUse *= 1000;
         llInUse /= MemoryStatusData.dwTotalPageFile;
         llInUse /= 10;

         dwPercentUsed = (DWORD)llInUse;

         nX = 0;
         nY = 0;
         _snprintf(szOutputString, 100, "Reported Memory Load: \t%3.1d%%",
                  MemoryStatusData.dwMemoryLoad);
         nStringLength = lstrlen (szOutputString) * sizeof (CHAR);
         lTextOutReturn = TabbedTextOut (hdc, nX, nY,
                                         szOutputString, nStringLength, 0, NULL, 0);
         nY += HIWORD (lTextOutReturn);

         _snprintf(szOutputString, 100, "Page file in use:  \t%3.1d%%",
                  dwPercentUsed);
         nStringLength = lstrlen (szOutputString) * sizeof (CHAR);
         lTextOutReturn = TabbedTextOut(hdc, nX, nY,
                                         szOutputString, nStringLength, 0, NULL, 0);
         nY += HIWORD(lTextOutReturn);

         EndPaint (hWnd, &ps);
      }
      break;

   case WM_DESTROY:
      FreeAllocatedMemory();
      // Tell WinHelp we don't need it any more...
      WinHelp(hWnd, APPNAME".HLP", HELP_QUIT,(DWORD)0);
      PostQuitMessage(0);
      break;

   default:
      return (DefWindowProc(hWnd, message, wParam, lParam));
   }
   return (0);
}

Variable Documentation

HINSTANCE hInst

Definition at line 46 of file LeakyBin.c.

char szAppName[100]

Definition at line 47 of file LeakyBin.c.

char szTitle[100]

Definition at line 48 of file LeakyBin.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/LeakyBin/LeakyBin.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • LeakyBin
Classes | Defines | Typedefs

LeakyBin.h File Reference

Go to the source code of this file.

Classes

struct | _MEMORY_ALLOC_BLOCK

Defines

#define | ALLOCATION_SIZE (4096*10)
#define | DLG_VERFIRST 400
#define | DLG_VERLAST DLG_VERFIRST+5
#define | G_ALLOC GlobalAlloc
#define | G_FREE GlobalFree
#define | G_REALLOC GlobalRealloc
#define | IDC_COMPANY DLG_VERFIRST
#define | IDC_COPYRIGHT DLG_VERFIRST+3
#define | IDC_FILEDESC DLG_VERFIRST+1
#define | IDC_LABEL DLG_VERLAST+1
#define | IDC_OSVERSION DLG_VERFIRST+4
#define | IDC_PRODVER DLG_VERFIRST+2
#define | IDC_STATIC -1
#define | IDC_TRADEMARK DLG_VERFIRST+5
#define | IDM_ABOUT 301
#define | IDM_EXIT 101
#define | IDM_HELPTOPICS 302
#define | IDM_RESET 203
#define | IDM_START 201
#define | IDM_STOP 202
#define | IDS_APP_TITLE 500
#define | IDS_DISPLAYCHANGED 501
#define | IDS_NO_HELP 504
#define | IDS_VER_INFO_LANG 502
#define | IDS_VERSION_ERROR 503
#define | LEAK_TIMER 13
#define | TIME_INTERVAL (100)

Typedefs

typedef struct _MEMORY_ALLOC_BLOCK | MEMORY_ALLOC_BLOCK
typedef struct
_MEMORY_ALLOC_BLOCK * 		PMEMORY_ALLOC_BLOCK

Define Documentation

#define ALLOCATION_SIZE (4096*10)

Definition at line 31 of file LeakyBin.h.

#define DLG_VERFIRST 400

Definition at line 46 of file LeakyBin.h.

#define DLG_VERLAST DLG_VERFIRST+5

Definition at line 53 of file LeakyBin.h.

#define G_ALLOC GlobalAlloc

Definition at line 20 of file LeakyBin.h.

#define G_FREE GlobalFree

Definition at line 21 of file LeakyBin.h.

#define G_REALLOC GlobalRealloc

Definition at line 22 of file LeakyBin.h.

#define IDC_COMPANY DLG_VERFIRST

Definition at line 47 of file LeakyBin.h.

#define IDC_COPYRIGHT DLG_VERFIRST+3

Definition at line 50 of file LeakyBin.h.

#define IDC_FILEDESC DLG_VERFIRST+1

Definition at line 48 of file LeakyBin.h.

#define IDC_LABEL DLG_VERLAST+1

Definition at line 55 of file LeakyBin.h.

#define IDC_OSVERSION DLG_VERFIRST+4

Definition at line 51 of file LeakyBin.h.

#define IDC_PRODVER DLG_VERFIRST+2

Definition at line 49 of file LeakyBin.h.

#define IDC_STATIC -1

Definition at line 44 of file LeakyBin.h.

#define IDC_TRADEMARK DLG_VERFIRST+5

Definition at line 52 of file LeakyBin.h.

#define IDM_ABOUT 301

Definition at line 41 of file LeakyBin.h.

#define IDM_EXIT 101

Definition at line 36 of file LeakyBin.h.

#define IDM_HELPTOPICS 302

Definition at line 42 of file LeakyBin.h.

#define IDM_RESET 203

Definition at line 39 of file LeakyBin.h.

#define IDM_START 201

Definition at line 37 of file LeakyBin.h.

#define IDM_STOP 202

Definition at line 38 of file LeakyBin.h.

#define IDS_APP_TITLE 500

Definition at line 57 of file LeakyBin.h.

#define IDS_DISPLAYCHANGED 501

Definition at line 58 of file LeakyBin.h.

#define IDS_NO_HELP 504

Definition at line 61 of file LeakyBin.h.

#define IDS_VER_INFO_LANG 502

Definition at line 59 of file LeakyBin.h.

#define IDS_VERSION_ERROR 503

Definition at line 60 of file LeakyBin.h.

#define LEAK_TIMER 13

Definition at line 33 of file LeakyBin.h.

#define TIME_INTERVAL (100)

Definition at line 32 of file LeakyBin.h.

Typedef Documentation

typedef struct _MEMORY_ALLOC_BLOCK MEMORY_ALLOC_BLOCK
typedef struct _MEMORY_ALLOC_BLOCK * PMEMORY_ALLOC_BLOCK
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/LeakyBin/Resource.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • LeakyBin

Resource.h File Reference

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/DataGen.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen
Variables

DataGen.c File Reference

#include <windows.h>
#include <winperf.h>
#include "genctrnm.h"
#include "datagen.h"

Go to the source code of this file.

Variables

SIGGEN_DATA_DEFINITION SigGenDataDefinition

Variable Documentation

SIGGEN_DATA_DEFINITION SigGenDataDefinition

Definition at line 43 of file DataGen.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/DataGen.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen
Classes | Defines | Typedefs

DataGen.h File Reference

Go to the source code of this file.

Classes

struct | _SIGGEN_COUNTER
struct | _SIGGEN_DATA_DEFINITION

Defines

#define | SIGGEN_NUM_PERF_OBJECT_TYPES 1

Typedefs

typedef struct _SIGGEN_COUNTER * | PSIGGEN_COUNTER
typedef struct _SIGGEN_COUNTER | SIGGEN_COUNTER
typedef struct
_SIGGEN_DATA_DEFINITION 		SIGGEN_DATA_DEFINITION

Define Documentation

#define SIGGEN_NUM_PERF_OBJECT_TYPES 1

Definition at line 43 of file DataGen.h.

Typedef Documentation

typedef struct _SIGGEN_COUNTER * PSIGGEN_COUNTER
typedef struct _SIGGEN_COUNTER SIGGEN_COUNTER
typedef struct _SIGGEN_DATA_DEFINITION SIGGEN_DATA_DEFINITION
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/GenCtrnm.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen
Defines

GenCtrnm.h File Reference

Go to the source code of this file.

Defines

#define | CONSTANT_VALUE 8
#define | SIGGEN_OBJ 0
#define | SINE_WAVE 2
#define | SQUARE_WAVE 6
#define | TRIANGLE_WAVE 4

Define Documentation

#define CONSTANT_VALUE 8

Definition at line 20 of file GenCtrnm.h.

#define SIGGEN_OBJ 0

Definition at line 16 of file GenCtrnm.h.

#define SINE_WAVE 2

Definition at line 17 of file GenCtrnm.h.

#define SQUARE_WAVE 6

Definition at line 19 of file GenCtrnm.h.

#define TRIANGLE_WAVE 4

Definition at line 18 of file GenCtrnm.h.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/Perfgen.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen
Classes | Defines | Typedefs | Functions | Variables

Perfgen.c File Reference

#include <windows.h>
#include <string.h>
#include <winperf.h>
#include <math.h>
#include "genctrs.h"
#include "perfmsg.h"
#include "perfutil.h"
#include "datagen.h"

Go to the source code of this file.

Classes

struct | _WAVE_DATA

Defines

#define | CONSTANT_VALUE_VALUE 49

Typedefs

typedef struct _WAVE_DATA * | PWAVE_DATA
typedef struct _WAVE_DATA | WAVE_DATA

Functions

DWORD APIENTRY | CloseSigGenPerformanceData ()
DWORD APIENTRY | CollectSigGenPerformanceData (IN LPWSTR lpValueName, IN OUT LPVOID *lppData, IN OUT LPDWORD lpcbTotalBytes, IN OUT LPDWORD lpNumObjectTypes)
DWORD APIENTRY | OpenSigGenPerformanceData (LPWSTR lpDeviceNames)

Variables

BOOL | bInitOK = FALSE
PM_CLOSE_PROC | CloseSigGenPerformanceData
PM_COLLECT_PROC | CollectSigGenPerformanceData
DWORD | dwOpenCount = 0
PM_OPEN_PROC | OpenSigGenPerformanceData
SIGGEN_DATA_DEFINITION SigGenDataDefinition

Define Documentation

#define CONSTANT_VALUE_VALUE 49

Definition at line 38 of file Perfgen.c.

Typedef Documentation

typedef struct _WAVE_DATA * PWAVE_DATA
typedef struct _WAVE_DATA WAVE_DATA

Function Documentation

DWORD APIENTRY CloseSigGenPerformanceData ( )

Definition at line 439 of file Perfgen.c.

                   :

    This routine closes the open handles to the Signal Gen counters.

Arguments:

    None.

Return Value:

    ERROR_SUCCESS

--*/

{
    if (! (-- dwOpenCount)) { // when this is the last thread...
        MonCloseEventLog();
    }
    return ERROR_SUCCESS;

}

DWORD APIENTRY CollectSigGenPerformanceData | ( | IN LPWSTR | lpValueName,
 |  | IN OUT LPVOID * | lppData,
 |  | IN OUT LPDWORD | lpcbTotalBytes,
 |  | IN OUT LPDWORD | lpNumObjectTypes
 | ) |  |

Definition at line 237 of file Perfgen.c.

                   :

    This routine will return the data for the Signal Generator counters.

Arguments:

   IN       LPWSTR   lpValueName
         pointer to a wide character string passed by registry.

   IN OUT   LPVOID   *lppData
         IN: pointer to the address of the buffer to receive the completed
            PerfDataBlock and subordinate structures. This routine will
            append its data to the buffer starting at the point referenced
            by *lppData.
         OUT: points to the first byte after the data structure added by this
            routine. This routine updated the value at lppdata after appending
            its data.

   IN OUT   LPDWORD  lpcbTotalBytes
         IN: the address of the DWORD that tells the size in bytes of the
            buffer referenced by the lppData argument
         OUT: the number of bytes added by this routine is writted to the
            DWORD pointed to by this argument

   IN OUT   LPDWORD  NumObjectTypes
         IN: the address of the DWORD to receive the number of objects added
            by this routine
         OUT: the number of objects added by this routine is writted to the
            DWORD pointed to by this argument

Return Value:

      ERROR_MORE_DATA if buffer passed is too small to hold data
         any error conditions encountered are reported to the event log if
         event logging is enabled.

      ERROR_SUCCESS  if success or any other error. Errors, however are
         also reported to the event log.

--*/
{
    //  Variables for reformating the data

    PERF_INSTANCE_DEFINITION * pPerfInstanceDefinition;
    DWORD   dwThisInstance;
    ULONG   SpaceNeeded;
    SIGGEN_DATA_DEFINITION   * pSigGenDataDefinition;
    DWORD   dwQueryType;
    DWORD   dwTime;
    DWORD   dwPhase;
    double  dPhase, dSin;
    LONG    lValue;
    PSIGGEN_COUNTER   pSC;

    //
    // before doing anything else, see if Open went OK
    //
    if (! bInitOK) {
        // unable to continue because open failed.
        * lpcbTotalBytes   = (DWORD) 0;
        * lpNumObjectTypes = (DWORD) 0;
        return ERROR_SUCCESS; // yes, this is a successful exit
    }

    // see if this is a foreign (i.e. non-NT) computer data request
    //
    dwQueryType = GetQueryType(lpValueName);

    if ((dwQueryType == QUERY_FOREIGN) || (dwQueryType == QUERY_COSTLY)) {
        // this routine does not service requests for data from
        // Non-NT computers
        * lpcbTotalBytes   = (DWORD) 0;
        * lpNumObjectTypes = (DWORD) 0;
        return ERROR_SUCCESS;
    }

    if (dwQueryType == QUERY_ITEMS) {
    if (! (IsNumberInUnicodeList(SigGenDataDefinition.SigGenObjectType.ObjectNameTitleIndex, lpValueName))) {
            // request received for data object not provided by this routine
            * lpcbTotalBytes   = (DWORD) 0;
            * lpNumObjectTypes = (DWORD) 0;
            return ERROR_SUCCESS;
        }
    }

    pSigGenDataDefinition = (SIGGEN_DATA_DEFINITION *) * lppData;

    SpaceNeeded = sizeof(SIGGEN_DATA_DEFINITION) +
                    (NUM_INSTANCES * (sizeof(PERF_INSTANCE_DEFINITION) +
                    (24) +    // size of instance names
                    sizeof(SIGGEN_COUNTER)));

    if (* lpcbTotalBytes < SpaceNeeded) {
        * lpcbTotalBytes   = (DWORD) 0;
        * lpNumObjectTypes = (DWORD) 0;
        return ERROR_MORE_DATA;
    }

    // Get current time for this sample
    //
    dwTime = GetTimeInMilliSeconds();
    //
    // Copy the (constant, initialized) Object Type and counter definitions
    //  to the caller's data buffer
    //
    memmove(pSigGenDataDefinition, & SigGenDataDefinition, sizeof(SIGGEN_DATA_DEFINITION));
    //
    //    Create data for return for each instance
    //
    pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *) & pSigGenDataDefinition[1];

    for (dwThisInstance = 0; dwThisInstance < NUM_INSTANCES; dwThisInstance ++) {
        MonBuildInstanceDefinition(
                        pPerfInstanceDefinition,
                        (PVOID *) & pSC,
                        0,
                        0,
                        (DWORD) -1, // use name
                        wdInstance[dwThisInstance].szInstanceName);

        pSC->CounterBlock.ByteLength = sizeof (SIGGEN_COUNTER);

        //**********************************************************
        //
        // for this particular example, the data is "created" here.
        // normally it would be read from the appropriate device or
        // application program.
        //
        //**********************************************************

        // comput phase for this instance period
        dwPhase = dwTime % wdInstance[dwThisInstance].dwPeriod;
        //
        // compute sinewave value here
        //
        dPhase  = (double) dwPhase / (double) wdInstance[dwThisInstance].dwPeriod;
        dPhase *= d2Pi;

        // the cosine function is used to keep the phase aligned with the
        // other wave forms
        dSin = -cos(dPhase);
        // adjust amplitude and add .5 to round to integer correctly
        dSin *= (double)((wdInstance[dwThisInstance].dwAmplitude) / 2.0) + 0.5;

        lValue  = (LONG) dSin;
        lValue += wdInstance[dwThisInstance].dwAmplitude / 2;   // to move negative values above 0

        // save sine value
        pSC->dwSineWaveValue = (DWORD) lValue;

        // compute triangle wave value here

        if (dwPhase < (wdInstance[dwThisInstance].dwPeriod / 2)) {
            lValue = (LONG)((dwPhase * wdInstance[dwThisInstance].dwAmplitude) / (wdInstance[dwThisInstance].dwPeriod / 2));
        } else {
            lValue = (LONG)(((wdInstance[dwThisInstance].dwPeriod - dwPhase) * wdInstance[dwThisInstance].dwAmplitude) /
                    (wdInstance[dwThisInstance].dwPeriod / 2));
        }
        // save triangle value
        pSC->dwTriangleWaveValue = (DWORD) lValue;

        //
        //  compute square wave value
        //
        if (dwPhase <= (wdInstance[dwThisInstance].dwPeriod / 2)) {
            lValue = 0;
        } else {
            lValue = (LONG)wdInstance[dwThisInstance].dwAmplitude;
        }
        // save square value
        pSC->dwSquareWaveValue = (DWORD) lValue;

        // finally the constant value (same fore every instance)
        pSC->dwConstantValue = (DWORD)CONSTANT_VALUE_VALUE;

        // update instance pointer for next instance
        pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *)&pSC[1];
    }
    // update arguments for return

    * lppData = (PVOID) pPerfInstanceDefinition;

    * lpNumObjectTypes = 1;

    pSigGenDataDefinition->SigGenObjectType.TotalByteLength =
                    * lpcbTotalBytes = (DWORD) ((PBYTE) pPerfInstanceDefinition - (PBYTE) pSigGenDataDefinition);

    // update instance count
    pSigGenDataDefinition->SigGenObjectType.NumInstances = NUM_INSTANCES;

    return ERROR_SUCCESS;
}

DWORD APIENTRY OpenSigGenPerformanceData ( LPWSTR lpDeviceNames )

Definition at line 98 of file Perfgen.c.

                   :

    This routine will initialize the data structures used to pass
    data back to the registry

Arguments:

    Pointer to object ID of each device to be opened (PerfGen)

Return Value:

    None.

--*/

{
    LONG  status;
    HKEY  hKeyDriverPerf = NULL;
    DWORD size;
    DWORD type;
    DWORD dwFirstCounter;
    DWORD dwFirstHelp;

    //
    //  Since WINLOGON is multi-threaded and will call this routine in
    //  order to service remote performance queries, this library
    //  must keep track of how many times it has been opened (i.e.
    //  how many threads have accessed it). the registry routines will
    //  limit access to the initialization routine to only one thread
    //  at a time so synchronization (i.e. reentrancy) should not be
    //  a problem
    //

    if (! dwOpenCount) {
        // open Eventlog interface

        hEventLog = MonOpenEventLog();

        // get counter and help index base values from registry
        //      Open key to registry entry
        //      read First Counter and First Help values
        //      update static data strucutures by adding base to
        //          offset value in structure.

        status = RegOpenKeyEx(
                        HKEY_LOCAL_MACHINE,
                        "SYSTEM\\CurrentControlSet\\Services\\PerfGen\\Performance",
                        0L,
                        KEY_READ,
                        & hKeyDriverPerf);
        if (status != ERROR_SUCCESS) {
            REPORT_ERROR_DATA (GENPERF_UNABLE_OPEN_DRIVER_KEY, LOG_USER,
                &status, sizeof(status));
            // this is fatal, if we can't get the base values of the
            // counter or help names, then the names won't be available
            // to the requesting application  so there's not much
            // point in continuing.
            goto OpenExitPoint;
        }

        size = sizeof(DWORD);
        status = RegQueryValueEx(
                        hKeyDriverPerf,
                        "First Counter",
                        0L,
                        & type,
                        (LPBYTE) & dwFirstCounter,
                        & size);
        if (status != ERROR_SUCCESS) {
            REPORT_ERROR_DATA (GENPERF_UNABLE_READ_FIRST_COUNTER, LOG_USER,
                &status, sizeof(status));
            // this is fatal, if we can't get the base values of the
            // counter or help names, then the names won't be available
            // to the requesting application  so there's not much
            // point in continuing.
            goto OpenExitPoint;
        }

        size = sizeof(DWORD);
        status = RegQueryValueEx(
                        hKeyDriverPerf,
                        "First Help",
                        0L,
                        & type,
                        (LPBYTE) & dwFirstHelp,
                        & size);
        if (status != ERROR_SUCCESS) {
            REPORT_ERROR_DATA (GENPERF_UNABLE_READ_FIRST_HELP, LOG_USER,
                &status, sizeof(status));
            // this is fatal, if we can't get the base values of the
            // counter or help names, then the names won't be available
            // to the requesting application  so there's not much
            // point in continuing.
            goto OpenExitPoint;
        }

        //
        //  NOTE: the initialization program could also retrieve
        //      LastCounter and LastHelp if they wanted to do
        //      bounds checking on the new number. e.g.
        //
        //      counter->CounterNameTitleIndex += dwFirstCounter;
        //      if (counter->CounterNameTitleIndex > dwLastCounter) {
        //          LogErrorToEventLog (INDEX_OUT_OF_BOUNDS);
        //      }

        SigGenDataDefinition.SigGenObjectType.ObjectNameTitleIndex  += dwFirstCounter;
        SigGenDataDefinition.SigGenObjectType.ObjectHelpTitleIndex  += dwFirstHelp;

        // assign index of default counter (Sine Wave)
        SigGenDataDefinition.SigGenObjectType.DefaultCounter         = 0;
        SigGenDataDefinition.SineWaveDef.CounterNameTitleIndex      += dwFirstCounter;
        SigGenDataDefinition.SineWaveDef.CounterHelpTitleIndex      += dwFirstHelp;
        SigGenDataDefinition.TriangleWaveDef.CounterNameTitleIndex  += dwFirstCounter;
        SigGenDataDefinition.TriangleWaveDef.CounterHelpTitleIndex  += dwFirstHelp;
        SigGenDataDefinition.SquareWaveDef.CounterNameTitleIndex    += dwFirstCounter;
        SigGenDataDefinition.SquareWaveDef.CounterHelpTitleIndex    += dwFirstHelp;
        SigGenDataDefinition.ConstantValueDef.CounterNameTitleIndex += dwFirstCounter;
        SigGenDataDefinition.ConstantValueDef.CounterHelpTitleIndex += dwFirstHelp;

        bInitOK = TRUE; // ok to use this function
    }

    dwOpenCount ++;  // increment OPEN counter

    status = ERROR_SUCCESS; // for successful exit

OpenExitPoint:
    if (hKeyDriverPerf != NULL) RegCloseKey(hKeyDriverPerf);
    return status;
}

Variable Documentation

BOOL bInitOK = FALSE

Definition at line 46 of file Perfgen.c.

PM_CLOSE_PROC CloseSigGenPerformanceData

Definition at line 57 of file Perfgen.c.

PM_COLLECT_PROC CollectSigGenPerformanceData

Definition at line 56 of file Perfgen.c.

DWORD dwOpenCount = 0

Definition at line 45 of file Perfgen.c.

PM_OPEN_PROC OpenSigGenPerformanceData

Definition at line 55 of file Perfgen.c.

SIGGEN_DATA_DEFINITION SigGenDataDefinition

Definition at line 43 of file DataGen.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/Perfmsg.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen
Defines | Variables

Perfmsg.h File Reference

Go to the source code of this file.

Defines

#define | APP_NAME "perfgen"
#define | LOG_DEBUG 2
#define | LOG_NONE 0
#define | LOG_USER 1
#define | LOG_VERBOSE 3
#define | MESSAGE_LEVEL_DEFAULT LOG_USER
#define | REPORT_ERROR(i, l)
#define | REPORT_ERROR_DATA(i, l, d, s)
#define | REPORT_INFORMATION(i, l)
#define | REPORT_INFORMATION_DATA(i, l, d, s)
#define | REPORT_SUCCESS(i, l)
#define | REPORT_WARNING(i, l)
#define | REPORT_WARNING_DATA(i, l, d, s)

Variables

DWORD dwLogUsers
HANDLE hEventLog
DWORD MESSAGE_LEVEL

Define Documentation

#define APP_NAME "perfgen"

Definition at line 28 of file Perfmsg.h.

#define LOG_DEBUG 2

Definition at line 47 of file Perfmsg.h.

#define LOG_NONE 0

Definition at line 45 of file Perfmsg.h.

#define LOG_USER 1

Definition at line 46 of file Perfmsg.h.

#define LOG_VERBOSE 3

Definition at line 48 of file Perfmsg.h.

#define MESSAGE_LEVEL_DEFAULT LOG_USER

Definition at line 50 of file Perfmsg.h.

#define REPORT_ERROR | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 87 of file Perfmsg.h.

#define REPORT_ERROR_DATA | ( | i,
 |  | l,
 |  | d,
 |  | s
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
   0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)

Definition at line 96 of file Perfmsg.h.

#define REPORT_INFORMATION | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 81 of file Perfmsg.h.

#define REPORT_INFORMATION_DATA | ( | i,
 |  | l,
 |  | d,
 |  | s
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
   0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)

Definition at line 90 of file Perfmsg.h.

#define REPORT_SUCCESS | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 78 of file Perfmsg.h.

#define REPORT_WARNING | ( | i,
 |  | l
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
   0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)

Definition at line 84 of file Perfmsg.h.

#define REPORT_WARNING_DATA | ( | i,
 |  | l,
 |  | d,
 |  | s
 | ) |
Value:
(MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
   0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)

Definition at line 93 of file Perfmsg.h.

Variable Documentation

DWORD dwLogUsers

Definition at line 41 of file PerfUtil.c.

HANDLE hEventLog

Definition at line 40 of file PerfUtil.c.

DWORD MESSAGE_LEVEL

Definition at line 42 of file PerfUtil.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/PerfUtil.c File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen
Defines | Functions | Variables

PerfUtil.c File Reference

#include <windows.h>
#include <string.h>
#include <winperf.h>
#include "genctrs.h"
#include "perfmsg.h"
#include "perfutil.h"

Go to the source code of this file.

Defines

#define | DELIMITER 2
#define | DIGIT 1
#define | EvalThisChar(c, d)
#define | INVALID 3

Functions

DWORD | GetQueryType (IN LPWSTR lpValue)
BOOL | IsNumberInUnicodeList (IN DWORD dwNumber, IN LPWSTR lpwszUnicodeList)
BOOL | MonBuildInstanceDefinition (PERF_INSTANCE_DEFINITION *pBuffer, PVOID *pBufferNext, DWORD ParentObjectTitleIndex, DWORD ParentObjectInstance, DWORD UniqueID, LPWSTR Name)
VOID | MonCloseEventLog ()
HANDLE MonOpenEventLog ()

Variables

WCHAR | COSTLY_STRING [] = "Costly"
DWORD | dwLogUsers = 0
WCHAR | FOREIGN_STRING [] = "Foreign"
WCHAR | GLOBAL_STRING [] = "Global"
HANDLE | hEventLog = NULL
DWORD | MESSAGE_LEVEL = 0
WCHAR | NULL_STRING [] = "\0"
ULONG | ulInfoBufferSize = 0

Define Documentation

#define DELIMITER 2

Definition at line 54 of file PerfUtil.c.

#define DIGIT 1

Definition at line 53 of file PerfUtil.c.

#define EvalThisChar | ( | c,
 |  | d
 | ) |
Value:
( \
     (c == d) ? DELIMITER : \
     (c == 0) ? DELIMITER : \
     (c < (WCHAR)'0') ? INVALID : \
     (c > (WCHAR)'9') ? INVALID : \
     DIGIT)

Definition at line 57 of file PerfUtil.c.

#define INVALID 3

Definition at line 55 of file PerfUtil.c.

Function Documentation

DWORD GetQueryType ( IN LPWSTR lpValue )

Definition at line 167 of file PerfUtil.c.

             :

    QUERY_ITEMS

--*/
{
    WCHAR   * pwcArgChar, * pwcTypeChar;
    BOOL    bFound;

    if (lpValue == 0) {
        return QUERY_GLOBAL;
    } else if (*lpValue == 0) {
        return QUERY_GLOBAL;
    }

    // check for "Global" request

    pwcArgChar  = lpValue;
    pwcTypeChar = GLOBAL_STRING;
    bFound = TRUE;  // assume found until contradicted

    // check to the length of the shortest string

    while ((* pwcArgChar != 0) && (* pwcTypeChar != 0)) {
        if (* pwcArgChar ++ != * pwcTypeChar ++) {
            bFound = FALSE; // no match
            break;          // bail out now
        }
    }

    if (bFound) return QUERY_GLOBAL;

    // check for "Foreign" request

    pwcArgChar  = lpValue;
    pwcTypeChar = FOREIGN_STRING;
    bFound      = TRUE;  // assume found until contradicted

    // check to the length of the shortest string

    while ((* pwcArgChar != 0) && (* pwcTypeChar != 0)) {
        if (* pwcArgChar ++ != * pwcTypeChar ++) {
            bFound = FALSE; // no match
            break;          // bail out now
        }
    }

    if (bFound) return QUERY_FOREIGN;

    // check for "Costly" request

    pwcArgChar  = lpValue;
    pwcTypeChar = COSTLY_STRING;
    bFound      = TRUE;  // assume found until contradicted

    // check to the length of the shortest string

    while ((* pwcArgChar != 0) && (* pwcTypeChar != 0)) {
        if (* pwcArgChar ++ != * pwcTypeChar ++) {
            bFound = FALSE; // no match
            break;          // bail out now
        }
    }

    if (bFound) return QUERY_COSTLY;

    // if not Global and not Foreign and not Costly,
    // then it must be an item list

    return QUERY_ITEMS;

}

BOOL IsNumberInUnicodeList | ( | IN DWORD | dwNumber,
 |  | IN LPWSTR | lpwszUnicodeList
 | ) |  |

Definition at line 269 of file PerfUtil.c.

         :

    IN dwNumber
        DWORD number to find in list

    IN lpwszUnicodeList
        Null terminated, Space delimited list of decimal numbers

Return Value:

    TRUE:
            dwNumber was found in the list of unicode number strings

    FALSE:
            dwNumber was not found in the list.

--*/
{
    DWORD   dwThisNumber;
    WCHAR   *pwcThisChar;
    BOOL    bValidNumber;
    BOOL    bNewItem;
    WCHAR   wcDelimiter;    // could be an argument to be more flexible

    if (lpwszUnicodeList == 0) return FALSE;    // null pointer, # not founde

    pwcThisChar  = lpwszUnicodeList;
    dwThisNumber = 0;
    wcDelimiter  = (WCHAR)' ';
    bValidNumber = FALSE;
    bNewItem     = TRUE;

    while (TRUE) {
        switch (EvalThisChar (*pwcThisChar, wcDelimiter)) {
            case DIGIT:
                // if this is the first digit after a delimiter, then
                // set flags to start computing the new number
                if (bNewItem) {
                    bNewItem     = FALSE;
                    bValidNumber = TRUE;
                }
                if (bValidNumber) {
                    dwThisNumber *= 10;
                    dwThisNumber += (* pwcThisChar - (WCHAR) '0');
                }
                break;

            case DELIMITER:
                // a delimter is either the delimiter character or the
                // end of the string ('\0') if when the delimiter has been
                // reached a valid number was found, then compare it to the
                // number from the argument list. if this is the end of the
                // string and no match was found, then return.
                //
                if (bValidNumber) {
                    if (dwThisNumber == dwNumber) return TRUE;
                    bValidNumber = FALSE;
                }
                if (* pwcThisChar == 0) {
                    return FALSE;
                } else {
                    bNewItem     = TRUE;
                    dwThisNumber = 0;
                }
                break;

            case INVALID:
                // if an invalid character was encountered, ignore all
                // characters up to the next delimiter and then start fresh.
                // the invalid number is not compared.
                bValidNumber = FALSE;
                break;

            default:
                break;

        }
        pwcThisChar++;
    }
    return FALSE;
}   // IsNumberInUnicodeList

BOOL MonBuildInstanceDefinition | ( | PERF_INSTANCE_DEFINITION * | pBuffer,
 |  | PVOID * | pBufferNext,
 |  | DWORD | ParentObjectTitleIndex,
 |  | DWORD | ParentObjectInstance,
 |  | DWORD | UniqueID,
 |  | LPWSTR | Name
 | ) |  |

Definition at line 360 of file PerfUtil.c.

              :

            pBuffer         -   pointer to buffer where instance is to
                                be constructed

            pBufferNext     -   pointer to a pointer which will contain
                                next available location, DWORD aligned

            ParentObjectTitleIndex
                            -   Title Index of parent object type; 0 if
                                no parent object

            ParentObjectInstance
                            -   Index into instances of parent object
                                type, starting at 0, for this instances
                                parent object instance

            UniqueID        -   a unique identifier which should be used
                                instead of the Name for identifying
                                this instance

            Name            -   Name of this instance
--*/
{
    DWORD NameLength;
    LPWSTR pName;
    //
    //  Include trailing null in name size
    //

    NameLength                      = (lstrlenW(Name) + 1) * sizeof(WCHAR);
    pBuffer->ByteLength             = sizeof(PERF_INSTANCE_DEFINITION) + DWORD_MULTIPLE(NameLength);
    pBuffer->ParentObjectTitleIndex = ParentObjectTitleIndex;
    pBuffer->ParentObjectInstance   = ParentObjectInstance;
    pBuffer->UniqueID               = UniqueID;
    pBuffer->NameOffset             = sizeof(PERF_INSTANCE_DEFINITION);
    pBuffer->NameLength             = NameLength;

    // copy name to name buffer
    pName = (LPWSTR) & pBuffer[1];
    RtlMoveMemory(pName, Name, NameLength);

    // update "next byte" pointer
    * pBufferNext = (PVOID) ((PCHAR) pBuffer + pBuffer->ByteLength);

    return 0;
}

VOID MonCloseEventLog ( )

Definition at line 139 of file PerfUtil.c.

                   :

      Closes the handle to the event logger if this is the last caller

Arguments:

      None

Return Value:

      None

--*/
{
    if (hEventLog != NULL) {
        dwLogUsers --;            // decrement usage
        if (dwLogUsers <= 0) {    // and if we're the last, then close up log
            REPORT_INFORMATION(UTIL_CLOSING_LOG, LOG_DEBUG);
            DeregisterEventSource(hEventLog);
        }
    }
}

HANDLE MonOpenEventLog ( )

Definition at line 65 of file PerfUtil.c.

                   :

    Reads the level of event logging from the registry and opens the
        channel to the event logger for subsequent event log entries.

Arguments:

      None

Return Value:

    Handle to the event log for reporting events.
    NULL if open not successful.

--*/
{
    HKEY hAppKey;
    TCHAR LogLevelKeyName[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib";
    TCHAR LogLevelValueName[] = "EventLogLevel";

    LONG lStatus;

    DWORD dwLogLevel;
    DWORD dwValueType;
    DWORD dwValueSize;

    // if global value of the logging level not initialized or is disabled,
    //  check the registry to see if it should be updated.

    if (!MESSAGE_LEVEL) {
       lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
                              LogLevelKeyName,
                              0,
                              KEY_READ,
                              & hAppKey);
       if (lStatus == ERROR_SUCCESS) {
            dwValueSize = sizeof(dwLogLevel);
            lStatus     = RegQueryValueEx(hAppKey,
                                          LogLevelValueName,
                                          (LPDWORD) NULL,
                                          & dwValueType,
                                          (LPBYTE) & dwLogLevel,
                                          & dwValueSize);
            if (lStatus == ERROR_SUCCESS) {
               MESSAGE_LEVEL = dwLogLevel;
            } else {
               MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
            }
            RegCloseKey(hAppKey);
       } else {
         MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
       }
    }

    if (hEventLog == NULL){
         hEventLog = RegisterEventSource(
                         (LPTSTR) NULL,            // Use Local Machine
                         APP_NAME);                // event log app name to find in registry
         if (hEventLog != NULL) {
            REPORT_INFORMATION (UTIL_LOG_OPEN, LOG_DEBUG);
         }
    }

    if (hEventLog != NULL) {
         dwLogUsers++;           // increment count of perfctr log users
    }
    return (hEventLog);
}

Variable Documentation

WCHAR COSTLY_STRING[] = "Costly"

Definition at line 46 of file PerfUtil.c.

DWORD dwLogUsers = 0

Definition at line 40 of file PerfUtil.c.

WCHAR FOREIGN_STRING[] = "Foreign"

Definition at line 45 of file PerfUtil.c.

WCHAR GLOBAL_STRING[] = "Global"

Definition at line 44 of file PerfUtil.c.

HANDLE hEventLog = NULL

Definition at line 38 of file PerfUtil.c.

DWORD MESSAGE_LEVEL = 0

Definition at line 42 of file PerfUtil.c.

WCHAR NULL_STRING[] = "\0"

Definition at line 48 of file PerfUtil.c.

ULONG ulInfoBufferSize = 0

Definition at line 36 of file PerfUtil.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/PerfUtil.h File Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen
Classes | Defines | Typedefs | Functions | Variables

PerfUtil.h File Reference

Go to the source code of this file.

Classes

struct | _LOCAL_HEAP_INFO_BLOCK

Defines

#define | ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))
#define | DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))
#define | HEAP_PROBE() ;
#define | QUERY_COSTLY 4
#define | QUERY_FOREIGN 3
#define | QUERY_GLOBAL 1
#define | QUERY_ITEMS 2

Typedefs

typedef struct
_LOCAL_HEAP_INFO_BLOCK 		LOCAL_HEAP_INFO
typedef struct
_LOCAL_HEAP_INFO_BLOCK * 		PLOCAL_HEAP_INFO

Functions

DWORD | GetQueryType (IN LPWSTR)
BOOL | IsNumberInUnicodeList (DWORD, LPWSTR)
BOOL | MonBuildInstanceDefinition (PERF_INSTANCE_DEFINITION *pBuffer, PVOID *pBufferNext, DWORD ParentObjectTitleIndex, DWORD ParentObjectInstance, DWORD UniqueID, LPWSTR Name)
VOID | MonCloseEventLog ()
HANDLE MonOpenEventLog ()

Variables

WCHAR | COSTLY_STRING []
WCHAR | FOREIGN_STRING []
WCHAR | GLOBAL_STRING []
WCHAR | NULL_STRING []

Define Documentation

#define ALIGN_ON_DWORD ( x ) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))

Definition at line 39 of file PerfUtil.h.

#define DWORD_MULTIPLE ( x ) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))

Definition at line 36 of file PerfUtil.h.

#define HEAP_PROBE ( ) ;

Definition at line 100 of file PerfUtil.h.

#define QUERY_COSTLY 4

Definition at line 49 of file PerfUtil.h.

#define QUERY_FOREIGN 3

Definition at line 48 of file PerfUtil.h.

#define QUERY_GLOBAL 1

Definition at line 46 of file PerfUtil.h.

#define QUERY_ITEMS 2

Definition at line 47 of file PerfUtil.h.

Typedef Documentation

typedef struct _LOCAL_HEAP_INFO_BLOCK LOCAL_HEAP_INFO
typedef struct _LOCAL_HEAP_INFO_BLOCK * PLOCAL_HEAP_INFO

Function Documentation

DWORD GetQueryType ( IN LPWSTR )

Definition at line 239 of file PerfUtil.c.

             :

    QUERY_ITEMS

--*/
{
   WCHAR   *pwcArgChar, *pwcTypeChar;
   BOOL    bFound;

   if (lpValue == 0)
   {
      return QUERY_GLOBAL;
   }
   else if (* lpValue == 0)
   {
      return QUERY_GLOBAL;
   }

   // check for "Global" request

   pwcArgChar  = lpValue;
   pwcTypeChar = GLOBAL_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_GLOBAL;

   // check for "Foreign" request

   pwcArgChar  = lpValue;
   pwcTypeChar = FOREIGN_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_FOREIGN;

   // check for "Costly" request

   pwcArgChar  = lpValue;
   pwcTypeChar = COSTLY_STRING;
   bFound      = TRUE;  // assume found until contradicted

   // check to the length of the shortest string

   while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
   {
      if (* pwcArgChar ++ != * pwcTypeChar ++)
      {
         bFound = FALSE; // no match
         break;          // bail out now
      }
   }

   if (bFound) return QUERY_COSTLY;

   // if not Global and not Foreign and not Costly,
   // then it must be an item list

   return QUERY_ITEMS;
}

BOOL IsNumberInUnicodeList | ( | DWORD | ,
 |  | LPWSTR |
 | ) |  |
BOOL MonBuildInstanceDefinition | ( | PERF_INSTANCE_DEFINITION * | pBuffer,
 |  | PVOID * | pBufferNext,
 |  | DWORD | ParentObjectTitleIndex,
 |  | DWORD | ParentObjectInstance,
 |  | DWORD | UniqueID,
 |  | LPWSTR | Name
 | ) |  |

Definition at line 63 of file PerfUtil.c.

              :

            pBuffer         -   pointer to buffer where instance is to
                                be constructed

            pBufferNext     -   pointer to a pointer which will contain
                                next available location, DWORD aligned

            ParentObjectTitleIndex
                            -   Title Index of parent object type; 0 if
                                no parent object

            ParentObjectInstance
                            -   Index into instances of parent object
                                type, starting at 0, for this instances
                                parent object instance

            UniqueID        -   a unique identifier which should be used
                                instead of the Name for identifying
                                this instance

            Name            -   Name of this instance
--*/
{
   DWORD NameLength = 0;
   WCHAR * pName;

   //
   //  Include trailing null in name size
   //

   NameLength = lstrlenW(Name) * sizeof(WCHAR);
   if (NameLength > 0)
   {
      NameLength += sizeof(WCHAR); // to include the terminating NULL
   }

   pBuffer->ByteLength             = sizeof(PERF_INSTANCE_DEFINITION) + DWORD_MULTIPLE(NameLength);
   pBuffer->ParentObjectTitleIndex = ParentObjectTitleIndex;
   pBuffer->ParentObjectInstance   = ParentObjectInstance;
   pBuffer->UniqueID               = UniqueID;
   pBuffer->NameOffset             = sizeof(PERF_INSTANCE_DEFINITION);
   pBuffer->NameLength             = NameLength;
   pName = (PWCHAR) & pBuffer[1];
   lstrcpynW(pName, Name, lstrlenW(Name) + 1);

   * pBufferNext = (PVOID) ((PCHAR) pBuffer + pBuffer->ByteLength);
   return TRUE;
}

VOID MonCloseEventLog ( )

Definition at line 209 of file PerfUtil.c.

                   :

      Closes the handle to the event logger if this is the last caller

Arguments:

      None

Return Value:

      None

--*/
{
   if (hEventLog != NULL)
   {
      dwLogUsers --;         // decrement usage
      if (dwLogUsers <= 0)
      {    // and if we're the last, then close up log
         REPORT_INFORMATION(UTIL_CLOSING_LOG, LOG_DEBUG);
         DeregisterEventSource(hEventLog);
      }
   }
}

HANDLE MonOpenEventLog ( )

Definition at line 126 of file PerfUtil.c.

                   :

    Reads the level of event logging from the registry and opens the
        channel to the event logger for subsequent event log entries.

Arguments:

      None

Return Value:

    Handle to the event log for reporting events.
    NULL if open not successful.

--*/
{
   HKEY  hAppKey;
   CHAR  LogLevelKeyName[]   = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib";
   CHAR  LogLevelValueName[] = "EventLogLevel";
   LONG  lStatus;
   DWORD dwLogLevel;
   DWORD dwValueType;
   DWORD dwValueSize;

   // if global value of the logging level not initialized or is disabled,
   //  check the registry to see if it should be updated.

   if (! MESSAGE_LEVEL)
   {

      lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
                             LogLevelKeyName,
                             0,
                             KEY_READ,
                             & hAppKey);
      if (lStatus == ERROR_SUCCESS)
      {
         dwValueSize = sizeof(dwLogLevel);
         lStatus = RegQueryValueEx(hAppKey,
                                   LogLevelValueName,
                                   (LPDWORD) NULL,
                                   & dwValueType,
                                   (LPBYTE) & dwLogLevel,
                                   & dwValueSize);
         if (lStatus == ERROR_SUCCESS)
         {
            MESSAGE_LEVEL = dwLogLevel;
         }
         else
         {
            MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
         }
         RegCloseKey(hAppKey);
      }
      else
      {
         MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
      }
   }

   if (hEventLog == NULL)
   {
      hEventLog = RegisterEventSource(
                                     (LPTSTR) NULL, // Use Local Machine
                                     APP_NAME);     // event log app name to find in registry
      if (hEventLog != NULL)
      {
         REPORT_INFORMATION(UTIL_LOG_OPEN, LOG_DEBUG);
      }
   }

   if (hEventLog != NULL)
   {
      dwLogUsers ++; // increment count of perfctr log users
   }
   return (hEventLog);
}

Variable Documentation

WCHAR COSTLY_STRING[]

Definition at line 45 of file PerfUtil.c.

WCHAR FOREIGN_STRING[]

Definition at line 44 of file PerfUtil.c.

WCHAR GLOBAL_STRING[]

Definition at line 43 of file PerfUtil.c.

WCHAR NULL_STRING[]

Definition at line 46 of file PerfUtil.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/Client/SysInf_C.c File Reference

  • WinBase
  • WtsApi
  • TSSysInf
  • Client
Defines | Functions

SysInf_C.c File Reference

#include "sysinfo.h"

Go to the source code of this file.

Defines

#define | TSDLL

Functions

void | DisplayError (LPTSTR pszAPI)
BOOL WINAPI | DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
void | GetMemoryInfo (void)
void | GetVersionInfo (void)
BOOL VCAPITYPE | VirtualChannelEntry (PCHANNEL_ENTRY_POINTS pEntryPoints)
VOID VCAPITYPE | VirtualChannelInitEventProc (LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength)
void WINAPI | VirtualChannelOpenEvent (DWORD openHandle, UINT event, LPVOID pdata, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags)
void | WaitForTheWrite (HANDLE hEvent)
void WINAPI | WorkerThread (void)

Define Documentation

#define TSDLL

Definition at line 27 of file SysInf_C.c.

Function Documentation

void DisplayError ( LPTSTR pszAPI )

Definition at line 32 of file SysInf_C.c.

{
    int    i;
    LPVOID lpvMessageBuffer;
    TCHAR  buffer[256] = TEXT("");
    DWORD  lastErr;

    lastErr = GetLastError();

    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                  NULL, lastErr,
                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
                  (LPTSTR)&lpvMessageBuffer, 0, NULL);

    //
    //... now display this string
    //
    i = wsprintf(buffer,      TEXT("SYSINF_C ERROR: API        = %s.\n"), pszAPI);
    i += wsprintf(buffer + i, TEXT("                error code = %u.\n"), lastErr);
    wsprintf(buffer + i,      TEXT("                message    = %s.\n"), (LPTSTR)lpvMessageBuffer);

    OutputDebugString(buffer);

    //
    // Free the buffer allocated by the system
    //
    LocalFree(lpvMessageBuffer);
}

BOOL WINAPI DllMain | ( | HINSTANCE | hinstDLL,
 |  | DWORD | fdwReason,
 |  | LPVOID | lpvReserved
 | ) |  |

Definition at line 62 of file SysInf_C.c.

{
UNREFERENCED_PARAMETER(lpvReserved);
UNREFERENCED_PARAMETER(hinstDLL);

    switch(fdwReason)
    {
        case DLL_PROCESS_ATTACH:
            OutputDebugString(TEXT("SYSINF_C: process attach\n"));
            break;

        case DLL_THREAD_ATTACH:
            OutputDebugString(TEXT("SYSINF_C: thread attach\n"));
            break;

        case DLL_THREAD_DETACH:
            OutputDebugString(TEXT("SYSINF_C: thread detach\n"));
            break;

        case DLL_PROCESS_DETACH:
            OutputDebugString(TEXT("SYSINF_C: process detach\n"));
            break;

        default:
            OutputDebugString(TEXT("SYSINF_C: Unknown reason in DllMain\n"));
            break;
    }
    return TRUE;
}

void GetMemoryInfo ( void )

Definition at line 102 of file SysInf_C.c.

{
    DWORD        dwControlCode = TSMEMORYINFO;
    MEMORYSTATUS ms;
    UINT         ui;

    OutputDebugString(TEXT("SYSINF_C: worker thread get memory info\n"));

    GlobalMemoryStatus(&ms);

    //
    // write memory info to channel
    //
    ui = gpEntryPoints->pVirtualChannelWrite(gdwOpenChannel,
                                             (LPVOID)&ms,
                                             sizeof(ms),
                                             (LPVOID)&dwControlCode);
    if (ui != CHANNEL_RC_OK)
        OutputDebugString(TEXT("SYSINF_C: worker thread VirtualChannelWrite failed\n"));

    //
    // wait for the write to complete
    //
    WaitForTheWrite(ghWriteEvent);
}

void GetVersionInfo ( void )

Definition at line 129 of file SysInf_C.c.

{
    TS_VERSION_INFO tsvi;
    OSVERSIONINFO   osvi;
    UINT            ui;
    DWORD           dwControlCode = TSVERSIONINFO;
    SYSTEM_INFO     si;
    TCHAR           szUserName[UNLEN+1];
    TCHAR           szComputerName[MAX_COMPUTERNAME_LENGTH+1];
    DWORD           dwSize;

    OutputDebugString(TEXT("SYSINF_C: worker thread get version info\n"));

    //
    // obtain version info
    //
    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

    if (!GetVersionEx(&osvi))
        DisplayError(TEXT("GetVersionEx"));

    ZeroMemory(&tsvi, sizeof(tsvi));
    tsvi.osvi = osvi;

    //
    // get the client name
    //
    strcpy(tsvi.szClientName, gszClientName);

    //
    // get the computer name
    //
    dwSize = sizeof(szComputerName);
    ZeroMemory(szComputerName, dwSize);

    if (!GetComputerName(szComputerName, &dwSize))
        DisplayError(TEXT("GetComputerName"));

    lstrcpy(tsvi.szComputerName, szComputerName);

    //
    // get system info
    //
    GetSystemInfo(&si);

    tsvi.si = si;

    //
    // get user name
    //
    dwSize = sizeof(szUserName);
    if (!GetUserName(szUserName, &dwSize))
        DisplayError(TEXT("GetUserName"));

    lstrcpy(tsvi.szUserName, szUserName);

    //
    // write memory info to channel
    //
    ui = gpEntryPoints->pVirtualChannelWrite(gdwOpenChannel,
                                             (LPVOID)&tsvi,
                                             sizeof(tsvi),
                                             (LPVOID)&dwControlCode);
    if (ui != CHANNEL_RC_OK)
        OutputDebugString(TEXT("SYSINF_C: worker thread VirtualChannelWrite failed\n"));

    //
    // wait for the write to complete
    //
    WaitForTheWrite(ghWriteEvent);
}

BOOL VCAPITYPE VirtualChannelEntry ( PCHANNEL_ENTRY_POINTS pEntryPoints )

Definition at line 501 of file SysInf_C.c.

{
    CHANNEL_DEF cd;
    UINT        uRet;

    OutputDebugString(TEXT("SYSINF_C: virtualchannelentry called\n"));

    //
    // allocate memory
    //
    gpEntryPoints = LocalAlloc(LPTR, pEntryPoints->cbSize);
    if (gpEntryPoints == NULL)
        DisplayError(TEXT("LocalAlloc"));

    memcpy(gpEntryPoints, pEntryPoints, pEntryPoints->cbSize);

    //
    // initialize global
    //
    //gpEntryPoints = pEntryPoints;

    //
    // initialize CHANNEL_DEF structure
    //
    ZeroMemory(&cd, sizeof(CHANNEL_DEF));
    strcpy(cd.name, CHANNELNAME); // ANSI ONLY

    //
    // register channel
    //
    uRet = gpEntryPoints->pVirtualChannelInit((LPVOID *)&gphChannel,
                                              (PCHANNEL_DEF)&cd, 1,
                                              VIRTUAL_CHANNEL_VERSION_WIN2000,
                                              (PCHANNEL_INIT_EVENT_FN)VirtualChannelInitEventProc);
    if (uRet != CHANNEL_RC_OK)
        return FALSE;

    //
    // make sure channel was initialized
    //
    if (cd.options != CHANNEL_OPTION_INITIALIZED)
        return FALSE;

    return TRUE;
}

VOID VCAPITYPE VirtualChannelInitEventProc | ( | LPVOID | pInitHandle,
 |  | UINT | event,
 |  | LPVOID | pData,
 |  | UINT | dataLength
 | ) |  |

Definition at line 345 of file SysInf_C.c.

{
    DWORD dwThreadId;
    UINT  ui;

    UNREFERENCED_PARAMETER(pInitHandle);
    UNREFERENCED_PARAMETER(dataLength);

    switch(event)
    {
        case CHANNEL_EVENT_INITIALIZED:
        {
            OutputDebugString(TEXT("SYSINF_C: channel initialized\n"));
        }
        break;

        case CHANNEL_EVENT_CONNECTED:
        {
            //
            // save client machine
            //
            ZeroMemory(gszClientName, sizeof(gszClientName));
            strcpy(gszClientName, (LPSTR)pData);

            OutputDebugString(TEXT("SYSINF_C: channel connected\n"));

            //
            // open channel
            //
            ui = gpEntryPoints->pVirtualChannelOpen(gphChannel,
                                                    &gdwOpenChannel,
                                                    CHANNELNAME,
                                                    (PCHANNEL_OPEN_EVENT_FN)VirtualChannelOpenEvent);
            if (ui != CHANNEL_RC_OK){
                OutputDebugString(TEXT("SYSINF_C: virtual channel open failed\n"));
                return;
            }

            //
            // create write completion event
            //
            ghWriteEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
            if (ghWriteEvent == NULL)
                DisplayError(TEXT("CreateEvent"));

            //
            // create thread wakeup event
            //
            ghAlertThread = CreateEvent(NULL, FALSE, FALSE, NULL);
            if (ghAlertThread == NULL)
                DisplayError(TEXT("CreateEvent"));

            //
            // create thread stop event
            //
            ghStopThread = CreateEvent(NULL, FALSE, FALSE, NULL);
            if (ghStopThread == NULL)
                DisplayError(TEXT("CreateEvent"));

            //
            // create thread synch event
            //
            ghSynchCodeEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
            if (ghSynchCodeEvent == NULL)
                DisplayError(TEXT("CreateEvent"));

            //
            // spawn the worker thread
            //
            ghThread = CreateThread(NULL,
                                    0,
                                    (LPTHREAD_START_ROUTINE)WorkerThread,
                                    NULL,
                                    0,
                                    &dwThreadId);
            if (ghThread == NULL)
                DisplayError(TEXT("CreateThread"));
        }
        break;

        case CHANNEL_EVENT_V1_CONNECTED:
        {
            OutputDebugString(TEXT("SYSINF_C: v1 connected\n"));
            MessageBox(NULL,
                       TEXT("Connecting to a non Windows 2000 Terminal Server"),
                       TEXT("sysinf_c.dll"),
                       MB_OK);
        }
        break;

        case CHANNEL_EVENT_DISCONNECTED:
        {
            DWORD dw;

            OutputDebugString(TEXT("SYSINF_C: disconnected\n"));

            //
            // signal worker thread to end
            //
            if (!SetEvent(ghStopThread))
                DisplayError(TEXT("SetEvent"));

            //
            // wait for thread to die
            //
            dw = WaitForSingleObject(ghThread, 5000);

            switch(dw)
            {
                case WAIT_TIMEOUT:
                    //
                    // blow away thread since time expired
                    //
                    OutputDebugString(TEXT("SYSINF_C: blowing away worker thread\n"));
                    if (!TerminateThread(ghThread, 0))
                        DisplayError(TEXT("TerminateThread"));
                    break;

                case WAIT_FAILED:
                    DisplayError(TEXT("WaitForSingleObject"));
                    break;
                default:
                    break;
            }

            OutputDebugString(TEXT("SYSINF_C: worker thread terminated\n"));

            //
            // close handles
            //
            CloseHandle(ghStopThread);
            CloseHandle(ghAlertThread);
            CloseHandle(ghWriteEvent);
            CloseHandle(ghSynchCodeEvent);
        }
        break;

        case CHANNEL_EVENT_TERMINATED:
        {
            OutputDebugString(TEXT("SYSINF_C: client terminated\n"));
            //
            // free the entry points table
            //
            LocalFree((HLOCAL)gpEntryPoints);
        }
        break;

        default:
        {
            OutputDebugString(TEXT("SYSINF_C: unrecognized init event\n"));
        }
        break;
    }
}

void WINAPI VirtualChannelOpenEvent | ( | DWORD | openHandle,
 |  | UINT | event,
 |  | LPVOID | pdata,
 |  | UINT32 | dataLength,
 |  | UINT32 | totalLength,
 |  | UINT32 | dataFlags
 | ) |  |

Definition at line 265 of file SysInf_C.c.

{
    LPDWORD pdwControlCode = (LPDWORD)pdata;

    UNREFERENCED_PARAMETER(openHandle);
    UNREFERENCED_PARAMETER(dataFlags);

    if (dataLength == totalLength){
        switch(event)
        {
            case CHANNEL_EVENT_DATA_RECEIVED:
            {
                //
                // initialize
                //
                gdwControlCode = *pdwControlCode;

                //
                // initiate a write
                //
                if (!SetEvent(ghAlertThread))
                    DisplayError(TEXT("SetEvent"));
                else
                    OutputDebugString(TEXT("SYSINF_C: signal to wake up thread\n"));

                //
                // wait for worker thread to read control
                //
                if (WaitForSingleObject(ghSynchCodeEvent, INFINITE) == WAIT_FAILED)
                    DisplayError(TEXT("WaitForSingleObject"));
            }
            break;

            case CHANNEL_EVENT_WRITE_COMPLETE:
            {
                switch (*pdwControlCode)
                {
                    case TSMEMORYINFO:
                        OutputDebugString(TEXT("SYSINF_C: write completed for memory info\n"));
                        break;

                    case TSVERSIONINFO:
                        OutputDebugString(TEXT("SYSINF_C: write completed for version info\n"));
                        break;

                    default:
                        OutputDebugString(TEXT("SYSINF_C: write completed for UNKNOWN\n"));
                        break;
                }

                //
                // set event to notify write is complete
                //
                if (!SetEvent(ghWriteEvent))
                    DisplayError(TEXT("SetEvent"));
            }
            break;

            case CHANNEL_EVENT_WRITE_CANCELLED:
            {
                //
                // set event to notify write is complete since write was cancelled
                //
                if (!SetEvent(ghWriteEvent))
                    DisplayError(TEXT("SetEvent"));
            }
            break;

            default:
            {
                OutputDebugString(TEXT("SYSINF_C: unrecognized open event\n"));
            }
            break;
        }
    }
    else
        OutputDebugString(TEXT("SYSINF_C: data is broken up\n"));
}

void WaitForTheWrite ( HANDLE hEvent )

Definition at line 93 of file SysInf_C.c.

{
    OutputDebugString(TEXT("SYSINF_C: worker thread waiting for write to complete\n"));

    if (!WaitForSingleObject(hEvent, INFINITE) == WAIT_FAILED)
        DisplayError(TEXT("WaitForSingleObject"));
}

void WINAPI WorkerThread ( void )

Definition at line 202 of file SysInf_C.c.

{
    DWORD  dw;
    DWORD  dwControlCode;
    HANDLE hEventConnect[2]; // 0 stop, 1 alert
    BOOL   bDone = FALSE;

    hEventConnect[0] = ghStopThread;
    hEventConnect[1] = ghAlertThread;

    while( !bDone ) {

        OutputDebugString(TEXT("SYSINF_C: worker thread waiting...\n"));

        dw = WaitForMultipleObjects(2, hEventConnect, FALSE, INFINITE);

        switch(dw)
        {
            case WAIT_FAILED:
            {
                DisplayError(TEXT("WaitForMultipleObjects"));
            }
            break;

            case WAIT_OBJECT_0:
            {
                bDone = TRUE;
            }
            break;

            case WAIT_OBJECT_0 + 1:
            {
                OutputDebugString(TEXT("SYSINF_C: worker thread wakeup\n"));

                dwControlCode = gdwControlCode;

                //
                // signal
                //
                if (!SetEvent(ghSynchCodeEvent))
                    DisplayError(TEXT("SetEvent"));

                if (dwControlCode == TSMEMORYINFO)
                    GetMemoryInfo();
                else
                    GetVersionInfo();
            }
            break;

            default:
            {
                OutputDebugString(TEXT("SYSINF_C: worker thread - unknown wait rc\n"));
            }
            break;
        }
    }

    OutputDebugString(TEXT("SYSINF_C: worker thread ending\n"));

    ExitThread(0);
}

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/Inc/SysInfo.h File Reference

  • WinBase
  • WtsApi
  • TSSysInf
  • Inc
Classes | Defines | Functions | Variables

SysInfo.h File Reference

#include <windows.h>
#include <stdio.h>
#include <wtsapi32.h>
#include <tchar.h>
#include <lmcons.h>

Go to the source code of this file.

Classes

struct | TS_VERSION_INFO

Defines

#define _
#define | CHANNELNAME "sysinfo"
#define | QUERY_INTERVAL 2000
#define | STRICT
#define | TSMEMORYINFO 1
#define | TSVERSIONINFO 0

Functions

void | DisplayError (LPTSTR pszAPI)
BOOL WINAPI | HandlerRoutine (DWORD dwCtrlType)

Variables

HANDLE ghEventEnd

Define Documentation

#define _

Definition at line 24 of file SysInfo.h.

#define CHANNELNAME "sysinfo"

Definition at line 48 of file SysInfo.h.

#define QUERY_INTERVAL 2000

Definition at line 51 of file SysInfo.h.

#define STRICT

Definition at line 23 of file SysInfo.h.

#define TSMEMORYINFO 1

Definition at line 50 of file SysInfo.h.

#define TSVERSIONINFO 0

Definition at line 49 of file SysInfo.h.

Function Documentation

void DisplayError ( LPTSTR pszAPI )

Definition at line 32 of file SysInf_C.c.

{
    int    i;
    LPVOID lpvMessageBuffer;
    TCHAR  buffer[256] = TEXT("");
    DWORD  lastErr;

    lastErr = GetLastError();

    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                  NULL, lastErr,
                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
                  (LPTSTR)&lpvMessageBuffer, 0, NULL);

    //
    //... now display this string
    //
    i = wsprintf(buffer,      TEXT("SYSINF_C ERROR: API        = %s.\n"), pszAPI);
    i += wsprintf(buffer + i, TEXT("                error code = %u.\n"), lastErr);
    wsprintf(buffer + i,      TEXT("                message    = %s.\n"), (LPTSTR)lpvMessageBuffer);

    OutputDebugString(buffer);

    //
    // Free the buffer allocated by the system
    //
    LocalFree(lpvMessageBuffer);
}

BOOL WINAPI HandlerRoutine ( DWORD dwCtrlType )

Definition at line 64 of file SysInf_S.c.

{
    //
    // cleanup
    //

    if (!SetEvent(ghEventEnd))
        DisplayError(TEXT("SetEvent"));

    return TRUE;
}

Variable Documentation

HANDLE ghEventEnd

Definition at line 82 of file SysInfo.h.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/Server/SysInf_S.c File Reference

  • WinBase
  • WtsApi
  • TSSysInf
  • Server
Defines | Functions

SysInf_S.c File Reference

#include "sysinfo.h"

Go to the source code of this file.

Defines

#define | TEXT1(x) x

Functions

void _cdecl | _tmain (void)
void | DisplayError (LPTSTR pszAPI)
BOOL WINAPI | HandlerRoutine (DWORD dwCtrlType)

Define Documentation

#define TEXT1 ( x ) x

Definition at line 33 of file SysInf_S.c.

Function Documentation

void _cdecl _tmain ( void )

Definition at line 79 of file SysInf_S.c.

{
    BOOL            bContinue = TRUE;
    BOOL            bQuery = TRUE;
    DWORD           dwTimeout = QUERY_INTERVAL;
    DWORD           dwWait = WAIT_TIMEOUT;
    DWORD           dwSessionId;
    DWORD           dwControlCode;
    ULONG           ulBytesWritten;
    ULONG           ulBytesRead;
    HANDLE          hVirtChannel;
    HANDLE          hEventConnect[3]; // 0 reconnect, 1 disconnect, 2 stop
    MEMORYSTATUS    ms;
    TS_VERSION_INFO tsvi;
    TCHAR           szEventReconnect[256] = TEXT("");
    TCHAR           szEventDisconnect[256] = TEXT("");
    TCHAR           buffer[256] = TEXT("");

    //
    // install console control handler
    //
    if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)HandlerRoutine, TRUE))
        DisplayError(TEXT("SetConsoleControlHandler"));

    //
    // obtain session id
    //
    if (!ProcessIdToSessionId(GetCurrentProcessId(), &dwSessionId))
        DisplayError(TEXT("ProcessIdToSessionId"));

    wsprintf(szEventReconnect, TEXT("Global\\sysinf_s-%u-Reconnect"), dwSessionId);
    wsprintf(szEventDisconnect, TEXT("Global\\sysinf_s-%u-Disconnect"), dwSessionId);

    //
    // exit if running in console session
    //
    if (dwSessionId == 0){
        _tprintf(TEXT1("running in console session\n"));
        return;
    }

    //
    // create connection events
    //
    hEventConnect[0] = CreateEvent(NULL, FALSE, FALSE, szEventReconnect);
    if (hEventConnect[0] == NULL)
        DisplayError(TEXT("CreateEvent"));

    hEventConnect[1] = CreateEvent(NULL, FALSE, FALSE, szEventDisconnect);
    if (hEventConnect[1] == NULL)
        DisplayError(TEXT("CreateEvent"));

    //
    // create stop event
    //
    ghEventEnd = CreateEvent(NULL, FALSE, FALSE, NULL);
    if (ghEventEnd == NULL)
        DisplayError(TEXT("CreateEvent"));

    hEventConnect[2] = ghEventEnd;

    //
    // open virtual channel
    //
    hVirtChannel = WTSVirtualChannelOpen(WTS_CURRENT_SERVER_HANDLE,
                                         dwSessionId,
                                         CHANNELNAME);
    if (hVirtChannel == NULL)
        DisplayError(TEXT("WTSVirtualChannelOpen"));

    //
    // get system information
    //
    dwControlCode = TSVERSIONINFO;
    if (!WTSVirtualChannelWrite(hVirtChannel,
                                (PCHAR)&dwControlCode,
                                sizeof(dwControlCode),
                                &ulBytesWritten))
        DisplayError(TEXT("WTSVirtualChannelWrite"));

    //
    // read system info
    //
    if (!WTSVirtualChannelRead(hVirtChannel,
                               INFINITE,
                               (PCHAR)&tsvi,
                               sizeof(tsvi),
                               &ulBytesRead))
        DisplayError(TEXT("WTSVirtualChannelRead"));

    //
    // display system info
    //
    _tprintf(TEXT1("Client machine  : %s\n"), tsvi.szComputerName);
    printf("TS machine      : %s\n", tsvi.szClientName);
    _tprintf(TEXT1("User context    : %s\n"), tsvi.szUserName);
    _tprintf(TEXT1("Operating System: "));
    if (tsvi.osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
        _tprintf(TEXT1("Windows 9x\n"));
    else if (tsvi.osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
        _tprintf(TEXT1("Windows NT or Windows 2000\n"));
    else
        _tprintf(TEXT1("Win32s\n"));

    _tprintf(TEXT1("OS Version      : %u.%u\n"), tsvi.osvi.dwMajorVersion, tsvi.osvi.dwMinorVersion);
    _tprintf(TEXT1("Build Number    : %u\n"), tsvi.osvi.dwBuildNumber);
    _tprintf(TEXT1("Service Pack    : %s\n"), tsvi.osvi.szCSDVersion);
    _tprintf(TEXT1("Page Size       : %u\n"), tsvi.si.dwPageSize);
    _tprintf(TEXT1("Number of procs : %u\n"), tsvi.si.dwNumberOfProcessors);

    if (tsvi.si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL){

        _tprintf(TEXT1("Processor type  : "), tsvi.si.dwNumberOfProcessors);
        switch (tsvi.si.wProcessorLevel)
        {
            case 3:
                _tprintf(TEXT1("Intel 80386\n"));
                break;

            case 4:
                _tprintf(TEXT1("Intel 80486\n"));
                break;

            case 5:
                _tprintf(TEXT1("Intel Pentium\n"));
                break;

            case 6:
                _tprintf(TEXT1("Intel Pentium Pro or Pentium II\n"));
                break;

            default:
                _tprintf(TEXT1("Intel ????\n"));
                break;
        }
    }

    _tprintf(TEXT1("\nMemory Load - Avail Physical - Avail Page File - Avail Virtual\n"));

    while(bContinue){
        dwWait = WaitForMultipleObjects(3, hEventConnect, FALSE, dwTimeout);
        switch(dwWait)
        {
            case WAIT_TIMEOUT:
                if (bQuery) {
                    //
                    // initialize buffer
                    //
                    ZeroMemory(&ms, sizeof(ms));
                    ulBytesRead = 0;
                    ZeroMemory(buffer, sizeof(buffer));

                    dwControlCode = TSMEMORYINFO;
                    if (!WTSVirtualChannelWrite(hVirtChannel,
                                                (PCHAR)&dwControlCode,
                                                sizeof(dwControlCode),
                                                &ulBytesWritten))
                        DisplayError(TEXT("WTSVirtualChannelWrite"));

                    //
                    // read data
                    //
                    if (!WTSVirtualChannelRead(hVirtChannel,
                                               INFINITE,
                                               (PCHAR)&ms,
                                               sizeof(ms),
                                               &ulBytesRead))
                        DisplayError(TEXT("WTSVirtualChannelRead"));

                    //
                    // display data
                    //
                    wsprintf(buffer,
                             TEXT("%10lu%%   %14lu   %15lu   %13lu"),
                             ms.dwMemoryLoad,
                             ms.dwAvailPhys,
                             ms.dwAvailPageFile,
                             ms.dwAvailVirtual);
                    _tprintf(TEXT1("\r%s"), buffer);
                }
                break;

            case WAIT_OBJECT_0: // reconnect
                //
                // allow query to occur
                //
                bQuery = TRUE;
                dwTimeout = QUERY_INTERVAL;
                _tprintf(TEXT1("-reconnected-\n"), buffer);
                break;

            case WAIT_OBJECT_0 + 1: // disconnect
                //
                // do not query
                //
                bQuery = FALSE;
                dwTimeout = INFINITE;
                _tprintf(TEXT1("\n-disconnected-\n"), buffer);
                break;

            case WAIT_OBJECT_0 + 2: // stop
                bContinue = FALSE;
                break;

            case WAIT_FAILED:
                DisplayError(TEXT("WaitForMultipleObjects"));
                break;

            default:
                break;
        }
    }

    //
    // close the virtual channel
    //
    WTSVirtualChannelClose(hVirtChannel);

    //
    // close handles
    //
    CloseHandle(hEventConnect[0]);
    CloseHandle(hEventConnect[1]);
    CloseHandle(ghEventEnd);
}

void DisplayError ( LPTSTR pszAPI )

Definition at line 36 of file SysInf_S.c.

{
    LPVOID lpvMessageBuffer;
    DWORD  lastErr;

    lastErr = GetLastError();

    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                  NULL, lastErr,
                  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
                  (LPTSTR)&lpvMessageBuffer, 0, NULL);

    //
    //... now display this string
    //
    _tprintf(TEXT1("SYSINF_S ERROR: API        = %s.\n"), pszAPI);
    _tprintf(TEXT1("                error code = %d.\n"), lastErr);
    _tprintf(TEXT1("                message    = %s.\n"), (LPTSTR)lpvMessageBuffer);

    //
    // Free the buffer allocated by the system
    //
    LocalFree(lpvMessageBuffer);

    ExitProcess(GetLastError());
}

BOOL WINAPI HandlerRoutine ( DWORD dwCtrlType )

Definition at line 64 of file SysInf_S.c.

{
    //
    // cleanup
    //

    if (!SetEvent(ghEventEnd))
        DisplayError(TEXT("SetEvent"));

    return TRUE;
}

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/Tst4Wts/Tst4Wts.c File Reference

  • WinBase
  • WtsApi
  • Tst4Wts
Typedefs | Functions | Variables

Tst4Wts.c File Reference

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <wtsapi32.h>
#include <wctype.h>

Go to the source code of this file.

Typedefs

typedef IN DWORD IN DWORD OUT
PWTS_SERVER_INFOW OUT DWORD * 		pCount
typedef IN DWORD IN DWORD OUT
PWTS_SERVER_INFOW * 		ppServerInfo
typedef PWTSENUMERATESERVERSA | PWTSENUMERATESERVERS
typedef VOID(WINAPI * | PWTSFREEMEMORY )(IN PVOID)
typedef IN DWORD | Reserved
typedef IN DWORD IN DWORD | Version

Functions

typedef | BOOL (WINAPI *PWTSENUMERATESERVERSW)(IN LPWSTR pDomainName
void | EnumerateServers (LPTSTR pDomainName)
BOOL | LoadWTSAPI (void)
void | main (INT argc, CHAR **argv)

Variables

char | aWTSEnumerateServers [] = "WTSEnumerateServersA"
char | aWTSFreeMemory [] = "WTSFreeMemory"
PWTSENUMERATESERVERS | pWTSEnumerateServers = NULL
PWTSFREEMEMORY | pWTSFreeMemory = NULL

Typedef Documentation

typedef IN DWORD IN DWORD OUT PWTS_SERVER_INFOA OUT DWORD * pCount

Definition at line 22 of file Tst4Wts.c.

typedef IN DWORD IN DWORD OUT PWTS_SERVER_INFOA * ppServerInfo

Definition at line 22 of file Tst4Wts.c.

typedef PWTSENUMERATESERVERSA PWTSENUMERATESERVERS

Definition at line 39 of file Tst4Wts.c.

typedef VOID(WINAPI * PWTSFREEMEMORY)(IN PVOID)

Definition at line 46 of file Tst4Wts.c.

typedef IN DWORD Reserved

Definition at line 22 of file Tst4Wts.c.

typedef IN DWORD IN DWORD Version

Definition at line 22 of file Tst4Wts.c.

Function Documentation

typedef BOOL ( WINAPI * PWTSENUMERATESERVERSW )
void EnumerateServers ( LPTSTR pDomainName )

Definition at line 69 of file Tst4Wts.c.

{
    PWTS_SERVER_INFO pServerInfo;
    DWORD Count;
    DWORD i;

    _tprintf( TEXT("\nWTSEnumerateServers: domain %s\n"), pDomainName );

    if ( !( (*pWTSEnumerateServers)( pDomainName,
                                    0,
                                    1,
                                    &pServerInfo,
                                    &Count ) ) )
    {
        _tprintf( TEXT("WTSEnumerateServers failed, error %u\n"),
                  GetLastError() );
        return;
    }

    _tprintf( TEXT("WTSEnumerateServers: count %u\n"), Count );

    for ( i=0; i < Count; i++ )
    {
        _tprintf( TEXT("%s "), pServerInfo[i].pServerName );
    }
    _tprintf( TEXT("\n") );

    (*pWTSFreeMemory)( pServerInfo );

} // EnumerateServers()

BOOL LoadWTSAPI ( void )

Definition at line 117 of file Tst4Wts.c.

{
    HMODULE hWTSAPI = NULL;

    /*
     *  Get handle to WTSAPI.DLL
     */
    if ((hWTSAPI = LoadLibrary(TEXT("WTSAPI32"))) == NULL )
        return(FALSE);

    /*
     *  Get entry point for WTSEnumerateServers
     */
    pWTSEnumerateServers =
       (PWTSENUMERATESERVERS)GetProcAddress( hWTSAPI,
                                            aWTSEnumerateServers );

    /*
     *  Get entry point for WTSFreeMemory
     */
    pWTSFreeMemory =
       (PWTSFREEMEMORY)GetProcAddress( hWTSAPI, aWTSFreeMemory );

    return(TRUE);
}

void main | ( | INT | argc,
 |  | CHAR ** | argv
 | ) |  |

Definition at line 150 of file Tst4Wts.c.

{
    /*
     *  Attempt to load the WTSAPI32.DLL.  If this fails, the program
     *  will exit gracefully.
     *
     *  If your  application will run on both plain Windows NT and
     *  on Terminal Server, you can choose to use a reduced feature
     *  set on Windows NT.
     */
    if ( !LoadWTSAPI() )
    {
        _tprintf( TEXT("\
Unable to load WTSAPI32.DLL.  This is because the system is running \n\
on a non-Terminal Server system.  This program will now terminate. \n\
(Your application could perform different things based on this result). \n") );
    }
    else
    {
        _tprintf( TEXT("\
WTSAPI32.DLL loaded successfully, now enumerating servers...\n\n") );
        EnumerateServers( NULL );
    }

} // main()

Variable Documentation

char aWTSEnumerateServers[] = "WTSEnumerateServersA"

Definition at line 40 of file Tst4Wts.c.

char aWTSFreeMemory[] = "WTSFreeMemory"

Definition at line 47 of file Tst4Wts.c.

PWTSENUMERATESERVERS pWTSEnumerateServers = NULL

Definition at line 43 of file Tst4Wts.c.

PWTSFREEMEMORY pWTSFreeMemory = NULL

Definition at line 48 of file Tst4Wts.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/API.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes | Variables

API.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include <wtsapi32.h>
#include "MainFrm.h"
#include "APIDoc.h"
#include "APIView.h"

Go to the source code of this file.

Classes

class CAboutDlg

Variables

CAPIApp theApp

Variable Documentation

CAPIApp theApp

Definition at line 43 of file API.Cpp.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/API.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes

API.h File Reference

#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Classes

class CAPIApp
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/APIDoc.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi
Variables

APIDoc.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "string.h"
#include <wtsapi32.h>
#include "APIDoc.h"
#include "ServerDlg.h"
#include "ProcessDlg.h"
#include "SessionDlg.h"
#include "MessageDlg.h"
#include "WaitSystemDlg.h"
#include "ShutdownDlg.h"

Go to the source code of this file.

Variables

CAPIDoc * g_pDoc

Variable Documentation

CAPIDoc* g_pDoc

Definition at line 43 of file APIDoc.Cpp.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/APIDoc.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes | Variables

APIDoc.h File Reference

#include <wtsapi32.h>

Go to the source code of this file.

Classes

class CAPIDoc

Variables

CAPIDoc * g_pDoc

Variable Documentation

CAPIDoc* g_pDoc

Definition at line 43 of file APIDoc.Cpp.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/APIView.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi

APIView.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "APIDoc.h"
#include "APIView.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/APIView.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes

APIView.h File Reference

Go to the source code of this file.

Classes

class CAPIView
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/MainFrm.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi

MainFrm.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "MainFrm.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:53:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/MainFrm.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes | Defines

MainFrm.h File Reference

Go to the source code of this file.

Classes

class | CMainFrame

Defines

#define | TM_SERVER_PROCESS 5001
#define | TM_SERVERDLG 5000

Define Documentation

#define TM_SERVER_PROCESS 5001

Definition at line 16 of file MainFrm.h.

#define TM_SERVERDLG 5000

Definition at line 15 of file MainFrm.h.

Generated on Wed Nov 13 2024 16:53:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/MessageDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi

MessageDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "APIDoc.h"
#include "MessageDlg.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/MessageDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes

MessageDlg.h File Reference

Go to the source code of this file.

Classes

class CMessageDlg
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ProcessDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi

ProcessDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "ProcessDlg.h"
#include "APIDoc.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ProcessDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes

ProcessDlg.h File Reference

#include <wtsapi32.h>

Go to the source code of this file.

Classes

class CProcessDlg
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/QueryDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi
Variables

QueryDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "APIDoc.h"
#include "QueryDlg.h"

Go to the source code of this file.

Variables

Query QueryItems [MAXQUERYITEMS]

Variable Documentation

Query QueryItems[MAXQUERYITEMS]
Initial value:
{

  {TEXT("Initial Program"), WTSInitialProgram},
  {TEXT("Working Directory"), WTSWorkingDirectory},
  {TEXT("OEM ID"), WTSOEMId},
  {TEXT("Session ID"), WTSSessionId},
  {TEXT("UserName"), WTSUserName},
  {TEXT("WinStation Name"), WTSWinStationName},
  {TEXT("Domain Name"), WTSDomainName},
  {TEXT("Connnection State"), WTSConnectState},
  {TEXT("Client Build Number"), WTSClientBuildNumber},
  {TEXT("Client Name"), WTSClientName},
  {TEXT("Client Directory"), WTSClientDirectory},
  {TEXT("Client Product ID"), WTSClientProductId},
  {TEXT("Client Address"), WTSClientAddress},
  {TEXT("Client Display"), WTSClientDisplay},

  {TEXT("Application Name"), WTSApplicationName}
}

Definition at line 19 of file QueryDlg.Cpp.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/QueryDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes | Defines | Typedefs

QueryDlg.h File Reference

#include <wtsapi32.h>

Go to the source code of this file.

Classes

struct | _Query
class | CQueryDlg

Defines

#define | MAXQUERYITEMS 20

Typedefs

typedef struct _Query | Query

Define Documentation

#define MAXQUERYITEMS 20

Definition at line 14 of file QueryDlg.h.

Typedef Documentation

typedef struct _Query Query
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/Resource.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | ID_PROCESS 32772
#define | ID_RUN_TEST 32771
#define | ID_SEND_MESSAGE 1012
#define | ID_SERVER 32771
#define | ID_SESSION 32773
#define | ID_SHUTDOWN_SYSTEM 32774
#define | ID_TERMINATE_PROCESS 1005
#define | ID_VIRTUAL_CHANNEL 32778
#define | ID_WAIT_EVENT 32777
#define | IDC_BUTTON1 1002
#define | IDC_CANCEL 1038
#define | IDC_DISCONNECT_SESSION 1006
#define | IDC_DOMAIN 1031
#define | IDC_DOMAIN_NAME 1000
#define | IDC_EVENT_FLAGS 1003
#define | IDC_LIST1 1003
#define | IDC_LIST2 1004
#define | IDC_LIST_SERVERS 1002
#define | IDC_LIST_SESSION 1026
#define | IDC_LOGOFF_SESSION 1007
#define | IDC_MANUAL_SERVER_NAME 1037
#define | IDC_PASSWORD 1032
#define | IDC_PROCESS 1003
#define | IDC_QUERY_SESSION 1008
#define | IDC_REFRESH 1019
#define | IDC_SEND_MESSAGE 1041
#define | IDC_SERVER_LIST 1001
#define | IDC_SERVER_LIST2 1036
#define | IDC_SERVER_NAME 1015
#define | IDC_SERVERNAME 1017
#define | IDC_SESSION_INFO 1010
#define | IDC_SESSION_LIST 1003
#define | IDC_SETSESSION 1002
#define | IDC_SHUTDOWN_PARAMETERS 1003
#define | IDC_USERNAME 1030
#define | IDC_VIRTUAL_CHANNEL 1013
#define | IDD_ABOUTBOX 100
#define | IDD_DIALOG1 137
#define | IDD_PROCESS 131
#define | IDD_QUERY_SESSION 134
#define | IDD_SEND_MESSAGE 135
#define | IDD_SERVER_PROCESS 131
#define | IDD_SERVERDLG 130
#define | IDD_SESSION 132
#define | IDD_SETSESSION 140
#define | IDD_SHUTDOWN 138
#define | IDD_WAIT_SYSTEM_EVENT 136
#define | IDQUERY 1009
#define | IDR_APITYPE 129
#define | IDR_MAINFRAME 128
#define | IDSHUTDOWN 1022

Define Documentation

#define ID_PROCESS 32772

Definition at line 51 of file Resource.h.

#define ID_RUN_TEST 32771

Definition at line 49 of file Resource.h.

#define ID_SEND_MESSAGE 1012

Definition at line 35 of file Resource.h.

#define ID_SERVER 32771

Definition at line 50 of file Resource.h.

#define ID_SESSION 32773

Definition at line 52 of file Resource.h.

#define ID_SHUTDOWN_SYSTEM 32774

Definition at line 53 of file Resource.h.

#define ID_TERMINATE_PROCESS 1005

Definition at line 29 of file Resource.h.

#define ID_VIRTUAL_CHANNEL 32778

Definition at line 55 of file Resource.h.

#define ID_WAIT_EVENT 32777

Definition at line 54 of file Resource.h.

#define IDC_BUTTON1 1002

Definition at line 20 of file Resource.h.

#define IDC_CANCEL 1038

Definition at line 47 of file Resource.h.

#define IDC_DISCONNECT_SESSION 1006

Definition at line 30 of file Resource.h.

#define IDC_DOMAIN 1031

Definition at line 43 of file Resource.h.

#define IDC_DOMAIN_NAME 1000

Definition at line 18 of file Resource.h.

#define IDC_EVENT_FLAGS 1003

Definition at line 26 of file Resource.h.

#define IDC_LIST1 1003

Definition at line 23 of file Resource.h.

#define IDC_LIST2 1004

Definition at line 28 of file Resource.h.

#define IDC_LIST_SERVERS 1002

Definition at line 21 of file Resource.h.

#define IDC_LIST_SESSION 1026

Definition at line 41 of file Resource.h.

#define IDC_LOGOFF_SESSION 1007

Definition at line 31 of file Resource.h.

#define IDC_MANUAL_SERVER_NAME 1037

Definition at line 46 of file Resource.h.

#define IDC_PASSWORD 1032

Definition at line 44 of file Resource.h.

#define IDC_PROCESS 1003

Definition at line 24 of file Resource.h.

#define IDC_QUERY_SESSION 1008

Definition at line 32 of file Resource.h.

#define IDC_REFRESH 1019

Definition at line 39 of file Resource.h.

#define IDC_SEND_MESSAGE 1041

Definition at line 48 of file Resource.h.

#define IDC_SERVER_LIST 1001

Definition at line 19 of file Resource.h.

#define IDC_SERVER_LIST2 1036

Definition at line 45 of file Resource.h.

#define IDC_SERVER_NAME 1015

Definition at line 37 of file Resource.h.

#define IDC_SERVERNAME 1017

Definition at line 38 of file Resource.h.

#define IDC_SESSION_INFO 1010

Definition at line 34 of file Resource.h.

#define IDC_SESSION_LIST 1003

Definition at line 25 of file Resource.h.

#define IDC_SETSESSION 1002

Definition at line 22 of file Resource.h.

#define IDC_SHUTDOWN_PARAMETERS 1003

Definition at line 27 of file Resource.h.

#define IDC_USERNAME 1030

Definition at line 42 of file Resource.h.

#define IDC_VIRTUAL_CHANNEL 1013

Definition at line 36 of file Resource.h.

#define IDD_ABOUTBOX 100

Definition at line 5 of file Resource.h.

#define IDD_DIALOG1 137

Definition at line 15 of file Resource.h.

#define IDD_PROCESS 131

Definition at line 10 of file Resource.h.

#define IDD_QUERY_SESSION 134

Definition at line 12 of file Resource.h.

#define IDD_SEND_MESSAGE 135

Definition at line 13 of file Resource.h.

#define IDD_SERVER_PROCESS 131

Definition at line 9 of file Resource.h.

#define IDD_SERVERDLG 130

Definition at line 8 of file Resource.h.

#define IDD_SESSION 132

Definition at line 11 of file Resource.h.

#define IDD_SETSESSION 140

Definition at line 17 of file Resource.h.

#define IDD_SHUTDOWN 138

Definition at line 16 of file Resource.h.

#define IDD_WAIT_SYSTEM_EVENT 136

Definition at line 14 of file Resource.h.

#define IDQUERY 1009

Definition at line 33 of file Resource.h.

#define IDR_APITYPE 129

Definition at line 7 of file Resource.h.

#define IDR_MAINFRAME 128

Definition at line 6 of file Resource.h.

#define IDSHUTDOWN 1022

Definition at line 40 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ServerDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi

ServerDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "ServerDlg.h"
#include "string.h"
#include "APIDoc.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ServerDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes

ServerDlg.h File Reference

#include <wtsapi32.h>

Go to the source code of this file.

Classes

class CServerDlg
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/SessionDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi
Variables

SessionDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "SessionDlg.h"
#include "QueryDlg.h"
#include "APIDoc.h"

Go to the source code of this file.

Variables

char * VCName []

Variable Documentation

char* VCName[]
Initial value:
 {
    "CTXTW  ",
    "CTXLPT1",
    "CTXCPM ",
    "CTXCDM ",
    "CTXCLIP",
    NULL,
  }

Definition at line 21 of file SessionDlg.Cpp.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/SessionDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes

SessionDlg.h File Reference

#include <wtsapi32.h>

Go to the source code of this file.

Classes

class CSessionDlg
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ShutdownDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi
Variables

ShutdownDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "APIDoc.h"
#include "ShutdownDlg.h"

Go to the source code of this file.

Variables

Shutdown ShutdownItems [5]

Variable Documentation

Shutdown ShutdownItems[5]
Initial value:
{
  {TEXT("Delete WinStations"), WTS_WSD_LOGOFF},
  {TEXT("Normal Shutdown"), WTS_WSD_SHUTDOWN},
  {TEXT("Reboot after Shutdown"), WTS_WSD_REBOOT},
  {TEXT("Power off computer after shutdown"), WTS_WSD_POWEROFF},
  {TEXT("CTRL-SHIFT-ALT-DEL fast reboot"), WTS_WSD_FASTREBOOT}
}

Definition at line 20 of file ShutdownDlg.Cpp.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ShutdownDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes | Defines | Typedefs

ShutdownDlg.h File Reference

Go to the source code of this file.

Classes

struct | _Shutdown
class | CShutdownDlg

Defines

#define | MAXSHUTDOWNITEMS 5

Typedefs

typedef struct _Shutdown | Shutdown

Define Documentation

#define MAXSHUTDOWNITEMS 5

Definition at line 12 of file ShutdownDlg.h.

Typedef Documentation

typedef struct _Shutdown Shutdown
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/StdAfx.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi

StdAfx.Cpp File Reference

#include "stdafx.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:53:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/StdAfx.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Defines

StdAfx.h File Reference

#include <afxwin.h>
#include <afxext.h>
#include <afxcmn.h>

Go to the source code of this file.

Defines

#define VC_EXTRALEAN

Define Documentation

#define VC_EXTRALEAN

Definition at line 13 of file StdAfx.h.

Generated on Wed Nov 13 2024 16:53:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/WaitDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi

WaitDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "APIDoc.h"
#include "WaitDlg.h"
#include "wtsapi32.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/WaitDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes

WaitDlg.h File Reference

Go to the source code of this file.

Classes

class CWaitDlg
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/WaitSystemDlg.Cpp File Reference

  • WinBase
  • WtsApi
  • WtsApi
Variables

WaitSystemDlg.Cpp File Reference

#include "stdafx.h"
#include "API.h"
#include "APIDoc.h"
#include "WaitSystemDlg.h"

Go to the source code of this file.

Variables

Events EventFlags [12]

Variable Documentation

Events EventFlags[12]
Initial value:
{
  {TEXT("Wait on nothing"), WTS_EVENT_NONE},
  {TEXT("New WinStation Created"), WTS_EVENT_CREATE},
  {TEXT("Existing WinStation Deleted"), WTS_EVENT_DELETE},
  {TEXT("Existing WinStation Renamed"), WTS_EVENT_RENAME},
  {TEXT("WinStation is connected to client"), WTS_EVENT_CONNECT},
  {TEXT("WinStation is disconnected from client"), WTS_EVENT_DISCONNECT},
  {TEXT("User logon to existing WinStation"), WTS_EVENT_LOGON},
  {TEXT("User logoff from existing WinStation"), WTS_EVENT_LOGOFF},
  {TEXT("WinStation state change"), WTS_EVENT_STATECHANGE},
  {TEXT("License state change"), WTS_EVENT_LICENSE},
  {TEXT("Wait for all event types"), WTS_EVENT_ALL},
  {TEXT("Unblock all waiters"), WTS_EVENT_FLUSH}
}

Definition at line 21 of file WaitSystemDlg.Cpp.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/WaitSystemDlg.h File Reference

  • WinBase
  • WtsApi
  • WtsApi
Classes | Defines | Typedefs

WaitSystemDlg.h File Reference

Go to the source code of this file.

Classes

struct | _Events
class | CWaitSystemDlg

Defines

#define | MAXEVENTITEMS 12

Typedefs

typedef struct _Events | Events

Define Documentation

#define MAXEVENTITEMS 12

Definition at line 12 of file WaitSystemDlg.h.

Typedef Documentation

typedef struct _Events Events
Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Clipboard/ClipText.c File Reference

  • WinUI
  • Clipboard
Functions | Variables

ClipText.c File Reference

#include "cliptext.h"
#include <string.h>

Go to the source code of this file.

Functions

INT_PTR APIENTRY | About (HWND, UINT, WPARAM, LPARAM)
BOOL InitApplication (HANDLE)
BOOL | InitInstance (HANDLE, INT)
BOOL | InitInstance (HINSTANCE hInstance, INT nCmdShow)
LRESULT APIENTRY | MainWndProc (HWND, UINT, WPARAM, LPARAM)
VOID | OutOfMemory ()
VOID | OutOfMemory (VOID)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

HACCEL | hAccTable
HANDLE hData
HINSTANCE | hInst
HANDLE | hText = NULL
HWND | hwnd
LPTSTR lpData
TCHAR | szInitialClientAreaText []

Function Documentation

INT_PTR APIENTRY About | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 458 of file ClipText.c.

{
    BOOL bRet = FALSE;

    switch (message)
    {
        case WM_INITDIALOG:
            bRet = TRUE;
            break;

        case WM_COMMAND:
            if (LOWORD(wParam) == IDOK ||
                LOWORD(wParam) == IDCANCEL)
            {
                EndDialog(hDlg, TRUE);
                bRet = TRUE;
            }
            break;
    }

    return (INT_PTR)bRet;
}

BOOL InitApplication ( HANDLE hInstance )

Definition at line 123 of file ClipText.c.

{
    WNDCLASS  wc = {0};

    wc.lpfnWndProc = (WNDPROC) MainWndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName =  TEXT("CliptextMenu");
    wc.lpszClassName = TEXT("CliptextWClass");

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | ,
 |  | INT |
 | ) |  |

Definition at line 128 of file Cursor.c.

{
    BOOL bSuccess = FALSE;
    HWND hWnd = NULL;

    hInst = hInstance;

    hHourGlass = LoadCursor(NULL, IDC_WAIT);

    hWnd = CreateWindow (
        TEXT ("CursorWClass"),
        TEXT ("Cursor Sample Application"),
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, 0,
        CW_USEDEFAULT, 0,
        NULL, NULL, hInstance, NULL);

    if (hWnd)
    {
        ShowWindow (hWnd, nCmdShow);
        bSuccess = UpdateWindow(hWnd);
    }

    return bSuccess;
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | INT | nCmdShow
 | ) |  |

Definition at line 147 of file ClipText.c.

{
    LPTSTR lpszText = NULL;
    BOOL bSuccess = TRUE;

    hInst = hInstance;

    hAccTable = LoadAccelerators(hInst, TEXT("ClipTextAcc"));

    if (!(hText
          = GlobalAlloc(GMEM_MOVEABLE,(DWORD)sizeof(szInitialClientAreaText))))
    {
        OutOfMemory();
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!(lpszText = GlobalLock(hText)))
    {
        OutOfMemory();
        bSuccess = FALSE;
        goto exit_func;
    }

    lstrcpyn(lpszText, szInitialClientAreaText,
             sizeof(szInitialClientAreaText)/sizeof(szInitialClientAreaText[0]) - 1);
    GlobalUnlock(hText);

    hwnd = CreateWindow(
        TEXT("CliptextWClass"),
        TEXT("Cliptext Sample Application"),
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, 0,
        CW_USEDEFAULT, 0,
        NULL, NULL, hInstance, NULL );

    if (!hwnd)
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    ShowWindow(hwnd, nCmdShow);
    bSuccess = UpdateWindow(hwnd);

exit_func:
    return bSuccess;
}

LRESULT APIENTRY MainWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 224 of file ClipText.c.

{
    HDC         hDC         = NULL;
    PAINTSTRUCT ps          = {0};
    RECT        rectClient  = {0};
    LPTSTR      lpszText    = NULL;
    HANDLE      hClipData   = NULL;  /* handles to clip data  */
    LPTSTR      lpClipData  = NULL;  /* pointers to clip data */

    switch (message)
    {
        case WM_INITMENU:
            if (wParam == (WPARAM)GetMenu(hWnd))
            {
          if (OpenClipboard(hWnd))
          {
#ifdef UNICODE
                    if (IsClipboardFormatAvailable(CF_UNICODETEXT))
#else
                    if (IsClipboardFormatAvailable(CF_TEXT) || IsClipboardFormatAvailable(CF_OEMTEXT))
#endif // UNICODE
                    {
                        EnableMenuItem((HMENU)wParam, IDM_PASTE, MF_ENABLED);
                    }
              else
              {
                        EnableMenuItem((HMENU)wParam, IDM_PASTE, MF_GRAYED);
              }
                    CloseClipboard();
                  return (TRUE);
                }
                else                           /* Clipboard is not available */
                {
                    return (FALSE);
                }
            }
            return (TRUE);

        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case IDM_ABOUT:
                    DialogBox(hInst, TEXT("AboutBox"), hWnd, About);
                    break;

                    /* file menu commands */

                case IDM_NEW:    /* fall-through */
                case IDM_OPEN:   /* fall-through */
                case IDM_SAVE:   /* fall-through */
                case IDM_SAVEAS: /* fall-through */
                case IDM_PRINT:
                    MessageBox (GetFocus (),
                                TEXT("Command not implemented."),
                                TEXT("ClipText Sample Application"),
                                MB_ICONASTERISK | MB_OK );
                    break;

                case IDM_EXIT:
                    DestroyWindow(hWnd);
                    break;

                /* edit menu commands */
                case IDM_UNDO:  /* fall-through */
                case IDM_CLEAR:
                    MessageBox (GetFocus (),
                                TEXT("Command not implemented."),
                                TEXT("ClipText Sample Application"),
                                MB_ICONASTERISK | MB_OK);
                    break;

                case IDM_CUT:  /* fall-through */
                case IDM_COPY:
                    if (hText != NULL)
                    {
                        /* Allocate memory and copy the string to it */
                        if (!(hData
                             = GlobalAlloc(GMEM_DDESHARE, GlobalSize (hText))))
                        {
                            OutOfMemory();
                            return (TRUE);
                        }
                        if (!(lpData = GlobalLock(hData)))
                        {
                            OutOfMemory();
                            return (TRUE);
                        }
                        if (!(lpszText = GlobalLock (hText)))
                        {
                            OutOfMemory();
                            return (TRUE);
                        }
                        lstrcpyn(lpData, lpszText, (int)GlobalSize (hText));
                        GlobalUnlock(hData);
                        GlobalUnlock (hText);

                        /* Clear the current contents of the clipboard, and set
                         * the data handle to the new string.
                         */
                        if (OpenClipboard(hWnd))
                        {
                            EmptyClipboard();
#ifdef UNICODE
                            SetClipboardData(CF_UNICODETEXT, hData);
#else
                            SetClipboardData(CF_TEXT, hData);
#endif // UNICODE
                            CloseClipboard();
                        }
                        hData = NULL;

                        if (LOWORD(wParam) == IDM_CUT)
                        {
                            GlobalFree (hText);
                            hText = NULL;
                            EnableMenuItem(GetMenu (hWnd), IDM_CUT, MF_GRAYED);
                            EnableMenuItem(GetMenu(hWnd), IDM_COPY, MF_GRAYED);
                            InvalidateRect (hWnd, NULL, TRUE);
                            UpdateWindow (hWnd);
                        }
                    }
                    return (TRUE);

                case IDM_PASTE:
                    if (OpenClipboard(hWnd))
                    {
                        /* get text from the clipboard */
#ifdef UNICODE
                        if (!(hClipData = GetClipboardData(CF_UNICODETEXT)))
#else
                        if (!(hClipData = GetClipboardData(CF_TEXT)))
#endif // !UNICODE
                        {
                            CloseClipboard();
                            break;
                        }

                        if (hText != NULL)
                        {
                            GlobalFree(hText);
                        }

                        if (!(hText = GlobalAlloc(GMEM_MOVEABLE, GlobalSize(hClipData))))
                        {
                            OutOfMemory();
                            CloseClipboard();
                            break;
                        }

                        if (!(lpClipData = GlobalLock(hClipData)))
                        {
                            OutOfMemory();
                            CloseClipboard();
                            break;
                        }

                        if (!(lpszText = GlobalLock(hText)))
                        {
                            OutOfMemory();
                            CloseClipboard();
                            break;
                        }

                        lstrcpyn(lpszText, lpClipData, (int)GlobalSize(hClipData));
                        GlobalUnlock(hClipData);
                        CloseClipboard();
                        GlobalUnlock(hText);
                        EnableMenuItem(GetMenu(hWnd), IDM_CUT, MF_ENABLED);
                        EnableMenuItem(GetMenu(hWnd), IDM_COPY, MF_ENABLED);

                        /* copy text to the application window */

                        InvalidateRect(hWnd, NULL, TRUE);
                        UpdateWindow(hWnd);
                        return (TRUE);
                    }
                    else
                    {
                        return (FALSE);
                    }
                }
                break;

            case WM_SIZE:
                InvalidateRect(hWnd, NULL, TRUE);
                break;

            case WM_PAINT:
                hDC = BeginPaint (hWnd, &ps);
                if (hText != NULL)
                {
                    if (!(lpszText = GlobalLock (hText)))
                    {
                        OutOfMemory();
                    }
                    else
                    {
                        GetClientRect (hWnd, &rectClient);
                        DrawText (hDC, lpszText, -1, &rectClient,
                                  DT_EXTERNALLEADING | DT_NOPREFIX | DT_WORDBREAK);
                        GlobalUnlock (hText);
                    }
                }
                EndPaint (hWnd, &ps);
                break;

            case WM_DESTROY:
                PostQuitMessage(0);
                break;

            default:
                return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return (0);
}

VOID OutOfMemory ( )

Definition at line 493 of file ClipText.c.

{
    MessageBox(
        GetFocus(),
        TEXT("Out of Memory"),
        NULL,
        MB_ICONHAND | MB_SYSTEMMODAL);
    return;
}

VOID OutOfMemory ( VOID )
int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 63 of file ClipText.c.

{
    MSG msg = {0};
    BOOL bRet = FALSE;
    BOOL bSuccess = TRUE;

    if (!InitApplication(hInstance))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!InitInstance(hInstance, nCmdShow))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
    {
        if (bRet == -1)
        {
            bSuccess = FALSE;
            goto exit_func;
        }
        else
        {
            /* Only translate message if it is not an accelerator message */
            if (!TranslateAccelerator(hwnd, hAccTable, &msg))
            {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        }
    }

exit_func:
    if (bSuccess)
    {
        return (int) (msg.wParam);
    }
    else
    {
        return 0;
    }
}

Variable Documentation

HACCEL hAccTable

Definition at line 33 of file ClipText.c.

HANDLE hData

Definition at line 46 of file ClipText.c.

HINSTANCE hInst

Definition at line 32 of file ClipText.c.

HANDLE hText = NULL

Definition at line 36 of file ClipText.c.

HWND hwnd

Definition at line 34 of file ClipText.c.

LPTSTR lpData

Definition at line 47 of file ClipText.c.

TCHAR szInitialClientAreaText[]
Initial value:

   TEXT("application so that you can watch the data exchanges take place.  ")

Definition at line 38 of file ClipText.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Clipboard/ClipText.h File Reference

  • WinUI
  • Clipboard
Defines

ClipText.h File Reference

#include <windows.h>

Go to the source code of this file.

Defines

#define | IDM_ABOUT 100
#define | IDM_CLEAR 204
#define | IDM_COPY 202
#define | IDM_CUT 201
#define | IDM_EXIT 106
#define | IDM_NEW 101
#define | IDM_OPEN 102
#define | IDM_PASTE 203
#define | IDM_PRINT 105
#define | IDM_SAVE 103
#define | IDM_SAVEAS 104
#define | IDM_UNDO 200

Define Documentation

#define IDM_ABOUT 100

Definition at line 14 of file ClipText.h.

#define IDM_CLEAR 204

Definition at line 31 of file ClipText.h.

#define IDM_COPY 202

Definition at line 29 of file ClipText.h.

#define IDM_CUT 201

Definition at line 28 of file ClipText.h.

#define IDM_EXIT 106

Definition at line 23 of file ClipText.h.

#define IDM_NEW 101

Definition at line 18 of file ClipText.h.

#define IDM_OPEN 102

Definition at line 19 of file ClipText.h.

#define IDM_PASTE 203

Definition at line 30 of file ClipText.h.

#define IDM_PRINT 105

Definition at line 22 of file ClipText.h.

#define IDM_SAVE 103

Definition at line 20 of file ClipText.h.

#define IDM_SAVEAS 104

Definition at line 21 of file ClipText.h.

#define IDM_UNDO 200

Definition at line 27 of file ClipText.h.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/CDTest.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

CDTest.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <winnls.h>
#include "cdtest.h"
#include "colors.h"
#include "save.h"
#include "print.h"
#include "title.h"
#include "replace.h"
#include "open.h"
#include "font.h"
#include "find.h"

Go to the source code of this file.

Defines

#define | szClass TEXT("cdtestclass")
#define | szIcon TEXT("theicon")
#define | szMenu TEXT("themenu")
#define | szTitle TEXT("Common Dialog Test App - ANSI Version")

Functions

INT_PTR APIENTRY | AboutProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void | HandleTheCommand (HWND hWnd, WPARAM wParam, LPARAM lParam)
BOOL | InitApplication (HINSTANCE hInstance)
void | InitGlobals (void)
BOOL | InitInstance (HINSTANCE hInstance, int nCmdShow)
LRESULT APIENTRY | MainWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LONG_PTR | MyAtol (LPTSTR szString, BOOL bHex, LPBOOL bSuccess)
int PASCAL | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

UINT_PTR | uMode = IDM_HEXMODE

Define Documentation

#define szClass TEXT("cdtestclass")

Definition at line 56 of file CDTest.c.

#define szIcon TEXT("theicon")

Definition at line 57 of file CDTest.c.

#define szMenu TEXT("themenu")

Definition at line 58 of file CDTest.c.

#define szTitle TEXT("Common Dialog Test App - ANSI Version")

Definition at line 63 of file CDTest.c.

Function Documentation

INT_PTR APIENTRY AboutProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 542 of file CDTest.c.

{

  if (msg == WM_INITDIALOG)
    return TRUE;

  if (
       (msg == WM_COMMAND) &&
       (LOWORD(wParam) == IDCANCEL)
     )
  {

     return EndDialog(hwnd, FALSE) ;
  }

  else
    return FALSE ;
}

void HandleTheCommand | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 309 of file CDTest.c.

{

  switch (LOWORD(wParam))
  {
    case IDM_COLOR:                //For any of the dialog creation
      DoColorsDialog(hWnd) ;       //commands, call the appropriate
      break ;                      //function.  The function will
                                   //create the dialog...
    case IDM_FONT:
      DoFontDialog(hWnd) ;
      break ;

    case IDM_TITLE:
      DoTitleDialog(hWnd) ;
      break ;

    case IDM_FIND:
      DoFindDialog(hWnd) ;
      break ;

    case IDM_OPEN:
      DoOpenDialog(hWnd) ;
      break ;

    case IDM_SAVE:
      DoSaveDialog(hWnd) ;
      break ;

    case IDM_PRINT:
      DoPrintDialog(hWnd) ;
      break ;

    case IDM_REPLACE:
      DoReplaceDialog(hWnd) ;
      break ;

    case IDM_EXIT:
      PostQuitMessage(0) ;
      break ;

    case IDM_HEXMODE:
    case IDM_DECIMALMODE:

      /* We need to maintain a global variable that will indicate what
         kind of number processing we have to do.  First, check the
         menu item corresponding to the new mode... */

      CheckMenuItem(GetMenu(hWnd), (UINT)uMode, MF_UNCHECKED) ;
      uMode = wParam ;
      CheckMenuItem(GetMenu(hWnd), (UINT)uMode, MF_CHECKED) ;

      /* and then create an appropriate filter for wsprintf() type
         functions */

      if (uMode == IDM_HEXMODE)
      {
        lstrcpyn(szShortFilter, TEXT("%x"), ARRAYSIZE(szShortFilter)) ;
        lstrcpyn(szLongFilter, TEXT("%lx"), ARRAYSIZE(szLongFilter)) ;
        lstrcpyn(szPointerFilter, TEXT("%p"), ARRAYSIZE(szPointerFilter)) ;
      }
      if (uMode == IDM_DECIMALMODE)
      {
        lstrcpyn(szShortFilter, TEXT("%d"), ARRAYSIZE(szShortFilter)) ;
        lstrcpyn(szLongFilter, TEXT("%ld"), ARRAYSIZE(szLongFilter)) ;
        lstrcpyn(szPointerFilter, TEXT("%Id"), ARRAYSIZE(szPointerFilter)) ;
      }

      break ;

    case IDM_ABOUT:
       DialogBox(hInst, TEXT("about"), hWnd, AboutProc) ;
       break ;

    default: break ;
  }

  return ;
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 152 of file CDTest.c.

{
  WNDCLASS  wc;

  wc.style = 0;
  wc.lpfnWndProc = (WNDPROC)MainWndProc;
  wc.cbClsExtra = 0;
  wc.cbWndExtra = 0;
  wc.hInstance = hInstance;
  wc.hIcon = LoadIcon(hInstance, szIcon) ;
  wc.hCursor = LoadCursor(NULL, IDC_ARROW);
  wc.hbrBackground = GetStockObject(WHITE_BRUSH);
  wc.lpszMenuName = szMenu ;
  wc.lpszClassName = szClass ;

  InitGlobals() ;

  /* Register any messages that the common dialogs will need to
     communicate with this app. */

  nFindMsg       = RegisterWindowMessage((LPTSTR) FINDMSGSTRING) ;
  nOpenShareVMsg = RegisterWindowMessage((LPTSTR) SHAREVISTRING) ;
  nHelpMessage   = RegisterWindowMessage((LPTSTR) HELPMSGSTRING) ;

  return (RegisterClass(&wc));
}

void InitGlobals ( void )

Definition at line 417 of file CDTest.c.

{

  /* not really too much to do here.  Create a hex wsprintf() filter since
     the app starts off in Hex mode. */

  lstrcpyn(szShortFilter, TEXT("%x"), ARRAYSIZE(szShortFilter)) ;
  lstrcpyn(szLongFilter, TEXT("%lx"), ARRAYSIZE(szLongFilter)) ;
  lstrcpyn(szPointerFilter, TEXT("%p"), ARRAYSIZE(szPointerFilter)) ;

}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 210 of file CDTest.c.

{
    HWND hWnd;
    DWORD dwFlags = WS_OVERLAPPED | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU ;

    /* save the instance handle in a global variable */

    hInst = hInstance;

    /* Create the main window */

    hWnd = CreateWindow(szClass, szTitle, dwFlags,
                        10, 10, 400, 200, NULL, NULL, hInstance, NULL) ;

    if (!hWnd)
        return (FALSE);

    ShowWindow(hWnd, SW_SHOWNORMAL) ;
    UpdateWindow(hWnd);

    return (TRUE);
}

LRESULT APIENTRY MainWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 262 of file CDTest.c.

{
    switch (message)
    {
      case WM_CREATE:
        CheckMenuItem(GetMenu(hWnd), IDM_HEXMODE, MF_CHECKED) ;
        break ;

      case WM_COMMAND:
        HandleTheCommand(hWnd, wParam, lParam) ;
        break ;

      case WM_DESTROY:
          PostQuitMessage(0);
          break;

      default:
          return (DefWindowProc(hWnd, message, wParam, lParam));
          break ;
    }
    return (0L);
}

LONG_PTR MyAtol | ( | LPTSTR | szString,
 |  | BOOL | bHex,
 |  | LPBOOL | bSuccess
 | ) |  |

Definition at line 460 of file CDTest.c.

{
  LPTSTR p ;
  LONG l ;
  LONG lMultiplier ;
  BOOL bDigit ;

  if (bHex)
    lMultiplier = 16 ;
  else
    lMultiplier = 10 ;

  p = szString ;
  l = 0 ;

  while (*p)      //while chars
  {
     bDigit = FALSE ;  //set to false for each char that we look at

     if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
     {
       bDigit = TRUE ;
       l+=(*p - (TCHAR) '0') ;
     }

     if (bHex)
     {
       if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
       {
         l+=(*p - (TCHAR) 'A' + 10) ;
         bDigit = TRUE ;
       }

       if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
       {
         l+=(*p - (TCHAR) 'a' + 10) ;
         bDigit = TRUE ;
       }

     }

     if (bDigit == FALSE)
     {
       *bSuccess = FALSE ;
       return 0 ;
     }

     p++ ;               //get next char

     if (*p)             //if there is going to be at least one more char
       l*=lMultiplier ;  //then multiply what we have by the multiplier...
  }

  *bSuccess = TRUE ;

  return l ;             //success! return the value.
}

int PASCAL WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 97 of file CDTest.c.

{

  MSG msg;

  UNREFERENCED_PARAMETER( lpCmdLine );

  if (!hPrevInstance)
    if (!InitApplication(hInstance))
        return (FALSE);

  if (!InitInstance(hInstance, nCmdShow))
    return (FALSE);

  while (GetMessage(&msg, 0, 0, 0))
  {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }

  return (int)(msg.wParam);
}

Variable Documentation

UINT_PTR uMode = IDM_HEXMODE

Definition at line 69 of file CDTest.c.

Generated on Wed Nov 13 2024 16:55:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/CDTest.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

CDTest.h File Reference

Go to the source code of this file.

Defines

#define | ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
#define | IDM_ABOUT 301
#define | IDM_COLOR 100
#define | IDM_DECIMALMODE 201
#define | IDM_EXIT 108
#define | IDM_FIND 102
#define | IDM_FONT 101
#define | IDM_HEXMODE 200
#define | IDM_MULTITHREAD2 300
#define | IDM_OPEN 104
#define | IDM_PRINT 106
#define | IDM_REPLACE 107
#define | IDM_SAVE 105
#define | IDM_TITLE 103
#define | UMSG_DECREMENTDLGCOUNT (WM_USER+1)

Functions

INT_PTR APIENTRY | AboutProc (HWND, UINT, WPARAM, LPARAM)
void | HandleTheCommand (HWND, WPARAM, LPARAM)
BOOL InitApplication (HANDLE)
BOOL | InitInstance (HANDLE, int)
LRESULT APIENTRY | MainWndProc (HWND, UINT, WPARAM, LPARAM)

Variables

HINSTANCE | hInst
UINT nFindMsg
UINT nHelpMessage
UINT nOpenShareVMsg
TCHAR | szLongFilter [5]
TCHAR | szPointerFilter [5]
TCHAR | szShortFilter [5]
TCHAR | szTemp [100]

Define Documentation

#define ARRAYSIZE ( x ) (sizeof(x) / sizeof(x[0]))

Definition at line 18 of file CDTest.h.

#define IDM_ABOUT 301

Definition at line 38 of file CDTest.h.

#define IDM_COLOR 100

Definition at line 26 of file CDTest.h.

#define IDM_DECIMALMODE 201

Definition at line 36 of file CDTest.h.

#define IDM_EXIT 108

Definition at line 34 of file CDTest.h.

#define IDM_FIND 102

Definition at line 28 of file CDTest.h.

#define IDM_FONT 101

Definition at line 27 of file CDTest.h.

#define IDM_HEXMODE 200

Definition at line 35 of file CDTest.h.

#define IDM_MULTITHREAD2 300

Definition at line 37 of file CDTest.h.

#define IDM_OPEN 104

Definition at line 30 of file CDTest.h.

#define IDM_PRINT 106

Definition at line 32 of file CDTest.h.

#define IDM_REPLACE 107

Definition at line 33 of file CDTest.h.

#define IDM_SAVE 105

Definition at line 31 of file CDTest.h.

#define IDM_TITLE 103

Definition at line 29 of file CDTest.h.

#define UMSG_DECREMENTDLGCOUNT (WM_USER+1)

Definition at line 6 of file CDTest.h.

Function Documentation

INT_PTR APIENTRY AboutProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 812 of file Framer.Cpp.

    {
  UNREFERENCED_PARAMETER(lParam);
    switch (iMsg)
        {
        case WM_INITDIALOG:
            return TRUE;

        case WM_COMMAND:
            switch (LOWORD(wParam))
                {
                case IDOK:
                    EndDialog(hDlg, TRUE);
                }
            break;
        }
    return FALSE;
    }

void HandleTheCommand | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 309 of file CDTest.c.

{

  switch (LOWORD(wParam))
  {
    case IDM_COLOR:                //For any of the dialog creation
      DoColorsDialog(hWnd) ;       //commands, call the appropriate
      break ;                      //function.  The function will
                                   //create the dialog...
    case IDM_FONT:
      DoFontDialog(hWnd) ;
      break ;

    case IDM_TITLE:
      DoTitleDialog(hWnd) ;
      break ;

    case IDM_FIND:
      DoFindDialog(hWnd) ;
      break ;

    case IDM_OPEN:
      DoOpenDialog(hWnd) ;
      break ;

    case IDM_SAVE:
      DoSaveDialog(hWnd) ;
      break ;

    case IDM_PRINT:
      DoPrintDialog(hWnd) ;
      break ;

    case IDM_REPLACE:
      DoReplaceDialog(hWnd) ;
      break ;

    case IDM_EXIT:
      PostQuitMessage(0) ;
      break ;

    case IDM_HEXMODE:
    case IDM_DECIMALMODE:

      /* We need to maintain a global variable that will indicate what
         kind of number processing we have to do.  First, check the
         menu item corresponding to the new mode... */

      CheckMenuItem(GetMenu(hWnd), (UINT)uMode, MF_UNCHECKED) ;
      uMode = wParam ;
      CheckMenuItem(GetMenu(hWnd), (UINT)uMode, MF_CHECKED) ;

      /* and then create an appropriate filter for wsprintf() type
         functions */

      if (uMode == IDM_HEXMODE)
      {
        lstrcpyn(szShortFilter, TEXT("%x"), ARRAYSIZE(szShortFilter)) ;
        lstrcpyn(szLongFilter, TEXT("%lx"), ARRAYSIZE(szLongFilter)) ;
        lstrcpyn(szPointerFilter, TEXT("%p"), ARRAYSIZE(szPointerFilter)) ;
      }
      if (uMode == IDM_DECIMALMODE)
      {
        lstrcpyn(szShortFilter, TEXT("%d"), ARRAYSIZE(szShortFilter)) ;
        lstrcpyn(szLongFilter, TEXT("%ld"), ARRAYSIZE(szLongFilter)) ;
        lstrcpyn(szPointerFilter, TEXT("%Id"), ARRAYSIZE(szPointerFilter)) ;
      }

      break ;

    case IDM_ABOUT:
       DialogBox(hInst, TEXT("about"), hWnd, AboutProc) ;
       break ;

    default: break ;
  }

  return ;
}

BOOL InitApplication ( HANDLE )

Definition at line 123 of file ClipText.c.

{
    WNDCLASS  wc = {0};

    wc.lpfnWndProc = (WNDPROC) MainWndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName =  TEXT("CliptextMenu");
    wc.lpszClassName = TEXT("CliptextWClass");

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | ,
 |  | int |
 | ) |  |

Definition at line 126 of file ComDlg32.C.

{
    HWND            hWnd;

  // Save off the handle to the current instance.
    g_hInst = hInstance;

    // Create a main window for this application instance.
    hWnd = CreateWindow(
        "Comdlg32WClass",
        "Common Dialog Sample Application",
        WS_OVERLAPPEDWINDOW,            // Window style.
        CW_USEDEFAULT,                  // Default horizontal position.
        CW_USEDEFAULT,                  // Default vertical position.
        CW_USEDEFAULT,                  // Default width.
        CW_USEDEFAULT,                  // Default height.
        NULL,                           // Overlapped windows have no parent.
        NULL,                           // Use the window class menu.
        g_hInst,                        // This instance owns this window.
        NULL                            // Pointer not needed.
    );

    // If window could not be created, return "failure".
    if (!hWnd)
        return (FALSE);

    // Register the window messages to receive.
    cdmsgShareViolation = RegisterWindowMessage(szmsgSHAREVIOLATION);
    cdmsgFileOK         = RegisterWindowMessage(szmsgFILEOK);
    cdmsgHelp           = RegisterWindowMessage(szCommdlgHelp);

    // Make the window visible; update its client area; and return "success".
    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);
    return (TRUE);

}

LRESULT APIENTRY MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

Variable Documentation

HINSTANCE hInst

Definition at line 10 of file CDTest.h.

UINT nFindMsg

Definition at line 41 of file CDTest.h.

UINT nHelpMessage

Definition at line 43 of file CDTest.h.

UINT nOpenShareVMsg

Definition at line 42 of file CDTest.h.

TCHAR szLongFilter[5]

Definition at line 23 of file CDTest.h.

TCHAR szPointerFilter[5]

Definition at line 24 of file CDTest.h.

TCHAR szShortFilter[5]

Definition at line 22 of file CDTest.h.

TCHAR szTemp[100]

Definition at line 20 of file CDTest.h.

Generated on Wed Nov 13 2024 16:55:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Colors.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

Colors.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <stdlib.h>
#include <winnls.h>
#include "cdtest.h"
#include "colors.h"

Go to the source code of this file.

Defines

#define | WSIZECC 30

Functions

UINT_PTR CALLBACK | ColorsHookProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR APIENTRY | ColorsProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
DWORD ColorThreadProc1 (LPDWORD)
DWORD ColorThreadProc2 (LPDWORD)
void | DoChooseColorStuff (HWND, LPCHOOSECOLOR)
void | DoColorsDialog (HWND hwnd)
void | EnableColorButtons (HWND, BOOL)
void | FillColorDlg (HWND hwnd, LPCHOOSECOLOR)
void | GetColorDlg (HWND hwnd, LPCHOOSECOLOR)
HANDLE | GetColorsResHandle (void)
void | InitColorStruct (HWND hwnd, LPCHOOSECOLOR)
void | MultiThreadColorDlg (void)
LONG_PTR | MyAtol (LPTSTR, BOOL, LPBOOL)

Variables

CHOOSECOLOR | cc
CHOOSECOLOR | ccThread1
CHOOSECOLOR | ccThread2
DWORD dwColor
DWORD dwColorThreadID1
DWORD dwColorThreadID2
DWORD dwColorThreadParm1
DWORD dwColorThreadParm2
DWORD | dwCustColors [16]
HANDLE hColorThread1
HANDLE hColorThread2
HGLOBAL hDialogColors
HRSRC | hResColors
HWND | hwndMainColor
int | nOpenColorDlgCount
TCHAR | szTemplateNameC [50]
UINT_PTR | uMode

Define Documentation

#define WSIZECC 30

Function Documentation

UINT_PTR CALLBACK ColorsHookProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 460 of file Colors.c.

{
  LPCHOOSECOLOR pCc ;
  TCHAR szMsg[50] ;

  switch(msg)
  {
    case WM_INITDIALOG:

      /* During initialization of the ChooseColor() dialog, if there is a
         hook proc the ChooseColor() function will send a pointer to the
         current CHOOSECOLOR structure in the wParam parameter */

      pCc = (LPCHOOSECOLOR) lParam ;

      if (pCc->lCustData != 0L)
      {
        wsprintf(szMsg, TEXT("CHOOSECOLOR->lCustData is: %ld"), pCc->lCustData) ;
        MessageBox(hwnd, szMsg, TEXT("lCustData Sent!"), MB_OK | MB_APPLMODAL) ;
      }

      SetWindowText(hwnd, TEXT("Color Hook Proc Dialog")) ;

      break ;

    default:
      break ;
  }

  return 0 ;   //send msg to the common dialog code
}

INT_PTR APIENTRY ColorsProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 140 of file Colors.c.

{
  BOOL bRet = FALSE ;

  switch (msg)
  {

    case WM_INITDIALOG:

       InitColorStruct(hwnd, &cc) ;  //initialize the CHOOSECOLOR structure
       FillColorDlg(hwnd, &cc) ;  //and fill the colors dialog.

       nOpenColorDlgCount = 0 ;

       hwndMainColor = hwnd ;

       *(&ccThread1) = *(&ccThread2) = *(&cc) ;

       SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEC)) ;

       break ;

     case UMSG_DECREMENTDLGCOUNT:  //user defined message indicating
                                   //the closure of a multithreaded dialog

       /* Keep the main colors dialog buttons disabled until the last
          multithreaded dialog function has returned. */

       nOpenColorDlgCount-- ;

       if (nOpenColorDlgCount == 0)
         EnableColorButtons(hwnd, TRUE) ;

       break ;

     case WM_COMMAND:

        switch (LOWORD(wParam))
        {
          case IDOK:

            GetColorDlg(hwnd, &cc) ;            //get user's choices

            DoChooseColorStuff(hwnd, &cc) ;     //do the dialog

            break ;

          case ID_RESETC:

            SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
              (WPARAM) 0, (LPARAM) 0) ;

            InitColorStruct(hwnd, &cc) ;
            FillColorDlg(hwnd, &cc) ;

            SendDlgItemMessage(hwnd, ID_NULLSTRUCTCOLOR, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PRELOADEDCOLORS, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;

            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEC)) ;

            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_ADD1C:
            GetDlgItemText(hwnd, ID_CUSTCOLORSC, szTemp, 100) ;

            if (*szTemp)
              SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_ADDSTRING,
                                 (WPARAM) 0, (LPARAM) (LPTSTR) szTemp) ;
            break ;

          case ID_CLEAR1C:
            SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
                               (WPARAM) 0, (LPARAM) 0) ;
            break ;

          case ID_MULTITHREADCOLORS:

            /* Start the dialog count off at 2, disable the main dialog's
               buttons, and multithread */

            nOpenColorDlgCount = 2 ;

            EnableColorButtons(hwnd, FALSE) ;

            MultiThreadColorDlg() ;

            break ;

          default: break ;
        }

    default:

      /* If the help button is pressed in the ChooseColor()
         dialog, it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                   TEXT("Colors Help Button"), MB_OK | MB_APPLMODAL) ;

      break ;
  }

  return FALSE ;
}

DWORD ColorThreadProc1 ( LPDWORD pdw )

Definition at line 603 of file Colors.c.

{
  GetColorDlg(hwndMainColor, &ccThread1) ;
  DoChooseColorStuff(hwndMainColor, &ccThread1) ;

  PostMessage(hwndMainColor, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;

  return 0L ;
}

DWORD ColorThreadProc2 ( LPDWORD pdw )

Definition at line 632 of file Colors.c.

{
  GetColorDlg(hwndMainColor, &ccThread2) ;
  DoChooseColorStuff(hwndMainColor, &ccThread2) ;

  PostMessage(hwndMainColor, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;

  return 0L ;
}

void DoChooseColorStuff | ( | HWND | hwnd,
 |  | LPCHOOSECOLOR | pcc
 | ) |  |

Definition at line 544 of file Colors.c.

{
  BOOL bRet ;

  /* If the "Preloaded template button is checked, load a handle for
     the custom template and put it in the hInstance member of the
     CHOOSECOLOR structure */

  if (IsDlgButtonChecked(hwnd, ID_PRELOADEDCOLORS) == 1)
    pcc->hInstance = GetColorsResHandle() ;

   /* If the "NULL Structure" box is checked, call ChooseColor() will
      a NULL pointer.  Otherwise call with the current CHOOSECOLOR pointer */

  if (IsDlgButtonChecked(hwnd, ID_NULLSTRUCTCOLOR) == 1)
    bRet = ChooseColor((LPCHOOSECOLOR) NULL) ;
  else
    bRet = ChooseColor(pcc) ;

  if (pcc->hInstance)
  {
    FreeResource(hDialogColors) ;
    hDialogColors = (HANDLE) 0 ;
    hResColors = (HANDLE) 0 ;
  }

  /* Fill the results into the main colors dialog */

  FillColorDlg(hwnd, pcc) ;

  wsprintf(szTemp, szShortFilter, bRet) ;
  SetDlgItemText(hwnd, ID_RETURNC, szTemp) ;

  wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
  SetDlgItemText(hwnd, ID_ERRORC, szTemp) ;

}

void DoColorsDialog ( HWND hwnd )

Definition at line 112 of file Colors.c.

{

  DialogBox(hInst, MAKEINTRESOURCE(ID_COLORSDIALOG),
            hwnd, ColorsProc) ;

}

void EnableColorButtons | ( | HWND | hwnd,
 |  | BOOL | bEnable
 | ) |  |

Definition at line 727 of file Colors.c.

{
  EnableWindow(GetDlgItem(hwnd, IDOK), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, IDCANCEL), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_RESETC), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_MULTITHREADCOLORS), bEnable) ;
}

void FillColorDlg | ( | HWND | hwnd,
 |  | LPCHOOSECOLOR | pcc
 | ) |  |

Definition at line 328 of file Colors.c.

{
  int i ;

  wsprintf(szTemp, szLongFilter, pcc->lStructSize) ;
  SetDlgItemText(hwnd, ID_STRUCTSIZEC, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcc->hwndOwner) ;
  SetDlgItemText(hwnd, ID_HWNDOWNERC, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcc->hInstance) ;
  SetDlgItemText(hwnd, ID_HINSTANCEC, szTemp) ;

  wsprintf(szTemp, szLongFilter, pcc->rgbResult) ;
  SetDlgItemText(hwnd, ID_RGBRESULTC, szTemp) ;

  SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
                     (WPARAM) 0, (LPARAM) 0) ;

  for (i=0; i<16; i++)
  {
    wsprintf(szTemp, szLongFilter, dwCustColors[i]) ;
    SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_ADDSTRING,
                       (WPARAM) 0, (LPARAM) (LPTSTR) szTemp) ;
  }

  SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_SETCURSEL,
                     (WPARAM) 0 , (LPARAM) 0) ;

  wsprintf(szTemp, szLongFilter, pcc->Flags) ;
  SetDlgItemText(hwnd, ID_FLAGSC, szTemp) ;

  wsprintf(szTemp, szLongFilter, pcc->lCustData) ;
  SetDlgItemText(hwnd, ID_CUSTDATAC, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcc->lpfnHook) ;
  SetDlgItemText(hwnd, ID_HOOKC, szTemp) ;

  SetDlgItemText(hwnd, ID_TEMPLATEC, (LPTSTR) pcc->lpTemplateName) ;
}

void GetColorDlg | ( | HWND | hwnd,
 |  | LPCHOOSECOLOR | pcc
 | ) |  |

Definition at line 390 of file Colors.c.

{
  int i ;
  BOOL b ;
  TCHAR szNum[30] ;

  #define WSIZECC 30

  GetDlgItemText(hwnd, ID_STRUCTSIZEC, szNum, WSIZECC) ;
  pcc->lStructSize = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HWNDOWNERC, szNum, WSIZECC) ;
  pcc->hwndOwner = (HWND) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HINSTANCEC, szNum, WSIZECC) ;
  pcc->hInstance = (HANDLE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_RGBRESULTC, szNum, WSIZECC) ;
  pcc->rgbResult = (COLORREF) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  for (i=0; i<16; i++)
  {
    if (SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_GETLBTEXT,
                          (WPARAM) i, (LPARAM) (LPTSTR) szNum) != CB_ERR)

      dwCustColors[i] = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

    else
      dwCustColors[i] = (DWORD) 0 ;

    *(pcc->lpCustColors + i) = dwCustColors[i] ;
  }

  GetDlgItemText(hwnd, ID_FLAGSC, szNum, WSIZECC) ;
  pcc->Flags = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_CUSTDATAC, szNum, WSIZECC) ;
  pcc->lCustData = MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HOOKC, szNum, WSIZECC) ;
  pcc->lpfnHook = (LPCCHOOKPROC) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_TEMPLATEC, (LPTSTR) pcc->lpTemplateName, 50) ;

  return ;
}

HANDLE GetColorsResHandle ( void )

Definition at line 514 of file Colors.c.

{

  hResColors = FindResource(hInst, TEXT("clrtemp"), RT_DIALOG) ;

  hDialogColors = LoadResource(hInst, hResColors) ;

  return hDialogColors ;
}

void InitColorStruct | ( | HWND | hwnd,
 |  | LPCHOOSECOLOR | pcc
 | ) |  |

Definition at line 279 of file Colors.c.

{
  int i ;

  pcc->lStructSize  = sizeof(CHOOSECOLOR) ;
  pcc->hwndOwner    = hwnd ;
  pcc->hInstance    = (HANDLE) hInst ;

  dwColor = RGB(0, 0, 0) ;
  pcc->rgbResult    = dwColor ;

  for (i=0; i<16; i++)
    dwCustColors[i] = (RGB(255-i*10, i, i*10)) ;

  pcc->lpCustColors = (LPDWORD) dwCustColors ;

  pcc->Flags     = CC_FULLOPEN | CC_SHOWHELP | CC_RGBINIT ;

  pcc->lCustData = 0 ;

  pcc->lpfnHook = ColorsHookProc ;

  lstrcpyn(szTemplateNameC, TEXT("clrtemp"), ARRAYSIZE(szTemplateNameC)) ;         //name of custom template

  pcc->lpTemplateName = (LPTSTR) szTemplateNameC ;

  return ;
}

void MultiThreadColorDlg ( void )

Definition at line 667 of file Colors.c.

{

  dwColorThreadParm1 = dwColorThreadParm2 = 0L ;

  if (!(hColorThread1 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                     (LPTHREAD_START_ROUTINE) ColorThreadProc1,
                                     &dwColorThreadParm1, CREATE_SUSPENDED, &dwColorThreadID1)))

  {
    MessageBox(GetForegroundWindow(), TEXT("Error creating thread 1"), NULL,
               MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;

    nOpenColorDlgCount = 0 ;

    EnableColorButtons(hwndMainColor, TRUE) ;

    return ;
  }

  if (!(hColorThread2 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                     (LPTHREAD_START_ROUTINE) ColorThreadProc2,
                                     &dwColorThreadParm2, CREATE_SUSPENDED, &dwColorThreadID2)))
  {
    MessageBox(GetForegroundWindow(), TEXT("Error creating thread 2"), NULL,
               MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;

    nOpenColorDlgCount = 0 ;

    EnableColorButtons(hwndMainColor, TRUE) ;

    return ;
  }

  ResumeThread(hColorThread1) ;

  ResumeThread(hColorThread2) ;

  return ;
}

LONG_PTR MyAtol | ( | LPTSTR | ,
 |  | BOOL | ,
 |  | LPBOOL |
 | ) |  |

Definition at line 460 of file CDTest.c.

{
  LPTSTR p ;
  LONG l ;
  LONG lMultiplier ;
  BOOL bDigit ;

  if (bHex)
    lMultiplier = 16 ;
  else
    lMultiplier = 10 ;

  p = szString ;
  l = 0 ;

  while (*p)      //while chars
  {
     bDigit = FALSE ;  //set to false for each char that we look at

     if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
     {
       bDigit = TRUE ;
       l+=(*p - (TCHAR) '0') ;
     }

     if (bHex)
     {
       if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
       {
         l+=(*p - (TCHAR) 'A' + 10) ;
         bDigit = TRUE ;
       }

       if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
       {
         l+=(*p - (TCHAR) 'a' + 10) ;
         bDigit = TRUE ;
       }

     }

     if (bDigit == FALSE)
     {
       *bSuccess = FALSE ;
       return 0 ;
     }

     p++ ;               //get next char

     if (*p)             //if there is going to be at least one more char
       l*=lMultiplier ;  //then multiply what we have by the multiplier...
  }

  *bSuccess = TRUE ;

  return l ;             //success! return the value.
}

Variable Documentation

CHOOSECOLOR cc

Definition at line 69 of file Colors.c.

CHOOSECOLOR ccThread1

Definition at line 94 of file Colors.c.

CHOOSECOLOR ccThread2

Definition at line 95 of file Colors.c.

DWORD dwColor

Definition at line 71 of file Colors.c.

DWORD dwColorThreadID1

Definition at line 82 of file Colors.c.

DWORD dwColorThreadID2

Definition at line 83 of file Colors.c.

DWORD dwColorThreadParm1

Definition at line 84 of file Colors.c.

DWORD dwColorThreadParm2

Definition at line 85 of file Colors.c.

DWORD dwCustColors[16]

Definition at line 70 of file Colors.c.

HANDLE hColorThread1

Definition at line 90 of file Colors.c.

HANDLE hColorThread2

Definition at line 91 of file Colors.c.

HGLOBAL hDialogColors

Definition at line 73 of file Colors.c.

HRSRC hResColors

Definition at line 72 of file Colors.c.

HWND hwndMainColor

Definition at line 92 of file Colors.c.

int nOpenColorDlgCount

Definition at line 93 of file Colors.c.

TCHAR szTemplateNameC[50]

Definition at line 75 of file Colors.c.

UINT_PTR uMode

Definition at line 69 of file CDTest.c.

Generated on Wed Nov 13 2024 16:55:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Colors.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions

Colors.h File Reference

Go to the source code of this file.

Defines

#define | ID_ADD1C 508
#define | ID_CLEAR1C 509
#define | ID_COLORSDIALOG 602
#define | ID_CUSTCOLORSC 503
#define | ID_CUSTDATAC 504
#define | ID_ERRORC 510
#define | ID_FLAGSC 512
#define | ID_HINSTANCEC 502
#define | ID_HOOKC 505
#define | ID_HWNDOWNERC 500
#define | ID_MULTITHREADCOLORS 606
#define | ID_NULLSTRUCTCOLOR 604
#define | ID_PRELOADEDCOLORS 605
#define | ID_RESETC 603
#define | ID_RETURNC 511
#define | ID_RGBRESULTC 507
#define | ID_STRUCTSIZEC 501
#define | ID_TEMPLATEC 506

Functions

INT_PTR APIENTRY | ColorsProc (HWND, UINT, WPARAM, LPARAM)
void | DoColorsDialog (HWND)

Define Documentation

#define ID_ADD1C 508

Definition at line 18 of file Colors.h.

#define ID_CLEAR1C 509

Definition at line 19 of file Colors.h.

#define ID_COLORSDIALOG 602

Definition at line 23 of file Colors.h.

#define ID_CUSTCOLORSC 503

Definition at line 13 of file Colors.h.

#define ID_CUSTDATAC 504

Definition at line 14 of file Colors.h.

#define ID_ERRORC 510

Definition at line 20 of file Colors.h.

#define ID_FLAGSC 512

Definition at line 25 of file Colors.h.

#define ID_HINSTANCEC 502

Definition at line 12 of file Colors.h.

#define ID_HOOKC 505

Definition at line 15 of file Colors.h.

#define ID_HWNDOWNERC 500

Definition at line 10 of file Colors.h.

#define ID_MULTITHREADCOLORS 606

Definition at line 29 of file Colors.h.

#define ID_NULLSTRUCTCOLOR 604

Definition at line 27 of file Colors.h.

#define ID_PRELOADEDCOLORS 605

Definition at line 28 of file Colors.h.

#define ID_RESETC 603

Definition at line 26 of file Colors.h.

#define ID_RETURNC 511

Definition at line 21 of file Colors.h.

#define ID_RGBRESULTC 507

Definition at line 17 of file Colors.h.

#define ID_STRUCTSIZEC 501

Definition at line 11 of file Colors.h.

#define ID_TEMPLATEC 506

Definition at line 16 of file Colors.h.

Function Documentation

INT_PTR APIENTRY ColorsProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 140 of file Colors.c.

{
  BOOL bRet = FALSE ;

  switch (msg)
  {

    case WM_INITDIALOG:

       InitColorStruct(hwnd, &cc) ;  //initialize the CHOOSECOLOR structure
       FillColorDlg(hwnd, &cc) ;  //and fill the colors dialog.

       nOpenColorDlgCount = 0 ;

       hwndMainColor = hwnd ;

       *(&ccThread1) = *(&ccThread2) = *(&cc) ;

       SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEC)) ;

       break ;

     case UMSG_DECREMENTDLGCOUNT:  //user defined message indicating
                                   //the closure of a multithreaded dialog

       /* Keep the main colors dialog buttons disabled until the last
          multithreaded dialog function has returned. */

       nOpenColorDlgCount-- ;

       if (nOpenColorDlgCount == 0)
         EnableColorButtons(hwnd, TRUE) ;

       break ;

     case WM_COMMAND:

        switch (LOWORD(wParam))
        {
          case IDOK:

            GetColorDlg(hwnd, &cc) ;            //get user's choices

            DoChooseColorStuff(hwnd, &cc) ;     //do the dialog

            break ;

          case ID_RESETC:

            SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
              (WPARAM) 0, (LPARAM) 0) ;

            InitColorStruct(hwnd, &cc) ;
            FillColorDlg(hwnd, &cc) ;

            SendDlgItemMessage(hwnd, ID_NULLSTRUCTCOLOR, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PRELOADEDCOLORS, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;

            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEC)) ;

            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_ADD1C:
            GetDlgItemText(hwnd, ID_CUSTCOLORSC, szTemp, 100) ;

            if (*szTemp)
              SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_ADDSTRING,
                                 (WPARAM) 0, (LPARAM) (LPTSTR) szTemp) ;
            break ;

          case ID_CLEAR1C:
            SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
                               (WPARAM) 0, (LPARAM) 0) ;
            break ;

          case ID_MULTITHREADCOLORS:

            /* Start the dialog count off at 2, disable the main dialog's
               buttons, and multithread */

            nOpenColorDlgCount = 2 ;

            EnableColorButtons(hwnd, FALSE) ;

            MultiThreadColorDlg() ;

            break ;

          default: break ;
        }

    default:

      /* If the help button is pressed in the ChooseColor()
         dialog, it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                   TEXT("Colors Help Button"), MB_OK | MB_APPLMODAL) ;

      break ;
  }

  return FALSE ;
}

void DoColorsDialog ( HWND )

Definition at line 112 of file Colors.c.

{

  DialogBox(hInst, MAKEINTRESOURCE(ID_COLORSDIALOG),
            hwnd, ColorsProc) ;

}

Generated on Wed Nov 13 2024 16:55:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/DevMode.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines

DevMode.h File Reference

Go to the source code of this file.

Defines

#define | ID_ADD1DM 119
#define | ID_CLEAR1DM 120
#define | ID_DEVMODEDIALOG 710
#define | ID_DMBITSPERPEL 142
#define | ID_DMCOLLATE 138
#define | ID_DMCOLOR 135
#define | ID_DMCOPIES 132
#define | ID_DMDEFAULTSOURCE 133
#define | ID_DMDEVNAME 121
#define | ID_DMDISPLAYFREQ 148
#define | ID_DMDRIVERDATA 118
#define | ID_DMDRIVEREXTRA 125
#define | ID_DMDRIVERVER 124
#define | ID_DMDUPLEX 136
#define | ID_DMFIELDS 117
#define | ID_DMFORMNAME 141
#define | ID_DMORIENTATION 137
#define | ID_DMPAPERLENGTH 129
#define | ID_DMPAPERSIZE 128
#define | ID_DMPAPERWIDTH 130
#define | ID_DMPELSHEIGHT 147
#define | ID_DMPELSWIDTH 146
#define | ID_DMPRINTQUALITY 134
#define | ID_DMRESETDEV 127
#define | ID_DMSCALE 131
#define | ID_DMSIZEDEV 123
#define | ID_DMSPECVER 122

Define Documentation

#define ID_ADD1DM 119

Definition at line 9 of file DevMode.h.

#define ID_CLEAR1DM 120

Definition at line 10 of file DevMode.h.

#define ID_DEVMODEDIALOG 710

Definition at line 6 of file DevMode.h.

#define ID_DMBITSPERPEL 142

Definition at line 30 of file DevMode.h.

#define ID_DMCOLLATE 138

Definition at line 28 of file DevMode.h.

#define ID_DMCOLOR 135

Definition at line 23 of file DevMode.h.

#define ID_DMCOPIES 132

Definition at line 20 of file DevMode.h.

#define ID_DMDEFAULTSOURCE 133

Definition at line 21 of file DevMode.h.

#define ID_DMDEVNAME 121

Definition at line 11 of file DevMode.h.

#define ID_DMDISPLAYFREQ 148

Definition at line 33 of file DevMode.h.

#define ID_DMDRIVERDATA 118

Definition at line 8 of file DevMode.h.

#define ID_DMDRIVEREXTRA 125

Definition at line 15 of file DevMode.h.

#define ID_DMDRIVERVER 124

Definition at line 14 of file DevMode.h.

#define ID_DMDUPLEX 136

Definition at line 24 of file DevMode.h.

#define ID_DMFIELDS 117

Definition at line 27 of file DevMode.h.

#define ID_DMFORMNAME 141

Definition at line 29 of file DevMode.h.

#define ID_DMORIENTATION 137

Definition at line 25 of file DevMode.h.

#define ID_DMPAPERLENGTH 129

Definition at line 17 of file DevMode.h.

#define ID_DMPAPERSIZE 128

Definition at line 16 of file DevMode.h.

#define ID_DMPAPERWIDTH 130

Definition at line 18 of file DevMode.h.

#define ID_DMPELSHEIGHT 147

Definition at line 32 of file DevMode.h.

#define ID_DMPELSWIDTH 146

Definition at line 31 of file DevMode.h.

#define ID_DMPRINTQUALITY 134

Definition at line 22 of file DevMode.h.

#define ID_DMRESETDEV 127

Definition at line 26 of file DevMode.h.

#define ID_DMSCALE 131

Definition at line 19 of file DevMode.h.

#define ID_DMSIZEDEV 123

Definition at line 13 of file DevMode.h.

#define ID_DMSPECVER 122

Definition at line 12 of file DevMode.h.

Generated on Wed Nov 13 2024 16:55:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/DevNames.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines

DevNames.h File Reference

Go to the source code of this file.

Defines

#define | ID_DEVNAMESDIALOG 700
#define | ID_RESETDEVNAMES 109
#define | ID_WDEFAULT 108
#define | ID_WDEVICEOFF 106
#define | ID_WDRIVEROFF 105
#define | ID_WOUTPUTOFF 107

Define Documentation

#define ID_DEVNAMESDIALOG 700

Definition at line 10 of file DevNames.h.

#define ID_RESETDEVNAMES 109

Definition at line 11 of file DevNames.h.

#define ID_WDEFAULT 108

Definition at line 9 of file DevNames.h.

#define ID_WDEVICEOFF 106

Definition at line 7 of file DevNames.h.

#define ID_WDRIVEROFF 105

Definition at line 6 of file DevNames.h.

#define ID_WOUTPUTOFF 107

Definition at line 8 of file DevNames.h.

Generated on Wed Nov 13 2024 16:55:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Find.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

Find.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <stdlib.h>
#include <winnls.h>
#include <shlwapi.h>
#include "cdtest.h"
#include "find.h"
#include "replace.h"

Go to the source code of this file.

Defines

#define | WSIZEFR 30

Functions

void | DoFindDialog (HWND hwnd)
void | DoFindRepStuff (LPFINDREPLACE)
void | FillFindDlg (HWND, LPFINDREPLACE)
INT_PTR APIENTRY | FindProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
UINT_PTR CALLBACK | FindReplaceHookProc (HWND, UINT, WPARAM, LPARAM)
void | GetFindDlg (HWND, LPFINDREPLACE)
HANDLE | GetFindDlgHandle (void)
HANDLE | GetReplaceDlgHandle (void)
void | InitFindStruct (HWND, LPFINDREPLACE)
LRESULT CALLBACK | lpfnFilterProc (int nCode, WPARAM wParam, LPARAM lParam)
LONG_PTR | MyAtol (LPTSTR, BOOL, LPBOOL)

Variables

FINDREPLACE | fr
HBRUSH | hBrushButton
HBRUSH | hBrushDlg
HBRUSH | hBrushEdit
HGLOBAL hDialogFind
HRSRC | hResFind
HWND | hwndFind
HWND | hwndMainDialog
LPFINDREPLACE | lpFr
TCHAR | szFindWhat [100]
TCHAR | szReplaceWith [100]
TCHAR | szTemplate [40]
UINT_PTR | uMode

Define Documentation

#define WSIZEFR 30

Function Documentation

void DoFindDialog ( HWND hwnd )

Definition at line 169 of file Find.c.

{
  bDoFindDlg = TRUE ;

  /* this is a little different than the others.  If the dialog is just
     created normally, it will make no IsDlgMessage() checks and the
     find/replace dialogs will have no keyboard input (i.e. tabbing and
     alt+key-ing from control to control.  To fix this, a message hook
     and message filter have to be installed

     It must be set to only look at the input for the current thread, or other
     programs will be interrupted by this hook also.
  */

  hHook = SetWindowsHookEx(WH_MSGFILTER, lpfnFilterProc,
                           hInst, GetCurrentThreadId()) ;

  if (!hHook) return ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_FINDDIALOG), hwnd, FindProc) ;

  UnhookWindowsHookEx(hHook) ;

}

void DoFindRepStuff ( LPFINDREPLACE pfr )

Definition at line 664 of file Find.c.

{
  if (IsDlgButtonChecked(hwndMainDialog, ID_PRELOADEDFIND) == 1)
  {
    if (bDoFindDlg)
      pfr->hInstance = GetFindDlgHandle() ;
    else
      pfr->hInstance = GetReplaceDlgHandle() ;
  }

  if (bDoFindDlg)
  {
    if (IsDlgButtonChecked(hwndMainDialog, ID_FRNULLSTRUCT) == 1)
    {
        hwndFind = FindText((LPFINDREPLACE) NULL) ;
    }
    else
    {
        hwndFind = FindText(pfr) ;
    }
  }
  else
  {
    if (IsDlgButtonChecked(hwndMainDialog, ID_FRNULLSTRUCT) == 1)
    {
        hwndFind = ReplaceText((LPFINDREPLACE) NULL) ;
    }
    else
    {
        hwndFind = ReplaceText(pfr) ;
    }

  }

  wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
  SetDlgItemText(hwndMainDialog, ID_ERRORFT, szTemp) ;

  wsprintf(szTemp, szLongFilter, hwndFind) ;
  SetDlgItemText(hwndMainDialog, ID_RETURNFT, szTemp) ;
}

void FillFindDlg | ( | HWND | hwnd,
 |  | LPFINDREPLACE | pfr
 | ) |  |

Definition at line 383 of file Find.c.

{
  wsprintf(szTemp, szLongFilter, pfr->lStructSize) ;
  SetDlgItemText(hwnd, ID_STRUCTSIZEFT, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pfr->hwndOwner) ;
  SetDlgItemText(hwnd, ID_HWNDOWNERFT, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pfr->hInstance) ;
  SetDlgItemText(hwnd, ID_HINSTANCEFT, szTemp) ;

  wsprintf(szTemp, szLongFilter, pfr->Flags) ;
  SetDlgItemText(hwnd, ID_FLAGSFT, szTemp) ;

  SetDlgItemText(hwnd, ID_FINDWHATFT, pfr->lpstrFindWhat) ;

  wsprintf(szTemp, szLongFilter, pfr->wFindWhatLen) ;
  SetDlgItemText(hwnd, ID_FINDWHATLENFT, szTemp) ;

  SetDlgItemText(hwnd, ID_REPLACEWITHFT, pfr->lpstrReplaceWith) ;

  wsprintf(szTemp, szLongFilter, pfr->wReplaceWithLen) ;
  SetDlgItemText(hwnd, ID_REPLACEWITHLENFT, szTemp) ;

  wsprintf(szTemp, szLongFilter, pfr->lCustData) ;
  SetDlgItemText(hwnd, ID_CUSTDATAFT, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pfr->lpfnHook) ;
  SetDlgItemText(hwnd, ID_HOOKFT, szTemp) ;

  SetDlgItemText(hwnd, ID_TEMPLATEFT, pfr->lpTemplateName) ;
}

INT_PTR APIENTRY FindProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 213 of file Find.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:

        if (bDoFindDlg)
          SetWindowText(hwnd, TEXT("FindText()")) ;
        else
          SetWindowText(hwnd, TEXT("ReplaceText()")) ;

        InitFindStruct(hwnd, &fr) ;
        FillFindDlg(hwnd, &fr) ;

        hwndMainDialog = hwnd ;

        /* The find and replace dialogs are a lot harder to multithread because they
           are modeless.  Modeless dialog creation functions return right after the
           dialog is created.  Since ExitThread will be called at this point, it is
           probably not possible to multithread these dialogs without a separate
           GetMessage() loop.
        */

        EnableWindow(GetDlgItem(hwnd, ID_MULTITHREADFINDREP), FALSE) ;

        SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEFT)) ;

        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetFindDlg(hwnd, &fr) ;
            DoFindRepStuff(&fr) ;
            break ;

          case ID_RESETFIND:
            SendDlgItemMessage(hwnd, ID_FRNULLSTRUCT, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PRELOADEDFIND, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            InitFindStruct(hwnd, &fr) ;
            FillFindDlg(hwnd, &fr) ;
            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEFT)) ;
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;

            break ;

          default: break ;
        }

    }

    default:

    /* nFindMsg is registered at program startup (see CDTEST.c).  The
       FindText() and ReplaceText() dialogs will communicate with the
       calling application via this message. */

    if (msg == nFindMsg)
    {
        lpFr = (LPFINDREPLACE) lParam ;

        if (lpFr->Flags & FR_DIALOGTERM)
        {
          PostMessage(hwnd, UMSG_DECREMENTDLGCOUNT, 0, 0L) ;

          if (hDialogFind)
          {
            FreeResource(hDialogFind) ;
            hDialogFind = (HANDLE) 0 ;
            hResFind = (HANDLE) 0 ;
          }

          hwndFind = (HWND) 0 ;
        }

        FillFindDlg(hwnd, &fr) ;

        wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
        SetDlgItemText(hwnd, ID_ERRORFT, szTemp) ;

        wsprintf(szTemp, szLongFilter, hwndFind) ;
        SetDlgItemText(hwnd, ID_RETURNFT, szTemp) ;
    }

    /* If the help button is pressed in the FindText() or ReplaceText()
       dialogs, it will send a message Registered with RegisterWindowMessage()
       to the parent window.  The message nHelpMessage was registered
       at application startup */

    if (msg == nHelpMessage)
      MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                 TEXT("Find Help Button"), MB_OK | MB_APPLMODAL) ;

    break ;
  }

  return FALSE ;
}

UINT_PTR CALLBACK FindReplaceHookProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 502 of file Find.c.

{
  LPFINDREPLACE pFr ;
  TCHAR szMsg[75] ;
  TCHAR szTmp[20] ;
  int i ;
  TCHAR szDefString[] = TEXT("Default String ") ;

  switch(msg)
  {
    case WM_INITDIALOG:

      pFr = (LPFINDREPLACE) lParam ;

      if (pFr->lCustData != 0L)
      {
        wsprintf(szMsg, TEXT("FINDREPLACE->lCustData is: %ld"), pFr->lCustData) ;

        MessageBox(hwnd, szMsg, TEXT("lCustData Sent!"), MB_OK | MB_APPLMODAL) ;
      }

      SetWindowText(hwnd, TEXT("Find Hook Proc Dialog")) ;

      if (GetDlgItem(hwnd, ID_DEFSTRINGS))
      {
        for (i=0; i<5; i++)
        {
          lstrcpyn(szMsg, szDefString, ARRAYSIZE(szMsg)) ;
          wsprintf(szTmp, TEXT("Number %d"), i+1) ;
          StrCatBuff(szMsg, szTmp, ARRAYSIZE(szTmp)) ;
          SendDlgItemMessage(hwnd, ID_DEFSTRINGS, LB_ADDSTRING, (WPARAM) 0,
                             (LONG_PTR) (LPTSTR) szMsg) ;
        }
      }

      return 1 ;

      break ;

    /* use the WM_CTLCOLOR* messages to change the color of the Open
       dialog */

    case WM_CTLCOLORDLG:

        if (!hBrushDlg)
            hBrushDlg = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushDlg;

        break ;

    case WM_CTLCOLORBTN:

        SetBkMode((HDC) wParam, TRANSPARENT) ;   //sets background color
                                                 //for push and check box
                                                 //buttons...

        if (!hBrushButton)
            hBrushButton = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushButton ;

        break ;

    case WM_CTLCOLORSTATIC:

        SetTextColor((HDC) wParam, RGB(0x00, 0xff, 0x00)) ;  //green
        SetBkMode((HDC) wParam, TRANSPARENT) ;               //transparent text

        if (!hBrushDlg)
            hBrushDlg = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushDlg;

        break ;

    default:
      break ;
  }

  return 0 ;   //send msg to the common dialog code
}

void GetFindDlg | ( | HWND | hwnd,
 |  | LPFINDREPLACE | pfr
 | ) |  |

Definition at line 434 of file Find.c.

{
  TCHAR szNum[30] ;
  BOOL b ;

  #define WSIZEFR 30

  GetDlgItemText(hwnd, ID_STRUCTSIZEFT, szNum, WSIZEFR) ;
  pfr->lStructSize = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HWNDOWNERFT, szNum, WSIZEFR) ;
  pfr->hwndOwner = (HWND) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HINSTANCEFT, szNum, WSIZEFR) ;
  pfr->hInstance = (HANDLE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_FLAGSFT, szNum, WSIZEFR) ;
  pfr->Flags = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_FINDWHATFT, szFindWhat, 100) ;

  GetDlgItemText(hwnd, ID_REPLACEWITHFT, szReplaceWith, 100) ;

  GetDlgItemText(hwnd, ID_FINDWHATLENFT, szNum, WSIZEFR) ;
  pfr->wFindWhatLen = (WORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_REPLACEWITHLENFT, szNum, WSIZEFR) ;
  pfr->wReplaceWithLen = (WORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_CUSTDATAFT, szNum, WSIZEFR) ;
  pfr->lCustData = MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HOOKFT, szNum, WSIZEFR) ;
  pfr->lpfnHook = (LPFRHOOKPROC) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_TEMPLATEFT, szTemplate, 40) ;
}

HANDLE GetFindDlgHandle ( void )

Definition at line 611 of file Find.c.

{
  hResFind = FindResource(hInst, TEXT("fttemp1"), RT_DIALOG) ;

  hDialogFind = LoadResource(hInst, hResFind) ;

  return hDialogFind ;
}

HANDLE GetReplaceDlgHandle ( void )

Definition at line 638 of file Find.c.

{
  hResFind = FindResource(hInst, TEXT("fttemp2"), RT_DIALOG) ;

  hDialogFind = LoadResource(hInst, hResFind) ;

  return hDialogFind ;
}

void InitFindStruct | ( | HWND | hwnd,
 |  | LPFINDREPLACE | pfr
 | ) |  |

Definition at line 341 of file Find.c.

{
  pfr->lStructSize = (DWORD) sizeof(FINDREPLACE) ;
  pfr->hwndOwner = hwnd ;
  pfr->hInstance = (HANDLE) hInst ;
  pfr->Flags = FR_DOWN | FR_SHOWHELP  ;

  lstrcpyn(szFindWhat, TEXT("Word to find"), ARRAYSIZE(szFindWhat)) ;
  pfr->lpstrFindWhat = szFindWhat ;
  pfr->wFindWhatLen = 100 ;

  lstrcpyn(szReplaceWith, TEXT("Replace with word"), ARRAYSIZE(szReplaceWith)) ;
  pfr->lpstrReplaceWith = szReplaceWith ;
  pfr->wReplaceWithLen = 100 ;

  pfr->lCustData = (DWORD) 0 ;

  pfr->lpfnHook = FindReplaceHookProc ;

  lstrcpyn(szTemplate, TEXT("fttemp1"), ARRAYSIZE(szTemplate)) ;

  pfr->lpTemplateName = szTemplate ;
}

LRESULT CALLBACK lpfnFilterProc | ( | int | nCode,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 124 of file Find.c.

{
  static bFirstTime = TRUE ;

  if (nCode < 0)
    return CallNextHookEx(hHook, nCode, wParam, lParam) ;

  if (nCode == MSGF_DIALOGBOX && bFirstTime)
  {
    bFirstTime = FALSE ;

    if (hwndFind && IsDialogMessage(hwndFind, (LPMSG) lParam))
    {
      bFirstTime = TRUE ;
      return 1L ;
    }

    else
    {
      bFirstTime = TRUE ;
      return 0L ;
    }
  }
  else return 0L ;
}

LONG_PTR MyAtol | ( | LPTSTR | ,
 |  | BOOL | ,
 |  | LPBOOL |
 | ) |  |

Definition at line 460 of file CDTest.c.

{
  LPTSTR p ;
  LONG l ;
  LONG lMultiplier ;
  BOOL bDigit ;

  if (bHex)
    lMultiplier = 16 ;
  else
    lMultiplier = 10 ;

  p = szString ;
  l = 0 ;

  while (*p)      //while chars
  {
     bDigit = FALSE ;  //set to false for each char that we look at

     if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
     {
       bDigit = TRUE ;
       l+=(*p - (TCHAR) '0') ;
     }

     if (bHex)
     {
       if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
       {
         l+=(*p - (TCHAR) 'A' + 10) ;
         bDigit = TRUE ;
       }

       if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
       {
         l+=(*p - (TCHAR) 'a' + 10) ;
         bDigit = TRUE ;
       }

     }

     if (bDigit == FALSE)
     {
       *bSuccess = FALSE ;
       return 0 ;
     }

     p++ ;               //get next char

     if (*p)             //if there is going to be at least one more char
       l*=lMultiplier ;  //then multiply what we have by the multiplier...
  }

  *bSuccess = TRUE ;

  return l ;             //success! return the value.
}

Variable Documentation

FINDREPLACE fr

Definition at line 85 of file Find.c.

HBRUSH hBrushButton

Definition at line 99 of file Find.c.

HBRUSH hBrushDlg

Definition at line 97 of file Find.c.

HBRUSH hBrushEdit

Definition at line 98 of file Find.c.

HGLOBAL hDialogFind

Definition at line 93 of file Find.c.

HRSRC hResFind

Definition at line 92 of file Find.c.

HWND hwndFind

Definition at line 82 of file Find.c.

HWND hwndMainDialog

Definition at line 83 of file Find.c.

LPFINDREPLACE lpFr

Definition at line 86 of file Find.c.

TCHAR szFindWhat[100]

Definition at line 88 of file Find.c.

TCHAR szReplaceWith[100]

Definition at line 89 of file Find.c.

TCHAR szTemplate[40]

Definition at line 90 of file Find.c.

UINT_PTR uMode

Definition at line 69 of file CDTest.c.

Generated on Wed Nov 13 2024 16:55:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Find.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

Find.h File Reference

Go to the source code of this file.

Defines

#define | ID_CUSTDATAFT 118
#define | ID_DEFSTRINGS 101
#define | ID_ERRORFT 123
#define | ID_FINDDIALOG 600
#define | ID_FINDLEFT 604
#define | ID_FINDRIGHT 605
#define | ID_FINDWHATFT 114
#define | ID_FINDWHATLENFT 116
#define | ID_FLAGSFT 113
#define | ID_FLAGSMSG 128
#define | ID_FRNULLSTRUCT 601
#define | ID_HINSTANCEFT 125
#define | ID_HOOKFT 119
#define | ID_HWNDOWNERFT 112
#define | ID_MULTITHREADFINDREP 603
#define | ID_PRELOADEDFIND 602
#define | ID_REPLACEWITHFT 115
#define | ID_REPLACEWITHLENFT 117
#define | ID_RESETFIND 127
#define | ID_RETURNFT 124
#define | ID_STRUCTSIZEFT 111
#define | ID_TEMPLATEFT 120

Functions

void | DoFindDialog (HWND)
INT_PTR APIENTRY | FindProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | lpfnFilterProc (int, WPARAM, LPARAM)

Variables

BOOL bDoFindDlg
HHOOK | hHook

Define Documentation

#define ID_CUSTDATAFT 118

Definition at line 25 of file Find.h.

#define ID_DEFSTRINGS 101

Definition at line 43 of file Find.h.

#define ID_ERRORFT 123

Definition at line 28 of file Find.h.

#define ID_FINDDIALOG 600

Definition at line 32 of file Find.h.

#define ID_FINDLEFT 604

Definition at line 41 of file Find.h.

#define ID_FINDRIGHT 605

Definition at line 42 of file Find.h.

#define ID_FINDWHATFT 114

Definition at line 21 of file Find.h.

#define ID_FINDWHATLENFT 116

Definition at line 23 of file Find.h.

#define ID_FLAGSFT 113

Definition at line 20 of file Find.h.

#define ID_FLAGSMSG 128

Definition at line 35 of file Find.h.

#define ID_FRNULLSTRUCT 601

Definition at line 36 of file Find.h.

#define ID_HINSTANCEFT 125

Definition at line 33 of file Find.h.

#define ID_HOOKFT 119

Definition at line 26 of file Find.h.

#define ID_HWNDOWNERFT 112

Definition at line 19 of file Find.h.

#define ID_MULTITHREADFINDREP 603

Definition at line 38 of file Find.h.

#define ID_PRELOADEDFIND 602

Definition at line 37 of file Find.h.

#define ID_REPLACEWITHFT 115

Definition at line 22 of file Find.h.

#define ID_REPLACEWITHLENFT 117

Definition at line 24 of file Find.h.

#define ID_RESETFIND 127

Definition at line 34 of file Find.h.

#define ID_RETURNFT 124

Definition at line 29 of file Find.h.

#define ID_STRUCTSIZEFT 111

Definition at line 18 of file Find.h.

#define ID_TEMPLATEFT 120

Definition at line 27 of file Find.h.

Function Documentation

void DoFindDialog ( HWND )

Definition at line 169 of file Find.c.

{
  bDoFindDlg = TRUE ;

  /* this is a little different than the others.  If the dialog is just
     created normally, it will make no IsDlgMessage() checks and the
     find/replace dialogs will have no keyboard input (i.e. tabbing and
     alt+key-ing from control to control.  To fix this, a message hook
     and message filter have to be installed

     It must be set to only look at the input for the current thread, or other
     programs will be interrupted by this hook also.
  */

  hHook = SetWindowsHookEx(WH_MSGFILTER, lpfnFilterProc,
                           hInst, GetCurrentThreadId()) ;

  if (!hHook) return ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_FINDDIALOG), hwnd, FindProc) ;

  UnhookWindowsHookEx(hHook) ;

}

INT_PTR APIENTRY FindProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 213 of file Find.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:

        if (bDoFindDlg)
          SetWindowText(hwnd, TEXT("FindText()")) ;
        else
          SetWindowText(hwnd, TEXT("ReplaceText()")) ;

        InitFindStruct(hwnd, &fr) ;
        FillFindDlg(hwnd, &fr) ;

        hwndMainDialog = hwnd ;

        /* The find and replace dialogs are a lot harder to multithread because they
           are modeless.  Modeless dialog creation functions return right after the
           dialog is created.  Since ExitThread will be called at this point, it is
           probably not possible to multithread these dialogs without a separate
           GetMessage() loop.
        */

        EnableWindow(GetDlgItem(hwnd, ID_MULTITHREADFINDREP), FALSE) ;

        SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEFT)) ;

        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetFindDlg(hwnd, &fr) ;
            DoFindRepStuff(&fr) ;
            break ;

          case ID_RESETFIND:
            SendDlgItemMessage(hwnd, ID_FRNULLSTRUCT, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PRELOADEDFIND, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            InitFindStruct(hwnd, &fr) ;
            FillFindDlg(hwnd, &fr) ;
            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEFT)) ;
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;

            break ;

          default: break ;
        }

    }

    default:

    /* nFindMsg is registered at program startup (see CDTEST.c).  The
       FindText() and ReplaceText() dialogs will communicate with the
       calling application via this message. */

    if (msg == nFindMsg)
    {
        lpFr = (LPFINDREPLACE) lParam ;

        if (lpFr->Flags & FR_DIALOGTERM)
        {
          PostMessage(hwnd, UMSG_DECREMENTDLGCOUNT, 0, 0L) ;

          if (hDialogFind)
          {
            FreeResource(hDialogFind) ;
            hDialogFind = (HANDLE) 0 ;
            hResFind = (HANDLE) 0 ;
          }

          hwndFind = (HWND) 0 ;
        }

        FillFindDlg(hwnd, &fr) ;

        wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
        SetDlgItemText(hwnd, ID_ERRORFT, szTemp) ;

        wsprintf(szTemp, szLongFilter, hwndFind) ;
        SetDlgItemText(hwnd, ID_RETURNFT, szTemp) ;
    }

    /* If the help button is pressed in the FindText() or ReplaceText()
       dialogs, it will send a message Registered with RegisterWindowMessage()
       to the parent window.  The message nHelpMessage was registered
       at application startup */

    if (msg == nHelpMessage)
      MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                 TEXT("Find Help Button"), MB_OK | MB_APPLMODAL) ;

    break ;
  }

  return FALSE ;
}

LRESULT CALLBACK lpfnFilterProc | ( | int | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 124 of file Find.c.

{
  static bFirstTime = TRUE ;

  if (nCode < 0)
    return CallNextHookEx(hHook, nCode, wParam, lParam) ;

  if (nCode == MSGF_DIALOGBOX && bFirstTime)
  {
    bFirstTime = FALSE ;

    if (hwndFind && IsDialogMessage(hwndFind, (LPMSG) lParam))
    {
      bFirstTime = TRUE ;
      return 1L ;
    }

    else
    {
      bFirstTime = TRUE ;
      return 0L ;
    }
  }
  else return 0L ;
}

Variable Documentation

BOOL bDoFindDlg

Definition at line 6 of file Find.h.

HHOOK hHook

Definition at line 8 of file Find.h.

Generated on Wed Nov 13 2024 16:55:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Font.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

Font.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <stdlib.h>
#include <winnls.h>
#include "cdtest.h"
#include "font.h"
#include "logfont.h"

Go to the source code of this file.

Defines

#define | FONT_TYPE_WYSIWYG 1
#define | HDCINVALID 4
#define | HDCNULL 3
#define | HDCPRINTER 2
#define | HDCSCREEN 1
#define | LFSIZE 30
#define | WSIZEFO 30

Functions

void | DoChooseFontStuff (HWND, LPCHOOSEFONT)
void | DoFontDialog (HWND hwnd)
void | EnableFontButtons (HWND, BOOL)
int CALLBACK | EnumFontsProc (LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM)
void | FillFontDlg (HWND, LPCHOOSEFONT)
void | FillFontsBox (HWND, DWORD)
void | FillLogFontDlg (HWND, LPLOGFONT)
UINT_PTR CALLBACK | FontHookProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR APIENTRY | FontProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
DWORD FontThreadProc1 (LPDWORD)
DWORD FontThreadProc2 (LPDWORD)
void | GetFontDlg (HWND, LPCHOOSEFONT)
HANDLE | GetFontDlgHandle (void)
HDC | GetHdc (HWND, int)
void | GetLogFontDlg (HWND, LPLOGFONT)
void | HandleFontCheckBox (HWND, int)
void | InitFontStruct (HWND, LPCHOOSEFONT)
void | InitLogFontStruct (HWND, LPLOGFONT)
INT_PTR APIENTRY | LogFontProc (HWND, UINT, WPARAM, LPARAM)
void | MultiThreadFontDlg (void)
LONG_PTR | MyAtol (LPTSTR, BOOL, LPBOOL)
void | ResetCheckBoxes (HWND)

Variables

BOOL bLogFontParam
BOOL bScreen
CHOOSEFONT | cf
CHOOSEFONT | cfThread1
CHOOSEFONT | cfThread2
DWORD dwFontFlag
DWORD dwFontThreadID1
DWORD dwFontThreadID2
DWORD dwFontThreadParm1
DWORD dwFontThreadParm2
HDC | hdc
HGLOBAL hDialogFont
HANDLE hFontThread1
HANDLE hFontThread2
HRSRC | hResFont
HWND | hwndMainFont
LOGFONT | lf
LOGFONT | lfWM_CF_LF
INT | nHdcType
int | nOpenFontDialogCount
PRINTDLG | pfd
TCHAR | szFaceName [50]
TCHAR | szFontStyle [50]
TCHAR | szFontTemplate [50]
UINT_PTR | uMode

Define Documentation

#define FONT_TYPE_WYSIWYG 1

Definition at line 82 of file Font.c.

#define HDCINVALID 4

Definition at line 126 of file Font.c.

#define HDCNULL 3

Definition at line 125 of file Font.c.

#define HDCPRINTER 2

Definition at line 124 of file Font.c.

#define HDCSCREEN 1

Definition at line 123 of file Font.c.

#define LFSIZE 30
#define WSIZEFO 30

Function Documentation

void DoChooseFontStuff | ( | HWND | hwnd,
 |  | LPCHOOSEFONT | pcf
 | ) |  |

Definition at line 1398 of file Font.c.

{
  BOOL bRet = FALSE ;

  if (IsDlgButtonChecked(hwnd, ID_PRELOADEDFONT) == 1)
  {
    pcf->hInstance = GetFontDlgHandle() ;
    wsprintf(szTemp, szLongFilter, pcf->hInstance) ;
    SetDlgItemText(hwnd, ID_HINSTANCEF, szTemp) ;
  }

  pcf->hDC = GetHdc(hwnd, nHdcType) ;

  wsprintf(szTemp, szLongFilter, pcf->hDC) ;
  SetDlgItemText(hwnd, ID_HDCF, szTemp) ;

  GetFontDlg(hwnd, pcf) ;

  if (IsDlgButtonChecked(hwnd, ID_NULLSTRUCTFONT) == 1)
    bRet = ChooseFont((LPCHOOSEFONT)NULL) ;
  else
    bRet = ChooseFont(pcf) ;

  wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
  SetDlgItemText(hwnd, ID_ERRORF, szTemp) ;

  if (pcf->hDC)
  {
    ReleaseDC(hwnd, pcf->hDC) ;   //free the HDC that we used if we called
    pcf->hDC = (HDC) 0 ;          //the function with a valid HDC.
  }

  if (hDialogFont)
  {
    FreeResource(hDialogFont) ;
    hDialogFont = (HANDLE) 0 ;
    hResFont = (HANDLE) 0 ;
  }

  wsprintf(szTemp, szShortFilter, bRet) ;     //fill results into the Font dlg
  SetDlgItemText(hwnd, ID_RETURNF, szTemp) ;

  FillFontDlg(hwnd, pcf) ;
}

void DoFontDialog ( HWND hwnd )

Definition at line 166 of file Font.c.

{

  DialogBox(hInst, MAKEINTRESOURCE(ID_FONTDIALOG),
            hwnd, FontProc) ;

}

void EnableFontButtons | ( | HWND | hwnd,
 |  | BOOL | bEnable
 | ) |  |

Definition at line 1597 of file Font.c.

{
  EnableWindow(GetDlgItem(hwnd, IDOK), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, IDCANCEL), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_RESETFONT), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_MULTITHREADFONT), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_EDITLOGFONT), bEnable) ;
}

int CALLBACK EnumFontsProc | ( | LPLOGFONT | lplf,
 |  | LPTEXTMETRIC | lptm,
 |  | DWORD | dwStyle,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 1078 of file Font.c.

{
  LRESULT i ;

  /* check to see if the font is already there right off the bat
     and just continue the enumeration if it is...        */

  i = SendDlgItemMessage((HWND) lParam, ID_FONTLIST, LB_FINDSTRINGEXACT, (WPARAM) 0,
                         (LPARAM) (LPTSTR) lplf->lfFaceName) ;

  if (i != LB_ERR)
  {
    if (bScreen)     //if we are adding it for the first time
      return 1 ;

    //else, we are adding printer fonts, so if we find one that is already there
    //it must be available for both the printer and the screen...

    else
    {
      SendDlgItemMessage((HWND) lParam, ID_FONTLIST, LB_SETITEMDATA, i,
                          FONT_TYPE_WYSIWYG) ;
      return 1 ;
    }
  }

  //Get rid of any fonts that we don't want...

  if ((dwFontFlag & CF_TTONLY) && (!(dwStyle & TRUETYPE_FONTTYPE)))
    return 1 ;

  if ((dwFontFlag & CF_SCALABLEONLY) && (dwStyle & RASTER_FONTTYPE))
    return 1 ;

  if ((dwFontFlag & CF_ANSIONLY) && (lplf->lfCharSet != ANSI_CHARSET))
    return 1 ;

  if ((dwFontFlag & CF_FIXEDPITCHONLY) && (lplf->lfPitchAndFamily & VARIABLE_PITCH))
    return 1 ;

  if ((dwFontFlag & CF_NOVECTORFONTS) && (lplf->lfCharSet == OEM_CHARSET))
    return 1 ;

  //if there is a font to be added, add it.

  if (*(lplf->lfFaceName))
    SendDlgItemMessage((HWND) lParam, ID_FONTLIST, LB_ADDSTRING,
                     (WPARAM) 0, (LPARAM) (LPTSTR) lplf->lfFaceName) ;

  return 1 ;
}

void FillFontDlg | ( | HWND | hwnd,
 |  | LPCHOOSEFONT | pcf
 | ) |  |

Definition at line 457 of file Font.c.

{
  wsprintf(szTemp, szLongFilter, pcf->lStructSize) ;
  SetDlgItemText(hwnd, ID_STRUCTSIZEF, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hwndOwner) ;
  SetDlgItemText(hwnd, ID_HWNDOWNERF, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hDC) ;
  SetDlgItemText(hwnd, ID_HDCF, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hDC) ;
  SetDlgItemText(hwnd, ID_HDCF, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->lpLogFont) ;
  SetDlgItemText(hwnd, ID_LOGFONTF, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->iPointSize) ;
  SetDlgItemText(hwnd, ID_POINTSIZEF, szTemp) ;

  wsprintf(szTemp, szLongFilter, pcf->Flags) ;
  SetDlgItemText(hwnd, ID_FLAGSF, szTemp) ;

  wsprintf(szTemp, szLongFilter, pcf->rgbColors) ;
  SetDlgItemText(hwnd, ID_RGBCOLORSF, szTemp) ;

  wsprintf(szTemp, szLongFilter, pcf->lCustData) ;
  SetDlgItemText(hwnd, ID_CUSTDATAF, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->lpfnHook) ;
  SetDlgItemText(hwnd, ID_HOOKF, szTemp) ;

  SetDlgItemText(hwnd, ID_TEMPLATEF, pcf->lpTemplateName) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hInstance) ;
  SetDlgItemText(hwnd, ID_HINSTANCEF, szTemp) ;

  SetDlgItemText(hwnd, ID_STYLEF, pcf->lpszStyle) ;

  wsprintf(szTemp, szLongFilter, (int) pcf->nFontType) ;
  SetDlgItemText(hwnd, ID_FONTTYPEF, szTemp) ;

  wsprintf(szTemp, szLongFilter, (int) pcf->nSizeMin) ;
  SetDlgItemText(hwnd, ID_SIZEMINF, szTemp) ;

  wsprintf(szTemp, szLongFilter, (int) pcf->nSizeMax) ;
  SetDlgItemText(hwnd, ID_SIZEMAXF, szTemp) ;

}

void FillFontsBox | ( | HWND | hwnd,
 |  | DWORD | dwFlags
 | ) |  |

Definition at line 1156 of file Font.c.

{
  HDC hdc ;
  HWND hwndControl ;
  LRESULT dwData ;
  LRESULT nItemCount ;

  /* Empty the list box, and turn of the redraw because we may need
     to remove some fonts after they are added if the user calls this
     function with the CF_WYSIWYG flag bit set. */

  SendDlgItemMessage(hwnd, ID_FONTLIST, LB_RESETCONTENT, (WPARAM)0, (LPARAM) 0) ;

  hwndControl = GetDlgItem(hwnd, ID_FONTLIST) ;

  SendMessage(hwndControl, WM_SETREDRAW, FALSE, 0L) ;

  /* Now call EnumFontFamilies() for each type of HDC requested */

  if (dwFlags & CF_SCREENFONTS)
  {
    bScreen = TRUE ;
    hdc = GetHdc(hwnd, HDCSCREEN) ;
    EnumFontFamilies(hdc, (LPTSTR) NULL, (FONTENUMPROC) EnumFontsProc, (LONG_PTR) hwnd) ;
    ReleaseDC(hwnd, hdc) ;
  }

  if (dwFlags & CF_PRINTERFONTS)
  {
    bScreen = FALSE ;
    hdc = GetHdc(hwnd, HDCPRINTER) ;
    EnumFontFamilies(hdc, (LPTSTR) NULL, (FONTENUMPROC) EnumFontsProc, (LONG_PTR) hwnd) ;
    ReleaseDC(hwnd, hdc) ;
  }

  /* Special case:  If the CF_WYSIWYG flag is used, we have to enumerate
     the fonts in both HDCs and then remove all the ones that are not
     both printer fonts and screen fonts. */

  if (dwFontFlag & CF_WYSIWYG)
  {
    nItemCount = SendDlgItemMessage(hwnd, ID_FONTLIST, LB_GETCOUNT, 0, 0L) ;

    nItemCount-- ;   //the list is zero based

    while (nItemCount >= 0)
    {
      dwData = SendDlgItemMessage(hwnd, ID_FONTLIST, LB_GETITEMDATA, nItemCount, 0L) ;

      if (dwData != FONT_TYPE_WYSIWYG)
      {
        SendDlgItemMessage(hwnd, ID_FONTLIST, LB_DELETESTRING, nItemCount, 0L) ;
      }

      nItemCount-- ;
    }
  }

  /* Now redraw the font list */

  SendMessage(hwndControl, WM_SETREDRAW, TRUE, 0L) ;
  InvalidateRect(hwndControl, NULL, FALSE) ;

  return ;
}

void FillLogFontDlg | ( | HWND | hwnd,
 |  | LPLOGFONT | plf
 | ) |  |

Definition at line 801 of file Font.c.

{
  TCHAR szTemp[50] ;

  LPLOGFONT pl = plf ;

  if (bLogFontParam)    //Are creating this dialog in response to the
    pl = &lfWM_CF_LF ;  //WM_CHOOSEFONT_GETLOGFONT message ?

  if (!pl)              //Avert a ghastly exception error
    return ;

  wsprintf(szTemp, szLongFilter, pl->lfHeight) ;
  SetDlgItemText(hwnd, ID_LFHEIGHT, szTemp) ;

  wsprintf(szTemp, szLongFilter, pl->lfWidth) ;
  SetDlgItemText(hwnd, ID_LFWIDTH, szTemp) ;

  wsprintf(szTemp, szLongFilter, pl->lfEscapement) ;
  SetDlgItemText(hwnd, ID_LFESCAPEMENT, szTemp) ;

  wsprintf(szTemp, szLongFilter, pl->lfOrientation) ;
  SetDlgItemText(hwnd, ID_LFORIENTATION, szTemp) ;

  wsprintf(szTemp, szLongFilter, pl->lfWeight) ;
  SetDlgItemText(hwnd, ID_LFWEIGHT, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfItalic) ;
  SetDlgItemText(hwnd, ID_LFITALIC, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfUnderline) ;
  SetDlgItemText(hwnd, ID_LFUNDERLINE, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfStrikeOut) ;
  SetDlgItemText(hwnd, ID_LFSTRIKEOUT, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfCharSet) ;
  SetDlgItemText(hwnd, ID_LFCHARSET, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfOutPrecision) ;
  SetDlgItemText(hwnd, ID_LFOUTP, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfClipPrecision) ;
  SetDlgItemText(hwnd, ID_LFCLIPP, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfQuality) ;
  SetDlgItemText(hwnd, ID_LFQUALITY, szTemp) ;

  wsprintf(szTemp, szShortFilter, pl->lfPitchAndFamily) ;
  SetDlgItemText(hwnd, ID_LFPITCHANDFAM, szTemp) ;

  SetDlgItemText(hwnd, ID_LFFACENAME, (LPTSTR) pl->lfFaceName) ;
}

UINT_PTR CALLBACK FontHookProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 951 of file Font.c.

{
  LPCHOOSEFONT pCf ;
  TCHAR szMsg[50] ;

  switch(msg)
  {
    case WM_INITDIALOG:

      pCf = (LPCHOOSEFONT) lParam ;

      if (pCf->lCustData != 0L)
      {
        wsprintf(szMsg, TEXT("CHOOSEFONT->lCustData is: %ld"), pCf->lCustData) ;
        MessageBox(hwnd, szMsg, TEXT("lCustData Sent!"), MB_OK) ;
      }

      SetWindowText(hwnd, TEXT("Font Hook Proc Dialog")) ;

      break ;

    case WM_COMMAND:

        /* NOTE: This button will only be available if the user creates the
           ChooseFont() dialog with the CF_ENABLETEMPLATE or CF_ENABLETEMPLATEHANDLE
           flag.

           This button will only work if the ChooseFont() dialog is created
           with the CF_ENABLEHOOK flag.  So, to get full functionality from
           this button:

           1.  Enter (CF_ENABLEHOOK | CF_ENABLETEMPLATE | CF_SCREENFONTS)
               in the "Flags" edit box of CDTEST'S Font dialog.

           2.  Click OK
        */

        /* The parent will send the WM_CHOOSEFONT_GETLOGFONT message and
           display it's findings in a LogFont dialog if it gets this message */

        if (LOWORD(wParam) == ID_SEND_WM_CF_LF_MSG)
          SendMessage(GetParent(hwnd), WM_CF_LF, 0, (LPARAM) hwnd) ;

        break ;

    default:
      break ;
  }

  return 0 ;   //send msg to the common dialog code
}

INT_PTR APIENTRY FontProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 197 of file Font.c.

{
  BOOL b ;
  TCHAR szNum[30] ;

  switch (msg)
  {
    case WM_INITDIALOG:

        InitLogFontStruct(hwnd, &lf) ;   //fill (struct lf) so the choosefont
        InitFontStruct(hwnd, &cf) ;      //struct can use it
        FillFontDlg(hwnd, &cf) ;

        CheckRadioButton(hwnd, ID_HDCSCREEN, ID_HDCPRINTER, ID_HDCSCREEN) ;
        nHdcType = HDCSCREEN ;

        dwFontFlag = cf.Flags ;

        FillFontsBox(hwnd, dwFontFlag) ;

        ResetCheckBoxes(hwnd) ;

        *(&cfThread1) = *(&cfThread2) = *(&cf) ;

        hwndMainFont = hwnd ;
        nOpenFontDialogCount = 0 ;

        SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEF)) ;

        break ;

    case UMSG_DECREMENTDLGCOUNT:  // user defined message.  This is send by
                                  // the functions that are executing when
                                  // a new thread is created.  When these
                                  // Thread functions end, they should send
                                  // this message.

      nOpenFontDialogCount-- ;

      if (nOpenFontDialogCount == 0)
        EnableFontButtons(hwnd, TRUE) ;

      break ;

    case WM_CF_LF:

       /* If this message comes in, we know that the user clicked the
          button that tells the ChooseFont() dialog to tell the parent
          to send the WM_CHOOSEFONT_GETLOGFONT message.  So what we will
          do is send the message and then show the user what was in the
          logfont by calling creating the Logfont dialog box */

       SendMessage((HWND) lParam, WM_CHOOSEFONT_GETLOGFONT,
                   0, (LPARAM) &lfWM_CF_LF) ;

       bLogFontParam = TRUE ; //tells us if we are doing normal logfont
                              //processing or answering the WM_CF_LF message.

       DialogBoxParam(hInst, MAKEINTRESOURCE(ID_LOGFONTDIALOG),
                      (HWND) lParam, LogFontProc, (LPARAM) &lf) ;

       bLogFontParam = FALSE ;

       break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            DoChooseFontStuff(hwnd, &cf) ;  //create the dialog.
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_RESETFONT:

            InitLogFontStruct(hwnd, &lf) ;  //reset all the structures.
            InitFontStruct(hwnd, &cf) ;
            FillFontDlg(hwnd, &cf) ;        //refill the dialog.

            CheckRadioButton(hwnd, ID_HDCSCREEN, ID_HDCPRINTER, ID_HDCSCREEN) ;
            nHdcType = HDCSCREEN ;

            SendDlgItemMessage(hwnd, ID_NULLSTRUCTFONT, BM_SETCHECK, (WPARAM) 0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PRELOADEDFONT,  BM_SETCHECK, (WPARAM) 0, (LPARAM)0) ;

            dwFontFlag = cf.Flags ;
            FillFontsBox(hwnd, dwFontFlag) ;
            ResetCheckBoxes(hwnd) ;

            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEF)) ;

            break ;

          case ID_HDCSCREEN:
            nHdcType = HDCSCREEN ;
            break ;

          case ID_HDCPRINTER:
            nHdcType = HDCPRINTER ;
            break ;

          case ID_HDCNULL:
            nHdcType = HDCNULL ;
            break ;

          case ID_HDCINVALID:
            nHdcType = HDCINVALID ;
            break ;

          case ID_EDITLOGFONT:

            /* Get the address of the logfont and then show the user what
               is in it with the Logfont dialog box */

            GetDlgItemText(hwnd, ID_LOGFONTF, szNum, 30) ;
            cf.lpLogFont = (LPLOGFONT) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

            DialogBox(hInst, MAKEINTRESOURCE(ID_LOGFONTDIALOG),
                      hwnd, LogFontProc) ;
            break ;

          case F_TTONLY:
          case F_ANSIONLY:
          case F_PRINTERFONTS:
          case F_SCREENFONTS:
          case F_FIXEDPITCHONLY:
          case F_NOOEMFONTS:
          case F_NOVECTORFONTS:
          case F_SCALABLEONLY:
          case F_WYSIWYG:
            HandleFontCheckBox(hwnd, LOWORD(wParam)) ;
            break ;

          case ID_MULTITHREADFONT:

            /* Set the dialog count to 2, disable the buttons in CDTEST's font
               dialog so the user can't do anything until last dialog has
               been terminated */

            nOpenFontDialogCount = 2 ;

            EnableFontButtons(hwndMainFont, FALSE) ;

            /* And then do the multithreading */

            MultiThreadFontDlg() ;

            break ;

          default: break ;
        }
    }

    default:

      /*
         If the help button is pressed in the ChooseFont()
         dialog, it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup

         It must be detected with an IF statement because the value
         returned by RegisterWindowMessage() is not a constant
      */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                   TEXT("Font Help Button"), MB_OK | MB_APPLMODAL) ;
      break ;
  }

  return FALSE ;
}

DWORD FontThreadProc1 ( LPDWORD pdw )

Definition at line 1465 of file Font.c.

{
  DoChooseFontStuff(hwndMainFont, &cfThread1) ;

  PostMessage(hwndMainFont, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;

  return 0L ;
}

DWORD FontThreadProc2 ( LPDWORD pdw )

Definition at line 1496 of file Font.c.

{
  DoChooseFontStuff(hwndMainFont, &cfThread2) ;

  PostMessage(hwndMainFont, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;

  return 0L ;
}

void GetFontDlg | ( | HWND | hwnd,
 |  | LPCHOOSEFONT | pcf
 | ) |  |

Definition at line 529 of file Font.c.

{
  BOOL b ;
  TCHAR szNum[30] ;

#define WSIZEFO 30

  GetDlgItemText(hwnd, ID_STRUCTSIZEF, szNum, WSIZEFO) ;
  pcf->lStructSize = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HWNDOWNERF, szNum, WSIZEFO) ;
  pcf->hwndOwner = (HWND) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LOGFONTF, szNum, WSIZEFO) ;
  pcf->lpLogFont = (LPLOGFONT) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_POINTSIZEF, szNum, WSIZEFO) ;
  pcf->iPointSize = (int) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_FLAGSF, szNum, WSIZEFO) ;
  pcf->Flags = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_RGBCOLORSF, szNum, WSIZEFO) ;
  pcf->rgbColors = (COLORREF) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_CUSTDATAF, szNum, WSIZEFO) ;
  pcf->lCustData = MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HOOKF, szNum, WSIZEFO) ;
  pcf->lpfnHook = (LPCFHOOKPROC) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_TEMPLATEF, szFontTemplate, 50) ;

  GetDlgItemText(hwnd, ID_HINSTANCEF, szNum, WSIZEFO) ;
  pcf->hInstance = (HANDLE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_STYLEF, szFontStyle, 50) ;

  GetDlgItemText(hwnd, ID_FONTTYPEF, szNum, WSIZEFO) ;
  pcf->nFontType = (WORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_SIZEMINF, szNum, WSIZEFO) ;
  pcf->nSizeMin = (int) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_SIZEMAXF, szNum, WSIZEFO) ;
  pcf->nSizeMax = (int) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
}

HANDLE GetFontDlgHandle ( void )

Definition at line 1028 of file Font.c.

{

  hResFont = FindResource(hInst, TEXT("fonttemp"), RT_DIALOG) ;

  hDialogFont = LoadResource(hInst, hResFont) ;

  return hDialogFont ;
}

HDC GetHdc | ( | HWND | hwnd,
 |  | int | nType
 | ) |  |

Definition at line 613 of file Font.c.

{
  switch (nType)
  {
    case HDCSCREEN:
        return GetDC(hwnd) ;
        break ;

    case HDCNULL:
        return (HDC) 0 ;
        break ;

    case HDCINVALID:
        return (HDC) 999 ;
        break ;

    case HDCPRINTER:

        /* To get the HDC of the current printer, fill out a PRINTDLG
           structure, and set it's flags to (PD_RETURNDC | PD_RETURNDEFAULT).
           This will tell PrintDlg() to create you an HDC but not show
           the Print dialog box. */

        pfd.lStructSize = sizeof(PRINTDLG) ;
        pfd.hwndOwner = hwnd ;
        pfd.hDevMode = (HANDLE) 0 ;
        pfd.hDevNames = (HANDLE) 0 ;
        pfd.Flags = PD_RETURNDC | PD_RETURNDEFAULT ;   //just get default printer
        pfd.nFromPage = 0 ;
        pfd.nToPage = 0 ;
        pfd.nMinPage = 0 ;
        pfd.nMaxPage = 0 ;
        pfd.nCopies = 0 ;
        pfd.hInstance = (HANDLE) hInst ;

        if (PrintDlg(&pfd) == 0)
            MessageBox(hwnd, TEXT("Error: Could not create a printer DC!"),
                       (LPTSTR) NULL, MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;
        else
           return pfd.hDC ;

        break ;

    default:
        break ;
  }
  return (HDC) 0 ;
}

void GetLogFontDlg | ( | HWND | hwnd,
 |  | LPLOGFONT | plf
 | ) |  |

Definition at line 875 of file Font.c.

{
  BOOL b ;
  TCHAR szNum[30] ;

  if (bLogFontParam)  //if we are just viewing the logfont because we sent a
    return ;          //WM_CHOOSEFONT_GETLOGFONT message, don't change the Logfont Struct
                      //that ChooseFont() gives us...

  #define LFSIZE 30

  GetDlgItemText(hwnd, ID_LFHEIGHT, szNum, LFSIZE) ;
  plf->lfHeight = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFWIDTH, szNum, LFSIZE) ;
  plf->lfWidth = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFESCAPEMENT, szNum, LFSIZE) ;
  plf->lfEscapement = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFORIENTATION, szNum, LFSIZE) ;
  plf->lfOrientation = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFWEIGHT, szNum, LFSIZE) ;
  plf->lfWeight = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFITALIC, szNum, LFSIZE) ;
  plf->lfItalic = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFUNDERLINE, szNum, LFSIZE) ;
  plf->lfUnderline = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFSTRIKEOUT, szNum, LFSIZE) ;
  plf->lfStrikeOut = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFCHARSET, szNum, LFSIZE) ;
  plf->lfCharSet = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFOUTP, szNum, LFSIZE) ;
  plf->lfOutPrecision = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFCLIPP, szNum, LFSIZE) ;
  plf->lfClipPrecision = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFQUALITY, szNum, LFSIZE) ;
  plf->lfQuality = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFPITCHANDFAM, szNum, LFSIZE) ;
  plf->lfPitchAndFamily = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LFFACENAME, (LPTSTR) plf->lfFaceName, 32) ;
}

void HandleFontCheckBox | ( | HWND | hwnd,
 |  | int | nID
 | ) |  |

Definition at line 1285 of file Font.c.

{
  DWORD dwTemp ;

  dwTemp = dwFontFlag ;

  switch (nID)
  {
    case F_TTONLY:

      /* TTONLY is a special case.  If we only want Truetype fonts,
         turn off irrelevant flags */

      if (!(dwFontFlag & CF_TTONLY)) //if we're turning this flag on...
      {
        dwFontFlag = 0L ;  //turn everyone off but the following:

        dwFontFlag |= CF_TTONLY ;

        if (dwTemp & CF_ANSIONLY)
          dwFontFlag |= CF_ANSIONLY ;

        if (dwTemp & CF_FIXEDPITCHONLY)
          dwFontFlag |= CF_FIXEDPITCHONLY ;

        if (dwTemp & CF_SCREENFONTS)
          dwFontFlag |= CF_SCREENFONTS ;

        if (dwTemp & CF_PRINTERFONTS)
          dwFontFlag |= CF_PRINTERFONTS ;
      }
      else
      {
        dwFontFlag ^= CF_TTONLY ;
      }

      break ;

    case F_ANSIONLY:
      dwFontFlag ^= CF_ANSIONLY ;        //otherwise toggle the bit.
      dwFontFlag &= ~CF_WYSIWYG ;

      break ;

    case F_PRINTERFONTS:
      dwFontFlag ^= CF_PRINTERFONTS ;

      break ;

    case F_SCREENFONTS:
      dwFontFlag ^= CF_SCREENFONTS ;

      break ;

    case F_FIXEDPITCHONLY:
      dwFontFlag ^= CF_FIXEDPITCHONLY ;

      break ;

    case F_NOOEMFONTS:
      dwFontFlag ^= CF_NOOEMFONTS ;

      break ;

    case F_NOVECTORFONTS:
      dwFontFlag ^= CF_NOVECTORFONTS ;

      break ;

    case F_SCALABLEONLY:
      dwFontFlag ^= CF_SCALABLEONLY ;

      break ;

    case F_WYSIWYG:                        //We want fonts for both the
                                           //screen and the printer...
      dwFontFlag ^= CF_WYSIWYG ;

      if (dwFontFlag & CF_WYSIWYG)
        dwFontFlag |= (CF_SCREENFONTS | CF_PRINTERFONTS | CF_SCALABLEONLY) ;

      break ;

    default: break ;
  }

  ResetCheckBoxes(hwnd) ;
  FillFontsBox(hwnd, dwFontFlag) ;
}

void InitFontStruct | ( | HWND | hwnd,
 |  | LPCHOOSEFONT | pcf
 | ) |  |

Definition at line 406 of file Font.c.

{
  pcf->lStructSize = sizeof(CHOOSEFONT) ;
  pcf->hwndOwner = hwnd ;
  pcf->hDC = (HDC) 0 ;
  pcf->lpLogFont = &lf ;
  pcf->iPointSize = 24 ;
  pcf->Flags = CF_EFFECTS | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_SHOWHELP | CF_APPLY ;
  pcf->rgbColors = RGB(0, 255, 0) ;
  pcf->lCustData = 0L ;
  pcf->lpfnHook = FontHookProc ;

  lstrcpyn(szFontTemplate, TEXT("fonttemp"), ARRAYSIZE(szFontTemplate)) ;
  pcf->lpTemplateName = szFontTemplate ;

  pcf->hInstance = (HANDLE) hInst ;

  lstrcpyn(szFontStyle, TEXT("Bold"), ARRAYSIZE(szFontStyle)) ;
  pcf->lpszStyle = szFontStyle ;

  pcf->nFontType = SCREEN_FONTTYPE ;

  pcf->nSizeMin = 8 ;
  pcf->nSizeMax = 50 ;
}

void InitLogFontStruct | ( | HWND | hwnd,
 |  | LPLOGFONT | plf
 | ) |  |

Definition at line 761 of file Font.c.

{
  plf->lfHeight = 24 ;
  plf->lfWidth  = 20 ;
  plf->lfEscapement = 0 ;
  plf->lfOrientation = 10 ;
  plf->lfWeight = 400 ;
  plf->lfItalic = FALSE ;
  plf->lfUnderline = FALSE ;
  plf->lfStrikeOut = FALSE ;
  plf->lfCharSet = ANSI_CHARSET ;
  plf->lfOutPrecision = OUT_DEFAULT_PRECIS ;
  plf->lfClipPrecision = CLIP_DEFAULT_PRECIS ;
  plf->lfQuality = DEFAULT_QUALITY ;
  plf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE ;

  szFaceName[0] = (TCHAR) 0 ;
  lstrcpyn(plf->lfFaceName, szFaceName, ARRAYSIZE(plf->lfFaceName)) ;
}

INT_PTR APIENTRY LogFontProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 687 of file Font.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:
        FillLogFontDlg(hwnd, cf.lpLogFont) ;  //start off with the one that
                                              //is returned from ChooseFont()
        break ;

    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
          case IDOK:

            GetLogFontDlg(hwnd, &lf) ;

            cf.lpLogFont = &lf ;

            EndDialog(hwnd, TRUE) ;

            break ;

          case ID_RESETLF:

            SetFocus(GetDlgItem(hwnd, ID_LFHEIGHT)) ;

            InitLogFontStruct(hwnd, &lf) ;

            FillLogFontDlg(hwnd, &lf) ;

            break ;

          case IDCANCEL:

            EndDialog(hwnd, FALSE) ;

            break ;

          default:
            break ;
        }

    default: break ;
  }

  return FALSE ;
}

void MultiThreadFontDlg ( void )

Definition at line 1533 of file Font.c.

{

  dwFontThreadParm1 = dwFontThreadParm2 = 0L ;

  if (!(hFontThread1 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                     (LPTHREAD_START_ROUTINE) FontThreadProc1,
                                     &dwFontThreadParm1, CREATE_SUSPENDED, &dwFontThreadID1)))

  {
    MessageBox(GetForegroundWindow(), TEXT("Error creating thread 1"), NULL,
               MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;

    nOpenFontDialogCount = 0 ;

    EnableFontButtons(hwndMainFont, TRUE) ;

    return ;
  }

  if (!(hFontThread2 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                     (LPTHREAD_START_ROUTINE) FontThreadProc2,
                                     &dwFontThreadParm2, CREATE_SUSPENDED, &dwFontThreadID2)))
  {
    MessageBox(GetForegroundWindow(), TEXT("Error creating thread 2"), NULL,
               MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;

    nOpenFontDialogCount = 0 ;

    EnableFontButtons(hwndMainFont, TRUE) ;

    return ;
  }

  ResumeThread(hFontThread1) ;
  ResumeThread(hFontThread2) ;

  return ;
}

LONG_PTR MyAtol | ( | LPTSTR | ,
 |  | BOOL | ,
 |  | LPBOOL |
 | ) |  |

Definition at line 460 of file CDTest.c.

{
  LPTSTR p ;
  LONG l ;
  LONG lMultiplier ;
  BOOL bDigit ;

  if (bHex)
    lMultiplier = 16 ;
  else
    lMultiplier = 10 ;

  p = szString ;
  l = 0 ;

  while (*p)      //while chars
  {
     bDigit = FALSE ;  //set to false for each char that we look at

     if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
     {
       bDigit = TRUE ;
       l+=(*p - (TCHAR) '0') ;
     }

     if (bHex)
     {
       if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
       {
         l+=(*p - (TCHAR) 'A' + 10) ;
         bDigit = TRUE ;
       }

       if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
       {
         l+=(*p - (TCHAR) 'a' + 10) ;
         bDigit = TRUE ;
       }

     }

     if (bDigit == FALSE)
     {
       *bSuccess = FALSE ;
       return 0 ;
     }

     p++ ;               //get next char

     if (*p)             //if there is going to be at least one more char
       l*=lMultiplier ;  //then multiply what we have by the multiplier...
  }

  *bSuccess = TRUE ;

  return l ;             //success! return the value.
}

void ResetCheckBoxes ( HWND hwnd )

Definition at line 1245 of file Font.c.

{

  SendDlgItemMessage(hwnd, F_TTONLY,          BM_SETCHECK, dwFontFlag & CF_TTONLY         ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_ANSIONLY,        BM_SETCHECK, dwFontFlag & CF_ANSIONLY       ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_SCREENFONTS,     BM_SETCHECK, dwFontFlag & CF_SCREENFONTS    ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_PRINTERFONTS,    BM_SETCHECK, dwFontFlag & CF_PRINTERFONTS   ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_NOOEMFONTS,      BM_SETCHECK, dwFontFlag & CF_NOOEMFONTS     ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_NOVECTORFONTS,   BM_SETCHECK, dwFontFlag & CF_NOVECTORFONTS  ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_SCALABLEONLY,    BM_SETCHECK, dwFontFlag & CF_SCALABLEONLY   ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_WYSIWYG,         BM_SETCHECK, dwFontFlag & CF_WYSIWYG        ? 1 : 0, (LPARAM)0) ;
  SendDlgItemMessage(hwnd, F_FIXEDPITCHONLY,  BM_SETCHECK, dwFontFlag & CF_FIXEDPITCHONLY ? 1 : 0, (LPARAM)0) ;

}

Variable Documentation

BOOL bLogFontParam

Definition at line 110 of file Font.c.

BOOL bScreen

Definition at line 83 of file Font.c.

CHOOSEFONT cf

Definition at line 117 of file Font.c.

CHOOSEFONT cfThread1

Definition at line 143 of file Font.c.

CHOOSEFONT cfThread2

Definition at line 144 of file Font.c.

DWORD dwFontFlag

Definition at line 108 of file Font.c.

DWORD dwFontThreadID1

Definition at line 135 of file Font.c.

DWORD dwFontThreadID2

Definition at line 136 of file Font.c.

DWORD dwFontThreadParm1

Definition at line 137 of file Font.c.

DWORD dwFontThreadParm2

Definition at line 138 of file Font.c.

HDC hdc

Definition at line 119 of file Font.c.

HGLOBAL hDialogFont

Definition at line 115 of file Font.c.

HANDLE hFontThread1

Definition at line 133 of file Font.c.

HANDLE hFontThread2

Definition at line 134 of file Font.c.

HRSRC hResFont

Definition at line 114 of file Font.c.

HWND hwndMainFont

Definition at line 141 of file Font.c.

LOGFONT lf

Definition at line 118 of file Font.c.

LOGFONT lfWM_CF_LF

Definition at line 111 of file Font.c.

INT nHdcType

Definition at line 127 of file Font.c.

int nOpenFontDialogCount

Definition at line 142 of file Font.c.

PRINTDLG pfd

Definition at line 109 of file Font.c.

TCHAR szFaceName[50]

Definition at line 120 of file Font.c.

TCHAR szFontStyle[50]

Definition at line 122 of file Font.c.

TCHAR szFontTemplate[50]

Definition at line 121 of file Font.c.

UINT_PTR uMode

Definition at line 69 of file CDTest.c.

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Font.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions

Font.h File Reference

Go to the source code of this file.

Defines

#define | F_ANSIONLY 614
#define | F_FIXEDPITCHONLY 618
#define | F_NOOEMFONTS 619
#define | F_NOSIMULATIONS 620
#define | F_NOVECTORFONTS 621
#define | F_PRINTERFONTS 617
#define | F_SCALABLEONLY 622
#define | F_SCREENFONTS 616
#define | F_TTONLY 615
#define | F_WYSIWYG 623
#define | ID_CUSTDATAF 123
#define | ID_EDITLOGFONT 132
#define | ID_ERRORF 135
#define | ID_FLAGSF 121
#define | ID_FONTDIALOG 607
#define | ID_FONTLIST 611
#define | ID_FONTTYPEF 128
#define | ID_HDCF 118
#define | ID_HDCINVALID 609
#define | ID_HDCNULL 131
#define | ID_HDCPRINTER 138
#define | ID_HDCSCREEN 137
#define | ID_HINSTANCEF 126
#define | ID_HOOKF 124
#define | ID_HWNDOWNERF 117
#define | ID_LOGFONTF 119
#define | ID_MULTITHREADFONT 624
#define | ID_NULLSTRUCTFONT 608
#define | ID_POINTSIZEF 120
#define | ID_PRELOADEDFONT 610
#define | ID_RESETFONT 139
#define | ID_RETURNF 136
#define | ID_RGBCOLORSF 122
#define | ID_SEND_WM_CF_LF_MSG 625
#define | ID_SIZEMAXF 130
#define | ID_SIZEMINF 129
#define | ID_STRUCTSIZEF 116
#define | ID_STYLEF 127
#define | ID_TEMPLATEF 125
#define | WM_CF_LF (WM_USER+2)

Functions

void | DoFontDialog (HWND)
INT_PTR APIENTRY | FontProc (HWND, UINT, WPARAM, LPARAM)

Define Documentation

#define F_ANSIONLY 614

Definition at line 39 of file Font.h.

#define F_FIXEDPITCHONLY 618

Definition at line 43 of file Font.h.

#define F_NOOEMFONTS 619

Definition at line 44 of file Font.h.

#define F_NOSIMULATIONS 620

Definition at line 45 of file Font.h.

#define F_NOVECTORFONTS 621

Definition at line 46 of file Font.h.

#define F_PRINTERFONTS 617

Definition at line 42 of file Font.h.

#define F_SCALABLEONLY 622

Definition at line 47 of file Font.h.

#define F_SCREENFONTS 616

Definition at line 41 of file Font.h.

#define F_TTONLY 615

Definition at line 40 of file Font.h.

#define F_WYSIWYG 623

Definition at line 48 of file Font.h.

#define ID_CUSTDATAF 123

Definition at line 20 of file Font.h.

#define ID_EDITLOGFONT 132

Definition at line 33 of file Font.h.

#define ID_ERRORF 135

Definition at line 28 of file Font.h.

#define ID_FLAGSF 121

Definition at line 18 of file Font.h.

#define ID_FONTDIALOG 607

Definition at line 10 of file Font.h.

#define ID_FONTLIST 611

Definition at line 38 of file Font.h.

#define ID_FONTTYPEF 128

Definition at line 25 of file Font.h.

#define ID_HDCF 118

Definition at line 15 of file Font.h.

#define ID_HDCINVALID 609

Definition at line 35 of file Font.h.

#define ID_HDCNULL 131

Definition at line 32 of file Font.h.

#define ID_HDCPRINTER 138

Definition at line 31 of file Font.h.

#define ID_HDCSCREEN 137

Definition at line 30 of file Font.h.

#define ID_HINSTANCEF 126

Definition at line 23 of file Font.h.

#define ID_HOOKF 124

Definition at line 21 of file Font.h.

#define ID_HWNDOWNERF 117

Definition at line 14 of file Font.h.

#define ID_LOGFONTF 119

Definition at line 16 of file Font.h.

#define ID_MULTITHREADFONT 624

Definition at line 49 of file Font.h.

#define ID_NULLSTRUCTFONT 608

Definition at line 36 of file Font.h.

#define ID_POINTSIZEF 120

Definition at line 17 of file Font.h.

#define ID_PRELOADEDFONT 610

Definition at line 37 of file Font.h.

#define ID_RESETFONT 139

Definition at line 34 of file Font.h.

#define ID_RETURNF 136

Definition at line 29 of file Font.h.

#define ID_RGBCOLORSF 122

Definition at line 19 of file Font.h.

#define ID_SEND_WM_CF_LF_MSG 625

Definition at line 50 of file Font.h.

#define ID_SIZEMAXF 130

Definition at line 27 of file Font.h.

#define ID_SIZEMINF 129

Definition at line 26 of file Font.h.

#define ID_STRUCTSIZEF 116

Definition at line 13 of file Font.h.

#define ID_STYLEF 127

Definition at line 24 of file Font.h.

#define ID_TEMPLATEF 125

Definition at line 22 of file Font.h.

#define WM_CF_LF (WM_USER+2)

Definition at line 11 of file Font.h.

Function Documentation

void DoFontDialog ( HWND )

Definition at line 166 of file Font.c.

{

  DialogBox(hInst, MAKEINTRESOURCE(ID_FONTDIALOG),
            hwnd, FontProc) ;

}

INT_PTR APIENTRY FontProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 197 of file Font.c.

{
  BOOL b ;
  TCHAR szNum[30] ;

  switch (msg)
  {
    case WM_INITDIALOG:

        InitLogFontStruct(hwnd, &lf) ;   //fill (struct lf) so the choosefont
        InitFontStruct(hwnd, &cf) ;      //struct can use it
        FillFontDlg(hwnd, &cf) ;

        CheckRadioButton(hwnd, ID_HDCSCREEN, ID_HDCPRINTER, ID_HDCSCREEN) ;
        nHdcType = HDCSCREEN ;

        dwFontFlag = cf.Flags ;

        FillFontsBox(hwnd, dwFontFlag) ;

        ResetCheckBoxes(hwnd) ;

        *(&cfThread1) = *(&cfThread2) = *(&cf) ;

        hwndMainFont = hwnd ;
        nOpenFontDialogCount = 0 ;

        SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEF)) ;

        break ;

    case UMSG_DECREMENTDLGCOUNT:  // user defined message.  This is send by
                                  // the functions that are executing when
                                  // a new thread is created.  When these
                                  // Thread functions end, they should send
                                  // this message.

      nOpenFontDialogCount-- ;

      if (nOpenFontDialogCount == 0)
        EnableFontButtons(hwnd, TRUE) ;

      break ;

    case WM_CF_LF:

       /* If this message comes in, we know that the user clicked the
          button that tells the ChooseFont() dialog to tell the parent
          to send the WM_CHOOSEFONT_GETLOGFONT message.  So what we will
          do is send the message and then show the user what was in the
          logfont by calling creating the Logfont dialog box */

       SendMessage((HWND) lParam, WM_CHOOSEFONT_GETLOGFONT,
                   0, (LPARAM) &lfWM_CF_LF) ;

       bLogFontParam = TRUE ; //tells us if we are doing normal logfont
                              //processing or answering the WM_CF_LF message.

       DialogBoxParam(hInst, MAKEINTRESOURCE(ID_LOGFONTDIALOG),
                      (HWND) lParam, LogFontProc, (LPARAM) &lf) ;

       bLogFontParam = FALSE ;

       break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            DoChooseFontStuff(hwnd, &cf) ;  //create the dialog.
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_RESETFONT:

            InitLogFontStruct(hwnd, &lf) ;  //reset all the structures.
            InitFontStruct(hwnd, &cf) ;
            FillFontDlg(hwnd, &cf) ;        //refill the dialog.

            CheckRadioButton(hwnd, ID_HDCSCREEN, ID_HDCPRINTER, ID_HDCSCREEN) ;
            nHdcType = HDCSCREEN ;

            SendDlgItemMessage(hwnd, ID_NULLSTRUCTFONT, BM_SETCHECK, (WPARAM) 0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PRELOADEDFONT,  BM_SETCHECK, (WPARAM) 0, (LPARAM)0) ;

            dwFontFlag = cf.Flags ;
            FillFontsBox(hwnd, dwFontFlag) ;
            ResetCheckBoxes(hwnd) ;

            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEF)) ;

            break ;

          case ID_HDCSCREEN:
            nHdcType = HDCSCREEN ;
            break ;

          case ID_HDCPRINTER:
            nHdcType = HDCPRINTER ;
            break ;

          case ID_HDCNULL:
            nHdcType = HDCNULL ;
            break ;

          case ID_HDCINVALID:
            nHdcType = HDCINVALID ;
            break ;

          case ID_EDITLOGFONT:

            /* Get the address of the logfont and then show the user what
               is in it with the Logfont dialog box */

            GetDlgItemText(hwnd, ID_LOGFONTF, szNum, 30) ;
            cf.lpLogFont = (LPLOGFONT) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

            DialogBox(hInst, MAKEINTRESOURCE(ID_LOGFONTDIALOG),
                      hwnd, LogFontProc) ;
            break ;

          case F_TTONLY:
          case F_ANSIONLY:
          case F_PRINTERFONTS:
          case F_SCREENFONTS:
          case F_FIXEDPITCHONLY:
          case F_NOOEMFONTS:
          case F_NOVECTORFONTS:
          case F_SCALABLEONLY:
          case F_WYSIWYG:
            HandleFontCheckBox(hwnd, LOWORD(wParam)) ;
            break ;

          case ID_MULTITHREADFONT:

            /* Set the dialog count to 2, disable the buttons in CDTEST's font
               dialog so the user can't do anything until last dialog has
               been terminated */

            nOpenFontDialogCount = 2 ;

            EnableFontButtons(hwndMainFont, FALSE) ;

            /* And then do the multithreading */

            MultiThreadFontDlg() ;

            break ;

          default: break ;
        }
    }

    default:

      /*
         If the help button is pressed in the ChooseFont()
         dialog, it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup

         It must be detected with an IF statement because the value
         returned by RegisterWindowMessage() is not a constant
      */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                   TEXT("Font Help Button"), MB_OK | MB_APPLMODAL) ;
      break ;
  }

  return FALSE ;
}

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/LogFont.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines

LogFont.h File Reference

Go to the source code of this file.

Defines

#define | ID_LFCHARSET 123
#define | ID_LFCLIPP 125
#define | ID_LFESCAPEMENT 117
#define | ID_LFFACENAME 128
#define | ID_LFHEIGHT 115
#define | ID_LFITALIC 120
#define | ID_LFORIENTATION 118
#define | ID_LFOUTP 124
#define | ID_LFPITCHANDFAM 127
#define | ID_LFQUALITY 126
#define | ID_LFSTRIKEOUT 122
#define | ID_LFUNDERLINE 121
#define | ID_LFWEIGHT 119
#define | ID_LFWIDTH 116
#define | ID_LOGFONTDIALOG 608
#define | ID_RESETLF 129

Define Documentation

#define ID_LFCHARSET 123

Definition at line 14 of file LogFont.h.

#define ID_LFCLIPP 125

Definition at line 16 of file LogFont.h.

#define ID_LFESCAPEMENT 117

Definition at line 8 of file LogFont.h.

#define ID_LFFACENAME 128

Definition at line 19 of file LogFont.h.

#define ID_LFHEIGHT 115

Definition at line 6 of file LogFont.h.

#define ID_LFITALIC 120

Definition at line 11 of file LogFont.h.

#define ID_LFORIENTATION 118

Definition at line 9 of file LogFont.h.

#define ID_LFOUTP 124

Definition at line 15 of file LogFont.h.

#define ID_LFPITCHANDFAM 127

Definition at line 18 of file LogFont.h.

#define ID_LFQUALITY 126

Definition at line 17 of file LogFont.h.

#define ID_LFSTRIKEOUT 122

Definition at line 13 of file LogFont.h.

#define ID_LFUNDERLINE 121

Definition at line 12 of file LogFont.h.

#define ID_LFWEIGHT 119

Definition at line 10 of file LogFont.h.

#define ID_LFWIDTH 116

Definition at line 7 of file LogFont.h.

#define ID_LOGFONTDIALOG 608

Definition at line 21 of file LogFont.h.

#define ID_RESETLF 129

Definition at line 22 of file LogFont.h.

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Open.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Functions | Variables

Open.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <stdlib.h>
#include <winnls.h>
#include "cdtest.h"
#include "open.h"
#include "save.h"
#include "dlgs.h"

Go to the source code of this file.

Functions

void | DoOpenDialog (HWND hwnd)
void | DoOpenSaveStuff (LPOPENFILENAME)
void | FillOpenDlg (HWND hwnd, LPOPENFILENAME po)
HANDLE | GetCorrectResourceHandle (void)
void | GetOpenDlg (HWND hwnd, LPOPENFILENAME po)
void | InitCustFilterString (void)
void | InitFilterString (void)
void | InitOpenStruct (HWND hwnd, LPOPENFILENAME po)
void | InterpretCustomFilterString (void)
void | MultiThreadOpenSave (void)
LONG_PTR | MyAtol (LPTSTR, BOOL, LPBOOL)
INT_PTR APIENTRY | OpenFunc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void | OpenMultiThreadEnableButtons (BOOL, HWND)
UINT_PTR CALLBACK | OpenSaveHookProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
DWORD OpenSaveThread1Proc (LPDWORD)
DWORD OpenSaveThread2Proc (LPDWORD)

Variables

DWORD dwThreadID1
DWORD dwThreadID2
DWORD dwThreadParm1
DWORD dwThreadParm2
HBRUSH | hBrushButton
HBRUSH | hBrushDlg
HBRUSH | hBrushEdit
HANDLE hDialog
HANDLE hOpenSaveThread1
HANDLE hOpenSaveThread2
HRSRC | hRes
HWND | hwndMainDialog
int | nOpenDialogCount
OPENFILENAME | ofnThread1
OPENFILENAME | ofnThread2
UINT uMode

Function Documentation

void DoOpenDialog ( HWND hwnd )

Definition at line 128 of file Open.c.

{

  bDoOpenDlg = TRUE ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_OPENDIALOG), hwnd, OpenFunc) ;

}

void DoOpenSaveStuff ( LPOPENFILENAME po )

Definition at line 1187 of file Open.c.

{
  BOOL bRet = TRUE ;

  /* If bOpenDlg is TRUE, do GetOpenFileName(), else do GetSave().
     If the "NULL Structure" button is checked, send in a NULL pointer
     to the function */

  if (bDoOpenDlg)
  {
    if (IsDlgButtonChecked(hwndMainDialog, ID_NULLSTRUCTO) == 1)
      bRet = GetOpenFileName((LPOPENFILENAME) NULL) ;
    else
      bRet = GetOpenFileName(po) ;
  }

  else
  {
    if (IsDlgButtonChecked(hwndMainDialog, ID_NULLSTRUCTO))
      bRet = GetSaveFileName((LPOPENFILENAME) NULL) ;
    else
      bRet = GetSaveFileName(po) ;
  }

  /* Record the results */

  wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
  SetDlgItemText(hwndMainDialog, ID_ERRORO, szTemp) ;

  wsprintf(szTemp, szShortFilter, (int) bRet) ;
  SetDlgItemText(hwndMainDialog, ID_RETURNO, szTemp) ;

  InterpretCustomFilterString() ;

  FillOpenDlg(hwndMainDialog, po) ;

  if (hDialog)
  {
    FreeResource(hDialog) ;    //free ofn.hInstance
    hDialog = (HANDLE) 0 ;
    hRes = (HANDLE) 0 ;
  }
}

void FillOpenDlg | ( | HWND | hwnd,
 |  | LPOPENFILENAME | po
 | ) |  |

Definition at line 464 of file Open.c.

{
   int i = 0 ;

   wsprintf(szTemp, szShortFilter, (int) po->lStructSize) ;
   SetDlgItemText(hwnd, ID_STRUCTSIZEO, szTemp) ;

   wsprintf(szTemp, szPointerFilter, (LONG_PTR) po->hwndOwner) ;
   SetDlgItemText(hwnd, ID_HWNDOWNERO, szTemp) ;

   wsprintf(szTemp, szPointerFilter, (LONG_PTR) po->hInstance) ;
   SetDlgItemText(hwnd, ID_HINSTANCEO, szTemp) ;

   SendDlgItemMessage(hwnd, ID_FILTERO, CB_RESETCONTENT,
                      (WPARAM) 0, (LPARAM) 0) ;

   while (szFilterInits[i][0] != (TCHAR) 0)
   {
      SendDlgItemMessage(hwnd, ID_FILTERO, CB_ADDSTRING, (WPARAM) 0,
                        (LPARAM) (LPTSTR) &szFilterInits[i][0]) ;
      i++ ;
   }

   SendDlgItemMessage(hwnd, ID_FILTERO, CB_SETCURSEL,
                     (WPARAM) 0, (LPARAM) 0 ) ;

   SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_RESETCONTENT,
                      (WPARAM) 0, (LPARAM) 0) ;

   for (i=0; i<2; i++)
     SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_ADDSTRING, (WPARAM) 0,
                        (LPARAM) (LPTSTR) &szCustFiltInits[i][0]) ;

   SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_SETCURSEL,
                     (WPARAM) 0, (LPARAM) 0) ;

   wsprintf(szTemp, szShortFilter, (int) po->nMaxCustFilter) ;
   SetDlgItemText(hwnd, ID_MAXCUSTFILTO, szTemp) ;

   wsprintf(szTemp, szShortFilter, (int) po->nFilterIndex) ;
   SetDlgItemText(hwnd, ID_FILTINDEXO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZFILEO, po->lpstrFile) ;

   wsprintf(szTemp, szShortFilter, (int) po->nMaxFile) ;
   SetDlgItemText(hwnd, ID_MAXSZFILEO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZFILETITLEO, po->lpstrFileTitle) ;

   wsprintf(szTemp, szShortFilter, (int) po->nMaxFileTitle) ;
   SetDlgItemText(hwnd, ID_MAXSZFILETITLEO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZINITDIRO, po->lpstrInitialDir) ;

   SetDlgItemText(hwnd, ID_SZTITLEO, po->lpstrTitle) ;

   wsprintf(szTemp, szLongFilter, po->Flags) ;
   SetDlgItemText(hwnd, ID_FLAGSO, szTemp) ;

   wsprintf(szTemp, szShortFilter, po->nFileOffset) ;
   SetDlgItemText(hwnd, ID_FILEOFFO, szTemp) ;

   wsprintf(szTemp, szShortFilter, po->nFileExtension) ;
   SetDlgItemText(hwnd, ID_FILEEXTO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZDEFEXTO, po->lpstrDefExt) ;

   wsprintf(szTemp, szLongFilter, po->lCustData) ;
   SetDlgItemText(hwnd, ID_CUSTDATAO, szTemp) ;

   wsprintf(szTemp, szLongFilter, po->lpfnHook) ;
   SetDlgItemText(hwnd, ID_HOOKO, szTemp) ;

   SetDlgItemText(hwnd, ID_TEMPLATEO, po->lpTemplateName) ;

   return ;
}

HANDLE GetCorrectResourceHandle ( void )

Definition at line 872 of file Open.c.

{
  if (ofn.Flags & OFN_ALLOWMULTISELECT)
  {
     hRes = FindResource(hInst, TEXT("opentemp2"), RT_DIALOG) ;
     hDialog = LoadResource(hInst, hRes) ;
  }

  else
  {
     hRes = FindResource(hInst, TEXT("opentemp1"), RT_DIALOG) ;
     hDialog = LoadResource(hInst, hRes) ;
  }

  return hDialog ;
}

void GetOpenDlg | ( | HWND | hwnd,
 |  | LPOPENFILENAME | po
 | ) |  |

Definition at line 575 of file Open.c.

{
   int i ;
   BOOL b ;
   TCHAR szNum[20] ;

   GetDlgItemText(hwnd, ID_STRUCTSIZEO, szNum, 20) ;
   po->lStructSize = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_HWNDOWNERO, szNum, 20) ;
   po->hwndOwner = (HWND) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_HINSTANCEO, szNum, 20) ;
   po->hInstance = (HANDLE) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   /* these are just strings, no conversion necessary */

   i = 0 ;
   while (SendDlgItemMessage(hwnd, ID_FILTERO, CB_GETLBTEXT, (WPARAM) i,
                          (LPARAM) (LPTSTR) szFilterInits[i]) != CB_ERR)
   { i++ ; }

   /* create the filter string */

   InitFilterString() ;

   i = 0 ;

   while (SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_GETLBTEXT, (WPARAM) i,
                        (LPARAM) (LPTSTR) szCustFiltInits[i]) != CB_ERR)
   { i++ ; }

   InitCustFilterString() ;

   GetDlgItemText(hwnd, ID_MAXCUSTFILTO, szNum, 20) ;
   po->nMaxCustFilter = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_FILTINDEXO, szNum, 20) ;
   po->nFilterIndex = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZFILEO, po->lpstrFile, MAXBUF) ;

   GetDlgItemText(hwnd, ID_MAXSZFILEO, szNum, 20) ;
   po->nMaxFile = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZFILETITLEO, po->lpstrFileTitle, MAXBUF) ;

   GetDlgItemText(hwnd, ID_MAXSZFILETITLEO, szNum, MAXBUF) ;
   po->nMaxFileTitle = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZINITDIRO, (LPTSTR) po->lpstrInitialDir, MAXBUF) ;

   GetDlgItemText(hwnd, ID_SZTITLEO, (LPTSTR) po->lpstrTitle, MAXBUF) ;

   GetDlgItemText(hwnd, ID_FLAGSO, szNum, 20) ;
   po->Flags = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_FILEOFFO, szNum, 20) ;
   po->nFileOffset = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_FILEEXTO, szNum, 20) ;
   po->nFileExtension = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZDEFEXTO, (LPTSTR) po->lpstrDefExt, DEFEXTSIZE) ;

   GetDlgItemText(hwnd, ID_CUSTDATAO, szNum, 20) ;
   po->lCustData = MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_HOOKO, szNum, 20) ;
   po->lpfnHook = (LPOFNHOOKPROC) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_TEMPLATEO, (LPTSTR) po->lpTemplateName, TEMPNAMESIZE) ;

   /*  if we are supposed to use a preloaded resource handle, load it and put it in
       OPENFILENAME.hInstance... */

   if (IsDlgButtonChecked(hwnd, ID_USEHINSTO) == 1)
     po->hInstance = GetCorrectResourceHandle() ;

   return ;
}

void InitCustFilterString ( void )

Definition at line 772 of file Open.c.

{
  int i ;
  LPTSTR lpStr = szCustFilterString ;
  int nInc = 0 ;

  for (i=0; i<MAXBUF; i++)
    szCustFilterString[i] = 0 ;

  i = 0 ;

  for(i=0; i<2; i++)  //only two for the custom filter
  {
    lstrcpyn(lpStr, &szCustFiltInits[i][0], MAXBUF) ;
    nInc+=lstrlen(&szCustFiltInits[i][0]) + 1 ;
    lpStr = &szCustFilterString[nInc] ;
  }

  szCustFilterString[nInc] = (TCHAR) 0 ;

  lpszCustFilterString = szCustFilterString ;

  return ;
}

void InitFilterString ( void )

Definition at line 695 of file Open.c.

{
  int i ;
  int nInc = 0 ;
  LPTSTR lpStr = szFilterString ;

  /* First, zero out this memory just for the sake of sanity */

  for (i=0; i<MAXBUF; i++)
    szFilterString[i] = 0 ;

  /* Now, for each string in the szFilterInits array, concatenate it to
     the last one right after the last one's null terminator */

  i = 0 ;

  while (szFilterInits[i][0] != (TCHAR) 0)
  {
    lstrcpyn(lpStr, &szFilterInits[i][0], MAXBUF) ;
    nInc+=lstrlen(&szFilterInits[i][0]) + 1 ;   //1 past null term...
    lpStr = &szFilterString[nInc] ;
    i++ ;
  }

  szFilterString[nInc] = (TCHAR) 0 ;  //double terminator

  /* Set the lpszFilterString to point to the memory we just filled in
     with the filters because lpszFilterString is what is in
     OPENFILENAME->lpstrFilter */

  lpszFilterString = szFilterString ;

  return ;
}

void InitOpenStruct | ( | HWND | hwnd,
 |  | LPOPENFILENAME | po
 | ) |  |

Definition at line 365 of file Open.c.

{
   int i = 0 ;
   szFileName[0] = 0 ;
   szFileTitle[0] = 0 ;

   dwFlags = OFN_READONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_SHOWHELP  ;

   if (bDoOpenDlg)
     lstrcpyn(szDlgTitle, TEXT("Open Dialog Title"), ARRAYSIZE(szDlgTitle)) ;
   else
     lstrcpyn(szDlgTitle, TEXT("Save Dialog Title"), ARRAYSIZE(szDlgTitle)) ;

   lstrcpyn(szDefExt, TEXT("rat"), ARRAYSIZE(szDefExt)) ;
   lstrcpyn(szInitialDir, TEXT("c:\\"), ARRAYSIZE(szInitialDir)) ;
   lstrcpyn(szTempName, TEXT("opentemp1"), ARRAYSIZE(szTempName)) ;

   lstrcpyn(&szFilterInits[0][0], TEXT("All Files (*.*)"), 30) ;
   lstrcpyn(&szFilterInits[1][0], TEXT("*.*"), 30) ;
   lstrcpyn(&szFilterInits[2][0], TEXT("Fat Files (*.fat)"), 30) ;
   lstrcpyn(&szFilterInits[3][0], TEXT("*.fat"), 30) ;
   szFilterInits[4][0] = (TCHAR) 0 ;

   lstrcpyn(&szCustFiltInits[0][0], TEXT("Last Filter Used"), 30) ;
   lstrcpyn(&szCustFiltInits[1][0], TEXT("*.lst"), 30) ;
   szCustFiltInits[2][0] = (TCHAR) 0 ;

   /*

      These two functions will create "strings" in the applications
      data area that are in the form

      "Filter Description"\0
      "Filter"\0
      "Filter Description"\0
      "Filter"\0
      ..
      ..
      \0\0

      The filters must be in this form in order that the common dialogs
      interpret it correctly...
   */

   InitFilterString() ;

   InitCustFilterString() ;

   po->lStructSize          = sizeof(OPENFILENAME) ;
   po->hwndOwner            = hwnd ;
   po->hInstance            = hInst ;
   po->lpstrFilter          = lpszFilterString ;
   po->lpstrCustomFilter    = lpszCustFilterString ;
   po->nMaxCustFilter       = MAXCUSTFILTER ;
   po->nFilterIndex         = 1L ;
   po->lpstrFile            = szFileName ;
   po->nMaxFile             = FILENAMESIZE ;
   po->lpstrFileTitle       = szFileTitle ;
   po->nMaxFileTitle        = FILETITLESIZE ;
   po->lpstrInitialDir      = szInitialDir ;
   po->lpstrTitle           = szDlgTitle ;
   po->Flags                = dwFlags ;
   po->nFileOffset          = 0 ;
   po->nFileExtension       = 0 ;
   po->lpstrDefExt          = szDefExt;
   po->lCustData            = 0L ;
   po->lpfnHook             = OpenSaveHookProc ;
   po->lpTemplateName       = szTempName ;

   return ;
}

void InterpretCustomFilterString ( void )

Definition at line 823 of file Open.c.

{
  LPTSTR pNext ;

  int nCount = lstrlen(ofn.lpstrCustomFilter) ;

  pNext = ofn.lpstrCustomFilter + nCount + 1 ;  //one past the NULL

  /* add it to the filter inits array */

  lstrcpyn(&szCustFiltInits[0][0], ofn.lpstrCustomFilter, 30) ;
  lstrcpyn(&szCustFiltInits[1][0], pNext, 30) ;

}

void MultiThreadOpenSave ( void )

Definition at line 1060 of file Open.c.

{

  if (!(hOpenSaveThread1 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                        (LPTHREAD_START_ROUTINE) OpenSaveThread1Proc,
                                        &dwThreadParm1, CREATE_SUSPENDED, &dwThreadID1)))

  {
    MessageBox(GetForegroundWindow(), TEXT("Cannot create thread 1"), NULL, MB_OK | MB_ICONEXCLAMATION) ;
    OpenMultiThreadEnableButtons(TRUE, hwndMainDialog) ;
    nOpenDialogCount = 0 ;
    return ;
  }

  if (!(hOpenSaveThread2 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                        (LPTHREAD_START_ROUTINE) OpenSaveThread2Proc,
                                        &dwThreadParm2, CREATE_SUSPENDED, &dwThreadID2)))
  {
    MessageBox(GetForegroundWindow(), TEXT("Cannot create thread 2"), NULL, MB_OK | MB_ICONEXCLAMATION) ;
    OpenMultiThreadEnableButtons(TRUE, hwndMainDialog) ;
    nOpenDialogCount = 0 ;
    return ;
  }

  ResumeThread(hOpenSaveThread1) ;
  ResumeThread(hOpenSaveThread2) ;

}

LONG_PTR MyAtol | ( | LPTSTR | ,
 |  | BOOL | ,
 |  | LPBOOL |
 | ) |  |

Definition at line 460 of file CDTest.c.

{
  LPTSTR p ;
  LONG l ;
  LONG lMultiplier ;
  BOOL bDigit ;

  if (bHex)
    lMultiplier = 16 ;
  else
    lMultiplier = 10 ;

  p = szString ;
  l = 0 ;

  while (*p)      //while chars
  {
     bDigit = FALSE ;  //set to false for each char that we look at

     if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
     {
       bDigit = TRUE ;
       l+=(*p - (TCHAR) '0') ;
     }

     if (bHex)
     {
       if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
       {
         l+=(*p - (TCHAR) 'A' + 10) ;
         bDigit = TRUE ;
       }

       if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
       {
         l+=(*p - (TCHAR) 'a' + 10) ;
         bDigit = TRUE ;
       }

     }

     if (bDigit == FALSE)
     {
       *bSuccess = FALSE ;
       return 0 ;
     }

     p++ ;               //get next char

     if (*p)             //if there is going to be at least one more char
       l*=lMultiplier ;  //then multiply what we have by the multiplier...
  }

  *bSuccess = TRUE ;

  return l ;             //success! return the value.
}

INT_PTR APIENTRY OpenFunc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 165 of file Open.c.

{
  switch (msg)
  {

    case WM_INITDIALOG:

      if (bDoOpenDlg)
        SetWindowText(hwnd, TEXT("GetOpenFileName()")) ;
      else
        SetWindowText(hwnd, TEXT("GetSaveFileName()")) ;

      /* initialize the OPENFILENAME structure members */

      InitOpenStruct(hwnd, &ofn) ;

      /* Fill these values into the creation dialog */

      FillOpenDlg(hwnd, &ofn) ;

      /* There are three separate OPENFILENAME structures.  One for
         the main Open/Save dialog and one for each multithreaded dialog.
         Set them equal to begin with */

      *(&ofnThread1) = *(&ofnThread2) = *(&ofn) ;

      hwndMainDialog = hwnd ;

      SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEO)) ;

      break ;

    case UMSG_DECREMENTDLGCOUNT:  //user defined message indicating
                                  //the closure of a multithreaded dialog

      /* When we are multithreading, there is nothing to prevent the
         user from interacting with the creation dialog once the first
         GetOpen(Save) file name dialog has returned.  So, in order
         to prevent the Multithread" button from being pressed again
         before the previous two multithreaded dialogs have been canceled,
         disable the controls until we get a message from each thread
         that the dialog has ended */

      nOpenDialogCount-- ;

      if (nOpenDialogCount == 0)
        OpenMultiThreadEnableButtons(TRUE, hwnd) ;

      break ;

    case WM_COMMAND:
    {
      switch (LOWORD(wParam))
      {

        case IDOK:
          GetOpenDlg(hwnd, &ofn) ;          //get the user's input
          DoOpenSaveStuff(&ofn) ;           //do the dialog
          break ;

        case IDCANCEL:
          EndDialog(hwnd, FALSE) ;
          break ;

        case ID_RESETOPEN:

          SendDlgItemMessage(hwnd, ID_FILTERO, CB_RESETCONTENT,
            (WPARAM) 0, (LPARAM) 0) ;

          InitOpenStruct(hwnd, &ofn) ;

          FillOpenDlg(hwnd, &ofn) ;

          SendDlgItemMessage(hwnd, ID_NULLSTRUCTO, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
          SendDlgItemMessage(hwnd, ID_USEHINSTO, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;

          *(&ofnThread1) = *(&ofnThread2) = *(&ofn) ;

          SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEO)) ;

          break ;

        case ID_ADD1O:

          GetDlgItemText(hwnd, ID_FILTERO, szTemp, 100) ;

          if (*szTemp)
          {
            SendDlgItemMessage(hwnd, ID_FILTERO, CB_ADDSTRING, (WPARAM) 0,
                              (LPARAM) (LPTSTR) szTemp) ;
            SetWindowText(GetDlgItem(hwnd, ID_FILTERO), TEXT("")) ;
          }
          break ;

        case ID_ADD2O:

          GetDlgItemText(hwnd, ID_CUSTFILTO, szTemp, 100) ;

          if (*szTemp)
          {
            SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_ADDSTRING, (WPARAM) 0,
                              (LPARAM) (LPTSTR) szTemp) ;
            SetWindowText(GetDlgItem(hwnd, ID_CUSTFILTO), TEXT("")) ;
          }
          break ;

        case ID_CLEAR1O:
          SendDlgItemMessage(hwnd, ID_FILTERO, CB_RESETCONTENT,
                             (WPARAM) 0, (LPARAM) 0) ;
          break ;

        case ID_CLEAR2O:
          SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_RESETCONTENT,
                             (WPARAM) 0, (LPARAM) 0) ;
          break ;

        case ID_MULTIOPEN:

        /* First, disable the OK, Cancel, and MultiThread buttons */

          OpenMultiThreadEnableButtons(FALSE, hwnd) ;

        /* Then multithread the dialogs */

          nOpenDialogCount = 2 ;

          MultiThreadOpenSave() ;

          break ;

        default:   //end WM_COMMAND case
          break ;
      }
    }

    default:

      /* If the help button is pressed in the GetOpen/SaveFileName()
         dialogs, it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(),
                   TEXT("Hello from the help button"),
                   TEXT("Open Help Button"), MB_OK | MB_APPLMODAL) ;

      break ;

  }

  return FALSE ;
}

void OpenMultiThreadEnableButtons | ( | BOOL | bEnable,
 |  | HWND | hwnd
 | ) |  |

Definition at line 1258 of file Open.c.

{
  EnableWindow(GetDlgItem(hwnd, IDOK), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, IDCANCEL), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_RESETOPEN), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_MULTIOPEN), bEnable) ;
}

UINT_PTR CALLBACK OpenSaveHookProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 917 of file Open.c.

{
  LPOPENFILENAME pOfn ;
  TCHAR szMsg[50] ;

  switch(msg)
  {
    case WM_INITDIALOG:

      pOfn = (LPOPENFILENAME) lParam ;

      /* During initialization, if there is a hook proc, the getopen()
         code will send pointer to the OPENFILENAME strucure in the
         lParam.  To demonstrate this, pop up a message box if this
         structure has a non zero value in the lCustData structure member */

      if (pOfn->lCustData != 0L)
      {
        wsprintf(szMsg, TEXT("OPENFILENAME->lCustData is: %ld"), pOfn->lCustData) ;

        MessageBox(hwnd, szMsg, TEXT("lCustData Sent!"), MB_OK) ;
      }

      SetWindowText(hwnd, TEXT("Open Hook Proc Dialog")) ;

      break ;

    /* use the WM_CTLCOLOR* messages to change the color of the Open
       dialog */

    case WM_CTLCOLORDLG:

        if (!hBrushDlg)
            hBrushDlg = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushDlg ;

        break ;

    case WM_CTLCOLORBTN:

        SetBkMode((HDC) wParam, TRANSPARENT) ;   //sets background color
                                                 //for push and check box
                                                 //buttons...

        if (!hBrushButton)
            hBrushButton = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushButton ;

        break ;

    case WM_CTLCOLORSTATIC:

        SetTextColor((HDC) wParam, RGB(0x00, 0xff, 0x00)) ;  //green
        SetBkMode((HDC) wParam, TRANSPARENT) ;               //transparent text

        if (!hBrushDlg)
            hBrushDlg = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushDlg ;

        break ;

    case WM_COMMAND:
        switch (LOWORD(wParam))
        {
          case chx1:
            MessageBox(hwnd, TEXT("Read-Only button clicked..."),
                       TEXT("Open"), MB_OK | MB_APPLMODAL) ;
            break ;

          case ID_FILEPREVIEW:
            MessageBox(hwnd, TEXT("File Preview Button Clicked"),
                       TEXT("Open"), MB_OK | MB_APPLMODAL) ;
            break ;

          default: break ;
        }
        break ;

    default:

      if (msg == nOpenShareVMsg)
      {
        MessageBox(hwnd, TEXT("The SHAREVSTRING message is here!"),
                         TEXT("Open"),
                         MB_ICONEXCLAMATION | MB_OK | MB_APPLMODAL) ;

        return OFN_SHAREWARN ;
      }
      break ;
  }

  return FALSE ;   //send msg to the common dialog code
}

DWORD OpenSaveThread1Proc ( LPDWORD pDw )

Definition at line 1113 of file Open.c.

{

  /* Get the user's input */

  GetOpenDlg(hwndMainDialog, &ofnThread1) ;

  /* Do the dialog */

  DoOpenSaveStuff(&ofnThread1) ;

  /* send a message to the parent telling it to decrement the dialog count.
     When the dialog count reaches zero, all the buttons are enabled again. */

  SendMessage(hwndMainDialog, UMSG_DECREMENTDLGCOUNT, 0, 0L) ;

  return 0L ;
}

DWORD OpenSaveThread2Proc ( LPDWORD pDw )

Definition at line 1154 of file Open.c.

{
  GetOpenDlg(hwndMainDialog, &ofnThread2) ;

  DoOpenSaveStuff(&ofnThread2) ;

  SendMessage(hwndMainDialog, UMSG_DECREMENTDLGCOUNT, 0, 0L) ;

  return 0L ;
}

Variable Documentation

DWORD dwThreadID1

Definition at line 100 of file Open.c.

DWORD dwThreadID2

Definition at line 100 of file Open.c.

DWORD dwThreadParm1

Definition at line 101 of file Open.c.

DWORD dwThreadParm2

Definition at line 101 of file Open.c.

HBRUSH hBrushButton

Definition at line 97 of file Open.c.

HBRUSH hBrushDlg

Definition at line 95 of file Open.c.

HBRUSH hBrushEdit

Definition at line 96 of file Open.c.

HANDLE hDialog

Definition at line 93 of file Open.c.

HANDLE hOpenSaveThread1

Definition at line 99 of file Open.c.

HANDLE hOpenSaveThread2

Definition at line 99 of file Open.c.

HRSRC hRes

Definition at line 92 of file Open.c.

HWND hwndMainDialog

Definition at line 90 of file Open.c.

int nOpenDialogCount

Definition at line 103 of file Open.c.

OPENFILENAME ofnThread1

Definition at line 102 of file Open.c.

OPENFILENAME ofnThread2

Definition at line 102 of file Open.c.

UINT uMode

Definition at line 69 of file CDTest.c.

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Open.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

Open.h File Reference

Go to the source code of this file.

Defines

#define | DEFEXTSIZE 40
#define | DLGTITLESIZE MAXBUF
#define | FILENAMESIZE MAXBUF
#define | FILETITLESIZE MAXBUF
#define | ID_ADD1O 422
#define | ID_ADD2O 423
#define | ID_CLEAR1O 424
#define | ID_CLEAR2O 425
#define | ID_CUSTDATAO 419
#define | ID_CUSTFILTO 401
#define | ID_ERRORO 414
#define | ID_FILEEXTO 412
#define | ID_FILEOFFO 411
#define | ID_FILEPREVIEW 609
#define | ID_FILTERO 400
#define | ID_FILTINDEXO 403
#define | ID_FLAGSO 410
#define | ID_HINSTANCEO 418
#define | ID_HOOKO 420
#define | ID_HWNDOWNERO 417
#define | ID_MAXCUSTFILTO 402
#define | ID_MAXSZFILEO 405
#define | ID_MAXSZFILETITLEO 407
#define | ID_MULTIOPEN 608
#define | ID_NULLSTRUCTO 602
#define | ID_OPENDIALOG 606
#define | ID_RESETOPEN 601
#define | ID_RETURNO 415
#define | ID_STRUCTSIZEO 416
#define | ID_SZDEFEXTO 413
#define | ID_SZFILEO 404
#define | ID_SZFILETITLEO 406
#define | ID_SZINITDIRO 408
#define | ID_SZTITLEO 409
#define | ID_TEMPLATEO 421
#define | ID_USEHINSTO 607
#define | INITDIRSIZE MAXBUF
#define | MAXBUF 300
#define | MAXCUSTFILTER MAXBUF
#define | MAXFILTERS 10
#define | TEMPNAMESIZE 30

Functions

void | DoOpenDialog (HWND)
void | FillOpenDlg (HWND, LPOPENFILENAME)
void | GetOpenDlg (HWND, LPOPENFILENAME)
void | InitCustFilterString (void)
void | InitFilterString (void)
void | InitOpenStruct (HWND, LPOPENFILENAME)
INT_PTR APIENTRY | OpenFunc (HWND, UINT, WPARAM, LPARAM)

Variables

BOOL bDoOpenDlg
DWORD dwFlags
LPTSTR lpszCustFilterString
LPTSTR lpszFilterString
OPENFILENAME | ofn
TCHAR | szCustFilterString [MAXBUF]
TCHAR | szCustFiltInits [3][30]
TCHAR | szDefExt [DEFEXTSIZE]
TCHAR | szDlgTitle [DLGTITLESIZE]
TCHAR | szFileName [FILENAMESIZE]
TCHAR | szFileTitle [FILETITLESIZE]
TCHAR | szFilterInits [MAXFILTERS][30]
TCHAR | szFilterString [MAXBUF]
TCHAR | szInitialDir [INITDIRSIZE]
TCHAR | szTempName [TEMPNAMESIZE]

Define Documentation

#define DEFEXTSIZE 40

Definition at line 20 of file Open.h.

#define DLGTITLESIZE MAXBUF

Definition at line 18 of file Open.h.

#define FILENAMESIZE MAXBUF

Definition at line 16 of file Open.h.

#define FILETITLESIZE MAXBUF

Definition at line 17 of file Open.h.

#define ID_ADD1O 422

Definition at line 75 of file Open.h.

#define ID_ADD2O 423

Definition at line 76 of file Open.h.

#define ID_CLEAR1O 424

Definition at line 77 of file Open.h.

#define ID_CLEAR2O 425

Definition at line 78 of file Open.h.

#define ID_CUSTDATAO 419

Definition at line 72 of file Open.h.

#define ID_CUSTFILTO 401

Definition at line 53 of file Open.h.

#define ID_ERRORO 414

Definition at line 66 of file Open.h.

#define ID_FILEEXTO 412

Definition at line 64 of file Open.h.

#define ID_FILEOFFO 411

Definition at line 63 of file Open.h.

#define ID_FILEPREVIEW 609

Definition at line 83 of file Open.h.

#define ID_FILTERO 400

Definition at line 52 of file Open.h.

#define ID_FILTINDEXO 403

Definition at line 55 of file Open.h.

#define ID_FLAGSO 410

Definition at line 62 of file Open.h.

#define ID_HINSTANCEO 418

Definition at line 71 of file Open.h.

#define ID_HOOKO 420

Definition at line 73 of file Open.h.

#define ID_HWNDOWNERO 417

Definition at line 70 of file Open.h.

#define ID_MAXCUSTFILTO 402

Definition at line 54 of file Open.h.

#define ID_MAXSZFILEO 405

Definition at line 57 of file Open.h.

#define ID_MAXSZFILETITLEO 407

Definition at line 59 of file Open.h.

#define ID_MULTIOPEN 608

Definition at line 82 of file Open.h.

#define ID_NULLSTRUCTO 602

Definition at line 80 of file Open.h.

#define ID_OPENDIALOG 606

Definition at line 68 of file Open.h.

#define ID_RESETOPEN 601

Definition at line 79 of file Open.h.

#define ID_RETURNO 415

Definition at line 67 of file Open.h.

#define ID_STRUCTSIZEO 416

Definition at line 69 of file Open.h.

#define ID_SZDEFEXTO 413

Definition at line 65 of file Open.h.

#define ID_SZFILEO 404

Definition at line 56 of file Open.h.

#define ID_SZFILETITLEO 406

Definition at line 58 of file Open.h.

#define ID_SZINITDIRO 408

Definition at line 60 of file Open.h.

#define ID_SZTITLEO 409

Definition at line 61 of file Open.h.

#define ID_TEMPLATEO 421

Definition at line 74 of file Open.h.

#define ID_USEHINSTO 607

Definition at line 81 of file Open.h.

#define INITDIRSIZE MAXBUF

Definition at line 19 of file Open.h.

#define MAXBUF 300

Definition at line 12 of file Open.h.

#define MAXCUSTFILTER MAXBUF

Definition at line 15 of file Open.h.

#define MAXFILTERS 10

Definition at line 14 of file Open.h.

#define TEMPNAMESIZE 30

Definition at line 21 of file Open.h.

Function Documentation

void DoOpenDialog ( HWND )

Definition at line 128 of file Open.c.

{

  bDoOpenDlg = TRUE ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_OPENDIALOG), hwnd, OpenFunc) ;

}

void FillOpenDlg | ( | HWND | ,
 |  | LPOPENFILENAME |
 | ) |  |

Definition at line 464 of file Open.c.

{
   int i = 0 ;

   wsprintf(szTemp, szShortFilter, (int) po->lStructSize) ;
   SetDlgItemText(hwnd, ID_STRUCTSIZEO, szTemp) ;

   wsprintf(szTemp, szPointerFilter, (LONG_PTR) po->hwndOwner) ;
   SetDlgItemText(hwnd, ID_HWNDOWNERO, szTemp) ;

   wsprintf(szTemp, szPointerFilter, (LONG_PTR) po->hInstance) ;
   SetDlgItemText(hwnd, ID_HINSTANCEO, szTemp) ;

   SendDlgItemMessage(hwnd, ID_FILTERO, CB_RESETCONTENT,
                      (WPARAM) 0, (LPARAM) 0) ;

   while (szFilterInits[i][0] != (TCHAR) 0)
   {
      SendDlgItemMessage(hwnd, ID_FILTERO, CB_ADDSTRING, (WPARAM) 0,
                        (LPARAM) (LPTSTR) &szFilterInits[i][0]) ;
      i++ ;
   }

   SendDlgItemMessage(hwnd, ID_FILTERO, CB_SETCURSEL,
                     (WPARAM) 0, (LPARAM) 0 ) ;

   SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_RESETCONTENT,
                      (WPARAM) 0, (LPARAM) 0) ;

   for (i=0; i<2; i++)
     SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_ADDSTRING, (WPARAM) 0,
                        (LPARAM) (LPTSTR) &szCustFiltInits[i][0]) ;

   SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_SETCURSEL,
                     (WPARAM) 0, (LPARAM) 0) ;

   wsprintf(szTemp, szShortFilter, (int) po->nMaxCustFilter) ;
   SetDlgItemText(hwnd, ID_MAXCUSTFILTO, szTemp) ;

   wsprintf(szTemp, szShortFilter, (int) po->nFilterIndex) ;
   SetDlgItemText(hwnd, ID_FILTINDEXO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZFILEO, po->lpstrFile) ;

   wsprintf(szTemp, szShortFilter, (int) po->nMaxFile) ;
   SetDlgItemText(hwnd, ID_MAXSZFILEO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZFILETITLEO, po->lpstrFileTitle) ;

   wsprintf(szTemp, szShortFilter, (int) po->nMaxFileTitle) ;
   SetDlgItemText(hwnd, ID_MAXSZFILETITLEO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZINITDIRO, po->lpstrInitialDir) ;

   SetDlgItemText(hwnd, ID_SZTITLEO, po->lpstrTitle) ;

   wsprintf(szTemp, szLongFilter, po->Flags) ;
   SetDlgItemText(hwnd, ID_FLAGSO, szTemp) ;

   wsprintf(szTemp, szShortFilter, po->nFileOffset) ;
   SetDlgItemText(hwnd, ID_FILEOFFO, szTemp) ;

   wsprintf(szTemp, szShortFilter, po->nFileExtension) ;
   SetDlgItemText(hwnd, ID_FILEEXTO, szTemp) ;

   SetDlgItemText(hwnd, ID_SZDEFEXTO, po->lpstrDefExt) ;

   wsprintf(szTemp, szLongFilter, po->lCustData) ;
   SetDlgItemText(hwnd, ID_CUSTDATAO, szTemp) ;

   wsprintf(szTemp, szLongFilter, po->lpfnHook) ;
   SetDlgItemText(hwnd, ID_HOOKO, szTemp) ;

   SetDlgItemText(hwnd, ID_TEMPLATEO, po->lpTemplateName) ;

   return ;
}

void GetOpenDlg | ( | HWND | ,
 |  | LPOPENFILENAME |
 | ) |  |

Definition at line 575 of file Open.c.

{
   int i ;
   BOOL b ;
   TCHAR szNum[20] ;

   GetDlgItemText(hwnd, ID_STRUCTSIZEO, szNum, 20) ;
   po->lStructSize = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_HWNDOWNERO, szNum, 20) ;
   po->hwndOwner = (HWND) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_HINSTANCEO, szNum, 20) ;
   po->hInstance = (HANDLE) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   /* these are just strings, no conversion necessary */

   i = 0 ;
   while (SendDlgItemMessage(hwnd, ID_FILTERO, CB_GETLBTEXT, (WPARAM) i,
                          (LPARAM) (LPTSTR) szFilterInits[i]) != CB_ERR)
   { i++ ; }

   /* create the filter string */

   InitFilterString() ;

   i = 0 ;

   while (SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_GETLBTEXT, (WPARAM) i,
                        (LPARAM) (LPTSTR) szCustFiltInits[i]) != CB_ERR)
   { i++ ; }

   InitCustFilterString() ;

   GetDlgItemText(hwnd, ID_MAXCUSTFILTO, szNum, 20) ;
   po->nMaxCustFilter = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_FILTINDEXO, szNum, 20) ;
   po->nFilterIndex = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZFILEO, po->lpstrFile, MAXBUF) ;

   GetDlgItemText(hwnd, ID_MAXSZFILEO, szNum, 20) ;
   po->nMaxFile = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZFILETITLEO, po->lpstrFileTitle, MAXBUF) ;

   GetDlgItemText(hwnd, ID_MAXSZFILETITLEO, szNum, MAXBUF) ;
   po->nMaxFileTitle = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZINITDIRO, (LPTSTR) po->lpstrInitialDir, MAXBUF) ;

   GetDlgItemText(hwnd, ID_SZTITLEO, (LPTSTR) po->lpstrTitle, MAXBUF) ;

   GetDlgItemText(hwnd, ID_FLAGSO, szNum, 20) ;
   po->Flags = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_FILEOFFO, szNum, 20) ;
   po->nFileOffset = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_FILEEXTO, szNum, 20) ;
   po->nFileExtension = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_SZDEFEXTO, (LPTSTR) po->lpstrDefExt, DEFEXTSIZE) ;

   GetDlgItemText(hwnd, ID_CUSTDATAO, szNum, 20) ;
   po->lCustData = MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_HOOKO, szNum, 20) ;
   po->lpfnHook = (LPOFNHOOKPROC) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

   GetDlgItemText(hwnd, ID_TEMPLATEO, (LPTSTR) po->lpTemplateName, TEMPNAMESIZE) ;

   /*  if we are supposed to use a preloaded resource handle, load it and put it in
       OPENFILENAME.hInstance... */

   if (IsDlgButtonChecked(hwnd, ID_USEHINSTO) == 1)
     po->hInstance = GetCorrectResourceHandle() ;

   return ;
}

void InitCustFilterString ( void )

Definition at line 772 of file Open.c.

{
  int i ;
  LPTSTR lpStr = szCustFilterString ;
  int nInc = 0 ;

  for (i=0; i<MAXBUF; i++)
    szCustFilterString[i] = 0 ;

  i = 0 ;

  for(i=0; i<2; i++)  //only two for the custom filter
  {
    lstrcpyn(lpStr, &szCustFiltInits[i][0], MAXBUF) ;
    nInc+=lstrlen(&szCustFiltInits[i][0]) + 1 ;
    lpStr = &szCustFilterString[nInc] ;
  }

  szCustFilterString[nInc] = (TCHAR) 0 ;

  lpszCustFilterString = szCustFilterString ;

  return ;
}

void InitFilterString ( void )

Definition at line 695 of file Open.c.

{
  int i ;
  int nInc = 0 ;
  LPTSTR lpStr = szFilterString ;

  /* First, zero out this memory just for the sake of sanity */

  for (i=0; i<MAXBUF; i++)
    szFilterString[i] = 0 ;

  /* Now, for each string in the szFilterInits array, concatenate it to
     the last one right after the last one's null terminator */

  i = 0 ;

  while (szFilterInits[i][0] != (TCHAR) 0)
  {
    lstrcpyn(lpStr, &szFilterInits[i][0], MAXBUF) ;
    nInc+=lstrlen(&szFilterInits[i][0]) + 1 ;   //1 past null term...
    lpStr = &szFilterString[nInc] ;
    i++ ;
  }

  szFilterString[nInc] = (TCHAR) 0 ;  //double terminator

  /* Set the lpszFilterString to point to the memory we just filled in
     with the filters because lpszFilterString is what is in
     OPENFILENAME->lpstrFilter */

  lpszFilterString = szFilterString ;

  return ;
}

void InitOpenStruct | ( | HWND | ,
 |  | LPOPENFILENAME |
 | ) |  |

Definition at line 365 of file Open.c.

{
   int i = 0 ;
   szFileName[0] = 0 ;
   szFileTitle[0] = 0 ;

   dwFlags = OFN_READONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_SHOWHELP  ;

   if (bDoOpenDlg)
     lstrcpyn(szDlgTitle, TEXT("Open Dialog Title"), ARRAYSIZE(szDlgTitle)) ;
   else
     lstrcpyn(szDlgTitle, TEXT("Save Dialog Title"), ARRAYSIZE(szDlgTitle)) ;

   lstrcpyn(szDefExt, TEXT("rat"), ARRAYSIZE(szDefExt)) ;
   lstrcpyn(szInitialDir, TEXT("c:\\"), ARRAYSIZE(szInitialDir)) ;
   lstrcpyn(szTempName, TEXT("opentemp1"), ARRAYSIZE(szTempName)) ;

   lstrcpyn(&szFilterInits[0][0], TEXT("All Files (*.*)"), 30) ;
   lstrcpyn(&szFilterInits[1][0], TEXT("*.*"), 30) ;
   lstrcpyn(&szFilterInits[2][0], TEXT("Fat Files (*.fat)"), 30) ;
   lstrcpyn(&szFilterInits[3][0], TEXT("*.fat"), 30) ;
   szFilterInits[4][0] = (TCHAR) 0 ;

   lstrcpyn(&szCustFiltInits[0][0], TEXT("Last Filter Used"), 30) ;
   lstrcpyn(&szCustFiltInits[1][0], TEXT("*.lst"), 30) ;
   szCustFiltInits[2][0] = (TCHAR) 0 ;

   /*

      These two functions will create "strings" in the applications
      data area that are in the form

      "Filter Description"\0
      "Filter"\0
      "Filter Description"\0
      "Filter"\0
      ..
      ..
      \0\0

      The filters must be in this form in order that the common dialogs
      interpret it correctly...
   */

   InitFilterString() ;

   InitCustFilterString() ;

   po->lStructSize          = sizeof(OPENFILENAME) ;
   po->hwndOwner            = hwnd ;
   po->hInstance            = hInst ;
   po->lpstrFilter          = lpszFilterString ;
   po->lpstrCustomFilter    = lpszCustFilterString ;
   po->nMaxCustFilter       = MAXCUSTFILTER ;
   po->nFilterIndex         = 1L ;
   po->lpstrFile            = szFileName ;
   po->nMaxFile             = FILENAMESIZE ;
   po->lpstrFileTitle       = szFileTitle ;
   po->nMaxFileTitle        = FILETITLESIZE ;
   po->lpstrInitialDir      = szInitialDir ;
   po->lpstrTitle           = szDlgTitle ;
   po->Flags                = dwFlags ;
   po->nFileOffset          = 0 ;
   po->nFileExtension       = 0 ;
   po->lpstrDefExt          = szDefExt;
   po->lCustData            = 0L ;
   po->lpfnHook             = OpenSaveHookProc ;
   po->lpTemplateName       = szTempName ;

   return ;
}

INT_PTR APIENTRY OpenFunc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 165 of file Open.c.

{
  switch (msg)
  {

    case WM_INITDIALOG:

      if (bDoOpenDlg)
        SetWindowText(hwnd, TEXT("GetOpenFileName()")) ;
      else
        SetWindowText(hwnd, TEXT("GetSaveFileName()")) ;

      /* initialize the OPENFILENAME structure members */

      InitOpenStruct(hwnd, &ofn) ;

      /* Fill these values into the creation dialog */

      FillOpenDlg(hwnd, &ofn) ;

      /* There are three separate OPENFILENAME structures.  One for
         the main Open/Save dialog and one for each multithreaded dialog.
         Set them equal to begin with */

      *(&ofnThread1) = *(&ofnThread2) = *(&ofn) ;

      hwndMainDialog = hwnd ;

      SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEO)) ;

      break ;

    case UMSG_DECREMENTDLGCOUNT:  //user defined message indicating
                                  //the closure of a multithreaded dialog

      /* When we are multithreading, there is nothing to prevent the
         user from interacting with the creation dialog once the first
         GetOpen(Save) file name dialog has returned.  So, in order
         to prevent the Multithread" button from being pressed again
         before the previous two multithreaded dialogs have been canceled,
         disable the controls until we get a message from each thread
         that the dialog has ended */

      nOpenDialogCount-- ;

      if (nOpenDialogCount == 0)
        OpenMultiThreadEnableButtons(TRUE, hwnd) ;

      break ;

    case WM_COMMAND:
    {
      switch (LOWORD(wParam))
      {

        case IDOK:
          GetOpenDlg(hwnd, &ofn) ;          //get the user's input
          DoOpenSaveStuff(&ofn) ;           //do the dialog
          break ;

        case IDCANCEL:
          EndDialog(hwnd, FALSE) ;
          break ;

        case ID_RESETOPEN:

          SendDlgItemMessage(hwnd, ID_FILTERO, CB_RESETCONTENT,
            (WPARAM) 0, (LPARAM) 0) ;

          InitOpenStruct(hwnd, &ofn) ;

          FillOpenDlg(hwnd, &ofn) ;

          SendDlgItemMessage(hwnd, ID_NULLSTRUCTO, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
          SendDlgItemMessage(hwnd, ID_USEHINSTO, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;

          *(&ofnThread1) = *(&ofnThread2) = *(&ofn) ;

          SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEO)) ;

          break ;

        case ID_ADD1O:

          GetDlgItemText(hwnd, ID_FILTERO, szTemp, 100) ;

          if (*szTemp)
          {
            SendDlgItemMessage(hwnd, ID_FILTERO, CB_ADDSTRING, (WPARAM) 0,
                              (LPARAM) (LPTSTR) szTemp) ;
            SetWindowText(GetDlgItem(hwnd, ID_FILTERO), TEXT("")) ;
          }
          break ;

        case ID_ADD2O:

          GetDlgItemText(hwnd, ID_CUSTFILTO, szTemp, 100) ;

          if (*szTemp)
          {
            SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_ADDSTRING, (WPARAM) 0,
                              (LPARAM) (LPTSTR) szTemp) ;
            SetWindowText(GetDlgItem(hwnd, ID_CUSTFILTO), TEXT("")) ;
          }
          break ;

        case ID_CLEAR1O:
          SendDlgItemMessage(hwnd, ID_FILTERO, CB_RESETCONTENT,
                             (WPARAM) 0, (LPARAM) 0) ;
          break ;

        case ID_CLEAR2O:
          SendDlgItemMessage(hwnd, ID_CUSTFILTO, CB_RESETCONTENT,
                             (WPARAM) 0, (LPARAM) 0) ;
          break ;

        case ID_MULTIOPEN:

        /* First, disable the OK, Cancel, and MultiThread buttons */

          OpenMultiThreadEnableButtons(FALSE, hwnd) ;

        /* Then multithread the dialogs */

          nOpenDialogCount = 2 ;

          MultiThreadOpenSave() ;

          break ;

        default:   //end WM_COMMAND case
          break ;
      }
    }

    default:

      /* If the help button is pressed in the GetOpen/SaveFileName()
         dialogs, it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(),
                   TEXT("Hello from the help button"),
                   TEXT("Open Help Button"), MB_OK | MB_APPLMODAL) ;

      break ;

  }

  return FALSE ;
}

Variable Documentation

BOOL bDoOpenDlg

Definition at line 6 of file Open.h.

DWORD dwFlags

Definition at line 46 of file Open.h.

LPTSTR lpszCustFilterString

Definition at line 43 of file Open.h.

LPTSTR lpszFilterString

Definition at line 39 of file Open.h.

OPENFILENAME ofn

Definition at line 10 of file Open.h.

TCHAR szCustFilterString[MAXBUF]

Definition at line 42 of file Open.h.

TCHAR szCustFiltInits[3][30]

Definition at line 41 of file Open.h.

TCHAR szDefExt[DEFEXTSIZE]

Definition at line 34 of file Open.h.

TCHAR szDlgTitle[DLGTITLESIZE]

Definition at line 31 of file Open.h.

TCHAR szFileName[FILENAMESIZE]

Definition at line 32 of file Open.h.

TCHAR szFileTitle[FILETITLESIZE]

Definition at line 30 of file Open.h.

TCHAR szFilterInits[MAXFILTERS][30]

Definition at line 37 of file Open.h.

TCHAR szFilterString[MAXBUF]

Definition at line 38 of file Open.h.

TCHAR szInitialDir[INITDIRSIZE]

Definition at line 33 of file Open.h.

TCHAR szTempName[TEMPNAMESIZE]

Definition at line 35 of file Open.h.

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Print.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

Print.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <stdlib.h>
#include <winnls.h>
#include "cdtest.h"
#include "print.h"
#include "devnames.h"
#include "devmode.h"
#include "dlgs.h"

Go to the source code of this file.

Defines

#define | WMAX 20
#define | WMAXDEV 30

Functions

INT_PTR APIENTRY | DevmodeProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR APIENTRY | DevnamesProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void | DoPrintDialog (HWND hwnd)
void | DoPrintDlgStuff (HWND, LPPRINTDLG)
void | EnablePrintControls (HWND, BOOL)
void | FillDevmodeDlg (HWND, LPPRINTDLG)
void | FillDevnamesDlg (HWND, LPPRINTDLG)
void | FillPrintDlg (HWND, LPPRINTDLG)
void | GetDevmodeDlg (HWND, LPPRINTDLG)
void | GetDevnamesDlg (HWND, LPPRINTDLG)
void | GetPrintDlg (HWND, LPPRINTDLG)
HANDLE | GetPrintDlgHandle (void)
HANDLE | GetSetupDlgHandle (void)
void | InitPrintStruct (HWND, LPPRINTDLG)
void | MultiThreadPrintDlg (void)
LONG_PTR | MyAtol (LPTSTR, BOOL, LPBOOL)
UINT_PTR CALLBACK | PrintHookProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
DWORD PrintMultiProc1 (LPDWORD)
DWORD PrintMultiProc2 (LPDWORD)
INT_PTR APIENTRY | PrintProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

Variables

DWORD dwPrintThreadID1
DWORD dwPrintThreadID2
DWORD dwPrintThreadParm1
DWORD dwPrintThreadParm2
HBRUSH | hBrushButton
HBRUSH | hBrushDlg
HBRUSH | hBrushEdit
HANDLE hDevMode
HANDLE hDevNames
HGLOBAL hDialogPrint
HANDLE hPrintThread1
HANDLE hPrintThread2
HRSRC | hResPrint
HWND | hwndMainPrint
int | nOpenDialogCount
PRINTDLG | pd
PRINTDLG | pdThread1
PRINTDLG | pdThread2
TCHAR | szDeviceOffset [100]
TCHAR | szDriverOffset [100]
TCHAR | szOutputOffset [100]
TCHAR | szPrintTempName [40]
TCHAR | szSetupTempName [40]
UINT_PTR | uMode

Define Documentation

#define WMAX 20
#define WMAXDEV 30

Function Documentation

INT_PTR APIENTRY DevmodeProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 328 of file Print.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:
        FillDevmodeDlg(hwnd, &pd) ;
        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetDevmodeDlg(hwnd, &pd) ;
            EndDialog(hwnd, TRUE) ;
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          default: break ;
        }
    }

    default: break ;
  }

  return FALSE ;
}

INT_PTR APIENTRY DevnamesProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 280 of file Print.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:
        FillDevnamesDlg(hwnd, &pd) ;
        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetDevnamesDlg(hwnd, &pd) ;
            EndDialog(hwnd, TRUE) ;
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          default: break ;
        }
    }

    default: break ;
  }

  return FALSE ;
}

void DoPrintDialog ( HWND hwnd )

Definition at line 142 of file Print.c.

{

  DialogBox(hInst, MAKEINTRESOURCE(ID_PRINTDIALOG),
            hwnd, PrintProc) ;

}

void DoPrintDlgStuff | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 1306 of file Print.c.

{
  BOOL bRet = FALSE ;

  /* Figure out how the user want's to call PrintDlg() */

  if (IsDlgButtonChecked(hwnd, ID_PREPRINTP) == 1)
    ppd->hPrintTemplate = GetPrintDlgHandle() ;

  if (IsDlgButtonChecked(hwnd, ID_PRESETUPP) == 1)
    ppd->hSetupTemplate = GetSetupDlgHandle() ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hPrintTemplate) ;
  SetDlgItemText(hwnd, ID_HPRINTTEMPP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hSetupTemplate) ;
  SetDlgItemText(hwnd, ID_HSETUPTEMPP, szTemp) ;

  /* Call the function */

  if (IsDlgButtonChecked(hwnd, ID_NULLSTRUCTP) == 1)
    bRet = PrintDlg((LPPRINTDLG) NULL) ;
  else
    bRet = PrintDlg(ppd) ;

  /* Clean up and show results */

  wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
  SetDlgItemText(hwnd, ID_ERRORP, szTemp) ;

  SetDlgItemInt(hwnd, ID_RETURNP, bRet, TRUE) ;

  if (hDialogPrint)
  {
    FreeResource(hDialogPrint) ; //obsolete call, but
    hDialogPrint = (HANDLE) 0 ;  //it's possible that this
    hResPrint = (HANDLE) 0 ;    //might be recompiled for win 3.x
  }

  pd.hDevMode = ppd->hDevMode ;    //need to fix this so that FillDevnamesDlg()
  pd.hDevNames = ppd->hDevNames ;  //and FillDevmodeDlg() work...

  FillPrintDlg(hwnd, ppd) ;

  if (ppd->hDC)  //release the HDC after its value is
                 //returned to the test app
  {
    ReleaseDC(ppd->hwndOwner, ppd->hDC) ;
    ppd->hDC = (HDC) 0 ;
  }
}

void EnablePrintControls | ( | HWND | hwnd,
 |  | BOOL | bEnable
 | ) |  |

Definition at line 1278 of file Print.c.

{
  EnableWindow(GetDlgItem(hwnd, IDOK), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, IDCANCEL), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_RESETPRINT), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_MULTITHREADPRINT), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_EDITDEVMODE), bEnable) ;
  EnableWindow(GetDlgItem(hwnd, ID_EDITDEVNAMES), bEnable) ;
}

void FillDevmodeDlg | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 765 of file Print.c.

{
  LPDEVMODE p ;

  if (ppd->hDevMode == (HANDLE) 0)
    return ;

  p = (LPDEVMODE) GlobalLock(ppd->hDevMode) ;
  if (p == (LPDEVMODE) NULL) return ;

  SetDlgItemText(hwnd, ID_DMDEVNAME, (LPTSTR) p->dmDeviceName) ;

  wsprintf(szTemp, szShortFilter, (int) p->dmSpecVersion) ;
  SetDlgItemText(hwnd, ID_DMSPECVER, szTemp) ;

  wsprintf(szTemp, szShortFilter, (int) p->dmDriverVersion) ;
  SetDlgItemText(hwnd, ID_DMDRIVERVER, szTemp) ;

  wsprintf(szTemp, szShortFilter, (int) p->dmSize) ;
  SetDlgItemText(hwnd, ID_DMSIZEDEV, szTemp) ;

  wsprintf(szTemp, szShortFilter, (int) p->dmDriverExtra) ;
  SetDlgItemText(hwnd, ID_DMDRIVEREXTRA, szTemp) ;

  wsprintf(szTemp, szShortFilter, (int) p->dmFields) ;
  SetDlgItemText(hwnd, ID_DMFIELDS, szTemp) ;

  wsprintf(szTemp, szShortFilter, (int) p->dmOrientation) ;
  SetDlgItemText(hwnd, ID_DMORIENTATION, szTemp) ;

  wsprintf(szTemp, szShortFilter, (int) p->dmPaperSize) ;
  SetDlgItemText(hwnd, ID_DMPAPERSIZE, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmPaperLength) ;
  SetDlgItemText(hwnd, ID_DMPAPERLENGTH, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmPaperWidth) ;
  SetDlgItemText(hwnd, ID_DMPAPERWIDTH, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmScale) ;
  SetDlgItemText(hwnd, ID_DMSCALE, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmCopies) ;
  SetDlgItemText(hwnd, ID_DMCOPIES, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmDefaultSource) ;
  SetDlgItemText(hwnd, ID_DMDEFAULTSOURCE, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmPrintQuality) ;
  SetDlgItemText(hwnd, ID_DMPRINTQUALITY, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmColor) ;
  SetDlgItemText(hwnd, ID_DMCOLOR, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmDuplex) ;
  SetDlgItemText(hwnd, ID_DMDUPLEX, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmCollate) ;
  SetDlgItemText(hwnd, ID_DMCOLLATE, szTemp) ;

  SetDlgItemText(hwnd, ID_DMFORMNAME, (LPTSTR) p->dmFormName) ;

  wsprintf(szTemp, szLongFilter, p->dmBitsPerPel) ;
  SetDlgItemText(hwnd, ID_DMBITSPERPEL, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmPelsWidth) ;
  SetDlgItemText(hwnd, ID_DMPELSWIDTH, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmPelsHeight) ;
  SetDlgItemText(hwnd, ID_DMPELSHEIGHT, szTemp) ;

  wsprintf(szTemp, szLongFilter, p->dmDisplayFrequency) ;
  SetDlgItemText(hwnd, ID_DMDISPLAYFREQ, szTemp) ;

  GlobalUnlock(ppd->hDevMode) ;
}

void FillDevnamesDlg | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 608 of file Print.c.

{
  LPDEVNAMES pn = (LPDEVNAMES) 0 ;

  if (ppd->hDevNames == (HANDLE) 0)
    return ;

  pn = (LPDEVNAMES) GlobalLock(ppd->hDevNames) ;
  if (pn == (LPDEVNAMES) NULL) return ;

  /* To find the strings in this block of memory, add the correct
     offset to the original pointer returned by GlobalLock() */

  SetDlgItemText(hwnd, ID_WDRIVEROFF, (LPTSTR) pn + pn->wDriverOffset) ;

  SetDlgItemText(hwnd, ID_WDEVICEOFF, (LPTSTR) pn + pn->wDeviceOffset) ;

  SetDlgItemText(hwnd, ID_WOUTPUTOFF, (LPTSTR) pn + pn->wOutputOffset) ;

  wsprintf(szTemp, szShortFilter, (int) pn->wDefault) ;
  SetDlgItemText(hwnd, ID_WDEFAULT, szTemp) ;

  GlobalUnlock(ppd->hDevNames) ;
}

void FillPrintDlg | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 444 of file Print.c.

{
  wsprintf(szTemp, szLongFilter, ppd->lStructSize) ;
  SetDlgItemText(hwnd, ID_STRUCTSIZEP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hwndOwner) ;
  SetDlgItemText(hwnd, ID_HWNDOWNERP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hDevMode) ;
  SetDlgItemText(hwnd, ID_HDEVMODEP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hDevNames) ;
  SetDlgItemText(hwnd, ID_HDEVNAMESP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hDC) ;
  SetDlgItemText(hwnd, ID_HDCP, szTemp) ;

  wsprintf(szTemp, szLongFilter, ppd->Flags) ;
  SetDlgItemText(hwnd, ID_FLAGSP, szTemp) ;

  wsprintf(szTemp, szShortFilter, ppd->nFromPage) ;
  SetDlgItemText(hwnd, ID_FROMPAGEP, szTemp) ;

  wsprintf(szTemp, szShortFilter, ppd->nToPage) ;
  SetDlgItemText(hwnd, ID_TOPAGEP, szTemp) ;

  wsprintf(szTemp, szShortFilter, ppd->nMinPage) ;
  SetDlgItemText(hwnd, ID_MINPAGEP, szTemp) ;

  wsprintf(szTemp, szShortFilter, ppd->nMaxPage) ;
  SetDlgItemText(hwnd, ID_MAXPAGEP, szTemp) ;

  wsprintf(szTemp, szShortFilter, ppd->nCopies) ;
  SetDlgItemText(hwnd, ID_COPIESP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hInstance) ;
  SetDlgItemText(hwnd, ID_HINSTANCEP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->lCustData) ;
  SetDlgItemText(hwnd, ID_CUSTDATAP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->lpfnPrintHook) ;
  SetDlgItemText(hwnd, ID_PRINTHOOKP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->lpfnSetupHook) ;
  SetDlgItemText(hwnd, ID_SETUPHOOKP, szTemp) ;

  SetDlgItemText(hwnd, ID_LPPRINTTEMPP, ppd->lpPrintTemplateName) ;

  SetDlgItemText(hwnd, ID_LPSETUPTEMPP, ppd->lpSetupTemplateName) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hPrintTemplate) ;
  SetDlgItemText(hwnd, ID_HPRINTTEMPP, szTemp) ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hSetupTemplate) ;
  SetDlgItemText(hwnd, ID_HSETUPTEMPP, szTemp) ;
}

void GetDevmodeDlg | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 865 of file Print.c.

{
  LPDEVMODE p ;
  BOOL b ;
  TCHAR szNum[30] ;

  #define WMAXDEV 30

  if (hDevMode)
  {
    GlobalFree(hDevMode) ;
    hDevMode = (HANDLE) 0 ;
  }

  if (!(hDevMode = GlobalAlloc(GMEM_ZEROINIT | GMEM_MOVEABLE, sizeof(DEVMODE))))
  {
    MessageBox(hwnd, TEXT("Can't allocate memory for hDevMode"),
               TEXT("Fatal Error"), MB_OK | MB_APPLMODAL) ;
    return ;
  }

  if (!(p = (LPDEVMODE) GlobalLock(hDevMode)))
  {
    MessageBox(hwnd, TEXT("Can't lock memory for hDevMode"),
               TEXT("Fatal Error"), MB_OK | MB_APPLMODAL) ;

    GlobalFree(hDevMode) ;
    hDevMode = (HANDLE) 0 ;

    return ;
  }

  GetDlgItemText(hwnd, ID_DMDEVNAME, (LPTSTR)p->dmDeviceName, 32) ;

  GetDlgItemText(hwnd, ID_DMSPECVER, szNum, WMAXDEV) ;
  p->dmSpecVersion = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMDRIVERVER, szNum, WMAXDEV) ;
  p->dmDriverVersion = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMSIZEDEV, szNum, WMAXDEV) ;
  p->dmSize = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMDRIVEREXTRA, szNum, WMAXDEV) ;
  p->dmDriverExtra = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMFIELDS, szNum, WMAXDEV) ;
  p->dmFields = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMORIENTATION, szNum, WMAXDEV) ;
  p->dmOrientation = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMPAPERSIZE, szNum, WMAXDEV) ;
  p->dmPaperSize = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMPAPERLENGTH, szNum, WMAXDEV) ;
  p->dmPaperLength = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMPAPERWIDTH, szNum, WMAXDEV) ;
  p->dmPaperWidth = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMSCALE, szNum, WMAXDEV) ;
  p->dmScale = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMCOPIES, szNum, WMAXDEV) ;
  p->dmCopies = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMDEFAULTSOURCE, szNum, WMAXDEV) ;
  p->dmDefaultSource = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMPRINTQUALITY, szNum, WMAXDEV) ;
  p->dmPrintQuality = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMCOLOR, szNum, WMAXDEV) ;
  p->dmColor = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMDUPLEX, szNum, WMAXDEV) ;
  p->dmDuplex = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMCOLLATE, szNum, WMAXDEV) ;
  p->dmCollate = (short) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMFORMNAME, (LPTSTR)p->dmFormName, 32) ;

  GetDlgItemText(hwnd, ID_DMBITSPERPEL, szNum, WMAXDEV) ;
  p->dmBitsPerPel = (USHORT) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMPELSWIDTH, szNum, WMAXDEV) ;
  p->dmPelsWidth = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMPELSHEIGHT, szNum, WMAXDEV) ;
  p->dmPelsHeight = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_DMDISPLAYFREQ, szNum, WMAXDEV) ;
  p->dmDisplayFrequency = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GlobalUnlock(hDevMode) ;
  ppd->hDevMode = hDevMode ;

  wsprintf(szTemp, szPointerFilter, (DWORD_PTR) ppd->hDevMode) ;
  SetDlgItemText(GetParent(hwnd), ID_HDEVMODEP, szTemp) ;
}

void GetDevnamesDlg | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 659 of file Print.c.

{
  BOOL b ;
  TCHAR szNum[30] ;
  LPDEVNAMES pn ;
  TCHAR sz1[100] ;
  TCHAR sz2[100] ;
  TCHAR sz3[100] ;
  DWORD dwSize ;
  int n1, n2, n3 ;

  GetDlgItemText(hwnd, ID_WDRIVEROFF, sz1, 100) ;
  GetDlgItemText(hwnd, ID_WDEVICEOFF, sz2, 100) ;
  GetDlgItemText(hwnd, ID_WOUTPUTOFF, sz3, 100) ;

  n1 = lstrlen(sz1) ;
  n2 = lstrlen(sz2) ;
  n3 = lstrlen(sz3) ;

  if (hDevNames)
  {
    GlobalFree(hDevNames) ;
    hDevNames = (HANDLE) 0 ;
  }

  /* allocate size of everything + 5 extra bytes for zeroes */

  dwSize = sizeof(DEVNAMES) + ((n1+n2+n3+5) * sizeof(TCHAR)) ;

  /* Allocate the memory and lock it down */

  if (!(hDevNames = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, dwSize)))
  {
    MessageBox(hwnd, TEXT("Can't Alloc memory for hDevNames!"),
               TEXT("Fatal Error!"), MB_OK | MB_APPLMODAL) ;
    return ;
  }

  if (!(pn = (LPDEVNAMES) GlobalLock(hDevNames)))
  {
    MessageBox(hwnd, TEXT("Can't Lock New hDevNames memory!"),
               TEXT("Fatal Error"), MB_OK | MB_APPLMODAL) ;

    GlobalFree(hDevNames) ;

    hDevNames = (HANDLE) 0 ;

    return ;
  }

  /* skip over devnames and copy string 1 there.  Make sure to
     divide by sizeof(TCHAR) or the compiler will create a pointer
     that points too far if you compile as a UNICODE program */

  pn->wDriverOffset = sizeof(DEVNAMES) / sizeof(TCHAR) ;
  lstrcpyn((LPTSTR) pn + pn->wDriverOffset, (LPTSTR) sz1, (dwSize / sizeof(TCHAR)) - pn->wDriverOffset) ;

  /* skip over string 1 and add string 1 with a zero between them */

  pn->wDeviceOffset = pn->wDriverOffset + (WORD)n1 + 1 ;
  lstrcpyn((LPTSTR) pn + pn->wDeviceOffset, (LPTSTR) sz2, (dwSize / sizeof(TCHAR)) - pn->wDeviceOffset) ;

  /* skip over string 2 and put string 3 there with a zero between them */

  pn->wOutputOffset = pn->wDeviceOffset + (WORD)n2 + 1 ;
  lstrcpyn((LPTSTR) pn + pn->wOutputOffset, (LPTSTR) sz3, (dwSize / sizeof(TCHAR)) - pn->wOutputOffset) ;

  GetDlgItemText(hwnd, ID_WDEFAULT, szNum, 30) ;
  pn->wDefault = (WORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;

  GlobalUnlock(hDevNames) ;

  ppd->hDevNames = hDevNames ;

  wsprintf(szTemp, szLongFilter, ppd->hDevNames) ;
  SetDlgItemText(GetParent(hwnd), ID_HDEVNAMESP, szTemp) ;

}

void GetPrintDlg | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 523 of file Print.c.

{
  BOOL b ;
  TCHAR szNum[20] ;

  #define WMAX 20

  GetDlgItemText(hwnd, ID_STRUCTSIZEP, szNum, WMAX) ;
  ppd->lStructSize = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HWNDOWNERP, szNum, WMAX) ;
  ppd->hwndOwner = (HWND) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HDEVMODEP, szNum, WMAX) ;
  ppd->hDevMode = (HANDLE) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HDEVNAMESP, szNum, WMAX) ;
  ppd->hDevNames = (HANDLE) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HDCP, szNum, WMAX) ;
  ppd->hDC = (HDC) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_FLAGSP, szNum, WMAX) ;
  ppd->Flags = (DWORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_FROMPAGEP, szNum, WMAX) ;
  ppd->nFromPage = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_TOPAGEP, szNum, WMAX) ;
  ppd->nToPage = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_MINPAGEP, szNum, WMAX) ;
  ppd->nMinPage = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_MAXPAGEP, szNum, WMAX) ;
  ppd->nMaxPage = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_COPIESP, szNum, WMAX) ;
  ppd->nCopies = (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HINSTANCEP, szNum, WMAX) ;
  ppd->hInstance = (HANDLE) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_CUSTDATAP, szNum, WMAX) ;
  ppd->lCustData = MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_PRINTHOOKP, szNum, WMAX) ;
  ppd->lpfnPrintHook = (LPPRINTHOOKPROC) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_SETUPHOOKP, szNum, WMAX) ;
  ppd->lpfnSetupHook = (LPSETUPHOOKPROC) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_LPPRINTTEMPP, szPrintTempName, 100) ;

  GetDlgItemText(hwnd, ID_LPSETUPTEMPP, szSetupTempName, 100) ;

  GetDlgItemText(hwnd, ID_HPRINTTEMPP, szNum, WMAX) ;
  ppd->hPrintTemplate = (HANDLE) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

  GetDlgItemText(hwnd, ID_HSETUPTEMPP, szNum, WMAX) ;
  ppd->hSetupTemplate = (HANDLE) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

}

HANDLE GetPrintDlgHandle ( void )

Definition at line 986 of file Print.c.

{
  hResPrint = FindResource(hInst, TEXT("prtemp1"), RT_DIALOG) ;

  hDialogPrint = LoadResource(hInst, hResPrint) ;

  return hDialogPrint ;
}

HANDLE GetSetupDlgHandle ( void )

Definition at line 1016 of file Print.c.

{
  hResPrint = FindResource(hInst, TEXT("prtemp2"), RT_DIALOG) ;

  hDialogPrint = LoadResource(hInst, hResPrint) ;

  return hDialogPrint ;
}

void InitPrintStruct | ( | HWND | hwnd,
 |  | LPPRINTDLG | ppd
 | ) |  |

Definition at line 382 of file Print.c.

{
  DWORD dwTempFlags = 0 ;

  ppd->lStructSize = sizeof(PRINTDLG) ;
  ppd->hwndOwner = hwnd ;
  ppd->hDevMode = (HANDLE) 0 ;
  ppd->hDevNames = (HANDLE) 0 ;
  ppd->hDC = (HDC) 0 ;
  ppd->Flags = PD_RETURNDC | PD_COLLATE | PD_SHOWHELP | PD_PAGENUMS ;
  ppd->nFromPage = 1 ;
  ppd->nToPage = 10 ;
  ppd->nMinPage = 1 ;
  ppd->nMaxPage = 10 ;
  ppd->nCopies = 1000 ;
  ppd->hInstance = (HANDLE) hInst ;
  ppd->lCustData = 0L ;

  ppd->lpfnPrintHook = PrintHookProc ;
  ppd->lpfnSetupHook = PrintHookProc ;

  lstrcpyn(szPrintTempName, TEXT("prtemp1"), ARRAYSIZE(szPrintTempName)) ;
  ppd->lpPrintTemplateName = szPrintTempName ;

  lstrcpyn(szSetupTempName, TEXT("prtemp2"), ARRAYSIZE(szSetupTempName)) ;
  ppd->lpSetupTemplateName = szSetupTempName ;

  ppd->hPrintTemplate = (HANDLE) 0 ;   //these are unknown right now
  ppd->hSetupTemplate = (HANDLE) 0 ;

  /* Let's fill the hDevMode and hDevNames structures. */
  /* This call should just return handles to structures of this */
  /* type filled with the info for the default printer */

  dwTempFlags = ppd->Flags ;
  ppd->Flags = PD_RETURNDEFAULT | PD_RETURNDC ;
  PrintDlg(ppd) ;

  ppd->Flags = dwTempFlags ;
}

void MultiThreadPrintDlg ( void )

Definition at line 1218 of file Print.c.

{

  dwPrintThreadParm1 = dwPrintThreadParm2 = 0L ;

  if (!(hPrintThread1 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                     (LPTHREAD_START_ROUTINE) PrintMultiProc1,
                                     &dwPrintThreadParm1, CREATE_SUSPENDED, &dwPrintThreadID1)))

  {
    MessageBox(GetForegroundWindow(), TEXT("Error creating thread 1"), NULL,
               MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;

    nOpenDialogCount = 0 ;

    EnablePrintControls(hwndMainPrint, TRUE) ;

    return ;
  }

  if (!(hPrintThread2 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
                                     (LPTHREAD_START_ROUTINE) PrintMultiProc2,
                                     &dwPrintThreadParm2, CREATE_SUSPENDED, &dwPrintThreadID2)))
  {
    MessageBox(GetForegroundWindow(), TEXT("Error creating thread 2"), NULL,
               MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;

    nOpenDialogCount = 0 ;

    EnablePrintControls(hwndMainPrint, TRUE) ;

    return ;
  }

  ResumeThread(hPrintThread1) ;

  ResumeThread(hPrintThread2) ;

  return ;
}

LONG_PTR MyAtol | ( | LPTSTR | ,
 |  | BOOL | ,
 |  | LPBOOL |
 | ) |  |

Definition at line 460 of file CDTest.c.

{
  LPTSTR p ;
  LONG l ;
  LONG lMultiplier ;
  BOOL bDigit ;

  if (bHex)
    lMultiplier = 16 ;
  else
    lMultiplier = 10 ;

  p = szString ;
  l = 0 ;

  while (*p)      //while chars
  {
     bDigit = FALSE ;  //set to false for each char that we look at

     if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
     {
       bDigit = TRUE ;
       l+=(*p - (TCHAR) '0') ;
     }

     if (bHex)
     {
       if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
       {
         l+=(*p - (TCHAR) 'A' + 10) ;
         bDigit = TRUE ;
       }

       if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
       {
         l+=(*p - (TCHAR) 'a' + 10) ;
         bDigit = TRUE ;
       }

     }

     if (bDigit == FALSE)
     {
       *bSuccess = FALSE ;
       return 0 ;
     }

     p++ ;               //get next char

     if (*p)             //if there is going to be at least one more char
       l*=lMultiplier ;  //then multiply what we have by the multiplier...
  }

  *bSuccess = TRUE ;

  return l ;             //success! return the value.
}

UINT_PTR CALLBACK PrintHookProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 1054 of file Print.c.

{
  LPPRINTDLG pPr ;
  TCHAR szMsg[50] ;

  switch(msg)
  {
    case WM_INITDIALOG:

      pPr = (LPPRINTDLG) lParam ;

      if (pPr->lCustData != 0)
      {
        wsprintf(szMsg, TEXT("PRINTDLG->lCustData is: %ld"), pPr->lCustData) ;

        MessageBox(hwnd, szMsg, TEXT("lCustData Sent!"), MB_OK | MB_APPLMODAL) ;
      }

      SetWindowText(hwnd, TEXT("Print Hook Proc Dialog")) ;

      break ;

    /* use the WM_CTLCOLOR* messages to change the color of the Open
       dialog */

    case WM_CTLCOLORDLG:

        if (!hBrushDlg)
            hBrushDlg = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushDlg ;

        break ;

    case WM_CTLCOLORBTN:

        SetBkMode((HDC) wParam, TRANSPARENT) ;   //sets background color
                                                 //for push and check box
                                                 //buttons...

        if (!hBrushButton)
            hBrushButton = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushButton ;

        break ;

    case WM_CTLCOLORSTATIC:

        SetTextColor((HDC) wParam, RGB(0x00, 0xff, 0x00)) ;  //green
        SetBkMode((HDC) wParam, TRANSPARENT) ;               //transparent text

        if (!hBrushDlg)
            hBrushDlg = GetStockObject(LTGRAY_BRUSH) ;

        return (LRESULT) hBrushDlg ;

        break ;

    default:
      break ;
  }

  return 0 ;   //send msg to the common dialog code
}

DWORD PrintMultiProc1 ( LPDWORD pdw )

Definition at line 1147 of file Print.c.

{
  GetPrintDlg(hwndMainPrint, &pdThread1) ;

  DoPrintDlgStuff(hwndMainPrint, &pdThread1) ;

  PostMessage(hwndMainPrint, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;

  return 0L ;
}

DWORD PrintMultiProc2 ( LPDWORD pdw )

Definition at line 1183 of file Print.c.

{
  GetPrintDlg(hwndMainPrint, &pdThread2) ;

  DoPrintDlgStuff(hwndMainPrint, &pdThread2) ;

  PostMessage(hwndMainPrint, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;

  return 0L ;
}

INT_PTR APIENTRY PrintProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 169 of file Print.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:

        InitPrintStruct(hwnd, &pd) ;
        FillPrintDlg(hwnd, &pd) ;

        *(&pdThread1) = *(&pdThread2) = *(&pd) ;

        hwndMainPrint = hwnd ;

        nOpenDialogCount = 0 ;

        SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEP)) ;

        break ;

    case UMSG_DECREMENTDLGCOUNT: //user defined message that is send when
                                 //each thread created when multithreading ends
        nOpenDialogCount-- ;

        if (nOpenDialogCount == 0)               //once both multitheading dlgs
            EnablePrintControls(hwnd, TRUE) ;   //are done, enable the controls again

        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetPrintDlg(hwnd, &pd) ;
            DoPrintDlgStuff(hwnd, &pd) ;
            break ;

          case IDCANCEL:

            if (pd.hDC)
              ReleaseDC(hwnd, pd.hDC) ;

            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_RESETPRINT:
            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEP)) ;
            InitPrintStruct(hwnd, &pd) ;
            FillPrintDlg(hwnd, &pd) ;
            SendDlgItemMessage(hwnd, ID_PRESETUPP,   BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PREPRINTP,   BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_NULLSTRUCTP, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            break ;

          case ID_EDITDEVNAMES:
            DialogBox(hInst, MAKEINTRESOURCE(ID_DEVNAMESDIALOG),
                      hwnd, DevnamesProc) ;
            break ;

          case ID_EDITDEVMODE:
            DialogBox(hInst, MAKEINTRESOURCE(ID_DEVMODEDIALOG),
                      hwnd, DevmodeProc) ;
            break ;

          case ID_MULTITHREADPRINT:
            nOpenDialogCount = 2 ;
            EnablePrintControls(hwnd, FALSE) ;
            MultiThreadPrintDlg() ;
            break ;

          default: break ;
        }
    }

    default:

      /* If the help button is pressed in the PrintDlg() dialog box,
         it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                   TEXT("Print Help Button"), MB_OK | MB_APPLMODAL) ;
      break ;
  }

  return FALSE ;
}

Variable Documentation

DWORD dwPrintThreadID1

Definition at line 110 of file Print.c.

DWORD dwPrintThreadID2

Definition at line 111 of file Print.c.

DWORD dwPrintThreadParm1

Definition at line 112 of file Print.c.

DWORD dwPrintThreadParm2

Definition at line 113 of file Print.c.

HBRUSH hBrushButton

Definition at line 121 of file Print.c.

HBRUSH hBrushDlg

Definition at line 119 of file Print.c.

HBRUSH hBrushEdit

Definition at line 120 of file Print.c.

HANDLE hDevMode

Definition at line 92 of file Print.c.

HANDLE hDevNames

Definition at line 91 of file Print.c.

HGLOBAL hDialogPrint

Definition at line 89 of file Print.c.

HANDLE hPrintThread1

Definition at line 108 of file Print.c.

HANDLE hPrintThread2

Definition at line 109 of file Print.c.

HRSRC hResPrint

Definition at line 88 of file Print.c.

HWND hwndMainPrint

Definition at line 116 of file Print.c.

int nOpenDialogCount

Definition at line 117 of file Print.c.

PRINTDLG pd

Definition at line 90 of file Print.c.

PRINTDLG pdThread1

Definition at line 114 of file Print.c.

PRINTDLG pdThread2

Definition at line 115 of file Print.c.

TCHAR szDeviceOffset[100]

Definition at line 95 of file Print.c.

TCHAR szDriverOffset[100]

Definition at line 94 of file Print.c.

TCHAR szOutputOffset[100]

Definition at line 96 of file Print.c.

TCHAR szPrintTempName[40]

Definition at line 97 of file Print.c.

TCHAR szSetupTempName[40]

Definition at line 98 of file Print.c.

UINT_PTR uMode

Definition at line 69 of file CDTest.c.

Generated on Wed Nov 13 2024 16:53:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Print.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions

Print.h File Reference

Go to the source code of this file.

Defines

#define | ID_ADD1 610
#define | ID_ADD1P 614
#define | ID_ADD2 612
#define | ID_ADD2P 616
#define | ID_CLEAR1 611
#define | ID_CLEAR1P 615
#define | ID_CLEAR2P 613
#define | ID_COPIESP 129
#define | ID_CUSTDATAP 131
#define | ID_EDITDEVMODE 617
#define | ID_EDITDEVNAMES 618
#define | ID_ERRORP 621
#define | ID_FLAGSP 124
#define | ID_FROMPAGEP 125
#define | ID_HDCP 123
#define | ID_HDEVMODEP 608
#define | ID_HDEVNAMESP 609
#define | ID_HINSTANCEP 130
#define | ID_HPRINTTEMPP 135
#define | ID_HSETUPTEMPP 136
#define | ID_HWNDOWNERP 120
#define | ID_LPPRINTTEMPP 133
#define | ID_LPSETUPTEMPP 134
#define | ID_MAXPAGEP 128
#define | ID_MINPAGEP 127
#define | ID_MULTITHREADPRINT 629
#define | ID_NULLSTRUCTP 626
#define | ID_PREPRINTP 628
#define | ID_PRESETUPP 627
#define | ID_PRINTDIALOG 605
#define | ID_PRINTHOOKP 132
#define | ID_RESETPRINT 625
#define | ID_RETURNP 622
#define | ID_SETUPHOOKP 624
#define | ID_STRUCTSIZEP 119
#define | ID_SZDEVMODEP 606
#define | ID_SZDEVNAMESP 607
#define | ID_TOPAGEP 126

Functions

INT_PTR APIENTRY | DevmodeProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR APIENTRY | DevnamesProc (HWND, UINT, WPARAM, LPARAM)
void | DoPrintDialog (HWND)
INT_PTR APIENTRY | PrintProc (HWND, UINT, WPARAM, LPARAM)

Define Documentation

#define ID_ADD1 610

Definition at line 31 of file Print.h.

#define ID_ADD1P 614

Definition at line 35 of file Print.h.

#define ID_ADD2 612

Definition at line 33 of file Print.h.

#define ID_ADD2P 616

Definition at line 37 of file Print.h.

#define ID_CLEAR1 611

Definition at line 32 of file Print.h.

#define ID_CLEAR1P 615

Definition at line 36 of file Print.h.

#define ID_CLEAR2P 613

Definition at line 34 of file Print.h.

#define ID_COPIESP 129

Definition at line 22 of file Print.h.

#define ID_CUSTDATAP 131

Definition at line 24 of file Print.h.

#define ID_EDITDEVMODE 617

Definition at line 42 of file Print.h.

#define ID_EDITDEVNAMES 618

Definition at line 43 of file Print.h.

#define ID_ERRORP 621

Definition at line 40 of file Print.h.

#define ID_FLAGSP 124

Definition at line 17 of file Print.h.

#define ID_FROMPAGEP 125

Definition at line 18 of file Print.h.

#define ID_HDCP 123

Definition at line 16 of file Print.h.

#define ID_HDEVMODEP 608

Definition at line 38 of file Print.h.

#define ID_HDEVNAMESP 609

Definition at line 39 of file Print.h.

#define ID_HINSTANCEP 130

Definition at line 23 of file Print.h.

#define ID_HPRINTTEMPP 135

Definition at line 27 of file Print.h.

#define ID_HSETUPTEMPP 136

Definition at line 28 of file Print.h.

#define ID_HWNDOWNERP 120

Definition at line 15 of file Print.h.

#define ID_LPPRINTTEMPP 133

Definition at line 25 of file Print.h.

#define ID_LPSETUPTEMPP 134

Definition at line 26 of file Print.h.

#define ID_MAXPAGEP 128

Definition at line 21 of file Print.h.

#define ID_MINPAGEP 127

Definition at line 20 of file Print.h.

#define ID_MULTITHREADPRINT 629

Definition at line 53 of file Print.h.

#define ID_NULLSTRUCTP 626

Definition at line 50 of file Print.h.

#define ID_PREPRINTP 628

Definition at line 52 of file Print.h.

#define ID_PRESETUPP 627

Definition at line 51 of file Print.h.

#define ID_PRINTDIALOG 605

Definition at line 48 of file Print.h.

#define ID_PRINTHOOKP 132

Definition at line 44 of file Print.h.

#define ID_RESETPRINT 625

Definition at line 49 of file Print.h.

#define ID_RETURNP 622

Definition at line 41 of file Print.h.

#define ID_SETUPHOOKP 624

Definition at line 45 of file Print.h.

#define ID_STRUCTSIZEP 119

Definition at line 14 of file Print.h.

#define ID_SZDEVMODEP 606

Definition at line 29 of file Print.h.

#define ID_SZDEVNAMESP 607

Definition at line 30 of file Print.h.

#define ID_TOPAGEP 126

Definition at line 19 of file Print.h.

Function Documentation

INT_PTR APIENTRY DevmodeProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 328 of file Print.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:
        FillDevmodeDlg(hwnd, &pd) ;
        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetDevmodeDlg(hwnd, &pd) ;
            EndDialog(hwnd, TRUE) ;
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          default: break ;
        }
    }

    default: break ;
  }

  return FALSE ;
}

INT_PTR APIENTRY DevnamesProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 280 of file Print.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:
        FillDevnamesDlg(hwnd, &pd) ;
        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetDevnamesDlg(hwnd, &pd) ;
            EndDialog(hwnd, TRUE) ;
            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          default: break ;
        }
    }

    default: break ;
  }

  return FALSE ;
}

void DoPrintDialog ( HWND )

Definition at line 142 of file Print.c.

{

  DialogBox(hInst, MAKEINTRESOURCE(ID_PRINTDIALOG),
            hwnd, PrintProc) ;

}

INT_PTR APIENTRY PrintProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 169 of file Print.c.

{
  switch (msg)
  {
    case WM_INITDIALOG:

        InitPrintStruct(hwnd, &pd) ;
        FillPrintDlg(hwnd, &pd) ;

        *(&pdThread1) = *(&pdThread2) = *(&pd) ;

        hwndMainPrint = hwnd ;

        nOpenDialogCount = 0 ;

        SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEP)) ;

        break ;

    case UMSG_DECREMENTDLGCOUNT: //user defined message that is send when
                                 //each thread created when multithreading ends
        nOpenDialogCount-- ;

        if (nOpenDialogCount == 0)               //once both multitheading dlgs
            EnablePrintControls(hwnd, TRUE) ;   //are done, enable the controls again

        break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetPrintDlg(hwnd, &pd) ;
            DoPrintDlgStuff(hwnd, &pd) ;
            break ;

          case IDCANCEL:

            if (pd.hDC)
              ReleaseDC(hwnd, pd.hDC) ;

            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_RESETPRINT:
            SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEP)) ;
            InitPrintStruct(hwnd, &pd) ;
            FillPrintDlg(hwnd, &pd) ;
            SendDlgItemMessage(hwnd, ID_PRESETUPP,   BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_PREPRINTP,   BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            SendDlgItemMessage(hwnd, ID_NULLSTRUCTP, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
            break ;

          case ID_EDITDEVNAMES:
            DialogBox(hInst, MAKEINTRESOURCE(ID_DEVNAMESDIALOG),
                      hwnd, DevnamesProc) ;
            break ;

          case ID_EDITDEVMODE:
            DialogBox(hInst, MAKEINTRESOURCE(ID_DEVMODEDIALOG),
                      hwnd, DevmodeProc) ;
            break ;

          case ID_MULTITHREADPRINT:
            nOpenDialogCount = 2 ;
            EnablePrintControls(hwnd, FALSE) ;
            MultiThreadPrintDlg() ;
            break ;

          default: break ;
        }
    }

    default:

      /* If the help button is pressed in the PrintDlg() dialog box,
         it will send a message Registered with RegisterWindowMessage()
         to the parent window.  The message nHelpMessage was registered
         at application startup */

      if (msg == nHelpMessage)
        MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
                   TEXT("Print Help Button"), MB_OK | MB_APPLMODAL) ;
      break ;
  }

  return FALSE ;
}

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Replace.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Functions

Replace.c File Reference

#include <windows.h>
#include <commdlg.h>
#include "cdtest.h"
#include "replace.h"
#include "find.h"

Go to the source code of this file.

Functions

void DoReplaceDialog (HWND hwnd)

Function Documentation

void DoReplaceDialog ( HWND hwnd )

Definition at line 52 of file Replace.c.

{

  bDoFindDlg = FALSE ;

  /* in order for the keyboard to work, a hook has to be installed before
     the dialog is created.  See find.c for more detail on this. */

  hHook = SetWindowsHookEx(WH_MSGFILTER, lpfnFilterProc, hInst, GetCurrentThreadId()) ;

  if (!hHook) return ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_FINDDIALOG), hwnd, FindProc) ;

  UnhookWindowsHookEx(hHook) ;

}

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Replace.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Functions

Replace.h File Reference

Go to the source code of this file.

Functions

void DoReplaceDialog (HWND)

Function Documentation

void DoReplaceDialog ( HWND )

Definition at line 52 of file Replace.c.

{

  bDoFindDlg = FALSE ;

  /* in order for the keyboard to work, a hook has to be installed before
     the dialog is created.  See find.c for more detail on this. */

  hHook = SetWindowsHookEx(WH_MSGFILTER, lpfnFilterProc, hInst, GetCurrentThreadId()) ;

  if (!hHook) return ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_FINDDIALOG), hwnd, FindProc) ;

  UnhookWindowsHookEx(hHook) ;

}

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Save.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Functions

Save.c File Reference

#include <windows.h>
#include <commdlg.h>
#include "cdtest.h"
#include "save.h"
#include "open.h"

Go to the source code of this file.

Functions

void DoSaveDialog (HWND hwnd)

Function Documentation

void DoSaveDialog ( HWND hwnd )

Definition at line 56 of file Save.c.

{
  bDoOpenDlg = FALSE ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_OPENDIALOG), hwnd, OpenFunc) ;

}

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Save.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Functions

Save.h File Reference

Go to the source code of this file.

Functions

void DoSaveDialog (HWND)

Function Documentation

void DoSaveDialog ( HWND )

Definition at line 56 of file Save.c.

{
  bDoOpenDlg = FALSE ;

  DialogBox(hInst, MAKEINTRESOURCE(ID_OPENDIALOG), hwnd, OpenFunc) ;

}

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Title.c File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions | Variables

Title.c File Reference

#include <windows.h>
#include <commdlg.h>
#include "cdtest.h"
#include "title.h"

Go to the source code of this file.

Defines

#define | MAXTITLE 256

Functions

void | DoTitleDialog (HWND hwnd)
LONG_PTR | MyAtol (LPTSTR, BOOL, LPBOOL)
INT_PTR APIENTRY | TitleProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

Variables

short | nReturn
TCHAR | szPath [MAXTITLE]
TCHAR | szTitle [MAXTITLE]
UINT_PTR | uMode
WORD | wBufSize

Define Documentation

#define MAXTITLE 256

Definition at line 35 of file Title.c.

Function Documentation

void DoTitleDialog ( HWND hwnd )

Definition at line 57 of file Title.c.

{
  DialogBox(hInst, MAKEINTRESOURCE(ID_TITLEDIALOG), hwnd, TitleProc) ;

}

LONG_PTR MyAtol | ( | LPTSTR | ,
 |  | BOOL | ,
 |  | LPBOOL |
 | ) |  |

Definition at line 460 of file CDTest.c.

{
  LPTSTR p ;
  LONG l ;
  LONG lMultiplier ;
  BOOL bDigit ;

  if (bHex)
    lMultiplier = 16 ;
  else
    lMultiplier = 10 ;

  p = szString ;
  l = 0 ;

  while (*p)      //while chars
  {
     bDigit = FALSE ;  //set to false for each char that we look at

     if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
     {
       bDigit = TRUE ;
       l+=(*p - (TCHAR) '0') ;
     }

     if (bHex)
     {
       if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
       {
         l+=(*p - (TCHAR) 'A' + 10) ;
         bDigit = TRUE ;
       }

       if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
       {
         l+=(*p - (TCHAR) 'a' + 10) ;
         bDigit = TRUE ;
       }

     }

     if (bDigit == FALSE)
     {
       *bSuccess = FALSE ;
       return 0 ;
     }

     p++ ;               //get next char

     if (*p)             //if there is going to be at least one more char
       l*=lMultiplier ;  //then multiply what we have by the multiplier...
  }

  *bSuccess = TRUE ;

  return l ;             //success! return the value.
}

INT_PTR APIENTRY TitleProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 81 of file Title.c.

{
  TCHAR szNum[30] ;
  BOOL b ;

  switch (msg)
  {
    case WM_INITDIALOG:
      SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
      break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetDlgItemText(hwnd, ID_PATHTI, szPath, MAXTITLE) ;
            GetDlgItemText(hwnd, ID_BUFFSIZETI, szNum, 30) ;

            wBufSize =  (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

            if (wBufSize > 256)
            {
                wBufSize = 256 ;
                SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
            }

            nReturn = GetFileTitle(szPath, szTitle, wBufSize) ;
            wsprintf(szTemp, szShortFilter, nReturn) ;
            SetDlgItemText(hwnd, ID_RETURNTI, szTemp) ;
            SetDlgItemText(hwnd, ID_TITLETI, szTitle) ;

            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_RESETTITLE:
            szPath[0] = 0 ;
            szNum[0] = 0 ;
            szTemp[0] = 0 ;
            szTitle[0] = 0 ;
            SetDlgItemText(hwnd, ID_PATHTI, szPath) ;
            SetDlgItemText(hwnd, ID_RETURNTI, szTemp) ;
            SetDlgItemText(hwnd, ID_TITLETI, szTitle) ;
            SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
            break ;

          default: break ;
        }
    }

    default: break ;
  }

  return FALSE ;
}

Variable Documentation

short nReturn

Definition at line 39 of file Title.c.

TCHAR szPath[MAXTITLE]

Definition at line 38 of file Title.c.

TCHAR szTitle[MAXTITLE]

Definition at line 37 of file Title.c.

UINT_PTR uMode

Definition at line 69 of file CDTest.c.

WORD wBufSize

Definition at line 40 of file Title.c.

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Title.h File Reference

  • WinUI
  • CommDlg
  • CDTest
Defines | Functions

Title.h File Reference

Go to the source code of this file.

Defines

#define | ID_BUFFSIZETI 107
#define | ID_PATHTI 105
#define | ID_RESETTITLE 603
#define | ID_RETURNTI 108
#define | ID_TITLEDIALOG 601
#define | ID_TITLETI 106

Functions

void | DoTitleDialog (HWND)
INT_PTR APIENTRY | TitleProc (HWND, UINT, WPARAM, LPARAM)

Define Documentation

#define ID_BUFFSIZETI 107

Definition at line 12 of file Title.h.

#define ID_PATHTI 105

Definition at line 10 of file Title.h.

#define ID_RESETTITLE 603

Definition at line 16 of file Title.h.

#define ID_RETURNTI 108

Definition at line 13 of file Title.h.

#define ID_TITLEDIALOG 601

Definition at line 15 of file Title.h.

#define ID_TITLETI 106

Definition at line 11 of file Title.h.

Function Documentation

void DoTitleDialog ( HWND )

Definition at line 57 of file Title.c.

{
  DialogBox(hInst, MAKEINTRESOURCE(ID_TITLEDIALOG), hwnd, TitleProc) ;

}

INT_PTR APIENTRY TitleProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 81 of file Title.c.

{
  TCHAR szNum[30] ;
  BOOL b ;

  switch (msg)
  {
    case WM_INITDIALOG:
      SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
      break ;

    case WM_COMMAND:
    {
        switch (LOWORD(wParam))
        {
          case IDOK:
            GetDlgItemText(hwnd, ID_PATHTI, szPath, MAXTITLE) ;
            GetDlgItemText(hwnd, ID_BUFFSIZETI, szNum, 30) ;

            wBufSize =  (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;

            if (wBufSize > 256)
            {
                wBufSize = 256 ;
                SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
            }

            nReturn = GetFileTitle(szPath, szTitle, wBufSize) ;
            wsprintf(szTemp, szShortFilter, nReturn) ;
            SetDlgItemText(hwnd, ID_RETURNTI, szTemp) ;
            SetDlgItemText(hwnd, ID_TITLETI, szTitle) ;

            break ;

          case IDCANCEL:
            EndDialog(hwnd, FALSE) ;
            break ;

          case ID_RESETTITLE:
            szPath[0] = 0 ;
            szNum[0] = 0 ;
            szTemp[0] = 0 ;
            szTitle[0] = 0 ;
            SetDlgItemText(hwnd, ID_PATHTI, szPath) ;
            SetDlgItemText(hwnd, ID_RETURNTI, szTemp) ;
            SetDlgItemText(hwnd, ID_TITLETI, szTitle) ;
            SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
            break ;

          default: break ;
        }
    }

    default: break ;
  }

  return FALSE ;
}

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/ComDlg32/ComDlg32.C File Reference

  • WinUI
  • CommDlg
  • ComDlg32
Classes | Defines | Typedefs | Functions | Variables

ComDlg32.C File Reference

#include <windows.h>
#include <commdlg.h>
#include <dlgs.h>
#include <cderr.h>
#include "COMDLG32.h"

Go to the source code of this file.

Classes

struct | _MYDATA

Defines

#define | ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))

Typedefs

typedef struct _MYDATA * | LPMYDATA
typedef struct _MYDATA | MYDATA

Functions

LRESULT CALLBACK | About (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK | ComDlg32DlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL | InitApplication (HANDLE hInstance)
BOOL | InitInstance (HANDLE hInstance, int nCmdShow)
LRESULT CALLBACK | MainWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL | OpenTheFile (HWND hWnd, HWND hWndEdit)
void | ProcessCDError (DWORD dwErrorCode, HWND hWnd)
BOOL NEAR PASCAL | TestNotify (HWND hDlg, LPOFNOTIFY pofn)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

UINT | cdmsgFileOK = 0
UINT | cdmsgHelp = 0
UINT | cdmsgShareViolation = 0
HINSTANCE | g_hInst
MYDATA sMyData
const char | szCommdlgHelp [] = HELPMSGSTRING
const char | szmsgFILEOK [] = FILEOKSTRING
const char | szmsgSHAREVIOLATION [] = SHAREVISTRING

Define Documentation

#define ARRAYSIZE ( x ) (sizeof(x) / sizeof(x[0]))

Definition at line 39 of file ComDlg32.C.

Typedef Documentation

typedef struct _MYDATA* LPMYDATA
typedef struct _MYDATA MYDATA

Function Documentation

LRESULT CALLBACK About | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 492 of file ComDlg32.C.

{
    switch (message)
    {
        case WM_INITDIALOG:
            return (TRUE);

        case WM_COMMAND:
            if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
            {
                EndDialog(hDlg, TRUE);
                return TRUE;
            }
            break;
    }
    return FALSE;

}

LRESULT CALLBACK ComDlg32DlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 436 of file ComDlg32.C.

{

  switch (uMsg)
  {
    case WM_INITDIALOG:
      // Save off the long pointer to the OPENFILENAME structure.
      SetWindowLongPtr(hDlg, DWLP_USER, lParam);
      break;

    case WM_DESTROY:
      {
      LPOPENFILENAME lpOFN = (LPOPENFILENAME)GetWindowLongPtr(hDlg, DWLP_USER);
      LPMYDATA psMyData = (LPMYDATA)lpOFN->lCustData;

      GetDlgItemText(hDlg, IDE_PATH, psMyData->szTest1, sizeof(psMyData->szTest1));
      GetDlgItemText(hDlg, IDE_SELECTED, psMyData->szTest2, sizeof(psMyData->szTest2));
      }
      break;

    case WM_NOTIFY:
      TestNotify(hDlg, (LPOFNOTIFY)lParam);

    default:
      if (uMsg == cdmsgFileOK)
      {
        SetDlgItemText(hDlg, IDE_SELECTED, ((LPOPENFILENAME)lParam)->lpstrFile);
        if (MessageBox(hDlg, "Got the OK button message.\n\nShould I open it?", "ComDlg32 Test", MB_YESNO)
          == IDNO)
        {
          SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1L);
        }
        break;
      }
      else if (uMsg == cdmsgShareViolation)
      {
        SetDlgItemText(hDlg, IDE_SELECTED, (LPSTR)lParam);
        MessageBox(hDlg, "Got a sharing violation message.", "ComDlg32 Test", MB_OK);
        break;
      }
      return FALSE;
  }
  return TRUE;
}

BOOL InitApplication ( HANDLE hInstance )

Definition at line 97 of file ComDlg32.C.

{
    WNDCLASS  wc;

    // Register the window class for my window.                                                           */
    wc.style = 0;                       // Class style.
    wc.lpfnWndProc = (WNDPROC)MainWndProc; // Window procedure for this class.
    wc.cbClsExtra = 0;                  // No per-class extra data.
    wc.cbWndExtra = 0;                  // No per-window extra data.
    wc.hInstance = hInstance;           // Application that owns the class.
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName =  "Comdlg32Menu";   // Name of menu resource in .RC file.
    wc.lpszClassName = "Comdlg32WClass"; // Name used in call to CreateWindow.

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 126 of file ComDlg32.C.

{
    HWND            hWnd;

  // Save off the handle to the current instance.
    g_hInst = hInstance;

    // Create a main window for this application instance.
    hWnd = CreateWindow(
        "Comdlg32WClass",
        "Common Dialog Sample Application",
        WS_OVERLAPPEDWINDOW,            // Window style.
        CW_USEDEFAULT,                  // Default horizontal position.
        CW_USEDEFAULT,                  // Default vertical position.
        CW_USEDEFAULT,                  // Default width.
        CW_USEDEFAULT,                  // Default height.
        NULL,                           // Overlapped windows have no parent.
        NULL,                           // Use the window class menu.
        g_hInst,                        // This instance owns this window.
        NULL                            // Pointer not needed.
    );

    // If window could not be created, return "failure".
    if (!hWnd)
        return (FALSE);

    // Register the window messages to receive.
    cdmsgShareViolation = RegisterWindowMessage(szmsgSHAREVIOLATION);
    cdmsgFileOK         = RegisterWindowMessage(szmsgFILEOK);
    cdmsgHelp           = RegisterWindowMessage(szCommdlgHelp);

    // Make the window visible; update its client area; and return "success".
    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);
    return (TRUE);

}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 178 of file ComDlg32.C.

{
    static HWND hwndEdit;
    CHAR lpszHello[] = "Choose File Open from the Options menu for a demo.";

    switch (message) {

        case WM_CREATE:
      // Create an MLE for the file contents.
      hwndEdit = CreateWindow(
                "EDIT",
        NULL,
                WS_CHILD | WS_VISIBLE | WS_VSCROLL |
                    ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL,
                0, 0, 0, 0,
                hWnd,
                (HMENU) ID_EDITCHILD,
                (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
                NULL);

            // Update the MLE.
            SendMessage(hwndEdit, WM_SETTEXT, 0, (LPARAM) lpszHello);
            return 0;

        case WM_SIZE:
            // Make the edit control the size of the window's client area.
            MoveWindow(hwndEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
            return 0;

        case WM_COMMAND:           // message: command from application menu
            switch( LOWORD( wParam ))
            {
                case IDM_FILEOPEN:
          // Call the FileOpen common dialog to open the file.
                    OpenTheFile( hWnd, hwndEdit );
                    break;

                case IDM_EXIT:
                    PostQuitMessage(0);
                    break;

                case IDM_ABOUT:
                    DialogBox(g_hInst,
                        MAKEINTRESOURCE(IDD_ABOUT),
                        hWnd,
                        (DLGPROC)About);
                    break;

                default:
                    return (DefWindowProc(hWnd, message, wParam, lParam));

            }
            break;

        case WM_DESTROY:                  // message: window being destroyed
            PostQuitMessage(0);
            break;

        default:
            return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return (0);
}

BOOL OpenTheFile | ( | HWND | hWnd,
 |  | HWND | hWndEdit
 | ) |  |

Definition at line 259 of file ComDlg32.C.

{
    HANDLE hFile;
    DWORD dwBytesRead;
  DWORD dwFileSize;
  OPENFILENAME OpenFileName;
  TCHAR         szFile[MAX_PATH]      = "\0";
  char *lpBufPtr;

    strncpy( szFile, "", ARRAYSIZE(szFile));

  // Fill in the OPENFILENAME structure to support a template and hook.
  OpenFileName.lStructSize       = sizeof(OPENFILENAME);
    OpenFileName.hwndOwner         = hWnd;
    OpenFileName.hInstance         = g_hInst;
    OpenFileName.lpstrFilter       = NULL;
    OpenFileName.lpstrCustomFilter = NULL;
    OpenFileName.nMaxCustFilter    = 0;
    OpenFileName.nFilterIndex      = 0;
    OpenFileName.lpstrFile         = szFile;
    OpenFileName.nMaxFile          = sizeof(szFile);
    OpenFileName.lpstrFileTitle    = NULL;
    OpenFileName.nMaxFileTitle     = 0;
    OpenFileName.lpstrInitialDir   = NULL;
    OpenFileName.lpstrTitle        = "Open a File";
    OpenFileName.nFileOffset       = 0;
    OpenFileName.nFileExtension    = 0;
    OpenFileName.lpstrDefExt       = NULL;
    OpenFileName.lCustData         = (LPARAM)&sMyData;
  OpenFileName.lpfnHook        = ComDlg32DlgProc;
  OpenFileName.lpTemplateName    = MAKEINTRESOURCE(IDD_COMDLG32);
    OpenFileName.Flags             = OFN_SHOWHELP | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_ENABLETEMPLATE;

  // Call the common dialog function.
    if (GetOpenFileName(&OpenFileName))
    {
    // Open the file.
    if ((hFile = CreateFile((LPCTSTR)OpenFileName.lpstrFile,
      GENERIC_READ,
      FILE_SHARE_READ,
      NULL,
      OPEN_EXISTING,
      FILE_ATTRIBUTE_NORMAL,
      (HANDLE)NULL)) == (HANDLE)-1)
    {
        MessageBox( hWnd, "File open failed.", NULL, MB_OK );
        return FALSE;
    }

    // Get the size of the file.
    dwFileSize = GetFileSize(hFile, NULL);
    if (dwFileSize == 0xFFFFFFFF)
    {
        MessageBox( NULL, "GetFileSize failed!", NULL, MB_OK);
        return FALSE;
    }

    // Allocate a buffer for the file to be read into.
    lpBufPtr = (char *)GlobalAlloc( GMEM_FIXED, dwFileSize );
    if (lpBufPtr == NULL)
    {
        MessageBox( NULL, "GlobalAlloc failed!", NULL, MB_OK);
        CloseHandle( hFile );
        return FALSE;
    }

    // Read it's contents into a buffer.
    ReadFile(hFile,(LPVOID)lpBufPtr, dwFileSize, &dwBytesRead, NULL);

    if (dwBytesRead == 0)
    {
        MessageBox( hWnd, "Zero bytes read.", NULL, MB_OK );
          return FALSE;
    }

        // Update the MLE with the file contents.
        SendMessage(hWndEdit, WM_SETTEXT, 0, (LPARAM) lpBufPtr);

    // Close the file.
    CloseHandle(hFile);

    return TRUE;
    }
    else
    {
    ProcessCDError(CommDlgExtendedError(), hWnd );
    return FALSE;
    }

}

void ProcessCDError | ( | DWORD | dwErrorCode,
 |  | HWND | hWnd
 | ) |  |

Definition at line 524 of file ComDlg32.C.

{
   WORD  wStringID;
   TCHAR  buf[MAX_PATH];

   switch(dwErrorCode)
      {
   case CDERR_DIALOGFAILURE:   wStringID=IDS_DIALOGFAILURE;   break;
   case CDERR_STRUCTSIZE:      wStringID=IDS_STRUCTSIZE;      break;
   case CDERR_INITIALIZATION:  wStringID=IDS_INITIALIZATION;  break;
   case CDERR_NOTEMPLATE:      wStringID=IDS_NOTEMPLATE;      break;
   case CDERR_NOHINSTANCE:     wStringID=IDS_NOHINSTANCE;     break;
   case CDERR_LOADSTRFAILURE:  wStringID=IDS_LOADSTRFAILURE;  break;
   case CDERR_FINDRESFAILURE:  wStringID=IDS_FINDRESFAILURE;  break;
   case CDERR_LOADRESFAILURE:  wStringID=IDS_LOADRESFAILURE;  break;
   case CDERR_LOCKRESFAILURE:  wStringID=IDS_LOCKRESFAILURE;  break;
   case CDERR_MEMALLOCFAILURE: wStringID=IDS_MEMALLOCFAILURE; break;
   case CDERR_MEMLOCKFAILURE:  wStringID=IDS_MEMLOCKFAILURE;  break;
   case CDERR_NOHOOK:          wStringID=IDS_NOHOOK;          break;
   case PDERR_SETUPFAILURE:    wStringID=IDS_SETUPFAILURE;    break;
   case PDERR_PARSEFAILURE:    wStringID=IDS_PARSEFAILURE;    break;
   case PDERR_RETDEFFAILURE:   wStringID=IDS_RETDEFFAILURE;   break;
   case PDERR_LOADDRVFAILURE:  wStringID=IDS_LOADDRVFAILURE;  break;
   case PDERR_GETDEVMODEFAIL:  wStringID=IDS_GETDEVMODEFAIL;  break;
   case PDERR_INITFAILURE:     wStringID=IDS_INITFAILURE;     break;
   case PDERR_NODEVICES:       wStringID=IDS_NODEVICES;       break;
   case PDERR_NODEFAULTPRN:    wStringID=IDS_NODEFAULTPRN;    break;
   case PDERR_DNDMMISMATCH:    wStringID=IDS_DNDMMISMATCH;    break;
   case PDERR_CREATEICFAILURE: wStringID=IDS_CREATEICFAILURE; break;
   case PDERR_PRINTERNOTFOUND: wStringID=IDS_PRINTERNOTFOUND; break;
   case CFERR_NOFONTS:         wStringID=IDS_NOFONTS;         break;
   case FNERR_SUBCLASSFAILURE: wStringID=IDS_SUBCLASSFAILURE; break;
   case FNERR_INVALIDFILENAME: wStringID=IDS_INVALIDFILENAME; break;
   case FNERR_BUFFERTOOSMALL:  wStringID=IDS_BUFFERTOOSMALL;  break;

   case 0:   //User may have hit CANCEL or we got a *very* random error
      return;

   default:
      wStringID=IDS_UNKNOWNERROR;
      }

   LoadString(NULL, wStringID, buf, sizeof(buf));
   MessageBox(hWnd, buf, NULL, MB_OK);
   return;
}

BOOL NEAR PASCAL TestNotify | ( | HWND | hDlg,
 |  | LPOFNOTIFY | pofn
 | ) |  |

Definition at line 358 of file ComDlg32.C.

{
  switch (pofn->hdr.code)
  {
    // The selection has changed.
    case CDN_SELCHANGE:
    {
      char szFile[MAX_PATH];

      // Get the file specification from the common dialog.
      if (CommDlg_OpenSave_GetSpec(GetParent(hDlg),
        szFile, sizeof(szFile)) <= sizeof(szFile))
      {
        // Set the dialog item to reflect this.
        SetDlgItemText(hDlg, IDE_SELECTED, szFile);
      }

      // Get the path of the selected file.
      if (CommDlg_OpenSave_GetFilePath(GetParent(hDlg),
        szFile, sizeof(szFile)) <= sizeof(szFile))
      {
        // Display this path in the appropriate box.
        SetDlgItemText(hDlg, IDE_PATH, szFile);
      }
    }
    break;

    // A new folder has been opened.
    case CDN_FOLDERCHANGE:
    {
      char szFile[MAX_PATH];

      if (CommDlg_OpenSave_GetFolderPath(GetParent(hDlg),
        szFile, sizeof(szFile)) <= sizeof(szFile))
      {
        // Display this new path in the appropriate box.
        SetDlgItemText(hDlg, IDE_SELECTED, szFile);
      }
    }
    break;

    // The "Help" pushbutton has been pressed.
    case CDN_HELP:
      MessageBox(hDlg, "Got the Help button notify.", "ComDlg32 Test", MB_OK);
      break;

    // The 'OK' pushbutton has been pressed.
    case CDN_FILEOK:
      // Update the appropriate box.
      SetDlgItemText(hDlg,IDE_SELECTED, pofn->lpOFN->lpstrFile);
      SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1L);
      break;

    // Received a sharing violation.
    case CDN_SHAREVIOLATION:
      // Update the appropriate box.
      SetDlgItemText(hDlg, IDE_SELECTED, pofn->pszFile);
      MessageBox(hDlg, "Got a sharing violation notify.", "ComDlg32 Test", MB_OK);
      break;
  }

  return(TRUE);
}

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 64 of file ComDlg32.C.

{
    MSG msg;

    if (!InitApplication(hInstance))
            return (FALSE);

    // Create the main window.
    if (!InitInstance(hInstance, nCmdShow))
        return (FALSE);

    // Acquire and dispatch messages until a WM_QUIT message is received.
    while (GetMessage(&msg,NULL,0,0))
        {
            TranslateMessage(&msg);    // Translates virtual key codes.
            DispatchMessage(&msg);     // Dispatches message to window.
        }
    return (int)(msg.wParam);           // Returns the value from PostQuitMessage.

}

Variable Documentation

UINT cdmsgFileOK = 0

Definition at line 42 of file ComDlg32.C.

UINT cdmsgHelp = 0

Definition at line 43 of file ComDlg32.C.

UINT cdmsgShareViolation = 0

Definition at line 41 of file ComDlg32.C.

HINSTANCE g_hInst

Definition at line 51 of file ComDlg32.C.

MYDATA sMyData

Definition at line 52 of file ComDlg32.C.

const char szCommdlgHelp[] = HELPMSGSTRING

Definition at line 37 of file ComDlg32.C.

const char szmsgFILEOK[] = FILEOKSTRING

Definition at line 36 of file ComDlg32.C.

const char szmsgSHAREVIOLATION[] = SHAREVISTRING

Definition at line 35 of file ComDlg32.C.

Generated on Wed Nov 13 2024 16:55:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/ComDlg32/ComDlg32.h File Reference

  • WinUI
  • CommDlg
  • ComDlg32
Defines | Functions

ComDlg32.h File Reference

#include <windows.h>
#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Defines

#define | ID_EDITCHILD 500
#define | IDS_BUFFERTOOSMALL 27
#define | IDS_CREATEICFAILURE 22
#define | IDS_DIALOGFAILURE 1
#define | IDS_DNDMMISMATCH 21
#define | IDS_FILTERSTRING 28
#define | IDS_FINDRESFAILURE 7
#define | IDS_GETDEVMODEFAIL 17
#define | IDS_INITFAILURE 18
#define | IDS_INITIALIZATION 3
#define | IDS_INVALIDFILENAME 26
#define | IDS_LOADDRVFAILURE 16
#define | IDS_LOADRESFAILURE 8
#define | IDS_LOADSTRFAILURE 6
#define | IDS_LOCKRESFAILURE 9
#define | IDS_MEMALLOCFAILURE 10
#define | IDS_MEMLOCKFAILURE 11
#define | IDS_NODEFAULTPRN 20
#define | IDS_NODEVICES 19
#define | IDS_NOFONTS 24
#define | IDS_NOHINSTANCE 5
#define | IDS_NOHOOK 12
#define | IDS_NOTEMPLATE 4
#define | IDS_PARSEFAILURE 14
#define | IDS_PRINTERNOTFOUND 23
#define | IDS_RETDEFFAILURE 15
#define | IDS_SETUPFAILURE 13
#define | IDS_STRUCTSIZE 2
#define | IDS_SUBCLASSFAILURE 25
#define | IDS_UNKNOWNERROR 29
#define | MAX_PATH 260

Functions

LRESULT CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | ComDlg32DlgProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | EnterNew (HWND, UINT, WPARAM, LPARAM)
BOOL InitApplication (HANDLE)
BOOL | InitInstance (HANDLE, int)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
BOOL | OpenTheFile (HWND, HWND)
void | ProcessCDError (DWORD, HWND)
BOOL NEAR PASCAL | TestNotify (HWND, LPOFNOTIFY)

Define Documentation

#define ID_EDITCHILD 500

Definition at line 17 of file ComDlg32.h.

#define IDS_BUFFERTOOSMALL 27

Definition at line 47 of file ComDlg32.h.

#define IDS_CREATEICFAILURE 22

Definition at line 42 of file ComDlg32.h.

#define IDS_DIALOGFAILURE 1

Definition at line 21 of file ComDlg32.h.

#define IDS_DNDMMISMATCH 21

Definition at line 41 of file ComDlg32.h.

#define IDS_FILTERSTRING 28

Definition at line 48 of file ComDlg32.h.

#define IDS_FINDRESFAILURE 7

Definition at line 27 of file ComDlg32.h.

#define IDS_GETDEVMODEFAIL 17

Definition at line 37 of file ComDlg32.h.

#define IDS_INITFAILURE 18

Definition at line 38 of file ComDlg32.h.

#define IDS_INITIALIZATION 3

Definition at line 23 of file ComDlg32.h.

#define IDS_INVALIDFILENAME 26

Definition at line 46 of file ComDlg32.h.

#define IDS_LOADDRVFAILURE 16

Definition at line 36 of file ComDlg32.h.

#define IDS_LOADRESFAILURE 8

Definition at line 28 of file ComDlg32.h.

#define IDS_LOADSTRFAILURE 6

Definition at line 26 of file ComDlg32.h.

#define IDS_LOCKRESFAILURE 9

Definition at line 29 of file ComDlg32.h.

#define IDS_MEMALLOCFAILURE 10

Definition at line 30 of file ComDlg32.h.

#define IDS_MEMLOCKFAILURE 11

Definition at line 31 of file ComDlg32.h.

#define IDS_NODEFAULTPRN 20

Definition at line 40 of file ComDlg32.h.

#define IDS_NODEVICES 19

Definition at line 39 of file ComDlg32.h.

#define IDS_NOFONTS 24

Definition at line 44 of file ComDlg32.h.

#define IDS_NOHINSTANCE 5

Definition at line 25 of file ComDlg32.h.

#define IDS_NOHOOK 12

Definition at line 32 of file ComDlg32.h.

#define IDS_NOTEMPLATE 4

Definition at line 24 of file ComDlg32.h.

#define IDS_PARSEFAILURE 14

Definition at line 34 of file ComDlg32.h.

#define IDS_PRINTERNOTFOUND 23

Definition at line 43 of file ComDlg32.h.

#define IDS_RETDEFFAILURE 15

Definition at line 35 of file ComDlg32.h.

#define IDS_SETUPFAILURE 13

Definition at line 33 of file ComDlg32.h.

#define IDS_STRUCTSIZE 2

Definition at line 22 of file ComDlg32.h.

#define IDS_SUBCLASSFAILURE 25

Definition at line 45 of file ComDlg32.h.

#define IDS_UNKNOWNERROR 29

Definition at line 49 of file ComDlg32.h.

#define MAX_PATH 260

Definition at line 53 of file ComDlg32.h.

Function Documentation

LRESULT CALLBACK About | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 445 of file Generic.C.

{
   static  HFONT hfontDlg;    // Font for dialog text
   static   HFONT hFinePrint; // Font for 'fine print' in dialog
   DWORD   dwVerInfoSize;     // Size of version information block
   LPSTR   lpVersion;         // String pointer to 'version' text
   DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
   UINT    uVersionLen;
   WORD    wRootLen;
   BOOL    bRetCode;
   int     i;
   char    szFullPath[BUFFSIZE];
   char    szResult[BUFFSIZE];
   char    szGetName[BUFFSIZE];
   DWORD dwVersion;
   char  szVersion[40];
   DWORD dwResult;
   HRESULT hRes;

   switch (message) {
        case WM_INITDIALOG:
         ShowWindow (hDlg, SW_HIDE);

         if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                  VARIABLE_PITCH | FF_DONTCARE, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                    VARIABLE_PITCH | FF_DONTCARE, "");
         }
         else
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                  VARIABLE_PITCH | FF_SWISS, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                    VARIABLE_PITCH | FF_SWISS, "");
         }

         CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
         GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));

         // Now lets dive in and pull out the version information:
         dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
         if (dwVerInfoSize) {
            LPSTR   lpstrVffInfo;
            HANDLE  hMem;
            hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
            lpstrVffInfo  = GlobalLock(hMem);
            GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
            // The below 'hex' value looks a little confusing, but
            // essentially what it is, is the hexidecimal representation
            // of a couple different values that represent the language
            // and character set that we are wanting string values for.
            // 040904E4 is a very common one, because it means:
            //   US English, Windows MultiLingual characterset
            // Or to pull it all apart:
            // 04------        = SUBLANG_ENGLISH_USA
            // --09----        = LANG_ENGLISH
            // --11----        = LANG_JAPANESE
            // ----04E4 = 1252 = Codepage for Windows:Multilingual

            // Use safe string handling
            szGetName[sizeof(szGetName) - 1] = '\0';
            lstrcpyn(szGetName, GetStringRes(IDS_VER_INFO_LANG), sizeof(szGetName) - 1);
            if (szGetName[sizeof(szGetName) - 1] != '\0') {
                return FALSE; // Buffer overflow error
            }

            wRootLen = (WORD) lstrlen(szGetName); // Save this position

            // Set the title of the dialog using safe string handling
            hRes = StringCchCatN(szGetName, sizeof(szGetName), "ProductName", sizeof("ProductName"));
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }

            bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
               (LPSTR)szGetName,
               (LPVOID)&lpVersion,
               (UINT *)&uVersionLen);

            // Notice order of version and string...
            if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), " ‚Ìƒo[ƒWƒ‡ƒ“î•ñ", sizeof(" ‚Ìƒo[ƒWƒ‡ƒ“î•ñ"));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }
            else
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), "About ", sizeof("About "));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }

            // -----------------------------------------------------

            SetWindowText (hDlg, szResult);

            // Walk through the dialog items that we want to replace:
            for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++) {
               GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
               szGetName[wRootLen] = (char)0;
               // Use safe sting handling
               hRes = StringCchCatN(szGetName, sizeof(szGetName), szResult, sizeof(szResult));
               if (FAILED(hRes)) {
                   return FALSE; // Buffer overflow error
               }
               uVersionLen   = 0;
               lpVersion     = NULL;
               bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
                  (LPSTR)szGetName,
                  (LPVOID)&lpVersion,
                  (UINT *)&uVersionLen);

               if ( bRetCode && uVersionLen && lpVersion) {
                   // Replace dialog item text with version info
                   // Use safe string handling
                   hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                   if (FAILED(hRes)) {
                       return FALSE; // Buffer overflow error
                   }
                   SetDlgItemText(hDlg, i, szResult);
               }
               else
               {
                  dwResult = GetLastError();

                  // Use safe string handling
                  hRes = StringCchPrintf(szResult, sizeof(szResult), GetStringRes(IDS_VERSION_ERROR), dwResult);
                  if (FAILED(hRes)) {
                      return FALSE; // Buffer overflow error
                  }

                  SetDlgItemText (hDlg, i, szResult);
               }
               SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
                  (ULONG_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
                  TRUE);
            } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)

            GlobalUnlock(hMem);
            GlobalFree(hMem);

         } else {
            // No version information available.
         } // if (dwVerInfoSize)

            SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
            (WPARAM)hfontDlg,(LPARAM)TRUE);

         // We are  using GetVersion rather then GetVersionEx
         // because earlier versions of Windows NT and Win32s
         // didn't include GetVersionEx:
         dwVersion = GetVersion();

         if (dwVersion < 0x80000000) {
            // Windows NT
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows NT %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion)) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else if (LOBYTE(LOWORD(dwVersion))<4) {
            // Win32s
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Win32s %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion) & ~0x8000) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else {
            // Windows 95
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows 95 %u.%u",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         }

          SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
         ShowWindow (hDlg, SW_SHOW);
         return (TRUE);

      case WM_COMMAND:
         if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
            EndDialog(hDlg, TRUE);
            DeleteObject (hfontDlg);
            DeleteObject (hFinePrint);
            return (TRUE);
         }
         break;
   }

    return FALSE;
}

LRESULT CALLBACK ComDlg32DlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 436 of file ComDlg32.C.

{

  switch (uMsg)
  {
    case WM_INITDIALOG:
      // Save off the long pointer to the OPENFILENAME structure.
      SetWindowLongPtr(hDlg, DWLP_USER, lParam);
      break;

    case WM_DESTROY:
      {
      LPOPENFILENAME lpOFN = (LPOPENFILENAME)GetWindowLongPtr(hDlg, DWLP_USER);
      LPMYDATA psMyData = (LPMYDATA)lpOFN->lCustData;

      GetDlgItemText(hDlg, IDE_PATH, psMyData->szTest1, sizeof(psMyData->szTest1));
      GetDlgItemText(hDlg, IDE_SELECTED, psMyData->szTest2, sizeof(psMyData->szTest2));
      }
      break;

    case WM_NOTIFY:
      TestNotify(hDlg, (LPOFNOTIFY)lParam);

    default:
      if (uMsg == cdmsgFileOK)
      {
        SetDlgItemText(hDlg, IDE_SELECTED, ((LPOPENFILENAME)lParam)->lpstrFile);
        if (MessageBox(hDlg, "Got the OK button message.\n\nShould I open it?", "ComDlg32 Test", MB_YESNO)
          == IDNO)
        {
          SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1L);
        }
        break;
      }
      else if (uMsg == cdmsgShareViolation)
      {
        SetDlgItemText(hDlg, IDE_SELECTED, (LPSTR)lParam);
        MessageBox(hDlg, "Got a sharing violation message.", "ComDlg32 Test", MB_OK);
        break;
      }
      return FALSE;
  }
  return TRUE;
}

LRESULT CALLBACK EnterNew | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |
BOOL InitApplication ( HANDLE )

Definition at line 123 of file ClipText.c.

{
    WNDCLASS  wc = {0};

    wc.lpfnWndProc = (WNDPROC) MainWndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName =  TEXT("CliptextMenu");
    wc.lpszClassName = TEXT("CliptextWClass");

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | ,
 |  | int |
 | ) |  |

Definition at line 126 of file ComDlg32.C.

{
    HWND            hWnd;

  // Save off the handle to the current instance.
    g_hInst = hInstance;

    // Create a main window for this application instance.
    hWnd = CreateWindow(
        "Comdlg32WClass",
        "Common Dialog Sample Application",
        WS_OVERLAPPEDWINDOW,            // Window style.
        CW_USEDEFAULT,                  // Default horizontal position.
        CW_USEDEFAULT,                  // Default vertical position.
        CW_USEDEFAULT,                  // Default width.
        CW_USEDEFAULT,                  // Default height.
        NULL,                           // Overlapped windows have no parent.
        NULL,                           // Use the window class menu.
        g_hInst,                        // This instance owns this window.
        NULL                            // Pointer not needed.
    );

    // If window could not be created, return "failure".
    if (!hWnd)
        return (FALSE);

    // Register the window messages to receive.
    cdmsgShareViolation = RegisterWindowMessage(szmsgSHAREVIOLATION);
    cdmsgFileOK         = RegisterWindowMessage(szmsgFILEOK);
    cdmsgHelp           = RegisterWindowMessage(szCommdlgHelp);

    // Make the window visible; update its client area; and return "success".
    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);
    return (TRUE);

}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

BOOL OpenTheFile | ( | HWND | ,
 |  | HWND |
 | ) |  |

Definition at line 259 of file ComDlg32.C.

{
    HANDLE hFile;
    DWORD dwBytesRead;
  DWORD dwFileSize;
  OPENFILENAME OpenFileName;
  TCHAR         szFile[MAX_PATH]      = "\0";
  char *lpBufPtr;

    strncpy( szFile, "", ARRAYSIZE(szFile));

  // Fill in the OPENFILENAME structure to support a template and hook.
  OpenFileName.lStructSize       = sizeof(OPENFILENAME);
    OpenFileName.hwndOwner         = hWnd;
    OpenFileName.hInstance         = g_hInst;
    OpenFileName.lpstrFilter       = NULL;
    OpenFileName.lpstrCustomFilter = NULL;
    OpenFileName.nMaxCustFilter    = 0;
    OpenFileName.nFilterIndex      = 0;
    OpenFileName.lpstrFile         = szFile;
    OpenFileName.nMaxFile          = sizeof(szFile);
    OpenFileName.lpstrFileTitle    = NULL;
    OpenFileName.nMaxFileTitle     = 0;
    OpenFileName.lpstrInitialDir   = NULL;
    OpenFileName.lpstrTitle        = "Open a File";
    OpenFileName.nFileOffset       = 0;
    OpenFileName.nFileExtension    = 0;
    OpenFileName.lpstrDefExt       = NULL;
    OpenFileName.lCustData         = (LPARAM)&sMyData;
  OpenFileName.lpfnHook        = ComDlg32DlgProc;
  OpenFileName.lpTemplateName    = MAKEINTRESOURCE(IDD_COMDLG32);
    OpenFileName.Flags             = OFN_SHOWHELP | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_ENABLETEMPLATE;

  // Call the common dialog function.
    if (GetOpenFileName(&OpenFileName))
    {
    // Open the file.
    if ((hFile = CreateFile((LPCTSTR)OpenFileName.lpstrFile,
      GENERIC_READ,
      FILE_SHARE_READ,
      NULL,
      OPEN_EXISTING,
      FILE_ATTRIBUTE_NORMAL,
      (HANDLE)NULL)) == (HANDLE)-1)
    {
        MessageBox( hWnd, "File open failed.", NULL, MB_OK );
        return FALSE;
    }

    // Get the size of the file.
    dwFileSize = GetFileSize(hFile, NULL);
    if (dwFileSize == 0xFFFFFFFF)
    {
        MessageBox( NULL, "GetFileSize failed!", NULL, MB_OK);
        return FALSE;
    }

    // Allocate a buffer for the file to be read into.
    lpBufPtr = (char *)GlobalAlloc( GMEM_FIXED, dwFileSize );
    if (lpBufPtr == NULL)
    {
        MessageBox( NULL, "GlobalAlloc failed!", NULL, MB_OK);
        CloseHandle( hFile );
        return FALSE;
    }

    // Read it's contents into a buffer.
    ReadFile(hFile,(LPVOID)lpBufPtr, dwFileSize, &dwBytesRead, NULL);

    if (dwBytesRead == 0)
    {
        MessageBox( hWnd, "Zero bytes read.", NULL, MB_OK );
          return FALSE;
    }

        // Update the MLE with the file contents.
        SendMessage(hWndEdit, WM_SETTEXT, 0, (LPARAM) lpBufPtr);

    // Close the file.
    CloseHandle(hFile);

    return TRUE;
    }
    else
    {
    ProcessCDError(CommDlgExtendedError(), hWnd );
    return FALSE;
    }

}

void ProcessCDError | ( | DWORD | ,
 |  | HWND |
 | ) |  |

Definition at line 524 of file ComDlg32.C.

{
   WORD  wStringID;
   TCHAR  buf[MAX_PATH];

   switch(dwErrorCode)
      {
   case CDERR_DIALOGFAILURE:   wStringID=IDS_DIALOGFAILURE;   break;
   case CDERR_STRUCTSIZE:      wStringID=IDS_STRUCTSIZE;      break;
   case CDERR_INITIALIZATION:  wStringID=IDS_INITIALIZATION;  break;
   case CDERR_NOTEMPLATE:      wStringID=IDS_NOTEMPLATE;      break;
   case CDERR_NOHINSTANCE:     wStringID=IDS_NOHINSTANCE;     break;
   case CDERR_LOADSTRFAILURE:  wStringID=IDS_LOADSTRFAILURE;  break;
   case CDERR_FINDRESFAILURE:  wStringID=IDS_FINDRESFAILURE;  break;
   case CDERR_LOADRESFAILURE:  wStringID=IDS_LOADRESFAILURE;  break;
   case CDERR_LOCKRESFAILURE:  wStringID=IDS_LOCKRESFAILURE;  break;
   case CDERR_MEMALLOCFAILURE: wStringID=IDS_MEMALLOCFAILURE; break;
   case CDERR_MEMLOCKFAILURE:  wStringID=IDS_MEMLOCKFAILURE;  break;
   case CDERR_NOHOOK:          wStringID=IDS_NOHOOK;          break;
   case PDERR_SETUPFAILURE:    wStringID=IDS_SETUPFAILURE;    break;
   case PDERR_PARSEFAILURE:    wStringID=IDS_PARSEFAILURE;    break;
   case PDERR_RETDEFFAILURE:   wStringID=IDS_RETDEFFAILURE;   break;
   case PDERR_LOADDRVFAILURE:  wStringID=IDS_LOADDRVFAILURE;  break;
   case PDERR_GETDEVMODEFAIL:  wStringID=IDS_GETDEVMODEFAIL;  break;
   case PDERR_INITFAILURE:     wStringID=IDS_INITFAILURE;     break;
   case PDERR_NODEVICES:       wStringID=IDS_NODEVICES;       break;
   case PDERR_NODEFAULTPRN:    wStringID=IDS_NODEFAULTPRN;    break;
   case PDERR_DNDMMISMATCH:    wStringID=IDS_DNDMMISMATCH;    break;
   case PDERR_CREATEICFAILURE: wStringID=IDS_CREATEICFAILURE; break;
   case PDERR_PRINTERNOTFOUND: wStringID=IDS_PRINTERNOTFOUND; break;
   case CFERR_NOFONTS:         wStringID=IDS_NOFONTS;         break;
   case FNERR_SUBCLASSFAILURE: wStringID=IDS_SUBCLASSFAILURE; break;
   case FNERR_INVALIDFILENAME: wStringID=IDS_INVALIDFILENAME; break;
   case FNERR_BUFFERTOOSMALL:  wStringID=IDS_BUFFERTOOSMALL;  break;

   case 0:   //User may have hit CANCEL or we got a *very* random error
      return;

   default:
      wStringID=IDS_UNKNOWNERROR;
      }

   LoadString(NULL, wStringID, buf, sizeof(buf));
   MessageBox(hWnd, buf, NULL, MB_OK);
   return;
}

BOOL NEAR PASCAL TestNotify | ( | HWND | ,
 |  | LPOFNOTIFY |
 | ) |  |

Definition at line 358 of file ComDlg32.C.

{
  switch (pofn->hdr.code)
  {
    // The selection has changed.
    case CDN_SELCHANGE:
    {
      char szFile[MAX_PATH];

      // Get the file specification from the common dialog.
      if (CommDlg_OpenSave_GetSpec(GetParent(hDlg),
        szFile, sizeof(szFile)) <= sizeof(szFile))
      {
        // Set the dialog item to reflect this.
        SetDlgItemText(hDlg, IDE_SELECTED, szFile);
      }

      // Get the path of the selected file.
      if (CommDlg_OpenSave_GetFilePath(GetParent(hDlg),
        szFile, sizeof(szFile)) <= sizeof(szFile))
      {
        // Display this path in the appropriate box.
        SetDlgItemText(hDlg, IDE_PATH, szFile);
      }
    }
    break;

    // A new folder has been opened.
    case CDN_FOLDERCHANGE:
    {
      char szFile[MAX_PATH];

      if (CommDlg_OpenSave_GetFolderPath(GetParent(hDlg),
        szFile, sizeof(szFile)) <= sizeof(szFile))
      {
        // Display this new path in the appropriate box.
        SetDlgItemText(hDlg, IDE_SELECTED, szFile);
      }
    }
    break;

    // The "Help" pushbutton has been pressed.
    case CDN_HELP:
      MessageBox(hDlg, "Got the Help button notify.", "ComDlg32 Test", MB_OK);
      break;

    // The 'OK' pushbutton has been pressed.
    case CDN_FILEOK:
      // Update the appropriate box.
      SetDlgItemText(hDlg,IDE_SELECTED, pofn->lpOFN->lpstrFile);
      SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1L);
      break;

    // Received a sharing violation.
    case CDN_SHAREVIOLATION:
      // Update the appropriate box.
      SetDlgItemText(hDlg, IDE_SELECTED, pofn->pszFile);
      MessageBox(hDlg, "Got a sharing violation notify.", "ComDlg32 Test", MB_OK);
      break;
  }

  return(TRUE);
}

Generated on Wed Nov 13 2024 16:55:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/ComDlg32/Resource.h File Reference

  • WinUI
  • CommDlg
  • ComDlg32
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_STATIC -1
#define | IDD_ABOUT 113
#define | IDD_COMDLG32 100
#define | IDE_PATH 102
#define | IDE_SELECTED 1022
#define | IDM_ABOUT 108
#define | IDM_EXIT 107
#define | IDM_FILEOPEN 106
#define | IDS_BUFFERTOOSMALL 27
#define | IDS_CREATEICFAILURE 22
#define | IDS_DIALOGFAILURE 1
#define | IDS_DNDMMISMATCH 21
#define | IDS_FILTERSTRING 28
#define | IDS_FINDRESFAILURE 7
#define | IDS_GETDEVMODEFAIL 17
#define | IDS_INITFAILURE 18
#define | IDS_INITIALIZATION 3
#define | IDS_INVALIDFILENAME 26
#define | IDS_LOADDRVFAILURE 16
#define | IDS_LOADRESFAILURE 8
#define | IDS_LOADSTRFAILURE 6
#define | IDS_LOCKRESFAILURE 9
#define | IDS_MEMALLOCFAILURE 10
#define | IDS_MEMLOCKFAILURE 11
#define | IDS_NODEFAULTPRN 20
#define | IDS_NODEVICES 19
#define | IDS_NOFONTS 24
#define | IDS_NOHINSTANCE 5
#define | IDS_NOHOOK 12
#define | IDS_NOTEMPLATE 4
#define | IDS_PARSEFAILURE 14
#define | IDS_PRINTERNOTFOUND 23
#define | IDS_RETDEFFAILURE 15
#define | IDS_SETUPFAILURE 13
#define | IDS_STRUCTSIZE 2
#define | IDS_SUBCLASSFAILURE 25
#define | IDS_UNKNOWNERROR 29

Define Documentation

#define IDC_STATIC -1

Definition at line 41 of file Resource.h.

#define IDD_ABOUT 113

Definition at line 39 of file Resource.h.

#define IDD_COMDLG32 100

Definition at line 34 of file Resource.h.

#define IDE_PATH 102

Definition at line 35 of file Resource.h.

#define IDE_SELECTED 1022

Definition at line 40 of file Resource.h.

#define IDM_ABOUT 108

Definition at line 38 of file Resource.h.

#define IDM_EXIT 107

Definition at line 37 of file Resource.h.

#define IDM_FILEOPEN 106

Definition at line 36 of file Resource.h.

#define IDS_BUFFERTOOSMALL 27

Definition at line 31 of file Resource.h.

#define IDS_CREATEICFAILURE 22

Definition at line 26 of file Resource.h.

#define IDS_DIALOGFAILURE 1

Definition at line 5 of file Resource.h.

#define IDS_DNDMMISMATCH 21

Definition at line 25 of file Resource.h.

#define IDS_FILTERSTRING 28

Definition at line 32 of file Resource.h.

#define IDS_FINDRESFAILURE 7

Definition at line 11 of file Resource.h.

#define IDS_GETDEVMODEFAIL 17

Definition at line 21 of file Resource.h.

#define IDS_INITFAILURE 18

Definition at line 22 of file Resource.h.

#define IDS_INITIALIZATION 3

Definition at line 7 of file Resource.h.

#define IDS_INVALIDFILENAME 26

Definition at line 30 of file Resource.h.

#define IDS_LOADDRVFAILURE 16

Definition at line 20 of file Resource.h.

#define IDS_LOADRESFAILURE 8

Definition at line 12 of file Resource.h.

#define IDS_LOADSTRFAILURE 6

Definition at line 10 of file Resource.h.

#define IDS_LOCKRESFAILURE 9

Definition at line 13 of file Resource.h.

#define IDS_MEMALLOCFAILURE 10

Definition at line 14 of file Resource.h.

#define IDS_MEMLOCKFAILURE 11

Definition at line 15 of file Resource.h.

#define IDS_NODEFAULTPRN 20

Definition at line 24 of file Resource.h.

#define IDS_NODEVICES 19

Definition at line 23 of file Resource.h.

#define IDS_NOFONTS 24

Definition at line 28 of file Resource.h.

#define IDS_NOHINSTANCE 5

Definition at line 9 of file Resource.h.

#define IDS_NOHOOK 12

Definition at line 16 of file Resource.h.

#define IDS_NOTEMPLATE 4

Definition at line 8 of file Resource.h.

#define IDS_PARSEFAILURE 14

Definition at line 18 of file Resource.h.

#define IDS_PRINTERNOTFOUND 23

Definition at line 27 of file Resource.h.

#define IDS_RETDEFFAILURE 15

Definition at line 19 of file Resource.h.

#define IDS_SETUPFAILURE 13

Definition at line 17 of file Resource.h.

#define IDS_STRUCTSIZE 2

Definition at line 6 of file Resource.h.

#define IDS_SUBCLASSFAILURE 25

Definition at line 29 of file Resource.h.

#define IDS_UNKNOWNERROR 29

Definition at line 33 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Property/Property.c File Reference

  • WinUI
  • Controls
  • Common
  • Property
Defines | Functions | Variables

Property.c File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include "property.h"

Go to the source code of this file.

Defines

#define | STRICT

Functions

INT_PTR CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | ButtonsDlgProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | ComboDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR | DoModalPropSheet (HWND)
HWND | DoModelessPropSheet (HWND)
INT_PTR | DoWizardPropSheet (HWND)
BOOL | InitApplication (HINSTANCE)
BOOL | InitInstance (HINSTANCE, int)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
void CALLBACK | PropSheetCallback (HWND, UINT, LPARAM)
int PASCAL | WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

Variables

BOOL g_bWin95
HINSTANCE | g_hInst
HWND | g_hwndMain
HWND | g_hwndPropSheet
TCHAR | g_szClassName [] = TEXT("PropSheetClass")

Define Documentation

#define STRICT

Definition at line 32 of file Property.c.

Function Documentation

INT_PTR CALLBACK About | ( | HWND | hWnd,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 277 of file Property.c.

{
switch (uMessage)
   {
   case WM_INITDIALOG:
      return TRUE;

   case WM_COMMAND:
      switch(wParam)
         {
         case IDOK:
            EndDialog(hWnd, IDOK);
            return TRUE;

         case IDCANCEL:
            EndDialog(hWnd, IDCANCEL);
            return TRUE;
         }
      break;
    }

return FALSE;
}

LRESULT CALLBACK ButtonsDlgProc | ( | HWND | hdlg,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 451 of file Property.c.

{
LPNMHDR     lpnmhdr;

switch (uMessage)
   {
   // on any command notification, tell the property sheet to enable the Apply button
   case WM_COMMAND:
      PropSheet_Changed(GetParent(hdlg), hdlg);
      break;

   case WM_NOTIFY:
      lpnmhdr = (NMHDR FAR *)lParam;

      switch (lpnmhdr->code)
         {
         case PSN_APPLY:   //sent when OK or Apply button pressed
            break;

         case PSN_RESET:   //sent when Cancel button pressed
            break;

         case PSN_SETACTIVE:
            //this will be ignored if the property sheet is not a wizard
            PropSheet_SetWizButtons(GetParent(hdlg), PSWIZB_NEXT);
            break;

         default:
            break;
         }
      break;

   default:
      break;
   }

return FALSE;
}

LRESULT CALLBACK ComboDlgProc | ( | HWND | hdlg,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 499 of file Property.c.

{
LPNMHDR     lpnmhdr;

switch (uMessage)
   {
   // on any command notification, tell the property sheet to enable the Apply button
   case WM_COMMAND:
      PropSheet_Changed(GetParent(hdlg), hdlg);
      break;

   case WM_NOTIFY:
      lpnmhdr = (NMHDR FAR *)lParam;

      switch (lpnmhdr->code)
         {
         case PSN_APPLY:   //sent when OK or Apply button pressed
            break;

         case PSN_RESET:   //sent when Cancel button pressed
            break;

         case PSN_SETACTIVE:
            //this will be ignored if the property sheet is not a wizard
            PropSheet_SetWizButtons(GetParent(hdlg), PSWIZB_BACK | PSWIZB_FINISH);
            return FALSE;

         default:
            break;
         }
      break;

   default:
   break;
   }

return FALSE;
}

INT_PTR DoModalPropSheet ( HWND hwndOwner )

Definition at line 310 of file Property.c.

{
PROPSHEETPAGE psp[2];
PROPSHEETHEADER psh;

//Fill out the PROPSHEETPAGE data structure for the Background Color sheet
psp[0].dwSize        = sizeof(PROPSHEETPAGE);
psp[0].dwFlags       = PSP_USETITLE;
psp[0].hInstance     = g_hInst;
psp[0].pszTemplate   = MAKEINTRESOURCE(IDD_BUTTONS);
psp[0].pszIcon       = NULL;
psp[0].pfnDlgProc    = ButtonsDlgProc;
psp[0].pszTitle      = TEXT("Buttons");
psp[0].lParam        = 0;

//Fill out the PROPSHEETPAGE data structure for the Client Area Shape sheet
psp[1].dwSize        = sizeof(PROPSHEETPAGE);
psp[1].dwFlags       = PSP_USETITLE;
psp[1].hInstance     = g_hInst;
psp[1].pszTemplate   = MAKEINTRESOURCE(IDD_COMBOBOXES);
psp[1].pszIcon       = NULL;
psp[1].pfnDlgProc    = ComboDlgProc;
psp[1].pszTitle      = TEXT("Combo Boxes");
psp[1].lParam        = 0;

//Fill out the PROPSHEETHEADER
psh.dwSize           = sizeof(PROPSHEETHEADER);
psh.dwFlags          = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
psh.hwndParent       = hwndOwner;
psh.hInstance        = g_hInst;
psh.pszIcon          = MAKEINTRESOURCE(IDI_BACKCOLOR);
psh.pszCaption       = TEXT("Modal Property Sheet");
psh.nPages           = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.ppsp             = (LPCPROPSHEETPAGE) &psp;
psh.pfnCallback      = (PFNPROPSHEETCALLBACK)PropSheetCallback;

//And finally display the modal property sheet
return PropertySheet(&psh);
}

HWND DoModelessPropSheet ( HWND hwndOwner )

Definition at line 356 of file Property.c.

{
PROPSHEETPAGE psp[2];
PROPSHEETHEADER psh;

//Fill out the PROPSHEETPAGE data structure for the Background Color sheet
psp[0].dwSize        = sizeof(PROPSHEETPAGE);
psp[0].dwFlags       = PSP_USETITLE;
psp[0].hInstance     = g_hInst;
psp[0].pszTemplate   = MAKEINTRESOURCE(IDD_BUTTONS);
psp[0].pszIcon       = NULL;
psp[0].pfnDlgProc    = ButtonsDlgProc;
psp[0].pszTitle      = TEXT("Buttons");
psp[0].lParam        = 0;

//Fill out the PROPSHEETPAGE data structure for the Client Area Shape sheet
psp[1].dwSize        = sizeof(PROPSHEETPAGE);
psp[1].dwFlags       = PSP_USETITLE;
psp[1].hInstance     = g_hInst;
psp[1].pszTemplate   = MAKEINTRESOURCE(IDD_COMBOBOXES);
psp[1].pszIcon       = NULL;
psp[1].pfnDlgProc    = ComboDlgProc;
psp[1].pszTitle      = TEXT("Combo Boxes");
psp[1].lParam        = 0;

//Fill out the PROPSHEETHEADER
psh.dwSize           = sizeof(PROPSHEETHEADER);
psh.dwFlags          = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK| PSH_MODELESS;
psh.hwndParent       = hwndOwner;
psh.hInstance        = g_hInst;
psh.pszIcon          = MAKEINTRESOURCE(IDI_BACKCOLOR);
psh.pszCaption       = TEXT("Modeless Property Sheet");
psh.nPages           = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.ppsp             = (LPCPROPSHEETPAGE) &psp;
psh.pfnCallback      = (PFNPROPSHEETCALLBACK)PropSheetCallback;

//disable the parent to prevent another property sheet from being created - this will be re-enabled when the property sheet is destroyed.
EnableWindow(hwndOwner, FALSE);

//And finally display the modeless property sheet. It will be destroyed in our main message loop.
return (HWND)PropertySheet(&psh);
}

INT_PTR DoWizardPropSheet ( HWND hwndOwner )

Definition at line 405 of file Property.c.

{
PROPSHEETPAGE psp[2];
PROPSHEETHEADER psh;

//Fill out the PROPSHEETPAGE data structure for the Background Color sheet
psp[0].dwSize        = sizeof(PROPSHEETPAGE);
psp[0].dwFlags       = PSP_USETITLE;
psp[0].hInstance     = g_hInst;
psp[0].pszTemplate   = MAKEINTRESOURCE(IDD_BUTTONS);
psp[0].pszIcon       = NULL;
psp[0].pfnDlgProc    = ButtonsDlgProc;
psp[0].pszTitle      = TEXT("Buttons");
psp[0].lParam        = 0;

//Fill out the PROPSHEETPAGE data structure for the Client Area Shape sheet
psp[1].dwSize        = sizeof(PROPSHEETPAGE);
psp[1].dwFlags       = PSP_USETITLE;
psp[1].hInstance     = g_hInst;
psp[1].pszTemplate   = MAKEINTRESOURCE(IDD_COMBOBOXES);
psp[1].pszIcon       = NULL;
psp[1].pfnDlgProc    = ComboDlgProc;
psp[1].pszTitle      = TEXT("Combo Boxes");
psp[1].lParam        = 0;

//Fill out the PROPSHEETHEADER
psh.dwSize           = sizeof(PROPSHEETHEADER);
psh.dwFlags          = PSH_PROPSHEETPAGE | PSH_WIZARD | PSH_USEICONID | PSH_USECALLBACK;
psh.hwndParent       = hwndOwner;
psh.hInstance        = g_hInst;
psh.pszIcon          = MAKEINTRESOURCE(IDI_BACKCOLOR);
psh.pszCaption       = TEXT("Wizard Property Sheet");
psh.nPages           = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.ppsp             = (LPCPROPSHEETPAGE) &psp;
psh.pfnCallback      = (PFNPROPSHEETCALLBACK)PropSheetCallback;

//And finally display the Wizard property sheet
return PropertySheet(&psh);
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 127 of file Property.c.

{
OSVERSIONINFO  os;

ZeroMemory(&os, sizeof(os));
os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&os);
if(os.dwMajorVersion >= 4)
   g_bWin95 = TRUE;
else
   g_bWin95 = FALSE;

if(g_bWin95)
   {
   WNDCLASSEX  wcex;

   ZeroMemory(&wcex, sizeof(wcex));

   wcex.cbSize          = sizeof(wcex);
   wcex.style           = CS_HREDRAW | CS_VREDRAW;
   wcex.lpfnWndProc     = (WNDPROC)MainWndProc;
   wcex.cbClsExtra      = 0;
   wcex.cbWndExtra      = 0;
   wcex.hInstance       = hInstance;
   wcex.hIcon           = LoadIcon(NULL, IDI_APPLICATION);
   wcex.hCursor         = LoadCursor(NULL, IDC_ARROW);
   wcex.hbrBackground   = GetStockObject(WHITE_BRUSH);
   wcex.lpszMenuName    = MAKEINTRESOURCE(IDR_MAIN_MENU);
   wcex.lpszClassName   = g_szClassName;

   return RegisterClassEx(&wcex);
   }
else
   {
   WNDCLASS  wc;

   ZeroMemory(&wc, sizeof(wc));

   wc.style          = CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc    = (WNDPROC)MainWndProc;
   wc.cbClsExtra     = 0;
   wc.cbWndExtra     = 0;
   wc.hInstance      = hInstance;
   wc.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
   wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
   wc.hbrBackground  = GetStockObject(WHITE_BRUSH);
   wc.lpszMenuName   = MAKEINTRESOURCE(IDR_MAIN_MENU);
   wc.lpszClassName  = g_szClassName;

   return RegisterClass(&wc);
   }
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 186 of file Property.c.

{
g_hwndMain = CreateWindowEx(  0,
                              g_szClassName,
                              TEXT("Property Sheet Application"),
                              WS_OVERLAPPEDWINDOW,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              NULL,
                              NULL,
                              hInstance,
                              NULL);

if (!g_hwndMain)
   {
   return FALSE;
   }

ShowWindow(g_hwndMain, nCmdShow);
UpdateWindow(g_hwndMain);

return TRUE;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 219 of file Property.c.

{
switch (uMessage)
   {
   case WM_CREATE:
      break;

   case WM_CLOSE:
      if(IsWindow(g_hwndPropSheet))
         DestroyWindow(g_hwndPropSheet);

      DestroyWindow(hWnd);
      break;

   case WM_DESTROY:
      PostQuitMessage(0);
      break;

   case WM_COMMAND:
      switch (GET_WM_COMMAND_ID(wParam, lParam))
         {
         case IDM_MODAL:
            DoModalPropSheet(hWnd);
            break;

         case IDM_MODELESS:
            g_hwndPropSheet = DoModelessPropSheet(hWnd);
            break;

         case IDM_WIZARD:
            DoWizardPropSheet(hWnd);
            break;

         case IDM_EXIT:
            PostMessage(hWnd, WM_CLOSE, 0, 0);
            break;

         case IDM_ABOUT:
            DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUT_DIALOG), hWnd, About);
            break;
         }
      return TRUE;

   default:
      break;
   }
return DefWindowProc(hWnd, uMessage, wParam, lParam);
}

void CALLBACK PropSheetCallback | ( | HWND | hwndPropSheet,
 |  | UINT | uMsg,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 547 of file Property.c.

{
switch(uMsg)
   {
   //called before the dialog is created, hwndPropSheet = NULL, lParam points to dialog resource
   case PSCB_PRECREATE:
      {
      LPDLGTEMPLATE  lpTemplate = (LPDLGTEMPLATE)lParam;

      if(!(lpTemplate->style & WS_SYSMENU))
         {
         lpTemplate->style |= WS_SYSMENU;
         }
      }
      break;

   //called after the dialog is created
   case PSCB_INITIALIZED:
      break;

   }
}

int PASCAL WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 75 of file Property.c.

{
MSG      msg;

g_hInst = hInstance;

//don't forget this
InitCommonControls();

if(!hPrevInstance)
   if(!InitApplication(hInstance))
      return FALSE;

if (!InitInstance(hInstance, nCmdShow))
   return FALSE;

while(GetMessage(&msg, NULL, 0x00, 0x00))
   {
   // If the modeless guy is up and is ready to be destroyed
   // (PropSheet_GetCurrentPageHwnd returns NULL) then destroy the dialog.

   // PropSheet_GetCurrentPageHwnd will return NULL after the OK or Cancel
   // button has been pressed and all of the pages have been notified. The
   // Apply button doesn't cause this to happen.
   if(g_hwndPropSheet && (NULL == PropSheet_GetCurrentPageHwnd(g_hwndPropSheet)))
      {
      //enable the parent first to prevent another window from becoming the foreground window
      EnableWindow(g_hwndMain, TRUE);
      DestroyWindow(g_hwndPropSheet);
      g_hwndPropSheet = NULL;
      }

   //use PropSheet_IsDialogMessage instead of IsDialogMessage
   if(!PropSheet_IsDialogMessage(g_hwndPropSheet, &msg))
      {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
      }
   }

return (int)msg.wParam;
}

Variable Documentation

BOOL g_bWin95

Definition at line 66 of file Property.c.

HINSTANCE g_hInst

Definition at line 63 of file Property.c.

HWND g_hwndMain

Definition at line 64 of file Property.c.

HWND g_hwndPropSheet

Definition at line 64 of file Property.c.

TCHAR g_szClassName[] = TEXT("PropSheetClass")

Definition at line 67 of file Property.c.

Generated on Wed Nov 13 2024 16:55:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Property/Property.h File Reference

  • WinUI
  • Controls
  • Common
  • Property

Property.h File Reference

#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:53:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Property/Resource.h File Reference

  • WinUI
  • Controls
  • Common
  • Property
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_BUTTON2 1007
#define | IDC_CHECK1 1011
#define | IDC_CHECK2 1012
#define | IDC_CHECK3 1013
#define | IDC_COMBO1 1014
#define | IDC_COMBO2 1015
#define | IDC_COMBO3 1016
#define | IDC_RADIO1 1008
#define | IDC_RADIO2 1009
#define | IDC_RADIO3 1010
#define | IDC_STATIC -1
#define | IDD_ABOUT_DIALOG 101
#define | IDD_BUTTONS 105
#define | IDD_COMBOBOXES 106
#define | IDI_BACKCOLOR 103
#define | IDM_ABOUT 2005
#define | IDM_EXIT 2001
#define | IDM_MODAL 2002
#define | IDM_MODELESS 2003
#define | IDM_WIZARD 2004
#define | IDR_MAIN_MENU 102

Define Documentation

#define IDC_BUTTON2 1007

Definition at line 10 of file Resource.h.

#define IDC_CHECK1 1011

Definition at line 14 of file Resource.h.

#define IDC_CHECK2 1012

Definition at line 15 of file Resource.h.

#define IDC_CHECK3 1013

Definition at line 16 of file Resource.h.

#define IDC_COMBO1 1014

Definition at line 17 of file Resource.h.

#define IDC_COMBO2 1015

Definition at line 18 of file Resource.h.

#define IDC_COMBO3 1016

Definition at line 19 of file Resource.h.

#define IDC_RADIO1 1008

Definition at line 11 of file Resource.h.

#define IDC_RADIO2 1009

Definition at line 12 of file Resource.h.

#define IDC_RADIO3 1010

Definition at line 13 of file Resource.h.

#define IDC_STATIC -1

Definition at line 25 of file Resource.h.

#define IDD_ABOUT_DIALOG 101

Definition at line 5 of file Resource.h.

#define IDD_BUTTONS 105

Definition at line 8 of file Resource.h.

#define IDD_COMBOBOXES 106

Definition at line 9 of file Resource.h.

#define IDI_BACKCOLOR 103

Definition at line 7 of file Resource.h.

#define IDM_ABOUT 2005

Definition at line 24 of file Resource.h.

#define IDM_EXIT 2001

Definition at line 20 of file Resource.h.

#define IDM_MODAL 2002

Definition at line 21 of file Resource.h.

#define IDM_MODELESS 2003

Definition at line 22 of file Resource.h.

#define IDM_WIZARD 2004

Definition at line 23 of file Resource.h.

#define IDR_MAIN_MENU 102

Definition at line 6 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Rebar/Rebar.c File Reference

  • WinUI
  • Controls
  • Common
  • Rebar
Defines | Functions | Variables

Rebar.c File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include "resource.h"

Go to the source code of this file.

Defines

#define | BOTTOM 0x02
#define | ID_BUTTON 2000
#define | ID_COMBOBOX 2001
#define | ID_REBAR 1000
#define | LEFT 0x01
#define | RIGHT 0x03
#define | STRICT
#define | TOP 0x00

Functions

INT_PTR CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
HWND | BuildRebar (HWND)
LRESULT | HandleCommand (HWND, WPARAM, LPARAM)
LRESULT | HandleMenuPopup (HMENU)
BOOL | InitApplication (HINSTANCE)
BOOL | InitInstance (HINSTANCE, int)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
void | MoveRebar (HWND)
int PASCAL | WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

Variables

HINSTANCE | g_hInst
WORD | g_wSide

Define Documentation

#define BOTTOM 0x02

Definition at line 53 of file Rebar.c.

#define ID_BUTTON 2000

Definition at line 48 of file Rebar.c.

#define ID_COMBOBOX 2001

Definition at line 49 of file Rebar.c.

#define ID_REBAR 1000

Definition at line 47 of file Rebar.c.

#define LEFT 0x01

Definition at line 52 of file Rebar.c.

#define RIGHT 0x03

Definition at line 54 of file Rebar.c.

#define STRICT

Definition at line 18 of file Rebar.c.

#define TOP 0x00

Definition at line 51 of file Rebar.c.

Function Documentation

INT_PTR CALLBACK About | ( | HWND | hDlg,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 228 of file Rebar.c.

{
switch (uMessage)
   {
   case WM_INITDIALOG:
      return TRUE;

   case WM_COMMAND:
      switch(wParam)
         {
         case IDOK:
            EndDialog(hDlg, IDOK);
            return TRUE;

         case IDCANCEL:
            EndDialog(hDlg, IDCANCEL);
            return TRUE;
         }
      break;
    }

return FALSE;
}

HWND BuildRebar ( HWND hwndParent )

Definition at line 261 of file Rebar.c.

{
HWND     hwndRebar = NULL;
LRESULT  lResult;

hwndRebar = CreateWindowEx(   WS_EX_TOOLWINDOW,
                              REBARCLASSNAME,
                              NULL,
                              WS_VISIBLE |
                                 WS_BORDER |
                                 WS_CHILD |
                                 WS_CLIPCHILDREN |
                                 WS_CLIPSIBLINGS |
                                 RBS_VARHEIGHT |
                                 RBS_BANDBORDERS |
                                 ((g_wSide & 0x01) ? CCS_VERT : 0) | //g_wSide is odd if this is a vertical bar
                                 ((g_wSide == BOTTOM) ? CCS_BOTTOM : 0) |
                                 ((g_wSide == RIGHT) ? CCS_RIGHT : 0) |
                                 0,
                              0,
                              0,
                              200,
                              100,
                              hwndParent,
                              (HMENU)ID_REBAR,
                              g_hInst,
                              NULL);

if(hwndRebar)
   {
   REBARINFO      rbi;
   HIMAGELIST     himlRebar;
   HICON          hIcon;
   REBARBANDINFO  rbbi;
   HWND           hwndChild;
   RECT           rc;
   TCHAR          szString[64];

   //set up the ReBar
   himlRebar = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 1, 0);
   hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON1));

   ImageList_AddIcon(himlRebar, hIcon);

   rbi.cbSize  = sizeof(rbi);
   rbi.fMask   = RBIM_IMAGELIST;
   rbi.himl    = himlRebar;
   lResult = SendMessage(hwndRebar, RB_SETBARINFO, 0, (LPARAM)&rbi);

   //add a band that contains a combobox
   hwndChild = CreateWindowEx(   0,
                                 TEXT("combobox"),
                                 NULL,
                                 WS_VISIBLE |
                                    WS_CHILD |
                                    WS_TABSTOP |
                                    WS_VSCROLL |
                                    WS_CLIPCHILDREN |
                                    WS_CLIPSIBLINGS |
                                    CBS_AUTOHSCROLL |
                                    CBS_DROPDOWN |
                                    0,
                                 0,
                                 0,
                                 100,
                                 200,
                                 hwndRebar,
                                 (HMENU)ID_COMBOBOX,
                                 g_hInst,
                                 NULL);

   //add some stuff to the combobox
   {
   int   i;

   SendMessage(hwndChild, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0));

   for(i = 0; i < 25; i++)
      {
      wsprintf(szString, TEXT("Item %d"), i + 1);
      SendMessage(hwndChild, CB_ADDSTRING, 0, (LPARAM)szString);
      }
   }

   GetWindowRect(hwndChild, &rc);

   ZeroMemory(&rbbi, sizeof(rbbi));
   rbbi.cbSize       = sizeof(REBARBANDINFO);
   rbbi.fMask        = RBBIM_SIZE |
                        RBBIM_CHILD |
                        RBBIM_CHILDSIZE |
                        RBBIM_ID |
                        RBBIM_STYLE |
                        RBBIM_TEXT |
                        RBBIM_BACKGROUND |
                        RBBIM_IMAGE |
                        0;

   rbbi.cxMinChild   = rc.right - rc.left;
   rbbi.cyMinChild   = rc.bottom - rc.top;
   rbbi.cx           = 100;
   rbbi.fStyle       = RBBS_CHILDEDGE |
                        RBBS_FIXEDBMP |
                        RBBS_GRIPPERALWAYS |
                        0;
   rbbi.wID          = ID_COMBOBOX;
   rbbi.hwndChild    = hwndChild;
   rbbi.lpText       = TEXT("ComboBox");
   rbbi.cch          = 2;
   rbbi.hbmBack      = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BACKGROUND));
   rbbi.iImage       = 0;

   lResult = SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(LPREBARBANDINFO)&rbbi);

   //add a band that contains a button
   hwndChild = CreateWindowEx(   0,
                                 TEXT("button"),
                                 TEXT("Button"),
                                 WS_CHILD |
                                    BS_PUSHBUTTON |
                                    0,
                                 0,
                                 0,
                                 100,
                                 50,
                                 hwndRebar,
                                 (HMENU)ID_BUTTON,
                                 g_hInst,
                                 NULL);

   GetWindowRect(hwndChild, &rc);

   ZeroMemory(&rbbi, sizeof(rbbi));
   rbbi.cbSize       = sizeof(REBARBANDINFO);
   rbbi.fMask        = RBBIM_SIZE |
                        RBBIM_CHILD |
                        RBBIM_CHILDSIZE |
                        RBBIM_ID |
                        RBBIM_STYLE |
                        RBBIM_TEXT |
                        RBBIM_BACKGROUND |
                        0;
   rbbi.cxMinChild   = rc.right - rc.left;
   rbbi.cyMinChild   = rc.bottom - rc.top;
   rbbi.cx           = 100;
   rbbi.fStyle       = RBBS_CHILDEDGE |
                        RBBS_FIXEDBMP |
                        RBBS_GRIPPERALWAYS |
                        0;
   rbbi.wID          = ID_BUTTON;
   rbbi.hwndChild    = hwndChild;
   rbbi.lpText       = TEXT("Button");
   rbbi.hbmBack      = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BACKGROUND));

   lResult = SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(LPREBARBANDINFO)&rbbi);
   }

return hwndRebar;
}

LRESULT HandleCommand | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 526 of file Rebar.c.

{
switch(GET_WM_COMMAND_ID(wParam, lParam))
   {
   case ID_BUTTON:
      break;

   case ID_COMBOBOX:
      break;

   case IDM_TOP:
      if(g_wSide != TOP)
         {
         //destroy the existing Rebar
         DestroyWindow(GetDlgItem(hWnd, ID_REBAR));

         //change to the new side
         g_wSide = TOP;

         //create the new Rebar
         BuildRebar(hWnd);

         }
      break;

   case IDM_BOTTOM:
      if(g_wSide != BOTTOM)
         {
         //destroy the existing Rebar
         DestroyWindow(GetDlgItem(hWnd, ID_REBAR));

         g_wSide = BOTTOM;

         //create the new Rebar
         BuildRebar(hWnd);

         }
      break;

   case IDM_LEFT:
      if(g_wSide != LEFT)
         {
         //destroy the existing Rebar
         DestroyWindow(GetDlgItem(hWnd, ID_REBAR));

         g_wSide = LEFT;

         //create the new Rebar
         BuildRebar(hWnd);

         }
      break;

   case IDM_RIGHT:
      if(g_wSide != RIGHT)
         {
         //destroy the existing Rebar
         DestroyWindow(GetDlgItem(hWnd, ID_REBAR));

         g_wSide = RIGHT;

         //create the new Rebar
         BuildRebar(hWnd);

         }
      break;

   case IDM_EXIT:
      DestroyWindow(hWnd);
      break;

   case IDM_ABOUT:
      DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
      break;

   }

return TRUE;
}

LRESULT HandleMenuPopup ( HMENU hMenu )

Definition at line 491 of file Rebar.c.

{
UINT  uSelect;

switch(g_wSide)
   {
   default:
   case TOP:
      uSelect = IDM_TOP;
      break;

   case LEFT:
      uSelect = IDM_LEFT;
      break;

   case BOTTOM:
      uSelect = IDM_BOTTOM;
      break;

   case RIGHT:
      uSelect = IDM_RIGHT;
      break;
   }

CheckMenuRadioItem(hMenu, IDM_TOP, IDM_BOTTOM, uSelect, MF_BYCOMMAND);

return 0;
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 111 of file Rebar.c.

{
WNDCLASS  wc;

wc.style          = 0;
wc.lpfnWndProc    = (WNDPROC)MainWndProc;
wc.cbClsExtra     = 0;
wc.cbWndExtra     = 0;
wc.hInstance      = hInstance;
wc.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName   = MAKEINTRESOURCE(IDM_GENERICMENU);
wc.lpszClassName  = TEXT("GenericClass");

return RegisterClass(&wc);
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 141 of file Rebar.c.

{
HWND  hWnd;

g_hInst = hInstance;

hWnd = CreateWindowEx(  0,
                        TEXT("GenericClass"),
                        TEXT("Generic Application"),
                        WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        NULL,
                        NULL,
                        hInstance,
                        NULL);

if (!hWnd)
   return FALSE;

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

return TRUE;

}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 183 of file Rebar.c.

{
switch (uMessage)
   {
   case WM_CREATE:
      g_wSide = TOP;

      BuildRebar(hWnd);
      break;

   case WM_SIZE:
      MoveRebar(hWnd);
      break;

   case WM_DESTROY:
      PostQuitMessage(0);
      break;

   case WM_INITMENUPOPUP:
      return HandleMenuPopup((HMENU)wParam);

   case WM_COMMAND:
      return HandleCommand(hWnd, wParam, lParam);

   default:
      break;
   }
return DefWindowProc(hWnd, uMessage, wParam, lParam);
}

void MoveRebar ( HWND hWnd )

Definition at line 429 of file Rebar.c.

{
RECT  rc,
      rcRebar;
int   x,
      y,
      cx,
      cy;

GetClientRect(hWnd, &rc);
GetWindowRect(GetDlgItem(hWnd, ID_REBAR), &rcRebar);

switch(g_wSide)
   {
   default:
   case TOP:
      //align the rebar along the top of the window
      x = 0;
      y = 0;
      cx = rc.right - rc.left;
      cy = rc.bottom - rc.top;
      break;

   case LEFT:
      //align the rebar along the left side of the window
      x = 0;
      y = 0;
      cx = rcRebar.right - rcRebar.left;
      cy = rc.bottom - rc.top;
      break;

   case BOTTOM:
      //align the rebar along the bottom of the window
      x = 0;
      y = rc.bottom - (rcRebar.bottom - rcRebar.top);
      cx = rc.right - rc.left;
      cy = rcRebar.bottom - rcRebar.top;
      break;

   case RIGHT:
      //align the coolbar along the right side of the window
      x = rc.right - (rcRebar.right - rcRebar.left);
      y = 0;
      cx = rcRebar.right - rcRebar.left;
      cy = rc.bottom - rc.top;
      break;
   }

MoveWindow( GetDlgItem(hWnd, ID_REBAR),
            x,
            y,
            cx,
            cy,
            TRUE);
}

int PASCAL WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 71 of file Rebar.c.

{
MSG      msg;
INITCOMMONCONTROLSEX iccex;

iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
iccex.dwICC = ICC_COOL_CLASSES;
InitCommonControlsEx(&iccex);

if(!hPrevInstance)
   if(!InitApplication(hInstance))
      return FALSE;

if (!InitInstance(hInstance, nCmdShow))
   return FALSE;

while(GetMessage( &msg, NULL, 0x00, 0x00))
   {
   TranslateMessage(&msg);
   DispatchMessage(&msg);
   }

return (int)msg.wParam;
}

Variable Documentation

HINSTANCE g_hInst

Definition at line 56 of file Rebar.c.

WORD g_wSide

Definition at line 57 of file Rebar.c.

Generated on Wed Nov 13 2024 16:55:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Rebar/Resource.h File Reference

  • WinUI
  • Controls
  • Common
  • Rebar
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDB_BACKGROUND 102
#define | IDB_LOGO 103
#define | IDD_ABOUTBOX 101
#define | IDI_ICON1 100
#define | IDM_ABOUT 100
#define | IDM_BOTTOM 105
#define | IDM_EXIT 101
#define | IDM_GENERICMENU 104
#define | IDM_LEFT 103
#define | IDM_RIGHT 104
#define | IDM_TOP 102

Define Documentation

#define IDB_BACKGROUND 102

Definition at line 18 of file Resource.h.

#define IDB_LOGO 103

Definition at line 20 of file Resource.h.

#define IDD_ABOUTBOX 101

Definition at line 16 of file Resource.h.

#define IDI_ICON1 100

Definition at line 14 of file Resource.h.

#define IDM_ABOUT 100

Definition at line 15 of file Resource.h.

#define IDM_BOTTOM 105

Definition at line 24 of file Resource.h.

#define IDM_EXIT 101

Definition at line 17 of file Resource.h.

#define IDM_GENERICMENU 104

Definition at line 22 of file Resource.h.

#define IDM_LEFT 103

Definition at line 21 of file Resource.h.

#define IDM_RIGHT 104

Definition at line 23 of file Resource.h.

#define IDM_TOP 102

Definition at line 19 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/VListVw/Resource.h File Reference

  • WinUI
  • Controls
  • Common
  • VListVw
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDD_ABOUT 100
#define | IDI_DISK 104
#define | IDI_MAINICON 101
#define | IDM_ABOUT 101
#define | IDM_CONTEXT_MENU 103
#define | IDM_EXIT 100
#define | IDM_LARGE_ICONS 200
#define | IDM_LIST 202
#define | IDM_MAIN_MENU 102
#define | IDM_REPORT 203
#define | IDM_SMALL_ICONS 201
#define | IDS_APPTITLE 1

Define Documentation

#define IDD_ABOUT 100

Definition at line 15 of file Resource.h.

#define IDI_DISK 104

Definition at line 19 of file Resource.h.

#define IDI_MAINICON 101

Definition at line 16 of file Resource.h.

#define IDM_ABOUT 101

Definition at line 21 of file Resource.h.

#define IDM_CONTEXT_MENU 103

Definition at line 18 of file Resource.h.

#define IDM_EXIT 100

Definition at line 20 of file Resource.h.

#define IDM_LARGE_ICONS 200

Definition at line 22 of file Resource.h.

#define IDM_LIST 202

Definition at line 24 of file Resource.h.

#define IDM_MAIN_MENU 102

Definition at line 17 of file Resource.h.

#define IDM_REPORT 203

Definition at line 25 of file Resource.h.

#define IDM_SMALL_ICONS 201

Definition at line 23 of file Resource.h.

#define IDS_APPTITLE 1

Definition at line 14 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/VListVw/VListVw.c File Reference

  • WinUI
  • Controls
  • Common
  • VListVw
Defines | Functions | Variables

VListVw.c File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include "VListVw.h"

Go to the source code of this file.

Defines

#define | ErrorHandler() ErrorHandlerEx(__LINE__, __FILE__)
#define | ITEM_COUNT 100000
#define | STRICT

Functions

INT_PTR CALLBACK | AboutDlgProc (HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)
HWND | CreateListView (HINSTANCE hInstance, HWND hwndParent)
BOOL | DoContextMenu (HWND, WPARAM, LPARAM)
void | ErrorHandlerEx (WORD, LPSTR)
BOOL | InitApplication (HINSTANCE hInstance)
BOOL | InitInstance (HINSTANCE hInstance, int nCmdShow)
BOOL | InitListView (HWND hwndListView)
BOOL | InsertListViewItems (HWND)
LRESULT | ListViewNotify (HWND, LPARAM)
LRESULT CALLBACK | MainWndProc (HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
void | PositionHeader (HWND)
void | ResizeListView (HWND hwndListView, HWND hwndParent)
void | SwitchView (HWND, DWORD)
void | UpdateMenu (HWND, HMENU)
int PASCAL | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

HINSTANCE | g_hInst
TCHAR | g_szClassName [] = TEXT("VListVwClass")

Define Documentation

#define ErrorHandler ( ) ErrorHandlerEx(__LINE__, __FILE__)

Definition at line 25 of file VListVw.c.

#define ITEM_COUNT 100000

Definition at line 42 of file VListVw.c.

#define STRICT

Definition at line 14 of file VListVw.c.

Function Documentation

INT_PTR CALLBACK AboutDlgProc | ( | HWND | hDlg,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 261 of file VListVw.c.

{
switch (uMessage)
   {
   case WM_INITDIALOG:
      return TRUE;

   case WM_COMMAND:
      switch(wParam)
         {
         case IDOK:
            EndDialog(hDlg, IDOK);
            break;

         case IDCANCEL:
            EndDialog(hDlg, IDOK);
            break;
         }
      return TRUE;
    }

return FALSE;
}

HWND CreateListView | ( | HINSTANCE | hInstance,
 |  | HWND | hwndParent
 | ) |  |

Definition at line 294 of file VListVw.c.

{
DWORD       dwStyle;
HWND        hwndListView;
HIMAGELIST  himlSmall;
HIMAGELIST  himlLarge;
BOOL        bSuccess = TRUE;

dwStyle =   WS_TABSTOP |
            WS_CHILD |
            WS_BORDER |
            WS_VISIBLE |
            LVS_AUTOARRANGE |
            LVS_REPORT |
            LVS_OWNERDATA;

hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,          // ex style
                                 WC_LISTVIEW,               // class name - defined in commctrl.h
                                 TEXT(""),                        // dummy text
                                 dwStyle,                   // style
                                 0,                         // x position
                                 0,                         // y position
                                 0,                         // width
                                 0,                         // height
                                 hwndParent,                // parent
                                 (HMENU)ID_LISTVIEW,        // ID
                                 g_hInst,                   // instance
                                 NULL);                     // no extra data

if(!hwndListView)
   return NULL;

ResizeListView(hwndListView, hwndParent);

//set the image lists
himlSmall = ImageList_Create(16, 16, ILC_COLORDDB | ILC_MASK, 1, 0);
himlLarge = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 1, 0);

if (himlSmall && himlLarge)
   {
   HICON hIcon;

   //set up the small image list
   hIcon = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DISK), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
   ImageList_AddIcon(himlSmall, hIcon);

   //set up the large image list
   hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISK));
   ImageList_AddIcon(himlLarge, hIcon);

   ListView_SetImageList(hwndListView, himlSmall, LVSIL_SMALL);
   ListView_SetImageList(hwndListView, himlLarge, LVSIL_NORMAL);
   }

return hwndListView;
}

BOOL DoContextMenu | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 596 of file VListVw.c.

{
HWND  hwndListView = (HWND)wParam;
HMENU hMenuLoad,
      hMenu;

if(hwndListView != GetDlgItem(hWnd, ID_LISTVIEW))
   return FALSE;

hMenuLoad = LoadMenu(g_hInst, MAKEINTRESOURCE(IDM_CONTEXT_MENU));
hMenu = GetSubMenu(hMenuLoad, 0);

UpdateMenu(hwndListView, hMenu);

TrackPopupMenu(   hMenu,
                  TPM_LEFTALIGN | TPM_RIGHTBUTTON,
                  LOWORD(lParam),
                  HIWORD(lParam),
                  0,
                  hWnd,
                  NULL);

DestroyMenu(hMenuLoad);

return TRUE;
}

void ErrorHandlerEx | ( | WORD | wLine,
 |  | LPSTR | lpszFile
 | ) |  |

Definition at line 541 of file VListVw.c.

{
LPVOID lpvMessage;
DWORD  dwError;
TCHAR  szBuffer[256];

// Allow FormatMessage() to look up the error code returned by GetLastError
dwError = FormatMessage(   FORMAT_MESSAGE_ALLOCATE_BUFFER |
                              FORMAT_MESSAGE_FROM_SYSTEM,
                           NULL,
                           GetLastError(),
                           MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
                           (LPTSTR)&lpvMessage,
                           0,
                           NULL);

// Check to see if an error occurred calling FormatMessage()
if (0 == dwError)
   {
   wsprintf(   szBuffer,
               TEXT("An error occurred calling FormatMessage().")
               TEXT("Error Code %d"),
               GetLastError());
   MessageBox( NULL,
               szBuffer,
               TEXT("Generic"),
               MB_ICONSTOP | MB_ICONEXCLAMATION);
   return;
   }

// Display the error information along with the place the error happened.
wsprintf(szBuffer, TEXT("Generic, Line=%d, File=%s"), wLine, lpszFile);
MessageBox(NULL, lpvMessage, szBuffer, MB_ICONEXCLAMATION | MB_OK);
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 89 of file VListVw.c.

{
WNDCLASSEX  wcex;
ATOM        aReturn;

wcex.cbSize          = sizeof(WNDCLASSEX);
wcex.style           = 0;
wcex.lpfnWndProc     = (WNDPROC)MainWndProc;
wcex.cbClsExtra      = 0;
wcex.cbWndExtra      = 0;
wcex.hInstance       = hInstance;
wcex.hCursor         = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground   = (HBRUSH)(COLOR_WINDOW + 1);
wcex.lpszMenuName    = MAKEINTRESOURCE(IDM_MAIN_MENU);
wcex.lpszClassName   = g_szClassName;
wcex.hIcon           = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON));
wcex.hIconSm         = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 16, 16, 0);

aReturn = RegisterClassEx(&wcex);

if(0 == aReturn)
   {
   WNDCLASS wc;

   wc.style          = 0;
   wc.lpfnWndProc    = (WNDPROC)MainWndProc;
   wc.cbClsExtra     = 0;
   wc.cbWndExtra     = 0;
   wc.hInstance      = hInstance;
   wc.hIcon          = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON));
   wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
   wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW + 1);
   wc.lpszMenuName   = MAKEINTRESOURCE(IDM_MAIN_MENU);
   wc.lpszClassName  = g_szClassName;

   aReturn = RegisterClass(&wc);
   }

return aReturn;
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 137 of file VListVw.c.

{
HWND     hWnd;
TCHAR    szTitle[MAX_PATH] = TEXT("");

g_hInst = hInstance;

LoadString(g_hInst, IDS_APPTITLE, szTitle, sizeof(szTitle)/sizeof(szTitle[0]));

/* Create a main window for this application instance.  */
hWnd = CreateWindowEx(  0,
                        g_szClassName,
                        szTitle,
                        WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        CW_USEDEFAULT,
                        NULL,
                        NULL,
                        hInstance,
                        NULL);

/* If window could not be created, return "failure" */

if (!hWnd)
   return FALSE;

/* Make the window visible; update its client area; and return "success" */

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;

}

BOOL InitListView ( HWND hwndListView )

Definition at line 424 of file VListVw.c.

{
LV_COLUMN   lvColumn;
int         i;
TCHAR       szString[5][20] = {TEXT("Main Column"), TEXT("Column 1"), TEXT("Column 2"), TEXT("Column 3"), TEXT("Column 4")};

//empty the list
ListView_DeleteAllItems(hwndListView);

//initialize the columns
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 120;
for(i = 0; i < 5; i++)
   {
   lvColumn.pszText = szString[i];
   ListView_InsertColumn(hwndListView, i, &lvColumn);
   }

InsertListViewItems(hwndListView);

return TRUE;
}

BOOL InsertListViewItems ( HWND hwndListView )

Definition at line 454 of file VListVw.c.

{
//empty the list
ListView_DeleteAllItems(hwndListView);

//set the number of items in the list
ListView_SetItemCount(hwndListView, ITEM_COUNT);

return TRUE;
}

LRESULT ListViewNotify | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 471 of file VListVw.c.

{
LPNMHDR  lpnmh = (LPNMHDR) lParam;
HWND     hwndListView = GetDlgItem(hWnd, ID_LISTVIEW);

switch(lpnmh->code)
   {
   case LVN_GETDISPINFO:
      {
      LV_DISPINFO *lpdi = (LV_DISPINFO *)lParam;
      TCHAR szString[MAX_PATH];

      if(lpdi->item.iSubItem)
         {
         if(lpdi->item.mask & LVIF_TEXT)
            {
            wsprintf(szString, TEXT("Item %d - Column %d"), lpdi->item.iItem + 1, lpdi->item.iSubItem);
            lstrcpyn(lpdi->item.pszText, szString, lpdi->item.cchTextMax);
            }
         }
      else
         {
         if(lpdi->item.mask & LVIF_TEXT)
            {
            wsprintf(szString, TEXT("Item %d"), lpdi->item.iItem + 1);
            lstrcpyn(lpdi->item.pszText, szString, lpdi->item.cchTextMax);
            }

         if(lpdi->item.mask & LVIF_IMAGE)
            {
            lpdi->item.iImage = 0;
            }
         }
      }
      return 0;

   case LVN_ODCACHEHINT:
      {
      LPNMLVCACHEHINT   lpCacheHint = (LPNMLVCACHEHINT)lParam;
      /*
      This sample doesn't use this notification, but this is sent when the
      ListView is about to ask for a range of items. On this notification,
      you should load the specified items into your local cache. It is still
      possible to get an LVN_GETDISPINFO for an item that has not been cached,
      therefore, your application must take into account the chance of this
      occurring.
      */
      }
      return 0;

   case LVN_ODFINDITEM:
      {
      LPNMLVFINDITEM lpFindItem = (LPNMLVFINDITEM)lParam;
      /*
      This sample doesn't use this notification, but this is sent when the
      ListView needs a particular item. Return -1 if the item is not found.
      */
      }
      return 0;
   }

return 0;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 180 of file VListVw.c.

{
static HWND hwndListView;

switch (uMessage)
   {
   case WM_CREATE:
      // create the TreeView control
      hwndListView = CreateListView(g_hInst, hWnd);

      //initialize the TreeView control
      InitListView(hwndListView);

      break;

   case WM_NOTIFY:
      return ListViewNotify(hWnd, lParam);

   case WM_SIZE:
      ResizeListView(hwndListView, hWnd);
      break;

   case WM_INITMENUPOPUP:
      UpdateMenu(hwndListView, GetMenu(hWnd));
      break;

   case WM_CONTEXTMENU:
      if(DoContextMenu(hWnd, wParam, lParam))
         return FALSE;
      break;

   case WM_COMMAND:
      switch (GET_WM_COMMAND_ID(wParam, lParam))
         {
         case IDM_LARGE_ICONS:
            SwitchView(hwndListView, LVS_ICON);
            break;

         case IDM_SMALL_ICONS:
            SwitchView(hwndListView, LVS_SMALLICON);
            break;

         case IDM_LIST:
            SwitchView(hwndListView, LVS_LIST);
            break;

         case IDM_REPORT:
            SwitchView(hwndListView, LVS_REPORT);
            break;

         case IDM_EXIT:
            DestroyWindow(hWnd);
            break;

         case IDM_ABOUT:
            DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), hWnd, AboutDlgProc);
            break;

         }
      break;

   case WM_DESTROY:
      PostQuitMessage(0);
      break;

   default:
      break;
   }
return DefWindowProc(hWnd, uMessage, wParam, lParam);
}

void PositionHeader ( HWND hwndListView )

Definition at line 383 of file VListVw.c.

{
HWND  hwndHeader = GetWindow(hwndListView, GW_CHILD);
DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);

/*To ensure that the first item will be visible, create the control without
the LVS_NOSCROLL style and then add it here*/
dwStyle |= LVS_NOSCROLL;
SetWindowLong(hwndListView, GWL_STYLE, dwStyle);

//only do this if we are in report view and were able to get the header hWnd
if(((dwStyle & LVS_TYPEMASK) == LVS_REPORT) && hwndHeader)
   {
   RECT        rc;
   HD_LAYOUT   hdLayout;
   WINDOWPOS   wpos;

   GetClientRect(hwndListView, &rc);
   hdLayout.prc = &rc;
   hdLayout.pwpos = &wpos;

   Header_Layout(hwndHeader, &hdLayout);

   SetWindowPos(  hwndHeader,
                  wpos.hwndInsertAfter,
                  wpos.x,
                  wpos.y,
                  wpos.cx,
                  wpos.cy,
                  wpos.flags | SWP_SHOWWINDOW);

   ListView_EnsureVisible(hwndListView, 0, FALSE);
   }
}

void ResizeListView | ( | HWND | hwndListView,
 |  | HWND | hwndParent
 | ) |  |

Definition at line 357 of file VListVw.c.

{
RECT  rc;

GetClientRect(hwndParent, &rc);

MoveWindow( hwndListView,
            rc.left,
            rc.top,
            rc.right - rc.left,
            rc.bottom - rc.top,
            TRUE);

//only call this if we want the LVS_NOSCROLL style
//PositionHeader(hwndListView);
}

void SwitchView | ( | HWND | hwndListView,
 |  | DWORD | dwView
 | ) |  |

Definition at line 582 of file VListVw.c.

{
DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);

SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | dwView);
ResizeListView(hwndListView, GetParent(hwndListView));
}

void UpdateMenu | ( | HWND | hwndListView,
 |  | HMENU | hMenu
 | ) |  |

Definition at line 631 of file VListVw.c.

{
UINT  uID = IDM_LIST;
DWORD dwStyle;

//uncheck all of these guys
CheckMenuItem(hMenu, IDM_LARGE_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_SMALL_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_LIST,  MF_BYCOMMAND | MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_REPORT,  MF_BYCOMMAND | MF_UNCHECKED);

//check the appropriate view menu item
dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
switch(dwStyle & LVS_TYPEMASK)
   {
   case LVS_ICON:
      uID = IDM_LARGE_ICONS;
      break;

   case LVS_SMALLICON:
      uID = IDM_SMALL_ICONS;
      break;

   case LVS_LIST:
      uID = IDM_LIST;
      break;

   case LVS_REPORT:
      uID = IDM_REPORT;
      break;
   }
CheckMenuRadioItem(hMenu, IDM_LARGE_ICONS, IDM_REPORT, uID,  MF_BYCOMMAND | MF_CHECKED);

}

int PASCAL WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 50 of file VListVw.c.

{
MSG  msg;

g_hInst = hInstance;

if(!hPrevInstance)
   if(!InitApplication(hInstance))
      return FALSE;

//required to use the common controls
InitCommonControls();

/* Perform initializations that apply to a specific instance */

if (!InitInstance(hInstance, nCmdShow))
   return FALSE;

/* Acquire and dispatch messages until a WM_QUIT uMessage is received. */

while(GetMessage( &msg, NULL, 0x00, 0x00))
   {
   TranslateMessage(&msg);
   DispatchMessage(&msg);
   }

return (int)msg.wParam;
}

Variable Documentation

HINSTANCE g_hInst

Definition at line 39 of file VListVw.c.

TCHAR g_szClassName[] = TEXT("VListVwClass")

Definition at line 40 of file VListVw.c.

Generated on Wed Nov 13 2024 16:55:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/VListVw/VListVw.h File Reference

  • WinUI
  • Controls
  • Common
  • VListVw
Defines | Functions

VListVw.h File Reference

#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Defines

#define | GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
#define | GET_WM_COMMAND_HWND(wp, lp) (HWND)(LOWORD(lp))
#define | GET_WM_COMMAND_ID(wp, lp) (wp)
#define | ID_LISTVIEW 2000

Functions

INT_PTR CALLBACK | AboutDlgProc (HWND, UINT, WPARAM, LPARAM)
HWND | CreateListView (HINSTANCE, HWND)
BOOL | InitApplication (HINSTANCE)
BOOL | InitInstance (HINSTANCE, int)
BOOL | InitListView (HWND)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
void | ResizeListView (HWND, HWND)
int PASCAL | WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

Define Documentation

#define GET_WM_COMMAND_CMD | ( | wp,
 |  | lp |
 | ) |  | HIWORD(lp)

Definition at line 16 of file VListVw.h.

#define GET_WM_COMMAND_HWND | ( | wp,
 |  | lp |
 | ) |  | (HWND)(LOWORD(lp))

Definition at line 15 of file VListVw.h.

#define GET_WM_COMMAND_ID | ( | wp,
 |  | lp |
 | ) |  | (wp)

Definition at line 14 of file VListVw.h.

#define ID_LISTVIEW 2000

Definition at line 29 of file VListVw.h.

Function Documentation

INT_PTR CALLBACK AboutDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 471 of file APP.Cxx.

{

    switch(message)
    {
       case WM_INITDIALOG:
            return TRUE;
       case WM_COMMAND:
            switch (wParam) //Command ID
            {
               case IDOK:
               case IDCANCEL:
                    EndDialog(hwnd, 0);
                    return TRUE;
            }
            break;
    }
    return FALSE;
}

HWND CreateListView | ( | HINSTANCE | ,
 |  | HWND |
 | ) |  |

Definition at line 294 of file VListVw.c.

{
DWORD       dwStyle;
HWND        hwndListView;
HIMAGELIST  himlSmall;
HIMAGELIST  himlLarge;
BOOL        bSuccess = TRUE;

dwStyle =   WS_TABSTOP |
            WS_CHILD |
            WS_BORDER |
            WS_VISIBLE |
            LVS_AUTOARRANGE |
            LVS_REPORT |
            LVS_OWNERDATA;

hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,          // ex style
                                 WC_LISTVIEW,               // class name - defined in commctrl.h
                                 TEXT(""),                        // dummy text
                                 dwStyle,                   // style
                                 0,                         // x position
                                 0,                         // y position
                                 0,                         // width
                                 0,                         // height
                                 hwndParent,                // parent
                                 (HMENU)ID_LISTVIEW,        // ID
                                 g_hInst,                   // instance
                                 NULL);                     // no extra data

if(!hwndListView)
   return NULL;

ResizeListView(hwndListView, hwndParent);

//set the image lists
himlSmall = ImageList_Create(16, 16, ILC_COLORDDB | ILC_MASK, 1, 0);
himlLarge = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 1, 0);

if (himlSmall && himlLarge)
   {
   HICON hIcon;

   //set up the small image list
   hIcon = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DISK), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
   ImageList_AddIcon(himlSmall, hIcon);

   //set up the large image list
   hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISK));
   ImageList_AddIcon(himlLarge, hIcon);

   ListView_SetImageList(hwndListView, himlSmall, LVSIL_SMALL);
   ListView_SetImageList(hwndListView, himlLarge, LVSIL_NORMAL);
   }

return hwndListView;
}

BOOL InitApplication ( HINSTANCE )

Definition at line 186 of file Generic.C.

{
    WNDCLASS  wc;
    HWND      hwnd;

    // Win32 will always set hPrevInstance to NULL, so lets check
    // things a little closer. This is because we only want a single
    // version of this app to run at a time
    hwnd = FindWindow (szAppName, szTitle);
    if (hwnd)
    {
        // We found another version of ourself. Lets defer to it:
        if (IsIconic(hwnd))
        {
            ShowWindow(hwnd, SW_RESTORE);
        }
        SetForegroundWindow (hwnd);

        // If this app actually had any functionality, we would
        // also want to communicate any action that our 'twin'
        // should now perform based on how the user tried to
        // execute us.
        return FALSE;
    }

    // Fill in window class structure with parameters that describe
    // the main window.
    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = (WNDPROC)WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon (hInstance, szAppName);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);

    // Since Windows95 has a slightly different recommended
    // format for the 'Help' menu, lets put this in the alternate menu like this:
    if (IS_WIN95)
    {
        wc.lpszMenuName  = "WIN95";
    }
    else
    {
        wc.lpszMenuName  = szAppName;
    }
    wc.lpszClassName = szAppName;

    // Register the window class and return success/failure code.
    if (IS_WIN95)
    {
        return MyRegisterClass(&wc);
    }
    else
    {
        return RegisterClass(&wc);
    }
}

BOOL InitInstance | ( | HINSTANCE | ,
 |  | int |
 | ) |  |

Definition at line 255 of file Generic.C.

{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szAppName, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
      NULL, NULL, hInstance, NULL);

   if (!hWnd) {
      return (FALSE);
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return (TRUE);
}

BOOL InitListView ( HWND )

Definition at line 424 of file VListVw.c.

{
LV_COLUMN   lvColumn;
int         i;
TCHAR       szString[5][20] = {TEXT("Main Column"), TEXT("Column 1"), TEXT("Column 2"), TEXT("Column 3"), TEXT("Column 4")};

//empty the list
ListView_DeleteAllItems(hwndListView);

//initialize the columns
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 120;
for(i = 0; i < 5; i++)
   {
   lvColumn.pszText = szString[i];
   ListView_InsertColumn(hwndListView, i, &lvColumn);
   }

InsertListViewItems(hwndListView);

return TRUE;
}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

void ResizeListView | ( | HWND | ,
 |  | HWND |
 | ) |  |

Definition at line 357 of file VListVw.c.

{
RECT  rc;

GetClientRect(hwndParent, &rc);

MoveWindow( hwndListView,
            rc.left,
            rc.top,
            rc.right - rc.left,
            rc.bottom - rc.top,
            TRUE);

//only call this if we want the LVS_NOSCROLL style
//PositionHeader(hwndListView);
}

int PASCAL WinMain | ( | HINSTANCE | ,
 |  | HINSTANCE | ,
 |  | LPSTR | ,
 |  | int |
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 48 of file Demo.c.

{

    HWND hWnd;
    MSG msg;
    CHAR szAppName[64];

    UNREFERENCED_PARAMETER(lpCmdLine);

    if (!hPrevInstance)
        if (!DemoInit(hInstance))
            return (0);

    hInst = hInstance;
    LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName));

    hWnd = CreateWindow("Demo",
        szAppName,
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        NULL,
        NULL,
        hInstance,
        NULL);

    if (!hWnd)
        return (0);

    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);

    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return (int)(msg.wParam);
}

Generated on Wed Nov 13 2024 16:55:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/Paint.c File Reference

  • WinUI
  • Controls
  • Custom
  • SpinCube
Functions

Paint.c File Reference

#include <windows.h>
#include <math.h>
#include <stdlib.h>
#include "spincube.h"
#include "paint.h"

Go to the source code of this file.

Functions

void | ComputeRotationTransformation (float fRotationX, float fRotationY, float fRotationZ)
void | Paint (HWND hwnd)
void | TransformVertices (HWND hwnd, RECT *pWindowRect, PSPINCUBEINFO pSCI, LONG lScaleFactor)

Function Documentation

void ComputeRotationTransformation | ( | float | fRotationX,
 |  | float | fRotationY,
 |  | float | fRotationZ
 | ) |  |

Definition at line 534 of file Paint.c.

{
  float sinX, cosX, sinY, cosY, sinZ, cosZ;

  sinX = (float) sin ((double) fRotationX);
  cosX = (float) cos ((double) fRotationX);
  sinY = (float) sin ((double) fRotationY);
  cosY = (float) cos ((double) fRotationY);
  sinZ = (float) sin ((double) fRotationZ);
  cosZ = (float) cos ((double) fRotationZ);

  gM[0][0] =  cosY*cosZ;
  gM[0][1] = -cosY*sinZ;
  gM[0][2] =  sinY;
  gM[1][0] =  sinX*sinY*cosZ + cosX*sinZ;
  gM[1][1] = -sinX*sinY*sinZ + cosX*cosZ;
  gM[1][2] = -sinX*cosY;
}

void Paint ( HWND hwnd )

Definition at line 96 of file Paint.c.

{
  PSPINCUBEINFO  pSCI;
  RECT           rect;
  int            i;
  LONG           lScaleFactor;
  PAINTSTRUCT    ps;
  HRGN           hrgnClip;
  HBRUSH         hBrush, hBrushSave;
  int            iX, iY, iCX, iCY;
  int            facetIndex, numPoints;
  POINT          polygn[MAX_POINTS_PER_FACET];
  POINT          vector1, vector2;
  COLORREF       acrColor[6] = { 0x0000ff, 0x00ff00, 0xff0000,
                                 0x00ffff, 0xff00ff, 0xffff00 };

  pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd, GWL_SPINCUBEDATA);

  BeginPaint (hwnd, &ps);

  if (memcmp((void *)&ps.rcPaint, (void *)&pSCI->rcCubeBoundary, sizeof(RECT))
      & !REPAINT_BKGND(pSCI))

  {
    //
    // We're not here because it's time to animate (i.e. this paint isn't
    //   the result of a WM_TIMER), so just do the Blt & blow out of here...
    //

    BitBlt (ps.hdc,
            ps.rcPaint.left,
            ps.rcPaint.top,
            ps.rcPaint.right - ps.rcPaint.left,
            ps.rcPaint.bottom - ps.rcPaint.top,
            pSCI->hdcCompat, ps.rcPaint.left,
            ps.rcPaint.top, SRCCOPY);

    EndPaint (hwnd, &ps);
    return;
  }

  //
  // The rectangle we get back is in Desktop coordinates, so we need to
  //   modify it to reflect coordinates relative to this window.
  //

  GetWindowRect (hwnd, &rect);

  rect.right  -= rect.left;
  rect.bottom -= rect.top;
  rect.left = rect.top = 0;

  //
  // Determine a "best fit" scale factor for our polyhedron
  //

  if (!(lScaleFactor = rect.right > rect.bottom ?
                       rect.bottom/12 : rect.right/12))

    lScaleFactor = 1;

  TransformVertices (hwnd, &rect, pSCI, lScaleFactor);

  //
  // Draw the window frame & background
  //
  // Note: The chances are that we are coming through here because we
  //   got a WM_TIMER message & it's time to redraw the cube to simulate
  //   animation. In that case all we want to erase/redraw is that small
  //   rectangle which bounded the polyhedron the last time. The less
  //   drawing that actually gets done the better, since we wnat to
  //   minimize the flicker on the screen. __BeginPaint__ is perfect for
  //   this because it causes all drawing outside of the invalid region
  //   to be "clipped" (no drawing is performed outside of the invalid
  //   region), and it also validates the invalid region.
  //

  if (DO_ERASE(hwnd) || REPAINT_BKGND(pSCI))
  {
    hrgnClip = CreateRectRgnIndirect (&ps.rcPaint);
    SelectClipRgn (pSCI->hdcCompat, hrgnClip);
    DeleteObject (hrgnClip);

    SelectObject (pSCI->hdcCompat, GetStockObject (GRAY_BRUSH));
    Rectangle    (pSCI->hdcCompat, (int)rect.left, (int)rect.top,
                  (int)rect.right, (int)rect.bottom);

    iX = (rect.right  - rect.left) / 4;
    iY = (rect.bottom - rect.top ) / 4;

    MoveToEx (pSCI->hdcCompat, (int)rect.left, (int)rect.top, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.left + iX, (int)rect.top + iY);
    LineTo   (pSCI->hdcCompat, (int)rect.left + iX, (int)rect.bottom - iY);
    LineTo   (pSCI->hdcCompat, (int)rect.left,      (int)rect.bottom);

    MoveToEx (pSCI->hdcCompat, (int)rect.right, (int)rect.top, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.top + iY);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.bottom- iY);
    LineTo   (pSCI->hdcCompat, (int)rect.right,      (int)rect.bottom);

    MoveToEx (pSCI->hdcCompat, (int)rect.left + iX,  (int)rect.top + iY, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.top + iY);

    MoveToEx (pSCI->hdcCompat, (int)rect.left + iX,  (int)rect.bottom - iY, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.bottom - iY);

    SelectClipRgn (pSCI->hdcCompat, NULL);

    pSCI->iOptions &= ~SPINCUBE_REPAINT_BKGND;
  }

  //
  // Draw the polyhedron. We'll walk through the facets list and compute
  //   the normal for each facet- if the normal has z > 0, then the facet
  //   faces us and we'll draw it. Note that this algorithim is ONLY valid
  //   for scenes with a single, convex polyhedron.
  //
  // Note: Use GetDC here because the above call to BeginPaint will
  //   probably not give us a DC with access to as much real estate as
  //   we'd like (we wouldn't be able to draw outside of the invalid
  //   region). We can party on the entire control window with the DC
  //   returned by GetDC.
  //

  for (i = 0, facetIndex = 0; i < NUMFACETS; i++)
  {
    vector1.x = gXformedVertices[gaiFacets[facetIndex + 1]].x -
                gXformedVertices[gaiFacets[facetIndex]].x;
    vector1.y = gXformedVertices[gaiFacets[facetIndex + 1]].y -
                gXformedVertices[gaiFacets[facetIndex]].y;
    vector2.x = gXformedVertices[gaiFacets[facetIndex + 2]].x -
                gXformedVertices[gaiFacets[facetIndex + 1]].x;
    vector2.y = gXformedVertices[gaiFacets[facetIndex + 2]].y -
                gXformedVertices[gaiFacets[facetIndex + 1]].y;

    for (numPoints = 0; gaiFacets[facetIndex] != -1; numPoints++, facetIndex++)
    {
      polygn[numPoints].x = gXformedVertices[gaiFacets[facetIndex]].x;
      polygn[numPoints].y = gXformedVertices[gaiFacets[facetIndex]].y;
    }

    facetIndex++; /* skip over the -1's in the facets list */
    if ((vector1.x*vector2.y - vector1.y*vector2.x) > 0)
    {
      hBrush     = CreateSolidBrush (acrColor[i]);
      hBrushSave = (HBRUSH) SelectObject (pSCI->hdcCompat, hBrush);

      Polygon (pSCI->hdcCompat, &polygn[0], numPoints);

      SelectObject (pSCI->hdcCompat, hBrushSave);
      DeleteObject (hBrush);
    }
  }

  iX  = pSCI->rcCubeBoundary.left < ps.rcPaint.left ?
        pSCI->rcCubeBoundary.left : ps.rcPaint.left;
  iY  = pSCI->rcCubeBoundary.top  < ps.rcPaint.top  ?
        pSCI->rcCubeBoundary.top  : ps.rcPaint.top;

  iCX = (pSCI->rcCubeBoundary.right > ps.rcPaint.right ?
         pSCI->rcCubeBoundary.right : ps.rcPaint.right) - iX;

  iCY = (pSCI->rcCubeBoundary.bottom > ps.rcPaint.bottom ?
         pSCI->rcCubeBoundary.bottom : ps.rcPaint.bottom) - iY;

  EndPaint (hwnd, &ps);

  ps.hdc = GetDC (hwnd);

  BitBlt (ps.hdc, iX, iY, iCX, iCY, pSCI->hdcCompat, iX, iY, SRCCOPY);

  ReleaseDC (hwnd, ps.hdc);

}

void TransformVertices | ( | HWND | hwnd,
 |  | RECT * | pWindowRect,
 |  | PSPINCUBEINFO | pSCI,
 |  | LONG | lScaleFactor
 | ) |  |

Definition at line 289 of file Paint.c.

{
  int    i;
  int    iWindowDepth = pWindowRect->right > pWindowRect->bottom ?
                        pWindowRect->right : pWindowRect->bottom;
  RECT   WindowRect;
  float  fDepthScale;
  int    iNewTranslationInc = (rand() % 10) + 2;
  float  fNewRotationInc    = (float) 0.01 * ((rand() % 30) + 2);

  WindowRect.left = - (WindowRect.right  = pWindowRect->right  >> 1);
  WindowRect.top  = - (WindowRect.bottom = pWindowRect->bottom >> 1);

  //
  // Initiailize the bounding rectangle with max/min vals
  //

  pSCI->rcCubeBoundary.left   =
  pSCI->rcCubeBoundary.top    = 100000; // big positive value
  pSCI->rcCubeBoundary.right  =
  pSCI->rcCubeBoundary.bottom = -100000; // small negative value

  //
  // First scale, then rotate, then translate each vertex.
  //   Keep track of the maximum & minimum values bounding the
  //   vertices in the x,y plane for use later in bounds checking.
  //
  // Note: we don't bother computing z values after the scale,
  //   as they are only really necessary for the rotation. If we
  //   were doing real bounds checking we'd need it, but this code
  //   simply uses the pSCI->iCurrentZTranslation to determine
  //   the z-boundaries.
  //

  for (i = 0; i < NUMVERTICES; i++)
  {
    LONG tempX;

    //
    // Copy the static vertices into a temp array
    //

    gXformedVertices[i] = gNormalizedVertices[i];

    //
    // The scale...
    //

    gXformedVertices[i].x *= lScaleFactor;
    gXformedVertices[i].y *= lScaleFactor;
    gXformedVertices[i].z *= lScaleFactor;

    //
    // The rotation...
    //

    ComputeRotationTransformation (pSCI->fCurrentXRotation,
                                   pSCI->fCurrentYRotation,
                                   pSCI->fCurrentZRotation);

    tempX   =               (LONG) (gM[0][0] * gXformedVertices[i].x +
                                    gM[0][1] * gXformedVertices[i].y +
                                    gM[0][2] * gXformedVertices[i].z);

    gXformedVertices[i].y = (LONG) (gM[1][0] * gXformedVertices[i].x +
                                    gM[1][1] * gXformedVertices[i].y +
                                    gM[1][2] * gXformedVertices[i].z);
    gXformedVertices[i].x = tempX;

    //
    // The translation...
    //

    gXformedVertices[i].x += pSCI->iCurrentXTranslation;
    gXformedVertices[i].y += pSCI->iCurrentYTranslation;

    //
    // Check if we have new max or min vals
    //

    if (pSCI->rcCubeBoundary.left > gXformedVertices[i].x)

      pSCI->rcCubeBoundary.left = gXformedVertices[i].x;

    if (pSCI->rcCubeBoundary.right < gXformedVertices[i].x)

      pSCI->rcCubeBoundary.right = gXformedVertices[i].x;

    if (pSCI->rcCubeBoundary.top > gXformedVertices[i].y)

      pSCI->rcCubeBoundary.top = gXformedVertices[i].y;

    if (pSCI->rcCubeBoundary.bottom < gXformedVertices[i].y)

      pSCI->rcCubeBoundary.bottom = gXformedVertices[i].y;
  }

  //
  // Now for some bounds checking, change translation & rotation increments
  //   if we hit a "wall". Also so the gbHitBoundary flag so we remember
  //   to flash the cube when we draw it.
  //

  if (pSCI->rcCubeBoundary.left < WindowRect.left)
  {
    pSCI->iCurrentXTranslationInc = iNewTranslationInc;
    pSCI->fCurrentZRotationInc    = fNewRotationInc;
  }

  else if (pSCI->rcCubeBoundary.right > WindowRect.right)
  {
    pSCI->iCurrentXTranslationInc = -iNewTranslationInc;
    pSCI->fCurrentZRotationInc    = -fNewRotationInc;
  }

  if (pSCI->rcCubeBoundary.top < WindowRect.top)
   {
    pSCI->iCurrentYTranslationInc = iNewTranslationInc;
    pSCI->fCurrentXRotationInc    = fNewRotationInc;
  }

  else if (pSCI->rcCubeBoundary.bottom > WindowRect.bottom)
  {
    pSCI->iCurrentYTranslationInc = -iNewTranslationInc;
    pSCI->fCurrentXRotationInc    = -fNewRotationInc;
  }

  if (pSCI->iCurrentZTranslation < (int) lScaleFactor<<1)
  {
    pSCI->iCurrentZTranslationInc = iNewTranslationInc;
    pSCI->fCurrentYRotationInc    = fNewRotationInc;
  }

  else if (pSCI->iCurrentZTranslation > (iWindowDepth - (int) lScaleFactor))
  {
    pSCI->iCurrentZTranslationInc = -iNewTranslationInc;
    pSCI->fCurrentYRotationInc    = -fNewRotationInc;
  }

  //
  // Now a kludgy scale based on depth (iCurrentZTranslation) of the center
  //   point of the polyhedron
  //

  fDepthScale =  ((float) iWindowDepth) /
                 ((float) (iWindowDepth + pSCI->iCurrentZTranslation));

  pSCI->rcCubeBoundary.left  = (LONG)(fDepthScale* pSCI->rcCubeBoundary.left  );
  pSCI->rcCubeBoundary.right = (LONG)(fDepthScale* pSCI->rcCubeBoundary.right );
  pSCI->rcCubeBoundary.top   = (LONG)(fDepthScale* pSCI->rcCubeBoundary.top   );
  pSCI->rcCubeBoundary.bottom= (LONG)(fDepthScale* pSCI->rcCubeBoundary.bottom);

  for (i = 0; i < NUMVERTICES; i++)
  {
    gXformedVertices[i].x = (LONG) (fDepthScale * gXformedVertices[i].x);
    gXformedVertices[i].y = (LONG) (fDepthScale * gXformedVertices[i].y);
  }

  //
  // If currently in motion then increment the current rotation & tranlation
  //

  if (IN_MOTION(hwnd))
  {
    pSCI->fCurrentXRotation += pSCI->fCurrentXRotationInc;
    pSCI->fCurrentYRotation += pSCI->fCurrentYRotationInc;
    pSCI->fCurrentZRotation += pSCI->fCurrentZRotationInc;

    pSCI->iCurrentXTranslation += pSCI->iCurrentXTranslationInc;
    pSCI->iCurrentYTranslation += pSCI->iCurrentYTranslationInc;
    pSCI->iCurrentZTranslation += pSCI->iCurrentZTranslationInc;
  }

  //
  // Up to this point all coordinates are relative to a window whose
  //   center is at (0,0). Now we'll translate appropriately...
  //

  pSCI->rcCubeBoundary.left   += pWindowRect->right  >> 1;
  pSCI->rcCubeBoundary.right  += pWindowRect->right  >> 1;
  pSCI->rcCubeBoundary.top    += pWindowRect->bottom >> 1;
  pSCI->rcCubeBoundary.bottom += pWindowRect->bottom >> 1;

  for (i = 0; i < NUMVERTICES; i++)
  {
    gXformedVertices[i].x += pWindowRect->right  >> 1;
    gXformedVertices[i].y += pWindowRect->bottom >> 1;
  }

  //
  // Since FillRect's are inclusive-exclusive (there'll be leftovers
  //   from the last cube we drew otherwise)...
  //

  pSCI->rcCubeBoundary.right++;
  pSCI->rcCubeBoundary.bottom++;

  //
  // Finally, adjust the rcCubeBoundary such that it fits entirely within
  //   the acutal control window. The reason for this is that when calling
  //   InvalidateRect from SpincubeWndProc\case_WM_TIMER we may get
  //   a different PAINSTRUCT.rcPaint (since InvalidateRect clips the passed
  //   in rect to the window bounds) and our abouve test to memcmp() will
  //   fail.
  //

  if (pSCI->rcCubeBoundary.left < 0)

    pSCI->rcCubeBoundary.left = 0;

  if (pSCI->rcCubeBoundary.top < 0)

    pSCI->rcCubeBoundary.top = 0;

  if (pSCI->rcCubeBoundary.right > pWindowRect->right)

    pSCI->rcCubeBoundary.right = pWindowRect->right;

  if (pSCI->rcCubeBoundary.bottom > pWindowRect->bottom)

    pSCI->rcCubeBoundary.bottom = pWindowRect->bottom;
}

Generated on Wed Nov 13 2024 16:53:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/Paint.h File Reference

  • WinUI
  • Controls
  • Custom
  • SpinCube
Classes | Defines | Functions | Variables

Paint.h File Reference

Go to the source code of this file.

Classes

struct | POINT3D

Defines

#define | MAX_POINTS_PER_FACET 4
#define | NUMFACETS 6
#define | NUMVERTICES 8

Functions

void | ComputeRotationTransformation (float, float, float)
void | TransformVertices (HWND, RECT *, PSPINCUBEINFO, LONG)

Variables

float | gM [2][3]
POINT3D | gXformedVertices [NUMVERTICES]

Define Documentation

#define MAX_POINTS_PER_FACET 4

Definition at line 16 of file Paint.h.

#define NUMFACETS 6

Definition at line 14 of file Paint.h.

#define NUMVERTICES 8

Definition at line 13 of file Paint.h.

Function Documentation

void ComputeRotationTransformation | ( | float | ,
 |  | float | ,
 |  | float |
 | ) |  |

Definition at line 534 of file Paint.c.

{
  float sinX, cosX, sinY, cosY, sinZ, cosZ;

  sinX = (float) sin ((double) fRotationX);
  cosX = (float) cos ((double) fRotationX);
  sinY = (float) sin ((double) fRotationY);
  cosY = (float) cos ((double) fRotationY);
  sinZ = (float) sin ((double) fRotationZ);
  cosZ = (float) cos ((double) fRotationZ);

  gM[0][0] =  cosY*cosZ;
  gM[0][1] = -cosY*sinZ;
  gM[0][2] =  sinY;
  gM[1][0] =  sinX*sinY*cosZ + cosX*sinZ;
  gM[1][1] = -sinX*sinY*sinZ + cosX*cosZ;
  gM[1][2] = -sinX*cosY;
}

void TransformVertices | ( | HWND | ,
 |  | RECT * | ,
 |  | PSPINCUBEINFO | ,
 |  | LONG |
 | ) |  |

Definition at line 289 of file Paint.c.

{
  int    i;
  int    iWindowDepth = pWindowRect->right > pWindowRect->bottom ?
                        pWindowRect->right : pWindowRect->bottom;
  RECT   WindowRect;
  float  fDepthScale;
  int    iNewTranslationInc = (rand() % 10) + 2;
  float  fNewRotationInc    = (float) 0.01 * ((rand() % 30) + 2);

  WindowRect.left = - (WindowRect.right  = pWindowRect->right  >> 1);
  WindowRect.top  = - (WindowRect.bottom = pWindowRect->bottom >> 1);

  //
  // Initiailize the bounding rectangle with max/min vals
  //

  pSCI->rcCubeBoundary.left   =
  pSCI->rcCubeBoundary.top    = 100000; // big positive value
  pSCI->rcCubeBoundary.right  =
  pSCI->rcCubeBoundary.bottom = -100000; // small negative value

  //
  // First scale, then rotate, then translate each vertex.
  //   Keep track of the maximum & minimum values bounding the
  //   vertices in the x,y plane for use later in bounds checking.
  //
  // Note: we don't bother computing z values after the scale,
  //   as they are only really necessary for the rotation. If we
  //   were doing real bounds checking we'd need it, but this code
  //   simply uses the pSCI->iCurrentZTranslation to determine
  //   the z-boundaries.
  //

  for (i = 0; i < NUMVERTICES; i++)
  {
    LONG tempX;

    //
    // Copy the static vertices into a temp array
    //

    gXformedVertices[i] = gNormalizedVertices[i];

    //
    // The scale...
    //

    gXformedVertices[i].x *= lScaleFactor;
    gXformedVertices[i].y *= lScaleFactor;
    gXformedVertices[i].z *= lScaleFactor;

    //
    // The rotation...
    //

    ComputeRotationTransformation (pSCI->fCurrentXRotation,
                                   pSCI->fCurrentYRotation,
                                   pSCI->fCurrentZRotation);

    tempX   =               (LONG) (gM[0][0] * gXformedVertices[i].x +
                                    gM[0][1] * gXformedVertices[i].y +
                                    gM[0][2] * gXformedVertices[i].z);

    gXformedVertices[i].y = (LONG) (gM[1][0] * gXformedVertices[i].x +
                                    gM[1][1] * gXformedVertices[i].y +
                                    gM[1][2] * gXformedVertices[i].z);
    gXformedVertices[i].x = tempX;

    //
    // The translation...
    //

    gXformedVertices[i].x += pSCI->iCurrentXTranslation;
    gXformedVertices[i].y += pSCI->iCurrentYTranslation;

    //
    // Check if we have new max or min vals
    //

    if (pSCI->rcCubeBoundary.left > gXformedVertices[i].x)

      pSCI->rcCubeBoundary.left = gXformedVertices[i].x;

    if (pSCI->rcCubeBoundary.right < gXformedVertices[i].x)

      pSCI->rcCubeBoundary.right = gXformedVertices[i].x;

    if (pSCI->rcCubeBoundary.top > gXformedVertices[i].y)

      pSCI->rcCubeBoundary.top = gXformedVertices[i].y;

    if (pSCI->rcCubeBoundary.bottom < gXformedVertices[i].y)

      pSCI->rcCubeBoundary.bottom = gXformedVertices[i].y;
  }

  //
  // Now for some bounds checking, change translation & rotation increments
  //   if we hit a "wall". Also so the gbHitBoundary flag so we remember
  //   to flash the cube when we draw it.
  //

  if (pSCI->rcCubeBoundary.left < WindowRect.left)
  {
    pSCI->iCurrentXTranslationInc = iNewTranslationInc;
    pSCI->fCurrentZRotationInc    = fNewRotationInc;
  }

  else if (pSCI->rcCubeBoundary.right > WindowRect.right)
  {
    pSCI->iCurrentXTranslationInc = -iNewTranslationInc;
    pSCI->fCurrentZRotationInc    = -fNewRotationInc;
  }

  if (pSCI->rcCubeBoundary.top < WindowRect.top)
   {
    pSCI->iCurrentYTranslationInc = iNewTranslationInc;
    pSCI->fCurrentXRotationInc    = fNewRotationInc;
  }

  else if (pSCI->rcCubeBoundary.bottom > WindowRect.bottom)
  {
    pSCI->iCurrentYTranslationInc = -iNewTranslationInc;
    pSCI->fCurrentXRotationInc    = -fNewRotationInc;
  }

  if (pSCI->iCurrentZTranslation < (int) lScaleFactor<<1)
  {
    pSCI->iCurrentZTranslationInc = iNewTranslationInc;
    pSCI->fCurrentYRotationInc    = fNewRotationInc;
  }

  else if (pSCI->iCurrentZTranslation > (iWindowDepth - (int) lScaleFactor))
  {
    pSCI->iCurrentZTranslationInc = -iNewTranslationInc;
    pSCI->fCurrentYRotationInc    = -fNewRotationInc;
  }

  //
  // Now a kludgy scale based on depth (iCurrentZTranslation) of the center
  //   point of the polyhedron
  //

  fDepthScale =  ((float) iWindowDepth) /
                 ((float) (iWindowDepth + pSCI->iCurrentZTranslation));

  pSCI->rcCubeBoundary.left  = (LONG)(fDepthScale* pSCI->rcCubeBoundary.left  );
  pSCI->rcCubeBoundary.right = (LONG)(fDepthScale* pSCI->rcCubeBoundary.right );
  pSCI->rcCubeBoundary.top   = (LONG)(fDepthScale* pSCI->rcCubeBoundary.top   );
  pSCI->rcCubeBoundary.bottom= (LONG)(fDepthScale* pSCI->rcCubeBoundary.bottom);

  for (i = 0; i < NUMVERTICES; i++)
  {
    gXformedVertices[i].x = (LONG) (fDepthScale * gXformedVertices[i].x);
    gXformedVertices[i].y = (LONG) (fDepthScale * gXformedVertices[i].y);
  }

  //
  // If currently in motion then increment the current rotation & tranlation
  //

  if (IN_MOTION(hwnd))
  {
    pSCI->fCurrentXRotation += pSCI->fCurrentXRotationInc;
    pSCI->fCurrentYRotation += pSCI->fCurrentYRotationInc;
    pSCI->fCurrentZRotation += pSCI->fCurrentZRotationInc;

    pSCI->iCurrentXTranslation += pSCI->iCurrentXTranslationInc;
    pSCI->iCurrentYTranslation += pSCI->iCurrentYTranslationInc;
    pSCI->iCurrentZTranslation += pSCI->iCurrentZTranslationInc;
  }

  //
  // Up to this point all coordinates are relative to a window whose
  //   center is at (0,0). Now we'll translate appropriately...
  //

  pSCI->rcCubeBoundary.left   += pWindowRect->right  >> 1;
  pSCI->rcCubeBoundary.right  += pWindowRect->right  >> 1;
  pSCI->rcCubeBoundary.top    += pWindowRect->bottom >> 1;
  pSCI->rcCubeBoundary.bottom += pWindowRect->bottom >> 1;

  for (i = 0; i < NUMVERTICES; i++)
  {
    gXformedVertices[i].x += pWindowRect->right  >> 1;
    gXformedVertices[i].y += pWindowRect->bottom >> 1;
  }

  //
  // Since FillRect's are inclusive-exclusive (there'll be leftovers
  //   from the last cube we drew otherwise)...
  //

  pSCI->rcCubeBoundary.right++;
  pSCI->rcCubeBoundary.bottom++;

  //
  // Finally, adjust the rcCubeBoundary such that it fits entirely within
  //   the acutal control window. The reason for this is that when calling
  //   InvalidateRect from SpincubeWndProc\case_WM_TIMER we may get
  //   a different PAINSTRUCT.rcPaint (since InvalidateRect clips the passed
  //   in rect to the window bounds) and our abouve test to memcmp() will
  //   fail.
  //

  if (pSCI->rcCubeBoundary.left < 0)

    pSCI->rcCubeBoundary.left = 0;

  if (pSCI->rcCubeBoundary.top < 0)

    pSCI->rcCubeBoundary.top = 0;

  if (pSCI->rcCubeBoundary.right > pWindowRect->right)

    pSCI->rcCubeBoundary.right = pWindowRect->right;

  if (pSCI->rcCubeBoundary.bottom > pWindowRect->bottom)

    pSCI->rcCubeBoundary.bottom = pWindowRect->bottom;
}

Variable Documentation

float gM[2][3]

Definition at line 62 of file Paint.h.

POINT3D gXformedVertices[NUMVERTICES]

Definition at line 60 of file Paint.h.

Generated on Wed Nov 13 2024 16:53:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/SpinCube.c File Reference

  • WinUI
  • Controls
  • Custom
  • SpinCube
Functions | Variables

SpinCube.c File Reference

#include <windows.h>
#include <stdlib.h>
#include "spincube.h"

Go to the source code of this file.

Functions

BOOL WINAPI | _CRT_INIT (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
UINT CALLBACK | CustomControlInfo (LPCCINFO acci)
BOOL WINAPI | DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
LPTSTR | GetStringRes (int)
void | Paint (HWND)
LRESULT CALLBACK | SpincubeDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
INT CALLBACK | SpincubeSizeToText (DWORD flStyle, DWORD flExtStyle, HFONT hFont, LPTSTR pszText)
BOOL CALLBACK | SpincubeStyle (HWND hWndParent, LPCCSTYLE pccs)
LRESULT CALLBACK | SpincubeWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

Variables

CCSTYLEFLAG | aSpincubeStyleFlags []
HANDLE ghMod
int | giNumSpincubesAllProcesses = 0
int | giNumSpincubesThisProcess = 0
LPCCSTYLE | gpccs

Function Documentation

BOOL WINAPI _CRT_INIT | ( | HINSTANCE | hDLL,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |
UINT CALLBACK CustomControlInfo ( LPCCINFO acci )

Definition at line 217 of file SpinCube.c.

{
  //
  // Dlgedit is querying the number of controls this DLL supports, so return 1.
  //   Then we'll get called again with a valid "acci"
  //

  if (!acci)

    return 1;

  //
  // Fill in the constant calues.
  //

  acci[0].flOptions         = 0;
  acci[0].cxDefault         = 40;      // default width  (dialog units)
  acci[0].cyDefault         = 40;      // default height (dialog units)
  acci[0].flStyleDefault    = WS_CHILD |
                              WS_VISIBLE |
                              SS_INMOTION;
  acci[0].flExtStyleDefault = 0;
  acci[0].flCtrlTypeMask    = 0;
  acci[0].cStyleFlags       = NUM_SPINCUBE_STYLES;
  acci[0].aStyleFlags       = aSpincubeStyleFlags;
  acci[0].lpfnStyle         = SpincubeStyle;
  acci[0].lpfnSizeToText    = SpincubeSizeToText;
  acci[0].dwReserved1       = 0;
  acci[0].dwReserved2       = 0;

  //
  // Copy the strings
  //
  // NOTE: MAKE SURE THE STRINGS COPIED DO NOT EXCEED THE LENGTH OF
  //       THE BUFFERS IN THE CCINFO STRUCTURE!
  //

  lstrcpyn (acci[0].szClass, SPINCUBECLASS, ARRAYSIZE(acci[0].szClass));
  lstrcpyn (acci[0].szDesc,  SPINCUBEDESCRIPTION, ARRAYSIZE(acci[0].szDesc));
  lstrcpyn (acci[0].szTextDefault, SPINCUBEDEFAULTTEXT, ARRAYSIZE(acci[0].szTextDefault));

  //
  // Return the number of controls that the DLL supports
  //

  return 1;
}

BOOL WINAPI DllMain | ( | HINSTANCE | hDLL,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 132 of file SpinCube.c.

{
  ghMod = hDLL;
  switch (dwReason)
  {
    case DLL_PROCESS_ATTACH:
    {
      WNDCLASS wc;

      if (!_CRT_INIT (hDLL, dwReason, lpReserved))

        return FALSE;

      wc.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC |
                         CS_GLOBALCLASS ;
      wc.lpfnWndProc   = (WNDPROC) SpincubeWndProc;
      wc.cbClsExtra    = 0;
      wc.cbWndExtra    = SPINCUBE_EXTRA;
      wc.hInstance     = hDLL;
      wc.hIcon         = NULL;
      wc.hCursor       = LoadCursor (NULL, IDC_ARROW);
      wc.hbrBackground = NULL;
      wc.lpszMenuName  = (LPTSTR) NULL;
      wc.lpszClassName = (LPTSTR) SPINCUBECLASS;

      if (!RegisterClass (&wc))
      {
        MessageBox (NULL,
                    GetStringRes (IDS_REGCLASSFAIL),
                    (LPCTSTR) TEXT("SPINCUBE.DLL"),
                    MB_OK | MB_ICONEXCLAMATION);

        return FALSE;
      }

      break;
    }

    case DLL_PROCESS_DETACH:
    {

      if (!_CRT_INIT (hDLL, dwReason, lpReserved))

        return FALSE;

      if (!UnregisterClass ((LPTSTR) SPINCUBECLASS, hDLL ))
      {
        MessageBox (NULL,
                    GetStringRes (IDS_UNREGFAIL),
                    (LPCTSTR) TEXT("SPINCUBE.DLL"),
                    MB_OK | MB_ICONEXCLAMATION);

        return FALSE;
      }

      break;
    }

    default:

      if (!_CRT_INIT (hDLL, dwReason, lpReserved))

        return FALSE;

      break;
  }
  return TRUE;
}

LPTSTR GetStringRes ( int id )

Definition at line 706 of file SpinCube.c.

{
  static TCHAR szBuffer[MAX_PATH];

  szBuffer[0]=0;
  LoadString (GetModuleHandle (NULL), id, szBuffer, MAX_PATH);
  return szBuffer;
}

void Paint ( HWND )

Definition at line 96 of file Paint.c.

{
  PSPINCUBEINFO  pSCI;
  RECT           rect;
  int            i;
  LONG           lScaleFactor;
  PAINTSTRUCT    ps;
  HRGN           hrgnClip;
  HBRUSH         hBrush, hBrushSave;
  int            iX, iY, iCX, iCY;
  int            facetIndex, numPoints;
  POINT          polygn[MAX_POINTS_PER_FACET];
  POINT          vector1, vector2;
  COLORREF       acrColor[6] = { 0x0000ff, 0x00ff00, 0xff0000,
                                 0x00ffff, 0xff00ff, 0xffff00 };

  pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd, GWL_SPINCUBEDATA);

  BeginPaint (hwnd, &ps);

  if (memcmp((void *)&ps.rcPaint, (void *)&pSCI->rcCubeBoundary, sizeof(RECT))
      & !REPAINT_BKGND(pSCI))

  {
    //
    // We're not here because it's time to animate (i.e. this paint isn't
    //   the result of a WM_TIMER), so just do the Blt & blow out of here...
    //

    BitBlt (ps.hdc,
            ps.rcPaint.left,
            ps.rcPaint.top,
            ps.rcPaint.right - ps.rcPaint.left,
            ps.rcPaint.bottom - ps.rcPaint.top,
            pSCI->hdcCompat, ps.rcPaint.left,
            ps.rcPaint.top, SRCCOPY);

    EndPaint (hwnd, &ps);
    return;
  }

  //
  // The rectangle we get back is in Desktop coordinates, so we need to
  //   modify it to reflect coordinates relative to this window.
  //

  GetWindowRect (hwnd, &rect);

  rect.right  -= rect.left;
  rect.bottom -= rect.top;
  rect.left = rect.top = 0;

  //
  // Determine a "best fit" scale factor for our polyhedron
  //

  if (!(lScaleFactor = rect.right > rect.bottom ?
                       rect.bottom/12 : rect.right/12))

    lScaleFactor = 1;

  TransformVertices (hwnd, &rect, pSCI, lScaleFactor);

  //
  // Draw the window frame & background
  //
  // Note: The chances are that we are coming through here because we
  //   got a WM_TIMER message & it's time to redraw the cube to simulate
  //   animation. In that case all we want to erase/redraw is that small
  //   rectangle which bounded the polyhedron the last time. The less
  //   drawing that actually gets done the better, since we wnat to
  //   minimize the flicker on the screen. __BeginPaint__ is perfect for
  //   this because it causes all drawing outside of the invalid region
  //   to be "clipped" (no drawing is performed outside of the invalid
  //   region), and it also validates the invalid region.
  //

  if (DO_ERASE(hwnd) || REPAINT_BKGND(pSCI))
  {
    hrgnClip = CreateRectRgnIndirect (&ps.rcPaint);
    SelectClipRgn (pSCI->hdcCompat, hrgnClip);
    DeleteObject (hrgnClip);

    SelectObject (pSCI->hdcCompat, GetStockObject (GRAY_BRUSH));
    Rectangle    (pSCI->hdcCompat, (int)rect.left, (int)rect.top,
                  (int)rect.right, (int)rect.bottom);

    iX = (rect.right  - rect.left) / 4;
    iY = (rect.bottom - rect.top ) / 4;

    MoveToEx (pSCI->hdcCompat, (int)rect.left, (int)rect.top, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.left + iX, (int)rect.top + iY);
    LineTo   (pSCI->hdcCompat, (int)rect.left + iX, (int)rect.bottom - iY);
    LineTo   (pSCI->hdcCompat, (int)rect.left,      (int)rect.bottom);

    MoveToEx (pSCI->hdcCompat, (int)rect.right, (int)rect.top, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.top + iY);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.bottom- iY);
    LineTo   (pSCI->hdcCompat, (int)rect.right,      (int)rect.bottom);

    MoveToEx (pSCI->hdcCompat, (int)rect.left + iX,  (int)rect.top + iY, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.top + iY);

    MoveToEx (pSCI->hdcCompat, (int)rect.left + iX,  (int)rect.bottom - iY, NULL);
    LineTo   (pSCI->hdcCompat, (int)rect.right - iX, (int)rect.bottom - iY);

    SelectClipRgn (pSCI->hdcCompat, NULL);

    pSCI->iOptions &= ~SPINCUBE_REPAINT_BKGND;
  }

  //
  // Draw the polyhedron. We'll walk through the facets list and compute
  //   the normal for each facet- if the normal has z > 0, then the facet
  //   faces us and we'll draw it. Note that this algorithim is ONLY valid
  //   for scenes with a single, convex polyhedron.
  //
  // Note: Use GetDC here because the above call to BeginPaint will
  //   probably not give us a DC with access to as much real estate as
  //   we'd like (we wouldn't be able to draw outside of the invalid
  //   region). We can party on the entire control window with the DC
  //   returned by GetDC.
  //

  for (i = 0, facetIndex = 0; i < NUMFACETS; i++)
  {
    vector1.x = gXformedVertices[gaiFacets[facetIndex + 1]].x -
                gXformedVertices[gaiFacets[facetIndex]].x;
    vector1.y = gXformedVertices[gaiFacets[facetIndex + 1]].y -
                gXformedVertices[gaiFacets[facetIndex]].y;
    vector2.x = gXformedVertices[gaiFacets[facetIndex + 2]].x -
                gXformedVertices[gaiFacets[facetIndex + 1]].x;
    vector2.y = gXformedVertices[gaiFacets[facetIndex + 2]].y -
                gXformedVertices[gaiFacets[facetIndex + 1]].y;

    for (numPoints = 0; gaiFacets[facetIndex] != -1; numPoints++, facetIndex++)
    {
      polygn[numPoints].x = gXformedVertices[gaiFacets[facetIndex]].x;
      polygn[numPoints].y = gXformedVertices[gaiFacets[facetIndex]].y;
    }

    facetIndex++; /* skip over the -1's in the facets list */
    if ((vector1.x*vector2.y - vector1.y*vector2.x) > 0)
    {
      hBrush     = CreateSolidBrush (acrColor[i]);
      hBrushSave = (HBRUSH) SelectObject (pSCI->hdcCompat, hBrush);

      Polygon (pSCI->hdcCompat, &polygn[0], numPoints);

      SelectObject (pSCI->hdcCompat, hBrushSave);
      DeleteObject (hBrush);
    }
  }

  iX  = pSCI->rcCubeBoundary.left < ps.rcPaint.left ?
        pSCI->rcCubeBoundary.left : ps.rcPaint.left;
  iY  = pSCI->rcCubeBoundary.top  < ps.rcPaint.top  ?
        pSCI->rcCubeBoundary.top  : ps.rcPaint.top;

  iCX = (pSCI->rcCubeBoundary.right > ps.rcPaint.right ?
         pSCI->rcCubeBoundary.right : ps.rcPaint.right) - iX;

  iCY = (pSCI->rcCubeBoundary.bottom > ps.rcPaint.bottom ?
         pSCI->rcCubeBoundary.bottom : ps.rcPaint.bottom) - iY;

  EndPaint (hwnd, &ps);

  ps.hdc = GetDC (hwnd);

  BitBlt (ps.hdc, iX, iY, iCX, iCY, pSCI->hdcCompat, iX, iY, SRCCOPY);

  ReleaseDC (hwnd, ps.hdc);

}

LRESULT CALLBACK SpincubeDlgProc | ( | HWND | hDlg,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 636 of file SpinCube.c.

{
  switch (msg)
  {
    case WM_INITDIALOG :
    {
      if (gpccs->flStyle & SS_ERASE)

        CheckDlgButton (hDlg, DID_ERASE, 1);

      if (gpccs->flStyle & SS_INMOTION)

        CheckDlgButton (hDlg, DID_INMOTION, 1);

      break;
    }

    case WM_COMMAND:

      switch (LOWORD(wParam))
      {
        case DID_ERASE:

          if (IsDlgButtonChecked (hDlg, DID_ERASE))

            gpccs->flStyle |= SS_ERASE;

          else

            gpccs->flStyle &= ~SS_ERASE;

          break;

        case DID_INMOTION:

          if (IsDlgButtonChecked (hDlg, DID_INMOTION))

            gpccs->flStyle |= SS_INMOTION;

          else

            gpccs->flStyle &= ~SS_INMOTION;

          break;

        case DID_OK:

          EndDialog  (hDlg, 1);
          break;
      }
      break;
  }
  return FALSE;
}

INT CALLBACK SpincubeSizeToText | ( | DWORD | flStyle,
 |  | DWORD | flExtStyle,
 |  | HFONT | hFont,
 |  | LPTSTR | pszText
 | ) |  |

Definition at line 319 of file SpinCube.c.

{
  return -1;
}

BOOL CALLBACK SpincubeStyle | ( | HWND | hWndParent,
 |  | LPCCSTYLE | pccs
 | ) |  |

Definition at line 282 of file SpinCube.c.

{
  gpccs = pccs;

  if (DialogBox (ghMod, TEXT("SpincubeStyle"), hWndParent,
                       (DLGPROC)SpincubeDlgProc) == -1)
  {
    MessageBox (hWndParent,
                GetStringRes (IDS_DLGBOXFAIL),
                (LPCTSTR) TEXT("Spincube.dll"),
                MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);

    return FALSE;
  }

  return TRUE;
}

LRESULT CALLBACK SpincubeWndProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 343 of file SpinCube.c.

{
  switch (msg)
  {
    case WM_CREATE:
    {
      //
      // Alloc & init a SPINCUBEINFO struct for this particular control
      //

      HDC            hdc;
      LPCREATESTRUCT lpcs = (LPCREATESTRUCT) lParam;
      PSPINCUBEINFO  pSCI = (PSPINCUBEINFO) LocalAlloc (LPTR,
                                                        sizeof(SPINCUBEINFO));
      if (!pSCI)
      {
        MessageBox (NULL,
                    GetStringRes (IDS_ALLOCFAIL),
                    (LPCTSTR) TEXT("SPINCUBE.DLL"),
                    MB_OK | MB_ICONEXCLAMATION);
        return -1;
      }

      //
      // Alloc the compatible DC for this control.
      //

      hdc = GetDC (hwnd);

      if ((pSCI->hdcCompat = CreateCompatibleDC (hdc)) == NULL)
      {
        MessageBox (NULL,
                    GetStringRes (IDS_CREATEDCFAIL),
                    (LPCTSTR) TEXT("SPINCUBE.DLL"),
                    MB_OK | MB_ICONEXCLAMATION);
        return -1;
      }

      ReleaseDC (hwnd, hdc);

      //
      // Initialize this instance structure
      //

      pSCI->fCurrentXRotation =
      pSCI->fCurrentYRotation =
      pSCI->fCurrentZRotation = (float) 0.0;

      pSCI->fCurrentXRotationInc =
      pSCI->fCurrentYRotationInc =
      pSCI->fCurrentZRotationInc = (float) 0.2617; // a random # (15 degrees)

      pSCI->iCurrentXTranslation =
      pSCI->iCurrentYTranslation =
      pSCI->iCurrentZTranslation = 0;

      //
      // All these calculations so the cubes start out with random movements.
      //

      if ((pSCI->iCurrentXTranslationInc = (rand() % 10) + 2) > 7)

        pSCI->iCurrentXTranslationInc = -pSCI->iCurrentXTranslationInc;

      if ((pSCI->iCurrentYTranslationInc = (rand() % 10) + 2) <= 7)

        pSCI->iCurrentYTranslationInc = -pSCI->iCurrentYTranslationInc;

      if ((pSCI->iCurrentZTranslationInc = (rand() % 10) + 2) > 7)

        pSCI->iCurrentZTranslationInc = -pSCI->iCurrentZTranslationInc;

      pSCI->rcCubeBoundary.left   =
      pSCI->rcCubeBoundary.top    = 0;
      pSCI->rcCubeBoundary.right  = lpcs->cx;
      pSCI->rcCubeBoundary.bottom = lpcs->cy;

      pSCI->iOptions  = SPINCUBE_REPAINT_BKGND;
      pSCI->hbmCompat = NULL;

      SetWindowLongPtr (hwnd, GWL_SPINCUBEDATA, (LONG_PTR) pSCI);

      SetTimer (hwnd, SPIN_EVENT, SPIN_INTERVAL, NULL);

      //
      // Increment the count vars
      //

      giNumSpincubesThisProcess++;
      giNumSpincubesAllProcesses++;

      break;
    }

    case WM_PAINT:

      Paint (hwnd);
      break;

    case WM_TIMER:

      switch (wParam)
      {
        case SPIN_EVENT:
        {
          PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                              GWL_SPINCUBEDATA);

          InvalidateRect (hwnd, &pSCI->rcCubeBoundary, FALSE);

          break;
        }
      }

      break;

    case WM_LBUTTONDBLCLK:
    {
      //
      // Toggle the erase state of the control
      //

      if (DO_ERASE(hwnd))

        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) & ~SS_ERASE);

      else
      {
        //
        // Repaint the entire control to get rid of the (cube trails) mess
        //

        PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                            GWL_SPINCUBEDATA);

        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) | SS_ERASE);
        pSCI->iOptions |= SPINCUBE_REPAINT_BKGND;
        InvalidateRect (hwnd, NULL, FALSE);
        SendMessage (hwnd, WM_PAINT, 0, 0);
      }
      break;
    }

    case WM_RBUTTONDBLCLK:
    {
      //
      // Toggle the motion state of the control
      //

      if (IN_MOTION(hwnd))
      {
        KillTimer (hwnd, SPIN_EVENT);
        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) & ~SS_INMOTION);
      }
      else
      {
        SetTimer (hwnd, SPIN_EVENT, SPIN_INTERVAL, NULL);
        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) | SS_INMOTION);
      }

      break;
    }

    case WM_SIZE:

      if (wParam == SIZE_MAXIMIZED || wParam == SIZE_RESTORED)
      {
        PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                            GWL_SPINCUBEDATA);
        //
        // Get a new bitmap which is the new size of our window
        //

        HDC hdc = GetDC (hwnd);
        HBITMAP hbmTemp = CreateCompatibleBitmap (hdc,
                                                  (int) LOWORD (lParam),
                                                  (int) HIWORD (lParam));
        if (!hbmTemp)
        {
          //
          // Scream, yell, & committ an untimely demise...
          //

          MessageBox (NULL,
                      GetStringRes (IDS_CREATEBITMAPFAIL),
                      (LPCTSTR) TEXT("SPINCUBE.DLL"),
                      MB_OK | MB_ICONEXCLAMATION);
          DestroyWindow (hwnd);
        }

        pSCI->hbmSave = SelectObject (pSCI->hdcCompat, hbmTemp);
        if (pSCI->hbmCompat)
          DeleteObject (pSCI->hbmCompat);
        ReleaseDC    (hwnd, hdc);
        pSCI->hbmCompat = hbmTemp;

        //
        // Reset the translation so the cube doesn't go spinning off into
        //   space somewhere- we'd never see it again!
        //

        pSCI->iCurrentXTranslation =
        pSCI->iCurrentYTranslation =
        pSCI->iCurrentZTranslation = 0;

        //
        // All these calculations so the cube starts out with random movements,
        //

        if ((pSCI->iCurrentXTranslationInc = (rand() % 10) + 2) > 7)

          pSCI->iCurrentXTranslationInc = -pSCI->iCurrentXTranslationInc;

        if ((pSCI->iCurrentYTranslationInc = (rand() % 10) + 2) <= 7)

          pSCI->iCurrentYTranslationInc = -pSCI->iCurrentYTranslationInc;

        if ((pSCI->iCurrentZTranslationInc = (rand() % 10) + 2) > 7)

          pSCI->iCurrentZTranslationInc = -pSCI->iCurrentZTranslationInc;

        pSCI->rcCubeBoundary.left   =
        pSCI->rcCubeBoundary.top    = 0;
        pSCI->rcCubeBoundary.right  = (int) LOWORD (lParam);
        pSCI->rcCubeBoundary.bottom = (int) HIWORD (lParam);

        pSCI->iOptions |= SPINCUBE_REPAINT_BKGND;

        InvalidateRect (hwnd, NULL, FALSE);
      }

      break;

    case WM_DESTROY:
    {
      PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                          GWL_SPINCUBEDATA);
      //
      // Clean up all the resources used for this control
      //

      if (IN_MOTION(hwnd))

        KillTimer (hwnd, SPIN_EVENT);

      SelectObject (pSCI->hdcCompat, pSCI->hbmSave);
      DeleteObject (pSCI->hbmCompat);
      DeleteDC     (pSCI->hdcCompat);

      LocalFree (LocalHandle ((LPVOID) pSCI));

      //
      // Decrement the global count vars
      //

      giNumSpincubesThisProcess--;
      giNumSpincubesAllProcesses--;

      break;
    }

    default:

      return (DefWindowProc(hwnd, msg, wParam, lParam));
  }

  return ((LONG) TRUE);
}

Variable Documentation

CCSTYLEFLAG aSpincubeStyleFlags[]
Initial value:
 { { SS_ERASE,    0, TEXT("SS_ERASE")    },
                                      { SS_INMOTION, 0, TEXT("SS_INMOTION") } }

Definition at line 92 of file SpinCube.c.

HANDLE ghMod

Definition at line 89 of file SpinCube.c.

int giNumSpincubesAllProcesses = 0

Definition at line 80 of file SpinCube.c.

int giNumSpincubesThisProcess = 0

Definition at line 76 of file SpinCube.c.

LPCCSTYLE gpccs

Definition at line 90 of file SpinCube.c.

Generated on Wed Nov 13 2024 16:55:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/SpinCube.h File Reference

  • WinUI
  • Controls
  • Custom
  • SpinCube
Classes | Defines | Typedefs | Functions

SpinCube.h File Reference

#include <custcntl.h>

Go to the source code of this file.

Classes

struct | SPINCUBEINFO

Defines

#define | ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
#define | CCHSTYLE 20
#define | DID_ERASE 101
#define | DID_INMOTION 102
#define | DID_OK 103
#define | DO_ERASE(hwnd)
#define | GWL_SPINCUBEDATA 0
#define | IDS_ALLOCFAIL 19
#define | IDS_CREATEBITMAPFAIL 21
#define | IDS_CREATEDCFAIL 20
#define | IDS_DLGBOXFAIL 18
#define | IDS_REGCLASSFAIL 16
#define | IDS_UNREGFAIL 17
#define | IN_MOTION(hwnd)
#define | NUM_SPINCUBE_STYLES 2
#define | REPAINT_BKGND(pSCI)
#define | SPIN_EVENT 1
#define | SPIN_INTERVAL 75
#define | SPINCUBE_EXTRA 4
#define | SPINCUBE_REPAINT_BKGND 0x00000001
#define | SPINCUBECLASS TEXT("Spincube")
#define | SPINCUBEDEFAULTTEXT TEXT(":-)")
#define | SPINCUBEDESCRIPTION TEXT("An animated control")
#define | SS_ERASE 0x0001
#define | SS_INMOTION 0x0002

Typedefs

typedef struct SPINCUBEINFO * | PSPINCUBEINFO

Functions

LRESULT CALLBACK | SpincubeDlgProc (HWND, UINT, WPARAM, LPARAM)
INT CALLBACK | SpincubeSizeToText (DWORD, DWORD, HFONT, LPTSTR)
BOOL CALLBACK | SpincubeStyle (HWND, LPCCSTYLE)
LRESULT CALLBACK | SpincubeWndProc (HWND, UINT, WPARAM, LPARAM)

Define Documentation

#define ARRAYSIZE ( x ) (sizeof(x)/sizeof(x[0]))

Definition at line 71 of file SpinCube.h.

#define CCHSTYLE 20

Definition at line 19 of file SpinCube.h.

#define DID_ERASE 101

Definition at line 47 of file SpinCube.h.

#define DID_INMOTION 102

Definition at line 48 of file SpinCube.h.

#define DID_OK 103

Definition at line 49 of file SpinCube.h.

#define DO_ERASE ( hwnd )
Value:
GetWindowLongPtr(hwnd,GWL_STYLE) & SS_ERASE \
                                           ? TRUE : FALSE

Definition at line 55 of file SpinCube.h.

#define GWL_SPINCUBEDATA 0

Definition at line 51 of file SpinCube.h.

#define IDS_ALLOCFAIL 19

Definition at line 67 of file SpinCube.h.

#define IDS_CREATEBITMAPFAIL 21

Definition at line 69 of file SpinCube.h.

#define IDS_CREATEDCFAIL 20

Definition at line 68 of file SpinCube.h.

#define IDS_DLGBOXFAIL 18

Definition at line 66 of file SpinCube.h.

#define IDS_REGCLASSFAIL 16

Definition at line 64 of file SpinCube.h.

#define IDS_UNREGFAIL 17

Definition at line 65 of file SpinCube.h.

#define IN_MOTION ( hwnd )
Value:
GetWindowLongPtr(hwnd,GWL_STYLE) & SS_INMOTION \
                                           ? TRUE : FALSE

Definition at line 58 of file SpinCube.h.

#define NUM_SPINCUBE_STYLES 2

Definition at line 21 of file SpinCube.h.

#define REPAINT_BKGND ( pSCI )
Value:
pSCI->iOptions&SPINCUBE_REPAINT_BKGND \
                                           ? TRUE : FALSE

Definition at line 61 of file SpinCube.h.

#define SPIN_EVENT 1

Definition at line 29 of file SpinCube.h.

#define SPIN_INTERVAL 75

Definition at line 39 of file SpinCube.h.

#define SPINCUBE_EXTRA 4

Definition at line 27 of file SpinCube.h.

#define SPINCUBE_REPAINT_BKGND 0x00000001

Definition at line 53 of file SpinCube.h.

#define SPINCUBECLASS TEXT("Spincube")

Definition at line 15 of file SpinCube.h.

#define SPINCUBEDEFAULTTEXT TEXT(":-)")

Definition at line 17 of file SpinCube.h.

#define SPINCUBEDESCRIPTION TEXT("An animated control")

Definition at line 16 of file SpinCube.h.

#define SS_ERASE 0x0001

Definition at line 23 of file SpinCube.h.

#define SS_INMOTION 0x0002

Definition at line 24 of file SpinCube.h.

Typedef Documentation

typedef struct SPINCUBEINFO * PSPINCUBEINFO

Function Documentation

LRESULT CALLBACK SpincubeDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 636 of file SpinCube.c.

{
  switch (msg)
  {
    case WM_INITDIALOG :
    {
      if (gpccs->flStyle & SS_ERASE)

        CheckDlgButton (hDlg, DID_ERASE, 1);

      if (gpccs->flStyle & SS_INMOTION)

        CheckDlgButton (hDlg, DID_INMOTION, 1);

      break;
    }

    case WM_COMMAND:

      switch (LOWORD(wParam))
      {
        case DID_ERASE:

          if (IsDlgButtonChecked (hDlg, DID_ERASE))

            gpccs->flStyle |= SS_ERASE;

          else

            gpccs->flStyle &= ~SS_ERASE;

          break;

        case DID_INMOTION:

          if (IsDlgButtonChecked (hDlg, DID_INMOTION))

            gpccs->flStyle |= SS_INMOTION;

          else

            gpccs->flStyle &= ~SS_INMOTION;

          break;

        case DID_OK:

          EndDialog  (hDlg, 1);
          break;
      }
      break;
  }
  return FALSE;
}

INT CALLBACK SpincubeSizeToText | ( | DWORD | ,
 |  | DWORD | ,
 |  | HFONT | ,
 |  | LPTSTR |
 | ) |  |

Definition at line 319 of file SpinCube.c.

{
  return -1;
}

BOOL CALLBACK SpincubeStyle | ( | HWND | ,
 |  | LPCCSTYLE |
 | ) |  |

Definition at line 282 of file SpinCube.c.

{
  gpccs = pccs;

  if (DialogBox (ghMod, TEXT("SpincubeStyle"), hWndParent,
                       (DLGPROC)SpincubeDlgProc) == -1)
  {
    MessageBox (hWndParent,
                GetStringRes (IDS_DLGBOXFAIL),
                (LPCTSTR) TEXT("Spincube.dll"),
                MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);

    return FALSE;
  }

  return TRUE;
}

LRESULT CALLBACK SpincubeWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 343 of file SpinCube.c.

{
  switch (msg)
  {
    case WM_CREATE:
    {
      //
      // Alloc & init a SPINCUBEINFO struct for this particular control
      //

      HDC            hdc;
      LPCREATESTRUCT lpcs = (LPCREATESTRUCT) lParam;
      PSPINCUBEINFO  pSCI = (PSPINCUBEINFO) LocalAlloc (LPTR,
                                                        sizeof(SPINCUBEINFO));
      if (!pSCI)
      {
        MessageBox (NULL,
                    GetStringRes (IDS_ALLOCFAIL),
                    (LPCTSTR) TEXT("SPINCUBE.DLL"),
                    MB_OK | MB_ICONEXCLAMATION);
        return -1;
      }

      //
      // Alloc the compatible DC for this control.
      //

      hdc = GetDC (hwnd);

      if ((pSCI->hdcCompat = CreateCompatibleDC (hdc)) == NULL)
      {
        MessageBox (NULL,
                    GetStringRes (IDS_CREATEDCFAIL),
                    (LPCTSTR) TEXT("SPINCUBE.DLL"),
                    MB_OK | MB_ICONEXCLAMATION);
        return -1;
      }

      ReleaseDC (hwnd, hdc);

      //
      // Initialize this instance structure
      //

      pSCI->fCurrentXRotation =
      pSCI->fCurrentYRotation =
      pSCI->fCurrentZRotation = (float) 0.0;

      pSCI->fCurrentXRotationInc =
      pSCI->fCurrentYRotationInc =
      pSCI->fCurrentZRotationInc = (float) 0.2617; // a random # (15 degrees)

      pSCI->iCurrentXTranslation =
      pSCI->iCurrentYTranslation =
      pSCI->iCurrentZTranslation = 0;

      //
      // All these calculations so the cubes start out with random movements.
      //

      if ((pSCI->iCurrentXTranslationInc = (rand() % 10) + 2) > 7)

        pSCI->iCurrentXTranslationInc = -pSCI->iCurrentXTranslationInc;

      if ((pSCI->iCurrentYTranslationInc = (rand() % 10) + 2) <= 7)

        pSCI->iCurrentYTranslationInc = -pSCI->iCurrentYTranslationInc;

      if ((pSCI->iCurrentZTranslationInc = (rand() % 10) + 2) > 7)

        pSCI->iCurrentZTranslationInc = -pSCI->iCurrentZTranslationInc;

      pSCI->rcCubeBoundary.left   =
      pSCI->rcCubeBoundary.top    = 0;
      pSCI->rcCubeBoundary.right  = lpcs->cx;
      pSCI->rcCubeBoundary.bottom = lpcs->cy;

      pSCI->iOptions  = SPINCUBE_REPAINT_BKGND;
      pSCI->hbmCompat = NULL;

      SetWindowLongPtr (hwnd, GWL_SPINCUBEDATA, (LONG_PTR) pSCI);

      SetTimer (hwnd, SPIN_EVENT, SPIN_INTERVAL, NULL);

      //
      // Increment the count vars
      //

      giNumSpincubesThisProcess++;
      giNumSpincubesAllProcesses++;

      break;
    }

    case WM_PAINT:

      Paint (hwnd);
      break;

    case WM_TIMER:

      switch (wParam)
      {
        case SPIN_EVENT:
        {
          PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                              GWL_SPINCUBEDATA);

          InvalidateRect (hwnd, &pSCI->rcCubeBoundary, FALSE);

          break;
        }
      }

      break;

    case WM_LBUTTONDBLCLK:
    {
      //
      // Toggle the erase state of the control
      //

      if (DO_ERASE(hwnd))

        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) & ~SS_ERASE);

      else
      {
        //
        // Repaint the entire control to get rid of the (cube trails) mess
        //

        PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                            GWL_SPINCUBEDATA);

        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) | SS_ERASE);
        pSCI->iOptions |= SPINCUBE_REPAINT_BKGND;
        InvalidateRect (hwnd, NULL, FALSE);
        SendMessage (hwnd, WM_PAINT, 0, 0);
      }
      break;
    }

    case WM_RBUTTONDBLCLK:
    {
      //
      // Toggle the motion state of the control
      //

      if (IN_MOTION(hwnd))
      {
        KillTimer (hwnd, SPIN_EVENT);
        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) & ~SS_INMOTION);
      }
      else
      {
        SetTimer (hwnd, SPIN_EVENT, SPIN_INTERVAL, NULL);
        SetWindowLongPtr (hwnd, GWL_STYLE,
                       GetWindowLongPtr (hwnd, GWL_STYLE) | SS_INMOTION);
      }

      break;
    }

    case WM_SIZE:

      if (wParam == SIZE_MAXIMIZED || wParam == SIZE_RESTORED)
      {
        PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                            GWL_SPINCUBEDATA);
        //
        // Get a new bitmap which is the new size of our window
        //

        HDC hdc = GetDC (hwnd);
        HBITMAP hbmTemp = CreateCompatibleBitmap (hdc,
                                                  (int) LOWORD (lParam),
                                                  (int) HIWORD (lParam));
        if (!hbmTemp)
        {
          //
          // Scream, yell, & committ an untimely demise...
          //

          MessageBox (NULL,
                      GetStringRes (IDS_CREATEBITMAPFAIL),
                      (LPCTSTR) TEXT("SPINCUBE.DLL"),
                      MB_OK | MB_ICONEXCLAMATION);
          DestroyWindow (hwnd);
        }

        pSCI->hbmSave = SelectObject (pSCI->hdcCompat, hbmTemp);
        if (pSCI->hbmCompat)
          DeleteObject (pSCI->hbmCompat);
        ReleaseDC    (hwnd, hdc);
        pSCI->hbmCompat = hbmTemp;

        //
        // Reset the translation so the cube doesn't go spinning off into
        //   space somewhere- we'd never see it again!
        //

        pSCI->iCurrentXTranslation =
        pSCI->iCurrentYTranslation =
        pSCI->iCurrentZTranslation = 0;

        //
        // All these calculations so the cube starts out with random movements,
        //

        if ((pSCI->iCurrentXTranslationInc = (rand() % 10) + 2) > 7)

          pSCI->iCurrentXTranslationInc = -pSCI->iCurrentXTranslationInc;

        if ((pSCI->iCurrentYTranslationInc = (rand() % 10) + 2) <= 7)

          pSCI->iCurrentYTranslationInc = -pSCI->iCurrentYTranslationInc;

        if ((pSCI->iCurrentZTranslationInc = (rand() % 10) + 2) > 7)

          pSCI->iCurrentZTranslationInc = -pSCI->iCurrentZTranslationInc;

        pSCI->rcCubeBoundary.left   =
        pSCI->rcCubeBoundary.top    = 0;
        pSCI->rcCubeBoundary.right  = (int) LOWORD (lParam);
        pSCI->rcCubeBoundary.bottom = (int) HIWORD (lParam);

        pSCI->iOptions |= SPINCUBE_REPAINT_BKGND;

        InvalidateRect (hwnd, NULL, FALSE);
      }

      break;

    case WM_DESTROY:
    {
      PSPINCUBEINFO pSCI = (PSPINCUBEINFO) GetWindowLongPtr (hwnd,
                                                          GWL_SPINCUBEDATA);
      //
      // Clean up all the resources used for this control
      //

      if (IN_MOTION(hwnd))

        KillTimer (hwnd, SPIN_EVENT);

      SelectObject (pSCI->hdcCompat, pSCI->hbmSave);
      DeleteObject (pSCI->hbmCompat);
      DeleteDC     (pSCI->hdcCompat);

      LocalFree (LocalHandle ((LPVOID) pSCI));

      //
      // Decrement the global count vars
      //

      giNumSpincubesThisProcess--;
      giNumSpincubesAllProcesses--;

      break;
    }

    default:

      return (DefWindowProc(hwnd, msg, wParam, lParam));
  }

  return ((LONG) TRUE);
}

Generated on Wed Nov 13 2024 16:55:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/SpinTest.c File Reference

  • WinUI
  • Controls
  • Custom
  • SpinCube
Functions

SpinTest.c File Reference

#include <windows.h>
#include <stdio.h>
#include "spintest.h"

Go to the source code of this file.

Functions

int | __declspec (dllimport)
LRESULT CALLBACK | DlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
LPTSTR | GetStringRes (int id)
LRESULT CALLBACK | MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

Function Documentation

int __declspec ( dllimport )

Definition at line 30 of file SpinTest.c.

           :    WinMain (standard WinMain INPUTS/RETURNS)
*
\******************************************************************************/

int WINAPI WinMain (HINSTANCE hInstance,HINSTANCE hPrevInstance, LPSTR lpCmdLine,
                   int     nCmdShow)
{
  WNDCLASS wc;
  HWND   hwnd;
  MSG    msg;
  RECT   rect;
  WORD   i;

  wc.style         = 0;
  wc.lpfnWndProc   = (WNDPROC) MainWndProc;
  wc.cbClsExtra    = 0;
  wc.cbWndExtra    = 0;
  wc.hInstance     = hInstance;
  wc.hIcon         = LoadIcon (hInstance, TEXT("spintesticon"));
  wc.hCursor       = LoadCursor (NULL, IDC_ARROW);
  wc.hbrBackground = GetStockObject (WHITE_BRUSH);
  wc.lpszMenuName  = (LPTSTR) TEXT("Menu");
  wc.lpszClassName = (LPTSTR) TEXT("Main");

  if (!RegisterClass (&wc))
  {
    MessageBox (NULL,
                GetStringRes (IDS_REGCLASSFAIL),
                TEXT("SPINTEST"), MB_OK | MB_ICONEXCLAMATION);
    return(FALSE);
  }

  ghInst = hInstance;
  if (!(hwnd = CreateWindow (TEXT("Main"),
                             GetStringRes (IDS_WINDOWTITLE),
                             WS_OVERLAPPEDWINDOW,
                             CW_USEDEFAULT, CW_USEDEFAULT,
                             CW_USEDEFAULT, CW_USEDEFAULT,
                             NULL, NULL, ghInst, NULL)))
    return 0;

  //
  // Create a couple of SpinCube custom controls, we'll size them later in
  //   the WM_SIZE message handler
  //

  for (i = 0; i < 4; i++)

    gahwndSpin[i] = CreateWindow (TEXT("Spincube"), TEXT(""),
                                  WS_VISIBLE | WS_CHILD |
                                  SS_INMOTION | SS_ERASE,
                                  0, 0, 0, 0, hwnd, NULL, NULL, NULL);

  //
  // Delete the SS_ERASE to the 1st & 4th controls so we get the
  //   trailing cubes effect.
  //

  SetWindowLongPtr (gahwndSpin[0], GWL_STYLE,
                 GetWindowLongPtr (gahwndSpin[0], GWL_STYLE) & ~ SS_ERASE);
  SetWindowLongPtr (gahwndSpin[3], GWL_STYLE,
                 GetWindowLongPtr (gahwndSpin[3], GWL_STYLE) & ~ SS_ERASE);

  //
  // Send ourself a WM_SIZE so the controls will get sized appropriately
  //

  GetClientRect (hwnd, &rect);
  SendMessage (hwnd, WM_SIZE, 0,
               MAKELONG((WORD)rect.right,(WORD)rect.bottom));

  ShowWindow (hwnd, nCmdShow);

  while (GetMessage (&msg, NULL, 0, 0))
  {
    TranslateMessage (&msg);
    DispatchMessage  (&msg);
  }

  return (int)(msg.wParam);
}

LRESULT CALLBACK DlgProc | ( | HWND | hwnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 213 of file SpinTest.c.

{
  switch (message)
  {
    case WM_INITDIALOG:

      //
      // If this dlg the "Stats" dlg fill in the appropriate fields.
      //   If not these calls will just fail.
      //
      // If the references to the giNum* vars are commented out &
      //   the program gets rebuilt don't be surprised if no spincubes
      //   appear- since no references to spincube.lib the linker will
      //   infer that it is not needed, & will not cause it to get
      //   loaded. You'll need to make a call to LoadLibrary ("SPINCUBE.DLL")
      //   prior to calling CreateWindow ("SPINCUBE"...).
      //

      SetDlgItemInt (hwnd, 500, giNumSpincubesThisProcess, TRUE);
      SetDlgItemInt (hwnd, 501, giNumSpincubesAllProcesses, TRUE);
      return (TRUE);

    case WM_COMMAND:

      if (LOWORD(wParam) == IDOK)

        EndDialog (hwnd, TRUE);

      return (TRUE);
  }
  return (FALSE);
}

LPTSTR GetStringRes ( int id )

Definition at line 258 of file SpinTest.c.

{
  static TCHAR szBuffer[MAX_PATH];

  szBuffer[0]=0;
  LoadString (GetModuleHandle (NULL), id, szBuffer, MAX_PATH);
  return szBuffer;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 136 of file SpinTest.c.

{
  switch (msg)
  {
    case WM_COMMAND:

      switch (LOWORD(wParam))
      {
        case IDM_DLGEDITDIALOG:

          DialogBox (ghInst, (LPCTSTR) TEXT("SpintestDlg"), hwnd, (DLGPROC) DlgProc);
          break;

        case IDM_SPINTESTSTATS:

          DialogBox (ghInst, (LPCTSTR) TEXT("Stats"), hwnd, (DLGPROC) DlgProc);
          break;

        case IDM_ABOUT:

          DialogBox (ghInst, (LPCTSTR) TEXT("About"), hwnd, (DLGPROC) DlgProc);
          break;

      }
      break;

    case WM_SIZE:
    {
      //
      // Resize the controls such that each cover half the client area
      //   (plus a little border).
      //

      int width  = (int) LOWORD(lParam);
      int height = (int) HIWORD(lParam);

      SetWindowPos (gahwndSpin[0], NULL,
                    BORDER, BORDER,
                    width/2 - BORDER, height/2 - BORDER,
                    SWP_SHOWWINDOW);
      SetWindowPos (gahwndSpin[1], NULL,
                    width/2 + BORDER, BORDER,
                    width/2 - 2*BORDER, height/2 - BORDER,
                    SWP_SHOWWINDOW);
      SetWindowPos (gahwndSpin[2], NULL,
                    BORDER, height/2 + BORDER,
                    width/2 - BORDER, height/2 - 2*BORDER,
                    SWP_SHOWWINDOW);
      SetWindowPos (gahwndSpin[3], NULL,
                    width/2 + BORDER, height/2 + BORDER,
                    width/2 - 2*BORDER, height/2 - 2*BORDER,
                    SWP_SHOWWINDOW);
      break;
    }

    case WM_DESTROY:

      PostQuitMessage (0);
      break;

    default:

      return (DefWindowProc (hwnd, msg, wParam, lParam));
  }
  return 0;
}

Generated on Wed Nov 13 2024 16:55:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/SpinTest.h File Reference

  • WinUI
  • Controls
  • Custom
  • SpinCube
Defines | Functions | Variables

SpinTest.h File Reference

Go to the source code of this file.

Defines

#define | BORDER 4
#define | IDM_ABOUT 103
#define | IDM_DLGEDITDIALOG 101
#define | IDM_SPINTESTSTATS 102
#define | IDS_REGCLASSFAIL 16
#define | IDS_WINDOWTITLE 17
#define | SS_ERASE 0x0001
#define | SS_INMOTION 0x0002

Functions

LRESULT CALLBACK | DlgProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)

Variables

HWND | gahwndSpin [4]
HINSTANCE | ghInst

Define Documentation

#define BORDER 4

Definition at line 17 of file SpinTest.h.

#define IDM_ABOUT 103

Definition at line 15 of file SpinTest.h.

#define IDM_DLGEDITDIALOG 101

Definition at line 13 of file SpinTest.h.

#define IDM_SPINTESTSTATS 102

Definition at line 14 of file SpinTest.h.

#define IDS_REGCLASSFAIL 16

Definition at line 19 of file SpinTest.h.

#define IDS_WINDOWTITLE 17

Definition at line 20 of file SpinTest.h.

#define SS_ERASE 0x0001

Definition at line 26 of file SpinTest.h.

#define SS_INMOTION 0x0002

Definition at line 27 of file SpinTest.h.

Function Documentation

LRESULT CALLBACK DlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 1058 of file PlgBlt.c.

{

  switch (message) {
    /**********************************************************************\
    *  WM_INITDIALOG
    *
    * Fill the entry fields with sensible original values.
    \**********************************************************************/
    case WM_INITDIALOG:
        SetDlgItemText(hwnd, DID_P1X     , "0");
        SetDlgItemText(hwnd, DID_P1Y     , "0");
        SetDlgItemText(hwnd, DID_P2X     , "0");
        SetDlgItemText(hwnd, DID_P2Y     , "0");
        SetDlgItemText(hwnd, DID_P3X     , "0");
        SetDlgItemText(hwnd, DID_P3Y     , "0");
        SetDlgItemText(hwnd, DID_XSRC    , "0");
        SetDlgItemText(hwnd, DID_YSRC    , "0");
        SetDlgItemText(hwnd, DID_WIDTH   , "0");
        SetDlgItemText(hwnd, DID_HEIGHT  , "0");
        SetDlgItemText(hwnd, DID_XMASK   , "0");
        SetDlgItemText(hwnd, DID_YMASK   , "0");
    return TRUE;

    /**********************************************************************\
    *  WM_PUTUPLPOINTS
    *
    * wParam -  HDC with the needed world transform.
    * lParam -  Pointer to the track object.
    *
    * Fill the entry fields for the array of 3 dest parallelogram points.
    *  Conditionally change the first point depending on tracking mode.
    \**********************************************************************/
    case WM_PUTUPLPOINTS: {
        POINT p, origin;
        PTrackObject pto;
        HDC hdc;

        hdc = (HDC) wParam;
        pto = (PTrackObject) lParam;
        GetViewportOrgEx (hdc, &origin);

        if (pto->Mode & TMMOVE) {
          p.x = pto->rect.left;
          p.y = pto->rect.top;
          LPtoDP (pto->hdc, &p, 1);
          p.x -= origin.x; p.y -= origin.y;

          SetDlgItemInt(hwnd, DID_P1X, p.x, TRUE);
          SetDlgItemInt(hwnd, DID_P1Y, p.y, TRUE);

        }

        p.x = pto->rect.right;
        p.y = pto->rect.top;
        LPtoDP (pto->hdc, &p, 1);
        p.x -= origin.x; p.y -= origin.y;

        SetDlgItemInt(hwnd, DID_P2X, p.x, TRUE);
        SetDlgItemInt(hwnd, DID_P2Y, p.y, TRUE);

        p.x = pto->rect.left;
        p.y = pto->rect.bottom;
        LPtoDP (pto->hdc, &p, 1);
        p.x -= origin.x; p.y -= origin.y;
        SetDlgItemInt(hwnd, DID_P3X, p.x, TRUE);
        SetDlgItemInt(hwnd, DID_P3Y, p.y, TRUE);

    } return FALSE;

    /**********************************************************************\
    *  WM_PUTUPSRCRECT
    *
    * wParam -  HDC with the needed world transform.
    * lParam -  Pointer to the track object.
    *
    * Fill the entry fields for the source rectangle points.
    *  Conditionally change <x,y> or <width,height> depending on tracking mode.
    \**********************************************************************/
    case WM_PUTUPSRCRECT: {
        POINT p1,p2, origin;
        PTrackObject pto;
        HDC hdc;

        hdc = (HDC) wParam;
        pto = (PTrackObject) lParam;
        GetViewportOrgEx (hdc, &origin);

        p1.x = pto->rect.left;
        p1.y = pto->rect.top;
        LPtoDP (pto->hdc, &p1, 1);

        p2.x = pto->rect.right;
        p2.y = pto->rect.bottom;
        LPtoDP (pto->hdc, &p2, 1);
        p2.x -= p1.x; p2.y -= p1.y;

        p1.x -= origin.x; p1.y -= origin.y;

        if (!(pto->Mode & TMSIZEXY)) {
          SetDlgItemInt(hwnd, DID_XSRC, p1.x, TRUE);
          SetDlgItemInt(hwnd, DID_YSRC, p1.y, TRUE);
        }

        if (!(pto->Mode & TMMOVE)) {
          SetDlgItemInt(hwnd, DID_WIDTH,  p2.x, TRUE);
          SetDlgItemInt(hwnd, DID_HEIGHT, p2.y, TRUE);
        }
    } return FALSE;

    /**********************************************************************\
    *  WM_PUTUPMASKPT
    *
    * wParam -  HDC with the needed world transform.
    * lParam -  Pointer to the track object.
    *
    * Fill the entry fields for the mask location point.
    \**********************************************************************/
    case WM_PUTUPMASKPT: {
        POINT p1, origin;
        PTrackObject pto;
        HDC hdc;

        hdc = (HDC) wParam;
        pto = (PTrackObject) lParam;
        GetViewportOrgEx (hdc, &origin);

        p1.x = pto->rect.left;
        p1.y = pto->rect.top;
        LPtoDP (pto->hdc, &p1, 1);
        p1.x -= origin.x; p1.y -= origin.y;

        SetDlgItemInt(hwnd, DID_XMASK, p1.x, TRUE);
        SetDlgItemInt(hwnd, DID_YMASK, p1.y, TRUE);

    } return FALSE;

    /**********************************************************************\
    *  WM_COMMAND, DID_DRAW
    *
    * Draw button hit - send main window message to call PlgBlt().
    \**********************************************************************/
    case WM_COMMAND: {
      HBITMAP hbm;

      if (LOWORD(wParam) == DID_DRAW) {
          SendMessage (hwndMain, WM_PLGBLT, 0,0);

    /**********************************************************************\
    *  WM_COMMAND, DID_NEWSRC
    *
    * Try to get a new source bitmap.  Then
    *  invalidate two sub windows so that we force a repaint.
    \**********************************************************************/
      } else if (LOWORD(wParam) == DID_NEWSRC) {
        if ( hbm = GetBitmap (hdcSrc, hInst, FALSE)) {
          DeleteObject (hbmSrc);
          hbmSrc = hbm;
          InvalidateRect (hwndMain, &ptoSrc->rectClip, TRUE);
          InvalidateRect (hwndMain, &ptoDest->rectClip, TRUE);
        }

    /**********************************************************************\
    *  WM_COMMAND, DID_Mask
    *
    * Try to get a new mask bitmap.  Then
    *  invalidate two sub windows so that we force a repaint.
    \**********************************************************************/
      } else if (LOWORD(wParam) == DID_NEWMASK) {
        if ( hbm = GetBitmap (hdcMask,  hInst, TRUE)) {
          DeleteObject (hbmMask);
          hbmMask = hbm;
          InvalidateRect (hwndMain, &ptoMask->rectClip, TRUE);
          InvalidateRect (hwndMain, &ptoDest->rectClip, TRUE);
        }
      }

    } return FALSE; /* end WM_COMMAND */

  } /* end switch */
  return 0;
}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

Variable Documentation

HWND gahwndSpin[4]

Definition at line 36 of file SpinTest.h.

HINSTANCE ghInst

Name of app.

Definition at line 35 of file SpinTest.h.

Generated on Wed Nov 13 2024 16:55:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Cursor/Cursor.c File Reference

  • WinUI
  • Cursor
Defines | Functions | Variables

Cursor.c File Reference

#include <windows.h>
#include <string.h>
#include <tchar.h>
#include <stdio.h>
#include "cursor.h"

Go to the source code of this file.

Defines

#define | NITER 20
#define | SIZE 81900

Functions

INT_PTR CALLBACK | About (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
BOOL | InitApplication (HANDLE hInstance)
BOOL | InitInstance (HANDLE hInstance, INT nCmdShow)
LRESULT CALLBACK | MainWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
INT | sieve ()
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

BOOL | bTrack = FALSE
CHAR | flags [SIZE+1] = {0}
HCURSOR | hHourGlass = NULL
HANDLE hInst
HCURSOR | hSaveCursor = NULL
INT | OrgX = 0
INT | OrgY = 0
INT | PrevX = 0
INT | PrevY = 0
MPOINT ptCursor
RECT | Rect
INT | repeat = 1
TCHAR | str [255] = {0}
INT | X = 0
INT | Y = 0

Define Documentation

#define NITER 20

Definition at line 511 of file Cursor.c.

#define SIZE 81900

Definition at line 512 of file Cursor.c.

Function Documentation

INT_PTR CALLBACK About | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 466 of file Cursor.c.

{
    BOOL bProcessedMsg = FALSE;

    switch (message)
    {
        case WM_INITDIALOG:
            bProcessedMsg = TRUE;
            break;

        case WM_COMMAND:
            // LOWORD added for portability
            if (LOWORD(wParam) == IDOK
                || LOWORD(wParam) == IDCANCEL) {
                EndDialog(hDlg, TRUE);
                bProcessedMsg = TRUE;
            }
            break;

    }

    return bProcessedMsg;
}

BOOL InitApplication ( HANDLE hInstance )

Definition at line 105 of file Cursor.c.

{
    WNDCLASS wc = {0};

    wc.lpfnWndProc = (WNDPROC) MainWndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon( NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor (hInstance, TEXT("bullseye"));
    wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
    wc.lpszMenuName =  TEXT("CursorMenu");
    wc.lpszClassName = TEXT("CursorWClass");

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | hInstance,
 |  | INT | nCmdShow
 | ) |  |

Definition at line 128 of file Cursor.c.

{
    BOOL bSuccess = FALSE;
    HWND hWnd = NULL;

    hInst = hInstance;

    hHourGlass = LoadCursor(NULL, IDC_WAIT);

    hWnd = CreateWindow (
        TEXT ("CursorWClass"),
        TEXT ("Cursor Sample Application"),
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, 0,
        CW_USEDEFAULT, 0,
        NULL, NULL, hInstance, NULL);

    if (hWnd)
    {
        ShowWindow (hWnd, nCmdShow);
        bSuccess = UpdateWindow(hWnd);
    }

    return bSuccess;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 190 of file Cursor.c.

{
    POINT pt = {0};
    HDC hDC = NULL;
    BOOL bRetDWP = FALSE; // return DefWindowProc(...)

    switch (message)
    {
        case WM_COMMAND:
            // LOWORD added for portability
            if (LOWORD(wParam) == IDM_ABOUT)
            {
                DialogBox(hInst,
                          TEXT("AboutBox"),
                          hWnd,
                          (DLGPROC)About);
                break;
            }
            else
            {
                bRetDWP = TRUE;
                goto exit_func;
                break;
            }

        case WM_CHAR:
            if (wParam == '\r')
            {
                SetCapture(hWnd);

                /* Set the cursor to an hourglass */

                hSaveCursor = SetCursor(hHourGlass);

                // OK now we perform a task that may take a while... We compute Primes
                _tcsncpy (str, TEXT("Calculating prime numbers..."), sizeof(str)/sizeof(str)-1);
                InvalidateRect (hWnd, NULL, TRUE);
                UpdateWindow (hWnd);
                _sntprintf (str, sizeof(str)/sizeof(str)-1, TEXT("Calculated %d primes.       "), sieve());
                InvalidateRect (hWnd, NULL, TRUE);
                UpdateWindow (hWnd);

                SetCursor(hSaveCursor);          /* Restores previous cursor */
                ReleaseCapture();
            }
            break;

        case WM_LBUTTONDOWN:
            bTrack = TRUE;
            _tcsncpy (str,TEXT(""),sizeof(str)/sizeof(str)-1 );
            PrevX = LOWORD(lParam);
            PrevY = HIWORD(lParam);
            if (!(wParam & MK_SHIFT))
            {       /* If shift key is not pressed */
                OrgX = LOWORD(lParam);
                OrgY = HIWORD(lParam);
            }
            InvalidateRect (hWnd, NULL, TRUE);
            UpdateWindow (hWnd);

            /* Capture all input even if the mouse goes outside of window */

            SetCapture(hWnd);
            break;

        case WM_MOUSEMOVE:
            {
                RECT rectClient = {0};
                INT  NextX = 0;
                INT  NextY = 0;

                if (bTrack)
                {
                    NextX = (SHORT)LOWORD(lParam);
                    NextY = (SHORT)HIWORD(lParam);

                    /* Do not draw outside the window's client area */

                    GetClientRect (hWnd, &rectClient);
                    if (NextX < rectClient.left)
                    {
                        NextX = rectClient.left;
                    }
                    else if (NextX >= rectClient.right)
                    {
                        NextX = rectClient.right - 1;
                    }
                    if (NextY < rectClient.top)
                    {
                        NextY = rectClient.top;
                    }
                    else if (NextY >= rectClient.bottom)
                    {
                        NextY = rectClient.bottom - 1;
                    }

                    /* If the mouse position has changed, then clear the */
                    /* previous rectangle and draw the new one.          */

                    if ((NextX != PrevX) || (NextY != PrevY))
                    {
                        hDC = GetDC(hWnd);
                        SetROP2(hDC, R2_NOT);          /* Erases the previous box */
                        MoveToEx(hDC, OrgX, OrgY, NULL);
                        LineTo(hDC, OrgX, PrevY);
                        LineTo(hDC, PrevX, PrevY);
                        LineTo(hDC, PrevX, OrgY);
                        LineTo(hDC, OrgX, OrgY);

                        /* Get the current mouse position */

                        PrevX = NextX;
                        PrevY = NextY;
                        MoveToEx(hDC, OrgX, OrgY, NULL); /* Draws the new box */
                        LineTo(hDC, OrgX, PrevY);
                        LineTo(hDC, PrevX, PrevY);
                        LineTo(hDC, PrevX, OrgY);
                        LineTo(hDC, OrgX, OrgY);
                        ReleaseDC(hWnd, hDC);
                    }
                }
            }
            break;

        case WM_LBUTTONUP:
            bTrack = FALSE;                 /* No longer creating a selection */
            ReleaseCapture();               /* Releases hold on mouse input */

            X = LOWORD(lParam);             /* Saves the current value      */
            Y = HIWORD(lParam);
            break;

        case WM_KEYDOWN:
            if (wParam != VK_LEFT && wParam != VK_RIGHT
                && wParam != VK_UP && wParam != VK_DOWN)
                break;

            MPOINT2POINT(ptCursor, pt);
            GetCursorPos(&pt);

            /* Convert screen coordinates to client coordinates */

            ScreenToClient(hWnd, &pt);
            POINT2MPOINT(pt, ptCursor);
            repeat++;                           /* Increases the repeat rate */

            switch (wParam)
            {

                /* Adjust cursor position according to which key was pressed. */

                case VK_LEFT:
                    ptCursor.x = ptCursor.x - (SHORT) repeat;
                    break;

                case VK_RIGHT:
                    ptCursor.x = ptCursor.x + (SHORT) repeat;
                    break;

                case VK_UP:
                    ptCursor.y = ptCursor.y - (SHORT) repeat;
                    break;

                case VK_DOWN:
                    ptCursor.y = ptCursor.y + (SHORT) repeat;
                    break;
            }

            /* Get the client boundaries */

            GetClientRect(hWnd, &Rect);

            /* Do not draw outside the window's client area */

            MPOINT2POINT(ptCursor, pt);
            if (pt.x >= Rect.right)
                pt.x = Rect.right - 1;
            else if (pt.x < Rect.left)
                pt.x = Rect.left;
            if (pt.y >= Rect.bottom)
                pt.y = Rect.bottom - 1;
            else if (pt.y < Rect.top)
                pt.y = Rect.top;

            /* Convert the coordinates to screen coordinates */

            ClientToScreen(hWnd, &pt);
            SetCursorPos(pt.x, pt.y);
            break;

        case WM_KEYUP:
            repeat = 1;                          /* Clears the repeat count. */
            break;

        case WM_ACTIVATE:
            if (!GetSystemMetrics(SM_MOUSEPRESENT))
            {
                if (!HIWORD(wParam))
                {
                    // LOWORD added for portability
                    if (LOWORD(wParam))
                    {
                        SetCursor(LoadCursor(hInst, TEXT("bullseye")));
                        pt.x = X;
                        pt.y = Y;
                        ClientToScreen(hWnd, &pt);
                        SetCursorPos(pt.x, pt.y);
                    }
                    if (wParam)
                    {
                        ShowCursor(TRUE);
                    }
                    else
                    {
                        ShowCursor(FALSE);
                    }
                }
            }
            break;

        case WM_PAINT:
            {
                PAINTSTRUCT ps = {0};

                hDC = BeginPaint (hWnd, &ps);
                if (OrgX != PrevX || OrgY != PrevY)
                {
                    MoveToEx(hDC, OrgX, OrgY, NULL);
                    LineTo(hDC, OrgX, PrevY);
                    LineTo(hDC, PrevX, PrevY);
                    LineTo(hDC, PrevX, OrgY);
                    LineTo(hDC, OrgX, OrgY);
                }
                TextOut (hDC, 1, 1, str, (INT)_tcslen (str)); // http://swiweb
                EndPaint (hWnd, &ps);
            }
            break;

        case WM_DESTROY:
            PostQuitMessage(0);
            break;

        default:
            bRetDWP = TRUE;
            goto exit_func;
            break;
    }

exit_func:
    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

INT sieve ( )

Definition at line 516 of file Cursor.c.

{
    INT i,k;
    INT iter, count = 0;

    for (iter = 1; iter <= NITER; iter++)
    {      /* Do sieve NITER times */
        count = 0;
        for (i = 0; i <= SIZE; i++)              /* Sets all flags TRUE    */
            flags[i] = TRUE;

        for (i = 2; i <= SIZE; i++)
        {
            if (flags[i] )
            {                        /* Found a prime?       */
                for (k = i + i; k <= SIZE; k += i)
                    flags[k] = FALSE;              /* Cancels its multiples */
                count++;
            }
        }
    }
    return (count);
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 55 of file Cursor.c.

{
    MSG msg;                                 /* message                      */
    BOOL bRet = FALSE;                     /* TRUE if getmessage failed    */

    if (!InitApplication(hInstance))
    {
        return FALSE;
    }

    if (!InitInstance(hInstance, nCmdShow))
    {
        return FALSE;
    }

    MessageBox ( GetFocus (),
                 TEXT("Use the mouse button in this program for an example of graphics ")
                 TEXT("selection, or the <Enter> key for an example of ")
                 TEXT("using a special cursor to reflect a program state."),
                 TEXT("Cursor Sample Application"),
                 MB_ICONASTERISK | MB_OK );

    while ((bRet = GetMessage(&msg, NULL, 0, 0)) !=0)
    {
        if (bRet == -1)
        {
            // Possibly handle the error
            return FALSE;
        }
        else
        {
            TranslateMessage (&msg);
            DispatchMessage (&msg);
        }
    }

        return (int) msg.wParam;
}

Variable Documentation

BOOL bTrack = FALSE

Definition at line 39 of file Cursor.c.

CHAR flags[SIZE+1] = {0}

Definition at line 514 of file Cursor.c.

HCURSOR hHourGlass = NULL

Definition at line 37 of file Cursor.c.

HANDLE hInst

Definition at line 33 of file Cursor.c.

HCURSOR hSaveCursor = NULL

Definition at line 36 of file Cursor.c.

INT OrgX = 0

Definition at line 40 of file Cursor.c.

INT OrgY = 0

Definition at line 40 of file Cursor.c.

INT PrevX = 0

Definition at line 41 of file Cursor.c.

INT PrevY = 0

Definition at line 41 of file Cursor.c.

MPOINT ptCursor

Definition at line 45 of file Cursor.c.

RECT Rect

Definition at line 43 of file Cursor.c.

INT repeat = 1

Definition at line 46 of file Cursor.c.

TCHAR str[255] = {0}

Definition at line 34 of file Cursor.c.

INT X = 0

Definition at line 42 of file Cursor.c.

INT Y = 0

Definition at line 42 of file Cursor.c.

Generated on Wed Nov 13 2024 16:55:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Cursor/Cursor.h File Reference

  • WinUI
  • Cursor
Defines | Typedefs | Functions

Cursor.h File Reference

Go to the source code of this file.

Defines

#define | IDM_ABOUT 100
#define | MPOINT2POINT(mpt, pt) ((pt).x = (mpt).x, (pt).y = (mpt).y)
#define | POINT2MPOINT(pt, mpt) ((mpt).x = (SHORT)(pt).x, (mpt).y = (SHORT)(pt).y)

Typedefs

typedef POINTS | MPOINT

Functions

INT_PTR CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
BOOL InitApplication (HANDLE)
BOOL | InitInstance (HANDLE, INT)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
INT | sieve (VOID)

Define Documentation

#define IDM_ABOUT 100

Definition at line 12 of file Cursor.h.

#define MPOINT2POINT | ( | mpt,
 |  | pt |
 | ) |  | ((pt).x = (mpt).x, (pt).y = (mpt).y)

Definition at line 15 of file Cursor.h.

#define POINT2MPOINT | ( | pt,
 |  | mpt |
 | ) |  | ((mpt).x = (SHORT)(pt).x, (mpt).y = (SHORT)(pt).y)

Definition at line 16 of file Cursor.h.

Typedef Documentation

typedef POINTS MPOINT

Definition at line 14 of file Cursor.h.

Function Documentation

INT_PTR CALLBACK About | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 445 of file Generic.C.

{
   static  HFONT hfontDlg;    // Font for dialog text
   static   HFONT hFinePrint; // Font for 'fine print' in dialog
   DWORD   dwVerInfoSize;     // Size of version information block
   LPSTR   lpVersion;         // String pointer to 'version' text
   DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
   UINT    uVersionLen;
   WORD    wRootLen;
   BOOL    bRetCode;
   int     i;
   char    szFullPath[BUFFSIZE];
   char    szResult[BUFFSIZE];
   char    szGetName[BUFFSIZE];
   DWORD dwVersion;
   char  szVersion[40];
   DWORD dwResult;
   HRESULT hRes;

   switch (message) {
        case WM_INITDIALOG:
         ShowWindow (hDlg, SW_HIDE);

         if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                  VARIABLE_PITCH | FF_DONTCARE, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                    VARIABLE_PITCH | FF_DONTCARE, "");
         }
         else
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                  VARIABLE_PITCH | FF_SWISS, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                    VARIABLE_PITCH | FF_SWISS, "");
         }

         CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
         GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));

         // Now lets dive in and pull out the version information:
         dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
         if (dwVerInfoSize) {
            LPSTR   lpstrVffInfo;
            HANDLE  hMem;
            hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
            lpstrVffInfo  = GlobalLock(hMem);
            GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
            // The below 'hex' value looks a little confusing, but
            // essentially what it is, is the hexidecimal representation
            // of a couple different values that represent the language
            // and character set that we are wanting string values for.
            // 040904E4 is a very common one, because it means:
            //   US English, Windows MultiLingual characterset
            // Or to pull it all apart:
            // 04------        = SUBLANG_ENGLISH_USA
            // --09----        = LANG_ENGLISH
            // --11----        = LANG_JAPANESE
            // ----04E4 = 1252 = Codepage for Windows:Multilingual

            // Use safe string handling
            szGetName[sizeof(szGetName) - 1] = '\0';
            lstrcpyn(szGetName, GetStringRes(IDS_VER_INFO_LANG), sizeof(szGetName) - 1);
            if (szGetName[sizeof(szGetName) - 1] != '\0') {
                return FALSE; // Buffer overflow error
            }

            wRootLen = (WORD) lstrlen(szGetName); // Save this position

            // Set the title of the dialog using safe string handling
            hRes = StringCchCatN(szGetName, sizeof(szGetName), "ProductName", sizeof("ProductName"));
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }

            bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
               (LPSTR)szGetName,
               (LPVOID)&lpVersion,
               (UINT *)&uVersionLen);

            // Notice order of version and string...
            if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), " ‚Ìƒo[ƒWƒ‡ƒ“î•ñ", sizeof(" ‚Ìƒo[ƒWƒ‡ƒ“î•ñ"));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }
            else
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), "About ", sizeof("About "));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }

            // -----------------------------------------------------

            SetWindowText (hDlg, szResult);

            // Walk through the dialog items that we want to replace:
            for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++) {
               GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
               szGetName[wRootLen] = (char)0;
               // Use safe sting handling
               hRes = StringCchCatN(szGetName, sizeof(szGetName), szResult, sizeof(szResult));
               if (FAILED(hRes)) {
                   return FALSE; // Buffer overflow error
               }
               uVersionLen   = 0;
               lpVersion     = NULL;
               bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
                  (LPSTR)szGetName,
                  (LPVOID)&lpVersion,
                  (UINT *)&uVersionLen);

               if ( bRetCode && uVersionLen && lpVersion) {
                   // Replace dialog item text with version info
                   // Use safe string handling
                   hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                   if (FAILED(hRes)) {
                       return FALSE; // Buffer overflow error
                   }
                   SetDlgItemText(hDlg, i, szResult);
               }
               else
               {
                  dwResult = GetLastError();

                  // Use safe string handling
                  hRes = StringCchPrintf(szResult, sizeof(szResult), GetStringRes(IDS_VERSION_ERROR), dwResult);
                  if (FAILED(hRes)) {
                      return FALSE; // Buffer overflow error
                  }

                  SetDlgItemText (hDlg, i, szResult);
               }
               SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
                  (ULONG_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
                  TRUE);
            } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)

            GlobalUnlock(hMem);
            GlobalFree(hMem);

         } else {
            // No version information available.
         } // if (dwVerInfoSize)

            SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
            (WPARAM)hfontDlg,(LPARAM)TRUE);

         // We are  using GetVersion rather then GetVersionEx
         // because earlier versions of Windows NT and Win32s
         // didn't include GetVersionEx:
         dwVersion = GetVersion();

         if (dwVersion < 0x80000000) {
            // Windows NT
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows NT %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion)) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else if (LOBYTE(LOWORD(dwVersion))<4) {
            // Win32s
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Win32s %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion) & ~0x8000) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else {
            // Windows 95
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows 95 %u.%u",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         }

          SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
         ShowWindow (hDlg, SW_SHOW);
         return (TRUE);

      case WM_COMMAND:
         if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
            EndDialog(hDlg, TRUE);
            DeleteObject (hfontDlg);
            DeleteObject (hFinePrint);
            return (TRUE);
         }
         break;
   }

    return FALSE;
}

BOOL InitApplication ( HANDLE )

Definition at line 123 of file ClipText.c.

{
    WNDCLASS  wc = {0};

    wc.lpfnWndProc = (WNDPROC) MainWndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName =  TEXT("CliptextMenu");
    wc.lpszClassName = TEXT("CliptextWClass");

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | ,
 |  | INT |
 | ) |  |

Definition at line 128 of file Cursor.c.

{
    BOOL bSuccess = FALSE;
    HWND hWnd = NULL;

    hInst = hInstance;

    hHourGlass = LoadCursor(NULL, IDC_WAIT);

    hWnd = CreateWindow (
        TEXT ("CursorWClass"),
        TEXT ("Cursor Sample Application"),
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, 0,
        CW_USEDEFAULT, 0,
        NULL, NULL, hInstance, NULL);

    if (hWnd)
    {
        ShowWindow (hWnd, nCmdShow);
        bSuccess = UpdateWindow(hWnd);
    }

    return bSuccess;
}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

INT sieve ( VOID )
Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/fulldrag/fulldrag.c File Reference

  • WinUI
  • fulldrag
Defines | Functions | Variables

fulldrag.c File Reference

#include "fulldrag.h"

Go to the source code of this file.

Defines

#define | MAXDEPTH 8

Functions

void | Hilbert (HDC hdc, int x, int y, int vx, int vy, int wx, int wy, int n)
void | Hilbert_OnPaint (HWND hwnd)
LRESULT CALLBACK | Hilbert_WndProc (HWND hwnd, UINT wm, WPARAM wp, LPARAM lp)
int WINAPI | WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)

Variables

BOOL g_fDragging
BOOL g_fPaintDeferred

Define Documentation

#define MAXDEPTH 8

Definition at line 58 of file fulldrag.c.

Function Documentation

void Hilbert | ( | HDC | hdc,
 |  | int | x,
 |  | int | y,
 |  | int | vx,
 |  | int | vy,
 |  | int | wx,
 |  | int | wy,
 |  | int | n
 | ) |  |

Definition at line 61 of file fulldrag.c.

{
    if (n >= MAXDEPTH) {
        LineTo(hdc, x + (vx+wx)/2, y + (vy+wy)/2);
    } else {
        n++;
        Hilbert(hdc, x, y, wx/2, wy/2, vx/2, vy/2, n);
        Hilbert(hdc, x+vx/2, y+vy/2, vx/2, vy/2, wx/2, wy/2, n);
        Hilbert(hdc, x+vx/2+wx/2, y+vy/2+wy/2, vx/2, vy/2, wx/2, wy/2, n);
        Hilbert(hdc, x+vx/2+wx, y+vy/2+wy, -wx/2, -wy/2, -vx/2, -vy/2, n);
    }
}

void Hilbert_OnPaint ( HWND hwnd )

Definition at line 89 of file fulldrag.c.

{
    PAINTSTRUCT ps;
    HDC hdc;

    hdc = BeginPaint(hwnd, &ps);
    if (hdc) {
        if (g_fDragging) {
            g_fPaintDeferred = TRUE;
        } else {

            HBRUSH hbrOld;
            HPEN hpenOld;
            HCURSOR hcurOld;

            hcurOld = SetCursor(LoadCursor(0, IDC_WAIT));

            hbrOld = SelectObject(hdc, GetStockObject(BLACK_BRUSH));
            hpenOld = SelectObject(hdc, GetStockObject(BLACK_PEN));

            MoveToEx(hdc, 0, 0, 0);
            Hilbert(hdc, 0, 0, GetSystemMetrics(SM_CXFULLSCREEN), 0,
                               0, GetSystemMetrics(SM_CYFULLSCREEN), 0);
            SelectObject(hdc, hpenOld);
            SelectObject(hdc, hbrOld);

            SetCursor(hcurOld);
        }
        EndPaint(hwnd, &ps);
    }
}

LRESULT CALLBACK Hilbert_WndProc | ( | HWND | hwnd,
 |  | UINT | wm,
 |  | WPARAM | wp,
 |  | LPARAM | lp
 | ) |  |

Definition at line 130 of file fulldrag.c.

{
    switch (wm) {
    case WM_PAINT:
        Hilbert_OnPaint(hwnd);
        break;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;

    /*
     *  When we begin a size/move operation, remember the fact
     *  so we won't paint during the size/move.
     */
    case WM_ENTERSIZEMOVE:
        g_fDragging = TRUE;
        break;

    /*
     *  When we finish a size/move operation, remember the fact
     *  so we will resume painting, and if there were any deferred
     *  paint messages, re-invalidate ourselves so they will be
     *  regenerated.
     */
    case WM_EXITSIZEMOVE:
        g_fDragging = FALSE;
        if (g_fPaintDeferred) {
            g_fPaintDeferred = FALSE;
            InvalidateRect(hwnd, 0, TRUE);
        }
        break;

    }

    return DefWindowProc(hwnd, wm, wp, lp);
}

int WINAPI WinMain | ( | HINSTANCE | hinst,
 |  | HINSTANCE | hinstPrev,
 |  | LPSTR | pszCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 179 of file fulldrag.c.

{
    HWND hwnd;
    MSG msg;
    WNDCLASS wc = {
        0,
        Hilbert_WndProc,
        0,
        0,
        hinst,
        LoadIcon(0, IDI_APPLICATION),
        LoadCursor(0, IDC_ARROW),
        (HBRUSH)(COLOR_WINDOW+1),
        0,
        "Hilbert"
    };

    RegisterClass(&wc);
    hwnd = CreateWindow("Hilbert", "Hilbert", WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT, CW_USEDEFAULT,
                        CW_USEDEFAULT, CW_USEDEFAULT,
                        0, 0, hinst, 0);
    ShowWindow(hwnd, nCmdShow);
    while (GetMessage(&msg, 0, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return 0;
}

Variable Documentation

BOOL g_fDragging

Definition at line 44 of file fulldrag.c.

BOOL g_fPaintDeferred

Definition at line 45 of file fulldrag.c.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/fulldrag/fulldrag.h File Reference

  • WinUI
  • fulldrag
Defines

fulldrag.h File Reference

#include <windows.h>

Go to the source code of this file.

Defines

#define STRICT

Define Documentation

#define STRICT

Definition at line 5 of file fulldrag.h.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/CSSamp.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Defines | Functions

CSSamp.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Defines

#define | GLOBALS_HERE 1

Functions

void | Initialise ()
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)

Define Documentation

#define GLOBALS_HERE 1

Definition at line 17 of file CSSamp.Cpp.

Function Documentation

void Initialise ( )

Definition at line 22 of file CSSamp.Cpp.

{
    InitStyles();
    InitText();
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 31 of file CSSamp.Cpp.

{
    MSG         msg = {0};
    HACCEL      hAccelTable = NULL;
    RECT        rc = {0};
    RECT        rcMain = {0};
    int         iRetValue = 1;
    BOOL        bSucess = TRUE;

    g_hInstance = hInstance;  // Global hInstance
    Initialise();

    // Create main text window
    g_hTextWnd = CreateTextWindow();

    // Add dialog box on leading side
    if(NULL == (g_hSettingsDlg = CreateDialog(g_hInstance,TEXT("Settings"),g_hTextWnd,(DLGPROC)SettingsDlgProc)))
    {
        iRetValue = 0;
        goto RETURN;
    }

    // Establish positon of text surface relative to the dialog
    GetWindowRect(g_hSettingsDlg, &rc);
    g_iSettingsWidth = rc.right - rc.left;
    g_iSettingsHeight = rc.bottom - rc.top;

    // Establish offset from main window to settings dialog
    GetWindowRect(g_hTextWnd, &rcMain);
    g_iMinWidth = rc.right - rcMain.left;
    g_iMinHeight = rc.bottom - rcMain.top;

    // Size main window to include dialog and text surface
    SetWindowPos(
        g_hTextWnd,
        NULL,
        0,0,
        g_iMinWidth * 29 / 10, g_iMinHeight,
        SWP_NOZORDER | SWP_NOMOVE);

    ShowWindow(g_hTextWnd, SW_SHOWNORMAL);
    InvalidateText();
    UpdateWindow(g_hTextWnd);

    // Main message loop
    if (g_bUnicodeWnd)
    {
        hAccelTable = LoadAcceleratorsW(g_hInstance, APPNAMEW);

        while (0 != (bSucess = GetMessageW(&msg, (HWND) NULL, 0, 0)))
        {
            if(bSucess == -1)
            {
                iRetValue = 1;
                goto RETURN;
            }
            if (g_hSettingsDlg == (HWND) NULL ||
                !IsDialogMessageW(g_hSettingsDlg, &msg) &&
                !TranslateAcceleratorW(g_hTextWnd, hAccelTable, &msg))
            {

                TranslateMessage(&msg);
                DispatchMessageW(&msg);
            }
        }
    }
    else
    {
        hAccelTable = LoadAcceleratorsA(g_hInstance, APPNAMEA);
        while (0 != (bSucess = GetMessageA(&msg, (HWND) NULL, 0, 0)))
        {
            if(bSucess == -1)
            {
                iRetValue = 1;
                goto RETURN;
            }
            if (g_hSettingsDlg == (HWND) NULL ||
                !IsDialogMessageA(g_hSettingsDlg, &msg) &&
                !TranslateAcceleratorA(g_hTextWnd, hAccelTable, &msg))
            {
                TranslateMessage(&msg);
                DispatchMessageA(&msg);
            }
        }
    }

    iRetValue = (int)msg.wParam;

    RETURN:
    FreeStyles();

    return iRetValue;
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Debug.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions

Debug.Cpp File Reference

#include "precomp.hxx"
#include <shlwapi.h>
#include "global.h"

Go to the source code of this file.

Functions

void WINAPIV | DebugHr (char *fmt,...)
void WINAPIV | DebugMsg (char *fmt,...)

Function Documentation

void WINAPIV DebugHr | ( | char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 39 of file Debug.Cpp.

{
    va_list vargs;
    char c[200];

//    TIMESUSPEND;

    wsprintfA(c, "%s[%d]                   ", strrchr(DG.psFile, '\\')+1, DG.iLine);
    c[17] = 0;
    OutputDebugStringA(c);

    wsprintfA(c, "%ld:      ", GetCurrentThreadId());
    c[5] = 0;
    OutputDebugStringA(c);

    va_start(vargs, fmt);
    wvnsprintfA(c,sizeof(c), fmt, vargs);
    OutputDebugStringA(c);

    //
    // Parse USP and Win32 Errors
    //

    switch( DG.hrLastError )
    {
    case USP_E_SCRIPT_NOT_IN_FONT:
      lstrcpyA( DG.sLastError , "Selected font doesn't contain requested script\n");
      break;

    default:
      FormatMessageA(
          FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
          NULL, DG.hrLastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
          DG.sLastError, sizeof(DG.sLastError), NULL);
    }

    wnsprintfA(c,sizeof(c)," -- HRESULT = %x: %s", DG.hrLastError, DG.sLastError);
    OutputDebugStringA(c);
//    TIMERESUME;
}

void WINAPIV DebugMsg | ( | char * | fmt,
 |  |  | ...
 | ) |  |

Debug function prototypes.

Definition at line 15 of file Debug.Cpp.

{
    va_list vargs;
    char c[200];

//    TIMESUSPEND;

    wnsprintfA(c,sizeof(c),"%s[%d]                   ", strrchr(DG.psFile, '\\')+1, DG.iLine);
    c[17] = 0;
    OutputDebugStringA(c);

    wnsprintfA(c,sizeof(c),"%ld:      ", GetCurrentThreadId());
    c[5] = 0;
    OutputDebugStringA(c);

    va_start(vargs, fmt);
    wvnsprintfA(c,sizeof(c),fmt,vargs);
    OutputDebugStringA(c);

    OutputDebugStringA("\n");

//    TIMERESUME;
}

Generated on Wed Nov 13 2024 16:54:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/DspFormt.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions | Variables

DspFormt.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Functions

int | BreakRun (RUN *pRun, int cGlyphs, int *piAdvances, WORD *pClusters, SCRIPT_VISATTR *pVisattrs, int iMaxWidth, int iPos, BOOL fNeedCluster)
void | BuildParaRunList (int iFirst, int iLen, RUN **ppFirstParaRun, int *pcRuns)
void | BuildVisualDisplayOrder (RUN *pFirstLogicalRun, int cRuns, RUN **ppVisualOrder, int *piPos)
void | CaretHandling (int iX, int iDx, int iY, int iDy, int iFirst, int cChars, int cGlyphs, const SCRIPT_ANALYSIS *psa, WORD *pwLogClust, const SCRIPT_VISATTR *psva, const int *piAdvance)
void | PaintFormattedRun (HDC hdc, int iY, int iLineHeight, int *piX, int *piCurStyle, int iStyle, SCRIPT_ANALYSIS *psa, int iPos, int iLen)
void | PaintFormattedText (HDC hdc, int *piY, RECT *prc, int iLineHeight)
void | PaintFormattedTextLine (HDC hdc, int *piCurStyle, int *piY, RECT *prc, int iFirst, int iLen, RUN *pFirstRun, int cRuns, int iLineHeight)
void | PaintFormattedTextPara (HDC hdc, int *piY, RECT *prc, int iFirst, int iLen, int iLineHeight)
HRESULT | ShapePlaceRun (HDC hdc, int *piCurStyle, int iStyle, SCRIPT_ANALYSIS *psa, int iPos, int iLen, int *pcGlyphs, WORD *pGlyphs, WORD *pClusters, SCRIPT_VISATTR *pVisattrs, int *piAdvances, GOFFSET *pGoffsets, int *piDx)

Variables

const int | MAXCHARS = 200
const int | MAXGLYPHS = 200
const int | MAXITEM = 200
const int | MAXRUN = 200

Function Documentation

int BreakRun | ( | RUN * | pRun,
 |  | int | cGlyphs,
 |  | int * | piAdvances,
 |  | WORD * | pClusters,
 |  | SCRIPT_VISATTR * | pVisattrs,
 |  | int | iMaxWidth,
 |  | int | iPos,
 |  | BOOL | fNeedCluster
 | ) |  |

Definition at line 654 of file DspFormt.Cpp.

{

    SCRIPT_LOGATTR   logattrs[MAXCHARS];    // Logical (codepoint) atributes
    int              logwidths[MAXCHARS];   // Codepoint widths
    int              iWidth  = 0;           // Width in pixels
    int              iChars  = 0;           // Width in codepoints
    RUN             *pNewRun = NULL;        // New run for text following wordbreak
    HRESULT          hr      = NULL;

    // Convert the glyph widths to logical widths: in the
    // same order and quantity as the origial codepoints.

    hr = ScriptGetLogicalWidths(
       &pRun->analysis,
        pRun->iLen,
        cGlyphs,
        piAdvances,
        pClusters,
        pVisattrs,
        logwidths);

    if (FAILED(hr))
    {
        iWidth = 0;
        goto RETURN;
    }

    // Calculate how many codepoints will fit iMaxWidth
    // ignoring word boundaries.
    iChars = 0;
    iWidth = 0;

    while (    iChars < pRun->iLen
        &&  iWidth + logwidths[iChars] < iMaxWidth)
    {
        iWidth += logwidths[iChars];
        iChars++;
    }

    // Obtain logical attributes including whitespace and
    // wordstart flags.
    hr = ScriptBreak(
        g_wcBuf + iPos,
        pRun->iLen,
       &pRun->analysis,
        logattrs);

    if (FAILED(hr))
    {
        iWidth = 0;
        goto RETURN;
    }

    // Back up to a wordbreak
    while(    iChars > 0
          &&  iChars < pRun->iLen
          &&  !logattrs[iChars].fWhiteSpace
          &&  !logattrs[iChars].fSoftBreak)
    {
        iChars--;
        iWidth -= logwidths[iChars];
    }

    if (fNeedCluster  &&  iChars == 0)
    {
        // Ensure at least one cluster is returned
        iWidth = piAdvances[pClusters[0]];
        iChars = 1;

        while (    iChars < pRun->iLen
               &&  pClusters[iChars] == pClusters[0])
        {
            iWidth += piAdvances[pClusters[iChars]];
            iChars++;
        }
    }

    // Include any subsequent whitespace characters
    while (    iChars < pRun->iLen
           &&  logattrs[iChars].fWhiteSpace)
    {
        iWidth += logwidths[iChars];
        iChars++;
    }

    // Split current run at this point
    if (iChars < pRun->iLen)
    {
        pNewRun        = new RUN;
        *pNewRun       = *pRun;
        pRun->pNext    = pNewRun;
        pRun->iLen     = iChars;
        pNewRun->iLen -= iChars;
    }

RETURN:
    return iWidth;
}

void BuildParaRunList | ( | int | iFirst,
 |  | int | iLen,
 |  | RUN ** | ppFirstParaRun,
 |  | int * | pcRuns
 | ) |  |

Build a Paragraph run list by merging itemization with formatting styles.

Definition at line 62 of file DspFormt.Cpp.

                   {          // Out   Number of runs generated

    SCRIPT_ITEM      Items[MAXITEM];
    int              cItems          = 0;      // Number of items returned by ScriptItemize
    RUN             *pFormatRunRider = NULL;   // Rides main formatting run list
    RUN             *pNewRun         = NULL;
    RUN            **ppLastNext      = NULL;   // Pointer to be updated with new run address
    int              iFormatRunStart = 0;      // Character offset of current formatting run
    int              iParaRunStart   = 0;
    int              iItem           = 0 ;
    SCRIPT_CONTROL   ScriptControl   = {0};
    SCRIPT_STATE     ScriptState     = {0};
    HRESULT          hr              = NULL;
    int              cRuns           = 0;

    // Itemize the paragraph by script and bidi direction
    ScriptControl = g_ScriptControl;
    ScriptState   = g_ScriptState;

    hr = ScriptItemize(
        g_wcBuf+iFirst,
        iLen,
        MAXITEM,
        g_fNullState   ? NULL : &ScriptControl,
        g_fNullState   ? NULL : &ScriptState,
        Items,
       &cItems);

    if (FAILED(hr))
    {
        return;
    }

    /// Build a Paragraph run list by merging itemization with formatting styles.
    //
    //  Generate a linked list of runs specific to this paragraph, such that
    //  each run has a single formatting style and a single item analysis.

    // Find first run for this para
    pFormatRunRider = g_pFirstFormatRun;
    iFormatRunStart = 0;
    while (iFormatRunStart + pFormatRunRider->iLen <= iFirst)
    {
        iFormatRunStart += pFormatRunRider->iLen;
        pFormatRunRider = pFormatRunRider->pNext;
    }

    // Create a paragraph run for every change of item or formatting
    ppLastNext = ppFirstParaRun;
    iItem = 0;
    iParaRunStart = iFirst;
    cRuns = 0;

    while (iItem < cItems  &&  iFormatRunStart < iFirst + iLen)
    {
        // Create a run up to the next change of item or formatting
        // style, whichever comes first.
        pNewRun = new RUN;
        pNewRun->iStyle   = pFormatRunRider->iStyle;
        pNewRun->analysis = Items[iItem].a;
        pNewRun->pNext    = NULL;
        *ppLastNext       = pNewRun;
        ppLastNext        = &pNewRun->pNext;
        cRuns++;

        if (iFirst + Items[iItem+1].iCharPos  <=  iFormatRunStart + pFormatRunRider->iLen)
        {
            // No change of style during the current item
            pNewRun->iLen = iFirst + Items[iItem+1].iCharPos - iParaRunStart;  // Item length

        }
        else
        {
            // Style changes before end of current item
            pNewRun->iLen = iFormatRunStart + pFormatRunRider->iLen - iParaRunStart;
        }

        iParaRunStart += pNewRun->iLen;

        if (iParaRunStart >= iFirst + Items[iItem+1].iCharPos)
        {
            iItem++;  // Advance to next item
        }

        if (iParaRunStart >= iFormatRunStart + pFormatRunRider->iLen)
        {
            iFormatRunStart += pFormatRunRider->iLen;   // Advance to next run
            pFormatRunRider = pFormatRunRider->pNext;
        }
    }

    *pcRuns = cRuns;
}

void BuildVisualDisplayOrder | ( | RUN * | pFirstLogicalRun,
 |  | int | cRuns,
 |  | RUN ** | ppVisualOrder,
 |  | int * | piPos
 | ) |  |

BuildVisualDisplayOrder.

Definition at line 168 of file DspFormt.Cpp.

{
    BYTE   BidiLevel[MAXRUN];
    int    iLogicalToVisual[MAXRUN];
    int    iRun  = 0;
    RUN   *pRun  = NULL ;
    int    iPos  = 0;

    // Extract bidi levels for the line into an array
    iRun = 0;
    pRun = pFirstLogicalRun;
    while (pRun != NULL  &&  iRun < cRuns  &&  iRun < MAXRUN)
    {
        BidiLevel[iRun] = (BYTE)pRun->analysis.s.uBidiLevel;
        iRun++;
        pRun = pRun->pNext;
    }

    // Obtain logical to visual order run index mapping
    ScriptLayout(cRuns, BidiLevel, NULL, iLogicalToVisual);

    // Fill in array of run pointers in visual order
    pRun = pFirstLogicalRun;
    iRun = 0;
    iPos = 0;
    while(iRun < cRuns)
    {
        ppVisualOrder[iLogicalToVisual[iRun]] = pRun;
        piPos[iLogicalToVisual[iRun]] = iPos;
        iPos += pRun->iLen;
        pRun = pRun->pNext;
        iRun++;
    }
}

void CaretHandling | ( | int | iX,
 |  | int | iDx,
 |  | int | iY,
 |  | int | iDy,
 |  | int | iFirst,
 |  | int | cChars,
 |  | int | cGlyphs,
 |  | const SCRIPT_ANALYSIS * | psa,
 |  | WORD * | pwLogClust,
 |  | const SCRIPT_VISATTR * | psva,
 |  | const int * | piAdvance
 | ) |  |

Definition at line 220 of file DspFormt.Cpp.

{
    int  iCp        = 0;
    int  iTrailing  = 0;
    int  iCpx       = 0;
    int  iFrom      = 0;
    int  iTo        = 0;

    // Check whether mouse clicks in this item are waiting to be processed
    if (    g_fMouseDown
        &&  g_iMouseDownY >= iY
        &&  g_iMouseDownY <  iY + iDy
        &&  g_iMouseDownX >= iX
        &&  g_iMouseDownX <  iX + iDx)
    {
        // Record position at mouse button down
        ScriptXtoCP(
            g_iMouseDownX - iX,
            cChars,
            cGlyphs,
            pwLogClust,
            psva,
            piAdvance,
            psa,
           &iCp,
           &iTrailing);

        g_iFrom = iCp + iTrailing + iFirst;
        g_fMouseDown = FALSE;
    }

    if (    g_fMouseUp
        &&  g_iMouseUpY >= iY
        &&  g_iMouseUpY <  iY + iDy
        &&  g_iMouseUpX >= iX
        &&  g_iMouseUpX <  iX + iDx)
    {
        // Process mouse up
        ScriptXtoCP(
            g_iMouseUpX - iX,
            cChars,
            cGlyphs,
            pwLogClust,
            psva,
            piAdvance,
            psa,
           &iCp,
           &iTrailing);

        g_iTo = iCp + iTrailing + iFirst;
        g_fMouseUp = FALSE;

        // Request caret move to this position
        g_iCurChar      = g_iTo;
        g_fUpdateCaret  = TRUE;
        g_iCaretSection = CARET_SECTION_FORMATTED;
    }

    // Check for caret positioning to this run
    if (    g_fUpdateCaret
        &&  g_iCaretSection == CARET_SECTION_FORMATTED
        &&  g_iCurChar >= iFirst
        &&  g_iCurChar <  iFirst+cChars)
    {
        // Display caret at coordinate corresponding to g_iCurChar
        g_fUpdateCaret = FALSE;
        ScriptCPtoX(
            g_iCurChar - iFirst,
            FALSE,          // Always display on leading edge
            cChars,
            cGlyphs,
            pwLogClust,
            psva,
            piAdvance,
            psa,
           &iCpx);

        ResetCaret(iX+iCpx, iY, iDy);
    }

    // If anypart of this run is selected, redisplay that part with a blue
    // background.
    if (g_iFrom != g_iTo)
    {
        if (g_iFrom <= g_iTo)
        {
            iFrom = g_iFrom - iFirst;
            iTo   = g_iTo   - iFirst;
        }
        else
        {
            iFrom = g_iTo   - iFirst;
            iTo   = g_iFrom - iFirst;
        }
    }
}

void PaintFormattedRun | ( | HDC | hdc,
 |  | int | iY,
 |  | int | iLineHeight,
 |  | int * | piX,
 |  | int * | piCurStyle,
 |  | int | iStyle,
 |  | SCRIPT_ANALYSIS * | psa,
 |  | int | iPos,
 |  | int | iLen
 | ) |  |

Definition at line 469 of file DspFormt.Cpp.

                           {     // In     Length of logical item

    WORD            glyphs[MAXGLYPHS];
    WORD            clusters[MAXGLYPHS];
    SCRIPT_VISATTR  visattrs[MAXGLYPHS];
    int             advances[MAXGLYPHS];    // Glyph advance widths
    GOFFSET         goffsets[MAXGLYPHS];    // Glyph 2D offsets
    int             cGlyphs = 0;
    int             iWidth  = 0;            // Run width
    HRESULT         hr      = NULL;

    // ShapePlaceRun calls ScriptShape and ScriptPlace to generate glyphs and
    // advance widths, and also performs limited font association.
    hr = ShapePlaceRun(
        hdc,
        piCurStyle,
        iStyle,
        psa,
        iPos,
        iLen,
       &cGlyphs,
        glyphs,
        clusters,
        visattrs,
        advances,
        goffsets,
       &iWidth);

    if (SUCCEEDED(hr))
    {
        // Set text color to represent any font association applied
        if (*piCurStyle != iStyle)
        {
            SetTextColor(hdc, 0x00ff0000);  // Show we did font association by marking text blue
        }
        else if (psa->eScript == SCRIPT_UNDEFINED)
        {
            SetTextColor(hdc, 0x000000ff);  // Show we forced SCRIPT_UNDEFINED by marking text red
        }
        else
        {
            SetTextColor(hdc, 0);           // Show text black when no font association required
        }

        hr = ScriptTextOut(
            hdc,
           &g_style[*piCurStyle].sc,
           *piX,
            iY,
            0,
            NULL,
            psa,
            NULL,
            0,
            glyphs,
            cGlyphs,
            advances,
            NULL,
            goffsets);

        // Handle mouse hits in this run and/or caret repositioning in this run
        CaretHandling(
           *piX,            // Run position
            iWidth,         // Width in pixels
            iY,             // Run top
            iLineHeight,    // Run height
            iPos,           // First character
            iLen,           // Character count
            cGlyphs,        // Glyph count
            psa,            // Script analysis
            clusters,       // Clusters
            visattrs,       // Visual attributes
            advances);      // Advance widths

        // Advance x coordinate to right edge of run
        if (SUCCEEDED(hr))
        {
            *piX += iWidth;     // Advance x position over this run
        }

        // Restore black text (we may have changed color to mark font association)
        SetTextColor(hdc, 0);
    }
}

void PaintFormattedText | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iLineHeight
 | ) |  |

Definition at line 953 of file DspFormt.Cpp.

                       {

    int   icpParaStart;     // First character of line
    int   icpParaEnd;       // End of para (end of buffer or index of CR character)

    // Since we'll output each run independantly, we can't paint the character background
    // lest it erase an overhanging part of a glyph at the end of the previous output run.
    // (This is common - for example most of the Arabic glyphs in Arial overhang a few
    // pixels beyond their advance width)
    SetBkMode(hdc, TRANSPARENT);    // Allow runs to overlap
    icpParaStart = 0;

    // Display line by line
    while (icpParaStart < g_iTextLen)
    {
        // Find end of para or end of buffer
        icpParaEnd = icpParaStart;
        while (icpParaEnd < g_iTextLen  &&  g_wcBuf[icpParaEnd] != 0x0D)
        {
            icpParaEnd++;
        }

        PaintFormattedTextPara(
            hdc,
            piY,
            prc,
            icpParaStart,
            icpParaEnd-icpParaStart,
            iLineHeight);

        // Advance to next line
        if (icpParaEnd < g_iTextLen)
        {
            icpParaEnd++;
        }
        if (icpParaEnd < g_iTextLen  &&  g_wcBuf[icpParaEnd] == 0x0A)
        {
            icpParaEnd++;
        }

        icpParaStart = icpParaEnd;
    }
}

void PaintFormattedTextLine | ( | HDC | hdc,
 |  | int * | piCurStyle,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iFirst,
 |  | int | iLen,
 |  | RUN * | pFirstRun,
 |  | int | cRuns,
 |  | int | iLineHeight
 | ) |  |

Definition at line 567 of file DspFormt.Cpp.

{

    RUN     *pVisualOrder[MAXRUN];  // Array of run pointers in visual order
    int      iPos[MAXRUN];          // Offset to first logical character of each run
    int      iRun    = 0;
    int      iX      = 0;
    RECT     rcClear = {0};

    // Clear each line before displaying it
    rcClear        = *prc;
    rcClear.top    = *piY;
    rcClear.bottom = *piY + iLineHeight;
    FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));

    // Construct array of run pointers in visual order
    BuildVisualDisplayOrder(pFirstRun, cRuns, pVisualOrder, iPos);

    // Display runs in visual order
    iX = prc->left;

    for (iRun = 0; iRun < cRuns; iRun++)
    {
        PaintFormattedRun(
            hdc,
           *piY,
            iLineHeight,
           &iX,                                         // Horizontal position (will be updated)
            piCurStyle,                                 // Current style (will be updated)
            pVisualOrder[iRun]->iStyle,                 // Desired style
           &pVisualOrder[iRun]->analysis,               // Analysis from ScriptItemize
            iFirst+iPos[iRun],
            pVisualOrder[iRun]->iLen);
    }

    // A pending caret position set may not have been handled in the previous loop
    if (    g_fUpdateCaret
        &&  g_iCaretSection == CARET_SECTION_FORMATTED
        &&  g_iCurChar >= iFirst
        &&  g_iCurChar <= iFirst + iLen)
    {
        if (g_iCurChar == iFirst + iLen)
        {
            // Caret is at the end of the line
            g_fUpdateCaret = FALSE;
            ResetCaret(iX, *piY, iLineHeight);
        }
        else
        {
            // If the caret position was changed by a mouse click at one end of a
            // formatted run that requires it to be displayed at the corresponding
            // end of another run, and if that other run happened to have been displayed
            // earlier, we may still have a mouse update pending. In that case,
            // rerun the fancy text display algorithm until the caret has been placed.

            iX = prc->left;
            for (iRun = 0;  g_fUpdateCaret && iRun < cRuns;  iRun++)
            {
                PaintFormattedRun(
                    hdc,
                   *piY,
                    iLineHeight,
                   &iX,                             // Horizontal position (will be updated)
                    piCurStyle,                     // Current style (will be updated)
                    pVisualOrder[iRun]->iStyle,     // Desired style
                   &pVisualOrder[iRun]->analysis,   // Analysis from ScriptItemize
                    iFirst+iPos[iRun],
                    pVisualOrder[iRun]->iLen);
            }
        }
    }

    *piY += iLineHeight;
}

void PaintFormattedTextPara | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iFirst,
 |  | int | iLen,
 |  | int | iLineHeight
 | ) |  |

Definition at line 768 of file DspFormt.Cpp.

{
    WORD            glyphs[MAXGLYPHS];
    WORD            clusters[MAXGLYPHS];
    SCRIPT_VISATTR  visattrs[MAXGLYPHS];
    int             advances[MAXGLYPHS];    // Glyph advance widths
    GOFFSET         goffsets[MAXGLYPHS];    // Glyph 2D offsets
    int             cGlyphs       = 0;
    HRESULT         hr            = NULL;
    RUN            *pFirstParaRun = NULL;
    RUN            *pLineStartRun = NULL;
    RUN            *pLineEndRun   = NULL;
    RUN            *pDelRun       = NULL;
    int             nRuns         = 0;
    int             iLineWidth    = 0;      // Width measured so far
    int             iRunWidth     = 0;      // Width of an individual run
    int             iMaxWidth     = 0;      // Line width
    int             iLineLen      = 0;      // Length in codepoints
    int             iCurStyle     = 0;

    iCurStyle = -1;             // Force style selection on first run
    iMaxWidth = prc->right - prc->left;

    if (iLen > 0  &&  iMaxWidth > 0)
    {
        // Itemize paragraph and merge items with style runs
        BuildParaRunList(iFirst, iLen, &pFirstParaRun, &nRuns);

        if (!g_fFillLines)
        {
            // Display whole para as one line
            PaintFormattedTextLine(
                hdc,
               &iCurStyle,
                piY,
                prc,
                iFirst,
                iLen,
                pFirstParaRun,
                nRuns,
                iLineHeight);

            // Free para run list
            while (pFirstParaRun != NULL)
            {
                pDelRun = pFirstParaRun;
                pFirstParaRun = pFirstParaRun->pNext;
                delete pDelRun;
                pDelRun = NULL;
            }

        }
        else
        {
            // Display paragraph in filled lines
            // Measure runs to fit
            pLineStartRun = pFirstParaRun;

            while (pLineStartRun)
            {
                pLineEndRun = pLineStartRun;
                iLineWidth  = 0;
                nRuns       = 0;
                iLineLen    = 0;

                hr = ShapePlaceRun(
                    hdc,
                   &iCurStyle,
                    pLineEndRun->iStyle,
                   &pLineEndRun->analysis,
                    iFirst + iLineLen,
                    pLineEndRun->iLen,
                  &cGlyphs,
                    glyphs,
                    clusters,
                    visattrs,
                    advances,
                    goffsets,
                   &iRunWidth);

                if (FAILED(hr))
                {
                    return;
                }

                while (pLineEndRun  &&  iLineWidth + iRunWidth <= iMaxWidth)
                {
                    iLineWidth += iRunWidth;
                    iLineLen   += pLineEndRun->iLen;
                    pLineEndRun = pLineEndRun->pNext;
                    nRuns++;

                    if (pLineEndRun)
                    {
                        hr = ShapePlaceRun(
                            hdc,
                           &iCurStyle,
                            pLineEndRun->iStyle,
                           &pLineEndRun->analysis,
                            iFirst + iLineLen,
                            pLineEndRun->iLen,
                          &cGlyphs,
                            glyphs,
                            clusters,
                            visattrs,
                            advances,
                            goffsets,
                           &iRunWidth);

                        if (FAILED(hr))
                        {
                            return;
                        }
                    }
                }

                // Having filled the line with as many whole runs as possible, now
                // break the next run on a word boundary if possible, or between
                // clusters if not.

                if (pLineEndRun  &&  iLineWidth < iMaxWidth)
                {

                    iRunWidth   = BreakRun(
                        pLineEndRun,
                        cGlyphs,
                        advances,
                        clusters,
                        visattrs,
                        iMaxWidth - iLineWidth,
                        iFirst + iLineLen,
                        iLineLen == 0);             // Ensure at least one cluster is broken

                    iLineWidth += iRunWidth;
                    iLineLen   += pLineEndRun->iLen;
                    pLineEndRun = pLineEndRun->pNext;
                    nRuns++;
                }

                PaintFormattedTextLine(
                    hdc,
                   &iCurStyle,
                    piY,
                    prc,
                    iFirst,
                    iLineLen,
                    pLineStartRun,
                    nRuns,
                    iLineHeight);

                // Advance to next line
                iFirst += iLineLen;
                while (pLineStartRun != pLineEndRun)
                {
                    pDelRun = pLineStartRun;
                    pLineStartRun = pLineStartRun->pNext;
                    delete pDelRun;
                    pDelRun = NULL;
                }
            }
        }
    }
    else
    {
        // Empty paragraph
        RECT     rcClear = {0};
        rcClear        = *prc;
        rcClear.top    = *piY;
        rcClear.bottom = *piY + iLineHeight;
        FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));
        *piY += iLineHeight;
    }
}

HRESULT ShapePlaceRun | ( | HDC | hdc,
 |  | int * | piCurStyle,
 |  | int | iStyle,
 |  | SCRIPT_ANALYSIS * | psa,
 |  | int | iPos,
 |  | int | iLen,
 |  | int * | pcGlyphs,
 |  | WORD * | pGlyphs,
 |  | WORD * | pClusters,
 |  | SCRIPT_VISATTR * | pVisattrs,
 |  | int * | piAdvances,
 |  | GOFFSET * | pGoffsets,
 |  | int * | piDx
 | ) |  |

Definition at line 336 of file DspFormt.Cpp.

{
    ABC             abc = {0};          // Run combined ABC
    HRESULT         hr  = NULL;

    // Obey global settings for logical order and NoGlyphIndex
    if (g_fLogicalOrder)
    {
        psa->fLogicalOrder = TRUE;
    }

    if (g_fNoGlyphIndex)
    {
        psa->fNoGlyphIndex = TRUE;
    }

    // Select desired style
    if (iStyle != *piCurStyle)
    {
        *piCurStyle = iStyle;
        SelectObject(hdc, g_style[iStyle].hf);
    }

    // Shape (generate glyphs) with desired style
    hr = ScriptShape(
        hdc,
       &g_style[*piCurStyle].sc,
        g_wcBuf + iPos,
        iLen,
        MAXGLYPHS,
        psa,
        pGlyphs,
        pClusters,
        pVisattrs,
        pcGlyphs);

    if (hr == USP_E_SCRIPT_NOT_IN_FONT)
    {
        // The desired style does not support the script of this run.
        // Implement font association here.

        // In this sample we simply try style 1. A better application may keep a
        // list of standard fonts to try.
        SelectObject(hdc, g_style[1].hf);
        *piCurStyle = 1;

        // Shape with style 1
        hr = ScriptShape(
            hdc,
           &g_style[*piCurStyle].sc,
            g_wcBuf + iPos,
            iLen,
            MAXGLYPHS,
            psa,
            pGlyphs,
            pClusters,
            pVisattrs,
            pcGlyphs);
    }

    if (hr == USP_E_SCRIPT_NOT_IN_FONT)
    {
        // Neither the users selected style nor style 1 support the
        // script of this run, so force the script to 'SCRIPT_UNDEFINED'
        // This will display the characters directly through the fonts
        // CMAP table, probably showing the text as square boxes (the
        // missing glyph)
        psa->eScript = SCRIPT_UNDEFINED;

        // Restore original desired style
        if (iStyle != *piCurStyle)
        {
            *piCurStyle = iStyle;
            SelectObject(hdc, g_style[iStyle].hf);
        }

        // Shape with SCRIPT_UNDEFINED
        hr = ScriptShape(
            hdc,
           &g_style[*piCurStyle].sc,
            g_wcBuf + iPos,
            iLen,
            MAXGLYPHS,
            psa,
            pGlyphs,
            pClusters,
            pVisattrs,
            pcGlyphs);
    }

    // Having generated glyphs, now generate advance widths and combining
    // offsets.
    // A real formatting app would probably use ScriptPlace at more than one
    // resolution, for example at a high 'ideal' resolution for page layout,
    // then again at screen and/or printer resolution for displaying and
    // printing.
    // This sample applet considers only screen resolution.

    if (SUCCEEDED(hr))
    {
        hr = ScriptPlace(
            hdc,
           &g_style[*piCurStyle].sc,
            pGlyphs,
           *pcGlyphs,
            pVisattrs,
            psa,
            piAdvances,
            pGoffsets,
           &abc);

        *piDx = abc.abcA + abc.abcB + abc.abcC;
    }

    return hr;
}

Variable Documentation

const int MAXCHARS = 200

Definition at line 22 of file DspFormt.Cpp.

const int MAXGLYPHS = 200

Definition at line 23 of file DspFormt.Cpp.

const int MAXITEM = 200

Definition at line 20 of file DspFormt.Cpp.

const int MAXRUN = 200

Definition at line 21 of file DspFormt.Cpp.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/DspLogcl.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Defines | Functions

DspLogcl.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Defines

#define | NUMLOGICALFONTS 4

Functions

void | DottedLine (HDC hdc, int x, int y, int dx, int dy)
void | PaintLogical (HDC hdc, int *piY, RECT *prc, int iLineHeight)

Define Documentation

#define NUMLOGICALFONTS 4

Function Documentation

void DottedLine | ( | HDC | hdc,
 |  | int | x,
 |  | int | y,
 |  | int | dx,
 |  | int | dy
 | ) |  |

Definition at line 13 of file DspLogcl.Cpp.

{
    SetPixel(hdc, x, y, 0);

    if (dx)
    {
        // Horizontal line
        while (dx > 2)
        {
            x += 3;
            SetPixel(hdc, x, y, 0);
            dx -= 3;
        }
        x += dx;
        SetPixel(hdc, x, y, 0);

    }
    else
    {
        // Vertical line
        while (dy > 2)
         {
            y += 3;
            SetPixel(hdc, x, y, 0);
            dy -= 3;
        }
        y += dy;
        SetPixel(hdc, x, y, 0);
    }
}

void PaintLogical | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iLineHeight
 | ) |  |

Definition at line 63 of file DspLogcl.Cpp.

{
    const int MAXBUF     = 100;
    const int CELLGAP    = 4;     // Pixels between adjacent glyphs

    int   icpLineStart   = 0;     // First character of line
    int   icpLineEnd     = 0;     // End of line (end of buffer or index of CR character)
    int   icp            = 0;
    int   iLen           = 0;
    int   iPartLen       = 0;     // Part of string in a single font
    int   iPartX         = 0;
    int   iPartWidth     = 0;
    WORD  wGlyphBuf[MAXBUF];
    int   idx[MAXBUF];            // Force widths so all characters show
    BYTE  bFont[MAXBUF];          // Font used for each character
    ABC   abc[MAXBUF];
    int   iTotX          = 0;
    int   ildx           = 0;     // Overall line dx, adjusts for 'A' width of leading glyph
    int   iSliderX       = 0;
    int   iFont          = 0;     // 0 = Microsoft Sans Serif, 1 = Mangal, 2 = Latha
    RECT  rcClear        = {0};   // Clear each line before displaying it

    // Selection highlighting
    bool  bHighlight     = TRUE;  // Current state of highlighting in the hdc
    int   iFrom          = 0;     // Selection range
    int   iTo            = 0;
    DWORD dwOldBkColor   = 0;
    DWORD dwOldTextColor = 0;

    // Item analysis

    SCRIPT_ITEM    items[MAXBUF];
    SCRIPT_CONTROL scriptControl = {0};
    SCRIPT_STATE   scriptState   = {0};
    INT            iItem         = 0;

#define NUMLOGICALFONTS 4

    SCRIPT_CACHE sc[NUMLOGICALFONTS];
    HFONT        hf[NUMLOGICALFONTS];
    HFONT        hfold  = NULL;
    HRESULT      hr     = NULL;

    SCRIPT_FONTPROPERTIES sfp = {0};
    BOOL         bMissing     = FALSE;

    icpLineStart = 0;

    hf[0]    = CreateFont(iLineHeight*7/10, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Microsoft Sans Serif"));
    hf[1]    = CreateFont(iLineHeight*7/10, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Mangal"));
    hf[2]    = CreateFont(iLineHeight*7/10, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Latha"));
    hf[3]    = CreateFont(iLineHeight*7/20, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Microsoft Sans Serif")); // For bidi level digits
    iFont    = 0;
    hfold    = (HFONT) SelectObject(hdc, hf[iFont]);
    ildx     = 0;

    memset(sc, 0, sizeof(sc));
    bHighlight = FALSE;

    INT iSliderHeight = g_fOverrideDx ? iLineHeight * 5 / 10 : 0;
    INT iLevelsHeight = g_fShowLevels ? iLineHeight * 8 / 20 : 0;

    // Display line by line
    while (icpLineStart < g_iTextLen)
    {
        // Clear line before displaying it
        rcClear        = *prc;
        rcClear.top    = *piY;
        rcClear.bottom = *piY + iLineHeight + iSliderHeight + iLevelsHeight;
        FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));

        // Find end of line or end of buffer
        icpLineEnd = icpLineStart;
        while (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] != 0x0D)
        {
            icpLineEnd++;
        }

        if (icpLineEnd - icpLineStart > MAXBUF)
        {
            iLen = MAXBUF;
        }
        else
        {
            iLen = icpLineEnd - icpLineStart;
        }

        // Obtain item analysis
        scriptControl = g_ScriptControl;
        scriptState   = g_ScriptState;
        ScriptItemize(g_wcBuf+icpLineStart, iLen, MAXBUF, &scriptControl, &scriptState, items, NULL);

        // Determine font and glyph index for each codepoint
        if (iFont != 0)        // Start with Microsoft Sans Serif
        {
            iFont = 0;
            SelectObject(hdc, hf[0]);
        }

        hr = ScriptGetCMap(hdc, &sc[iFont], g_wcBuf+icpLineStart, iLen, 0, wGlyphBuf);
        if (SUCCEEDED(hr))
        {
            memset(bFont, 0, iLen);
            if (hr != S_OK)
            {
               // Some characters were not in Microsoft Sans Serif
                sfp.cBytes = sizeof(sfp);
                ScriptGetFontProperties(hdc, &sc[iFont], &sfp);

                bMissing = FALSE;
                for (icp=0; icp<iLen; icp++)
                {
                    if (wGlyphBuf[icp] == sfp.wgDefault)
                    {
                        bFont[icp] = 1;
                        bMissing = TRUE;
                    }
                }

                // Try other fonts
                while (bMissing  &&  iFont < 2)
                {
                    iFont++;
                    SelectObject(hdc, hf[iFont]);
                    ScriptGetFontProperties(hdc, &sc[iFont], &sfp);
                    bMissing = FALSE;
                    for (icp=0; icp<iLen; icp++)
                    {
                        if (bFont[icp] == iFont)
                        {
                            ScriptGetCMap(hdc, &sc[iFont], g_wcBuf+icpLineStart+icp, 1, 0, wGlyphBuf+icp);
                            if (wGlyphBuf[icp] == sfp.wgDefault)
                            {
                                bFont[icp] = (BYTE)(iFont+1);
                                bMissing = TRUE;
                            }
                        }
                    }
                }

                if (bMissing)
                {
                    // Remaining missing characters come from font 0
                    for (icp=0; icp<iLen; icp++)
                    {
                        if (bFont[icp] >= NUMLOGICALFONTS)
                        {
                            bFont[icp] = 0;
                        }
                    }
                }
            }

            // Display each glyphs black box next to the previous. Override the
            // default ABC behaviour.
            idx[0] = 0;
            for (icp=0; icp<iLen; icp++)
            {
                if (iFont != bFont[icp])
                {
                    iFont = bFont[icp];
                    SelectObject(hdc, hf[iFont]);
                }

                ScriptGetGlyphABCWidth(hdc, &sc[iFont], wGlyphBuf[icp], &abc[icp]);

                if (g_wcBuf[icpLineStart+icp] == TCHAR(' '))
                {
                    // Treat entire space as black
                    abc[icp].abcB += abc[icp].abcA;   abc[icp].abcA = 0;
                    abc[icp].abcB += abc[icp].abcC;   abc[icp].abcC = 0;
                }

                // Glyph black box width is abc.abcB
                // We'd like the glyph to appear 2 pixels to the right of the
                // previous glyph.
                //
                // The default placement of left edge is abc.abcA.
                //
                // Therefore we need to shift this character to the right by
                // 2 - abc.abcA to get it positioned correctly. We do this by
                // updating the advance width for the previous character.
                if (!icp)
                {
                    ildx = CELLGAP/2 - abc[icp].abcA;
                }
                else
                {
                    idx[icp-1] += CELLGAP - abc[icp].abcA;
                }

                // Now adjust the advance width for this character to take us to
                // the right edge of it's black box.
                idx[icp] = abc[icp].abcB + abc[icp].abcA;
            }

            // Support selection range specified in either direction
            if (g_iFrom <= g_iTo)
            {
                iFrom = g_iFrom - icpLineStart;
                iTo   = g_iTo   - icpLineStart;
            }
            else
            {
                iFrom = g_iTo   - icpLineStart;
                iTo   = g_iFrom - icpLineStart;
            }

            // Display glyphs in their appropriate fonts
            icp = 0;
            iPartX = prc->left+ildx;

            while (icp < iLen)
            {
                if (iFont != bFont[icp])
                {
                    iFont = bFont[icp];
                    SelectObject(hdc, hf[iFont]);
                }

                // Set selection highlighting at start
                if (    icp >= iFrom
                    &&  icp < iTo
                    &&  !bHighlight)
                {
                    // Turn on highlighting
                    dwOldBkColor   = SetBkColor(hdc,   GetSysColor(COLOR_HIGHLIGHT));
                    dwOldTextColor = SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
                    bHighlight = TRUE;

                }
                else if (    (    icp < iFrom
                                ||  icp >= iTo)
                           &&  bHighlight)
                {
                    // Turn off highlighting
                    SetBkColor(hdc, dwOldBkColor);
                    SetTextColor(hdc, dwOldTextColor);
                    bHighlight = FALSE;
                }

                // Find longest run from a single font, and
                // without change of highlighting.

                iPartLen   = 0;
                iPartWidth = 0;

                while (    icp+iPartLen < iLen
                       &&  iFont == bFont[icp+iPartLen]
                       &&  bHighlight == (icp+iPartLen >= iFrom && icp+iPartLen < iTo))
                {
                    iPartWidth += idx[icp+iPartLen];
                    iPartLen++;
                }

                // Display single font, single highlighting
                ExtTextOutW(hdc,
                    iPartX,
                    *piY+2,
                    ETO_CLIPPED | ETO_GLYPH_INDEX,
                    prc,
                    wGlyphBuf+icp,
                    iPartLen,
                    idx+icp);

                icp    += iPartLen;
                iPartX += iPartWidth;
            }

            // Mark the cells to make the characters stand out clearly
            MoveToEx(hdc, prc->left, *piY, NULL);
            LineTo(hdc,   prc->left, *piY + iLineHeight*3/4);

            iTotX = 0;

            for (icp=0; icp<iLen; icp++)
            {
                iTotX += abc[icp].abcB + CELLGAP;
                idx[icp] = iTotX;   // Record cell position for mouse hit testing
                DottedLine(hdc, prc->left + iTotX, *piY, 0, iLineHeight*3/4);

                // Add slider for OverridedDx control
                if (g_fOverrideDx)
                {
                    iSliderX = prc->left + (icp==0 ? idx[0]/2 : (idx[icp-1] + idx[icp])/2);

                    // Draw the axis of the slider
                    DottedLine(hdc, iSliderX, *piY + iLineHeight*35/40, 0, iSliderHeight*35/40);

                    // Draw the knob
                    if (g_iWidthBuf[icpLineStart + icp] < iSliderHeight)
                    {
                        MoveToEx(hdc, iSliderX-2, *piY + iLineHeight*35/40 + iSliderHeight*35/40 - g_iWidthBuf[icpLineStart + icp], NULL);
                        LineTo  (hdc, iSliderX+3, *piY + iLineHeight*35/40 + iSliderHeight*35/40 - g_iWidthBuf[icpLineStart + icp]);
                    }
                    else
                    {
                        MoveToEx(hdc, iSliderX-2, *piY + iLineHeight*35/40, NULL);
                        LineTo  (hdc, iSliderX+3, *piY + iLineHeight*35/40);
                    }
                }
            }

            MoveToEx(hdc, prc->left + iTotX, *piY, NULL);
            LineTo(hdc,   prc->left + iTotX, *piY + iLineHeight*30/40);

            MoveToEx(hdc, prc->left, *piY, NULL);
            LineTo(hdc,   prc->left + iTotX, *piY);
            MoveToEx(hdc, prc->left, *piY + iLineHeight*30/40, NULL);
            LineTo(hdc,   prc->left + iTotX, *piY + iLineHeight*30/40);

            if (g_fShowLevels)
            {
                // Display bidi levels for each codepoint
                iItem = 0;
                iFont = 3;
                SelectObject(hdc, hf[3]);

                for (icp=0; icp<iLen; icp++)
                {
                    if (icp == items[iItem+1].iCharPos)
                    {
                        iItem++;

                        // Draw a vertical line to mark the item boundary
                        MoveToEx(hdc, prc->left + idx[icp-1], *piY + iLineHeight*35/40 + iSliderHeight, NULL);
                        LineTo(  hdc, prc->left + idx[icp-1], *piY + iLineHeight*35/40 + iSliderHeight + iLevelsHeight*35/40);
                    }

                    // Establish where horizontally to display the digit

                    char chDigit = char('0' + items[iItem].a.s.uBidiLevel);
                    int digitWidth = 0;
                    GetCharWidth32A(hdc, chDigit, chDigit, &digitWidth);

                    ExtTextOutA(
                        hdc,
                        prc->left + (icp==0 ? idx[0]/2 : (idx[icp-1] + idx[icp])/2) - digitWidth / 2,
                        *piY + iLineHeight*35/40 + iSliderHeight,
                        0,
                        NULL,
                        &chDigit,
                        1,
                        NULL);
                }
            }

            // Check whether mouse clicks in this line are waiting to be processed
            if (    g_fOverrideDx
                &&  g_fMouseUp  &&  g_iMouseUpY > *piY + iLineHeight*33/40  &&  g_iMouseUpY < *piY + iLineHeight*63/40)
            {
                // Procss change to DX override slider
                icp = 0;
                while (icp<iLen  &&  prc->left + idx[icp] < g_iMouseUpX)
                {
                    icp++;
                }

                g_iWidthBuf[icpLineStart+icp] = *piY + 60 - g_iMouseUpY; // Adjust this slider
                InvalidateText();   // Force slider to redraw at new position
                g_fMouseDown = FALSE;
                g_fMouseUp   = FALSE;
                g_iFrom = icpLineStart+icp;
                g_iTo   = icpLineStart+icp;

            }
            else if (g_fMouseDown  &&  g_iMouseDownY > *piY  &&  g_iMouseDownY < *piY+iLineHeight)
            {
                // Handle text selection

                // Record char pos at left button down
                // Snap mouse hit to closest character boundary
                if (g_iMouseDownX < prc->left + idx[0]/2)
                {
                    icp = 0;
                }
                else
                {
                    icp = 1;
                    while (    icp < iLen
                           &&  g_iMouseDownX > prc->left + (idx[icp-1] + idx[icp]) / 2)
                    {
                        icp++;
                    }
                }

                g_iFrom = icp + icpLineStart;

                if (g_iFrom < icpLineStart)
                {
                    g_iFrom = icpLineStart;
                }
                if (g_iFrom > icpLineEnd)
                {
                    g_iFrom = icpLineEnd;
                }
                g_fMouseDown = FALSE;
            }

            if (g_fMouseUp  &&  g_iMouseUpY > *piY  &&  g_iMouseUpY < *piY+iLineHeight)
            {
                // Complete selection processing
                if (g_iMouseUpX < prc->left + idx[0]/2)
                {
                    icp = 0;
                }
                else
                {
                    icp = 1;
                    while (    icp < iLen
                           &&  g_iMouseUpX > prc->left + (idx[icp-1] + idx[icp]) / 2)
                    {
                        icp++;
                    }
                }
                g_iTo = icp + icpLineStart;

                if (g_iTo < icpLineStart)
                {
                    g_iTo = icpLineStart;
                }
                if (g_iTo > icpLineEnd)
                {
                    g_iTo = icpLineEnd;
                }

                // Caret is where mouse was raised
                g_iCurChar = g_iTo;
                g_iCaretSection = CARET_SECTION_LOGICAL;  // Show caret in logical text
                g_fUpdateCaret = TRUE;

                g_fMouseUp = FALSE;     // Signal that the mouse up is processed

            }

            if (    g_fUpdateCaret
                &&  g_iCurChar >= icpLineStart
                &&  g_iCurChar <= icpLineEnd
                &&  g_iCaretSection == CARET_SECTION_LOGICAL)
            {
                g_fUpdateCaret = FALSE;
                if (g_iCurChar <= icpLineStart)
                {
                    ResetCaret(prc->left, *piY, iLineHeight);
                }
                else
                {
                    ResetCaret(prc->left + idx[g_iCurChar - icpLineStart - 1], *piY, iLineHeight);
                }
            }

        }
        else
        {
            // ScriptGetCMap failed - therefore this is not a glyphable font.
            // This could indicate
            //      A printer device font
            //      We're running on FE Win95 which cannot handle glyph indices
            //
            // For the sample app, we know we are using a glyphable Truetype font
            // on a screen DC, so it must mean the sample is running on a Far
            // East version of Windows 95.
            // Theoretically we could go to the trouble of calling
            // WideCharToMultiByte and using the 'A' char interfaces to
            // implement DspLogcl.
            // However this is only a sample program - DspPlain and DspFormt
            // work correctly, but there's no advantage in implementing
            // DspLogcl so well.
            // Display an apology.

            ExtTextOutA(hdc, prc->left+2, *piY+2, ETO_CLIPPED, prc, "Sorry, no logical text display on Far East Windows 95.", 54, NULL);
            icpLineEnd = g_iTextLen;  // Hack to stop display of subsequent lines
        }

        *piY += iLineHeight + iSliderHeight + iLevelsHeight;

        // Advance to next line
        if (g_fPresentation)
        {
            icpLineStart = g_iTextLen;  // Only show one line in presentation mode
        }
        else
        {
            if (icpLineEnd < g_iTextLen)
            {
                icpLineEnd++;
            }
            if (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] == 0x0A)
            {
                icpLineEnd++;
            }
            icpLineStart = icpLineEnd;
        }
    }

    SelectObject(hdc, hfold);

    if (bHighlight)
    {
        // Turn off highlighting
        SetBkColor(hdc, dwOldBkColor);
        SetTextColor(hdc, dwOldTextColor);
        bHighlight = FALSE;
    }

    for (iFont=0; iFont<NUMLOGICALFONTS; iFont++)
    {
        DeleteObject(hf[iFont]);
        if (sc[iFont])
        {
            ScriptFreeCache(&sc[iFont]);
        }
    }
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/DspPlain.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions

DspPlain.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Functions

void | PaintPlainText (HDC hdc, int *piY, RECT *prc, int iLineHeight)
void | PaintPlainTextLine (HDC hdc, int *piY, RECT *prc, int iFirst, int iLen, int iLineHeight)

Function Documentation

void PaintPlainText | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iLineHeight
 | ) |  |

Definition at line 250 of file DspPlain.Cpp.

{
    int      icpLineStart = 0;     // First character of line
    int      icpLineEnd   = 0;       // End of line (end of buffer or index of CR character)
    HFONT    hFont        = NULL;
    HFONT    hOldFont     = NULL;
    LOGFONT  lf           = {0};

    icpLineStart = 0;

    if (    g_fPresentation
        &&  GetObject(g_style[0].hf, sizeof(lf), &lf))
    {
        // Select font using the entire line height
        hFont = CreateFont(
            iLineHeight,
            0, 0, 0,
            lf.lfWeight,
            lf.lfItalic,
            lf.lfUnderline,
            lf.lfStrikeOut,
            lf.lfCharSet,
            OUT_DEFAULT_PRECIS,
            CLIP_DEFAULT_PRECIS,
            DEFAULT_QUALITY,
            FF_DONTCARE|DEFAULT_PITCH,
            lf.lfFaceName);
        hOldFont = (HFONT) SelectObject(hdc, hFont);
    }
    else
    {
        // Select users font
        hOldFont = (HFONT) SelectObject(hdc, g_style[0].hf);
    }

    // Display line by line
    while (icpLineStart < g_iTextLen)
    {
        // Find end of line or end of buffer
        icpLineEnd = icpLineStart;
        while (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] != 0x0D)
        {
            icpLineEnd++;
        }

        PaintPlainTextLine(
            hdc,
            piY,
            prc,
            icpLineStart,
            icpLineEnd-icpLineStart,
            iLineHeight);

        if (g_fPresentation)
        {
            // Display only one line in presentation mode
            icpLineStart = g_iTextLen;
        }
        else
        {
            // Advance to next line
            if (icpLineEnd < g_iTextLen)
            {
                icpLineEnd++;
            }
            if (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] == 0x0A)
            {
                icpLineEnd++;
            }
            icpLineStart = icpLineEnd;
        }
    }

    if (g_fPresentation)
    {
        SelectObject(hdc, hOldFont);
    }
}

void PaintPlainTextLine | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iFirst,
 |  | int | iLen,
 |  | int | iLineHeight
 | ) |  |

Definition at line 20 of file DspPlain.Cpp.

{
    int      iX         = 0;
    HRESULT  hr         = NULL;
    int      iClipWidth = 0;
    int      iTrailing  = 0;         // ScriptStringXtoCP result - offset to nearest cluster edge
    RECT     rc         = {0};
    RECT     rcClear    = {0};
    int      iFrom      = 0;
    int      iTo        = 0;
    DWORD    dwFlags    = 0;

    SCRIPT_CONTROL         ScriptControl = {0};
    SCRIPT_STATE           ScriptState   = {0};
    SCRIPT_STRING_ANALYSIS ssa           = {0};

    // Clear each line before displaying it
    rcClear        = *prc;
    rcClear.top    = *piY;
    rcClear.bottom = *piY + iLineHeight;
    FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));

    if (iLen)
    {
        // There's at least one character to display
        iX = prc->left;

        // Prepare string analysis input parameters
        dwFlags = g_dwSSAflags | SSA_GLYPHS;    // Require glyph generation for ScriptStringOut

        ScriptControl = g_ScriptControl;
        ScriptState   = g_ScriptState;

        if (ScriptState.uBidiLevel & 1)        // ScriptStringAnalyse requires SSA_RTL for rtl reading order
        {
            dwFlags |= SSA_RTL;
        }

        iClipWidth = prc->right - prc->left - 50;

        // Analyse the string.
        //
        // ScriptStringAnalyse calls the ScriptItemize, ScriptShape,
        // ScriptPlace and ScriptBreak APIs and returns a pointer to a block
        // of memory containing all these results.
        if (!g_fOverrideDx)
        {
            // Normal - no DX override testing required
            hr = ScriptStringAnalyse(
                    hdc,
                    g_wcBuf + iFirst,
                    iLen, 0, -1,
                    dwFlags,
                    iClipWidth,
                    g_fNullState ? NULL : &ScriptControl,
                    g_fNullState ? NULL : &ScriptState,
                    NULL,
                    NULL, NULL, &ssa);

            // Testing
            int iNewLen = *ScriptString_pcOutChars(&ssa);
            // End testing
        }
        else
        {
            // For logical DX override testing, initialise g_iWidthBuf the
            // first time, subsequently follow it's specification.
            // The UI allows users to adjust individual logical widths.
            if (g_iWidthBuf[iFirst+iLen] == 0)
            {
                g_iWidthBuf[iFirst+iLen] = 1;  // Mark this line as measured
                hr = ScriptStringAnalyse(
                        hdc,
                        g_wcBuf + iFirst,
                        iLen, 0, -1,
                        dwFlags,
                        iClipWidth,
                        g_fNullState ? NULL : &ScriptControl,
                        g_fNullState ? NULL : &ScriptState,
                        NULL,
                        NULL, NULL, &ssa);

                if (SUCCEEDED(hr))
                {
                    hr = ScriptStringGetLogicalWidths(ssa, g_iWidthBuf + iFirst);
                }

                InvalidateText();   // Need to redisplay logical area with corrected sliders

            }
            else
            {
                hr = ScriptStringAnalyse(
                        hdc,
                        g_wcBuf + iFirst,
                        iLen, 0, -1,
                        dwFlags,
                        iClipWidth,
                        g_fNullState ? NULL : &ScriptControl,
                        g_fNullState ? NULL : &ScriptState,
                        g_iWidthBuf + iFirst,
                        NULL, NULL, &ssa);
            }
        }

        if (SUCCEEDED(hr))
        {
            // Check whether mouse clicks in this line are waiting to be processed
            if (g_fMouseDown  &&  g_iMouseDownY > *piY  &&  g_iMouseDownY < *piY+iLineHeight)
            {
                // Record char pos at left button down
                ScriptStringXtoCP(ssa, g_iMouseDownX-prc->left, &g_iFrom, &iTrailing);
                g_iFrom += iTrailing + iFirst; // Snap to closest cluster edge and make relative to buffer
                g_fMouseDown = FALSE;
            }

            if (g_fMouseUp  &&  g_iMouseUpY > *piY  &&  g_iMouseUpY < *piY+iLineHeight)
            {
                // Complete selection processing
                ScriptStringXtoCP(ssa, g_iMouseUpX-prc->left, &g_iTo, &iTrailing);
                g_iTo += iTrailing + iFirst; // Snap to closest cluster edge and make relative to buffer

                // Caret is where mouse was raised
                g_iCurChar = g_iTo;
                g_fMouseUp = FALSE;     // Signal that the mouse up is processed
                g_fUpdateCaret = TRUE;  // Request caret update
                g_iCaretSection = CARET_SECTION_PLAINTEXT;    // in plaintext section
            }

            // Display this line
            rc        = *prc;          // Clip to line height (important for selection marking)
            rc.top    = *piY;
            rc.bottom = *piY + iLineHeight;

            // Support selection range specified in either direction
            if (g_iFrom <= g_iTo)
            {
                iFrom = g_iFrom - iFirst;
                iTo   = g_iTo   - iFirst;
            }
            else
            {
                iFrom = g_iTo   - iFirst;
                iTo   = g_iFrom - iFirst;
            }

            hr = ScriptStringOut(
                ssa,
                prc->left,
               *piY,
                ETO_CLIPPED,
               &rc,
                iFrom,   // ScriptStringOut will ignore From/To that are outside this line
                iTo,
                FALSE);

            // Now position the caret if it has moved, either because of a mouse click
            // detected above, or because of an editing function such as a cursor key.

            if (    g_fUpdateCaret
                &&  g_iCaretSection == CARET_SECTION_PLAINTEXT
                &&  g_iCurChar >= iFirst
                &&  g_iCurChar <= iFirst+iLen)
            {
                // Display caret at coordinate corresponding to g_iCurChar
                g_fUpdateCaret = FALSE;
                if (g_iCurChar < iFirst + iLen)
                {
                    ScriptStringCPtoX(ssa, g_iCurChar - iFirst, FALSE, &g_iCaretX);
                }
                else
                {
                    // represent end of line position by placing caret at right edge
                    g_iCaretX = ScriptString_pSize(ssa)->cx;
                }

                ResetCaret(prc->left + g_iCaretX, *piY, iLineHeight);
            }

            // Show clipping boundary
            if (dwFlags & (SSA_FIT | SSA_CLIP))
            {
                TEXTMETRIC tma = {0};
                GetTextMetrics(hdc, &tma);

                MoveToEx(hdc, iX-1, *piY, NULL);
                LineTo(hdc,   iX-1, *piY + tma.tmAscent + tma.tmDescent);

                MoveToEx(hdc, iX + iClipWidth, *piY, NULL);
                LineTo(hdc,   iX + iClipWidth, *piY + tma.tmAscent + tma.tmDescent);

                MoveToEx(hdc, iX,              *piY-1, NULL);
                LineTo  (hdc, iX + iClipWidth, *piY-1);

                MoveToEx(hdc, iX,              *piY + tma.tmAscent, NULL);
                LineTo  (hdc, iX + iClipWidth, *piY + tma.tmAscent);

                MoveToEx(hdc, iX,              *piY + tma.tmAscent + tma.tmDescent, NULL);
                LineTo  (hdc, iX + iClipWidth, *piY + tma.tmAscent + tma.tmDescent);
            }

            ScriptStringFree(&ssa);
        }
    }
    else
    {
        // Although the line is empty we may still need to display the caret
        if (    g_fUpdateCaret
            &&  g_iCaretSection == CARET_SECTION_PLAINTEXT
            &&  g_iCurChar == iFirst)
        {
            g_fUpdateCaret = FALSE;
            ResetCaret(prc->left, *piY, iLineHeight);
        }
    }

    *piY += iLineHeight;
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Edit.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions

Edit.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Functions

BOOL | EditChar (WCHAR wc)
BOOL | EditKeyDown (WCHAR wc)

Function Documentation

BOOL EditChar ( WCHAR wc )

Definition at line 121 of file Edit.Cpp.

{
    BOOL bSucess = TRUE;
    switch(wc)
    {
        case VK_RETURN:
            if (!TextInsert(g_iCurChar, L"\r\n", 2))
            {
                bSucess = FALSE;
                break;
            }
            InvalidateText();
            g_iCurChar+=2;
            break;

        case VK_BACK:
            if (g_iCurChar)
            {
                g_iCurChar--;
                if (    g_iCurChar
                    &&  g_wcBuf[g_iCurChar] == 0x000A
                    &&  g_wcBuf[g_iCurChar-1] == 0x000D)
                {
                    g_iCurChar--;
                    TextDelete(g_iCurChar, 2);
                }
                else
                {
                    TextDelete(g_iCurChar, 1);
                }
                InvalidateText();
                g_fUpdateCaret = TRUE;
            }
            break;

        case 1:  // Ctrl/A - select all
            g_iFrom = 0;
            g_iTo = g_iTextLen;
            InvalidateText();
            break;

        default:
            /* if(!((wc >= 0x0900 && wc < 0x0d80)
                      || wc == 0x200c
                      || wc == 0x200d))
               {
                    TranslateCharToUnicode(&wc);
               }
            */
            if (!TextInsert(g_iCurChar, &wc, 1))
            {
                bSucess = FALSE;
                break;
            }

            // If there was a range marked previously, now delete that range
            if (g_iFrom < g_iTo)
            {
                TextDelete(g_iFrom, g_iTo-g_iFrom);
                g_iTo      = g_iFrom;
                g_iCurChar = g_iFrom+1;
            }
            else if (g_iTo < g_iFrom)
            {
                TextDelete(g_iTo, g_iFrom-g_iTo);
                g_iFrom    = g_iTo;
                g_iCurChar = g_iTo+1;
            }
            else
            {
                // No prior selected text
                g_iCurChar++;
            }

            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;
    }

    return bSucess;
}

BOOL EditKeyDown ( WCHAR wc )

Definition at line 7 of file Edit.Cpp.

{
    switch(wc)
    {
        case VK_LEFT:
            if (g_iCurChar)
            {
                g_iCurChar--;
                if (    g_iCurChar
                    &&  g_wcBuf[g_iCurChar] == 0x000A
                    &&  g_wcBuf[g_iCurChar-1] == 0x000D)
                {
                    g_iCurChar--;
                }

                // If shift is down, extend selection, else clear it
                if (GetKeyState(VK_SHIFT) >= 0)
                {
                    g_iFrom = g_iCurChar;
                }
                g_iTo = g_iCurChar;

                InvalidateText();
                g_fUpdateCaret = TRUE;
            }
            break;

        case VK_RIGHT:
            if (g_iCurChar < g_iTextLen)
            {
                if (    g_iCurChar < g_iTextLen-1
                    &&  g_wcBuf[g_iCurChar] == 0x000D
                    &&  g_wcBuf[g_iCurChar+1] == 0x000A)
                {
                    g_iCurChar+= 2;
                }
                else
                {
                    g_iCurChar++;
                }

                // If shift is down, extend selection, else clear it
                if (GetKeyState(VK_SHIFT) >= 0)
                {
                    g_iFrom = g_iCurChar;
                }
                g_iTo = g_iCurChar;

                InvalidateText();
                g_fUpdateCaret = TRUE;
            }
            break;

        case VK_HOME:
            // Implemented as - go to start of text
            g_iCurChar = 0;
            g_iFrom    = 0;
            g_iTo      = 0;
            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;

        case VK_END:
            // Implemented as - go to end of text
            g_iCurChar = g_iTextLen;
            g_iFrom    = g_iTextLen;
            g_iTo      = g_iTextLen;
            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;

        case VK_DELETE:
            if (g_iFrom != g_iTo)
            {
                // Delete selection
                if (g_iFrom < g_iTo)
                {
                    TextDelete(g_iFrom, g_iTo-g_iFrom);
                    g_iTo      = g_iFrom;
                    g_iCurChar = g_iFrom;
                }
                else
                {
                    TextDelete(g_iTo, g_iFrom-g_iTo);
                    g_iTo      = g_iTo;
                    g_iCurChar = g_iTo;
                }
            }
            else
            {
                // Delete character
                if (g_iCurChar < g_iTextLen)
                {
                    if (    g_iCurChar < g_iTextLen-1
                        &&  g_wcBuf[g_iCurChar] == 0x000D
                        &&  g_wcBuf[g_iCurChar+1] == 0x000A)
                    {
                        TextDelete(g_iCurChar, 2);
                    }
                    else
                    {
                        TextDelete(g_iCurChar, 1);
                    }
                }
            }

            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;
    }

    return TRUE;
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Global.h File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Classes | Defines | Functions | Variables

Global.h File Reference

Go to the source code of this file.

Classes

struct | DebugGlobals
Debug variables. More...
struct | RUN
struct | STYLE

Defines

#define | APPNAMEA "CSSamp"
#define | APPNAMEW L"CSSamp"
#define | APPTITLEA "CSSamp - Uniscribe complex script sample application"
#define | APPTITLEW L"CSSamp - Uniscribe complex script sample application"
#define | ASSERT(a) {if (!(a)) TRACEMSG(("Assertion failure: "#a));}
#define | ASSERTHR(a, b)
#define | ASSERTS(a, b) {if (!(a)) TRACEMSG(("Assertion failure: "#a" - "#b));}
#define | GLOBAL extern
#define | GLOBALINIT(a)
#define | TRACEMSG(a) {DG.psFile=__FILE__; DG.iLine=__LINE__; DebugMsg a;}

Functions

HWND | CreateTextWindow ()
void WINAPIV | DebugHr (char *fmt,...)
void WINAPIV | DebugMsg (char *fmt,...)
BOOL | EditChar (WCHAR wc)
void | EditFreeCaches ()
void | EditInsertUnicode ()
BOOL | EditKeyDown (WCHAR wc)
void | FreeStyles ()
GLOBAL BOOL g_bUnicodeWnd | GLOBALINIT (FALSE)
GLOBAL SCRIPT_CONTROL
g_ScriptControl 		GLOBALINIT ({0})
GLOBAL DWORD g_dwSSAflags | GLOBALINIT (SSA_FALLBACK)
GLOBAL HINSTANCE g_hInstance | GLOBALINIT (NULL)
GLOBAL int g_iTextLen | GLOBALINIT (0)
GLOBAL int g_iCaretSection | GLOBALINIT (CARET_SECTION_LOGICAL)
GLOBAL BOOL g_fFillLines | GLOBALINIT (TRUE)
void | InitStyles ()
void | InitText ()
void | InvalidateText ()
void | PaintFormattedText (HDC hdc, int *piY, RECT *prc, int iLineHeight)
void | PaintLogical (HDC hdc, int *piY, RECT *prc, int iLineHeight)
void | PaintPlainText (HDC hdc, int *piY, RECT *prc, int iLineHeight)
void | ResetCaret (int iX, int iY, int iHeight)
void | SetLogFont (PLOGFONTA plf, int iHeight, int iWeight, int iItalic, int iUnderline, char *pcFaceName)
void | SetStyle (int iStyle, int iHeight, int iWeight, int iItalic, int iUnderline, char *pcFaceName)
INT_PTR CALLBACK | SettingsDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL StyleCheckRange ()
void | StyleDeleteRange (int iDelPos, int iDelLen)
void | StyleExtendRange (int iExtPos, int iExtLen)
void | StyleSetRange (int iSetStyle, int iSetPos, int iSetLen)
BOOL | TextDelete (int iPos, int iLen)
BOOL | TextInsert (int iPos, PWCH pwc, int iLen)
LRESULT CALLBACK | TextWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

Variables

const int | CARET_SECTION_FORMATTED = 2
const int | CARET_SECTION_LOGICAL = 0
const int | CARET_SECTION_PLAINTEXT = 1
GLOBAL int | g_iMinHeight
GLOBAL int | g_iMinWidth
GLOBAL int | g_iSettingsHeight
GLOBAL int | g_iSettingsWidth
GLOBAL int | g_iWidthBuf [MAX_TEXT]
GLOBAL STYLE g_style [MAX_STYLES]
GLOBAL WCHAR | g_wcBuf [MAX_TEXT]
const int | MAX_STYLES = 5
const int | MAX_TEXT = 10000

Define Documentation

#define APPNAMEA "CSSamp"

Definition at line 9 of file Global.h.

#define APPNAMEW L"CSSamp"

Definition at line 11 of file Global.h.

#define APPTITLEA "CSSamp - Uniscribe complex script sample application"

Definition at line 10 of file Global.h.

#define APPTITLEW L"CSSamp - Uniscribe complex script sample application"

Definition at line 12 of file Global.h.

#define ASSERT ( a ) {if (!(a)) TRACEMSG(("Assertion failure: "#a));}

Definition at line 215 of file Global.h.

#define ASSERTHR | ( | a,
 |  | b
 | ) |
Value:
{if (!SUCCEEDED(a)) {DG.psFile=__FILE__; \
                        DG.iLine=__LINE__; DG.hrLastError=a; DebugHr b;}}

Definition at line 217 of file Global.h.

#define ASSERTS | ( | a,
 |  | b |
 | ) |  | {if (!(a)) TRACEMSG(("Assertion failure: "#a" - "#b));}

Definition at line 216 of file Global.h.

#define GLOBAL extern

Definition at line 45 of file Global.h.

#define GLOBALINIT ( a )

Definition at line 46 of file Global.h.

#define TRACEMSG ( a ) {DG.psFile=__FILE__; DG.iLine=__LINE__; DebugMsg a;}

Definition at line 214 of file Global.h.

Function Documentation

HWND CreateTextWindow ( )

Definition at line 363 of file TextWnd.Cpp.

{
    WNDCLASSA  wcA  = {0};
    WNDCLASSW  wcW  = {0};
    HWND       hWnd = NULL;

    // Try registering as a Unicode window
    wcW.style         = CS_HREDRAW | CS_VREDRAW;
    wcW.lpfnWndProc   = TextWndProc;
    wcW.cbClsExtra    = 0;
    wcW.cbWndExtra    = 0;
    wcW.hInstance     = g_hInstance;
    wcW.hIcon         = LoadIconW(g_hInstance, APPNAMEW);
    wcW.hCursor       = LoadCursorW(NULL, (WCHAR*)IDC_ARROW);
    wcW.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wcW.lpszMenuName  = APPNAMEW;
    wcW.lpszClassName = APPNAMEW;

    if (RegisterClassW(&wcW))
    {
        // Use a Unicode window
        g_bUnicodeWnd = TRUE;
        hWnd  = CreateWindowW(
            APPNAMEW, APPTITLEW,
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT, 0,
            CW_USEDEFAULT, 0,
            NULL, NULL,
            g_hInstance,
            NULL);

    }
    else
    {
        // Must use an ANSI window.
        wcA.style         = CS_HREDRAW | CS_VREDRAW;
        wcA.lpfnWndProc   = TextWndProc;
        wcA.cbClsExtra    = 0;
        wcA.cbWndExtra    = 0;
        wcA.hInstance     = g_hInstance;
        wcA.hIcon         = LoadIconA(g_hInstance, APPNAMEA);
        wcA.hCursor       = LoadCursorA(NULL, (LPCSTR)IDC_ARROW);
        wcA.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
        wcA.lpszMenuName  = APPNAMEA;
        wcA.lpszClassName = APPNAMEA;

        if (!RegisterClassA(&wcA))
        {
            hWnd = NULL;
        }
        else
        {
            g_bUnicodeWnd = FALSE;

            hWnd  = CreateWindowA(
                APPNAMEA, APPTITLEA,
                WS_OVERLAPPEDWINDOW,
                CW_USEDEFAULT, 0,
                CW_USEDEFAULT, 0,
                NULL, NULL,
                g_hInstance,
                NULL);
        }
    }

    return hWnd;
}

void WINAPIV DebugHr | ( | char * | fmt,
 |  |  | ...
 | ) |  |

Definition at line 39 of file Debug.Cpp.

{
    va_list vargs;
    char c[200];

//    TIMESUSPEND;

    wsprintfA(c, "%s[%d]                   ", strrchr(DG.psFile, '\\')+1, DG.iLine);
    c[17] = 0;
    OutputDebugStringA(c);

    wsprintfA(c, "%ld:      ", GetCurrentThreadId());
    c[5] = 0;
    OutputDebugStringA(c);

    va_start(vargs, fmt);
    wvnsprintfA(c,sizeof(c), fmt, vargs);
    OutputDebugStringA(c);

    //
    // Parse USP and Win32 Errors
    //

    switch( DG.hrLastError )
    {
    case USP_E_SCRIPT_NOT_IN_FONT:
      lstrcpyA( DG.sLastError , "Selected font doesn't contain requested script\n");
      break;

    default:
      FormatMessageA(
          FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
          NULL, DG.hrLastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
          DG.sLastError, sizeof(DG.sLastError), NULL);
    }

    wnsprintfA(c,sizeof(c)," -- HRESULT = %x: %s", DG.hrLastError, DG.sLastError);
    OutputDebugStringA(c);
//    TIMERESUME;
}

void WINAPIV DebugMsg | ( | char * | fmt,
 |  |  | ...
 | ) |  |

Debug function prototypes.

Definition at line 15 of file Debug.Cpp.

{
    va_list vargs;
    char c[200];

//    TIMESUSPEND;

    wnsprintfA(c,sizeof(c),"%s[%d]                   ", strrchr(DG.psFile, '\\')+1, DG.iLine);
    c[17] = 0;
    OutputDebugStringA(c);

    wnsprintfA(c,sizeof(c),"%ld:      ", GetCurrentThreadId());
    c[5] = 0;
    OutputDebugStringA(c);

    va_start(vargs, fmt);
    wvnsprintfA(c,sizeof(c),fmt,vargs);
    OutputDebugStringA(c);

    OutputDebugStringA("\n");

//    TIMERESUME;
}

BOOL EditChar ( WCHAR wc )

Definition at line 121 of file Edit.Cpp.

{
    BOOL bSucess = TRUE;
    switch(wc)
    {
        case VK_RETURN:
            if (!TextInsert(g_iCurChar, L"\r\n", 2))
            {
                bSucess = FALSE;
                break;
            }
            InvalidateText();
            g_iCurChar+=2;
            break;

        case VK_BACK:
            if (g_iCurChar)
            {
                g_iCurChar--;
                if (    g_iCurChar
                    &&  g_wcBuf[g_iCurChar] == 0x000A
                    &&  g_wcBuf[g_iCurChar-1] == 0x000D)
                {
                    g_iCurChar--;
                    TextDelete(g_iCurChar, 2);
                }
                else
                {
                    TextDelete(g_iCurChar, 1);
                }
                InvalidateText();
                g_fUpdateCaret = TRUE;
            }
            break;

        case 1:  // Ctrl/A - select all
            g_iFrom = 0;
            g_iTo = g_iTextLen;
            InvalidateText();
            break;

        default:
            /* if(!((wc >= 0x0900 && wc < 0x0d80)
                      || wc == 0x200c
                      || wc == 0x200d))
               {
                    TranslateCharToUnicode(&wc);
               }
            */
            if (!TextInsert(g_iCurChar, &wc, 1))
            {
                bSucess = FALSE;
                break;
            }

            // If there was a range marked previously, now delete that range
            if (g_iFrom < g_iTo)
            {
                TextDelete(g_iFrom, g_iTo-g_iFrom);
                g_iTo      = g_iFrom;
                g_iCurChar = g_iFrom+1;
            }
            else if (g_iTo < g_iFrom)
            {
                TextDelete(g_iTo, g_iFrom-g_iTo);
                g_iFrom    = g_iTo;
                g_iCurChar = g_iTo+1;
            }
            else
            {
                // No prior selected text
                g_iCurChar++;
            }

            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;
    }

    return bSucess;
}

void EditFreeCaches ( )
void EditInsertUnicode ( )
BOOL EditKeyDown ( WCHAR wc )

Definition at line 7 of file Edit.Cpp.

{
    switch(wc)
    {
        case VK_LEFT:
            if (g_iCurChar)
            {
                g_iCurChar--;
                if (    g_iCurChar
                    &&  g_wcBuf[g_iCurChar] == 0x000A
                    &&  g_wcBuf[g_iCurChar-1] == 0x000D)
                {
                    g_iCurChar--;
                }

                // If shift is down, extend selection, else clear it
                if (GetKeyState(VK_SHIFT) >= 0)
                {
                    g_iFrom = g_iCurChar;
                }
                g_iTo = g_iCurChar;

                InvalidateText();
                g_fUpdateCaret = TRUE;
            }
            break;

        case VK_RIGHT:
            if (g_iCurChar < g_iTextLen)
            {
                if (    g_iCurChar < g_iTextLen-1
                    &&  g_wcBuf[g_iCurChar] == 0x000D
                    &&  g_wcBuf[g_iCurChar+1] == 0x000A)
                {
                    g_iCurChar+= 2;
                }
                else
                {
                    g_iCurChar++;
                }

                // If shift is down, extend selection, else clear it
                if (GetKeyState(VK_SHIFT) >= 0)
                {
                    g_iFrom = g_iCurChar;
                }
                g_iTo = g_iCurChar;

                InvalidateText();
                g_fUpdateCaret = TRUE;
            }
            break;

        case VK_HOME:
            // Implemented as - go to start of text
            g_iCurChar = 0;
            g_iFrom    = 0;
            g_iTo      = 0;
            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;

        case VK_END:
            // Implemented as - go to end of text
            g_iCurChar = g_iTextLen;
            g_iFrom    = g_iTextLen;
            g_iTo      = g_iTextLen;
            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;

        case VK_DELETE:
            if (g_iFrom != g_iTo)
            {
                // Delete selection
                if (g_iFrom < g_iTo)
                {
                    TextDelete(g_iFrom, g_iTo-g_iFrom);
                    g_iTo      = g_iFrom;
                    g_iCurChar = g_iFrom;
                }
                else
                {
                    TextDelete(g_iTo, g_iFrom-g_iTo);
                    g_iTo      = g_iTo;
                    g_iCurChar = g_iTo;
                }
            }
            else
            {
                // Delete character
                if (g_iCurChar < g_iTextLen)
                {
                    if (    g_iCurChar < g_iTextLen-1
                        &&  g_wcBuf[g_iCurChar] == 0x000D
                        &&  g_wcBuf[g_iCurChar+1] == 0x000A)
                    {
                        TextDelete(g_iCurChar, 2);
                    }
                    else
                    {
                        TextDelete(g_iCurChar, 1);
                    }
                }
            }

            InvalidateText();
            g_fUpdateCaret = TRUE;
            break;
    }

    return TRUE;
}

void FreeStyles ( )

Definition at line 67 of file Style.Cpp.

{
    int i = 0;
    for (i = 0; i < 5; ++i)
    {
        FreeStyle(i);
    }
}

GLOBAL BOOL g_fMouseUp GLOBALINIT ( FALSE )
GLOBAL DebugGlobals DG GLOBALINIT ( )
GLOBAL DWORD g_dwSSAflags GLOBALINIT ( SSA_FALLBACK )
GLOBAL HFONT g_hfCaption GLOBALINIT ( NULL )
GLOBAL UINT debug GLOBALINIT ( 0 )
GLOBAL int g_iCaretSection GLOBALINIT ( CARET_SECTION_LOGICAL )
GLOBAL int g_fUpdateCaret GLOBALINIT ( TRUE )
void InitStyles ( )

Definition at line 62 of file Style.Cpp.

{
    memset(g_style, 0, sizeof(g_style));
}

void InitText ( )

Definition at line 11 of file Text.Cpp.

{
    HMODULE    hmod  = NULL;
    HRSRC      hrsrc = NULL;
    HGLOBAL    hglob = NULL;
    WCHAR     *pwcIt = NULL;  // Initial text
    int        i     = 0;

    g_iTextLen = 0;
    hmod       = GetModuleHandle(NULL);
    hrsrc      = FindResourceA(hmod, (LPCSTR)110, "INITIALTEXT");
    hglob      = LoadResource(hmod, hrsrc);
    g_iTextLen = SizeofResource(hmod, hrsrc) - 2;  // Remove leading byte order mark
    pwcIt      = (WCHAR*) LockResource(hglob);

    if (!hmod  ||  !hrsrc  ||  !hglob  ||  !pwcIt  ||  !g_iTextLen)
    {
        ASSERTS(hmod,    "GetModuleHandle(usptest.exe) failed");
        ASSERTS(hrsrc,   "FindResource(110, INITIALTEXT) failed");
        ASSERTS(hglob,   "LoadResource(110, INITIALTEXT) failed");
        ASSERTS(pwcIt,   "LockResource(110, INITIALTEXT) failed");
        ASSERTS(g_iTextLen, "INITIALTEXT length zero");

        g_iTextLen = 0;
    }

    if (g_iTextLen >= sizeof(g_wcBuf))
    {
        g_iTextLen = sizeof(g_wcBuf);
    }

    _memccpy(g_wcBuf, pwcIt+1,WCHAR('\0'),g_iTextLen);
    g_iTextLen <<= 1;  // Bytes to characters

    i = 0;
    while (i < g_iTextLen  &&  g_wcBuf[i])
    {
        i++;
    }

    g_iTextLen = i;

    // Construct initial formatting style run covering the entire text
    StyleExtendRange(0, g_iTextLen);
    ASSERT(StyleCheckRange());
}

void InvalidateText ( )

Definition at line 10 of file TextWnd.Cpp.

{
    RECT rc = {0};

    rc.left   = g_fPresentation ? 0 : g_iSettingsWidth;
    rc.top    = 0;
    rc.right  = 10000;
    rc.bottom = 10000;
    InvalidateRect(g_hTextWnd, &rc, TRUE);
}

void PaintFormattedText | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iLineHeight
 | ) |  |

Definition at line 953 of file DspFormt.Cpp.

                       {

    int   icpParaStart;     // First character of line
    int   icpParaEnd;       // End of para (end of buffer or index of CR character)

    // Since we'll output each run independantly, we can't paint the character background
    // lest it erase an overhanging part of a glyph at the end of the previous output run.
    // (This is common - for example most of the Arabic glyphs in Arial overhang a few
    // pixels beyond their advance width)
    SetBkMode(hdc, TRANSPARENT);    // Allow runs to overlap
    icpParaStart = 0;

    // Display line by line
    while (icpParaStart < g_iTextLen)
    {
        // Find end of para or end of buffer
        icpParaEnd = icpParaStart;
        while (icpParaEnd < g_iTextLen  &&  g_wcBuf[icpParaEnd] != 0x0D)
        {
            icpParaEnd++;
        }

        PaintFormattedTextPara(
            hdc,
            piY,
            prc,
            icpParaStart,
            icpParaEnd-icpParaStart,
            iLineHeight);

        // Advance to next line
        if (icpParaEnd < g_iTextLen)
        {
            icpParaEnd++;
        }
        if (icpParaEnd < g_iTextLen  &&  g_wcBuf[icpParaEnd] == 0x0A)
        {
            icpParaEnd++;
        }

        icpParaStart = icpParaEnd;
    }
}

void PaintLogical | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iLineHeight
 | ) |  |

Definition at line 63 of file DspLogcl.Cpp.

{
    const int MAXBUF     = 100;
    const int CELLGAP    = 4;     // Pixels between adjacent glyphs

    int   icpLineStart   = 0;     // First character of line
    int   icpLineEnd     = 0;     // End of line (end of buffer or index of CR character)
    int   icp            = 0;
    int   iLen           = 0;
    int   iPartLen       = 0;     // Part of string in a single font
    int   iPartX         = 0;
    int   iPartWidth     = 0;
    WORD  wGlyphBuf[MAXBUF];
    int   idx[MAXBUF];            // Force widths so all characters show
    BYTE  bFont[MAXBUF];          // Font used for each character
    ABC   abc[MAXBUF];
    int   iTotX          = 0;
    int   ildx           = 0;     // Overall line dx, adjusts for 'A' width of leading glyph
    int   iSliderX       = 0;
    int   iFont          = 0;     // 0 = Microsoft Sans Serif, 1 = Mangal, 2 = Latha
    RECT  rcClear        = {0};   // Clear each line before displaying it

    // Selection highlighting
    bool  bHighlight     = TRUE;  // Current state of highlighting in the hdc
    int   iFrom          = 0;     // Selection range
    int   iTo            = 0;
    DWORD dwOldBkColor   = 0;
    DWORD dwOldTextColor = 0;

    // Item analysis

    SCRIPT_ITEM    items[MAXBUF];
    SCRIPT_CONTROL scriptControl = {0};
    SCRIPT_STATE   scriptState   = {0};
    INT            iItem         = 0;

#define NUMLOGICALFONTS 4

    SCRIPT_CACHE sc[NUMLOGICALFONTS];
    HFONT        hf[NUMLOGICALFONTS];
    HFONT        hfold  = NULL;
    HRESULT      hr     = NULL;

    SCRIPT_FONTPROPERTIES sfp = {0};
    BOOL         bMissing     = FALSE;

    icpLineStart = 0;

    hf[0]    = CreateFont(iLineHeight*7/10, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Microsoft Sans Serif"));
    hf[1]    = CreateFont(iLineHeight*7/10, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Mangal"));
    hf[2]    = CreateFont(iLineHeight*7/10, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Latha"));
    hf[3]    = CreateFont(iLineHeight*7/20, 0, 0, 0, 0, 0, 0, 0, 1,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH, TEXT("Microsoft Sans Serif")); // For bidi level digits
    iFont    = 0;
    hfold    = (HFONT) SelectObject(hdc, hf[iFont]);
    ildx     = 0;

    memset(sc, 0, sizeof(sc));
    bHighlight = FALSE;

    INT iSliderHeight = g_fOverrideDx ? iLineHeight * 5 / 10 : 0;
    INT iLevelsHeight = g_fShowLevels ? iLineHeight * 8 / 20 : 0;

    // Display line by line
    while (icpLineStart < g_iTextLen)
    {
        // Clear line before displaying it
        rcClear        = *prc;
        rcClear.top    = *piY;
        rcClear.bottom = *piY + iLineHeight + iSliderHeight + iLevelsHeight;
        FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));

        // Find end of line or end of buffer
        icpLineEnd = icpLineStart;
        while (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] != 0x0D)
        {
            icpLineEnd++;
        }

        if (icpLineEnd - icpLineStart > MAXBUF)
        {
            iLen = MAXBUF;
        }
        else
        {
            iLen = icpLineEnd - icpLineStart;
        }

        // Obtain item analysis
        scriptControl = g_ScriptControl;
        scriptState   = g_ScriptState;
        ScriptItemize(g_wcBuf+icpLineStart, iLen, MAXBUF, &scriptControl, &scriptState, items, NULL);

        // Determine font and glyph index for each codepoint
        if (iFont != 0)        // Start with Microsoft Sans Serif
        {
            iFont = 0;
            SelectObject(hdc, hf[0]);
        }

        hr = ScriptGetCMap(hdc, &sc[iFont], g_wcBuf+icpLineStart, iLen, 0, wGlyphBuf);
        if (SUCCEEDED(hr))
        {
            memset(bFont, 0, iLen);
            if (hr != S_OK)
            {
               // Some characters were not in Microsoft Sans Serif
                sfp.cBytes = sizeof(sfp);
                ScriptGetFontProperties(hdc, &sc[iFont], &sfp);

                bMissing = FALSE;
                for (icp=0; icp<iLen; icp++)
                {
                    if (wGlyphBuf[icp] == sfp.wgDefault)
                    {
                        bFont[icp] = 1;
                        bMissing = TRUE;
                    }
                }

                // Try other fonts
                while (bMissing  &&  iFont < 2)
                {
                    iFont++;
                    SelectObject(hdc, hf[iFont]);
                    ScriptGetFontProperties(hdc, &sc[iFont], &sfp);
                    bMissing = FALSE;
                    for (icp=0; icp<iLen; icp++)
                    {
                        if (bFont[icp] == iFont)
                        {
                            ScriptGetCMap(hdc, &sc[iFont], g_wcBuf+icpLineStart+icp, 1, 0, wGlyphBuf+icp);
                            if (wGlyphBuf[icp] == sfp.wgDefault)
                            {
                                bFont[icp] = (BYTE)(iFont+1);
                                bMissing = TRUE;
                            }
                        }
                    }
                }

                if (bMissing)
                {
                    // Remaining missing characters come from font 0
                    for (icp=0; icp<iLen; icp++)
                    {
                        if (bFont[icp] >= NUMLOGICALFONTS)
                        {
                            bFont[icp] = 0;
                        }
                    }
                }
            }

            // Display each glyphs black box next to the previous. Override the
            // default ABC behaviour.
            idx[0] = 0;
            for (icp=0; icp<iLen; icp++)
            {
                if (iFont != bFont[icp])
                {
                    iFont = bFont[icp];
                    SelectObject(hdc, hf[iFont]);
                }

                ScriptGetGlyphABCWidth(hdc, &sc[iFont], wGlyphBuf[icp], &abc[icp]);

                if (g_wcBuf[icpLineStart+icp] == TCHAR(' '))
                {
                    // Treat entire space as black
                    abc[icp].abcB += abc[icp].abcA;   abc[icp].abcA = 0;
                    abc[icp].abcB += abc[icp].abcC;   abc[icp].abcC = 0;
                }

                // Glyph black box width is abc.abcB
                // We'd like the glyph to appear 2 pixels to the right of the
                // previous glyph.
                //
                // The default placement of left edge is abc.abcA.
                //
                // Therefore we need to shift this character to the right by
                // 2 - abc.abcA to get it positioned correctly. We do this by
                // updating the advance width for the previous character.
                if (!icp)
                {
                    ildx = CELLGAP/2 - abc[icp].abcA;
                }
                else
                {
                    idx[icp-1] += CELLGAP - abc[icp].abcA;
                }

                // Now adjust the advance width for this character to take us to
                // the right edge of it's black box.
                idx[icp] = abc[icp].abcB + abc[icp].abcA;
            }

            // Support selection range specified in either direction
            if (g_iFrom <= g_iTo)
            {
                iFrom = g_iFrom - icpLineStart;
                iTo   = g_iTo   - icpLineStart;
            }
            else
            {
                iFrom = g_iTo   - icpLineStart;
                iTo   = g_iFrom - icpLineStart;
            }

            // Display glyphs in their appropriate fonts
            icp = 0;
            iPartX = prc->left+ildx;

            while (icp < iLen)
            {
                if (iFont != bFont[icp])
                {
                    iFont = bFont[icp];
                    SelectObject(hdc, hf[iFont]);
                }

                // Set selection highlighting at start
                if (    icp >= iFrom
                    &&  icp < iTo
                    &&  !bHighlight)
                {
                    // Turn on highlighting
                    dwOldBkColor   = SetBkColor(hdc,   GetSysColor(COLOR_HIGHLIGHT));
                    dwOldTextColor = SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
                    bHighlight = TRUE;

                }
                else if (    (    icp < iFrom
                                ||  icp >= iTo)
                           &&  bHighlight)
                {
                    // Turn off highlighting
                    SetBkColor(hdc, dwOldBkColor);
                    SetTextColor(hdc, dwOldTextColor);
                    bHighlight = FALSE;
                }

                // Find longest run from a single font, and
                // without change of highlighting.

                iPartLen   = 0;
                iPartWidth = 0;

                while (    icp+iPartLen < iLen
                       &&  iFont == bFont[icp+iPartLen]
                       &&  bHighlight == (icp+iPartLen >= iFrom && icp+iPartLen < iTo))
                {
                    iPartWidth += idx[icp+iPartLen];
                    iPartLen++;
                }

                // Display single font, single highlighting
                ExtTextOutW(hdc,
                    iPartX,
                    *piY+2,
                    ETO_CLIPPED | ETO_GLYPH_INDEX,
                    prc,
                    wGlyphBuf+icp,
                    iPartLen,
                    idx+icp);

                icp    += iPartLen;
                iPartX += iPartWidth;
            }

            // Mark the cells to make the characters stand out clearly
            MoveToEx(hdc, prc->left, *piY, NULL);
            LineTo(hdc,   prc->left, *piY + iLineHeight*3/4);

            iTotX = 0;

            for (icp=0; icp<iLen; icp++)
            {
                iTotX += abc[icp].abcB + CELLGAP;
                idx[icp] = iTotX;   // Record cell position for mouse hit testing
                DottedLine(hdc, prc->left + iTotX, *piY, 0, iLineHeight*3/4);

                // Add slider for OverridedDx control
                if (g_fOverrideDx)
                {
                    iSliderX = prc->left + (icp==0 ? idx[0]/2 : (idx[icp-1] + idx[icp])/2);

                    // Draw the axis of the slider
                    DottedLine(hdc, iSliderX, *piY + iLineHeight*35/40, 0, iSliderHeight*35/40);

                    // Draw the knob
                    if (g_iWidthBuf[icpLineStart + icp] < iSliderHeight)
                    {
                        MoveToEx(hdc, iSliderX-2, *piY + iLineHeight*35/40 + iSliderHeight*35/40 - g_iWidthBuf[icpLineStart + icp], NULL);
                        LineTo  (hdc, iSliderX+3, *piY + iLineHeight*35/40 + iSliderHeight*35/40 - g_iWidthBuf[icpLineStart + icp]);
                    }
                    else
                    {
                        MoveToEx(hdc, iSliderX-2, *piY + iLineHeight*35/40, NULL);
                        LineTo  (hdc, iSliderX+3, *piY + iLineHeight*35/40);
                    }
                }
            }

            MoveToEx(hdc, prc->left + iTotX, *piY, NULL);
            LineTo(hdc,   prc->left + iTotX, *piY + iLineHeight*30/40);

            MoveToEx(hdc, prc->left, *piY, NULL);
            LineTo(hdc,   prc->left + iTotX, *piY);
            MoveToEx(hdc, prc->left, *piY + iLineHeight*30/40, NULL);
            LineTo(hdc,   prc->left + iTotX, *piY + iLineHeight*30/40);

            if (g_fShowLevels)
            {
                // Display bidi levels for each codepoint
                iItem = 0;
                iFont = 3;
                SelectObject(hdc, hf[3]);

                for (icp=0; icp<iLen; icp++)
                {
                    if (icp == items[iItem+1].iCharPos)
                    {
                        iItem++;

                        // Draw a vertical line to mark the item boundary
                        MoveToEx(hdc, prc->left + idx[icp-1], *piY + iLineHeight*35/40 + iSliderHeight, NULL);
                        LineTo(  hdc, prc->left + idx[icp-1], *piY + iLineHeight*35/40 + iSliderHeight + iLevelsHeight*35/40);
                    }

                    // Establish where horizontally to display the digit

                    char chDigit = char('0' + items[iItem].a.s.uBidiLevel);
                    int digitWidth = 0;
                    GetCharWidth32A(hdc, chDigit, chDigit, &digitWidth);

                    ExtTextOutA(
                        hdc,
                        prc->left + (icp==0 ? idx[0]/2 : (idx[icp-1] + idx[icp])/2) - digitWidth / 2,
                        *piY + iLineHeight*35/40 + iSliderHeight,
                        0,
                        NULL,
                        &chDigit,
                        1,
                        NULL);
                }
            }

            // Check whether mouse clicks in this line are waiting to be processed
            if (    g_fOverrideDx
                &&  g_fMouseUp  &&  g_iMouseUpY > *piY + iLineHeight*33/40  &&  g_iMouseUpY < *piY + iLineHeight*63/40)
            {
                // Procss change to DX override slider
                icp = 0;
                while (icp<iLen  &&  prc->left + idx[icp] < g_iMouseUpX)
                {
                    icp++;
                }

                g_iWidthBuf[icpLineStart+icp] = *piY + 60 - g_iMouseUpY; // Adjust this slider
                InvalidateText();   // Force slider to redraw at new position
                g_fMouseDown = FALSE;
                g_fMouseUp   = FALSE;
                g_iFrom = icpLineStart+icp;
                g_iTo   = icpLineStart+icp;

            }
            else if (g_fMouseDown  &&  g_iMouseDownY > *piY  &&  g_iMouseDownY < *piY+iLineHeight)
            {
                // Handle text selection

                // Record char pos at left button down
                // Snap mouse hit to closest character boundary
                if (g_iMouseDownX < prc->left + idx[0]/2)
                {
                    icp = 0;
                }
                else
                {
                    icp = 1;
                    while (    icp < iLen
                           &&  g_iMouseDownX > prc->left + (idx[icp-1] + idx[icp]) / 2)
                    {
                        icp++;
                    }
                }

                g_iFrom = icp + icpLineStart;

                if (g_iFrom < icpLineStart)
                {
                    g_iFrom = icpLineStart;
                }
                if (g_iFrom > icpLineEnd)
                {
                    g_iFrom = icpLineEnd;
                }
                g_fMouseDown = FALSE;
            }

            if (g_fMouseUp  &&  g_iMouseUpY > *piY  &&  g_iMouseUpY < *piY+iLineHeight)
            {
                // Complete selection processing
                if (g_iMouseUpX < prc->left + idx[0]/2)
                {
                    icp = 0;
                }
                else
                {
                    icp = 1;
                    while (    icp < iLen
                           &&  g_iMouseUpX > prc->left + (idx[icp-1] + idx[icp]) / 2)
                    {
                        icp++;
                    }
                }
                g_iTo = icp + icpLineStart;

                if (g_iTo < icpLineStart)
                {
                    g_iTo = icpLineStart;
                }
                if (g_iTo > icpLineEnd)
                {
                    g_iTo = icpLineEnd;
                }

                // Caret is where mouse was raised
                g_iCurChar = g_iTo;
                g_iCaretSection = CARET_SECTION_LOGICAL;  // Show caret in logical text
                g_fUpdateCaret = TRUE;

                g_fMouseUp = FALSE;     // Signal that the mouse up is processed

            }

            if (    g_fUpdateCaret
                &&  g_iCurChar >= icpLineStart
                &&  g_iCurChar <= icpLineEnd
                &&  g_iCaretSection == CARET_SECTION_LOGICAL)
            {
                g_fUpdateCaret = FALSE;
                if (g_iCurChar <= icpLineStart)
                {
                    ResetCaret(prc->left, *piY, iLineHeight);
                }
                else
                {
                    ResetCaret(prc->left + idx[g_iCurChar - icpLineStart - 1], *piY, iLineHeight);
                }
            }

        }
        else
        {
            // ScriptGetCMap failed - therefore this is not a glyphable font.
            // This could indicate
            //      A printer device font
            //      We're running on FE Win95 which cannot handle glyph indices
            //
            // For the sample app, we know we are using a glyphable Truetype font
            // on a screen DC, so it must mean the sample is running on a Far
            // East version of Windows 95.
            // Theoretically we could go to the trouble of calling
            // WideCharToMultiByte and using the 'A' char interfaces to
            // implement DspLogcl.
            // However this is only a sample program - DspPlain and DspFormt
            // work correctly, but there's no advantage in implementing
            // DspLogcl so well.
            // Display an apology.

            ExtTextOutA(hdc, prc->left+2, *piY+2, ETO_CLIPPED, prc, "Sorry, no logical text display on Far East Windows 95.", 54, NULL);
            icpLineEnd = g_iTextLen;  // Hack to stop display of subsequent lines
        }

        *piY += iLineHeight + iSliderHeight + iLevelsHeight;

        // Advance to next line
        if (g_fPresentation)
        {
            icpLineStart = g_iTextLen;  // Only show one line in presentation mode
        }
        else
        {
            if (icpLineEnd < g_iTextLen)
            {
                icpLineEnd++;
            }
            if (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] == 0x0A)
            {
                icpLineEnd++;
            }
            icpLineStart = icpLineEnd;
        }
    }

    SelectObject(hdc, hfold);

    if (bHighlight)
    {
        // Turn off highlighting
        SetBkColor(hdc, dwOldBkColor);
        SetTextColor(hdc, dwOldTextColor);
        bHighlight = FALSE;
    }

    for (iFont=0; iFont<NUMLOGICALFONTS; iFont++)
    {
        DeleteObject(hf[iFont]);
        if (sc[iFont])
        {
            ScriptFreeCache(&sc[iFont]);
        }
    }
}

void PaintPlainText | ( | HDC | hdc,
 |  | int * | piY,
 |  | RECT * | prc,
 |  | int | iLineHeight
 | ) |  |

Definition at line 250 of file DspPlain.Cpp.

{
    int      icpLineStart = 0;     // First character of line
    int      icpLineEnd   = 0;       // End of line (end of buffer or index of CR character)
    HFONT    hFont        = NULL;
    HFONT    hOldFont     = NULL;
    LOGFONT  lf           = {0};

    icpLineStart = 0;

    if (    g_fPresentation
        &&  GetObject(g_style[0].hf, sizeof(lf), &lf))
    {
        // Select font using the entire line height
        hFont = CreateFont(
            iLineHeight,
            0, 0, 0,
            lf.lfWeight,
            lf.lfItalic,
            lf.lfUnderline,
            lf.lfStrikeOut,
            lf.lfCharSet,
            OUT_DEFAULT_PRECIS,
            CLIP_DEFAULT_PRECIS,
            DEFAULT_QUALITY,
            FF_DONTCARE|DEFAULT_PITCH,
            lf.lfFaceName);
        hOldFont = (HFONT) SelectObject(hdc, hFont);
    }
    else
    {
        // Select users font
        hOldFont = (HFONT) SelectObject(hdc, g_style[0].hf);
    }

    // Display line by line
    while (icpLineStart < g_iTextLen)
    {
        // Find end of line or end of buffer
        icpLineEnd = icpLineStart;
        while (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] != 0x0D)
        {
            icpLineEnd++;
        }

        PaintPlainTextLine(
            hdc,
            piY,
            prc,
            icpLineStart,
            icpLineEnd-icpLineStart,
            iLineHeight);

        if (g_fPresentation)
        {
            // Display only one line in presentation mode
            icpLineStart = g_iTextLen;
        }
        else
        {
            // Advance to next line
            if (icpLineEnd < g_iTextLen)
            {
                icpLineEnd++;
            }
            if (icpLineEnd < g_iTextLen  &&  g_wcBuf[icpLineEnd] == 0x0A)
            {
                icpLineEnd++;
            }
            icpLineStart = icpLineEnd;
        }
    }

    if (g_fPresentation)
    {
        SelectObject(hdc, hOldFont);
    }
}

void ResetCaret | ( | int | iX,
 |  | int | iY,
 |  | int | iHeight
 | ) |  |

Definition at line 95 of file TextWnd.Cpp.

{
    g_iCaretX = iX;
    g_iCaretY = iY;

    if (g_iCaretHeight != iHeight)
    {
        g_iCaretHeight = iHeight;
        HideCaret(g_hTextWnd);
        DestroyCaret();
        CreateCaret(g_hTextWnd, NULL, 0, g_iCaretHeight);
        SetCaretPos(g_iCaretX, g_iCaretY);
        ShowCaret(g_hTextWnd);
    }
    else
    {
        SetCaretPos(g_iCaretX, g_iCaretY);
    }
}

void SetLogFont | ( | PLOGFONTA | plf,
 |  | int | iHeight,
 |  | int | iWeight,
 |  | int | iItalic,
 |  | int | iUnderline,
 |  | char * | pcFaceName
 | ) |  |

Definition at line 9 of file Style.Cpp.

{

    memset(plf, 0, sizeof(LOGFONTA));
    plf->lfCharSet        = DEFAULT_CHARSET;
    plf->lfHeight         = iHeight;
    plf->lfWeight         = iWeight;
    plf->lfItalic         = (BYTE) iItalic;
    plf->lfUnderline      = (BYTE) iUnderline;
    lstrcpynA(plf->lfFaceName, pcFaceName, min(sizeof(plf->lfFaceName),sizeof(pcFaceName)));
    plf->lfOutPrecision   = OUT_STROKE_PRECIS;
    plf->lfClipPrecision  = CLIP_STROKE_PRECIS;
    plf->lfQuality        = DRAFT_QUALITY;
    plf->lfPitchAndFamily = VARIABLE_PITCH;
    plf->lfEscapement     = 0;
    plf->lfOrientation    = 0;
}

void SetStyle | ( | int | iStyle,
 |  | int | iHeight,
 |  | int | iWeight,
 |  | int | iItalic,
 |  | int | iUnderline,
 |  | char * | pcFaceName
 | ) |  |

Definition at line 46 of file Style.Cpp.

{
    LOGFONTA lf = {0};
    FreeStyle(iStyle);

    SetLogFont(&lf, iHeight, iWeight, iItalic, iUnderline, pcFaceName);
    g_style[iStyle].hf = CreateFontIndirectA(&lf);
    g_style[iStyle].sc = NULL;
}

INT_PTR CALLBACK SettingsDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 701 of file Settings.Cpp.

{
        int i = 0;

        switch (uMsg)
        {
        case WM_INITDIALOG:
            // Populate the Unicode codepoint combo box
            for (i = 0; i < sizeof(szUniChar)/sizeof(szUniChar[0]); ++i)
            {
                SendDlgItemMessage(hDlg, IDC_CODEPOINT, CB_ADDSTRING, 0, (LPARAM)szUniChar[i]);
            }

            for (i = 0; i < sizeof(szLanguage)/sizeof(szLanguage[0]); ++i)
            {
                SendDlgItemMessage(hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)szLanguage[i]);
            }

            SendDlgItemMessage(hDlg, IDC_LANGUAGE, CB_SETCURSEL, 0, 0);
            SendDlgItemMessage(hDlg, IDC_LTR,       BM_SETSTATE, TRUE, 0);
            SendDlgItemMessage(hDlg, IDC_HORIZ,     BM_SETSTATE, TRUE, 0);
            SendDlgItemMessage(hDlg, IDC_LOGICAL,   BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_PLAINTEXT, BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_FORMATTED, BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_LINEFILL,  BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_PLAINTEXT_FALLBACK, BM_SETCHECK, BST_CHECKED, 0);

            InitFaceLists(hDlg);
            break;

        case WM_COMMAND:
            Command(hDlg, LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
            break;

        }

        return FALSE;
}

BOOL StyleCheckRange ( )

Definition at line 79 of file Style.Cpp.

{
    int     iFormatPos   = 0;
    RUN    *pFormatRider = NULL;

    // Check that style length is same as text length
    pFormatRider = g_pFirstFormatRun;
    iFormatPos = 0;
    while (pFormatRider != NULL)
    {
        iFormatPos += pFormatRider->iLen;
        pFormatRider = pFormatRider->pNext;
    }

    return iFormatPos == g_iTextLen;
}

void StyleDeleteRange | ( | int | iDelPos,
 |  | int | iDelLen
 | ) |  |

StyleDeleteRange - delete range of style information.

Definition at line 118 of file Style.Cpp.

{

    int     iFormatPos   = 0;
    RUN    *pFormatRider = NULL;
    RUN    *pPrevRun     = NULL;
    RUN    *pDelRun      = NULL;            // Run to be deleted

    if (iDelLen <= 0) return;

    // Find first run affected by the deletion
    iFormatPos   = 0;
    pFormatRider = g_pFirstFormatRun;
    pPrevRun = NULL;

    while (iFormatPos + pFormatRider->iLen <= iDelPos)
    {
        iFormatPos  += pFormatRider->iLen;
        pPrevRun     = pFormatRider;
        pFormatRider = pFormatRider->pNext;
        ASSERT(pFormatRider);
    }

    // Delete from end of first run
    if (iDelPos + iDelLen  >  iFormatPos + pFormatRider->iLen)
    {

        // Delete all the way from iDelPos to the end of the first affected run
        iDelLen = iDelPos + iDelLen - (iFormatPos + pFormatRider->iLen);    // Amount that will remain to be deleted
        pFormatRider->iLen = iDelPos - iFormatPos;

    }
    else
    {
        // Deletion is entirely in the first affected run
        pFormatRider->iLen -= iDelLen;
        iDelLen = 0;
    }

    // First affected run now contains no range to be deleted
    // If it's empty, remove it, otherwise step over it
    if (pFormatRider->iLen == 0)
    {
        // Remove redundant run
        if (pFormatRider->pNext)
        {
            // Replace this run by the next one
            pDelRun       = pFormatRider->pNext;
            *pFormatRider = *pDelRun;                 // Copy content of next run over this one
            delete pDelRun;
            pDelRun = NULL;
        }
        else
        {
            // No runs following this one
            if (pPrevRun)
            {
                ASSERT(iDelLen == 0);
                delete pFormatRider;
                pFormatRider = NULL;
                pPrevRun->pNext = NULL;
            }
            else
            {
                // No runs left at all
                ASSERT(iDelLen == 0);
                delete pFormatRider;
                pFormatRider = NULL;
                g_pFirstFormatRun = NULL;
            }
        }
    }
    else
    {
        //  Current run now contains no text to be deleted, so advance to next run
        iFormatPos  += pFormatRider->iLen;
        pPrevRun     = pFormatRider;
        pFormatRider = pFormatRider->pNext;
    }

    // Delete from start of any remaining runs
    while (iDelLen > 0)
    {
        if (pFormatRider->iLen <= iDelLen)
        {
            // This entire run must go
            ASSERT(pFormatRider->pNext);
            iDelLen -= pFormatRider->iLen;
            pDelRun  = pFormatRider->pNext;
            *pFormatRider = *pDelRun;
            delete pDelRun;
            pDelRun = NULL;
        }
        else
        {
            // Last run is deleted in part only
            pFormatRider->iLen -= iDelLen;
            iDelLen = 0;
        }
    }

    // Check whether current run (which immediately follows deletion) can
    // now be collapsed into the previous run
    if (pPrevRun  &&  pFormatRider  &&  pPrevRun->iStyle == pFormatRider->iStyle)
    {
        pPrevRun->iLen += pFormatRider->iLen;
        pPrevRun->pNext = pFormatRider->pNext;
        delete pFormatRider;
        pFormatRider = NULL;
    }
}

void StyleExtendRange | ( | int | iExtPos,
 |  | int | iExtLen
 | ) |  |

StyleExtendRange - Extend style immediately preceeding iPos by iLen characters.

Definition at line 235 of file Style.Cpp.

{

    int     iFormatPos = 0;
    RUN    *pFormatRider = NULL;
    const SCRIPT_ANALYSIS nullAnalysis = {0};

    if (g_pFirstFormatRun == NULL)
    {
        // Starting from no text at all
        ASSERT(iExtPos == 0);
        g_pFirstFormatRun           = new RUN;
        g_pFirstFormatRun->iLen     = iExtLen;
        g_pFirstFormatRun->iStyle   = 1;
        g_pFirstFormatRun->pNext    = NULL;
        g_pFirstFormatRun->analysis = nullAnalysis;

    }
    else
    {
        // Find run containing character immediately prior to iExtPos
        iFormatPos = 0;
        pFormatRider = g_pFirstFormatRun;

        while (iFormatPos + pFormatRider->iLen < iExtPos)
        {
            iFormatPos += pFormatRider->iLen;
            pFormatRider = pFormatRider->pNext;
        }

        pFormatRider->iLen += iExtLen;
    }
}

void StyleSetRange | ( | int | iSetStyle,
 |  | int | iSetPos,
 |  | int | iSetLen
 | ) |  |

Definition at line 274 of file Style.Cpp.

{

    int     iFormatPos   = 0;
    RUN    *pFormatRider = NULL;
    RUN    *pNewRun      = NULL;

    if (iSetLen <= 0) return;

    // Remove existing style for the range

    StyleDeleteRange(iSetPos, iSetLen);

    if (g_pFirstFormatRun == NULL)
    {

        // Replace style on entire text
        g_pFirstFormatRun = new RUN;
        g_pFirstFormatRun->pNext = NULL;
        g_pFirstFormatRun->iLen = iSetLen;
        g_pFirstFormatRun->iStyle = iSetStyle;
    }
    else
    {
        // Find first run affected by the change
        iFormatPos   = 0;
        pFormatRider = g_pFirstFormatRun;
        while (iFormatPos + pFormatRider->iLen < iSetPos)
        {
            iFormatPos  += pFormatRider->iLen;
            pFormatRider = pFormatRider->pNext;
            ASSERT(pFormatRider);
        }

        // New style starts after beginning of this run or at beginning of next run
        if (pFormatRider->iStyle == iSetStyle)
        {
            // Already the same style - just increase length
            pFormatRider->iLen += iSetLen;
        }
        else
        {
            if (iFormatPos + pFormatRider->iLen > iSetPos)
            {
                // New style is within this run
                // Split this run around the new run
                pNewRun = new RUN;          // Create second part of existing run
                *pNewRun = *pFormatRider;
                pNewRun->iLen      -= iSetPos - iFormatPos;
                pFormatRider->iLen  = iSetPos - iFormatPos;
                pFormatRider->pNext = pNewRun;

                pNewRun = new RUN;          // Create inserted run
                *pNewRun = *pFormatRider;
                pNewRun->iLen = iSetLen;
                pNewRun->iStyle = iSetStyle;
                pFormatRider->pNext = pNewRun;
            }
            else
            {
                // New style is between this run and the next run
                if (    pFormatRider->pNext
                    &&  pFormatRider->pNext->iStyle == iSetStyle)
                {
                    // New style is same as adjacent following run
                    pFormatRider->pNext->iLen += iSetLen;
                }
                else
                {
                    // Create new run between current run and next run
                    pNewRun = new RUN;
                    *pNewRun = *pFormatRider;
                    pNewRun->iStyle = iSetStyle;
                    pNewRun->iLen   = iSetLen;
                    pFormatRider->pNext = pNewRun;
                }
            }
        }
    }
}

BOOL TextDelete | ( | int | iPos,
 |  | int | iLen
 | ) |  |

Definition at line 60 of file Text.Cpp.

{
    BOOL bSucess = TRUE;
    if (   iPos < 0
        || iLen < 0
        || iPos +iLen > g_iTextLen)
    {
        bSucess = FALSE;
        goto RETURN;
    }

    if (iPos + iLen >= g_iTextLen)
    {
        g_iTextLen = iPos;
        StyleDeleteRange(iPos, iLen);
        ASSERT(StyleCheckRange());
        goto RETURN;
    }

    if (iLen == 0)
    {
        goto RETURN;
    }

    _memccpy(g_wcBuf + iPos, g_wcBuf + iPos + iLen,WCHAR('\0'),sizeof(WCHAR) * (g_iTextLen - (iPos + iLen)));
    g_iTextLen -= iLen;

    StyleDeleteRange(iPos, iLen);
    ASSERT(StyleCheckRange());

RETURN:
    return bSucess;
}

BOOL TextInsert | ( | int | iPos,
 |  | PWCH | pwc,
 |  | int | iLen
 | ) |  |

Definition at line 96 of file Text.Cpp.

{
    BOOL bSucess = TRUE;

    if (   iPos < 0
        || iLen < 0
        || iPos + iLen >= MAX_TEXT
        || iPos > g_iTextLen
        || iLen + g_iTextLen <= MAX_TEXT-1 )
    {
        bSucess = FALSE;
    }
    else
    {
        // Shift text above iPos up the buffer
        if (iPos < g_iTextLen)
        {
            memmove(g_wcBuf+iPos+iLen, g_wcBuf+iPos, sizeof(WCHAR)*(g_iTextLen-iPos));
        }

        // Copy new text into buffer
        memcpy(g_wcBuf+iPos, pwc, sizeof(WCHAR)*iLen);
        g_iTextLen += iLen;

        // Give the new characters the same style as the original character they follow
        StyleExtendRange(iPos, iLen);
        ASSERT(StyleCheckRange());
    }

    return bSucess;
}

LRESULT CALLBACK TextWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 3221 of file MfEdit.c.

{
    static HFONT hFont = (HFONT) NULL;

    switch (message)
    {
    case WM_CREATE:
        {
        LOGFONT    lf;
        HDC        hDC;
        HFONT      hOldFont;
            TEXTMETRIC tm;
        //RECT       rect;

            SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lf), (PVOID) &lf, (UINT)FALSE);

        hDC = GetDC(hwnd);
        // this is the height for 8 point size font in pixels
        lf.lfHeight = 8 * GetDeviceCaps(hDC, LOGPIXELSY) / 72;

        hFont = CreateFontIndirect(&lf);
        hOldFont = SelectObject(hDC, hFont);
        GetTextMetrics(hDC, &tm);

        // base the height of the window on size of text
        glcyStatus = tm.tmHeight+6*GetSystemMetrics(SM_CYBORDER)+2;
            ReleaseDC(hwnd, hDC);
            break;
        }

    case WM_DESTROY:
        if (hFont)
        DeleteObject(hFont);
        break;

    case WM_SETTEXT:
            DefWindowProc(hwnd, message, wParam, lParam);
            InvalidateRect(hwnd,NULL,FALSE);
            UpdateWindow(hwnd);
            return 0L;

    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            RECT   rc;
            char   ach[128];
            int    len, nxBorder, nyBorder;
            HFONT  hOldFont = NULL;

            BeginPaint(hwnd, &ps);

            GetClientRect(hwnd,&rc);

            nxBorder = GetSystemMetrics(SM_CXBORDER);
        rc.left  += 9*nxBorder;
            rc.right -= 9*nxBorder;

            nyBorder = GetSystemMetrics(SM_CYBORDER);
        rc.top    += 3*nyBorder;
        rc.bottom -= 3*nyBorder;

        // 3D Text
            len = GetWindowText(hwnd, ach, sizeof(ach));
        SetBkColor(ps.hdc, GetSysColor(COLOR_BTNFACE));

        SetBkMode(ps.hdc, TRANSPARENT);
        SetTextColor(ps.hdc, RGB(64,96,96));
        if (hFont)
        hOldFont = SelectObject(ps.hdc, hFont);
        ExtTextOut(ps.hdc, rc.left+2*nxBorder+2, rc.top+2, ETO_OPAQUE | ETO_CLIPPED,
                    &rc, ach, len, NULL);

        SetTextColor(ps.hdc, RGB(128,128,128));
        if (hFont)
        hOldFont = SelectObject(ps.hdc, hFont);
        ExtTextOut(ps.hdc, rc.left+2*nxBorder+1, rc.top+1, ETO_CLIPPED,
            &rc, ach, len, NULL);

        SetTextColor(ps.hdc, RGB(255,255,255));
        if (hFont)
        hOldFont = SelectObject(ps.hdc, hFont);
        ExtTextOut(ps.hdc, rc.left+2*nxBorder, rc.top, ETO_CLIPPED,
            &rc, ach, len, NULL);

        SetBkMode(ps.hdc, OPAQUE);

        if (hOldFont)
        SelectObject(ps.hdc, hOldFont);

            EndPaint(hwnd, &ps);
            return 0L;
        }
    }
    return DefWindowProc(hwnd, message, wParam, lParam);
}

Variable Documentation

const int CARET_SECTION_FORMATTED = 2

Definition at line 19 of file Global.h.

const int CARET_SECTION_LOGICAL = 0

Definition at line 17 of file Global.h.

const int CARET_SECTION_PLAINTEXT = 1

Definition at line 18 of file Global.h.

GLOBAL int g_iMinHeight

Definition at line 59 of file Global.h.

GLOBAL int g_iMinWidth

Definition at line 58 of file Global.h.

GLOBAL int g_iSettingsHeight

Definition at line 55 of file Global.h.

GLOBAL int g_iSettingsWidth

Definition at line 54 of file Global.h.

GLOBAL int g_iWidthBuf[MAX_TEXT]

Definition at line 84 of file Global.h.

GLOBAL STYLE g_style[MAX_STYLES]

Definition at line 79 of file Global.h.

GLOBAL WCHAR g_wcBuf[MAX_TEXT]

Definition at line 83 of file Global.h.

const int MAX_STYLES = 5

Definition at line 14 of file Global.h.

const int MAX_TEXT = 10000

Definition at line 15 of file Global.h.

Generated on Wed Nov 13 2024 16:53:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/PreComp.Hxx File Reference

  • WinUI
  • GlobalDev
  • CSSamp

PreComp.Hxx File Reference

#include <windows.h>
#include <commdlg.h>
#include "usp10.h"
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <string.h>
#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Resource.h File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_APPLYDIGITSUBST 1046
#define | IDC_ARANUMCONTEXT 1045
#define | IDC_CENTER 1005
#define | IDC_CODEPOINT 1012
#define | IDC_CONTROL_CHARS 1008
#define | IDC_CONTROL_CONTEXT 1039
#define | IDC_DIGIT_SUBSTITUTE 1043
#define | IDC_FANCY_BOLD1 1064
#define | IDC_FANCY_BOLD2 1069
#define | IDC_FANCY_BOLD3 1074
#define | IDC_FANCY_BOLD4 1079
#define | IDC_FANCY_FONT1 1062
#define | IDC_FANCY_FONT2 1067
#define | IDC_FANCY_FONT3 1072
#define | IDC_FANCY_FONT4 1077
#define | IDC_FANCY_ITALIC1 1065
#define | IDC_FANCY_ITALIC2 1070
#define | IDC_FANCY_ITALIC3 1075
#define | IDC_FANCY_ITALIC4 1080
#define | IDC_FANCY_SIZE1 1063
#define | IDC_FANCY_SIZE2 1068
#define | IDC_FANCY_SIZE3 1073
#define | IDC_FANCY_SIZE4 1078
#define | IDC_FANCY_UNDERLINE1 1066
#define | IDC_FANCY_UNDERLINE2 1071
#define | IDC_FANCY_UNDERLINE3 1076
#define | IDC_FANCY_UNDERLINE4 1081
#define | IDC_FAR 1007
#define | IDC_FORMAT1 1038
#define | IDC_FORMAT2 1087
#define | IDC_FORMAT3 1090
#define | IDC_FORMAT4 1091
#define | IDC_FORMATTED 1037
#define | IDC_HIGHLIGHT_FROM 1010
#define | IDC_HIGHLIGHT_TO 1011
#define | IDC_HORIZ 1000
#define | IDC_INSERT_CODEPOINT 1013
#define | IDC_JUSTIFY 1006
#define | IDC_LANGUAGE 1040
#define | IDC_LEGACY_BIDI 1041
#define | IDC_LINEFILL 1044
#define | IDC_LOGICAL 1018
#define | IDC_LOGICAL_ORDER 1014
#define | IDC_LOGICAL_STYLES 1020
#define | IDC_LOGICAL_WIDTH 1019
#define | IDC_LTR 1002
#define | IDC_NEAR 1004
#define | IDC_NO_GLYPH_INDEX 1009
#define | IDC_OVERRIDE 1042
#define | IDC_PLAINTEXT 1021
#define | IDC_PLAINTEXT_BOLD 1026
#define | IDC_PLAINTEXT_CLIP 1029
#define | IDC_PLAINTEXT_DX 1031
#define | IDC_PLAINTEXT_FALLBACK 1033
#define | IDC_PLAINTEXT_FIT 1030
#define | IDC_PLAINTEXT_FONT 1024
#define | IDC_PLAINTEXT_HOTKEY 1035
#define | IDC_PLAINTEXT_ITALIC 1027
#define | IDC_PLAINTEXT_LINK 1034
#define | IDC_PLAINTEXT_PASSWORD 1036
#define | IDC_PLAINTEXT_SIZE 1025
#define | IDC_PLAINTEXT_TAB 1032
#define | IDC_PLAINTEXT_UNDERLINE 1028
#define | IDC_PRESENTATION 1047
#define | IDC_RTL 1003
#define | IDC_SHOWLEVELS 1048
#define | IDC_VERT 1001
#define | IDM_EXIT 40001

Define Documentation

#define IDC_APPLYDIGITSUBST 1046

Definition at line 46 of file Resource.h.

#define IDC_ARANUMCONTEXT 1045

Definition at line 45 of file Resource.h.

#define IDC_CENTER 1005

Definition at line 10 of file Resource.h.

#define IDC_CODEPOINT 1012

Definition at line 17 of file Resource.h.

#define IDC_CONTROL_CHARS 1008

Definition at line 13 of file Resource.h.

#define IDC_CONTROL_CONTEXT 1039

Definition at line 39 of file Resource.h.

#define IDC_DIGIT_SUBSTITUTE 1043

Definition at line 43 of file Resource.h.

#define IDC_FANCY_BOLD1 1064

Definition at line 51 of file Resource.h.

#define IDC_FANCY_BOLD2 1069

Definition at line 56 of file Resource.h.

#define IDC_FANCY_BOLD3 1074

Definition at line 61 of file Resource.h.

#define IDC_FANCY_BOLD4 1079

Definition at line 66 of file Resource.h.

#define IDC_FANCY_FONT1 1062

Definition at line 49 of file Resource.h.

#define IDC_FANCY_FONT2 1067

Definition at line 54 of file Resource.h.

#define IDC_FANCY_FONT3 1072

Definition at line 59 of file Resource.h.

#define IDC_FANCY_FONT4 1077

Definition at line 64 of file Resource.h.

#define IDC_FANCY_ITALIC1 1065

Definition at line 52 of file Resource.h.

#define IDC_FANCY_ITALIC2 1070

Definition at line 57 of file Resource.h.

#define IDC_FANCY_ITALIC3 1075

Definition at line 62 of file Resource.h.

#define IDC_FANCY_ITALIC4 1080

Definition at line 67 of file Resource.h.

#define IDC_FANCY_SIZE1 1063

Definition at line 50 of file Resource.h.

#define IDC_FANCY_SIZE2 1068

Definition at line 55 of file Resource.h.

#define IDC_FANCY_SIZE3 1073

Definition at line 60 of file Resource.h.

#define IDC_FANCY_SIZE4 1078

Definition at line 65 of file Resource.h.

#define IDC_FANCY_UNDERLINE1 1066

Definition at line 53 of file Resource.h.

#define IDC_FANCY_UNDERLINE2 1071

Definition at line 58 of file Resource.h.

#define IDC_FANCY_UNDERLINE3 1076

Definition at line 63 of file Resource.h.

#define IDC_FANCY_UNDERLINE4 1081

Definition at line 68 of file Resource.h.

#define IDC_FAR 1007

Definition at line 12 of file Resource.h.

#define IDC_FORMAT1 1038

Definition at line 38 of file Resource.h.

#define IDC_FORMAT2 1087

Definition at line 69 of file Resource.h.

#define IDC_FORMAT3 1090

Definition at line 70 of file Resource.h.

#define IDC_FORMAT4 1091

Definition at line 71 of file Resource.h.

#define IDC_FORMATTED 1037

Definition at line 37 of file Resource.h.

#define IDC_HIGHLIGHT_FROM 1010

Definition at line 15 of file Resource.h.

#define IDC_HIGHLIGHT_TO 1011

Definition at line 16 of file Resource.h.

#define IDC_HORIZ 1000

Definition at line 5 of file Resource.h.

#define IDC_INSERT_CODEPOINT 1013

Definition at line 18 of file Resource.h.

#define IDC_JUSTIFY 1006

Definition at line 11 of file Resource.h.

#define IDC_LANGUAGE 1040

Definition at line 40 of file Resource.h.

#define IDC_LEGACY_BIDI 1041

Definition at line 41 of file Resource.h.

#define IDC_LINEFILL 1044

Definition at line 44 of file Resource.h.

#define IDC_LOGICAL 1018

Definition at line 20 of file Resource.h.

#define IDC_LOGICAL_ORDER 1014

Definition at line 19 of file Resource.h.

#define IDC_LOGICAL_STYLES 1020

Definition at line 22 of file Resource.h.

#define IDC_LOGICAL_WIDTH 1019

Definition at line 21 of file Resource.h.

#define IDC_LTR 1002

Definition at line 7 of file Resource.h.

#define IDC_NEAR 1004

Definition at line 9 of file Resource.h.

#define IDC_NO_GLYPH_INDEX 1009

Definition at line 14 of file Resource.h.

#define IDC_OVERRIDE 1042

Definition at line 42 of file Resource.h.

#define IDC_PLAINTEXT 1021

Definition at line 23 of file Resource.h.

#define IDC_PLAINTEXT_BOLD 1026

Definition at line 26 of file Resource.h.

#define IDC_PLAINTEXT_CLIP 1029

Definition at line 29 of file Resource.h.

#define IDC_PLAINTEXT_DX 1031

Definition at line 31 of file Resource.h.

#define IDC_PLAINTEXT_FALLBACK 1033

Definition at line 33 of file Resource.h.

#define IDC_PLAINTEXT_FIT 1030

Definition at line 30 of file Resource.h.

#define IDC_PLAINTEXT_FONT 1024

Definition at line 24 of file Resource.h.

#define IDC_PLAINTEXT_HOTKEY 1035

Definition at line 35 of file Resource.h.

#define IDC_PLAINTEXT_ITALIC 1027

Definition at line 27 of file Resource.h.

#define IDC_PLAINTEXT_LINK 1034

Definition at line 34 of file Resource.h.

#define IDC_PLAINTEXT_PASSWORD 1036

Definition at line 36 of file Resource.h.

#define IDC_PLAINTEXT_SIZE 1025

Definition at line 25 of file Resource.h.

#define IDC_PLAINTEXT_TAB 1032

Definition at line 32 of file Resource.h.

#define IDC_PLAINTEXT_UNDERLINE 1028

Definition at line 28 of file Resource.h.

#define IDC_PRESENTATION 1047

Definition at line 47 of file Resource.h.

#define IDC_RTL 1003

Definition at line 8 of file Resource.h.

#define IDC_SHOWLEVELS 1048

Definition at line 48 of file Resource.h.

#define IDC_VERT 1001

Definition at line 6 of file Resource.h.

#define IDM_EXIT 40001

Definition at line 72 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Settings.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions | Variables

Settings.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Functions

BOOL | ChangeFont (HWND hDlg, int iStyle, int idFont, int idSize, int idBold, int idItalic, int idUnderline)
BOOL | Command (HWND hDlg, int iCmd, int iNotify, HWND hItemWnd)
int | HexToInt (char szHex[])
void | InitFaceLists (HWND hDlg)
int CALLBACK | InitOneFace (const ENUMLOGFONTEXA *lpelfe, const NEWTEXTMETRICEXA *lpntme, int FontType, LPARAM lParam)
void | InitOneSize (HWND hDlg, char *str)
void | InitSelection (HWND hDlg, int idFace, int idSize, char *sFaceName)
INT_PTR CALLBACK | SettingsDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Variables

const char * | szLanguage []
const char * | szUniChar []

Function Documentation

BOOL ChangeFont | ( | HWND | hDlg,
 |  | int | iStyle,
 |  | int | idFont,
 |  | int | idSize,
 |  | int | idBold,
 |  | int | idItalic,
 |  | int | idUnderline
 | ) |  |

Definition at line 47 of file Settings.Cpp.

{
    int   iHeight = 0;
    char  sFaceName[100];
    int   i = 0;
    BOOL bSucess = TRUE;

    // Get size
    i = (int)SendDlgItemMessage(hDlg, idSize, CB_GETCURSEL, 0, 0);
    if (SendDlgItemMessage(hDlg, idSize, CB_GETLBTEXT, i, (LPARAM)sFaceName) == CB_ERR)
    {
        bSucess = FALSE;
        goto RETURN;
    }
    iHeight = -MulDiv(atoi(sFaceName), g_iLogPixelsY, 72);

    // Get facename
    i = (int)SendDlgItemMessage(hDlg, idFont, CB_GETCURSEL, 0, 0);
    if (SendDlgItemMessage(hDlg, idFont, CB_GETLBTEXT, i, (LPARAM)sFaceName) == CB_ERR)
    {
        bSucess = FALSE;
        goto RETURN;
    }

    SetStyle(
        iStyle,
        iHeight,
        IsDlgButtonChecked(hDlg, idBold)      == BST_CHECKED ? 700 : 400,
        IsDlgButtonChecked(hDlg, idItalic)    == BST_CHECKED,
        IsDlgButtonChecked(hDlg, idUnderline) == BST_CHECKED,
        sFaceName);

    InvalidateText();
    RETURN:
    return bSucess;
}

BOOL Command | ( | HWND | hDlg,
 |  | int | iCmd,
 |  | int | iNotify,
 |  | HWND | hItemWnd
 | ) |  |

Definition at line 86 of file Settings.Cpp.

{
    char str[100];
    WCHAR  wc;
    int    i = 0;
    char   hex[] = "0123456789abcdef";
    BOOL bProcessed = TRUE;

    switch(iCmd)
    {
    case IDC_LANGUAGE:
        if (iNotify == CBN_SELCHANGE)
        {
            i = (int)SendMessage(hItemWnd, CB_GETCURSEL, 0, 0);
            if (SendMessage(hItemWnd, CB_GETLBTEXT, i, (LPARAM)str) != CB_ERR)
            {
                wc = (WCHAR)HexToInt(str);
                g_ScriptControl.uDefaultLanguage = wc;
                InvalidateText();
            }
        }
        else if (iNotify == CBN_EDITCHANGE)
        {
            if (SendMessage(hItemWnd, WM_GETTEXT, sizeof(str), (LPARAM)str))
            {
                wc = (WCHAR)HexToInt(str);
                g_ScriptControl.uDefaultLanguage = wc;
                InvalidateText();
            }
        }
        break;

    case IDC_INSERT_CODEPOINT:
        if (GetDlgItemTextA(g_hSettingsDlg, IDC_CODEPOINT, str, sizeof(str)))
        {
            wc = (WCHAR)HexToInt(str);
            if (TextInsert(g_iCurChar, &wc, 1))
            {
                g_iCurChar++;
                InvalidateText();
            }
        }
        break;

    case IDC_HIGHLIGHT_FROM:  /* fall-through*/
    case IDC_HIGHLIGHT_TO:
        InvalidateText();
        break;

    case IDC_LINEFILL:
        g_fFillLines = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_LTR:
        g_ScriptState.uBidiLevel = 0;
        SendDlgItemMessage(hDlg, IDC_LTR, BM_SETSTATE, TRUE, 0);
        SendDlgItemMessage(hDlg, IDC_RTL, BM_SETSTATE, FALSE, 0);
        InvalidateText();
        break;

    case IDC_RTL:
        g_ScriptState.uBidiLevel = 1;
        SendDlgItemMessage(hDlg, IDC_RTL, BM_SETSTATE, TRUE, 0);
        SendDlgItemMessage(hDlg, IDC_LTR, BM_SETSTATE, FALSE, 0);
        InvalidateText();
        break;

    case IDC_CONTROL_CONTEXT:
        g_ScriptControl.fContextDigits = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_DIGIT_SUBSTITUTE:
        g_ScriptState.fDigitSubstitute = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_ARANUMCONTEXT:
        g_ScriptState.fArabicNumContext = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_LEGACY_BIDI:
        g_ScriptControl.fLegacyBidiClass = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_OVERRIDE:
        g_ScriptState.fOverrideDirection = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_CONTROL_CHARS:
        g_ScriptState.fDisplayZWG = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_LOGICAL_ORDER:
        g_fLogicalOrder = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_NO_GLYPH_INDEX:
        g_fNoGlyphIndex = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_LOGICAL:
        g_fShowLogical = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_PLAINTEXT:
        g_fShowPlainText = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_PLAINTEXT_FIT:
        if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
        {
            g_dwSSAflags |= SSA_FIT;
        }
        else
        {
            g_dwSSAflags &= ~SSA_FIT;
        }
        InvalidateText();
        break;

    case IDC_PLAINTEXT_CLIP:
        if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
        {
            g_dwSSAflags |= SSA_CLIP;
        }
        else
        {
            g_dwSSAflags &= ~SSA_CLIP;
        }
        InvalidateText();
        break;

    case IDC_PLAINTEXT_TAB:
        if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
        {
            g_dwSSAflags |= SSA_TAB;
        }
        else
        {
            g_dwSSAflags &= ~SSA_TAB;
        }
        InvalidateText();
        break;

    case IDC_PLAINTEXT_DX:
        g_fOverrideDx = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        memset(g_iWidthBuf, 0, sizeof(int)*g_iTextLen+1);
        InvalidateText();
        break;

    case IDC_PLAINTEXT_FALLBACK:
        if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
        {
            g_dwSSAflags |= SSA_FALLBACK;
        }
        else
        {
            g_dwSSAflags &= ~SSA_FALLBACK;
        }
        InvalidateText();
        break;

    case IDC_PLAINTEXT_LINK:
        if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
        {
            g_dwSSAflags |= SSA_LINK;
        }
        else
        {
            g_dwSSAflags &= ~SSA_LINK;
        }
        InvalidateText();
        break;

    case IDC_PLAINTEXT_HOTKEY:
        if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
        {
            g_dwSSAflags |= SSA_HOTKEY;
        }
        else
        {
            g_dwSSAflags &= ~SSA_HOTKEY;
        }
        InvalidateText();
        break;

    case IDC_PLAINTEXT_PASSWORD:
        if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
        {
            g_dwSSAflags |= SSA_PASSWORD;
        }
        else
        {
            g_dwSSAflags &= ~SSA_PASSWORD;
        }
        InvalidateText();
        break;

    case IDC_PLAINTEXT_FONT:  /* fall-through */
    case IDC_PLAINTEXT_SIZE:
        if (iNotify != CBN_SELCHANGE)
        {
            bProcessed = FALSE;
            break;
        }

    case IDC_PLAINTEXT_BOLD:  /* fall-through */
    case IDC_PLAINTEXT_ITALIC:  /* fall-through */
    case IDC_PLAINTEXT_UNDERLINE:
        ChangeFont(
            hDlg,
            0,
            IDC_PLAINTEXT_FONT,
            IDC_PLAINTEXT_SIZE,
            IDC_PLAINTEXT_BOLD,
            IDC_PLAINTEXT_ITALIC,
            IDC_PLAINTEXT_UNDERLINE);
        break;

    case IDC_FORMATTED:
        g_fShowFancyText = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
        InvalidateText();
        break;

    case IDC_FANCY_FONT1:  /* fall-through */
    case IDC_FANCY_SIZE1:
        if (iNotify != CBN_SELCHANGE)
        {
            bProcessed = FALSE;
            break;
        }
    case IDC_FANCY_BOLD1:  /* fall-through */
    case IDC_FANCY_ITALIC1:  /* fall-through */
    case IDC_FANCY_UNDERLINE1:
        ChangeFont(
            hDlg,
            1,
            IDC_FANCY_FONT1,
            IDC_FANCY_SIZE1,
            IDC_FANCY_BOLD1,
            IDC_FANCY_ITALIC1,
            IDC_FANCY_UNDERLINE1);
        break;

    case IDC_FANCY_FONT2:  /* fall-through */
    case IDC_FANCY_SIZE2:
        if (iNotify != CBN_SELCHANGE)
        {
            bProcessed = FALSE;
            break;
        }

    case IDC_FANCY_BOLD2:  /* fall-through */
    case IDC_FANCY_ITALIC2:  /* fall-through */
    case IDC_FANCY_UNDERLINE2:
        ChangeFont(
            hDlg,
            2,
            IDC_FANCY_FONT2,
            IDC_FANCY_SIZE2,
            IDC_FANCY_BOLD2,
            IDC_FANCY_ITALIC2,
            IDC_FANCY_UNDERLINE2);
        break;

    case IDC_FANCY_FONT3:  /* fall-through */
    case IDC_FANCY_SIZE3:
        if (iNotify != CBN_SELCHANGE)
        {
            bProcessed = FALSE;
            break;
        }

    case IDC_FANCY_BOLD3:  /* fall-through */
    case IDC_FANCY_ITALIC3:  /* fall-through */
    case IDC_FANCY_UNDERLINE3:
        ChangeFont(
            hDlg,
            3,
            IDC_FANCY_FONT3,
            IDC_FANCY_SIZE3,
            IDC_FANCY_BOLD3,
            IDC_FANCY_ITALIC3,
            IDC_FANCY_UNDERLINE3);
        break;

    case IDC_FANCY_FONT4:  /* fall-through */
    case IDC_FANCY_SIZE4:
        if (iNotify != CBN_SELCHANGE)
        {
            bProcessed = FALSE;
            break;
        }

    case IDC_FANCY_BOLD4:  /* fall-through */
    case IDC_FANCY_ITALIC4:  /* fall-through */
    case IDC_FANCY_UNDERLINE4:
        ChangeFont(
            hDlg,
            4,
            IDC_FANCY_FONT4,
            IDC_FANCY_SIZE4,
            IDC_FANCY_BOLD4,
            IDC_FANCY_ITALIC4,
            IDC_FANCY_UNDERLINE4);
        break;

    case IDC_FORMAT1:  /* fall-through */
    case IDC_FORMAT2:  /* fall-through */
    case IDC_FORMAT3:  /* fall-through */
    case IDC_FORMAT4:
        if (g_iTo < g_iFrom)
        {
            i=g_iTo;  g_iTo=g_iFrom;  g_iFrom=i;
        }

        if (    g_iFrom <  g_iTo
            &&  g_iFrom <  g_iTextLen
            &&  g_iTo   <= g_iTextLen)
        {

            i=1; // Default
            switch(iCmd) {
                case IDC_FORMAT1:  i=1;  break;
                case IDC_FORMAT2:  i=2;  break;
                case IDC_FORMAT3:  i=3;  break;
                case IDC_FORMAT4:  i=4;  break;
            }
            StyleSetRange(i, g_iFrom, g_iTo-g_iFrom);
            ASSERT(StyleCheckRange());
            InvalidateText();
        }
        break;

    case IDC_APPLYDIGITSUBST:
        ScriptApplyDigitSubstitution(NULL, &g_ScriptControl, &g_ScriptState);

        SendDlgItemMessage(hDlg, IDC_DIGIT_SUBSTITUTE,  BM_SETCHECK, g_ScriptState.fDigitSubstitute ? BST_CHECKED : BST_UNCHECKED, 0);
        SendDlgItemMessage(hDlg, IDC_CONTROL_CONTEXT,   BM_SETCHECK, g_ScriptControl.fContextDigits ? BST_CHECKED : BST_UNCHECKED, 0);
        str[0] = '0';
        str[1] = 'x';
        str[2] = hex[(g_ScriptControl.uDefaultLanguage & 0xf0) >> 4];
        str[3] = hex[ g_ScriptControl.uDefaultLanguage & 0x0f];
        str[4] = 0;
        SendDlgItemMessage(hDlg, IDC_LANGUAGE,          CB_SELECTSTRING, 0, (LPARAM) str);

        InvalidateText();
        break;

    case IDC_PRESENTATION:
        g_fPresentation = TRUE;
        ShowWindow(g_hSettingsDlg, SW_HIDE);
        SetFocus(g_hTextWnd);
        InvalidateText();
        break;

    case IDC_SHOWLEVELS:
        g_fShowLevels = !g_fShowLevels;
        if (g_fShowLevels)
        {
            SetDlgItemTextA(g_hSettingsDlg, IDC_SHOWLEVELS, "Hide levels");
        }
        else
        {
            SetDlgItemTextA(g_hSettingsDlg, IDC_SHOWLEVELS, "Show levels");
        }
        SetFocus(g_hTextWnd);
        InvalidateText();
        break;
    default:
        bProcessed = FALSE;

    }  // end switch

    return bProcessed;
}

int HexToInt ( char szHex[] )

Definition at line 10 of file Settings.Cpp.

{

    int i = 0;
    int h = 0;
    //int d = 0;

    while (szHex[i]  &&  szHex[i] != ' ')
    {
        if (szHex[i] >= '0'  &&  szHex[i] <= '9')
        {

            h = h*16 + szHex[i] - '0';
            //d = d*10 + szHex[i] - '0';

        }
        else if (szHex[i] >= 'a'  &&  szHex[i] <= 'f')
        {
            h = h*16 + 10 + szHex[i] - 'a';

        }
        else if (szHex[i] >= 'A'  &&  szHex[i] <= 'F')
        {
            h = h*16 + 10 + szHex[i] - 'A';

        }
        else if (szHex[i] != ' '  &&  szHex[i] != ','  &&  szHex[i] != 'x'  &&  szHex[i] != 'X')
        {
            h = -1;
            break;
        }
        i++;
    }

    return h;
}

void InitFaceLists ( HWND hDlg )

Definition at line 550 of file Settings.Cpp.

{
    HDC      hdc = NULL;
    LOGFONTA lf = {0};

    SetLogFont(&lf, 0, 0, 0, 0, "");
    hdc = GetDC(g_hTextWnd);
    EnumFontFamiliesExA(hdc, &lf, (FONTENUMPROCA)InitOneFace, (LPARAM)hDlg, 0);
    ReleaseDC(g_hTextWnd, hdc);

    // Initialise sizes
    InitOneSize(hDlg, "6");
    InitOneSize(hDlg, "7");
    InitOneSize(hDlg, "8");
    InitOneSize(hDlg, "9");
    InitOneSize(hDlg, "10");
    InitOneSize(hDlg, "11");
    InitOneSize(hDlg, "12");
    InitOneSize(hDlg, "13");
    InitOneSize(hDlg, "14");
    InitOneSize(hDlg, "16");
    InitOneSize(hDlg, "18");
    InitOneSize(hDlg, "20");
    InitOneSize(hDlg, "22");
    InitOneSize(hDlg, "24");
    InitOneSize(hDlg, "28");
    InitOneSize(hDlg, "32");
    InitOneSize(hDlg, "36");
    InitOneSize(hDlg, "48");
    InitOneSize(hDlg, "60");
    InitOneSize(hDlg, "72");
    InitOneSize(hDlg, "90");
    InitOneSize(hDlg, "108");
    InitOneSize(hDlg, "126");
    InitOneSize(hDlg, "144");

    // Select standard fonts and sizes
    InitSelection(hDlg, IDC_PLAINTEXT_FONT, IDC_PLAINTEXT_SIZE, "Microsoft Sans Serif");

    InitSelection(hDlg, IDC_FANCY_FONT1,    IDC_FANCY_SIZE1,    "Microsoft Sans Serif");
    InitSelection(hDlg, IDC_FANCY_FONT2,    IDC_FANCY_SIZE2,    "Mangal");
    InitSelection(hDlg, IDC_FANCY_FONT3,    IDC_FANCY_SIZE3,    "Latha");
    InitSelection(hDlg, IDC_FANCY_FONT4,    IDC_FANCY_SIZE4,    "Arial");

    ChangeFont(hDlg, 0, IDC_PLAINTEXT_FONT, IDC_PLAINTEXT_SIZE, IDC_PLAINTEXT_BOLD, IDC_PLAINTEXT_ITALIC, IDC_PLAINTEXT_UNDERLINE);
    ChangeFont(hDlg, 1, IDC_FANCY_FONT1, IDC_FANCY_SIZE1, IDC_FANCY_BOLD1, IDC_FANCY_ITALIC1, IDC_FANCY_UNDERLINE1);
    ChangeFont(hDlg, 2, IDC_FANCY_FONT2, IDC_FANCY_SIZE2, IDC_FANCY_BOLD2, IDC_FANCY_ITALIC2, IDC_FANCY_UNDERLINE2);
    ChangeFont(hDlg, 3, IDC_FANCY_FONT3, IDC_FANCY_SIZE3, IDC_FANCY_BOLD3, IDC_FANCY_ITALIC3, IDC_FANCY_UNDERLINE3);
    ChangeFont(hDlg, 4, IDC_FANCY_FONT4, IDC_FANCY_SIZE4, IDC_FANCY_BOLD4, IDC_FANCY_ITALIC4, IDC_FANCY_UNDERLINE4);
}

int CALLBACK InitOneFace | ( | const ENUMLOGFONTEXA * | lpelfe,
 |  | const NEWTEXTMETRICEXA * | lpntme,
 |  | int | FontType,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 473 of file Settings.Cpp.

{
    if (SendDlgItemMessage(
            (HWND)lParam,
            IDC_PLAINTEXT_FONT,
            CB_FINDSTRINGEXACT,
            0, (LPARAM)lpelfe->elfLogFont.lfFaceName) == CB_ERR)
   {
        // It's a new font name
        SendDlgItemMessage(
            (HWND)lParam,
            IDC_PLAINTEXT_FONT,
            CB_ADDSTRING,
            0, (LPARAM)lpelfe->elfLogFont.lfFaceName);

        SendDlgItemMessage(
            (HWND)lParam,
            IDC_FANCY_FONT1,
            CB_ADDSTRING,
            0, (LPARAM)lpelfe->elfLogFont.lfFaceName);

        SendDlgItemMessage(
            (HWND)lParam,
            IDC_FANCY_FONT2,
            CB_ADDSTRING,
            0, (LPARAM)lpelfe->elfLogFont.lfFaceName);

        SendDlgItemMessage(
            (HWND)lParam,
            IDC_FANCY_FONT3,
            CB_ADDSTRING,
            0, (LPARAM)lpelfe->elfLogFont.lfFaceName);

        SendDlgItemMessage(
            (HWND)lParam,
            IDC_FANCY_FONT4,
            CB_ADDSTRING,
            0, (LPARAM)lpelfe->elfLogFont.lfFaceName);
    }

    return 1;   // Continue enumeration
}

void InitOneSize | ( | HWND | hDlg,
 |  | char * | str
 | ) |  |

Definition at line 521 of file Settings.Cpp.

{

    SendDlgItemMessage(hDlg, IDC_PLAINTEXT_SIZE, CB_ADDSTRING, 0, (LPARAM)str);
    SendDlgItemMessage(hDlg, IDC_FANCY_SIZE1,    CB_ADDSTRING, 0, (LPARAM)str);
    SendDlgItemMessage(hDlg, IDC_FANCY_SIZE2,    CB_ADDSTRING, 0, (LPARAM)str);
    SendDlgItemMessage(hDlg, IDC_FANCY_SIZE3,    CB_ADDSTRING, 0, (LPARAM)str);
    SendDlgItemMessage(hDlg, IDC_FANCY_SIZE4,    CB_ADDSTRING, 0, (LPARAM)str);
}

void InitSelection | ( | HWND | hDlg,
 |  | int | idFace,
 |  | int | idSize,
 |  | char * | sFaceName
 | ) |  |

Definition at line 533 of file Settings.Cpp.

{
    int i = 0;

    i = (int)SendDlgItemMessage(hDlg, idFace, CB_FINDSTRINGEXACT, 0, (LPARAM)sFaceName);
    if (i == CB_ERR)
    {
        SendDlgItemMessage(hDlg, idFace, CB_SETCURSEL, 0, 0);
    }
    else
    {
        SendDlgItemMessage(hDlg, idFace, CB_SETCURSEL, i, 0);
    }

    SendDlgItemMessage(hDlg, idSize, CB_SETCURSEL, 10, 0);   // Selection 10 is 18 point
}

INT_PTR CALLBACK SettingsDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 701 of file Settings.Cpp.

{
        int i = 0;

        switch (uMsg)
        {
        case WM_INITDIALOG:
            // Populate the Unicode codepoint combo box
            for (i = 0; i < sizeof(szUniChar)/sizeof(szUniChar[0]); ++i)
            {
                SendDlgItemMessage(hDlg, IDC_CODEPOINT, CB_ADDSTRING, 0, (LPARAM)szUniChar[i]);
            }

            for (i = 0; i < sizeof(szLanguage)/sizeof(szLanguage[0]); ++i)
            {
                SendDlgItemMessage(hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)szLanguage[i]);
            }

            SendDlgItemMessage(hDlg, IDC_LANGUAGE, CB_SETCURSEL, 0, 0);
            SendDlgItemMessage(hDlg, IDC_LTR,       BM_SETSTATE, TRUE, 0);
            SendDlgItemMessage(hDlg, IDC_HORIZ,     BM_SETSTATE, TRUE, 0);
            SendDlgItemMessage(hDlg, IDC_LOGICAL,   BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_PLAINTEXT, BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_FORMATTED, BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_LINEFILL,  BM_SETCHECK, BST_CHECKED, 0);
            SendDlgItemMessage(hDlg, IDC_PLAINTEXT_FALLBACK, BM_SETCHECK, BST_CHECKED, 0);

            InitFaceLists(hDlg);
            break;

        case WM_COMMAND:
            Command(hDlg, LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
            break;

        }

        return FALSE;
}

Variable Documentation

const char* szLanguage[]

Definition at line 622 of file Settings.Cpp.

const char* szUniChar[]
Initial value:
 {
    "200B ZWSP",
    "200C ZWNJ",
    "200D ZWJ",
    "200E LRM",
    "200F RLM",
    "202A LRE",
    "202B RLE",
    "202C PDF",
    "202D LRO",
    "202E RLO",
    "206A ISS",
    "206B ASS",
    "206E NADS",
    "206F NODS",
    "0908 Letter Ii",
    "0915 Letter Ka",
    "093f Vowel I",
    "094D Virama",
}

Definition at line 601 of file Settings.Cpp.

Generated on Wed Nov 13 2024 16:54:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Style.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions

Style.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Functions

void | FreeStyle (int iStyle)
void | FreeStyles ()
void | InitStyles ()
void | SetLogFont (PLOGFONTA plf, int iHeight, int iWeight, int iItalic, int iUnderline, char *pcFaceName)
void | SetStyle (int iStyle, int iHeight, int iWeight, int iItalic, int iUnderline, char *pcFaceName)
BOOL StyleCheckRange ()
void | StyleDeleteRange (int iDelPos, int iDelLen)
void | StyleExtendRange (int iExtPos, int iExtLen)
void | StyleSetRange (int iSetStyle, int iSetPos, int iSetLen)

Function Documentation

void FreeStyle ( int iStyle )

Definition at line 33 of file Style.Cpp.

{
    if (g_style[iStyle].hf)
    {
        DeleteObject(g_style[iStyle].hf);
    }

    if (g_style[iStyle].sc)
    {
        ScriptFreeCache(&g_style[iStyle].sc);
    }
}

void FreeStyles ( )

Definition at line 67 of file Style.Cpp.

{
    int i = 0;
    for (i = 0; i < 5; ++i)
    {
        FreeStyle(i);
    }
}

void InitStyles ( )

Definition at line 62 of file Style.Cpp.

{
    memset(g_style, 0, sizeof(g_style));
}

void SetLogFont | ( | PLOGFONTA | plf,
 |  | int | iHeight,
 |  | int | iWeight,
 |  | int | iItalic,
 |  | int | iUnderline,
 |  | char * | pcFaceName
 | ) |  |

Definition at line 9 of file Style.Cpp.

{

    memset(plf, 0, sizeof(LOGFONTA));
    plf->lfCharSet        = DEFAULT_CHARSET;
    plf->lfHeight         = iHeight;
    plf->lfWeight         = iWeight;
    plf->lfItalic         = (BYTE) iItalic;
    plf->lfUnderline      = (BYTE) iUnderline;
    lstrcpynA(plf->lfFaceName, pcFaceName, min(sizeof(plf->lfFaceName),sizeof(pcFaceName)));
    plf->lfOutPrecision   = OUT_STROKE_PRECIS;
    plf->lfClipPrecision  = CLIP_STROKE_PRECIS;
    plf->lfQuality        = DRAFT_QUALITY;
    plf->lfPitchAndFamily = VARIABLE_PITCH;
    plf->lfEscapement     = 0;
    plf->lfOrientation    = 0;
}

void SetStyle | ( | int | iStyle,
 |  | int | iHeight,
 |  | int | iWeight,
 |  | int | iItalic,
 |  | int | iUnderline,
 |  | char * | pcFaceName
 | ) |  |

Definition at line 46 of file Style.Cpp.

{
    LOGFONTA lf = {0};
    FreeStyle(iStyle);

    SetLogFont(&lf, iHeight, iWeight, iItalic, iUnderline, pcFaceName);
    g_style[iStyle].hf = CreateFontIndirectA(&lf);
    g_style[iStyle].sc = NULL;
}

BOOL StyleCheckRange ( )

Definition at line 79 of file Style.Cpp.

{
    int     iFormatPos   = 0;
    RUN    *pFormatRider = NULL;

    // Check that style length is same as text length
    pFormatRider = g_pFirstFormatRun;
    iFormatPos = 0;
    while (pFormatRider != NULL)
    {
        iFormatPos += pFormatRider->iLen;
        pFormatRider = pFormatRider->pNext;
    }

    return iFormatPos == g_iTextLen;
}

void StyleDeleteRange | ( | int | iDelPos,
 |  | int | iDelLen
 | ) |  |

StyleDeleteRange - delete range of style information.

Definition at line 118 of file Style.Cpp.

{

    int     iFormatPos   = 0;
    RUN    *pFormatRider = NULL;
    RUN    *pPrevRun     = NULL;
    RUN    *pDelRun      = NULL;            // Run to be deleted

    if (iDelLen <= 0) return;

    // Find first run affected by the deletion
    iFormatPos   = 0;
    pFormatRider = g_pFirstFormatRun;
    pPrevRun = NULL;

    while (iFormatPos + pFormatRider->iLen <= iDelPos)
    {
        iFormatPos  += pFormatRider->iLen;
        pPrevRun     = pFormatRider;
        pFormatRider = pFormatRider->pNext;
        ASSERT(pFormatRider);
    }

    // Delete from end of first run
    if (iDelPos + iDelLen  >  iFormatPos + pFormatRider->iLen)
    {

        // Delete all the way from iDelPos to the end of the first affected run
        iDelLen = iDelPos + iDelLen - (iFormatPos + pFormatRider->iLen);    // Amount that will remain to be deleted
        pFormatRider->iLen = iDelPos - iFormatPos;

    }
    else
    {
        // Deletion is entirely in the first affected run
        pFormatRider->iLen -= iDelLen;
        iDelLen = 0;
    }

    // First affected run now contains no range to be deleted
    // If it's empty, remove it, otherwise step over it
    if (pFormatRider->iLen == 0)
    {
        // Remove redundant run
        if (pFormatRider->pNext)
        {
            // Replace this run by the next one
            pDelRun       = pFormatRider->pNext;
            *pFormatRider = *pDelRun;                 // Copy content of next run over this one
            delete pDelRun;
            pDelRun = NULL;
        }
        else
        {
            // No runs following this one
            if (pPrevRun)
            {
                ASSERT(iDelLen == 0);
                delete pFormatRider;
                pFormatRider = NULL;
                pPrevRun->pNext = NULL;
            }
            else
            {
                // No runs left at all
                ASSERT(iDelLen == 0);
                delete pFormatRider;
                pFormatRider = NULL;
                g_pFirstFormatRun = NULL;
            }
        }
    }
    else
    {
        //  Current run now contains no text to be deleted, so advance to next run
        iFormatPos  += pFormatRider->iLen;
        pPrevRun     = pFormatRider;
        pFormatRider = pFormatRider->pNext;
    }

    // Delete from start of any remaining runs
    while (iDelLen > 0)
    {
        if (pFormatRider->iLen <= iDelLen)
        {
            // This entire run must go
            ASSERT(pFormatRider->pNext);
            iDelLen -= pFormatRider->iLen;
            pDelRun  = pFormatRider->pNext;
            *pFormatRider = *pDelRun;
            delete pDelRun;
            pDelRun = NULL;
        }
        else
        {
            // Last run is deleted in part only
            pFormatRider->iLen -= iDelLen;
            iDelLen = 0;
        }
    }

    // Check whether current run (which immediately follows deletion) can
    // now be collapsed into the previous run
    if (pPrevRun  &&  pFormatRider  &&  pPrevRun->iStyle == pFormatRider->iStyle)
    {
        pPrevRun->iLen += pFormatRider->iLen;
        pPrevRun->pNext = pFormatRider->pNext;
        delete pFormatRider;
        pFormatRider = NULL;
    }
}

void StyleExtendRange | ( | int | iExtPos,
 |  | int | iExtLen
 | ) |  |

StyleExtendRange - Extend style immediately preceeding iPos by iLen characters.

Definition at line 235 of file Style.Cpp.

{

    int     iFormatPos = 0;
    RUN    *pFormatRider = NULL;
    const SCRIPT_ANALYSIS nullAnalysis = {0};

    if (g_pFirstFormatRun == NULL)
    {
        // Starting from no text at all
        ASSERT(iExtPos == 0);
        g_pFirstFormatRun           = new RUN;
        g_pFirstFormatRun->iLen     = iExtLen;
        g_pFirstFormatRun->iStyle   = 1;
        g_pFirstFormatRun->pNext    = NULL;
        g_pFirstFormatRun->analysis = nullAnalysis;

    }
    else
    {
        // Find run containing character immediately prior to iExtPos
        iFormatPos = 0;
        pFormatRider = g_pFirstFormatRun;

        while (iFormatPos + pFormatRider->iLen < iExtPos)
        {
            iFormatPos += pFormatRider->iLen;
            pFormatRider = pFormatRider->pNext;
        }

        pFormatRider->iLen += iExtLen;
    }
}

void StyleSetRange | ( | int | iSetStyle,
 |  | int | iSetPos,
 |  | int | iSetLen
 | ) |  |

Definition at line 274 of file Style.Cpp.

{

    int     iFormatPos   = 0;
    RUN    *pFormatRider = NULL;
    RUN    *pNewRun      = NULL;

    if (iSetLen <= 0) return;

    // Remove existing style for the range

    StyleDeleteRange(iSetPos, iSetLen);

    if (g_pFirstFormatRun == NULL)
    {

        // Replace style on entire text
        g_pFirstFormatRun = new RUN;
        g_pFirstFormatRun->pNext = NULL;
        g_pFirstFormatRun->iLen = iSetLen;
        g_pFirstFormatRun->iStyle = iSetStyle;
    }
    else
    {
        // Find first run affected by the change
        iFormatPos   = 0;
        pFormatRider = g_pFirstFormatRun;
        while (iFormatPos + pFormatRider->iLen < iSetPos)
        {
            iFormatPos  += pFormatRider->iLen;
            pFormatRider = pFormatRider->pNext;
            ASSERT(pFormatRider);
        }

        // New style starts after beginning of this run or at beginning of next run
        if (pFormatRider->iStyle == iSetStyle)
        {
            // Already the same style - just increase length
            pFormatRider->iLen += iSetLen;
        }
        else
        {
            if (iFormatPos + pFormatRider->iLen > iSetPos)
            {
                // New style is within this run
                // Split this run around the new run
                pNewRun = new RUN;          // Create second part of existing run
                *pNewRun = *pFormatRider;
                pNewRun->iLen      -= iSetPos - iFormatPos;
                pFormatRider->iLen  = iSetPos - iFormatPos;
                pFormatRider->pNext = pNewRun;

                pNewRun = new RUN;          // Create inserted run
                *pNewRun = *pFormatRider;
                pNewRun->iLen = iSetLen;
                pNewRun->iStyle = iSetStyle;
                pFormatRider->pNext = pNewRun;
            }
            else
            {
                // New style is between this run and the next run
                if (    pFormatRider->pNext
                    &&  pFormatRider->pNext->iStyle == iSetStyle)
                {
                    // New style is same as adjacent following run
                    pFormatRider->pNext->iLen += iSetLen;
                }
                else
                {
                    // Create new run between current run and next run
                    pNewRun = new RUN;
                    *pNewRun = *pFormatRider;
                    pNewRun->iStyle = iSetStyle;
                    pNewRun->iLen   = iSetLen;
                    pFormatRider->pNext = pNewRun;
                }
            }
        }
    }
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Text.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions

Text.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Functions

void | InitText ()
BOOL | TextDelete (int iPos, int iLen)
BOOL | TextInsert (int iPos, PWCH pwc, int iLen)

Function Documentation

void InitText ( )

Definition at line 11 of file Text.Cpp.

{
    HMODULE    hmod  = NULL;
    HRSRC      hrsrc = NULL;
    HGLOBAL    hglob = NULL;
    WCHAR     *pwcIt = NULL;  // Initial text
    int        i     = 0;

    g_iTextLen = 0;
    hmod       = GetModuleHandle(NULL);
    hrsrc      = FindResourceA(hmod, (LPCSTR)110, "INITIALTEXT");
    hglob      = LoadResource(hmod, hrsrc);
    g_iTextLen = SizeofResource(hmod, hrsrc) - 2;  // Remove leading byte order mark
    pwcIt      = (WCHAR*) LockResource(hglob);

    if (!hmod  ||  !hrsrc  ||  !hglob  ||  !pwcIt  ||  !g_iTextLen)
    {
        ASSERTS(hmod,    "GetModuleHandle(usptest.exe) failed");
        ASSERTS(hrsrc,   "FindResource(110, INITIALTEXT) failed");
        ASSERTS(hglob,   "LoadResource(110, INITIALTEXT) failed");
        ASSERTS(pwcIt,   "LockResource(110, INITIALTEXT) failed");
        ASSERTS(g_iTextLen, "INITIALTEXT length zero");

        g_iTextLen = 0;
    }

    if (g_iTextLen >= sizeof(g_wcBuf))
    {
        g_iTextLen = sizeof(g_wcBuf);
    }

    _memccpy(g_wcBuf, pwcIt+1,WCHAR('\0'),g_iTextLen);
    g_iTextLen <<= 1;  // Bytes to characters

    i = 0;
    while (i < g_iTextLen  &&  g_wcBuf[i])
    {
        i++;
    }

    g_iTextLen = i;

    // Construct initial formatting style run covering the entire text
    StyleExtendRange(0, g_iTextLen);
    ASSERT(StyleCheckRange());
}

BOOL TextDelete | ( | int | iPos,
 |  | int | iLen
 | ) |  |

Definition at line 60 of file Text.Cpp.

{
    BOOL bSucess = TRUE;
    if (   iPos < 0
        || iLen < 0
        || iPos +iLen > g_iTextLen)
    {
        bSucess = FALSE;
        goto RETURN;
    }

    if (iPos + iLen >= g_iTextLen)
    {
        g_iTextLen = iPos;
        StyleDeleteRange(iPos, iLen);
        ASSERT(StyleCheckRange());
        goto RETURN;
    }

    if (iLen == 0)
    {
        goto RETURN;
    }

    _memccpy(g_wcBuf + iPos, g_wcBuf + iPos + iLen,WCHAR('\0'),sizeof(WCHAR) * (g_iTextLen - (iPos + iLen)));
    g_iTextLen -= iLen;

    StyleDeleteRange(iPos, iLen);
    ASSERT(StyleCheckRange());

RETURN:
    return bSucess;
}

BOOL TextInsert | ( | int | iPos,
 |  | PWCH | pwc,
 |  | int | iLen
 | ) |  |

Definition at line 96 of file Text.Cpp.

{
    BOOL bSucess = TRUE;

    if (   iPos < 0
        || iLen < 0
        || iPos + iLen >= MAX_TEXT
        || iPos > g_iTextLen
        || iLen + g_iTextLen <= MAX_TEXT-1 )
    {
        bSucess = FALSE;
    }
    else
    {
        // Shift text above iPos up the buffer
        if (iPos < g_iTextLen)
        {
            memmove(g_wcBuf+iPos+iLen, g_wcBuf+iPos, sizeof(WCHAR)*(g_iTextLen-iPos));
        }

        // Copy new text into buffer
        memcpy(g_wcBuf+iPos, pwc, sizeof(WCHAR)*iLen);
        g_iTextLen += iLen;

        // Give the new characters the same style as the original character they follow
        StyleExtendRange(iPos, iLen);
        ASSERT(StyleCheckRange());
    }

    return bSucess;
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/TextWnd.Cpp File Reference

  • WinUI
  • GlobalDev
  • CSSamp
Functions | Variables

TextWnd.Cpp File Reference

#include "precomp.hxx"
#include "global.h"

Go to the source code of this file.

Functions

HWND | CreateTextWindow ()
void | Header (HDC hdc, char *str, RECT *prc, int *piY)
void | InvalidateText ()
void | Paint (HWND hWnd)
void | ResetCaret (int iX, int iY, int iHeight)
LRESULT CALLBACK | TextWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Variables

const int | SEPARATORHEIGHT = 35

Function Documentation

HWND CreateTextWindow ( )

Definition at line 363 of file TextWnd.Cpp.

{
    WNDCLASSA  wcA  = {0};
    WNDCLASSW  wcW  = {0};
    HWND       hWnd = NULL;

    // Try registering as a Unicode window
    wcW.style         = CS_HREDRAW | CS_VREDRAW;
    wcW.lpfnWndProc   = TextWndProc;
    wcW.cbClsExtra    = 0;
    wcW.cbWndExtra    = 0;
    wcW.hInstance     = g_hInstance;
    wcW.hIcon         = LoadIconW(g_hInstance, APPNAMEW);
    wcW.hCursor       = LoadCursorW(NULL, (WCHAR*)IDC_ARROW);
    wcW.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wcW.lpszMenuName  = APPNAMEW;
    wcW.lpszClassName = APPNAMEW;

    if (RegisterClassW(&wcW))
    {
        // Use a Unicode window
        g_bUnicodeWnd = TRUE;
        hWnd  = CreateWindowW(
            APPNAMEW, APPTITLEW,
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT, 0,
            CW_USEDEFAULT, 0,
            NULL, NULL,
            g_hInstance,
            NULL);

    }
    else
    {
        // Must use an ANSI window.
        wcA.style         = CS_HREDRAW | CS_VREDRAW;
        wcA.lpfnWndProc   = TextWndProc;
        wcA.cbClsExtra    = 0;
        wcA.cbWndExtra    = 0;
        wcA.hInstance     = g_hInstance;
        wcA.hIcon         = LoadIconA(g_hInstance, APPNAMEA);
        wcA.hCursor       = LoadCursorA(NULL, (LPCSTR)IDC_ARROW);
        wcA.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
        wcA.lpszMenuName  = APPNAMEA;
        wcA.lpszClassName = APPNAMEA;

        if (!RegisterClassA(&wcA))
        {
            hWnd = NULL;
        }
        else
        {
            g_bUnicodeWnd = FALSE;

            hWnd  = CreateWindowA(
                APPNAMEA, APPTITLEA,
                WS_OVERLAPPEDWINDOW,
                CW_USEDEFAULT, 0,
                CW_USEDEFAULT, 0,
                NULL, NULL,
                g_hInstance,
                NULL);
        }
    }

    return hWnd;
}

void Header | ( | HDC | hdc,
 |  | char * | str,
 |  | RECT * | prc,
 |  | int * | piY
 | ) |  |

Definition at line 32 of file TextWnd.Cpp.

                                                     {

    HFONT hf      = NULL;
    HFONT hfold   = NULL;
    RECT  rcClear = {0};

    int iLinePos      = 0;
    int iTextPos      = 0;
    int iFontEmHeight = 0;
    int iHeight       = 0;

    iFontEmHeight = SEPARATORHEIGHT*40/100;
    if (*piY <= prc->top)
    {
        // Prepare settings for title only, at top of window
        iLinePos = -1;
        iTextPos = 0;
        iHeight  = SEPARATORHEIGHT*60/100;
    }
    else
    {
        // Prepare settings for 40% white space, a line, 10% whitespace, text and 3% whitespace
        iLinePos = SEPARATORHEIGHT*30/100;
        iTextPos = SEPARATORHEIGHT*40/100;
        iHeight  = SEPARATORHEIGHT;
    }

    rcClear = *prc;
    rcClear.top = *piY;
    rcClear.bottom = *piY + iHeight;
    FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));

    if (*piY > prc->top)
    {
        // Separate from previous output with double pixel line
        MoveToEx(hdc, prc->left,  *piY+iLinePos, NULL);
        LineTo  (hdc, prc->right, *piY+iLinePos);
        MoveToEx(hdc, prc->left,  *piY+iLinePos+1, NULL);
        LineTo  (hdc, prc->right, *piY+iLinePos+1);
    }

    hf = CreateFont(-iFontEmHeight, 0, 0, 0, 0, 0, 0, 0, 1, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE|DEFAULT_PITCH,TEXT("Arial"));
    hfold = (HFONT) SelectObject(hdc, hf);
    __try
    {
         // If str is not null terminated, this call can cause access violation.
        ExtTextOutA(hdc, prc->left, *piY + iTextPos, 0, prc, str, (int)strlen(str), NULL);
    }
    __except(EXCEPTION_EXECUTE_HANDLER)
    {
        DeleteObject(hf);
        return;
     }

    *piY += iHeight;

    SelectObject(hdc, hfold);
    DeleteObject(hf);
}

void InvalidateText ( )

Definition at line 10 of file TextWnd.Cpp.

{
    RECT rc = {0};

    rc.left   = g_fPresentation ? 0 : g_iSettingsWidth;
    rc.top    = 0;
    rc.right  = 10000;
    rc.bottom = 10000;
    InvalidateRect(g_hTextWnd, &rc, TRUE);
}

void Paint ( HWND hWnd )

Definition at line 118 of file TextWnd.Cpp.

{

    PAINTSTRUCT  ps          = {0};
    HDC          hdc         = NULL;
    int          iPos        = 0;
    int          iY          = 0;
    int          iLineHeight = 0;
    RECT         rcText      = {0};
    RECT         rcClear     = {0};

    hdc = BeginPaint(hWnd, &ps);

    // Remove the settings dialog from the repaint rectangle
    if (ps.fErase)
    {
        // Clear below the settings dialog
        if (!g_fPresentation)
        {
            rcClear = ps.rcPaint;
            if (rcClear.right > g_iSettingsWidth)
            {
                rcClear.right = g_iSettingsWidth;
            }
            if (rcClear.top < g_iSettingsHeight)
            {
                rcClear.top = g_iSettingsHeight;
            }

            FillRect(ps.hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));
        }
    }

    // Clear top and left margin
    GetClientRect(hWnd, &rcText);

    // Left margin
    rcClear = rcText;
    rcClear.left  = g_fPresentation ? 0 : g_iSettingsWidth;
    rcClear.right = rcClear.left + 10;
    FillRect(ps.hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));

    // Top margin
    rcClear = rcText;
    rcClear.left  = g_fPresentation ? 0 : g_iSettingsWidth;
    rcClear.top = 0;
    rcClear.bottom = 8;
    FillRect(ps.hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));

    rcText.left = g_fPresentation ? 10 : g_iSettingsWidth + 10;
    rcText.top  = 8;

    iPos = 0;
    iY = rcText.top;

    if (g_fPresentation)
    {
        iLineHeight = rcText.bottom*9/20;
    }
    else
    {
        iLineHeight = 40;
    }

    if (g_fShowLogical)
    {
        if (!g_fPresentation)
        {
            Header(hdc, "Logical characters (ScriptGetCmap, ExtTextOut(ETO_GLYPHINDEX))", &rcText, &iY);
        }
        PaintLogical(hdc, &iY, &rcText, iLineHeight);
    }

    if (g_fShowPlainText)
    {
        if (!g_fPresentation)
        {
            Header(hdc, "Plain text (ScriptStringAnalyse, ScriptStringOut, ScriptStringFree)", &rcText, &iY);
        }
        PaintPlainText(hdc, &iY, &rcText, iLineHeight);
    }

    if (g_fShowFancyText  &&  !g_fPresentation)
    {
        Header(hdc, "Formatted text (ScriptItemize, ScriptLayout, ScriptShape, ScriptPlace, ScriptTextOut)", &rcText, &iY);
        PaintFormattedText(hdc, &iY, &rcText, iLineHeight);
    }

    // Clear any remaining space below the text
    if (    ps.fErase
        &&  iY < rcText.bottom)
    {
        rcClear = rcText;
        rcClear.top = iY;
        FillRect(ps.hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));
    }

    EndPaint(hWnd, &ps);
}

void ResetCaret | ( | int | iX,
 |  | int | iY,
 |  | int | iHeight
 | ) |  |

Definition at line 95 of file TextWnd.Cpp.

{
    g_iCaretX = iX;
    g_iCaretY = iY;

    if (g_iCaretHeight != iHeight)
    {
        g_iCaretHeight = iHeight;
        HideCaret(g_hTextWnd);
        DestroyCaret();
        CreateCaret(g_hTextWnd, NULL, 0, g_iCaretHeight);
        SetCaretPos(g_iCaretX, g_iCaretY);
        ShowCaret(g_hTextWnd);
    }
    else
    {
        SetCaretPos(g_iCaretX, g_iCaretY);
    }
}

LRESULT CALLBACK TextWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 222 of file TextWnd.Cpp.

{
    HDC hdc = NULL;
    LRESULT lProcessed = 0;
    switch (message)
    {
        case WM_CREATE:
            hdc = GetDC(hWnd);
            g_iLogPixelsY = GetDeviceCaps(hdc, LOGPIXELSY);
            ReleaseDC(hWnd, hdc);
            break;

        case WM_ERASEBKGND:
            lProcessed = 0;       // Leave Paint to erase the background
            break;

        case WM_CHAR:

            if (!g_bUnicodeWnd)
            {
                // Convert ANSI keyboard data to Unicode
                int   iCP = 0;
                switch (PRIMARYLANGID(LOWORD(GetKeyboardLayout(NULL))))
                {
                    case LANG_ARABIC:   iCP = 1256;   break;
                    case LANG_HEBREW:   iCP = 1255;   break;
                    case LANG_THAI:     iCP =  874;   break;
                    default:            iCP = 1252;   break;
                }
                DWORD tmpChr = wParam;

                MultiByteToWideChar(iCP, 0, (char*)&tmpChr, 1, (WCHAR*)&wParam, 1);
            }

            if (LOWORD(wParam) == 0x1B)
            {
                // Exit presentation mode
                g_fPresentation = FALSE;
                ShowWindow(g_hSettingsDlg, SW_SHOW);
                UpdateWindow(g_hSettingsDlg);
                InvalidateText();

            }
            else
            {
                EditChar(LOWORD(wParam));
            }
            break;

        case WM_KEYDOWN:
            EditKeyDown(LOWORD(wParam));
            break;

        case WM_KEYUP:

            if (wParam != VK_ESCAPE)
            {
                goto DefaultWindowProcedure;
            }
            // Eat all escape key processing
            break;

        case WM_LBUTTONDOWN:
            g_iMouseDownX = LOWORD(lParam);  // horizontal position of cursor
            g_iMouseDownY = HIWORD(lParam);  // vertical position of cursor
            g_fMouseDown  = TRUE;
            SetFocus(hWnd);
            break;

        case WM_MOUSEMOVE:
            // Treat movement like lbuttonup while lbutton is down,
            // so the selection tracks the cursor movement.
            if (wParam & MK_LBUTTON)
            {
                g_iMouseUpX = LOWORD(lParam);  // horizontal position of cursor
                g_iMouseUpY = HIWORD(lParam);  // vertical position of cursor
                g_fMouseUp = TRUE;
                InvalidateText();
                SetActiveWindow(hWnd);
            }
            break;

        case WM_LBUTTONUP:
            g_iMouseUpX = LOWORD(lParam);  // horizontal position of cursor
            g_iMouseUpY = HIWORD(lParam);  // vertical position of cursor
            g_fMouseUp = TRUE;
            InvalidateText();
            SetActiveWindow(hWnd);
            break;

        case WM_SETFOCUS:
            CreateCaret(hWnd, NULL, 0, g_iCaretHeight);
            SetCaretPos(g_iCaretX, g_iCaretY);
            ShowCaret(hWnd);
            break;

        case WM_KILLFOCUS:
            DestroyCaret();
            break;

        case WM_GETMINMAXINFO:

            // Don't let text window size drop too low

            ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = g_fPresentation ? 10 : g_iMinWidth;
            ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = g_fPresentation ? 10 : g_iMinHeight;
            lProcessed = 0;
            break;

        case WM_PAINT:
            Paint(hWnd);
            break;

        case WM_DESTROY:
            DestroyWindow(g_hSettingsDlg);
            PostQuitMessage(0);
            lProcessed = 0;
            break;

        default:
        DefaultWindowProcedure:
            if (g_bUnicodeWnd)
            {
                lProcessed = DefWindowProcW(hWnd, message, wParam, lParam);
            }
            else
            {
                lProcessed = DefWindowProcA(hWnd, message, wParam, lParam);
            }
    }

    return lProcessed;
}

Variable Documentation

const int SEPARATORHEIGHT = 35

Definition at line 30 of file TextWnd.Cpp.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/gentab.c File Reference

  • WinUI
  • GlobalDev
  • globaldev
Functions

gentab.c File Reference

#include "global.h"

Go to the source code of this file.

Functions

INT_PTR CALLBACK | GeneralDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
void | InitLangList (HWND)

Function Documentation

INT_PTR CALLBACK GeneralDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 57 of file gentab.c.

{
    int      nIndex;
    static   LCID  wNewLang;
    BOOL     bSuccess = TRUE;

    switch(uMsg)
    {
            case WM_INITDIALOG:
             {
                   HANDLE hFile = NULL;
                   LPTSTR lpszText = 0;
                   DWORD  dwReadByte = 0;
                   DWORD  dwFileSize = 0;

                    // We are displaying the content of global.txt in an edit control on this page.
                    // Load the file and set the text.
                    if((hFile = CreateFile(TEXT("global.txt"), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE)
                    {
                        dwFileSize = GetFileSize(hFile, &dwReadByte);
                        if(NULL==(lpszText = (LPTSTR)VirtualAlloc(NULL, dwFileSize, MEM_COMMIT, PAGE_READWRITE)))
                        {
                            bSuccess = FALSE;
                            break;
                        }

                        ReadFile(hFile, lpszText, dwFileSize, &dwReadByte, NULL);
                        if(FALSE == CloseHandle(hFile))
                        {
                            bSuccess = FALSE;
                            VirtualFree(lpszText, dwFileSize, MEM_RELEASE);
                            break;
                        }

                        SetWindowText(GetDlgItem(hDlg, IDC_PURPOSE), lpszText);
                        VirtualFree(lpszText, dwFileSize, MEM_RELEASE);
                    }
                    else
                    {
                        bSuccess = FALSE;
                        break;
                    }

                    // Create the list of the available languages to be displayed in our
                    // drop-down menu for UI language selection
                    InitLangList(hDlg);
            }
            break;

            case WM_COMMAND:
                switch(LOWORD(wParam))
                {
                    case IDCANCEL:  /* fall-through*/
                    case IDOK:
                        break;
                }

                switch (HIWORD(wParam))
                {
                    case CBN_SELCHANGE:  /* fall-through*/
                    case CBN_DBLCLK:

                    // track the user changes into the language selection drop-down menu.
                    nIndex = (int)SendMessage((HWND) lParam, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);

                    if(CB_ERR == nIndex)
                    {
                        bSuccess = FALSE;
                        break;
                    }

                    wNewLang = (LCID) SendMessage((HWND) lParam, CB_GETITEMDATA, (WPARAM) nIndex, (LPARAM) 0 );
                    if (wNewLang != (LCID)g_wCurLang)
                    {
                        // enable the apply buton...
                        SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM)hDlg, 0L);   // enable Apply
                    }
                    else
                    {
                        SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0L);   // enable Apply
                    }
                    break;
                }
                break;

            case WM_NOTIFY:
                switch (((NMHDR *)lParam)->code)
                {
                    case PSN_APPLY:
                    {
                        PSHNOTIFY *lppsn = NULL;

                        lppsn = (LPPSHNOTIFY) lParam;
                        if (lppsn->lParam == FALSE)
                        {
                            // we have an apply, we need to re-load new langauge resources...

                            STARTUPINFO         sui = {0};
                            PROCESS_INFORMATION pi1 = {0};
                            TCHAR               szProcess[MAX_STR];

                            // Create a new instance on ourselve and pass the new language
                            // dll as a parameter.
                            sui.cb = sizeof (STARTUPINFO);
                            _sntprintf(szProcess,MAX_STR,TEXT("global %x"), wNewLang);
              bSuccess = CreateProcess(NULL, szProcess, 0, 0, 0, 0, 0, 0, &sui, &pi1);

                            // close the previous version...
                            PostMessage(GetParent(hDlg), WM_CLOSE, 0, 0);
                        }
                    }
                    break;
                }
                break;

        default:
         bSuccess = FALSE;
   }

    return bSuccess;
}

void InitLangList ( HWND hDlg )

Definition at line 188 of file gentab.c.

{
    int   nIndex = 0;
    WIN32_FIND_DATA wfd = {0};
    HANDLE hFindFile = NULL;

    // Our naming convention for resource DLLs is as follow: gres[langID].dll
    // Find all available resource dlls in the current directory but enumerating gres*.* files
    hFindFile = FindFirstFile(TEXT("gres*.*"), &wfd);

    if(NULL != hFindFile)
    {
        do
        {
            LANGID wFileLang = 0;
            TCHAR szLangName[32];

            // Skip first four letters ("GRES") of filename, convert the rest to a langID.
            wFileLang = (LANGID) _tcstoul(wfd.cFileName+4, NULL, 16);

            // We only offer UI languages that are in fact supported...
            // This is done to prevent users from selecting a language for which the support (font, USP...)
            // are not installed.
            if (IsValidLocale(wFileLang, LCID_INSTALLED))
            {
                // Get the native name of the country associated with that language ID.
                GetLocaleInfo(MAKELCID(wFileLang, SORT_DEFAULT) , LOCALE_SNATIVELANGNAME, szLangName, 32);

                // Add the new language to our list of UI languages.
                SendDlgItemMessage(hDlg, IDC_LANGUAGES, CB_INSERTSTRING, nIndex, (LPARAM) szLangName);

                // Store the langID of the current resource DLL in the combo-box data area
                // for later use.
                SendDlgItemMessage(hDlg, IDC_LANGUAGES, CB_SETITEMDATA, nIndex, (LPARAM) wFileLang);

                // Select the current language in the combo box edit control.
                if(wFileLang == g_wCurLang)
                {
                    SendDlgItemMessage(hDlg, IDC_LANGUAGES, CB_SETCURSEL, nIndex, 0L );
                }

                nIndex++;
            }
        }
        // Look for the followig resouce DLL
        while (FindNextFile(hFindFile, &wfd) );  // Test for do ... while loop
    }
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/global.c File Reference

  • WinUI
  • GlobalDev
  • globaldev
Functions

global.c File Reference

#include "global.h"

Go to the source code of this file.

Functions

int WINAPI | _tWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
BOOL | CreatePropSheet (HWND)
HANDLE | LoadLanguageResource (WORD)

Function Documentation

int WINAPI _tWinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPTSTR | lpszCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 65 of file global.c.

{
    INITCOMMONCONTROLSEX    InitCtrls = {0};
    OSVERSIONINFO           VersionInfo = {0};
    BOOL                    bSuccess = TRUE;

    // Keep a handle to our main instance. That will be handy.
    g_hInst = hInstance;

    // Register specific common controls classes.
    InitCtrls.dwSize = sizeof (INITCOMMONCONTROLSEX);
    InitCtrls.dwICC = ICC_BAR_CLASSES ;
    InitCommonControlsEx(&InitCtrls);

    // We only run on top of Win2000 and Windows XP.
    // These are the only two platfroms really designed for multilingual computing
    VersionInfo.dwOSVersionInfoSize = sizeof (VersionInfo);
    GetVersionEx(&VersionInfo);
    if (VersionInfo.dwMajorVersion < 5)
    {
        MessageBox(NULL,TEXT("This application is designed to run on Windows 2000 and beyond."), TEXT("Global - Error to initialize"), MB_OK|MB_ICONSTOP);
        bSuccess =  FALSE;
    }
    else
    {

        // Load the appropriate resource DLL.
        // If a language is specefied at the command line, then load that language, if not,
        // select the resource DLL that matches the system UI language.
        if (_tcslen(lpszCmdLine) != 0)
        {
            // we start the application in a given language...
            g_hRes = LoadLanguageResource((LANGID) _tcstoul(lpszCmdLine, NULL, 16));
        }
        else
        {
            g_hRes = LoadLanguageResource(0);
        }

        // We fail to load any language DLL, just let the user know and end program.
        if (!g_hRes)
        {
            TCHAR   tcsErr[MAX_STR];
            LoadString(g_hInst, STR_RESDLL_NOTFOUND, tcsErr, MAX_STR);
            LoadString(g_hInst, STR_APPTITLE, g_tcsTemp, MAX_STR);
            MessageBox(NULL, tcsErr, g_tcsTemp, MB_OK|MB_ICONERROR);
            bSuccess =  FALSE;
        }
        else
        {
            // Create our application's proprety sheet.
            CreatePropSheet(NULL);
            // Free resource dll before leaving...
            bSuccess = FreeLibrary(g_hRes);
        }
    }
    return bSuccess;
}

BOOL CreatePropSheet ( HWND hDlg )

Definition at line 133 of file global.c.

{
    PROPSHEETPAGE       psp[NBR_PS_PAGE];
    PROPSHEETHEADER     psh = {0};
    UINT                uiPage = 0;

    // Create our "NLS API" page.
    // the resource template is coming from the resource DLL loaded at run time.
    psp[uiPage].dwSize      = sizeof(PROPSHEETPAGE);
    psp[uiPage].dwFlags     = PSP_DEFAULT;
    psp[uiPage].hInstance   = g_hRes;
    psp[uiPage].pszTemplate = MAKEINTRESOURCE(DLG_NLS);
    psp[uiPage].pszIcon     = NULL;
    psp[uiPage].pfnDlgProc  = NLSDlgProc;
    psp[uiPage].pszTitle    = NULL;
    psp[uiPage].lParam      = 0L;
    psp[uiPage].pfnCallback = NULL;
    uiPage++;

    // Create our "TEXT API" page.
    // The resource template is coming from the resource DLL loaded at run time.
    psp[uiPage].dwSize      = sizeof(PROPSHEETPAGE);
    psp[uiPage].dwFlags     = PSP_DEFAULT;
    psp[uiPage].hInstance   = g_hRes;
    psp[uiPage].pszTemplate = MAKEINTRESOURCE(DLG_TEXT);
    psp[uiPage].pszIcon     = NULL;
    psp[uiPage].pfnDlgProc  = TextDlgProc;
    psp[uiPage].pszTitle    = NULL;
    psp[uiPage].lParam      = 0L;
    psp[uiPage].pfnCallback = NULL;
    uiPage++;

    // Create our "General" page.
    // The resource template is coming from the resource DLL loaded at run time.
    psp[uiPage].dwSize      = sizeof(PROPSHEETPAGE);
    psp[uiPage].dwFlags     = PSP_DEFAULT;
    psp[uiPage].hInstance   = g_hRes;
    psp[uiPage].pszTemplate = MAKEINTRESOURCE(DLG_GENERAL);
    psp[uiPage].pszIcon     = NULL;
    psp[uiPage].pfnDlgProc  = GeneralDlgProc;
    psp[uiPage].pszTitle    = NULL;
    psp[uiPage].lParam      = 0L;
    psp[uiPage].pfnCallback = NULL;
    uiPage++;

    psh.dwSize      = sizeof(PROPSHEETHEADER);
    psh.dwFlags     = PSH_PROPSHEETPAGE | PSH_USEPAGELANG;
    psh.hwndParent  = hDlg;
    psh.hInstance   = g_hInst;
    psh.hIcon       = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON));

    LoadString(g_hInst, STR_TITLE, g_tcsTemp, MAX_STR);
    psh.pszCaption  = g_tcsTemp;
    psh.nPages      = NBR_PS_PAGE;
    psh.nStartPage  = 0;
    psh.ppsp        = (LPCPROPSHEETPAGE)&psp;
    psh.pfnCallback = NULL;

    return (PropertySheet(&psh) != -1);
}

HANDLE LoadLanguageResource ( WORD wLangId )

Definition at line 207 of file global.c.

{
    HANDLE  hRes = NULL;

    // if wLangId = NULL then load user's language of the UI
    // GetUserDefaltUILanguage only works on WinME, Win2000, and WinXP.
    // To retrieve the UI language on any other OS, refer to the article at:
    // http://www.microsoft.com/globaldev/articles/muiapp.asp
    if (wLangId == 0)
    {
        wLangId = GetUserDefaultUILanguage();
    }

    // Our naming convention for satellite DLLs is: gres[langID].dll
    // Create file name and load the appropriate resource DLL.
    _sntprintf(g_tcsTemp,MAX_STR,TEXT("gres%x.dll"), wLangId);
    g_wCurLang = wLangId;

    if(NULL == (hRes = LoadLibrary(g_tcsTemp)))
    {
        // We didn't find the desired language satellite DLL, lets go with English
        hRes = LoadLibrary(TEXT("gres409.dll"));

        // Keep the a copy of our UI language ID (will be handy).
        g_wCurLang = 409;
    }

     return hRes;
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/global.h File Reference

  • WinUI
  • GlobalDev
  • globaldev
Classes | Defines | Typedefs | Functions | Variables

global.h File Reference

#include <windows.h>
#include <commdlg.h>
#include <winuser.h>
#include <windowsx.h>
#include <dos.h>
#include <tchar.h>
#include <io.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cpl.h>
#include <time.h>
#include <commctrl.h>
#include <direct.h>
#include <objbase.h>
#include <shlobj.h>
#include <TCHAR.h>
#include "resource.h"
#include "res.h"
#include "resource.h"

Go to the source code of this file.

Classes

struct | _LOCINFO

Defines

#define | COLUMN_ACP 4
#define | COLUMN_LANGID 0
#define | COLUMN_LANGUAGE 1
#define | COLUMN_NATIVECOUNTRY 3
#define | COLUMN_NATIVELANG 2
#define | COLUMN_OEMCP 5
#define | DEFAULT_FONT TEXT("MS Shell Dlg")
#define | DeleteFontObject(_hDlg, _hFont, _CntlID)
#define | MAX_STR 256
#define | NBR_PS_PAGE 3
#define | STR_CPLEN 5
#define | STR_LEN 50
#define | WS_EX_LAYOUTRTL 0x00400000L
#define | WS_EX_NOINHERITLAYOUT 0x00100000L

Typedefs

typedef struct _LOCINFO | LOCINFO
typedef struct _LOCINFO * | LPLOCINFO

Functions

INT_PTR CALLBACK | FontDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR CALLBACK | GeneralDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR CALLBACK | MirroringDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR CALLBACK | NLSDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR CALLBACK | TextDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR CALLBACK | USPDlgProc (HWND, UINT, WPARAM, LPARAM)

Variables

HINSTANCE | g_hInst
HANDLE g_hRes
TCHAR | g_tcsTemp [MAX_STR]
int | g_wCurLang

Define Documentation

#define COLUMN_ACP 4

Definition at line 73 of file global.h.

#define COLUMN_LANGID 0

Definition at line 69 of file global.h.

#define COLUMN_LANGUAGE 1

Definition at line 70 of file global.h.

#define COLUMN_NATIVECOUNTRY 3

Definition at line 72 of file global.h.

#define COLUMN_NATIVELANG 2

Definition at line 71 of file global.h.

#define COLUMN_OEMCP 5

Definition at line 74 of file global.h.

#define DEFAULT_FONT TEXT("MS Shell Dlg")

Definition at line 76 of file global.h.

#define DeleteFontObject | ( | _hDlg,
 |  | _hFont,
 |  | _CntlID
 | ) |
Value:
do \
{ \
    _hFont = (HFONT) SendDlgItemMessage(_hDlg, _CntlID, WM_GETFONT, \
        (WPARAM) 0,  (LPARAM) 0) ; \
    if (_hFont) DeleteObject (_hFont) ; \
}while (0);

Definition at line 106 of file global.h.

#define MAX_STR 256

Definition at line 65 of file global.h.

#define NBR_PS_PAGE 3

Definition at line 67 of file global.h.

#define STR_CPLEN 5

Definition at line 66 of file global.h.

#define STR_LEN 50

Definition at line 64 of file global.h.

#define WS_EX_LAYOUTRTL 0x00400000L

Definition at line 61 of file global.h.

#define WS_EX_NOINHERITLAYOUT 0x00100000L

Definition at line 62 of file global.h.

Typedef Documentation

typedef struct _LOCINFO LOCINFO
typedef struct _LOCINFO* LPLOCINFO

Function Documentation

INT_PTR CALLBACK FontDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |
INT_PTR CALLBACK GeneralDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 57 of file gentab.c.

{
    int      nIndex;
    static   LCID  wNewLang;
    BOOL     bSuccess = TRUE;

    switch(uMsg)
    {
            case WM_INITDIALOG:
             {
                   HANDLE hFile = NULL;
                   LPTSTR lpszText = 0;
                   DWORD  dwReadByte = 0;
                   DWORD  dwFileSize = 0;

                    // We are displaying the content of global.txt in an edit control on this page.
                    // Load the file and set the text.
                    if((hFile = CreateFile(TEXT("global.txt"), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE)
                    {
                        dwFileSize = GetFileSize(hFile, &dwReadByte);
                        if(NULL==(lpszText = (LPTSTR)VirtualAlloc(NULL, dwFileSize, MEM_COMMIT, PAGE_READWRITE)))
                        {
                            bSuccess = FALSE;
                            break;
                        }

                        ReadFile(hFile, lpszText, dwFileSize, &dwReadByte, NULL);
                        if(FALSE == CloseHandle(hFile))
                        {
                            bSuccess = FALSE;
                            VirtualFree(lpszText, dwFileSize, MEM_RELEASE);
                            break;
                        }

                        SetWindowText(GetDlgItem(hDlg, IDC_PURPOSE), lpszText);
                        VirtualFree(lpszText, dwFileSize, MEM_RELEASE);
                    }
                    else
                    {
                        bSuccess = FALSE;
                        break;
                    }

                    // Create the list of the available languages to be displayed in our
                    // drop-down menu for UI language selection
                    InitLangList(hDlg);
            }
            break;

            case WM_COMMAND:
                switch(LOWORD(wParam))
                {
                    case IDCANCEL:  /* fall-through*/
                    case IDOK:
                        break;
                }

                switch (HIWORD(wParam))
                {
                    case CBN_SELCHANGE:  /* fall-through*/
                    case CBN_DBLCLK:

                    // track the user changes into the language selection drop-down menu.
                    nIndex = (int)SendMessage((HWND) lParam, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);

                    if(CB_ERR == nIndex)
                    {
                        bSuccess = FALSE;
                        break;
                    }

                    wNewLang = (LCID) SendMessage((HWND) lParam, CB_GETITEMDATA, (WPARAM) nIndex, (LPARAM) 0 );
                    if (wNewLang != (LCID)g_wCurLang)
                    {
                        // enable the apply buton...
                        SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM)hDlg, 0L);   // enable Apply
                    }
                    else
                    {
                        SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0L);   // enable Apply
                    }
                    break;
                }
                break;

            case WM_NOTIFY:
                switch (((NMHDR *)lParam)->code)
                {
                    case PSN_APPLY:
                    {
                        PSHNOTIFY *lppsn = NULL;

                        lppsn = (LPPSHNOTIFY) lParam;
                        if (lppsn->lParam == FALSE)
                        {
                            // we have an apply, we need to re-load new langauge resources...

                            STARTUPINFO         sui = {0};
                            PROCESS_INFORMATION pi1 = {0};
                            TCHAR               szProcess[MAX_STR];

                            // Create a new instance on ourselve and pass the new language
                            // dll as a parameter.
                            sui.cb = sizeof (STARTUPINFO);
                            _sntprintf(szProcess,MAX_STR,TEXT("global %x"), wNewLang);
              bSuccess = CreateProcess(NULL, szProcess, 0, 0, 0, 0, 0, 0, &sui, &pi1);

                            // close the previous version...
                            PostMessage(GetParent(hDlg), WM_CLOSE, 0, 0);
                        }
                    }
                    break;
                }
                break;

        default:
         bSuccess = FALSE;
   }

    return bSuccess;
}

INT_PTR CALLBACK MirroringDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |
INT_PTR CALLBACK NLSDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 78 of file nlsapi.c.

{
    BOOL bProcessedMsg = TRUE;

    switch(uMsg)
    {
        case WM_INITDIALOG:
        {
            LVCOLUMN    lvcCol = {0};
            UINT        lcid = 0;
            LVFINDINFO  lvInfo = {0};
            int         iItem = 0;

            // load our own icon
            SendMessage(GetParent(hDlg), WM_SETICON, ICON_BIG, (LPARAM) (LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON))));

            // Create our list column  for the listview control
            g_hwndList = GetDlgItem(hDlg, IDC_LV_LCID);
            g_hDlg = hDlg;

            lvcCol.mask = LVCF_TEXT;
            LoadString(g_hRes, STR_LANGID, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_LANGID, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_LANG, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_LANGUAGE, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_NLANG, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_NATIVELANG, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_NCOUNTRY, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_NATIVECOUNTRY, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_ACP, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_ACP, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_OEMCP, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_OEMCP, (LV_COLUMN *)&lvcCol);

            // fill out our listview control with available locales (supported ones).
            EnumSystemLocales(EnumLocalesProc, LCID_SUPPORTED);

            // Initialize formatting fields related to the selected locale in the listview
            InitNLSFields(hDlg, LOCALE_USER_DEFAULT);

            // Set the column width of the listview control.
            ListView_SetColumnWidth(g_hwndList, COLUMN_LANGID, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_LANGUAGE, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVELANG, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVECOUNTRY, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_ACP, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_OEMCP, LVSCW_AUTOSIZE_USEHEADER);

            // Find user's current locale and select that item in the listview control.
            lcid = GetUserDefaultLCID();

            // Our list has all the LCIDs in 4 digits (0409) whereas GetUserDefaultLCID returs (409).
            if (lcid < 0x1000)
            {
                _sntprintf(g_tcsTemp,MAX_STR,TEXT("0%x"), lcid);
            }
            else
            {
                _sntprintf(g_tcsTemp,MAX_STR,TEXT("%x"), lcid);
            }

            lvInfo.flags = LVFI_STRING;
            lvInfo.psz = g_tcsTemp;

            iItem = ListView_FindItem(g_hwndList, 0, &lvInfo);
            ListView_SetItemState (g_hwndList, iItem, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
            ListView_EnsureVisible(g_hwndList, iItem, FALSE);

            // Set some of the extended styles of our list view (cool reports ;-)
            ListView_SetExtendedListViewStyle(g_hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_GRIDLINES | LVS_EX_TWOCLICKACTIVATE);
        }
        break;

        case WM_NOTIFY:
            switch (((NMHDR *)lParam)->code)
            {
                case LVN_COLUMNCLICK:
                    {
                        NM_LISTVIEW nmv;
                        static int iLastSort = COLUMN_LANGID;
                        LPARAM lSortParam = -1;
                        LVFINDINFO lvInfo;
                        int         iItem;

                        // When a column is clicked we need to redo our sorting of preview table.

                        nmv = *(const NM_LISTVIEW *) lParam;

                        // We don't sort for native language and native country name (avoid confusion).
                        if ((nmv.iSubItem == COLUMN_NATIVELANG) || (nmv.iSubItem == COLUMN_NATIVECOUNTRY))
                        {
                            break;
                        }

                        // If our last sorting was on a different column, we need to do more
                        // than simply reverting our sorting.
                        // Because of listview sorting limitations, we need to redo our list...
                        if (iLastSort != nmv.iSubItem)
                        {
                            // The list view sorting is based on a q-sort, we need to redo our list!
                            ListView_DeleteAllItems(g_hwndList);
                            g_iCounter  = 0;
                            EnumSystemLocales(EnumLocalesProc, LCID_SUPPORTED);

                            // Make sure the last selection remains active after sorting...
                            if (g_iCurLocale < 0x1000)
                            {
                                _sntprintf(g_tcsTemp,MAX_STR,TEXT("0%x"), g_iCurLocale);
                            }
                            else
                            {
                                _sntprintf(g_tcsTemp,MAX_STR,TEXT("%x"), g_iCurLocale);
                            }

                            lvInfo.flags = LVFI_STRING;
                            lvInfo.psz = g_tcsTemp;
                            iItem = ListView_FindItem(g_hwndList, 0, &lvInfo);
                            ListView_SetItemState (g_hwndList, iItem, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);

                            // Update our flag for the last column sorted and set the sorting flag
                            iLastSort = nmv.iSubItem;
                            lSortParam = iLastSort;
                        }

                        // Do the actual sorting...
                        ListView_SortItems(g_hwndList, (PFNLVCOMPARE)CompareFunc, lSortParam);

                        // Make sure our selection is visible after the sorting!
                        ListView_EnsureVisible(g_hwndList, ListView_GetSelectionMark(g_hwndList), FALSE);
                    }
                    break;

                case LVN_ITEMCHANGED:   /* fall-through */
                case LVN_ITEMACTIVATE:
                    {
                        LPNM_LISTVIEW lpnmlv = (LPNM_LISTVIEW)lParam;
                        static    int iItem;
                        LVITEM    lvItem = {0};

                        // Item selection has been changed.
                        // Find the new langId and update our formatting fields...
                        if (iItem != lpnmlv->iItem)
                        {
                            iItem = lpnmlv->iItem;

                            lvItem.mask = LVIF_TEXT;
                            lvItem.iItem = iItem;
                            lvItem.pszText = g_tcsTemp;
                            lvItem.cchTextMax  = STR_LEN;
                            ListView_GetItem(g_hwndList, &lvItem);
                            g_iCurLocale = iConvertStrToInt(lvItem.pszText);
                            InitNLSFields(hDlg, g_iCurLocale);
                        }

                        // Show advanced data on the selected locale...
                        if (((NMHDR *)lParam)->code == LVN_ITEMACTIVATE)
                        {
                           bProcessedMsg = (DialogBox(g_hRes, MAKEINTRESOURCE(DLG_LCID), hDlg, LcidDlgProc) != -1);
                        }
                    }
                    break;
                }
                break;

                case WM_COMMAND:
                    switch(LOWORD(wParam))
                    {
                        case IDCANCEL: /* fall-through*/
                        case IDOK:
                            break;

                        case IDC_TIMEFORMAT:
                            {
                                if(HIWORD(wParam) == CBN_SELCHANGE)
                                {
                                    // Time formating selection has been changed.
                                    // Re-edit time
                                    HWND    hList = NULL;
                                    LRESULT index = 0;
                                    TCHAR    tcTemp[MAX_STR];

                                    hList = GetDlgItem(hDlg, IDC_TIMEFORMAT);

                                    if(NULL == hList)
                                    {
                                        bProcessedMsg = FALSE;
                                        break;
                                    }

                                    index = SendMessage(hList, CB_GETCURSEL, 0, 0);
                                    SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
                                    GetTimeFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
                                    SetWindowText(GetDlgItem(hDlg, IDC_TIMESAMPLE), tcTemp);
                                }
                            }
                            break;

                        case IDC_SDATEFORMAT:
                            {
                                if(HIWORD(wParam) == CBN_SELCHANGE)
                                {
                                    // short date formating selection has been changed.
                                    // Re-edit short date
                                    HWND    hList = NULL;
                                    LRESULT index = 0;
                                    TCHAR    tcTemp[MAX_STR];

                                    hList = GetDlgItem(hDlg, IDC_SDATEFORMAT);

                                    if(NULL == hList)
                                    {
                                        bProcessedMsg = FALSE;
                                        break;
                                    }
                                    index = SendMessage(hList, CB_GETCURSEL, 0, 0);
                                    SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
                                    GetDateFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
                                    SetWindowText(GetDlgItem(hDlg, IDC_SDATESAMPLE), tcTemp);
                                }
                            }
                            break;

                        case IDC_LDATEFORMAT:
                            {
                                if(HIWORD(wParam) == CBN_SELCHANGE)
                                {
                                    // long date formating selection has been changed.
                                    // Re-edit long date
                                    HWND    hList = NULL;
                                    LRESULT index = 0;
                                    TCHAR    tcTemp[MAX_STR];

                                    hList = GetDlgItem(hDlg, IDC_LDATEFORMAT);

                                    if(NULL == hList)
                                    {
                                        bProcessedMsg = FALSE;
                                        break;
                                    }

                                    index = SendMessage(hList, CB_GETCURSEL, 0, 0);
                                    SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
                                    GetDateFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
                                    SetWindowText(GetDlgItem(hDlg, IDC_LDATESAMPLE), tcTemp);
                                }
                            }
                            break;
                    }
                    break;

        default:
            bProcessedMsg = FALSE;
    }

    return bProcessedMsg;
}

INT_PTR CALLBACK TextDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 57 of file textapi.c.

{
    LONG        lAlign = 0;
    HFONT       hEditFont = NULL;
    HWND        hWndEdit = NULL;
    static      CHOOSEFONT cf;
    static      LOGFONT lf;
    INT_PTR     iProcessedMsg   = 1;

    switch(uMsg)
    {
        case WM_INITDIALOG:
            {
                // Fill out a font structure that will be used in a call for CreateFont.
                InitializeFont(hDlg, DEFAULT_FONT, 24, &cf, &lf);

                hEditFont = CreateFontIndirect(&lf) ;
                if(NULL == hEditFont)
                {
                    iProcessedMsg = 0;
                    break;
                }
                // Set font of edit control
                SendDlgItemMessage(hDlg, IDC_EDITWIN, WM_SETFONT, (WPARAM) hEditFont,  MAKELPARAM(TRUE, 0)) ;
            }
            break;

        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                // Erase our text control by setting the content to NULL.
                case IDB_CLEAR:
                    {
                        hWndEdit = GetDlgItem (hDlg, IDC_EDITWIN);
                        if(NULL == hWndEdit)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        SetWindowText(hWndEdit, TEXT(""));
                    }
                    break;

                // Provide a font selection mechanism through the system's font selection
                // common dialog.
                case IDB_FONT:
                    {
                        DeleteFontObject(hDlg, hEditFont, IDC_EDITWIN);

                        if(FALSE == ChooseFont(&cf))
                        {
                            iProcessedMsg = 0;
                            break;
                        }

                        hEditFont = CreateFontIndirect(&lf);
                        if(NULL == hEditFont)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        SendDlgItemMessage (hDlg, IDC_EDITWIN, WM_SETFONT, (WPARAM) hEditFont,  MAKELPARAM(TRUE, 0));
                    }
                    break;

                // Toggles the reading order of the text.
                case IDB_READING:
                    {
                        hWndEdit = GetDlgItem(hDlg, IDC_EDITWIN);
                        if(NULL == hWndEdit)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        lAlign   = GetWindowLong(hWndEdit, GWL_EXSTYLE) ^ WS_EX_RTLREADING;
                        SetWindowLong(hWndEdit, GWL_EXSTYLE, lAlign);
                        InvalidateRect(hWndEdit ,NULL, TRUE);
                    }
                    break;

                // Toggles the text alignment.
                case IDB_ALIGN:
                    {
                        hWndEdit = GetDlgItem(hDlg, IDC_EDITWIN);
                        if(NULL == hWndEdit)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        lAlign   = GetWindowLong(hWndEdit, GWL_EXSTYLE) ^ WS_EX_RIGHT;
                        SetWindowLong(hWndEdit, GWL_EXSTYLE, lAlign);
                        InvalidateRect(hWndEdit ,NULL, TRUE);
                    }
                    break;

                case IDCANCEL: /* fall-through*/
                case IDOK:
                    {
                        DeleteFontObject(hDlg, hEditFont, IDC_EDITWIN);
                    }
                    break;
            }
         break;

        default:
            iProcessedMsg = 0;
            break;
    }
    return iProcessedMsg;
}

INT_PTR CALLBACK USPDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Variable Documentation

HINSTANCE g_hInst

Definition at line 91 of file global.h.

HANDLE g_hRes

Definition at line 93 of file global.h.

TCHAR g_tcsTemp[MAX_STR]

Definition at line 92 of file global.h.

int g_wCurLang

Definition at line 94 of file global.h.

Generated on Wed Nov 13 2024 16:53:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/nlsapi.c File Reference

  • WinUI
  • GlobalDev
  • globaldev
Functions | Variables

nlsapi.c File Reference

#include "global.h"

Go to the source code of this file.

Functions

int CALLBACK | CompareFunc (LPARAM, LPARAM, LPARAM)
BOOL CALLBACK | EnumCalendarInfoProc (LPTSTR)
BOOL CALLBACK | EnumLDateFormatsProc (LPTSTR)
BOOL CALLBACK | EnumLocalesProc (LPTSTR)
BOOL CALLBACK | EnumSDateFormatsProc (LPTSTR)
BOOL CALLBACK | EnumTimeFormatsProc (LPTSTR)
int | iConvertStrToInt (LPTSTR)
void | InitNLSFields (HWND, LCID)
INT_PTR CALLBACK | LcidDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR CALLBACK | NLSDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Variables

HWND | g_hDlg
HWND | g_hwndList
int | g_iCounter = 0
int | g_iCurLocale

Function Documentation

int CALLBACK CompareFunc | ( | LPARAM | lParam1,
 |  | LPARAM | lParam2,
 |  | LPARAM | lParamSort
 | ) |  |

Definition at line 712 of file nlsapi.c.

{
int     iRet = 0;
TCHAR   csItem1[STR_LEN], csItem2[STR_LEN];

    // We are just reversing the order, just leave now.
    if (lParamSort == -1)
    {
        iRet = 1;
    }
    else
    {
        // find the text of the subitem that we want to sort...
        ListView_GetItemText(g_hwndList, (int)lParam1, (int)lParamSort, csItem1, STR_LEN);
        ListView_GetItemText(g_hwndList, (int)lParam2, (int)lParamSort, csItem2, STR_LEN);

        switch (lParamSort)
        {
            case COLUMN_LANGID:
                iRet = lstrcmp(csItem1, csItem2);
                break;

            case COLUMN_LANGUAGE:
                iRet = lstrcmp(csItem1, csItem2);
                break;

            case COLUMN_ACP:
                iRet = _ttoi(csItem1) - _ttoi (csItem2);
                break;

        case COLUMN_OEMCP:
                iRet = _ttoi(csItem1) - _ttoi (csItem2);
                break;

            // Don't do anything. We should not get here.
            default:
                iRet = -1;
        }
    }

    return iRet;
}

BOOL CALLBACK EnumCalendarInfoProc ( LPTSTR lpCalendarInfoString )

Definition at line 625 of file nlsapi.c.

{
    BOOL bProcessed = TRUE;

    if (!lpCalendarInfoString)
    {
        return FALSE;
    }
    else
    {
        // Fill into the combo box the list of supported calendars...
        SendMessage(GetDlgItem(g_hDlg, IDC_CALFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpCalendarInfoString);
    }

    return bProcessed;
}

BOOL CALLBACK EnumLDateFormatsProc ( LPTSTR lpDateFormatString )

Definition at line 600 of file nlsapi.c.

{
    BOOL bProcessed = TRUE;

    if (!lpDateFormatString)
    {
        return FALSE;
    }
    else
    {
        // Fill into the combo box the list of supported long date formats...
        SendMessage(GetDlgItem(g_hDlg, IDC_LDATEFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpDateFormatString);
    }

    return bProcessed;
}

BOOL CALLBACK EnumLocalesProc ( LPTSTR lpLocaleString )

Definition at line 358 of file nlsapi.c.

{
    int     iCurLocale = 0;
    TCHAR   szCurName[STR_LEN];
    LVITEM  lviItem = {0};
    int     iNewItem  = 0;
    BOOL    bProcessed = TRUE;

    if (!lpLocaleString)
    {
        bProcessed = FALSE;
    }
    else
    {
        iCurLocale = iConvertStrToInt(lpLocaleString);

        // initialize out LV item
        lviItem.mask = LVIF_TEXT | LVIF_PARAM;
        lviItem.cchTextMax  = STR_LEN;
        lviItem.lParam = g_iCounter ;

        // Get LangID and add it in LV
        GetLocaleInfo(iCurLocale, LOCALE_ILANGUAGE , szCurName, STR_LEN);
        lviItem.pszText = szCurName;
        iNewItem = ListView_InsertItem(g_hwndList, &lviItem);

        // Get and write localize language name
        GetLocaleInfo(iCurLocale, LOCALE_SLANGUAGE , szCurName, STR_LEN);
        ListView_SetItemText(g_hwndList, iNewItem, 1, szCurName);

        // Get and write Native Language Name...
        GetLocaleInfo(iCurLocale, LOCALE_SNATIVELANGNAME , szCurName, STR_LEN);
        ListView_SetItemText(g_hwndList, iNewItem, 2, szCurName);

        // Get and write Native Country Name...
        GetLocaleInfo(iCurLocale, LOCALE_SNATIVECTRYNAME , szCurName, STR_LEN);
        ListView_SetItemText(g_hwndList, iNewItem, 3, szCurName);

        // Get and write ANSI CP.
        GetLocaleInfo(iCurLocale, LOCALE_IDEFAULTANSICODEPAGE , szCurName, STR_LEN);
        ListView_SetItemText(g_hwndList, iNewItem, 4, szCurName);

        // Get and write OEM CP.
        GetLocaleInfo(iCurLocale, LOCALE_IDEFAULTCODEPAGE , szCurName, STR_LEN);
        ListView_SetItemText(g_hwndList, iNewItem, 5, szCurName);

        g_iCounter ++;
    }

    return bProcessed;
}

BOOL CALLBACK EnumSDateFormatsProc ( LPTSTR lpDateFormatString )

Definition at line 576 of file nlsapi.c.

{
    BOOL bProcessed = TRUE;
    if (!lpDateFormatString)
    {
        return FALSE;
    }
    else
    {
        // Fill into the combo box the list of supported short date formats...
        SendMessage(GetDlgItem(g_hDlg, IDC_SDATEFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpDateFormatString);
    }

    return bProcessed;
}

BOOL CALLBACK EnumTimeFormatsProc ( LPTSTR lpTimeFormatString )

Definition at line 550 of file nlsapi.c.

{
    BOOL bProcessed = TRUE;

    if (!lpTimeFormatString)
    {
        bProcessed = FALSE;
    }
    else
    {
        // Fill into the combo box the list of supported time formats...
        SendMessage(GetDlgItem(g_hDlg, IDC_TIMEFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpTimeFormatString);
    }

    return bProcessed;
}

int iConvertStrToInt ( LPTSTR strString )

Definition at line 419 of file nlsapi.c.

{
int   i, iNum;
int   iValue = 0;
int   iboundry;

  // convert the string to upper case first.
  _tcsupr(strString);

  // we look into 4 LSB only since:
  // LCID (DWORD) = Sort-Key (HI-WORD) + Lang ID (LOW-WORD)
    __try
    {
        // If strString is not null terminated , this call can cause access violation.
        iboundry = _tcslen(strString) - 1;
    }

    __except(EXCEPTION_EXECUTE_HANDLER)
    {
        iboundry = 0;
    }

  for (i = iboundry; i > iboundry - 4; i--)
  {
    iNum = strString[i] - 48; // 48 being the ASCII number for 0
    if (iNum > 10)        // if it's over digit range
      iNum -= 7;
    iValue += iNum * (int)(pow(16, iboundry-i));
  }
  return iValue;
}

void InitNLSFields | ( | HWND | hDlg,
 |  | LCID | lcid
 | ) |  |

Definition at line 460 of file nlsapi.c.

{
    TCHAR   tcsTemp[MAX_STR];
    HWND    hList = NULL;

    // Init larg number fields...
    LoadString(g_hInst, STR_LARGEPOSNUMBER, g_tcsTemp, MAX_STR);
    GetNumberFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
    SetWindowText(GetDlgItem(hDlg, IDC_POS_NUMBER), tcsTemp);

    LoadString(g_hInst, STR_LARGENEGNUMBER, g_tcsTemp, MAX_STR);
    GetNumberFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
    SetWindowText(GetDlgItem(hDlg, IDC_NEG_NUMBER), tcsTemp);

    // Init the currency field format...
    LoadString(g_hInst, STR_LARGEPOSNUMBER, g_tcsTemp, MAX_STR);
    GetCurrencyFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
    SetWindowText(GetDlgItem(hDlg, IDC_POS_CURRENCY), tcsTemp);

    LoadString(g_hInst, STR_LARGENEGNUMBER, g_tcsTemp, MAX_STR);
    GetCurrencyFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
    SetWindowText(GetDlgItem(hDlg, IDC_NEG_CURRENCY), tcsTemp);

    // Init time field format...
    // Delete our previous list of items...
    hList = GetDlgItem(g_hDlg, IDC_TIMEFORMAT);
    if(NULL != hList)
    {
        SendMessage(hList, CB_RESETCONTENT , 0, 0);

        // Enumerates the time formats that are available for a specified locale.
        EnumTimeFormats(EnumTimeFormatsProc, lcid, 0);
        SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
        SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
        GetTimeFormat(lcid, 0, NULL, g_tcsTemp, tcsTemp, MAX_STR);
        SetWindowText(GetDlgItem(hDlg, IDC_TIMESAMPLE), tcsTemp);
    }

    // Init calendar field format...
    // Delete our previous list of items...
    hList = GetDlgItem(g_hDlg, IDC_CALFORMAT);
    if(NULL != hList)
    {
        SendMessage(hList, CB_RESETCONTENT , 0, 0);

        // Enumerates the short date formats that are available for a specified locale.
        EnumCalendarInfo(EnumCalendarInfoProc, lcid, ENUM_ALL_CALENDARS, CAL_SCALNAME);
        SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
        SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
    }

    // Init short date field format...
    // Delete our previous list of items...
    hList = GetDlgItem(g_hDlg, IDC_SDATEFORMAT);
    if(NULL != hList)
    {
        SendMessage(hList, CB_RESETCONTENT , 0, 0);

        // Enumerates the short date formats that are available for a specified locale.
        EnumDateFormats(EnumSDateFormatsProc, lcid, DATE_SHORTDATE);
        SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
        SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
        GetDateFormat(lcid, 0, NULL, g_tcsTemp, tcsTemp, MAX_STR);
        SetWindowText(GetDlgItem(hDlg, IDC_SDATESAMPLE), tcsTemp);
    }

    // Init long date field format...
    // Delete our previous list of items...
    hList = GetDlgItem(g_hDlg, IDC_LDATEFORMAT);
    if(NULL != hList)
    {
        SendMessage(hList, CB_RESETCONTENT , 0, 0);

        // Enumerates the long date formats that are available for a specified locale
        EnumDateFormats(EnumLDateFormatsProc, lcid, DATE_LONGDATE);
        SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
        SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
        GetDateFormat(lcid, 0, NULL, g_tcsTemp, tcsTemp, MAX_STR);
        SetWindowText(GetDlgItem(hDlg, IDC_LDATESAMPLE), tcsTemp);
    }
}

INT_PTR CALLBACK LcidDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 651 of file nlsapi.c.

{
    BOOL bProcessedMsg = TRUE;

    switch(uMsg)
    {
    case WM_INITDIALOG:
        {
            TCHAR   szCurName[STR_LEN];

            // Get and write Localized Name...
            GetLocaleInfo(g_iCurLocale, LOCALE_SLANGUAGE , szCurName, STR_LEN);
            SetWindowText(GetDlgItem(hDlg, IDC_LANGNAME), szCurName);

            // Get and write Native Language Name...
            GetLocaleInfo(g_iCurLocale, LOCALE_SNATIVELANGNAME , szCurName, STR_LEN);
            SetWindowText(GetDlgItem(hDlg, IDC_NLANGNAME), szCurName);

            // Get and write Native Country Name...
            GetLocaleInfo(g_iCurLocale, LOCALE_SNATIVECTRYNAME , szCurName, STR_LEN);
            SetWindowText(GetDlgItem(hDlg, IDC_NCOUNTRYNAME), szCurName);

            // Get and write ANSI CP
            GetLocaleInfo(g_iCurLocale, LOCALE_IDEFAULTANSICODEPAGE , szCurName, STR_LEN);
            SetWindowText(GetDlgItem(hDlg, IDC_ACP), szCurName);

            // Get and write OEM CP
            GetLocaleInfo(g_iCurLocale, LOCALE_IDEFAULTCODEPAGE , szCurName, STR_LEN);
            SetWindowText(GetDlgItem(hDlg, IDC_OEM), szCurName);
        }
        break;

    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
            case IDOK:      /* fall-through */
            case IDCANCEL:
                bProcessedMsg = EndDialog(hDlg, TRUE);
                break;
        }
     break;

    default:
        bProcessedMsg = FALSE;
        break;
    }

    return bProcessedMsg;
}

INT_PTR CALLBACK NLSDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 78 of file nlsapi.c.

{
    BOOL bProcessedMsg = TRUE;

    switch(uMsg)
    {
        case WM_INITDIALOG:
        {
            LVCOLUMN    lvcCol = {0};
            UINT        lcid = 0;
            LVFINDINFO  lvInfo = {0};
            int         iItem = 0;

            // load our own icon
            SendMessage(GetParent(hDlg), WM_SETICON, ICON_BIG, (LPARAM) (LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON))));

            // Create our list column  for the listview control
            g_hwndList = GetDlgItem(hDlg, IDC_LV_LCID);
            g_hDlg = hDlg;

            lvcCol.mask = LVCF_TEXT;
            LoadString(g_hRes, STR_LANGID, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_LANGID, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_LANG, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_LANGUAGE, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_NLANG, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_NATIVELANG, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_NCOUNTRY, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_NATIVECOUNTRY, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_ACP, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_ACP, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_OEMCP, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_OEMCP, (LV_COLUMN *)&lvcCol);

            // fill out our listview control with available locales (supported ones).
            EnumSystemLocales(EnumLocalesProc, LCID_SUPPORTED);

            // Initialize formatting fields related to the selected locale in the listview
            InitNLSFields(hDlg, LOCALE_USER_DEFAULT);

            // Set the column width of the listview control.
            ListView_SetColumnWidth(g_hwndList, COLUMN_LANGID, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_LANGUAGE, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVELANG, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVECOUNTRY, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_ACP, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_OEMCP, LVSCW_AUTOSIZE_USEHEADER);

            // Find user's current locale and select that item in the listview control.
            lcid = GetUserDefaultLCID();

            // Our list has all the LCIDs in 4 digits (0409) whereas GetUserDefaultLCID returs (409).
            if (lcid < 0x1000)
            {
                _sntprintf(g_tcsTemp,MAX_STR,TEXT("0%x"), lcid);
            }
            else
            {
                _sntprintf(g_tcsTemp,MAX_STR,TEXT("%x"), lcid);
            }

            lvInfo.flags = LVFI_STRING;
            lvInfo.psz = g_tcsTemp;

            iItem = ListView_FindItem(g_hwndList, 0, &lvInfo);
            ListView_SetItemState (g_hwndList, iItem, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
            ListView_EnsureVisible(g_hwndList, iItem, FALSE);

            // Set some of the extended styles of our list view (cool reports ;-)
            ListView_SetExtendedListViewStyle(g_hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_GRIDLINES | LVS_EX_TWOCLICKACTIVATE);
        }
        break;

        case WM_NOTIFY:
            switch (((NMHDR *)lParam)->code)
            {
                case LVN_COLUMNCLICK:
                    {
                        NM_LISTVIEW nmv;
                        static int iLastSort = COLUMN_LANGID;
                        LPARAM lSortParam = -1;
                        LVFINDINFO lvInfo;
                        int         iItem;

                        // When a column is clicked we need to redo our sorting of preview table.

                        nmv = *(const NM_LISTVIEW *) lParam;

                        // We don't sort for native language and native country name (avoid confusion).
                        if ((nmv.iSubItem == COLUMN_NATIVELANG) || (nmv.iSubItem == COLUMN_NATIVECOUNTRY))
                        {
                            break;
                        }

                        // If our last sorting was on a different column, we need to do more
                        // than simply reverting our sorting.
                        // Because of listview sorting limitations, we need to redo our list...
                        if (iLastSort != nmv.iSubItem)
                        {
                            // The list view sorting is based on a q-sort, we need to redo our list!
                            ListView_DeleteAllItems(g_hwndList);
                            g_iCounter  = 0;
                            EnumSystemLocales(EnumLocalesProc, LCID_SUPPORTED);

                            // Make sure the last selection remains active after sorting...
                            if (g_iCurLocale < 0x1000)
                            {
                                _sntprintf(g_tcsTemp,MAX_STR,TEXT("0%x"), g_iCurLocale);
                            }
                            else
                            {
                                _sntprintf(g_tcsTemp,MAX_STR,TEXT("%x"), g_iCurLocale);
                            }

                            lvInfo.flags = LVFI_STRING;
                            lvInfo.psz = g_tcsTemp;
                            iItem = ListView_FindItem(g_hwndList, 0, &lvInfo);
                            ListView_SetItemState (g_hwndList, iItem, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);

                            // Update our flag for the last column sorted and set the sorting flag
                            iLastSort = nmv.iSubItem;
                            lSortParam = iLastSort;
                        }

                        // Do the actual sorting...
                        ListView_SortItems(g_hwndList, (PFNLVCOMPARE)CompareFunc, lSortParam);

                        // Make sure our selection is visible after the sorting!
                        ListView_EnsureVisible(g_hwndList, ListView_GetSelectionMark(g_hwndList), FALSE);
                    }
                    break;

                case LVN_ITEMCHANGED:   /* fall-through */
                case LVN_ITEMACTIVATE:
                    {
                        LPNM_LISTVIEW lpnmlv = (LPNM_LISTVIEW)lParam;
                        static    int iItem;
                        LVITEM    lvItem = {0};

                        // Item selection has been changed.
                        // Find the new langId and update our formatting fields...
                        if (iItem != lpnmlv->iItem)
                        {
                            iItem = lpnmlv->iItem;

                            lvItem.mask = LVIF_TEXT;
                            lvItem.iItem = iItem;
                            lvItem.pszText = g_tcsTemp;
                            lvItem.cchTextMax  = STR_LEN;
                            ListView_GetItem(g_hwndList, &lvItem);
                            g_iCurLocale = iConvertStrToInt(lvItem.pszText);
                            InitNLSFields(hDlg, g_iCurLocale);
                        }

                        // Show advanced data on the selected locale...
                        if (((NMHDR *)lParam)->code == LVN_ITEMACTIVATE)
                        {
                           bProcessedMsg = (DialogBox(g_hRes, MAKEINTRESOURCE(DLG_LCID), hDlg, LcidDlgProc) != -1);
                        }
                    }
                    break;
                }
                break;

                case WM_COMMAND:
                    switch(LOWORD(wParam))
                    {
                        case IDCANCEL: /* fall-through*/
                        case IDOK:
                            break;

                        case IDC_TIMEFORMAT:
                            {
                                if(HIWORD(wParam) == CBN_SELCHANGE)
                                {
                                    // Time formating selection has been changed.
                                    // Re-edit time
                                    HWND    hList = NULL;
                                    LRESULT index = 0;
                                    TCHAR    tcTemp[MAX_STR];

                                    hList = GetDlgItem(hDlg, IDC_TIMEFORMAT);

                                    if(NULL == hList)
                                    {
                                        bProcessedMsg = FALSE;
                                        break;
                                    }

                                    index = SendMessage(hList, CB_GETCURSEL, 0, 0);
                                    SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
                                    GetTimeFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
                                    SetWindowText(GetDlgItem(hDlg, IDC_TIMESAMPLE), tcTemp);
                                }
                            }
                            break;

                        case IDC_SDATEFORMAT:
                            {
                                if(HIWORD(wParam) == CBN_SELCHANGE)
                                {
                                    // short date formating selection has been changed.
                                    // Re-edit short date
                                    HWND    hList = NULL;
                                    LRESULT index = 0;
                                    TCHAR    tcTemp[MAX_STR];

                                    hList = GetDlgItem(hDlg, IDC_SDATEFORMAT);

                                    if(NULL == hList)
                                    {
                                        bProcessedMsg = FALSE;
                                        break;
                                    }
                                    index = SendMessage(hList, CB_GETCURSEL, 0, 0);
                                    SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
                                    GetDateFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
                                    SetWindowText(GetDlgItem(hDlg, IDC_SDATESAMPLE), tcTemp);
                                }
                            }
                            break;

                        case IDC_LDATEFORMAT:
                            {
                                if(HIWORD(wParam) == CBN_SELCHANGE)
                                {
                                    // long date formating selection has been changed.
                                    // Re-edit long date
                                    HWND    hList = NULL;
                                    LRESULT index = 0;
                                    TCHAR    tcTemp[MAX_STR];

                                    hList = GetDlgItem(hDlg, IDC_LDATEFORMAT);

                                    if(NULL == hList)
                                    {
                                        bProcessedMsg = FALSE;
                                        break;
                                    }

                                    index = SendMessage(hList, CB_GETCURSEL, 0, 0);
                                    SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
                                    GetDateFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
                                    SetWindowText(GetDlgItem(hDlg, IDC_LDATESAMPLE), tcTemp);
                                }
                            }
                            break;
                    }
                    break;

        default:
            bProcessedMsg = FALSE;
    }

    return bProcessedMsg;
}

Variable Documentation

HWND g_hDlg

Definition at line 65 of file nlsapi.c.

HWND g_hwndList

Definition at line 64 of file nlsapi.c.

int g_iCounter = 0

Definition at line 67 of file nlsapi.c.

int g_iCurLocale

Definition at line 66 of file nlsapi.c.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/res.h File Reference

  • WinUI
  • GlobalDev
  • globaldev
Defines

res.h File Reference

Go to the source code of this file.

Defines

#define | DLG_FONT 102
#define | DLG_GENERAL 104
#define | DLG_LCID 107
#define | DLG_MIRRORING 104
#define | DLG_MUI 105
#define | DLG_NLS 101
#define | DLG_TEXT 106
#define | DLG_USP 103
#define | IDB_ALIGN 1022
#define | IDB_BITMAP1 108
#define | IDB_CLEAR 1019
#define | IDB_FONT 1020
#define | IDB_READING 1021
#define | IDC_ACP 1021
#define | IDC_CALFORMAT 1020
#define | IDC_EDITWIN 1018
#define | IDC_GLOBALDEV 1033
#define | IDC_LANGNAME 1018
#define | IDC_LANGUAGES 1020
#define | IDC_LDATEFORMAT 1019
#define | IDC_LDATESAMPLE 1018
#define | IDC_LV_LCID 1005
#define | IDC_MUIWEB 1032
#define | IDC_MUIWEB2 1033
#define | IDC_MULTILINGUAL 1036
#define | IDC_NCOUNTRYNAME 1020
#define | IDC_NEG_CURRENCY 1012
#define | IDC_NEG_NUMBER 1010
#define | IDC_NLANGNAME 1019
#define | IDC_NLSWEB 1086
#define | IDC_OEM 1022
#define | IDC_POS_CURRENCY 1011
#define | IDC_POS_NUMBER 1009
#define | IDC_PURPOSE 1044
#define | IDC_SDATEFORMAT 1017
#define | IDC_SDATESAMPLE 1016
#define | IDC_TIMEFORMAT 1015
#define | IDC_TIMESAMPLE 1013
#define | IDS_GLOBALDEV 10
#define | IDS_MUIWEB 9
#define | IDS_MULTILINGUAL 11
#define | IDS_NLSWEB 8
#define | IDS_RESTART 7
#define | STR_ACP 5
#define | STR_LANG 2
#define | STR_LANGID 1
#define | STR_NCOUNTRY 4
#define | STR_NLANG 3
#define | STR_OEMCP 6

Define Documentation

#define DLG_FONT 102

Definition at line 16 of file res.h.

#define DLG_GENERAL 104

Definition at line 19 of file res.h.

#define DLG_LCID 107

Definition at line 22 of file res.h.

#define DLG_MIRRORING 104

Definition at line 18 of file res.h.

#define DLG_MUI 105

Definition at line 20 of file res.h.

#define DLG_NLS 101

Definition at line 15 of file res.h.

#define DLG_TEXT 106

Definition at line 21 of file res.h.

#define DLG_USP 103

Definition at line 17 of file res.h.

#define IDB_ALIGN 1022

Definition at line 46 of file res.h.

#define IDB_BITMAP1 108

Definition at line 23 of file res.h.

#define IDB_CLEAR 1019

Definition at line 38 of file res.h.

#define IDB_FONT 1020

Definition at line 41 of file res.h.

#define IDB_READING 1021

Definition at line 44 of file res.h.

#define IDC_ACP 1021

Definition at line 43 of file res.h.

#define IDC_CALFORMAT 1020

Definition at line 39 of file res.h.

#define IDC_EDITWIN 1018

Definition at line 35 of file res.h.

#define IDC_GLOBALDEV 1033

Definition at line 48 of file res.h.

#define IDC_LANGNAME 1018

Definition at line 34 of file res.h.

#define IDC_LANGUAGES 1020

Definition at line 42 of file res.h.

#define IDC_LDATEFORMAT 1019

Definition at line 36 of file res.h.

#define IDC_LDATESAMPLE 1018

Definition at line 33 of file res.h.

#define IDC_LV_LCID 1005

Definition at line 24 of file res.h.

#define IDC_MUIWEB 1032

Definition at line 47 of file res.h.

#define IDC_MUIWEB2 1033

Definition at line 49 of file res.h.

#define IDC_MULTILINGUAL 1036

Definition at line 50 of file res.h.

#define IDC_NCOUNTRYNAME 1020

Definition at line 40 of file res.h.

#define IDC_NEG_CURRENCY 1012

Definition at line 28 of file res.h.

#define IDC_NEG_NUMBER 1010

Definition at line 26 of file res.h.

#define IDC_NLANGNAME 1019

Definition at line 37 of file res.h.

#define IDC_NLSWEB 1086

Definition at line 52 of file res.h.

#define IDC_OEM 1022

Definition at line 45 of file res.h.

#define IDC_POS_CURRENCY 1011

Definition at line 27 of file res.h.

#define IDC_POS_NUMBER 1009

Definition at line 25 of file res.h.

#define IDC_PURPOSE 1044

Definition at line 51 of file res.h.

#define IDC_SDATEFORMAT 1017

Definition at line 32 of file res.h.

#define IDC_SDATESAMPLE 1016

Definition at line 31 of file res.h.

#define IDC_TIMEFORMAT 1015

Definition at line 30 of file res.h.

#define IDC_TIMESAMPLE 1013

Definition at line 29 of file res.h.

#define IDS_GLOBALDEV 10

Definition at line 13 of file res.h.

#define IDS_MUIWEB 9

Definition at line 12 of file res.h.

#define IDS_MULTILINGUAL 11

Definition at line 14 of file res.h.

#define IDS_NLSWEB 8

Definition at line 11 of file res.h.

#define IDS_RESTART 7

Definition at line 10 of file res.h.

#define STR_ACP 5

Definition at line 8 of file res.h.

#define STR_LANG 2

Definition at line 5 of file res.h.

#define STR_LANGID 1

Definition at line 4 of file res.h.

#define STR_NCOUNTRY 4

Definition at line 7 of file res.h.

#define STR_NLANG 3

Definition at line 6 of file res.h.

#define STR_OEMCP 6

Definition at line 9 of file res.h.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/resource.h File Reference

  • WinUI
  • GlobalDev
  • globaldev
Defines

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDI_MAINICON 101
#define | STR_APPTITLE 2
#define | STR_LARGENEGNUMBER 5
#define | STR_LARGEPOSNUMBER 4
#define | STR_NEGCURRENCY 7
#define | STR_POSCURRENCY 6
#define | STR_RESDLL_NOTFOUND 1
#define | STR_TITLE 3

Define Documentation

#define IDI_MAINICON 101

Definition at line 11 of file resource.h.

#define STR_APPTITLE 2

Definition at line 5 of file resource.h.

#define STR_LARGENEGNUMBER 5

Definition at line 8 of file resource.h.

#define STR_LARGEPOSNUMBER 4

Definition at line 7 of file resource.h.

#define STR_NEGCURRENCY 7

Definition at line 10 of file resource.h.

#define STR_POSCURRENCY 6

Definition at line 9 of file resource.h.

#define STR_RESDLL_NOTFOUND 1

Definition at line 4 of file resource.h.

#define STR_TITLE 3

Definition at line 6 of file resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/textapi.c File Reference

  • WinUI
  • GlobalDev
  • globaldev
Functions

textapi.c File Reference

#include "global.h"

Go to the source code of this file.

Functions

void | InitializeFont (HWND, LPTSTR, LONG, LPCHOOSEFONT, LPLOGFONT)
INT_PTR CALLBACK | TextDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Function Documentation

void InitializeFont | ( | HWND | hWnd,
 |  | LPTSTR | szFaceName,
 |  | LONG | lHeight,
 |  | LPCHOOSEFONT | lpCf,
 |  | LPLOGFONT | lpLf
 | ) |  |

Definition at line 177 of file textapi.c.

{
    lpCf->lStructSize   = sizeof(CHOOSEFONT) ;
    lpCf->hwndOwner     = hWnd ;
    lpCf->hDC           = NULL ;
    lpCf->lpLogFont     = lpLf ;
    lpCf->iPointSize    = 10;
    lpCf->Flags         = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_NOSIZESEL ;
    lpCf->rgbColors     = RGB(0,0,0);
    lpCf->lCustData     = 0;
    lpCf->lpfnHook      = NULL;
    lpCf->lpTemplateName= NULL;
    lpCf->hInstance     = g_hInst;
    lpCf->lpszStyle     = NULL;
    lpCf->nFontType     = SIMULATED_FONTTYPE;
    lpCf->nSizeMin      = 0;
    lpCf->nSizeMax      = 0;

    lpLf->lfHeight      = lHeight ;
    lpLf->lfWidth       = 0 ;
    lpLf->lfEscapement  = 0 ;
    lpLf->lfOrientation = 0 ;
    lpLf->lfWeight      = FW_DONTCARE ;
    lpLf->lfItalic      = FALSE ;
    lpLf->lfUnderline   = FALSE ;
    lpLf->lfStrikeOut   = FALSE ;
    lpLf->lfCharSet     = DEFAULT_CHARSET ;
    lpLf->lfOutPrecision= OUT_DEFAULT_PRECIS ;
    lpLf->lfClipPrecision = CLIP_DEFAULT_PRECIS ;
    lpLf->lfQuality     = DEFAULT_QUALITY ;
    lpLf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE ;
    _tcsncpy(lpLf->lfFaceName, szFaceName,min(_tcslen(lpLf->lfFaceName),_tcslen(szFaceName)));
}

INT_PTR CALLBACK TextDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 57 of file textapi.c.

{
    LONG        lAlign = 0;
    HFONT       hEditFont = NULL;
    HWND        hWndEdit = NULL;
    static      CHOOSEFONT cf;
    static      LOGFONT lf;
    INT_PTR     iProcessedMsg   = 1;

    switch(uMsg)
    {
        case WM_INITDIALOG:
            {
                // Fill out a font structure that will be used in a call for CreateFont.
                InitializeFont(hDlg, DEFAULT_FONT, 24, &cf, &lf);

                hEditFont = CreateFontIndirect(&lf) ;
                if(NULL == hEditFont)
                {
                    iProcessedMsg = 0;
                    break;
                }
                // Set font of edit control
                SendDlgItemMessage(hDlg, IDC_EDITWIN, WM_SETFONT, (WPARAM) hEditFont,  MAKELPARAM(TRUE, 0)) ;
            }
            break;

        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                // Erase our text control by setting the content to NULL.
                case IDB_CLEAR:
                    {
                        hWndEdit = GetDlgItem (hDlg, IDC_EDITWIN);
                        if(NULL == hWndEdit)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        SetWindowText(hWndEdit, TEXT(""));
                    }
                    break;

                // Provide a font selection mechanism through the system's font selection
                // common dialog.
                case IDB_FONT:
                    {
                        DeleteFontObject(hDlg, hEditFont, IDC_EDITWIN);

                        if(FALSE == ChooseFont(&cf))
                        {
                            iProcessedMsg = 0;
                            break;
                        }

                        hEditFont = CreateFontIndirect(&lf);
                        if(NULL == hEditFont)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        SendDlgItemMessage (hDlg, IDC_EDITWIN, WM_SETFONT, (WPARAM) hEditFont,  MAKELPARAM(TRUE, 0));
                    }
                    break;

                // Toggles the reading order of the text.
                case IDB_READING:
                    {
                        hWndEdit = GetDlgItem(hDlg, IDC_EDITWIN);
                        if(NULL == hWndEdit)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        lAlign   = GetWindowLong(hWndEdit, GWL_EXSTYLE) ^ WS_EX_RTLREADING;
                        SetWindowLong(hWndEdit, GWL_EXSTYLE, lAlign);
                        InvalidateRect(hWndEdit ,NULL, TRUE);
                    }
                    break;

                // Toggles the text alignment.
                case IDB_ALIGN:
                    {
                        hWndEdit = GetDlgItem(hDlg, IDC_EDITWIN);
                        if(NULL == hWndEdit)
                        {
                            iProcessedMsg = 0;
                            break;
                        }
                        lAlign   = GetWindowLong(hWndEdit, GWL_EXSTYLE) ^ WS_EX_RIGHT;
                        SetWindowLong(hWndEdit, GWL_EXSTYLE, lAlign);
                        InvalidateRect(hWndEdit ,NULL, TRUE);
                    }
                    break;

                case IDCANCEL: /* fall-through*/
                case IDOK:
                    {
                        DeleteFontObject(hDlg, hEditFont, IDC_EDITWIN);
                    }
                    break;
            }
         break;

        default:
            iProcessedMsg = 0;
            break;
    }
    return iProcessedMsg;
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/gres409/gres409.c File Reference

  • WinUI
  • GlobalDev
  • globaldev
  • gres409
Functions

gres409.c File Reference

#include <windows.h>

Go to the source code of this file.

Functions

BOOL WINAPI DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)

Function Documentation

BOOL WINAPI DllMain | ( | HANDLE | hModule,
 |  | DWORD | ul_reason_for_call,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 6 of file gres409.c.

{
    return TRUE;
}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/gres409/resource.h File Reference

  • WinUI
  • GlobalDev
  • globaldev
  • gres409
Defines

resource.h File Reference

Go to the source code of this file.

Defines

#define | DLG_FONT 102
#define | DLG_GENERAL 104
#define | DLG_LCID 107
#define | DLG_MIRRORING 104
#define | DLG_MUI 105
#define | DLG_NLS 101
#define | DLG_TEXT 106
#define | DLG_USP 103
#define | IDB_ALIGN 1022
#define | IDB_BITMAP1 108
#define | IDB_CLEAR 1019
#define | IDB_FONT 1020
#define | IDB_READING 1021
#define | IDC_ACP 1021
#define | IDC_CALFORMAT 1020
#define | IDC_EDITWIN 1018
#define | IDC_LANGNAME 1018
#define | IDC_LANGUAGES 1020
#define | IDC_LDATEFORMAT 1019
#define | IDC_LDATESAMPLE 1018
#define | IDC_LV_LCID 1005
#define | IDC_NCOUNTRYNAME 1020
#define | IDC_NEG_CURRENCY 1012
#define | IDC_NEG_NUMBER 1010
#define | IDC_NLANGNAME 1019
#define | IDC_OEM 1022
#define | IDC_POS_CURRENCY 1011
#define | IDC_POS_NUMBER 1009
#define | IDC_PURPOSE 1044
#define | IDC_SDATEFORMAT 1017
#define | IDC_SDATESAMPLE 1016
#define | IDC_TIMEFORMAT 1015
#define | IDC_TIMESAMPLE 1013
#define | IDS_GLOBALDEV 10
#define | IDS_MUIWEB 9
#define | IDS_MULTILINGUAL 11
#define | IDS_NLSWEB 8
#define | IDS_RESTART 7
#define | STR_ACP 5
#define | STR_LANG 2
#define | STR_LANGID 1
#define | STR_NCOUNTRY 4
#define | STR_NLANG 3
#define | STR_OEMCP 6

Define Documentation

#define DLG_FONT 102

Definition at line 17 of file resource.h.

#define DLG_GENERAL 104

Definition at line 20 of file resource.h.

#define DLG_LCID 107

Definition at line 23 of file resource.h.

#define DLG_MIRRORING 104

Definition at line 19 of file resource.h.

#define DLG_MUI 105

Definition at line 21 of file resource.h.

#define DLG_NLS 101

Definition at line 16 of file resource.h.

#define DLG_TEXT 106

Definition at line 22 of file resource.h.

#define DLG_USP 103

Definition at line 18 of file resource.h.

#define IDB_ALIGN 1022

Definition at line 47 of file resource.h.

#define IDB_BITMAP1 108

Definition at line 24 of file resource.h.

#define IDB_CLEAR 1019

Definition at line 39 of file resource.h.

#define IDB_FONT 1020

Definition at line 42 of file resource.h.

#define IDB_READING 1021

Definition at line 45 of file resource.h.

#define IDC_ACP 1021

Definition at line 44 of file resource.h.

#define IDC_CALFORMAT 1020

Definition at line 40 of file resource.h.

#define IDC_EDITWIN 1018

Definition at line 36 of file resource.h.

#define IDC_LANGNAME 1018

Definition at line 35 of file resource.h.

#define IDC_LANGUAGES 1020

Definition at line 43 of file resource.h.

#define IDC_LDATEFORMAT 1019

Definition at line 37 of file resource.h.

#define IDC_LDATESAMPLE 1018

Definition at line 34 of file resource.h.

#define IDC_LV_LCID 1005

Definition at line 25 of file resource.h.

#define IDC_NCOUNTRYNAME 1020

Definition at line 41 of file resource.h.

#define IDC_NEG_CURRENCY 1012

Definition at line 29 of file resource.h.

#define IDC_NEG_NUMBER 1010

Definition at line 27 of file resource.h.

#define IDC_NLANGNAME 1019

Definition at line 38 of file resource.h.

#define IDC_OEM 1022

Definition at line 46 of file resource.h.

#define IDC_POS_CURRENCY 1011

Definition at line 28 of file resource.h.

#define IDC_POS_NUMBER 1009

Definition at line 26 of file resource.h.

#define IDC_PURPOSE 1044

Definition at line 48 of file resource.h.

#define IDC_SDATEFORMAT 1017

Definition at line 33 of file resource.h.

#define IDC_SDATESAMPLE 1016

Definition at line 32 of file resource.h.

#define IDC_TIMEFORMAT 1015

Definition at line 31 of file resource.h.

#define IDC_TIMESAMPLE 1013

Definition at line 30 of file resource.h.

#define IDS_GLOBALDEV 10

Definition at line 14 of file resource.h.

#define IDS_MUIWEB 9

Definition at line 13 of file resource.h.

#define IDS_MULTILINGUAL 11

Definition at line 15 of file resource.h.

#define IDS_NLSWEB 8

Definition at line 12 of file resource.h.

#define IDS_RESTART 7

Definition at line 11 of file resource.h.

#define STR_ACP 5

Definition at line 9 of file resource.h.

#define STR_LANG 2

Definition at line 6 of file resource.h.

#define STR_LANGID 1

Definition at line 5 of file resource.h.

#define STR_NCOUNTRY 4

Definition at line 8 of file resource.h.

#define STR_NLANG 3

Definition at line 7 of file resource.h.

#define STR_OEMCP 6

Definition at line 10 of file resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/CANDUI.C File Reference

  • WinUI
  • Input
  • Ime
  • FullIME
Functions

CANDUI.C File Reference

#include <assert.h>
#include <windows.h>
#include <imm.h>
#include "FullIME.h"

Go to the source code of this file.

Functions

void | CandUIPaint (HWND hwnd)
int WINAPI | CandWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void | DisplayCandStrings (HWND hwnd, LPCANDIDATELIST lpCandList)

Function Documentation

void CandUIPaint ( HWND hwnd )

Definition at line 151 of file CANDUI.C.

{
    int             index;
    LPCANDIDATELIST lpCandList;
    HDC             hdc;
    PAINTSTRUCT     ps;

    hdc = BeginPaint( hwnd, &ps );

    //
    // Determine which candidate window needs to repaint.
    //

    for ( index = 0; index < MAX_LISTCAND; index ++ )
        if ( gImeUIData.hListCand[ index ] == hwnd )
            break;

    //
    // If index == MAX_LISTCAND, then something wrong, do nothing.
    //

    if ( index == MAX_LISTCAND )
        goto exit;

    if ( !gImeUIData.hListCandMem[ index ] ||
         (lpCandList = (LPCANDIDATELIST)
              GlobalLock( gImeUIData.hListCandMem[ index ] ) ) == NULL )
    {
        goto exit;
    }

    DisplayCandStrings( hwnd, lpCandList );

    GlobalUnlock( gImeUIData.hListCandMem[ index ] );

exit:

    EndPaint( hwnd, &ps );

}

int WINAPI CandWndProc | ( | HWND | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 13 of file CANDUI.C.

{

    switch( msg )
    {

        case WM_PAINT:

            CandUIPaint( hwnd );
            break;

        default:

            return (int) DefWindowProc( hwnd, msg, wParam, lParam );
    }

    return 0;
}

void DisplayCandStrings | ( | HWND | hwnd,
 |  | LPCANDIDATELIST | lpCandList
 | ) |  |

Definition at line 44 of file CANDUI.C.

{

    HDC         hdc;            // Storage for device context handle.
    LPSTR       lpStr;          // Storage for LP to a string.
    DWORD       dwNumPerPage;   // Storage for num per page
    DWORD       dwStartIndex;   // Storage for candidate index
    DWORD       dwEndIndex;     // Storage for candidate index
    RECT        rect;           // Storage for client rect.
    int         y = 0;          //
    DWORD       dwBackColor;    // Storage for background color value
    DWORD       dwTextColor;

    //
    // Determine how many candidate strings per page.
    //

    dwNumPerPage = ( !lpCandList->dwPageSize ) ?
                     DEFAULT_CAND_NUM_PER_PAGE :
                     lpCandList->dwPageSize;

    //
    // Determine the dwStartIndex from which the candidate string will
    // start displaying.
    //

    dwStartIndex = lpCandList->dwPageStart;

    //
    // Determine the dwEndIndex which indicate the last candidate string
    // will be displayed.
    //

    dwEndIndex = dwStartIndex + dwNumPerPage;

    dwEndIndex = ( dwEndIndex >= lpCandList->dwCount ) ?
                 lpCandList->dwCount : dwEndIndex;

    //
    // Dissplay candidate strings.
    // First paint background color.
    //

    hdc = GetDC( hwnd );

    dwBackColor = SetBkColor( hdc, RGB( 0xbf, 0xbf, 0xbf ) );

    GetClientRect( hwnd, &rect );

    ExtTextOut( hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, 0 );

    //
    // Set background color of selected candidate string to be blue.
    //

    rect.top = rect.top +
               ( lpCandList->dwSelection - dwStartIndex ) * cyMetrics;

    rect.bottom = rect.top + cyMetrics;

    SetBkColor( hdc,RGB( 0x00, 0x00, 0xff ) );

    ExtTextOut( hdc, 0, rect.top, ETO_OPAQUE, &rect, NULL, 0, 0 );

    //
    // Display candidate strings.
    //

    SetBkMode( hdc, TRANSPARENT );

    dwTextColor = GetTextColor( hdc );

    for ( ; dwStartIndex < dwEndIndex; dwStartIndex++, y++ )
    {

        lpStr = (LPSTR) lpCandList +
                lpCandList->dwOffset[ dwStartIndex ];

        if ( dwStartIndex == lpCandList->dwSelection )
            SetTextColor( hdc, RGB( 255, 255, 255 ) );
        else
            SetTextColor( hdc, dwTextColor );

        TextOut( hdc, 3, y * cyMetrics, lpStr, lstrlen( lpStr ) );
    }

    SetTextColor( hdc, dwTextColor );

    SetBkColor( hdc, dwBackColor );

    ReleaseDC( hwnd, hdc );

}

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/FullIME.h File Reference

  • WinUI
  • Input
  • Ime
  • FullIME
Classes | Defines | Typedefs | Functions | Variables

FullIME.h File Reference

Go to the source code of this file.

Classes

struct | _IMEUIDATA

Defines

#define | CheckProperty
#define | DEFAULT_CAND_NUM_PER_PAGE 5
#define | FIRSTCOL 0
#define | FIRSTROW 0
#define | ID_ICON 1
#define | ID_MENU 1
#define | IDC_ANSIFILL 42
#define | IDC_CLEAR 41
#define | IDC_CLOSEIME 45
#define | IDC_DBCSFILL 43
#define | IDC_LIST1 0
#define | IDC_LIST32 31
#define | IDC_OPENIME 44
#define | IDS_CANDCLASS 6
#define | IDS_CANDTITLE 5
#define | IDS_CANDUI 3
#define | IDS_CLASS 1
#define | IDS_COMPTITLE 4
#define | IDS_TITLE 2
#define | IME_IN_CHOSECAND 2
#define | IME_IN_COMPOSITION 1
#define | LASTCOL (MAXCOL-1)
#define | LASTROW (MAXROW-1)
#define | MAX_CHARS_PER_LINE 10
#define | MAX_COMP_STRING_LEN 10
#define | MAX_LISTCAND 32
#define | MAXCOL 60
#define | MAXROW 12
#define | TABSTOP 4
#define | X_INDENT 10
#define | Y_INDENT 10

Typedefs

typedef struct _IMEUIDATA | IMEUIDATA

Functions

void | CandUIPaint (HWND)
int WINAPI | CandWndProc (HWND hwnd, UINT, WPARAM, LPARAM)
void | DisplayCandStrings (HWND, LPCANDIDATELIST)
void | DisplayCompString (HWND, LPSTR, LPSTR)
void | DisplayResultString (HWND, LPSTR)
void | GetCompositionStr (HWND, LPARAM)
void | GetResultStr (HWND)
void | ImeUIChangeCandidate (HWND, LPARAM)
void | ImeUIClearData (HWND)
void | ImeUICloseCandidate (HWND, LPARAM)
void | ImeUIComposition (HWND, WPARAM, LPARAM)
void | ImeUIEndComposition (HWND)
void | ImeUIMoveCandWin (HWND)
BOOL | ImeUINotify (HWND, WPARAM, LPARAM)
void | ImeUIOpenCandidate (HWND, LPARAM)
void | ImeUISetOpenStatus (HWND)
void | ImeUIStartComposition (HWND)
BOOL | MoveCaret (HWND)
void | ResetCaret (HWND)
void | RestoreImeUI (HWND)
void | SetIMECompFormPos (HWND)
int WINAPI | SteWndProc (HWND, UINT, UINT, LONG)

Variables

int | CaretWidth
UINT cxMetrics
UINT cxOverTypeCaret
UINT cyMetrics
int | DBCSFillChar
BOOL fInsertMode
IMEUIDATA gImeUIData
HKL | hCurKL
HFONT | hfntFixed
HFONT | hfntOld
char | szCandClass []
char | szSteCandTitle []
char | szSteCandUIClass []
char | szSteClass []
char | szSteCompTitle []
char | szSteTitle []
BYTE | textbuf [MAXROW][MAXCOL]
int | xPos
int | yPos

Define Documentation

#define CheckProperty
Value:
{       \
    if ( ( gImeUIData.fdwProperty & IME_PROP_SPECIAL_UI ) ||  \
   !( gImeUIData.fdwProperty & IME_PROP_AT_CARET ) )  \
  goto call_defwinproc;         \
}

Definition at line 36 of file FullIME.h.

#define DEFAULT_CAND_NUM_PER_PAGE 5

Definition at line 11 of file FullIME.h.

#define FIRSTCOL 0

Definition at line 4 of file FullIME.h.

#define FIRSTROW 0

Definition at line 3 of file FullIME.h.

#define ID_ICON 1

Definition at line 15 of file FullIME.h.

#define ID_MENU 1

Definition at line 16 of file FullIME.h.

#define IDC_ANSIFILL 42

Definition at line 28 of file FullIME.h.

#define IDC_CLEAR 41

Definition at line 27 of file FullIME.h.

#define IDC_CLOSEIME 45

Definition at line 31 of file FullIME.h.

#define IDC_DBCSFILL 43

Definition at line 29 of file FullIME.h.

#define IDC_LIST1 0

Definition at line 24 of file FullIME.h.

#define IDC_LIST32 31

Definition at line 25 of file FullIME.h.

#define IDC_OPENIME 44

Definition at line 30 of file FullIME.h.

#define IDS_CANDCLASS 6

Definition at line 22 of file FullIME.h.

#define IDS_CANDTITLE 5

Definition at line 21 of file FullIME.h.

#define IDS_CANDUI 3

Definition at line 19 of file FullIME.h.

#define IDS_CLASS 1

Definition at line 17 of file FullIME.h.

#define IDS_COMPTITLE 4

Definition at line 20 of file FullIME.h.

#define IDS_TITLE 2

Definition at line 18 of file FullIME.h.

#define IME_IN_CHOSECAND 2

Definition at line 34 of file FullIME.h.

#define IME_IN_COMPOSITION 1

Definition at line 33 of file FullIME.h.

#define LASTCOL (MAXCOL-1)

Definition at line 6 of file FullIME.h.

#define LASTROW (MAXROW-1)

Definition at line 5 of file FullIME.h.

#define MAX_CHARS_PER_LINE 10

Definition at line 9 of file FullIME.h.

#define MAX_COMP_STRING_LEN 10

Definition at line 10 of file FullIME.h.

#define MAX_LISTCAND 32

Definition at line 8 of file FullIME.h.

#define MAXCOL 60

Definition at line 2 of file FullIME.h.

#define MAXROW 12

Definition at line 1 of file FullIME.h.

#define TABSTOP 4

Definition at line 7 of file FullIME.h.

#define X_INDENT 10

Definition at line 12 of file FullIME.h.

#define Y_INDENT 10

Definition at line 13 of file FullIME.h.

Typedef Documentation

typedef struct _IMEUIDATA IMEUIDATA

Function Documentation

void CandUIPaint ( HWND )

Definition at line 151 of file CANDUI.C.

{
    int             index;
    LPCANDIDATELIST lpCandList;
    HDC             hdc;
    PAINTSTRUCT     ps;

    hdc = BeginPaint( hwnd, &ps );

    //
    // Determine which candidate window needs to repaint.
    //

    for ( index = 0; index < MAX_LISTCAND; index ++ )
        if ( gImeUIData.hListCand[ index ] == hwnd )
            break;

    //
    // If index == MAX_LISTCAND, then something wrong, do nothing.
    //

    if ( index == MAX_LISTCAND )
        goto exit;

    if ( !gImeUIData.hListCandMem[ index ] ||
         (lpCandList = (LPCANDIDATELIST)
              GlobalLock( gImeUIData.hListCandMem[ index ] ) ) == NULL )
    {
        goto exit;
    }

    DisplayCandStrings( hwnd, lpCandList );

    GlobalUnlock( gImeUIData.hListCandMem[ index ] );

exit:

    EndPaint( hwnd, &ps );

}

int WINAPI CandWndProc | ( | HWND | hwnd,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 13 of file CANDUI.C.

{

    switch( msg )
    {

        case WM_PAINT:

            CandUIPaint( hwnd );
            break;

        default:

            return (int) DefWindowProc( hwnd, msg, wParam, lParam );
    }

    return 0;
}

void DisplayCandStrings | ( | HWND | ,
 |  | LPCANDIDATELIST |
 | ) |  |

Definition at line 44 of file CANDUI.C.

{

    HDC         hdc;            // Storage for device context handle.
    LPSTR       lpStr;          // Storage for LP to a string.
    DWORD       dwNumPerPage;   // Storage for num per page
    DWORD       dwStartIndex;   // Storage for candidate index
    DWORD       dwEndIndex;     // Storage for candidate index
    RECT        rect;           // Storage for client rect.
    int         y = 0;          //
    DWORD       dwBackColor;    // Storage for background color value
    DWORD       dwTextColor;

    //
    // Determine how many candidate strings per page.
    //

    dwNumPerPage = ( !lpCandList->dwPageSize ) ?
                     DEFAULT_CAND_NUM_PER_PAGE :
                     lpCandList->dwPageSize;

    //
    // Determine the dwStartIndex from which the candidate string will
    // start displaying.
    //

    dwStartIndex = lpCandList->dwPageStart;

    //
    // Determine the dwEndIndex which indicate the last candidate string
    // will be displayed.
    //

    dwEndIndex = dwStartIndex + dwNumPerPage;

    dwEndIndex = ( dwEndIndex >= lpCandList->dwCount ) ?
                 lpCandList->dwCount : dwEndIndex;

    //
    // Dissplay candidate strings.
    // First paint background color.
    //

    hdc = GetDC( hwnd );

    dwBackColor = SetBkColor( hdc, RGB( 0xbf, 0xbf, 0xbf ) );

    GetClientRect( hwnd, &rect );

    ExtTextOut( hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, 0 );

    //
    // Set background color of selected candidate string to be blue.
    //

    rect.top = rect.top +
               ( lpCandList->dwSelection - dwStartIndex ) * cyMetrics;

    rect.bottom = rect.top + cyMetrics;

    SetBkColor( hdc,RGB( 0x00, 0x00, 0xff ) );

    ExtTextOut( hdc, 0, rect.top, ETO_OPAQUE, &rect, NULL, 0, 0 );

    //
    // Display candidate strings.
    //

    SetBkMode( hdc, TRANSPARENT );

    dwTextColor = GetTextColor( hdc );

    for ( ; dwStartIndex < dwEndIndex; dwStartIndex++, y++ )
    {

        lpStr = (LPSTR) lpCandList +
                lpCandList->dwOffset[ dwStartIndex ];

        if ( dwStartIndex == lpCandList->dwSelection )
            SetTextColor( hdc, RGB( 255, 255, 255 ) );
        else
            SetTextColor( hdc, dwTextColor );

        TextOut( hdc, 3, y * cyMetrics, lpStr, lstrlen( lpStr ) );
    }

    SetTextColor( hdc, dwTextColor );

    SetBkColor( hdc, dwBackColor );

    ReleaseDC( hwnd, hdc );

}

void DisplayCompString | ( | HWND | ,
 |  | LPSTR | ,
 |  | LPSTR |
 | ) |  |

Definition at line 815 of file ImeUI.C.

{
    HDC         hdc;
    int         StrLen = lstrlen( lpStr );
    RECT        rect;
    DWORD       dwColor;
    int         i;
    BOOL        fDBCSTrailByte = FALSE;

    hdc = GetDC( hwnd );

    HideCaret( hwnd );

    //
    // Determine OPAQUE rect.
    //

    rect.left = xPos * cxMetrics;
    rect.top  = yPos * cyMetrics;
    rect.bottom = rect.top + cyMetrics;
    rect.right = ( (int)gImeUIData.uCompLen > StrLen ) ?
                 ( xPos + gImeUIData.uCompLen ) * cxMetrics:
                 ( xPos + StrLen ) * cxMetrics;

    //
    // This example we use red to display composition chars
    // with attribute 000, pink for attribute 001,
    // blue for attribute 010, green for attribute 011.
    //

    //
    // Each composition character has different attribute.
    // We here use different kinds of color to represent attributes.
    // Red, pink, blue and green are for attribute 000, 001, 010 and 011,
    // respectively.
    //

    dwColor = GetTextColor( hdc );

    if ( ( StrLen % 2 ) )
    {
        if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
        {
            textbuf[ yPos ][ xPos + StrLen ] = ' ';
            fDBCSTrailByte = TRUE;
        }
    } else
    {
        if ( !IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 2 ] ) )
        {
            if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
      {
                textbuf[ yPos ][ xPos + StrLen ] = ' ';
                fDBCSTrailByte = TRUE;
            }
        }
    }

    if ( !lpStrAttr )
    {
        //
        // If there are not attribute array, here we use default color, RED,
        // to display all of composition characters.
        //

        SetTextColor( hdc, CompColor[ 0 ] ); // default color

        ExtTextOut( hdc, xPos * cxMetrics, yPos * cyMetrics,
                ETO_OPAQUE, &rect, lpStr, StrLen, 0 );

    } else
    {

        int  ColorIndex;

        ExtTextOut( hdc, xPos * cxMetrics, yPos * cyMetrics, ETO_OPAQUE,
                    &rect, NULL, 0, 0 );

        for( i = 0; *lpStr;)
        {
            int cnt = IsDBCSLeadByte(*lpStr) ? 2 : 1;

            ColorIndex = ( ((int)*lpStrAttr) < 0 ) ? 0 : (int)*lpStrAttr;
            ColorIndex = ( ColorIndex > 3 ) ? 3 : ColorIndex;

            SetTextColor( hdc, CompColor[ ColorIndex ] );

            TextOut( hdc, ( i + xPos ) * cxMetrics, yPos * cyMetrics,
                     lpStr, cnt );
            lpStr += cnt;
            lpStrAttr += cnt;
            i += cnt;
        }
    }

    SetTextColor( hdc, dwColor );

    if ( fDBCSTrailByte )
    {
        TextOut( hdc, ( xPos + StrLen ) * cxMetrics, yPos * cyMetrics,
           " ", 1 );
    }

    SetCaretPos( ( xPos + StrLen ) * cxMetrics, yPos * cyMetrics );

    ShowCaret( hwnd );

    ReleaseDC( hwnd, hdc );

}

void DisplayResultString | ( | HWND | ,
 |  | LPSTR |
 | ) |  |

Definition at line 939 of file ImeUI.C.

{

    int         StrLen;         // Storage for string length.
    int         i;              // Loop counter.
    HDC         hdc;            // Display context handle.

    StrLen = lstrlen( lpStr );

    //
    // If there is no room for compsoition string, discard it
    //

    if ( xPos == ( LASTCOL - StrLen - 1 ) )
        return;

    //
    // if insert mode or during composition session,
    // move rest of line to the right by StrLen bytes.
    //

    if ( fInsertMode )
    {

        for( i = LASTCOL; i > xPos; i-- )
            textbuf[ yPos ][ i ] = textbuf[ yPos ][ i - StrLen ];

        //
        // If the row ends on a lead byte, blank it out,
        // To do this we must first traverse the string starting
        // from a know character boundry until we reach the last column.
        // If the last column is a character boundry then the last
        // character is either a string byte or a lead byte.
        //

        for( i = xPos + StrLen; i < LASTCOL; )
        {
            if ( IsDBCSLeadByte( textbuf[ yPos ][ i ] ) )
                i++;
            i++;
        }

        if ( i == LASTCOL && IsDBCSLeadByte( textbuf[ yPos ][ i ] ) )
            textbuf[ yPos ][ LASTCOL ] = ' ';

    }
    else
    {
        //
        // overtype mode
        //

        if ( ( StrLen % 2 ) )
        {
            if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
                textbuf[ yPos ][ xPos + StrLen ] = ' ';
        }
        else
        {
            if ( !IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 2 ] ) )
            {
                //
                // Overtyping the current byte, plus the following byte
                // which could be a lead byte.
                //

                if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
                    textbuf[ yPos ][ xPos + StrLen ] = ' ';
            }
        }
    }

    //
    // Store input character at current caret position.
    //

    for( i = 0; i <= LASTCOL && *lpStr; i++ )
        textbuf[ yPos ][ xPos + i ] = *lpStr++;

    //
    // Display input character
    //

    hdc = GetDC( hwnd );

    HideCaret( hwnd );

    //
    // Displays result string with normal color.
    //

    TextOut( hdc, xPos *cxMetrics, yPos * cyMetrics,
             (LPCSTR)&( textbuf[ yPos][xPos] ), MAXCOL - xPos );

    ShowCaret( hwnd );

    ReleaseDC( hwnd, hdc );

    //
    // Reset Caret position
    //

    xPos += StrLen;

    if ( xPos > LASTCOL )
        xPos = LASTCOL;

    ResetCaret( hwnd );

    gImeUIData.uCompLen = 0;

}

void GetCompositionStr | ( | HWND | ,
 |  | LPARAM |
 | ) |  |

Definition at line 77 of file ImeUI.C.

{
     LONG       bufLen;               // Stogare for len. of composition str
     LPSTR      lpCompStr;              // Pointer to composition str.
     HIMC       hIMC;                   // Input context handle.
     HLOCAL     hMem;                   // Memory handle.
     LPSTR      lpCompStrAttr;          // Pointer to composition str array.
     HLOCAL     hMemAttr = NULL;        // Memory handle for comp. str. array.
     LONG       bufLenAttr;

     //
     // If fail to get input context handle then do nothing.
     // Applications should call ImmGetContext API to get
     // input context handle.
     //

     if ( !( hIMC = ImmGetContext( hwnd ) ) )
         return;

     //
     // Determines how much memory space to store the composition string.
     // Applications should call ImmGetCompositionString with
     // GCS_COMPSTR flag on, buffer length zero, to get the bullfer
     // length.
     //

     bufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR, (void*)NULL, 0l );
     if ( ( IMM_ERROR_NODATA == bufLen) ||
          ( IMM_ERROR_GENERAL == bufLen) )
     {
         goto exit2;
     }

     //
     // Allocates memory with bufLen+1 bytes to store the composition
     // string. Here we allocale on more byte to put null character.
     //

     if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
         goto exit2;

     if ( !( lpCompStr = (LPSTR) LocalLock( hMem ) ) )
         goto exit1;

     //
     // Reads in the composition string.
     //

     ImmGetCompositionString( hIMC, GCS_COMPSTR, lpCompStr, bufLen );

     //
     // Null terminated.
     //

     lpCompStr[ bufLen ] = 0;

     //
     // If GCS_COMPATTR flag is on, then we need to take care of it.
     //

     if ( CompFlag & GCS_COMPATTR )
     {
         bufLenAttr = ImmGetCompositionString( hIMC, GCS_COMPATTR, (void*)NULL, 0l );
         if ( ( IMM_ERROR_NODATA == bufLenAttr) ||
              ( IMM_ERROR_GENERAL == bufLenAttr) )
         {
             goto nothing;
         }

         //
         // Allocate memory to store attributes of composition strings.
         //

         if ( !( hMemAttr = LocalAlloc( LPTR, (int)bufLenAttr + 1 ) ) )
             goto nothing;

         if ( !( lpCompStrAttr = (LPSTR) LocalLock( hMemAttr ) ) )
         {
             LocalFree( hMemAttr );
             goto nothing;
         }

         //
         // Reads in the attribute array.
         //

         ImmGetCompositionString( hIMC, GCS_COMPATTR, lpCompStrAttr,
                                  bufLenAttr );

         lpCompStrAttr[ bufLenAttr ] = 0;

     } else
     {

nothing:
         lpCompStrAttr = NULL;
     }

     //
     // Display new composition chars.
     //

     DisplayCompString( hwnd, lpCompStr, lpCompStrAttr );

     //
     // Keep the length of the composition string for using later.
     //

     gImeUIData.uCompLen = (UINT)bufLen;

     LocalUnlock( hMem );

     if ( lpCompStrAttr )
     {
         if (NULL != hMemAttr)
         {
             LocalUnlock( hMemAttr );
             LocalFree( hMemAttr );
         }
     }

exit1:

     LocalFree( hMem );

exit2:

     ImmReleaseContext( hwnd, hIMC );

}

void GetResultStr ( HWND )

Definition at line 219 of file ImeUI.C.

{
    LONG        bufLen;                 // Storage for length of result str.
    LPSTR       lpResultStr;            // Pointer to result string.
    HIMC        hIMC;                   // Input context handle.
    HLOCAL      hMem;                   // Memory handle.

    //
    // If fail to get input context handle then do nothing.
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // Determines how much memory space to store the result string.
    // Applications should call ImmGetCompositionString with
    // GCS_RESULTSTR flag on, buffer length zero, to get the bullfer
    // length.
    //

    if ( ( bufLen = ImmGetCompositionString( hIMC, GCS_RESULTSTR,
                                  (void *)NULL, (DWORD) 0 ) ) <= 0 )
        goto exit2;

    //
    // Allocates memory with bufLen+1 bytes to store the result
    // string. Here we allocale on more byte to put null character.
    //

    if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
        goto exit2;

    if ( !( lpResultStr = (LPSTR) LocalLock( hMem ) ) )
        goto exit1;

    //
    // Reads in the result string.
    //

    ImmGetCompositionString( hIMC, GCS_RESULTSTR, lpResultStr, bufLen );

    //
    // Displays the result string.
    //

    DisplayResultString( hwnd, lpResultStr );

    LocalUnlock( hMem );

exit1:

    LocalFree( hMem );

exit2:

    ImmReleaseContext( hwnd, hIMC );

}

void ImeUIChangeCandidate | ( | HWND | ,
 |  | LPARAM |
 | ) |  |

Definition at line 611 of file ImeUI.C.

{
    HIMC            hIMC;
    LPCANDIDATELIST lpCandList = NULL;
    DWORD           dwIndex;
    DWORD           bufLen;
    LPSTR         lpStr;
    DWORD         i;
    RECT          rect = {0};
    int           width = 0;
    DWORD         dwPreferNumPerPage;

    //
    // If fail to get input context, do nothing.
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // Determine which candidate list should be updated.
    //

    for ( dwIndex = 0; dwIndex < MAX_LISTCAND; dwIndex++ )
        if ( CandList & ( 1 << dwIndex ) )
            break;

    //
    // If dwIndex == MAX_LISTCAND, then something wrong, do nothing.
    //

    if ( dwIndex == MAX_LISTCAND )
        return;

    //
    // Determines how much memory space should be allocated to read in the
    // corresponding candidate list.
    //

    if ( !( bufLen = ImmGetCandidateList( hIMC, dwIndex, lpCandList, 0 ) ) )
        goto exit2;

    //
    // Relocate memory space.
    //

    if ( !( gImeUIData.hListCandMem[ dwIndex ] = GlobalReAlloc(
      gImeUIData.hListCandMem[ dwIndex ], (int)bufLen, LPTR ) ) )
    {
        goto exit2;
    }

    if ( !( lpStr =
        (LPSTR)GlobalLock( gImeUIData.hListCandMem[ dwIndex ] ) ) )
    {
        GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
        gImeUIData.hListCandMem[ dwIndex ] = NULL;
        goto exit2;
    }

    lpCandList = (LPCANDIDATELIST) lpStr;

    //
    // Reads in the corresponding candidate list.
    //

    ImmGetCandidateList( hIMC, dwIndex, lpCandList, bufLen );

    //
    // Determines how many candidate strings per page.
    //

    dwPreferNumPerPage = ( !lpCandList->dwPageSize ) ?
                         DEFAULT_CAND_NUM_PER_PAGE :
                         lpCandList->dwPageSize;
    //
    // Determining maximum character length  the list box
    // will display by loopping through all candidate strings.
    //

    for( i = 0; i < lpCandList->dwCount; i++ )
    {
        //
        // Get the pointer to i-th candidate string.
        //

        lpStr = (LPSTR)lpCandList +
                lpCandList->dwOffset[ i ];

        width = ( width < lstrlen( lpStr ) ) ? lstrlen( lpStr ) :
                  width;
    }

    GetWindowRect( gImeUIData.hListCand[ dwIndex ] , &rect);

    SetWindowPos( gImeUIData.hListCand[ dwIndex ],
              hwnd,
              rect.left,
              rect.top,
              ( width ) * cxMetrics + 10,
              (int)(dwPreferNumPerPage) * cyMetrics + 5,
              SWP_NOZORDER | SWP_NOACTIVATE );

    DisplayCandStrings( gImeUIData.hListCand[ dwIndex ], lpCandList );

    GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );

exit2:

    return;

}

void ImeUIClearData ( HWND )

Definition at line 1236 of file ImeUI.C.

{

    RECT            rect;
    int             i;

    SetWindowText( hwnd, szSteTitle );

    //
    // If user switches to other IME, here we destroy all candidate
    // windows which has been opened and erase all composition
    // chars if any.
    //

    for( i = 0; i < MAX_LISTCAND; i++ )
    {
        if ( gImeUIData.hListCand[ i ] )
        {
            //
            // The i-th candidate list has already been displayed,
            // destroy it and free memory which stores candidate
            // strings.
            //

            DestroyWindow( gImeUIData.hListCand[ i] );
            GlobalFree( gImeUIData.hListCandMem[ i ] );

            gImeUIData.hListCand[ i ] =
            gImeUIData.hListCandMem[ i ] = NULL;

        }
    }

    //
    // Update client area.
    //

    GetClientRect( hwnd, &rect );

    InvalidateRect( hwnd, &rect, FALSE );

    //
    // Reset IMEUI's global data.
    //

    gImeUIData.uCompLen = gImeUIData.ImeState = 0;

    //
    // Reset caret to the original position.
    //

    HideCaret( hwnd );
    ResetCaret( hwnd );
    ShowCaret( hwnd );

}

void ImeUICloseCandidate | ( | HWND | ,
 |  | LPARAM |
 | ) |  |

Definition at line 558 of file ImeUI.C.

{
    int index;

    //
    // Change window's caption title to normal.
    //

    SetWindowText( hwnd, szSteCompTitle );

    //
    // If the i-th bit on of CandList that means the i-th
    // candidate list should be closed.
    //

    for( index = 0; index < MAX_LISTCAND; index ++ )
    {
        if (( CandList & ( 1 << index ) ) && gImeUIData.hListCand[ index ])
        {

            //
            // Destroy the candidate window.
            //

            DestroyWindow( gImeUIData.hListCand[ index ] );

            gImeUIData.hListCand[ index ] = NULL;

            //
            // Free memory.
            //

            GlobalFree( gImeUIData.hListCandMem[ index ] );

            gImeUIData.hListCandMem[ index ] = NULL;

        }
    }

    gImeUIData.ImeState &= ~IME_IN_CHOSECAND;

}

void ImeUIComposition | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 49 of file ImeUI.C.

{

    if ( CompFlag & GCS_RESULTSTR )
    {
         GetResultStr( hwnd );
    }
    else
    {
        if ( CompFlag & GCS_COMPSTR )
        {
            GetCompositionStr( hwnd, CompFlag );
        }
    }

}

void ImeUIEndComposition ( HWND )

Definition at line 288 of file ImeUI.C.

{

    RECT rect = {0};

    //
    // Change caption title to normal
    //

    SetWindowText( hwnd, szSteTitle );

    //
    // Update client area.
    //

    GetClientRect( hwnd, &rect );

    InvalidateRect( hwnd, &rect, FALSE );

    //
    // Reset the length of composition string to zero.
    //

    gImeUIData.uCompLen = 0;

    gImeUIData.ImeState &= ~IME_IN_COMPOSITION;

}

void ImeUIMoveCandWin ( HWND )

Definition at line 1188 of file ImeUI.C.

{

    if ( gImeUIData.ImeState & IME_IN_CHOSECAND )
    {
        POINT point;          // Storage for caret position.
        int   i;              // loop counter.
        int   NumCandWin;     // Storage for num of cand win.
        RECT  rect;           // Storage for client rect.

        //
        // If current IME state is in chosing candidate, here we
        // move all candidate windows, if any, to the appropriate
        // position based on the parent window's position.
        //

        NumCandWin = 0;

        GetCaretPos( &point );
        ClientToScreen( hwnd, &point );

        for ( i = 0; i < MAX_LISTCAND ; i++ )
        {
            if ( gImeUIData.hListCand[ i ] )
            {
                GetClientRect( gImeUIData.hListCand[ i ], &rect );

                MoveWindow( gImeUIData.hListCand[ i ],
                            point.x + X_INDENT * NumCandWin,
                            point.y + Y_INDENT * NumCandWin + cyMetrics,
                            ( rect.right - rect.left + 1 ),
                            ( rect.bottom - rect.top + 1 ), TRUE );

                NumCandWin++;
            }
        }
    }
}

BOOL ImeUINotify | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 325 of file ImeUI.C.

{
    switch (wParam )
    {
        case IMN_OPENCANDIDATE:

            ImeUIOpenCandidate( hwnd, lParam );
            break;

        case IMN_CLOSECANDIDATE:

            ImeUICloseCandidate( hwnd, lParam );
            break;

        case IMN_CHANGECANDIDATE:

            ImeUIChangeCandidate( hwnd, lParam );
            break;

        case IMN_SETOPENSTATUS:

            ImeUISetOpenStatus( hwnd );
            break;

  default:
      return FALSE;

    }

    return TRUE;
}

void ImeUIOpenCandidate | ( | HWND | ,
 |  | LPARAM |
 | ) |  |

Definition at line 368 of file ImeUI.C.

{
    HIMC            hIMC;               // Input context handle.
    LPCANDIDATELIST lpCandList;         // Storage for LP to candidate list.
    CANDIDATELIST   tempCandList;       // Storage for LP to candidate list.
    DWORD           bufLen;           // Storage for candidate strings.
    LPSTR           lpStr;              // Storage for LP to a string.
    DWORD           dwIndex;            // Storage for index of ListCand array
    DWORD           i;                  // Loop count.
    int             width = 0;          // Storage for width of listCand
    int             CurNumCandList = 0; // Storage for number of cand. lists.
    DWORD           dwPreferNumPerPage; // Storage for PreferNumPerPage
    POINT           point;              // Storage for caret position.

    //
    // If fail to get input context handle, do nothing.
    //

    if ( ! (hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // Change caption title to DBCS candidate mode.
    //

    SetWindowText( hwnd, szSteCandTitle );

    //
    // Find out how many candidate windows have already been opened.
    //

    for( i = 0; i < MAX_LISTCAND; i++ )
    {
        if ( gImeUIData.hListCand[ i ] )
        {
            CurNumCandList++;
        }
    }

    //
    // Check which candidate lists should be displayed by loopping
    // through all possible candidate lists.
    //

    for( dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ )
    {

        if ( CandList & ( 1 << dwIndex ) )
        {
            //
            // The dwIndex-th candidate list contains candidate strings.
            // So here we want to display them.
            //

            //
            // Determines how musch memory space should be allocated to
            // read in the corresponding candidate list .
            //

            if ( ! ( bufLen = ImmGetCandidateList( hIMC, dwIndex, &tempCandList, 0 ) ) )
                goto exit2;

            //
            // Allocate memory space.
            //

            if( !( gImeUIData.hListCandMem[ dwIndex ]  =
                   GlobalAlloc( LPTR, (int)bufLen ) ) )
                goto exit2;

            if( !( lpStr =
                 (LPSTR)GlobalLock( gImeUIData.hListCandMem[ dwIndex ] ) ) )
            {
                GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
                gImeUIData.hListCandMem[ dwIndex ] = NULL;
                goto exit2;
            }

            lpCandList = (LPCANDIDATELIST) lpStr;

            //
            // Reads in the corresponding candidate list.
            //

            ImmGetCandidateList( hIMC, dwIndex, lpCandList, bufLen );

            //
            // Get current caret position.
            //

            GetCaretPos( (POINT *)&point );
            ClientToScreen( hwnd, &point );

            //
            // Determines how many candidate strings per page.
            //

            dwPreferNumPerPage = ( !lpCandList->dwPageSize ) ?
                                 DEFAULT_CAND_NUM_PER_PAGE :
                                 lpCandList->dwPageSize;
            //
            // Determining maximum character length the list box
            // will display by loopping through all candidate strings.
            //

            for( i = 0; i < lpCandList->dwCount; i++ )
            {
                //
                // Get the pointer to i-th candidate string.
                //

                lpStr = (LPSTR)lpCandList +
                        lpCandList->dwOffset[ i ];

                width = ( width < lstrlen( lpStr ) ) ? lstrlen( lpStr ) : width;

            }

            //
            // Create a candidate window for the candidate list.
            //

            gImeUIData.hListCand[ dwIndex ] =
                   CreateWindow( szCandClass,
                                 NULL,
                                 WS_BORDER | WS_POPUP | WS_DISABLED,
                                 CurNumCandList * X_INDENT + point.x,
                                 CurNumCandList * Y_INDENT +
                                     point.y + cyMetrics,
                                 ( width ) * cxMetrics + 10,
                                 (int)(dwPreferNumPerPage) * cyMetrics + 5,
                                 hwnd,
                                 NULL,
                                 (HANDLE)GetWindowLongPtr( hwnd, GWLP_HINSTANCE ),
                                 NULL );
            //
            // If fail to create the candidate window then do nothing.
            //

            if ( gImeUIData.hListCand[ dwIndex ] < 0 )
            {
                GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );
                GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
                goto exit2;
            }

            //
            // Show candidate window.
            //

            ShowWindow( gImeUIData.hListCand[ dwIndex ], SW_SHOWNOACTIVATE );

            //
            // Display candidate strings.
            //

            DisplayCandStrings( gImeUIData.hListCand[ dwIndex ], lpCandList );

            GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );

            CurNumCandList++;
        }
    }

    //
    // Reset IME state.
    //

    gImeUIData.ImeState |= IME_IN_CHOSECAND;

exit2:

    ImmReleaseContext( hwnd, hIMC );

}

void ImeUISetOpenStatus ( HWND )

Definition at line 737 of file ImeUI.C.

{
    int  i;       // Lopp counter
    HIMC hIMC;    // Storage for input context handle.

    //
    // If fail to get input context handle then do nothing
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    if ( ImmGetOpenStatus( hIMC ) )
    {

        //
        // If the IME conversion engine is open, here we change
        // window's caption title to DBCS composition mode.
        //

        SetWindowText( hwnd, (LPSTR)szSteCompTitle );
    }
    else
    {
        RECT rect = {0};

        //
        // If the IME conversion engine is closed, here we
        // erase all already displayed composition chars if any,
        // change the window's caption title to normal.
        //

        GetClientRect( hwnd, &rect );
        InvalidateRect( hwnd, &rect, FALSE );

        SetWindowText( hwnd, (LPSTR)szSteTitle );

        //
        // Here we close and destroy all of candidate windows
        // if IME conversion engine is closed.
        //

        for( i = 0; i <= MAX_LISTCAND; i++ )
        {
            if ( gImeUIData.hListCand[ i ] )
            {
                DestroyWindow( gImeUIData.hListCand[ i ] );
                gImeUIData.hListCand[ i ] = NULL;
                GlobalFree( gImeUIData.hListCandMem[ i ] );
                gImeUIData.hListCandMem[ i ] = NULL;
            }
        }

        //
        // Reset IMEUI's global data.
        //

        gImeUIData.uCompLen = 0;
        gImeUIData.ImeState = 0;

        ResetCaret( hwnd );

    }

    ImmReleaseContext( hwnd, hIMC );
}

void ImeUIStartComposition ( HWND )

Definition at line 18 of file ImeUI.C.

{

    //
    // Change caption title to DBCS composition mode.
    //

    SetWindowText( hwnd, szSteCompTitle );

    //
    // Reset global variables.
    //

    gImeUIData.uCompLen = 0;             // length of composition string.

    gImeUIData.ImeState |= IME_IN_COMPOSITION;
}

BOOL MoveCaret ( HWND )

Definition at line 519 of file Main.C.

{
    HIMC hIMC;
    BOOL retVal = TRUE;

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        goto exit_func;

    if ( ImmGetCompositionString( hIMC, GCS_CURSORPOS, (void *)NULL, 0 ) )
        retVal = FALSE;

    ImmReleaseContext( hwnd, hIMC );

exit_func:
    return retVal;
}

void ResetCaret ( HWND hWnd )

Definition at line 480 of file Main.C.

{

    HideCaret( hWnd );
    DestroyCaret();
    CreateCaret( hWnd,
                 NULL,
                 (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
                    CaretWidth*2 : CaretWidth,
                 cyMetrics );
    SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
    ShowCaret( hWnd );

    SetIMECompFormPos( hWnd );

}

void RestoreImeUI ( HWND )

Definition at line 1066 of file ImeUI.C.

{
    HIMC        hIMC;           // Storage for input context handle.
    LONG        bufLen;         //

    //
    // If fail to get input context handle then do nothing.
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // If IME conversion engine is open and there are any composition
    // string in the context then we redisplay them.
    //

    if ( ImmGetOpenStatus( hIMC ) && gImeUIData.ImeState &&
         ( bufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR,
                      (void *)NULL, 0l ) ) > 0 )
    {
        LPSTR  lpCompStr;            // Pointer to composition string
        HLOCAL hMem;                 // Storage for memory handle.
        LPSTR  lpCompStrAttr = NULL; // Pointer to composition string's attribute
        LONG   bufLenAttr;           //
        HLOCAL hMemAttr = NULL;      // Memory handle for composition string's
                                     // attributes.

        //
        // If fail to allocate and lock memory space for reading in
        // the composition string then do nothing.
        //

        if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
            goto exit2;

        if( !( lpCompStr = (LPSTR) LocalLock( hMem ) ) )
        {
            LocalFree( hMem );
            goto exit2;
        }

        //
        // Get composition string and redisplay them.
        //

        if ( ImmGetCompositionString( hIMC, GCS_COMPSTR, lpCompStr,
                                      bufLen ) > 0 )
        {

            //
            // Make sure whether we need to handle composition string's
            // attributes.
            //

            if ( ( bufLenAttr = ( ImmGetCompositionString( hIMC,
                       GCS_COMPATTR, (void FAR*)NULL, 0l ) ) ) > 0 )
            {
                //
                // If fail to allocate and lock memory space for reading in
                // the composition string's attribute then we assume
                // no attribute array.
                //

                if ( !( hMemAttr = LocalAlloc(LPTR, (int)bufLenAttr + 1 )))
                    goto nothing;

                if ( !( lpCompStrAttr = (LPSTR) LocalLock( hMemAttr ) ) )
                {
                    LocalFree( hMemAttr );
                    goto nothing;
                }

                ImmGetCompositionString( hIMC, GCS_COMPATTR, lpCompStrAttr,
                                         bufLenAttr );

                lpCompStrAttr[ bufLenAttr ] = 0;
            }
            else
            {
nothing:
                lpCompStrAttr = NULL;
            }

            lpCompStr[ bufLen ] = 0;

            DisplayCompString( hwnd, lpCompStr, lpCompStrAttr );

        }

        LocalUnlock( hMem );
        LocalFree( hMem );

        if ( lpCompStrAttr )
        {
            if (NULL != hMemAttr)
            {
                LocalUnlock( hMemAttr );
                LocalFree( hMemAttr );
            }
        }

    }

exit2:

    ImmReleaseContext( hwnd, hIMC );

}

void SetIMECompFormPos ( HWND hWnd )

Definition at line 359 of file Main.C.

{

    //
    // If current composition form mode is near caret operation,
    // application should inform IME UI the caret position has been
    // changed. IME UI will make decision whether it has to adjust
    // composition window position.
    //
    //
    if ( CompWindowMode == IDC_NEARCARET_POS )
    {
        HIMC hIMC = ImmGetContext(hWnd);
        POINT point = {0};

        GetCaretPos( &point );

        CompForm.dwStyle = CFS_POINT;

        CompForm.ptCurrentPos.x = (long) point.x;
        CompForm.ptCurrentPos.y = (long) point.y;

        if ( hIMC )
        {
            ImmSetCompositionWindow(hIMC,&CompForm);
        }
        ImmReleaseContext( hWnd , hIMC);
    }

}

int WINAPI SteWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | UINT | ,
 |  | LONG |
 | ) |  |

Definition at line 1064 of file Main.C.

{
    int i;
    HDC hdc;
    PAINTSTRUCT ps = {0};

    switch( msg )
    {
    case WM_CREATE:
        SteCreate( hWnd );
        break;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;

    case WM_CLOSE:
        DestroyWindow( hWnd );
        break;

    case WM_SETFOCUS:
        CreateCaret( hWnd, NULL,
                     (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
                         CaretWidth*2 : CaretWidth,
                     cyMetrics );
        SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
        ShowCaret( hWnd );
        break;

    case WM_KILLFOCUS:
        HideCaret( hWnd );
        DestroyCaret();
        break;

    case WM_IME_KEYDOWN: /* fall-through */
    case WM_KEYDOWN:
        VirtualKeyHandler( hWnd, wParam );
        break;

    case WM_KEYUP:
        break;

    case WM_CHAR:
        CharHandler( hWnd, (WORD)wParam );
        break;

    case WM_LBUTTONDOWN:
        MouseHandler( hWnd, lParam );
        break;

    case WM_MOVE:
        ImeUIMoveCandWin( hWnd );
        break;

    case WM_COMMAND:
        SteCommand( hWnd, wParam, lParam );
        break;

    case WM_PAINT:
        InvalidateRect(hWnd,NULL,FALSE);  //for repaint allignment problem??
              // WinChi3.0
        hdc = BeginPaint( hWnd, &ps );

        //
        // Refresh display from text buffer
        //
        for ( i = FIRSTROW; i <= LASTROW; i++ )
            TextOut( hdc, 0, i*cyMetrics, (LPSTR)textbuf[i], MAXCOL );

        EndPaint( hWnd, &ps );
        RestoreImeUI( hWnd );
        break;

    case WM_INPUTLANGCHANGE:
        InputChangeHandler( hWnd );
        goto call_defwinproc;
        break;

    case WM_IME_SETCONTEXT:
        //
        // The application have to pass WM_IME_SETCONTEXT to DefWindowProc.
        // When the application want to handle the IME at the timing of
        // focus changing, the application should use WM_SETFOCUS or
        // WM_KILLFOCUS.
        //

        if ( gImeUIData.fdwProperty & IME_PROP_SPECIAL_UI )
        {
            goto call_defwinproc;
        }
        else if ( gImeUIData.fdwProperty & IME_PROP_AT_CARET )
        {
            //
            // application wants to draw UI ny itself.
            //
            lParam &= ~(ISC_SHOWUICOMPOSITIONWINDOW | ISC_SHOWUIALLCANDIDATEWINDOW);
        }
        goto call_defwinproc;

    case WM_IME_STARTCOMPOSITION:
        //
        // CheckProperty is a macro, if IME already provides near caret or
        // special UI then let IME handle this message.
        //
        CheckProperty;
        ImeUIStartComposition( hWnd );
        break;

    case WM_IME_COMPOSITION:
        CheckProperty;
        ImeUIComposition( hWnd, wParam, lParam );
        break;

    case WM_IME_ENDCOMPOSITION:
        CheckProperty;
        ImeUIEndComposition( hWnd );
        break;

    case WM_IME_COMPOSITIONFULL:
        //
        // Make sure the size for drawing the composition string.
        // Application should draw the composition string correctly.
        //
        break;

    case WM_IME_NOTIFY:
        CheckProperty;
        if ( !ImeUINotify( hWnd, wParam, lParam ) )
            // This application does not handle all notification message.
            // So we pass those notification messages which are not hanlded
            // by this application to the DefWindowProc.
            goto call_defwinproc;
        break;

    case WM_IME_CONTROL:
        //
        // This message is not received by the application window.
        // But don't pass it to DefWindowProc().
        //
        break;

    default:

call_defwinproc:
        return (int)DefWindowProc( hWnd, msg, wParam, lParam );
    }

    return 0;
}

Variable Documentation

int CaretWidth

Definition at line 24 of file Global.C.

UINT cxMetrics

Definition at line 17 of file Global.C.

UINT cxOverTypeCaret

Definition at line 17 of file Global.C.

UINT cyMetrics

Definition at line 17 of file Global.C.

int DBCSFillChar

Definition at line 26 of file Global.C.

BOOL fInsertMode

Definition at line 23 of file Global.C.

IMEUIDATA gImeUIData

Definition at line 29 of file Global.C.

HKL hCurKL

Definition at line 31 of file Global.C.

HFONT hfntFixed

Definition at line 21 of file Global.C.

HFONT hfntOld

Definition at line 22 of file Global.C.

char szCandClass[]

Definition at line 16 of file Global.C.

char szSteCandTitle[]

Definition at line 15 of file Global.C.

char szSteCandUIClass[]

Definition at line 12 of file Global.C.

char szSteClass[]

Definition at line 11 of file Global.C.

char szSteCompTitle[]

Definition at line 14 of file Global.C.

char szSteTitle[]

Definition at line 13 of file Global.C.

BYTE textbuf[MAXROW][MAXCOL]

Definition at line 25 of file Global.C.

int xPos

Definition at line 20 of file Global.C.

int yPos

Definition at line 20 of file Global.C.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/Global.C File Reference

  • WinUI
  • Input
  • Ime
  • FullIME
Variables

Global.C File Reference

#include <windows.h>
#include <imm.h>
#include "FullIME.h"

Go to the source code of this file.

Variables

int | CaretWidth
UINT cxMetrics
UINT cxOverTypeCaret
UINT cyMetrics
int | DBCSFillChar
BOOL fInsertMode
IMEUIDATA gImeUIData
HKL | hCurKL
HFONT | hfntFixed
HFONT | hfntOld
char | szCandClass [20]
char | szSteCandTitle [55]
char | szSteCandUIClass [12]
char | szSteClass [10]
char | szSteCompTitle [55]
char | szSteTitle [55]
BYTE | textbuf [MAXROW][MAXCOL]
int | xPos
int | yPos

Variable Documentation

int CaretWidth

Definition at line 24 of file Global.C.

UINT cxMetrics

Definition at line 17 of file Global.C.

UINT cxOverTypeCaret

Definition at line 17 of file Global.C.

UINT cyMetrics

Definition at line 17 of file Global.C.

int DBCSFillChar

Definition at line 26 of file Global.C.

BOOL fInsertMode

Definition at line 23 of file Global.C.

IMEUIDATA gImeUIData

Definition at line 29 of file Global.C.

HKL hCurKL

Definition at line 31 of file Global.C.

HFONT hfntFixed

Definition at line 21 of file Global.C.

HFONT hfntOld

Definition at line 22 of file Global.C.

char szCandClass[20]

Definition at line 16 of file Global.C.

char szSteCandTitle[55]

Definition at line 15 of file Global.C.

char szSteCandUIClass[12]

Definition at line 12 of file Global.C.

char szSteClass[10]

Definition at line 11 of file Global.C.

char szSteCompTitle[55]

Definition at line 14 of file Global.C.

char szSteTitle[55]

Definition at line 13 of file Global.C.

BYTE textbuf[MAXROW][MAXCOL]

Definition at line 25 of file Global.C.

int xPos

Definition at line 20 of file Global.C.

int yPos

Definition at line 20 of file Global.C.

Generated on Wed Nov 13 2024 16:55:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/ImeUI.C File Reference

  • WinUI
  • Input
  • Ime
  • FullIME
Functions

ImeUI.C File Reference

#include <assert.h>
#include <windows.h>
#include <imm.h>
#include "FullIME.h"

Go to the source code of this file.

Functions

void | DisplayCompString (HWND hwnd, LPSTR lpStr, LPSTR lpStrAttr)
void | DisplayResultString (HWND hwnd, LPSTR lpStr)
void | GetCompositionStr (HWND hwnd, LPARAM CompFlag)
void | GetResultStr (HWND hwnd)
void | ImeUIChangeCandidate (HWND hwnd, LPARAM CandList)
void | ImeUIClearData (HWND hwnd)
void | ImeUICloseCandidate (HWND hwnd, LPARAM CandList)
void | ImeUIComposition (HWND hwnd, WPARAM wParam, LPARAM CompFlag)
void | ImeUIEndComposition (HWND hwnd)
void | ImeUIMoveCandWin (HWND hwnd)
BOOL | ImeUINotify (HWND hwnd, WPARAM wParam, LPARAM lParam)
void | ImeUIOpenCandidate (HWND hwnd, LPARAM CandList)
void | ImeUISetOpenStatus (HWND hwnd)
void | ImeUIStartComposition (HWND hwnd)
void | RestoreImeUI (HWND hwnd)

Function Documentation

void DisplayCompString | ( | HWND | hwnd,
 |  | LPSTR | lpStr,
 |  | LPSTR | lpStrAttr
 | ) |  |

Definition at line 815 of file ImeUI.C.

{
    HDC         hdc;
    int         StrLen = lstrlen( lpStr );
    RECT        rect;
    DWORD       dwColor;
    int         i;
    BOOL        fDBCSTrailByte = FALSE;

    hdc = GetDC( hwnd );

    HideCaret( hwnd );

    //
    // Determine OPAQUE rect.
    //

    rect.left = xPos * cxMetrics;
    rect.top  = yPos * cyMetrics;
    rect.bottom = rect.top + cyMetrics;
    rect.right = ( (int)gImeUIData.uCompLen > StrLen ) ?
                 ( xPos + gImeUIData.uCompLen ) * cxMetrics:
                 ( xPos + StrLen ) * cxMetrics;

    //
    // This example we use red to display composition chars
    // with attribute 000, pink for attribute 001,
    // blue for attribute 010, green for attribute 011.
    //

    //
    // Each composition character has different attribute.
    // We here use different kinds of color to represent attributes.
    // Red, pink, blue and green are for attribute 000, 001, 010 and 011,
    // respectively.
    //

    dwColor = GetTextColor( hdc );

    if ( ( StrLen % 2 ) )
    {
        if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
        {
            textbuf[ yPos ][ xPos + StrLen ] = ' ';
            fDBCSTrailByte = TRUE;
        }
    } else
    {
        if ( !IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 2 ] ) )
        {
            if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
      {
                textbuf[ yPos ][ xPos + StrLen ] = ' ';
                fDBCSTrailByte = TRUE;
            }
        }
    }

    if ( !lpStrAttr )
    {
        //
        // If there are not attribute array, here we use default color, RED,
        // to display all of composition characters.
        //

        SetTextColor( hdc, CompColor[ 0 ] ); // default color

        ExtTextOut( hdc, xPos * cxMetrics, yPos * cyMetrics,
                ETO_OPAQUE, &rect, lpStr, StrLen, 0 );

    } else
    {

        int  ColorIndex;

        ExtTextOut( hdc, xPos * cxMetrics, yPos * cyMetrics, ETO_OPAQUE,
                    &rect, NULL, 0, 0 );

        for( i = 0; *lpStr;)
        {
            int cnt = IsDBCSLeadByte(*lpStr) ? 2 : 1;

            ColorIndex = ( ((int)*lpStrAttr) < 0 ) ? 0 : (int)*lpStrAttr;
            ColorIndex = ( ColorIndex > 3 ) ? 3 : ColorIndex;

            SetTextColor( hdc, CompColor[ ColorIndex ] );

            TextOut( hdc, ( i + xPos ) * cxMetrics, yPos * cyMetrics,
                     lpStr, cnt );
            lpStr += cnt;
            lpStrAttr += cnt;
            i += cnt;
        }
    }

    SetTextColor( hdc, dwColor );

    if ( fDBCSTrailByte )
    {
        TextOut( hdc, ( xPos + StrLen ) * cxMetrics, yPos * cyMetrics,
           " ", 1 );
    }

    SetCaretPos( ( xPos + StrLen ) * cxMetrics, yPos * cyMetrics );

    ShowCaret( hwnd );

    ReleaseDC( hwnd, hdc );

}

void DisplayResultString | ( | HWND | hwnd,
 |  | LPSTR | lpStr
 | ) |  |

Definition at line 939 of file ImeUI.C.

{

    int         StrLen;         // Storage for string length.
    int         i;              // Loop counter.
    HDC         hdc;            // Display context handle.

    StrLen = lstrlen( lpStr );

    //
    // If there is no room for compsoition string, discard it
    //

    if ( xPos == ( LASTCOL - StrLen - 1 ) )
        return;

    //
    // if insert mode or during composition session,
    // move rest of line to the right by StrLen bytes.
    //

    if ( fInsertMode )
    {

        for( i = LASTCOL; i > xPos; i-- )
            textbuf[ yPos ][ i ] = textbuf[ yPos ][ i - StrLen ];

        //
        // If the row ends on a lead byte, blank it out,
        // To do this we must first traverse the string starting
        // from a know character boundry until we reach the last column.
        // If the last column is a character boundry then the last
        // character is either a string byte or a lead byte.
        //

        for( i = xPos + StrLen; i < LASTCOL; )
        {
            if ( IsDBCSLeadByte( textbuf[ yPos ][ i ] ) )
                i++;
            i++;
        }

        if ( i == LASTCOL && IsDBCSLeadByte( textbuf[ yPos ][ i ] ) )
            textbuf[ yPos ][ LASTCOL ] = ' ';

    }
    else
    {
        //
        // overtype mode
        //

        if ( ( StrLen % 2 ) )
        {
            if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
                textbuf[ yPos ][ xPos + StrLen ] = ' ';
        }
        else
        {
            if ( !IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 2 ] ) )
            {
                //
                // Overtyping the current byte, plus the following byte
                // which could be a lead byte.
                //

                if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
                    textbuf[ yPos ][ xPos + StrLen ] = ' ';
            }
        }
    }

    //
    // Store input character at current caret position.
    //

    for( i = 0; i <= LASTCOL && *lpStr; i++ )
        textbuf[ yPos ][ xPos + i ] = *lpStr++;

    //
    // Display input character
    //

    hdc = GetDC( hwnd );

    HideCaret( hwnd );

    //
    // Displays result string with normal color.
    //

    TextOut( hdc, xPos *cxMetrics, yPos * cyMetrics,
             (LPCSTR)&( textbuf[ yPos][xPos] ), MAXCOL - xPos );

    ShowCaret( hwnd );

    ReleaseDC( hwnd, hdc );

    //
    // Reset Caret position
    //

    xPos += StrLen;

    if ( xPos > LASTCOL )
        xPos = LASTCOL;

    ResetCaret( hwnd );

    gImeUIData.uCompLen = 0;

}

void GetCompositionStr | ( | HWND | hwnd,
 |  | LPARAM | CompFlag
 | ) |  |

Definition at line 77 of file ImeUI.C.

{
     LONG       bufLen;               // Stogare for len. of composition str
     LPSTR      lpCompStr;              // Pointer to composition str.
     HIMC       hIMC;                   // Input context handle.
     HLOCAL     hMem;                   // Memory handle.
     LPSTR      lpCompStrAttr;          // Pointer to composition str array.
     HLOCAL     hMemAttr = NULL;        // Memory handle for comp. str. array.
     LONG       bufLenAttr;

     //
     // If fail to get input context handle then do nothing.
     // Applications should call ImmGetContext API to get
     // input context handle.
     //

     if ( !( hIMC = ImmGetContext( hwnd ) ) )
         return;

     //
     // Determines how much memory space to store the composition string.
     // Applications should call ImmGetCompositionString with
     // GCS_COMPSTR flag on, buffer length zero, to get the bullfer
     // length.
     //

     bufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR, (void*)NULL, 0l );
     if ( ( IMM_ERROR_NODATA == bufLen) ||
          ( IMM_ERROR_GENERAL == bufLen) )
     {
         goto exit2;
     }

     //
     // Allocates memory with bufLen+1 bytes to store the composition
     // string. Here we allocale on more byte to put null character.
     //

     if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
         goto exit2;

     if ( !( lpCompStr = (LPSTR) LocalLock( hMem ) ) )
         goto exit1;

     //
     // Reads in the composition string.
     //

     ImmGetCompositionString( hIMC, GCS_COMPSTR, lpCompStr, bufLen );

     //
     // Null terminated.
     //

     lpCompStr[ bufLen ] = 0;

     //
     // If GCS_COMPATTR flag is on, then we need to take care of it.
     //

     if ( CompFlag & GCS_COMPATTR )
     {
         bufLenAttr = ImmGetCompositionString( hIMC, GCS_COMPATTR, (void*)NULL, 0l );
         if ( ( IMM_ERROR_NODATA == bufLenAttr) ||
              ( IMM_ERROR_GENERAL == bufLenAttr) )
         {
             goto nothing;
         }

         //
         // Allocate memory to store attributes of composition strings.
         //

         if ( !( hMemAttr = LocalAlloc( LPTR, (int)bufLenAttr + 1 ) ) )
             goto nothing;

         if ( !( lpCompStrAttr = (LPSTR) LocalLock( hMemAttr ) ) )
         {
             LocalFree( hMemAttr );
             goto nothing;
         }

         //
         // Reads in the attribute array.
         //

         ImmGetCompositionString( hIMC, GCS_COMPATTR, lpCompStrAttr,
                                  bufLenAttr );

         lpCompStrAttr[ bufLenAttr ] = 0;

     } else
     {

nothing:
         lpCompStrAttr = NULL;
     }

     //
     // Display new composition chars.
     //

     DisplayCompString( hwnd, lpCompStr, lpCompStrAttr );

     //
     // Keep the length of the composition string for using later.
     //

     gImeUIData.uCompLen = (UINT)bufLen;

     LocalUnlock( hMem );

     if ( lpCompStrAttr )
     {
         if (NULL != hMemAttr)
         {
             LocalUnlock( hMemAttr );
             LocalFree( hMemAttr );
         }
     }

exit1:

     LocalFree( hMem );

exit2:

     ImmReleaseContext( hwnd, hIMC );

}

void GetResultStr ( HWND hwnd )

Definition at line 219 of file ImeUI.C.

{
    LONG        bufLen;                 // Storage for length of result str.
    LPSTR       lpResultStr;            // Pointer to result string.
    HIMC        hIMC;                   // Input context handle.
    HLOCAL      hMem;                   // Memory handle.

    //
    // If fail to get input context handle then do nothing.
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // Determines how much memory space to store the result string.
    // Applications should call ImmGetCompositionString with
    // GCS_RESULTSTR flag on, buffer length zero, to get the bullfer
    // length.
    //

    if ( ( bufLen = ImmGetCompositionString( hIMC, GCS_RESULTSTR,
                                  (void *)NULL, (DWORD) 0 ) ) <= 0 )
        goto exit2;

    //
    // Allocates memory with bufLen+1 bytes to store the result
    // string. Here we allocale on more byte to put null character.
    //

    if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
        goto exit2;

    if ( !( lpResultStr = (LPSTR) LocalLock( hMem ) ) )
        goto exit1;

    //
    // Reads in the result string.
    //

    ImmGetCompositionString( hIMC, GCS_RESULTSTR, lpResultStr, bufLen );

    //
    // Displays the result string.
    //

    DisplayResultString( hwnd, lpResultStr );

    LocalUnlock( hMem );

exit1:

    LocalFree( hMem );

exit2:

    ImmReleaseContext( hwnd, hIMC );

}

void ImeUIChangeCandidate | ( | HWND | hwnd,
 |  | LPARAM | CandList
 | ) |  |

Definition at line 611 of file ImeUI.C.

{
    HIMC            hIMC;
    LPCANDIDATELIST lpCandList = NULL;
    DWORD           dwIndex;
    DWORD           bufLen;
    LPSTR         lpStr;
    DWORD         i;
    RECT          rect = {0};
    int           width = 0;
    DWORD         dwPreferNumPerPage;

    //
    // If fail to get input context, do nothing.
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // Determine which candidate list should be updated.
    //

    for ( dwIndex = 0; dwIndex < MAX_LISTCAND; dwIndex++ )
        if ( CandList & ( 1 << dwIndex ) )
            break;

    //
    // If dwIndex == MAX_LISTCAND, then something wrong, do nothing.
    //

    if ( dwIndex == MAX_LISTCAND )
        return;

    //
    // Determines how much memory space should be allocated to read in the
    // corresponding candidate list.
    //

    if ( !( bufLen = ImmGetCandidateList( hIMC, dwIndex, lpCandList, 0 ) ) )
        goto exit2;

    //
    // Relocate memory space.
    //

    if ( !( gImeUIData.hListCandMem[ dwIndex ] = GlobalReAlloc(
      gImeUIData.hListCandMem[ dwIndex ], (int)bufLen, LPTR ) ) )
    {
        goto exit2;
    }

    if ( !( lpStr =
        (LPSTR)GlobalLock( gImeUIData.hListCandMem[ dwIndex ] ) ) )
    {
        GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
        gImeUIData.hListCandMem[ dwIndex ] = NULL;
        goto exit2;
    }

    lpCandList = (LPCANDIDATELIST) lpStr;

    //
    // Reads in the corresponding candidate list.
    //

    ImmGetCandidateList( hIMC, dwIndex, lpCandList, bufLen );

    //
    // Determines how many candidate strings per page.
    //

    dwPreferNumPerPage = ( !lpCandList->dwPageSize ) ?
                         DEFAULT_CAND_NUM_PER_PAGE :
                         lpCandList->dwPageSize;
    //
    // Determining maximum character length  the list box
    // will display by loopping through all candidate strings.
    //

    for( i = 0; i < lpCandList->dwCount; i++ )
    {
        //
        // Get the pointer to i-th candidate string.
        //

        lpStr = (LPSTR)lpCandList +
                lpCandList->dwOffset[ i ];

        width = ( width < lstrlen( lpStr ) ) ? lstrlen( lpStr ) :
                  width;
    }

    GetWindowRect( gImeUIData.hListCand[ dwIndex ] , &rect);

    SetWindowPos( gImeUIData.hListCand[ dwIndex ],
              hwnd,
              rect.left,
              rect.top,
              ( width ) * cxMetrics + 10,
              (int)(dwPreferNumPerPage) * cyMetrics + 5,
              SWP_NOZORDER | SWP_NOACTIVATE );

    DisplayCandStrings( gImeUIData.hListCand[ dwIndex ], lpCandList );

    GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );

exit2:

    return;

}

void ImeUIClearData ( HWND hwnd )

Definition at line 1236 of file ImeUI.C.

{

    RECT            rect;
    int             i;

    SetWindowText( hwnd, szSteTitle );

    //
    // If user switches to other IME, here we destroy all candidate
    // windows which has been opened and erase all composition
    // chars if any.
    //

    for( i = 0; i < MAX_LISTCAND; i++ )
    {
        if ( gImeUIData.hListCand[ i ] )
        {
            //
            // The i-th candidate list has already been displayed,
            // destroy it and free memory which stores candidate
            // strings.
            //

            DestroyWindow( gImeUIData.hListCand[ i] );
            GlobalFree( gImeUIData.hListCandMem[ i ] );

            gImeUIData.hListCand[ i ] =
            gImeUIData.hListCandMem[ i ] = NULL;

        }
    }

    //
    // Update client area.
    //

    GetClientRect( hwnd, &rect );

    InvalidateRect( hwnd, &rect, FALSE );

    //
    // Reset IMEUI's global data.
    //

    gImeUIData.uCompLen = gImeUIData.ImeState = 0;

    //
    // Reset caret to the original position.
    //

    HideCaret( hwnd );
    ResetCaret( hwnd );
    ShowCaret( hwnd );

}

void ImeUICloseCandidate | ( | HWND | hwnd,
 |  | LPARAM | CandList
 | ) |  |

Definition at line 558 of file ImeUI.C.

{
    int index;

    //
    // Change window's caption title to normal.
    //

    SetWindowText( hwnd, szSteCompTitle );

    //
    // If the i-th bit on of CandList that means the i-th
    // candidate list should be closed.
    //

    for( index = 0; index < MAX_LISTCAND; index ++ )
    {
        if (( CandList & ( 1 << index ) ) && gImeUIData.hListCand[ index ])
        {

            //
            // Destroy the candidate window.
            //

            DestroyWindow( gImeUIData.hListCand[ index ] );

            gImeUIData.hListCand[ index ] = NULL;

            //
            // Free memory.
            //

            GlobalFree( gImeUIData.hListCandMem[ index ] );

            gImeUIData.hListCandMem[ index ] = NULL;

        }
    }

    gImeUIData.ImeState &= ~IME_IN_CHOSECAND;

}

void ImeUIComposition | ( | HWND | hwnd,
 |  | WPARAM | wParam,
 |  | LPARAM | CompFlag
 | ) |  |

Definition at line 49 of file ImeUI.C.

{

    if ( CompFlag & GCS_RESULTSTR )
    {
         GetResultStr( hwnd );
    }
    else
    {
        if ( CompFlag & GCS_COMPSTR )
        {
            GetCompositionStr( hwnd, CompFlag );
        }
    }

}

void ImeUIEndComposition ( HWND hwnd )

Definition at line 288 of file ImeUI.C.

{

    RECT rect = {0};

    //
    // Change caption title to normal
    //

    SetWindowText( hwnd, szSteTitle );

    //
    // Update client area.
    //

    GetClientRect( hwnd, &rect );

    InvalidateRect( hwnd, &rect, FALSE );

    //
    // Reset the length of composition string to zero.
    //

    gImeUIData.uCompLen = 0;

    gImeUIData.ImeState &= ~IME_IN_COMPOSITION;

}

void ImeUIMoveCandWin ( HWND hwnd )

Definition at line 1188 of file ImeUI.C.

{

    if ( gImeUIData.ImeState & IME_IN_CHOSECAND )
    {
        POINT point;          // Storage for caret position.
        int   i;              // loop counter.
        int   NumCandWin;     // Storage for num of cand win.
        RECT  rect;           // Storage for client rect.

        //
        // If current IME state is in chosing candidate, here we
        // move all candidate windows, if any, to the appropriate
        // position based on the parent window's position.
        //

        NumCandWin = 0;

        GetCaretPos( &point );
        ClientToScreen( hwnd, &point );

        for ( i = 0; i < MAX_LISTCAND ; i++ )
        {
            if ( gImeUIData.hListCand[ i ] )
            {
                GetClientRect( gImeUIData.hListCand[ i ], &rect );

                MoveWindow( gImeUIData.hListCand[ i ],
                            point.x + X_INDENT * NumCandWin,
                            point.y + Y_INDENT * NumCandWin + cyMetrics,
                            ( rect.right - rect.left + 1 ),
                            ( rect.bottom - rect.top + 1 ), TRUE );

                NumCandWin++;
            }
        }
    }
}

BOOL ImeUINotify | ( | HWND | hwnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 325 of file ImeUI.C.

{
    switch (wParam )
    {
        case IMN_OPENCANDIDATE:

            ImeUIOpenCandidate( hwnd, lParam );
            break;

        case IMN_CLOSECANDIDATE:

            ImeUICloseCandidate( hwnd, lParam );
            break;

        case IMN_CHANGECANDIDATE:

            ImeUIChangeCandidate( hwnd, lParam );
            break;

        case IMN_SETOPENSTATUS:

            ImeUISetOpenStatus( hwnd );
            break;

  default:
      return FALSE;

    }

    return TRUE;
}

void ImeUIOpenCandidate | ( | HWND | hwnd,
 |  | LPARAM | CandList
 | ) |  |

Definition at line 368 of file ImeUI.C.

{
    HIMC            hIMC;               // Input context handle.
    LPCANDIDATELIST lpCandList;         // Storage for LP to candidate list.
    CANDIDATELIST   tempCandList;       // Storage for LP to candidate list.
    DWORD           bufLen;           // Storage for candidate strings.
    LPSTR           lpStr;              // Storage for LP to a string.
    DWORD           dwIndex;            // Storage for index of ListCand array
    DWORD           i;                  // Loop count.
    int             width = 0;          // Storage for width of listCand
    int             CurNumCandList = 0; // Storage for number of cand. lists.
    DWORD           dwPreferNumPerPage; // Storage for PreferNumPerPage
    POINT           point;              // Storage for caret position.

    //
    // If fail to get input context handle, do nothing.
    //

    if ( ! (hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // Change caption title to DBCS candidate mode.
    //

    SetWindowText( hwnd, szSteCandTitle );

    //
    // Find out how many candidate windows have already been opened.
    //

    for( i = 0; i < MAX_LISTCAND; i++ )
    {
        if ( gImeUIData.hListCand[ i ] )
        {
            CurNumCandList++;
        }
    }

    //
    // Check which candidate lists should be displayed by loopping
    // through all possible candidate lists.
    //

    for( dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ )
    {

        if ( CandList & ( 1 << dwIndex ) )
        {
            //
            // The dwIndex-th candidate list contains candidate strings.
            // So here we want to display them.
            //

            //
            // Determines how musch memory space should be allocated to
            // read in the corresponding candidate list .
            //

            if ( ! ( bufLen = ImmGetCandidateList( hIMC, dwIndex, &tempCandList, 0 ) ) )
                goto exit2;

            //
            // Allocate memory space.
            //

            if( !( gImeUIData.hListCandMem[ dwIndex ]  =
                   GlobalAlloc( LPTR, (int)bufLen ) ) )
                goto exit2;

            if( !( lpStr =
                 (LPSTR)GlobalLock( gImeUIData.hListCandMem[ dwIndex ] ) ) )
            {
                GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
                gImeUIData.hListCandMem[ dwIndex ] = NULL;
                goto exit2;
            }

            lpCandList = (LPCANDIDATELIST) lpStr;

            //
            // Reads in the corresponding candidate list.
            //

            ImmGetCandidateList( hIMC, dwIndex, lpCandList, bufLen );

            //
            // Get current caret position.
            //

            GetCaretPos( (POINT *)&point );
            ClientToScreen( hwnd, &point );

            //
            // Determines how many candidate strings per page.
            //

            dwPreferNumPerPage = ( !lpCandList->dwPageSize ) ?
                                 DEFAULT_CAND_NUM_PER_PAGE :
                                 lpCandList->dwPageSize;
            //
            // Determining maximum character length the list box
            // will display by loopping through all candidate strings.
            //

            for( i = 0; i < lpCandList->dwCount; i++ )
            {
                //
                // Get the pointer to i-th candidate string.
                //

                lpStr = (LPSTR)lpCandList +
                        lpCandList->dwOffset[ i ];

                width = ( width < lstrlen( lpStr ) ) ? lstrlen( lpStr ) : width;

            }

            //
            // Create a candidate window for the candidate list.
            //

            gImeUIData.hListCand[ dwIndex ] =
                   CreateWindow( szCandClass,
                                 NULL,
                                 WS_BORDER | WS_POPUP | WS_DISABLED,
                                 CurNumCandList * X_INDENT + point.x,
                                 CurNumCandList * Y_INDENT +
                                     point.y + cyMetrics,
                                 ( width ) * cxMetrics + 10,
                                 (int)(dwPreferNumPerPage) * cyMetrics + 5,
                                 hwnd,
                                 NULL,
                                 (HANDLE)GetWindowLongPtr( hwnd, GWLP_HINSTANCE ),
                                 NULL );
            //
            // If fail to create the candidate window then do nothing.
            //

            if ( gImeUIData.hListCand[ dwIndex ] < 0 )
            {
                GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );
                GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
                goto exit2;
            }

            //
            // Show candidate window.
            //

            ShowWindow( gImeUIData.hListCand[ dwIndex ], SW_SHOWNOACTIVATE );

            //
            // Display candidate strings.
            //

            DisplayCandStrings( gImeUIData.hListCand[ dwIndex ], lpCandList );

            GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );

            CurNumCandList++;
        }
    }

    //
    // Reset IME state.
    //

    gImeUIData.ImeState |= IME_IN_CHOSECAND;

exit2:

    ImmReleaseContext( hwnd, hIMC );

}

void ImeUISetOpenStatus ( HWND hwnd )

Definition at line 737 of file ImeUI.C.

{
    int  i;       // Lopp counter
    HIMC hIMC;    // Storage for input context handle.

    //
    // If fail to get input context handle then do nothing
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    if ( ImmGetOpenStatus( hIMC ) )
    {

        //
        // If the IME conversion engine is open, here we change
        // window's caption title to DBCS composition mode.
        //

        SetWindowText( hwnd, (LPSTR)szSteCompTitle );
    }
    else
    {
        RECT rect = {0};

        //
        // If the IME conversion engine is closed, here we
        // erase all already displayed composition chars if any,
        // change the window's caption title to normal.
        //

        GetClientRect( hwnd, &rect );
        InvalidateRect( hwnd, &rect, FALSE );

        SetWindowText( hwnd, (LPSTR)szSteTitle );

        //
        // Here we close and destroy all of candidate windows
        // if IME conversion engine is closed.
        //

        for( i = 0; i <= MAX_LISTCAND; i++ )
        {
            if ( gImeUIData.hListCand[ i ] )
            {
                DestroyWindow( gImeUIData.hListCand[ i ] );
                gImeUIData.hListCand[ i ] = NULL;
                GlobalFree( gImeUIData.hListCandMem[ i ] );
                gImeUIData.hListCandMem[ i ] = NULL;
            }
        }

        //
        // Reset IMEUI's global data.
        //

        gImeUIData.uCompLen = 0;
        gImeUIData.ImeState = 0;

        ResetCaret( hwnd );

    }

    ImmReleaseContext( hwnd, hIMC );
}

void ImeUIStartComposition ( HWND hwnd )

Definition at line 18 of file ImeUI.C.

{

    //
    // Change caption title to DBCS composition mode.
    //

    SetWindowText( hwnd, szSteCompTitle );

    //
    // Reset global variables.
    //

    gImeUIData.uCompLen = 0;             // length of composition string.

    gImeUIData.ImeState |= IME_IN_COMPOSITION;
}

void RestoreImeUI ( HWND hwnd )

Definition at line 1066 of file ImeUI.C.

{
    HIMC        hIMC;           // Storage for input context handle.
    LONG        bufLen;         //

    //
    // If fail to get input context handle then do nothing.
    //

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        return;

    //
    // If IME conversion engine is open and there are any composition
    // string in the context then we redisplay them.
    //

    if ( ImmGetOpenStatus( hIMC ) && gImeUIData.ImeState &&
         ( bufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR,
                      (void *)NULL, 0l ) ) > 0 )
    {
        LPSTR  lpCompStr;            // Pointer to composition string
        HLOCAL hMem;                 // Storage for memory handle.
        LPSTR  lpCompStrAttr = NULL; // Pointer to composition string's attribute
        LONG   bufLenAttr;           //
        HLOCAL hMemAttr = NULL;      // Memory handle for composition string's
                                     // attributes.

        //
        // If fail to allocate and lock memory space for reading in
        // the composition string then do nothing.
        //

        if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
            goto exit2;

        if( !( lpCompStr = (LPSTR) LocalLock( hMem ) ) )
        {
            LocalFree( hMem );
            goto exit2;
        }

        //
        // Get composition string and redisplay them.
        //

        if ( ImmGetCompositionString( hIMC, GCS_COMPSTR, lpCompStr,
                                      bufLen ) > 0 )
        {

            //
            // Make sure whether we need to handle composition string's
            // attributes.
            //

            if ( ( bufLenAttr = ( ImmGetCompositionString( hIMC,
                       GCS_COMPATTR, (void FAR*)NULL, 0l ) ) ) > 0 )
            {
                //
                // If fail to allocate and lock memory space for reading in
                // the composition string's attribute then we assume
                // no attribute array.
                //

                if ( !( hMemAttr = LocalAlloc(LPTR, (int)bufLenAttr + 1 )))
                    goto nothing;

                if ( !( lpCompStrAttr = (LPSTR) LocalLock( hMemAttr ) ) )
                {
                    LocalFree( hMemAttr );
                    goto nothing;
                }

                ImmGetCompositionString( hIMC, GCS_COMPATTR, lpCompStrAttr,
                                         bufLenAttr );

                lpCompStrAttr[ bufLenAttr ] = 0;
            }
            else
            {
nothing:
                lpCompStrAttr = NULL;
            }

            lpCompStr[ bufLen ] = 0;

            DisplayCompString( hwnd, lpCompStr, lpCompStrAttr );

        }

        LocalUnlock( hMem );
        LocalFree( hMem );

        if ( lpCompStrAttr )
        {
            if (NULL != hMemAttr)
            {
                LocalUnlock( hMemAttr );
                LocalFree( hMemAttr );
            }
        }

    }

exit2:

    ImmReleaseContext( hwnd, hIMC );

}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/Main.C File Reference

  • WinUI
  • Input
  • Ime
  • FullIME
Functions

Main.C File Reference

#include <assert.h>
#include <windows.h>
#include <imm.h>
#include "FullIME.h"

Go to the source code of this file.

Functions

void | CharHandler (HWND hWnd, WORD wParam)
void | InputChangeHandler (HWND hWnd)
BOOL | IsDBCSTrailByte (char *base, char *p)
void | MouseHandler (HWND hWnd, LONG lParam)
BOOL | MoveCaret (HWND hwnd)
void | ResetCaret (HWND hWnd)
void | SetIMECompFormPos (HWND hWnd)
void | SteCommand (HWND hWnd, UINT cmd, LPARAM lParam)
void | SteCreate (HWND hWnd)
void | SteImeOpenClose (HWND hWnd, BOOL fFlag)
int | SteRegister (HANDLE hInstance)
int WINAPI | SteWndProc (HWND hWnd, UINT msg, UINT wParam, LONG lParam)
void | StoreChar (HWND hWnd, UCHAR ch)
void | StoreDBCSChar (HWND hWnd, WORD ch)
void | VirtualKeyHandler (HWND hWnd, UINT wParam)
int PASCAL | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)

Function Documentation

void CharHandler | ( | HWND | hWnd,
 |  | WORD | wParam
 | ) |  |

Definition at line 869 of file Main.C.

{
    unsigned char ch = (unsigned char)wParam;

    //
    // Because DBCS characters are usually generated by IMEs (as two
    // PostMessages), if a lead byte comes in, the trail byte should
    // arrive very soon after.  We wait here for the trail byte and
    // store them into the text buffer together.

    if ( IsDBCSLeadByte( ch ) )
    {
      //
      // Wait an arbitrary amount of time for the trail byte to
      // arrive.  If it doesn't, then discard the lead byte.
      //
      // This could happen if the IME screwed up.  Or, more likely,
      // the user generated the lead byte through ALT-numpad.
      //

        MSG msg = {0};
        int i = 10;

        while (!PeekMessage((LPMSG)&msg, hWnd, WM_CHAR, WM_CHAR, PM_REMOVE))
        {
            if ( --i == 0 )
                return;
            Yield();
        }

        StoreDBCSChar( hWnd,  (WORD)(((unsigned)(msg.wParam)<<8) | (unsigned)ch ));
    }
    else
    {
        switch( ch )
        {
            case '\r':
            case '\t':
            case '\b':
                //
                // Throw away.  Already handled at WM_KEYDOWN time.
                //
                break;

            default:
                StoreChar( hWnd, ch );
                break;
        }
    }
}

void InputChangeHandler ( HWND hWnd )

Definition at line 974 of file Main.C.

{
    HIMC hIMC;

    //
    // If the old keyboard layout is IME, the ime ui data have to be free.
    //

    if (ImmIsIME(hCurKL))
    {
        //
        // If application prefers to use near caret provded by IME, or
        // IME provides special UI, then no need to clean UD data.
        //
        if ( gImeUIData.fdwProperty & IME_PROP_SPECIAL_UI )
            ;
        else if ( gImeUIData.fdwProperty & IME_PROP_AT_CARET )
            ImeUIClearData(hWnd);
        else
            ;
    }

    //
    // Set new keyboard layout.
    //
    hCurKL = GetKeyboardLayout(0L);

    //
    // Get new property.
    //
    gImeUIData.fdwProperty = ImmGetProperty( hCurKL, IGP_PROPERTY );

    // if this application set the candidate position, it need to set
    // it to default for the near caret IME

    if ( hIMC = ImmGetContext( hWnd ) )
    {
        UINT i;

        for (i = 0; i < 4; i++)
        {
            CANDIDATEFORM CandForm;

            if ( gImeUIData.fdwProperty & IME_PROP_AT_CARET )
            {
                CandForm.dwIndex = i;
                CandForm.dwStyle = CFS_CANDIDATEPOS;

#if 0
                // This application dooes not want to set candidate window
                // to any position. If an application need to set the
                // candidate position, it should remove the if 0 code

                // the position you want to set
                CandForm.ptCurrentPos.x = ptAppWantPosition[i].x;
                CandForm.ptCurrentPos.y = ptAppWantPosition[i].y;

                ImmSetCandidateWindow( hIMC, &CandForm );
#endif
            }
            else
            {
                if ( !ImmGetCandidateWindow( hIMC, i, &CandForm ) )
                {
                    continue;
                }

                if ( CandForm.dwStyle == CFS_DEFAULT )
                {
                    continue;
                }

                CandForm.dwStyle = CFS_DEFAULT;
                ImmSetCandidateWindow( hIMC, &CandForm );
            }
        }

        ImmReleaseContext( hWnd, hIMC );
    }

    return;
}

BOOL IsDBCSTrailByte | ( | char * | base,
 |  | char * | p
 | ) |  |

Definition at line 495 of file Main.C.

{
    int lbc = 0;    // lead byte count

    assert(base <= p);

    while ( p > base )
    {
        if ( !IsDBCSLeadByte(*(--p)) )
            break;
        lbc++;
    }

    return (lbc & 1);
}

void MouseHandler | ( | HWND | hWnd,
 |  | LONG | lParam
 | ) |  |

Definition at line 928 of file Main.C.

{

    if ( ( gImeUIData.ImeState & IME_IN_CHOSECAND ) ||
         ( gImeUIData.ImeState & IME_IN_COMPOSITION && !MoveCaret( hWnd ) ) )
        return;

    HideCaret( hWnd );

    //
    // Calculate caret position based on fixed pitched font
    //
    yPos = MAKEPOINTS(lParam).y / cyMetrics;
    xPos = MAKEPOINTS(lParam).x / cxMetrics;

    //
    // Adjust caret position if click landed on a trail byte
    //
    if ( IsDBCSTrailByte( (LPSTR)textbuf[yPos], (LPSTR)&(textbuf[yPos][xPos]) ) )
    {
        //
        // If click landed on the last quarter of the DBCS character,
        // assume the user was aiming at the next character.
        //
        if ( (MAKEPOINTS(lParam).x - xPos * cxMetrics) > (cxMetrics / 2) )
            xPos++;
        else
            xPos--;
    }

    DestroyCaret();
    CreateCaret(hWnd, NULL,
                (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ? CaretWidth*2 : CaretWidth,
                cyMetrics );
    SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
    ShowCaret( hWnd );
}

BOOL MoveCaret ( HWND hwnd )

Definition at line 519 of file Main.C.

{
    HIMC hIMC;
    BOOL retVal = TRUE;

    if ( !( hIMC = ImmGetContext( hwnd ) ) )
        goto exit_func;

    if ( ImmGetCompositionString( hIMC, GCS_CURSORPOS, (void *)NULL, 0 ) )
        retVal = FALSE;

    ImmReleaseContext( hwnd, hIMC );

exit_func:
    return retVal;
}

void ResetCaret ( HWND hWnd )

Definition at line 372 of file Main.C.

{
    HideCaret( hWnd );
    DestroyCaret();
    CreateCaret( hWnd,
                 NULL,
                 (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
                 CaretWidth*2 : CaretWidth,
                 cyMetrics );
    SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );

    if ( !( gImeUIData.fdwProperty & IME_PROP_AT_CARET ) &&
         !( gImeUIData.fdwProperty & IME_PROP_SPECIAL_UI ) )
    {
        // near caret.
        SetIMECompFormPos( hWnd );
    }

    ShowCaret( hWnd );
}

void SetIMECompFormPos ( HWND hWnd )

Definition at line 399 of file Main.C.

{
    HIMC hIMC = ImmGetContext(hWnd);
    POINT point = {0};
    COMPOSITIONFORM CompForm;

    GetCaretPos( &point );

    CompForm.dwStyle = CFS_POINT;

    CompForm.ptCurrentPos.x = (long) point.x;
    CompForm.ptCurrentPos.y = (long) point.y;

    if ( hIMC )
        ImmSetCompositionWindow(hIMC,&CompForm);
    ImmReleaseContext( hWnd , hIMC);
}

void SteCommand | ( | HWND | hWnd,
 |  | UINT | cmd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 424 of file Main.C.

{
    switch( cmd )
    {
    case IDC_CLEAR:
        //
        // Blank out text buffer.  Return caret to home position
        //
        for ( yPos = FIRSTROW; yPos <= LASTROW; yPos++ )
            for ( xPos = FIRSTCOL; xPos <= LASTCOL; xPos++ )
          textbuf[yPos][xPos] = ' ';
        break;

    case IDC_ANSIFILL: /* fall through */
    case IDC_DBCSFILL:
        //
        // Fill text buffer with ANSI or DBCS pattern
        //
        for ( yPos = FIRSTROW; yPos <= LASTROW; yPos++ )
            for ( xPos = FIRSTCOL; xPos <= LASTCOL; xPos++ )
          if ( cmd == IDC_ANSIFILL )
              textbuf[yPos][xPos] = 'a';
          else {
              textbuf[yPos][xPos]   = HIBYTE(DBCSFillChar);
              textbuf[yPos][++xPos] = LOBYTE(DBCSFillChar);
          }
        break;

    //
    // The following messages are to control IME.
    //
    case IDC_OPENIME:
        SteImeOpenClose( hWnd, TRUE );
        goto exit_func;

    case IDC_CLOSEIME:
        SteImeOpenClose( hWnd, FALSE );
        goto exit_func;

    }

    yPos = FIRSTROW;
    xPos = FIRSTCOL;

    InvalidateRect( hWnd, (LPRECT)NULL, TRUE );
    ResetCaret(hWnd);

exit_func:
    return;
}

void SteCreate ( HWND hWnd )

Definition at line 247 of file Main.C.

{
    HDC        hdc;
    TEXTMETRIC tm = {0};
    int        i;
    WORD       patern = 0xA4A4;
    SIZE       size;
    HFONT      hFont;
    LOGFONT    lFont = {0};

    //
    // Note that this window has a class DC
    //

    hdc = GetDC( hWnd );

    //
    // Select fixed pitch system font and get its text metrics
    //

    hfntFixed = GetStockObject( SYSTEM_FIXED_FONT );
    hfntOld = SelectObject( hdc, hfntFixed );
    GetTextMetrics( hdc, &tm );
    ReleaseDC( hWnd, hdc );

    GetTextExtentPoint( hdc, (LPSTR)&patern, sizeof( WORD), (LPSIZE) &size );

//    cxMetrics = tm.tmAveCharWidth;
//    cyMetrics = tm.tmHeight;

    cxMetrics = (UINT) size.cx / 2;
    cyMetrics = (UINT) size.cy;

    //
    // Determine the version of DBCS Windows from system font charset ID.
    // Then hardcode a DBCS character value for the 'Pattern/DBCS' command.
    // The value is the Han character for 'door' or 'gate', which is
    // left-right symmetrical.
    //

    switch( tm.tmCharSet )
    {
    case SHIFTJIS_CHARSET:
        DBCSFillChar = 0x96e5;
        break;

    case HANGEUL_CHARSET:
        DBCSFillChar = 0xdaa6;
        break;

    case CHINESEBIG5_CHARSET:
        DBCSFillChar = 0xaaf9;
        break;

    default:
        DBCSFillChar = 0x7071;  // 'pq'
        break;
    }

    //
    // Initialize caret width.  Fat in INSERT mode, skinny in OVERTYPE mode.
    //

    fInsertMode = FALSE;
    CaretWidth = cxOverTypeCaret = GetSystemMetrics( SM_CXBORDER );

    //
    // Sets the logical font to be used to display characters in the
    // composition window. Especially for at caret or near caret operation,
    // application should set composition font.
    //
    // If Application provides user to dynamicly change font, each time after
    // user change font, application should set composition font again.
    //

    if ( ( hFont = (HFONT)SendMessage( hWnd, WM_GETFONT, 0, 0L ) ) != NULL )
    {
        if ( GetObject( hFont, sizeof(LOGFONT), (LPVOID)&lFont ) )
        {
            HIMC  hImc;

            if ( (  hImc = ImmGetContext( hWnd ) ) )
            {
                ImmSetCompositionFont( hImc, &lFont );
                ImmReleaseContext( hWnd, hImc );
            }
        }
    }

    //
    // Get the property and apiabilities of current keyboard layout(IME).
    // If the keyboard layout is US, the return value will be zero.
    //

    gImeUIData.fdwProperty = ImmGetProperty( GetKeyboardLayout(0),
                                             IGP_PROPERTY );

    //
    // Initialize candidate list window array.
    //

    for( i = 0; i < MAX_LISTCAND; i++ )
    {
         gImeUIData.hListCand[ i ] = NULL;
         gImeUIData.hListCandMem[ i ] = NULL;
    }

    PostMessage( hWnd, WM_COMMAND, IDC_CLEAR, 0L );

    //
    // Initialise the current keyboard layout.
    //

    hCurKL = GetKeyboardLayout(0L);
}

void SteImeOpenClose | ( | HWND | hWnd,
 |  | BOOL | fFlag
 | ) |  |

Definition at line 224 of file Main.C.

{
  HIMC hIMC;

  //
  // If fFlag is true then open IME; otherwise close it.
  //

    if ( !( hIMC = ImmGetContext( hWnd ) ) )
        return;

    ImmSetOpenStatus( hIMC, fFlag );
    ImmReleaseContext( hWnd, hIMC );
}

int SteRegister ( HANDLE hInstance )

Definition at line 82 of file Main.C.

{
    BOOL bSuccess = TRUE;
    int WINAPI SteWndProc( HWND, UINT, UINT, LONG );

    PWNDCLASS pWndClass;

    pWndClass=(PWNDCLASS)LocalAlloc(LPTR, sizeof(WNDCLASS));
    if (NULL == pWndClass)
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    pWndClass->hCursor       = LoadCursor( NULL, IDC_IBEAM );
    pWndClass->hIcon         = LoadIcon( hInstance, MAKEINTRESOURCE(ID_ICON));
    pWndClass->lpszMenuName  = MAKEINTRESOURCE(ID_MENU);
    pWndClass->hInstance     = hInstance;
    pWndClass->lpszClassName = szSteClass;
    pWndClass->lpfnWndProc   = (WNDPROC)SteWndProc;
    pWndClass->hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    pWndClass->style         = CS_BYTEALIGNCLIENT | CS_CLASSDC;

    if ( 0 == RegisterClass( (LPWNDCLASS)pWndClass ) )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    pWndClass->hCursor       = LoadCursor( NULL,IDC_ARROW );
    pWndClass->hIcon         = NULL;
    pWndClass->lpszMenuName  = NULL;
    pWndClass->hInstance     = hInstance;
    pWndClass->lpszClassName = szCandClass;
    pWndClass->lpfnWndProc   = (WNDPROC)CandWndProc;
    pWndClass->hbrBackground = GetStockObject( LTGRAY_BRUSH );
    pWndClass->style         = CS_HREDRAW | CS_VREDRAW;

    if ( 0 == RegisterClass( (LPWNDCLASS)pWndClass ) )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if ( NULL != LocalFree( (HANDLE)pWndClass ) )
    {
        bSuccess = FALSE;
    }

exit_func:
    return bSuccess;
}

int WINAPI SteWndProc | ( | HWND | hWnd,
 |  | UINT | msg,
 |  | UINT | wParam,
 |  | LONG | lParam
 | ) |  |

Definition at line 1064 of file Main.C.

{
    int i;
    HDC hdc;
    PAINTSTRUCT ps = {0};

    switch( msg )
    {
    case WM_CREATE:
        SteCreate( hWnd );
        break;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;

    case WM_CLOSE:
        DestroyWindow( hWnd );
        break;

    case WM_SETFOCUS:
        CreateCaret( hWnd, NULL,
                     (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
                         CaretWidth*2 : CaretWidth,
                     cyMetrics );
        SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
        ShowCaret( hWnd );
        break;

    case WM_KILLFOCUS:
        HideCaret( hWnd );
        DestroyCaret();
        break;

    case WM_IME_KEYDOWN: /* fall-through */
    case WM_KEYDOWN:
        VirtualKeyHandler( hWnd, wParam );
        break;

    case WM_KEYUP:
        break;

    case WM_CHAR:
        CharHandler( hWnd, (WORD)wParam );
        break;

    case WM_LBUTTONDOWN:
        MouseHandler( hWnd, lParam );
        break;

    case WM_MOVE:
        ImeUIMoveCandWin( hWnd );
        break;

    case WM_COMMAND:
        SteCommand( hWnd, wParam, lParam );
        break;

    case WM_PAINT:
        InvalidateRect(hWnd,NULL,FALSE);  //for repaint allignment problem??
              // WinChi3.0
        hdc = BeginPaint( hWnd, &ps );

        //
        // Refresh display from text buffer
        //
        for ( i = FIRSTROW; i <= LASTROW; i++ )
            TextOut( hdc, 0, i*cyMetrics, (LPSTR)textbuf[i], MAXCOL );

        EndPaint( hWnd, &ps );
        RestoreImeUI( hWnd );
        break;

    case WM_INPUTLANGCHANGE:
        InputChangeHandler( hWnd );
        goto call_defwinproc;
        break;

    case WM_IME_SETCONTEXT:
        //
        // The application have to pass WM_IME_SETCONTEXT to DefWindowProc.
        // When the application want to handle the IME at the timing of
        // focus changing, the application should use WM_SETFOCUS or
        // WM_KILLFOCUS.
        //

        if ( gImeUIData.fdwProperty & IME_PROP_SPECIAL_UI )
        {
            goto call_defwinproc;
        }
        else if ( gImeUIData.fdwProperty & IME_PROP_AT_CARET )
        {
            //
            // application wants to draw UI ny itself.
            //
            lParam &= ~(ISC_SHOWUICOMPOSITIONWINDOW | ISC_SHOWUIALLCANDIDATEWINDOW);
        }
        goto call_defwinproc;

    case WM_IME_STARTCOMPOSITION:
        //
        // CheckProperty is a macro, if IME already provides near caret or
        // special UI then let IME handle this message.
        //
        CheckProperty;
        ImeUIStartComposition( hWnd );
        break;

    case WM_IME_COMPOSITION:
        CheckProperty;
        ImeUIComposition( hWnd, wParam, lParam );
        break;

    case WM_IME_ENDCOMPOSITION:
        CheckProperty;
        ImeUIEndComposition( hWnd );
        break;

    case WM_IME_COMPOSITIONFULL:
        //
        // Make sure the size for drawing the composition string.
        // Application should draw the composition string correctly.
        //
        break;

    case WM_IME_NOTIFY:
        CheckProperty;
        if ( !ImeUINotify( hWnd, wParam, lParam ) )
            // This application does not handle all notification message.
            // So we pass those notification messages which are not hanlded
            // by this application to the DefWindowProc.
            goto call_defwinproc;
        break;

    case WM_IME_CONTROL:
        //
        // This message is not received by the application window.
        // But don't pass it to DefWindowProc().
        //
        break;

    default:

call_defwinproc:
        return (int)DefWindowProc( hWnd, msg, wParam, lParam );
    }

    return 0;
}

void StoreChar | ( | HWND | hWnd,
 |  | UCHAR | ch
 | ) |  |

Definition at line 708 of file Main.C.

{
    int i;
    HDC hdc;

    //
    // If insert mode, move rest of line to the right by one
    //

    if ( fInsertMode )
    {
      for ( i = LASTCOL; i > xPos; i-- )
          textbuf[yPos][i] = textbuf[yPos][i-1];

      //
      // If the row ends on a lead byte, blank it out
      // To do this we must first traverse the string
      // starting from a known character boundry until
      // we reach the last column. If the last column
      // is a character boundry then the last character
      // is either a single byte or a lead byte
      //
        for ( i = xPos+1; i < LASTCOL; )
        {
            if ( IsDBCSLeadByte( textbuf[yPos][i] ) )
            {
                i++;
            }
            i++;
      }

        if (i==LASTCOL)
            if ( IsDBCSLeadByte( textbuf[yPos][LASTCOL] ) )
                textbuf[yPos][LASTCOL] = ' ';
    }
    else
    {  // overtype mode
      if ( IsDBCSLeadByte( textbuf[yPos][xPos] ) )

          //
          // Blank out trail byte
          //
          textbuf[yPos][xPos+1] = ' ';

          //
          // or shift line left on character and blank last column
          //
          // for ( i = xPos+1; i < LASTCOL; i++ )
          //     textbuf[yPos][i] = textbuf[yPos][i+1];
          // textbuf[yPos][LASTCOL] = ' ';
    }

    //
    // Store input character at current caret position
    //
    textbuf[yPos][xPos] = ch;

    //
    // Display input character.
    //
    hdc = GetDC( hWnd );
    HideCaret( hWnd );
    TextOut( hdc, xPos*cxMetrics, yPos*cyMetrics,
             (LPSTR)&(textbuf[yPos][xPos]), MAXCOL-xPos );
    ShowCaret( hWnd );
    ReleaseDC( hWnd, hdc );

    SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
}

void StoreDBCSChar | ( | HWND | hWnd,
 |  | WORD | ch
 | ) |  |

Definition at line 788 of file Main.C.

{
    int i;
    HDC hdc;

    //
    // If there is no room for a DBCS character, discard it
    //
    if ( xPos == LASTCOL )
        return;

    //
    // If insert mode, move rest of line to the right by two
    //

    if ( fInsertMode )
    {
        for ( i = LASTCOL; i > xPos+1; i-- )
          textbuf[yPos][i] = textbuf[yPos][i-2];

      //
      // If the row ends on a lead byte, blank it out
      // To do this we must first traverse the string
      // starting from a known charcter boundry until
      // we reach the last column. If the last column
      // is not a trail byte then it is a single byte
      // or a lead byte
      //

        for ( i = xPos+2; i < LASTCOL; )
        {
            if ( IsDBCSLeadByte( textbuf[yPos][i] ) )
                i++;
            i++;
      }

        if (i==LASTCOL)
            if (IsDBCSLeadByte( textbuf[yPos][LASTCOL] ) )
                textbuf[yPos][LASTCOL] = ' ';
    }
    else
    {  // overtype mode
      if ( !IsDBCSLeadByte( textbuf[yPos][xPos] ) )

        //
        // Overtyping the current byte, plus the following byte,
        // which could be a lead byte.
        //

        if ( IsDBCSLeadByte( textbuf[yPos][xPos+1] ) )
            textbuf[yPos][xPos+2] = ' ';
    }

    //
    // Store input character at current caret position
    //
    textbuf[yPos][xPos]   = LOBYTE(ch);     // lead byte
    textbuf[yPos][xPos+1] = HIBYTE(ch);     // trail byte

    //
    // Display input character.
    //

    hdc = GetDC( hWnd );
    HideCaret( hWnd );
    TextOut( hdc, xPos*cxMetrics, yPos*cyMetrics,
             (LPSTR)&(textbuf[yPos][xPos]), MAXCOL-xPos );
    ShowCaret( hWnd );
    ReleaseDC( hWnd, hdc );

    SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
}

void VirtualKeyHandler | ( | HWND | hWnd,
 |  | UINT | wParam
 | ) |  |

Definition at line 548 of file Main.C.

{
    int i;
    HDC hdc;
    static int delta = 1;

    if ( ( gImeUIData.ImeState & IME_IN_CHOSECAND ) ||
         ( gImeUIData.ImeState & IME_IN_COMPOSITION && !MoveCaret( hWnd ) ) )
        return;

    switch( wParam )
    {
    case VK_HOME:   // beginning of line
        xPos = FIRSTCOL;
        break;

    case VK_END:    // end of line
        xPos = LASTCOL;
        goto check_for_trailbyte;

    case VK_RIGHT:
        if ( IsDBCSLeadByte( textbuf[yPos][xPos] ) )
        {
            if (xPos==LASTCOL - 1) break;  //last character don't move
            xPos += 2;                     //skip 2 for DB Character
        }
        else
        {
            xPos = min( xPos + 1, LASTCOL );
        }
        break;

    case VK_LEFT:
        xPos = max( xPos - 1, FIRSTCOL );
check_for_trailbyte:
      if ( IsDBCSTrailByte( (LPSTR)textbuf[yPos], (LPSTR)&(textbuf[yPos][xPos]) ) )
          xPos--;
      break;

    case VK_UP:
        yPos = max( yPos - 1, FIRSTROW );
        goto Virtical_Check_Trail;

    case VK_DOWN:
        yPos = min( yPos + 1, LASTROW );
Virtical_Check_Trail:
        if ( IsDBCSTrailByte( (LPSTR)textbuf[yPos], (LPSTR)&(textbuf[yPos][xPos]) ) )
        {
            if (xPos<LASTCOL)
            {
                xPos+=delta;
                delta *= -1;
            }
            else
            {
                xPos--;
            }
        }
        break;

    case VK_INSERT:
        //
        // Change caret shape to indicate insert/overtype mode
        //
        fInsertMode = !fInsertMode;
        CaretWidth = fInsertMode ? cxMetrics : cxOverTypeCaret;
        break;

    case VK_BACK:   // backspace

        if ( xPos > FIRSTCOL )
        {
            xPos--;

            //
            // DB Character so backup one more to allign on boundary
            //
            if ( IsDBCSTrailByte( (LPSTR)textbuf[yPos], (LPSTR)&(textbuf[yPos][xPos]) ) )
          xPos--;
            //
            // Fall Through to VK_DELETE to adjust row
            //
        }
        else     //FIRST COLUMN  don't backup -- this would change for wrapping
        {
           break;
        }

    case VK_DELETE:

        if ( !IsDBCSLeadByte( textbuf[yPos][xPos] ) )
        {
            //
            // Move rest of line left by one, then blank out last character
            //
            for ( i = xPos; i < LASTCOL; i++ )
            {
                textbuf[yPos][i] = textbuf[yPos][i+1];
            }
            textbuf[yPos][LASTCOL] = ' ';

        }
        else
        {
            //
            // Move line left by two bytes, blank out last two bytes
            //
            for ( i = xPos; i < LASTCOL-1; i++ )
            {
              textbuf[yPos][i] = textbuf[yPos][i+2];
            }
            textbuf[yPos][LASTCOL-1] = ' ';
            textbuf[yPos][LASTCOL]   = ' ';
        }

        //
        // Repaint the entire line
        //
        hdc = GetDC( hWnd );
        HideCaret( hWnd );
        TextOut( hdc, 0, yPos*cyMetrics, (LPSTR)textbuf[yPos], MAXCOL );
        ReleaseDC( hWnd, hdc );
        break;

    case VK_TAB:    // tab  -- tabs are column allignment not character
        {
            int xTabMax = xPos + TABSTOP;
            int xPosPrev;

            do
            {
                xPosPrev = xPos;
                SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
            } while ( (xPos % TABSTOP) &&
                      (xPos < xTabMax) &&
                      (xPos != xPosPrev));

        }
        break;

    case VK_RETURN: // linefeed
        yPos = min( yPos+1, LASTROW );
        xPos = FIRSTCOL;
        break;
    }

    ResetCaret( hWnd );
}

int PASCAL WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 142 of file Main.C.

{
    MSG msg = {0};
    HWND hWnd = NULL;
    BOOL bRet;
    BOOL bSuccess = TRUE;

    LoadString( hInstance, IDS_CLASS, szSteClass, 14 );
    LoadString( hInstance, IDS_TITLE, szSteTitle, 55 );
    LoadString( hInstance, IDS_CANDUI, szSteCandUIClass, 12 );
    LoadString( hInstance, IDS_COMPTITLE, szSteCompTitle, 55 );
    LoadString( hInstance, IDS_CANDTITLE, szSteCandTitle, 55 );
    LoadString( hInstance, IDS_CANDCLASS, szCandClass, 20 );

    if ( !SteRegister( hInstance ) )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if ( !(hWnd = CreateWindow( szSteClass, szSteTitle,
                                WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
                                CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
                                NULL, NULL, hInstance, NULL)) )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    //
    // Create window with just enough client space for the text buffer
    //
    SetWindowPos( hWnd, 0, 0, 0,
                  MAXCOL*cxMetrics + GetSystemMetrics(SM_CXBORDER)*2,
                  MAXROW*cyMetrics + GetSystemMetrics(SM_CYBORDER)*2
                    + GetSystemMetrics(SM_CYCAPTION)
                    + GetSystemMetrics(SM_CYMENU),
                  SWP_NOZORDER );
    ShowWindow( hWnd, nCmdShow );

    //
    // IME initial state.
    //
    gImeUIData.ImeState = 0;

    while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
    {
        if (bRet == -1)
        {
            // handle the error and possibly exit
            bSuccess = FALSE;
            goto exit_func;
        }
        else
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

exit_func:
    if (bSuccess)
    {
        return (int)msg.wParam;
    }
    else
    {
        return 0;
    }
}

Generated on Wed Nov 13 2024 16:53:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/HalfIME/HalfIME.h File Reference

  • WinUI
  • Input
  • Ime
  • HalfIME
Defines

HalfIME.h File Reference

Go to the source code of this file.

Defines

#define | FIRSTCOL 0
#define | FIRSTROW 0
#define | ID_ICON 1
#define | ID_MENU 1
#define | IDC_ANSIFILL 2
#define | IDC_CLEAR 1
#define | IDC_CLOSEIME 8
#define | IDC_DBCSFILL 3
#define | IDC_DEFAULT_POS 4
#define | IDC_NEARCARET_POS 5
#define | IDC_OPENIME 7
#define | IDC_PREFER_POS 6
#define | IDS_CLASS 1
#define | IDS_TITLE 2
#define | LASTCOL (MAXCOL-1)
#define | LASTROW (MAXROW-1)
#define | MAXCOL 60
#define | MAXROW 12
#define | TABSTOP 4

Define Documentation

#define FIRSTCOL 0

Definition at line 4 of file HalfIME.h.

#define FIRSTROW 0

Definition at line 3 of file HalfIME.h.

#define ID_ICON 1

Definition at line 9 of file HalfIME.h.

#define ID_MENU 1

Definition at line 10 of file HalfIME.h.

#define IDC_ANSIFILL 2

Definition at line 15 of file HalfIME.h.

#define IDC_CLEAR 1

Definition at line 14 of file HalfIME.h.

#define IDC_CLOSEIME 8

Definition at line 21 of file HalfIME.h.

#define IDC_DBCSFILL 3

Definition at line 16 of file HalfIME.h.

#define IDC_DEFAULT_POS 4

Definition at line 17 of file HalfIME.h.

#define IDC_NEARCARET_POS 5

Definition at line 18 of file HalfIME.h.

#define IDC_OPENIME 7

Definition at line 20 of file HalfIME.h.

#define IDC_PREFER_POS 6

Definition at line 19 of file HalfIME.h.

#define IDS_CLASS 1

Definition at line 11 of file HalfIME.h.

#define IDS_TITLE 2

Definition at line 12 of file HalfIME.h.

#define LASTCOL (MAXCOL-1)

Definition at line 6 of file HalfIME.h.

#define LASTROW (MAXROW-1)

Definition at line 5 of file HalfIME.h.

#define MAXCOL 60

Definition at line 2 of file HalfIME.h.

#define MAXROW 12

Definition at line 1 of file HalfIME.h.

#define TABSTOP 4

Definition at line 7 of file HalfIME.h.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/HalfIME/Main.C File Reference

  • WinUI
  • Input
  • Ime
  • HalfIME
Functions | Variables

Main.C File Reference

#include <assert.h>
#include <windows.h>
#include <imm.h>
#include "halfime.h"

Go to the source code of this file.

Functions

void | CharHandler (HWND hWnd, WPARAM wParam)
void | InputChangeHandler (HWND hWnd)
BOOL | IsDBCSTrailByte (char *base, char *p)
void | MouseHandler (HWND hWnd, LPARAM lParam)
void | ResetCaret (HWND)
void | ResetIMECompWin (HWND hWnd)
void | SetIMECompFormPos (HWND)
void | SteCommand (HWND hWnd, WPARAM cmd)
void | SteCreate (HWND hWnd)
void | SteIMECompWindowPos (HWND hWnd, WPARAM cmd)
void | SteImeOpenClose (HWND hWnd, BOOL fFlag)
int | SteRegister (HANDLE hInstance)
LRESULT CALLBACK | SteWndProc (HWND, UINT, WPARAM, LPARAM)
void | StoreChar (HWND hWnd, BYTE ch)
void | StoreDBCSChar (HWND hWnd, WORD ch)
void | VirtualKeyHandler (HWND hWnd, WPARAM wParam)
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)

Variables

int | CaretWidth
COMPOSITIONFORM | CompForm = {0}
WPARAM | CompWindowMode
UINT cxMetrics
UINT cxOverTypeCaret
UINT cyMetrics
int | DBCSFillChar
DWORD fdwProperty
BOOL fInsertMode
HFONT | hfntFixed
HFONT | hfntOld
TCHAR | szSteClass [10] = {0}
TCHAR | szSteTitle [40] = {0}
BYTE | textbuf [MAXROW][MAXCOL]
int | xPos
int | yPos

Function Documentation

void CharHandler | ( | HWND | hWnd,
 |  | WPARAM | wParam
 | ) |  |

Definition at line 978 of file Main.C.

{
    unsigned char ch = (unsigned char)wParam;

    //
    // Because DBCS characters are usually generated by IMEs (as two
    // PostMessages), if a lead byte comes in, the trail byte should
    // arrive very soon after.  We wait here for the trail byte and
    // store them into the text buffer together.
    if ( IsDBCSLeadByte( ch ) )
    {
        //
        // Wait an arbitrary amount of time for the trail byte to
        // arrive.  If it doesn't, then discard the lead byte.
        //
        // This could happen if the IME screwed up.  Or, more likely,
        // the user generated the lead byte through ALT-numpad.
        //
        MSG msg = {0};
        int i = 10;

        while (!PeekMessage((LPMSG)&msg, hWnd, WM_CHAR, WM_CHAR, PM_REMOVE))
        {
            if ( --i == 0 )
            {
                return;
            }
            Yield();
        }

        StoreDBCSChar( hWnd, (WORD)(((unsigned)(msg.wParam)<<8) | (unsigned)ch ));
    }
    else
    {
        switch( ch )
        {
            case '\r': /* fall-through */
            case '\t': /* fall-through */
            case '\b':
                //
                // Throw away.  Already handled at WM_KEYDOWN time.
                //
                break;

            default:
                StoreChar( hWnd, ch );
                break;
        }
    }
}

void InputChangeHandler ( HWND hWnd )

Definition at line 1086 of file Main.C.

{
    HIMC hIMC;

    fdwProperty = ImmGetProperty( GetKeyboardLayout(0), IGP_PROPERTY );

    // if this application set the candidate position, it need to set
    // it to default for the near caret IME
    if ( hIMC = ImmGetContext( hWnd ) )
    {
        UINT i;

        for (i = 0; i < 4; i++)
        {
            CANDIDATEFORM CandForm = {0};

            if ( fdwProperty & IME_PROP_AT_CARET )
            {
                CandForm.dwIndex = i;
                CandForm.dwStyle = CFS_CANDIDATEPOS;
#if 0
                // This application do not want to set candidate window to
                // any position. Anyway, if an application need to set the
                // candiadet position, it should remove the if 0 code

                // the position you want to set
                CandForm.ptCurrentPos.x = ptAppWantPosition[i].x;
                CandForm.ptCurrentPos.y = ptAppWantPosition[i].y;

                ImmSetCandidateWindow( hIMC, &CandForm );
#endif
            }
            else
            {
                if ( !ImmGetCandidateWindow( hIMC, i, &CandForm ) )
                {
                    continue;
                }

                if ( CandForm.dwStyle == CFS_DEFAULT )
                {
                    continue;
                }

                CandForm.dwStyle = CFS_DEFAULT;

                ImmSetCandidateWindow( hIMC, &CandForm );
            }
        }

        ImmReleaseContext( hWnd, hIMC );
    }

    return;
}

BOOL IsDBCSTrailByte | ( | char * | base,
 |  | char * | p
 | ) |  |

Definition at line 603 of file Main.C.

{
    int lbc = 0;    // lead byte count

    assert(base <= p);

    while ( p > base )
    {
      if ( !IsDBCSLeadByte(*(--p)) )
      {
          break;
      }
      lbc++;
    }

    return (lbc & 1);
}

void MouseHandler | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 1037 of file Main.C.

{
    HideCaret( hWnd );

    //
    // Calculate caret position based on fixed pitched font
    //
    yPos = MAKEPOINTS(lParam).y / cyMetrics;
    xPos = MAKEPOINTS(lParam).x / cxMetrics;

    //
    // Adjust caret position if click landed on a trail byte
    //
    if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
    {
        //
        // If click landed on the last quarter of the DBCS character,
        // assume the user was aiming at the next character.
        //
        if ( (MAKEPOINTS(lParam).x - xPos * cxMetrics) > (cxMetrics / 2) )
        {
            xPos++;
        }
        else
        {
            xPos--;
        }
    }

    DestroyCaret();
    CreateCaret(hWnd,
                NULL,
                (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
                    CaretWidth*2 : CaretWidth,
                cyMetrics );
    SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
    ShowCaret( hWnd );

    SetIMECompFormPos( hWnd );
}

void ResetCaret ( HWND hWnd )

Definition at line 480 of file Main.C.

{

    HideCaret( hWnd );
    DestroyCaret();
    CreateCaret( hWnd,
                 NULL,
                 (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
                    CaretWidth*2 : CaretWidth,
                 cyMetrics );
    SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
    ShowCaret( hWnd );

    SetIMECompFormPos( hWnd );

}

void ResetIMECompWin ( HWND hWnd )

Definition at line 338 of file Main.C.

{
    if ( CompWindowMode == IDC_NEARCARET_POS ||
         CompWindowMode == IDC_PREFER_POS )
    {
        HIMC hIMC = ImmGetContext(hWnd);
        if ( hIMC )
        {
            ImmSetCompositionWindow(hIMC,&CompForm);
        }
        ImmReleaseContext( hWnd , hIMC);
    }
}

void SetIMECompFormPos ( HWND hWnd )

Definition at line 359 of file Main.C.

{

    //
    // If current composition form mode is near caret operation,
    // application should inform IME UI the caret position has been
    // changed. IME UI will make decision whether it has to adjust
    // composition window position.
    //
    //
    if ( CompWindowMode == IDC_NEARCARET_POS )
    {
        HIMC hIMC = ImmGetContext(hWnd);
        POINT point = {0};

        GetCaretPos( &point );

        CompForm.dwStyle = CFS_POINT;

        CompForm.ptCurrentPos.x = (long) point.x;
        CompForm.ptCurrentPos.y = (long) point.y;

        if ( hIMC )
        {
            ImmSetCompositionWindow(hIMC,&CompForm);
        }
        ImmReleaseContext( hWnd , hIMC);
    }

}

void SteCommand | ( | HWND | hWnd,
 |  | WPARAM | cmd
 | ) |  |

Definition at line 505 of file Main.C.

{
    switch( cmd )
    {
        case IDC_CLEAR:
            //
            // Blank out text buffer.  Return caret to home position
            //

            for ( yPos = FIRSTROW; yPos <= LASTROW; yPos++ )
            {
                for ( xPos = FIRSTCOL; xPos <= LASTCOL; xPos++ )
                {
                    textbuf[yPos][xPos] = ' ';
                }
            }
            break;

        case IDC_ANSIFILL: /* fall-through */
        case IDC_DBCSFILL:

            //
            // Fill text buffer with ANSI or DBCS pattern
            //

            for ( yPos = FIRSTROW; yPos <= LASTROW; yPos++ )
            {
                for ( xPos = FIRSTCOL; xPos <= LASTCOL; xPos++ )
                {
                    if ( cmd == IDC_ANSIFILL )
                    {
                        textbuf[yPos][xPos] = 'a';
                    }
                    else
                    {
                        textbuf[yPos][xPos]   = HIBYTE(DBCSFillChar);
                        textbuf[yPos][++xPos] = LOBYTE(DBCSFillChar);
                    }
                }
            }
            break;

        //
        // The following messages are to control IME.
        //

        case IDC_OPENIME:

            SteImeOpenClose( hWnd, TRUE );
            goto RETURN;
            break;

        case IDC_CLOSEIME:

            SteImeOpenClose( hWnd, FALSE );
            goto RETURN;
            break;

        case IDC_DEFAULT_POS:    /* fall-through */
        case IDC_NEARCARET_POS:  /* fall-through */
        case IDC_PREFER_POS:

            SteIMECompWindowPos( hWnd, cmd );
            goto RETURN;
            break;

    }

    yPos = FIRSTROW;
    xPos = FIRSTCOL;

    InvalidateRect( hWnd, (LPRECT)NULL, TRUE );
    ResetCaret(hWnd);

RETURN:

    return;
}

void SteCreate ( HWND hWnd )

Definition at line 397 of file Main.C.

{
    HDC        hdc = NULL;
    TEXTMETRIC tm = {0};
    LOGFONT    lFont = {0};
    HFONT      hFont = NULL;

    //
    // Note that this window has a class DC
    //
    hdc = GetDC( hWnd );

    //
    // Select fixed pitch system font and get its text metrics
    //
    hfntFixed = GetStockObject( SYSTEM_FIXED_FONT );
    hfntOld = SelectObject( hdc, hfntFixed );
    GetTextMetrics( hdc, &tm );
    ReleaseDC( hWnd, hdc );
    cxMetrics = tm.tmAveCharWidth;
    cyMetrics = tm.tmHeight;

    //
    // Determine the version of DBCS Windows from system font charset ID.
    // Then hardcode a DBCS character value for the 'Pattern/DBCS' command.
    // The value is the Han character for 'door' or 'gate', which is
    // left-right symmetrical.
    //
    switch( tm.tmCharSet )
    {
        case SHIFTJIS_CHARSET:
            DBCSFillChar = 0x96e5;
            break;

        case HANGEUL_CHARSET:
            DBCSFillChar = 0xdaa6;
            break;

        case CHINESEBIG5_CHARSET:
            DBCSFillChar = 0xaaf9;
            break;

        default:
            DBCSFillChar = 0x7071;  // 'pq'
            break;
    }

    //
    // Initialize caret width.  Fat in INSERT mode, skinny in OVERTYPE mode.
    //
    fInsertMode = FALSE;
    CaretWidth = cxOverTypeCaret = GetSystemMetrics( SM_CXBORDER );

    //
    // Sets the logical font to be used to display characters in the
    // composition window. Especially for at caret or near caret operation,
    // application should set composition font.
    //
    if ( ( hFont = (HFONT)SendMessage( hWnd, WM_GETFONT, 0, 0L ) ) != NULL )
    {
        if ( GetObject( hFont, sizeof(LOGFONT), (LPVOID)&lFont ) )
        {
            HIMC hImc = NULL;
            if ( (  hImc = ImmGetContext( hWnd ) ) )
            {
                ImmSetCompositionFont( hImc, &lFont );
                ImmReleaseContext( hWnd, hImc );
            }
        }
    }

    PostMessage( hWnd, WM_COMMAND, IDC_CLEAR, 0L );

    fdwProperty = ImmGetProperty( GetKeyboardLayout(0), IGP_PROPERTY );
}

void SteIMECompWindowPos | ( | HWND | hWnd,
 |  | WPARAM | cmd
 | ) |  |

Definition at line 255 of file Main.C.

{
    RECT rect = {0};  // Storage for client rect.
    HIMC hImc = NULL;

    //
    // Set current composition mode.
    //
    CompWindowMode = cmd;

    switch( cmd )
    {
        case IDC_DEFAULT_POS:

            //
            // Put composition window in default position
            // being deterimined by IME UI. Applications
            // have to set composition form style with
            // CFS_DEFAULT to imform IME UI.
            //

            CompForm.dwStyle = CFS_DEFAULT;
            break;

        case IDC_NEARCARET_POS:

            //
            // Put composition window in near caret
            // position. If IME UI receives this control
            // message, it will put the composition window
            // near to the position deesignated by ptCurrentPos.
            // So for this operation, applications have to set
            // composition form style with CFS_POINT and store
            // caret position in ptCurrentPos.
            //

            CompForm.dwStyle = CFS_POINT;
            GetCaretPos( (PPOINT) &CompForm.ptCurrentPos );
            break;

        case IDC_PREFER_POS:

            // Put composition window in application
            // prefer position. Applications have to set
            // composition form sytle with  CFS_POINT |
            // CFS_FORCE_POSITION and store the prefer
            // position in ptCurrentPos.
            //
            // The difference between CFS_POINT and CFS_POINT
            // with CFS_FORCE_POSITION is if setting
            // CFS_FORCE_POSITION style, IME will actually
            // display its composition window in the position
            // specified by ptCurrent without any adjustment;
            // otherwise IME will shPosow its composition window
            // by adjusting the position specified by
            // ptCurrentPos.
            //

            CompForm.dwStyle = CFS_POINT | CFS_FORCE_POSITION;

            GetClientRect( hWnd, (LPRECT) &rect);

            CompForm.ptCurrentPos.x = 0;
            CompForm.ptCurrentPos.y = rect.bottom;
            break;
    }

    hImc = ImmGetContext( hWnd );
    ImmSetCompositionWindow( hImc, (COMPOSITIONFORM FAR*)&CompForm );
    ImmReleaseContext( hWnd, hImc );
}

void SteImeOpenClose | ( | HWND | hWnd,
 |  | BOOL | fFlag
 | ) |  |

Definition at line 221 of file Main.C.

{
    HIMC hIMC = NULL;    // Input context handle.

    //
    // If fFlag is true then open IME; otherwise close it.
    //
    if ( !( hIMC = ImmGetContext( hWnd ) ) )
    {
        return;
    }

    //
    // When an application wants to open/close IME for some
    // reasons, it should call TMMSetOpenStatus() to do that.
    //
    ImmSetOpenStatus( hIMC, fFlag );
    ImmReleaseContext( hWnd, hIMC );
}

int SteRegister ( HANDLE hInstance )

Definition at line 109 of file Main.C.

{
    WNDCLASS wc = {0};

    wc.hCursor       = LoadCursor( NULL, IDC_IBEAM );
    wc.hIcon         = LoadIcon( hInstance, MAKEINTRESOURCE(ID_ICON));
    wc.lpszMenuName  = MAKEINTRESOURCE(ID_MENU);
    wc.hInstance     = hInstance;
    wc.lpszClassName = szSteClass;
    wc.lpfnWndProc   = (WNDPROC)SteWndProc;
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.style         = CS_BYTEALIGNCLIENT | CS_CLASSDC;

    if ( !RegisterClass( &wc ) )
    {
        return FALSE;
    }
    else
    {
        return TRUE;
    }
}

LRESULT CALLBACK SteWndProc | ( | HWND | hWnd,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 1149 of file Main.C.

{
    int i = 0;
    HDC hdc = NULL;
    PAINTSTRUCT ps = {0};
    BOOL bRetDWP = FALSE;

    switch( msg )
    {
        case WM_CREATE:
            SteCreate( hWnd );
            break;

        case WM_MOVE:
            ResetIMECompWin( hWnd );
            break;

        case WM_DESTROY:
            PostQuitMessage(0);
            break;

        case WM_CLOSE:
            DestroyWindow( hWnd );
            break;

        case WM_SETFOCUS:
            CreateCaret(hWnd,
                        NULL,
                        (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
                            CaretWidth*2 : CaretWidth,
                        cyMetrics );
            SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
            ShowCaret( hWnd );
            break;

        case WM_KILLFOCUS:
            HideCaret( hWnd );
            DestroyCaret();
            break;

        case WM_KEYDOWN:
            VirtualKeyHandler( hWnd, wParam );
            break;

        case WM_CHAR:
            CharHandler( hWnd, wParam );
            break;

        case WM_LBUTTONDOWN:
            MouseHandler( hWnd, lParam );
            break;

        case WM_COMMAND:
            SteCommand( hWnd, wParam );
            break;

        case WM_PAINT:
            InvalidateRect(hWnd,NULL,FALSE);
            hdc = BeginPaint( hWnd, &ps );

            //
            // Refresh display from text buffer
            //
            for ( i = FIRSTROW; i <= LASTROW; i++ )
            {
                TextOutA( hdc, 0, i*cyMetrics, (LPCSTR)textbuf[i], MAXCOL );
            }
            EndPaint( hWnd, &ps );
            break;

        case WM_INPUTLANGCHANGE:
            InputChangeHandler( hWnd );
            bRetDWP = TRUE;
            break;

        default:
            bRetDWP = TRUE;
            break;
    }

    if (bRetDWP)
    {
        return DefWindowProc( hWnd, msg, wParam, lParam );
    }
    else
    {
        return 0;
    }
}

void StoreChar | ( | HWND | hWnd,
 |  | BYTE | ch
 | ) |  |

Definition at line 802 of file Main.C.

{
    int i;
    HDC hdc = NULL;

    //
    // If insert mode, move rest of line to the right by one
    //

    if ( fInsertMode )
    {
        for ( i = LASTCOL; i > xPos; i-- )
        {
            textbuf[yPos][i] = textbuf[yPos][i-1];
        }

        //
        // If the row ends on a lead byte, blank it out
        // To do this we must first traverse the string
        // starting from a known character boundry until
        // we reach the last column. If the last column
        // is a character boundry then the last character
        // is either a single byte or a lead byte
        //

        for ( i = xPos+1; i < LASTCOL; )
        {
            if ( IsDBCSLeadByte( textbuf[yPos][i] ) )
            {
                i++;
            }
            i++;
        }

        if (i==LASTCOL)
        {
           if ( IsDBCSLeadByte( textbuf[yPos][LASTCOL] ) )
           {
               textbuf[yPos][LASTCOL] = ' ';
           }
        }
    }
    else
    {  // overtype mode
      if ( IsDBCSLeadByte( textbuf[yPos][xPos] ) )
      {
            //
            // Blank out trail byte
            //
            textbuf[yPos][xPos+1] = ' ';

            //
            // or shift line left on character and blank last column
            //
            // for ( i = xPos+1; i < LASTCOL; i++ )
            //     textbuf[yPos][i] = textbuf[yPos][i+1];
            // textbuf[yPos][LASTCOL] = ' ';
        }
    }

    //
    // Store input character at current caret position
    //
    textbuf[yPos][xPos] = ch;

    //
    // Display input character.
    //
    hdc = GetDC( hWnd );
    HideCaret( hWnd );
    TextOutA( hdc, xPos*cxMetrics, yPos*cyMetrics,
              (LPCSTR)&(textbuf[yPos][xPos]), MAXCOL-xPos );
    ShowCaret( hWnd );
    ReleaseDC( hWnd, hdc );

    SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
}

void StoreDBCSChar | ( | HWND | hWnd,
 |  | WORD | ch
 | ) |  |

Definition at line 889 of file Main.C.

{
    int i;
    HDC hdc;

    //
    // If there is no room for a DBCS character, discard it
    //
    if ( xPos == LASTCOL )
    {
        return;
    }

    //
    // If insert mode, move rest of line to the right by two
    //
    if ( fInsertMode )
    {
        for ( i = LASTCOL; i > xPos+1; i-- )
        {
            textbuf[yPos][i] = textbuf[yPos][i-2];
        }

        //
        // If the row ends on a lead byte, blank it out
        // To do this we must first traverse the string
        // starting from a known charcter boundry until
        // we reach the last column. If the last column
        // is not a trail byte then it is a single byte
        // or a lead byte
        //
        for ( i = xPos+2; i < LASTCOL; )
        {
            if ( IsDBCSLeadByte( textbuf[yPos][i] ) )
            {
                i++;
            }
            i++;
        }
        if (i==LASTCOL)
        {
           if (IsDBCSLeadByte( textbuf[yPos][LASTCOL] ) )
           {
                textbuf[yPos][LASTCOL] = ' ';
           }
        }
    }
    else
    {  // overtype mode
        if ( !IsDBCSLeadByte( textbuf[yPos][xPos] ) )
        {
            //
            // Overtyping the current byte, plus the following byte,
            // which could be a lead byte.
            //
            if ( IsDBCSLeadByte( textbuf[yPos][xPos+1] ) )
            {
                textbuf[yPos][xPos+2] = ' ';
            }
        }
    }

    //
    // Store input character at current caret position
    //
    textbuf[yPos][xPos]   = LOBYTE(ch);     // lead byte
    textbuf[yPos][xPos+1] = HIBYTE(ch);     // trail byte

    //
    // Display input character.
    //
    hdc = GetDC( hWnd );
    HideCaret( hWnd );
    TextOutA( hdc, xPos*cxMetrics, yPos*cyMetrics,
             (LPCSTR)&(textbuf[yPos][xPos]), MAXCOL-xPos );
    ShowCaret( hWnd );
    ReleaseDC( hWnd, hdc );

    SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
}

void VirtualKeyHandler | ( | HWND | hWnd,
 |  | WPARAM | wParam
 | ) |  |

Definition at line 635 of file Main.C.

{
    int i;
    HDC hdc;
    static int delta = 1;

    switch( wParam )
    {
        case VK_HOME:   // beginning of line
            xPos = FIRSTCOL;
            break;

        case VK_END:    // end of line
            xPos = LASTCOL;
            goto check_for_trailbyte;

        case VK_RIGHT:
            if ( IsDBCSLeadByte( textbuf[yPos][xPos] ) )
            {
                if (xPos==LASTCOL - 1)
                {
                    break;   // last character don't move
                }
                xPos += 2;   // skip 2 for DB Character
            }
            else
            {
                xPos = min( xPos+1, LASTCOL );
            }
            break;

        case VK_LEFT:
            xPos = max( xPos-1, FIRSTCOL );

check_for_trailbyte:

            if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
            {
                xPos--;
            }
            break;

        case VK_UP:
            yPos = max( yPos-1, FIRSTROW );
            goto Virtical_Check_Trail;

        case VK_DOWN:
            yPos = min( yPos+1, LASTROW );

Virtical_Check_Trail:

            if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
            {
                if (xPos<LASTCOL)
                {
                    xPos+=delta;
                    delta *= -1;
                }
                else
                {
                    xPos--;
                }
            }
            break;

        case VK_INSERT:

            //
            // Change caret shape to indicate insert/overtype mode
            //

            fInsertMode = !fInsertMode;
            CaretWidth = fInsertMode ? cxMetrics : cxOverTypeCaret;
            break;

        case VK_BACK:   // backspace
            if ( xPos > FIRSTCOL )
            {
                xPos--;

                //
                // DB Character so backup one more to allign on boundary
                //
                if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
                {
                  xPos--;
                }
                //
                // Fall Through to VK_DELETE to adjust row
                //
            }
            else     //FIRST COLUMN  don't backup -- this would change for wrapping
            {
               break;
            }

        case VK_DELETE:

            if ( !IsDBCSLeadByte( textbuf[yPos][xPos] ) )
            {
                //
                // Move rest of line left by one, then blank out last character
                //
                for ( i = xPos; i < LASTCOL; i++ )
              textbuf[yPos][i] = textbuf[yPos][i+1];
                textbuf[yPos][LASTCOL] = ' ';
            }
            else
            {
                //
                // Move line left by two bytes, blank out last two bytes
                //

                for ( i = xPos; i < LASTCOL-1; i++ )
                {
                  textbuf[yPos][i] = textbuf[yPos][i+2];
                }
                textbuf[yPos][LASTCOL-1] = ' ';
                textbuf[yPos][LASTCOL]   = ' ';
            }

            //
            // Repaint the entire line
            //

            hdc = GetDC( hWnd );
            HideCaret( hWnd );
            TextOutA( hdc, 0, yPos*cyMetrics, (LPCSTR)textbuf[yPos], MAXCOL );
            ReleaseDC( hWnd, hdc );
            break;

        case VK_TAB:    // tab  -- tabs are column allignment not character
            {
                 int xTabMax = xPos + TABSTOP;
                 int xPosPrev;

                 do
                 {
                     xPosPrev = xPos;
                     SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
                 }
                 while ((xPos % TABSTOP) &&
                        (xPos < xTabMax) &&
                        (xPos != xPosPrev));

            }
            break;

        case VK_RETURN: // linefeed
            yPos = min( yPos+1, LASTROW );
            xPos = FIRSTCOL;
            break;
    }

    ResetCaret( hWnd );
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 139 of file Main.C.

{
    MSG msg = {0};
    HWND hWnd = NULL;
    BOOL bSuccess = TRUE;
    BOOL bRet;

    LoadString( hInstance, IDS_CLASS, szSteClass, 10 );
    LoadString( hInstance, IDS_TITLE, szSteTitle, 40 );

  if ( !SteRegister( hInstance ) )
  {
      bSuccess = FALSE;
      goto exit_func;
  }

    if ( !(hWnd = CreateWindow( szSteClass, szSteTitle,
                                WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
                                CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
                                NULL, NULL, hInstance, NULL)) )
    {
      bSuccess = FALSE;
      goto exit_func;
    }

    //
    // Create window with just enough client space for the text buffer
    //
    SetWindowPos( hWnd, 0, 0, 0,
                  MAXCOL*cxMetrics + GetSystemMetrics(SM_CXBORDER)*2,
                  MAXROW*cyMetrics + GetSystemMetrics(SM_CYBORDER)*2
                    + GetSystemMetrics(SM_CYCAPTION)
                    + GetSystemMetrics(SM_CYMENU),
                  SWP_NOZORDER );

    ShowWindow( hWnd, nCmdShow );

    //
    // Any IME half-aware application should call TranslateMessage API to
    // translate messages. This is because Windows95 IME architecture
    // will call ImmToAsciiEx API, if necessary, to make IME conversion
    // engine work, and generate some IME messages during TranslateMessage
    // session. Otherwise, IME will not work.
    //
    while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
    {
        if (bRet == -1)
        {
            // possibly handle the error
            bSuccess = FALSE;
        }
        else
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

exit_func:
    if (bSuccess)
    {
        return (int) msg.wParam;
    }
    else
    {
        return 0;
    }
}

Variable Documentation

int CaretWidth

Definition at line 94 of file Main.C.

COMPOSITIONFORM CompForm = {0}

Definition at line 99 of file Main.C.

WPARAM CompWindowMode

Definition at line 98 of file Main.C.

UINT cxMetrics

Definition at line 87 of file Main.C.

UINT cxOverTypeCaret

Definition at line 87 of file Main.C.

UINT cyMetrics

Definition at line 87 of file Main.C.

int DBCSFillChar

Definition at line 96 of file Main.C.

DWORD fdwProperty

Definition at line 101 of file Main.C.

BOOL fInsertMode

Definition at line 93 of file Main.C.

HFONT hfntFixed

Definition at line 91 of file Main.C.

HFONT hfntOld

Definition at line 92 of file Main.C.

TCHAR szSteClass[10] = {0}

Definition at line 85 of file Main.C.

TCHAR szSteTitle[40] = {0}

Definition at line 86 of file Main.C.

BYTE textbuf[MAXROW][MAXCOL]

Definition at line 95 of file Main.C.

int xPos

Definition at line 90 of file Main.C.

int yPos

Definition at line 90 of file Main.C.

Generated on Wed Nov 13 2024 16:53:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Comp.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Defines | Functions

Comp.c File Reference

#include <windows.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Defines

#define | DEBUG 1

Functions

LRESULT | HandleChar (HWND hWnd, WPARAM wParam, LPARAM lParam)
LRESULT | HandleComposition (HWND hWnd, WPARAM wParam, LPARAM lParam)
LRESULT | HandleEndComposition (HWND hWnd, WPARAM wParam, LPARAM lParam)
LRESULT | HandleNotify (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT | HandleStartComposition (HWND hWnd, WPARAM wParam, LPARAM lParam)
void | MakePaintString (HWND hWnd, LPMYSTR lpStr, DWORD dwStrLen, LPDWORD lpCls, DWORD dwClsLen, LPMYSTR lpPaintStr)

Define Documentation

#define DEBUG 1

Definition at line 14 of file Comp.c.

Function Documentation

LRESULT HandleChar | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 293 of file Comp.c.

{
    RECT rc = {0};
    HDC hIC = NULL;
    SIZE sz0, sz1;
    HFONT hOldFont = NULL;
    LPMYSTR lp = NULL;
    // is the previous received char is a DBCS lead byte char ?
    static BOOL fIsPrevLeadByte = FALSE;

    GetClientRect(hWnd,&rc);
    hIC = CreateIC("DISPLAY", NULL, NULL, NULL);
    hOldFont = SelectObject(hIC,hFont);
#ifdef USEWAPI
    GetTextExtentPointW(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
    GetTextExtentPointW(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#else
    GetTextExtentPoint(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
    GetTextExtentPoint(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#endif
    if (sz0.cx + sz1.cx >= rc.right)
    {
        szPaintResult[0] = MYTEXT('\0');
        szPaintResultRead[0] = MYTEXT('\0');
    }
    SelectObject(hIC,hOldFont);
    DeleteDC(hIC);

    lp = szPaintResult + Mylstrlen(szPaintResult);

#ifndef USEWAPI
    if (fIsPrevLeadByte)
    {
        // remove , and append second byte for showing DBCS char
        if (*(lp - 1) == ',')
        {
            lp--;
        }
    }
#endif

    // append second byte
    *lp++ = (MYCHAR)(BYTE)wParam;
    *lp++ = MYTEXT(',');
    *lp++ = MYTEXT('\0');

    lp = szPaintResultRead + Mylstrlen(szPaintResultRead);

#ifndef USEWAPI
    if (fIsPrevLeadByte)
    {
        // remove , and append second byte for showing DBCS char
        if (*(lp - 1) == ',')
        {
            lp--;
        }

        fIsPrevLeadByte = FALSE;
    }
    else
    {
        fIsPrevLeadByte = IsDBCSLeadByte((BYTE)wParam);
    }
#endif

    *lp++ = (BYTE)wParam;
    *lp++ = MYTEXT(',');
    *lp++ = MYTEXT('\0');

    InvalidateRect(hWnd,NULL,TRUE);
    UpdateWindow(hWnd);

    return 1;
}

LRESULT HandleComposition | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 116 of file Comp.c.

{
    HIMC hIMC = NULL;
    BOOL fRedraw = FALSE;

    hIMC = ImmGetContext(hWnd);

    if (lParam & GCS_COMPSTR)
    {
        dwCompStrLen = MyImmGetCompositionString(hIMC,GCS_COMPSTR,szCompStr,sizeof(szCompStr));
        dwCompStrLen /= sizeof(MYCHAR);
        szCompStr[dwCompStrLen] = MYTEXT('\0');
        fRedraw = TRUE;
    }
    else
    {
        dwCompStrLen = 0;
        szCompStr[0] = MYTEXT('\0');
    }

    if (lParam & GCS_COMPATTR)
    {
        dwCompAttrLen = MyImmGetCompositionString(hIMC,GCS_COMPATTR,bCompAttr,sizeof(bCompAttr));
        fRedraw = TRUE;
    }
    else
    {
        dwCompAttrLen = 0;
        bCompAttr[0] = 0;
    }

    if (lParam & GCS_COMPCLAUSE)
    {
        dwCompClsLen = MyImmGetCompositionString(hIMC,GCS_COMPCLAUSE,dwCompCls,sizeof(dwCompCls));
        fRedraw = TRUE;
    }
    else
    {
        dwCompClsLen = 0;
        dwCompCls[0] = 0;
        dwCompCls[1] = 0;
    }

    if (lParam & GCS_COMPREADSTR)
    {
        dwCompReadStrLen = MyImmGetCompositionString(hIMC,GCS_COMPREADSTR,szCompReadStr,sizeof(szCompReadStr));
        dwCompReadStrLen /= sizeof(MYCHAR);
        szCompReadStr[dwCompReadStrLen] = MYTEXT('\0');
        fRedraw = TRUE;
    }
    else
    {
        dwCompReadStrLen = 0;
        szCompReadStr[0] = MYTEXT('\0');
    }

    if (lParam & GCS_COMPREADATTR)
    {
        dwCompReadAttrLen = MyImmGetCompositionString(hIMC,GCS_COMPREADATTR,bCompReadAttr,sizeof(bCompReadAttr));
        fRedraw = TRUE;
    }
    else
    {
        dwCompReadAttrLen = 0;
        bCompReadAttr[0] = 0;
    }

    if (lParam & GCS_COMPREADCLAUSE)
    {
        dwCompReadClsLen = MyImmGetCompositionString(hIMC,GCS_COMPREADCLAUSE,dwCompReadCls,sizeof(dwCompReadCls));
        fRedraw = TRUE;
    }
    else
    {
        dwCompReadClsLen = 0;
        dwCompReadCls[0] = 0;
        dwCompReadCls[1] = 0;
    }

    if (lParam & GCS_RESULTSTR)
    {
        RECT rc = {0};
        HDC hIC = NULL;
        SIZE sz0, sz1;
        HFONT hOldFont = NULL;

        if (lParam & GCS_RESULTCLAUSE)
        {
            dwResultClsLen = MyImmGetCompositionString(hIMC,GCS_RESULTCLAUSE,dwResultCls,sizeof(dwResultCls));
        }
        else
        {
            dwResultClsLen = 0;
            dwResultCls[0] = 0;
            dwResultCls[1] = 0;
        }

        dwResultStrLen = MyImmGetCompositionString(hIMC,GCS_RESULTSTR,szResultStr,sizeof(szResultStr));
        dwResultStrLen /= sizeof(MYCHAR);
        szResultStr[dwResultStrLen] = MYTEXT('\0');

        // szPaintResult may overflow..
        GetClientRect(hWnd,&rc);
        hIC = CreateIC("DISPLAY", NULL, NULL, NULL);
        hOldFont = SelectObject(hIC,hFont);
#ifdef USEWAPI
        GetTextExtentPointW(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
        GetTextExtentPointW(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#else
        GetTextExtentPoint(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
        GetTextExtentPoint(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#endif
        if (sz0.cx + sz1.cx >= rc.right)
        {
            szPaintResult[0] = MYTEXT('\0');
            szPaintResultRead[0] = MYTEXT('\0');
        }
        SelectObject(hIC,hOldFont);
        DeleteDC(hIC);

        MakePaintString(hWnd,szResultStr,dwResultStrLen,dwResultCls,dwResultClsLen,szPaintResult);

        fRedraw = TRUE;
    }
    else
    {
        dwResultStrLen = 0;
        szResultStr[0] = MYTEXT('\0');
        dwResultClsLen = 0;
        dwResultCls[0] = 0;
        dwResultCls[1] = 0;
    }

    if (lParam & GCS_RESULTREADSTR)
    {
        if (lParam & GCS_RESULTREADCLAUSE)
        {
            dwResultReadClsLen = MyImmGetCompositionString(hIMC,GCS_RESULTREADCLAUSE,dwResultReadCls,sizeof(dwResultReadCls));
            fRedraw = TRUE;
        }
        else
        {
            dwResultReadClsLen = 0;
            dwResultReadCls[0] = 0;
            dwResultReadCls[1] = 0;
        }
        dwResultReadStrLen = MyImmGetCompositionString(hIMC,GCS_RESULTREADSTR,szResultReadStr,sizeof(szResultReadStr));
        dwResultReadStrLen /= sizeof(MYCHAR);
        szResultReadStr[dwResultReadStrLen] = MYTEXT('\0');
        MakePaintString(hWnd,szResultReadStr,dwResultReadStrLen,dwResultReadCls,dwResultReadClsLen,szPaintResultRead);
        fRedraw = TRUE;
    }
    else
    {
        dwResultReadStrLen = 0;
        szResultReadStr[0] = MYTEXT('\0');
        dwResultReadClsLen = 0;
        dwResultReadCls[0] = 0;
        dwResultReadCls[1] = 0;
    }

    if (fRedraw)
    {
        InvalidateRect(hWnd,NULL,TRUE);
        UpdateWindow(hWnd);
    }
    return 1;
}

LRESULT HandleEndComposition | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 62 of file Comp.c.

{
#ifdef DEBUG
    OutputDebugString("WM_ENDCOMPOSITIONSTRING!!!\r\n");
#endif
    dwCompStrLen      = 0;
    dwCompAttrLen     = 0;
    dwCompClsLen      = 0;
    dwCompReadStrLen  = 0;
    dwCompReadAttrLen = 0;
    dwCompReadClsLen  = 0;
    dwResultStrLen      = 0;
    dwResultClsLen      = 0;
    dwResultReadStrLen  = 0;
    dwResultReadClsLen  = 0;
    InvalidateRect(hWnd,NULL,TRUE);

    return 1;
}

LRESULT HandleNotify | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 369 of file Comp.c.

{
    HIMC hIMC = NULL;
    BOOL fOpen = FALSE;
    DWORD dwConvMode, dwSentMode;

    switch (wParam)
    {
        case IMN_OPENSTATUSWINDOW: /* fall-through */
        case IMN_CLOSESTATUSWINDOW:
            break;

        case IMN_SETOPENSTATUS:
            SetStatusItems(hWnd);

            hIMC = ImmGetContext(hWnd);
            fOpen = ImmGetOpenStatus(hIMC);
            UpdateShowOpenStatusButton(fOpen);

            ImmReleaseContext(hWnd,hIMC);
            break;

        case IMN_SETCONVERSIONMODE:
            hIMC = ImmGetContext(hWnd);
            fOpen = ImmGetOpenStatus(hIMC);
            ImmGetConversionStatus(hIMC,&dwConvMode,&dwSentMode);
            if (fOpen)
            {
                SetConvModeParts(dwConvMode);
                UpdateModeButton(dwConvMode);
            }
            else
            {
                ClearConvModeParts();
            }
            ImmReleaseContext(hWnd,hIMC);
            break;

        case IMN_OPENCANDIDATE:
            if (!fShowCand || (lParam != 0x01))
            {
                if (fdwProperty & IME_PROP_SPECIAL_UI)
                {
                    // Normally, we only need to set the composition window
                    // position for a special UI IME
                }
                else if (fdwProperty & IME_PROP_AT_CARET)
                {
                    CANDIDATEFORM cdf;
                    HIMC          hIMC;

                    hIMC = ImmGetContext(hWnd);

                    cdf.dwIndex = 0;
                    cdf.dwStyle = CFS_CANDIDATEPOS;
                    cdf.ptCurrentPos.x = ptImeUIPos.x;
                    cdf.ptCurrentPos.y = ptImeUIPos.y;
                    ImmSetCandidateWindow(hIMC,&cdf);

                    ImmReleaseContext(hWnd,hIMC);
                }
                else
                {
                    // Normally, we only need to set the composition window
                    // position for a near caret IME
                }

                return (DefWindowProc(hWnd, message, wParam, lParam));
            }

        case IMN_CHANGECANDIDATE:

#ifdef _DEBUG
            {
                char szDev[80];
                DWORD dwSize;
                LPCANDIDATELIST lpC;

                hIMC = ImmGetContext(hWnd);
                if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
                {
                    lpC = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);

                    ImmGetCandidateList(hIMC,0x0,lpC,dwSize);

                    OutputDebugString("DumpCandList!!!\r\n");
                    wsprintf((LPSTR)szDev,"dwCount %d\r\n",lpC->dwCount);
                    OutputDebugString((LPSTR)szDev);
                    wsprintf((LPSTR)szDev,"dwSelection %d\r\n",lpC->dwSelection);
                    OutputDebugString((LPSTR)szDev);
                    wsprintf((LPSTR)szDev,"dwPageStart %d\r\n",lpC->dwPageStart);
                    OutputDebugString((LPSTR)szDev);
                    wsprintf((LPSTR)szDev,"dwPageSize %d\r\n",lpC->dwPageSize);
                    OutputDebugString((LPSTR)szDev);
                    GlobalFree((HANDLE)lpC);
                }
            }
#endif
            if (fShowCand && (lParam == 0x01))
            {
                DWORD dwSize;

                if (!lpCandList)
                    lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,sizeof(CANDIDATELIST));

                hIMC = ImmGetContext(hWnd);
                if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
                {
                    GlobalFree((HANDLE)lpCandList);
                    lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);

                    ImmGetCandidateList(hIMC,0x0,lpCandList,dwSize);
                }
                else
                {
                    memset(lpCandList, 0, sizeof(CANDIDATELIST));
                }

                InvalidateRect(hWndCandList,NULL,TRUE);
                UpdateWindow(hWndCandList);

                ImmReleaseContext(hWnd,hIMC);
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

        case IMN_CLOSECANDIDATE:
            if (fShowCand && (lParam == 0x01))
            {
                if (!lpCandList)
                {
                    lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,sizeof(CANDIDATELIST));
                }

                memset(lpCandList, 0, sizeof(CANDIDATELIST));
                InvalidateRect(hWndCandList,NULL,TRUE);
                UpdateWindow(hWndCandList);
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

       default:
            return (DefWindowProc(hWnd, message, wParam, lParam));
    }

    return 0;
}

LRESULT HandleStartComposition | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 16 of file Comp.c.

{
    COMPOSITIONFORM cpf = {0};
    HIMC hIMC = NULL;

#ifdef DEBUG
    OutputDebugString("WM_STARTCOMPOSITIONSTRING!!!\r\n");
#endif

    if (fdwProperty & IME_PROP_SPECIAL_UI)
    {
        // Normally, we need to set the composition window
        // position to caret position for a special UI IME
    }
    else if (fdwProperty & IME_PROP_AT_CARET)
    {
        // If an application show composition string by itself, we do not
        // need to set the position of composition window for an at caret
        // IME.

        return 1;
    }
    else
    {
        // Normally, we need to set the composition window
        // position to caret position for a near caret IME
    }

    hIMC = ImmGetContext(hWnd);

    if (!hIMC)
    {
        return 1;
    }

    cpf.dwStyle = CFS_POINT;
    cpf.ptCurrentPos.x = ptImeUIPos.x;
    cpf.ptCurrentPos.y = ptImeUIPos.y;

    ImmSetCompositionWindow(hIMC,&cpf);

    ImmReleaseContext(hWnd,hIMC);

    return 1;
}

void MakePaintString | ( | HWND | hWnd,
 |  | LPMYSTR | lpStr,
 |  | DWORD | dwStrLen,
 |  | LPDWORD | lpCls,
 |  | DWORD | dwClsLen,
 |  | LPMYSTR | lpPaintStr
 | ) |  |

Definition at line 82 of file Comp.c.

{
    LPMYSTR lpPaintStart = lpPaintStr;

    lpPaintStr += Mylstrlen(lpPaintStr);

    if (dwStrLen)
    {
        if (dwClsLen)
        {
            lpCls[127] = 0;

            while (*(lpCls+1) && *lpCls < dwStrLen)
            {
                DWORD dwTextLen = *(lpCls+1) - *lpCls;
                LPMYSTR lpT = lpStr + *lpCls;

                memcpy(lpPaintStr,lpT,dwTextLen * sizeof(MYCHAR));
                lpPaintStr += dwTextLen;
                *lpPaintStr = MYTEXT(',');
                lpPaintStr++;
                lpCls++;
            }
            *lpPaintStr = MYTEXT('\0');
        }
        else
        {
            Mylstrcpy(lpPaintStr,lpStr);
            Mylstrcat(lpPaintStr,MYTEXT(","));
        }
    }

}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Data.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Variables

Data.c File Reference

#include <windows.h>
#include <imm.h>
#include "wapi.h"

Go to the source code of this file.

Variables

BYTE | bCompAttr [512] = {0}
BYTE | bCompReadAttr [512] = {0}
DWORD | dwCompAttrLen = 0
DWORD | dwCompCls [128] = {0}
DWORD | dwCompClsLen = 0
DWORD | dwCompReadAttrLen = 0
DWORD | dwCompReadCls [128] = {0}
DWORD | dwCompReadClsLen = 0
DWORD | dwCompReadStrLen = 0
DWORD | dwCompStrLen = 0
DWORD | dwResultCls [128] = {0}
DWORD | dwResultClsLen = 0
DWORD | dwResultReadCls [128] = {0}
DWORD | dwResultReadClsLen = 0
DWORD | dwResultReadStrLen = 0
DWORD | dwResultStrLen = 0
DWORD | fdwProperty = 0
BOOL | fShowCand = FALSE
HFONT | hFont = NULL
HANDLE | hInst = NULL
HWND | hWndCandList = NULL
HWND | hWndCompStr = NULL
HWND | hWndMain = NULL
HWND | hWndStatus = NULL
HWND | hWndToolBar = NULL
LOGFONT | lf = {0}
LPCANDIDATELIST | lpCandList = NULL
int | nStatusHeight = 0
int | nToolBarHeight = 0
POINT | ptImeUIPos = {0}
MYCHAR | szCompReadStr [512] = {0}
MYCHAR | szCompStr [512] = {0}
MYCHAR | szPaintResult [512] = {0}
MYCHAR | szPaintResultRead [512] = {0}
MYCHAR | szResultReadStr [512] = {0}
MYCHAR | szResultStr [512] = {0}

Variable Documentation

BYTE bCompAttr[512] = {0}

Definition at line 40 of file Data.c.

BYTE bCompReadAttr[512] = {0}

Definition at line 43 of file Data.c.

DWORD dwCompAttrLen = 0

Definition at line 29 of file Data.c.

DWORD dwCompCls[128] = {0}

Definition at line 41 of file Data.c.

DWORD dwCompClsLen = 0

Definition at line 30 of file Data.c.

DWORD dwCompReadAttrLen = 0

Definition at line 32 of file Data.c.

DWORD dwCompReadCls[128] = {0}

Definition at line 44 of file Data.c.

DWORD dwCompReadClsLen = 0

Definition at line 33 of file Data.c.

DWORD dwCompReadStrLen = 0

Definition at line 31 of file Data.c.

DWORD dwCompStrLen = 0

Definition at line 28 of file Data.c.

DWORD dwResultCls[128] = {0}

Definition at line 46 of file Data.c.

DWORD dwResultClsLen = 0

Definition at line 35 of file Data.c.

DWORD dwResultReadCls[128] = {0}

Definition at line 48 of file Data.c.

DWORD dwResultReadClsLen = 0

Definition at line 37 of file Data.c.

DWORD dwResultReadStrLen = 0

Definition at line 36 of file Data.c.

DWORD dwResultStrLen = 0

Definition at line 34 of file Data.c.

DWORD fdwProperty = 0

Definition at line 26 of file Data.c.

BOOL fShowCand = FALSE

Definition at line 25 of file Data.c.

HFONT hFont = NULL

Definition at line 21 of file Data.c.

HANDLE hInst = NULL

Definition at line 13 of file Data.c.

HWND hWndCandList = NULL

Definition at line 18 of file Data.c.

HWND hWndCompStr = NULL

Definition at line 15 of file Data.c.

HWND hWndMain = NULL

Definition at line 14 of file Data.c.

HWND hWndStatus = NULL

Definition at line 17 of file Data.c.

HWND hWndToolBar = NULL

Definition at line 16 of file Data.c.

LOGFONT lf = {0}

Definition at line 20 of file Data.c.

LPCANDIDATELIST lpCandList = NULL

Definition at line 52 of file Data.c.

int nStatusHeight = 0

Definition at line 23 of file Data.c.

int nToolBarHeight = 0

Definition at line 24 of file Data.c.

POINT ptImeUIPos = {0}

Definition at line 54 of file Data.c.

MYCHAR szCompReadStr[512] = {0}

Definition at line 42 of file Data.c.

MYCHAR szCompStr[512] = {0}

Definition at line 39 of file Data.c.

MYCHAR szPaintResult[512] = {0}

Definition at line 49 of file Data.c.

MYCHAR szPaintResultRead[512] = {0}

Definition at line 50 of file Data.c.

MYCHAR szResultReadStr[512] = {0}

Definition at line 47 of file Data.c.

MYCHAR szResultStr[512] = {0}

Definition at line 45 of file Data.c.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/IMEApps.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Functions

IMEApps.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <commctrl.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Functions

LRESULT CALLBACK | AboutDlg (HWND hDlg, unsigned message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK | CandListWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK | CompStrWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL | InitApplication (HANDLE hInstance)
void | InitIMEUIPosition (HWND hWnd)
BOOL | InitInstance (HANDLE hInstance, INT nCmdShow)
LRESULT CALLBACK | MainWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)

Function Documentation

LRESULT CALLBACK AboutDlg | ( | HWND | hDlg,
 |  | unsigned | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 693 of file IMEApps.c.

{
    switch (message)
    {
        case WM_INITDIALOG:
            return (TRUE);

        case WM_COMMAND:
            if ((wParam == IDOK) ||
                 (wParam == IDCANCEL))
            {
              EndDialog(hDlg, TRUE);
              return (TRUE);
            }
            break;
    }
    return (FALSE);
}

LRESULT CALLBACK CandListWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 669 of file IMEApps.c.

{
    switch (message)
    {
        case WM_PAINT:
            HandleCandPaint(hWnd,wParam,lParam);
            break;

        case WM_SETFOCUS:
            SetFocus(hWndCompStr);
            break;

        default:
            return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return 0L;
}

LRESULT CALLBACK CompStrWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 422 of file IMEApps.c.

{
    HIMC hIMC    = NULL;
    HIMC hOldIMC = NULL;

    switch (message)
    {
        case WM_CREATE:
            hIMC = ImmCreateContext();
            hOldIMC = ImmAssociateContext(hWnd,hIMC);
            SetWindowLongPtr(hWnd, 0, (LONG_PTR)hOldIMC);
            fdwProperty = ImmGetProperty(GetKeyboardLayout(0), IGP_PROPERTY);
            break;

        case WM_CHAR:
            HandleChar(hWnd,wParam,lParam);
            break;

        case WM_LBUTTONUP:  /* fall-through */
        case WM_RBUTTONUP:
            if (hIMC = ImmGetContext(hWnd))
            {
                HMENU hMenu = NULL;

                InitMenuItemIDTable();
                hMenu = CreateImeMenu(hWnd, hIMC, NULL,(message == WM_RBUTTONUP));

                if (hMenu)
                {
                    DWORD dwItemData;
                    DWORD dwPos = (DWORD)GetMessagePos();
                    int nCmd;

                    nCmd = TrackPopupMenuEx(hMenu,
                                            TPM_RETURNCMD | TPM_NONOTIFY |
                                            TPM_LEFTBUTTON | TPM_LEFTALIGN | TPM_TOPALIGN,
                                            LOWORD(dwPos), HIWORD(dwPos),
                                            hWnd, NULL);

                    if (nCmd)
                    {
                        nCmd -= IDM_STARTIMEMENU;
                        dwItemData = FindItemData(nCmd);
                        ImmNotifyIME(hIMC, NI_IMEMENUSELECTED, nCmd, dwItemData);
                    }
                }
                EndMenuItemIDTable();

                DestroyMenu(hMenu);
            }
            break;

        case WM_IME_SETCONTEXT:
            if (fShowCand)
            {
                lParam &= ~ISC_SHOWUICANDIDATEWINDOW;
            }

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                // EMPTY
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                lParam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
            }
            else
            {
                // EMPTY
            }

            return (DefWindowProc(hWnd, message, wParam, lParam));

        case WM_IME_STARTCOMPOSITION:
            // Normally, we should not call into HandleStartComposition
            // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
            // we should pass this message to DefWindowProc directly for
            // this kind of IMEs

            HandleStartComposition(hWnd,wParam,lParam);

            // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
            // and not IME_PROP_AT_CARET IMEs

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                // EMPTY
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }

            break;

        case WM_IME_ENDCOMPOSITION:
            // Normally, we should not call into HandleEndComposition
            // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
            // we should pass this message to DefWindowProc directly for
            // this kind of IMEs

            HandleEndComposition(hWnd,wParam,lParam);

            // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
            // and not IME_PROP_AT_CARET IMEs

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                // EMPTY
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

        case WM_IME_COMPOSITION:
            // Normally, we should not call into HandleComposition
            // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
            // we should pass this message to DefWindowProc directly for
            // this kind of IMEs

            HandleComposition(hWnd,wParam,lParam);

            // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
            // and not IME_PROP_AT_CARET IMEs

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                // EMPTY
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

        case WM_PAINT:
            HandlePaint(hWnd,wParam,lParam);
            break;

        case WM_IME_NOTIFY:
            {
                LRESULT lRet;

                // Normally, we should not call into HandleNotify
                // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
                // we should pass this message to DefWindowProc directly for
                // this kind of IMEs

                lRet = HandleNotify(hWnd, message, wParam, lParam);

                // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
                // and not IME_PROP_AT_CARET IMEs

                if (fdwProperty & IME_PROP_SPECIAL_UI)
                {
                    return (DefWindowProc(hWnd, message, wParam, lParam));
                }
                else if (fdwProperty & IME_PROP_AT_CARET)
                {
                    // EMPTY
                }
                else
                {
                    return (DefWindowProc(hWnd, message, wParam, lParam));
                }

                return lRet;
            }

        case WM_DESTROY:
            hOldIMC = (HIMC)GetWindowLongPtr(hWnd, 0);
            hIMC = ImmAssociateContext(hWnd, hOldIMC);
            ImmDestroyContext(hIMC);
            break;

        case WM_INPUTLANGCHANGE:
            fdwProperty = ImmGetProperty(GetKeyboardLayout(0), IGP_PROPERTY);

            if (hIMC = ImmGetContext(hWnd))
            {
                CANDIDATEFORM cdf = {0};

                if (fdwProperty & IME_PROP_AT_CARET)
                {
                    cdf.dwIndex = 0;
                    cdf.dwStyle = CFS_CANDIDATEPOS;
                    cdf.ptCurrentPos.x = ptImeUIPos.x;
                    cdf.ptCurrentPos.y = ptImeUIPos.y;
                    ImmSetCandidateWindow(hIMC, &cdf);
                }
                else
                {
                    UINT i;

                    // The candidate position should be decided by a near caret
                    // IME. There are 4 candidate form in the input context

                    for (i = 0; i < 4; i++)
                    {
                        if (!ImmGetCandidateWindow(hIMC, i, &cdf))
                        {
                            continue;
                        }

                        if (cdf.dwStyle == CFS_DEFAULT)
                        {
                            continue;
                        }

                        cdf.dwStyle = CFS_DEFAULT;

                        ImmSetCandidateWindow(hIMC, &cdf);
                    }

                }

                ImmReleaseContext(hWnd, hIMC);
            }

            return (DefWindowProc(hWnd, message, wParam, lParam));

        default:
          return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return 0L;
}

BOOL InitApplication ( HANDLE hInstance )

Definition at line 71 of file IMEApps.c.

{
    WNDCLASS  wc = {0};
    BOOL bSuccess = TRUE;

    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = MainWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(hInstance,"MyIcon");
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
    wc.lpszMenuName  = "ImeAppsMenu";
    wc.lpszClassName = "ImeAppsWClass";

    if (! RegisterClass (&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = CompStrWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 4;
    wc.hInstance     = hInstance;
    wc.hIcon         = NULL;
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = "CompStrWndClass";

    if (! RegisterClass (&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = CandListWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = NULL;
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = "CandListWndClass";

    if (! RegisterClass (&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    hFont = GetStockObject(DEFAULT_GUI_FONT);

exit_func:
    return bSuccess;
}

void InitIMEUIPosition ( HWND hWnd )

Definition at line 173 of file IMEApps.c.

{
    HDC hDC = NULL;
    int y;
    SIZE sz;
    HFONT hOldFont = NULL;
    HFONT hDefFont = NULL;
    int height, defheight;

    hDefFont = GetStockObject(DEFAULT_GUI_FONT);

    hOldFont = NULL;

    y = ORG_Y;

    hDC = GetDC(hWnd);

    if (hFont)
    {
        hOldFont = SelectObject(hDC,hDefFont);
    }

    // Get the height of the default gui font.
    GetTextExtentPoint(hDC,"A",1,&sz);
    defheight = sz.cy + 1;

    // Get the height of the font.
    SelectObject(hDC,hFont);
    GetTextExtentPoint(hDC,"A",1,&sz);
    height = sz.cy + 1;

    SelectObject(hDC,hDefFont);
    y += defheight;

    y += height;

    y += height;

    y += defheight;

    y += height;

    y += height;

    ptImeUIPos.y = y;

    SelectObject(hDC,hOldFont);
    ReleaseDC(hWnd, hDC);

    return;
}

BOOL InitInstance | ( | HANDLE | hInstance,
 |  | INT | nCmdShow
 | ) |  |

Definition at line 138 of file IMEApps.c.

{
#ifdef USEWAPI
    char szTitle[] =  "ImeApps W API version";
#else
    char szTitle[] =  "ImeApps";
#endif

    hInst = hInstance;

    ptImeUIPos.x = 0;
    ptImeUIPos.y = 0;

    if (!(hWndMain = CreateWindowEx(0L,
                                    "ImeAppsWClass", (LPSTR)szTitle,
                                    WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
                                    CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
                                  NULL, NULL, hInstance, NULL)))
    {
      return FALSE;
    }

    /* display each windows */
    ShowWindow (hWndMain, nCmdShow);
    UpdateWindow (hWndMain);

    return TRUE;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 231 of file IMEApps.c.

{
    FARPROC lpProc = NULL;
    RECT rect      = {0};
    HMENU hMenu    = NULL;
    HIMC hIMC      = NULL;
    BOOL fOpen     = FALSE;

    switch (message)
    {
        case WM_CREATE:

            // Create Status Window
            CreateTBar(hWnd);
            CreateStatus(hWnd);

            // Create Child Window
            GetClientRect(hWnd, &rect);
            if (!(hWndCompStr = CreateWindowEx(WS_EX_CLIENTEDGE,
              "CompStrWndClass", NULL,
              WS_CHILD | WS_VISIBLE,
              // 0, 0, rect.right, rect.bottom - nStatusHeight,
              0, 0, 0, 0,
              hWnd, NULL, hInst, NULL)))
          return FALSE;

            InitIMEUIPosition(hWndCompStr);

            if (!(hWndCandList = CreateWindowEx(WS_EX_CLIENTEDGE,
              "CandListWndClass", NULL,
              WS_CHILD | WS_VISIBLE,
              0, 0, 0, 0,
              hWnd, NULL, hInst, NULL)))
          return FALSE;

            ShowWindow(hWndCompStr, SW_SHOW);
            ShowWindow(hWndCandList, SW_SHOWNA);

            SetStatusItems(hWnd);

            hMenu = GetMenu(hWnd);
            CheckMenuItem(hMenu,IDM_SHOWCAND,
                                (fShowCand ? MF_CHECKED : MF_UNCHECKED));

            break;

        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
            case IDM_ABOUT:
                lpProc = MakeProcInstance(AboutDlg, hInst);
                DialogBox(hInst, "ABOUTBOX", hWnd, (DLGPROC)lpProc);
                FreeProcInstance(lpProc);
                break;

            case IDM_FONT:
                {
                    CHOOSEFONT cf = {0};
                    LOGFONT lfT = {0};

                    /* Set all structure fields to zero. */

                    memset(&cf, 0, sizeof(CHOOSEFONT));
                    memcpy(&lfT, &lf, sizeof(LOGFONT));

                    cf.lStructSize = sizeof(CHOOSEFONT);
                    cf.hwndOwner = hWnd;
                    cf.lpLogFont = &lfT;
                    cf.Flags = CF_SCREENFONTS | CF_EFFECTS;
                    cf.nFontType = SCREEN_FONTTYPE;

                    if (ChooseFont(&cf))
                    {
                        if (hFont)
                        {
                            DeleteObject(hFont);
                        }

                        memcpy(&lf, &lfT, sizeof(LOGFONT));
                        hFont = CreateFontIndirect(&lf);
                        InvalidateRect(hWndCompStr,NULL,TRUE);
                        UpdateWindow(hWndCompStr);
                    }
                }
                break;

                case IDM_SHOWCAND:
                    hMenu = GetMenu(hWnd);
                    fShowCand = !fShowCand;
                    CheckMenuItem(hMenu,IDM_SHOWCAND,
                                (fShowCand ? MF_CHECKED : MF_UNCHECKED));
                    MoveCompCandWindow(hWnd);
                    UpdateShowCandButton();
                    break;

                case IDM_OPENSTATUS:
                    hIMC = ImmGetContext(hWndCompStr);
                    fOpen = ImmGetOpenStatus(hIMC);
                    ImmSetOpenStatus(hIMC,!fOpen);
                    UpdateShowOpenStatusButton(!fOpen);
                    ImmReleaseContext(hWndCompStr,hIMC);

                    hMenu = GetMenu(hWnd);
                    CheckMenuItem(hMenu,IDM_OPENSTATUS,
                                (fOpen ? MF_UNCHECKED : MF_CHECKED));
                    break;

                case IDM_NATIVEMODE: /* fall-through */
                case IDM_FULLHALF:   /* fall-through */
                case IDM_ROMAN:      /* fall-through */
                case IDM_CHARCODE:   /* fall-through */
                case IDM_HANJA:      /* fall-through */
                case IDM_SOFTKBD:    /* fall-through */
                case IDM_EUDC:       /* fall-through */
                case IDM_SYMBOL:
                    HandleModeCommand(hWnd,wParam,lParam);
                    break;

                case IDM_CONVERT:    /* fall-through */
                case IDM_CANCEL:     /* fall-through */
                case IDM_REVERT:     /* fall-through */
                case IDM_COMPLETE:   /* fall-through */
                case IDM_OPENCAND:   /* fall-through */
                case IDM_CLOSECAND:  /* fall-through */
                case IDM_NEXTCAND:   /* fall-through */
                case IDM_PREVCAND:
                    HandleConvertCommand(hWnd,wParam,lParam);
                    break;

                case IDM_NEXTCLAUSE: /* fall-through */
                case IDM_PREVCLAUSE:
                    HandleChangeAttr(hWnd,(LOWORD(wParam) == IDM_NEXTCLAUSE));
                    break;

                default:
                    break;
            }
            break;

        case WM_SETFOCUS:
            SetFocus(hWndCompStr);
            break;

        case WM_NOTIFY:
            SetTooltipText(hWnd, lParam);
            break;

        case WM_SIZE:
            SendMessage(hWndStatus,message,wParam,lParam);
            SendMessage(hWndToolBar,message,wParam,lParam);

            if (wParam != SIZE_MINIMIZED)
            {
                MoveCompCandWindow(hWnd);
            }
            break;

        case WM_IME_NOTIFY:
            switch (wParam)
            {
                case IMN_OPENSTATUSWINDOW:  /* fall-through */
                case IMN_CLOSESTATUSWINDOW:
                    break;

                case IMN_SETCONVERSIONMODE:
                    return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

        case WM_DESTROY:
            if (hFont)
            {
                DeleteObject(hFont);
            }
            PostQuitMessage(0);
            break;

        default:
            return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return 0L;
}

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | INT | nCmdShow
 | ) |  |

Definition at line 22 of file IMEApps.c.

{
    MSG msg = {0};
    BOOL bRet = FALSE;
    BOOL bSuccess = TRUE;

    if (!InitApplication(hInstance))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!InitInstance(hInstance, nCmdShow))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
    {
        if (bRet == -1)
        {
            bSuccess = FALSE;
            goto exit_func;
        }
        else
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

exit_func:
    if (bSuccess)
    {
        return (int)(msg.wParam);
    }
    else
    {
        return 0;
    }
}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/IMEApps.h File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Defines | Functions | Variables

IMEApps.h File Reference

#include "wapi.h"

Go to the source code of this file.

Defines

#define | CAND_CX 130
#define | COMPREAD_X 10
#define | COMPREAD_Y 60
#define | COMPSTR_X 10
#define | COMPSTR_Y 50
#define | IMESTATUS_CY 20
#define | ORG_X 10
#define | ORG_Y 10
#define | RESULT_X 10
#define | RESULT_Y 10
#define | RESULTREAD_X 10
#define | RESULTREAD_Y 30

Functions

LRESULT CALLBACK | AboutDlg (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | CandListWndProc (HWND, UINT, WPARAM, LPARAM)
void | ClearConvModeParts ()
LRESULT CALLBACK | CompStrWndProc (HWND, UINT, WPARAM, LPARAM)
HMENU | CreateImeMenu (HWND hWnd, HIMC hIMC, LPMYIMEMENUITEMINFO lpImeParentMenu, BOOL fRight)
BOOL CreateStatus ()
BOOL | CreateTBar (HWND)
void | EndMenuItemIDTable ()
DWORD | FindItemData (UINT wID)
LRESULT | HandleCandPaint (HWND, WPARAM, LPARAM)
LRESULT | HandleChangeAttr (HWND hWnd, BOOL fNext)
LRESULT | HandleChar (HWND, WPARAM, LPARAM)
LRESULT | HandleComposition (HWND, WPARAM, LPARAM)
LRESULT | HandleConvertCommand (HWND, WPARAM, LPARAM)
LRESULT | HandleEndComposition (HWND, WPARAM, LPARAM)
LRESULT | HandleModeCommand (HWND hWnd, WPARAM wParam, LPARAM lParam)
LRESULT | HandleNotify (HWND, UINT, WPARAM, LPARAM)
LRESULT | HandlePaint (HWND, WPARAM, LPARAM)
LRESULT | HandleStartComposition (HWND, WPARAM, LPARAM)
BOOL InitApplication (HANDLE)
BOOL | InitInstance (HANDLE, int)
void | InitMenuItemIDTable ()
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
void | MoveCompCandWindow (HWND hWnd)
void | SetConvModeParts (DWORD dwConvMode)
void | SetOpenStatusParts (BOOL fOpen)
void | SetStatusItems (HWND hWnd)
LRESULT | SetTooltipText (HWND hWnd, LPARAM lparam)
void | UpdateButton (UINT iID, UINT iFlags)
void | UpdateModeButton (DWORD dwConv)
void | UpdateShowCandButton ()
void | UpdateShowOpenStatusButton (BOOL fOpen)

Variables

BYTE | bCompAttr [512]
BYTE | bCompReadAttr [512]
DWORD dwCompAttrLen
DWORD | dwCompCls [128]
DWORD dwCompClsLen
DWORD dwCompReadAttrLen
DWORD | dwCompReadCls [128]
DWORD dwCompReadClsLen
DWORD dwCompReadStrLen
DWORD dwCompStrLen
DWORD | dwResultCls [128]
DWORD dwResultClsLen
DWORD | dwResultReadCls [128]
DWORD dwResultReadClsLen
DWORD dwResultReadStrLen
DWORD dwResultStrLen
DWORD fdwProperty
BOOL fShowCand
HFONT | hFont
HANDLE hInst
HWND | hWndCandList
HWND | hWndCompStr
HWND | hWndMain
HWND | hWndStatus
HWND | hWndToolBar
LOGFONT | lf
LPCANDIDATELIST | lpCandList
int | nStatusHeight
POINT | ptImeUIPos
MYCHAR | szCompReadStr [512]
MYCHAR | szCompStr [512]
MYCHAR | szPaintResult [512]
MYCHAR | szPaintResultRead [512]
MYCHAR | szResultReadStr [512]
MYCHAR | szResultStr [512]

Define Documentation

#define CAND_CX 130

Definition at line 25 of file IMEApps.h.

#define COMPREAD_X 10

Definition at line 21 of file IMEApps.h.

#define COMPREAD_Y 60

Definition at line 22 of file IMEApps.h.

#define COMPSTR_X 10

Definition at line 19 of file IMEApps.h.

#define COMPSTR_Y 50

Definition at line 20 of file IMEApps.h.

#define IMESTATUS_CY 20

Definition at line 24 of file IMEApps.h.

#define ORG_X 10

Definition at line 11 of file IMEApps.h.

#define ORG_Y 10

Definition at line 12 of file IMEApps.h.

#define RESULT_X 10

Definition at line 14 of file IMEApps.h.

#define RESULT_Y 10

Definition at line 15 of file IMEApps.h.

#define RESULTREAD_X 10

Definition at line 16 of file IMEApps.h.

#define RESULTREAD_Y 30

Definition at line 17 of file IMEApps.h.

Function Documentation

LRESULT CALLBACK AboutDlg | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 19 of file Dlgs.C.

{
    BOOL bRet = FALSE;

    switch (message)
    {
        case WM_INITDIALOG:
            bRet = TRUE;
            break;

        case WM_COMMAND:
            if (wParam == IDOK ||
                wParam == IDCANCEL)
            {
                EndDialog(hDlg, TRUE);
                bRet = TRUE;
            }
            break;
    }

    return bRet;
}

LRESULT CALLBACK CandListWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 669 of file IMEApps.c.

{
    switch (message)
    {
        case WM_PAINT:
            HandleCandPaint(hWnd,wParam,lParam);
            break;

        case WM_SETFOCUS:
            SetFocus(hWndCompStr);
            break;

        default:
            return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return 0L;
}

void ClearConvModeParts ( )

Definition at line 239 of file Status.c.

{
    int i;

    for (i = SBITEM_CMODEFIRST; i <= SBITEM_CMODELAST; i++)
    {
        SendMessage(hWndStatus,SB_SETTEXT, i,(LPARAM)&szImeNull);
    }
}

LRESULT CALLBACK CompStrWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 422 of file IMEApps.c.

{
    HIMC hIMC    = NULL;
    HIMC hOldIMC = NULL;

    switch (message)
    {
        case WM_CREATE:
            hIMC = ImmCreateContext();
            hOldIMC = ImmAssociateContext(hWnd,hIMC);
            SetWindowLongPtr(hWnd, 0, (LONG_PTR)hOldIMC);
            fdwProperty = ImmGetProperty(GetKeyboardLayout(0), IGP_PROPERTY);
            break;

        case WM_CHAR:
            HandleChar(hWnd,wParam,lParam);
            break;

        case WM_LBUTTONUP:  /* fall-through */
        case WM_RBUTTONUP:
            if (hIMC = ImmGetContext(hWnd))
            {
                HMENU hMenu = NULL;

                InitMenuItemIDTable();
                hMenu = CreateImeMenu(hWnd, hIMC, NULL,(message == WM_RBUTTONUP));

                if (hMenu)
                {
                    DWORD dwItemData;
                    DWORD dwPos = (DWORD)GetMessagePos();
                    int nCmd;

                    nCmd = TrackPopupMenuEx(hMenu,
                                            TPM_RETURNCMD | TPM_NONOTIFY |
                                            TPM_LEFTBUTTON | TPM_LEFTALIGN | TPM_TOPALIGN,
                                            LOWORD(dwPos), HIWORD(dwPos),
                                            hWnd, NULL);

                    if (nCmd)
                    {
                        nCmd -= IDM_STARTIMEMENU;
                        dwItemData = FindItemData(nCmd);
                        ImmNotifyIME(hIMC, NI_IMEMENUSELECTED, nCmd, dwItemData);
                    }
                }
                EndMenuItemIDTable();

                DestroyMenu(hMenu);
            }
            break;

        case WM_IME_SETCONTEXT:
            if (fShowCand)
            {
                lParam &= ~ISC_SHOWUICANDIDATEWINDOW;
            }

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                // EMPTY
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                lParam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
            }
            else
            {
                // EMPTY
            }

            return (DefWindowProc(hWnd, message, wParam, lParam));

        case WM_IME_STARTCOMPOSITION:
            // Normally, we should not call into HandleStartComposition
            // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
            // we should pass this message to DefWindowProc directly for
            // this kind of IMEs

            HandleStartComposition(hWnd,wParam,lParam);

            // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
            // and not IME_PROP_AT_CARET IMEs

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                // EMPTY
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }

            break;

        case WM_IME_ENDCOMPOSITION:
            // Normally, we should not call into HandleEndComposition
            // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
            // we should pass this message to DefWindowProc directly for
            // this kind of IMEs

            HandleEndComposition(hWnd,wParam,lParam);

            // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
            // and not IME_PROP_AT_CARET IMEs

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                // EMPTY
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

        case WM_IME_COMPOSITION:
            // Normally, we should not call into HandleComposition
            // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
            // we should pass this message to DefWindowProc directly for
            // this kind of IMEs

            HandleComposition(hWnd,wParam,lParam);

            // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
            // and not IME_PROP_AT_CARET IMEs

            if (fdwProperty & IME_PROP_SPECIAL_UI)
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            else if (fdwProperty & IME_PROP_AT_CARET)
            {
                // EMPTY
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

        case WM_PAINT:
            HandlePaint(hWnd,wParam,lParam);
            break;

        case WM_IME_NOTIFY:
            {
                LRESULT lRet;

                // Normally, we should not call into HandleNotify
                // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
                // we should pass this message to DefWindowProc directly for
                // this kind of IMEs

                lRet = HandleNotify(hWnd, message, wParam, lParam);

                // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
                // and not IME_PROP_AT_CARET IMEs

                if (fdwProperty & IME_PROP_SPECIAL_UI)
                {
                    return (DefWindowProc(hWnd, message, wParam, lParam));
                }
                else if (fdwProperty & IME_PROP_AT_CARET)
                {
                    // EMPTY
                }
                else
                {
                    return (DefWindowProc(hWnd, message, wParam, lParam));
                }

                return lRet;
            }

        case WM_DESTROY:
            hOldIMC = (HIMC)GetWindowLongPtr(hWnd, 0);
            hIMC = ImmAssociateContext(hWnd, hOldIMC);
            ImmDestroyContext(hIMC);
            break;

        case WM_INPUTLANGCHANGE:
            fdwProperty = ImmGetProperty(GetKeyboardLayout(0), IGP_PROPERTY);

            if (hIMC = ImmGetContext(hWnd))
            {
                CANDIDATEFORM cdf = {0};

                if (fdwProperty & IME_PROP_AT_CARET)
                {
                    cdf.dwIndex = 0;
                    cdf.dwStyle = CFS_CANDIDATEPOS;
                    cdf.ptCurrentPos.x = ptImeUIPos.x;
                    cdf.ptCurrentPos.y = ptImeUIPos.y;
                    ImmSetCandidateWindow(hIMC, &cdf);
                }
                else
                {
                    UINT i;

                    // The candidate position should be decided by a near caret
                    // IME. There are 4 candidate form in the input context

                    for (i = 0; i < 4; i++)
                    {
                        if (!ImmGetCandidateWindow(hIMC, i, &cdf))
                        {
                            continue;
                        }

                        if (cdf.dwStyle == CFS_DEFAULT)
                        {
                            continue;
                        }

                        cdf.dwStyle = CFS_DEFAULT;

                        ImmSetCandidateWindow(hIMC, &cdf);
                    }

                }

                ImmReleaseContext(hWnd, hIMC);
            }

            return (DefWindowProc(hWnd, message, wParam, lParam));

        default:
          return (DefWindowProc(hWnd, message, wParam, lParam));
    }
    return 0L;
}

HMENU CreateImeMenu | ( | HWND | hWnd,
 |  | HIMC | hIMC,
 |  | LPMYIMEMENUITEMINFO | lpImeParentMenu,
 |  | BOOL | fRight
 | ) |  |

Definition at line 176 of file ImeMenu.c.

{
    HMENU hMenu = NULL;
    DWORD dwSize, dwNum, dwI;
    MENUITEMINFO mii = {0};
    LPMYIMEMENUITEMINFO lpImeMenu = NULL;

    dwNum = MyImmGetImeMenuItems(hIMC, fRight ? IGIMIF_RIGHTMENU : 0,
                                 IGIMII_CMODE |
                                 IGIMII_SMODE |
                                 IGIMII_CONFIGURE |
                                 IGIMII_TOOLS |
                                 IGIMII_HELP |
                                 IGIMII_OTHER,
                                 lpImeParentMenu, NULL, 0);

    if (!dwNum)
    {
        return 0;
    }

    dwSize = dwNum * sizeof(MYIMEMENUITEMINFO);

    lpImeMenu = (LPMYIMEMENUITEMINFO)GlobalAlloc(GPTR, dwSize);

    dwNum = MyImmGetImeMenuItems(hIMC, fRight ? IGIMIF_RIGHTMENU : 0,
                                 IGIMII_CMODE |
                                 IGIMII_SMODE |
                                 IGIMII_CONFIGURE |
                                 IGIMII_TOOLS |
                                 IGIMII_HELP |
                                 IGIMII_OTHER,
                                 lpImeParentMenu, lpImeMenu, dwSize);

    hMenu = CreatePopupMenu();

    for (dwI = 0 ; dwI < dwNum; dwI++)
    {
        AddIDTableEntry(lpImeMenu->wID, lpImeMenu->dwItemData);
        FillMenuItemInfo(hWnd, hIMC, &mii, lpImeMenu + dwI, fRight);
        InsertMenuItem(hMenu, dwI, TRUE, &mii);
    }

    GlobalFree((HANDLE)lpImeMenu);

    return hMenu;
}

BOOL CreateStatus ( )
BOOL CreateTBar ( HWND )

Definition at line 75 of file ToolBar.c.

{
    hWndToolbar = CreateToolbarEx(hwnd,
                                  WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS,
                                  IDM_TOOLBAR,
                                  NUMIMAGES,
                                  hInst,
                                  IDB_BMP,
                                  tbButton,
                                  sizeof(tbButton)/sizeof(TBBUTTON),
                                  BUTTONWIDTH,
                                  BUTTONHEIGHT,
                                  IMAGEWIDTH,
                                  IMAGEHEIGHT,
                                  sizeof(TBBUTTON));

    return (hWndToolbar != NULL);
}

void EndMenuItemIDTable ( )

Definition at line 24 of file ImeMenu.c.

{
    if (lpdwIDTable)
    {
        GlobalFree((HANDLE)lpdwIDTable);
        lpdwIDTable = NULL;
    }

    nIDTable = 0;
}

DWORD FindItemData ( UINT wID )

Definition at line 63 of file ImeMenu.c.

{
    int i;
    for (i = 0; i < nIDTable ; i++)
    {
        if (*(lpdwIDTable+(i*2)) == wID)
        {
            return *(lpdwIDTable+(i*2)+1);
        }
    }
    return 0;
}

LRESULT HandleCandPaint | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 293 of file Paint.c.

{
    HDC hDC = NULL;
    PAINTSTRUCT ps = {0};
    UINT i;
    int x = ORG_X;
    int y = ORG_Y;
    SIZE sz;
    HFONT hOldFont = NULL;
    HFONT hDefFont = GetStockObject(DEFAULT_GUI_FONT);
    int height,defheight;
    LPDWORD lpdwOffset = NULL;
    RECT rect = {0};
    const char  szCand[] = "Candidate List";
    const char  szCandNull[] = "";
    const char  szCandRead[] = "Reading";
    const char  szCandCode[] = "Code";
    const char  szCandMean[] = "Meaning";
    const char  szCandRadi[] = "Radical";
    const char  szCandStrk[] = "Stroke";

    GetClientRect(hWnd,&rect);

    hDC = BeginPaint(hWnd, &ps);

    if (!lpCandList)
    {
        goto pt_cand_10;
    }

    if (hFont)
    {
        hOldFont = SelectObject(hDC,hDefFont);
    }

    // Get the height of the default gui font.
    GetTextExtentPoint(hDC,"A",1,&sz);
    defheight = sz.cy + 1;

    // Get the height of the font.
    SelectObject(hDC,hFont);
    GetTextExtentPoint(hDC,"A",1,&sz);
    height = sz.cy + 1;

    SelectObject(hDC,hDefFont);
    SetTextColor(hDC,RGB(0,0,0));
    SetBkMode(hDC,TRANSPARENT);
    TextOut(hDC,ORG_X,y,szCand,lstrlen(szCand));
    y += defheight;

    switch (lpCandList->dwStyle)
    {
        case IME_CAND_READ:
            TextOut(hDC,ORG_X,y,szCandRead,lstrlen(szCandRead));
            break;

        case IME_CAND_CODE:
            TextOut(hDC,ORG_X,y,szCandCode,lstrlen(szCandCode));
            break;

        case IME_CAND_MEANING:
            TextOut(hDC,ORG_X,y,szCandMean,lstrlen(szCandMean));
            break;

        case IME_CAND_RADICAL:
            TextOut(hDC,ORG_X,y,szCandRadi,lstrlen(szCandRadi));
            break;

        case IME_CAND_STROKE:
            TextOut(hDC,ORG_X,y,szCandStrk,lstrlen(szCandStrk));
            break;

        default:
            break;

    }
    y += defheight;

    if (!lpCandList->dwCount)
    {
        goto pt_cand_10;
    }

    lpdwOffset = &lpCandList->dwOffset[0];

    lpdwOffset += lpCandList->dwPageStart;

    for (i = lpCandList->dwPageStart;
         (i < lpCandList->dwCount) &&
         (i < lpCandList->dwPageStart + lpCandList->dwPageSize) &&
         (y <= rect.bottom + height); i++)
    {
        LPSTR lpstr = (LPSTR)lpCandList + *lpdwOffset++;

        x = ORG_X;

        SelectObject(hDC,hFont);
        if (i != lpCandList->dwSelection)
        {
            SetTextColor(hDC,RGB(0,0,0));
            SetBkMode(hDC,TRANSPARENT);
        }
        else
        {
            SetTextColor(hDC,RGB(255,255,255));
            SetBkColor(hDC,RGB(0,0,255));
            SetBkMode(hDC,OPAQUE);
        }

        TextOut(hDC,x,y,lpstr,lstrlen(lpstr));
        y += height;
    }

    SelectObject(hDC,hOldFont);

pt_cand_10:
    EndPaint(hWnd,&ps);
    return 1;
}

LRESULT HandleChangeAttr | ( | HWND | hWnd,
 |  | BOOL | fNext
 | ) |  |

Definition at line 37 of file Setcomp.c.

{
    BYTE bAttr[512];
    BYTE bAttrRead[512];
    UINT i,j;
    UINT uClause;
    UINT uMaxClause;
    UINT uCnt;
    UINT uCntRead;
    BYTE bAt;
    BOOL fAttrOK = FALSE;
    BOOL fAttrReadOK = FALSE;
    HIMC hIMC = NULL;
    BOOL bRet = FALSE;

    uMaxClause = (dwCompClsLen / sizeof(DWORD)) - 1;
    uClause = GetTargetClause();

    if (uClause == (DWORD)-1L)
    {
         return 0L;
    }

    if (fNext)
    {
        if (uClause + 1 <= uMaxClause)
        {
            uClause++;
        }
        else
        {
            return 0L;
        }
    }
    else
    {
        if (uClause > 0)
        {
            uClause--;
        }
        else
        {
            return 0L;
        }
    }

    uCnt = 0;

    if (uClause < uMaxClause)
    {
        for (i=0; i < uMaxClause; i++)
        {
            if (i == uClause)
            {
                switch (bCompAttr[dwCompCls[i]])
                {
                    case ATTR_INPUT:
                        bAt = ATTR_TARGET_NOTCONVERTED;
                        break;
                        break;

                    case ATTR_CONVERTED:
                        bAt = ATTR_TARGET_CONVERTED;
                        break;

                    default:
                        bAt = bCompAttr[dwCompCls[i]];
                        break;
                }
            }
            else
            {
                switch (bCompAttr[dwCompCls[i]])
                {
                    case ATTR_TARGET_CONVERTED:
                        bAt = ATTR_CONVERTED;
                        break;
                        break;

                    case ATTR_TARGET_NOTCONVERTED:
                        bAt = ATTR_INPUT;
                        break;

                    default:
                        bAt = bCompAttr[dwCompCls[i]];
                        break;
                }
            }

            for (j = 0; j < (dwCompCls[i+1] - dwCompCls[i]); j++)
            {
                bAttr[uCnt++] = bAt;
            }
        }
        fAttrOK = TRUE;
    }

    uCntRead = 0;

    if (uClause < uMaxClause)
    {
        for (i=0; i < uMaxClause; i++)
        {
            if (i == uClause)
            {
                switch (bCompReadAttr[dwCompReadCls[i]])
                {
                    case ATTR_INPUT:
                        bAt = ATTR_TARGET_NOTCONVERTED;
                        break;
                        break;

                    case ATTR_CONVERTED:
                        bAt = ATTR_TARGET_CONVERTED;
                        break;

                    default:
                        bAt = bCompReadAttr[dwCompReadCls[i]];
                        break;
                }
            }
            else
            {
                switch (bCompReadAttr[dwCompReadCls[i]])
                {
                    case ATTR_TARGET_CONVERTED:
                        bAt = ATTR_CONVERTED;
                        break;
                        break;

                    case ATTR_TARGET_NOTCONVERTED:
                        bAt = ATTR_INPUT;
                        break;

                    default:
                        bAt = bCompReadAttr[dwCompReadCls[i]];
                        break;
                }
            }

            for (j = 0; j < (dwCompReadCls[i+1] - dwCompReadCls[i]); j++)
            {
                bAttrRead[uCntRead++] = bAt;
            }
        }
        fAttrReadOK = TRUE;
    }

    if (fAttrReadOK && fAttrOK)
    {
        hIMC = ImmGetContext(hWndCompStr);
#ifdef USEWAPI
        bRet = ImmSetCompositionStringW(hIMC,SCS_CHANGEATTR,bAttr,uCnt,
                                                    bAttrRead,uCntRead);
#else
        bRet = ImmSetCompositionString(hIMC,SCS_CHANGEATTR,bAttr,uCnt,
                                                    bAttrRead,uCntRead);
#endif
        // bRet = ImmSetCompositionString(hIMC,SCS_CHANGEATTR,NULL,0,
        //                                             bAttrRead,uCntRead);
        // bRet = ImmSetCompositionString(hIMC,SCS_CHANGEATTR,bAttr,uCnt,
        //                                             NULL,0);
        ImmReleaseContext(hWndCompStr,hIMC);
    }
    else
    {
#ifdef DEBUG
        OutputDebugString("Can not call ImmSetCompositionString\r\n");
        bRet = TRUE;
#endif
    }

#ifdef DEBUG
    if (!bRet)
    {
        OutputDebugString("ImmSetCompositionString return FALSE\r\n");
    }
#endif

    return 1;
}

LRESULT HandleChar | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 293 of file Comp.c.

{
    RECT rc = {0};
    HDC hIC = NULL;
    SIZE sz0, sz1;
    HFONT hOldFont = NULL;
    LPMYSTR lp = NULL;
    // is the previous received char is a DBCS lead byte char ?
    static BOOL fIsPrevLeadByte = FALSE;

    GetClientRect(hWnd,&rc);
    hIC = CreateIC("DISPLAY", NULL, NULL, NULL);
    hOldFont = SelectObject(hIC,hFont);
#ifdef USEWAPI
    GetTextExtentPointW(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
    GetTextExtentPointW(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#else
    GetTextExtentPoint(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
    GetTextExtentPoint(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#endif
    if (sz0.cx + sz1.cx >= rc.right)
    {
        szPaintResult[0] = MYTEXT('\0');
        szPaintResultRead[0] = MYTEXT('\0');
    }
    SelectObject(hIC,hOldFont);
    DeleteDC(hIC);

    lp = szPaintResult + Mylstrlen(szPaintResult);

#ifndef USEWAPI
    if (fIsPrevLeadByte)
    {
        // remove , and append second byte for showing DBCS char
        if (*(lp - 1) == ',')
        {
            lp--;
        }
    }
#endif

    // append second byte
    *lp++ = (MYCHAR)(BYTE)wParam;
    *lp++ = MYTEXT(',');
    *lp++ = MYTEXT('\0');

    lp = szPaintResultRead + Mylstrlen(szPaintResultRead);

#ifndef USEWAPI
    if (fIsPrevLeadByte)
    {
        // remove , and append second byte for showing DBCS char
        if (*(lp - 1) == ',')
        {
            lp--;
        }

        fIsPrevLeadByte = FALSE;
    }
    else
    {
        fIsPrevLeadByte = IsDBCSLeadByte((BYTE)wParam);
    }
#endif

    *lp++ = (BYTE)wParam;
    *lp++ = MYTEXT(',');
    *lp++ = MYTEXT('\0');

    InvalidateRect(hWnd,NULL,TRUE);
    UpdateWindow(hWnd);

    return 1;
}

LRESULT HandleComposition | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 116 of file Comp.c.

{
    HIMC hIMC = NULL;
    BOOL fRedraw = FALSE;

    hIMC = ImmGetContext(hWnd);

    if (lParam & GCS_COMPSTR)
    {
        dwCompStrLen = MyImmGetCompositionString(hIMC,GCS_COMPSTR,szCompStr,sizeof(szCompStr));
        dwCompStrLen /= sizeof(MYCHAR);
        szCompStr[dwCompStrLen] = MYTEXT('\0');
        fRedraw = TRUE;
    }
    else
    {
        dwCompStrLen = 0;
        szCompStr[0] = MYTEXT('\0');
    }

    if (lParam & GCS_COMPATTR)
    {
        dwCompAttrLen = MyImmGetCompositionString(hIMC,GCS_COMPATTR,bCompAttr,sizeof(bCompAttr));
        fRedraw = TRUE;
    }
    else
    {
        dwCompAttrLen = 0;
        bCompAttr[0] = 0;
    }

    if (lParam & GCS_COMPCLAUSE)
    {
        dwCompClsLen = MyImmGetCompositionString(hIMC,GCS_COMPCLAUSE,dwCompCls,sizeof(dwCompCls));
        fRedraw = TRUE;
    }
    else
    {
        dwCompClsLen = 0;
        dwCompCls[0] = 0;
        dwCompCls[1] = 0;
    }

    if (lParam & GCS_COMPREADSTR)
    {
        dwCompReadStrLen = MyImmGetCompositionString(hIMC,GCS_COMPREADSTR,szCompReadStr,sizeof(szCompReadStr));
        dwCompReadStrLen /= sizeof(MYCHAR);
        szCompReadStr[dwCompReadStrLen] = MYTEXT('\0');
        fRedraw = TRUE;
    }
    else
    {
        dwCompReadStrLen = 0;
        szCompReadStr[0] = MYTEXT('\0');
    }

    if (lParam & GCS_COMPREADATTR)
    {
        dwCompReadAttrLen = MyImmGetCompositionString(hIMC,GCS_COMPREADATTR,bCompReadAttr,sizeof(bCompReadAttr));
        fRedraw = TRUE;
    }
    else
    {
        dwCompReadAttrLen = 0;
        bCompReadAttr[0] = 0;
    }

    if (lParam & GCS_COMPREADCLAUSE)
    {
        dwCompReadClsLen = MyImmGetCompositionString(hIMC,GCS_COMPREADCLAUSE,dwCompReadCls,sizeof(dwCompReadCls));
        fRedraw = TRUE;
    }
    else
    {
        dwCompReadClsLen = 0;
        dwCompReadCls[0] = 0;
        dwCompReadCls[1] = 0;
    }

    if (lParam & GCS_RESULTSTR)
    {
        RECT rc = {0};
        HDC hIC = NULL;
        SIZE sz0, sz1;
        HFONT hOldFont = NULL;

        if (lParam & GCS_RESULTCLAUSE)
        {
            dwResultClsLen = MyImmGetCompositionString(hIMC,GCS_RESULTCLAUSE,dwResultCls,sizeof(dwResultCls));
        }
        else
        {
            dwResultClsLen = 0;
            dwResultCls[0] = 0;
            dwResultCls[1] = 0;
        }

        dwResultStrLen = MyImmGetCompositionString(hIMC,GCS_RESULTSTR,szResultStr,sizeof(szResultStr));
        dwResultStrLen /= sizeof(MYCHAR);
        szResultStr[dwResultStrLen] = MYTEXT('\0');

        // szPaintResult may overflow..
        GetClientRect(hWnd,&rc);
        hIC = CreateIC("DISPLAY", NULL, NULL, NULL);
        hOldFont = SelectObject(hIC,hFont);
#ifdef USEWAPI
        GetTextExtentPointW(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
        GetTextExtentPointW(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#else
        GetTextExtentPoint(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
        GetTextExtentPoint(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
#endif
        if (sz0.cx + sz1.cx >= rc.right)
        {
            szPaintResult[0] = MYTEXT('\0');
            szPaintResultRead[0] = MYTEXT('\0');
        }
        SelectObject(hIC,hOldFont);
        DeleteDC(hIC);

        MakePaintString(hWnd,szResultStr,dwResultStrLen,dwResultCls,dwResultClsLen,szPaintResult);

        fRedraw = TRUE;
    }
    else
    {
        dwResultStrLen = 0;
        szResultStr[0] = MYTEXT('\0');
        dwResultClsLen = 0;
        dwResultCls[0] = 0;
        dwResultCls[1] = 0;
    }

    if (lParam & GCS_RESULTREADSTR)
    {
        if (lParam & GCS_RESULTREADCLAUSE)
        {
            dwResultReadClsLen = MyImmGetCompositionString(hIMC,GCS_RESULTREADCLAUSE,dwResultReadCls,sizeof(dwResultReadCls));
            fRedraw = TRUE;
        }
        else
        {
            dwResultReadClsLen = 0;
            dwResultReadCls[0] = 0;
            dwResultReadCls[1] = 0;
        }
        dwResultReadStrLen = MyImmGetCompositionString(hIMC,GCS_RESULTREADSTR,szResultReadStr,sizeof(szResultReadStr));
        dwResultReadStrLen /= sizeof(MYCHAR);
        szResultReadStr[dwResultReadStrLen] = MYTEXT('\0');
        MakePaintString(hWnd,szResultReadStr,dwResultReadStrLen,dwResultReadCls,dwResultReadClsLen,szPaintResultRead);
        fRedraw = TRUE;
    }
    else
    {
        dwResultReadStrLen = 0;
        szResultReadStr[0] = MYTEXT('\0');
        dwResultReadClsLen = 0;
        dwResultReadCls[0] = 0;
        dwResultReadCls[1] = 0;
    }

    if (fRedraw)
    {
        InvalidateRect(hWnd,NULL,TRUE);
        UpdateWindow(hWnd);
    }
    return 1;
}

LRESULT HandleConvertCommand | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 129 of file Mode.c.

{
    HIMC hIMC = ImmGetContext(hWndCompStr);
    DWORD dwSel;
    DWORD dwSize;
    LPCANDIDATELIST lpCL = NULL;

    switch(wParam)
    {
        case IDM_CONVERT:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_CONVERT,0);
            break;

        case IDM_CANCEL:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_CANCEL,0);
            break;

        case IDM_REVERT:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_REVERT,0);
            break;

        case IDM_COMPLETE:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_COMPLETE,0);
            break;

        case IDM_OPENCAND:
            ImmNotifyIME(hIMC,NI_OPENCANDIDATE,0,0);
            break;

        case IDM_CLOSECAND:
            ImmNotifyIME(hIMC,NI_CLOSECANDIDATE,0,0);
            break;

        case IDM_NEXTCAND: /* fall-through */
        case IDM_PREVCAND:
            if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
            {
                lpCL = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);

                ImmGetCandidateList(hIMC,0x0,lpCL,dwSize);

                dwSel = lpCL->dwSelection;

                if (wParam == IDM_NEXTCAND)
                {
                   if (++dwSel >= lpCL->dwCount)
                   {
                      dwSel = 0;
                   }
                }
                else
                {
                   if (dwSel)
                   {
                      dwSel--;
                   }
                   else
                   {
                      dwSel = lpCL->dwCount - 1;
                   }
                }
                GlobalFree((HANDLE)lpCL);

                ImmNotifyIME(hIMC,NI_SELECTCANDIDATESTR,0,dwSel);
            }
            break;

    }

    ImmReleaseContext(hWndCompStr,hIMC);

    return 1;
}

LRESULT HandleEndComposition | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 62 of file Comp.c.

{
#ifdef DEBUG
    OutputDebugString("WM_ENDCOMPOSITIONSTRING!!!\r\n");
#endif
    dwCompStrLen      = 0;
    dwCompAttrLen     = 0;
    dwCompClsLen      = 0;
    dwCompReadStrLen  = 0;
    dwCompReadAttrLen = 0;
    dwCompReadClsLen  = 0;
    dwResultStrLen      = 0;
    dwResultClsLen      = 0;
    dwResultReadStrLen  = 0;
    dwResultReadClsLen  = 0;
    InvalidateRect(hWnd,NULL,TRUE);

    return 1;
}

LRESULT HandleModeCommand | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 15 of file Mode.c.

{
    HIMC hIMC = ImmGetContext(hWndCompStr);
    DWORD dwConv, dwSent;
    DWORD dwTemp;

    ImmGetConversionStatus(hIMC,&dwConv,&dwSent);

    switch(LOWORD(wParam))
    {
        case IDM_NATIVEMODE:
            dwTemp = dwConv & ~IME_CMODE_LANGUAGE;

            switch (dwConv & IME_CMODE_LANGUAGE)
            {
                case IME_CMODE_ALPHANUMERIC:
                    dwTemp |= IME_CMODE_NATIVE;
                    break;

                case IME_CMODE_NATIVE:
                    dwTemp |= (IME_CMODE_NATIVE | IME_CMODE_KATAKANA);
                    break;

                case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA): /* fall-through */
                default:
                    break;
            }
            dwConv = dwTemp;
            break;

        case IDM_FULLHALF:
            if (dwConv & IME_CMODE_FULLSHAPE)
            {
                dwConv &= ~IME_CMODE_FULLSHAPE;
            }
            else
            {
                dwConv |= IME_CMODE_FULLSHAPE;
            }
            break;

        case IDM_ROMAN:
            if (dwConv & IME_CMODE_ROMAN)
            {
                dwConv &= ~IME_CMODE_ROMAN;
            }
            else
            {
                dwConv |= IME_CMODE_ROMAN;
            }
            break;

        case IDM_CHARCODE:
            if (dwConv & IME_CMODE_CHARCODE)
            {
                dwConv &= ~IME_CMODE_CHARCODE;
            }
            else
            {
                dwConv |= IME_CMODE_CHARCODE;
            }
            break;

        case IDM_HANJA:
            if (dwConv & IME_CMODE_HANJACONVERT)
            {
                dwConv &= ~IME_CMODE_HANJACONVERT;
            }
            else
            {
                dwConv |= IME_CMODE_HANJACONVERT;
            }
            break;

        case IDM_SOFTKBD:
            if (dwConv & IME_CMODE_SOFTKBD)
            {
                dwConv &= ~IME_CMODE_SOFTKBD;
            }
            else
            {
                dwConv |= IME_CMODE_SOFTKBD;
            }
            break;

        case IDM_EUDC:
            if (dwConv & IME_CMODE_EUDC)
            {
                dwConv &= ~IME_CMODE_EUDC;
            }
            else
            {
                dwConv |= IME_CMODE_EUDC;
            }
            break;

        case IDM_SYMBOL:
            if (dwConv & IME_CMODE_SYMBOL)
            {
                dwConv &= ~IME_CMODE_SYMBOL;
            }
            else
            {
                dwConv |= IME_CMODE_SYMBOL;
            }
            break;
    }

    ImmSetConversionStatus(hIMC,dwConv,dwSent);
    ImmReleaseContext(hWndCompStr,hIMC);

    return 1L;
}

LRESULT HandleNotify | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 369 of file Comp.c.

{
    HIMC hIMC = NULL;
    BOOL fOpen = FALSE;
    DWORD dwConvMode, dwSentMode;

    switch (wParam)
    {
        case IMN_OPENSTATUSWINDOW: /* fall-through */
        case IMN_CLOSESTATUSWINDOW:
            break;

        case IMN_SETOPENSTATUS:
            SetStatusItems(hWnd);

            hIMC = ImmGetContext(hWnd);
            fOpen = ImmGetOpenStatus(hIMC);
            UpdateShowOpenStatusButton(fOpen);

            ImmReleaseContext(hWnd,hIMC);
            break;

        case IMN_SETCONVERSIONMODE:
            hIMC = ImmGetContext(hWnd);
            fOpen = ImmGetOpenStatus(hIMC);
            ImmGetConversionStatus(hIMC,&dwConvMode,&dwSentMode);
            if (fOpen)
            {
                SetConvModeParts(dwConvMode);
                UpdateModeButton(dwConvMode);
            }
            else
            {
                ClearConvModeParts();
            }
            ImmReleaseContext(hWnd,hIMC);
            break;

        case IMN_OPENCANDIDATE:
            if (!fShowCand || (lParam != 0x01))
            {
                if (fdwProperty & IME_PROP_SPECIAL_UI)
                {
                    // Normally, we only need to set the composition window
                    // position for a special UI IME
                }
                else if (fdwProperty & IME_PROP_AT_CARET)
                {
                    CANDIDATEFORM cdf;
                    HIMC          hIMC;

                    hIMC = ImmGetContext(hWnd);

                    cdf.dwIndex = 0;
                    cdf.dwStyle = CFS_CANDIDATEPOS;
                    cdf.ptCurrentPos.x = ptImeUIPos.x;
                    cdf.ptCurrentPos.y = ptImeUIPos.y;
                    ImmSetCandidateWindow(hIMC,&cdf);

                    ImmReleaseContext(hWnd,hIMC);
                }
                else
                {
                    // Normally, we only need to set the composition window
                    // position for a near caret IME
                }

                return (DefWindowProc(hWnd, message, wParam, lParam));
            }

        case IMN_CHANGECANDIDATE:

#ifdef _DEBUG
            {
                char szDev[80];
                DWORD dwSize;
                LPCANDIDATELIST lpC;

                hIMC = ImmGetContext(hWnd);
                if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
                {
                    lpC = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);

                    ImmGetCandidateList(hIMC,0x0,lpC,dwSize);

                    OutputDebugString("DumpCandList!!!\r\n");
                    wsprintf((LPSTR)szDev,"dwCount %d\r\n",lpC->dwCount);
                    OutputDebugString((LPSTR)szDev);
                    wsprintf((LPSTR)szDev,"dwSelection %d\r\n",lpC->dwSelection);
                    OutputDebugString((LPSTR)szDev);
                    wsprintf((LPSTR)szDev,"dwPageStart %d\r\n",lpC->dwPageStart);
                    OutputDebugString((LPSTR)szDev);
                    wsprintf((LPSTR)szDev,"dwPageSize %d\r\n",lpC->dwPageSize);
                    OutputDebugString((LPSTR)szDev);
                    GlobalFree((HANDLE)lpC);
                }
            }
#endif
            if (fShowCand && (lParam == 0x01))
            {
                DWORD dwSize;

                if (!lpCandList)
                    lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,sizeof(CANDIDATELIST));

                hIMC = ImmGetContext(hWnd);
                if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
                {
                    GlobalFree((HANDLE)lpCandList);
                    lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);

                    ImmGetCandidateList(hIMC,0x0,lpCandList,dwSize);
                }
                else
                {
                    memset(lpCandList, 0, sizeof(CANDIDATELIST));
                }

                InvalidateRect(hWndCandList,NULL,TRUE);
                UpdateWindow(hWndCandList);

                ImmReleaseContext(hWnd,hIMC);
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

        case IMN_CLOSECANDIDATE:
            if (fShowCand && (lParam == 0x01))
            {
                if (!lpCandList)
                {
                    lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,sizeof(CANDIDATELIST));
                }

                memset(lpCandList, 0, sizeof(CANDIDATELIST));
                InvalidateRect(hWndCandList,NULL,TRUE);
                UpdateWindow(hWndCandList);
            }
            else
            {
                return (DefWindowProc(hWnd, message, wParam, lParam));
            }
            break;

       default:
            return (DefWindowProc(hWnd, message, wParam, lParam));
    }

    return 0;
}

LRESULT HandlePaint | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 61 of file Paint.c.

{
    HDC hDC = NULL;
    PAINTSTRUCT ps = {0};
    UINT i;
    int x = ORG_X;
    int y = ORG_Y;
    SIZE sz;
    HFONT hOldFont = NULL;
    HFONT hDefFont = GetStockObject(DEFAULT_GUI_FONT);
    int height,defheight;
    const char  szResult[] = "Result String";
    const char  szComp[] = "Composition String";
    RECT rc = {0};

    GetClientRect(hWnd,&rc);

    hDC = BeginPaint(hWnd, &ps);

    if (hFont)
    {
        hOldFont = SelectObject(hDC,hDefFont);
    }

    // Get the height of the default gui font.
    GetTextExtentPoint(hDC,"A",1,&sz);
    defheight = sz.cy + 1;

    // Get the height of the font.
    SelectObject(hDC,hFont);
    GetTextExtentPoint(hDC,"A",1,&sz);
    height = sz.cy + 1;

    SelectObject(hDC,hDefFont);
    SetTextColor(hDC,RGB(0,0,0));
    SetBkMode(hDC,TRANSPARENT);
    TextOut(hDC,ORG_X,y,szResult,lstrlen(szResult));
    y += defheight;

    if (Mylstrlen(szPaintResult))
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(255,0,0));
        SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
        TextOutW(hDC,x,y,szPaintResult,Mylstrlen(szPaintResult));
#else
        TextOut(hDC,x,y,szPaintResult,Mylstrlen(szPaintResult));
#endif
    }

    y += height;

    if (Mylstrlen(szPaintResultRead))
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(255,0,0));
        SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
        TextOutW(hDC,x,y,szPaintResultRead,Mylstrlen(szPaintResultRead));
#else
        TextOut(hDC,x,y,szPaintResultRead,Mylstrlen(szPaintResultRead));
#endif
    }
#if 0
    if (dwResultReadStrLen)
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(0,0,0));
        SetBkMode(hDC,TRANSPARENT);

        if (dwResultReadClsLen)
        {
            dwResultReadCls[127] = 0;
            i = 1;

            SetTextColor(hDC,RGB(255,0,0));
            while (dwResultReadCls[i] && dwResultReadCls[i-1] < dwResultReadStrLen)
            {
                DWORD dwTextLen = dwResultReadCls[i] - dwResultReadCls[i-1];
                LPSTR lpStart = szResultReadStr + dwResultReadCls[i-1];

                TextOut(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
                x += sz.cx;

                TextOut(hDC,x,y,",",1);
                GetTextExtentPoint(hDC,",",1,&sz);
                x += (sz.cx + 2);

                i++;
            }
        }
        else
        {
            SetTextColor(hDC,RGB(255,0,0));
            SetBkMode(hDC,TRANSPARENT);
            TextOut(hDC,x,y,szResultReadStr,dwResultReadStrLen);
        }

    }
#endif

    y += height;

    SelectObject(hDC,hDefFont);
    SetTextColor(hDC,RGB(0,0,0));
    SetBkMode(hDC,TRANSPARENT);
    TextOut(hDC,ORG_X,y,szComp,lstrlen(szComp));
    y += defheight;

    if (dwCompStrLen)
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(0,0,0));

        if (dwCompClsLen && dwCompAttrLen)
        {
            dwCompCls[127] = 0;
            i = 1;

            while (dwCompCls[i] && dwCompCls[i-1] < dwCompStrLen)
            {
                DWORD dwTextLen = dwCompCls[i] - dwCompCls[i-1];
                LPMYSTR lpStart = szCompStr + dwCompCls[i-1];

                SetAttrColor(hDC, bCompAttr[dwCompCls[i-1]]);
#ifdef USEWAPI
                TextOutW(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPointW(hDC,lpStart,dwTextLen,&sz);
#else
                TextOut(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
#endif
                x += sz.cx;

                SetTextColor(hDC,RGB(0,0,0));
                SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
                TextOutW(hDC,x,y,MYTEXT(","),1);
                GetTextExtentPointW(hDC,MYTEXT(","),1,&sz);
#else
                TextOut(hDC,x,y,",",1);
                GetTextExtentPoint(hDC,",",1,&sz);
#endif
                x += (sz.cx + 2);

                i++;
            }
        }
        else
        {
            SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
            TextOutW(hDC,x,y,szCompStr,dwCompStrLen);
#else
            TextOut(hDC,x,y,szCompStr,dwCompStrLen);
#endif
        }

    }

    y += height;

    if (dwCompReadStrLen)
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(0,0,0));
        SetBkMode(hDC,TRANSPARENT);

        if (dwCompReadClsLen && dwCompReadAttrLen)
        {
            dwCompReadCls[127] = 0;
            i = 1;

            while (dwCompReadCls[i] && dwCompReadCls[i-1] < dwCompReadStrLen)
            {
                DWORD dwTextLen = dwCompReadCls[i] - dwCompReadCls[i-1];
                LPMYSTR lpStart = szCompReadStr + dwCompReadCls[i-1];

                SetAttrColor(hDC, bCompReadAttr[dwCompReadCls[i-1]]);
#ifdef USEWAPI
                TextOutW(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPointW(hDC,lpStart,dwTextLen,&sz);
#else
                TextOut(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
#endif
                x += sz.cx;

                SetTextColor(hDC,RGB(0,0,0));
                SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
                TextOutW(hDC,x,y,MYTEXT(","),1);
                GetTextExtentPointW(hDC,MYTEXT(","),1,&sz);
#else
                TextOut(hDC,x,y,",",1);
                GetTextExtentPoint(hDC,",",1,&sz);
#endif
                x += (sz.cx + 2);

                i++;
            }
        }
        else
        {
            SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
            TextOutW(hDC,x,y,szCompReadStr,dwCompReadStrLen);
#else
            TextOut(hDC,x,y,szCompReadStr,dwCompReadStrLen);
#endif
        }

    }

    y += height;

    ptImeUIPos.y = y;

    SelectObject(hDC,hOldFont);
    EndPaint(hWnd,&ps);
    return 1;
}

LRESULT HandleStartComposition | ( | HWND | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 16 of file Comp.c.

{
    COMPOSITIONFORM cpf = {0};
    HIMC hIMC = NULL;

#ifdef DEBUG
    OutputDebugString("WM_STARTCOMPOSITIONSTRING!!!\r\n");
#endif

    if (fdwProperty & IME_PROP_SPECIAL_UI)
    {
        // Normally, we need to set the composition window
        // position to caret position for a special UI IME
    }
    else if (fdwProperty & IME_PROP_AT_CARET)
    {
        // If an application show composition string by itself, we do not
        // need to set the position of composition window for an at caret
        // IME.

        return 1;
    }
    else
    {
        // Normally, we need to set the composition window
        // position to caret position for a near caret IME
    }

    hIMC = ImmGetContext(hWnd);

    if (!hIMC)
    {
        return 1;
    }

    cpf.dwStyle = CFS_POINT;
    cpf.ptCurrentPos.x = ptImeUIPos.x;
    cpf.ptCurrentPos.y = ptImeUIPos.y;

    ImmSetCompositionWindow(hIMC,&cpf);

    ImmReleaseContext(hWnd,hIMC);

    return 1;
}

BOOL InitApplication ( HANDLE )

Definition at line 123 of file ClipText.c.

{
    WNDCLASS  wc = {0};

    wc.lpfnWndProc = (WNDPROC) MainWndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName =  TEXT("CliptextMenu");
    wc.lpszClassName = TEXT("CliptextWClass");

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | ,
 |  | int |
 | ) |  |

Definition at line 126 of file ComDlg32.C.

{
    HWND            hWnd;

  // Save off the handle to the current instance.
    g_hInst = hInstance;

    // Create a main window for this application instance.
    hWnd = CreateWindow(
        "Comdlg32WClass",
        "Common Dialog Sample Application",
        WS_OVERLAPPEDWINDOW,            // Window style.
        CW_USEDEFAULT,                  // Default horizontal position.
        CW_USEDEFAULT,                  // Default vertical position.
        CW_USEDEFAULT,                  // Default width.
        CW_USEDEFAULT,                  // Default height.
        NULL,                           // Overlapped windows have no parent.
        NULL,                           // Use the window class menu.
        g_hInst,                        // This instance owns this window.
        NULL                            // Pointer not needed.
    );

    // If window could not be created, return "failure".
    if (!hWnd)
        return (FALSE);

    // Register the window messages to receive.
    cdmsgShareViolation = RegisterWindowMessage(szmsgSHAREVIOLATION);
    cdmsgFileOK         = RegisterWindowMessage(szmsgFILEOK);
    cdmsgHelp           = RegisterWindowMessage(szCommdlgHelp);

    // Make the window visible; update its client area; and return "success".
    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);
    return (TRUE);

}

void InitMenuItemIDTable ( )

Definition at line 40 of file ImeMenu.c.

{
    EndMenuItemIDTable();
    lpdwIDTable = GlobalAlloc(GPTR, 100 * 2 * sizeof(DWORD));
}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

void MoveCompCandWindow ( HWND hWnd )

Definition at line 15 of file Subs.c.

{
    RECT rc = {0};
    RECT rcClient = {0};
    int cx;

    GetClientRect(hWnd, &rcClient);

    GetWindowRect(hWndToolBar,&rc);
    ScreenToClient(hWnd,(LPPOINT)&rc.right);
    rcClient.top = rc.bottom;

    GetWindowRect(hWndStatus,&rc);
    ScreenToClient(hWnd,(LPPOINT)&rc.left);
    rcClient.bottom = rc.top;

    if (fShowCand)
    {
        if (rcClient.right >= CAND_CX * 3)
        {
            cx = rcClient.right-rcClient.left - CAND_CX;
        }
        else
        {
            cx = (rcClient.right-rcClient.left) * 2 / 3;
        }

        MoveWindow(hWndCompStr,
                   rcClient.left,
                   rcClient.top,
                   cx,
                   rcClient.bottom-rcClient.top,
                   TRUE);
        MoveWindow(hWndCandList,
                   cx,
                   rcClient.top,
                   rcClient.right-rcClient.left - cx,
                   rcClient.bottom-rcClient.top,
                   TRUE);
    }
    else
    {
        MoveWindow(hWndCompStr,
                   rcClient.left,
                   rcClient.top,
                   rcClient.right-rcClient.left,
                   rcClient.bottom-rcClient.top,
                   TRUE);
        MoveWindow(hWndCandList, 0, 0, 0, 0, TRUE);
    }

}

void SetConvModeParts ( DWORD dwConvMode )

Definition at line 118 of file Status.c.

{
    switch (dwConvMode & IME_CMODE_LANGUAGE)
    {
        case IME_CMODE_ALPHANUMERIC:
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeAlpha);
            break;

        case IME_CMODE_NATIVE:
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeNative);

            break;

        case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA):
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeKatakana);

            break;

        default:
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeNull);
            break;
    }

    if (dwConvMode & IME_CMODE_ROMAN)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_ROMAN,(LPARAM)&szImeRoman);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_ROMAN,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_CHARCODE)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_CHARCODE,(LPARAM)&szImeCode);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_CHARCODE,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_FULLSHAPE)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_FULLSHAPE,(LPARAM)&szImeFull);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_FULLSHAPE,(LPARAM)&szImeHalf);
    }

    if (dwConvMode & IME_CMODE_HANJACONVERT)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_HANJA,(LPARAM)&szImeHanja);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_HANJA,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_SOFTKBD)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_SOFTKBD,(LPARAM)&szImeSoftKbd);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_SOFTKBD,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_NOCONVERSION)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_NOCONVERSION,(LPARAM)&szImeNoConv);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_NOCONVERSION,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_EUDC)
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_EUDC,(LPARAM)&szImeEUDC);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_EUDC,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_SYMBOL)
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_SYMBOL,(LPARAM)&szImeSymbol);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_SYMBOL,(LPARAM)&szImeNull);
    }
}

void SetOpenStatusParts ( BOOL fOpen )

Definition at line 104 of file Status.c.

{
    if (fOpen)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_OPENSTATUS,(LPARAM)&szImeOpen);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_OPENSTATUS,(LPARAM)&szImeClose);
    }
}

void SetStatusItems ( HWND hWnd )

Definition at line 79 of file Status.c.

{
    HIMC hIMC = NULL;
    BOOL fOpen;
    DWORD dwConvMode,dwSentMode;

    hIMC = ImmGetContext(hWnd);

    fOpen = ImmGetOpenStatus(hIMC);
    SetOpenStatusParts(fOpen);
    ImmGetConversionStatus(hIMC,&dwConvMode,&dwSentMode);

    if (fOpen)
    {
        SetConvModeParts(dwConvMode);
    }
    else
    {
        ClearConvModeParts();
    }

    ImmReleaseContext(hWnd,hIMC);
}

LRESULT SetTooltipText | ( | HWND | hWnd,
 |  | LPARAM | lparam
 | ) |  |

Definition at line 130 of file ToolBar.c.

{
    LPTOOLTIPTEXT lpToolTipText = NULL;
    static char   szBuffer[64];

    lpToolTipText = (LPTOOLTIPTEXT)lParam;
    if (lpToolTipText->hdr.code == TTN_NEEDTEXT)
    {
        LoadString(hInst,
                   (UINT)lpToolTipText->hdr.idFrom,   // string ID == command ID
                   szBuffer,
                   (int)sizeof(szBuffer));

        lpToolTipText->lpszText = szBuffer;
    }
    return 0;
}

void UpdateButton | ( | UINT | iID,
 |  | UINT | iFlags
 | ) |  |

Definition at line 148 of file ToolBar.c.

{
    int iCurrentFlags;

    iCurrentFlags = (int)SendMessage(hWndToolBar,
                                     TB_GETSTATE,
                                     iID, 0L);

    if (iCurrentFlags & TBSTATE_PRESSED)
    {
        iFlags |= TBSTATE_PRESSED;
    }

    SendMessage(hWndToolBar,
                TB_SETSTATE,
                iID,
                MAKELPARAM(iFlags, 0));
    return;
}

void UpdateModeButton ( DWORD dwConv )

Definition at line 189 of file ToolBar.c.

{
    int nIDTBB;

    switch (dwConv & IME_CMODE_LANGUAGE)
    {
        case IME_CMODE_ALPHANUMERIC:
            nIDTBB = IDTBB_ALPHA;
            break;

        case IME_CMODE_NATIVE:
            nIDTBB = IDTBB_NATIVE;
            break;

        case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA):
            nIDTBB = IDTBB_KATAKANA;
            break;

        default:
            nIDTBB = IDTBB_ALPHA;
            break;

    }
    SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_NATIVEMODE,
                MAKELPARAM(nIDTBB, 0));

    if (dwConv & IME_CMODE_FULLSHAPE)
    {
        nIDTBB = IDTBB_FULL;
    }
    else
    {
        nIDTBB = IDTBB_HALF;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_FULLHALF,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_ROMAN)
    {
        nIDTBB = IDTBB_ROMAN;
    }
    else
    {
        nIDTBB = IDTBB_NOROMAN;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_ROMAN,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_CHARCODE)
    {
        nIDTBB = IDTBB_CHARCODE;
    }
    else
    {
        nIDTBB = IDTBB_NOCHARCODE;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_CHARCODE,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_HANJACONVERT)
    {
        nIDTBB = IDTBB_HANJA;
    }
    else
    {
        nIDTBB = IDTBB_NOHANJA;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_HANJA,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_SOFTKBD)
    {
        nIDTBB = IDTBB_SOFTKBD;
    }
    else
    {
        nIDTBB = IDTBB_NOSOFTKBD;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_SOFTKBD,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_EUDC)
    {
        nIDTBB = IDTBB_EUDC;
    }
    else
    {
        nIDTBB = IDTBB_NOEUDC;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_EUDC,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_SYMBOL)
    {
        nIDTBB = IDTBB_SYMBOL;
    }
    else
    {
        nIDTBB = IDTBB_NOSYMBOL;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_SYMBOL,
                    MAKELPARAM(nIDTBB, 0));
    }

    return;
}

void UpdateShowCandButton ( )

Definition at line 178 of file ToolBar.c.

{

    SendMessage(hWndToolBar,
                TB_CHANGEBITMAP,
                IDM_SHOWCAND,
                MAKELPARAM((fShowCand ? IDTBB_SHOWCAND : IDTBB_NOSHOWCAND), 0));
    return;
}

void UpdateShowOpenStatusButton ( BOOL fOpen )

Definition at line 168 of file ToolBar.c.

{

    SendMessage(hWndToolBar,
                TB_CHANGEBITMAP,
                IDM_OPENSTATUS,
                MAKELPARAM((fOpen ? IDTBB_OPEN : IDTBB_CLOSE), 0));
    return;
}

Variable Documentation

BYTE bCompAttr[512]

Definition at line 40 of file Data.c.

BYTE bCompReadAttr[512]

Definition at line 43 of file Data.c.

DWORD dwCompAttrLen

Definition at line 29 of file Data.c.

DWORD dwCompCls[128]

Definition at line 41 of file Data.c.

DWORD dwCompClsLen

Definition at line 30 of file Data.c.

DWORD dwCompReadAttrLen

Definition at line 32 of file Data.c.

DWORD dwCompReadCls[128]

Definition at line 44 of file Data.c.

DWORD dwCompReadClsLen

Definition at line 33 of file Data.c.

DWORD dwCompReadStrLen

Definition at line 31 of file Data.c.

DWORD dwCompStrLen

Definition at line 28 of file Data.c.

DWORD dwResultCls[128]

Definition at line 46 of file Data.c.

DWORD dwResultClsLen

Definition at line 35 of file Data.c.

DWORD dwResultReadCls[128]

Definition at line 48 of file Data.c.

DWORD dwResultReadClsLen

Definition at line 37 of file Data.c.

DWORD dwResultReadStrLen

Definition at line 36 of file Data.c.

DWORD dwResultStrLen

Definition at line 34 of file Data.c.

DWORD fdwProperty

Definition at line 101 of file Main.C.

BOOL fShowCand

Definition at line 25 of file Data.c.

HFONT hFont

Definition at line 77 of file status.cpp.

HANDLE hInst

Definition at line 37 of file Demo.c.

HWND hWndCandList

Definition at line 18 of file Data.c.

HWND hWndCompStr

Definition at line 15 of file Data.c.

HWND hWndMain

Definition at line 40 of file halftone.c.

HWND hWndStatus

Definition at line 17 of file Data.c.

HWND hWndToolBar

Definition at line 16 of file Data.c.

LOGFONT lf

Definition at line 32 of file FontView.c.

LPCANDIDATELIST lpCandList

Definition at line 52 of file Data.c.

int nStatusHeight

Definition at line 23 of file Data.c.

POINT ptImeUIPos

Definition at line 54 of file Data.c.

MYCHAR szCompReadStr[512]

Definition at line 42 of file Data.c.

MYCHAR szCompStr[512]

Definition at line 39 of file Data.c.

MYCHAR szPaintResult[512]

Definition at line 49 of file Data.c.

MYCHAR szPaintResultRead[512]

Definition at line 50 of file Data.c.

MYCHAR szResultReadStr[512]

Definition at line 47 of file Data.c.

MYCHAR szResultStr[512]

Definition at line 45 of file Data.c.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/ImeMenu.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Functions | Variables

ImeMenu.c File Reference

#include <windows.h>
#include <commdlg.h>
#include <commctrl.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Functions

void | AddIDTableEntry (UINT wID, DWORD dwItemData)
HMENU | CreateImeMenu (HWND hWnd, HIMC hIMC, LPMYIMEMENUITEMINFO lpImeParentMenu, BOOL fRight)
void | EndMenuItemIDTable ()
void | FillMenuItemInfo (HWND hWnd, HIMC hIMC, LPMENUITEMINFO lpmii, LPMYIMEMENUITEMINFO lpIme, BOOL fRight)
DWORD | FindItemData (UINT wID)
void | InitMenuItemIDTable ()

Variables

LPDWORD | lpdwIDTable = NULL
int | nIDTable = 0

Function Documentation

void AddIDTableEntry | ( | UINT | wID,
 |  | DWORD | dwItemData
 | ) |  |

Definition at line 51 of file ImeMenu.c.

{
    *(lpdwIDTable+(nIDTable*2)) = wID;
    *(lpdwIDTable+(nIDTable*2)+1) = dwItemData;
    nIDTable++;
}

HMENU CreateImeMenu | ( | HWND | hWnd,
 |  | HIMC | hIMC,
 |  | LPMYIMEMENUITEMINFO | lpImeParentMenu,
 |  | BOOL | fRight
 | ) |  |

Definition at line 176 of file ImeMenu.c.

{
    HMENU hMenu = NULL;
    DWORD dwSize, dwNum, dwI;
    MENUITEMINFO mii = {0};
    LPMYIMEMENUITEMINFO lpImeMenu = NULL;

    dwNum = MyImmGetImeMenuItems(hIMC, fRight ? IGIMIF_RIGHTMENU : 0,
                                 IGIMII_CMODE |
                                 IGIMII_SMODE |
                                 IGIMII_CONFIGURE |
                                 IGIMII_TOOLS |
                                 IGIMII_HELP |
                                 IGIMII_OTHER,
                                 lpImeParentMenu, NULL, 0);

    if (!dwNum)
    {
        return 0;
    }

    dwSize = dwNum * sizeof(MYIMEMENUITEMINFO);

    lpImeMenu = (LPMYIMEMENUITEMINFO)GlobalAlloc(GPTR, dwSize);

    dwNum = MyImmGetImeMenuItems(hIMC, fRight ? IGIMIF_RIGHTMENU : 0,
                                 IGIMII_CMODE |
                                 IGIMII_SMODE |
                                 IGIMII_CONFIGURE |
                                 IGIMII_TOOLS |
                                 IGIMII_HELP |
                                 IGIMII_OTHER,
                                 lpImeParentMenu, lpImeMenu, dwSize);

    hMenu = CreatePopupMenu();

    for (dwI = 0 ; dwI < dwNum; dwI++)
    {
        AddIDTableEntry(lpImeMenu->wID, lpImeMenu->dwItemData);
        FillMenuItemInfo(hWnd, hIMC, &mii, lpImeMenu + dwI, fRight);
        InsertMenuItem(hMenu, dwI, TRUE, &mii);
    }

    GlobalFree((HANDLE)lpImeMenu);

    return hMenu;
}

void EndMenuItemIDTable ( )

Definition at line 24 of file ImeMenu.c.

{
    if (lpdwIDTable)
    {
        GlobalFree((HANDLE)lpdwIDTable);
        lpdwIDTable = NULL;
    }

    nIDTable = 0;
}

void FillMenuItemInfo | ( | HWND | hWnd,
 |  | HIMC | hIMC,
 |  | LPMENUITEMINFO | lpmii,
 |  | LPMYIMEMENUITEMINFO | lpIme,
 |  | BOOL | fRight
 | ) |  |

Definition at line 82 of file ImeMenu.c.

{
    FillMemory((PVOID)lpmii, sizeof(MENUITEMINFO), 0);
    lpmii->cbSize = sizeof(MENUITEMINFO);
    lpmii->fMask = 0;

    // Set fType;
    if (lpIme->fType)
    {
        lpmii->fMask |= MIIM_TYPE;
        lpmii->fType = 0;

        if (lpIme->fType & IMFT_RADIOCHECK)
        {
            lpmii->fType |= MFT_RADIOCHECK;
        }

        if (lpIme->fType & IMFT_SEPARATOR)
        {
            lpmii->fType |= MFT_SEPARATOR;
        }

    }

    lpmii->fMask |= MIIM_ID;
    lpmii->wID = lpIme->wID + IDM_STARTIMEMENU;

    if (lpIme->fType & IMFT_SUBMENU)
    {
        lpmii->fMask |= MIIM_SUBMENU;
        lpmii->hSubMenu = CreateImeMenu(hWnd, hIMC, lpIme, fRight);
    }

    lpmii->fMask |= MIIM_STATE;
    lpmii->fState = lpIme->fState;

    if (lpIme->hbmpChecked &&  lpIme->hbmpUnchecked)
    {
       lpmii->fMask |= MIIM_CHECKMARKS;
       lpmii->hbmpChecked = lpIme->hbmpChecked;
       lpmii->hbmpUnchecked = lpIme->hbmpUnchecked;
    }

    lpmii->fMask |= MIIM_DATA;
    lpmii->dwItemData = lpIme->dwItemData;

    if (lpIme->hbmpItem)
    {
       lpmii->fMask |= MIIM_BITMAP;
       lpmii->hbmpItem = lpIme->hbmpItem;
    }

#ifdef USEWAPI
    {
        BOOL bUDC;
        int i;
        char   szTemp[IMEMENUITEM_STRING_SIZE] = {0};

        i = WideCharToMultiByte(CP_ACP,
                                0,
                                lpIme->szString,
                                (int)wcslen(lpIme->szString),
                                szTemp,
                                IMEMENUITEM_STRING_SIZE,
                                (LPSTR)NULL,
                                &bUDC);
        szTemp[i] = '\0';

        if (lstrlen(szTemp))
        {
            lpmii->fMask |= MIIM_STRING;
            lstrcpyn((LPSTR)lpIme->szString, szTemp, IMEMENUITEM_STRING_SIZE-1);
            lpmii->dwTypeData = (LPSTR)lpIme->szString;
            lpmii->cch = lstrlen((LPSTR)lpIme->szString);
        }
    }
#else
    if (lstrlen(lpIme->szString))
    {
        lpmii->fMask |= MIIM_STRING;
        lpmii->dwTypeData = lpIme->szString;
        lpmii->cch = lstrlen(lpIme->szString);
    }
#endif

}

DWORD FindItemData ( UINT wID )

Definition at line 63 of file ImeMenu.c.

{
    int i;
    for (i = 0; i < nIDTable ; i++)
    {
        if (*(lpdwIDTable+(i*2)) == wID)
        {
            return *(lpdwIDTable+(i*2)+1);
        }
    }
    return 0;
}

void InitMenuItemIDTable ( )

Definition at line 40 of file ImeMenu.c.

{
    EndMenuItemIDTable();
    lpdwIDTable = GlobalAlloc(GPTR, 100 * 2 * sizeof(DWORD));
}

Variable Documentation

LPDWORD lpdwIDTable = NULL

Definition at line 16 of file ImeMenu.c.

int nIDTable = 0

Definition at line 17 of file ImeMenu.c.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Mode.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Functions

Mode.c File Reference

#include <windows.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Functions

LRESULT | HandleConvertCommand (HWND hWnd, WPARAM wParam, LPARAM lParam)
LRESULT | HandleModeCommand (HWND hWnd, WPARAM wParam, LPARAM lParam)

Function Documentation

LRESULT HandleConvertCommand | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 129 of file Mode.c.

{
    HIMC hIMC = ImmGetContext(hWndCompStr);
    DWORD dwSel;
    DWORD dwSize;
    LPCANDIDATELIST lpCL = NULL;

    switch(wParam)
    {
        case IDM_CONVERT:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_CONVERT,0);
            break;

        case IDM_CANCEL:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_CANCEL,0);
            break;

        case IDM_REVERT:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_REVERT,0);
            break;

        case IDM_COMPLETE:
            ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_COMPLETE,0);
            break;

        case IDM_OPENCAND:
            ImmNotifyIME(hIMC,NI_OPENCANDIDATE,0,0);
            break;

        case IDM_CLOSECAND:
            ImmNotifyIME(hIMC,NI_CLOSECANDIDATE,0,0);
            break;

        case IDM_NEXTCAND: /* fall-through */
        case IDM_PREVCAND:
            if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
            {
                lpCL = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);

                ImmGetCandidateList(hIMC,0x0,lpCL,dwSize);

                dwSel = lpCL->dwSelection;

                if (wParam == IDM_NEXTCAND)
                {
                   if (++dwSel >= lpCL->dwCount)
                   {
                      dwSel = 0;
                   }
                }
                else
                {
                   if (dwSel)
                   {
                      dwSel--;
                   }
                   else
                   {
                      dwSel = lpCL->dwCount - 1;
                   }
                }
                GlobalFree((HANDLE)lpCL);

                ImmNotifyIME(hIMC,NI_SELECTCANDIDATESTR,0,dwSel);
            }
            break;

    }

    ImmReleaseContext(hWndCompStr,hIMC);

    return 1;
}

LRESULT HandleModeCommand | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 15 of file Mode.c.

{
    HIMC hIMC = ImmGetContext(hWndCompStr);
    DWORD dwConv, dwSent;
    DWORD dwTemp;

    ImmGetConversionStatus(hIMC,&dwConv,&dwSent);

    switch(LOWORD(wParam))
    {
        case IDM_NATIVEMODE:
            dwTemp = dwConv & ~IME_CMODE_LANGUAGE;

            switch (dwConv & IME_CMODE_LANGUAGE)
            {
                case IME_CMODE_ALPHANUMERIC:
                    dwTemp |= IME_CMODE_NATIVE;
                    break;

                case IME_CMODE_NATIVE:
                    dwTemp |= (IME_CMODE_NATIVE | IME_CMODE_KATAKANA);
                    break;

                case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA): /* fall-through */
                default:
                    break;
            }
            dwConv = dwTemp;
            break;

        case IDM_FULLHALF:
            if (dwConv & IME_CMODE_FULLSHAPE)
            {
                dwConv &= ~IME_CMODE_FULLSHAPE;
            }
            else
            {
                dwConv |= IME_CMODE_FULLSHAPE;
            }
            break;

        case IDM_ROMAN:
            if (dwConv & IME_CMODE_ROMAN)
            {
                dwConv &= ~IME_CMODE_ROMAN;
            }
            else
            {
                dwConv |= IME_CMODE_ROMAN;
            }
            break;

        case IDM_CHARCODE:
            if (dwConv & IME_CMODE_CHARCODE)
            {
                dwConv &= ~IME_CMODE_CHARCODE;
            }
            else
            {
                dwConv |= IME_CMODE_CHARCODE;
            }
            break;

        case IDM_HANJA:
            if (dwConv & IME_CMODE_HANJACONVERT)
            {
                dwConv &= ~IME_CMODE_HANJACONVERT;
            }
            else
            {
                dwConv |= IME_CMODE_HANJACONVERT;
            }
            break;

        case IDM_SOFTKBD:
            if (dwConv & IME_CMODE_SOFTKBD)
            {
                dwConv &= ~IME_CMODE_SOFTKBD;
            }
            else
            {
                dwConv |= IME_CMODE_SOFTKBD;
            }
            break;

        case IDM_EUDC:
            if (dwConv & IME_CMODE_EUDC)
            {
                dwConv &= ~IME_CMODE_EUDC;
            }
            else
            {
                dwConv |= IME_CMODE_EUDC;
            }
            break;

        case IDM_SYMBOL:
            if (dwConv & IME_CMODE_SYMBOL)
            {
                dwConv &= ~IME_CMODE_SYMBOL;
            }
            else
            {
                dwConv |= IME_CMODE_SYMBOL;
            }
            break;
    }

    ImmSetConversionStatus(hIMC,dwConv,dwSent);
    ImmReleaseContext(hWndCompStr,hIMC);

    return 1L;
}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Paint.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Defines | Functions

Paint.c File Reference

#include <windows.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Defines

#define | DEBUG 1

Functions

LRESULT | HandleCandPaint (HWND hWnd, WPARAM wParam, LPARAM lParam)
LRESULT | HandlePaint (HWND hWnd, WPARAM wParam, LPARAM lParam)
void | SetAttrColor (HDC hDC, BYTE bAttr)

Define Documentation

#define DEBUG 1

Definition at line 14 of file Paint.c.

Function Documentation

LRESULT HandleCandPaint | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 293 of file Paint.c.

{
    HDC hDC = NULL;
    PAINTSTRUCT ps = {0};
    UINT i;
    int x = ORG_X;
    int y = ORG_Y;
    SIZE sz;
    HFONT hOldFont = NULL;
    HFONT hDefFont = GetStockObject(DEFAULT_GUI_FONT);
    int height,defheight;
    LPDWORD lpdwOffset = NULL;
    RECT rect = {0};
    const char  szCand[] = "Candidate List";
    const char  szCandNull[] = "";
    const char  szCandRead[] = "Reading";
    const char  szCandCode[] = "Code";
    const char  szCandMean[] = "Meaning";
    const char  szCandRadi[] = "Radical";
    const char  szCandStrk[] = "Stroke";

    GetClientRect(hWnd,&rect);

    hDC = BeginPaint(hWnd, &ps);

    if (!lpCandList)
    {
        goto pt_cand_10;
    }

    if (hFont)
    {
        hOldFont = SelectObject(hDC,hDefFont);
    }

    // Get the height of the default gui font.
    GetTextExtentPoint(hDC,"A",1,&sz);
    defheight = sz.cy + 1;

    // Get the height of the font.
    SelectObject(hDC,hFont);
    GetTextExtentPoint(hDC,"A",1,&sz);
    height = sz.cy + 1;

    SelectObject(hDC,hDefFont);
    SetTextColor(hDC,RGB(0,0,0));
    SetBkMode(hDC,TRANSPARENT);
    TextOut(hDC,ORG_X,y,szCand,lstrlen(szCand));
    y += defheight;

    switch (lpCandList->dwStyle)
    {
        case IME_CAND_READ:
            TextOut(hDC,ORG_X,y,szCandRead,lstrlen(szCandRead));
            break;

        case IME_CAND_CODE:
            TextOut(hDC,ORG_X,y,szCandCode,lstrlen(szCandCode));
            break;

        case IME_CAND_MEANING:
            TextOut(hDC,ORG_X,y,szCandMean,lstrlen(szCandMean));
            break;

        case IME_CAND_RADICAL:
            TextOut(hDC,ORG_X,y,szCandRadi,lstrlen(szCandRadi));
            break;

        case IME_CAND_STROKE:
            TextOut(hDC,ORG_X,y,szCandStrk,lstrlen(szCandStrk));
            break;

        default:
            break;

    }
    y += defheight;

    if (!lpCandList->dwCount)
    {
        goto pt_cand_10;
    }

    lpdwOffset = &lpCandList->dwOffset[0];

    lpdwOffset += lpCandList->dwPageStart;

    for (i = lpCandList->dwPageStart;
         (i < lpCandList->dwCount) &&
         (i < lpCandList->dwPageStart + lpCandList->dwPageSize) &&
         (y <= rect.bottom + height); i++)
    {
        LPSTR lpstr = (LPSTR)lpCandList + *lpdwOffset++;

        x = ORG_X;

        SelectObject(hDC,hFont);
        if (i != lpCandList->dwSelection)
        {
            SetTextColor(hDC,RGB(0,0,0));
            SetBkMode(hDC,TRANSPARENT);
        }
        else
        {
            SetTextColor(hDC,RGB(255,255,255));
            SetBkColor(hDC,RGB(0,0,255));
            SetBkMode(hDC,OPAQUE);
        }

        TextOut(hDC,x,y,lpstr,lstrlen(lpstr));
        y += height;
    }

    SelectObject(hDC,hOldFont);

pt_cand_10:
    EndPaint(hWnd,&ps);
    return 1;
}

LRESULT HandlePaint | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 61 of file Paint.c.

{
    HDC hDC = NULL;
    PAINTSTRUCT ps = {0};
    UINT i;
    int x = ORG_X;
    int y = ORG_Y;
    SIZE sz;
    HFONT hOldFont = NULL;
    HFONT hDefFont = GetStockObject(DEFAULT_GUI_FONT);
    int height,defheight;
    const char  szResult[] = "Result String";
    const char  szComp[] = "Composition String";
    RECT rc = {0};

    GetClientRect(hWnd,&rc);

    hDC = BeginPaint(hWnd, &ps);

    if (hFont)
    {
        hOldFont = SelectObject(hDC,hDefFont);
    }

    // Get the height of the default gui font.
    GetTextExtentPoint(hDC,"A",1,&sz);
    defheight = sz.cy + 1;

    // Get the height of the font.
    SelectObject(hDC,hFont);
    GetTextExtentPoint(hDC,"A",1,&sz);
    height = sz.cy + 1;

    SelectObject(hDC,hDefFont);
    SetTextColor(hDC,RGB(0,0,0));
    SetBkMode(hDC,TRANSPARENT);
    TextOut(hDC,ORG_X,y,szResult,lstrlen(szResult));
    y += defheight;

    if (Mylstrlen(szPaintResult))
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(255,0,0));
        SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
        TextOutW(hDC,x,y,szPaintResult,Mylstrlen(szPaintResult));
#else
        TextOut(hDC,x,y,szPaintResult,Mylstrlen(szPaintResult));
#endif
    }

    y += height;

    if (Mylstrlen(szPaintResultRead))
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(255,0,0));
        SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
        TextOutW(hDC,x,y,szPaintResultRead,Mylstrlen(szPaintResultRead));
#else
        TextOut(hDC,x,y,szPaintResultRead,Mylstrlen(szPaintResultRead));
#endif
    }
#if 0
    if (dwResultReadStrLen)
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(0,0,0));
        SetBkMode(hDC,TRANSPARENT);

        if (dwResultReadClsLen)
        {
            dwResultReadCls[127] = 0;
            i = 1;

            SetTextColor(hDC,RGB(255,0,0));
            while (dwResultReadCls[i] && dwResultReadCls[i-1] < dwResultReadStrLen)
            {
                DWORD dwTextLen = dwResultReadCls[i] - dwResultReadCls[i-1];
                LPSTR lpStart = szResultReadStr + dwResultReadCls[i-1];

                TextOut(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
                x += sz.cx;

                TextOut(hDC,x,y,",",1);
                GetTextExtentPoint(hDC,",",1,&sz);
                x += (sz.cx + 2);

                i++;
            }
        }
        else
        {
            SetTextColor(hDC,RGB(255,0,0));
            SetBkMode(hDC,TRANSPARENT);
            TextOut(hDC,x,y,szResultReadStr,dwResultReadStrLen);
        }

    }
#endif

    y += height;

    SelectObject(hDC,hDefFont);
    SetTextColor(hDC,RGB(0,0,0));
    SetBkMode(hDC,TRANSPARENT);
    TextOut(hDC,ORG_X,y,szComp,lstrlen(szComp));
    y += defheight;

    if (dwCompStrLen)
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(0,0,0));

        if (dwCompClsLen && dwCompAttrLen)
        {
            dwCompCls[127] = 0;
            i = 1;

            while (dwCompCls[i] && dwCompCls[i-1] < dwCompStrLen)
            {
                DWORD dwTextLen = dwCompCls[i] - dwCompCls[i-1];
                LPMYSTR lpStart = szCompStr + dwCompCls[i-1];

                SetAttrColor(hDC, bCompAttr[dwCompCls[i-1]]);
#ifdef USEWAPI
                TextOutW(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPointW(hDC,lpStart,dwTextLen,&sz);
#else
                TextOut(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
#endif
                x += sz.cx;

                SetTextColor(hDC,RGB(0,0,0));
                SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
                TextOutW(hDC,x,y,MYTEXT(","),1);
                GetTextExtentPointW(hDC,MYTEXT(","),1,&sz);
#else
                TextOut(hDC,x,y,",",1);
                GetTextExtentPoint(hDC,",",1,&sz);
#endif
                x += (sz.cx + 2);

                i++;
            }
        }
        else
        {
            SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
            TextOutW(hDC,x,y,szCompStr,dwCompStrLen);
#else
            TextOut(hDC,x,y,szCompStr,dwCompStrLen);
#endif
        }

    }

    y += height;

    if (dwCompReadStrLen)
    {
        x = ORG_X;
        SelectObject(hDC,hFont);
        SetTextColor(hDC,RGB(0,0,0));
        SetBkMode(hDC,TRANSPARENT);

        if (dwCompReadClsLen && dwCompReadAttrLen)
        {
            dwCompReadCls[127] = 0;
            i = 1;

            while (dwCompReadCls[i] && dwCompReadCls[i-1] < dwCompReadStrLen)
            {
                DWORD dwTextLen = dwCompReadCls[i] - dwCompReadCls[i-1];
                LPMYSTR lpStart = szCompReadStr + dwCompReadCls[i-1];

                SetAttrColor(hDC, bCompReadAttr[dwCompReadCls[i-1]]);
#ifdef USEWAPI
                TextOutW(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPointW(hDC,lpStart,dwTextLen,&sz);
#else
                TextOut(hDC,x,y,lpStart,dwTextLen);
                GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
#endif
                x += sz.cx;

                SetTextColor(hDC,RGB(0,0,0));
                SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
                TextOutW(hDC,x,y,MYTEXT(","),1);
                GetTextExtentPointW(hDC,MYTEXT(","),1,&sz);
#else
                TextOut(hDC,x,y,",",1);
                GetTextExtentPoint(hDC,",",1,&sz);
#endif
                x += (sz.cx + 2);

                i++;
            }
        }
        else
        {
            SetBkMode(hDC,TRANSPARENT);
#ifdef USEWAPI
            TextOutW(hDC,x,y,szCompReadStr,dwCompReadStrLen);
#else
            TextOut(hDC,x,y,szCompReadStr,dwCompReadStrLen);
#endif
        }

    }

    y += height;

    ptImeUIPos.y = y;

    SelectObject(hDC,hOldFont);
    EndPaint(hWnd,&ps);
    return 1;
}

void SetAttrColor | ( | HDC | hDC,
 |  | BYTE | bAttr
 | ) |  |

Definition at line 18 of file Paint.c.

{
    switch (bAttr)
    {
        case ATTR_INPUT:
            SetTextColor(hDC,RGB(0,0,0));
            SetBkMode(hDC,TRANSPARENT);
            break;

        case ATTR_TARGET_CONVERTED:
            SetTextColor(hDC,RGB(255,255,255));
            SetBkMode(hDC,OPAQUE);
            SetBkColor(hDC,RGB(0,0,255));
            break;

        case ATTR_CONVERTED:
            SetTextColor(hDC,RGB(0,0,255));
            SetBkMode(hDC,TRANSPARENT);
            break;

        case ATTR_TARGET_NOTCONVERTED:
            SetTextColor(hDC,RGB(255,255,255));
            SetBkMode(hDC,OPAQUE);
            SetBkColor(hDC,RGB(0,255,0));
            break;

        case ATTR_INPUT_ERROR:
            SetTextColor(hDC,RGB(255,255,0));
            SetBkMode(hDC,TRANSPARENT);
            break;

        case ATTR_FIXEDCONVERTED:
            SetTextColor(hDC,RGB(255,0,0));
            SetBkMode(hDC,TRANSPARENT);
            break;

        default:
            SetTextColor(hDC,RGB(0,0,0));
            SetBkMode(hDC,TRANSPARENT);
            break;
    }
}

Generated on Wed Nov 13 2024 16:53:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Pch.h File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps

Pch.h File Reference

#include <windows.h>
#include <commdlg.h>
#include <commctrl.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Resource.h File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDB_BMP 700
#define | IDC_STATIC -1
#define | IDM_ABOUT 10002
#define | IDM_CANCEL 10021
#define | IDM_CHARCODE 10014
#define | IDM_CLOSECAND 10026
#define | IDM_COMPLETE 10023
#define | IDM_CONVERT 10020
#define | IDM_EUDC 10017
#define | IDM_FONT 10001
#define | IDM_FULLHALF 10012
#define | IDM_HANJA 10015
#define | IDM_NATIVEMODE 10011
#define | IDM_NEXTCAND 10027
#define | IDM_NEXTCLAUSE 10029
#define | IDM_OPENCAND 10025
#define | IDM_OPENSTATUS 10010
#define | IDM_PREVCAND 10028
#define | IDM_PREVCLAUSE 10030
#define | IDM_REVERT 10022
#define | IDM_ROMAN 10013
#define | IDM_SHOWCAND 10024
#define | IDM_SOFTKBD 10016
#define | IDM_STARTIMEMENU 20000
#define | IDM_SYMBOL 10018
#define | STATUS_ID 10001
#define | TOOLBAR_ID 10002

Define Documentation

#define IDB_BMP 700

Definition at line 14 of file Resource.h.

#define IDC_STATIC -1

Definition at line 13 of file Resource.h.

#define IDM_ABOUT 10002

Definition at line 17 of file Resource.h.

#define IDM_CANCEL 10021

Definition at line 31 of file Resource.h.

#define IDM_CHARCODE 10014

Definition at line 24 of file Resource.h.

#define IDM_CLOSECAND 10026

Definition at line 36 of file Resource.h.

#define IDM_COMPLETE 10023

Definition at line 33 of file Resource.h.

#define IDM_CONVERT 10020

Definition at line 30 of file Resource.h.

#define IDM_EUDC 10017

Definition at line 27 of file Resource.h.

#define IDM_FONT 10001

Definition at line 16 of file Resource.h.

#define IDM_FULLHALF 10012

Definition at line 22 of file Resource.h.

#define IDM_HANJA 10015

Definition at line 25 of file Resource.h.

#define IDM_NATIVEMODE 10011

Definition at line 21 of file Resource.h.

#define IDM_NEXTCAND 10027

Definition at line 37 of file Resource.h.

#define IDM_NEXTCLAUSE 10029

Definition at line 39 of file Resource.h.

#define IDM_OPENCAND 10025

Definition at line 35 of file Resource.h.

#define IDM_OPENSTATUS 10010

Definition at line 19 of file Resource.h.

#define IDM_PREVCAND 10028

Definition at line 38 of file Resource.h.

#define IDM_PREVCLAUSE 10030

Definition at line 40 of file Resource.h.

#define IDM_REVERT 10022

Definition at line 32 of file Resource.h.

#define IDM_ROMAN 10013

Definition at line 23 of file Resource.h.

#define IDM_SHOWCAND 10024

Definition at line 34 of file Resource.h.

#define IDM_SOFTKBD 10016

Definition at line 26 of file Resource.h.

#define IDM_STARTIMEMENU 20000

Definition at line 42 of file Resource.h.

#define IDM_SYMBOL 10018

Definition at line 28 of file Resource.h.

#define STATUS_ID 10001

Definition at line 9 of file Resource.h.

#define TOOLBAR_ID 10002

Definition at line 10 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Setcomp.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Functions

Setcomp.c File Reference

#include <windows.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Functions

DWORD GetTargetClause ()
LRESULT HandleChangeAttr (HWND hWnd, BOOL fNext)

Function Documentation

DWORD GetTargetClause ( )

Definition at line 12 of file Setcomp.c.

{
    int nMaxClause = (int)(dwCompClsLen / sizeof(DWORD)) - 1;
    int nCnt;

    if (nMaxClause <= 0)
    {
        return (DWORD)-1L;
    }

    for (nCnt = 0; nCnt < nMaxClause; nCnt++)
    {
        DWORD dwCls = dwCompCls[nCnt];

        if ((bCompAttr[dwCompCls[nCnt]] == ATTR_TARGET_CONVERTED) ||
            (bCompAttr[dwCompCls[nCnt]] == ATTR_TARGET_NOTCONVERTED))
        {
            return nCnt;
        }
    }

    return (DWORD)-1L;
}

LRESULT HandleChangeAttr | ( | HWND | hWnd,
 |  | BOOL | fNext
 | ) |  |

Definition at line 37 of file Setcomp.c.

{
    BYTE bAttr[512];
    BYTE bAttrRead[512];
    UINT i,j;
    UINT uClause;
    UINT uMaxClause;
    UINT uCnt;
    UINT uCntRead;
    BYTE bAt;
    BOOL fAttrOK = FALSE;
    BOOL fAttrReadOK = FALSE;
    HIMC hIMC = NULL;
    BOOL bRet = FALSE;

    uMaxClause = (dwCompClsLen / sizeof(DWORD)) - 1;
    uClause = GetTargetClause();

    if (uClause == (DWORD)-1L)
    {
         return 0L;
    }

    if (fNext)
    {
        if (uClause + 1 <= uMaxClause)
        {
            uClause++;
        }
        else
        {
            return 0L;
        }
    }
    else
    {
        if (uClause > 0)
        {
            uClause--;
        }
        else
        {
            return 0L;
        }
    }

    uCnt = 0;

    if (uClause < uMaxClause)
    {
        for (i=0; i < uMaxClause; i++)
        {
            if (i == uClause)
            {
                switch (bCompAttr[dwCompCls[i]])
                {
                    case ATTR_INPUT:
                        bAt = ATTR_TARGET_NOTCONVERTED;
                        break;
                        break;

                    case ATTR_CONVERTED:
                        bAt = ATTR_TARGET_CONVERTED;
                        break;

                    default:
                        bAt = bCompAttr[dwCompCls[i]];
                        break;
                }
            }
            else
            {
                switch (bCompAttr[dwCompCls[i]])
                {
                    case ATTR_TARGET_CONVERTED:
                        bAt = ATTR_CONVERTED;
                        break;
                        break;

                    case ATTR_TARGET_NOTCONVERTED:
                        bAt = ATTR_INPUT;
                        break;

                    default:
                        bAt = bCompAttr[dwCompCls[i]];
                        break;
                }
            }

            for (j = 0; j < (dwCompCls[i+1] - dwCompCls[i]); j++)
            {
                bAttr[uCnt++] = bAt;
            }
        }
        fAttrOK = TRUE;
    }

    uCntRead = 0;

    if (uClause < uMaxClause)
    {
        for (i=0; i < uMaxClause; i++)
        {
            if (i == uClause)
            {
                switch (bCompReadAttr[dwCompReadCls[i]])
                {
                    case ATTR_INPUT:
                        bAt = ATTR_TARGET_NOTCONVERTED;
                        break;
                        break;

                    case ATTR_CONVERTED:
                        bAt = ATTR_TARGET_CONVERTED;
                        break;

                    default:
                        bAt = bCompReadAttr[dwCompReadCls[i]];
                        break;
                }
            }
            else
            {
                switch (bCompReadAttr[dwCompReadCls[i]])
                {
                    case ATTR_TARGET_CONVERTED:
                        bAt = ATTR_CONVERTED;
                        break;
                        break;

                    case ATTR_TARGET_NOTCONVERTED:
                        bAt = ATTR_INPUT;
                        break;

                    default:
                        bAt = bCompReadAttr[dwCompReadCls[i]];
                        break;
                }
            }

            for (j = 0; j < (dwCompReadCls[i+1] - dwCompReadCls[i]); j++)
            {
                bAttrRead[uCntRead++] = bAt;
            }
        }
        fAttrReadOK = TRUE;
    }

    if (fAttrReadOK && fAttrOK)
    {
        hIMC = ImmGetContext(hWndCompStr);
#ifdef USEWAPI
        bRet = ImmSetCompositionStringW(hIMC,SCS_CHANGEATTR,bAttr,uCnt,
                                                    bAttrRead,uCntRead);
#else
        bRet = ImmSetCompositionString(hIMC,SCS_CHANGEATTR,bAttr,uCnt,
                                                    bAttrRead,uCntRead);
#endif
        // bRet = ImmSetCompositionString(hIMC,SCS_CHANGEATTR,NULL,0,
        //                                             bAttrRead,uCntRead);
        // bRet = ImmSetCompositionString(hIMC,SCS_CHANGEATTR,bAttr,uCnt,
        //                                             NULL,0);
        ImmReleaseContext(hWndCompStr,hIMC);
    }
    else
    {
#ifdef DEBUG
        OutputDebugString("Can not call ImmSetCompositionString\r\n");
        bRet = TRUE;
#endif
    }

#ifdef DEBUG
    if (!bRet)
    {
        OutputDebugString("ImmSetCompositionString return FALSE\r\n");
    }
#endif

    return 1;
}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Status.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Defines | Functions | Variables

Status.c File Reference

#include <windows.h>
#include <commctrl.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Defines

#define | NUM_PARTS 10
#define | SBITEM_CHARCODE 4
#define | SBITEM_CMODEFIRST 1
#define | SBITEM_CMODELAST 9
#define | SBITEM_EUDC 8
#define | SBITEM_FULLSHAPE 2
#define | SBITEM_HANJA 5
#define | SBITEM_NATIVEMODE 1
#define | SBITEM_NOCONVERSION 7
#define | SBITEM_OPENSTATUS 0
#define | SBITEM_ROMAN 3
#define | SBITEM_SOFTKBD 6
#define | SBITEM_SYMBOL 9

Functions

void | ClearConvModeParts ()
BOOL | CreateStatus (HWND hWnd)
void | SetConvModeParts (DWORD dwConvMode)
void | SetOpenStatusParts (BOOL fOpen)
void | SetStatusItems (HWND hWnd)

Variables

int | nPartsWidthTbl [NUM_PARTS] = {30,50,30,30,30,30,30,30,30,30}
const char | szImeAlpha [] = "Alpha"
const char | szImeClose [] = "Off"
const char | szImeCode [] = "Code"
const char | szImeEUDC [] = "EUDC"
const char | szImeFull [] = "Full"
const char | szImeHalf [] = "Half"
const char | szImeHanja [] = "Hanja"
const char | szImeKatakana [] = "Kata"
const char | szImeNative [] = "Native"
const char | szImeNoConv [] = "NoConv"
const char | szImeNull [] = ""
const char | szImeOpen [] = "On"
const char | szImeRoman [] = "Roman"
const char | szImeSoftKbd [] = "SoftKbd"
const char | szImeSymbol [] = "Symbol"

Define Documentation

#define NUM_PARTS 10

Definition at line 45 of file Status.c.

#define SBITEM_CHARCODE 4

Definition at line 35 of file Status.c.

#define SBITEM_CMODEFIRST 1

Definition at line 42 of file Status.c.

#define SBITEM_CMODELAST 9

Definition at line 43 of file Status.c.

#define SBITEM_EUDC 8

Definition at line 39 of file Status.c.

#define SBITEM_FULLSHAPE 2

Definition at line 33 of file Status.c.

#define SBITEM_HANJA 5

Definition at line 36 of file Status.c.

#define SBITEM_NATIVEMODE 1

Definition at line 32 of file Status.c.

#define SBITEM_NOCONVERSION 7

Definition at line 38 of file Status.c.

#define SBITEM_OPENSTATUS 0

Definition at line 31 of file Status.c.

#define SBITEM_ROMAN 3

Definition at line 34 of file Status.c.

#define SBITEM_SOFTKBD 6

Definition at line 37 of file Status.c.

#define SBITEM_SYMBOL 9

Definition at line 40 of file Status.c.

Function Documentation

void ClearConvModeParts ( )

Definition at line 239 of file Status.c.

{
    int i;

    for (i = SBITEM_CMODEFIRST; i <= SBITEM_CMODELAST; i++)
    {
        SendMessage(hWndStatus,SB_SETTEXT, i,(LPARAM)&szImeNull);
    }
}

BOOL CreateStatus ( HWND hWnd )

Definition at line 48 of file Status.c.

{
    int *pPartsWidth;
    int i;
    int nWidth = 0;

    hWndStatus = CreateStatusWindow(WS_CHILD | WS_VISIBLE, NULL ,
                                    hWnd,  STATUS_ID);

    if (!hWndStatus)
    {
        return FALSE;
    }

    pPartsWidth = (int *)LocalAlloc(LPTR,sizeof(int) * NUM_PARTS);

    for (i = 0; i < NUM_PARTS; i++)
    {
        nWidth += nPartsWidthTbl[i];
        pPartsWidth[i] = nWidth;
    }

    SendMessage(hWndStatus, SB_SETPARTS,
                (WPARAM)NUM_PARTS,(LPARAM)pPartsWidth);

    LocalFree((HANDLE)pPartsWidth);

    return TRUE;
}

void SetConvModeParts ( DWORD dwConvMode )

Definition at line 118 of file Status.c.

{
    switch (dwConvMode & IME_CMODE_LANGUAGE)
    {
        case IME_CMODE_ALPHANUMERIC:
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeAlpha);
            break;

        case IME_CMODE_NATIVE:
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeNative);

            break;

        case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA):
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeKatakana);

            break;

        default:
            SendMessage(hWndStatus,SB_SETTEXT,
                        SBITEM_NATIVEMODE,(LPARAM)&szImeNull);
            break;
    }

    if (dwConvMode & IME_CMODE_ROMAN)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_ROMAN,(LPARAM)&szImeRoman);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_ROMAN,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_CHARCODE)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_CHARCODE,(LPARAM)&szImeCode);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_CHARCODE,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_FULLSHAPE)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_FULLSHAPE,(LPARAM)&szImeFull);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_FULLSHAPE,(LPARAM)&szImeHalf);
    }

    if (dwConvMode & IME_CMODE_HANJACONVERT)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_HANJA,(LPARAM)&szImeHanja);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_HANJA,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_SOFTKBD)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_SOFTKBD,(LPARAM)&szImeSoftKbd);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_SOFTKBD,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_NOCONVERSION)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_NOCONVERSION,(LPARAM)&szImeNoConv);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_NOCONVERSION,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_EUDC)
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_EUDC,(LPARAM)&szImeEUDC);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_EUDC,(LPARAM)&szImeNull);
    }

    if (dwConvMode & IME_CMODE_SYMBOL)
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_SYMBOL,(LPARAM)&szImeSymbol);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,SBITEM_SYMBOL,(LPARAM)&szImeNull);
    }
}

void SetOpenStatusParts ( BOOL fOpen )

Definition at line 104 of file Status.c.

{
    if (fOpen)
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_OPENSTATUS,(LPARAM)&szImeOpen);
    }
    else
    {
        SendMessage(hWndStatus,SB_SETTEXT,
                    SBITEM_OPENSTATUS,(LPARAM)&szImeClose);
    }
}

void SetStatusItems ( HWND hWnd )

Definition at line 79 of file Status.c.

{
    HIMC hIMC = NULL;
    BOOL fOpen;
    DWORD dwConvMode,dwSentMode;

    hIMC = ImmGetContext(hWnd);

    fOpen = ImmGetOpenStatus(hIMC);
    SetOpenStatusParts(fOpen);
    ImmGetConversionStatus(hIMC,&dwConvMode,&dwSentMode);

    if (fOpen)
    {
        SetConvModeParts(dwConvMode);
    }
    else
    {
        ClearConvModeParts();
    }

    ImmReleaseContext(hWnd,hIMC);
}

Variable Documentation

int nPartsWidthTbl[NUM_PARTS] = {30,50,30,30,30,30,30,30,30,30}

Definition at line 46 of file Status.c.

const char szImeAlpha[] = "Alpha"

Definition at line 18 of file Status.c.

const char szImeClose[] = "Off"

Definition at line 17 of file Status.c.

const char szImeCode[] = "Code"

Definition at line 24 of file Status.c.

const char szImeEUDC[] = "EUDC"

Definition at line 28 of file Status.c.

const char szImeFull[] = "Full"

Definition at line 22 of file Status.c.

const char szImeHalf[] = "Half"

Definition at line 21 of file Status.c.

const char szImeHanja[] = "Hanja"

Definition at line 25 of file Status.c.

const char szImeKatakana[] = "Kata"

Definition at line 20 of file Status.c.

const char szImeNative[] = "Native"

Definition at line 19 of file Status.c.

const char szImeNoConv[] = "NoConv"

Definition at line 27 of file Status.c.

const char szImeNull[] = ""

Definition at line 15 of file Status.c.

const char szImeOpen[] = "On"

Definition at line 16 of file Status.c.

const char szImeRoman[] = "Roman"

Definition at line 23 of file Status.c.

const char szImeSoftKbd[] = "SoftKbd"

Definition at line 26 of file Status.c.

const char szImeSymbol[] = "Symbol"

Definition at line 29 of file Status.c.

Generated on Wed Nov 13 2024 16:53:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Subs.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Functions

Subs.c File Reference

#include <windows.h>
#include <commctrl.h>
#include <imm.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Functions

void MoveCompCandWindow (HWND hWnd)

Function Documentation

void MoveCompCandWindow ( HWND hWnd )

Definition at line 15 of file Subs.c.

{
    RECT rc = {0};
    RECT rcClient = {0};
    int cx;

    GetClientRect(hWnd, &rcClient);

    GetWindowRect(hWndToolBar,&rc);
    ScreenToClient(hWnd,(LPPOINT)&rc.right);
    rcClient.top = rc.bottom;

    GetWindowRect(hWndStatus,&rc);
    ScreenToClient(hWnd,(LPPOINT)&rc.left);
    rcClient.bottom = rc.top;

    if (fShowCand)
    {
        if (rcClient.right >= CAND_CX * 3)
        {
            cx = rcClient.right-rcClient.left - CAND_CX;
        }
        else
        {
            cx = (rcClient.right-rcClient.left) * 2 / 3;
        }

        MoveWindow(hWndCompStr,
                   rcClient.left,
                   rcClient.top,
                   cx,
                   rcClient.bottom-rcClient.top,
                   TRUE);
        MoveWindow(hWndCandList,
                   cx,
                   rcClient.top,
                   rcClient.right-rcClient.left - cx,
                   rcClient.bottom-rcClient.top,
                   TRUE);
    }
    else
    {
        MoveWindow(hWndCompStr,
                   rcClient.left,
                   rcClient.top,
                   rcClient.right-rcClient.left,
                   rcClient.bottom-rcClient.top,
                   TRUE);
        MoveWindow(hWndCandList, 0, 0, 0, 0, TRUE);
    }

}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/ToolBar.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Defines | Functions | Variables

ToolBar.c File Reference

#include <windows.h>
#include <commctrl.h>
#include "resource.h"
#include "imeapps.h"

Go to the source code of this file.

Defines

#define | BUTTONHEIGHT 0
#define | BUTTONWIDTH 0
#define | IDTBB_ALPHA 16
#define | IDTBB_CANCEL 7
#define | IDTBB_CHARCODE 23
#define | IDTBB_CLOSE 2
#define | IDTBB_CLOSECAND 15
#define | IDTBB_COMPLETE 9
#define | IDTBB_CONVERT 6
#define | IDTBB_EUDC 29
#define | IDTBB_FONT 0
#define | IDTBB_FULL 19
#define | IDTBB_HALF 20
#define | IDTBB_HANJA 25
#define | IDTBB_KATAKANA 18
#define | IDTBB_MODE 3
#define | IDTBB_NATIVE 17
#define | IDTBB_NEXTCAND 10
#define | IDTBB_NEXTCLAUSE 12
#define | IDTBB_NOCHARCODE 24
#define | IDTBB_NOEUDC 30
#define | IDTBB_NOHANJA 26
#define | IDTBB_NOROMAN 22
#define | IDTBB_NOSHOWCAND 5
#define | IDTBB_NOSOFTKBD 28
#define | IDTBB_NOSYMBOL 32
#define | IDTBB_OPEN 1
#define | IDTBB_OPENCAND 14
#define | IDTBB_PREVCAND 11
#define | IDTBB_PREVCLAUSE 13
#define | IDTBB_REVERT 8
#define | IDTBB_ROMAN 21
#define | IDTBB_SHOWCAND 4
#define | IDTBB_SOFTKBD 27
#define | IDTBB_SYMBOL 31
#define | IMAGEHEIGHT 17
#define | IMAGEWIDTH 16
#define | NUMIMAGES 33

Functions

BOOL | CreateTBar (HWND hWnd)
LRESULT | SetTooltipText (HWND hWnd, LPARAM lParam)
void | UpdateButton (UINT iID, UINT iFlags)
void | UpdateModeButton (DWORD dwConv)
void | UpdateShowCandButton ()
void | UpdateShowOpenStatusButton (BOOL fOpen)

Variables

TBBUTTON | tbButton []

Define Documentation

#define BUTTONHEIGHT 0

Definition at line 21 of file ToolBar.c.

#define BUTTONWIDTH 0

Definition at line 20 of file ToolBar.c.

#define IDTBB_ALPHA 16

Definition at line 39 of file ToolBar.c.

#define IDTBB_CANCEL 7

Definition at line 30 of file ToolBar.c.

#define IDTBB_CHARCODE 23

Definition at line 46 of file ToolBar.c.

#define IDTBB_CLOSE 2

Definition at line 25 of file ToolBar.c.

#define IDTBB_CLOSECAND 15

Definition at line 38 of file ToolBar.c.

#define IDTBB_COMPLETE 9

Definition at line 32 of file ToolBar.c.

#define IDTBB_CONVERT 6

Definition at line 29 of file ToolBar.c.

#define IDTBB_EUDC 29

Definition at line 52 of file ToolBar.c.

#define IDTBB_FONT 0

Definition at line 23 of file ToolBar.c.

#define IDTBB_FULL 19

Definition at line 42 of file ToolBar.c.

#define IDTBB_HALF 20

Definition at line 43 of file ToolBar.c.

#define IDTBB_HANJA 25

Definition at line 48 of file ToolBar.c.

#define IDTBB_KATAKANA 18

Definition at line 41 of file ToolBar.c.

#define IDTBB_MODE 3

Definition at line 26 of file ToolBar.c.

#define IDTBB_NATIVE 17

Definition at line 40 of file ToolBar.c.

#define IDTBB_NEXTCAND 10

Definition at line 33 of file ToolBar.c.

#define IDTBB_NEXTCLAUSE 12

Definition at line 35 of file ToolBar.c.

#define IDTBB_NOCHARCODE 24

Definition at line 47 of file ToolBar.c.

#define IDTBB_NOEUDC 30

Definition at line 53 of file ToolBar.c.

#define IDTBB_NOHANJA 26

Definition at line 49 of file ToolBar.c.

#define IDTBB_NOROMAN 22

Definition at line 45 of file ToolBar.c.

#define IDTBB_NOSHOWCAND 5

Definition at line 28 of file ToolBar.c.

#define IDTBB_NOSOFTKBD 28

Definition at line 51 of file ToolBar.c.

#define IDTBB_NOSYMBOL 32

Definition at line 55 of file ToolBar.c.

#define IDTBB_OPEN 1

Definition at line 24 of file ToolBar.c.

#define IDTBB_OPENCAND 14

Definition at line 37 of file ToolBar.c.

#define IDTBB_PREVCAND 11

Definition at line 34 of file ToolBar.c.

#define IDTBB_PREVCLAUSE 13

Definition at line 36 of file ToolBar.c.

#define IDTBB_REVERT 8

Definition at line 31 of file ToolBar.c.

#define IDTBB_ROMAN 21

Definition at line 44 of file ToolBar.c.

#define IDTBB_SHOWCAND 4

Definition at line 27 of file ToolBar.c.

#define IDTBB_SOFTKBD 27

Definition at line 50 of file ToolBar.c.

#define IDTBB_SYMBOL 31

Definition at line 54 of file ToolBar.c.

#define IMAGEHEIGHT 17

Definition at line 19 of file ToolBar.c.

#define IMAGEWIDTH 16

Definition at line 18 of file ToolBar.c.

#define NUMIMAGES 33

Definition at line 17 of file ToolBar.c.

Function Documentation

BOOL CreateTBar ( HWND hWnd )

Definition at line 100 of file ToolBar.c.

{
    HIMC hIMC = NULL;
    BOOL fOpen;

    hWndToolBar = CreateToolbarEx(hWnd,
                                  WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS,
                                  TOOLBAR_ID,
                                  NUMIMAGES,
                                  hInst,
                                  IDB_BMP,
                                  tbButton,
                                  sizeof(tbButton)/sizeof(TBBUTTON),
                                  BUTTONWIDTH,
                                  BUTTONHEIGHT,
                                  IMAGEWIDTH,
                                  IMAGEHEIGHT,
                                  sizeof(TBBUTTON));

    UpdateShowCandButton();

    hIMC = ImmGetContext(hWndCompStr);
    fOpen = ImmGetOpenStatus(hIMC);
    UpdateShowOpenStatusButton(fOpen);
    ImmReleaseContext(hWndCompStr,hIMC);

    return (hWndToolBar != 0);
}

LRESULT SetTooltipText | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 130 of file ToolBar.c.

{
    LPTOOLTIPTEXT lpToolTipText = NULL;
    static char   szBuffer[64];

    lpToolTipText = (LPTOOLTIPTEXT)lParam;
    if (lpToolTipText->hdr.code == TTN_NEEDTEXT)
    {
        LoadString(hInst,
                   (UINT)lpToolTipText->hdr.idFrom,   // string ID == command ID
                   szBuffer,
                   (int)sizeof(szBuffer));

        lpToolTipText->lpszText = szBuffer;
    }
    return 0;
}

void UpdateButton | ( | UINT | iID,
 |  | UINT | iFlags
 | ) |  |

Definition at line 148 of file ToolBar.c.

{
    int iCurrentFlags;

    iCurrentFlags = (int)SendMessage(hWndToolBar,
                                     TB_GETSTATE,
                                     iID, 0L);

    if (iCurrentFlags & TBSTATE_PRESSED)
    {
        iFlags |= TBSTATE_PRESSED;
    }

    SendMessage(hWndToolBar,
                TB_SETSTATE,
                iID,
                MAKELPARAM(iFlags, 0));
    return;
}

void UpdateModeButton ( DWORD dwConv )

Definition at line 189 of file ToolBar.c.

{
    int nIDTBB;

    switch (dwConv & IME_CMODE_LANGUAGE)
    {
        case IME_CMODE_ALPHANUMERIC:
            nIDTBB = IDTBB_ALPHA;
            break;

        case IME_CMODE_NATIVE:
            nIDTBB = IDTBB_NATIVE;
            break;

        case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA):
            nIDTBB = IDTBB_KATAKANA;
            break;

        default:
            nIDTBB = IDTBB_ALPHA;
            break;

    }
    SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_NATIVEMODE,
                MAKELPARAM(nIDTBB, 0));

    if (dwConv & IME_CMODE_FULLSHAPE)
    {
        nIDTBB = IDTBB_FULL;
    }
    else
    {
        nIDTBB = IDTBB_HALF;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_FULLHALF,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_ROMAN)
    {
        nIDTBB = IDTBB_ROMAN;
    }
    else
    {
        nIDTBB = IDTBB_NOROMAN;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_ROMAN,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_CHARCODE)
    {
        nIDTBB = IDTBB_CHARCODE;
    }
    else
    {
        nIDTBB = IDTBB_NOCHARCODE;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_CHARCODE,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_HANJACONVERT)
    {
        nIDTBB = IDTBB_HANJA;
    }
    else
    {
        nIDTBB = IDTBB_NOHANJA;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_HANJA,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_SOFTKBD)
    {
        nIDTBB = IDTBB_SOFTKBD;
    }
    else
    {
        nIDTBB = IDTBB_NOSOFTKBD;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_SOFTKBD,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_EUDC)
    {
        nIDTBB = IDTBB_EUDC;
    }
    else
    {
        nIDTBB = IDTBB_NOEUDC;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_EUDC,
                    MAKELPARAM(nIDTBB, 0));
    }

    if (dwConv & IME_CMODE_SYMBOL)
    {
        nIDTBB = IDTBB_SYMBOL;
    }
    else
    {
        nIDTBB = IDTBB_NOSYMBOL;
        SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_SYMBOL,
                    MAKELPARAM(nIDTBB, 0));
    }

    return;
}

void UpdateShowCandButton ( )

Definition at line 178 of file ToolBar.c.

{

    SendMessage(hWndToolBar,
                TB_CHANGEBITMAP,
                IDM_SHOWCAND,
                MAKELPARAM((fShowCand ? IDTBB_SHOWCAND : IDTBB_NOSHOWCAND), 0));
    return;
}

void UpdateShowOpenStatusButton ( BOOL fOpen )

Definition at line 168 of file ToolBar.c.

{

    SendMessage(hWndToolBar,
                TB_CHANGEBITMAP,
                IDM_OPENSTATUS,
                MAKELPARAM((fOpen ? IDTBB_OPEN : IDTBB_CLOSE), 0));
    return;
}

Variable Documentation

TBBUTTON tbButton[]

Definition at line 57 of file ToolBar.c.

Generated on Wed Nov 13 2024 16:54:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/ToolBar.h File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Variables

ToolBar.h File Reference

Go to the source code of this file.

Variables

HWND hWndToolbar

Variable Documentation

HWND hWndToolbar

Definition at line 27 of file ToolBar.c.

Generated on Wed Nov 13 2024 16:54:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Wapi.h File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps
Defines | Typedefs

Wapi.h File Reference

Go to the source code of this file.

Defines

#define | LPMYIMEMENUITEMINFO LPIMEMENUITEMINFO
#define | MyCharNext(x) AnsiNext(x)
#define | MyCharPrev(x, y) AnsiPrev((x), (y))
#define | MYIMEMENUITEMINFO IMEMENUITEMINFO
#define | MyImmGetCompositionString ImmGetCompositionString
#define | MyImmGetImeMenuItems ImmGetImeMenuItems
#define | Mylstrcat(x, y) lstrcat((x), (y))
#define | Mylstrcmp(x, y) lstrcmp((x), (y))
#define | Mylstrcpy(x, y) lstrcpy((x), (y))
#define | Mylstrlen(x) lstrlen(x)
#define | MYTEXT(x) x

Typedefs

typedef LPTSTR | LPMYSTR
typedef TCHAR | MYCHAR

Define Documentation

#define LPMYIMEMENUITEMINFO LPIMEMENUITEMINFO

Definition at line 26 of file Wapi.h.

#define MyCharNext ( x ) AnsiNext(x)

Definition at line 25 of file Wapi.h.

#define MyCharPrev | ( | x,
 |  | y |
 | ) |  | AnsiPrev((x), (y))

Definition at line 24 of file Wapi.h.

#define MYIMEMENUITEMINFO IMEMENUITEMINFO

Definition at line 27 of file Wapi.h.

#define MyImmGetCompositionString ImmGetCompositionString

Definition at line 29 of file Wapi.h.

#define MyImmGetImeMenuItems ImmGetImeMenuItems

Definition at line 28 of file Wapi.h.

#define Mylstrcat | ( | x,
 |  | y |
 | ) |  | lstrcat((x), (y))

Definition at line 22 of file Wapi.h.

#define Mylstrcmp | ( | x,
 |  | y |
 | ) |  | lstrcmp((x), (y))

Definition at line 23 of file Wapi.h.

#define Mylstrcpy | ( | x,
 |  | y |
 | ) |  | lstrcpy((x), (y))

Definition at line 21 of file Wapi.h.

#define Mylstrlen ( x ) lstrlen(x)

Definition at line 20 of file Wapi.h.

#define MYTEXT ( x ) x

Definition at line 19 of file Wapi.h.

Typedef Documentation

typedef LPTSTR LPMYSTR

Definition at line 17 of file Wapi.h.

typedef TCHAR MYCHAR

Definition at line 18 of file Wapi.h.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Wsubs.c File Reference

  • WinUI
  • Input
  • Ime
  • IMEApps

Wsubs.c File Reference

#include <windows.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/Data.C File Reference

  • WinUI
  • Input
  • Ime
  • MultiUI
Variables

Data.C File Reference

#include <windows.h>
#include <imm.h>
#include "resource.h"

Go to the source code of this file.

Variables

HANDLE hInst
HWND | hWndDef1
HWND | hWndDef2
HWND | hWndIMC1
HWND | hWndIMC2
HWND | hWndIMCUI1
HWND | hWndIMCUI2
HWND | hWndMain

Variable Documentation

HANDLE hInst

Definition at line 13 of file Data.C.

HWND hWndDef1

Definition at line 16 of file Data.C.

HWND hWndDef2

Definition at line 17 of file Data.C.

HWND hWndIMC1

Definition at line 18 of file Data.C.

HWND hWndIMC2

Definition at line 19 of file Data.C.

HWND hWndIMCUI1

Definition at line 20 of file Data.C.

HWND hWndIMCUI2

Definition at line 21 of file Data.C.

HWND hWndMain

Definition at line 14 of file Data.C.

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/Dlgs.C File Reference

  • WinUI
  • Input
  • Ime
  • MultiUI
Functions

Dlgs.C File Reference

#include <windows.h>
#include <imm.h>
#include "resource.h"
#include "multiui.h"

Go to the source code of this file.

Functions

BOOL AboutDlg (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)

Function Documentation

BOOL AboutDlg | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 19 of file Dlgs.C.

{
    BOOL bRet = FALSE;

    switch (message)
    {
        case WM_INITDIALOG:
            bRet = TRUE;
            break;

        case WM_COMMAND:
            if (wParam == IDOK ||
                wParam == IDCANCEL)
            {
                EndDialog(hDlg, TRUE);
                bRet = TRUE;
            }
            break;
    }

    return bRet;
}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/MultiUI.C File Reference

  • WinUI
  • Input
  • Ime
  • MultiUI
Functions

MultiUI.C File Reference

#include <windows.h>
#include <imm.h>
#include <tchar.h>
#include <stdio.h>
#include "resource.h"
#include "multiui.h"

Go to the source code of this file.

Functions

BOOL | InitApplication (HANDLE hInstance)
BOOL | InitInstance (HANDLE hInstance, int nCmdShow)
LRESULT CALLBACK | MainWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)

Function Documentation

BOOL InitApplication ( HANDLE hInstance )

Definition at line 76 of file MultiUI.C.

{
    WNDCLASS wc = {0};
    BOOL bSuccess = TRUE;

    wc.lpfnWndProc   = (WNDPROC)MainWndProc;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(hInstance,TEXT("MyIcon"));
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName  = TEXT("MultiUiMenu");
    wc.lpszClassName = TEXT("MultiUiWClass");

    if (! RegisterClass (&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    wc.style         = CS_DBLCLKS;
    wc.lpfnWndProc   = (WNDPROC)NoUINoIMCWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = WNDEXTRA_NOUINOIMC;
    wc.hInstance     = hInstance;
    wc.hIcon         = 0;
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = TEXT("NoUINoIMCWClass");

    if (! RegisterClass (&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    wc.style         = CS_DBLCLKS;
    wc.lpfnWndProc   = (WNDPROC)NoUIOwnIMCWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = WNDEXTRA_NOUIOWNIMC;
    wc.hInstance     = hInstance;
    wc.hIcon         = 0;
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = TEXT("NoUIOwnIMCWClass");

    if (! RegisterClass (&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    wc.style         = CS_DBLCLKS;
    wc.lpfnWndProc   = (WNDPROC)OwnUIOwnIMCWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = WNDEXTRA_OWNUIOWNIMC;
    wc.hInstance     = hInstance;
    wc.hIcon         = 0;
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = TEXT("OwnUIOwnIMCWClass");

    if (! RegisterClass (&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

exit_func:
    return bSuccess;
}

BOOL InitInstance | ( | HANDLE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 157 of file MultiUI.C.

{
    RECT       rc          = {0};
    int        iDesc       = 0;
    HDC        hIC         = NULL;
    TEXTMETRIC tm          = {0};
    HFONT      hFont       = GetDefaultGUIFont();
    BOOL       bSuccess    = TRUE;
    TCHAR      szTitle[20] =  TEXT("MultiUi TestTool");

    hInst = hInstance;

    hWndMain = CreateWindow(TEXT("MultiUiWClass"), szTitle,
                            WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
                            CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
                            NULL, NULL, hInstance, NULL);
    if (!hWndMain)
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    GetClientRect(hWndMain,&rc);

    rc.right  /= 2;
    rc.bottom /= 3;

    hIC = CreateIC(TEXT("DISPLAY"), NULL, NULL, NULL);

    SelectObject(hIC, hFont);

    GetTextMetrics(hIC,&tm);

    if (rc.bottom >= tm.tmHeight)
    {
        iDesc = tm.tmHeight + tm.tmExternalLeading;
    }

    DeleteDC(hIC);

    if (!(hWndDef1 = CreateWindowEx(
                        WS_EX_CLIENTEDGE, TEXT("NoUINoIMCWClass"), TEXT(""),
                        WS_CHILD | WS_VISIBLE,
                        rc.left, rc.top + iDesc, rc.right, rc.bottom - iDesc,
                        hWndMain, NULL, hInstance, NULL)))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!(hWndDef2 = CreateWindowEx(
                        WS_EX_CLIENTEDGE, TEXT("NoUINoIMCWClass"), TEXT(""),
                        WS_CHILD | WS_VISIBLE,
                        rc.right, rc.top + iDesc, rc.right, rc.bottom - iDesc,
                        hWndMain, NULL, hInstance, NULL)))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!(hWndIMC1 = CreateWindowEx(
                        WS_EX_CLIENTEDGE, TEXT("NoUIOwnIMCWClass"), TEXT(""),
                        WS_CHILD | WS_VISIBLE,
                        rc.left, rc.bottom + iDesc, rc.right, rc.bottom - iDesc,
                        hWndMain, NULL, hInstance, NULL)))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!(hWndIMC2 = CreateWindowEx(
                        WS_EX_CLIENTEDGE, TEXT("NoUIOwnIMCWClass"), TEXT(""),
                        WS_CHILD | WS_VISIBLE,
                        rc.right, rc.bottom + iDesc, rc.right, rc.bottom - iDesc,
                        hWndMain, NULL, hInstance, NULL)))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!(hWndIMCUI1 = CreateWindowEx(
                        WS_EX_CLIENTEDGE, TEXT("OwnUIOwnIMCWClass"), TEXT(""),
                        WS_CHILD | WS_VISIBLE,
                        rc.left, rc.bottom * 2 + iDesc, rc.right, rc.bottom - iDesc,
                        hWndMain, NULL, hInstance, NULL)))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!(hWndIMCUI2 = CreateWindowEx(
                        WS_EX_CLIENTEDGE, TEXT("OwnUIOwnIMCWClass"), TEXT(""),
                        WS_CHILD | WS_VISIBLE,
                        rc.right, rc.bottom * 2 + iDesc, rc.right, rc.bottom - iDesc,
                        hWndMain, NULL, hInstance, NULL)))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    /* display each windows */
    ShowWindow (hWndMain, nCmdShow);
    UpdateWindow (hWndMain);

exit_func:
    return bSuccess;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 276 of file MultiUI.C.

{
    PAINTSTRUCT ps          = {0};
    HDC         hDC         = NULL;
    RECT        rc          = {0};
    int         iDesc       = 0;
    HDC         hIC         = NULL;
    TEXTMETRIC  tm          = {0};
    HFONT       hFont       = NULL;
    HFONT       hOldFont    = NULL;
    HIMC        hIMC        = NULL;
    HWND        hIMEWnd     = NULL;
    TCHAR       szDesc[128] = {0};
    BOOL        bRetDWP     = FALSE;

    switch (message)
    {
        case WM_CREATE:
            break;

        case WM_SIZE:
            switch (wParam)
            {
                case SIZENORMAL: /* fall-through */
                case SIZEFULLSCREEN:
                    GetClientRect(hWndMain,&rc);
                    rc.right  /= 2;
                    rc.bottom /= 3;

                    hFont = GetDefaultGUIFont();
                    hIC = CreateIC(TEXT("DISPLAY"), NULL, NULL, NULL);

                    SelectObject(hIC, hFont);

                    GetTextMetrics(hIC,&tm);

                    iDesc = 0;
                    if (rc.bottom >= tm.tmHeight)
                    {
                        iDesc = tm.tmHeight + tm.tmExternalLeading;
                    }

                    DeleteDC(hIC);

                    MoveWindow(hWndDef1,
                               rc.left,rc.top + iDesc,
                               rc.right,rc.bottom - iDesc,TRUE);
                    MoveWindow(hWndDef2,
                               rc.right,rc.top + iDesc,
                               rc.right,rc.bottom - iDesc,TRUE);
                    MoveWindow(hWndIMC1,
                               rc.left,rc.bottom + iDesc,
                               rc.right,rc.bottom - iDesc,TRUE);
                    MoveWindow(hWndIMC2,
                               rc.right,rc.bottom + iDesc,
                               rc.right,rc.bottom - iDesc,TRUE);
                    MoveWindow(hWndIMCUI1,
                               rc.left,rc.bottom * 2 + iDesc,
                               rc.right,rc.bottom - iDesc,TRUE);
                    MoveWindow(hWndIMCUI2,
                               rc.right,rc.bottom * 2 + iDesc,
                               rc.right,rc.bottom - iDesc,TRUE);

                    InvalidateRect(hWnd,NULL,TRUE);
                    break;

                case SIZEICONIC:
                    bRetDWP = TRUE;
                    goto exit_func;
                    break;

            }
            break;

        case WM_PAINT:
            hDC = BeginPaint (hWnd, &ps);
            hFont = GetDefaultGUIFont();
            hOldFont = SelectObject(hDC, hFont);

            GetClientRect(hWndMain,&rc);
            rc.right  /= 2;
            rc.bottom /= 3;

            _sntprintf (szDesc, sizeof(szDesc)/sizeof(szDesc[0]) - 1,
                        TEXT("%08lX Default IMC and Default IME window"),
                        (DWORD_PTR)hWndDef1);
            TextOut (hDC, rc.left,rc.top, szDesc, lstrlen(szDesc));

            _sntprintf (szDesc, sizeof(szDesc)/sizeof(szDesc[0]) - 1,
                        TEXT("%08lX Default IMC and Default IME window"),
                        (DWORD_PTR)hWndDef2);
            TextOut (hDC, rc.right, rc.top, szDesc, lstrlen(szDesc));

            hIMC = (HIMC)GetWindowLongPtr(hWndIMC1,MYGWL_IMC);
            _sntprintf (szDesc, sizeof(szDesc)/sizeof(szDesc[0]) - 1,
                        TEXT("%08lX IMC[%08lX] and Default IME window"),
                        (DWORD_PTR)hWndIMC1, (DWORD_PTR)hIMC);
            TextOut (hDC, rc.left, rc.bottom, szDesc, lstrlen(szDesc));

            hIMC = (HIMC)GetWindowLongPtr(hWndIMC2,MYGWL_IMC);
            _sntprintf (szDesc, sizeof(szDesc)/sizeof(szDesc[0]) - 1,
                        TEXT("%08lX IMC[%08lX] and Default IME window"),
                        (DWORD_PTR)hWndIMC2, (DWORD_PTR)hIMC);
            TextOut (hDC, rc.right, rc.bottom, szDesc, lstrlen(szDesc));

            hIMC = (HIMC)GetWindowLongPtr(hWndIMCUI1,MYGWL_IMC);
            hIMEWnd = (HWND)GetWindowLongPtr(hWndIMCUI1,MYGWL_IMEWND);
            _sntprintf (szDesc, sizeof(szDesc)/sizeof(szDesc[0]) - 1,
                        TEXT("%08lX IMC[%08lX] and IME window[%08lX]"),
                        (DWORD_PTR)hWndIMCUI1, (DWORD_PTR)hIMC ,(DWORD_PTR)hIMEWnd);
            TextOut (hDC, rc.left, rc.bottom * 2, szDesc, lstrlen(szDesc));

            hIMC = (HIMC)GetWindowLongPtr(hWndIMCUI2,MYGWL_IMC);
            hIMEWnd = (HWND)GetWindowLongPtr(hWndIMCUI2,MYGWL_IMEWND);
            _sntprintf (szDesc, sizeof(szDesc)/sizeof(szDesc[0]) - 1,
                        TEXT("%08lX IMC[%08lX] and IME window[%08lX]"),
                        (DWORD_PTR)hWndIMCUI2, (DWORD_PTR)hIMC ,(DWORD_PTR)hIMEWnd);
            TextOut (hDC, rc.right, rc.bottom * 2, szDesc, lstrlen(szDesc));

            SelectObject(hDC, hOldFont);
            EndPaint (hWnd, &ps);
            break;

        case WM_COMMAND:
            switch(WMCOMMANDWPARAM(wParam))
            {
              case IDM_ABOUT:
                  DialogBox(hInst, TEXT("ABOUTBOX"), hWnd, (DLGPROC)AboutDlg);
                  break;
            }
            break;

        case WM_DESTROY:
            PostQuitMessage(0);
            break;

        default:
            bRetDWP = TRUE;
            goto exit_func;
    }

exit_func:
    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0L;
    }
}

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | INT | nCmdShow
 | ) |  |

Definition at line 22 of file MultiUI.C.

{
    MSG msg = {0};
    BOOL bSuccess = TRUE;
    BOOL bRet = FALSE;

    if (!InitApplication(hInstance))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if (!InitInstance(hInstance, nCmdShow))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
    {
        if (bRet == -1)
        {
            // handle the error and possibly exit
            bSuccess = FALSE;
        }
        else
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

exit_func:
    if (bSuccess)
    {
        return (int)(msg.wParam);
    }
    else
    {
        return 0;
    }
}

Generated on Wed Nov 13 2024 16:55:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/MultiUI.h File Reference

  • WinUI
  • Input
  • Ime
  • MultiUI
Defines | Functions | Variables

MultiUI.h File Reference

Go to the source code of this file.

Defines

#define | DEFIMC1 0
#define | DEFIMC2 1
#define | IMC1 2
#define | IMC2 3
#define | IMCUI1 4
#define | IMCUI2 5
#define | MAXSIZE_STR 1024
#define | MYGWL_FONT 0
#define | MYGWL_IMC 8
#define | MYGWL_IMEWND 12
#define | MYGWL_STR 4
#define | WMCOMMANDWPARAM(w) LOWORD(w)
#define | WNDEXTRA_NOUINOIMC 8
#define | WNDEXTRA_NOUIOWNIMC 12
#define | WNDEXTRA_OWNUIOWNIMC 16

Functions

BOOL | AboutDlg (HWND, UINT, WPARAM, LPARAM)
HFONT | GetDefaultGUIFont (void)
BOOL InitApplication (HANDLE)
BOOL | InitInstance (HANDLE, int)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | NoUINoIMCWndProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | NoUIOwnIMCWndProc (HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK | OwnUIOwnIMCWndProc (HWND, UINT, WPARAM, LPARAM)
int APIENTRY | WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

Variables

HANDLE hInst
HWND | hWndDef1
HWND | hWndDef2
HWND | hWndIMC1
HWND | hWndIMC2
HWND | hWndIMCUI1
HWND | hWndIMCUI2
HWND | hWndMain

Define Documentation

#define DEFIMC1 0

Definition at line 11 of file MultiUI.h.

#define DEFIMC2 1

Definition at line 12 of file MultiUI.h.

#define IMC1 2

Definition at line 13 of file MultiUI.h.

#define IMC2 3

Definition at line 14 of file MultiUI.h.

#define IMCUI1 4

Definition at line 15 of file MultiUI.h.

#define IMCUI2 5

Definition at line 16 of file MultiUI.h.

#define MAXSIZE_STR 1024

Definition at line 18 of file MultiUI.h.

#define MYGWL_FONT 0

Definition at line 24 of file MultiUI.h.

#define MYGWL_IMC 8

Definition at line 26 of file MultiUI.h.

#define MYGWL_IMEWND 12

Definition at line 27 of file MultiUI.h.

#define MYGWL_STR 4

Definition at line 25 of file MultiUI.h.

#define WMCOMMANDWPARAM ( w ) LOWORD(w)

Definition at line 9 of file MultiUI.h.

#define WNDEXTRA_NOUINOIMC 8

Definition at line 20 of file MultiUI.h.

#define WNDEXTRA_NOUIOWNIMC 12

Definition at line 21 of file MultiUI.h.

#define WNDEXTRA_OWNUIOWNIMC 16

Definition at line 22 of file MultiUI.h.

Function Documentation

BOOL AboutDlg | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 19 of file Dlgs.C.

{
    BOOL bRet = FALSE;

    switch (message)
    {
        case WM_INITDIALOG:
            bRet = TRUE;
            break;

        case WM_COMMAND:
            if (wParam == IDOK ||
                wParam == IDCANCEL)
            {
                EndDialog(hDlg, TRUE);
                bRet = TRUE;
            }
            break;
    }

    return bRet;
}

HFONT GetDefaultGUIFont ( void )
BOOL InitApplication ( HANDLE )

Definition at line 123 of file ClipText.c.

{
    WNDCLASS  wc = {0};

    wc.lpfnWndProc = (WNDPROC) MainWndProc;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName =  TEXT("CliptextMenu");
    wc.lpszClassName = TEXT("CliptextWClass");

    return (RegisterClass(&wc));
}

BOOL InitInstance | ( | HANDLE | ,
 |  | int |
 | ) |  |

Definition at line 126 of file ComDlg32.C.

{
    HWND            hWnd;

  // Save off the handle to the current instance.
    g_hInst = hInstance;

    // Create a main window for this application instance.
    hWnd = CreateWindow(
        "Comdlg32WClass",
        "Common Dialog Sample Application",
        WS_OVERLAPPEDWINDOW,            // Window style.
        CW_USEDEFAULT,                  // Default horizontal position.
        CW_USEDEFAULT,                  // Default vertical position.
        CW_USEDEFAULT,                  // Default width.
        CW_USEDEFAULT,                  // Default height.
        NULL,                           // Overlapped windows have no parent.
        NULL,                           // Use the window class menu.
        g_hInst,                        // This instance owns this window.
        NULL                            // Pointer not needed.
    );

    // If window could not be created, return "failure".
    if (!hWnd)
        return (FALSE);

    // Register the window messages to receive.
    cdmsgShareViolation = RegisterWindowMessage(szmsgSHAREVIOLATION);
    cdmsgFileOK         = RegisterWindowMessage(szmsgFILEOK);
    cdmsgHelp           = RegisterWindowMessage(szCommdlgHelp);

    // Make the window visible; update its client area; and return "success".
    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);
    return (TRUE);

}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

LRESULT CALLBACK NoUINoIMCWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 385 of file MultiWnd.C.

{
    HFONT hFont = NULL;
    BOOL bRetDWP = FALSE;

    switch (message)
    {
        case WM_CREATE:
            hFont = GetDefaultGUIFont();
            SetWindowLongPtr(hWnd,MYGWL_FONT,(LONG_PTR)hFont);
            InitStringBuffer(hWnd);
            break;

        case WM_LBUTTONDBLCLK:
            MyChangeFont(hWnd);
            break;

        case WM_LBUTTONDOWN:
            SetFocus(hWnd);
            break;

        case WM_SETFOCUS:
            MySetCompositionFont(hWnd);
            MySetCompositionForm(hWnd);
            break;

        case WM_IME_COMPOSITION:
            if (lParam & GCS_RESULTSTR)
            {
                AddResultString(hWnd);
            }
            bRetDWP = TRUE;
            break;

        case WM_SIZE:
            switch (wParam)
            {
                case SIZENORMAL: /* fall-through */
                case SIZEFULLSCREEN:
                    if (hWnd == GetFocus())
                    {
                        MySetCompositionForm(hWnd);
                    }
                    InvalidateRect(hWnd,NULL,TRUE);
                    break;

                case SIZEICONIC:
                    bRetDWP = TRUE;
                    break;
            }
            break;

        case WM_PAINT:
            MyDrawString(hWnd,wParam,lParam);
            break;

        case WM_DESTROY:
            hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
            DeleteObject(hFont);
            DestroyStringBuffer(hWnd);
            break;

        default:
            bRetDWP = TRUE;
            break;
    }

    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

LRESULT CALLBACK NoUIOwnIMCWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 473 of file MultiWnd.C.

{
    HIMC  hIMC    = NULL;
    HFONT hFont   = NULL;
    BOOL  bRetDWP = FALSE;

    switch (message)
    {
        case WM_CREATE:
            hFont = GetDefaultGUIFont();
            SetWindowLongPtr(hWnd,MYGWL_FONT,(LONG_PTR)hFont);

            hIMC = ImmCreateContext();
            ImmAssociateContext(hWnd,hIMC);

            // Save hIMC into WndExtra.
            SetWindowLongPtr(hWnd,MYGWL_IMC,(LONG_PTR)hIMC);

            MySetCompositionFont(hWnd);
            MySetCompositionForm(hWnd);

            InitStringBuffer(hWnd);
            break;

        case WM_LBUTTONDBLCLK:
            MyChangeFont(hWnd);
            break;

        case WM_LBUTTONDOWN:
            SetFocus(hWnd);
            break;

        case WM_IME_COMPOSITION:
            if (lParam & GCS_RESULTSTR)
            {
                AddResultString(hWnd);
            }
            bRetDWP = TRUE;
            break;

        case WM_SIZE:
            switch (wParam)
            {
                case SIZENORMAL: /* fall-through */
                case SIZEFULLSCREEN:
                    MySetCompositionForm(hWnd);
                    InvalidateRect(hWnd,NULL,TRUE);
                    break;

                case SIZEICONIC:
                    bRetDWP = TRUE;
                    break;
            }
            break;

        case WM_PAINT:
            MyDrawString(hWnd,wParam,lParam);
            break;

        case WM_DESTROY:
            hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
            DeleteObject(hFont);

            hIMC = (HIMC)GetWindowLongPtr(hWnd,MYGWL_IMC);
            ImmDestroyContext(hIMC);

            DestroyStringBuffer(hWnd);
            break;

        default:
            bRetDWP = TRUE;
            break;
    }

    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

LRESULT CALLBACK OwnUIOwnIMCWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 567 of file MultiWnd.C.

{
    HFONT hFont   = NULL;
    HIMC  hIMC    = 0L;
    HWND  hIMEWnd = (HWND)GetWindowLongPtr(hWnd,MYGWL_IMEWND);
    BOOL  bRetDWP = FALSE;

    if (IsWindow(hIMEWnd) && ImmIsUIMessage(hIMEWnd,message,wParam,lParam))
    {
        switch (message)
        {
            case WM_IME_COMPOSITION:
                if (lParam & GCS_RESULTSTR)
                {
                    AddResultString(hWnd);
                }
                break;

            default:
                break;
        }

        goto exit_func;
    }

    switch (message)
    {
        case WM_CREATE:
            hFont = GetDefaultGUIFont();
            SetWindowLongPtr(hWnd,MYGWL_FONT,(LONG_PTR)hFont);

            hIMC = ImmCreateContext();
            ImmAssociateContext(hWnd,hIMC);

            // Save hIMC into WndExtra.
            SetWindowLongPtr(hWnd,MYGWL_IMC,(LONG_PTR)hIMC);

            if (!(hIMEWnd = CreateWindow(
                            TEXT("Ime"), TEXT(""),
                            WS_POPUP | WS_DISABLED,
                            0,0,0,0,
                            hWnd, NULL, hInst, NULL)))
            {
              return -1;
            }

            // Save hIMEWnd into WndExtra.
            SetWindowLongPtr(hWnd,MYGWL_IMEWND,(LONG_PTR)hIMEWnd);

            MySetCompositionFont(hWnd);
            MySetCompositionForm(hWnd);

            InitStringBuffer(hWnd);
            break;

        case WM_LBUTTONDBLCLK:
            MyChangeFont(hWnd);
            break;

        case WM_LBUTTONDOWN:
            SetFocus(hWnd);
            break;

        case WM_SIZE:
            switch (wParam)
            {
                case SIZENORMAL: /* fall-through */
                case SIZEFULLSCREEN:
                    MySetCompositionForm(hWnd);
                    InvalidateRect(hWnd,NULL,TRUE);
                    break;

                case SIZEICONIC:
                    bRetDWP = TRUE;
                    break;
            }
            break;

        case WM_PAINT:
            MyDrawString(hWnd,wParam,lParam);
            break;

        case WM_DESTROY:
            hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
            DeleteObject(hFont);

            hIMC = (HIMC)GetWindowLongPtr(hWnd,MYGWL_IMC);
            ImmDestroyContext(hIMC);

            DestroyStringBuffer(hWnd);
            break;

        default:
            bRetDWP = TRUE;
            break;
    }

exit_func:
    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

int APIENTRY WinMain | ( | HINSTANCE | ,
 |  | HINSTANCE | ,
 |  | LPSTR | ,
 |  | int |
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 48 of file Demo.c.

{

    HWND hWnd;
    MSG msg;
    CHAR szAppName[64];

    UNREFERENCED_PARAMETER(lpCmdLine);

    if (!hPrevInstance)
        if (!DemoInit(hInstance))
            return (0);

    hInst = hInstance;
    LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName));

    hWnd = CreateWindow("Demo",
        szAppName,
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        NULL,
        NULL,
        hInstance,
        NULL);

    if (!hWnd)
        return (0);

    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);

    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return (int)(msg.wParam);
}

Variable Documentation

HANDLE hInst

Definition at line 37 of file Demo.c.

HWND hWndDef1

Definition at line 16 of file Data.C.

HWND hWndDef2

Definition at line 17 of file Data.C.

HWND hWndIMC1

Definition at line 18 of file Data.C.

HWND hWndIMC2

Definition at line 19 of file Data.C.

HWND hWndIMCUI1

Definition at line 20 of file Data.C.

HWND hWndIMCUI2

Definition at line 21 of file Data.C.

HWND hWndMain

Definition at line 40 of file halftone.c.

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/MultiWnd.C File Reference

  • WinUI
  • Input
  • Ime
  • MultiUI
Functions

MultiWnd.C File Reference

#include <windows.h>
#include <Commdlg.h>
#include <imm.h>
#include <tchar.h>
#include "resource.h"
#include "multiui.h"

Go to the source code of this file.

Functions

void | AddResultString (HWND hWnd)
DWORD | DestroyStringBuffer (HWND hWnd)
HFONT | GetDefaultGUIFont (VOID)
DWORD | InitStringBuffer (HWND hWnd)
void | MyChangeFont (HWND hWnd)
DWORD | MyDrawString (HWND hWnd, WPARAM wParam, LPARAM lParam)
void | MySetCompositionFont (HWND hWnd)
DWORD | MySetCompositionForm (HWND hWnd)
LRESULT CALLBACK | NoUINoIMCWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK | NoUIOwnIMCWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL | OverFlowText (HWND hWnd, PTSTR pStr, PTSTR pResultStr)
LRESULT CALLBACK | OwnUIOwnIMCWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Function Documentation

void AddResultString ( HWND hWnd )

Definition at line 333 of file MultiWnd.C.

{
    HIMC  hIMC       = NULL;
    DWORD dwLen      = 0;
    PTSTR pStr       = NULL;
    PTSTR pResultStr = NULL;

    pStr = (PTSTR)GetWindowLongPtr(hWnd, MYGWL_STR);

    hIMC = ImmGetContext(hWnd);

    if (!hIMC)
    {
        return;
    }

    dwLen = ImmGetCompositionString(hIMC,GCS_RESULTSTR,NULL,0L);

    if (dwLen)
    {
        pResultStr = GlobalAlloc(GPTR, dwLen + 1);

        if (pResultStr)
        {
            ImmGetCompositionString(hIMC, GCS_RESULTSTR,
                                    pResultStr,dwLen+1);

            if (OverFlowText(hWnd, pStr, pResultStr))
            {
                _tcsncpy(pStr, pResultStr, MAXSIZE_STR - 1);
            }
            else
            {
                _tcsncat(pStr, pResultStr, min(MAXSIZE_STR - _tcslen(pStr) - 1, _tcslen(pResultStr)));
            }

            InvalidateRect(hWnd,NULL,TRUE);

            GlobalFree((HANDLE)pResultStr);
        }
    }

    ImmReleaseContext(hWnd,hIMC);

}

DWORD DestroyStringBuffer ( HWND hWnd )

Definition at line 47 of file MultiWnd.C.

{
    DWORD error = ERROR_SUCCESS;
    PTSTR pStr = NULL;

    pStr = (PTSTR)GetWindowLongPtr(hWnd, MYGWL_STR);
    if (pStr)
    {
        GlobalFree((HANDLE)pStr);
    }
    else
    {
        error = GetLastError ();
    }

    return error;
}

HFONT GetDefaultGUIFont ( VOID )

Definition at line 231 of file MultiWnd.C.

{
    static HFONT hFont;
    OSVERSIONINFO VerInfo = {0};

    if (hFont)
    {
        return hFont;
    }

    VerInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    GetVersionEx(&VerInfo);

    if (VerInfo.dwMajorVersion < 4)
    {
        NONCLIENTMETRICS ncm = {0};

        ncm.cbSize = sizeof(NONCLIENTMETRICS);
        SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
        hFont = CreateFontIndirect(&ncm.lfStatusFont);

        if (!hFont)
        {
            hFont = GetStockObject(SYSTEM_FONT);
        }
    }
    else
    {
        hFont = GetStockObject(DEFAULT_GUI_FONT);
    }

    return hFont;
}

DWORD InitStringBuffer ( HWND hWnd )

Definition at line 22 of file MultiWnd.C.

{
    DWORD error = ERROR_SUCCESS;
    PTSTR pStr = NULL;

    pStr = GlobalAlloc (GPTR, MAXSIZE_STR * sizeof(TCHAR));
    if (NULL == pStr)
    {
        error = GetLastError ();
    }

    if (0 == SetWindowLongPtr(hWnd, MYGWL_STR, (LONG_PTR)pStr))
    {
        error = GetLastError ();
    }

    return error;
}

void MyChangeFont ( HWND hWnd )

Definition at line 196 of file MultiWnd.C.

{
    LOGFONT    lf    = {0};
    CHOOSEFONT cf    = {0};
    HFONT      hFont = NULL;

    /* Set all structure fields to zero. */
    memset(&cf, 0, sizeof(CHOOSEFONT));

    cf.lStructSize = sizeof(CHOOSEFONT);
    cf.hwndOwner = hWnd;
    cf.lpLogFont = &lf;
    cf.Flags = CF_SCREENFONTS | CF_EFFECTS;
    cf.rgbColors = RGB(0, 255, 255); /* light blue */
    cf.nFontType = SCREEN_FONTTYPE;

    if (ChooseFont(&cf))
    {
        hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
        DeleteObject(hFont);

        hFont = CreateFontIndirect(&lf);
        SetWindowLongPtr(hWnd,MYGWL_FONT,(LONG_PTR)hFont);
        MySetCompositionForm(hWnd);
        MySetCompositionFont(hWnd);
    }
    SetFocus(hWnd);
}

DWORD MyDrawString | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 71 of file MultiWnd.C.

{
    DWORD       error    = ERROR_SUCCESS;
    PTSTR       pStr     = NULL;
    HDC         hDC      = NULL;
    PAINTSTRUCT ps       = {0};
    HFONT       hOldFont = NULL;
    HFONT       hFont    = NULL;
    DWORD       dwHeight = 0;
    TEXTMETRIC  tm       = {0};
    RECT        rc       = {0};

    pStr = (PTSTR)GetWindowLongPtr(hWnd, MYGWL_STR);
    if (!pStr)
    {
        error = GetLastError ();
        goto exit_func;
    }

    hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
    if (!hFont)
    {
        error = GetLastError ();
        goto exit_func;
    }

    hDC = BeginPaint(hWnd, &ps);
    hOldFont = SelectObject(hDC, hFont);

    pStr = (PTSTR)GetWindowLongPtr(hWnd, MYGWL_STR);
    // Get dwHeight.
    GetTextMetrics(hDC,&tm);
    dwHeight = tm.tmHeight + tm.tmExternalLeading;

    GetClientRect(hWnd,&rc);
    rc.bottom -= dwHeight;

    DrawText(hDC, pStr, -1, &rc, DT_LEFT | DT_WORDBREAK);

    SelectObject(hDC, hOldFont);
    EndPaint(hWnd, &ps);

exit_func:
    return error;
}

void MySetCompositionFont ( HWND hWnd )

Definition at line 127 of file MultiWnd.C.

{
    HIMC hIMC;

    if (hIMC = ImmGetContext(hWnd))
    {
        LOGFONT lf;
        HFONT   hFont = (HFONT)GetWindowLongPtr(hWnd, MYGWL_FONT);
        GetObject(hFont, sizeof(lf), &lf);

        ImmSetCompositionFont(hIMC, &lf);
        ImmReleaseContext(hWnd, hIMC);
    }
}

DWORD MySetCompositionForm ( HWND hWnd )

Definition at line 148 of file MultiWnd.C.

{
    DWORD           error    = ERROR_SUCCESS;
    RECT            rc       = {0};
    HIMC            hIMC     = NULL;
    HDC             hDC      = NULL;
    TEXTMETRIC      tm       = {0};
    DWORD           dwHeight = 0;
    HFONT           hFont    = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
    HFONT           hOldFont = NULL;
    COMPOSITIONFORM CompForm = {0};

    if (!hFont)
    {
        error = GetLastError ();
        goto exit_func;
    }

    if (hIMC = ImmGetContext(hWnd))
    {
        // Get dwHeight.
        hDC = GetDC(hWnd);
        hOldFont = SelectObject(hDC, hFont);
        GetTextMetrics(hDC,&tm);
        dwHeight = tm.tmHeight + tm.tmExternalLeading;
        SelectObject(hDC, hOldFont);
        ReleaseDC(hWnd,hDC);

        GetClientRect(hWnd,&rc);
        CompForm.dwStyle = CFS_POINT;
        CompForm.ptCurrentPos.x = rc.left;
        CompForm.ptCurrentPos.y = rc.bottom - dwHeight;
        ImmSetCompositionWindow(hIMC,&CompForm);

        ImmReleaseContext(hWnd, hIMC);
    }

exit_func:
    return error;
}

LRESULT CALLBACK NoUINoIMCWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 385 of file MultiWnd.C.

{
    HFONT hFont = NULL;
    BOOL bRetDWP = FALSE;

    switch (message)
    {
        case WM_CREATE:
            hFont = GetDefaultGUIFont();
            SetWindowLongPtr(hWnd,MYGWL_FONT,(LONG_PTR)hFont);
            InitStringBuffer(hWnd);
            break;

        case WM_LBUTTONDBLCLK:
            MyChangeFont(hWnd);
            break;

        case WM_LBUTTONDOWN:
            SetFocus(hWnd);
            break;

        case WM_SETFOCUS:
            MySetCompositionFont(hWnd);
            MySetCompositionForm(hWnd);
            break;

        case WM_IME_COMPOSITION:
            if (lParam & GCS_RESULTSTR)
            {
                AddResultString(hWnd);
            }
            bRetDWP = TRUE;
            break;

        case WM_SIZE:
            switch (wParam)
            {
                case SIZENORMAL: /* fall-through */
                case SIZEFULLSCREEN:
                    if (hWnd == GetFocus())
                    {
                        MySetCompositionForm(hWnd);
                    }
                    InvalidateRect(hWnd,NULL,TRUE);
                    break;

                case SIZEICONIC:
                    bRetDWP = TRUE;
                    break;
            }
            break;

        case WM_PAINT:
            MyDrawString(hWnd,wParam,lParam);
            break;

        case WM_DESTROY:
            hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
            DeleteObject(hFont);
            DestroyStringBuffer(hWnd);
            break;

        default:
            bRetDWP = TRUE;
            break;
    }

    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

LRESULT CALLBACK NoUIOwnIMCWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 473 of file MultiWnd.C.

{
    HIMC  hIMC    = NULL;
    HFONT hFont   = NULL;
    BOOL  bRetDWP = FALSE;

    switch (message)
    {
        case WM_CREATE:
            hFont = GetDefaultGUIFont();
            SetWindowLongPtr(hWnd,MYGWL_FONT,(LONG_PTR)hFont);

            hIMC = ImmCreateContext();
            ImmAssociateContext(hWnd,hIMC);

            // Save hIMC into WndExtra.
            SetWindowLongPtr(hWnd,MYGWL_IMC,(LONG_PTR)hIMC);

            MySetCompositionFont(hWnd);
            MySetCompositionForm(hWnd);

            InitStringBuffer(hWnd);
            break;

        case WM_LBUTTONDBLCLK:
            MyChangeFont(hWnd);
            break;

        case WM_LBUTTONDOWN:
            SetFocus(hWnd);
            break;

        case WM_IME_COMPOSITION:
            if (lParam & GCS_RESULTSTR)
            {
                AddResultString(hWnd);
            }
            bRetDWP = TRUE;
            break;

        case WM_SIZE:
            switch (wParam)
            {
                case SIZENORMAL: /* fall-through */
                case SIZEFULLSCREEN:
                    MySetCompositionForm(hWnd);
                    InvalidateRect(hWnd,NULL,TRUE);
                    break;

                case SIZEICONIC:
                    bRetDWP = TRUE;
                    break;
            }
            break;

        case WM_PAINT:
            MyDrawString(hWnd,wParam,lParam);
            break;

        case WM_DESTROY:
            hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
            DeleteObject(hFont);

            hIMC = (HIMC)GetWindowLongPtr(hWnd,MYGWL_IMC);
            ImmDestroyContext(hIMC);

            DestroyStringBuffer(hWnd);
            break;

        default:
            bRetDWP = TRUE;
            break;
    }

    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

BOOL OverFlowText | ( | HWND | hWnd,
 |  | PTSTR | pStr,
 |  | PTSTR | pResultStr
 | ) |  |

Definition at line 271 of file MultiWnd.C.

{
    BOOL        bRet     = FALSE;
    RECT        rc       = {0};
    HDC         hDC      = NULL;
    TEXTMETRIC  tm       = {0};
    int         nHeight  = 0;
    HFONT       hFont    = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
    HFONT       hOldFont = NULL;
    PTSTR       pTempStr = NULL;

    if (!hFont)
    {
        return FALSE;
    }

    if (_tcsclen(pStr) + _tcsclen(pResultStr) > MAXSIZE_STR)
    {
        bRet = TRUE;
    }
    else
    {
        pTempStr = GlobalAlloc(GPTR, MAXSIZE_STR * sizeof(TCHAR));

        if (pTempStr)
        {
            _tcsncpy(pTempStr, pStr, MAXSIZE_STR - 1);
            _tcsncat(pTempStr, pResultStr, min(MAXSIZE_STR - _tcslen(pTempStr) - 1, _tcslen(pResultStr)));

            GetClientRect(hWnd,&rc);

            hDC = GetDC(hWnd);
            hOldFont = SelectObject(hDC, hFont);
            GetTextMetrics(hDC,&tm);

            rc.bottom -= tm.tmHeight + tm.tmExternalLeading;
            nHeight = rc.bottom;

            if (nHeight < DrawText(hDC, pTempStr, -1, &rc, DT_LEFT | DT_WORDBREAK | DT_CALCRECT))
            {
                bRet = TRUE;
            }

            SelectObject(hDC, hOldFont);
            ReleaseDC(hWnd,hDC);

            GlobalFree((HANDLE)pTempStr);
        }
    }

    return bRet;
}

LRESULT CALLBACK OwnUIOwnIMCWndProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 567 of file MultiWnd.C.

{
    HFONT hFont   = NULL;
    HIMC  hIMC    = 0L;
    HWND  hIMEWnd = (HWND)GetWindowLongPtr(hWnd,MYGWL_IMEWND);
    BOOL  bRetDWP = FALSE;

    if (IsWindow(hIMEWnd) && ImmIsUIMessage(hIMEWnd,message,wParam,lParam))
    {
        switch (message)
        {
            case WM_IME_COMPOSITION:
                if (lParam & GCS_RESULTSTR)
                {
                    AddResultString(hWnd);
                }
                break;

            default:
                break;
        }

        goto exit_func;
    }

    switch (message)
    {
        case WM_CREATE:
            hFont = GetDefaultGUIFont();
            SetWindowLongPtr(hWnd,MYGWL_FONT,(LONG_PTR)hFont);

            hIMC = ImmCreateContext();
            ImmAssociateContext(hWnd,hIMC);

            // Save hIMC into WndExtra.
            SetWindowLongPtr(hWnd,MYGWL_IMC,(LONG_PTR)hIMC);

            if (!(hIMEWnd = CreateWindow(
                            TEXT("Ime"), TEXT(""),
                            WS_POPUP | WS_DISABLED,
                            0,0,0,0,
                            hWnd, NULL, hInst, NULL)))
            {
              return -1;
            }

            // Save hIMEWnd into WndExtra.
            SetWindowLongPtr(hWnd,MYGWL_IMEWND,(LONG_PTR)hIMEWnd);

            MySetCompositionFont(hWnd);
            MySetCompositionForm(hWnd);

            InitStringBuffer(hWnd);
            break;

        case WM_LBUTTONDBLCLK:
            MyChangeFont(hWnd);
            break;

        case WM_LBUTTONDOWN:
            SetFocus(hWnd);
            break;

        case WM_SIZE:
            switch (wParam)
            {
                case SIZENORMAL: /* fall-through */
                case SIZEFULLSCREEN:
                    MySetCompositionForm(hWnd);
                    InvalidateRect(hWnd,NULL,TRUE);
                    break;

                case SIZEICONIC:
                    bRetDWP = TRUE;
                    break;
            }
            break;

        case WM_PAINT:
            MyDrawString(hWnd,wParam,lParam);
            break;

        case WM_DESTROY:
            hFont = (HFONT)GetWindowLongPtr(hWnd,MYGWL_FONT);
            DeleteObject(hFont);

            hIMC = (HIMC)GetWindowLongPtr(hWnd,MYGWL_IMC);
            ImmDestroyContext(hIMC);

            DestroyStringBuffer(hWnd);
            break;

        default:
            bRetDWP = TRUE;
            break;
    }

exit_func:
    if (bRetDWP)
    {
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/Resource.h File Reference

  • WinUI
  • Input
  • Ime
  • MultiUI
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define IDM_ABOUT 40003

Define Documentation

#define IDM_ABOUT 40003

Definition at line 5 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/MouseInfo/MousInfo.c File Reference

  • WinUI
  • Input
  • MouseInfo
Functions | Variables

MousInfo.c File Reference

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "mousinfo.h"

Go to the source code of this file.

Functions

LRESULT CALLBACK | MainWindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

TCHAR | garMsgStrings [][20]
HINSTANCE | ghInst

Function Documentation

LRESULT CALLBACK MainWindowProc | ( | HWND | hwnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 167 of file MousInfo.c.

{
    TEXTMETRIC tm = {0};
    HDC hDC = NULL;

    int MsgIndex = NO_MESSAGE;          // Index into garMsgStrings[] array
    TCHAR szBuff[128] = {0};            // String buffer
    static int LB = 0, RB = 0, MB = 0;  // State of the mouse buttons
    static int X = 0, Y = 0;            // Mouse position
    static TCHAR Roller = TEXT(' ');    // State of the mouse wheel. '+' or '-'
    static int fHasWheel = FALSE;       // Mouse has a wheel?? TRUE if yes, FALSE if no

    switch (message)
    {
        case WM_CREATE:
            //
            // See if we have a mouse with a wheel attached to the system.
            // Note that SM_MOUSEWHEELPRESENT is a new flag for GetSystemMetrics
            //  and returns TRUE if a mouse with a wheel is present, FALSE if not.
            //
            fHasWheel = GetSystemMetrics (SM_MOUSEWHEELPRESENT);

            //
            // Size the window so that it will display all the text
            //
            hDC = GetDC (hwnd);
            GetTextMetrics (hDC,&tm);
            SetWindowPos (hwnd, HWND_BOTTOM, 0, 0,
                          tm.tmMaxCharWidth * MAX_TITLE_LEN,
                          100, SWP_SHOWWINDOW);
            ReleaseDC (hwnd, hDC);
      break;

        case WM_DESTROY:
            PostQuitMessage (0);
            break;

        //
        // Handle WM_MOUSE messages.
        // First we setup up some variables and then let
        //   control fall through to the end of the switch
        //   construct, where we then update the title bar.
        //
        case WM_LBUTTONUP:      LB=0; MsgIndex = LBU; break;
        case WM_RBUTTONUP:      RB=0; MsgIndex = RBU; break;
        case WM_MBUTTONUP:      MB=0; MsgIndex = MBU; break;
        case WM_LBUTTONDOWN:    LB=1; MsgIndex = LBD; break;
        case WM_RBUTTONDOWN:    RB=1; MsgIndex = RBD; break;
        case WM_MBUTTONDOWN:    MB=1; MsgIndex = MBD; break;
        case WM_LBUTTONDBLCLK:  LB=0; MsgIndex = LB2; break;
        case WM_MBUTTONDBLCLK:  MB=0; MsgIndex = MB2; break;
        case WM_RBUTTONDBLCLK:  RB=0; MsgIndex = RB2; break;
        case WM_MOUSEHOVER:     MsgIndex = MH;  break;
        case WM_MOUSELEAVE:     MsgIndex = ML;  break;
        case WM_MOUSEMOVE:      MsgIndex = NO_MESSAGE; Roller = TEXT(' ');  break;

        // Handle WM_MOUSEWHEEL message.
        // We handle this message a little differently since the
        // roller movement info is in the HIWORD of wParam.
        //
        // The MouseWheel has 18 'detents'. As the wheel is rolled
        // and a detent is encountered, the OS will send a WM_MOUSEWHEEL
        // message with the HIWORD of wParam set to a value of +/- 120.
        // '+' if the wheel is being rolled forward (away from the user),
        // '-' if the wheel is being rolled backwards (towards the user).
        case WM_MOUSEWHEEL:
            //
            // Mouse Wheel is being rolled forward
            //
            if ((short) HIWORD(wParam) > 0)
            {
                Roller = TEXT('+');
            }

            //
            // Mouse Wheel is being rolled backward
            //
            if ((short)HIWORD(wParam) < 0)
            {
                Roller = TEXT('-');
            }
            MsgIndex = MW;
            break;

        case WM_COMMAND:
            switch (wParam)
            {
                //
                // Call the TrackMouseEvent() API, and set up a WM_MOUSEHOVER
                // "one-shot" event. Exactly one and only one  WM_MOUSEHOVER
                // message will be sent to the window specified in the hwndTrack
                // member of the TRACKMOUSEEVENT structure, when the mouse has
                // 'hovered' over the client area an amount of time equal to that
                // specified in the dwHoverTime member of TRACKMOUSEEVENT.
                //
                // NOTE that this message will be generated only once. The application
                // must call the TrackMouseEvent() API again in order for the system
                // to generate another WM_MOUSEHOVER message.
                //
                case IDM_HOVER:
                {
                    TRACKMOUSEEVENT tme = {0};

                    tme.cbSize      = sizeof(TRACKMOUSEEVENT);
                    tme.dwFlags     = TME_HOVER;
                    tme.hwndTrack   = hwnd;
                    tme.dwHoverTime = HOVER_DEFAULT;

                    TrackMouseEvent(&tme);
                    break;
                }

                //
                // Call the TrackMouseEvent() API, and set up a WM_MOUSELEAVE
                // "one-shot" event. Exactly one and only one  WM_MOUSELEAVE
                // message will be sent to the window specified in the hwndTrack
                // member of the TRACKMOUSEEVENT structure, when the mouse has
                // left the client area.
                //
                // NOTE that this message will be generated only once. The application
                // must call the TrackMouseEvent() API again in order for the system
                // to generate another WM_MOUSELEAVE message. Also note that if the
                // mouse pointer is not over the application, a call to TrackMouseEvent()
                // will result in the immediate posting of a WM_MOUSELEAVE
                // message.
                //
                case IDM_LEAVE:
                {
                    TRACKMOUSEEVENT tme = {0};

                    tme.cbSize      = sizeof(TRACKMOUSEEVENT);
                    tme.dwFlags     = TME_LEAVE;
                    tme.hwndTrack   = hwnd;

                    TrackMouseEvent(&tme);
                    break;
                }

                case IDM_ABOUT:
                {
                    TCHAR buff[128] = {0};

                    _sntprintf (buff, sizeof(buff)/sizeof(buff[0]) - 1,
                                TEXT("MousInfo.Exe\r\n")
                                TEXT("Copyright 1995 - 2000 Microsoft Corp.\r\n")
                                TEXT("All rights reserved\r\n\r\n") );

                    MessageBox (hwnd, buff, szAppName, MB_OK);
                    break;
                }
            }
            break;

        default:
            goto exit_func;
            break;
    }  // end switch (message)

    //
    // If the mouse has a wheel, display the state of the mouse buttons,
    // wheel and position in the title bar.
    // Else if mouse does not have a wheel, do not display the state
    // of the wheel (but do display everything else!)
    //
    if (fHasWheel)
    {
        _sntprintf (szBuff, sizeof(szBuff)/sizeof(szBuff[0]) - 1,
                    TEXT("L:%d M:%d R:%d W:%c x:%04d y:%04d %s"),
                    LB, MB, RB, Roller,
                    LOWORD(lParam), HIWORD(lParam),
                    garMsgStrings[MsgIndex] );
    }
    else
    {
        _sntprintf (szBuff, sizeof(szBuff)/sizeof(szBuff[0]) - 1,
                    TEXT("L:%d M:%d R:%d x:%04d y:%04d %s"),
                    LB, MB, RB, LOWORD(lParam), HIWORD(lParam),
                    garMsgStrings[MsgIndex] );
    }

    SetWindowText(hwnd,szBuff);

exit_func:
    return  DefWindowProc (hwnd, message, wParam, lParam);
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 54 of file MousInfo.c.

{
    MSG msg = {0};
    WNDCLASS wc = {0};
    HWND hwndMain = NULL;
    BOOL bRet = FALSE;
    BOOL bRetZero = FALSE;

    ghInst = hInstance;

    //
    // Register our main window
    //
    wc.style         = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc   = (WNDPROC) MainWindowProc;
    wc.hInstance     = ghInst;
    wc.hIcon         = LoadIcon (hInstance, MAKEINTRESOURCE(MOUSINFO_ICON));
    wc.hCursor       = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
    wc.lpszMenuName  = MAKEINTRESOURCE (IDM_MENU);
    wc.lpszClassName = szClassName;

    if (!RegisterClass(&wc))
    {
        bRetZero = TRUE;
        goto exit_func;
    }

    //
    // Create the main window...
    // with an initial size of 0
    //
    hwndMain = CreateWindow (
        szClassName,
        szAppName,
        WS_OVERLAPPEDWINDOW ^ WS_MAXIMIZEBOX,
        0,0,0,0,
        NULL, NULL, ghInst, NULL);

    //
    // Show the window
    //
    ShowWindow (hwndMain,SW_SHOW);
    UpdateWindow (hwndMain);

    //
    // Message pump
    //
    while ((bRet = GetMessage (&msg, NULL, 0, 0)) != 0)
    {
        if (bRet == -1)
        {
            bRetZero = TRUE;
            goto exit_func;
        }
        else
        {
            TranslateMessage (&msg);
            DispatchMessage (&msg);
        }
    }

exit_func:
    if (bRetZero)
    {
        return 0;
    }
    else
    {
        return (int) msg.wParam;
    }
}

Variable Documentation

TCHAR garMsgStrings[][20]
Initial value:

{
    TEXT("                   "),
    TEXT("WM_LBUTTONUP       "),
    TEXT("WM_RBUTTONUP       "),
    TEXT("WM_MBUTTONUP       "),
    TEXT("WM_LBUTTONDOWN     "),
    TEXT("WM_RBUTTONDOWN     "),
    TEXT("WM_MBUTTONDOWN     "),
    TEXT("WM_LBUTTONDBLCLK   "),
    TEXT("WM_MBUTTONDBLCLK   "),
    TEXT("WM_RBUTTONDBLCLK   "),
    TEXT("WM_MOUSEWHEEL      "),
    TEXT("WM_MOUSEHOVER      "),

}

Definition at line 29 of file MousInfo.c.

HINSTANCE ghInst

Name of app.

Definition at line 24 of file MousInfo.c.

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/MouseInfo/MousInfo.h File Reference

  • WinUI
  • Input
  • MouseInfo
Defines | Functions | Variables

MousInfo.h File Reference

Go to the source code of this file.

Defines

#define | IDM_ABOUT 0x2000
#define | IDM_HOVER 0x1001
#define | IDM_LEAVE 0x1002
#define | IDM_MENU 0x0900
#define | IDM_TRACK 0x1000
#define | LB2 7
#define | LBD 4
#define | LBU 1
#define | MAX_TITLE_LEN 44
#define | MB2 8
#define | MBD 6
#define | MBU 3
#define | MH 11
#define | ML 12
#define | MOUSINFO_ICON 102
#define | MW 10
#define | NO_MESSAGE 0
#define | RB2 9
#define | RBD 5
#define | RBU 2

Functions

LRESULT CALLBACK | MainWindowProc (HWND, UINT, WPARAM, LPARAM)
int WINAPI | WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

Variables

TCHAR | szAppName [] = TEXT("MousInfo")
TCHAR | szClassName [] = TEXT("MousInfoClass")

Define Documentation

#define IDM_ABOUT 0x2000

Definition at line 44 of file MousInfo.h.

#define IDM_HOVER 0x1001

Definition at line 41 of file MousInfo.h.

#define IDM_LEAVE 0x1002

Definition at line 42 of file MousInfo.h.

#define IDM_MENU 0x0900

Definition at line 38 of file MousInfo.h.

#define IDM_TRACK 0x1000

Definition at line 40 of file MousInfo.h.

#define LB2 7

Definition at line 28 of file MousInfo.h.

#define LBD 4

Definition at line 25 of file MousInfo.h.

#define LBU 1

Definition at line 22 of file MousInfo.h.

#define MAX_TITLE_LEN 44

Definition at line 18 of file MousInfo.h.

#define MB2 8

Definition at line 29 of file MousInfo.h.

#define MBD 6

Definition at line 27 of file MousInfo.h.

#define MBU 3

Definition at line 24 of file MousInfo.h.

#define MH 11

Definition at line 32 of file MousInfo.h.

#define ML 12

Definition at line 33 of file MousInfo.h.

#define MOUSINFO_ICON 102

Definition at line 36 of file MousInfo.h.

#define MW 10

Definition at line 31 of file MousInfo.h.

#define NO_MESSAGE 0

Definition at line 21 of file MousInfo.h.

#define RB2 9

Definition at line 30 of file MousInfo.h.

#define RBD 5

Definition at line 26 of file MousInfo.h.

#define RBU 2

Definition at line 23 of file MousInfo.h.

Function Documentation

LRESULT CALLBACK MainWindowProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 167 of file MousInfo.c.

{
    TEXTMETRIC tm = {0};
    HDC hDC = NULL;

    int MsgIndex = NO_MESSAGE;          // Index into garMsgStrings[] array
    TCHAR szBuff[128] = {0};            // String buffer
    static int LB = 0, RB = 0, MB = 0;  // State of the mouse buttons
    static int X = 0, Y = 0;            // Mouse position
    static TCHAR Roller = TEXT(' ');    // State of the mouse wheel. '+' or '-'
    static int fHasWheel = FALSE;       // Mouse has a wheel?? TRUE if yes, FALSE if no

    switch (message)
    {
        case WM_CREATE:
            //
            // See if we have a mouse with a wheel attached to the system.
            // Note that SM_MOUSEWHEELPRESENT is a new flag for GetSystemMetrics
            //  and returns TRUE if a mouse with a wheel is present, FALSE if not.
            //
            fHasWheel = GetSystemMetrics (SM_MOUSEWHEELPRESENT);

            //
            // Size the window so that it will display all the text
            //
            hDC = GetDC (hwnd);
            GetTextMetrics (hDC,&tm);
            SetWindowPos (hwnd, HWND_BOTTOM, 0, 0,
                          tm.tmMaxCharWidth * MAX_TITLE_LEN,
                          100, SWP_SHOWWINDOW);
            ReleaseDC (hwnd, hDC);
      break;

        case WM_DESTROY:
            PostQuitMessage (0);
            break;

        //
        // Handle WM_MOUSE messages.
        // First we setup up some variables and then let
        //   control fall through to the end of the switch
        //   construct, where we then update the title bar.
        //
        case WM_LBUTTONUP:      LB=0; MsgIndex = LBU; break;
        case WM_RBUTTONUP:      RB=0; MsgIndex = RBU; break;
        case WM_MBUTTONUP:      MB=0; MsgIndex = MBU; break;
        case WM_LBUTTONDOWN:    LB=1; MsgIndex = LBD; break;
        case WM_RBUTTONDOWN:    RB=1; MsgIndex = RBD; break;
        case WM_MBUTTONDOWN:    MB=1; MsgIndex = MBD; break;
        case WM_LBUTTONDBLCLK:  LB=0; MsgIndex = LB2; break;
        case WM_MBUTTONDBLCLK:  MB=0; MsgIndex = MB2; break;
        case WM_RBUTTONDBLCLK:  RB=0; MsgIndex = RB2; break;
        case WM_MOUSEHOVER:     MsgIndex = MH;  break;
        case WM_MOUSELEAVE:     MsgIndex = ML;  break;
        case WM_MOUSEMOVE:      MsgIndex = NO_MESSAGE; Roller = TEXT(' ');  break;

        // Handle WM_MOUSEWHEEL message.
        // We handle this message a little differently since the
        // roller movement info is in the HIWORD of wParam.
        //
        // The MouseWheel has 18 'detents'. As the wheel is rolled
        // and a detent is encountered, the OS will send a WM_MOUSEWHEEL
        // message with the HIWORD of wParam set to a value of +/- 120.
        // '+' if the wheel is being rolled forward (away from the user),
        // '-' if the wheel is being rolled backwards (towards the user).
        case WM_MOUSEWHEEL:
            //
            // Mouse Wheel is being rolled forward
            //
            if ((short) HIWORD(wParam) > 0)
            {
                Roller = TEXT('+');
            }

            //
            // Mouse Wheel is being rolled backward
            //
            if ((short)HIWORD(wParam) < 0)
            {
                Roller = TEXT('-');
            }
            MsgIndex = MW;
            break;

        case WM_COMMAND:
            switch (wParam)
            {
                //
                // Call the TrackMouseEvent() API, and set up a WM_MOUSEHOVER
                // "one-shot" event. Exactly one and only one  WM_MOUSEHOVER
                // message will be sent to the window specified in the hwndTrack
                // member of the TRACKMOUSEEVENT structure, when the mouse has
                // 'hovered' over the client area an amount of time equal to that
                // specified in the dwHoverTime member of TRACKMOUSEEVENT.
                //
                // NOTE that this message will be generated only once. The application
                // must call the TrackMouseEvent() API again in order for the system
                // to generate another WM_MOUSEHOVER message.
                //
                case IDM_HOVER:
                {
                    TRACKMOUSEEVENT tme = {0};

                    tme.cbSize      = sizeof(TRACKMOUSEEVENT);
                    tme.dwFlags     = TME_HOVER;
                    tme.hwndTrack   = hwnd;
                    tme.dwHoverTime = HOVER_DEFAULT;

                    TrackMouseEvent(&tme);
                    break;
                }

                //
                // Call the TrackMouseEvent() API, and set up a WM_MOUSELEAVE
                // "one-shot" event. Exactly one and only one  WM_MOUSELEAVE
                // message will be sent to the window specified in the hwndTrack
                // member of the TRACKMOUSEEVENT structure, when the mouse has
                // left the client area.
                //
                // NOTE that this message will be generated only once. The application
                // must call the TrackMouseEvent() API again in order for the system
                // to generate another WM_MOUSELEAVE message. Also note that if the
                // mouse pointer is not over the application, a call to TrackMouseEvent()
                // will result in the immediate posting of a WM_MOUSELEAVE
                // message.
                //
                case IDM_LEAVE:
                {
                    TRACKMOUSEEVENT tme = {0};

                    tme.cbSize      = sizeof(TRACKMOUSEEVENT);
                    tme.dwFlags     = TME_LEAVE;
                    tme.hwndTrack   = hwnd;

                    TrackMouseEvent(&tme);
                    break;
                }

                case IDM_ABOUT:
                {
                    TCHAR buff[128] = {0};

                    _sntprintf (buff, sizeof(buff)/sizeof(buff[0]) - 1,
                                TEXT("MousInfo.Exe\r\n")
                                TEXT("Copyright 1995 - 2000 Microsoft Corp.\r\n")
                                TEXT("All rights reserved\r\n\r\n") );

                    MessageBox (hwnd, buff, szAppName, MB_OK);
                    break;
                }
            }
            break;

        default:
            goto exit_func;
            break;
    }  // end switch (message)

    //
    // If the mouse has a wheel, display the state of the mouse buttons,
    // wheel and position in the title bar.
    // Else if mouse does not have a wheel, do not display the state
    // of the wheel (but do display everything else!)
    //
    if (fHasWheel)
    {
        _sntprintf (szBuff, sizeof(szBuff)/sizeof(szBuff[0]) - 1,
                    TEXT("L:%d M:%d R:%d W:%c x:%04d y:%04d %s"),
                    LB, MB, RB, Roller,
                    LOWORD(lParam), HIWORD(lParam),
                    garMsgStrings[MsgIndex] );
    }
    else
    {
        _sntprintf (szBuff, sizeof(szBuff)/sizeof(szBuff[0]) - 1,
                    TEXT("L:%d M:%d R:%d x:%04d y:%04d %s"),
                    LB, MB, RB, LOWORD(lParam), HIWORD(lParam),
                    garMsgStrings[MsgIndex] );
    }

    SetWindowText(hwnd,szBuff);

exit_func:
    return  DefWindowProc (hwnd, message, wParam, lParam);
}

int WINAPI WinMain | ( | HINSTANCE | ,
 |  | HINSTANCE | ,
 |  | LPSTR | ,
 |  | int |
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 48 of file Demo.c.

{

    HWND hWnd;
    MSG msg;
    CHAR szAppName[64];

    UNREFERENCED_PARAMETER(lpCmdLine);

    if (!hPrevInstance)
        if (!DemoInit(hInstance))
            return (0);

    hInst = hInstance;
    LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName));

    hWnd = CreateWindow("Demo",
        szAppName,
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        CW_USEDEFAULT,
        NULL,
        NULL,
        hInstance,
        NULL);

    if (!hWnd)
        return (0);

    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);

    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return (int)(msg.wParam);
}

Variable Documentation

TCHAR szAppName[] = TEXT("MousInfo")

Definition at line 14 of file MousInfo.h.

TCHAR szClassName[] = TEXT("MousInfoClass")

Definition at line 15 of file MousInfo.h.

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Menu/Menu.c File Reference

  • WinUI
  • Menu
Functions | Variables

Menu.c File Reference

#include <windows.h>
#include <tchar.h>
#include "menu.h"

Go to the source code of this file.

Functions

INT_PTR CALLBACK | AboutDialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
VOID | HandleChangeColors (HWND hwnd)
VOID | HandleCreate (HWND hwnd)
VOID | HandleDrawItem (HWND hwnd, LPDRAWITEMSTRUCT lpdis)
VOID | HandlePaint (HWND hwnd)
VOID | HandlePopupMenu (HWND hwnd, POINT point)
BOOL | MenuInit (HINSTANCE hInstance)
LRESULT CALLBACK | MenuWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
HBITMAP | ShrinkBitmap (HWND hwnd, HBITMAP hbm)
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

HMENU | hBigMenu
HBITMAP | hbmCheckOff
HBITMAP | hbmCheckOn
HINSTANCE | hInst

Function Documentation

INT_PTR CALLBACK AboutDialogProc | ( | HWND | hDlg,
 |  | UINT | msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 164 of file Menu.c.

{
    BOOL ret = FALSE;

    switch (msg)
    {
        case WM_INITDIALOG:
            ret = TRUE;
            break;

        case WM_COMMAND:
            // LOWORD added for portability
            if (LOWORD(wParam) == IDOK)
            {
                EndDialog (hDlg, 0);
                ret = TRUE;
            }
            else
            {
                ret = FALSE;
            }
            break;

        case WM_SYSCOMMAND:
            if (wParam == SC_CLOSE)
            {
                EndDialog (hDlg, 0);
                ret = TRUE;
            }
            else
            {
                ret = FALSE;
            }
            break;

        default:
            ret = FALSE;
            break;
    }

    return (INT_PTR) ret;
}

VOID HandleChangeColors ( HWND hwnd )

Definition at line 368 of file Menu.c.

{
    HMENU hMenu      = NULL;
    BOOL  fOwnerDraw = FALSE;

    /* Get a handle to the Colors menu. This is at position 1. */
    hMenu = GetSubMenu (GetMenu (hwnd), IDCOLORS_POS);

    /* Get the current state of the item */
    fOwnerDraw = GetMenuState ( hMenu,
                                IDM_COLOROWNERDR, MF_BYCOMMAND) & MF_CHECKED;

    /* Toggle the state of the item. */
    CheckMenuItem ( hMenu,
                    IDM_COLOROWNERDR,
                    MF_BYCOMMAND | (fOwnerDraw ? MF_UNCHECKED : MF_CHECKED));

    if (!fOwnerDraw)
    {
        /* Change the items to owner-draw items. Pass the RGB value for the
         * color as the application-supplied data. This makes it easier for
         * us to draw the items.
         */
        ModifyMenu(hMenu,
                   IDM_BLACK,
                   MF_OWNERDRAW | MF_BYCOMMAND,
                   IDM_BLACK,
                   (LPCTSTR)(INT_PTR)RGB (0,0,0));

        ModifyMenu(hMenu,
                   IDM_BLUE,
                   MF_OWNERDRAW | MF_BYCOMMAND,
                   IDM_BLUE,
                   (LPCTSTR)(INT_PTR)RGB (0,0,255));

        ModifyMenu(hMenu,
                   IDM_RED,
                   MF_OWNERDRAW | MF_BYCOMMAND,
                   IDM_RED,
                   (LPCTSTR)(INT_PTR)RGB (255,0,0));

        ModifyMenu(hMenu,
                   IDM_GREEN,
                   MF_OWNERDRAW | MF_BYCOMMAND,
                   IDM_GREEN,
                   (LPCTSTR)(INT_PTR)RGB (0,255,0));
    }
    else
    {
        /* Change the items to normal text items. */
        ModifyMenu(hMenu, IDM_BLACK, MF_BYCOMMAND, IDM_BLACK, TEXT("Black"));
        ModifyMenu(hMenu, IDM_BLUE,  MF_BYCOMMAND, IDM_BLUE,  TEXT("Blue"));
        ModifyMenu(hMenu, IDM_RED,   MF_BYCOMMAND, IDM_RED,   TEXT("Red"));
        ModifyMenu(hMenu, IDM_GREEN, MF_BYCOMMAND, IDM_GREEN, TEXT("Green"));
    }
}

VOID HandleCreate ( HWND hwnd )

Definition at line 287 of file Menu.c.

{
    HMENU   hMenu    = NULL;
    HMENU   hWndMenu = NULL;

    /* Create a new menu into the menubar on the fly */
    hMenu = CreateMenu ();
    if (!hMenu)
    {
        return;
    }

    /* Append the state menu items to it */
    AppendMenu (hMenu, MF_STRING, IDM_STATE1, TEXT("South Dakota"));
    AppendMenu (hMenu, MF_STRING, IDM_STATE2, TEXT("Washington"));
    AppendMenu (hMenu, MF_STRING, IDM_STATE3, TEXT("California"));
    if (!AppendMenu (hMenu, MF_STRING, IDM_STATE4, TEXT("Oregon")))
    {
        /* It is unlikely the other appends will fail and this will succeed.
         * So just check this one. And if it fails, Destroy the menu for
         * good measure and return.
         */
        DestroyMenu(hMenu);
        return;
    }
    hbmCheckOn  = ShrinkBitmap (hwnd, LoadBitmap (hInst, TEXT("checkon")));
    hbmCheckOff = ShrinkBitmap (hwnd, LoadBitmap (hInst, TEXT("checkoff")));

    /* Set up the user-defined check marks */
    SetMenuItemBitmaps (hMenu, 0, MF_BYPOSITION, hbmCheckOff, hbmCheckOn);
    SetMenuItemBitmaps (hMenu, 1, MF_BYPOSITION, hbmCheckOff, hbmCheckOn);
    SetMenuItemBitmaps (hMenu, 2, MF_BYPOSITION, hbmCheckOff, hbmCheckOn);
    SetMenuItemBitmaps (hMenu, 3, MF_BYPOSITION, hbmCheckOff, hbmCheckOn);

    /* Now insert the menu into the main menu bar. */
    hWndMenu = GetMenu (hwnd);
    InsertMenu (hWndMenu, 2, MF_POPUP|MF_BYPOSITION, (DWORD_PTR)hMenu, TEXT("States"));

    return;
}

VOID HandleDrawItem | ( | HWND | hwnd,
 |  | LPDRAWITEMSTRUCT | lpdis
 | ) |  |

Definition at line 438 of file Menu.c.

{
    HDC     hdcBitmap      = NULL;
    HBITMAP hbmSave        = NULL;
    HBRUSH  hbr            = NULL;
    RECT    rc             = {0};
    LONG    checkMarkSize  = 0;
    DWORD   textColorSave  = 0;
    DWORD   bkColorSave    = 0;

    /* Get the size of the checkmark so we can leave room for it since we
     * want to be able to check the selected color.
     */
    checkMarkSize = GetMenuCheckMarkDimensions ();

    if (lpdis->itemAction == ODA_SELECT ||
        lpdis->itemAction == ODA_DRAWENTIRE)
    {
        CopyRect ((LPRECT)&rc, (LPRECT)&lpdis->rcItem);
        InflateRect ((LPRECT)&rc, (-2 - LOWORD(checkMarkSize)), -2);

        if (lpdis->itemState & ODS_SELECTED)
        {
            /* Item has been selected -- hilite with a gray frame */
            hbr = GetStockObject (GRAY_BRUSH);
            FrameRect (lpdis->hDC, (LPRECT)&rc, hbr);
        }
        else if (lpdis->itemAction == ODA_SELECT)
        {
            /* Item has been de-selected -- remove gray frame */
            hbr = CreateSolidBrush (GetSysColor (COLOR_MENU));
            FrameRect (lpdis->hDC, (LPRECT)&rc, hbr);
            DeleteObject (hbr);
        }
    }

    if (lpdis->itemAction == ODA_DRAWENTIRE)
    {
        /* Paint the color item in the color requested. */
        hbr = CreateSolidBrush ((COLORREF) lpdis->itemData);
        CopyRect ((LPRECT)&rc, (LPRECT)&lpdis->rcItem);
        InflateRect ((LPRECT)&rc, -10-LOWORD(checkMarkSize), -10);
        FillRect (lpdis->hDC, (LPRECT)&rc, hbr);
        DeleteObject (hbr);

        if (lpdis->itemState & ODS_CHECKED)
        {
            /* Draw the check mark if the item is checked. */
            hdcBitmap = CreateCompatibleDC (lpdis->hDC);
            hbmSave = SelectObject (hdcBitmap, hbmCheckOn);

            textColorSave = SetTextColor (lpdis->hDC, 0x00000000L);
            bkColorSave   = SetBkColor (lpdis->hDC, 0x00FFFFFFL);

            /* Use Magic bitblt op so that monochrome bitmaps preserve
               background and foreground colors. */
            BitBlt (lpdis->hDC,
                    lpdis->rcItem.left,
                    lpdis->rcItem.top+
                           (MEASUREITEMHEIGHT - HIWORD (checkMarkSize)) / 2,
                    LOWORD (checkMarkSize),
                    HIWORD (checkMarkSize),
                    hdcBitmap,
                    0,
                    0,
                    ROP_PSDPxax);

            /* Restore colors and bitmap and clean up */
            SetTextColor (lpdis->hDC, textColorSave);
            SetBkColor (lpdis->hDC, bkColorSave);
            SelectObject (hdcBitmap, hbmSave);
            DeleteDC (hdcBitmap);
        }
    }
}

VOID HandlePaint ( HWND hwnd )

Definition at line 336 of file Menu.c.

{
    HDC         hdc = NULL;
    PAINTSTRUCT ps  = {0};
    RECT        rc  = {0};
    TCHAR       text[] = TEXT("Click in the window for a popup menu");

    hdc = BeginPaint (hwnd, (LPPAINTSTRUCT)&ps);

    /* Center the text in the client area */
    GetClientRect (hwnd, &rc);
    DrawText (hdc,
              text,
              (INT)_tcslen (text),
              &rc,
              DT_CENTER | DT_WORDBREAK);
    EndPaint(hwnd, (LPPAINTSTRUCT)&ps);
}

VOID HandlePopupMenu | ( | HWND | hwnd,
 |  | POINT | point
 | ) |  |

Definition at line 525 of file Menu.c.

{
    HMENU hMenu           = NULL;
    HMENU hMenuTrackPopup = NULL;

    /* Get the menu for the popup from the resource file. */
    hMenu = LoadMenu (hInst, TEXT("PopupMenu"));
    if (!hMenu)
    {
        return;
    }

    /* Get the first menu in it which we will use for the call to
     * TrackPopup(). This could also have been created on the fly using
     * CreatePopupMenu and then we could have used InsertMenu() or
     * AppendMenu.
     */
    hMenuTrackPopup = GetSubMenu (hMenu, 0);

    /* Convert the mouse point to screen coordinates since that is what
     * TrackPopup expects.
     */
    ClientToScreen (hwnd, (LPPOINT)&point);

    /* Draw and track the "floating" popup */
    TrackPopupMenu (hMenuTrackPopup, 0, point.x, point.y, 0, hwnd, NULL);

    /* Destroy the menu since were are done with it. */
    DestroyMenu (hMenu);
}

BOOL MenuInit ( HINSTANCE hInstance )

Definition at line 140 of file Menu.c.

{
    WNDCLASS wc = {0};

    wc.lpfnWndProc   = (WNDPROC) MenuWindowProc;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon (hInstance, TEXT("menu"));
    wc.hCursor       = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
    wc.lpszMenuName  = TEXT("MenuMenu");
    wc.lpszClassName = TEXT("menu");

    return RegisterClass (&wc);
}

LRESULT CALLBACK MenuWindowProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 567 of file Menu.c.

{
    HMENU hMenu   = NULL;
    RECT  rc      = {0};
    POINT pt      = {0};
    BOOL  bRetDWP = FALSE;

    switch (message)
    {
        case WM_SYSCOMMAND:
            /* Show the About ... dialog */
            if (wParam == ID_ABOUT)
            {
                DialogBox (hInst,
                           TEXT("AboutBox"),
                           hWnd,
                           AboutDialogProc);
                break;
            }
            else
            {
                bRetDWP = TRUE;
                goto exit_func;
            }

        case WM_COMMAND:
            // LOWORD added for portability
            switch (LOWORD(wParam))
            {
                 case IDM_EXIT:
                   DestroyWindow (hWnd);
                   break;

                 case IDM_ABOUT:
                   /* Bring up the About.. dialog box */
                   DialogBox (hInst,
                              TEXT("AboutBox"),
                              hWnd,
                              AboutDialogProc);
                   break;

                 case IDM_COLOROWNERDR:
                     /* Change colors in color menu depending on state of this
                        menu item. */
                     HandleChangeColors (hWnd);
                     break;

                 case IDM_STATE1: /* fall through */
                 case IDM_STATE2: /* fall through */
                 case IDM_STATE3: /* fall through */
                 case IDM_STATE4:
                      /* Get a handle to the states menu... */
                      hMenu = GetSubMenu (GetMenu (hWnd), IDSTATES_POS);

                      /* Uncheck all the items. */
                      CheckMenuItem (hMenu, IDM_STATE1,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_STATE2,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_STATE3,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_STATE4,
                                     MF_BYCOMMAND | MF_UNCHECKED);

                      /* ...and just check the selected one.*/
                      CheckMenuItem (hMenu, (WORD)wParam,
                                     MF_BYCOMMAND | MF_CHECKED);
                     break;

                 case IDM_BLACK: /* fall through */
                 case IDM_RED:   /* fall through */
                 case IDM_BLUE:  /* fall through */
                 case IDM_GREEN:
                      /* Get a handle to the Colors menu. */
                      hMenu = GetSubMenu (GetMenu (hWnd),IDCOLORS_POS);

                      /* Uncheck all the items. */
                      CheckMenuItem (hMenu, IDM_BLACK,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_RED,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_BLUE,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_GREEN,
                                     MF_BYCOMMAND | MF_UNCHECKED);

                      /* ...and just check the selected one.*/
                      CheckMenuItem (hMenu, (WORD)wParam,
                                     MF_BYCOMMAND | MF_CHECKED);
                      break;

                 case IDM_FONT:
                      /* Messages sent to us from TrackPopupMenu when
                       * items are selected from the "floating" popups
                       */
                      MessageBox (hWnd,
                                  TEXT("A font was selected"),
                                  TEXT("Popup Menu Alert"),
                                  MB_APPLMODAL|MB_OK);
                      break;

                 case IDM_SIZE:
                      MessageBox (hWnd,
                                  TEXT("A size was selected"),
                                  TEXT("Popup Menu Alert"),
                                  MB_APPLMODAL|MB_OK);
                      break;

                 case IDM_STYLE:
                      MessageBox (hWnd,
                                  TEXT("A style was selected"),
                                  TEXT("Popup Menu Alert"),
                                  MB_APPLMODAL|MB_OK);
                      break;
            }
            break;

        case WM_SIZE:
            if (lParam)
            {
                /* If window is being sized to a non zero value...
                 * invalidate it's client area.
                 */
                InvalidateRect (hWnd, NULL, TRUE);
            }
            break;

        case WM_PAINT:
            HandlePaint (hWnd);
            break;

        case WM_MEASUREITEM:
            /* Use the same width for all items. We could examine the item id
               and use different widths/heights for each item. */
            ((LPMEASUREITEMSTRUCT)lParam)->itemWidth  = MEASUREITEMWIDTH;
            ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = MEASUREITEMHEIGHT;
            return TRUE;
            break;

        case WM_DRAWITEM:
            /* Redraw the "colors" menu in normal/ownerdrawmode */
            HandleDrawItem (hWnd,(LPDRAWITEMSTRUCT)lParam);
            return TRUE;
            break;

        case WM_CREATE:
            /* Create the menu */
            HandleCreate (hWnd);
            break;

        case WM_DESTROY:
            /* Delete the on/off bitmaps so that they don't waste memory. */
            DeleteObject (hbmCheckOn);
            DeleteObject (hbmCheckOff);

            PostQuitMessage (0);
            break;

        case WM_LBUTTONDOWN:
            /* Draw the "floating" popup in the app's client area */
            GetClientRect (hWnd, (LPRECT)&rc);

            // Temporary porting macro
            LONG2POINT(lParam, pt);
            if (PtInRect ((LPRECT)&rc, pt))
            {
                HandlePopupMenu (hWnd, pt);
            }
            break;

        default:
            bRetDWP = TRUE;
            goto exit_func;
            break;
    }

exit_func:
    if (bRetDWP)
    {
        return DefWindowProc (hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

HBITMAP ShrinkBitmap | ( | HWND | hwnd,
 |  | HBITMAP | hbm
 | ) |  |

Definition at line 224 of file Menu.c.

{
    HDC     hdc            = NULL;
    HDC     hmemorydcNew   = NULL;
    HDC     hmemorydcOld   = NULL;
    LONG    checkMarkSize  = 0;
    HBITMAP hCheckBitmap   = NULL;
    HBITMAP hOldBitmapSave = NULL;
    HBITMAP hNewBitmapSave = NULL;

    hdc = GetDC (hwnd);

    /* Create DCs for the source (old) and target (new) bitmaps */
    hmemorydcNew = CreateCompatibleDC (hdc);
    hmemorydcOld = CreateCompatibleDC (hdc);

    /* Determine the dimensions of the default menu checkmark and
     * create a target bitmap of the same dimensions
     */
    checkMarkSize = GetMenuCheckMarkDimensions ();
    hCheckBitmap  = CreateCompatibleBitmap (hdc,
                                            LOWORD (checkMarkSize),
                                            HIWORD (checkMarkSize));

    /* Select the source bitmap and the target bitmap into their
     * respective DCs.
     */
    hOldBitmapSave = SelectObject (hmemorydcNew, hCheckBitmap);
    hNewBitmapSave = SelectObject (hmemorydcOld, hbm);

    /* Shrink the source bitmap into the target DC */
    StretchBlt (hmemorydcNew,
                0, 0,
                LOWORD(checkMarkSize),
                HIWORD(checkMarkSize),
                hmemorydcOld,
                0, 0,
                64, 64,
                SRCCOPY);

    /* De-select the bitmaps and clean up .. */
    SelectObject (hmemorydcNew, hOldBitmapSave);
    SelectObject (hmemorydcOld, hNewBitmapSave);
    DeleteDC (hmemorydcNew);
    DeleteDC (hmemorydcOld);
    ReleaseDC (hwnd, hdc);

    /* .. and return a handle to the target bitmap */
    return hCheckBitmap;
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 68 of file Menu.c.

{
    HWND hWnd = NULL;
    MSG  msg = {0};   /* message */
    BOOL bRet = FALSE;
    BOOL bSuccess = TRUE;

    if (!MenuInit (hInstance))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    hInst = hInstance;

    /* Create the app. window */
    hWnd = CreateWindow (TEXT("menu"),
                         TEXT("Menu Example"),
                         WS_OVERLAPPEDWINDOW,
                         CW_USEDEFAULT, 0,
                         CW_USEDEFAULT, 0,
                         NULL, NULL, hInstance, NULL);

    if (!hWnd)
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    ShowWindow (hWnd, nCmdShow);
    UpdateWindow (hWnd);

    while (bRet = GetMessage (&msg, NULL, 0, 0) != 0)
    {
        if (bRet == -1)
        {
            bSuccess = FALSE;
            goto exit_func;
        }
        else
        {
            TranslateMessage (&msg);
            DispatchMessage (&msg);
        }
    }

exit_func:
    if (bSuccess)
    {
        return (int) msg.wParam;
    }
    else
    {
        return 0;
    }
}

Variable Documentation

HMENU hBigMenu

Definition at line 56 of file Menu.c.

HBITMAP hbmCheckOff

Definition at line 58 of file Menu.c.

HBITMAP hbmCheckOn

Definition at line 57 of file Menu.c.

HINSTANCE hInst

Definition at line 55 of file Menu.c.

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Menu/Menu.h File Reference

  • WinUI
  • Menu
Defines | Functions

Menu.h File Reference

Go to the source code of this file.

Defines

#define | ID_ABOUT 100
#define | IDCOLORS_POS 1
#define | IDFILE_POS 0
#define | IDHELP_POS 3
#define | IDM_ABOUT 203
#define | IDM_BLACK 501
#define | IDM_BLUE 502
#define | IDM_COLOROWNERDR 500
#define | IDM_EXIT 202
#define | IDM_FONT 600
#define | IDM_GREEN 504
#define | IDM_RED 503
#define | IDM_SIZE 601
#define | IDM_STATE1 610
#define | IDM_STATE2 611
#define | IDM_STATE3 612
#define | IDM_STATE4 613
#define | IDM_STYLE 602
#define | IDSTATES_POS 2
#define | LONG2POINT(l, pt) ((pt).x = (INT)LOWORD(l), (pt).y = (INT)HIWORD(l))
#define | MEASUREITEMHEIGHT 40
#define | MEASUREITEMWIDTH 40
#define | ROP_PSDPxax 0x00B8074AL

Functions

INT_PTR APIENTRY | AboutDialogProc (HWND, UINT, WPARAM, LPARAM)
BOOL | MenuInit (HINSTANCE)
LRESULT CALLBACK | MenuWindowProc (HWND, UINT, WPARAM, LPARAM)

Define Documentation

#define ID_ABOUT 100

Definition at line 29 of file Menu.h.

#define IDCOLORS_POS 1

Definition at line 21 of file Menu.h.

#define IDFILE_POS 0

Definition at line 20 of file Menu.h.

#define IDHELP_POS 3

Definition at line 23 of file Menu.h.

#define IDM_ABOUT 203

Definition at line 33 of file Menu.h.

#define IDM_BLACK 501

Definition at line 37 of file Menu.h.

#define IDM_BLUE 502

Definition at line 38 of file Menu.h.

#define IDM_COLOROWNERDR 500

Definition at line 36 of file Menu.h.

#define IDM_EXIT 202

Definition at line 32 of file Menu.h.

#define IDM_FONT 600

Definition at line 43 of file Menu.h.

#define IDM_GREEN 504

Definition at line 40 of file Menu.h.

#define IDM_RED 503

Definition at line 39 of file Menu.h.

#define IDM_SIZE 601

Definition at line 44 of file Menu.h.

#define IDM_STATE1 610

Definition at line 48 of file Menu.h.

#define IDM_STATE2 611

Definition at line 49 of file Menu.h.

#define IDM_STATE3 612

Definition at line 50 of file Menu.h.

#define IDM_STATE4 613

Definition at line 51 of file Menu.h.

#define IDM_STYLE 602

Definition at line 45 of file Menu.h.

#define IDSTATES_POS 2

Definition at line 22 of file Menu.h.

#define LONG2POINT | ( | l,
 |  | pt |
 | ) |  | ((pt).x = (INT)LOWORD(l), (pt).y = (INT)HIWORD(l))

Definition at line 16 of file Menu.h.

#define MEASUREITEMHEIGHT 40

Definition at line 26 of file Menu.h.

#define MEASUREITEMWIDTH 40

Definition at line 25 of file Menu.h.

#define ROP_PSDPxax 0x00B8074AL

Definition at line 54 of file Menu.h.

Function Documentation

INT_PTR APIENTRY AboutDialogProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 164 of file Menu.c.

{
    BOOL ret = FALSE;

    switch (msg)
    {
        case WM_INITDIALOG:
            ret = TRUE;
            break;

        case WM_COMMAND:
            // LOWORD added for portability
            if (LOWORD(wParam) == IDOK)
            {
                EndDialog (hDlg, 0);
                ret = TRUE;
            }
            else
            {
                ret = FALSE;
            }
            break;

        case WM_SYSCOMMAND:
            if (wParam == SC_CLOSE)
            {
                EndDialog (hDlg, 0);
                ret = TRUE;
            }
            else
            {
                ret = FALSE;
            }
            break;

        default:
            ret = FALSE;
            break;
    }

    return (INT_PTR) ret;
}

BOOL MenuInit ( HINSTANCE )

Definition at line 140 of file Menu.c.

{
    WNDCLASS wc = {0};

    wc.lpfnWndProc   = (WNDPROC) MenuWindowProc;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon (hInstance, TEXT("menu"));
    wc.hCursor       = LoadCursor (NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
    wc.lpszMenuName  = TEXT("MenuMenu");
    wc.lpszClassName = TEXT("menu");

    return RegisterClass (&wc);
}

LRESULT CALLBACK MenuWindowProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 567 of file Menu.c.

{
    HMENU hMenu   = NULL;
    RECT  rc      = {0};
    POINT pt      = {0};
    BOOL  bRetDWP = FALSE;

    switch (message)
    {
        case WM_SYSCOMMAND:
            /* Show the About ... dialog */
            if (wParam == ID_ABOUT)
            {
                DialogBox (hInst,
                           TEXT("AboutBox"),
                           hWnd,
                           AboutDialogProc);
                break;
            }
            else
            {
                bRetDWP = TRUE;
                goto exit_func;
            }

        case WM_COMMAND:
            // LOWORD added for portability
            switch (LOWORD(wParam))
            {
                 case IDM_EXIT:
                   DestroyWindow (hWnd);
                   break;

                 case IDM_ABOUT:
                   /* Bring up the About.. dialog box */
                   DialogBox (hInst,
                              TEXT("AboutBox"),
                              hWnd,
                              AboutDialogProc);
                   break;

                 case IDM_COLOROWNERDR:
                     /* Change colors in color menu depending on state of this
                        menu item. */
                     HandleChangeColors (hWnd);
                     break;

                 case IDM_STATE1: /* fall through */
                 case IDM_STATE2: /* fall through */
                 case IDM_STATE3: /* fall through */
                 case IDM_STATE4:
                      /* Get a handle to the states menu... */
                      hMenu = GetSubMenu (GetMenu (hWnd), IDSTATES_POS);

                      /* Uncheck all the items. */
                      CheckMenuItem (hMenu, IDM_STATE1,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_STATE2,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_STATE3,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_STATE4,
                                     MF_BYCOMMAND | MF_UNCHECKED);

                      /* ...and just check the selected one.*/
                      CheckMenuItem (hMenu, (WORD)wParam,
                                     MF_BYCOMMAND | MF_CHECKED);
                     break;

                 case IDM_BLACK: /* fall through */
                 case IDM_RED:   /* fall through */
                 case IDM_BLUE:  /* fall through */
                 case IDM_GREEN:
                      /* Get a handle to the Colors menu. */
                      hMenu = GetSubMenu (GetMenu (hWnd),IDCOLORS_POS);

                      /* Uncheck all the items. */
                      CheckMenuItem (hMenu, IDM_BLACK,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_RED,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_BLUE,
                                     MF_BYCOMMAND | MF_UNCHECKED);
                      CheckMenuItem (hMenu, IDM_GREEN,
                                     MF_BYCOMMAND | MF_UNCHECKED);

                      /* ...and just check the selected one.*/
                      CheckMenuItem (hMenu, (WORD)wParam,
                                     MF_BYCOMMAND | MF_CHECKED);
                      break;

                 case IDM_FONT:
                      /* Messages sent to us from TrackPopupMenu when
                       * items are selected from the "floating" popups
                       */
                      MessageBox (hWnd,
                                  TEXT("A font was selected"),
                                  TEXT("Popup Menu Alert"),
                                  MB_APPLMODAL|MB_OK);
                      break;

                 case IDM_SIZE:
                      MessageBox (hWnd,
                                  TEXT("A size was selected"),
                                  TEXT("Popup Menu Alert"),
                                  MB_APPLMODAL|MB_OK);
                      break;

                 case IDM_STYLE:
                      MessageBox (hWnd,
                                  TEXT("A style was selected"),
                                  TEXT("Popup Menu Alert"),
                                  MB_APPLMODAL|MB_OK);
                      break;
            }
            break;

        case WM_SIZE:
            if (lParam)
            {
                /* If window is being sized to a non zero value...
                 * invalidate it's client area.
                 */
                InvalidateRect (hWnd, NULL, TRUE);
            }
            break;

        case WM_PAINT:
            HandlePaint (hWnd);
            break;

        case WM_MEASUREITEM:
            /* Use the same width for all items. We could examine the item id
               and use different widths/heights for each item. */
            ((LPMEASUREITEMSTRUCT)lParam)->itemWidth  = MEASUREITEMWIDTH;
            ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = MEASUREITEMHEIGHT;
            return TRUE;
            break;

        case WM_DRAWITEM:
            /* Redraw the "colors" menu in normal/ownerdrawmode */
            HandleDrawItem (hWnd,(LPDRAWITEMSTRUCT)lParam);
            return TRUE;
            break;

        case WM_CREATE:
            /* Create the menu */
            HandleCreate (hWnd);
            break;

        case WM_DESTROY:
            /* Delete the on/off bitmaps so that they don't waste memory. */
            DeleteObject (hbmCheckOn);
            DeleteObject (hbmCheckOff);

            PostQuitMessage (0);
            break;

        case WM_LBUTTONDOWN:
            /* Draw the "floating" popup in the app's client area */
            GetClientRect (hWnd, (LPRECT)&rc);

            // Temporary porting macro
            LONG2POINT(lParam, pt);
            if (PtInRect ((LPRECT)&rc, pt))
            {
                HandlePopupMenu (hWnd, pt);
            }
            break;

        default:
            bRetDWP = TRUE;
            goto exit_func;
            break;
    }

exit_func:
    if (bRetDWP)
    {
        return DefWindowProc (hWnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/obscure/Obscure.c File Reference

  • WinUI
  • obscure
Defines | Functions | Variables

Obscure.c File Reference

#include <windows.h>

Go to the source code of this file.

Defines

#define | OBS_COMPLETELYCOVERED 0
#define | OBS_COMPLETELYVISIBLE 2
#define | OBS_PARTIALLYVISIBLE 1
#define | STRICT

Functions

int | GetClientObscuredness (HWND hwnd)
void | Obscure_EnsureTimerRunning (HWND hwnd)
void | Obscure_EnsureTimerStopped (HWND hwnd)
void | Obscure_OnPaint (HWND hwnd)
void CALLBACK | Obscure_TimerProc (HWND hwnd, UINT uiMsg, UINT_PTR idTimer, DWORD tm)
LRESULT CALLBACK | Obscure_WndProc (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
int WINAPI | WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)

Variables

BOOL | g_fTimerActive = FALSE

Define Documentation

#define OBS_COMPLETELYCOVERED 0

Definition at line 68 of file Obscure.c.

#define OBS_COMPLETELYVISIBLE 2

Definition at line 70 of file Obscure.c.

#define OBS_PARTIALLYVISIBLE 1

Definition at line 69 of file Obscure.c.

#define STRICT

Definition at line 35 of file Obscure.c.

Function Documentation

int GetClientObscuredness ( HWND hwnd )

Definition at line 73 of file Obscure.c.

{
    HDC hdc;
    RECT rc, rcClient;
    int iType;

    hdc = GetDC(hwnd);
    iType = GetClipBox(hdc, &rc);

    ReleaseDC(hwnd, hdc);

    if (iType == NULLREGION)
        return OBS_COMPLETELYCOVERED;
    if (iType == COMPLEXREGION)
        return OBS_PARTIALLYVISIBLE;

    GetClientRect(hwnd, &rcClient);
    if (EqualRect(&rc, &rcClient))
        return OBS_COMPLETELYVISIBLE;

    return OBS_PARTIALLYVISIBLE;
}

void Obscure_EnsureTimerRunning ( HWND hwnd )

Definition at line 155 of file Obscure.c.

{
    if (!g_fTimerActive) {
        SetTimer(hwnd, 1, 100, Obscure_TimerProc);
        g_fTimerActive = TRUE;
    }
}

void Obscure_EnsureTimerStopped ( HWND hwnd )

Definition at line 105 of file Obscure.c.

{
    if (g_fTimerActive) {
        KillTimer(hwnd, 1);
        g_fTimerActive = FALSE;
        InvalidateRect(hwnd, NULL, FALSE);
        SetWindowText(hwnd, "Covered (Paused)");
    }
}

void Obscure_OnPaint ( HWND hwnd )

Definition at line 172 of file Obscure.c.

{
    PAINTSTRUCT ps;
    HDC hdc;

    hdc = BeginPaint(hwnd, &ps);
    if (hdc) {
        char sz[64];
        RECT rc;
        HFONT hfOld;
        COLORREF crTextOld, crBkOld;
        int cch;

        if (IsRectEmpty(&ps.rcPaint)) {
            /*
             *  Nothing to do.  Don't wake up either.
             */
        } else {
            hfOld = SelectObject(hdc, GetStockObject(ANSI_FIXED_FONT));
            crTextOld = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
            crBkOld = SetBkColor(hdc, GetSysColor(COLOR_WINDOW));

            GetClientRect(hwnd, &rc);
            cch = wsprintf(sz, "%u", GetTickCount());
            ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rc, sz, cch, NULL);

            SetBkColor(hdc, crBkOld);
            SetTextColor(hdc, crTextOld);
            SelectObject(hdc, hfOld);

            Obscure_EnsureTimerRunning(hwnd);
        }

        EndPaint(hwnd, &ps);
    }
}

void CALLBACK Obscure_TimerProc | ( | HWND | hwnd,
 |  | UINT | uiMsg,
 |  | UINT_PTR | idTimer,
 |  | DWORD | tm
 | ) |  |

Definition at line 127 of file Obscure.c.

{
    /*
     *  If the client area is totally obscured, then stop the timer
     *  so we don't waste any more CPU.
     */
    int iState = GetClientObscuredness(hwnd);
    if (iState == OBS_COMPLETELYCOVERED) {
        Obscure_EnsureTimerStopped(hwnd);
    } else {
        InvalidateRect(hwnd, NULL, FALSE);
        if (iState == OBS_PARTIALLYVISIBLE) {
            SetWindowText(hwnd, "Partially Visible");
        } else if (iState == OBS_COMPLETELYVISIBLE) {
            SetWindowText(hwnd, "Completely Visible");
        }
    }
}

LRESULT CALLBACK Obscure_WndProc | ( | HWND | hwnd,
 |  | UINT | uiMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 218 of file Obscure.c.

{
    switch (uiMsg) {

    case WM_CREATE:
        Obscure_EnsureTimerRunning(hwnd);
        break;

    case WM_PAINT:
        Obscure_OnPaint(hwnd);
        break;

    /*
     *  The app exits when this window is destroyed.
     */
    case WM_DESTROY:
        Obscure_EnsureTimerStopped(hwnd);
        PostQuitMessage(0);
        break;
    }

    return DefWindowProc(hwnd, uiMsg, wParam, lParam);
}

int WINAPI WinMain | ( | HINSTANCE | hinst,
 |  | HINSTANCE | hinstPrev,
 |  | LPSTR | pszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 251 of file Obscure.c.

{
    WNDCLASS wc;
    MSG msg;
    HWND hwnd;

    wc.style = 0;
    wc.lpfnWndProc = Obscure_WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hinst;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName = NULL;
    wc.lpszClassName = "Obscure";

    RegisterClass(&wc);

    hwnd = CreateWindow(
        "Obscure",                      /* Class Name */
        "Obscure",                      /* Title */
        WS_OVERLAPPEDWINDOW,            /* Style */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
        NULL,                           /* Parent */
        NULL,                           /* Use class menu */
        hinst,                          /* Instance */
        0);                             /* No special parameters */

    ShowWindow(hwnd, nCmdShow);

    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return 0;
}

Variable Documentation

BOOL g_fTimerActive = FALSE

Definition at line 58 of file Obscure.c.

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/DynDlg/DynDlg.c File Reference

  • WinUI
  • Resource
  • DynDlg
Defines | Functions | Variables

DynDlg.c File Reference

#include <windows.h>
#include "dyndlg.h"

Go to the source code of this file.

Defines

#define | SS_INMOTION 0x0002

Functions

LRESULT CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
DWORD | Create1 (HWND)
DWORD | Create2 (HWND)
WORD * | lpwAlign (WORD *)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
int | nCopyAnsiToWideChar (WORD *, PTSTR)
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

HINSTANCE | ghInst

Define Documentation

#define SS_INMOTION 0x0002

Function Documentation

LRESULT CALLBACK About | ( | HWND | hwnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 215 of file DynDlg.c.

{
    BOOL bRet = FALSE;

    if (message == WM_INITDIALOG)
    {
        bRet = TRUE;
    }

    if ((message == WM_COMMAND) && (LOWORD(wParam) == IDOK))
    {
        EndDialog (hwnd, TRUE);
        bRet = TRUE;
    }

    if ((message == WM_SYSCOMMAND) && (wParam == SC_CLOSE))
    {
        EndDialog (hwnd, TRUE);
        bRet = TRUE;
    }

    return (LRESULT)bRet;
}

DWORD Create1 ( HWND hwnd )

Definition at line 264 of file DynDlg.c.

{
    WORD*   p = NULL;
    WORD*   pdlgtemplate = NULL;
    int     nchar;
    DWORD   lStyle;
    INT_PTR pSize = 1000;
    DWORD   error = ERROR_SUCCESS;

    /* allocate some memory to play with  */
    p = (PWORD) LocalAlloc (LPTR, pSize);
    if (NULL == p)
    {
        error = GetLastError ();
        goto exit_func;
    }

    pdlgtemplate = p;

    /* start to fill in the dlgtemplate information.  addressing by WORDs */
    lStyle = DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_VISIBLE;

    *p++ = LOWORD (lStyle);
    *p++ = HIWORD (lStyle);
    *p++ = 0;          // LOWORD (lExtendedStyle)
    *p++ = 0;          // HIWORD (lExtendedStyle)
    *p++ = 1;          // NumberOfItems
    *p++ = 10;         // x
    *p++ = 10;         // y
    *p++ = 100;        // cx
    *p++ = 100;        // cy
    *p++ = 0;          // Menu
    *p++ = 0;          // Class

    pSize -= (p - pdlgtemplate);
    pSize /= 2;

    /* copy the title of the dialog */
    if (PRIMARYLANGID(GetUserDefaultLangID ()) == LANG_JAPANESE)
    {
        nchar = nCopyAnsiToWideChar (p, TEXT("ƒ^ƒCƒgƒ‹ 1"));
    }
    else
    {
        nchar = nCopyAnsiToWideChar (p, TEXT("Title 1"));
    }
    p += nchar;

    /* add in the wPointSize and szFontName here iff the DS_SETFONT bit on */
    /* make sure the first item starts on a DWORD boundary */
    p = lpwAlign (p);

    /* now start with the first item */
    lStyle = BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD;

    *p++ = LOWORD (lStyle);
    *p++ = HIWORD (lStyle);
    *p++ = 0;          // LOWORD (lExtendedStyle)
    *p++ = 0;          // HIWORD (lExtendedStyle)
    *p++ = 10;         // x
    *p++ = 70;         // y
    *p++ = 80;         // cx
    *p++ = 20;         // cy
    *p++ = IDOK;       // ID

    /* fill in class i.d. Button in this case */
    *p++ = (WORD)0xffff;
    *p++ = (WORD)0x0080;

    /* copy the text of the first item */
    nchar = nCopyAnsiToWideChar (p, TEXT("OK"));
    p += nchar;

    *p++ = 0;  // advance pointer over nExtraStuff WORD

    if (NULL == CreateDialogIndirect (ghInst, (LPDLGTEMPLATE) pdlgtemplate, hwnd, (DLGPROC) About))
    {
        error = GetLastError ();
    }

    if (NULL != LocalFree (pdlgtemplate))
    {
        error = GetLastError ();
        DebugBreak ();
    }

exit_func:
    return error;
}

DWORD Create2 ( HWND hwnd )

Definition at line 373 of file DynDlg.c.

{
    WORD* p = NULL;
    WORD* pdlgtemplate = NULL;
    int   nchar;
    DWORD lStyle;
    DWORD error = ERROR_SUCCESS;

    /* allocate some memory to play with  */
    p = (PWORD) LocalAlloc (LPTR, 1000);
    if (NULL == p)
    {
        error = GetLastError ();
        DebugBreak ();
        goto exit_func;
    }
    pdlgtemplate = p;

    /* start to fill in the dlgtemplate information.  addressing by WORDs */
    lStyle = WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_SETFONT;
    *p++ = LOWORD (lStyle);
    *p++ = HIWORD (lStyle);
    *p++ = 0;          // LOWORD (lExtendedStyle)
    *p++ = 0;          // HIWORD (lExtendedStyle)
    *p++ = 2;          // NumberOfItems
    *p++ = 210;        // x
    *p++ = 10;         // y
    *p++ = 100;        // cx
    *p++ = 100;        // cy
    *p++ = 0;          // Menu
    *p++ = 0;          // Class

    /* copy the title of the dialog */
    if (PRIMARYLANGID(GetUserDefaultLangID ()) == LANG_JAPANESE)
    {
        nchar = nCopyAnsiToWideChar (p, TEXT("ƒ^ƒCƒgƒ‹ 2"));
    }
    else
    {
        nchar = nCopyAnsiToWideChar (p, TEXT("Title 2"));
    }
    p += nchar;

    /* Font information because of DS_SETFONT */
    *p++ = 18;     // point size
    nchar = nCopyAnsiToWideChar (p, TEXT("Times New Roman"));  // Face name
    p += nchar;

    /* make sure the first item starts on a DWORD boundary */
    p = lpwAlign (p);

    /* now start with the first item */
    lStyle = BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP;
    *p++ = LOWORD (lStyle);
    *p++ = HIWORD (lStyle);
    *p++ = 0;          // LOWORD (lExtendedStyle)
    *p++ = 0;          // HIWORD (lExtendedStyle)
    *p++ = 10;         // x
    *p++ = 60;         // y
    *p++ = 80;         // cx
    *p++ = 20;         // cy
    *p++ = IDOK;       // ID

    /* fill in class i.d., this time by name */
    nchar = nCopyAnsiToWideChar (p, TEXT("BUTTON"));
    p += nchar;

    /* copy the text of the first item */
    nchar = nCopyAnsiToWideChar (p, TEXT("OK"));
    p += nchar;

    *p++ = 0;  // advance pointer over nExtraStuff WORD

    /* make sure the second item starts on a DWORD boundary */
    p = lpwAlign (p);

#define SS_INMOTION 0x0002  /* from spincube.h */
    lStyle = WS_VISIBLE | WS_CHILD | SS_INMOTION;
    *p++ = LOWORD (lStyle);
    *p++ = HIWORD (lStyle);
    *p++ = 0;          // LOWORD (lExtendedStyle)
    *p++ = 0;          // HIWORD (lExtendedStyle)
    *p++ = 20;         // x
    *p++ = 5;          // y
    *p++ = 65;         // cx
    *p++ = 45;         // cy
    *p++ = 57;         // ID

    /* fill in class i.d., this time by name */

    /***** CUSTOM CONTROL
    * Fill in the class name that is specified in the DLL
    *  See the \q_a\samples\spincube sample for the source to this.
    *****/
    nchar = nCopyAnsiToWideChar (p, TEXT("Spincube"));
    p += nchar;

    /* copy the text of the second item, null terminate the string. */
    nchar = nCopyAnsiToWideChar (p, TEXT(""));
    p += nchar;

    *p++ = 0;  // advance pointer over nExtraStuff WORD

    if (NULL == CreateDialogIndirect (ghInst, (LPDLGTEMPLATE) pdlgtemplate, hwnd, (DLGPROC) About))
    {
        error = GetLastError ();
    }

    if (NULL != LocalFree (pdlgtemplate))
    {
        error = GetLastError ();
        DebugBreak ();
    }

exit_func:
    return error;
}

WORD * lpwAlign ( WORD * pIn )

Definition at line 505 of file DynDlg.c.

{
    DWORD_PTR ul;

    ul = (DWORD_PTR) pIn;
    ul +=3;
    ul >>=2;
    ul <<=2;
    return (WORD*) ul;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hwnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 154 of file DynDlg.c.

{
    BOOL bRetDWP = TRUE;

    switch (message)
    {
        /**********************************************************************\
        *  Menu item support.
        *
        \**********************************************************************/
        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDM_EXIT:
                    PostQuitMessage (0);
                    break;

                case IDM_DIALOG1:
                    Create1 (hwnd);
                    break;

                case IDM_DIALOG2:
                    Create2 (hwnd);
                    break;

                case IDM_HELP:
                    WinHelp (hwnd, TEXT("dyndlg.hlp"), HELP_INDEX, 0L);
                    break;

                case IDM_ABOUT:
                    DialogBox (GetModuleHandle(NULL), TEXT("aboutBox"), hwnd, (DLGPROC)About);
                    bRetDWP = FALSE;
                    break;
            }
            break;  /* end wm_command */

        case WM_DESTROY:
            WinHelp ( hwnd,  TEXT("dyndlg.hlp"), (UINT) HELP_QUIT, 0L );
            PostQuitMessage (0);
            break;
    }

    if (bRetDWP)
    {
        return DefWindowProc (hwnd, message, wParam, lParam);
    }
    else
    {
        return 0;
    }
}

int nCopyAnsiToWideChar | ( | WORD * | pWCStr,
 |  | PTSTR | pAnsiIn
 | ) |  |

Definition at line 525 of file DynDlg.c.

{
#ifdef UNICODE
    return lstrlen(lstrcpy(pWCStr, pAnsiIn)) + 1;
#else
    int cchAnsi = lstrlen(pAnsiIn);
    return MultiByteToWideChar(GetACP(), MB_PRECOMPOSED,
                               pAnsiIn, cchAnsi, pWCStr, cchAnsi) + 1;
#endif
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 33 of file DynDlg.c.

{
    HWND      hwnd     = NULL;
    MSG       msg      = {0};
    HANDLE    hLibrary = NULL;
    WNDCLASS  wc       = {0};
    BOOL      bSuccess = TRUE;
    BOOL      bRet     = FALSE;

    ghInst = hInstance;

    wc.lpfnWndProc   = (WNDPROC)MainWndProc;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(hInstance, TEXT("dyndlgIcon"));
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
    wc.lpszMenuName  = TEXT("dyndlgMenu");
    wc.lpszClassName = TEXT("dyndlg");

    if (0 == RegisterClass(&wc))
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    /* Create the main window.  Return false if CreateWindow() fails */
    hwnd = CreateWindow(
        TEXT("dyndlg"),
        TEXT("DynDlg"),
        WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_VISIBLE,
        CW_USEDEFAULT, 0,
        CW_USEDEFAULT, 0,
        NULL, NULL, hInstance, NULL);

    if (NULL == hwnd)
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    /*
     * Load SPINCUBE.DLL containing the custom control.
     * The above library should be present in the current directory
     *
     * Generally it is better to pass an absolute path to LoadLibrary.
     * Otherwise the API might attempt to load a DLL from the current PATH,
     * which presents a potential security breach. Refer to MSDN
     * for the documentation on the SearchPath function for the search
     * strategy used by the operating system.
     */
    hLibrary = LoadLibrary (TEXT("SPINCUBE.DLL"));

    if (NULL == hLibrary)
    {
        if (PRIMARYLANGID(GetUserDefaultLangID ()) == LANG_JAPANESE)
        {
            MessageBox (hwnd, TEXT("LoadLibrary (SPINCUBE.DLL) ‚ªŽ¸”s‚µ‚Ü‚µ‚½B"),
                        TEXT("ƒGƒ‰[, ‚±‚ÌƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚Í spincube ‚ª•K—v‚Å‚·"),
                        MB_OK | MB_ICONEXCLAMATION);
        }
        else
        {
            MessageBox (hwnd, TEXT("LoadLibrary (SPINCUBE.DLL) failed"),
                        TEXT("Error, this app requires spincube."),
                        MB_OK | MB_ICONEXCLAMATION);
        }
    }

    /* Demo: Just for fun, start out with one of the dialogs created. */
    PostMessage (hwnd, WM_COMMAND, IDM_DIALOG2, 0);

    ShowWindow (hwnd, SW_SHOWNORMAL);
    UpdateWindow (hwnd);

    /* Loop getting messages and dispatching them. */
    while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
    {
        if (bRet == -1)
        {
            bSuccess = FALSE;
            goto exit_func;
        }
        else
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

    if (NULL != hLibrary)
    {
        bSuccess = FreeLibrary (hLibrary);
    }

exit_func:
    if (TRUE == bSuccess)
    {
        return (int)(msg.wParam);
    }
    else
    {
        return 0;
    }
}

Variable Documentation

HINSTANCE ghInst

Name of app.

Definition at line 23 of file DynDlg.c.

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/DynDlg/DynDlg.h File Reference

  • WinUI
  • Resource
  • DynDlg
Defines | Functions

DynDlg.h File Reference

Go to the source code of this file.

Defines

#define | IDM_ABOUT 302
#define | IDM_DIALOG1 201
#define | IDM_DIALOG2 202
#define | IDM_EXIT 101
#define | IDM_HELP 301

Functions

LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)

Define Documentation

#define IDM_ABOUT 302

Definition at line 9 of file DynDlg.h.

#define IDM_DIALOG1 201

Definition at line 6 of file DynDlg.h.

#define IDM_DIALOG2 202

Definition at line 7 of file DynDlg.h.

#define IDM_EXIT 101

Definition at line 5 of file DynDlg.h.

#define IDM_HELP 301

Definition at line 8 of file DynDlg.h.

Function Documentation

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Dib.c File Reference

  • WinUI
  • Resource
  • Iconpro
Functions

Dib.c File Reference

#include <Windows.h>
#include <malloc.h>
#include "Dib.H"

Go to the source code of this file.

Functions

DWORD | BytesPerLine (PBITMAPINFOHEADER pBMIH)
PBYTE | ConvertDIBFormat (PBITMAPINFO pSrcDIB, UINT nWidth, UINT nHeight, UINT nbpp, BOOL bStretch)
BOOL | CopyColorTable (PBITMAPINFO pTarget, PBITMAPINFO pSource)
WORD | DIBNumColors (PSTR pbi)
PSTR | FindDIBBits (PSTR pbi)
WORD | PaletteSize (PSTR pbi)
PBYTE | ReadBMPFile (PCTSTR szFileName)
void | SetMonoDIBPixel (PBYTE pANDBits, DWORD dwWidth, DWORD dwHeight, DWORD x, DWORD y, BOOL bWhite)
BOOL | WriteBMPFile (PCTSTR szFileName, PBYTE pDIB)

Function Documentation

DWORD BytesPerLine ( PBITMAPINFOHEADER pBMIH )

Definition at line 148 of file Dib.c.

{
    return WIDTHBYTES(pBMIH->biWidth * pBMIH->biPlanes * pBMIH->biBitCount);
}

PBYTE ConvertDIBFormat | ( | PBITMAPINFO | pSrcDIB,
 |  | UINT | nWidth,
 |  | UINT | nHeight,
 |  | UINT | nbpp,
 |  | BOOL | bStretch
 | ) |  |

Definition at line 179 of file Dib.c.

{
    PBITMAPINFO    pbmi            = NULL;
    PBYTE          pSourceBits     = NULL;
    PBYTE          pTargetBits     = NULL;
    PBYTE          pResult         = NULL;
    HDC            hDC              = NULL;
    HDC            hSourceDC        = NULL;
    HDC            hTargetDC        = NULL;
    HBITMAP        hSourceBitmap    = NULL;
    HBITMAP        hTargetBitmap    = NULL;
    HBITMAP        hOldTargetBitmap = NULL;
    HBITMAP        hOldSourceBitmap = NULL;
    DWORD          dwSourceBitsSize, dwTargetBitsSize, dwTargetHeaderSize;

    // Allocate and fill out a BITMAPINFO struct for the new DIB
    // Allow enough room for a 256-entry color table, just in case
    dwTargetHeaderSize = sizeof( BITMAPINFO ) + ( 256 * sizeof( RGBQUAD ) );
    pbmi = malloc( dwTargetHeaderSize );
    pbmi->bmiHeader.biSize = sizeof( BITMAPINFOHEADER );
    pbmi->bmiHeader.biWidth = nWidth;
    pbmi->bmiHeader.biHeight = nHeight;
    pbmi->bmiHeader.biPlanes = 1;
    pbmi->bmiHeader.biBitCount = (WORD)nbpp;
    pbmi->bmiHeader.biCompression = BI_RGB;
    pbmi->bmiHeader.biSizeImage = 0;
    pbmi->bmiHeader.biXPelsPerMeter = 0;
    pbmi->bmiHeader.biYPelsPerMeter = 0;
    pbmi->bmiHeader.biClrUsed = 0;
    pbmi->bmiHeader.biClrImportant = 0;
    // Fill in the color table
    if( ! CopyColorTable( pbmi, (PBITMAPINFO)pSrcDIB ) )
    {
        free( pbmi );
        return NULL;
    }

    // Gonna use DIBSections and BitBlt() to do the conversion, so make 'em
    hDC = GetDC( NULL );
    hTargetBitmap = CreateDIBSection( hDC, pbmi, DIB_RGB_COLORS, &pTargetBits, NULL, 0 );
    hSourceBitmap = CreateDIBSection( hDC, pSrcDIB, DIB_RGB_COLORS, &pSourceBits, NULL, 0 );
    hSourceDC = CreateCompatibleDC( hDC );
    hTargetDC = CreateCompatibleDC( hDC );

    // Flip the bits on the source DIBSection to match the source DIB
    dwSourceBitsSize = pSrcDIB->bmiHeader.biHeight * BytesPerLine(&(pSrcDIB->bmiHeader));
    dwTargetBitsSize = pbmi->bmiHeader.biHeight * BytesPerLine(&(pbmi->bmiHeader));
    memcpy( pSourceBits, FindDIBBits((PSTR)pSrcDIB), dwSourceBitsSize );

    // Select DIBSections into DCs
    hOldSourceBitmap = SelectObject( hSourceDC, hSourceBitmap );
    hOldTargetBitmap = SelectObject( hTargetDC, hTargetBitmap );

    // Set the color tables for the DIBSections
    if( pSrcDIB->bmiHeader.biBitCount <= 8 )
    {
        SetDIBColorTable( hSourceDC, 0, 1 << pSrcDIB->bmiHeader.biBitCount, pSrcDIB->bmiColors );
    }

    if( pbmi->bmiHeader.biBitCount <= 8 )
    {
        SetDIBColorTable( hTargetDC, 0, 1 << pbmi->bmiHeader.biBitCount, pbmi->bmiColors );
    }

    // If we are asking for a straight copy, do it
    if( (pSrcDIB->bmiHeader.biWidth==pbmi->bmiHeader.biWidth) && (pSrcDIB->bmiHeader.biHeight==pbmi->bmiHeader.biHeight) )
    {
        BitBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, SRCCOPY );
    }
    else
    {
        // else, should we stretch it?
        if( bStretch )
        {
            SetStretchBltMode( hTargetDC, COLORONCOLOR );
            StretchBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, pSrcDIB->bmiHeader.biWidth, pSrcDIB->bmiHeader.biHeight, SRCCOPY );
        }
        else
        {
            // or just take the upper left corner of the source
            BitBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, SRCCOPY );
        }
    }

    // Clean up and delete the DCs
    SelectObject( hSourceDC, hOldSourceBitmap );
    SelectObject( hSourceDC, hOldTargetBitmap );
    DeleteDC( hSourceDC );
    DeleteDC( hTargetDC );
    ReleaseDC( NULL, hDC );

    // Flush the GDI batch, so we can play with the bits
    GdiFlush();

    // Allocate enough memory for the new CF_DIB, and copy bits
    pResult = malloc( dwTargetHeaderSize + dwTargetBitsSize );
    memcpy( pResult, pbmi, dwTargetHeaderSize );
    memcpy( FindDIBBits( pResult ), pTargetBits, dwTargetBitsSize );

    // final cleanup
    DeleteObject( hTargetBitmap );
    DeleteObject( hSourceBitmap );
    free( pbmi );

    return pResult;
}

BOOL CopyColorTable | ( | PBITMAPINFO | pTarget,
 |  | PBITMAPINFO | pSource
 | ) |  |

Definition at line 309 of file Dib.c.

{
    // What we do depends on the target's color depth
    switch( pTarget->bmiHeader.biBitCount )
    {
        // 8bpp - need 256 entry color table
        case 8:
            if( pSource->bmiHeader.biBitCount == 8 )
            { // Source is 8bpp too, copy color table
                memcpy( pTarget->bmiColors, pSource->bmiColors, 256*sizeof(RGBQUAD) );
                return TRUE;
            }
            else
            { // Source is != 8bpp, use halftone palette
                HPALETTE        hPal;
                HDC             hDC = GetDC( NULL );
                PALETTEENTRY    pe[256];
                UINT            i;

                hPal = CreateHalftonePalette( hDC );
                ReleaseDC( NULL, hDC );
                GetPaletteEntries( hPal, 0, 256, pe );
                DeleteObject( hPal );
                for(i=0;i<256;i++)
                {
                    pTarget->bmiColors[i].rgbRed = pe[i].peRed;
                    pTarget->bmiColors[i].rgbGreen = pe[i].peGreen;
                    pTarget->bmiColors[i].rgbBlue = pe[i].peBlue;
                    pTarget->bmiColors[i].rgbReserved = pe[i].peFlags;
                }
                return TRUE;
            }
            break; // end 8bpp

        // 4bpp - need 16 entry color table
        case 4:
            if( pSource->bmiHeader.biBitCount == 4 )
            { // Source is 4bpp too, copy color table
                memcpy( pTarget->bmiColors, pSource->bmiColors, 16*sizeof(RGBQUAD) );
                return TRUE;
            }
            else
            { // Source is != 4bpp, use system palette
                HPALETTE        hPal;
                PALETTEENTRY    pe[256];
                UINT            i;

                hPal = GetStockObject( DEFAULT_PALETTE );
                GetPaletteEntries( hPal, 0, 16, pe );
                for(i=0;i<16;i++)
                {
                    pTarget->bmiColors[i].rgbRed = pe[i].peRed;
                    pTarget->bmiColors[i].rgbGreen = pe[i].peGreen;
                    pTarget->bmiColors[i].rgbBlue = pe[i].peBlue;
                    pTarget->bmiColors[i].rgbReserved = pe[i].peFlags;
                }
                return TRUE;
            }
            break; // end 4bpp

        // 1bpp - need 2 entry mono color table
        case 1:
            pTarget->bmiColors[0].rgbRed = 0;
            pTarget->bmiColors[0].rgbGreen = 0;
            pTarget->bmiColors[0].rgbBlue = 0;
            pTarget->bmiColors[0].rgbReserved = 0;
            pTarget->bmiColors[1].rgbRed = 255;
            pTarget->bmiColors[1].rgbGreen = 255;
            pTarget->bmiColors[1].rgbBlue = 255;
            pTarget->bmiColors[1].rgbReserved = 0;
            break; // end 1bpp

        // no color table for the > 8bpp modes
        case 32:    /* fall-through */
        case 24:    /* fall-through */
        case 16:    /* fall-through */
        default:
            return TRUE;
            break;
    }
    return TRUE;
}

WORD DIBNumColors ( PSTR pbi )

Definition at line 81 of file Dib.c.

{
    WORD wBitCount;
    DWORD dwClrUsed;

    dwClrUsed = ((PBITMAPINFOHEADER) pbi)->biClrUsed;

    if (dwClrUsed)
    {
        return (WORD) dwClrUsed;
    }

    wBitCount = ((PBITMAPINFOHEADER) pbi)->biBitCount;

    switch (wBitCount)
    {
        case 1: return 2;
        case 4: return 16;
        case 8: return 256;
        default:return 0;
    }
    return 0;
}

PSTR FindDIBBits ( PSTR pbi )

Definition at line 58 of file Dib.c.

{
   return ( pbi + *(PDWORD)pbi + PaletteSize( pbi ) );
}

WORD PaletteSize ( PSTR pbi )

Definition at line 124 of file Dib.c.

{
    return (WORD)( DIBNumColors( pbi ) * sizeof( RGBQUAD ) );
}

PBYTE ReadBMPFile ( PCTSTR szFileName )

Definition at line 463 of file Dib.c.

{
    HANDLE              hFile        = NULL;
    BITMAPFILEHEADER    bfh          = {0};
    DWORD               dwBytes      = 0;
    PBYTE               pDIB        = NULL;
    PBYTE               pTemp       = NULL;
    WORD                wPaletteSize = 0;
    DWORD               dwBitsSize   = 0;

    // Open the file
    if( (hFile=CreateFile( szFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE )
    {
        MessageBox( NULL, TEXT("Error opening file"), szFileName, MB_OK );
        return NULL;
    }
    // Read the header
    if( ( ! ReadFile( hFile, &bfh, sizeof(BITMAPFILEHEADER), &dwBytes, NULL ) ) || ( dwBytes != sizeof( BITMAPFILEHEADER ) ) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
        return NULL;
    }
    // Does it look like a BMP file?
    if( ( bfh.bfType != 0x4d42 ) || (bfh.bfReserved1!=0) || (bfh.bfReserved2!=0) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Not a recognised BMP format file"), szFileName, MB_OK );
        return NULL;
    }
    // Allocate some memory
    if( (pDIB = malloc( sizeof( BITMAPINFO ) )) == NULL )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Failed to allocate memory for DIB"), szFileName, MB_OK );
        return NULL;
    }
    // Read in the BITMAPINFOHEADER
    if( (!ReadFile( hFile, pDIB, sizeof(BITMAPINFOHEADER), &dwBytes, NULL )) || (dwBytes!=sizeof(BITMAPINFOHEADER)) )
    {
        CloseHandle( hFile );
        free( pDIB );
        MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
        return NULL;
    }
    if( ((PBITMAPINFOHEADER)pDIB)->biSize != sizeof( BITMAPINFOHEADER ) )
    {
        CloseHandle( hFile );
        free( pDIB );
        MessageBox( NULL, TEXT("OS/2 style BMPs Not Supported"), szFileName, MB_OK );
        return NULL;
    }
    // How big are the elements?
    wPaletteSize = PaletteSize((PSTR)pDIB);
    dwBitsSize = ((PBITMAPINFOHEADER)pDIB)->biHeight * BytesPerLine((PBITMAPINFOHEADER)pDIB);
    // realloc to account for the total size of the DIB
    if( (pTemp = realloc( pDIB, sizeof( BITMAPINFOHEADER ) + wPaletteSize + dwBitsSize )) == NULL )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Failed to allocate memory for DIB"), szFileName, MB_OK );
        free( pDIB );
        return NULL;
    }
    pDIB = pTemp;
    // If there is a color table, read it
    if( wPaletteSize != 0 )
    {
        if( (!ReadFile( hFile, ((PBITMAPINFO)pDIB)->bmiColors, wPaletteSize, &dwBytes, NULL )) || (dwBytes!=wPaletteSize) )
        {
            CloseHandle( hFile );
            free( pDIB );
            MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
            return NULL;
        }
    }
    // Seek to the bits
    // checking against 0 in case some bogus app didn't set this element
    if( bfh.bfOffBits != 0 )
    {
        if( SetFilePointer( hFile, bfh.bfOffBits, NULL, FILE_BEGIN ) == INVALID_SET_FILE_POINTER )
        {
            CloseHandle( hFile );
            free( pDIB );
            MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
            return NULL;
        }
    }
    // Read the image bits
    if( (!ReadFile( hFile, FindDIBBits(pDIB), dwBitsSize, &dwBytes, NULL )) || (dwBytes!=dwBitsSize) )
    {
        CloseHandle( hFile );
        free( pDIB );
        MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
        return NULL;
    }
    // clean up
    CloseHandle( hFile );
    return pDIB;
}

void SetMonoDIBPixel | ( | PBYTE | pANDBits,
 |  | DWORD | dwWidth,
 |  | DWORD | dwHeight,
 |  | DWORD | x,
 |  | DWORD | y,
 |  | BOOL | bWhite
 | ) |  |

Definition at line 416 of file Dib.c.

{
    DWORD ByteIndex;
    BYTE    BitNumber;

    // Find the byte on which this scanline begins
    ByteIndex = (dwHeight - y - 1) * WIDTHBYTES(dwWidth);
    // Find the byte containing this pixel
    ByteIndex += (x >> 3);
    // Which bit is it?
    BitNumber = (BYTE)( 7 - (x % 8) );

    if( bWhite )
    {
        // Turn it on
        pANDBits[ByteIndex] |= (1<<BitNumber);
    }
    else
    {
        // Turn it off
        pANDBits[ByteIndex] &= ~(1<<BitNumber);
    }
}

BOOL WriteBMPFile | ( | PCTSTR | szFileName,
 |  | PBYTE | pDIB
 | ) |  |

Definition at line 581 of file Dib.c.

{
    HANDLE              hFile           = NULL;
    BITMAPFILEHEADER    bfh             = {0};
    DWORD             dwBytes;
    DWORD               dwBytesToWrite;
    PBITMAPINFOHEADER pbmih           = NULL;

    // Open the file
    if( (hFile=CreateFile( szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE )
    {
        MessageBox( NULL, TEXT("Error opening file"), szFileName, MB_OK );
        return FALSE;
    }
    bfh.bfType = 0x4d42;
    bfh.bfReserved1 = 0;
    bfh.bfReserved2 = 0;
    bfh.bfOffBits = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) + PaletteSize( pDIB );
    bfh.bfSize = (bfh.bfOffBits + ((PBITMAPINFOHEADER)pDIB)->biHeight * BytesPerLine((PBITMAPINFOHEADER)pDIB))/4;
    // Write the header
    if( ( ! WriteFile( hFile, &bfh, sizeof(BITMAPFILEHEADER), &dwBytes, NULL ) ) || ( dwBytes != sizeof( BITMAPFILEHEADER ) ) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Error Writing file"), szFileName, MB_OK );
        return FALSE;
    }
    pbmih = (PBITMAPINFOHEADER)pDIB;
    pbmih->biHeight /= 2;
    dwBytesToWrite = bfh.bfOffBits + (pbmih->biHeight * BytesPerLine(pbmih));
    if( ( ! WriteFile( hFile, pDIB, dwBytesToWrite, &dwBytes, NULL ) ) || ( dwBytes != dwBytesToWrite ) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Error Writing file"), szFileName, MB_OK );
        return FALSE;
    }
    pbmih->biHeight *= 2;
    CloseHandle( hFile );
    return TRUE;
}

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Dib.h File Reference

  • WinUI
  • Resource
  • Iconpro
Defines | Functions

Dib.h File Reference

Go to the source code of this file.

Defines

#define | WIDTHBYTES(bits) ((((bits) + 31)>>5)<<2)

Functions

DWORD | BytesPerLine (PBITMAPINFOHEADER pBMIH)
PBYTE | ConvertDIBFormat (PBITMAPINFO pSrcDIB, UINT nWidth, UINT nHeight, UINT nColors, BOOL bStretch)
WORD | DIBNumColors (PSTR pbi)
PSTR | FindDIBBits (PSTR pbi)
WORD | PaletteSize (PSTR pbi)
PBYTE | ReadBMPFile (PCTSTR szFileName)
VOID | SetMonoDIBPixel (PBYTE pANDBits, DWORD dwWidth, DWORD dwHeight, DWORD x, DWORD y, BOOL bWhite)
BOOL | WriteBMPFile (PCTSTR szFileName, PBYTE lpDIB)

Define Documentation

#define WIDTHBYTES ( bits ) ((((bits) + 31)>>5)<<2)

Definition at line 24 of file Dib.h.

Function Documentation

DWORD BytesPerLine ( PBITMAPINFOHEADER pBMIH )

Definition at line 148 of file Dib.c.

{
    return WIDTHBYTES(pBMIH->biWidth * pBMIH->biPlanes * pBMIH->biBitCount);
}

PBYTE ConvertDIBFormat | ( | PBITMAPINFO | pSrcDIB,
 |  | UINT | nWidth,
 |  | UINT | nHeight,
 |  | UINT | nColors,
 |  | BOOL | bStretch
 | ) |  |

Definition at line 179 of file Dib.c.

{
    PBITMAPINFO    pbmi            = NULL;
    PBYTE          pSourceBits     = NULL;
    PBYTE          pTargetBits     = NULL;
    PBYTE          pResult         = NULL;
    HDC            hDC              = NULL;
    HDC            hSourceDC        = NULL;
    HDC            hTargetDC        = NULL;
    HBITMAP        hSourceBitmap    = NULL;
    HBITMAP        hTargetBitmap    = NULL;
    HBITMAP        hOldTargetBitmap = NULL;
    HBITMAP        hOldSourceBitmap = NULL;
    DWORD          dwSourceBitsSize, dwTargetBitsSize, dwTargetHeaderSize;

    // Allocate and fill out a BITMAPINFO struct for the new DIB
    // Allow enough room for a 256-entry color table, just in case
    dwTargetHeaderSize = sizeof( BITMAPINFO ) + ( 256 * sizeof( RGBQUAD ) );
    pbmi = malloc( dwTargetHeaderSize );
    pbmi->bmiHeader.biSize = sizeof( BITMAPINFOHEADER );
    pbmi->bmiHeader.biWidth = nWidth;
    pbmi->bmiHeader.biHeight = nHeight;
    pbmi->bmiHeader.biPlanes = 1;
    pbmi->bmiHeader.biBitCount = (WORD)nbpp;
    pbmi->bmiHeader.biCompression = BI_RGB;
    pbmi->bmiHeader.biSizeImage = 0;
    pbmi->bmiHeader.biXPelsPerMeter = 0;
    pbmi->bmiHeader.biYPelsPerMeter = 0;
    pbmi->bmiHeader.biClrUsed = 0;
    pbmi->bmiHeader.biClrImportant = 0;
    // Fill in the color table
    if( ! CopyColorTable( pbmi, (PBITMAPINFO)pSrcDIB ) )
    {
        free( pbmi );
        return NULL;
    }

    // Gonna use DIBSections and BitBlt() to do the conversion, so make 'em
    hDC = GetDC( NULL );
    hTargetBitmap = CreateDIBSection( hDC, pbmi, DIB_RGB_COLORS, &pTargetBits, NULL, 0 );
    hSourceBitmap = CreateDIBSection( hDC, pSrcDIB, DIB_RGB_COLORS, &pSourceBits, NULL, 0 );
    hSourceDC = CreateCompatibleDC( hDC );
    hTargetDC = CreateCompatibleDC( hDC );

    // Flip the bits on the source DIBSection to match the source DIB
    dwSourceBitsSize = pSrcDIB->bmiHeader.biHeight * BytesPerLine(&(pSrcDIB->bmiHeader));
    dwTargetBitsSize = pbmi->bmiHeader.biHeight * BytesPerLine(&(pbmi->bmiHeader));
    memcpy( pSourceBits, FindDIBBits((PSTR)pSrcDIB), dwSourceBitsSize );

    // Select DIBSections into DCs
    hOldSourceBitmap = SelectObject( hSourceDC, hSourceBitmap );
    hOldTargetBitmap = SelectObject( hTargetDC, hTargetBitmap );

    // Set the color tables for the DIBSections
    if( pSrcDIB->bmiHeader.biBitCount <= 8 )
    {
        SetDIBColorTable( hSourceDC, 0, 1 << pSrcDIB->bmiHeader.biBitCount, pSrcDIB->bmiColors );
    }

    if( pbmi->bmiHeader.biBitCount <= 8 )
    {
        SetDIBColorTable( hTargetDC, 0, 1 << pbmi->bmiHeader.biBitCount, pbmi->bmiColors );
    }

    // If we are asking for a straight copy, do it
    if( (pSrcDIB->bmiHeader.biWidth==pbmi->bmiHeader.biWidth) && (pSrcDIB->bmiHeader.biHeight==pbmi->bmiHeader.biHeight) )
    {
        BitBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, SRCCOPY );
    }
    else
    {
        // else, should we stretch it?
        if( bStretch )
        {
            SetStretchBltMode( hTargetDC, COLORONCOLOR );
            StretchBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, pSrcDIB->bmiHeader.biWidth, pSrcDIB->bmiHeader.biHeight, SRCCOPY );
        }
        else
        {
            // or just take the upper left corner of the source
            BitBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, SRCCOPY );
        }
    }

    // Clean up and delete the DCs
    SelectObject( hSourceDC, hOldSourceBitmap );
    SelectObject( hSourceDC, hOldTargetBitmap );
    DeleteDC( hSourceDC );
    DeleteDC( hTargetDC );
    ReleaseDC( NULL, hDC );

    // Flush the GDI batch, so we can play with the bits
    GdiFlush();

    // Allocate enough memory for the new CF_DIB, and copy bits
    pResult = malloc( dwTargetHeaderSize + dwTargetBitsSize );
    memcpy( pResult, pbmi, dwTargetHeaderSize );
    memcpy( FindDIBBits( pResult ), pTargetBits, dwTargetBitsSize );

    // final cleanup
    DeleteObject( hTargetBitmap );
    DeleteObject( hSourceBitmap );
    free( pbmi );

    return pResult;
}

WORD DIBNumColors ( PSTR pbi )

Definition at line 81 of file Dib.c.

{
    WORD wBitCount;
    DWORD dwClrUsed;

    dwClrUsed = ((PBITMAPINFOHEADER) pbi)->biClrUsed;

    if (dwClrUsed)
    {
        return (WORD) dwClrUsed;
    }

    wBitCount = ((PBITMAPINFOHEADER) pbi)->biBitCount;

    switch (wBitCount)
    {
        case 1: return 2;
        case 4: return 16;
        case 8: return 256;
        default:return 0;
    }
    return 0;
}

PSTR FindDIBBits ( PSTR pbi )

Definition at line 58 of file Dib.c.

{
   return ( pbi + *(PDWORD)pbi + PaletteSize( pbi ) );
}

WORD PaletteSize ( PSTR pbi )

Definition at line 124 of file Dib.c.

{
    return (WORD)( DIBNumColors( pbi ) * sizeof( RGBQUAD ) );
}

PBYTE ReadBMPFile ( PCTSTR szFileName )

Definition at line 463 of file Dib.c.

{
    HANDLE              hFile        = NULL;
    BITMAPFILEHEADER    bfh          = {0};
    DWORD               dwBytes      = 0;
    PBYTE               pDIB        = NULL;
    PBYTE               pTemp       = NULL;
    WORD                wPaletteSize = 0;
    DWORD               dwBitsSize   = 0;

    // Open the file
    if( (hFile=CreateFile( szFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE )
    {
        MessageBox( NULL, TEXT("Error opening file"), szFileName, MB_OK );
        return NULL;
    }
    // Read the header
    if( ( ! ReadFile( hFile, &bfh, sizeof(BITMAPFILEHEADER), &dwBytes, NULL ) ) || ( dwBytes != sizeof( BITMAPFILEHEADER ) ) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
        return NULL;
    }
    // Does it look like a BMP file?
    if( ( bfh.bfType != 0x4d42 ) || (bfh.bfReserved1!=0) || (bfh.bfReserved2!=0) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Not a recognised BMP format file"), szFileName, MB_OK );
        return NULL;
    }
    // Allocate some memory
    if( (pDIB = malloc( sizeof( BITMAPINFO ) )) == NULL )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Failed to allocate memory for DIB"), szFileName, MB_OK );
        return NULL;
    }
    // Read in the BITMAPINFOHEADER
    if( (!ReadFile( hFile, pDIB, sizeof(BITMAPINFOHEADER), &dwBytes, NULL )) || (dwBytes!=sizeof(BITMAPINFOHEADER)) )
    {
        CloseHandle( hFile );
        free( pDIB );
        MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
        return NULL;
    }
    if( ((PBITMAPINFOHEADER)pDIB)->biSize != sizeof( BITMAPINFOHEADER ) )
    {
        CloseHandle( hFile );
        free( pDIB );
        MessageBox( NULL, TEXT("OS/2 style BMPs Not Supported"), szFileName, MB_OK );
        return NULL;
    }
    // How big are the elements?
    wPaletteSize = PaletteSize((PSTR)pDIB);
    dwBitsSize = ((PBITMAPINFOHEADER)pDIB)->biHeight * BytesPerLine((PBITMAPINFOHEADER)pDIB);
    // realloc to account for the total size of the DIB
    if( (pTemp = realloc( pDIB, sizeof( BITMAPINFOHEADER ) + wPaletteSize + dwBitsSize )) == NULL )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Failed to allocate memory for DIB"), szFileName, MB_OK );
        free( pDIB );
        return NULL;
    }
    pDIB = pTemp;
    // If there is a color table, read it
    if( wPaletteSize != 0 )
    {
        if( (!ReadFile( hFile, ((PBITMAPINFO)pDIB)->bmiColors, wPaletteSize, &dwBytes, NULL )) || (dwBytes!=wPaletteSize) )
        {
            CloseHandle( hFile );
            free( pDIB );
            MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
            return NULL;
        }
    }
    // Seek to the bits
    // checking against 0 in case some bogus app didn't set this element
    if( bfh.bfOffBits != 0 )
    {
        if( SetFilePointer( hFile, bfh.bfOffBits, NULL, FILE_BEGIN ) == INVALID_SET_FILE_POINTER )
        {
            CloseHandle( hFile );
            free( pDIB );
            MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
            return NULL;
        }
    }
    // Read the image bits
    if( (!ReadFile( hFile, FindDIBBits(pDIB), dwBitsSize, &dwBytes, NULL )) || (dwBytes!=dwBitsSize) )
    {
        CloseHandle( hFile );
        free( pDIB );
        MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
        return NULL;
    }
    // clean up
    CloseHandle( hFile );
    return pDIB;
}

VOID SetMonoDIBPixel | ( | PBYTE | pANDBits,
 |  | DWORD | dwWidth,
 |  | DWORD | dwHeight,
 |  | DWORD | x,
 |  | DWORD | y,
 |  | BOOL | bWhite
 | ) |  |

Definition at line 416 of file Dib.c.

{
    DWORD ByteIndex;
    BYTE    BitNumber;

    // Find the byte on which this scanline begins
    ByteIndex = (dwHeight - y - 1) * WIDTHBYTES(dwWidth);
    // Find the byte containing this pixel
    ByteIndex += (x >> 3);
    // Which bit is it?
    BitNumber = (BYTE)( 7 - (x % 8) );

    if( bWhite )
    {
        // Turn it on
        pANDBits[ByteIndex] |= (1<<BitNumber);
    }
    else
    {
        // Turn it off
        pANDBits[ByteIndex] &= ~(1<<BitNumber);
    }
}

BOOL WriteBMPFile | ( | PCTSTR | szFileName,
 |  | PBYTE | lpDIB
 | ) |  |

Definition at line 581 of file Dib.c.

{
    HANDLE              hFile           = NULL;
    BITMAPFILEHEADER    bfh             = {0};
    DWORD             dwBytes;
    DWORD               dwBytesToWrite;
    PBITMAPINFOHEADER pbmih           = NULL;

    // Open the file
    if( (hFile=CreateFile( szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE )
    {
        MessageBox( NULL, TEXT("Error opening file"), szFileName, MB_OK );
        return FALSE;
    }
    bfh.bfType = 0x4d42;
    bfh.bfReserved1 = 0;
    bfh.bfReserved2 = 0;
    bfh.bfOffBits = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) + PaletteSize( pDIB );
    bfh.bfSize = (bfh.bfOffBits + ((PBITMAPINFOHEADER)pDIB)->biHeight * BytesPerLine((PBITMAPINFOHEADER)pDIB))/4;
    // Write the header
    if( ( ! WriteFile( hFile, &bfh, sizeof(BITMAPFILEHEADER), &dwBytes, NULL ) ) || ( dwBytes != sizeof( BITMAPFILEHEADER ) ) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Error Writing file"), szFileName, MB_OK );
        return FALSE;
    }
    pbmih = (PBITMAPINFOHEADER)pDIB;
    pbmih->biHeight /= 2;
    dwBytesToWrite = bfh.bfOffBits + (pbmih->biHeight * BytesPerLine(pbmih));
    if( ( ! WriteFile( hFile, pDIB, dwBytesToWrite, &dwBytes, NULL ) ) || ( dwBytes != dwBytesToWrite ) )
    {
        CloseHandle( hFile );
        MessageBox( NULL, TEXT("Error Writing file"), szFileName, MB_OK );
        return FALSE;
    }
    pbmih->biHeight *= 2;
    CloseHandle( hFile );
    return TRUE;
}

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/IconPRO.C File Reference

  • WinUI
  • Resource
  • Iconpro
Functions | Variables

IconPRO.C File Reference

#include <Windows.H>
#include <commdlg.h>
#include "Resource.h"
#include "Icons.H"
#include "IconPro.h"
#include "MDIChild.h"

Go to the source code of this file.

Functions

BOOL CALLBACK | AboutDlgProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
HWND | CreateNewMDIChildWindow (PTSTR szTitle, PVOID lpData)
BOOL | GetOpenIconFileName (PTSTR szFileName, UINT FilterStringID, PCTSTR szTitle)
BOOL | GetSaveIconFileName (PTSTR szFileName, UINT FilterStringID, PCTSTR szTitle)
BOOL | InitApplication (HANDLE hInstance)
BOOL | InitInstance (HANDLE hInstance, int nCmdShow)
LRESULT | OnCommand (HWND hWnd, WPARAM wParam, LPARAM lParam)
BOOL | QueryCloseAllChildren (void)
BOOL | QueryCloseAllChildren (VOID)
BOOL | UpdateMenuState (HWND hWnd, HMENU hMenu)
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpszCmdLine, int nCmdShow)
LRESULT CALLBACK | WndProc (HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)

Variables

HINSTANCE | hInst
HWND | hMDIClientWnd
HWND | hWndMain
TCHAR | szAppName [] = TEXT("IconPro")
TCHAR | szChildClassName [] = TEXT("IconChildClass")
TCHAR | szHelpFileName [] = TEXT("IconPro.HLP")
TCHAR | szTitle [] = TEXT("IconPro Icon Handler")

Function Documentation

BOOL CALLBACK AboutDlgProc | ( | HWND | hWnd,
 |  | UINT | Msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 511 of file IconPRO.C.

{
    switch( Msg )
    {
        case WM_INITDIALOG:
            break;

        case WM_CLOSE:
            PostMessage( hWnd, WM_COMMAND, IDCANCEL, 0l );
            break;

        case WM_COMMAND:
            switch( LOWORD(wParam) )
            {
                case IDOK:
                    EndDialog( hWnd, TRUE );
                    break;

                case IDCANCEL:
                    EndDialog( hWnd, FALSE );
                    break;

            }
            break;

        default:
            return FALSE;
            break;
    }
    return TRUE;
}

HWND CreateNewMDIChildWindow | ( | PTSTR | szTitle,
 |  | PVOID | lpData
 | ) |  |

Definition at line 565 of file IconPRO.C.

{
    HWND    hReturnWnd = NULL;

    // Create the MDI child window
    hReturnWnd = CreateMDIWindow(
                    szChildClassName, szTitle, 0,
                    CW_USEDEFAULT, CW_USEDEFAULT, WINDOW_WIDTH, WINDOW_HEIGHT,
                    hMDIClientWnd, hInst, (LPARAM)lpData );
    // Show it
    ShowWindow( hReturnWnd, SW_SHOW );
    return hReturnWnd;
}

BOOL GetOpenIconFileName | ( | PTSTR | szFileName,
 |  | UINT | FilterStringID,
 |  | PCTSTR | szTitle
 | ) |  |

Definition at line 600 of file IconPRO.C.

{
    OPENFILENAME    ofn = {0};
    UINT            i, cbString;
    TCHAR         chReplace;
    TCHAR         szFilter[256];

    // Get the filter string
    if ((cbString = LoadString( hInst, FilterStringID, szFilter, sizeof(szFilter))) == 0 )
    {
        return FALSE;
    }

    // Replace the wildcard with NULL
    chReplace = szFilter[cbString - 1]; /* retrieve wildcard */
    for (i = 0; szFilter[i] != TEXT('\0'); i++)
    {
        if (szFilter[i] == chReplace)
        {
            szFilter[i] = TEXT('\0');
        }
    }

    // Fill out the OPENFILENAME struct
    ZeroMemory( &ofn, sizeof( OPENFILENAME ) );
    ofn.lStructSize = sizeof( OPENFILENAME );
    ofn.hwndOwner = hWndMain;
    ofn.hInstance = hInst;
    lstrcpyn( szFileName, TEXT(""), sizeof(szFileName)/sizeof(szFileName[0]) - 1 );
    ofn.lpstrFile = szFileName;
    ofn.nMaxFile = MAX_PATH;
    ofn.Flags = OFN_FILEMUSTEXIST;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrTitle = szTitle;

    // Use the common dialog
    return GetOpenFileName( &ofn );
}

BOOL GetSaveIconFileName | ( | PTSTR | szFileName,
 |  | UINT | FilterStringID,
 |  | PCTSTR | szTitle
 | ) |  |

Definition at line 661 of file IconPRO.C.

{
    OPENFILENAME    ofn = {0};
    UINT            i, cbString;
    TCHAR         chReplace;
    TCHAR         szFilter[256];

    // Get the filter string
    if ((cbString = LoadString( hInst, FilterStringID, szFilter, sizeof(szFilter))) == 0 )
    {
        return FALSE;
    }

    // Replace the wildcard with NULL
    chReplace = szFilter[cbString - 1]; /* retrieve wildcard */
    for (i = 0; szFilter[i] != TEXT('\0'); i++)
    {
        if (szFilter[i] == chReplace)
        {
            szFilter[i] = TEXT('\0');
        }
    }

    // Fill out the OPENFILENAME struct
    ZeroMemory( &ofn, sizeof( OPENFILENAME ) );
    ofn.lStructSize = sizeof( OPENFILENAME );
    ofn.hwndOwner = hWndMain;
    ofn.hInstance = hInst;
    lstrcpyn( szFileName, TEXT(""), sizeof(szFileName)/sizeof(szFileName[0]) - 1 );
    ofn.lpstrFile = szFileName;
    ofn.nMaxFile = MAX_PATH;
    ofn.Flags = OFN_OVERWRITEPROMPT;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrDefExt = TEXT("ICO");
    ofn.lpstrTitle = szTitle;

    // Use the common dialog
    return GetSaveFileName( &ofn );
}

BOOL InitApplication ( HANDLE hInstance )

Definition at line 141 of file IconPRO.C.

{
    WNDCLASS    wc = {0};
    BOOL        bResult;

    wc.lpfnWndProc   = (WNDPROC)WndProc;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon( hInstance, MAKEINTRESOURCE(ICONPRO_ICON) );
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.lpszMenuName  = MAKEINTRESOURCE(ICONPRO_MENU);
    wc.lpszClassName = szAppName;

    bResult = RegisterClass( &wc );

    wc.lpfnWndProc   = (WNDPROC)IconChildWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon( hInstance, MAKEINTRESOURCE(ICONPRO_ICON) );
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = CreateSolidBrush(COLOR_3DFACE);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = szChildClassName;

    return( bResult && RegisterClass( &wc ) );
}

BOOL InitInstance | ( | HANDLE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 187 of file IconPRO.C.

{
    BOOL bSuccess = TRUE;

    hInst = hInstance;
    hWndMain = CreateWindow(
        szAppName,
        szTitle,
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, 0,
        CW_USEDEFAULT, 0,
        NULL, NULL, hInstance, NULL );

    if( hWndMain == NULL )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    ShowWindow( hWndMain, nCmdShow );
    bSuccess = UpdateWindow( hWndMain );

exit_func:
    return bSuccess;
}

LRESULT OnCommand | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 327 of file IconPRO.C.

{
    // Which command is it?
    switch( LOWORD( wParam ) )
    {
        // File->New menu option - spawn a new child
        case ID_FILE_NEW:
            {
                HWND    hWndNew;

                hWndNew = CreateNewMDIChildWindow( TEXT("Untitled"), NULL );
                SendMessage( hMDIClientWnd, WM_MDIACTIVATE, (WPARAM)hWndNew, 0 );
            }
            break;

        // File->Open menu option - open an ICO file
        case ID_FILE_OPEN:
            {
                HWND            hWndNew               = NULL;
                ICONRESOURCE*   pIR                   = NULL;
                TCHAR         szFileName[MAX_PATH]  = {0};
                TCHAR         szFileTitle[MAX_PATH] = {0};

                // Get the name of the file to open
                if( GetOpenIconFileName( szFileName, IDS_FILTERSTRING, TEXT("Open Icon File") ) )
                {
                    // Read in the icon data
                    if( (pIR = ReadIconFromICOFile( szFileName )) == NULL )
                    {
                        break;
                    }

                    // Get the name of the file for the window title
                    if( GetFileTitle( szFileName, szFileTitle, MAX_PATH ) )
                    {
                        break;
                    }

                    // Make a new child to handle this icon
                    hWndNew = CreateNewMDIChildWindow( szFileTitle, pIR );
                    SendMessage( hMDIClientWnd, WM_MDIACTIVATE, (WPARAM)hWndNew, 0 );
                }
            }
            break;

        // File->Extract menu option - extract icon data from a DLL or EXE
        case ID_FILE_EXTRACT:
            {
                HWND            hWndNew              = NULL;
                ICONRESOURCE*   pIR                  = NULL;
                TCHAR           szFileName[MAX_PATH] = {0};

                // Get the name of the file from which to extract the icon
                if( GetOpenIconFileName( szFileName, IDS_EXEFILTERSTRING, TEXT("Extract Icon from File") ) )
                {
                    // Extract the icon data
                    if( (pIR = ReadIconFromEXEFile( szFileName )) == NULL )
                    {
                        break;
                    }
                    // Make a new child to handle this icon
                    hWndNew = CreateNewMDIChildWindow( (TEXT("Untitled")), pIR );
                    SendMessage( hMDIClientWnd, WM_MDIACTIVATE, (WPARAM)hWndNew, 0 );
                }
            }
            break;

        // File->Save and File->SaveAs menu options - save current ICO file to disk
        case ID_FILE_SAVEAS: /* fall-through */
        case ID_FILE_SAVE:
            {
                HWND    hWndActive;

                // Get the active MDI child window
                if( (hWndActive = (HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0 )) != NULL )
                {
                    // Tell it to write its icon to disk
                    SendMessage( hWndActive, WM_COMMAND, wParam, 0 );
                }
                else
                    MessageBox( hWnd, TEXT("Error Getting Active Window"), TEXT("Error"), MB_OK );
            }
            break;

        // File->Close menu option - close the current MDI child window
        case ID_FILE_CLOSE:
            {
                HWND    hWndActive;

                // Get the active MDI child window and tell it to close itself
                if( (hWndActive = (HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0)) != NULL )
                    SendMessage( hWndActive, WM_CLOSE, 0, lParam );
            }
            break;

        // File->Exit menu option - shut 'er down
        case ID_F_EXIT:
            // Just send a WM_CLOSE - code there will handle it
            PostMessage( hWnd, WM_CLOSE, (WPARAM)0, (LPARAM)0 );
            break;

        // Edit->Import BMP and Edit->Stretch-Import BMP - convert BMP file to icon
        // Edit->Copy, Edit->Paste, Edit->StretchPaste, Edit->AddFormat, Edit->RemoveFormat
        // menu options. Just pass 'em on to the currently active MDI child window
        case ID_EDIT_EXPORTBMP:         /* fall-through */
        case ID_EDIT_IMPORTBMP:         /* fall-through */
        case ID_EDIT_STRETCHIMPORTBMP:  /* fall-through */
        case ID_EDIT_COPY:              /* fall-through */
        case ID_EDIT_PASTE:             /* fall-through */
        case ID_EDIT_STRETCHPASTE:      /* fall-through */
        case ID_EDIT_ADDFORMAT:         /* fall-through */
        case ID_EDIT_REMOVEFORMAT:
            {
                HWND    hWndActive;

                // Get active MDI child
                if( (hWndActive = (HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0 )) != NULL )
                {
                    // Pass the message along
                    SendMessage( hWndActive, WM_COMMAND, wParam, 0 );
                }
            }
            break; // End ID_EDIT_XXXX

        // Window->ArrangeIcons menu option
        case ID_WINDOW_ARRANGEICONS:
            // Ask the MDIClient to do it
            SendMessage( hMDIClientWnd, WM_MDIICONARRANGE, 0, 0);
            break;

        // Window->Cascade menu option
        case ID_WINDOW_CASCADE:
            // Ask the MDIClient to do it
            SendMessage( hMDIClientWnd, WM_MDICASCADE, 0, 0);
            break;

        // Window->Tile menu option
        case ID_WINDOW_TILE:
            // Ask the MDIClient to do it
            SendMessage( hMDIClientWnd, WM_MDITILE, (WPARAM)MDITILE_HORIZONTAL, 0);
            break;

        // Window->TileVertical menu option
        case ID_WINDOW_TILEVERTICAL:
            // Ask the MDIClient to do it
            SendMessage( hMDIClientWnd, WM_MDITILE, (WPARAM)MDITILE_VERTICAL, 0);
            break;

        // Help->About menu option
        case ID_HELP_ABOUT:
            // Launch the About Dialog
            DialogBox( hInst, MAKEINTRESOURCE(ICONPRO_ABOUT_DLG), hWnd, (DLGPROC)AboutDlgProc );
            break;

        case ID_HELP_CONTENTS:
            WinHelp( hWnd, szHelpFileName, HELP_CONTENTS, 0 );
            break;
    }
    return 0l;
}

BOOL QueryCloseAllChildren ( void )
BOOL QueryCloseAllChildren ( VOID )

Definition at line 809 of file IconPRO.C.

{
    register HWND hwndT;

    for( hwndT = GetWindow(hMDIClientWnd, GW_CHILD); hwndT; hwndT = GetWindow (hwndT, GW_HWNDNEXT) )
    {
        if( GetWindow( hwndT, GW_OWNER ) )
        {
            continue;
        }

        if( SendMessage( hwndT, WM_CLOSE, 0, 0L ) )
        {
            return FALSE;
        }
    }
    return TRUE;
}

BOOL UpdateMenuState | ( | HWND | hWnd,
 |  | HMENU | hMenu
 | ) |  |

Definition at line 722 of file IconPRO.C.

{
    UINT    nEnableFlag, nNumFormats;
    HWND    hWndActive = NULL;

    // Get a handle to the active MDI child window
    hWndActive=(HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0 );
    // Find out how many icon image formats it holds
    nNumFormats = (UINT)SendMessage( hWndActive, WM_COMMAND, ID_GETNUMFORMATS, 0 );
    // Do we actually have an active window?
    if( hWndActive == NULL )
    {
        // No active MDI child...
        EnableMenuItem( hMenu, ID_FILE_NEW, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_FILE_OPEN, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_FILE_EXTRACT, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_FILE_CLOSE, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_FILE_SAVE, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_FILE_SAVEAS, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_F_EXIT, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_EDIT_COPY, MF_BYCOMMAND| MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_PASTE, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_STRETCHPASTE, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_ADDFORMAT, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_IMPORTBMP, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_STRETCHIMPORTBMP, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_EXPORTBMP, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_REMOVEFORMAT, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_WINDOW_ARRANGEICONS, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_WINDOW_CASCADE, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_WINDOW_TILE, MF_BYCOMMAND | MF_GRAYED );
        EnableMenuItem( hMenu, ID_WINDOW_TILEVERTICAL, MF_BYCOMMAND | MF_GRAYED );
    }
    else
    {
        // We have an active MDI child...
        EnableMenuItem( hMenu, ID_FILE_NEW, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_FILE_OPEN, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_FILE_EXTRACT, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_FILE_CLOSE, MF_BYCOMMAND | MF_ENABLED );
        nEnableFlag = (BOOL)SendMessage( hWndActive, WM_COMMAND, ID_HASFILECHANGED, 0 ) ? MF_ENABLED : MF_GRAYED;
        EnableMenuItem( hMenu, ID_FILE_SAVE, MF_BYCOMMAND | nEnableFlag );
        EnableMenuItem( hMenu, ID_FILE_SAVEAS, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_F_EXIT, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_EDIT_COPY, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
        if( IsClipboardFormatAvailable( CF_DIB ) )
        {
            EnableMenuItem( hMenu, ID_EDIT_PASTE, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
            EnableMenuItem( hMenu, ID_EDIT_STRETCHPASTE, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
        }
        else
        {
            EnableMenuItem( hMenu, ID_EDIT_PASTE, MF_BYCOMMAND | MF_GRAYED );
            EnableMenuItem( hMenu, ID_EDIT_STRETCHPASTE, MF_BYCOMMAND | MF_GRAYED );
        }
        EnableMenuItem( hMenu, ID_EDIT_IMPORTBMP, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_STRETCHIMPORTBMP, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_EXPORTBMP, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
        EnableMenuItem( hMenu, ID_EDIT_ADDFORMAT, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_EDIT_REMOVEFORMAT, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
        EnableMenuItem( hMenu, ID_WINDOW_ARRANGEICONS, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_WINDOW_CASCADE, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_WINDOW_TILE, MF_BYCOMMAND | MF_ENABLED );
        EnableMenuItem( hMenu, ID_WINDOW_TILEVERTICAL, MF_BYCOMMAND | MF_ENABLED );
    }
    return TRUE;
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | PSTR | lpszCmdLine,
 |  | int | nCmdShow
 | ) |  |

Definition at line 81 of file IconPRO.C.

{
    MSG msg;
    BOOL bRet = FALSE;

    // standard init stuff
    if( ! hPrevInstance )
    {
        if( ! InitApplication( hInstance ) )
        {
            return FALSE;
        }
    }
    if( ! InitInstance( hInstance, nCmdShow ) )
    {
        return FALSE;
    }

    // Standard message loop
    while ((bRet = GetMessage(&msg, (HWND) NULL, 0, 0)) != 0)
    {
        if (bRet == -1)
        {
            goto exit_func;
        }
        else
        {
            if( !TranslateMDISysAccel(hMDIClientWnd, &msg) )
            {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        }
    }

exit_func:
    return (int)msg.wParam;
}

LRESULT CALLBACK WndProc | ( | HWND | hWnd,
 |  | UINT | Message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 235 of file IconPRO.C.

{
    INT ret = -1;

    switch( Message )
    {
        // Menu is coming up, initialize it
        case WM_INITMENU:
            UpdateMenuState( hWnd, (HMENU)wParam );
            ret = 1;
            break;

        // Window is being created, create the MDI client also
        case WM_CREATE:
            {
                CLIENTCREATESTRUCT ccs = {0};

                // Retrieve the handle of the Window menu and assign the
                // first child window identifier.
                ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd), 2 );
                ccs.idFirstChild = IDM_WINDOWCHILD;

                // Create the MDI client window
                hMDIClientWnd = CreateWindow( TEXT("MDICLIENT"), (PCTSTR) NULL,
                                              WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
                                              0, 0, 0, 0, hWnd, (HMENU) 0xCAC, hInst, (PSTR) &ccs );

                ShowWindow(hMDIClientWnd, SW_SHOW);
            }
            break;

        // Command Messages (menu items, etc)
        case WM_COMMAND:
            OnCommand( hWnd, wParam, lParam );
            ret = -1;
            break;

        case WM_CLOSE:
            {
                // Will the children allow it? (Give 'em a chance to cancel)
                if( QueryCloseAllChildren() )
                {
                    WinHelp( hWnd, szHelpFileName, HELP_QUIT, 0 );
                    DestroyWindow( hWnd );
                    PostQuitMessage( 0 );
                    ret = -1;
                }
                else
                {
                    ret = 0;
                }
            }
            break;

        // Pass it on to the default window procedure
        default:
            break;
    }

    if (ret == -1)
    {
        return DefFrameProc( hWnd, hMDIClientWnd, Message, wParam, lParam );
    }
    else
    {
        return ret;
    }
}

Variable Documentation

HINSTANCE hInst

Definition at line 55 of file IconPRO.C.

HWND hMDIClientWnd

Definition at line 56 of file IconPRO.C.

HWND hWndMain

Definition at line 56 of file IconPRO.C.

TCHAR szAppName[] = TEXT("IconPro")

Definition at line 57 of file IconPRO.C.

TCHAR szChildClassName[] = TEXT("IconChildClass")

Definition at line 59 of file IconPRO.C.

TCHAR szHelpFileName[] = TEXT("IconPro.HLP")

Definition at line 60 of file IconPRO.C.

TCHAR szTitle[] = TEXT("IconPro Icon Handler")

Definition at line 58 of file IconPRO.C.

Generated on Wed Nov 13 2024 16:55:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/IconPRO.h File Reference

  • WinUI
  • Resource
  • Iconpro
Defines | Functions

IconPRO.h File Reference

Go to the source code of this file.

Defines

#define | MAX_ICON_HEIGHT MAX_ICON_WIDTH
#define | MAX_ICON_WIDTH 128
#define | MIN_ICON_HEIGHT MIN_ICON_WIDTH
#define | MIN_ICON_WIDTH 16
#define | RectHeight(r) ((r).bottom - (r).top + 1)
#define | RectWidth(r) ((r).right - (r).left + 1)
#define | WINDOW_HEIGHT ( ( MAX_ICON_HEIGHT * 2 ) + 150 )
#define | WINDOW_WIDTH ( ( MAX_ICON_WIDTH * 2 ) + 30 )

Functions

BOOL | GetOpenIconFileName (PTSTR szFileName, UINT FilterStringID, PCTSTR szTitle)
BOOL | GetSaveIconFileName (PTSTR szFileName, UINT FilterStringID, PCTSTR szTitle)

Define Documentation

#define MAX_ICON_HEIGHT MAX_ICON_WIDTH

Definition at line 31 of file IconPRO.h.

#define MAX_ICON_WIDTH 128

Definition at line 29 of file IconPRO.h.

#define MIN_ICON_HEIGHT MIN_ICON_WIDTH

Definition at line 32 of file IconPRO.h.

#define MIN_ICON_WIDTH 16

Definition at line 30 of file IconPRO.h.

#define RectHeight ( r ) ((r).bottom - (r).top + 1)

Definition at line 41 of file IconPRO.h.

#define RectWidth ( r ) ((r).right - (r).left + 1)

Definition at line 40 of file IconPRO.h.

#define WINDOW_HEIGHT ( ( MAX_ICON_HEIGHT * 2 ) + 150 )

Definition at line 37 of file IconPRO.h.

#define WINDOW_WIDTH ( ( MAX_ICON_WIDTH * 2 ) + 30 )

Definition at line 36 of file IconPRO.h.

Function Documentation

BOOL GetOpenIconFileName | ( | PTSTR | szFileName,
 |  | UINT | FilterStringID,
 |  | PCTSTR | szTitle
 | ) |  |

Definition at line 600 of file IconPRO.C.

{
    OPENFILENAME    ofn = {0};
    UINT            i, cbString;
    TCHAR         chReplace;
    TCHAR         szFilter[256];

    // Get the filter string
    if ((cbString = LoadString( hInst, FilterStringID, szFilter, sizeof(szFilter))) == 0 )
    {
        return FALSE;
    }

    // Replace the wildcard with NULL
    chReplace = szFilter[cbString - 1]; /* retrieve wildcard */
    for (i = 0; szFilter[i] != TEXT('\0'); i++)
    {
        if (szFilter[i] == chReplace)
        {
            szFilter[i] = TEXT('\0');
        }
    }

    // Fill out the OPENFILENAME struct
    ZeroMemory( &ofn, sizeof( OPENFILENAME ) );
    ofn.lStructSize = sizeof( OPENFILENAME );
    ofn.hwndOwner = hWndMain;
    ofn.hInstance = hInst;
    lstrcpyn( szFileName, TEXT(""), sizeof(szFileName)/sizeof(szFileName[0]) - 1 );
    ofn.lpstrFile = szFileName;
    ofn.nMaxFile = MAX_PATH;
    ofn.Flags = OFN_FILEMUSTEXIST;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrTitle = szTitle;

    // Use the common dialog
    return GetOpenFileName( &ofn );
}

BOOL GetSaveIconFileName | ( | PTSTR | szFileName,
 |  | UINT | FilterStringID,
 |  | PCTSTR | szTitle
 | ) |  |

Definition at line 661 of file IconPRO.C.

{
    OPENFILENAME    ofn = {0};
    UINT            i, cbString;
    TCHAR         chReplace;
    TCHAR         szFilter[256];

    // Get the filter string
    if ((cbString = LoadString( hInst, FilterStringID, szFilter, sizeof(szFilter))) == 0 )
    {
        return FALSE;
    }

    // Replace the wildcard with NULL
    chReplace = szFilter[cbString - 1]; /* retrieve wildcard */
    for (i = 0; szFilter[i] != TEXT('\0'); i++)
    {
        if (szFilter[i] == chReplace)
        {
            szFilter[i] = TEXT('\0');
        }
    }

    // Fill out the OPENFILENAME struct
    ZeroMemory( &ofn, sizeof( OPENFILENAME ) );
    ofn.lStructSize = sizeof( OPENFILENAME );
    ofn.hwndOwner = hWndMain;
    ofn.hInstance = hInst;
    lstrcpyn( szFileName, TEXT(""), sizeof(szFileName)/sizeof(szFileName[0]) - 1 );
    ofn.lpstrFile = szFileName;
    ofn.nMaxFile = MAX_PATH;
    ofn.Flags = OFN_OVERWRITEPROMPT;
    ofn.lpstrFilter = szFilter;
    ofn.lpstrDefExt = TEXT("ICO");
    ofn.lpstrTitle = szTitle;

    // Use the common dialog
    return GetSaveFileName( &ofn );
}

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Icons.C File Reference

  • WinUI
  • Resource
  • Iconpro
Classes | Typedefs | Functions | Variables

Icons.C File Reference

#include <Windows.h>
#include <commdlg.h>
#include <malloc.h>
#include <tchar.h>
#include "Resource.h"
#include "IconPro.h"
#include "Icons.H"
#include "Dib.H"

Go to the source code of this file.

Classes

struct | EXEDLLICONINFO
struct | RESOURCEPOSINFO

Typedefs

typedef struct EXEDLLICONINFO * | PEXEDLLICONINFO
typedef struct RESOURCEPOSINFO * | PRESOURCEPOSINFO

Functions

BOOL | AdjustIconImagePointers (ICONIMAGE *pImage)
DWORD | CalculateImageOffset (ICONRESOURCE *pIR, UINT nIndex)
PTSTR | ChooseIconFromEXEFile (PEXEDLLICONINFO pEDII)
BOOL | CreateBlankNewFormatIcon (ICONIMAGE *pii)
BOOL | DIBToIconImage (ICONIMAGE *pii, PBYTE pDIB, BOOL bStretch)
BOOL | DrawANDMask (HDC hDC, RECT Rect, ICONIMAGE *pIcon)
BOOL | DrawXORMask (HDC hDC, RECT Rect, ICONIMAGE *pIcon)
BOOL CALLBACK | ExtractDlgProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
HICON | GetIconFromInstance (HINSTANCE hInstance, PTSTR nIndex)
RECT | GetXORImageRect (RECT Rect, ICONIMAGE *pIcon)
BOOL | IconImageFromBMPFile (PCTSTR szFileName, ICONIMAGE *pii, BOOL bStretchToFit)
BOOL | IconImageFromClipBoard (ICONIMAGE *pii, BOOL bStretchToFit)
BOOL | IconImageToBMPFile (PCTSTR szFileName, ICONIMAGE *pii)
BOOL | IconImageToClipBoard (ICONIMAGE *pii)
HICON | MakeIconFromResource (ICONIMAGE *pIcon)
BOOL | MakeNewANDMaskBasedOnPoint (ICONIMAGE *pIcon, POINT pt)
BOOL CALLBACK | MyEnumProcedure (HANDLE hModule, PCTSTR pszType, PTSTR pszName, LPARAM lParam)
UINT | ReadICOHeader (HANDLE hFile)
ICONRESOURCE * | ReadIconFromEXEFile (PCTSTR szFileName)
ICONRESOURCE * | ReadIconFromICOFile (PCTSTR szFileName)
BOOL | WriteICOHeader (HANDLE hFile, UINT nNumEntries)
BOOL | WriteIconToICOFile (ICONRESOURCE *pIR, PCTSTR szFileName)

Variables

HINSTANCE | hInst
HWND | hWndMain

Typedef Documentation

typedef struct EXEDLLICONINFO * PEXEDLLICONINFO
typedef struct RESOURCEPOSINFO * PRESOURCEPOSINFO

Function Documentation

BOOL AdjustIconImagePointers ( ICONIMAGE * pImage )

Definition at line 299 of file Icons.C.

{
    // Sanity check
    if( pImage==NULL )
    {
        return FALSE;
    }

    // BITMAPINFO is at beginning of bits
    pImage->pbi = (PBITMAPINFO)pImage->pBits;
    // Width - simple enough
    pImage->Width = pImage->pbi->bmiHeader.biWidth;
    // Icons are stored in funky format where height is doubled - account for it
    pImage->Height = (pImage->pbi->bmiHeader.biHeight)/2;
    // How many colors?
    pImage->Colors = pImage->pbi->bmiHeader.biPlanes * pImage->pbi->bmiHeader.biBitCount;
    // XOR bits follow the header and color table
    pImage->pXOR = (PBYTE)FindDIBBits((PSTR)pImage->pbi);
    // AND bits follow the XOR bits
    pImage->pAND = pImage->pXOR + (pImage->Height*BytesPerLine((PBITMAPINFOHEADER)(pImage->pbi)));
    return TRUE;
}

DWORD CalculateImageOffset | ( | ICONRESOURCE * | pIR,
 |  | UINT | nIndex
 | ) |  |

Definition at line 869 of file Icons.C.

{
    DWORD dwSize;
    UINT  i;

    // Calculate the ICO header size
    dwSize = 3 * sizeof(WORD);
    // Add the ICONDIRENTRY's
    dwSize += pIR->nNumImages * sizeof(ICONDIRENTRY);
    // Add the sizes of the previous images
    for(i=0;i<nIndex;i++)
    {
        dwSize += pIR->IconImages[i].dwNumBytes;
    }
    // we're there - return the number
    return dwSize;
}

PTSTR ChooseIconFromEXEFile ( PEXEDLLICONINFO pEDII )

Definition at line 657 of file Icons.C.

{
    // Just launch the dialog box and let it handle it
    if( DialogBoxParam( hInst, MAKEINTRESOURCE(IDD_EXTRACTDLG),
                        hWndMain, (DLGPROC)ExtractDlgProc, (LPARAM)(pEDII) ) )
    {
        // User chose 'Ok'
        return pEDII->pID;
    }
    // User chose 'Cancel', or an error occurred, fail the call
    return NULL;
}

BOOL CreateBlankNewFormatIcon ( ICONIMAGE * pii )

Definition at line 1175 of file Icons.C.

{
    DWORD            dwFinalSize = 0;
    BITMAPINFOHEADER bmih        = {0};

    // Fill in the bitmap header
    ZeroMemory( &bmih, sizeof( BITMAPINFOHEADER ) );
    bmih.biSize = sizeof( BITMAPINFOHEADER );
    bmih.biBitCount = (WORD)pii->Colors;
    bmih.biClrUsed = 0;

    // How big will the final thing be?
    // Well, it'll have a header
    dwFinalSize = sizeof( BITMAPINFOHEADER );
    // and a color table (even if it's zero length)
    dwFinalSize += PaletteSize( (PSTR)&bmih );
    // and XOR bits
    dwFinalSize += pii->Height * WIDTHBYTES( pii->Width * pii->Colors );
    // and AND bits. That's about it :)
    dwFinalSize += pii->Height * WIDTHBYTES( pii->Width );

    // Allocate some memory for it
    pii->pBits = malloc( dwFinalSize );
    ZeroMemory( pii->pBits, dwFinalSize );
    pii->dwNumBytes = dwFinalSize;
    pii->pbi = (PBITMAPINFO)(pii->pBits);
    pii->pXOR = (PBYTE)(pii->pbi) + sizeof(BITMAPINFOHEADER) + PaletteSize( (PSTR)&bmih );
    pii->pAND = pii->pXOR + (pii->Height * WIDTHBYTES( pii->Width * pii->Colors ));

    // The bitmap header is zeros, fill it out
    pii->pbi->bmiHeader.biSize = sizeof( BITMAPINFOHEADER );
    pii->pbi->bmiHeader.biWidth = pii->Width;
    // Don't forget the funky height*2 icon resource thing
    pii->pbi->bmiHeader.biHeight = pii->Height * 2;
    pii->pbi->bmiHeader.biPlanes = 1;
    pii->pbi->bmiHeader.biBitCount = (WORD)pii->Colors;
    pii->pbi->bmiHeader.biCompression = BI_RGB;

    return TRUE;
}

BOOL DIBToIconImage | ( | ICONIMAGE * | pii,
 |  | PBYTE | pDIB,
 |  | BOOL | bStretch
 | ) |  |

Definition at line 1106 of file Icons.C.

{
    PBYTE pNewDIB = NULL;

    // Sanity check
    if( pDIB == NULL )
    {
        return FALSE;
    }

    // Let the DIB engine convert color depths if need be
    pNewDIB = ConvertDIBFormat( (PBITMAPINFO)pDIB, pii->Width, pii->Height, pii->Colors, bStretch );

    // Now we have a cool new DIB of the proper size/color depth
    // Lets poke it into our data structures and be done with it

    // How big is it?
    pii->dwNumBytes = sizeof( BITMAPINFOHEADER )                        // Header
                    + PaletteSize( (PSTR)pNewDIB )                      // Palette
                    + pii->Height * BytesPerLine( (PBITMAPINFOHEADER)pNewDIB )  // XOR mask
                    + pii->Height * WIDTHBYTES( pii->Width );           // AND mask

    // If there was already an image here, free it
    if( pii->pBits != NULL )
    {
        free( pii->pBits );
    }

    // Allocate enough room for the new image
    if( (pii->pBits = malloc( pii->dwNumBytes )) == NULL )
    {
        free( pii );
        return FALSE;
    }
    // Copy the bits
    memcpy( pii->pBits, pNewDIB, sizeof( BITMAPINFOHEADER ) + PaletteSize( (PSTR)pNewDIB ) );
    // Adjust internal pointers/variables for new image
    pii->pbi = (PBITMAPINFO)(pii->pBits);
    pii->pbi->bmiHeader.biHeight *= 2;
    pii->pXOR = (PBYTE)FindDIBBits( (PSTR)(pii->pBits) );
    memcpy( pii->pXOR, FindDIBBits((PSTR)pNewDIB), pii->Height * BytesPerLine( (PBITMAPINFOHEADER)pNewDIB ) );
    pii->pAND = pii->pXOR + pii->Height * BytesPerLine( (PBITMAPINFOHEADER)pNewDIB );
    memset( pii->pAND, 0, pii->Height * WIDTHBYTES( pii->Width ) );
    // Free the source
    free( pNewDIB );
    return TRUE;
}

BOOL DrawANDMask | ( | HDC | hDC,
 |  | RECT | Rect,
 |  | ICONIMAGE * | pIcon
 | ) |  |

Definition at line 1326 of file Icons.C.

{
    PBITMAPINFO pbi = NULL;
    int         x, y;
    BOOL        bSuccess = TRUE;

    // Sanity checks
    if( pIcon == NULL )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    if( pIcon->pBits == NULL )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    // Need a bitmap header for the mono mask
    pbi = malloc( sizeof(BITMAPINFO) + (2 * sizeof( RGBQUAD )) );
    pbi->bmiHeader.biSize = sizeof( BITMAPINFOHEADER );
    pbi->bmiHeader.biWidth = pIcon->pbi->bmiHeader.biWidth;
    pbi->bmiHeader.biHeight = pIcon->pbi->bmiHeader.biHeight/2;
    pbi->bmiHeader.biPlanes = 1;
    pbi->bmiHeader.biBitCount = 1;
    pbi->bmiHeader.biCompression = BI_RGB;
    pbi->bmiHeader.biSizeImage = 0;
    pbi->bmiHeader.biXPelsPerMeter = 0;
    pbi->bmiHeader.biYPelsPerMeter = 0;
    pbi->bmiHeader.biClrUsed = 0;
    pbi->bmiHeader.biClrImportant = 0;
    pbi->bmiColors[0].rgbRed = 0;
    pbi->bmiColors[0].rgbGreen = 0;
    pbi->bmiColors[0].rgbBlue = 0;
    pbi->bmiColors[0].rgbReserved = 0;
    pbi->bmiColors[1].rgbRed = 255;
    pbi->bmiColors[1].rgbGreen = 255;
    pbi->bmiColors[1].rgbBlue = 255;
    pbi->bmiColors[1].rgbReserved = 0;

    // Locate it
    x = Rect.left + ((RectWidth(Rect)-pbi->bmiHeader.biWidth)/2);
    y = Rect.top + ((RectHeight(Rect)-pbi->bmiHeader.biHeight)/2);

    // Blast it to the screen
    SetDIBitsToDevice( hDC, x, y, pbi->bmiHeader.biWidth, pbi->bmiHeader.biHeight, 0, 0, 0, pbi->bmiHeader.biHeight, pIcon->pAND, pbi, DIB_RGB_COLORS );

    // clean up
    free( pbi );

exit_func:
    return bSuccess;
}

BOOL DrawXORMask | ( | HDC | hDC,
 |  | RECT | Rect,
 |  | ICONIMAGE * | pIcon
 | ) |  |

Definition at line 1272 of file Icons.C.

{
    int x, y;

    // Sanity checks
    if( pIcon == NULL )
    {
        return FALSE;
    }

    if( pIcon->pBits == NULL )
    {
        return FALSE;
    }

    // Account for height*2 thing
    pIcon->pbi->bmiHeader.biHeight /= 2;

    // Locate it
    x = Rect.left + ((RectWidth(Rect)-pIcon->pbi->bmiHeader.biWidth)/2);
    y = Rect.top + ((RectHeight(Rect)-pIcon->pbi->bmiHeader.biHeight)/2);

    // Blast it to the screen
    SetDIBitsToDevice( hDC, x, y, pIcon->pbi->bmiHeader.biWidth, pIcon->pbi->bmiHeader.biHeight, 0, 0, 0, pIcon->pbi->bmiHeader.biHeight, pIcon->pXOR, pIcon->pbi, DIB_RGB_COLORS );

    // UnAccount for height*2 thing
    pIcon->pbi->bmiHeader.biHeight *= 2;

    return TRUE;
}

BOOL CALLBACK ExtractDlgProc | ( | HWND | hWnd,
 |  | UINT | Msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 494 of file Icons.C.

{
    // Variable that holds info on this EXE/DLL
    static PEXEDLLICONINFO pEDII;

    switch( Msg )
    {
        // During Paint, we will draw the currently selected icon
        case WM_PAINT:
            {
                HDC         hDC      = NULL;
                PAINTSTRUCT ps       = {0};
                DWORD       nIndex;
                PTSTR       pIconID  = NULL;

                hDC = BeginPaint( hWnd, &ps );
                // Get the current selection
                if( (nIndex = (DWORD)SendDlgItemMessage( hWnd, IDC_LIST1, LB_GETCURSEL, 0, 0 )) != CB_ERR )
                {
                    // Get the data associated with the current selection - its the icon name
                    if( (pIconID = (PTSTR)SendDlgItemMessage( hWnd, IDC_LIST1, LB_GETITEMDATA, nIndex, 0 )) != (PTSTR)CB_ERR )
                    {
                        RECT        Rect       = {0};
                        RECT        ButtonRect = {0};
                        RECT        DlgRect    = {0};
                        HWND        hWndButton = NULL;
                        HICON     hIcon      = NULL;
                        ICONINFO    IconInfo   = {0};
                        BITMAP      bm         = {0};
                        POINT     UpperLeft  = {0};
                        POINT       LowerRight = {0};

                        // Make an Icon
                        hIcon = GetIconFromInstance( pEDII->hInstance, pIconID );
                        // Locate the icon
                        GetIconInfo( hIcon, &IconInfo );
                        GetObject( IconInfo.hbmColor, sizeof(BITMAP), &bm );
                        hWndButton = GetDlgItem( hWnd, IDCANCEL );
                        GetWindowRect( hWndButton, &ButtonRect );
                        GetWindowRect( hWnd, &DlgRect );
                        UpperLeft.x = ButtonRect.left;
                        UpperLeft.y = ButtonRect.bottom;
                        LowerRight.x = ButtonRect.right;
                        LowerRight.y = DlgRect.bottom;
                        ScreenToClient( hWnd, &UpperLeft );
                        ScreenToClient( hWnd, &LowerRight );
                        SetRect( &Rect, UpperLeft.x, UpperLeft.y, LowerRight.x, LowerRight.y );
                        // Draw it
                        DrawIcon( hDC, Rect.left + ((Rect.right - Rect.left - bm.bmWidth)/2),
                                Rect.top + ((Rect.bottom - Rect.top - bm.bmHeight)/2), hIcon );
                        // Kill it
                        DestroyIcon( hIcon );
                    }
                }
                EndPaint( hWnd, &ps );
            }
            break; // End WM_PAINT

        // Dialog is being initialized
        case WM_INITDIALOG:
            {
                UINT    nCount;
                TCHAR szBuffer[MAX_PATH]    = {0};
                TCHAR   szFileTitle[MAX_PATH] = {0};

                // Are we being sent data about an EXE/DLL?
                if( (pEDII = (PEXEDLLICONINFO)lParam) != NULL )
                {
                    // Set the title of the dialog to reflect the EXE/DLL filename
                    GetFileTitle( pEDII->szFileName, szFileTitle, MAX_PATH );
                    wsprintf( szBuffer, TEXT("Extract Icon [%s]"), szFileTitle );
                    SetWindowText( hWnd, szBuffer );
                    // Fill in the listbox with the icons available
                    if( ! EnumResourceNames( pEDII->hInstance, RT_GROUP_ICON, MyEnumProcedure, (LPARAM)hWnd ) )
                    {
                        MessageBox( hWnd, TEXT("Error Enumerating Icons"), TEXT("Error"), MB_OK );
                        PostMessage( hWnd, WM_CLOSE, 0, 0 );
                    }
                    SendDlgItemMessage( hWnd, IDC_LIST1, LB_SETCURSEL, 0, 0 );
                    // If we have <= 1, post an OK message
                    if( (nCount = (UINT)SendDlgItemMessage(hWnd, IDC_LIST1, LB_GETCOUNT, 0, 0)) == 1 )
                    {
                        PostMessage( hWnd, WM_COMMAND, IDOK, 0 );
                    }
                    // If there were no icons, let the user know
                    if( nCount == 0 )
                    {
                        MessageBox( hWnd, TEXT("No Icons in this File"), TEXT("Error"), MB_OK );
                        PostMessage( hWnd, WM_CLOSE, 0, 0 );
                    }
                }
                return FALSE;
            }
            break; // End WM_INITDIALOG

        // Shut 'er down
        case WM_CLOSE:
            PostMessage( hWnd, WM_COMMAND, IDCANCEL, 0l );
            break; // End WM_CLOSE

        // Children are sending messages
        case WM_COMMAND:
            switch( LOWORD(wParam) )
            {
                // Its the listbox, just redraw the icon
                case IDC_LIST1:
                    switch( HIWORD(wParam) )
                    {
                        case CBN_SELCHANGE: /* fall-through */
                        case CBN_SELENDOK:
                            InvalidateRect( hWnd, NULL, TRUE );
                        break;
                    }
                    break; // End IDC_LIST1

                // User has chosen an icon, shut it down
                case IDOK:
                    {
                        LONG nIndex;

                        pEDII->pID = NULL;
                        if( (nIndex = (LONG)SendDlgItemMessage( hWnd, IDC_LIST1, LB_GETCURSEL, 0, 0 )) != LB_ERR )
                            pEDII->pID = (PTSTR)SendDlgItemMessage( hWnd, IDC_LIST1, LB_GETITEMDATA, nIndex, 0 );
                        EndDialog( hWnd, TRUE );
                    }
                    break; // End IDOK

                // BAIL!
                case IDCANCEL:
                    EndDialog( hWnd, FALSE );
                    break; // End IDCANCEL
            }
            break;

        default:
            return FALSE;
            break;
    }
    return TRUE;
}

HICON GetIconFromInstance | ( | HINSTANCE | hInstance,
 |  | PTSTR | nIndex
 | ) |  |

Definition at line 443 of file Icons.C.

{
    HICON hIcon   = NULL;
    HRSRC hRsrc   = NULL;
    HGLOBAL hGlobal = NULL;
    PVOID pRes    = NULL;
    int     nID;

    // Find the group icon
    if( (hRsrc = FindResource( hInstance, nIndex, RT_GROUP_ICON )) == NULL )
        return NULL;
    if( (hGlobal = LoadResource( hInstance, hRsrc )) == NULL )
        return NULL;
    if( (pRes = LockResource(hGlobal)) == NULL )
        return NULL;

    // Find this particular image
    nID = LookupIconIdFromDirectory( pRes, TRUE );
    if( (hRsrc = FindResource( hInstance, MAKEINTRESOURCE(nID), RT_ICON )) == NULL )
        return NULL;
    if( (hGlobal = LoadResource( hInstance, hRsrc )) == NULL )
        return NULL;
    if( (pRes = LockResource(hGlobal)) == NULL )
        return NULL;
    // Let the OS make us an icon
    hIcon = CreateIconFromResource( pRes, SizeofResource(hInstance,hRsrc), TRUE, 0x00030000 );
    return hIcon;
}

RECT GetXORImageRect | ( | RECT | Rect,
 |  | ICONIMAGE * | pIcon
 | ) |  |

Definition at line 1235 of file Icons.C.

{
    RECT NewRect = {0};

    // Just center the thing in the bounding display rect
    NewRect.left = Rect.left + ((RectWidth(Rect)-pIcon->pbi->bmiHeader.biWidth)/2);
    NewRect.top = Rect.top + ((RectHeight(Rect)-(pIcon->pbi->bmiHeader.biHeight/2))/2);
    NewRect.bottom = NewRect.top + (pIcon->pbi->bmiHeader.biHeight/2);
    NewRect.right = NewRect.left + pIcon->pbi->bmiHeader.biWidth;
    return NewRect;
}

BOOL IconImageFromBMPFile | ( | PCTSTR | szFileName,
 |  | ICONIMAGE * | pii,
 |  | BOOL | bStretchToFit
 | ) |  |

Definition at line 1508 of file Icons.C.

{
    PBYTE   pDIB = NULL;
    BOOL    bRet = FALSE;

    if( (pDIB=ReadBMPFile(szFileName)) == NULL )
    {
        return FALSE;
    }

    // Convert it to an icon image
    bRet = DIBToIconImage( pii, pDIB, bStretchToFit );
    free( pDIB );
    return bRet;
}

BOOL IconImageFromClipBoard | ( | ICONIMAGE * | pii,
 |  | BOOL | bStretchToFit
 | ) |  |

Definition at line 1059 of file Icons.C.

{
    PBITMAPINFO pbi         = NULL;
    HANDLE      hClipGlobal = NULL;
    BOOL        bRet        = FALSE;

    // Open the clipboard
    if( OpenClipboard( hWndMain ) )
    {
        // Get the CF_DIB data from it
        if( (hClipGlobal = GetClipboardData( CF_DIB )) != NULL )
        {
            // Lock it down
            if( (pbi=GlobalLock(hClipGlobal)) != NULL )
            {
                // Convert it to an icon image
                bRet = DIBToIconImage( pii, (PBYTE)pbi, bStretchToFit );
                GlobalUnlock( hClipGlobal );
            }
        }
        CloseClipboard();
    }
    return bRet;
}

BOOL IconImageToBMPFile | ( | PCTSTR | szFileName,
 |  | ICONIMAGE * | pii
 | ) |  |

Definition at line 1546 of file Icons.C.

{
    return WriteBMPFile( szFileName, (PBYTE)pii->pbi );
}

BOOL IconImageToClipBoard ( ICONIMAGE * pii )

Definition at line 1011 of file Icons.C.

{
    HANDLE hGlobal = NULL;
    PSTR   pBits   = NULL;

    // Open the clipboard
    if( OpenClipboard( hWndMain ) )
    {
        // empty it
        if( EmptyClipboard() )
        {
            // Make a buffer to send to clipboard
            hGlobal = GlobalAlloc( GMEM_MOVEABLE | GMEM_DDESHARE, pii->dwNumBytes );
            pBits = GlobalLock( hGlobal );
            // Copy the bits to the buffer
            memcpy( pBits, pii->pBits, pii->dwNumBytes );
            // Adjust for funky height*2 thing
            ((PBITMAPINFOHEADER)pBits)->biHeight /= 2;
            GlobalUnlock( hGlobal );
            // Send it to the clipboard
            SetClipboardData( CF_DIB, hGlobal );
            CloseClipboard();
            return TRUE;
        }
    }
    return FALSE;
}

HICON MakeIconFromResource ( ICONIMAGE * pIcon )

Definition at line 106 of file Icons.C.

{
    HICON  hIcon = NULL;

    // Sanity Check
    if( pIcon == NULL )
    {
        return NULL;
    }

    if( pIcon->pBits == NULL )
    {
        return NULL;
    }

    // Let the OS do the real work :)
    hIcon = CreateIconFromResourceEx( pIcon->pBits, pIcon->dwNumBytes, TRUE, 0x00030000,
            (*(PBITMAPINFOHEADER)(pIcon->pBits)).biWidth, (*(PBITMAPINFOHEADER)(pIcon->pBits)).biHeight/2, 0 );

    // It failed, odds are good we're on NT so try the non-Ex way
    if( hIcon == NULL )
    {
        // We would break on NT if we try with a 16bpp image
        if(pIcon->pbi->bmiHeader.biBitCount != 16)
        {
            hIcon = CreateIconFromResource( pIcon->pBits, pIcon->dwNumBytes, TRUE, 0x00030000 );
        }
    }
    return hIcon;
}

BOOL MakeNewANDMaskBasedOnPoint | ( | ICONIMAGE * | pIcon,
 |  | POINT | pt
 | ) |  |

Definition at line 1408 of file Icons.C.

{
    HBITMAP     hXORBitmap          = NULL;
    HBITMAP     hOldXORBitmap       = NULL;
    HDC         hDC                 = NULL;
    HDC         hMemDC1             = NULL;
    PBYTE       pXORBits            = NULL;
    COLORREF    crTransparentColor  = {0};
    LONG        i,j;

    // Account for height*2 thing
    pIcon->pbi->bmiHeader.biHeight /= 2;

    // Need a DC
    hDC = GetDC( NULL );

    // Use DIBSection for source
    hXORBitmap = CreateDIBSection( hDC, pIcon->pbi, DIB_RGB_COLORS, &pXORBits, NULL, 0  );
    memcpy( pXORBits, pIcon->pXOR, (pIcon->pbi->bmiHeader.biHeight) * BytesPerLine((PBITMAPINFOHEADER)(pIcon->pbi)) );
    hMemDC1 = CreateCompatibleDC( hDC );
    hOldXORBitmap = SelectObject( hMemDC1, hXORBitmap );

    // Set the color table if need be
    if( pIcon->pbi->bmiHeader.biBitCount <= 8 )
    {
        SetDIBColorTable( hMemDC1, 0, DIBNumColors((PSTR)(pIcon->pbi)), pIcon->pbi->bmiColors);
    }

    // What's the transparent color?
    crTransparentColor = GetPixel( hMemDC1, pt.x, pt.y );

    // Loop through the pixels
    for(i=0;i<pIcon->pbi->bmiHeader.biWidth;i++)
    {
        for(j=0;j<pIcon->pbi->bmiHeader.biHeight;j++)
        {
            // Is the source transparent at this point?
            if( GetPixel( hMemDC1, i, j ) == crTransparentColor )
            {
                // Yes, so set the pixel in AND mask, and clear it in XOR mask
                SetMonoDIBPixel( pIcon->pAND, pIcon->pbi->bmiHeader.biWidth,
                                 pIcon->pbi->bmiHeader.biHeight, i, j, TRUE );
                if( pIcon->pbi->bmiHeader.biBitCount == 1 )
                {
                    SetMonoDIBPixel( pXORBits, pIcon->pbi->bmiHeader.biWidth,
                                     pIcon->pbi->bmiHeader.biHeight, i, j, FALSE );
                }
                else
                {
                    SetPixelV( hMemDC1, i, j, RGB(0,0,0) );
                }
            }
            else
            {
                // No, so clear pixel in AND mask
                SetMonoDIBPixel( pIcon->pAND, pIcon->pbi->bmiHeader.biWidth, pIcon->pbi->bmiHeader.biHeight, i, j, FALSE );
            }
        }
    }
    // Flush the SetPixelV() calls
    GdiFlush();

    SelectObject( hMemDC1, hOldXORBitmap );

    // Copy the new XOR bits back to our storage
    memcpy( pIcon->pXOR, pXORBits, (pIcon->pbi->bmiHeader.biHeight) * BytesPerLine((PBITMAPINFOHEADER)(pIcon->pbi)) );

    // Clean up
    DeleteObject( hXORBitmap );
    DeleteDC( hMemDC1 );
    ReleaseDC( NULL, hDC );

    // UnAccount for height*2 thing
    pIcon->pbi->bmiHeader.biHeight *= 2;
    return TRUE;
}

BOOL CALLBACK MyEnumProcedure | ( | HANDLE | hModule,
 |  | PCTSTR | pszType,
 |  | PTSTR | pszName,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 396 of file Icons.C.

{
    TCHAR szBuffer[256] = {0};
    LONG    nIndex        = LB_ERR;
    PTSTR pID           = NULL;

    // Name is from MAKEINTRESOURCE()
    if( HIWORD(pszName) == 0 )
    {
        wsprintf( szBuffer, TEXT("Icon [%d]"), (DWORD_PTR)pszName );
        pID = pszName;
    }
    else
    {
        // Name is string
        pID = _tcsdup( pszName );
        wsprintf( szBuffer, TEXT("Icon [%s]"), pID );
    }
    // Add it to the listbox
    nIndex = (LONG)SendDlgItemMessage( (HWND)lParam, IDC_LIST1, LB_ADDSTRING, 0, (LPARAM)(szBuffer) );
    // Set the item data to be the name of the resource so we can get it later
    SendDlgItemMessage( (HWND)lParam, IDC_LIST1, LB_SETITEMDATA, (WPARAM)nIndex, (LPARAM)pID );
    return TRUE;
}

UINT ReadICOHeader ( HANDLE hFile )

Definition at line 341 of file Icons.C.

{
    WORD    Input;
    DWORD dwBytesRead;

    // Read the 'reserved' WORD
    if( ! ReadFile( hFile, &Input, sizeof( WORD ), &dwBytesRead, NULL ) )
        return (UINT)-1;
    // Did we get a WORD?
    if( dwBytesRead != sizeof( WORD ) )
        return (UINT)-1;
    // Was it 'reserved' ?   (ie 0)
    if( Input != 0 )
        return (UINT)-1;
    // Read the type WORD
    if( ! ReadFile( hFile, &Input, sizeof( WORD ), &dwBytesRead, NULL ) )
        return (UINT)-1;
    // Did we get a WORD?
    if( dwBytesRead != sizeof( WORD ) )
        return (UINT)-1;
    // Was it type 1?
    if( Input != 1 )
        return (UINT)-1;
    // Get the count of images
    if( ! ReadFile( hFile, &Input, sizeof( WORD ), &dwBytesRead, NULL ) )
        return (UINT)-1;
    // Did we get a WORD?
    if( dwBytesRead != sizeof( WORD ) )
        return (UINT)-1;
    // Return the count
    return Input;
}

ICONRESOURCE* ReadIconFromEXEFile ( PCTSTR szFileName )

Definition at line 689 of file Icons.C.

{
    ICONRESOURCE*  pIR      = NULL;
    HINSTANCE      hLibrary = NULL;
    PTSTR          pID      = NULL;
    EXEDLLICONINFO EDII     = {0};

    // Load the DLL/EXE - NOTE: must be a 32bit EXE/DLL for this to work
    if( (hLibrary = LoadLibraryEx( szFileName, NULL, LOAD_LIBRARY_AS_DATAFILE )) == NULL )
    {
        // Failed to load - abort
        MessageBox( hWndMain, TEXT("Error Loading File - Choose a 32bit DLL or EXE"), szFileName, MB_OK );
        return NULL;
    }
    // Store the info
    EDII.szFileName = szFileName;
    EDII.hInstance = hLibrary;
    // Ask the user, "Which Icon?"
    if( (pID = ChooseIconFromEXEFile( &EDII )) != NULL )
    {
        HRSRC       hRsrc   = NULL;
        HGLOBAL     hGlobal = NULL;
        MEMICONDIR* pIcon   = NULL;
        UINT        i;

        // Find the group icon resource
        if( (hRsrc = FindResource( hLibrary, pID, RT_GROUP_ICON )) == NULL )
        {
            FreeLibrary( hLibrary );
            return NULL;
        }
        if( (hGlobal = LoadResource( hLibrary, hRsrc )) == NULL )
        {
            FreeLibrary( hLibrary );
            return NULL;
        }
        if( (pIcon = LockResource(hGlobal)) == NULL )
        {
            FreeLibrary( hLibrary );
            return NULL;
        }
        // Allocate enough memory for the images
        if( (pIR = malloc( sizeof(ICONRESOURCE) + ((pIcon->idCount-1) * sizeof(ICONIMAGE)) )) == NULL )
        {
            MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
            FreeLibrary( hLibrary );
            return NULL;
        }
        // Fill in local struct members
        pIR->nNumImages = pIcon->idCount;
        lstrcpyn( pIR->szOriginalDLLFileName, szFileName, MAX_PATH - 1 );
        lstrcpyn( pIR->szOriginalICOFileName, TEXT(""), MAX_PATH - 1 );
        // Loop through the images
        for( i = 0; i < pIR->nNumImages; i++ )
        {
            // Get the individual image
            if( (hRsrc = FindResource( hLibrary, MAKEINTRESOURCE(pIcon->idEntries[i].nID), RT_ICON )) == NULL )
            {
                free( pIR );
                FreeLibrary( hLibrary );
                return NULL;
            }
            if( (hGlobal = LoadResource( hLibrary, hRsrc )) == NULL )
            {
                free( pIR );
                FreeLibrary( hLibrary );
                return NULL;
            }
            // Store a copy of the resource locally
            pIR->IconImages[i].dwNumBytes = SizeofResource( hLibrary, hRsrc );
            pIR->IconImages[i].pBits = malloc( pIR->IconImages[i].dwNumBytes );
            memcpy( pIR->IconImages[i].pBits, LockResource( hGlobal ), pIR->IconImages[i].dwNumBytes );
            // Adjust internal pointers
            if( ! AdjustIconImagePointers( &(pIR->IconImages[i]) ) )
            {
                MessageBox( hWndMain, TEXT("Error Converting to Internal Format"), szFileName, MB_OK );
                free( pIR );
                FreeLibrary( hLibrary );
                return NULL;
            }
        }
    }
    FreeLibrary( hLibrary );
    return pIR;
}

ICONRESOURCE* ReadIconFromICOFile ( PCTSTR szFileName )

Definition at line 157 of file Icons.C.

{
    ICONRESOURCE*       pIR = NULL;
    ICONRESOURCE*       pNew = NULL;
    HANDLE              hFile = NULL;
    PRESOURCEPOSINFO    pRPI = NULL;
    UINT                i;
    DWORD             dwBytesRead;
    ICONDIRENTRY*       pIDE = NULL;

    // Open the file
    if( (hFile = CreateFile( szFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL )) == INVALID_HANDLE_VALUE )
    {
        MessageBox( hWndMain, TEXT("Error Opening File for Reading"), szFileName, MB_OK );
        return NULL;
    }
    // Allocate memory for the resource structure
    if( (pIR = malloc( sizeof(ICONRESOURCE) )) == NULL )
    {
        MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
        CloseHandle( hFile );
        return NULL;
    }
    // Read in the header
    if( (pIR->nNumImages = ReadICOHeader( hFile )) == (UINT)-1 )
    {
        MessageBox( hWndMain, TEXT("Error Reading File Header"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    // Adjust the size of the struct to account for the images
    if( (pNew = realloc( pIR, sizeof(ICONRESOURCE) + ((pIR->nNumImages-1) * sizeof(ICONIMAGE)) )) == NULL )
    {
        MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    pIR = pNew;
    // Store the original name
    lstrcpyn( pIR->szOriginalICOFileName, szFileName, MAX_PATH - 1);
    lstrcpyn( pIR->szOriginalDLLFileName, TEXT(""), MAX_PATH - 1 );
    // Allocate enough memory for the icon directory entries
    if( (pIDE = malloc( pIR->nNumImages * sizeof( ICONDIRENTRY ) ) ) == NULL )
    {
        MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    // Read in the icon directory entries
    if( ! ReadFile( hFile, pIDE, pIR->nNumImages * sizeof( ICONDIRENTRY ), &dwBytesRead, NULL ) )
    {
        MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    if( dwBytesRead != pIR->nNumImages * sizeof( ICONDIRENTRY ) )
    {
        MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    // Loop through and read in each image
    for( i = 0; i < pIR->nNumImages; i++ )
    {
        // Allocate memory for the resource
        if( (pIR->IconImages[i].pBits = malloc(pIDE[i].dwBytesInRes)) == NULL )
        {
            MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIR );
            free( pIDE );
            return NULL;
        }
        pIR->IconImages[i].dwNumBytes = pIDE[i].dwBytesInRes;
        // Seek to beginning of this image
        if( SetFilePointer( hFile, pIDE[i].dwImageOffset, NULL, FILE_BEGIN ) == INVALID_SET_FILE_POINTER )
        {
            MessageBox( hWndMain, TEXT("Error Seeking in File"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIR );
            free( pIDE );
            return NULL;
        }
        // Read it in
        if( ! ReadFile( hFile, pIR->IconImages[i].pBits, pIDE[i].dwBytesInRes, &dwBytesRead, NULL ) )
        {
            MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIR );
            free( pIDE );
            return NULL;
        }
        if( dwBytesRead != pIDE[i].dwBytesInRes )
        {
            MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIDE );
            free( pIR );
            return NULL;
        }
        // Set the internal pointers appropriately
        if( ! AdjustIconImagePointers( &(pIR->IconImages[i]) ) )
        {
            MessageBox( hWndMain, TEXT("Error Converting to Internal Format"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIDE );
            free( pIR );
            return NULL;
        }
    }
    // Clean up
    free( pIDE );
    free( pRPI );
    CloseHandle( hFile );
    return pIR;
}

BOOL WriteICOHeader | ( | HANDLE | hFile,
 |  | UINT | nNumEntries
 | ) |  |

Definition at line 794 of file Icons.C.

{
    WORD    Output;
    DWORD dwBytesWritten;
    BOOL    bRet = TRUE;

    // Write 'reserved' WORD
    Output = 0;
    if( ! WriteFile( hFile, &Output, sizeof( WORD ), &dwBytesWritten, NULL ) )
    {
        bRet = FALSE;
        goto exit_func;
    }

    // Did we write a WORD?
    if( dwBytesWritten != sizeof( WORD ) )
    {
        bRet = FALSE;
        goto exit_func;
    }

    // Write 'type' WORD (1)
    Output = 1;
    if( ! WriteFile( hFile, &Output, sizeof( WORD ), &dwBytesWritten, NULL ) )
    {
        bRet = FALSE;
        goto exit_func;
    }

    // Did we write a WORD?
    if( dwBytesWritten != sizeof( WORD ) )
    {
        bRet = FALSE;
        goto exit_func;
    }

    // Write Number of Entries
    Output = (WORD)nNumEntries;
    if( ! WriteFile( hFile, &Output, sizeof( WORD ), &dwBytesWritten, NULL ) )
    {
        bRet = FALSE;
        goto exit_func;
    }

    // Did we write a WORD?
    if( dwBytesWritten != sizeof( WORD ) )
    {
        bRet = FALSE;
        goto exit_func;
    }

exit_func:
    return bRet;
}

BOOL WriteIconToICOFile | ( | ICONRESOURCE * | pIR,
 |  | PCTSTR | szFileName
 | ) |  |

Definition at line 908 of file Icons.C.

{
    HANDLE hFile = NULL;
    UINT   i;
    DWORD  dwBytesWritten;
    BOOL   bSuccess = TRUE;

    // open the file
    if( (hFile = CreateFile( szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL )) == INVALID_HANDLE_VALUE )
    {
        MessageBox( hWndMain, TEXT("Error Opening File for Writing"), szFileName, MB_OK );
        bSuccess = FALSE;
        goto exit_func;
    }

    // Write the header
    if( ! WriteICOHeader( hFile, pIR->nNumImages ) )
    {
        MessageBox( hWndMain, TEXT("Error Writing ICO File"), szFileName, MB_OK );
        CloseHandle( hFile );
        bSuccess = FALSE;
        goto exit_func;
    }

    // Write the ICONDIRENTRY's
    for( i=0; i<pIR->nNumImages; i++ )
    {
        ICONDIRENTRY ide = {0};

        // Convert internal format to ICONDIRENTRY
        ide.bWidth = (BYTE)pIR->IconImages[i].Width;
        ide.bHeight = (BYTE)pIR->IconImages[i].Height;
        ide.wPlanes = pIR->IconImages[i].pbi->bmiHeader.biPlanes;
        ide.wBitCount = pIR->IconImages[i].pbi->bmiHeader.biBitCount;
        if( (ide.wPlanes * ide.wBitCount) >= 8 )
        {
            ide.bColorCount = 0;
        }
        else
        {
            ide.bColorCount = (BYTE)(1 << (ide.wPlanes * ide.wBitCount));
        }
        ide.dwBytesInRes = pIR->IconImages[i].dwNumBytes;
        ide.dwImageOffset = CalculateImageOffset( pIR, i );
        // Write the ICONDIRENTRY out to disk
        if( ! WriteFile( hFile, &ide, sizeof( ICONDIRENTRY ), &dwBytesWritten, NULL ) )
        {
            bSuccess = FALSE;
            goto exit_func;
        }
        // Did we write a full ICONDIRENTRY ?
        if( dwBytesWritten != sizeof( ICONDIRENTRY ) )
        {
            bSuccess = FALSE;
            goto exit_func;
        }
    }
    // Write the image bits for each image
    for( i=0; i<pIR->nNumImages; i++ )
    {
        DWORD dwTemp = pIR->IconImages[i].pbi->bmiHeader.biSizeImage;

        // Set the sizeimage member to zero
        pIR->IconImages[i].pbi->bmiHeader.biSizeImage = 0;
        // Write the image bits to file
        if( ! WriteFile( hFile, pIR->IconImages[i].pBits, pIR->IconImages[i].dwNumBytes, &dwBytesWritten, NULL ) )
        {
            bSuccess = FALSE;
            goto exit_func;
        }

        if( dwBytesWritten != pIR->IconImages[i].dwNumBytes )
        {
            bSuccess = FALSE;
            goto exit_func;
        }
        // set it back
        pIR->IconImages[i].pbi->bmiHeader.biSizeImage = dwTemp;
    }
    CloseHandle( hFile );

exit_func:
    return bSuccess;
}

Variable Documentation

HINSTANCE hInst

Definition at line 37 of file Demo.c.

HWND hWndMain

Definition at line 40 of file halftone.c.

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Icons.h File Reference

  • WinUI
  • Resource
  • Iconpro
Classes | Typedefs | Functions

Icons.h File Reference

#include <windows.h>

Go to the source code of this file.

Classes

struct | ICONDIR
struct | ICONDIRENTRY
struct | ICONIMAGE
struct | ICONRESOURCE
struct | MEMICONDIR
struct | MEMICONDIRENTRY

Typedefs

typedef struct ICONDIR * | PICONDIR
typedef struct ICONDIRENTRY * | PICONDIRENTRY
typedef struct ICONIMAGE * | PICONIMAGE
typedef struct ICONRESOURCE * | PICONRESOURCE
typedef struct MEMICONDIR * | PMEMICONDIR
typedef struct MEMICONDIRENTRY * | PMEMICONDIRENTRY

Functions

BOOL | CreateBlankNewFormatIcon (PICONIMAGE pii)
BOOL | DrawANDMask (HDC hDC, RECT Rect, PICONIMAGE pIcon)
BOOL | DrawXORMask (HDC hDC, RECT Rect, PICONIMAGE pIcon)
RECT | GetXORImageRect (RECT Rect, PICONIMAGE pIcon)
BOOL | IconImageFromBMPFile (PCTSTR szFileName, PICONIMAGE pii, BOOL bStretchToFit)
BOOL | IconImageFromClipBoard (PICONIMAGE pii, BOOL bStretchToFit)
BOOL | IconImageToBMPFile (PCTSTR szFileName, PICONIMAGE pii)
BOOL | IconImageToClipBoard (PICONIMAGE pii)
HICON | MakeIconFromResource (PICONIMAGE pIcon)
BOOL | MakeNewANDMaskBasedOnPoint (PICONIMAGE pIcon, POINT pt)
PICONRESOURCE | ReadIconFromEXEFile (PCTSTR szFileName)
PICONRESOURCE | ReadIconFromICOFile (PCTSTR szFileName)
BOOL | WriteIconToICOFile (PICONRESOURCE pIR, PCTSTR szFileName)

Typedef Documentation

typedef struct ICONDIR * PICONDIR
typedef struct ICONDIRENTRY * PICONDIRENTRY
typedef struct ICONIMAGE * PICONIMAGE
typedef struct ICONRESOURCE * PICONRESOURCE
typedef struct MEMICONDIR * PMEMICONDIR
typedef struct MEMICONDIRENTRY * PMEMICONDIRENTRY

Function Documentation

BOOL CreateBlankNewFormatIcon ( PICONIMAGE pii )
BOOL DrawANDMask | ( | HDC | hDC,
 |  | RECT | Rect,
 |  | PICONIMAGE | pIcon
 | ) |  |
BOOL DrawXORMask | ( | HDC | hDC,
 |  | RECT | Rect,
 |  | PICONIMAGE | pIcon
 | ) |  |
RECT GetXORImageRect | ( | RECT | Rect,
 |  | PICONIMAGE | pIcon
 | ) |  |
BOOL IconImageFromBMPFile | ( | PCTSTR | szFileName,
 |  | PICONIMAGE | pii,
 |  | BOOL | bStretchToFit
 | ) |  |
BOOL IconImageFromClipBoard | ( | PICONIMAGE | pii,
 |  | BOOL | bStretchToFit
 | ) |  |
BOOL IconImageToBMPFile | ( | PCTSTR | szFileName,
 |  | PICONIMAGE | pii
 | ) |  |
BOOL IconImageToClipBoard ( PICONIMAGE pii )
HICON MakeIconFromResource ( PICONIMAGE pIcon )
BOOL MakeNewANDMaskBasedOnPoint | ( | PICONIMAGE | pIcon,
 |  | POINT | pt
 | ) |  |
PICONRESOURCE ReadIconFromEXEFile ( PCTSTR szFileName )

Definition at line 689 of file Icons.C.

{
    ICONRESOURCE*  pIR      = NULL;
    HINSTANCE      hLibrary = NULL;
    PTSTR          pID      = NULL;
    EXEDLLICONINFO EDII     = {0};

    // Load the DLL/EXE - NOTE: must be a 32bit EXE/DLL for this to work
    if( (hLibrary = LoadLibraryEx( szFileName, NULL, LOAD_LIBRARY_AS_DATAFILE )) == NULL )
    {
        // Failed to load - abort
        MessageBox( hWndMain, TEXT("Error Loading File - Choose a 32bit DLL or EXE"), szFileName, MB_OK );
        return NULL;
    }
    // Store the info
    EDII.szFileName = szFileName;
    EDII.hInstance = hLibrary;
    // Ask the user, "Which Icon?"
    if( (pID = ChooseIconFromEXEFile( &EDII )) != NULL )
    {
        HRSRC       hRsrc   = NULL;
        HGLOBAL     hGlobal = NULL;
        MEMICONDIR* pIcon   = NULL;
        UINT        i;

        // Find the group icon resource
        if( (hRsrc = FindResource( hLibrary, pID, RT_GROUP_ICON )) == NULL )
        {
            FreeLibrary( hLibrary );
            return NULL;
        }
        if( (hGlobal = LoadResource( hLibrary, hRsrc )) == NULL )
        {
            FreeLibrary( hLibrary );
            return NULL;
        }
        if( (pIcon = LockResource(hGlobal)) == NULL )
        {
            FreeLibrary( hLibrary );
            return NULL;
        }
        // Allocate enough memory for the images
        if( (pIR = malloc( sizeof(ICONRESOURCE) + ((pIcon->idCount-1) * sizeof(ICONIMAGE)) )) == NULL )
        {
            MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
            FreeLibrary( hLibrary );
            return NULL;
        }
        // Fill in local struct members
        pIR->nNumImages = pIcon->idCount;
        lstrcpyn( pIR->szOriginalDLLFileName, szFileName, MAX_PATH - 1 );
        lstrcpyn( pIR->szOriginalICOFileName, TEXT(""), MAX_PATH - 1 );
        // Loop through the images
        for( i = 0; i < pIR->nNumImages; i++ )
        {
            // Get the individual image
            if( (hRsrc = FindResource( hLibrary, MAKEINTRESOURCE(pIcon->idEntries[i].nID), RT_ICON )) == NULL )
            {
                free( pIR );
                FreeLibrary( hLibrary );
                return NULL;
            }
            if( (hGlobal = LoadResource( hLibrary, hRsrc )) == NULL )
            {
                free( pIR );
                FreeLibrary( hLibrary );
                return NULL;
            }
            // Store a copy of the resource locally
            pIR->IconImages[i].dwNumBytes = SizeofResource( hLibrary, hRsrc );
            pIR->IconImages[i].pBits = malloc( pIR->IconImages[i].dwNumBytes );
            memcpy( pIR->IconImages[i].pBits, LockResource( hGlobal ), pIR->IconImages[i].dwNumBytes );
            // Adjust internal pointers
            if( ! AdjustIconImagePointers( &(pIR->IconImages[i]) ) )
            {
                MessageBox( hWndMain, TEXT("Error Converting to Internal Format"), szFileName, MB_OK );
                free( pIR );
                FreeLibrary( hLibrary );
                return NULL;
            }
        }
    }
    FreeLibrary( hLibrary );
    return pIR;
}

PICONRESOURCE ReadIconFromICOFile ( PCTSTR szFileName )

Definition at line 157 of file Icons.C.

{
    ICONRESOURCE*       pIR = NULL;
    ICONRESOURCE*       pNew = NULL;
    HANDLE              hFile = NULL;
    PRESOURCEPOSINFO    pRPI = NULL;
    UINT                i;
    DWORD             dwBytesRead;
    ICONDIRENTRY*       pIDE = NULL;

    // Open the file
    if( (hFile = CreateFile( szFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL )) == INVALID_HANDLE_VALUE )
    {
        MessageBox( hWndMain, TEXT("Error Opening File for Reading"), szFileName, MB_OK );
        return NULL;
    }
    // Allocate memory for the resource structure
    if( (pIR = malloc( sizeof(ICONRESOURCE) )) == NULL )
    {
        MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
        CloseHandle( hFile );
        return NULL;
    }
    // Read in the header
    if( (pIR->nNumImages = ReadICOHeader( hFile )) == (UINT)-1 )
    {
        MessageBox( hWndMain, TEXT("Error Reading File Header"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    // Adjust the size of the struct to account for the images
    if( (pNew = realloc( pIR, sizeof(ICONRESOURCE) + ((pIR->nNumImages-1) * sizeof(ICONIMAGE)) )) == NULL )
    {
        MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    pIR = pNew;
    // Store the original name
    lstrcpyn( pIR->szOriginalICOFileName, szFileName, MAX_PATH - 1);
    lstrcpyn( pIR->szOriginalDLLFileName, TEXT(""), MAX_PATH - 1 );
    // Allocate enough memory for the icon directory entries
    if( (pIDE = malloc( pIR->nNumImages * sizeof( ICONDIRENTRY ) ) ) == NULL )
    {
        MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    // Read in the icon directory entries
    if( ! ReadFile( hFile, pIDE, pIR->nNumImages * sizeof( ICONDIRENTRY ), &dwBytesRead, NULL ) )
    {
        MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    if( dwBytesRead != pIR->nNumImages * sizeof( ICONDIRENTRY ) )
    {
        MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
        CloseHandle( hFile );
        free( pIR );
        return NULL;
    }
    // Loop through and read in each image
    for( i = 0; i < pIR->nNumImages; i++ )
    {
        // Allocate memory for the resource
        if( (pIR->IconImages[i].pBits = malloc(pIDE[i].dwBytesInRes)) == NULL )
        {
            MessageBox( hWndMain, TEXT("Error Allocating Memory"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIR );
            free( pIDE );
            return NULL;
        }
        pIR->IconImages[i].dwNumBytes = pIDE[i].dwBytesInRes;
        // Seek to beginning of this image
        if( SetFilePointer( hFile, pIDE[i].dwImageOffset, NULL, FILE_BEGIN ) == INVALID_SET_FILE_POINTER )
        {
            MessageBox( hWndMain, TEXT("Error Seeking in File"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIR );
            free( pIDE );
            return NULL;
        }
        // Read it in
        if( ! ReadFile( hFile, pIR->IconImages[i].pBits, pIDE[i].dwBytesInRes, &dwBytesRead, NULL ) )
        {
            MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIR );
            free( pIDE );
            return NULL;
        }
        if( dwBytesRead != pIDE[i].dwBytesInRes )
        {
            MessageBox( hWndMain, TEXT("Error Reading File"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIDE );
            free( pIR );
            return NULL;
        }
        // Set the internal pointers appropriately
        if( ! AdjustIconImagePointers( &(pIR->IconImages[i]) ) )
        {
            MessageBox( hWndMain, TEXT("Error Converting to Internal Format"), szFileName, MB_OK );
            CloseHandle( hFile );
            free( pIDE );
            free( pIR );
            return NULL;
        }
    }
    // Clean up
    free( pIDE );
    free( pRPI );
    CloseHandle( hFile );
    return pIR;
}

BOOL WriteIconToICOFile | ( | PICONRESOURCE | pIR,
 |  | PCTSTR | szFileName
 | ) |  |
Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/MDIChild.C File Reference

  • WinUI
  • Resource
  • Iconpro
Defines | Functions | Variables

MDIChild.C File Reference

#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
#include <malloc.h>
#include "Icons.h"
#include "IconPro.h"
#include "Resource.h"
#include "MDIChild.H"

Go to the source code of this file.

Defines

#define | DIVIDER 5
#define | MAX_COLOR_FORMAT 5

Functions

BOOL CALLBACK | AddFormatDlgProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
HWND | CreateChildListBox (HWND hWndParent, UINT ID, PRECT pRect)
BOOL | CreateChildren (HWND hWnd)
BOOL | Draw3DRect (HDC hDC, RECT Rect, BOOL bSunken)
void | EraseBackground (HWND hWnd, HDC hDC)
LRESULT CALLBACK | IconChildWndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)

Variables

HINSTANCE | hInst
HWND | hMDIClientWnd
HWND | hWndMain

Define Documentation

#define DIVIDER 5
#define MAX_COLOR_FORMAT 5

Function Documentation

BOOL CALLBACK AddFormatDlgProc | ( | HWND | hWnd,
 |  | UINT | Msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 1031 of file MDIChild.C.

{
    // Support all DIB color formats known at this time
    #define MAX_COLOR_FORMAT    5
    TCHAR ColorFormats[MAX_COLOR_FORMAT+1][20] = { TEXT("Monochrome (1bpp)"), TEXT("16 Color (4bpp)"), TEXT("256 Color (8bpp)"),
                                    TEXT("16 Bit Color"), TEXT("24 Bit Color"), TEXT("32 Bit Color") };
    UINT    Bits[MAX_COLOR_FORMAT+1] = { 1, 4, 8, 16, 24, 32 };
    static  bSquareOnly = TRUE;
    static  LPARAM lInitParam;

    switch( Msg )
    {
        // Dialog is being initialized
        case WM_INITDIALOG:
            {
                TCHAR szBuffer[100] = {0};

                // We are passed a pointer to a LPICONIMAGE in lParam, save it
                lInitParam = lParam;
                // Set the range and position of the sliders
                SendDlgItemMessage( hWnd, ID_WIDTHSLIDER, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(MIN_ICON_WIDTH,MAX_ICON_WIDTH) );
                SendDlgItemMessage( hWnd, ID_WIDTHSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)MIN_ICON_WIDTH );
                wsprintf( szBuffer, TEXT("%d Width"), MIN_ICON_WIDTH );
                SetDlgItemText( hWnd, ID_WIDTHTEXT, szBuffer );
                SendDlgItemMessage( hWnd, ID_HEIGHTSLIDER, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(MIN_ICON_HEIGHT,MAX_ICON_HEIGHT) );
                SendDlgItemMessage( hWnd, ID_HEIGHTSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)MIN_ICON_HEIGHT );
                wsprintf( szBuffer, TEXT("%d Height"), MIN_ICON_HEIGHT );
                SetDlgItemText( hWnd, ID_HEIGHTTEXT, szBuffer );
                SendDlgItemMessage( hWnd, ID_COLORSLIDER, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0,MAX_COLOR_FORMAT) );
                SendDlgItemMessage( hWnd, ID_COLORSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)2);
                SetDlgItemText( hWnd, ID_COLORTEXT, ColorFormats[2] );
                CheckDlgButton( hWnd, IDC_SQUAREONLY, bSquareOnly );
            }
            break; // End WM_INITDIALOG

        // Scroll message from the sliders
        case WM_HSCROLL:
            {
                int nPos;
                TCHAR szBuffer[100] = {0};

                // Get the current position
                if( ( LOWORD(wParam) == TB_THUMBPOSITION ) || ( LOWORD(wParam) == TB_THUMBTRACK ) )
                    nPos = HIWORD( wParam );
                else
                    nPos = (int)SendMessage( (HWND)lParam, TBM_GETPOS, 0, 0 );
                // Was it the width slider?
                if( (HWND)lParam == GetDlgItem( hWnd, ID_WIDTHSLIDER) )
                {
                    // Update the text
                    wsprintf( szBuffer, TEXT("%d Width"), nPos );
                    SetDlgItemText( hWnd, ID_WIDTHTEXT, szBuffer );
                    // If dealing with width=height, adjust height too
                    if( bSquareOnly )
                    {
                        SendDlgItemMessage( hWnd, ID_HEIGHTSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)nPos );
                        wsprintf( szBuffer, TEXT("%d Height"), nPos );
                        SetDlgItemText( hWnd, ID_HEIGHTTEXT, szBuffer );
                    }
                }
                else
                {
                    // Was it the height slider?
                    if( (HWND)lParam == GetDlgItem( hWnd, ID_HEIGHTSLIDER) )
                    {
                        // Update the text
                        wsprintf( szBuffer, TEXT("%d Height"), nPos );
                        SetDlgItemText( hWnd, ID_HEIGHTTEXT, szBuffer );
                        // If dealing with width=height, adjust width too
                        if( bSquareOnly )
                        {
                            SendDlgItemMessage( hWnd, ID_WIDTHSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)nPos );
                            wsprintf( szBuffer, TEXT("%d Width"), nPos );
                            SetDlgItemText( hWnd, ID_WIDTHTEXT, szBuffer );
                        }
                    }
                    else
                    {
                        // Was it the color slider?
                        if( (HWND)lParam == GetDlgItem( hWnd, ID_COLORSLIDER) )
                        {
                            // Update the text
                            SetDlgItemText( hWnd, ID_COLORTEXT, ColorFormats[nPos] );
                        }
                    }
                }
            }
            break; // End WM_HSCROLL

        // Time to say 'goodbye'
        case WM_CLOSE:
            PostMessage( hWnd, WM_COMMAND, IDCANCEL, 0l );
            break; // End WM_CLOSE

        // Messages from user items - checkboxes etc
        case WM_COMMAND:
            switch( LOWORD(wParam) )
            {
                // Checkbox for width=height restriction
                case IDC_SQUAREONLY:
                    // Is it checked now?
                    bSquareOnly = IsDlgButtonChecked( hWnd, IDC_SQUAREONLY );
                    // If it is, set height equal to width
                    if( bSquareOnly )
                    {
                        int nPos;
                        TCHAR szBuffer[100] = {0};

                        nPos = (int)SendDlgItemMessage( hWnd, ID_WIDTHSLIDER, TBM_GETPOS, 0, 0 );
                        SendDlgItemMessage( hWnd, ID_HEIGHTSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)nPos );
                        wsprintf( szBuffer, TEXT("%d Height"), nPos );
                        SetDlgItemText( hWnd, ID_HEIGHTTEXT, szBuffer );
                    }
                    break; // End IDC_SQUAREONLY

                // Add Format button has been pressed
                case IDOK:
                    {
                        PICONIMAGE pii = NULL;

                        // Were we passed a valid PICONIMAGE pointer?
                        if( ((PICONIMAGE)lInitParam) != NULL )
                        {
                            // allocate the new ICONIMAGE
                            if( (pii = malloc( sizeof( ICONIMAGE ) )) == FALSE )
                            {
                                EndDialog( hWnd, FALSE );
                            }
                            else
                            {
                                // initialize it
                                ZeroMemory( pii, sizeof( ICONIMAGE ) );
                                pii->Width = (UINT)SendDlgItemMessage( hWnd, ID_WIDTHSLIDER, TBM_GETPOS, 0, 0 );
                                pii->Height = (UINT)SendDlgItemMessage( hWnd, ID_HEIGHTSLIDER, TBM_GETPOS, 0, 0 );
                                pii->Colors = Bits[SendDlgItemMessage( hWnd, ID_COLORSLIDER, TBM_GETPOS, 0, 0 )];
                                // update the pointer that we were passed
                                *(PICONIMAGE *)lInitParam = pii;
                                // bail
                                EndDialog( hWnd, TRUE );
                            }
                        }
                        else
                        {
                            // bail
                            EndDialog( hWnd, FALSE );
                        }
                    }
                    break; // End IDOK

                // Time to cancel
                case IDCANCEL:
                    EndDialog( hWnd, FALSE );
                    break; // End IDCANCEL
            }
            break;

        default:
            return FALSE;
            break;
    }

    return TRUE;
    #undef MAX_COLOR_FORMAT
}

HWND CreateChildListBox | ( | HWND | hWndParent,
 |  | UINT | ID,
 |  | PRECT | pRect
 | ) |  |

Definition at line 992 of file MDIChild.C.

{
    HWND hWnd;

    hWnd = CreateWindow( TEXT("COMBOBOX"), TEXT(""), CBS_DROPDOWNLIST | CBS_DISABLENOSCROLL | WS_CHILD | WS_VSCROLL,
                        pRect->left, pRect->top,
                        pRect->right - pRect->left + 1, pRect->bottom - pRect->top + 1,
                        hWndParent, (HMENU)(LONG_PTR)ID, hInst, 0 );
    if( hWnd != NULL )
    {
        ShowWindow( hWnd, SW_SHOW );
    }
    return hWnd;
}

BOOL CreateChildren ( HWND hWnd )

Definition at line 901 of file MDIChild.C.

{
    RECT             ClientRect = {0};
    RECT             TempRect   = {0};
    PCHILDWINDOWDATA pcwd       = NULL;
    HDC              hDC        = NULL;
    SIZE             size       = {0};
    BOOL             bSuccess   = TRUE;

    // Get the data associated with this window
    if( (pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA )) == NULL )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    // Just how big is this window?
    GetClientRect( hWnd, &ClientRect );
    // Calculate listbox size and position
    SetRect( &(pcwd->BoxRect), 10, ClientRect.bottom-30, (MAX_ICON_WIDTH*2)+14, ClientRect.bottom+50 );
    // Create the listbox
    if((pcwd->hWndFormatListBox=CreateChildListBox( hWnd, ID_FORMAT_BOX, &(pcwd->BoxRect) )) == NULL )
    {
        bSuccess = FALSE;
        goto exit_func;
    }

    // If we have an icon resource
    if( pcwd->pIR != NULL )
    {
        UINT  i, nIndex;
        TCHAR szBuffer[256] = {0};

        // For each image in the resoure
        for(i=0;i<pcwd->pIR->nNumImages;i++)
        {
            // Add the type of the image to the listbox
            wsprintf( szBuffer, TEXT("%dx%d, %d Bit Color"), pcwd->pIR->IconImages[i].Width,
                        pcwd->pIR->IconImages[i].Height, pcwd->pIR->IconImages[i].Colors );
            nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_ADDSTRING, 0, (LPARAM)szBuffer );
        }
        // Select the first entry
        SendMessage( pcwd->hWndFormatListBox,   CB_SETCURSEL, (WPARAM)0, (LPARAM)0 );
    }
    // Adjust the box size based on the listbox's real size
    GetClientRect( pcwd->hWndFormatListBox, &TempRect );
    pcwd->BoxRect.bottom = pcwd->BoxRect.top + TempRect.bottom;

    // How big is text these days?
    hDC = GetDC( hWnd );
    GetTextExtentPoint32( hDC, TEXT("Icon on Black"), 13, &size );
    ReleaseDC( hWnd, hDC );

    // Set the rectangles for the various squares to be drawn later
#define DIVIDER 5
    SetRect( &(pcwd->DrawingRect), 10, 10, (MAX_ICON_WIDTH*2)+14, 20 + (MAX_ICON_HEIGHT*2) + (TempRect.bottom*2) );
    SetRect( &(pcwd->BlackRect), pcwd->DrawingRect.left, pcwd->DrawingRect.top, pcwd->DrawingRect.left + MAX_ICON_WIDTH + 1, pcwd->DrawingRect.top + MAX_ICON_HEIGHT + 1 );
    SetRect( &(pcwd->BlackTextRect), pcwd->BlackRect.left, pcwd->BlackRect.bottom+1, pcwd->BlackRect.right, pcwd->BlackRect.bottom + TempRect.bottom + 1 );
    SetRect( &(pcwd->WhiteRect), pcwd->BlackRect.right+1, pcwd->BlackRect.top, pcwd->DrawingRect.right, pcwd->BlackRect.bottom );
    SetRect( &(pcwd->WhiteTextRect), pcwd->WhiteRect.left, pcwd->WhiteRect.bottom+1, pcwd->WhiteRect.right, pcwd->WhiteRect.bottom + TempRect.bottom + 1 );
    SetRect( &(pcwd->XORRect),  pcwd->BlackTextRect.left, pcwd->BlackTextRect.bottom + 1 + DIVIDER, pcwd->BlackRect.right, pcwd->BlackTextRect.bottom + 2 + DIVIDER + MAX_ICON_HEIGHT );
    SetRect( &(pcwd->XORTextRect),  pcwd->XORRect.left, pcwd->XORRect.bottom + 1, pcwd->XORRect.right, pcwd->DrawingRect.bottom );
    SetRect( &(pcwd->ANDRect),  pcwd->WhiteTextRect.left, pcwd->WhiteTextRect.bottom + 1 + DIVIDER, pcwd->WhiteRect.right, pcwd->WhiteTextRect.bottom + 2 + DIVIDER + MAX_ICON_HEIGHT );
    SetRect( &(pcwd->ANDTextRect),  pcwd->ANDRect.left, pcwd->ANDRect.bottom + 1, pcwd->ANDRect.right, pcwd->DrawingRect.bottom );
#undef DIVIDER

exit_func:
    return bSuccess;
}

BOOL Draw3DRect | ( | HDC | hDC,
 |  | RECT | Rect,
 |  | BOOL | bSunken
 | ) |  |

Definition at line 759 of file MDIChild.C.

{
    HBRUSH  hBrush  = NULL;
    HPEN    hPen    = NULL;
    HPEN    hOldPen = NULL;

    // Get the color for the main foreground
    hBrush = CreateSolidBrush( GetSysColor(COLOR_3DFACE) );
    // paint it
    FillRect( hDC, &Rect, hBrush );
    DeleteObject( hBrush );
    // Get the pen for the top and left sides
    if( bSunken )
    {
        hPen = CreatePen( PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW) );
    }
    else
    {
        hPen = CreatePen( PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT) );
    }
    hOldPen = SelectObject( hDC, hPen);
    // Draw the top and left sides
    MoveToEx( hDC, Rect.right, Rect.top, NULL );
    LineTo( hDC, Rect.left, Rect.top );
    LineTo( hDC, Rect.left, Rect.bottom );
    SelectObject( hDC, hOldPen);
    DeleteObject( hPen );
    // Get the pen for the bottom and right sides
    if( bSunken )
    {
        hPen = CreatePen( PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT) );
    }
    else
    {
        hPen = CreatePen( PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW) );
    }
    hOldPen = SelectObject( hDC, hPen);
    // Draw the bottom and right sides
    LineTo( hDC, Rect.right, Rect.bottom );
    LineTo( hDC, Rect.right, Rect.top );
    SelectObject( hDC, hOldPen);
    DeleteObject( hPen );
    return TRUE;
}

void EraseBackground | ( | HWND | hWnd,
 |  | HDC | hDC
 | ) |  |

Definition at line 826 of file MDIChild.C.

{
    RECT                Rect     = {0};
    PCHILDWINDOWDATA  pcwd     = NULL;
    HBRUSH              hBrush   = NULL;
    SIZE                TextSize = {0};

    // Just how big is this window?
    GetClientRect( hWnd, &Rect );
    // Paint the background
    Draw3DRect( hDC, Rect, FALSE );

    // If there is no icon resource yet, bail out
    if( ( pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA ) ) == NULL )
    {
        return;
    }
    // Draw 3d rectangles around areas of interest
    Draw3DRect( hDC, pcwd->WhiteRect, TRUE );
    Draw3DRect( hDC, pcwd->WhiteTextRect, TRUE );
    Draw3DRect( hDC, pcwd->BlackRect, TRUE );
    Draw3DRect( hDC, pcwd->BlackTextRect, TRUE );
    Draw3DRect( hDC, pcwd->XORRect, TRUE );
    Draw3DRect( hDC, pcwd->XORTextRect, TRUE );
    Draw3DRect( hDC, pcwd->ANDRect, TRUE );
    Draw3DRect( hDC, pcwd->ANDTextRect, TRUE );
    // Fill in the white area
    hBrush = GetStockObject( WHITE_BRUSH );
    SelectObject( hDC, hBrush );
    Rectangle( hDC, pcwd->WhiteRect.left, pcwd->WhiteRect.top, pcwd->WhiteRect.right, pcwd->WhiteRect.bottom );
    // Fill in the black area
    hBrush = GetStockObject( BLACK_BRUSH );
    SelectObject( hDC, hBrush );
    Rectangle( hDC, pcwd->BlackRect.left, pcwd->BlackRect.top, pcwd->BlackRect.right, pcwd->BlackRect.bottom );

    // Set texts for the various sections
    SetBkMode( hDC, TRANSPARENT );
    GetTextExtentPoint32( hDC, TEXT("Icon On Black"), 13, &TextSize );
    TextOut( hDC, pcwd->BlackTextRect.left + ((RectWidth(pcwd->BlackTextRect)-TextSize.cx)/2),
             pcwd->BlackTextRect.top + ((RectHeight(pcwd->BlackTextRect)-TextSize.cy)/2),
             TEXT("Icon On Black"), 13 );
    GetTextExtentPoint32( hDC, TEXT("Icon On White"), 13, &TextSize );
    TextOut( hDC, pcwd->WhiteTextRect.left + ((RectWidth(pcwd->WhiteTextRect)-TextSize.cx)/2),
             pcwd->WhiteTextRect.top + ((RectHeight(pcwd->WhiteTextRect)-TextSize.cy)/2),
             TEXT("Icon On White"), 13 );
    GetTextExtentPoint32( hDC, TEXT("XOR Mask"), 8, &TextSize );
    TextOut( hDC, pcwd->XORTextRect.left + ((RectWidth(pcwd->XORTextRect)-TextSize.cx)/2),
             pcwd->XORTextRect.top + ((RectHeight(pcwd->XORTextRect)-TextSize.cy)/2),
             TEXT("XOR Mask"), 8 );
    GetTextExtentPoint32( hDC, TEXT("AND Mask"), 8, &TextSize );
    TextOut( hDC, pcwd->ANDTextRect.left + ((RectWidth(pcwd->ANDTextRect)-TextSize.cx)/2),
             pcwd->ANDTextRect.top + ((RectHeight(pcwd->ANDTextRect)-TextSize.cy)/2),
             TEXT("AND Mask"), 8 );
}

LRESULT CALLBACK IconChildWndProc | ( | HWND | hWnd,
 |  | UINT | Msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 71 of file MDIChild.C.

{
    // Which message is it?
    switch( Msg )
    {
        // User pressed left mouse button
        // Should be re-generate the AND mask?
        case WM_LBUTTONDOWN:
            {
                PCHILDWINDOWDATA pcwd = NULL;

                // Get the icon resource data aassociated with this window
                if( (pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA )) == NULL )
                {
                    break;
                }

                // Do something only if the CNTRL key is pressed too
                if( MK_CONTROL & wParam )
                {
                    POINTS  pts       = MAKEPOINTS(lParam);
                    POINT pt        = {0};
                    RECT    ImageRect = {0};
                    DWORD nIndex;

                    pt.x = pts.x; pt.y = pts.y;
                    // Do we have some icon resource data?
                    if( pcwd->pIR != NULL )
                    {
                        // Which image is selected right now?
                        if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                        {
                            // Where is it drawn
                            ImageRect = GetXORImageRect( pcwd->XORRect, &(pcwd->pIR->IconImages[nIndex]) );
                            // Is the mouse click in the image?
                            if( PtInRect( &ImageRect, pt ) )
                            {
                                HCURSOR hOldCursor = NULL;

                                // This might take a while :(
                                hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );
                                pt.x -= ImageRect.left;
                                pt.y -= ImageRect.top;
                                // generate the new AND mask
                                MakeNewANDMaskBasedOnPoint( &(pcwd->pIR->IconImages[nIndex]), pt );
                                // force a redraw
                                InvalidateRect( hWnd, NULL, TRUE );
                                //  Set changed flag
                                pcwd->pIR->bHasChanged = TRUE;
                                // finally, its over, put the cursor back
                                SetCursor( hOldCursor );
                            }
                        }
                    }
                }
            }
            break; // End WM_LBUTTONDOWN

        // Time to say "Goodbye"
        case WM_CLOSE:
            {
                PCHILDWINDOWDATA    pcwd        = NULL;
                TCHAR   szWindowTitle[MAX_PATH] = {0};

                // Get the data associated with this window
                pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                // Is there data associated with this window?
                if( pcwd != NULL )
                {
                    // Does the data include an icon resource
                    if( pcwd->pIR != NULL )
                    {
                        // Has the resource changed?
                        if( pcwd->pIR->bHasChanged )
                        {
                            // Get the title for the message box
                            GetWindowText( hWnd, szWindowTitle, MAX_PATH );
                            if( lstrlen( szWindowTitle ) < 1 )
                            {
                                lstrcpyn( szWindowTitle, TEXT("UnKnown"),
                                          sizeof(szWindowTitle)/sizeof(szWindowTitle[0]) - 1  );
                            }
                            // User want to save changes?
                            switch( MessageBox( hWnd, TEXT("Icon has Changed, Save Changes?"), szWindowTitle, MB_ICONSTOP | MB_YESNOCANCEL ) )
                            {
                                case IDYES:
                                    SendMessage( hWnd, WM_COMMAND, ID_FILE_SAVE, 0 );
                                    // Fall through to IDNO and kill window
                                case IDNO:
                                    DefMDIChildProc( hWnd, Msg, wParam, lParam );
                                    return 0;
                                    break;
                                case IDCANCEL:
                                    return 1;
                                    break;
                            }
                        }
                    }
                }
                DefMDIChildProc( hWnd, Msg, wParam, lParam );
                return 0;
            }
            break; // End WM_CLOSE

        // We are being created
        case WM_CREATE:
            {
                PCHILDWINDOWDATA pcwd = NULL;

                // Need new data for this new window
                pcwd = malloc( sizeof( CHILDWINDOWDATA ) );
                SetWindowLongPtr( hWnd, GWLP_USERDATA, (LONG_PTR)pcwd );
                pcwd->pIR = NULL;
                // If a resource was passed in, use it
                if( (PVOID)lParam != NULL )
                {
                    pcwd->pIR = (PICONRESOURCE)(((MDICREATESTRUCT *)(((CREATESTRUCT *)lParam)->lpCreateParams))->lParam);
                }

                // If no resource was passed in, do minimal initialization
                if( pcwd->pIR == NULL )
                {
                    pcwd->pIR = malloc(sizeof(ICONRESOURCE));
                    lstrcpyn( pcwd->pIR->szOriginalICOFileName, TEXT("Untitled"), MAX_PATH - 1 );
                    lstrcpyn( pcwd->pIR->szOriginalDLLFileName, TEXT(""), MAX_PATH - 1 );
                    pcwd->pIR->nNumImages = 0;
                }
                // Nothing has changed
                pcwd->pIR->bHasChanged = FALSE;
                // Create the list box, etc
                CreateChildren( hWnd );
                return DefMDIChildProc( hWnd, Msg, wParam, lParam );
            }
            break; // End WM_CREATE

        // Won't let window get too small to show our main area
        case WM_GETMINMAXINFO:
            {
                PMINMAXINFO pmmi = (PMINMAXINFO)lParam;

                pmmi->ptMinTrackSize.x = WINDOW_WIDTH;
                pmmi->ptMinTrackSize.y = WINDOW_HEIGHT;
                return 0;
            }
            break; // End WM_GETMINMAXINFO

        // Yikes! We're being destroyed!
        case WM_DESTROY:
            {
                PCHILDWINDOWDATA pcwd = NULL;

                // Get the data associated with this window
                pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                // Is there some?
                if( pcwd != NULL )
                {
                    // Is there a resource?
                    if( pcwd->pIR != NULL )
                    {
                        UINT i;

                        // Free all the bits
                        for( i=0; i< pcwd->pIR->nNumImages; i++ )
                        {
                            if( pcwd->pIR->IconImages[i].pBits != NULL )
                            {
                                free( pcwd->pIR->IconImages[i].pBits );
                            }
                        }
                        free( pcwd->pIR );
                    }
                    free( pcwd );
                }
                SetWindowLongPtr( hWnd, GWLP_USERDATA, 0 );
            }
            break; // End WM_DESTROY

        // Draw our background (white and black squares, etc)
        case WM_ERASEBKGND:
            EraseBackground( hWnd, (HDC)wParam );
            return 1;
            break; // End WM_ERASEBKGND

        // Ok, time to paint
        case WM_PAINT:
            {
                PCHILDWINDOWDATA    pcwd  = NULL;
                HDC                 hDC   = NULL;
                PAINTSTRUCT         ps    = {0};
                DWORD               nIndex;
                HICON               hIcon = NULL;

                // Obligatory BeginPaint()
                hDC = BeginPaint( hWnd, &ps );
                // Get the data associated with this window
                pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                // Is there some?
                if( pcwd != NULL )
                {
                    // Is there a resource?
                    if( pcwd->pIR != NULL )
                    {
                        // Which image is selected?
                        if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                        {
                            int         Width, Height;

                            // Get an HICON for the currently selected image
                            hIcon = MakeIconFromResource( &(pcwd->pIR->IconImages[nIndex]) );
                            // How big is the icon?
                            Width = pcwd->pIR->IconImages[nIndex].Width;
                            Height = pcwd->pIR->IconImages[nIndex].Height;
                            // Check to see if the icon is NULL
                            // If it is, consider it "unsupported"
                            // In the future, maybe we should look into MakeIconFromResource() and
                            // see why it is null - it may be for another reason than "unsupported"
                            if( hIcon == NULL )
                            {
                                SIZE    Size, Position;

                                // Draw some text in the black rect
                                SetTextColor( hDC, RGB(255,255,255) );
                                GetTextExtentPoint32( hDC, TEXT("Unsupported"), 11, &Size );
                                Position.cx = pcwd->BlackRect.left + ((RectWidth(pcwd->BlackRect)-Size.cx)/2);
                                Position.cy = pcwd->BlackRect.top + (RectHeight(pcwd->BlackRect)/2) - Size.cy;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Unsupported"), 11 );
                                GetTextExtentPoint32( hDC, TEXT("Format"), 6, &Size );
                                Position.cx = pcwd->BlackRect.left + ((RectWidth(pcwd->BlackRect)-Size.cx)/2);
                                Position.cy = pcwd->BlackRect.top + (RectHeight(pcwd->BlackRect)/2) + 1;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Format"), 6 );

                                // Draw some text in the white rect
                                SetTextColor( hDC, RGB(0,0,0) );
                                GetTextExtentPoint32( hDC, TEXT("Unsupported"), 11, &Size );
                                Position.cx = pcwd->WhiteRect.left + ((RectWidth(pcwd->WhiteRect)-Size.cx)/2);
                                Position.cy = pcwd->WhiteRect.top + (RectHeight(pcwd->WhiteRect)/2) - Size.cy;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Unsupported"), 11 );
                                GetTextExtentPoint32( hDC, TEXT("Format"), 6, &Size );
                                Position.cx = pcwd->WhiteRect.left + ((RectWidth(pcwd->WhiteRect)-Size.cx)/2);
                                Position.cy = pcwd->WhiteRect.top + (RectHeight(pcwd->WhiteRect)/2) + 1;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Format"), 6 );
                            }
                            else
                            {
                                // Draw it on the black background
                                DrawIconEx( hDC, pcwd->BlackRect.left + ((RectWidth(pcwd->BlackRect)-Width)/2),
                                                pcwd->BlackRect.top + ((RectHeight(pcwd->BlackRect)-Height)/2),
                                                hIcon, Width, Height, 0, NULL, DI_NORMAL );
                                // Draw it on the white background
                                DrawIconEx( hDC, pcwd->WhiteRect.left + ((RectWidth(pcwd->WhiteRect)-Width)/2),
                                                pcwd->WhiteRect.top + ((RectHeight(pcwd->WhiteRect)-Height)/2),
                                                hIcon, Width, Height, 0, NULL, DI_NORMAL );
                            }
                            // Draw just the XOR mask
                            DrawXORMask( hDC, pcwd->XORRect, &(pcwd->pIR->IconImages[nIndex]) );
                            // Draw just the AND mask
                            DrawANDMask( hDC, pcwd->ANDRect, &(pcwd->pIR->IconImages[nIndex]) );
                            // Kill the icon, we're one with it
                            if( hIcon != NULL )
                                DestroyIcon( hIcon );
                        }
                    }
                }
                // Obligtory EndPaint()
                EndPaint( hWnd, &ps );
            }
            break; // End WM_PAINT

        // WM_COMMAND - menu options, etc
        case WM_COMMAND:
            // which one is it?
            switch( LOWORD(wParam) )
            {
                // Edit->Export BMP - write icon image as BMP file
                case ID_EDIT_EXPORTBMP:
                    {
                    PCHILDWINDOWDATA pcwd                 = NULL;
                    DWORD            nIndex;
                    TCHAR            szFileName[MAX_PATH] = {0};

                    // Get the data associated this window
                    pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                    // If we have some data, including an icon resource
                    if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                    {
                        // Which image is currently selected?
                        if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                        {
                            // Get the name of the file from which to import the image
                            if( GetSaveIconFileName( szFileName, IDS_BMPFILTERSTRING, TEXT("Export to BMP File") ) )
                            {
                                HCURSOR hOldCursor;

                                // This might take a while :(
                                hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );
                                IconImageToBMPFile( szFileName, &(pcwd->pIR->IconImages[nIndex]) );
                                SetCursor( hOldCursor );
                            }
                        }
                    }
                    }
                    break; // End ID_EDIT_EXPORTBMP

                // Edit->Import BMP and Edit->Stretch-Import BMP - convert BMP file to icon
                case ID_EDIT_IMPORTBMP:  /* fall-through */
                case ID_EDIT_STRETCHIMPORTBMP:
                    {
                        PCHILDWINDOWDATA    pcwd                 = NULL;
                        DWORD               nIndex;
                        TCHAR               szFileName[MAX_PATH] = {0};

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                // Get the name of the file from which to import the image
                                if( GetOpenIconFileName( szFileName, IDS_BMPFILTERSTRING, TEXT("Import from BMP File") ) )
                                {
                                    HCURSOR hOldCursor;

                                    // This might take a while :(
                                    hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );
                                    // Import the BMP image data
                                    if( IconImageFromBMPFile( szFileName, &(pcwd->pIR->IconImages[nIndex]), (LOWORD(wParam)==ID_EDIT_STRETCHIMPORTBMP)?TRUE:FALSE ) )
                                    {
                                        // which, of course, changes things
                                        pcwd->pIR->bHasChanged = TRUE;
                                        // Force a repaint
                                        InvalidateRect( hWnd, NULL, TRUE );
                                    }
                                    SetCursor( hOldCursor );
                                }
                            }
                        }
                    }
                    break; // End ID_EDIT_IMPORTBMP/ID_EDIT_STRETCHIMPORTBMP

                // User wants to add an image format
                case ID_EDIT_ADDFORMAT:
                    {
                        PICONIMAGE  pii           = NULL;
                        TCHAR       szBuffer[256] = {0};

                        // Launch the dialog to ask which size and color depth
                        if( DialogBoxParam( hInst, MAKEINTRESOURCE(IDD_ADDFORMATDLG), hWndMain, (DLGPROC)AddFormatDlgProc, (LPARAM)(&pii) ) )
                        {
                            PCHILDWINDOWDATA    pcwd    = NULL;
                            PICONRESOURCE       pNewIR  = NULL;
                            DWORD               nIndex, i;

                            // Get the data associated this window
                            pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                            // If we have some data, including an icon resource
                            if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                            {
                                // Need to see if the new format already exists in the resource
                                // We don't want dupes, so check each image for dupe
                                for(i=0;i<pcwd->pIR->nNumImages;i++)
                                {
                                    // Is it the same as the new one?
                                    if( (pcwd->pIR->IconImages[i].Width==pii->Width) &&
                                        (pcwd->pIR->IconImages[i].Height==pii->Height) &&
                                        (pcwd->pIR->IconImages[i].Colors==pii->Colors) )
                                    {
                                        // Yikes! It is - bail and select the old one
                                        MessageBox( hWnd, TEXT("That format already exists - format not added"), TEXT("Error"), MB_OK );
                                        SendMessage( pcwd->hWndFormatListBox,   CB_SETCURSEL, (WPARAM)i, (LPARAM)0 );
                                        break;
                                    }
                                }
                                // Need bigger block of memory to hold an extra image format
                                pNewIR = malloc( sizeof( ICONRESOURCE ) + ( ( pcwd->pIR->nNumImages + 1) * sizeof(ICONIMAGE) ) );
                                // Of course this changes things
                                pNewIR->bHasChanged = TRUE;
                                // Copy old to new
                                lstrcpyn( pNewIR->szOriginalICOFileName, pcwd->pIR->szOriginalICOFileName,
                                          MAX_PATH - 1);
                                lstrcpyn( pNewIR->szOriginalDLLFileName, pcwd->pIR->szOriginalDLLFileName,
                                          MAX_PATH - 1);
                                pNewIR->nNumImages = pcwd->pIR->nNumImages + 1;
                                for(i=0;i<pcwd->pIR->nNumImages;i++)
                                {
                                    memcpy( &(pNewIR->IconImages[i]), &(pcwd->pIR->IconImages[i]), sizeof( ICONIMAGE ) );
                                }
                                // Add in the new one
                                memcpy( &(pNewIR->IconImages[i]), pii, sizeof( ICONIMAGE ) );
                                // Add this new one to the list box
                                wsprintf( szBuffer, TEXT("%dx%d, %d Bit Color"), pii->Width, pii->Height, pii->Colors );
                                nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_ADDSTRING, 0, (LPARAM)szBuffer );
                                // Select the new one
                                SendMessage( pcwd->hWndFormatListBox,   CB_SETCURSEL, (WPARAM)i, (LPARAM)0 );
                                // clean up
                                free( pii );
                                free( pcwd->pIR );
                                pcwd->pIR = pNewIR;
                                // Create a nice new blank image for this format
                                CreateBlankNewFormatIcon( &(pcwd->pIR->IconImages[i]) );
                                // force a repaint
                                InvalidateRect( hWnd, NULL, TRUE );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_ADDFORMAT

                // User wants to remove an image format
                case ID_EDIT_REMOVEFORMAT:
                    {
                        PCHILDWINDOWDATA    pcwd        = NULL;
                        DWORD               nIndex, i;
                        PICONRESOURCE       pNewIR      = NULL;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                // Remove the entry from the list box
                                SendMessage( pcwd->hWndFormatListBox, CB_DELETESTRING, nIndex, 0 );
                                // Need less memory now
                                pNewIR = malloc( sizeof( ICONRESOURCE ) + ( ( pcwd->pIR->nNumImages - 1) * sizeof(ICONIMAGE) ) );
                                // Of course this changes things
                                pNewIR->bHasChanged = TRUE;
                                // Copy old to new
                                lstrcpyn( pNewIR->szOriginalICOFileName, pcwd->pIR->szOriginalICOFileName,
                                          MAX_PATH - 1);
                                lstrcpyn( pNewIR->szOriginalDLLFileName, pcwd->pIR->szOriginalDLLFileName,
                                          MAX_PATH - 1);
                                pNewIR->nNumImages = pcwd->pIR->nNumImages - 1;
                                // Copy the rest of the images from old to new
                                for(i=0;i<nIndex;i++)
                                {
                                    memcpy( &(pNewIR->IconImages[i]), &(pcwd->pIR->IconImages[i]), sizeof( ICONIMAGE ) );
                                }
                                for(;i<pcwd->pIR->nNumImages-1;i++)
                                {
                                    memcpy( &(pNewIR->IconImages[i]), &(pcwd->pIR->IconImages[i+1]), sizeof( ICONIMAGE ) );
                                }
                                // Clean up
                                free( pcwd->pIR );
                                pcwd->pIR = pNewIR;
                                // Select a different image
                                if( (int) --nIndex < 0 )
                                {
                                    nIndex = 0;
                                }
                                SendMessage( pcwd->hWndFormatListBox, CB_SETCURSEL, (WPARAM)nIndex, 0 );
                                // Force a repaint
                                InvalidateRect( hWnd, NULL, TRUE );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_REMOVEFORMAT

                // User wants to paste CF_DIB from clipboard into current image
                case ID_EDIT_STRETCHPASTE: /* fall-through */
                case ID_EDIT_PASTE:
                    {
                        PCHILDWINDOWDATA    pcwd    = NULL;
                        DWORD               nIndex;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                HCURSOR hOldCursor;

                                // This might take a while :(
                                hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );

                                // Paste over it from the clipboard
                                if( IconImageFromClipBoard( &(pcwd->pIR->IconImages[nIndex]),
                                                            LOWORD(wParam)!=ID_EDIT_PASTE ) )
                                {
                                    // which, of course, changes things
                                    pcwd->pIR->bHasChanged = TRUE;
                                }
                                // Force a repaint
                                InvalidateRect( hWnd, NULL, TRUE );
                                SetCursor( hOldCursor );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_STRETCHPASTE/ID_EDIT_PASTE

                // Put current image on the clipboard in CF_DIB format
                case ID_EDIT_COPY:
                    {
                        PCHILDWINDOWDATA    pcwd  = NULL;
                        DWORD               nIndex;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                // Send this image to the clipboard
                                IconImageToClipBoard( &(pcwd->pIR->IconImages[nIndex]) );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_COPY

                // The filename has changed, update the window title
                case ID_UPDATETITLE:
                    {
                        TCHAR            szFileTitle[MAX_PATH] = {0};
                        PCHILDWINDOWDATA pcwd                  = NULL;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data
                        if( pcwd != NULL )
                        {
                            // including an icon resource
                            if( pcwd->pIR != NULL )
                            {
                                // The calculate and set the new title
                                if( GetFileTitle( pcwd->pIR->szOriginalICOFileName, szFileTitle, MAX_PATH ) == 0 )
                                {
                                    SetWindowText( hWnd, szFileTitle );
                                }
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_UPDATETITLE

                // How many image formats in the icon resource? (return that number)
                case ID_GETNUMFORMATS:
                    {
                        PCHILDWINDOWDATA pcwd = NULL;
                        UINT             nNum = 0;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data
                        if( pcwd != NULL )
                        {
                            // If we have a listbox, get its count, else 0
                            if( pcwd->hWndFormatListBox != NULL )
                            {
                                nNum = (UINT)SendMessage( pcwd->hWndFormatListBox, CB_GETCOUNT, 0, 0 );
                            }
                            else
                            {
                                nNum = 0;
                            }

                            // If an error occurred, default to 0
                            if( nNum == (UINT)CB_ERR )
                            {
                                nNum = 0;
                            }
                        }
                        // Send it back
                        return nNum;
                    }
                    break; // End WM_COMMAND -> ID_GETNUMFORMATS

                // Has this icon resource changed? return TRUE=yes, FALSE=no
                case ID_HASFILECHANGED:
                    {
                        PCHILDWINDOWDATA pcwd = NULL;
                        UINT             nRet = 0;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data
                        if( pcwd != NULL )
                        {
                            // And it includes an icon resource
                            if( pcwd->pIR != NULL )
                            {
                                // then check whether it has changed
                                return pcwd->pIR->bHasChanged == TRUE;
                            }
                        }
                        // Otherwise, return FALSE
                        return nRet;
                    }
                    break; // End WM_COMMAND -> ID_HASFILECHANGED

                // Handle selection changes, etc from listbox
                case ID_FORMAT_BOX:
                    switch( HIWORD(wParam) )
                    {
                        // If a selection is made, or changes, repaint
                        case CBN_SELCHANGE: /* fall-through */
                        case CBN_SELENDOK:
                            InvalidateRect( hWnd, NULL, TRUE );
                            break;
                    }
                    break; // End WM_COMMAND -> ID_FORMAT_BOX

                // User wants to save the ICO file
                case ID_FILE_SAVEAS: /* fall-through */
                case ID_FILE_SAVE:
                {
                    TCHAR          szFileName[MAX_PATH] = {0};
                    PCHILDWINDOWDATA pcwd                 = NULL;

                    // Get the data associated this window
                    if( ( pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA ) ) != NULL )
                    {
                        // See if it includes an icon resource
                        if( pcwd->pIR != NULL )
                        {
                            HCURSOR hOldCursor = NULL;

                            // This might take a while :(
                            hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );

                            // If we have an original filename, and user did *NOT* 'Save As'
                            if( ( lstrlen(pcwd->pIR->szOriginalICOFileName) > 0 ) && (LOWORD(wParam)!=ID_FILE_SAVEAS) )
                            {
                                // The just write it out
                                WriteIconToICOFile( pcwd->pIR, pcwd->pIR->szOriginalICOFileName );
                                // which, of course, brings it up to date
                                pcwd->pIR->bHasChanged = FALSE;
                            }
                            else
                            {
                                // Either we have no name, or user hit 'Save As'
                                if( GetSaveIconFileName( szFileName, IDS_FILTERSTRING, LOWORD(wParam)==ID_FILE_SAVE?TEXT("Save Icon File"):TEXT("Save Icon File As") ) )
                                {
                                    // So, write it out
                                    WriteIconToICOFile( pcwd->pIR, szFileName );
                                    // Update the name associated with the resource
                                    lstrcpyn( pcwd->pIR->szOriginalICOFileName, szFileName, MAX_PATH - 1 );
                                    // Inform window to update title
                                    SendMessage( hWnd, WM_COMMAND, ID_UPDATETITLE, 0 );
                                    // and, of course, it is now up to date
                                    pcwd->pIR->bHasChanged = FALSE;
                                }
                            }
                            SetCursor( hOldCursor );
                        }
                        else
                        {
                            MessageBox( hWnd, TEXT("Error Getting Icon Info - File Not Saved"), TEXT("Error"), MB_OK );
                        }
                    }
                }
                break; // End WM_COMMAND -> ID_FILE_SAVE/ID_FILE_SAVEAS
            }
            break; // End WM_COMMAND
    }
    return DefMDIChildProc( hWnd, Msg, wParam, lParam );
}

Variable Documentation

HINSTANCE hInst

Definition at line 37 of file Demo.c.

HWND hMDIClientWnd

Definition at line 56 of file IconPRO.C.

HWND hWndMain

Definition at line 40 of file halftone.c.

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/MDIChild.h File Reference

  • WinUI
  • Resource
  • Iconpro
Classes | Defines | Typedefs | Functions

MDIChild.h File Reference

#include <windows.h>

Go to the source code of this file.

Classes

struct | CHILDWINDOWDATA

Defines

#define | ID_FORMAT_BOX 102

Typedefs

typedef struct CHILDWINDOWDATA * | PCHILDWINDOWDATA

Functions

LRESULT CALLBACK | IconChildWndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)

Define Documentation

#define ID_FORMAT_BOX 102

Definition at line 26 of file MDIChild.h.

Typedef Documentation

typedef struct CHILDWINDOWDATA * PCHILDWINDOWDATA

Function Documentation

LRESULT CALLBACK IconChildWndProc | ( | HWND | hWnd,
 |  | UINT | Msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 71 of file MDIChild.C.

{
    // Which message is it?
    switch( Msg )
    {
        // User pressed left mouse button
        // Should be re-generate the AND mask?
        case WM_LBUTTONDOWN:
            {
                PCHILDWINDOWDATA pcwd = NULL;

                // Get the icon resource data aassociated with this window
                if( (pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA )) == NULL )
                {
                    break;
                }

                // Do something only if the CNTRL key is pressed too
                if( MK_CONTROL & wParam )
                {
                    POINTS  pts       = MAKEPOINTS(lParam);
                    POINT pt        = {0};
                    RECT    ImageRect = {0};
                    DWORD nIndex;

                    pt.x = pts.x; pt.y = pts.y;
                    // Do we have some icon resource data?
                    if( pcwd->pIR != NULL )
                    {
                        // Which image is selected right now?
                        if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                        {
                            // Where is it drawn
                            ImageRect = GetXORImageRect( pcwd->XORRect, &(pcwd->pIR->IconImages[nIndex]) );
                            // Is the mouse click in the image?
                            if( PtInRect( &ImageRect, pt ) )
                            {
                                HCURSOR hOldCursor = NULL;

                                // This might take a while :(
                                hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );
                                pt.x -= ImageRect.left;
                                pt.y -= ImageRect.top;
                                // generate the new AND mask
                                MakeNewANDMaskBasedOnPoint( &(pcwd->pIR->IconImages[nIndex]), pt );
                                // force a redraw
                                InvalidateRect( hWnd, NULL, TRUE );
                                //  Set changed flag
                                pcwd->pIR->bHasChanged = TRUE;
                                // finally, its over, put the cursor back
                                SetCursor( hOldCursor );
                            }
                        }
                    }
                }
            }
            break; // End WM_LBUTTONDOWN

        // Time to say "Goodbye"
        case WM_CLOSE:
            {
                PCHILDWINDOWDATA    pcwd        = NULL;
                TCHAR   szWindowTitle[MAX_PATH] = {0};

                // Get the data associated with this window
                pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                // Is there data associated with this window?
                if( pcwd != NULL )
                {
                    // Does the data include an icon resource
                    if( pcwd->pIR != NULL )
                    {
                        // Has the resource changed?
                        if( pcwd->pIR->bHasChanged )
                        {
                            // Get the title for the message box
                            GetWindowText( hWnd, szWindowTitle, MAX_PATH );
                            if( lstrlen( szWindowTitle ) < 1 )
                            {
                                lstrcpyn( szWindowTitle, TEXT("UnKnown"),
                                          sizeof(szWindowTitle)/sizeof(szWindowTitle[0]) - 1  );
                            }
                            // User want to save changes?
                            switch( MessageBox( hWnd, TEXT("Icon has Changed, Save Changes?"), szWindowTitle, MB_ICONSTOP | MB_YESNOCANCEL ) )
                            {
                                case IDYES:
                                    SendMessage( hWnd, WM_COMMAND, ID_FILE_SAVE, 0 );
                                    // Fall through to IDNO and kill window
                                case IDNO:
                                    DefMDIChildProc( hWnd, Msg, wParam, lParam );
                                    return 0;
                                    break;
                                case IDCANCEL:
                                    return 1;
                                    break;
                            }
                        }
                    }
                }
                DefMDIChildProc( hWnd, Msg, wParam, lParam );
                return 0;
            }
            break; // End WM_CLOSE

        // We are being created
        case WM_CREATE:
            {
                PCHILDWINDOWDATA pcwd = NULL;

                // Need new data for this new window
                pcwd = malloc( sizeof( CHILDWINDOWDATA ) );
                SetWindowLongPtr( hWnd, GWLP_USERDATA, (LONG_PTR)pcwd );
                pcwd->pIR = NULL;
                // If a resource was passed in, use it
                if( (PVOID)lParam != NULL )
                {
                    pcwd->pIR = (PICONRESOURCE)(((MDICREATESTRUCT *)(((CREATESTRUCT *)lParam)->lpCreateParams))->lParam);
                }

                // If no resource was passed in, do minimal initialization
                if( pcwd->pIR == NULL )
                {
                    pcwd->pIR = malloc(sizeof(ICONRESOURCE));
                    lstrcpyn( pcwd->pIR->szOriginalICOFileName, TEXT("Untitled"), MAX_PATH - 1 );
                    lstrcpyn( pcwd->pIR->szOriginalDLLFileName, TEXT(""), MAX_PATH - 1 );
                    pcwd->pIR->nNumImages = 0;
                }
                // Nothing has changed
                pcwd->pIR->bHasChanged = FALSE;
                // Create the list box, etc
                CreateChildren( hWnd );
                return DefMDIChildProc( hWnd, Msg, wParam, lParam );
            }
            break; // End WM_CREATE

        // Won't let window get too small to show our main area
        case WM_GETMINMAXINFO:
            {
                PMINMAXINFO pmmi = (PMINMAXINFO)lParam;

                pmmi->ptMinTrackSize.x = WINDOW_WIDTH;
                pmmi->ptMinTrackSize.y = WINDOW_HEIGHT;
                return 0;
            }
            break; // End WM_GETMINMAXINFO

        // Yikes! We're being destroyed!
        case WM_DESTROY:
            {
                PCHILDWINDOWDATA pcwd = NULL;

                // Get the data associated with this window
                pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                // Is there some?
                if( pcwd != NULL )
                {
                    // Is there a resource?
                    if( pcwd->pIR != NULL )
                    {
                        UINT i;

                        // Free all the bits
                        for( i=0; i< pcwd->pIR->nNumImages; i++ )
                        {
                            if( pcwd->pIR->IconImages[i].pBits != NULL )
                            {
                                free( pcwd->pIR->IconImages[i].pBits );
                            }
                        }
                        free( pcwd->pIR );
                    }
                    free( pcwd );
                }
                SetWindowLongPtr( hWnd, GWLP_USERDATA, 0 );
            }
            break; // End WM_DESTROY

        // Draw our background (white and black squares, etc)
        case WM_ERASEBKGND:
            EraseBackground( hWnd, (HDC)wParam );
            return 1;
            break; // End WM_ERASEBKGND

        // Ok, time to paint
        case WM_PAINT:
            {
                PCHILDWINDOWDATA    pcwd  = NULL;
                HDC                 hDC   = NULL;
                PAINTSTRUCT         ps    = {0};
                DWORD               nIndex;
                HICON               hIcon = NULL;

                // Obligatory BeginPaint()
                hDC = BeginPaint( hWnd, &ps );
                // Get the data associated with this window
                pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                // Is there some?
                if( pcwd != NULL )
                {
                    // Is there a resource?
                    if( pcwd->pIR != NULL )
                    {
                        // Which image is selected?
                        if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                        {
                            int         Width, Height;

                            // Get an HICON for the currently selected image
                            hIcon = MakeIconFromResource( &(pcwd->pIR->IconImages[nIndex]) );
                            // How big is the icon?
                            Width = pcwd->pIR->IconImages[nIndex].Width;
                            Height = pcwd->pIR->IconImages[nIndex].Height;
                            // Check to see if the icon is NULL
                            // If it is, consider it "unsupported"
                            // In the future, maybe we should look into MakeIconFromResource() and
                            // see why it is null - it may be for another reason than "unsupported"
                            if( hIcon == NULL )
                            {
                                SIZE    Size, Position;

                                // Draw some text in the black rect
                                SetTextColor( hDC, RGB(255,255,255) );
                                GetTextExtentPoint32( hDC, TEXT("Unsupported"), 11, &Size );
                                Position.cx = pcwd->BlackRect.left + ((RectWidth(pcwd->BlackRect)-Size.cx)/2);
                                Position.cy = pcwd->BlackRect.top + (RectHeight(pcwd->BlackRect)/2) - Size.cy;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Unsupported"), 11 );
                                GetTextExtentPoint32( hDC, TEXT("Format"), 6, &Size );
                                Position.cx = pcwd->BlackRect.left + ((RectWidth(pcwd->BlackRect)-Size.cx)/2);
                                Position.cy = pcwd->BlackRect.top + (RectHeight(pcwd->BlackRect)/2) + 1;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Format"), 6 );

                                // Draw some text in the white rect
                                SetTextColor( hDC, RGB(0,0,0) );
                                GetTextExtentPoint32( hDC, TEXT("Unsupported"), 11, &Size );
                                Position.cx = pcwd->WhiteRect.left + ((RectWidth(pcwd->WhiteRect)-Size.cx)/2);
                                Position.cy = pcwd->WhiteRect.top + (RectHeight(pcwd->WhiteRect)/2) - Size.cy;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Unsupported"), 11 );
                                GetTextExtentPoint32( hDC, TEXT("Format"), 6, &Size );
                                Position.cx = pcwd->WhiteRect.left + ((RectWidth(pcwd->WhiteRect)-Size.cx)/2);
                                Position.cy = pcwd->WhiteRect.top + (RectHeight(pcwd->WhiteRect)/2) + 1;
                                TextOut( hDC, Position.cx, Position.cy, TEXT("Format"), 6 );
                            }
                            else
                            {
                                // Draw it on the black background
                                DrawIconEx( hDC, pcwd->BlackRect.left + ((RectWidth(pcwd->BlackRect)-Width)/2),
                                                pcwd->BlackRect.top + ((RectHeight(pcwd->BlackRect)-Height)/2),
                                                hIcon, Width, Height, 0, NULL, DI_NORMAL );
                                // Draw it on the white background
                                DrawIconEx( hDC, pcwd->WhiteRect.left + ((RectWidth(pcwd->WhiteRect)-Width)/2),
                                                pcwd->WhiteRect.top + ((RectHeight(pcwd->WhiteRect)-Height)/2),
                                                hIcon, Width, Height, 0, NULL, DI_NORMAL );
                            }
                            // Draw just the XOR mask
                            DrawXORMask( hDC, pcwd->XORRect, &(pcwd->pIR->IconImages[nIndex]) );
                            // Draw just the AND mask
                            DrawANDMask( hDC, pcwd->ANDRect, &(pcwd->pIR->IconImages[nIndex]) );
                            // Kill the icon, we're one with it
                            if( hIcon != NULL )
                                DestroyIcon( hIcon );
                        }
                    }
                }
                // Obligtory EndPaint()
                EndPaint( hWnd, &ps );
            }
            break; // End WM_PAINT

        // WM_COMMAND - menu options, etc
        case WM_COMMAND:
            // which one is it?
            switch( LOWORD(wParam) )
            {
                // Edit->Export BMP - write icon image as BMP file
                case ID_EDIT_EXPORTBMP:
                    {
                    PCHILDWINDOWDATA pcwd                 = NULL;
                    DWORD            nIndex;
                    TCHAR            szFileName[MAX_PATH] = {0};

                    // Get the data associated this window
                    pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                    // If we have some data, including an icon resource
                    if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                    {
                        // Which image is currently selected?
                        if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                        {
                            // Get the name of the file from which to import the image
                            if( GetSaveIconFileName( szFileName, IDS_BMPFILTERSTRING, TEXT("Export to BMP File") ) )
                            {
                                HCURSOR hOldCursor;

                                // This might take a while :(
                                hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );
                                IconImageToBMPFile( szFileName, &(pcwd->pIR->IconImages[nIndex]) );
                                SetCursor( hOldCursor );
                            }
                        }
                    }
                    }
                    break; // End ID_EDIT_EXPORTBMP

                // Edit->Import BMP and Edit->Stretch-Import BMP - convert BMP file to icon
                case ID_EDIT_IMPORTBMP:  /* fall-through */
                case ID_EDIT_STRETCHIMPORTBMP:
                    {
                        PCHILDWINDOWDATA    pcwd                 = NULL;
                        DWORD               nIndex;
                        TCHAR               szFileName[MAX_PATH] = {0};

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (DWORD)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                // Get the name of the file from which to import the image
                                if( GetOpenIconFileName( szFileName, IDS_BMPFILTERSTRING, TEXT("Import from BMP File") ) )
                                {
                                    HCURSOR hOldCursor;

                                    // This might take a while :(
                                    hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );
                                    // Import the BMP image data
                                    if( IconImageFromBMPFile( szFileName, &(pcwd->pIR->IconImages[nIndex]), (LOWORD(wParam)==ID_EDIT_STRETCHIMPORTBMP)?TRUE:FALSE ) )
                                    {
                                        // which, of course, changes things
                                        pcwd->pIR->bHasChanged = TRUE;
                                        // Force a repaint
                                        InvalidateRect( hWnd, NULL, TRUE );
                                    }
                                    SetCursor( hOldCursor );
                                }
                            }
                        }
                    }
                    break; // End ID_EDIT_IMPORTBMP/ID_EDIT_STRETCHIMPORTBMP

                // User wants to add an image format
                case ID_EDIT_ADDFORMAT:
                    {
                        PICONIMAGE  pii           = NULL;
                        TCHAR       szBuffer[256] = {0};

                        // Launch the dialog to ask which size and color depth
                        if( DialogBoxParam( hInst, MAKEINTRESOURCE(IDD_ADDFORMATDLG), hWndMain, (DLGPROC)AddFormatDlgProc, (LPARAM)(&pii) ) )
                        {
                            PCHILDWINDOWDATA    pcwd    = NULL;
                            PICONRESOURCE       pNewIR  = NULL;
                            DWORD               nIndex, i;

                            // Get the data associated this window
                            pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                            // If we have some data, including an icon resource
                            if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                            {
                                // Need to see if the new format already exists in the resource
                                // We don't want dupes, so check each image for dupe
                                for(i=0;i<pcwd->pIR->nNumImages;i++)
                                {
                                    // Is it the same as the new one?
                                    if( (pcwd->pIR->IconImages[i].Width==pii->Width) &&
                                        (pcwd->pIR->IconImages[i].Height==pii->Height) &&
                                        (pcwd->pIR->IconImages[i].Colors==pii->Colors) )
                                    {
                                        // Yikes! It is - bail and select the old one
                                        MessageBox( hWnd, TEXT("That format already exists - format not added"), TEXT("Error"), MB_OK );
                                        SendMessage( pcwd->hWndFormatListBox,   CB_SETCURSEL, (WPARAM)i, (LPARAM)0 );
                                        break;
                                    }
                                }
                                // Need bigger block of memory to hold an extra image format
                                pNewIR = malloc( sizeof( ICONRESOURCE ) + ( ( pcwd->pIR->nNumImages + 1) * sizeof(ICONIMAGE) ) );
                                // Of course this changes things
                                pNewIR->bHasChanged = TRUE;
                                // Copy old to new
                                lstrcpyn( pNewIR->szOriginalICOFileName, pcwd->pIR->szOriginalICOFileName,
                                          MAX_PATH - 1);
                                lstrcpyn( pNewIR->szOriginalDLLFileName, pcwd->pIR->szOriginalDLLFileName,
                                          MAX_PATH - 1);
                                pNewIR->nNumImages = pcwd->pIR->nNumImages + 1;
                                for(i=0;i<pcwd->pIR->nNumImages;i++)
                                {
                                    memcpy( &(pNewIR->IconImages[i]), &(pcwd->pIR->IconImages[i]), sizeof( ICONIMAGE ) );
                                }
                                // Add in the new one
                                memcpy( &(pNewIR->IconImages[i]), pii, sizeof( ICONIMAGE ) );
                                // Add this new one to the list box
                                wsprintf( szBuffer, TEXT("%dx%d, %d Bit Color"), pii->Width, pii->Height, pii->Colors );
                                nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_ADDSTRING, 0, (LPARAM)szBuffer );
                                // Select the new one
                                SendMessage( pcwd->hWndFormatListBox,   CB_SETCURSEL, (WPARAM)i, (LPARAM)0 );
                                // clean up
                                free( pii );
                                free( pcwd->pIR );
                                pcwd->pIR = pNewIR;
                                // Create a nice new blank image for this format
                                CreateBlankNewFormatIcon( &(pcwd->pIR->IconImages[i]) );
                                // force a repaint
                                InvalidateRect( hWnd, NULL, TRUE );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_ADDFORMAT

                // User wants to remove an image format
                case ID_EDIT_REMOVEFORMAT:
                    {
                        PCHILDWINDOWDATA    pcwd        = NULL;
                        DWORD               nIndex, i;
                        PICONRESOURCE       pNewIR      = NULL;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                // Remove the entry from the list box
                                SendMessage( pcwd->hWndFormatListBox, CB_DELETESTRING, nIndex, 0 );
                                // Need less memory now
                                pNewIR = malloc( sizeof( ICONRESOURCE ) + ( ( pcwd->pIR->nNumImages - 1) * sizeof(ICONIMAGE) ) );
                                // Of course this changes things
                                pNewIR->bHasChanged = TRUE;
                                // Copy old to new
                                lstrcpyn( pNewIR->szOriginalICOFileName, pcwd->pIR->szOriginalICOFileName,
                                          MAX_PATH - 1);
                                lstrcpyn( pNewIR->szOriginalDLLFileName, pcwd->pIR->szOriginalDLLFileName,
                                          MAX_PATH - 1);
                                pNewIR->nNumImages = pcwd->pIR->nNumImages - 1;
                                // Copy the rest of the images from old to new
                                for(i=0;i<nIndex;i++)
                                {
                                    memcpy( &(pNewIR->IconImages[i]), &(pcwd->pIR->IconImages[i]), sizeof( ICONIMAGE ) );
                                }
                                for(;i<pcwd->pIR->nNumImages-1;i++)
                                {
                                    memcpy( &(pNewIR->IconImages[i]), &(pcwd->pIR->IconImages[i+1]), sizeof( ICONIMAGE ) );
                                }
                                // Clean up
                                free( pcwd->pIR );
                                pcwd->pIR = pNewIR;
                                // Select a different image
                                if( (int) --nIndex < 0 )
                                {
                                    nIndex = 0;
                                }
                                SendMessage( pcwd->hWndFormatListBox, CB_SETCURSEL, (WPARAM)nIndex, 0 );
                                // Force a repaint
                                InvalidateRect( hWnd, NULL, TRUE );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_REMOVEFORMAT

                // User wants to paste CF_DIB from clipboard into current image
                case ID_EDIT_STRETCHPASTE: /* fall-through */
                case ID_EDIT_PASTE:
                    {
                        PCHILDWINDOWDATA    pcwd    = NULL;
                        DWORD               nIndex;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                HCURSOR hOldCursor;

                                // This might take a while :(
                                hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );

                                // Paste over it from the clipboard
                                if( IconImageFromClipBoard( &(pcwd->pIR->IconImages[nIndex]),
                                                            LOWORD(wParam)!=ID_EDIT_PASTE ) )
                                {
                                    // which, of course, changes things
                                    pcwd->pIR->bHasChanged = TRUE;
                                }
                                // Force a repaint
                                InvalidateRect( hWnd, NULL, TRUE );
                                SetCursor( hOldCursor );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_STRETCHPASTE/ID_EDIT_PASTE

                // Put current image on the clipboard in CF_DIB format
                case ID_EDIT_COPY:
                    {
                        PCHILDWINDOWDATA    pcwd  = NULL;
                        DWORD               nIndex;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data, including an icon resource
                        if( (pcwd != NULL ) && (pcwd->pIR != NULL) && (pcwd->hWndFormatListBox!= NULL) )
                        {
                            // Which image is currently selected?
                            if( (nIndex = (ULONG)SendMessage( pcwd->hWndFormatListBox, CB_GETCURSEL, 0, 0 )) != CB_ERR )
                            {
                                // Send this image to the clipboard
                                IconImageToClipBoard( &(pcwd->pIR->IconImages[nIndex]) );
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_EDIT_COPY

                // The filename has changed, update the window title
                case ID_UPDATETITLE:
                    {
                        TCHAR            szFileTitle[MAX_PATH] = {0};
                        PCHILDWINDOWDATA pcwd                  = NULL;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data
                        if( pcwd != NULL )
                        {
                            // including an icon resource
                            if( pcwd->pIR != NULL )
                            {
                                // The calculate and set the new title
                                if( GetFileTitle( pcwd->pIR->szOriginalICOFileName, szFileTitle, MAX_PATH ) == 0 )
                                {
                                    SetWindowText( hWnd, szFileTitle );
                                }
                            }
                        }
                    }
                    break; // End WM_COMMAND -> ID_UPDATETITLE

                // How many image formats in the icon resource? (return that number)
                case ID_GETNUMFORMATS:
                    {
                        PCHILDWINDOWDATA pcwd = NULL;
                        UINT             nNum = 0;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data
                        if( pcwd != NULL )
                        {
                            // If we have a listbox, get its count, else 0
                            if( pcwd->hWndFormatListBox != NULL )
                            {
                                nNum = (UINT)SendMessage( pcwd->hWndFormatListBox, CB_GETCOUNT, 0, 0 );
                            }
                            else
                            {
                                nNum = 0;
                            }

                            // If an error occurred, default to 0
                            if( nNum == (UINT)CB_ERR )
                            {
                                nNum = 0;
                            }
                        }
                        // Send it back
                        return nNum;
                    }
                    break; // End WM_COMMAND -> ID_GETNUMFORMATS

                // Has this icon resource changed? return TRUE=yes, FALSE=no
                case ID_HASFILECHANGED:
                    {
                        PCHILDWINDOWDATA pcwd = NULL;
                        UINT             nRet = 0;

                        // Get the data associated this window
                        pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA );
                        // If we have some data
                        if( pcwd != NULL )
                        {
                            // And it includes an icon resource
                            if( pcwd->pIR != NULL )
                            {
                                // then check whether it has changed
                                return pcwd->pIR->bHasChanged == TRUE;
                            }
                        }
                        // Otherwise, return FALSE
                        return nRet;
                    }
                    break; // End WM_COMMAND -> ID_HASFILECHANGED

                // Handle selection changes, etc from listbox
                case ID_FORMAT_BOX:
                    switch( HIWORD(wParam) )
                    {
                        // If a selection is made, or changes, repaint
                        case CBN_SELCHANGE: /* fall-through */
                        case CBN_SELENDOK:
                            InvalidateRect( hWnd, NULL, TRUE );
                            break;
                    }
                    break; // End WM_COMMAND -> ID_FORMAT_BOX

                // User wants to save the ICO file
                case ID_FILE_SAVEAS: /* fall-through */
                case ID_FILE_SAVE:
                {
                    TCHAR          szFileName[MAX_PATH] = {0};
                    PCHILDWINDOWDATA pcwd                 = NULL;

                    // Get the data associated this window
                    if( ( pcwd = (PCHILDWINDOWDATA)GetWindowLongPtr( hWnd, GWLP_USERDATA ) ) != NULL )
                    {
                        // See if it includes an icon resource
                        if( pcwd->pIR != NULL )
                        {
                            HCURSOR hOldCursor = NULL;

                            // This might take a while :(
                            hOldCursor = SetCursor( LoadCursor(NULL,IDC_WAIT) );

                            // If we have an original filename, and user did *NOT* 'Save As'
                            if( ( lstrlen(pcwd->pIR->szOriginalICOFileName) > 0 ) && (LOWORD(wParam)!=ID_FILE_SAVEAS) )
                            {
                                // The just write it out
                                WriteIconToICOFile( pcwd->pIR, pcwd->pIR->szOriginalICOFileName );
                                // which, of course, brings it up to date
                                pcwd->pIR->bHasChanged = FALSE;
                            }
                            else
                            {
                                // Either we have no name, or user hit 'Save As'
                                if( GetSaveIconFileName( szFileName, IDS_FILTERSTRING, LOWORD(wParam)==ID_FILE_SAVE?TEXT("Save Icon File"):TEXT("Save Icon File As") ) )
                                {
                                    // So, write it out
                                    WriteIconToICOFile( pcwd->pIR, szFileName );
                                    // Update the name associated with the resource
                                    lstrcpyn( pcwd->pIR->szOriginalICOFileName, szFileName, MAX_PATH - 1 );
                                    // Inform window to update title
                                    SendMessage( hWnd, WM_COMMAND, ID_UPDATETITLE, 0 );
                                    // and, of course, it is now up to date
                                    pcwd->pIR->bHasChanged = FALSE;
                                }
                            }
                            SetCursor( hOldCursor );
                        }
                        else
                        {
                            MessageBox( hWnd, TEXT("Error Getting Icon Info - File Not Saved"), TEXT("Error"), MB_OK );
                        }
                    }
                }
                break; // End WM_COMMAND -> ID_FILE_SAVE/ID_FILE_SAVEAS
            }
            break; // End WM_COMMAND
    }
    return DefMDIChildProc( hWnd, Msg, wParam, lParam );
}

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Resource.h File Reference

  • WinUI
  • Resource
  • Iconpro
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | ICONPRO_ABOUT_DLG 402
#define | ICONPRO_ICON 401
#define | ICONPRO_ICON1 402
#define | ICONPRO_MENU 400
#define | ID_COLORSLIDER 615
#define | ID_COLORTEXT 710
#define | ID_EDIT_ADDFORMAT 507
#define | ID_EDIT_COPY 504
#define | ID_EDIT_EXPORTBMP 520
#define | ID_EDIT_IMPORTBMP 518
#define | ID_EDIT_PASTE 505
#define | ID_EDIT_REMOVEFORMAT 508
#define | ID_EDIT_STRETCHIMPORTBMP 519
#define | ID_EDIT_STRETCHPASTE 506
#define | ID_F_ABOUT 101
#define | ID_F_EXIT 102
#define | ID_F_MENUOPTION1 100
#define | ID_FILE_CLOSE 514
#define | ID_FILE_EXTRACT 516
#define | ID_FILE_NEW 500
#define | ID_FILE_OPEN 501
#define | ID_FILE_SAVE 502
#define | ID_FILE_SAVEAS 503
#define | ID_GETNUMFORMATS 701
#define | ID_HASFILECHANGED 705
#define | ID_HEIGHTSLIDER 610
#define | ID_HEIGHTTEXT 617
#define | ID_HELP_ABOUT 512
#define | ID_HELP_CONTENTS 513
#define | ID_UPDATETITLE 703
#define | ID_WIDTHSLIDER 609
#define | ID_WIDTHTEXT 616
#define | ID_WINDOW_ARRANGEICONS 509
#define | ID_WINDOW_CASCADE 510
#define | ID_WINDOW_TILE 511
#define | ID_WINDOW_TILEVERTICAL 515
#define | IDC_DISPLAYBOX -1
#define | IDC_DISPLAYICON 605
#define | IDC_LIST1 603
#define | IDC_SQUAREONLY 618
#define | IDC_STATIC -1
#define | IDD_ADDFORMATDLG 409
#define | IDD_EXTRACTDLG 404
#define | IDM_WINDOWCHILD 700
#define | IDS_BMPFILTERSTRING 3
#define | IDS_EXEFILTERSTRING 2
#define | IDS_FILTERSTRING 1
#define | IDS_PROGNAME 1

Define Documentation

#define ICONPRO_ABOUT_DLG 402

Definition at line 12 of file Resource.h.

#define ICONPRO_ICON 401

Definition at line 11 of file Resource.h.

#define ICONPRO_ICON1 402

Definition at line 13 of file Resource.h.

#define ICONPRO_MENU 400

Definition at line 10 of file Resource.h.

#define ID_COLORSLIDER 615

Definition at line 40 of file Resource.h.

#define ID_COLORTEXT 710

Definition at line 48 of file Resource.h.

#define ID_EDIT_ADDFORMAT 507

Definition at line 23 of file Resource.h.

#define ID_EDIT_COPY 504

Definition at line 20 of file Resource.h.

#define ID_EDIT_EXPORTBMP 520

Definition at line 35 of file Resource.h.

#define ID_EDIT_IMPORTBMP 518

Definition at line 33 of file Resource.h.

#define ID_EDIT_PASTE 505

Definition at line 21 of file Resource.h.

#define ID_EDIT_REMOVEFORMAT 508

Definition at line 24 of file Resource.h.

#define ID_EDIT_STRETCHIMPORTBMP 519

Definition at line 34 of file Resource.h.

#define ID_EDIT_STRETCHPASTE 506

Definition at line 22 of file Resource.h.

#define ID_F_ABOUT 101

Definition at line 8 of file Resource.h.

#define ID_F_EXIT 102

Definition at line 9 of file Resource.h.

#define ID_F_MENUOPTION1 100

Definition at line 7 of file Resource.h.

#define ID_FILE_CLOSE 514

Definition at line 30 of file Resource.h.

#define ID_FILE_EXTRACT 516

Definition at line 32 of file Resource.h.

#define ID_FILE_NEW 500

Definition at line 16 of file Resource.h.

#define ID_FILE_OPEN 501

Definition at line 17 of file Resource.h.

#define ID_FILE_SAVE 502

Definition at line 18 of file Resource.h.

#define ID_FILE_SAVEAS 503

Definition at line 19 of file Resource.h.

#define ID_GETNUMFORMATS 701

Definition at line 45 of file Resource.h.

#define ID_HASFILECHANGED 705

Definition at line 47 of file Resource.h.

#define ID_HEIGHTSLIDER 610

Definition at line 39 of file Resource.h.

#define ID_HEIGHTTEXT 617

Definition at line 42 of file Resource.h.

#define ID_HELP_ABOUT 512

Definition at line 28 of file Resource.h.

#define ID_HELP_CONTENTS 513

Definition at line 29 of file Resource.h.

#define ID_UPDATETITLE 703

Definition at line 46 of file Resource.h.

#define ID_WIDTHSLIDER 609

Definition at line 38 of file Resource.h.

#define ID_WIDTHTEXT 616

Definition at line 41 of file Resource.h.

#define ID_WINDOW_ARRANGEICONS 509

Definition at line 25 of file Resource.h.

#define ID_WINDOW_CASCADE 510

Definition at line 26 of file Resource.h.

#define ID_WINDOW_TILE 511

Definition at line 27 of file Resource.h.

#define ID_WINDOW_TILEVERTICAL 515

Definition at line 31 of file Resource.h.

#define IDC_DISPLAYBOX -1

Definition at line 49 of file Resource.h.

#define IDC_DISPLAYICON 605

Definition at line 37 of file Resource.h.

#define IDC_LIST1 603

Definition at line 36 of file Resource.h.

#define IDC_SQUAREONLY 618

Definition at line 43 of file Resource.h.

#define IDC_STATIC -1

Definition at line 50 of file Resource.h.

#define IDD_ADDFORMATDLG 409

Definition at line 15 of file Resource.h.

#define IDD_EXTRACTDLG 404

Definition at line 14 of file Resource.h.

#define IDM_WINDOWCHILD 700

Definition at line 44 of file Resource.h.

#define IDS_BMPFILTERSTRING 3

Definition at line 6 of file Resource.h.

#define IDS_EXEFILTERSTRING 2

Definition at line 5 of file Resource.h.

#define IDS_FILTERSTRING 1

Definition at line 4 of file Resource.h.

#define IDS_PROGNAME 1

Definition at line 3 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/msgtable/MsgTest.c File Reference

  • WinUI
  • Resource
  • msgtable
Defines | Functions

MsgTest.c File Reference

#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "messages.h"

Go to the source code of this file.

Defines

#define | FACILITY_MASK 0x0FFF0000
#define | MAX_MESSAGES 5
#define | MAX_MSG_LENGTH 1024
#define | MSG_ID_MASK 0x0000FFFF
#define | SEVERITY_MASK 0xC0000000

Functions

int __cdecl | _tmain ()
VOID | myPutMsg (HINSTANCE hLib, PVOID pArgs, DWORD dwMsgId, DWORD dwLangId)

Define Documentation

#define FACILITY_MASK 0x0FFF0000

Definition at line 14 of file MsgTest.c.

#define MAX_MESSAGES 5

Definition at line 11 of file MsgTest.c.

#define MAX_MSG_LENGTH 1024

Definition at line 12 of file MsgTest.c.

#define MSG_ID_MASK 0x0000FFFF

Definition at line 15 of file MsgTest.c.

#define SEVERITY_MASK 0xC0000000

Definition at line 13 of file MsgTest.c.

Function Documentation

int __cdecl _tmain ( void )

Definition at line 154 of file MsgTest.c.

{
    HINSTANCE hLib = NULL;  /* handle to the messagetable DLL */
    PTCHAR aInsertStrs[8] = {0};  /* array of 32-bit insert values for FormatMessage*/
    WORD wLangID;

    /* Check to make sure we are running on Windows NT */
    if( GetVersion() & 0x80000000 )
    {
        MessageBox(NULL,
            TEXT("Sorry, this application requires Windows NT.\n")
            TEXT("This application will now terminate."),
            TEXT("Error: Windows NT Required to Run"),  MB_OK );
        return(1);
    }

    /*
     * Load the resource library without calling any entry points since
     * this is a resource-only DLL
     * Note that in general one should use absolute paths in calls of
     * LoadLibraries and LoadLibraryEx, because relative paths pose a
     * significant security risk. For more information refer to MSDN for the
     * documentation of LoadLibrary and LoadLibraryEx
     */
    hLib = LoadLibraryEx(TEXT("messages.dll"), NULL, DONT_RESOLVE_DLL_REFERENCES);
    if (!hLib)
    {
        _tprintf(TEXT("Error %d from LoadLibrary\n"), GetLastError());
    }

    /* Messages in the .mc file have been defined using standard locale ID's:
       see MAKELANGID and LANG_* definitions in winnt.h */
    wLangID = LANG_USER_DEFAULT;

    /*
     * To force a different language, define the language ID as one of the values
     * defined in the Language statement in the .mc file. Alternatively, you
     * can choose a different language in the International applet in the control
     * panel and stick with LANG_USER_DEFAULT.
     */
    //wLangID = 0x411;

    /*
     * Output some error messages from the messagetable DLL
     * The first three have no insert strings
     */
    myPutMsg(hLib, NULL, MSG_BAD_COMMAND, wLangID);
    myPutMsg(hLib, NULL, MSG_BAD_PARM1, wLangID);
    myPutMsg(hLib, NULL, MSG_STRIKE_ANY_KEY, wLangID);

    /* wait for user to hit enter as per last error message */
    getchar();

    /*
     * The next two messages contain insert strings - set up our array
     * of insert strings and pass the array to myPutMsg()
     */
    aInsertStrs[0] = TEXT("foo.c");
    aInsertStrs[1] = TEXT("BAR");
    myPutMsg(hLib, aInsertStrs, MSG_CMD_DELETE, wLangID);

    aInsertStrs[0] = (PTCHAR) 47;
    aInsertStrs[1] = (PTCHAR) 5;
    myPutMsg(hLib, aInsertStrs, MSG_RETRYS, wLangID);
    return(0);
}

VOID myPutMsg | ( | HINSTANCE | hLib,
 |  | PVOID | pArgs,
 |  | DWORD | dwMsgId,
 |  | DWORD | dwLangId
 | ) |  |

Definition at line 32 of file MsgTest.c.

{
    BOOL bSuccess  = FALSE;
    PTSTR msgBuf   = NULL;  /* hold text of the error message that we build */
    int dwCode;  /* hold various codes extracted from dwMsgId */

    /*

    Here is the layout of the message ID:

    3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
    1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
    +---+-+-+-----------------------+-------------------------------+
    |Sev|C|R|     Facility          |               Code            |
    +---+-+-+-----------------------+-------------------------------+

    where

      Sev - is the severity code
      C - is the Customer code flag
      R - is a reserved bit
      Facility - is the facility code
      Code - is the facility's status code
    */

    _tprintf(TEXT("Severity: "));
    /* output the severity and facility code. Mask off the severity */
    /* bits with SEVERITY_MASK and shift them down */
    dwCode = (dwMsgId & SEVERITY_MASK) >> 30;
    switch (dwCode)
    {
        case STATUS_SEVERITY_WARNING:
            _tprintf(TEXT("STATUS_SEVERITY_WARNING  "));
            break;

        case STATUS_SEVERITY_SUCCESS:
            _tprintf(TEXT("STATUS_SEVERITY_SUCCESS  "));
            break;

        case STATUS_SEVERITY_INFORMATIONAL:
            _tprintf(TEXT("STATUS_SEVERITY_INFORMATIONAL  "));
            break;

        case STATUS_SEVERITY_ERROR:
            _tprintf(TEXT("STATUS_SEVERITY_ERROR  "));
            break;

        default:
            _tprintf(TEXT("Unknown!  "));
            break;
    }

    _tprintf (TEXT("\nFacility: "));
    /* Mask off the facility bits with FACILITY_MASK and shift them down */
    dwCode = (dwMsgId & FACILITY_MASK) >> 16;
    switch (dwCode)
    {
        case FACILITY_SYSTEM:
            _tprintf(TEXT("FACILITY_SYSTEM  "));
            break;

        case FACILITY_STUBS:
            _tprintf(TEXT("FACILITY_STUBS  "));
            break;

        case FACILITY_RUNTIME:
            _tprintf(TEXT("FACILITY_RUNTIME  "));
            break;

        case FACILITY_IO_ERROR_CODE:
            _tprintf(TEXT("FACILITY_IO_ERROR_CODE  "));
            break;

        default:
             _tprintf(TEXT("Unknown!  "));
             break;
    }

    /* retrieve and format the message from the messagetable DLL. */
    bSuccess = FormatMessage(
        FORMAT_MESSAGE_FROM_HMODULE         |   /* get the message from the DLL */
            FORMAT_MESSAGE_ALLOCATE_BUFFER  |   /* allocate the msg buffer for us */
            FORMAT_MESSAGE_ARGUMENT_ARRAY   |   /* pArgs is an array of 32-bit values */
        60,                                     /* line length for the mesages */
        hLib,                                   /* the messagetable DLL handle */
        dwMsgId,                                /* message ID */
        dwLangId,                               /* language ID as defined in .mc file */
        msgBuf,                                 /* address of pointer to buffer for message */
        MAX_MSG_LENGTH,                         /* maximum size of the message buffer */
        pArgs);                                 /* array of insert strings for the message */

    if (!bSuccess)
    {
        _tprintf(TEXT("Error %d from FormatMessage\n"), GetLastError());
    }
    else
    {
        /* mask off the actual message number with MSG_ID_MASK and show it */
        _tprintf(TEXT("\nError: %d: %s"), dwMsgId & MSG_ID_MASK, msgBuf);
        /* Free the buffer that FormatMessage allocated for us. */
        LocalFree((HLOCAL) msgBuf);
    }

    _tprintf(TEXT("\n__________\n"));
    CloseHandle(hLib);
}

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/sendto/sendto.c File Reference

  • WinUI
  • sendto
Functions | Variables

sendto.c File Reference

#include "SendTo.h"

Go to the source code of this file.

Functions

void | DoDrop (LPDATAOBJECT pdto, LPDROPTARGET pdt)
LPSHELLFOLDER | GetSpecialFolder (HWND hwnd, int idFolder)
HRESULT | GetUIObjectOfAbsPidl (HWND hwnd, LPITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
HRESULT | GetUIObjectOfPath (HWND hwnd, LPCSTR pszPath, REFIID riid, LPVOID *ppvOut)
BOOL | InitApp (void)
LPITEMIDLIST | PidlFromPath (HWND hwnd, LPCSTR pszPath)
void | SendTo_FillSendToMenu (HWND hwnd, HMENU hmenu)
void | SendTo_OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
BOOL | SendTo_OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
void | SendTo_OnDestroy (HWND hwnd)
void | SendTo_OnInitMenuPopup (HWND hwnd, HMENU hmenu, UINT item, BOOL fSystemMenu)
void | SendTo_OnOpen (HWND hwnd)
void | SendTo_ResetSendToMenu (HMENU hmenu)
void | SendTo_SendToItem (HWND hwnd, int idm)
LRESULT CALLBACK | SendTo_WndProc (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
void | ShellFree (LPVOID pv)
LPITEMIDLIST | StepOverPidl (LPITEMIDLIST pidl)
void | StrRetToStr (LPSTRRET pstr, LPITEMIDLIST pidl)
void | TermApp (void)
int WINAPI | WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)

Variables

HINSTANCE | g_hinst
HMENU | g_hmenuSendTo
LPMALLOC | g_pMalloc
LPSHELLFOLDER | g_psfDesktop
char | g_szFileName [MAX_PATH]

Function Documentation

void DoDrop | ( | LPDATAOBJECT | pdto,
 |  | LPDROPTARGET | pdt
 | ) |  |

Definition at line 365 of file sendto.c.

{
    POINTL pt = { 0, 0 };
    DWORD dwEffect;
    HRESULT hres;

    /*
     *  The data object enters the drop target via the left button
     *  with all drop effects permitted.
     */
    dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE | DROPEFFECT_LINK;
    hres = pdt->lpVtbl->DragEnter(pdt, pdto, MK_LBUTTON, pt, &dwEffect);
    if (SUCCEEDED(hres) && dwEffect) {
        /*
         *  The drop target likes the data object and the effect.
         *  Go drop it.
         */
        hres = pdt->lpVtbl->Drop(pdt, pdto, MK_LBUTTON, pt, &dwEffect);

    } else {
        /*
         *  The drop target didn't like us.  Tell it we're leaving,
         *  sorry to bother you.
         */
        hres = pdt->lpVtbl->DragLeave(pdt);
    }
}

LPSHELLFOLDER GetSpecialFolder | ( | HWND | hwnd,
 |  | int | idFolder
 | ) |  |

Definition at line 170 of file sendto.c.

{
    HRESULT hres;
    LPSHELLFOLDER psf;
    LPITEMIDLIST pidl;

    hres = SHGetSpecialFolderLocation(hwnd, CSIDL_SENDTO, &pidl);
    if (SUCCEEDED(hres)) {
        hres = g_psfDesktop->lpVtbl->BindToObject(g_psfDesktop,
                    pidl, NULL, &IID_IShellFolder, (LPVOID *)&psf);
        if (SUCCEEDED(hres)) {
            /* Woo-hoo, we're done */
        } else {
            psf = NULL;
        }
        ShellFree(pidl);
    } else {
        psf = NULL;
    }
    return psf;
}

HRESULT GetUIObjectOfAbsPidl | ( | HWND | hwnd,
 |  | LPITEMIDLIST | pidl,
 |  | REFIID | riid,
 |  | LPVOID * | ppvOut
 | ) |  |

Definition at line 246 of file sendto.c.

{
    /*
     *  To get the UI object of an absolute pidl, we must first bind
     *  to its parent, and then call GetUIObjectOf on the last part.
     */

    LPITEMIDLIST pidlLast, pidlNext;
    USHORT cb;
    LPSHELLFOLDER psf;
    HRESULT hres;

    /*
     *  Just for safety's sake.
     */
    *ppvOut = NULL;

    /*
     *  Walk the incoming pidl to split it into the parent part
     *  and the last part.  (This is the Shell Namespace version
     *  of walking a path to split it into a directory part and
     *  a filename part.)
     */

    for (pidlLast = pidl; pidlNext = StepOverPidl(pidlLast),
                          pidlNext->mkid.cb; pidlLast = pidlNext) {
        /* Keep walking */
    }

    /*
     *  Now temporarily split the pidl at the point we found.
     *  Save the value we smash so we can restore it.
     */
    cb = pidlLast->mkid.cb;
    pidlLast->mkid.cb = 0;

    /*
     *  Bind to the folder part.  Note that if pidlLast == pidl, then
     *  this means that there is no folder part; the item is a direct
     *  child of the desktop.  (Note that we need to AddRef to balance
     *  the Release we do afterwards.)
     */
    if (pidl == pidlLast) {
        psf = g_psfDesktop;
        g_psfDesktop->lpVtbl->AddRef(g_psfDesktop);
        hres = S_OK;
    } else {
        hres = g_psfDesktop->lpVtbl->BindToObject(g_psfDesktop, pidl,
                        NULL, &IID_IShellFolder, (LPVOID *)&psf);
    }

    /*
     *  Before we forget, restore the pidl we temporarily edited.
     */
    pidlLast->mkid.cb = cb;

    if (FAILED(hres)) {
        /*
         *  Couldn't even get to the parent; we have no chance of
         *  getting to the item itself.
         */
        return hres;
    }

    /*
     *  Now ask the parent for the the UI object of the child.
     */
    hres = psf->lpVtbl->GetUIObjectOf(psf, hwnd, 1, &pidlLast,
                                riid, NULL, ppvOut);

    /*
     *  Regardless of whether or not the GetUIObjectOf succeeded,
     *  we have no further use for the parent folder.
     */
    psf->lpVtbl->Release(psf);

    return hres;
}

HRESULT GetUIObjectOfPath | ( | HWND | hwnd,
 |  | LPCSTR | pszPath,
 |  | REFIID | riid,
 |  | LPVOID * | ppvOut
 | ) |  |

Definition at line 334 of file sendto.c.

{
    LPITEMIDLIST pidl;
    HRESULT hres;

    /*
     *  Just for safety's sake.
     */
    *ppvOut = NULL;

    pidl = PidlFromPath(hwnd, pszPath);
    if (!pidl) {
        return E_FAIL;
    }

    hres = GetUIObjectOfAbsPidl(hwnd, pidl, riid, ppvOut);

    ShellFree(pidl);

    return hres;
}

BOOL InitApp ( void )

Definition at line 700 of file sendto.c.

{
    WNDCLASS wc;
    HRESULT hr;

    wc.style = 0;
    wc.lpfnWndProc = SendTo_WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = g_hinst;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName = "SendToMenu";
    wc.lpszClassName = "SendTo";

    RegisterClass(&wc);

    hr = SHGetMalloc(&g_pMalloc);
    if (FAILED(hr)) {
        return FALSE;
    }

    hr = SHGetDesktopFolder(&g_psfDesktop);
    if (FAILED(hr)) {
        return FALSE;
    }

    return TRUE;
}

LPITEMIDLIST PidlFromPath | ( | HWND | hwnd,
 |  | LPCSTR | pszPath
 | ) |  |

Definition at line 201 of file sendto.c.

{
    LPITEMIDLIST pidl;
    ULONG ulEaten;
    DWORD dwAttributes;
    HRESULT hres;
    WCHAR wszName[MAX_PATH];

    if (!MultiByteToWideChar(CP_ACP, 0, pszPath, -1, wszName, MAX_PATH)) {
        return NULL;
    }

    hres = g_psfDesktop->lpVtbl->ParseDisplayName(g_psfDesktop, hwnd,
                         NULL, wszName, &ulEaten, &pidl, &dwAttributes);
    if (FAILED(hres)) {
        return NULL;
    }

    return pidl;
}

void SendTo_FillSendToMenu | ( | HWND | hwnd,
 |  | HMENU | hmenu
 | ) |  |

Definition at line 453 of file sendto.c.

{
    MENUITEMINFO mii;
    LPSHELLFOLDER psf;
    LPITEMIDLIST pidl;
    LPENUMIDLIST peidl;
    HRESULT hres;
    STRRET str;
    UINT idm = IDM_SENDTOFIRST;

    psf = GetSpecialFolder(hwnd, CSIDL_SENDTO);
    if (psf) {
        hres = psf->lpVtbl->EnumObjects(psf, hwnd,
                    SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
                    &peidl);
        if (SUCCEEDED(hres)) {
            while (peidl->lpVtbl->Next(peidl, 1, &pidl, NULL) == S_OK &&
                   idm < IDM_SENDTOLAST) {
                hres = psf->lpVtbl->GetDisplayNameOf(psf, pidl,
                                    SHGDN_NORMAL, &str);
                if (SUCCEEDED(hres)) {

                    StrRetToStr(&str, pidl);

                    if (AppendMenu(hmenu, MF_ENABLED | MF_STRING,
                                   idm, str.cStr)) {
                        mii.cbSize = sizeof(mii);
                        mii.fMask = MIIM_DATA;
                        mii.dwItemData = (ULONG_PTR)pidl;
                        SetMenuItemInfo(hmenu, idm, FALSE, &mii);
                        idm++;

                    }
                }
            }
            peidl->lpVtbl->Release(peidl);
        }
        psf->lpVtbl->Release(psf);

    }

    /*
     *  If the menu is still empty (the user has an empty SendTo folder),
     *  then add a disabled "None" item so we have at least something
     *  to display.
     */
    if (idm == IDM_SENDTOFIRST) {
        AppendMenu(hmenu, MF_GRAYED | MF_DISABLED | MF_STRING,
                   idm, "(none)");
    }
}

void SendTo_OnCommand | ( | HWND | hwnd,
 |  | int | id,
 |  | HWND | hwndCtl,
 |  | UINT | codeNotify
 | ) |  |

Definition at line 635 of file sendto.c.

{
    if (id >= IDM_SENDTOFIRST && id <= IDM_SENDTOLAST) {
        SendTo_SendToItem(hwnd, id);
    } else if (id == IDM_OPEN) {
        SendTo_OnOpen(hwnd);
    }
}

BOOL SendTo_OnCreate | ( | HWND | hwnd,
 |  | LPCREATESTRUCT | lpCreateStruct
 | ) |  |

Definition at line 403 of file sendto.c.

{
    MENUITEMINFO mii;
    HMENU hmenu;
    mii.cbSize = sizeof(mii);
    mii.fMask = MIIM_SUBMENU;

    hmenu = GetMenu(hwnd);
    if (GetMenuItemInfo(hmenu, IDM_SENDTOPOPUP, FALSE, &mii)) {
        g_hmenuSendTo = mii.hSubMenu;
    }

    return TRUE;
}

void SendTo_OnDestroy ( HWND hwnd )

Definition at line 656 of file sendto.c.

{
    if (g_hmenuSendTo) {
        SendTo_ResetSendToMenu(g_hmenuSendTo);
    }

    PostQuitMessage(0);
}

void SendTo_OnInitMenuPopup | ( | HWND | hwnd,
 |  | HMENU | hmenu,
 |  | UINT | item,
 |  | BOOL | fSystemMenu
 | ) |  |

Definition at line 515 of file sendto.c.

{

    /*
     *  If it's the SendTo menu, then rebuild it.
     */
    if (hmenu == g_hmenuSendTo) {
        SendTo_ResetSendToMenu(hmenu);
        SendTo_FillSendToMenu(hwnd, hmenu);
    }
}

void SendTo_OnOpen ( HWND hwnd )

Definition at line 538 of file sendto.c.

{
    OPENFILENAME ofn;
    char szFileName[MAX_PATH];
    char szTitle[64];

    ZeroMemory(&ofn, sizeof(ofn));
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = hwnd;
    lstrcpy(szFileName, g_szFileName);
    ofn.lpstrFile = szFileName;
    ofn.nMaxFile = MAX_PATH;
    ofn.lpstrFileTitle = szTitle;
    ofn.nMaxFileTitle = 64;
    ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
    if (GetOpenFileName(&ofn)) {
        lstrcpy(g_szFileName, szFileName);
        wsprintf(szFileName, "%s - SendTo Demo", szTitle);
        SetWindowText(hwnd, szFileName);
    }
}

void SendTo_ResetSendToMenu ( HMENU hmenu )

Definition at line 427 of file sendto.c.

{
    MENUITEMINFO mii;

    mii.cbSize = sizeof(mii);
    mii.fMask = MIIM_DATA;

    while (GetMenuItemInfo(hmenu, 0, TRUE, &mii)) {
        if (mii.dwItemData) {
            ShellFree((LPVOID)mii.dwItemData);
        }
        DeleteMenu(hmenu, 0, MF_BYPOSITION);
    }

}

void SendTo_SendToItem | ( | HWND | hwnd,
 |  | int | idm
 | ) |  |

Definition at line 572 of file sendto.c.

{
    MENUITEMINFO mii;
    LPSHELLFOLDER psf;
    LPITEMIDLIST pidl;
    LPDATAOBJECT pdto;
    LPDROPTARGET pdt;
    HRESULT hres;

    /*
     *  First convert our filename to a data object.
     */
    hres = GetUIObjectOfPath(hwnd, g_szFileName, &IID_IDataObject,
                                    (LPVOID *)&pdto);

    if (SUCCEEDED(hres)) {

        /*
         *  Now go find the item we should send to.
         */
        mii.cbSize = sizeof(mii);
        mii.fMask = MIIM_DATA;
        if (GetMenuItemInfo(g_hmenuSendTo, idm, FALSE, &mii) &&
            mii.dwItemData) {
            pidl = (LPITEMIDLIST)mii.dwItemData;

            /*
             *  Now convert the send to pidl to a drop target.
             */
            psf = GetSpecialFolder(hwnd, CSIDL_SENDTO);
            if (psf) {
                hres = psf->lpVtbl->GetUIObjectOf(psf, hwnd, 1, &pidl,
                                    &IID_IDropTarget, NULL, (LPVOID *)&pdt);
                if (SUCCEEDED(hres)) {

                    /*
                     *  Now drop the file on the drop target.
                     */

                    DoDrop(pdto, pdt);
                    pdt->lpVtbl->Release(pdt);
                }

                psf->lpVtbl->Release(psf);
            }
        }
        pdto->lpVtbl->Release(pdto);
    }

}

LRESULT CALLBACK SendTo_WndProc | ( | HWND | hwnd,
 |  | UINT | uiMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 674 of file sendto.c.

{
    switch (uiMsg) {

    HANDLE_MSG(hwnd, WM_CREATE, SendTo_OnCreate);

    HANDLE_MSG(hwnd, WM_COMMAND, SendTo_OnCommand);

    HANDLE_MSG(hwnd, WM_INITMENUPOPUP, SendTo_OnInitMenuPopup);

    HANDLE_MSG(hwnd, WM_DESTROY, SendTo_OnDestroy);

    }

    return DefWindowProc(hwnd, uiMsg, wParam, lParam);
}

void ShellFree ( LPVOID pv )

Definition at line 111 of file sendto.c.

{
    g_pMalloc->lpVtbl->Free(g_pMalloc, pv);
}

LPITEMIDLIST StepOverPidl ( LPITEMIDLIST pidl )

Definition at line 231 of file sendto.c.

{
    return (LPITEMIDLIST)((BYTE*)pidl + pidl->mkid.cb);
}

void StrRetToStr | ( | LPSTRRET | pstr,
 |  | LPITEMIDLIST | pidl
 | ) |  |

Definition at line 125 of file sendto.c.

{
    LPWSTR pOleStr;

    switch (pstr->uType) {

    case STRRET_WSTR:
        /*
         *      The pOleStr points to a WCHAR string that we convert
         *      to ANSI.  We need to stash pstr->pOleStr into a safe
         *      place, because pstr->cStr lives in the same place.
         */
        pOleStr = pstr->pOleStr;
        WideCharToMultiByte(CP_ACP, 0, pOleStr, -1,
                            pstr->cStr, MAX_PATH, NULL, NULL);
        ShellFree(pOleStr);
        break;

    case STRRET_OFFSET:
        /*
         *      The string lives inside the pidl, so copy it out.
         */
        lstrcpyn(pstr->cStr, (LPSTR)((LPBYTE)pidl + pstr->uOffset), MAX_PATH);
        break;

    case STRRET_CSTR:
        /*
         *      The string already is in the right place.
         */
        break;
    }
}

void TermApp ( void )

Definition at line 740 of file sendto.c.

{
    if (g_pMalloc) {
        g_pMalloc->lpVtbl->Release(g_pMalloc);
        g_pMalloc = NULL;
    }

    if (g_psfDesktop) {
        g_psfDesktop->lpVtbl->Release(g_psfDesktop);
        g_psfDesktop = NULL;
    }

}

int WINAPI WinMain | ( | HINSTANCE | hinst,
 |  | HINSTANCE | hinstPrev,
 |  | LPSTR | pszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 765 of file sendto.c.

{
    MSG msg;
    HWND hwnd;
    HRESULT hrInit;

    g_hinst = hinst;

    if (!InitApp()) return 0;

    hrInit = CoInitialize(NULL);

    hwnd = CreateWindow(
        "SendTo",                       /* Class Name */
        "SendTo Demo",                  /* Title */
        WS_OVERLAPPEDWINDOW,            /* Style */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
        NULL,                           /* Parent */
        NULL,                           /* No menu */
        hinst,                          /* Instance */
        0);                             /* No special parameters */

    ShowWindow(hwnd, nCmdShow);

    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    TermApp();

    if (SUCCEEDED(hrInit))
        CoUninitialize();

    return 0;
}

Variable Documentation

HINSTANCE g_hinst

Definition at line 88 of file sendto.c.

HMENU g_hmenuSendTo

Definition at line 91 of file sendto.c.

LPMALLOC g_pMalloc

Definition at line 89 of file sendto.c.

LPSHELLFOLDER g_psfDesktop

Definition at line 90 of file sendto.c.

char g_szFileName[MAX_PATH]

Definition at line 92 of file sendto.c.

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/sendto/sendto.h File Reference

  • WinUI
  • sendto
Defines

sendto.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#include <commdlg.h>

Go to the source code of this file.

Defines

#define | _WIN32_WINDOWS 0x0400
#define | IDM_OPEN 0x0100
#define | IDM_SENDTOFIRST 0x0200
#define | IDM_SENDTOLAST 0x02FF
#define | IDM_SENDTOPOPUP 0x0101
#define | STRICT

Define Documentation

#define _WIN32_WINDOWS 0x0400

Definition at line 18 of file sendto.h.

#define IDM_OPEN 0x0100

Definition at line 26 of file sendto.h.

#define IDM_SENDTOFIRST 0x0200

Definition at line 29 of file sendto.h.

#define IDM_SENDTOLAST 0x02FF

Definition at line 30 of file sendto.h.

#define IDM_SENDTOPOPUP 0x0101

Definition at line 27 of file sendto.h.

#define STRICT

Definition at line 17 of file sendto.h.

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/AppBar.c File Reference

  • WinUI
  • Shell
  • AppBar
Functions | Variables

AppBar.c File Reference

#include <windows.h>
#include <windowsx.h>
#include "globals.h"
#include "resource.h"
#include "appbar.h"

Go to the source code of this file.

Functions

BOOL | AppBar_AutoHide (HWND hwnd)
void | AppBar_Callback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void | AppBar_Hide (HWND hwnd)
BOOL | AppBar_NoAutoHide (HWND hwnd)
void | AppBar_PosChanged (PAPPBARDATA pabd)
void | AppBar_QueryPos (HWND hwnd, LPRECT lprc)
void | AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
BOOL | AppBar_Register (HWND hwnd)
void | AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
BOOL | AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
void | AppBar_SetAutoHideTimer (HWND hwnd)
void | AppBar_SetAutoUnhideTimer (HWND hwnd)
BOOL | AppBar_SetSide (HWND hwnd, UINT uSide)
void | AppBar_Size (HWND hwnd)
void | AppBar_UnHide (HWND hwnd)
BOOL | AppBar_UnRegister (HWND hwnd)
POPTIONS | GetAppbarData (HWND hwnd)

Variables

DWORD g_cxWidth
DWORD g_cyHeight
BOOL | g_fAppRegistered = FALSE
RECT | g_rcAppBar

Function Documentation

BOOL AppBar_AutoHide ( HWND hwnd )

Definition at line 477 of file AppBar.c.

{
    HWND hwndAutoHide;
    APPBARDATA abd;
    POPTIONS pOpt = GetAppbarData(hwnd);
    BOOL fSuccess;
    RECT rc;

    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;
    abd.uEdge = pOpt->uSide;

    // First figure out if someone already has this side for
    // autohiding
    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
    if (hwndAutoHide != NULL)
    {
        DebugMsg(TEXT("ERROR: Another appbar is already hiding ")
                 TEXT("on this edge.  Cannot set to autohide.\r\n"));
        return (FALSE);
    }

    // We can autohide on this edge.  Set the autohide style.
    abd.lParam = TRUE;

    fSuccess = (BOOL) SHAppBarMessage(ABM_SETAUTOHIDEBAR, &abd);
    if (!fSuccess)
    {
        DebugMsg(TEXT("ERROR: Error trying to set autohidebar.\r\n"));
        ErrorHandler();
        return (FALSE);
    }
    else
    {
        // Since we're allowed to autohide, we need to adjust our screen
        // rectangle to the autohidden position.  This will allow the system
        // to resize the desktop.
        pOpt->fAutoHide = TRUE;
        g_cxWidth = pOpt->cxWidth;
        g_cyHeight = pOpt->cyHeight;

        rc = g_rcAppBar;
        switch (pOpt->uSide)
        {
            case ABE_TOP:
                rc.bottom = rc.top + 2;
                break;
            case ABE_BOTTOM:
                rc.top = rc.bottom - 2;
                break;
            case ABE_LEFT:
                rc.right = rc.left + 2;
                break;
            case ABE_RIGHT:
                rc.left = rc.right - 2;
                break;
        }

        AppBar_QuerySetPos(pOpt->uSide, &rc, &abd, TRUE);
    }

    return (TRUE);
}

void AppBar_Callback | ( | HWND | hwnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 324 of file AppBar.c.

{
    APPBARDATA abd;
    static HWND hwndZOrder = NULL;
    POPTIONS pOpt = GetAppbarData(hwnd);

    abd.cbSize = sizeof(abd);
    abd.hWnd = hwnd;

    switch (wParam)
    {
        // Notifies the appbar that the taskbar's autohide or always-on-top
        // state has changed.  The appbar can use this to conform to the settings
        // of the system taskbar.
        case ABN_STATECHANGE:
            DebugMsg("AppBarCallback: ABN_STATECHANGE\r\n");
            break;

        // Notifies the appbar when a full screen application is opening or
        // closing.  When a full screen app is opening, the appbar must drop
        // to the bottom of the Z-Order.  When the app is closing, we should
        // restore our Z-order position.
        case ABN_FULLSCREENAPP:
            DebugMsg("AppBarCallback: ABN_FULLSCREENAPP\r\n");
            if (lParam)
            {
                // A full screen app is opening.  Move us to the bottom of the
                // Z-Order.

                // First get the window that we're underneath so we can correctly
                // restore our position
                hwndZOrder = GetWindow(hwnd, GW_HWNDPREV);

                // Now move ourselves to the bottom of the Z-Order
                SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0,
                             SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
            }
            else
            {
                // The app is closing.  Restore the Z-order
                SetWindowPos(hwnd, pOpt->fOnTop ? HWND_TOPMOST : hwndZOrder,
                             0, 0, 0, 0,
                             SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

                hwndZOrder = NULL;
            }
            break;

        // Notifies the appbar when an event has occured that may effect the
        // appbar's size and position.  These events include changes in the
        // taskbar's size, position, and visiblity as well as adding, removing,
        // or resizing another appbar on the same side of the screen.
        case ABN_POSCHANGED:
            DebugMsg("AppBarCallback: ABN_POSCHANGED\r\n");

            // Update our position in response to the system change
            AppBar_PosChanged(&abd);
            break;
    }
}

void AppBar_Hide ( HWND hwnd )

Definition at line 717 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    RECT rc;

    // Don't want to hide if AutoHide not set
    if (!pOpt->fAutoHide)
    {
        return;
    }

    // Calculate a hidden rectangle to use
    rc = g_rcAppBar;
    switch (pOpt->uSide)
    {
        case ABE_TOP:
            rc.bottom = rc.top + 2;
            break;
        case ABE_BOTTOM:
            rc.top = rc.bottom - 2;
            break;
        case ABE_LEFT:
            rc.right = rc.left + 2;
            break;
        case ABE_RIGHT:
            rc.left = rc.right - 2;
            break;
    }

    pOpt->fHiding = TRUE;
    SlideWindow(hwnd, &rc);
}

BOOL AppBar_NoAutoHide ( HWND hwnd )

Definition at line 556 of file AppBar.c.

{
    HWND hwndAutoHide;
    APPBARDATA abd;
    POPTIONS pOpt = GetAppbarData(hwnd);
    BOOL fSuccess;

    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;
    abd.uEdge = pOpt->uSide;

    // First let's check to see if we're the appbar attached to the
    // side of the screen
    abd.uEdge = pOpt->uSide;
    hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
    if (hwndAutoHide != hwnd)
    {
        DebugMsg(TEXT("ERROR: We're not hidden currently\r\n"));
        return (FALSE);
    }

    // We can autohide or stop autohide on this edge.  Set the autohide style.
    abd.lParam = FALSE;

    fSuccess = (BOOL) SHAppBarMessage(ABM_SETAUTOHIDEBAR, &abd);
    if (!fSuccess)
    {
        DebugMsg(TEXT("ERROR: Error trying to set autohidebar.\r\n"));
        ErrorHandler();
        return (FALSE);
    }
    else
    {
        // Need to change the appbar to get the screen desktop space
        // back.  Also need to reattach the appbar to that edge of the
        // screen.
        pOpt->fAutoHide = FALSE;

        pOpt->cxWidth = g_cxWidth;
        pOpt->cyHeight = g_cyHeight;

        AppBar_SetSide(hwnd, pOpt->uSide);
    }

    return (TRUE);
}

void AppBar_PosChanged ( PAPPBARDATA pabd )

Definition at line 238 of file AppBar.c.

{
    RECT rc;
    RECT rcWindow;
    int iHeight;
    int iWidth;
    POPTIONS pOpt = GetAppbarData(pabd->hWnd);

    DebugMsg("AppBarPosChanged\r\n");

    // Start by getting the size of the screen.
    rc.top = 0;
    rc.left = 0;
    rc.right = GetSystemMetrics(SM_CXSCREEN);
    rc.bottom = GetSystemMetrics(SM_CYSCREEN);

    // Update the g_rcAppbar so when we slide (if hidden) we slide to the
    // right place.
    if (pOpt->fAutoHide)
    {
        g_rcAppBar = rc;
        switch (pOpt->uSide)
        {
            case ABE_TOP:
                g_rcAppBar.bottom = g_rcAppBar.top + g_cyHeight;
                break;

            case ABE_BOTTOM:
                g_rcAppBar.top = g_rcAppBar.bottom - g_cyHeight;
                break;

            case ABE_LEFT:
                g_rcAppBar.right = g_rcAppBar.left + g_cxWidth;
                break;

            case ABE_RIGHT:
                g_rcAppBar.left = g_rcAppBar.right - g_cxWidth;
                break;
        }
    }

    // Now get the current window rectangle and find the height and width
    GetWindowRect(pabd->hWnd, &rcWindow);
    iHeight = rcWindow.bottom - rcWindow.top;
    iWidth = rcWindow.right - rcWindow.left;

    // Depending on which side we're on, try to preserve the thickness of
    // the window
    switch (pOpt->uSide)
    {
        case ABE_TOP:
            rc.bottom = rc.top + iHeight;
            break;

        case ABE_BOTTOM:
            rc.top = rc.bottom - iHeight;
            break;

        case ABE_LEFT:
            rc.right = rc.left + iWidth;
            break;

        case ABE_RIGHT:
            rc.left = rc.right - iWidth;
            break;
    }

    // Move the appbar.
    AppBar_QuerySetPos(pOpt->uSide, &rc, pabd, TRUE);

}

void AppBar_QueryPos | ( | HWND | hwnd,
 |  | LPRECT | lprc
 | ) |  |

Definition at line 102 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    APPBARDATA abd;
    int iWidth = 0;
    int iHeight = 0;

    // Fill out the APPBARDATA struct and save the edge we're moving to
    // in the appbar OPTIONS struct.
    abd.hWnd = hwnd;
    abd.cbSize = sizeof(APPBARDATA);
    abd.rc = *lprc;
    abd.uEdge = pOpt->uSide;

    // Calculate the part we want to occupy.  We only figure out the top
    // and bottom coordinates if we're on the top or bottom of the screen.
    // Likewise for the left and right.  We will always try to occupy the
    // full height or width of the screen edge.
    if ((ABE_LEFT == abd.uEdge) || (ABE_RIGHT == abd.uEdge))
    {
        iWidth = abd.rc.right - abd.rc.left;
        abd.rc.top = 0;
        abd.rc.bottom = GetSystemMetrics(SM_CYSCREEN);
    }
    else
    {
        iHeight = abd.rc.bottom - abd.rc.top;
        abd.rc.left = 0;
        abd.rc.right = GetSystemMetrics(SM_CXSCREEN);
    }

    // Ask the system for the screen space
    SHAppBarMessage(ABM_QUERYPOS, &abd);

    // The system will return an approved position along the edge we're asking
    // for.  However, if we can't get the exact position requested, the system
    // only updates the edge that's incorrect.  For example, if we want to
    // attach to the bottom of the screen and the taskbar is already there,
    // we'll pass in a rect like 0, 964, 1280, 1024 and the system will return
    // 0, 964, 1280, 996.  Since the appbar has to be above the taskbar, the
    // bottom of the rect was adjusted to 996.  We need to adjust the opposite
    // edge of the rectangle to preserve the height we want.

    switch (abd.uEdge)
    {
        case ABE_LEFT:
            abd.rc.right = abd.rc.left + iWidth;
            break;

        case ABE_RIGHT:
            abd.rc.left = abd.rc.right - iWidth;
            break;

        case ABE_TOP:
            abd.rc.bottom = abd.rc.top + iHeight;
            break;

        case ABE_BOTTOM:
            abd.rc.top = abd.rc.bottom - iHeight;
            break;
    }

    *lprc = abd.rc;
}

void AppBar_QuerySetPos | ( | UINT | uEdge,
 |  | LPRECT | lprc,
 |  | PAPPBARDATA | pabd,
 |  | BOOL | fMove
 | ) |  |

Definition at line 187 of file AppBar.c.

{
    int iHeight = 0;
    int iWidth = 0;
    POPTIONS pOpt = GetAppbarData(pabd->hWnd);

    DebugMsg("AppBarQuerySetPos: uEdge=%d, lprc->left=%d, lprc->top=%d, "
             "lprc->right=%d, lprc->bottom=%d\r\n", uEdge, lprc->left,
             lprc->top, lprc->right, lprc->bottom);

    // Fill out the APPBARDATA struct and save the edge we're moving to
    // in the appbar OPTIONS struct.
    pabd->rc = *lprc;
    pabd->uEdge = uEdge;
    pOpt->uSide = uEdge;

    AppBar_QueryPos(pabd->hWnd, &(pabd->rc));

    // Tell the system we're moving to this new approved position.
    SHAppBarMessage(ABM_SETPOS, pabd);

    if (fMove)
    {
        // Move the appbar window to the new position
        MoveWindow(pabd->hWnd, pabd->rc.left, pabd->rc.top,
                   pabd->rc.right - pabd->rc.left,
                   pabd->rc.bottom - pabd->rc.top, TRUE);
    }

    // Save the appbar rect.  We use this later when we autohide.  If we're
    // currently hidden, then don't mess with this.
    if (!pOpt->fAutoHide)
        g_rcAppBar = pabd->rc;
}

BOOL AppBar_Register ( HWND hwnd )

Definition at line 401 of file AppBar.c.

{
    APPBARDATA abd;

    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;
    abd.uCallbackMessage = APPBAR_CALLBACK;

    g_fAppRegistered = (BOOL)SHAppBarMessage(ABM_NEW, &abd);
    return g_fAppRegistered;
}

void AppBar_SetAlwaysOnTop | ( | HWND | hwnd,
 |  | BOOL | fOnTop
 | ) |  |

Definition at line 694 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    // Update the window position to HWND_TOPMOST if we're to be always
    // on top, or HWND_NOTOPMOST if we're not.
    SetWindowPos(hwnd, (fOnTop) ? HWND_TOPMOST : HWND_NOTOPMOST,
                 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

    // Store the setting in the appbar OPTIONS struct.
    pOpt->fOnTop = fOnTop;
}

BOOL AppBar_SetAutoHide | ( | HWND | hwnd,
 |  | BOOL | fHide
 | ) |  |

Definition at line 454 of file AppBar.c.

{
    if (fHide)
        return AppBar_AutoHide(hwnd);
    else
        return AppBar_NoAutoHide(hwnd);
}

void AppBar_SetAutoHideTimer ( HWND hwnd )

Definition at line 784 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    if (pOpt->fAutoHide)
        SetTimer(hwnd, IDT_AUTOHIDE, 500, NULL);
}

void AppBar_SetAutoUnhideTimer ( HWND hwnd )

Definition at line 806 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    if (pOpt->fAutoHide && pOpt->fHiding)
        SetTimer(hwnd, IDT_AUTOUNHIDE, 50, NULL);
}

BOOL AppBar_SetSide | ( | HWND | hwnd,
 |  | UINT | uSide
 | ) |  |

Definition at line 618 of file AppBar.c.

{
    APPBARDATA abd;
    RECT       rc;
    POPTIONS   pOpt = GetAppbarData(hwnd);
    BOOL       fAutoHide = FALSE;

    // Calculate the size of the screen so we can occupy the full width or
    // height of the screen on the edge we request.
    rc.top = 0;
    rc.left = 0;
    rc.right = GetSystemMetrics(SM_CXSCREEN);
    rc.bottom = GetSystemMetrics(SM_CYSCREEN);

    // Fill out the APPBARDATA struct with the basic information
    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;

    // If the appbar is autohidden, turn that off so we can move the bar
    if (pOpt->fAutoHide)
    {
        fAutoHide = pOpt->fAutoHide;

        // Turn off the redrawing of the desktop while we move things around.
        // If you put any breakpoints in this area you will lock up the desktop
        // Since turning off the desktop repaints turns it off for all the apps
        // in the system
        SetWindowRedraw(GetDesktopWindow(), FALSE);
        AppBar_SetAutoHide(hwnd, FALSE);
    }

    // Adjust the rectangle to set our height or width depending on the
    // side we want.
    switch (uSide)
    {
        case ABE_TOP:
            rc.bottom = rc.top + pOpt->cyHeight;
            break;
        case ABE_BOTTOM:
            rc.top = rc.bottom - pOpt->cyHeight;
            break;
        case ABE_LEFT:
            rc.right = rc.left + pOpt->cxWidth;
            break;
        case ABE_RIGHT:
            rc.left = rc.right - pOpt->cxWidth;
            break;
    }

    // Move the appbar to the new screen space.
    AppBar_QuerySetPos(uSide, &rc, &abd, TRUE);

    // If the appbar was hidden, rehide it now
    if (fAutoHide)
    {
        AppBar_SetAutoHide(hwnd, TRUE);

        SetWindowRedraw(GetDesktopWindow(), TRUE);
        RedrawWindow(GetDesktopWindow(), NULL, NULL,
                     RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);
    }

    return (TRUE);
}

void AppBar_Size ( HWND hwnd )

Definition at line 69 of file AppBar.c.

{
    RECT rc;
    APPBARDATA abd;
    POPTIONS pOpt;

    if (g_fAppRegistered)
    {
        DebugMsg("AppBarSize Called\r\n");

        pOpt = GetAppbarData(hwnd);

        abd.cbSize = sizeof(APPBARDATA);
        abd.hWnd = hwnd;

        GetWindowRect(hwnd, &rc);
        AppBar_QuerySetPos(pOpt->uSide, &rc, &abd, TRUE);
    }
}

void AppBar_UnHide ( HWND hwnd )

Definition at line 760 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    SlideWindow(hwnd, &g_rcAppBar);
    pOpt->fHiding = FALSE;

    AppBar_SetAutoHideTimer(hwnd);
}

BOOL AppBar_UnRegister ( HWND hwnd )

Definition at line 427 of file AppBar.c.

{
    APPBARDATA abd;

    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;

    g_fAppRegistered = !SHAppBarMessage(ABM_REMOVE, &abd);

    return !g_fAppRegistered;
}

POPTIONS GetAppbarData ( HWND hwnd )

Definition at line 828 of file AppBar.c.

{
    return (POPTIONS) GetWindowLongPtr(hwnd, 0);
}

Variable Documentation

DWORD g_cxWidth

Definition at line 56 of file AppBar.c.

DWORD g_cyHeight

Definition at line 56 of file AppBar.c.

BOOL g_fAppRegistered = FALSE

Definition at line 53 of file AppBar.c.

RECT g_rcAppBar

Definition at line 54 of file AppBar.c.

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/AppBar.h File Reference

  • WinUI
  • Shell
  • AppBar
Classes | Defines | Typedefs | Functions | Variables

AppBar.h File Reference

Go to the source code of this file.

Classes

struct | tagOPTIONS

Defines

#define | APPBAR_BOTTOM 1
#define | APPBAR_LEFT 2
#define | APPBAR_RIGHT 3
#define | APPBAR_TOP 0
#define | CX_DEFWIDTH 80
#define | CY_DEFHEIGHT 60
#define | IDT_AUTOHIDE 1
#define | IDT_AUTOUNHIDE 2

Typedefs

typedef struct tagOPTIONS | OPTIONS
typedef struct tagOPTIONS * | POPTIONS

Functions

void | AppBar_Callback (HWND, UINT, WPARAM, LPARAM)
void | AppBar_Hide (HWND hwnd)
void | AppBar_PosChanged (PAPPBARDATA)
void | AppBar_QueryPos (HWND, LPRECT)
void | AppBar_QuerySetPos (UINT, LPRECT, PAPPBARDATA, BOOL)
BOOL | AppBar_Register (HWND hwnd)
void | AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
BOOL | AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
void | AppBar_SetAutoHideTimer (HWND hwnd)
void | AppBar_SetAutoUnhideTimer (HWND hwnd)
BOOL | AppBar_SetSide (HWND hwnd, UINT uSide)
void | AppBar_Size (HWND)
void | AppBar_UnHide (HWND hwnd)
BOOL | AppBar_UnRegister (HWND hwnd)
POPTIONS | GetAppbarData (HWND)

Variables

BOOL g_fAppRegistered
RECT | g_rcAppBar

Define Documentation

#define APPBAR_BOTTOM 1

Definition at line 26 of file AppBar.h.

#define APPBAR_LEFT 2

Definition at line 27 of file AppBar.h.

#define APPBAR_RIGHT 3

Definition at line 28 of file AppBar.h.

#define APPBAR_TOP 0

Definition at line 25 of file AppBar.h.

#define CX_DEFWIDTH 80

Definition at line 19 of file AppBar.h.

#define CY_DEFHEIGHT 60

Definition at line 20 of file AppBar.h.

#define IDT_AUTOHIDE 1

Definition at line 22 of file AppBar.h.

#define IDT_AUTOUNHIDE 2

Definition at line 23 of file AppBar.h.

Typedef Documentation

typedef struct tagOPTIONS OPTIONS
typedef struct tagOPTIONS * POPTIONS

Function Documentation

void AppBar_Callback | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 324 of file AppBar.c.

{
    APPBARDATA abd;
    static HWND hwndZOrder = NULL;
    POPTIONS pOpt = GetAppbarData(hwnd);

    abd.cbSize = sizeof(abd);
    abd.hWnd = hwnd;

    switch (wParam)
    {
        // Notifies the appbar that the taskbar's autohide or always-on-top
        // state has changed.  The appbar can use this to conform to the settings
        // of the system taskbar.
        case ABN_STATECHANGE:
            DebugMsg("AppBarCallback: ABN_STATECHANGE\r\n");
            break;

        // Notifies the appbar when a full screen application is opening or
        // closing.  When a full screen app is opening, the appbar must drop
        // to the bottom of the Z-Order.  When the app is closing, we should
        // restore our Z-order position.
        case ABN_FULLSCREENAPP:
            DebugMsg("AppBarCallback: ABN_FULLSCREENAPP\r\n");
            if (lParam)
            {
                // A full screen app is opening.  Move us to the bottom of the
                // Z-Order.

                // First get the window that we're underneath so we can correctly
                // restore our position
                hwndZOrder = GetWindow(hwnd, GW_HWNDPREV);

                // Now move ourselves to the bottom of the Z-Order
                SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0,
                             SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
            }
            else
            {
                // The app is closing.  Restore the Z-order
                SetWindowPos(hwnd, pOpt->fOnTop ? HWND_TOPMOST : hwndZOrder,
                             0, 0, 0, 0,
                             SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

                hwndZOrder = NULL;
            }
            break;

        // Notifies the appbar when an event has occured that may effect the
        // appbar's size and position.  These events include changes in the
        // taskbar's size, position, and visiblity as well as adding, removing,
        // or resizing another appbar on the same side of the screen.
        case ABN_POSCHANGED:
            DebugMsg("AppBarCallback: ABN_POSCHANGED\r\n");

            // Update our position in response to the system change
            AppBar_PosChanged(&abd);
            break;
    }
}

void AppBar_Hide ( HWND hwnd )

Definition at line 717 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    RECT rc;

    // Don't want to hide if AutoHide not set
    if (!pOpt->fAutoHide)
    {
        return;
    }

    // Calculate a hidden rectangle to use
    rc = g_rcAppBar;
    switch (pOpt->uSide)
    {
        case ABE_TOP:
            rc.bottom = rc.top + 2;
            break;
        case ABE_BOTTOM:
            rc.top = rc.bottom - 2;
            break;
        case ABE_LEFT:
            rc.right = rc.left + 2;
            break;
        case ABE_RIGHT:
            rc.left = rc.right - 2;
            break;
    }

    pOpt->fHiding = TRUE;
    SlideWindow(hwnd, &rc);
}

void AppBar_PosChanged ( PAPPBARDATA )

Definition at line 238 of file AppBar.c.

{
    RECT rc;
    RECT rcWindow;
    int iHeight;
    int iWidth;
    POPTIONS pOpt = GetAppbarData(pabd->hWnd);

    DebugMsg("AppBarPosChanged\r\n");

    // Start by getting the size of the screen.
    rc.top = 0;
    rc.left = 0;
    rc.right = GetSystemMetrics(SM_CXSCREEN);
    rc.bottom = GetSystemMetrics(SM_CYSCREEN);

    // Update the g_rcAppbar so when we slide (if hidden) we slide to the
    // right place.
    if (pOpt->fAutoHide)
    {
        g_rcAppBar = rc;
        switch (pOpt->uSide)
        {
            case ABE_TOP:
                g_rcAppBar.bottom = g_rcAppBar.top + g_cyHeight;
                break;

            case ABE_BOTTOM:
                g_rcAppBar.top = g_rcAppBar.bottom - g_cyHeight;
                break;

            case ABE_LEFT:
                g_rcAppBar.right = g_rcAppBar.left + g_cxWidth;
                break;

            case ABE_RIGHT:
                g_rcAppBar.left = g_rcAppBar.right - g_cxWidth;
                break;
        }
    }

    // Now get the current window rectangle and find the height and width
    GetWindowRect(pabd->hWnd, &rcWindow);
    iHeight = rcWindow.bottom - rcWindow.top;
    iWidth = rcWindow.right - rcWindow.left;

    // Depending on which side we're on, try to preserve the thickness of
    // the window
    switch (pOpt->uSide)
    {
        case ABE_TOP:
            rc.bottom = rc.top + iHeight;
            break;

        case ABE_BOTTOM:
            rc.top = rc.bottom - iHeight;
            break;

        case ABE_LEFT:
            rc.right = rc.left + iWidth;
            break;

        case ABE_RIGHT:
            rc.left = rc.right - iWidth;
            break;
    }

    // Move the appbar.
    AppBar_QuerySetPos(pOpt->uSide, &rc, pabd, TRUE);

}

void AppBar_QueryPos | ( | HWND | ,
 |  | LPRECT |
 | ) |  |

Definition at line 102 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    APPBARDATA abd;
    int iWidth = 0;
    int iHeight = 0;

    // Fill out the APPBARDATA struct and save the edge we're moving to
    // in the appbar OPTIONS struct.
    abd.hWnd = hwnd;
    abd.cbSize = sizeof(APPBARDATA);
    abd.rc = *lprc;
    abd.uEdge = pOpt->uSide;

    // Calculate the part we want to occupy.  We only figure out the top
    // and bottom coordinates if we're on the top or bottom of the screen.
    // Likewise for the left and right.  We will always try to occupy the
    // full height or width of the screen edge.
    if ((ABE_LEFT == abd.uEdge) || (ABE_RIGHT == abd.uEdge))
    {
        iWidth = abd.rc.right - abd.rc.left;
        abd.rc.top = 0;
        abd.rc.bottom = GetSystemMetrics(SM_CYSCREEN);
    }
    else
    {
        iHeight = abd.rc.bottom - abd.rc.top;
        abd.rc.left = 0;
        abd.rc.right = GetSystemMetrics(SM_CXSCREEN);
    }

    // Ask the system for the screen space
    SHAppBarMessage(ABM_QUERYPOS, &abd);

    // The system will return an approved position along the edge we're asking
    // for.  However, if we can't get the exact position requested, the system
    // only updates the edge that's incorrect.  For example, if we want to
    // attach to the bottom of the screen and the taskbar is already there,
    // we'll pass in a rect like 0, 964, 1280, 1024 and the system will return
    // 0, 964, 1280, 996.  Since the appbar has to be above the taskbar, the
    // bottom of the rect was adjusted to 996.  We need to adjust the opposite
    // edge of the rectangle to preserve the height we want.

    switch (abd.uEdge)
    {
        case ABE_LEFT:
            abd.rc.right = abd.rc.left + iWidth;
            break;

        case ABE_RIGHT:
            abd.rc.left = abd.rc.right - iWidth;
            break;

        case ABE_TOP:
            abd.rc.bottom = abd.rc.top + iHeight;
            break;

        case ABE_BOTTOM:
            abd.rc.top = abd.rc.bottom - iHeight;
            break;
    }

    *lprc = abd.rc;
}

void AppBar_QuerySetPos | ( | UINT | ,
 |  | LPRECT | ,
 |  | PAPPBARDATA | ,
 |  | BOOL |
 | ) |  |

Definition at line 187 of file AppBar.c.

{
    int iHeight = 0;
    int iWidth = 0;
    POPTIONS pOpt = GetAppbarData(pabd->hWnd);

    DebugMsg("AppBarQuerySetPos: uEdge=%d, lprc->left=%d, lprc->top=%d, "
             "lprc->right=%d, lprc->bottom=%d\r\n", uEdge, lprc->left,
             lprc->top, lprc->right, lprc->bottom);

    // Fill out the APPBARDATA struct and save the edge we're moving to
    // in the appbar OPTIONS struct.
    pabd->rc = *lprc;
    pabd->uEdge = uEdge;
    pOpt->uSide = uEdge;

    AppBar_QueryPos(pabd->hWnd, &(pabd->rc));

    // Tell the system we're moving to this new approved position.
    SHAppBarMessage(ABM_SETPOS, pabd);

    if (fMove)
    {
        // Move the appbar window to the new position
        MoveWindow(pabd->hWnd, pabd->rc.left, pabd->rc.top,
                   pabd->rc.right - pabd->rc.left,
                   pabd->rc.bottom - pabd->rc.top, TRUE);
    }

    // Save the appbar rect.  We use this later when we autohide.  If we're
    // currently hidden, then don't mess with this.
    if (!pOpt->fAutoHide)
        g_rcAppBar = pabd->rc;
}

BOOL AppBar_Register ( HWND hwnd )

Definition at line 401 of file AppBar.c.

{
    APPBARDATA abd;

    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;
    abd.uCallbackMessage = APPBAR_CALLBACK;

    g_fAppRegistered = (BOOL)SHAppBarMessage(ABM_NEW, &abd);
    return g_fAppRegistered;
}

void AppBar_SetAlwaysOnTop | ( | HWND | hwnd,
 |  | BOOL | fOnTop
 | ) |  |

Definition at line 694 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    // Update the window position to HWND_TOPMOST if we're to be always
    // on top, or HWND_NOTOPMOST if we're not.
    SetWindowPos(hwnd, (fOnTop) ? HWND_TOPMOST : HWND_NOTOPMOST,
                 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

    // Store the setting in the appbar OPTIONS struct.
    pOpt->fOnTop = fOnTop;
}

BOOL AppBar_SetAutoHide | ( | HWND | hwnd,
 |  | BOOL | fHide
 | ) |  |

Definition at line 454 of file AppBar.c.

{
    if (fHide)
        return AppBar_AutoHide(hwnd);
    else
        return AppBar_NoAutoHide(hwnd);
}

void AppBar_SetAutoHideTimer ( HWND hwnd )

Definition at line 784 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    if (pOpt->fAutoHide)
        SetTimer(hwnd, IDT_AUTOHIDE, 500, NULL);
}

void AppBar_SetAutoUnhideTimer ( HWND hwnd )

Definition at line 806 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    if (pOpt->fAutoHide && pOpt->fHiding)
        SetTimer(hwnd, IDT_AUTOUNHIDE, 50, NULL);
}

BOOL AppBar_SetSide | ( | HWND | hwnd,
 |  | UINT | uSide
 | ) |  |

Definition at line 618 of file AppBar.c.

{
    APPBARDATA abd;
    RECT       rc;
    POPTIONS   pOpt = GetAppbarData(hwnd);
    BOOL       fAutoHide = FALSE;

    // Calculate the size of the screen so we can occupy the full width or
    // height of the screen on the edge we request.
    rc.top = 0;
    rc.left = 0;
    rc.right = GetSystemMetrics(SM_CXSCREEN);
    rc.bottom = GetSystemMetrics(SM_CYSCREEN);

    // Fill out the APPBARDATA struct with the basic information
    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;

    // If the appbar is autohidden, turn that off so we can move the bar
    if (pOpt->fAutoHide)
    {
        fAutoHide = pOpt->fAutoHide;

        // Turn off the redrawing of the desktop while we move things around.
        // If you put any breakpoints in this area you will lock up the desktop
        // Since turning off the desktop repaints turns it off for all the apps
        // in the system
        SetWindowRedraw(GetDesktopWindow(), FALSE);
        AppBar_SetAutoHide(hwnd, FALSE);
    }

    // Adjust the rectangle to set our height or width depending on the
    // side we want.
    switch (uSide)
    {
        case ABE_TOP:
            rc.bottom = rc.top + pOpt->cyHeight;
            break;
        case ABE_BOTTOM:
            rc.top = rc.bottom - pOpt->cyHeight;
            break;
        case ABE_LEFT:
            rc.right = rc.left + pOpt->cxWidth;
            break;
        case ABE_RIGHT:
            rc.left = rc.right - pOpt->cxWidth;
            break;
    }

    // Move the appbar to the new screen space.
    AppBar_QuerySetPos(uSide, &rc, &abd, TRUE);

    // If the appbar was hidden, rehide it now
    if (fAutoHide)
    {
        AppBar_SetAutoHide(hwnd, TRUE);

        SetWindowRedraw(GetDesktopWindow(), TRUE);
        RedrawWindow(GetDesktopWindow(), NULL, NULL,
                     RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);
    }

    return (TRUE);
}

void AppBar_Size ( HWND )

Definition at line 69 of file AppBar.c.

{
    RECT rc;
    APPBARDATA abd;
    POPTIONS pOpt;

    if (g_fAppRegistered)
    {
        DebugMsg("AppBarSize Called\r\n");

        pOpt = GetAppbarData(hwnd);

        abd.cbSize = sizeof(APPBARDATA);
        abd.hWnd = hwnd;

        GetWindowRect(hwnd, &rc);
        AppBar_QuerySetPos(pOpt->uSide, &rc, &abd, TRUE);
    }
}

void AppBar_UnHide ( HWND hwnd )

Definition at line 760 of file AppBar.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    SlideWindow(hwnd, &g_rcAppBar);
    pOpt->fHiding = FALSE;

    AppBar_SetAutoHideTimer(hwnd);
}

BOOL AppBar_UnRegister ( HWND hwnd )

Definition at line 427 of file AppBar.c.

{
    APPBARDATA abd;

    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;

    g_fAppRegistered = !SHAppBarMessage(ABM_REMOVE, &abd);

    return !g_fAppRegistered;
}

POPTIONS GetAppbarData ( HWND )

Definition at line 828 of file AppBar.c.

{
    return (POPTIONS) GetWindowLongPtr(hwnd, 0);
}

Variable Documentation

BOOL g_fAppRegistered

Definition at line 53 of file AppBar.c.

RECT g_rcAppBar

Definition at line 54 of file AppBar.c.

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/Globals.h File Reference

  • WinUI
  • Shell
  • AppBar
Defines | Typedefs | Enumerations | Functions | Variables

Globals.h File Reference

Go to the source code of this file.

Defines

#define | APPBAR_CALLBACK WM_USER + 1010
#define | ErrorHandler() ErrorHandlerEx(__LINE__, __FILE__)
#define | FORWARD_WM_MOVING(hwnd, fwSide, lprc) (BOOL)(DWORD)(fn)((hwnd), WM_MOVING, (WPARAM)(fwSide), (LPARAM)(LPRECT)(lprc))
#define | HANDLE_WM_MOVING(hwnd, wParam, lParam, fn) (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (wParam), (LPRECT)(lParam))

Typedefs

typedef enum tagVERSION | VERSION

Enumerations

enum | tagVERSION { WINNT, WIN32S, WIN95 }

Functions

int | DebugMsg (const TCHAR *pFmt,...)
void | ErrorHandlerEx (INT, LPSTR)
BOOL | InitApplication (HINSTANCE)
BOOL | InitInstance (HINSTANCE, int)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
void | ShowOptions (HWND hwndParent)
void | SlideWindow (HWND, LPRECT)

Variables

HINSTANCE | g_hInstance
VERSION version

Define Documentation

#define APPBAR_CALLBACK WM_USER + 1010

Definition at line 23 of file Globals.h.

#define ErrorHandler ( ) ErrorHandlerEx(__LINE__, __FILE__)

Definition at line 48 of file Globals.h.

#define FORWARD_WM_MOVING | ( | hwnd,
 |  | fwSide,
 |  | lprc |
 | ) |  | (BOOL)(DWORD)(fn)((hwnd), WM_MOVING, (WPARAM)(fwSide), (LPARAM)(LPRECT)(lprc))

Definition at line 54 of file Globals.h.

#define HANDLE_WM_MOVING | ( | hwnd,
 |  | wParam,
 |  | lParam,
 |  | fn |
 | ) |  | (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (wParam), (LPRECT)(lParam))

Definition at line 52 of file Globals.h.

Typedef Documentation

typedef enum tagVERSION VERSION

Enumeration Type Documentation

enum tagVERSION
Enumerator:
WINNT
WIN32S
WIN95

Definition at line 21 of file Globals.h.

{WINNT, WIN32S, WIN95} VERSION;

Function Documentation

int DebugMsg | ( | const TCHAR * | pFmt,
 |  |  | ...
 | ) |  |

Definition at line 330 of file Main.c.

{
    int i;
    const int iMsgSize = 512;
    va_list pArgs;
    char szMsg[512];

    // outputs formatted string to debugger
    // returns count of bytes written or -1 if buffer size is too small

    va_start( pArgs, pFmt );

    #ifdef UNICODE
        i = _vsnwprintf(szMsg, iMsgSize+1, pFmt, pArgs);
    #else
        i = _vsnprintf(szMsg, iMsgSize+1, pFmt, pArgs);
    #endif

    va_end( pArgs );

    OutputDebugString( szMsg );

    return( i );
}

void ErrorHandlerEx | ( | INT | ,
 |  | LPSTR |
 | ) |  |

Definition at line 248 of file Main.c.

{
    LPVOID lpvMessage;
    DWORD  dwError;
    TCHAR  szBuffer[256];

    // The the text of the error message
    dwError = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                            FORMAT_MESSAGE_FROM_SYSTEM,
                            NULL,
                            GetLastError(),
                            MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
                            (LPTSTR)&lpvMessage,
                            0,
                            NULL);

    // Check to see if an error occured calling FormatMessage()
    if (0 == dwError)
    {
        wsprintf(szBuffer, TEXT("An error occured calling FormatMessage().")
                 TEXT("Error Code %d"), GetLastError());
        MessageBox(NULL, szBuffer, TEXT("Generic"), MB_ICONSTOP |
                   MB_ICONEXCLAMATION);
        return;
    }

    // Display the error message
    wsprintf(szBuffer, TEXT("Generic, Line=%d, File=%s"), wLine, lpszFile);
    MessageBox(NULL, lpvMessage, szBuffer, MB_ICONEXCLAMATION | MB_OK);

    return;
}

BOOL InitApplication ( HINSTANCE )

Definition at line 186 of file Generic.C.

{
    WNDCLASS  wc;
    HWND      hwnd;

    // Win32 will always set hPrevInstance to NULL, so lets check
    // things a little closer. This is because we only want a single
    // version of this app to run at a time
    hwnd = FindWindow (szAppName, szTitle);
    if (hwnd)
    {
        // We found another version of ourself. Lets defer to it:
        if (IsIconic(hwnd))
        {
            ShowWindow(hwnd, SW_RESTORE);
        }
        SetForegroundWindow (hwnd);

        // If this app actually had any functionality, we would
        // also want to communicate any action that our 'twin'
        // should now perform based on how the user tried to
        // execute us.
        return FALSE;
    }

    // Fill in window class structure with parameters that describe
    // the main window.
    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = (WNDPROC)WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon (hInstance, szAppName);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);

    // Since Windows95 has a slightly different recommended
    // format for the 'Help' menu, lets put this in the alternate menu like this:
    if (IS_WIN95)
    {
        wc.lpszMenuName  = "WIN95";
    }
    else
    {
        wc.lpszMenuName  = szAppName;
    }
    wc.lpszClassName = szAppName;

    // Register the window class and return success/failure code.
    if (IS_WIN95)
    {
        return MyRegisterClass(&wc);
    }
    else
    {
        return RegisterClass(&wc);
    }
}

BOOL InitInstance | ( | HINSTANCE | ,
 |  | int |
 | ) |  |

Definition at line 255 of file Generic.C.

{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szAppName, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
      NULL, NULL, hInstance, NULL);

   if (!hWnd) {
      return (FALSE);
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return (TRUE);
}

LRESULT CALLBACK MainWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 3333 of file sdkdiff.cpp.

{
    char str[32];
    long ret;
    DWORD threadid;
  HRESULT hr;

    switch (message) {

        case WM_CREATE:

            /* initialise menu options to default/saved
             * option settings
             */

#define CHECKMENU(id, fChecked)  \
          CheckMenuItem(hMenu, (id), (fChecked) ? MF_CHECKED:MF_UNCHECKED)

            /* outline_include options */
            CHECKMENU(IDM_OUTLINE_INCSAME,   (outline_include & INCLUDE_SAME));
            CHECKMENU(IDM_OUTLINE_INCLEFT,   (outline_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_OUTLINE_INCRIGHT,  (outline_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_OUTLINE_INCDIFFER, (outline_include & INCLUDE_DIFFER));

            /* expand_include options */
            CHECKMENU(IDM_EXPAND_INCSAME,         (expand_include & INCLUDE_SAME));
            CHECKMENU(IDM_EXPAND_INCLEFT,         (expand_include & INCLUDE_LEFTONLY));
            CHECKMENU(IDM_EXPAND_INCRIGHT,        (expand_include & INCLUDE_RIGHTONLY));
            CHECKMENU(IDM_EXPAND_INCMOVEDLEFT,    (expand_include & INCLUDE_MOVEDLEFT));
            CHECKMENU(IDM_EXPAND_INCMOVEDRIGHT,   (expand_include & INCLUDE_MOVEDRIGHT));
            CHECKMENU(IDM_EXPAND_INCSIMILARLEFT,  (expand_include & INCLUDE_SIMILARLEFT));
            CHECKMENU(IDM_EXPAND_INCSIMILARRIGHT, (expand_include & INCLUDE_SIMILARRIGHT));

            /* other options */
            CHECKMENU(line_numbers, TRUE);
            CHECKMENU(expand_mode, TRUE);
            CHECKMENU(IDM_IGNBLANKS, ignore_blanks);
            CHECKMENU(IDM_SHOWWHITESPACE, show_whitespace);
            CHECKMENU(IDM_ALG2, Algorithm2);
            CHECKMENU(IDM_MONOCOLS, mono_colours);
            CHECKMENU(IDM_PICTURE, picture_mode);
            CHECKMENU(IDM_HIDEMARK, hide_markedfiles);
#undef CHECKMENU

            /* nothing currently displayed */
            DisplayMode = MODE_NULL;

            break;

        case WM_SYSCOLORCHANGE:
            {
                HIGHCONTRAST hc;

                hc.cbSize = sizeof(hc);
                SystemParametersInfo(SPI_GETHIGHCONTRAST,0 ,&hc, 0);

                mono_colours = (hc.dwFlags & HCF_HIGHCONTRASTON);
                if (mono_colours) {
                    SetMonoColours();
                } else {
                    SetColours();
                }

                CheckMenuItem(hMenu, IDM_MONOCOLS,
                              mono_colours? MF_CHECKED:MF_UNCHECKED);
                hr = StringCchPrintf(str, 32, szD, mono_colours);
        if (FAILED(hr))
          OutputError(hr, IDS_SAFE_PRINTF);
                WriteProfileString(APPNAME, szMonoColours, str);
                SendMessage(hwndRCD, message, wParam, lParam);
                SendMessage(hwndStatus, message, wParam, lParam);
                SendMessage(hwndBar, message, wParam, lParam);

                /* The diffs are still valid, but force a re-display
                 * of bar window and main table.
                 */
                SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                InvalidateRect(hwndBar, NULL, TRUE);
                view_changeviewoptions(current_view);
            }
            break;

        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
                case IDM_EXIT:
                    if (ghThread!=NULL) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                        break;
                    }
                    if (!view_isexpanded(current_view)) {
                        /* save the current outline size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szOutlineShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szOutlineMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szOutlineMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szOutlineNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szOutlineNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szOutlineNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szOutlineNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szOutlineSaved, 1);
                        }
                    } else {
                        /* save the current expanded size and position */
                        WINDOWPLACEMENT wp;
                        wp.length = sizeof(wp);
                        if (GetWindowPlacement(hwndClient,&wp)) {
                            WriteProfileInt(APPNAME, szExpandShowCmd, wp.showCmd);
                            WriteProfileInt(APPNAME, szExpandMaxX, wp.ptMaxPosition.x);
                            WriteProfileInt(APPNAME, szExpandMaxY, wp.ptMaxPosition.y);
                            WriteProfileInt(APPNAME, szExpandNormLeft, wp.rcNormalPosition.left);
                            WriteProfileInt(APPNAME, szExpandNormTop, wp.rcNormalPosition.top);
                            WriteProfileInt(APPNAME, szExpandNormRight, wp.rcNormalPosition.right);
                            WriteProfileInt(APPNAME, szExpandNormBottom, wp.rcNormalPosition.bottom);
                            WriteProfileInt(APPNAME, szExpandedSaved, 1);
                        }
                    }
                    DestroyWindow(hWnd);
                    break;

                case IDM_ABORT:
                    /* abort menu item, or status bar button.
                     * the status bar button text gives the appropriate
                     * action depending on our state - abort, outline
                     * or expand. But the command sent is always
                     * IDM_ABORT. Thus we need to check the state
                     * to see what to do. If we are busy, set the abort
                     * flag. If there is nothing to view,
                     * exit, otherwise switch outline<->expand
                     */
                    if (IsBusy()) {
                        bAbort = TRUE;
                        SetStatus(LoadRcString(IDS_ABORT_PENDING));
                    } else if (DisplayMode == MODE_NULL) {
                        DestroyWindow(hWnd);
                    } else if (DisplayMode == MODE_EXPAND) {
                        ToOutline(hWnd);
                    } else {
                        ToExpand(hWnd);
                    }
                    break;

                case IDM_FILE:
                    /* select two files and compare them */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        /* make a COMPLIST using the files dialog,
                         * and notify the view
                         */
                        if (complist_filedialog(current_view) == NULL) {
                            view_close(current_view);
                        }

                        /* all done! */
                        SetNotBusy();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_DIR:

                    /* read two directory names, scan them and
                     * compare all the files and subdirs.
                     */
                    if (SetBusy()) {

                        /* close the current view */
                        view_close(current_view);

                        /* make a new empty view */
                        current_view = view_new(hwndRCD);

                        ghThread = CreateThread(NULL, 0, wd_dirdialog,
                                                (LPVOID) current_view, 0, &threadid);

                        if (ghThread == NULL)
                        {

                            /*
                             * either we are on WIN16, or the
                             * thread call failed. continue
                             * single-threaded.
                             */
                            wd_dirdialog( (LPVOID) current_view);

                        }

                    } else {
                        BusyError();
                    }
                    break;

                case IDM_CLOSE:
                    /* close the output list -
                     * discard all results so far
                     */
                    if (!IsBusy()) {
                        view_close(current_view);
                    }
                    break;

                case IDM_PRINT:
                    /* print the current view -
                     * either the outline list of filenames,
                     * or the currently expanded file.
                     */
                    if (!IsBusy()) {
                        DoPrint();
                    } else {
                        BusyError();
                    }
                    break;

                case IDM_TIME:
                    /* show time it took */
                    {       char msg[50];
                        DWORD tim;
                        if (IsBusy()) {
                            BusyError();
                        } else {
                            tim = complist_querytime();
                            hr = StringCchPrintf(msg, 50, LoadRcString(IDS_SECONDS), tim/1000, tim%1000);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_PRINTF);
                            Trace_Status(msg);
                        }
                    }
                    break;

                case IDM_TRACE:
                    /* enable tracing */
                    bTrace = TRUE;
                    Trace_Status(LoadRcString(IDS_TRACING_ENABLED));
                    break;

                case IDM_TRACEOFF:
                    /* enable tracing */
                    bTrace = FALSE;
                    Trace_Status(LoadRcString(IDS_TRACING_DISABLED));
                    break;

                case IDM_SAVELIST:
                    /* allow user to save list of same/different files
                     * to a text file. dialog box to give filename
                     * and select which types of file to include
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    complist_savelist(view_getcomplist(current_view), NULL, outline_include);
                    break;

                case IDM_COPYFILES:
                    /*
                     * copy files that are same/different to a new
                     * root directory. dialog box allows user
                     * to select new root and inclusion options
                     */
                    if (current_view == NULL) {
                        MessageBox(hWnd,
                                   LoadRcString(IDS_CREATE_DIFF_LIST),
                                   szSdkDiff, MB_OK|MB_ICONSTOP);
                        break;
                    }

                    if (SetBusy()) {
                        ghThread = CreateThread(NULL, 0, wd_copy,
                                                (LPVOID) current_view, 0, &threadid);
                        if (ghThread == NULL)
                        {
                            wd_copy( (LPVOID) current_view);
                        }

                    } else {
                        BusyError();
                    }

                    break;

                case IDM_ABOUT:
                    ShellAbout( hWnd,
                                (LPTSTR)szSdkDiff,
                                LoadRcString(IDS_TOOL_DESCRIPTION),
                                LoadIcon(hInst, szSdkDiff)
                              );
                    break;

                case IDM_CONTENTS:
                    /* Help contents */
          TCHAR pszHelp[MAX_PATH];
          memset(pszHelp, 0, MAX_PATH);
          hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_COPY);
          hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_CAT);
          WinHelp(hWnd, pszHelp, HELP_INDEX, 0);
                    break;

                    /* launch an editor on the current item - left, right or
                     * composite view
                     */
                case IDM_EDITLEFT:
                    do_editthread(current_view, CI_LEFT);
                    break;

                case IDM_EDITRIGHT:
                    do_editthread(current_view, CI_RIGHT);
                    break;

                case IDM_EDITCOMP:
                    {
                        COMPITEM item = view_getitem(current_view, selection);
                        FILEDATA fdLeft;
                        FILEDATA fdRight;

                        fdLeft = compitem_getleftfile(item);
                        fdRight = compitem_getrightfile(item);
                        if ((fdLeft && file_IsUnicode(fdLeft)) || (fdRight && file_IsUnicode(fdRight))) {
                            MessageBox(hWnd, LoadRcString(IDS_NOCOMPUNICODE),
                                       szSdkDiff, MB_OK);
                        } else {
                            do_editthread(current_view, CI_COMP);
                        }
                    }
                    break;

                    /* allow customisation of the editor command line */
                case IDM_SETEDIT:
                    if (StringInput(editor_cmdline, sizeof(editor_cmdline),
                                    LoadRcString(IDS_EDITOR_COMMAND),
                                    (LPSTR)szSdkDiff, editor_cmdline)) {
                        WriteProfileString(APPNAME, szEditor,
                                           editor_cmdline);
                    }
                    break;

                case IDM_SETTABWIDTH:
                    {
                        char sz[32];
                        int n;

LTabWidth_tryagain:
                        hr = StringCchPrintf(sz, 32, "%d", g_tabwidth);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        if (StringInput(sz, sizeof(sz),
                                        LoadRcString(IDS_TABWIDTH),
                                        (LPSTR)szSdkDiff, sz))
                        {
                            n = atoi(sz);
                            if (n <= 0 || n > 100)
                            {
                                MessageBox(hWnd,
                                           LoadRcString(IDS_BAD_TABWIDTH),
                                           szSdkDiff, MB_OK);
                                goto LTabWidth_tryagain;
                            }
                            WriteProfileInt(APPNAME, szTabWidth, n);
                            g_tabwidth = n;
                            SendMessage(hwndRCD, TM_SETTABWIDTH, 0, n);
                        }
                    }
                    break;

                case IDM_TABWIDTH4:
                case IDM_TABWIDTH8:
                    g_tabwidth = (GET_WM_COMMAND_ID(wParam, lParam) == IDM_TABWIDTH8) ? 8 : 4;
                    SendMessage(hwndRCD, TM_SETTABWIDTH, 0, g_tabwidth);
                    break;

                case IDM_SETFONT:
                    {
                        CHOOSEFONT cf;
                        LOGFONT lf;
                        char szFace[LF_FACESIZE];

                        hr = StringCchCopy(szFace, LF_FACESIZE, g_szFontFaceName);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);

                        memset(&lf, 0, sizeof(lf));
                        hr = StringCchCopy(lf.lfFaceName, LF_FACESIZE, szFace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_COPY);
                        lf.lfWeight = g_fFontBold ? FW_BOLD : FW_DONTCARE;
                        lf.lfHeight = g_nFontHeight;
                        lf.lfCharSet = g_bFontCharSet;

                        memset(&cf, 0, sizeof(cf));
                        cf.lStructSize = sizeof(CHOOSEFONT);
                        cf.hwndOwner = hWnd;
                        cf.lpLogFont = &lf;
                        cf.Flags = CF_INITTOLOGFONTSTRUCT|CF_FORCEFONTEXIST|
                                CF_SCREENFONTS|CF_LIMITSIZE;
                        cf.nSizeMin = 8;
                        cf.nSizeMax = 36;
                        cf.lpszStyle = szFace;
                        if (ChooseFont(&cf))
                            {
                            hr = StringCchCopy(g_szFontFaceName, LF_FACESIZE, lf.lfFaceName);
              if (FAILED(hr))
                OutputError(hr, IDS_SAFE_COPY);
                            g_fFontBold = (lf.lfWeight == FW_BOLD);
                            g_nFontHeight = lf.lfHeight;
                            g_bFontCharSet = lf.lfCharSet;

                            WriteProfileString(APPNAME, szFontFaceName, g_szFontFaceName);
                            WriteProfileInt(APPNAME, szFontHeight, g_nFontHeight);
                            WriteProfileInt(APPNAME, szFontBold, g_fFontBold);
                            WriteProfileInt(APPNAME, szFontCharSet, g_bFontCharSet);

                            GetFontPref();

                            view_changeviewoptions(current_view);
                            }
                    }
                    break;

                case IDM_LNRS:
                case IDM_RNRS:
                case IDM_NONRS:

                    /* option selects whether the line nrs displayed
                     * in expand mode are the line nrs in the left
                     * file, the right file or none
                     */

                    CheckMenuItem(GetMenu(hWnd),
                                  line_numbers, MF_UNCHECKED);
                    line_numbers = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), line_numbers, MF_CHECKED);
                    hr = StringCchPrintf(str, 32, szD, line_numbers);
          if (FAILED(hr))
            OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szLineNumbers, str);

                    /* change the display to show the line nr style
                     * chosen
                     */

                    view_changeviewoptions(current_view);
                    break;

                /*
                 * options selecting which lines to include in the
                 * expand listing, based on their state
                 */
                case IDM_EXPAND_INCSAME:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SAME;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSAME,
                              (expand_include & INCLUDE_SAME) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_LEFTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCLEFT,
                              (expand_include & INCLUDE_LEFTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_RIGHTONLY;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCRIGHT,
                              (expand_include & INCLUDE_RIGHTONLY) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDLEFT,
                              (expand_include & INCLUDE_MOVEDLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCMOVEDRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_MOVEDRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCMOVEDRIGHT,
                              (expand_include & INCLUDE_MOVEDRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARLEFT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARLEFT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARLEFT,
                              (expand_include & INCLUDE_SIMILARLEFT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                case IDM_EXPAND_INCSIMILARRIGHT:
                        /* toggle flag in expand_include options */
                        expand_include ^= INCLUDE_SIMILARRIGHT;

                        /* check/uncheck as necessary */
                        CheckMenuItem(hMenu, IDM_EXPAND_INCSIMILARRIGHT,
                              (expand_include & INCLUDE_SIMILARRIGHT) ?
                                        MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, expand_include);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szLineInclude, str);
                        view_changeviewoptions(current_view);
                        break;

                    /*
                     * options selecting which files to include in the
                     * outline listing, based on their state
                     */
                case IDM_OUTLINE_INCLEFT:

                    /* toggle flag in outline_include options */
                    outline_include ^= INCLUDE_LEFTONLY;

                    /* check/uncheck as necessary */
                    CheckMenuItem(hMenu, IDM_OUTLINE_INCLEFT,
                                  (outline_include & INCLUDE_LEFTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCRIGHT:

                    outline_include ^= INCLUDE_RIGHTONLY;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCRIGHT,
                                  (outline_include & INCLUDE_RIGHTONLY) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCSAME:

                    outline_include ^= INCLUDE_SAME;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCSAME,
                                  (outline_include & INCLUDE_SAME) ?
                                  MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_OUTLINE_INCDIFFER:

                    outline_include ^= INCLUDE_DIFFER;

                    CheckMenuItem(hMenu, IDM_OUTLINE_INCDIFFER,
                                  (outline_include & INCLUDE_DIFFER) ?
                                  MF_CHECKED:MF_UNCHECKED);

                    hr = StringCchPrintf(str, 32, szD, outline_include);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szFileInclude, str);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_UPDATE:
                    OnUpdate( (COMPITEM) lParam);
                    break;

                case IDM_RESCAN:
                    RescanFile(hWnd);

                    /* do we need to force any repaints? */
                    // - no, as RescanFile sends a IDM_UPDATE
                    break;

                case IDM_LONLY:
                case IDM_RONLY:
                case IDM_BOTHFILES:
                    /* option selects whether the expanded file
                     * show is the combined file, or just one
                     * or other of the input files.
                     *
                     * if we are not in expand mode, this also
                     * causes us to expand the selection
                     */

                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_UNCHECKED);
                    expand_mode = GET_WM_COMMAND_ID(wParam, lParam);
                    CheckMenuItem(GetMenu(hWnd), expand_mode, MF_CHECKED);

                    /* change the current view to show only the lines
                     * of the selected type.
                     */
                    if (DisplayMode == MODE_OUTLINE) {
                        ToExpand(hWnd);
                    } else {
                        view_changeviewoptions(current_view);
                    }

                    break;

                case IDM_IGNBLANKS:

                    /* if selected, ignore all spaces and tabs on
                     * comparison - expand view only: outline view
                     * will still show that 'text files differ'
                     */

                    ignore_blanks = !ignore_blanks;
                    CheckMenuItem(hMenu, IDM_IGNBLANKS,
                                  ignore_blanks? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, ignore_blanks);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szBlanks, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_SHOWWHITESPACE:

                        /* if selected, display all spaces and tabs in
                           the expanded text view */
                        show_whitespace = !show_whitespace;
                        CheckMenuItem(hMenu, IDM_SHOWWHITESPACE,
                                show_whitespace ? MF_CHECKED:MF_UNCHECKED);
                        hr = StringCchPrintf(str, 32, szD, show_whitespace);
            if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                        WriteProfileString(APPNAME, szShowWhitespace, str);

                        // change the current view to show only the lines
                        // of the selected type.
                        if (DisplayMode == MODE_EXPAND) {
                                view_changeviewoptions(current_view);
                        }

                        break;

                case IDM_ALG2:

                    /* if selected, do algorithm2 which does not accept
                     * unsafe matches.
                     */

                    Algorithm2 = !Algorithm2;
                    CheckMenuItem(hMenu, IDM_ALG2,
                                  Algorithm2? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, Algorithm2);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szAlgorithm2, str);

                    /* invalidate all diffs since we have
                     * changed diff options, and re-do and display the
                     * current diff if we are in expand mode.
                     */
                    view_changediffoptions(current_view);

                    /* force repaint of bar window */
                    InvalidateRect(hwndBar, NULL, TRUE);

                    break;

                case IDM_MONOCOLS:

                    /* Use monochrome colours - toggle */

                    mono_colours = !mono_colours;
                    CheckMenuItem(hMenu, IDM_MONOCOLS,
                                  mono_colours? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, mono_colours);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szMonoColours, str);
                    if (mono_colours)
                        SetMonoColours();
                    else
                        SetColours();

                    /* The diffs are still valid, but force a re-display
                     * of bar window and main table.
                     */
                    SendMessage(hwndBar, WM_COMMAND, IDM_MONOCOLS, 0);
                    InvalidateRect(hwndBar, NULL, TRUE);
                    view_changeviewoptions(current_view);

                    break;

                case IDM_PICTURE:
                    picture_mode = !picture_mode;
                    CheckMenuItem(hMenu, IDM_PICTURE,
                                  picture_mode? MF_CHECKED:MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, picture_mode);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szPicture, str);
                    DoResize(hWnd);
                    break;

                case IDM_HIDEMARK:
                    // toggle state of marked files hidden or not
                    hide_markedfiles = !hide_markedfiles;
                    CheckMenuItem(hMenu, IDM_HIDEMARK,
                                  hide_markedfiles? MF_CHECKED : MF_UNCHECKED);
                    hr = StringCchPrintf(str, 32, szD, hide_markedfiles);
          if (FAILED(hr))
              OutputError(hr, IDS_SAFE_PRINTF);
                    WriteProfileString(APPNAME, szHideMark, str);

                    // rebuild view with new global option
                    // - note that marks only affect outline views
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_FIND:
                  {
                  int nRet = IDCANCEL;
                  DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE) FindDlgProc, hInst);
                  if (lpProc)
                    {
                    char *pszFind = NULL;
                    sdkdiff_UI(TRUE);
                    nRet = (BOOL) DialogBoxParam(hInst, (LPCTSTR) IDD_FIND, hwndClient, lpProc, 0L);
                    sdkdiff_UI(FALSE);
                    FreeProcInstance(lpProc);
                    }
                  }
                  break;

                case IDM_FINDNEXT:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, 1, 0);
                  break;
                  }

                case IDM_FINDPREV:
                  {
                  const LONG iCol = (view_isexpanded(current_view)) ? 2 : 1;
                  FindString(hWnd, iCol, NULL, -1, 0);
                  break;
                  }

                case IDM_GOTOLINE:
                  {
                  if (!view_getrowcount(current_view))
                    {
                    MessageBox(hWnd, LoadRcString(IDS_GOTOLINE_NOLINES), szSdkDiff, MB_OK|MB_ICONSTOP|MB_TASKMODAL);
                    }
                  else
                    {
                    DLGPROC lpProc = (DLGPROC) MakeProcInstance((WINPROCTYPE)GoToLineDlgProc, hInst);
                    if (lpProc)
                      {
                      sdkdiff_UI(TRUE);
                      DialogBoxParam(hInst, (LPCTSTR) IDD_GOTOLINE, hwndClient, lpProc, 0L);
                      sdkdiff_UI(FALSE);
                      FreeProcInstance(lpProc);
                      }
                    }
                  }
                  break;

                case IDM_EDITCOPY:
                    {
                        unsigned long cb = 0;
                        LPCSTR pszText = NULL;
                        long iRow = 0;
                        const BOOL fOutline = !view_isexpanded(current_view);

                        /* first count total data size */
                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                            if (fOutline) {
                                pszText = view_gettext(current_view, selection + iRow, 1);
                                if (!pszText)
                                    break;
                                cb += (lstrlen(pszText) + 3) * sizeof(char);
                            }

                            pszText = view_gettext(current_view, selection + iRow, 2);
                            if (!pszText)
                                break;
                            cb += (lstrlen(pszText)) * sizeof(char);
                        }

                        if (cb && OpenClipboard(NULL)) {
                            /* space for trailing nul char */
                            cb++;

                            /* copy data to clipboard */
                            if (EmptyClipboard()) {
                                HGLOBAL hData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,  cb);

                                if (hData) {
                                    void *pv = hData;
                                    if (!pv) {
                                        HeapFree(GetProcessHeap(), NULL, hData);
                                    }
                                    else {
                                        LPSTR pszBuf = (LPSTR) pv;
                                        memset(pv, 0, cb);

                                        for (iRow = 0; iRow < selection_nrows; iRow++) {
                                            if (fOutline) {
                                                pszText = view_gettext(current_view, selection + iRow, 1);
                                                if (!pszText)
                                                    break;

                                                hr = StringCchCopy(pszBuf, cb, pszText);
                        if (FAILED(hr))
                          OutputError(hr, IDS_SAFE_COPY);
                                                pszBuf += lstrlen(pszBuf);
                                                *(pszBuf++) = '\t';
                                                *pszBuf = 0;
                                            }

                                            pszText = view_gettext(current_view, selection + iRow, 2);
                                            if (!pszText)
                                                break;

                                            hr = StringCchCopy(pszBuf, cb, pszText);
                      if (FAILED(hr))
                        OutputError(hr, IDS_SAFE_COPY);
                                            pszBuf += lstrlen(pszBuf);

                                            if (fOutline) {
                                                *(pszBuf++) = '\r';
                                                *(pszBuf++) = '\n';
                                                *pszBuf = 0;
                                            }
                                        }

                                        SetClipboardData(CF_TEXT, hData);
                                    }
                                }
                            }
                            CloseClipboard();
                        }
                    }
                    break;

                case IDM_MARK:
                    {
                        BOOL bChanged = FALSE;
                        int i;

                        // toggle the mark on the current selection
                        // note that the selection could be multiple rows
                        for (i = 0; i < selection_nrows; i++) {

                            if (view_setmarkstate(current_view, selection + i,
                                                  !view_getmarkstate(current_view, selection + i))) {

                                bChanged = TRUE;
                            }
                        }

                        if (bChanged) {
                            // yes the mark state was changed - need
                            // to rebuild the view.
                            if (!view_isexpanded(current_view)) {
                                view_changeviewoptions(current_view);
                            }
                        }
                        break;
                    }

                case IDM_TOGGLEMARK:
                    // toggle the state of all files: unmark all
                    // marked files and vice versa
                    complist_togglemark(view_getcomplist(current_view));

                    // rebuild view
                    if (!view_isexpanded(current_view)) {
                        view_changeviewoptions(current_view);
                    }
                    break;

                case IDM_MARKPATTERN:
                    // dialog to query the pattern, then set a mark on
                    // all compitems whose title matches that pattern
                    // returns TRUE if anything was changed
                    if (complist_markpattern(view_getcomplist(current_view))) {

                        // rebuild view
                        if (!view_isexpanded(current_view)) {
                            view_changeviewoptions(current_view);
                        }
                    }
                    break;

                case IDM_EXPAND:

                    /* show the expanded view of the
                     * selected file
                     */
                    if (current_view != NULL) {
                        ToExpand(hWnd);
                    }

                    break;

                case IDM_OUTLINE:
                    /* return to the outline view (list of filenames) */
                    ToOutline(hWnd);

                    break;

                case IDM_FCHANGE:
                    /* find the next line in the current view
                     * that is not the same in both files -
                     * in outline view, finds the next filename that
                     * is not identical
                     */
                    FindNextChange();
                    break;

                case IDM_FPCHANGE:
                    /* same as IDM_FCHANGE, but going backwards from
                     * current position
                     */
                    FindPrevChange();
                    break;

                case IDM_FCHANGE_LAURIE:
                    /* same as IDM_FCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindNextChange(TRUE, FALSE);
                    break;

                case IDM_FPCHANGE_LAURIE:
                    /* same as IDM_FPCHANGE, but tries to keep cursor on same
                     * line.
                     */
                    _FindPrevChange(TRUE, FALSE);
                    break;

                    // given a line that has been moved, jump to the
                    // other representation of the same line.
                    // this used to be available just through double-click
                    // but now is also available from a context menu
                case IDM_TOMOVED:
                    ToMoved(hWnd, TRUE);
                    break;
            }
            break;

        case WM_SIZE:
            DoResize(hWnd);
            break;

        case WM_SETFOCUS:
            /* set the focus on the table class so it can process
             * page-up /pagedown keys etc.
             */
            SetFocus(hwndRCD);
            break;

        case WM_KEYDOWN:
            /* although the table window has the focus, he passes
             * back to us any keys he doesn't understand
             * We handle escape here to mean 'return to outline view'
             */
            if (wParam == VK_ESCAPE) {
                ToOutline(hWnd);
            } else if (wParam == VK_APPS) {
                // Handle the context menu keyboard key
                POINT posCursor;
                GetCursorPos(&posCursor);
                ScreenToClient(hwndRCD, &posCursor);
                OnRightClick(hWnd, posCursor.x, posCursor.y);
            }
            break;

        case WM_RBUTTONDOWN:
            /*
             * the table window handles this by performing the
             * selection and then passing the message to us, allowing
             * us to put up a context menu.
             */
            OnRightClick(hWnd, LOWORD(lParam), HIWORD(lParam));
            break;

        case WM_CLOSE:
            SendMessage(hWnd, WM_COMMAND, IDM_EXIT, 0);
            return TRUE;

            /* don't allow close when busy - process this message in
             * order to ensure this
             */
            break;

        case WM_DESTROY:
      TCHAR pszHelp[MAX_PATH];
      memset(pszHelp, 0, MAX_PATH);
      hr = StringCchCopy(pszHelp, MAX_PATH, pszWorkingDirectoryName);
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
      hr = StringCchCat(pszHelp, MAX_PATH, "sdkdiff.hlp");
      if (FAILED(hr))
        OutputError(hr, IDS_SAFE_COPY);
            DeleteTools();
            WinHelp(hWnd, pszHelp, HELP_QUIT, 0);
            PostQuitMessage(0);
            break;

        case TM_CURRENTVIEW:
            /* allow other people such as the bar window to query the
             * current view
             */
            return((INT_PTR) current_view);

#ifdef LATER
#ifdef WM_MOUSEWHEEL
        case WM_MOUSEWHEEL:
            if (LOWORD(wParam) & MK_MBUTTON) {
                if ((short)HIWORD(wParam) < 0) {
                    // The next occurence
                    _FindNextChange(FALSE, TRUE);
                }
                else {
                    _FindPrevChange(FALSE, TRUE);
                }
            }
            break;
#endif
#endif

        case WM_QUERYENDSESSION:
            if (IsBusy())
                return FALSE;
            return TRUE;

        case WM_ENDSESSION:
            SendMessage(hWnd, WM_CLOSE, 0, 0);
            break;

        default:
            /* handle registered table messages */
            if (message == table_msgcode) {
                ret = TableServer(hWnd, wParam, lParam);
                return(ret);
            }
            return(DefWindowProc(hWnd, message, wParam, lParam));
    }
    return(0);
}

void ShowOptions ( HWND hwndParent )

Definition at line 60 of file PropSht.c.

{
    PROPSHEETPAGE psp[2];
    PROPSHEETHEADER psh;

    // Store the window handle of the appbar so we can send it commands
    // when the options change
    hwndAppbar = hwndParent;

    // Initialize the memory
    ZeroMemory(psp, sizeof(PROPSHEETPAGE) * 2);

    // Fill out the property sheet pages
    psp[0].dwSize      = sizeof(PROPSHEETPAGE);
    psp[0].dwFlags     = PSP_USETITLE;
    psp[0].hInstance   = g_hInstance;
    psp[0].pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS);
    psp[0].pszTitle    = TEXT("AppBar Options");
    psp[0].pfnDlgProc  = (DLGPROC)OptionsPageProc;
    psp[0].lParam      = (LPARAM)((POPTIONS)GetAppbarData(hwndParent));

    // Now fill out the property sheet header
    psh.dwSize = sizeof(PROPSHEETHEADER);
    psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
    psh.hwndParent = hwndParent;
    psh.hInstance = g_hInstance;
    psh.pszCaption = TEXT("AppBar");
    psh.nPages = 1;
    psh.ppsp = psp;

    // Finally display the property sheet
    PropertySheet(&psh);
    return;
}

void SlideWindow | ( | HWND | ,
 |  | LPRECT |
 | ) |  |

Definition at line 42 of file Util.c.

{
    RECT rcOld;
    RECT rcNew;
    int x, y, dx, dy, dt, t, t0;
    BOOL fShow;
    HANDLE hThreadMe;
    int priority;

    rcNew = *prc;

    if ((g_dtSlideShow > 0) && (g_dtSlideHide > 0))
    {
        GetWindowRect(hwnd, &rcOld);

        fShow = (rcNew.bottom - rcNew.top) > (rcOld.bottom - rcOld.top) ||
                (rcNew.right - rcNew.left) > (rcOld.right - rcOld.left);

        dx = (rcNew.right - rcOld.right) + (rcNew.left - rcOld.left);
        dy = (rcNew.bottom - rcOld.bottom) + (rcNew.top - rcOld.top);

        if (fShow)
        {
            rcOld = rcNew;
            OffsetRect(&rcOld, -dx, -dy);
            SetWindowPos(hwnd, NULL, rcOld.left, rcOld.top,
                    rcOld.right - rcOld.left, rcOld.bottom - rcOld.top,
                    SWP_NOZORDER | SWP_NOACTIVATE | SWP_DRAWFRAME);

            dt = g_dtSlideShow;
        }
        else
        {
            dt = g_dtSlideHide;
        }

        hThreadMe = GetCurrentThread();
        priority = GetThreadPriority(hThreadMe);
        SetThreadPriority(hThreadMe, THREAD_PRIORITY_HIGHEST);

        t0 = GetTickCount();
        while ((t = GetTickCount()) < t0 + dt)
        {
            x = rcOld.left + dx * (t - t0) / dt;
            y = rcOld.top + dy * (t - t0) / dt;

            SetWindowPos(hwnd, NULL, x, y, 0, 0,
                         SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
            if (fShow)
                UpdateWindow(hwnd);
            else
                UpdateWindow(GetDesktopWindow());
        }

        SetThreadPriority(hThreadMe, priority);
    }

    SetWindowPos(hwnd, NULL, rcNew.left, rcNew.top,
                 rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
                 SWP_NOZORDER | SWP_NOACTIVATE | SWP_DRAWFRAME);

}

Variable Documentation

HINSTANCE g_hInstance

Definition at line 104 of file SServer.Cpp.

VERSION version

Definition at line 42 of file Main.c.

Generated on Wed Nov 13 2024 16:54:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/Main.c File Reference

  • WinUI
  • Shell
  • AppBar
Defines | Functions | Variables

Main.c File Reference

#include <windows.h>
#include <stdio.h>
#include "globals.h"
#include "resource.h"

Go to the source code of this file.

Defines

#define | DEFBKGDCOLOR (COLOR_WINDOW + 1)

Functions

int | DebugMsg (const TCHAR *pFmt,...)
VERSION | DetermineVersion (void)
int | DoMain (void)
void | ErrorHandlerEx (INT wLine, LPSTR lpszFile)
BOOL | InitApplication (HINSTANCE hInstance)
BOOL | InitInstance (HINSTANCE hInstance, int nCmdShow)
int PASCAL | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)

Variables

HINSTANCE | g_hInstance = NULL
VERSION version

Define Documentation

#define DEFBKGDCOLOR (COLOR_WINDOW + 1)

Definition at line 128 of file Main.c.

Function Documentation

int DebugMsg | ( | const TCHAR * | pFmt,
 |  |  | ...
 | ) |  |

Definition at line 330 of file Main.c.

{
    int i;
    const int iMsgSize = 512;
    va_list pArgs;
    char szMsg[512];

    // outputs formatted string to debugger
    // returns count of bytes written or -1 if buffer size is too small

    va_start( pArgs, pFmt );

    #ifdef UNICODE
        i = _vsnwprintf(szMsg, iMsgSize+1, pFmt, pArgs);
    #else
        i = _vsnprintf(szMsg, iMsgSize+1, pFmt, pArgs);
    #endif

    va_end( pArgs );

    OutputDebugString( szMsg );

    return( i );
}

VERSION DetermineVersion ( void )

Definition at line 298 of file Main.c.

{
    DWORD dwVersion;

    dwVersion = GetVersion();
    if (dwVersion < 0x80000000)
        return (WINNT);
    else
        if (LOBYTE(LOWORD(dwVersion)) < 4)
            return (WIN32S);
        else
            return (WIN95);
}

int DoMain ( void )

Definition at line 99 of file Main.c.

{
    MSG msg;

    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);   // Translates virtual key codes
        DispatchMessage(&msg);    // Dispatches message to window procedure
    }

    return ((int) msg.wParam);
}

void ErrorHandlerEx | ( | INT | wLine,
 |  | LPSTR | lpszFile
 | ) |  |

Definition at line 248 of file Main.c.

{
    LPVOID lpvMessage;
    DWORD  dwError;
    TCHAR  szBuffer[256];

    // The the text of the error message
    dwError = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
                            FORMAT_MESSAGE_FROM_SYSTEM,
                            NULL,
                            GetLastError(),
                            MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
                            (LPTSTR)&lpvMessage,
                            0,
                            NULL);

    // Check to see if an error occured calling FormatMessage()
    if (0 == dwError)
    {
        wsprintf(szBuffer, TEXT("An error occured calling FormatMessage().")
                 TEXT("Error Code %d"), GetLastError());
        MessageBox(NULL, szBuffer, TEXT("Generic"), MB_ICONSTOP |
                   MB_ICONEXCLAMATION);
        return;
    }

    // Display the error message
    wsprintf(szBuffer, TEXT("Generic, Line=%d, File=%s"), wLine, lpszFile);
    MessageBox(NULL, lpvMessage, szBuffer, MB_ICONEXCLAMATION | MB_OK);

    return;
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 129 of file Main.c.

{
    WNDCLASSEX  wcx;

    // The window class is not registered yet, so we have to fill a
    // window class structure with parameters that describe the
    // window class.
    wcx.cbSize        = sizeof(WNDCLASSEX);
    wcx.style         = 0;
    wcx.lpfnWndProc   = MainWndProc;
    wcx.cbClsExtra    = 0;
    wcx.cbWndExtra    = sizeof(LPVOID);
    wcx.hInstance     = hInstance;
    wcx.hIcon         = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON));
    wcx.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wcx.hbrBackground = (HBRUSH)DEFBKGDCOLOR;
    wcx.lpszMenuName  = NULL;
    wcx.lpszClassName = TEXT("MSSampleAppbar");
    wcx.hIconSm       = LoadImage(hInstance,
                                  MAKEINTRESOURCE(IDI_APPICON),
                                  IMAGE_ICON,
                                  16, 16,
                                  0);

    // Attempt to register the class first with the WNDCLASSEX structure
    // and if that doesn't work try just the WNDCLASS for NT and Win32s.
    if (!RegisterClassEx(&wcx))
    {
        if (!RegisterClass((LPWNDCLASS)&wcx.style))
        {
            ErrorHandler();
            return (FALSE);
        }
    }

    return (TRUE);
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 185 of file Main.c.

{
    HWND hwnd;                       // temporary window handle
    BOOL bStatus = FALSE;            // holds return status for function

    // Save the instance handle in global variable, which will be used in
    // many subsequent calls from this application to Windows
    g_hInstance = hInstance;

    // Create a main window for this application instance
    hwnd = CreateWindowEx(WS_EX_CLIENTEDGE | WS_EX_TOOLWINDOW,
                          TEXT("MSSampleAppbar"),
                          TEXT("Win32 Sample AppBar"),
                          WS_POPUP | WS_THICKFRAME | WS_CLIPCHILDREN,
                          CW_USEDEFAULT,
                          CW_USEDEFAULT,
                          400,
                          200,
                          NULL,
                          NULL,
                          hInstance,
                          NULL
                         );

    // If the window was successfully created, make the window visible,
    // update its client area, and return "success".  If the window
    // was not created, return "failure"
    if (hwnd)
    {
        ShowWindow(hwnd, nCmdShow); // Set to visible & paint non-client area
        UpdateWindow(hwnd);         // Tell window to paint client area

        bStatus = TRUE;             // Indicate success, default is failure
    }
    else
    {
        ErrorHandler();
    }

    return bStatus;                  // Return status code
}

int PASCAL WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 66 of file Main.c.

{
    int iResult;

    // Find out what OS we're running on in case we have to call any platform
    // specific code.
    version = DetermineVersion();

    if (InitApplication(hInstance))
       if (InitInstance(hInstance, SW_SHOWDEFAULT))
           iResult = DoMain();

    return iResult;
}

Variable Documentation

HINSTANCE g_hInstance = NULL

Definition at line 43 of file Main.c.

VERSION version

Definition at line 42 of file Main.c.

Generated on Wed Nov 13 2024 16:53:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/PropSht.c File Reference

  • WinUI
  • Shell
  • AppBar
Functions

PropSht.c File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include "globals.h"
#include "resource.h"
#include "appbar.h"

Go to the source code of this file.

Functions

void | Options_OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
void | Options_OnDestroy (HWND hwnd)
BOOL | Options_OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam)
LRESULT | Options_OnNotify (HWND hwnd, int idFrom, LPNMHDR pnmhdr)
BOOL CALLBACK | OptionsPageProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void | ShowOptions (HWND hwndParent)

Function Documentation

void Options_OnCommand | ( | HWND | hwnd,
 |  | int | id,
 |  | HWND | hwndCtl,
 |  | UINT | codeNotify
 | ) |  |

Definition at line 238 of file PropSht.c.

{
    switch (id)
    {
        case IDC_AUTOHIDE:
            // First let the property sheet know somethings changed
            PropSheet_Changed(GetParent(hwnd), hwnd);

            // Now update the picture
            if (Button_GetCheck(hwndCtl))
                ShowWindow(GetDlgItem(hwnd, IDC_APPBAR), SW_HIDE);
            else
                ShowWindow(GetDlgItem(hwnd, IDC_APPBAR), SW_SHOW);

            break;

        case IDC_ONTOP:
            // First let the property sheet know somethings changed
            PropSheet_Changed(GetParent(hwnd), hwnd);

            // Now update the picture
            if (Button_GetCheck(hwndCtl))
                ShowWindow(GetDlgItem(hwnd, IDC_WINDOW), SW_HIDE);
            else
                ShowWindow(GetDlgItem(hwnd, IDC_WINDOW), SW_SHOW);

            break;
    }
}

void Options_OnDestroy ( HWND hwnd )

Definition at line 278 of file PropSht.c.

{
    HBITMAP hbmp;

    hbmp = (HBITMAP) SendDlgItemMessage(hwnd, IDC_PICTURE, STM_GETIMAGE,
                                        IMAGE_BITMAP, 0L);
    if (hbmp)
        DeleteObject(hbmp);

    hbmp = (HBITMAP) SendDlgItemMessage(hwnd, IDC_APPBAR, STM_GETIMAGE,
                                        IMAGE_BITMAP, 0L);
    if (hbmp)
        DeleteObject(hbmp);

    hbmp = (HBITMAP) SendDlgItemMessage(hwnd, IDC_WINDOW, STM_GETIMAGE,
                                        IMAGE_BITMAP, 0L);
    if (hbmp)
        DeleteObject(hbmp);
}

BOOL Options_OnInitDialog | ( | HWND | hwnd,
 |  | HWND | hwndFocus,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 147 of file PropSht.c.

{
    PROPSHEETPAGE *ppsp;
    RECT rc;
    HBITMAP hbmpBase;
    HBITMAP hbmpAppbar;
    HBITMAP hbmpWindow;
    APPBARDATA abd;
    HWND hwndAutohide;

    // Get the pointer to the OPTIONS struct from the lParam
    ppsp = (PROPSHEETPAGE *)lParam;
    pOptions = (POPTIONS)ppsp->lParam;

    // Load and set the picture for the base image
    hbmpBase = LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_BASE));
    if (!hbmpBase)
    {
        ErrorHandler();
        EndDialog(hwnd, 0);
    }

    SendDlgItemMessage(hwnd, IDC_PICTURE, STM_SETIMAGE, IMAGE_BITMAP,
                       (LPARAM) hbmpBase);

    // Set the pictures for the rest of the static controls, move them
    // into position, and hide them
    hbmpAppbar = LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_APPBAR));
    hbmpWindow = LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_WINDOW));
    if (!hbmpAppbar || !hbmpWindow)
    {
        ErrorHandler();
        EndDialog(hwnd, 0);
    }

    SendDlgItemMessage(hwnd, IDC_APPBAR, STM_SETIMAGE, IMAGE_BITMAP,
                       (LPARAM) hbmpAppbar);
    SendDlgItemMessage(hwnd, IDC_WINDOW, STM_SETIMAGE, IMAGE_BITMAP,
                       (LPARAM) hbmpWindow);

    // Get the position of the picture and convert to client coordiates
    GetWindowRect(GetDlgItem(hwnd, IDC_PICTURE), &rc);
    ScreenToClient(hwnd, (LPPOINT)&rc);

    SetWindowPos(GetDlgItem(hwnd, IDC_APPBAR), GetDlgItem(hwnd, IDC_PICTURE),
                 rc.left + 2, rc.top + 69, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);

    SetWindowPos(GetDlgItem(hwnd, IDC_WINDOW), GetDlgItem(hwnd, IDC_APPBAR),
                 rc.left + 212, rc.top + 69, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);

    // Set the values of the controls based on the values in OPTIONS
    Button_SetCheck(GetDlgItem(hwnd, IDC_AUTOHIDE), pOptions->fAutoHide);
    Button_SetCheck(GetDlgItem(hwnd, IDC_ONTOP), pOptions->fOnTop);

    if (pOptions->fAutoHide)
        ShowWindow(GetDlgItem(hwnd, IDC_APPBAR), SW_HIDE);
    if (pOptions->fOnTop)
        ShowWindow(GetDlgItem(hwnd, IDC_WINDOW), SW_HIDE);

    // Check the autohide window for this side.  Since only one appbar can be
    // auto hidden on each side of the screen, we should disable this check box
    // if we can't autohide.
    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwndAppbar;
    abd.uEdge = pOptions->uSide;

    hwndAutohide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
    if ((hwndAutohide != NULL) && (hwndAutohide != hwndAppbar))
        EnableWindow(GetDlgItem(hwnd, IDC_AUTOHIDE), FALSE);

    return (FALSE);
}

LRESULT Options_OnNotify | ( | HWND | hwnd,
 |  | int | idFrom,
 |  | LPNMHDR | pnmhdr
 | ) |  |

Definition at line 315 of file PropSht.c.

{
    BOOL fCheck;

    switch (pnmhdr->code)
    {
        case PSN_APPLY:
            // Check to see if the options have changed.  If so, send
            // the appropriate command to the appbar
            fCheck = (BOOL) Button_GetCheck(GetDlgItem(hwnd, IDC_AUTOHIDE));
            if (pOptions->fAutoHide != fCheck)
            {
                if (AppBar_SetAutoHide(hwndAppbar, fCheck))
                    pOptions->fAutoHide = fCheck;
            }

            // If the Always-On-Top setting has changed update the appbar state
            fCheck = (BOOL) Button_GetCheck(GetDlgItem(hwnd, IDC_ONTOP));
            if (pOptions->fOnTop != fCheck)
            {
                pOptions->fOnTop = fCheck;
                AppBar_SetAlwaysOnTop(hwndAppbar, fCheck);
            }

            SetDlgMsgResult(hwnd, WM_NOTIFY, PSNRET_NOERROR);
            break;
    }

    return (0);
}

BOOL CALLBACK OptionsPageProc | ( | HWND | hwnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 102 of file PropSht.c.

{
    switch (uMsg)
    {
        case WM_INITDIALOG:
            return (BOOL)HANDLE_WM_INITDIALOG(hwnd, wParam,
                                              lParam, Options_OnInitDialog);

        case WM_COMMAND:
            HANDLE_WM_COMMAND(hwnd, wParam, lParam,
                              Options_OnCommand);
            return (TRUE);

        case WM_DESTROY:
            HANDLE_WM_DESTROY(hwnd, wParam, lParam,
                              Options_OnDestroy);
            return (TRUE);

        case WM_NOTIFY:
            HANDLE_WM_NOTIFY(hwnd, wParam, lParam, Options_OnNotify);
            return (TRUE);

    }

    return (0);
}

void ShowOptions ( HWND hwndParent )

Definition at line 60 of file PropSht.c.

{
    PROPSHEETPAGE psp[2];
    PROPSHEETHEADER psh;

    // Store the window handle of the appbar so we can send it commands
    // when the options change
    hwndAppbar = hwndParent;

    // Initialize the memory
    ZeroMemory(psp, sizeof(PROPSHEETPAGE) * 2);

    // Fill out the property sheet pages
    psp[0].dwSize      = sizeof(PROPSHEETPAGE);
    psp[0].dwFlags     = PSP_USETITLE;
    psp[0].hInstance   = g_hInstance;
    psp[0].pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS);
    psp[0].pszTitle    = TEXT("AppBar Options");
    psp[0].pfnDlgProc  = (DLGPROC)OptionsPageProc;
    psp[0].lParam      = (LPARAM)((POPTIONS)GetAppbarData(hwndParent));

    // Now fill out the property sheet header
    psh.dwSize = sizeof(PROPSHEETHEADER);
    psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
    psh.hwndParent = hwndParent;
    psh.hInstance = g_hInstance;
    psh.pszCaption = TEXT("AppBar");
    psh.nPages = 1;
    psh.ppsp = psp;

    // Finally display the property sheet
    PropertySheet(&psh);
    return;
}

Generated on Wed Nov 13 2024 16:55:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/Resource.h File Reference

  • WinUI
  • Shell
  • AppBar
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | ID_APPBAR_AUTOHIDE 40005
#define | ID_APPBAR_BOTTOM 40008
#define | ID_APPBAR_LEFT 40009
#define | ID_APPBAR_NOAUTOHIDE 40006
#define | ID_APPBAR_REGISTER 40003
#define | ID_APPBAR_RIGHT 40010
#define | ID_APPBAR_TOP 40007
#define | ID_APPBAR_UNREGISTER 40004
#define | ID_FILE_EXIT 40001
#define | ID_HELP_ABOUT 40002
#define | ID_PROPERTIES 40012
#define | IDB_APPBAR 107
#define | IDB_BASE 108
#define | IDB_WINDOW 109
#define | IDC_APPBAR 1003
#define | IDC_AUTOHIDE 1000
#define | IDC_ONTOP 1001
#define | IDC_PICTURE 1002
#define | IDC_STATIC -1
#define | IDC_USER1 1005
#define | IDC_WINDOW 1004
#define | IDD_ABOUT 102
#define | IDD_OPTIONS 105
#define | IDI_APPICON 103
#define | IDR_CONTEXTMENU 106
#define | IDR_GENERIC 101

Define Documentation

#define ID_APPBAR_AUTOHIDE 40005

Definition at line 23 of file Resource.h.

#define ID_APPBAR_BOTTOM 40008

Definition at line 26 of file Resource.h.

#define ID_APPBAR_LEFT 40009

Definition at line 27 of file Resource.h.

#define ID_APPBAR_NOAUTOHIDE 40006

Definition at line 24 of file Resource.h.

#define ID_APPBAR_REGISTER 40003

Definition at line 21 of file Resource.h.

#define ID_APPBAR_RIGHT 40010

Definition at line 28 of file Resource.h.

#define ID_APPBAR_TOP 40007

Definition at line 25 of file Resource.h.

#define ID_APPBAR_UNREGISTER 40004

Definition at line 22 of file Resource.h.

#define ID_FILE_EXIT 40001

Definition at line 19 of file Resource.h.

#define ID_HELP_ABOUT 40002

Definition at line 20 of file Resource.h.

#define ID_PROPERTIES 40012

Definition at line 29 of file Resource.h.

#define IDB_APPBAR 107

Definition at line 10 of file Resource.h.

#define IDB_BASE 108

Definition at line 11 of file Resource.h.

#define IDB_WINDOW 109

Definition at line 12 of file Resource.h.

#define IDC_APPBAR 1003

Definition at line 16 of file Resource.h.

#define IDC_AUTOHIDE 1000

Definition at line 13 of file Resource.h.

#define IDC_ONTOP 1001

Definition at line 14 of file Resource.h.

#define IDC_PICTURE 1002

Definition at line 15 of file Resource.h.

#define IDC_STATIC -1

Definition at line 30 of file Resource.h.

#define IDC_USER1 1005

Definition at line 18 of file Resource.h.

#define IDC_WINDOW 1004

Definition at line 17 of file Resource.h.

#define IDD_ABOUT 102

Definition at line 6 of file Resource.h.

#define IDD_OPTIONS 105

Definition at line 8 of file Resource.h.

#define IDI_APPICON 103

Definition at line 7 of file Resource.h.

#define IDR_CONTEXTMENU 106

Definition at line 9 of file Resource.h.

#define IDR_GENERIC 101

Definition at line 5 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/Util.c File Reference

  • WinUI
  • Shell
  • AppBar
Functions | Variables

Util.c File Reference

#include <windows.h>
#include <windowsx.h>
#include "globals.h"
#include "appbar.h"

Go to the source code of this file.

Functions

void | SlideWindow (HWND hwnd, LPRECT prc)

Variables

const int | g_dtSlideHide = 400
const int | g_dtSlideShow = 200

Function Documentation

void SlideWindow | ( | HWND | hwnd,
 |  | LPRECT | prc
 | ) |  |

Definition at line 42 of file Util.c.

{
    RECT rcOld;
    RECT rcNew;
    int x, y, dx, dy, dt, t, t0;
    BOOL fShow;
    HANDLE hThreadMe;
    int priority;

    rcNew = *prc;

    if ((g_dtSlideShow > 0) && (g_dtSlideHide > 0))
    {
        GetWindowRect(hwnd, &rcOld);

        fShow = (rcNew.bottom - rcNew.top) > (rcOld.bottom - rcOld.top) ||
                (rcNew.right - rcNew.left) > (rcOld.right - rcOld.left);

        dx = (rcNew.right - rcOld.right) + (rcNew.left - rcOld.left);
        dy = (rcNew.bottom - rcOld.bottom) + (rcNew.top - rcOld.top);

        if (fShow)
        {
            rcOld = rcNew;
            OffsetRect(&rcOld, -dx, -dy);
            SetWindowPos(hwnd, NULL, rcOld.left, rcOld.top,
                    rcOld.right - rcOld.left, rcOld.bottom - rcOld.top,
                    SWP_NOZORDER | SWP_NOACTIVATE | SWP_DRAWFRAME);

            dt = g_dtSlideShow;
        }
        else
        {
            dt = g_dtSlideHide;
        }

        hThreadMe = GetCurrentThread();
        priority = GetThreadPriority(hThreadMe);
        SetThreadPriority(hThreadMe, THREAD_PRIORITY_HIGHEST);

        t0 = GetTickCount();
        while ((t = GetTickCount()) < t0 + dt)
        {
            x = rcOld.left + dx * (t - t0) / dt;
            y = rcOld.top + dy * (t - t0) / dt;

            SetWindowPos(hwnd, NULL, x, y, 0, 0,
                         SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
            if (fShow)
                UpdateWindow(hwnd);
            else
                UpdateWindow(GetDesktopWindow());
        }

        SetThreadPriority(hThreadMe, priority);
    }

    SetWindowPos(hwnd, NULL, rcNew.left, rcNew.top,
                 rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
                 SWP_NOZORDER | SWP_NOACTIVATE | SWP_DRAWFRAME);

}

Variable Documentation

const int g_dtSlideHide = 400

Definition at line 26 of file Util.c.

const int g_dtSlideShow = 200

Definition at line 27 of file Util.c.

Generated on Wed Nov 13 2024 16:53:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/WndProc.c File Reference

  • WinUI
  • Shell
  • AppBar
Functions

WndProc.c File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include "resource.h"
#include "globals.h"
#include "appbar.h"

Go to the source code of this file.

Functions

LRESULT CALLBACK | AboutDlgProc (HWND, UINT, WPARAM, LPARAM)
void | Main_OnActivate (HWND, UINT, HWND, BOOL)
void | Main_OnCommand (HWND, int, HWND, UINT)
BOOL | Main_OnCreate (HWND, LPCREATESTRUCT)
void | Main_OnDestroy (HWND)
void | Main_OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
void | Main_OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
void | Main_OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
void | Main_OnMove (HWND, int, int)
UINT | Main_OnNCHitTest (HWND, int, int)
void | Main_OnPaint (HWND)
void | Main_OnRButtonDown (HWND, BOOL, int, int, UINT)
void | Main_OnSize (HWND, UINT, int, int)
void | Main_OnTimer (HWND, UINT)
void | Main_OnWindowPosChanged (HWND, const LPWINDOWPOS)
LRESULT CALLBACK | MainWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

Function Documentation

LRESULT CALLBACK AboutDlgProc | ( | HWND | hwnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 848 of file WndProc.c.

{
    switch(uMsg)
    {
        case WM_INITDIALOG:
            // Should return nonzero to set focus to the first control in the
            // dialog, or zero if this routine sets the focus manually.
            return (TRUE);

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDOK:
                    EndDialog(hwnd, 0);
                    break;
            }
            return (TRUE);
    }
    return (FALSE);
}

void Main_OnActivate | ( | HWND | hwnd,
 |  | UINT | state,
 |  | HWND | hwndActDeact,
 |  | BOOL | fMinimized
 | ) |  |

Definition at line 191 of file WndProc.c.

{
    APPBARDATA abd;

    // Always send the activate message to the system
    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;
    abd.lParam = 0;
    SHAppBarMessage(ABM_ACTIVATE, &abd);

    // Now determine if we're getting or losing activation
    switch (state)
    {
        case WA_ACTIVE:
        case WA_CLICKACTIVE:
            // If we're gaining activation, make sure we're visible
            AppBar_UnHide(hwnd);
            KillTimer(hwnd, IDT_AUTOHIDE);
            break;

        case WA_INACTIVE:
            // If we're losing activation, check to see if we need to autohide.
            AppBar_Hide(hwnd);
            break;
    }
}

void Main_OnCommand | ( | HWND | hwnd,
 |  | int | id,
 |  | HWND | hwndCtl,
 |  | UINT | codeNotify
 | ) |  |

Definition at line 266 of file WndProc.c.

{
    switch (id)
    {
        case ID_FILE_EXIT:
            // The user wants to exit, so send our window a close message
            SendMessage(hwnd, WM_CLOSE, 0, 0L);
            break;

        case ID_HELP_ABOUT:
            // Display the "About" dialog
            DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwnd,
                      AboutDlgProc);
            break;

        case ID_PROPERTIES:
            ShowOptions(hwnd);
            break;

        case ID_APPBAR_REGISTER:
            AppBar_Register(hwnd);
            break;

        case ID_APPBAR_UNREGISTER:
            AppBar_UnRegister(hwnd);
            break;

        case ID_APPBAR_AUTOHIDE:
            AppBar_SetAutoHide(hwnd, TRUE);
            break;

        case ID_APPBAR_NOAUTOHIDE:
            AppBar_SetAutoHide(hwnd, FALSE);
            break;

        case ID_APPBAR_TOP:
            AppBar_SetSide(hwnd, ABE_TOP);
            break;

        case ID_APPBAR_BOTTOM:
            AppBar_SetSide(hwnd, ABE_BOTTOM);
            break;

        case ID_APPBAR_LEFT:
            AppBar_SetSide(hwnd, ABE_LEFT);
            break;

        case ID_APPBAR_RIGHT:
            AppBar_SetSide(hwnd, ABE_RIGHT);
            break;
    }
}

BOOL Main_OnCreate | ( | HWND | hwnd,
 |  | LPCREATESTRUCT | lpCreateStruct
 | ) |  |

Definition at line 135 of file WndProc.c.

{
    POPTIONS pOptions;
    LOGFONT lf;

    // Initialize the common control DLL
    InitCommonControls();

    // Allocate an OPTIONS struct and attach to the appbar
    pOptions = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OPTIONS));
    if (pOptions)
        SetWindowLongPtr(hwnd, 0,(LONG_PTR)pOptions);
    else
        return (FALSE);

    pOptions->fAutoHide = FALSE;
    pOptions->fOnTop = FALSE;
    pOptions->uSide = ABE_TOP;
    pOptions->cxWidth = CX_DEFWIDTH;
    pOptions->cyHeight = CY_DEFHEIGHT;

    // Register the appbar and attach it to the top by default
    AppBar_Register(hwnd);
    AppBar_SetSide(hwnd, ABE_TOP);

    // Create the fonts for drawing in the client area
    ZeroMemory(&lf,sizeof(LOGFONT));
    lf.lfHeight = 45;
    lf.lfEscapement = 2700;
    lf.lfOrientation = 0;
    lstrcpyn(lf.lfFaceName, TEXT("Arial"), sizeof(lf.lfFaceName)/sizeof(lf.lfFaceName[0]));
    g_hFontLeft = CreateFontIndirect(&lf);

    lf.lfEscapement = 0;
    g_hFontTop = CreateFontIndirect(&lf);

    return (TRUE);
}

void Main_OnDestroy ( HWND hwnd )

Definition at line 460 of file WndProc.c.

{
    POPTIONS pOptions = GetAppbarData(hwnd);

    // Make sure the appbar is unregistered
    if (g_fAppRegistered)
    {
        SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(ID_APPBAR_UNREGISTER, 0), 0L);
    }

    // Free the OPTIONS struct associated with the appbar
    HeapFree(GetProcessHeap(), 0, pOptions);

    // Clean up the GDI objects we allocated
    DeleteObject(g_hFontTop);
    DeleteObject(g_hFontLeft);

    // Indicate that the message loop should exit since the main window
    // is being destroyed.
    PostQuitMessage(0);
}

void Main_OnLButtonDown | ( | HWND | hwnd,
 |  | BOOL | fDoubleClick,
 |  | int | x,
 |  | int | y,
 |  | UINT | keyFlags
 | ) |  |

Definition at line 659 of file WndProc.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    g_fMoving = TRUE;
    SetCapture(hwnd);
}

void Main_OnLButtonUp | ( | HWND | hwnd,
 |  | int | x,
 |  | int | y,
 |  | UINT | keyFlags
 | ) |  |

Definition at line 785 of file WndProc.c.

{
    APPBARDATA abd;
    POPTIONS pOpt = GetAppbarData(hwnd);

    if (!g_fMoving)
        return;

    // Update the global appbar rect used when we're autohiding.  This is
    // sloppy but it works for now.  It would be better to maintain two rects,
    // one for the hidden state and one for the unhidden state.
    g_rcAppBar = g_rcDrag;

    // Clean up the drag state info.
    ReleaseCapture();

    // Calculate the hidden rect if we need to and then tell the system about
    // our new area.
    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;

    if (pOpt->fAutoHide)
    {
        switch (pOpt->uSide)
        {
            case ABE_TOP:
                g_rcDrag.bottom = g_rcDrag.top + 2;
                break;
            case ABE_BOTTOM:
                g_rcDrag.top = g_rcDrag.bottom - 2;
                break;
            case ABE_LEFT:
                g_rcDrag.right = g_rcDrag.left + 2;
                break;
            case ABE_RIGHT:
                g_rcDrag.left = g_rcDrag.right - 2;
                break;
        }
    }

    AppBar_QuerySetPos(pOpt->uSide, &g_rcDrag, &abd, FALSE);

    g_fMoving = FALSE;
}

void Main_OnMouseMove | ( | HWND | hwnd,
 |  | int | x,
 |  | int | y,
 |  | UINT | keyFlags
 | ) |  |

Definition at line 680 of file WndProc.c.

{
    POINT ptCursor = {x, y};
    LONG cxScreen, cyScreen;
    DWORD dx, dy;
    WORD horiz, vert;
    POPTIONS pOpt = GetAppbarData(hwnd);
    APPBARDATA abd;

    // If we're not currently in the middle of moving the appbar window,
    // there's nothing to do.
    if (!g_fMoving)
        return;

    // Convert the mouse position to screen coordinates
    ClientToScreen(hwnd, &ptCursor);

    // Find out which edge of the screen we're closest to
    cxScreen = GetSystemMetrics(SM_CXSCREEN);
    cyScreen = GetSystemMetrics(SM_CYSCREEN);

    if (ptCursor.x < (cxScreen / 2))
    {
        dx = ptCursor.x;
        horiz = ABE_LEFT;
    }
    else
    {
        dx = cxScreen - ptCursor.x;
        horiz = ABE_RIGHT;
    }

    if (ptCursor.y < (cyScreen / 2))
    {
        dy = ptCursor.y;
        vert = ABE_TOP;
    }
    else
    {
        dy = cyScreen - ptCursor.y;
        vert = ABE_BOTTOM;
    }

    // Build a drag rectangle based on the edge of the screen that we're
    // closest to.
    if ((cxScreen * dy) > (cyScreen * dx))
    {
        g_rcDrag.top = 0;
        g_rcDrag.bottom = cyScreen;
        if (horiz == ABE_LEFT)
        {
            g_rcDrag.left = 0;
            g_rcDrag.right = g_rcDrag.left + pOpt->cxWidth;
            pOpt->uSide = ABE_LEFT;
        }
        else
        {
            g_rcDrag.right = cxScreen;
            g_rcDrag.left = g_rcDrag.right - pOpt->cxWidth;
            pOpt->uSide = ABE_RIGHT;
        }
    }
    else
    {
        g_rcDrag.left = 0;
        g_rcDrag.right = cxScreen;
        if (vert == ABE_TOP)
        {
            g_rcDrag.top = 0;
            g_rcDrag.bottom = g_rcDrag.top + pOpt->cyHeight;
            pOpt->uSide = ABE_TOP;
        }
        else
        {
            g_rcDrag.bottom = cyScreen;
            g_rcDrag.top = g_rcDrag.bottom - pOpt->cyHeight;
            pOpt->uSide = ABE_BOTTOM;
        }
    }

    // Finally, make sure this is an OK position with the system and move
    // the window.
    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;

    AppBar_QueryPos(hwnd, &g_rcDrag);
    MoveWindow(hwnd, g_rcDrag.left, g_rcDrag.top,
               g_rcDrag.right - g_rcDrag.left,
               g_rcDrag.bottom - g_rcDrag.top,
               TRUE);
}

void Main_OnMove | ( | HWND | hwnd,
 |  | int | x,
 |  | int | y
 | ) |  |

Definition at line 378 of file WndProc.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);

    if (g_fMoving || pOpt->fAutoHide)
        return;
    AppBar_Size(hwnd);
}

UINT Main_OnNCHitTest | ( | HWND | hwnd,
 |  | int | x,
 |  | int | y
 | ) |  |

Definition at line 563 of file WndProc.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    LRESULT  lHitTest;

    // Take care of the autohide stuff if needed
    AppBar_SetAutoUnhideTimer(hwnd);

    // Let DefWindowProc() tell us where the mouse is
    lHitTest = FORWARD_WM_NCHITTEST(hwnd, x, y, DefWindowProc);

    // We want to disable sizing in all directions except the inside edge.
    if ((pOpt->uSide == ABE_TOP) && (lHitTest == HTBOTTOM))
        return HTBOTTOM;

    if ((pOpt->uSide == ABE_BOTTOM) && (lHitTest == HTTOP))
        return HTTOP;

    if ((pOpt->uSide == ABE_LEFT) && (lHitTest == HTRIGHT))
        return HTRIGHT;

    if ((pOpt->uSide == ABE_RIGHT) && (lHitTest == HTLEFT))
        return HTLEFT;

    return HTCLIENT;
}

void Main_OnPaint ( HWND hwnd )

Definition at line 601 of file WndProc.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    HDC hdc;
    PAINTSTRUCT ps;
    RECT rc;
    HFONT hfont;
    int x,y;

    // Get the client rect
    GetClientRect(hwnd, &rc);
    InvalidateRect(hwnd, NULL, TRUE);

    hdc = BeginPaint(hwnd, &ps);

    // Figure out which side we're on so we can adjust the text accordingly
    switch (pOpt->uSide)
    {
        case ABE_TOP:
        case ABE_BOTTOM:
            hfont = SelectObject(hdc, g_hFontTop);
            x = 2;
            y = 2;
            break;

        case ABE_LEFT:
        case ABE_RIGHT:
            hfont = SelectObject(hdc, g_hFontLeft);
            x = rc.right - 2;
            y = 2;
            break;
    }

    // Draw the text and clean up
    ExtTextOut(hdc, x, y, ETO_OPAQUE, NULL, TEXT("Right Click for Options"),
               lstrlen(TEXT("Right Click for Options")), NULL);

    SelectObject(hdc, hfont);
    EndPaint(hwnd, &ps);

}

void Main_OnRButtonDown | ( | HWND | hwnd,
 |  | BOOL | fDoubleClick,
 |  | int | x,
 |  | int | y,
 |  | UINT | keyFlags
 | ) |  |

Definition at line 400 of file WndProc.c.

{
    HMENU hMenu, hSubMenu;
    POINT pt = {x, y};
    MENUITEMINFO mii;
    POPTIONS pOptions = GetAppbarData(hwnd);
    UINT uItem;
    TCHAR szMenu[64];

    // Bring up the context menu
    hMenu = LoadMenu(g_hInstance, MAKEINTRESOURCE(IDR_CONTEXTMENU));
    hSubMenu = GetSubMenu(hMenu, 0);

    // Convert the mouse position to screen coordinates
    ClientToScreen(hwnd, &pt);

    // Set the default menu item
    mii.cbSize = sizeof(MENUITEMINFO);
    mii.fMask = MIIM_STATE;
    mii.fState = MFS_DEFAULT;

    SetMenuItemInfo(hSubMenu, ID_PROPERTIES, FALSE, &mii);

    // Set the radio button to the side we're on
    if (ABE_TOP == pOptions->uSide)
        uItem = ID_APPBAR_TOP;
    else if (ABE_BOTTOM == pOptions->uSide)
        uItem = ID_APPBAR_BOTTOM;
    else if (ABE_LEFT == pOptions->uSide)
        uItem = ID_APPBAR_LEFT;
    else
        uItem = ID_APPBAR_RIGHT;

    mii.fMask = MIIM_TYPE | MIIM_STATE;
    (LPTSTR) mii.dwTypeData = szMenu;
    mii.cch = sizeof(szMenu);

    GetMenuItemInfo(hSubMenu, uItem, FALSE, &mii);

    mii.fType |= MFT_RADIOCHECK;
    mii.fState = MFS_CHECKED;

    SetMenuItemInfo(hSubMenu, uItem, FALSE, &mii);

    // Display the menu
    TrackPopupMenu(hSubMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
}

void Main_OnSize | ( | HWND | hwnd,
 |  | UINT | state,
 |  | int | cx,
 |  | int | cy
 | ) |  |

Definition at line 336 of file WndProc.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    RECT rcWindow;

    if (g_fMoving || pOpt->fAutoHide)
        return;

    // If the client width or height is zero, spew out a warning.
    if (!pOpt->fHiding && ((cx == 0) || (cy == 0)))
        DebugMsg(TEXT("Client area has a zero dimension!\r\n"));

    // Let the system know the appbar size has changed
    AppBar_Size(hwnd);

    // Update the stored height and widths if the appbar is not hidden
    if (!pOpt->fHiding)
    {
        GetWindowRect(hwnd, &rcWindow);

        if (pOpt->uSide == ABE_TOP || pOpt->uSide == ABE_BOTTOM)
            pOpt->cyHeight = rcWindow.bottom - rcWindow.top;
        else
            pOpt->cxWidth = rcWindow.right - rcWindow.left;

        DebugMsg(TEXT("Main_OnSize: cxWidth = %d, cyHeight = %d\r\n"),
                 pOpt->cxWidth, pOpt->cyHeight);
    }
}

void Main_OnTimer | ( | HWND | hwnd,
 |  | UINT | id
 | ) |  |

Definition at line 494 of file WndProc.c.

{
    POPTIONS pOpt = GetAppbarData(hwnd);
    POINT pt;
    RECT rc;
    HWND hwndActive;

    switch (id)
    {
        // The AUTOHIDE timer has fired.  Check to see if the mouse is over our
        // window and if not hide the appbar.
        case IDT_AUTOHIDE:
            if ((pOpt->fAutoHide) && (!pOpt->fHiding))
            {
                // Get the mouse position, the window position, and active
                // window
                GetCursorPos(&pt);
                GetWindowRect(hwnd, &rc);
                hwndActive = GetForegroundWindow();

                // If the mouse is outside of our window, or we are not active,
                // or at least one window is active, or we are not the parent
                // of an active window, the hide the appbar window.
                if ((!PtInRect(&rc, pt)) && (hwndActive != hwnd) &&
                    (hwndActive != NULL) && (GetWindowOwner(hwndActive) != hwnd))
                {
                    KillTimer(hwnd, id);
                    AppBar_Hide(hwnd);
                }
            }
            break;

        // The period between the time the user has entered our window and the
        // time we should show the window has expired.
        case IDT_AUTOUNHIDE:
            // Kill the timer, we only need it to fire once.
            KillTimer(hwnd, id);

            GetWindowRect(hwnd, &rc);
            if ((pOpt->fAutoHide) && (pOpt->fHiding))
            {
                // Check to see if the cursor is still in the appbar.  If so,
                // the unhide the window.
                GetCursorPos(&pt);
                if (PtInRect(&rc, pt))
                    AppBar_UnHide(hwnd);
            }
            break;
    }
}

void Main_OnWindowPosChanged | ( | HWND | hwnd,
 |  | const LPWINDOWPOS | lpwpos
 | ) |  |

Definition at line 230 of file WndProc.c.

{
    APPBARDATA abd;

    abd.cbSize = sizeof(APPBARDATA);
    abd.hWnd = hwnd;
    abd.lParam = 0;

    SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd);

    // DefWindowProc needs this to generate the WM_SIZE message.
    FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, DefWindowProc);
}

LRESULT CALLBACK MainWndProc | ( | HWND | hwnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 89 of file WndProc.c.

{
    switch(uMsg)
    {
        HANDLE_MSG(hwnd, WM_CREATE,           Main_OnCreate);
        HANDLE_MSG(hwnd, WM_ACTIVATE,         Main_OnActivate);
        HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGED, Main_OnWindowPosChanged);
        HANDLE_MSG(hwnd, WM_COMMAND,          Main_OnCommand);
        HANDLE_MSG(hwnd, WM_SIZE,             Main_OnSize);
        HANDLE_MSG(hwnd, WM_MOVE,             Main_OnMove);
        HANDLE_MSG(hwnd, WM_RBUTTONDOWN,      Main_OnRButtonDown);
        HANDLE_MSG(hwnd, WM_DESTROY,          Main_OnDestroy);
        HANDLE_MSG(hwnd, WM_TIMER,            Main_OnTimer);
        HANDLE_MSG(hwnd, WM_NCHITTEST,        Main_OnNCHitTest);
        HANDLE_MSG(hwnd, WM_PAINT,            Main_OnPaint);
        HANDLE_MSG(hwnd, WM_LBUTTONDOWN,      Main_OnLButtonDown);
        HANDLE_MSG(hwnd, WM_MOUSEMOVE,        Main_OnMouseMove);
        HANDLE_MSG(hwnd, WM_LBUTTONUP,        Main_OnLButtonUp);

        case APPBAR_CALLBACK:
            AppBar_Callback(hwnd, uMsg, wParam, lParam);
            return (0);

        default:                // Pass message on for default proccessing
            return DefWindowProc( hwnd, uMsg, wParam, lParam );
    }

    // If we performed non-default processing on the message, return FALSE
    return FALSE;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/BandObjs.Cpp File Reference

  • WinUI
  • Shell
  • BandObjs
Classes | Defines | Typedefs | Functions | Variables

BandObjs.Cpp File Reference

#include <ole2.h>
#include <comcat.h>
#include <olectl.h>
#include "ClsFact.h"
#include <initguid.h>
#include <shlguid.h>
#include "Guid.h"

Go to the source code of this file.

Classes

struct | DOREGSTRUCT

Defines

#define | INITGUID

Typedefs

typedef struct DOREGSTRUCT * | LPDOREGSTRUCT

Functions

STDAPI | DllCanUnloadNow (void)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppReturn)
BOOL WINAPI | DllMain (HINSTANCE, DWORD, LPVOID)
STDAPI | DllRegisterServer (void)
BOOL | RegisterComCat (CLSID, CATID)
BOOL RegisterServer (CLSID, LPTSTR)
BOOL RegisterToolBand (CLSID)

Variables

UINT g_DllRefCount
HINSTANCE | g_hInst

Define Documentation

#define INITGUID

Definition at line 33 of file BandObjs.Cpp.

Typedef Documentation

typedef struct DOREGSTRUCT * LPDOREGSTRUCT

Function Documentation

STDAPI DllCanUnloadNow ( void )

Definition at line 83 of file BandObjs.Cpp.

{
return (g_DllRefCount ? S_FALSE : S_OK);
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppReturn
 | ) |  |

Definition at line 94 of file BandObjs.Cpp.

{
*ppReturn = NULL;

//if we don't support this classid, return the proper error code
if(   !IsEqualCLSID(rclsid, CLSID_SampleDeskBand) &&
      !IsEqualCLSID(rclsid, CLSID_SampleExplorerBar) &&
      !IsEqualCLSID(rclsid, CLSID_SampleCommBand) &&
      !IsEqualCLSID(rclsid, CLSID_SampleToolBand))
   return CLASS_E_CLASSNOTAVAILABLE;

//create a CClassFactory object and check it for validity
CClassFactory *pClassFactory = new CClassFactory(rclsid);
if(NULL == pClassFactory)
   return E_OUTOFMEMORY;

//get the QueryInterface return for our return value
HRESULT hResult = pClassFactory->QueryInterface(riid, ppReturn);

//call Release to decement the ref count - creating the object set it to one
//and QueryInterface incremented it - since its being used externally (not by
//us), we only want the ref count to be 1
pClassFactory->Release();

//return the result from QueryInterface
return hResult;
}

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 60 of file BandObjs.Cpp.

{
switch(dwReason)
   {
   case DLL_PROCESS_ATTACH:
      g_hInst = hInstance;
      break;

   case DLL_PROCESS_DETACH:
      break;
   }

return TRUE;
}

STDAPI DllRegisterServer ( void )

Definition at line 130 of file BandObjs.Cpp.

{
//Register the desk band object.
if(!RegisterServer(CLSID_SampleDeskBand, TEXT("Sample &Desk Band")))
   return SELFREG_E_CLASS;

//Register the component categories for the desk band object.
if(!RegisterComCat(CLSID_SampleDeskBand, CATID_DeskBand))
   return SELFREG_E_CLASS;

//Register the explorer bar object.
if(!RegisterServer(CLSID_SampleExplorerBar, TEXT("Sample &Explorer Bar")))
   return SELFREG_E_CLASS;

//Register the component categories for the explorer bar object.
if(!RegisterComCat(CLSID_SampleExplorerBar, CATID_InfoBand))
   return SELFREG_E_CLASS;

//Register the comm band object.
if(!RegisterServer(CLSID_SampleCommBand, TEXT("Sample &Comm Band")))
   return SELFREG_E_CLASS;

//Register the component categories for the comm band object.
if(!RegisterComCat(CLSID_SampleCommBand, CATID_CommBand))
   return SELFREG_E_CLASS;

//Register the tool band object.
if(!RegisterServer(CLSID_SampleToolBand, TEXT("Sample &Tool Band")))
   return SELFREG_E_CLASS;

//Register the tool band object.
if(!RegisterToolBand(CLSID_SampleToolBand))
   return SELFREG_E_CLASS;

/*
Remove the cache of the deskbands on Windows 2000. This will cause the new
deskband to be displayed in the toolbar menu the next time the user brings it
up. See KB article Q214842 for more information on this.
*/
TCHAR    szSubKey[MAX_PATH];
TCHAR    szCATID[MAX_PATH];
LPWSTR   pwszCATID;

StringFromCLSID(CATID_DeskBand, &pwszCATID);
if(pwszCATID)
   {
#ifdef UNICODE
   lstrcpyn(szCATID, pwszCATID, ARRAYSIZE(szCATID));
#else
   WideCharToMultiByte( CP_ACP,
                        0,
                        pwszCATID,
                        -1,
                        szCATID,
                        ARRAYSIZE(szCATID),
                        NULL,
                        NULL);
#endif

   //free the string
   CoTaskMemFree(pwszCATID);

   wsprintf(szSubKey, TEXT("Component Categories\\%s\\Enum"), szCATID);

   RegDeleteKey(HKEY_CLASSES_ROOT, szSubKey);
   }

return S_OK;
}

BOOL RegisterComCat | ( | CLSID | clsid,
 |  | CATID | CatID
 | ) |  |

Definition at line 339 of file BandObjs.Cpp.

{
ICatRegister   *pcr;
HRESULT        hr = S_OK ;

CoInitialize(NULL);

hr = CoCreateInstance(  CLSID_StdComponentCategoriesMgr,
                        NULL,
                        CLSCTX_INPROC_SERVER,
                        IID_ICatRegister,
                        (LPVOID*)&pcr);

if(SUCCEEDED(hr))
   {
   hr = pcr->RegisterClassImplCategories(clsid, 1, &CatID);

   pcr->Release();
   }

CoUninitialize();

return SUCCEEDED(hr);
}

BOOL RegisterServer | ( | CLSID | clsid,
 |  | LPTSTR | lpszTitle
 | ) |  |

Definition at line 213 of file BandObjs.Cpp.

{
int      i;
HKEY     hKey;
LRESULT  lResult;
DWORD    dwDisp;
TCHAR    szSubKey[MAX_PATH];
TCHAR    szCLSID[MAX_PATH];
TCHAR    szModule[MAX_PATH];
LPWSTR   pwsz;

//get the CLSID in string form
StringFromIID(clsid, &pwsz);

if(pwsz)
   {
#ifdef UNICODE
   lstrcpyn(szCLSID, pwsz, ARRAYSIZE(szCLSID));
#else
   WideCharToMultiByte( CP_ACP,
                        0,
                        pwsz,
                        -1,
                        szCLSID,
                        ARRAYSIZE(szCLSID),
                        NULL,
                        NULL);
#endif

   //free the string
   CoTaskMemFree(pwsz);
   }

//get this app's path and file name
GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule));

DOREGSTRUCT ClsidEntries[] = {HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s"),                  NULL,                   lpszTitle,
                              HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),  NULL,                   szModule,
                              HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),  TEXT("ThreadingModel"), TEXT("Apartment"),
                              NULL,                NULL,                               NULL,                   NULL};

//register the CLSID entries
for(i = 0; ClsidEntries[i].hRootKey; i++)
   {
   //create the sub key string - for this case, insert the file extension
   wsprintf(szSubKey, ClsidEntries[i].szSubKey, szCLSID);

   lResult = RegCreateKeyEx(  ClsidEntries[i].hRootKey,
                              szSubKey,
                              0,
                              NULL,
                              REG_OPTION_NON_VOLATILE,
                              KEY_WRITE,
                              NULL,
                              &hKey,
                              &dwDisp);

   if(NOERROR == lResult)
      {
      TCHAR szData[MAX_PATH];

      //if necessary, create the value string
      wsprintf(szData, ClsidEntries[i].szData, szModule);

      lResult = RegSetValueEx(   hKey,
                                 ClsidEntries[i].lpszValueName,
                                 0,
                                 REG_SZ,
                                 (LPBYTE)szData,
                                 lstrlen(szData) + 1);

      RegCloseKey(hKey);
      }
   else
      return FALSE;
   }

//If running on NT, register the extension as approved.
OSVERSIONINFO  osvi;

osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);

if(VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
   {
   lstrcpyn( szSubKey, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), ARRAYSIZE(szSubKey));

   lResult = RegCreateKeyEx(  HKEY_LOCAL_MACHINE,
                              szSubKey,
                              0,
                              NULL,
                              REG_OPTION_NON_VOLATILE,
                              KEY_WRITE,
                              NULL,
                              &hKey,
                              &dwDisp);

   if(NOERROR == lResult)
      {
      TCHAR szData[MAX_PATH];

      //Create the value string.
      lstrcpyn(szData, lpszTitle, ARRAYSIZE(szData));

      lResult = RegSetValueEx(   hKey,
                                 szCLSID,
                                 0,
                                 REG_SZ,
                                 (LPBYTE)szData,
                                 (lstrlen(szData) + 1) * sizeof(TCHAR));

      RegCloseKey(hKey);
      }
   else
      return FALSE;
   }

return TRUE;
}

BOOL RegisterToolBand ( CLSID clsid )

Definition at line 370 of file BandObjs.Cpp.

{
HKEY     hKey;
LRESULT  lResult;
DWORD    dwDisp;
TCHAR    szCLSID[MAX_PATH];
LPWSTR   pwsz;

//get the CLSID in string form
StringFromIID(clsid, &pwsz);

if(pwsz)
   {
#ifdef UNICODE
   lstrcpyn(szCLSID, pwsz, ARRAYSIZE(szCLSID));
#else
   WideCharToMultiByte( CP_ACP,
                        0,
                        pwsz,
                        -1,
                        szCLSID,
                        ARRAYSIZE(szCLSID),
                        NULL,
                        NULL);
#endif

   //free the string
   CoTaskMemFree(pwsz);
   }

lResult = RegCreateKeyEx(  HKEY_LOCAL_MACHINE,
                           TEXT("Software\\Microsoft\\Internet Explorer\\Toolbar"),
                           0,
                           NULL,
                           REG_OPTION_NON_VOLATILE,
                           KEY_WRITE,
                           NULL,
                           &hKey,
                           &dwDisp);

if(NOERROR == lResult)
   {
   TCHAR szData[] = TEXT("");

   lResult = RegSetValueEx(   hKey,
                              szCLSID,
                              0,
                              REG_SZ,
                              (LPBYTE)szData,
                              lstrlen(szData) + 1);

   RegCloseKey(hKey);
   }
else
   return FALSE;

return TRUE;
}

Variable Documentation

UINT g_DllRefCount

Definition at line 52 of file BandObjs.Cpp.

HINSTANCE g_hInst

Definition at line 51 of file BandObjs.Cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ClsFact.Cpp File Reference

  • WinUI
  • Shell
  • BandObjs
Functions

ClsFact.Cpp File Reference

#include "ClsFact.h"
#include "Guid.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CClassFactory

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 109 of file ClsFact.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ClsFact.h File Reference

  • WinUI
  • Shell
  • BandObjs
Classes

ClsFact.h File Reference

#include <windows.h>
#include "Globals.h"
#include "DeskBand.h"
#include "ExplrBar.h"
#include "CommBand.h"
#include "ToolBand.h"
#include "Globals.h"

Go to the source code of this file.

Classes

class CClassFactory
Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/CommBand.Cpp File Reference

  • WinUI
  • Shell
  • BandObjs
Functions

CommBand.Cpp File Reference

#include "CommBand.h"
#include "Guid.h"
#include <mshtmhst.h>

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CCommBand

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 162 of file CommBand.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/CommBand.h File Reference

  • WinUI
  • Shell
  • BandObjs
Classes | Defines

CommBand.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "Globals.h"

Go to the source code of this file.

Classes

class | CCommBand

Defines

#define | CB_CLASS_NAME (TEXT("CommBandSampleClass"))

Define Documentation

#define CB_CLASS_NAME (TEXT("CommBandSampleClass"))

Definition at line 26 of file CommBand.h.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/DeskBand.Cpp File Reference

  • WinUI
  • Shell
  • BandObjs
Functions

DeskBand.Cpp File Reference

#include "DeskBand.h"
#include "Guid.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CDeskBand

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 161 of file DeskBand.Cpp.

{
  if(--m_ObjRefCount == 0)
    {
      delete this;
      return 0;
    }

  return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/DeskBand.h File Reference

  • WinUI
  • Shell
  • BandObjs
Classes | Defines

DeskBand.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "Globals.h"

Go to the source code of this file.

Classes

class | CDeskBand

Defines

#define | DB_CLASS_NAME (TEXT("DeskBandSampleClass"))
#define | DB_MIN_SIZE_X 10
#define | DB_MIN_SIZE_Y 10
#define | IDM_COMMAND 0

Define Documentation

#define DB_CLASS_NAME (TEXT("DeskBandSampleClass"))

Definition at line 26 of file DeskBand.h.

#define DB_MIN_SIZE_X 10

Definition at line 28 of file DeskBand.h.

#define DB_MIN_SIZE_Y 10

Definition at line 29 of file DeskBand.h.

#define IDM_COMMAND 0

Definition at line 31 of file DeskBand.h.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ExplrBar.Cpp File Reference

  • WinUI
  • Shell
  • BandObjs
Functions

ExplrBar.Cpp File Reference

#include "ExplrBar.h"
#include "Guid.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CExplorerBar

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 155 of file ExplrBar.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ExplrBar.h File Reference

  • WinUI
  • Shell
  • BandObjs
Classes | Defines

ExplrBar.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "Globals.h"

Go to the source code of this file.

Classes

class | CExplorerBar

Defines

#define | EB_CLASS_NAME (TEXT("ExplorerBarSampleClass"))
#define | MIN_SIZE_X 10
#define | MIN_SIZE_Y 10

Define Documentation

#define EB_CLASS_NAME (TEXT("ExplorerBarSampleClass"))

Definition at line 26 of file ExplrBar.h.

#define MIN_SIZE_X 10

Definition at line 28 of file ExplrBar.h.

#define MIN_SIZE_Y 10

Definition at line 29 of file ExplrBar.h.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/Globals.h File Reference

  • WinUI
  • Shell
  • BandObjs
Defines | Variables

Globals.h File Reference

Go to the source code of this file.

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))

Variables

UINT g_DllRefCount
HINSTANCE | g_hInst

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 23 of file Globals.h.

Variable Documentation

UINT g_DllRefCount

Definition at line 63 of file DoServer.Cpp.

HINSTANCE g_hInst

Definition at line 62 of file DoServer.Cpp.

Generated on Wed Nov 13 2024 16:54:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/Guid.h File Reference

  • WinUI
  • Shell
  • BandObjs
Functions

Guid.h File Reference

Go to the source code of this file.

Functions

DEFINE_GUID (CLSID_SampleDeskBand, 0x85e0b170, 0x4fa, 0x11d1, 0xb7, 0xda, 0x0, 0xa0, 0xc9, 0x3, 0x48, 0xd6)
DEFINE_GUID (CLSID_SampleToolBand, 0x85e0b173, 0x4fa, 0x11d1, 0xb7, 0xda, 0x0, 0xa0, 0xc9, 0x3, 0x48, 0xd6)
DEFINE_GUID (CLSID_SampleCommBand, 0x85e0b172, 0x4fa, 0x11d1, 0xb7, 0xda, 0x0, 0xa0, 0xc9, 0x3, 0x48, 0xd6)
DEFINE_GUID (CLSID_SampleExplorerBar, 0x85e0b171, 0x4fa, 0x11d1, 0xb7, 0xda, 0x0, 0xa0, 0xc9, 0x3, 0x48, 0xd6)

Function Documentation

DEFINE_GUID | ( | CLSID_SampleDeskBand | ,
 |  | 0x85e0b170 | ,
 |  | 0x4fa | ,
 |  | 0x11d1 | ,
 |  | 0xb7 | ,
 |  | 0xda | ,
 |  | 0x0 | ,
 |  | 0xa0 | ,
 |  | 0xc9 | ,
 |  | 0x3 | ,
 |  | 0x48 | ,
 |  | 0xd6 |
 | ) |  |
DEFINE_GUID | ( | CLSID_SampleToolBand | ,
 |  | 0x85e0b173 | ,
 |  | 0x4fa | ,
 |  | 0x11d1 | ,
 |  | 0xb7 | ,
 |  | 0xda | ,
 |  | 0x0 | ,
 |  | 0xa0 | ,
 |  | 0xc9 | ,
 |  | 0x3 | ,
 |  | 0x48 | ,
 |  | 0xd6 |
 | ) |  |
DEFINE_GUID | ( | CLSID_SampleCommBand | ,
 |  | 0x85e0b172 | ,
 |  | 0x4fa | ,
 |  | 0x11d1 | ,
 |  | 0xb7 | ,
 |  | 0xda | ,
 |  | 0x0 | ,
 |  | 0xa0 | ,
 |  | 0xc9 | ,
 |  | 0x3 | ,
 |  | 0x48 | ,
 |  | 0xd6 |
 | ) |  |
DEFINE_GUID | ( | CLSID_SampleExplorerBar | ,
 |  | 0x85e0b171 | ,
 |  | 0x4fa | ,
 |  | 0x11d1 | ,
 |  | 0xb7 | ,
 |  | 0xda | ,
 |  | 0x0 | ,
 |  | 0xa0 | ,
 |  | 0xc9 | ,
 |  | 0x3 | ,
 |  | 0x48 | ,
 |  | 0xd6 |
 | ) |  |
Generated on Wed Nov 13 2024 16:54:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ToolBand.Cpp File Reference

  • WinUI
  • Shell
  • BandObjs
Functions

ToolBand.Cpp File Reference

#include "ToolBand.h"
#include "Guid.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CToolBand

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 161 of file ToolBand.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ToolBand.h File Reference

  • WinUI
  • Shell
  • BandObjs
Classes | Defines

ToolBand.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "Globals.h"

Go to the source code of this file.

Classes

class | CToolBand

Defines

#define | TB_CLASS_NAME (TEXT("ToolBandSampleClass"))
#define | TB_MAX_SIZE_Y 25
#define | TB_MIN_SIZE_X 10
#define | TB_MIN_SIZE_Y 10

Define Documentation

#define TB_CLASS_NAME (TEXT("ToolBandSampleClass"))

Definition at line 33 of file ToolBand.h.

#define TB_MAX_SIZE_Y 25

Definition at line 38 of file ToolBand.h.

#define TB_MIN_SIZE_X 10

Definition at line 35 of file ToolBand.h.

#define TB_MIN_SIZE_Y 10

Definition at line 36 of file ToolBand.h.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ClassFactory.Cpp File Reference

  • WinUI
  • Shell
  • ColumnProvider
Functions

ClassFactory.Cpp File Reference

#include "ShortName.h"
#include "ClassFactory.h"
#include "ColumnProvider.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CClassFactory

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 63 of file ClassFactory.Cpp.

{
    if (--m_nRefCount == 0)
    {
        delete this;
        return 0;
    }
    return m_nRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ClassFactory.h File Reference

  • WinUI
  • Shell
  • ColumnProvider
Classes

ClassFactory.h File Reference

Go to the source code of this file.

Classes

class CClassFactory
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/clsid.Cpp File Reference

  • WinUI
  • Shell
  • ColumnProvider
Functions | Variables

clsid.Cpp File Reference

#include "ShortName.h"
#include "Resource.h"

Go to the source code of this file.

Functions

BOOL WINAPI | GetObjectClsid (LPTSTR lpszClsid, DWORD cbClsid)
BOOL WINAPI | GetObjectClsid (LPCLSID pClsid)

Variables

HINSTANCE | hDllInstance

Function Documentation

BOOL WINAPI GetObjectClsid | ( | LPTSTR | lpszClsid,
 |  | DWORD | cbClsid
 | ) |  |

Definition at line 21 of file clsid.Cpp.

{
    if (!LoadString (hDllInstance, IDS_CLSID, lpszClsid, cbClsid))
        return FALSE;
    return TRUE;
}

BOOL WINAPI GetObjectClsid ( LPCLSID pClsid )

Definition at line 29 of file clsid.Cpp.

{
    if (pClsid == NULL)
        return FALSE;

    TCHAR szClsid[40];
    WCHAR wszClsid[40];

    if (!GetObjectClsid (szClsid, 40))
        return FALSE;

#ifndef UNICODE
    MultiByteToWideChar (CP_ACP, 0, szClsid, -1, wszClsid, 40);
#else
    lstrcpyn (wszClsid, szClsid, ARRAYSIZE(wszClsid));
#endif

    if (FAILED(CLSIDFromString (wszClsid, pClsid)))
        return FALSE;
    return TRUE;
}

Variable Documentation

HINSTANCE hDllInstance

Definition at line 37 of file spi.cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/columnprovider.Cpp File Reference

  • WinUI
  • Shell
  • ColumnProvider
Defines | Functions | Variables

columnprovider.Cpp File Reference

#include "ShortName.h"
#include "ColumnProvider.h"
#include "Resource.h"

Go to the source code of this file.

Defines

#define | NUM_COLUMNS 2
#define | STR_FMTID_FullPath TEXT("{706005E2-0888-11D3-B1C2-00600893AD51}")
#define | STR_FMTID_ShortFilename TEXT("{706005E1-0888-11D3-B1C2-00600893AD51}")

Functions

STDMETHODIMP_ (ULONG) CColumnProvider

Variables

GUID | FMTID_FullPath = {0x706005E2, 0x0888, 0x11D3, {0xB1, 0xC2, 0x00, 0x60, 0x08, 0x93, 0xAD, 0x51}}
GUID | FMTID_ShortFilename = {0x706005E1, 0x0888, 0x11D3, {0xB1, 0xC2, 0x00, 0x60, 0x08, 0x93, 0xAD, 0x51}}
SHCOLUMNINFO | sci [NUM_COLUMNS]

Define Documentation

#define NUM_COLUMNS 2

Definition at line 20 of file columnprovider.Cpp.

#define STR_FMTID_FullPath TEXT("{706005E2-0888-11D3-B1C2-00600893AD51}")

Definition at line 25 of file columnprovider.Cpp.

#define STR_FMTID_ShortFilename TEXT("{706005E1-0888-11D3-B1C2-00600893AD51}")

Definition at line 22 of file columnprovider.Cpp.

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 80 of file columnprovider.Cpp.

{
    if (--m_nRefCount == 0)
    {
        delete this;
        return 0;
    }
    return m_nRefCount;
}

Variable Documentation

GUID FMTID_FullPath = {0x706005E2, 0x0888, 0x11D3, {0xB1, 0xC2, 0x00, 0x60, 0x08, 0x93, 0xAD, 0x51}}

Definition at line 26 of file columnprovider.Cpp.

GUID FMTID_ShortFilename = {0x706005E1, 0x0888, 0x11D3, {0xB1, 0xC2, 0x00, 0x60, 0x08, 0x93, 0xAD, 0x51}}

Definition at line 23 of file columnprovider.Cpp.

SHCOLUMNINFO sci[NUM_COLUMNS]
Initial value:
{
    {{0}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR | SHCOLSTATE_SECONDARYUI, TEXT("Short Filename"), TEXT("Displays the 8.3 filename.")},
    {{0}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR | SHCOLSTATE_SECONDARYUI, TEXT("Short Pathname"), TEXT("Displays the 8.3 pathname to the file or folder.")}
}

Definition at line 28 of file columnprovider.Cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/columnprovider.h File Reference

  • WinUI
  • Shell
  • ColumnProvider
Classes

columnprovider.h File Reference

Go to the source code of this file.

Classes

class CColumnProvider
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/RegisterServer.Cpp File Reference

  • WinUI
  • Shell
  • ColumnProvider
Functions | Variables

RegisterServer.Cpp File Reference

#include "ShortName.h"
#include "Resource.h"
#include <sddl.h>

Go to the source code of this file.

Functions

PSECURITY_DESCRIPTOR WINAPI | CreateNullDacl ()
STDAPI | DllRegisterServer (VOID)
VOID WINAPI | FreeNullDacl (PSECURITY_DESCRIPTOR psd)

Variables

HINSTANCE | hDllInstance

Function Documentation

PSECURITY_DESCRIPTOR WINAPI CreateNullDacl ( )
STDAPI DllRegisterServer ( VOID )

Definition at line 30 of file RegisterServer.Cpp.

{
    TCHAR       szModuleName[MAX_PATH];
    HRESULT     hResult = S_OK;
    TCHAR       szBuffer[MAX_PATH+10] = TEXT("");
    TCHAR       szClsid[MAX_PATH] = TEXT("");
    TCHAR       szSubKey[MAX_PATH] = TEXT("");
    TCHAR       szColumnProvider[MAX_PATH] = TEXT("");
    TCHAR       szDescription[MAX_PATH] = TEXT("");

    SECURITY_ATTRIBUTES SA;
    SA.nLength = sizeof(SECURITY_ATTRIBUTES);
    SA.bInheritHandle = TRUE;
    WCHAR *pwszSD=L"D:(A;OICI;GA;;;SY)(A;OICI;GA;;;BA)(A;OICI;GA;;;CO)(A;OICI;GRGWGX;;;IU)";
    //
    //  Load some necessary string values
    //
    //
    //  Initialize the security attributes structure
    //
    if (ConvertStringSecurityDescriptorToSecurityDescriptor(pwszSD,
                  SDDL_REVISION_1,
                  &(SA.lpSecurityDescriptor),
                  NULL))
      {
  LoadString (hDllInstance, IDS_CLSID, szClsid, MAX_PATH);
  LoadString (hDllInstance, IDS_DESCRIPTION, szDescription, MAX_PATH);
  LoadString (hDllInstance, IDS_REGKEY_COLUMNPROVIDER, szColumnProvider, MAX_PATH);

  //
  //  Get the name of this module
  //
  GetModuleFileName (hDllInstance, szModuleName, MAX_PATH);

  //
  //  Register the component under HKCR\CLSID
  //
  HKEY    hKey            = NULL;
  DWORD   dwDisposition   = 0;
  LRESULT lResult         = 0;

  wsprintf (szSubKey, TEXT("CLSID\\%s"), szClsid);
  lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
          0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
          &SA, &hKey, &dwDisposition);

  if (lResult == NOERROR)
    {
      lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
             (LPBYTE) szDescription, GetStringByteSize(szDescription));
      if (lResult != NOERROR)
        hResult = SELFREG_E_CLASS;
      RegCloseKey (hKey);
      hKey = NULL;
    }
  else
    {
      hResult = SELFREG_E_CLASS;
    }

  //
  //  Register component information under HKCR\CLSID\{CLSID}
  //
  StrCatBuff (szSubKey, TEXT("\\InprocServer32"), ARRAYSIZE(szSubKey));
  lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
          0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
          &SA, &hKey, &dwDisposition);

  if (lResult == NOERROR)
    {
      lstrcpyn (szBuffer, TEXT("Apartment"), ARRAYSIZE(szBuffer));
      lResult = RegSetValueEx (hKey, TEXT("ThreadingModel"), 0,
             REG_SZ, (LPBYTE) szBuffer, GetStringByteSize (szBuffer));
      if (lResult != NOERROR)
        hResult = SELFREG_E_CLASS;

      lResult = RegSetValueEx (hKey, TEXT(""), 0,
             REG_SZ, (LPBYTE) szModuleName, GetStringByteSize(szModuleName));
      if (lResult != NOERROR)
        hResult = SELFREG_E_CLASS;

      RegCloseKey (hKey);
      hKey = NULL;
    }
  else
    {
      hResult = SELFREG_E_CLASS;
    }

  //
  //  Register the component as a column provider extension under
  //  HKCR\Folder\shellex\ColumnHandlers
  //
  wsprintf (szSubKey, TEXT("%s\\%s"), szColumnProvider, szClsid);
  lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
          0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
          &SA, &hKey, &dwDisposition);

  if (lResult != NOERROR)
    {
      hResult = SELFREG_E_CLASS;
    }

  LocalFree(SA.lpSecurityDescriptor);
      } else {
  hResult = E_FAIL;
      }

    return hResult;
}

VOID WINAPI FreeNullDacl ( PSECURITY_DESCRIPTOR psd )

Variable Documentation

HINSTANCE hDllInstance

Definition at line 37 of file spi.cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/Resource.h File Reference

  • WinUI
  • Shell
  • ColumnProvider
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDI_ICON1 101
#define | IDS_CLSID 2
#define | IDS_DESCRIPTION 1
#define | IDS_REGKEY_COLUMNPROVIDER 3
#define | IDS_TITLE 4

Define Documentation

#define IDI_ICON1 101

Definition at line 9 of file Resource.h.

#define IDS_CLSID 2

Definition at line 6 of file Resource.h.

#define IDS_DESCRIPTION 1

Definition at line 5 of file Resource.h.

#define IDS_REGKEY_COLUMNPROVIDER 3

Definition at line 7 of file Resource.h.

#define IDS_TITLE 4

Definition at line 8 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ShortName.Cpp File Reference

  • WinUI
  • Shell
  • ColumnProvider
Functions | Variables

ShortName.Cpp File Reference

#include "ShortName.h"
#include "ClassFactory.h"

Go to the source code of this file.

Functions

STDAPI | DllCanUnloadNow (VOID)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
BOOL WINAPI | DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)

Variables

CLSID | CLSID_ShortNameColumnProvider = {0}
HINSTANCE | hDllInstance = NULL
ULONG | nDllRefCount = 0

Function Documentation

STDAPI DllCanUnloadNow ( VOID )

Definition at line 55 of file ShortName.Cpp.

{
    if (nDllRefCount > 0)
        return S_FALSE;
    return S_OK;
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppv
 | ) |  |

Definition at line 63 of file ShortName.Cpp.

{
    if (ppv == NULL)
        return E_INVALIDARG;

    *ppv = NULL;

    if (!IsEqualIID(rclsid, CLSID_ShortNameColumnProvider))
        return CLASS_E_CLASSNOTAVAILABLE;

    CClassFactory *pFactory = new CClassFactory;
    if (!pFactory)
        return E_OUTOFMEMORY;

    HRESULT hResult = NOERROR;
    hResult = pFactory->QueryInterface (riid, ppv);

    return hResult;
}

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 25 of file ShortName.Cpp.

{
    switch (dwReason)
    {
        case DLL_PROCESS_ATTACH:
            hDllInstance = hInstance;
            nDllRefCount = 0;

            //
            //  Initialize CLSID_ShortNameColumnProvider
            //
            GetObjectClsid (&CLSID_ShortNameColumnProvider);
            break;

        case DLL_THREAD_ATTACH:
            break;

        case DLL_THREAD_DETACH:
            break;

        case DLL_PROCESS_DETACH:
            break;

        default:
            break;
    }
    return TRUE;
}

Variable Documentation

CLSID CLSID_ShortNameColumnProvider = {0}

Definition at line 23 of file ShortName.Cpp.

HINSTANCE hDllInstance = NULL

Definition at line 20 of file ShortName.Cpp.

ULONG nDllRefCount = 0

Definition at line 21 of file ShortName.Cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ShortName.h File Reference

  • WinUI
  • Shell
  • ColumnProvider
Defines | Functions | Variables

ShortName.h File Reference

#include <windows.h>
#include <olectl.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <shlobj.h>

Go to the source code of this file.

Defines

#define | ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
#define | MAX_BUTTONTEXT_LEN 25
#define | MAX_DESCRIPTION_LEN 500
#define | MAX_DISPLAY_LEN 100

Functions

BOOL WINAPI | GetObjectClsid (LPTSTR lpszClsid, DWORD cbClsid)
BOOL WINAPI | GetObjectClsid (LPCLSID pClsid)
UINT | GetStringByteSize (LPTSTR pszString)
UINT | GetStringByteSizeUnicode (LPCSTR pszString)

Variables

HINSTANCE | hDllInstance
ULONG nDllRefCount

Define Documentation

#define ARRAYSIZE ( x ) (sizeof(x) / sizeof(x[0]))

Definition at line 34 of file ShortName.h.

#define MAX_BUTTONTEXT_LEN 25

Definition at line 29 of file ShortName.h.

#define MAX_DESCRIPTION_LEN 500

Definition at line 28 of file ShortName.h.

#define MAX_DISPLAY_LEN 100

Definition at line 27 of file ShortName.h.

Function Documentation

BOOL WINAPI GetObjectClsid | ( | LPTSTR | lpszClsid,
 |  | DWORD | cbClsid
 | ) |  |

Definition at line 21 of file clsid.Cpp.

{
    if (!LoadString (hDllInstance, IDS_CLSID, lpszClsid, cbClsid))
        return FALSE;
    return TRUE;
}

BOOL WINAPI GetObjectClsid ( LPCLSID pClsid )

Definition at line 29 of file clsid.Cpp.

{
    if (pClsid == NULL)
        return FALSE;

    TCHAR szClsid[40];
    WCHAR wszClsid[40];

    if (!GetObjectClsid (szClsid, 40))
        return FALSE;

#ifndef UNICODE
    MultiByteToWideChar (CP_ACP, 0, szClsid, -1, wszClsid, 40);
#else
    lstrcpyn (wszClsid, szClsid, ARRAYSIZE(wszClsid));
#endif

    if (FAILED(CLSIDFromString (wszClsid, pClsid)))
        return FALSE;
    return TRUE;
}

UINT GetStringByteSize ( LPTSTR pszString ) [inline]

Definition at line 43 of file ShortName.h.

{return ((lstrlen(pszString) + 1) * sizeof(TCHAR));}

UINT GetStringByteSizeUnicode ( LPCSTR pszString ) [inline]

Definition at line 52 of file ShortName.h.

{return ((lstrlenA(pszString) + 1) * sizeof(WCHAR));}

Variable Documentation

HINSTANCE hDllInstance

Definition at line 37 of file spi.cpp.

ULONG nDllRefCount

Definition at line 21 of file ShortName.Cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/UnRegisterServer.Cpp File Reference

  • WinUI
  • Shell
  • ColumnProvider
Functions | Variables

UnRegisterServer.Cpp File Reference

#include "ShortName.h"
#include "Resource.h"

Go to the source code of this file.

Functions

STDAPI | DllUnregisterServer (VOID)

Variables

HINSTANCE | hDllInstance

Function Documentation

STDAPI DllUnregisterServer ( VOID )

Definition at line 21 of file UnRegisterServer.Cpp.

{
    HRESULT     hResult     = S_OK;
    LRESULT     lResult     = NOERROR;
    HKEY        hKey        = NULL;
    TCHAR       szClsid[MAX_PATH] = TEXT("");
    TCHAR       szSubKey[MAX_PATH] = TEXT("");

    //
    //  Load some necessary string values
    //
    LoadString (hDllInstance, IDS_CLSID, szClsid, MAX_PATH);

    //
    //  Delete the key HKCR\CLSID\{CLSID}\InprocServer32
    //
    wsprintf (szSubKey, TEXT("CLSID\\%s\\InprocServer32"), szClsid);
    lResult = RegDeleteKey (HKEY_CLASSES_ROOT, szSubKey);
    if (lResult != NOERROR)
    {
        hResult = SELFREG_E_CLASS;
    }

    //
    //  Delete the key HKCR\CLSID\{CLSID}
    //
    wsprintf (szSubKey, TEXT("CLSID\\%s"), szClsid);
    lResult = RegDeleteKey (HKEY_CLASSES_ROOT, szSubKey);
    if (lResult != NOERROR)
    {
        hResult = SELFREG_E_CLASS;
    }

    //
    //  Delete the key HKCR\Folder\shellex\ColumnHandlers\{CLSID}
    //
    LoadString (hDllInstance, IDS_REGKEY_COLUMNPROVIDER, szSubKey, MAX_PATH);
    StrCatBuff (szSubKey, TEXT("\\"), ARRAYSIZE(szSubKey));
    StrCatBuff (szSubKey, szClsid, ARRAYSIZE(szSubKey));
    lResult = RegDeleteKey (HKEY_CLASSES_ROOT, szSubKey);
    if (lResult != NOERROR)
    {
        hResult = SELFREG_E_CLASS;
    }

    return hResult;
}

Variable Documentation

HINSTANCE hDllInstance

Definition at line 37 of file spi.cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/customdrawbuttondlg/CustomDrawButtonDlg.cpp File Reference

  • WinUI
  • Shell
  • customdrawbuttondlg
Functions

CustomDrawButtonDlg.cpp File Reference

#include "Windows.h"
#include <commctrl.h>
#include "shlwapi.h"
#include "resource.h"

Go to the source code of this file.

Functions

LRESULT CALLBACK | DlgProc (HWND, UINT, WPARAM, LPARAM)
int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Function Documentation

LRESULT CALLBACK DlgProc | ( | HWND | hWnd,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 31 of file CustomDrawButtonDlg.cpp.

{
  int wmId, wmEvent;
  static HWND hStatic = NULL;
  static const int nSleepTime = 750;

  switch (message)
  {
  case WM_COMMAND:
    wmId    = LOWORD(wParam);
    wmEvent = HIWORD(wParam);
    // Parse the menu selections:
    switch (wmId)
    {

      case IDCANCEL:
        EndDialog(hWnd, 0);
        break;
      default:
        return 0;
    }
    break;
  case WM_INITDIALOG:
    {
      hStatic = GetDlgItem(hWnd, IDC_STATIC);
    }
    break;
  case WM_NOTIFY:
    {
      NMHDR* nmhdr = (NMHDR*)lParam;

      if (!nmhdr)
        break;

      switch (nmhdr->code)
      {
      case NM_CUSTOMDRAW:
        {
          if (nmhdr->idFrom != ID_CUSTOM_BUTTON)
            break;

          LPNMCUSTOMDRAW lpCD = (LPNMCUSTOMDRAW)lParam;

          TCHAR szOut[150];
          BOOL bStateAdded = FALSE;
          if ((lpCD->uItemState & CDIS_CHECKED) == CDIS_CHECKED)// The item is
                                                                                // is checked.
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_CHECKED"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_CHECKED"));
            }
          }

          if ((lpCD->uItemState & CDIS_DEFAULT) ==  CDIS_DEFAULT)// The item
                                                                                // is in its
                                                                                // default
                                                                                // state.
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_DEFAULT"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_DEFAULT"));
            }
          }

          if ((lpCD->uItemState & CDIS_DISABLED) ==  CDIS_DISABLED) // The item is
                                                                                // disabled.
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_DISABLED"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_DISABLED"));
            }
          }

          if ((lpCD->uItemState & CDIS_FOCUS) ==  CDIS_FOCUS) // The item is in focus.
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_FOCUS"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_FOCUS"));
            }
          }

          if ((lpCD->uItemState & CDIS_GRAYED) ==  CDIS_GRAYED) // The item is grayed.
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_GRAYED"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_GRAYED"));
            }
          }

          if ((lpCD->uItemState & CDIS_HOT) ==  CDIS_HOT) // The item is currently
                                                                                // under the pointer
                                                                                // ("hot").
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_HOT"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_HOT"));
            }
          }

          if ((lpCD->uItemState & CDIS_INDETERMINATE) == CDIS_INDETERMINATE)
                                                                                // The item is in an
                                                                                // indeterminate state.

          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_INDETERMINATE"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_INDETERMINATE"));
            }
          }

          if ((lpCD->uItemState & CDIS_MARKED) ==  CDIS_MARKED) // The item is marked.
                                                                                // The meaning of this
                                                                                // is up to the
                                                                                // implementation.
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_MARKED"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_MARKED"));
            }
          }

          if ((lpCD->uItemState & CDIS_SELECTED) ==  CDIS_SELECTED) // The item is
                                                                                // selected.
          {
            if (bStateAdded)
              StrCat(szOut, TEXT(" | CDIS_SELECTED"));
            else
            {
              bStateAdded = TRUE;
              StrCpy(szOut, TEXT("State = CDIS_SELECTED"));
            }
          }

          if (lpCD->dwDrawStage == CDDS_PREPAINT)
          {
            if (!bStateAdded)
              StrCpy(szOut, TEXT("CDDS_PREPAINT"));
            else
              StrCat(szOut, TEXT(", CDDS_PREPAINT"));
            SetWindowText(hStatic, szOut);
            Sleep(nSleepTime);
            SetWindowLong(hWnd, DWL_MSGRESULT, (LONG)(CDRF_NOTIFYITEMDRAW |                                                                  CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYPOSTERASE));
            return 1;
          }

          if (lpCD->dwDrawStage == CDDS_POSTPAINT )
          {
            if (!bStateAdded)
              StrCpy(szOut, TEXT("CDDS_POSTPAINT"));
            else
              StrCat(szOut, TEXT(", CDDS_POSTPAINT"));
            SetWindowText(hStatic, szOut);
            Sleep(nSleepTime);
          }

          if (lpCD->dwDrawStage == CDDS_PREERASE )
          {
            if (!bStateAdded)
              StrCpy(szOut, TEXT("CDDS_PREERASE"));
            else
              StrCat(szOut, TEXT(", CDDS_PREERASE"));

            SetWindowText(hStatic, szOut);
            Sleep(nSleepTime);
            SetWindowLong(hWnd, DWL_MSGRESULT, (LONG)(CDRF_NOTIFYITEMDRAW |                                                               CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYPOSTERASE));
            return 1;
          }

          if (lpCD->dwDrawStage == CDDS_POSTERASE)
          {
            if (!bStateAdded)
              StrCpy(szOut, TEXT("CDDS_POSTERASE"));
            else
              StrCat(szOut, TEXT(", CDDS_POSTERASE"));

            SetWindowText(hStatic, szOut);
            Sleep(nSleepTime);
          }
        }
      }
      break;
    }
  }
  return 0;
}

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 13 of file CustomDrawButtonDlg.cpp.

{
  InitCommonControls();
  DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG), NULL, (DLGPROC)DlgProc);

  return 0;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/customdrawbuttondlg/CustomDrawButtonDlg.h File Reference

  • WinUI
  • Shell
  • customdrawbuttondlg

CustomDrawButtonDlg.h File Reference

#include "resource.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/customdrawbuttondlg/Resource.h File Reference

  • WinUI
  • Shell
  • customdrawbuttondlg
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | ID_CUSTOM_BUTTON 128
#define | IDC_CHECK1 1002
#define | IDC_CUSTOMDRAWBUTTONDLG 109
#define | IDC_MYICON 2
#define | IDC_STATIC -1
#define | IDD_CUSTOMDRAWBUTTONDLG_DIALOG 102
#define | IDD_DIALOG 129
#define | IDM_ABOUT 104
#define | IDM_EXIT 105
#define | IDOK2 3
#define | IDR_MAINFRAME 128
#define | IDS_APP_TITLE 103

Define Documentation

#define ID_CUSTOM_BUTTON 128

Definition at line 13 of file Resource.h.

#define IDC_CHECK1 1002

Definition at line 15 of file Resource.h.

#define IDC_CUSTOMDRAWBUTTONDLG 109

Definition at line 11 of file Resource.h.

#define IDC_MYICON 2

Definition at line 5 of file Resource.h.

#define IDC_STATIC -1

Definition at line 16 of file Resource.h.

#define IDD_CUSTOMDRAWBUTTONDLG_DIALOG 102

Definition at line 7 of file Resource.h.

#define IDD_DIALOG 129

Definition at line 14 of file Resource.h.

#define IDM_ABOUT 104

Definition at line 9 of file Resource.h.

#define IDM_EXIT 105

Definition at line 10 of file Resource.h.

#define IDOK2 3

Definition at line 6 of file Resource.h.

#define IDR_MAINFRAME 128

Definition at line 12 of file Resource.h.

#define IDS_APP_TITLE 103

Definition at line 8 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/ClassFactory.Cpp File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Functions

ClassFactory.Cpp File Reference

#include "Cleanup.h"
#include "ClassFactory.h"
#include "EmptyVolumeCache.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CClassFactory

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 63 of file ClassFactory.Cpp.

{
    if (--m_nRefCount == 0)
    {
        delete this;
        return 0;
    }
    return m_nRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/ClassFactory.h File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Classes

ClassFactory.h File Reference

Go to the source code of this file.

Classes

class CClassFactory
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/Cleanup.Cpp File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Functions | Variables

Cleanup.Cpp File Reference

#include "Cleanup.h"
#include "ClassFactory.h"

Go to the source code of this file.

Functions

STDAPI | DllCanUnloadNow (VOID)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
BOOL WINAPI | DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)

Variables

CLSID | CLSID_CleanupSample = {0xD0748010, 0x026C, 0x11D3, {0xB1, 0xBD, 0x00, 0x60, 0x08, 0x93, 0xAD, 0x51}}
HINSTANCE | hDllInstance = NULL
ULONG | nDllRefCount = 0

Function Documentation

STDAPI DllCanUnloadNow ( VOID )

Definition at line 51 of file Cleanup.Cpp.

{
    if (nDllRefCount > 0)
        return S_FALSE;
    return S_OK;
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppv
 | ) |  |

Definition at line 59 of file Cleanup.Cpp.

{
    if (ppv == NULL)
        return E_INVALIDARG;

    *ppv = NULL;

    if (!IsEqualIID(rclsid, CLSID_CleanupSample))
        return CLASS_E_CLASSNOTAVAILABLE;

    CClassFactory *pFactory = new CClassFactory;
    if (!pFactory)
        return E_OUTOFMEMORY;

    HRESULT hResult = NOERROR;
    hResult = pFactory->QueryInterface (riid, ppv);

    return hResult;
}

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 26 of file Cleanup.Cpp.

{
    switch (dwReason)
    {
        case DLL_PROCESS_ATTACH:
            hDllInstance = hInstance;
            nDllRefCount = 0;
            break;

        case DLL_THREAD_ATTACH:
            break;

        case DLL_THREAD_DETACH:
            break;

        case DLL_PROCESS_DETACH:
            break;

        default:
            break;
    }
    return TRUE;
}

Variable Documentation

CLSID CLSID_CleanupSample = {0xD0748010, 0x026C, 0x11D3, {0xB1, 0xBD, 0x00, 0x60, 0x08, 0x93, 0xAD, 0x51}}

Definition at line 24 of file Cleanup.Cpp.

HINSTANCE hDllInstance = NULL

Definition at line 20 of file Cleanup.Cpp.

ULONG nDllRefCount = 0

Definition at line 21 of file Cleanup.Cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/Cleanup.h File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Defines | Functions | Variables

Cleanup.h File Reference

#include <windows.h>
#include <olectl.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <emptyvc.h>

Go to the source code of this file.

Defines

#define | ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
#define | MAKEDWORDLONG(high, low) ((DWORDLONG)(((high) << 32) | (low)))
#define | MAX_BUTTONTEXT_LEN 25
#define | MAX_DESCRIPTION_LEN 500
#define | MAX_DISPLAY_LEN 100

Functions

UINT | GetStringByteSize (LPTSTR pszString)
UINT | GetStringByteSizeUnicode (LPCSTR pszString)

Variables

HINSTANCE | hDllInstance
ULONG nDllRefCount

Define Documentation

#define ARRAYSIZE ( x ) (sizeof(x) / sizeof(x[0]))

Definition at line 33 of file Cleanup.h.

#define MAKEDWORDLONG | ( | high,
 |  | low |
 | ) |  | ((DWORDLONG)(((high) << 32) | (low)))

Definition at line 32 of file Cleanup.h.

#define MAX_BUTTONTEXT_LEN 25

Definition at line 30 of file Cleanup.h.

#define MAX_DESCRIPTION_LEN 500

Definition at line 29 of file Cleanup.h.

#define MAX_DISPLAY_LEN 100

Definition at line 28 of file Cleanup.h.

Function Documentation

UINT GetStringByteSize ( LPTSTR pszString ) [inline]

Definition at line 44 of file Cleanup.h.

{return ((lstrlen(pszString) + 1) * sizeof(TCHAR));}

UINT GetStringByteSizeUnicode ( LPCSTR pszString ) [inline]

Definition at line 53 of file Cleanup.h.

{return ((lstrlen(pszString) + 1) * sizeof(WCHAR));}

Variable Documentation

HINSTANCE hDllInstance

Definition at line 37 of file spi.cpp.

ULONG nDllRefCount

Definition at line 21 of file ShortName.Cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/dacl.cpp File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler

dacl.cpp File Reference

#include "Cleanup.h"
#include <sddl.h>
#include <accctrl.h>
#include <aclapi.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/EmptyVolumeCache.Cpp File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Functions

EmptyVolumeCache.Cpp File Reference

#include "Cleanup.h"
#include "EmptyVolumeCache.h"
#include "Resource.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CEmptyVolumeCache

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 64 of file EmptyVolumeCache.Cpp.

{
    if (--m_nRefCount == 0)
    {
        delete this;
        return 0;
    }
    return m_nRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/EmptyVolumeCache.h File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Classes

EmptyVolumeCache.h File Reference

Go to the source code of this file.

Classes

class CEmptyVolumeCache
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/RegisterServer.Cpp File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Functions | Variables

RegisterServer.Cpp File Reference

#include "Cleanup.h"
#include "Resource.h"

Go to the source code of this file.

Functions

PSECURITY_DESCRIPTOR WINAPI | CreateDacl ()
STDAPI | DllRegisterServer (VOID)

Variables

HINSTANCE | hDllInstance

Function Documentation

PSECURITY_DESCRIPTOR WINAPI CreateDacl ( )
STDAPI DllRegisterServer ( VOID )

Definition at line 31 of file RegisterServer.Cpp.

{
    SECURITY_ATTRIBUTES sa = {0};
    SECURITY_ATTRIBUTES *pSA = &sa;
    TCHAR       szModuleName[MAX_PATH];
    HRESULT     hResult = S_OK;
    TCHAR       szBuffer[500] = TEXT("");
    TCHAR       szClsid[MAX_PATH] = TEXT("");
    TCHAR       szSubKey[MAX_PATH] = TEXT("");
    TCHAR       szDisplay[MAX_PATH] = TEXT("");
    TCHAR       szDescription[MAX_PATH] = TEXT("");
    TCHAR       szEmptyVCSubKey[MAX_PATH] = TEXT("");

    //
    //  Load some necessary string values
    //
    LoadString (hDllInstance, IDS_CLSID, szClsid, MAX_PATH);
    LoadString (hDllInstance, IDS_DISPLAY, szDisplay, MAX_PATH);
    LoadString (hDllInstance, IDS_DESCRIPTION, szDescription, MAX_PATH);
    LoadString (hDllInstance, IDS_EMPTYVC_SUBKEY, szEmptyVCSubKey, MAX_PATH);

#if _WIN32_WINNT >= 0x5000
    //
    //  Initialize the security attributes structure
    //
    sa.nLength              = sizeof (SECURITY_ATTRIBUTES);
    sa.lpSecurityDescriptor = CreateDacl ();
    sa.bInheritHandle       = FALSE;
#else
    pSA = NULL;
#endif
    //
    //  Get the name of this module
    //
    GetModuleFileName (hDllInstance, szModuleName, MAX_PATH);

    //
    //  Register the component under HKCR\CLSID
    //
    HKEY    hKey            = NULL;
    DWORD   dwDisposition   = 0;
    LRESULT lResult         = 0;

    wsprintf (szSubKey, TEXT("CLSID\\%s"), szClsid);
    lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
                              0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
                              pSA, &hKey, &dwDisposition);

    if (lResult == NOERROR)
    {
        lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
         (LPBYTE) szDisplay, GetStringByteSize(szDisplay));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;
        RegCloseKey (hKey);
        hKey = NULL;
    }
    else
    {
        hResult = SELFREG_E_CLASS;
    }

    //
    //  Register component information under HKCR\CLSID\{CLSID}
    //
    StrCatBuff (szSubKey, TEXT("\\InprocServer32"), ARRAYSIZE(szSubKey));
    lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
                              0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
                              pSA, &hKey, &dwDisposition);

    if (lResult == NOERROR)
    {
        lstrcpyn (szBuffer, TEXT("Apartment"), ARRAYSIZE(szBuffer));
        lResult = RegSetValueEx (hKey, TEXT("ThreadingModel"), 0, REG_SZ,
         (LPBYTE) szBuffer, GetStringByteSize (szBuffer));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;

        lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
         (LPBYTE) szModuleName, GetStringByteSize(szModuleName));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;

        RegCloseKey (hKey);
        hKey = NULL;
    }
    else
    {
        hResult = SELFREG_E_CLASS;
    }

    wsprintf (szSubKey, TEXT("CLSID\\%s\\DefaultIcon"), szClsid);
    lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
                              0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
                              pSA, &hKey, &dwDisposition);

    if (lResult == NOERROR)
    {
        wsprintf (szBuffer, TEXT("%s,%d"), szModuleName, 0);
        lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
         (LPBYTE) szBuffer, GetStringByteSize(szBuffer));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;

        RegCloseKey (hKey);
        hKey = NULL;
    }
    else
    {
        hResult = SELFREG_E_CLASS;
    }

    //
    //  Register the shell extension under
    //  HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches
    //
    wsprintf (szSubKey, TEXT("%s\\%s"), szEmptyVCSubKey, szDisplay);
    lResult = RegCreateKeyEx (HKEY_LOCAL_MACHINE, szSubKey,
                              0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
                              pSA, &hKey, &dwDisposition);

    if (lResult == NOERROR)
    {
        lResult = RegSetValueEx (hKey, TEXT("Description"), 0, REG_SZ,
         (LPBYTE)szDescription, GetStringByteSize(szDescription));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;

        lResult = RegSetValueEx (hKey, TEXT("Display"), 0, REG_SZ,
         (LPBYTE)szDisplay, GetStringByteSize(szDisplay));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;

        lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
         (LPBYTE)szClsid, GetStringByteSize(szClsid));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;

        RegCloseKey (hKey);
        hKey = NULL;
    }
    else
    {
        hResult = SELFREG_E_CLASS;
    }

    //
    //  Free the security descriptor
    //
    if (sa.lpSecurityDescriptor) {
      LocalFree(sa.lpSecurityDescriptor);
    }

    return hResult;
}

Variable Documentation

HINSTANCE hDllInstance

Definition at line 37 of file spi.cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/Resource.h File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDI_ICON 102
#define | IDI_MSDEV 102
#define | IDS_BUTTONTEXT 5
#define | IDS_CLSID 3
#define | IDS_DESCRIPTION 1
#define | IDS_DISPLAY 2
#define | IDS_EMPTYVC_SUBKEY 4

Define Documentation

#define IDI_ICON 102

Definition at line 11 of file Resource.h.

#define IDI_MSDEV 102

Definition at line 10 of file Resource.h.

#define IDS_BUTTONTEXT 5

Definition at line 9 of file Resource.h.

#define IDS_CLSID 3

Definition at line 7 of file Resource.h.

#define IDS_DESCRIPTION 1

Definition at line 5 of file Resource.h.

#define IDS_DISPLAY 2

Definition at line 6 of file Resource.h.

#define IDS_EMPTYVC_SUBKEY 4

Definition at line 8 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/UnRegisterServer.Cpp File Reference

  • WinUI
  • Shell
  • DiskCleanupHandler
Functions | Variables

UnRegisterServer.Cpp File Reference

#include "Cleanup.h"
#include "Resource.h"

Go to the source code of this file.

Functions

STDAPI | DllUnregisterServer (VOID)

Variables

HINSTANCE | hDllInstance

Function Documentation

STDAPI DllUnregisterServer ( VOID )

Definition at line 21 of file UnRegisterServer.Cpp.

{
    HRESULT     hResult     = S_OK;
    LRESULT     lResult     = NOERROR;
    HKEY        hKey        = NULL;
    TCHAR       szClsid[MAX_PATH] = TEXT("");
    TCHAR       szSubKey[MAX_PATH] = TEXT("");
    TCHAR       szDisplay[MAX_PATH] = TEXT("");
    TCHAR       szEmptyVCSubKey[MAX_PATH] = TEXT("");

    //
    //  Load some necessary string values
    //
    LoadString (hDllInstance, IDS_CLSID, szClsid, MAX_PATH);
    LoadString (hDllInstance, IDS_DISPLAY, szDisplay, MAX_PATH);
    LoadString (hDllInstance, IDS_EMPTYVC_SUBKEY, szEmptyVCSubKey, MAX_PATH);

    //
    //  Delete the key HKCR\CLSID\{CLSID}\InprocServer32
    //  Delete the key HKCR\CLSID\{CLSID}\DefaultIcon
    //
    wsprintf (szSubKey, TEXT("CLSID\\%s"), szClsid);
    lResult = RegOpenKeyEx (HKEY_CLASSES_ROOT, szSubKey, 0, KEY_ALL_ACCESS, &hKey);
    if (lResult == NOERROR)
    {
        lResult = RegDeleteKey (hKey, TEXT("InprocServer32"));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;

        lResult = RegDeleteKey (hKey, TEXT("DefaultIcon"));
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;
        RegCloseKey (hKey);
    }
    else
        hResult = SELFREG_E_CLASS;

    //
    //  Delete the key HKCR\CLSID\{CLSID}
    //
    lResult = RegOpenKeyEx (HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_ALL_ACCESS, &hKey);

    if (lResult == NOERROR)
    {
        lResult = RegDeleteKey (hKey, szClsid);
        if (lResult != NOERROR)
            hResult = SELFREG_E_CLASS;
        RegCloseKey (hKey);
    }
    else
        hResult = SELFREG_E_CLASS;

    //
    //  Delete the key HKLM\Software\Microsoft\Windows\CurrentVersion
    //                   \Explorer\VolumeCaches\CleanupSample
    //
    lResult = RegOpenKeyEx (HKEY_LOCAL_MACHINE, szEmptyVCSubKey, 0, KEY_ALL_ACCESS, &hKey);

    if (lResult == NOERROR)
    {
        lResult = RegDeleteKey (hKey, szDisplay);
        if (lResult != NOERROR) hResult = SELFREG_E_CLASS;

        RegCloseKey (hKey);
    }
    else
        hResult = SELFREG_E_CLASS;

    return hResult;
}

Variable Documentation

HINSTANCE hDllInstance

Definition at line 37 of file spi.cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DataObj.Cpp File Reference

  • WinUI
  • Shell
  • DragImg
Functions | Variables

DataObj.Cpp File Reference

#include "DataObj.h"
#include "EnumFE.h"
#include "Render.h"
#include <shlobj.h>

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CDataObject

Variables

USHORT g_cfFileContents
USHORT g_cfFileGroupDescriptor

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 123 of file DataObj.Cpp.

{
if(--m_cRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_cRefCount;
}

Variable Documentation

USHORT g_cfFileContents

Definition at line 56 of file DragImg.Cpp.

USHORT g_cfFileGroupDescriptor

Definition at line 57 of file DragImg.Cpp.

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DataObj.h File Reference

  • WinUI
  • Shell
  • DragImg
Classes | Defines

DataObj.h File Reference

#include <windows.h>
#include <ole2.h>

Go to the source code of this file.

Classes

class | CDataObject

Defines

#define | MAX_NUM_FORMAT 5

Define Documentation

#define MAX_NUM_FORMAT 5

Definition at line 32 of file DataObj.h.

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DragImg.Cpp File Reference

  • WinUI
  • Shell
  • DragImg
Defines | Functions | Variables

DragImg.Cpp File Reference

#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#include <strsafe.h>
#include "resource.h"
#include "DragSrc.h"
#include "DataObj.h"
#include "DropTgt.h"
#include "Render.h"

Go to the source code of this file.

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#define | FILE_COUNT 10
#define | ID_LISTVIEW 1000

Functions

BOOL CALLBACK | AboutDlgProc (HWND, UINT, WPARAM, LPARAM)
HWND | CreateListView (HINSTANCE, HWND)
void | HandleDragDrop (HWND, BOOL)
LRESULT | HandleNotify (HWND, LPARAM)
BOOL | InitApplication (HINSTANCE)
BOOL | InitInstance (HINSTANCE, int)
BOOL | InitListView (HWND)
BOOL | InsertListViewItems (HWND)
LRESULT CALLBACK | MainWndProc (HWND, UINT, WPARAM, LPARAM)
void | ResizeListView (HWND, HWND)
void | SwitchView (HWND, DWORD)
int CALLBACK | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

USHORT | g_cfFileContents = 0
USHORT | g_cfFileGroupDescriptor = 0
BOOL g_fUseList
HINSTANCE | g_hInst
HWND | g_hwndMain
TCHAR | g_szClassName [] = TEXT("DragImageClass")
TCHAR | g_szTitle [] = TEXT("Drag Image Helper Sample Application")

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 26 of file DragImg.Cpp.

#define FILE_COUNT 10

Definition at line 425 of file DragImg.Cpp.

#define ID_LISTVIEW 1000

Definition at line 61 of file DragImg.Cpp.

Function Documentation

BOOL CALLBACK AboutDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 292 of file DragImg.Cpp.

{
switch(uMsg)
   {
   case WM_COMMAND:
      switch(GET_WM_COMMAND_ID(wParam, lParam))
         {
         case IDOK:
            EndDialog(hDlg, IDOK);
            break;

         case IDCANCEL:
            EndDialog(hDlg, IDCANCEL);
         }
      break;
   }

return FALSE;
}

HWND CreateListView | ( | HINSTANCE | hInstance,
 |  | HWND | hwndParent
 | ) |  |

Definition at line 318 of file DragImg.Cpp.

{
DWORD       dwStyle;
HWND        hwndListView;
BOOL        bSuccess = TRUE;

dwStyle =   WS_TABSTOP |
            WS_CHILD |
            WS_BORDER |
            LVS_AUTOARRANGE |
            LVS_ICON |
            LVS_SHOWSELALWAYS |
            WS_VISIBLE;

hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,
                                 WC_LISTVIEW,
                                 NULL,
                                 dwStyle,
                                 0,
                                 0,
                                 0,
                                 0,
                                 hwndParent,
                                 (HMENU)ID_LISTVIEW,
                                 g_hInst,
                                 NULL);

if(!hwndListView)
   return NULL;

return hwndListView;
}

void HandleDragDrop | ( | HWND | hwndList,
 |  | BOOL | fFromWindow
 | ) |  |

Definition at line 479 of file DragImg.Cpp.

{
DWORD       dwEffect;
HRESULT     hr;
CDragSource *pDropSource;
CDataObject *pDataObject;
int         nItems;

nItems = ListView_GetSelectedCount(hwndList);
if(!nItems)
   return;

pDropSource = new CDragSource;
if(pDropSource)
   {
   pDataObject = new CDataObject;
   if(pDataObject)
      {
      FORMATETC   fe;
      STGMEDIUM   sm;
      int         i,
                  nStart;
      int         *anItems;
      DWORD       dwChars;

      //get the indexes of the selected items
      anItems = new int[nItems];
      for(i = 0, nStart = -1; i < nItems; i++)
         {
         nStart = anItems[i] = ListView_GetNextItem(hwndList, nStart, LVNI_SELECTED);
         }

      //get the length of the text for each selected item
      for(i = 0, dwChars = 0; i < nItems; i++)
         {
         TCHAR szText[MAX_PATH] = TEXT("");

         ListView_GetItemText(hwndList, anItems[i], 0, szText, MAX_PATH);

         dwChars += lstrlen(szText) + 1;
         }

      //add one for the double-NULL terminator
      dwChars += 1;

      LPTSTR pszFiles = new TCHAR[dwChars];
      LPTSTR pszThis;

      //get the text for each selected item
      for(i = 0, pszThis = pszFiles; i < nItems; i++)
         {
         ListView_GetItemText(hwndList, anItems[i], 0, pszThis, dwChars - (DWORD)(pszThis - pszFiles));

         pszThis += lstrlen(pszThis) + 1;
         }

      //double NULL terminate the list
      *pszThis = 0;

      //initialize the data object
      fe.cfFormat = g_cfFileGroupDescriptor;
      fe.ptd = NULL;
      fe.dwAspect = DVASPECT_CONTENT;
      fe.lindex = -1;
      fe.tymed = TYMED_HGLOBAL;

      sm.tymed = TYMED_HGLOBAL;
      sm.pUnkForRelease = NULL;
      sm.hGlobal = CreateFileGroupDescriptor(pszFiles);

      pDataObject->SetData(&fe, &sm, TRUE);

      fe.cfFormat = g_cfFileContents;
      fe.ptd = NULL;
      fe.dwAspect = DVASPECT_CONTENT;
      fe.tymed = TYMED_HGLOBAL;

      sm.tymed = TYMED_HGLOBAL;
      sm.pUnkForRelease = NULL;

      for(i = 0; i < nItems; i++)
         {
         fe.lindex = i;
         sm.hGlobal = CreateFileContents(pszFiles, i);

         pDataObject->SetData(&fe, &sm, TRUE);
         }

      IDragSourceHelper *pDragSourceHelper = NULL;

      CoCreateInstance( CLSID_DragDropHelper,
                        NULL,
                        CLSCTX_INPROC_SERVER,
                        IID_IDragSourceHelper,
                        (LPVOID*)&pDragSourceHelper);

      if(pDragSourceHelper)
         {
         POINT pt;

         pt.x = 0;
         pt.y = 0;

         GetCursorPos(&pt);
         ScreenToClient(hwndList, &pt);

         if(fFromWindow)
            {
            /*
            The pt parameter appears to be ignored, or at least overridden by
            the window.
            */
            pDragSourceHelper->InitializeFromWindow(hwndList, &pt, pDataObject);
            }
         else
            {
            SHDRAGIMAGE di;
            HBITMAP     hbm;
            BITMAP      bm;
            RECT  rc;

            hbm = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_DRAG_IMAGE));

            GetObject(hbm, sizeof(bm), &bm);

            di.sizeDragImage.cx = bm.bmWidth;
            di.sizeDragImage.cy = bm.bmHeight;
            di.hbmpDragImage = hbm;
            di.crColorKey = RGB(0, 0, 0); //transparent color

            //get the offset for the cursor compared to the first selected item
            ListView_GetItemRect(hwndList, anItems[0], &rc, LVIR_SELECTBOUNDS);
            di.ptOffset.x = pt.x - rc.left;
            di.ptOffset.y = pt.y - rc.top;

            pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
            }
         }

      delete anItems;
      delete pszFiles;

      // do the drag and drop
      hr = DoDragDrop(pDataObject, pDropSource, DROPEFFECT_COPY, &dwEffect);

      if(pDragSourceHelper)
         {
         pDragSourceHelper->Release();
         }

      pDataObject->Release();
      }

   pDropSource->Release();
   }
}

LRESULT HandleNotify | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 458 of file DragImg.Cpp.

{
LPNMHDR  lpnmh = (LPNMHDR)lParam;
HWND     hwndList = GetDlgItem(hWnd, ID_LISTVIEW);

switch(lpnmh->code)
   {
   case LVN_BEGINDRAG:
      HandleDragDrop(hwndList, g_fUseList);
      return 0;
   }

return 0;
}

BOOL InitApplication ( HINSTANCE hInstance )

Definition at line 109 of file DragImg.Cpp.

{
WNDCLASS  wc;

wc.style         = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc   = (WNDPROC)MainWndProc;
wc.cbClsExtra    = 0;
wc.cbWndExtra    = 0;
wc.hInstance     = hInstance;
wc.hIcon         = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAINICON));
wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MAINMENU);
wc.lpszClassName = g_szClassName;

return(RegisterClass(&wc));
}

BOOL InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 133 of file DragImg.Cpp.

{
HWND hWnd;

//get the ID for the File Group Descriptor clipboard format
g_cfFileGroupDescriptor = (USHORT) RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR);

//get the ID for the File Contents clipboard format
g_cfFileContents = (USHORT) RegisterClipboardFormat(CFSTR_FILECONTENTS);

// Create a main window for this application instance.
hWnd = CreateWindow( g_szClassName,
                     g_szTitle,
                     WS_OVERLAPPEDWINDOW,
                     CW_USEDEFAULT,
                     CW_USEDEFAULT,
                     CW_USEDEFAULT,
                     CW_USEDEFAULT,
                     NULL,
                     NULL,
                     hInstance,
                     NULL);

// If window could not be created, return "failure"
if(!hWnd)
   return FALSE;

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}

BOOL InitListView ( HWND hwndListView )

Definition at line 378 of file DragImg.Cpp.

{
LV_COLUMN   lvColumn;
HIMAGELIST  himlSmall;
HIMAGELIST  himlLarge;

//empty the list
ListView_DeleteAllItems(hwndListView);

//initialize the columns
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 150;
lvColumn.pszText = TEXT("Source File Name");
ListView_InsertColumn(hwndListView, 0, &lvColumn);

//set the image lists
himlSmall = ImageList_Create(16, 16, ILC_COLORDDB | ILC_MASK, 1, 0);
himlLarge = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 1, 0);

if (himlSmall && himlLarge)
   {
   HICON hIcon;

   //set up the small image list
   hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
   ImageList_AddIcon(himlSmall, hIcon);

   //set up the large image list
   hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON));
   ImageList_AddIcon(himlLarge, hIcon);

   ListView_SetImageList(hwndListView, himlSmall, LVSIL_SMALL);
   ListView_SetImageList(hwndListView, himlLarge, LVSIL_NORMAL);
   }

InsertListViewItems(hwndListView);

return TRUE;
}

BOOL InsertListViewItems ( HWND hwndListView )

Definition at line 427 of file DragImg.Cpp.

{
//empty the list
ListView_DeleteAllItems(hwndListView);

UINT     i;
LVITEM   lvItem;

for(i = 0; i < FILE_COUNT; i++)
   {
   TCHAR szName[MAX_PATH];

   StringCchPrintf(szName, ARRAYSIZE(szName), TEXT("File%02d.txt"), i);

   ZeroMemory(&lvItem, sizeof(lvItem));
   lvItem.iItem = i;
   lvItem.mask = LVIF_TEXT | LVIF_IMAGE;
   lvItem.pszText = szName;
   lvItem.iImage = 0;
   ListView_InsertItem(hwndListView, &lvItem);
   }

return TRUE;
}

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 171 of file DragImg.Cpp.

{
static HWND s_hwndList;

switch(uMsg)
   {
   case WM_CREATE:
      {
      g_hwndMain = hWnd;

      CDropTarget *pDropTarget = new CDropTarget;

      if(pDropTarget)
         RegisterDragDrop(hWnd, pDropTarget);

      s_hwndList = CreateListView(g_hInst, hWnd);
      if(s_hwndList)
         InitListView(s_hwndList);

      g_fUseList = TRUE;
      }
      break;

   case WM_DESTROY:
      RevokeDragDrop(hWnd);

      PostQuitMessage(0);
      break;

   case WM_SIZE:
      ResizeListView(s_hwndList, hWnd);
      break;

   case WM_SETFOCUS:
      SetFocus(s_hwndList);
      return 0;

   case WM_INITMENUPOPUP:
      {
      DWORD dwStyle;
      UINT  uID;

      CheckMenuRadioItem((HMENU)wParam, IDM_FROM_WINDOW, IDM_FROM_BITMAP, g_fUseList ? IDM_FROM_WINDOW : IDM_FROM_BITMAP, MF_BYCOMMAND);

      dwStyle = GetWindowLong(s_hwndList, GWL_STYLE);
      switch(dwStyle & LVS_TYPEMASK)
         {
         default:
         case LVS_ICON:
            uID = IDM_LARGEICONS;
            break;

         case LVS_SMALLICON:
            uID = IDM_SMALLICONS;
            break;

         case LVS_LIST:
            uID = IDM_LIST;
            break;

         case LVS_REPORT:
            uID = IDM_REPORT;
            break;
         }
      CheckMenuRadioItem((HMENU)wParam, IDM_LARGEICONS, IDM_REPORT, uID,  MF_BYCOMMAND | MF_CHECKED);
      }
      break;

   case WM_COMMAND:
      switch(GET_WM_COMMAND_ID(wParam, lParam))
         {
         case IDM_FROM_WINDOW:
            g_fUseList = TRUE;
            break;

         case IDM_FROM_BITMAP:
            g_fUseList = FALSE;
            break;

         case IDM_LARGEICONS:
            SwitchView(s_hwndList, LVS_ICON);
            break;

         case IDM_SMALLICONS:
            SwitchView(s_hwndList, LVS_SMALLICON);
            break;

         case IDM_LIST:
            SwitchView(s_hwndList, LVS_LIST);
            break;

         case IDM_REPORT:
            SwitchView(s_hwndList, LVS_REPORT);
            break;

         case IDM_ABOUT:
            DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), hWnd, (DLGPROC)AboutDlgProc);
            break;

         case IDM_EXIT:
            DestroyWindow(hWnd);
            break;
         }
      break;

   case WM_NOTIFY:
      return HandleNotify(hWnd, lParam);

   default:
      break;
  }

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

void ResizeListView | ( | HWND | hwndListView,
 |  | HWND | hwndParent
 | ) |  |

Definition at line 357 of file DragImg.Cpp.

{
RECT  rc;

GetClientRect(hwndParent, &rc);

MoveWindow( hwndListView,
            rc.left,
            rc.top,
            rc.right - rc.left,
            rc.bottom - rc.top,
            TRUE);

}

void SwitchView | ( | HWND | hwndListView,
 |  | DWORD | dwView
 | ) |  |

Definition at line 642 of file DragImg.Cpp.

{
DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);

SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | dwView);
ResizeListView(hwndListView, GetParent(hwndListView));
}

int CALLBACK WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 69 of file DragImg.Cpp.

{
MSG   msg;
INITCOMMONCONTROLSEX icc;

icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
icc.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icc);

g_hInst = hInstance;

if(OleInitialize(NULL) != S_OK)
   return FALSE;

if(!InitApplication(hInstance))
   return FALSE;

if(!InitInstance(hInstance, nCmdShow))
   return FALSE;

while(GetMessage(&msg, NULL,0, 0))
   {
   TranslateMessage(&msg);
   DispatchMessage(&msg);
   }

OleUninitialize();

return (int)msg.wParam;
}

Variable Documentation

USHORT g_cfFileContents = 0

Definition at line 56 of file DragImg.Cpp.

USHORT g_cfFileGroupDescriptor = 0

Definition at line 57 of file DragImg.Cpp.

BOOL g_fUseList

Definition at line 59 of file DragImg.Cpp.

HINSTANCE g_hInst

Definition at line 55 of file DragImg.Cpp.

HWND g_hwndMain

Definition at line 58 of file DragImg.Cpp.

TCHAR g_szClassName[] = TEXT("DragImageClass")

Definition at line 53 of file DragImg.Cpp.

TCHAR g_szTitle[] = TEXT("Drag Image Helper Sample Application")

Definition at line 54 of file DragImg.Cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DragImg.h File Reference

  • WinUI
  • Shell
  • DragImg
Functions

DragImg.h File Reference

Go to the source code of this file.

Functions

LRESULT CALLBACK | About (HWND, UINT, WPARAM, LPARAM)
BOOL | InitApplication (HINSTANCE)
BOOL | InitInstance (HINSTANCE, int)
LRESULT CALLBACK | WndProc (HWND, UINT, WPARAM, LPARAM)

Function Documentation

LRESULT CALLBACK About | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 445 of file Generic.C.

{
   static  HFONT hfontDlg;    // Font for dialog text
   static   HFONT hFinePrint; // Font for 'fine print' in dialog
   DWORD   dwVerInfoSize;     // Size of version information block
   LPSTR   lpVersion;         // String pointer to 'version' text
   DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
   UINT    uVersionLen;
   WORD    wRootLen;
   BOOL    bRetCode;
   int     i;
   char    szFullPath[BUFFSIZE];
   char    szResult[BUFFSIZE];
   char    szGetName[BUFFSIZE];
   DWORD dwVersion;
   char  szVersion[40];
   DWORD dwResult;
   HRESULT hRes;

   switch (message) {
        case WM_INITDIALOG:
         ShowWindow (hDlg, SW_HIDE);

         if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                  VARIABLE_PITCH | FF_DONTCARE, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
                                    VARIABLE_PITCH | FF_DONTCARE, "");
         }
         else
         {
            hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                  VARIABLE_PITCH | FF_SWISS, "");
            hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                                    VARIABLE_PITCH | FF_SWISS, "");
         }

         CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
         GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));

         // Now lets dive in and pull out the version information:
         dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
         if (dwVerInfoSize) {
            LPSTR   lpstrVffInfo;
            HANDLE  hMem;
            hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
            lpstrVffInfo  = GlobalLock(hMem);
            GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
            // The below 'hex' value looks a little confusing, but
            // essentially what it is, is the hexidecimal representation
            // of a couple different values that represent the language
            // and character set that we are wanting string values for.
            // 040904E4 is a very common one, because it means:
            //   US English, Windows MultiLingual characterset
            // Or to pull it all apart:
            // 04------        = SUBLANG_ENGLISH_USA
            // --09----        = LANG_ENGLISH
            // --11----        = LANG_JAPANESE
            // ----04E4 = 1252 = Codepage for Windows:Multilingual

            // Use safe string handling
            szGetName[sizeof(szGetName) - 1] = '\0';
            lstrcpyn(szGetName, GetStringRes(IDS_VER_INFO_LANG), sizeof(szGetName) - 1);
            if (szGetName[sizeof(szGetName) - 1] != '\0') {
                return FALSE; // Buffer overflow error
            }

            wRootLen = (WORD) lstrlen(szGetName); // Save this position

            // Set the title of the dialog using safe string handling
            hRes = StringCchCatN(szGetName, sizeof(szGetName), "ProductName", sizeof("ProductName"));
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }

            bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
               (LPSTR)szGetName,
               (LPVOID)&lpVersion,
               (UINT *)&uVersionLen);

            // Notice order of version and string...
            if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), " ‚Ìƒo[ƒWƒ‡ƒ“î•ñ", sizeof(" ‚Ìƒo[ƒWƒ‡ƒ“î•ñ"));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }
            else
            {
                // Use safe string handling
                hRes = StringCchCopyN(szResult, sizeof(szResult), "About ", sizeof("About "));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
                hRes = StringCchCatN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                if (FAILED(hRes)) {
                    return FALSE; // Buffer overflow error
                }
            }

            // -----------------------------------------------------

            SetWindowText (hDlg, szResult);

            // Walk through the dialog items that we want to replace:
            for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++) {
               GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
               szGetName[wRootLen] = (char)0;
               // Use safe sting handling
               hRes = StringCchCatN(szGetName, sizeof(szGetName), szResult, sizeof(szResult));
               if (FAILED(hRes)) {
                   return FALSE; // Buffer overflow error
               }
               uVersionLen   = 0;
               lpVersion     = NULL;
               bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
                  (LPSTR)szGetName,
                  (LPVOID)&lpVersion,
                  (UINT *)&uVersionLen);

               if ( bRetCode && uVersionLen && lpVersion) {
                   // Replace dialog item text with version info
                   // Use safe string handling
                   hRes = StringCchCopyN(szResult, sizeof(szResult), lpVersion, lstrlen(lpVersion));
                   if (FAILED(hRes)) {
                       return FALSE; // Buffer overflow error
                   }
                   SetDlgItemText(hDlg, i, szResult);
               }
               else
               {
                  dwResult = GetLastError();

                  // Use safe string handling
                  hRes = StringCchPrintf(szResult, sizeof(szResult), GetStringRes(IDS_VERSION_ERROR), dwResult);
                  if (FAILED(hRes)) {
                      return FALSE; // Buffer overflow error
                  }

                  SetDlgItemText (hDlg, i, szResult);
               }
               SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
                  (ULONG_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
                  TRUE);
            } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)

            GlobalUnlock(hMem);
            GlobalFree(hMem);

         } else {
            // No version information available.
         } // if (dwVerInfoSize)

            SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
            (WPARAM)hfontDlg,(LPARAM)TRUE);

         // We are  using GetVersion rather then GetVersionEx
         // because earlier versions of Windows NT and Win32s
         // didn't include GetVersionEx:
         dwVersion = GetVersion();

         if (dwVersion < 0x80000000) {
            // Windows NT
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows NT %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion)) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else if (LOBYTE(LOWORD(dwVersion))<4) {
            // Win32s
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Win32s %u.%u (Build: %u)",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))),
                (DWORD)(HIWORD(dwVersion) & ~0x8000) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         } else {
            // Windows 95
            // Use safe sting handling
            hRes = StringCchPrintf(szVersion, sizeof(szVersion), "Microsoft Windows 95 %u.%u",
                (DWORD)(LOBYTE(LOWORD(dwVersion))),
                (DWORD)(HIBYTE(LOWORD(dwVersion))) );
            if (FAILED(hRes)) {
                return FALSE; // Buffer overflow error
            }
         }

          SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
         ShowWindow (hDlg, SW_SHOW);
         return (TRUE);

      case WM_COMMAND:
         if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
            EndDialog(hDlg, TRUE);
            DeleteObject (hfontDlg);
            DeleteObject (hFinePrint);
            return (TRUE);
         }
         break;
   }

    return FALSE;
}

BOOL InitApplication ( HINSTANCE )

Definition at line 186 of file Generic.C.

{
    WNDCLASS  wc;
    HWND      hwnd;

    // Win32 will always set hPrevInstance to NULL, so lets check
    // things a little closer. This is because we only want a single
    // version of this app to run at a time
    hwnd = FindWindow (szAppName, szTitle);
    if (hwnd)
    {
        // We found another version of ourself. Lets defer to it:
        if (IsIconic(hwnd))
        {
            ShowWindow(hwnd, SW_RESTORE);
        }
        SetForegroundWindow (hwnd);

        // If this app actually had any functionality, we would
        // also want to communicate any action that our 'twin'
        // should now perform based on how the user tried to
        // execute us.
        return FALSE;
    }

    // Fill in window class structure with parameters that describe
    // the main window.
    wc.style         = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc   = (WNDPROC)WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon (hInstance, szAppName);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);

    // Since Windows95 has a slightly different recommended
    // format for the 'Help' menu, lets put this in the alternate menu like this:
    if (IS_WIN95)
    {
        wc.lpszMenuName  = "WIN95";
    }
    else
    {
        wc.lpszMenuName  = szAppName;
    }
    wc.lpszClassName = szAppName;

    // Register the window class and return success/failure code.
    if (IS_WIN95)
    {
        return MyRegisterClass(&wc);
    }
    else
    {
        return RegisterClass(&wc);
    }
}

BOOL InitInstance | ( | HINSTANCE | ,
 |  | int |
 | ) |  |

Definition at line 255 of file Generic.C.

{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

   hWnd = CreateWindow(szAppName, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
      NULL, NULL, hInstance, NULL);

   if (!hWnd) {
      return (FALSE);
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return (TRUE);
}

LRESULT CALLBACK WndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 290 of file Generic.C.

{
   int wmId, wmEvent;
   PAINTSTRUCT ps;
   HDC hdc;
      POINT pnt;
   HMENU hMenu;
      BOOL bGotHelp;

   switch (message) {

      case WM_COMMAND:
         wmId    = LOWORD(wParam); // Remember, these are...
         wmEvent = HIWORD(wParam); // ...different for Win32!

         //Parse the menu selections:
         switch (wmId) {

            case IDM_ABOUT:
               DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)About);
               break;

            case IDM_EXIT:
               DestroyWindow (hWnd);
               break;

            case IDM_HELPTOPICS: // Only called in Windows 95
               bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_FINDER,(DWORD)0);
               if (!bGotHelp)
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPCONTENTS: // Not called in Windows 95
               bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_CONTENTS,(DWORD)0);
               if (!bGotHelp)
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPSEARCH: // Not called in Windows 95
               if (!WinHelp(hWnd, APPNAME".HLP", HELP_PARTIALKEY,
                           (ULONG_PTR)(LPSTR)""))
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            case IDM_HELPHELP: // Not called in Windows 95
               if(!WinHelp(hWnd, (LPSTR)NULL, HELP_HELPONHELP, 0))
               {
                  MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
                              szAppName, MB_OK|MB_ICONHAND);
               }
               break;

            // Here are all the other possible menu options,
            // all of these are currently disabled:
            case IDM_NEW:
            case IDM_OPEN:
            case IDM_SAVE:
            case IDM_SAVEAS:
            case IDM_UNDO:
            case IDM_CUT:
            case IDM_COPY:
            case IDM_PASTE:
            case IDM_LINK:
            case IDM_LINKS:

            default:
               return (DefWindowProc(hWnd, message, wParam, lParam));
         }
         break;

      case WM_NCRBUTTONUP: // RightClick on windows non-client area...
         if (IS_WIN95 && SendMessage(hWnd, WM_NCHITTEST, 0, lParam) == HTSYSMENU)
         {
            // The user has clicked the right button on the applications
            // 'System Menu'. Here is where you would alter the default
            // system menu to reflect your application. Notice how the
            // explorer deals with this. For this app, we aren't doing
            // anything
            return (DefWindowProc(hWnd, message, wParam, lParam));
         } else {
            // Nothing we are interested in, allow default handling...
            return (DefWindowProc(hWnd, message, wParam, lParam));
         }
            break;

        case WM_RBUTTONDOWN: // RightClick in windows client area...
            pnt.x = LOWORD(lParam);
            pnt.y = HIWORD(lParam);
            ClientToScreen(hWnd, (LPPOINT) &pnt);
      // This is where you would determine the appropriate 'context'
      // menu to bring up. Since this app has no real functionality,
      // we will just bring up the 'Help' menu:
            hMenu = GetSubMenu (GetMenu (hWnd), 2);
            if (hMenu) {
                TrackPopupMenu (hMenu, 0, pnt.x, pnt.y, 0, hWnd, NULL);
            } else {
            // Couldn't find the menu...
                MessageBeep(0);
            }
            break;

      case WM_DISPLAYCHANGE: // Only comes through on plug'n'play systems
      {
         SIZE  szScreen;
         DWORD dwBitsPerPixel = (DWORD)wParam;

         szScreen.cx = LOWORD(lParam);
         szScreen.cy = HIWORD(lParam);

         MessageBox (GetFocus(), GetStringRes(IDS_DISPLAYCHANGED),
                     szAppName, 0);
      }
      break;

      case WM_PAINT:
         hdc = BeginPaint (hWnd, &ps);
         // Add any drawing code here...
         EndPaint (hWnd, &ps);
         break;

      case WM_DESTROY:
         // Tell WinHelp we don't need it any more...
               WinHelp (hWnd, APPNAME".HLP", HELP_QUIT,(DWORD)0);
         PostQuitMessage(0);
         break;

      default:
         return (DefWindowProc(hWnd, message, wParam, lParam));
   }
   return (0);
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Dragsrc.Cpp File Reference

  • WinUI
  • Shell
  • DragImg
Functions

Dragsrc.Cpp File Reference

#include "DragSrc.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CDragSource

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 98 of file Dragsrc.Cpp.

{
if(--m_cRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_cRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Dragsrc.h File Reference

  • WinUI
  • Shell
  • DragImg
Classes

Dragsrc.h File Reference

#include <windows.h>
#include <ole2.h>

Go to the source code of this file.

Classes

class CDragSource
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DropTgt.Cpp File Reference

  • WinUI
  • Shell
  • DragImg
Defines | Functions | Variables

DropTgt.Cpp File Reference

#include "DropTgt.h"

Go to the source code of this file.

Defines

#define | OleStdGetDropEffect(grfKeyState)

Functions

STDMETHODIMP_ (ULONG) CDropTarget

Variables

HWND | g_hwndMain

Define Documentation

#define OleStdGetDropEffect ( grfKeyState )
Value:
( (grfKeyState & MK_CONTROL) ?          \
        ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY ) :  \
        ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_MOVE : 0 ) )

Definition at line 257 of file DropTgt.Cpp.

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 117 of file DropTgt.Cpp.

{
if(--m_cRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_cRefCount;
}

Variable Documentation

HWND g_hwndMain

Definition at line 63 of file ui.cpp.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DropTgt.h File Reference

  • WinUI
  • Shell
  • DragImg
Classes

DropTgt.h File Reference

#include <windows.h>
#include <ole2.h>
#include <shlobj.h>

Go to the source code of this file.

Classes

class CDropTarget
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Enumfe.Cpp File Reference

  • WinUI
  • Shell
  • DragImg
Functions

Enumfe.Cpp File Reference

#include <windows.h>
#include <shlobj.h>
#include "EnumFE.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CEnumFormatEtc

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 116 of file Enumfe.Cpp.

{
if(--m_cRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_cRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Enumfe.h File Reference

  • WinUI
  • Shell
  • DragImg
Classes

Enumfe.h File Reference

#include <windows.h>
#include <ole2.h>

Go to the source code of this file.

Classes

class CEnumFormatEtc
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Render.Cpp File Reference

  • WinUI
  • Shell
  • DragImg
Defines | Functions

Render.Cpp File Reference

#include <windows.h>
#include <shlobj.h>
#include <strsafe.h>
#include "Render.h"

Go to the source code of this file.

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))

Functions

HGLOBAL | CreateFileContents (LPCTSTR pszFiles, int nItem)
HGLOBAL | CreateFileGroupDescriptor (LPCTSTR pszFiles)
LPTSTR | GetNextName (LPCTSTR)

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 25 of file Render.Cpp.

Function Documentation

HGLOBAL CreateFileContents | ( | LPCTSTR | pszFiles,
 |  | int | nItem
 | ) |  |

Definition at line 82 of file Render.Cpp.

{
HGLOBAL  hg = NULL;
TCHAR    szText[MAX_PATH];
LPTSTR   pszNext;
int      i, cch;

for(i = 0, pszNext = (LPTSTR)pszFiles; i < nItem; pszNext = GetNextName(pszNext), i++)
   {
   }

StringCchPrintf(szText, ARRAYSIZE(szText), TEXT("This file is %s created from CFSTR_FILECONTENTS"), pszNext);
cch = lstrlen(szText) + 1;
hg = GlobalAlloc(GMEM_FIXED, cch * sizeof(TCHAR));

if(hg)
   {
   LPTSTR psz = (LPSTR)GlobalLock(hg);

   if(psz)
      {
      StringCchCopy(psz, cch, szText);

      GlobalUnlock(hg);
      }
   }

return hg;
}

HGLOBAL CreateFileGroupDescriptor ( LPCTSTR pszFiles )

Definition at line 40 of file Render.Cpp.

{
HGLOBAL              hg;
FILEGROUPDESCRIPTOR  *pfgd;
LPTSTR               pszNext;
DWORD                dwItems;

//get the number of items
for(dwItems = 0, pszNext = (LPTSTR)pszFiles; pszNext; pszNext = GetNextName(pszNext))
   {
   dwItems++;
   }

hg = GlobalAlloc(GMEM_FIXED, sizeof(FILEGROUPDESCRIPTOR) + (dwItems - 1) * sizeof(FILEDESCRIPTOR));
if(hg)
   {
   pfgd = (FILEGROUPDESCRIPTOR*)GlobalLock(hg);
   if(pfgd)
      {
      int   i;

      pfgd->cItems = dwItems;

      for(i = 0, pszNext = (LPTSTR)pszFiles; pszNext; pszNext = GetNextName(pszNext), i++)
         {
             pfgd->fgd[i].dwFlags = FD_ATTRIBUTES;
             pfgd->fgd[i].dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
             lstrcpyn(pfgd->fgd[i].cFileName, pszNext, ARRAYSIZE(pfgd->fgd[i].cFileName));
         }

      GlobalUnlock(hg);
      }
   }
return hg;
}

LPTSTR GetNextName ( LPCTSTR pszFiles )

Definition at line 118 of file Render.Cpp.

{
LPTSTR   pszTemp = (LPTSTR)pszFiles;
while(*pszTemp)
   {
   pszTemp++;
   }

pszTemp++;

return *pszTemp ? pszTemp : NULL;
}

Generated on Wed Nov 13 2024 16:54:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Render.h File Reference

  • WinUI
  • Shell
  • DragImg
Functions

Render.h File Reference

Go to the source code of this file.

Functions

HGLOBAL | CreateFileContents (LPCTSTR, int)
HGLOBAL | CreateFileGroupDescriptor (LPCTSTR)

Function Documentation

HGLOBAL CreateFileContents | ( | LPCTSTR | ,
 |  | int |
 | ) |  |

Definition at line 82 of file Render.Cpp.

{
HGLOBAL  hg = NULL;
TCHAR    szText[MAX_PATH];
LPTSTR   pszNext;
int      i, cch;

for(i = 0, pszNext = (LPTSTR)pszFiles; i < nItem; pszNext = GetNextName(pszNext), i++)
   {
   }

StringCchPrintf(szText, ARRAYSIZE(szText), TEXT("This file is %s created from CFSTR_FILECONTENTS"), pszNext);
cch = lstrlen(szText) + 1;
hg = GlobalAlloc(GMEM_FIXED, cch * sizeof(TCHAR));

if(hg)
   {
   LPTSTR psz = (LPSTR)GlobalLock(hg);

   if(psz)
      {
      StringCchCopy(psz, cch, szText);

      GlobalUnlock(hg);
      }
   }

return hg;
}

HGLOBAL CreateFileGroupDescriptor ( LPCTSTR )

Definition at line 40 of file Render.Cpp.

{
HGLOBAL              hg;
FILEGROUPDESCRIPTOR  *pfgd;
LPTSTR               pszNext;
DWORD                dwItems;

//get the number of items
for(dwItems = 0, pszNext = (LPTSTR)pszFiles; pszNext; pszNext = GetNextName(pszNext))
   {
   dwItems++;
   }

hg = GlobalAlloc(GMEM_FIXED, sizeof(FILEGROUPDESCRIPTOR) + (dwItems - 1) * sizeof(FILEDESCRIPTOR));
if(hg)
   {
   pfgd = (FILEGROUPDESCRIPTOR*)GlobalLock(hg);
   if(pfgd)
      {
      int   i;

      pfgd->cItems = dwItems;

      for(i = 0, pszNext = (LPTSTR)pszFiles; pszNext; pszNext = GetNextName(pszNext), i++)
         {
             pfgd->fgd[i].dwFlags = FD_ATTRIBUTES;
             pfgd->fgd[i].dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
             lstrcpyn(pfgd->fgd[i].cFileName, pszNext, ARRAYSIZE(pfgd->fgd[i].cFileName));
         }

      GlobalUnlock(hg);
      }
   }
return hg;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Resource.h File Reference

  • WinUI
  • Shell
  • DragImg
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDB_DRAG_IMAGE 106
#define | IDD_ABOUT 103
#define | IDI_MAINICON 102
#define | IDM_ABOUT 2001
#define | IDM_EXIT 2000
#define | IDM_FROM_BITMAP 2003
#define | IDM_FROM_WINDOW 2002
#define | IDM_LARGEICONS 2004
#define | IDM_LIST 2006
#define | IDM_REPORT 2007
#define | IDM_SMALLICONS 2005
#define | IDR_MAINMENU 101

Define Documentation

#define IDB_DRAG_IMAGE 106

Definition at line 8 of file Resource.h.

#define IDD_ABOUT 103

Definition at line 7 of file Resource.h.

#define IDI_MAINICON 102

Definition at line 6 of file Resource.h.

#define IDM_ABOUT 2001

Definition at line 10 of file Resource.h.

#define IDM_EXIT 2000

Definition at line 9 of file Resource.h.

#define IDM_FROM_BITMAP 2003

Definition at line 12 of file Resource.h.

#define IDM_FROM_WINDOW 2002

Definition at line 11 of file Resource.h.

#define IDM_LARGEICONS 2004

Definition at line 13 of file Resource.h.

#define IDM_LIST 2006

Definition at line 15 of file Resource.h.

#define IDM_REPORT 2007

Definition at line 16 of file Resource.h.

#define IDM_SMALLICONS 2005

Definition at line 14 of file Resource.h.

#define IDR_MAINMENU 101

Definition at line 5 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/DefClsF.C File Reference

  • WinUI
  • Shell
  • DropExt
Classes | Functions | Variables

DefClsF.C File Reference

#include "priv.h"

Go to the source code of this file.

Classes

struct | CDefClassFactory

Functions

ULONG STDMETHODCALLTYPE | CDefClassFactory_AddRef (IClassFactory FAR *pcf)
CDefClassFactory *NEAR PASCAL | CDefClassFactory_Create (LPFNCREATEINSTANCE lpfnCI, UINT FAR *pcRefDll, REFIID riidInst)
STDMETHODIMP | CDefClassFactory_CreateInstance (IClassFactory FAR *pcf, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR *ppvObject)
STDMETHODIMP | CDefClassFactory_LockServer (IClassFactory FAR *pcf, BOOL fLock)
STDMETHODIMP | CDefClassFactory_QueryInterface (IClassFactory FAR *pcf, REFIID riid, LPVOID FAR *ppvObj)
ULONG STDMETHODCALLTYPE | CDefClassFactory_Release (IClassFactory FAR *pcf)
STDAPI | SHCreateDefClassObject (REFIID riid, LPVOID FAR *ppv, LPFNCREATEINSTANCE lpfnCI, UINT FAR *pcRefDll, REFIID riidInst)
STDAPI | Shell_CreateDefClassObject (REFIID riid, LPVOID FAR *ppv, LPFNCREATEINSTANCE lpfnCI, UINT FAR *pcRefDll, REFIID riidInst)

Variables

IClassFactoryVtbl | c_vtblAppUIClassFactory

Function Documentation

ULONG STDMETHODCALLTYPE CDefClassFactory_AddRef ( IClassFactory FAR * pcf )

Definition at line 74 of file DefClsF.C.

{
    CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);
    return (++this->cRef);
}

CDefClassFactory* NEAR PASCAL CDefClassFactory_Create | ( | LPFNCREATEINSTANCE | lpfnCI,
 |  | UINT FAR * | pcRefDll,
 |  | REFIID | riidInst
 | ) |  |

Definition at line 139 of file DefClsF.C.

{
    register CDefClassFactory * pacf;
    pacf = (CDefClassFactory *)LocalAlloc(LPTR, sizeof(CDefClassFactory));
    if (pacf)
    {
  pacf->cf.lpVtbl = &c_vtblAppUIClassFactory;
  pacf->cRef++;  // pacf->cRef=0; (generates smaller code)
  pacf->pcRefDll = pcRefDll;
  pacf->lpfnCI = lpfnCI;
  pacf->riidInst = riidInst;
  if (pcRefDll) {
      (*pcRefDll)++;
  }
    }
    return pacf;
}

STDMETHODIMP CDefClassFactory_CreateInstance | ( | IClassFactory FAR * | pcf,
 |  | LPUNKNOWN | pUnkOuter,
 |  | REFIID | riid,
 |  | LPVOID FAR * | ppvObject
 | ) |  |

Definition at line 100 of file DefClsF.C.

{
    CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);

    //
    // We don't support aggregation at all.
    //
    if (pUnkOuter)
    {
  return ResultFromScode(CLASS_E_NOAGGREGATION);
    }

    //
    // if this->riidInst is specified, they should match.
    //
    if (this->riidInst==NULL
     || IsEqualIID(riid, this->riidInst)
     || IsEqualIID(riid, &IID_IUnknown))
    {
  return this->lpfnCI(pUnkOuter, riid, ppvObject);
    }

    return ResultFromScode(E_NOINTERFACE);
}

STDMETHODIMP CDefClassFactory_LockServer | ( | IClassFactory FAR * | pcf,
 |  | BOOL | fLock
 | ) |  |

Definition at line 130 of file DefClsF.C.

{
    return ResultFromScode(E_NOTIMPL);
}

STDMETHODIMP CDefClassFactory_QueryInterface | ( | IClassFactory FAR * | pcf,
 |  | REFIID | riid,
 |  | LPVOID FAR * | ppvObj
 | ) |  |

Definition at line 58 of file DefClsF.C.

{
    CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);
    if (IsEqualIID(riid, &IID_IClassFactory)
     || IsEqualIID(riid, &IID_IUnknown))
    {
  (LPCLASSFACTORY)*ppvObj = &this->cf;
  this->cRef++;
        return NOERROR;
    }
    return ResultFromScode(E_NOINTERFACE);
}

ULONG STDMETHODCALLTYPE CDefClassFactory_Release ( IClassFactory FAR * pcf )

Definition at line 83 of file DefClsF.C.

{
    CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);
    if (--this->cRef > 0)
  return this->cRef;

    if (this->pcRefDll) {
  (*this->pcRefDll)--;
    }
    LocalFree((HLOCAL)this);

    return 0;
}

STDAPI SHCreateDefClassObject | ( | REFIID | riid,
 |  | LPVOID FAR * | ppv,
 |  | LPFNCREATEINSTANCE | lpfnCI,
 |  | UINT FAR * | pcRefDll,
 |  | REFIID | riidInst
 | ) |  |

Definition at line 183 of file DefClsF.C.

{
    // The default class factory supports only IClassFactory interface
    if (IsEqualIID(riid, &IID_IClassFactory))
    {
  CDefClassFactory * pacf = CDefClassFactory_Create(lpfnCI, pcRefDll, riidInst);
  if (pacf)
  {
      (IClassFactory FAR *)*ppv = &pacf->cf;
      return NOERROR;
  }
  return ResultFromScode(E_OUTOFMEMORY);
    }
    return ResultFromScode(E_NOINTERFACE);
}

STDAPI Shell_CreateDefClassObject | ( | REFIID | riid,
 |  | LPVOID FAR * | ppv,
 |  | LPFNCREATEINSTANCE | lpfnCI,
 |  | UINT FAR * | pcRefDll,
 |  | REFIID | riidInst
 | ) |  |

Definition at line 159 of file DefClsF.C.

{
    MessageBeep(0);
    // DebugMsg(DM_TRACE, "Shell_CreateDefClassObject: obsolete, use SHCreateDefClassObject");
    return SHCreateDefClassObject(riid, ppv, lpfnCI, pcRefDll, riidInst);
}

Variable Documentation

IClassFactoryVtbl c_vtblAppUIClassFactory
Initial value:
 {
            CDefClassFactory_QueryInterface,
            CDefClassFactory_AddRef,
            CDefClassFactory_Release,
            CDefClassFactory_CreateInstance,
      CDefClassFactory_LockServer
}

Definition at line 35 of file DefClsF.C.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/DropExt.C File Reference

  • WinUI
  • Shell
  • DropExt
Classes | Defines | Typedefs | Functions | Variables

DropExt.C File Reference

#include "priv.h"
#include <initguid.h>
#include <strsafe.h>
#include "dropext.h"

Go to the source code of this file.

Classes

struct | _CSampleDropExt

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#define | INITGUID
#define | PCTM2PSMX(pctm) PVOID2PSMX(pctm, SMX_OFFSETOF(_ctm))
#define | PSXI2PSMX(psxi) PVOID2PSMX(psxi, SMX_OFFSETOF(_sxi))
#define | PVOID2PSMX(pv, offset) ((PSAMPLEDROPEXT)(((LPBYTE)pv)-offset))
#define | SMX_OFFSETOF(x) ((UINT_PTR)(&((PSAMPLEDROPEXT)0)->x))

Typedefs

typedef struct _CSampleDropExt | CSampleDropExt
typedef struct _CSampleDropExt * | PSAMPLEDROPEXT

Functions

LPCSTR | _Offset2Ptr (LPSTR pszBase, UINT_PTR offset, UINT *pcb)
STDAPI | DllCanUnloadNow (void)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID FAR *ppvOut)
HRESULT | DropExt_CheckForHDROP (PSAMPLEDROPEXT this, HWND hwnd)
HRESULT | DropExt_CheckForHNRES (PSAMPLEDROPEXT this, HWND hwnd)
HRESULT CALLBACK | DropExt_CreateInstance (LPUNKNOWN, REFIID, LPVOID FAR *)
STDMETHODIMP | DropExt_CTM_QueryInterface (LPCONTEXTMENU pctm, REFIID riid, LPVOID FAR *ppvOut)
STDMETHODIMP | DropExt_GetCommandString (LPCONTEXTMENU pctm, UINT_PTR idCmd, UINT wReserved, UINT FAR *pwReserved, LPSTR pszName, UINT cchMax)
UINT | DropExt_GetNetResource (HGLOBAL hnres, UINT iItem, LPNETRESOURCE pnresOut, UINT cbMax)
STDMETHODIMP | DropExt_Initialize (LPSHELLEXTINIT psxi, LPCITEMIDLIST pidlFolder, LPDATAOBJECT pdtobj, HKEY hkeyProgID)
STDMETHODIMP | DropExt_InvokeCommand (LPCONTEXTMENU pctm, LPCMINVOKECOMMANDINFO lpici)
STDMETHODIMP | DropExt_QueryContextMenu (LPCONTEXTMENU pctm, HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
STDMETHODIMP | DropExt_SXI_QueryInterface (LPSHELLEXTINIT psxi, REFIID riid, LPVOID FAR *ppv)
BOOL APIENTRY | LibMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
STDMETHODIMP_ (ULONG)

Variables

IContextMenuVtbl | c_SampleDropExt_CTMVtbl
IShellExtInitVtbl | c_SampleDropExt_SXIVtbl
UINT | g_cfNetResource = 0
UINT | g_cRefThisDll = 0

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 31 of file DropExt.C.

#define INITGUID

Definition at line 28 of file DropExt.C.

#define PCTM2PSMX ( pctm ) PVOID2PSMX(pctm, SMX_OFFSETOF(_ctm))

Definition at line 145 of file DropExt.C.

#define PSXI2PSMX ( psxi ) PVOID2PSMX(psxi, SMX_OFFSETOF(_sxi))

Definition at line 146 of file DropExt.C.

#define PVOID2PSMX | ( | pv,
 |  | offset |
 | ) |  | ((PSAMPLEDROPEXT)(((LPBYTE)pv)-offset))

Definition at line 144 of file DropExt.C.

#define SMX_OFFSETOF ( x ) ((UINT_PTR)(&((PSAMPLEDROPEXT)0)->x))

Definition at line 143 of file DropExt.C.

Typedef Documentation

typedef struct _CSampleDropExt CSampleDropExt
typedef struct _CSampleDropExt * PSAMPLEDROPEXT

Function Documentation

LPCSTR _Offset2Ptr | ( | LPSTR | pszBase,
 |  | UINT_PTR | offset,
 |  | UINT * | pcb
 | ) |  |

Definition at line 260 of file DropExt.C.

{
    LPSTR pszRet;
    if (offset==0) {
  pszRet = NULL;
  *pcb = 0;
    } else {
  pszRet = pszBase + offset;
  *pcb = lstrlen(pszRet) + 1;
    }
    return pszRet;
}

STDAPI DllCanUnloadNow ( void )

Definition at line 72 of file DropExt.C.

{
    return ResultFromScode((g_cRefThisDll==0) ? S_OK : S_FALSE);
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID FAR * | ppvOut
 | ) |  |

Definition at line 87 of file DropExt.C.

{
    //
    //  This DLL has only one class (CLSID_SampleDropExt). If a DLL supports
    // multiple classes, it should have either multiple if-statements or
    // efficient table lookup code.
    //
    if (IsEqualIID(rclsid, &CLSID_SampleDropExt))
    {
  //
  //  We are supposed return the class object for this class. Instead
  // of fully implementing it in this DLL, we just call a helper
  // function in the shell DLL which creates a default class factory
  // object for us. When its CreateInstance member is called, it
  // will call back our create instance function (DropExt_CreateInstance).
  //
  return SHCreateDefClassObject(
        riid,       //
        ppvOut,       //
        DropExt_CreateInstance, // callback function
        &g_cRefThisDll,     // reference count of this DLL
        &IID_IShellExtInit      // init interface
        );
    }

    return ResultFromScode(E_FAIL);
}

HRESULT DropExt_CheckForHDROP | ( | PSAMPLEDROPEXT | this,
 |  | HWND | hwnd
 | ) |  |

Definition at line 312 of file DropExt.C.

{
    FORMATETC fmte = {
          CF_HDROP,
          (DVTARGETDEVICE FAR *)NULL,
          DVASPECT_CONTENT,
          -1,
          TYMED_HGLOBAL };
    STGMEDIUM medium;
    HRESULT hres = this->_pdtobj->lpVtbl->GetData(this->_pdtobj, &fmte, &medium);

    if (SUCCEEDED(hres))
    {
  HDROP hdrop = medium.hGlobal;
  UINT cFiles = DragQueryFile(hdrop, (UINT)-1, NULL, 0);
  char szFile[MAX_PATH];
  char szBuf[MAX_PATH*2+64];

  DragQueryFile(hdrop, 0, szFile, sizeof(szFile));
  StringCchPrintf(szBuf, ARRAYSIZE(szBuf),
     "The drop target is %s.\n"
     "%d files/directories in HDROP\n"
     "The path to the first object is\n"
       "\t%s.",
     this->_szTargetFolder,
     cFiles,
     szFile);

  MessageBox(hwnd, szBuf, "DropExt", MB_OK);

  ReleaseStgMedium(&medium);

    }
    else
    {
  MessageBox(hwnd, "No file system object in the selection", "DropExt", MB_OK);
    }

    return hres;
}

HRESULT DropExt_CheckForHNRES | ( | PSAMPLEDROPEXT | this,
 |  | HWND | hwnd
 | ) |  |

Definition at line 353 of file DropExt.C.

{
    FORMATETC fmte = {
          (CLIPFORMAT)(g_cfNetResource ? g_cfNetResource
        : (g_cfNetResource= RegisterClipboardFormat("Net Resource"))),
          (DVTARGETDEVICE FAR *)NULL,
          DVASPECT_CONTENT,
          -1,
          TYMED_HGLOBAL };
    STGMEDIUM medium;
    HRESULT hres = this->_pdtobj->lpVtbl->GetData(this->_pdtobj, &fmte, &medium);
    if (SUCCEEDED(hres))
    {
  HGLOBAL hnres = medium.hGlobal;
  LPNETRESOURCE pnr = (LPNETRESOURCE)LocalAlloc(LPTR, 1024);

  if (pnr)
  {
      char szBuf[512];
      UINT cItems = DropExt_GetNetResource(hnres, (UINT)-1, NULL, 0);

      // Get the NETRESOURCE of the first item
      DropExt_GetNetResource(hnres, 0, pnr, 1024);

      StringCchPrintf(szBuf, ARRAYSIZE(szBuf),
         "%d network resource objects in HNRES\n"
         "The attributes of the first object are\n"
         "\tProvider      = %s\n"
         "\tRemoteName    = %s\n"
         "\tdwDisplayType = %x\n"
         "\tdwType        = %x\n"
         "\tdwUsage       = %x\n",
         cItems,
         pnr->lpProvider,
         pnr->lpRemoteName ? pnr->lpRemoteName : "N/A",
         pnr->dwDisplayType,
         pnr->dwType,
         pnr->dwUsage);

      MessageBox(hwnd, szBuf, "DropExt", MB_OK);

      LocalFree(pnr);
  }
  else
  {
      hres = ResultFromScode(E_OUTOFMEMORY);
  }

  ReleaseStgMedium(&medium);
    }
    else
    {
  MessageBox(hwnd, "No network objects in the selection", "DropExt", MB_OK);
    }
    return hres;
}

HRESULT CALLBACK DropExt_CreateInstance | ( | LPUNKNOWN | punkOuter,
 |  | REFIID | riid,
 |  | LPVOID FAR * | ppvOut
 | ) |  |

Definition at line 163 of file DropExt.C.

{
    HRESULT hres;
    PSAMPLEDROPEXT psmx;

    //
    // Shell extentions typically does not support aggregation.
    //
    if (punkOuter) {
  return ResultFromScode(CLASS_E_NOAGGREGATION);
    }

    //
    // in C++:
    //  psmx = new CSampleDropExt();
    //
    psmx = LocalAlloc(LPTR, sizeof(CSampleDropExt));
    if (!psmx) {
  return ResultFromScode(E_OUTOFMEMORY);
    }
    psmx->_ctm.lpVtbl = &c_SampleDropExt_CTMVtbl;
    psmx->_sxi.lpVtbl = &c_SampleDropExt_SXIVtbl;
    psmx->_cRef = 1;
    psmx->_pdtobj = NULL;
    psmx->_hkeyProgID = NULL;
    g_cRefThisDll++;

    //
    // in C++:
    //  hres = psmx->QueryInterface(riid, ppvOut);
    //  psmx->Release();
    //
    // Note that the Release member will free the object, if QueryInterface
    // failed.
    //
    hres = c_SampleDropExt_CTMVtbl.QueryInterface(&psmx->_ctm, riid, ppvOut);
    c_SampleDropExt_CTMVtbl.Release(&psmx->_ctm);

    return hres;  // S_OK or E_NOINTERFACE
}

STDMETHODIMP DropExt_CTM_QueryInterface | ( | LPCONTEXTMENU | pctm,
 |  | REFIID | riid,
 |  | LPVOID FAR * | ppvOut
 | ) |  |

Definition at line 507 of file DropExt.C.

{
    PSAMPLEDROPEXT this = PCTM2PSMX(pctm);
    if (IsEqualIID(riid, &IID_IContextMenu) || IsEqualIID(riid, &IID_IUnknown))
    {
        (LPCONTEXTMENU)*ppvOut=pctm;
        this->_cRef++;
        return NOERROR;
    }
    if (IsEqualIID(riid, &IID_IShellExtInit))
    {
        (LPSHELLEXTINIT)*ppvOut=&this->_sxi;
        this->_cRef++;
        return NOERROR;
    }
    return ResultFromScode(E_NOINTERFACE);
}

STDMETHODIMP DropExt_GetCommandString | ( | LPCONTEXTMENU | pctm,
 |  | UINT_PTR | idCmd,
 |  | UINT | wReserved,
 |  | UINT FAR * | pwReserved,
 |  | LPSTR | pszName,
 |  | UINT | cchMax
 | ) |  |

Definition at line 436 of file DropExt.C.

{
    return NOERROR;
}

UINT DropExt_GetNetResource | ( | HGLOBAL | hnres,
 |  | UINT | iItem,
 |  | LPNETRESOURCE | pnresOut,
 |  | UINT | cbMax
 | ) |  |

Definition at line 276 of file DropExt.C.

{
    LPNRESARRAY panr = GlobalLock(hnres);
    UINT iRet = 0;  // assume error
    if (hnres)
    {
  if (iItem==(UINT)-1)
  {
      iRet = panr->cItems;
  }
  else if (iItem < panr->cItems)
  {
      UINT cbProvider, cbRemoteName;
      LPCSTR pszProvider = _Offset2Ptr((LPSTR)panr, (UINT_PTR)panr->nr[iItem].lpProvider, &cbProvider);
      LPCSTR pszRemoteName = _Offset2Ptr((LPSTR)panr, (UINT_PTR)panr->nr[iItem].lpRemoteName, &cbRemoteName);
      iRet = sizeof(NETRESOURCE) + cbProvider + cbRemoteName;
      if (iRet <= cbMax)
      {
    LPSTR psz = (LPSTR)(pnresOut+1);
    *pnresOut = panr->nr[iItem];
    if (pnresOut->lpProvider) {
        pnresOut->lpProvider = psz;
        StringCbCopy(psz, cbProvider, pszProvider);
        psz += cbProvider;
    }
    if (pnresOut->lpRemoteName) {
        pnresOut->lpRemoteName = psz;
        StringCbCopy(psz, cbRemoteName, pszRemoteName);
    }
      }
  }
  GlobalUnlock(hnres);
    }
    return iRet;
}

STDMETHODIMP DropExt_Initialize | ( | LPSHELLEXTINIT | psxi,
 |  | LPCITEMIDLIST | pidlFolder,
 |  | LPDATAOBJECT | pdtobj,
 |  | HKEY | hkeyProgID
 | ) |  |

Definition at line 209 of file DropExt.C.

{
    PSAMPLEDROPEXT this = PSXI2PSMX(psxi);

    // Initialize can be called more than once.
    if (this->_pdtobj) {
  this->_pdtobj->lpVtbl->Release(this->_pdtobj);
    }

    if (this->_hkeyProgID) {
  RegCloseKey(this->_hkeyProgID);
    }

    // Duplicate the pdtobj pointer
    if (pdtobj) {
  this->_pdtobj = pdtobj;
  pdtobj->lpVtbl->AddRef(pdtobj);
    }

    // Duplicate the handle
    if (hkeyProgID) {
  RegOpenKeyEx(hkeyProgID, NULL, 0L, MAXIMUM_ALLOWED, &this->_hkeyProgID);
    }

    // Get the path to the drop target folder
    if (pidlFolder) {
  SHGetPathFromIDList(pidlFolder, this->_szTargetFolder);
    }

    return NOERROR;
}

STDMETHODIMP DropExt_InvokeCommand | ( | LPCONTEXTMENU | pctm,
 |  | LPCMINVOKECOMMANDINFO | lpici
 | ) |  |

Definition at line 410 of file DropExt.C.

{
    PSAMPLEDROPEXT this = PCTM2PSMX(pctm);
    HRESULT hres = ResultFromScode(E_INVALIDARG); // assume error
    //
    // No need to support string based command.
    //
    if (!HIWORD(lpici->lpVerb))
    {
  UINT idCmd = LOWORD(lpici->lpVerb);

  switch(idCmd)
  {
  case 0:
      hres = DropExt_CheckForHDROP(this, lpici->hwnd);
      break;

  case 1:
      hres = DropExt_CheckForHNRES(this, lpici->hwnd);
      break;
  }
    }
    return hres;
}

STDMETHODIMP DropExt_QueryContextMenu | ( | LPCONTEXTMENU | pctm,
 |  | HMENU | hmenu,
 |  | UINT | indexMenu,
 |  | UINT | idCmdFirst,
 |  | UINT | idCmdLast,
 |  | UINT | uFlags
 | ) |  |

Definition at line 244 of file DropExt.C.

{
    UINT idCmd = idCmdFirst;
    InsertMenu(hmenu, indexMenu++, MF_STRING|MF_BYPOSITION, idCmd++, "Check H&DROP (dropext)");
    InsertMenu(hmenu, indexMenu++, MF_STRING|MF_BYPOSITION, idCmd++, "Check H&NRES (dropext)");
    return ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_NULL, (USHORT)2));
}

STDMETHODIMP DropExt_SXI_QueryInterface | ( | LPSHELLEXTINIT | psxi,
 |  | REFIID | riid,
 |  | LPVOID FAR * | ppv
 | ) |  |

Definition at line 529 of file DropExt.C.

{
    PSAMPLEDROPEXT this = PSXI2PSMX(psxi);
    return DropExt_CTM_QueryInterface(&this->_ctm, riid, ppv);
}

BOOL APIENTRY LibMain | ( | HANDLE | hDll,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 48 of file DropExt.C.

{
    switch(dwReason)
    {
    case DLL_PROCESS_ATTACH:
      break;
    case DLL_PROCESS_DETACH:
      break;

    case DLL_THREAD_DETACH:
        break;

    case DLL_THREAD_ATTACH:
    default:
      break;
    } // end switch()

    return TRUE;
}

STDMETHODIMP_ ( ULONG )

Definition at line 497 of file DropExt.C.

{
    PSAMPLEDROPEXT this = PSXI2PSMX(psxi);
    return DropExt_CTM_Release(&this->_ctm);
}

Variable Documentation

IContextMenuVtbl c_SampleDropExt_CTMVtbl
Initial value:
 {
    DropExt_CTM_QueryInterface,
    DropExt_CTM_AddRef,
    DropExt_CTM_Release,
    DropExt_QueryContextMenu,
    DropExt_InvokeCommand,
    DropExt_GetCommandString,
}

Definition at line 540 of file DropExt.C.

IShellExtInitVtbl c_SampleDropExt_SXIVtbl
Initial value:
 {
    DropExt_SXI_QueryInterface,
    DropExt_SXI_AddRef,
    DropExt_SXI_Release,
    DropExt_Initialize
}

Definition at line 549 of file DropExt.C.

UINT g_cfNetResource = 0

Definition at line 43 of file DropExt.C.

UINT g_cRefThisDll = 0

Definition at line 42 of file DropExt.C.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/DropExt.h File Reference

  • WinUI
  • Shell
  • DropExt
Functions

DropExt.h File Reference

Go to the source code of this file.

Functions

DEFINE_GUID (CLSID_SampleDropExt, 0xA4D78B20, 0x6E05, 0x1069, 0x87, 0x58, 0x08, 0x00, 0x2B, 0x2B, 0xD6, 0x4F)

Function Documentation

DEFINE_GUID | ( | CLSID_SampleDropExt | ,
 |  | 0xA4D78B20 | ,
 |  | 0x6E05 | ,
 |  | 0x1069 | ,
 |  | 0x87 | ,
 |  | 0x58 | ,
 |  | 0x08 | ,
 |  | 0x00 | ,
 |  | 0x2B | ,
 |  | 0x2B | ,
 |  | 0xD6 | ,
 |  | 0x4F |
 | ) |  |
Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/Priv.h File Reference

  • WinUI
  • Shell
  • DropExt
Defines | Typedefs | Functions

Priv.h File Reference

#include <windows.h>
#include <commdlg.h>
#include <dlgs.h>
#include <shellapi.h>
#include <commctrl.h>
#include <windowsx.h>
#include <ole2.h>
#include <shlobj.h>

Go to the source code of this file.

Defines

#define | _INC_OLE
#define | _IOffset(class, itf) ((UINT_PTR)&(((class *)0)->itf))
#define | CONST_VTABLE
#define | IToClass(class, itf, pitf) ((class *)(((LPSTR)pitf)-_IOffset(class, itf)))
#define | IToClassN(class, itf, pitf) IToClass(class, itf, pitf)
#define | STRICT

Typedefs

typedef REFIID LPVOID FAR * | ppvObject
typedef REFIID | riid

Functions

typedef | HRESULT (CALLBACK FAR *LPFNCREATEINSTANCE)(LPUNKNOWN pUnkOuter
STDAPI | SHCreateDefClassObject (REFIID riid, LPVOID FAR *ppv, LPFNCREATEINSTANCE lpfnCI, UINT FAR *pcRefDll, REFIID riidInst)

Define Documentation

#define _INC_OLE

Definition at line 8 of file Priv.h.

#define _IOffset | ( | class,
 |  | itf |
 | ) |  | ((UINT_PTR)&(((class *)0)->itf))

Definition at line 33 of file Priv.h.

#define CONST_VTABLE

Definition at line 9 of file Priv.h.

#define IToClass | ( | class,
 |  | itf,
 |  | pitf |
 | ) |  | ((class *)(((LPSTR)pitf)-_IOffset(class, itf)))

Definition at line 34 of file Priv.h.

#define IToClassN | ( | class,
 |  | itf,
 |  | pitf |
 | ) |  | IToClass(class, itf, pitf)

Definition at line 35 of file Priv.h.

#define STRICT

Definition at line 7 of file Priv.h.

Typedef Documentation

typedef REFIID LPVOID FAR* ppvObject

Definition at line 24 of file Priv.h.

typedef REFIID riid

Definition at line 24 of file Priv.h.

Function Documentation

typedef HRESULT ( CALLBACK FAR * LPFNCREATEINSTANCE )
STDAPI SHCreateDefClassObject | ( | REFIID | riid,
 |  | LPVOID FAR * | ppv,
 |  | LPFNCREATEINSTANCE | lpfnCI,
 |  | UINT FAR * | pcRefDll,
 |  | REFIID | riidInst
 | ) |  |

Definition at line 183 of file DefClsF.C.

{
    // The default class factory supports only IClassFactory interface
    if (IsEqualIID(riid, &IID_IClassFactory))
    {
  CDefClassFactory * pacf = CDefClassFactory_Create(lpfnCI, pcRefDll, riidInst);
  if (pacf)
  {
      (IClassFactory FAR *)*ppv = &pacf->cf;
      return NOERROR;
  }
  return ResultFromScode(E_OUTOFMEMORY);
    }
    return ResultFromScode(E_NOINTERFACE);
}

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/enumdesk.cpp File Reference

  • WinUI
  • Shell
  • EnumDesk
Defines | Functions | Variables

enumdesk.cpp File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <shlobj.h>
#include "EnumDesk.h"
#include "Tree.h"
#include "List.h"
#include "resource.h"

Go to the source code of this file.

Defines

#define | GAP_SIZE 2
#define | MIN_SIZE 10

Functions

HIMAGELIST | Main_CreateImageList (BOOL)
BOOL | Main_InitApplication (HINSTANCE)
BOOL | Main_InitInstance (HINSTANCE, int)
LRESULT | Main_OnCommand (HWND, WPARAM, LPARAM)
void | Main_SizeChildren (HWND)
void | Main_UpdateMenu (HWND, HMENU)
LRESULT CALLBACK | Main_WndProc (HWND, UINT, WPARAM, LPARAM)
LPITEMIDLIST | Pidl_Concatenate (LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
LPITEMIDLIST | Pidl_Copy (LPCITEMIDLIST pidlSource)
LPITEMIDLIST | Pidl_Create (UINT cbSize)
void | Pidl_Free (LPITEMIDLIST pidl)
LPITEMIDLIST | Pidl_GetNextItem (LPCITEMIDLIST pidl)
UINT | Pidl_GetSize (LPCITEMIDLIST pidl)
int PASCAL | WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

Variables

HINSTANCE | g_hInst
HWND | g_hwndMain
IContextMenu2 * | g_pcm2
LPMALLOC | g_pMalloc
TCHAR | g_szClassName [] = TEXT("EnumDeskWndClass")
UINT g_uPosition

Define Documentation

#define GAP_SIZE 2

Definition at line 55 of file enumdesk.cpp.

#define MIN_SIZE 10

Definition at line 56 of file enumdesk.cpp.

Function Documentation

HIMAGELIST Main_CreateImageList ( BOOL fLarge )

Definition at line 347 of file enumdesk.cpp.

{
HIMAGELIST hImageList;
SHFILEINFO  sfi;

//get the system image list
hImageList = (HIMAGELIST)SHGetFileInfo(   TEXT("C:\\"),
                                          0,
                                          &sfi,
                                          sizeof(SHFILEINFO),
                                          SHGFI_SYSICONINDEX | (fLarge ? 0 : SHGFI_SMALLICON));

return hImageList;
}

BOOL Main_InitApplication ( HINSTANCE hInstance )

Definition at line 113 of file enumdesk.cpp.

{
WNDCLASS  wc;

/* Fill in window class structure with parameters that describe the main window. */

wc.style          = 0;
wc.lpfnWndProc    = (WNDPROC)Main_WndProc;
wc.cbClsExtra     = 0;
wc.cbWndExtra     = 0;
wc.hInstance      = hInstance;
wc.hIcon          = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor        = LoadCursor(hInstance, MAKEINTRESOURCE(IDC_SPLIT_CURSOR));
wc.hbrBackground  = GetSysColorBrush(COLOR_3DFACE);
wc.lpszMenuName   = MAKEINTRESOURCE(IDM_MAIN_MENU);
wc.lpszClassName  = g_szClassName;

/* Register the window class and return success/failure code. */

return RegisterClass(&wc);
}

BOOL Main_InitInstance | ( | HINSTANCE | hInstance,
 |  | int | nCmdShow
 | ) |  |

Definition at line 142 of file enumdesk.cpp.

{
/* Create a main window for this application instance.  */

g_hwndMain = CreateWindowEx(  0,
                              g_szClassName,
                              TEXT("New EnumDesk Sample"),
                              WS_OVERLAPPEDWINDOW,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              CW_USEDEFAULT,
                              NULL,
                              NULL,
                              hInstance,
                              NULL);

/* If window could not be created, return "failure" */

if(!g_hwndMain)
   return FALSE;

/* Make the window visible; update its client area; and return "success" */

ShowWindow(g_hwndMain, nCmdShow);
UpdateWindow(g_hwndMain);
return TRUE;

}

LRESULT Main_OnCommand | ( | HWND | hWnd,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 437 of file enumdesk.cpp.

{
UNREFERENCED_PARAMETER(lParam);

switch (GET_WM_COMMAND_ID(wParam, lParam))
   {
   case IDM_EXIT:
      DestroyWindow(hWnd);
      break;

   case IDM_LARGE_ICONS:
      {
      HWND  hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);
      DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
      SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_ICON);
      }
      break;

   case IDM_SMALL_ICONS:
      {
      HWND  hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);
      DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
      SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_SMALLICON);
      }
      break;

   case IDM_LIST:
      {
      HWND  hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);
      DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
      SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_LIST);
      }
      break;

   case IDM_REFRESH:
      List_Refresh(GetDlgItem(hWnd, IDC_LISTVIEW));
      break;
   }

return 0;
}

void Main_SizeChildren ( HWND hwndParent )

Definition at line 368 of file enumdesk.cpp.

{
RECT  rc;

GetClientRect(hwndParent, &rc);

if(!g_uPosition)
   {
   g_uPosition = rc.right/3;
   }

//resize the TreeView control
MoveWindow( GetDlgItem(hwndParent, IDC_TREEVIEW),
            0,
            0,
            g_uPosition - GAP_SIZE,
            rc.bottom,
            TRUE);

//resize the ListView
MoveWindow( GetDlgItem(hwndParent, IDC_LISTVIEW),
            g_uPosition,
            0,
            rc.right - g_uPosition,
            rc.bottom,
            TRUE);
}

void Main_UpdateMenu | ( | HWND | hWnd,
 |  | HMENU | hMenu
 | ) |  |

Definition at line 402 of file enumdesk.cpp.

{
UINT  uID = 0;
DWORD dwStyle;

//uncheck all of these guys
CheckMenuItem(hMenu, IDM_LARGE_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_SMALL_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
CheckMenuItem(hMenu, IDM_LIST,  MF_BYCOMMAND | MF_UNCHECKED);

//check the appropriate view menu item
dwStyle = GetWindowLong(GetDlgItem(hWnd, IDC_LISTVIEW), GWL_STYLE);
switch(dwStyle & LVS_TYPEMASK)
   {
   case LVS_ICON:
      uID = IDM_LARGE_ICONS;
      break;

   case LVS_SMALLICON:
      uID = IDM_SMALL_ICONS;
      break;

   case LVS_LIST:
      uID = IDM_LIST;
      break;
   }
CheckMenuRadioItem(hMenu, IDM_LARGE_ICONS, IDM_LIST, uID,  MF_BYCOMMAND | MF_CHECKED);
}

LRESULT CALLBACK Main_WndProc | ( | HWND | hWnd,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 179 of file enumdesk.cpp.

{
switch (uMessage)
   {
   case WM_NCCREATE:
      SHGetMalloc(&g_pMalloc);
      break;

   case WM_CREATE:
      {
      HIMAGELIST  himlLarge;
      HIMAGELIST  himlSmall;
      HWND        hwndTree;
      HWND        hwndList;

      g_uPosition = 0;

      //get the system image lists
      himlLarge = Main_CreateImageList(TRUE);
      himlSmall = Main_CreateImageList(FALSE);

      // create the TreeView control
      hwndTree = Tree_Create(g_hInst, hWnd, himlSmall);

      // create the ListView control
      hwndList = List_Create(g_hInst, hWnd, himlLarge, himlSmall);

      //initialize the TreeView control
      Tree_Init(hwndTree);

      SetFocus(hwndTree);
      }
      break;

   case WM_NOTIFY:
      {
      LPNMHDR  pnmh = (LPNMHDR) lParam;

      switch(pnmh->idFrom)
         {
         case IDC_TREEVIEW:
            return Tree_Notify(hWnd, lParam);

         case IDC_LISTVIEW:
            return List_Notify(hWnd, lParam);
         }
      }
      return 0;

   case WM_SIZE:
      {
      Main_SizeChildren(hWnd);
      }
      break;

   case WM_LBUTTONDOWN:
      SetCapture(hWnd);
      return 0;

   case WM_LBUTTONUP:
      ReleaseCapture();
      return 0;

   case WM_MOUSEMOVE:
      //if the left button is down
      if(GetKeyState(VK_LBUTTON) & 0x8000)
         {
         RECT  rc;

         GetClientRect(hWnd, &rc);

         //don't do anything if we are already at the minimum size
         if((g_uPosition == MIN_SIZE) && (LOWORD(lParam) <= MIN_SIZE))
            break;

         //don't do anything if we are already at the maximum size
         if(((rc.right - g_uPosition) == MIN_SIZE) && (LOWORD(lParam) >= g_uPosition))
            break;

         g_uPosition = LOWORD(lParam);

         //check for min and max
         if(g_uPosition < MIN_SIZE)
            g_uPosition = MIN_SIZE;

         if((rc.right - g_uPosition) < MIN_SIZE)
            g_uPosition = rc.right - MIN_SIZE;

         Main_SizeChildren(hWnd);
         }
      break;

   case WM_COMMAND:
      return Main_OnCommand(hWnd, wParam, lParam);

   case WM_DESTROY:
      //tell the list to release its current folder
      List_ReleaseCurrentFolder();

      PostQuitMessage(0);
      break;

   case WM_NCDESTROY:
      g_pMalloc->Release();
      g_pMalloc = NULL;
      break;

   case WM_SYSCOLORCHANGE:
      {
      HBRUSH   hbr = GetSysColorBrush(COLOR_3DFACE);

      hbr = (HBRUSH)SetClassLongPtr(hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)hbr);

      if(hbr)
         DeleteObject(hbr);
      }
      break;

   case WM_INITMENUPOPUP:
      Main_UpdateMenu(hWnd, (HMENU)wParam);
      //fall through

   case WM_DRAWITEM:
   case WM_MENUCHAR:
   case WM_MEASUREITEM:
      if(g_pcm2)
         {
         g_pcm2->HandleMenuMsg(uMessage, wParam, lParam);
         }
      break;

   case WM_CONTEXTMENU:
      {
      POINT ptScreen;
      POINT ptClient;

      ptScreen.x = GET_X_LPARAM(lParam);
      ptScreen.y = GET_Y_LPARAM(lParam);
      ptClient = ptScreen;
      ScreenToClient(hWnd, &ptClient);
      HWND  hwndOver = ChildWindowFromPoint(hWnd, ptClient);

      if(GetDlgItem(hWnd, IDC_TREEVIEW) == hwndOver)
         {
         Tree_DoContextMenu(hwndOver, &ptScreen);
         }
      else if(GetDlgItem(hWnd, IDC_LISTVIEW) == hwndOver)
         {
         List_DoContextMenu(hwndOver, &ptScreen);
         }
      }
      break;

   default:
      break;
   }
return DefWindowProc(hWnd, uMessage, wParam, lParam);
}

LPITEMIDLIST Pidl_Concatenate | ( | LPCITEMIDLIST | pidl1,
 |  | LPCITEMIDLIST | pidl2
 | ) |  |

Definition at line 573 of file enumdesk.cpp.

{
LPITEMIDLIST   pidlNew;
UINT           cb1 = 0,
               cb2 = 0;

//
// Pidl1 can possibly be NULL if it points to the desktop.  Since we only
// need a single NULL terminator, we remove the extra 2 bytes from the
// size of the first ITEMIDLIST.
//
if(pidl1)
   cb1 = Pidl_GetSize(pidl1) - (2 * sizeof(BYTE));

cb2 = Pidl_GetSize(pidl2);

//
// Create a new ITEMIDLIST that is the size of both pidl1 and pidl2, then
// copy pidl1 and pidl2 to the new list.
//
pidlNew = Pidl_Create(cb1 + cb2);
if(pidlNew)
   {
   if(pidl1)
      CopyMemory(pidlNew, pidl1, cb1);

   CopyMemory(((LPBYTE)pidlNew) + cb1, pidl2, cb2);
   }

return pidlNew;
}

LPITEMIDLIST Pidl_Copy ( LPCITEMIDLIST pidlSource )

Definition at line 543 of file enumdesk.cpp.

{
LPITEMIDLIST   pidlTarget = NULL;
UINT           cbSource = 0;

if(NULL == pidlSource)
   return NULL;

//
// Allocate the new ITEMIDLIST
//
cbSource = Pidl_GetSize(pidlSource);
pidlTarget = (LPITEMIDLIST) g_pMalloc->Alloc(cbSource);
if(!pidlTarget)
   return NULL;

//
// Copy the source to the target
//
CopyMemory(pidlTarget, pidlSource, cbSource);

return pidlTarget;
}

LPITEMIDLIST Pidl_Create ( UINT cbSize )

Definition at line 500 of file enumdesk.cpp.

{
LPITEMIDLIST pidl = NULL;

pidl = (LPITEMIDLIST) g_pMalloc->Alloc(cbSize);
if(pidl)
   ZeroMemory(pidl, cbSize);

return pidl;
}

void Pidl_Free ( LPITEMIDLIST pidl )

Definition at line 611 of file enumdesk.cpp.

{
if(pidl)
   g_pMalloc->Free(pidl);
}

LPITEMIDLIST Pidl_GetNextItem ( LPCITEMIDLIST pidl ) [inline]

Definition at line 486 of file enumdesk.cpp.

{
if(pidl)
   return (LPITEMIDLIST)(LPBYTE)(((LPBYTE)pidl) + pidl->mkid.cb);
else
   return NULL;
}

UINT Pidl_GetSize ( LPCITEMIDLIST pidl )

Definition at line 517 of file enumdesk.cpp.

{
UINT           cbTotal = 0;
LPITEMIDLIST   pidlTemp = (LPITEMIDLIST) pidl;

if(pidlTemp)
   {
   while(pidlTemp->mkid.cb)
      {
      cbTotal += pidlTemp->mkid.cb;
      pidlTemp = Pidl_GetNextItem(pidlTemp);
      }

   // Requires a 16 bit zero value for the NULL terminator
   cbTotal += 2 * sizeof(BYTE);
   }

return cbTotal;
}

int PASCAL WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 64 of file enumdesk.cpp.

{
UNREFERENCED_PARAMETER(lpCmdLine);

MSG  msg;

g_hInst = hInstance;

if(!hPrevInstance)
   if(!Main_InitApplication(hInstance))
      return FALSE;

CoInitialize(NULL);

//required to use the common controls
InitCommonControls();

/* Perform initializations that apply to a specific instance */

if (!Main_InitInstance(hInstance, nCmdShow))
   return FALSE;

/* Acquire and dispatch messages until a WM_QUIT uMessage is received. */

HACCEL   hAccels = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELS));

while(GetMessage( &msg, NULL, 0x00, 0x00))
   {
   if(!TranslateAccelerator(g_hwndMain, hAccels, &msg))
      {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
      }
   }

CoUninitialize();

return (int)msg.wParam;
}

Variable Documentation

HINSTANCE g_hInst

Definition at line 48 of file enumdesk.cpp.

HWND g_hwndMain

Definition at line 50 of file enumdesk.cpp.

IContextMenu2* g_pcm2

Definition at line 53 of file enumdesk.cpp.

LPMALLOC g_pMalloc

Definition at line 51 of file enumdesk.cpp.

TCHAR g_szClassName[] = TEXT("EnumDeskWndClass")

Definition at line 49 of file enumdesk.cpp.

UINT g_uPosition

Definition at line 52 of file enumdesk.cpp.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/enumdesk.h File Reference

  • WinUI
  • Shell
  • EnumDesk
Classes | Defines | Typedefs | Functions | Variables

enumdesk.h File Reference

#include <windows.h>

Go to the source code of this file.

Classes

struct | ITEMINFO

Defines

#define | IDC_LISTVIEW 2001
#define | IDC_TREEVIEW 2000

Typedefs

typedef struct ITEMINFO * | LPITEMINFO

Functions

LPITEMIDLIST | Pidl_Concatenate (LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
LPITEMIDLIST | Pidl_Copy (LPCITEMIDLIST pidlSource)
void | Pidl_Free (LPITEMIDLIST)

Variables

HINSTANCE | g_hInst
IContextMenu2 * | g_pcm2
LPMALLOC | g_pMalloc

Define Documentation

#define IDC_LISTVIEW 2001

Definition at line 48 of file enumdesk.h.

#define IDC_TREEVIEW 2000

Definition at line 47 of file enumdesk.h.

Typedef Documentation

typedef struct ITEMINFO* LPITEMINFO

Function Documentation

LPITEMIDLIST Pidl_Concatenate | ( | LPCITEMIDLIST | pidl1,
 |  | LPCITEMIDLIST | pidl2
 | ) |  |

Definition at line 573 of file enumdesk.cpp.

{
LPITEMIDLIST   pidlNew;
UINT           cb1 = 0,
               cb2 = 0;

//
// Pidl1 can possibly be NULL if it points to the desktop.  Since we only
// need a single NULL terminator, we remove the extra 2 bytes from the
// size of the first ITEMIDLIST.
//
if(pidl1)
   cb1 = Pidl_GetSize(pidl1) - (2 * sizeof(BYTE));

cb2 = Pidl_GetSize(pidl2);

//
// Create a new ITEMIDLIST that is the size of both pidl1 and pidl2, then
// copy pidl1 and pidl2 to the new list.
//
pidlNew = Pidl_Create(cb1 + cb2);
if(pidlNew)
   {
   if(pidl1)
      CopyMemory(pidlNew, pidl1, cb1);

   CopyMemory(((LPBYTE)pidlNew) + cb1, pidl2, cb2);
   }

return pidlNew;
}

LPITEMIDLIST Pidl_Copy ( LPCITEMIDLIST pidlSource )

Definition at line 543 of file enumdesk.cpp.

{
LPITEMIDLIST   pidlTarget = NULL;
UINT           cbSource = 0;

if(NULL == pidlSource)
   return NULL;

//
// Allocate the new ITEMIDLIST
//
cbSource = Pidl_GetSize(pidlSource);
pidlTarget = (LPITEMIDLIST) g_pMalloc->Alloc(cbSource);
if(!pidlTarget)
   return NULL;

//
// Copy the source to the target
//
CopyMemory(pidlTarget, pidlSource, cbSource);

return pidlTarget;
}

void Pidl_Free ( LPITEMIDLIST )

Definition at line 611 of file enumdesk.cpp.

{
if(pidl)
   g_pMalloc->Free(pidl);
}

Variable Documentation

HINSTANCE g_hInst

Definition at line 62 of file DoServer.Cpp.

IContextMenu2* g_pcm2

Definition at line 53 of file enumdesk.cpp.

LPMALLOC g_pMalloc

Definition at line 89 of file sendto.c.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/list.cpp File Reference

  • WinUI
  • Shell
  • EnumDesk
Functions | Variables

list.cpp File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <shlobj.h>
#include "EnumDesk.h"
#include "resource.h"

Go to the source code of this file.

Functions

int CALLBACK | List_CompareProc (LPARAM, LPARAM, LPARAM)
HWND | List_Create (HINSTANCE hInstance, HWND hwndParent, HIMAGELIST himlLarge, HIMAGELIST himlSmall)
HRESULT | List_DisplayFolder (HWND hwndListView, LPITEMINFO pItemInfo)
void | List_DoBackgroundMenu (HWND hwndListView, LPPOINT pptScreen)
void | List_DoContextMenu (HWND hwndListView, LPPOINT pptScreen)
void | List_DoDefault (HWND hwndListView, int iItem)
void | List_DoItemMenu (HWND hwndListView, LPINT piItems, UINT cbItems, LPPOINT pptScreen)
void | List_EnumObjects (HWND, LPSHELLFOLDER, LPITEMIDLIST)
void | List_LockCurrentFolder (LPITEMINFO pItemInfo)
LRESULT | List_Notify (HWND hWnd, LPARAM lParam)
HRESULT | List_Refresh (HWND hwndListView)
void | List_ReleaseCurrentFolder (void)

Variables

LPITEMIDLIST | g_pidlCurFQ = NULL
IShellFolder * | g_psfCurFolder = NULL

Function Documentation

int CALLBACK List_CompareProc | ( | LPARAM | lParam1,
 |  | LPARAM | lParam2,
 |  | LPARAM | lParamSort
 | ) |  |

Definition at line 363 of file list.cpp.

{
UNREFERENCED_PARAMETER(lParamSort);

LPITEMINFO  pItem1 = (LPITEMINFO)lParam1;
LPITEMINFO  pItem2 = (LPITEMINFO)lParam2;
HRESULT     hr;

hr = pItem1->pParentFolder->CompareIDs(   0,
                                          pItem1->pidlRel,
                                          pItem2->pidlRel);

if(FAILED(hr))
   return 0;

return (short)SCODE_CODE(GetScode(hr));
}

HWND List_Create | ( | HINSTANCE | hInstance,
 |  | HWND | hwndParent,
 |  | HIMAGELIST | himlLarge,
 |  | HIMAGELIST | himlSmall
 | ) |  |

Definition at line 50 of file list.cpp.

{
DWORD       dwStyle;
HWND        hwndListView;

dwStyle =   WS_TABSTOP |
            WS_CHILD |
            WS_BORDER |
            WS_VISIBLE |
            LVS_AUTOARRANGE |
            LVS_LIST |
            LVS_SHAREIMAGELISTS |
            LVS_SHOWSELALWAYS |
            0;

hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,
                                 WC_LISTVIEW,
                                 NULL,
                                 dwStyle,
                                 0,
                                 0,
                                 0,
                                 0,
                                 hwndParent,
                                 (HMENU)IDC_LISTVIEW,
                                 hInstance,
                                 NULL);

if(hwndListView)
   {
   //set the image lists
   ListView_SetImageList(hwndListView, himlLarge, LVSIL_NORMAL);
   ListView_SetImageList(hwndListView, himlSmall, LVSIL_SMALL);
   }

return hwndListView;
}

HRESULT List_DisplayFolder | ( | HWND | hwndListView,
 |  | LPITEMINFO | pItemInfo
 | ) |  |

Definition at line 138 of file list.cpp.

{
if(pItemInfo)
   {
   List_ReleaseCurrentFolder();

   List_LockCurrentFolder(pItemInfo);
   }

HRESULT  hr = E_FAIL;

ListView_DeleteAllItems(hwndListView);

if(g_psfCurFolder)
   {
   HCURSOR  hCur = LoadCursor(NULL, IDC_WAIT);

   hCur = SetCursor(hCur);

   //turn redawing off in the ListView. This will speed things up as we add items
   SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0);

   List_EnumObjects(hwndListView, g_psfCurFolder, g_pidlCurFQ);

   ListView_SortItems(hwndListView, List_CompareProc, 0);

   //turn redawing back on
   SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0);

   SetCursor(hCur);
   }

return hr;
}

void List_DoBackgroundMenu | ( | HWND | hwndListView,
 |  | LPPOINT | pptScreen
 | ) |  |

Definition at line 493 of file list.cpp.

{
HWND           hwndParent = GetParent(hwndListView);
HRESULT        hr;

if(g_psfCurFolder)
   {
   IContextMenu   *pcm;

   hr = g_psfCurFolder->CreateViewObject( hwndParent,
                                          IID_IContextMenu,
                                          (LPVOID*)&pcm);

   if(SUCCEEDED(hr))
      {
      HMENU hMenu;

      hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDM_MAIN_MENU));
      if(hMenu)
         {
         HMENU hPopup;
         hPopup = GetSubMenu(hMenu, 1);

         if(hPopup)
            {
            int   i;
            UINT  idCmdFirst;
            UINT  idCmd;

            //find the largest ID in the menu
            i = 0;
            idCmdFirst = 0;

            while((idCmd = GetMenuItemID(hPopup, i)) != (UINT)-1)
               {
               if(idCmd > idCmdFirst)
                  idCmdFirst = idCmd;

               i++;
               }

            hr = pcm->QueryContextMenu(hPopup, 0, ++idCmdFirst, (UINT)-1, CMF_NORMAL | CMF_EXPLORE);

            if(SUCCEEDED(hr))
               {
               pcm->QueryInterface(IID_IContextMenu2, (LPVOID*)&g_pcm2);

               idCmd = TrackPopupMenu( hPopup,
                                       TPM_LEFTALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
                                       pptScreen->x,
                                       pptScreen->y,
                                       0,
                                       hwndParent,
                                       NULL);

               if(g_pcm2)
                  {
                  g_pcm2->Release();
                  g_pcm2 = NULL;
                  }

               if(idCmd)
                  {
                  if(idCmd < idCmdFirst)
                     {
                     //this is one of our commands
                     FORWARD_WM_COMMAND(hwndParent, idCmd, NULL, 0, SendMessage);
                     }
                  else
                     {
                     CMINVOKECOMMANDINFO  cmi;
                     cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
                     cmi.fMask = 0;
                     cmi.hwnd = hwndParent;
                     cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - idCmdFirst);
                     cmi.lpParameters = NULL;
                     cmi.lpDirectory = NULL;
                     cmi.nShow = SW_SHOWNORMAL;
                     cmi.dwHotKey = 0;
                     cmi.hIcon = NULL;
                     hr = pcm->InvokeCommand(&cmi);

                     /*
                     The operation performed by the context menu may have
                     changed the contents of the folder, so do a refresh.
                     */
                     List_Refresh(hwndListView);
                     }
                  }
               }
            }
         DestroyMenu(hMenu);
         }

      pcm->Release();
      }
   }
}

void List_DoContextMenu | ( | HWND | hwndListView,
 |  | LPPOINT | pptScreen
 | ) |  |

Definition at line 598 of file list.cpp.

{
LVHITTESTINFO  lvhti;

lvhti.pt = *pptScreen;
ScreenToClient(hwndListView, &lvhti.pt);

lvhti.flags = LVHT_NOWHERE;

ListView_HitTest(hwndListView, &lvhti);

if(LVHT_ONITEM & lvhti.flags)
   {
   //get the selected items
   UINT  nItems = ListView_GetSelectedCount(hwndListView);
   LPINT pItems = (LPINT)GlobalAlloc(GPTR, sizeof(int) * nItems);

   if(pItems)
      {
      UINT  i;
      int   nCurItem;

      //put the item clicked on first in the list
      pItems[0] = lvhti.iItem;

      for(i = 1, nCurItem = -1; i < nItems; i++)
         {
         nCurItem = ListView_GetNextItem(hwndListView, nCurItem, LVNI_SELECTED);
         if(nCurItem != lvhti.iItem)
            pItems[i] = nCurItem;
         else
            i--;
         }

      List_DoItemMenu(hwndListView, pItems, nItems, pptScreen);

      GlobalFree(pItems);
      }
   }
else
   {
   List_DoBackgroundMenu(hwndListView, pptScreen);
   }
}

void List_DoDefault | ( | HWND | hwndListView,
 |  | int | iItem
 | ) |  |

Definition at line 649 of file list.cpp.

{
LVITEM   lvItem;

ZeroMemory(&lvItem, sizeof(lvItem));
lvItem.mask = LVIF_PARAM;
lvItem.iItem = iItem;

if(ListView_GetItem(hwndListView, &lvItem))
   {
   HRESULT        hr;
   LPITEMINFO     pInfo = (LPITEMINFO)lvItem.lParam;
   IContextMenu   *pcm;
   IShellFolder   *psfFolder = pInfo->pParentFolder;

   if(!psfFolder)
      {
      SHGetDesktopFolder(&psfFolder);
      }
   else
      {
      psfFolder->AddRef();
      }

   if(psfFolder)
      {
      hr = psfFolder->GetUIObjectOf(   hwndListView,
                                       1,
                                       (LPCITEMIDLIST*)&pInfo->pidlRel,
                                       IID_IContextMenu,
                                       NULL,
                                       (LPVOID*)&pcm);

      if(SUCCEEDED(hr))
         {
         HMENU hPopup;

         hPopup = CreatePopupMenu();
         if(hPopup)
            {
            hr = pcm->QueryContextMenu(hPopup, 0, 1, 0x7fff, CMF_DEFAULTONLY | CMF_EXPLORE);

            if(SUCCEEDED(hr))
               {
               UINT  idCmd;

               idCmd = GetMenuItemID(hPopup, 0);

               if(idCmd && (idCmd != (UINT)-1))
                  {
                  CMINVOKECOMMANDINFO  cmi;
                  cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
                  cmi.fMask = 0;
                  cmi.hwnd = GetParent(hwndListView);
                  cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - 1);
                  cmi.lpParameters = NULL;
                  cmi.lpDirectory = NULL;
                  cmi.nShow = SW_SHOWNORMAL;
                  cmi.dwHotKey = 0;
                  cmi.hIcon = NULL;
                  hr = pcm->InvokeCommand(&cmi);
                  }
               }
            }

         pcm->Release();
         }

      psfFolder->Release();
      }
   }
}

void List_DoItemMenu | ( | HWND | hwndListView,
 |  | LPINT | piItems,
 |  | UINT | cbItems,
 |  | LPPOINT | pptScreen
 | ) |  |

Definition at line 387 of file list.cpp.

{
LPITEMIDLIST   *pPidls;

pPidls = (LPITEMIDLIST*)g_pMalloc->Alloc(sizeof(LPITEMIDLIST) * cbItems);
if(!pPidls)
   return;

LVITEM   lvItem;
UINT     i;

for(i = 0; i < cbItems; i++)
   {
   ZeroMemory(&lvItem, sizeof(lvItem));
   lvItem.mask = LVIF_PARAM;
   lvItem.iItem = piItems[i];
   if(ListView_GetItem(hwndListView, &lvItem))
      {
      LPITEMINFO  pInfo = (LPITEMINFO)lvItem.lParam;
      pPidls[i] = pInfo->pidlRel;
      }
   }

if(pPidls[0])
   {
   HRESULT        hr;
   IContextMenu   *pcm;

   if(g_psfCurFolder)
      {
      hr = g_psfCurFolder->GetUIObjectOf( hwndListView,
                                          cbItems,
                                          (LPCITEMIDLIST*)pPidls,
                                          IID_IContextMenu,
                                          NULL,
                                          (LPVOID*)&pcm);

      if(SUCCEEDED(hr))
         {
         HMENU hPopup;

         hPopup = CreatePopupMenu();
         if(hPopup)
            {
            hr = pcm->QueryContextMenu(hPopup, 0, 1, 0x7fff, CMF_NORMAL | CMF_EXPLORE);

            if(SUCCEEDED(hr))
               {
               pcm->QueryInterface(IID_IContextMenu2, (LPVOID*)&g_pcm2);

               UINT  idCmd;

               idCmd = TrackPopupMenu( hPopup,
                                       TPM_LEFTALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
                                       pptScreen->x,
                                       pptScreen->y,
                                       0,
                                       GetParent(hwndListView),
                                       NULL);

               if(g_pcm2)
                  {
                  g_pcm2->Release();
                  g_pcm2 = NULL;
                  }

               if(idCmd)
                  {
                  CMINVOKECOMMANDINFO  cmi;
                  cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
                  cmi.fMask = 0;
                  cmi.hwnd = (HWND)GetParent(hwndListView);
                  cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - 1);
                  cmi.lpParameters = NULL;
                  cmi.lpDirectory = NULL;
                  cmi.nShow = SW_SHOWNORMAL;
                  cmi.dwHotKey = 0;
                  cmi.hIcon = NULL;
                  hr = pcm->InvokeCommand(&cmi);

                  /*
                  The operation performed by the context menu may have changed
                  the contents of the folder, so do a refresh.
                  */
                  List_Refresh(hwndListView);
                  }
               }
            }

         pcm->Release();
         }
      }
   }

g_pMalloc->Free(pPidls);
}

void List_EnumObjects | ( | HWND | hwndListView,
 |  | LPSHELLFOLDER | pParentFolder,
 |  | LPITEMIDLIST | pidlParent
 | ) |  |

Definition at line 287 of file list.cpp.

{
LPENUMIDLIST   pEnum;

if(SUCCEEDED(pParentFolder->EnumObjects(  NULL,
                                          SHCONTF_FOLDERS |
                                             SHCONTF_NONFOLDERS |
                                             SHCONTF_INCLUDEHIDDEN,
                                          &pEnum)))
   {
   LPITEMIDLIST   pidlTemp;
   DWORD          dwFetched = 1;
   LPITEMINFO     pItem;

   //enumerate the item's PIDLs
   while(S_OK == (pEnum->Next(1, &pidlTemp, &dwFetched)) && dwFetched)
      {
      LVITEM   lvItem;
      DWORD    dwAttr;

      ZeroMemory(&lvItem, sizeof(lvItem));

      //fill in the TV_ITEM structure for this item
      lvItem.mask = LVIF_PARAM | LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;

      //AddRef the parent folder so it's pointer stays valid
      pParentFolder->AddRef();

      //put the private information in the lParam
      pItem = (LPITEMINFO)GlobalAlloc(GPTR, sizeof(ITEMINFO));

      pItem->pidlRel = pidlTemp;
      pItem->pidlFQ = Pidl_Concatenate(pidlParent, pidlTemp);

      pItem->pParentFolder = pParentFolder;
      lvItem.lParam = (LPARAM)pItem;

      //text and images are done on a callback basis
      lvItem.pszText = LPSTR_TEXTCALLBACK;
      lvItem.iImage = I_IMAGECALLBACK;

      //determine if the item is shared
      dwAttr = SFGAO_DISPLAYATTRMASK;
      pParentFolder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &dwAttr);

      if(dwAttr & SFGAO_SHARE)
         {
         lvItem.mask |= LVIF_STATE;
         lvItem.stateMask |= LVIS_OVERLAYMASK;
         lvItem.state |= INDEXTOOVERLAYMASK(1); //1 is the index for the shared overlay image
         }

      if(dwAttr & SFGAO_GHOSTED)
         {
         lvItem.mask |= LVIF_STATE;
         lvItem.stateMask |= LVIS_CUT;
         lvItem.state |= LVIS_CUT;
         }

      ListView_InsertItem(hwndListView, &lvItem);

      dwFetched = 0;
      }

   pEnum->Release();
   }
}

void List_LockCurrentFolder ( LPITEMINFO pItemInfo )

Definition at line 115 of file list.cpp.

{
if(pItemInfo && pItemInfo->pParentFolder)
   {
   pItemInfo->pParentFolder->BindToObject(pItemInfo->pidlRel, NULL, IID_IShellFolder, (LPVOID*)&g_psfCurFolder);

   g_pidlCurFQ = Pidl_Copy(pItemInfo->pidlFQ);
   }
else
   {
   SHGetDesktopFolder(&g_psfCurFolder);

   if(pItemInfo)
      g_pidlCurFQ = Pidl_Copy(pItemInfo->pidlFQ);
   }
}

LRESULT List_Notify | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 190 of file list.cpp.

{
LPNMHDR  pnmh = (LPNMHDR) lParam;
HWND     hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);

switch(pnmh->code)
   {
   case LVN_GETDISPINFO:
      {
      NMLVDISPINFO   *pdi = (NMLVDISPINFO*)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)pdi->item.lParam;

      //do we need to supply the text?
      if(pdi->item.mask & LVIF_TEXT)
         {
         switch(pdi->item.iSubItem)
            {
            case 0:  //name
               {
               SHFILEINFO     sfi;

               //get the display name of the item
               if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_DISPLAYNAME))
                  {
                  lstrcpyn(pdi->item.pszText, sfi.szDisplayName, pdi->item.cchTextMax);
                  }
               }
               break;

            case 1:  //size
               break;
            }
         }

      //do we need to supply the unselected image?
      if(pdi->item.mask & LVIF_IMAGE)
         {
         SHFILEINFO     sfi;

         //get the unselected image for this item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_LINKOVERLAY))
            {
            pdi->item.iImage = sfi.iIcon;
            }
         }
      }
      break;

   case LVN_DELETEITEM:
      {
      LPNMLISTVIEW   pnmlv = (LPNMLISTVIEW)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)pnmlv->lParam;

      //free up the pidls that we allocated
      Pidl_Free(pItem->pidlFQ);
      Pidl_Free(pItem->pidlRel);

      //this may be NULL if this is the root item
      if(pItem->pParentFolder)
         pItem->pParentFolder->Release();

      GlobalFree((HGLOBAL)pItem);
      }
      break;

#ifdef LVN_ITEMACTIVATE

   case LVN_ITEMACTIVATE:

#else    //LVN_ITEMACTIVATE

   case NM_DBLCLK:
   case NM_RETURN:

#endif   //LVN_ITEMACTIVATE
      {
      //get the item that has the focus
      int   nItem = ListView_GetNextItem(hwndListView, -1, LVNI_FOCUSED);

      if(-1 != nItem)
         List_DoDefault(hwndListView, nItem);
      }
      break;

   default:
      break;
   }

return 0;
}

HRESULT List_Refresh ( HWND hwndListView )

Definition at line 179 of file list.cpp.

{
return List_DisplayFolder(hwndListView, NULL);
}

void List_ReleaseCurrentFolder ( void )

Definition at line 97 of file list.cpp.

{
if(g_psfCurFolder)
   {
   g_psfCurFolder->Release();
   g_psfCurFolder = NULL;

   Pidl_Free(g_pidlCurFQ);
   g_pidlCurFQ = NULL;
   }
}

Variable Documentation

LPITEMIDLIST g_pidlCurFQ = NULL

Definition at line 42 of file list.cpp.

IShellFolder* g_psfCurFolder = NULL

Definition at line 41 of file list.cpp.

Generated on Wed Nov 13 2024 16:53:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/list.h File Reference

  • WinUI
  • Shell
  • EnumDesk
Functions

list.h File Reference

#include <windows.h>

Go to the source code of this file.

Functions

HWND | List_Create (HINSTANCE, HWND, HIMAGELIST, HIMAGELIST)
HRESULT | List_DisplayFolder (HWND, LPITEMINFO)
void | List_DoContextMenu (HWND, LPPOINT)
LRESULT | List_Notify (HWND, LPARAM)
HRESULT | List_Refresh (HWND)
void | List_ReleaseCurrentFolder (void)

Function Documentation

HWND List_Create | ( | HINSTANCE | ,
 |  | HWND | ,
 |  | HIMAGELIST | ,
 |  | HIMAGELIST |
 | ) |  |

Definition at line 50 of file list.cpp.

{
DWORD       dwStyle;
HWND        hwndListView;

dwStyle =   WS_TABSTOP |
            WS_CHILD |
            WS_BORDER |
            WS_VISIBLE |
            LVS_AUTOARRANGE |
            LVS_LIST |
            LVS_SHAREIMAGELISTS |
            LVS_SHOWSELALWAYS |
            0;

hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,
                                 WC_LISTVIEW,
                                 NULL,
                                 dwStyle,
                                 0,
                                 0,
                                 0,
                                 0,
                                 hwndParent,
                                 (HMENU)IDC_LISTVIEW,
                                 hInstance,
                                 NULL);

if(hwndListView)
   {
   //set the image lists
   ListView_SetImageList(hwndListView, himlLarge, LVSIL_NORMAL);
   ListView_SetImageList(hwndListView, himlSmall, LVSIL_SMALL);
   }

return hwndListView;
}

HRESULT List_DisplayFolder | ( | HWND | ,
 |  | LPITEMINFO |
 | ) |  |

Definition at line 138 of file list.cpp.

{
if(pItemInfo)
   {
   List_ReleaseCurrentFolder();

   List_LockCurrentFolder(pItemInfo);
   }

HRESULT  hr = E_FAIL;

ListView_DeleteAllItems(hwndListView);

if(g_psfCurFolder)
   {
   HCURSOR  hCur = LoadCursor(NULL, IDC_WAIT);

   hCur = SetCursor(hCur);

   //turn redawing off in the ListView. This will speed things up as we add items
   SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0);

   List_EnumObjects(hwndListView, g_psfCurFolder, g_pidlCurFQ);

   ListView_SortItems(hwndListView, List_CompareProc, 0);

   //turn redawing back on
   SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0);

   SetCursor(hCur);
   }

return hr;
}

void List_DoContextMenu | ( | HWND | ,
 |  | LPPOINT |
 | ) |  |

Definition at line 598 of file list.cpp.

{
LVHITTESTINFO  lvhti;

lvhti.pt = *pptScreen;
ScreenToClient(hwndListView, &lvhti.pt);

lvhti.flags = LVHT_NOWHERE;

ListView_HitTest(hwndListView, &lvhti);

if(LVHT_ONITEM & lvhti.flags)
   {
   //get the selected items
   UINT  nItems = ListView_GetSelectedCount(hwndListView);
   LPINT pItems = (LPINT)GlobalAlloc(GPTR, sizeof(int) * nItems);

   if(pItems)
      {
      UINT  i;
      int   nCurItem;

      //put the item clicked on first in the list
      pItems[0] = lvhti.iItem;

      for(i = 1, nCurItem = -1; i < nItems; i++)
         {
         nCurItem = ListView_GetNextItem(hwndListView, nCurItem, LVNI_SELECTED);
         if(nCurItem != lvhti.iItem)
            pItems[i] = nCurItem;
         else
            i--;
         }

      List_DoItemMenu(hwndListView, pItems, nItems, pptScreen);

      GlobalFree(pItems);
      }
   }
else
   {
   List_DoBackgroundMenu(hwndListView, pptScreen);
   }
}

LRESULT List_Notify | ( | HWND | ,
 |  | LPARAM |
 | ) |  |

Definition at line 190 of file list.cpp.

{
LPNMHDR  pnmh = (LPNMHDR) lParam;
HWND     hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);

switch(pnmh->code)
   {
   case LVN_GETDISPINFO:
      {
      NMLVDISPINFO   *pdi = (NMLVDISPINFO*)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)pdi->item.lParam;

      //do we need to supply the text?
      if(pdi->item.mask & LVIF_TEXT)
         {
         switch(pdi->item.iSubItem)
            {
            case 0:  //name
               {
               SHFILEINFO     sfi;

               //get the display name of the item
               if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_DISPLAYNAME))
                  {
                  lstrcpyn(pdi->item.pszText, sfi.szDisplayName, pdi->item.cchTextMax);
                  }
               }
               break;

            case 1:  //size
               break;
            }
         }

      //do we need to supply the unselected image?
      if(pdi->item.mask & LVIF_IMAGE)
         {
         SHFILEINFO     sfi;

         //get the unselected image for this item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_LINKOVERLAY))
            {
            pdi->item.iImage = sfi.iIcon;
            }
         }
      }
      break;

   case LVN_DELETEITEM:
      {
      LPNMLISTVIEW   pnmlv = (LPNMLISTVIEW)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)pnmlv->lParam;

      //free up the pidls that we allocated
      Pidl_Free(pItem->pidlFQ);
      Pidl_Free(pItem->pidlRel);

      //this may be NULL if this is the root item
      if(pItem->pParentFolder)
         pItem->pParentFolder->Release();

      GlobalFree((HGLOBAL)pItem);
      }
      break;

#ifdef LVN_ITEMACTIVATE

   case LVN_ITEMACTIVATE:

#else    //LVN_ITEMACTIVATE

   case NM_DBLCLK:
   case NM_RETURN:

#endif   //LVN_ITEMACTIVATE
      {
      //get the item that has the focus
      int   nItem = ListView_GetNextItem(hwndListView, -1, LVNI_FOCUSED);

      if(-1 != nItem)
         List_DoDefault(hwndListView, nItem);
      }
      break;

   default:
      break;
   }

return 0;
}

HRESULT List_Refresh ( HWND )

Definition at line 179 of file list.cpp.

{
return List_DisplayFolder(hwndListView, NULL);
}

void List_ReleaseCurrentFolder ( void )

Definition at line 97 of file list.cpp.

{
if(g_psfCurFolder)
   {
   g_psfCurFolder->Release();
   g_psfCurFolder = NULL;

   Pidl_Free(g_pidlCurFQ);
   g_pidlCurFQ = NULL;
   }
}

Generated on Wed Nov 13 2024 16:53:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/resource.h File Reference

  • WinUI
  • Shell
  • EnumDesk
Defines

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_SPLIT_CURSOR 101
#define | IDM_EXIT 1000
#define | IDM_LARGE_ICONS 200
#define | IDM_LIST 202
#define | IDM_MAIN_MENU 100
#define | IDM_REFRESH 203
#define | IDM_SMALL_ICONS 201
#define | IDR_ACCELS 102

Define Documentation

#define IDC_SPLIT_CURSOR 101

Definition at line 6 of file resource.h.

#define IDM_EXIT 1000

Definition at line 12 of file resource.h.

#define IDM_LARGE_ICONS 200

Definition at line 8 of file resource.h.

#define IDM_LIST 202

Definition at line 10 of file resource.h.

#define IDM_MAIN_MENU 100

Definition at line 5 of file resource.h.

#define IDM_REFRESH 203

Definition at line 11 of file resource.h.

#define IDM_SMALL_ICONS 201

Definition at line 9 of file resource.h.

#define IDR_ACCELS 102

Definition at line 7 of file resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/tree.cpp File Reference

  • WinUI
  • Shell
  • EnumDesk
Functions

tree.cpp File Reference

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <shlobj.h>
#include "EnumDesk.h"
#include "List.h"
#include "resource.h"

Go to the source code of this file.

Functions

int CALLBACK | Tree_CompareProc (LPARAM, LPARAM, LPARAM)
HWND | Tree_Create (HINSTANCE hInstance, HWND hwndParent, HIMAGELIST hImageList)
void | Tree_DoContextMenu (HWND hwndTreeView, LPPOINT pptScreen)
void | Tree_DoItemMenu (HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen)
void | Tree_EnumObjects (HWND, HTREEITEM, LPSHELLFOLDER, LPITEMIDLIST)
BOOL | Tree_GetChildItems (HWND, HTREEITEM)
BOOL | Tree_GetRootItems (HWND)
void | Tree_Init (HWND hwndTreeView)
LRESULT | Tree_Notify (HWND hWnd, LPARAM lParam)

Function Documentation

int CALLBACK Tree_CompareProc | ( | LPARAM | lParam1,
 |  | LPARAM | lParam2,
 |  | LPARAM | lParamSort
 | ) |  |

Definition at line 415 of file tree.cpp.

{
UNREFERENCED_PARAMETER(lParamSort);

LPITEMINFO  pItem1 = (LPITEMINFO)lParam1;
LPITEMINFO  pItem2 = (LPITEMINFO)lParam2;
HRESULT     hr;

hr = pItem1->pParentFolder->CompareIDs(   0,
                                          pItem1->pidlRel,
                                          pItem2->pidlRel);

if(FAILED(hr))
   return 0;

return (short)SCODE_CODE(GetScode(hr));
}

HWND Tree_Create | ( | HINSTANCE | hInstance,
 |  | HWND | hwndParent,
 |  | HIMAGELIST | hImageList
 | ) |  |

Definition at line 49 of file tree.cpp.

{
DWORD dwStyle;
HWND  hwndTreeView;

dwStyle =   WS_TABSTOP |
            WS_CHILD |
            WS_VISIBLE |
            TVS_HASLINES |
            TVS_HASBUTTONS |
            TVS_NOTOOLTIPS |
            0;

hwndTreeView = CreateWindowEx(   WS_EX_CLIENTEDGE,
                                 WC_TREEVIEW,
                                 NULL,
                                 dwStyle,
                                 0,
                                 0,
                                 0,
                                 0,
                                 hwndParent,
                                 (HMENU)IDC_TREEVIEW,
                                 hInstance,
                                 NULL);

if(!hwndTreeView)
   return NULL;

// attach ImageList to TreeView
if (hImageList)
   TreeView_SetImageList(hwndTreeView, hImageList, 0);

return hwndTreeView;
}

void Tree_DoContextMenu | ( | HWND | hwndTreeView,
 |  | LPPOINT | pptScreen
 | ) |  |

Definition at line 533 of file tree.cpp.

{
TVHITTESTINFO  tvhti;

tvhti.pt = *pptScreen;
ScreenToClient(hwndTreeView, &tvhti.pt);

tvhti.flags = LVHT_NOWHERE;

TreeView_HitTest(hwndTreeView, &tvhti);

if(TVHT_ONITEM & tvhti.flags)
   {
   Tree_DoItemMenu(hwndTreeView, tvhti.hItem , pptScreen);
   }
else
   {
   //the tree doesn't support background menus
   }
}

void Tree_DoItemMenu | ( | HWND | hwndTreeView,
 |  | HTREEITEM | hItem,
 |  | LPPOINT | pptScreen
 | ) |  |

Definition at line 439 of file tree.cpp.

{
TVITEM   tvItem;

ZeroMemory(&tvItem, sizeof(tvItem));
tvItem.mask = TVIF_PARAM;
tvItem.hItem = hItem;

if(TreeView_GetItem(hwndTreeView, &tvItem))
   {
   HWND           hwndParent = GetParent(hwndTreeView);
   HRESULT        hr;
   LPITEMINFO     pInfo = (LPITEMINFO)tvItem.lParam;
   IContextMenu   *pcm;
   IShellFolder   *psfFolder = pInfo->pParentFolder;

   if(!psfFolder)
      {
      SHGetDesktopFolder(&psfFolder);
      }
   else
      {
      psfFolder->AddRef();
      }

   if(psfFolder)
      {
      hr = psfFolder->GetUIObjectOf(   hwndParent,
                                       1,
                                       (LPCITEMIDLIST*)&pInfo->pidlRel,
                                       IID_IContextMenu,
                                       NULL,
                                       (LPVOID*)&pcm);

      if(SUCCEEDED(hr))
         {
         HMENU hPopup;

         hPopup = CreatePopupMenu();
         if(hPopup)
            {
            hr = pcm->QueryContextMenu(hPopup, 0, 1, 0x7fff, CMF_NORMAL | CMF_EXPLORE);

            if(SUCCEEDED(hr))
               {
               pcm->QueryInterface(IID_IContextMenu2, (LPVOID*)&g_pcm2);

               UINT  idCmd;

               idCmd = TrackPopupMenu( hPopup,
                                       TPM_LEFTALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
                                       pptScreen->x,
                                       pptScreen->y,
                                       0,
                                       hwndParent,
                                       NULL);

               if(g_pcm2)
                  {
                  g_pcm2->Release();
                  g_pcm2 = NULL;
                  }

               if(idCmd)
                  {
                  CMINVOKECOMMANDINFO  cmi;
                  cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
                  cmi.fMask = 0;
                  cmi.hwnd = hwndParent;
                  cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - 1);
                  cmi.lpParameters = NULL;
                  cmi.lpDirectory = NULL;
                  cmi.nShow = SW_SHOWNORMAL;
                  cmi.dwHotKey = 0;
                  cmi.hIcon = NULL;
                  hr = pcm->InvokeCommand(&cmi);
                  }
               }
            }

         pcm->Release();
         }

      psfFolder->Release();
      }
   }
}

void Tree_EnumObjects | ( | HWND | hwndTreeView,
 |  | HTREEITEM | hParentItem,
 |  | LPSHELLFOLDER | pParentFolder,
 |  | LPITEMIDLIST | pidlParent
 | ) |  |

Definition at line 341 of file tree.cpp.

{
LPENUMIDLIST   pEnum;

if(SUCCEEDED(pParentFolder->EnumObjects(NULL, SHCONTF_FOLDERS, &pEnum)))
   {
   LPITEMIDLIST   pidlTemp;
   DWORD          dwFetched = 1;
   LPITEMINFO     pItem;

   //enumerate the item's PIDLs
   while(S_OK == (pEnum->Next(1, &pidlTemp, &dwFetched)) && dwFetched)
      {
      TVITEM         tvItem;
      TVINSERTSTRUCT tvInsert;
      DWORD          dwAttribs;

      ZeroMemory(&tvItem, sizeof(tvItem));

      //fill in the TV_ITEM structure for this item
      tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;

      //AddRef the parent folder so it's pointer stays valid
      pParentFolder->AddRef();

      //put the private information in the lParam
      pItem = (LPITEMINFO)GlobalAlloc(GPTR, sizeof(ITEMINFO));

      pItem->pidlRel = pidlTemp;
      pItem->pidlFQ = Pidl_Concatenate(pidlParent, pidlTemp);

      pItem->pParentFolder = pParentFolder;
      tvItem.lParam = (LPARAM)pItem;

      //text and images are done on a callback basis
      tvItem.pszText = LPSTR_TEXTCALLBACK;
      tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;

      //determine if the item has children
      dwAttribs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_DISPLAYATTRMASK | SFGAO_CANRENAME;
      pParentFolder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &dwAttribs);
      tvItem.cChildren = (dwAttribs & SFGAO_HASSUBFOLDER);

      //determine if the item is shared
      if(dwAttribs & SFGAO_SHARE)
         {
         tvItem.mask |= TVIF_STATE;
         tvItem.stateMask |= TVIS_OVERLAYMASK;
         tvItem.state |= INDEXTOOVERLAYMASK(1); //1 is the index for the shared overlay image
         }

      //fill in the TV_INSERTSTRUCT structure for this item
      tvInsert.item = tvItem;
      tvInsert.hInsertAfter = TVI_LAST;
      tvInsert.hParent = hParentItem;

      TreeView_InsertItem(hwndTreeView, &tvInsert);

      dwFetched = 0;
      }

   pEnum->Release();
   }
}

BOOL Tree_GetChildItems | ( | HWND | hwndTreeView,
 |  | HTREEITEM | hParentItem
 | ) |  |

Definition at line 277 of file tree.cpp.

{
TVITEM         tvItem;
LPITEMINFO     pItem;
LPSHELLFOLDER  pParentFolder = NULL;
HRESULT        hr;
HCURSOR        hCursor;
TV_SORTCB      tvSort;

//get the parent item's pidl
ZeroMemory(&tvItem, sizeof(tvItem));
tvItem.mask = TVIF_PARAM;
tvItem.hItem = hParentItem;
if(!TreeView_GetItem(hwndTreeView, &tvItem))
   return FALSE;

//change the cursor
hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));

//turn redawing off in the TreeView. This will speed things up as we add items
SendMessage(hwndTreeView, WM_SETREDRAW, FALSE, 0);

pItem = (LPITEMINFO)tvItem.lParam;

//if the parent folder is NULL, then we are at the root of the namespace, so the parent of this item is the desktop folder
if(!pItem->pParentFolder)
   {
   hr = SHGetDesktopFolder(&pParentFolder);
   }
//otherwise we need to get the IShellFolder for this item
else
   {
   hr = pItem->pParentFolder->BindToObject(pItem->pidlRel, NULL, IID_IShellFolder, (LPVOID*)&pParentFolder);
   }

if(FAILED(hr))
   return FALSE;

Tree_EnumObjects(hwndTreeView, hParentItem, pParentFolder, pItem->pidlFQ);

//sort the new items
tvSort.hParent = hParentItem;
tvSort.lpfnCompare = Tree_CompareProc;
tvSort.lParam = 0;
TreeView_SortChildrenCB(hwndTreeView, &tvSort, 0);

//turn redawing back on in the TreeView
SendMessage(hwndTreeView, WM_SETREDRAW, TRUE, 0);
//UpdateWindow(hwndTreeView);

pParentFolder->Release();

SetCursor(hCursor);

return TRUE;
}

BOOL Tree_GetRootItems ( HWND hwndTreeView )

Definition at line 217 of file tree.cpp.

{
LPITEMIDLIST      pidl;

if(SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl)))
   {
   TV_ITEM           tvItem;
   TV_INSERTSTRUCT   tvInsert;
   LPSHELLFOLDER     pDesktop;
   HTREEITEM         hParentItem;
   LPITEMINFO        pItem;

   //get the desktop's IShellFolder
   if(FAILED(SHGetDesktopFolder(&pDesktop)))
      return FALSE;

   //fill in the TVITEM structure for this item
   tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;

   //put the private information in the lParam
   pItem = (LPITEMINFO)GlobalAlloc(GPTR, sizeof(ITEMINFO));
   pItem->pidlRel = pidl;
   pItem->pidlFQ = Pidl_Copy(pidl);

   //the desktop doesn't have a parent folder, so make this NULL
   pItem->pParentFolder = NULL;
   tvItem.lParam = (LPARAM)pItem;

   //text and images are done on a callback basis
   tvItem.pszText = LPSTR_TEXTCALLBACK;
   tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;

   //assume the desktop has children
   tvItem.cChildren = TRUE;

   //fill in the TV_INSERTSTRUCT structure for this item
   tvInsert.item = tvItem;
   tvInsert.hInsertAfter = TVI_LAST;
   tvInsert.hParent = TVI_ROOT;

   //add the item
   hParentItem = TreeView_InsertItem(hwndTreeView, &tvInsert);

   //go ahead and expand this item
   TreeView_Expand(hwndTreeView, hParentItem, TVE_EXPAND);

   pDesktop->Release();

   return TRUE;
   }

return FALSE;
}

void Tree_Init ( HWND hwndTreeView )

Definition at line 91 of file tree.cpp.

{
//empty the list
TreeView_DeleteAllItems(hwndTreeView);

Tree_GetRootItems(hwndTreeView);

TreeView_SetScrollTime(hwndTreeView, 100);
}

LRESULT Tree_Notify | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 107 of file tree.cpp.

{
LPNMHDR  lpnmh = (LPNMHDR) lParam;
HWND     hwndTreeView = GetDlgItem(hWnd, IDC_TREEVIEW);

switch(lpnmh->code)
   {
   case TVN_GETDISPINFO:
      {
      LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)lpdi->item.lParam;

      //do we need to supply the text?
      if(lpdi->item.mask & TVIF_TEXT)
         {
         SHFILEINFO     sfi;

         //get the display name of the item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_DISPLAYNAME))
            {
            lstrcpyn(lpdi->item.pszText, sfi.szDisplayName, lpdi->item.cchTextMax);
            }
         }

      //do we need to supply the unselected image?
      if(lpdi->item.mask & TVIF_IMAGE)
         {
         SHFILEINFO     sfi;

         //get the unselected image for this item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_LINKOVERLAY))
            {
            lpdi->item.iImage = sfi.iIcon;
            }
         }

      //do we need to supply the selected image?
      if(lpdi->item.mask & TVIF_SELECTEDIMAGE)
         {
         SHFILEINFO     sfi;

         //get the selected image for this item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON))
            {
            lpdi->item.iSelectedImage = sfi.iIcon;
            }
         }
      }
      break;

   case TVN_ITEMEXPANDING:
      {
      LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;

      switch(pnmtv->action)
         {
         case TVE_EXPAND:
            Tree_GetChildItems(hwndTreeView, pnmtv->itemNew.hItem);
            break;

         case TVE_COLLAPSE:
            //remove all of the items from this node
            TreeView_Expand(hwndTreeView, pnmtv->itemNew.hItem, TVE_COLLAPSE | TVE_COLLAPSERESET);
            break;
         }
      }
      break;

   case TVN_DELETEITEM:
      {
      LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)pnmtv->itemOld.lParam;
      LPMALLOC       pMalloc;

      if(SUCCEEDED(SHGetMalloc(&pMalloc)))
         {
         //free up the pidls that we allocated
         Pidl_Free(pItem->pidlFQ);
         Pidl_Free(pItem->pidlRel);

         pMalloc->Release();
         }

      //this may be NULL if this is the root item
      if(pItem->pParentFolder)
         pItem->pParentFolder->Release();

      GlobalFree((HGLOBAL)pItem);
      }
      break;

   case TVN_SELCHANGED:
      {
      LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;
      LPITEMINFO pItem = (LPITEMINFO)pnmtv->itemNew.lParam;

      List_DisplayFolder(GetDlgItem(hWnd, IDC_LISTVIEW), pItem);
      }
      break;
   }

return 0;
}

Generated on Wed Nov 13 2024 16:53:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/tree.h File Reference

  • WinUI
  • Shell
  • EnumDesk
Functions

tree.h File Reference

#include <windows.h>

Go to the source code of this file.

Functions

HWND | Tree_Create (HINSTANCE, HWND, HIMAGELIST)
void | Tree_DoContextMenu (HWND, LPPOINT)
void | Tree_Init (HWND)
LRESULT | Tree_Notify (HWND, LPARAM)

Function Documentation

HWND Tree_Create | ( | HINSTANCE | ,
 |  | HWND | ,
 |  | HIMAGELIST |
 | ) |  |

Definition at line 49 of file tree.cpp.

{
DWORD dwStyle;
HWND  hwndTreeView;

dwStyle =   WS_TABSTOP |
            WS_CHILD |
            WS_VISIBLE |
            TVS_HASLINES |
            TVS_HASBUTTONS |
            TVS_NOTOOLTIPS |
            0;

hwndTreeView = CreateWindowEx(   WS_EX_CLIENTEDGE,
                                 WC_TREEVIEW,
                                 NULL,
                                 dwStyle,
                                 0,
                                 0,
                                 0,
                                 0,
                                 hwndParent,
                                 (HMENU)IDC_TREEVIEW,
                                 hInstance,
                                 NULL);

if(!hwndTreeView)
   return NULL;

// attach ImageList to TreeView
if (hImageList)
   TreeView_SetImageList(hwndTreeView, hImageList, 0);

return hwndTreeView;
}

void Tree_DoContextMenu | ( | HWND | ,
 |  | LPPOINT |
 | ) |  |

Definition at line 533 of file tree.cpp.

{
TVHITTESTINFO  tvhti;

tvhti.pt = *pptScreen;
ScreenToClient(hwndTreeView, &tvhti.pt);

tvhti.flags = LVHT_NOWHERE;

TreeView_HitTest(hwndTreeView, &tvhti);

if(TVHT_ONITEM & tvhti.flags)
   {
   Tree_DoItemMenu(hwndTreeView, tvhti.hItem , pptScreen);
   }
else
   {
   //the tree doesn't support background menus
   }
}

void Tree_Init ( HWND )

Definition at line 91 of file tree.cpp.

{
//empty the list
TreeView_DeleteAllItems(hwndTreeView);

Tree_GetRootItems(hwndTreeView);

TreeView_SetScrollTime(hwndTreeView, 100);
}

LRESULT Tree_Notify | ( | HWND | ,
 |  | LPARAM |
 | ) |  |

Definition at line 107 of file tree.cpp.

{
LPNMHDR  lpnmh = (LPNMHDR) lParam;
HWND     hwndTreeView = GetDlgItem(hWnd, IDC_TREEVIEW);

switch(lpnmh->code)
   {
   case TVN_GETDISPINFO:
      {
      LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)lpdi->item.lParam;

      //do we need to supply the text?
      if(lpdi->item.mask & TVIF_TEXT)
         {
         SHFILEINFO     sfi;

         //get the display name of the item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_DISPLAYNAME))
            {
            lstrcpyn(lpdi->item.pszText, sfi.szDisplayName, lpdi->item.cchTextMax);
            }
         }

      //do we need to supply the unselected image?
      if(lpdi->item.mask & TVIF_IMAGE)
         {
         SHFILEINFO     sfi;

         //get the unselected image for this item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_LINKOVERLAY))
            {
            lpdi->item.iImage = sfi.iIcon;
            }
         }

      //do we need to supply the selected image?
      if(lpdi->item.mask & TVIF_SELECTEDIMAGE)
         {
         SHFILEINFO     sfi;

         //get the selected image for this item
         if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON))
            {
            lpdi->item.iSelectedImage = sfi.iIcon;
            }
         }
      }
      break;

   case TVN_ITEMEXPANDING:
      {
      LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;

      switch(pnmtv->action)
         {
         case TVE_EXPAND:
            Tree_GetChildItems(hwndTreeView, pnmtv->itemNew.hItem);
            break;

         case TVE_COLLAPSE:
            //remove all of the items from this node
            TreeView_Expand(hwndTreeView, pnmtv->itemNew.hItem, TVE_COLLAPSE | TVE_COLLAPSERESET);
            break;
         }
      }
      break;

   case TVN_DELETEITEM:
      {
      LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;
      LPITEMINFO     pItem = (LPITEMINFO)pnmtv->itemOld.lParam;
      LPMALLOC       pMalloc;

      if(SUCCEEDED(SHGetMalloc(&pMalloc)))
         {
         //free up the pidls that we allocated
         Pidl_Free(pItem->pidlFQ);
         Pidl_Free(pItem->pidlRel);

         pMalloc->Release();
         }

      //this may be NULL if this is the root item
      if(pItem->pParentFolder)
         pItem->pParentFolder->Release();

      GlobalFree((HGLOBAL)pItem);
      }
      break;

   case TVN_SELCHANGED:
      {
      LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;
      LPITEMINFO pItem = (LPITEMINFO)pnmtv->itemNew.lParam;

      List_DisplayFolder(GetDlgItem(hWnd, IDC_LISTVIEW), pItem);
      }
      break;
   }

return 0;
}

Generated on Wed Nov 13 2024 16:53:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/Fakemenu/fakemenu.c File Reference

  • WinUI
  • Shell
  • Fakemenu
Classes | Defines | Typedefs | Functions | Variables

fakemenu.c File Reference

#include "FakeMenu.h"
#include <multimon.h>

Go to the source code of this file.

Classes

struct | COLORPICKSTATE

Defines

#define | CCLRPREDEF 16
#define | COMPILE_MULTIMON_STUBS
#define | CXFAKEMENU 100
#define | CYCOLOR 16

Typedefs

typedef struct COLORPICKSTATE | COLORPICKSTATE
typedef struct COLORPICKSTATE * | PCOLORPICKSTATE

Functions

void | ColorPick_ChangeSel (PCOLORPICKSTATE pcps, HWND hwnd, int iSel)
void | ColorPick_ChooseLocation (HWND hwnd, int x, int y, int cx, int cy, LPPOINT ppt)
void | ColorPick_GetColorRect (LPRECT prc, int iColor)
LRESULT | ColorPick_OnCreate (HWND hwnd, LPCREATESTRUCT pcs)
void | ColorPick_OnKeyDown (PCOLORPICKSTATE pcps, HWND hwnd, WPARAM vk)
void | ColorPick_OnLButtonUp (PCOLORPICKSTATE pcps, HWND hwnd, int x, int y)
void | ColorPick_OnMouseMove (PCOLORPICKSTATE pcps, HWND hwnd, int x, int y)
void | ColorPick_OnPaint (PCOLORPICKSTATE pcps, HWND hwnd)
int | ColorPick_Popup (HWND hwndOwner, int x, int y)
LRESULT CALLBACK | ColorPick_WndProc (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
void | FakeMenuDemo_OnContextMenu (HWND hwnd, int x, int y)
void | FakeMenuDemo_OnEraseBkgnd (HWND hwnd, HDC hdc)
LRESULT CALLBACK | FakeMenuDemo_WndProc (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
void | InitClasses (void)
int WINAPI | WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)

Variables

const COLORREF | c_rgclrPredef [CCLRPREDEF]
HBRUSH | g_hbrColor
HINSTANCE | g_hinst

Define Documentation

#define CCLRPREDEF 16

Definition at line 66 of file fakemenu.c.

#define COMPILE_MULTIMON_STUBS

Definition at line 21 of file fakemenu.c.

#define CXFAKEMENU 100

Definition at line 111 of file fakemenu.c.

#define CYCOLOR 16

Definition at line 110 of file fakemenu.c.

Typedef Documentation

typedef struct COLORPICKSTATE COLORPICKSTATE
typedef struct COLORPICKSTATE * PCOLORPICKSTATE

Function Documentation

void ColorPick_ChangeSel | ( | PCOLORPICKSTATE | pcps,
 |  | HWND | hwnd,
 |  | int | iSel
 | ) |  |

Definition at line 219 of file fakemenu.c.

{
    /*
     *  If the selection changed, then
     *  repaint the items that need repainting.
     */
    if (pcps->iSel != iSel) {
        RECT rc;

        if (pcps->iSel >= 0) {
            ColorPick_GetColorRect(&rc, pcps->iSel);
            InvalidateRect(hwnd, &rc, TRUE);
        }

        pcps->iSel = iSel;
        if (pcps->iSel >= 0) {
            ColorPick_GetColorRect(&rc, pcps->iSel);
            InvalidateRect(hwnd, &rc, TRUE);
        }

    }
}

void ColorPick_ChooseLocation | ( | HWND | hwnd,
 |  | int | x,
 |  | int | y,
 |  | int | cx,
 |  | int | cy,
 |  | LPPOINT | ppt
 | ) |  |

Definition at line 408 of file fakemenu.c.

{
    HMONITOR hmon;
    MONITORINFO minf;

    /*
     *  First get the dimensions of the monitor that contains (x, y).
     */
    ppt->x = x;
    ppt->y = y;

    hmon = MonitorFromPoint(*ppt, MONITOR_DEFAULTTONULL);

    /*
     *  If (x, y) is not on any monitor, then use the monitor that
     *  the owner window is on.
     */
    if (hmon == NULL) {
        hmon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
    }

    minf.cbSize = sizeof(minf);
    GetMonitorInfo(hmon, &minf);

    /*
     *  Now slide things around until they fit.
     */

    /*
     *  If too high, then slide down.
     */
    if (ppt->y < minf.rcMonitor.top) {
        ppt->y = minf.rcMonitor.top;
    }

    /*
     *  If too far left, then slide right.
     */
    if (ppt->x < minf.rcMonitor.left) {
        ppt->x = minf.rcMonitor.left;
    }

    /*
     *  If too low, then slide up.
     */
    if (ppt->y > minf.rcMonitor.bottom - cy) {
        ppt->y = minf.rcMonitor.bottom - cy;
    }

    /*
     *  If too far right, then flip left.
     */
    if (ppt->x > minf.rcMonitor.right - cx) {
        ppt->x = ppt->x - cx;
    }
}

void ColorPick_GetColorRect | ( | LPRECT | prc,
 |  | int | iColor
 | ) |  |

Definition at line 122 of file fakemenu.c.

{
    /*
     *  Build the "menu" item rect.
     */
    prc->left = 0;
    prc->right = CXFAKEMENU;
    prc->top = iColor * CYCOLOR;
    prc->bottom = prc->top + CYCOLOR;

}

LRESULT ColorPick_OnCreate | ( | HWND | hwnd,
 |  | LPCREATESTRUCT | pcs
 | ) |  |

Definition at line 143 of file fakemenu.c.

{
    SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)(pcs->lpCreateParams));

    return 0;
}

void ColorPick_OnKeyDown | ( | PCOLORPICKSTATE | pcps,
 |  | HWND | hwnd,
 |  | WPARAM | vk
 | ) |  |

Definition at line 307 of file fakemenu.c.

{
    switch (vk) {

    case VK_ESCAPE:
        pcps->fDone = TRUE;         /* Abandoned */
        break;

    case VK_RETURN:
        pcps->iResult = pcps->iSel; /* Accept current selection */
        pcps->fDone = TRUE;
        break;

    case VK_UP:
        if (pcps->iSel > 0) {
            ColorPick_ChangeSel(pcps, hwnd, pcps->iSel - 1);
        } else {
            ColorPick_ChangeSel(pcps, hwnd, CCLRPREDEF - 1);
        }
        break;

    case VK_DOWN:
        if (pcps->iSel + 1 < CCLRPREDEF) {
            ColorPick_ChangeSel(pcps, hwnd, pcps->iSel + 1);
        } else {
            ColorPick_ChangeSel(pcps, hwnd, 0);
        }
        break;

    }
}

void ColorPick_OnLButtonUp | ( | PCOLORPICKSTATE | pcps,
 |  | HWND | hwnd,
 |  | int | x,
 |  | int | y
 | ) |  |

Definition at line 275 of file fakemenu.c.

{
    /*
     *  First track to the final location, in case the user
     *  moves the mouse REALLY FAST and immediately lets go.
     */
    ColorPick_OnMouseMove(pcps, hwnd, x, y);

    /*
     *  Set the result to the current selection.
     */
    pcps->iResult = pcps->iSel;

    /*
     *  And tell the message loop that we're done.
     */
    pcps->fDone = TRUE;
}

void ColorPick_OnMouseMove | ( | PCOLORPICKSTATE | pcps,
 |  | HWND | hwnd,
 |  | int | x,
 |  | int | y
 | ) |  |

Definition at line 251 of file fakemenu.c.

{
    int iSel;

    if (x >= 0 && x < CXFAKEMENU &&
        y >= 0 && y < CCLRPREDEF * CYCOLOR) {
        iSel = y / CYCOLOR;
    } else {
        iSel = -1;
    }

    ColorPick_ChangeSel(pcps, hwnd, iSel);

}

void ColorPick_OnPaint | ( | PCOLORPICKSTATE | pcps,
 |  | HWND | hwnd
 | ) |  |

Definition at line 160 of file fakemenu.c.

{
    PAINTSTRUCT ps;
    HDC hdc;

    hdc = BeginPaint(hwnd, &ps);
    if (hdc) {
        RECT rcClient;
        int iColor;

        GetClientRect(hwnd, &rcClient);

        /*
         *  For each of our predefined colors, draw it in a little
         *  rectangular region, leaving some border so the user can
         *  see if the item is highlighted or not.
         */
        for (iColor = 0; iColor < CCLRPREDEF; iColor++) {
            RECT rc;
            HBRUSH hbr;

            /*
             *  Build the "menu" item rect.
             */
            ColorPick_GetColorRect(&rc, iColor);

            /*
             *  If the item is highlighted, then draw a highlighted
             *  background.
             */
            if (iColor == pcps->iSel) {
                FillRect(hdc, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
            }

            /*
             *  Now shrink the rectangle by an edge and fill the
             *  rest with the color of the item itself.
             */
            InflateRect(&rc, -GetSystemMetrics(SM_CXEDGE),
                             -GetSystemMetrics(SM_CYEDGE));

            hbr = CreateSolidBrush(c_rgclrPredef[iColor]);
            FillRect(hdc, &rc, hbr);
            DeleteObject(hbr);
        }

        EndPaint(hwnd, &ps);
    }
}

int ColorPick_Popup | ( | HWND | hwndOwner,
 |  | int | x,
 |  | int | y
 | ) |  |

Definition at line 477 of file fakemenu.c.

{
    COLORPICKSTATE cps;
    HWND hwndPopup, hwndActive;
    RECT rc;
    DWORD dwStyle, dwExStyle;
    MSG msg;
    POINT pt;
    int cx, cy;

    /*
     *  Early check:  We must be on same thread as the owner
     *  so we can see its mouse and keyboard messages when we
     *  set capture to it.
     */
    if (GetCurrentThreadId() != GetWindowThreadProcessId(hwndOwner, NULL)) {
        /*
         *  Error: Menu must be on same thread as parent window.
         */
        return -1;
    }

    cps.fDone = FALSE;          /* Not done yet */
    cps.iSel = -1;              /* No initial selection */
    cps.iResult = -1;           /* No result */
    cps.hwndOwner = hwndOwner;  /* Owner window */

    /*
     *  The style and extended style we want to use.
     */

    dwStyle = WS_POPUP | WS_BORDER;
    dwExStyle = WS_EX_TOOLWINDOW |      /* So it doesn't show up in taskbar */
                WS_EX_DLGMODALFRAME |   /* Get the edges right */
                WS_EX_WINDOWEDGE |
                WS_EX_TOPMOST;          /* So it isn't obscured */

    /*
     *  We want a client area of size (CXFAKEMENU, CCLRPREDEF * CYCOLOR),
     *  so use AdjustWindowRectEx to figure out what window rect will
     *  give us a client rect of that size.
     */
    rc.left = 0;
    rc.top = 0;
    rc.right = CXFAKEMENU;
    rc.bottom = CCLRPREDEF * CYCOLOR;
    AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);

    /*
     *  Now find a proper home for the window that won't go off
     *  the screen or straddle two monitors.
     */
    cx = rc.right - rc.left;
    cy = rc.bottom - rc.top;
    ColorPick_ChooseLocation(hwndOwner, x, y, cx, cy, &pt);

    hwndPopup = CreateWindowEx(
        dwExStyle,                      /* Extended style */
        "ColorPick",                    /* Class Name */
        "",                             /* Title */
        dwStyle,                        /* Style */
        pt.x, pt.y,                     /* Position */
        cx, cy,                         /* Size */
        hwndOwner,                      /* Parent */
        NULL,                           /* No menu */
        g_hinst,                        /* Instance */
        &cps);                          /* Starting parameters */

    /*
     *  Show the window but don't activate it!
     */
    ShowWindow(hwndPopup, SW_SHOWNOACTIVATE);

    /*
     *  We want to receive all mouse messages, but since
     *  only the active window can capture the mouse,
     *  we have to set the capture to our owner window,
     *  and then steal the mouse messages out from under him.
     */
    SetCapture(hwndOwner);

    /*
     *  Go into a message loop that filters all the messages
     *  it receives and routes the interesting ones to the
     *  color picker window.
     */
    while (GetMessage(&msg, NULL, 0, 0)) {

        /*
         *  Something may have happened that caused us to stop.
         *  If so, then stop.
         */
        if (cps.fDone) break;

        /*
         *  If our owner stopped being the active window
         *  (e.g., the user Alt+Tab'd to another window
         *  in the meantime), then stop.
         */
        hwndActive = GetActiveWindow();
        if (hwndActive != hwndOwner &&
            !IsChild(hwndActive, hwndOwner)) break;
        if (GetCapture() != hwndOwner) break;

        /*
         *  At this point, we get to snoop at all input messages
         *  before they get dispatched.  This allows us to
         *  route all input to our popup window even if really
         *  belongs to somebody else.
         *
         *  All mouse messages are remunged and directed at our
         *  popup menu.  If the mouse message arrives as client
         *  coordinates, then we have to convert it from the
         *  client coordinates of the original target to the
         *  client coordinates of the new target.
         */

        switch (msg.message) {

        /*
         *  These mouse messages arrive in client coordinates,
         *  so in addition to stealing the message, we also
         *  need to convert the coordinates.
         */
        case WM_MOUSEMOVE:
        case WM_LBUTTONDOWN:
        case WM_LBUTTONUP:
        case WM_LBUTTONDBLCLK:
        case WM_RBUTTONDOWN:
        case WM_RBUTTONUP:
        case WM_RBUTTONDBLCLK:
        case WM_MBUTTONDOWN:
        case WM_MBUTTONUP:
        case WM_MBUTTONDBLCLK:
            pt.x = (short)LOWORD(msg.lParam);
            pt.y = (short)HIWORD(msg.lParam);
            MapWindowPoints(msg.hwnd, hwndPopup, &pt, 1);
            msg.lParam = MAKELPARAM(pt.x, pt.y);
            msg.hwnd = hwndPopup;
            break;

        /*
         *  These mouse messages arrive in screen coordinates,
         *  so we just need to steal the message.
         */
        case WM_NCMOUSEMOVE:
        case WM_NCLBUTTONDOWN:
        case WM_NCLBUTTONUP:
        case WM_NCLBUTTONDBLCLK:
        case WM_NCRBUTTONDOWN:
        case WM_NCRBUTTONUP:
        case WM_NCRBUTTONDBLCLK:
        case WM_NCMBUTTONDOWN:
        case WM_NCMBUTTONUP:
        case WM_NCMBUTTONDBLCLK:
            msg.hwnd = hwndPopup;
            break;

        /*
         *  Steal all keyboard messages, too.
         */
        case WM_KEYDOWN:
        case WM_KEYUP:
        case WM_CHAR:
        case WM_DEADCHAR:
        case WM_SYSKEYDOWN:
        case WM_SYSKEYUP:
        case WM_SYSCHAR:
        case WM_SYSDEADCHAR:
            msg.hwnd = hwndPopup;
            break;

        }

        TranslateMessage(&msg);
        DispatchMessage(&msg);

        /*
         *  Something may have happened that caused us to stop.
         *  If so, then stop.
         */
        if (cps.fDone) break;

        /*
         *  If our owner stopped being the active window
         *  (e.g., the user Alt+Tab'd to another window
         *  in the meantime), then stop.
         */
        hwndActive = GetActiveWindow();
        if (hwndActive != hwndOwner &&
            !IsChild(hwndActive, hwndOwner)) break;
        if (GetCapture() != hwndOwner) break;

    }

    /*
     *  Clean up the capture we created.
     */
    ReleaseCapture();

    DestroyWindow(hwndPopup);

    /*
     *  If we got a WM_QUIT message, then re-post it so the caller's
     *  message loop will see it.
     */
    if (msg.message == WM_QUIT) {
        PostQuitMessage((int)msg.wParam);
    }

    return cps.iResult;
}

LRESULT CALLBACK ColorPick_WndProc | ( | HWND | hwnd,
 |  | UINT | uiMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 349 of file fakemenu.c.

{
    PCOLORPICKSTATE pcps = (PCOLORPICKSTATE)GetWindowLongPtr(hwnd, GWLP_USERDATA);

    switch (uiMsg) {

    case WM_CREATE:
        return ColorPick_OnCreate(hwnd, (LPCREATESTRUCT)lParam);

    case WM_MOUSEMOVE:
        ColorPick_OnMouseMove(pcps, hwnd, (short)LOWORD(lParam),
                                          (short)HIWORD(lParam));
        break;

    case WM_LBUTTONUP:
        ColorPick_OnLButtonUp(pcps, hwnd, (short)LOWORD(lParam),
                                          (short)HIWORD(lParam));
        break;

    case WM_SYSKEYDOWN:
    case WM_KEYDOWN:
        ColorPick_OnKeyDown(pcps, hwnd, wParam);
        break;

    /*
     *  Do not activate when somebody clicks on me.
     */
    case WM_MOUSEACTIVATE:
        return MA_NOACTIVATE;

    case WM_PAINT:
        ColorPick_OnPaint(pcps, hwnd);
        return 0;

    }

    return DefWindowProc(hwnd, uiMsg, wParam, lParam);
}

void FakeMenuDemo_OnContextMenu | ( | HWND | hwnd,
 |  | int | x,
 |  | int | y
 | ) |  |

Definition at line 717 of file fakemenu.c.

{
    int iColor;

    /*
     *  If the coordinates are (-1, -1), then the user typed Shift+F10,
     *  so we should pretend the user clicked at client (0, 0).
     */
    if (x == -1 && y == -1) {
        POINT pt;
        pt.x = 0;
        pt.y = 0;
        ClientToScreen(hwnd, &pt);
        x = pt.x;
        y = pt.y;
    }

    iColor = ColorPick_Popup(hwnd, x, y);

    /*
     *  If the user picked a color, then change to that color.
     */
    if (iColor >= 0) {
        DeleteObject(g_hbrColor);
        g_hbrColor = CreateSolidBrush(c_rgclrPredef[iColor]);
        InvalidateRect(hwnd, NULL, TRUE);
    }
}

void FakeMenuDemo_OnEraseBkgnd | ( | HWND | hwnd,
 |  | HDC | hdc
 | ) |  |

Definition at line 699 of file fakemenu.c.

{
    RECT rc;

    GetClientRect(hwnd, &rc);
    FillRect(hdc, &rc, g_hbrColor);
}

LRESULT CALLBACK FakeMenuDemo_WndProc | ( | HWND | hwnd,
 |  | UINT | uiMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 755 of file fakemenu.c.

{
    switch (uiMsg) {

    case WM_ERASEBKGND:
        FakeMenuDemo_OnEraseBkgnd(hwnd, (HDC)wParam);
        return TRUE;

    case WM_CONTEXTMENU:
        FakeMenuDemo_OnContextMenu(hwnd, (short)LOWORD(lParam),
                                         (short)HIWORD(lParam));
        return 0;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    }

    return DefWindowProc(hwnd, uiMsg, wParam, lParam);
}

void InitClasses ( void )

Definition at line 789 of file fakemenu.c.

{
    WNDCLASS wc;

    wc.style = 0;
    wc.lpfnWndProc = ColorPick_WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = g_hinst;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
    wc.lpszMenuName = NULL;
    wc.lpszClassName = "ColorPick";

    RegisterClass(&wc);

    wc.style = 0;
    wc.lpfnWndProc = FakeMenuDemo_WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = g_hinst;
    wc.hIcon = NULL;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = NULL;            /* Background color is dynamic */
    wc.lpszMenuName = NULL;
    wc.lpszClassName = "FakeMenuDemo";

    RegisterClass(&wc);

}

int WINAPI WinMain | ( | HINSTANCE | hinst,
 |  | HINSTANCE | hinstPrev,
 |  | LPSTR | pszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 832 of file fakemenu.c.

{
    MSG msg;
    HWND hwnd;

    g_hinst = hinst;

    InitClasses();

    /*
     *  Start out white.
     */
    g_hbrColor = CreateSolidBrush(RGB(0xFF, 0xFF, 0xFF));

    hwnd = CreateWindow(
        "FakeMenuDemo",                 /* Class Name */
        "Fake Menu Demo - Right-click in window to change color", /* Title */
        WS_OVERLAPPEDWINDOW,            /* Style */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
        NULL,                           /* Parent */
        NULL,                           /* No menu */
        hinst,                          /* Instance */
        0);                             /* No special parameters */

    ShowWindow(hwnd, nCmdShow);

    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return 0;
}

Variable Documentation

const COLORREF c_rgclrPredef[CCLRPREDEF]
Initial value:
 {
    RGB(0x00, 0x00, 0x00),
    RGB(0x80, 0x00, 0x00),
    RGB(0x00, 0x80, 0x00),
    RGB(0x80, 0x80, 0x00),
    RGB(0x00, 0x00, 0x80),
    RGB(0x80, 0x00, 0x80),
    RGB(0x00, 0x80, 0x80),
    RGB(0x80, 0x80, 0x80),
    RGB(0xC0, 0xC0, 0xC0),
    RGB(0xFF, 0x00, 0x00),
    RGB(0x00, 0xFF, 0x00),
    RGB(0xFF, 0xFF, 0x00),
    RGB(0x00, 0x00, 0xFF),
    RGB(0xFF, 0x00, 0xFF),
    RGB(0x00, 0xFF, 0xFF),
    RGB(0xFF, 0xFF, 0xFF),
}

Definition at line 68 of file fakemenu.c.

HBRUSH g_hbrColor

Definition at line 57 of file fakemenu.c.

HINSTANCE g_hinst

Definition at line 56 of file fakemenu.c.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/Fakemenu/fakemenu.h File Reference

  • WinUI
  • Shell
  • Fakemenu
Defines

fakemenu.h File Reference

#include <windows.h>

Go to the source code of this file.

Defines

#define STRICT

Define Documentation

#define STRICT

Definition at line 5 of file fakemenu.h.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/CStatHlp.Cpp File Reference

  • WinUI
  • Shell
  • FileView

CStatHlp.Cpp File Reference

#include "fileview.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/CStatHlp.h File Reference

  • WinUI
  • Shell
  • FileView
Classes | Typedefs

CStatHlp.h File Reference

Go to the source code of this file.

Classes

class | CStatusHelper
struct | tagPOPUPMENUMAP
struct | tagSTATMESSAGEMAP

Typedefs

typedef CStatusHelper * | PCStatusHelper
typedef struct tagPOPUPMENUMAP | POPUPMENUMAP
typedef struct tagPOPUPMENUMAP * | PPOPUPMENUMAP
typedef struct tagSTATMESSAGEMAP * | PSTATMESSAGEMAP
typedef struct tagSTATMESSAGEMAP | STATMESSAGEMAP

Typedef Documentation

typedef CStatusHelper* PCStatusHelper

Definition at line 86 of file CStatHlp.h.

typedef struct tagPOPUPMENUMAP POPUPMENUMAP
typedef struct tagPOPUPMENUMAP * PPOPUPMENUMAP
typedef struct tagSTATMESSAGEMAP * PSTATMESSAGEMAP
typedef struct tagSTATMESSAGEMAP STATMESSAGEMAP
Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/CStrTabl.Cpp File Reference

  • WinUI
  • Shell
  • FileView

CStrTabl.Cpp File Reference

#include "fileview.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/CStrTabl.h File Reference

  • WinUI
  • Shell
  • FileView
Classes | Typedefs

CStrTabl.h File Reference

Go to the source code of this file.

Classes

class | CStringTable

Typedefs

typedef CStringTable * | PCStringTable

Typedef Documentation

typedef CStringTable* PCStringTable

Definition at line 47 of file CStrTabl.h.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/DbgOut.h File Reference

  • WinUI
  • Shell
  • FileView
Defines

DbgOut.h File Reference

Go to the source code of this file.

Defines

#define | D(x)
#define | ODS(x)
#define | ODSlu(f, lu)
#define | ODSsz(f, s)
#define | ODSszlu(f, s, lu)
#define | ODSszu(f, s, u)
#define | ODSu(f, u)

Define Documentation

#define D ( x )

Definition at line 77 of file DbgOut.h.

#define ODS ( x )

Definition at line 78 of file DbgOut.h.

#define ODSlu | ( | f,
 |  | lu
 | ) |

Definition at line 82 of file DbgOut.h.

#define ODSsz | ( | f,
 |  | s
 | ) |

Definition at line 80 of file DbgOut.h.

#define ODSszlu | ( | f,
 |  | s,
 |  | lu
 | ) |

Definition at line 84 of file DbgOut.h.

#define ODSszu | ( | f,
 |  | s,
 |  | u
 | ) |

Definition at line 83 of file DbgOut.h.

#define ODSu | ( | f,
 |  | u
 | ) |

Definition at line 81 of file DbgOut.h.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FileView.Cpp File Reference

  • WinUI
  • Shell
  • FileView
Defines | Functions | Variables

FileView.Cpp File Reference

#include "fileview.h"
#include <initguid.h>
#include <shlguid.h>
#include "fvtext.h"

Go to the source code of this file.

Defines

#define | INITGUIDS

Functions

STDAPI | DllCanUnloadNow (void)
HRESULT PASCAL | DllGetClassObject (REFCLSID rclsid, REFIID riid, PPVOID ppv)
BOOL WINAPI | DllMain (HINSTANCE hInstance, ULONG ulReason, PVOID pvReserved)
void PASCAL | ObjectDestroyed (void)
STDMETHODIMP_ (ULONG) CFVClassFactory

Variables

ULONG | g_cLock = 0
ULONG | g_cObj = 0
HINSTANCE | g_hInst

Define Documentation

#define INITGUIDS

Definition at line 23 of file FileView.Cpp.

Function Documentation

STDAPI DllCanUnloadNow ( void )

Definition at line 117 of file FileView.Cpp.

    {
    SCODE   sc;

    //Our answer is whether there are any object or locks
    sc=(0L==g_cObj && 0L==g_cLock) ? S_OK : S_FALSE;
    return ResultFromScode(sc);
    }

HRESULT PASCAL DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | PPVOID | ppv
 | ) |  |

Definition at line 81 of file FileView.Cpp.

    {
    // Warning:: The shell may not have initialized OLE so
    // do it here to be sure...
    OleInitialize(NULL);

    //MODIFY:  Change CLSID_FileViewerText to your own CLSID
    if (!IsEqualCLSID(rclsid, CLSID_FileViewerText))
        return ResultFromScode(E_FAIL);

    //Check that we can provide the interface
    if (!IsEqualIID(riid, IID_IUnknown)
        && !IsEqualIID(riid, IID_IClassFactory))
        return ResultFromScode(E_NOINTERFACE);

    //Return our IClassFactory for our viewer objects
    *ppv=(LPVOID)new CFVClassFactory();

    if (NULL==*ppv)
        return ResultFromScode(E_OUTOFMEMORY);

    //AddRef the object through any interface we return
    ((LPUNKNOWN)*ppv)->AddRef();

    return NOERROR;
    }

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | ULONG | ulReason,
 |  | PVOID | pvReserved
 | ) |  |

Definition at line 43 of file FileView.Cpp.

    {
    if (DLL_PROCESS_DETACH==ulReason)
        {
        return TRUE;
        }
    else
        {
        if (DLL_PROCESS_ATTACH!=ulReason)
            return TRUE;
        }

    g_hInst=hInstance;
    return TRUE;
    }

void PASCAL ObjectDestroyed ( void )

Definition at line 132 of file FileView.Cpp.

    {
    g_cObj--;
    return;
    }

STDMETHODIMP_ ( ULONG )

Definition at line 192 of file FileView.Cpp.

    {
    ULONG           cRefT;

    cRefT=--m_cRef;

    if (0L==m_cRef)
        delete this;

    return cRefT;
    }

Variable Documentation

ULONG g_cLock = 0

Definition at line 32 of file FileView.Cpp.

ULONG g_cObj = 0

Definition at line 31 of file FileView.Cpp.

HINSTANCE g_hInst

Definition at line 35 of file FileView.Cpp.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FileView.h File Reference

  • WinUI
  • Shell
  • FileView
Classes | Defines | Typedefs | Functions

FileView.h File Reference

#include <windows.h>
#include <stdlib.h>
#include <ole2.h>
#include <commdlg.h>
#include <shlobj.h>
#include "dbgout.h"
#include "cstrtabl.h"
#include "cstathlp.h"
#include "fvtext.h"
#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Classes

class | CFVClassFactory

Defines

#define | INC_OLE2

Typedefs

typedef CFVClassFactory * | PCFVClassFactory
typedef void(WINAPI * | PFNDESTROYED )(void)
typedef LPVOID * | PPVOID

Functions

STDAPI | DllCanUnloadNow (void)
HRESULT PASCAL | DllGetClassObject (REFCLSID, REFIID, PPVOID)
void WINAPI | ObjectDestroyed (void)

Define Documentation

#define INC_OLE2

Definition at line 23 of file FileView.h.

Typedef Documentation

typedef CFVClassFactory* PCFVClassFactory

Definition at line 82 of file FileView.h.

typedef void(WINAPI * PFNDESTROYED)(void)

Definition at line 48 of file FileView.h.

typedef LPVOID* PPVOID

Definition at line 38 of file FileView.h.

Function Documentation

STDAPI DllCanUnloadNow ( void )

Definition at line 53 of file ComSpyAudit.Cpp.

{
  return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

HRESULT PASCAL DllGetClassObject | ( | REFCLSID | ,
 |  | REFIID | ,
 |  | PPVOID |
 | ) |  |

Definition at line 209 of file ConServe.Cpp.

{
  HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
  IUnknown* pCob = NULL;

  if (CLSID_DllSndBall == rclsid)
  {
    hr = E_OUTOFMEMORY;
    pCob = new CFBall(NULL, g_pServer);
  }

  if (NULL != pCob)
  {
    g_pServer->ObjectsUp();
    hr = pCob->QueryInterface(riid, ppv);
    if (FAILED(hr))
    {
      g_pServer->ObjectsDown();
      DELETE_POINTER(pCob);
    }
  }

  return hr;
}

void WINAPI ObjectDestroyed ( void )

Definition at line 277 of file Server.Cxx.

{
    if(InterlockedDecrement(&g_ObjectCount) == 0)
    {
        //When the last object is released, post a quit message.
        PostQuitMessage(0);
    }
}

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FVInit.Cpp File Reference

  • WinUI
  • Shell
  • FileView
Functions

FVInit.Cpp File Reference

#include "fileview.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CFileViewer

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 329 of file FVInit.Cpp.

    {
    ULONG       cRefT;

    cRefT=--m_cRef;

    ODSu("CFileViewer::Release Count=%d", cRefT);

    if (0L==m_cRef)
  {
   // Tell the server that an object is going away
   // so it can shut down if appropriate.  (See FILEVIEW.CPP
   // for the ObjectDestroyed function).
  if (NULL!=m_pfnDestroy)
      (*m_pfnDestroy)();

  delete this;
  }

    return cRefT;
    }

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FVProc.Cpp File Reference

  • WinUI
  • Shell
  • FileView
Functions

FVProc.Cpp File Reference

#include "fileview.h"

Go to the source code of this file.

Functions

BOOL APIENTRY | AboutProc (HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI | FileViewerFrameProc (HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI | ViewportWndProc (HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)

Function Documentation

BOOL APIENTRY AboutProc | ( | HWND | hDlg,
 |  | UINT | iMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 279 of file FVProc.Cpp.

    {
    switch (iMsg)
        {
        case WM_INITDIALOG:
            return TRUE;

        case WM_COMMAND:
            switch (LOWORD(wParam))
                {
                case IDOK:
                    EndDialog(hDlg, TRUE);
                    break;
                }
            break;

        case WM_CLOSE:
            EndDialog(hDlg, FALSE);
            break;
        }
    return FALSE;
    }

LRESULT WINAPI FileViewerFrameProc | ( | HWND | hWnd,
 |  | UINT | iMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 27 of file FVProc.Cpp.

    {
    LONG_PTR        lTemp;
    PCFileViewer    pObj;
    LPTOOLTIPTEXT   pTTT;

    //This is invalid until WM_NCCREATE is called.
    pObj=(PCFileViewer)GetWindowLongPtr(hWnd, FVWL_OBJECTPOINTER);

    switch (iMsg)
        {
        case WM_NCCREATE:
            //Save the the CFileViewer object pointer we're passed
            lTemp=(LONG_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams;
            SetWindowLongPtr(hWnd, FVWL_OBJECTPOINTER, lTemp);
            return DefWindowProc(hWnd, iMsg, wParam, lParam);

        case WM_COMMAND:
            pObj->OnCommand(LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
            break;

        case WM_NOTIFY:
             // The toolbar, created with TBSTYLE_TOOLTIPS, will
             // send notifications for each button.  lParam will
             // be an LPTOOLTIPTEXT in such a case, but even when
             // the structure is something different it will always
             // have a hdr field of type NMHDR as the first field
             // which we use to see if it comes from the toolbar.
             // The notification we want is TTN_NEEDTEXT.
            pTTT=(LPTOOLTIPTEXT)lParam;

            if (NULL==pTTT)
                return 0L;

            if (TTN_NEEDTEXT==pTTT->hdr.code)
                pTTT->lpszText=pObj->PszToolTip((UINT)(pTTT->hdr.idFrom));

            return 0L;

        case WM_CLOSE:
            DestroyWindow(hWnd);
            break;

    case WM_DESTROY:
            if (NULL != pObj)
            {
                ODSu("FileViewerFrameProc Quit? %u", pObj->m_fPostQuitMsg);
                if (pObj->m_fPostQuitMsg)
                    PostQuitMessage(0);
                pObj->m_fPostQuitMsg = TRUE;    // One shot that it did not...

                if (pObj->m_hWnd == hWnd)
                    pObj->m_hWnd = NULL;        // Don't try to destroy this again...
            }
            break;

        case WM_SIZE:
            //Resize frame tools and viewport
            pObj->ChildrenResize();
            break;

        case WM_MENUSELECT:
            //Win32 Parameters are wItem, wFlags, and hMenu
            pObj->m_pSH->MenuSelect(LOWORD(wParam)
                , HIWORD(wParam), (HMENU)lParam);
            break;

        case WM_DROPFILES:
            // We have a new file dropped on us so we need to pass this
            // information back to the caller of the viewer...
            pObj->DropFiles((HDROP)wParam);
            break;

        default:
            return DefWindowProc(hWnd, iMsg, wParam, lParam);
        }

    return 0L;
    }

LRESULT WINAPI ViewportWndProc | ( | HWND | hWnd,
 |  | UINT | iMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 118 of file FVProc.Cpp.

    {
    LONG_PTR        lTemp;
    PCFileViewer    pObj;
    PAINTSTRUCT     ps;

    //This is invalid until WM_NCCREATE is called.
    pObj=(PCFileViewer)GetWindowLongPtr(hWnd, VPWL_OBJECTPOINTER);

    switch (iMsg)
        {
        case WM_NCCREATE:
            //Save the the CFileViewer object pointer we're passed
            lTemp=(LONG_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams;
            SetWindowLongPtr(hWnd, VPWL_OBJECTPOINTER, lTemp);
            return DefWindowProc(hWnd, iMsg, wParam, lParam);

        case WM_PAINT:
            BeginPaint(hWnd, &ps);

            if (NULL!=pObj->m_hMemText)
                {
                LPSTR       psz;
                RECT        rc;
                HFONT       hFont;

                GetClientRect(hWnd, &rc);

                SetTextColor(ps.hdc, GetSysColor(COLOR_WINDOWTEXT));
                SetBkColor(ps.hdc, GetSysColor(COLOR_WINDOW));
                hFont=(HFONT)SelectObject(ps.hdc, pObj->m_hFont);

                psz=(LPSTR)GlobalLock(pObj->m_hMemText);

                 // We can use the client area rectangle here for
                 // drawing since we also use DT_NOCLIP, so we'll
                 // always draw all over the client area.
                OffsetRect(&rc, -pObj->m_xPos, -pObj->m_yPos);
                DrawText(ps.hdc, psz, -1, &rc, DT_LEFT
                    | DT_NOCLIP| DT_EXPANDTABS);

                GlobalUnlock(pObj->m_hMemText);
                SelectObject(ps.hdc, hFont);
                }
            EndPaint(hWnd, &ps);
            break;

        case WM_MOUSEMOVE:
             // If this message is already displayed, CStatusHelper
             // will just ignore this call and return very fast.
            pObj->m_pSH->MessageDisplay(ID_MSGCHOOSEOPEN);
            break;

        case WM_RBUTTONDOWN:
            {
            HMENU           hMenu, hMenuRes;
            POINT           pt;
            UINT            i, cItems;

            //Load our context menu.
            hMenuRes=LoadMenu(pObj->m_hInst
                , MAKEINTRESOURCE(IDR_MENUVIEWPORT));

            if (NULL==hMenuRes)
                break;

             // Make a copy popup menu because you cannot
             // use a resource-loaded menu with TrackPopupMenu.
            cItems=GetMenuItemCount(hMenuRes);
            hMenu=CreatePopupMenu();

            for (i=0; i < cItems; i++)
                {
                char    szItem[80];
                int     id, uFlags;

                GetMenuString(hMenuRes, i, szItem, sizeof(szItem)
                    , MF_BYPOSITION);
                id=GetMenuItemID(hMenuRes, i);

                uFlags=(0==id) ? MF_SEPARATOR : MF_STRING | MF_ENABLED;
                AppendMenu(hMenu, uFlags, id, szItem);
                }

            DestroyMenu(hMenuRes);

            pt.x=LOWORD(lParam);
            pt.y=HIWORD(lParam);
            ClientToScreen(hWnd, &pt);

            //Messages sent to frame window from this menu.
            TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON
                , pt.x, pt.y, 0, pObj->m_hWnd, NULL);

            DestroyMenu(hMenu);
            }
            break;

        case WM_HSCROLL:
        case WM_VSCROLL:
            {
            int             iTmp;
            UINT            idScroll;
            SCROLLINFO      si;

            idScroll=(WM_HSCROLL==iMsg) ? SB_HORZ : SB_VERT;

            si.cbSize = sizeof(SCROLLINFO);
            si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
            GetScrollInfo(hWnd, idScroll, &si);

            iTmp=si.nPos;

            switch (LOWORD(wParam))
                {
                case SB_LINEUP:     si.nPos -= 20;  break;
                case SB_PAGEUP:     si.nPos -=si.nPage;  break;
                case SB_LINEDOWN:   si.nPos += 20;  break;
                case SB_PAGEDOWN:   si.nPos +=si.nPage;  break;

                case SB_THUMBPOSITION:
                case SB_THUMBTRACK:
                    si.nPos=HIWORD(wParam);
                    break;
                }

            si.nPos=max(si.nMin, min(si.nPos, si.nMax));

            if (si.nPos!=iTmp)
                {
                //Set the new position and scroll the window
                SetScrollPos(hWnd, idScroll, si.nPos, TRUE);

                if (SB_HORZ==idScroll)
                    {
                    pObj->m_xPos=si.nPos;
                    ScrollWindow(hWnd, iTmp-si.nPos, 0, NULL, NULL);
                    }
                else
                    {
                    pObj->m_yPos=si.nPos;
                    ScrollWindow(hWnd, 0, iTmp-si.nPos, NULL, NULL);
                    }

                UpdateWindow(hWnd);
                }
            }
            break;

        default:
            return DefWindowProc(hWnd, iMsg, wParam, lParam);
        }

    return 0L;
    }

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FVText.Cpp File Reference

  • WinUI
  • Shell
  • FileView

FVText.Cpp File Reference

#include "fileview.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FVText.h File Reference

  • WinUI
  • Shell
  • FileView
Classes | Defines | Typedefs | Enumerations | Functions

FVText.h File Reference

Go to the source code of this file.

Classes

class | CFileViewer
class | CImpIFileViewer
class | CImpIPersistFile

Defines

#define | _FVTEXT_H_
#define | CBWNDEXTRAFRAME sizeof(LPVOID)
#define | CBWNDEXTRAVIEWPORT sizeof(LPVOID)
#define | FONTSIZEDELTALARGE 24
#define | FONTSIZEDELTAMEDIUM 8
#define | FONTSIZEDELTASMALL 2
#define | FONTSIZETHRESHOLDLOW 32
#define | FONTSIZETHRESHOLDMAX 120
#define | FONTSIZETHRESHOLDMID 48
#define | FONTSIZETHRESHOLDMIN 4
#define | FVWL_OBJECTPOINTER 0
#define | ID_STATUSBAR 51
#define | ID_TOOLBAR 50
#define | ID_VIEWPORT 52
#define | VPWL_OBJECTPOINTER 0

Typedefs

typedef CFileViewer * | PCFileViewer
typedef class CImpIFileViewer * | PIMPIFILEVIEWER
typedef class CImpIPersistFile * | PIMPIPERSISTFILE

Enumerations

enum | VIEWFONTOPTION { VIEWFONT_SELECT = 0, VIEWFONT_INCREASESIZE, VIEWFONT_DECREASESIZE }

Functions

BOOL APIENTRY | AboutProc (HWND, UINT, WPARAM, LPARAM)
DEFINE_GUID (CLSID_FileViewerText, 0x00021117, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, 0x46)
DEFINE_GUID (CLSID_SampleTextFile, 0x00021116, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, 0x46)
LRESULT WINAPI | FileViewerFrameProc (HWND, UINT, WPARAM, LPARAM)
LRESULT WINAPI | ViewportWndProc (HWND, UINT, WPARAM, LPARAM)

Define Documentation

#define _FVTEXT_H_

Definition at line 28 of file FVText.h.

#define CBWNDEXTRAFRAME sizeof(LPVOID)

Definition at line 41 of file FVText.h.

#define CBWNDEXTRAVIEWPORT sizeof(LPVOID)

Definition at line 51 of file FVText.h.

#define FONTSIZEDELTALARGE 24

Definition at line 90 of file FVText.h.

#define FONTSIZEDELTAMEDIUM 8

Definition at line 89 of file FVText.h.

#define FONTSIZEDELTASMALL 2

Definition at line 88 of file FVText.h.

#define FONTSIZETHRESHOLDLOW 32

Definition at line 85 of file FVText.h.

#define FONTSIZETHRESHOLDMAX 120

Definition at line 87 of file FVText.h.

#define FONTSIZETHRESHOLDMID 48

Definition at line 86 of file FVText.h.

#define FONTSIZETHRESHOLDMIN 4

Definition at line 84 of file FVText.h.

#define FVWL_OBJECTPOINTER 0

Definition at line 42 of file FVText.h.

#define ID_STATUSBAR 51

Definition at line 60 of file FVText.h.

#define ID_TOOLBAR 50

Definition at line 59 of file FVText.h.

#define ID_VIEWPORT 52

Definition at line 61 of file FVText.h.

#define VPWL_OBJECTPOINTER 0

Definition at line 52 of file FVText.h.

Typedef Documentation

typedef CFileViewer* PCFileViewer

Definition at line 197 of file FVText.h.

typedef class CImpIFileViewer* PIMPIFILEVIEWER

Definition at line 34 of file FVText.h.

typedef class CImpIPersistFile* PIMPIPERSISTFILE

Definition at line 31 of file FVText.h.

Enumeration Type Documentation

enum VIEWFONTOPTION
Enumerator:
VIEWFONT_SELECT
VIEWFONT_INCREASESIZE
VIEWFONT_DECREASESIZE

Definition at line 65 of file FVText.h.

    {
    VIEWFONT_SELECT=0,
    VIEWFONT_INCREASESIZE,
    VIEWFONT_DECREASESIZE
    } VIEWFONTOPTION;

Function Documentation

BOOL APIENTRY AboutProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 812 of file Framer.Cpp.

    {
  UNREFERENCED_PARAMETER(lParam);
    switch (iMsg)
        {
        case WM_INITDIALOG:
            return TRUE;

        case WM_COMMAND:
            switch (LOWORD(wParam))
                {
                case IDOK:
                    EndDialog(hDlg, TRUE);
                }
            break;
        }
    return FALSE;
    }

DEFINE_GUID | ( | CLSID_FileViewerText | ,
 |  | 0x00021117 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0xC0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0x46 |
 | ) |  |
DEFINE_GUID | ( | CLSID_SampleTextFile | ,
 |  | 0x00021116 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0xC0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0 | ,
 |  | 0x46 |
 | ) |  |
LRESULT WINAPI FileViewerFrameProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 27 of file FVProc.Cpp.

    {
    LONG_PTR        lTemp;
    PCFileViewer    pObj;
    LPTOOLTIPTEXT   pTTT;

    //This is invalid until WM_NCCREATE is called.
    pObj=(PCFileViewer)GetWindowLongPtr(hWnd, FVWL_OBJECTPOINTER);

    switch (iMsg)
        {
        case WM_NCCREATE:
            //Save the the CFileViewer object pointer we're passed
            lTemp=(LONG_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams;
            SetWindowLongPtr(hWnd, FVWL_OBJECTPOINTER, lTemp);
            return DefWindowProc(hWnd, iMsg, wParam, lParam);

        case WM_COMMAND:
            pObj->OnCommand(LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
            break;

        case WM_NOTIFY:
             // The toolbar, created with TBSTYLE_TOOLTIPS, will
             // send notifications for each button.  lParam will
             // be an LPTOOLTIPTEXT in such a case, but even when
             // the structure is something different it will always
             // have a hdr field of type NMHDR as the first field
             // which we use to see if it comes from the toolbar.
             // The notification we want is TTN_NEEDTEXT.
            pTTT=(LPTOOLTIPTEXT)lParam;

            if (NULL==pTTT)
                return 0L;

            if (TTN_NEEDTEXT==pTTT->hdr.code)
                pTTT->lpszText=pObj->PszToolTip((UINT)(pTTT->hdr.idFrom));

            return 0L;

        case WM_CLOSE:
            DestroyWindow(hWnd);
            break;

    case WM_DESTROY:
            if (NULL != pObj)
            {
                ODSu("FileViewerFrameProc Quit? %u", pObj->m_fPostQuitMsg);
                if (pObj->m_fPostQuitMsg)
                    PostQuitMessage(0);
                pObj->m_fPostQuitMsg = TRUE;    // One shot that it did not...

                if (pObj->m_hWnd == hWnd)
                    pObj->m_hWnd = NULL;        // Don't try to destroy this again...
            }
            break;

        case WM_SIZE:
            //Resize frame tools and viewport
            pObj->ChildrenResize();
            break;

        case WM_MENUSELECT:
            //Win32 Parameters are wItem, wFlags, and hMenu
            pObj->m_pSH->MenuSelect(LOWORD(wParam)
                , HIWORD(wParam), (HMENU)lParam);
            break;

        case WM_DROPFILES:
            // We have a new file dropped on us so we need to pass this
            // information back to the caller of the viewer...
            pObj->DropFiles((HDROP)wParam);
            break;

        default:
            return DefWindowProc(hWnd, iMsg, wParam, lParam);
        }

    return 0L;
    }

LRESULT WINAPI ViewportWndProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 118 of file FVProc.Cpp.

    {
    LONG_PTR        lTemp;
    PCFileViewer    pObj;
    PAINTSTRUCT     ps;

    //This is invalid until WM_NCCREATE is called.
    pObj=(PCFileViewer)GetWindowLongPtr(hWnd, VPWL_OBJECTPOINTER);

    switch (iMsg)
        {
        case WM_NCCREATE:
            //Save the the CFileViewer object pointer we're passed
            lTemp=(LONG_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams;
            SetWindowLongPtr(hWnd, VPWL_OBJECTPOINTER, lTemp);
            return DefWindowProc(hWnd, iMsg, wParam, lParam);

        case WM_PAINT:
            BeginPaint(hWnd, &ps);

            if (NULL!=pObj->m_hMemText)
                {
                LPSTR       psz;
                RECT        rc;
                HFONT       hFont;

                GetClientRect(hWnd, &rc);

                SetTextColor(ps.hdc, GetSysColor(COLOR_WINDOWTEXT));
                SetBkColor(ps.hdc, GetSysColor(COLOR_WINDOW));
                hFont=(HFONT)SelectObject(ps.hdc, pObj->m_hFont);

                psz=(LPSTR)GlobalLock(pObj->m_hMemText);

                 // We can use the client area rectangle here for
                 // drawing since we also use DT_NOCLIP, so we'll
                 // always draw all over the client area.
                OffsetRect(&rc, -pObj->m_xPos, -pObj->m_yPos);
                DrawText(ps.hdc, psz, -1, &rc, DT_LEFT
                    | DT_NOCLIP| DT_EXPANDTABS);

                GlobalUnlock(pObj->m_hMemText);
                SelectObject(ps.hdc, hFont);
                }
            EndPaint(hWnd, &ps);
            break;

        case WM_MOUSEMOVE:
             // If this message is already displayed, CStatusHelper
             // will just ignore this call and return very fast.
            pObj->m_pSH->MessageDisplay(ID_MSGCHOOSEOPEN);
            break;

        case WM_RBUTTONDOWN:
            {
            HMENU           hMenu, hMenuRes;
            POINT           pt;
            UINT            i, cItems;

            //Load our context menu.
            hMenuRes=LoadMenu(pObj->m_hInst
                , MAKEINTRESOURCE(IDR_MENUVIEWPORT));

            if (NULL==hMenuRes)
                break;

             // Make a copy popup menu because you cannot
             // use a resource-loaded menu with TrackPopupMenu.
            cItems=GetMenuItemCount(hMenuRes);
            hMenu=CreatePopupMenu();

            for (i=0; i < cItems; i++)
                {
                char    szItem[80];
                int     id, uFlags;

                GetMenuString(hMenuRes, i, szItem, sizeof(szItem)
                    , MF_BYPOSITION);
                id=GetMenuItemID(hMenuRes, i);

                uFlags=(0==id) ? MF_SEPARATOR : MF_STRING | MF_ENABLED;
                AppendMenu(hMenu, uFlags, id, szItem);
                }

            DestroyMenu(hMenuRes);

            pt.x=LOWORD(lParam);
            pt.y=HIWORD(lParam);
            ClientToScreen(hWnd, &pt);

            //Messages sent to frame window from this menu.
            TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON
                , pt.x, pt.y, 0, pObj->m_hWnd, NULL);

            DestroyMenu(hMenu);
            }
            break;

        case WM_HSCROLL:
        case WM_VSCROLL:
            {
            int             iTmp;
            UINT            idScroll;
            SCROLLINFO      si;

            idScroll=(WM_HSCROLL==iMsg) ? SB_HORZ : SB_VERT;

            si.cbSize = sizeof(SCROLLINFO);
            si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
            GetScrollInfo(hWnd, idScroll, &si);

            iTmp=si.nPos;

            switch (LOWORD(wParam))
                {
                case SB_LINEUP:     si.nPos -= 20;  break;
                case SB_PAGEUP:     si.nPos -=si.nPage;  break;
                case SB_LINEDOWN:   si.nPos += 20;  break;
                case SB_PAGEDOWN:   si.nPos +=si.nPage;  break;

                case SB_THUMBPOSITION:
                case SB_THUMBTRACK:
                    si.nPos=HIWORD(wParam);
                    break;
                }

            si.nPos=max(si.nMin, min(si.nPos, si.nMax));

            if (si.nPos!=iTmp)
                {
                //Set the new position and scroll the window
                SetScrollPos(hWnd, idScroll, si.nPos, TRUE);

                if (SB_HORZ==idScroll)
                    {
                    pObj->m_xPos=si.nPos;
                    ScrollWindow(hWnd, iTmp-si.nPos, 0, NULL, NULL);
                    }
                else
                    {
                    pObj->m_yPos=si.nPos;
                    ScrollWindow(hWnd, 0, iTmp-si.nPos, NULL, NULL);
                    }

                UpdateWindow(hWnd);
                }
            }
            break;

        default:
            return DefWindowProc(hWnd, iMsg, wParam, lParam);
        }

    return 0L;
    }

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/IFileVW.Cpp File Reference

  • WinUI
  • Shell
  • FileView
Functions

IFileVW.Cpp File Reference

#include "fileview.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CImpIFileViewer

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 64 of file IFileVW.Cpp.

    {
    return m_pUnkOuter->Release();
    }

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/IPerFile.Cpp File Reference

  • WinUI
  • Shell
  • FileView
Functions

IPerFile.Cpp File Reference

#include "fileview.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (ULONG) CImpIPersistFile

Function Documentation

STDMETHODIMP_ ( ULONG )

Definition at line 66 of file IPerFile.Cpp.

    {
    return m_pUnkOuter->Release();
    }

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/Resource.h File Reference

  • WinUI
  • Shell
  • FileView
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | CCHSTATUSMSGMAX 80
#define | CCHSTRINGMAX 40
#define | CTBBITMAPS 3
#define | CTBBUTTONS 4
#define | ID_MENUFILE 1003
#define | ID_MENUHELP 1005
#define | ID_MENUMAX ID_MENUHELP
#define | ID_MENUMIN ID_MENUFILE
#define | ID_MENUSYS 1002
#define | ID_MENUVIEW 1004
#define | ID_MSGCHOOSEOPEN 1008
#define | ID_MSGEMPTY 1000
#define | ID_MSGREADY 1001
#define | ID_TIPFONTDEC 1007
#define | ID_TIPFONTINC 1006
#define | IDB_TOOLS 1
#define | IDBT_FONTSIZEDECREASE 2
#define | IDBT_FONTSIZEINCREASE 1
#define | IDBT_OPENAS 0
#define | IDD_ABOUT 1
#define | IDM_FILEEXIT 120
#define | IDM_FILEOPENAS 100
#define | IDM_FILEPAGESETUP 110
#define | IDM_FILEPRINT 111
#define | IDM_HELPABOUT 301
#define | IDM_HELPCONTENTS 300
#define | IDM_VIEWFONT 210
#define | IDM_VIEWFONTDECREASE 212
#define | IDM_VIEWFONTINCREASE 211
#define | IDM_VIEWREPLACE 223
#define | IDM_VIEWSTATUSBAR 201
#define | IDM_VIEWTOOLBAR 200
#define | IDR_ACCELERATORS 1
#define | IDR_MENU 1
#define | IDR_MENUVIEWPORT 2
#define | IDR_STATMESSAGEMAP 1
#define | IDS_CAPTION (IDS_MIN+2)
#define | IDS_CLASSFRAME (IDS_MIN+0)
#define | IDS_CLASSVIEWPORT (IDS_MIN+1)
#define | IDS_DOCUMENTTYPE (IDS_MIN+3)
#define | IDS_MAX (IDS_MIN+7)
#define | IDS_MIN 0
#define | IDS_MSGCHOOSEOPEN (IDS_STATUSMSGMIN+24)
#define | IDS_MSGEMPTY (IDS_STATUSMSGMIN+0)
#define | IDS_MSGFILE (IDS_STATUSMSGMIN+10)
#define | IDS_MSGFILEEXIT (IDS_STATUSMSGMIN+14)
#define | IDS_MSGFILEOPENAS (IDS_STATUSMSGMIN+11)
#define | IDS_MSGFILEPAGESETUP (IDS_STATUSMSGMIN+12)
#define | IDS_MSGFILEPRINT (IDS_STATUSMSGMIN+13)
#define | IDS_MSGHELP (IDS_STATUSMSGMIN+19)
#define | IDS_MSGHELPABOUT (IDS_STATUSMSGMIN+21)
#define | IDS_MSGHELPCONTENTS (IDS_STATUSMSGMIN+20)
#define | IDS_MSGREADY (IDS_STATUSMSGMIN+1)
#define | IDS_MSGSYS (IDS_STATUSMSGMIN+2)
#define | IDS_MSGSYSCLOSE (IDS_STATUSMSGMIN+8)
#define | IDS_MSGSYSMAXIMIZE (IDS_STATUSMSGMIN+7)
#define | IDS_MSGSYSMINIMIZE (IDS_STATUSMSGMIN+6)
#define | IDS_MSGSYSMOVE (IDS_STATUSMSGMIN+4)
#define | IDS_MSGSYSRESTORE (IDS_STATUSMSGMIN+3)
#define | IDS_MSGSYSSIZE (IDS_STATUSMSGMIN+5)
#define | IDS_MSGSYSTASKLIST (IDS_STATUSMSGMIN+9)
#define | IDS_MSGTIPFONTDEC (IDS_STATUSMSGMIN+23)
#define | IDS_MSGTIPFONTINC (IDS_STATUSMSGMIN+22)
#define | IDS_MSGVIEW (IDS_STATUSMSGMIN+15)
#define | IDS_MSGVIEWFONT (IDS_STATUSMSGMIN+18)
#define | IDS_MSGVIEWSTATUSBAR (IDS_STATUSMSGMIN+17)
#define | IDS_MSGVIEWTOOLBAR (IDS_STATUSMSGMIN+16)
#define | IDS_NOHELP (IDS_MIN+4)
#define | IDS_STATUSMSGMAX (IDS_STATUSMSGMIN+24)
#define | IDS_STATUSMSGMIN 32
#define | IDS_TOOLTIPFONTDEC (IDS_MIN+7)
#define | IDS_TOOLTIPFONTINC (IDS_MIN+6)
#define | IDS_TOOLTIPOPENAS (IDS_MIN+5)

Define Documentation

#define CCHSTATUSMSGMAX 80

Definition at line 108 of file Resource.h.

#define CCHSTRINGMAX 40

Definition at line 73 of file Resource.h.

#define CTBBITMAPS 3

Definition at line 34 of file Resource.h.

#define CTBBUTTONS 4

Definition at line 33 of file Resource.h.

#define ID_MENUFILE 1003

Definition at line 122 of file Resource.h.

#define ID_MENUHELP 1005

Definition at line 124 of file Resource.h.

#define ID_MENUMAX ID_MENUHELP

Definition at line 131 of file Resource.h.

#define ID_MENUMIN ID_MENUFILE

Definition at line 130 of file Resource.h.

#define ID_MENUSYS 1002

Definition at line 121 of file Resource.h.

#define ID_MENUVIEW 1004

Definition at line 123 of file Resource.h.

#define ID_MSGCHOOSEOPEN 1008

Definition at line 127 of file Resource.h.

#define ID_MSGEMPTY 1000

Definition at line 119 of file Resource.h.

#define ID_MSGREADY 1001

Definition at line 120 of file Resource.h.

#define ID_TIPFONTDEC 1007

Definition at line 126 of file Resource.h.

#define ID_TIPFONTINC 1006

Definition at line 125 of file Resource.h.

#define IDB_TOOLS 1

Definition at line 24 of file Resource.h.

#define IDBT_FONTSIZEDECREASE 2

Definition at line 31 of file Resource.h.

#define IDBT_FONTSIZEINCREASE 1

Definition at line 30 of file Resource.h.

#define IDBT_OPENAS 0

Definition at line 29 of file Resource.h.

#define IDD_ABOUT 1

Definition at line 25 of file Resource.h.

#define IDM_FILEEXIT 120

Definition at line 42 of file Resource.h.

#define IDM_FILEOPENAS 100

Definition at line 39 of file Resource.h.

#define IDM_FILEPAGESETUP 110

Definition at line 40 of file Resource.h.

#define IDM_FILEPRINT 111

Definition at line 41 of file Resource.h.

#define IDM_HELPABOUT 301

Definition at line 52 of file Resource.h.

#define IDM_HELPCONTENTS 300

Definition at line 51 of file Resource.h.

#define IDM_VIEWFONT 210

Definition at line 46 of file Resource.h.

#define IDM_VIEWFONTDECREASE 212

Definition at line 48 of file Resource.h.

#define IDM_VIEWFONTINCREASE 211

Definition at line 47 of file Resource.h.

#define IDM_VIEWREPLACE 223

Definition at line 49 of file Resource.h.

#define IDM_VIEWSTATUSBAR 201

Definition at line 45 of file Resource.h.

#define IDM_VIEWTOOLBAR 200

Definition at line 44 of file Resource.h.

#define IDR_ACCELERATORS 1

Definition at line 22 of file Resource.h.

#define IDR_MENU 1

Definition at line 20 of file Resource.h.

#define IDR_MENUVIEWPORT 2

Definition at line 21 of file Resource.h.

#define IDR_STATMESSAGEMAP 1

Definition at line 23 of file Resource.h.

#define IDS_CAPTION (IDS_MIN+2)

Definition at line 63 of file Resource.h.

#define IDS_CLASSFRAME (IDS_MIN+0)

Definition at line 61 of file Resource.h.

#define IDS_CLASSVIEWPORT (IDS_MIN+1)

Definition at line 62 of file Resource.h.

#define IDS_DOCUMENTTYPE (IDS_MIN+3)

Definition at line 64 of file Resource.h.

#define IDS_MAX (IDS_MIN+7)

Definition at line 70 of file Resource.h.

#define IDS_MIN 0

Definition at line 59 of file Resource.h.

#define IDS_MSGCHOOSEOPEN (IDS_STATUSMSGMIN+24)

Definition at line 104 of file Resource.h.

#define IDS_MSGEMPTY (IDS_STATUSMSGMIN+0)

Definition at line 80 of file Resource.h.

#define IDS_MSGFILE (IDS_STATUSMSGMIN+10)

Definition at line 90 of file Resource.h.

#define IDS_MSGFILEEXIT (IDS_STATUSMSGMIN+14)

Definition at line 94 of file Resource.h.

#define IDS_MSGFILEOPENAS (IDS_STATUSMSGMIN+11)

Definition at line 91 of file Resource.h.

#define IDS_MSGFILEPAGESETUP (IDS_STATUSMSGMIN+12)

Definition at line 92 of file Resource.h.

#define IDS_MSGFILEPRINT (IDS_STATUSMSGMIN+13)

Definition at line 93 of file Resource.h.

#define IDS_MSGHELP (IDS_STATUSMSGMIN+19)

Definition at line 99 of file Resource.h.

#define IDS_MSGHELPABOUT (IDS_STATUSMSGMIN+21)

Definition at line 101 of file Resource.h.

#define IDS_MSGHELPCONTENTS (IDS_STATUSMSGMIN+20)

Definition at line 100 of file Resource.h.

#define IDS_MSGREADY (IDS_STATUSMSGMIN+1)

Definition at line 81 of file Resource.h.

#define IDS_MSGSYS (IDS_STATUSMSGMIN+2)

Definition at line 82 of file Resource.h.

#define IDS_MSGSYSCLOSE (IDS_STATUSMSGMIN+8)

Definition at line 88 of file Resource.h.

#define IDS_MSGSYSMAXIMIZE (IDS_STATUSMSGMIN+7)

Definition at line 87 of file Resource.h.

#define IDS_MSGSYSMINIMIZE (IDS_STATUSMSGMIN+6)

Definition at line 86 of file Resource.h.

#define IDS_MSGSYSMOVE (IDS_STATUSMSGMIN+4)

Definition at line 84 of file Resource.h.

#define IDS_MSGSYSRESTORE (IDS_STATUSMSGMIN+3)

Definition at line 83 of file Resource.h.

#define IDS_MSGSYSSIZE (IDS_STATUSMSGMIN+5)

Definition at line 85 of file Resource.h.

#define IDS_MSGSYSTASKLIST (IDS_STATUSMSGMIN+9)

Definition at line 89 of file Resource.h.

#define IDS_MSGTIPFONTDEC (IDS_STATUSMSGMIN+23)

Definition at line 103 of file Resource.h.

#define IDS_MSGTIPFONTINC (IDS_STATUSMSGMIN+22)

Definition at line 102 of file Resource.h.

#define IDS_MSGVIEW (IDS_STATUSMSGMIN+15)

Definition at line 95 of file Resource.h.

#define IDS_MSGVIEWFONT (IDS_STATUSMSGMIN+18)

Definition at line 98 of file Resource.h.

#define IDS_MSGVIEWSTATUSBAR (IDS_STATUSMSGMIN+17)

Definition at line 97 of file Resource.h.

#define IDS_MSGVIEWTOOLBAR (IDS_STATUSMSGMIN+16)

Definition at line 96 of file Resource.h.

#define IDS_NOHELP (IDS_MIN+4)

Definition at line 65 of file Resource.h.

#define IDS_STATUSMSGMAX (IDS_STATUSMSGMIN+24)

Definition at line 106 of file Resource.h.

#define IDS_STATUSMSGMIN 32

Definition at line 78 of file Resource.h.

#define IDS_TOOLTIPFONTDEC (IDS_MIN+7)

Definition at line 68 of file Resource.h.

#define IDS_TOOLTIPFONTINC (IDS_MIN+6)

Definition at line 67 of file Resource.h.

#define IDS_TOOLTIPOPENAS (IDS_MIN+5)

Definition at line 66 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ClsFact.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Functions

ClsFact.Cpp File Reference

#include "ClsFact.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CClassFactory

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 107 of file ClsFact.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ClsFact.h File Reference

  • WinUI
  • Shell
  • SampView
Classes

ClsFact.h File Reference

#include <windows.h>
#include "ShlFldr.h"
#include "ShlView.h"

Go to the source code of this file.

Classes

class CClassFactory
Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Commands.h File Reference

  • WinUI
  • Shell
  • SampView
Defines

Commands.h File Reference

Go to the source code of this file.

Defines

#define | IDM_COPY 9
#define | IDM_CUT 10
#define | IDM_DELETE 8
#define | IDM_EXPLORE 1
#define | IDM_LAST 17
#define | IDM_MODIFY_DATA 6
#define | IDM_NEW 3
#define | IDM_NEW_FOLDER 4
#define | IDM_NEW_ITEM 5
#define | IDM_OPEN 2
#define | IDM_PASTE 11
#define | IDM_RENAME 7
#define | IDM_SEPARATOR 12
#define | IDM_VIEW 13
#define | IDM_VIEW_DETAILS 17
#define | IDM_VIEW_LARGE 14
#define | IDM_VIEW_LIST 16
#define | IDM_VIEW_SMALL 15

Define Documentation

#define IDM_COPY 9

Definition at line 30 of file Commands.h.

#define IDM_CUT 10

Definition at line 31 of file Commands.h.

#define IDM_DELETE 8

Definition at line 29 of file Commands.h.

#define IDM_EXPLORE 1

Definition at line 22 of file Commands.h.

#define IDM_LAST 17

Definition at line 40 of file Commands.h.

#define IDM_MODIFY_DATA 6

Definition at line 27 of file Commands.h.

#define IDM_NEW 3

Definition at line 24 of file Commands.h.

#define IDM_NEW_FOLDER 4

Definition at line 25 of file Commands.h.

#define IDM_NEW_ITEM 5

Definition at line 26 of file Commands.h.

#define IDM_OPEN 2

Definition at line 23 of file Commands.h.

#define IDM_PASTE 11

Definition at line 32 of file Commands.h.

#define IDM_RENAME 7

Definition at line 28 of file Commands.h.

#define IDM_SEPARATOR 12

Definition at line 33 of file Commands.h.

#define IDM_VIEW 13

Definition at line 34 of file Commands.h.

#define IDM_VIEW_DETAILS 17

Definition at line 38 of file Commands.h.

#define IDM_VIEW_LARGE 14

Definition at line 35 of file Commands.h.

#define IDM_VIEW_LIST 16

Definition at line 37 of file Commands.h.

#define IDM_VIEW_SMALL 15

Definition at line 36 of file Commands.h.

Generated on Wed Nov 13 2024 16:55:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ContMenu.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines | Typedefs | Functions | Variables

ContMenu.Cpp File Reference

#include "ContMenu.h"
#include "Commands.h"
#include "ShlView.h"
#include <ShellApi.h>

Go to the source code of this file.

Classes

struct | VERBMAPPING

Defines

#define | MAX_VERB 64

Typedefs

typedef struct VERBMAPPING * | LPVERBMAPPING

Functions

STDMETHODIMP_ (DWORD) CContextMenu

Variables

VERBMAPPING g_VerbMap []

Define Documentation

#define MAX_VERB 64

Definition at line 31 of file ContMenu.Cpp.

Typedef Documentation

typedef struct VERBMAPPING* LPVERBMAPPING

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 182 of file ContMenu.Cpp.

{
  if(--m_ObjRefCount == 0)
  {
      delete this;
      return 0;
  }
  return m_ObjRefCount;
}

Variable Documentation

VERBMAPPING g_VerbMap[]
Initial value:
 {   TEXT("explore"),     IDM_EXPLORE,
                              TEXT("open"),        IDM_OPEN,
                              TEXT("delete"),      IDM_DELETE,
                              TEXT("rename"),      IDM_RENAME,
                              TEXT("copy"),        IDM_COPY,
                              TEXT("cut"),         IDM_CUT,
                              TEXT("paste"),       IDM_PASTE,
                              TEXT("NewFolder"),   IDM_NEW_FOLDER,
                              TEXT("NewItem"),     IDM_NEW_ITEM,
                              TEXT("ModifyData"),  IDM_MODIFY_DATA,
                              TEXT(""),            (DWORD)-1
                              }

Definition at line 38 of file ContMenu.Cpp.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ContMenu.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines

ContMenu.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#include "ShlFldr.h"
#include "PidlMgr.h"
#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Classes

class | CContextMenu

Defines

#define | MYCMF_MULTISELECT 0x00010000

Define Documentation

#define MYCMF_MULTISELECT 0x00010000

Definition at line 77 of file ContMenu.h.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DataObj.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Functions

DataObj.Cpp File Reference

#include "DataObj.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CDataObject

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 160 of file DataObj.Cpp.

{
  if(--m_ObjRefCount == 0)
  {
      delete this;
    return 0;
  }
    return m_ObjRefCount;

}

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DataObj.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines

DataObj.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#include "ShlFldr.h"
#include "PidlMgr.h"
#include "resource.h"

Go to the source code of this file.

Classes

class | CDataObject

Defines

#define | SETDefFormatEtc(fe, cf, med)

Define Documentation

#define SETDefFormatEtc | ( | fe,
 |  | cf,
 |  | med
 | ) |
Value:
{\
  (fe).cfFormat=(CLIPFORMAT)cf; \
  (fe).dwAspect=DVASPECT_CONTENT; \
  (fe).ptd=NULL;\
  (fe).tymed=med;\
  (fe).lindex=-1;\
  };

Definition at line 28 of file DataObj.h.

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DropSrc.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Functions

DropSrc.Cpp File Reference

#include "DropSrc.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CDropSource

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 101 of file DropSrc.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DropSrc.h File Reference

  • WinUI
  • Shell
  • SampView
Classes

DropSrc.h File Reference

#include <windows.h>
#include "Utility.h"

Go to the source code of this file.

Classes

class CDropSource
Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DropTgt.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Functions

DropTgt.Cpp File Reference

#include "DropTgt.h"
#include "Utility.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CDropTarget

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 138 of file DropTgt.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DropTgt.h File Reference

  • WinUI
  • Shell
  • SampView
Classes

DropTgt.h File Reference

#include <windows.h>
#include <ole2.h>
#include <shlobj.h>
#include "ShlFldr.h"
#include "PidlMgr.h"

Go to the source code of this file.

Classes

class CDropTarget
Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Enumidl.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Functions

Enumidl.Cpp File Reference

#include "EnumIDL.h"
#include "ShlFldr.h"
#include <shlwapi.h>

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CEnumIDList

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 136 of file Enumidl.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Enumidl.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Typedefs

Enumidl.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "PidlMgr.h"
#include "Utility.h"

Go to the source code of this file.

Classes

class | CEnumIDList
struct | tagENUMLIST

Typedefs

typedef struct tagENUMLIST | ENUMLIST
typedef struct tagENUMLIST * | LPENUMLIST

Typedef Documentation

typedef struct tagENUMLIST ENUMLIST
typedef struct tagENUMLIST* LPENUMLIST
Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ExtrIcon.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Functions

ExtrIcon.Cpp File Reference

#include "ExtrIcon.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CExtractIcon

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 121 of file ExtrIcon.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ExtrIcon.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines

ExtrIcon.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "PidlMgr.h"
#include "Utility.h"

Go to the source code of this file.

Classes

class | CExtractIcon

Defines

#define | ICON_INDEX_FOLDER 1
#define | ICON_INDEX_FOLDEROPEN 2
#define | ICON_INDEX_ITEM 0

Define Documentation

#define ICON_INDEX_FOLDER 1

Definition at line 58 of file ExtrIcon.h.

#define ICON_INDEX_FOLDEROPEN 2

Definition at line 59 of file ExtrIcon.h.

#define ICON_INDEX_ITEM 0

Definition at line 57 of file ExtrIcon.h.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Guid.h File Reference

  • WinUI
  • Shell
  • SampView
Functions

Guid.h File Reference

Go to the source code of this file.

Functions

DEFINE_GUID (CLSID_SampleNameSpace, 0xe2cb71d0, 0xd2dc, 0x11d1, 0xb0, 0x22, 0x0, 0x60, 0x8, 0x93, 0xad, 0x51)

Function Documentation

DEFINE_GUID | ( | CLSID_SampleNameSpace | ,
 |  | 0xe2cb71d0 | ,
 |  | 0xd2dc | ,
 |  | 0x11d1 | ,
 |  | 0xb0 | ,
 |  | 0x22 | ,
 |  | 0x0 | ,
 |  | 0x60 | ,
 |  | 0x8 | ,
 |  | 0x93 | ,
 |  | 0xad | ,
 |  | 0x51 |
 | ) |  |
Generated on Wed Nov 13 2024 16:54:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/PidlMgr.Cpp File Reference

  • WinUI
  • Shell
  • SampView

PidlMgr.Cpp File Reference

#include "PidlMgr.h"
#include "ShlFldr.h"
#include "Guid.h"
#include "resource.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/PidlMgr.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines | Typedefs

PidlMgr.h File Reference

#include <windows.h>
#include <shlobj.h>

Go to the source code of this file.

Classes

class | CPidlMgr
struct | tagPIDLDATA

Defines

#define | MAX_DATA 128
#define | MAX_NAME MAX_PATH

Typedefs

typedef struct tagPIDLDATA * | LPPIDLDATA
typedef struct tagPIDLDATA | PIDLDATA

Define Documentation

#define MAX_DATA 128

Definition at line 29 of file PidlMgr.h.

#define MAX_NAME MAX_PATH

Definition at line 28 of file PidlMgr.h.

Typedef Documentation

typedef struct tagPIDLDATA* LPPIDLDATA
typedef struct tagPIDLDATA PIDLDATA
Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Resource.h File Reference

  • WinUI
  • Shell
  • SampView
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_DATA 1001
#define | IDD_ITEMDATADLG 102
#define | IDI_MAINICON 100
#define | IDR_ACCELS 101
#define | IDS_COLUMN1 1
#define | IDS_COLUMN2 2
#define | IDS_COPY 21
#define | IDS_CUT 20
#define | IDS_DELETE 22
#define | IDS_EXPLORE 17
#define | IDS_EXT_TITLE 5
#define | IDS_FOLDER 7
#define | IDS_FOLDER_DATA 25
#define | IDS_ITEM 24
#define | IDS_MI_COMMAND 4
#define | IDS_MI_FILEITEM 6
#define | IDS_MODIFY_DATA 23
#define | IDS_NEW 13
#define | IDS_NEW_FOLDER 14
#define | IDS_NEW_ITEM 15
#define | IDS_OPEN 18
#define | IDS_PASTE 16
#define | IDS_RENAME 19
#define | IDS_TB_COMMAND 3
#define | IDS_VIEW 8
#define | IDS_VIEW_DETAILS 12
#define | IDS_VIEW_LARGE 9
#define | IDS_VIEW_LIST 11
#define | IDS_VIEW_SMALL 10

Define Documentation

#define IDC_DATA 1001

Definition at line 33 of file Resource.h.

#define IDD_ITEMDATADLG 102

Definition at line 32 of file Resource.h.

#define IDI_MAINICON 100

Definition at line 30 of file Resource.h.

#define IDR_ACCELS 101

Definition at line 31 of file Resource.h.

#define IDS_COLUMN1 1

Definition at line 5 of file Resource.h.

#define IDS_COLUMN2 2

Definition at line 6 of file Resource.h.

#define IDS_COPY 21

Definition at line 25 of file Resource.h.

#define IDS_CUT 20

Definition at line 24 of file Resource.h.

#define IDS_DELETE 22

Definition at line 26 of file Resource.h.

#define IDS_EXPLORE 17

Definition at line 21 of file Resource.h.

#define IDS_EXT_TITLE 5

Definition at line 9 of file Resource.h.

#define IDS_FOLDER 7

Definition at line 11 of file Resource.h.

#define IDS_FOLDER_DATA 25

Definition at line 29 of file Resource.h.

#define IDS_ITEM 24

Definition at line 28 of file Resource.h.

#define IDS_MI_COMMAND 4

Definition at line 8 of file Resource.h.

#define IDS_MI_FILEITEM 6

Definition at line 10 of file Resource.h.

#define IDS_MODIFY_DATA 23

Definition at line 27 of file Resource.h.

#define IDS_NEW 13

Definition at line 17 of file Resource.h.

#define IDS_NEW_FOLDER 14

Definition at line 18 of file Resource.h.

#define IDS_NEW_ITEM 15

Definition at line 19 of file Resource.h.

#define IDS_OPEN 18

Definition at line 22 of file Resource.h.

#define IDS_PASTE 16

Definition at line 20 of file Resource.h.

#define IDS_RENAME 19

Definition at line 23 of file Resource.h.

#define IDS_TB_COMMAND 3

Definition at line 7 of file Resource.h.

#define IDS_VIEW 8

Definition at line 12 of file Resource.h.

#define IDS_VIEW_DETAILS 12

Definition at line 16 of file Resource.h.

#define IDS_VIEW_LARGE 9

Definition at line 13 of file Resource.h.

#define IDS_VIEW_LIST 11

Definition at line 15 of file Resource.h.

#define IDS_VIEW_SMALL 10

Definition at line 14 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/SampView.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines | Typedefs | Functions | Variables

SampView.Cpp File Reference

#include "ShlView.h"
#include "ClsFact.h"
#include "ViewList.h"
#include "Utility.h"
#include <olectl.h>
#include <initguid.h>
#include <shlguid.h>
#include "Guid.h"

Go to the source code of this file.

Classes

struct | REGSTRUCT

Defines

#define | INITGUID

Typedefs

typedef struct REGSTRUCT * | LPREGSTRUCT

Functions

BOOL DeleteEntireKey (HKEY, LPTSTR)
STDAPI | DllCanUnloadNow (VOID)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppReturn)
BOOL WINAPI | DllMain (HINSTANCE, DWORD, LPVOID)
STDAPI | DllRegisterServer (VOID)
STDAPI | DllUnregisterServer (VOID)

Variables

const TCHAR | c_szDataFile [] = TEXT("items.ini\0")
const TCHAR | c_szSection [] = TEXT("Items\0")
UINT g_DllRefCount
HIMAGELIST | g_himlLarge = NULL
HIMAGELIST | g_himlSmall = NULL
HINSTANCE | g_hInst
int | g_nColumn = INITIAL_COLUMN_SIZE
CViewList * g_pViewList
TCHAR | g_szExtTitle [TITLE_SIZE]
TCHAR | g_szStoragePath [MAX_PATH]

Define Documentation

#define INITGUID

Definition at line 34 of file SampView.Cpp.

Typedef Documentation

typedef struct REGSTRUCT * LPREGSTRUCT

Function Documentation

BOOL DeleteEntireKey | ( | HKEY | hKey,
 |  | LPTSTR | pszSubKey
 | ) |  |

Definition at line 471 of file SampView.Cpp.

{
LRESULT  lResult;
HKEY     hEnumKey;

lResult = RegOpenKeyEx( hKey,
                        pszSubKey,
                        0,
                        KEY_ENUMERATE_SUB_KEYS,
                        &hEnumKey);

if(NOERROR == lResult)
   {
   TCHAR szKey[MAX_PATH];
   DWORD dwSize = MAX_PATH;

   while(ERROR_SUCCESS == RegEnumKeyEx(hEnumKey, 0, szKey, &dwSize, NULL, NULL, NULL, NULL))
      {
      DeleteEntireKey(hEnumKey, szKey);

      dwSize = MAX_PATH;
      }

   RegCloseKey(hEnumKey);
   }
else
   {
   return FALSE;
   }

RegDeleteKey(hKey, pszSubKey);

return TRUE;
}

STDAPI DllCanUnloadNow ( VOID )

Definition at line 105 of file SampView.Cpp.

{
return (g_DllRefCount ? S_FALSE : S_OK);
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppReturn
 | ) |  |

Definition at line 116 of file SampView.Cpp.

{
*ppReturn = NULL;

//if we don't support this classid, return the proper error code
if(!IsEqualCLSID(rclsid, CLSID_SampleNameSpace))
   return CLASS_E_CLASSNOTAVAILABLE;

//create a CClassFactory object and check it for validity
CClassFactory *pClassFactory = new CClassFactory();
if(NULL == pClassFactory)
   return E_OUTOFMEMORY;

//get the QueryInterface return for our return value
HRESULT hResult = pClassFactory->QueryInterface(riid, ppReturn);

//call Release to decrement the ref count - creating the object set it to one
//and QueryInterface incremented it - since its being used externally (not by
//us), we only want the ref count to be 1
pClassFactory->Release();

//return the result from QueryInterface
return hResult;
}

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 67 of file SampView.Cpp.

{
switch(dwReason)
   {
   case DLL_PROCESS_ATTACH:
      g_hInst = hInstance;
      g_DllRefCount = 0;

      GetGlobalSettings();

      //create the global image lists
      CreateImageLists();

      g_pViewList = new CViewList();
      break;

   case DLL_PROCESS_DETACH:
      SaveGlobalSettings();

      //destroy the global image lists
      DestroyImageLists();

      if(g_pViewList)
         delete g_pViewList;
      break;
   }

return TRUE;
}

STDAPI DllRegisterServer ( VOID )

Definition at line 156 of file SampView.Cpp.

{
int      i;
HKEY     hKey;
LRESULT  lResult;
DWORD    dwDisp;
TCHAR    szSubKey[MAX_PATH];
TCHAR    szCLSID[MAX_PATH];
TCHAR    szModule[MAX_PATH];
LPWSTR   pwsz;

//get the CLSID in string form
StringFromIID(CLSID_SampleNameSpace, &pwsz);

if(pwsz)
   {
   WideCharToLocal(szCLSID, pwsz, ARRAYSIZE(szCLSID));

   //free the string
   LPMALLOC pMalloc;
   CoGetMalloc(1, &pMalloc);
   if(pMalloc)
      {
      pMalloc->Free(pwsz);
      pMalloc->Release();
      }
   }

//get this DLL's path and file name
GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule));

//register the CLSID entries
REGSTRUCT ClsidEntries[] = {  HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s"),                  NULL,                   g_szExtTitle,
                              HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),  NULL,                   TEXT("%s"),
                              HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),  TEXT("ThreadingModel"), TEXT("Apartment"),
                              HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\DefaultIcon"),     NULL,                   TEXT("%s,0"),
                              NULL,                NULL,                               NULL,                   NULL};

for(i = 0; ClsidEntries[i].hRootKey; i++)
   {
   //Create the sub key string.
   wsprintf(szSubKey, ClsidEntries[i].lpszSubKey, szCLSID);

   lResult = RegCreateKeyEx(  ClsidEntries[i].hRootKey,
                              szSubKey,
                              0,
                              NULL,
                              REG_OPTION_NON_VOLATILE,
                              KEY_WRITE,
                              NULL,
                              &hKey,
                              &dwDisp);

   if(NOERROR == lResult)
      {
      TCHAR szData[MAX_PATH];

      //if necessary, create the value string
      wsprintf(szData, ClsidEntries[i].lpszData, szModule);

      lResult = RegSetValueEx(   hKey,
                                 ClsidEntries[i].lpszValueName,
                                 0,
                                 REG_SZ,
                                 (LPBYTE)szData,
                                 (lstrlen(szData) + 1) * sizeof(TCHAR));

      RegCloseKey(hKey);
      }
   else
      return SELFREG_E_CLASS;
   }

//Register the default flags for the folder.

wsprintf(   szSubKey,
            TEXT("CLSID\\%s\\ShellFolder"),
            szCLSID);

lResult = RegCreateKeyEx(  HKEY_CLASSES_ROOT,
                           szSubKey,
                           0,
                           NULL,
                           REG_OPTION_NON_VOLATILE,
                           KEY_WRITE,
                           NULL,
                           &hKey,
                           &dwDisp);

if(NOERROR == lResult)
   {
   DWORD dwData = SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_BROWSABLE | SFGAO_DROPTARGET;

   lResult = RegSetValueEx(   hKey,
                              TEXT("Attributes"),
                              0,
                              REG_BINARY,
                              (LPBYTE)&dwData,
                              sizeof(dwData));

   RegCloseKey(hKey);
   }
else
   return SELFREG_E_CLASS;

//Register the name space extension

/*
Create the sub key string. Change this from "...MyComputer..." to
"...Desktop..." if desired.
*/
//#define INSTALL_ON_DESKTOP
wsprintf(   szSubKey,
#ifdef INSTALL_ON_DESKTOP
            TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\%s"),
#else
            TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\%s"),
#endif
            szCLSID);

lResult = RegCreateKeyEx(  HKEY_LOCAL_MACHINE,
                           szSubKey,
                           0,
                           NULL,
                           REG_OPTION_NON_VOLATILE,
                           KEY_WRITE,
                           NULL,
                           &hKey,
                           &dwDisp);

if(NOERROR == lResult)
   {
   TCHAR szData[MAX_PATH];

   //Create the value string.
   lstrcpyn(szData, g_szExtTitle, ARRAYSIZE(szData));

   lResult = RegSetValueEx(   hKey,
                              NULL,
                              0,
                              REG_SZ,
                              (LPBYTE)szData,
                              (lstrlen(szData) + 1) * sizeof(TCHAR));

   RegCloseKey(hKey);
   }
else
   return SELFREG_E_CLASS;

//If running on NT, register the extension as approved.
OSVERSIONINFO  osvi;

osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);

if(VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
   {
   lstrcpyn( szSubKey, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), ARRAYSIZE(szSubKey));

   lResult = RegCreateKeyEx(  HKEY_LOCAL_MACHINE,
                              szSubKey,
                              0,
                              NULL,
                              REG_OPTION_NON_VOLATILE,
                              KEY_WRITE,
                              NULL,
                              &hKey,
                              &dwDisp);

   if(NOERROR == lResult)
      {
      TCHAR szData[MAX_PATH];

      //Create the value string.
      lstrcpyn(szData, g_szExtTitle, ARRAYSIZE(szData));

      lResult = RegSetValueEx(   hKey,
                                 szCLSID,
                                 0,
                                 REG_SZ,
                                 (LPBYTE)szData,
                                 (lstrlen(szData) + 1) * sizeof(TCHAR));

      RegCloseKey(hKey);
      }
   else
      return SELFREG_E_CLASS;
   }

//tell the shell that the folder has been added.
LPITEMIDLIST   pidlDesktop,
               pidlMyComputer;

SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop);
SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidlMyComputer);
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_IDLIST, pidlDesktop, 0);
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_IDLIST, pidlMyComputer, 0);

IMalloc  *pMalloc;
if(S_OK == SHGetMalloc(&pMalloc))
   {
   pMalloc->Free(pidlDesktop);
   pMalloc->Free(pidlMyComputer);
   pMalloc->Release();
   }

return S_OK;
}

STDAPI DllUnregisterServer ( VOID )

Definition at line 371 of file SampView.Cpp.

{
LPWSTR   pwsz;
TCHAR    szCLSID[MAX_PATH];
TCHAR    szSubKey[MAX_PATH];

//get the CLSID in string form
StringFromIID(CLSID_SampleNameSpace, &pwsz);

if(pwsz)
   {
   WideCharToLocal(szCLSID, pwsz, ARRAYSIZE(szCLSID));

   //free the string
   LPMALLOC pMalloc;
   CoGetMalloc(1, &pMalloc);
   if(pMalloc)
      {
      pMalloc->Free(pwsz);
      pMalloc->Release();
      }
   }
else
   {
   return E_FAIL;
   }

//delete the namespace extension entries
wsprintf(   szSubKey,
            TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\%s"),
            szCLSID);
DeleteEntireKey(HKEY_LOCAL_MACHINE, szSubKey);
wsprintf(   szSubKey,
            TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\%s"),
            szCLSID);
DeleteEntireKey(HKEY_LOCAL_MACHINE, szSubKey);

//delete the object's registry entries
wsprintf(szSubKey, TEXT("CLSID\\%s"), szCLSID);
DeleteEntireKey(HKEY_CLASSES_ROOT, szSubKey);

//delete the approved extensions on NT
OSVERSIONINFO  osvi;

osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);

if(VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
   {
   LRESULT  lResult;
   HKEY     hKey;

   lResult = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
                           TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),
                           0,
                           KEY_SET_VALUE,
                           &hKey);

   if(NOERROR == lResult)
      {
      TCHAR szData[MAX_PATH];

      //Create the value string.
      lstrcpyn(szData, g_szExtTitle, ARRAYSIZE(szData));

      lResult = RegDeleteValue(  hKey,
                                 szCLSID);

      RegCloseKey(hKey);
      }
   else
      return SELFREG_E_CLASS;
   }

//tell the shell that the folder has been removed.
LPITEMIDLIST   pidlDesktop,
               pidlMyComputer;

SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop);
SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidlMyComputer);
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_IDLIST, pidlDesktop, 0);
SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_IDLIST, pidlMyComputer, 0);

IMalloc  *pMalloc;
if(S_OK == SHGetMalloc(&pMalloc))
   {
   pMalloc->Free(pidlDesktop);
   pMalloc->Free(pidlMyComputer);
   pMalloc->Release();
   }

return S_OK;
}

Variable Documentation

const TCHAR c_szDataFile[] = TEXT("items.ini\0")

Definition at line 56 of file SampView.Cpp.

const TCHAR c_szSection[] = TEXT("Items\0")

Definition at line 57 of file SampView.Cpp.

UINT g_DllRefCount

Definition at line 51 of file SampView.Cpp.

HIMAGELIST g_himlLarge = NULL

Definition at line 52 of file SampView.Cpp.

HIMAGELIST g_himlSmall = NULL

Definition at line 53 of file SampView.Cpp.

HINSTANCE g_hInst

Definition at line 50 of file SampView.Cpp.

int g_nColumn = INITIAL_COLUMN_SIZE

Definition at line 58 of file SampView.Cpp.

CViewList* g_pViewList

Definition at line 59 of file SampView.Cpp.

TCHAR g_szExtTitle[TITLE_SIZE]

Definition at line 55 of file SampView.Cpp.

TCHAR g_szStoragePath[MAX_PATH]

Definition at line 54 of file SampView.Cpp.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ShlFldr.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Defines | Functions | Variables

ShlFldr.Cpp File Reference

#include "ShlFldr.h"
#include "ShlView.h"
#include "ExtrIcon.h"
#include "ContMenu.h"
#include "DataObj.h"
#include "DropTgt.h"
#include "ViewList.h"
#include "Guid.h"
#include "resource.h"
#include <ShellApi.h>
#include <shlwapi.h>

Go to the source code of this file.

Defines

#define | DC_DATA TEXT("Really Loves Cheese")
#define | DC_NAME TEXT("David Campbell")
#define | DEFAULT_DATA TEXT("Data")
#define | NEW_FOLDER_NAME TEXT("New Folder")
#define | NEW_ITEM_NAME TEXT("New Item")

Functions

STDMETHODIMP_ (DWORD) CShellFolder

Variables

CViewList * g_pViewList

Define Documentation

#define DC_DATA TEXT("Really Loves Cheese")

Definition at line 167 of file ShlFldr.Cpp.

#define DC_NAME TEXT("David Campbell")

Definition at line 166 of file ShlFldr.Cpp.

#define DEFAULT_DATA TEXT("Data")

Definition at line 38 of file ShlFldr.Cpp.

#define NEW_FOLDER_NAME TEXT("New Folder")

Definition at line 1000 of file ShlFldr.Cpp.

#define NEW_ITEM_NAME TEXT("New Item")

Definition at line 1001 of file ShlFldr.Cpp.

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 186 of file ShlFldr.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Variable Documentation

CViewList* g_pViewList

Definition at line 59 of file SampView.Cpp.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ShlFldr.h File Reference

  • WinUI
  • Shell
  • SampView
Classes

ShlFldr.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "EnumIDL.h"
#include "PidlMgr.h"

Go to the source code of this file.

Classes

class CShellFolder
Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ShlView.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Defines | Functions | Variables

ShlView.Cpp File Reference

#include "ShlView.h"
#include "Guid.h"
#include "Commands.h"
#include "resource.h"
#include "Tools.h"
#include "ViewList.h"
#include "DropSrc.h"

Go to the source code of this file.

Defines

#define MENU_MAX 100

Functions

STDMETHODIMP_ (DWORD) CShellView

Variables

CViewList * g_pViewList
MYTOOLINFO g_Tools []

Define Documentation

#define MENU_MAX 100

Definition at line 973 of file ShlView.Cpp.

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 197 of file ShlView.Cpp.

{
if(--m_ObjRefCount == 0)
   {
   delete this;
   return 0;
   }

return m_ObjRefCount;
}

Variable Documentation

CViewList* g_pViewList

Definition at line 59 of file SampView.Cpp.

MYTOOLINFO g_Tools[]
Initial value:

   {
   IDB_VIEW_SMALL_COLOR, IDM_NEW_FOLDER, VIEW_NEWFOLDER, IDS_NEW_FOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON,
   IDB_STD_SMALL_COLOR, IDM_NEW_ITEM, STD_FILENEW, IDS_NEW_ITEM, TBSTATE_ENABLED, TBSTYLE_BUTTON,
   0, IDM_SEPARATOR, 0, 0, 0, TBSTYLE_SEP,
   IDB_VIEW_SMALL_COLOR, IDM_VIEW_LARGE, VIEW_LARGEICONS, IDS_VIEW_LARGE, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
   IDB_VIEW_SMALL_COLOR, IDM_VIEW_SMALL, VIEW_SMALLICONS, IDS_VIEW_SMALL, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
   IDB_VIEW_SMALL_COLOR, IDM_VIEW_LIST, VIEW_LIST, IDS_VIEW_LIST, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
   IDB_VIEW_SMALL_COLOR, IDM_VIEW_DETAILS, VIEW_DETAILS, IDS_VIEW_DETAILS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
   0, (UINT)-1, 0, 0, 0, 0,
   }

Definition at line 34 of file ShlView.Cpp.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ShlView.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines

ShlView.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <objbase.h>
#include <shlobj.h>
#include <ServProv.h>
#include <DocObj.h>
#include "ShlFldr.h"
#include "PidlMgr.h"
#include "ContMenu.h"

Go to the source code of this file.

Classes

class | CShellView

Defines

#define | ID_LISTVIEW 2000

Define Documentation

#define ID_LISTVIEW 2000

Definition at line 36 of file ShlView.h.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Tools.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Typedefs | Variables

Tools.h File Reference

#include "resource.h"

Go to the source code of this file.

Classes

struct | MYTOOLINFO

Typedefs

typedef struct MYTOOLINFO * | LPMYTOOLINFO

Variables

MYTOOLINFO g_Tools []

Typedef Documentation

typedef struct MYTOOLINFO * LPMYTOOLINFO

Variable Documentation

MYTOOLINFO g_Tools[]

Definition at line 34 of file ShlView.Cpp.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Utility.Cpp File Reference

  • WinUI
  • Shell
  • SampView
Defines | Functions

Utility.Cpp File Reference

#include "Utility.h"
#include "ShlFldr.h"
#include "resource.h"
#include "Commands.h"
#include <ShellApi.h>
#include <shlwapi.h>

Go to the source code of this file.

Defines

#define | DISPLAY_SETTINGS_COUNT 1
#define | MAIN_KEY_STRING (TEXT("Software\\SampleView"))
#define | VALUE_STRING (TEXT("Display Settings"))

Functions

UINT | AddFileMenuItems (HMENU hMenu, UINT uOffset, UINT uInsertBefore, BOOL fByPosition)
UINT | AddViewMenuItems (HMENU hMenu, UINT uOffset, UINT uInsertBefore, BOOL fByPosition)
int | AnsiToLocal (LPTSTR pLocal, LPSTR pAnsi, DWORD dwChars)
int | BuildDataFileName (LPTSTR pszDataFile, LPCTSTR pszPath, DWORD dwChars)
int CALLBACK | CompareItems (LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
VOID | CreateImageLists (VOID)
HGLOBAL | CreatePrivateClipboardData (LPITEMIDLIST pidlParent, LPITEMIDLIST *aPidls, UINT uItemCount, BOOL fCut)
HGLOBAL | CreateShellIDList (LPITEMIDLIST pidlParent, LPITEMIDLIST *aPidls, UINT uItemCount)
BOOL | DeleteDirectory (LPCTSTR pszDir)
VOID | DestroyImageLists (VOID)
VOID | GetGlobalSettings (VOID)
BOOL | GetTextFromSTRRET (IMalloc *pMalloc, LPSTRRET pStrRet, LPCITEMIDLIST pidl, LPTSTR pszText, DWORD dwSize)
LPVOID | GetViewInterface (HWND hWnd)
BOOL | IsViewWindow (HWND hWnd)
BOOL CALLBACK | ItemDataDlgProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
int | LocalToAnsi (LPSTR pAnsi, LPCTSTR pLocal, DWORD dwChars)
int | LocalToWideChar (LPWSTR pWide, LPCTSTR pLocal, DWORD dwChars)
BOOL | SaveGlobalSettings (void)
VOID | SmartAppendBackslash (LPTSTR pszPath, DWORD cchPath)
int | WideCharToLocal (LPTSTR pLocal, LPCWSTR pWide, DWORD dwChars)

Define Documentation

#define DISPLAY_SETTINGS_COUNT 1

Definition at line 35 of file Utility.Cpp.

#define MAIN_KEY_STRING (TEXT("Software\\SampleView"))

Definition at line 33 of file Utility.Cpp.

#define VALUE_STRING (TEXT("Display Settings"))

Definition at line 34 of file Utility.Cpp.

Function Documentation

UINT AddFileMenuItems | ( | HMENU | hMenu,
 |  | UINT | uOffset,
 |  | UINT | uInsertBefore,
 |  | BOOL | fByPosition
 | ) |  |

Definition at line 855 of file Utility.Cpp.

{
//add the file menu items
TCHAR          szText[MAX_PATH] = TEXT("");
MENUITEMINFO   mii;
HMENU          hPopup;
UINT           uAdded = 0;

hPopup = CreatePopupMenu();

if(hPopup)
   {
   ZeroMemory(&mii, sizeof(mii));
   mii.cbSize = sizeof(mii);

   LoadString(g_hInst, IDS_NEW_FOLDER, szText, sizeof(szText));
   mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
   mii.fType = MFT_STRING;
   mii.fState = MFS_ENABLED;
   mii.dwTypeData = szText;
   mii.wID = uOffset + IDM_NEW_FOLDER;
   InsertMenuItem(hPopup, (UINT)-1, FALSE, &mii);

   LoadString(g_hInst, IDS_NEW_ITEM, szText, sizeof(szText));
   mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
   mii.fType = MFT_STRING;
   mii.fState = MFS_ENABLED;
   mii.dwTypeData = szText;
   mii.wID = uOffset + IDM_NEW_ITEM;
   InsertMenuItem(hPopup, (UINT)-1, FALSE, &mii);

   LoadString(g_hInst, IDS_NEW, szText, sizeof(szText));
   mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE | MIIM_SUBMENU;
   mii.fType = MFT_STRING;
   mii.fState = MFS_ENABLED;
   mii.dwTypeData = szText;
   mii.wID = uOffset + IDM_NEW;
   mii.hSubMenu = hPopup;
   InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

   uAdded++;
   }

return uAdded;
}

UINT AddViewMenuItems | ( | HMENU | hMenu,
 |  | UINT | uOffset,
 |  | UINT | uInsertBefore,
 |  | BOOL | fByPosition
 | ) |  |

Definition at line 793 of file Utility.Cpp.

{
MENUITEMINFO   mii;
TCHAR          szText[MAX_PATH] = TEXT("");
UINT           uAdded = 0;

ZeroMemory(&mii, sizeof(mii));
mii.cbSize = sizeof(mii);

//add the view menu items at the correct position in the menu
LoadString(g_hInst, IDS_VIEW_LARGE, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_LARGE;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

LoadString(g_hInst, IDS_VIEW_SMALL, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_SMALL;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

LoadString(g_hInst, IDS_VIEW_LIST, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_LIST;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

LoadString(g_hInst, IDS_VIEW_DETAILS, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_DETAILS;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

return uAdded;
}

int AnsiToLocal | ( | LPTSTR | pLocal,
 |  | LPSTR | pAnsi,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 389 of file Utility.Cpp.

{
*pLocal = 0;

#ifdef UNICODE
MultiByteToWideChar( CP_ACP,
                     0,
                     pAnsi,
                     -1,
                     pLocal,
                     dwChars);
#else
lstrcpyn(pLocal, pAnsi, dwChars);
#endif

return lstrlen(pLocal);
}

int BuildDataFileName | ( | LPTSTR | pszDataFile,
 |  | LPCTSTR | pszPath,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 371 of file Utility.Cpp.

{
if(dwChars < (DWORD)(lstrlen(pszPath) + 1 + lstrlen(c_szDataFile)))
   return 0;

lstrcpyn(pszDataFile, pszPath, dwChars);
SmartAppendBackslash(pszDataFile, dwChars);
StrCatBuff(pszDataFile, c_szDataFile, dwChars);

return lstrlen(pszDataFile);
}

int CALLBACK CompareItems | ( | LPARAM | lParam1,
 |  | LPARAM | lParam2,
 |  | LPARAM | lpData
 | ) |  |

Definition at line 43 of file Utility.Cpp.

{
CShellFolder  *pFolder = (CShellFolder*)lpData;

if(!pFolder)
   return 0;

HRESULT  hr = pFolder->CompareIDs(0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2);

return (SHORT)HRESULT_CODE(hr);
}

VOID CreateImageLists ( VOID )

Definition at line 178 of file Utility.Cpp.

{
int   cx;
int   cy;

cx = GetSystemMetrics(SM_CXSMICON);
cy = GetSystemMetrics(SM_CYSMICON);

if(g_himlSmall)
   ImageList_Destroy(g_himlSmall);

//set the small image list
g_himlSmall = ImageList_Create(cx, cy, ILC_COLORDDB | ILC_MASK, 3, 0);

if(g_himlSmall)
   {
   HICON       hIcon;
   TCHAR       szFolder[MAX_PATH];
   SHFILEINFO  sfi;

   //add the item icon
   hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, cx, cy, LR_DEFAULTCOLOR);
   ImageList_AddIcon(g_himlSmall, hIcon);

   //add the closed folder icon
   GetWindowsDirectory(szFolder, MAX_PATH);
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON | SHGFI_SMALLICON);
   ImageList_AddIcon(g_himlSmall, sfi.hIcon);

   //add the open folder icon
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON | SHGFI_SMALLICON | SHGFI_OPENICON);
   ImageList_AddIcon(g_himlSmall, sfi.hIcon);
   }

if(g_himlLarge)
   ImageList_Destroy(g_himlLarge);

cx = GetSystemMetrics(SM_CXICON);
cy = GetSystemMetrics(SM_CYICON);

//set the large image list
g_himlLarge = ImageList_Create(cx, cy, ILC_COLORDDB | ILC_MASK, 4, 0);

if(g_himlLarge)
   {
   HICON       hIcon;
   TCHAR       szFolder[MAX_PATH];
   SHFILEINFO  sfi;

   //add the item icon
   hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, cx, cy, LR_DEFAULTCOLOR);
   ImageList_AddIcon(g_himlLarge, hIcon);

   //add the closed folder icon
   GetWindowsDirectory(szFolder, MAX_PATH);
   ZeroMemory(&sfi, sizeof(sfi));
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON);
   ImageList_AddIcon(g_himlLarge, sfi.hIcon);

   //add the open folder icon
   GetWindowsDirectory(szFolder, MAX_PATH);
   ZeroMemory(&sfi, sizeof(sfi));
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON | SHGFI_OPENICON);
   ImageList_AddIcon(g_himlLarge, sfi.hIcon);
   }

}

HGLOBAL CreatePrivateClipboardData | ( | LPITEMIDLIST | pidlParent,
 |  | LPITEMIDLIST * | aPidls,
 |  | UINT | uItemCount,
 |  | BOOL | fCut
 | ) |  |

Definition at line 557 of file Utility.Cpp.

{
HGLOBAL        hGlobal = NULL;
LPPRIVCLIPDATA pData;
UINT           iCurPos;
UINT           cbPidl;
UINT           i;
CPidlMgr       *pPidlMgr;

pPidlMgr = new CPidlMgr();

if(!pPidlMgr)
   return NULL;

//get the size of the parent folder's PIDL
cbPidl = pPidlMgr->GetSize(pidlParent);

//get the total size of all of the PIDLs
for(i = 0; i < uItemCount; i++)
   {
   cbPidl += pPidlMgr->GetSize(aPidls[i]);
   }

/*
Find the end of the PRIVCLIPDATA structure. This is the size of the
PRIVCLIPDATA structure itself (which includes one element of aoffset) plus the
additional number of elements in aoffset.
*/
iCurPos = sizeof(PRIVCLIPDATA) + (uItemCount * sizeof(UINT));

/*
Allocate the memory for the PRIVCLIPDATA structure and it's variable length members.
*/
hGlobal = GlobalAlloc(GHND | GMEM_SHARE, (DWORD)
         (iCurPos +        // size of the PRIVCLIPDATA structure and the additional aoffset elements
         (cbPidl + 1)));   // size of the pidls

if (NULL == hGlobal)
   return (hGlobal);

pData = (LPPRIVCLIPDATA)GlobalLock(hGlobal);

if(pData)
   {
   pData->fCut = fCut;
   pData->cidl = uItemCount + 1;
   pData->aoffset[0] = iCurPos;

   //add the PIDL for the parent folder
   cbPidl = pPidlMgr->GetSize(pidlParent);
   CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)pidlParent, cbPidl);
   iCurPos += cbPidl;

   for(i = 0; i < uItemCount; i++)
      {
      //get the size of the PIDL
      cbPidl = pPidlMgr->GetSize(aPidls[i]);

      //fill out the members of the PRIVCLIPDATA structure.
      pData->aoffset[i + 1] = iCurPos;

      //copy the contents of the PIDL
      CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)aPidls[i], cbPidl);

      //set up the position of the next PIDL
      iCurPos += cbPidl;
      }

   GlobalUnlock(hGlobal);
   }

delete pPidlMgr;

return (hGlobal);
}

HGLOBAL CreateShellIDList | ( | LPITEMIDLIST | pidlParent,
 |  | LPITEMIDLIST * | aPidls,
 |  | UINT | uItemCount
 | ) |  |

Definition at line 642 of file Utility.Cpp.

{
HGLOBAL        hGlobal = NULL;
LPIDA          pData;
UINT           iCurPos;
UINT           cbPidl;
UINT           i;
CPidlMgr       *pPidlMgr;

pPidlMgr = new CPidlMgr();

if(!pPidlMgr)
   return NULL;

//get the size of the parent folder's PIDL
cbPidl = pPidlMgr->GetSize(pidlParent);

//get the total size of all of the PIDLs
for(i = 0; i < uItemCount; i++)
   {
   cbPidl += pPidlMgr->GetSize(aPidls[i]);
   }

/*
Find the end of the CIDA structure. This is the size of the
CIDA structure itself (which includes one element of aoffset) plus the
additional number of elements in aoffset.
*/
iCurPos = sizeof(CIDA) + (uItemCount * sizeof(UINT));

/*
Allocate the memory for the CIDA structure and it's variable length members.
*/
hGlobal = GlobalAlloc(GHND | GMEM_SHARE, (DWORD)
         (iCurPos +        // size of the CIDA structure and the additional aoffset elements
         (cbPidl + 1)));   // size of the pidls

if (NULL == hGlobal)
   return (hGlobal);

pData = (LPIDA)GlobalLock(hGlobal);

if(pData)
   {
   pData->cidl = uItemCount + 1;
   pData->aoffset[0] = iCurPos;

   //add the PIDL for the parent folder
   cbPidl = pPidlMgr->GetSize(pidlParent);
   CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)pidlParent, cbPidl);
   iCurPos += cbPidl;

   for(i = 0; i < uItemCount; i++)
      {
      //get the size of the PIDL
      cbPidl = pPidlMgr->GetSize(aPidls[i]);

      //fill out the members of the CIDA structure.
      pData->aoffset[i + 1] = iCurPos;

      //copy the contents of the PIDL
      CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)aPidls[i], cbPidl);

      //set up the position of the next PIDL
      iCurPos += cbPidl;
      }

   GlobalUnlock(hGlobal);
   }

delete pPidlMgr;

return (hGlobal);
}

BOOL DeleteDirectory ( LPCTSTR pszDir )

Definition at line 489 of file Utility.Cpp.

{
BOOL              fReturn = FALSE;
HANDLE            hFind;
WIN32_FIND_DATA   wfd;
TCHAR             szTemp[MAX_PATH];

lstrcpyn(szTemp, pszDir, ARRAYSIZE(szTemp));
SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
StrCatBuff(szTemp, TEXT("*.*"), ARRAYSIZE(szTemp));
hFind = FindFirstFile(szTemp, &wfd);

if(INVALID_HANDLE_VALUE != hFind)
   {
   do
      {
      if(lstrcmpi(wfd.cFileName, TEXT(".")) &&
         lstrcmpi(wfd.cFileName, TEXT("..")))
         {
         //build the path of the directory or file found
         lstrcpyn(szTemp, pszDir, ARRAYSIZE(szTemp));
         SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
         StrCatBuff(szTemp, wfd.cFileName, ARRAYSIZE(szTemp));

         if(FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes)
            {
            //we found a directory - call this function recursively
            DeleteDirectory(szTemp);
            }
         else
            {
            /*
            We found a file. Only delete the data file to prevent us from
            deleteting something that the user has placed in the folder.
            */
            if(0 == lstrcmpi(wfd.cFileName, c_szDataFile))
               {
               DeleteFile(szTemp);
               }
            }
         }
      }
   while(FindNextFile(hFind, &wfd));

   FindClose(hFind);

   /*
   If this fails it means the directory is not empty, so just remove our
   attributes so the enumerator won't see it.
   */
   fReturn = RemoveDirectory(pszDir);
   if(!fReturn)
      {
      DWORD dwAttr = GetFileAttributes(pszDir);
      dwAttr &= ~FILTER_ATTRIBUTES;
      fReturn = SetFileAttributes(pszDir, dwAttr);
      }
   }

return fReturn;
}

VOID DestroyImageLists ( VOID )

Definition at line 268 of file Utility.Cpp.

{
if(g_himlSmall)
   ImageList_Destroy(g_himlSmall);

if(g_himlLarge)
   ImageList_Destroy(g_himlLarge);
}

VOID GetGlobalSettings ( VOID )

Definition at line 106 of file Utility.Cpp.

{
LPITEMIDLIST   pidl = NULL;

g_nColumn = INITIAL_COLUMN_SIZE;

LoadString(g_hInst, IDS_EXT_TITLE, g_szExtTitle, TITLE_SIZE);

*g_szStoragePath = 0;
SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &pidl);

if(pidl)
   {
   IMalloc *pMalloc;

   SHGetPathFromIDList(pidl, g_szStoragePath);

   SHGetMalloc(&pMalloc);
   if(pMalloc)
      {
      pMalloc->Free(pidl);
      pMalloc->Release();
      }
   }
else
   {
   GetWindowsDirectory(g_szStoragePath, MAX_PATH);
   }

SmartAppendBackslash(g_szStoragePath, MAX_PATH);
StrCatBuff(g_szStoragePath, g_szExtTitle, MAX_PATH);
SmartAppendBackslash(g_szStoragePath, MAX_PATH);
CreateDirectory(g_szStoragePath, NULL);

HKEY     hKey;
LRESULT  lResult;
lResult = RegOpenKeyEx( HKEY_CURRENT_USER,
                        MAIN_KEY_STRING,
                        0,
                        KEY_ALL_ACCESS,
                        &hKey);

if(lResult != ERROR_SUCCESS)
   return;

//create an array to put our data in
DWORD dwArray[DISPLAY_SETTINGS_COUNT];
DWORD dwType;
DWORD dwSize = sizeof(dwArray);

//get the saved data
lResult = RegQueryValueEx( hKey,
                           VALUE_STRING,
                           NULL,
                           &dwType,
                           (LPBYTE)dwArray,
                           &dwSize);

RegCloseKey(hKey);

if(lResult != ERROR_SUCCESS)
   return;

g_nColumn = dwArray[0];
}

BOOL GetTextFromSTRRET | ( | IMalloc * | pMalloc,
 |  | LPSTRRET | pStrRet,
 |  | LPCITEMIDLIST | pidl,
 |  | LPTSTR | pszText,
 |  | DWORD | dwSize
 | ) |  |

Definition at line 413 of file Utility.Cpp.

{
if(IsBadReadPtr(pStrRet, sizeof(UINT)))
   return FALSE;

if(IsBadWritePtr(pszText, dwSize))
   return FALSE;

switch(pStrRet->uType)
   {
   case STRRET_CSTR:
      AnsiToLocal(pszText, pStrRet->cStr, dwSize);
      break;

   case STRRET_OFFSET:
      lstrcpyn(pszText, (LPTSTR)(((LPBYTE)pidl) + pStrRet->uOffset), dwSize);
      break;

   case STRRET_WSTR:
      {
      WideCharToLocal(pszText, pStrRet->pOleStr, dwSize);

      if(!pMalloc)
         {
         SHGetMalloc(&pMalloc);
         }
      else
         {
         pMalloc->AddRef();
         }
      if(pMalloc)
         {
         pMalloc->Free(pStrRet->pOleStr);
         pMalloc->Release();
         }
      }
      break;

   default:
      return FALSE;
   }

return TRUE;
}

LPVOID GetViewInterface ( HWND hWnd )

Definition at line 772 of file Utility.Cpp.

{
IUnknown *pRet = NULL;

if(IsViewWindow(hWnd))
   {
   pRet = (IUnknown*)GetWindowLongPtr(hWnd, VIEW_POINTER_OFFSET);
   }

if(pRet)
   pRet->AddRef();

return (LPVOID)pRet;
}

BOOL IsViewWindow ( HWND hWnd )

Definition at line 468 of file Utility.Cpp.

{
if(!hWnd)
   return FALSE;

TCHAR szClass[MAX_PATH] = TEXT("");

GetClassName(hWnd, szClass, MAX_PATH);

if(0 == lstrcmpi(szClass, NS_CLASS_NAME))
   return TRUE;

return FALSE;
}

BOOL CALLBACK ItemDataDlgProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 725 of file Utility.Cpp.

{
static LPTSTR  pszData;

switch(uMsg)
   {
   case WM_INITDIALOG:
      pszData = (LPTSTR)lParam;
      if(IsBadWritePtr((LPVOID)pszData, MAX_DATA))
         {
         EndDialog(hWnd, IDCANCEL);
         break;
         }

      SendDlgItemMessage(hWnd, IDC_DATA, EM_LIMITTEXT, MAX_DATA - 1, 0);

      SetDlgItemText(hWnd, IDC_DATA, pszData);
      break;

   case WM_COMMAND:
      switch(GET_WM_COMMAND_ID(wParam, lParam))
         {
         case IDCANCEL:
            EndDialog(hWnd, IDCANCEL);
            break;

         case IDOK:
            GetDlgItemText(hWnd, IDC_DATA, pszData, MAX_DATA);
            EndDialog(hWnd, IDOK);
            break;

         }
      break;

   default:
      break;
   }

return FALSE;
}

int LocalToAnsi | ( | LPSTR | pAnsi,
 |  | LPCTSTR | pLocal,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 333 of file Utility.Cpp.

{
*pAnsi = 0;

#ifdef UNICODE
WideCharToMultiByte( CP_ACP,
                     0,
                     pLocal,
                     -1,
                     pAnsi,
                     dwChars,
                     NULL,
                     NULL);
#else
lstrcpyn(pAnsi, pLocal, dwChars);
#endif

return lstrlenA(pAnsi);
}

int LocalToWideChar | ( | LPWSTR | pWide,
 |  | LPCTSTR | pLocal,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 309 of file Utility.Cpp.

{
*pWide = 0;

#ifdef UNICODE
lstrcpyn(pWide, pLocal, dwChars);
#else
MultiByteToWideChar( CP_ACP,
                     0,
                     pLocal,
                     -1,
                     pWide,
                     dwChars);
#endif

return lstrlenW(pWide);
}

BOOL SaveGlobalSettings ( void )

Definition at line 61 of file Utility.Cpp.

{
HKEY  hKey;
LONG  lResult;
DWORD dwDisp;

lResult = RegCreateKeyEx(  HKEY_CURRENT_USER,
                           MAIN_KEY_STRING,
                           0,
                           NULL,
                           REG_OPTION_NON_VOLATILE,
                           KEY_ALL_ACCESS,
                           NULL,
                           &hKey,
                           &dwDisp);

if(lResult != ERROR_SUCCESS)
   return FALSE;

//create an array to put our data in
DWORD dwArray[DISPLAY_SETTINGS_COUNT];
dwArray[0] = g_nColumn;

//save the last printer selected
lResult = RegSetValueEx(   hKey,
                           VALUE_STRING,
                           0,
                           REG_BINARY,
                           (LPBYTE)dwArray,
                           sizeof(dwArray));

RegCloseKey(hKey);

if(lResult != ERROR_SUCCESS)
   return FALSE;

return TRUE;
}

VOID SmartAppendBackslash | ( | LPTSTR | pszPath,
 |  | DWORD | cchPath
 | ) |  |

Definition at line 359 of file Utility.Cpp.

{
if(*(pszPath + lstrlen(pszPath) - 1) != '\\')
   StrCatBuff(pszPath, TEXT("\\"), cchPath);
}

int WideCharToLocal | ( | LPTSTR | pLocal,
 |  | LPCWSTR | pWide,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 283 of file Utility.Cpp.

{
*pLocal = 0;

#ifdef UNICODE
lstrcpyn(pLocal, pWide, dwChars);
#else
WideCharToMultiByte( CP_ACP,
                     0,
                     pWide,
                     -1,
                     pLocal,
                     dwChars,
                     NULL,
                     NULL);
#endif

return lstrlen(pLocal);
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Utility.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Defines | Typedefs | Functions | Variables

Utility.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#include <Regstr.h>

Go to the source code of this file.

Classes

struct | PRIVCLIPDATA

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#define | CFSTR_SAMPVIEWDATA TEXT("SampleViewDataFormat")
#define | FILTER_ATTRIBUTES (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN)
#define | INITIAL_COLUMN_SIZE 100
#define | NS_CLASS_NAME (TEXT("SampleViewNSClass"))
#define | SFGAO_BROWSABLE (0)
#define | SHGDN_INCLUDE_NONFILESYS (0)
#define | TITLE_SIZE 64
#define | VIEW_POINTER_OFFSET GWLP_USERDATA

Typedefs

typedef struct PRIVCLIPDATA * | LPPRIVCLIPDATA

Functions

UINT | AddFileMenuItems (HMENU, UINT, UINT, BOOL)
UINT | AddViewMenuItems (HMENU, UINT, UINT, BOOL)
int | BuildDataFileName (LPTSTR, LPCTSTR, DWORD)
int CALLBACK | CompareItems (LPARAM, LPARAM, LPARAM)
VOID | CreateImageLists (VOID)
HGLOBAL | CreatePrivateClipboardData (LPITEMIDLIST, LPITEMIDLIST *, UINT, BOOL)
HGLOBAL | CreateShellIDList (LPITEMIDLIST, LPITEMIDLIST *, UINT)
BOOL | DeleteDirectory (LPCTSTR)
VOID | DestroyImageLists (VOID)
VOID | GetGlobalSettings (VOID)
BOOL | GetTextFromSTRRET (IMalloc *, LPSTRRET, LPCITEMIDLIST, LPTSTR, DWORD)
LPVOID | GetViewInterface (HWND)
BOOL | IsViewWindow (HWND)
BOOL CALLBACK | ItemDataDlgProc (HWND, UINT, WPARAM, LPARAM)
int | LocalToAnsi (LPSTR, LPCTSTR, DWORD)
int | LocalToWideChar (LPWSTR, LPCTSTR, DWORD)
BOOL | SaveGlobalSettings (VOID)
VOID | SmartAppendBackslash (LPTSTR, DWORD)
int | WideCharToLocal (LPTSTR, LPCWSTR, DWORD)

Variables

const TCHAR | c_szDataFile []
const TCHAR | c_szSection []
UINT g_DllRefCount
HIMAGELIST | g_himlLarge
HIMAGELIST | g_himlSmall
HINSTANCE | g_hInst
int | g_nColumn
TCHAR | g_szExtTitle []
TCHAR | g_szStoragePath []

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 103 of file Utility.h.

#define CFSTR_SAMPVIEWDATA TEXT("SampleViewDataFormat")

Definition at line 58 of file Utility.h.

#define FILTER_ATTRIBUTES (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN)

Definition at line 54 of file Utility.h.

#define INITIAL_COLUMN_SIZE 100

Definition at line 56 of file Utility.h.

#define NS_CLASS_NAME (TEXT("SampleViewNSClass"))

Definition at line 60 of file Utility.h.

#define SFGAO_BROWSABLE (0)

Definition at line 31 of file Utility.h.

#define SHGDN_INCLUDE_NONFILESYS (0)

Definition at line 35 of file Utility.h.

#define TITLE_SIZE 64

Definition at line 52 of file Utility.h.

#define VIEW_POINTER_OFFSET GWLP_USERDATA

Definition at line 62 of file Utility.h.

Typedef Documentation

typedef struct PRIVCLIPDATA* LPPRIVCLIPDATA

Function Documentation

UINT AddFileMenuItems | ( | HMENU | ,
 |  | UINT | ,
 |  | UINT | ,
 |  | BOOL |
 | ) |  |

Definition at line 855 of file Utility.Cpp.

{
//add the file menu items
TCHAR          szText[MAX_PATH] = TEXT("");
MENUITEMINFO   mii;
HMENU          hPopup;
UINT           uAdded = 0;

hPopup = CreatePopupMenu();

if(hPopup)
   {
   ZeroMemory(&mii, sizeof(mii));
   mii.cbSize = sizeof(mii);

   LoadString(g_hInst, IDS_NEW_FOLDER, szText, sizeof(szText));
   mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
   mii.fType = MFT_STRING;
   mii.fState = MFS_ENABLED;
   mii.dwTypeData = szText;
   mii.wID = uOffset + IDM_NEW_FOLDER;
   InsertMenuItem(hPopup, (UINT)-1, FALSE, &mii);

   LoadString(g_hInst, IDS_NEW_ITEM, szText, sizeof(szText));
   mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
   mii.fType = MFT_STRING;
   mii.fState = MFS_ENABLED;
   mii.dwTypeData = szText;
   mii.wID = uOffset + IDM_NEW_ITEM;
   InsertMenuItem(hPopup, (UINT)-1, FALSE, &mii);

   LoadString(g_hInst, IDS_NEW, szText, sizeof(szText));
   mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE | MIIM_SUBMENU;
   mii.fType = MFT_STRING;
   mii.fState = MFS_ENABLED;
   mii.dwTypeData = szText;
   mii.wID = uOffset + IDM_NEW;
   mii.hSubMenu = hPopup;
   InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

   uAdded++;
   }

return uAdded;
}

UINT AddViewMenuItems | ( | HMENU | ,
 |  | UINT | ,
 |  | UINT | ,
 |  | BOOL |
 | ) |  |

Definition at line 793 of file Utility.Cpp.

{
MENUITEMINFO   mii;
TCHAR          szText[MAX_PATH] = TEXT("");
UINT           uAdded = 0;

ZeroMemory(&mii, sizeof(mii));
mii.cbSize = sizeof(mii);

//add the view menu items at the correct position in the menu
LoadString(g_hInst, IDS_VIEW_LARGE, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_LARGE;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

LoadString(g_hInst, IDS_VIEW_SMALL, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_SMALL;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

LoadString(g_hInst, IDS_VIEW_LIST, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_LIST;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

LoadString(g_hInst, IDS_VIEW_DETAILS, szText, sizeof(szText));
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = MFS_ENABLED;
mii.dwTypeData = szText;
mii.wID = uOffset + IDM_VIEW_DETAILS;
InsertMenuItem(hMenu, uInsertBefore, fByPosition, &mii);

uAdded++;

return uAdded;
}

int BuildDataFileName | ( | LPTSTR | ,
 |  | LPCTSTR | ,
 |  | DWORD |
 | ) |  |

Definition at line 371 of file Utility.Cpp.

{
if(dwChars < (DWORD)(lstrlen(pszPath) + 1 + lstrlen(c_szDataFile)))
   return 0;

lstrcpyn(pszDataFile, pszPath, dwChars);
SmartAppendBackslash(pszDataFile, dwChars);
StrCatBuff(pszDataFile, c_szDataFile, dwChars);

return lstrlen(pszDataFile);
}

int CALLBACK CompareItems | ( | LPARAM | ,
 |  | LPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 43 of file Utility.Cpp.

{
CShellFolder  *pFolder = (CShellFolder*)lpData;

if(!pFolder)
   return 0;

HRESULT  hr = pFolder->CompareIDs(0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2);

return (SHORT)HRESULT_CODE(hr);
}

VOID CreateImageLists ( VOID )

Definition at line 178 of file Utility.Cpp.

{
int   cx;
int   cy;

cx = GetSystemMetrics(SM_CXSMICON);
cy = GetSystemMetrics(SM_CYSMICON);

if(g_himlSmall)
   ImageList_Destroy(g_himlSmall);

//set the small image list
g_himlSmall = ImageList_Create(cx, cy, ILC_COLORDDB | ILC_MASK, 3, 0);

if(g_himlSmall)
   {
   HICON       hIcon;
   TCHAR       szFolder[MAX_PATH];
   SHFILEINFO  sfi;

   //add the item icon
   hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, cx, cy, LR_DEFAULTCOLOR);
   ImageList_AddIcon(g_himlSmall, hIcon);

   //add the closed folder icon
   GetWindowsDirectory(szFolder, MAX_PATH);
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON | SHGFI_SMALLICON);
   ImageList_AddIcon(g_himlSmall, sfi.hIcon);

   //add the open folder icon
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON | SHGFI_SMALLICON | SHGFI_OPENICON);
   ImageList_AddIcon(g_himlSmall, sfi.hIcon);
   }

if(g_himlLarge)
   ImageList_Destroy(g_himlLarge);

cx = GetSystemMetrics(SM_CXICON);
cy = GetSystemMetrics(SM_CYICON);

//set the large image list
g_himlLarge = ImageList_Create(cx, cy, ILC_COLORDDB | ILC_MASK, 4, 0);

if(g_himlLarge)
   {
   HICON       hIcon;
   TCHAR       szFolder[MAX_PATH];
   SHFILEINFO  sfi;

   //add the item icon
   hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, cx, cy, LR_DEFAULTCOLOR);
   ImageList_AddIcon(g_himlLarge, hIcon);

   //add the closed folder icon
   GetWindowsDirectory(szFolder, MAX_PATH);
   ZeroMemory(&sfi, sizeof(sfi));
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON);
   ImageList_AddIcon(g_himlLarge, sfi.hIcon);

   //add the open folder icon
   GetWindowsDirectory(szFolder, MAX_PATH);
   ZeroMemory(&sfi, sizeof(sfi));
   SHGetFileInfo( szFolder,
                  0,
                  &sfi,
                  sizeof(sfi),
                  SHGFI_ICON | SHGFI_OPENICON);
   ImageList_AddIcon(g_himlLarge, sfi.hIcon);
   }

}

HGLOBAL CreatePrivateClipboardData | ( | LPITEMIDLIST | ,
 |  | LPITEMIDLIST * | ,
 |  | UINT | ,
 |  | BOOL |
 | ) |  |

Definition at line 557 of file Utility.Cpp.

{
HGLOBAL        hGlobal = NULL;
LPPRIVCLIPDATA pData;
UINT           iCurPos;
UINT           cbPidl;
UINT           i;
CPidlMgr       *pPidlMgr;

pPidlMgr = new CPidlMgr();

if(!pPidlMgr)
   return NULL;

//get the size of the parent folder's PIDL
cbPidl = pPidlMgr->GetSize(pidlParent);

//get the total size of all of the PIDLs
for(i = 0; i < uItemCount; i++)
   {
   cbPidl += pPidlMgr->GetSize(aPidls[i]);
   }

/*
Find the end of the PRIVCLIPDATA structure. This is the size of the
PRIVCLIPDATA structure itself (which includes one element of aoffset) plus the
additional number of elements in aoffset.
*/
iCurPos = sizeof(PRIVCLIPDATA) + (uItemCount * sizeof(UINT));

/*
Allocate the memory for the PRIVCLIPDATA structure and it's variable length members.
*/
hGlobal = GlobalAlloc(GHND | GMEM_SHARE, (DWORD)
         (iCurPos +        // size of the PRIVCLIPDATA structure and the additional aoffset elements
         (cbPidl + 1)));   // size of the pidls

if (NULL == hGlobal)
   return (hGlobal);

pData = (LPPRIVCLIPDATA)GlobalLock(hGlobal);

if(pData)
   {
   pData->fCut = fCut;
   pData->cidl = uItemCount + 1;
   pData->aoffset[0] = iCurPos;

   //add the PIDL for the parent folder
   cbPidl = pPidlMgr->GetSize(pidlParent);
   CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)pidlParent, cbPidl);
   iCurPos += cbPidl;

   for(i = 0; i < uItemCount; i++)
      {
      //get the size of the PIDL
      cbPidl = pPidlMgr->GetSize(aPidls[i]);

      //fill out the members of the PRIVCLIPDATA structure.
      pData->aoffset[i + 1] = iCurPos;

      //copy the contents of the PIDL
      CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)aPidls[i], cbPidl);

      //set up the position of the next PIDL
      iCurPos += cbPidl;
      }

   GlobalUnlock(hGlobal);
   }

delete pPidlMgr;

return (hGlobal);
}

HGLOBAL CreateShellIDList | ( | LPITEMIDLIST | ,
 |  | LPITEMIDLIST * | ,
 |  | UINT |
 | ) |  |

Definition at line 642 of file Utility.Cpp.

{
HGLOBAL        hGlobal = NULL;
LPIDA          pData;
UINT           iCurPos;
UINT           cbPidl;
UINT           i;
CPidlMgr       *pPidlMgr;

pPidlMgr = new CPidlMgr();

if(!pPidlMgr)
   return NULL;

//get the size of the parent folder's PIDL
cbPidl = pPidlMgr->GetSize(pidlParent);

//get the total size of all of the PIDLs
for(i = 0; i < uItemCount; i++)
   {
   cbPidl += pPidlMgr->GetSize(aPidls[i]);
   }

/*
Find the end of the CIDA structure. This is the size of the
CIDA structure itself (which includes one element of aoffset) plus the
additional number of elements in aoffset.
*/
iCurPos = sizeof(CIDA) + (uItemCount * sizeof(UINT));

/*
Allocate the memory for the CIDA structure and it's variable length members.
*/
hGlobal = GlobalAlloc(GHND | GMEM_SHARE, (DWORD)
         (iCurPos +        // size of the CIDA structure and the additional aoffset elements
         (cbPidl + 1)));   // size of the pidls

if (NULL == hGlobal)
   return (hGlobal);

pData = (LPIDA)GlobalLock(hGlobal);

if(pData)
   {
   pData->cidl = uItemCount + 1;
   pData->aoffset[0] = iCurPos;

   //add the PIDL for the parent folder
   cbPidl = pPidlMgr->GetSize(pidlParent);
   CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)pidlParent, cbPidl);
   iCurPos += cbPidl;

   for(i = 0; i < uItemCount; i++)
      {
      //get the size of the PIDL
      cbPidl = pPidlMgr->GetSize(aPidls[i]);

      //fill out the members of the CIDA structure.
      pData->aoffset[i + 1] = iCurPos;

      //copy the contents of the PIDL
      CopyMemory((LPBYTE)(pData) + iCurPos, (LPBYTE)aPidls[i], cbPidl);

      //set up the position of the next PIDL
      iCurPos += cbPidl;
      }

   GlobalUnlock(hGlobal);
   }

delete pPidlMgr;

return (hGlobal);
}

BOOL DeleteDirectory ( LPCTSTR )

Definition at line 489 of file Utility.Cpp.

{
BOOL              fReturn = FALSE;
HANDLE            hFind;
WIN32_FIND_DATA   wfd;
TCHAR             szTemp[MAX_PATH];

lstrcpyn(szTemp, pszDir, ARRAYSIZE(szTemp));
SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
StrCatBuff(szTemp, TEXT("*.*"), ARRAYSIZE(szTemp));
hFind = FindFirstFile(szTemp, &wfd);

if(INVALID_HANDLE_VALUE != hFind)
   {
   do
      {
      if(lstrcmpi(wfd.cFileName, TEXT(".")) &&
         lstrcmpi(wfd.cFileName, TEXT("..")))
         {
         //build the path of the directory or file found
         lstrcpyn(szTemp, pszDir, ARRAYSIZE(szTemp));
         SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
         StrCatBuff(szTemp, wfd.cFileName, ARRAYSIZE(szTemp));

         if(FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes)
            {
            //we found a directory - call this function recursively
            DeleteDirectory(szTemp);
            }
         else
            {
            /*
            We found a file. Only delete the data file to prevent us from
            deleteting something that the user has placed in the folder.
            */
            if(0 == lstrcmpi(wfd.cFileName, c_szDataFile))
               {
               DeleteFile(szTemp);
               }
            }
         }
      }
   while(FindNextFile(hFind, &wfd));

   FindClose(hFind);

   /*
   If this fails it means the directory is not empty, so just remove our
   attributes so the enumerator won't see it.
   */
   fReturn = RemoveDirectory(pszDir);
   if(!fReturn)
      {
      DWORD dwAttr = GetFileAttributes(pszDir);
      dwAttr &= ~FILTER_ATTRIBUTES;
      fReturn = SetFileAttributes(pszDir, dwAttr);
      }
   }

return fReturn;
}

VOID DestroyImageLists ( VOID )

Definition at line 268 of file Utility.Cpp.

{
if(g_himlSmall)
   ImageList_Destroy(g_himlSmall);

if(g_himlLarge)
   ImageList_Destroy(g_himlLarge);
}

VOID GetGlobalSettings ( VOID )

Definition at line 106 of file Utility.Cpp.

{
LPITEMIDLIST   pidl = NULL;

g_nColumn = INITIAL_COLUMN_SIZE;

LoadString(g_hInst, IDS_EXT_TITLE, g_szExtTitle, TITLE_SIZE);

*g_szStoragePath = 0;
SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &pidl);

if(pidl)
   {
   IMalloc *pMalloc;

   SHGetPathFromIDList(pidl, g_szStoragePath);

   SHGetMalloc(&pMalloc);
   if(pMalloc)
      {
      pMalloc->Free(pidl);
      pMalloc->Release();
      }
   }
else
   {
   GetWindowsDirectory(g_szStoragePath, MAX_PATH);
   }

SmartAppendBackslash(g_szStoragePath, MAX_PATH);
StrCatBuff(g_szStoragePath, g_szExtTitle, MAX_PATH);
SmartAppendBackslash(g_szStoragePath, MAX_PATH);
CreateDirectory(g_szStoragePath, NULL);

HKEY     hKey;
LRESULT  lResult;
lResult = RegOpenKeyEx( HKEY_CURRENT_USER,
                        MAIN_KEY_STRING,
                        0,
                        KEY_ALL_ACCESS,
                        &hKey);

if(lResult != ERROR_SUCCESS)
   return;

//create an array to put our data in
DWORD dwArray[DISPLAY_SETTINGS_COUNT];
DWORD dwType;
DWORD dwSize = sizeof(dwArray);

//get the saved data
lResult = RegQueryValueEx( hKey,
                           VALUE_STRING,
                           NULL,
                           &dwType,
                           (LPBYTE)dwArray,
                           &dwSize);

RegCloseKey(hKey);

if(lResult != ERROR_SUCCESS)
   return;

g_nColumn = dwArray[0];
}

BOOL GetTextFromSTRRET | ( | IMalloc * | ,
 |  | LPSTRRET | ,
 |  | LPCITEMIDLIST | ,
 |  | LPTSTR | ,
 |  | DWORD |
 | ) |  |

Definition at line 413 of file Utility.Cpp.

{
if(IsBadReadPtr(pStrRet, sizeof(UINT)))
   return FALSE;

if(IsBadWritePtr(pszText, dwSize))
   return FALSE;

switch(pStrRet->uType)
   {
   case STRRET_CSTR:
      AnsiToLocal(pszText, pStrRet->cStr, dwSize);
      break;

   case STRRET_OFFSET:
      lstrcpyn(pszText, (LPTSTR)(((LPBYTE)pidl) + pStrRet->uOffset), dwSize);
      break;

   case STRRET_WSTR:
      {
      WideCharToLocal(pszText, pStrRet->pOleStr, dwSize);

      if(!pMalloc)
         {
         SHGetMalloc(&pMalloc);
         }
      else
         {
         pMalloc->AddRef();
         }
      if(pMalloc)
         {
         pMalloc->Free(pStrRet->pOleStr);
         pMalloc->Release();
         }
      }
      break;

   default:
      return FALSE;
   }

return TRUE;
}

LPVOID GetViewInterface ( HWND )

Definition at line 772 of file Utility.Cpp.

{
IUnknown *pRet = NULL;

if(IsViewWindow(hWnd))
   {
   pRet = (IUnknown*)GetWindowLongPtr(hWnd, VIEW_POINTER_OFFSET);
   }

if(pRet)
   pRet->AddRef();

return (LPVOID)pRet;
}

BOOL IsViewWindow ( HWND )

Definition at line 468 of file Utility.Cpp.

{
if(!hWnd)
   return FALSE;

TCHAR szClass[MAX_PATH] = TEXT("");

GetClassName(hWnd, szClass, MAX_PATH);

if(0 == lstrcmpi(szClass, NS_CLASS_NAME))
   return TRUE;

return FALSE;
}

BOOL CALLBACK ItemDataDlgProc | ( | HWND | ,
 |  | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) |  |

Definition at line 725 of file Utility.Cpp.

{
static LPTSTR  pszData;

switch(uMsg)
   {
   case WM_INITDIALOG:
      pszData = (LPTSTR)lParam;
      if(IsBadWritePtr((LPVOID)pszData, MAX_DATA))
         {
         EndDialog(hWnd, IDCANCEL);
         break;
         }

      SendDlgItemMessage(hWnd, IDC_DATA, EM_LIMITTEXT, MAX_DATA - 1, 0);

      SetDlgItemText(hWnd, IDC_DATA, pszData);
      break;

   case WM_COMMAND:
      switch(GET_WM_COMMAND_ID(wParam, lParam))
         {
         case IDCANCEL:
            EndDialog(hWnd, IDCANCEL);
            break;

         case IDOK:
            GetDlgItemText(hWnd, IDC_DATA, pszData, MAX_DATA);
            EndDialog(hWnd, IDOK);
            break;

         }
      break;

   default:
      break;
   }

return FALSE;
}

int LocalToAnsi | ( | LPSTR | ,
 |  | LPCTSTR | ,
 |  | DWORD |
 | ) |  |

Definition at line 333 of file Utility.Cpp.

{
*pAnsi = 0;

#ifdef UNICODE
WideCharToMultiByte( CP_ACP,
                     0,
                     pLocal,
                     -1,
                     pAnsi,
                     dwChars,
                     NULL,
                     NULL);
#else
lstrcpyn(pAnsi, pLocal, dwChars);
#endif

return lstrlenA(pAnsi);
}

int LocalToWideChar | ( | LPWSTR | ,
 |  | LPCTSTR | ,
 |  | DWORD |
 | ) |  |

Definition at line 113 of file Main.cpp.

{
    *pWide = 0;

    #ifdef UNICODE
    lstrcpyn(pWide, pLocal, dwChars);
    #else
    MultiByteToWideChar( CP_ACP,
                        0,
                        pLocal,
                        -1,
                        pWide,
                        dwChars);
    #endif

    return lstrlenW(pWide);
}

BOOL SaveGlobalSettings ( VOID )
VOID SmartAppendBackslash | ( | LPTSTR | ,
 |  | DWORD |
 | ) |  |

Definition at line 359 of file Utility.Cpp.

{
if(*(pszPath + lstrlen(pszPath) - 1) != '\\')
   StrCatBuff(pszPath, TEXT("\\"), cchPath);
}

int WideCharToLocal | ( | LPTSTR | ,
 |  | LPCWSTR | ,
 |  | DWORD |
 | ) |  |

Definition at line 283 of file Utility.Cpp.

{
*pLocal = 0;

#ifdef UNICODE
lstrcpyn(pLocal, pWide, dwChars);
#else
WideCharToMultiByte( CP_ACP,
                     0,
                     pWide,
                     -1,
                     pLocal,
                     dwChars,
                     NULL,
                     NULL);
#endif

return lstrlen(pLocal);
}

Variable Documentation

const TCHAR c_szDataFile[]

Definition at line 56 of file SampView.Cpp.

const TCHAR c_szSection[]

Definition at line 57 of file SampView.Cpp.

UINT g_DllRefCount

Definition at line 63 of file DoServer.Cpp.

HIMAGELIST g_himlLarge

Definition at line 52 of file SampView.Cpp.

HIMAGELIST g_himlSmall

Definition at line 53 of file SampView.Cpp.

HINSTANCE g_hInst

Definition at line 62 of file DoServer.Cpp.

int g_nColumn

Definition at line 58 of file SampView.Cpp.

TCHAR g_szExtTitle[]

Definition at line 55 of file SampView.Cpp.

TCHAR g_szStoragePath[]

Definition at line 54 of file SampView.Cpp.

Generated on Wed Nov 13 2024 16:53:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Viewlist.Cpp File Reference

  • WinUI
  • Shell
  • SampView

Viewlist.Cpp File Reference

#include "ViewList.h"
#include <ShellApi.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Viewlist.h File Reference

  • WinUI
  • Shell
  • SampView
Classes | Typedefs

Viewlist.h File Reference

#include <windows.h>
#include <shlobj.h>
#include "PidlMgr.h"
#include "ShlView.h"

Go to the source code of this file.

Classes

class | CViewList
struct | tagVIEWLIST

Typedefs

typedef struct tagVIEWLIST * | LPVIEWLIST
typedef struct tagVIEWLIST | VIEWLIST

Typedef Documentation

typedef struct tagVIEWLIST* LPVIEWLIST
typedef struct tagVIEWLIST VIEWLIST
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/CopyHook.Cpp File Reference

  • WinUI
  • Shell
  • ShellExt
Functions

CopyHook.Cpp File Reference

#include "priv.h"
#include "shellext.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (UINT) CShellExt

Function Documentation

STDMETHODIMP_ ( UINT )

Definition at line 53 of file CopyHook.Cpp.

{
    ODS("CShellExt::CopyCallback\r\n");

    MessageBox(NULL, "CopyCallback!", "SHELLEXT", MB_OK);

    return IDYES;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/CtxMenu.Cpp File Reference

  • WinUI
  • Shell
  • ShellExt
Defines

CtxMenu.Cpp File Reference

#include "priv.h"
#include "shellext.h"

Go to the source code of this file.

Defines

#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))

Define Documentation

#define ARRAYSIZE ( x ) (sizeof(x)/sizeof(x[0]))

Definition at line 22 of file CtxMenu.Cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/IconHdlr.Cpp File Reference

  • WinUI
  • Shell
  • ShellExt
Variables

IconHdlr.Cpp File Reference

#include "priv.h"
#include "shellext.h"

Go to the source code of this file.

Variables

HINSTANCE g_hmodThisDll

Variable Documentation

HINSTANCE g_hmodThisDll

Definition at line 25 of file DllMain.Cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/Priv.h File Reference

  • WinUI
  • Shell
  • ShellExt
Defines

Priv.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>

Go to the source code of this file.

Defines

#define | INC_OLE2
#define | ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))

Define Documentation

#define INC_OLE2

Definition at line 13 of file Priv.h.

#define ResultFromShort ( i ) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))

Definition at line 19 of file Priv.h.

Generated on Wed Nov 13 2024 16:55:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/PropShet.Cpp File Reference

  • WinUI
  • Shell
  • ShellExt
Functions | Variables

PropShet.Cpp File Reference

#include "priv.h"
#include "shellext.h"
#include "resource.h"

Go to the source code of this file.

Functions

UINT CALLBACK | GAKPageCallback (HWND hWnd, UINT uMessage, LPPROPSHEETPAGE ppsp)
INT_PTR CALLBACK | GAKPageDlgProc (HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)

Variables

UINT g_cRefThisDll
HINSTANCE | g_hmodThisDll

Function Documentation

UINT CALLBACK GAKPageCallback | ( | HWND | hWnd,
 |  | UINT | uMessage,
 |  | LPPROPSHEETPAGE | ppsp
 | ) |  |

Definition at line 44 of file PropShet.Cpp.

{
    switch(uMessage)
    {
        case PSPCB_CREATE:
            return TRUE;

        case PSPCB_RELEASE:
            if (ppsp->lParam)
            {
               ((LPCSHELLEXT)(ppsp->lParam))->Release();
            }
            return TRUE;
    }
    return TRUE;
}

INT_PTR CALLBACK GAKPageDlgProc | ( | HWND | hDlg,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 85 of file PropShet.Cpp.

{
    LPPROPSHEETPAGE psp=(LPPROPSHEETPAGE)GetWindowLongPtr(hDlg, DWLP_USER);
    UINT iIndex=0;
    int  iID;
    LPCSHELLEXT lpcs;
     char szTemp[4];

    switch (uMessage)
    {
        //
        // When the shell creates a dialog box for a property sheet page,
        // it passes the pointer to the PROPSHEETPAGE data structure as
        // lParam. The dialog procedures of extensions typically store it
        // in the DWL_USER of the dialog box window.
        //
        case WM_INITDIALOG:
            SetWindowLongPtr(hDlg, DWLP_USER, lParam);

            psp = (LPPROPSHEETPAGE)lParam;

            lpcs = (LPCSHELLEXT)psp->lParam;

            if (*(lpcs->m_szPropSheetFileUserClickedOn))
                iIndex = (UINT)GetPrivateProfileInt("IconImage",
                                                    "Index",
                                                    0,
                                                    lpcs->m_szPropSheetFileUserClickedOn);

            //Note that the following line assumes that IDC_RED, IDC_GREEN,
            //and IDC_BLUE are in sequential order, with IDC_RED having the
            //smallest value.
            SendDlgItemMessage(hDlg, iIndex + IDC_RED, BM_SETCHECK, TRUE, 0L);

            break;

        case WM_DESTROY:
            RemoveProp(hDlg, "ID");
            break;

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDC_RED:
                case IDC_GREEN:
                case IDC_BLUE:
                    SetProp(hDlg, "ID", (HANDLE)lParam);
                    break;

                default:
                    break;
            }
            break;

        case WM_NOTIFY:
            switch (((NMHDR FAR *)lParam)->code)
            {
                case PSN_SETACTIVE:
                    break;

                case PSN_APPLY:
                    //User has clicked the OK or Apply button so we'll
                    //update the icon information in the .GAK file
                    lpcs = (LPCSHELLEXT)psp->lParam;
                    iID  = GetDlgCtrlID((HWND)GetProp(hDlg, "ID"));
                    iID -= IDC_RED;
                    wsprintf(szTemp, "%i", iID);
                    WritePrivateProfileString("IconImage",
                                              "Index",
                                               szTemp,
                                               lpcs->m_szPropSheetFileUserClickedOn);
                    //Ask the shell to refresh the icon list...
                    SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, 0, 0);
                    break;

                default:
                    break;
            }
            break;

        default:
            return FALSE;
    }

    return TRUE;
}

Variable Documentation

UINT g_cRefThisDll

Definition at line 24 of file DllMain.Cpp.

HINSTANCE g_hmodThisDll

Definition at line 25 of file DllMain.Cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/Resource.h File Reference

  • WinUI
  • Shell
  • ShellExt
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_BLUE 1002
#define | IDC_GREEN 1001
#define | IDC_RED 1000
#define | IDD_GAKPAGE 132
#define | IDI_ICON1 129
#define | IDI_ICON2 130
#define | IDI_ICON3 131
#define | IDI_ICON4 133
#define | IDI_ICON5 134
#define | IDI_ICON6 135

Define Documentation

#define IDC_BLUE 1002

Definition at line 15 of file Resource.h.

#define IDC_GREEN 1001

Definition at line 14 of file Resource.h.

#define IDC_RED 1000

Definition at line 13 of file Resource.h.

#define IDD_GAKPAGE 132

Definition at line 9 of file Resource.h.

#define IDI_ICON1 129

Definition at line 6 of file Resource.h.

#define IDI_ICON2 130

Definition at line 7 of file Resource.h.

#define IDI_ICON3 131

Definition at line 8 of file Resource.h.

#define IDI_ICON4 133

Definition at line 10 of file Resource.h.

#define IDI_ICON5 134

Definition at line 11 of file Resource.h.

#define IDI_ICON6 135

Definition at line 12 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/ShellExt.Cpp File Reference

  • WinUI
  • Shell
  • ShellExt
Defines | Functions | Variables

ShellExt.Cpp File Reference

#include "priv.h"
#include <initguid.h>
#include <shlguid.h>
#include "shellext.h"

Go to the source code of this file.

Defines

#define | INITGUID

Functions

STDAPI | DllCanUnloadNow (void)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppvOut)
int APIENTRY | DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
STDMETHODIMP_ (ULONG) CShellExtClassFactory

Variables

UINT | g_cRefThisDll = 0
HINSTANCE | g_hmodThisDll = NULL

Define Documentation

#define INITGUID

Definition at line 19 of file ShellExt.Cpp.

Function Documentation

STDAPI DllCanUnloadNow ( void )

Definition at line 54 of file ShellExt.Cpp.

{
    ODS("In DLLCanUnloadNow\r\n");

    return (g_cRefThisDll == 0 ? S_OK : S_FALSE);
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppvOut
 | ) |  |

Definition at line 61 of file ShellExt.Cpp.

{
    ODS("In DllGetClassObject\r\n");

    *ppvOut = NULL;

    if (IsEqualIID(rclsid, CLSID_ShellExtension))
    {
        CShellExtClassFactory *pcf = new CShellExtClassFactory;

        return pcf->QueryInterface(riid, ppvOut);
    }

    return CLASS_E_CLASSNOTAVAILABLE;
}

int APIENTRY DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 32 of file ShellExt.Cpp.

{
    if (dwReason == DLL_PROCESS_ATTACH)
    {
        ODS("In DLLMain, DLL_PROCESS_ATTACH\r\n");

        // Extension DLL one-time initialization

        g_hmodThisDll = hInstance;
    }
    else if (dwReason == DLL_PROCESS_DETACH)
    {
        ODS("In DLLMain, DLL_PROCESS_DETACH\r\n");
    }

    return 1;   // ok
}

STDMETHODIMP_ ( ULONG )

Definition at line 237 of file ShellExt.Cpp.

{
    ODS("CShellExt::Release()\r\n");

    if (--m_cRef)
        return m_cRef;

    delete this;

    return 0L;
}

Variable Documentation

UINT g_cRefThisDll = 0

Definition at line 28 of file ShellExt.Cpp.

HINSTANCE g_hmodThisDll = NULL

Definition at line 29 of file ShellExt.Cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/ShellExt.h File Reference

  • WinUI
  • Shell
  • ShellExt
Classes | Defines | Typedefs | Functions

ShellExt.h File Reference

Go to the source code of this file.

Classes

class | CShellExt
class | CShellExtClassFactory

Defines

#define | ODS(sz) OutputDebugString(sz)

Typedefs

typedef CShellExt * | LPCSHELLEXT
typedef CShellExtClassFactory * | LPCSHELLEXTCLASSFACTORY

Functions

DEFINE_GUID (CLSID_ShellExtension, 0x87b9bd00L, 0xc65c, 0x11cd, 0xa2, 0x59, 0x00, 0xdd, 0x01, 0x0e, 0x8c, 0x28)

Define Documentation

#define ODS ( sz ) OutputDebugString(sz)

Definition at line 13 of file ShellExt.h.

Typedef Documentation

typedef CShellExt* LPCSHELLEXT

Definition at line 163 of file ShellExt.h.

typedef CShellExtClassFactory* LPCSHELLEXTCLASSFACTORY

Definition at line 40 of file ShellExt.h.

Function Documentation

DEFINE_GUID | ( | CLSID_ShellExtension | ,
 |  | 0x87b9bd00L | ,
 |  | 0xc65c | ,
 |  | 0x11cd | ,
 |  | 0xa2 | ,
 |  | 0x59 | ,
 |  | 0x00 | ,
 |  | 0xdd | ,
 |  | 0x01 | ,
 |  | 0x0e | ,
 |  | 0x8c | ,
 |  | 0x28 |
 | ) |  |
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/ShExInit.Cpp File Reference

  • WinUI
  • Shell
  • ShellExt

ShExInit.Cpp File Reference

#include "priv.h"
#include "shellext.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellIconOverlay/IcnOvrly.Cpp File Reference

  • WinUI
  • Shell
  • ShellIconOverlay
Classes | Defines | Typedefs | Functions | Variables

IcnOvrly.Cpp File Reference

#include "IcnOvrly.h"
#include <olectl.h>
#include <shlguid.h>
#include <shlwapi.h>

Go to the source code of this file.

Classes

struct | REGSTRUCT

Defines

#define | STR_EXT_TITLE TEXT("Sample Shell Icon Overlay Identifier")
#define | STR_REG_PATH TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers")

Typedefs

typedef struct REGSTRUCT * | LPREGSTRUCT

Functions

BOOL | DeleteEntireKey (HKEY hKey, LPTSTR pszSubKey)
STDAPI | DllCanUnloadNow (void)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppReturn)
BOOL WINAPI | DllMain (HINSTANCE, DWORD, LPVOID)
STDAPI | DllRegisterServer (void)
STDAPI | DllUnregisterServer (VOID)
int | LocalToWideChar (LPWSTR pWide, LPCTSTR pLocal, DWORD dwChars)
STDMETHODIMP_ (DWORD) CClassFactory
int | WideCharToLocal (LPTSTR pLocal, LPCWSTR pWide, DWORD dwChars)

Variables

DWORD g_DllRefCount
HINSTANCE | g_hInst

Define Documentation

#define STR_EXT_TITLE TEXT("Sample Shell Icon Overlay Identifier")

Definition at line 40 of file IcnOvrly.Cpp.

#define STR_REG_PATH TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers")

Definition at line 41 of file IcnOvrly.Cpp.

Typedef Documentation

typedef struct REGSTRUCT * LPREGSTRUCT

Function Documentation

BOOL DeleteEntireKey | ( | HKEY | hKey,
 |  | LPTSTR | pszSubKey
 | ) |  |

Definition at line 639 of file IcnOvrly.Cpp.

{
LRESULT  lResult;
HKEY     hEnumKey;

lResult = RegOpenKeyEx( hKey,
                        pszSubKey,
                        0,
                        KEY_ENUMERATE_SUB_KEYS,
                        &hEnumKey);

if(NOERROR == lResult)
   {
   TCHAR szKey[MAX_PATH];
   DWORD dwSize = MAX_PATH;

   while(ERROR_SUCCESS == RegEnumKeyEx(hEnumKey, 0, szKey, &dwSize, NULL, NULL, NULL, NULL))
      {
      DeleteEntireKey(hEnumKey, szKey);

      dwSize = MAX_PATH;
      }

   RegCloseKey(hEnumKey);
   }
else
   {
   return FALSE;
   }

RegDeleteKey(hKey, pszSubKey);

return TRUE;
}

STDAPI DllCanUnloadNow ( void )

Definition at line 73 of file IcnOvrly.Cpp.

{
return ((g_DllRefCount == 0) ? S_OK : S_FALSE);
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppReturn
 | ) |  |

Definition at line 84 of file IcnOvrly.Cpp.

{
*ppReturn = NULL;

//if we don't support this classid, return the proper error code
if(!IsEqualCLSID(rclsid, CLSID_SampleShellIconOverlay))
   return CLASS_E_CLASSNOTAVAILABLE;

//create a CClassFactory object and check it for validity
CClassFactory *pClassFactory = new CClassFactory();
if(NULL == pClassFactory)
   return E_OUTOFMEMORY;

//get the QueryInterface return for our return value
HRESULT hResult = pClassFactory->QueryInterface(riid, ppReturn);

//call Release to decement the ref count - creating the object set it to one
//and QueryInterface incremented it - since its being used externally (not by
//us), we only want the ref count to be 1
pClassFactory->Release();

//return the result from QueryInterface
return hResult;
}

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | lpReserved
 | ) |  |

Definition at line 49 of file IcnOvrly.Cpp.

{
switch(dwReason)
   {
   case DLL_PROCESS_ATTACH:
      g_hInst = hInstance;
      break;

   case DLL_PROCESS_DETACH:
      //MessageBeep(MB_OK);
      break;
   }

return TRUE;
}

STDAPI DllRegisterServer ( void )

Definition at line 420 of file IcnOvrly.Cpp.

{
int      i;
HKEY     hKey;
LRESULT  lResult;
DWORD    dwDisp;
TCHAR    szSubKey[MAX_PATH];
TCHAR    szCLSID[MAX_PATH];
TCHAR    szModule[MAX_PATH];
LPWSTR   pwsz;

//get the CLSID in string form
StringFromIID(CLSID_SampleShellIconOverlay, &pwsz);

if(pwsz)
   {
   WideCharToLocal(szCLSID, pwsz, ARRAYSIZE(szCLSID));

   //free the string
   LPMALLOC pMalloc;
   CoGetMalloc(1, &pMalloc);
   if(pMalloc)
      {
      pMalloc->Free(pwsz);
      pMalloc->Release();
      }
   }

//get this DLL's path and file name
GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule));

//register the CLSID entries
REGSTRUCT ClsidEntries[] = {  HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s"),                                    NULL,                   STR_EXT_TITLE,
                              HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),                    NULL,                   TEXT("%s"),
                              HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),                    TEXT("ThreadingModel"), TEXT("Apartment"),
                              NULL,                NULL,                                                NULL,                   NULL};

for(i = 0; ClsidEntries[i].hRootKey; i++)
   {
   //Create the sub key string.
   wsprintf(szSubKey, ClsidEntries[i].lpszSubKey, szCLSID);

   lResult = RegCreateKeyEx(  ClsidEntries[i].hRootKey,
                              szSubKey,
                              0,
                              NULL,
                              REG_OPTION_NON_VOLATILE,
                              KEY_WRITE,
                              NULL,
                              &hKey,
                              &dwDisp);

   if(NOERROR == lResult)
      {
      TCHAR szData[MAX_PATH] = TEXT("");

      //if necessary, create the value string
      wsprintf(szData, ClsidEntries[i].lpszData, szModule);

      lResult = RegSetValueEx(   hKey,
                                 ClsidEntries[i].lpszValueName,
                                 0,
                                 REG_SZ,
                                 (LPBYTE)szData,
                                 lstrlen(szData) + 1);

      RegCloseKey(hKey);
      }
   else
      return SELFREG_E_CLASS;
   }

//register the shell icon overlay identifier
wsprintf(szSubKey, TEXT("%s\\%s"), STR_REG_PATH, STR_EXT_TITLE);
lResult = RegCreateKeyEx(  HKEY_LOCAL_MACHINE,
                           szSubKey,
                           0,
                           NULL,
                           REG_OPTION_NON_VOLATILE,
                           KEY_WRITE,
                           NULL,
                           &hKey,
                           &dwDisp);

if(NOERROR == lResult)
   {
   //Create the value string.
   lResult = RegSetValueEx(   hKey,
                              NULL,
                              0,
                              REG_SZ,
                              (LPBYTE)szCLSID,
                              (lstrlen(szCLSID) + 1) * sizeof(TCHAR));

   RegCloseKey(hKey);
   }
else
   return SELFREG_E_CLASS;

//If running on NT, register the extension as approved.
OSVERSIONINFO  osvi;

osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);

if(VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
   {
   lstrcpyn( szSubKey, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), ARRAYSIZE(szSubKey));

   lResult = RegCreateKeyEx(  HKEY_LOCAL_MACHINE,
                              szSubKey,
                              0,
                              NULL,
                              REG_OPTION_NON_VOLATILE,
                              KEY_WRITE,
                              NULL,
                              &hKey,
                              &dwDisp);

   if(NOERROR == lResult)
      {
      TCHAR szData[MAX_PATH];

      //Create the value string.
      lstrcpyn(szData, STR_EXT_TITLE, ARRAYSIZE(szData));

      lResult = RegSetValueEx(   hKey,
                                 szCLSID,
                                 0,
                                 REG_SZ,
                                 (LPBYTE)szData,
                                 (lstrlen(szData) + 1) * sizeof(TCHAR));

      RegCloseKey(hKey);
      }
   else
      return SELFREG_E_CLASS;
   }

return S_OK;
}

STDAPI DllUnregisterServer ( VOID )

Definition at line 568 of file IcnOvrly.Cpp.

{
LPWSTR   pwsz;
TCHAR    szCLSID[MAX_PATH];
TCHAR    szSubKey[MAX_PATH];

//get the CLSID in string form
StringFromIID(CLSID_SampleShellIconOverlay, &pwsz);

if(pwsz)
   {
   WideCharToLocal(szCLSID, pwsz, ARRAYSIZE(szCLSID));

   //free the string
   LPMALLOC pMalloc;
   CoGetMalloc(1, &pMalloc);
   if(pMalloc)
      {
      pMalloc->Free(pwsz);
      pMalloc->Release();
      }
   }
else
   {
   return E_FAIL;
   }

//delete the namespace extension entries
wsprintf(szSubKey, TEXT("%s\\%s"), STR_REG_PATH, STR_EXT_TITLE);
DeleteEntireKey(HKEY_LOCAL_MACHINE, szSubKey);

//delete the object's registry entries
wsprintf(szSubKey, TEXT("CLSID\\%s"), szCLSID);
DeleteEntireKey(HKEY_CLASSES_ROOT, szSubKey);

//delete the approved extensions on NT
OSVERSIONINFO  osvi;

osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);

if(VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
   {
   LRESULT  lResult;
   HKEY     hKey;

   lResult = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
                           TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),
                           0,
                           KEY_SET_VALUE,
                           &hKey);

   if(NOERROR == lResult)
      {
      lResult = RegDeleteValue(hKey, STR_EXT_TITLE);

      RegCloseKey(hKey);
      }
   else
      return SELFREG_E_CLASS;
   }

return S_OK;
}

int LocalToWideChar | ( | LPWSTR | pWide,
 |  | LPCTSTR | pLocal,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 706 of file IcnOvrly.Cpp.

{
*pWide = 0;

#ifdef UNICODE
lstrcpyn(pWide, pLocal, dwChars);
#else
MultiByteToWideChar( CP_ACP,
                     0,
                     pLocal,
                     -1,
                     pWide,
                     dwChars);
#endif

return lstrlenW(pWide);
}

STDMETHODIMP_ ( DWORD )

Definition at line 312 of file IcnOvrly.Cpp.

{
if(--m_ObjRefCount == 0)
   delete this;

return m_ObjRefCount;
}

int WideCharToLocal | ( | LPTSTR | pLocal,
 |  | LPCWSTR | pWide,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 680 of file IcnOvrly.Cpp.

{
*pLocal = 0;

#ifdef UNICODE
lstrcpyn(pLocal, pWide, dwChars);
#else
WideCharToMultiByte( CP_ACP,
                     0,
                     pWide,
                     -1,
                     pLocal,
                     dwChars,
                     NULL,
                     NULL);
#endif

return lstrlen(pLocal);
}

Variable Documentation

DWORD g_DllRefCount

Definition at line 38 of file IcnOvrly.Cpp.

HINSTANCE g_hInst

Definition at line 37 of file IcnOvrly.Cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellIconOverlay/IcnOvrly.h File Reference

  • WinUI
  • Shell
  • ShellIconOverlay
Classes | Defines | Functions

IcnOvrly.h File Reference

#include <windows.h>
#include <initguid.h>
#include <shlobj.h>

Go to the source code of this file.

Classes

class | CClassFactory
class | CShellIconOverlayID

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))

Functions

DEFINE_GUID (CLSID_SampleShellIconOverlay, 0xea3775f2, 0x28be, 0x11d3, 0x9c, 0x8d, 0x0, 0x10, 0x5a, 0x24, 0xed, 0x29)
BOOL | DeleteEntireKey (HKEY hKey, LPTSTR pszSubKey)
int | LocalToWideChar (LPWSTR pWide, LPCTSTR pLocal, DWORD dwChars)
int | WideCharToLocal (LPTSTR pLocal, LPCWSTR pWide, DWORD dwChars)

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 101 of file IcnOvrly.h.

Function Documentation

DEFINE_GUID | ( | CLSID_SampleShellIconOverlay | ,
 |  | 0xea3775f2 | ,
 |  | 0x28be | ,
 |  | 0x11d3 | ,
 |  | 0x9c | ,
 |  | 0x8d | ,
 |  | 0x0 | ,
 |  | 0x10 | ,
 |  | 0x5a | ,
 |  | 0x24 | ,
 |  | 0xed | ,
 |  | 0x29 |
 | ) |  |
BOOL DeleteEntireKey | ( | HKEY | hKey,
 |  | LPTSTR | pszSubKey
 | ) |  |

Definition at line 708 of file ADEvent.cpp.

{
    LRESULT  lResult;
    HKEY     hEnumKey;

    lResult = RegOpenKeyEx( hKey,
                            pszSubKey,
                            0,
                            KEY_ENUMERATE_SUB_KEYS,
                            &hEnumKey);

    if(NOERROR == lResult)
    {
        TCHAR szKey[MAX_PATH];
        DWORD dwSize = MAX_PATH;

        while(ERROR_SUCCESS == RegEnumKeyEx(hEnumKey, 0, szKey, &dwSize, NULL, NULL, NULL, NULL))
        {
            DeleteEntireKey(hEnumKey, szKey);

            dwSize = MAX_PATH;
        }

        RegCloseKey(hEnumKey);
    }
    else
    {
        return FALSE;
    }

    RegDeleteKey(hKey, pszSubKey);

    return TRUE;
}

int LocalToWideChar | ( | LPWSTR | pWide,
 |  | LPCTSTR | pLocal,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 113 of file Main.cpp.

{
    *pWide = 0;

    #ifdef UNICODE
    lstrcpyn(pWide, pLocal, dwChars);
    #else
    MultiByteToWideChar( CP_ACP,
                        0,
                        pLocal,
                        -1,
                        pWide,
                        dwChars);
    #endif

    return lstrlenW(pWide);
}

int WideCharToLocal | ( | LPTSTR | pLocal,
 |  | LPCWSTR | pWide,
 |  | DWORD | dwChars
 | ) |  |

Definition at line 283 of file Utility.Cpp.

{
*pLocal = 0;

#ifdef UNICODE
lstrcpyn(pLocal, pWide, dwChars);
#else
WideCharToMultiByte( CP_ACP,
                     0,
                     pWide,
                     -1,
                     pLocal,
                     dwChars,
                     NULL,
                     NULL);
#endif

return lstrlen(pLocal);
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellIconOverlay/Resource.h File Reference

  • WinUI
  • Shell
  • ShellIconOverlay
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDI_ICON1 101
#define | IDI_OVERLAY_ICON 101

Define Documentation

#define IDI_ICON1 101

Definition at line 5 of file Resource.h.

#define IDI_OVERLAY_ICON 101

Definition at line 6 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/TrayNot/App32.C File Reference

  • WinUI
  • Shell
  • TrayNot
Classes | Defines | Functions | Variables

App32.C File Reference

#include "app32.h"
#include <windowsx.h>
#include "resource.h"

Go to the source code of this file.

Classes

struct | _DLGITEMS

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#define | MYWM_NOTIFYICON (WM_APP+100)

Functions

LRESULT | IconDrawItem (LPDRAWITEMSTRUCT lpdi)
void | NotifyAdd (HWND hDlg, UINT_PTR uIndex)
void | NotifyChange (HWND hDlg, UINT uIndex)
void | NotifyDelete (HWND hDlg, UINT uIndex)
void | StateChange (HWND hDlg, UINT_PTR uIndex, UINT uSelect)
LRESULT CALLBACK | TestAppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL | TrayMessage (HWND hDlg, DWORD dwMessage, UINT uID, HICON hIcon, PSTR pszTip)
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

HINSTANCE | g_hinst
struct _DLGITEMS | g_sDlgItems []

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 15 of file App32.C.

#define MYWM_NOTIFYICON (WM_APP+100)

Definition at line 8 of file App32.C.

Function Documentation

LRESULT IconDrawItem ( LPDRAWITEMSTRUCT lpdi )

Definition at line 72 of file App32.C.

{
  HICON hIcon;

  hIcon = (HICON)LoadImage(g_hinst, MAKEINTRESOURCE(lpdi->CtlID), IMAGE_ICON,
    16, 16, 0);
  if (!hIcon)
  {
    return(FALSE);
  }

  DrawIconEx(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top, hIcon,
    16, 16, 0, NULL, DI_NORMAL);

  return(TRUE);
}

void NotifyAdd | ( | HWND | hDlg,
 |  | UINT_PTR | uIndex
 | ) |  |

Definition at line 138 of file App32.C.

{
  TrayMessage(hDlg, NIM_ADD, g_sDlgItems[uIndex].uNotify, NULL, NULL);

  StateChange(hDlg, uIndex, 0);
}

void NotifyChange | ( | HWND | hDlg,
 |  | UINT | uIndex
 | ) |  |

Definition at line 146 of file App32.C.

{
  UINT uDelay;
  BOOL bTranslated;
  BOOL bEnable = FALSE;

  if (IsDlgButtonChecked(hDlg, g_sDlgItems[uIndex].uNotify))
  {
    uDelay = GetDlgItemInt(hDlg, g_sDlgItems[uIndex].uDelayID, &bTranslated, FALSE);

    if (uDelay)
    {
      g_sDlgItems[uIndex].dwStart = GetTickCount() + uDelay*60000;
      SetTimer(hDlg, uIndex, 60000, NULL);
    }
    else
    {
      NotifyAdd(hDlg, uIndex);
    }
  }
  else
  {
    NotifyDelete(hDlg, uIndex);
  }

  for (uIndex=0; uIndex<ARRAYSIZE(g_sDlgItems); ++uIndex)
  {
    if (IsDlgButtonChecked(hDlg, g_sDlgItems[uIndex].uNotify))
    {
      bEnable = TRUE;
    }
  }

  EnableWindow(GetDlgItem(hDlg, IDABORT), bEnable);
}

void NotifyDelete | ( | HWND | hDlg,
 |  | UINT | uIndex
 | ) |  |

Definition at line 132 of file App32.C.

{
  TrayMessage(hDlg, NIM_DELETE, g_sDlgItems[uIndex].uNotify, NULL, NULL);
}

void StateChange | ( | HWND | hDlg,
 |  | UINT_PTR | uIndex,
 |  | UINT | uSelect
 | ) |  |

Definition at line 90 of file App32.C.

{
  UINT uState1, uState2;
  HWND hwndIcon;
  LPCSTR pszIDIcon;
  UINT uTip;
  char szTip[64];

  uState1 = g_sDlgItems[uIndex].uState1;
  uState2 = g_sDlgItems[uIndex].uState2;

  // if !uSelect, find out which button is selected
  if (!uSelect)
  {
    uSelect = IsDlgButtonChecked(hDlg, uState2) ? uState2 : uState1;
  }
  // if uSelect<0, find out shich button is NOT selected
  else if ((int)uSelect < 0)
  {
    uSelect = IsDlgButtonChecked(hDlg, uState2) ? uState1 : uState2;
  }

  CheckRadioButton(hDlg, uState1, uState2, uSelect);

  // If there is a tip specified, use it, otherwise use the default
  uTip = (uSelect==uState1) ? g_sDlgItems[uIndex].uTip1 : g_sDlgItems[uIndex].uTip2;

  if (!GetDlgItemText(hDlg, uTip, szTip, ARRAYSIZE(szTip))
    && !LoadString(g_hinst, uSelect, szTip, ARRAYSIZE(szTip)))
  {
    *szTip = '\0';
  }

  // The ID of window after the radio button is the ID of the icon
  hwndIcon = GetWindow(GetDlgItem(hDlg, uSelect), GW_HWNDNEXT);
  pszIDIcon = MAKEINTRESOURCE(GetDlgCtrlID(hwndIcon));

  TrayMessage(hDlg, NIM_MODIFY, g_sDlgItems[uIndex].uNotify,
    LoadImage(g_hinst, pszIDIcon, IMAGE_ICON, 16, 16, 0), szTip);
}

LRESULT CALLBACK TestAppDlgProc | ( | HWND | hDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 183 of file App32.C.

{
  switch (uMsg)
  {
  case WM_INITDIALOG:
    break;

  case WM_DRAWITEM:
    return(IconDrawItem((LPDRAWITEMSTRUCT)lParam));
    break;

  case WM_DESTROY:
    NotifyDelete(hDlg, 0);
    NotifyDelete(hDlg, 1);
    NotifyDelete(hDlg, 2);
    break;

  case WM_TIMER:
    if (wParam >= ARRAYSIZE(g_sDlgItems))
    {
      break;
    }

    if ((int)(GetTickCount() - g_sDlgItems[wParam].dwStart) < 0)
    {
      break;
    }

    KillTimer(hDlg, wParam);
    NotifyAdd(hDlg, wParam);
    break;

  case WM_COMMAND:
    switch (GET_WM_COMMAND_ID(wParam, lParam))
    {
    case IDCANCEL:
      EndDialog(hDlg, TRUE);
      break;

    case IDABORT:
      ShowWindow(hDlg, SW_HIDE);
      break;

    case IDC_NOTIFY1:
      NotifyChange(hDlg, 0);
      break;

    case IDC_NOTIFY2:
      NotifyChange(hDlg, 1);
      break;

    case IDC_NOTIFY3:
      NotifyChange(hDlg, 2);
      break;

    case IDC_STATE11:
    case IDC_STATE12:
      StateChange(hDlg, 0, GET_WM_COMMAND_ID(wParam, lParam));
      break;

    case IDC_STATE21:
    case IDC_STATE22:
      StateChange(hDlg, 1, GET_WM_COMMAND_ID(wParam, lParam));
      break;

    case IDC_STATE31:
    case IDC_STATE32:
      StateChange(hDlg, 2, GET_WM_COMMAND_ID(wParam, lParam));
      break;
    }
    break;

  case MYWM_NOTIFYICON:
    switch (lParam)
    {
    case WM_LBUTTONDOWN:
      switch (wParam)
      {
      case IDC_NOTIFY1:
        StateChange(hDlg, 0, (UINT)-1);
        break;

      case IDC_NOTIFY2:
        StateChange(hDlg, 1, (UINT)-1);
        break;

      case IDC_NOTIFY3:
        StateChange(hDlg, 2, (UINT)-1);
        break;

      default:
        break;
      }
      break;

    case WM_RBUTTONDOWN:
      ShowWindow(hDlg, SW_SHOW);
      SetForegroundWindow(hDlg);  // make us come to the front
      break;

    default:
      break;
    }
    break;

  default:
    return(FALSE);
  }

  return(TRUE);
}

BOOL TrayMessage | ( | HWND | hDlg,
 |  | DWORD | dwMessage,
 |  | UINT | uID,
 |  | HICON | hIcon,
 |  | PSTR | pszTip
 | ) |  |

Definition at line 41 of file App32.C.

{
    BOOL res;

  NOTIFYICONDATA tnd;

  tnd.cbSize    = sizeof(tnd);
  tnd.hWnd    = hDlg;
  tnd.uID     = uID;

  tnd.uFlags    = NIF_MESSAGE|NIF_ICON|NIF_TIP;
  tnd.uCallbackMessage  = MYWM_NOTIFYICON;
  tnd.hIcon   = hIcon;
  if (pszTip)
  {
    lstrcpyn(tnd.szTip, pszTip, ARRAYSIZE(tnd.szTip));
  }
  else
  {
    tnd.szTip[0] = '\0';
  }

  res = Shell_NotifyIcon(dwMessage, &tnd);

  if (hIcon)
      DestroyIcon(hIcon);

  return res;
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 297 of file App32.C.

{
  g_hinst = hInstance;

  DialogBox(hInstance, MAKEINTRESOURCE(IDD_APP32), NULL, TestAppDlgProc);

  return(FALSE);
}

Variable Documentation

HINSTANCE g_hinst

Definition at line 12 of file App32.C.

struct _DLGITEMS g_sDlgItems[]
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/TrayNot/App32.h File Reference

  • WinUI
  • Shell
  • TrayNot
Defines | Variables

App32.h File Reference

#include <windows.h>
#include <shell.h>

Go to the source code of this file.

Defines

#define | _INC_OLE
#define | STRICT

Variables

HINSTANCE | g_hinst

Define Documentation

#define _INC_OLE

Definition at line 6 of file App32.h.

#define STRICT

Definition at line 4 of file App32.h.

Variable Documentation

HINSTANCE g_hinst

Definition at line 33 of file SetDisp.h.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/TrayNot/Resource.h File Reference

  • WinUI
  • Shell
  • TrayNot
Defines

Resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_DELAY1 1017
#define | IDC_DELAY2 1020
#define | IDC_DELAY3 1023
#define | IDC_NOTIFY1 1006
#define | IDC_NOTIFY2 1007
#define | IDC_NOTIFY3 1008
#define | IDC_STATE11 1009
#define | IDC_STATE12 1010
#define | IDC_STATE21 1011
#define | IDC_STATE22 1012
#define | IDC_STATE31 1013
#define | IDC_STATE32 1014
#define | IDC_STATIC -1
#define | IDC_TIP11 1018
#define | IDC_TIP12 1019
#define | IDC_TIP21 1021
#define | IDC_TIP22 1022
#define | IDC_TIP31 1024
#define | IDC_TIP32 1025
#define | IDD_APP32 103
#define | IDI_APP32 102
#define | IDI_STATE11 105
#define | IDI_STATE12 106
#define | IDI_STATE21 107
#define | IDI_STATE22 108
#define | IDI_STATE31 109
#define | IDI_STATE32 110

Define Documentation

#define IDC_DELAY1 1017

Definition at line 22 of file Resource.h.

#define IDC_DELAY2 1020

Definition at line 25 of file Resource.h.

#define IDC_DELAY3 1023

Definition at line 28 of file Resource.h.

#define IDC_NOTIFY1 1006

Definition at line 13 of file Resource.h.

#define IDC_NOTIFY2 1007

Definition at line 14 of file Resource.h.

#define IDC_NOTIFY3 1008

Definition at line 15 of file Resource.h.

#define IDC_STATE11 1009

Definition at line 16 of file Resource.h.

#define IDC_STATE12 1010

Definition at line 17 of file Resource.h.

#define IDC_STATE21 1011

Definition at line 18 of file Resource.h.

#define IDC_STATE22 1012

Definition at line 19 of file Resource.h.

#define IDC_STATE31 1013

Definition at line 20 of file Resource.h.

#define IDC_STATE32 1014

Definition at line 21 of file Resource.h.

#define IDC_STATIC -1

Definition at line 31 of file Resource.h.

#define IDC_TIP11 1018

Definition at line 23 of file Resource.h.

#define IDC_TIP12 1019

Definition at line 24 of file Resource.h.

#define IDC_TIP21 1021

Definition at line 26 of file Resource.h.

#define IDC_TIP22 1022

Definition at line 27 of file Resource.h.

#define IDC_TIP31 1024

Definition at line 29 of file Resource.h.

#define IDC_TIP32 1025

Definition at line 30 of file Resource.h.

#define IDD_APP32 103

Definition at line 6 of file Resource.h.

#define IDI_APP32 102

Definition at line 5 of file Resource.h.

#define IDI_STATE11 105

Definition at line 7 of file Resource.h.

#define IDI_STATE12 106

Definition at line 8 of file Resource.h.

#define IDI_STATE21 107

Definition at line 9 of file Resource.h.

#define IDI_STATE22 108

Definition at line 10 of file Resource.h.

#define IDI_STATE31 109

Definition at line 11 of file Resource.h.

#define IDI_STATE32 110

Definition at line 12 of file Resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tallmenu/tallmenu.c File Reference

  • WinUI
  • tallmenu
Defines | Functions

tallmenu.c File Reference

#include "tallmenu.h"
#include <multimon.h>

Go to the source code of this file.

Defines

#define | COMPILE_MULTIMON_STUBS

Functions

void | AdjustTallMenu (HWND hwnd, HMENU hmenuPopup)
void | GetWorkArea (HWND hwnd, LPRECT prcWork)
LRESULT CALLBACK | TallMenu_WndProc (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
int WINAPI | WinMain (HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)

Define Documentation

#define COMPILE_MULTIMON_STUBS

Definition at line 44 of file tallmenu.c.

Function Documentation

void AdjustTallMenu | ( | HWND | hwnd,
 |  | HMENU | hmenuPopup
 | ) |  |

Definition at line 91 of file tallmenu.c.

{
    int cyScreen, cyItem, cy;
    int iItem, cItem;
    RECT rc;

    /*
     *  Early-out: If the menu is empty, then there is nothing to adjust.
     *  This saves us from boundary conditions in the rest of the code.
     */
    cItem = GetMenuItemCount(hmenuPopup);
    if (cItem == 0) return;

    GetWorkArea(hwnd, &rc);

    /*
     *  Convert rectangle boundaries to height.
     */
    cyScreen = rc.bottom - rc.top;

    /*
     *  Subtract off some extra to account for the border around the menu.
     *  Note that this doesn't need to be exact, since this entire process
     *  of adjusting a tall menu is a heuristic anyway.
     */

    cyScreen -= 2 * 3 * GetSystemMetrics(SM_CYEDGE);

    /*
     *  Warning!  We assume that the menu is not owner-draw!
     *
     *  Extending this code to support owner-draw menu items is left
     *  as an exercise for the reader.  (Hint: WM_MEASUREITEM is your
     *  friend.)
     */
    GetMenuItemRect(hwnd, hmenuPopup, 0, &rc);
    cyItem = rc.bottom - rc.top;

    /*
     *  cyItem is zero if the menu item has never been shown, in which
     *  case we cheat and use the menu bar height, which is a reasonable
     *  approximation to the menu item height.
     */
    if (cyItem == 0) {
        cyItem = GetSystemMetrics(SM_CYMENU);
    }

    /*
     *  Now walk through the menu tallying up the height of each item.
     *  When it gets too tall, insert a break.
     *
     *  An annoying feature of SetMenuItemInfo is that you can't change
     *  the MFT_MENUBARBREAK flag without resetting the text, so we
     *  have to get the text, flip the flag, and set the text back
     *  with the new flag.
     */

    cy = 0;
    for (iItem = 0; iItem < cItem; iItem++) {
        MENUITEMINFO mii;
        TCHAR buf[80];

        mii.cbSize = sizeof(mii);
        mii.fMask = MIIM_TYPE | MIIM_DATA;
        mii.dwTypeData = buf;
        mii.cch = 80;

        if (GetMenuItemInfo(hmenuPopup, iItem, MF_BYPOSITION, &mii)) {
            if (cy > cyScreen) {
                cy = 0;
                mii.fType |= MFT_MENUBARBREAK;
            } else {
                mii.fType &= ~MFT_MENUBARBREAK;
            }

            SetMenuItemInfo(hmenuPopup, iItem, MF_BYPOSITION, &mii);
        }
        cy += cyItem;
    }

}

void GetWorkArea | ( | HWND | hwnd,
 |  | LPRECT | prcWork
 | ) |  |

Definition at line 60 of file tallmenu.c.

{
    HMONITOR hmon;
    MONITORINFO moni;

    hmon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);

    moni.cbSize = sizeof(moni);
    GetMonitorInfo(hmon, &moni);

    *prcWork = moni.rcWork;
}

LRESULT CALLBACK TallMenu_WndProc | ( | HWND | hwnd,
 |  | UINT | uiMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 182 of file tallmenu.c.

{
    switch (uiMsg) {

    /*
     *  If a popup menu is about to be displayed, first make sure
     *  it isn't too tall for the screen.
     */
    case WM_INITMENUPOPUP:
        AdjustTallMenu(hwnd, (HMENU)wParam);
        break;

    /*
     *  The app exits when this window is destroyed.
     */
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    }

    return DefWindowProc(hwnd, uiMsg, wParam, lParam);
}

int WINAPI WinMain | ( | HINSTANCE | hinst,
 |  | HINSTANCE | hinstPrev,
 |  | LPSTR | pszCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 217 of file tallmenu.c.

{
    WNDCLASS wc;
    MSG msg;
    HWND hwnd;

    wc.style = 0;
    wc.lpfnWndProc = TallMenu_WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hinst;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
    wc.lpszMenuName = "TallMenu";
    wc.lpszClassName = "TallMenu";

    RegisterClass(&wc);

    hwnd = CreateWindow(
        "TallMenu",                     /* Class Name */
        "Tall Menu Sample",             /* Title */
        WS_OVERLAPPEDWINDOW,            /* Style */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
        CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
        NULL,                           /* Parent */
        NULL,                           /* Use class menu */
        hinst,                          /* Instance */
        0);                             /* No special parameters */

    ShowWindow(hwnd, nCmdShow);

    while (GetMessage(&msg, NULL, 0, 0)) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return 0;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tallmenu/tallmenu.h File Reference

  • WinUI
  • tallmenu
Defines

tallmenu.h File Reference

#include <windows.h>

Go to the source code of this file.

Defines

#define STRICT

Define Documentation

#define STRICT

Definition at line 5 of file tallmenu.h.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/context.cpp File Reference

  • WinUI
  • tsfapp

context.cpp File Reference

#include "TSFEdit.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:54:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/dataobj.cpp File Reference

  • WinUI
  • tsfapp
Functions

dataobj.cpp File Reference

#include "DataObj.h"

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CTSFDataObject

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 109 of file dataobj.cpp.

{
    if(--m_ObjRefCount == 0)
    {
        delete this;
    }

    return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/dataobj.h File Reference

  • WinUI
  • tsfapp
Classes

dataobj.h File Reference

#include <windows.h>

Go to the source code of this file.

Classes

class CTSFDataObject
Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/funcprov.cpp File Reference

  • WinUI
  • tsfapp

funcprov.cpp File Reference

#include "TSFEdit.h"
#include "globals.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/globals.h File Reference

  • WinUI
  • tsfapp
Defines | Variables

globals.h File Reference

#include <windows.h>
#include <msctf.h>

Go to the source code of this file.

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))

Variables

ITfThreadMgr * | g_pThreadMgr

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 38 of file globals.h.

Variable Documentation

ITfThreadMgr* g_pThreadMgr

Definition at line 34 of file tsfapp.cpp.

Generated on Wed Nov 13 2024 16:54:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/persist.cpp File Reference

  • WinUI
  • tsfapp
Defines

persist.cpp File Reference

#include "TSFEdit.h"
#include "PropLdr.h"

Go to the source code of this file.

Defines

#define BLOCK_SIZE 256

Define Documentation

#define BLOCK_SIZE 256

Definition at line 33 of file persist.cpp.

Generated on Wed Nov 13 2024 16:53:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/propldr.cpp File Reference

  • WinUI
  • tsfapp
Functions

propldr.cpp File Reference

#include "PropLdr.h"

Go to the source code of this file.

Functions

STDAPI_ (ULONG) CTSFPersistentPropertyLoader

Function Documentation

STDAPI_ ( ULONG )

Definition at line 108 of file propldr.cpp.

{
    if(--m_ObjRefCount == 0)
    {
        delete this;
        return 0;
    }

    return m_ObjRefCount;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/propldr.h File Reference

  • WinUI
  • tsfapp
Classes

propldr.h File Reference

#include <windows.h>
#include <msctf.h>

Go to the source code of this file.

Classes

class CTSFPersistentPropertyLoader
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/resource.h File Reference

  • WinUI
  • tsfapp
Defines

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDD_ABOUT_DIALOG 103
#define | IDI_MAIN_ICON 101
#define | IDM_ABOUT 40002
#define | IDM_EXIT 40001
#define | IDM_GET_COMPOSING 40009
#define | IDM_GET_READING 40008
#define | IDM_GET_TEXTOWNER 40007
#define | IDM_GETDISPATTR 40005
#define | IDM_GETPRESERVEDKEY 40003
#define | IDM_LOAD 40013
#define | IDM_PLAYBACK 40011
#define | IDM_RECONVERT 40010
#define | IDM_SAVE 40012
#define | IDM_TERMINATE_COMPOSITION 40006
#define | IDM_TEST 40004
#define | IDR_MAIN_MENU 102

Define Documentation

#define IDD_ABOUT_DIALOG 103

Definition at line 7 of file resource.h.

#define IDI_MAIN_ICON 101

Definition at line 5 of file resource.h.

#define IDM_ABOUT 40002

Definition at line 9 of file resource.h.

#define IDM_EXIT 40001

Definition at line 8 of file resource.h.

#define IDM_GET_COMPOSING 40009

Definition at line 16 of file resource.h.

#define IDM_GET_READING 40008

Definition at line 15 of file resource.h.

#define IDM_GET_TEXTOWNER 40007

Definition at line 14 of file resource.h.

#define IDM_GETDISPATTR 40005

Definition at line 12 of file resource.h.

#define IDM_GETPRESERVEDKEY 40003

Definition at line 10 of file resource.h.

#define IDM_LOAD 40013

Definition at line 20 of file resource.h.

#define IDM_PLAYBACK 40011

Definition at line 18 of file resource.h.

#define IDM_RECONVERT 40010

Definition at line 17 of file resource.h.

#define IDM_SAVE 40012

Definition at line 19 of file resource.h.

#define IDM_TERMINATE_COMPOSITION 40006

Definition at line 13 of file resource.h.

#define IDM_TEST 40004

Definition at line 11 of file resource.h.

#define IDR_MAIN_MENU 102

Definition at line 6 of file resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/test.cpp File Reference

  • WinUI
  • tsfapp

test.cpp File Reference

#include "TSFEdit.h"
#include <ctffunc.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/textstor.cpp File Reference

  • WinUI
  • tsfapp

textstor.cpp File Reference

#include "TSFEdit.h"
#include "DataObj.h"
#include "Globals.h"
#include <tsattrs.h>

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/tsfapp.cpp File Reference

  • WinUI
  • tsfapp
Functions | Variables

tsfapp.cpp File Reference

#include "TSFWnd.h"

Go to the source code of this file.

Functions

int WINAPI | WinMain (HINSTANCE, HINSTANCE, LPSTR, int)

Variables

ITfThreadMgr * | g_pThreadMgr

Function Documentation

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 42 of file tsfapp.cpp.

{
    CTSFMainWnd *pMainWnd;
    int         nReturn = 0;

    CoInitialize(NULL);

    pMainWnd = new CTSFMainWnd(hInstance);

    if(NULL == pMainWnd)
    {
        return 0;
    }

    if(pMainWnd->Initialize(nCmdShow))
    {
        ITfKeystrokeMgr *pKeyMgr;
        ITfMessagePump  *pMsgPump;

        // get the keystroke manager interfce
        if(SUCCEEDED(g_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeyMgr)))
        {
            // get the message pump wrapper interface
            if(SUCCEEDED(g_pThreadMgr->QueryInterface(IID_ITfMessagePump, (void **)&pMsgPump)))
            {
                BOOL    fResult = TRUE;

                while(fResult)
                {
                    MSG     msg;
                    BOOL    fEaten;

                    /*
                    Get the next message in the queue. fResult receives FALSE if WM_QUIT is encountered
                    */
                    if(FAILED(pMsgPump->GetMessage(&msg, NULL, 0, 0, &fResult)))
                    {
                        fResult = FALSE;
                    }
                    else if(WM_KEYDOWN == msg.message)
                    {
                        // does an ime want it?
                        if (pKeyMgr->TestKeyDown(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten &&
                            pKeyMgr->KeyDown(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten)
                        {
                            continue;
                        }
                    }
                    else if(WM_KEYUP == msg.message)
                    {
                        // does an ime want it?
                        if (pKeyMgr->TestKeyUp(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten &&
                            pKeyMgr->KeyUp(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten)
                        {
                            continue;
                        }
                    }

                    if(fResult)
                    {
                        TranslateMessage(&msg);
                        DispatchMessage(&msg);
                    }

                    if(WM_QUIT == msg.message)
                    {
                        nReturn = (int)msg.wParam;
                    }
                }

                pMsgPump->Release();
            }

            pKeyMgr->Release();
        }
    }

    delete pMainWnd;

    CoUninitialize();

    return nReturn;
}

Variable Documentation

ITfThreadMgr* g_pThreadMgr

Definition at line 34 of file tsfapp.cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/tsfedit.cpp File Reference

  • WinUI
  • tsfapp
Defines | Functions | Variables

tsfedit.cpp File Reference

#include "TSFEdit.h"
#include "Globals.h"
#include <ctffunc.h>
#include <initguid.h>
#include <tsattrs.h>

Go to the source code of this file.

Defines

#define | THIS_POINTER_OFFSET GWLP_USERDATA

Functions

STDMETHODIMP_ (DWORD) CTSFEditWnd

Variables

TCHAR | g_szTSFEditClassName [] = TEXT("TSFEditWndClass")

Define Documentation

#define THIS_POINTER_OFFSET GWLP_USERDATA

Definition at line 43 of file tsfedit.cpp.

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 1738 of file tsfedit.cpp.

{
    if(--m_ObjRefCount == 0)
    {
        delete this;
        return 0;
    }

    return m_ObjRefCount;
}

Variable Documentation

TCHAR g_szTSFEditClassName[] = TEXT("TSFEditWndClass")

Definition at line 41 of file tsfedit.cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/tsfedit.h File Reference

  • WinUI
  • tsfapp
Classes | Defines | Typedefs

tsfedit.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <msctf.h>
#include <olectl.h>
#include <commctrl.h>
#include "resource.h"
#include "resource.h"

Go to the source code of this file.

Classes

struct | ADVISE_SINK
struct | ATTRIBUTES
class | CTSFEditWnd

Defines

#define | ATTR_FLAG_DEFAULT 2
#define | ATTR_FLAG_NONE 0
#define | ATTR_FLAG_REQUESTED 1
#define | ATTR_INDEX_MODEBIAS 0
#define | ATTR_INDEX_TEXT_ORIENTATION 1
#define | ATTR_INDEX_TEXT_VERTICALWRITING 2
#define | EDIT_VIEW_COOKIE 0
#define | IDC_EDIT 1000
#define | IDC_STATUSBAR 1001
#define | MAX_COMPOSITIONS 5
#define | NUM_SUPPORTED_ATTRS 3

Typedefs

typedef struct ADVISE_SINK * | PADVISE_SINK
typedef struct ATTRIBUTES * | PATTRIBUTES

Define Documentation

#define ATTR_FLAG_DEFAULT 2

Definition at line 56 of file tsfedit.h.

#define ATTR_FLAG_NONE 0

Definition at line 54 of file tsfedit.h.

#define ATTR_FLAG_REQUESTED 1

Definition at line 55 of file tsfedit.h.

#define ATTR_INDEX_MODEBIAS 0

Definition at line 50 of file tsfedit.h.

#define ATTR_INDEX_TEXT_ORIENTATION 1

Definition at line 51 of file tsfedit.h.

#define ATTR_INDEX_TEXT_VERTICALWRITING 2

Definition at line 52 of file tsfedit.h.

#define EDIT_VIEW_COOKIE 0

Definition at line 36 of file tsfedit.h.

#define IDC_EDIT 1000

Definition at line 38 of file tsfedit.h.

#define IDC_STATUSBAR 1001

Definition at line 39 of file tsfedit.h.

#define MAX_COMPOSITIONS 5

Definition at line 58 of file tsfedit.h.

#define NUM_SUPPORTED_ATTRS 3

Definition at line 48 of file tsfedit.h.

Typedef Documentation

typedef struct ADVISE_SINK * PADVISE_SINK
typedef struct ATTRIBUTES * PATTRIBUTES
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/tsfwnd.cpp File Reference

  • WinUI
  • tsfapp
Defines | Variables

tsfwnd.cpp File Reference

#include "TSFWnd.h"
#include "Globals.h"

Go to the source code of this file.

Defines

#define | THIS_POINTER_OFFSET GWLP_USERDATA

Variables

TCHAR | g_szTSFAppTitle [] = TEXT("TSF Test Application")
TCHAR | g_szTSFMainClassName [] = TEXT("TSFMainWndClass")

Define Documentation

#define THIS_POINTER_OFFSET GWLP_USERDATA

Definition at line 36 of file tsfwnd.cpp.

Variable Documentation

TCHAR g_szTSFAppTitle[] = TEXT("TSF Test Application")

Definition at line 34 of file tsfwnd.cpp.

TCHAR g_szTSFMainClassName[] = TEXT("TSFMainWndClass")

Definition at line 33 of file tsfwnd.cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/tsfwnd.h File Reference

  • WinUI
  • tsfapp
Classes

tsfwnd.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <msctf.h>
#include "resource.h"
#include "TSFEdit.h"

Go to the source code of this file.

Classes

class CTSFMainWnd
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/case.cpp File Reference

  • WinUI
  • TSFcase
Functions

case.cpp File Reference

#include "globals.h"
#include "case.h"

Go to the source code of this file.

Functions

STDAPI_ (ULONG) CCaseTextService

Function Documentation

STDAPI_ ( ULONG )

Definition at line 141 of file case.cpp.

{
    LONG cr = --_cRef;

    assert(_cRef >= 0);

    if (_cRef == 0)
    {
        delete this;
    }

    return cr;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/case.h File Reference

  • WinUI
  • TSFcase
Classes

case.h File Reference

Go to the source code of this file.

Classes

class CCaseTextService
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/dllmain.cpp File Reference

  • WinUI
  • TSFcase
Functions

dllmain.cpp File Reference

#include "globals.h"
#include "snoop.h"

Go to the source code of this file.

Functions

BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID pvReserved)

Function Documentation

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | pvReserved
 | ) |  |

Definition at line 16 of file dllmain.cpp.

{
    switch (dwReason)
    {
        case DLL_PROCESS_ATTACH:

            g_hInst = hInstance;

            if (!InitializeCriticalSectionAndSpinCount(&g_cs, 0))
                return FALSE;

            CSnoopWnd::_InitClass();

            break;

        case DLL_PROCESS_DETACH:

            CSnoopWnd::_UninitClass();

            DeleteCriticalSection(&g_cs);

            break;
    }

    return TRUE;
}

Generated on Wed Nov 13 2024 16:54:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/editsess.h File Reference

  • WinUI
  • TSFcase
Classes

editsess.h File Reference

Go to the source code of this file.

Classes

class CEditSessionBase
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/editsink.cpp File Reference

  • WinUI
  • TSFcase

editsink.cpp File Reference

#include "globals.h"
#include "case.h"
#include "snoop.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/flipdoc.cpp File Reference

  • WinUI
  • TSFcase
Classes

flipdoc.cpp File Reference

#include "globals.h"
#include "case.h"
#include "editsess.h"

Go to the source code of this file.

Classes

class CFlipDocEditSession
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/flipsel.cpp File Reference

  • WinUI
  • TSFcase
Classes

flipsel.cpp File Reference

#include "globals.h"
#include "case.h"
#include "editsess.h"

Go to the source code of this file.

Classes

class CFlipEditSession
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/globals.cpp File Reference

  • WinUI
  • TSFcase
Functions | Variables

globals.cpp File Reference

#include "globals.h"

Go to the source code of this file.

Functions

void | ToggleCase (TfEditCookie ec, ITfRange *pRange, BOOL fIgnoreRangeEnd)
WCHAR | ToggleChar (WCHAR ch)

Variables

const CLSID | c_clsidCaseTextService = { 0x6565d455, 0x5030, 0x4c0f, {0x88, 0x71, 0x83, 0xf6, 0xaf, 0xde, 0x51, 0x4f} }
const GUID | c_guidCaseProfile = { 0x4d5459db, 0x7543, 0x42c0, {0x92, 0x04, 0x91, 0x95, 0xb9, 0x1f, 0x6f, 0xb8} }
const GUID | c_guidLangBarItemButton = { 0x01679c88, 0x5141, 0x4ee5, {0xa4, 0x7f, 0xc8, 0xd5, 0x86, 0xff, 0x37, 0xe1} }
LONG | g_cRefDll = -1
CRITICAL_SECTION | g_cs
HINSTANCE | g_hInst

Function Documentation

void ToggleCase | ( | TfEditCookie | ec,
 |  | ITfRange * | pRange,
 |  | BOOL | fIgnoreRangeEnd
 | ) |  |

Definition at line 55 of file globals.cpp.

{
    ITfRange *pRangeToggle;
    ULONG cch;
    ULONG i;
    DWORD dwFlags;
    WCHAR achText[64];

    // backup the current range
    if (pRange->Clone(&pRangeToggle) != S_OK)
        return;

    dwFlags = TF_TF_MOVESTART | (fIgnoreRangeEnd ? TF_TF_IGNOREEND : 0);

    while (TRUE)
    {
        // grab the next block of chars
        if (pRange->GetText(ec, dwFlags, achText, ARRAYSIZE(achText), &cch) != S_OK)
            break;

        // out of text?
        if (cch == 0)
            break;

        // toggle the case
        for (i=0; i<cch; i++)
        {
            achText[i] = ToggleChar(achText[i]);
        }

        // shift pRangeToggle so it covers just the text we read
        if (pRangeToggle->ShiftEndToRange(ec, pRange, TF_ANCHOR_START) != S_OK)
            break;

        // replace the text
        pRangeToggle->SetText(ec, 0, achText, cch);

        // prepare for next iteration
        pRangeToggle->Collapse(ec, TF_ANCHOR_END);
    }

    pRangeToggle->Release();
}

WCHAR ToggleChar ( WCHAR ch )

Definition at line 31 of file globals.cpp.

{
    // toggle english ascii
    if ((ch >= 'a' && ch <= 'z') ||
        (ch >= 'A' && ch <= 'Z'))
    {
        return ch ^ 32;
    }

    // give up for non-ascii
    return ch;
}

Variable Documentation

const CLSID c_clsidCaseTextService = { 0x6565d455, 0x5030, 0x4c0f, {0x88, 0x71, 0x83, 0xf6, 0xaf, 0xde, 0x51, 0x4f} }

Definition at line 16 of file globals.cpp.

const GUID c_guidCaseProfile = { 0x4d5459db, 0x7543, 0x42c0, {0x92, 0x04, 0x91, 0x95, 0xb9, 0x1f, 0x6f, 0xb8} }

Definition at line 19 of file globals.cpp.

const GUID c_guidLangBarItemButton = { 0x01679c88, 0x5141, 0x4ee5, {0xa4, 0x7f, 0xc8, 0xd5, 0x86, 0xff, 0x37, 0xe1} }

Definition at line 22 of file globals.cpp.

LONG g_cRefDll = -1

Definition at line 11 of file globals.cpp.

CRITICAL_SECTION g_cs

Definition at line 13 of file globals.cpp.

HINSTANCE g_hInst

Definition at line 9 of file globals.cpp.

Generated on Wed Nov 13 2024 16:53:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/globals.h File Reference

  • WinUI
  • TSFcase
Defines | Functions | Variables

globals.h File Reference

#include <windows.h>
#include <ole2.h>
#include <olectl.h>
#include <assert.h>
#include "msctf.h"

Go to the source code of this file.

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#define | CASE_DESC L"Case Text Service"
#define | CASE_DESC_A "Case Text Service"
#define | CASE_ICON_INDEX 0
#define | CASE_LANGID MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
#define | CASE_MODEL TEXT("Apartment")
#define | LANGBAR_ITEM_DESC L"Case Menu"
#define | SafeRelease(punk)
#define | SafeReleaseClear(punk)

Functions

void | DllAddRef ()
void | DllRelease ()
void | InsertTextAtSelection (TfEditCookie ec, ITfContext *pContext, const WCHAR *pchText, ULONG cchText)
void | SafeStringCopy (WCHAR *pchDst, ULONG cchMax, const WCHAR *pchSrc)
void | ToggleCase (TfEditCookie ec, ITfRange *range, BOOL fIgnoreRangeEnd)

Variables

const CLSID | c_clsidCaseTextService
const GUID | c_guidCaseProfile
const GUID | c_guidLangBarItemButton
LONG | g_cRefDll
CRITICAL_SECTION | g_cs
HINSTANCE | g_hInst

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 22 of file globals.h.

#define CASE_DESC L"Case Text Service"

Definition at line 26 of file globals.h.

#define CASE_DESC_A "Case Text Service"

Definition at line 27 of file globals.h.

#define CASE_ICON_INDEX 0

Definition at line 32 of file globals.h.

#define CASE_LANGID MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)

Definition at line 24 of file globals.h.

#define CASE_MODEL TEXT("Apartment")

Definition at line 28 of file globals.h.

#define LANGBAR_ITEM_DESC L"Case Menu"

Definition at line 30 of file globals.h.

#define SafeRelease ( punk )
Value:
{                               \
    if ((punk) != NULL)         \
    {                           \
        (punk)->Release();      \
    }                           \
}

Definition at line 34 of file globals.h.

#define SafeReleaseClear ( punk )
Value:
{                               \
    if ((punk) != NULL)         \
    {                           \
        (punk)->Release();      \
        (punk) = NULL;          \
    }                           \
}

Definition at line 42 of file globals.h.

Function Documentation

void DllAddRef ( )

Definition at line 21 of file server.cpp.

{
    InterlockedIncrement(&g_cRefDll);
}

void DllRelease ( )

Definition at line 32 of file server.cpp.

{
    if (InterlockedDecrement(&g_cRefDll) < 0) // g_cRefDll == -1 with zero refs
    {
        EnterCriticalSection(&g_cs);

        // need to check ref again after grabbing mutex
        if (g_ObjectInfo[0] != NULL)
        {
            FreeGlobalObjects();
        }
        assert(g_cRefDll == -1);

        LeaveCriticalSection(&g_cs);
    }
}

void InsertTextAtSelection | ( | TfEditCookie | ec,
 |  | ITfContext * | pContext,
 |  | const WCHAR * | pchText,
 |  | ULONG | cchText
 | ) |  |

Definition at line 79 of file hello.cpp.

{
    ITfInsertAtSelection *pInsertAtSelection;
    ITfRange *pRange;
    TF_SELECTION tfSelection;

    // we need a special interface to insert text at the selection
    if (pContext->QueryInterface(IID_ITfInsertAtSelection, (void **)&pInsertAtSelection) != S_OK)
        return;

    // insert the text
    if (pInsertAtSelection->InsertTextAtSelection(ec, 0, pchText, cchText, &pRange) != S_OK)
        goto Exit;

    // update the selection, we'll make it an insertion point just past
    // the inserted text.
    pRange->Collapse(ec, TF_ANCHOR_END);

    tfSelection.range = pRange;
    tfSelection.style.ase = TF_AE_NONE;
    tfSelection.style.fInterimChar = FALSE;

    pContext->SetSelection(ec, 1, &tfSelection);

    pRange->Release();

Exit:
    pInsertAtSelection->Release();
}

void SafeStringCopy | ( | WCHAR * | pchDst,
 |  | ULONG | cchMax,
 |  | const WCHAR * | pchSrc |
 | ) |  |  | [inline]

Definition at line 59 of file globals.h.

{
    if (cchMax > 0)
    {
        wcsncpy(pchDst, pchSrc, cchMax);
        pchDst[cchMax-1] = '\0';
    }
}

void ToggleCase | ( | TfEditCookie | ec,
 |  | ITfRange * | range,
 |  | BOOL | fIgnoreRangeEnd
 | ) |  |

Definition at line 55 of file globals.cpp.

{
    ITfRange *pRangeToggle;
    ULONG cch;
    ULONG i;
    DWORD dwFlags;
    WCHAR achText[64];

    // backup the current range
    if (pRange->Clone(&pRangeToggle) != S_OK)
        return;

    dwFlags = TF_TF_MOVESTART | (fIgnoreRangeEnd ? TF_TF_IGNOREEND : 0);

    while (TRUE)
    {
        // grab the next block of chars
        if (pRange->GetText(ec, dwFlags, achText, ARRAYSIZE(achText), &cch) != S_OK)
            break;

        // out of text?
        if (cch == 0)
            break;

        // toggle the case
        for (i=0; i<cch; i++)
        {
            achText[i] = ToggleChar(achText[i]);
        }

        // shift pRangeToggle so it covers just the text we read
        if (pRangeToggle->ShiftEndToRange(ec, pRange, TF_ANCHOR_START) != S_OK)
            break;

        // replace the text
        pRangeToggle->SetText(ec, 0, achText, cch);

        // prepare for next iteration
        pRangeToggle->Collapse(ec, TF_ANCHOR_END);
    }

    pRangeToggle->Release();
}

Variable Documentation

const CLSID c_clsidCaseTextService

Definition at line 16 of file globals.cpp.

const GUID c_guidCaseProfile

Definition at line 19 of file globals.cpp.

const GUID c_guidLangBarItemButton

Definition at line 22 of file globals.cpp.

LONG g_cRefDll

Definition at line 11 of file globals.cpp.

CRITICAL_SECTION g_cs

Definition at line 41 of file SServer.Cpp.

HINSTANCE g_hInst

Definition at line 62 of file DoServer.Cpp.

Generated on Wed Nov 13 2024 16:54:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/hello.cpp File Reference

  • WinUI
  • TSFcase
Classes | Functions

hello.cpp File Reference

#include "globals.h"
#include "case.h"
#include "editsess.h"

Go to the source code of this file.

Classes

class | CHelloEditSession

Functions

void | InsertTextAtSelection (TfEditCookie ec, ITfContext *pContext, const WCHAR *pchText, ULONG cchText)

Function Documentation

void InsertTextAtSelection | ( | TfEditCookie | ec,
 |  | ITfContext * | pContext,
 |  | const WCHAR * | pchText,
 |  | ULONG | cchText
 | ) |  |

Definition at line 79 of file hello.cpp.

{
    ITfInsertAtSelection *pInsertAtSelection;
    ITfRange *pRange;
    TF_SELECTION tfSelection;

    // we need a special interface to insert text at the selection
    if (pContext->QueryInterface(IID_ITfInsertAtSelection, (void **)&pInsertAtSelection) != S_OK)
        return;

    // insert the text
    if (pInsertAtSelection->InsertTextAtSelection(ec, 0, pchText, cchText, &pRange) != S_OK)
        goto Exit;

    // update the selection, we'll make it an insertion point just past
    // the inserted text.
    pRange->Collapse(ec, TF_ANCHOR_END);

    tfSelection.range = pRange;
    tfSelection.style.ase = TF_AE_NONE;
    tfSelection.style.fInterimChar = FALSE;

    pContext->SetSelection(ec, 1, &tfSelection);

    pRange->Release();

Exit:
    pInsertAtSelection->Release();
}

Generated on Wed Nov 13 2024 16:54:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/keys.cpp File Reference

  • WinUI
  • TSFcase
Classes | Functions

keys.cpp File Reference

#include "globals.h"
#include "case.h"
#include "editsess.h"

Go to the source code of this file.

Classes

class | CKeystrokeEditSession

Functions

BOOL | IsKeyEaten (BOOL fFlipKeys, WPARAM wParam)

Function Documentation

BOOL IsKeyEaten | ( | BOOL | fFlipKeys,
 |  | WPARAM | wParam |
 | ) |  |  | [inline]

Definition at line 39 of file keys.cpp.

{
    // we're only interested in VK_A - VK_Z, when the "Flip Keys" menu option
    // is on
    return fFlipKeys && (wParam >= 'A') && (wParam <= 'Z');
}

Generated on Wed Nov 13 2024 16:54:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/langbar.cpp File Reference

  • WinUI
  • TSFcase
Classes | Defines | Functions | Variables

langbar.cpp File Reference

#include "globals.h"
#include "case.h"
#include "resource.h"

Go to the source code of this file.

Classes

class | CLangBarItemButton

Defines

#define | CASE_LANGBARITEMSINK_COOKIE 0x0fab0fab
#define | MENU_FLIPKEYS_INDEX 4
#define | MENU_SHOWSNOOP_INDEX 0

Functions

STDAPI_ (ULONG) CLangBarItemButton

Variables

struct {
const WCHAR * pchDesc
void(* pfnHandler )(CCaseTextService *_this)
} c_rgMenuItems []

Define Documentation

#define CASE_LANGBARITEMSINK_COOKIE 0x0fab0fab

Definition at line 11 of file langbar.cpp.

#define MENU_FLIPKEYS_INDEX 4

Definition at line 28 of file langbar.cpp.

#define MENU_SHOWSNOOP_INDEX 0

Definition at line 27 of file langbar.cpp.

Function Documentation

STDAPI_ ( ULONG )

Definition at line 152 of file langbar.cpp.

{
    LONG cr = --_cRef;

    assert(_cRef >= 0);

    if (_cRef == 0)
    {
        delete this;
    }

    return cr;
}

Variable Documentation

struct { ... } c_rgMenuItems[]
const WCHAR* pchDesc

Definition at line 15 of file langbar.cpp.

void(* pfnHandler)(CCaseTextService *_this)

Definition at line 16 of file langbar.cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/precomp.cpp File Reference

  • WinUI
  • TSFcase

precomp.cpp File Reference

#include "globals.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/register.cpp File Reference

  • WinUI
  • TSFcase
Defines | Functions | Variables

register.cpp File Reference

#include <windows.h>
#include <ole2.h>
#include "msctf.h"
#include "globals.h"
#include "case.h"

Go to the source code of this file.

Defines

#define | CLSID_STRLEN 38

Functions

BOOL | CLSIDToStringA (REFGUID refGUID, char *pchA)
LONG | RecurseDeleteKey (HKEY hParentKey, LPCTSTR lpszKey)

Variables

struct {
const GUID * pguid
const GUID * pguidCategory
} c_rgCategories []

Define Documentation

#define CLSID_STRLEN 38

Definition at line 13 of file register.cpp.

Function Documentation

BOOL CLSIDToStringA | ( | REFGUID | refGUID,
 |  | char * | pchA
 | ) |  |

Definition at line 140 of file register.cpp.

{
    static const BYTE GuidMap[] = {3, 2, 1, 0, '-', 5, 4, '-', 7, 6, '-',
                                   8, 9, '-', 10, 11, 12, 13, 14, 15};

    static const char szDigits[] = "0123456789ABCDEF";

    int i;
    char *p = pchA;

    const BYTE * pBytes = (const BYTE *) &refGUID;

    *p++ = '{';
    for (i = 0; i < sizeof(GuidMap); i++)
    {
        if (GuidMap[i] == '-')
        {
            *p++ = '-';
        }
        else
        {
            *p++ = szDigits[ (pBytes[GuidMap[i]] & 0xF0) >> 4 ];
            *p++ = szDigits[ (pBytes[GuidMap[i]] & 0x0F) ];
        }
    }

    *p++ = '}';
    *p   = '\0';

    return TRUE;
}

LONG RecurseDeleteKey | ( | HKEY | hParentKey,
 |  | LPCTSTR | lpszKey
 | ) |  |

Definition at line 179 of file register.cpp.

{
    HKEY hKey;
    LONG lRes;
    FILETIME time;
    TCHAR szBuffer[256];
    DWORD dwSize = ARRAYSIZE(szBuffer);

    if (RegOpenKey(hParentKey, lpszKey, &hKey) != ERROR_SUCCESS)
        return ERROR_SUCCESS; // let's assume we couldn't open it because it's not there

    lRes = ERROR_SUCCESS;
    while (RegEnumKeyEx(hKey, 0, szBuffer, &dwSize, NULL, NULL, NULL, &time)==ERROR_SUCCESS)
    {
        szBuffer[ARRAYSIZE(szBuffer)-1] = '\0';
        lRes = RecurseDeleteKey(hKey, szBuffer);
        if (lRes != ERROR_SUCCESS)
            break;
        dwSize = ARRAYSIZE(szBuffer);
    }
    RegCloseKey(hKey);

    return lRes == ERROR_SUCCESS ? RegDeleteKey(hParentKey, lpszKey) : lRes;
}

Variable Documentation

struct { ... } c_rgCategories[]
const GUID* pguid

Definition at line 18 of file register.cpp.

const GUID* pguidCategory

Definition at line 17 of file register.cpp.

Generated on Wed Nov 13 2024 16:53:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/resource.h File Reference

  • WinUI
  • TSFcase

resource.h File Reference

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/server.cpp File Reference

  • WinUI
  • TSFcase
Classes | Functions

server.cpp File Reference

#include "globals.h"
#include "case.h"

Go to the source code of this file.

Classes

class | CClassFactory

Functions

void | BuildGlobalObjects (void)
void | DllAddRef (void)
STDAPI | DllCanUnloadNow (void)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, void **ppvObj)
STDAPI | DllRegisterServer (void)
void | DllRelease (void)
STDAPI | DllUnregisterServer (void)
void | FreeGlobalObjects (void)
STDAPI_ (ULONG) CClassFactory

Function Documentation

void BuildGlobalObjects ( void )

Definition at line 158 of file server.cpp.

{
    // Build CClassFactory Objects

    g_ObjectInfo[0] = new CClassFactory(c_clsidCaseTextService, CCaseTextService::CreateInstance);

    // You can add more object info here.
    // Don't forget to increase number of item for g_ObjectInfo[],
}

void DllAddRef ( void )

Definition at line 21 of file server.cpp.

{
    InterlockedIncrement(&g_cRefDll);
}

STDAPI DllCanUnloadNow ( void )

Definition at line 234 of file server.cpp.

{
    if (g_cRefDll >= 0) // -1 with no refs
        return S_FALSE;

    return S_OK;
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 193 of file server.cpp.

{
    if (g_ObjectInfo[0] == NULL)
    {
        EnterCriticalSection(&g_cs);

            // need to check ref again after grabbing mutex
            if (g_ObjectInfo[0] == NULL)
            {
                BuildGlobalObjects();
            }

        LeaveCriticalSection(&g_cs);
    }

    if (IsEqualIID(riid, IID_IClassFactory) ||
        IsEqualIID(riid, IID_IUnknown))
    {
        for (int i = 0; i < ARRAYSIZE(g_ObjectInfo); i++)
        {
            if (NULL != g_ObjectInfo[i] &&
                IsEqualGUID(rclsid, g_ObjectInfo[i]->_rclsid))
            {
                *ppvObj = (void *)g_ObjectInfo[i];
                DllAddRef();    // class factory holds DLL ref count
                return NOERROR;
            }
        }
    }

    *ppvObj = NULL;

    return CLASS_E_CLASSNOTAVAILABLE;
}

STDAPI DllRegisterServer ( void )

Definition at line 263 of file server.cpp.

{
    // register this service's profile with the tsf
    if (!CCaseTextService::RegisterServer() ||
        !CCaseTextService::RegisterProfiles() ||
        !CCaseTextService::RegisterCategories(TRUE))
    {
        DllUnregisterServer(); // cleanup any loose ends
        return E_FAIL;
    }

    return S_OK;
}

void DllRelease ( void )

Definition at line 32 of file server.cpp.

{
    if (InterlockedDecrement(&g_cRefDll) < 0) // g_cRefDll == -1 with zero refs
    {
        EnterCriticalSection(&g_cs);

        // need to check ref again after grabbing mutex
        if (g_ObjectInfo[0] != NULL)
        {
            FreeGlobalObjects();
        }
        assert(g_cRefDll == -1);

        LeaveCriticalSection(&g_cs);
    }
}

STDAPI DllUnregisterServer ( void )

Definition at line 248 of file server.cpp.

{
    CCaseTextService::RegisterCategories(FALSE);
    CCaseTextService::UnregisterProfiles();
    CCaseTextService::UnregisterServer();

    return S_OK;
}

void FreeGlobalObjects ( void )

Definition at line 174 of file server.cpp.

{
    // Free CClassFactory Objects
    for (int i = 0; i < ARRAYSIZE(g_ObjectInfo); i++)
    {
        if (NULL != g_ObjectInfo[i])
        {
            delete g_ObjectInfo[i];
            g_ObjectInfo[i] = NULL;
        }
    }
}

STDAPI_ ( ULONG )

Definition at line 115 of file server.cpp.

{
    DllRelease();
    return g_cRefDll+1; // -1 w/ no refs
}

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/snoop.cpp File Reference

  • WinUI
  • TSFcase
Classes | Defines

snoop.cpp File Reference

#include "globals.h"
#include "snoop.h"
#include "case.h"
#include "editsess.h"

Go to the source code of this file.

Classes

class | CUpdateTextEditSession

Defines

#define | SNOOP_HEIGHT (SNOOP_WIDTH / 3)
#define | SNOOP_WIDTH 300
#define | SNOOP_X_POS 0
#define | SNOOP_Y_POS 0

Define Documentation

#define SNOOP_HEIGHT (SNOOP_WIDTH / 3)

Definition at line 42 of file snoop.cpp.

#define SNOOP_WIDTH 300

Definition at line 41 of file snoop.cpp.

#define SNOOP_X_POS 0

Definition at line 38 of file snoop.cpp.

#define SNOOP_Y_POS 0

Definition at line 39 of file snoop.cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/snoop.h File Reference

  • WinUI
  • TSFcase
Classes | Defines

snoop.h File Reference

Go to the source code of this file.

Classes

class | CSnoopWnd

Defines

#define | MAX_SNOOP_TEXT 32

Define Documentation

#define MAX_SNOOP_TEXT 32

Definition at line 10 of file snoop.h.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/tmgrsink.cpp File Reference

  • WinUI
  • TSFcase

tmgrsink.cpp File Reference

#include "globals.h"
#include "case.h"
#include "snoop.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfcompart/compart.cpp File Reference

  • WinUI
  • tsfcompart
Functions

compart.cpp File Reference

#include <windows.h>
#include <windowsx.h>
#include "resource.h"
#include "Monitor.h"

Go to the source code of this file.

Functions

INT_PTR CALLBACK | DialogProc (HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
HRESULT CALLBACK | MonitorCallback (const GUID *pguidCompartment, BOOL fStatus, LPARAM lParam)
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Function Documentation

INT_PTR CALLBACK DialogProc | ( | HWND | hWnd,
 |  | UINT | uMessage,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 69 of file compart.cpp.

{
    static CCompartmentMonitor *s_pCompartmentMonitor;

    switch(uMessage)
    {
    case WM_INITDIALOG:
        s_pCompartmentMonitor = new CCompartmentMonitor();
        if(s_pCompartmentMonitor)
        {
            HRESULT hr;

            hr = s_pCompartmentMonitor->Initialize(&GUID_COMPARTMENT_SPEECH_OPENCLOSE, MonitorCallback, (LPARAM)hWnd);
            if(FAILED(hr))
            {
                s_pCompartmentMonitor->Release();
                s_pCompartmentMonitor = NULL;
            }
            else
            {
                //update the status text
                BOOL    fStatus;

                s_pCompartmentMonitor->GetStatus(&fStatus);

                MonitorCallback(&GUID_COMPARTMENT_SPEECH_OPENCLOSE, fStatus, (LPARAM)hWnd);
            }
        }
        break;

    case WM_COMMAND:
        switch(GET_WM_COMMAND_ID(wParam, lParam))
        {
        case IDC_CLOSE:
            PostMessage(hWnd, WM_CLOSE, 0, 0);
            break;
        }
        break;

    case WM_CLOSE:
        EndDialog(hWnd, 0);
        break;

    case WM_DESTROY:
        if(s_pCompartmentMonitor)
        {
            s_pCompartmentMonitor->Uninitialize();
            s_pCompartmentMonitor->Release();
            s_pCompartmentMonitor = NULL;
        }
        break;
    }

    return FALSE;
}

HRESULT CALLBACK MonitorCallback | ( | const GUID * | pguidCompartment,
 |  | BOOL | fStatus,
 |  | LPARAM | lParam
 | ) |  |

Definition at line 134 of file compart.cpp.

{
    TCHAR   szSpeechStatus[MAX_PATH];

    //get the status of the speech text service
    if(fStatus)
    {
        lstrcpy(szSpeechStatus, TEXT("Speech Is Active"));
    }
    else
    {
        lstrcpy(szSpeechStatus, TEXT("Speech Is Inactive"));
    }

    SetDlgItemText((HWND)lParam, IDC_TEXT, szSpeechStatus);

    return S_OK;
}

int WINAPI WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |  |

_tWinMain - Application entry point and dispatch loop

Definition at line 49 of file compart.cpp.

{
    CoInitialize(NULL);

    DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG), NULL, DialogProc);

    CoUninitialize();

    return 0;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfcompart/monitor.cpp File Reference

  • WinUI
  • tsfcompart
Functions

monitor.cpp File Reference

#include "Monitor.h"

Go to the source code of this file.

Functions

STDAPI_ (ULONG) CCompartmentMonitor

Function Documentation

STDAPI_ ( ULONG )

Definition at line 206 of file monitor.cpp.

{
    m_dwRef--;

    if(0 == m_dwRef)
    {
        delete this;
        return 0;
    }

    return m_dwRef;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfcompart/monitor.h File Reference

  • WinUI
  • tsfcompart
Classes | Typedefs

monitor.h File Reference

#include <windows.h>
#include <windowsx.h>
#include <msctf.h>

Go to the source code of this file.

Classes

class | CCompartmentMonitor

Typedefs

typedef HRESULT(CALLBACK * | PCOMPARTMENTMONITORPROC )(const GUID *, BOOL, LPARAM)

Typedef Documentation

typedef HRESULT(CALLBACK* PCOMPARTMENTMONITORPROC)(const GUID *, BOOL, LPARAM)

Definition at line 29 of file monitor.h.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfcompart/resource.h File Reference

  • WinUI
  • tsfcompart
Defines

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDC_CLOSE 1000
#define | IDC_TEXT 1001
#define | IDD_DIALOG 101

Define Documentation

#define IDC_CLOSE 1000

Definition at line 6 of file resource.h.

#define IDC_TEXT 1001

Definition at line 7 of file resource.h.

#define IDD_DIALOG 101

Definition at line 5 of file resource.h.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/cleanup.cpp File Reference

  • WinUI
  • TSFmark

cleanup.cpp File Reference

#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/compart.cpp File Reference

  • WinUI
  • TSFmark

compart.cpp File Reference

#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/compose.cpp File Reference

  • WinUI
  • TSFmark
Classes

compose.cpp File Reference

#include "globals.h"
#include "mark.h"
#include "editsess.h"

Go to the source code of this file.

Classes

class | CCompositionEditSession
class | CTerminateCompositionEditSession
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/dap.cpp File Reference

  • WinUI
  • TSFmark
Classes | Functions | Variables

dap.cpp File Reference

#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Classes

class | CDisplayAttributeInfo
class | CEnumDisplayAttributeInfo

Functions

STDAPI_ (ULONG) CEnumDisplayAttributeInfo

Variables

CDisplayAttributeInfo g_DisplayAttributeInfo

Function Documentation

STDAPI_ ( ULONG )

Definition at line 286 of file dap.cpp.

{
    LONG cr = --_cRef;

    assert(_cRef >= 0);

    if (_cRef == 0)
    {
        delete this;
    }

    return cr;
}

Variable Documentation

CDisplayAttributeInfo g_DisplayAttributeInfo
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/dllmain.cpp File Reference

  • WinUI
  • TSFmark
Functions

dllmain.cpp File Reference

#include "globals.h"

Go to the source code of this file.

Functions

BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID pvReserved)

Function Documentation

BOOL WINAPI DllMain | ( | HINSTANCE | hInstance,
 |  | DWORD | dwReason,
 |  | LPVOID | pvReserved
 | ) |  |

Definition at line 15 of file dllmain.cpp.

{
    switch (dwReason)
    {
        case DLL_PROCESS_ATTACH:

            g_hInst = hInstance;

            if (!InitializeCriticalSectionAndSpinCount(&g_cs, 0))
                return FALSE;

            break;

        case DLL_PROCESS_DETACH:

            DeleteCriticalSection(&g_cs);

            break;
    }

    return TRUE;
}

Generated on Wed Nov 13 2024 16:54:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/editsess.h File Reference

  • WinUI
  • TSFmark
Classes

editsess.h File Reference

Go to the source code of this file.

Classes

class CEditSessionBase
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/editsink.cpp File Reference

  • WinUI
  • TSFmark

editsink.cpp File Reference

#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/globals.cpp File Reference

  • WinUI
  • TSFmark
Functions | Variables

globals.cpp File Reference

#include "globals.h"

Go to the source code of this file.

Functions

BOOL | AdviseSingleSink (TfClientId tfClientId, IUnknown *pSourceIn, IUnknown *pSink, REFIID riid)
BOOL | AdviseSink (IUnknown *pSourceIn, IUnknown *pSink, REFIID riid, DWORD *pdwCookie)
BOOL | IsEqualUnknown (IUnknown *interface1, IUnknown *interface2)
BOOL | IsRangeCovered (TfEditCookie ec, ITfRange *pRangeTest, ITfRange *pRangeCover)
void | UnadviseSingleSink (TfClientId tfClientId, IUnknown *pSourceIn, REFIID riid)
void | UnadviseSink (IUnknown *pSourceIn, DWORD *pdwCookie)

Variables

const CLSID | c_clsidMarkTextService = { 0x23e97bc9, 0xf2d3, 0x4b25, {0x8e, 0xf3, 0xd7, 0x83, 0x91, 0xbf, 0x21, 0x50} }
const GUID | c_guidCaseProperty = { 0x3042ae6a, 0x4697, 0x4f7d, {0xac, 0xdf, 0x20, 0xa9, 0x72, 0xfe, 0xe0, 0x27} }
const GUID | c_guidCustomProperty = { 0xd05a182a, 0x7782, 0x4e61, {0xa2, 0xea, 0x6a, 0x47, 0x94, 0xab, 0x7a, 0xaa} }
const GUID | c_guidLangBarItemButton = { 0xc74a88d5, 0x6614, 0x439b, {0x88, 0x80, 0x2d, 0xd8, 0xe6, 0xcd, 0x91, 0xa7} }
const GUID | c_guidMarkContextCompartment = { 0xeadc084c, 0x6130, 0x4222, {0x82, 0xe5, 0xc5, 0x28, 0xc1, 0xf4, 0xab, 0xbb} }
const GUID | c_guidMarkDisplayAttribute = { 0xd81face6, 0x845c, 0x45e7, {0xa2, 0xaf, 0x1c, 0x5f, 0xc7, 0xad, 0xf6, 0x67} }
const GUID | c_guidMarkGlobalCompartment = { 0x947d9d1c, 0x7a4c, 0x4392, {0xb3, 0x7c, 0x34, 0x01, 0x7c, 0x6c, 0x7f, 0xe1} }
const GUID | c_guidMarkProfile = { 0xa2767f97, 0xe735, 0x461a, {0x84, 0xba, 0x7a, 0x7e, 0xca, 0xd2, 0x48, 0x27} }
LONG | g_cRefDll = -1
CRITICAL_SECTION | g_cs
HINSTANCE | g_hInst

Function Documentation

BOOL AdviseSingleSink | ( | TfClientId | tfClientId,
 |  | IUnknown * | pSourceIn,
 |  | IUnknown * | pSink,
 |  | REFIID | riid
 | ) |  |

Definition at line 95 of file globals.cpp.

{
    ITfSourceSingle *pSource;
    HRESULT hr;

    if (pSourceIn->QueryInterface(IID_ITfSourceSingle, (void **)&pSource) != S_OK)
        return FALSE;

    hr = pSource->AdviseSingleSink(tfClientId, riid, pSink);

    pSource->Release();

    return (hr == S_OK);
}

BOOL AdviseSink | ( | IUnknown * | pSourceIn,
 |  | IUnknown * | pSink,
 |  | REFIID | riid,
 |  | DWORD * | pdwCookie
 | ) |  |

Definition at line 45 of file globals.cpp.

{
    ITfSource *pSource;
    HRESULT hr;

    if (pSourceIn->QueryInterface(IID_ITfSource, (void **)&pSource) != S_OK)
        return FALSE;

    hr = pSource->AdviseSink(riid, pSink, pdwCookie);

    pSource->Release();

    if (hr != S_OK)
    {
        // make sure we don't try to Unadvise pdwCookie later
        *pdwCookie = TF_INVALID_COOKIE;
        return FALSE;
    }

    return TRUE;
}

BOOL IsEqualUnknown | ( | IUnknown * | interface1,
 |  | IUnknown * | interface2
 | ) |  |

Definition at line 161 of file globals.cpp.

{
    IUnknown *punk1;
    IUnknown *punk2;

    if (interface1->QueryInterface(IID_IUnknown, (void **)&punk1) != S_OK)
        return FALSE;

    punk1->Release(); // we don't actually need to dereference these guys, just want to compare them

    if (interface2->QueryInterface(IID_IUnknown, (void **)&punk2) != S_OK)
        return FALSE;

    punk2->Release();

    return (punk1 == punk2);
}

BOOL IsRangeCovered | ( | TfEditCookie | ec,
 |  | ITfRange * | pRangeTest,
 |  | ITfRange * | pRangeCover
 | ) |  |

Definition at line 134 of file globals.cpp.

{
    LONG lResult;

    if (pRangeCover->CompareStart(ec, pRangeTest, TF_ANCHOR_START, &lResult) != S_OK ||
        lResult > 0)
    {
        return FALSE;
    }

    if (pRangeCover->CompareEnd(ec, pRangeTest, TF_ANCHOR_END, &lResult) != S_OK ||
        lResult < 0)
    {
        return FALSE;
    }

    return TRUE;
}

void UnadviseSingleSink | ( | TfClientId | tfClientId,
 |  | IUnknown * | pSourceIn,
 |  | REFIID | riid
 | ) |  |

Definition at line 116 of file globals.cpp.

{
    ITfSourceSingle *pSource;

    if (pSourceIn->QueryInterface(IID_ITfSourceSingle, (void **)&pSource) == S_OK)
    {
        pSource->UnadviseSingleSink(tfClientId, riid);
        pSource->Release();
    }
}

void UnadviseSink | ( | IUnknown * | pSourceIn,
 |  | DWORD * | pdwCookie
 | ) |  |

Definition at line 73 of file globals.cpp.

{
    ITfSource *pSource;

    if (*pdwCookie == TF_INVALID_COOKIE)
        return; // never Advised

    if (pSourceIn->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
    {
        pSource->UnadviseSink(*pdwCookie);
        pSource->Release();
    }

    *pdwCookie = TF_INVALID_COOKIE;
}

Variable Documentation

const CLSID c_clsidMarkTextService = { 0x23e97bc9, 0xf2d3, 0x4b25, {0x8e, 0xf3, 0xd7, 0x83, 0x91, 0xbf, 0x21, 0x50} }

Definition at line 16 of file globals.cpp.

const GUID c_guidCaseProperty = { 0x3042ae6a, 0x4697, 0x4f7d, {0xac, 0xdf, 0x20, 0xa9, 0x72, 0xfe, 0xe0, 0x27} }

Definition at line 34 of file globals.cpp.

const GUID c_guidCustomProperty = { 0xd05a182a, 0x7782, 0x4e61, {0xa2, 0xea, 0x6a, 0x47, 0x94, 0xab, 0x7a, 0xaa} }

Definition at line 37 of file globals.cpp.

const GUID c_guidLangBarItemButton = { 0xc74a88d5, 0x6614, 0x439b, {0x88, 0x80, 0x2d, 0xd8, 0xe6, 0xcd, 0x91, 0xa7} }

Definition at line 22 of file globals.cpp.

const GUID c_guidMarkContextCompartment = { 0xeadc084c, 0x6130, 0x4222, {0x82, 0xe5, 0xc5, 0x28, 0xc1, 0xf4, 0xab, 0xbb} }

Definition at line 28 of file globals.cpp.

const GUID c_guidMarkDisplayAttribute = { 0xd81face6, 0x845c, 0x45e7, {0xa2, 0xaf, 0x1c, 0x5f, 0xc7, 0xad, 0xf6, 0x67} }

Definition at line 25 of file globals.cpp.

const GUID c_guidMarkGlobalCompartment = { 0x947d9d1c, 0x7a4c, 0x4392, {0xb3, 0x7c, 0x34, 0x01, 0x7c, 0x6c, 0x7f, 0xe1} }

Definition at line 31 of file globals.cpp.

const GUID c_guidMarkProfile = { 0xa2767f97, 0xe735, 0x461a, {0x84, 0xba, 0x7a, 0x7e, 0xca, 0xd2, 0x48, 0x27} }

Definition at line 19 of file globals.cpp.

LONG g_cRefDll = -1

Definition at line 11 of file globals.cpp.

CRITICAL_SECTION g_cs

Definition at line 13 of file globals.cpp.

HINSTANCE g_hInst

Definition at line 9 of file globals.cpp.

Generated on Wed Nov 13 2024 16:53:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/globals.h File Reference

  • WinUI
  • TSFmark
Defines | Functions | Variables

globals.h File Reference

#include <windows.h>
#include <ole2.h>
#include <olectl.h>
#include <assert.h>
#include "msctf.h"

Go to the source code of this file.

Defines

#define | ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#define | LANGBAR_ITEM_DESC L"Mark Menu"
#define | MARK_DESC L"Mark Text Service"
#define | MARK_DESC_A "Mark Text Service"
#define | MARK_ICON_INDEX 0
#define | MARK_LANGID MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
#define | MARK_MODEL TEXT("Apartment")
#define | SafeRelease(punk)
#define | SafeReleaseClear(punk)

Functions

BOOL | AdviseSingleSink (TfClientId tfClientId, IUnknown *pSource, IUnknown *pSink, REFIID riid)
BOOL | AdviseSink (IUnknown *pSource, IUnknown *pSink, REFIID riid, DWORD *pdwCookie)
LONG | DllAddRef ()
LONG | DllRelease ()
BOOL | IsEqualUnknown (IUnknown *interface1, IUnknown *interface2)
BOOL | IsRangeCovered (TfEditCookie ec, ITfRange *pRangeTest, ITfRange *pRangeCover)
void | SafeStringCopy (WCHAR *pchDst, ULONG cchMax, const WCHAR *pchSrc)
void | UnadviseSingleSink (TfClientId tfClientId, IUnknown *pSource, REFIID riid)
void | UnadviseSink (IUnknown *pSource, DWORD *pdwCookie)

Variables

const CLSID | c_clsidMarkTextService
const GUID | c_guidCaseProperty
const GUID | c_guidCustomProperty
const GUID | c_guidLangBarItemButton
const GUID | c_guidMarkContextCompartment
const GUID | c_guidMarkDisplayAttribute
const GUID | c_guidMarkGlobalCompartment
const GUID | c_guidMarkProfile
LONG | g_cRefDll
CRITICAL_SECTION | g_cs
HINSTANCE | g_hInst

Define Documentation

#define ARRAYSIZE ( a ) (sizeof(a)/sizeof(a[0]))

Definition at line 29 of file globals.h.

#define LANGBAR_ITEM_DESC L"Mark Menu"

Definition at line 37 of file globals.h.

#define MARK_DESC L"Mark Text Service"

Definition at line 33 of file globals.h.

#define MARK_DESC_A "Mark Text Service"

Definition at line 34 of file globals.h.

#define MARK_ICON_INDEX 0

Definition at line 39 of file globals.h.

#define MARK_LANGID MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)

Definition at line 31 of file globals.h.

#define MARK_MODEL TEXT("Apartment")

Definition at line 35 of file globals.h.

#define SafeRelease ( punk )
Value:
{                               \
    if ((punk) != NULL)         \
    {                           \
        (punk)->Release();      \
    }                           \
}

Definition at line 41 of file globals.h.

#define SafeReleaseClear ( punk )
Value:
{                               \
    if ((punk) != NULL)         \
    {                           \
        (punk)->Release();      \
        (punk) = NULL;          \
    }                           \
}

Definition at line 49 of file globals.h.

Function Documentation

BOOL AdviseSingleSink | ( | TfClientId | tfClientId,
 |  | IUnknown * | pSource,
 |  | IUnknown * | pSink,
 |  | REFIID | riid
 | ) |  |

Definition at line 95 of file globals.cpp.

{
    ITfSourceSingle *pSource;
    HRESULT hr;

    if (pSourceIn->QueryInterface(IID_ITfSourceSingle, (void **)&pSource) != S_OK)
        return FALSE;

    hr = pSource->AdviseSingleSink(tfClientId, riid, pSink);

    pSource->Release();

    return (hr == S_OK);
}

BOOL AdviseSink | ( | IUnknown * | pSource,
 |  | IUnknown * | pSink,
 |  | REFIID | riid,
 |  | DWORD * | pdwCookie
 | ) |  |

Definition at line 45 of file globals.cpp.

{
    ITfSource *pSource;
    HRESULT hr;

    if (pSourceIn->QueryInterface(IID_ITfSource, (void **)&pSource) != S_OK)
        return FALSE;

    hr = pSource->AdviseSink(riid, pSink, pdwCookie);

    pSource->Release();

    if (hr != S_OK)
    {
        // make sure we don't try to Unadvise pdwCookie later
        *pdwCookie = TF_INVALID_COOKIE;
        return FALSE;
    }

    return TRUE;
}

LONG DllAddRef ( )

Definition at line 21 of file server.cpp.

{
    InterlockedIncrement(&g_cRefDll);
}

LONG DllRelease ( )

Definition at line 32 of file server.cpp.

{
    if (InterlockedDecrement(&g_cRefDll) < 0) // g_cRefDll == -1 with zero refs
    {
        EnterCriticalSection(&g_cs);

        // need to check ref again after grabbing mutex
        if (g_ObjectInfo[0] != NULL)
        {
            FreeGlobalObjects();
        }
        assert(g_cRefDll == -1);

        LeaveCriticalSection(&g_cs);
    }
}

BOOL IsEqualUnknown | ( | IUnknown * | interface1,
 |  | IUnknown * | interface2
 | ) |  |

Definition at line 161 of file globals.cpp.

{
    IUnknown *punk1;
    IUnknown *punk2;

    if (interface1->QueryInterface(IID_IUnknown, (void **)&punk1) != S_OK)
        return FALSE;

    punk1->Release(); // we don't actually need to dereference these guys, just want to compare them

    if (interface2->QueryInterface(IID_IUnknown, (void **)&punk2) != S_OK)
        return FALSE;

    punk2->Release();

    return (punk1 == punk2);
}

BOOL IsRangeCovered | ( | TfEditCookie | ec,
 |  | ITfRange * | pRangeTest,
 |  | ITfRange * | pRangeCover
 | ) |  |

Definition at line 134 of file globals.cpp.

{
    LONG lResult;

    if (pRangeCover->CompareStart(ec, pRangeTest, TF_ANCHOR_START, &lResult) != S_OK ||
        lResult > 0)
    {
        return FALSE;
    }

    if (pRangeCover->CompareEnd(ec, pRangeTest, TF_ANCHOR_END, &lResult) != S_OK ||
        lResult < 0)
    {
        return FALSE;
    }

    return TRUE;
}

void SafeStringCopy | ( | WCHAR * | pchDst,
 |  | ULONG | cchMax,
 |  | const WCHAR * | pchSrc |
 | ) |  |  | [inline]

Definition at line 66 of file globals.h.

{
    if (cchMax > 0)
    {
        wcsncpy(pchDst, pchSrc, cchMax);
        pchDst[cchMax-1] = '\0';
    }
}

void UnadviseSingleSink | ( | TfClientId | tfClientId,
 |  | IUnknown * | pSource,
 |  | REFIID | riid
 | ) |  |

Definition at line 116 of file globals.cpp.

{
    ITfSourceSingle *pSource;

    if (pSourceIn->QueryInterface(IID_ITfSourceSingle, (void **)&pSource) == S_OK)
    {
        pSource->UnadviseSingleSink(tfClientId, riid);
        pSource->Release();
    }
}

void UnadviseSink | ( | IUnknown * | pSource,
 |  | DWORD * | pdwCookie
 | ) |  |

Definition at line 73 of file globals.cpp.

{
    ITfSource *pSource;

    if (*pdwCookie == TF_INVALID_COOKIE)
        return; // never Advised

    if (pSourceIn->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
    {
        pSource->UnadviseSink(*pdwCookie);
        pSource->Release();
    }

    *pdwCookie = TF_INVALID_COOKIE;
}

Variable Documentation

const CLSID c_clsidMarkTextService

Definition at line 16 of file globals.cpp.

const GUID c_guidCaseProperty

Definition at line 34 of file globals.cpp.

const GUID c_guidCustomProperty

Definition at line 37 of file globals.cpp.

const GUID c_guidLangBarItemButton

Definition at line 22 of file globals.cpp.

const GUID c_guidMarkContextCompartment

Definition at line 28 of file globals.cpp.

const GUID c_guidMarkDisplayAttribute

Definition at line 25 of file globals.cpp.

const GUID c_guidMarkGlobalCompartment

Definition at line 31 of file globals.cpp.

const GUID c_guidMarkProfile

Definition at line 19 of file globals.cpp.

LONG g_cRefDll

Definition at line 11 of file globals.cpp.

CRITICAL_SECTION g_cs

Definition at line 41 of file SServer.Cpp.

HINSTANCE g_hInst

Definition at line 62 of file DoServer.Cpp.

Generated on Wed Nov 13 2024 16:54:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/keys.cpp File Reference

  • WinUI
  • TSFmark
Classes

keys.cpp File Reference

#include "globals.h"
#include "mark.h"
#include "editsess.h"

Go to the source code of this file.

Classes

class CKeystrokeEditSession
Generated on Wed Nov 13 2024 16:54:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/langbar.cpp File Reference

  • WinUI
  • TSFmark
Classes | Defines | Functions | Variables

langbar.cpp File Reference

#include "globals.h"
#include "mark.h"
#include "resource.h"

Go to the source code of this file.

Classes

class | CLangBarItemButton

Defines

#define | MARK_LANGBARITEMSINK_COOKIE 0x0fab0fab

Functions

STDAPI_ (ULONG) CLangBarItemButton

Variables

struct {
const WCHAR * pchDesc
void(* pfnHandler )(CMarkTextService *_this)
} c_rgMenuItems []

Define Documentation

#define MARK_LANGBARITEMSINK_COOKIE 0x0fab0fab

Definition at line 11 of file langbar.cpp.

Function Documentation

STDAPI_ ( ULONG )

Definition at line 150 of file langbar.cpp.

{
    LONG cr = --_cRef;

    assert(_cRef >= 0);

    if (_cRef == 0)
    {
        delete this;
    }

    return cr;
}

Variable Documentation

struct { ... } c_rgMenuItems[]
const WCHAR* pchDesc

Definition at line 15 of file langbar.cpp.

void(* pfnHandler)(CMarkTextService *_this)

Definition at line 16 of file langbar.cpp.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/mark.cpp File Reference

  • WinUI
  • TSFmark
Functions

mark.cpp File Reference

#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Functions

STDAPI_ (ULONG) CMarkTextService

Function Documentation

STDAPI_ ( ULONG )

Definition at line 158 of file mark.cpp.

{
    LONG cr = --_cRef;

    assert(_cRef >= 0);

    if (_cRef == 0)
    {
        delete this;
    }

    return cr;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/mark.h File Reference

  • WinUI
  • TSFmark
Classes

mark.h File Reference

Go to the source code of this file.

Classes

class CMarkTextService
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/precomp.cpp File Reference

  • WinUI
  • TSFmark

precomp.cpp File Reference

#include "globals.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/property.cpp File Reference

  • WinUI
  • TSFmark
Classes | Defines | Variables

property.cpp File Reference

#include "globals.h"
#include "mark.h"
#include "editsess.h"
#include "pstore.h"

Go to the source code of this file.

Classes

class | CPropertyEditSession

Defines

#define | SET_CASE_PROPERTY 1
#define | SET_CUSTOM_PROPERTY 3
#define | VIEW_CASE_PROPERTY 0
#define | VIEW_CUSTOM_PROPERTY 2

Variables

const TCHAR | c_szWorkerWndClass [] = TEXT("Mark Worker Wnd Class")

Define Documentation

#define SET_CASE_PROPERTY 1

Definition at line 14 of file property.cpp.

#define SET_CUSTOM_PROPERTY 3

Definition at line 16 of file property.cpp.

#define VIEW_CASE_PROPERTY 0

Definition at line 13 of file property.cpp.

#define VIEW_CUSTOM_PROPERTY 2

Definition at line 15 of file property.cpp.

Variable Documentation

const TCHAR c_szWorkerWndClass[] = TEXT("Mark Worker Wnd Class")

Definition at line 18 of file property.cpp.

Generated on Wed Nov 13 2024 16:53:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/pstore.cpp File Reference

  • WinUI
  • TSFmark
Functions

pstore.cpp File Reference

#include "globals.h"
#include "pstore.h"
#include "mark.h"

Go to the source code of this file.

Functions

STDAPI_ (ULONG) CCustomPropertyStore

Function Documentation

STDAPI_ ( ULONG )

Definition at line 83 of file pstore.cpp.

{
    LONG cr = --_cRef;

    assert(_cRef >= 0);

    if (_cRef == 0)
    {
        delete this;
    }

    return cr;
}

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/pstore.h File Reference

  • WinUI
  • TSFmark
Classes

pstore.h File Reference

Go to the source code of this file.

Classes

class CCustomPropertyStore
Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/register.cpp File Reference

  • WinUI
  • TSFmark
Defines | Functions | Variables

register.cpp File Reference

#include <windows.h>
#include <ole2.h>
#include "msctf.h"
#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Defines

#define | CLSID_STRLEN 38

Functions

BOOL | CLSIDToStringA (REFGUID refGUID, char *pchA)
LONG | RecurseDeleteKey (HKEY hParentKey, LPCTSTR lpszKey)

Variables

struct {
const GUID * pguid
const GUID * pguidCategory
} c_rgCategories []

Define Documentation

#define CLSID_STRLEN 38

Definition at line 13 of file register.cpp.

Function Documentation

BOOL CLSIDToStringA | ( | REFGUID | refGUID,
 |  | char * | pchA
 | ) |  |

Definition at line 143 of file register.cpp.

{
    static const BYTE GuidMap[] = {3, 2, 1, 0, '-', 5, 4, '-', 7, 6, '-',
                                   8, 9, '-', 10, 11, 12, 13, 14, 15};

    static const char szDigits[] = "0123456789ABCDEF";

    int i;
    char *p = pchA;

    const BYTE * pBytes = (const BYTE *) &refGUID;

    *p++ = '{';
    for (i = 0; i < sizeof(GuidMap); i++)
    {
        if (GuidMap[i] == '-')
        {
            *p++ = '-';
        }
        else
        {
            *p++ = szDigits[ (pBytes[GuidMap[i]] & 0xF0) >> 4 ];
            *p++ = szDigits[ (pBytes[GuidMap[i]] & 0x0F) ];
        }
    }

    *p++ = '}';
    *p   = '\0';

    return TRUE;
}

LONG RecurseDeleteKey | ( | HKEY | hParentKey,
 |  | LPCTSTR | lpszKey
 | ) |  |

Definition at line 182 of file register.cpp.

{
    HKEY hKey;
    LONG lRes;
    FILETIME time;
    TCHAR szBuffer[256];
    DWORD dwSize = ARRAYSIZE(szBuffer);

    if (RegOpenKey(hParentKey, lpszKey, &hKey) != ERROR_SUCCESS)
        return ERROR_SUCCESS; // let's assume we couldn't open it because it's not there

    lRes = ERROR_SUCCESS;
    while (RegEnumKeyEx(hKey, 0, szBuffer, &dwSize, NULL, NULL, NULL, &time)==ERROR_SUCCESS)
    {
        szBuffer[ARRAYSIZE(szBuffer)-1] = '\0';
        lRes = RecurseDeleteKey(hKey, szBuffer);
        if (lRes != ERROR_SUCCESS)
            break;
        dwSize = ARRAYSIZE(szBuffer);
    }
    RegCloseKey(hKey);

    return lRes == ERROR_SUCCESS ? RegDeleteKey(hParentKey, lpszKey) : lRes;
}

Variable Documentation

struct { ... } c_rgCategories[]
const GUID* pguid

Definition at line 18 of file register.cpp.

const GUID* pguidCategory

Definition at line 17 of file register.cpp.

Generated on Wed Nov 13 2024 16:53:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/resource.h File Reference

  • WinUI
  • TSFmark

resource.h File Reference

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:52:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/server.cpp File Reference

  • WinUI
  • TSFmark
Classes | Functions

server.cpp File Reference

#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Classes

class | CClassFactory

Functions

void | BuildGlobalObjects (void)
LONG | DllAddRef (void)
STDAPI | DllCanUnloadNow (void)
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, void **ppvObj)
STDAPI | DllRegisterServer (void)
LONG | DllRelease (void)
STDAPI | DllUnregisterServer (void)
void | FreeGlobalObjects (void)
STDAPI_ (ULONG) CClassFactory

Function Documentation

void BuildGlobalObjects ( void )

Definition at line 160 of file server.cpp.

{
    // Build CClassFactory Objects

    g_ObjectInfo[0] = new CClassFactory(c_clsidMarkTextService,
                                        CMarkTextService::CreateInstance);

    // You can add more object info here.
    // Don't forget to increase number of item for g_ObjectInfo[],
}

LONG DllAddRef ( void )

Definition at line 21 of file server.cpp.

{
    return InterlockedIncrement(&g_cRefDll) + 1;
}

STDAPI DllCanUnloadNow ( void )

Definition at line 237 of file server.cpp.

{
    if (g_cRefDll >= 0) // -1 with no refs
        return S_FALSE;

    return S_OK;
}

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | void ** | ppvObj
 | ) |  |

Definition at line 196 of file server.cpp.

{
    if (g_ObjectInfo[0] == NULL)
    {
        EnterCriticalSection(&g_cs);

            // need to check ref again after grabbing mutex
            if (g_ObjectInfo[0] == NULL)
            {
                BuildGlobalObjects();
            }

        LeaveCriticalSection(&g_cs);
    }

    if (IsEqualIID(riid, IID_IClassFactory) ||
        IsEqualIID(riid, IID_IUnknown))
    {
        for (int i = 0; i < ARRAYSIZE(g_ObjectInfo); i++)
        {
            if (NULL != g_ObjectInfo[i] &&
                IsEqualGUID(rclsid, g_ObjectInfo[i]->_rclsid))
            {
                *ppvObj = (void *)g_ObjectInfo[i];
                DllAddRef();    // class factory holds DLL ref count
                return NOERROR;
            }
        }
    }

    *ppvObj = NULL;

    return CLASS_E_CLASSNOTAVAILABLE;
}

STDAPI DllRegisterServer ( void )

Definition at line 266 of file server.cpp.

{
    // register this service's profile with the tsf
    if (!CMarkTextService::RegisterServer() ||
        !CMarkTextService::RegisterProfiles() ||
        !CMarkTextService::RegisterCategories(TRUE))
    {
        DllUnregisterServer(); // cleanup any loose ends
        return E_FAIL;
    }

    return S_OK;
}

LONG DllRelease ( void )

Definition at line 32 of file server.cpp.

{
    if (InterlockedDecrement(&g_cRefDll) < 0) // g_cRefDll == -1 with zero refs
    {
        EnterCriticalSection(&g_cs);

        // need to check ref again after grabbing mutex
        if (g_ObjectInfo[0] != NULL)
        {
            FreeGlobalObjects();
        }
        assert(g_cRefDll == -1);

        LeaveCriticalSection(&g_cs);
    }

    return g_cRefDll+1;
}

STDAPI DllUnregisterServer ( void )

Definition at line 251 of file server.cpp.

{
    CMarkTextService::RegisterCategories(FALSE);
    CMarkTextService::UnregisterProfiles();
    CMarkTextService::UnregisterServer();

    return S_OK;
}

void FreeGlobalObjects ( void )

Definition at line 177 of file server.cpp.

{
    // Free CClassFactory Objects
    for (int i = 0; i < ARRAYSIZE(g_ObjectInfo); i++)
    {
        if (NULL != g_ObjectInfo[i])
        {
            delete g_ObjectInfo[i];
            g_ObjectInfo[i] = NULL;
        }
    }
}

STDAPI_ ( ULONG )

Definition at line 117 of file server.cpp.

{
    DllRelease();
    return g_cRefDll+1; // -1 w/ no refs
}

Generated on Wed Nov 13 2024 16:53:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/tmgrsink.cpp File Reference

  • WinUI
  • TSFmark

tmgrsink.cpp File Reference

#include "globals.h"
#include "mark.h"

Go to the source code of this file.

Generated on Wed Nov 13 2024 16:55:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Directory Hierarchy

Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Begin
    • dll
    • Generic
    • sdkdiff
    • Simple
  • Com
    • Administration
      • Explore.VC
      • Spy
        • ComSpy
        • ComSpyAudit
        • ComSpyCtl
        • ComSpyface
        • idl
    • async
      • client
      • proxy
      • server
    • Common
      • Inc
      • ProxyStub
    • Fundamentals
      • ActiveDocument
        • DfV
        • DoServer
        • Framer
        • Range
      • AsyncCalls
        • CallBackClient
        • CPPClient
        • FullSvr
        • HelpDll
        • JavaClient
          • FullSvr
        • ScaleDemo
      • CMallSpy
      • Common
      • CustomSurrogate
        • Dog
        • Surrog
      • DCom
        • Cancel
          • Client
          • InProc
          • Local
            • Mta
            • Sta
        • ComPerf
        • DComPerm
        • OleImp
        • Secure
        • Simple
          • sclient
          • sserver
        • TimeOuts
          • Client
          • PingResp
          • Server
      • Include
      • Object
        • CallAs
        • OHello
      • OleApt
      • OleStd
      • Pipes
        • Client
        • Include
        • LocalServer
      • SimpCntr
      • SimpDnd
      • SimpSvr
      • TutSamp
        • AppUtil
        • AptClien
        • AptServe
        • ComObj
        • ComUser
        • ConClien
        • ConServe
        • DcdMarsh
        • DcdServe
        • DComDraw
        • DllClien
        • DllServe
        • DllSkel
        • DllUser
        • ExeSkel
        • FreClien
        • FreServe
        • Inc
        • LicClien
        • LicServe
        • LocClien
        • LocServe
        • Marshal
        • Marshal2
        • PerClien
        • PerDraw
        • PerServe
        • PerText
        • ReadTut
        • Register
        • RemClien
        • StoClien
        • StoServe
      • WinHlprs
    • Services
      • BYOT
        • BYOTSampleWeb
          • _ScriptLibrary
        • Client
          • BYOTTransaction
        • Server
          • BYOTTxEnlister
      • Concurrency
        • SyncComp
          • ComSyncObject
          • FreeObject
          • STAObject
      • Crm
        • CrmDebug
        • CrmFiles
        • CrmFilesTest
        • CrmMonitor
        • IDL
      • Events
        • EventNews
          • CascadeEC
          • Include
          • NewsEventClass
          • PersistATL
        • EventNewsJAVA
          • CascadeEvent
            • Cascadeec
          • ComAdmin
          • NewsEvent
            • Helper
            • newsEventClass
          • NewsFlash
          • NewsSuscriber
          • PersistSubs
            • Persistatl
        • UserEvents
          • VCAcct
      • Object_Pooling
        • ObjectPoolingJAVA
          • ObjectPoolingComponent
            • Account
              • util
        • OPBankSample
          • Account.VC
          • OPBank
        • PoolTest
          • LogWriter
      • Queued_Components
        • QCJAVA
          • Components
            • Helper
            • qcNotify
            • qcOrder
            • qcShip
        • QCSamp1
          • Driver
          • QCNotify
          • QCOrder
          • QCShip
        • QCSamp2
          • Driver
          • QCNotify
          • QCOrder
          • QCShip2
      • Resource_Dispenser
      • Security
        • VC
      • Shared_Property_Manager
        • TServer
      • Transaction
        • DataAccess
          • DataAcADO
          • DataAcOleDB
          • DataAcRDO
        • SampleBank
          • VCAcct
          • vjAcct
            • MsAdo15
            • vcAcct
    • StructuredStorage
      • Propsets
    • Tools
      • COMPlusWizard
        • VJ
      • EntityProxy
        • DataServices
  • Dataaccess
    • ADO
      • ADOVCGEN
      • isapi
      • shell
    • odbc
      • odbcsql
      • quiktest
    • oledb
      • internetpublishing
        • ippsample
      • omniprov
        • source
      • prsample
      • rowsetviewer
      • sampclnt
      • sampprov
      • tablecopy
    • osp
      • vc
      • vj
    • rds
      • handler
        • vc
  • Multimedia
    • Audio
      • MciPlay
      • MidiPlyr
      • multichan
    • Gdi
      • Fonts
        • FontView
        • GridFont
      • fontsize
      • GdiDemo
      • Metafile
        • MfEdit
      • palette
      • Printer
      • PrintJob
      • SetDisp
      • TextFx
      • ViewDIB
      • WinCap32
      • WinNT
        • HalfTone
        • PlgBlt
        • WxForm
    • wia
      • GetImage
      • wiassamp
    • WindowsMediaServices9
      • Authentication
      • Authorization
      • CacheProxy
        • cplusplus
        • csharp
      • DataSource
      • EventNotification
        • ContextSamplePropPage
      • Playlist
  • NetDS
    • ActiveDirectory
      • PropSheetHost
    • ADSI
      • DevGuide
      • samples
        • activedir
          • addgroup
            • vc
          • adevent
          • attributes
            • vc
          • bindtoparent
            • vc
          • createuser
            • vc
          • credentials
            • VC
          • gcallusers
            • vc
          • getdomainmode
            • vc
          • getschemainfo
            • vc
          • guidbind
            • vc
          • OtherWKO
            • vc
          • PropertyList
            • vc
          • QueryUsers
            • vc
          • RootDSE
            • VC
          • SID
            • vc
          • User
            • vc
          • WKGUID
            • vc
        • DSUI
          • scpext
            • scpcmenu
            • scpproppage
            • scpwizard
          • userext
            • userproppage
            • userwizard
        • Extension
          • tutorial
            • step1
            • step2
        • General
          • ADQI
          • ADsCmd
          • ADsError
          • ADSIDump
          • DsBrowse
            • bitmaps
          • DsSrch
        • Start
          • Binding
            • vc
          • Child
            • vc
          • Create
            • vc
          • Delete
            • vc
          • Enum
            • vc
          • Filter
            • vc
          • First
            • vc
          • Move
            • vc
          • Parent
            • vc
          • Read
            • vc
          • Rename
            • vc
          • Schema
            • vc
          • Search
            • vc
          • Write
            • vc
    • Bluetooth
    • DHCP
      • DHCPNotify
      • DHCPPersist
      • DHCPRequest
    • DNS
      • DNSQuery
      • ModifyRecords
    • fax
      • PrintSdi
      • SampleFSP
      • SampleRoute
      • SampleSend
    • GQos
      • QosEvent
      • Qoslist
    • http
      • server
      • serviceconfig
    • IAS
      • DialIn
      • MapName
    • IPHelp
      • EnableRouter
      • IPArp
      • IPChange
      • IPConfig
      • IPRenew
      • IPRoute
      • IPStat
    • MessageQueuing
      • c_draw
      • csharp_draw
      • DirEncrypt
      • Imp_Draw
      • MqApiTst
      • mqf_draw
      • MQPers
        • GraphObj
        • Rcv
        • Snd
      • MQPort
      • MqTestOA
      • MqTrans
      • MSMQTest
    • NetMon
      • experts
        • blrplate
      • parsers
        • blrplate
    • netshell
    • Ras
      • ConnectionManager
      • customdial
      • CustomScript
        • CustomEntry
      • PhoneEntry
      • Ras_Statistics
      • RasDial
        • c
      • RasDialAsync
      • RasEnumConnections
        • c
      • RasEnumDevices
        • c
      • RasEnumEntries
        • c
      • WinNT
        • RasHost
    • RPC
      • AsyncRPC
      • ClUuid
      • Data
        • DUnion
        • InOut
        • repas
        • Xmit
      • Dynept
      • DynOut
      • FileRep
        • FileRepAsyncPipe
        • filerepmultiuser
        • filerepsecure
        • filerepsimple
      • Handles
        • cxhndl
        • usrdef
      • Hello
      • Pickle
        • Picklp
        • Picklt
      • Pipes
      • RPCssm
      • RPCsvc
      • StrOut
    • RRas
      • Adminapi
      • Callout
      • Eap
      • ip
      • LoadProtocol
      • rqs
        • client
        • common
        • inc
        • rqsmsg
        • server
    • rtc
      • Client
        • CPP
          • RTCIncoming
          • RTCOutgoing
          • rtcsample
    • Snmp
      • SnmpUtil
      • TestDll
      • WSnmp
    • SyncMgr
      • SyncDir
    • Tapi
      • Tapi2
        • Atsp32
        • Dialer
        • TapiComm
      • Tapi3
        • Cpp
          • FileTerm
          • Incoming
          • Msp
            • MSPBase
            • SampleMSP
          • Outgoing
          • pluggable
          • Rend
          • tapirecv
          • tapisend
    • upnp
      • DCO_DimmerService
      • FunctionDelegator
      • GenericUCP
        • CPP
      • RegisterDevice
      • StepByStep
        • Step1
        • Step2
        • Step3
        • Step4
    • WinNT
      • NetApi
        • ChngPass
        • NetShare
    • WinSock
      • Accept
      • appletalk
      • ATMEvent
      • Bcast
      • Dt_Dll
      • Dt_Dll2
      • iocp
      • iphdrinc
      • IpxChat
      • LSP
      • McastIP
      • Overlap
      • Ping
      • rcvall
      • Rnr2
      • simple
      • Sockdup
  • Security
    • Authentication
      • KerbSubAuth
      • MSVSubAuth
      • SampSSP
    • Authorization
      • AclApi
      • Audit
      • authz
      • Check_SD
      • klist
      • MyToken
      • Rcmd
      • SecFile
        • c
      • SecPrint
      • SecurObj
      • SidCln
      • SuperUsr
      • TakeOwn
      • TextSid
    • capicom
      • c_sharp
        • chainsh
        • storesh
        • xmldsig
      • cpp
        • isapiCertPolicy
        • store
    • CertServices
      • Encode
      • Exit
        • C++
          • Windows.Net
          • Windows2000
      • Policy
        • C++
          • Windows.Net
          • Windows2000
      • RequestCert
    • CryptoApi
      • CreateCert
      • Encrypt
      • EncryptDecrypt
        • RSACert
        • RSAKey
        • SessionKey
      • EnumAlgs
      • InitUser
      • SignHash
    • GINA
      • GinaHook
      • GinaStub
    • LSAPolicy
      • LsaPrivs
      • MachAcct
    • NetProviders
      • LogonNP
    • PasswordFilters
      • PassFilt
    • SmartCard
      • PropCert
      • SmartCardAPI
        • SCIntro
        • SCQuery
    • SSPI
      • GSS
      • HttpAuth
      • SockAuth
      • SSL
        • WebClient
        • WebServer
  • SysMgmt
    • MMC
      • About
      • ActiveX
        • atl
        • vb
      • CMenu
      • CMenuExt
      • Complete
      • CutCopy
      • Extens
      • Help
        • Help source
      • Menubtn
      • mmc2.0
        • about
        • contextmenu
        • contextmenuex
        • dragdrop
        • help
        • multisel
        • proppage
        • proppagex
        • simple
        • viewex
      • Multisel
      • Nameext
      • Nodes
      • Openserv
      • Ppgeext
      • Proppage
      • Simple
      • Taskpads
      • Tbarext
      • Toolbar
        • Help source
      • WMI
    • Msi
      • create.dll
      • msiloc
      • msistuff
      • process.dll
      • remove.dll
      • setup.exe
      • tutorial.dll
    • TaskSched
    • WMI
      • VC
        • AdvClient
        • ClassProv
        • CmdLineConsumer
        • decoupled
          • Event_Consumer
            • Include
          • Event_Provider
            • Include
          • Instance_Provider
            • Include
        • EventConsumer
        • EventProvider
        • FrameworkProv
        • HiPerfClient
        • HiPerfProvider
        • InstProv
        • MethCli
        • MethProv
        • pathparser
        • PropProv
        • queryparser
        • security
        • SimpleClient
        • TempConsumer
        • UtilLib
        • WMIDiskPerf
  • TabletPC
    • AdvReco
    • AutoClaims
      • C#
    • AutoClaims15
      • C#
    • AutoClaims_WebControl
      • C#
    • BasicRecognition
    • EventSink
    • InkBlog
      • C#
    • InkClipboard
    • InkCollection
      • C#
    • InkCollection_RTS
      • C#
    • InkDivider
      • C#
    • InkErase
      • C#
    • InkHitTest
    • InkRecognition
      • C#
    • InkZoom
      • C#
    • MultiReco
    • RealTimeStylusPlugin
      • C#
    • RecoDLL
    • ScannedPaperForm
      • C#
    • Serialization
    • TPCInfo
  • UDDI
    • publish
    • wsdldiscovery
      • controls
  • Web
    • bits
      • bits_ie
      • Upload
    • Browser
      • BrochureMachine
      • EdAnnotator
        • AnnotatorProject
      • EditCommands
      • EditFeatures
      • EditGlyphs
      • EditHost
      • RenderBehave
        • renderproject
    • dxtrans
      • dxsurf1
      • dxsurf2
      • dxsurf3
      • dxsurfmod
    • iis
      • Components
        • Cpp
          • Intermediate
          • MTXSample
          • Simple
      • extensions
        • Chunk
        • DumpVars
        • Formdump
        • InvokObjThreads
        • io
          • ASyncRead
          • ASyncTrans
          • ASyncWrite
          • SyncRead
          • SyncWrite
        • Keep-Alive
        • KeepAliveWithThreads
        • Redirect
        • Simple
        • WorkerThread
      • filters
        • AuthFilt
        • UpCase
      • ISAPI_6.0
        • CacheIsapi
        • CustomAuth
        • DumpRequestInfo
        • HelloIsapi
        • inc
        • PoolWrap
        • ReMapUrl
        • src
        • UpCaseMap
        • WildCardMap
      • progadmin
        • ABO
          • EnumerateKeys
    • MSAgent
      • c
        • Cap
        • CapMFC
        • Hello
        • Hello2
        • Hello3
      • Java
        • CapJ
        • Hello
        • Hello2
        • Hello3
    • NetMeeting
      • InstCodc
      • NMChat
      • NMChat2
      • NMFT
      • NMShare
      • NMUI
      • PlugTransport
    • networking
      • asyncdemo
      • ftpjr
      • httpauth
      • httpdump
    • winhttp
      • asyncdemocomplete
      • asyncdemotutorial
      • retoptions
      • setoptions
      • WinHttpAsyncSample
      • WinHttpFormSubmitSample
      • WinHttpPostSample
    • xml
      • mfc_tree
  • WinBase
    • Cluster
      • Win2003
        • ClipBookServer
          • ClipBook Server
          • ClipBook ServerEx
        • FileShareSample
          • File Share Sample
          • File Share SampleEx
        • MyCapabilities
        • MyEvictListener
        • MyMemberSetChangeListener
        • MyStartupListener
        • MyStorageResource
    • Debug
      • BPSamp
      • dbh
      • Deb
      • DebugHandler
      • eventlog
    • EventTrace
      • TraceDmp
      • tracedp
      • TraceLog
    • Indexing
      • AdvQuery
      • ChgState
      • HtmlProp
      • IFilter
      • IISSearch
      • lrsample
      • Simple
      • SmpFilt
      • VJQuery
    • IO
      • AsyncIO
      • DiskQuota
      • DLEdit
      • EnumMount
      • EnumStreams
      • FCopy
      • Floppy
      • Mount
      • RSM
        • app
        • inc
        • mll
      • UnBufCpy
    • IPC
      • NamePipe
        • Console
        • npClient
        • NPServer
    • Registry
    • Service
    • WinNT
      • PerfTool
        • Pdh
          • ProcList
          • StatList
        • PerfDllS
          • AppMem
            • appDll
            • Inc
            • PerfDll
            • pub
          • LeakyBin
          • PerfGen
    • WtsApi
      • TSSysInf
        • Client
        • Inc
        • Server
      • Tst4Wts
      • WtsApi
  • WinUI
    • Clipboard
    • CommDlg
      • CDTest
      • ComDlg32
    • Controls
      • Common
        • Property
        • Rebar
        • VListVw
      • Custom
        • SpinCube
    • Cursor
    • fulldrag
    • GlobalDev
      • CSSamp
      • globaldev
        • gres409
    • Input
      • Ime
        • FullIME
        • HalfIME
        • IMEApps
        • MultiUI
      • MouseInfo
    • Menu
    • obscure
    • Resource
      • DynDlg
      • Iconpro
      • msgtable
    • sendto
    • Shell
      • AppBar
      • BandObjs
      • ColumnProvider
      • customdrawbuttondlg
      • DiskCleanupHandler
      • DragImg
      • DropExt
      • EnumDesk
      • Fakemenu
      • FileView
      • SampView
      • ShellExt
      • ShellIconOverlay
      • TrayNot
    • tallmenu
    • tsfapp
    • TSFcase
    • tsfcompart
    • TSFmark
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/ Directory Reference

  • Begin

Begin Directory Reference

Directories

directory | dll
directory | Generic
directory | sdkdiff
directory | Simple
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/dll/ Directory Reference

  • Begin
  • dll

dll Directory Reference

Files

file | Demo.c [code]
file | Demo.h [code]
file | Select.c [code]
file | Select.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/Generic/ Directory Reference

  • Begin
  • Generic

Generic Directory Reference

Files

file | Generic.C [code]
file | Generic.H [code]
file | Resource.H [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/ Directory Reference

  • Begin
  • sdkdiff

sdkdiff Directory Reference

Files

file | bar.cpp [code]
file | compitem.cpp [code]
file | compitem.h [code]
file | complist.cpp [code]
file | complist.h [code]
file | ErrorOut.cpp [code]
file | ErrorOut.h [code]
file | file.cpp [code]
file | file.h [code]
file | findgoto.cpp [code]
file | findgoto.h [code]
file | gfile.cpp [code]
file | gutils.cpp [code]
file | gutils.h [code]
file | gutilsrc.h [code]
file | line.cpp [code]
file | line.h [code]
file | list.cpp [code]
file | list.h [code]
file | precomp.h [code]
file | profile.cpp [code]
file | profile.h [code]
file | scandir.cpp [code]
file | scandir.h [code]
file | sdkdiff.cpp [code]
file | sdkdiff.h [code]
file | section.cpp [code]
file | section.h [code]
file | state.h [code]
file | status.cpp [code]
file | table.cpp [code]
file | table.h [code]
file | tpaint.cpp [code]
file | tprint.cpp [code]
file | tpriv.h [code]
file | tree.cpp [code]
file | tree.h [code]
file | tscroll.cpp [code]
file | utils.cpp [code]
file | view.cpp [code]
file | view.h [code]
file | wdiffrc.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/Simple/ Directory Reference

  • Begin
  • Simple

Simple Directory Reference

Files

file Simple.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/ Directory Reference

  • Com

Com Directory Reference

Directories

directory | Administration
directory | async
directory | Common
directory | Fundamentals
directory | Services
directory | StructuredStorage
directory | Tools
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/ Directory Reference

  • Com
  • Administration

Administration Directory Reference

Directories

directory | Explore.VC
directory | Spy
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/ Directory Reference

  • Com
  • Administration
  • Explore.VC

Explore.VC Directory Reference

Files

file | AppExportDlg.Cpp [code]
file | AppExportDlg.h [code]
file | AppInstallDlg.Cpp [code]
file | AppInstallDlg.h [code]
file | AppUtilDlg.Cpp [code]
file | AppUtilDlg.h [code]
file | CompImportDlg.Cpp [code]
file | CompImportDlg.h [code]
file | CompInstallDlg.Cpp [code]
file | CompInstallDlg.h [code]
file | ConnectDlg.Cpp [code]
file | ConnectDlg.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | UtilitiesDlg.Cpp [code]
file | UtilitiesDlg.h [code]
file | VCExplore.Cpp [code]
file | VCExplore.h [code]
file | VCExploreDlg.Cpp [code]
file | VCExploreDlg.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ Directory Reference

  • Com
  • Administration
  • Spy

Spy Directory Reference

Directories

directory | ComSpy
directory | ComSpyAudit
directory | ComSpyCtl
directory | ComSpyface
directory | idl
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpy/ Directory Reference

  • Com
  • Administration
  • Spy
  • ComSpy

ComSpy Directory Reference

Files

file | ComSpy.Cpp [code]
file | ComSpy.Idl [code]
file | Resource.h [code]
file | SpyCon.Cpp [code]
file | SpyCon.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyAudit/ Directory Reference

  • Com
  • Administration
  • Spy
  • ComSpyAudit

ComSpyAudit Directory Reference

Files

file | ComSpyAudit.Cpp [code]
file | ComSpysqlAudit.Cpp [code]
file | ComSpysqlAudit.h [code]
file | Events.Cpp [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/ Directory Reference

  • Com
  • Administration
  • Spy
  • ComSpyCtl

ComSpyCtl Directory Reference

Files

file | activitysub.h [code]
file | Adminwrap.Cpp [code]
file | Adminwrap.h [code]
file | appinfo.Cpp [code]
file | appinfo.h [code]
file | appsub.h [code]
file | ccomspy.h [code]
file | ComSpy.Cpp [code]
file | ComSpyCtl.Cpp [code]
file | ComSpyproppage.Cpp [code]
file | ComSpyproppage.h [code]
file | crmsub.Cpp [code]
file | crmsub.h [code]
file | evtstoresub.Cpp [code]
file | evtstoresub.h [code]
file | exceptionsub.h [code]
file | Identitysub.h [code]
file | instancesub.h [code]
file | lbsub.h [code]
file | Methodsub.Cpp [code]
file | Methodsub.h [code]
file | Objconstsub.h [code]
file | ObjPool2sub.h [code]
file | ObjPoolsub.h [code]
file | Objsub.h [code]
file | qcsub.h [code]
file | Resource.h [code]
file | Resourcesub.Cpp [code]
file | Resourcesub.h [code]
file | securitysub.h [code]
file | selectEventsDlg.Cpp [code]
file | selectEventsDlg.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | syslcesub.Cpp [code]
file | syslcesub.h [code]
file | threadsub.h [code]
file | txsub.Cpp [code]
file | txsub.h [code]
file | usersub.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyface/ Directory Reference

  • Com
  • Administration
  • Spy
  • ComSpyface

ComSpyface Directory Reference

Files

file | ComSpyAudit.Idl [code]
file | ComSpyCtl.Idl [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/idl/ Directory Reference

  • Com
  • Administration
  • Spy
  • idl

idl Directory Reference

Files

file | comspyaudit.idl [code]
file | comspyctl.idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/ Directory Reference

  • Com
  • async

async Directory Reference

Directories

directory | client
directory | proxy
directory | server
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/client/ Directory Reference

  • Com
  • async
  • client

client Directory Reference

Files

file | CEvent.h [code]
file | main.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/proxy/ Directory Reference

  • Com
  • async
  • proxy

proxy Directory Reference

Files

file Proxy.idl [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/ Directory Reference

  • Com
  • async
  • server

server Directory Reference

Files

file | CAsyncTest.cpp [code]
file | CAsyncTest.h [code]
file | CAsyncXXX.cpp [code]
file | CAsyncXXX.h [code]
file | CConnectionPT.cpp [code]
file | CConnectionPT.h [code]
file | CEnumXXX.cpp [code]
file | CEnumXXX.h [code]
file | cfactory.cpp [code]
file | cfactory.h [code]
file | cunknown.cpp [code]
file | cunknown.h [code]
file | DCOMServer.cpp [code]
file | DCOMServer.h [code]
file | debug.c [code]
file | debug.h [code]
file | main.cpp [code]
file | registry.cpp [code]
file | registry.h [code]
file | SERVER.CPP [code]
file | UNK.H [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Common/ Directory Reference

  • Com
  • Common

Common Directory Reference

Directories

directory | Inc
directory | ProxyStub
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Common/Inc/ Directory Reference

  • Com
  • Common
  • Inc

Inc Directory Reference

Files

file | CpyImage.Idl [code]
file | MtsAudit.Idl [code]
file | MtsSpyCtl.Idl [code]
file | MtsUserEventObj.Idl [code]
file | RmWorker.Idl [code]
file | TxFileDisp.Idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Common/ProxyStub/ Directory Reference

  • Com
  • Common
  • ProxyStub

ProxyStub Directory Reference

Files

file | CopyFileRm.Idl [code]
file | iid.c [code]
file | SimpleLog.Idl [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ Directory Reference

  • Com
  • Fundamentals

Fundamentals Directory Reference

Directories

directory | ActiveDocument
directory | AsyncCalls
directory | CMallSpy
directory | Common
directory | CustomSurrogate
directory | DCom
directory | Include
directory | Object
directory | OleApt
directory | OleStd
directory | Pipes
directory | SimpCntr
directory | SimpDnd
directory | SimpSvr
directory | TutSamp
directory | WinHlprs
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/ Directory Reference

  • Com
  • Fundamentals
  • ActiveDocument

ActiveDocument Directory Reference

Directories

directory | DfV
directory | DoServer
directory | Framer
directory | Range
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/ Directory Reference

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

DfV Directory Reference

Files

file | about.Cxx [code]
file | about.h [code]
file | bitmaps.Cxx [code]
file | bitmaps.h [code]
file | DfV.h [code]
file | message.Cxx [code]
file | message.h [code]
file | mwclass.Cxx [code]
file | mwclass.h [code]
file | strmvwr.Cxx [code]
file | strmvwr.h [code]
file | WinMain.Cxx [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/ Directory Reference

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

DoServer Directory Reference

Files

file | clsfact.Cpp [code]
file | clsfact.h [code]
file | DataObj.Cpp [code]
file | DataObj.h [code]
file | DoServer.Cpp [code]
file | DoServer.h [code]
file | oipaObj.Cpp [code]
file | oipaObj.h [code]
file | oipObj.Cpp [code]
file | oipObj.h [code]
file | OLEDoc.Cpp [code]
file | OLEDoc.h [code]
file | OLEDocVw.Cpp [code]
file | OLEDocVw.h [code]
file | OLEObj.Cpp [code]
file | OLEObj.h [code]
file | perfile.Cpp [code]
file | perfile.h [code]
file | perstor.Cpp [code]
file | perstor.h [code]
file | Resource.h [code]
file | Utils.Cpp [code]
file | Utils.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Framer/ Directory Reference

  • Com
  • Fundamentals
  • ActiveDocument
  • Framer

Framer Directory Reference

Files

file | Framer.Cpp [code]
file | Framer.h [code]
file | IAdvSink.Cpp [code]
file | ICliSite.Cpp [code]
file | IDocSite.Cpp [code]
file | IIpSite.Cpp [code]
file | Resource.h [code]
file | Site.Cpp [code]
file | Site.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Range/ Directory Reference

  • Com
  • Fundamentals
  • ActiveDocument
  • Range

Range Directory Reference

Files

file | cache.Cpp [code]
file | callback.Cpp [code]
file | callback.hpp [code]
file | download.Cpp [code]
file | Range.c [code]
file | Range.h [code]
file | recvbuf.Cpp [code]
file | recvbuf.hpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls

AsyncCalls Directory Reference

Directories

directory | CallBackClient
directory | CPPClient
directory | FullSvr
directory | HelpDll
directory | JavaClient
directory | ScaleDemo
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/CallBackClient/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls
  • CallBackClient

CallBackClient Directory Reference

Files

file | callbackclient.Cpp [code]
file | callbackclient.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/CPPClient/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls
  • CPPClient

CPPClient Directory Reference

Files

file | cppclient.Cpp [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/FullSvr/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls
  • FullSvr

FullSvr Directory Reference

Files

file | fullserv.Cpp [code]
file | fullserv.h [code]
file | fullsvr.Cpp [code]
file | fullsvr.Idl [code]
file | resource.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/HelpDll/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls
  • HelpDll

HelpDll Directory Reference

Files

file | helpdll.Cpp [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/JavaClient/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls
  • JavaClient

JavaClient Directory Reference

Directories

directory | FullSvr

Files

file | Class1.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/JavaClient/FullSvr/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls
  • JavaClient
  • FullSvr

FullSvr Directory Reference

Files

file | AsyncFullServ.java [code]
file | AsyncIFullServ.java [code]
file | FullServ.java [code]
file | ICallFactory.java [code]
file | ICancelMethodCalls.java [code]
file | IFullServ.java [code]
file | ISynchronize.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/ScaleDemo/ Directory Reference

  • Com
  • Fundamentals
  • AsyncCalls
  • ScaleDemo

ScaleDemo Directory Reference

Files

file | scaledemo.Cpp [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CMallSpy/ Directory Reference

  • Com
  • Fundamentals
  • CMallSpy

CMallSpy Directory Reference

Files

file | CMallSpy.Cxx [code]
file | CMallSpy.Hxx [code]
file | Test.Cxx [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Common/ Directory Reference

  • Com
  • Fundamentals
  • Common

Common Directory Reference

Files

file | altassrt.Cxx [code]
file | Stablize.Cxx [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/ Directory Reference

  • Com
  • Fundamentals
  • CustomSurrogate

CustomSurrogate Directory Reference

Directories

directory | Dog
directory | Surrog
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/Dog/ Directory Reference

  • Com
  • Fundamentals
  • CustomSurrogate
  • Dog

Dog Directory Reference

Files

file | cDog.h [code]
file | Dog.Cpp [code]
file | Dogcf.Cpp [code]
file | Dogcf.h [code]
file | iDog.Cpp [code]
file | iDog.Idl [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/Surrog/ Directory Reference

  • Com
  • Fundamentals
  • CustomSurrogate
  • Surrog

Surrog Directory Reference

Files

file | cfWrap.Cpp [code]
file | cfWrap.h [code]
file | Common.h [code]
file | csur.Cpp [code]
file | csur.h [code]
file | custsur.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/ Directory Reference

  • Com
  • Fundamentals
  • DCom

DCom Directory Reference

Directories

directory | Cancel
directory | ComPerf
directory | DComPerm
directory | OleImp
directory | Secure
directory | Simple
directory | TimeOuts
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Cancel

Cancel Directory Reference

Directories

directory | Client
directory | InProc
directory | Local
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/Client/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • Client

Client Directory Reference

Files

file | Cancel.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/InProc/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • InProc

InProc Directory Reference

Files

file SServer.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/Local/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • Local

Local Directory Reference

Directories

directory | Mta
directory | Sta
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/Local/Mta/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • Local
  • Mta

Mta Directory Reference

Files

file SServer.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/Local/Sta/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • Local
  • Sta

Sta Directory Reference

Files

file SServer.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/ComPerf/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • ComPerf

ComPerf Directory Reference

Files

file | ComPerf.Cpp [code]
file | psperf.Idl [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/DComPerm/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • DComPerm

DComPerm Directory Reference

Files

file | AclMgmt.Cpp [code]
file | DComPerm.Cpp [code]
file | DComPerm.h [code]
file | ListAcl.Cpp [code]
file | SDMgmt.Cpp [code]
file | SrvcMgmt.Cpp [code]
file | UtilS.Cpp [code]
file | Wrappers.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/OleImp/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • OleImp

OleImp Directory Reference

Files

file | Client.Cpp [code]
file | OleImp.Cpp [code]
file | Util.Cpp [code]
file | Util.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Secure/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Secure

Secure Directory Reference

Files

file | myProp.Idl [code]
file | Resource.h [code]
file | secClnt.Cpp [code]
file | secClnt.h [code]
file | secSvr.Cpp [code]
file | secSvr.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Simple/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Simple

Simple Directory Reference

Directories

directory | sclient
directory | sserver
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Simple/sclient/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Simple
  • sclient

sclient Directory Reference

Files

file sclient.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Simple/sserver/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • Simple
  • sserver

sserver Directory Reference

Files

file sserver.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • TimeOuts

TimeOuts Directory Reference

Directories

directory | Client
directory | PingResp
directory | Server
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Client/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Client

Client Directory Reference

Files

file | Client.Cpp [code]
file | Client.h [code]
file | ClientDlg.Cpp [code]
file | ClientDlg.h [code]
file | Resource.h [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/PingResp/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • PingResp

PingResp Directory Reference

Files

file | DllDatax.c [code]
file | DllDatax.h [code]
file | PingResp.Cpp [code]
file | PingResp.Idl [code]
file | PingResponder.h [code]
file | Resource.h [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Server/ Directory Reference

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Server

Server Directory Reference

Files

file | MonitorServer.Cpp [code]
file | MonitorServer.h [code]
file | Resource.h [code]
file | Server.Cpp [code]
file | Server.Idl [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Include/ Directory Reference

  • Com
  • Fundamentals
  • Include

Include Directory Reference

Files

file | ansiapi.h [code]
file | assert.h [code]
file | BttnCur.h [code]
file | GizmoBar.h [code]
file | msgfiltr.h [code]
file | OleStd.h [code]
file | Stablize.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/ Directory Reference

  • Com
  • Fundamentals
  • Object

Object Directory Reference

Directories

directory | CallAs
directory | OHello
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/CallAs/ Directory Reference

  • Com
  • Fundamentals
  • Object
  • CallAs

CallAs Directory Reference

Files

file | call_as.c [code]
file | CallAs.Idl [code]
file | Client.c [code]
file | Server.Cxx [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/OHello/ Directory Reference

  • Com
  • Fundamentals
  • Object
  • OHello

OHello Directory Reference

Files

file | cHello.Cxx [code]
file | Client.Cxx [code]
file | error.Cxx [code]
file | OHello.Idl [code]
file | Server.Cxx [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleApt/ Directory Reference

  • Com
  • Fundamentals
  • OleApt

OleApt Directory Reference

Files

file OleApt.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/ Directory Reference

  • Com
  • Fundamentals
  • OleStd

OleStd Directory Reference

Files

file | ansiapi.h [code]
file | Common.h [code]
file | dballoc.Cpp [code]
file | dballoc.h [code]
file | dbgUtil.c [code]
file | debug.h [code]
file | drawIcon.c [code]
file | enumfetc.c [code]
file | enumStat.c [code]
file | getIcon.c [code]
file | hatch.c [code]
file | malspy.c [code]
file | malspy.h [code]
file | msgfiltr.c [code]
file | Objfdbk.c [code]
file | ole2ui.c [code]
file | OleStd.c [code]
file | oleutl.c [code]
file | regdb.c [code]
file | stdpal.c [code]
file | stdpal.h [code]
file | suminfo.Cpp [code]
file | suminfo.h [code]
file | targtdev.c [code]
file | Utility.c [code]
file | Utility.h [code]
file | wn_dos.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Pipes/ Directory Reference

  • Com
  • Fundamentals
  • Pipes

Pipes Directory Reference

Directories

directory | Client
directory | Include
directory | LocalServer
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Pipes/Client/ Directory Reference

  • Com
  • Fundamentals
  • Pipes
  • Client

Client Directory Reference

Files

file client.cxx [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Pipes/Include/ Directory Reference

  • Com
  • Fundamentals
  • Pipes
  • Include

Include Directory Reference

Files

file | pipe.cxx [code]
file | pipe.hxx [code]
file | pipesample.Idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Pipes/LocalServer/ Directory Reference

  • Com
  • Fundamentals
  • Pipes
  • LocalServer

LocalServer Directory Reference

Files

file | component.cxx [code]
file | component.hxx [code]
file | server.cxx [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpCntr/ Directory Reference

  • Com
  • Fundamentals
  • SimpCntr

SimpCntr Directory Reference

Files

file | app.Cpp [code]
file | app.h [code]
file | doc.Cpp [code]
file | doc.h [code]
file | ias.Cpp [code]
file | ias.h [code]
file | iocs.Cpp [code]
file | iocs.h [code]
file | ioipf.Cpp [code]
file | ioipf.h [code]
file | ioips.Cpp [code]
file | ioips.h [code]
file | pre.h [code]
file | Resource.h [code]
file | SimpCntr.Cpp [code]
file | SimpCntr.h [code]
file | site.Cpp [code]
file | site.h [code]
file | stdpal.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/ Directory Reference

  • Com
  • Fundamentals
  • SimpDnd

SimpDnd Directory Reference

Files

file | app.Cpp [code]
file | app.h [code]
file | doc.Cpp [code]
file | doc.h [code]
file | dxferObj.Cpp [code]
file | dxferObj.h [code]
file | ias.Cpp [code]
file | ias.h [code]
file | ids.Cpp [code]
file | ids.h [code]
file | idt.Cpp [code]
file | idt.h [code]
file | iocs.Cpp [code]
file | iocs.h [code]
file | pre.h [code]
file | Resource.h [code]
file | SimpDnd.Cpp [code]
file | SimpDnd.h [code]
file | site.Cpp [code]
file | site.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/ Directory Reference

  • Com
  • Fundamentals
  • SimpSvr

SimpSvr Directory Reference

Files

file | app.Cpp [code]
file | app.h [code]
file | doc.Cpp [code]
file | doc.h [code]
file | icf.Cpp [code]
file | icf.h [code]
file | ido.Cpp [code]
file | ido.h [code]
file | iec.Cpp [code]
file | iec.h [code]
file | ioipao.Cpp [code]
file | ioipao.h [code]
file | ioipo.Cpp [code]
file | ioipo.h [code]
file | ioo.Cpp [code]
file | ioo.h [code]
file | ips.Cpp [code]
file | ips.h [code]
file | Obj.Cpp [code]
file | Obj.h [code]
file | pre.h [code]
file | Resource.h [code]
file | SimpSvr.Cpp [code]
file | SimpSvr.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp

TutSamp Directory Reference

Directories

directory | AppUtil
directory | AptClien
directory | AptServe
directory | ComObj
directory | ComUser
directory | ConClien
directory | ConServe
directory | DcdMarsh
directory | DcdServe
directory | DComDraw
directory | DllClien
directory | DllServe
directory | DllSkel
directory | DllUser
directory | ExeSkel
directory | FreClien
directory | FreServe
directory | Inc
directory | LicClien
directory | LicServe
directory | LocClien
directory | LocServe
directory | Marshal
directory | Marshal2
directory | PerClien
directory | PerDraw
directory | PerServe
directory | PerText
directory | ReadTut
directory | Register
directory | RemClien
directory | StoClien
directory | StoServe
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AppUtil/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • AppUtil

AppUtil Directory Reference

Files

file | AppUtil.Cpp [code]
file | AppUtil.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • AptClien

AptClien Directory Reference

Files

file | AptClien.Cpp [code]
file | AptClien.h [code]
file | UTCRUCAR.Cpp [code]
file | UTCRUCAR.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • AptServe

AptServe Directory Reference

Files

file | AptServe.Cpp [code]
file | AptServe.h [code]
file | CAR.Cpp [code]
file | CAR.h [code]
file | CRUCAR.Cpp [code]
file | CRUCAR.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | Server.Cpp [code]
file | Server.h [code]
file | UtilCAR.Cpp [code]
file | UtilCAR.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComObj/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • ComObj

ComObj Directory Reference

Files

file | CAR.Cpp [code]
file | CAR.h [code]
file | ComObj.Cpp [code]
file | ComObj.h [code]
file | ComObjI.h [code]
file | CRUCAR.Cpp [code]
file | CRUCAR.h [code]
file | UtilCAR.Cpp [code]
file | UtilCAR.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComUser/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • ComUser

ComUser Directory Reference

Files

file | ComUser.Cpp [code]
file | ComUser.h [code]
file | UTCRUCAR.Cpp [code]
file | UTCRUCAR.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • ConClien

ConClien Directory Reference

Files

file | ConClien.Cpp [code]
file | ConClien.h [code]
file | GUIBALL.Cpp [code]
file | GUIBALL.h [code]
file | SINK.Cpp [code]
file | SINK.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • ConServe

ConServe Directory Reference

Files

file | BALL.Cpp [code]
file | BALL.h [code]
file | Connect.Cpp [code]
file | Connect.h [code]
file | ConServe.Cpp [code]
file | ConServe.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | Server.Cpp [code]
file | Server.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdMarsh/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • DcdMarsh

DcdMarsh Directory Reference

Files

file PAPINT.Idl [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

DcdServe Directory Reference

Files

file | Connect.Cpp [code]
file | Connect.h [code]
file | DcdServe.Cpp [code]
file | DcdServe.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | PAPER.Cpp [code]
file | PAPER.h [code]
file | Server.Cpp [code]
file | Server.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DComDraw/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • DComDraw

DComDraw Directory Reference

Files

file | DComDraw.Cpp [code]
file | DComDraw.h [code]
file | GUIPAPER.Cpp [code]
file | GUIPAPER.h [code]
file | SINK.Cpp [code]
file | SINK.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • DllClien

DllClien Directory Reference

Files

file | DllClien.Cpp [code]
file | DllClien.h [code]
file | UTCRUCAR.Cpp [code]
file | UTCRUCAR.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

DllServe Directory Reference

Files

file | CAR.Cpp [code]
file | CAR.h [code]
file | CRUCAR.Cpp [code]
file | CRUCAR.h [code]
file | DllServe.Cpp [code]
file | DllServe.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | Sample.Cpp [code]
file | Sample.h [code]
file | Server.Cpp [code]
file | Server.h [code]
file | UtilCAR.Cpp [code]
file | UtilCAR.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllSkel/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • DllSkel

DllSkel Directory Reference

Files

file | DllSkel.Cpp [code]
file | DllSkel.h [code]
file | DllSkelI.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllUser/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • DllUser

DllUser Directory Reference

Files

file | DllUser.Cpp [code]
file | DllUser.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ExeSkel/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • ExeSkel

ExeSkel Directory Reference

Files

file | ExeSkel.Cpp [code]
file | ExeSkel.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • FreClien

FreClien Directory Reference

Files

file | FreClien.Cpp [code]
file | FreClien.h [code]
file | GUIBALL.Cpp [code]
file | GUIBALL.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • FreServe

FreServe Directory Reference

Files

file | BALL.Cpp [code]
file | BALL.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | FreServe.Cpp [code]
file | FreServe.h [code]
file | Server.Cpp [code]
file | Server.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Inc/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • Inc

Inc Directory Reference

Files

file | AppUtil.h [code]
file | BALLGUID.h [code]
file | CARGUIDS.h [code]
file | IBALL.h [code]
file | ICARS.h [code]
file | IPageS.h [code]
file | IPAPER.h [code]
file | PageGUID.h [code]
file | PAPGUIDS.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LicClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • LicClien

LicClien Directory Reference

Files

file | LicClien.Cpp [code]
file | LicClien.h [code]
file | UTCRUCAR.Cpp [code]
file | UTCRUCAR.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LicServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • LicServe

LicServe Directory Reference

Files

file | CRUCAR.Cpp [code]
file | CRUCAR.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | LicServe.Cpp [code]
file | LicServe.h [code]
file | Sample.Cpp [code]
file | Sample.h [code]
file | Server.Cpp [code]
file | Server.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • LocClien

LocClien Directory Reference

Files

file | LocClien.Cpp [code]
file | LocClien.h [code]
file | UTCRUCAR.Cpp [code]
file | UTCRUCAR.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

LocServe Directory Reference

Files

file | CAR.Cpp [code]
file | CAR.h [code]
file | CRUCAR.Cpp [code]
file | CRUCAR.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | LocServe.Cpp [code]
file | LocServe.h [code]
file | Server.Cpp [code]
file | Server.h [code]
file | UtilCAR.Cpp [code]
file | UtilCAR.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Marshal/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • Marshal

Marshal Directory Reference

Files

file MICARS.Idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Marshal2/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • Marshal2

Marshal2 Directory Reference

Files

file | Marshal2.Cpp [code]
file | MICARS.Idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

PerClien Directory Reference

Files

file | DRAWSINK.Cpp [code]
file | DRAWSINK.h [code]
file | GUIDRAW.Cpp [code]
file | GUIDRAW.h [code]
file | GUIList.Cpp [code]
file | GUIList.h [code]
file | GUIText.Cpp [code]
file | GUIText.h [code]
file | ListSINK.Cpp [code]
file | ListSINK.h [code]
file | ListWIN.Cpp [code]
file | ListWIN.h [code]
file | PageFILE.Cpp [code]
file | PageFILE.h [code]
file | PerClien.Cpp [code]
file | PerClien.h [code]
file | RESDEF.h [code]
file | TextSINK.Cpp [code]
file | TextSINK.h [code]
file | TextWIN.Cpp [code]
file | TextWIN.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerDraw/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • PerDraw

PerDraw Directory Reference

Files

file | Connect.Cpp [code]
file | Connect.h [code]
file | DRAWPage.Cpp [code]
file | DRAWPage.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | PerDraw.Cpp [code]
file | PerDraw.h [code]
file | Server.Cpp [code]
file | Server.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • PerServe

PerServe Directory Reference

Files

file | Connect.Cpp [code]
file | Connect.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | PageList.Cpp [code]
file | PageList.h [code]
file | PerServe.Cpp [code]
file | PerServe.h [code]
file | Server.Cpp [code]
file | Server.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerText/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • PerText

PerText Directory Reference

Files

file | Connect.Cpp [code]
file | Connect.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | PerText.Cpp [code]
file | PerText.h [code]
file | Server.Cpp [code]
file | Server.h [code]
file | TextPage.Cpp [code]
file | TextPage.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ReadTut/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • ReadTut

ReadTut Directory Reference

Files

file | ReadTut.Cpp [code]
file | ReadTut.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Register/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • Register

Register Directory Reference

Files

file | register.Cpp [code]
file | register.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/RemClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • RemClien

RemClien Directory Reference

Files

file | RemClien.Cpp [code]
file | RemClien.h [code]
file | UTCRUCAR.Cpp [code]
file | UTCRUCAR.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/StoClien/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • StoClien

StoClien Directory Reference

Files

file | GUIPAPER.Cpp [code]
file | GUIPAPER.h [code]
file | PAPFILE.Cpp [code]
file | PAPFILE.h [code]
file | SINK.Cpp [code]
file | SINK.h [code]
file | StoClien.Cpp [code]
file | StoClien.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/StoServe/ Directory Reference

  • Com
  • Fundamentals
  • TutSamp
  • StoServe

StoServe Directory Reference

Files

file | Connect.Cpp [code]
file | Connect.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | PAPER.Cpp [code]
file | PAPER.h [code]
file | Server.Cpp [code]
file | Server.h [code]
file | StoServe.Cpp [code]
file | StoServe.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/WinHlprs/ Directory Reference

  • Com
  • Fundamentals
  • WinHlprs

WinHlprs Directory Reference

Files

file | cDialog.Cxx [code]
file | cDialog.h [code]
file | cwindow.Cxx [code]
file | cwindow.h [code]
file | strmHelp.Cxx [code]
file | strmHelp.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/ Directory Reference

  • Com
  • Services

Services Directory Reference

Directories

directory | BYOT
directory | Concurrency
directory | Crm
directory | Events
directory | Object_Pooling
directory | Queued_Components
directory | Resource_Dispenser
directory | Security
directory | Shared_Property_Manager
directory | Transaction
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/ Directory Reference

  • Com
  • Services
  • BYOT

BYOT Directory Reference

Directories

directory | BYOTSampleWeb
directory | Client
directory | Server
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/BYOTSampleWeb/ Directory Reference

  • Com
  • Services
  • BYOT
  • BYOTSampleWeb

BYOTSampleWeb Directory Reference

Directories

directory _ScriptLibrary
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/BYOTSampleWeb/_ScriptLibrary/ Directory Reference

  • Com
  • Services
  • BYOT
  • BYOTSampleWeb
  • _ScriptLibrary

_ScriptLibrary Directory Reference

Files

file rsProxy.java [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Client/ Directory Reference

  • Com
  • Services
  • BYOT
  • Client

Client Directory Reference

Directories

directory BYOTTransaction
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Client/BYOTTransaction/ Directory Reference

  • Com
  • Services
  • BYOT
  • Client
  • BYOTTransaction

BYOTTransaction Directory Reference

Files

file | BYOTTransaction.Cpp [code]
file | BYOTTransaction.Idl [code]
file | BYOTtransObj.Cpp [code]
file | BYOTtransObj.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Server/ Directory Reference

  • Com
  • Services
  • BYOT
  • Server

Server Directory Reference

Directories

directory BYOTTxEnlister
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Server/BYOTTxEnlister/ Directory Reference

  • Com
  • Services
  • BYOT
  • Server
  • BYOTTxEnlister

BYOTTxEnlister Directory Reference

Files

file | EnlistTransaction.Cpp [code]
file | EnlistTransaction.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | TxEnlister.Cpp [code]
file | TxEnlister.Idl [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/ Directory Reference

  • Com
  • Services
  • Concurrency

Concurrency Directory Reference

Directories

directory SyncComp
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/ Directory Reference

  • Com
  • Services
  • Concurrency
  • SyncComp

SyncComp Directory Reference

Directories

directory | ComSyncObject
directory | FreeObject
directory | STAObject

Files

file | Main.Cpp [code]
file | Main.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | SyncComp.Cpp [code]
file | SyncComp.Idl [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/ComSyncObject/ Directory Reference

  • Com
  • Services
  • Concurrency
  • SyncComp
  • ComSyncObject

ComSyncObject Directory Reference

Files

file | ComSyncObject.Cpp [code]
file | ComSyncObject.Idl [code]
file | ComSyncTest.Cpp [code]
file | ComSyncTest.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/FreeObject/ Directory Reference

  • Com
  • Services
  • Concurrency
  • SyncComp
  • FreeObject

FreeObject Directory Reference

Files

file | FreeObject.Cpp [code]
file | FreeObject.Idl [code]
file | FreeTest.Cpp [code]
file | FreeTest.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/STAObject/ Directory Reference

  • Com
  • Services
  • Concurrency
  • SyncComp
  • STAObject

STAObject Directory Reference

Files

file | Resource.h [code]
file | STAObject.Cpp [code]
file | STAObject.Idl [code]
file | STATest.Cpp [code]
file | STATest.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/ Directory Reference

  • Com
  • Services
  • Crm

Crm Directory Reference

Directories

directory | CrmDebug
directory | CrmFiles
directory | CrmFilesTest
directory | CrmMonitor
directory | IDL
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmDebug/ Directory Reference

  • Com
  • Services
  • Crm
  • CrmDebug

CrmDebug Directory Reference

Files

file | CrmDebug.Cpp [code]
file | CrmDebug.Idl [code]
file | CrmDebugCompensator.Cpp [code]
file | CrmDebugCompensator.h [code]
file | DllDatax.c [code]
file | DllDatax.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFiles/ Directory Reference

  • Com
  • Services
  • Crm
  • CrmFiles

CrmFiles Directory Reference

Files

file | CrmFiles.Cpp [code]
file | CrmFiles.Idl [code]
file | CrmFilesCompensator.Cpp [code]
file | CrmFilesCompensator.h [code]
file | CrmFilesWorker.Cpp [code]
file | CrmFilesWorker.h [code]
file | DllDatax.c [code]
file | DllDatax.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFilesTest/ Directory Reference

  • Com
  • Services
  • Crm
  • CrmFilesTest

CrmFilesTest Directory Reference

Files

file | CrmFilesTest.Cpp [code]
file | CrmFilesTest.Idl [code]
file | CrmFilesTestObj.Cpp [code]
file | CrmFilesTestObj.h [code]
file | DllDatax.c [code]
file | DllDatax.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmMonitor/ Directory Reference

  • Com
  • Services
  • Crm
  • CrmMonitor

CrmMonitor Directory Reference

Files

file | CrmMonComp.Cpp [code]
file | CrmMonComp.Idl [code]
file | CrmMonCompObj.Cpp [code]
file | CrmMonCompObj.h [code]
file | DllDatax.c [code]
file | DllDatax.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/IDL/ Directory Reference

  • Com
  • Services
  • Crm
  • IDL

IDL Directory Reference

Files

file icrmFiles.Idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/ Directory Reference

  • Com
  • Services
  • Events

Events Directory Reference

Directories

directory | EventNews
directory | EventNewsJAVA
directory | UserEvents
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/ Directory Reference

  • Com
  • Services
  • Events
  • EventNews

EventNews Directory Reference

Directories

directory | CascadeEC
directory | Include
directory | NewsEventClass
directory | PersistATL
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/CascadeEC/ Directory Reference

  • Com
  • Services
  • Events
  • EventNews
  • CascadeEC

CascadeEC Directory Reference

Files

file | cascade.Cpp [code]
file | cascade.h [code]
file | cascadeec.Cpp [code]
file | cascadeec.Idl [code]
file | resource.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/Include/ Directory Reference

  • Com
  • Services
  • Events
  • EventNews
  • Include

Include Directory Reference

Files

file news.Idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/NewsEventClass/ Directory Reference

  • Com
  • Services
  • Events
  • EventNews
  • NewsEventClass

NewsEventClass Directory Reference

Files

file | newsevent.Cpp [code]
file | newsevent.h [code]
file | newseventclass.Cpp [code]
file | newseventclass.Idl [code]
file | resource.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/PersistATL/ Directory Reference

  • Com
  • Services
  • Events
  • EventNews
  • PersistATL

PersistATL Directory Reference

Files

file | newsevent.Cpp [code]
file | newsevent.h [code]
file | persistatl.Cpp [code]
file | persistatl.Idl [code]
file | resource.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA

EventNewsJAVA Directory Reference

Directories

directory | CascadeEvent
directory | ComAdmin
directory | NewsEvent
directory | NewsFlash
directory | NewsSuscriber
directory | PersistSubs
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/CascadeEvent/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • CascadeEvent

CascadeEvent Directory Reference

Directories

directory Cascadeec
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/CascadeEvent/Cascadeec/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • CascadeEvent
  • Cascadeec

Cascadeec Directory Reference

Files

file | CascadeEC.java [code]
file | INewsEvent.java [code]
file | INewsEventDefault.java [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

ComAdmin Directory Reference

Files

file | COMAdminAccessChecksLevelOptions.java [code]
file | COMAdminActivationOptions.java [code]
file | COMAdminApplicationExportOptions.java [code]
file | COMAdminApplicationInstallOptions.java [code]
file | COMAdminAuthenticationCapabilitiesOptions.java [code]
file | COMAdminAuthenticationLevelOptions.java [code]
file | COMAdminCatalog.java [code]
file | COMAdminCatalogCollection.java [code]
file | COMAdminCatalogObject.java [code]
file | COMAdminComponentFlags.java [code]
file | COMAdminErrorCodes.java [code]
file | COMAdminFileFlags.java [code]
file | COMAdminImpersonationLevelOptions.java [code]
file | COMAdminOS.java [code]
file | COMAdminServiceOptions.java [code]
file | COMAdminServiceStatusOptions.java [code]
file | COMAdminSynchronizationOptions.java [code]
file | COMAdminThreadingModels.java [code]
file | COMAdminTransactionOptions.java [code]
file | ICatalogCollection.java [code]
file | ICatalogObject.java [code]
file | ICOMAdminCatalog.java [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsEvent/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsEvent

NewsEvent Directory Reference

Directories

directory | Helper
directory | newsEventClass
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsEvent/Helper/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsEvent
  • Helper

Helper Directory Reference

Files

file sampleConstants.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsEvent/newsEventClass/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsEvent
  • newsEventClass

newsEventClass Directory Reference

Files

file | INewsEvent.java [code]
file | INewsEventDefault.java [code]
file | NewsEvent.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsFlash/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsFlash

NewsFlash Directory Reference

Files

file NewsFlash.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsSuscriber/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsSuscriber

NewsSuscriber Directory Reference

Files

file NewsSubscriber.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/PersistSubs/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • PersistSubs

PersistSubs Directory Reference

Directories

directory Persistatl
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/PersistSubs/Persistatl/ Directory Reference

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • PersistSubs
  • Persistatl

Persistatl Directory Reference

Files

file | INewsEvent.java [code]
file | INewsEventDefault.java [code]
file | NewsEvent.java [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/UserEvents/ Directory Reference

  • Com
  • Services
  • Events
  • UserEvents

UserEvents Directory Reference

Directories

directory VCAcct
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/UserEvents/VCAcct/ Directory Reference

  • Com
  • Services
  • Events
  • UserEvents
  • VCAcct

VCAcct Directory Reference

Files

file | Account.cpp [code]
file | Account.idl [code]
file | CAccount.cpp [code]
file | CAccount.h [code]
file | Resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/ Directory Reference

  • Com
  • Services
  • Object_Pooling

Object_Pooling Directory Reference

Directories

directory | ObjectPoolingJAVA
directory | OPBankSample
directory | PoolTest
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/ObjectPoolingJAVA/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • ObjectPoolingJAVA

ObjectPoolingJAVA Directory Reference

Directories

directory ObjectPoolingComponent
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/ObjectPoolingJAVA/ObjectPoolingComponent/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • ObjectPoolingJAVA
  • ObjectPoolingComponent

ObjectPoolingComponent Directory Reference

Directories

directory Account
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/ObjectPoolingJAVA/ObjectPoolingComponent/Account/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • ObjectPoolingJAVA
  • ObjectPoolingComponent
  • Account

Account Directory Reference

Directories

directory util
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/ObjectPoolingJAVA/ObjectPoolingComponent/Account/util/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • ObjectPoolingJAVA
  • ObjectPoolingComponent
  • Account
  • util

util Directory Reference

Files

file DatabaseSettings.java [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • OPBankSample

OPBankSample Directory Reference

Directories

directory | Account.VC
directory | OPBank
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

Account.VC Directory Reference

Files

file | Account.Cpp [code]
file | Account.Idl [code]
file | caccount.Cpp [code]
file | caccount.h [code]
file | getrec.Cpp [code]
file | getrec.h [code]
file | mvmoney.Cpp [code]
file | mvmoney.h [code]
file | resource.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
file | unicode.h [code]
file | updrec.Cpp [code]
file | updrec.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/OPBank/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • OPBank

OPBank Directory Reference

Files

file | bankdlg.Cpp [code]
file | bankdlg.h [code]
file | bankthrds.Cpp [code]
file | linkable.Cpp [code]
file | linkable.h [code]
file | OPBank.Cpp [code]
file | OPBank.Idl [code]
file | resource.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • PoolTest

PoolTest Directory Reference

Directories

directory | LogWriter

Files

file | PoolTest.Cpp [code]
file | PoolTest.h [code]
file | PoolTest.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | TestDlg.Cpp [code]
file | TestDlg.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/LogWriter/ Directory Reference

  • Com
  • Services
  • Object_Pooling
  • PoolTest
  • LogWriter

LogWriter Directory Reference

Files

file | DllDatax.c [code]
file | DllDatax.h [code]
file | LogFile.Cpp [code]
file | LogFile.h [code]
file | LogWriter.Cpp [code]
file | LogWriter.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/ Directory Reference

  • Com
  • Services
  • Queued_Components

Queued_Components Directory Reference

Directories

directory | QCJAVA
directory | QCSamp1
directory | QCSamp2

Files

file | StdAfx.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCJAVA

QCJAVA Directory Reference

Directories

directory Components
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components

Components Directory Reference

Directories

directory | Helper
directory | qcNotify
directory | qcOrder
directory | qcShip
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/Helper/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • Helper

Helper Directory Reference

Files

file DatabaseSettings.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcNotify/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcNotify

qcNotify Directory Reference

Files

file | _ShipStatus.java [code]
file | INotify.java [code]
file | INotifyDefault.java [code]
file | Notify.java [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcOrder/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcOrder

qcOrder Directory Reference

Files

file | IOrder.java [code]
file | IOrderDefault.java [code]
file | Order.java [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcShip/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcShip

qcShip Directory Reference

Files

file | IShip.java [code]
file | IShipDefault.java [code]
file | Ship.java [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp1

QCSamp1 Directory Reference

Directories

directory | Driver
directory | QCNotify
directory | QCOrder
directory | QCShip

Files

file | DataSourceNames.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/Driver/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • Driver

Driver Directory Reference

Files

file | Driver.Cpp [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCNotify/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCNotify

QCNotify Directory Reference

Files

file | Notify.Cpp [code]
file | Notify.h [code]
file | QCNotify.Cpp [code]
file | QCNotify.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCOrder/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCOrder

QCOrder Directory Reference

Files

file | Order.Cpp [code]
file | Order.h [code]
file | processFlags.h [code]
file | QCOrder.Cpp [code]
file | QCOrder.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCShip/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCShip

QCShip Directory Reference

Files

file | QCShip.Cpp [code]
file | QCShip.Idl [code]
file | Resource.h [code]
file | Ship.Cpp [code]
file | Ship.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp2

QCSamp2 Directory Reference

Directories

directory | Driver
directory | QCNotify
directory | QCOrder
directory | QCShip2

Files

file | DataSourceNames.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/Driver/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • Driver

Driver Directory Reference

Files

file | Driver.Cpp [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCNotify/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCNotify

QCNotify Directory Reference

Files

file | Notify.Cpp [code]
file | Notify.h [code]
file | QCNotify.Cpp [code]
file | QCNotify.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCOrder/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCOrder

QCOrder Directory Reference

Files

file | Order.Cpp [code]
file | Order.h [code]
file | processFlags.h [code]
file | QCOrder.Cpp [code]
file | QCOrder.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCShip2/ Directory Reference

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCShip2

QCShip2 Directory Reference

Files

file | QCShip2.Cpp [code]
file | QCShip2.Idl [code]
file | Resource.h [code]
file | Ship2.Cpp [code]
file | Ship2.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Resource_Dispenser/ Directory Reference

  • Com
  • Services
  • Resource_Dispenser

Resource_Dispenser Directory Reference

Files

file | Disp1.Cpp [code]
file | Disp1.Idl [code]
file | LDisp.Cpp [code]
file | LDisp.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Security/ Directory Reference

  • Com
  • Services
  • Security

Security Directory Reference

Directories

directory VC
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Security/VC/ Directory Reference

  • Com
  • Services
  • Security
  • VC

VC Directory Reference

Files

file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | VCSecuritySample.Cpp [code]
file | VCSecuritySample.Idl [code]
file | VCSecuritySampleCLASS.Cpp [code]
file | VCSecuritySampleCLASS.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Shared_Property_Manager/ Directory Reference

  • Com
  • Services
  • Shared_Property_Manager

Shared_Property_Manager Directory Reference

Directories

directory TServer
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Shared_Property_Manager/TServer/ Directory Reference

  • Com
  • Services
  • Shared_Property_Manager
  • TServer

TServer Directory Reference

Files

file | Computer.Cpp [code]
file | Computer.h [code]
file | Human.Cpp [code]
file | Human.h [code]
file | resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | TServer.Cpp [code]
file | TServer.Idl [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/ Directory Reference

  • Com
  • Services
  • Transaction

Transaction Directory Reference

Directories

directory | DataAccess
directory | SampleBank
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/ Directory Reference

  • Com
  • Services
  • Transaction
  • DataAccess

DataAccess Directory Reference

Directories

directory | DataAcADO
directory | DataAcOleDB
directory | DataAcRDO
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcADO/ Directory Reference

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcADO

DataAcADO Directory Reference

Files

file | adocomponent.Cpp [code]
file | adocomponent.h [code]
file | ADOKB.Cpp [code]
file | ADOKB.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/ Directory Reference

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

DataAcOleDB Directory Reference

Files

file | helper.h [code]
file | oledbcomponent.Cpp [code]
file | oledbcomponent.h [code]
file | OLEDBKB.Cpp [code]
file | OLEDBKB.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcRDO/ Directory Reference

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcRDO

DataAcRDO Directory Reference

Files

file | rdocomponent.Cpp [code]
file | rdocomponent.h [code]
file | RDOKB.Cpp [code]
file | RDOKB.Idl [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/ Directory Reference

  • Com
  • Services
  • Transaction
  • SampleBank

SampleBank Directory Reference

Directories

directory | VCAcct
directory | vjAcct
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/ Directory Reference

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

VCAcct Directory Reference

Files

file | account.Cpp [code]
file | account.Idl [code]
file | caccount.Cpp [code]
file | caccount.h [code]
file | getreceipt.Cpp [code]
file | getreceipt.h [code]
file | moveMoney.Cpp [code]
file | moveMoney.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | Updatereceipt.Cpp [code]
file | Updatereceipt.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/ Directory Reference

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct

vjAcct Directory Reference

Directories

directory | MsAdo15
directory | vcAcct
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ Directory Reference

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

MsAdo15 Directory Reference

Files

file | _ADO.java [code]
file | _Collection.java [code]
file | _Command.java [code]
file | _Connection.java [code]
file | _DynaCollection.java [code]
file | _Parameter.java [code]
file | _Record.java [code]
file | _Recordset.java [code]
file | _Stream.java [code]
file | ADCPROP_ASYNCTHREADPRIORITY_ENUM.java [code]
file | ADCPROP_AUTORECALC_ENUM.java [code]
file | ADCPROP_UPDATECRITERIA_ENUM.java [code]
file | ADOCommandConstruction.java [code]
file | ADOConnectionConstruction.java [code]
file | ADOConnectionConstruction15.java [code]
file | ADORecordConstruction.java [code]
file | ADORecordsetConstruction.java [code]
file | ADOStreamConstruction.java [code]
file | AffectEnum.java [code]
file | BookmarkEnum.java [code]
file | CEResyncEnum.java [code]
file | Command.java [code]
file | Command15.java [code]
file | CommandTypeEnum.java [code]
file | CompareEnum.java [code]
file | Connection.java [code]
file | Connection15.java [code]
file | ConnectionEvents.java [code]
file | ConnectionEventsVt.java [code]
file | ConnectModeEnum.java [code]
file | ConnectOptionEnum.java [code]
file | ConnectPromptEnum.java [code]
file | CopyRecordOptionsEnum.java [code]
file | CursorLocationEnum.java [code]
file | CursorOptionEnum.java [code]
file | CursorTypeEnum.java [code]
file | DataTypeEnum.java [code]
file | EditModeEnum.java [code]
file | Error.java [code]
file | Errors.java [code]
file | ErrorValueEnum.java [code]
file | EventReasonEnum.java [code]
file | EventStatusEnum.java [code]
file | ExecuteOptionEnum.java [code]
file | Field.java [code]
file | Field15.java [code]
file | FieldAttributeEnum.java [code]
file | FieldEnum.java [code]
file | Fields.java [code]
file | Fields15.java [code]
file | Fields20.java [code]
file | FilterGroupEnum.java [code]
file | GetRowsOptionEnum.java [code]
file | IRecFields.java [code]
file | IsolationLevelEnum.java [code]
file | LineSeparatorEnum.java [code]
file | LockTypeEnum.java [code]
file | MarshalOptionsEnum.java [code]
file | MoveRecordOptionsEnum.java [code]
file | ObjectStateEnum.java [code]
file | Parameter.java [code]
file | ParameterAttributesEnum.java [code]
file | ParameterDirectionEnum.java [code]
file | Parameters.java [code]
file | PersistFormatEnum.java [code]
file | PositionEnum.java [code]
file | Properties.java [code]
file | Property.java [code]
file | PropertyAttributesEnum.java [code]
file | Record.java [code]
file | RecordCreateOptionsEnum.java [code]
file | RecordOpenOptionsEnum.java [code]
file | Recordset.java [code]
file | Recordset15.java [code]
file | Recordset20.java [code]
file | Recordset21.java [code]
file | RecordsetEvents.java [code]
file | RecordsetEventsVt.java [code]
file | RecordStatusEnum.java [code]
file | RecordTypeEnum.java [code]
file | ResyncEnum.java [code]
file | SaveOptionsEnum.java [code]
file | SchemaEnum.java [code]
file | SearchDirectionEnum.java [code]
file | SeekEnum.java [code]
file | Stream.java [code]
file | StreamOpenOptionsEnum.java [code]
file | StreamReadEnum.java [code]
file | StreamTypeEnum.java [code]
file | StreamWriteEnum.java [code]
file | StringFormatEnum.java [code]
file | XactAttributeEnum.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/vcAcct/ Directory Reference

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • vcAcct

vcAcct Directory Reference

Files

file | CAccount.java [code]
file | CGetReceipt.java [code]
file | CMoveMoney.java [code]
file | CUpdateReceipt.java [code]
file | IAccount.java [code]
file | IGetReceipt.java [code]
file | IMoveMoney.java [code]
file | IUpdateReceipt.java [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/StructuredStorage/ Directory Reference

  • Com
  • StructuredStorage

StructuredStorage Directory Reference

Directories

directory Propsets
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/StructuredStorage/Propsets/ Directory Reference

  • Com
  • StructuredStorage
  • Propsets

Propsets Directory Reference

Files

file | propdump.cpp [code]
file | stgcreatepropsetstg.cpp [code]
file | writeread.cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/ Directory Reference

  • Com
  • Tools

Tools Directory Reference

Directories

directory | COMPlusWizard
directory | EntityProxy
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/COMPlusWizard/ Directory Reference

  • Com
  • Tools
  • COMPlusWizard

COMPlusWizard Directory Reference

Directories

directory VJ
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/COMPlusWizard/VJ/ Directory Reference

  • Com
  • Tools
  • COMPlusWizard
  • VJ

VJ Directory Reference

Files

file | COMPlus.java [code]
file | op.java [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/ Directory Reference

  • Com
  • Tools
  • EntityProxy

EntityProxy Directory Reference

Directories

directory DataServices
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/ Directory Reference

  • Com
  • Tools
  • EntityProxy
  • DataServices

DataServices Directory Reference

Files

file | data.Cpp [code]
file | data.Idl [code]
file | dynamic.Cpp [code]
file | dynamic.h [code]
file | entity.Cpp [code]
file | entity.h [code]
file | entity_except.Cpp [code]
file | heap.Cpp [code]
file | heap.h [code]
file | limits.h [code]
file | marshalhelpers.h [code]
file | odbcdata.Cpp [code]
file | odbcdata.h [code]
file | pooleddata.Cpp [code]
file | pooleddata.h [code]
file | proxy.Cpp [code]
file | proxy.h [code]
file | proxy_except.Cpp [code]
file | resource.h [code]
file | resultset.Cpp [code]
file | resultset.h [code]
file | staticmap.h [code]
file | stdafx.Cpp [code]
file | stdafx.h [code]
file | string.Cpp [code]
file | string.h [code]
file | string_fast.Cpp [code]
file | string_fast.h [code]
file | utils.Cpp [code]
file | utils.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ Directory Reference

  • Dataaccess

Dataaccess Directory Reference

Directories

directory | ADO
directory | odbc
directory | oledb
directory | osp
directory | rds
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/ Directory Reference

  • Dataaccess
  • ADO

ADO Directory Reference

Directories

directory | ADOVCGEN
directory | isapi
directory | shell
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/ADOVCGEN/ Directory Reference

  • Dataaccess
  • ADO
  • ADOVCGEN

ADOVCGEN Directory Reference

Files

file | adoheader.h [code]
file | advcgen.cpp [code]
file | advcgen.h [code]
file | advcgendlg.cpp [code]
file | advcgendlg.h [code]
file | datagrid.cpp [code]
file | datagrid.h [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/isapi/ Directory Reference

  • Dataaccess
  • ADO
  • isapi

isapi Directory Reference

Files

file adoisapi.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/shell/ Directory Reference

  • Dataaccess
  • ADO
  • shell

shell Directory Reference

Files

file adovbs.inc [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/ Directory Reference

  • Dataaccess
  • odbc

odbc Directory Reference

Directories

directory | odbcsql
directory | quiktest
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/odbcsql/ Directory Reference

  • Dataaccess
  • odbc
  • odbcsql

odbcsql Directory Reference

Files

file odbcsql.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/quiktest/ Directory Reference

  • Dataaccess
  • odbc
  • quiktest

quiktest Directory Reference

Files

file | autotest.h [code]
file | custom.c [code]
file | custom.h [code]
file | dllstub.c [code]
file | quiktest.c [code]
file | quiktest.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/ Directory Reference

  • Dataaccess
  • oledb

oledb Directory Reference

Directories

directory | internetpublishing
directory | omniprov
directory | prsample
directory | rowsetviewer
directory | sampclnt
directory | sampprov
directory | tablecopy
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/internetpublishing/ Directory Reference

  • Dataaccess
  • oledb
  • internetpublishing

internetpublishing Directory Reference

Directories

directory ippsample
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/internetpublishing/ippsample/ Directory Reference

  • Dataaccess
  • oledb
  • internetpublishing
  • ippsample

ippsample Directory Reference

Files

file | Guids.Cpp [code]
file | IAuth.Cpp [code]
file | Sample1.Cpp [code]
file | Sample1.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/ Directory Reference

  • Dataaccess
  • oledb
  • omniprov

omniprov Directory Reference

Directories

directory source
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/ Directory Reference

  • Dataaccess
  • oledb
  • omniprov
  • source

source Directory Reference

Files

file | cdbfile.cpp [code]
file | cdbfile.h [code]
file | crow.cpp [code]
file | crow.h [code]
file | irowsetchange.h [code]
file | irowsetscroll.h [code]
file | msomniprovds.h [code]
file | msomniprovrs.cpp [code]
file | msomniprovrs.h [code]
file | msomniprovsess.h [code]
file | resource.h [code]
file | rncp.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
file | theprovider.cpp [code]
file | theprovider.h [code]
file | theprovider.idl [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/prsample/ Directory Reference

  • Dataaccess
  • oledb
  • prsample

prsample Directory Reference

Files

file | command.cpp [code]
file | datasource.cpp [code]
file | enum.cpp [code]
file | error.cpp [code]
file | main.cpp [code]
file | prsample.h [code]
file | resource.h [code]
file | rowset.cpp [code]
file | session.cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/ Directory Reference

  • Dataaccess
  • oledb
  • rowsetviewer

rowsetviewer Directory Reference

Files

file | cbase.cpp [code]
file | cbase.h [code]
file | cbinder.cpp [code]
file | cbinder.h [code]
file | ccommand.cpp [code]
file | ccommand.h [code]
file | cdatalinks.cpp [code]
file | cdatalinks.h [code]
file | cdataset.cpp [code]
file | cdataset.h [code]
file | cdatasource.cpp [code]
file | cdatasource.h [code]
file | cdialog.cpp [code]
file | cdialog.h [code]
file | cdialoglite.cpp [code]
file | cdialoglite.h [code]
file | cenum.cpp [code]
file | cenum.h [code]
file | cerror.cpp [code]
file | cerror.h [code]
file | clistener.cpp [code]
file | clistener.h [code]
file | cmainwindow.cpp [code]
file | cmainwindow.h [code]
file | cmdichild.cpp [code]
file | cmdichild.h [code]
file | cmultipleresults.h [code]
file | cmutipleresults.cpp [code]
file | cobjtree.cpp [code]
file | cobjtree.h [code]
file | common.cpp [code]
file | common.h [code]
file | coptions.cpp [code]
file | coptions.h [code]
file | crow.cpp [code]
file | crow.h [code]
file | crowposition.cpp [code]
file | crowposition.h [code]
file | crowset.cpp [code]
file | crowset.h [code]
file | csession.cpp [code]
file | csession.h [code]
file | cstream.cpp [code]
file | cstream.h [code]
file | ctrace.cpp [code]
file | ctrace.h [code]
file | ctransaction.cpp [code]
file | ctransaction.h [code]
file | cwinapp.cpp [code]
file | cwinapp.h [code]
file | error.cpp [code]
file | error.h [code]
file | headers.cpp [code]
file | headers.h [code]
file | list.h [code]
file | property.cpp [code]
file | property.h [code]
file | resource.h [code]
file | spy.cpp [code]
file | spy.h [code]
file | version.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampclnt/ Directory Reference

  • Dataaccess
  • oledb
  • sampclnt

sampclnt Directory Reference

Files

file | dump.cpp [code]
file | resource.h [code]
file | sampclnt.cpp [code]
file | sampclnt.h [code]
file | sampver.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/ Directory Reference

  • Dataaccess
  • oledb
  • sampprov

sampprov Directory Reference

Files

file | accessor.cpp [code]
file | accessor.h [code]
file | asserts.cpp [code]
file | asserts.h [code]
file | baseobj.cpp [code]
file | baseobj.h [code]
file | binder.cpp [code]
file | binder.h [code]
file | bitarray.cpp [code]
file | bitarray.h [code]
file | classfac.cpp [code]
file | classfac.h [code]
file | colinfo.cpp [code]
file | command.cpp [code]
file | command.h [code]
file | common.cpp [code]
file | common.h [code]
file | crtsess.cpp [code]
file | cvttype.cpp [code]
file | datasrc.cpp [code]
file | datasrc.h [code]
file | dbinit.cpp [code]
file | dbprop.cpp [code]
file | dbsess.cpp [code]
file | dbsess.h [code]
file | extbuff.cpp [code]
file | extbuff.h [code]
file | fileidx.cpp [code]
file | fileidx.h [code]
file | fileio.cpp [code]
file | fileio.h [code]
file | globals.cpp [code]
file | guids.h [code]
file | hashtbl.cpp [code]
file | hashtbl.h [code]
file | headers.cpp [code]
file | headers.h [code]
file | igetrow.cpp [code]
file | irowiden.cpp [code]
file | irowset.cpp [code]
file | opnrowst.cpp [code]
file | persist.cpp [code]
file | resource.h [code]
file | row.cpp [code]
file | row.h [code]
file | rowchng.cpp [code]
file | rowinfo.cpp [code]
file | rowset.cpp [code]
file | rowset.h [code]
file | sampprov.h [code]
file | sampver.h [code]
file | stream.cpp [code]
file | stream.h [code]
file | utilprop.cpp [code]
file | utilprop.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/ Directory Reference

  • Dataaccess
  • oledb
  • tablecopy

tablecopy Directory Reference

Files

file | common.cpp [code]
file | common.h [code]
file | datasource.cpp [code]
file | datasource.h [code]
file | error.cpp [code]
file | error.h [code]
file | list.h [code]
file | progress.cpp [code]
file | progress.h [code]
file | property.cpp [code]
file | property.h [code]
file | resource.h [code]
file | spy.cpp [code]
file | spy.h [code]
file | step1.cpp [code]
file | step2.cpp [code]
file | step3.cpp [code]
file | step4.cpp [code]
file | table.cpp [code]
file | table.h [code]
file | tablecopy.cpp [code]
file | tablecopy.h [code]
file | version.h [code]
file | winmain.cpp [code]
file | winmain.h [code]
file | wizard.cpp [code]
file | wizard.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/ Directory Reference

  • Dataaccess
  • osp

osp Directory Reference

Directories

directory | vc
directory | vj
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vc/ Directory Reference

  • Dataaccess
  • osp
  • vc

vc Directory Reference

Files

file | cexlist.h [code]
file | common.cpp [code]
file | common.h [code]
file | myclassfactory.cpp [code]
file | myclassfactory.h [code]
file | mydatasource.cpp [code]
file | mydatasource.h [code]
file | myospobject.cpp [code]
file | myospobject.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vj/ Directory Reference

  • Dataaccess
  • osp
  • vj

vj Directory Reference

Files

file | mydatasource.java [code]
file | myospobject.java [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/ Directory Reference

  • Dataaccess
  • rds

rds Directory Reference

Directories

directory | handler

Files

file | ADOVBS.inc [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/ Directory Reference

  • Dataaccess
  • rds
  • handler

handler Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/ Directory Reference

  • Dataaccess
  • rds
  • handler
  • vc

vc Directory Reference

Files

file | adoid.h [code]
file | adoint.h [code]
file | const.cpp [code]
file | handler.cpp [code]
file | handler.h [code]
file | msdfhdl.idl [code]
file | msdfmap.cpp [code]
file | msdfmap.idl [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
file | stdafxx.cpp [code]
file | util.cpp [code]
file | util.h [code]
file | utiltest.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/ Directory Reference

  • Multimedia

Multimedia Directory Reference

Directories

directory | Audio
directory | Gdi
directory | wia
directory | WindowsMediaServices9
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/ Directory Reference

  • Multimedia
  • Audio

Audio Directory Reference

Directories

directory | MciPlay
directory | MidiPlyr
directory | multichan
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MciPlay/ Directory Reference

  • Multimedia
  • Audio
  • MciPlay

MciPlay Directory Reference

Files

file | MciPlay.c [code]
file | MciPlay.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/ Directory Reference

  • Multimedia
  • Audio
  • MidiPlyr

MidiPlyr Directory Reference

Files

file | Debug.c [code]
file | Debug.h [code]
file | GLOBAL.h [code]
file | MainWND.c [code]
file | MidiPlyr.c [code]
file | MidiPlyr.h [code]
file | MulDiv32.h [code]
file | SEQ.h [code]
file | SEQUENCE.c [code]
file | SMF.c [code]
file | SMF.h [code]
file | SMFI.h [code]
file | SMFREAD.c [code]
file | TIMEWND.c [code]
file | UIUTILS.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/ Directory Reference

  • Multimedia
  • Audio
  • multichan

multichan Directory Reference

Files

file | childview.cpp [code]
file | childview.h [code]
file | dlgdest.cpp [code]
file | dlgdest.h [code]
file | dlgsrc.cpp [code]
file | dlgsrc.h [code]
file | mainfrm.cpp [code]
file | mainfrm.h [code]
file | multichan.cpp [code]
file | multichan.h [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
file | wave.cpp [code]
file | wave.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/ Directory Reference

  • Multimedia
  • Gdi

Gdi Directory Reference

Directories

directory | Fonts
directory | fontsize
directory | GdiDemo
directory | Metafile
directory | palette
directory | Printer
directory | PrintJob
directory | SetDisp
directory | TextFx
directory | ViewDIB
directory | WinCap32
directory | WinNT
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/ Directory Reference

  • Multimedia
  • Gdi
  • Fonts

Fonts Directory Reference

Directories

directory | FontView
directory | GridFont
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/FontView/ Directory Reference

  • Multimedia
  • Gdi
  • Fonts
  • FontView

FontView Directory Reference

Files

file | Dialogs.c [code]
file | Display.c [code]
file | FontView.c [code]
file | FontView.h [code]
file | Status.c [code]
file | Tools.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/GridFont/ Directory Reference

  • Multimedia
  • Gdi
  • Fonts
  • GridFont

GridFont Directory Reference

Files

file | APP.Cxx [code]
file | APP.h [code]
file | APP.Hxx [code]
file | Box.Cxx [code]
file | Box.Hxx [code]
file | Canvas.Hxx [code]
file | Cset.Cxx [code]
file | Cset.Hxx [code]
file | Font.Cxx [code]
file | Font.Hxx [code]
file | Grid.Cxx [code]
file | Grid.Hxx [code]
file | Resource.h [code]
file | View.Cxx [code]
file | View.Hxx [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/fontsize/ Directory Reference

  • Multimedia
  • Gdi
  • fontsize

fontsize Directory Reference

Files

file Fontsize.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/ Directory Reference

  • Multimedia
  • Gdi
  • GdiDemo

GdiDemo Directory Reference

Files

file | Bounce.c [code]
file | Bounce.h [code]
file | Dialog.c [code]
file | Draw.c [code]
file | Draw.h [code]
file | GdiDemo.c [code]
file | GdiDemo.h [code]
file | Init.c [code]
file | Maze.c [code]
file | Maze.h [code]
file | Poly.c [code]
file | Poly.h [code]
file | Wininfo.c [code]
file | XForm.c [code]
file | XForm.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Metafile/ Directory Reference

  • Multimedia
  • Gdi
  • Metafile

Metafile Directory Reference

Directories

directory MfEdit
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Metafile/MfEdit/ Directory Reference

  • Multimedia
  • Gdi
  • Metafile
  • MfEdit

MfEdit Directory Reference

Files

file | MfEdit.c [code]
file | MfEdit.h [code]
file | Precomp.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/palette/ Directory Reference

  • Multimedia
  • Gdi
  • palette

palette Directory Reference

Files

file | Mypal.c [code]
file | Mypal.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/ Directory Reference

  • Multimedia
  • Gdi
  • Printer

Printer Directory Reference

Files

file | Common.h [code]
file | Enumprt.c [code]
file | Enumprt.h [code]
file | Getcaps.c [code]
file | Getcaps.h [code]
file | Getpdriv.c [code]
file | Getpdriv.h [code]
file | Paint.c [code]
file | Paint.h [code]
file | Printer.c [code]
file | Printer.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/ Directory Reference

  • Multimedia
  • Gdi
  • PrintJob

PrintJob Directory Reference

Files

file | dialogs.c [code]
file | dialogs.h [code]
file | errors.c [code]
file | errors.h [code]
file | printjob.c [code]
file | printjob.h [code]
file | quecore.h [code]
file | quelist.c [code]
file | quelist.h [code]
file | queue.c [code]
file | queue.h [code]
file | resource.h [code]
file | threads.c [code]
file | threads.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/SetDisp/ Directory Reference

  • Multimedia
  • Gdi
  • SetDisp

SetDisp Directory Reference

Files

file | Resource.h [code]
file | SetDisp.c [code]
file | SetDisp.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/TextFx/ Directory Reference

  • Multimedia
  • Gdi
  • TextFx

TextFx Directory Reference

Files

file | Fx.c [code]
file | Fx.h [code]
file | GuidE.c [code]
file | GuidE.h [code]
file | Resource.h [code]
file | TextFx.c [code]
file | TextFx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/ViewDIB/ Directory Reference

  • Multimedia
  • Gdi
  • ViewDIB

ViewDIB Directory Reference

Files

file | DIBSectn.c [code]
file | DIBSectn.h [code]
file | OpenDIB.c [code]
file | OpenDIB.h [code]
file | Resource.h [code]
file | ViewDIB.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/ Directory Reference

  • Multimedia
  • Gdi
  • WinCap32

WinCap32 Directory Reference

Files

file | Copy.c [code]
file | Dialogs.c [code]
file | Dialogs.h [code]
file | Dibapi.h [code]
file | Dibdll.h [code]
file | Dibutil.c [code]
file | Dibutil.h [code]
file | Dlgopen.c [code]
file | Dllinit.c [code]
file | Errors.c [code]
file | File.c [code]
file | Hook.c [code]
file | Print.c [code]
file | Resource.h [code]
file | Wepcode.c [code]
file | WinCap.c [code]
file | WinCap.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/ Directory Reference

  • Multimedia
  • Gdi
  • WinNT

WinNT Directory Reference

Directories

directory | HalfTone
directory | PlgBlt
directory | WxForm
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/HalfTone/ Directory Reference

  • Multimedia
  • Gdi
  • WinNT
  • HalfTone

HalfTone Directory Reference

Files

file | halftone.c [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/PlgBlt/ Directory Reference

  • Multimedia
  • Gdi
  • WinNT
  • PlgBlt

PlgBlt Directory Reference

Files

file | BitMap.c [code]
file | BitMap.h [code]
file | PlgBlt.c [code]
file | PlgBlt.h [code]
file | Track.c [code]
file | Track.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/WxForm/ Directory Reference

  • Multimedia
  • Gdi
  • WinNT
  • WxForm

WxForm Directory Reference

Files

file | WxForm.c [code]
file | WxForm.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/ Directory Reference

  • Multimedia
  • wia

wia Directory Reference

Directories

directory | GetImage
directory | wiassamp
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/ Directory Reference

  • Multimedia
  • wia
  • GetImage

GetImage Directory Reference

Files

file | BitmapUtil.cpp [code]
file | BitmapUtil.h [code]
file | BitmapWnd.cpp [code]
file | BitmapWnd.h [code]
file | DataCallback.cpp [code]
file | DataCallback.h [code]
file | EventCallback.cpp [code]
file | EventCallback.h [code]
file | GetImage.cpp [code]
file | MainWnd.cpp [code]
file | MainWnd.h [code]
file | ProgressDlg.cpp [code]
file | ProgressDlg.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | WiaWrap.cpp [code]
file | WiaWrap.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/wiassamp/ Directory Reference

  • Multimedia
  • wia
  • wiassamp

wiassamp Directory Reference

Files

file wiassamp.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/ Directory Reference

  • Multimedia
  • WindowsMediaServices9

WindowsMediaServices9 Directory Reference

Directories

directory | Authentication
directory | Authorization
directory | CacheProxy
directory | DataSource
directory | EventNotification
directory | Playlist
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authentication/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • Authentication

Authentication Directory Reference

Files

file | Authenticate.cpp [code]
file | Authenticate.idl [code]
file | AuthenticateAdmin.cpp [code]
file | AuthenticateAdmin.h [code]
file | AuthenticateContext.cpp [code]
file | AuthenticateContext.h [code]
file | AuthenticatePlugin.cpp [code]
file | AuthenticatePlugin.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authorization/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • Authorization

Authorization Directory Reference

Files

file | dbauth.cpp [code]
file | dbauth.idl [code]
file | dbauthadmin.cpp [code]
file | dbauthadmin.h [code]
file | dbauthplugin.cpp [code]
file | dbauthplugin.h [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy

CacheProxy Directory Reference

Directories

directory | cplusplus
directory | csharp
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/cplusplus/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • cplusplus

cplusplus Directory Reference

Files

file | proxyplugin.cpp [code]
file | proxyplugin.idl [code]
file | proxypluginimpl.cpp [code]
file | proxypluginimpl.h [code]
file | Resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/csharp/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • csharp

csharp Directory Reference

Files

file | AssemblyInfo.cs [code]
file | cacheproxysampleplugin.cs [code]
file | Class1.cs [code]
file | PluginAdmin.cs [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/DataSource/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • DataSource

DataSource Directory Reference

Files

file | resource.h [code]
file | sdksamplestorageplugin.cpp [code]
file | sdksamplestorageplugin.idl [code]
file | sdksamplestoragesystem.cpp [code]
file | sdksamplestoragesystem.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • EventNotification

EventNotification Directory Reference

Directories

directory | ContextSamplePropPage

Files

file | ContextAdmin.cpp [code]
file | ContextAdmin.h [code]
file | ContextDll.cpp [code]
file | ContextDll.idl [code]
file | ContextPlugin.cpp [code]
file | ContextPlugin.h [code]
file | Resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextSamplePropPage/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • EventNotification
  • ContextSamplePropPage

ContextSamplePropPage Directory Reference

Files

file | ContextSamplePropPage.cpp [code]
file | ContextSamplePropPage.idl [code]
file | ContextSamplePropPageImpl.cpp [code]
file | ContextSamplePropPageImpl.h [code]
file | resource.h [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/ Directory Reference

  • Multimedia
  • WindowsMediaServices9
  • Playlist

Playlist Directory Reference

Files

file | dlldatax.h [code]
file | resource.h [code]
file | SDKSamplePlaylistParser.cpp [code]
file | SDKSamplePlaylistParser.h [code]
file | SDKSamplePlaylistPlugin.cpp [code]
file | SDKSamplePlaylistPlugin.idl [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ Directory Reference

  • NetDS

NetDS Directory Reference

Directories

directory | ActiveDirectory
directory | ADSI
directory | Bluetooth
directory | DHCP
directory | DNS
directory | fax
directory | GQos
directory | http
directory | IAS
directory | IPHelp
directory | MessageQueuing
directory | NetMon
directory | netshell
directory | Ras
directory | RPC
directory | RRas
directory | rtc
directory | Snmp
directory | SyncMgr
directory | Tapi
directory | upnp
directory | WinNT
directory | WinSock
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ActiveDirectory/ Directory Reference

  • NetDS
  • ActiveDirectory

ActiveDirectory Directory Reference

Directories

directory PropSheetHost
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ActiveDirectory/PropSheetHost/ Directory Reference

  • NetDS
  • ActiveDirectory
  • PropSheetHost

PropSheetHost Directory Reference

Files

file | DataObj.cpp [code]
file | Main.cpp [code]
file | PropSheetHost.cpp [code]
file | PropSheetHost.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/ Directory Reference

  • NetDS
  • ADSI

ADSI Directory Reference

Directories

directory | DevGuide
directory | samples
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/DevGuide/ Directory Reference

  • NetDS
  • ADSI
  • DevGuide

DevGuide Directory Reference

Files

file banner.inc [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/ Directory Reference

  • NetDS
  • ADSI
  • samples

samples Directory Reference

Directories

directory | activedir
directory | DSUI
directory | Extension
directory | General
directory | Start
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir

activedir Directory Reference

Directories

directory | addgroup
directory | adevent
directory | attributes
directory | bindtoparent
directory | createuser
directory | credentials
directory | gcallusers
directory | getdomainmode
directory | getschemainfo
directory | guidbind
directory | OtherWKO
directory | PropertyList
directory | QueryUsers
directory | RootDSE
directory | SID
directory | User
directory | WKGUID
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/addgroup/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • addgroup

addgroup Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/addgroup/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • addgroup
  • vc

vc Directory Reference

Files

file main.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/adevent/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • adevent

adevent Directory Reference

Files

file | ADEvent.cpp [code]
file | adevent.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/attributes/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • attributes

attributes Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/attributes/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • attributes
  • vc

vc Directory Reference

Files

file attributes.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/bindtoparent/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • bindtoparent

bindtoparent Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/bindtoparent/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • bindtoparent
  • vc

vc Directory Reference

Files

file bindtoparent.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/createuser/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • createuser

createuser Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/createuser/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • createuser
  • vc

vc Directory Reference

Files

file | CreateUserHelpers.cpp [code]
file | CreateUserHelpers.h [code]
file | main.cpp [code]
file | UserProps.cpp [code]
file | UserProps.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/credentials/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • credentials

credentials Directory Reference

Directories

directory VC
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/credentials/VC/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • credentials
  • VC

VC Directory Reference

Files

file | Credentials.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/gcallusers/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • gcallusers

gcallusers Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/gcallusers/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • gcallusers
  • vc

vc Directory Reference

Files

file gcallusers.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/getdomainmode/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • getdomainmode

getdomainmode Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/getdomainmode/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • getdomainmode
  • vc

vc Directory Reference

Files

file getdomainmode.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/getschemainfo/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • getschemainfo

getschemainfo Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/getschemainfo/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • getschemainfo
  • vc

vc Directory Reference

Files

file getschemainfo.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/guidbind/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • guidbind

guidbind Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/guidbind/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • guidbind
  • vc

vc Directory Reference

Files

file | ADSIhelpers.cpp [code]
file | ADSIhelpers.h [code]
file | main.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/OtherWKO/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • OtherWKO

OtherWKO Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/OtherWKO/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • OtherWKO
  • vc

vc Directory Reference

Files

file | otherwko.cpp [code]
file | otherwko1.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/PropertyList/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • PropertyList

PropertyList Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/PropertyList/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • PropertyList
  • vc

vc Directory Reference

Files

file | ADSIhelpers.cpp [code]
file | ADSIhelpers.h [code]
file | main.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/QueryUsers/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • QueryUsers

QueryUsers Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/QueryUsers/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • QueryUsers
  • vc

vc Directory Reference

Files

file queryusers.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/RootDSE/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • RootDSE

RootDSE Directory Reference

Directories

directory VC
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/RootDSE/VC/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • RootDSE
  • VC

VC Directory Reference

Files

file | RootDSE.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/SID/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • SID

SID Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/SID/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • SID
  • vc

vc Directory Reference

Files

file objectSid.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/User/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • User

User Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/User/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • User
  • vc

vc Directory Reference

Files

file iasuser.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/WKGUID/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • WKGUID

WKGUID Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/WKGUID/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • activedir
  • WKGUID
  • vc

vc Directory Reference

Files

file wkguid.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI

DSUI Directory Reference

Directories

directory | scpext
directory | userext
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext

scpext Directory Reference

Directories

directory | scpcmenu
directory | scpproppage
directory | scpwizard
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

scpcmenu Directory Reference

Files

file | dsmenu.cpp [code]
file | dsmenu.h [code]
file | resource.h [code]
file | SCPCMenu.cpp [code]
file | SCPCMenu.h [code]
file | scpcmenuui.cpp [code]
file | scpcmenuui.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

scpproppage Directory Reference

Files

file | resource.h [code]
file | SCP.cpp [code]
file | SCP.h [code]
file | SCPProppage.cpp [code]
file | SCPProppage.h [code]
file | SCPUI.cpp [code]
file | SCPUI.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | util.cpp [code]
file | util.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpwizard/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpwizard

scpwizard Directory Reference

Files

file | resource.h [code]
file | SCPPageUI.cpp [code]
file | SCPPageUI.h [code]
file | SCPWiz.cpp [code]
file | SCPWiz.h [code]
file | SCPWizard.cpp [code]
file | SCPWizard.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | util.cpp [code]
file | util.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext

userext Directory Reference

Directories

directory | userproppage
directory | userwizard
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

userproppage Directory Reference

Files

file | proppageuser.cpp [code]
file | proppageuser.h [code]
file | proppageuserui.cpp [code]
file | proppageuserui.h [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
file | userproppage.cpp [code]
file | userproppage.h [code]
file | util.cpp [code]
file | util.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

userwizard Directory Reference

Files

file | extpageuser.cpp [code]
file | extpageuser.h [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
file | userwizard.cpp [code]
file | userwizard.h [code]
file | util.cpp [code]
file | util.h [code]
file | wizext.cpp [code]
file | wizext.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Extension

Extension Directory Reference

Directories

directory tutorial
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial

tutorial Directory Reference

Directories

directory | step1
directory | step2
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step1/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step1

step1 Directory Reference

Files

file | ADsFirstExt.cpp [code]
file | ADsFirstExt.h [code]
file | ADsFirstExt.idl [code]
file | ADsFirstExt_i.c [code]
file | ADsFirstExt_p.c [code]
file | dlldata.c [code]
file | HelloWorld.cpp [code]
file | HelloWorld.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step2/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step2

step2 Directory Reference

Files

file | ADsFirstExt.cpp [code]
file | ADsFirstExt.h [code]
file | ADsFirstExt.idl [code]
file | ADsFirstExt_i.c [code]
file | ADsFirstExt_p.c [code]
file | dlldata.c [code]
file | HelloWorld.cpp [code]
file | HelloWorld.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General

General Directory Reference

Directories

directory | ADQI
directory | ADsCmd
directory | ADsError
directory | ADSIDump
directory | DsBrowse
directory | DsSrch
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

ADQI Directory Reference

Files

file | ADQI.cpp [code]
file | ADQI.h [code]
file | ADQIDlg.cpp [code]
file | ADQIDlg.h [code]
file | ADs.cpp [code]
file | ADs.h [code]
file | adscontainer.cpp [code]
file | adscontainer.h [code]
file | ADsLargeInteger.cpp [code]
file | ADsLargeInteger.h [code]
file | ADsOpenDSObject.cpp [code]
file | ADsOpenDSObject.h [code]
file | ADsPropertyList.cpp [code]
file | ADsPropertyList.h [code]
file | DirectoryObject.cpp [code]
file | DirectoryObject.h [code]
file | DirectorySearch.cpp [code]
file | DirectorySearch.h [code]
file | helper.cpp [code]
file | helper.h [code]
file | resource.h [code]
file | security.cpp [code]
file | security.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsCmd/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General
  • ADsCmd

ADsCmd Directory Reference

Files

file | dump.cxx [code]
file | enum.cxx [code]
file | main.cxx [code]
file | main.hxx [code]
file | util.cxx [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsError/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General
  • ADsError

ADsError Directory Reference

Files

file | ADsError.cpp [code]
file | ADsError.h [code]
file | ADsError.idl [code]
file | ADsError_i.c [code]
file | ADsError_p.c [code]
file | dlldata.c [code]
file | IADsError.cpp [code]
file | IADsError.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADSIDump/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General
  • ADSIDump

ADSIDump Directory Reference

Files

file | AdsiDump.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/DsBrowse/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General
  • DsBrowse

DsBrowse Directory Reference

Directories

directory bitmaps
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/DsBrowse/bitmaps/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General
  • DsBrowse
  • bitmaps

bitmaps Directory Reference

Files

file | afxres.h [code]
file | resource.h [code]
file | winres.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/DsSrch/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • General
  • DsSrch

DsSrch Directory Reference

Files

file | main.cxx [code]
file | main.hxx [code]
file | util.cxx [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start

Start Directory Reference

Directories

directory | Binding
directory | Child
directory | Create
directory | Delete
directory | Enum
directory | Filter
directory | First
directory | Move
directory | Parent
directory | Read
directory | Rename
directory | Schema
directory | Search
directory | Write
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Binding/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Binding

Binding Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Binding/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Binding
  • vc

vc Directory Reference

Files

file | Binding.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Child/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Child

Child Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Child/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Child
  • vc

vc Directory Reference

Files

file | Child.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Create/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Create

Create Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Create/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Create
  • vc

vc Directory Reference

Files

file | Create.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Delete/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Delete

Delete Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Delete/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Delete
  • vc

vc Directory Reference

Files

file | Delete.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Enum/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Enum

Enum Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Enum/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Enum
  • vc

vc Directory Reference

Files

file | Enum.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Filter/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Filter

Filter Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Filter/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Filter
  • vc

vc Directory Reference

Files

file | Filter.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/First/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • First

First Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/First/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • First
  • vc

vc Directory Reference

Files

file | First.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Move/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Move

Move Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Move/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Move
  • vc

vc Directory Reference

Files

file | Move.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Parent/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Parent

Parent Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Parent/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Parent
  • vc

vc Directory Reference

Files

file | Parent.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Read/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Read

Read Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Read/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Read
  • vc

vc Directory Reference

Files

file | Read.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Rename/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Rename

Rename Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Rename/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Rename
  • vc

vc Directory Reference

Files

file | Rename.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Schema/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Schema

Schema Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Schema/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Schema
  • vc

vc Directory Reference

Files

file | Schema.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Search/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Search

Search Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Search/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Search
  • vc

vc Directory Reference

Files

file | Search.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Write/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Write

Write Directory Reference

Directories

directory vc
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Write/vc/ Directory Reference

  • NetDS
  • ADSI
  • samples
  • Start
  • Write
  • vc

vc Directory Reference

Files

file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | Write.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Bluetooth/ Directory Reference

  • NetDS
  • Bluetooth

Bluetooth Directory Reference

Files

file bthcxn.cpp [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DHCP/ Directory Reference

  • NetDS
  • DHCP

DHCP Directory Reference

Directories

directory | DHCPNotify
directory | DHCPPersist
directory | DHCPRequest
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DHCP/DHCPNotify/ Directory Reference

  • NetDS
  • DHCP
  • DHCPNotify

DHCPNotify Directory Reference

Files

file dhcpnotify.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DHCP/DHCPPersist/ Directory Reference

  • NetDS
  • DHCP
  • DHCPPersist

DHCPPersist Directory Reference

Files

file dhcppersist.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DHCP/DHCPRequest/ Directory Reference

  • NetDS
  • DHCP
  • DHCPRequest

DHCPRequest Directory Reference

Files

file dhcprequest.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DNS/ Directory Reference

  • NetDS
  • DNS

DNS Directory Reference

Directories

directory | DNSQuery
directory | ModifyRecords
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DNS/DNSQuery/ Directory Reference

  • NetDS
  • DNS
  • DNSQuery

DNSQuery Directory Reference

Files

file DNSQuery.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DNS/ModifyRecords/ Directory Reference

  • NetDS
  • DNS
  • ModifyRecords

ModifyRecords Directory Reference

Files

file ModifyRecords.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/ Directory Reference

  • NetDS
  • fax

fax Directory Reference

Directories

directory | PrintSdi
directory | SampleFSP
directory | SampleRoute
directory | SampleSend
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/ Directory Reference

  • NetDS
  • fax
  • PrintSdi

PrintSdi Directory Reference

Files

file | FaxDlg.Cpp [code]
file | FaxDlg.h [code]
file | MainFrm.Cpp [code]
file | MainFrm.h [code]
file | NewDocDlg.Cpp [code]
file | NewDocDlg.h [code]
file | PrintSdi.Cpp [code]
file | PrintSdi.h [code]
file | PrintSdiDoc.h [code]
file | PrintSdiView.h [code]
file | PrintSdiVw.Cpp [code]
file | Resource.h [code]
file | SdiDoc.Cpp [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleFSP/ Directory Reference

  • NetDS
  • fax
  • SampleFSP

SampleFSP Directory Reference

Files

file | Macros.h [code]
file | NewFsp.c [code]
file | NewFsp.h [code]
file | Reg.c [code]
file | Reg.h [code]
file | Resource.h [code]
file | Util.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleRoute/ Directory Reference

  • NetDS
  • fax
  • SampleRoute

SampleRoute Directory Reference

Files

file | FaxSiren.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleSend/ Directory Reference

  • NetDS
  • fax
  • SampleSend

SampleSend Directory Reference

Files

file | Resource.h [code]
file | Simple.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/ Directory Reference

  • NetDS
  • GQos

GQos Directory Reference

Directories

directory | QosEvent
directory | Qoslist
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/QosEvent/ Directory Reference

  • NetDS
  • GQos
  • QosEvent

QosEvent Directory Reference

Files

file | ChkQos.Cpp [code]
file | Findsp.Cpp [code]
file | GetQos.Cpp [code]
file | PrintQos.Cpp [code]
file | QosEvent.Cpp [code]
file | QosEvent.h [code]
file | Receiver.Cpp [code]
file | Sender.Cpp [code]
file | SetQos.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/Qoslist/ Directory Reference

  • NetDS
  • GQos
  • Qoslist

Qoslist Directory Reference

Files

file Qoslist.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/ Directory Reference

  • NetDS
  • http

http Directory Reference

Directories

directory | server
directory | serviceconfig
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/server/ Directory Reference

  • NetDS
  • http
  • server

server Directory Reference

Files

file | main.c [code]
file | precomp.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/serviceconfig/ Directory Reference

  • NetDS
  • http
  • serviceconfig

serviceconfig Directory Reference

Files

file | iplisten.c [code]
file | main.c [code]
file | makefile.inc [code]
file | precomp.h [code]
file | ssl.c [code]
file | url.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IAS/ Directory Reference

  • NetDS
  • IAS

IAS Directory Reference

Directories

directory | DialIn
directory | MapName
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IAS/DialIn/ Directory Reference

  • NetDS
  • IAS
  • DialIn

DialIn Directory Reference

Files

file DialIn.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IAS/MapName/ Directory Reference

  • NetDS
  • IAS
  • MapName

MapName Directory Reference

Files

file | dllmain.c [code]
file | mapname.c [code]
file | multisz.c [code]
file | multisz.h [code]
file | radutil.c [code]
file | radutil.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/ Directory Reference

  • NetDS
  • IPHelp

IPHelp Directory Reference

Directories

directory | EnableRouter
directory | IPArp
directory | IPChange
directory | IPConfig
directory | IPRenew
directory | IPRoute
directory | IPStat
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/EnableRouter/ Directory Reference

  • NetDS
  • IPHelp
  • EnableRouter

EnableRouter Directory Reference

Files

file enablerouter.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPArp/ Directory Reference

  • NetDS
  • IPHelp
  • IPArp

IPArp Directory Reference

Files

file | IPArp.Cpp [code]
file | IPArp.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPChange/ Directory Reference

  • NetDS
  • IPHelp
  • IPChange

IPChange Directory Reference

Files

file IPChange.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPConfig/ Directory Reference

  • NetDS
  • IPHelp
  • IPConfig

IPConfig Directory Reference

Files

file IPConfig.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPRenew/ Directory Reference

  • NetDS
  • IPHelp
  • IPRenew

IPRenew Directory Reference

Files

file IPRenew.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPRoute/ Directory Reference

  • NetDS
  • IPHelp
  • IPRoute

IPRoute Directory Reference

Files

file | IPRoute.Cpp [code]
file | IPRoute.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPStat/ Directory Reference

  • NetDS
  • IPHelp
  • IPStat

IPStat Directory Reference

Files

file | IPStat.Cpp [code]
file | IPStat.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/ Directory Reference

  • NetDS
  • MessageQueuing

MessageQueuing Directory Reference

Directories

directory | c_draw
directory | csharp_draw
directory | DirEncrypt
directory | Imp_Draw
directory | MqApiTst
directory | mqf_draw
directory | MQPers
directory | MQPort
directory | MqTestOA
directory | MqTrans
directory | MSMQTest
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/ Directory Reference

  • NetDS
  • MessageQueuing
  • c_draw

c_draw Directory Reference

Files

file | DisDraw.Cpp [code]
file | DisDraw.h [code]
file | DrawArea.Cpp [code]
file | DrawArea.h [code]
file | DrawDlg.Cpp [code]
file | DrawDlg.h [code]
file | LoginDlg.Cpp [code]
file | LoginDlg.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/csharp_draw/ Directory Reference

  • NetDS
  • MessageQueuing
  • csharp_draw

csharp_draw Directory Reference

Files

file | assemblyinfo.cs [code]
file | form1.cs [code]
file | inputbox.cs [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/DirEncrypt/ Directory Reference

  • NetDS
  • MessageQueuing
  • DirEncrypt

DirEncrypt Directory Reference

Files

file DirEncrypt.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/ Directory Reference

  • NetDS
  • MessageQueuing
  • Imp_Draw

Imp_Draw Directory Reference

Files

file | DrawArea.Cpp [code]
file | DrawArea.h [code]
file | EvHandle.Cpp [code]
file | EvHandle.h [code]
file | Imp_Dlg.Cpp [code]
file | Imp_Dlg.h [code]
file | Imp_Draw.Cpp [code]
file | Imp_Draw.h [code]
file | LoginDlg.Cpp [code]
file | LoginDlg.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/ Directory Reference

  • NetDS
  • MessageQueuing
  • MqApiTst

MqApiTst Directory Reference

Files

file | CLOSQDlg.Cpp [code]
file | CLOSQDlg.h [code]
file | CRQDlg.Cpp [code]
file | CRQDlg.h [code]
file | DELQDlg.Cpp [code]
file | DELQDlg.h [code]
file | LocatDlg.Cpp [code]
file | LocatDlg.h [code]
file | MainFrm.Cpp [code]
file | MainFrm.h [code]
file | MqApiTst.Cpp [code]
file | MqApiTst.h [code]
file | OpenQDlg.Cpp [code]
file | OpenQDlg.h [code]
file | RecvMDlg.Cpp [code]
file | RecvMDlg.h [code]
file | RecWDlg.Cpp [code]
file | RecWDlg.h [code]
file | Resource.h [code]
file | SendMDlg.Cpp [code]
file | SendMDlg.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | TestDoc.Cpp [code]
file | TestDoc.h [code]
file | TestVIEW.Cpp [code]
file | TestVIEW.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/mqf_draw/ Directory Reference

  • NetDS
  • MessageQueuing
  • mqf_draw

mqf_draw Directory Reference

Files

file | connectdlg.cpp [code]
file | connectdlg.h [code]
file | drawarea.cpp [code]
file | drawarea.h [code]
file | drawdlg.cpp [code]
file | drawdlg.h [code]
file | logindlg.cpp [code]
file | logindlg.h [code]
file | mqfdraw.cpp [code]
file | mqfdraw.h [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/ Directory Reference

  • NetDS
  • MessageQueuing
  • MQPers

MQPers Directory Reference

Directories

directory | GraphObj
directory | Rcv
directory | Snd

Files

file | QueueDef.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/ Directory Reference

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

GraphObj Directory Reference

Files

file | DllDatax.c [code]
file | DllDatax.h [code]
file | GraphObj.Cpp [code]
file | GraphObj.Idl [code]
file | IPersistStm.h [code]
file | Line.Cpp [code]
file | Line.h [code]
file | Point.Cpp [code]
file | Point.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/Rcv/ Directory Reference

  • NetDS
  • MessageQueuing
  • MQPers
  • Rcv

Rcv Directory Reference

Files

file | Main.Cpp [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/Snd/ Directory Reference

  • NetDS
  • MessageQueuing
  • MQPers
  • Snd

Snd Directory Reference

Files

file | Main.Cpp [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPort/ Directory Reference

  • NetDS
  • MessageQueuing
  • MQPort

MQPort Directory Reference

Files

file MQPort.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqTestOA/ Directory Reference

  • NetDS
  • MessageQueuing
  • MqTestOA

MqTestOA Directory Reference

Files

file | Guids.Cpp [code]
file | MqTestOA.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqTrans/ Directory Reference

  • NetDS
  • MessageQueuing
  • MqTrans

MqTrans Directory Reference

Files

file MqTrans.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MSMQTest/ Directory Reference

  • NetDS
  • MessageQueuing
  • MSMQTest

MSMQTest Directory Reference

Files

file MSMQTest.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/NetMon/ Directory Reference

  • NetDS
  • NetMon

NetMon Directory Reference

Directories

directory | experts
directory | parsers
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/NetMon/experts/ Directory Reference

  • NetDS
  • NetMon
  • experts

experts Directory Reference

Directories

directory blrplate
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/NetMon/experts/blrplate/ Directory Reference

  • NetDS
  • NetMon
  • experts
  • blrplate

blrplate Directory Reference

Files

file | blrplate.cpp [code]
file | blrplate.h [code]
file | config.cpp [code]
file | resrc1.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/NetMon/parsers/ Directory Reference

  • NetDS
  • NetMon
  • parsers

parsers Directory Reference

Directories

directory blrplate
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/NetMon/parsers/blrplate/ Directory Reference

  • NetDS
  • NetMon
  • parsers
  • blrplate

blrplate Directory Reference

Files

file | blrplate.c [code]
file | blrplate.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/netshell/ Directory Reference

  • NetDS
  • netshell

netshell Directory Reference

Files

file | nshsamp.cpp [code]
file | nshsamp.h [code]
file | sampinterface.cpp [code]
file | sample.cpp [code]
file | subcontext.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/ Directory Reference

  • NetDS
  • Ras

Ras Directory Reference

Directories

directory | ConnectionManager
directory | customdial
directory | CustomScript
directory | PhoneEntry
directory | Ras_Statistics
directory | RasDial
directory | RasDialAsync
directory | RasEnumConnections
directory | RasEnumDevices
directory | RasEnumEntries
directory | WinNT
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/ConnectionManager/ Directory Reference

  • NetDS
  • Ras
  • ConnectionManager

ConnectionManager Directory Reference

Files

file cmsample.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/customdial/ Directory Reference

  • NetDS
  • Ras
  • customdial

customdial Directory Reference

Files

file | customdial.cpp [code]
file | customdialreg.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/CustomScript/ Directory Reference

  • NetDS
  • Ras
  • CustomScript

CustomScript Directory Reference

Directories

directory CustomEntry
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/CustomScript/CustomEntry/ Directory Reference

  • NetDS
  • Ras
  • CustomScript
  • CustomEntry

CustomEntry Directory Reference

Files

file customentry.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/PhoneEntry/ Directory Reference

  • NetDS
  • Ras
  • PhoneEntry

PhoneEntry Directory Reference

Files

file | PhoneEntry.c [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/Ras_Statistics/ Directory Reference

  • NetDS
  • Ras
  • Ras_Statistics

Ras_Statistics Directory Reference

Files

file RasGetConnectionStatistics.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasDial/ Directory Reference

  • NetDS
  • Ras
  • RasDial

RasDial Directory Reference

Directories

directory c
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasDial/c/ Directory Reference

  • NetDS
  • Ras
  • RasDial
  • c

c Directory Reference

Files

file RasDial.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasDialAsync/ Directory Reference

  • NetDS
  • Ras
  • RasDialAsync

RasDialAsync Directory Reference

Files

file RasDialAsync.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasEnumConnections/ Directory Reference

  • NetDS
  • Ras
  • RasEnumConnections

RasEnumConnections Directory Reference

Directories

directory c
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasEnumConnections/c/ Directory Reference

  • NetDS
  • Ras
  • RasEnumConnections
  • c

c Directory Reference

Files

file RasEnumConnections.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasEnumDevices/ Directory Reference

  • NetDS
  • Ras
  • RasEnumDevices

RasEnumDevices Directory Reference

Directories

directory c
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasEnumDevices/c/ Directory Reference

  • NetDS
  • Ras
  • RasEnumDevices
  • c

c Directory Reference

Files

file RasEnumDevices.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasEnumEntries/ Directory Reference

  • NetDS
  • Ras
  • RasEnumEntries

RasEnumEntries Directory Reference

Directories

directory c
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasEnumEntries/c/ Directory Reference

  • NetDS
  • Ras
  • RasEnumEntries
  • c

c Directory Reference

Files

file RasEnumentries.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/WinNT/ Directory Reference

  • NetDS
  • Ras
  • WinNT

WinNT Directory Reference

Directories

directory RasHost
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/WinNT/RasHost/ Directory Reference

  • NetDS
  • Ras
  • WinNT
  • RasHost

RasHost Directory Reference

Files

file | RasHost.Cpp [code]
file | RasHost.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/ Directory Reference

  • NetDS
  • RPC

RPC Directory Reference

Directories

directory | AsyncRPC
directory | ClUuid
directory | Data
directory | Dynept
directory | DynOut
directory | FileRep
directory | Handles
directory | Hello
directory | Pickle
directory | Pipes
directory | RPCssm
directory | RPCsvc
directory | StrOut
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/AsyncRPC/ Directory Reference

  • NetDS
  • RPC
  • AsyncRPC

AsyncRPC Directory Reference

Files

file | AsyncRPC.Idl [code]
file | AsyncRPCc.c [code]
file | AsyncRPCp.c [code]
file | AsyncRPCs.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/ClUuid/ Directory Reference

  • NetDS
  • RPC
  • ClUuid

ClUuid Directory Reference

Files

file | ClUuid.Idl [code]
file | ClUuidc.c [code]
file | ClUuidp.c [code]
file | ClUuids.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/ Directory Reference

  • NetDS
  • RPC
  • Data

Data Directory Reference

Directories

directory | DUnion
directory | InOut
directory | repas
directory | Xmit
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/DUnion/ Directory Reference

  • NetDS
  • RPC
  • Data
  • DUnion

DUnion Directory Reference

Files

file | DUnion.Idl [code]
file | DUnionc.c [code]
file | DUnionp.c [code]
file | DUnions.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/InOut/ Directory Reference

  • NetDS
  • RPC
  • Data
  • InOut

InOut Directory Reference

Files

file | InOut.Idl [code]
file | InOutc.c [code]
file | InOutp.c [code]
file | InOuts.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/repas/ Directory Reference

  • NetDS
  • RPC
  • Data
  • repas

repas Directory Reference

Files

file | Repas.Idl [code]
file | Repasc.c [code]
file | Repascu.c [code]
file | Repasp.c [code]
file | Repass.c [code]
file | Repassu.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/Xmit/ Directory Reference

  • NetDS
  • RPC
  • Data
  • Xmit

Xmit Directory Reference

Files

file | Xmit.Idl [code]
file | Xmitc.c [code]
file | Xmitp.c [code]
file | Xmits.c [code]
file | Xmitu.c [code]
file | Xmitu.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Dynept/ Directory Reference

  • NetDS
  • RPC
  • Dynept

Dynept Directory Reference

Files

file | Dynept.Idl [code]
file | Dyneptc.c [code]
file | Dyneptp.c [code]
file | Dynepts.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/DynOut/ Directory Reference

  • NetDS
  • RPC
  • DynOut

DynOut Directory Reference

Files

file | DynOut.Idl [code]
file | DynOutc.c [code]
file | DynOutp.c [code]
file | DynOuts.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/ Directory Reference

  • NetDS
  • RPC
  • FileRep

FileRep Directory Reference

Directories

directory | FileRepAsyncPipe
directory | filerepmultiuser
directory | filerepsecure
directory | filerepsimple
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/FileRepAsyncPipe/ Directory Reference

  • NetDS
  • RPC
  • FileRep
  • FileRepAsyncPipe

FileRepAsyncPipe Directory Reference

Files

file | common.cpp [code]
file | common.h [code]
file | DbgMsg.cpp [code]
file | DbgMsg.h [code]
file | FileRep.cpp [code]
file | FileRepClient.idl [code]
file | FileRepClientProc.cpp [code]
file | FileRepServer.cpp [code]
file | FileRepServer.idl [code]
file | FileRepServerProc.cpp [code]
file | FileRepService.cpp [code]
file | Prof.cpp [code]
file | Prof.h [code]
file | Resources.cpp [code]
file | Resources.h [code]
file | Service.cpp [code]
file | Service.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/ Directory Reference

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

filerepmultiuser Directory Reference

Files

file | common.cpp [code]
file | common.h [code]
file | dbgmsg.cpp [code]
file | dbgmsg.h [code]
file | filerep.cpp [code]
file | filerepclient.idl [code]
file | filerepclientproc.cpp [code]
file | filerepserver.idl [code]
file | filerepserverproc.cpp [code]
file | filerepservice.cpp [code]
file | prof.cpp [code]
file | prof.h [code]
file | resources.cpp [code]
file | resources.h [code]
file | service.cpp [code]
file | service.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/ Directory Reference

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

filerepsecure Directory Reference

Files

file | common.cpp [code]
file | common.h [code]
file | filerep.cpp [code]
file | filerepclient.idl [code]
file | filerepclientproc.cpp [code]
file | filerepserver.idl [code]
file | filerepserverproc.cpp [code]
file | filerepservice.cpp [code]
file | prof.cpp [code]
file | prof.h [code]
file | service.cpp [code]
file | service.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/ Directory Reference

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

filerepsimple Directory Reference

Files

file | common.cpp [code]
file | common.h [code]
file | filerep.cpp [code]
file | filerepclient.idl [code]
file | filerepclientproc.cpp [code]
file | filerepserver.cpp [code]
file | filerepserver.idl [code]
file | filerepserverproc.cpp [code]
file | filerepservice.cpp [code]
file | prof.cpp [code]
file | prof.h [code]
file | service.cpp [code]
file | service.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/ Directory Reference

  • NetDS
  • RPC
  • Handles

Handles Directory Reference

Directories

directory | cxhndl
directory | usrdef
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/cxhndl/ Directory Reference

  • NetDS
  • RPC
  • Handles
  • cxhndl

cxhndl Directory Reference

Files

file | Cxhndl.Idl [code]
file | Cxhndlc.c [code]
file | Cxhndlp.c [code]
file | Cxhndls.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/usrdef/ Directory Reference

  • NetDS
  • RPC
  • Handles
  • usrdef

usrdef Directory Reference

Files

file | Usrdef.Idl [code]
file | Usrdefc.c [code]
file | Usrdefp.c [code]
file | Usrdefs.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Hello/ Directory Reference

  • NetDS
  • RPC
  • Hello

Hello Directory Reference

Files

file | Hello.Idl [code]
file | Helloc.c [code]
file | Hellop.c [code]
file | Hellos.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pickle/ Directory Reference

  • NetDS
  • RPC
  • Pickle

Pickle Directory Reference

Directories

directory | Picklp
directory | Picklt
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pickle/Picklp/ Directory Reference

  • NetDS
  • RPC
  • Pickle
  • Picklp

Picklp Directory Reference

Files

file | Picklp.Idl [code]
file | Picklpc.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pickle/Picklt/ Directory Reference

  • NetDS
  • RPC
  • Pickle
  • Picklt

Picklt Directory Reference

Files

file | Picklt.Idl [code]
file | Pickltc.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pipes/ Directory Reference

  • NetDS
  • RPC
  • Pipes

Pipes Directory Reference

Files

file | Common.h [code]
file | Pipe.Idl [code]
file | Pipec.c [code]
file | Pipeproc.c [code]
file | Pipes.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/RPCssm/ Directory Reference

  • NetDS
  • RPC
  • RPCssm

RPCssm Directory Reference

Files

file | RPCssm.Idl [code]
file | RPCssmc.c [code]
file | RPCssmp.c [code]
file | RPCssms.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/RPCsvc/ Directory Reference

  • NetDS
  • RPC
  • RPCsvc

RPCsvc Directory Reference

Files

file | Client.C [code]
file | RPCsvc.Idl [code]
file | Server.c [code]
file | Service.C [code]
file | Service.H [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/StrOut/ Directory Reference

  • NetDS
  • RPC
  • StrOut

StrOut Directory Reference

Files

file | Client.c [code]
file | Common.h [code]
file | Remote.c [code]
file | Server.c [code]
file | StrOut.Idl [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ Directory Reference

  • NetDS
  • RRas

RRas Directory Reference

Directories

directory | Adminapi
directory | Callout
directory | Eap
directory | ip
directory | LoadProtocol
directory | rqs
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/Adminapi/ Directory Reference

  • NetDS
  • RRas
  • Adminapi

Adminapi Directory Reference

Files

file Admapit.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/Callout/ Directory Reference

  • NetDS
  • RRas
  • Callout

Callout Directory Reference

Files

file AdminDll.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/Eap/ Directory Reference

  • NetDS
  • RRas
  • Eap

Eap Directory Reference

Files

file | CeapCfg.Cpp [code]
file | CeapCfg.h [code]
file | Eap.c [code]
file | Eap.h [code]
file | Exports.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/ Directory Reference

  • NetDS
  • RRas
  • ip

ip Directory Reference

Files

file | configentry.c [code]
file | configentry.h [code]
file | configmgr.c [code]
file | configmgr.h [code]
file | defs.h [code]
file | hashtable.c [code]
file | hashtable.h [code]
file | ipsample.c [code]
file | ipsample.h [code]
file | ipsamplerm.h [code]
file | list.h [code]
file | log.h [code]
file | makefile.inc [code]
file | mibmgr.c [code]
file | mibmgr.h [code]
file | networkentry.c [code]
file | networkentry.h [code]
file | networkmgr.c [code]
file | networkmgr.h [code]
file | packet.c [code]
file | packet.h [code]
file | pchsample.h [code]
file | rmapi.c [code]
file | rmapi.h [code]
file | rtmapi.c [code]
file | rtmapi.h [code]
file | sampletest.cxx [code]
file | sampletest.h [code]
file | socket.c [code]
file | socket.h [code]
file | sync.c [code]
file | sync.h [code]
file | test.c [code]
file | utils.c [code]
file | utils.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/LoadProtocol/ Directory Reference

  • NetDS
  • RRas
  • LoadProtocol

LoadProtocol Directory Reference

Files

file | ipsamplerm.h [code]
file | loadprotocol.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/ Directory Reference

  • NetDS
  • RRas
  • rqs

rqs Directory Reference

Directories

directory | client
directory | common
directory | inc
directory | rqsmsg
directory | server
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/client/ Directory Reference

  • NetDS
  • RRas
  • rqs
  • client

client Directory Reference

Files

file main.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/common/ Directory Reference

  • NetDS
  • RRas
  • rqs
  • common

common Directory Reference

Files

file | rcusync.cpp [code]
file | rumem.cpp [code]
file | rureg.cpp [code]
file | rusocket.cpp [code]
file | rustring.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/inc/ Directory Reference

  • NetDS
  • RRas
  • rqs
  • inc

inc Directory Reference

Files

file | rasutil.h [code]
file | rcusync.h [code]
file | rumem.h [code]
file | rureg.h [code]
file | rusocket.h [code]
file | rustring.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/rqsmsg/ Directory Reference

  • NetDS
  • RRas
  • rqs
  • rqsmsg

rqsmsg Directory Reference

Files

file rqsmsg.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/ Directory Reference

  • NetDS
  • RRas
  • rqs
  • server

server Directory Reference

Files

file | clntlst.h [code]
file | main.cpp [code]
file | rqs.h [code]
file | rqsclient.cpp [code]
file | rqsclient.h [code]
file | rqsconfig.cpp [code]
file | rqsconfig.h [code]
file | rqsengine.cpp [code]
file | rqsengine.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/ Directory Reference

  • NetDS
  • rtc

rtc Directory Reference

Directories

directory Client
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/ Directory Reference

  • NetDS
  • rtc
  • Client

Client Directory Reference

Directories

directory CPP
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/ Directory Reference

  • NetDS
  • rtc
  • Client
  • CPP

CPP Directory Reference

Directories

directory | RTCIncoming
directory | RTCOutgoing
directory | rtcsample
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCIncoming/ Directory Reference

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCIncoming

RTCIncoming Directory Reference

Files

file | Resource.h [code]
file | RTCIncoming.cpp [code]
file | RTCIncoming.h [code]
file | RTCIncomingDlg.cpp [code]
file | RTCIncomingDlg.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | Utils.cpp [code]
file | Utils.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCOutgoing/ Directory Reference

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCOutgoing

RTCOutgoing Directory Reference

Files

file | Resource.h [code]
file | RTCOutgoing.cpp [code]
file | RTCOutgoing.h [code]
file | RTCOutgoingDlg.cpp [code]
file | RTCOutgoingDlg.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | Utils.cpp [code]
file | Utils.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/ Directory Reference

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcsample Directory Reference

Files

file | resource.h [code]
file | rtcav.cpp [code]
file | rtcav.h [code]
file | rtcdialogs.cpp [code]
file | rtcdialogs.h [code]
file | rtcevents.h [code]
file | rtcim.cpp [code]
file | rtcim.h [code]
file | rtcsample.cpp [code]
file | rtcsession.cpp [code]
file | rtcsession.h [code]
file | rtcwin.cpp [code]
file | rtcwin.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Snmp/ Directory Reference

  • NetDS
  • Snmp

Snmp Directory Reference

Directories

directory | SnmpUtil
directory | TestDll
directory | WSnmp
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Snmp/SnmpUtil/ Directory Reference

  • NetDS
  • Snmp
  • SnmpUtil

SnmpUtil Directory Reference

Files

file SnmpUtil.C [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Snmp/TestDll/ Directory Reference

  • NetDS
  • Snmp
  • TestDll

TestDll Directory Reference

Files

file | TestDll.C [code]
file | TestMIB.C [code]
file | TestMIB.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Snmp/WSnmp/ Directory Reference

  • NetDS
  • Snmp
  • WSnmp

WSnmp Directory Reference

Files

file | Helper.Cpp [code]
file | WSnmpUtil.Cpp [code]
file | WSnmpUtil.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/ Directory Reference

  • NetDS
  • SyncMgr

SyncMgr Directory Reference

Directories

directory SyncDir
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/ Directory Reference

  • NetDS
  • SyncMgr
  • SyncDir

SyncDir Directory Reference

Files

file | Alloc.Cpp [code]
file | Alloc.h [code]
file | Cfact.Cpp [code]
file | Cfact.h [code]
file | Critsect.Cpp [code]
file | Critsect.h [code]
file | Debug.Cpp [code]
file | Debug.h [code]
file | DllMain.Cpp [code]
file | DllMain.h [code]
file | Enum.Cpp [code]
file | Enum.h [code]
file | Guid.c [code]
file | Guid.h [code]
file | Handler.Cpp [code]
file | Handler.h [code]
file | Helper.Cpp [code]
file | Helper.h [code]
file | PreComp.h [code]
file | Reg.Cpp [code]
file | Reg.h [code]
file | Resource.h [code]
file | Settings.Cpp [code]
file | Settings.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/ Directory Reference

  • NetDS
  • Tapi

Tapi Directory Reference

Directories

directory | Tapi2
directory | Tapi3
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/ Directory Reference

  • NetDS
  • Tapi
  • Tapi2

Tapi2 Directory Reference

Directories

directory | Atsp32
directory | Dialer
directory | TapiComm
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/Atsp32/ Directory Reference

  • NetDS
  • Tapi
  • Tapi2
  • Atsp32

Atsp32 Directory Reference

Files

file | Atsp.c [code]
file | Atsp.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/Dialer/ Directory Reference

  • NetDS
  • Tapi
  • Tapi2
  • Dialer

Dialer Directory Reference

Files

file | Dialer.c [code]
file | Dialer.h [code]
file | Dialhelp.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/ Directory Reference

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

TapiComm Directory Reference

Files

file | ABOUT.c [code]
file | CommCode.c [code]
file | CommCode.h [code]
file | DISPATCH.c [code]
file | EDITCTLS.c [code]
file | EDITCTLS.h [code]
file | GLOBALS.h [code]
file | INIT.c [code]
file | Misc.c [code]
file | Resource.h [code]
file | STATBAR.c [code]
file | STATBAR.h [code]
file | TapiCode.c [code]
file | TapiCode.h [code]
file | TapiComm.c [code]
file | TapiInfo.c [code]
file | TapiInfo.h [code]
file | ToolBar.c [code]
file | ToolBar.h [code]
file | WinMain.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3

Tapi3 Directory Reference

Directories

directory Cpp
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp

Cpp Directory Reference

Directories

directory | FileTerm
directory | Incoming
directory | Msp
directory | Outgoing
directory | pluggable
directory | Rend
directory | tapirecv
directory | tapisend
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/FileTerm/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • FileTerm

FileTerm Directory Reference

Files

file | CallNot.cpp [code]
file | CallNot.h [code]
file | FileTerm.cpp [code]
file | FileTerm.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Incoming/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Incoming

Incoming Directory Reference

Files

file | Callnot.Cpp [code]
file | Callnot.h [code]
file | Incoming.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp

Msp Directory Reference

Directories

directory | MSPBase
directory | SampleMSP
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/MSPBase/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • MSPBase

MSPBase Directory Reference

Files

file | dtevntsk.cpp [code]
file | mspaddr.cpp [code]
file | mspcall.cpp [code]
file | msplog.cpp [code]
file | mspstrm.cpp [code]
file | mspterm.cpp [code]
file | mspthrd.cpp [code]
file | msptrmac.cpp [code]
file | msptrmar.cpp [code]
file | msptrmvc.cpp [code]
file | msputils.cpp [code]
file | precomp.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/SampleMSP/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • SampleMSP

SampleMSP Directory Reference

Files

file | Common.h [code]
file | Resource.h [code]
file | SampAddr.Cpp [code]
file | SampAddr.h [code]
file | SampCall.Cpp [code]
file | SampCall.h [code]
file | SampMsp.Cpp [code]
file | SampMsp.Idl [code]
file | SampStrm.Cpp [code]
file | SampStrm.h [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Outgoing/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Outgoing

Outgoing Directory Reference

Files

file | Outgoing.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

pluggable Directory Reference

Files

file | guids.h [code]
file | plgterm.cpp [code]
file | plgterm.h [code]
file | plgtermfilter.cpp [code]
file | plgtermfilter.h [code]
file | plgtermpin.cpp [code]
file | plgtermpin.h [code]
file | plgtermpriv.h [code]
file | plgtermsample.idl [code]
file | pluggable.cpp [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Rend/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Rend

Rend Directory Reference

Files

file RendSam.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapirecv/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapirecv

tapirecv Directory Reference

Files

file | avifilewriter.cpp [code]
file | avifilewriter.h [code]
file | common.h [code]
file | Processing.cpp [code]
file | Processing.h [code]
file | tapirecv.cpp [code]
file | workerthread.cpp [code]
file | workerthread.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapisend/ Directory Reference

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapisend

tapisend Directory Reference

Files

file | avifilereader.cpp [code]
file | avifilereader.h [code]
file | common.h [code]
file | tapisend.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/ Directory Reference

  • NetDS
  • upnp

upnp Directory Reference

Directories

directory | DCO_DimmerService
directory | FunctionDelegator
directory | GenericUCP
directory | RegisterDevice
directory | StepByStep
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/DCO_DimmerService/ Directory Reference

  • NetDS
  • upnp
  • DCO_DimmerService

DCO_DimmerService Directory Reference

Files

file | DeviceDll.cpp [code]
file | DeviceDll.h [code]
file | DimmerDevice.idl [code]
file | DimmerDeviceDCO.cpp [code]
file | DimmerDeviceDCO.h [code]
file | DimmerService.cpp [code]
file | DimmerService.h [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/FunctionDelegator/ Directory Reference

  • NetDS
  • upnp
  • FunctionDelegator

FunctionDelegator Directory Reference

Files

file cbklib.idl [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/GenericUCP/ Directory Reference

  • NetDS
  • upnp
  • GenericUCP

GenericUCP Directory Reference

Directories

directory CPP
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/GenericUCP/CPP/ Directory Reference

  • NetDS
  • upnp
  • GenericUCP
  • CPP

CPP Directory Reference

Files

file | deviceprop.cpp [code]
file | deviceprop.h [code]
file | genericucp.cpp [code]
file | genericucp.h [code]
file | GenericUCPDlg.cpp [code]
file | genericucpdlg.h [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | stdafx.h [code]
file | util.cpp [code]
file | util.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/RegisterDevice/ Directory Reference

  • NetDS
  • upnp
  • RegisterDevice

RegisterDevice Directory Reference

Files

file RegDevice.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/ Directory Reference

  • NetDS
  • upnp
  • StepByStep

StepByStep Directory Reference

Directories

directory | Step1
directory | Step2
directory | Step3
directory | Step4
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step1/ Directory Reference

  • NetDS
  • upnp
  • StepByStep
  • Step1

Step1 Directory Reference

Files

file DimmingService_SCPD.idl [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/ Directory Reference

  • NetDS
  • upnp
  • StepByStep
  • Step2

Step2 Directory Reference

Files

file | Dimmer.cpp [code]
file | Dimmer.h [code]
file | DimmerService.cpp [code]
file | DimmerService.h [code]
file | dlldata.c [code]
file | MyDevice.cpp [code]
file | MyDevice.h [code]
file | MyDevice.idl [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/ Directory Reference

  • NetDS
  • upnp
  • StepByStep
  • Step3

Step3 Directory Reference

Files

file | Dimmer.cpp [code]
file | Dimmer.h [code]
file | DimmerService.cpp [code]
file | DimmerService.h [code]
file | dlldata.c [code]
file | MyDevice.cpp [code]
file | MyDevice.h [code]
file | MyDevice.idl [code]
file | MyDevice_i.c [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/ Directory Reference

  • NetDS
  • upnp
  • StepByStep
  • Step4

Step4 Directory Reference

Files

file | Dimmer.cpp [code]
file | Dimmer.h [code]
file | DimmerService.cpp [code]
file | DimmerService.h [code]
file | dlldata.c [code]
file | MyDevice.cpp [code]
file | MyDevice.h [code]
file | MyDevice.idl [code]
file | MyDevice_i.c [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinNT/ Directory Reference

  • NetDS
  • WinNT

WinNT Directory Reference

Directories

directory NetApi
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinNT/NetApi/ Directory Reference

  • NetDS
  • WinNT
  • NetApi

NetApi Directory Reference

Directories

directory | ChngPass
directory | NetShare
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinNT/NetApi/ChngPass/ Directory Reference

  • NetDS
  • WinNT
  • NetApi
  • ChngPass

ChngPass Directory Reference

Files

file ChngPass.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinNT/NetApi/NetShare/ Directory Reference

  • NetDS
  • WinNT
  • NetApi
  • NetShare

NetShare Directory Reference

Files

file NetShare.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/ Directory Reference

  • NetDS
  • WinSock

WinSock Directory Reference

Directories

directory | Accept
directory | appletalk
directory | ATMEvent
directory | Bcast
directory | Dt_Dll
directory | Dt_Dll2
directory | iocp
directory | iphdrinc
directory | IpxChat
directory | LSP
directory | McastIP
directory | Overlap
directory | Ping
directory | rcvall
directory | Rnr2
directory | simple
directory | Sockdup
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Accept/ Directory Reference

  • NetDS
  • WinSock
  • Accept

Accept Directory Reference

Files

file | ASAccept.cpp [code]
file | common.cpp [code]
file | common.h [code]
file | main.cpp [code]
file | NBAccept.cpp [code]
file | SockInfo.cpp [code]
file | TestAccept.cpp [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/appletalk/ Directory Reference

  • NetDS
  • WinSock
  • appletalk

appletalk Directory Reference

Files

file | PrPerf.c [code]
file | PrSamp.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/ATMEvent/ Directory Reference

  • NetDS
  • WinSock
  • ATMEvent

ATMEvent Directory Reference

Files

file | ATMEvent.Cpp [code]
file | ATMEvent.h [code]
file | Enumerator.Cpp [code]
file | Receiver.Cpp [code]
file | Sender.Cpp [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Bcast/ Directory Reference

  • NetDS
  • WinSock
  • Bcast

Bcast Directory Reference

Files

file Bcast.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/ Directory Reference

  • NetDS
  • WinSock
  • Dt_Dll

Dt_Dll Directory Reference

Files

file | CStack.h [code]
file | Dt.h [code]
file | Dt_Dll.Cpp [code]
file | Dt_Dll.h [code]
file | Handlers.Cpp [code]
file | Handlers.h [code]
file | HuError.Cpp [code]
file | HuError.h [code]
file | Nideque.h [code]
file | NoWarn.h [code]
file | Stack.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll2/ Directory Reference

  • NetDS
  • WinSock
  • Dt_Dll2

Dt_Dll2 Directory Reference

Files

file | ApiHook.Hpp [code]
file | Dt_Dll.Cpp [code]
file | Dt_Dll.Hpp [code]
file | DtHandler.Cpp [code]
file | DtHandler.Hpp [code]
file | Socketmon.Cpp [code]
file | Socketmon.Hpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/iocp/ Directory Reference

  • NetDS
  • WinSock
  • iocp

iocp Directory Reference

Files

file | IocpClient.Cpp [code]
file | IocpServer.Cpp [code]
file | IocpServer.h [code]
file | IocpServerex.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/iphdrinc/ Directory Reference

  • NetDS
  • WinSock
  • iphdrinc

iphdrinc Directory Reference

Files

file | iphdr.h [code]
file | rawudp.c [code]
file | resolve.c [code]
file | resolve.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/IpxChat/ Directory Reference

  • NetDS
  • WinSock
  • IpxChat

IpxChat Directory Reference

Files

file | About.c [code]
file | Connect.c [code]
file | Dispatch.c [code]
file | Globals.h [code]
file | Init.c [code]
file | IpxChat.c [code]
file | Listen.c [code]
file | Misc.c [code]
file | WinMain.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/LSP/ Directory Reference

  • NetDS
  • WinSock
  • LSP

LSP Directory Reference

Files

file | asyncselect.cpp [code]
file | extension.cpp [code]
file | install.h [code]
file | instlsp.cpp [code]
file | lspguid.cpp [code]
file | overlap.cpp [code]
file | prnpinfo.cpp [code]
file | provider.cpp [code]
file | provider.h [code]
file | sockinfo.cpp [code]
file | spi.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/McastIP/ Directory Reference

  • NetDS
  • WinSock
  • McastIP

McastIP Directory Reference

Files

file | Mcastws1.c [code]
file | Mcastws2.c [code]
file | resolve.c [code]
file | resolve.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Overlap/ Directory Reference

  • NetDS
  • WinSock
  • Overlap

Overlap Directory Reference

Files

file Overlap.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Ping/ Directory Reference

  • NetDS
  • WinSock
  • Ping

Ping Directory Reference

Files

file | iphdr.h [code]
file | Ping.cpp [code]
file | resolve.cpp [code]
file | resolve.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/rcvall/ Directory Reference

  • NetDS
  • WinSock
  • rcvall

rcvall Directory Reference

Files

file | iphdr.h [code]
file | parser.c [code]
file | parser.h [code]
file | rcvall.c [code]
file | resolve.c [code]
file | resolve.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Rnr2/ Directory Reference

  • NetDS
  • WinSock
  • Rnr2

Rnr2 Directory Reference

Files

file rnrcs.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/simple/ Directory Reference

  • NetDS
  • WinSock
  • simple

simple Directory Reference

Files

file | Ioctl.c [code]
file | Simplec.c [code]
file | Simples.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Sockdup/ Directory Reference

  • NetDS
  • WinSock
  • Sockdup

Sockdup Directory Reference

Files

file | Sockdupc.c [code]
file | Sockdups.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/ Directory Reference

  • Security

Security Directory Reference

Directories

directory | Authentication
directory | Authorization
directory | capicom
directory | CertServices
directory | CryptoApi
directory | GINA
directory | LSAPolicy
directory | NetProviders
directory | PasswordFilters
directory | SmartCard
directory | SSPI
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/ Directory Reference

  • Security
  • Authentication

Authentication Directory Reference

Directories

directory | KerbSubAuth
directory | MSVSubAuth
directory | SampSSP
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/KerbSubAuth/ Directory Reference

  • Security
  • Authentication
  • KerbSubAuth

KerbSubAuth Directory Reference

Files

file SubAuth.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/MSVSubAuth/ Directory Reference

  • Security
  • Authentication
  • MSVSubAuth

MSVSubAuth Directory Reference

Files

file SubAuth.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/SampSSP/ Directory Reference

  • Security
  • Authentication
  • SampSSP

SampSSP Directory Reference

Files

file | Init.c [code]
file | SampSSP.H [code]
file | Stubs.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/ Directory Reference

  • Security
  • Authorization

Authorization Directory Reference

Directories

directory | AclApi
directory | Audit
directory | authz
directory | Check_SD
directory | klist
directory | MyToken
directory | Rcmd
directory | SecFile
directory | SecPrint
directory | SecurObj
directory | SidCln
directory | SuperUsr
directory | TakeOwn
directory | TextSid
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/AclApi/ Directory Reference

  • Security
  • Authorization
  • AclApi

AclApi Directory Reference

Files

file AclApi.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Audit/ Directory Reference

  • Security
  • Authorization
  • Audit

Audit Directory Reference

Files

file Audit.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/authz/ Directory Reference

  • Security
  • Authorization
  • authz

authz Directory Reference

Files

file | AuthzCli.c [code]
file | AuthzSvr.c [code]
file | common.c [code]
file | common.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Check_SD/ Directory Reference

  • Security
  • Authorization
  • Check_SD

Check_SD Directory Reference

Files

file | Check_SD.c [code]
file | Check_SD.h [code]
file | Helper.c [code]
file | SD.c [code]
file | SecObjects.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/klist/ Directory Reference

  • Security
  • Authorization
  • klist

klist Directory Reference

Files

file KList.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/MyToken/ Directory Reference

  • Security
  • Authorization
  • MyToken

MyToken Directory Reference

Files

file MyToken.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Rcmd/ Directory Reference

  • Security
  • Authorization
  • Rcmd

Rcmd Directory Reference

Files

file | Client.c [code]
file | Server.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SecFile/ Directory Reference

  • Security
  • Authorization
  • SecFile

SecFile Directory Reference

Directories

directory c
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SecFile/c/ Directory Reference

  • Security
  • Authorization
  • SecFile
  • c

c Directory Reference

Files

file SecFile.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SecPrint/ Directory Reference

  • Security
  • Authorization
  • SecPrint

SecPrint Directory Reference

Files

file SecPrint.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SecurObj/ Directory Reference

  • Security
  • Authorization
  • SecurObj

SecurObj Directory Reference

Files

file | Main.Cpp [code]
file | Main.h [code]
file | Privobji.Cpp [code]
file | Resource.h [code]
file | Security.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SidCln/ Directory Reference

  • Security
  • Authorization
  • SidCln

SidCln Directory Reference

Files

file SidClean.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SuperUsr/ Directory Reference

  • Security
  • Authorization
  • SuperUsr

SuperUsr Directory Reference

Files

file SuperUsr.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/TakeOwn/ Directory Reference

  • Security
  • Authorization
  • TakeOwn

TakeOwn Directory Reference

Files

file TakeOwn.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/TextSid/ Directory Reference

  • Security
  • Authorization
  • TextSid

TextSid Directory Reference

Files

file TextSid.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/ Directory Reference

  • Security
  • capicom

capicom Directory Reference

Directories

directory | c_sharp
directory | cpp
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/ Directory Reference

  • Security
  • capicom
  • c_sharp

c_sharp Directory Reference

Directories

directory | chainsh
directory | storesh
directory | xmldsig
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/chainsh/ Directory Reference

  • Security
  • capicom
  • c_sharp
  • chainsh

chainsh Directory Reference

Files

file | AssemblyInfo.cs [code]
file | chainsh.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/storesh/ Directory Reference

  • Security
  • capicom
  • c_sharp
  • storesh

storesh Directory Reference

Files

file storesh.cs [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/xmldsig/ Directory Reference

  • Security
  • capicom
  • c_sharp
  • xmldsig

xmldsig Directory Reference

Files

file | AboutBox.cs [code]
file | CertGetKey.c [code]
file | MainWindow.cs [code]
file | Messages.cs [code]
file | SignVerify.cs [code]
file | xmldsig.cs [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/cpp/ Directory Reference

  • Security
  • capicom
  • cpp

cpp Directory Reference

Directories

directory | isapiCertPolicy
directory | store
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/cpp/isapiCertPolicy/ Directory Reference

  • Security
  • capicom
  • cpp
  • isapiCertPolicy

isapiCertPolicy Directory Reference

Files

file | ErrorTxt.h [code]
file | isapiCertPolicy.cpp [code]
file | isapiCertPolicy.h [code]
file | Resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/cpp/store/ Directory Reference

  • Security
  • capicom
  • cpp
  • store

store Directory Reference

Files

file Store.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/ Directory Reference

  • Security
  • CertServices

CertServices Directory Reference

Directories

directory | Encode
directory | Exit
directory | Policy
directory | RequestCert
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/ Directory Reference

  • Security
  • CertServices
  • Encode

Encode Directory Reference

Files

file | ADate.Cpp [code]
file | ADate.h [code]
file | ALong.Cpp [code]
file | ALong.h [code]
file | AltName.Cpp [code]
file | AltName.h [code]
file | AString.Cpp [code]
file | AString.h [code]
file | Atl.Cpp [code]
file | BitStr.Cpp [code]
file | BitStr.h [code]
file | CeError.Cpp [code]
file | CeLib.Cpp [code]
file | CertEnc.Cpp [code]
file | CrlDist.Cpp [code]
file | CrlDist.h [code]
file | Pch.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/ Directory Reference

  • Security
  • CertServices
  • Exit

Exit Directory Reference

Directories

directory C++
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/ Directory Reference

  • Security
  • CertServices
  • Exit
  • C++

C++ Directory Reference

Directories

directory | Windows.Net
directory | Windows2000
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows.Net/ Directory Reference

  • Security
  • CertServices
  • Exit
  • C++
  • Windows.Net

Windows.Net Directory Reference

Files

file | atl.cpp [code]
file | cedebug.cpp [code]
file | ceerror.cpp [code]
file | celib.cpp [code]
file | certxsam.cpp [code]
file | certxsam.idl [code]
file | exit.cpp [code]
file | exit.h [code]
file | module.cpp [code]
file | module.h [code]
file | pch.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows2000/ Directory Reference

  • Security
  • CertServices
  • Exit
  • C++
  • Windows2000

Windows2000 Directory Reference

Files

file | Atl.Cpp [code]
file | CeDebug.Cpp [code]
file | CeError.Cpp [code]
file | CeLib.Cpp [code]
file | CeLibW2k.h [code]
file | CertXSam.Cpp [code]
file | CertXSam.Idl [code]
file | Exit.Cpp [code]
file | Exit.h [code]
file | Module.Cpp [code]
file | Module.h [code]
file | Pch.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/ Directory Reference

  • Security
  • CertServices
  • Policy

Policy Directory Reference

Directories

directory C++
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/ Directory Reference

  • Security
  • CertServices
  • Policy
  • C++

C++ Directory Reference

Directories

directory | Windows.Net
directory | Windows2000
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows.Net/ Directory Reference

  • Security
  • CertServices
  • Policy
  • C++
  • Windows.Net

Windows.Net Directory Reference

Files

file | atl.cpp [code]
file | cedebug.cpp [code]
file | ceerror.cpp [code]
file | ceformat.cpp [code]
file | celib.cpp [code]
file | certpsam.cpp [code]
file | certpsam.idl [code]
file | module.cpp [code]
file | module.h [code]
file | pch.cpp [code]
file | policy.cpp [code]
file | policy.h [code]
file | request.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/ Directory Reference

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

Windows2000 Directory Reference

Files

file | Atl.Cpp [code]
file | CeDebug.Cpp [code]
file | CeError.Cpp [code]
file | CeFormat.Cpp [code]
file | CeLib.Cpp [code]
file | CeLibW2k.h [code]
file | CertPSam.Cpp [code]
file | CertPSam.Idl [code]
file | Module.Cpp [code]
file | Module.h [code]
file | Pch.Cpp [code]
file | Policy.Cpp [code]
file | Policy.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/RequestCert/ Directory Reference

  • Security
  • CertServices
  • RequestCert

RequestCert Directory Reference

Files

file RequestCert.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/ Directory Reference

  • Security
  • CryptoApi

CryptoApi Directory Reference

Directories

directory | CreateCert
directory | Encrypt
directory | EncryptDecrypt
directory | EnumAlgs
directory | InitUser
directory | SignHash
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/CreateCert/ Directory Reference

  • Security
  • CryptoApi
  • CreateCert

CreateCert Directory Reference

Files

file | CreateCert.c [code]
file | CreateCert.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/Encrypt/ Directory Reference

  • Security
  • CryptoApi
  • Encrypt

Encrypt Directory Reference

Files

file | Decrypt.c [code]
file | Encrypt.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/EncryptDecrypt/ Directory Reference

  • Security
  • CryptoApi
  • EncryptDecrypt

EncryptDecrypt Directory Reference

Directories

directory | RSACert
directory | RSAKey
directory | SessionKey
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/EncryptDecrypt/RSACert/ Directory Reference

  • Security
  • CryptoApi
  • EncryptDecrypt
  • RSACert

RSACert Directory Reference

Files

file RSACert.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/EncryptDecrypt/RSAKey/ Directory Reference

  • Security
  • CryptoApi
  • EncryptDecrypt
  • RSAKey

RSAKey Directory Reference

Files

file RSAKey.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/EncryptDecrypt/SessionKey/ Directory Reference

  • Security
  • CryptoApi
  • EncryptDecrypt
  • SessionKey

SessionKey Directory Reference

Files

file SessionKey.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/EnumAlgs/ Directory Reference

  • Security
  • CryptoApi
  • EnumAlgs

EnumAlgs Directory Reference

Files

file EnumAlgs.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/InitUser/ Directory Reference

  • Security
  • CryptoApi
  • InitUser

InitUser Directory Reference

Files

file InitUser.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/SignHash/ Directory Reference

  • Security
  • CryptoApi
  • SignHash

SignHash Directory Reference

Files

file SignHash.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/GINA/ Directory Reference

  • Security
  • GINA

GINA Directory Reference

Directories

directory | GinaHook
directory | GinaStub
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/GINA/GinaHook/ Directory Reference

  • Security
  • GINA
  • GinaHook

GinaHook Directory Reference

Files

file | GinaDlg.c [code]
file | GinaDlg.h [code]
file | GinaHook.c [code]
file | GinaHook.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/GINA/GinaStub/ Directory Reference

  • Security
  • GINA
  • GinaStub

GinaStub Directory Reference

Files

file | GinaStub.c [code]
file | GinaStub.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/LSAPolicy/ Directory Reference

  • Security
  • LSAPolicy

LSAPolicy Directory Reference

Directories

directory | LsaPrivs
directory | MachAcct
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/LSAPolicy/LsaPrivs/ Directory Reference

  • Security
  • LSAPolicy
  • LsaPrivs

LsaPrivs Directory Reference

Files

file LsaPrivs.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/LSAPolicy/MachAcct/ Directory Reference

  • Security
  • LSAPolicy
  • MachAcct

MachAcct Directory Reference

Files

file MachAcct.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/NetProviders/ Directory Reference

  • Security
  • NetProviders

NetProviders Directory Reference

Directories

directory LogonNP
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/NetProviders/LogonNP/ Directory Reference

  • Security
  • NetProviders
  • LogonNP

LogonNP Directory Reference

Files

file | LogonNP.c [code]
file | Npaux.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/PasswordFilters/ Directory Reference

  • Security
  • PasswordFilters

PasswordFilters Directory Reference

Directories

directory PassFilt
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/PasswordFilters/PassFilt/ Directory Reference

  • Security
  • PasswordFilters
  • PassFilt

PassFilt Directory Reference

Files

file PwdFilt.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/ Directory Reference

  • Security
  • SmartCard

SmartCard Directory Reference

Directories

directory | PropCert
directory | SmartCardAPI
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/PropCert/ Directory Reference

  • Security
  • SmartCard
  • PropCert

PropCert Directory Reference

Files

file PropCert.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/SmartCardAPI/ Directory Reference

  • Security
  • SmartCard
  • SmartCardAPI

SmartCardAPI Directory Reference

Directories

directory | SCIntro
directory | SCQuery
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/SmartCardAPI/SCIntro/ Directory Reference

  • Security
  • SmartCard
  • SmartCardAPI
  • SCIntro

SCIntro Directory Reference

Files

file SCIntro.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/SmartCardAPI/SCQuery/ Directory Reference

  • Security
  • SmartCard
  • SmartCardAPI
  • SCQuery

SCQuery Directory Reference

Files

file | SCCommon.Cpp [code]
file | SCCommon.h [code]
file | SCQuery.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/ Directory Reference

  • Security
  • SSPI

SSPI Directory Reference

Directories

directory | GSS
directory | HttpAuth
directory | SockAuth
directory | SSL
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/GSS/ Directory Reference

  • Security
  • SSPI
  • GSS

GSS Directory Reference

Files

file | Gss-Misc.h [code]
file | GssAPI.h [code]
file | GssClient.c [code]
file | GssMisc.c [code]
file | GssServer.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/HttpAuth/ Directory Reference

  • Security
  • SSPI
  • HttpAuth

HttpAuth Directory Reference

Files

file | Const.H [code]
file | Get_Sock.c [code]
file | HttpAuth.c [code]
file | HttpAuth.h [code]
file | HttpGet.c [code]
file | Proto.H [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SockAuth/ Directory Reference

  • Security
  • SSPI
  • SockAuth

SockAuth Directory Reference

Files

file | Client.cpp [code]
file | Collect.cpp [code]
file | Collect.h [code]
file | Comm.cpp [code]
file | Comm.h [code]
file | Security.cpp [code]
file | Security.h [code]
file | Server.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SSL/ Directory Reference

  • Security
  • SSPI
  • SSL

SSL Directory Reference

Directories

directory | WebClient
directory | WebServer
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SSL/WebClient/ Directory Reference

  • Security
  • SSPI
  • SSL
  • WebClient

WebClient Directory Reference

Files

file | WebClient.c [code]
file | WI_SSL_Client.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SSL/WebServer/ Directory Reference

  • Security
  • SSPI
  • SSL
  • WebServer

WebServer Directory Reference

Files

file WebServer.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/ Directory Reference

  • SysMgmt

SysMgmt Directory Reference

Directories

directory | MMC
directory | Msi
directory | TaskSched
directory | WMI
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ Directory Reference

  • SysMgmt
  • MMC

MMC Directory Reference

Directories

directory | About
directory | ActiveX
directory | CMenu
directory | CMenuExt
directory | Complete
directory | CutCopy
directory | Extens
directory | Help
directory | Menubtn
directory | mmc2.0
directory | Multisel
directory | Nameext
directory | Nodes
directory | Openserv
directory | Ppgeext
directory | Proppage
directory | Simple
directory | Taskpads
directory | Tbarext
directory | Toolbar
directory | WMI
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/ Directory Reference

  • SysMgmt
  • MMC
  • About

About Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/ Directory Reference

  • SysMgmt
  • MMC
  • ActiveX

ActiveX Directory Reference

Directories

directory | atl
directory | vb

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/atl/ Directory Reference

  • SysMgmt
  • MMC
  • ActiveX
  • atl

atl Directory Reference

Files

file | atlcontrol.Cpp [code]
file | atlcontrol.h [code]
file | atlcontrol.idl [code]
file | mmccontrol.Cpp [code]
file | mmccontrol.h [code]
file | resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/vb/ Directory Reference

  • SysMgmt
  • MMC
  • ActiveX
  • vb

vb Directory Reference

Files

file mmcsample.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/ Directory Reference

  • SysMgmt
  • MMC
  • CMenu

CMenu Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/ Directory Reference

  • SysMgmt
  • MMC
  • CMenuExt

CMenuExt Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | cMenuext.Cpp [code]
file | cMenuext.h [code]
file | extend.h [code]
file | globals.h [code]
file | guids.h [code]
file | localres.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/ Directory Reference

  • SysMgmt
  • MMC
  • Complete

Complete Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | extend.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/ Directory Reference

  • SysMgmt
  • MMC
  • CutCopy

CutCopy Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | backgrnd.Cpp [code]
file | backgrnd.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/ Directory Reference

  • SysMgmt
  • MMC
  • Extens

Extens Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | extend.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/ Directory Reference

  • SysMgmt
  • MMC
  • Help

Help Directory Reference

Directories

directory | Help source

Files

file | About.Cpp [code]
file | About.h [code]
file | BaseSnap.Cpp [code]
file | BaseSnap.h [code]
file | Comp.Cpp [code]
file | Comp.h [code]
file | CompData.Cpp [code]
file | CompData.h [code]
file | Dataobj.Cpp [code]
file | Dataobj.h [code]
file | deleBase.Cpp [code]
file | deleBase.h [code]
file | Globals.h [code]
file | Guids.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | Registry.Cpp [code]
file | Registry.h [code]
file | Resource.h [code]
file | StatNode.Cpp [code]
file | StatNode.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/Help source/ Directory Reference

  • SysMgmt
  • MMC
  • Help
  • Help source

Help source Directory Reference

Files

file mmcsample.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/ Directory Reference

  • SysMgmt
  • MMC
  • Menubtn

Menubtn Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0

mmc2.0 Directory Reference

Directories

directory | about
directory | contextmenu
directory | contextmenuex
directory | dragdrop
directory | help
directory | multisel
directory | proppage
directory | proppagex
directory | simple
directory | viewex
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • about

about Directory Reference

Files

file | about.cpp [code]
file | about.h [code]
file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

contextmenu Directory Reference

Files

file | about.cpp [code]
file | about.h [code]
file | adddevicedlg.cpp [code]
file | adddevicedlg.h [code]
file | basedialog.cpp [code]
file | basedialog.h [code]
file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | devicenode.cpp [code]
file | devicenode.h [code]
file | foldernode.cpp [code]
file | foldernode.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | llistimpl.cpp [code]
file | llistimpl.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

contextmenuex Directory Reference

Files

file | basesnap.cpp [code]
file | basesnap.h [code]
file | contextmenuex.cpp [code]
file | contextmenuex.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

dragdrop Directory Reference

Files

file | about.cpp [code]
file | about.h [code]
file | adddevicedlg.cpp [code]
file | adddevicedlg.h [code]
file | addvfiledlg.cpp [code]
file | addvfiledlg.h [code]
file | basedialog.cpp [code]
file | basedialog.h [code]
file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | devicenode.cpp [code]
file | devicenode.h [code]
file | enumformatetc.cpp [code]
file | enumformatetc.h [code]
file | foldernode.cpp [code]
file | foldernode.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | llistimpl.cpp [code]
file | llistimpl.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
file | virtualfile.cpp [code]
file | virtualfile.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • help

help Directory Reference

Files

file | about.cpp [code]
file | about.h [code]
file | adddevicedlg.cpp [code]
file | adddevicedlg.h [code]
file | addvfiledlg.cpp [code]
file | addvfiledlg.h [code]
file | basedialog.cpp [code]
file | basedialog.h [code]
file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | devicenode.cpp [code]
file | devicenode.h [code]
file | foldernode.cpp [code]
file | foldernode.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | llistimpl.cpp [code]
file | llistimpl.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
file | virtualfile.cpp [code]
file | virtualfile.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

multisel Directory Reference

Files

file | about.cpp [code]
file | about.h [code]
file | adddevicedlg.cpp [code]
file | adddevicedlg.h [code]
file | ADDFolderdlg.cpp [code]
file | addfolderdlg.h [code]
file | addvfiledlg.cpp [code]
file | addvfiledlg.h [code]
file | basedialog.cpp [code]
file | basedialog.h [code]
file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | devicenode.cpp [code]
file | devicenode.h [code]
file | foldernode.cpp [code]
file | foldernode.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | llistimpl.cpp [code]
file | llistimpl.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
file | virtualfile.cpp [code]
file | virtualfile.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

proppage Directory Reference

Files

file | about.cpp [code]
file | about.h [code]
file | adddevicedlg.cpp [code]
file | adddevicedlg.h [code]
file | addvfiledlg.cpp [code]
file | addvfiledlg.h [code]
file | basedialog.cpp [code]
file | basedialog.h [code]
file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | devicenode.cpp [code]
file | devicenode.h [code]
file | foldernode.cpp [code]
file | foldernode.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | llistimpl.cpp [code]
file | llistimpl.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
file | virtualfile.cpp [code]
file | virtualfile.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppagex/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • proppagex

proppagex Directory Reference

Files

file | basesnap.cpp [code]
file | basesnap.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | proppagex.cpp [code]
file | proppagex.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

simple Directory Reference

Files

file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/ Directory Reference

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

viewex Directory Reference

Files

file | about.cpp [code]
file | about.h [code]
file | adddevicedlg.cpp [code]
file | adddevicedlg.h [code]
file | addvfiledlg.cpp [code]
file | addvfiledlg.h [code]
file | basedialog.cpp [code]
file | basedialog.h [code]
file | basenode.h [code]
file | basesnap.cpp [code]
file | basesnap.h [code]
file | comp.cpp [code]
file | comp.h [code]
file | compdata.cpp [code]
file | compdata.h [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | devicenode.cpp [code]
file | devicenode.h [code]
file | foldernode.cpp [code]
file | foldernode.h [code]
file | globals.cpp [code]
file | globals.h [code]
file | guids.h [code]
file | llistimpl.cpp [code]
file | llistimpl.h [code]
file | registry.cpp [code]
file | registry.h [code]
file | resource.h [code]
file | scripts.h [code]
file | staticnode.cpp [code]
file | staticnode.h [code]
file | tracemacro.cpp [code]
file | tracemacro.h [code]
file | virtualfile.cpp [code]
file | virtualfile.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/ Directory Reference

  • SysMgmt
  • MMC
  • Multisel

Multisel Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | backgrnd.Cpp [code]
file | backgrnd.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/ Directory Reference

  • SysMgmt
  • MMC
  • Nameext

Nameext Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | extend.h [code]
file | globals.h [code]
file | guids.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | nameext.Cpp [code]
file | nameext.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/ Directory Reference

  • SysMgmt
  • MMC
  • Nodes

Nodes Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | backgrnd.Cpp [code]
file | backgrnd.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/ Directory Reference

  • SysMgmt
  • MMC
  • Openserv

Openserv Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/ Directory Reference

  • SysMgmt
  • MMC
  • Ppgeext

Ppgeext Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | extend.h [code]
file | globals.h [code]
file | guids.h [code]
file | localres.h [code]
file | ppgeext.Cpp [code]
file | ppgeext.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/ Directory Reference

  • SysMgmt
  • MMC
  • Proppage

Proppage Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/ Directory Reference

  • SysMgmt
  • MMC
  • Simple

Simple Directory Reference

Files

file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/ Directory Reference

  • SysMgmt
  • MMC
  • Taskpads

Taskpads Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | enumtask.Cpp [code]
file | enumtask.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/ Directory Reference

  • SysMgmt
  • MMC
  • Tbarext

Tbarext Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | extend.h [code]
file | globals.h [code]
file | guids.h [code]
file | localres.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | tbarext.Cpp [code]
file | tbarext.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/ Directory Reference

  • SysMgmt
  • MMC
  • Toolbar

Toolbar Directory Reference

Directories

directory | Help source

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/Help source/ Directory Reference

  • SysMgmt
  • MMC
  • Toolbar
  • Help source

Help source Directory Reference

Files

file mmcsample.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/ Directory Reference

  • SysMgmt
  • MMC
  • WMI

WMI Directory Reference

Files

file | about.Cpp [code]
file | about.h [code]
file | basesnap.Cpp [code]
file | basesnap.h [code]
file | comp.Cpp [code]
file | comp.h [code]
file | compdata.Cpp [code]
file | compdata.h [code]
file | dataobj.Cpp [code]
file | dataobj.h [code]
file | delebase.Cpp [code]
file | delebase.h [code]
file | globals.h [code]
file | guids.h [code]
file | land.Cpp [code]
file | land.h [code]
file | localres.h [code]
file | mmccrack.Cpp [code]
file | people.Cpp [code]
file | people.h [code]
file | registry.Cpp [code]
file | registry.h [code]
file | resource.h [code]
file | simplearray.h [code]
file | sky.Cpp [code]
file | sky.h [code]
file | space.Cpp [code]
file | space.h [code]
file | statnode.Cpp [code]
file | statnode.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/ Directory Reference

  • SysMgmt
  • Msi

Msi Directory Reference

Directories

directory | create.dll
directory | msiloc
directory | msistuff
directory | process.dll
directory | remove.dll
directory | setup.exe
directory | tutorial.dll
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/create.dll/ Directory Reference

  • SysMgmt
  • Msi
  • create.dll

create.dll Directory Reference

Files

file Create.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/msiloc/ Directory Reference

  • SysMgmt
  • Msi
  • msiloc

msiloc Directory Reference

Files

file msiloc.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/msistuff/ Directory Reference

  • SysMgmt
  • Msi
  • msistuff

msistuff Directory Reference

Files

file msistuff.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/process.dll/ Directory Reference

  • SysMgmt
  • Msi
  • process.dll

process.dll Directory Reference

Files

file Process.cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/remove.dll/ Directory Reference

  • SysMgmt
  • Msi
  • remove.dll

remove.dll Directory Reference

Files

file Remove.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/setup.exe/ Directory Reference

  • SysMgmt
  • Msi
  • setup.exe

setup.exe Directory Reference

Files

file | common.h [code]
file | resource.h [code]
file | setup.cpp [code]
file | setup.h [code]
file | setupui.cpp [code]
file | setupui.h [code]
file | upgrdmsi.cpp [code]
file | utils.cpp [code]
file | vertrust.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/tutorial.dll/ Directory Reference

  • SysMgmt
  • Msi
  • tutorial.dll

tutorial.dll Directory Reference

Files

file Tutorial.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/TaskSched/ Directory Reference

  • SysMgmt
  • TaskSched

TaskSched Directory Reference

Files

file sa.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/ Directory Reference

  • SysMgmt
  • WMI

WMI Directory Reference

Directories

directory VC
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/ Directory Reference

  • SysMgmt
  • WMI
  • VC

VC Directory Reference

Directories

directory | AdvClient
directory | ClassProv
directory | CmdLineConsumer
directory | decoupled
directory | EventConsumer
directory | EventProvider
directory | FrameworkProv
directory | HiPerfClient
directory | HiPerfProvider
directory | InstProv
directory | MethCli
directory | MethProv
directory | pathparser
directory | PropProv
directory | queryparser
directory | security
directory | SimpleClient
directory | TempConsumer
directory | UtilLib
directory | WMIDiskPerf
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • AdvClient

AdvClient Directory Reference

Files

file | AdvClient.cpp [code]
file | AdvClient.h [code]
file | AdvClientdlg.cpp [code]
file | AdvClientdlg.h [code]
file | officedlg.cpp [code]
file | officedlg.h [code]
file | onaddequipment.cpp [code]
file | onasync.cpp [code]
file | OnAsync.h [code]
file | onconnect.cpp [code]
file | ondiskdetails.cpp [code]
file | OnDiskPropsDescriptions.cpp [code]
file | onenumdisks.cpp [code]
file | onenumsvcs.cpp [code]
file | onperm.cpp [code]
file | onregister.cpp [code]
file | ontemp.cpp [code]
file | resource.h [code]
file | stdafx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/ClassProv/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • ClassProv

ClassProv Directory Reference

Files

file | ClassFac.Cpp [code]
file | ClassProv.Cpp [code]
file | MainDll.Cpp [code]
file | Sample.h [code]
file | Utils.Cpp [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

CmdLineConsumer Directory Reference

Files

file | CmdLineConsumer.Cpp [code]
file | CmdLineConsumer.h [code]
file | CmdLineConsumerDlg.Cpp [code]
file | CmdLineConsumerDlg.h [code]
file | Consumer.Cpp [code]
file | Consumer.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | Provider.Cpp [code]
file | Provider.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • decoupled

decoupled Directory Reference

Directories

directory | Event_Consumer
directory | Event_Provider
directory | Instance_Provider
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Consumer/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Consumer

Event_Consumer Directory Reference

Directories

directory | Include

Files

file | Events.cpp [code]
file | Globals.cpp [code]
file | Main.cpp [code]
file | PreComp.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Consumer/Include/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Consumer
  • Include

Include Directory Reference

Files

file | Events.h [code]
file | Globals.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Provider/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Provider

Event_Provider Directory Reference

Directories

directory | Include

Files

file | Events.cpp [code]
file | Globals.cpp [code]
file | Main.cpp [code]
file | PreComp.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Provider/Include/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Provider
  • Include

Include Directory Reference

Files

file | Events.h [code]
file | Globals.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Instance_Provider/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Instance_Provider

Instance_Provider Directory Reference

Directories

directory | Include

Files

file | Globals.cpp [code]
file | Main.cpp [code]
file | PreComp.h [code]
file | Service.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Instance_Provider/Include/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Instance_Provider
  • Include

Include Directory Reference

Files

file | Globals.h [code]
file | Resource.h [code]
file | Service.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

EventConsumer Directory Reference

Files

file | Consumer.Cpp [code]
file | Consumer.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | PermEvents.Cpp [code]
file | PermEvents.h [code]
file | PermEventsdlg.Cpp [code]
file | PermEventsdlg.h [code]
file | Provider.Cpp [code]
file | Provider.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventProvider/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • EventProvider

EventProvider Directory Reference

Files

file | EvProv.Cpp [code]
file | EvProv.h [code]
file | OaHelp.Inl [code]
file | OleSrvr.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/FrameworkProv/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • FrameworkProv

FrameworkProv Directory Reference

Files

file | FrameworkProv.Cpp [code]
file | FrameworkProv.h [code]
file | MainDll.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/HiPerfClient/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • HiPerfClient

HiPerfClient Directory Reference

Files

file | RefClint.Cpp [code]
file | RefClint.h [code]
file | SamplCli.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/HiPerfProvider/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • HiPerfProvider

HiPerfProvider Directory Reference

Files

file | BasicHiPerf.Cpp [code]
file | BasicHiPerf.h [code]
file | Factory.Cpp [code]
file | Factory.h [code]
file | Server.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/InstProv/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • InstProv

InstProv Directory Reference

Files

file | ClassFac.Cpp [code]
file | InstProv.Cpp [code]
file | MainDll.Cpp [code]
file | Sample.h [code]
file | Utils.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/MethCli/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • MethCli

MethCli Directory Reference

Files

file MethCli.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/MethProv/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • MethProv

MethProv Directory Reference

Files

file | ClassFac.Cpp [code]
file | MainDll.Cpp [code]
file | MethProv.Cpp [code]
file | MethProv.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/pathparser/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • pathparser

pathparser Directory Reference

Files

file PathParser.cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/PropProv/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • PropProv

PropProv Directory Reference

Files

file | ClassFac.Cpp [code]
file | MainDll.Cpp [code]
file | PropProv.Cpp [code]
file | Sample.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/queryparser/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • queryparser

queryparser Directory Reference

Files

file QueryParser.cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/security/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • security

security Directory Reference

Files

file security.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/SimpleClient/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • SimpleClient

SimpleClient Directory Reference

Files

file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | WbemClient.Cpp [code]
file | WbemClient.h [code]
file | WbemClientDlg.Cpp [code]
file | WbemClientDlg.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/TempConsumer/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • TempConsumer

TempConsumer Directory Reference

Files

file | Consumer.Cpp [code]
file | OaHelp.Inl [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/UtilLib/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • UtilLib

UtilLib Directory Reference

Files

file | PreComp.h [code]
file | UtilLib.h [code]
file | Utils.Cpp [code]
file | WbemSec.Cpp [code]
file | WbemSec.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/WMIDiskPerf/ Directory Reference

  • SysMgmt
  • WMI
  • VC
  • WMIDiskPerf

WMIDiskPerf Directory Reference

Files

file | DpDetail.Cpp [code]
file | WMIDiskPerf.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/ Directory Reference

  • TabletPC

TabletPC Directory Reference

Directories

directory | AdvReco
directory | AutoClaims
directory | AutoClaims15
directory | AutoClaims_WebControl
directory | BasicRecognition
directory | EventSink
directory | InkBlog
directory | InkClipboard
directory | InkCollection
directory | InkCollection_RTS
directory | InkDivider
directory | InkErase
directory | InkHitTest
directory | InkRecognition
directory | InkZoom
directory | MultiReco
directory | RealTimeStylusPlugin
directory | RecoDLL
directory | ScannedPaperForm
directory | Serialization
directory | TPCInfo
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AdvReco/ Directory Reference

  • TabletPC
  • AdvReco

AdvReco Directory Reference

Files

file | AdvReco.cpp [code]
file | AdvReco.h [code]
file | ChildWnds.cpp [code]
file | ChildWnds.h [code]
file | EventSinks.h [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims/ Directory Reference

  • TabletPC
  • AutoClaims

AutoClaims Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims/C#/ Directory Reference

  • TabletPC
  • AutoClaims
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | AutoClaims.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims15/ Directory Reference

  • TabletPC
  • AutoClaims15

AutoClaims15 Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims15/C#/ Directory Reference

  • TabletPC
  • AutoClaims15
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | AutoClaims.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims_WebControl/ Directory Reference

  • TabletPC
  • AutoClaims_WebControl

AutoClaims_WebControl Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims_WebControl/C#/ Directory Reference

  • TabletPC
  • AutoClaims_WebControl
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | AutoClaims.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/BasicRecognition/ Directory Reference

  • TabletPC
  • BasicRecognition

BasicRecognition Directory Reference

Files

file | BasicRecognition.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/EventSink/ Directory Reference

  • TabletPC
  • EventSink

EventSink Directory Reference

Files

file | EventSink.cpp [code]
file | EventSink.h [code]
file | Resource.h [code]
file | TpcConpt.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkBlog/ Directory Reference

  • TabletPC
  • InkBlog

InkBlog Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkBlog/C#/ Directory Reference

  • TabletPC
  • InkBlog
  • C#

C# Directory Reference

Files

file | AddBlog.aspx.cs [code]
file | AssemblyInfo.cs [code]
file | Default.aspx.cs [code]
file | InkArea.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkClipboard/ Directory Reference

  • TabletPC
  • InkClipboard

InkClipboard Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkClipboard.cs [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkCollection/ Directory Reference

  • TabletPC
  • InkCollection

InkCollection Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkCollection/C#/ Directory Reference

  • TabletPC
  • InkCollection
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkCollection.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkCollection_RTS/ Directory Reference

  • TabletPC
  • InkCollection_RTS

InkCollection_RTS Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkCollection_RTS/C#/ Directory Reference

  • TabletPC
  • InkCollection_RTS
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkCollection.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkDivider/ Directory Reference

  • TabletPC
  • InkDivider

InkDivider Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkDivider/C#/ Directory Reference

  • TabletPC
  • InkDivider
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkDividerForm.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkErase/ Directory Reference

  • TabletPC
  • InkErase

InkErase Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkErase/C#/ Directory Reference

  • TabletPC
  • InkErase
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkErase.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkHitTest/ Directory Reference

  • TabletPC
  • InkHitTest

InkHitTest Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkHitTest.cs [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkRecognition/ Directory Reference

  • TabletPC
  • InkRecognition

InkRecognition Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkRecognition/C#/ Directory Reference

  • TabletPC
  • InkRecognition
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkRecognition.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkZoom/ Directory Reference

  • TabletPC
  • InkZoom

InkZoom Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkZoom/C#/ Directory Reference

  • TabletPC
  • InkZoom
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | InkZoom.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/MultiReco/ Directory Reference

  • TabletPC
  • MultiReco

MultiReco Directory Reference

Files

file | ChildWnds.cpp [code]
file | ChildWnds.h [code]
file | EventSinks.h [code]
file | MultiReco.cpp [code]
file | MultiReco.h [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/RealTimeStylusPlugin/ Directory Reference

  • TabletPC
  • RealTimeStylusPlugin

RealTimeStylusPlugin Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/RealTimeStylusPlugin/C#/ Directory Reference

  • TabletPC
  • RealTimeStylusPlugin
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | CustomDynamicRendererPlugin.cs [code]
file | PacketFilterPlugin.cs [code]
file | RealTimeStylusPluginApp.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/RecoDLL/ Directory Reference

  • TabletPC
  • RecoDLL

RecoDLL Directory Reference

Files

file | RecoDll.cpp [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/ScannedPaperForm/ Directory Reference

  • TabletPC
  • ScannedPaperForm

ScannedPaperForm Directory Reference

Directories

directory C#
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/ScannedPaperForm/C#/ Directory Reference

  • TabletPC
  • ScannedPaperForm
  • C#

C# Directory Reference

Files

file | AssemblyInfo.cs [code]
file | PaperForm.cs [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/Serialization/ Directory Reference

  • TabletPC
  • Serialization

Serialization Directory Reference

Files

file | AssemblyInfo.cs [code]
file | Serialization.cs [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/TPCInfo/ Directory Reference

  • TabletPC
  • TPCInfo

TPCInfo Directory Reference

Files

file | resource.h [code]
file | TPCInfo.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: UDDI/ Directory Reference

  • UDDI

UDDI Directory Reference

Directories

directory | publish
directory | wsdldiscovery
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: UDDI/publish/ Directory Reference

  • UDDI
  • publish

publish Directory Reference

Files

file | AssemblyInfo.cs [code]
file | publish.cs [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: UDDI/wsdldiscovery/ Directory Reference

  • UDDI
  • wsdldiscovery

wsdldiscovery Directory Reference

Directories

directory | controls

Files

file | AssemblyInfo.cs [code]
file | main.cs [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: UDDI/wsdldiscovery/controls/ Directory Reference

  • UDDI
  • wsdldiscovery
  • controls

controls Directory Reference

Files

file categorytree.cs [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/ Directory Reference

  • Web

Web Directory Reference

Directories

directory | bits
directory | Browser
directory | dxtrans
directory | iis
directory | MSAgent
directory | NetMeeting
directory | networking
directory | winhttp
directory | xml
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/ Directory Reference

  • Web
  • bits

bits Directory Reference

Directories

directory | bits_ie
directory | Upload
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/bits_ie/ Directory Reference

  • Web
  • bits
  • bits_ie

bits_ie Directory Reference

Files

file | bits_ie.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/Upload/ Directory Reference

  • Web
  • bits
  • Upload

Upload Directory Reference

Files

file | cdialog.cpp [code]
file | cdialog.h [code]
file | cmonitor.cpp [code]
file | cmonitor.h [code]
file | cpack.cpp [code]
file | cpack.h [code]
file | main.cpp [code]
file | main.h [code]
file | resource.h [code]
file | util.cpp [code]
file | util.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/ Directory Reference

  • Web
  • Browser

Browser Directory Reference

Directories

directory | BrochureMachine
directory | EdAnnotator
directory | EditCommands
directory | EditFeatures
directory | EditGlyphs
directory | EditHost
directory | RenderBehave
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/BrochureMachine/ Directory Reference

  • Web
  • Browser
  • BrochureMachine

BrochureMachine Directory Reference

Files

file | BrochureMachine.cpp [code]
file | BrochureMachine.idl [code]
file | BrochureMachine_p.c [code]
file | dlldata.c [code]
file | PTLauncher.cpp [code]
file | PTLauncher.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EdAnnotator/ Directory Reference

  • Web
  • Browser
  • EdAnnotator

EdAnnotator Directory Reference

Directories

directory AnnotatorProject
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EdAnnotator/AnnotatorProject/ Directory Reference

  • Web
  • Browser
  • EdAnnotator
  • AnnotatorProject

AnnotatorProject Directory Reference

Files

file | Annotator.cpp [code]
file | Annotator.h [code]
file | dlldata.c [code]
file | EDAnnotator.cpp [code]
file | EDAnnotator.idl [code]
file | EDAnnotator_p.c [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditCommands/ Directory Reference

  • Web
  • Browser
  • EditCommands

EditCommands Directory Reference

Files

file | BrowserHost.cpp [code]
file | BrowserHost.h [code]
file | dlldata.c [code]
file | EdCommands.cpp [code]
file | EdCommands.idl [code]
file | EdCommands_p.c [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/ Directory Reference

  • Web
  • Browser
  • EditFeatures

EditFeatures Directory Reference

Files

file | BrowserHost.cpp [code]
file | BrowserHost.h [code]
file | dlldata.c [code]
file | EdCommands.cpp [code]
file | EdCommands.idl [code]
file | EdCommands_p.c [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/ Directory Reference

  • Web
  • Browser
  • EditGlyphs

EditGlyphs Directory Reference

Files

file | BrowserHost.cpp [code]
file | BrowserHost.h [code]
file | dlldata.c [code]
file | EdGlyphs.cpp [code]
file | EdGlyphs.idl [code]
file | EdGlyphs_p.c [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditHost/ Directory Reference

  • Web
  • Browser
  • EditHost

EditHost Directory Reference

Files

file | BrowserHost.cpp [code]
file | BrowserHost.h [code]
file | dlldata.c [code]
file | EdHost.cpp [code]
file | EdHost.idl [code]
file | EdHost_p.c [code]
file | Grid.cpp [code]
file | Grid.h [code]
file | resource.h [code]
file | Snap.cpp [code]
file | Snap.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/ Directory Reference

  • Web
  • Browser
  • RenderBehave

RenderBehave Directory Reference

Directories

directory renderproject
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/ Directory Reference

  • Web
  • Browser
  • RenderBehave
  • renderproject

renderproject Directory Reference

Files

file | Behavior.cpp [code]
file | Behavior.h [code]
file | Dlldata.c [code]
file | EventSink.cpp [code]
file | EventSink.h [code]
file | Factory.cpp [code]
file | Factory.h [code]
file | Render.cpp [code]
file | Render.idl [code]
file | Render_p.c [code]
file | Resource.h [code]
file | Stdafx.cpp [code]
file | Stdafx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/dxtrans/ Directory Reference

  • Web
  • dxtrans

dxtrans Directory Reference

Directories

directory | dxsurf1
directory | dxsurf2
directory | dxsurf3
directory | dxsurfmod
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/dxtrans/dxsurf1/ Directory Reference

  • Web
  • dxtrans
  • dxsurf1

dxsurf1 Directory Reference

Files

file | dxsurf1.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/dxtrans/dxsurf2/ Directory Reference

  • Web
  • dxtrans
  • dxsurf2

dxsurf2 Directory Reference

Files

file | dxsurf2.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/dxtrans/dxsurf3/ Directory Reference

  • Web
  • dxtrans
  • dxsurf3

dxsurf3 Directory Reference

Files

file | dxsurf3.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/dxtrans/dxsurfmod/ Directory Reference

  • Web
  • dxtrans
  • dxsurfmod

dxsurfmod Directory Reference

Files

file | main.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ Directory Reference

  • Web
  • iis

iis Directory Reference

Directories

directory | Components
directory | extensions
directory | filters
directory | ISAPI_6.0
directory | progadmin
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/ Directory Reference

  • Web
  • iis
  • Components

Components Directory Reference

Directories

directory Cpp
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/ Directory Reference

  • Web
  • iis
  • Components
  • Cpp

Cpp Directory Reference

Directories

directory | Intermediate
directory | MTXSample
directory | Simple
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Intermediate/ Directory Reference

  • Web
  • iis
  • Components
  • Cpp
  • Intermediate

Intermediate Directory Reference

Files

file | Catlpwr.Cpp [code]
file | Catlpwr.Idl [code]
file | Context.Cpp [code]
file | Context.h [code]
file | Power.Cpp [code]
file | Power.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/MTXSample/ Directory Reference

  • Web
  • iis
  • Components
  • Cpp
  • MTXSample

MTXSample Directory Reference

Files

file | Account.cpp [code]
file | Account.h [code]
file | BankVC.cpp [code]
file | BankVC.idl [code]
file | CreateTable.cpp [code]
file | CreateTable.h [code]
file | MoveMoney.cpp [code]
file | MoveMoney.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Simple/ Directory Reference

  • Web
  • iis
  • Components
  • Cpp
  • Simple

Simple Directory Reference

Files

file | CatlSmpl.Cpp [code]
file | CatlSmpl.Idl [code]
file | Resource.h [code]
file | Simple.Cpp [code]
file | Simple.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/ Directory Reference

  • Web
  • iis
  • extensions

extensions Directory Reference

Directories

directory | Chunk
directory | DumpVars
directory | Formdump
directory | InvokObjThreads
directory | io
directory | Keep-Alive
directory | KeepAliveWithThreads
directory | Redirect
directory | Simple
directory | WorkerThread
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Chunk/ Directory Reference

  • Web
  • iis
  • extensions
  • Chunk

Chunk Directory Reference

Files

file | cte_enc.c [code]
file | ctetest.c [code]
file | ctetest.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/DumpVars/ Directory Reference

  • Web
  • iis
  • extensions
  • DumpVars

DumpVars Directory Reference

Files

file DumpVars.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Formdump/ Directory Reference

  • Web
  • iis
  • extensions
  • Formdump

Formdump Directory Reference

Files

file | formdump.cpp [code]
file | html.cpp [code]
file | html.h [code]
file | keys.cpp [code]
file | keys.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/InvokObjThreads/ Directory Reference

  • Web
  • iis
  • extensions
  • InvokObjThreads

InvokObjThreads Directory Reference

Files

file | InvokObjThreads.cpp [code]
file | IsapiThread.cpp [code]
file | IsapiThread.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ Directory Reference

  • Web
  • iis
  • extensions
  • io

io Directory Reference

Directories

directory | ASyncRead
directory | ASyncTrans
directory | ASyncWrite
directory | SyncRead
directory | SyncWrite
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ASyncRead/ Directory Reference

  • Web
  • iis
  • extensions
  • io
  • ASyncRead

ASyncRead Directory Reference

Files

file areadcli.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ASyncTrans/ Directory Reference

  • Web
  • iis
  • extensions
  • io
  • ASyncTrans

ASyncTrans Directory Reference

Files

file | ftrans.c [code]
file | openf.c [code]
file | openf.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ASyncWrite/ Directory Reference

  • Web
  • iis
  • extensions
  • io
  • ASyncWrite

ASyncWrite Directory Reference

Files

file | fwasync.c [code]
file | openf.c [code]
file | openf.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/SyncRead/ Directory Reference

  • Web
  • iis
  • extensions
  • io
  • SyncRead

SyncRead Directory Reference

Files

file readcli.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/SyncWrite/ Directory Reference

  • Web
  • iis
  • extensions
  • io
  • SyncWrite

SyncWrite Directory Reference

Files

file | fwrite.c [code]
file | openf.c [code]
file | openf.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Keep-Alive/ Directory Reference

  • Web
  • iis
  • extensions
  • Keep-Alive

Keep-Alive Directory Reference

Files

file KeepAlive.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/KeepAliveWithThreads/ Directory Reference

  • Web
  • iis
  • extensions
  • KeepAliveWithThreads

KeepAliveWithThreads Directory Reference

Files

file | KeepAliveP.c [code]
file | ThreadPool.c [code]
file | ThreadPool.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Redirect/ Directory Reference

  • Web
  • iis
  • extensions
  • Redirect

Redirect Directory Reference

Files

file Redirect.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Simple/ Directory Reference

  • Web
  • iis
  • extensions
  • Simple

Simple Directory Reference

Files

file Simple.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/WorkerThread/ Directory Reference

  • Web
  • iis
  • extensions
  • WorkerThread

WorkerThread Directory Reference

Files

file WorkerThread.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/ Directory Reference

  • Web
  • iis
  • filters

filters Directory Reference

Directories

directory | AuthFilt
directory | UpCase
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/AuthFilt/ Directory Reference

  • Web
  • iis
  • filters
  • AuthFilt

AuthFilt Directory Reference

Files

file | AuthFilt.c [code]
file | AuthFilt.h [code]
file | cache.c [code]
file | db.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/UpCase/ Directory Reference

  • Web
  • iis
  • filters
  • UpCase

UpCase Directory Reference

Files

file UpCase.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0

ISAPI_6.0 Directory Reference

Directories

directory | CacheIsapi
directory | CustomAuth
directory | DumpRequestInfo
directory | HelloIsapi
directory | inc
directory | PoolWrap
directory | ReMapUrl
directory | src
directory | UpCaseMap
directory | WildCardMap

Files

file | Extension.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/CacheIsapi/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • CacheIsapi

CacheIsapi Directory Reference

Files

file CacheIsapi.cpp [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/CustomAuth/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • CustomAuth

CustomAuth Directory Reference

Files

file | CustomAuth.cpp [code]
file | CustomAuth.h [code]
file | Redir401.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/DumpRequestInfo/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • DumpRequestInfo

DumpRequestInfo Directory Reference

Files

file DumpRequestInfo.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/HelloIsapi/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • HelloIsapi

HelloIsapi Directory Reference

Files

file HelloIsapi.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/inc/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • inc

inc Directory Reference

Files

file | IsapiBuffer.h [code]
file | IsapiDebug.h [code]
file | IsapiExtension.h [code]
file | IsapiModule.h [code]
file | IsapiRequest.h [code]
file | IsapiString.h [code]
file | IsapiStringW.h [code]
file | IsapiTime.h [code]
file | IsapiTools.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/PoolWrap/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • PoolWrap

PoolWrap Directory Reference

Files

file | Extension.cpp [code]
file | PoolWrap.cpp [code]
file | PoolWrap.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/ReMapUrl/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • ReMapUrl

ReMapUrl Directory Reference

Files

file ReMapUrl.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/src/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • src

src Directory Reference

Files

file | IsapiBuffer.cpp [code]
file | IsapiDebug.cpp [code]
file | IsapiExtension.cpp [code]
file | IsapiModule.cpp [code]
file | IsapiRequest.cpp [code]
file | IsapiString.cpp [code]
file | IsapiStringW.cpp [code]
file | IsapiTime.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/UpCaseMap/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • UpCaseMap

UpCaseMap Directory Reference

Files

file UpCaseMap.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/WildCardMap/ Directory Reference

  • Web
  • iis
  • ISAPI_6.0
  • WildCardMap

WildCardMap Directory Reference

Files

file WildCardMap.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/progadmin/ Directory Reference

  • Web
  • iis
  • progadmin

progadmin Directory Reference

Directories

directory ABO
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/progadmin/ABO/ Directory Reference

  • Web
  • iis
  • progadmin
  • ABO

ABO Directory Reference

Directories

directory EnumerateKeys
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/progadmin/ABO/EnumerateKeys/ Directory Reference

  • Web
  • iis
  • progadmin
  • ABO
  • EnumerateKeys

EnumerateKeys Directory Reference

Files

file EnumerateKeys.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/ Directory Reference

  • Web
  • MSAgent

MSAgent Directory Reference

Directories

directory | c
directory | Java
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/ Directory Reference

  • Web
  • MSAgent
  • c

c Directory Reference

Directories

directory | Cap
directory | CapMFC
directory | Hello
directory | Hello2
directory | Hello3
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/ Directory Reference

  • Web
  • MSAgent
  • c
  • Cap

Cap Directory Reference

Files

file | About.Cpp [code]
file | About.h [code]
file | Cap.Cpp [code]
file | Error.Cpp [code]
file | Error.h [code]
file | MainDlg.Cpp [code]
file | MainDlg.h [code]
file | Notify.Cpp [code]
file | Notify.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | StrConv.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/ Directory Reference

  • Web
  • MSAgent
  • c
  • CapMFC

CapMFC Directory Reference

Files

file | AcAnim.Cpp [code]
file | AcAnim.h [code]
file | AcAudio.Cpp [code]
file | AcAudio.h [code]
file | AcBall.Cpp [code]
file | AcBall.h [code]
file | AcChar.Cpp [code]
file | AcChar.h [code]
file | AcChars.Cpp [code]
file | AcChars.h [code]
file | AcComm.Cpp [code]
file | AcComm.h [code]
file | AcComms.Cpp [code]
file | AcComms.h [code]
file | Acex.Cpp [code]
file | Acex.h [code]
file | AcProp.Cpp [code]
file | AcProp.h [code]
file | AcReq.Cpp [code]
file | AcReq.h [code]
file | AcUser.Cpp [code]
file | AcUser.h [code]
file | CapMFC.Cpp [code]
file | CapMFC.h [code]
file | MainDlg.Cpp [code]
file | MainDlg.h [code]
file | Resource.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello/ Directory Reference

  • Web
  • MSAgent
  • c
  • Hello

Hello Directory Reference

Files

file Hello.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello2/ Directory Reference

  • Web
  • MSAgent
  • c
  • Hello2

Hello2 Directory Reference

Files

file | Hello2.Cpp [code]
file | Hello2.h [code]
file | Notify.Cpp [code]
file | Notify.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello3/ Directory Reference

  • Web
  • MSAgent
  • c
  • Hello3

Hello3 Directory Reference

Files

file | Hello3.Cpp [code]
file | Hello3.h [code]
file | Notify.Cpp [code]
file | Notify.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/ Directory Reference

  • Web
  • MSAgent
  • Java

Java Directory Reference

Directories

directory | CapJ
directory | Hello
directory | Hello2
directory | Hello3
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/CapJ/ Directory Reference

  • Web
  • MSAgent
  • Java
  • CapJ

CapJ Directory Reference

Files

file | about.java [code]
file | capj.java [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/Hello/ Directory Reference

  • Web
  • MSAgent
  • Java
  • Hello

Hello Directory Reference

Files

file HelloJ.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/Hello2/ Directory Reference

  • Web
  • MSAgent
  • Java
  • Hello2

Hello2 Directory Reference

Files

file | Hello2J.java [code]
file | notify.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/Hello3/ Directory Reference

  • Web
  • MSAgent
  • Java
  • Hello3

Hello3 Directory Reference

Files

file | Hello3J.java [code]
file | Notify.java [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/ Directory Reference

  • Web
  • NetMeeting

NetMeeting Directory Reference

Directories

directory | InstCodc
directory | NMChat
directory | NMChat2
directory | NMFT
directory | NMShare
directory | NMUI
directory | PlugTransport
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/InstCodc/ Directory Reference

  • Web
  • NetMeeting
  • InstCodc

InstCodc Directory Reference

Files

file | InstCodc.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/ Directory Reference

  • Web
  • NetMeeting
  • NMChat

NMChat Directory Reference

Files

file | CConf.Cpp [code]
file | CConf.h [code]
file | cData.Cpp [code]
file | cData.h [code]
file | clUtil.Cpp [code]
file | clUtil.h [code]
file | Cmd.Cpp [code]
file | cMemb.Cpp [code]
file | cMemb.h [code]
file | Debug.Cpp [code]
file | Global.h [code]
file | IMSConf2.Idl [code]
file | Main.Cpp [code]
file | Msg.Cpp [code]
file | PreComp.h [code]
file | Resource.h [code]
file | Util.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/ Directory Reference

  • Web
  • NetMeeting
  • NMChat2

NMChat2 Directory Reference

Files

file | applet.cpp [code]
file | applet.h [code]
file | conf.cpp [code]
file | conf.h [code]
file | iapplet.c [code]
file | iapplet.h [code]
file | iapplet.idl [code]
file | imsconf2.idl [code]
file | precomp.h [code]
file | resource.h [code]
file | session.cpp [code]
file | session.h [code]
file | ui.cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/ Directory Reference

  • Web
  • NetMeeting
  • NMFT

NMFT Directory Reference

Files

file | CConf.Cpp [code]
file | CConf.h [code]
file | clUtil.Cpp [code]
file | clUtil.h [code]
file | Debug.Cpp [code]
file | Global.h [code]
file | IMSConf2.Idl [code]
file | Main.Cpp [code]
file | Msg.Cpp [code]
file | PreComp.h [code]
file | Resource.h [code]
file | Util.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/ Directory Reference

  • Web
  • NetMeeting
  • NMShare

NMShare Directory Reference

Files

file | CConf.Cpp [code]
file | CConf.h [code]
file | chWnd.Cpp [code]
file | clUtil.Cpp [code]
file | clUtil.h [code]
file | Cmd.Cpp [code]
file | cMemb.Cpp [code]
file | cMemb.h [code]
file | cShare.Cpp [code]
file | cShare.h [code]
file | Debug.Cpp [code]
file | Global.h [code]
file | IMSConf2.Idl [code]
file | Main.Cpp [code]
file | Msg.Cpp [code]
file | PreComp.h [code]
file | Resource.h [code]
file | Util.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/ Directory Reference

  • Web
  • NetMeeting
  • NMUI

NMUI Directory Reference

Files

file | CCall.Cpp [code]
file | CCall.h [code]
file | CChan.Cpp [code]
file | CChan.h [code]
file | CConf.Cpp [code]
file | CConf.h [code]
file | cData.Cpp [code]
file | cData.h [code]
file | cft.cpp [code]
file | cft.h [code]
file | clUtil.Cpp [code]
file | clUtil.h [code]
file | Cmd.Cpp [code]
file | cMemb.Cpp [code]
file | cMemb.h [code]
file | cMgr.Cpp [code]
file | cMgr.h [code]
file | cshare.cpp [code]
file | cshare.h [code]
file | Debug.Cpp [code]
file | Dlg.Cpp [code]
file | Global.h [code]
file | IMSConf2.Idl [code]
file | Init.Cpp [code]
file | Main.Cpp [code]
file | Msg.Cpp [code]
file | PreComp.h [code]
file | Resource.h [code]
file | rtns.Cpp [code]
file | sBar.Cpp [code]
file | Util.Cpp [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/ Directory Reference

  • Web
  • NetMeeting
  • PlugTransport

PlugTransport Directory Reference

Files

file | imsconf3.idl [code]
file | iplgxprt.idl [code]
file | nmsession.cpp [code]
file | nmsession.h [code]
file | nullmdm.cpp [code]
file | nullmdm.h [code]
file | plugtransport.idl [code]
file | plugxprt.cpp [code]
file | plugxprt.h [code]
file | precomp.h [code]
file | resource.h [code]
file | ui.cpp [code]
file | utils.cpp [code]
file | utils.h [code]
file | x224.cpp [code]
file | x224.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/networking/ Directory Reference

  • Web
  • networking

networking Directory Reference

Directories

directory | asyncdemo
directory | ftpjr
directory | httpauth
directory | httpdump
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/networking/asyncdemo/ Directory Reference

  • Web
  • networking
  • asyncdemo

asyncdemo Directory Reference

Files

file | AsyncDemo.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/networking/ftpjr/ Directory Reference

  • Web
  • networking
  • ftpjr

ftpjr Directory Reference

Files

file FTPJr.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/networking/httpauth/ Directory Reference

  • Web
  • networking
  • httpauth

httpauth Directory Reference

Files

file httpauth.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/networking/httpdump/ Directory Reference

  • Web
  • networking
  • httpdump

httpdump Directory Reference

Files

file HeadDump.cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/ Directory Reference

  • Web
  • winhttp

winhttp Directory Reference

Directories

directory | asyncdemocomplete
directory | asyncdemotutorial
directory | retoptions
directory | setoptions
directory | WinHttpAsyncSample
directory | WinHttpFormSubmitSample
directory | WinHttpPostSample
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/asyncdemocomplete/ Directory Reference

  • Web
  • winhttp
  • asyncdemocomplete

asyncdemocomplete Directory Reference

Files

file | AsyncDemo.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/asyncdemotutorial/ Directory Reference

  • Web
  • winhttp
  • asyncdemotutorial

asyncdemotutorial Directory Reference

Files

file | AsyncDemo.cpp [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/retoptions/ Directory Reference

  • Web
  • winhttp
  • retoptions

retoptions Directory Reference

Files

file RetOptions.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/setoptions/ Directory Reference

  • Web
  • winhttp
  • setoptions

setoptions Directory Reference

Files

file SetOptions.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpAsyncSample/ Directory Reference

  • Web
  • winhttp
  • WinHttpAsyncSample

WinHttpAsyncSample Directory Reference

Files

file | browser.cpp [code]
file | browser.h [code]
file | defs.h [code]
file | SimpleBrowser.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpFormSubmitSample/ Directory Reference

  • Web
  • winhttp
  • WinHttpFormSubmitSample

WinHttpFormSubmitSample Directory Reference

Files

file WinHttpFormSubmitSample.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpPostSample/ Directory Reference

  • Web
  • winhttp
  • WinHttpPostSample

WinHttpPostSample Directory Reference

Files

file WinHttpPostSample.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/ Directory Reference

  • Web
  • xml

xml Directory Reference

Directories

directory mfc_tree
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/mfc_tree/ Directory Reference

  • Web
  • xml
  • mfc_tree

mfc_tree Directory Reference

Files

file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | XMLTree.cpp [code]
file | XMLTree.h [code]
file | XMLTreeDlg.cpp [code]
file | XMLTreeDlg.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/ Directory Reference

  • WinBase

WinBase Directory Reference

Directories

directory | Cluster
directory | Debug
directory | EventTrace
directory | Indexing
directory | IO
directory | IPC
directory | Registry
directory | Service
directory | WinNT
directory | WtsApi
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/ Directory Reference

  • WinBase
  • Cluster

Cluster Directory Reference

Directories

directory Win2003
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ Directory Reference

  • WinBase
  • Cluster
  • Win2003

Win2003 Directory Reference

Directories

directory | ClipBookServer
directory | FileShareSample
directory | MyCapabilities
directory | MyEvictListener
directory | MyMemberSetChangeListener
directory | MyStartupListener
directory | MyStorageResource
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer

ClipBookServer Directory Reference

Directories

directory | ClipBook Server
directory | ClipBook ServerEx
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

ClipBook Server Directory Reference

Files

file | ClipBook Server.cpp [code]
file | ClRes.cpp [code]
file | ClRes.h [code]
file | CMgdClusCfgInit.cpp [code]
file | CMgdClusCfgInit.h [code]
file | CMgdResType.cpp [code]
file | CMgdResType.h [code]
file | Guids.h [code]
file | MgdResource.idl [code]
file | Resource.h [code]
file | StringUtils.cpp [code]
file | StringUtils.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

ClipBook ServerEx Directory Reference

Files

file | BasePage.cpp [code]
file | BasePage.h [code]
file | ClipBook ServerEx.cpp [code]
file | ClipBook ServerEx.h [code]
file | DDxDDv.cpp [code]
file | DDxDDv.h [code]
file | ExtObj.cpp [code]
file | ExtObj.h [code]
file | ExtObjData.cpp [code]
file | ExtObjData.h [code]
file | ExtObjID.idl [code]
file | PropList.cpp [code]
file | PropList.h [code]
file | RegExt.cpp [code]
file | RegExt.h [code]
file | resource.h [code]
file | ResProp.cpp [code]
file | ResProp.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample

FileShareSample Directory Reference

Directories

directory | File Share Sample
directory | File Share SampleEx
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share Sample/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share Sample

File Share Sample Directory Reference

Files

file | ClRes.cpp [code]
file | ClRes.h [code]
file | File Share Sample.cpp [code]
file | StringUtils.cpp [code]
file | StringUtils.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

File Share SampleEx Directory Reference

Files

file | BasePage.cpp [code]
file | BasePage.h [code]
file | DDxDDv.cpp [code]
file | DDxDDv.h [code]
file | ExtObj.cpp [code]
file | ExtObj.h [code]
file | ExtObjData.cpp [code]
file | ExtObjData.h [code]
file | ExtObjID.idl [code]
file | File Share SampleEx.cpp [code]
file | File Share SampleEx.h [code]
file | PropList.cpp [code]
file | PropList.h [code]
file | RegExt.cpp [code]
file | RegExt.h [code]
file | resource.h [code]
file | ResProp.cpp [code]
file | ResProp.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyCapabilities/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • MyCapabilities

MyCapabilities Directory Reference

Files

file | Dll.cpp [code]
file | MyCapabilities.cpp [code]
file | MyCapabilities.h [code]
file | Resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyEvictListener/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • MyEvictListener

MyEvictListener Directory Reference

Files

file | dll.cpp [code]
file | MyEvictListener.cpp [code]
file | MyEvictListener.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyMemberSetChangeListener/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • MyMemberSetChangeListener

MyMemberSetChangeListener Directory Reference

Files

file | dll.cpp [code]
file | MyMemberSetChangeListener.cpp [code]
file | MyMemberSetChangeListener.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStartupListener/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • MyStartupListener

MyStartupListener Directory Reference

Files

file | Dll.cpp [code]
file | MyStartupListener.cpp [code]
file | MyStartupListener.h [code]
file | resource.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/ Directory Reference

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

MyStorageResource Directory Reference

Files

file | CClusterUtils.cpp [code]
file | CClusterUtils.h [code]
file | CEnumStorageResource.cpp [code]
file | CEnumStorageResource.h [code]
file | CMgdClusCfgInit.cpp [code]
file | CMgdClusCfgInit.h [code]
file | Common.h [code]
file | CPartitionInfo.cpp [code]
file | CPartitionInfo.h [code]
file | CStorageResource.cpp [code]
file | CStorageResource.h [code]
file | CStorageResType.cpp [code]
file | CStorageResType.h [code]
file | guids.h [code]
file | InsertionSort.h [code]
file | MyStorageResource.cpp [code]
file | MyStorageResource.idl [code]
file | PropList.cpp [code]
file | PropList.h [code]
file | resource.h [code]
file | SIndexedDisk.cpp [code]
file | SIndexedDisk.h [code]
file | StdAfx.cpp [code]
file | StdAfx.h [code]
file | StringUtils.cpp [code]
file | StringUtils.h [code]
file | WMIHelpers.cpp [code]
file | WMIHelpers.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/ Directory Reference

  • WinBase
  • Debug

Debug Directory Reference

Directories

directory | BPSamp
directory | dbh
directory | Deb
directory | DebugHandler
directory | eventlog
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/BPSamp/ Directory Reference

  • WinBase
  • Debug
  • BPSamp

BPSamp Directory Reference

Files

file | BPSamp.h [code]
file | BPSampTest.c [code]
file | DbgCmd.c [code]
file | Main.c [code]
file | Utils.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/dbh/ Directory Reference

  • WinBase
  • Debug
  • dbh

dbh Directory Reference

Files

file dbh.cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/ Directory Reference

  • WinBase
  • Debug
  • Deb

Deb Directory Reference

Files

file | Deb.h [code]
file | DebDebug.c [code]
file | DebDebug.h [code]
file | DebMain.c [code]
file | DebMain.h [code]
file | DebMisc.c [code]
file | DebMisc.h [code]
file | LinkList.c [code]
file | LinkList.h [code]
file | ToolBar.c [code]
file | ToolBar.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/DebugHandler/ Directory Reference

  • WinBase
  • Debug
  • DebugHandler

DebugHandler Directory Reference

Files

file DebugHandler.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/eventlog/ Directory Reference

  • WinBase
  • Debug
  • eventlog

eventlog Directory Reference

Files

file log.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/ Directory Reference

  • WinBase
  • EventTrace

EventTrace Directory Reference

Directories

directory | TraceDmp
directory | tracedp
directory | TraceLog
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceDmp/ Directory Reference

  • WinBase
  • EventTrace
  • TraceDmp

TraceDmp Directory Reference

Files

file | tracedmp.cpp [code]
file | tracedmp.h [code]
file | tracewmi.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/tracedp/ Directory Reference

  • WinBase
  • EventTrace
  • tracedp

tracedp Directory Reference

Files

file TraceDp.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceLog/ Directory Reference

  • WinBase
  • EventTrace
  • TraceLog

TraceLog Directory Reference

Files

file TraceLog.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/ Directory Reference

  • WinBase
  • Indexing

Indexing Directory Reference

Directories

directory | AdvQuery
directory | ChgState
directory | HtmlProp
directory | IFilter
directory | IISSearch
directory | lrsample
directory | Simple
directory | SmpFilt
directory | VJQuery
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/AdvQuery/ Directory Reference

  • WinBase
  • Indexing
  • AdvQuery

AdvQuery Directory Reference

Files

file | AdvQuery.Cxx [code]
file | DispTree.Cxx [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/ChgState/ Directory Reference

  • WinBase
  • Indexing
  • ChgState

ChgState Directory Reference

Files

file ChgState.Cxx [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/HtmlProp/ Directory Reference

  • WinBase
  • Indexing
  • HtmlProp

HtmlProp Directory Reference

Files

file | FiltReg.Hxx [code]
file | HtmlProp.Cxx [code]
file | HtmlProp.Hxx [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/ Directory Reference

  • WinBase
  • Indexing
  • IFilter

IFilter Directory Reference

Files

file | Anchor.Cxx [code]
file | Anchor.Hxx [code]
file | Assert.Cxx [code]
file | Bag.Cxx [code]
file | Bag.Hxx [code]
file | CharHash.Cxx [code]
file | CharHash.Hxx [code]
file | CodePage.Cxx [code]
file | CodePage.Hxx [code]
file | Debug.Hxx [code]
file | Except.Cxx [code]
file | Except.Hxx [code]
file | FiltReg.Hxx [code]
file | Global.Hxx [code]
file | HtmlElem.Cxx [code]
file | HtmlElem.Hxx [code]
file | HtmlFilt.Cxx [code]
file | HtmlFilt.Hxx [code]
file | HtmlGuid.Cxx [code]
file | HtmlGuid.Hxx [code]
file | HtmlIFlt.Cxx [code]
file | HtmlIFlt.Hxx [code]
file | HtmlScan.Cxx [code]
file | HtmlScan.Hxx [code]
file | ImageTag.Cxx [code]
file | ImageTag.Hxx [code]
file | InpStrm.Cxx [code]
file | InpStrm.Hxx [code]
file | InputTag.Cxx [code]
file | InputTag.Hxx [code]
file | Main.Cxx [code]
file | MetaTag.Cxx [code]
file | MetaTag.Hxx [code]
file | MMbuf.Cxx [code]
file | MMScBuf.Cxx [code]
file | MMScBuf.Hxx [code]
file | MMStrm.Cxx [code]
file | MMStrm.Hxx [code]
file | osv.Hxx [code]
file | Pch.Cxx [code]
file | PMMStrm.Hxx [code]
file | PropSpec.Cxx [code]
file | PropSpec.Hxx [code]
file | PropTag.Cxx [code]
file | PropTag.Hxx [code]
file | RegAcc32.Cxx [code]
file | RegAcc32.Hxx [code]
file | Register.Cxx [code]
file | ScripTag.Cxx [code]
file | ScripTag.Hxx [code]
file | SerStrm.Cxx [code]
file | SerStrm.Hxx [code]
file | Start.Cxx [code]
file | Start.Hxx [code]
file | TextElem.Cxx [code]
file | TextElem.Hxx [code]
file | TitleTag.Cxx [code]
file | TitleTag.Hxx [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IISSearch/ Directory Reference

  • WinBase
  • Indexing
  • IISSearch

IISSearch Directory Reference

Files

file | AdoVbs.Inc [code]
file | Is2Foot.Inc [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/ Directory Reference

  • WinBase
  • Indexing
  • lrsample

lrsample Directory Reference

Files

file | filtreg.hxx [code]
file | langreg.hxx [code]
file | lrsample.CXX [code]
file | lrsample.HXX [code]
file | minici.hxx [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/Simple/ Directory Reference

  • WinBase
  • Indexing
  • Simple

Simple Directory Reference

Files

file | DispTree.Cxx [code]
file | QSample.Cxx [code]
file | QSample.Hxx [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/SmpFilt/ Directory Reference

  • WinBase
  • Indexing
  • SmpFilt

SmpFilt Directory Reference

Files

file | FiltReg.Hxx [code]
file | SmpFilt.Cxx [code]
file | SmpFilt.Hxx [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/VJQuery/ Directory Reference

  • WinBase
  • Indexing
  • VJQuery

VJQuery Directory Reference

Files

file | Query.java [code]
file | VJQuery.java [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/ Directory Reference

  • WinBase
  • IO

IO Directory Reference

Directories

directory | AsyncIO
directory | DiskQuota
directory | DLEdit
directory | EnumMount
directory | EnumStreams
directory | FCopy
directory | Floppy
directory | Mount
directory | RSM
directory | UnBufCpy
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/AsyncIO/ Directory Reference

  • WinBase
  • IO
  • AsyncIO

AsyncIO Directory Reference

Files

file | AsyncIO.c [code]
file | AsyncIO.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/ Directory Reference

  • WinBase
  • IO
  • DiskQuota

DiskQuota Directory Reference

Files

file | Commands.Cpp [code]
file | Commands.h [code]
file | DskQuota.Cpp [code]
file | PrintMenu.Cpp [code]
file | PrintMenu.h [code]
file | ProcessMenu.Cpp [code]
file | ProcessMenu.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DLEdit/ Directory Reference

  • WinBase
  • IO
  • DLEdit

DLEdit Directory Reference

Files

file DLEdit.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumMount/ Directory Reference

  • WinBase
  • IO
  • EnumMount

EnumMount Directory Reference

Files

file EnumMountPoints.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumStreams/ Directory Reference

  • WinBase
  • IO
  • EnumStreams

EnumStreams Directory Reference

Files

file | EnumStreams.c [code]
file | FindStream.c [code]
file | FindStream.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/FCopy/ Directory Reference

  • WinBase
  • IO
  • FCopy

FCopy Directory Reference

Files

file FCopy.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/Floppy/ Directory Reference

  • WinBase
  • IO
  • Floppy

Floppy Directory Reference

Files

file Mfmt.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/Mount/ Directory Reference

  • WinBase
  • IO
  • Mount

Mount Directory Reference

Files

file | Mount.Cpp [code]
file | UnMount.Cpp [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/ Directory Reference

  • WinBase
  • IO
  • RSM

RSM Directory Reference

Directories

directory | app
directory | inc
directory | mll
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/app/ Directory Reference

  • WinBase
  • IO
  • RSM
  • app

app Directory Reference

Files

file | app.cpp [code]
file | app_utls.cpp [code]
file | stl_write.cpp [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/inc/ Directory Reference

  • WinBase
  • IO
  • RSM
  • inc

inc Directory Reference

Files

file stl.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/mll/ Directory Reference

  • WinBase
  • IO
  • RSM
  • mll

mll Directory Reference

Files

file | dllmain.cpp [code]
file | stl_mll.cpp [code]
file | stl_mll.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/UnBufCpy/ Directory Reference

  • WinBase
  • IO
  • UnBufCpy

UnBufCpy Directory Reference

Files

file | UnBufCp1.c [code]
file | UnBufCp2.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/ Directory Reference

  • WinBase
  • IPC

IPC Directory Reference

Directories

directory NamePipe
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/ Directory Reference

  • WinBase
  • IPC
  • NamePipe

NamePipe Directory Reference

Directories

directory | Console
directory | npClient
directory | NPServer
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/Console/ Directory Reference

  • WinBase
  • IPC
  • NamePipe
  • Console

Console Directory Reference

Files

file NmPipe.c [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/npClient/ Directory Reference

  • WinBase
  • IPC
  • NamePipe
  • npClient

npClient Directory Reference

Files

file | Client32.c [code]
file | Client32.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/NPServer/ Directory Reference

  • WinBase
  • IPC
  • NamePipe
  • NPServer

NPServer Directory Reference

Files

file | Server32.c [code]
file | Server32.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Registry/ Directory Reference

  • WinBase
  • Registry

Registry Directory Reference

Files

file | Monkey.c [code]
file | Monkey.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/ Directory Reference

  • WinBase
  • Service

Service Directory Reference

Files

file | Client.c [code]
file | Service.c [code]
file | Service.H [code]
file | Simple.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/ Directory Reference

  • WinBase
  • WinNT

WinNT Directory Reference

Directories

directory PerfTool
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool

PerfTool Directory Reference

Directories

directory | Pdh
directory | PerfDllS
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh

Pdh Directory Reference

Directories

directory | ProcList
directory | StatList
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/ProcList/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • ProcList

ProcList Directory Reference

Files

file ProcList.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList

StatList Directory Reference

Files

file | AboutDlg.c [code]
file | AboutDlg.h [code]
file | MainWnd.c [code]
file | MainWnd.h [code]
file | Resource.h [code]
file | StatList.c [code]
file | StatList.h [code]
file | WinUtils.c [code]
file | WinUtils.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS

PerfDllS Directory Reference

Directories

directory | AppMem
directory | LeakyBin
directory | PerfGen
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem

AppMem Directory Reference

Directories

directory | appDll
directory | Inc
directory | PerfDll
directory | pub
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/appDll/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • appDll

appDll Directory Reference

Files

file | AppMema.c [code]
file | AppMema.h [code]
file | DllInit.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/Inc/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • Inc

Inc Directory Reference

Files

file AppMemi.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll

PerfDll Directory Reference

Files

file | DataMem.c [code]
file | DataMem.h [code]
file | Perfmem.c [code]
file | Perfmsg.h [code]
file | PerfUtil.c [code]
file | PerfUtil.h [code]
file | ShareMem.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/pub/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • pub

pub Directory Reference

Files

file | AppMem.h [code]
file | MemCtrnm.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/LeakyBin/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • LeakyBin

LeakyBin Directory Reference

Files

file | LeakyBin.c [code]
file | LeakyBin.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/ Directory Reference

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen

PerfGen Directory Reference

Files

file | DataGen.c [code]
file | DataGen.h [code]
file | GenCtrnm.h [code]
file | Perfgen.c [code]
file | Perfmsg.h [code]
file | PerfUtil.c [code]
file | PerfUtil.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/ Directory Reference

  • WinBase
  • WtsApi

WtsApi Directory Reference

Directories

directory | TSSysInf
directory | Tst4Wts
directory | WtsApi
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/ Directory Reference

  • WinBase
  • WtsApi
  • TSSysInf

TSSysInf Directory Reference

Directories

directory | Client
directory | Inc
directory | Server
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/Client/ Directory Reference

  • WinBase
  • WtsApi
  • TSSysInf
  • Client

Client Directory Reference

Files

file SysInf_C.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/Inc/ Directory Reference

  • WinBase
  • WtsApi
  • TSSysInf
  • Inc

Inc Directory Reference

Files

file SysInfo.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/Server/ Directory Reference

  • WinBase
  • WtsApi
  • TSSysInf
  • Server

Server Directory Reference

Files

file SysInf_S.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/Tst4Wts/ Directory Reference

  • WinBase
  • WtsApi
  • Tst4Wts

Tst4Wts Directory Reference

Files

file Tst4Wts.c [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ Directory Reference

  • WinBase
  • WtsApi
  • WtsApi

WtsApi Directory Reference

Files

file | API.Cpp [code]
file | API.h [code]
file | APIDoc.Cpp [code]
file | APIDoc.h [code]
file | APIView.Cpp [code]
file | APIView.h [code]
file | MainFrm.Cpp [code]
file | MainFrm.h [code]
file | MessageDlg.Cpp [code]
file | MessageDlg.h [code]
file | ProcessDlg.Cpp [code]
file | ProcessDlg.h [code]
file | QueryDlg.Cpp [code]
file | QueryDlg.h [code]
file | Resource.h [code]
file | ServerDlg.Cpp [code]
file | ServerDlg.h [code]
file | SessionDlg.Cpp [code]
file | SessionDlg.h [code]
file | ShutdownDlg.Cpp [code]
file | ShutdownDlg.h [code]
file | StdAfx.Cpp [code]
file | StdAfx.h [code]
file | WaitDlg.Cpp [code]
file | WaitDlg.h [code]
file | WaitSystemDlg.Cpp [code]
file | WaitSystemDlg.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/ Directory Reference

  • WinUI

WinUI Directory Reference

Directories

directory | Clipboard
directory | CommDlg
directory | Controls
directory | Cursor
directory | fulldrag
directory | GlobalDev
directory | Input
directory | Menu
directory | obscure
directory | Resource
directory | sendto
directory | Shell
directory | tallmenu
directory | tsfapp
directory | TSFcase
directory | tsfcompart
directory | TSFmark
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Clipboard/ Directory Reference

  • WinUI
  • Clipboard

Clipboard Directory Reference

Files

file | ClipText.c [code]
file | ClipText.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/ Directory Reference

  • WinUI
  • CommDlg

CommDlg Directory Reference

Directories

directory | CDTest
directory | ComDlg32
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/ Directory Reference

  • WinUI
  • CommDlg
  • CDTest

CDTest Directory Reference

Files

file | CDTest.c [code]
file | CDTest.h [code]
file | Colors.c [code]
file | Colors.h [code]
file | DevMode.h [code]
file | DevNames.h [code]
file | Find.c [code]
file | Find.h [code]
file | Font.c [code]
file | Font.h [code]
file | LogFont.h [code]
file | Open.c [code]
file | Open.h [code]
file | Print.c [code]
file | Print.h [code]
file | Replace.c [code]
file | Replace.h [code]
file | Save.c [code]
file | Save.h [code]
file | Title.c [code]
file | Title.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/ComDlg32/ Directory Reference

  • WinUI
  • CommDlg
  • ComDlg32

ComDlg32 Directory Reference

Files

file | ComDlg32.C [code]
file | ComDlg32.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/ Directory Reference

  • WinUI
  • Controls

Controls Directory Reference

Directories

directory | Common
directory | Custom
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/ Directory Reference

  • WinUI
  • Controls
  • Common

Common Directory Reference

Directories

directory | Property
directory | Rebar
directory | VListVw
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Property/ Directory Reference

  • WinUI
  • Controls
  • Common
  • Property

Property Directory Reference

Files

file | Property.c [code]
file | Property.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Rebar/ Directory Reference

  • WinUI
  • Controls
  • Common
  • Rebar

Rebar Directory Reference

Files

file | Rebar.c [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/VListVw/ Directory Reference

  • WinUI
  • Controls
  • Common
  • VListVw

VListVw Directory Reference

Files

file | Resource.h [code]
file | VListVw.c [code]
file | VListVw.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/ Directory Reference

  • WinUI
  • Controls
  • Custom

Custom Directory Reference

Directories

directory SpinCube
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/ Directory Reference

  • WinUI
  • Controls
  • Custom
  • SpinCube

SpinCube Directory Reference

Files

file | Paint.c [code]
file | Paint.h [code]
file | SpinCube.c [code]
file | SpinCube.h [code]
file | SpinTest.c [code]
file | SpinTest.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Cursor/ Directory Reference

  • WinUI
  • Cursor

Cursor Directory Reference

Files

file | Cursor.c [code]
file | Cursor.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/fulldrag/ Directory Reference

  • WinUI
  • fulldrag

fulldrag Directory Reference

Files

file | fulldrag.c [code]
file | fulldrag.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/ Directory Reference

  • WinUI
  • GlobalDev

GlobalDev Directory Reference

Directories

directory | CSSamp
directory | globaldev
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/ Directory Reference

  • WinUI
  • GlobalDev
  • CSSamp

CSSamp Directory Reference

Files

file | CSSamp.Cpp [code]
file | Debug.Cpp [code]
file | DspFormt.Cpp [code]
file | DspLogcl.Cpp [code]
file | DspPlain.Cpp [code]
file | Edit.Cpp [code]
file | Global.h [code]
file | PreComp.Hxx [code]
file | Resource.h [code]
file | Settings.Cpp [code]
file | Style.Cpp [code]
file | Text.Cpp [code]
file | TextWnd.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/ Directory Reference

  • WinUI
  • GlobalDev
  • globaldev

globaldev Directory Reference

Directories

directory | gres409

Files

file | gentab.c [code]
file | global.c [code]
file | global.h [code]
file | nlsapi.c [code]
file | res.h [code]
file | resource.h [code]
file | textapi.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/gres409/ Directory Reference

  • WinUI
  • GlobalDev
  • globaldev
  • gres409

gres409 Directory Reference

Files

file | gres409.c [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/ Directory Reference

  • WinUI
  • Input

Input Directory Reference

Directories

directory | Ime
directory | MouseInfo
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/ Directory Reference

  • WinUI
  • Input
  • Ime

Ime Directory Reference

Directories

directory | FullIME
directory | HalfIME
directory | IMEApps
directory | MultiUI
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/ Directory Reference

  • WinUI
  • Input
  • Ime
  • FullIME

FullIME Directory Reference

Files

file | CANDUI.C [code]
file | FullIME.h [code]
file | Global.C [code]
file | ImeUI.C [code]
file | Main.C [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/HalfIME/ Directory Reference

  • WinUI
  • Input
  • Ime
  • HalfIME

HalfIME Directory Reference

Files

file | HalfIME.h [code]
file | Main.C [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/ Directory Reference

  • WinUI
  • Input
  • Ime
  • IMEApps

IMEApps Directory Reference

Files

file | Comp.c [code]
file | Data.c [code]
file | IMEApps.c [code]
file | IMEApps.h [code]
file | ImeMenu.c [code]
file | Mode.c [code]
file | Paint.c [code]
file | Pch.h [code]
file | Resource.h [code]
file | Setcomp.c [code]
file | Status.c [code]
file | Subs.c [code]
file | ToolBar.c [code]
file | ToolBar.h [code]
file | Wapi.h [code]
file | Wsubs.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/ Directory Reference

  • WinUI
  • Input
  • Ime
  • MultiUI

MultiUI Directory Reference

Files

file | Data.C [code]
file | Dlgs.C [code]
file | MultiUI.C [code]
file | MultiUI.h [code]
file | MultiWnd.C [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/MouseInfo/ Directory Reference

  • WinUI
  • Input
  • MouseInfo

MouseInfo Directory Reference

Files

file | MousInfo.c [code]
file | MousInfo.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Menu/ Directory Reference

  • WinUI
  • Menu

Menu Directory Reference

Files

file | Menu.c [code]
file | Menu.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/obscure/ Directory Reference

  • WinUI
  • obscure

obscure Directory Reference

Files

file Obscure.c [code]
Generated on Wed Nov 13 2024 16:58:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/ Directory Reference

  • WinUI
  • Resource

Resource Directory Reference

Directories

directory | DynDlg
directory | Iconpro
directory | msgtable
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/DynDlg/ Directory Reference

  • WinUI
  • Resource
  • DynDlg

DynDlg Directory Reference

Files

file | DynDlg.c [code]
file | DynDlg.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/ Directory Reference

  • WinUI
  • Resource
  • Iconpro

Iconpro Directory Reference

Files

file | Dib.c [code]
file | Dib.h [code]
file | IconPRO.C [code]
file | IconPRO.h [code]
file | Icons.C [code]
file | Icons.h [code]
file | MDIChild.C [code]
file | MDIChild.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/msgtable/ Directory Reference

  • WinUI
  • Resource
  • msgtable

msgtable Directory Reference

Files

file MsgTest.c [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/sendto/ Directory Reference

  • WinUI
  • sendto

sendto Directory Reference

Files

file | sendto.c [code]
file | sendto.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ Directory Reference

  • WinUI
  • Shell

Shell Directory Reference

Directories

directory | AppBar
directory | BandObjs
directory | ColumnProvider
directory | customdrawbuttondlg
directory | DiskCleanupHandler
directory | DragImg
directory | DropExt
directory | EnumDesk
directory | Fakemenu
directory | FileView
directory | SampView
directory | ShellExt
directory | ShellIconOverlay
directory | TrayNot
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/ Directory Reference

  • WinUI
  • Shell
  • AppBar

AppBar Directory Reference

Files

file | AppBar.c [code]
file | AppBar.h [code]
file | Globals.h [code]
file | Main.c [code]
file | PropSht.c [code]
file | Resource.h [code]
file | Util.c [code]
file | WndProc.c [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ Directory Reference

  • WinUI
  • Shell
  • BandObjs

BandObjs Directory Reference

Files

file | BandObjs.Cpp [code]
file | ClsFact.Cpp [code]
file | ClsFact.h [code]
file | CommBand.Cpp [code]
file | CommBand.h [code]
file | DeskBand.Cpp [code]
file | DeskBand.h [code]
file | ExplrBar.Cpp [code]
file | ExplrBar.h [code]
file | Globals.h [code]
file | Guid.h [code]
file | ToolBand.Cpp [code]
file | ToolBand.h [code]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ Directory Reference

  • WinUI
  • Shell
  • ColumnProvider

ColumnProvider Directory Reference

Files

file | ClassFactory.Cpp [code]
file | ClassFactory.h [code]
file | clsid.Cpp [code]
file | columnprovider.Cpp [code]
file | columnprovider.h [code]
file | RegisterServer.Cpp [code]
file | Resource.h [code]
file | ShortName.Cpp [code]
file | ShortName.h [code]
file | UnRegisterServer.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/customdrawbuttondlg/ Directory Reference

  • WinUI
  • Shell
  • customdrawbuttondlg

customdrawbuttondlg Directory Reference

Files

file | CustomDrawButtonDlg.cpp [code]
file | CustomDrawButtonDlg.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/ Directory Reference

  • WinUI
  • Shell
  • DiskCleanupHandler

DiskCleanupHandler Directory Reference

Files

file | ClassFactory.Cpp [code]
file | ClassFactory.h [code]
file | Cleanup.Cpp [code]
file | Cleanup.h [code]
file | dacl.cpp [code]
file | EmptyVolumeCache.Cpp [code]
file | EmptyVolumeCache.h [code]
file | RegisterServer.Cpp [code]
file | Resource.h [code]
file | UnRegisterServer.Cpp [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/ Directory Reference

  • WinUI
  • Shell
  • DragImg

DragImg Directory Reference

Files

file | DataObj.Cpp [code]
file | DataObj.h [code]
file | DragImg.Cpp [code]
file | DragImg.h [code]
file | Dragsrc.Cpp [code]
file | Dragsrc.h [code]
file | DropTgt.Cpp [code]
file | DropTgt.h [code]
file | Enumfe.Cpp [code]
file | Enumfe.h [code]
file | Render.Cpp [code]
file | Render.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/ Directory Reference

  • WinUI
  • Shell
  • DropExt

DropExt Directory Reference

Files

file | DefClsF.C [code]
file | DropExt.C [code]
file | DropExt.h [code]
file | Priv.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/ Directory Reference

  • WinUI
  • Shell
  • EnumDesk

EnumDesk Directory Reference

Files

file | enumdesk.cpp [code]
file | enumdesk.h [code]
file | list.cpp [code]
file | list.h [code]
file | resource.h [code]
file | tree.cpp [code]
file | tree.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/Fakemenu/ Directory Reference

  • WinUI
  • Shell
  • Fakemenu

Fakemenu Directory Reference

Files

file | fakemenu.c [code]
file | fakemenu.h [code]
Generated on Wed Nov 13 2024 16:58:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/ Directory Reference

  • WinUI
  • Shell
  • FileView

FileView Directory Reference

Files

file | CStatHlp.Cpp [code]
file | CStatHlp.h [code]
file | CStrTabl.Cpp [code]
file | CStrTabl.h [code]
file | DbgOut.h [code]
file | FileView.Cpp [code]
file | FileView.h [code]
file | FVInit.Cpp [code]
file | FVProc.Cpp [code]
file | FVText.Cpp [code]
file | FVText.h [code]
file | IFileVW.Cpp [code]
file | IPerFile.Cpp [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ Directory Reference

  • WinUI
  • Shell
  • SampView

SampView Directory Reference

Files

file | ClsFact.Cpp [code]
file | ClsFact.h [code]
file | Commands.h [code]
file | ContMenu.Cpp [code]
file | ContMenu.h [code]
file | DataObj.Cpp [code]
file | DataObj.h [code]
file | DropSrc.Cpp [code]
file | DropSrc.h [code]
file | DropTgt.Cpp [code]
file | DropTgt.h [code]
file | Enumidl.Cpp [code]
file | Enumidl.h [code]
file | ExtrIcon.Cpp [code]
file | ExtrIcon.h [code]
file | Guid.h [code]
file | PidlMgr.Cpp [code]
file | PidlMgr.h [code]
file | Resource.h [code]
file | SampView.Cpp [code]
file | ShlFldr.Cpp [code]
file | ShlFldr.h [code]
file | ShlView.Cpp [code]
file | ShlView.h [code]
file | Tools.h [code]
file | Utility.Cpp [code]
file | Utility.h [code]
file | Viewlist.Cpp [code]
file | Viewlist.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/ Directory Reference

  • WinUI
  • Shell
  • ShellExt

ShellExt Directory Reference

Files

file | CopyHook.Cpp [code]
file | CtxMenu.Cpp [code]
file | IconHdlr.Cpp [code]
file | Priv.h [code]
file | PropShet.Cpp [code]
file | Resource.h [code]
file | ShellExt.Cpp [code]
file | ShellExt.h [code]
file | ShExInit.Cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellIconOverlay/ Directory Reference

  • WinUI
  • Shell
  • ShellIconOverlay

ShellIconOverlay Directory Reference

Files

file | IcnOvrly.Cpp [code]
file | IcnOvrly.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/TrayNot/ Directory Reference

  • WinUI
  • Shell
  • TrayNot

TrayNot Directory Reference

Files

file | App32.C [code]
file | App32.h [code]
file | Resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tallmenu/ Directory Reference

  • WinUI
  • tallmenu

tallmenu Directory Reference

Files

file | tallmenu.c [code]
file | tallmenu.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/ Directory Reference

  • WinUI
  • tsfapp

tsfapp Directory Reference

Files

file | context.cpp [code]
file | dataobj.cpp [code]
file | dataobj.h [code]
file | funcprov.cpp [code]
file | globals.h [code]
file | persist.cpp [code]
file | propldr.cpp [code]
file | propldr.h [code]
file | resource.h [code]
file | test.cpp [code]
file | textstor.cpp [code]
file | tsfapp.cpp [code]
file | tsfedit.cpp [code]
file | tsfedit.h [code]
file | tsfwnd.cpp [code]
file | tsfwnd.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/ Directory Reference

  • WinUI
  • TSFcase

TSFcase Directory Reference

Files

file | case.cpp [code]
file | case.h [code]
file | dllmain.cpp [code]
file | editsess.h [code]
file | editsink.cpp [code]
file | flipdoc.cpp [code]
file | flipsel.cpp [code]
file | globals.cpp [code]
file | globals.h [code]
file | hello.cpp [code]
file | keys.cpp [code]
file | langbar.cpp [code]
file | precomp.cpp [code]
file | register.cpp [code]
file | resource.h [code]
file | server.cpp [code]
file | snoop.cpp [code]
file | snoop.h [code]
file | tmgrsink.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfcompart/ Directory Reference

  • WinUI
  • tsfcompart

tsfcompart Directory Reference

Files

file | compart.cpp [code]
file | monitor.cpp [code]
file | monitor.h [code]
file | resource.h [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/ Directory Reference

  • WinUI
  • TSFmark

TSFmark Directory Reference

Files

file | cleanup.cpp [code]
file | compart.cpp [code]
file | compose.cpp [code]
file | dap.cpp [code]
file | dllmain.cpp [code]
file | editsess.h [code]
file | editsink.cpp [code]
file | globals.cpp [code]
file | globals.h [code]
file | keys.cpp [code]
file | langbar.cpp [code]
file | mark.cpp [code]
file | mark.h [code]
file | precomp.cpp [code]
file | property.cpp [code]
file | pstore.cpp [code]
file | pstore.h [code]
file | register.cpp [code]
file | resource.h [code]
file | server.cpp [code]
file | tmgrsink.cpp [code]
Generated on Wed Nov 13 2024 16:58:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- _ -

  • _ : SysInfo.h
  • ___ADO_FWD_DEFINED__ : adoint.h
  • ___ADO_INTERFACE_DEFINED__ : adoint.h
  • ___ADOCollection_FWD_DEFINED__ : adoint.h
  • ___ADOCollection_INTERFACE_DEFINED__ : adoint.h
  • ___ADODynaCollection_FWD_DEFINED__ : adoint.h
  • ___ADODynaCollection_INTERFACE_DEFINED__ : adoint.h
  • ___Command_FWD_DEFINED__ : adoint.h
  • ___Command_INTERFACE_DEFINED__ : adoint.h
  • ___Connection_FWD_DEFINED__ : adoint.h
  • ___Connection_INTERFACE_DEFINED__ : adoint.h
  • ___Parameter_FWD_DEFINED__ : adoint.h
  • ___Parameter_INTERFACE_DEFINED__ : adoint.h
  • ___Recordset_FWD_DEFINED__ : adoint.h
  • ___Recordset_INTERFACE_DEFINED__ : adoint.h
  • __ADOConnectionConstruction_FWD_DEFINED__ : adoint.h
  • __ADOConnectionConstruction_INTERFACE_DEFINED__ : adoint.h
  • __ADODB_LIBRARY_DEFINED__ : adoint.h
  • __ADORecordsetConstruction_FWD_DEFINED__ : adoint.h
  • __ADORecordsetConstruction_INTERFACE_DEFINED__ : adoint.h
  • __ADsError_FWD_DEFINED__ : ADsError.h
  • __ADSERRORLib_LIBRARY_DEFINED__ : ADsError.h
  • __ADSFIRSTEXTLib_LIBRARY_DEFINED__ : ADsFirstExt.h
  • __ATLCONTROLLib_LIBRARY_DEFINED__ : atlcontrol.h
  • __BERR : sdkdiff.cpp , sdkdiff.h
  • __BSTRC__DEFINED__ : policy.h
  • __Command_FWD_DEFINED__ : adoint.h
  • __COMMON_PIPE_SAMPLE__ : Common.h
  • __COMMON_STROUT__ : Common.h
  • __Connection_FWD_DEFINED__ : adoint.h
  • __declspec() : utils.cpp , helpdll.Cpp , plgtermpriv.h , CertGetKey.c , SpinTest.c
  • __Dimmer_FWD_DEFINED__ : MyDevice.h
  • __Error_FWD_DEFINED__ : adoint.h
  • __Error_INTERFACE_DEFINED__ : adoint.h
  • __Errors_FWD_DEFINED__ : adoint.h
  • __Errors_INTERFACE_DEFINED__ : adoint.h
  • __Field_FWD_DEFINED__ : adoint.h
  • __Field_INTERFACE_DEFINED__ : adoint.h
  • __Fields_FWD_DEFINED__ : adoint.h
  • __Fields_INTERFACE_DEFINED__ : adoint.h
  • __HelloWorld_FWD_DEFINED__ : ADsFirstExt.h
  • __IADsError_FWD_DEFINED__ : ADsError.h
  • __IADsError_INTERFACE_DEFINED__ : ADsError.h
  • __IApplet_FWD_DEFINED__ : iapplet.h
  • __IApplet_INTERFACE_DEFINED__ : iapplet.h
  • __IAppletNotify_FWD_DEFINED__ : iapplet.h
  • __IAppletNotify_INTERFACE_DEFINED__ : iapplet.h
  • __IAppletSession_FWD_DEFINED__ : iapplet.h
  • __IAppletSession_INTERFACE_DEFINED__ : iapplet.h
  • __IAppletSessionNotify_FWD_DEFINED__ : iapplet.h
  • __IAppletSessionNotify_INTERFACE_DEFINED__ : iapplet.h
  • __IHelloWorld_FWD_DEFINED__ : ADsFirstExt.h
  • __IHelloWorld_INTERFACE_DEFINED__ : ADsFirstExt.h
  • __IID_DEFINED__ : ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c , iapplet.c
  • __IMMCControl_FWD_DEFINED__ : atlcontrol.h
  • __IMMCControl_INTERFACE_DEFINED__ : atlcontrol.h
  • __IUPnPService_DimmingService_SCPD_FWD_DEFINED__ : MyDevice.h
  • __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__ : MyDevice.h
  • __LONGSTRING : helper.h , prsample.h
  • __m_bobj_h__ : adoint.h
  • __MIDL_itf_iapplet_0000_v0_0_c_ifspec : iapplet.h
  • __MIDL_itf_iapplet_0000_v0_0_s_ifspec : iapplet.h
  • __MIDL_itf_iapplet_0212_v0_0_c_ifspec : iapplet.h
  • __MIDL_itf_iapplet_0212_v0_0_s_ifspec : iapplet.h
  • __MIDL_itf_m_bobj_0000_v0_0_c_ifspec : adoint.h
  • __MIDL_itf_m_bobj_0000_v0_0_s_ifspec : adoint.h
  • __MIDL_ProcFormatString : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • __MIDL_TypeFormatString : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • __MMCControl_FWD_DEFINED__ : atlcontrol.h
  • __MSOmniProv_FWD_DEFINED__ : theprovider.h
  • __MYDEVICELib_LIBRARY_DEFINED__ : MyDevice.h
  • __NmApplet_FWD_DEFINED__ : iapplet.h
  • __NmApplet_LIBRARY_DEFINED__ : iapplet.h
  • __pad0__ : suminfo.Cpp
  • __Parameter_FWD_DEFINED__ : adoint.h
  • __Parameters_FWD_DEFINED__ : adoint.h
  • __Parameters_INTERFACE_DEFINED__ : adoint.h
  • __PLG_TERMSAMPLE_IDL__ : plgtermsample.idl
  • __Properties_FWD_DEFINED__ : adoint.h
  • __Properties_INTERFACE_DEFINED__ : adoint.h
  • __Property_FWD_DEFINED__ : adoint.h
  • __Property_INTERFACE_DEFINED__ : adoint.h
  • __Recordset_FWD_DEFINED__ : adoint.h
  • __REQUIRED_RPCNDR_H_VERSION__ : iapplet.h , theprovider.h , ADsFirstExt.h , ADsError.h , MyDevice.h , atlcontrol.h
  • __REQUIRED_RPCPROXY_H_VERSION__ : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • __T : utilprop.cpp
  • __THEPROVIDERLib_LIBRARY_DEFINED__ : theprovider.h
  • __WIDESTRING : common.h
  • _ADO : adoint.h
  • _ADO_get_Properties_Proxy() : adoint.h
  • _ADO_get_Properties_Stub() : adoint.h
  • _ADOCollection : adoint.h
  • _ADOCollection__NewEnum_Proxy() : adoint.h
  • _ADOCollection__NewEnum_Stub() : adoint.h
  • _ADOCollection_Refresh_Proxy() : adoint.h
  • _ADOCollection_Refresh_Stub() : adoint.h
  • _ADOCollectionVtbl : adoint.h
  • _ADODynaCollection : adoint.h
  • _ADODynaCollection_Append_Proxy() : adoint.h
  • _ADODynaCollection_Append_Stub() : adoint.h
  • _ADODynaCollection_Delete_Proxy() : adoint.h
  • _ADODynaCollection_Delete_Stub() : adoint.h
  • _ADODynaCollectionVtbl : adoint.h
  • _ADOVtbl : adoint.h
  • _ADsError_BaseIIDList : ADsError_p.c
  • _ADsError_CHECK_IID : ADsError_p.c
  • _ADsError_IID_Lookup() : ADsError_p.c
  • _ADsError_InterfaceNamesList : ADsError_p.c
  • _ADsError_ProxyVtblList : ADsError_p.c
  • _ADsError_StubVtblList : ADsError_p.c
  • _ADsFirstExt_BaseIIDList : ADsFirstExt_p.c
  • _ADsFirstExt_CHECK_IID : ADsFirstExt_p.c
  • _ADsFirstExt_IID_Lookup() : ADsFirstExt_p.c
  • _ADsFirstExt_InterfaceNamesList : ADsFirstExt_p.c
  • _ADsFirstExt_ProxyVtblList : ADsFirstExt_p.c
  • _ADsFirstExt_StubVtblList : ADsFirstExt_p.c
  • _AFXRES : afxres.h
  • _APS_NEXT_COMMAND_VALUE : Resource.h
  • _APS_NEXT_CONTROL_VALUE : Resource.h
  • _APS_NEXT_RESOURCE_VALUE : Resource.h
  • _APS_NEXT_SYMED_VALUE : Resource.h
  • _assert : assert.h
  • _ATL_APARTMENT_THREADED : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , CeapCfg.h , StdAfx.h , Stdafx.h , StdAfx.h , ClRes.h , StdAfx.h
  • _ATL_DEBUG_QI : StdAfx.h , stdafx.h , Line.h
  • _ATL_DEBUG_REFCOUNT : StdAfx.h , Line.h
  • _ATL_FREE_THREADED : stdafx.h
  • _ATL_STATIC_REGISTRY : StdAfx.h
  • _BrochureMachine_BaseIIDList : BrochureMachine_p.c
  • _BrochureMachine_CHECK_IID : BrochureMachine_p.c
  • _BrochureMachine_IID_Lookup() : BrochureMachine_p.c
  • _BrochureMachine_InterfaceNamesList : BrochureMachine_p.c
  • _BrochureMachine_ProxyVtblList : BrochureMachine_p.c
  • _BrochureMachine_StubVtblList : BrochureMachine_p.c
  • _ClearAttribute() : util.cpp
  • _CMDLN_STATE : cmsample.cpp
  • _Collection_get_Count_Proxy() : adoint.h
  • _Collection_get_Count_Stub() : adoint.h
  • _com_issue_error() : security.cpp
  • _COM_SMARTPTR_TYPEDEF() : UtilLib.h
  • _Command : adoint.h
  • _Command_Cancel_Proxy() : adoint.h
  • _Command_Cancel_Stub() : adoint.h
  • _Command_CreateParameter_Proxy() : adoint.h
  • _Command_CreateParameter_Stub() : adoint.h
  • _Command_Execute_Proxy() : adoint.h
  • _Command_Execute_Stub() : adoint.h
  • _Command_get_ActiveConnection_Proxy() : adoint.h
  • _Command_get_ActiveConnection_Stub() : adoint.h
  • _Command_get_CommandText_Proxy() : adoint.h
  • _Command_get_CommandText_Stub() : adoint.h
  • _Command_get_CommandTimeout_Proxy() : adoint.h
  • _Command_get_CommandTimeout_Stub() : adoint.h
  • _Command_get_CommandType_Proxy() : adoint.h
  • _Command_get_CommandType_Stub() : adoint.h
  • _Command_get_Name_Proxy() : adoint.h
  • _Command_get_Name_Stub() : adoint.h
  • _Command_get_Parameters_Proxy() : adoint.h
  • _Command_get_Parameters_Stub() : adoint.h
  • _Command_get_Prepared_Proxy() : adoint.h
  • _Command_get_Prepared_Stub() : adoint.h
  • _Command_get_State_Proxy() : adoint.h
  • _Command_get_State_Stub() : adoint.h
  • _Command_put_ActiveConnection_Proxy() : adoint.h
  • _Command_put_ActiveConnection_Stub() : adoint.h
  • _Command_put_CommandText_Proxy() : adoint.h
  • _Command_put_CommandText_Stub() : adoint.h
  • _Command_put_CommandTimeout_Proxy() : adoint.h
  • _Command_put_CommandTimeout_Stub() : adoint.h
  • _Command_put_CommandType_Proxy() : adoint.h
  • _Command_put_CommandType_Stub() : adoint.h
  • _Command_put_Name_Proxy() : adoint.h
  • _Command_put_Name_Stub() : adoint.h
  • _Command_put_Prepared_Proxy() : adoint.h
  • _Command_put_Prepared_Stub() : adoint.h
  • _Command_putref_ActiveConnection_Proxy() : adoint.h
  • _Command_putref_ActiveConnection_Stub() : adoint.h
  • _CommandVtbl : adoint.h
  • _Connection : adoint.h
  • _Connection_BeginTrans_Proxy() : adoint.h
  • _Connection_BeginTrans_Stub() : adoint.h
  • _Connection_Cancel_Proxy() : adoint.h
  • _Connection_Cancel_Stub() : adoint.h
  • _Connection_Close_Proxy() : adoint.h
  • _Connection_Close_Stub() : adoint.h
  • _Connection_CommitTrans_Proxy() : adoint.h
  • _Connection_CommitTrans_Stub() : adoint.h
  • _Connection_Execute_Proxy() : adoint.h
  • _Connection_Execute_Stub() : adoint.h
  • _Connection_get_Attributes_Proxy() : adoint.h
  • _Connection_get_Attributes_Stub() : adoint.h
  • _Connection_get_CommandTimeout_Proxy() : adoint.h
  • _Connection_get_CommandTimeout_Stub() : adoint.h
  • _Connection_get_ConnectionString_Proxy() : adoint.h
  • _Connection_get_ConnectionString_Stub() : adoint.h
  • _Connection_get_ConnectionTimeout_Proxy() : adoint.h
  • _Connection_get_ConnectionTimeout_Stub() : adoint.h
  • _Connection_get_CursorLocation_Proxy() : adoint.h
  • _Connection_get_CursorLocation_Stub() : adoint.h
  • _Connection_get_DefaultDatabase_Proxy() : adoint.h
  • _Connection_get_DefaultDatabase_Stub() : adoint.h
  • _Connection_get_Errors_Proxy() : adoint.h
  • _Connection_get_Errors_Stub() : adoint.h
  • _Connection_get_IsolationLevel_Proxy() : adoint.h
  • _Connection_get_IsolationLevel_Stub() : adoint.h
  • _Connection_get_Mode_Proxy() : adoint.h
  • _Connection_get_Mode_Stub() : adoint.h
  • _Connection_get_Provider_Proxy() : adoint.h
  • _Connection_get_Provider_Stub() : adoint.h
  • _Connection_get_State_Proxy() : adoint.h
  • _Connection_get_State_Stub() : adoint.h
  • _Connection_get_Version_Proxy() : adoint.h
  • _Connection_get_Version_Stub() : adoint.h
  • _Connection_Open_Proxy() : adoint.h
  • _Connection_Open_Stub() : adoint.h
  • _Connection_OpenSchema_Proxy() : adoint.h
  • _Connection_OpenSchema_Stub() : adoint.h
  • _Connection_put_Attributes_Proxy() : adoint.h
  • _Connection_put_Attributes_Stub() : adoint.h
  • _Connection_put_CommandTimeout_Proxy() : adoint.h
  • _Connection_put_CommandTimeout_Stub() : adoint.h
  • _Connection_put_ConnectionString_Proxy() : adoint.h
  • _Connection_put_ConnectionString_Stub() : adoint.h
  • _Connection_put_ConnectionTimeout_Proxy() : adoint.h
  • _Connection_put_ConnectionTimeout_Stub() : adoint.h
  • _Connection_put_CursorLocation_Proxy() : adoint.h
  • _Connection_put_CursorLocation_Stub() : adoint.h
  • _Connection_put_DefaultDatabase_Proxy() : adoint.h
  • _Connection_put_DefaultDatabase_Stub() : adoint.h
  • _Connection_put_IsolationLevel_Proxy() : adoint.h
  • _Connection_put_IsolationLevel_Stub() : adoint.h
  • _Connection_put_Mode_Proxy() : adoint.h
  • _Connection_put_Mode_Stub() : adoint.h
  • _Connection_put_Provider_Proxy() : adoint.h
  • _Connection_put_Provider_Stub() : adoint.h
  • _Connection_RollbackTrans_Proxy() : adoint.h
  • _Connection_RollbackTrans_Stub() : adoint.h
  • _ConnectionVtbl : adoint.h
  • _CRT_INIT() : SpinCube.c
  • _CRTAPI2 : assert.h
  • _DECL_DLLMAIN : Main.Cxx
  • _dispaddr() : dbh.cpp
  • _DLLEXPORT_ : ComObj.Cpp , ConServe.Cpp , DllServe.Cpp , DllSkel.Cpp , FreServe.Cpp , LicServe.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , StoServe.Cpp
  • _DumpStringArray : policy.h , Policy.h
  • _dumpsym() : dbh.cpp
  • _EDAnnotator_BaseIIDList : EDAnnotator_p.c
  • _EDAnnotator_CHECK_IID : EDAnnotator_p.c
  • _EDAnnotator_IID_Lookup() : EDAnnotator_p.c
  • _EDAnnotator_InterfaceNamesList : EDAnnotator_p.c
  • _EDAnnotator_ProxyVtblList : EDAnnotator_p.c
  • _EDAnnotator_StubVtblList : EDAnnotator_p.c
  • _EdCommands_BaseIIDList : EdCommands_p.c
  • _EdCommands_CHECK_IID : EdCommands_p.c
  • _EdCommands_IID_Lookup() : EdCommands_p.c
  • _EdCommands_InterfaceNamesList : EdCommands_p.c
  • _EdCommands_ProxyVtblList : EdCommands_p.c
  • _EdCommands_StubVtblList : EdCommands_p.c
  • _EdGlyphs_BaseIIDList : EdGlyphs_p.c
  • _EdGlyphs_CHECK_IID : EdGlyphs_p.c
  • _EdGlyphs_IID_Lookup() : EdGlyphs_p.c
  • _EdGlyphs_InterfaceNamesList : EdGlyphs_p.c
  • _EdGlyphs_ProxyVtblList : EdGlyphs_p.c
  • _EdGlyphs_StubVtblList : EdGlyphs_p.c
  • _EdHost_BaseIIDList : EdHost_p.c
  • _EdHost_CHECK_IID : EdHost_p.c
  • _EdHost_IID_Lookup() : EdHost_p.c
  • _EdHost_InterfaceNamesList : EdHost_p.c
  • _EdHost_ProxyVtblList : EdHost_p.c
  • _EdHost_StubVtblList : EdHost_p.c
  • _epPchNil : string.Cpp , string.h
  • _ExtendableNodes : registry.Cpp
  • _FindNextChange() : sdkdiff.cpp
  • _FindPrevChange() : sdkdiff.cpp
  • _FVTEXT_H_ : FVText.h
  • _GetDefaultTbb() : sBar.Cpp
  • _HTTPCFG_TYPE : precomp.h
  • _IADsErrorStubVtbl : ADsError_p.c
  • _IAnnotatorStubVtbl : EDAnnotator_p.c
  • _IBehaviorStubVtbl : Render_p.c
  • _IBrowserHostStubVtbl : EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c
  • _IEventSinkStubVtbl : Render_p.c
  • _IFactoryStubVtbl : Render_p.c
  • _IGridStubVtbl : EdHost_p.c
  • _IHelloWorldStubVtbl : ADsFirstExt_p.c
  • _INC_OLE : SetDisp.h , Priv.h , App32.h
  • _INC_SHELLAPI : MainWND.c , MidiPlyr.c , TIMEWND.c , UIUTILS.c
  • _init_InitOle_ : Main.Cpp
  • _InitGuidLBox() : Dlg.Cpp
  • _InsertMenuHelper() : dsmenu.cpp
  • _IO_OPERATION : IocpServer.h
  • _IOffset : Priv.h
  • _IPSAMPLE_STATUS_CODE : configentry.h
  • _IPTLauncherStubVtbl : BrochureMachine_p.c
  • _IsConfigLocal() : CeLib.Cpp , celib.cpp
  • _ISnapStubVtbl : EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c
  • _ITEM_TYPE : tracedmp.h
  • _JumpError : CeLibW2k.h
  • _JumpErrorStr : CeLibW2k.h
  • _JumpIfError : CeLibW2k.h
  • _JumpIfError2 : CeLibW2k.h
  • _JumpIfErrorStr : CeLibW2k.h
  • _JumpIfErrorStr2 : CeLibW2k.h
  • _lcreat_AW : ansiapi.h
  • _LOCALCALLS_ : CRUCAR.Cpp , UtilCAR.Cpp
  • _lopen_AW : ansiapi.h
  • _MBCS : Monkey.c
  • _MODE : Bcast.c
  • _Module : StdAfx.h , TxEnlister.Cpp , ComSyncObject.Cpp , StdAfx.h , FreeObject.Cpp , StdAfx.h , STAObject.Cpp , StdAfx.h , SyncComp.Cpp , CrmDebug.Cpp , StdAfx.h , CrmFiles.Cpp , StdAfx.h , CrmFilesTest.Cpp , StdAfx.h , CrmMonComp.Cpp , StdAfx.h , cascadeec.Cpp , stdafx.h , newseventclass.Cpp , stdafx.h , persistatl.Cpp , stdafx.h , Account.cpp , StdAfx.h , Account.Cpp , stdafx.h , OPBank.Cpp , stdafx.h , LogWriter.Cpp , dll.cpp , StdAfx.h , PoolTest.Cpp , StdAfx.h , File Share SampleEx.cpp , StdAfx.h , QCNotify.Cpp , StdAfx.h , ClRes.cpp , QCOrder.Cpp , StdAfx.h , QCShip.Cpp , StdAfx.h , QCNotify.Cpp , StdAfx.h , QCOrder.Cpp , Render.cpp , StdAfx.h , QCShip2.Cpp , StdAfx.h , EdGlyphs.cpp , Disp1.Cpp , StdAfx.h , EdCommands.cpp , VCSecuritySample.Cpp , StdAfx.h , TServer.Cpp , ADOKB.Cpp , StdAfx.h , OLEDBKB.Cpp , StdAfx.h , AdvReco.cpp , RDOKB.Cpp , StdAfx.h , account.Cpp , CertPSam.Cpp , StdAfx.h , data.Cpp , stdafx.h , CertXSam.Cpp , stdafx.h , theprovider.cpp , msdfmap.cpp , stdafx.h , Authenticate.cpp , StdAfx.h , dbauth.cpp , MyDevice.cpp , stdafx.h , proxyplugin.cpp , StdAfx.h , genericucp.cpp , sdksamplestorageplugin.cpp , stdafx.h , ContextDll.cpp , pluggable.cpp , ContextSamplePropPage.cpp , stdafx.h , StdAfx.h , SDKSamplePlaylistPlugin.cpp , StdAfx.h , SCPCMenu.cpp , StdAfx.h , SCPProppage.cpp , StdAfx.h , SCPWizard.cpp , StdAfx.h , stdafx.h , userproppage.cpp , stdafx.h , userwizard.cpp , ADsFirstExt.cpp , StdAfx.h , ADsFirstExt.cpp , ADsError.cpp , StdAfx.h , GraphObj.Cpp , StdAfx.h , CeapCfg.h , Exports.Cpp , SampMsp.Cpp , stdafx.h , DeviceDll.cpp , DeviceDll.h , stdafx.h , MyDevice.cpp , StdAfx.h , MyDevice.cpp , StdAfx.h , CertEnc.Cpp , Pch.Cpp , certxsam.cpp , pch.cpp , Pch.Cpp , certpsam.cpp , pch.cpp , Pch.Cpp , atlcontrol.Cpp , StdAfx.h , ChildWnds.cpp , MultiReco.cpp , BrochureMachine.cpp , StdAfx.h , EDAnnotator.cpp , StdAfx.h , EdCommands.cpp , StdAfx.h , EdHost.cpp , StdAfx.h , Stdafx.h , Catlpwr.Cpp , StdAfx.h , BankVC.cpp , StdAfx.h , CatlSmpl.Cpp , StdAfx.h , ClRes.h , ClipBook ServerEx.cpp , StdAfx.h , Dll.cpp , StdAfx.h , dll.cpp , StdAfx.h , Dll.cpp , StdAfx.h , MyStorageResource.cpp , StdAfx.h , ComSpy.Cpp , ComSpyAudit.Cpp , StdAfx.h , ComSpyCtl.Cpp , StdAfx.h , callbackclient.Cpp , stdafx.h , fullsvr.Cpp , stdafx.h , PingResp.Cpp , StdAfx.h , Server.Cpp , StdAfx.h , BYOTTransaction.Cpp
  • _mqscpy : MainFrm.Cpp
  • _MSV1_0_LOGON_SUBMIT_TYPE : Npaux.h
  • _MYSTATE : Eap.h
  • _NewEnum() : data.Idl
  • _NOANSIMACROS_ : AppUtil.Cpp
  • _NodeExtensions : registry.Cpp
  • _Offset2Ptr() : DropExt.C
  • _OLEIVERB_HIDE : SERVER.CPP
  • _OLEIVERB_OPEN : SERVER.CPP
  • _OLEIVERB_PRIMARY : SERVER.CPP
  • _OLEIVERB_PROPERTIES : SERVER.CPP
  • _OLEIVERB_SHOW : SERVER.CPP
  • _options : client.cxx
  • _Parameter : adoint.h
  • _Parameter_AppendChunk_Proxy() : adoint.h
  • _Parameter_AppendChunk_Stub() : adoint.h
  • _Parameter_get_Attributes_Proxy() : adoint.h
  • _Parameter_get_Attributes_Stub() : adoint.h
  • _Parameter_get_Direction_Proxy() : adoint.h
  • _Parameter_get_Direction_Stub() : adoint.h
  • _Parameter_get_Name_Proxy() : adoint.h
  • _Parameter_get_Name_Stub() : adoint.h
  • _Parameter_get_NumericScale_Proxy() : adoint.h
  • _Parameter_get_NumericScale_Stub() : adoint.h
  • _Parameter_get_Precision_Proxy() : adoint.h
  • _Parameter_get_Precision_Stub() : adoint.h
  • _Parameter_get_Size_Proxy() : adoint.h
  • _Parameter_get_Size_Stub() : adoint.h
  • _Parameter_get_Type_Proxy() : adoint.h
  • _Parameter_get_Type_Stub() : adoint.h
  • _Parameter_get_Value_Proxy() : adoint.h
  • _Parameter_get_Value_Stub() : adoint.h
  • _Parameter_put_Attributes_Proxy() : adoint.h
  • _Parameter_put_Attributes_Stub() : adoint.h
  • _Parameter_put_Direction_Proxy() : adoint.h
  • _Parameter_put_Direction_Stub() : adoint.h
  • _Parameter_put_Name_Proxy() : adoint.h
  • _Parameter_put_Name_Stub() : adoint.h
  • _Parameter_put_NumericScale_Proxy() : adoint.h
  • _Parameter_put_NumericScale_Stub() : adoint.h
  • _Parameter_put_Precision_Proxy() : adoint.h
  • _Parameter_put_Precision_Stub() : adoint.h
  • _Parameter_put_Size_Proxy() : adoint.h
  • _Parameter_put_Size_Stub() : adoint.h
  • _Parameter_put_Type_Proxy() : adoint.h
  • _Parameter_put_Type_Stub() : adoint.h
  • _Parameter_put_Value_Proxy() : adoint.h
  • _Parameter_put_Value_Stub() : adoint.h
  • _ParameterVtbl : adoint.h
  • _PrintError : CeLibW2k.h
  • _PrintError2 : CeLibW2k.h
  • _PrintErrorStr : CeLibW2k.h
  • _PrintErrorStr2 : CeLibW2k.h
  • _PrintIfError : CeLibW2k.h
  • _PrintIfError2 : CeLibW2k.h
  • _PrintIfErrorStr : CeLibW2k.h
  • _PrintIfErrorStr2 : CeLibW2k.h
  • _PROTOCOL : Bcast.c
  • _Recordset : adoint.h
  • _Recordset_AddNew_Proxy() : adoint.h
  • _Recordset_AddNew_Stub() : adoint.h
  • _Recordset_Cancel_Proxy() : adoint.h
  • _Recordset_Cancel_Stub() : adoint.h
  • _Recordset_CancelBatch_Proxy() : adoint.h
  • _Recordset_CancelBatch_Stub() : adoint.h
  • _Recordset_CancelUpdate_Proxy() : adoint.h
  • _Recordset_CancelUpdate_Stub() : adoint.h
  • _Recordset_Clone_Proxy() : adoint.h
  • _Recordset_Clone_Stub() : adoint.h
  • _Recordset_Close_Proxy() : adoint.h
  • _Recordset_Close_Stub() : adoint.h
  • _Recordset_Delete_Proxy() : adoint.h
  • _Recordset_Delete_Stub() : adoint.h
  • _Recordset_Find_Proxy() : adoint.h
  • _Recordset_Find_Stub() : adoint.h
  • _Recordset_get_AbsolutePage_Proxy() : adoint.h
  • _Recordset_get_AbsolutePage_Stub() : adoint.h
  • _Recordset_get_AbsolutePosition_Proxy() : adoint.h
  • _Recordset_get_AbsolutePosition_Stub() : adoint.h
  • _Recordset_get_ActiveConnection_Proxy() : adoint.h
  • _Recordset_get_ActiveConnection_Stub() : adoint.h
  • _Recordset_get_BOF_Proxy() : adoint.h
  • _Recordset_get_BOF_Stub() : adoint.h
  • _Recordset_get_Bookmark_Proxy() : adoint.h
  • _Recordset_get_Bookmark_Stub() : adoint.h
  • _Recordset_get_CacheSize_Proxy() : adoint.h
  • _Recordset_get_CacheSize_Stub() : adoint.h
  • _Recordset_get_Collect_Proxy() : adoint.h
  • _Recordset_get_Collect_Stub() : adoint.h
  • _Recordset_get_CursorLocation_Proxy() : adoint.h
  • _Recordset_get_CursorLocation_Stub() : adoint.h
  • _Recordset_get_CursorType_Proxy() : adoint.h
  • _Recordset_get_CursorType_Stub() : adoint.h
  • _Recordset_get_EditMode_Proxy() : adoint.h
  • _Recordset_get_EditMode_Stub() : adoint.h
  • _Recordset_get_EOF_Proxy() : adoint.h
  • _Recordset_get_EOF_Stub() : adoint.h
  • _Recordset_get_Fields_Proxy() : adoint.h
  • _Recordset_get_Fields_Stub() : adoint.h
  • _Recordset_get_Filter_Proxy() : adoint.h
  • _Recordset_get_Filter_Stub() : adoint.h
  • _Recordset_get_LockType_Proxy() : adoint.h
  • _Recordset_get_LockType_Stub() : adoint.h
  • _Recordset_get_MarshalOptions_Proxy() : adoint.h
  • _Recordset_get_MarshalOptions_Stub() : adoint.h
  • _Recordset_get_MaxRecords_Proxy() : adoint.h
  • _Recordset_get_MaxRecords_Stub() : adoint.h
  • _Recordset_get_PageCount_Proxy() : adoint.h
  • _Recordset_get_PageCount_Stub() : adoint.h
  • _Recordset_get_PageSize_Proxy() : adoint.h
  • _Recordset_get_PageSize_Stub() : adoint.h
  • _Recordset_get_RecordCount_Proxy() : adoint.h
  • _Recordset_get_RecordCount_Stub() : adoint.h
  • _Recordset_get_Sort_Proxy() : adoint.h
  • _Recordset_get_Sort_Stub() : adoint.h
  • _Recordset_get_Source_Proxy() : adoint.h
  • _Recordset_get_Source_Stub() : adoint.h
  • _Recordset_get_State_Proxy() : adoint.h
  • _Recordset_get_State_Stub() : adoint.h
  • _Recordset_get_Status_Proxy() : adoint.h
  • _Recordset_get_Status_Stub() : adoint.h
  • _Recordset_GetRows_Proxy() : adoint.h
  • _Recordset_GetRows_Stub() : adoint.h
  • _Recordset_Move_Proxy() : adoint.h
  • _Recordset_Move_Stub() : adoint.h
  • _Recordset_MoveFirst_Proxy() : adoint.h
  • _Recordset_MoveFirst_Stub() : adoint.h
  • _Recordset_MoveLast_Proxy() : adoint.h
  • _Recordset_MoveLast_Stub() : adoint.h
  • _Recordset_MoveNext_Proxy() : adoint.h
  • _Recordset_MoveNext_Stub() : adoint.h
  • _Recordset_MovePrevious_Proxy() : adoint.h
  • _Recordset_MovePrevious_Stub() : adoint.h
  • _Recordset_NextRecordset_Proxy() : adoint.h
  • _Recordset_NextRecordset_Stub() : adoint.h
  • _Recordset_Open_Proxy() : adoint.h
  • _Recordset_Open_Stub() : adoint.h
  • _Recordset_put_AbsolutePage_Proxy() : adoint.h
  • _Recordset_put_AbsolutePage_Stub() : adoint.h
  • _Recordset_put_AbsolutePosition_Proxy() : adoint.h
  • _Recordset_put_AbsolutePosition_Stub() : adoint.h
  • _Recordset_put_ActiveConnection_Proxy() : adoint.h
  • _Recordset_put_ActiveConnection_Stub() : adoint.h
  • _Recordset_put_Bookmark_Proxy() : adoint.h
  • _Recordset_put_Bookmark_Stub() : adoint.h
  • _Recordset_put_CacheSize_Proxy() : adoint.h
  • _Recordset_put_CacheSize_Stub() : adoint.h
  • _Recordset_put_Collect_Proxy() : adoint.h
  • _Recordset_put_Collect_Stub() : adoint.h
  • _Recordset_put_CursorLocation_Proxy() : adoint.h
  • _Recordset_put_CursorLocation_Stub() : adoint.h
  • _Recordset_put_CursorType_Proxy() : adoint.h
  • _Recordset_put_CursorType_Stub() : adoint.h
  • _Recordset_put_Filter_Proxy() : adoint.h
  • _Recordset_put_Filter_Stub() : adoint.h
  • _Recordset_put_LockType_Proxy() : adoint.h
  • _Recordset_put_LockType_Stub() : adoint.h
  • _Recordset_put_MarshalOptions_Proxy() : adoint.h
  • _Recordset_put_MarshalOptions_Stub() : adoint.h
  • _Recordset_put_MaxRecords_Proxy() : adoint.h
  • _Recordset_put_MaxRecords_Stub() : adoint.h
  • _Recordset_put_PageSize_Proxy() : adoint.h
  • _Recordset_put_PageSize_Stub() : adoint.h
  • _Recordset_put_Sort_Proxy() : adoint.h
  • _Recordset_put_Sort_Stub() : adoint.h
  • _Recordset_put_Source_Proxy() : adoint.h
  • _Recordset_put_Source_Stub() : adoint.h
  • _Recordset_putref_ActiveConnection_Proxy() : adoint.h
  • _Recordset_putref_ActiveConnection_Stub() : adoint.h
  • _Recordset_putref_Source_Proxy() : adoint.h
  • _Recordset_putref_Source_Stub() : adoint.h
  • _Recordset_Requery_Proxy() : adoint.h
  • _Recordset_Requery_Stub() : adoint.h
  • _Recordset_Resync_Proxy() : adoint.h
  • _Recordset_Resync_Stub() : adoint.h
  • _Recordset_Supports_Proxy() : adoint.h
  • _Recordset_Supports_Stub() : adoint.h
  • _Recordset_Update_Proxy() : adoint.h
  • _Recordset_Update_Stub() : adoint.h
  • _Recordset_UpdateBatch_Proxy() : adoint.h
  • _Recordset_UpdateBatch_Stub() : adoint.h
  • _RecordsetVtbl : adoint.h
  • _Render_BaseIIDList : Render_p.c
  • _Render_CHECK_IID : Render_p.c
  • _Render_IID_Lookup() : Render_p.c
  • _Render_InterfaceNamesList : Render_p.c
  • _Render_ProxyVtblList : Render_p.c
  • _Render_StubVtblList : Render_p.c
  • _rgAddrType : Dlg.Cpp
  • _rgCallType : Dlg.Cpp
  • _rgSysInfo : cMgr.Cpp
  • _rgtbb : sBar.Cpp
  • _ShipStatus : QCNotify.Idl
  • _T_CCF_DISPLAY_NAME : dataobj.Cpp , cMenuext.Cpp , dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp , nameext.Cpp , dataobj.Cpp , tbarext.Cpp , dataobj.Cpp , ppgeext.Cpp , dataobj.Cpp
  • _T_CCF_INTERNAL_SNAPIN : dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp
  • _T_CCF_NODETYPE : dataobj.Cpp , nameext.Cpp , dataobj.Cpp , cMenuext.Cpp , dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp , ppgeext.Cpp , dataobj.Cpp , tbarext.Cpp
  • _T_CCF_OBJECT_TYPES_IN_MULTI_SELECT : dataobj.Cpp
  • _T_CCF_SNAPIN_CLASSID : dataobj.Cpp , tbarext.Cpp , dataobj.Cpp , nameext.Cpp , ppgeext.Cpp , dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp , cMenuext.Cpp , dataobj.Cpp
  • _T_CCF_SZNODETYPE : dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp
  • _tcerr : HeadDump.cpp
  • _tcin : HeadDump.cpp
  • _tcout : HeadDump.cpp
  • _TEXT : utilprop.cpp
  • _tmain() : Store.cpp , wiassamp.cpp , Main.cpp , Check_SD.c , RequestCert.Cpp , WinHttpPostSample.cpp , odbcsql.c , SessionKey.cpp , DComPerm.Cpp , MyToken.cpp , RSAKey.cpp , SysInf_S.c , MsgTest.c , SuperUsr.cpp , WinHttpFormSubmitSample.cpp , SCQuery.Cpp , SCIntro.Cpp , msiloc.cpp , HeadDump.cpp , SignHash.cpp , msistuff.cpp , RSACert.cpp , DLEdit.Cpp , SecPrint.c , EnumStreams.c , PropCert.Cpp
  • _tWinMain() : PoolTest.Cpp , ComSpy.Cpp , OPBank.Cpp , EdCommands.cpp , global.c , SyncComp.Cpp , fullsvr.Cpp , EdHost.cpp , EdCommands.cpp , Server.Cpp , EdGlyphs.cpp
  • _UNICODE : LogonNP.c , KList.c , main.hxx , ClRes.h , SubAuth.c , bits_ie.cpp , SuperUsr.cpp , MyToken.cpp , Security.Cpp , ClRes.h , RSAKey.cpp , StdAfx.h , Main.Cpp , app.cpp , BasicHiPerf.Cpp , StdAfx.h , BasicHiPerf.h , DLEdit.Cpp , StdAfx.h , Privobji.Cpp , SignHash.cpp , main.hxx , writeread.cpp , propdump.cpp , stgcreatepropsetstg.cpp , StdAfx.h , unicode.h , Factory.Cpp , SecPrint.c
  • _WIN32_DCOM : ADSIhelpers.cpp , PreComp.h , CreateUserHelpers.cpp , MethProv.Cpp , main.cpp , common.h , main.cpp , ADSIhelpers.cpp , main.cpp , UserProps.cpp , main.cpp , EnumerateKeys.cpp , common.h
  • _WIN32_WINDOWS : sendto.h
  • _WIN32_WINNT : ClRes.h , StdAfx.h , HelloIsapi.cpp , StdAfx.h , iasuser.cpp , SamplCli.Cpp , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , otherwko.cpp , RasEnumDevices.c , Redir401.cpp , FaxSiren.Cpp , StdAfx.h , SuperUsr.cpp , StdAfx.h , wkguid.cpp , StdAfx.h , RasDial.c , StdAfx.h , PreComp.h , SServer.Cpp , Stdafx.h , StdAfx.h , SServer.Cpp , stdafx.h , StdAfx.h , stdafx.h , PreComp.h , Common.h , RasDialAsync.c , ADSIhelpers.cpp , RSAKey.cpp , stdafx.h , StdAfx.h , PreComp.h , StdAfx.h , stdafx.h , StdAfx.h , ChildWnds.cpp , Extension.cpp , stdafx.h , SignHash.cpp , GinaDlg.c , BasicHiPerf.Cpp , StdAfx.h , InstProv.Cpp , StdAfx.h , GinaHook.c , Cancel.Cpp , SessionKey.cpp , StdAfx.h , stdafx.h , StdAfx.h , MultiReco.cpp , StdAfx.h , ComPerf.Cpp , Extension.cpp , stdafx.h , StdAfx.h , UpCaseMap.cpp , StdAfx.h , QueryParser.cpp , StdAfx.h , GinaStub.c , StdAfx.h , RasEnumentries.c , otherwko1.cpp , EvProv.Cpp , PoolWrap.cpp , PropCert.Cpp , StdAfx.h , getschemainfo.cpp , StdAfx.h , ChildWnds.cpp , StdAfx.h , RasGetConnectionStatistics.c , DumpRequestInfo.cpp , stdafx.h , StdAfx.h , Consumer.Cpp , ClRes.h , StdAfx.h , WildCardMap.cpp , stdafx.h , StdAfx.h , objectSid.cpp , StdAfx.h , IsapiExtension.cpp , customentry.c , RasEnumConnections.c , StdAfx.h , InvokObjThreads.cpp , SServer.Cpp , StdAfx.h , AdvReco.cpp , PropProv.Cpp , queryusers.cpp , StdAfx.h
  • _WINSOCKAPI_ : DtHandler.Hpp , Handlers.Cpp , Dt_Dll.Cpp , Nideque.h , CStack.h , Stack.h
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Alphabetical List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Class Index

A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | _
A
CImpIGetRow CTabLite sampleConstants (helper)
About CImpIGetSession CTAPIEventNotification SaveOptionsEnum (msado15)
AboutBox (Sample::UI) CImpIGetSourceRow CTE_ENCODER_STRUCT SchemaEnum (msado15)
AboutDlg CImpIOleClientSite CTerminateCompositionEditSession SClassEntry
Account (BANKVCLib) CImpIOleDocumentSite CTestApp SDKSamplePlaylistParser (SDKSAMPLEPLAYLISTPLUGINLib)
ADCPROP_ASYNCTHREADPRIORITY_ENUM (msado15) CImpIOleInPlaceSite CTestCOMPerformance SearchDirectionEnum (msado15)
ADCPROP_AUTORECALC_ENUM (msado15) CImpIOpenRowset CTestDlg section
ADCPROP_UPDATECRITERIA_ENUM (msado15) CImpIPersist CTestDoc SeekEnum (msado15)
AddBlog (InkBlog) CImpIPersistFile CTestView SerializationForm (Serialization)
ADDRESS_DATA CImpIRow CTextElement ServiceCallBackInterface (CallbackIUnknownLib)
ADOCommandConstruction (msado15) CImpIRowChange CTextField SESSION_DATA
ADOConnectionConstruction (msado15) CImpIRowset CTextGrid SFilterEntry
ADOConnectionConstruction15 (msado15) CImpIRowsetChange CThreadData SHandlerEntry
ADOConnectionConstructionVtbl CImpIRowsetIdentity CThreadSub Ship (qcship)
ADORecordConstruction (msado15) CImpIRowsetInfo CThumbNailPhotoHolder SignVerify (Sample)
ADORecordsetConstruction (msado15) CImpIServiceProvider CTIMER SIMPLE_BROWSER
ADORecordsetConstructionVtbl CImpISessionProperties CTitleTag SIndexedDisk
ADOStreamConstruction (msado15) CImpISpecifyPropertyPages CToken SIndexedDiskLessThan
ADsError (ADSERRORLib) CImpIStream CToolBand SInfo
ADsError CImportRes CToolBarExtension SLangClassEntry
ADSTYPE_TO_STRING_ENTRY CInitStringBox CToolBarLite SLangRegistry
ADSTYPEsyntaxmapping CInkInputWnd CTransaction SmartRefPointer
ADVISE_SINK CInputTag CTransactionOptions SMmStream
AffectEnum (msado15) CInstanceSub CTreeViewLite Snap (EDHOSTLib)
AgentNotifySink CInstPro CTSFDataObject Sock_Info
Annotator (EDANNOTATORLib) CInterfaceDlg CTSFEditWnd SocketMonitor
APIHook CIntTrace CTSFMainWnd SPINCUBEINFO
APMFILEHEADER CIsapiCertPolicyFilter CTSFPersistentPropertyLoader SPropertyEntry
AppEvents CISeqStream CTxSub SStemForm
ARRAYQ CKeystrokeEditSession CTypesDialog Stack_c
ASYNC_REQUESTER CLandBasedVehicle CUnknown statel
AsyncFullServ (fullsvr) CLangBarItemButton CUpdateReceipt (vcacct) Static_Info_Database
AsyncIFullServ (fullsvr) CLanguageResourceSampleCF CUpdateReceipt Static_Statistic
AsyncTest (Async_Lib) Class1 CUpdateTextEditSession STL_LABEL
ATTRIBUTES CLBSub CUrlmonCallback Storesh (storesh)
AUTH_DATA CLDisp CursorLocationEnum (msado15) STR_BINDING
AuthenticateAdmin (AUTHENTICATEPLUGINLib) CLERK_ENTRY CursorOptionEnum (msado15) Stream (msado15)
AuthenticateContext (AUTHENTICATEPLUGINLib) ClientList CursorTypeEnum (msado15) StreamOpenOptionsEnum (msado15)
AuthenticatePlugin (AUTHENTICATEPLUGINLib) CLine CUserSub StreamReadEnum (msado15)
AutoClaims (AutoClaims) CLineGrid CustomDynamicRendererPlugin (RealTimeStylusPlugins) StreamTypeEnum (msado15)
B
CLinkable CUtil StreamWriteEnum (msado15)
BANDINFOSTRUCT ClipBookServer (MGDRESOURCELib) CUtilBSTR StringFormatEnum (msado15)
Behavior (RENDERLib) CList CUtilComPtr STYLE
BINDINGINFO CListBoxLite CUtilitiesDlg SupportConcurList
blockTag CListener CUtilProp SupportOptList
BookmarkEnum (msado15) CListHeader CUtilString
T
BROWSER_CONFIG CListViewLite CVARIANT t_Ctype
BrowserHost (EDHOSTLib) CLListImpl CVariant Table
BrowserHost (EDGLYPHSLib) CLocateDialog CVCExploreApp TableHdr
BrowserHost (EDCOMMANDSLib) CLock CVCExploreDlg TABLEINFO
BSTRING CLockHandler CVCSecuritySampleClass TableSelection
BTSTR CLogFile CVector tag_BASENODE_PROPERTIES
C
CLoginDlg CVectorEx tag_chunkhdr
CAboutDlg CMain CView tag_filehdr
CAccount (vcacct) CMainFrame CViewList tag_keyframe
CAccount CMainWindow CVirtualFile tag_preroll
CAccount (ACCOUNT) CMallocSpy CWaitCursor tag_seq
CachePluginAdmin CMap CWaitDlg tag_smf
CacheProxyPlugin (CacheProxySamplePlugin) CMarkTextService CWaitSystemDlg tag_smffileinfo
CActivitySub CMD_ARGS CWbemClientApp tag_smfopenstruct
CAddDeviceDlg CMDIChild CWbemClientDlg tag_tempomapentry
CAddFolderDlg CMDIChildLite CWebBrowser tag_track
CAddrNode CMDIFrameLite CWiaDataCallback tagACCESSOR
CAddVFileDlg CMDIObjects CWinApp tagADSERRMSG
CAdminNotifyHandler CMDITrace CWindow tagADSIIF
CADOComponent CMember CWizard tagAppletCapability
CADQIApp CMemoryException CWizExtUser tagAppletCapability2
CADQIDlg CMemoryMappedInputStream CWndLite tagAppletCapabilityClass
CADsFirstExtApp CMessageDlg CWorkerThread tagAppletCapabilityID
CADsSearch CMetaTag CWrapVBComponent tagAppletChannelRequest
CADVCGENApp CMethodPro CX224 tagAppletLongString
CADVCGENDlg CMethodSub CXmlDOM tagAppletObjectKey
CAdvClientDlg CMgdClusCfgInit CXMLTreeApp tagAppletOctetString
CAdvRecoApp CMgdResType CXMLTreeDlg tagAppletProtocolEntity
CAgentCtlAnimationNames CMgrNotify
D
tagAppletRecord
CAgentCtlAudioObject CMMCControl DatabaseSettings (util) tagAppletRegistryEntryOwner
CAgentCtlBalloonEx CMmStream DatabaseSettings (helper) tagAppletRegistryItem
CAgentCtlCharacterEx CMmStreamBuf DataTypeEnum (msado15) tagAppletRegistryKey
CAgentCtlCharacters CMmStreamConsecBuf DBCONN tagAppletRegistryRequest
CAgentCtlCommandEx CModel DBG_THREAD_INFO tagAppletRoster
CAgentCtlCommandsEx CMonitor DEB_DLL_LIST_INFO_STRUCT tagAppletSessionKey
CAgentCtlEx CMonitorServer DEB_DLL_NODE_INFO_STRUCT tagAppletSessionRequest
CAgentCtlPropertySheet CMoveDlg DEB_PROCESS_LIST_INFO_STRUCT tagAppletTokenRequest
CAgentCtlRequest CMoveMoney (vcacct) DEB_PROCESS_NODE_INFO_STRUCT tagArFonts
CAgentCtlUserInput CMoveMoney DEB_STARTUP_INFO_STRUCT tagBRUSHSTYLELOOKUP
CAggregate CMSMQEventHandler DEB_THREAD_LIST_INFO_STRUCT tagCAPSLOOKUP
CAlterColumnDlg CMSOmniProvCommand DEB_THREAD_NODE_INFO_STRUCT tagCMTMLTFMT
CAlterIndexDlg CMSOmniProvRowset DebugGlobals tagCONSOLEDATA
CAlterTableDlg CMSOmniProvSession Deers tagCrmFilesCreateFileLogRecord
CAnchorTag CMSOmniProvSessionColSchemaRowset DeviceFinderCallBackInterface (CallbackIUnknownLib) tagCrmFilesDeleteFileLogRecord
CAnnotator CMSOmniProvSessionPTSchemaRowset Dimmer (MYDEVICELib) tagDataStruct
CAPIApp CMSOmniProvSessionTRSchemaRowset DimmerService (MYDEVICELib) tagDescInfo
CAPIDoc CMSOmniProvSource direct tagDescType
CAPIView CMultichanApp diritem tagDIAGINFO
CapJ CMultipleResults dirlist tagDRAWINFO
CAppExportDlg CMultipleResultsDlg DOREGSTRUCT tagEnhKeyUsage
CAppInfo CMultiRecoApp DTHandler tagENTRY
CAppInstallDlg CMultiValuedAttributeEditor DWSTR tagENUMLIST
CApplet CMultiValuedListBox
E
tagENUMPRTLOOKUP
CAppletSession CMyCapabilities ECB_QUEUE_ENTRY tagEVENT
CAppLite CMyEventProvider EDITARGS tagFieldMetaData
CAppShareNotify CMyEvictListener EditModeEnum (msado15) tagGRAPHICLOOKUP
CAppSub CMyInkCollector ENUMINFO tagHANDLES
CAppUtilDlg CMyInkEvents ENUMSYMDATA tagHeader
CascadeEC (cascadeec) CMyMemberSetChangeListener Error (msado15) tagICONEXTRACT
CAssoc CMySink Errors (msado15) tagINTERFACEIMPL
CAsyncFullServ CMyStartupListener ErrorsVtbl tagLABELEXTRACT
CAsynchBase CMyUIExtApp ErrorValueEnum (msado15) tagLINE
CAsynchNotify CMyUIExtModule ErrorVtbl tagLINE_INFO
CAsyncQuerySink CMyWizExtApp EventID tagLINEINFO
CAsyncTest CMyWizExtModule EventReasonEnum (msado15) tagLSTSLOT
CAsyncXXX CNetInterfaceData EventSink (RENDERLib) tagMAPMODELOOKUP
CategoryTreeNode (UDDI::Tools) CNetworkData EventStatusEnum (msado15) tagMETA16HEADER
CategoryTreeView (UDDI::Tools) CNewsEvent ExecuteOptionEnum (msado15) tagMULTI_SZ
CAttributeValueAddButton CNode EXEDLLICONINFO tagObject
CAttributeValueDeleteButton CLListImpl::CNode EXTENDER_NODE tagOleStdEnumFmtEtc
CAttributeValueEditButton CFixedAlloc::CNode EXTENSION_NODE tagOleStdEnumStatData
CAttributeValueEditor CNodeData
F
tagOLESTDMESSAGEFILTER
CAuthenticateAdmin CNotify Factory (RENDERLib) tagOPTIONS
CAuthenticateContext CNullModem FaxDlg tagPENSTYLELOOKUP
CAuthenticatePlugin CObjConstSub Field (msado15) tagPENWIDTHLOOKUP
CAVIFileReader CObjData Field15 (msado15) tagPIDLDATA
CAVIFileWriter CObject FieldAttributeEnum (msado15) tagPLUGXPRT_PARAMETERS
CBackground CObjPool2Sub FieldEnum (msado15) tagPOPUPMENUMAP
CBackgroundCopyCallback CObjPoolSub FieldInfo tagProperties
CBackgroundFolder CObjSecurity Fields (msado15) tagQtStruct
CBankDlg CObjSub Fields15 (msado15) tagRGPT
CBase CObjTree Fields20 (msado15) tagRowBuff
CBaseDialog COBLIST FieldsVtbl tagSEG
CBaseNode COBNODE FieldVtbl tagSERVERINFO
CBaseObj CoClipBookServerEx (CLUADMEXLib) FILE_CONTEXT_TYPE tagSLOT
CBasePropertyPage CODBCData filebuffer tagSTATMESSAGEMAP
CBehavior COfficeDlg filedata tagSTATUSBARLOOKUP
CBicycle CoFileShareSampleEx (CLUADMEXLib) FILEDEX tagTOOLDISPLAYDATA
CBicycleFolder COL fileline tagTrackObject
CBinder COLDESC FileRepClient tagUser
CBindings COleClient FileRepServer tagVIEWLIST
CBitArray COLEDBComponent FilterGroupEnum (msado15) TempBuffer
CBitmapWnd COleDocument FLAGMAPPING TEXTBUTTON_STRUCT
CBlackPen COleDocumentView FONTENUM THREAD_STRUCT
CBlockFormat COleInPlaceActiveObject FONTLIST ThreadArg_Struct
CBlockFrame COleInPlaceObject Form1 (CSharp_Draw) THREADARGS
CBox COleObject frmMain (WsdlDiscovery) ThreadArgs
CBoxFormat COLORPICKSTATE FullServ (fullsvr) THREADDATA
CBrowserHost ColProps
G
THREADINFO
CBrush ColPropsList GBGETINT CAsyncTest::threadParam
CBSTR COLUMNDATA GBGETTEXTA Title
CButtonLite COMAdminAccessChecksLevelOptions (comadmin) GBGETTEXTW tpc_hdr
CByotTransObj COMAdminActivationOptions (comadmin) GBMSG tphys_connect_info
CCacheMapEl COMAdminApplicationExportOptions (comadmin) GBSETINT TPropBase
CCallAs COMAdminApplicationInstallOptions (comadmin) GetRowsOptionEnum (msado15) TPropSetBase
CCallAsFactory COMAdminAuthenticationCapabilitiesOptions (comadmin) GLOBAL_STRUCT tree
CCallBack COMAdminAuthenticationLevelOptions (comadmin) GlobalVars TREEINFO
CCallbackWrapper COMAdminCatalog (comadmin) Grid (EDHOSTLib) treeitem
CCallNotify COMAdminCatalogCollection (comadmin) gss_buffer_desc_struct tReq
CCanvas COMAdminCatalogObject (comadmin) gss_channel_bindings_struct TS_VERSION_INFO
CCapMFCApp COMAdminComponentFlags (comadmin) gss_OID_desc_struct tSReq
CCapMFCDlg COMAdminErrorCodes (comadmin) gss_OID_set_desc_struct TYPEINFO
CCascade COMAdminFileFlags (comadmin)
H
U
CCaseTextService COMAdminImpersonationLevelOptions (comadmin) Handler (MSDFMAPLib) udp_hdr
CCertEncodeAltName COMAdminOS (comadmin) Hello2J UnionInt64
CCertEncodeBitString COMAdminServiceOptions (comadmin) Hello3J UPNPDimmerDevice
CCertEncodeCRLDistInfo COMAdminServiceStatusOptions (comadmin) HelloJ UPNPDimmerService
CCertEncodeDateArray COMAdminSynchronizationOptions (comadmin) HelloWorld UPNPSampleDimmerDevice (SDKDimmerServiceLib)
CCertEncodeLongArray COMAdminThreadingModels (comadmin) HelloWorld (ADSFIRSTEXTLib) UsageStringInfo
CCertEncodeStringArray COMAdminTransactionOptions (comadmin) HelperFunctions (Util)
V
CCertExitSample (CERTEXITSAMPLELib) Command (msado15) HtmlPropIFilter VERBMAPPING
CCertExitSample Command15 (msado15) HtmlPropIFilterCF view
CCertManageExitModuleSample (CERTEXITSAMPLELib) CommandTypeEnum (msado15) HTTP_REQUEST_PARAM viewline
CCertManageExitModuleSample CompareEnum (msado15) HTTP_REQUEST_RANGE VJQuery
CCertManagePolicyModuleSample (CERTPOLICYSAMPLELib) compitem HTTP_REQUESTCB_PARAM VTUNION
CCertManagePolicyModuleSample complist
I
W
CCertPolicySample (CERTPOLICYSAMPLELib) COMPlus IAccount (vcacct) WATCHER_DATA
CCertPolicySample ComSpy (COMSPYCTLLib) IAccount Win32 (storesh)
CChannelNotify ComSpyAudit (COMSPYAUDITLib) IADsError Win32 (Sample)
CCharBlock ComSpyPropPage (COMSPYCTLLib) IADsErrorVtbl WININFO
CCharGrid Conf IAnnotator WRITER_PARAMS
CChildView Connection (msado15) IAppletNotifyVtbl WRTHANDLE
CClassFactory Connection15 (msado15) IAppletSessionNotifyVtbl
X
CClassFactoryWrapper ConnectionEvents (msado15) IAppletSessionVtbl XactAttributeEnum (msado15)
CClassPro ConnectionEventsVt (msado15) IAppletVtbl XBStr
CClientApp ConnectModeEnum (msado15) IAuthenticateAdmin XInterface
CClientDlg ConnectOptionEnum (msado15) IAuthenticateContext XPtr
CClipBookServerApp ConnectPromptEnum (msado15) IAuthenticatePlugin XWindow
CClipBookServerParamsPage CONotify IBehavior
_
CCloseQueueDialog CONST_DWORD_REP IBrowserHost __POSITION
CClusPropList CONST_GUID_REP ICallFactory (fullsvr) _AcceptContext
CClusPropValueList CONST_WORD_REP ICancelMethodCalls (fullsvr) _ACCEPTEXARGS
CClusterData ContentInfo (CacheProxySamplePlugin) ICatalogCollection (comadmin) _ADO (msado15)
CClusterUtils ContextNameHint ICatalogObject (comadmin) _ADOCollectionVtbl
CCmdLineConsumerApp ContextSamplePropPage (CONTEXTSAMPLEPROPPAGELib) icmp_hdr _ADODynaCollectionVtbl
CCmdLineConsumerDlg COpenQueueDialog icmpv6_echo_request _ADOVtbl
CCmdLineLite CProxyPlugin::COpState icmpv6_hdr _AIO_WORK_ITEM
CCodeGrid COptionsAccessor ICOMAdminCatalog (comadmin) _APPMEM_COUNTERS
CColumnInfo COptionsCommand IComSpy _APPMEM_DATA_DEFINITION
CColumnProvider COptionsDataSource IComSpyAudit _APPMEM_DATA_HEADER
CComboBoxEx COptionsError ICOMSysLCE _APPMEM_INSTANCE
CComboBoxGuid COptionsNotify ICONDIR _ASYNC_REQUEST
CComboBoxLite COptionsRowset ICONDIRENTRY _AUTH_SEQ
CComboBoxString COptionsSheet ICONIMAGE _BALLDATA
CCommand CopyRecordOptionsEnum (msado15) IConnectionPointImpl _BEZBUFFER
CCommBand COrder ICONRESOURCE _BINDING_ENTRY
CCompartmentMonitor COShip ICreateTable _BLRPLATE
CCompImportDlg COShip2 IDataFactoryHandler (MSDFHDL) _BLRPLATECONFIG
CCompInstallDlg Counter IDBAuthAdmin _BOUNCEDATA
CComponent CPack IDBAuthPlugin _BUFFER
CComponentData CPage IDimmer _ClientContext
CCompositionEditSession CPageFormat IDimmerService _CLIPBOOKSERVER_RESOURCE
CComPtrArray (WiaWrap) CPaintCanvas IDispEventSimpleImpl _CMD
CComputer CParameters IEnumConnectionPoints _CMDI
CComSpy CPartitionInfo (MyStorageResourceLib) IEnumConnections _Collection (msado15)
CComSpyPropPage CPartitionInfo IEventSink _COLUMNDATA
CComSpySqlAudit CPeoplePoweredVehicle IFactory _Command (msado15)
CComSyncTest CPermEventsApp IFullServ (fullsvr) _CommandVtbl
CComWSTR CPermEventsDlg IGetReceipt (vcacct) _CONFIGURATION_ENTRY
CConfNotify CPersistFile igmp_group_record_v3 _CONNECTEXARGS
CConnectDlg CPersistStorage igmp_hdr _Connection (msado15)
CConnectionPoint CPerson igmp_hdr_query_v3 _ConnectionVtbl
CConnectionPointContainer CPidlMgr igmp_hdr_report_v3 _COPY_CHUNK
CConsole CPingResponder IGrid _CounterInfoBlock
CConstraintDlg CPlane IHelloWorld _CREDENTIAL
CConsumer CPlex IHelloWorldVtbl _CSampleDropExt
CContainerBase CPlgFilter IIDLookUp _CUSTOM_DIAL_DLG_SAMPLE_
CContext CPlgPin IInkCollectorEventsImpl _CUSTOM_ENTRY_DATA_SAMPLE_
CContextAdmin CPlgTermSample IInkRecognitionEventsImpl _DATA_BUFFER
CContextMenu CPluggableTransport IMMCControl _Default (InkBlog)
CContextMenuExtension CPoint IMMCControlVtbl _DEVICE_INFO
CContextPlugin CPooledData IMoveMoney (vcacct) _DIBDATA
CContextSamplePropPage CPower IMoveMoney _DISCONNECTEXARGS
CController CPrintAux IMyPersistStreamImpl _DLGITEMS
CCounterData CPrintCanvas INDEXINFO _DOSDTTM
CCreateQueueDialog CPrintRequest INewsEvent (persistatl) _DRAWDATA
CCreateTable CPrintSDIApp INewsEvent (newseventclass) _DRVLINE
CCriticalSection CPrintSDIDoc INewsEvent (cascadeec) _DRVLINECONFIG
CCrmDebugCompensator CPrintSDIView INewsEventDefault (persistatl) _DSA_SEC_PAGE_INFO
CCrmFilesCompensator CProcessDlg INewsEventDefault (newseventclass) _DynaCollection (msado15)
CCrmFilesTest CProgress INewsEventDefault (cascadeec) _DYNAMIC_LOCKS_STORE
CCrmFilesWorker CProgressDlg (WiaWrap) InitOle _DYNAMIC_READWRITE_LOCK
CCrmMonComp CProperties InkArea (InkBlog) _EAP_NAME_DIALOG
CCRMSub CPropertiesBase InkClipboard (InkClipboard) _EAPCB
CCTypeSet CPropertiesDlg InkCollection (InkCollection) _ENUMERATE_DIRECTORY_STACK
CCustomError CPropertyEditSession InkCollectorEvents _ENUMERATE_DIRECTORY_STATE
CCustomPropertyStore CPropertyIDs InkDividerForm (Microsoft::Samples::Ink::CS::InkDividerSample) _ERRORMAP
CDataAccess CPropertyInfos InkErase (InkErase) _EVENT_ENTRY
CDataCallback (WiaWrap) CPropertyPage InkHitTest (InkHitTest) _EVENT_SINK_INFO
CDataGrid CPropertyTag InkLayer (AutoClaims) _Events
CDataLinks CPropIDSets InkRecognition (InkRecognition) _ExpenseBuf
CDataNotify CPropInfoSets InkZoom (Microsoft::Samples::Ink::Cs::InkZoom) _EXT_WSPPROC_TABLE
CDataObject CPropPageLite INotify (qcnotify) _FFSTREAM
CDataset CProppageUser INotifyDefault (qcnotify) _FileInfo
CDataSource CProppageUserUI InputBox (CSharp_Draw) _FILESHARESAMPLE_PROPS
CDataXferObj CPropPro INSSBufferImpl (CacheProxySamplePlugin) _FILESHARESAMPLE_RESOURCE
CDbAlloc CPropSets InstDef _FILETIME
CDBAuthAdmin CPropSheetExtension INVOKE_INFO _foo
CDBAuthPlugin CPropSheetHost IOrder (qcorder) _FUNC_INFO
CDBFile CPropSheetLite IOrderDefault (qcorder) _FundsRM
CDBSession CProvFactory ip_hdr _HASH_TABLE
CDefClassFactory CProvider IPartitionProperties _htdata
CDelegationBase CProvider_IWbemEventConsumerProvider IPluggableTransport _IID
CDeleteObjectDlg CProvider_IWbemEventProvider IPTLauncher _IMEUIDATA
CDeleteQueueDialog CProvider_IWbemServices ipv4_option_hdr _INITDATA
CDeskBand CProvider_IWbemUnboundObjectSink ipv6_fragment_hdr _INTERFACE_ENTRY
CDeviceFinderCallback CProviderFactory ipv6_hdr _INTERFACEMAP
CDeviceNode CProxy IRecFields (msado15) _INTS
CDeviceProp CProxyIRowsetNotify IRowsetChange _IO_WORK_ITEM
CDialogBase CProxyPlugin IRowsetChangeImpl _IOCTLARGS
CDialogLite CPSTN IRowsetScrollImpl _IPSAMPLE_GLOBAL_CONFIG
CDialogStream CPTLauncher ISAPI_BUFFER _IPSAMPLE_GLOBAL_STATS
CDimmer CQCSub ISAPI_EXTENSION _IPSAMPLE_IF_BINDING
CDimmerService CQueryBox ISAPI_REQUEST _IPSAMPLE_IF_CONFIG
CDisdrawApp CQueryDlg ISAPI_STRING _IPSAMPLE_IF_STATS
CDisdrawDlg CQuickStringWrap ISAPI_STRINGW _IPSAMPLE_IP_ADDRESS
CDisplayAttributeInfo CRDOComponent ISAPITHREAD _IPSAMPLE_MIB_GET_INPUT_DATA
CDlgDest CREATEDATA IShip (qcship) _IPSAMPLE_MIB_GET_OUTPUT_DATA
CDlgIADs CREATEGIZMOA IShipDefault (qcship) _IPSAMPLE_MIB_SET_INPUT_DATA
CDlgIADsContainer CREATEGIZMOW ISnap _ITEM_DESC
CDlgIADsLargeInteger CreateTable (BANKVCLib) IsolationLevelEnum (msado15) _Job
CDlgIADsOpenDSObject CReceiveMessageDialog IStorageProperties _JOB_INFO
CDlgIADsPropertyList CReceiveWaitDialog ISynchronize _LOCAL_HEAP_INFO_BLOCK
CDlgIADsSecurityDescriptor CRecoOutputWnd ISynchronize (fullsvr) _LOCINFO
CDlgIDirectoryObject CRefClient item_tag _LOCKED_LIST
CDlgIDirectorySearch CRefCount ITEMINFO _LSP_ENTRY
CDlgSrc CRefresher itemlist _MAZEDATA
CDllData CRefresherMember ClientList::Iterator _MEMORY_ALLOC_BLOCK
CDllShared CRegAccess ITest _MESSAGE
CDog CReindeer IUpdateReceipt (vcacct) _metalookup
CDownloadBindStatusCallback CRenameDlg IUPnPService_DimmingService_SCPD (SDKDimmerServiceLib) _MIDL_PROC_FORMAT_STRING
CDownloadUI CRequestInstance IUPnPService_DimmingService_SCPD (MYDEVICELib) _MIDL_TYPE_FORMAT_STRING
CDragSource CResData IUPnPService_DimmingService_SCPD _MOF_INFO
CDrawArea CResourceSub IUPnPService_DimmingService_SCPDVtbl _MSD
CDropObject CResString IWMIObject _MSDI
CDropSource CResTypeData IWMIServices _MSV1_0_INTERACTIVE_LOGON
CDropTarget CResultset IWMSCacheAdmin _MultiSelectCookies
CDSLAdvancedPage CRichEditLite IWMSCacheItemCollectionImpl (CacheProxySamplePlugin) _MYDATA
CDSLConnectionPage CRocket IWMSCacheItemDescriptorImpl (CacheProxySamplePlugin) _MYXFORM
CDSLContextBox CRow IWMSContextAdmin _NAMEMAP
CDynamic CRowPosition IWMSContextPlugin _NETWORK_ENTRY
CDynamicResultset CRowset
K
_NoAddRefReleaseQIOnSmartPtr
CEapCfg CRowsetViewerDlg KEY_HEADER _node_tag
CEditBoxLite CRTCAVSession
L
_OPEN_FILE
CEditSessionBase CRTCEvents LessThan _OPTIONS
CEditValueDlg CRTCIMSession line (Util) _PACKET
CellData CRTCIncomingApp CImp_DrawDlg::Line _Parameter (msado15)
CellDataList CRTCIncomingDlg LineData _ParameterVtbl
CellPos CRTCOutgoingApp CLine::LINEDATA _PER_IO_CONTEXT
CEmptyVolumeCache CRTCOutgoingDlg LineSeparatorEnum (msado15) _PER_SOCKET_CONTEXT
CEnlistTransaction CRTCSession LIST_STRUCT _playinfo
CEntity CRTCWin LockTypeEnum (msado15) _POLYDATA
CEnumConnectionPoints CS1Dialog LOGON_DATA _PREF
CEnumConnections CS2Dialog LOGPAL _Printer
CEnumDisplayAttributeInfo CS3Dialog
M
_PROPIDLIST
CEnumerator CS4Dialog MainDlg _PROPSETLIST
CEnumFormatEtc CSAFEARRAY MainWindow (Sample::UI) _PROPSHEETCFG
CEnumIDList CSafeRefCount Margin _PROPVALUE
CEnumStorageResource (MyStorageResourceLib) CSampleDataContainer MarshalOptionsEnum (msado15) _PROVIDER
CEnumStorageResource CSampleDataSource MEMICONDIR _PRTDATA
CEnumSyncMgrItems CSampleDirectory MEMICONDIRENTRY _QOS_OPTIONS
CEnumTASK CSampleDirectoryInfo Messages (Sample) _Query
CEnumXXX CSampleInstance mib_entry _Queue
CEResyncEnum (msado15) CSampleMSP MMCControl (ATLCONTROLLib) _QueueHashNode
CError CSampleMSPCall MoveMoney (BANKVCLib) _QueueNode
Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA (Sample) CSampleMSPStream MoveRecordOptionsEnum (msado15) _RASHOST_DATA
CERT_SYSTEM_STORE_INFO (storesh) CSamplePipe MSOmniProv (THEPROVIDERLib) _READ_WRITE_LOCK
CEvent CSampleStemmer MyClassFactory _Record (msado15)
CEventCallback (WiaWrap) CSampleWordBreaker MyDataSource _Recordset (msado15)
CEventSink CSchemaDlg MyOSPObject _RecordsetVtbl
CEvtStoreSub CSCP MySignedXml (Sample) _RECV_INFO
CException CSCPCMenuApp MyString _RECVARGS
CExceptionSub CSCPCMenuDialog MYTOOLINFO _RECVFROMARGS
CExecuteParamDlg CSCPContextMenuModule
N
_REGSTRUCT
CExeModule CSCPPageBindingInfo NewDocDlg _RqsConfigString
CExList CSCPPageGeneral NewsEvent (persistatl) _RqsEngineCbInfo
CExplorerBar CSCPPageKeywords NewsEvent (newseventclass) _RSUMINFO
CExtBuffer CSCPUIBindingInfo NewsFlash _RU_SOCKET
CExtendContextMenuEx CSCPUIGeneral NewsSubscriber _RU_SOCKET_CREATE_DATA
CExtendPropertySheet CSCPUIKeywords NIDeque_c _RURASREGROOT
CExtObject CSCPWiz NIDequeIter_c _RUREGVALUE
CExtPageUser CSCPWizApp NILNode_c _SAMPLE_HELPER_DATA_
CExtractIcon CSCPWizModule NODE_PROPERTIES _SCHEMAINFO
CFactory CScreenCanvas NODE_STRUCT _SEARCH_REQUEST
CFactoryData CScriptTag NODESTRUCT _SEARCH_REQUEST_STATE
CFastVariant CScrollableView NONDIALTOKENS _SEC_CONTEXT
CFileIdx CScrollBarLite Note _SEC_FUNC
CFileIO CSDKSamplePlaylistParser Notify (qcnotify) _SECTION
CFileLite CSDKSamplePlaylistParserPlugin Notify _SEND_INFO
CFileShareSampleApp CSDKSampleStorageSystem
O
_SENDARGS
CFileShareSampleParamsPage CSecureObject Object_Property _SENDTOARGS
CFileStream CSecuritySub ObjectStateEnum (msado15) _SFFS
CFileTransferNotify CSelectEventsDlg Order (qcorder) _ShipStatus (qcnotify)
CFileViewer CSendMessageDialog
P
_Shutdown
CFixedAlloc CSerialStream PacketFilterPlugin (RealTimeStylusPlugins) _SIGGEN_COUNTER
CFlipDocEditSession CServer PaperForm (PaperForm) _SIGGEN_DATA_DEFINITION
CFlipEditSession CServerDlg Parameter (msado15) _SIGNATURE
CFolderNode CServiceCallback ParameterAttributesEnum (msado15) _SNMP_MGR_SESSION
CFont CServiceComp ParameterDirectionEnum (msado15) _SOCK_INFO
CFontRange CSession Parameters (msado15) _socklist
CFontSelect CSessionDlg ParametersVtbl _SP_OPTIONS
CFontSet CSet params _STANDARDSECINMEM
CFrame CSettings perf _STDZ
CFrameFormat CShellExt PersistedConfiguration _Stream (msado15)
CFrameWndLite CShellExtClassFactory PersistedConfigurationDataSet _STREAM_FIND_DATA
CFreeTest CShellFolder PersistFormatEnum (msado15) _stringstruct
CFtNotify CShellIconOverlayID PickleControlBlock _SUMMARYINFO
CFullConnect CShellView pipe_state _SynchInfo
CFullConnectOptions CShutdownDlg PlaylistItem (CacheProxySamplePlugin) ClientList::_tag_LIST_NODE
CFullConnectProperties CSids PlgTermSample (PLGTRMSMPLib) _tag_MMC_VERSION_INFO
CFullConnectProvider CSimple PluginListItem (RealTimeStylusPluginApp) _tag_NODE_ATTRIB_
CFullConnectSecurity CSimpleApp PMmStream _tagCol
CFullPropSpec CSimpleArray CPoint::POINT _tagCONFIGITEMLISTVIEWLPARAM
CFullServ CSimpleClass POINT3D _tagCONFIGSETTINGSLPARAM
CFVClassFactory CSimpleDialog port_hdr _tagDELETELOGERRORMSG
CGdiplusInit CSimpleDoc PositionEnum (msado15) _tagENABLEMODELESSMSG
CGenerateRC CSimpleObject PRIMARYKEY _tagESTABLISHCONNECTIONMSG
CGenericEnum CSimpleSite PrintContext _tagFILEOBJECT
CGenericUCPApp CSimpSvrApp CStaticNode::privateData _tagGENERICITEM
CGenericUCPDlg CSimpSvrDoc PRIVCLIPDATA _tagGENERICITEMLIST
CGetInfoExDlg CSimpSvrObj PROFILE_STRUCT _tagHANDLERITEM_SYNCSTATUS
CGetReceipt (vcacct) CSite Properties (msado15) _tagHANDLERITEMSETTINGS
CGetReceipt CSkateboard PropertiesVtbl _tagITEMCONFIGSETTINGSLPARAM
CGrid CSkateboardFolder Property (msado15) _tagLISTPROP
CGridIt CSkyBasedVehicle PropertyAttributesEnum (msado15) _tagLOGERRORMSG
CGroupData CSkyVehicle PropertyVtbl _tagLogon
CHandler CSmartComPtr Props _tagMETHODARGS
CHello CSmartPtr Provider_Globals _tagPOSDATA
CHelloClassFactory CSmartPtrTrace PROVIDERINFO _tagPOSTKEY
CHelloEditSession CSmpFilter PROVTYPEINFO _tagPREPAREFORSYNCCOMPLETEDMSG
CHILD_PROPERTIES CSmpFilterCF PTLauncher (BROCHUREMACHINELib) _tagPREPAREFORSYNCMSG
CHILDWINDOWDATA CSnap Publish (Microsoft::Uddi::Demo) _tagPROGRESSMSG
CHiPerfProvider CSnapinAbout
Q
_tagPROPSTRUCT
CHMMSampleApp CSnoopWnd Query _tagSAMPLEITEMSETTINGS
CHourglass CSpaceFolder Queue _tagSHOWERRORCOMPLETEDMSG
CHtmlElemBagEntry CSpaceStation
R
_tagSHOWERRORMSG
CHtmlElement CSpaceVehicle RealTimeStylusPluginApp (RealTimeStylusPluginApp) _tagSHOWPROPERTIESCOMPLETEDMSG
CHtmlElementBag CSpecialCharHashEntry RECEIVE_CONTEXT _tagSHOWPROPERTIESMSG
CHtmlIFilter CSpecialCharHashTable Record (msado15) _tagStatus
CHtmlIFilterBase CSplitterLite RecordCreateOptionsEnum (msado15) _tagSYNCHRONIZECOMPLETEDMSG
CHtmlIFilterCF CSpyCon RecordOpenOptionsEnum (msado15) _tagSYNCHRONIZEMSG
CHtmlScanner CStabilize Recordset (msado15) _tagTools
CHuman Cstack_c Recordset15 (msado15) _tagWorkerThreadArgs
CIceSkate CStartOfFileElement Recordset20 (msado15) _threadparameters
CIceSkateFolder CSTATest Recordset21 (msado15) _THUMB
CIdentitySub CStaticEntity RecordsetEvents (msado15) _TIME
CImageTag CStaticMap RecordsetEventsVt (msado15) _TRANSMITFILEARGS
CImp_DrawApp CStaticNode RecordStatusEnum (msado15) _TRANSMITPACKETSARGS
CImp_DrawDlg CStatusBarLite RecordTypeEnum (msado15) _TYPEMAP
CImpAuth CStatusHelper RECTI _UNICODE_STRING
CImpIAccessor CStdDbOutput RecvBuf _UNITSTABLE
CImpIAdviseSink CStorageBuffer RefCount _USER_EVENT
CImpIBindResource CStorageResource (MyStorageResourceLib) REGENTRY _USER_INFO
CImpIColumnsInfo CStorageResource REGSTRUCT _VIRTUAL_BUFFER
CImpICommandProperties CStorageResType (MyStorageResourceLib) REQUEST_CONTEXT _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION
CImpICommandText CStorageResType RESOURCEPOSINFO _WAVE_DATA
CImpIConvertType CStream RESULTDATA _WIDEDBIDMAP
CImpICreateRow CString ResyncEnum (msado15) _WIDEGUIDMAP
CImpIDBBinderProperties CStringData RqsClient _WIDENAMEMAP
CImpIDBCreateCommand CStringException RqsConfig _WORK_QUEUE
CImpIDBCreateSession CStringTable RqsEngine _WORK_QUEUE_ITEM
CImpIDBInfo CSurrogate RSProxy _WORK_THREAD_DATA
CImpIDBInitialize CSyncMgrHandler RUN _WSAOVERLAPPEDPLUS
CImpIDBProperties CSysLCESub
S
_WSARECVMSGARGS
CImpIFileViewer CTable Sample (Sample) _XFORMDATA
CImpIGetDataSource CTableCopy
A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | _
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- j -

  • JobError() : CBackgroundCopyCallback , CMonitor
  • JobId : _Job
  • JobModification() : CBackgroundCopyCallback , CMonitor
  • JobTransferred() : CMonitor , CBackgroundCopyCallback
  • JobType : _JOB_INFO
  • Join() : CAppletSession
  • JoinSessionConfirm() : CAppletSession
  • JoinTransactionProc() : CMDIChild
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- k -

  • key : treeitem , APMFILEHEADER
  • KeyDown() : CController
  • keyInfoBox : Sample::UI::MainWindow
  • KeyUp() : CController
  • kpszCharacterWindowTitle : CapJ
  • kpszOptionsWindowTitle : CapJ
  • kpszRecentFilesItem : CapJ
  • kpszRecentFilesSubkey : CapJ
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- l -

  • l : UnionInt64 , _ParameterVtbl
  • label1 : CSharp_Draw::InputBox
  • labelSign : Sample::UI::MainWindow
  • LabelType : STL_LABEL
  • labelVerify : Sample::UI::MainWindow
  • LabelVersion : STL_LABEL
  • lAddVerbs() : CSimpleDoc , CSimpSvrDoc
  • LassoPercent : InkClipboard::InkClipboard
  • lassoPoints : InkClipboard::InkClipboard
  • Last() : NIDequeIter_c< T >
  • last : section , filebuffer
  • Last() : CListHeader
  • lastDrawnLassoDot : InkClipboard::InkClipboard
  • LastModified : CacheProxySamplePlugin::ContentInfo
  • lastMouseDownEventArgs : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • LastName : Serialization::SerializationForm
  • LastNameBox : Serialization::SerializationForm
  • LastNameLabel : Serialization::SerializationForm
  • LastSize : PickleControlBlock
  • lAttr : _ConnectionVtbl
  • lAttributes : PropertyVtbl
  • LaunchError() : CWrapVBComponent
  • LaunchPT() : IPTLauncher , CPTLauncher
  • LayeredEntries : _LSP_ENTRY
  • LayeredGuidCount : _LSP_ENTRY
  • LayeredGuids : _LSP_ENTRY
  • LayeredProvider : _PROVIDER
  • LayeredSocket : _SOCK_INFO
  • lblDSConnection : CSharp_Draw::Form1
  • lblInstructions : AutoClaims::AutoClaims
  • lblInsuredName : AutoClaims::AutoClaims
  • lblMake : AutoClaims::AutoClaims
  • lblModel : AutoClaims::AutoClaims
  • lblPluginList : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • lblPolicyNumber : AutoClaims::AutoClaims
  • lblRemoteComputer : CSharp_Draw::Form1
  • lblRemoteQueue : CSharp_Draw::Form1
  • lblTitle : AutoClaims::AutoClaims
  • lblVehicleDamage : AutoClaims::AutoClaims
  • lblVehicleDescription : AutoClaims::AutoClaims
  • lblYear : AutoClaims::AutoClaims
  • lblZoom : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • lButtonDown() : CSimpSvrDoc , CSimpSvrObj
  • lChapter : ADORecordsetConstructionVtbl
  • lcid : ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , _ADOCollectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOCollectionVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , _ADOCollectionVtbl , IMMCControlVtbl , _ADODynaCollectionVtbl , SLangRegistry
  • Lcid() : CExtObject
  • lcid : _ADODynaCollectionVtbl
  • Lcid() : CExtObject
  • lcid : _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl
  • lCmdType : _CommandVtbl
  • lCommandHandler() : CSimpleApp , CSimpSvrApp
  • lContextHint : ContextNameHint
  • lCreateDoc() : CSimpleApp , CSimpSvrApp
  • lCursorLoc : _ConnectionVtbl , _RecordsetVtbl
  • lCursorType : _RecordsetVtbl
  • lDOSDttm : _DOSDTTM
  • Leave() : CCriticalSection , CLock , CAppletSession
  • LeaveSessionIndication() : CAppletSession
  • left : complist , Margin , treeitem , RECTI , compitem
  • leftbase : section
  • leftBottomHandle : InkClipboard::InkClipboard
  • leftCenterHandle : InkClipboard::InkClipboard
  • leftTopHandle : InkClipboard::InkClipboard
  • leIndexSortedList : _NETWORK_ENTRY
  • leIndexSortedListLink : _INTERFACE_ENTRY
  • leInterfaceTableLink : _INTERFACE_ENTRY
  • leLink : _DYNAMIC_READWRITE_LOCK
  • lenflags : tpc_hdr
  • Length : FieldVtbl , CacheProxySamplePlugin::INSSBufferImpl , _UNICODE_STRING , CComWSTR , CISeqStream
  • length : treeitem , FieldInfo , gss_OID_desc_struct , gss_buffer_desc_struct
  • lError : NONDIALTOKENS
  • Level : _ConnectionVtbl , _MOF_INFO
  • lExpiration : CacheProxySamplePlugin::ContentInfo
  • lf : FONTENUM , tagArFonts , _PREF
  • lHeight : CPerson , CRocket , CPlane
  • libName() : APIHook< T >
  • LibraryPathA : _PROVIDER
  • LibraryPathW : _PROVIDER
  • Line() : CCanvas
  • line : viewline
  • LineFromChar() : CRichEditLite
  • LineHandle : _JOB_INFO
  • LineIndex() : CEditBoxLite
  • LineItem()
: qcnotify::INotify
, qcnotify::INotifyDefault
, qcnotify::Notify
, qcorder::IOrder
, qcorder::IOrderDefault
, qcorder::Order
, qcship::IShip
, qcship::IShipDefault
, qcship::Ship
, CONotify
, COrder
, COShip
, CONotify
, COrder
, COShip2
  • LineLength() : CEditBoxLite
  • linenr : fileline
  • linepos : LineData
  • lines : filedata , CSharp_Draw::Form1
  • LineScan() : CComputer
  • LineScroll() : CEditBoxLite
  • LineToString() : Util::HelperFunctions
  • link : fileline , section
  • List : _WORK_QUEUE_ITEM
  • ListBoxSize : GLOBAL_STRUCT
  • ListBoxWndProc : MainDlg
  • listen() : DTHandler
  • Listen() : CAgentCtlCharacterEx
  • ListeningState() : AgentNotifySink , Notify
  • listEntry : _AIO_WORK_ITEM
  • ListEntry : _USER_INFO
  • ListError : LIST_STRUCT
  • Listing : storesh::Storesh
  • LISTNODE : ClientList
  • listopts : THREADARGS
  • lItem : _NAMEMAP , _WIDENAMEMAP
  • live : WRTHANDLE
  • llFreeLocksList : _DYNAMIC_LOCKS_STORE
  • lLockType : _RecordsetVtbl
  • lMaxRecords : _RecordsetVtbl
  • lMode : _ConnectionVtbl
  • lNotifyHandle : _PROPSHEETCFG
  • Load() : CPersistFile , CPersistStorage , CSimpSvrDoc , CDynamic , CEntity , CResultset , CWebBrowser , CPropertyPage , CDSLConnectionPage , IMyPersistStreamImpl< T > , RqsConfig , CComponentData , CAgentCtlCharacters , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CResString , CSmpFilter , CCommBand , CDeskBand , CExplorerBar , CToolBand , CImpIPersistFile , CShellExt
  • LoadAll() : CBankDlg
  • LoadAppCombo() : CCompImportDlg , CCompInstallDlg
  • LoadArray() : CComputer , CHuman
  • LoadBitmaps() : CComponentData , CDelegationBase
  • LoadCharacter() : MainDlg , CCapMFCDlg , CapJ , Hello3J
  • LoadConfig() : CacheProxySamplePlugin::CacheProxyPlugin , RqsConfig
  • LoadConfigValues() : CContextPlugin
  • loadData() : MyOSPObject
  • LoadDBPROP() : CUtilProp
  • LoadDBPROPINFO() : CUtilProp
  • LoadDefaults() : CFullConnect
  • LoadDialog() : CImportRes
  • LoadDllServer() : CSurrogate
  • LoadFile() : CXmlDOM , CMultiRecoApp
  • LoadFromFile()
: msado15::Stream
, msado15::_Stream
  • LoadFromStorage() : CSimpSvrObj
  • LoadFromStream() : CEntity
  • LoadInitString() : CServiceComp
  • LoadISF() : Serialization::SerializationForm
  • LoadMenu() : CAdvRecoApp , CMultiRecoApp
  • LoadOptions() : COptionsSheet
  • LoadProperty() : CTSFPersistentPropertyLoader
  • LoadPropertyValues() : CReindeer
  • LoadRecentConfig() : CFullConnect
  • LoadRecentFile() : CFullConnect
  • LoadSettings() : CMainWindow
  • LoadSettingsFromServerNamespace() : CachePluginAdmin
  • LoadSettingsFromXmlFile() : CachePluginAdmin
  • LoadStream() : CXmlDOM
  • LoadString() : CImportRes
  • LoadSurfaces() : CBicycle
  • LoadTModels() : UDDI::Tools::CategoryTreeView
  • LoadTrace() : RqsConfig
  • LoadXML() : CXmlDOM , Serialization::SerializationForm , CXMLTreeDlg
  • LocalFileName : tSReq , tReq
  • LocalMachine : storesh::Storesh
  • localname : diritem
  • LocalTime : _INITDATA
  • Lock : tReq , tSReq , CDBAuthPlugin , CSampleInstance
  • lock : _LOCKED_LIST
  • Lock() : CLockHandler
  • LockBuffer() : CString
  • lockCount() : CFactory
  • LockRegion() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream
  • LockServer() : CClassFactory , HtmlPropIFilterCF , CClassFactory , CFactory , CClassFactory , CSmpFilterCF , CClassFactory , CClassFactoryWrapper , CClassFactory , CFactory , CClassFactory , CHelloClassFactory , CFactory , CClassFactory , MyClassFactory , CClassFactory , CCallAsFactory , CClassFactory , CProvFactory , CClassFactory , CHtmlIFilterCF , CClassFactory , CShellExtClassFactory , CClassFactory , CProvFactory , CLanguageResourceSampleCF , CClassFactory , CFVClassFactory , CClassFactory
  • LockType : _RecordsetVtbl
  • LogError() : CSyncMgrHandler , CCallbackWrapper
  • LogErrorMsg : _tagMETHODARGS
  • LogFile() : IComSpy
  • LogFont : PROFILE_STRUCT
  • LoginPrompt() : CImp_DrawDlg
  • LogonDomainName : _MSV1_0_INTERACTIVE_LOGON
  • LogPrunedDisk() : CEnumStorageResource
  • LogToFile() : IComSpy
  • LONG : CImpIAdviseSink
  • LongQuote()
: newseventclass::NewsEvent
, NewsSubscriber
, cascadeec::CascadeEC
, newseventclass::INewsEventDefault
, persistatl::INewsEventDefault
, newseventclass::INewsEvent
, CNewsEvent
, cascadeec::INewsEventDefault
, cascadeec::INewsEvent
, persistatl::INewsEvent
, persistatl::NewsEvent
  • longVal : _tagPROPSTRUCT
  • Lookup() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , COBLIST , CSpecialCharHashTable , CStaticMap
  • LookupFree() : CProxy
  • loopCount : _ClientContext
  • lParam : GBMSG
  • lParmAttribs : _ParameterVtbl
  • lParmDirection : _ParameterVtbl
  • lPayload : CRocket , CPlane
  • lpBack : tagINTERFACEIMPL
  • lpbAlloc : tag_seq
  • lpBuffer : REQUEST_CONTEXT
  • lpBuffers : _RECVARGS , _SENDTOARGS , _SENDARGS , _RECVFROMARGS
  • lpButtonText : TEXTBUTTON_STRUCT
  • lpbyBuf : _tagLISTPROP , _tagPOSTKEY
  • lpByte : _THUMB
  • lpCallerCompletionRoutine : _WSAOVERLAPPEDPLUS
  • lpCallerOverlapped : _WSAOVERLAPPEDPLUS
  • lpcErrorText : _tagLOGERRORMSG
  • lpContext : _FFSTREAM
  • lpCriticalSection : Queue
  • lpDataBuffer : HTTP_REQUESTCB_PARAM
  • lpfnAcceptEx : _EXT_WSPPROC_TABLE
  • lpfnCI : CDefClassFactory
  • lpfnConnectEx : _EXT_WSPPROC_TABLE
  • lpfnDisconnectEx : _EXT_WSPPROC_TABLE
  • lpfnGetAcceptExSockaddrs : _EXT_WSPPROC_TABLE
  • lpfnTransmitFile : _EXT_WSPPROC_TABLE
  • lpfnTransmitPackets : _EXT_WSPPROC_TABLE
  • lpfnWSARecvMsg : _EXT_WSPPROC_TABLE
  • lpFrom : _RECVFROMARGS
  • lpFromLen : _RECVFROMARGS
  • lpmhFree : tag_seq
  • lpmhPreroll : tag_seq
  • lpMsg : _WSARECVMSGARGS
  • lpOutputBuffer : _ACCEPTEXARGS
  • lpPacketArray : _TRANSMITPACKETSARGS
  • lpPoints : tagSEG
  • lpSendBuffer : _CONNECTEXARGS
  • LPSTGMEDIUM : CImpIAdviseSink
  • lpstrFileName : DEB_PROCESS_NODE_INFO_STRUCT , DEB_DLL_NODE_INFO_STRUCT , DEB_STARTUP_INFO_STRUCT
  • lpstrPathName : DEB_STARTUP_INFO_STRUCT , DEB_PROCESS_NODE_INFO_STRUCT , DEB_DLL_NODE_INFO_STRUCT
  • lpstzName : _THUMB
  • lpSyncLogError : _tagLOGERRORMSG
  • lpSyncProgressItem : _tagPROGRESSMSG
  • lpsz : tagLABELEXTRACT , _tagCol , COL
  • lpszData : REGSTRUCT , _REGSTRUCT
  • lpszSubKey : REGSTRUCT , _REGSTRUCT
  • lpszValueName : DOREGSTRUCT , REGSTRUCT , _REGSTRUCT
  • LPTEST : ITest
  • LPtoDP() : CCanvas
  • lpTransmitBuffers : _TRANSMITFILEARGS
  • lpvInBuffer : _IOCTLARGS
  • lpvMapView : _FileInfo
  • lpvOutBuffer : _IOCTLARGS
  • lpVtbl : tagINTERFACEIMPL , CMallocSpy , tagOleStdEnumStatData , tagOleStdEnumFmtEtc
  • lpWSPStartup : _PROVIDER
  • lpwszConnection : _tagESTABLISHCONNECTIONMSG
  • lqEventQueue : _CONFIGURATION_ENTRY
  • lResizeDoc() : CSimpleDoc , CSimpSvrDoc , CSimpleDoc
  • lResult : _FUNC_INFO
  • lSizeHandler() : CSimpleApp , CSimpSvrApp , CSimpleApp
  • lSpeed : CPerson
  • LspOrder : _LSP_ENTRY
  • lstAnnotationLayer : AutoClaims::AutoClaims
  • lstAnnotationLayer_SelectedIndexChanged() : AutoClaims::AutoClaims
  • lstrObjectID : tagAppletObjectKey
  • lTimeout : _ConnectionVtbl
  • lVal : VTUNION
  • lValue : InstDef
  • LVEventItemChanged() : CSelectEventsDlg
  • LVSystemEventItemChanged() : CSelectEventsDlg
  • lWeight : CRocket , CPlane , CPerson
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- m -

  • m_acePtrList : CDlgIADsSecurityDescriptor
  • m_aCounter : CSampleInstance
  • m_acpEnd : CTSFEditWnd
  • m_acpStart : CTSFEditWnd
  • m_ActionInArgument : CGenericUCPDlg
  • m_ActionName : CGenericUCPDlg
  • m_ActionOutArgument : CGenericUCPDlg
  • m_ActiveSelEnd : CTSFEditWnd
  • m_ActualGraphState : CSampleMSPStream
  • m_AddButton : CMultiValuedAttributeEditor
  • m_addEquipment : CAdvClientDlg
  • m_AdminPathNameCB : CSendMessageDialog
  • m_Adviselimit : CConnectionPoint
  • m_AdviseSink : CSimpleSite , CTSFEditWnd
  • m_Agent : CCapMFCDlg
  • m_AgentEx : HelloJ , Hello2J , Notify , Hello3J
  • m_aInstance : CSampleDataSource
  • m_aKey : CStaticMap
  • m_alHandle : CSampleDataSource
  • m_Animations : CCapMFCDlg
  • m_AnimationsLabel : CCapMFCDlg
  • m_apEnumerator : CRefresher
  • m_aPidls : CContextMenu , CDataObject
  • m_apIMembers : CConfNotify
  • m_apInstances : CRefresher
  • m_apInstMap : CRefresher
  • m_apMembers : CAppletSession
  • m_Applet : Notify
  • m_apstrCDPRevocationURL : CCertPolicySample
  • m_apstrDisableExtensions : CCertPolicySample
  • m_apstrEnableRequestExtensions : CCertPolicySample
  • m_apstrIssuerCertURL : CCertPolicySample
  • m_apwszDisableExtensions : CCertPolicySample
  • m_apwszEnableEnrolleeRequestExtensions : CCertPolicySample
  • m_apwszEnableRequestExtensions : CCertPolicySample
  • m_arrWorkerThreads : ISAPITHREAD
  • m_astrDevType : CGenericUCPDlg
  • m_astrSubjectAltNameObjectId : CCertPolicySample
  • m_astrSubjectAltNameProp : CCertPolicySample
  • m_AsyncFind : CGenericUCPDlg
  • m_aT : CSimpleArray< T >
  • m_Authenticated : CSendMessageDialog
  • m_aValue : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeCRLDistInfo
  • m_backgroundHwnd : CBackgroundFolder
  • m_bAddedCommands : MainDlg
  • m_bAllMSGestures : CAdvRecoApp
  • m_BalloonAutoHide : CCapMFCDlg
  • m_BalloonAutoPace : CCapMFCDlg
  • m_BalloonEnabled : CCapMFCDlg
  • m_BalloonSizeToText : CCapMFCDlg
  • m_bAllSSGestures : CAdvRecoApp
  • m_bAnimating : CMMCControl
  • m_BaseObjectType : CBaseObj
  • m_bAsynch : CDlgIDirectorySearch
  • m_bAtlBrowserHelp : CBrowserHost
  • m_bAttrib : CDlgIDirectorySearch
  • m_bAudit : CComSpy
  • m_bAutoAnswer : CRTCIncomingDlg
  • m_bBackPressed : CBasePropertyPage
  • m_bBMP : WiaWrap::CDataCallback
  • m_bButton10Down : CBrowserHost
  • m_bButton2Down : CBrowserHost
  • m_bButton3Down : CBrowserHost
  • m_bButton4Down : CBrowserHost
  • m_bButton5Down : CBrowserHost
  • m_bButton6Down : CBrowserHost
  • m_bButton7Down : CBrowserHost
  • m_bButton8Down : CBrowserHost
  • m_bButton9Down : CBrowserHost
  • m_bCacheResult : CDlgIDirectorySearch
  • m_bCancelled : WiaWrap::CProgressDlg
  • m_bChangesArePending : CVCExploreDlg
  • m_bClearAll : CPropertiesDlg
  • m_bClearText : CDlgIADsOpenDSObject
  • m_bClosed : CDBFile
  • m_bCoerceInputScope : CAdvRecoApp
  • m_bConstructed : CAccount , CUpdateReceipt , CPooledData
  • m_bCSV : CComSpy
  • m_bDirty : CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords
  • m_bDisplayWaitCursor : CMainWindow
  • m_bDoDetach : CBasePropertyPage
  • m_bEnableCtxMenus : CBrowserHost
  • m_bEnableFilter : CDlgIDirectorySearch
  • m_bEncrypt : CDlgIADsOpenDSObject
  • m_bEOF : CFileLite
  • m_bFastBind : CDlgIADsOpenDSObject
  • m_bFocus : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • m_bHasMRUSeparator : MainDlg , CCapMFCDlg
  • m_bInCall : Conf
  • m_bInConnection : CPluggableTransport
  • m_Bindings : CParameters , CDataAccess
  • m_bInPlaceActive : CSpyCon , CBrowserHost
  • m_bIsChecked : CBrowserHost
  • m_bIsTaskpadPreferred : CComponent
  • m_bKnownSafeContext : CPlgTermSample
  • m_bLogToFile : CComSpy
  • m_blue : CSimpSvrObj
  • m_bmk : CRow
  • m_bNeedCreate : CSCPPageGeneral
  • m_bNewGesture : CRecoOutputWnd
  • m_bNoAuthentication : CDlgIADsOpenDSObject
  • m_bObjectPooled : CAccount , CUpdateReceipt , CPooledData
  • m_bOnlineStatus : CDeviceNode
  • m_bOverwriteFiles : CAppExportDlg , CAppInstallDlg
  • m_bPriority : CSendMessageDialog
  • m_bPrompt : CDlgIADsOpenDSObject
  • m_bReadOnly : CDlgIADsOpenDSObject
  • m_bReadyForDelete : CAppInfo
  • m_bRegisteredForConnectionNotification : RqsEngine
  • m_bRemoteInstall : CAppInstallDlg
  • m_bRequiresSave : CDynamic , CEntity , CLine , CPoint
  • m_bRetrieved : CRow
  • m_bSaved : CBasePropertyPage
  • m_bSaveOnExit : CSpyCon
  • m_bSchemaRowset : CDataAccess
  • m_bSealing : CDlgIADsOpenDSObject
  • m_bSecured : CDlgIADsOpenDSObject
  • m_bSelected : CBackgroundFolder
  • m_bShouldEnlist : CAccount , CUpdateReceipt , CPooledData
  • m_bShowGridLines : CComSpy
  • m_bShowOnScreen : CComSpy
  • m_bSigning : CDlgIADsOpenDSObject
  • m_bSnapOn : CSnap
  • m_bStop : CMain
  • m_bstr : CUtilBSTR , BSTRING
  • m_bstrBootDevice : CEnumStorageResource
  • m_bstrBootLogicalDisk : CEnumStorageResource
  • m_bstrCAName : CCertPolicySample
  • m_bstrCASanitizedDSName : CCertPolicySample
  • m_bstrCASanitizedName : CCertPolicySample
  • m_bstrConn : CUtil
  • m_bstrCrashDumpLogicalDisk : CEnumStorageResource
  • m_bstrCurRecoName : CAdvRecoApp , CMultiRecoApp
  • m_bstrDatasource : CUtil
  • m_bstrDescription : CCertExitSample , CCertPolicySample , CPartitionInfo , CStorageResource
  • m_bstrDeviceID : CStorageResource
  • m_bstrDiskDeviceID : CPartitionInfo
  • m_bstrDisplayName : CMgdClusCfgInit
  • m_bstrDllName : CMgdClusCfgInit
  • m_bstrFileName : CCrmFilesTest
  • m_bstrFriendlyName : CStorageResource
  • m_bstrHost : CProxyPlugin::COpState
  • m_bstrIniFile : CUtil
  • m_bstrMachineDNSName : CCertPolicySample
  • m_bstrMyProperty : CPower , CSimple
  • m_bstrName : CPartitionInfo , CStorageResource
  • m_bstrNodeName : CMgdClusCfgInit
  • m_bstrOriginUrl : CProxyPlugin::COpState
  • m_bstrOrigOutputPath : CContextSamplePropPage
  • m_bstrOutputPath : CContextPlugin , CContextSamplePropPage
  • m_bstrPath : CProxyPlugin::COpState
  • m_bstrProtocol : CProxyPlugin::COpState
  • m_bstrResTypeName : CMgdClusCfgInit
  • m_bstrResults : CRecoOutputWnd
  • m_bstrSectionConn : CUtil
  • m_bstrSectionName : CUtil
  • m_bstrSectionUserlist : CUtil
  • m_bstrSql : CUtil
  • m_bstrSqlSection : CUtil
  • m_bstrSystemDevice : CEnumStorageResource
  • m_bstrSystemLogicalDisk : CEnumStorageResource
  • m_bstrSystemWMIDeviceID : CEnumStorageResource
  • m_bstrTipUrl : CEnlistTransaction
  • m_bstrUID : CPartitionInfo
  • m_bstrUsername : CAuthenticateContext
  • m_bTaskpadView : CComponent
  • m_btnAddParty : CRTCOutgoingDlg
  • m_btnAddQueue : CDisdrawDlg
  • m_btnAnswer : CRTCIncomingDlg
  • m_btnAppSharing : CRTCOutgoingDlg
  • m_btnAttach : CDisdrawDlg , CImp_DrawDlg
  • m_btnConnect : CRTCOutgoingDlg
  • m_btnDisconnect : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_btnPcPc : CRTCOutgoingDlg
  • m_btnPcPh : CRTCOutgoingDlg
  • m_btnPhPh : CRTCOutgoingDlg
  • m_btnRemoveParty : CRTCOutgoingDlg
  • m_btnSetProperty : CVCExploreDlg
  • m_btnTune : CRTCOutgoingDlg
  • m_bTopmost : CSpyCon
  • m_bUnblocking : tagOLESTDMESSAGEFILTER
  • m_bUnicode : CFileLite
  • m_bUnicodeMsg : CWndLite
  • m_bUseComPlus : CMoveMoney
  • m_bUsePing : CClientDlg
  • m_bUsingDefaultCharacter : Hello2J
  • m_butClose : CDlgSrc
  • m_butPlay : CDlgDest , CDlgSrc
  • m_butStop : CDlgDest , CDlgSrc
  • m_bViewUpdated : CBackgroundFolder
  • m_bwIP : CFrame
  • m_bWizard : CExtObject
  • m_CAccessor : COptionsSheet
  • m_cACEList : CDlgIADsSecurityDescriptor
  • m_cADsPath : CADQIDlg
  • m_CADsSearchScope : CDlgIDirectorySearch
  • m_cADsType : CDlgIADsPropertyList
  • m_callInProgress : CAsyncFullServ
  • m_cAllocations : CMallocSpy
  • m_cAllocCalls : CDbAlloc
  • m_CancelButton : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_CAPathLength : CCertPolicySample
  • m_cAttributes : CDlgIDirectoryObject
  • m_cAttrList : CDlgIADs , CDlgIDirectorySearch
  • m_CAType : CCertPolicySample
  • m_cAveBitsPerSec : CDlgDest
  • m_cAxis : CDataset
  • m_cb : CAddrNode
  • m_cBad : CClientDlg
  • m_cbAlloc : CExtBuffer
  • m_cbBufferSize : CClusPropValueList , CClusPropList
  • m_cbBufSize : RecvBuf
  • m_cbData : CDlgDest , CDlgSrc
  • m_cbDataLeft : CClusPropValueList , CClusPropList
  • m_cbDataSize : CClusPropValueList , CClusPropList
  • m_cbhCurrentProp : CClusPropList
  • m_cbhCurrentPropName : CClusPropList
  • m_cbhCurrentValue : CClusPropValueList
  • m_cbHeapUsed : CFileIO
  • m_cbhPropList : CClusPropList
  • m_cbhValueList : CClusPropValueList
  • m_cbItem : CExtBuffer
  • m_cBits : CCertEncodeBitString
  • m_cboApplications : CCompImportDlg , CCompInstallDlg
  • m_cbPage : CBitArray
  • m_CBParam : CUrlmonCallback
  • m_cbRead : CFileLite
  • m_cbRequest : CMallocSpy
  • m_cbRequested : CMallocSpy
  • m_cbReserved : CExtBuffer
  • m_cbRowSize : CRow , CParameters , CDataAccess , CFileIO , CRow , CRowset
  • m_cbTotalRowSize : CRowset
  • m_cBufSize : CISeqStream
  • m_cbWritten : CFileLite
  • m_cCACert : CCertExitSample
  • m_cCacheResult : CDlgIDirectorySearch
  • m_cCDPRevocationURL : CCertPolicySample
  • m_cChannelMask : CDlgDest
  • m_cChannels : CChildView , CDlgDest
  • m_cChaseReferrals : CDlgIDirectorySearch
  • m_cChildList : CDlgIADsContainer
  • m_cchildren : CSpaceVehicle
  • m_cChildSpaceStations : CSpaceStation
  • m_cchOldLength : CTSFEditWnd
  • m_cchRangeDelimiter : CUrlmonCallback
  • m_cColAccess : CRow
  • m_cCols : CDBFile , CMSOmniProvRowset , CRowset
  • m_cColumns : CFileIO , CTable , MyOSPObject , CInkInputWnd
  • m_CComboInterface : CInterfaceDlg
  • m_CComboReserved : CMultipleResultsDlg
  • m_CCommand : COptionsSheet
  • m_cCompositions : CTSFEditWnd
  • m_cComputerInput : CDisdrawDlg , CImp_DrawDlg
  • m_cComputerLabel : CDisdrawDlg , CImp_DrawDlg
  • m_cConnectionMode : CDisdrawDlg
  • m_cContinueButton : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_cCP : CConnectionPointContainer
  • m_cCRLPublishRetryCount : CCertExitSample
  • m_cd : CBankDlg
  • m_cDataCount : CDataObject
  • m_CDataSource : COptionsSheet
  • m_CDefPropSets : CMDIChild
  • m_cDisableExtensions : CCertPolicySample
  • m_cDiskCount : CEnumStorageResource
  • m_cDsFrame : CDisdrawDlg , CImp_DrawDlg
  • m_cElements : CVector< TYPE, IDX >
  • m_cELT : CEnumXXX< T, ELT_T, IFACE >
  • m_cEnableEnrolleeRequestExtensions : CCertPolicySample
  • m_cEnableFilter : CDlgIDirectorySearch
  • m_cEnableRequestExtensions : CCertPolicySample
  • m_cEnumInfo : CEnumerator
  • m_CError : COptionsSheet
  • m_CertType : CCertPolicySample
  • m_cEvents : CComSpy
  • m_cExecute : CDlgIDirectorySearch
  • m_cExtraCols : CRow
  • m_cfDsDisplaySpecOptions : CSCPCMenuDialog
  • m_cfDSDispSpecOptions : CPropSheetHost
  • m_cfDSObjectNames : CPropSheetHost
  • m_cfDsObjectNames : CSCPCMenuDialog
  • m_cfDSPropSheetConfig : CPropSheetHost
  • m_cfe : CEnumFormatEtc
  • m_cfEmbedSource : CDataObject , CEnumFormatEtc
  • m_cFilter : CDlgIDirectorySearch
  • m_cFormatEtc : CDataObject
  • m_cfPrivateData : CContextMenu , CDataObject , CDropTarget
  • m_cFriendFrame : CDisdrawDlg
  • m_cfShellIDList : CDataObject
  • m_cGood : CClientDlg
  • m_cGuidMaps : CComboBoxGuid
  • m_Character : HelloJ , Hello2J , Notify
  • m_CharacterID : HelloJ , Hello2J
  • m_CharacterPathOld : HelloJ , Hello2J
  • m_cHiddenColumns : CColumnInfo
  • m_children : CBackgroundFolder , CBicycleFolder
  • m_chkAutoAnswer : CRTCIncomingDlg
  • m_cIMembers : CConfNotify
  • m_cIndent : UsageStringInfo
  • m_cIndexes : CTable
  • m_cInput : CDlgSrc
  • m_cIssuerCertURL : CCertPolicySample
  • m_cItem : CExtBuffer , COBLIST
  • m_cItems : CSids , CEnumFormatEtc
  • m_cLastIniString : CUtil
  • m_cLines : CImp_DrawDlg
  • m_cListIf : CADQIDlg
  • m_cListView : CDlgIDirectorySearch
  • m_CloseApp : CGenericUCPDlg
  • m_clsctxAccount : CMoveMoney
  • m_ClsId : CFactory
  • m_clsID : CFileViewer
  • m_clsid : CClassFactoryWrapper , CClassFactory , CPropertyPage
  • m_clsidObject : CClassFactory
  • m_clsReg : CCmdLineConsumerApp , CPermEventsApp
  • m_cMaxSize : CStorageBuffer , CStream
  • m_cMembers : CAppletSession
  • m_cMessageFrame : CDisdrawDlg , CImp_DrawDlg
  • m_cMessages : CStatusHelper
  • m_cNest : CSafeRefCount
  • m_CNotify : COptionsSheet
  • m_cobj : CExtObject
  • m_cOffset : CGenericEnum
  • m_cOK : CADQIDlg
  • m_ColDesc : CAlterColumnDlg
  • m_Color : COleDocument
  • m_ColumnInfo : CDataAccess
  • m_comboBindingTypes : COptionsAccessor
  • m_comboBitDepth : CDlgDest
  • m_comboConfig : CFullConnectProvider
  • m_comboConstraintType : CConstraintDlg
  • m_comboDBType : CAlterColumnDlg
  • m_comboDeleteRule : CConstraintDlg
  • m_comboFormat : CDlgDest
  • m_comboMatchType : CConstraintDlg
  • m_comboOptions : CPropertiesDlg
  • m_comboPropSet : CPropertiesDlg
  • m_comboProvider : CFullConnectProvider
  • m_comboSampleRate : CDlgDest
  • m_comboSchema : CSchemaDlg
  • m_comboSpeaker : CDlgSrc
  • m_comboType : CPropertiesDlg
  • m_comboTypeName : CAlterColumnDlg
  • m_comboUpdateRule : CConstraintDlg
  • m_comboValue : CPropertiesDlg
  • m_CommandID : Hello2J , Notify
  • m_Commands : Hello2J
  • m_CommandType : CCrmFilesCompensator
  • m_ComputerName : CProvider_IWbemServices
  • m_Config : RqsEngine
  • m_connect : CAdvClientDlg
  • m_connectHwnd : CBicycleFolder
  • m_ContactInfo_Object : CProvider_IWbemServices
  • m_ContentLength : ASYNC_REQUESTER
  • m_context : CDataObject
  • m_cookie : CConnectionPointContainer , CConnectionPoint
  • m_CookieList : CDataObject
  • m_COptions : CFullConnect
  • m_CoreService : CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_cot : CObjData
  • m_cOutput : CDlgDest
  • m_cPageCurrent : CBitArray
  • m_cPageMax : CBitArray
  • m_cPartitions : CStorageResource
  • m_cPopups : CStatusHelper
  • m_CProperties : CFullConnect
  • m_cPropInfoSets : CPropertiesDlg
  • m_CPropSets : CFullConnect , CSchemaDlg , CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg
  • m_CProvider : CFullConnect
  • m_cProviderInfo : CDataSource
  • m_cProvTypes : CSession
  • m_cQueueFrame : CDisdrawDlg
  • m_cQueueInput : CDisdrawDlg , CImp_DrawDlg
  • m_cQueueLabel : CDisdrawDlg , CImp_DrawDlg
  • m_cRadioDS : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_cRadioExpress : CDisdrawDlg , CImp_DrawDlg
  • m_cRadioPrivate : CDisdrawDlg
  • m_cRadioPublic : CDisdrawDlg
  • m_cRadioRecoverable : CDisdrawDlg , CImp_DrawDlg
  • m_cRadioWorkgroup : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_crColor : CSecureObject
  • m_cRef : CBinder , CClassFactory , CCommand , CDataSource , CImpISpecifyPropertyPages , CPropertyPage , CDBSession , CRow , CRowset , CStream , CISeqStream , MyClassFactory , MyDataSource , MyOSPObject , CBitmapWnd , WiaWrap::CDataCallback , WiaWrap::CEventCallback , CMainWindow , WiaWrap::CProgressDlg , CWiaDataCallback , CProxyPlugin::COpState , CSampleDataContainer , CSampleDirectory , CGenericEnum , CSyncMgrHandler , CCallbackWrapper , CObjSecurity , CSnapinAbout , CComponent , CComponentData , CDataObject , CExtendContextMenuEx , CEnumFormatEtc , CExtendPropertySheet , CClassPro , CProvFactory , CConsumer , CProviderFactory , CProvider , CMyEventProvider , CInstPro , CMethodPro , CPropPro , CMySink , RefCount , CRefCount , CPartitionInfo , CFVClassFactory , CFileViewer , CShellExtClassFactory , CShellExt
  • m_cref : CSnapinAbout , CClassFactory , CComponent , CComponentData , CDataObject , CContextMenuExtension , CPropSheetExtension , CEnumTASK , CToolBarExtension
  • m_cRef : CEvent , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CFactory , CUnknown , CFrame , CImpIOleClientSite , CImpIAdviseSink , CImpIOleInPlaceSite , CImpIOleDocumentSite , CSite , CUrlmonCallback , CMallocSpy , CDog , CClassFactory , CClassFactoryWrapper , CSimpleObject , CClassFactory , CTestCOMPerformance , CSecureObject , CHello , CHelloClassFactory , tagOLESTDMESSAGEFILTER , CSamplePipe , CSimpleClass , CFactory , CBase , CAggregate , CDropObject , CDropSource , CDropTarget , COleClient , CListener , CStorageBuffer , CFileStream
  • m_cRefCount : CDataObject , CDragSource , CDropTarget , CEnumFormatEtc
  • m_cRefs : CSafeRefCount , CSettings , AgentNotifySink
  • m_cRemix : CDlgDest
  • m_cRestrictions : CSchemaDlg
  • m_CriticalSection : CSampleDataContainer , CSampleDirectory , CLockHandler , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_CritSec : CAuthenticateContext , CDBAuthPlugin
  • m_critSect : CBackgroundFolder , CBicycleFolder , CAdvClientDlg
  • m_cRows : CFileIO , CRowset , MyOSPObject , CInkInputWnd
  • m_CRowset : COptionsSheet
  • m_cRowsetsOpen : CCommand
  • m_cRowsToFetch : COptionsSheet
  • m_cRSN : CClientDlg
  • m_cs : CLDisp
  • m_cSamples : CDlgSrc
  • m_cSchemas : CSchemaDlg
  • m_csClientsLock : RqsEngine
  • m_CSecurity : CFullConnect
  • m_csFriendName : CImp_DrawDlg
  • m_csLogin : CImp_DrawDlg
  • m_cslotCurrent : CBitArray
  • m_csQueue : ISAPITHREAD
  • m_csScreenText : CImp_DrawDlg
  • m_CStatusBar : CMainWindow
  • m_cstrDataSource : CDataSource
  • m_cstrDBMS : CDataSource
  • m_cstrDBMSVer : CDataSource
  • m_cStrings : CStringTable
  • m_cstrProviderDesc : CDataSource
  • m_cstrProviderName : CDataSource
  • m_cstrStringBuffer : CColumnInfo
  • m_cTables : CS1Dialog , MyDataSource
  • m_ctlStart : CClientDlg
  • m_ctlSysListView32 : CComSpy
  • m_CToolBar : CMainWindow
  • m_ctrlEditStatus : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_CurrTask : CEnumTASK
  • m_curThreadCount : CMain
  • m_cValidBits : CDlgDest
  • m_cValue : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeCRLDistInfo
  • m_cValueList : CDlgIADs , CDlgIADsPropertyList , CDlgIDirectoryObject
  • m_cValuesSet : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeStringArray
  • m_cWarning : CClientDlg
  • m_cWriteFileErr : CGenerateRC
  • m_cyPPI : CFileViewer
  • m_cyStatus : CFileViewer
  • m_cyTools : CFileViewer
  • m_data : CNode< TYPE >
  • m_DataGridDisplay : CADVCGENDlg
  • m_DataObject : CSimpSvrObj
  • m_dbAlloc : CExtBuffer
  • m_DBFile : CMSOmniProvRowset
  • m_DeadLetter : CSendMessageDialog
  • m_debug : CXMLTreeDlg
  • m_DecodeInfo : CCertEncodeAltName , CCertEncodeBitString , CCertEncodeCRLDistInfo
  • m_DecodeLength : CCertEncodeAltName
  • m_DefaultTimeouts : CNullModem
  • m_DeleteButton : CMultiValuedAttributeEditor
  • m_deleted : Deers
  • m_DesiredGraphState : CSampleMSPStream
  • m_DeviceCombo : CGenericUCPDlg
  • m_DeviceProperties : CGenericUCPDlg
  • m_DeviceType : CDeviceProp
  • m_diskDescriptions : CAdvClientDlg
  • m_diskDetails : CAdvClientDlg
  • m_diskInfo : CWbemClientDlg
  • m_displayInfo : CQueryDlg
  • m_DlgProc : CBaseDialog , CSimpleDialog
  • m_domainName : CServerDlg
  • m_DoneID : Notify
  • m_double : CMSOmniProvSessionColSchemaRowset
  • m_doWork : CBicycleFolder
  • m_drawScribble : CDisdrawDlg , CImp_DrawDlg
  • m_DropSource : CSimpleDoc
  • m_DropTarget : CSimpleDoc
  • m_dwAccessorOpts : COptionsSheet
  • m_dwAddressH : RqsClient
  • m_dwAlignment : CSampleDataContainer
  • m_dwAlignmentLog2 : CSampleDataContainer
  • m_dwAsynchProp : CFullConnectProperties
  • m_dwAttributes : CDeviceNode , CFolderNode , CVirtualFile , CBaseNode
  • m_dwBandID : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • m_dwBlobOpt : CTableCopy
  • m_dwBodySize : CReceiveMessageDialog
  • m_dwBytesReadSoFar : ASYNC_REQUESTER
  • m_dwCacheProp : CFullConnectSecurity
  • m_dwChannelMask : CDlgSrc
  • m_dwCheckPoint : RqsEngine
  • m_dwCLSCTX : CBase , CFullConnectOptions , COptionsSheet
  • m_dwColFlags : CAlterColumnDlg
  • m_dwCommandOpts : COptionsSheet
  • m_dwConnection : CSimpleSite
  • m_dwConnectOpts : CFullConnectOptions
  • m_dwConvFlags : COptionsSheet
  • m_dwCookie : CConnectionPoint , CRTCEvents , InkCollectorEvents , CBrowserHost , CBehavior , CNotify , CApplet , CAppletSession , CCompartmentMonitor
  • m_dwCookie2 : CBrowserHost
  • m_dwCookieAsynchNotify : CAsynchBase
  • m_dwCookieRowPos : CRowPosition
  • m_dwCookieRowsetNotify : CRowset
  • m_dwCookieTransNotify : CTransaction
  • m_dwCreateOpts : COptionsSheet
  • m_dwCurLen : CUtilString
  • m_dwCurrentItem : ISAPITHREAD
  • m_dwDispositionFlags : CCertPolicySample
  • m_dwDLControl : CBrowserHost
  • m_dwDocHostUIDblClk : CBrowserHost
  • m_dwDocHostUIFlags : CBrowserHost
  • m_dwDrawAspect : CSimpleSite
  • m_dwEditFlags : CCertPolicySample
  • m_dwEncryptPasswordProp : CFullConnectSecurity
  • m_dwErrorAPI : ASYNC_REQUESTER
  • m_dwEventCookie : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_dwEventMask : CNullModem
  • m_dwExitPublishFlags : CCertExitSample
  • m_dwFlag : CADQIApp
  • m_dwFlags : CSampleDirectoryInfo , CBaseDialog , CEnumIDList
  • m_dwID : CSite
  • m_dwIDCounter : CFrame
  • m_dwImpersonateProp : CFullConnectSecurity
  • m_dwInComingCallStatus : tagOLESTDMESSAGEFILTER
  • m_dwInPipeSent : CSamplePipe
  • m_dwInsertOpt : CTableCopy
  • m_dwInternalLockType : CTSFEditWnd
  • m_dwIssuerCertURLFlags : CCertPolicySample
  • m_dwItemNum : CSampleDirectory
  • m_dwItemsInQueue : ISAPITHREAD
  • m_dwLastError : ASYNC_REQUESTER
  • m_dwlcidProp : CFullConnectProperties
  • m_dwLockThreadId : CLockHandler
  • m_dwLockType : CTSFEditWnd
  • m_dwMaskPasswordProp : CFullConnectSecurity
  • m_dwMaxLen : CUtilString
  • m_dwMaxLength : COptionsSheet
  • m_dwMaxTime : CMain
  • m_dwMinTime : CMain
  • m_dwModeProp : CFullConnectProperties
  • m_dwMyCookie : CMSMQEventHandler
  • m_dwNotifyOpts : COptionsSheet
  • m_dwNumThreads : ISAPITHREAD
  • m_dwOffset : CUrlmonCallback
  • m_dwOutPipeRcvd : CSamplePipe
  • m_dwPageSize : CSDKSampleStorageSystem
  • m_dwPathNameLength : CSampleDirectory
  • m_dwPersistEncryptProp : CFullConnectSecurity
  • m_dwPersistProp : CFullConnectSecurity
  • m_dwPictureSize : CThumbNailPhotoHolder
  • m_dwPrefCount : CADsSearch
  • m_dwPromptProp : CFullConnectProvider
  • m_dwProtectionProp : CFullConnectSecurity
  • m_dwProtocolIndex : CProxyPlugin::COpState
  • m_dwRangeBeg : CUrlmonCallback
  • m_dwRangeEnd : CUrlmonCallback
  • m_dwRef : CCompartmentMonitor
  • m_dwRefCount : CRTCIncomingDlg , CRTCOutgoingDlg , CRTCEvents , CTAPIEventNotification
  • m_dwRefs : tagOleStdEnumFmtEtc , tagOleStdEnumStatData
  • m_dwReg : CClassFactoryWrapper
  • m_dwRegister : COleDocument , CSimpSvrObj
  • m_dwRegisterClass : CSimpSvrApp
  • m_dwResponseCode : CUrlmonCallback
  • m_dwRevocationFlags : CCertPolicySample
  • m_dwRowOpt : CTableCopy
  • m_dwRowsetOpts : COptionsSheet
  • m_dwSIFlags : CObjSecurity
  • m_dwSignature : CStorageResource
  • m_dwStartingTime : ASYNC_REQUESTER
  • m_dwStatus : CCommand , CRowset
  • m_dwStorageObjects : CDataSource
  • m_dwSyncFlags : CSyncMgrHandler
  • m_dwTemplateMajorVersion : CRequestInstance
  • m_dwTemplateMinorVersion : CRequestInstance
  • m_dwThreadID : CCriticalSection , CLock
  • m_dwTimeLimit : ASYNC_REQUESTER
  • m_dwTimeoutProp : CFullConnectProperties
  • m_dwTimeToBeReceived : CSendMessageDialog
  • m_dwTimeToReachQueue : CSendMessageDialog
  • m_dwTotalIters : CMain
  • m_dwTotalTime : CMain
  • m_dwTraceId : RqsEngine
  • m_dwType : tagProperties
  • m_dwViewMode : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • m_dwWorkItemQueueSize : ISAPITHREAD
  • m_dwXAttribs : CExtendPropertySheet
  • m_DynChnlRegKey : CAppletSession
  • m_eBaseClass : CBase
  • m_eConfig : RqsEngine
  • m_editBaseTableName : CConstraintDlg
  • m_editColumnName : CConstraintDlg , CAlterColumnDlg
  • m_editConstraintName : CConstraintDlg
  • m_editConstraintText : CConstraintDlg
  • m_EditCookie : CTSFEditWnd
  • m_editDesc : CPropertiesDlg
  • m_editDURI : CRTCOutgoingDlg
  • m_editFKColumnName : CConstraintDlg
  • m_editIndexName : CAlterIndexDlg
  • m_editLURI : CRTCOutgoingDlg
  • m_EditMode : CEntity
  • m_editNewColumnName : CAlterColumnDlg
  • m_editNewIndexName : CAlterIndexDlg
  • m_editNewTableName : CAlterTableDlg
  • m_editPath : CFileShareSampleParamsPage
  • m_editPrecision : CAlterColumnDlg
  • m_editReferencedTableName : CConstraintDlg
  • m_editScale : CAlterColumnDlg
  • m_editShareName : CFileShareSampleParamsPage
  • m_editSize : CAlterColumnDlg
  • m_editTableName : CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg
  • m_editValue : CEditValueDlg
  • m_edtApp : CAppUtilDlg
  • m_edtAppFile : CAppInstallDlg
  • m_edtApplicationID : CAppExportDlg
  • m_edtComponent : CCompInstallDlg
  • m_edtExportPath : CAppExportDlg
  • m_edtID : CCompImportDlg
  • m_edtInstallDir : CAppInstallDlg
  • m_edtPropertyValue : CVCExploreDlg
  • m_edtProxyStub : CCompInstallDlg
  • m_edtPWD : CAppInstallDlg
  • m_edtRemoteComputerName : CConnectDlg
  • m_edtRemoteServerName : CAppInstallDlg
  • m_edtTypeLib : CCompInstallDlg
  • m_edtUID : CAppInstallDlg
  • m_eidMember : CMember
  • m_eidMyself : CAppletSession
  • m_eInterfaceAdded : RqsEngine
  • m_EmbeddedLinks : SIMPLE_BROWSER
  • m_eMethodType : CPropertiesDlg
  • m_Encrypted : CSendMessageDialog
  • m_enState : CRTCSession , CRTCWin
  • m_Enum : CRefClient
  • m_enumDisks : CAdvClientDlg , CWbemClientDlg
  • m_EnumInfo : CFullConnect
  • m_enumServices : CAdvClientDlg
  • m_enumServicesAsync : CAdvClientDlg
  • m_eObjectType : CBase
  • m_eQuit : RqsEngine
  • m_eSocketAccept : RqsEngine
  • m_eSocketRead : RqsEngine
  • m_eStatus : CMyEventProvider
  • m_eTrace : RqsEngine
  • m_eventFlags : CWaitSystemDlg
  • m_eventList : CAdvClientDlg
  • m_EventMap : CAppInfo
  • m_EventObject : CProvider_IWbemEventProvider
  • m_EventSink : CProvider_IWbemEventProvider , ThreadArg_Struct
  • m_EventText : CGenericUCPDlg
  • m_ExternalConnection : CSimpSvrObj
  • m_fAcceptFmt : CDropTarget
  • m_fActive : CSchemaDlg
  • m_factory : CCmdLineConsumerApp , CPermEventsApp
  • m_factoryType : CClassFactory
  • m_FactoryType : CClassFactory
  • m_fAddMyUI : CSimpleDoc
  • m_fAggregation : CInterfaceDlg
  • m_fAllowOverrideMachineNameOut : CStaticNode::privateData
  • m_fAllowStomping : CUtilString
  • m_fAlwaysAddProp : CClusPropList
  • m_fAppActive : CSimpleApp
  • m_fAsyncFindRunning : CGenericUCPDlg
  • m_fAtEnd : CClusPropValueList
  • m_FaxNumber : FaxDlg
  • m_fBackground : CContextMenu
  • m_fCA : CRequestInstance
  • m_fCancel : CProgress
  • m_fCanDropCopy : CSimpleDoc
  • m_fCanDropLink : CSimpleDoc
  • m_fClassReg : CFileViewer
  • m_fClosing : CSimpSvrDoc , ASYNC_REQUESTER
  • m_fCommPortInUse : CNullModem
  • m_fConnected : CDataSource
  • m_fConsoleTrace : RqsEngine
  • m_fConstructing : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeCRLDistInfo
  • m_fContents : CSmpFilter
  • m_fCopyIndexes : CTableCopy
  • m_fCopyPrimaryKeys : CTableCopy
  • m_fCopyTables : CTableCopy
  • m_fCreated : COleDocument
  • m_fCSHMode : CSimpleApp
  • m_fDBSessionCreated : CDataSource
  • m_fDebuggerTrace : RqsConfig
  • m_fDebugTrace : RqsEngine
  • m_fDenyPutColor : CSecureObject
  • m_fDenyPutUserName : CSecureObject
  • m_fDirty : COleDocument , CUtilString
  • m_fDocObj : CSite
  • m_fDragging : CDlgDest , CDlgSrc
  • m_fDragLeave : CSimpleDoc
  • m_fDsEnabledLocaly : CDisdrawDlg , CImp_DrawDlg , CLoginDlg
  • m_fDSOInitialized : CDataSource
  • m_fEditing : CSchemaDlg , CS1Dialog
  • m_fEnableBusyDialog : tagOLESTDMESSAGEFILTER
  • m_fEnableModeless : COleInPlaceActiveObject
  • m_fEnableNotRespondingDialog : tagOLESTDMESSAGEFILTER
  • m_fEof : CSmpFilter
  • m_fError : CGenerateRC , CImportRes
  • m_fExternalOnly : UsageStringInfo
  • m_fFoundLang : CImportRes
  • m_fHaveObject : CFrame
  • m_fHeapAlloc : TempBuffer
  • m_FileIdx : CFileIO
  • m_filename : CXMLTreeDlg
  • m_FileReadOnly : CFileIO
  • m_FilterType : CAppInfo
  • m_fInContextHelp : CFrame
  • m_FindByType : CGenericUCPDlg
  • m_FindByUDN : CGenericUCPDlg
  • m_FindCombo : CGenericUCPDlg
  • m_fInDelete : CSafeRefCount
  • m_fInEdit : CShellView
  • m_fInitialized : CFrame , CSite , CSimpleApp , CSimpSvrApp , CAsynchBase , CDownloadUI , CNullModem
  • m_fInitializing : CContextSamplePropPage
  • m_fInObjectHelp : CFrame
  • m_fInPlaceActive : COleDocumentView , CSimpleDoc , CSimpleSite , CSimpSvrObj
  • m_fInPlaceVisible : CSimpSvrObj
  • m_fInRoster : CMember
  • m_fInterimChar : CTSFEditWnd
  • m_fInternalOnly : UsageStringInfo
  • m_fIRowsetChange : CDataSource
  • m_fIRowsetUpdate : CDataSource
  • m_fIsDynamicDisk : CStorageResource
  • m_fIsGPTDisk : CStorageResource
  • m_fIsManaged : CStorageResource
  • m_fIsManagedByDefault : CStorageResource
  • m_fIsMultiNodeCapable : CStorageResource
  • m_fIsQuorumCapable : CStorageResource
  • m_fIsQuorumResource : CStorageResource
  • m_fIsRadioLocalMachine : CStaticNode::privateData
  • m_fLastFetchForward : CDataGrid
  • m_fLayoutChanged : CTSFEditWnd
  • m_fLoadCalled : CFileViewer
  • m_fLoadedDevices : CEnumStorageResource
  • m_fLocalDrag : CSimpleDoc
  • m_fLocalDrop : CSimpleDoc
  • m_fLocked : CTSFEditWnd
  • m_fMapped : CStatusHelper
  • m_fMenuMode : CSimpleApp
  • m_fModal : CDialogLite
  • m_fModifiedMenu : CSimpleDoc
  • m_fMultipleParamSets : CDataSource
  • m_fNoScribbleMode : COleDocument , CSimpSvrObj
  • m_fNotify : CTSFEditWnd
  • m_fObjectOpen : CSimpleSite
  • m_FolderSettings : CShellView
  • m_fOleStdInit : CSimpleApp , CSimpSvrApp
  • m_fOpen : COleObject
  • m_FormatEtc : CTSFDataObject
  • m_FormatNameCB : COpenQueueDialog
  • m_fOurMenuShowing : CFrame
  • m_fOutput : CInterfaceDlg
  • m_fPendingDrag : CSimpleDoc
  • m_fPendingLockUpgrade : CTSFEditWnd
  • m_fPlayable : CDlgDest , CDlgSrc
  • m_fPostQuitMsg : CFileViewer
  • m_fPrepareForSync : CSyncMgrHandler
  • m_fPresenceEnabled : CRTCWin
  • m_fPrimaryKeysSupported : CDataSource
  • m_fProxy : CFactoryData
  • m_fProxyAutoDiscovery : ASYNC_REQUESTER
  • m_fProxyFailover : ASYNC_REQUESTER
  • m_FrameInfo : COleDocumentView , CSimpSvrObj
  • m_fReadOnly : CDataSource
  • m_fRegDragDrop : CSimpleDoc
  • m_fRemoveDeleted : CRowset
  • m_FriendlyName : CDeviceProp
  • m_fRtTrace : RqsEngine
  • m_fSameAsLoad : CPersistStorage
  • m_fSaveWithSameAsLoad : CSimpSvrObj
  • m_fSetCodepage : CImportRes
  • m_fShowInit : CFileViewer
  • m_fShowPrev : CRTCAVSession
  • m_fShowQuery : CTableCopy
  • m_fShowRecv : CRTCAVSession
  • m_fShowSupported : CSchemaDlg
  • m_fShutdownInProgress : SIMPLE_BROWSER
  • m_fStartByOle : CSimpSvrApp
  • m_fStatusVisible : CFileViewer
  • m_fStopped : CSyncMgrHandler
  • m_fSupportedType : CResData , CResTypeData
  • m_fSynchronizing : CSyncMgrHandler
  • m_fTerminalConnected : CSampleMSPStream
  • m_fToolsVisible : CFileViewer
  • m_fTopProvider : CAppletSession
  • m_fTraceEnabled : RqsConfig
  • m_fTranslate : CTableCopy
  • m_fTransportConfigured : CSampleMSPStream
  • m_fTyping : CRTCIMSession
  • m_fUIActive : COleDocumentView , CSimpSvrObj
  • m_fUse : CDlgSrc
  • m_fUseColProps : CAlterColumnDlg
  • m_fUseProperties : CSchemaDlg
  • m_fUserCancel : CDownloadUI
  • m_fUseRestrictions : CSchemaDlg
  • m_fUseTableProps : CAlterTableDlg
  • m_fUsingOurHelp : CFrame
  • m_fWroteBinary : CGenerateRC
  • m_Genie : Hello3J
  • m_GenieFilename : Hello3J
  • m_GenieID : Hello3J
  • m_green : CSimpSvrObj
  • m_grfMode : CFileViewer
  • m_guidCmdDialect : CCommand
  • m_guidCompartment : CCompartmentMonitor
  • m_guidDialect : CCommand
  • m_guidImpersonate : CCommand
  • m_GuidList : CDataObject
  • m_guidProv : MyClassFactory
  • m_guidSource : CBase
  • m_hAccel : CFrame , MainDlg , CFileViewer
  • m_hAccels : CShellView
  • m_hAccessor : CDataAccess
  • m_hAddDeviceDlg : CStaticNode
  • m_hAddFolderDlg : CDeviceNode
  • m_hAddVFileDlg : CFolderNode
  • m_handle : CDelegationBase
  • m_hAppIcon : CSnapinAbout
  • m_hAppWnd : CSimpleApp , CSimpSvrApp
  • m_hBitmap : CBitmapWnd
  • m_hBmkAccessor : CDataAccess
  • m_hBuddyList : CRTCWin
  • m_hCascadeMenu : CSimpleApp
  • m_hChapter : CRowset
  • m_hchapter : CMSOmniProvSessionColSchemaRowset
  • m_hCluster : CExtObject , CClusterData
  • m_hColorMenu : CSimpSvrApp
  • m_hConnect : ASYNC_REQUESTER
  • m_hControl : CImportRes
  • m_hCreateThread : CBankDlg
  • m_hCur : CHourglass
  • m_hCurSizeNS : CMainWindow
  • m_hCursorOld : CSplitterLite
  • m_hCursorRight : CSplitterLite
  • m_hCursorTop : CSplitterLite
  • m_hDatabase : CGenerateRC , CImportRes
  • m_hdbc : CComSpySqlAudit , CAccount , CUpdateReceipt , CODBCData
  • m_hDialog : CImportRes
  • m_hDisplay : CRTCIMSession
  • m_hDlg : WiaWrap::CProgressDlg
  • m_hDocWnd : CSimpleDoc , CSimpSvrDoc
  • m_hdr : CTSFPersistentPropertyLoader
  • m_hDraggingItem : CTreeViewLite
  • m_hEdit : CRTCIMSession
  • m_hEditMenu : CSimpleApp
  • m_HelpFile : CComponentData
  • m_henv : CComSpySqlAudit , CAccount , CUpdateReceipt , CODBCData
  • m_hEvtClose : CPluggableTransport
  • m_hevtOverlapped : CNullModem
  • m_hEvtRead : CPluggableTransport
  • m_hEvtWrite : CPluggableTransport
  • m_hExitKey : CCertExitSample
  • m_hFile : CComSpy , CBankDlg , CLogFile , CDBFile , CFileLite , CSampleDataContainer , CGenerateRC , CPack , CSmpFilter
  • m_hFileMenu : CSimpleApp
  • m_hFont : CComSpy , CRecoOutputWnd , CFileViewer
  • m_hfont : CExtObject
  • m_hGroup : CGroupData
  • m_hHatchWnd : CSimpSvrDoc
  • m_hHelpMenu : CSimpleApp , CSimpSvrApp
  • m_hicon : CExtObject
  • m_hIcon : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg , CVCExploreDlg , CClientDlg , CADVCGENDlg , CADQIDlg , CDisdrawDlg , CImp_DrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CGenericUCPDlg , CCmdLineConsumerDlg , CPermEventsDlg , CWbemClientDlg , AboutDlg , CCapMFCDlg , CXMLTreeDlg
  • m_hImageList : CMainWindow
  • m_hImageStrip16 : CComponent , CComponentData
  • m_hImageStrip32 : CComponent , CComponentData
  • m_hInitDlg : WiaWrap::CProgressDlg
  • m_hInst : CFrame , CSimpleApp , CSimpSvrApp , CDialogBase , CPropSheetHost , CImportRes , CDownloadUI , CStatusHelper , CStringTable , CFileViewer , CTSFEditWnd , CTSFMainWnd
  • m_hInstance : CAppLite , CSimpleDialog
  • m_hInstMprApi : RqsEngine
  • m_hInstPrev : CFrame
  • m_hkConfig : RqsEngine
  • m_hkTrace : RqsEngine
  • m_hLargeImage : CSnapinAbout
  • m_hLibRichEdit10 : CMainWindow
  • m_hLibRichEdit20 : CMainWindow
  • m_hListenSocket : CX224
  • m_hLog : RqsEngine
  • m_hMainMenu : CSimpleApp , CSimpSvrApp
  • m_hMapFile : CDBFile
  • m_hMDIClient : CMainWindow
  • m_hMemSMM : CStatusHelper
  • m_hMemText : CFileViewer
  • m_hMenu : CBankDlg , CShellView
  • m_hMenuDebug : CComSpy
  • m_hMenuHelp : CFrame
  • m_hMenuOrg : CFrame
  • m_hmenuShared : CSimpSvrObj
  • m_hMenuTop : CFrame
  • m_hMessageWnd : CStaticNode , CFolderNode , CDeviceNode
  • m_hMicLevel : CRTCAVSession
  • m_hMicMute : CRTCAVSession
  • m_hMicText : CRTCAVSession
  • m_hMicVol : CRTCAVSession
  • m_hNetInterface : CNetInterfaceData
  • m_hNetwork : CNetworkData
  • m_hNode : CNodeData
  • m_hNotifyObj : CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI
  • m_hObjClassIcon : CSCPWiz , CWizExtUser
  • m_hOldCursor : CAnnotator
  • m_hOleMenu : COleDocumentView , CSimpSvrObj
  • m_hOpenImage : CSnapinAbout
  • m_host : CStaticNode::privateData
  • m_hpage : CBasePropertyPage
  • m_hParentHScopeItem : CLandBasedVehicle , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CSpaceVehicle , CStaticNode
  • m_hParentNode : CDeviceNode
  • m_hParentWnd : CAddDeviceDlg , CAddVFileDlg , CAddFolderDlg
  • m_hPrevCursor : CWaitCursor
  • m_hPrevInstance : CAppLite
  • m_hPrevVideoParent : CRTCAVSession
  • m_hqIncoming : CDisdrawDlg
  • m_hqOutgoing : CDisdrawDlg
  • m_hQuit : CSampleDataSource
  • m_hr : CAsyncFullServ
  • m_hRadioButton : CImportRes
  • m_hRecvVideoParent : CRTCAVSession
  • m_hRequest : ASYNC_REQUESTER
  • m_hResource : CResData
  • m_hResult : CAsyncTest
  • m_hRichEdit : CRecoOutputWnd
  • m_hrLastUpdateResult : CCertPolicySample
  • m_hrLaunch : CWrapVBComponent
  • m_hRow : CRow
  • m_hrReturn : CListener
  • m_hSearch : CADsSearch
  • m_hSend : CRTCIMSession
  • m_hServer : RqsEngine
  • m_hService : RqsEngine
  • m_hSession : SIMPLE_BROWSER
  • m_hSharedMenu : COleDocumentView
  • m_hShutdownEvent : SIMPLE_BROWSER
  • m_hSmallImage : CSnapinAbout
  • m_hSmallImageOpen : CSnapinAbout
  • m_hSocket : CX224
  • m_hSourceRow : CRow
  • m_hSpkLevel : CRTCAVSession
  • m_hSpkMute : CRTCAVSession
  • m_hSpkText : CRTCAVSession
  • m_hSpkVol : CRTCAVSession
  • m_hStateList : CMainWindow
  • m_hStaticNode : CComponentData , CStaticNode
  • m_hStatusBar : CRTCSession , CRTCWin
  • m_hStdPal : CSimpleApp
  • m_hstmt : CComSpySqlAudit , CAccount , CUpdateReceipt , CODBCData
  • m_hThread : CMyEventProvider , CSampleDataSource
  • m_hThreadHandle : CWorkerThread
  • m_hToken : CAuthenticateContext
  • m_hTreeItem : CBase
  • m_hwnd : CEventSink
  • m_hWnd : CFrame , CSite , CWndLite , CPropertyPage , CDialogBase , CRTCEvents , CRTCSession , CRTCWin , CBaseDialog , CMyInkEvents , CSimpleDialog , AboutDlg , MainDlg , Conf , CCommBand , CDeskBand , CExplorerBar , CToolBand , CStatusHelper , CFileViewer , CShellView , CTSFEditWnd , CTSFMainWnd
  • m_hWndBusyDialog : tagOLESTDMESSAGEFILTER
  • m_hwndCallback : CCallbackWrapper
  • m_hWndCapture : CHourglass
  • m_hWndClient : CFrame
  • m_hwndEdit : CTSFEditWnd
  • m_hWndFileNameEdit : CThumbNailPhotoHolder
  • m_hwndHandler : CSyncMgrHandler
  • m_hwndHidden : CPropSheetHost
  • m_hwndIPObj : CSimpleSite
  • m_hwndList : CShellView
  • m_hWndList : CComSpy
  • m_hWndMDIClient : CMDIFrameLite
  • m_hWndModeless : CAppLite
  • m_hwndMSGestLV : CAdvRecoApp
  • m_hWndObj : CFrame
  • m_hWndOld : CFileViewer
  • m_hWndOwner : CStatusHelper
  • m_hwndParent : CPropSheetHost , CDownloadUI , CCommBand , CDeskBand , CExplorerBar , CToolBand , CShellView , CTSFEditWnd
  • m_hWndParent : tagOLESTDMESSAGEFILTER , CSimpSvrObj , CWndLite , WiaWrap::CProgressDlg
  • m_hWndPictureControl : CThumbNailPhotoHolder
  • m_hwndProgress : CDownloadUI
  • m_hWndProp : CFullConnectProvider
  • m_hWndSchemas : CSchemaDlg
  • m_hwndSSGestLV : CAdvRecoApp
  • m_hwndStatus : CTSFEditWnd
  • m_hWndStatus : CFileViewer
  • m_hwndStatusBar : CAdvRecoApp , CMultiRecoApp
  • m_hWndToolbar : CFileViewer
  • m_hwndToolBar : CVCExploreDlg
  • m_hWndTreeView : CSchemaDlg
  • m_hWndTreeWnd : CSchemaDlg
  • m_hwndUIActiveObj : CSimpleApp
  • m_hwndView : COleDocumentView
  • m_hWndViewport : CFileViewer
  • m_hwndWorker : CSyncMgrHandler
  • m_hWorkerThreadSemaphore : ISAPITHREAD
  • m_i : CAsyncFullServ
  • m_iAccessRight : COpenQueueDialog
  • m_iAck : CSendMessageDialog
  • m_iArraySize : CImp_DrawDlg
  • m_iBorderCX : CSplitterLite
  • m_iBorderCY : CSplitterLite
  • m_iCert : CCertPolicySample
  • m_iChildWindow : CMDIChild
  • m_iColor : CMultiRecoApp
  • m_iCookie : CMain
  • m_iCount : ClientList
  • m_iCRL : CCertPolicySample
  • m_iCtrlResID : CGenerateRC
  • m_iCur : CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc
  • m_iCurrent : CDataObject
  • m_id : CCrmFilesWorker , CPerson , CBackground
  • m_iData : CClientDlg
  • m_iddPropertyPage : CBasePropertyPage
  • m_iddWizardPage : CBasePropertyPage
  • m_iDelivery : CDisdrawDlg , CSendMessageDialog
  • m_iDialogID : CPropertyPage
  • m_ids : UsageStringInfo
  • m_idsCaption : CBasePropertyPage
  • m_idsMax : CStatusHelper , CStringTable
  • m_idsMin : CStatusHelper , CStringTable
  • m_idSource : CFullConnect , CMainWindow , CMDIChild
  • m_idxDevice : CStorageResource
  • m_idxEnumNext : CEnumStorageResource
  • m_idxEnumPartitionNext : CStorageResource
  • m_idxNext : CEnumStorageResource
  • m_idxNextLogicalDisk : CPartitionInfo
  • m_idxNextPartition : CStorageResource
  • m_iFontName : CRecoOutputWnd
  • m_iFormatNameList : CDisdrawDlg
  • m_iid : CAsyncXXX< T, ISyncFace, IAsyncFace > , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CInterfaceDlg
  • m_iidProp : CPropertiesDlg
  • m_iIters : CMain
  • m_Image : CBitmapWnd
  • m_imageList : CXMLTreeDlg
  • m_iMidline : CInkInputWnd
  • m_IndexMap : CDynamic
  • m_InitTime : CVirtualFile
  • m_InkEvents : CMyInkCollector
  • m_inst : CBicycle
  • m_Instances : CRefClient
  • m_Interface : SmartRefPointer< T >
  • m_InternalReferenceCount : CProvider_IWbemEventProvider
  • m_InvokeAction : CGenericUCPDlg
  • m_iOldSchemaIndex : CSchemaDlg
  • m_ipConsole : CComponent , CComponentData , CComponent , CComponentData , CComponent
  • m_ipConsole2 : CComponentData , CComponent
  • m_ipConsoleNameSpace : CComponentData
  • m_ipConsoleNameSpace2 : CComponentData
  • m_ipConsoleVerb : CComponent
  • m_ipControlBar : CComponent , CToolBarExtension
  • m_ipControlbar : CComponent
  • m_ipDeviceToolbar : CComponent
  • m_ipDisplayHelp : CComponent
  • m_ipHeaderCtrl : CComponent
  • m_ipHeaderCtrl2 : CComponent
  • m_ipMenuButton : CComponent
  • m_iPos : CStorageBuffer , CStream , CISeqStream
  • m_ipResultData : CComponent
  • m_iPrevStep : CWizard
  • m_ipScopeImage : CComponentData
  • m_ipStaticToolbar : CComponent
  • m_ipToolbar : CComponent , CToolBarExtension
  • m_ipVFileToolbar : CComponent
  • m_iRadio : CImp_DrawDlg
  • m_iRadioDS : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_iRefCnt : CDownloadBindStatusCallback
  • m_irowFilePos : CRowset
  • m_irowLastFilePos : CRowset
  • m_irowMin : CRowset
  • m_iSavedSel : CComboBoxLite
  • m_iSchemaIndex : CSchemaDlg
  • m_isDirty : CStaticNode::privateData
  • m_iSelCol : CDataGrid
  • m_iSelRow : CDataGrid
  • m_iSelStart : CRecoOutputWnd
  • m_iStrResID : CGenerateRC
  • m_iSurface : CBicycle
  • m_item : COfficeDlg
  • m_itemId : CBackground
  • m_iTimeout : CReceiveMessageDialog
  • m_iType : CDisdrawDlg
  • m_iWasText : CImp_DrawDlg
  • m_j : CAsyncFullServ
  • m_JoinSessionReq : CAppletSession
  • m_Journal : CSendMessageDialog
  • m_key : CAssoc< KEY, VALUE >
  • m_keyInfoEnum : Sample::MySignedXml
  • m_keyMap : CEntity
  • m_lAccess : CUtil
  • m_lastSizedEdge : CMDIChild
  • m_lAsyncFindHandle : CGenericUCPDlg
  • m_lblCollectionName : CVCExploreDlg
  • m_lblComponentDesc : CCompImportDlg
  • m_lblComputerName : CVCExploreDlg
  • m_lbParties : CRTCOutgoingDlg
  • m_lCharacterID : MainDlg
  • m_lcid : CFactoryData , CMgdClusCfgInit , CExtObject , CMyCapabilities , CMyEvictListener , CMyMemberSetChangeListener , CMyStartupListener , CPartitionInfo
  • m_lClerkNumber : CCrmMonComp
  • m_lClientLeft : CGrid
  • m_lClients : RqsEngine
  • m_lClientTop : CGrid
  • m_lCmdPropertiesID : MainDlg
  • m_lCookie : CDataObject , CBehavior
  • m_lCSSlevel : CBrowserHost
  • m_lCurPos : CDataGrid
  • m_lCustomerId : CONotify , COrder , COShip , COShip2
  • m_lDataSourceType : CDataSource
  • m_lFails : CClientDlg
  • m_lGenID : CCacheMapEl
  • m_lGridCookie : CBrowserHost
  • m_lGridSize : CGrid
  • m_lHandle : CCounterData
  • m_lHiPart : CDlgIADsLargeInteger
  • m_LibVersion : CFactoryData
  • m_lID : CRefresherMember< T >
  • m_liFreq : CTIMER
  • m_lIndex : CCacheMapEl
  • m_Line : CLine , CNullModem
  • m_LinksCritSec : SIMPLE_BROWSER
  • m_list : CBankDlg
  • m_listColumnDescFlags : CAlterColumnDlg
  • m_listColumnList : CConstraintDlg
  • m_listConfigs : CFullConnect
  • m_listCPropSets : CSession
  • m_listDeferrability : CConstraintDlg
  • m_listFiles : CFullConnect
  • m_listFKColumnList : CConstraintDlg
  • m_listLines : CDrawArea
  • m_listListeners : MyDataSource , MyOSPObject
  • m_listTransactions : CMainWindow
  • m_listValues : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • m_listviewProps : CPropertiesDlg
  • m_lLanguage : CCrmFilesTest
  • m_lLastX : CImp_DrawDlg
  • m_lLastY : CImp_DrawDlg
  • m_lLeftBandWidth : CBrowserHost
  • m_lLowPart : CDlgIADsLargeInteger
  • m_lMaxRows : CDataGrid
  • m_Locale : CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_lOrderId : CONotify , COrder , COShip , COShip2
  • m_lpActiveObject : CSimpleDoc
  • m_lpApp : CSimpleDoc , CSimpSvrDoc
  • m_lParam : CCompartmentMonitor
  • m_lPartID : CBehavior
  • m_lpAsyncXXX : CAsyncTest
  • m_lpCntrDoc : CSimpSvrObj
  • m_lpColorStm : CSimpSvrObj
  • m_lpDataAdviseHolder : CSimpSvrObj
  • m_lpDoc : CSimpleApp , CSimpleSite , CSimpSvrApp , CSimpSvrObj
  • m_lpEtc : tagOleStdEnumFmtEtc
  • m_lpEventSink : CConnectionPoint
  • m_lpfnBusyDialogHookCallback : tagOLESTDMESSAGEFILTER
  • m_lpfnHandleInComingCallback : tagOLESTDMESSAGEFILTER
  • m_lpfnMessagePendingCallback : tagOLESTDMESSAGEFILTER
  • m_lpFrame : CSimpSvrObj
  • m_lpfsi : CFileViewer
  • m_lpg : CExtObject
  • m_lPingFailures : CClientDlg
  • m_lPings : CClientDlg
  • m_lpInPlaceObject : CSimpleSite
  • m_lpIPSite : CSimpSvrObj
  • m_lpObj : CAsyncXXX< T, ISyncFace, IAsyncFace > , CSimpSvrDoc
  • m_lpObjStorage : CSimpleSite , CDataXferObj
  • m_lpOleAdviseHolder : CSimpSvrObj
  • m_lpOleClientSite : CSimpSvrObj
  • m_lpOleObject : CSimpleSite , CDataXferObj
  • m_lPrevHeight : CRTCAVSession
  • m_lPrevWidth : CRTCAVSession
  • m_lpSite : CSimpleDoc
  • m_lpSizeStm : CSimpSvrObj
  • m_lpStat : tagOleStdEnumStatData
  • m_lpStorage : CSimpleDoc , CSimpSvrObj
  • m_lpstrClass : CUnknown
  • m_lpSyncface : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • m_lpszAppName : tagOLESTDMESSAGEFILTER
  • m_lpunk : CEnumXXX< T, ELT_T, IFACE >
  • m_lpUnkSync : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • m_lpVtbl : tagOLESTDMESSAGEFILTER
  • m_lpWaveFormatEx : CPlgFilter
  • m_lpwhdr : CDlgDest , CDlgSrc
  • m_lRecordNumber : CCrmMonComp
  • m_lRecvHeight : CRTCAVSession
  • m_lRecvWidth : CRTCAVSession
  • m_lRef : CAsyncQuerySink , CHiPerfProvider , CRefresher , CClassFactory
  • m_lRefCount : CMonitor
  • m_lRefs : CSmpFilter , CSmpFilterCF
  • m_lSinkID : MainDlg
  • m_lSnapIncrement : CBrowserHost , CSnap
  • m_lstObjects : CVCExploreDlg
  • m_lstParentCollections : CVCExploreDlg
  • m_lstProperties : CVCExploreDlg
  • m_lstRelatedCollections : CVCExploreDlg
  • m_lTimeouts : CClientDlg
  • m_lTopBandHeight : CBrowserHost
  • m_lTries : CClientDlg
  • m_lUID : CCacheMapEl
  • m_Manufacturer : CDeviceProp
  • m_ManufacturerUrl : CDeviceProp
  • m_map : CComSpy , CMethodSub , CSelectEventsDlg
  • m_MapIndex : CDynamic
  • m_Merlin : Hello3J
  • m_MerlinFilename : Hello3J
  • m_MerlinID : Hello3J
  • m_message : CMessageDlg
  • m_MetaData : CProxy
  • m_mgw : COleDocumentView
  • m_ModelDescription : CDeviceProp
  • m_ModelName : CDeviceProp
  • m_ModelNumber : CDeviceProp
  • m_ModelUrl : CDeviceProp
  • m_Move : CCapMFCDlg
  • m_MoveX : CCapMFCDlg
  • m_MoveY : CCapMFCDlg
  • m_msgOut : CImp_DrawDlg
  • m_nAlloc : CAddrNode , CResultset
  • m_nAllocSize : CFixedAlloc , CSimpleArray< T >
  • m_Name : Object_Property
  • m_name : Deers
  • m_namespace : CAdvClientDlg , CWbemClientDlg
  • m_Namespace : CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_nAppID : CAppLite
  • m_nBlockSize : CFixedAlloc , CLListImpl< TYPE, ARG_TYPE >
  • m_nBreakAtAllocSize : CDbAlloc
  • m_nBreakAtNthAlloc : CDbAlloc
  • m_nChannel : CDlgSrc
  • m_nCmdGuide : CAdvRecoApp
  • m_nCmdInputScope : CAdvRecoApp
  • m_nCmdMode : CAdvRecoApp
  • m_nCmdRecognizer : CAdvRecoApp , CMultiRecoApp
  • m_nCmdShow : CFrame , CAppLite
  • m_nConfID : CAppletSession
  • m_nConnectionID : CNullModem
  • m_nConnectionType : CConnectDlg
  • m_nCookie : CDataObject
  • m_nCount : tagOleStdEnumFmtEtc , tagOleStdEnumStatData , CDataXferObj , CSimpleSite , CSimpSvrObj , CEntity , CProxy , CResultset , WiaWrap::CComPtrArray< T > , CLListImpl< TYPE, ARG_TYPE >
  • m_nDataSize : WiaWrap::CDataCallback
  • m_nDeref : CDlgIDirectorySearch
  • m_nDragDelay : CSimpleApp
  • m_nDragMinDist : CSimpleApp
  • m_nDynamicMulticastChannel : CAppletSession
  • m_nExportType : CAppExportDlg
  • m_next : CAddrNode
  • m_nFailureRetries : ASYNC_REQUESTER
  • m_nGesture : CRecoOutputWnd
  • m_nGrow : CDynamic
  • m_nHeaderSize : WiaWrap::CDataCallback
  • m_nID : CWndLite , SIMPLE_BROWSER , ASYNC_REQUESTER
  • m_nidMember : CMember
  • m_nidMyself : CAppletSession
  • m_nImportType : CCompImportDlg
  • m_nIndex : tagOleStdEnumFmtEtc , tagOleStdEnumStatData
  • m_nInstallType : CAppInstallDlg
  • m_nMaxCount : CEntity
  • m_nMaxRowLength : CBankDlg
  • m_nMaxUsers : CFileShareSampleParamsPage
  • m_nMsgs : CBankDlg
  • m_nNotifyHandle : CVirtualFile
  • m_nNumAttempts : ASYNC_REQUESTER
  • m_nNumberWrites : CTestDlg
  • m_nNumDevices : WiaWrap::CEventCallback
  • m_nNumImages : CMainWindow
  • m_NodeList : CDeviceNode , CStaticNode , CFolderNode
  • m_nPageCount : CExtendPropertySheet
  • m_nPageSize : CDlgIDirectorySearch
  • m_nPrevMaxUsers : CFileShareSampleParamsPage
  • m_nPropPageCount : CBaseNode
  • m_nPropsRemaining : CClusPropList
  • m_nPullSeq : CSamplePipe
  • m_nPushSeq : CSamplePipe
  • m_nRefCount : CClassFactory , CColumnProvider , CEmptyVolumeCache
  • m_nRefs : CImpAuth
  • m_nRequesterIDSeed : SIMPLE_BROWSER
  • m_nReserve : CDynamic
  • m_nRows : CProxy
  • m_nSampleSize : CAVIFileWriter
  • m_nSamplesReadSoFar : CAVIFileReader
  • m_nScrollDelay : CSimpleApp
  • m_nScrollInset : CSimpleApp
  • m_nScrollInterval : CSimpleApp
  • m_nSize : CStaticMap , CSimpleArray< T >
  • m_nSizeLimit : CDlgIDirectorySearch
  • m_nSpeaker : CDlgSrc
  • m_nSuiteIndex : CBankDlg
  • m_nTemplate : CBaseDialog
  • m_nThreadID : CWorkerThread
  • m_nTimeLimit : CDlgIDirectorySearch
  • m_nTimeOut : CDlgIDirectorySearch
  • m_nTotalTests : CBankDlg
  • m_nTransportID : CNullModem
  • m_nUtilityOption : CUtilitiesDlg
  • m_nUtilityType : CAppUtilDlg , CUtilitiesDlg
  • m_nWidth : CComSpy
  • m_ObjRefCount : CClassFactory , CEnumFormatEtc , COleDocument , CPropSheetHost , CAdminNotifyHandler , CCommBand , CDeskBand , CExplorerBar , CToolBand , CContextMenu , CDataObject , CDropSource , CDropTarget , CEnumIDList , CExtractIcon , CShellFolder , CShellView , CShellIconOverlayID , CTSFDataObject , CTSFPersistentPropertyLoader , CTSFEditWnd
  • m_OkButton : CDeviceProp
  • m_OldPath : Hello3J
  • m_OleClientSite : CSimpleSite
  • m_OleInPlaceActiveObject : CSimpSvrObj
  • m_OleInPlaceFrame : CSimpleApp
  • m_OleInPlaceObject : CSimpSvrObj
  • m_OleInPlaceSite : CSimpleSite
  • m_oleMisc : CFactoryData
  • m_OleObject : CSimpSvrApp , CSimpSvrObj
  • m_oleVerbs : CFactoryData
  • m_Op : CProxyPlugin::COpState
  • m_OpenedQueuePathNameArray : CMainFrame
  • m_OperatingSystemVersion : CProvider_IWbemServices
  • m_output : CCmdLineConsumerDlg
  • m_outputList : CAdvClientDlg , CPermEventsDlg , CWbemClientDlg
  • m_Overlapped : CNullModem
  • m_p : CSmartPtr< T > , CUtilComPtr< T >
  • m_pADs : CDlgIADs
  • m_pAgent : MainDlg
  • m_pAggISync : CAsyncFullServ
  • m_pApplet : CAppletSession
  • m_Parameters : CCommand
  • m_Params : CParameters
  • m_parent : CBicycle
  • m_pArray : WiaWrap::CComPtrArray< T >
  • m_PathNameArray : CMainFrame
  • m_PathNameCB : CCloseQueueDialog , CDeleteQueueDialog , COpenQueueDialog , CReceiveMessageDialog , CSendMessageDialog
  • m_pAttribStr : CVirtualFile
  • m_pAttributeEditor : CSCPUIBindingInfo , CSCPUIKeywords , CSCPPageBindingInfo , CSCPPageKeywords
  • m_pAttributeStr : CVirtualFile , CBaseNode
  • m_pAudioStream : CAVIFileWriter , CAVIFileReader
  • m_pAuthenticatePlugin : CAuthenticateAdmin
  • m_pAVIFile : CAVIFileWriter
  • m_pb : CTSFPersistentPropertyLoader
  • m_pBalloon : MainDlg
  • m_pbBufBeg : RecvBuf
  • m_pbBufEnd : RecvBuf
  • m_pbCurrentPos : CDBFile
  • m_pbData : CDlgDest
  • m_pbDataBeg : RecvBuf
  • m_pbDataEnd : RecvBuf
  • m_pBehavior : CEventSink
  • m_pbEOF : CDBFile
  • m_pbHeap : CFileIO
  • m_pBinding : CUrlmonCallback
  • m_pBlocks : CFixedAlloc , CLListImpl< TYPE, ARG_TYPE >
  • m_pBMapLg : CComponentData , CDelegationBase
  • m_pBMapSm : CDelegationBase , CComponentData
  • m_pbProxyData : CRow
  • m_pBrowser : ASYNC_REQUESTER
  • m_pBrowserConfig : SIMPLE_BROWSER
  • m_pbStartLoc : CRow
  • m_pBuf : TempBuffer
  • m_pBuffer : CISeqStream , CSamplePipe , CStorageBuffer , CStream
  • m_pCacheProxyCallback : CProxyPlugin::COpState
  • m_pCAggregate : CInterfaceDlg
  • m_pCallback : CCompartmentMonitor
  • m_pCallNotify : Conf
  • m_pCallObjUnk : CCallBack
  • m_pCaptureStream : CSampleMSPCall
  • m_pCatalog : CConnectDlg , CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CUtilitiesDlg , CVCExploreDlg
  • m_pCategoryMgr : CTSFEditWnd
  • m_pCCommand : CMDIChild
  • m_pCDataAccess : CMDIChild
  • m_pCDataGrid : CMDIChild
  • m_pCDataLinks : CMainWindow
  • m_pCDataSource : CMDIChild , CDBSession , CTable
  • m_pCEnumerator : CFullConnect
  • m_pCert : CCertPolicySample
  • m_pCFromTable : CTableCopy
  • m_pCFullConnect : CMainWindow
  • m_pch : CDialogStream
  • m_pChannelAs : tagUser
  • m_pChannelAudio : tagUser
  • m_pChannelData : tagUser
  • m_pChannelFt : tagUser
  • m_pCharacter : MainDlg , CapJ
  • m_pchData : CString
  • m_pChildren : CSampleDirectory
  • m_pClassFactory : CSDKSampleStorageSystem
  • m_pClient : CRTCWin
  • m_pCListener : CMainWindow
  • m_pCLSID : CFactoryData
  • m_pCMainWindow : CMDIChild , CMDITrace , CBase , CRowsetViewerDlg , CAppLite , CObjTree , CMDIObjects , CIntTrace
  • m_pCMallocSpy : CWinApp
  • m_pCMDIChild : CQueryBox , CBase , CRowsetViewerDlg , CDataGrid
  • m_pCMDIObjects : CMainWindow
  • m_pCMDITrace : CMainWindow
  • m_pCMultipleResults : CMDIChild
  • m_pcnp : CNotify
  • m_pcnpcnt : CNotify
  • m_pCObjTree : CMDIObjects
  • m_pColNames : CFileIO
  • m_pColorStream : CPersistStorage
  • m_pColumnID : CAlterColumnDlg
  • m_pCompartment : CCompartmentMonitor
  • m_pCompData : CStaticNode , CDeviceNode , CFolderNode , CVirtualFile
  • m_pComponent : CVirtualFile
  • m_pComponentData : CComponent , CDelegationBase , CSpaceStation , CComponent
  • m_pConf : CCallNotify , CConfNotify , CMgrNotify
  • m_pConfig : CRefClient
  • m_pConfNotify : Conf
  • m_pConnectEventObject : WiaWrap::CEventCallback
  • m_pConsDesc : CConstraintDlg
  • m_pConsoleNameSpace : CBackgroundFolder
  • m_pCont : CDlgIADsContainer
  • m_pContents : CEntity
  • m_pContext : CTSFEditWnd
  • m_pContextPlugin : CContextAdmin
  • m_pContextState : CLogFile
  • m_pCOptionsSheet : CMainWindow
  • m_pCParent : CBase
  • m_pCPC : CConnectionPoint
  • m_pCProgress : CWizard
  • m_pCPropSets : CPropertiesDlg
  • m_pCPropSheet : CPropPageLite
  • m_pCQueryBox : CMDIChild
  • m_pCreator : CRowset
  • m_pCRootBinder : CMainWindow
  • m_pCRootEnumerator : CMainWindow
  • m_pcsect : CCriticalSection
  • m_pCServiceComp : CMainWindow
  • m_pCSession : CMDIChild , CCommand
  • m_pCSource : CMainWindow , CMDIChild
  • m_pCTableCopy : CS1Dialog , CS2Dialog , CS3Dialog , CS4Dialog , CTypesDialog , CWizard
  • m_pCToTable : CTableCopy
  • m_pCTrace : CMDITrace
  • m_pCTreeRowset : CSchemaDlg
  • m_pCurrCollection : CVCExploreDlg
  • m_pCurrent : ClientList::Iterator , CEnumIDList
  • m_pCurrentThreadData : CBankDlg
  • m_pCWizard : CTableCopy , CTable
  • m_pCWndBottom : CSplitterLite
  • m_pCWndLeft : CSplitterLite
  • m_pCWndRight : CSplitterLite
  • m_pCWndTop : CSplitterLite
  • m_pData : CDataAccess
  • m_pDataAdviseHolder : CDataObject
  • m_pDataObj : CShellExt
  • m_pDataObject : COleDocument
  • m_pDBAuthPlugin : CDBAuthAdmin
  • m_pdbout : CDbAlloc
  • m_pDescripStr : CVirtualFile
  • m_pDeviceFinder : CGenericUCPDlg
  • m_pDeviceFinderCallback : CGenericUCPDlg
  • m_pDirObject : CDlgIDirectoryObject
  • m_pDisconnectEventObject : WiaWrap::CEventCallback
  • m_pDisplayAttrMgr : CTSFEditWnd
  • m_pDispMan : CLDisp
  • m_pDocMgr : CTSFEditWnd
  • m_pdoFrom : CAdminNotifyHandler
  • m_pdoTo : CAdminNotifyHandler
  • m_pDownloadUI : CDownloadBindStatusCallback
  • m_pDropTargetHelper : CDropTarget
  • m_pDS : CRefresher
  • m_pEditor : CAttributeValueEditor , CAttributeValueEditButton , CMultiValuedListBox , CAttributeValueAddButton , CAttributeValueDeleteButton
  • m_pEngine : RqsClient
  • m_pEntity : CResultset
  • m_pEnumFormatEtc : CDataObject
  • m_peo : CBasePropertyPage
  • m_PerformanceFrequency : CComSpySqlAudit
  • m_perm : CAdvClientDlg
  • m_PersistStorage : CSimpSvrObj
  • m_pEventCallback : CMainWindow
  • m_pEventClassDef : CMyEventProvider
  • m_pEvents : CRTCWin
  • m_pEventSink : CBehavior , CPlgTermSample
  • m_pextbufferAccessor : CImpIAccessor , CRowset
  • m_pExtPageUser : CWizExtUser
  • m_pFactoryData : CFactory
  • m_pFile : CFileStream
  • m_pFileio : CRow , CRowset
  • m_pFileMap : CDBFile
  • m_pFirst : CEnumIDList , CViewList
  • m_pfnDestroy : CFileViewer
  • m_pfnProgressCallback : WiaWrap::CDataCallback
  • m_pFont : CComSpy
  • m_pFormatEtc : CDataObject
  • m_pFR : CSite
  • m_pFTM : CPlgTermSample
  • m_pfUseIndexProps : CAlterIndexDlg
  • m_pGenericItemList : CGenericEnum
  • m_pGenericUCPDlg : CServiceCallback , CDeviceFinderCallback
  • m_pGuidPropertySet : CPropertiesDlg
  • m_pHandler : CImp_DrawDlg
  • m_pHandlerItems : CSettings
  • m_pHead : ClientList , ClientList::Iterator , COBLIST
  • m_pHeadNode : CList< TYPE, ARG_TYPE > , CExList< TYPE >
  • m_phMenu : CFrame
  • m_pHolder : CLDisp
  • m_pHomePageRequester : SIMPLE_BROWSER
  • m_phThread : CSyncMgrHandler
  • m_pI : CSmartComPtr< T >
  • m_pIAccessor : CRowset , CDataAccess , CCommand , CTable
  • m_pIAggregate : CBase
  • m_pIAlterIndex : CSession
  • m_pIAlterTable : CSession
  • m_pIApplet : CApplet
  • m_piApplication : CContext
  • m_pIBindResource : CBinder , CRow , CSession , CBinder , CDBSession
  • m_pIBuffer : CRowset
  • m_pICacheProxyServer : CProxyPlugin
  • m_piccCallback : CMyMemberSetChangeListener , CMyCapabilities , CMyEvictListener , CMyStartupListener
  • m_picccCallback : CMgdClusCfgInit
  • m_pIChapteredRowset : CRowset
  • m_pIColumnsInfo : CCommand , CRow , CRowset , CDataAccess
  • m_pIColumnsInfo2 : CRow
  • m_pIColumnsRowset : CDataAccess
  • m_pICommand : CCommand
  • m_pICommandPersist : CCommand
  • m_pICommandPrepare : CCommand
  • m_pICommandProperties : CCommand
  • m_pICommandStream : CCommand
  • m_pICommandText : CCommand , CDataSource , CCommand
  • m_pICommandWithParameters : CCommand
  • m_pIConnectionPoint : InkCollectorEvents , CConnectionPoint
  • m_pIConnectionPointContainer : CContainerBase
  • m_pIConvertType : CDataAccess , CCommand , CRow , CRowset
  • m_pICreateRow : CBinder , CSession , CBinder , CRow
  • m_pICrmFilesWorker : CCrmFilesTest
  • m_pICrmFilesWorkerCurrent : CCrmFilesTest
  • m_pICrmFormatLogRecords : CCrmMonComp
  • m_pICrmLogControl : CCrmFilesCompensator , CCrmFilesWorker
  • m_pICrmMonitor : CCrmMonComp
  • m_pICrmMonitorClerks : CCrmMonComp
  • m_pICrmMonitorLogRecords : CLERK_ENTRY
  • m_PID : CAppInfo
  • m_piData : CExtObject
  • m_pIDataInitialize : CServiceComp
  • m_pIDBAsynchStatus : CAsynchBase
  • m_pIDBBinderProperties : CBinder
  • m_pIDBCreateCommand : CRow , CSession , CDBSession
  • m_pIDBCreateSession : CDataSource
  • m_pIDBDataSourceAdmin : CDataSource , CPropertiesDlg
  • m_pIDBInfo : CDataSource
  • m_pIDBInitialize : CAsynchBase , CDataSource
  • m_pIDBPromptInitialize : CDataLinks
  • m_pIDBProperties : CPropertiesBase , CBinder , CDataSource
  • m_pIDBPropertyInfo : CPropertiesDlg
  • m_pIDBSchemaRowset : CSession , CDataSource
  • m_pidl : CShellView , CExtractIcon
  • m_pidlFQ : CShellFolder
  • m_pidlRel : CShellFolder
  • m_pIErrorInfo : CError
  • m_pIErrorRecords : CError
  • m_pIFileViewer : CFileViewer
  • m_pIFullServ : CAsyncFullServ
  • m_pIGetDataSource : CSession , CDBSession
  • m_pIGetRow : CRowset
  • m_pIGetSession : CRow
  • m_pIGetSourceRow : CStream
  • m_pIIndexDefinition : CSession , CDataSource
  • m_pILockBytes : CStream
  • m_pIMDDataset : CDataset
  • m_pIMDFind : CDataset
  • m_pIMDRangeRowset : CDataset
  • m_pImpIAdviseSink : CSite
  • m_pImpIOleClientSite : CSite
  • m_pImpIOleDocumentSite : CSite
  • m_pImpIOleIPSite : CSite
  • m_pIMultipleResults : CMultipleResults
  • m_pInkCollector : CMyInkCollector
  • m_pINmCall : Conf
  • m_pINmConf : Conf
  • m_pINmMgr : Conf
  • m_pInPlaceFrame : COleDocumentView
  • m_pInPlaceSite : COleDocumentView
  • m_pInPlaceUIWindow : COleDocumentView
  • m_pInputPin : CPlgFilter
  • m_pInternal : CWrapVBComponent
  • m_pIOleDocView : CSite
  • m_pIOleIPActiveObject : CFrame
  • m_pIOleIPObject : CSite
  • m_pIOleObject : CSite
  • m_pIOpenRowset : CSession , CDBSession , CDataSource
  • m_pIParseDisplayName : CEnumerator , CDataSource
  • m_pIPersist : CDataSource
  • m_pIPersistFile : CDataSource , CFileViewer
  • m_pIPlugTrans : CPluggableTransport
  • m_pIPrevVideo : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_pIPropertyPageSite : CPropertyPage
  • m_pIRecvVideo : CRTCOutgoingDlg , CRTCIncomingDlg
  • m_pIRegisterProvider : CBinder
  • m_piRequest : CContext
  • m_piResponse : CContext
  • m_pIRow : CRow
  • m_pIRowChange : CRow
  • m_pIRowPosition : CRowPosition
  • m_pIRowSchemaChange : CRow
  • m_pIRowset : CRowset , CTable , CRowset
  • m_pIRowsetBookmark : CRowset
  • m_pIRowsetChange : CRowset
  • m_pIRowsetFind : CRowset
  • m_pIRowsetIdentity : CRowset
  • m_pIRowsetIndex : CRowset
  • m_pIRowsetInfo : CRowset
  • m_pIRowsetLocate : CRowset
  • m_pIRowsetRefresh : CRowset
  • m_pIRowsetResynch : CRowset
  • m_pIRowsetScroll : CRowset
  • m_pIRowsetUpdate : CRowset
  • m_pIRowsetView : CRowset
  • m_pIRTCClient : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_pIRTCParty : CRTCOutgoingDlg
  • m_pIRTCSession : CRTCOutgoingDlg , CRTCIncomingDlg
  • m_pIScopedOperations : CRow
  • m_pISequentialStream : CStream
  • m_piServer : CContext
  • m_pIService : CBase
  • m_pIServiceProvider : CDataSource
  • m_pISession : CAppletSession
  • m_piSession : CContext
  • m_pISessionProperties : CSession , CDBSession
  • m_pISourcesRowset : CEnumerator
  • m_pISQLErrorInfo : CCustomError
  • m_pIStorage : CFrame , CSite , CStream
  • m_pIStream : CSite , CStream
  • m_pISupportErrorInfo : CBase
  • m_pITableDefinition : CSession , CDataSource
  • m_pITableDefinitionWithConstraints : CSession
  • m_pItemsToSyncList : CSyncMgrHandler
  • m_pITransaction : CSession , CTransaction
  • m_pITransactionJoin : CSession
  • m_pITransactionLocal : CSession
  • m_pITransactionObject : CSession
  • m_pITransactionOptions : CTransactionOptions
  • m_pIUnknown : CBase , CInterfaceDlg
  • m_pIUnkProperties : CPropertiesDlg
  • m_pIWbemServices : CAdvClientDlg , CWbemClientDlg , CEnumStorageResource , CPartitionInfo , CStorageResource
  • m_piWizardCallback : CExtObject
  • m_pLargeInt : CDlgIADsLargeInteger
  • m_pLast : CEnumIDList , CViewList
  • m_pLastBindBase : CRowset
  • m_pLastNode : CComponent
  • m_Play : CCapMFCDlg
  • m_plCount : WiaWrap::CDataCallback
  • m_pLF : CTestDlg
  • m_pLIBID : CFactoryData
  • m_pLockHandler : CLock
  • m_pMainDlg : AgentNotifySink
  • m_pMalloc : CContextMenu , CDataObject , CDropTarget , CEnumIDList , CPidlMgr , CShellView , CViewList , CShellFolder
  • m_pMember : CRefresherMember< T >
  • m_pMgrNotify : Conf
  • m_pMyCP : CMSMQEventHandler
  • m_pMyOSPObject : MyDataSource
  • m_pNamedValues : CSDKSampleStorageSystem , CContextPlugin
  • m_pNamespace : CClassPro , CInstPro
  • m_pNameSpace : CRefClient
  • m_pNewTableID : CAlterTableDlg
  • m_pNext : CLinkable , CNode< TYPE > , CSampleDirectoryInfo
  • m_pNextItem : CGenericEnum
  • m_pNextNode : CNode< TYPE >
  • m_pNodeAttribs : CExtendPropertySheet
  • m_pNodeFree : CFixedAlloc , CLListImpl< TYPE, ARG_TYPE >
  • m_pNodeHead : CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • m_pNodeTail : CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • m_pNs : CMyEventProvider
  • m_pNullModem : CPSTN
  • m_pObj : CSite , CImpIPersistFile , CImpIFileViewer
  • m_pObjSafeRefCount : CStabilize
  • m_podObjData : CExtObject
  • m_pOfficeService : CWbemClientDlg , CAdvClientDlg
  • m_Point : CPoint
  • m_pointl : CDataXferObj
  • m_pOleAdviseHolder : COleDocument
  • m_pOleClientSite : COleDocument
  • m_pOleDoc : CDataObject , COleInPlaceActiveObject , COleDocumentView , COleObject , CPersistFile , CPersistStorage , COleInPlaceObject
  • m_pOleDocView : COleDocument
  • m_pOleInPlaceActiveObject : COleDocument
  • m_pOleInPlaceObject : COleDocument
  • m_pOleObject : COleDocument , CSpyCon
  • m_PolicyCriticalSection : CCertPolicySample
  • m_polytype : NewDocDlg , CPrintSDIDoc
  • m_pOpenDS : CDlgIADsOpenDSObject
  • m_PositionLabel : CCapMFCDlg
  • m_posRect : CSimpSvrObj
  • m_pOutClass : CMethodPro
  • m_pOutputList : CAsyncQuerySink , CConsumer , CProviderFactory , CProvider
  • m_pOwnerStorageSystem : CSampleDataContainer , CSampleDirectory
  • m_pPaintSite : CBehavior
  • m_pParam : CUrlmonCallback
  • m_pParent : CRocket , CComponent
  • m_pParentDlg : CConnectDlg
  • m_pParentFolder : CVirtualFile
  • m_pParentNode : CDeviceNode , CFolderNode
  • m_pParentObj : CRow , CStream , CRowset
  • m_pPathName : CSampleDirectory
  • m_pPersistFile : COleDocument
  • m_pPersistStorage : COleDocument , CPersistFile
  • m_ppHandle : CRocket , CPropSheetExtension , CBicycle
  • m_pPictureArray : CThumbNailPhotoHolder
  • m_pPidlMgr : CContextMenu , CDataObject , CEnumIDList , CExtractIcon , CShellFolder , CShellView , CDropTarget
  • m_ppIndexID : CAlterIndexDlg
  • m_ppIUnknown : CInterfaceDlg
  • m_pPlgEventSink : CPlgFilter
  • m_pPluginAdmin : CContextSamplePropPage
  • m_pPMM : CStatusHelper
  • m_ppNewIndexID : CAlterIndexDlg
  • m_pPolicy : CRequestInstance
  • m_pppStream : WiaWrap::CDataCallback
  • m_pPresentationContext : CProxyPlugin::COpState
  • m_pPrev : CLinkable , CNode< TYPE >
  • m_pPrevDocMgr : CTSFEditWnd
  • m_pPrevNode : CNode< TYPE >
  • m_pProfile : CRTCWin
  • m_pProgressCallbackParam : WiaWrap::CDataCallback
  • m_pPropList : CDlgIADsPropertyList
  • m_pProppageUIBindingInfo : CSCP
  • m_pProppageUIGeneral : CSCP
  • m_pProppageUIKeywords : CSCP
  • m_pProvider : CRefresher
  • m_ppSD : CObjSecurity
  • m_pPSTN : CPluggableTransport
  • m_ppszTable : CStringTable
  • m_ppTableID : CAlterIndexDlg
  • m_ppUnk : CDlgIADsOpenDSObject
  • m_ppwszTableName : CConstraintDlg
  • m_pQueryCallback : CAdvClientDlg
  • m_pRecentChild : CSampleDirectory
  • m_pRefresher : CRefClient
  • m_pRenderStream : CSampleMSPCall
  • m_Presentation : CGenericUCPDlg
  • m_PresentationUrl : CDeviceProp
  • m_pResultData : CBicycleFolder
  • m_prgColInfo : CDBFile , CMSOmniProvRowset
  • m_prgCP : CConnectionPointContainer
  • m_prgDisks : CEnumStorageResource
  • m_prgELT : CEnumXXX< T, ELT_T, IFACE >
  • m_prgEventIID : CConnectionPointContainer
  • m_prgfe : CEnumFormatEtc
  • m_prgLogicalDisks : CPartitionInfo
  • m_prgPartitions : CStorageResource
  • m_processList : CProcessDlg
  • m_protect : CFixedAlloc
  • m_prowbitsIBuffer : CRowset
  • m_pRowBuff : CRow
  • m_ProxyInfo : ASYNC_REQUESTER
  • m_pSampleDS : CHiPerfProvider
  • m_pScopeCookie : CComponent
  • m_pSearch : CDlgIDirectorySearch , CADsSearch
  • m_pSearchDirName : CSampleDirectory
  • m_pSecurityDesc : CDlgIADsSecurityDescriptor
  • m_pServer : CContextPlugin
  • m_pServerContext : CSDKSampleStorageSystem
  • m_pServiceCallback : CGenericUCPDlg
  • m_pServices : CTSFEditWnd
  • m_pSession : CRTCSession
  • m_psfParent : CDataObject , CDropTarget , CShellFolder , CShellView , CContextMenu
  • m_pSH : CFileViewer
  • m_psHeader : CPropSheetLite
  • m_pShellBrowser : CShellView
  • m_pSidList : CSids
  • m_pSids : CDBAuthPlugin
  • m_pSink : MainDlg , CMyEventProvider
  • m_pSite : CDeskBand , CToolBand , CImpIOleDocumentSite , CImpIOleInPlaceSite , CImpIOleClientSite , CCommBand , CImpIAdviseSink , CExplorerBar , CFrame
  • m_pSMM : CStatusHelper
  • m_pSocket : RqsClient
  • m_pSpaceStation : CRocket
  • m_psPage : CPropPageLite
  • m_pSpy : CAppInfo , CComSpyPropPage , CSpyCon , CSysLCESub
  • m_pSpyObj : CSelectEventsDlg
  • m_pSqlAudit : CComSpy
  • m_pST : CFileViewer , CStatusHelper
  • m_pStaticNode : CComponentData
  • m_pStgMedium : CDataObject
  • m_pstm : CUrlmonCallback
  • m_pStorage : CPersistStorage , CPersistFile
  • m_pStr : CBSTR
  • m_pStrArray : CDeleteQueueDialog , CReceiveMessageDialog , CSendMessageDialog , CCloseQueueDialog , COpenQueueDialog
  • m_pStream : CBicycleFolder , CAdvClientDlg , WiaWrap::CDataCallback
  • m_pStrFE : CEnumFormatEtc
  • m_pStringBuffer : CPropertiesDlg
  • m_pStrings : RqsConfig
  • m_pStubSink : CBicycleFolder
  • m_pSubClassProc : CWndLite
  • m_pSyncMgrSynchronizeCallback : CSyncMgrHandler
  • m_pSysAppInfo : CComSpy , CSelectEventsDlg
  • m_psz : BTSTR
  • m_pszAddress : RqsClient
  • m_pszBuffer : RqsClient
  • m_pszCmdLine : CFrame , CAppLite
  • m_pszCurCharID : CCapMFCDlg
  • m_pszLastIniString : CUtil
  • m_pszLibrary : RqsConfig
  • m_pszMemberName : CMember
  • m_pszMyName : CAppletSession
  • m_pszObjectName : CObjSecurity
  • m_pszPath : CFileViewer
  • m_pszPathName : CSampleDataContainer
  • m_pszRangeDelimiter : CUrlmonCallback
  • m_pszServerName : CObjSecurity
  • m_pszString : RqsClient
  • m_pszStrings : CStringTable
  • m_pszUsername : CUtil , RqsClient
  • m_pszVal : CUtilString
  • m_pszwHelpPath : CComponentData
  • m_pszwName : CSampleDirectoryInfo
  • m_pTableID : CAlterTableDlg , CAlterColumnDlg
  • m_pTail : ClientList::Iterator , ClientList , COBLIST
  • m_pTailNode : CList< TYPE, ARG_TYPE > , CExList< TYPE >
  • m_pTaskList : CEnumTASK
  • m_ptButDown : CSimpleDoc
  • m_pTemplate : CHiPerfProvider
  • m_ptGridLT : CInkInputWnd
  • m_pThreadMgr : CTSFEditWnd
  • m_ptLast : CDrawArea
  • m_ptPolyCorners : CBehavior
  • m_ptPosInCaption : CDlgDest , CDlgSrc
  • m_ptrReady : CBicycleFolder , CAdvClientDlg
  • m_pTSFEditWnd : CTSFMainWnd
  • m_pTypeInfo : HelloWorld
  • m_pUnk : CADQIDlg , CNotify
  • m_punkFTM : InkCollectorEvents
  • m_pUnkMarshaler : CProxy , CSimple , CCrmDebugCompensator , CCrmMonComp , CLDisp , CPower , CComSpySqlAudit
  • m_pUnknown : CPerson
  • m_pUnknownOuter : CUnknown
  • m_pUnkOuter : CImpIPersistFile , CImpIOleDocumentSite , CImpIOleClientSite , CImpIOleInPlaceSite , CBaseObj , CImpIFileViewer , CDataSource , CImpIAdviseSink , CFileViewer
  • m_pUnsecApp : CBicycleFolder
  • m_pUtilProp : CDBSession , CRowset , CCommand , CBinder , CDataSource
  • m_pv : CAddrNode
  • m_pVar : CResultset
  • m_pvData : CDlgSrc
  • m_pvInput : CFileIO
  • m_pvlValues : CClusPropList
  • m_pvsi : CFileViewer
  • m_pWaveFormat : CAVIFileReader
  • m_pWbemSvcs : CMethodPro
  • m_pWin : CRTCSession
  • m_pWizExt : CExtPageUser , CSCPPageKeywords , CSCPPageGeneral , CSCPPageBindingInfo
  • m_pWizPage1 : CSCPWiz
  • m_pWizPage2 : CSCPWiz
  • m_pWizPage3 : CSCPWiz
  • m_pWMSAuthenticationPlugin : CAuthenticateContext
  • m_pwndParent : CDlgDest , CDlgSrc
  • m_pWritableAttrs : CSCPUIBindingInfo , CSCPUIGeneral , CSCPUIKeywords , CProppageUserUI
  • m_pwszCatalog : CDataSource
  • m_pwszCatalogLocation : CDataSource
  • m_pwszCatalogTerm : CDataSource
  • m_pwszClassName : CWndLite
  • m_pwszConfig : CMDIChild
  • m_pwszDataSource : CDataSource
  • m_pwszDBMS : CDataSource
  • m_pwszDBMSVer : CDataSource
  • m_pwszFile : CPersistFile
  • m_pwszFileName : CSmpFilter
  • m_pwszFilename : CPack
  • m_pwszInitString : CServiceComp
  • m_pwszNewLine : CConsole
  • m_pwszNextProxies : ASYNC_REQUESTER
  • m_pwszNodeName : CBaseNode
  • m_pwszPrefix : CPropSheetHost
  • m_pwszProviderFileName : CDataSource
  • m_pwszProviderName : CDataSource
  • m_pwszProviderOLEDBVer : CDataSource
  • m_pwszProviderParseName : CDataSource
  • m_pwszProviderVer : CDataSource
  • m_pwszRegStorageLoc : CCertExitSample
  • m_pwszSchemaTerm : CDataSource
  • m_pwszTableTerm : CDataSource
  • m_pwszText : CTSFDataObject
  • m_pwszTitle : CEditValueDlg , CInterfaceDlg
  • m_pwszURL : CBinder
  • m_pwszUrl : ASYNC_REQUESTER
  • m_pwszVal : CUtilString
  • m_pwszValue : CEditValueDlg
  • m_pX224 : CPluggableTransport
  • m_qevent : CImp_DrawDlg
  • m_qFriend : CImp_DrawDlg
  • m_qFunc : RqsEngine
  • m_querySession : CQueryDlg
  • m_QueryVariable : CGenericUCPDlg
  • m_queue : CImp_DrawDlg
  • m_qwFileSize : CSampleDataContainer
  • m_qwSize : CSampleDirectoryInfo
  • m_rcDrawnBox : CInkInputWnd
  • m_rcIcon : AboutDlg
  • m_RDI : CBaseNode
  • m_ReadBuffer : ASYNC_REQUESTER
  • m_realWMI : CBicycleFolder
  • m_RecipientName : FaxDlg
  • m_Rect : COleDocumentView
  • m_red : CSimpSvrObj
  • m_redNose : Deers
  • m_ReferenceCount : CProvider_IWbemUnboundObjectSink , CProvider_IWbemEventProvider , CProvider_IWbemServices , CProvider_IWbemEventConsumerProvider
  • m_refs : CDbAlloc , CStdDbOutput
  • m_Registrar : ThreadArg_Struct
  • m_RegistryName : CFactoryData
  • m_regPerm : CAdvClientDlg
  • m_regTemp : CAdvClientDlg
  • m_requestHead : RSProxy
  • m_RequestID : HelloJ , Notify , Hello3J , Hello2J
  • m_requestLock : RSProxy
  • m_responseHead : RSProxy
  • m_responseLock : RSProxy
  • m_responseTail : RSProxy
  • m_rganode : CDbAlloc
  • m_rgAttributes : CTSFEditWnd
  • m_rgAxisInfo : CDataset
  • m_rgbBit : CBitArray
  • m_rgbBitMask : CBitArray
  • m_rgbRowData : CRowset
  • m_rgch : CStdDbOutput
  • m_rgchSig : CDbAlloc
  • m_rgchUserName : CSecureObject
  • m_rgColAccess : CRow
  • m_rgColDesc : CTable
  • m_rgCompositions : CTSFEditWnd
  • m_rgdbcolinfo : CFileIO
  • m_rgDex : CFileIdx
  • m_rgDialogSteps : CWizard
  • m_rgdwDataOffsets : CFileIO
  • m_rgElements : CVector< TYPE, IDX >
  • m_rgEnumInfo : CEnumerator
  • m_rgExtracolinfo : CRow
  • m_rgfSigned : CFileIO
  • m_rgGuidMaps : CComboBoxGuid
  • m_rgIndexInfo : CTable
  • m_rgItem : CExtBuffer
  • m_rgPageHandles : CPropSheetHost
  • m_rgpColNames : CFileIO
  • m_rgpColumnData : CFileIO
  • m_rgproperties : CUtilProp
  • m_rgPropInfoSets : CPropertiesDlg
  • m_rgProps : CFileShareSampleParamsPage
  • m_rgProviderInfo : CDataSource
  • m_rgProvTypes : CSession
  • m_rgprtcPSPages : CObjData
  • m_rgprtcWizPages : CObjData
  • m_rgpwszTableName : MyDataSource
  • m_rgResName : CSchemaDlg
  • m_rgRestrictions : CSchemaDlg
  • m_rgRestrictionSupport : CSchemaDlg
  • m_rgResType : CSchemaDlg
  • m_rgResValue : CSchemaDlg
  • m_rgSchemas : CSchemaDlg
  • m_rgsdwMaxLen : CFileIO
  • m_rgswColType : CFileIO
  • m_rgTableInfo : CS1Dialog
  • m_rgudwColSize : CFileIO
  • m_rOSPObject : MyDataSource
  • m_Rows : CDBFile
  • m_RS : Query
  • m_rsTable : MyOSPObject
  • m_rtElemCorners : CBehavior
  • m_running : CBicycleFolder , CBackgroundFolder
  • m_rvTable : MyOSPObject
  • m_rwlConfig : RqsEngine
  • m_sADsPath : CDlgIADs , CDlgIADsOpenDSObject , CMoveDlg , CADQIDlg
  • m_sAgentMajor : AboutDlg
  • m_sAgentMinor : AboutDlg
  • m_sAppID : CAppInfo
  • m_sAppName : CAppInfo
  • m_sAttr : CGetInfoExDlg
  • m_sAttribute : CDlgIADsPropertyList
  • m_sAttributes : CDlgIDirectoryObject
  • m_sAttrText : CGetInfoExDlg
  • m_scale : CSimpSvrObj
  • m_SchemaInfo : CADVCGENDlg , CSchemaDlg
  • m_sClass : CDlgIADs , CDlgIDirectoryObject
  • m_sClassList : CDlgIADsContainer
  • m_sColumnList : CADsSearch
  • m_scopeitem : CBackgroundFolder
  • m_SCPDURL : CGenericUCPDlg
  • m_sDataMember : MyDataSource
  • m_sDelete : CDeleteObjectDlg
  • m_SDI : CBaseNode
  • m_sDN : CDlgIDirectoryObject
  • m_sDSN : CAccount , CUpdateReceipt
  • m_search : CDlgIADsSecurityDescriptor
  • m_sendMessage : CMessageDlg
  • m_SerialNumber : CDeviceProp
  • m_serverList2 : CServerDlg
  • m_serverName : CMessageDlg , CQueryDlg , CShutdownDlg
  • m_ServerName : CAPIDoc
  • m_serverName : CSessionDlg , CWaitSystemDlg , CProcessDlg
  • m_Service : ThreadArg_Struct
  • m_ServiceCombo : CGenericUCPDlg
  • m_sessionInfo : CQueryDlg
  • m_sessionList : CSessionDlg
  • m_SessionList : CRTCWin
  • m_SessionType : CRTCOutgoingDlg
  • m_SetStatusCalled : CAsyncQuerySink
  • m_sFilePath : MyOSPObject
  • m_sFilter : CDlgIADsContainer , CDlgIDirectorySearch
  • m_Sfx : CCapMFCDlg
  • m_sGUID : CDlgIADs
  • m_shutdown : CShutdownDlg
  • m_sidMyself : CAppletSession
  • m_Singleton : CRTCAVSession
  • m_Sink : ThreadArg_Struct , Hello3J , Hello2J
  • m_SinkID : Hello3J , Hello2J
  • m_size : CSimpSvrObj
  • m_sizeInitPos : CChildView
  • m_sizel : CDataXferObj , CSimpleSite
  • m_SKU : COfficeDlg
  • m_sLogFile : CComSpy
  • m_sName : CRenameDlg , CDlgIADs
  • m_sNewName : CRenameDlg
  • m_sOldName : CRenameDlg
  • m_spADObject : CPropSheetHost
  • m_spADsContainerObj : CSCPWiz , CWizExtUser
  • m_spADsCopySourceObj : CSCPWiz , CWizExtUser
  • m_spADsObj : CSCPWiz , CWizExtUser
  • m_sParent : CDlgIADs , CDlgIDirectoryObject
  • m_sPassword : CDlgIADsOpenDSObject
  • m_spClassFactory : CSDKSamplePlaylistParser , CSDKSamplePlaylistParserPlugin
  • m_spCommandContext : CSDKSamplePlaylistParser
  • m_spCommentEditBox : CAnnotator
  • m_spConnection : CProxy
  • m_spDataObj : CContextMenu , CSCP , CSCPCMenuDialog , CProppageUser
  • m_spDesigner : CAnnotator
  • m_spDoc : CBrowserHost , CBehavior , CAnnotator
  • m_spDsAdminNewObj : CSCPWiz , CWizExtUser
  • m_spDsAdminNewObjPrimarySite : CSCPWiz
  • m_spDsObj : CSCPUIBindingInfo , CSCPUIGeneral , CProppageUserUI , CSCPUIKeywords
  • m_Speak : CCapMFCDlg
  • m_SpeakText : CCapMFCDlg
  • m_SpeechOutputLabel : CCapMFCDlg
  • m_spElem : CBehavior
  • m_spGrid : CBrowserHost
  • m_spIInkCollector : CAdvRecoApp , CMultiRecoApp
  • m_spIInkCustomStrokes : CMultiRecoApp
  • m_spIInkDisp : CAdvRecoApp , CMultiRecoApp
  • m_spIInkRecoContext : CMultiRecoApp , CAdvRecoApp
  • m_spIInkRecognizers : CAdvRecoApp , CMultiRecoApp
  • m_spIInkRecoGuide : CAdvRecoApp
  • m_spIInkRecoGuideBoxed : CMultiRecoApp
  • m_spIInkRecoGuideLined : CMultiRecoApp
  • m_spIInkRenderer : CAdvRecoApp
  • m_spIInkStrokes : CMultiRecoApp , CAdvRecoApp
  • m_spInPlaceObject : CBrowserHost
  • m_spLoadStream : CWebBrowser
  • m_spNamedValues : CSDKSamplePlaylistParserPlugin , CDBAuthPlugin , CSDKSamplePlaylistParser , CAuthenticatePlugin
  • m_spObjectContext : CRDOComponent , CADOComponent , COLEDBComponent , CPooledData , CCrmFilesTest
  • m_spOleCmdTarg : CBrowserHost
  • m_spOleObject : CWebBrowser
  • m_spOMSite : CBehavior
  • m_spPaintSite : CGrid
  • m_spParent : CBehavior
  • m_spPresentationContext : CSDKSamplePlaylistParser
  • m_spSel : CBehavior
  • m_spServer : CDBAuthPlugin
  • m_spServerContext : CSDKSamplePlaylistParserPlugin , CSDKSamplePlaylistParser
  • m_spSite : CGrid , CBehavior
  • m_spSnap : CBrowserHost
  • m_spSrcElem : CAnnotator
  • m_spUnkInner : CAggregate
  • m_spUserContext : CSDKSamplePlaylistParser
  • m_spWebBrowser : CBrowserHost
  • m_spWebBrowser2 : CWebBrowser
  • m_spWin : CBehavior
  • m_spXMLDocument : CXmlDOM
  • m_SQLEditBox : CADVCGENDlg
  • m_SqlText : Query
  • m_srchInfo : CADsSearch
  • m_sRDN : CDeleteObjectDlg , CDlgIDirectoryObject
  • m_sSchema : CDlgIADs , CDlgIDirectoryObject
  • m_sServer : RqsEngine
  • m_sSortOn : CDlgIDirectorySearch
  • m_sSQL : CComSpySqlAudit
  • m_sStart : CTIMER
  • m_sStop : CTIMER
  • m_StartDiscovery : CGenericUCPDlg
  • m_State : CAuthenticateContext
  • m_state : CAsyncTest
  • m_State : Object_Property , RqsClient , ASYNC_REQUESTER
  • m_staticIcon : CBasePropertyPage
  • m_staticTitle : CBasePropertyPage
  • m_StatusText : CGenericUCPDlg
  • m_stkClassFactories : CSurrogate
  • m_Stop : CCapMFCDlg
  • m_StopBeforePlay : CCapMFCDlg
  • m_stopThread : CAdvClientDlg
  • m_str : CComWSTR
  • m_strBody : CSendMessageDialog
  • m_strCAName : CCertPolicySample , CCertExitSample
  • m_strCASanitizedDSName : CCertPolicySample
  • m_strCASanitizedName : CCertPolicySample
  • m_strChannelMask : CDlgDest
  • m_strClusterName : CClusterData
  • m_strCmdText : CCommand
  • m_strDescription : CCertExitSample , CCertPolicySample
  • m_strError : CStringException
  • m_strFriend : CDisdrawDlg
  • m_StringType : CCertEncodeStringArray
  • m_strLabel : CSendMessageDialog , CCreateQueueDialog
  • m_strLogin : CLoginDlg , CDisdrawDlg , CConnectDlg
  • m_strMachineDNSName : CCertPolicySample
  • m_strName : CObjData , CDlgSrc
  • m_strObjectDesc : CBase
  • m_strPath : CFileShareSampleParamsPage
  • m_strPathName : CCreateQueueDialog
  • m_strPrevPath : CFileShareSampleParamsPage
  • m_strPrevRemark : CFileShareSampleParamsPage
  • m_strPrevShareName : CFileShareSampleParamsPage
  • m_strrefAttributeList : CMultiValuedAttributeEditor
  • m_strRegStorageLoc : CCertPolicySample
  • m_strRemark : CFileShareSampleParamsPage
  • m_strRemoteComputerName : CDisdrawDlg , CImp_DrawDlg
  • m_strResTypeName : CResData
  • m_strShareName : CFileShareSampleParamsPage
  • m_strTemplateName : CRequestInstance
  • m_strTemplateObjId : CRequestInstance
  • m_strTitle : CBasePropertyPage
  • m_SubscriptionGuid : CSysLCESub
  • m_sum : CAsyncFullServ
  • m_sUserName : CDlgIADsOpenDSObject , CADQIApp
  • m_szAdminPathName : CSendMessageDialog
  • m_szADsPath : CSCPCMenuDialog
  • m_szAppName : CFactoryData
  • m_szBindingInfo : CSCPUIGeneral
  • m_szCaption : CDownloadUI
  • m_szClass : CSCPCMenuDialog , CProppageUserUI , CSCPUIKeywords , CSCPUIBindingInfo , CSCPUIGeneral
  • m_szClassName : CSCPWiz , CWizExtUser
  • m_szComPortName : CPSTN
  • m_szConnID : CPluggableTransport
  • m_szContCanonicalName : CSCPWiz , CWizExtUser
  • m_szDatabase : CImportRes , CGenerateRC
  • m_szDescription : CSCPUIGeneral
  • m_szDLLFile : CImportRes
  • m_szFilePath : MyOSPObject
  • m_szFileUserClickedOn : CShellExt
  • m_szFormatName : COpenQueueDialog
  • m_szGuideBox : CAdvRecoApp
  • m_szHiddenWindowClass : CPropSheetHost
  • m_szHostName : CX224
  • m_szInternalAddress : RqsEngine
  • m_szLabel : CLocateDialog
  • m_szName : CSCPPageGeneral
  • m_szname : CFactoryData
  • m_szOrigDb : CGenerateRC , CImportRes
  • m_szPath : CProppageUserUI , CSCPUIBindingInfo , CSCPUIKeywords , CSCPUIGeneral , CEnumIDList
  • m_szPathName : CSendMessageDialog , CCloseQueueDialog , CReceiveMessageDialog , COpenQueueDialog , CDeleteQueueDialog
  • m_szPrefix : CSCPCMenuDialog
  • m_szProgID : CFactoryData
  • m_szPropSheetFileUserClickedOn : CShellExt
  • m_szServer : CSCPCMenuDialog
  • m_szServerConfigPath : CSCPCMenuDialog
  • m_szServiceClassName : CSCPUIGeneral , CSCPPageGeneral
  • m_szServiceDNSName : CSCPUIGeneral , CSCPPageGeneral
  • m_szServiceDNSNameType : CSCPPageGeneral , CSCPUIGeneral
  • m_szTblNm : CDBFile
  • m_szText : CPrintSDIDoc , NewDocDlg
  • m_szTitle : CWizExtUser , CSCPWiz
  • m_szTmpBuf : TempBuffer
  • m_szUsername : CSCPCMenuDialog
  • m_szValueList : CSCPPageKeywords , CSCPUIBindingInfo , CSCPPageBindingInfo , CSCPUIKeywords
  • m_szVerIndProgID : CFactoryData
  • m_szWritingBox : CInkInputWnd
  • m_TableInfo : CTable
  • m_TableListBox : CADVCGENDlg
  • m_tabParamSets : CExecuteParamDlg
  • m_TaskCount : CEnumTASK
  • m_tcsPropertyName : tagProperties
  • m_td : CThreadData
  • m_temp : CAdvClientDlg
  • m_tfClientID : CTSFEditWnd , CTSFMainWnd
  • m_thisGUID : CDeviceNode , CStaticNode , CFolderNode , CVirtualFile
  • m_thread : CAdvClientDlg , CBicycleFolder , CBackgroundFolder
  • m_threadCmd : CBicycleFolder
  • m_ThreadHandle : CProvider_IWbemEventProvider
  • m_threadId : CBackgroundFolder , CAdvClientDlg , CBicycleFolder
  • m_ThreadTerminate : CProvider_IWbemEventProvider
  • m_thumbNailPhotoHolder : CProppageUserUI , CExtPageUser
  • m_TimeRemaining : ASYNC_REQUESTER
  • m_timerId : CMMCControl
  • m_tree : CXMLTreeDlg
  • m_txuow : CUpdateReceipt , CAccount , CPooledData
  • m_Type : CEntity , Object_Property
  • m_uContext : CDataObject
  • m_uCookie : CDataObject
  • m_UDN : CDeviceProp
  • m_uiBytesRead : RqsClient
  • m_uiCount : RqsConfig
  • m_uIDBlank : CStatusHelper
  • m_uIDCur : CStatusHelper
  • m_uIDD : CDialogLite
  • m_uidMember : CMember
  • m_uidMyself : CAppletSession
  • m_uIDPopupMax : CStatusHelper
  • m_uIDPopupMin : CStatusHelper
  • m_uIDStatic : CStatusHelper
  • m_uIDSysMenu : CStatusHelper
  • m_uiMessageSize : RqsClient
  • m_uiPort : RqsConfig
  • m_uItemCount : CContextMenu , CDataObject
  • m_ulActiveSessions : CDataSource
  • m_ulBlobSize : CTableCopy
  • m_ulBufferLen : CSmpFilter
  • m_ulCharsRead : CSmpFilter
  • m_ulChunkID : CSmpFilter
  • m_ulClientCount : RqsEngine
  • m_ulCodePage : CSmpFilter
  • m_ulDataTypeOffset : CFileIO
  • m_ulDexCnt : CFileIdx
  • m_ulDialogId : CSimpleDialog
  • m_ulElements : CList< TYPE, ARG_TYPE > , CExList< TYPE >
  • m_ulGrowSize : CVector< TYPE, IDX >
  • m_ulLowerBound : CVector< TYPE, IDX >
  • m_ulMaxRows : CTableCopy
  • m_ulMaxSize : CVector< TYPE, IDX >
  • m_ulNestingLevel : CIntTrace
  • m_ulParamSets : CTableCopy
  • m_ulPartitionSize : CPartitionInfo
  • m_ulProgressMax : CDownloadUI
  • m_ulProgressSoFar : CDownloadUI , CDownloadBindStatusCallback
  • m_ulRowRefCount : CRowset
  • m_ulSCSIBus : CStorageResource
  • m_ulSCSILun : CStorageResource
  • m_ulSCSIPort : CStorageResource
  • m_ulSCSITid : CStorageResource
  • m_uNodeTypeFlg : CDataObject
  • m_UPC : CDeviceProp
  • m_User : CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_uState : CShellView
  • m_vActivityId : CCrmMonComp
  • m_Value : Object_Property
  • m_value : CAssoc< KEY, VALUE >
  • m_ValueEditor : CMultiValuedAttributeEditor
  • m_ValueList : CMultiValuedAttributeEditor
  • m_varContext : CProxyPlugin::COpState
  • m_VariableName : CGenericUCPDlg
  • m_VarVect : CDynamic
  • m_vDataSource : CDSLConnectionPage
  • m_vecClerks : CCrmMonComp
  • m_veclItemId : COShip , CONotify , COrder , COShip2
  • m_veclQuantity : CONotify , COrder , COShip , COShip2
  • m_vecParams : CExecuteParamDlg
  • m_vecShipStatus : COShip2 , COShip , CONotify
  • m_vecValues : CExecuteParamDlg
  • m_ViewSCPD : CGenericUCPDlg
  • m_vIndex : CLERK_ENTRY
  • m_vListeners : MyOSPObject , MyDataSource
  • m_vtFriendName : CImp_DrawDlg
  • m_vtguidDraw : CImp_DrawDlg
  • m_vtLogin : CImp_DrawDlg
  • m_vTxUOWRequired : CCrmMonComp
  • m_WaitID : Hello3J
  • m_wBindingType : COptionsSheet
  • m_wchFile : CMultiRecoApp
  • m_wchFileTitle : CMultiRecoApp
  • m_wClient : CObjSecurity
  • m_wcsBuffer : CSmpFilter
  • m_wcsFormatNameList : CDisdrawDlg
  • m_wcsName : CCounterData
  • m_weight : Deers
  • m_wfExt : CDlgDest
  • m_wfx : CDlgSrc
  • m_wfxFormat : CPlgPin
  • m_Win32_ProcessEx_Object : CProvider_IWbemServices
  • m_wmsContexts : CContextPlugin
  • m_wmsContextTypes : CContextSamplePropPage
  • m_wmsOrigContextTypes : CContextSamplePropPage
  • m_wndAddressBox : CBrowserHost
  • m_wndBox1 : CBrowserHost
  • m_wndBox2 : CBrowserHost
  • m_wndBox3 : CBrowserHost
  • m_wndBox4 : CBrowserHost
  • m_wndButton1 : CBrowserHost
  • m_wndButton2 : CBrowserHost
  • m_wndButton3 : CBrowserHost
  • m_wndButton4 : CBrowserHost
  • m_wndButton5 : CBrowserHost
  • m_wndButton6 : CBrowserHost
  • m_wndButton7 : CBrowserHost
  • m_wndCheckBox : CBrowserHost
  • m_wndDlgBar : CMainFrame
  • m_wndIncrementCombo : CBrowserHost
  • m_wndInput : CAdvRecoApp , CMultiRecoApp
  • m_wndLeftBand : CBrowserHost
  • m_wndPlacement : CWndLite
  • m_wndResults : CMultiRecoApp , CAdvRecoApp
  • m_wndStatusBar : CMainFrame , CBrowserHost
  • m_wndToolBar : CBrowserHost , CMainFrame
  • m_wndTopBand : CBrowserHost
  • m_wndUrlCombo : CBrowserHost
  • m_wndView : CMainFrame
  • m_WorkItemQueue : ISAPITHREAD
  • m_wp : CSpyCon
  • m_wpListBox : MainDlg
  • m_wpMoveX : MainDlg
  • m_wpMoveY : MainDlg
  • m_wpOrigEditProc : CRTCIMSession
  • m_wPort : CProxyPlugin::COpState
  • m_wpSpeakText : MainDlg
  • m_wReqType : CEditValueDlg
  • m_wszASPRevocationURL : CCertPolicySample
  • m_wszCatalog : CFullConnectProperties
  • m_wszConfigName : CFullConnect
  • m_wszConnection : CODBCData
  • m_wszDataSource : CFullConnectProvider
  • m_wszDataSourcePath : CRowset
  • m_wszDeleteStoredProc : CProxy , CResultset , CEntity
  • m_wszFilePath : CRowset , CUtilProp
  • m_wszIDQuote : CTable
  • m_wszIDSeperator : CTable
  • m_wszInsertStoredProc : CProxy , CEntity , CResultset
  • m_wszIntegrated : CFullConnectSecurity
  • m_wszKeyField : CProxy , CResultset , CEntity
  • m_wszLastCmd : CCmdLineLite
  • m_wszLocation : CFullConnectProvider
  • m_wszPassword : CImpAuth , CFullConnectProvider
  • m_wszPath : CDataSource
  • m_wszProvString : CFullConnectProperties
  • m_wszQualTableName : CTable
  • m_wszReadStoredProc : CResultset , CProxy , CEntity
  • m_wszRegStorageLoc : CCertExitSample , CCertPolicySample
  • m_wszRemoteServer : CFullConnectOptions , COptionsSheet
  • m_wszSourceFileName : CCrmFilesCompensator
  • m_wszTempFile : CPack
  • m_wszTempFileName : CCrmFilesCompensator
  • m_wszUpdateStoredProc : CProxy , CResultset , CEntity
  • m_wszUserID : CFullConnectProvider
  • m_wszUserName : CImpAuth
  • m_wType : CStream
  • m_wValidBitsPerSample : CDlgDest
  • m_wzStatus : CDeviceNode
  • m_XLabel : CCapMFCDlg
  • m_xOffset : CSimpSvrObj
  • m_xPos : CFileViewer
  • m_YLabel : CCapMFCDlg
  • m_yOffset : CSimpSvrObj
  • m_yPos : CFileViewer
  • Main()
: AutoClaims::AutoClaims
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • main() : MyOSPObject
  • Main()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
, InkRecognition::InkRecognition
  • main() : VJQuery , MyDataSource
  • Main()
: PaperForm::PaperForm
, WsdlDiscovery::frmMain
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkCollection::InkCollection
, InkErase::InkErase
, AutoClaims::AutoClaims
  • main() : Class1
  • Main() : storesh::Storesh
  • main() : NewsFlash , NewsSubscriber , CapJ
  • Main()
: Sample::Sample
, CSharp_Draw::Form1
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, Microsoft::Uddi::Demo::Publish
, Serialization::SerializationForm
, InkHitTest::InkHitTest
  • main() : About
  • Main() : Sample::Sample
  • MainDlg() : MainDlg
  • mainMenu
: PaperForm::PaperForm
, InkClipboard::InkClipboard
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, Sample::UI::MainWindow
  • mainMenu1 : CapJ , InkHitTest::InkHitTest
  • MainWindow() : Sample::UI::MainWindow
  • MakeEllipsisPath() : CCapMFCDlg , MainDlg , CapJ
  • MakeTree() : CXMLTreeDlg
  • MakeVariantArray() : CCrmFilesCompensator
  • ManualConstruct() : CPooledData , CProxy
  • ManualConstructData() : CODBCData
  • Map() : CMmStreamConsecBuf , CMmStream , PMmStream
  • MapAll() : PMmStream , CMmStream
  • MapColumnIDs() : CImpIColumnsInfo
  • MapGeneric() : CObjSecurity
  • MapTableInfo() : CTable
  • MapTypes() : CTableCopy
  • margin : PrintContext
  • MarkAllAppsForDelete() : CSelectEventsDlg
  • MarkItemsAsCut() : CShellView
  • MarshalInterface() : CDynamic , CEntity , CResultset , CClassFactoryWrapper
  • mask : ENUMSYMDATA
  • MatchExtendedKeyUsage() : CIsapiCertPolicyFilter
  • MatchIssuerThumbprint() : CIsapiCertPolicyFilter
  • MatchSid() : CSids
  • MAX_CHILDREN : CSpaceStation , CBackgroundFolder
  • MAX_COOKIES : CDataObject
  • MAX_NUMBER_OF_CHILDREN : CSpaceVehicle
  • MAX_RECENT_FILENAME : CapJ
  • MAX_RECENT_FILES : CapJ
  • max_repetitions : GlobalVars
  • max_resp_time : igmp_hdr_query_v3 , igmp_hdr
  • MaxChainLength : _LSP_ENTRY
  • MaximumLength : _UNICODE_STRING
  • maxrest : view
  • MaxStrLen : GLOBAL_STRUCT
  • maxtag : view
  • mc_AtlFuncInfo : IInkCollectorEventsImpl< T > , IInkRecognitionEventsImpl< T >
  • mc_cNumMSGestures : CAdvRecoApp
  • mc_cNumSSGestures : CAdvRecoApp
  • mc_crColors : CMultiRecoApp
  • mc_cxBoxMargin : CMultiRecoApp , CAdvRecoApp
  • mc_cxGestLVWidth : CAdvRecoApp
  • mc_cyBoxMargin : CAdvRecoApp , CMultiRecoApp
  • mc_iFontHeight : CRecoOutputWnd
  • mc_iGuideColWidth : CMultiRecoApp , CAdvRecoApp
  • mc_iGuideRowHeight : CAdvRecoApp , CMultiRecoApp
  • mc_iInputWndId : CMultiRecoApp , CAdvRecoApp
  • mc_iMarginX : CRecoOutputWnd
  • mc_iMarginY : CRecoOutputWnd
  • mc_iMSGestLVId : CAdvRecoApp
  • mc_iNumResults : CRecoOutputWnd
  • mc_iNumRowsCols : CMultiRecoApp , CAdvRecoApp
  • mc_iOutputWndId : CAdvRecoApp , CMultiRecoApp
  • mc_iPenWidth : CAdvRecoApp , CMultiRecoApp
  • mc_iSSGestLVId : CAdvRecoApp
  • mc_iStatusWndId : CMultiRecoApp , CAdvRecoApp
  • mc_iSubmenuGuides : CAdvRecoApp
  • mc_iSubmenuInputScopes : CAdvRecoApp
  • mc_iSubmenuModes : CAdvRecoApp
  • mc_iSubmenuRecognizers : CAdvRecoApp , CMultiRecoApp
  • mcRef : CClassFactory , CObject
  • MDIActivate() : CMDIFrameLite
  • MDIDestroy() : CMDIFrameLite
  • MDIWndProc() : CMDIChildLite
  • MediaID : STL_LABEL
  • MediumInkWidth
: InkClipboard::InkClipboard
, InkErase::InkErase
, InkCollection::InkCollection
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • MemAlloc() : CFileViewer
  • MemberChanged() : CFtNotify , CConfNotify , CFileTransferNotify , CConfNotify , CAppShareNotify , CDataNotify , CChannelNotify , CConfNotify , CAppShareNotify , CConfNotify , CDataNotify
  • MemFree() : CFileViewer
  • MenuBar : Serialization::SerializationForm
  • menuItem1 : CapJ
  • menuItem4 : PaperForm::PaperForm
  • MenuSelect() : CStatusHelper
  • MergeEditMenu() : CShellView
  • MergeFileMenu() : CShellView
  • MergeMenus() : COleDocumentView
  • MergeToolbar() : CShellView
  • MergeViewMenu() : CShellView
  • MessageBox() : CContextSamplePropPage
  • MessageDisplay() : CStatusHelper
  • MessageId : _SIGNATURE
  • MessageLoop() : CFrame
  • MessageMap() : CStatusHelper
  • MessageType : _MESSAGE , _MSV1_0_INTERACTIVE_LOGON
  • Method1() : COMPlus
  • METHOD_GETPROPERTIES : CPropertiesDlg
  • METHOD_GETPROPERTYINFO : CPropertiesDlg
  • METHOD_SETPROPERTIES : CPropertiesDlg
  • METHOD_TYPE : CPropertiesDlg
  • miAction : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • miActionSeparator : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miAutomaticLayoutAnalysis : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miAutomaticLayoutAnalysis_Click() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • MibFunc : mib_entry
  • miBlack : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miBlack_Click()
: InkCollection::InkCollection
, InkClipboard::InkClipboard
  • miBlue : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miBlue_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miBMP : InkClipboard::InkClipboard
  • miBMP_Click() : InkClipboard::InkClipboard
  • MibNext : mib_entry
  • miClear
: InkErase::InkErase
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkClipboard::InkClipboard
, PaperForm::PaperForm
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miClear_Click()
: Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, InkErase::InkErase
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkClipboard::InkClipboard
, PaperForm::PaperForm
  • miColor : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miCopy : InkClipboard::InkClipboard
  • miCopy_Click() : InkClipboard::InkClipboard
  • miCuspErase : InkErase::InkErase
  • miCuspErase_Click() : InkErase::InkErase
  • miCut : InkClipboard::InkClipboard
  • miCut_Click() : InkClipboard::InkClipboard
  • miDivide : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miDivide_Click() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miEdit : PaperForm::PaperForm
  • miEdit_Click() : PaperForm::PaperForm
  • miEditSeparator : InkClipboard::InkClipboard
  • miEMF : InkClipboard::InkClipboard
  • miEMF_Click() : InkClipboard::InkClipboard
  • miEnabled : InkCollection::InkCollection
  • miEnabled_Click() : InkCollection::InkCollection
  • miErase : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miErase_Click() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miEraser : PaperForm::PaperForm
  • miEraser_Click() : PaperForm::PaperForm
  • miExit
: InkHitTest::InkHitTest
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, PaperForm::PaperForm
, InkCollection::InkCollection
, InkErase::InkErase
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkClipboard::InkClipboard
  • miExit_Click()
: InkClipboard::InkClipboard
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
, InkCollection::InkCollection
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkCollection::InkCollection
, InkHitTest::InkHitTest
, InkErase::InkErase
  • miFile : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom , Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miFormatSeparator : InkClipboard::InkClipboard
  • miGreen : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miGreen_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miInk
: InkClipboard::InkClipboard
, InkErase::InkErase
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, PaperForm::PaperForm
  • miInk_Click()
: Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, InkErase::InkErase
, InkClipboard::InkClipboard
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miInkSeparator : InkClipboard::InkClipboard
  • miIntersectErase : InkErase::InkErase
  • miIntersectErase_Click() : InkErase::InkErase
  • miISF : InkClipboard::InkClipboard
  • miISF_Click() : InkClipboard::InkClipboard
  • miLassoSelect : InkClipboard::InkClipboard
  • miLassoSelect_Click() : InkClipboard::InkClipboard
  • miMain
: RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkErase::InkErase
, InkCollection::InkCollection
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miMainAction : InkClipboard::InkClipboard , InkErase::InkErase
  • miMainEdit : InkClipboard::InkClipboard
  • miMainEdit_Popup() : InkClipboard::InkClipboard
  • miMainFile : InkCollection::InkCollection
  • miMainFormat : InkClipboard::InkClipboard
  • miMainInk : InkCollection::InkCollection
  • miMainMode : InkErase::InkErase
  • miMedium : InkCollection::InkCollection , InkClipboard::InkClipboard
  • miMedium_Click()
: InkCollection::InkCollection
, InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miMetafile : InkClipboard::InkClipboard
  • miMetafile_Click() : InkClipboard::InkClipboard
  • miMode : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm , PaperForm::PaperForm
  • miModeSepararator : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miNoOLE : InkClipboard::InkClipboard
  • miNoOLE_Click() : InkClipboard::InkClipboard
  • mint : _DOSDTTM , _SFFS
  • miOther : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miPaste : InkClipboard::InkClipboard
  • miPaste_Click() : InkClipboard::InkClipboard
  • miPen : PaperForm::PaperForm
  • miPen_Click() : PaperForm::PaperForm
  • miRecognize : PaperForm::PaperForm
  • miRecognize_Click() : PaperForm::PaperForm
  • miRed : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miRed_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miScalePenWidth : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miScalePenWidth_Click() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miSeparate : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miSeparator : RealTimeStylusPluginApp::RealTimeStylusPluginApp , InkErase::InkErase
  • miSInk : InkClipboard::InkClipboard
  • miSInk_Click() : InkClipboard::InkClipboard
  • miStrokeErase : InkErase::InkErase
  • miStrokeErase_Click() : InkErase::InkErase
  • miStyle : InkClipboard::InkClipboard
  • miThick : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miThick_Click()
: InkCollection::InkCollection
, InkClipboard::InkClipboard
  • miThin : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miThin_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miTInk : InkClipboard::InkClipboard
  • miTInk_Click() : InkClipboard::InkClipboard
  • miWidth : InkCollection::InkCollection , InkClipboard::InkClipboard
  • miZoomToRect : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miZoomToRect_Click() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • MK_LBUTTON : Notify
  • mMessage : _EVENT_ENTRY
  • mmrcLastErr : tag_seq
  • Mode : tagTrackObject
  • mode : InkHitTest::InkHitTest , InkErase::InkErase
  • ModeItem : InkHitTest::InkHitTest
  • ModifyPacketData() : RealTimeStylusPlugins::PacketFilterPlugin
  • ModifySettingsEventHandler() : CachePluginAdmin
  • mon : _SFFS
  • MonitorShutdown() : CExeModule
  • month : _DOSDTTM
  • MouseDown() : InkCollectorEvents
  • mouseDown : CEventSink
  • MouseMove() : InkCollectorEvents
  • MouseUp() : InkCollectorEvents
  • MouseWheel() : InkCollectorEvents
  • Move() : AgentNotifySink , CPropertyPage , AgentNotifySink , msado15::Recordset21 , msado15::Recordset , CapJ , CDialogStream , msado15::_Recordset , Notify , AgentNotifySink , msado15::Recordset15 , msado15::Recordset20 , Notify
  • Move_click() : CapJ
  • MoveComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • MoveFirst()
: msado15::Recordset21
, msado15::Recordset20
, msado15::Recordset
, msado15::_Recordset
, msado15::Recordset15
  • MoveLast()
: msado15::Recordset15
, msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset21
, msado15::Recordset
  • MoveNext()
: msado15::Recordset
, msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset15
, msado15::Recordset21
  • MovePrevious()
: msado15::Recordset
, msado15::_Recordset
, msado15::Recordset21
, msado15::Recordset20
, msado15::Recordset15
  • MoveRecord()
: msado15::_Record
, msado15::Record
  • MoveTo() : CAgentCtlCharacterEx
  • MoveToOpenedQueuePathNameArray() : CMainFrame
  • MoveToPathNameArray() : CMainFrame
  • MoveXWndProc : MainDlg
  • MoveYWndProc : MainDlg
  • msBase : tag_tempomapentry
  • MSPAddressAddRef() : CSampleMSP
  • MSPAddressRelease() : CSampleMSP
  • MSPCallAddRef() : CSampleMSPCall
  • MSPCallRelease() : CSampleMSPCall
  • mtHeaderSize : tagMETA16HEADER
  • mtMaxRecord : tagMETA16HEADER
  • mtNoObjects : tagMETA16HEADER
  • mtNoParameters : tagMETA16HEADER
  • mtSize : tagMETA16HEADER
  • mtType : tagMETA16HEADER
  • mtVersion : tagMETA16HEADER
  • MyChangeEventHandler : CacheProxySamplePlugin::CacheProxyPlugin
  • MyClassFactory() : MyClassFactory
  • myColor : AutoClaims::InkLayer
  • MyDataSource() : MyDataSource
  • myDrawingBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myDynamicRenderer : InkCollection::InkCollection
  • myGraphics : RealTimeStylusPlugins::CustomDynamicRendererPlugin
  • myHidden : AutoClaims::InkLayer
  • myInk : AutoClaims::InkLayer , InkCollection::InkCollection
  • myInkCollector
: Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, InkCollection::InkCollection
, InkErase::InkErase
, InkClipboard::InkClipboard
, InkRecognition::InkRecognition
  • myInkCollector_CursorDown() : InkErase::InkErase
  • myInkCollector_NewPackets()
: InkClipboard::InkClipboard
, InkErase::InkErase
  • myInkCollector_Stroke()
: InkErase::InkErase
, InkClipboard::InkClipboard
  • myInkDivider : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myInkOverlay : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myInkOverlay_Stroke() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myInkOverlay_StrokeDeleted() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myInkOverlay_StrokeDeleting() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myLineBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myMethod() : CSimple , CPower
  • MyOSPObject() : MyOSPObject
  • myPackets : InkCollection::InkCollection
  • myParagraphBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myPowerMethod() : CPower
  • MyQuery() : CCallBack
  • myRealTimeStylus : InkCollection::InkCollection , RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • myRecognizers : InkRecognition::InkRecognition
  • myRenderer : InkCollection::InkCollection
  • MySignedXml() : Sample::MySignedXml
  • MyString() : MyString
  • myWordBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- n -

  • n : UnionInt64
  • nAddr : tagLINEINFO
  • nAllocated : _Queue
  • nAllocLength : CStringData , _tagPOSDATA
  • name : FLAGMAPPING
  • Name : _CommandVtbl , WRTHANDLE
  • name : diritem , _CONNECTEXARGS
  • NamedValues : CachePluginAdmin
  • nameLabel : About
  • namelen : _CONNECTEXARGS
  • NAMESPACEEXTENSION : CClassFactory
  • nAmount : THREADDATA
  • nAppletUserID : tagAppletRecord
  • Navigate() : CWebBrowser
  • NavigateTo() : CVCExploreDlg
  • nBezCurr : _POLYDATA
  • nBezTotal : _POLYDATA
  • nBlockSize : NODE_PROPERTIES
  • nBPP : WININFO
  • nBufferLength : _tagPOSDATA
  • nBufferPos : _tagPOSDATA
  • nBufSize : _OPTIONS
  • nBytesOutstanding : tReq
  • nBytesRecd : _ClientContext
  • nBytesRemainingToBeSent : _ClientContext
  • ncells : CellDataList , TableSelection
  • nChannelID : tagAppletChannelRequest , tagAppletRegistryItem , IAppletSessionNotifyVtbl , IAppletSessionVtbl , tagAppletRegistryRequest
  • nChar : tagMULTI_SZ
  • nchars : ColProps , CellData
  • nChildCount : NODE_PROPERTIES
  • nColor : _POLYDATA
  • ncols : TableHdr , ColPropsList
  • nConfID : IAppletNotifyVtbl , IAppletVtbl , INVOKE_INFO
  • nCurrentPos : _tagPOSDATA
  • nDataBindLen : tagFieldMetaData
  • nDataLen : tagFieldMetaData
  • nDataLength : CStringData
  • NDeers : Deers
  • NearestPointItem : InkHitTest::InkHitTest
  • nearestPt : InkHitTest::InkHitTest
  • nElementCount : _TRANSMITPACKETSARGS
  • nEntityID : tagAppletRecord
  • nError : _SNMP_MGR_SESSION
  • nErrorIndex : _SNMP_MGR_SESSION
  • nErrorStatus : _SNMP_MGR_SESSION
  • NEW_EVENT_DLL : helper::sampleConstants
  • newDataResponse() : RSProxy
  • NewDocDlg() : NewDocDlg
  • newErrorResponse() : RSProxy
  • NewInAirPackets() : InkCollectorEvents
  • NewMenu : Serialization::SerializationForm
  • NewMenu_Click() : Serialization::SerializationForm
  • NewMove() : CComputer , CHuman
  • NewNode() : CLListImpl< TYPE, ARG_TYPE >
  • NewPackets() : InkCollectorEvents
  • newRequest() : RSProxy
  • NewsFlash()
: CNewsEvent
, cascadeec::CascadeEC
, cascadeec::INewsEvent
, cascadeec::INewsEventDefault
, newseventclass::INewsEvent
, newseventclass::INewsEventDefault
, newseventclass::NewsEvent
, NewsFlash
, NewsSubscriber
, persistatl::INewsEvent
, persistatl::INewsEventDefault
, persistatl::NewsEvent
  • NewsSubscriber() : NewsSubscriber
  • NewValue : tagDescInfo
  • Next : tagTrackObject , NILNode_c< T > , _SEC_CONTEXT , _CREDENTIAL , CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc , CLinkable , ClientList::Iterator , CGenericEnum , CEnumSyncMgrItems , NIDequeIter_c< T > , CEnumFormatEtc , CEnumTASK , CEnumStorageResource , CStorageResource , CEnumFormatEtc , CDataObject , CEnumIDList , CEnumDisplayAttributeInfo
  • next : _SOCK_INFO , Sock_Info , _WSAOVERLAPPEDPLUS
  • NextBlock : blockTag
  • NextEntity() : CProxy
  • NextLookup() : CProxy
  • NextPage() : CModel
  • NextProcTable : _PROVIDER
  • NextProcTableExt : _PROVIDER
  • NextProvider : _PROVIDER
  • NextRecordset()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • NextResultset() : CProxy
  • NextResultsetData() : CODBCData
  • NextSection() : CModel
  • nFail : CClientApp
  • nFailureRetries : BROWSER_CONFIG
  • nFirstHandle : IAppletSessionNotifyVtbl
  • nFonts : tagArFonts
  • nFormats : tagCMTMLTFMT
  • nFrom : THREADDATA
  • nHeader : REQUEST_CONTEXT
  • nHeight : _BALLDATA , WININFO , PROFILE_STRUCT
  • nHits : _OPEN_FILE
  • nId : CRocket , CPlane
  • nID : MEMICONDIRENTRY
  • NIDeque : NIDequeIter_c< T >
  • NIDeque_c() : NIDeque_c< T >
  • NIDeque_c< T > : NILNode_c< T >
  • NIDequeIter_c() : NIDequeIter_c< T >
  • NIDequeIter_c< T > : NILNode_c< T > , NIDeque_c< T >
  • nidInitiator : INVOKE_INFO
  • nidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • NILNode_c() : NILNode_c< T >
  • nInstance : _tagPOSTKEY
  • nInstanceNumber : tagAppletRoster
  • nitems : itemlist
  • nIters : THREADDATA
  • nJobs : _Queue
  • nlines : Table
  • nmAddrType : _PREF
  • nMajor : _tag_MMC_VERSION_INFO
  • nMaxUsers : _FILESHARESAMPLE_PROPS
  • nMaze : _MAZEDATA
  • nmCallType : _PREF
  • nMinor : _tag_MMC_VERSION_INFO
  • nMinOrMax : tagAppletCapabilityClass
  • NmUI() : CConfNotify , CMgrNotify , CConfNotify , CDataNotify , CMgrNotify , CConfNotify , CFtNotify , CMgrNotify , CConfNotify , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , CMgrNotify , CAppShareNotify , CCallNotify , CMgrNotify
  • nNodeID : tagAppletRecord
  • nNonStdCap : tagAppletCapabilityID
  • nNullable : tagFieldMetaData
  • nNumberOfBytesPerSend : _TRANSMITFILEARGS
  • nNumberOfBytesToWrite : _TRANSMITFILEARGS
  • nNumImages : ICONRESOURCE
  • nObject : _DRAWDATA , _XFORMDATA
  • non_repeaters : GlobalVars
  • Nonce : _SEC_CONTEXT
  • NondelegatingAddRef() : CUnknown
  • NondelegatingQueryInterface() : CAsyncXXX< T, ISyncFace, IAsyncFace > , CUnknown , CServer
  • NondelegatingRelease() : CUnknown
  • Notify() : CComponent , CGrid , CBehavior , Notify , CMgdResType , CMyMemberSetChangeListener , CMyStartupListener , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CAdminNotifyHandler , Notify , CComponentData , CStorageResType , CComponent , CComponentData
  • notify : THREADARGS
  • Notify() : qcnotify::Notify , MyOSPObject , CComponentData , CCertExitSample , CComponent , CCertExitSample , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent
  • NotifyRequestor() : COShip , COShip2
  • NotifyViews() : CShellFolder
  • nOwnerEntityID : tagAppletRegistryEntryOwner
  • nOwnerNodeID : tagAppletRegistryEntryOwner
  • nPduType : _SNMP_MGR_SESSION
  • nr_left : viewline
  • nr_right : viewline
  • nRead : _AIO_WORK_ITEM
  • nRefs : CStringData , _OPEN_FILE
  • nRepeat : _OPTIONS
  • nReqTag : IAppletSessionNotifyVtbl
  • nRequestId : _SNMP_MGR_SESSION , GlobalVars
  • nResource : REQUEST_CONTEXT
  • nRetries : GlobalVars
  • nrows : TableHdr , TableSelection
  • nRows : CREATEDATA
  • nrtext : view
  • nScale : tagFieldMetaData
  • nSendSize : _TRANSMITPACKETSARGS
  • nSentBytes : _PER_IO_CONTEXT
  • nSessionID : tagAppletSessionKey
  • NSPAddressToString() : DTHandler
  • NSPGetAddressByName() : DTHandler
  • NSPGetServiceClassInfo() : DTHandler
  • NSPGetServiceClassNameByClassId() : DTHandler
  • NSPInstallServiceClass() : DTHandler
  • NSPLookupServiceBegin() : DTHandler
  • NSPLookupServiceEnd() : DTHandler
  • NSPLookupServiceNext() : DTHandler
  • NSPRemoveServiceClass() : DTHandler
  • NSPSetService() : DTHandler
  • NSPStringToAddress() : DTHandler
  • nStartupChannelType : tagAppletSessionRequest
  • nStdCap : tagAppletCapabilityID
  • nStrLen : tagAppletLongString
  • nT203TimeoutInQ922 : tagPLUGXPRT_PARAMETERS
  • nTestType : THREADDATA
  • nThreads : THREADDATA
  • nTimeLimit : BROWSER_CONFIG
  • nTimeOut : GlobalVars
  • nTo : THREADDATA
  • ntohl() : DTHandler
  • ntohs() : DTHandler
  • nTokenID : tagAppletTokenRequest , IAppletSessionNotifyVtbl , tagAppletRegistryItem
  • nTotalBytes : _PER_IO_CONTEXT
  • nTotalClients : _RECV_INFO
  • nTotalLength : _BLRPLATECONFIG
  • nTotalRecd : _SOCK_INFO
  • nTotalRows : CREATEDATA
  • nTotalSends : _SEND_INFO
  • nTotalSent : _SOCK_INFO
  • nTotalThreads : _OPTIONS
  • nTranType : THREADDATA
  • nullable : FieldInfo
  • nullRect : CSimpSvrApp , CSimpleApp
  • num_records : igmp_hdr_report_v3
  • num_sources : igmp_hdr_query_v3 , igmp_group_record_v3
  • NUMBER_OF_CHILDREN : CComponentData , CSpaceVehicle , CIceSkateFolder , CBicycleFolder , CSpaceFolder , CSkateboardFolder , CPeoplePoweredVehicle , CSpaceStation , CSkyVehicle , CStaticNode
  • NumberOfWorkerThreads : _WORK_QUEUE
  • NumRecords : _RecordsetVtbl
  • nURL : REQUEST_CONTEXT
  • nWidth : _BALLDATA , PROFILE_STRUCT , WININFO
  • nWritesOutstanding : tReq
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- o -

  • Object : _ADODynaCollectionVtbl , ParametersVtbl
  • ObjectAddRef() : CBase
  • ObjectInitialize() : CSite
  • ObjectQI() : CBase
  • ObjectRelease() : CBase
  • Objects : tagObject
  • ObjectsNotInstalledError : AutoClaims::AutoClaims
  • offsetTitle : _DSA_SEC_PAGE_INFO
  • Oid : mib_entry
  • oid : GlobalVars
  • oidCount : GlobalVars
  • Ok() : CMmStream , PMmStream
  • okButton : About
  • OkButton : Sample::UI::AboutBox
  • OkButton_Click() : Sample::UI::AboutBox
  • okButton_click() : About
  • OldListBoxWndProc : GLOBAL_STRUCT
  • OleDuplicateString() : CComponent
  • OnAbort() : CMainWindow
  • OnAbout() : CSpyCon , CComSpy , CMainWindow
  • OnActivate() : CWndLite , CDialogLite , CShellView
  • OnActivateApp() : MainDlg , CCapMFCDlg
  • OnActivityCreate() : IComSpyAudit , CComSpySqlAudit , CActivitySub
  • OnActivityDestroy() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityEnter() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityLeave() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityLeaveSame() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityReenter() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityTimeout() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnAdd() : CBankDlg , CAttributeValueAddButton
  • OnAddDefinedProperties() : CPropertiesDlg
  • OnAddEquipment() : CAdvClientDlg
  • OnAddImages() : CComponent , CBackgroundFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CBackgroundFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CBackgroundFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CComponent
  • OnAddMenuItems() : CDelegationBase , CLandBasedVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CDelegationBase , CSpaceVehicle , CDelegationBase , CPlane , CSkyVehicle
  • OnAddParameter() : CExecuteParamDlg
  • OnAddparty() : CRTCOutgoingDlg
  • OnAddRef() : CMainWindow
  • OnAddressBox() : CBrowserHost
  • OnAddSet() : CExecuteParamDlg
  • OnAddValue() : CMultiValuedAttributeEditor
  • OnAdvise() : CMainWindow
  • OnAgentPropertyChange() : CCapMFCDlg
  • OnAggregation() : CInterfaceDlg
  • OnAlwaysOnTop() : CSpyCon
  • OnAmbientPropertyChange() : CMMCControl
  • OnAnswer() : CRTCIncomingDlg
  • OnApiCloseQueue() : CMainFrame
  • OnApiCreateQueue() : CMainFrame
  • OnApiDeleteQueue() : CMainFrame
  • OnApiLocate() : CMainFrame
  • OnApiOpenQueue() : CMainFrame
  • OnApiReceiveMessage() : CMainFrame
  • OnApiSendMessage() : CMainFrame
  • OnAppAbout() : CMultichanApp , CPrintSDIApp , CTestApp , CGenericUCPDlg , CAPIApp
  • OnAppActivation() : CComSpySqlAudit , CAppSub , IComSpyAudit
  • OnAppFileSearch() : CAppInstallDlg
  • OnAppForceShutdown() : CAppSub
  • OnApply() : COptionsError , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI , CBasePropertyPage , CFullConnectProvider , CPropPageLite , COptionsDataSource , COptionsCommand , COptionsAccessor , COptionsRowset , COptionsNotify
  • OnApplyChanges() : CVirtualFile , CExtendPropertySheet
  • OnAppSearch() : CAppUtilDlg
  • OnAppsharing() : CRTCOutgoingDlg
  • OnAppShutdown() : CComSpySqlAudit , CAppSub , IComSpyAudit
  • OnArrangeIcons() : CMainWindow
  • OnAssertOnErrors() : CBankDlg
  • OnAsyncFind() : CGenericUCPDlg
  • OnAuthenticate() : CComSpySqlAudit , CSecuritySub , IComSpyAudit
  • OnAuthenticateFail() : CComSpySqlAudit , CSecuritySub , IComSpyAudit
  • OnAuthentication() : CIsapiCertPolicyFilter
  • OnAuthorizeOpen() : CDBAuthPlugin
  • OnAutoPosition() : CMDIFrameLite
  • OnAutoQI() : CMainWindow
  • OnBalloonUse() : CCapMFCDlg
  • OnBeginDrag() : CTreeViewLite
  • OnBeginLabelEdit() : CTreeViewLite
  • OnBeginPrinting() : CPrintSDIView
  • OnBindGuid() : CDlgIADs
  • OnBorder() : CSplitterLite
  • OnBox1() : CBrowserHost
  • OnBox2() : CBrowserHost
  • OnBox3() : CBrowserHost
  • OnBox4() : CBrowserHost
  • OnBuild() : CADVCGENDlg
  • OnButton1() : CBrowserHost
  • OnButton10() : CBrowserHost
  • OnButton2() : CBrowserHost
  • OnButton3() : CBrowserHost
  • OnButton4() : CBrowserHost
  • OnButton5() : CBrowserHost
  • OnButton6() : CBrowserHost
  • OnButton7() : CBrowserHost
  • OnButton8() : CBrowserHost
  • OnButton9() : CBrowserHost
  • OnButtonAddQueue() : CDisdrawDlg
  • OnButtonAttach() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • OnButtonClick() : CSCPPageBindingInfo , MainDlg
  • OnButtonClicked() : CDelegationBase , CRocket
  • OnCacheClientClose() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnCancel() : CMain , CTestDlg , CPropertiesDlg , CExecuteParamDlg , CDialogLite , CPropPageLite , CDlgDest , CDlgSrc , CADQIDlg , CBaseDialog , CAdvClientDlg , CSimpleDialog , CProcessDlg , CQueryDlg , CSessionDlg
  • OnCancelDownloadContent() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnCascade() : CMainWindow
  • OnChange() : CAttributeValueEditor , CCompartmentMonitor , CMarkTextService
  • OnChangeADsPath() : CADQIDlg , CDlgIADsOpenDSObject
  • OnChangeADspath() : CMoveDlg
  • OnChangeAttribute() : CDlgIDirectoryObject
  • OnChangeCtrl() : CBasePropertyPage
  • OnChangeDelete() : CDeleteObjectDlg
  • OnChangeDomainName() : CServerDlg
  • OnChangeEditFriend() : CDisdrawDlg
  • OnChangeEditFriendComputer() : CDisdrawDlg
  • OnChangeFilename() : CXMLTreeDlg
  • OnChangeFilter() : CDlgIDirectorySearch
  • OnChangePicture() : CProppageUserUI , CExtPageUser
  • OnChangeRequiredField() : CClipBookServerParamsPage , CFileShareSampleParamsPage
  • OnChangeSpeakText() : CCapMFCDlg
  • OnChangeTableList() : CADVCGENDlg
  • OnChangeUsername() : CDlgIADsOpenDSObject
  • OnChar() : CWndLite , CDrawArea
  • OnCharacterCommand() : MainDlg
  • OnCharacterMove() : MainDlg
  • OnCharacterRightClick() : MainDlg
  • OnCheckauto() : CRTCIncomingDlg
  • OnCheckBox() : CBrowserHost
  • OnCheckBoxClick() : CComSpyPropPage
  • OnChooseFont() : CSpyCon , CComSpy
  • OnChooseLogFile() : CSpyCon , CComSpy
  • OnCleanupContext() : CMarkTextService
  • OnClear() : CSpyCon , CComSpy , CAdvRecoApp , CMultiRecoApp
  • OnClearAll() : CPropertiesDlg
  • onClearClick() : InkHitTest::InkHitTest
  • OnClearPicture() : CProppageUserUI , CExtPageUser
  • OnClick() : CEventSink , CLangBarItemButton
  • OnClickedAnimate() : CMMCControl
  • OnClickedRadio_COMPlusSync() : CMain
  • OnClickedRadio_Free() : CMain
  • OnClickedRadio_STA() : CMain
  • OnClickedStart() : CMain
  • OnClose() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg , CVCExploreDlg , CSpyCon , CBankDlg , CWndLite , CFrameWndLite , CMDIChild , CMDIObjects , CMDITrace , CDisdrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCSession , CRTCWin , CGenericUCPDlg , CBaseDialog , CMultiRecoApp , CSimpleDialog
  • OnCloseAll() : CMainWindow
  • OnCloseClick() : CGenericUCPDlg
  • OnCLSID() : CCompImportDlg
  • OnCmdMsg() : CMainFrame
  • OnColumnClick() : CListViewLite , CDataGrid
  • OnComboBitdepth() : CDlgDest
  • OnComboSamplerate() : CDlgDest
  • OnComboSpeaker() : CDlgSrc
  • OnComboWaveformat() : CDlgDest
  • OnCommand() : COleDocumentView , CFrame , CInterfaceDlg , CPropertiesDlg , CFullConnectProvider , CFullConnectProperties , CFullConnectSecurity , CFullConnectOptions , CConstraintDlg , CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg , CExecuteParamDlg , CWndLite , CMDIFrameLite , CMainWindow , CMDIChild , CObjTree , CMDIObjects , COptionsDataSource , COptionsRowset , COptionsError , CIntTrace , CMDITrace , CRTCAVSession , CRTCIMSession , CRTCWin , MainDlg , CCapMFCDlg , CCommBand , CDeskBand , CExplorerBar , CToolBand , CFileViewer , CShellView
  • OnCommandAgent() : CCapMFCDlg
  • OnCommandNotify() : CPropertiesDlg , CFullConnectProvider , CAlterColumnDlg , CWndLite , CMDIFrameLite , CListBoxLite , CComboBoxLite
  • OnCompareContentInformation() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnComponentSearch() : CCompInstallDlg
  • OnCompositionTerminated() : CMarkTextService
  • OnConfigDlgAdd() : CSettings
  • OnConfigDlgCommand() : CSettings
  • OnConfigDlgDestroy() : CSettings
  • OnConfigDlgEdit() : CSettings
  • OnConfigDlgInit() : CSettings
  • OnConfigDlgNotify() : CSettings
  • OnConfigDlgRemove() : CSettings
  • OnConnect() : CMainWindow , CDisdrawDlg , CImp_DrawDlg , CConnectDlg , CRTCOutgoingDlg , CAdvClientDlg , CWbemClientDlg
  • OnContextHelp() : CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • OnContextMenu() : CExecuteParamDlg , CWndLite , CQueryBox , CDataGrid , CObjTree , CIntTrace
  • OnCopy() : CBankDlg , CDlgIADs
  • OnCopyAll() : CBankDlg
  • OnCopyErrors() : CBankDlg
  • OnCreate() : CComSpy , COleDocumentView , CWndLite , CMDIFrameLite , CEditBoxLite , CRichEditLite , CListViewLite , CTreeViewLite , CTabLite , CMainWindow , CMDIChild , CMDIObjects , CMDITrace , CMainFrame , CTestView , CRTCAVSession , CRTCIMSession , CRTCSession , CRTCWin , CAdvRecoApp , CMultiRecoApp , CBrowserHost , CBasePropertyPage , CMainFrame , CShellView
  • OnCreateClient() : CMDIFrameLite
  • OnCreateFileMoniker() : CMainWindow
  • OnCreateRows() : CBankDlg
  • OnCreateTables() : CBankDlg
  • OnCRMAbort() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMAnalyze() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMBegin() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMCheckpoint() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMCommit() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMDeliver() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMDone() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMForce() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMForget() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMIndoubt() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMPrepare() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMRecoveryDone() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMRecoveryStart() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMRelease() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMWrite() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCtlColor() : CDlgDest , CDlgSrc
  • OnCutOrMove() : CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • OnDataAvailable() : CUrlmonCallback , CDownloadBindStatusCallback
  • OnDataLinks() : CMainWindow
  • OnDblClickListView() : CDlgIDirectorySearch
  • OnDblClk() : CListBoxLite
  • OnDblclk() : CWndLite , CObjTree
  • OnDblclkAnimations() : CCapMFCDlg
  • OnDblClkAttrValue() : CDlgIADs
  • OnDblClkChildrenList() : CDlgIADsContainer
  • OnDblClkInterfaces() : CADQIDlg
  • OnDblclkPartylist() : CRTCOutgoingDlg
  • OnDblclkQuerySession() : CQueryDlg
  • OnDeactivate() : CShellView
  • OnDebugApplication() : CComSpy
  • OnDefOperation() : CBase , CBinder , CServiceComp , CDataLinks , CEnumerator , CStream
  • OnDelete() : CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CDelegationBase , CRocket , CAttributeValueDeleteButton , CDlgIADsContainer , CDlgIDirectoryObject , CDelegationBase , CRocket , CDelegationBase , CRocket , CBaseNode , CDeviceNode
  • OnDeleteScopeItem() : CDelegationBase , CSpaceStation
  • OnDeleteValue() : CMultiValuedAttributeEditor
  • OnDelParameter() : CExecuteParamDlg
  • OnDelSet() : CExecuteParamDlg
  • OnDestroy() : CComSpy , CBankDlg , CWndLite , CFrameWndLite , CMDIFrameLite , CMainWindow , CMDIChild , CMDIObjects , CMDITrace , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI , CRTCAVSession , CRTCIMSession , CRTCSession , CRTCWin , CBaseDialog , CAdvRecoApp , CMultiRecoApp , CSimpleDialog , CBrowserHost , MainDlg , CBasePropertyPage , CShellView
  • OnDestroyDlg() : CSelectEventsDlg
  • OnDevpropClick() : CGenericUCPDlg
  • OnDisableCommit() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnDisconnect() : CMainWindow , CRTCIncomingDlg , CRTCOutgoingDlg
  • OnDisconnectSession() : CSessionDlg
  • OnDiscoveryClicked() : CGenericUCPDlg
  • OnDiskdetails() : CAdvClientDlg
  • OnDiskinfo() : CWbemClientDlg
  • OnDiskPropsDescriptions() : CAdvClientDlg
  • OnDNSNameChange() : CSCPPageGeneral
  • OnDNSNameTypeChange() : CSCPPageGeneral
  • OnDocumentComplete() : CWebBrowser
  • OnDocWindowActivate() : COleInPlaceActiveObject
  • OnDownloadBegin() : CWebBrowser
  • OnDownloadComplete() : CWebBrowser
  • OnDownloadContentFinished() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnDownloadContentProgress() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnDownloadControl() : CWebBrowser
  • OnDraw() : CPrintSDIView , CTestView , CAnnotator , CAPIView
  • OnDrawAdvanced() : CComSpy
  • OnDropDown() : CFullConnectProvider , CComboBoxLite
  • OnDropdownServerList2() : CServerDlg
  • OnDropFiles() : CWndLite , CMainWindow , MainDlg , CCapMFCDlg
  • OnEasterEgg() : CAboutDlg
  • OnEdit() : CAttributeValueEditButton
  • OnEditChange() : CMultiValuedAttributeEditor
  • OnEditupdateFormatnameCombo2() : COpenQueueDialog
  • OnEditupdatePathnameCombo() : COpenQueueDialog
  • OnEditValidbits() : CDlgDest
  • OnEmployeeIDChange() : CProppageUserUI
  • OnEnableCommit() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnEnabled() : CDlgIDirectorySearch
  • OnEndCleanupContext() : CMarkTextService
  • OnEndComposition() : CTSFEditWnd
  • OnEndEdit() : CCaseTextService , CMarkTextService
  • OnEndLabelEdit() : CTreeViewLite
  • OnEndPrinting() : CPrintSDIView
  • OnEnumdisks() : CAdvClientDlg , CWbemClientDlg
  • OnEnumservices() : CAdvClientDlg
  • OnEnumservicesasync() : CAdvClientDlg
  • OnErase() : CSpyCon
  • OnError() : CSCPWiz , CWizExtUser
  • OnEvent() : CContextPlugin
  • OnExceptionUser() : CComSpySqlAudit , CExceptionSub , IComSpyAudit
  • OnExecute() : CDlgIDirectorySearch
  • OnExit() : CSpyCon , CADVCGENDlg , CAdvRecoApp , CMultiRecoApp
  • OnExpand() : CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CBackgroundFolder , CDelegationBase , CPeoplePoweredVehicle , CSpaceFolder , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBackgroundFolder , CDelegationBase , CPeoplePoweredVehicle , CSpaceFolder , CStaticNode , CDelegationBase , CComponentData , CBackgroundFolder , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode
  • OnExportClients() : CAppExportDlg
  • OnExportPathSearch() : CAppExportDlg
  • OnExportUsers() : CAppExportDlg
  • OnExportWithoutUsers() : CAppExportDlg
  • OnFieldChange() : CListener
  • OnFileExit() : CCapMFCDlg
  • OnFileFax() : CPrintSDIView
  • OnFileOpen() : CChildView , CMultiRecoApp , CCapMFCDlg
  • OnFileSave() : CChildView , CMultiRecoApp
  • OnFinalRelease() : CCapMFCDlg
  • OnFindByType() : CGenericUCPDlg
  • OnFindbyUDN() : CGenericUCPDlg
  • OnFindConnectionPoint() : CMainWindow
  • OnFrameWindowActivate() : COleInPlaceActiveObject
  • OnFromScannerOrCamera() : CMainWindow
  • OnGesture() : CAdvRecoApp
  • OnGet() : CDlgIADs , CDlgIADsPropertyList , CDlgIDirectoryObject
  • OnGetConnectionInterface() : CMainWindow
  • OnGetContentInformation() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnGetDataSource() : CMainWindow
  • OnGetEx() : CDlgIADs
  • OnGetInfo() : CDlgIADs
  • OnGetInfoex() : CDlgIADs
  • OnGetStatus() : CMainWindow
  • OnGo() : CBankDlg
  • OnGuide() : CAdvRecoApp
  • OnHandleClosing() : ASYNC_REQUESTER
  • OnHeadersAvailable() : ASYNC_REQUESTER
  • OnHeartbeat() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • OnHelpAbout() : CCapMFCDlg
  • OnHScroll() : CWndLite , CRTCAVSession
  • OnIdle() : CClientApp
  • OnIISRequestInfo() : CComSpySqlAudit , CIdentitySub , IComSpyAudit
  • OnInit()
: InkBlog::AddBlog
, InkBlog::_Default
  • OnInitDialog() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg , CAboutDlg , CVCExploreDlg , CComSpyPropPage , CSelectEventsDlg , CClientDlg , CMain , CBankDlg , CTestDlg , CADVCGENDlg , CInterfaceDlg , CEditValueDlg , CPropertiesDlg , CFullConnectProvider , CFullConnectProperties , CFullConnectSecurity , CFullConnectOptions , CMultipleResultsDlg , CConstraintDlg , CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg , CExecuteParamDlg , CDialogLite , CAboutDlg , COptionsDataSource , COptionsCommand , COptionsAccessor , COptionsRowset , COptionsNotify , COptionsError , CDlgDest , CDlgSrc , CContextSamplePropPage , CSCPCMenuDialog , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CSCPPageGeneral , CSCPPageBindingInfo , CSCPPageKeywords , CProppageUserUI , CExtPageUser , CADQIDlg , CDlgIADs , CDlgIADsContainer , CRenameDlg , CDlgIADsLargeInteger , CDlgIADsOpenDSObject , CDlgIADsPropertyList , CDlgIDirectoryObject , CDlgIDirectorySearch , CDlgIADsSecurityDescriptor , CDisdrawDlg , CImp_DrawDlg , CCloseQueueDialog , CDeleteQueueDialog , COpenQueueDialog , CReceiveMessageDialog , CSendMessageDialog , CConnectDlg , CDisdrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CDeviceProp , CGenericUCPDlg , CAddDeviceDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddFolderDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAdvClientDlg , CCmdLineConsumerDlg , CPermEventsDlg , CWbemClientDlg , CSimpleDialog , AboutDlg , MainDlg , CAboutDlg , CCapMFCDlg , CXMLTreeDlg , CBasePropertyPage , CClipBookServerParamsPage , CBasePropertyPage , CFileShareSampleParamsPage , CMessageDlg , CProcessDlg , CQueryDlg , CServerDlg , CSessionDlg , CShutdownDlg , CWaitSystemDlg
  • OnInitDocumentMgr() : CCaseTextService , CMarkTextService
  • OnInitialize() : CMainWindow
  • OnInitialUpdate() : CComboBoxString , CWndLite , CComboBoxEx , CWebBrowser , CMainWindow , CMDIChild , CMDIObjects , CMDITrace
  • OnInitMenu() : CSpyCon , CComSpy , CBankDlg
  • OnInitMenuPopup() : CWndLite , CMainWindow , MainDlg , CCapMFCDlg
  • OnInitPropPage() : CVirtualFile , CExtendPropertySheet
  • OnInPlaceActivate() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • OnInPlaceDeactivate() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • OnInputScope() : CAdvRecoApp
  • OnInputScopeCoerce() : CAdvRecoApp
  • OnInstallDirSearch() : CAppInstallDlg
  • OnInstallWithoutUsers() : CAppInstallDlg
  • OnInstallWithUsers() : CAppInstallDlg
  • OnInvokeAction() : CGenericUCPDlg
  • OnIoCompletion() : CSampleDataContainer
  • OnItemActivate() : CListViewLite , CDataGrid
  • OnItemChanged() : CListViewLite
  • OnItemConfigDlgApply() : CSettings
  • OnItemConfigDlgCommand() : CSettings
  • OnItemConfigDlgDestroy() : CSettings
  • OnItemConfigDlgInit() : CSettings
  • OnItemConfigDlgNotify() : CSettings
  • OnJNEC() : CUtilitiesDlg
  • OnKeyDown() : CInitStringBox , CDSLContextBox , CWndLite , CQueryBox , CDataGrid , CObjTree , CDrawArea , CCaseTextService , CMarkTextService
  • OnKeydown() : CBrowserHost
  • OnKeyUp() : CCaseTextService , CMarkTextService
  • OnKillActive() : CFullConnectProvider , CFullConnectProperties , CFullConnectSecurity , CFullConnectOptions , CPropPageLite , CSCPPageGeneral , CSCPPageBindingInfo , CSCPPageKeywords , CExtPageUser
  • OnKillFocus() : CCommBand , CDeskBand , CExplorerBar , CToolBand , CShellView
  • OnKillThreadFocus() : CCaseTextService
  • OnKillThreads() : CBankDlg
  • OnLButtonDblClk() : CDrawArea
  • OnLButtonDown() : CWndLite , CDlgDest , CDlgSrc , CDrawArea
  • OnLButtonUp() : CWndLite , CTreeViewLite , CDlgDest , CDlgSrc
  • OnLink() : CRichEditLite
  • OnListDblClick() : CapJ
  • OnListpad() : CDelegationBase , CBicycleFolder , CIceSkateFolder
  • OnLoad() : CXMLTreeDlg
  • OnLoadRecentConfig() : CMainWindow
  • OnLoadRecentFile() : CMainWindow
  • OnLoadStringFromStorage() : CMainWindow
  • OnLocalComputer() : CConnectDlg
  • OnLogFileChange() : CComSpyPropPage
  • OnLoggedOff() : CRTCWin
  • OnLoggedOn() : CRTCWin
  • OnLoggingOff() : CRTCWin
  • OnLoggingOn() : CRTCWin
  • OnLogoffSession() : CSessionDlg
  • OnLogToFile() : CSpyCon , CComSpy
  • OnLowResource() : CUrlmonCallback , CListener , CDownloadBindStatusCallback , CAsynchNotify
  • OnLVColumnClick() : CAdvRecoApp
  • OnLVItemChanging() : CAdvRecoApp
  • OnMakeoffice() : CWbemClientDlg
  • OnMDIActivate() : CMDIChildLite , CMDIChild , CMDIObjects , CMDITrace
  • OnMenuButtonCommand() : CDelegationBase , CRocket
  • OnMenuCommand() : CDelegationBase , CLandBasedVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CDelegationBase , CSpaceVehicle , CDelegationBase , CPlane , CSkyVehicle
  • OnMenuSelect() : CWndLite , CMainWindow , CLangBarItemButton
  • OnMethodCall() : CComSpySqlAudit , CMethodSub , IComSpyAudit
  • OnMethodException() : CComSpySqlAudit , CMethodSub , IComSpyAudit
  • OnMethodReturn() : CComSpySqlAudit , CMethodSub , IComSpyAudit
  • OnMixerMerge() : CChildView
  • OnMixerPlay() : CChildView , CMainFrame
  • OnMixerStop() : CChildView
  • OnMode() : CAdvRecoApp
  • OnMouseMove() : CWndLite , CTreeViewLite , CDlgDest , CDlgSrc , CDrawArea
  • onMouseMove() : InkHitTest::InkHitTest
  • OnMouseOut() : CEventSink
  • OnMouseOver() : CEventSink
  • OnMove() : CWndLite , CDlgIADsContainer , CCapMFCDlg
  • OnMoveAgent() : CCapMFCDlg
  • OnNameChange() : CSCPPageGeneral
  • OnNavigateComplete() : CWebBrowser
  • OnNCButtonDown() : CWndLite , CSplitterLite
  • OnNcDestroy() : CBaseDialog , CSimpleDialog
  • OnNCDestroy() : CSpyCon , CBrowserHost
  • OnNCMouseMove() : CWndLite , CSplitterLite
  • OnNewDocument() : CPrintSDIDoc , CTestDoc
  • OnNewStrokes() : CMultiRecoApp
  • OnNextWindow() : CMainWindow
  • OnNotify() : CPropertiesDlg , CExecuteParamDlg , CWndLite , CFrameWndLite , CMDIFrameLite , CRichEditLite , CListViewLite , CTreeViewLite , CTabLite , CMDIChild , CMDIObjects , CMDITrace , CRTCWin , CShellView
  • OnNotifyBeginUserSession() : CContextPlugin
  • OnNotifyCache() : CContextPlugin
  • OnNotifyClose() : CContextPlugin
  • OnNotifyConnect() : CContextPlugin
  • OnNotifyCreateDistributionDataPath() : CContextPlugin
  • OnNotifyDescribe() : CContextPlugin
  • OnNotifyDestroyDistributionDataPath() : CContextPlugin
  • OnNotifyDisconnect() : CContextPlugin
  • OnNotifyEndUserSession() : CContextPlugin
  • OnNotifyGetParameter() : CContextPlugin
  • OnNotifyLimitChange() : CContextPlugin
  • OnNotifyLimitHit() : CContextPlugin
  • OnNotifyLog() : CContextPlugin
  • OnNotifyOpen() : CContextPlugin
  • OnNotifyPause() : CContextPlugin
  • OnNotifyPlay() : CContextPlugin
  • OnNotifyPlaylist() : CContextPlugin
  • OnNotifyPlugin() : CContextPlugin
  • OnNotifyPublishingPoint() : CContextPlugin
  • OnNotifyRemoteCacheClose() : CContextPlugin
  • OnNotifyRemoteCacheLog() : CContextPlugin
  • OnNotifyRemoteCacheOpen() : CContextPlugin
  • OnNotifySelectStreams() : CContextPlugin
  • OnNotifyServer() : CContextPlugin
  • OnNotifySetParameter() : CContextPlugin
  • OnNotifyStop() : CContextPlugin
  • OnNotifyValidatePushDistribution() : CContextPlugin
  • OnObjectActivate() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnObjectAvailable() : CUrlmonCallback , CDownloadBindStatusCallback
  • OnObjectConstruct() : CComSpySqlAudit , CObjConstSub , IComSpyAudit
  • OnObjectCreate() : CComSpySqlAudit , CInstanceSub , IComSpyAudit
  • OnObjectDeactivate() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnObjectDestroy() : CComSpySqlAudit , CInstanceSub , IComSpyAudit
  • OnObjectsWindow() : CMainWindow
  • OnObjPoolCreateDecision() : CComSpySqlAudit , CObjPool2Sub , IComSpyAudit
  • OnObjPoolCreateObject() : CComSpySqlAudit , CObjPool2Sub , IComSpyAudit
  • OnObjPoolCreatePool() : CComSpySqlAudit , CObjPool2Sub , IComSpyAudit
  • OnObjPoolDestroyObject() : CComSpySqlAudit , CObjPool2Sub , IComSpyAudit
  • OnObjPoolGetFromTx() : CComSpySqlAudit , CObjPoolSub , IComSpyAudit
  • OnObjPoolGetObject() : CComSpySqlAudit , CObjPoolSub , IComSpyAudit
  • OnObjPoolPutObject() : CComSpySqlAudit , CObjPoolSub , IComSpyAudit
  • OnObjPoolRecycleToTx() : CComSpySqlAudit , CObjPoolSub , IComSpyAudit
  • OnObjPoolTimeout() : IComSpyAudit , CComSpySqlAudit , CObjPool2Sub
  • OnOK() : CAddVFileDlg , CWaitSystemDlg , CBaseDialog , CConstraintDlg , CAddDeviceDlg , CBaseDialog , CDeleteObjectDlg , CDlgSrc , CExecuteParamDlg , CUtilitiesDlg , CAppUtilDlg
  • OnOk() : CDeviceProp
  • OnOK() : CAppExportDlg , CAppInstallDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CSelectEventsDlg , CClientDlg , CBankDlg , CInterfaceDlg , CEditValueDlg , CPropertiesDlg , CMultipleResultsDlg , CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg , CDialogLite , CPropPageLite , CDlgDest , CADQIDlg , CGetInfoExDlg , CDlgIADsContainer , CRenameDlg , CMoveDlg , CDlgIADsLargeInteger , CDlgIADsOpenDSObject , CDlgIDirectorySearch , CSendMessageDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddFolderDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CSimpleDialog , CXMLTreeDlg , CServerDlg
  • OnOpen() : CXMLTreeDlg
  • OnOptions() : CMainWindow
  • OnOverwriteFiles() : CAppExportDlg , CAppInstallDlg
  • OnPaint() : CInkInputWnd , CExplorerBar , CXMLTreeDlg , CDrawArea , CADVCGENDlg , CVCExploreDlg , COleDocumentView , CClientDlg , CChildView , CBitmapWnd , CADQIDlg , CDisdrawDlg , CDrawArea , CImp_DrawDlg , CDisdrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CGenericUCPDlg , CCmdLineConsumerDlg , CPermEventsDlg , CWbemClientDlg , CRecoOutputWnd , CInkInputWnd , CCapMFCDlg , CAPIView , CCommBand , CDeskBand , CToolBand
  • OnParentPath() : CDlgIADs
  • OnPaste() : CStaticNode , CDelegationBase , CSpaceStation , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile
  • OnPcpcradio() : CRTCOutgoingDlg
  • OnPcphradio() : CRTCOutgoingDlg
  • OnPermRegister() : CAdvClientDlg
  • OnPermUnregister() : CAdvClientDlg
  • OnPhphradio() : CRTCOutgoingDlg
  • OnPlay() : CDlgSrc , CDlgDest , CCapMFCDlg
  • OnPopContext() : CCaseTextService , CMarkTextService
  • OnPosRectChange() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • OnPreparePrinting() : CPrintSDIView
  • OnPreservedKey() : CMarkTextService , CCaseTextService
  • OnProcess() : CAPIDoc
  • OnProgID() : CCompImportDlg
  • OnProgress() : CListener , CDownloadBindStatusCallback , CAsynchNotify , CUrlmonCallback
  • OnPromptDataSource() : CMainWindow
  • OnPromptFileName() : CMainWindow
  • OnPropertyChange() : CSCPUIGeneral , CSCPUIBindingInfo , CDelegationBase , CRocket , CDelegationBase , CBicycle , CRocket , CSCPUIKeywords , MainDlg , CRocket
  • OnPropOptionsChange() : CPropertiesDlg
  • OnPropSetChange() : CPropertiesDlg
  • OnPropTypeChange() : CPropertiesDlg
  • OnPropValueChange() : CPropertiesDlg
  • OnProxyStubDll() : CCompInstallDlg
  • OnPurge() : CDlgIADsPropertyList
  • OnPushContext() : CCaseTextService , CMarkTextService
  • OnPut() : CDlgIADs
  • OnPutEx() : CDlgIADs
  • OnQCMoveToDeadQueue() : CComSpySqlAudit , IComSpyAudit , CQCSub
  • OnQCMoveToReTryQueue() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQCPlayback() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQCQueueOpen() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQCReceive() : CComSpySqlAudit , IComSpyAudit , CQCSub
  • OnQCReceiveFail() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQCRecord() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQuery() : CQueryDlg
  • OnQueryDragIcon() : CVCExploreDlg , CClientDlg , CADVCGENDlg , CADQIDlg , CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg , CRTCOutgoingDlg , CGenericUCPDlg , CCmdLineConsumerDlg , CWbemClientDlg , CCapMFCDlg , CXMLTreeDlg , CRTCIncomingDlg , CPermEventsDlg
  • OnQueryInterface() : CMainWindow
  • OnQueryPaste() : CDelegationBase , CSpaceStation , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • OnQuerySession() : CSessionDlg
  • OnQueryVariable() : CGenericUCPDlg
  • OnRadioPrivatequeue() : CDisdrawDlg
  • OnRadioPublicqueue() : CDisdrawDlg
  • OnRandom() : CBankDlg
  • OnRButtonDown() : CComSpy , CWndLite , CQueryBox , CObjTree , CIntTrace , CDataGrid
  • OnRButtonUp() : CWndLite , CDrawArea
  • OnReadComplete() : ASYNC_REQUESTER
  • OnRecentFile() : CCapMFCDlg , CapJ , MainDlg
  • OnRecognition() : CMultiRecoApp
  • OnRecognitionWithAlternates() : IInkRecognitionEventsImpl< T > , CAdvRecoApp
  • OnRecognize() : CAdvRecoApp
  • OnRecognizer() : CAdvRecoApp
  • OnRefresh() : CDelegationBase , CRocket , CBackgroundFolder , CDelegationBase , CRocket , CBackgroundFolder , CDelegationBase , CBackgroundFolder , CDelegationBase , CProcessDlg , CRocket , CSessionDlg , CUtilitiesDlg
  • OnRegPerm() : CAdvClientDlg
  • OnRegTemp() : CAdvClientDlg
  • OnRelease() : CMainWindow
  • OnReleaseAll() : CMainWindow
  • OnRemix() : CDlgDest
  • OnRemoteComputer() : CConnectDlg
  • OnRemoteServerInstall() : CAppInstallDlg
  • OnRemove() : CBankDlg
  • OnRemoveChildren() : CBaseNode , CDeviceNode , CFolderNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CStaticNode , CVirtualFile , CStaticNode , CFolderNode , CStaticNode
  • OnRemoveparty() : CRTCOutgoingDlg
  • OnRename() : CDlgIADsContainer , CDelegationBase , CRocket , CDelegationBase , CRocket , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile , CBaseNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CDelegationBase , CRocket , CDelegationBase , CRocket , CDelegationBase , CRocket , CDelegationBase , CRocket , CVirtualFile , CRocket , CDelegationBase , CDeviceNode , CFolderNode
  • OnRequesterClosed() : SIMPLE_BROWSER
  • OnRequestError() : ASYNC_REQUESTER
  • OnRequesterStopped() : SIMPLE_BROWSER
  • OnReset() : CPropPageLite
  • OnResize() : InkBlog::InkArea , CGrid , CBehavior
  • OnResourceAllocate() : CResourceSub , IComSpyAudit , CComSpySqlAudit
  • OnResourceCreate() : CComSpySqlAudit , IComSpyAudit , CResourceSub
  • OnResourceDestroy() : CComSpySqlAudit , CResourceSub , IComSpyAudit
  • OnResourceRecycle() : CComSpySqlAudit , CResourceSub , IComSpyAudit
  • OnResourceTrack() : CResourceSub , IComSpyAudit , CComSpySqlAudit
  • OnResponse() : CUrlmonCallback
  • OnRetryOnErrors() : CBankDlg
  • OnRootBinder() : CMainWindow
  • OnRootEnumerator() : CMainWindow
  • OnRouter() : CUtilitiesDlg
  • OnRowChange() : CListener
  • OnRowPositionChange() : CListener
  • OnRowsetChange() : CListener
  • OnRTCBuddyEvent() : CRTCWin
  • OnRTCClientEvent() : CRTCWin
  • OnRTCEvent() : CRTCWin
  • OnRTCIntensityEvent() : CRTCWin
  • OnRTCMediaEvent() : CRTCWin
  • OnRTCMessagingEvent() : CRTCWin
  • OnRTCParticipantStateChangeEvent() : CRTCWin
  • OnRTCRegistrationStateChangeEvent() : CRTCWin
  • OnRTCSessionStateChangeEvent() : CRTCWin
  • OnRTCWatcherEvent() : CRTCWin
  • OnRunSuite() : CBankDlg
  • OnRunTest() : CAPIDoc
  • OnSave() : CSpyCon , CBankDlg , CComSpy
  • OnSaveNow() : CSpyCon
  • OnSchemaPath() : CDlgIADs
  • OnSelChange() : CPropertiesDlg , CFullConnectProvider , CAlterColumnDlg , CComboBoxLite , CMultiValuedListBox , CTabLite
  • OnSelChangeAceList() : CDlgIADsSecurityDescriptor
  • OnSelChangeAttrList() : CDlgIADs
  • OnSelChanged() : CTreeViewLite
  • OnSelchangeFormatnameCombo2() : COpenQueueDialog
  • OnSelChangeObjects() : CVCExploreDlg
  • OnSelChangeParentCollections() : CVCExploreDlg
  • OnSelchangePartylist() : CRTCOutgoingDlg
  • OnSelchangePathnameCombo() : COpenQueueDialog
  • OnSelChangeProperties() : CVCExploreDlg
  • OnSelChangeRelatedCollections() : CVCExploreDlg
  • OnSelchangeTargetCombo() : CSendMessageDialog
  • OnSelChanging() : CTabLite
  • OnSelect() : CSpaceStation , CBaseNode , CStaticNode , CDelegationBase , CDeviceNode , CFolderNode , CRocket , CIceSkateFolder , CDelegationBase , CStaticNode , CFolderNode , CDeviceNode , CStaticNode , CVirtualFile , CBaseNode , CRocket , CStaticNode , CDelegationBase , CBackgroundFolder , CDelegationBase , CStaticNode , CBaseNode , CDeviceNode , CDelegationBase , CStaticNode , CBaseNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CDeviceNode , CBackgroundFolder , CDelegationBase , CRocket , CBackgroundFolder , CRocket , CIceSkate , CVirtualFile , CRocket , CDelegationBase , CBicycle , CBaseNode , CVirtualFile , CBaseNode , CVirtualFile , CRocket , CSpaceStation , CDelegationBase , CRocket , CDelegationBase , CRocket
  • OnSelectAccount() : CBankDlg
  • OnSelectAllApps() : CSelectEventsDlg
  • OnSelectApplications() : CComSpy
  • OnSelectChattyDisplay() : CBankDlg
  • OnSelectCoInit() : CBankDlg
  • OnSelectColumn() : CComSpyPropPage
  • OnSelectCreatePerIteration() : CBankDlg
  • OnSelectFilter() : CSpyCon
  • OnSelectLanguage() : CBankDlg
  • OnSelectMoveMoney() : CBankDlg
  • OnSelEndOkComboDevice() : CGenericUCPDlg
  • OnSelEndOkComboService() : CGenericUCPDlg
  • OnSendMessage() : CAPIDoc , CMessageDlg
  • OnSendRequestComplete() : ASYNC_REQUESTER
  • OnServiceClassChange() : CSCPPageGeneral
  • OnServiceComponents() : CMainWindow
  • OnSession() : CAPIDoc
  • OnSet() : CDlgIADsContainer
  • OnSetAbort() : CComSpySqlAudit , IComSpyAudit , CObjSub
  • OnSetActive() : CFullConnectOptions , CBasePropertyPage , CFileShareSampleParamsPage , CFullConnectProvider , CFullConnectSecurity , CSCPPageBindingInfo , CSCPPageKeywords , CExtPageUser , CClipBookServerParamsPage , CFullConnectProperties , CPropPageLite , CSCPPageGeneral , CBasePropertyPage
  • OnSetComplete() : CComSpySqlAudit , IComSpyAudit , CObjSub
  • OnSetCursor() : CDrawArea , CWndLite , CDrawArea
  • OnSetFocus() : CAPIView , CCaseTextService , CDeskBand , CDrawArea , CMDIObjects , CMDITrace , CMainFrame , CDrawArea , CCommBand , CExplorerBar , CShellView , CMarkTextService , CWndLite , CMDIChild , CAdvRecoApp , CDrawArea , CToolBand , CCaseTextService , CMarkTextService
  • OnSetFocusAnimations() : CCapMFCDlg
  • OnSetfocusEditValidbits() : CChildView
  • OnSetFocusMoveX() : CCapMFCDlg
  • OnSetFocusMoveY() : CCapMFCDlg
  • OnSetFocusSpeakText() : CCapMFCDlg
  • OnSetInfo() : CDlgIADs
  • OnSetMenuButton() : CDelegationBase , CRocket
  • OnSetProperty() : CVCExploreDlg
  • OnSetsession() : CSessionDlg
  • OnSetThreadFocus() : CCaseTextService
  • OnSettingChange() : CShellView
  • OnSetToolbar() : CDelegationBase , CRocket , CDelegationBase
  • OnSfx() : CCapMFCDlg
  • OnShow() : CVirtualFile , CSpaceVehicle , CIceSkateFolder , CSkateboardFolder , CBicycleFolder , CDelegationBase , CSpaceVehicle , CBicycleFolder , CDeviceNode , CBaseNode , CSkateboardFolder , CIceSkateFolder , CSkateboardFolder , CDeviceNode , CSpaceVehicle , CSkateboardFolder , CVirtualFile , CIceSkateFolder , CSkateboardFolder , CStaticNode , CFolderNode , CIceSkateFolder , CSpaceVehicle , CSkyBasedVehicle , CFolderNode , CDelegationBase , CStaticNode , CBicycleFolder , CStaticNode , CDelegationBase , CSkateboardFolder , CBicycleFolder , CDeviceNode , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CDelegationBase , CStaticNode , CSkateboardFolder , CDelegationBase , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CSpaceVehicle , CSpaceStation , CSkyBasedVehicle , CBaseNode , CDelegationBase , CDeviceNode , CSkateboardFolder , CBicycleFolder , CIceSkateFolder , CDelegationBase , CIceSkateFolder , CSkyBasedVehicle , CSpaceStation , CDelegationBase , CSkateboardFolder , CBicycleFolder , CIceSkateFolder , CBaseNode , CSpaceVehicle , CFolderNode , CStaticNode , CFolderNode , CDeviceNode , CStaticNode , CBaseNode , CSpaceVehicle , CVirtualFile , CStaticNode , CBaseNode , CFolderNode , CVirtualFile , CIceSkateFolder , CSkyVehicle , CDelegationBase , CIceSkateFolder , CBicycleFolder , CDelegationBase , CBicycleFolder , CSkateboardFolder , CSpaceVehicle , CBicycleFolder , CIceSkateFolder , CDelegationBase , CSpaceVehicle , CBicycleFolder
  • OnShowContextHelp() : CDelegationBase , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase
  • OnShowError() : CBankDlg
  • OnShowResults() : CBankDlg
  • OnShowWindow() : CBrowserHost , CSpyCon , COleClient , CBrowserHost , CImpIOleClientSite
  • OnShutdown() : CShutdownDlg
  • OnShutdownSystem() : CAPIDoc
  • OnSize() : CMDITrace , CMainWindow , CMDIChild , CSpyCon , CBankDlg , CBrowserHost , CMultiRecoApp , CWndLite , CMain , CDataGrid , CMDIObjects , CRTCAVSession , CAdvRecoApp , CBrowserHost , CShellView , CDeskBand , CToolBand , CRTCWin , CBrowserHost , CRTCIMSession , CRTCSession
  • OnSizing() : CMDIChild , CWndLite
  • OnSpeak() : CCapMFCDlg , MainDlg
  • OnStart() : CUtilitiesDlg , CClientDlg
  • OnStartBinding() : CDownloadBindStatusCallback , CUrlmonCallback
  • OnStartCleanupContext() : CMarkTextService
  • OnStartComposition() : CTSFEditWnd
  • OnStatusChange() : CExecuteParamDlg
  • OnStop() : CBankDlg , CListener , CUtilitiesDlg , CDlgSrc , CAsynchNotify , CDlgDest , CCapMFCDlg
  • OnStopBinding() : CDownloadBindStatusCallback , CUrlmonCallback
  • OnStopOnODBCErrors() : CBankDlg
  • OnStroke() : CMultiRecoApp , CAdvRecoApp
  • OnSupportErrorInfo() : CMainWindow
  • OnSysCommand() : CRTCOutgoingDlg , CVCExploreDlg , CSpyCon , CWndLite , CAdvClientDlg , CPermEventsDlg , MainDlg , CGenericUCPDlg , CCapMFCDlg , CXMLTreeDlg , CWbemClientDlg , CCmdLineConsumerDlg , CRTCIncomingDlg , CADVCGENDlg
  • OnSysKeyDown() : CWndLite
  • OnTBtnAbout() : CVCExploreDlg
  • OnTBtnConnect() : CVCExploreDlg
  • OnTBtnDelete() : CVCExploreDlg
  • OnTBtnExportApp() : CVCExploreDlg
  • OnTBtnImportComponent() : CVCExploreDlg
  • OnTBtnInstallApp() : CVCExploreDlg
  • OnTBtnInstallComponent() : CVCExploreDlg
  • OnTBtnNew() : CVCExploreDlg
  • OnTBtnRefresh() : CVCExploreDlg
  • OnTBtnSave() : CVCExploreDlg
  • OnTBtnStartApp() : CVCExploreDlg
  • OnTBtnStopApp() : CVCExploreDlg
  • OnTBtnUtility() : CVCExploreDlg
  • OnTempRegister() : CAdvClientDlg
  • OnTempUnregister() : CAdvClientDlg
  • OnTerminateProcess() : CProcessDlg
  • OnTestKeyDown() : CCaseTextService , CMarkTextService
  • OnTestKeyUp() : CMarkTextService , CCaseTextService
  • OnTextUpdated() : CCustomPropertyStore
  • OnThreadAssignApartment() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadBindToApartment() : IComSpyAudit , CThreadSub , CComSpySqlAudit
  • OnThreadStart() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadTerminate() : CComSpySqlAudit , CThreadSub , IComSpyAudit
  • OnThreadUnassignApartment() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadUnBind() : IComSpyAudit , CComSpySqlAudit , CThreadSub
  • OnThreadWorkEnque() : IComSpyAudit , CComSpySqlAudit , CThreadSub
  • OnThreadWorkPrivate() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadWorkPublic() : IComSpyAudit , CComSpySqlAudit , CThreadSub
  • OnThreadWorkRedirect() : CComSpySqlAudit , CThreadSub , IComSpyAudit
  • OnThreadWorkReject() : IComSpyAudit , CThreadSub , CComSpySqlAudit
  • OnTile() : CMainWindow
  • OnTimer() : CWndLite , CMain , CTestDlg
  • OnToggleAudit() : CComSpy
  • OnToggleGridLines() : CSpyCon , CComSpy
  • OnToggleSaveOnExit() : CSpyCon
  • OnToggleShowOnScreen() : CSpyCon , CComSpy
  • OnToolbarCommand() : CRocket , CDelegationBase , CRocket , CDelegationBase
  • OnToolTip() : CFrameWndLite
  • OnTraceWindow() : CMainWindow
  • OnTransactionAbort() : CTxSub
  • OnTransactionAborted() : CComSpySqlAudit , IComSpyAudit
  • OnTransactionCommit() : IComSpyAudit , CComSpySqlAudit , CTxSub
  • OnTransactionPrepare() : CTxSub
  • OnTransactionPrepared() : CComSpySqlAudit , IComSpyAudit
  • OnTransactionStart() : CTxSub , CComSpySqlAudit , IComSpyAudit
  • OnTune() : CRTCOutgoingDlg
  • OnTypeLibrary() : CCompInstallDlg
  • OnUIActivate() : CSpyCon , COleClient , CBrowserHost , CImpIOleInPlaceSite , CBrowserHost
  • OnUIDeactivate() : CBrowserHost , COleClient , CBrowserHost , CImpIOleInPlaceSite , CSpyCon , CBrowserHost
  • OnUnadvise() : CMainWindow
  • OnUninitDocumentMgr() : CCaseTextService , CMarkTextService
  • OnUninitialize() : CMainWindow
  • OnUpdate() : CInterfaceDlg
  • OnUpdateCommand() : CWndLite , CMDITrace , CMainWindow , CIntTrace , CObjTree , CMDIChild , CMDIObjects , CMDIFrameLite
  • OnUpdateComposition() : CTSFEditWnd
  • OnUpdateFileSave() : CChildView
  • OnUpdateFrameTitle() : CMainFrame
  • OnUpdateItem() : CDelegationBase , CRocket , CDelegationBase , CRocket , CDelegationBase , CSpaceStation , CRocket , CSpaceStation
  • OnUpdateMixerMerge() : CChildView
  • OnUpdateMixerPlay() : CMainFrame , CChildView
  • OnUpdateMixerStop() : CChildView
  • OnUpdateOutputSelected() : CIntTrace
  • OnUsePing() : CClientDlg
  • OnUserconfig() : CAPIDoc
  • OnUserEvent() : CUserSub
  • OnValueSelChange() : CMultiValuedAttributeEditor
  • OnView() : CDlgIADsContainer
  • OnViewChange() : CStaticNode , CFolderNode , CBaseNode , CDeviceNode , CBaseNode , CFolderNode , CBaseNode , CFolderNode , CDeviceNode , CFolderNode , CVirtualFile
  • OnViewDetails() : CShellView
  • OnViewLarge() : CShellView
  • OnViewList() : CShellView
  • OnViewNext() : CBankDlg
  • OnViewPrev() : CBankDlg
  • OnViewSmall() : CShellView
  • OnVirtualChannel() : CSessionDlg
  • OnVScroll() : CDataGrid , CWndLite
  • OnWaitEvent() : CAPIDoc
  • OnWidthChange() : CComSpyPropPage
  • OnWizardBack() : CBasePropertyPage
  • OnWizardFinish() : CBasePropertyPage
  • OnWizardNext() : CBasePropertyPage
  • OnXecute() : CADVCGENDlg
  • oOverlapped : _PACKET
  • OP_QUERY_CACHE : CProxyPlugin::COpState
  • OP_QUERY_CACHE_MISS_POLICY : CProxyPlugin::COpState
  • Opcode : _BLRPLATE
  • Open() : msado15::Recordset21 , msado15::Record , msado15::Stream , msado15::_Recordset , ASYNC_REQUESTER , msado15::Recordset20 , msado15::Recordset , msado15::Connection15 , COleDocumentView , msado15::Connection , CFileLite , CRow , msado15::Recordset15 , CDBFile , CFileLite , msado15::_Record , msado15::_Stream , CImpIRow , SIMPLE_BROWSER , msado15::_Connection , CMmStream
  • OPEN_BUFSIZE : FileRepServer
  • OpenCommentEditBox() : CAnnotator
  • OpenConnection() : CHandler , MSDFHDL::IDataFactoryHandler
  • OpenDataContainer() : CSDKSampleStorageSystem
  • OpenDialog() : CFrame
  • OpenDirectory() : CSDKSampleStorageSystem
  • OPENED : ASYNC_REQUESTER
  • OpenFile() : CDataSource , CFileStream
  • OpenFileHandler() : Sample::UI::MainWindow
  • openFileMenu : Sample::UI::MainWindow
  • openMenu : CapJ
  • OpenMenu : Serialization::SerializationForm
  • openMenu_click() : CapJ
  • OpenMenu_Click() : Serialization::SerializationForm
  • OpenNamespace() : CProvider_IWbemServices , CClassPro , CMethodPro , CInstPro
  • OpenPrivateReceiveQueue() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • OpenReceiveQueue() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • OpenRorW() : CMmStream
  • OpenRowset() : CMSOmniProvSession , CRow , CSession , CImpIOpenRowset
  • OpenRowsetProc() : CMDIChild
  • OpenSchema()
: msado15::_Connection
, msado15::Connection15
, msado15::Connection
  • openStore() : Sample::Sample
  • OpenStreams() : CPersistStorage
  • OpenTempFile() : CPack
  • Operate() : HelloWorld
  • operation : GlobalVars
  • Operation : _WSAOVERLAPPEDPLUS
  • operator BOOL() : CVARIANT
  • operator BSTR() : CBSTR , BSTRING , CUtilBSTR , BSTRING , CBSTR , BSTRING
  • operator BYTE() : CVARIANT
  • operator CHAR *() : CUtilString
  • operator const CLUSPROP_BUFFER_HELPER() : CClusPropValueList
  • operator const T *() : CSmartComPtr< T > , SmartRefPointer< T >
  • operator CSZ() : CStringException
  • operator delete() : CStdDbOutput , CDbAlloc , CCallAs , CFullPropSpec , CAddrNode
  • operator double() : CVARIANT
  • operator HDC() : CCanvas
  • operator HFONT() : CFont
  • operator HWND() : CWindow
  • operator LONG() : CVARIANT
  • operator LPCWSTR() : CQuickStringWrap , CString
  • operator LPTSTR() : BTSTR
  • operator LPWSTR() : CVARIANT
  • operator new() : CStdDbOutput , CDbAlloc , CCallAs , CFullPropSpec , CAddrNode
  • operator PCLUSPROP_LIST() : CClusPropList
  • operator SAFEARRAY *() : CSAFEARRAY , CVARIANT , CSAFEARRAY , CVARIANT
  • operator short() : CVARIANT
  • operator T *() : CUtilComPtr< T > , CSmartPtr< T >
  • operator T **() : WiaWrap::CComPtrArray< T >
  • operator VARIANT *() : CVARIANT
  • operator void *const() : CISeqStream
  • operator WCHAR *() : CUtilString , CComWSTR
  • operator!() : CComWSTR , CSmartPtr< T > , WiaWrap::CComPtrArray< T > , SMmStream
  • operator!=() : CFullPropSpec , CFastVariant
  • operator&() : CEnumConnectionPoints , WiaWrap::CComPtrArray< T > , CVARIANT , CSmartComPtr< T > , CUtilComPtr< T > , CVARIANT , CEnumConnections , CComWSTR , CSmartPtr< T >
  • operator()() : SIndexedDiskLessThan , LessThan< Item >
  • operator*() : CPoint , SMmStream
  • operator+ : CString , CPoint , CString
  • operator++() : CGridIt
  • operator+=() : CComWSTR , CString , MyString , CUtilString , CString
  • operator-() : CPoint
  • operator->() : CSmartComPtr< T > , SmartRefPointer< T > , CSmartPtr< T > , XInterface< T > , SMmStream , XInterface< T >
  • operator/() : CPoint
  • operator<() : CFastVariant
  • operator<<() : CConsole
  • operator=() : CFastVariant , CString , CExtBuffer , CClusPropValueList , CFastVariant , CStorageResource , CMgdClusCfgInit , CEnumConnections , CClusPropValueList , CString , CFastVariant , CEnumStorageResource , CFastVariant , CEnumConnectionPoints , CFastVariant , WiaWrap::CComPtrArray< T > , CFastVariant , CClusterUtils , CUtilString , CFastVariant , CMgdResType , CFastVariant , CUtilString , CFastVariant , CString , CPartitionInfo , CFullPropSpec , SmartRefPointer< T > , CFastVariant , CMgdClusCfgInit , CWiaDataCallback , CSmartComPtr< T > , CUtilString , CString , CStorageResType , CString
  • operator==() : CFullPropSpec , CSmartPtr< T > , CFastVariant
  • operator>() : CFastVariant
  • operator[]() : XPtr< T > , CString , CStringTable , XPtr< T > , CSimpleArray< T > , CExtBuffer , XPtr< T > , CVector< TYPE, IDX >
  • opt_addr : ipv4_option_hdr
  • opt_code : ipv4_option_hdr
  • opt_len : ipv4_option_hdr
  • opt_ptr : ipv4_option_hdr
  • option : EDITARGS
  • Option : SupportConcurList , SupportOptList
  • Options : _ConnectionVtbl , _RecordsetVtbl , _ConnectionVtbl , _RecordsetVtbl , _CommandVtbl
  • OpTypes : CProxyPlugin::COpState
  • Order() : qcorder::Order
  • OrderFunction : LIST_STRUCT
  • orderID
: qcnotify::Notify
, qcship::Ship
, qcorder::Order
  • OriginUrl : CacheProxySamplePlugin::ContentInfo
  • ostrH221NonStdID : tagAppletObjectKey
  • ostrParamValue : tagAppletRegistryItem , tagAppletRegistryRequest
  • ostrResourceID : tagAppletRegistryKey
  • osVersion : _RSUMINFO , _SUMMARYINFO
  • osvi : TS_VERSION_INFO
  • OutPipe : tSReq , tReq
  • OutPipeSample() : CSimpleClass
  • OutputControls() : CGenerateRC
  • OutputDialog() : CGenerateRC
  • OutputDialogFinalize() : CGenerateRC
  • OutputDialogInit() : CGenerateRC
  • OutputDialogs() : CGenerateRC
  • OutputIndent() : CIntTrace
  • OutputIntoDataGrid() : CADVCGENDlg
  • OutputLineEnd() : CIntTrace
  • OutputPath() : IWMSContextAdmin
  • OutputString() : CGenerateRC
  • OutputStringInit() : CGenerateRC
  • OutputText() : CIntTrace
  • OutputTextFmt() : CIntTrace
  • OutputTime() : CTIMER
  • ov : RECEIVE_CONTEXT , _AIO_WORK_ITEM
  • overLap : WRTHANDLE
  • overlap : _socklist
  • Overlapped : _PER_IO_CONTEXT , _DRVLINE , _COPY_CHUNK
  • OverlappedIO : _SEARCH_REQUEST
  • ovr : _SEND_INFO
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- z -

  • z : POINT3D
  • ZeroBuffer() : ISAPI_BUFFER , ISAPI_STRING
  • zoomFactor : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • zoomRectangle : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • zoomToolBar : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • ZoomToRectangle() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • zoomUpDown : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- ~ -

  • ~AboutDlg() : AboutDlg
  • ~AgentNotifySink() : AgentNotifySink
  • ~ASYNC_REQUESTER() : ASYNC_REQUESTER
  • ~BSTRING() : BSTRING
  • ~BTSTR() : BTSTR
  • ~CAccount() : CAccount
  • ~CAddDeviceDlg() : CAddDeviceDlg
  • ~CAddFolderDlg() : CAddFolderDlg
  • ~CAddVFileDlg() : CAddVFileDlg
  • ~CAdminNotifyHandler() : CAdminNotifyHandler
  • ~CADsSearch() : CADsSearch
  • ~CADVCGENDlg() : CADVCGENDlg
  • ~CAdvClientDlg() : CAdvClientDlg
  • ~CAggregate() : CAggregate
  • ~CAlterColumnDlg() : CAlterColumnDlg
  • ~CAlterIndexDlg() : CAlterIndexDlg
  • ~CAlterTableDlg() : CAlterTableDlg
  • ~CAnchorTag() : CAnchorTag
  • ~CAPIDoc() : CAPIDoc
  • ~CAPIView() : CAPIView
  • ~CAppInfo() : CAppInfo
  • ~CApplet() : CApplet
  • ~CAppletSession() : CAppletSession
  • ~CAppLite() : CAppLite
  • ~CAppShareNotify() : CAppShareNotify
  • ~CAssoc() : CAssoc< KEY, VALUE >
  • ~CAsynchBase() : CAsynchBase
  • ~CAsynchNotify() : CAsynchNotify
  • ~CAsyncQuerySink() : CAsyncQuerySink
  • ~CAsyncTest() : CAsyncTest
  • ~CAsyncXXX() : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • ~CAttributeValueAddButton() : CAttributeValueAddButton
  • ~CAttributeValueDeleteButton() : CAttributeValueDeleteButton
  • ~CAttributeValueEditButton() : CAttributeValueEditButton
  • ~CAttributeValueEditor() : CAttributeValueEditor
  • ~CAuthenticateContext() : CAuthenticateContext
  • ~CAuthenticatePlugin() : CAuthenticatePlugin
  • ~CAVIFileReader() : CAVIFileReader
  • ~CAVIFileWriter() : CAVIFileWriter
  • ~CBackground() : CBackground
  • ~CBackgroundFolder() : CBackgroundFolder
  • ~CBankDlg() : CBankDlg
  • ~CBase() : CBase
  • ~CBaseDialog() : CBaseDialog
  • ~CBaseNode() : CBaseNode
  • ~CBaseObj() : CBaseObj
  • ~CBasePropertyPage() : CBasePropertyPage
  • ~CBicycle() : CBicycle
  • ~CBicycleFolder() : CBicycleFolder
  • ~CBinder() : CBinder
  • ~CBindings() : CBindings
  • ~CBitArray() : CBitArray
  • ~CBlackPen() : CBlackPen
  • ~CBlockFrame() : CBlockFrame
  • ~CBrush() : CBrush
  • ~CBSTR() : CBSTR
  • ~CButtonLite() : CButtonLite
  • ~CCallbackWrapper() : CCallbackWrapper
  • ~CCallNotify() : CCallNotify
  • ~CCaseTextService() : CCaseTextService
  • ~CCertEncodeAltName() : CCertEncodeAltName
  • ~CCertEncodeBitString() : CCertEncodeBitString
  • ~CCertEncodeCRLDistInfo() : CCertEncodeCRLDistInfo
  • ~CCertEncodeDateArray() : CCertEncodeDateArray
  • ~CCertEncodeLongArray() : CCertEncodeLongArray
  • ~CCertEncodeStringArray() : CCertEncodeStringArray
  • ~CCertExitSample() : CCertExitSample
  • ~CCertManageExitModuleSample() : CCertManageExitModuleSample
  • ~CCertManagePolicyModuleSample() : CCertManagePolicyModuleSample
  • ~CCertPolicySample() : CCertPolicySample
  • ~CChannelNotify() : CChannelNotify
  • ~CChildView() : CChildView
  • ~CClassFactory() : CClassFactory
  • ~CClassFactoryWrapper() : CClassFactoryWrapper
  • ~CClassPro() : CClassPro
  • ~CClientApp() : CClientApp
  • ~CClusPropList() : CClusPropList
  • ~CClusPropValueList() : CClusPropValueList
  • ~CClusterUtils() : CClusterUtils
  • ~CCmdLineLite() : CCmdLineLite
  • ~CColumnInfo() : CColumnInfo
  • ~CColumnProvider() : CColumnProvider
  • ~CComboBoxEx() : CComboBoxEx
  • ~CComboBoxGuid() : CComboBoxGuid
  • ~CComboBoxLite() : CComboBoxLite
  • ~CComboBoxString() : CComboBoxString
  • ~CCommand() : CCommand
  • ~CCommBand() : CCommBand
  • ~CCompartmentMonitor() : CCompartmentMonitor
  • ~CComponent() : CComponent
  • ~CComponentData() : CComponentData
  • ~CCompositionEditSession() : CCompositionEditSession
  • ~CComPtrArray() : WiaWrap::CComPtrArray< T >
  • ~CComSpy() : CComSpy
  • ~CComWSTR() : CComWSTR
  • ~CConfNotify() : CConfNotify
  • ~CConnectionPoint() : CConnectionPoint
  • ~CConnectionPointContainer() : CConnectionPointContainer
  • ~CConsole() : CConsole
  • ~CConstraintDlg() : CConstraintDlg
  • ~CConsumer() : CConsumer
  • ~CContainerBase() : CContainerBase
  • ~CContextMenu() : CContextMenu
  • ~CContextMenuExtension() : CContextMenuExtension
  • ~CContextPlugin() : CContextPlugin
  • ~CCriticalSection() : CCriticalSection
  • ~CCrmFilesWorker() : CCrmFilesWorker
  • ~CCustomError() : CCustomError
  • ~CCustomPropertyStore() : CCustomPropertyStore
  • ~CDataAccess() : CDataAccess
  • ~CDataGrid() : CDataGrid
  • ~CDataLinks() : CDataLinks
  • ~CDataNotify() : CDataNotify
  • ~CDataObject() : CDataObject
  • ~CDataset() : CDataset
  • ~CDataSource() : CDataSource
  • ~CDataXferObj() : CDataXferObj
  • ~CDbAlloc() : CDbAlloc
  • ~CDBAuthAdmin() : CDBAuthAdmin
  • ~CDBAuthPlugin() : CDBAuthPlugin
  • ~CDBFile() : CDBFile
  • ~CDBSession() : CDBSession
  • ~CDelegationBase() : CDelegationBase
  • ~CDeskBand() : CDeskBand
  • ~CDeviceFinderCallback() : CDeviceFinderCallback
  • ~CDeviceNode() : CDeviceNode
  • ~CDeviceProp() : CDeviceProp
  • ~CDialogBase() : CDialogBase
  • ~CDialogLite() : CDialogLite
  • ~CDialogStream() : CDialogStream
  • ~CDimmer() : CDimmer
  • ~CDimmerService() : CDimmerService
  • ~CDlgDest() : CDlgDest
  • ~CDlgIADs() : CDlgIADs
  • ~CDlgIADsContainer() : CDlgIADsContainer
  • ~CDlgIADsLargeInteger() : CDlgIADsLargeInteger
  • ~CDlgIADsOpenDSObject() : CDlgIADsOpenDSObject
  • ~CDlgIADsPropertyList() : CDlgIADsPropertyList
  • ~CDlgIADsSecurityDescriptor() : CDlgIADsSecurityDescriptor
  • ~CDlgIDirectoryObject() : CDlgIDirectoryObject
  • ~CDlgIDirectorySearch() : CDlgIDirectorySearch
  • ~CDlgSrc() : CDlgSrc
  • ~CDog() : CDog
  • ~CDownloadBindStatusCallback() : CDownloadBindStatusCallback
  • ~CDownloadUI() : CDownloadUI
  • ~CDragSource() : CDragSource
  • ~CDrawArea() : CDrawArea
  • ~CDropObject() : CDropObject
  • ~CDropSource() : CDropSource
  • ~CDropTarget() : CDropTarget
  • ~CDSLAdvancedPage() : CDSLAdvancedPage
  • ~CDSLConnectionPage() : CDSLConnectionPage
  • ~CDynamic() : CDynamic
  • ~CEditBoxLite() : CEditBoxLite
  • ~CEditSessionBase() : CEditSessionBase
  • ~CEditValueDlg() : CEditValueDlg
  • ~CEmptyVolumeCache() : CEmptyVolumeCache
  • ~CEntity() : CEntity
  • ~CEnumConnectionPoints() : CEnumConnectionPoints
  • ~CEnumConnections() : CEnumConnections
  • ~CEnumDisplayAttributeInfo() : CEnumDisplayAttributeInfo
  • ~CEnumerator() : CEnumerator
  • ~CEnumFormatEtc() : CEnumFormatEtc
  • ~CEnumIDList() : CEnumIDList
  • ~CEnumStorageResource() : CEnumStorageResource
  • ~CEnumTASK() : CEnumTASK
  • ~CEnumXXX() : CEnumXXX< T, ELT_T, IFACE >
  • ~CError() : CError
  • ~CEvent() : CEvent
  • ~CEventSink() : CEventSink
  • ~CExList() : CExList< TYPE >
  • ~CExplorerBar() : CExplorerBar
  • ~CExtBuffer() : CExtBuffer
  • ~CExtendContextMenuEx() : CExtendContextMenuEx
  • ~CExtendPropertySheet() : CExtendPropertySheet
  • ~CExtObject() : CExtObject
  • ~CExtPageUser() : CExtPageUser
  • ~CExtractIcon() : CExtractIcon
  • ~CFactory() : CFactory
  • ~CFastVariant() : CFastVariant
  • ~CFileIdx() : CFileIdx
  • ~CFileIO() : CFileIO
  • ~CFileLite() : CFileLite
  • ~CFileStream() : CFileStream
  • ~CFileTransferNotify() : CFileTransferNotify
  • ~CFileViewer() : CFileViewer
  • ~CFixedAlloc() : CFixedAlloc
  • ~CFolderNode() : CFolderNode
  • ~CFont() : CFont
  • ~CFontRange() : CFontRange
  • ~CFontSelect() : CFontSelect
  • ~CFrame() : CFrame
  • ~CFrameWndLite() : CFrameWndLite
  • ~CFtNotify() : CFtNotify
  • ~CFullConnect() : CFullConnect
  • ~CFullPropSpec() : CFullPropSpec
  • ~CFVClassFactory() : CFVClassFactory
  • ~CGdiplusInit() : CGdiplusInit
  • ~CGenerateRC() : CGenerateRC
  • ~CGenericEnum() : CGenericEnum
  • ~CGenericUCPDlg() : CGenericUCPDlg
  • ~CHello() : CHello
  • ~CHelloClassFactory() : CHelloClassFactory
  • ~CHiPerfProvider() : CHiPerfProvider
  • ~CHourglass() : CHourglass
  • ~CHtmlElemBagEntry() : CHtmlElemBagEntry
  • ~CHtmlElement() : CHtmlElement
  • ~CHtmlElementBag() : CHtmlElementBag
  • ~CHtmlIFilter() : CHtmlIFilter
  • ~CHtmlIFilterBase() : CHtmlIFilterBase
  • ~CHtmlIFilterCF() : CHtmlIFilterCF
  • ~CHtmlScanner() : CHtmlScanner
  • ~CIceSkate() : CIceSkate
  • ~CIceSkateFolder() : CIceSkateFolder
  • ~CImp_DrawDlg() : CImp_DrawDlg
  • ~CImpAuth() : CImpAuth
  • ~CImpIAdviseSink() : CImpIAdviseSink
  • ~CImpIFileViewer() : CImpIFileViewer
  • ~CImpIOleClientSite() : CImpIOleClientSite
  • ~CImpIOleDocumentSite() : CImpIOleDocumentSite
  • ~CImpIOleInPlaceSite() : CImpIOleInPlaceSite
  • ~CImpIPersistFile() : CImpIPersistFile
  • ~CImpISpecifyPropertyPages() : CImpISpecifyPropertyPages
  • ~CImportRes() : CImportRes
  • ~CInstPro() : CInstPro
  • ~CInterfaceDlg() : CInterfaceDlg
  • ~CIntTrace() : CIntTrace
  • ~CIsapiCertPolicyFilter() : CIsapiCertPolicyFilter
  • ~CISeqStream() : CISeqStream
  • ~CKeystrokeEditSession() : CKeystrokeEditSession
  • ~CLandBasedVehicle() : CLandBasedVehicle
  • ~CLangBarItemButton() : CLangBarItemButton
  • ~CLanguageResourceSampleCF() : CLanguageResourceSampleCF
  • ~ClientList() : ClientList
  • ~CLinkable() : CLinkable
  • ~CList() : CList< TYPE, ARG_TYPE >
  • ~CListBoxLite() : CListBoxLite
  • ~CListener() : CListener
  • ~CListHeader() : CListHeader
  • ~CListViewLite() : CListViewLite
  • ~CLListImpl() : CLListImpl< TYPE, ARG_TYPE >
  • ~CLock() : CLock
  • ~CLockHandler() : CLockHandler
  • ~CLogFile() : CLogFile
  • ~CMain() : CMain
  • ~CMainFrame() : CMainFrame
  • ~CMainWindow() : CMainWindow
  • ~CMallocSpy() : CMallocSpy
  • ~CMap() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • ~CMarkTextService() : CMarkTextService
  • ~CMDIChild() : CMDIChild
  • ~CMDIChildLite() : CMDIChildLite
  • ~CMDIFrameLite() : CMDIFrameLite
  • ~CMDIObjects() : CMDIObjects
  • ~CMDITrace() : CMDITrace
  • ~CMember() : CMember
  • ~CMemoryMappedInputStream() : CMemoryMappedInputStream
  • ~CMethodPro() : CMethodPro
  • ~CMgdClusCfgInit() : CMgdClusCfgInit
  • ~CMgdResType() : CMgdResType
  • ~CMgrNotify() : CMgrNotify
  • ~CMMCControl() : CMMCControl
  • ~CMmStream() : CMmStream
  • ~CMmStreamBuf() : CMmStreamBuf
  • ~CModel() : CModel
  • ~CMonitor() : CMonitor
  • ~CMSMQEventHandler() : CMSMQEventHandler
  • ~CMSOmniProvRowset() : CMSOmniProvRowset
  • ~CMultichanApp() : CMultichanApp
  • ~CMultipleResults() : CMultipleResults
  • ~CMultipleResultsDlg() : CMultipleResultsDlg
  • ~CMultiValuedAttributeEditor() : CMultiValuedAttributeEditor
  • ~CMultiValuedListBox() : CMultiValuedListBox
  • ~CMyCapabilities() : CMyCapabilities
  • ~CMyEventProvider() : CMyEventProvider
  • ~CMyEvictListener() : CMyEvictListener
  • ~CMyInkCollector() : CMyInkCollector
  • ~CMyMemberSetChangeListener() : CMyMemberSetChangeListener
  • ~CMySink() : CMySink
  • ~CMyStartupListener() : CMyStartupListener
  • ~CNode() : CNode< TYPE >
  • ~CNotify() : CNotify
  • ~CNullModem() : CNullModem
  • ~CObjData() : CObjData
  • ~CObjSecurity() : CObjSecurity
  • ~CObjTree() : CObjTree
  • ~COBLIST() : COBLIST
  • ~CODBCData() : CODBCData
  • ~COleClient() : COleClient
  • ~COleDocument() : COleDocument
  • ~COleDocumentView() : COleDocumentView
  • ~COleInPlaceActiveObject() : COleInPlaceActiveObject
  • ~COleInPlaceObject() : COleInPlaceObject
  • ~COleObject() : COleObject
  • ~Conf() : Conf
  • ~COpState() : CProxyPlugin::COpState
  • ~CPack() : CPack
  • ~CPage() : CPage
  • ~CPaintCanvas() : CPaintCanvas
  • ~CParameters() : CParameters
  • ~CPartitionInfo() : CPartitionInfo
  • ~CPeoplePoweredVehicle() : CPeoplePoweredVehicle
  • ~CPersistFile() : CPersistFile
  • ~CPersistStorage() : CPersistStorage
  • ~CPerson() : CPerson
  • ~CPidlMgr() : CPidlMgr
  • ~CPlane() : CPlane
  • ~CPlgFilter() : CPlgFilter
  • ~CPlgPin() : CPlgPin
  • ~CPlgTermSample() : CPlgTermSample
  • ~CPluggableTransport() : CPluggableTransport
  • ~CPooledData() : CPooledData
  • ~CPrintCanvas() : CPrintCanvas
  • ~CPrintRequest() : CPrintRequest
  • ~CPrintSDIDoc() : CPrintSDIDoc
  • ~CPrintSDIView() : CPrintSDIView
  • ~CProgress() : CProgress
  • ~CProgressDlg() : WiaWrap::CProgressDlg
  • ~CProperties() : CProperties
  • ~CPropertiesBase() : CPropertiesBase
  • ~CPropertiesDlg() : CPropertiesDlg
  • ~CPropertyEditSession() : CPropertyEditSession
  • ~CPropertyIDs() : CPropertyIDs
  • ~CPropertyInfos() : CPropertyInfos
  • ~CPropertyPage() : CPropertyPage
  • ~CPropertyTag() : CPropertyTag
  • ~CPropIDSets() : CPropIDSets
  • ~CPropInfoSets() : CPropInfoSets
  • ~CPropPageLite() : CPropPageLite
  • ~CProppageUser() : CProppageUser
  • ~CProppageUserUI() : CProppageUserUI
  • ~CPropPro() : CPropPro
  • ~CPropSets() : CPropSets
  • ~CPropSheetExtension() : CPropSheetExtension
  • ~CPropSheetHost() : CPropSheetHost
  • ~CPropSheetLite() : CPropSheetLite
  • ~CProvFactory() : CProvFactory
  • ~CProvider() : CProvider
  • ~CProvider_IWbemEventConsumerProvider() : CProvider_IWbemEventConsumerProvider
  • ~CProvider_IWbemEventProvider() : CProvider_IWbemEventProvider
  • ~CProvider_IWbemServices() : CProvider_IWbemServices
  • ~CProvider_IWbemUnboundObjectSink() : CProvider_IWbemUnboundObjectSink
  • ~CProviderFactory() : CProviderFactory
  • ~CProxy() : CProxy
  • ~CProxyPlugin() : CProxyPlugin
  • ~CPSTN() : CPSTN
  • ~CQueryBox() : CQueryBox
  • ~CQuickStringWrap() : CQuickStringWrap
  • ~CRecoOutputWnd() : CRecoOutputWnd
  • ~CRefClient() : CRefClient
  • ~CRefCount() : CRefCount
  • ~CRefresher() : CRefresher
  • ~CRefresherMember() : CRefresherMember< T >
  • ~CRegAccess() : CRegAccess
  • ~CReindeer() : CReindeer
  • ~CRequestInstance() : CRequestInstance
  • ~CResultset() : CResultset
  • ~CRichEditLite() : CRichEditLite
  • ~CRocket() : CRocket
  • ~CRow() : CRow
  • ~CRowPosition() : CRowPosition
  • ~CRowset() : CRowset
  • ~CRTCAVSession() : CRTCAVSession
  • ~CRTCIMSession() : CRTCIMSession
  • ~CRTCSession() : CRTCSession
  • ~CRTCWin() : CRTCWin
  • ~CS1Dialog() : CS1Dialog
  • ~CS2Dialog() : CS2Dialog
  • ~CS3Dialog() : CS3Dialog
  • ~CS4Dialog() : CS4Dialog
  • ~CSAFEARRAY() : CSAFEARRAY
  • ~CSafeRefCount() : CSafeRefCount
  • ~CSampleDataContainer() : CSampleDataContainer
  • ~CSampleDataSource() : CSampleDataSource
  • ~CSampleDirectory() : CSampleDirectory
  • ~CSampleDirectoryInfo() : CSampleDirectoryInfo
  • ~CSampleInstance() : CSampleInstance
  • ~CSampleMSP() : CSampleMSP
  • ~CSampleMSPCall() : CSampleMSPCall
  • ~CSampleMSPStream() : CSampleMSPStream
  • ~CSamplePipe() : CSamplePipe
  • ~CSampleStemmer() : CSampleStemmer
  • ~CSampleWordBreaker() : CSampleWordBreaker
  • ~CSchemaDlg() : CSchemaDlg
  • ~CSCP() : CSCP
  • ~CSCPCMenuDialog() : CSCPCMenuDialog
  • ~CSCPPageBindingInfo() : CSCPPageBindingInfo
  • ~CSCPPageGeneral() : CSCPPageGeneral
  • ~CSCPPageKeywords() : CSCPPageKeywords
  • ~CSCPUIBindingInfo() : CSCPUIBindingInfo
  • ~CSCPUIGeneral() : CSCPUIGeneral
  • ~CSCPUIKeywords() : CSCPUIKeywords
  • ~CSCPWiz() : CSCPWiz
  • ~CScreenCanvas() : CScreenCanvas
  • ~CScrollBarLite() : CScrollBarLite
  • ~CSDKSamplePlaylistParser() : CSDKSamplePlaylistParser
  • ~CSDKSamplePlaylistParserPlugin() : CSDKSamplePlaylistParserPlugin
  • ~CSDKSampleStorageSystem() : CSDKSampleStorageSystem
  • ~CSecureObject() : CSecureObject
  • ~CServer() : CServer
  • ~CServiceCallback() : CServiceCallback
  • ~CServiceComp() : CServiceComp
  • ~CSession() : CSession
  • ~CSettings() : CSettings
  • ~CShellExt() : CShellExt
  • ~CShellExtClassFactory() : CShellExtClassFactory
  • ~CShellFolder() : CShellFolder
  • ~CShellIconOverlayID() : CShellIconOverlayID
  • ~CShellView() : CShellView
  • ~CSids() : CSids
  • ~CSimpleApp() : CSimpleApp
  • ~CSimpleArray() : CSimpleArray< T >
  • ~CSimpleClass() : CSimpleClass
  • ~CSimpleDialog() : CSimpleDialog
  • ~CSimpleDoc() : CSimpleDoc
  • ~CSimpleObject() : CSimpleObject
  • ~CSimpleSite() : CSimpleSite
  • ~CSimpSvrApp() : CSimpSvrApp
  • ~CSimpSvrDoc() : CSimpSvrDoc
  • ~CSimpSvrObj() : CSimpSvrObj
  • ~CSite() : CSite
  • ~CSkateboard() : CSkateboard
  • ~CSkateboardFolder() : CSkateboardFolder
  • ~CSkyBasedVehicle() : CSkyBasedVehicle
  • ~CSkyVehicle() : CSkyVehicle
  • ~CSmartComPtr() : CSmartComPtr< T >
  • ~CSmartPtr() : CSmartPtr< T >
  • ~CSmpFilter() : CSmpFilter
  • ~CSmpFilterCF() : CSmpFilterCF
  • ~CSnapinAbout() : CSnapinAbout
  • ~CSpaceFolder() : CSpaceFolder
  • ~CSpaceStation() : CSpaceStation
  • ~CSpaceVehicle() : CSpaceVehicle
  • ~CSpecialCharHashTable() : CSpecialCharHashTable
  • ~CSpyCon() : CSpyCon
  • ~CStabilize() : CStabilize
  • ~Cstack_c() : Cstack_c
  • ~CStaticMap() : CStaticMap
  • ~CStaticNode() : CStaticNode
  • ~CStatusBarLite() : CStatusBarLite
  • ~CStatusHelper() : CStatusHelper
  • ~CStdDbOutput() : CStdDbOutput
  • ~CStorageBuffer() : CStorageBuffer
  • ~CStorageResource() : CStorageResource
  • ~CStorageResType() : CStorageResType
  • ~CStream() : CStream
  • ~CString() : CString
  • ~CStringTable() : CStringTable
  • ~CSurrogate() : CSurrogate
  • ~CSyncMgrHandler() : CSyncMgrHandler
  • ~CTable() : CTable
  • ~CTableCopy() : CTableCopy
  • ~CTabLite() : CTabLite
  • ~CTAPIEventNotification() : CTAPIEventNotification
  • ~CTerminateCompositionEditSession() : CTerminateCompositionEditSession
  • ~CTestDlg() : CTestDlg
  • ~CTestDoc() : CTestDoc
  • ~CTestView() : CTestView
  • ~CTextGrid() : CTextGrid
  • ~CThumbNailPhotoHolder() : CThumbNailPhotoHolder
  • ~CToolBand() : CToolBand
  • ~CToolBarExtension() : CToolBarExtension
  • ~CToolBarLite() : CToolBarLite
  • ~CTransaction() : CTransaction
  • ~CTransactionOptions() : CTransactionOptions
  • ~CTreeViewLite() : CTreeViewLite
  • ~CTSFDataObject() : CTSFDataObject
  • ~CTSFEditWnd() : CTSFEditWnd
  • ~CTSFMainWnd() : CTSFMainWnd
  • ~CTSFPersistentPropertyLoader() : CTSFPersistentPropertyLoader
  • ~CTypesDialog() : CTypesDialog
  • ~CUnknown() : CUnknown
  • ~CUpdateTextEditSession() : CUpdateTextEditSession
  • ~CUrlmonCallback() : CUrlmonCallback
  • ~CUtil() : CUtil
  • ~CUtilBSTR() : CUtilBSTR
  • ~CUtilComPtr() : CUtilComPtr< T >
  • ~CUtilProp() : CUtilProp
  • ~CUtilString() : CUtilString
  • ~CVARIANT() : CVARIANT
  • ~CVariant() : CVariant
  • ~CVARIANT() : CVARIANT
  • ~CVector() : CVector< TYPE, IDX >
  • ~CVectorEx() : CVectorEx< TYPE, IDX >
  • ~CViewList() : CViewList
  • ~CVirtualFile() : CVirtualFile
  • ~CWaitCursor() : CWaitCursor
  • ~CWbemClientDlg() : CWbemClientDlg
  • ~CWebBrowser() : CWebBrowser
  • ~CWiaDataCallback() : CWiaDataCallback
  • ~CWinApp() : CWinApp
  • ~CWizard() : CWizard
  • ~CWizExtUser() : CWizExtUser
  • ~CWndLite() : CWndLite
  • ~CWorkerThread() : CWorkerThread
  • ~CWrapVBComponent() : CWrapVBComponent
  • ~CX224() : CX224
  • ~CXmlDOM() : CXmlDOM
  • ~GlobalVars() : GlobalVars
  • ~HelloWorld() : HelloWorld
  • ~HtmlPropIFilter() : HtmlPropIFilter
  • ~HtmlPropIFilterCF() : HtmlPropIFilterCF
  • ~InitOle() : InitOle
  • ~InkCollectorEvents() : InkCollectorEvents
  • ~ISAPI_BUFFER() : ISAPI_BUFFER
  • ~ISAPI_EXTENSION() : ISAPI_EXTENSION
  • ~ISAPI_REQUEST() : ISAPI_REQUEST
  • ~ISAPI_STRING() : ISAPI_STRING
  • ~ISAPI_STRINGW() : ISAPI_STRINGW
  • ~ISAPITHREAD() : ISAPITHREAD
  • ~Iterator() : ClientList::Iterator
  • ~MyClassFactory() : MyClassFactory
  • ~MyDataSource() : MyDataSource
  • ~MyOSPObject() : MyOSPObject
  • ~MyString() : MyString
  • ~NIDeque_c() : NIDeque_c< T >
  • ~NIDequeIter_c() : NIDequeIter_c< T >
  • ~PMmStream() : PMmStream
  • ~RecvBuf() : RecvBuf
  • ~RefCount() : RefCount
  • ~RqsClient() : RqsClient
  • ~RqsConfig() : RqsConfig
  • ~RqsEngine() : RqsEngine
  • ~SIMPLE_BROWSER() : SIMPLE_BROWSER
  • ~SmartRefPointer() : SmartRefPointer< T >
  • ~SMmStream() : SMmStream
  • ~Stack_c() : Stack_c< T >
  • ~TempBuffer() : TempBuffer
  • ~TPropBase() : TPropBase< TYPE >
  • ~TPropSetBase() : TPropSetBase< TYPE, OBJTYPE >
  • ~UPNPDimmerDevice() : UPNPDimmerDevice
  • ~UPNPDimmerService() : UPNPDimmerService
  • ~XBStr() : XBStr
  • ~XInterface() : XInterface< T >
  • ~XPtr() : XPtr< T >
  • ~XWindow() : XWindow
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- a -

  • abEvent : tagEVENT
  • Abort() : CCrmFilesTest , CAsynchBase
  • AbortProc : CPrintAux
  • AbortRecord() : CCrmDebugCompensator , CCrmFilesCompensator
  • AbortRecordVariants() : CCrmDebugCompensator
  • AbortTransaction() : CByotTransObj , CCrmMonComp
  • AbortTransactionProc() : CMDIChild
  • ABOUT : CClassFactory
  • About() : CComSpy , IComSpy , About
  • AboutBox() : Sample::UI::AboutBox
  • AboutBoxHandler() : Sample::UI::MainWindow
  • AboutDlg() : AboutDlg
  • aboutMenu : Sample::UI::MainWindow , CapJ
  • aboutMenu_click() : CapJ
  • Accelerators() : CFrame
  • accept() : DTHandler
  • AcceptCall() : Conf
  • AcceptConnection() : CPluggableTransport
  • Accepted() : CCallNotify
  • AcceptExArgs : _WSAOVERLAPPEDPLUS
  • acceptor_address : gss_channel_bindings_struct
  • acceptor_addrtype : gss_channel_bindings_struct
  • Access() : CSAFEARRAY , mib_entry
  • AccessCheck() : CMyEventProvider
  • aChannelRegistryKeys : tagAppletSessionRequest
  • achFile : FILE_CONTEXT_TYPE
  • achNTUserName : _USER_INFO
  • achNTUserPassword : _USER_INFO
  • achPassword : _USER_INFO
  • achUserName : _USER_INFO
  • ack_num : tpc_hdr
  • Acquire() : XInterface< T > , SMmStream , XPtr< T > , XInterface< T > , XBStr , XInterface< T > , XPtr< T >
  • Action : tSReq
  • Activate() : CCaseTextService , CMarkTextService , CSite , CCrmFilesWorker , CCrmFilesTest , CAccount , CUpdateReceipt , CLogFile , CADOComponent , COLEDBComponent , CRDOComponent , COMPlus , CProxy , CPropertyPage , CAgentCtlCharacterEx
  • ActivateData() : CPooledData
  • ActivateInPlace() : COleDocumentView
  • ActivateInputState() : AgentNotifySink , Notify
  • ActivateMe() : CImpIOleDocumentSite
  • ActivateUI() : COleDocumentView
  • Active() : CPlgPin
  • ActiveClientChange() : AgentNotifySink , Notify
  • ActiveColor : AutoClaims::InkLayer
  • ActiveComponents() : CUnknown
  • ActiveConnection : _RecordsetVtbl
  • ActiveInk : AutoClaims::InkLayer
  • activePen : InkHitTest::InkHitTest
  • adAddNew : msado15::CursorOptionEnum
  • adAffectAll : msado15::AffectEnum
  • adAffectAllChapters : msado15::AffectEnum
  • adAffectCurrent : msado15::AffectEnum
  • adAffectGroup : msado15::AffectEnum
  • adApproxPosition : msado15::CursorOptionEnum
  • adAsyncConnect : msado15::ConnectOptionEnum
  • adAsyncExecute : msado15::ExecuteOptionEnum
  • adAsyncFetch : msado15::ExecuteOptionEnum
  • adAsyncFetchNonBlocking : msado15::ExecuteOptionEnum
  • adBigInt : msado15::DataTypeEnum
  • adBinary : msado15::DataTypeEnum
  • adBookmark : msado15::CursorOptionEnum
  • adBookmarkCurrent : msado15::BookmarkEnum
  • adBookmarkFirst : msado15::BookmarkEnum
  • adBookmarkLast : msado15::BookmarkEnum
  • adBoolean : msado15::DataTypeEnum
  • adBSTR : msado15::DataTypeEnum
  • adChapter : msado15::DataTypeEnum
  • adChar : msado15::DataTypeEnum
  • adClipString : msado15::StringFormatEnum
  • adCmdFile : msado15::CommandTypeEnum
  • adCmdStoredProc : msado15::CommandTypeEnum
  • adCmdTable : msado15::CommandTypeEnum
  • adCmdTableDirect : msado15::CommandTypeEnum
  • adCmdText : msado15::CommandTypeEnum
  • adCmdUnknown : msado15::CommandTypeEnum
  • adCmdUnspecified : msado15::CommandTypeEnum
  • adCmdURLBind : msado15::CommandTypeEnum
  • adCollectionRecord : msado15::RecordTypeEnum
  • adCompareEqual : msado15::CompareEnum
  • adCompareGreaterThan : msado15::CompareEnum
  • adCompareLessThan : msado15::CompareEnum
  • adCompareNotComparable : msado15::CompareEnum
  • adCompareNotEqual : msado15::CompareEnum
  • adConnectUnspecified : msado15::ConnectOptionEnum
  • adCopyAllowEmulation : msado15::CopyRecordOptionsEnum
  • adCopyNonRecursive : msado15::CopyRecordOptionsEnum
  • adCopyOverWrite : msado15::CopyRecordOptionsEnum
  • adCR : msado15::LineSeparatorEnum
  • adCreateCollection : msado15::RecordCreateOptionsEnum
  • adCreateNonCollection : msado15::RecordCreateOptionsEnum
  • adCreateOverwrite : msado15::RecordCreateOptionsEnum
  • adCreateStructDoc : msado15::RecordCreateOptionsEnum
  • adCriteriaAllCols : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCriteriaKey : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCriteriaTimeStamp : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCriteriaUpdCols : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCRLF : msado15::LineSeparatorEnum
  • adCurrency : msado15::DataTypeEnum
  • Add() : comadmin::COMAdminCatalogCollection , comadmin::ICatalogCollection , CDynamic , CEntity , CStaticMap , CSimpleArray< T > , CAgentCtlCommandsEx , CSpecialCharHashTable
  • Add2OpenedQueuePathNameArray() : CMainFrame
  • Add2PathNameArray() : CMainFrame
  • adDate : msado15::DataTypeEnum
  • AddBasicConstraintsCommon() : CCertPolicySample
  • adDBDate : msado15::DataTypeEnum
  • adDBFileTime : msado15::DataTypeEnum
  • AddBinding() : CAdvClientDlg
  • adDBTime : msado15::DataTypeEnum
  • adDBTimeStamp : msado15::DataTypeEnum
  • AddCacheItem() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • addCatalog() : NewsSubscriber
  • AddCDLToContext() : CacheProxySamplePlugin::CacheProxyPlugin
  • AddColumn() : CADsSearch
  • AddColumnProc() : CMDIChild
  • AddComment() : CAnnotator , IAnnotator
  • AddContextMenuItem() : CObjData
  • AddContextMenuItems() : CObjData , CClusterData , CNodeData , CGroupData , CResData , CResTypeData , CNetworkData , CNetInterfaceData , CExtObject , CObjData , CClusterData , CNodeData , CGroupData , CResData , CResTypeData , CNetworkData , CNetInterfaceData
  • addDataSourceListener() : MyDataSource
  • AddDataToResponseBuffer() : ISAPI_REQUEST
  • AddDevice() : CGenericUCPDlg
  • AddDeviceNode() : CStaticNode
  • adDecimal : msado15::DataTypeEnum
  • adDefaultStream : msado15::FieldEnum
  • adDelayFetchFields : msado15::RecordOpenOptionsEnum
  • adDelayFetchStream : msado15::RecordOpenOptionsEnum
  • AddElement() : CVector< TYPE, IDX > , CHtmlElementBag
  • adDelete : msado15::CursorOptionEnum
  • AddEnum() : CRefClient , CRefresher
  • AddEOL() : CRow
  • AddEventToList() : CComSpy
  • AddFilter() : CAdvClientDlg
  • AddFiltersToGraph() : CPlgTermSample
  • AddFolder() : CShellFolder
  • AddFolderNode() : CDeviceNode
  • AddForDownload() : CacheProxySamplePlugin::CacheProxyPlugin
  • AddFrameLevelTools() : CSimpleApp
  • AddFrameLevelUI() : CSimpleApp , CSimpSvrObj
  • AddHead() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • AddHeaderToBufferedResponse() : ISAPI_REQUEST
  • AddImages() : CDelegationBase
  • AddInst() : CDbAlloc
  • AddItem() : CBackgroundFolder , CShellFolder , CShellView
  • AddKeystroke() : CDrawArea
  • AddLine() : CDrawArea , CSharp_Draw::Form1 , CDrawArea
  • AddMenuItems() : CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CComponent , CComponentData , CComponent , CComponentData , CContextMenuExtension , CComponentData , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CExtendContextMenuEx , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • AddMultiSelectCookie() : CDataObject
  • AddMultiSelectGuid() : CDataObject
  • AddNew()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • AddNewGame() : CComputer
  • AddNoLen() : CStaticMap
  • AddObject() : CObjTree , CRefresher
  • AddObjects() : CRefClient
  • addOLEDBSimpleProviderListener() : MyOSPObject
  • adDouble : msado15::DataTypeEnum
  • AddPage() : CPropSheetLite
  • AddPages() : CSCP , CSCPWiz , CProppageUser , CWizExtUser , CShellExt
  • AddParamValueToList() : CComSpy
  • AddParent() : CVCExploreDlg
  • AddProperty() : TPropBase< TYPE >
  • AddPropertySheetPages() : CShellView
  • AddPropSet() : TPropSetBase< TYPE, OBJTYPE >
  • addr : _RU_SOCKET
  • AddRecentConfig() : CFullConnect
  • AddRecentFile() : CFullConnect
  • AddRef() : CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CFactory , CCallAsFactory , CCallAs , CHello , CHelloClassFactory , CImpAuth , CSmartPtr< T > , CSmartPtrTrace< T > , CWiaDataCallback , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCEvents , CTAPIEventNotification , CDownloadBindStatusCallback , InkCollectorEvents , CBackgroundCopyCallback , CMonitor , CMgrNotify , CConfNotify , CDataNotify , RefCount , CApplet , CRefCount , CMgrNotify , CConfNotify , CAppletSession , CFtNotify , RefCount , CMgrNotify , CConfNotify , RefCount , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , RefCount , CMgrNotify , CAppShareNotify , CCallNotify , CConfNotify , CMgrNotify , RefCount , HtmlPropIFilter , HtmlPropIFilterCF , CHtmlIFilterBase , CHtmlIFilterCF , CLanguageResourceSampleCF , CSampleWordBreaker , CSampleStemmer , CSmpFilter , CSmpFilterCF
  • AddRefAccessor() : CDataAccess , CImpIAccessor
  • AddReference() : CSmartComPtr< T >
  • AddRefRows() : CDataGrid , CRowset , CImpIRowset
  • addressFamily : _AcceptContext , _ClientContext
  • AddRow() : CDBFile
  • AddRunningAspsToDebugMenu() : CComSpy
  • AddSearchPref() : CADsSearch
  • AddService() : Microsoft::Uddi::Demo::Publish
  • AddSession() : CRTCWin
  • AddStatusMessage() : CSimpleDialog
  • AddString() : CListBoxLite , CComboBoxLite , CComboBoxEx , CRecoOutputWnd
  • AddSubscription() : CAppInfo
  • AddTail() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • AddToEnumList() : CEnumIDList
  • AddToList() : CMallocSpy , CViewList
  • AddToMediaCapabilities() : CRTCIncomingDlg , CRTCOutgoingDlg
  • AddToParticipantList() : CRTCOutgoingDlg
  • AddUser() : IDBAuthAdmin , CDBAuthAdmin , CDBAuthPlugin
  • AddV1TemplateNameExtension() : CCertPolicySample
  • AddVirtualFile() : CFolderNode
  • adEditAdd : msado15::EditModeEnum
  • adEditDelete : msado15::EditModeEnum
  • adEditInProgress : msado15::EditModeEnum
  • adEditNone : msado15::EditModeEnum
  • adEmpty : msado15::DataTypeEnum
  • adErrBoundToCommand : msado15::ErrorValueEnum
  • adErrDataConversion : msado15::ErrorValueEnum
  • adErrFeatureNotAvailable : msado15::ErrorValueEnum
  • adErrIllegalOperation : msado15::ErrorValueEnum
  • adErrInTransaction : msado15::ErrorValueEnum
  • adErrInvalidArgument : msado15::ErrorValueEnum
  • adErrInvalidConnection : msado15::ErrorValueEnum
  • adErrInvalidParamInfo : msado15::ErrorValueEnum
  • adErrItemNotFound : msado15::ErrorValueEnum
  • adErrNoCurrentRecord : msado15::ErrorValueEnum
  • adErrNotExecuting : msado15::ErrorValueEnum
  • adErrNotReentrant : msado15::ErrorValueEnum
  • adErrObjectClosed : msado15::ErrorValueEnum
  • adErrObjectInCollection : msado15::ErrorValueEnum
  • adErrObjectNotSet : msado15::ErrorValueEnum
  • adErrObjectOpen : msado15::ErrorValueEnum
  • adErrOpeningFile : msado15::ErrorValueEnum
  • adErrOperationCancelled : msado15::ErrorValueEnum
  • adError : msado15::DataTypeEnum
  • adErrProviderNotFound : msado15::ErrorValueEnum
  • adErrReadFile : msado15::ErrorValueEnum
  • adErrStillConnecting : msado15::ErrorValueEnum
  • adErrStillExecuting : msado15::ErrorValueEnum
  • adErrUnsafeOperation : msado15::ErrorValueEnum
  • adErrWriteFile : msado15::ErrorValueEnum
  • adExecuteNoRecords : msado15::ExecuteOptionEnum
  • adFailIfNotExists : msado15::RecordCreateOptionsEnum
  • adFileTime : msado15::DataTypeEnum
  • adFilterAffectedRecords : msado15::FilterGroupEnum
  • adFilterConflictingRecords : msado15::FilterGroupEnum
  • adFilterFetchedRecords : msado15::FilterGroupEnum
  • adFilterNone : msado15::FilterGroupEnum
  • adFilterPendingRecords : msado15::FilterGroupEnum
  • adFilterPredicate : msado15::FilterGroupEnum
  • adFind : msado15::CursorOptionEnum
  • adFldCacheDeferred : msado15::FieldAttributeEnum
  • adFldFixed : msado15::FieldAttributeEnum
  • adFldIsNullable : msado15::FieldAttributeEnum
  • adFldKeyColumn : msado15::FieldAttributeEnum
  • adFldLong : msado15::FieldAttributeEnum
  • adFldMayBeNull : msado15::FieldAttributeEnum
  • adFldMayDefer : msado15::FieldAttributeEnum
  • adFldNegativeScale : msado15::FieldAttributeEnum
  • adFldRowID : msado15::FieldAttributeEnum
  • adFldRowVersion : msado15::FieldAttributeEnum
  • adFldUnknownUpdatable : msado15::FieldAttributeEnum
  • adFldUnspecified : msado15::FieldAttributeEnum
  • adFldUpdatable : msado15::FieldAttributeEnum
  • adGetRowsRest : msado15::GetRowsOptionEnum
  • adGUID : msado15::DataTypeEnum
  • adHoldRecords : msado15::CursorOptionEnum
  • adIDispatch : msado15::DataTypeEnum
  • adIndex : msado15::CursorOptionEnum
  • adInteger : msado15::DataTypeEnum
  • adIUnknown : msado15::DataTypeEnum
  • AdjustBindings() : CTable
  • AdjustRect() : CTabLite
  • AdjustStartLocationForEOL() : CRow
  • adLF : msado15::LineSeparatorEnum
  • adLockBatchOptimistic : msado15::LockTypeEnum
  • adLockOptimistic : msado15::LockTypeEnum
  • adLockPessimistic : msado15::LockTypeEnum
  • adLockReadOnly : msado15::LockTypeEnum
  • adLockUnspecified : msado15::LockTypeEnum
  • adLongVarBinary : msado15::DataTypeEnum
  • adLongVarChar : msado15::DataTypeEnum
  • adLongVarWChar : msado15::DataTypeEnum
  • adMarshalAll : msado15::MarshalOptionsEnum
  • adMarshalModifiedOnly : msado15::MarshalOptionsEnum
  • admin : NewsFlash , NewsSubscriber
  • AdminCreateDataSource() : CDataSource
  • AdminCreateDataSourceProc() : CMDIChild
  • AdminSettings : CacheProxySamplePlugin::CacheProxyPlugin
  • adModeRead : msado15::ConnectModeEnum
  • adModeReadWrite : msado15::ConnectModeEnum
  • adModeRecursive : msado15::ConnectModeEnum
  • adModeShareDenyNone : msado15::ConnectModeEnum
  • adModeShareDenyRead : msado15::ConnectModeEnum
  • adModeShareDenyWrite : msado15::ConnectModeEnum
  • adModeShareExclusive : msado15::ConnectModeEnum
  • adModeUnknown : msado15::ConnectModeEnum
  • adModeWrite : msado15::ConnectModeEnum
  • adMoveAllowEmulation : msado15::MoveRecordOptionsEnum
  • adMoveDontUpdateLinks : msado15::MoveRecordOptionsEnum
  • adMoveOverWrite : msado15::MoveRecordOptionsEnum
  • adMovePrevious : msado15::CursorOptionEnum
  • adNotify : msado15::CursorOptionEnum
  • adNumeric : msado15::DataTypeEnum
  • ADOCheck() : msado15::IRecFields
  • adoModeRead : msado15::ConnectModeEnum
  • adoModeReadWrite : msado15::ConnectModeEnum
  • adoModeRecursive : msado15::ConnectModeEnum
  • adoModeShareDenyRead : msado15::ConnectModeEnum
  • adoModeShareDenyWrite : msado15::ConnectModeEnum
  • adoModeShareExclusive : msado15::ConnectModeEnum
  • adoModeShareNone : msado15::ConnectModeEnum
  • adoModeUnknown : msado15::ConnectModeEnum
  • adoModeWrite : msado15::ConnectModeEnum
  • adOpenAsync : msado15::RecordOpenOptionsEnum
  • adOpenDynamic : msado15::CursorTypeEnum
  • adOpenForwardOnly : msado15::CursorTypeEnum
  • adOpenIfExists : msado15::RecordCreateOptionsEnum
  • adOpenKeyset : msado15::CursorTypeEnum
  • adOpenSource : msado15::RecordOpenOptionsEnum
  • adOpenStatic : msado15::CursorTypeEnum
  • adOpenStreamAsync : msado15::StreamOpenOptionsEnum
  • adOpenStreamFromRecord : msado15::StreamOpenOptionsEnum
  • adOpenStreamFromURL : msado15::StreamOpenOptionsEnum
  • adOpenUnspecified : msado15::CursorTypeEnum
  • adOpenURLBind : msado15::RecordOpenOptionsEnum
  • adOptionUnspecified : msado15::ExecuteOptionEnum
  • adParamInput : msado15::ParameterDirectionEnum
  • adParamInputOutput : msado15::ParameterDirectionEnum
  • adParamLong : msado15::ParameterAttributesEnum
  • adParamNullable : msado15::ParameterAttributesEnum
  • adParamOutput : msado15::ParameterDirectionEnum
  • adParamReturnValue : msado15::ParameterDirectionEnum
  • adParamSigned : msado15::ParameterAttributesEnum
  • adParamUnknown : msado15::ParameterDirectionEnum
  • adPersistADTG : msado15::PersistFormatEnum
  • adPersistXML : msado15::PersistFormatEnum
  • adPosBOF : msado15::PositionEnum
  • adPosEOF : msado15::PositionEnum
  • adPosUnknown : msado15::PositionEnum
  • adPriorityAboveNormal : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityBelowNormal : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityHighest : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityLowest : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityNormal : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPromptAlways : msado15::ConnectPromptEnum
  • adPromptComplete : msado15::ConnectPromptEnum
  • adPromptCompleteRequired : msado15::ConnectPromptEnum
  • adPromptNever : msado15::ConnectPromptEnum
  • adPropNotSupported : msado15::PropertyAttributesEnum
  • adPropOptional : msado15::PropertyAttributesEnum
  • adPropRead : msado15::PropertyAttributesEnum
  • adPropRequired : msado15::PropertyAttributesEnum
  • adPropVariant : msado15::DataTypeEnum
  • adPropWrite : msado15::PropertyAttributesEnum
  • adReadAll : msado15::StreamReadEnum
  • adReadLine : msado15::StreamReadEnum
  • adRecalcAlways : msado15::ADCPROP_AUTORECALC_ENUM
  • adRecalcUpFront : msado15::ADCPROP_AUTORECALC_ENUM
  • adRecCanceled : msado15::RecordStatusEnum
  • adRecCantRelease : msado15::RecordStatusEnum
  • adRecConcurrencyViolation : msado15::RecordStatusEnum
  • adRecDBDeleted : msado15::RecordStatusEnum
  • adRecDeleted : msado15::RecordStatusEnum
  • adRecIntegrityViolation : msado15::RecordStatusEnum
  • adRecInvalid : msado15::RecordStatusEnum
  • adRecMaxChangesExceeded : msado15::RecordStatusEnum
  • adRecModified : msado15::RecordStatusEnum
  • adRecMultipleChanges : msado15::RecordStatusEnum
  • adRecNew : msado15::RecordStatusEnum
  • adRecObjectOpen : msado15::RecordStatusEnum
  • adRecOK : msado15::RecordStatusEnum
  • adRecordURL : msado15::FieldEnum
  • adRecOutOfMemory : msado15::RecordStatusEnum
  • adRecPendingChanges : msado15::RecordStatusEnum
  • adRecPermissionDenied : msado15::RecordStatusEnum
  • adRecSchemaViolation : msado15::RecordStatusEnum
  • adRecUnmodified : msado15::RecordStatusEnum
  • adResync : msado15::CursorOptionEnum
  • adResyncAll : msado15::CEResyncEnum
  • adResyncAllValues : msado15::ResyncEnum
  • adResyncAutoIncrement : msado15::CEResyncEnum
  • adResyncConflicts : msado15::CEResyncEnum
  • adResyncInserts : msado15::CEResyncEnum
  • adResyncNone : msado15::CEResyncEnum
  • adResyncUnderlyingValues : msado15::ResyncEnum
  • adResyncUpdates : msado15::CEResyncEnum
  • adRsnAddNew : msado15::EventReasonEnum
  • adRsnClose : msado15::EventReasonEnum
  • adRsnDelete : msado15::EventReasonEnum
  • adRsnFirstChange : msado15::EventReasonEnum
  • adRsnMove : msado15::EventReasonEnum
  • adRsnMoveFirst : msado15::EventReasonEnum
  • adRsnMoveLast : msado15::EventReasonEnum
  • adRsnMoveNext : msado15::EventReasonEnum
  • adRsnMovePrevious : msado15::EventReasonEnum
  • adRsnRequery : msado15::EventReasonEnum
  • adRsnResynch : msado15::EventReasonEnum
  • adRsnUndoAddNew : msado15::EventReasonEnum
  • adRsnUndoDelete : msado15::EventReasonEnum
  • adRsnUndoUpdate : msado15::EventReasonEnum
  • adRsnUpdate : msado15::EventReasonEnum
  • adSaveCreateNotExist : msado15::SaveOptionsEnum
  • adSaveCreateOverWrite : msado15::SaveOptionsEnum
  • adSchemaAsserts : msado15::SchemaEnum
  • adSchemaCatalogs : msado15::SchemaEnum
  • adSchemaCharacterSets : msado15::SchemaEnum
  • adSchemaCheckConstraints : msado15::SchemaEnum
  • adSchemaCollations : msado15::SchemaEnum
  • adSchemaColumnPrivileges : msado15::SchemaEnum
  • adSchemaColumns : msado15::SchemaEnum
  • adSchemaColumnsDomainUsage : msado15::SchemaEnum
  • adSchemaConstraintColumnUsage : msado15::SchemaEnum
  • adSchemaConstraintTableUsage : msado15::SchemaEnum
  • adSchemaCubes : msado15::SchemaEnum
  • adSchemaDBInfoKeywords : msado15::SchemaEnum
  • adSchemaDBInfoLiterals : msado15::SchemaEnum
  • adSchemaDimensions : msado15::SchemaEnum
  • adSchemaForeignKeys : msado15::SchemaEnum
  • adSchemaHierarchies : msado15::SchemaEnum
  • adSchemaIndexes : msado15::SchemaEnum
  • adSchemaKeyColumnUsage : msado15::SchemaEnum
  • adSchemaLevels : msado15::SchemaEnum
  • adSchemaMeasures : msado15::SchemaEnum
  • adSchemaMembers : msado15::SchemaEnum
  • adSchemaPrimaryKeys : msado15::SchemaEnum
  • adSchemaProcedureColumns : msado15::SchemaEnum
  • adSchemaProcedureParameters : msado15::SchemaEnum
  • adSchemaProcedures : msado15::SchemaEnum
  • adSchemaProperties : msado15::SchemaEnum
  • adSchemaProviderSpecific : msado15::SchemaEnum
  • adSchemaProviderTypes : msado15::SchemaEnum
  • adSchemaReferentialConstraints : msado15::SchemaEnum
  • adSchemaReferentialContraints : msado15::SchemaEnum
  • adSchemaSchemata : msado15::SchemaEnum
  • adSchemaSQLLanguages : msado15::SchemaEnum
  • adSchemaStatistics : msado15::SchemaEnum
  • adSchemaTableConstraints : msado15::SchemaEnum
  • adSchemaTablePrivileges : msado15::SchemaEnum
  • adSchemaTables : msado15::SchemaEnum
  • adSchemaTranslations : msado15::SchemaEnum
  • adSchemaTrustees : msado15::SchemaEnum
  • adSchemaUsagePrivileges : msado15::SchemaEnum
  • adSchemaViewColumnUsage : msado15::SchemaEnum
  • adSchemaViews : msado15::SchemaEnum
  • adSchemaViewTableUsage : msado15::SchemaEnum
  • adSearchBackward : msado15::SearchDirectionEnum
  • adSearchForward : msado15::SearchDirectionEnum
  • adSeek : msado15::CursorOptionEnum
  • adSeekAfter : msado15::SeekEnum
  • adSeekAfterEQ : msado15::SeekEnum
  • adSeekBefore : msado15::SeekEnum
  • adSeekBeforeEQ : msado15::SeekEnum
  • adSeekFirstEQ : msado15::SeekEnum
  • adSeekLastEQ : msado15::SeekEnum
  • ADsError() : ADsError
  • adSimpleRecord : msado15::RecordTypeEnum
  • adSingle : msado15::DataTypeEnum
  • adSmallInt : msado15::DataTypeEnum
  • ADsOpenObject() : CADQIApp
  • adStateClosed : msado15::ObjectStateEnum
  • adStateConnecting : msado15::ObjectStateEnum
  • adStateExecuting : msado15::ObjectStateEnum
  • adStateFetching : msado15::ObjectStateEnum
  • adStateOpen : msado15::ObjectStateEnum
  • adStatusCancel : msado15::EventStatusEnum
  • adStatusCantDeny : msado15::EventStatusEnum
  • adStatusErrorsOccurred : msado15::EventStatusEnum
  • adStatusOK : msado15::EventStatusEnum
  • adStatusUnwantedEvent : msado15::EventStatusEnum
  • adStructDoc : msado15::RecordTypeEnum
  • adsType : ADSTYPEsyntaxmapping
  • AdsType : ADSTYPE_TO_STRING_ENTRY
  • adTinyInt : msado15::DataTypeEnum
  • adTypeBinary : msado15::StreamTypeEnum
  • adTypeText : msado15::StreamTypeEnum
  • adUnsignedBigInt : msado15::DataTypeEnum
  • adUnsignedInt : msado15::DataTypeEnum
  • adUnsignedSmallInt : msado15::DataTypeEnum
  • adUnsignedTinyInt : msado15::DataTypeEnum
  • adUpdate : msado15::CursorOptionEnum
  • adUpdateBatch : msado15::CursorOptionEnum
  • adUseClient : msado15::CursorLocationEnum
  • adUseClientBatch : msado15::CursorLocationEnum
  • adUseNone : msado15::CursorLocationEnum
  • adUserDefined : msado15::DataTypeEnum
  • adUseServer : msado15::CursorLocationEnum
  • adVarBinary : msado15::DataTypeEnum
  • adVarChar : msado15::DataTypeEnum
  • adVariant : msado15::DataTypeEnum
  • adVarNumeric : msado15::DataTypeEnum
  • adVarWChar : msado15::DataTypeEnum
  • Advise() : CAppletSession , CListener , COleObject , UPNPDimmerService , CDimmerService , CApplet , CRTCEvents , CDimmerService , CConnectionPoint
  • AdviseInkCollector() : InkCollectorEvents
  • AdviseListener() : CContainerBase
  • AdviseSink() : CLangBarItemButton , CTSFEditWnd , CLangBarItemButton
  • AdviseSource() : CMSMQEventHandler
  • adWChar : msado15::DataTypeEnum
  • adWriteChar : msado15::StreamWriteEnum
  • adWriteLine : msado15::StreamWriteEnum
  • adXactAbortRetaining : msado15::XactAttributeEnum
  • adXactAsyncPhaseOne : msado15::XactAttributeEnum
  • adXactBrowse : msado15::IsolationLevelEnum
  • adXactChaos : msado15::IsolationLevelEnum
  • adXactCommitRetaining : msado15::XactAttributeEnum
  • adXactCursorStability : msado15::IsolationLevelEnum
  • adXactIsolated : msado15::IsolationLevelEnum
  • adXactReadCommitted : msado15::IsolationLevelEnum
  • adXactReadUncommitted : msado15::IsolationLevelEnum
  • adXactRepeatableRead : msado15::IsolationLevelEnum
  • adXactSerializable : msado15::IsolationLevelEnum
  • adXactSyncPhaseOne : msado15::XactAttributeEnum
  • adXactUnspecified : msado15::IsolationLevelEnum
  • aDynamicChannels : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • aemrformat : tagCMTMLTFMT
  • AffectRecords : _RecordsetVtbl
  • agent1 : CapJ
  • agent1_agentPropertyChange() : CapJ
  • agent1_command() : CapJ
  • agent1_move() : CapJ
  • AgentNotifySink : MainDlg , AgentNotifySink
  • AgentPropertyChange() : AgentNotifySink , Notify
  • agentSockAddr : GlobalVars
  • Alert() : CSettings
  • AlertBox() : CController
  • Align16() : CDialogStream
  • Align32() : CDialogStream
  • alignment : Props
  • Alloc() : CFixedAlloc , CLDisp
  • AllocatedBytes : _LOCAL_HEAP_INFO_BLOCK
  • AllocatedEntries : _LOCAL_HEAP_INFO_BLOCK
  • AllocateHandleConfirm() : CAppletSession
  • AllocateProxyBuffers() : CDBFile , CMSOmniProvRowset
  • AllocBeforeWrite() : CString
  • AllocBuffer() : CString
  • AllocCopy() : CString
  • AllocOleStr() : CSnapinAbout
  • AllocPidlTable() : CContextMenu , CDropTarget , CDataObject
  • AllocProxyBuffer() : CRow
  • allowedModes : tagTrackObject
  • AlterColumn() : CAlterColumnDlg
  • AlterIndex() : CAlterIndexDlg
  • AlterTable() : CAlterTableDlg
  • AmIAnAdministrator() : CVCSecuritySampleClass
  • analysis : RUN
  • ANDRect : CHILDWINDOWDATA
  • ANDTextRect : CHILDWINDOWDATA
  • AnimationsLabel : CapJ
  • AnimationsListBox : CapJ
  • AnimationsListBox_doubleClick() : CapJ
  • aNodeIDs : IAppletSessionVtbl
  • aoffset : PRIVCLIPDATA
  • apAppletRecords : tagAppletRoster
  • apAppRosters : IAppletSessionNotifyVtbl
  • apCapabilities : tagAppletRecord , tagAppletRoster
  • apCollapsedCaps : tagAppletSessionRequest
  • apExpectedCapabilities : tagAppletProtocolEntity
  • APIHook() : APIHook< T >
  • apNonCollapsedCaps : tagAppletSessionRequest
  • Append() : msado15::_DynaCollection , CComWSTR , ISAPI_STRINGW , ISAPI_STRING , CRichEditLite , msado15::Parameters , CEntity , CComWSTR , msado15::Fields
  • AppendA() : ISAPI_STRINGW
  • AppendChunk()
: msado15::_Parameter
, msado15::Field15
, msado15::Field
, msado15::Parameter
  • AppendData() : ISAPI_BUFFER
  • AppendW() : ISAPI_STRING
  • AppInitialize() : CAppLite
  • AppletProtocolKey : tagAppletSessionKey
  • Application : STL_LABEL , CContext
  • application_data : gss_channel_bindings_struct
  • applicationMode : InkClipboard::InkClipboard
  • Apply() : CComSpyPropPage , CContextSamplePropPage , CPropertyPage
  • ApplyViewState() : COleDocumentView
  • AppMemAllocs : _APPMEM_DATA_DEFINITION
  • AppMemAllocsSec : _APPMEM_DATA_DEFINITION
  • AppMemBytesAllocated : _APPMEM_DATA_DEFINITION
  • AppMemFrees : _APPMEM_DATA_DEFINITION
  • AppMemFreesSec : _APPMEM_DATA_DEFINITION
  • AppMemObjectType : _APPMEM_DATA_DEFINITION
  • AppMemReAllocs : _APPMEM_DATA_DEFINITION
  • AppMemReAllocsSec : _APPMEM_DATA_DEFINITION
  • AppName() : CAppInfo
  • appNameLB : NewsSubscriber
  • appNameTF : NewsSubscriber
  • AppsListHandler() : CSelectEventsDlg
  • AquireData() : CDlgSrc
  • ArchiveQuotaPerStream : IWMSCacheAdmin , CachePluginAdmin
  • archiveQuotaPerStream : PersistedConfiguration
  • ArchiveQuotaPerStream : CachePluginAdmin
  • ArrayEmpty() : CBitArray
  • ARRAYQ() : ARRAYQ
  • ArraySize : _ITEM_DESC
  • Arrived() : CImp_DrawDlg , CMSMQEventHandler
  • ArrivedError() : CMSMQEventHandler
  • AssembleMenus() : CSimpSvrObj
  • Assertion() : CDbAlloc
  • AssignCopy() : CString
  • AssignSocket() : RqsClient
  • AssocFromPos() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • AssociateToMachine() : CAdvClientDlg
  • aStaticChannels : tagAppletSessionRequest
  • Async : tReq , tSReq
  • ASYNC_REQUESTER : SIMPLE_BROWSER , ASYNC_REQUESTER
  • AsyncSendResponseIIS4() : ISAPI_REQUEST
  • AsyncSendResponseIIS5() : ISAPI_REQUEST
  • AsyncSendResponseIIS6() : ISAPI_REQUEST
  • AsyncTransmitBufferedResponse() : ISAPI_REQUEST
  • aszIdentity : _EAPCB
  • aszPassword : _EAPCB
  • AtEnd() : ClientList::Iterator
  • Attach() : CPropertyInfos , CFastVariant , CPropertyIDs , CVector< TYPE, IDX > , CParameters , CComWSTR , CColumnInfo , CVariant , CProperties
  • AttachAnnotator() : CAnnotator , IAnnotator
  • attr : diritem
  • attrid : ATTRIBUTES
  • Audit() : IComSpy , CComSpy
  • aUsers : tagAppletChannelRequest
  • AuthData : _CREDENTIAL
  • Authenticate() : CImpAuth , CAuthenticateContext
  • AuthorizeEvent() : CDBAuthPlugin
  • AutoClaims() : AutoClaims::AutoClaims
  • AutoClaims_Load() : AutoClaims::AutoClaims
  • AutoHide : CapJ
  • autoinc : FieldInfo
  • AutoJoinSessionIndication() : CApplet
  • AutoPace : CapJ
  • AutoPosition() : CMDITrace , CMDIChild , CMDIObjects , CMDIChildLite
  • AutoQI() : CTransactionOptions , CDataset , CRow , CDataSource , CCommand , CDataLinks , CSession , CDataAccess , CTransaction , CAsynchBase , CError , CBinder , CCustomError , CContainerBase , CMultipleResults , CStream , CPropertiesBase , CConnectionPoint , CUnknown , CEnumerator , CRowPosition , CBase , CRowset , CServiceComp
  • AutoRelease() : CTransaction , CSession , CEnumerator , CServiceComp , CBinder , CError , CRowPosition , CCommand , CDataSource , CPropertiesBase , CConnectionPoint , CDataLinks , CBase , CAsynchBase , CRowset , CUnknown , CMultipleResults , CStream , CTransactionOptions , CDataset , CRow , CContainerBase , CCustomError , CDataAccess
  • aux_data_len : igmp_group_record_v3
  • avewidth : Table
  • awcName : SPropertyEntry
  • awszIdentity : _EAP_NAME_DIALOG
  • awszPassword : _EAP_NAME_DIALOG
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- b -

  • Back : NILNode_c< T > , NIDequeIter_c< T >
  • backcolour : Props
  • backendServer : PersistedConfiguration
  • BackendServer : IWMSCacheAdmin , CachePluginAdmin
  • BackupREGDB()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • bActivity : CExeModule
  • BalloonVisibleState() : AgentNotifySink , Notify
  • bAllPullsDone : tReq
  • BAllRequiredFieldsPresent() : CClipBookServerParamsPage , CFileShareSampleParamsPage
  • bAlternateQos : _QOS_OPTIONS
  • bAnchor : item_tag
  • BandedDataCallback() : WiaWrap::CDataCallback , CWiaDataCallback
  • BApplyChanges() : CBasePropertyPage
  • Bark() : CDog
  • base : ENUMSYMDATA
  • Base : _VIRTUAL_BUFFER
  • Base64Decode() : ISAPI_BUFFER
  • Base64Encode() : ISAPI_STRING
  • bAsyncCallFailureReceived : tReq
  • BBackPressed() : CBasePropertyPage
  • bbox : APMFILEHEADER
  • bBuf : tReq , tSReq
  • BBuildPropList() : CBasePropertyPage
  • bCallCancelled : tReq
  • bCallComplete : tReq
  • bCallMade : tReq
  • bChatty : THREADDATA , CREATEDATA
  • bClosing : _SOCK_INFO
  • bColorCount : MEMICONDIRENTRY , ICONDIRENTRY
  • bConfirmResv : _QOS_OPTIONS
  • bCreatePerIteration : THREADDATA
  • bData : COLUMNDATA , _COLUMNDATA
  • bDataAvailable : tReq
  • bDirectMode : CSharp_Draw::Form1
  • bDisableSignalling : _QOS_OPTIONS
  • bDiscard : compitem , section
  • bDone : CREATEDATA
  • bDropInProgress : _DRVLINE
  • bDSEnabled : CSharp_Draw::Form1
  • Beep() : CEvent , AppEvents
  • Begin() : CAdminNotifyHandler
  • Begin_Sum() : CAsyncFullServ , fullsvr::AsyncFullServ , fullsvr::AsyncIFullServ
  • Begin_Test1() : CAsyncTest
  • Begin_Test2() : CAsyncTest
  • BeginAbort() : CCrmDebugCompensator , CCrmFilesCompensator
  • BeginAbortVariants() : CCrmDebugCompensator
  • BeginCommit() : CCrmDebugCompensator , CCrmFilesCompensator
  • BeginCommitVariants() : CCrmDebugCompensator
  • BeginningTransaction() : CUrlmonCallback
  • BeginPrepare() : CCrmDebugCompensator , CCrmFilesCompensator
  • BeginPrepareVariants() : CCrmDebugCompensator
  • BeginTrans()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • BeginTransaction() : CByotTransObj
  • BeginTransComplete()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • bEnabled : _SAMPLE_HELPER_DATA_
  • bExpand : view
  • bExpanded : CDelegationBase , CComponentData
  • bExpandGuard : view
  • bExpanding : view
  • bFailureFromPull : tReq
  • bFailureFromWrite : tReq
  • bFile : dirlist
  • bFineGrainErrorAvail : _QOS_OPTIONS
  • bFit2Wnd : _PRTDATA
  • bFixTemplate : _QOS_OPTIONS
  • bFormatNameOnly : ARRAYQ
  • bGlobalTemplate : _OPTIONS
  • bGraphics : BANDINFOSTRUCT
  • bHasChanged : ICONRESOURCE
  • bHasCtrlChars : _tagPOSTKEY
  • bHeight : MEMICONDIRENTRY , ICONDIRENTRY
  • bImpersonating : tReq , tSReq , ThreadArgs
  • Bind() : CRow , CImpIBindResource
  • bind() : DTHandler
  • BindDSO() : CImpIBindResource
  • BindRegion() : HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter
  • BindResourceProc() : CMainWindow
  • BindResultMetaData() : CODBCData
  • BindRow() : CImpIBindResource
  • BindRowset() : CImpIBindResource
  • BindSession() : CImpIBindResource
  • BindStaticEntity() : CProxy
  • BindStream() : CImpIBindResource
  • BindToObject() : CShellFolder
  • BindToStorage() : CShellFolder
  • bInProcess : params
  • BIsListEmpty() : CClusPropList
  • BlackPen : CSharp_Draw::Form1
  • blackPen : InkHitTest::InkHitTest , Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • BlackRect : CHILDWINDOWDATA
  • BlackTextRect : CHILDWINDOWDATA
  • bLastDataPushIssued : tSReq
  • blob : KEY_HEADER
  • bLocalIsTemp : diritem
  • bMarked : compitem
  • bMulticast : _SP_OPTIONS
  • bMustSetQosInAccept : _QOS_OPTIONS
  • bNewPosition : _BALLDATA
  • bNull : tagFieldMetaData
  • bNullPush : tSReq
  • bOK : item_tag
  • BookMark() : AgentNotifySink , Notify
  • bool : VTUNION
  • boolVal : _tagPROPSTRUCT
  • bottom : Margin , RECTI
  • bottominner : Margin
  • Bound : Counter
  • box : Props
  • BoxRect : CHILDWINDOWDATA
  • bPlayContinuous : _playinfo
  • bPrecision : COLDESC , _ParameterVtbl
  • bProviderSpecific : _QOS_OPTIONS
  • bPullOutstanding : tReq
  • bPushOutstanding : tSReq
  • bQos : _SP_OPTIONS
  • bQosabilityIoctls : _QOS_OPTIONS
  • bQueryBufferSize : _QOS_OPTIONS
  • Branding : _JOB_INFO
  • bRandom : THREADDATA
  • bReadOutstanding : tSReq
  • bReadsDone : tSReq
  • BreakText() : CSampleWordBreaker
  • bReceiver : _QOS_OPTIONS
  • bRecvPacketId : _EAPCB
  • bReserved : MEMICONDIRENTRY , ICONDIRENTRY
  • bResult : CSharp_Draw::InputBox
  • BrowseEnumeratorProc() : CFullConnect
  • bRpcImpersonating : tReq
  • bRunningStatus : tag_track
  • brushText : CSharp_Draw::Form1
  • BSaved() : CBasePropertyPage
  • bScale : COLDESC , _ParameterVtbl
  • bScanned : direct
  • bSelected : CIceSkate
  • bSendComplete : _SEND_INFO
  • bSendEnabled : _SEND_INFO
  • bSetDestaddr : _QOS_OPTIONS
  • BSetPrivateProps() : CBasePropertyPage
  • bState : MYTOOLINFO
  • bStatus : FILEDEX
  • bStop : CREATEDATA
  • bstr : _CommandVtbl , _ConnectionVtbl , _ParameterVtbl
  • bstrConn : _RecordsetVtbl
  • bstrEventClassID : CEvtStoreSub
  • BSTRING() : BSTRING
  • bstrName : SESSION_DATA , WATCHER_DATA , _CommandVtbl
  • bstrOldURI : AUTH_DATA
  • bstrPublisherID : CEvtStoreSub
  • bstrSubscriptionID : CEvtStoreSub
  • bstrURI : WATCHER_DATA , SESSION_DATA
  • bstrVal : VTUNION
  • bStyle : MYTOOLINFO
  • bSum : dirlist
  • bTaken : Static_Statistic , Static_Info_Database
  • bText : BANDINFOSTRUCT
  • btnAttach : CSharp_Draw::Form1
  • btnAttach_Click() : CSharp_Draw::Form1
  • btnCancel : CSharp_Draw::Form1 , CSharp_Draw::InputBox
  • btnCancel_Click()
: CSharp_Draw::Form1
, CSharp_Draw::InputBox
  • btnConnect : CSharp_Draw::Form1
  • btnConnect_Click() : CSharp_Draw::Form1
  • btnMove_Click() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • btnMoveDown : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • btnMoveUp : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • btnOK : CSharp_Draw::InputBox
  • btnOK_Click() : CSharp_Draw::InputBox
  • btnRecognize : InkRecognition::InkRecognition
  • btnRecognize_Click() : InkRecognition::InkRecognition
  • BTSTR() : BTSTR
  • buf : _DATA_BUFFER , _OPTIONS , tagQtStruct
  • BufAlloc() : RecvBuf
  • BufBeg() : RecvBuf
  • buff : _SFFS
  • Buffer : _MESSAGE , _SEARCH_REQUEST_STATE , _COPY_CHUNK , _UNICODE_STRING , _RASHOST_DATA , _PER_IO_CONTEXT , CacheProxySamplePlugin::INSSBufferImpl , _socklist
  • buffer : filebuffer
  • BUFFER_SIZE : RSProxy
  • BufReset() : RecvBuf
  • BufScanInt() : RecvBuf
  • BufScanStr() : RecvBuf
  • BufShift() : RecvBuf
  • BufSize() : RecvBuf
  • BufSpace() : RecvBuf
  • BuildJoinSessionStructure() : CAppletSession
  • BuildRemoteUrl() : CPack
  • ButtonDown() : CController
  • buttonSign : Sample::UI::MainWindow
  • buttonSign_Click() : Sample::UI::MainWindow
  • ButtonUp() : CController
  • buttonVerify : Sample::UI::MainWindow
  • buttonVerify_Click() : Sample::UI::MainWindow
  • bVerbose : _OPTIONS
  • bWaitToSend : _QOS_OPTIONS
  • bWidth : ICONDIRENTRY , MEMICONDIRENTRY
  • bWindowed : WININFO
  • BWizard() : CBasePropertyPage , CExtObject , CBasePropertyPage
  • byteOffset : _PROPIDLIST , _PROPSETLIST
  • byteOrder : _SUMMARYINFO , _RSUMINFO
  • BytesPrinted : _Job
  • BytesRecv : _SOCK_INFO
  • BytesReturned : CQueryDlg
  • BytesSent : _SOCK_INFO
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- c -

  • c : _ADOCollectionVtbl , _ADODynaCollectionVtbl , FieldsVtbl , ParametersVtbl , ErrorsVtbl , PropertiesVtbl , _IID
  • C_REQUEST : RSProxy
  • C_RESPONSE : RSProxy
  • CAboutDlg() : CAboutDlg
  • CAccount() : CAccount
  • CacheDirectoryPath : CachePluginAdmin
  • cacheDirectoryPath : PersistedConfiguration
  • CacheDirectoryPath : IWMSCacheAdmin , CachePluginAdmin
  • CacheFlags : CacheProxySamplePlugin::ContentInfo
  • CacheHint() : CComponent
  • CacheID : CacheProxySamplePlugin::PlaylistItem
  • cacheOnDemandCacheMiss : PersistedConfiguration
  • CacheOnDemandCacheMiss : IWMSCacheAdmin , CachePluginAdmin
  • CachePluginAdmin() : CachePluginAdmin
  • CacheProxyCallback : CacheProxySamplePlugin::ContentInfo
  • CacheProxyPlugin() : CacheProxySamplePlugin::CacheProxyPlugin
  • CacheProxyServer : CacheProxySamplePlugin::CacheProxyPlugin
  • CacheSize : _RecordsetVtbl
  • CacheUrl : CacheProxySamplePlugin::PlaylistItem , CacheProxySamplePlugin::ContentInfo
  • CActivitySub() : CActivitySub
  • CAddDeviceDlg() : CAddDeviceDlg
  • CAddFolderDlg() : CAddFolderDlg
  • CAddVFileDlg() : CAddVFileDlg
  • CAdminNotifyHandler() : CAdminNotifyHandler
  • CADOComponent() : CADOComponent
  • CADQIApp() : CADQIApp
  • CADQIDlg() : CADQIDlg
  • CADsSearch() : CADsSearch
  • CADVCGENApp() : CADVCGENApp
  • CADVCGENDlg() : CADVCGENDlg
  • CAdvClientDlg() : CAdvClientDlg
  • CAdvRecoApp() : CAdvRecoApp
  • CAgentCtlAnimationNames() : CAgentCtlAnimationNames
  • CAgentCtlAudioObject() : CAgentCtlAudioObject
  • CAgentCtlBalloonEx() : CAgentCtlBalloonEx
  • CAgentCtlCharacterEx() : CAgentCtlCharacterEx
  • CAgentCtlCharacters() : CAgentCtlCharacters
  • CAgentCtlCommandEx() : CAgentCtlCommandEx
  • CAgentCtlCommandsEx() : CAgentCtlCommandsEx
  • CAgentCtlPropertySheet() : CAgentCtlPropertySheet
  • CAgentCtlRequest() : CAgentCtlRequest
  • CAgentCtlUserInput() : CAgentCtlUserInput
  • CAggregate() : CAggregate
  • CalcLen() : ISAPI_STRING , ISAPI_STRINGW
  • CalculateRowData() : CRow
  • CalculateRowDataToDelete() : CRow
  • Call() : Conf
  • CallAccepted() : Conf
  • CallBack() : CCallBack
  • CallbackFunction()
: CallbackIUnknownLib::ServiceCallBackInterface
, CallbackIUnknownLib::DeviceFinderCallBackInterface
  • CallbackType : HTTP_REQUESTCB_PARAM
  • CallCreated() : CMgrNotify , Conf
  • CallDone : CAsyncTest
  • CallerId : _JOB_INFO
  • CallerName : _JOB_INFO
  • CallerNumber : _JOB_INFO
  • CallerSocket : _WSAOVERLAPPEDPLUS
  • CallerThreadId : _WSAOVERLAPPEDPLUS
  • CallHandle : _JOB_INFO
  • CallNone : CAsyncTest
  • CAllocList : CMallocSpy
  • CallPending : CAsyncTest
  • CallRejected() : Conf
  • CAlterColumnDlg() : CAlterColumnDlg
  • CAlterIndexDlg() : CAlterIndexDlg
  • CAlterTableDlg() : CAlterTableDlg
  • CanBeManaged() : CStorageResource , IStorageProperties
  • CanBePooled() : CCrmFilesWorker , COMPlus , CProxy
  • Cancel()
: fullsvr::AsyncFullServ
, fullsvr::ICancelMethodCalls
, msado15::_Command
, msado15::_Connection
, msado15::_Record
, msado15::_Recordset
, msado15::_Stream
, msado15::Command
, msado15::Connection
, msado15::Record
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
, msado15::Stream
, CImpICommandText
, CProgress
  • CancelAsyncCall() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • CancelBatch()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • Cancelled() : CPrintRequest , WiaWrap::CProgressDlg
  • cancelRequest() : RSProxy
  • CancelUpdate()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • CAnchorTag() : CAnchorTag
  • CanConnectionBePooled() : CPooledData
  • CanConvert() : CImpIConvertType
  • CanConvertProc() : CMDIChild
  • CanInPlaceActivate() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • CanNextPage() : CModel
  • CanNextSection() : CModel
  • CanNodeBeClustered() : CMyCapabilities
  • CAnnotator() : CAnnotator
  • CanPaste() : CEditBoxLite
  • CanPrevPage() : CModel
  • CanPrevSection() : CModel
  • CapClass : tagAppletCapability
  • CAPIApp() : CAPIApp
  • CAPICOM_ENCODED_DATA_FORMAT_MULTI_LINES : storesh::Storesh
  • CapID : tagAppletCapability , tagAppletCapability2
  • CAPIDoc() : CAPIDoc
  • CAPIView() : CAPIView
  • CapJ() : CapJ
  • CapJ_activate() : CapJ
  • CapJ_closing() : CapJ
  • CapJ_deactivate() : CapJ
  • CAppExportDlg() : CAppExportDlg
  • CAppInfo() : CAppInfo
  • CAppInstallDlg() : CAppInstallDlg
  • CApplet() : CApplet
  • CAppletSession() : CAppletSession
  • CAppLite() : CAppLite
  • CAppShareNotify() : CAppShareNotify
  • CAppSub() : CAppSub
  • CAppUtilDlg() : CAppUtilDlg
  • CaptureImage() : CDataGrid
  • CASCADE_EVENT_CLSID : helper::sampleConstants
  • CASCADE_EVENT_DLL : helper::sampleConstants
  • CASCADE_EVENT_NAME : helper::sampleConstants
  • CASCADE_NAME : helper::sampleConstants
  • cascadeAppName : NewsSubscriber
  • cascadeHeading : NewsSubscriber
  • cascadePersisRB : NewsSubscriber
  • cascadeTransRB : NewsSubscriber
  • CAssoc() : CAssoc< KEY, VALUE >
  • CastToStruct() : CFullPropSpec
  • CAsyncFullServ() : CAsyncFullServ
  • CAsynchBase() : CAsynchBase
  • CAsynchNotify() : CAsynchNotify
  • CAsyncQuerySink() : CAsyncQuerySink
  • CAsyncTest() : CAsyncTest
  • CAsyncXXX() : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • CategoryTree_BeforeExpand() : UDDI::Tools::CategoryTreeView
  • CategoryTreeNode() : UDDI::Tools::CategoryTreeNode
  • CategoryTreeView() : UDDI::Tools::CategoryTreeView
  • CategoryValue : UDDI::Tools::CategoryTreeNode
  • CAttributeValueAddButton() : CAttributeValueAddButton
  • CAttributeValueDeleteButton() : CAttributeValueDeleteButton
  • CAttributeValueEditButton() : CAttributeValueEditButton
  • CAttributeValueEditor() : CAttributeValueEditor
  • CAuthenticateAdmin() : CAuthenticateAdmin
  • CAuthenticateContext() : CAuthenticateContext
  • CAuthenticatePlugin() : CAuthenticatePlugin
  • CAVIFileReader() : CAVIFileReader
  • CAVIFileWriter() : CAVIFileWriter
  • cb : CDbAlloc , tagDataStruct
  • CBackground() : CBackground
  • CBackgroundFolder() : CBackgroundFolder
  • CBankDlg() : CBankDlg
  • CBase() : CBase
  • CBaseDialog() : CBaseDialog
  • CBaseNode() : CBaseNode
  • CBaseObj() : CBaseObj
  • CBasePropertyPage() : CBasePropertyPage
  • cbBmk : tagRowBuff
  • cbBuffer : tag_seq
  • CbBufferSize() : CClusPropList
  • cbBufSize : IAppletSessionVtbl
  • cbBytesReturned : _IOCTLARGS
  • cbCommitCurrent : tagLSTSLOT
  • cbCommitMax : tagLSTSLOT
  • CbCurrentValueLength() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • cbData : CTE_ENCODER_STRUCT
  • CbDataLeft() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • cbDataLength : HTTP_REQUESTCB_PARAM
  • CbDataSize() : CClusPropValueList
  • CBehavior() : CBehavior
  • cbExtra : tagLSTSLOT
  • cbFile : _SFFS
  • CbhCurrentPropertyName() : CClusPropList
  • CbhCurrentValue() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • CbhCurrentValueList() : CClusPropList
  • CbhPropList() : CClusPropList
  • CbhValueList() : CClusPropValueList
  • CBicycle() : CBicycle
  • CBicycleFolder() : CBicycleFolder
  • cbImage : tag_smf
  • cbInBuffer : _IOCTLARGS
  • CBinder() : CBinder
  • CBindings() : CBindings
  • cBindings : tagACCESSOR , BINDINGINFO
  • CBitArray() : CBitArray
  • CBitmapWnd() : CBitmapWnd
  • CBlackPen() : CBlackPen
  • cbLeft : tag_track
  • cbLength : tag_track
  • CBlockFormat() : CBlockFormat
  • CBlockFrame() : CBlockFrame
  • cbMaxSignature : _AUTH_SEQ
  • cbNumItems : _tagPREPAREFORSYNCMSG , _tagSHOWERRORCOMPLETEDMSG
  • cbOutBuffer : _IOCTLARGS
  • CBox() : CBox
  • CBoxFormat() : CBoxFormat
  • cbPage : tagLSTSLOT
  • cbParm : tagEVENT
  • cbPendingUserEvent : tag_smf
  • cbPhysicalLayerReceiveBufferSize : tagPLUGXPRT_PARAMETERS
  • cbPhysicalLayerSendBufferSize : tagPLUGXPRT_PARAMETERS
  • cbPreroll : tag_seq
  • CbPropList() : CClusPropList
  • cbRead : tSReq
  • cbReadFileBufferSize : tagPLUGXPRT_PARAMETERS
  • cbReadSoFar : _IO_WORK_ITEM
  • cbRequest : CMallocSpy
  • CBrowserHost() : CBrowserHost
  • CBrush() : CBrush
  • cbSecurityTrailer : _AUTH_SEQ
  • cbSize : tagHeader , _tagGENERICITEM , Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA , storesh::CERT_SYSTEM_STORE_INFO
  • cbSlot : tagLSTSLOT
  • cbslotLeftOver : tagLSTSLOT
  • CBSTR() : CBSTR
  • cbStrSize : tagAppletOctetString
  • cbStruct : HTTP_REQUESTCB_PARAM , HTTP_REQUEST_PARAM
  • cbStructSize : tagPLUGXPRT_PARAMETERS
  • cBuff : tagSERVERINFO
  • cBuffer : tag_seq
  • CButtonLite() : CButtonLite
  • cbValue : tagDescInfo
  • CByotTransObj() : CByotTransObj
  • cBytes : _SECTION , _THUMB , _STANDARDSECINMEM
  • CCacheMapEl() : CCacheMapEl
  • CCallAs() : CCallAs
  • CCallAsFactory() : CCallAsFactory
  • CCallBack() : CCallBack
  • CCallbackWrapper() : CCallbackWrapper
  • CCallNotify() : CCallNotify
  • CCanvas() : CCanvas
  • cCapabilities : tagAppletRecord , tagAppletRoster
  • CCapMFCApp() : CCapMFCApp
  • CCapMFCDlg() : CCapMFCDlg
  • CCascade() : CCascade
  • CCaseTextService() : CCaseTextService
  • CCertEncodeAltName() : CCertEncodeAltName
  • CCertEncodeBitString() : CCertEncodeBitString
  • CCertEncodeCRLDistInfo() : CCertEncodeCRLDistInfo
  • CCertEncodeDateArray() : CCertEncodeDateArray
  • CCertEncodeLongArray() : CCertEncodeLongArray
  • CCertEncodeStringArray() : CCertEncodeStringArray
  • CCertExitSample() : CCertExitSample
  • CCertManageExitModuleSample() : CCertManageExitModuleSample
  • CCertManagePolicyModuleSample() : CCertManagePolicyModuleSample
  • CCertPolicySample() : CCertPolicySample
  • cch : GBGETTEXTA , GBGETTEXTW , tagLABELEXTRACT
  • CChannelNotify() : CChannelNotify
  • CCharBlock() : CCharBlock
  • CCharGrid() : CCharGrid
  • CChildView() : CChildView
  • CClassFactory : CSimpSvrApp , CClassFactory
  • CClassFactoryWrapper() : CClassFactoryWrapper
  • CClassPro() : CClassPro
  • CClientApp() : CClientApp
  • CClientDlg() : CClientDlg
  • CClipBookServerParamsPage() : CClipBookServerParamsPage
  • CCloseQueueDialog() : CCloseQueueDialog
  • CClusPropList() : CClusPropList
  • CClusPropValueList() : CClusPropValueList
  • CClusterUtils() : CClusterUtils
  • ccmd : _CMDI
  • CCmdLineConsumerApp() : CCmdLineConsumerApp
  • CCmdLineConsumerDlg() : CCmdLineConsumerDlg
  • CCmdLineLite() : CCmdLineLite
  • CCodeGrid() : CCodeGrid
  • cCollapsedCaps : tagAppletSessionRequest
  • CColumnInfo() : CColumnInfo
  • CColumnProvider() : CColumnProvider
  • CComboBoxEx() : CComboBoxEx
  • CComboBoxGuid() : CComboBoxGuid
  • CComboBoxLite() : CComboBoxLite
  • CComboBoxString() : CComboBoxString
  • CCommand : CImpIAccessor , CCommand
  • CCommBand() : CCommBand
  • CCompartmentMonitor() : CCompartmentMonitor
  • CCompImportDlg() : CCompImportDlg
  • CCompInstallDlg() : CCompInstallDlg
  • CComponent : CComponentData , CComponent
  • CComponentData() : CComponentData
  • CCompositionEditSession() : CCompositionEditSession
  • CComPtrArray() : WiaWrap::CComPtrArray< T >
  • CComputer() : CComputer
  • CComSpy() : CComSpy
  • CComSpyPropPage() : CComSpyPropPage
  • CComSpySqlAudit() : CComSpySqlAudit
  • CComSyncTest() : CComSyncTest
  • CComWSTR() : CComWSTR
  • CConfNotify() : CConfNotify
  • CConnectDlg() : CConnectDlg
  • CConnectionPoint() : CConnectionPoint
  • CConnectionPointContainer() : CConnectionPointContainer
  • CConsole() : CConsole
  • CConstraintDlg() : CConstraintDlg
  • CConsumer() : CConsumer
  • CContainerBase() : CContainerBase
  • CContextAdmin() : CContextAdmin
  • CContextMenu : CShellFolder , CShellView , CContextMenu
  • CContextMenuExtension() : CContextMenuExtension
  • CContextPlugin() : CContextPlugin
  • CContextSamplePropPage() : CContextSamplePropPage
  • CCreateQueueDialog() : CCreateQueueDialog
  • CCreateTable() : CCreateTable
  • CCriticalSection() : CCriticalSection
  • CCrmDebugCompensator() : CCrmDebugCompensator
  • CCrmFilesCompensator() : CCrmFilesCompensator
  • CCrmFilesTest() : CCrmFilesTest
  • CCrmFilesWorker() : CCrmFilesWorker
  • CCrmMonComp() : CCrmMonComp
  • CCRMSub() : CCRMSub
  • CCTypeSet() : CCTypeSet
  • CCustomError() : CCustomError
  • CCustomPropertyStore() : CCustomPropertyStore
  • CDataAccess() : CDataAccess
  • CDataCallback() : WiaWrap::CDataCallback
  • CDataGrid() : CDataGrid
  • CDataLinks() : CDataLinks
  • CDataNotify() : CDataNotify
  • CDataObject : COleDocument , CSimpSvrObj , CShellFolder , CDataObject
  • CDataset() : CDataset
  • CDataSource() : CDataSource
  • CDataXferObj() : CDataXferObj
  • CDbAlloc() : CDbAlloc
  • CDBAuthAdmin() : CDBAuthAdmin
  • CDBAuthPlugin() : CDBAuthPlugin
  • CDBFile() : CDBFile
  • CDBSession : CDataSource , CDBSession
  • cdData : tagRowBuff
  • CDelegationBase() : CDelegationBase
  • CDeleteObjectDlg() : CDeleteObjectDlg
  • CDeleteQueueDialog() : CDeleteQueueDialog
  • CDeskBand() : CDeskBand
  • CDeviceFinderCallback() : CDeviceFinderCallback
  • CDeviceNode() : CDeviceNode
  • CDeviceProp() : CDeviceProp
  • CDialogBase() : CDialogBase
  • CDialogLite() : CDialogLite
  • CDialogStream() : CDialogStream
  • CDimmer() : CDimmer
  • CDimmerService() : CDimmerService
  • CDisdrawApp() : CDisdrawApp
  • CDisdrawDlg() : CDisdrawDlg
  • CDL : CacheProxySamplePlugin::ContentInfo
  • CDLData : CacheProxySamplePlugin::PlaylistItem , CacheProxySamplePlugin::ContentInfo
  • CDlgDest() : CDlgDest
  • CDlgIADs() : CDlgIADs
  • CDlgIADsContainer() : CDlgIADsContainer
  • CDlgIADsLargeInteger() : CDlgIADsLargeInteger
  • CDlgIADsOpenDSObject() : CDlgIADsOpenDSObject
  • CDlgIADsPropertyList() : CDlgIADsPropertyList
  • CDlgIADsSecurityDescriptor() : CDlgIADsSecurityDescriptor
  • CDlgIDirectoryObject() : CDlgIDirectoryObject
  • CDlgIDirectorySearch() : CDlgIDirectorySearch
  • CDlgSrc() : CDlgSrc
  • CDog() : CDog
  • CDownloadBindStatusCallback() : CDownloadBindStatusCallback
  • CDownloadUI() : CDownloadUI
  • CDragSource() : CDragSource
  • CDrawArea() : CDrawArea
  • CDropObject() : CDropObject
  • CDropSource() : CDropSource
  • CDropTarget : CShellFolder , CDropTarget
  • CDSLAdvancedPage() : CDSLAdvancedPage
  • CDSLConnectionPage() : CDSLConnectionPage
  • CDynamic() : CDynamic
  • cDynamicChannels : tagAppletSessionRequest , IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • CEapCfg() : CEapCfg
  • CEditBoxLite() : CEditBoxLite
  • CEditSessionBase() : CEditSessionBase
  • CEditValueDlg() : CEditValueDlg
  • CEmptyVolumeCache() : CEmptyVolumeCache
  • CEnlistTransaction() : CEnlistTransaction
  • centerBottomHandle : InkClipboard::InkClipboard
  • centerTopHandle : InkClipboard::InkClipboard
  • CenterWindow() : CReceiveWaitDialog
  • cEntities : tagAppletCapability
  • CEntity() : CEntity
  • CEnumConnectionPoints() : CEnumConnectionPoints
  • CEnumConnections() : CEnumConnections
  • CEnumDisplayAttributeInfo() : CEnumDisplayAttributeInfo
  • CEnumerator() : CEnumerator
  • CEnumFormatEtc() : CEnumFormatEtc
  • CEnumIDList() : CEnumIDList
  • CEnumStorageResource() : CEnumStorageResource
  • CEnumSyncMgrItems() : CEnumSyncMgrItems
  • CEnumTASK() : CEnumTASK
  • CEnumXXX() : CEnumXXX< T, ELT_T, IFACE >
  • CError() : CError
  • cErrors : tagSERVERINFO
  • CERT_SYSTEM_STORE_CURRENT_USER : storesh::Storesh
  • CERT_SYSTEM_STORE_LOCAL_MACHINE : storesh::Storesh
  • CertEnumSystemStore() : storesh::Win32
  • CertEnumSystemStoreCallback() : storesh::Storesh
  • CertFindChainInStore() : Sample::Win32
  • CERTNAME_LENGTH : storesh::Storesh
  • CertOpenSystemStore() : Sample::Win32
  • CEvent() : CEvent
  • CEventCallback() : WiaWrap::CEventCallback
  • cEventID : EventID
  • CEventSink() : CEventSink
  • CEvtStoreSub() : CEvtStoreSub
  • CException() : CException
  • CExceptionSub() : CExceptionSub
  • CExecuteParamDlg() : CExecuteParamDlg
  • CExList() : CExList< TYPE >
  • cExpectedCapabilities : tagAppletProtocolEntity
  • CExplorerBar() : CExplorerBar
  • CExtBuffer() : CExtBuffer
  • CExtendContextMenuEx() : CExtendContextMenuEx
  • CExtendPropertySheet() : CExtendPropertySheet
  • CExternalConnection : CSimpSvrObj
  • CExtObject() : CExtObject
  • CExtPageUser() : CExtPageUser
  • CExtractIcon() : CExtractIcon
  • cf : CDefClassFactory
  • CFactory : CUnknown , CFactory
  • CFastVariant() : CFastVariant
  • CFileIdx() : CFileIdx
  • CFileIO() : CFileIO
  • CFileLite() : CFileLite
  • CFileShareSampleParamsPage() : CFileShareSampleParamsPage
  • CFileStream() : CFileStream
  • CFileTransferNotify() : CFileTransferNotify
  • CFileViewer() : CFileViewer
  • CFixedAlloc() : CFixedAlloc
  • CFlipDocEditSession() : CFlipDocEditSession
  • CFlipEditSession() : CFlipEditSession
  • CFolderNode() : CFolderNode
  • CFont() : CFont
  • CFontSelect() : CFontSelect
  • CFontSet() : CFontSet
  • CFrame() : CFrame
  • CFrameFormat() : CFrameFormat
  • CFrameWndLite() : CFrameWndLite
  • CFreeTest() : CFreeTest
  • CFtNotify() : CFtNotify
  • CFullConnect() : CFullConnect
  • CFullConnectOptions() : CFullConnectOptions
  • CFullConnectProperties() : CFullConnectProperties
  • CFullConnectProvider() : CFullConnectProvider
  • CFullConnectSecurity() : CFullConnectSecurity
  • CFullPropSpec() : CFullPropSpec
  • CFullServ() : CFullServ
  • CFVClassFactory() : CFVClassFactory
  • CGdiplusInit() : CGdiplusInit
  • CGenerateRC() : CGenerateRC
  • CGenericEnum() : CGenericEnum
  • CGenericUCPApp() : CGenericUCPApp
  • CGenericUCPDlg() : CGenericUCPDlg
  • CGetCounter() : Cstack_c
  • CGetInfoExDlg() : CGetInfoExDlg
  • CGetReceipt() : CGetReceipt
  • CGrid() : CGrid
  • CGridIt() : CGridIt
  • CHandler() : CHandler
  • cHandles : tagAppletRegistryRequest , IAppletSessionNotifyVtbl
  • Change() : CThumbNailPhotoHolder
  • Changed : _Job
  • ChangeRestrictions() : CSchemaDlg
  • ChangeSelectedRow() : CMDIChild
  • ChangeState() : CHtmlIFilter
  • ChangeTableName() : CS1Dialog
  • changeType : CEvtStoreSub
  • ChangeType() : CFastVariant , CVariant
  • ChannelChanged() : CConfNotify
  • ChannelConfirm() : CAppletSession
  • ChannelIndication() : CAppletSession
  • Char() : CCanvas
  • CHAR_PIPE_TYPE : FileRepServer
  • CHAR_TYPE : FileRepServer
  • Character() : CAgentCtlCharacters
  • chData : blockTag
  • CheckAccess() : CMyEventProvider
  • CheckButton() : CButtonLite
  • CheckCanceledHelper() : CCommand
  • CheckCertPolicy() : CIsapiCertPolicyFilter
  • CheckDlgButton() : CWndLite
  • checkForAppAlreadyInstalled() : NewsFlash , NewsSubscriber
  • checkForApplication() : NewsFlash , NewsSubscriber
  • checkForComponent() : NewsFlash , NewsSubscriber
  • CheckMediaType() : CPlgPin
  • CheckOfficeNamespace() : CAdvClientDlg
  • checksum : diritem , APMFILEHEADER , igmp_hdr , igmp_hdr_query_v3 , igmp_hdr_report_v3
  • CheckTable() : CMSOmniProvRowset
  • checkValidity() : Sample::Sample
  • CHello() : CHello
  • CHelloClassFactory() : CHelloClassFactory
  • CHelloEditSession() : CHelloEditSession
  • chHideLayer : AutoClaims::AutoClaims
  • chHideLayer_CheckedChanged() : AutoClaims::AutoClaims
  • children : CPeoplePoweredVehicle , CSpaceVehicle , CStaticNode , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSpaceStation , CSpaceFolder , CComponentData , CSkyVehicle , CIceSkateFolder
  • ChildrenResize() : CFileViewer
  • CHiPerfProvider() : CHiPerfProvider
  • chklbPlugins : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • chklbPlugins_ItemCheck() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • chklbPlugins_MouseDown() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • CHMMSampleApp() : CHMMSampleApp
  • Choose() : CFont
  • ChooseCertKeyAlgorithm : Sample::Messages
  • ChooseCertMessage : Sample::Messages
  • ChooseCertNoPrivateKey : Sample::Messages
  • ChooseCertUnableToConstructKey : Sample::Messages
  • ChooseFont() : CComSpy , IComSpy , CModel
  • ChooseLogFile() : CComSpy , IComSpy
  • CHourglass() : CHourglass
  • CHtmlElemBagEntry() : CHtmlElemBagEntry
  • CHtmlElement() : CHtmlElement
  • CHtmlElementBag() : CHtmlElementBag
  • CHtmlIFilter() : CHtmlIFilter
  • CHtmlIFilterBase() : CHtmlIFilterBase
  • CHtmlIFilterCF() : CHtmlIFilterCF
  • CHtmlScanner() : CHtmlScanner
  • CHuman() : CHuman
  • CIceSkate() : CIceSkate
  • CIceSkateFolder() : CIceSkateFolder
  • CIdentitySub() : CIdentitySub
  • cidl : PRIVCLIPDATA
  • CImageTag() : CImageTag
  • CImp_DrawApp() : CImp_DrawApp
  • CImp_DrawDlg() : CImp_DrawDlg
  • CImpAuth() : CImpAuth
  • CImpIAccessor : CImpIAccessor , CCommand , CRowset
  • CImpIAdviseSink() : CImpIAdviseSink , CSite
  • CImpIBindResource : CBinder , CDBSession
  • CImpIColumnsInfo : CCommand , CRow , CRowset
  • CImpICommandProperties : CCommand
  • CImpICommandText : CCommand
  • CImpIConvertType : CCommand , CRow , CRowset
  • CImpICreateCommand : CDBSession
  • CImpICreateRow : CBinder
  • CImpIDataSource : CDBSession
  • CImpIDBBinderProperties : CBinder
  • CImpIDBCreateSession : CDataSource
  • CImpIDBInfo : CDataSource
  • CImpIDBInitialize : CDataSource
  • CImpIDBProperties : CDataSource
  • CImpIFileViewer : CFileViewer , CImpIFileViewer
  • CImpIGetDataSource : CDBSession
  • CImpIGetRow : CRowset
  • CImpIGetSession : CRow , CRowset
  • CImpIGetSourceRow : CStream
  • CImpIOleClientSite : CSite , CImpIOleClientSite
  • CImpIOleDocumentSite : CSite , CImpIOleDocumentSite
  • CImpIOleInPlaceSite : CSite , CImpIOleInPlaceSite
  • CImpIOpenRowset : CDBSession
  • CImpIPersist : CDataSource
  • CImpIPersistFile : CFileViewer , CImpIPersistFile
  • CImpIRow : CRow , CRowset
  • CImpIRowChange : CRow , CRowset
  • CImpIRowset : CRowset
  • CImpIRowsetChange : CRowset
  • CImpIRowsetIdentity : CRowset
  • CImpIRowsetInfo : CRowset
  • CImpIServiceProvider : CDataSource
  • CImpISessionProperties : CDBSession
  • CImpISpecifyPropertyPages() : CImpISpecifyPropertyPages
  • CImpIStream : CStream
  • CImportRes() : CImportRes
  • CInkInputWnd() : CInkInputWnd
  • CInputTag() : CInputTag
  • CInstanceSub() : CInstanceSub
  • CInstPro() : CInstPro
  • CInterfaceDlg() : CInterfaceDlg
  • CIntTrace() : CIntTrace
  • Circle() : CCanvas
  • CIsapiCertPolicyFilter() : CIsapiCertPolicyFilter
  • ciSelect : view
  • CISeqStream() : CISeqStream
  • cIssuer : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • cJobs : _Printer
  • CKeystrokeEditSession() : CKeystrokeEditSession
  • cl : view
  • CLandBasedVehicle() : CLandBasedVehicle
  • CLangBarItemButton() : CLangBarItemButton
  • CLanguageResourceSampleCF() : CLanguageResourceSampleCF
  • classId : _RSUMINFO , _SUMMARYINFO
  • ClassObject : CacheProxySamplePlugin::CacheProxyPlugin
  • ClassToString() : CMainFrame
  • CLBSub() : CLBSub
  • CLDisp() : CLDisp
  • CleanPathNameArray() : CMainFrame
  • CleanUp() : CSids
  • Cleanup() : CStorageResource
  • CleanupSessions() : CRTCWin
  • Clear() : msado15::Errors , CDynamic , CEntity , CResultset , CFastVariant , CVariant , CIntTrace , CISeqStream , CUtilString , CCanvas , WiaWrap::CComPtrArray< T > , CThumbNailPhotoHolder , RqsConfig , RqsEngine , CVARIANT , RealTimeStylusPluginApp::RealTimeStylusPluginApp , SmartRefPointer< T > , CSmartComPtr< T >
  • ClearAll() : CDataGrid
  • ClearAllDataStructures() : CGenericUCPDlg
  • ClearAllEvents() : CComSpy , IComSpy
  • ClearArray() : CProxy , CStaticMap
  • ClearArrays() : CEntity
  • ClearBuddyList() : CRTCWin
  • clearButton : NewsSubscriber
  • clearButton_click() : NewsSubscriber
  • clearCheck() : InkHitTest::InkHitTest
  • ClearDataAdviseHolder() : CSimpSvrObj
  • ClearDeviceCombo() : CGenericUCPDlg
  • clearDirty() : CStaticNode
  • ClearDoc() : CSimpSvrApp
  • ClearFields() : CDataGrid
  • ClearInRosterFlag() : CMember
  • ClearItem : InkHitTest::InkHitTest
  • ClearObj() : CSimpSvrDoc
  • ClearOleAdviseHolder() : CSimpSvrObj
  • ClearOleClientSite() : CSimpSvrObj
  • ClearPropList() : CClusPropList
  • ClearQueue() : ISAPITHREAD
  • ClearSelCols() : CDataGrid
  • ClearServiceCombo() : CGenericUCPDlg
  • ClearStrings() : RqsConfig
  • cLen : _BUFFER
  • Click() : AgentNotifySink , Notify
  • ClientAdd() : RqsEngine
  • ClientAuthenticate() : RqsEngine
  • ClientClearQuarantine() : RqsEngine
  • ClientCompleteCb() : RqsEngine
  • ClientConnect() : RqsEngine
  • ClientConnectCb() : RqsEngine
  • ClientList : ClientList::Iterator , ClientList
  • ClientLogInfo() : RqsEngine
  • ClientReadCb() : RqsEngine
  • ClientReadMessages() : RqsEngine
  • ClientRemove() : RqsEngine
  • ClientSize : GLOBAL_STRUCT
  • ClientWndProc : CFrame
  • CLine() : CLine
  • CLineGrid() : CLineGrid
  • CLinkable() : CLinkable
  • clipend : CellPos
  • clipFormat : _THUMB
  • clipstart : CellPos
  • CList() : CList< TYPE, ARG_TYPE >
  • CListBoxLite() : CListBoxLite
  • CListener() : CListener
  • CListHeader() : CListHeader
  • CListViewLite() : CListViewLite
  • CLListImpl() : CLListImpl< TYPE, ARG_TYPE >
  • CLocateDialog() : CLocateDialog
  • CLock : CLockHandler , CLock
  • CLockHandler() : CLockHandler
  • CLogFile() : CLogFile
  • CLoginDlg() : CLoginDlg
  • Clone() : CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc , COleDocumentView , CSimpleObject , msado15::_Recordset , msado15::Recordset , msado15::Recordset20 , msado15::Recordset21 , CStream , CStorageBuffer , CFileStream , CImpIStream , CGenericEnum , CEnumSyncMgrItems , CEnumFormatEtc , CEnumTASK , CEnumStorageResource , CStorageResource , CEnumFormatEtc , CDataObject , CEnumIDList , CEnumDisplayAttributeInfo , CCustomPropertyStore
  • Close() : CComSpy , COleObject , CFrame , CSite , CSimpleDoc , CSimpSvrDoc , msado15::_Connection , msado15::_Record , msado15::_Recordset , msado15::_Stream , msado15::Connection , msado15::Connection15 , msado15::Record , msado15::Recordset , msado15::Recordset15 , msado15::Recordset20 , msado15::Recordset21 , msado15::Stream , CDBFile , CFileLite , SIMPLE_BROWSER , ASYNC_REQUESTER , CMmStream , PMmStream
  • CloseCommentEditBox() : CAnnotator
  • CloseComPort() : CPSTN
  • CloseConnection() : IPluggableTransport , CPluggableTransport
  • CloseCurrentStatement() : CODBCData
  • CLOSED : ASYNC_REQUESTER
  • CloseDW() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • CloseFile() : CFileStream
  • CloseListenSocket() : CX224
  • closeMenu : Sample::UI::MainWindow
  • CloseOleObject() : CSimpleSite
  • closesocket() : DTHandler
  • CloseSocket() : CX224
  • CloseTempFile() : CPack
  • CloseView() : COleDocumentView
  • CLOSING : ASYNC_REQUESTER
  • clsid
: fullsvr::AsyncFullServ
, fullsvr::FullServ
, comadmin::COMAdminCatalog
, comadmin::COMAdminCatalogCollection
, comadmin::COMAdminCatalogObject
, msado15::Command
, msado15::Connection
, msado15::Parameter
, msado15::Record
, msado15::Recordset
, msado15::Stream
, vcacct::CAccount
, vcacct::CGetReceipt
, vcacct::CMoveMoney
, vcacct::CUpdateReceipt
  • CMain() : CMain
  • CMainFrame() : CMainFrame
  • CMainWindow() : CMainWindow
  • CMallocSpy() : CMallocSpy
  • CMap() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • CMarkTextService() : CMarkTextService
  • cMaximumT200TimeoutsInQ922 : tagPLUGXPRT_PARAMETERS
  • cmd : _OPTIONS
  • CMDIChild() : CMDIChild
  • CMDIChildLite() : CMDIChildLite
  • CMDIFrameLite() : CMDIFrameLite
  • CMDIObjects() : CMDIObjects
  • CMDITrace() : CMDITrace
  • CMember() : CMember
  • CMemoryMappedInputStream() : CMemoryMappedInputStream
  • CMessageDlg() : CMessageDlg
  • CMetaTag() : CMetaTag
  • CMethodPro() : CMethodPro
  • CMethodSub() : CMethodSub
  • CMgdClusCfgInit() : CMgdClusCfgInit
  • CMgdResType() : CMgdResType
  • CMgrNotify() : CMgrNotify
  • CMMCControl() : CMMCControl
  • CMmStream() : CMmStream
  • CMmStreamBuf : CMmStream , CMmStreamBuf
  • CMmStreamConsecBuf() : CMmStreamConsecBuf
  • CModel() : CModel
  • CMonitor() : CMonitor
  • CMonitorServer() : CMonitorServer
  • CMoveDlg() : CMoveDlg
  • CMoveMoney() : CMoveMoney
  • cmsd : _MSDI
  • CMSMQEventHandler() : CMSMQEventHandler
  • CMSOmniProvRowset() : CMSOmniProvRowset
  • CMSOmniProvSession() : CMSOmniProvSession
  • CMultichanApp() : CMultichanApp
  • CMultipleResults() : CMultipleResults
  • CMultipleResultsDlg() : CMultipleResultsDlg
  • CMultiRecoApp() : CMultiRecoApp
  • CMultiValuedAttributeEditor() : CMultiValuedAttributeEditor
  • CMultiValuedListBox() : CMultiValuedListBox
  • CMyCapabilities() : CMyCapabilities
  • CMyEventProvider() : CMyEventProvider
  • CMyEvictListener() : CMyEvictListener
  • CMyInkCollector() : CMyInkCollector
  • CMyInkEvents() : CMyInkEvents
  • CMyMemberSetChangeListener() : CMyMemberSetChangeListener
  • CMySink() : CMySink
  • CMyStartupListener() : CMyStartupListener
  • cNames : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • CNewsEvent() : CNewsEvent
  • CNode() : CNode< TYPE >
  • cNodes : IAppletSessionVtbl
  • cNonCollapsedCaps : tagAppletSessionRequest
  • CNotify() : CNotify
  • CNullModem() : CNullModem
  • Cobj() : CExtObject
  • CObjConstSub() : CObjConstSub
  • CObjData() : CObjData
  • CObject() : CObject
  • CObjPool2Sub() : CObjPool2Sub
  • CObjPoolSub() : CObjPoolSub
  • CObjSecurity() : CObjSecurity
  • CObjSub() : CObjSub
  • CObjTree() : CObjTree
  • COBLIST() : COBLIST
  • CoCreateInstance() : CSmartPtr< T > , CSmartPtrTrace< T >
  • CODBCData() : CODBCData
  • COfficeDlg() : COfficeDlg
  • Col() : CGridIt
  • ColContaining() : CDataGrid
  • COleClient() : COleClient
  • COLEDBComponent() : COLEDBComponent
  • COleDocument : COleDocumentView , COleDocument
  • COleDocumentView : COleDocument , COleDocumentView
  • COleInPlaceActiveObject : COleDocument , COleDocumentView , CSimpSvrObj , COleInPlaceActiveObject
  • COleInPlaceObject : COleDocument , CSimpSvrObj , COleInPlaceObject
  • COleObject : COleDocument , CSimpSvrObj , COleObject
  • Collection : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • CollectResultRows() : CProxy
  • CollectUserInput() : CSimpleDialog
  • Color : CSharp_Draw::Form1
  • ColorHookProc : COleDocument
  • Colors : ICONIMAGE
  • ColumnChangeProc() : CMDIChild
  • ColWidth() : IComSpy
  • COMAdminAccessChecksApplicationComponentLevel : comadmin::COMAdminAccessChecksLevelOptions
  • COMAdminAccessChecksApplicationLevel : comadmin::COMAdminAccessChecksLevelOptions
  • COMAdminActivationInproc : comadmin::COMAdminActivationOptions
  • COMAdminActivationLocal : comadmin::COMAdminActivationOptions
  • COMAdminAuthenticationCall : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationCapabilitiesDynamicCloaking : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationCapabilitiesNone : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationCapabilitiesSecureReference : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationCapabilitiesStaticCloaking : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationConnect : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationDefault : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationIntegrity : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationNone : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationPacket : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationPrivacy : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminCompFlagAlreadyInstalled : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagCOMPlusPropertiesFound : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagInterfacesFound : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagNotInApplication : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagProxyFound : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagTypeInfoFound : comadmin::COMAdminComponentFlags
  • COMAdminErrAlreadyInstalled : comadmin::COMAdminErrorCodes
  • COMAdminErrAppDirNotFound : comadmin::COMAdminErrorCodes
  • COMAdminErrAppFileReadFail : comadmin::COMAdminErrorCodes
  • COMAdminErrAppFileVersion : comadmin::COMAdminErrorCodes
  • COMAdminErrAppFileWriteFail : comadmin::COMAdminErrorCodes
  • COMAdminErrApplicationExists : comadmin::COMAdminErrorCodes
  • COMAdminErrApplidMatchesClsid : comadmin::COMAdminErrorCodes
  • COMAdminErrAuthenticationLevel : comadmin::COMAdminErrorCodes
  • COMAdminErrBadPath : comadmin::COMAdminErrorCodes
  • COMAdminErrBadRegistryLibID : comadmin::COMAdminErrorCodes
  • COMAdminErrBadRegistryProgID : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotExportAppProxy : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotExportSystemApp : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotStartApp : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotSubscribeToComponent : comadmin::COMAdminErrorCodes
  • COMAdminErrCantCopyFile : comadmin::COMAdminErrorCodes
  • COMAdminErrCLSIDOrIIDMismatch : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileBadTLB : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileClassNotAvail : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileDoesNotExist : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileGetClassObj : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileLoadDLLFail : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileNoRegistrar : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileNotInstallable : comadmin::COMAdminErrorCodes
  • COMAdminErrCompMoveBadDest : comadmin::COMAdminErrorCodes
  • COMAdminErrCompMoveLocked : comadmin::COMAdminErrorCodes
  • COMAdminErrCoReqCompInstalled : comadmin::COMAdminErrorCodes
  • COMAdminErrDllLoadFailed : comadmin::COMAdminErrorCodes
  • COMAdminErrDllRegisterServer : comadmin::COMAdminErrorCodes
  • COMAdminErrInvalidUserids : comadmin::COMAdminErrorCodes
  • COMAdminErrKeyMissing : comadmin::COMAdminErrorCodes
  • COMAdminErrNoRegistryCLSID : comadmin::COMAdminErrorCodes
  • COMAdminErrNoServerShare : comadmin::COMAdminErrorCodes
  • COMAdminErrNotChangeable : comadmin::COMAdminErrorCodes
  • COMAdminErrNotDeletable : comadmin::COMAdminErrorCodes
  • COMAdminErrNotInRegistry : comadmin::COMAdminErrorCodes
  • COMAdminErrNoUser : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectDoesNotExist : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectErrors : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectExists : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectInvalid : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectNotPoolable : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectParentMissing : comadmin::COMAdminErrorCodes
  • COMAdminErrPropertyOverflow : comadmin::COMAdminErrorCodes
  • COMAdminErrPropertySaveFailed : comadmin::COMAdminErrorCodes
  • COMAdminErrQueuingServiceNotAvailable : comadmin::COMAdminErrorCodes
  • COMAdminErrRegFileCorrupt : comadmin::COMAdminErrorCodes
  • COMAdminErrRegisterTLB : comadmin::COMAdminErrorCodes
  • COMAdminErrRegistrarFailed : comadmin::COMAdminErrorCodes
  • COMAdminErrRemoteInterface : comadmin::COMAdminErrorCodes
  • COMAdminErrRequiresDifferentPlatform : comadmin::COMAdminErrorCodes
  • COMAdminErrRoleDoesNotExist : comadmin::COMAdminErrorCodes
  • COMAdminErrRoleExists : comadmin::COMAdminErrorCodes
  • COMAdminErrServiceNotInstalled : comadmin::COMAdminErrorCodes
  • COMAdminErrSession : comadmin::COMAdminErrorCodes
  • COMAdminErrStartAppNeedsComponents : comadmin::COMAdminErrorCodes
  • COMAdminErrSystemApp : comadmin::COMAdminErrorCodes
  • COMAdminErrUserPasswdNotValid : comadmin::COMAdminErrorCodes
  • COMAdminExportApplicationProxy : comadmin::COMAdminApplicationExportOptions
  • COMAdminExportForceOverwriteOfFiles : comadmin::COMAdminApplicationExportOptions
  • COMAdminExportNoUsers : comadmin::COMAdminApplicationExportOptions
  • COMAdminExportUsers : comadmin::COMAdminApplicationExportOptions
  • COMAdminFileFlagAlreadyInstalled : comadmin::COMAdminFileFlags
  • COMAdminFileFlagBadTLB : comadmin::COMAdminFileFlags
  • COMAdminFileFlagClassNotAvailable : comadmin::COMAdminFileFlags
  • COMAdminFileFlagCOM : comadmin::COMAdminFileFlags
  • COMAdminFileFlagContainsComp : comadmin::COMAdminFileFlags
  • COMAdminFileFlagContainsPS : comadmin::COMAdminFileFlags
  • COMAdminFileFlagContainsTLB : comadmin::COMAdminFileFlags
  • COMAdminFileFlagDLLRegsvrFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagDoesNotExist : comadmin::COMAdminFileFlags
  • COMAdminFileFlagError : comadmin::COMAdminFileFlags
  • COMAdminFileFlagGetClassObjFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagLoadable : comadmin::COMAdminFileFlags
  • COMAdminFileFlagNoRegistrar : comadmin::COMAdminFileFlags
  • COMAdminFileFlagRegistrar : comadmin::COMAdminFileFlags
  • COMAdminFileFlagRegistrarFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagRegTLBFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagSelfReg : comadmin::COMAdminFileFlags
  • COMAdminFileFlagSelfUnReg : comadmin::COMAdminFileFlags
  • COMAdminFileFlagUnloadableDLL : comadmin::COMAdminFileFlags
  • COMAdminImpersonationAnonymous : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminImpersonationDelegate : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminImpersonationIdentify : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminImpersonationImpersonate : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminInstallForceOverwriteOfFiles : comadmin::COMAdminApplicationInstallOptions
  • COMAdminInstallNoUsers : comadmin::COMAdminApplicationInstallOptions
  • COMAdminInstallUsers : comadmin::COMAdminApplicationInstallOptions
  • COMAdminOSWindows3_1 : comadmin::COMAdminOS
  • COMAdminOSWindows9x : comadmin::COMAdminOS
  • COMAdminOSWindowsNT : comadmin::COMAdminOS
  • COMAdminOSWindowsNTEnterprise : comadmin::COMAdminOS
  • COMAdminServiceContinuePending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceLoadBalanceRouter : comadmin::COMAdminServiceOptions
  • COMAdminServicePaused : comadmin::COMAdminServiceStatusOptions
  • COMAdminServicePausePending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceRunning : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceStartPending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceStopped : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceStopPending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceUnknownState : comadmin::COMAdminServiceStatusOptions
  • COMAdminSynchronizationIgnored : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationNone : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationRequired : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationRequiresNew : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationSupported : comadmin::COMAdminSynchronizationOptions
  • COMAdminThreadingModelApartment : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelBoth : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelFree : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelMain : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelNeutral : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelNotSpecified : comadmin::COMAdminThreadingModels
  • COMAdminTransactionIgnored : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionNone : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionRequired : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionRequiresNew : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionSupported : comadmin::COMAdminTransactionOptions
  • Command() : CStaticNode , CComponent , CDeviceNode , CStaticNode , CDeviceNode , CStaticNode , CBaseNode , CComponent , CController , CComponentData , CContextMenuExtension , CComponentData , CDeviceNode , CFolderNode , CExtendContextMenuEx , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CComponentData , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CComponentData , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CComponentData , CFolderNode , CStaticNode , CVirtualFile , CComponentData , AgentNotifySink , CAgentCtlCommandsEx , AgentNotifySink , Notify
  • CommandPersistProc() : CMDIChild
  • CommandText : _ConnectionVtbl
  • CommandType : tagCrmFilesCreateFileLogRecord , tagCrmFilesDeleteFileLogRecord
  • Commit() : CImpIStream , CSimpleObject , CCrmFilesTest , CStorageBuffer , CFileStream
  • CommitChanges() : CMgdResType , CStorageResType
  • CommitLimit : _VIRTUAL_BUFFER
  • CommitRecord() : CCrmDebugCompensator , CCrmFilesCompensator
  • CommitRecordVariants() : CCrmDebugCompensator
  • CommitTrans()
: msado15::Connection
, msado15::_Connection
, msado15::Connection15
  • CommitTransaction() : CByotTransObj
  • CommitTransactionProc() : CMDIChild
  • CommitTransComplete()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • CommonConstruct() : CBasePropertyPage
  • Compare() : CString , IRowsetScrollImpl< T, RowsetInterface > , COBLIST
  • CompareBookmarks()
: msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset
, msado15::Recordset21
  • CompareData() : CISeqStream
  • CompareIDs() : CShellFolder
  • CompareItems() : CShellFolder
  • CompareObjects() : CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • compareString() : MyOSPObject
  • CompletionKey : _JOB_INFO
  • CompletionPortHandle : _JOB_INFO
  • COMPONENT : CClassFactory
  • COMPONENTDATA : CClassFactory
  • components
: About
, InkHitTest::InkHitTest
, InkClipboard::InkClipboard
, Sample::UI::AboutBox
, NewsFlash
, NewsSubscriber
, CSharp_Draw::Form1
, CSharp_Draw::InputBox
, Sample::UI::MainWindow
, AutoClaims::AutoClaims
, InkBlog::InkArea
, InkCollection::InkCollection
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkErase::InkErase
, InkRecognition::InkRecognition
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
, Serialization::SerializationForm
, UDDI::Tools::CategoryTreeView
, WsdlDiscovery::frmMain
, CapJ
  • compopts : THREADARGS
  • ComposePhrase() : CSampleWordBreaker
  • ConcatCopy() : CString
  • Concatenate() : CPidlMgr
  • ConcatenateProperty() : CPropertyTag
  • ConcatInPlace() : CString
  • Conf() : Conf
  • ConferenceCreated() : CMgrNotify , Conf
  • ConfigDlgAddListViewItem() : CSettings
  • ConfigDlgDeleteListViewItem() : CSettings
  • ConfigPath : CacheProxySamplePlugin::CacheProxyPlugin
  • Configure() : CCertManagePolicyModuleSample , CCertManageExitModuleSample , CCertManagePolicyModuleSample
  • ConfigureDlgProc : CSettings
  • ConfigureTransport() : CSampleMSPStream
  • conn : CADVCGENDlg
  • Connect() : CNotify , CAppShareNotify , CNotify , CMgrNotify
  • connect() : DTHandler
  • Connect() : comadmin::COMAdminCatalog , comadmin::ICOMAdminCatalog , CDataSource , CTable , CS3Dialog , CContextSamplePropPage , CConfNotify , CDataNotify , CNotify , CMgrNotify , CConfNotify , CFtNotify , CMgrNotify , CConfNotify , CNotify , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , CNotify , CMgrNotify , CCallNotify , CConfNotify , CMgrNotify
  • ConnectComplete()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • ConnectExArgs : _WSAOVERLAPPEDPLUS
  • ConnectFromFile() : CServiceComp
  • Connection : UDDI::Tools::CategoryTreeView
  • connectionID : tphys_connect_info
  • ConnectionString : _ConnectionVtbl
  • connectorColor : InkClipboard::InkClipboard
  • connectorPen : InkClipboard::InkClipboard
  • ConnectRRAS() : RqsEngine
  • connectState : CSessionDlg
  • ConnectTerminal() : CSampleMSPStream
  • ConnectToTerminalPin() : CSampleMSPStream
  • connInfo : tagLINE_INFO
  • connStr : CADVCGENDlg
  • CONotify() : CONotify
  • const_cast() : IInkCollectorEventsImpl< T >
  • ConstantValueDef : _SIGGEN_DATA_DEFINITION
  • Construct() : CAccount , CUpdateReceipt , CLogFile , CProxy
  • ConstructData() : CPooledData
  • ConsumeAllMessages() : CBankDlg
  • ContainsInsensitive() : WsdlDiscovery::frmMain
  • ContentInfo() : CacheProxySamplePlugin::ContentInfo
  • ContentSize : CacheProxySamplePlugin::ContentInfo
  • ContentType : CacheProxySamplePlugin::ContentInfo
  • CONTEXTEXTENSION : CClassFactory
  • ContextFlags : _SEC_CONTEXT
  • ContextId : _SEC_CONTEXT
  • CONTEXTMENUX : CClassFactory
  • ContextSensitiveHelp() : CBrowserHost , CSimpleApp , CExplorerBar , CSpyCon , COleInPlaceActiveObject , COleInPlaceObject , CFrame , CImpIOleInPlaceSite , COleClient , CBrowserHost , CCommBand , CDeskBand , CToolBand , CShellView
  • ContextTypes() : IWMSContextAdmin
  • ControlbarNotify() : CComponent , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CToolBarExtension , CComponent , CVirtualFile , CComponent
  • ConvertIntToByteArray() : Sample::MySignedXml
  • ConvertSurfaceValue() : CBicycle
  • Cookies : _MultiSelectCookies
  • COpenQueueDialog() : COpenQueueDialog
  • COpState() : CProxyPlugin::COpState
  • COptionsAccessor() : COptionsAccessor
  • COptionsCommand() : COptionsCommand
  • COptionsDataSource() : COptionsDataSource
  • COptionsError() : COptionsError
  • COptionsNotify() : COptionsNotify
  • COptionsRowset() : COptionsRowset
  • COptionsSheet() : COptionsSheet
  • Copy() : CEnumConnections , CFastVariant , CEditBoxLite , CComWSTR , WiaWrap::CComPtrArray< T > , ISAPI_STRING , ISAPI_STRINGW , CPidlMgr , CEnumConnectionPoints , CVariant
  • CopyA() : ISAPI_STRINGW
  • CopyAccessors() : CImpIAccessor
  • CopyAndAddSid() : CSids
  • CopyAndRemoveItem() : CSids
  • CopyAToOffset() : ISAPI_STRINGW
  • CopyBeforeWrite() : CString
  • CopyData() : CTable
  • CopyEmptyProp() : CClusPropList
  • CopyExpandSzProp() : CClusPropList
  • CopyFileFullPath() : CSyncMgrHandler
  • CopyFiles() : CSyncMgrHandler
  • CopyFrom() : CComWSTR
  • CopyHandlerSyncInfo() : CSettings
  • CopyIndexes() : CTable
  • CopyInkToClipboard() : InkClipboard::InkClipboard
  • CopyItems() : CShellFolder
  • CopyMultiSzProp() : CClusPropList
  • CopyObjectToClip() : CSimpleDoc
  • CopyProp() : CClusPropList
  • CopyRecord()
: msado15::_Record
, msado15::Record
  • CopyrightLabel : Sample::UI::AboutBox
  • CopyrightMessage : Sample::Messages
  • CopySingleItem() : CPidlMgr
  • CopyTables() : CTableCopy
  • CopyTo() : CFileStream , CSimpleObject , CStorageBuffer , CImpIStream , msado15::_Stream , msado15::Stream
  • CopyToBuffer() : WiaWrap::CDataCallback
  • CopyToOffset() : ISAPI_STRINGW , ISAPI_STRING
  • CopyW() : ISAPI_STRING
  • CopyWToOffset() : ISAPI_STRING
  • COrder() : COrder
  • correspond : section
  • COShip() : COShip
  • COShip2() : COShip2
  • Cot() : CObjData , CExtObject , CBasePropertyPage , CExtObject , CBasePropertyPage , CObjData
  • count : FONTLIST , gss_OID_set_desc_struct
  • Count() : CDynamic , CEntity
  • count : CSessionDlg
  • Count() : CEnumStorageResource , CResultset
  • count : _MultiSelectCookies , CAPIDoc , CProcessDlg , CServerDlg
  • Count : _LSP_ENTRY , WiaWrap::CComPtrArray< T > , CStorageResource
  • counter : Cstack_c
  • CounterBlock : _SIGGEN_COUNTER , _APPMEM_COUNTERS
  • CountNumberOfFilesInList() : CSyncMgrHandler
  • CountUCSegments() : CFontRange
  • CPack() : CPack
  • CPage() : CPage
  • CPageFormat() : CPageFormat
  • CPaintCanvas() : CPaintCanvas
  • CParameters() : CParameters
  • CPartitionInfo() : CPartitionInfo
  • cpe : LOGPAL
  • CPeoplePoweredVehicle() : CPeoplePoweredVehicle
  • CPermEventsApp() : CPermEventsApp
  • CPermEventsDlg() : CPermEventsDlg
  • CPersistFile : CPersistStorage , CPersistFile
  • CPersistStorage : COleDocument , CPersistStorage , CSimpSvrObj
  • CPerson() : CPerson
  • CpfCurrentValueFormat() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList
  • CPidlMgr() : CPidlMgr
  • CPingResponder() : CPingResponder
  • CPlane() : CPlane
  • CPlgFilter() : CPlgFilter
  • CPlgPin : CPlgFilter , CPlgPin
  • CPlgTermSample() : CPlgTermSample
  • CPluggableTransport() : CPluggableTransport
  • CPoint() : CPoint
  • CPooledData() : CPooledData
  • CPop() : Cstack_c
  • CPower() : CPower
  • CPrintCanvas() : CPrintCanvas , CPrintRequest
  • CPrintRequest() : CPrintRequest , CPrintAux
  • CPrintSDIApp() : CPrintSDIApp
  • CPrintSDIDoc() : CPrintSDIDoc
  • CPrintSDIView() : CPrintSDIView
  • CProcessDlg() : CProcessDlg
  • CProgress() : CProgress
  • CProgressDlg() : WiaWrap::CProgressDlg
  • cProperties : _SECTION , _STANDARDSECINMEM
  • CProperties() : CProperties
  • CPropertiesBase() : CPropertiesBase
  • CPropertiesDlg() : CPropertiesDlg
  • CPropertyEditSession() : CPropertyEditSession
  • CPropertyIDs() : CPropertyIDs
  • CPropertyInfos() : CPropertyInfos
  • CPropertyPage() : CPropertyPage
  • CPropertyTag() : CPropertyTag
  • CPropIDSets() : CPropIDSets
  • CPropInfoSets() : CPropInfoSets
  • CPropPageLite() : CPropPageLite
  • CProppageUser() : CProppageUser
  • CProppageUserUI() : CProppageUserUI
  • CPropPro() : CPropPro
  • Cprops() : CBasePropertyPage , CClusPropList , CFileShareSampleParamsPage , CClusPropList , CBasePropertyPage , CClipBookServerParamsPage , CClusPropList
  • CPropSets() : CPropSets
  • CPropSheetExtension() : CPropSheetExtension
  • CPropSheetHost() : CPropSheetHost
  • CPropSheetLite() : CPropSheetLite
  • CProvFactory() : CProvFactory
  • CProvider() : CProvider
  • CProvider_IWbemEventConsumerProvider() : CProvider_IWbemEventConsumerProvider
  • CProvider_IWbemEventProvider() : CProvider_IWbemEventProvider
  • CProvider_IWbemServices() : CProvider_IWbemServices
  • CProvider_IWbemUnboundObjectSink() : CProvider_IWbemUnboundObjectSink
  • CProviderFactory() : CProviderFactory
  • CProxy() : CProxy
  • CProxyPlugin() : CProxyPlugin
  • CpsCurrentValueSyntax() : CClusPropList , CClusPropValueList , CClusPropList
  • CPSTN() : CPSTN
  • CptCurrentValueType() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • CPTLauncher() : CPTLauncher
  • CPush() : Cstack_c
  • CQCSub() : CQCSub
  • CQueryBox() : CQueryBox
  • CQueryDlg() : CQueryDlg
  • CQuickStringWrap() : CQuickStringWrap
  • cRanges : HTTP_REQUEST_PARAM
  • crColor : _BALLDATA
  • CRDOComponent() : CRDOComponent
  • Create() : CSimpleSite , CAsyncXXX< T, ISyncFace, IAsyncFace > , CDbAlloc , CSimpleDoc , CDataXferObj , CDataGrid , CServiceComp , CWndLite , CStatusBarLite , CXmlDOM , CDlgSrc , CServiceCallback , CPlex , CBaseDialog , CPlex , CStorageResource , CSite , CStdDbOutput , CEnumXXX< T, ELT_T, IFACE > , CSimpleDoc , CDataGrid , CMDIChildLite , CFrameWndLite , CController , CFont , CDlgDest , CBaseDialog , CPlex , CRecoOutputWnd , CBaseDialog , CPidlMgr , CAgentCtlEx , CBaseDialog , CDeviceFinderCallback , CDataLinks , CToolBarLite , CPlex , CAgentCtlEx , CPlex , CEnumerator , CSimpSvrDoc , CSimpleSite
  • CreateAcceptSocket() : CX224
  • CreateAccessor() : CImpIAccessor , CDataAccess
  • CreateAccessorProc() : CMDIChild
  • CreateAccessors() : CDataAccess , CTable
  • CreateAccount() : ICreateTable , CCreateTable
  • CreateArrayOfEvents() : CDBAuthPlugin , CContextPlugin
  • CreateAuthenticationContext() : CAuthenticatePlugin
  • CreateBinder() : CBinder
  • CreateCacheItemCollection() : CacheProxySamplePlugin::CacheProxyPlugin , CProxyPlugin
  • CreateCacheTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • CreateCall()
: fullsvr::FullServ
, fullsvr::ICallFactory
, CFullServ
  • CreateCatalog() : CVCExploreDlg
  • CreateChildWindows() : CAdvRecoApp , CMultiRecoApp
  • CreateClassEnum() : CProvider_IWbemServices , CInstPro , CMethodPro , CClassPro
  • CreateClassEnumAsync() : CProvider_IWbemServices , CClassPro , CInstPro , CMethodPro
  • CreateColInfo() : CMSOmniProvRowset
  • CreateCommand() : CRow , CImpIDBCreateCommand , CSession
  • CreateCompensator() : CCrmMonComp
  • CreateComponent() : CComponentData
  • CreateComPort() : CPSTN
  • CreateConnection() : CPluggableTransport , IPluggableTransport
  • CreateConnectSocket() : CX224
  • created : _LOCKED_LIST
  • CreateDataSourceDirectory() : CSDKSampleStorageSystem
  • CreateDBInstance() : CServiceComp
  • CreateDefaultRow() : CRow
  • CreateDirFileListFromPath() : CSyncMgrHandler
  • CreateDlg() : CDialogLite
  • CreateEnumChild() : CMDIChild
  • CreateEnumInfo() : CEnumerator
  • CreateEnumList() : CEnumIDList
  • CreateFile() : COleDocument , CCrmFilesWorker , CCrmFilesTest
  • CreateFilter() : CPlgTermSample
  • CreateFolderPidl() : CPidlMgr
  • CreateFont() : CModel
  • CreateFQPidl() : CShellFolder
  • CreateGif() : InkBlog::AddBlog
  • CreateHelperFunctions() : CRowset
  • CreateHFontFromIFont() : CComSpy
  • CreateHRow() : IRowsetChangeImpl< T, Storage, RowClass >
  • CreateHtm() : InkBlog::AddBlog
  • CreateIndexProc() : CMDIChild
  • CreateIndirect() : CWndLite
  • CreateInkCollectionSurface() : InkBlog::InkArea
  • CreateInstance() : CServer , CFactory , CClassFactoryWrapper , CClassFactory , CCallAsFactory , CHelloClassFactory , CEnlistTransaction , CClassFactory , CCaseTextService , CClassFactory , CFVClassFactory , CClassFactory , CProvFactory , CSmpFilterCF , CClassFactory , CProvFactory , CClassFactory , CBackgroundCopyCallback , HtmlPropIFilterCF , CClassFactory , CFactory , CClassFactory , CProvFactory , CClassFactory , CProvFactory , CClassFactory , Provider_Globals , CClassFactory , CFactory , CClassFactory , MyClassFactory , CEnumerator , CClassFactory , CFactoryData , CClassFactory , CLanguageResourceSampleCF , Provider_Globals , CHtmlIFilterCF , CClassFactory , CMarkTextService , CShellExtClassFactory
  • CreateInstanceEnum() : CMethodPro , CClassPro , CInstPro , CProvider_IWbemServices
  • CreateInstanceEnumAsync() : CMethodPro , CInstPro , CProvider_IWbemServices , CClassPro
  • CreateInstanceEnumAsync_Contacts() : CProvider_IWbemServices
  • CreateInstanceEnumAsync_Process() : CProvider_IWbemServices
  • CreateItemPidl() : CPidlMgr
  • CreateList() : CShellView
  • CreateListenSocket() : CX224
  • CreateMSPCall() : CSampleMSP
  • CreateObject() : CSimpSvrDoc , CFrame , CBase
  • CreateParamAccessor() : CCommand
  • CreateParameter()
: msado15::Command
, msado15::_Command
, msado15::Command15
  • CreatePin() : CPlgFilter
  • CreatePlaylistParser() : CSDKSamplePlaylistParserPlugin
  • CreatePlaylistTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • CreatePropertyPages() : CComponent , CDeviceNode , CRocket , CStaticNode , CPropSheetExtension , CRocket , CBicycle , CComponentData , CStaticNode , CComponent , CVirtualFile , CExtendPropertySheet , CDelegationBase , CBaseNode , CComponentData , CComponent , CRocket , CFolderNode , CDeviceNode , CDelegationBase , CComponent , CVirtualFile , CStaticNode , CComponentData , CDelegationBase , CComponentData , CBaseNode , CComponent , CRocket
  • CreatePropertySheetPages() : CExtObject
  • CreatePropertyStore() : CMarkTextService
  • CreateProviderInstance() : CFullConnect
  • CreateRecoContext() : CMultiRecoApp
  • CreateRecoGuides() : CMultiRecoApp
  • CreateRecord() : IRowsetChangeImpl< T, Storage, RowClass >
  • CreateRefreshableEnum() : CHiPerfProvider
  • CreateRefreshableObject() : CHiPerfProvider
  • CreateRefresher() : CHiPerfProvider
  • CreateResource() : CLDisp
  • CreateResourceFile() : CGenerateRC
  • CreateReverseProxyTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • CreateRow() : CImpICreateRow
  • CreateSession() : CDataSource , CImpIDBCreateSession
  • CreateSQLStmt() : CTable
  • CreateStorage() : CSite
  • CreateStream() : CSampleMSPCall
  • CreateStreamObject() : CSampleMSPCall
  • CreateStreams() : CPersistStorage
  • CreateTable() : CTable
  • CreateTableNode() : CS1Dialog
  • CreateTableProc() : CMDIChild
  • CreateToolbar() : CBrowserHost
  • CreateView() : COleDocument
  • CreateViewObject() : CShellFolder
  • CreateViewWindow() : COleDocumentView , CShellView
  • CreateWizardPages() : CExtObject
  • CreateWorkerThread() : CSyncMgrHandler
  • CReceiveMessageDialog() : CReceiveMessageDialog
  • CReceiveWaitDialog() : CReceiveWaitDialog
  • CRecoOutputWnd() : CRecoOutputWnd
  • cRecords : tagAppletRoster
  • CredentialId : _CREDENTIAL , _SEC_CONTEXT
  • cRef : CDefClassFactory , tagINTERFACEIMPL , tagACCESSOR
  • CRefClient() : CRefClient
  • CRefCount() : CRefCount
  • CRefresher() : CRefresher
  • CRefresherMember() : CRefresherMember< T >
  • cRefs : CCriticalSection , CLock
  • CRegAccess() : CRegAccess
  • CReindeer() : CReindeer
  • CRenameDlg() : CRenameDlg
  • CRequestInstance() : CRequestInstance
  • CResourceSub() : CResourceSub
  • CResString() : CResString
  • cRestrictions : _SCHEMAINFO
  • CResultset() : CResultset
  • CRichEditLite() : CRichEditLite
  • Criteria : _RecordsetVtbl
  • CriticalSection : _WORK_QUEUE
  • crm_Total : CCrmFilesTest
  • crm_VB : CCrmFilesTest
  • crm_VC : CCrmFilesTest
  • crm_VJ : CCrmFilesTest
  • CRocket() : CRocket
  • cRosters : IAppletSessionNotifyVtbl
  • CRow() : CRow , CRowset , CRow
  • CRowPosition() : CRowPosition
  • CRowset : CImpIAccessor , CRowset
  • CRowsetViewerDlg() : CRowsetViewerDlg
  • CRTCAVSession() : CRTCAVSession
  • CRTCEvents() : CRTCEvents
  • CRTCIMSession() : CRTCIMSession
  • CRTCIncomingApp() : CRTCIncomingApp
  • CRTCIncomingDlg() : CRTCIncomingDlg
  • CRTCOutgoingApp() : CRTCOutgoingApp
  • CRTCOutgoingDlg() : CRTCOutgoingDlg
  • CRTCSession() : CRTCSession
  • CRTCWin : CRTCSession , CRTCAVSession , CRTCWin
  • CS : CSampleInstance
  • cs : _DEVICE_INFO
  • CS1Dialog() : CS1Dialog
  • CS2Dialog() : CS2Dialog
  • CS3Dialog() : CS3Dialog
  • CS4Dialog() : CS4Dialog
  • CSAFEARRAY() : CSAFEARRAY
  • CSafeRefCount() : CSafeRefCount
  • CSampleDataContainer() : CSampleDataContainer
  • CSampleDataSource() : CSampleDataSource
  • CSampleDirectory : CSampleDirectoryInfo , CSampleDirectory
  • CSampleDirectoryInfo() : CSampleDirectoryInfo
  • CSampleInstance() : CSampleInstance
  • CSampleMSP() : CSampleMSP
  • CSampleMSPCall() : CSampleMSPCall
  • CSampleMSPStream() : CSampleMSPStream
  • CSamplePipe() : CSamplePipe
  • CSampleStemmer() : CSampleStemmer
  • CSampleWordBreaker() : CSampleWordBreaker
  • CSchemaDlg() : CSchemaDlg
  • CSCP() : CSCP
  • CSCPCMenuDialog() : CSCPCMenuDialog
  • CSCPPageBindingInfo() : CSCPPageBindingInfo
  • CSCPPageGeneral() : CSCPPageGeneral
  • CSCPPageKeywords() : CSCPPageKeywords
  • CSCPUIBindingInfo() : CSCPUIBindingInfo
  • CSCPUIGeneral() : CSCPUIGeneral
  • CSCPUIKeywords() : CSCPUIKeywords
  • CSCPWiz() : CSCPWiz
  • CScreenCanvas() : CScreenCanvas
  • CScriptTag() : CScriptTag
  • CScrollableView() : CScrollableView
  • CScrollBarLite() : CScrollBarLite
  • CSDKSamplePlaylistParser() : CSDKSamplePlaylistParser
  • CSDKSamplePlaylistParserPlugin() : CSDKSamplePlaylistParserPlugin
  • CSDKSampleStorageSystem() : CSDKSampleStorageSystem
  • cSections : _RSUMINFO , _SUMMARYINFO
  • CSecureObject() : CSecureObject
  • CSecuritySub() : CSecuritySub
  • CSelectEventsDlg() : CSelectEventsDlg
  • CSendMessageDialog() : CSendMessageDialog
  • CSerialStream() : CSerialStream
  • CServer() : CServer
  • CServerDlg() : CServerDlg
  • CServiceCallback() : CServiceCallback
  • CServiceComp() : CServiceComp
  • CSession() : CSession
  • CSessionDlg() : CSessionDlg
  • CSettings() : CSettings
  • CShellExt() : CShellExt
  • CShellExtClassFactory() : CShellExtClassFactory
  • CShellFolder : CShellView , CShellFolder
  • CShellIconOverlayID() : CShellIconOverlayID
  • CShellView : CShellFolder , CShellView
  • CShutdownDlg() : CShutdownDlg
  • CSI : _JOB_INFO
  • CSids() : CSids
  • CSimple() : CSimple
  • CSimpleApp() : CSimpleApp
  • CSimpleArray() : CSimpleArray< T >
  • CSimpleClass() : CSimpleClass
  • CSimpleDialog() : CSimpleDialog
  • CSimpleDoc() : CSimpleDoc
  • CSimpleObject() : CSimpleObject
  • CSimpleSite() : CSimpleSite
  • CSimpSvrApp() : CSimpSvrApp
  • CSimpSvrDoc() : CSimpSvrDoc
  • CSimpSvrObj() : CSimpSvrObj
  • CSite() : CSite
  • cSize : _stringstruct
  • CSkateboard() : CSkateboard
  • CSkateboardFolder() : CSkateboardFolder
  • CSkyBasedVehicle() : CSkyBasedVehicle
  • CSkyVehicle() : CSkyVehicle
  • cslot : tagSLOT
  • CSmartComPtr() : CSmartComPtr< T >
  • CSmartPtr() : CSmartPtr< T >
  • CSmpFilter() : CSmpFilter
  • CSmpFilterCF() : CSmpFilterCF , CSmpFilter
  • CSnap() : CSnap
  • CSnapinAbout() : CSnapinAbout
  • CSnoopWnd() : CSnoopWnd
  • CSpaceFolder() : CSpaceFolder
  • CSpaceStation() : CSpaceStation , CRocket
  • CSpaceVehicle() : CSpaceVehicle
  • CSpecialCharHashEntry() : CSpecialCharHashEntry
  • CSpecialCharHashTable() : CSpecialCharHashTable
  • CSplitterLite() : CSplitterLite
  • CSpyCon() : CSpyCon
  • csSync : CDimmerService , UPNPDimmerService
  • CStabilize() : CStabilize
  • Cstack_c() : Cstack_c
  • CStartOfFileElement() : CStartOfFileElement
  • CSTATest() : CSTATest
  • cStaticChannels : tagAppletSessionRequest
  • CStaticMap() : CStaticMap
  • CStaticNode() : CStaticNode
  • CStatusBarLite() : CStatusBarLite
  • CStatusHelper() : CStatusHelper
  • CStdDbOutput() : CStdDbOutput
  • CStorageBuffer() : CStorageBuffer
  • CStorageResource() : CStorageResource
  • CStorageResType() : CStorageResType
  • CStream : CRow , CStream
  • cStreamName : _STREAM_FIND_DATA
  • CString() : CString
  • CStringException() : CStringException
  • CStringTable() : CStringTable
  • CSurrogate : CClassFactoryWrapper , CSurrogate
  • CSyncMgrHandler() : CSyncMgrHandler
  • CSysLCESub() : CSysLCESub
  • CTable() : CTable
  • CTableCopy() : CTableCopy
  • CTabLite() : CTabLite
  • CTAPIEventNotification() : CTAPIEventNotification
  • cTempoMap : tag_smf
  • cTempoMapAlloc : tag_smf
  • CTerminateCompositionEditSession() : CTerminateCompositionEditSession
  • CTestApp() : CTestApp
  • CTestCOMPerformance() : CTestCOMPerformance
  • CTestDlg() : CTestDlg
  • CTestDoc() : CTestDoc
  • CTestView() : CTestView
  • CTextElement() : CTextElement
  • CTextField() : CTextField
  • CTextGrid : CFontRange , CTextGrid
  • CThreadData() : CThreadData
  • CThreadSub() : CThreadSub
  • CThumbNailPhotoHolder() : CThumbNailPhotoHolder
  • CTIMER() : CTIMER
  • CTitleTag() : CTitleTag
  • CtlColor() : CDrawArea
  • CToolBand() : CToolBand
  • CToolBarExtension() : CToolBarExtension
  • CToolBarLite() : CToolBarLite
  • CTransaction() : CTransaction
  • CTransactionOptions() : CTransactionOptions
  • CTreeViewLite() : CTreeViewLite
  • cTrk : tag_seq
  • CTSFDataObject() : CTSFDataObject
  • CTSFEditWnd() : CTSFEditWnd
  • CTSFMainWnd() : CTSFMainWnd
  • CTSFPersistentPropertyLoader() : CTSFPersistentPropertyLoader
  • CTxSub() : CTxSub
  • CTypesDialog() : CTypesDialog
  • CUnknown() : CUnknown
  • CUnknown::Quit : CFactory
  • CUpdateReceipt() : CUpdateReceipt
  • CUpdateTextEditSession() : CUpdateTextEditSession , CSnoopWnd
  • curdir : direct
  • CUrlmonCallback() : CUrlmonCallback
  • Current : NIDequeIter_c< T >
  • CurrentExtendedSize : tReq
  • CurrentOutput : _SEARCH_REQUEST_STATE
  • CurrentUser : storesh::Storesh
  • CursorButtonDown() : InkCollectorEvents
  • CursorButtonUp() : InkCollectorEvents
  • CursorDown() : InkCollectorEvents
  • CursorInRange() : InkCollectorEvents
  • CursorOptions : _RecordsetVtbl
  • CursorOutOfRange() : InkCollectorEvents
  • CursorType : _RecordsetVtbl
  • cUsers : tagAppletChannelRequest
  • CUserSub() : CUserSub
  • customDynamicRendererGraphics : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • CustomDynamicRendererPlugin() : RealTimeStylusPlugins::CustomDynamicRendererPlugin
  • customerID
: qcship::Ship
, qcorder::Order
, qcnotify::Notify
  • CustomStylusDataAdded()
: RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • Cut() : CEditBoxLite
  • CUtil() : CUtil
  • CUtilBSTR() : CUtilBSTR
  • CUtilComPtr() : CUtilComPtr< T >
  • CUtilitiesDlg() : CUtilitiesDlg
  • CUtilProp() : CUtilProp
  • CUtilString() : CUtilString
  • CVARIANT() : CVARIANT
  • CVariant() : CVariant
  • CVARIANT() : CVARIANT
  • CVCExploreApp() : CVCExploreApp
  • CVCExploreDlg() : CVCExploreDlg
  • CVCSecuritySampleClass() : CVCSecuritySampleClass
  • CVector() : CVector< TYPE, IDX >
  • CVectorEx() : CVectorEx< TYPE, IDX >
  • CView() : CView
  • CViewList() : CViewList
  • CVirtualFile() : CVirtualFile
  • CWaitCursor() : CWaitCursor
  • CWaitDlg() : CWaitDlg
  • CWaitSystemDlg() : CWaitSystemDlg
  • CWbemClientApp() : CWbemClientApp
  • CWbemClientDlg() : CWbemClientDlg
  • cwcAtATime : CSampleWordBreaker
  • CWebBrowser() : CWebBrowser
  • CWiaDataCallback() : CWiaDataCallback
  • CWinApp() : CWinApp
  • CWindow() : CWindow
  • CWizard() : CWizard
  • CWizExtUser : CExtPageUser , CWizExtUser
  • CWndLite() : CWndLite
  • CWorkerThread() : CWorkerThread
  • CWrapVBComponent() : CWrapVBComponent
  • cwWorkerThread : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • Cx() : CGridIt
  • CX224() : CX224
  • cxButton : tagTOOLDISPLAYDATA
  • cxImage : tagTOOLDISPLAYDATA
  • CXmlDOM() : CXmlDOM
  • CXMLTreeApp() : CXMLTreeApp
  • CXMLTreeDlg() : CXMLTreeDlg
  • cxWidth : tagOPTIONS
  • Cy() : CGridIt
  • cyBar : tagTOOLDISPLAYDATA
  • cyButton : tagTOOLDISPLAYDATA
  • cyHeight : tagOPTIONS
  • cyImage : tagTOOLDISPLAYDATA
  • cySpace : tagArFonts
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- d -

  • d_acctBalance : CAccount
  • DAdvise() : CDataObject , CDropObject , CDataObject , CTSFDataObject , CDataObject , CPropSheetHost , CDataObject , CDataXferObj , CDataObject
  • Data : item_tag , FieldVtbl , NILNode_c< T > , IAppletSessionNotifyVtbl
  • data : treeitem , CAsyncTest::threadParam , tagDataStruct , CLListImpl< TYPE, ARG_TYPE >::CNode , CPlex , CStringData , CPlex
  • DATA_AVAILABLE : ASYNC_REQUESTER
  • DATA_EXHAUSTED : ASYNC_REQUESTER
  • DatabasePath : CacheProxySamplePlugin::CacheProxyPlugin
  • DataBuf : _socklist
  • DataInterest
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • DataReceived() : CDataNotify
  • DataRefresh() : CADVCGENDlg
  • dataRs : CADVCGENDlg
  • DataSent() : CDataNotify
  • DataSize : _ITEM_DESC
  • dataSize : _DATA_BUFFER
  • date : _SFFS , tagDataStruct
  • dateVariable : _SFFS
  • day : _DOSDTTM
  • DblClick() : InkCollectorEvents , AgentNotifySink , Notify
  • dblVal : VTUNION
  • dbType : SPropertyEntry
  • Deactivate() : CCrmFilesWorker , COMPlus , CProxy , CPropertyPage , CEmptyVolumeCache , CCaseTextService , CMarkTextService
  • DeactivateAndUndo() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • DeactivateData() : CODBCData , CPooledData
  • DeactivateInPlace() : COleDocument , COleDocumentView
  • DeactivateUI() : COleDocument , COleDocumentView , CSimpSvrObj
  • DeAlloc() : CLDisp
  • DebugErrorLevel : PROFILE_STRUCT
  • DebuggeePriority : PROFILE_STRUCT
  • DebugMode : PROFILE_STRUCT
  • DECLARE_AGGREGATABLE() : CCallBack
  • DECLARE_CLASSFACTORY_SINGLETON() : CLDisp
  • DECLARE_FIXED_ALLOC() : CEntity , CStaticEntity , tagFieldMetaData , CString , CFastVariant
  • DECLARE_GET_CONTROLLING_UNKNOWN() : CCallBack
  • DECLARE_IUNKNOWN : CPlgPin
  • DECLARE_PROTECT_FINAL_CONSTRUCT() : CLDisp
  • DECLARE_REGISTRY() : CCertExitSample , CCertPolicySample , CPower , CSimple , CExtObject
  • DECLARE_REGISTRY_CLSID() : CSCP , CSCPWiz , CProppageUser , CWizExtUser
  • DeclareIEAPProviderConfigMembers() : CEapCfg
  • DecrementCountChildSpaceStations() : CSpaceStation
  • DecrementNestCount() : CSafeRefCount
  • DecrementOpenRowsets() : CCommand
  • DefaultCharacterChange() : AgentNotifySink , Notify
  • DefaultVal : tagDescInfo
  • DEFINE_ADDREF_RELEASE : CPropertyPage
  • DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR() : CImpIAccessor , CImpIBindResource , CImpICreateRow , CImpIDBBinderProperties , CImpICommandText , CImpICommandProperties , CImpIDBInitialize , CImpIDBCreateSession , CImpIDBProperties , CImpIDBInfo , CImpIPersist , CImpIServiceProvider , CImpIGetDataSource , CImpIOpenRowset , CImpISessionProperties , CImpIDBCreateCommand , CImpIRow , CImpIGetSession , CImpIRowChange , CImpIRowset , CImpIRowsetChange , CImpIColumnsInfo , CImpIRowsetInfo , CImpIRowsetIdentity , CImpIConvertType , CImpIGetRow , CImpIGetSourceRow , CImpIStream
  • DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA() : CImpIDBCreateCommand
  • delay : _ClientContext
  • Delete()
: msado15::_DynaCollection
, msado15::_Recordset
, msado15::Fields
, msado15::Fields20
, msado15::Parameters
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
, CMemoryException
, CPidlMgr
  • DeleteAllItems() : CListViewLite , CTreeViewLite , CTabLite
  • DeleteChildItems() : CDeviceNode
  • DeleteClass() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • DeleteClassAsync() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • DeleteColumn() : CListViewLite
  • DeleteDataContainer() : CSDKSampleStorageSystem
  • DeleteDirectory() : CSDKSampleStorageSystem
  • DeleteEntity() : CResultset
  • DeleteFile() : CCrmFilesWorker , CCrmFilesTest
  • DeleteInstance() : CClassPro , CProvider_IWbemServices , CReindeer , CInstPro , CMethodPro
  • DeleteInstanceAsync() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • DeleteItem() : CListViewLite , CTreeViewLite , CTabLite , CShellView
  • DeleteItems() : CShellFolder
  • DeleteItemSettings() : CSettings
  • DeleteList() : CEnumIDList , CViewList
  • DeleteLogError() : CCallbackWrapper
  • DeleteLogErrorMsg : _tagMETHODARGS
  • DeletePropList() : CClusPropList
  • DeleteRecord()
: msado15::_Record
, msado15::Record
  • DeleteRow() : CFileIdx , CFileIO
  • DeleteRowImmediate() : CDBFile
  • deleteRows() : MyOSPObject
  • DeleteRows() : IRowsetChangeImpl< T, Storage, RowClass > , CImpIRowsetChange
  • DeleteScopeItems() : CStaticNode
  • DeleteSelectedRows() : CMDIChild
  • DeleteString() : CListBoxLite , CComboBoxLite
  • DeleteThisObject() : CGenericEnum , CEnumSyncMgrItems
  • DeleteValueList() : CClusPropValueList
  • delims : compitem
  • DelInst() : CDbAlloc
  • DeliverClient() : CRTCAVSession , CRTCSession
  • DeliverIntensity() : CRTCAVSession , CRTCSession
  • DeliverMedia() : CRTCAVSession , CRTCSession
  • DeliverMessage() : CRTCSession , CRTCIMSession
  • DeliverParticipantState() : CRTCSession
  • DeliverSessionState() : CRTCSession
  • DeliverUserStatus() : CRTCIMSession , CRTCSession
  • DemoTitle : Sample::Messages
  • Depth : _ENUMERATE_DIRECTORY_STATE
  • DeregisterForConnectionNotification() : RqsEngine
  • Description : RealTimeStylusPluginApp::PluginListItem
  • descriptionDoc : UPNPDimmerDevice , CDimmer
  • dest_portno : udp_hdr , tpc_hdr , port_hdr
  • Destroy() : CSite , CProgress , CDialogBase , CController , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • destroy() : RSProxy , HelloJ , Hello2J , Hello3J
  • DestroyCatalog() : CVCExploreDlg
  • DestroyDocs() : CSimpleApp
  • DestroyPrevStep() : CWizard
  • DestroyResource() : CLDisp
  • DestroyResourceS() : CLDisp
  • DestroyViewWindow() : CShellView
  • DestroyWindow() : CWndLite
  • Detach() : CFastVariant , CComWSTR , CVariant , CVector< TYPE, IDX > , CProperties , CPropertyInfos , CPropertyIDs , CUtilComPtr< T > , CGrid , CBehavior
  • DetachAnnotator() : CAnnotator , IAnnotator
  • DetermineUnicode() : CFileLite
  • DeviceAdded() : CDeviceFinderCallback
  • DeviceId : _DEVICE_INFO
  • DeviceNodeWndProc() : CDeviceNode
  • DeviceRemoved() : CDeviceFinderCallback
  • DialogProc() : CPropertyPage , WiaWrap::CProgressDlg , CRocket , CStaticNode , CPropSheetExtension , CRocket , CBicycle , CRocket
  • DIID__IInkCollectorEvents : IInkCollectorEventsImpl< T >
  • dimLevel() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • dimnessLevel : UPNPDimmerService , CDimmerService
  • dir1 : _tagHANDLERITEMSETTINGS , _tagSAMPLEITEMSETTINGS
  • dir2 : _tagHANDLERITEMSETTINGS , _tagSAMPLEITEMSETTINGS
  • direct : diritem
  • Direction : _CommandVtbl
  • Directory : _DEVICE_INFO
  • directPersisRB : NewsSubscriber
  • directs : direct
  • directTransRB : NewsSubscriber
  • diritem : filedata
  • diritems : direct
  • DisableInsertObject() : CSimpleDoc
  • DisablePlugin() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • DisableWinsock() : IPluggableTransport , CPluggableTransport
  • DisassembleMenus() : CSimpSvrObj
  • DiscardUndoState() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • Disconnect() : msado15::ConnectionEvents , msado15::ConnectionEventsVt , CDataSource , CMgrNotify , CConfNotify , CDataNotify , CNotify , CMgrNotify , CConfNotify , CFtNotify , CNotify , CMgrNotify , CConfNotify , CNotify , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , CNotify , CMgrNotify , CAppShareNotify , CCallNotify , CConfNotify , CMgrNotify , CNotify
  • DisconnectExArgs : _WSAOVERLAPPEDPLUS
  • DisconnectObject() : CClassFactoryWrapper , CDynamic , CEntity , CResultset
  • diskQuota : PersistedConfiguration
  • DiskQuota : CachePluginAdmin
  • dispatch() : DTHandler
  • DISPID_CEGesture : IInkCollectorEventsImpl< T >
  • dispIdMember : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • Display() : CFullConnect , CSchemaDlg , CProgress , CDialogBase , CS1Dialog , CS2Dialog , CS3Dialog , CS4Dialog , CTypesDialog , CWizard , Query
  • DisplayACE() : CDlgIADsSecurityDescriptor
  • DisplayAceObjectType() : CDlgIADsSecurityDescriptor
  • DisplayBrowseEnumInfo() : CFullConnect
  • DisplayCertificate() : storesh::Storesh
  • displayChain() : Sample::Sample
  • DisplayChildren() : CBicycleFolder
  • DisplayColumnInfo() : CDataGrid
  • DisplayData() : CDataGrid
  • DisplayDialog() : CMainWindow , CMDIChild
  • DisplayEKU() : storesh::Storesh
  • DisplayEvents() : CAdvClientDlg
  • DisplayFetchPosition() : CDataGrid
  • DisplayFileNames() : CDropTarget
  • displayHelp() : Sample::Sample
  • DisplayHelp() : storesh::Storesh
  • DisplayMessageBox() : CComponent
  • DisplayObject() : CBase , CDataset , CRow , CRowset , CStream
  • DisplayOpenedQueuePathNameArray() : CMainFrame
  • DisplayOwnedEntities() : Microsoft::Uddi::Demo::Publish
  • DisplayPathNameArray() : CMainFrame
  • DisplayProperties() : CPropertiesDlg
  • DisplayProperty() : CPropertiesDlg
  • DisplayPropertyValue() : CVCExploreDlg
  • DisplayRows() : CDataGrid
  • DisplaySetPropsError() : CBasePropertyPage
  • DisplayStep() : CWizard
  • DisplayTaxonomy() : Microsoft::Uddi::Demo::Publish
  • DisplayTaxonomyItems() : Microsoft::Uddi::Demo::Publish
  • DisplayTree() : CSchemaDlg
  • Dispose()
: InkCollection::InkCollection
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkErase::InkErase
, InkHitTest::InkHitTest
, InkRecognition::InkRecognition
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
, Serialization::SerializationForm
, UDDI::Tools::CategoryTreeView
  • dispose() : NewsFlash , NewsSubscriber , About
  • Dispose() : WsdlDiscovery::frmMain
  • dispose() : CapJ
  • Dispose()
: AutoClaims::AutoClaims
, InkClipboard::InkClipboard
, CSharp_Draw::Form1
, CSharp_Draw::InputBox
, Sample::UI::AboutBox
, AutoClaims::AutoClaims
, InkBlog::InkArea
  • DisposeResources()
: AutoClaims::AutoClaims
, InkBlog::InkArea
  • Distance() : CBehavior
  • Divide() : CCustomPropertyStore
  • DivideInk() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • dLastValue : _CounterInfoBlock
  • dLevel : IUPnPService_DimmingService_SCPDVtbl
  • DlgProc() : CProgress , CS1Dialog , CS2Dialog , CS4Dialog , CTypesDialog , CBaseDialog , CSimpleDialog , AboutDlg , CS3Dialog , CBaseDialog , CDialogLite
  • DllDebugInfo : DEB_DLL_NODE_INFO_STRUCT
  • DllGetClassObject : CHtmlIFilterCF , CLanguageResourceSampleCF , CSmpFilterCF , HtmlPropIFilterCF
  • dllPathLB : NewsSubscriber
  • dllPathTF : NewsSubscriber
  • dlsDynamicLocksStore : _CONFIGURATION_ENTRY
  • DoAddBuddy() : CRTCWin
  • DoAPing() : CClientApp
  • DoAuth() : CRTCWin
  • DoCall() : CRTCWin
  • DoConnect() : CNullModem
  • DoContextMenu() : CShellView
  • DoCopyOrCut() : CContextMenu
  • DoDataContainerExtendedCommand() : CSampleDataContainer
  • DoDataExchange() : CAppExportDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CUtilitiesDlg , CAboutDlg , CVCExploreDlg , CAboutDlg , CADVCGENDlg , CDlgDest , CDlgSrc , CADQIDlg , CDlgIADs , CGetInfoExDlg , CRenameDlg , CMoveDlg , CDlgIADsLargeInteger , CDlgIADsPropertyList , CDlgIDirectoryObject , CDeleteObjectDlg , CDlgIADsSecurityDescriptor , FaxDlg , NewDocDlg , CAboutDlg , CDisdrawDlg , CLoginDlg , CImp_DrawDlg , CCloseQueueDialog , CCreateQueueDialog , CDeleteQueueDialog , CAboutDlg , COpenQueueDialog , CReceiveMessageDialog , CSendMessageDialog , CConnectDlg , CDisdrawDlg , CLoginDlg , CAboutDlg , CRTCIncomingDlg , CAboutDlg , CDeviceProp , CAboutDlg , CGenericUCPDlg , CAdvClientDlg , COfficeDlg , CAboutDlg , CPermEventsDlg , CAboutDlg , CWbemClientDlg , CAboutDlg , CCapMFCDlg , CAboutDlg , CBasePropertyPage , CClipBookServerParamsPage , CBasePropertyPage , CAboutDlg , CMessageDlg , CProcessDlg , CServerDlg , CSessionDlg , CShutdownDlg , CWaitDlg , CWaitSystemDlg , CFileShareSampleParamsPage , CQueryDlg , CAboutDlg , CXMLTreeDlg , CCmdLineConsumerDlg , CLocateDialog , CRTCOutgoingDlg , CReceiveWaitDialog , CDlgIADsOpenDSObject , CLoginDlg , CDlgIDirectorySearch , CConnectDlg , CDlgIADsContainer , CClientDlg , CAppInstallDlg
  • DoDelete() : CContextMenu
  • DoDisplayMessage() : CRTCIMSession
  • DoDisplayTyping() : CRTCIMSession
  • DoDragDrop() : CSimpleDoc
  • DoDrop() : CDropTarget
  • DoEditSession() : CEditSessionBase , CFlipEditSession , CHelloEditSession , CKeystrokeEditSession , CCompositionEditSession , CTerminateCompositionEditSession , CEditSessionBase , CKeystrokeEditSession , CPropertyEditSession , CFlipDocEditSession , CUpdateTextEditSession
  • DoEnablePresence() : CRTCWin
  • DoExplore() : CContextMenu
  • DoGAKMenu1() : CShellExt
  • DoGAKMenu2() : CShellExt
  • DoGAKMenu3() : CShellExt
  • DoGAKMenu4() : CShellExt
  • DoGenerateProvisioning() : CRTCWin
  • DoHelp() : IMMCControl , CMMCControl
  • DoInPlaceActivate() : CSimpSvrObj
  • DoInPlaceHide() : CSimpSvrObj
  • DoLogOff() : CRTCWin
  • DoLogOn() : CRTCWin
  • dom : _SFFS
  • domainFlag : CServerDlg
  • domainName : CAPIDoc
  • DoModal() : CDialogLite , CPropSheetLite , AboutDlg , CMainWindow
  • DoModifyData() : CContextMenu
  • DoMute() : CRTCAVSession
  • Done() : CGridIt
  • DoNewFolder() : CContextMenu
  • DoNewItem() : CContextMenu
  • DoOpen() : CMultiRecoApp , CContextMenu
  • DoPaste() : CContextMenu
  • DoRemoveBuddy() : CRTCWin
  • DoRename() : CContextMenu
  • DoSave() : CMultiRecoApp
  • DoSendMessage() : CRTCIMSession
  • DoSendTyping() : CRTCIMSession
  • doSet : GlobalVars
  • DoSetPresence() : CRTCWin
  • doSum() : CAsyncFullServ
  • dot : dirlist
  • dotColor : InkClipboard::InkClipboard
  • dotEdgeColor : InkClipboard::InkClipboard
  • dotEdgePen : InkClipboard::InkClipboard
  • dotPen : InkClipboard::InkClipboard
  • DotSize : InkClipboard::InkClipboard
  • DotSpacing : InkClipboard::InkClipboard
  • DoTuningWizard() : CRTCWin
  • DoVerb() : COleObject
  • DoVolume() : CRTCAVSession
  • DoWork() : CBankDlg , CAccount
  • DPtoLP() : CCanvas
  • DragComplete() : Notify , AgentNotifySink , Notify , AgentNotifySink
  • DragEnter() : CDropTarget
  • DragLeave() : CDropTarget
  • DragOver() : CDropTarget
  • DragStart() : AgentNotifySink , Notify , AgentNotifySink , Notify
  • Draw() : CGrid , CSimpSvrObj , CBlockFrame , CBehavior
  • DrawArea : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • DrawArea_Paint() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • DrawChar() : CSharp_Draw::Form1
  • DrawElement() : CTextGrid , CCharGrid , CCodeGrid
  • DrawingRect : CHILDWINDOWDATA
  • DrawLasso() : InkClipboard::InkClipboard
  • DrawLassoConnector() : InkClipboard::InkClipboard
  • DrawLine() : CSharp_Draw::Form1
  • DrawSelectionInkDot() : InkClipboard::InkClipboard
  • DrawSplitter() : CSplitterLite
  • DrawStrokes() : InkClipboard::InkClipboard
  • Drop() : CDropTarget
  • DropCall() : CNullModem
  • DropColumnProc() : CMDIChild
  • DropConstraintProc() : CMDIChild
  • DropFiles() : CFileViewer
  • DropIndexProc() : CMDIChild
  • DropTableProc() : CMDIChild
  • DS : CacheProxySamplePlugin::CacheProxyPlugin
  • DSN : util::DatabaseSettings , helper::DatabaseSettings
  • dsObjectNames : _DSA_SEC_PAGE_INFO
  • dst_portno : udp_hdr
  • DT : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl
  • dummy : CTitleTag
  • DummyEntry : _LSP_ENTRY
  • DumpContextInformation() : CContextPlugin
  • DumpInst() : CDbAlloc
  • DumpInstTable() : CDbAlloc
  • DumpLeaks() : CMallocSpy
  • DUnadvise() : CDataObject , CDropObject , CDataObject , CDataXferObj , CDataObject , CTSFDataObject , CDataObject , CPropSheetHost , CDataObject
  • dw : _foo , DWSTR
  • dwAccess : ARRAYQ
  • dwAccessorFlags : tagACCESSOR
  • dwAcquirePrivateKeyFlags : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • dwActiveDebuggees : GLOBAL_STRUCT
  • dwActiveDlls : DEB_DLL_LIST_INFO_STRUCT
  • dwActiveProcesses : DEB_PROCESS_LIST_INFO_STRUCT
  • dwActiveThreads : DEB_THREAD_LIST_INFO_STRUCT
  • dwAddress : CMD_ARGS , _IPSAMPLE_IP_ADDRESS
  • dwAllocCalls : _APPMEM_INSTANCE
  • dwAmmount : _ExpenseBuf
  • dwAmplitude : _WAVE_DATA
  • dwAPIVersion : tagLINEINFO
  • dwApplicationBytes : _APPMEM_INSTANCE
  • dwAppMemAllocs : _APPMEM_COUNTERS
  • dwAppMemAllocsSec : _APPMEM_COUNTERS
  • dwAppMemBytesAllocated : _APPMEM_COUNTERS
  • dwAppMemFrees : _APPMEM_COUNTERS
  • dwAppMemFreesSec : _APPMEM_COUNTERS
  • dwAppMemReAllocs : _APPMEM_COUNTERS
  • dwAppMemReAllocsSec : _APPMEM_COUNTERS
  • dwAttributes : NODE_PROPERTIES , CHILD_PROPERTIES , tag_BASENODE_PROPERTIES
  • dwBmk : tagRowBuff
  • dwBmkStatus : tagRowBuff
  • dwBPType : CMD_ARGS
  • dwBufferCount : _RECVFROMARGS , _SENDARGS , _RECVARGS , _SENDTOARGS
  • dwBytes : RESOURCEPOSINFO
  • dwBytesInRes : ICONDIRENTRY , MEMICONDIRENTRY
  • dwBytesReceived : _ACCEPTEXARGS
  • dwBytesSent : _CONNECTEXARGS
  • dwCallState : _DRVLINE
  • dwCallStateMode : _DRVLINE
  • dwChunkSize : CTE_ENCODER_STRUCT
  • dwCollation : INDEXINFO
  • dwCommand : VERBMAPPING , _ASYNC_REQUEST
  • dwConstant : CONST_DWORD_REP
  • dwConstantValue : _SIGGEN_COUNTER
  • dwContentLength : HTTP_REQUESTCB_PARAM
  • dwCookie : IAppletSessionVtbl , IAppletVtbl
  • dwCount : tagEnhKeyUsage
  • dwDataOffset : HTTP_REQUESTCB_PARAM
  • dwDestAttribs : CShellExt
  • dwDevCapFlag : NONDIALTOKENS
  • dwDeviceID : _DRVLINE
  • dwErrorLevel : _tagLOGERRORMSG
  • dwFFStreamMagic : _FFSTREAM
  • dwFillFactor : INDEXINFO
  • dwFirstFreeOffset : _APPMEM_DATA_HEADER
  • dwFirstIndex : _CounterInfoBlock
  • dwFirstInUseOffset : _APPMEM_DATA_HEADER
  • dwFlag : Note
  • dwFlags : _SENDTOARGS , _TRANSMITPACKETSARGS , COLDESC , _DISCONNECTEXARGS , _RECVARGS , _TRANSMITFILEARGS , _RECVFROMARGS , ATTRIBUTES , _tagPROPSTRUCT , _INTERFACE_ENTRY , _SENDARGS , tagPLUGXPRT_PARAMETERS
  • dwFormat : tag_smf , tag_smffileinfo
  • dwFreeCalls : _APPMEM_INSTANCE
  • dwGraphic : tagGRAPHICLOOKUP
  • dwh : _foo
  • dwHighDateTime : _FILETIME
  • dwIdExpected : _EAPCB
  • dwIfIndex : _INTERFACE_ENTRY
  • dwImageOffset : ICONDIRENTRY
  • dwInitialPacketId : _EAPCB
  • dwInitialSize : INDEXINFO
  • dwInstanceCount : _APPMEM_DATA_HEADER
  • dwIoControlCode : _IOCTLARGS
  • dwKey : _node_tag
  • dwKeySpec : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • dwLastIndex : _CounterInfoBlock
  • dwLength : tag_chunkhdr , _COLUMNDATA , COLUMNDATA , _tagPOSTKEY
  • dwLocalAddressLength : _ACCEPTEXARGS
  • dwLoggingLevel : _IPSAMPLE_GLOBAL_CONFIG
  • dwLogLevel : _CONFIGURATION_ENTRY
  • dwLowDateTime : _FILETIME
  • dwMask : _IPSAMPLE_IP_ADDRESS , ADVISE_SINK
  • dwMediaMode : _DRVLINE
  • dwMSPHandle : _DRVLINE
  • dwNextEntry : ECB_QUEUE_ENTRY
  • dwNextIndex : _CounterInfoBlock
  • dwNmch : _PREF
  • dwNullCollation : INDEXINFO
  • dwNulls : INDEXINFO
  • dwNumberOfBytesRecvd : _RECVFROMARGS , _RECVARGS , _WSARECVMSGARGS
  • dwNumberOfBytesSent : _SENDTOARGS , _SENDARGS
  • dwNumBytes : ICONIMAGE
  • dwNumItems : _tagGENERICITEMLIST
  • dwObjectType : params
  • dwOffset : RESOURCEPOSINFO , HTTP_REQUEST_RANGE , _tagPOSTKEY
  • dwOffsetOfNext : _APPMEM_INSTANCE
  • dwOutstandingAsync : _SOCK_INFO
  • dwPendingUserEvent : tag_smf
  • dwPeriod : _WAVE_DATA
  • dwPermanentLineID : tagLINEINFO
  • dwPID : CTestDlg
  • dwPos : tagSEG
  • dwProcessId : DEB_THREAD_NODE_INFO_STRUCT , _APPMEM_INSTANCE , _CLIPBOOKSERVER_RESOURCE , DEB_STARTUP_INFO_STRUCT , DEB_PROCESS_NODE_INFO_STRUCT
  • dwPropertyID : _tagPROPSTRUCT
  • dwReAllocCalls : _APPMEM_INSTANCE
  • dwReceiveDataLength : _ACCEPTEXARGS
  • dwRemoteAddressLength : _ACCEPTEXARGS
  • dwRequestCtx : HTTP_REQUEST_PARAM , HTTP_REQUESTCB_PARAM
  • dwRequestID : _ASYNC_REQUEST
  • dwReserved : _SIGGEN_COUNTER , _tagPREPAREFORSYNCMSG , _DISCONNECTEXARGS , _tagESTABLISHCONNECTIONMSG , CPlex , _tagDELETELOGERRORMSG
  • dwReserved1 : _APPMEM_INSTANCE
  • dwReserved2 : _APPMEM_INSTANCE
  • dwResponseCode : HTTP_REQUESTCB_PARAM
  • dwResult : _EAPCB
  • dwSendDataLength : _CONNECTEXARGS
  • dwSineWaveValue : _SIGGEN_COUNTER
  • dwSize : _RASHOST_DATA , _RUREGVALUE , HTTP_REQUEST_RANGE , REQUEST_CONTEXT
  • dwSizeOfDataFromInteractiveUI : _EAPCB
  • dwSleep : _OPTIONS
  • dwSleepClose : _OPTIONS
  • dwSourceSize : tagCrmFilesDeleteFileLogRecord , tagCrmFilesCreateFileLogRecord
  • dwSquareWaveValue : _SIGGEN_COUNTER
  • dwSrcAttribs : CShellExt
  • dwStart : _DLGITEMS
  • dwState : _IPSAMPLE_IF_BINDING
  • dwStatus : _Job , _COLUMNDATA , _Printer , COLUMNDATA
  • dwSyncMgrResultStatus : _tagHANDLERITEM_SYNCSTATUS
  • dwTempo : tag_tempomapentry
  • dwTempSize : tagCrmFilesDeleteFileLogRecord
  • dwThreadId : RESULTDATA , DEB_PROCESS_NODE_INFO_STRUCT
  • dwThreadID : CExeModule , REQUEST_CONTEXT , DBG_THREAD_INFO
  • dwThreadId : DEB_THREAD_NODE_INFO_STRUCT
  • dwThreadType : params
  • dwTimeDivision : tag_seq , tag_smfopenstruct , tag_smf , tag_smffileinfo
  • dwTotalClients : _OPTIONS
  • dwTotalSize : REQUEST_CONTEXT
  • dwTraceID : _CONFIGURATION_ENTRY
  • dwTracks : tag_smffileinfo , tag_smf
  • dwTriangleWaveValue : _SIGGEN_COUNTER
  • dwType : _RUREGVALUE , _ExpenseBuf
  • dwVal : tagENTRY
  • dwValue : tagENUMPRTLOOKUP , tagEnhKeyUsage
  • dwWidth : COL , _tagCol
  • dwWorkerMsg : _tagMETHODARGS
  • dx : CREATEGIZMOA , CREATEGIZMOW
  • dy : CREATEGIZMOW , CREATEGIZMOA
  • dyRowsFromTop : TableSelection
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- e -

  • e_compType : CMain
  • E_FAIL : RSProxy
  • EapState : _EAPCB
  • EatBlanks() : CHtmlScanner
  • EatTag() : CHtmlScanner
  • EatText() : CHtmlScanner
  • eCallControl : tagPLUGXPRT_PARAMETERS
  • eCallState : tagLINE_INFO
  • ecDllNameFT : NewsFlash
  • ecDllNameLabel : NewsFlash
  • eCoInit : THREADDATA
  • eCommand : IAppletSessionNotifyVtbl , tagAppletRegistryRequest , tagAppletChannelRequest , tagAppletTokenRequest , IAppletSessionNotifyVtbl
  • eCOMPlus : CMain
  • eDataPriority : IAppletSessionNotifyVtbl
  • EditItem() : CShellView
  • EditLabel() : CListViewLite
  • EditSubclassProc() : CRTCIMSession
  • edwp : _MSDI , _CMDI
  • eEvent : _EVENT_SINK_INFO
  • eFree : CMain
  • eidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • eLang : THREADDATA
  • elements : gss_OID_desc_struct , gss_OID_set_desc_struct
  • eMarshal : _RecordsetVtbl
  • Empty() : CString , CComWSTR , MyString
  • EmptyChildren() : CBicycleFolder
  • emptyInk : AutoClaims::AutoClaims
  • EmptyList() : COBLIST
  • EnableAudit() : CComSpy
  • EnableButton() : CToolBarLite
  • enableCaching : PersistedConfiguration
  • EnableModeless() : COleInPlaceActiveObject , CFrame , CCallbackWrapper , CShellView
  • EnableModelessMsg : _tagMETHODARGS
  • EnableNext() : CBasePropertyPage
  • EnablePlugin() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • enableProxy : PersistedConfiguration
  • EnableTable() : CS3Dialog
  • EnableWindow() : CWndLite
  • EnableWinsock() : IPluggableTransport , CPluggableTransport
  • Encode() : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeBitString , CCertEncodeCRLDistInfo
  • End() : CAdminNotifyHandler
  • END_COM_MAP() : CPartitionInfo
  • EndAbort() : CCrmDebugCompensator , CCrmFilesCompensator
  • EndAbortVariants() : CCrmDebugCompensator
  • EndCommit() : CCrmDebugCompensator , CCrmFilesCompensator
  • EndCommitVariants() : CCrmDebugCompensator
  • EndDialog() : CDialogLite
  • EndOfRecordset()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • EndPrepare() : CCrmDebugCompensator , CCrmFilesCompensator
  • EndPrepareVariants() : CCrmDebugCompensator
  • endResponse() : RSProxy
  • EngineDefined() : CComSpySqlAudit , CLBSub , IComSpyAudit
  • Enlist() : CAccount , CUpdateReceipt , CODBCData , CPooledData
  • EnlistResource() : CLDisp
  • EnlistTransaction() : CEnlistTransaction
  • EnsureOfficeNamespace() : CAdvClientDlg
  • EnsureVisible() : CListViewLite , CTreeViewLite
  • Enter() : CCriticalSection , CLock
  • enterHitTestMode() : InkHitTest::InkHitTest
  • enterInkMode() : InkHitTest::InkHitTest
  • enterNearestPointMode() : InkHitTest::InkHitTest
  • EnterNewGame() : CHuman
  • EntityDelete() : CProxy
  • EntityInsert() : CProxy
  • EntityLoad() : CProxy
  • EntityLookup() : CProxy
  • EntityQuery() : CProxy
  • EntityRead() : CProxy
  • EntityTags : CacheProxySamplePlugin::ContentInfo
  • EntityUpdate() : CProxy
  • Entry : _MOF_INFO , _ITEM_DESC
  • EnumAdvise() : COleObject
  • enumAnsi : CCertEncodeAltName
  • enumBlob : CCertEncodeAltName
  • EnumChildren() : CBicycleFolder
  • EnumConnectionPoints() : CConnectionPointContainer
  • EnumConnections() : CConnectionPoint
  • EnumDAdvise() : CDataObject , CTSFDataObject , CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject
  • EnumDisplayAttributeInfo() : CMarkTextService
  • EnumerateChildren() : CDlgIADsContainer
  • EnumerateInfo() : CEnumerator
  • EnumerateInstances() : CReindeer
  • EnumerateInterface() : CADQIDlg
  • EnumerateResultItems() : CFolderNode
  • EnumerationCallback() : CReindeer
  • EnumFormatEtc() : CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject , CTSFDataObject
  • enumNameType : CCertEncodeAltName
  • EnumObjects() : CShellFolder
  • enumOther : CCertEncodeAltName
  • enumPeriod : _UNITSTABLE
  • EnumPropertiesProc() : CMainWindow
  • EnumSyncMgrItems() : CSyncMgrHandler , CSettings
  • EnumTasks() : CComponent
  • enumUnicode : CCertEncodeAltName
  • enumUnknown : CCertEncodeAltName
  • EnumVerbs() : COleObject
  • EnumViews() : COleDocument
  • Eof() : CMmStreamConsecBuf , CMemoryMappedInputStream , CSerialStream
  • EOFCheck : FILE_CONTEXT_TYPE
  • eParamModifyRights : tagAppletRegistryRequest
  • ePriority : IAppletSessionVtbl
  • epropMAX : CFileShareSampleParamsPage
  • epropMaxUsers : CFileShareSampleParamsPage
  • epropPath : CFileShareSampleParamsPage
  • epropRemark : CFileShareSampleParamsPage
  • epropShareName : CFileShareSampleParamsPage
  • EraseAtCusps() : InkErase::InkErase
  • EraseAtIntersections() : InkErase::InkErase
  • EraseStrokes() : InkErase::InkErase
  • eReason : IAppletSessionNotifyVtbl
  • eRights : IAppletSessionNotifyVtbl
  • Error : _WSAOVERLAPPEDPLUS , CPrintRequest , InkCollection::InkCollection , RealTimeStylusPlugins::CustomDynamicRendererPlugin , RealTimeStylusPlugins::PacketFilterPlugin , RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • ERROR : ASYNC_REQUESTER
  • ErrorID : _tagDELETELOGERRORMSG , _tagSHOWERRORMSG
  • ErrorRecordsProc() : CMainWindow
  • ErrorString() : CConsumer , CBicycleFolder , CConsumer
  • Escape() : ISAPI_STRING
  • EscapeHandler() : Sample::UI::MainWindow
  • EscapeSlashAndQuoteForRC() : CGenerateRC
  • esEventingManager : UPNPDimmerService , CDimmerService
  • eSTA : CMain
  • EstablishConnection() : CCallbackWrapper
  • EstablishConnectionMsg : _tagMETHODARGS
  • eStartupChannelType : tagAppletProtocolEntity , tagAppletRecord
  • eStatus : IAppletSessionNotifyVtbl
  • eType : tagAppletObjectKey , EXTENDER_NODE , ENUMINFO , tagAppletCapabilityClass , tagAppletCapabilityID
  • Evaluate() : CComputer
  • Event() : CRTCEvents , CTAPIEventNotification , CRTCOutgoingDlg , CRTCIncomingDlg , CTAPIEventNotification
  • EVENT_CLSID : helper::sampleConstants
  • EVENT_NAME : helper::sampleConstants
  • EventCount : _MOF_INFO
  • EventFlag : _Events
  • EventIDs : EventID
  • EventInfo : _USER_EVENT
  • eventList : NewsSubscriber
  • EventName : _Events , CSysLCESub
  • EventThread() : CMyEventProvider
  • Evict() : CStorageResource
  • EvictNotify() : CMyEvictListener
  • ExceptionTitle : Sample::Messages
  • Exec() : CFrame
  • ExecMethod() : CReindeer , CProvider_IWbemServices , CMethodPro , CInstPro , CClassPro
  • ExecMethodAsync() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • ExecNotificationQuery() : CProvider_IWbemServices , CMethodPro , CInstPro , CClassPro
  • ExecNotificationQueryAsync() : CProvider_IWbemServices , CInstPro , CMethodPro , CClassPro
  • ExecQuery() : CProvider_IWbemServices , CMethodPro , CReindeer , CClassPro , CInstPro
  • ExecQueryAsync() : CClassPro , CInstPro , CMethodPro , CProvider_IWbemServices
  • Execute() : CMSOmniProvRowset , CMSOmniProvSessionColSchemaRowset , RqsEngine , Query , msado15::_Command , msado15::Command15 , msado15::Connection , CCommand , msado15::Command , CMSOmniProvSessionTRSchemaRowset , CMSOmniProvSessionPTSchemaRowset , CMSOmniProvCommand , CProxy , msado15::_Connection , msado15::Connection15 , CImpICommandText , CADsSearch
  • ExecuteComplete()
: msado15::ConnectionEventsVt
, msado15::ConnectionEvents
  • ExecuteProc() : CMDIChild
  • ExecuteSQL() : CODBCData
  • Exercise() : CComSyncTest , CSTATest , CFreeTest
  • ExitEvent : _DEVICE_INFO
  • ExitInstance() : CMyWizExtApp , CWinApp , CHMMSampleApp , CADsFirstExtApp , CMyUIExtApp , CSCPCMenuApp , CMyUIExtApp , CCmdLineConsumerApp , CADsFirstExtApp , CSCPWizApp , CGenericUCPApp , CAppLite , CPermEventsApp , CClipBookServerApp , CFileShareSampleApp
  • ExitMenu : Serialization::SerializationForm
  • exitMenu : CapJ
  • ExitMenu_Click() : Serialization::SerializationForm
  • exitMenu_click() : CapJ
  • Expand() : CPeoplePoweredVehicle , CTreeViewLite , CDelegationBase , CStaticNode , CSpaceStation
  • ExpandFileAndAdjustRowObjects() : CDBFile
  • EXPECTED_MAX_CONCURRENT_CALLS : RSProxy
  • ExpirationTime : CacheProxySamplePlugin::ContentInfo
  • ExportApplication()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • Extract() : CExtractIcon , CShellExt
  • ExtractData() : CComponentData , CContextMenuExtension , CToolBarExtension , CPropSheetExtension
  • ExtractObjectTypeGUID() : CToolBarExtension , CPropSheetExtension , CComponentData , CContextMenuExtension
  • ExtractParams() : CEntity
  • ExtractSnapInCLSID() : CComponentData , CPropSheetExtension , CToolBarExtension , CContextMenuExtension
  • ExtractString() : CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- f -

  • fAccept : SESSION_DATA
  • fActive : DEB_STARTUP_INFO_STRUCT
  • FACTORY_TYPE : CClassFactory
  • fActual : CMallocSpy
  • fAddBuddy : WATCHER_DATA
  • Failed() : CCallNotify
  • failed : tagSERVERINFO
  • FailureMessage : Sample::Messages
  • fAllow : WATCHER_DATA
  • FALSE : HelloJ , Hello2J , Hello3J
  • fAND : tagICONEXTRACT
  • fAnimating : CPerson
  • fAsync : _tagMETHODARGS
  • fAuthenticator : _EAPCB
  • fAutoCall : _PREF
  • fAutoChat : _PREF
  • fAutoHide : tagOPTIONS
  • fAutoHost : _PREF
  • fAutoMonitor : _PREF
  • fAutoUpdate : FieldInfo , INDEXINFO
  • FaxDlg() : FaxDlg
  • fCaller : tagLINE_INFO
  • fCallInvalidated : tSReq
  • fCancelled : _tagHANDLERITEM_SYNCSTATUS
  • fCapabilitiesChanged : tagAppletRoster
  • fChar : STR_BINDING
  • fChat : _PREF
  • fClearOnNew : PROFILE_STRUCT
  • fClustered : INDEXINFO
  • fConductingCapable : tagAppletRecord
  • fConfirm : _PREF
  • fContainer : tagObject
  • fCurrentXRotation : SPINCUBEINFO
  • fCurrentXRotationInc : SPINCUBEINFO
  • fCurrentYRotation : SPINCUBEINFO
  • fCurrentYRotationInc : SPINCUBEINFO
  • fCurrentZRotation : SPINCUBEINFO
  • fCurrentZRotationInc : SPINCUBEINFO
  • fCut : PRIVCLIPDATA
  • fDebug : tagSERVERINFO
  • fDeep : THREADARGS
  • fDefault : tagDescInfo
  • fDescribeFiles : THREADARGS
  • fDirectory : _tagFILEOBJECT
  • fDirty : _tagITEMCONFIGSETTINGSLPARAM
  • fDone : GlobalVars , COLORPICKSTATE
  • fdwProperty : _IMEUIDATA
  • fdwRequestFlags : HTTP_REQUESTCB_PARAM
  • fdwSeq : tag_seq
  • fdwSMF : tag_smf
  • fdwTrack : tag_track
  • fEnable : _tagENABLEMODELESSMSG
  • fEnableProxyFailover : BROWSER_CONFIG
  • fEnrolledActively : tagAppletRecord
  • fEntryOwned : tagAppletRegistryEntryOwner
  • Fetch() : CFileIO
  • FetchColumnString() : CRow
  • FetchComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • FetchData() : CODBCData
  • FetchNameValFromServerNamespace() : CachePluginAdmin
  • FetchProgress()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • FetchRow() : CDBFile
  • fExit : THREADARGS
  • fFileExists() : CGenericUCPDlg
  • FFilterContent() : CHtmlIFilter
  • fFlags : _EAPCB
  • fFolder : tagPIDLDATA
  • fFoundIconOnly : tagLABELEXTRACT
  • fFoundIndex : tagLABELEXTRACT
  • fFoundSource : tagLABELEXTRACT
  • fGettable : tagDescInfo
  • fh : filebuffer
  • fHandleType : tagHANDLES
  • fHeader : tagDescInfo
  • fHelpUsed : GLOBAL_STRUCT
  • fHiding : tagOPTIONS
  • fIconOnly : tagDRAWINFO
  • FieldChangeComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • FieldList : _RecordsetVtbl
  • Fields : _RecordsetVtbl
  • File : _SEARCH_REQUEST
  • FileData : _SEARCH_REQUEST
  • fileerror : diritem
  • FileItem : InkHitTest::InkHitTest
  • FileLoad() : CFileViewer
  • fileMenu : Sample::UI::MainWindow , CapJ
  • FileMenu : Serialization::SerializationForm
  • FileName : _JOB_INFO
  • fileOffset : _RSUMINFO
  • FileOl : tReq , tSReq
  • FileReadPos : tSReq
  • FileShow() : CFileViewer
  • FileShowInit() : CFileViewer
  • FileSize : _SEARCH_REQUEST
  • FileViewerFrameProc : CFileViewer
  • FileWritePos : tReq
  • fill : _STDZ
  • FillBinding() : CFileIO
  • fillchar : _OPTIONS
  • FillList() : CShellView
  • FillPidlTable() : CContextMenu , CDataObject
  • FillResultsControl() : WsdlDiscovery::frmMain
  • FillRowArray() : CDBFile
  • FinalConstruct() : CComSpySqlAudit , CCallBack , CCrmDebugCompensator , CCrmMonComp , CAccount , CMoveMoney , CLDisp , CProxy , CMSOmniProvSource , CMSOmniProvCommand , CMSOmniProvSession , CPlgTermSample
  • FinalCountruct() : CPower , CSimple
  • FinalRelease() : CSpyCon , CComSpySqlAudit , CComSpy , CAsyncXXX< T, ISyncFace, IAsyncFace > , CEnumConnections , CEnumConnectionPoints , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CUnknown , CServer , CCallBack , CCrmDebugCompensator , CCrmMonComp , CAccount , CUpdateReceipt , CLDisp , CProxy , CMSOmniProvCommand , CSampleMSPStream , CPower , CSimple
  • find() : MyOSPObject
  • Find() : msado15::_Recordset , msado15::Recordset , msado15::Recordset15 , msado15::Recordset20 , msado15::Recordset21 , CList< TYPE, ARG_TYPE > , CExList< TYPE > , RqsConfig , CLListImpl< TYPE, ARG_TYPE > , CSimpleArray< T >
  • FindBehavior() : CGrid , CFactory
  • FindCacheItem() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • FindConnectionPoint() : CConnectionPointContainer , CContainerBase
  • FindConsumer() : CProvider , CProvider_IWbemEventConsumerProvider , CProvider
  • FindElement() : CVectorEx< TYPE, IDX >
  • FindFileItemWithName() : CSyncMgrHandler
  • FindHandle : _ENUMERATE_DIRECTORY_STACK
  • FindIndex() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • FindItem() : CComponent
  • FindItemPidl() : CShellView
  • FindItemSettings() : CSettings
  • FindKey() : CStaticMap
  • FindKeyword() : CImpIBindResource
  • FindNext() : CRichEditLite
  • FindNextAttrTransition() : CTSFEditWnd
  • FindNextRowProc() : CMDIChild
  • FindPin() : CPlgTermSample
  • FindPrecedingPlugin() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • FindProperty() : CPropInfoSets , TPropBase< TYPE > , CProperties , CPropertyInfos , CPropertyIDs , CPropSets , CPropIDSets
  • FindPropSet() : TPropSetBase< TYPE, OBJTYPE >
  • FindProxyForURL() : CacheProxySamplePlugin::CacheProxyPlugin
  • findRequest() : RSProxy
  • FindSearchPrefence() : CADsSearch
  • FindSession() : CRTCWin
  • FindSet() : CBitArray
  • FindStr() : ISAPI_STRING
  • FindString() : CComboBoxLite , CComboBoxEx
  • FindStringExact() : CComboBoxLite
  • FindTab() : CTabLite
  • FindText() : CRichEditLite
  • FindWindow() : CMDIFrameLite
  • Finish_Sum() : fullsvr::AsyncFullServ , CAsyncFullServ , fullsvr::AsyncIFullServ
  • Finish_Test1() : CAsyncTest
  • Finish_Test2() : CAsyncTest
  • FinishParsingPacketlist() : CSampleDataContainer
  • FinishQI() : CUnknown
  • FInit() : CImpIAccessor , CBinder , CBitArray , CCommand , CDataSource , CDBSession , CRow , CRowset , CStringTable
  • fInit() : CFileIdx , CFileIO
  • FInit() : CExtBuffer , CStream
  • fInitApplication() : CSimpleApp , CSimpSvrApp , CSimpleApp
  • FInitFrameControls() : CFileViewer
  • fInitInstance() : CSimpleApp , CSimpSvrApp
  • fInputFile : THREADARGS
  • fInputFileSingle : THREADARGS
  • Fire_OnFieldChange() : CProxyIRowsetNotify< T >
  • Fire_OnRowChange() : CProxyIRowsetNotify< T >
  • Fire_OnRowsetChange() : CProxyIRowsetNotify< T >
  • Fire_RemoteOnFieldChange() : CProxyIRowsetNotify< T >
  • Fire_RemoteOnRowChange() : CProxyIRowsetNotify< T >
  • Fire_RemoteOnRowsetChange() : CProxyIRowsetNotify< T >
  • FireEvent() : CSampleMSPStream , CPlgTermSample
  • first : THREADARGS , section , tree
  • First() : CListHeader , NIDequeIter_c< T >
  • FirstAccept : _SEC_CONTEXT
  • FirstInit : _SEC_CONTEXT
  • FirstName : Serialization::SerializationForm
  • FirstNameBox : Serialization::SerializationForm
  • FirstNameLabel : Serialization::SerializationForm
  • fIsAliveFailed : _FILESHARESAMPLE_RESOURCE
  • fIsAutoInc : COLDESC , TYPEINFO
  • fIsNullable : TYPEINFO , COLDESC
  • fIsolate : tagSERVERINFO
  • fIsParent : ENUMINFO
  • fIsPrimaryKey : INDEXINFO , COLDESC
  • fixedcols : TableHdr
  • fixedrows : TableHdr
  • fixedselectable : TableHdr
  • Flags : _BLRPLATE
  • flags : statel , fileline , CellData
  • fLastUpdateValid : _tagFILEOBJECT
  • fLocal : tagUser
  • fLog : tagSERVERINFO
  • fltVal : VTUNION
  • Flush() : msado15::_Stream , PMmStream , CFileLite , CStorageBuffer , CMmStream , PMmStream , msado15::Stream
  • fMaximized : PROFILE_STRUCT
  • fMcu : tagUser
  • fMinimized : PROFILE_STRUCT
  • fMsg : _PREF
  • fMsgNotify : _PREF
  • fMsgObjects : _PREF
  • fMsgState : _PREF
  • fMsgTrace : _PREF
  • fMsgWindow : _PREF
  • fMustBeInvoked : tagAppletProtocolEntity
  • fn : _CMD
  • fnAcceptEx : _PER_SOCKET_CONTEXT
  • fName : _tagFILEOBJECT
  • fNewItem : _tagITEMCONFIGSETTINGSLPARAM
  • fNodesAdded : tagAppletRoster
  • fNodesRemoved : tagAppletRoster
  • FocusChange() : CToolBand , CCommBand , CDeskBand , CExplorerBar
  • FolderNodeWndProc() : CFolderNode
  • Font() : IComSpy
  • FontChange() : CFileViewer
  • fontfamilyText : CSharp_Draw::Form1
  • fOnTop : tagOPTIONS
  • fontText : CSharp_Draw::Form1
  • foot : PrintContext
  • FOpenAs() : CFileViewer
  • fOpenedFiles : THREADARGS
  • forecolour : Props
  • forecolourws : Props
  • Form1() : CSharp_Draw::Form1
  • Format : _MIDL_PROC_FORMAT_STRING , _MIDL_TYPE_FORMAT_STRING
  • FormatColumn() : CADsSearch
  • formatID : _PROPSETLIST
  • formatVersion : _SUMMARYINFO , _RSUMINFO
  • formData : PaperForm::PaperForm
  • formDataFile : PaperForm::PaperForm
  • fourccType : tag_chunkhdr
  • fPermissionGranted : IAppletNotifyVtbl
  • fPrepared : _CommandVtbl
  • fProxyAutoDiscovery : BROWSER_CONFIG
  • FrameWndProc : CFrame
  • fRecursive : _tagHANDLERITEMSETTINGS , _tagSAMPLEITEMSETTINGS
  • Free() : XInterface< T > , CUtilString , XPtr< T > , XBStr , XWindow , XBStr , XPtr< T > , CFixedAlloc
  • FreeAll() : CFixedAlloc
  • FreeAxisInfo() : CDataset
  • FreeBytes : _LOCAL_HEAP_INFO_BLOCK
  • FreeColumn() : CADsSearch
  • FreeData() : CBindings , CString
  • FreeDataChain() : CPlex
  • FreeEntries : _LOCAL_HEAP_INFO_BLOCK
  • FreeExtra() : CString
  • FreeNode() : CLListImpl< TYPE, ARG_TYPE >
  • FreePidlTable() : CDropTarget , CDataObject , CContextMenu
  • FreeSurrogate() : CSurrogate
  • FRIENDLYNAME_LENGTH : storesh::Storesh
  • frmMain() : WsdlDiscovery::frmMain
  • fRosterChanged : tagAppletRoster
  • fSavedDirectory : PROFILE_STRUCT
  • fSaveOnExit : PROFILE_STRUCT
  • fSavePreferences : PROFILE_STRUCT
  • fSbar : _PREF
  • fScreen : tagSERVERINFO
  • fSearchable : FieldInfo
  • fSettable : tagDescInfo
  • fShowSymbols : PROFILE_STRUCT
  • fSigned : GBSETINT , GBGETINT
  • fSortBookmarks : INDEXINFO
  • fSpyed : CMallocSpy
  • fSuccess : GBGETINT
  • fSynchronizeComplete : _tagHANDLERITEM_SYNCSTATUS
  • fSynchronizing : _tagHANDLERITEM_SYNCSTATUS
  • fSyncLock : _tagSAMPLEITEMSETTINGS
  • ft : FONTENUM , _tagHANDLERITEMSETTINGS
  • ft_lastwrite : diritem
  • fTbar : _PREF
  • ftLastUpdate : _tagFILEOBJECT
  • fToolBar : PROFILE_STRUCT
  • fTop : tagUser
  • FtUpdate() : CFileTransferNotify , CFtNotify
  • FullConnect() : CFullConnect
  • FullPathName : _SEARCH_REQUEST
  • func : CAsyncTest::threadParam
  • fUnicode : filebuffer , filedata
  • fUniformSend : IAppletSessionVtbl , IAppletSessionNotifyVtbl
  • fUnique : INDEXINFO
  • fUnresolvedConflicts : _tagHANDLERITEM_SYNCSTATUS
  • fUnsigned : FieldInfo
  • fUserList : _PREF
  • fVal : t_Ctype
  • fValid : INVOKE_INFO
  • fVerbose : PROFILE_STRUCT
  • fVoiceLine : tagLINEINFO
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- g -

  • g_hInst : GlobalVars
  • g_NamedValues : CachePluginAdmin
  • GarbageCollectNode() : CObjTree
  • GatewayUserData : _SAMPLE_HELPER_DATA_
  • GatherColumnInfo() : CFileIO
  • gbInkArea : InkRecognition::InkRecognition
  • gbTestArea : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • GenerateFileInfo() : CFileIO
  • GenerateWordForms() : CSampleStemmer
  • genericItem : _tagHANDLERITEM_SYNCSTATUS , _tagFILEOBJECT , _tagSAMPLEITEMSETTINGS
  • Gesture : IInkCollectorEventsImpl< T > , InkCollectorEvents
  • GestureAt() : CAgentCtlCharacterEx
  • Get() : CSAFEARRAY , SmartRefPointer< T > , CAgentCtlCharacterEx , CMmStreamBuf , CRegAccess , XPtr< T > , XWindow , XPtr< T > , CResString
  • get : IWMSCacheAdmin
  • get_ActivityId() : CCrmMonComp
  • get_All : CContext
  • get_Application : CContext
  • get_Audit() : CComSpy
  • get_ColumnHeaders() : CCrmMonComp
  • get_ColWidth() : CComSpy
  • get_ContextTypes() : CContextAdmin
  • get_DeleteCommand() : CEntity
  • get_DeleteStoredProcedure() : CEntity
  • get_Description() : CCrmMonComp
  • get_dimLevel() : UPNPDimmerService , CDimmerService
  • get_EditMode() : CEntity
  • get_Field() : CEntity
  • get_FindClerks() : CCrmMonComp
  • get_FormattedRecord() : CCrmMonComp
  • get_GridSize() : CGrid
  • get_InsertCommand() : CEntity
  • get_InsertStoredProcedure() : CEntity
  • get_Key() : CEntity
  • get_KeyField() : CEntity
  • get_LogFile() : CComSpy
  • get_LogToFile() : CComSpy
  • get_myPowerProperty() : CPower
  • get_myProperty() : CPower , CSimple
  • get_Name() : CSampleMSPStream
  • get_NewEnum()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • get_NumberOfLogRecords() : CCrmMonComp
  • get_OutputPath() : CContextAdmin
  • get_Power() : UPNPDimmerService , CDimmerService
  • get_ProgId() : CCrmMonComp
  • get_ReadCommand() : CEntity
  • get_ReadStoredProcedure() : CEntity
  • get_Record() : CResultset
  • get_Request : CContext
  • get_Response : CContext
  • get_Server : CContext
  • get_Session : CContext
  • get_ShowGridLines() : CComSpy
  • get_ShowOnScreen() : CComSpy
  • get_SnapIncrement() : CSnap
  • get_SnapOn() : CSnap
  • get_TipURL() : CByotTransObj
  • get_TransactionState() : CCrmMonComp
  • get_UpdateCommand() : CEntity
  • get_UpdateStoredProcedure() : CEntity
  • get_x() : CPoint
  • get_x1() : CLine
  • get_x2() : CLine
  • get_y() : CPoint
  • get_y1() : CLine
  • get_y2() : CLine
  • getAbsolutePage()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getAbsolutePosition()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetAccess() : COpenQueueDialog
  • GetAccessRights() : CObjSecurity
  • GetAcknowledge() : CSendMessageDialog
  • GetACPFromPoint() : CTSFEditWnd
  • GetActive() : CAgentCtlCharacterEx
  • getActiveCommand()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • getActiveConnection()
: msado15::_Command
, msado15::_Record
, msado15::_Recordset
, msado15::Command
, msado15::Command15
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetActiveParam() : CExecuteParamDlg
  • GetActiveValue() : CExecuteParamDlg
  • GetActiveView() : CTSFEditWnd
  • GetActiveWindow() : CMDIFrameLite
  • getActualSize()
: msado15::Field
, msado15::Field15
  • getAddEnabled()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • GetAddNewMode() : CDataGrid
  • GetAddressH() : RqsClient
  • GetAddressN() : RqsClient
  • GetAddressPsz() : RqsClient
  • GetAdminPathName() : CSendMessageDialog
  • GetAdvProperties() : CFullConnect
  • GetAggregate() : CInterfaceDlg
  • GetAllocLength() : CString
  • GetAllocSize() : CFixedAlloc
  • GetAllowAddNew() : CDataGrid
  • GetAllowArrows() : CDataGrid
  • GetAllowDelete() : CDataGrid
  • GetAllowRowSizing() : CDataGrid
  • GetAllowUpdate() : CDataGrid
  • GetAlt1Confidence() : CAgentCtlUserInput
  • GetAlt1Name() : CAgentCtlUserInput
  • GetAlt1Voice() : CAgentCtlUserInput
  • GetAlt2Confidence() : CAgentCtlUserInput
  • GetAlt2Name() : CAgentCtlUserInput
  • GetAlt2Voice() : CAgentCtlUserInput
  • GetAnimationNames() : CAgentCtlCharacterEx
  • GetApp() : CSimpSvrDoc
  • GetAppearance() : CDataGrid
  • getAppletInfo() : RSProxy , HelloJ , Hello2J , Hello3J
  • GetApproxCount() : CDataGrid
  • GetApproximatePosition() : IRowsetScrollImpl< T, RowsetInterface >
  • GetAt() : CString , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • GetAttribute() : CGetInfoExDlg
  • GetAttributeInfo() : CDisplayAttributeInfo
  • GetAttributes() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • getAttributes()
: msado15::_Connection
, msado15::_Parameter
, msado15::Connection
, msado15::Connection15
, msado15::Field
, msado15::Field15
, msado15::Parameter
, msado15::Property
  • GetAttributesOf() : CShellFolder
  • GetAttributeString() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • GetAudioOutput() : CAgentCtlEx
  • GetAuditObj() : CComSpy
  • GetAuthenticated() : CSendMessageDialog
  • GetAuthenticationPlugin() : CAuthenticateContext
  • GetAuthorizedEvents() : CDBAuthPlugin
  • GetAuthorizedUsers() : CSids
  • GetAutoPopupMenu() : CAgentCtlCharacterEx
  • GetAxisInfo() : CDataset
  • GetAxisInfoProc() : CMDIChild
  • GetAxisRowset() : CDataset
  • GetAxisRowsetProc() : CMDIChild
  • GetBackColor() : CDataGrid , CAgentCtlBalloonEx
  • GetBackground() : CComponent
  • GetBalloon() : CAgentCtlCharacterEx
  • GetBandInfo() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • GetBaseNodeObject() : CDataObject
  • GetBaseObjectType() : CBaseObj
  • GetBaseType() : CBase
  • GetBestHeight() : CRecoOutputWnd
  • GetBindInfo() : CUrlmonCallback , CDownloadBindStatusCallback
  • GetBindings() : CParameters , CImpIAccessor
  • GetBindingsProc() : CMDIChild
  • GetBindingType() : COptionsSheet
  • GetBitmapIndex() : CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CPlane , CSkyVehicle , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycleFolder , CBicycle , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder
  • GetBitString() : CCertEncodeBitString
  • GetBlockOfChars() : CHtmlScanner
  • GetBodySize() : CReceiveMessageDialog
  • getBOF()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getBookmark()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetBookmark() : CDataGrid , CRowset
  • GetBool() : CVARIANT
  • GetBorder() : CFrame
  • GetBorderColor() : CAgentCtlBalloonEx
  • GetBorderStyle() : CDataGrid
  • GetBuffer() : CString , CacheProxySamplePlugin::INSSBufferImpl , TempBuffer
  • GetBufferAndLength() : CacheProxySamplePlugin::INSSBufferImpl
  • GetBufferSetLength() : CString
  • GetByPath() : CClassPro , CInstPro
  • GetByte() : CVARIANT
  • getCacheSize()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetCacheUrl() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • GetCallback() : CMgdClusCfgInit
  • GetCallMediaTypes() : CSampleMSP
  • GetCanonicalFormatEtc() : CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject , CTSFDataObject
  • GetCaption() : CAgentCtlCommandEx , CAgentCtlCommandsEx , CDataGrid
  • GetCatalog() : CVCExploreDlg
  • GetCatalogApps() : CSelectEventsDlg
  • GetCellData() : CDataset
  • GetCertByIndex() : storesh::Storesh
  • getChainFromStore() : Sample::Sample
  • GetChangePictureButton() : CProppageUserUI , CExtPageUser
  • GetChapter() : CRowset
  • getChapter() : msado15::ADORecordsetConstruction
  • GetChapteredChild() : CMDIChild
  • GetChar() : CMemoryMappedInputStream , CSerialStream
  • GetCharacterID() : CAgentCtlUserInput
  • GetCharacters() : CAgentCtlEx
  • getCharset()
: msado15::_Stream
, msado15::Stream
  • GetCharsPerLine() : CAgentCtlBalloonEx
  • GetCheckpoint() : RqsEngine
  • GetChildColumnInfo() : CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder
  • GetChildInfo() : CSampleDirectory
  • GetChildItem() : CTreeViewLite
  • GetChildPtr() : CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder
  • GetChildren()
: msado15::_Record
, msado15::Record
, UDDI::Tools::CategoryTreeView
  • GetChunk() : msado15::Field , msado15::Field15 , HtmlPropIFilter , CAnchorTag , CHtmlElement , CHtmlIFilter , CHtmlIFilterBase , CImageTag , CInputTag , CMetaTag , CPropertyTag , CScriptTag , CStartOfFileElement , CTextElement , CTitleTag , CSmpFilter
  • GetClassAndName() : CDlgIADsContainer
  • GetClassIcon() : CSCPWiz , CWizExtUser
  • GetClassID() : CPersistFile , CPersistStorage , CSimpleObject , CDynamic , CEntity , CResultset , CDataSource , CImpIPersist , CPropertyPage , IMyPersistStreamImpl< T > , CComponentData , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter , CCommBand , CDeskBand , CExplorerBar , CToolBand , CImpIPersistFile , CShellFolder , CShellExt
  • GetClassName() : CSCPWiz , CWizExtUser
  • GetClearPictureButton() : CProppageUserUI , CExtPageUser
  • GetClientSite() : COleObject
  • GetClipboardData() : COleObject
  • GetCloneString() : MyString
  • GetCloseEventHandle() : CPluggableTransport
  • GetCLSID() : CServer
  • GetClsid() : CDataGrid , CAgentCtlEx
  • GetClsidOfTypeLib2() : CMethodSub
  • GetCol() : CDataGrid
  • GetColInfo() : CDataAccess , CFileIO , CTable
  • GetColInfoProc() : CMDIChild
  • getCollect()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetCollection()
: comadmin::COMAdminCatalog
, comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, comadmin::ICOMAdminCatalog
  • GetCollectionByQuery()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetColNameHeap() : CFileIO
  • GetColNameHeapSize() : CFileIO
  • GetColor() : CSecureObject
  • GetColorMenu() : CSimpSvrApp
  • GetColumn() : CCrmFilesCompensator , CADsSearch
  • GetColumnCnt() : CFileIO
  • getColumnCount() : MyOSPObject
  • GetColumnCount() : CCrmFilesCompensator
  • GetColumnData() : CDataAccess , CFileIO
  • GetColumnDesc() : CTable
  • GetColumnHeaders() : CCrmFilesCompensator , CDataGrid
  • GetColumnImage() : CDataAccess
  • GetColumnInfo() : CMSOmniProvCommand , CMSOmniProvRowset , CImpIColumnsInfo , CColumnProvider
  • GetColumnName() : CFileIO
  • GetColumnOrdinal() : CRow
  • GetColumns() : CDataGrid , CRow , CImpIRow
  • GetColumnsRowset() : CDataAccess
  • GetColumnsRowsetProc() : CMDIChild
  • GetColumnVariants() : CCrmFilesCompensator
  • GetColumnWidth() : CListViewLite
  • GetCommands() : CAgentCtlCharacterEx
  • GetCommandString() : CContextMenu , CDeskBand , CContextMenu , CShellExt
  • GetCommandsWindow() : CAgentCtlEx
  • GetCommandText() : CCommand , CImpICommandText
  • getCommandText()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • getCommandTimeout()
: msado15::_Command
, msado15::_Connection
, msado15::Command
, msado15::Command15
, msado15::Connection
, msado15::Connection15
  • getCommandType()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • GetCommLink() : CNullModem , CPSTN
  • GetCompSysRef() : CAdvClientDlg
  • GetComputerName() : CImp_DrawDlg
  • GetConfID() : CAppletSession
  • GetConfidence() : CAgentCtlCommandEx , CAgentCtlUserInput
  • GetConfidenceText() : CAgentCtlCommandEx
  • GetConfigDetails() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • GetConfigPath() : RqsConfig
  • GetConn() : CUtil
  • GetConnected() : CAgentCtlEx
  • GetConnection() : CODBCData
  • GetConnectionID() : CPluggableTransport
  • GetConnectionInterface() : CConnectionPoint
  • GetConnectionPoint() : CConnectionPointContainer
  • GetConnectionPointContainer() : CConnectionPoint
  • GetConnectionProps() : CDataSource
  • getConnectionString()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • getConnectionTimeout()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • GetConsole() : CConsole
  • GetConsoleNameSpace() : CComponentData
  • GetConsumer() : CAdvClientDlg
  • GetContainer() : CSpyCon , CImpIOleClientSite , COleClient , CSCPWiz , CWizExtUser , CBrowserHost
  • GetContainerCanonicalName() : CSCPWiz , CWizExtUser
  • GetContainerFormat() : CSampleDataContainer
  • GetContentInfo() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetContentInfoContext() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetContentInfoFromContext() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetContentInformation() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • GetContentSize() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • GetContext() : CDataObject
  • GetContextTypes() : CContextPlugin
  • GetCookie() : CDelegationBase , CDataObject , CDelegationBase
  • GetCopySourceObj() : CSCPWiz , CWizExtUser
  • GetCorrectCRM() : CCrmFilesTest
  • getCount()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, msado15::_Collection
, msado15::_DynaCollection
, msado15::Errors
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::Parameters
, msado15::Properties
  • GetCount() : CListBoxLite , CComboBoxLite , CList< TYPE, ARG_TYPE > , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , CVector< TYPE, IDX > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CacheProxySamplePlugin::IWMSCacheItemCollectionImpl , CCertEncodeStringArray , CLListImpl< TYPE, ARG_TYPE > , CAgentCtlCommandsEx , CAgentCtlUserInput
  • GetCountChildSpaceStations() : CSpaceStation
  • GetCounter() : CSampleInstance
  • GetCountPerPage() : CListViewLite
  • GetCredentials() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetCrmLogControl() : CCrmFilesWorker
  • GetCurFile() : CPersistFile , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter , CImpIPersistFile , CShellExt
  • GetCurHtmlElement() : CHtmlIFilter
  • GetCurrent() : NIDequeIter_c< T >
  • GetCurrentCellModified() : CDataGrid
  • GetCurrentCellVisible() : CDataGrid
  • GetCurrentCommand() : CCommand
  • GetCurrentInfo() : CShellView
  • GetCurrentSelections() : CComponent
  • GetCurrentWindow() : CDownloadUI
  • GetCurSel() : CListBoxLite , CComboBoxLite , CTabLite
  • getCursorLocation()
: msado15::_Connection
, msado15::_Recordset
, msado15::Connection
, msado15::Connection15
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getCursorType()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetCustomAdminInterface() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • GetCustomErrorObject() : CError
  • GetCUtilProp() : CRowset
  • GetData() : CDataObject , CMonitorServer , CDataXferObj , CString , CMSOmniProvRowset , CParameters , CDropObject , CRowset , CImpIRowset , CPropSheetHost , CDataObject , CSimpleArray< T > , CDataObject , CPidlMgr , CTSFDataObject , CCustomPropertyStore
  • getData() : RSProxy , CStaticNode
  • GetDataAdviseHolder() : CSimpSvrObj
  • GetDataChanged() : CDataGrid
  • GetDataContainerVersion() : CSDKSampleStorageSystem
  • getDataFormat() : msado15::Field
  • GetDataFormats() : CDataGrid
  • GetDataHere() : CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject , CTSFDataObject
  • getDataMember()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
, MyDataSource
  • GetDataMember() : CDataGrid
  • getDataMemberCount() : MyDataSource
  • getDataMemberName() : MyDataSource
  • GetDataObject() : CSimpSvrObj
  • GetDataPointer() : CPidlMgr
  • getDataSize() : CStaticNode
  • getDataSource()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • GetDataSource() : CDataGrid , CMSOmniProvRowset , CServiceComp , CSession , CImpIGetDataSource
  • GetDataSourceAttributes() : CSDKSampleStorageSystem
  • GetDataSourcePlugin() : CSampleDataContainer , CSampleDirectory
  • GetDataSourceProc() : CMainWindow
  • getDataStoreMajorVersion()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • getDataStoreMinorVersion()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • GetDataType() : CCustomPropertyStore
  • GetDataTypes() : CFileIO
  • GetDBSession() : CImpICommandText
  • GetDBStatus() : CMSOmniProvSessionTRSchemaRowset , CMSOmniProvSessionColSchemaRowset
  • GetDeadLetter() : CSendMessageDialog
  • GetDebugTrace() : RqsConfig
  • GetDefaultCommand() : CAgentCtlCommandsEx
  • getDefaultDatabase()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • GetDefaultInterface() : CBase , CUnknown , CConnectionPoint , CBinder , CCommand , CServiceComp , CDataLinks , CDataset , CDataSource , CEnumerator , CError , CCustomError , CMultipleResults , CRow , CRowPosition , CRowset , CSession , CStream , CTransaction , CTransactionOptions
  • GetDefaultSummary() : CSCPWiz , CWizExtUser
  • GetDefColWidth() : CDataGrid
  • getDefinedSize()
: msado15::Field
, msado15::Field15
  • getDeletedStatus() : CRocket
  • GetDelivery() : CSendMessageDialog
  • GetDescription() : CError , CCertExitSample , CCertPolicySample , CAgentCtlCharacterEx , CAgentCtlRequest , CPartitionInfo , CTSFEditWnd , CDisplayAttributeInfo
  • getDescription() : msado15::Error
  • GetDescriptionString() : CVirtualFile
  • GetDescriptiveText() : CComponent
  • GetDimLevel() : CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • getDirection()
: msado15::_Parameter
, msado15::Parameter
  • GetDispatch() : CVARIANT
  • GetDisplayAttributeInfo() : CMarkTextService
  • GetDisplayInfo() : CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • GetDisplayName() : CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CPlane , CSkyVehicle , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycleFolder , CBicycle , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CMgdClusCfgInit
  • GetDisplayNameOf() : CShellFolder
  • GetDlgItem() : CWndLite
  • GetDllName() : CMgdClusCfgInit
  • GetDoc() : CSimpSvrApp
  • GetDocMiscStatus() : COleDocument
  • GetDocument() : COleDocumentView , CPrintSDIView , CTestView , CAPIView
  • GetDomainSlashUser() : CSecuritySub
  • GetDouble() : CVARIANT
  • GetDriveLetterMappings() : CPartitionInfo , CStorageResource
  • GetDropEffectFromKeyState() : CDropTarget
  • getDSO()
: msado15::ADOConnectionConstruction
, msado15::ADOConnectionConstruction15
  • GetEditActive() : CDataGrid
  • getEditMode()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetElement() : CVector< TYPE, IDX >
  • GetElements() : CVector< TYPE, IDX >
  • GetEmbedded() : CTSFEditWnd
  • GetEnabled() : CDataGrid , CAgentCtlAudioObject , CAgentCtlBalloonEx , CAgentCtlCommandEx
  • GetEncrypted() : CSendMessageDialog
  • GetEndACP() : CTSFEditWnd
  • GetEntity() : CResultset
  • getEOF()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getEOS()
: msado15::_Stream
, msado15::Stream
  • GetError() : CComSpySqlAudit
  • GetErrorCode() : CException
  • GetErrorInfo() : CError
  • GetErrorMessage() : IADsError , ADsError
  • getErrors()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • GetErrorText() : CDataGrid
  • getEstimatedRows() : MyOSPObject
  • GetEventClass() : CActivitySub , CAppSub , CCRMSub , CEvtStoreSub , CExceptionSub , CIdentitySub , CInstanceSub , CLBSub , CMethodSub , CObjConstSub , CObjPool2Sub , CObjPoolSub , CObjSub , CQCSub , CResourceSub , CSecuritySub , CSysLCESub , CThreadSub , CTxSub , CUserSub , ICOMSysLCE
  • GetEventClassesForIID()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetEventObject() : CBehavior
  • GetEvents() : CAppInfo
  • GetEventType() : CActivitySub , CAppSub , CCRMSub , CEvtStoreSub , CExceptionSub , CIdentitySub , CInstanceSub , CLBSub , CMethodSub , CObjConstSub , CObjPool2Sub , CObjPoolSub , CObjSub , CQCSub , CResourceSub , CSecuritySub , CSysLCESub , CThreadSub , CTxSub , CUserSub , ICOMSysLCE , RqsEngine
  • GetExtent() : COleObject , CTextField
  • GetExtraColCount() : CRow
  • GetExtraColumnInfo() : CRow
  • GetExtraData() : CAgentCtlCharacterEx
  • getFields()
: msado15::_Record
, msado15::_Recordset
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetFileName() : CPack
  • GetFileObj() : CRow , CRowset
  • GetFilePath() : CDataSource
  • GetFileSchemaInfo() : CDBFile
  • GetFilesForDir() : CSyncMgrHandler
  • getFilter()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetFilterType() : CAppInfo
  • GetFilterVersion() : CIsapiCertPolicyFilter
  • GetFirstLastItemH() : CExtBuffer
  • GetFirstLocation() : Microsoft::Uddi::Demo::Publish
  • GetFirstRow() : CDataGrid
  • GetFlags() : CAuthenticatePlugin
  • GetFont() : CDataGrid , CWndLite , CModel
  • GetFontBold() : CAgentCtlBalloonEx
  • GetFontCharSet() : CAgentCtlBalloonEx
  • GetFontItalic() : CAgentCtlBalloonEx
  • GetFontName() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • GetFontSize() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • GetFontStrikethru() : CAgentCtlBalloonEx
  • GetFontUnderline() : CAgentCtlBalloonEx
  • GetForeColor() : CDataGrid , CAgentCtlBalloonEx
  • GetForegroundWindow() : CapJ
  • GetFormat() : CModel , CAVIFileReader
  • GetFormatName() : COpenQueueDialog
  • GetFormattedText() : CTSFEditWnd
  • GetFQPidl() : CShellView
  • GetFrameInfo() : CSimpSvrObj
  • GetFromBack() : NIDeque_c< T >
  • GetFromFront() : NIDeque_c< T >
  • GetFromPosition() : COBLIST
  • GetFullName() : CShellFolder
  • GetFunction() : CTSFEditWnd
  • GetGestureName() : CAdvRecoApp
  • GetGirls() : CBicycle
  • GetGlobalVoiceCommandsEnabled() : CAgentCtlCommandsEx
  • GetGUID() : CError , CDisplayAttributeInfo
  • GetGuid() : CComboBoxGuid , CAgentCtlCharacterEx
  • GetHandle() : CDelegationBase , CBackground , CDelegationBase
  • GetHandledEvents() : CContextPlugin
  • GetHandlerInfo() : CSyncMgrHandler
  • GethAppWnd() : CSimpSvrApp , CSimpSvrDoc
  • GetHasOtherClients() : CAgentCtlCharacterEx
  • GetHCluster() : CClusterData
  • GethDocWnd() : CSimpSvrDoc
  • GetHead() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • GetHeadFont() : CDataGrid
  • GetHeadLines() : CDataGrid
  • GetHeadPosition() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • GetHeight() : CAgentCtlCharacterEx , CAgentCtlPropertySheet
  • GetHelpContext() : CError
  • getHelpContext() : msado15::Error
  • GetHelpContextID() : CAgentCtlCharacterEx , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • GetHelpFile() : CError , CAgentCtlCharacterEx
  • getHelpFile() : msado15::Error
  • GetHelpMenu() : CSimpSvrApp
  • GetHelpModeOn() : CAgentCtlCharacterEx
  • GetHelpPath() : CComponentData
  • GetHelpTopic() : CComponentData
  • GetHGroup() : CGroupData
  • GethHatchWnd() : CSimpSvrDoc
  • GethInst() : CSimpSvrApp
  • GetHNetInterface() : CNetInterfaceData
  • GetHNetwork() : CNetworkData
  • GetHNode() : CNodeData
  • getHost() : CStaticNode
  • gethostbyaddr() : DTHandler
  • gethostbyname() : DTHandler
  • gethostname() : DTHandler
  • GetHResource() : CResData
  • GetHtmlElement() : CHtmlElemBagEntry
  • GetHwnd() : CSimpleDialog , IBrowserHost
  • GetHWnd() : CDataGrid
  • GetHWndEditor() : CDataGrid
  • GetIcon() : CLangBarItemButton
  • GetIconLocation() : CExtractIcon , CShellExt
  • GetId() : CRocket
  • GetID() : CRefresherMember< T >
  • GetIDEdit() : CProppageUserUI , CExtPageUser
  • GetIdleOn() : CAgentCtlCharacterEx
  • GetIDsAdminNewObj() : CSCPWiz , CWizExtUser
  • GetIDsAdminNewObjPrimarySite() : CSCPWiz
  • GetIDsOfNames() : CTestCOMPerformance , COleClient , HelloWorld , CWrapVBComponent , CAsyncQuerySink , CMethodPro , InkCollectorEvents , AgentNotifySink
  • GetIMemberArray() : CConfNotify
  • GetIMemberCount() : CConfNotify
  • GetImpersonationAccountName() : CAuthenticateContext
  • GetImpersonationToken() : CAuthenticateContext
  • GetInboundByte : _tagPOSDATA
  • getIndex()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset21
  • GetInfo() : CSampleDataContainer , CException , CLangBarItemButton
  • GetInheritTypes() : CObjSecurity
  • GetIniString() : CUtil
  • GetInitString() : CServiceComp
  • GetInPlaceFrame() : CSimpSvrObj
  • GetInPlaceSite() : COleDocumentView , CSimpSvrObj
  • GetInst() : CDbAlloc
  • GetInt16() : CDialogStream
  • GetInt32() : CDialogStream
  • GetInt8() : CDialogStream
  • getInteger() : RSProxy
  • GetInterface() : CComponent , CActivitySub , CAppSub , CCRMSub , CEvtStoreSub , CExceptionSub , CUserSub , CIdentitySub , CInstanceSub , CLBSub , CMethodSub , CObjConstSub , CObjPool2Sub , CObjPoolSub , CObjSub , CQCSub , CResourceSub , CSecuritySub , CSysLCESub , CThreadSub , CTxSub , CBase , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • GetInterfaceAddress() : CDataAccess , CCustomError , CDataset , CContainerBase , CBase , CUnknown , CConnectionPoint , CAsynchBase , CPropertiesBase , CBinder , CCommand , CServiceComp , CDataLinks , CDataSource , CEnumerator , CError , CMultipleResults , CRow , CRowPosition , CRowset , CSession , CStream , CTransaction , CTransactionOptions
  • GetInterfaceHook() : CMSMQEventHandler
  • GetInterfaceSafetyOptions() : CPlgTermSample
  • GetInternalIpAddress() : RqsEngine
  • GetIpAddressFromInterfaceIndex() : RqsEngine
  • GetIpAddressFromInterfaceName() : RqsEngine
  • getIsolationLevel()
: msado15::Connection
, msado15::_Connection
, msado15::Connection15
  • GetISync() : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • GetItem() : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl
  • getItem()
: comadmin::ICatalogCollection
, comadmin::COMAdminCatalogCollection
, msado15::Errors
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::Parameters
, msado15::Properties
  • GetItem() : CTabLite , ClientList::Iterator , CAgentCtlCharacters , CAgentCtlCommandsEx
  • GetItemCount() : COBLIST , CListViewLite , CTabLite , COBLIST
  • GetItemData() : CTabLite , CColumnProvider
  • GetItemImage() : CListViewLite
  • GetItemObject() : CSyncMgrHandler , CShellView
  • GetItemOfExtBuffer() : CExtBuffer
  • GetItemParam() : CListViewLite , CListBoxLite , CTreeViewLite , CComboBoxLite
  • GetItemState() : CListViewLite
  • GetItemText() : CListViewLite
  • GetIterator() : ClientList
  • GetIUPointer() : XInterface< T >
  • GetJournal() : CSendMessageDialog
  • getKey()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
  • GetKeywords() : CImpIDBInfo
  • GetLabel() : CCreateQueueDialog , CLocateDialog
  • GetLanguageID() : CAgentCtlCharacterEx
  • GetLastItem() : CPidlMgr
  • GetLCID() : CMgdClusCfgInit
  • GetLeft() : CAgentCtlPropertySheet , CAgentCtlCharacterEx
  • GetLeftCol() : CDataGrid
  • GetLength() : CString , CacheProxySamplePlugin::INSSBufferImpl
  • GetLibrary() : RqsConfig
  • GetLicenseToUse() : CSampleWordBreaker , CSampleStemmer
  • GetLine() : CEditBoxLite
  • GetLineCount() : CEditBoxLite
  • getLineSeparator()
: msado15::_Stream
, msado15::Stream
  • GetLineSize() : CModel
  • GetLinkedTopics() : CComponentData
  • GetListpadInfo() : CBicycleFolder
  • GetListPadInfo() : CComponent
  • GetListpadInfo() : CDelegationBase , CSkateboardFolder , CIceSkateFolder
  • GetListViewValues() : CMDIChild
  • GetLiteralInfo() : CImpIDBInfo , CTable
  • GetLiteralInfoProc() : CMDIChild
  • getLocale() : MyOSPObject
  • GetLocale() : CHtmlIFilter
  • GetLockThreadId() : CLockHandler
  • getLockType()
: msado15::Recordset
, msado15::_Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetLogicalUserID() : CAuthenticateContext
  • GetLONG() : CVARIANT
  • GetLPBSTR() : BSTRING
  • GetMainMenu() : CSimpSvrApp
  • getMajorVersion()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetManageModule() : CCertExitSample , CCertPolicySample
  • GetMarqueeStyle() : CDataGrid
  • getMarshalOptions()
: msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset21
  • GetMarshalSizeMax() : CEntity , CClassFactoryWrapper , CDynamic , CResultset
  • GetMaxLength() : CacheProxySamplePlugin::INSSBufferImpl
  • GetMaxPage() : CModel
  • getMaxRecords()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetMaxSection() : CModel
  • GetMediaType() : CPlgPin
  • GetMember() : CRefresherMember< T >
  • GetMemberName() : CAppletSession
  • GetMenu() : CRocket
  • getMessage() : RSProxy
  • GetMessageBody() : CSendMessageDialog
  • GetMessageLabel() : CSendMessageDialog
  • GetMessageWnd() : CStaticNode
  • GetMetaFilePict() : CSimpSvrObj
  • GetMethodName() : CMethodSub
  • getMinorVersion()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetMiscStatus() : COleObject
  • getMode()
: msado15::Connection15
, msado15::_Connection
, msado15::_Record
, msado15::_Stream
, msado15::Connection
, msado15::Record
, msado15::Stream
  • GetMoniker() : CBrowserHost , CSpyCon , COleObject , CImpIOleClientSite , COleClient , CBrowserHost
  • GetMove() : CComputer
  • GetMoveCause() : CAgentCtlCharacterEx
  • GetMultipleComponentsInfo()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetMultiSelectCookie() : CDataObject
  • GetName() : CStorageResource
  • getName()
: msado15::_Parameter
, comadmin::COMAdminCatalogObject
  • GetName() : CSampleDirectory , CRenameDlg , CCertEncodeAltName , CCertEncodeCRLDistInfo , CAgentCtlCharacterEx , CAgentCtlUserInput , CMember , CPartitionInfo , CSpecialCharHashEntry , CPidlMgr
  • getName()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, comadmin::ICatalogObject
, msado15::_Command
, msado15::Command
, msado15::Command15
, msado15::Field
, msado15::Field15
, msado15::Parameter
, msado15::Property
  • GetNameChoice() : CCertEncodeCRLDistInfo , CCertEncodeAltName
  • GetNameCount() : CCertEncodeCRLDistInfo
  • getNativeError() : msado15::Error
  • GetNewMove() : CHuman
  • GetNext() : CLListImpl< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • GetNextAssoc() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • GetNextChunkId() : CHtmlIFilter
  • GetNextHashEntry() : CSpecialCharHashEntry
  • GetNextItem() : CListViewLite , CTreeViewLite , CPidlMgr
  • GetNextReceipt() : vcacct::CGetReceipt , CGetReceipt , vcacct::IGetReceipt
  • GetNextRow() : CADsSearch
  • GetNextRows() : CDataGrid , CMSOmniProvRowset , CRowset , CImpIRowset
  • GetNextRowsProc() : CMDIChild
  • GetNextView() : CViewList
  • GetNIDeque() : NIDequeIter_c< T >
  • GetNmManager() : Conf
  • GetNodeGUID() : CStaticNode , CDeviceNode , CVirtualFile , CBaseNode , CFolderNode , CStaticNode , CBaseNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CStaticNode , CBaseNode , CFolderNode , CStaticNode , CVirtualFile
  • GetNodeName() : CBaseNode , CMgdClusCfgInit , CBaseNode , CMgdClusCfgInit
  • getNodeType() : CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CRocket , CSpaceVehicle , CStaticNode , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CSkyBasedVehicle , CRocket , CSpaceVehicle , CDelegationBase , CLandBasedVehicle , CBicycle , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CStaticNode , CDelegationBase , CStaticNode , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CDelegationBase , CLandBasedVehicle , CBicycle , CSkateboard , CSkateboardFolder , CIceSkate , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CSkateboard , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CSpaceVehicle , CStaticNode
  • GetNodeType() : CBaseNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CStaticNode , CBaseNode , CFolderNode , CStaticNode , CVirtualFile , CStaticNode , CDeviceNode , CVirtualFile , CBaseNode , CFolderNode , CStaticNode
  • getNodeType() : CStaticNode , CRocket , CIceSkate , CBicycleFolder , CIceSkateFolder , CBicycleFolder , CPeoplePoweredVehicle , CSkateboard , CDelegationBase , CSpaceVehicle , CBicycleFolder , CStaticNode , CPeoplePoweredVehicle , CDelegationBase , CSkyBasedVehicle , CSkyVehicle , CSpaceFolder , CIceSkate , CDelegationBase , CSpaceVehicle , CIceSkateFolder , CStaticNode , CRocket , CBicycleFolder , CSpaceFolder , CPeoplePoweredVehicle , CSkateboard , CSpaceVehicle , CIceSkateFolder , CPeoplePoweredVehicle , CSkateboard , CDelegationBase , CStaticNode , CLandBasedVehicle , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboardFolder , CIceSkate , CIceSkateFolder , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CSkateboard , CSkateboardFolder , CIceSkate , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboardFolder , CIceSkate , CIceSkateFolder , CSkyBasedVehicle , CRocket , CSpaceStation , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CStaticNode , CBackground , CBackgroundFolder , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CSkyBasedVehicle , CRocket , CSpaceStation , CStaticNode , CDelegationBase , CPlane
  • GetNumber() : CAgentCtlRequest
  • getNumber() : msado15::Error
  • GetNumberOfLines() : CAgentCtlBalloonEx
  • GetNumDevices() : WiaWrap::CEventCallback
  • GetNumElements() : CSAFEARRAY
  • getNumericScale()
: msado15::_Parameter
, msado15::Field
, msado15::Parameter
, msado15::Field15
  • GetObj() : CSimpSvrDoc , CSCPWiz , CWizExtUser
  • GetObject() : CMainWindow , CMDIChild , CClassPro , CProvider_IWbemServices , CReindeer , CInstPro , CMethodPro
  • getObject() : RSProxy
  • GetObjectAddress() : CMainWindow , CMDIChild
  • GetObjectAsync() : CClassPro , CInstPro , CMethodPro , CProvider_IWbemServices
  • GetObjectDesc() : CRowset , CCustomError , CRow , CBase , CBinder , CDataSource , CEnumerator , CConnectionPoint , CError
  • GetObjectImage() : CBase , CRowPosition , CDataset , CDataLinks , CRowset , CBinder , CUnknown , CServiceComp , CEnumerator , CError , CCustomError , CRow , CStream , CTransactionOptions , CCommand , CDataSource , CConnectionPoint , CMultipleResults , CSession , CTransaction
  • GetObjectInformation() : CObjSecurity
  • GetObjectMenu() : CCustomError , CTransaction , CStream , CError , CEnumerator , CConnectionPoint , CUnknown , CDataLinks , CBase , CCommand , CServiceComp , CDataSource , CMultipleResults , CRowPosition , CSession , CDataset , CRowset , CTransactionOptions , CRow , CBinder
  • GetObjectName() : CRowPosition , CRow , CBase , CUnknown , CConnectionPoint , CCommand , CDataSource , CError , CMultipleResults , CSession , CStream , CDeleteObjectDlg , CBinder , CDataset , CCustomError , CRowset , CEnumerator , CServiceComp , CTransactionOptions , CDataLinks , CTransaction
  • GetObjectPath() : CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CMoveDlg , CStaticNode
  • GetObjects() : CHiPerfProvider
  • GetObjectType() : CBase
  • GetObjRect() : CSimpleSite
  • GetODBCError() : CODBCData
  • GetOleAdviseHolder() : CSimpSvrObj
  • GetOleClientSite() : CSimpSvrObj
  • getOLEDBCommand() : msado15::ADOCommandConstruction
  • GetOleInPlaceActiveObject() : CSimpSvrObj
  • GetOleInPlaceObject() : CSimpSvrObj
  • GetOleObject() : CSimpSvrApp , CSimpSvrObj
  • GetOptions() : CRowsetViewerDlg , CDataGrid , CIntTrace , CMDIChild , CBase , CMainWindow
  • GetOrdinal() : CColumnInfo , CBindings
  • GetOriginalHeight() : CAgentCtlCharacterEx
  • getOriginalValue()
: msado15::Field
, msado15::Field15
  • GetOriginalWidth() : CAgentCtlCharacterEx
  • GetOriginUrl() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • getOSVersion : _RSUMINFO , _SUMMARYINFO
  • GetOuterUnknown() : CUnknown , CBaseObj
  • GetOutputPath() : CContextPlugin
  • GetOverlayInfo() : CShellIconOverlayID
  • GetPackageName() : CAuthenticatePlugin
  • GetPage() : CAgentCtlPropertySheet , CModel
  • getPageCount()
: msado15::Recordset20
, msado15::Recordset21
, msado15::Recordset15
, msado15::Recordset
, msado15::_Recordset
  • GetPageData() : CCTypeSet
  • GetPageInfo() : CPropertyPage
  • GetPageMode() : CModel
  • GetPages() : CImpISpecifyPropertyPages
  • getPageSize()
: msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset
, msado15::Recordset21
, msado15::_Recordset
  • GetPainterInfo() : CBehavior , CGrid
  • GetParameterInfo() : CCommand
  • GetParameterInfoProc() : CMDIChild
  • getParameters()
: msado15::Command
, msado15::Command15
, msado15::_Command
  • GetParams() : CParameters
  • GetParent() : CBase , CRocket , CSimpSvrObj , CPropPageLite , CComponent , CVirtualFile
  • GetParentItem() : CTreeViewLite
  • GetParentScopeItem() : CDelegationBase , CBicycleFolder , CSkyBasedVehicle , CSpaceVehicle , CStaticNode , CLandBasedVehicle , CPeoplePoweredVehicle , CIceSkateFolder , CSkateboardFolder
  • getParentURL()
: msado15::Record
, msado15::_Record
  • GetPath() : CShellFolder
  • GetPathEdit() : CExtPageUser , CProppageUserUI
  • GetPathName() : CCloseQueueDialog , CDeleteQueueDialog , CReceiveMessageDialog , COpenQueueDialog , CSendMessageDialog , CCreateQueueDialog
  • getpeername() : DTHandler
  • GetPersistSize() : CEntity
  • GetPersistSizeMax() : CEntity
  • GetPersistStorage() : CSimpSvrObj
  • GetPicture() : CProppageUserUI , CExtPageUser
  • GetPidl() : CShellView
  • GetPin() : CPlgFilter
  • GetPinCount() : CPlgFilter
  • GetPingResponder() : CMonitorServer
  • GetPitch() : CAgentCtlCharacterEx
  • GetPluginSetting() : CContextSamplePropPage
  • GetPointer() : XInterface< T > , XBStr , XInterface< T > , XBStr
  • GetPolicy() : CRequestInstance
  • GetPolicyDescription() : CCertPolicySample
  • GetPort() : RqsConfig
  • GetPosition() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , COBLIST
  • getPosition() : msado15::Stream
  • GetPosition() : COBLIST
  • getPosition() : msado15::_Stream
  • GetPosition() : COBLIST
  • GetPosRect() : CSimpSvrObj
  • GetPowerValue() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • GetPPointer() : XInterface< T >
  • getPrecision()
: msado15::Parameter
, msado15::_Parameter
, msado15::Field
, msado15::Field15
  • getPrepared()
: msado15::Command
, msado15::Command15
, msado15::_Command
  • GetPrev() : CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE > , CExList< TYPE > , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE >
  • GetPrimaryKeys() : CS2Dialog
  • getPrimaryNodeType() : CComponentData
  • GetPriority() : CDownloadBindStatusCallback , CShellIconOverlayID , CUrlmonCallback , CSendMessageDialog
  • GetProgID() : CServer
  • GetProgressCallback() : CSyncMgrHandler
  • getProperties()
: msado15::_ADO
, msado15::_Record
, msado15::Command
, msado15::Connection
, msado15::Parameter
, msado15::Record
, msado15::Recordset20
  • GetProperties() : TPropBase< TYPE > , CImpICommandProperties , CImpISessionProperties , CDeviceNode , CFolderNode
  • getProperties() : msado15::Recordset21
  • GetProperties() : CPropertiesDlg
  • getProperties()
: msado15::Recordset
, msado15::Command15
, msado15::Field15
, msado15::Field
, msado15::Recordset15
  • GetProperties() : CBaseNode , CImpIDBProperties , CUtilProp , CVirtualFile
  • getProperties() : msado15::_Connection
  • GetProperties() : CPropertiesDlg , CImpIRowsetInfo , CImpIDBBinderProperties
  • getProperties()
: msado15::_Parameter
, msado15::Connection15
, msado15::_Recordset
, msado15::_Command
  • GetProperties() : CStaticNode
  • GetPropertiesArgChk() : CUtilProp
  • GetProperty() : CFolderNode , CVirtualFile , CPropPro , CBaseNode , CComponent , CProvider_IWbemServices , CDeviceNode , CStaticNode
  • GetPropertyInfo() : CImpIDBProperties , CUtilProp , CPropertiesDlg , CImpIDBBinderProperties , CPropertiesDlg
  • GetPropertyName() : CFullPropSpec
  • GetPropertyPropid() : CFullPropSpec
  • GetPropertyRangeCreator() : CCustomPropertyStore
  • GetPropertySheet() : CAgentCtlEx
  • GetPropertySheetPages() : CObjData , CResData
  • GetPropIndex() : CUtilProp
  • GetPropSet() : CFullPropSpec
  • GetPropSets() : CFullConnect , TPropSetBase< TYPE, OBJTYPE >
  • GetPropSpec() : CFullPropSpec
  • getprotobyname() : DTHandler
  • getprotobynumber() : DTHandler
  • GetProtocolName() : CAuthenticatePlugin
  • GetProvider() : CSnapinAbout
  • getProvider() : msado15::_Connection
  • GetProvider() : CSnapinAbout
  • getProvider()
: msado15::Connection
, msado15::Connection15
  • GetProvider() : CSnapinAbout
  • GetProviderCLSID() : MyClassFactory
  • GetProviderName() : CFullConnectProvider
  • GetProviders() : CDataSource
  • GetProviderTypes() : CSession
  • GetProxyData() : CRow
  • GetPtr() : CBicycleFolder
  • GetPublicKey() : Sample::MySignedXml
  • GetPunk() : CNotify
  • GetQIPointer() : XInterface< T >
  • GetQueueHandle() : CMainFrame
  • GetQuotedID() : CTable
  • GetRaiseRequestErrors() : CAgentCtlEx
  • GetReadEventHandle() : CPluggableTransport
  • getRecordCount()
: msado15::Recordset15
, msado15::_Recordset
, msado15::Recordset21
, msado15::Recordset20
, msado15::Recordset
  • GetRecordCount() : CError
  • GetRecordSelectors() : CDataGrid
  • GetRecordset() : CHandler , MSDFHDL::IDataFactoryHandler
  • getRecordType()
: msado15::_Record
, msado15::Record
  • GetRect() : COleDocumentView , CPaintCanvas
  • GetRecvPointer() : SmartRefPointer< T >
  • GetReference() : XInterface< T >
  • GetReferencedRowset() : CImpIRowsetInfo
  • GetReferencedRowsetProc() : CMDIChild
  • GetRegisterClass() : CSimpSvrApp
  • GetRelativeName() : CPidlMgr
  • getRemoveEnabled()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • getRequestID() : RSProxy
  • GetResourcePrivateData() : CStorageResource
  • GetResTypeName() : CMgdClusCfgInit
  • GetResult() : CMultipleResults
  • GetResultViewType() : CSpaceStation , CDelegationBase , CComponent , CDelegationBase , CComponent , CDelegationBase , CPerson , CComponent , CIceSkateFolder , CDelegationBase , CComponent , CDelegationBase , CSkyBasedVehicle , CComponent , CDelegationBase , CIceSkateFolder , CComponent , CBicycleFolder , CDelegationBase , CComponent , CDelegationBase , CSkateboardFolder , CIceSkateFolder , CComponent , CDelegationBase , CComponent , CSkyBasedVehicle , CSpaceStation , CComponent , CDelegationBase , CComponent , CIceSkateFolder , CDelegationBase , CComponent , CDelegationBase , CComponent , CSkyBasedVehicle , CComponent , CDelegationBase , CComponent , CDelegationBase , CComponent
  • GetResultViewType2() : CBaseNode , CComponent , CFolderNode , CVirtualFile , CBaseNode , CVirtualFile , CComponent , CDeviceNode , CComponent , CFolderNode , CStaticNode , CVirtualFile , CComponent , CVirtualFile , CBaseNode , CFolderNode , CDeviceNode , CFolderNode , CStaticNode , CFolderNode , CStaticNode , CDeviceNode , CBaseNode , CDeviceNode , CComponent , CBaseNode , CStaticNode , CBaseNode , CVirtualFile , CStaticNode , CFolderNode , CComponent , CStaticNode
  • GetReturnValue() : CListener
  • GetRightToLeft() : CDataGrid
  • GetRootDirectories() : CSDKSampleStorageSystem
  • GetRotRegister() : CSimpSvrObj
  • getRow() : msado15::ADORecordConstruction
  • GetRow() : CDataGrid
  • GetRowBuff() : CRow , CRowset
  • GetRowCnt() : CFileIO
  • getRowCount() : MyOSPObject
  • GetRowDividerStyle() : CDataGrid
  • GetRowFromHROW() : CRowset , CImpIGetRow
  • GetRowHeight() : CDataGrid
  • GetRowOffset() : CFileIdx
  • getRowPosition() : msado15::ADORecordsetConstruction
  • GetRows()
: msado15::Recordset15
, msado15::Recordset
, msado15::_Recordset
, msado15::Recordset21
, msado15::Recordset20
  • GetRowsAt() : IRowsetScrollImpl< T, RowsetInterface >
  • GetRowsAtRatio() : IRowsetScrollImpl< T, RowsetInterface >
  • GetRowsByBookmark() : IRowsetScrollImpl< T, RowsetInterface >
  • GetRowset() : CRowPosition
  • getRowset() : msado15::ADORecordsetConstruction
  • GetRowset() : CTable
  • GetRowSize() : CParameters , CFileIO
  • GetRunningApps() : CSelectEventsDlg
  • getRWStatus() : MyOSPObject
  • GetScale() : CScrollableView
  • GetSchemaInfo() : CMSOmniProvRowset , CDBFile
  • GetSchemaRowset() : CSession
  • GetScopeCookie() : CComponent
  • GetScreenExt() : CTSFEditWnd
  • GetScrollBars() : CDataGrid
  • GetScrollInfo() : CScrollBarLite
  • GetScrollPos() : CScrollBarLite
  • GetScrollRange() : CScrollBarLite
  • GetSearchIf() : CADsSearch
  • GetSecurity() : CObjSecurity
  • GetSel() : CEditBoxLite , CRichEditLite
  • GetSelBookmarks() : CDataGrid
  • GetSelectedItem() : CTreeViewLite
  • GetSelectedObject() : CObjTree
  • GetSelectedRestrictions() : CSchemaDlg
  • GetSelectedRow() : CDataGrid
  • GetSelectedSchema() : CSchemaDlg
  • GetSelectedText() : CRichEditLite
  • GetSelection() : CTSFEditWnd
  • GetSelEndCol() : CDataGrid
  • GetSelInterface() : CInterfaceDlg
  • GetSelLength() : CDataGrid
  • GetSelPropInfo() : CPropertiesDlg
  • GetSelStart() : CDataGrid
  • GetSelStartCol() : CDataGrid
  • GetSelText() : CComboBoxLite , CComboBoxString , CDataGrid
  • GetSelValue() : CComboBoxLite
  • getservbyname() : DTHandler
  • getservbyport() : DTHandler
  • GetServerName() : CAPIDoc
  • GetServerObject() : CContext
  • GetServerVariable() : ISAPI_REQUEST
  • GetServiceHandle() : RqsEngine
  • GetServiceObject() : CDimmer , UPNPDimmerDevice , CDimmer
  • getSession() : msado15::ADOConnectionConstruction
  • GetSession() : CImpIGetSession
  • getSession() : msado15::ADOConnectionConstruction15
  • GetSessionID() : CSessionDlg , CAPIDoc
  • GetShellSettings() : CShellView
  • getShipStatusString() : qcnotify::Notify
  • GetShort() : CVARIANT
  • GetSIDFromName() : CDBAuthPlugin
  • GetSignatureKey() : Sample::SignVerify
  • GetSite() : CDeskBand , CToolBand , CCommBand , CExplorerBar
  • GetSize() : CSimpSvrObj , CBox
  • getSize() : msado15::Parameter
  • GetSize() : CPidlMgr
  • getSize()
: msado15::Stream
, msado15::_Stream
, msado15::_Parameter
  • GetSize() : CPartitionInfo , CSimpleArray< T > , CStaticMap
  • GetSizeMax() : CResultset , CExplorerBar , IMyPersistStreamImpl< T > , CDeskBand , CComponentData , CToolBand , CCommBand , CEntity , CDynamic
  • GetSnapinDescription() : CSnapinAbout
  • GetSnapinImage() : CSnapinAbout
  • GetSnapinVersion() : CSnapinAbout
  • GetSnapOn() : ISnap
  • GetSocket() : CX224
  • getsockname() : DTHandler
  • getsockopt() : DTHandler
  • getSort()
: msado15::Recordset15
, msado15::Recordset
, msado15::Recordset21
, msado15::Recordset20
, msado15::_Recordset
  • GetSoundEffects() : CAgentCtlAudioObject
  • GetSoundEffectsOn() : CAgentCtlCharacterEx
  • getSource()
: msado15::Recordset21
, msado15::_Record
, msado15::Error
, msado15::Recordset20
, msado15::Recordset15
  • GetSource() : CError
  • getSource()
: msado15::_Recordset
, msado15::Record
, msado15::Recordset
  • GetSourceRow() : CImpIGetSourceRow
  • GetSourceRowset() : CImpIRow
  • GetSourcesRowset() : CEnumerator
  • GetSourcesRowsetProc() : CMainWindow
  • GetSpaceUsed() : CEmptyVolumeCache
  • GetSpecification() : CImpIRowsetInfo
  • GetSpeechInput() : CAgentCtlEx
  • GetSpeed() : CAgentCtlCharacterEx
  • GetSplit() : CDataGrid
  • GetSplits() : CDataGrid
  • GetSql() : CUtil
  • GetSQLInfo() : CCustomError
  • getSQLState() : msado15::Error
  • GetSRModeID() : CAgentCtlCharacterEx
  • GetSRStatus() : CAgentCtlCharacterEx
  • GetStartPosition() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • getState()
: msado15::Recordset
, msado15::_Recordset
, msado15::Connection15
, msado15::Recordset15
, msado15::Command
, msado15::Stream
, msado15::_Record
, msado15::_Command
, msado15::_Stream
, msado15::Record
, msado15::Recordset20
, msado15::Connection
  • GetState() : RqsClient
  • getState()
: msado15::_Connection
, msado15::Recordset21
  • GetStaticFolderImage() : CSnapinAbout
  • GetStaticNode() : CComponentData
  • getStatus() : msado15::Recordset21 , RSProxy
  • GetStatus() : CTSFEditWnd , CAsynchBase
  • getStatus()
: msado15::_Recordset
, msado15::Recordset
  • GetStatus() : CCompartmentMonitor
  • getStatus() : msado15::Recordset20
  • GetStatus() : CLangBarItemButton , CAgentCtlRequest
  • getStatus() : msado15::Recordset15
  • getStayInSync()
: msado15::Recordset20
, msado15::Recordset21
, msado15::_Recordset
, msado15::Recordset
  • GetStorage() : CSimpSvrObj
  • GetStr() : CVARIANT , CDialogStream , CVARIANT
  • getStream() : msado15::ADOStreamConstruction
  • GetString()
: msado15::Recordset21
, RqsClient
, MyString
, msado15::_Recordset
, msado15::Recordset20
, msado15::Recordset
  • GetStringFromNSSBuffer() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetStyle() : CAgentCtlBalloonEx
  • GetSummaryInfo() : CSCPPageBindingInfo , CSCPPageGeneral , CExtPageUser , CSCPWiz , CWizExtUser , CSCPPageKeywords
  • GetSupportedMediaTypes() : CPlgTermSample
  • GetSuspended() : CAgentCtlEx
  • GetTabAcrossSplits() : CDataGrid
  • GetTabAction() : CDataGrid
  • GetTableColInfo() : CS1Dialog
  • GetTail() : CLListImpl< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , CExList< TYPE > , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE >
  • GetTailPosition() : CList< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CList< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE >
  • GetTaskList() : CIceSkateFolder , CSkateboardFolder , CBicycleFolder , CDelegationBase
  • GetTaskpadBackground() : CIceSkateFolder , CDelegationBase , CSkateboardFolder , CBicycleFolder
  • GetTaskpadDescription() : CDelegationBase , CSkateboardFolder , CIceSkateFolder , CBicycleFolder
  • GetTaskpadTitle() : CBicycleFolder , CIceSkateFolder , CSkateboardFolder , CDelegationBase
  • GetTemplateName() : CRequestInstance
  • GetTemplateObjId() : CRequestInstance
  • GetText() : CHtmlIFilterBase , CListBoxLite , CHtmlIFilter , CScriptTag , CDataGrid , CTextElement , CAnchorTag , CHtmlElement , CLangBarItemButton , CTitleTag , CImageTag , CSmpFilter , CComboBoxLite , CLangBarItemButton , CStartOfFileElement , HtmlPropIFilter , CTSFEditWnd , CInputTag , CMetaTag , CPropertyTag
  • GetTextExt() : CTSFEditWnd
  • GetTextLen() : CListBoxLite
  • GetTextLength() : CComboBoxLite
  • GetTextRange() : CEditBoxLite
  • GetThreadData() : CThreadData , CBankDlg
  • GetTimeout() : CReceiveMessageDialog
  • GetTimeToBeReceived() : CSendMessageDialog
  • GetTimeToReachQueue() : CSendMessageDialog
  • GetTitle() : CComponent , CWizExtUser , CSCPWiz
  • GetTModel() : WsdlDiscovery::frmMain
  • GetTokenType() : CToken , CHtmlElemBagEntry
  • getToolbar() : CComponent , CToolBarExtension , CComponent
  • GetTooltipString() : CLangBarItemButton
  • GetTop() : CAgentCtlPropertySheet , CAgentCtlCharacterEx
  • GetTrace() : CIntTrace
  • GetTraceEnabled() : RqsConfig
  • GetTracePath() : RqsConfig
  • GetTransactionInfo() : CMDIChild
  • GetTransferParameters() : CSampleDataContainer
  • GetTTSModeID() : CAgentCtlCharacterEx
  • GetType() : CVARIANT
  • getType() : msado15::_Stream
  • GetType() : CVARIANT
  • getType()
: msado15::Parameter
, msado15::Property
, msado15::Field
, msado15::Stream
, msado15::_Parameter
  • GetType() : CCustomPropertyStore , CTSFEditWnd
  • getType() : msado15::Field15
  • GetTypeGUID() : CMgdResType , CStorageResType
  • GetTypeInfo() : CMethodPro , CTable , CAsyncQuerySink , COleClient , AgentNotifySink , HelloWorld , CWrapVBComponent , CTestCOMPerformance , InkCollectorEvents
  • GetTypeInfoCount() : InkCollectorEvents , COleClient , CWrapVBComponent , AgentNotifySink , CTestCOMPerformance , AgentNotifySink , CMethodPro , AgentNotifySink , HelloWorld , CAsyncQuerySink
  • GetTypeInfoRowset() : CTable
  • GetTypeName() : CStorageResType , CMgdResType
  • GetTypeNameAndParams() : CTable
  • GetUID() : CPartitionInfo , CMember , CStorageResource , CCacheMapEl
  • GetUIData() : CSCPUIGeneral
  • GetUInt16() : CDialogStream
  • GetUIObjectOf() : CShellFolder
  • GetUIWindow() : CSimpSvrObj
  • getUnderlyingValue()
: msado15::Field15
, msado15::Field
  • GetUniqueName() : CShellFolder
  • GetUnitBBoxes() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • GetUnknown() : CVARIANT
  • GetUnmarshalClass() : CEntity , CDynamic , CClassFactoryWrapper , CResultset
  • GetURLFromHROW() : CImpIGetRow
  • GetUserClassID() : COleObject
  • GetUserName() : CSecureObject
  • GetUsername() : RqsClient
  • GetUserName() : CImp_DrawDlg
  • GetUsername() : CUtil
  • GetUsers() : IDBAuthAdmin , CDBAuthAdmin , CSids , CDBAuthPlugin
  • GetUserType() : COleObject
  • GetUserURI() : CRTCWin
  • GetUtilInterface()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • getValid()
: comadmin::ICatalogObject
, comadmin::COMAdminCatalogObject
  • GetValue() : CTitleTag
  • getValue()
: comadmin::ICatalogObject
, msado15::Field
, msado15::Field15
  • GetValue() : CHtmlElement , CSmpFilter
  • getValue() : comadmin::COMAdminCatalogObject
  • GetValue() : CCertEncodeStringArray
  • getValue() : msado15::_Parameter
  • GetValue() : CMetaTag
  • getValue() : msado15::Parameter
  • GetValue() : CHtmlIFilterBase , CCertEncodeLongArray , HtmlPropIFilter , CHtmlIFilter , CCertEncodeDateArray , CScriptTag
  • getValue() : msado15::Property
  • GetValue() : CEditValueDlg
  • getVariant() : MyOSPObject
  • GetVariant() : CEditValueDlg
  • getVariant() : MyOSPObject
  • getVersion() : msado15::Connection15
  • GetVersion() : CAgentCtlCharacterEx
  • getVersion()
: msado15::_Connection
, msado15::Connection
  • GetViewStatus() : CComSpy
  • GetVisibilityCause() : CAgentCtlCharacterEx
  • GetVisible() : CAgentCtlBalloonEx , CAgentCtlCommandsEx , CAgentCtlCharacterEx , CAgentCtlCommandEx , CAgentCtlPropertySheet
  • GetVisibleCols() : CDataGrid
  • GetVisibleRows() : CDataGrid
  • GetVoice() : CAgentCtlCommandsEx , CAgentCtlUserInput , CAgentCtlCommandEx
  • GetVoiceCaption() : CAgentCtlCommandEx , CAgentCtlCommandsEx
  • GetWatermarks() : CComponent , CRocket , CComponent , CDelegationBase , CComponentData , CDelegationBase , CBicycle , CFolderNode , CBaseNode , CStaticNode , CBaseNode , CDelegationBase , CComponent , CComponentData , CFolderNode , CComponent , CRocket , CVirtualFile , CDeviceNode , CComponentData , CComponent , CStaticNode , CComponent , CVirtualFile , CComponentData
  • GetWideChar() : CSpecialCharHashEntry
  • GetWidth() : CAgentCtlCharacterEx , CAgentCtlPropertySheet
  • GetWindow() : COleDocument , CShellView , COleInPlaceObject , COleInPlaceActiveObject , COleClient , CFrame , CDeskBand , CSpyCon , CBrowserHost , CToolBand , CCommBand , CImpIOleInPlaceSite , CBrowserHost , CExplorerBar , CBrowserHost
  • GetWindowContext() : CBrowserHost , CSpyCon , CBrowserHost , COleClient , CBrowserHost , CImpIOleInPlaceSite , CBrowserHost
  • GetWindowPlacement() : CWndLite
  • GetWindowText() : CapJ , CWndLite
  • GetWizardPages() : CResData , CObjData , CResData , CObjData
  • GetWnd() : CTSFEditWnd , CWndLite
  • GetWorkItem() : ISAPITHREAD
  • GetWrapCellPointer() : CDataGrid
  • GetWriteEventHandle() : CPluggableTransport
  • GetX509Certificate() : Sample::SignVerify
  • GiveFeedback() : CDropSource , CDragSource
  • Global_Shutdown() : Provider_Globals
  • Global_Startup() : Provider_Globals
  • GlobalVars() : GlobalVars
  • GptAttributes : _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION
  • GrabOutPtr() : CSmartComPtr< T >
  • GraphicsRect : BANDINFOSTRUCT
  • GridSize() : IGrid
  • group_addr : igmp_hdr , igmp_group_record_v3 , igmp_hdr_query_v3
  • groupConnectionMode : CSharp_Draw::Form1
  • groupSendType : CSharp_Draw::Form1
  • GrowTagBuffer() : CHtmlScanner
  • GUID : EXTENSION_NODE
  • Guid : _MOF_INFO
  • GUID : NODESTRUCT
  • guidDraw : CSharp_Draw::Form1
  • guidExtension : EXTENDER_NODE
  • guidNode : EXTENDER_NODE
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- h -

  • hAcceptWindow : _AcceptContext
  • hAccessor : BINDINGINFO
  • hActivitySemaphore : _CONFIGURATION_ENTRY
  • hAgentEntity : _SNMP_MGR_SESSION
  • HandleAccelerators() : CSimpleApp
  • HandleAggregation() : CAggregate
  • HandleErrors() : CImp_DrawDlg
  • handleHitTest() : InkHitTest::InkHitTest
  • HandleMenuPos() : CWndLite
  • HandleMessage() : CDSLConnectionPage , CDSLAdvancedPage , CWndLite , CMDIChildLite , CDialogLite , CPropPageLite , CPropertyPage
  • handleNearestPoint() : InkHitTest::InkHitTest
  • HandleObjectType() : CMainWindow
  • handleResponse() : RSProxy
  • HandleRowset() : CMDIChild
  • HandlerThreadWndProc : CSyncMgrHandler
  • handleUpstreamCacheRequests : PersistedConfiguration
  • HandsOffStorage() : CPersistStorage
  • HangUp() : Conf
  • HasDownloadedChildren : UDDI::Tools::CategoryTreeNode
  • HasEOL() : CRow
  • HasFocusIO() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • hash : fileline
  • Hash() : IRowsetScrollImpl< T, RowsetInterface > , CSpecialCharHashTable
  • HashBmk() : IRowsetScrollImpl< T, RowsetInterface >
  • HashInst() : CDbAlloc
  • HasPropertySheets() : CDelegationBase , CRocket , CDelegationBase , CRocket , CStaticNode , CDelegationBase , CRocket , CDelegationBase , CBicycle , CRocket
  • HasReadAccess() : CUtil
  • hasResponse() : RSProxy
  • HasSelection() : InkClipboard::InkClipboard
  • HasSubFolder() : CShellFolder
  • HasUserCanceled() : CDownloadUI
  • HasWriteAccess() : CUtil
  • hBall1 : _BOUNCEDATA
  • hBall2 : _BOUNCEDATA
  • hBall3 : _BOUNCEDATA
  • hBall4 : _BOUNCEDATA
  • hBezBuffer : _POLYDATA
  • hbmCompat : SPINCUBEINFO
  • hBmp : CREATEGIZMOA , CREATEGIZMOW
  • hbmSave : SPINCUBEINFO
  • Hcluster() : CBasePropertyPage , CExtObject , CBasePropertyPage , CExtObject
  • hCluster : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • hComm : _DRVLINE
  • hCommLink : tagLINE_INFO
  • hConnect : REQUEST_CONTEXT
  • hConnection : Static_Info_Database
  • hConsole : CSimpleObject
  • hCounter : _CounterInfoBlock
  • hdbc : tagSERVERINFO , THREAD_STRUCT , DBCONN
  • hdc : tagArFonts , tagTrackObject
  • hdcCompat : SPINCUBEINFO
  • hDllInst : CDllData
  • hdr : Table
  • head : direct , PrintContext , _LOCKED_LIST
  • Header : _USER_EVENT
  • HEADERS_AVAILABLE : ASYNC_REQUESTER
  • headlineLabel : NewsFlash
  • headlineTF : NewsFlash
  • height : Props
  • Height : ICONIMAGE
  • Hello2J() : Hello2J
  • Hello3J() : Hello3J
  • HelloJ() : HelloJ
  • HelloProc() : CCallAs , CHello
  • HelloWorld() : HelloWorld
  • Help() : CPropertyPage
  • HELP_PAD : storesh::Storesh
  • HelpComplete() : AgentNotifySink , Notify
  • helpMenu : Sample::UI::MainWindow , CapJ
  • henv : tagSERVERINFO , THREAD_STRUCT
  • hEvent : _tagWorkerThreadArgs , WRTHANDLE
  • hEvents : _RECV_INFO , _SEND_INFO
  • hEventShutdown : CExeModule
  • hevtCall : tagLINE_INFO
  • hf : STYLE
  • hFile : _FileInfo , FILE_CONTEXT_TYPE , _TRANSMITFILEARGS , _OPEN_FILE , _AIO_WORK_ITEM , _FFSTREAM
  • hFileRepClient : tReq , tSReq
  • hFileRepServer : tReq , ThreadArgs
  • Hfont() : CExtObject
  • hFont : Props
  • Hfont() : CExtObject
  • hGlobalHeap : _CONFIGURATION_ENTRY
  • hHandle : tagHANDLES , ARRAYQ
  • hHeap : _DYNAMIC_LOCKS_STORE
  • Hicon() : CExtObject
  • hIcon : tagICONEXTRACT , _tagTools
  • Hidden : AutoClaims::InkLayer
  • Hide() : CAgentCtlCharacterEx
  • HideAppWnd() : CSimpSvrApp
  • HideCharacters() : Hello3J
  • HideDocWnd() : CSimpSvrDoc
  • HideHatchWnd() : CSimpSvrDoc
  • hImpToken : _tagLogon
  • hInstance : WININFO , GLOBAL_STRUCT , EXEDLLICONINFO
  • hIocp : _SOCK_INFO
  • hItem : TREEINFO
  • HitSize : InkHitTest::InkHitTest
  • Hittest() : CTextField , CBox , CTextGrid , CCharBlock , CPage , CModel , CView
  • HitTest() : CListViewLite , CTreeViewLite
  • HitTestItem : InkHitTest::InkHitTest
  • HitTestPoint() : CGrid , CBehavior
  • HitTestRadius : InkErase::InkErase
  • hkeyParameters : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • hkRegRoot : _RURASREGROOT
  • hLine : tagLINEINFO
  • hList : FONTLIST
  • hListCand : _IMEUIDATA
  • hListCandMem : _IMEUIDATA
  • hLoadedInst : tagSERVERINFO
  • hLocalFile : tReq , tSReq , ThreadArgs
  • hLogHandle : _CONFIGURATION_ENTRY
  • hLogon : _tagLogon
  • hManagerEntity : _SNMP_MGR_SESSION
  • hMapFile : _FileInfo
  • hMem : blockTag
  • hMemAND : tagICONEXTRACT
  • hMenu : tagPOPUPMENUMAP
  • hMetaf : _PRTDATA
  • hmf : APMFILEHEADER
  • hMgmHandle : _CONFIGURATION_ENTRY
  • hMgrNotificationEvent : _CONFIGURATION_ENTRY
  • hmidi : tag_seq
  • hNew : pipe_state
  • hOld : pipe_state
  • HoldFields() : CDataGrid
  • hOpen : REQUEST_CONTEXT
  • host : CStaticNode::privateData
  • hours : _DOSDTTM
  • HowManyTurns() : CComputer , CHuman
  • HP : CSharp_Draw::Form1
  • Hpage() : CBasePropertyPage
  • hParent : TREEINFO
  • hpbImage : tag_track , tag_smf
  • hpbParm : tagEVENT
  • hpbPendingUserEvent : tag_smf
  • hPdu : _SNMP_MGR_SESSION
  • hPeriodicTimer : _INTERFACE_ENTRY
  • hPipe : WRITER_PARAMS , WRTHANDLE
  • hPort : _WORK_THREAD_DATA
  • hPrevThread : _threadparameters
  • hPrinter : _Printer , _threadparameters
  • hProcessHeap : _APPMEM_INSTANCE
  • hProvider : _PROVIDER
  • hQueue : RECEIVE_CONTEXT
  • hr : _SFFS , CADVCGENDlg , _ERRORMAP , tagADSERRMSG , _RUREGVALUE , _tagWorkerThreadArgs , _tagPREPAREFORSYNCCOMPLETEDMSG , _tagSYNCHRONIZECOMPLETEDMSG , _tagSHOWPROPERTIESCOMPLETEDMSG , _tagSHOWERRORCOMPLETEDMSG , _tagMETHODARGS , _tagCONFIGSETTINGSLPARAM , _tagITEMCONFIGSETTINGSLPARAM
  • HrAddLogicalDiskToArray() : CPartitionInfo
  • HrAddObjectToArray() : CEnumStorageResource
  • HrAddPartitionToArray() : CStorageResource
  • HrConvertDeviceVolumeToLogicalDisk() : CEnumStorageResource
  • HrConvertDeviceVolumeToWMIDeviceID() : CEnumStorageResource
  • HrCreateFriendlyName() : CStorageResource
  • HrCreatePage() : CBasePropertyPage
  • HrCreatePartitionInfo() : CStorageResource
  • hReceiveEvent : _INTERFACE_ENTRY
  • hReceiveWait : _INTERFACE_ENTRY
  • HrEnumNodeResources() : CClusterUtils
  • hRequest : REQUEST_CONTEXT
  • hResource : REQUEST_CONTEXT , _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • hResourceHandle : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • HRESULT() : IUPnPService_DimmingService_SCPDVtbl , _ADODynaCollectionVtbl , IADsErrorVtbl , PropertiesVtbl , IADsErrorVtbl , IHelloWorldVtbl , _ADODynaCollectionVtbl , IHelloWorldVtbl , _ADODynaCollectionVtbl , IHelloWorldVtbl , _ADODynaCollectionVtbl , IHelloWorldVtbl , _ADODynaCollectionVtbl , IHelloWorldVtbl , PropertiesVtbl , IHelloWorldVtbl , PropertiesVtbl , _ADODynaCollectionVtbl , PropertyVtbl , IHelloWorldVtbl , PropertyVtbl , _ADODynaCollectionVtbl , _ADOVtbl , PropertyVtbl , ParametersVtbl , IADsErrorVtbl , ParametersVtbl , IADsErrorVtbl , ParametersVtbl , _ADOVtbl , ParametersVtbl , _ADOVtbl , ParametersVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , _ADOVtbl , ErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , ErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , ErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , ErrorVtbl , _ParameterVtbl , IUPnPService_DimmingService_SCPDVtbl , ErrorVtbl , FieldsVtbl , ErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , FieldsVtbl , ErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , FieldsVtbl , ErrorVtbl , IMMCControlVtbl , FieldVtbl , IMMCControlVtbl , ErrorVtbl , FieldVtbl , ErrorsVtbl , IMMCControlVtbl , ErrorsVtbl , FieldVtbl , ErrorsVtbl , FieldVtbl , IAppletSessionNotifyVtbl , ErrorsVtbl , ADORecordsetConstructionVtbl , ErrorsVtbl , IAppletSessionNotifyVtbl , ADORecordsetConstructionVtbl , ErrorsVtbl , IAppletSessionNotifyVtbl , ADORecordsetConstructionVtbl , IAppletSessionNotifyVtbl , ADORecordsetConstructionVtbl , ErrorsVtbl , _RecordsetVtbl , IAppletSessionNotifyVtbl , ErrorsVtbl , _RecordsetVtbl , IAppletSessionVtbl , ErrorsVtbl , _CommandVtbl , _RecordsetVtbl , IAppletSessionVtbl , _CommandVtbl , _RecordsetVtbl , _CommandVtbl , _RecordsetVtbl , IAppletSessionVtbl , _CommandVtbl , _RecordsetVtbl , IAppletSessionVtbl , IAppletNotifyVtbl , _RecordsetVtbl , _CommandVtbl , IAppletVtbl , _RecordsetVtbl , _CommandVtbl , IAppletVtbl , _RecordsetVtbl , IAppletVtbl , _CommandVtbl , _RecordsetVtbl
  • hResult : CAsyncQuerySink
  • HRESULT() : _CommandVtbl , _RecordsetVtbl , _CommandVtbl , _RecordsetVtbl , _CommandVtbl , _RecordsetVtbl , _CommandVtbl , _RecordsetVtbl , _CommandVtbl , _RecordsetVtbl , _CommandVtbl , _RecordsetVtbl , _ConnectionVtbl , _RecordsetVtbl , _ConnectionVtbl , IAppletSessionVtbl , _ConnectionVtbl , ADOConnectionConstructionVtbl , _ConnectionVtbl , IAppletSessionVtbl , IAppletVtbl , ADOConnectionConstructionVtbl , _RecordsetVtbl
  • hResult : IADsErrorVtbl
  • HRESULT() : _RecordsetVtbl , IAppletVtbl , IAppletSessionVtbl , _RecordsetVtbl , IAppletVtbl , _RecordsetVtbl , IAppletVtbl , IAppletNotifyVtbl , _RecordsetVtbl , IAppletNotifyVtbl , IUPnPService_DimmingService_SCPDVtbl , IAppletSessionNotifyVtbl , IAppletSessionVtbl , _RecordsetVtbl , IAppletSessionVtbl , _RecordsetVtbl , IAppletSessionVtbl , IAppletSessionNotifyVtbl , _RecordsetVtbl , IAppletSessionVtbl , _RecordsetVtbl , IAppletSessionVtbl , _RecordsetVtbl , IMMCControlVtbl , IAppletSessionNotifyVtbl , _RecordsetVtbl , IAppletSessionNotifyVtbl , _ADODynaCollectionVtbl , PropertiesVtbl , _ADOCollectionVtbl , PropertiesVtbl , _ADOCollectionVtbl , PropertyVtbl , _ADOCollectionVtbl , _RecordsetVtbl , _ADOCollectionVtbl , ParametersVtbl , ADORecordsetConstructionVtbl , IAppletSessionNotifyVtbl , _ParameterVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , ADORecordsetConstructionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , FieldsVtbl , FieldVtbl , ADORecordsetConstructionVtbl , IMMCControlVtbl , FieldVtbl , IAppletSessionNotifyVtbl , FieldVtbl , ADORecordsetConstructionVtbl , IAppletSessionNotifyVtbl , IMMCControlVtbl , FieldVtbl , IMMCControlVtbl , FieldVtbl , IUPnPService_DimmingService_SCPDVtbl , FieldVtbl , FieldsVtbl , IUPnPService_DimmingService_SCPDVtbl , FieldsVtbl , _ParameterVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , ParametersVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOCollectionVtbl , PropertyVtbl , _ADOCollectionVtbl , PropertyVtbl , _ADODynaCollectionVtbl
  • HrFindDiskWithLogicalDisk() : CEnumStorageResource
  • HrFindDiskWithWMIDeviceID() : CEnumStorageResource
  • HrFixupDisks() : CEnumStorageResource
  • HrGetApplicationCompatibilityInfo() : CMyCapabilities
  • HrGetBootLogicalDisk() : CEnumStorageResource
  • HrGetClusterDiskInfo() : CEnumStorageResource
  • HrGetClusterProperties() : CEnumStorageResource
  • HrGetCrashDumpLogicalDisk() : CEnumStorageResource
  • HrGetDeviceID() : IStorageProperties , CStorageResource
  • HrGetDeviceIndex() : IStorageProperties , CStorageResource
  • HrGetDiskNames() : IStorageProperties , CStorageResource
  • HrGetDisks() : CEnumStorageResource
  • HrGetFriendlyName() : IPartitionProperties , CPartitionInfo
  • HrGetLogicalDisks() : CPartitionInfo
  • HrGetObjectInfo() : CExtObject
  • HrGetPageFileLogicalDisks() : CEnumStorageResource
  • HrGetPartitionInfo() : CStorageResource
  • HrGetQuorumResourceName() : CClusterUtils
  • HrGetSCSIBus() : CStorageResource , IStorageProperties
  • HrGetSCSIInfo() : CEnumStorageResource
  • HrGetSCSIPort() : CStorageResource , IStorageProperties
  • HrGetSignature() : CStorageResource , IStorageProperties
  • HrGetSystemDevice() : CEnumStorageResource
  • HrGetUIInfo() : CExtObject
  • hrGiveResponse : tagAppletTokenRequest
  • HrInit() : SIndexedDisk , CBasePropertyPage
  • HrInitialize() : CNodeData , CNetInterfaceData , CResData , CGroupData , CClusterData , CNodeData , CNetworkData , CObjData , CResData , CResTypeData , CNetInterfaceData , CClusterData
  • HrIsClusterCapable() : CStorageResource
  • HrIsClusterServiceRunning() : CClusterUtils
  • HrIsCoreResource() : CClusterUtils
  • HrIsDynamicDisk() : IStorageProperties , CStorageResource
  • HrIsGPTDisk() : IStorageProperties , CStorageResource
  • HrIsGroupOwnedByThisNode() : CClusterUtils
  • HrIsLogicalDiskNTFS() : CEnumStorageResource
  • HrIsNodeClustered() : CClusterUtils
  • HrIsNTFS() : IPartitionProperties , CPartitionInfo
  • HrIsPartitionGPT() : CStorageResource
  • HrIsPartitionLDM() : CStorageResource
  • HrIsSystemBusManaged() : CEnumStorageResource
  • HrIsThisLogicalDisk() : CPartitionInfo , IPartitionProperties
  • hrLastError : DebugGlobals
  • HrLoadEnum() : CEnumStorageResource
  • HrLoadGroupResources() : CClusterUtils
  • HrLogDiskInfo() : CEnumStorageResource
  • HrLogLogicalDiskInfo() : CPartitionInfo
  • HrNodeResourceCallback() : CEnumStorageResource , CClusterUtils
  • hRootKey : REGENTRY , DOREGSTRUCT , REGSTRUCT , _REGSTRUCT
  • HrProcessWMIDiskObject() : CEnumStorageResource
  • HrPruneCrashDumpBus() : CEnumStorageResource
  • HrPruneDisks() : CEnumStorageResource
  • HrPruneDynamicDisks() : CEnumStorageResource
  • HrPruneGPTDisks() : CEnumStorageResource
  • HrPrunePageFileDiskBuses() : CEnumStorageResource
  • HrPruneSystemDisks() : CEnumStorageResource
  • hrRequest : HTTP_REQUESTCB_PARAM
  • hrResult : IAppletSessionNotifyVtbl , IAppletNotifyVtbl , IAppletSessionNotifyVtbl
  • HrSaveData() : CExtObject
  • HrSendStatusReport() : CMgdClusCfgInit
  • HrSetDeviceID() : CPartitionInfo , IPartitionProperties
  • HrSetFriendlyName() : IStorageProperties , CStorageResource
  • HrSetThisDiskToBeManaged() : CEnumStorageResource
  • HrSortDisksByIndex() : CEnumStorageResource
  • hRtmHandle : _CONFIGURATION_ENTRY
  • hRtmNotificationHandle : _CONFIGURATION_ENTRY
  • HScroll() : CController
  • hScrollBar : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • hScrollBar_Scroll() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • hScrollBar_ValueChanged() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • hseparator : TableHdr
  • hService : _CLIPBOOKSERVER_RESOURCE
  • hseTf : _AIO_WORK_ITEM
  • hSmf : tag_smfopenstruct , tag_seq
  • hSnmpSession : _SNMP_MGR_SESSION
  • hstmt : tagSERVERINFO , DBCONN
  • htask : tag_smf
  • htCall : _DRVLINE
  • hTempoMap : tag_smf
  • hThread : REQUEST_CONTEXT , THREADINFO , DBG_THREAD_INFO , WRTHANDLE
  • hTimerQueue : _CONFIGURATION_ENTRY
  • htLine : _DRVLINE
  • HtmlPropIFilter() : HtmlPropIFilter
  • HtmlPropIFilterCF() : HtmlPropIFilterCF , HtmlPropIFilter
  • htMSPLineHandle : _DRVLINE
  • hTokenHandle : tReq , tSReq
  • htonl() : DTHandler
  • htons() : DTHandler
  • hTreeItem : tagObject
  • hVbl : _SNMP_MGR_SESSION
  • hViewContext : _SNMP_MGR_SESSION
  • hWindow : REQUEST_CONTEXT
  • hWnd : _SNMP_MGR_SESSION
  • hwnd : _tagStatus
  • hWnd : _threadparameters
  • hwnd : _tagWorkerThreadArgs
  • hWnd : _SOCK_INFO
  • hwnd : view , tagSERVERINFO , _tagTools
  • hWnd : _BALLDATA , tag_seq
  • hWndButton : TEXTBUTTON_STRUCT
  • hWndFormatListBox : CHILDWINDOWDATA
  • hwndHidden : _PROPSHEETCFG
  • hWndListBox : GLOBAL_STRUCT , DEB_STARTUP_INFO_STRUCT
  • hWndMain : GLOBAL_STRUCT
  • hwndOwner : COLORPICKSTATE
  • hWndParent : _tagPREPAREFORSYNCMSG , _tagSHOWERRORMSG , CREATEGIZMOA , _tagSHOWPROPERTIESMSG , CREATEGIZMOW , _tagSYNCHRONIZEMSG
  • hwndParentSheet : _PROPSHEETCFG , _DSA_SEC_PAGE_INFO
  • hWndResults : CREATEDATA
  • hWndStopButton : CREATEDATA
  • hWndSynch : _SynchInfo
  • hWndToolBar : GLOBAL_STRUCT
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- i -

  • i : UnionInt64
  • IAsyncFace : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • iBrushStyle : tagBRUSHSTYLELOOKUP
  • ic : InkHitTest::InkHitTest , Serialization::SerializationForm
  • icmp6_checksum : icmpv6_hdr
  • icmp6_code : icmpv6_hdr
  • icmp6_echo_id : icmpv6_echo_request
  • icmp6_echo_sequence : icmpv6_echo_request
  • icmp6_type : icmpv6_hdr
  • icmp_checksum : icmp_hdr
  • icmp_code : icmp_hdr
  • icmp_id : icmp_hdr
  • icmp_sequence : icmp_hdr
  • icmp_type : icmp_hdr
  • iComment : tagCMTMLTFMT
  • IconBox : Sample::UI::AboutBox
  • IconImages : ICONRESOURCE
  • iCurrentXTranslation : SPINCUBEINFO
  • iCurrentXTranslationInc : SPINCUBEINFO
  • iCurrentYTranslation : SPINCUBEINFO
  • iCurrentYTranslationInc : SPINCUBEINFO
  • iCurrentZTranslation : SPINCUBEINFO
  • iCurrentZTranslationInc : SPINCUBEINFO
  • id : IIDLookUp , CBicycle , CSkateboard , CIceSkate , CSkyVehicle , statel , TableHdr , ColPropsList , CellDataList , TableSelection , PrintContext , CAsyncTest::threadParam
  • iDataSize : WRITER_PARAMS
  • idButton : TEXTBUTTON_STRUCT
  • idCommand : MYTOOLINFO
  • idCount : MEMICONDIR , ICONDIR
  • IDD : CExtPageUser , CADQIDlg , CDlgIADs , CGetInfoExDlg , CDlgIADsContainer , CRenameDlg , CMoveDlg , CDlgIADsLargeInteger , CDlgIADsOpenDSObject , CDlgIADsPropertyList , CDlgIDirectoryObject , CDeleteObjectDlg , CDlgIDirectorySearch , CDlgIADsSecurityDescriptor , FaxDlg , NewDocDlg , CDisdrawDlg , CLoginDlg , CImp_DrawDlg , CCloseQueueDialog , CAppExportDlg , CCreateQueueDialog , CDeleteQueueDialog , CAppInstallDlg , CLocateDialog , COpenQueueDialog , CAppUtilDlg , CReceiveMessageDialog , CReceiveWaitDialog , CCompImportDlg , CSendMessageDialog , CRTCIncomingDlg , CCompInstallDlg , CRTCOutgoingDlg , CDeviceProp , CConnectDlg , CGenericUCPDlg , CMMCControl , CUtilitiesDlg , CAdvClientDlg , COfficeDlg , CAboutDlg , CCmdLineConsumerDlg , CPermEventsDlg , CVCExploreDlg , CWbemClientDlg , CCapMFCDlg , CComSpyPropPage , CXMLTreeDlg , CBasePropertyPage , CSelectEventsDlg , CClipBookServerParamsPage , CFileShareSampleParamsPage , CClientDlg , CMessageDlg , CProcessDlg , CMain , CQueryDlg , CServerDlg , CBankDlg , CSessionDlg , CShutdownDlg , CTestDlg , CWaitDlg , CWaitSystemDlg , CADVCGENDlg , CDlgDest , CDlgSrc , CContextSamplePropPage , CSCPPageGeneral , CSCPPageBindingInfo , CSCPPageKeywords
  • IddPropertyPage() : CBasePropertyPage
  • IddWizardPage() : CBasePropertyPage
  • ident : tagCMTMLTFMT
  • idEntries : MEMICONDIR , ICONDIR
  • IDFromHMenu() : CStatusHelper
  • Idle : _SEC_CONTEXT , AgentNotifySink , Notify
  • IDM_NEW_BACKGROUND : CBackground
  • IDM_NEW_LAND : CLandBasedVehicle
  • IDM_NEW_PEOPLE : CPeoplePoweredVehicle
  • IDM_NEW_SKY : CSkyBasedVehicle , CSkyVehicle
  • IDM_NEW_SPACE : CSpaceVehicle , CSpaceFolder
  • IDM_PAUSE_SKY : CPlane
  • IDM_PAUSE_SPACE : CRocket
  • IDM_START_SKY : CPlane
  • IDM_START_SPACE : CRocket
  • IDM_STOP_SKY : CPlane
  • IDM_STOP_SPACE : CRocket
  • idReserved : MEMICONDIR , ICONDIR
  • IdsCaption() : CBasePropertyPage
  • idsMsg : tagSTATMESSAGEMAP
  • idString : MYTOOLINFO
  • idType : MEMICONDIR , ICONDIR
  • idxDisk : SIndexedDisk
  • idxTrack : tag_track
  • iField : FieldInfo
  • iForm : SStemForm
  • iGiveWidth : _tagStatus
  • iGizmo : CREATEGIZMOA , CREATEGIZMOW
  • igsStats : _CONFIGURATION_ENTRY
  • iHeight : _tagTools
  • iHelloCount : CDllShared
  • iIcon : tagLABELEXTRACT
  • iid
: fullsvr::AsyncFullServ
, fullsvr::AsyncIFullServ
, fullsvr::FullServ
, fullsvr::ICallFactory
, fullsvr::ICancelMethodCalls
, fullsvr::IFullServ
, fullsvr::ISynchronize
, cascadeec::INewsEvent
, cascadeec::INewsEventDefault
, comadmin::COMAdminCatalog
, comadmin::COMAdminCatalogCollection
, comadmin::COMAdminCatalogObject
, comadmin::ICatalogCollection
, comadmin::ICatalogObject
, comadmin::ICOMAdminCatalog
, newseventclass::INewsEvent
, newseventclass::INewsEventDefault
, persistatl::INewsEvent
, persistatl::INewsEventDefault
, qcnotify::INotify
, qcnotify::INotifyDefault
, qcorder::IOrder
, qcorder::IOrderDefault
, qcship::IShip
, qcship::IShipDefault
, msado15::_ADO
, msado15::_Collection
, msado15::_Command
, msado15::_Connection
, msado15::_DynaCollection
, msado15::_Parameter
, msado15::_Record
, msado15::_Recordset
, msado15::_Stream
, msado15::ADOCommandConstruction
, msado15::ADOConnectionConstruction
, msado15::ADOConnectionConstruction15
, msado15::ADORecordConstruction
, msado15::ADORecordsetConstruction
, msado15::ADOStreamConstruction
, msado15::Command
, msado15::Command15
, msado15::Connection
, msado15::Connection15
, msado15::ConnectionEvents
, msado15::ConnectionEventsVt
, msado15::Error
, msado15::Errors
, msado15::Field
, msado15::Field15
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::IRecFields
, msado15::Parameter
, msado15::Parameters
, msado15::Properties
, msado15::Property
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
, msado15::RecordsetEvents
, msado15::RecordsetEventsVt
, msado15::Stream
, vcacct::CAccount
, vcacct::CGetReceipt
, vcacct::CMoveMoney
, vcacct::CUpdateReceipt
, vcacct::IAccount
, vcacct::IGetReceipt
, vcacct::IMoveMoney
, vcacct::IUpdateReceipt
, CSmartPtr< T >
  • IIDLookUp() : IIDLookUp
  • iImage : CREATEGIZMOA , CREATEGIZMOW , MYTOOLINFO
  • iInfo : tagRGPT
  • iInit : _PREF
  • iInUse : blockTag
  • iisStats : _INTERFACE_ENTRY
  • iItem : tagUser
  • iLastX : CSharp_Draw::Form1
  • iLastY : CSharp_Draw::Form1
  • iLen : item_tag , RUN
  • iLine : DebugGlobals
  • iList : SStemForm
  • ImageEventCallback() : WiaWrap::CEventCallback
  • iMapMode : tagMAPMODELOOKUP
  • iMaxScale : PROVTYPEINFO
  • iMaxWidth : _tagStatus
  • ImeState : _IMEUIDATA
  • IMGID_IfIndex : _IPSAMPLE_MIB_GET_INPUT_DATA
  • IMGID_TypeID : _IPSAMPLE_MIB_GET_INPUT_DATA
  • IMGOD_Buffer : _IPSAMPLE_MIB_GET_OUTPUT_DATA
  • IMGOD_IfIndex : _IPSAMPLE_MIB_GET_OUTPUT_DATA
  • IMGOD_TypeID : _IPSAMPLE_MIB_GET_OUTPUT_DATA
  • iMinWidth : _tagStatus
  • ImpersonateClient() : ISAPI_REQUEST
  • ImportComponent()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • ImportDialog() : CImportRes
  • ImportDialogs() : CImportRes
  • ImportDlgInit() : CImportRes
  • ImportPublicKeyBlob() : Sample::MySignedXml
  • ImportStrings() : CImportRes
  • iMRNumber : _metalookup
  • iMsg : GBMSG
  • IMSID_Buffer : _IPSAMPLE_MIB_SET_INPUT_DATA
  • IMSID_BufferSize : _IPSAMPLE_MIB_SET_INPUT_DATA
  • IMSID_IfIndex : _IPSAMPLE_MIB_SET_INPUT_DATA
  • IMSID_TypeID : _IPSAMPLE_MIB_SET_INPUT_DATA
  • IMyPersistStreamImpl_GetSizeMax() : CLine , CPoint
  • IMyPersistStreamImpl_Load() : CLine , CPoint
  • IMyPersistStreamImpl_Save() : CLine , CPoint
  • In() : CSet , CCTypeSet
  • Inactive() : CPlgPin
  • InAirPackets()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • InCall() : Conf
  • inch : APMFILEHEADER
  • InConnection() : CPluggableTransport
  • IncrementNestCount() : CSafeRefCount
  • IncrementOpenRowsets() : CCommand
  • IncrementProgressBar() : CDownloadUI
  • Index : tagLABELEXTRACT , _ADODynaCollectionVtbl , ErrorsVtbl , _RecordsetVtbl , FieldsVtbl , ParametersVtbl , PropertiesVtbl
  • Indicate() : CMySink
  • IndicateToConsumer() : CConsumer , CProvider_IWbemUnboundObjectSink , CConsumer
  • indPtr : STR_BINDING
  • inet_addr() : DTHandler
  • inet_ntoa() : DTHandler
  • iNext : blockTag
  • InfoClass : _Query
  • InfoMessage()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • InInOutPipesSample() : CSimpleClass
  • INIT : ASYNC_REQUESTER
  • Init() : CComSpySqlAudit , IComSpyAudit , CAsyncTest , CAsyncXXX< T, ISyncFace, IAsyncFace > , CConnectionPointContainer , CEnumXXX< T, ELT_T, IFACE > , CUnknown , CServer , CFrame , CAsyncFullServ , CString , CVariant , MyDataSource , MyOSPObject , CController , CCanvas , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI , CSampleMSPCall , CMyInkEvents , CMyInkCollector , InkCollectorEvents , CGrid , CBehavior , CContext , MainDlg , CClusPropValueList , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CMemoryMappedInputStream , CMmStreamConsecBuf , CSerialStream , CSampleWordBreaker , CSampleStemmer , CSmpFilter , CFileViewer
  • init() : RSProxy , HelloJ , Hello2J , Hello3J
  • initAdminCatlog() : NewsFlash , NewsSubscriber
  • InitArray() : CComputer , CHuman
  • InitControls() : CS1Dialog , CS2Dialog , CS3Dialog , CS4Dialog , CTypesDialog
  • InitDefaultDevices() : CStaticNode
  • InitDefaultFolder() : CDeviceNode
  • InitDefaultVFile() : CFolderNode
  • InitFilterRegion() : CHtmlElement , CTextElement
  • initForm() : NewsFlash , NewsSubscriber , About , CapJ
  • InitFromData() : COleObject
  • InitialControlsState() : CRTCOutgoingDlg
  • Initialise() : CResultset
  • Initialize() : CComponentData , CGenerateRC , CImportRes , CDownloadUI , CClassPro , CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices , CProvider , CMyEventProvider , CRefClient , CSampleDataSource , CHiPerfProvider , CRefresher , CInstPro , CMethodPro , ISAPI_EXTENSION , Notify , CMember , Conf , CPluggableTransport , CMgdClusCfgInit , CMyCapabilities , CMyEvictListener , CMyMemberSetChangeListener , CMyStartupListener , CEnumStorageResource , CMgdClusCfgInit , CColumnProvider , CEmptyVolumeCache , CShellFolder , CShellExt , CTSFMainWnd , CCompartmentMonitor , CEntity , CStaticMap , CAsynchBase , CRowPosition , CImpIDBInitialize , CAuthenticateAdmin , CAuthenticateContext , CDBAuthAdmin , CSampleDataContainer , CSampleDirectory , CContextAdmin , CSDKSamplePlaylistParser , CAdminNotifyHandler , CContextMenu , CSCP , CMultiValuedAttributeEditor , CSCPWiz , CMultiValuedAttributeEditor , CProppageUser , CThumbNailPhotoHolder , CWizExtUser , RqsEngine , CSyncMgrHandler , CPlgFilter , CAVIFileWriter , CWorkerThread , CAVIFileReader , UPNPDimmerDevice , CDimmer , NIDequeIter_c< T > , CObjSecurity , CCertExitSample , CCertPolicySample , CRequestInstance , CCertPolicySample , CComponent , CComponentData , CComponent , CComponentData , CPerson , CRocket , CComponent , CComponentData , CRocket , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CRocket , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CRocket , CComponent
  • InitializeComponent()
: CSharp_Draw::Form1
, CSharp_Draw::InputBox
, Sample::UI::AboutBox
, Sample::UI::MainWindow
, AutoClaims::AutoClaims
, InkBlog::AddBlog
, InkBlog::_Default
, InkBlog::InkArea
, InkClipboard::InkClipboard
, InkCollection::InkCollection
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkErase::InkErase
, InkHitTest::InkHitTest
, InkRecognition::InkRecognition
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
, Serialization::SerializationForm
, UDDI::Tools::CategoryTreeView
, WsdlDiscovery::frmMain
  • InitializeDevTypeArray() : CGenericUCPDlg
  • InitializeDynamic() : CPlgTermSample
  • InitializeEvents() : RqsEngine
  • InitializeEx() : CEmptyVolumeCache
  • InitializePlugin() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • InitializePrivate() : CPlgFilter
  • InitializeRTCApp() : CRTCIncomingDlg , CRTCOutgoingDlg
  • InitializeServerSocket() : RqsEngine
  • InitializeServerSocketCb() : RqsEngine
  • InitializeUDNList() : CGenericUCPDlg
  • initializeUi() : CDisdrawDlg
  • initializeUI() : CImp_DrawDlg
  • Initialze() : CAppInfo
  • initiator_address : gss_channel_bindings_struct
  • initiator_addrtype : gss_channel_bindings_struct
  • InitInstance() : CSCPWizApp , CClipBookServerApp , CPermEventsApp , CImp_DrawApp , CADsFirstExtApp , CVCExploreApp , CClientApp , CADVCGENApp , CAppLite , CWinApp , CMultichanApp , CSCPCMenuApp , CMyUIExtApp , CMyWizExtApp , CADsFirstExtApp , CADQIApp , CPrintSDIApp , CDisdrawApp , CTestApp , CDisdrawApp , CRTCIncomingApp , CRTCOutgoingApp , CGenericUCPApp , CHMMSampleApp , CCmdLineConsumerApp , CWbemClientApp , CCapMFCApp , CXMLTreeApp , CFileShareSampleApp , CAPIApp
  • InitList() : CShellView
  • InitMediaType() : CPlgPin
  • InitMenu() : CLangBarItemButton
  • InitNew() : CPersistStorage , CDynamic , CEntity , CResultset , CPropertyPage
  • InitObject() : CSimpleSite
  • InitOCX() : CDelegationBase
  • InitOle() : InitOle
  • InitOnce() : ISAPI_EXTENSION
  • InitPage() : CPage
  • InitProgressBar() : CDownloadUI
  • InitPropCombo() : CFullConnect
  • InitSchemaCombo() : CSchemaDlg
  • InitSchemas() : CSchemaDlg
  • InitSecurity() : CHMMSampleApp , CWbemClientApp
  • InitSize() : CClusPropList
  • InitStatChunk() : CAnchorTag , CImageTag , CInputTag , CMetaTag , CScriptTag , CStartOfFileElement , CTextElement , CPropertyTag , CHtmlElement
  • InitThreadPool() : ISAPITHREAD
  • InitTreeView() : CSchemaDlg
  • InkArea() : InkBlog::InkArea
  • InkClipboard() : InkClipboard::InkClipboard
  • InkClipboard_Load() : InkClipboard::InkClipboard
  • InkClipboard_MouseDown() : InkClipboard::InkClipboard
  • InkClipboard_MouseMove() : InkClipboard::InkClipboard
  • InkClipboard_MouseUp() : InkClipboard::InkClipboard
  • InkClipboard_Paint() : InkClipboard::InkClipboard
  • InkCollection() : InkCollection::InkCollection
  • InkCollection_Load() : InkCollection::InkCollection
  • InkCollection_Paint() : InkCollection::InkCollection
  • inkCollector : InkBlog::InkArea
  • InkCollectorEvents() : InkCollectorEvents
  • InkData : InkBlog::InkArea
  • InkDividerForm() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • InkDividerForm_Load() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • inkEdMake : AutoClaims::AutoClaims
  • inkEdMake_Enter() : AutoClaims::AutoClaims
  • inkEdModel : AutoClaims::AutoClaims
  • inkEdModel_Enter() : AutoClaims::AutoClaims
  • inkEdName : AutoClaims::AutoClaims
  • inkEdPolicyNumber : AutoClaims::AutoClaims
  • inkEdYear : AutoClaims::AutoClaims
  • inkEdYear_Enter() : AutoClaims::AutoClaims
  • InkEnabled : InkBlog::InkArea
  • InkErase() : InkErase::InkErase
  • InkErase_Load() : InkErase::InkErase
  • InkErase_OnMouseMove() : InkErase::InkErase
  • InkErase_OnPaint() : InkErase::InkErase
  • InkHitTest() : InkHitTest::InkHitTest
  • InkHitTest_Load() : InkHitTest::InkHitTest
  • InkHitTestForm_Paint() : InkHitTest::InkHitTest
  • InkItem : InkHitTest::InkHitTest
  • InkLayer() : AutoClaims::InkLayer
  • inkLayers : AutoClaims::AutoClaims
  • inkPicture1 : PaperForm::PaperForm
  • inkPictVehicle : AutoClaims::AutoClaims
  • inkPictVehicle_Paint() : AutoClaims::AutoClaims
  • InkRecognition() : InkRecognition::InkRecognition
  • InkRecognition_Load() : InkRecognition::InkRecognition
  • InkSpaceHeight : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InkSpaceToPixel() : InkClipboard::InkClipboard
  • InkSpaceWidth : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InkZoom() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InkZoom_Load() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InkZoom_Resize() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • iNode : _SCHEMAINFO
  • InOutPipeSample() : CSimpleClass
  • InPipeSample() : CSimpleClass
  • InPlaceDeactivate() : COleInPlaceObject
  • inputArea : InkBlog::InkArea
  • InputBox() : CSharp_Draw::InputBox
  • InquireRosterConfirm() : CAppletSession
  • Insert() : CAgentCtlCommandsEx , CEntity
  • InsertAfter() : CLinkable , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE >
  • InsertAt() : CVector< TYPE, IDX >
  • InsertBack() : ClientList
  • InsertBackgroundItems() : CContextMenu
  • InsertBefore() : CLinkable , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE >
  • InsertChildItems() : CDeviceNode
  • InsertColumn() : CListViewLite
  • InsertEmbedded() : CTSFEditWnd
  • InsertEmbeddedAtSelection() : CTSFEditWnd
  • InsertFirst() : CListHeader
  • InsertIntoBack() : NIDeque_c< T >
  • InsertIntoExtBuffer() : CExtBuffer
  • InsertIntoFront() : NIDeque_c< T >
  • InsertIntoPluginCollection() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • InsertItem() : CListViewLite , CTreeViewLite , CComboBoxEx , CTabLite
  • InsertItems() : CContextMenu
  • InsertLast() : CListHeader
  • InsertMenus() : CFrame
  • InsertNewRow() : CMDIChild
  • InsertObject() : CSimpleDoc
  • insertRequest() : RSProxy
  • insertResponse() : RSProxy
  • InsertRow() : CImpIRowsetChange , IRowsetChangeImpl< T, Storage, RowClass >
  • InsertRowImmediate() : CDBFile
  • insertRows() : MyOSPObject
  • InsertScopeItems() : CStaticNode
  • InsertTextAtSelection() : CTSFEditWnd
  • INSSBufferImpl() : CacheProxySamplePlugin::INSSBufferImpl
  • Install() : CSysLCESub , ICOMSysLCE
  • INSTALL_FLAG : helper::sampleConstants
  • InstallApplication()
: comadmin::ICOMAdminCatalog
, comadmin::COMAdminCatalog
  • installCascadeButton : NewsSubscriber
  • installCascadeButton_click() : NewsSubscriber
  • InstallComponent()
: comadmin::ICOMAdminCatalog
, comadmin::COMAdminCatalog
  • InstallEventBorder : NewsFlash
  • installEventButton : NewsFlash
  • installEventButton_click() : NewsFlash
  • InstallEventClass()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • InstallMultipleComponents()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • InstallMultipleEventClasses()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • Instance() : CFrame
  • InstanceThread() : CMyEventProvider
  • InterfaceID : _SAMPLE_HELPER_DATA_
  • InterfaceSupportsErrorInfo() : CMMCControl , CAccount , HelloWorld , CMoveMoney , CLine , CContextAdmin , CUpdateReceipt , CHuman , CGetReceipt , CHandler , CMoveMoney , CAccount , CByotTransObj , CEnlistTransaction , CNewsEvent , CAccount , CGetReceipt , CComputer , CMoveMoney , CDynamic , CProxy , CResultset , CDBAuthAdmin , CEntity , ADsError , CCreateTable , CAuthenticateAdmin , CAccount , CExtObject
  • InternalBindLookup() : CProxy
  • InternalClear() : CFastVariant
  • InternalCopy() : CFastVariant
  • InternalInsert() : CEntity
  • InternalLookup() : CProxy
  • InternalNextEntity() : CProxy
  • Interrupt() : CAgentCtlCharacterEx
  • iNumberOfInArguments() : CGenericUCPDlg
  • Invalidate() : CView
  • invalidateRect : InkHitTest::InkHitTest
  • Invoke() : CBrowserHost , AgentNotifySink , COleClient , CTestCOMPerformance , CWrapVBComponent , CAsyncQuerySink , CMethodPro , CBrowserHost , CEventSink , AgentNotifySink , CWebBrowser , HelloWorld , InkCollectorEvents , AgentNotifySink
  • InvokeApplet() : CAppletSession
  • InvokeAppletConfirm() : CAppletSession
  • InvokeCommand() : CNetInterfaceData , CResData , CGroupData , CExtObject , CNetworkData , CResTypeData , CClusterData , CNetworkData , CShellExt , CNetInterfaceData , CClusterData , CNodeData , CGroupData , CResTypeData , CObjData , CNodeData , CResData , CDeskBand , CContextMenu , CObjData
  • InvokeNotify() : qcship::Ship
  • InvokeNotifyIDispatch() : COShip2 , COShip
  • InvokeNotifyVtable() : COShip , COShip2
  • InvokeShip() : COrder , qcorder::Order
  • InvokeShipIDispatch() : COrder
  • InvokeShipVtable() : COrder
  • IO_READ : CSampleDataContainer
  • IO_WRITE : CSampleDataContainer
  • Iocp : _WSAOVERLAPPEDPLUS
  • IoctlArgs : _WSAOVERLAPPEDPLUS
  • ioctlsocket() : DTHandler
  • IOOperation : _PER_IO_CONTEXT
  • iOption : tagOPTIONS
  • iOptions : SPINCUBEINFO
  • iOrdinal : INDEXINFO , COLDESC
  • ip_checksum : ip_hdr
  • ip_destaddr : ip_hdr
  • ip_id : ip_hdr
  • ip_offset : ip_hdr
  • ip_protocol : ip_hdr
  • ip_srcaddr : ip_hdr
  • ip_tos : ip_hdr
  • ip_totallength : ip_hdr
  • ip_ttl : ip_hdr
  • ip_verlen : ip_hdr
  • IpAddress : Static_Statistic
  • ipAddress : _INTERFACE_ENTRY , _BINDING_ENTRY
  • iPenStyle : tagPENSTYLELOOKUP
  • iPenWidth : tagPENWIDTHLOOKUP
  • IPersistStreamInit_Load() : CComSpy
  • IPersistStreamInit_Save() : CComSpy
  • ipMask : _BINDING_ENTRY
  • iProtocol : _SP_OPTIONS
  • ipSource : _PACKET
  • ipv6_destaddr : ipv6_hdr
  • ipv6_frag_id : ipv6_fragment_hdr
  • ipv6_frag_nexthdr : ipv6_fragment_hdr
  • ipv6_frag_offset : ipv6_fragment_hdr
  • ipv6_frag_reserved : ipv6_fragment_hdr
  • ipv6_hoplimit : ipv6_hdr
  • ipv6_nexthdr : ipv6_hdr
  • ipv6_payloadlen : ipv6_hdr
  • ipv6_srcaddr : ipv6_hdr
  • ipv6_vertcflow : ipv6_hdr
  • iRecord : _playinfo , _htdata
  • irecRecNumber : tagDIAGINFO
  • iResult : COLORPICKSTATE
  • irowbuffNext : tagRowBuff
  • ISAPI_BUFFER() : ISAPI_BUFFER
  • ISAPI_EXTENSION() : ISAPI_EXTENSION
  • ISAPI_REQUEST() : ISAPI_REQUEST
  • ISAPI_STRING() : ISAPI_STRING
  • ISAPI_STRINGW() : ISAPI_STRINGW
  • ISAPITHREAD() : ISAPITHREAD
  • isAsync() : MyOSPObject
  • IsAttributeSet() : CVirtualFile , CBaseNode , CStaticNode , CVirtualFile , CFolderNode , CExtendPropertySheet , CVirtualFile , CDeviceNode
  • IsButtonChecked() : CButtonLite
  • IsCARequest() : CRequestInstance
  • IsClassID() : CFactoryData
  • ISCO_DeleteProc() : CMDIChild
  • ISCO_Proc() : CMDIChild
  • IsCommandSet() : CCommand
  • IsConnected() : CDataSource , CTable
  • IsContentCached() : CacheProxySamplePlugin::CacheProxyPlugin
  • iscStatus : _CONFIGURATION_ENTRY
  • IsDeleted() : CFileIO
  • isDeleted : CRocket
  • IsDeleted() : CFileIdx
  • IsDestroyed() : CWndLite , CMDIFrameLite
  • IsDirty() : CEntity
  • isDirty() : CStaticNode
  • IsDirty() : CHtmlIFilterBase , CSmpFilter , CHtmlIFilter , CDynamic , IMyPersistStreamImpl< T > , CResultset , CCommBand , CToolBand
  • isDirty() : CStaticNode , CStaticNode::privateData
  • IsDirty() : CShellExt , CExplorerBar , CComponentData , CDeskBand , CComponentData , CPersistStorage , CPersistFile , HtmlPropIFilter , CImpIPersistFile
  • IsDiskSCSI() : CEnumStorageResource
  • IsDlgButtonChecked() : CWndLite
  • IsDownloadInProgress() : CacheProxySamplePlugin::CacheProxyPlugin
  • IsDsEnabledLocaly() : CTestApp , CImp_DrawDlg , CDisdrawDlg , CLoginDlg
  • iSel : COLORPICKSTATE
  • IsEmpty() : Stack_c< T > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CDbAlloc , NIDeque_c< T > , CLListImpl< TYPE, ARG_TYPE > , CExList< TYPE > , Cstack_c , CList< TYPE, ARG_TYPE > , CString
  • isEmpty() : CMmStream , PMmStream
  • IsEmpty() : CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CListHeader , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • IsEmptyMember() : CMember
  • IsEmptyUID() : CMember
  • IsEOF() : CFileLite
  • IsEqual() : CDataSource
  • isFdCloseRecd : _SOCK_INFO
  • IsFolder() : CPidlMgr
  • IsFormatName() : CMainFrame
  • IsHidden() : CColumnInfo
  • IsInErrorState() : CImportRes , CGenerateRC
  • IsInitialized() : CSimpSvrApp , CAsynchBase
  • IsInList() : CReindeer
  • IsInPlaceActive() : CSimpSvrObj , CSimpSvrApp
  • IsInPlaceVisible() : CSimpSvrObj
  • IsInRoster() : CMember
  • IsLinked() : CLinkable
  • IsLocked() : CFactory
  • islotFirst : tagLSTSLOT
  • islotMax : tagLSTSLOT
  • islotMin : tagLSTSLOT
  • islotNext : tagSLOT
  • islotPrev : tagSLOT
  • islotRov : tagLSTSLOT
  • IsManaged() : CStorageResource
  • IsManagedByDefault() : CStorageResource
  • IsMatchProperty() : CToken
  • IsMemberOf() : CShellIconOverlayID
  • IsModelPageUsed() : CModel
  • IsMultiNodeCapable() : CStorageResource
  • isNewData : _DATA_BUFFER
  • IsNonHtmlFile() : CHtmlIFilter
  • IsNull() : XPtr< T > , XBStr , XInterface< T > , XBStr
  • IsOpen() : CFileLite
  • IsOpenedQueueArrayEmpty() : CMainFrame
  • IsPageDirty() : CPropertyPage
  • IsPageUsed() : CFontRange
  • IsPropertyName() : CFullPropSpec
  • IsPropertyPropid() : CFullPropSpec
  • IsPropertyReadOnly()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
  • IsPropertyWriteOnly()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
  • IsQuorumCapable() : CStorageResource
  • IsQuorumResource() : CStorageResource
  • IsReadOnly() : CFileIO
  • IsReadyForDelete() : CAppInfo
  • IsRowsetOpen() : CCommand
  • IsSameMemberID() : CMember
  • IsSameObject() : CBase
  • IsSameRow() : CImpIRowsetIdentity
  • IsSameUID() : CMember
  • IsSchemeNode : UDDI::Tools::CategoryTreeNode
  • isselected : itemlist
  • IsSelected() : CIceSkate
  • IsSimilar() : CDataSource
  • IsSlotSet() : CBitArray
  • isSocketListening : _SOCK_INFO
  • IsStartedByOle() : CSimpSvrApp
  • IsStartToken() : CToken
  • IsStopToken() : CHtmlIFilter
  • IsStoreSerializable() : CMarkTextService
  • IsSubscribed() : CAppInfo
  • IsSubscribedToAny() : CAppInfo
  • iStatus : CRocket , CPlane , CToolBarExtension , CRocket
  • IsThisLogicalDisk() : CStorageResource , IStorageProperties
  • IStringFromID() : CStatusHelper
  • iStyle : RUN
  • IsUIActive() : CSimpSvrObj
  • IsUnicode() : CFileLite
  • IsUnicodeNumber() : CSerialStream
  • IsUpToDate() : COleObject
  • IsValid() : CAsynchNotify , CFullPropSpec
  • IsValidAudioFile() : CAVIFileReader
  • IsValidValue() : CUtilProp
  • IsVisible() : CWndLite
  • IsWin() : CHuman , CComputer
  • isWritable() : PMmStream , CMmStream
  • Item() : CEntity , CDynamic
  • ItemConfigDlgGetItemSettings() : CSettings
  • ItemConfigDlgProc : CSettings
  • ItemHeader : _MOF_INFO
  • ItemID : _tagCONFIGITEMLISTVIEWLPARAM , _tagPROGRESSMSG , _tagSHOWPROPERTIESMSG , _tagITEMCONFIGSETTINGSLPARAM , _tagHANDLERITEMSETTINGS , _tagHANDLERITEM_SYNCSTATUS
  • items : complist
  • Items : PersistedConfigurationDataSet
  • ItemType : tagAppletRegistryItem , _ITEM_DESC
  • itemVect
: qcship::Ship
, qcnotify::Notify
, qcorder::Order
  • Iterator() : ClientList::Iterator
  • iTInfo : _RecordsetVtbl , IUPnPService_DimmingService_SCPDVtbl , PropertiesVtbl , _ConnectionVtbl , _ParameterVtbl , ParametersVtbl , _ADOCollectionVtbl , ADORecordsetConstructionVtbl , _ADOVtbl , ErrorsVtbl , IMMCControlVtbl , FieldsVtbl , PropertyVtbl , IHelloWorldVtbl , ErrorVtbl , _ADODynaCollectionVtbl , IADsErrorVtbl , FieldVtbl , _CommandVtbl
  • iToLen : _SENDTOARGS
  • iType : CREATEGIZMOW , CREATEGIZMOA
  • iUserCount : CDllData , CDllShared
  • iVal : VTUNION
  • iValue : tagCAPSLOOKUP
  • iWidth : _tagTools
  • IWMSCacheItemCollectionImpl() : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl
  • IWMSCacheItemDescriptorImpl() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • iXScale : tagOPTIONS
  • iYScale : tagOPTIONS
Generated on Wed Nov 13 2024 16:55:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- p -

  • p : CSAFEARRAY
  • pA : CAsyncTest::threadParam
  • PacketFilterPlugin() : RealTimeStylusPlugins::PacketFilterPlugin
  • Packets()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • PackText() : CPack
  • pAcquireCredentialsHandle : _SEC_FUNC
  • Pad : _MIDL_TYPE_FORMAT_STRING , _MIDL_PROC_FORMAT_STRING
  • Page : _RecordsetVtbl , CController
  • Page_Load()
: InkBlog::AddBlog
, InkBlog::_Default
  • PageCount : _JOB_INFO
  • pAgentCommunity : GlobalVars
  • pAgentStrAddr : GlobalVars
  • PageSize : _RecordsetVtbl , _VIRTUAL_BUFFER
  • PagesPrinted : _Job
  • Paint() : CView
  • paint() : RSProxy , HelloJ , Hello2J , Hello3J
  • Paint() : CController , CTextField , CBox , CGrid , CLineGrid , CTextGrid , CCharBlock , CBlockFrame , CPage , CModel
  • PaintApp() : CSimpleApp , CSimpSvrApp
  • PaintCusps() : InkErase::InkErase
  • PaintDoc() : CSimpleDoc , CSimpSvrDoc
  • PaintIntersections() : InkErase::InkErase
  • PaintObj() : CSimpleSite , CSimpSvrObj
  • pAND : ICONIMAGE
  • pAPE : IAppletSessionVtbl
  • PaperForm() : PaperForm::PaperForm
  • PaperForm_Load() : PaperForm::PaperForm
  • PARALLEL_FLAG : helper::sampleConstants
  • parallelCB : NewsFlash
  • Parameters : _CommandVtbl
  • parent : direct
  • Parent : tagObject
  • ParseArgs() : storesh::Storesh
  • ParseCmdLine() : CSimpSvrApp
  • ParseColumnNames() : CFileIO
  • parseCommandLine() : storesh::Storesh
  • ParseCommandLine() : CCmdLineLite
  • ParseConn() : CUtil
  • ParseDataTypes() : CFileIO
  • ParseDisplayName() : CEnumerator , CShellFolder
  • ParseFile() : CCmdLineLite
  • ParseMultiPartBuffer() : CUrlmonCallback
  • ParseMultiPartHeader() : CUrlmonCallback
  • ParseParam() : CCmdLineLite
  • ParseRowValues() : CFileIO
  • ParseURL() : CImpIBindResource
  • ParseUrl() : CProxyPlugin
  • Pass : helper::DatabaseSettings
  • pass : util::DatabaseSettings
  • Password : _ConnectionVtbl , _MSV1_0_INTERACTIVE_LOGON
  • Paste() : CEditBoxLite
  • Path : _ENUMERATE_DIRECTORY_STATE
  • PathEnd : _ENUMERATE_DIRECTORY_STACK
  • Pause() : CPlgFilter
  • PAUSED : CRocket , CPlane , CToolBarExtension
  • PauseStream() : CSampleMSPStream
  • pb : _RecordsetVtbl
  • pbBmk : tagRowBuff
  • pbBuf : tReq , ThreadArgs
  • pbData : _RUREGVALUE
  • pbDATAFromClient : _IO_WORK_ITEM
  • pbeBindingTable : _INTERFACE_ENTRY
  • pbi : ICONIMAGE
  • pBits : ICONIMAGE
  • pbitsSlot : tagLSTSLOT
  • pBlock : item_tag
  • pbMsg : IADsErrorVtbl
  • pbNumericScale : FieldVtbl
  • pbPrecision : FieldVtbl , _ParameterVtbl
  • PbPropList() : CClusPropList
  • pbReadBuf : tSReq
  • pbScale : _ParameterVtbl
  • pbstr : ErrorVtbl , _CommandVtbl , _ConnectionVtbl , FieldVtbl , _ParameterVtbl , PropertyVtbl
  • pbstrName : _CommandVtbl
  • pBuf : _BUFFER
  • pBuffer : IAppletSessionVtbl
  • pBufferStart : PickleControlBlock
  • pbValue : tagAppletOctetString
  • pCapData : tagAppletCapability2
  • pcellpos : Table
  • pchBuffer : _AIO_WORK_ITEM
  • pChildList : _tagFILEOBJECT
  • pChildProps : NODE_PROPERTIES
  • pClient : ClientList::_tag_LIST_NODE , _RqsEngineCbInfo
  • pcmd : _RecordsetVtbl
  • pcolhdr : Table
  • pCompleteAuthToken : _SEC_FUNC
  • pComponentData : NODE_PROPERTIES , tag_BASENODE_PROPERTIES
  • pCon : _CommandVtbl
  • pconn : _RecordsetVtbl
  • PCONTEXT_HANDLE_TYPE : FileRepServer
  • pCookies : CDataObject
  • pCounterArray : _CounterInfoBlock
  • pcRefDll : CDefClassFactory
  • pctinfo : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • pCtxtBack : _PER_SOCKET_CONTEXT
  • pCtxtForward : _PER_SOCKET_CONTEXT
  • pCurrentDevice : CDeviceProp
  • pCurrentNode : LIST_STRUCT
  • pd : PrintContext
  • pdata : LineData , Table
  • pData : tagFieldMetaData , _QueueNode , _node_tag , CTE_ENCODER_STRUCT , _tagPOSDATA
  • pDataFromInteractiveUI : _EAPCB
  • pDataType : FieldVtbl
  • pDBID : _WIDEDBIDMAP
  • pDeleteSecurityContext : _SEC_FUNC
  • pDescription : dirlist
  • pDeviceInfo : _JOB_INFO
  • pdhCurrentStats : _CounterInfoBlock
  • pdimLevel : IUPnPService_DimmingService_SCPDVtbl
  • pDispParams : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • pDisPtrs : UPNPDimmerDevice , CDimmer
  • pdLevel : IUPnPService_DimmingService_SCPDVtbl
  • pDlg : CClientApp
  • pDllList : DEB_PROCESS_NODE_INFO_STRUCT
  • pdwCookie : IAppletSessionVtbl , IAppletVtbl
  • pdwIssuerChainIndex : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pdwIssuerElementIndex : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pecb : _IO_WORK_ITEM , _AIO_WORK_ITEM
  • pECB : CTE_ENCODER_STRUCT , _tagPOSDATA , ECB_QUEUE_ENTRY
  • peMarshal : _RecordsetVtbl
  • Pending : CMyEventProvider
  • PendingStop : CMyEventProvider
  • pEngine : _RqsEngineCbInfo
  • penPt : InkHitTest::InkHitTest
  • pEntryOwner : IAppletSessionNotifyVtbl
  • pEnumerateSecurityPackages : _SEC_FUNC
  • Peo() : CBasePropertyPage
  • PerfCountToTickCount() : CComSpySqlAudit
  • Perform() : CMoveMoney , vcacct::CMoveMoney , vcacct::IMoveMoney , IMoveMoney , CMoveMoney
  • PermitToJoinSessionIndication() : CApplet
  • PermRegistered() : CAdvClientDlg
  • PERSIS_EVENT_NAME : helper::sampleConstants
  • PERSIS_NAME : helper::sampleConstants
  • PERSIST_EVENT_DLL : helper::sampleConstants
  • PersistChangesToXmlFile() : CachePluginAdmin
  • persistentHeading : NewsSubscriber
  • PersistNameValToServerNamespace() : CachePluginAdmin
  • PersistSettings() : CacheProxySamplePlugin::CacheProxyPlugin
  • pExcepInfo : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • pFirst : Queue
  • pFirstGenericItem : _tagGENERICITEMLIST
  • pFirstNode : LIST_STRUCT
  • pFn : tagADSIIF
  • pfncmd : _CMD
  • pfnCompare : _HASH_TABLE
  • pfnDisplay : _HASH_TABLE
  • pfnEventProc : _DRVLINE
  • pfnFindCallback : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pfnFree : _HASH_TABLE
  • pfnHash : _HASH_TABLE
  • pfnmsg : _MSD
  • pfnRequestCB : HTTP_REQUEST_PARAM
  • pfPrepared : _CommandVtbl
  • pFreeContextBuffer : _SEC_FUNC
  • pFreeCredentialsHandle : _SEC_FUNC
  • pfTopProvider : IAppletSessionVtbl
  • pGuid : _WIDEGUIDMAP
  • pguidConstant : CONST_GUID_REP
  • pguidSchema : _SCHEMAINFO
  • phContext : tReq , ThreadArgs
  • pHead : _tagPOSTKEY
  • phtInterfaceTable : _NETWORK_ENTRY
  • pictCheckmarks : AutoClaims::AutoClaims
  • pictHorzontalBar1 : AutoClaims::AutoClaims
  • pictHorzontalBar2 : AutoClaims::AutoClaims
  • pictHorzontalBar3 : AutoClaims::AutoClaims
  • pictPolicyBox : AutoClaims::AutoClaims
  • picture1 : CSharp_Draw::Form1
  • picture1_MouseDown() : CSharp_Draw::Form1
  • picture1_MouseMove() : CSharp_Draw::Form1
  • picture1_MouseUp() : CSharp_Draw::Form1
  • picture1_Paint() : CSharp_Draw::Form1
  • picture1Graphics : CSharp_Draw::Form1
  • pictVehicleBox : AutoClaims::AutoClaims
  • pID : EXEDLLICONINFO
  • PID : _INITDATA
  • pidl : tagENUMLIST
  • pidlFQ : ITEMINFO
  • pidlRel : ITEMINFO
  • pIDName : IIDLookUp
  • pIID : _INTERFACEMAP , tagADSIIF
  • Ping() : CPingResponder
  • pInitializeSecurityContext : _SEC_FUNC
  • pInkStroke : IInkCollectorEventsImpl< T >
  • pIOContext : _PER_SOCKET_CONTEXT
  • pIOContextForward : _PER_IO_CONTEXT
  • pipName : AutoClaims::AutoClaims
  • pipPolicyNumber : AutoClaims::AutoClaims
  • pipShared : AutoClaims::AutoClaims
  • pIR : CHILDWINDOWDATA
  • pItem : COBNODE
  • pItemIDs : _tagPREPAREFORSYNCMSG , _tagSHOWERRORCOMPLETEDMSG
  • pItems : view
  • pItemSettings : _tagITEMCONFIGSETTINGSLPARAM
  • pitNext : item_tag
  • pitPrev : item_tag
  • PiWizardCallback() : CBasePropertyPage , CExtObject , CBasePropertyPage , CExtObject
  • PixelToInkSpace() : InkClipboard::InkClipboard
  • pJobInfo : _DEVICE_INFO
  • pJobs : _Queue
  • pKey : _QueueHashNode
  • pl : ErrorVtbl , _CommandVtbl , _RecordsetVtbl , FieldVtbl , _ParameterVtbl
  • pLast : Queue
  • pLastNode : LIST_STRUCT
  • plAttr : _ConnectionVtbl
  • plAttributes : PropertyVtbl
  • Play() : CAgentCtlCharacterEx
  • PlayButton : CapJ
  • PlayButton_click() : CapJ
  • plChapter : ADORecordsetConstructionVtbl
  • plCmdType : _CommandVtbl
  • plCursorLoc : _ConnectionVtbl , _RecordsetVtbl
  • plCursorType : _RecordsetVtbl
  • pleBuckets : _HASH_TABLE
  • pLeftLink : NODE_STRUCT
  • plField : CComputer , CHuman
  • pLines : view
  • Plist() : CClusPropList
  • plist : ColPropsList , CellDataList
  • pListData : LIST_STRUCT
  • plLockType : _RecordsetVtbl
  • plMaxRecords : _RecordsetVtbl
  • plMode : _ConnectionVtbl
  • plObjState : _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl
  • pLockHandler : _tagSAMPLEITEMSETTINGS
  • plParmAttribs : _ParameterVtbl
  • plParmDirection : _ParameterVtbl
  • plTimeout : _ConnectionVtbl
  • Plugin : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl , RealTimeStylusPluginApp::PluginListItem
  • PluginListItem() : RealTimeStylusPluginApp::PluginListItem
  • pMember : tagUser
  • pMemBuffer : PickleControlBlock
  • pMonitor : CClientApp
  • pMonitorCallFactory : CClientApp
  • pMonitorResponder : CClientApp
  • pMPPEKeyAttributes : _EAPCB
  • pMsgBox : CDllData
  • pmsgprops : RECEIVE_CONTEXT
  • pnConfID : IAppletSessionVtbl
  • pneNetworkEntry : _CONFIGURATION_ENTRY
  • pNext : CPlex , CFixedAlloc::CNode , tag_seq , _QueueNode , ClientList::_tag_LIST_NODE , _ASYNC_REQUEST , _node_tag , CLListImpl< TYPE, ARG_TYPE >::CNode , _tagPOSTKEY , _OPEN_FILE , COBNODE , _CounterInfoBlock , _MEMORY_ALLOC_BLOCK , RUN , tagENUMLIST , tagVIEWLIST
  • pNextDeviceInfo : _DEVICE_INFO
  • pNextGenericItem : _tagGENERICITEM
  • pnlDrawingArea : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pnlDrawingArea_MouseDown() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pnlDrawingArea_MouseMove() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pnlDrawingArea_MouseUp() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pnlPlugins : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • pnlZoom : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pNodeData : NODE_STRUCT
  • pNotify : IAppletSessionVtbl , IAppletVtbl
  • pnReqTag : IAppletSessionVtbl
  • pnValue : tagAppletLongString
  • pObjArray : CAsyncQuerySink
  • pObject : _XFORMDATA
  • pObjParam : CAsyncQuerySink
  • PodObjData() : CExtObject
  • point : _htdata
  • Pop() : Stack_c< T >
  • Populate()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, CComboBoxGuid
, CComboBoxLite
  • PopulateACL() : CDlgIADsSecurityDescriptor
  • PopulateByKey()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • PopulateByQuery()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • PopulateControls() : CContextSamplePropPage
  • PopulateEventList() : CSelectEventsDlg
  • PopulateStaticEntity() : CProxy
  • PopulateSysEventList() : CSelectEventsDlg
  • port : _OPTIONS
  • pos : direct
  • Position : _RecordsetVtbl
  • PositionLabel : CapJ
  • Post() : IAccount , CAccount , vcacct::CAccount , vcacct::IAccount , CAccount , IAccount
  • PostCreate() : CStorageResource
  • PostEditorEventNotify() : CAnnotator
  • PostHandleEvent() : CAnnotator
  • PostMessage() : CWorkerThread
  • Potential : _SAMPLE_HELPER_DATA_
  • pOtherDirList : dirlist
  • Power() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • power : UPNPDimmerService , CDimmerService
  • PowerOff() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • PowerOn() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • PPageWndProc0() : CVirtualFile
  • PPageWndProcX() : CExtendPropertySheet
  • pParentFolder : ITEMINFO
  • pParentObject : tag_BASENODE_PROPERTIES , NODE_PROPERTIES
  • pPattern : dirlist
  • ppDSO : ADOConnectionConstructionVtbl
  • ppiprm : _CommandVtbl
  • ppirs : _CommandVtbl
  • ppiRs : _RecordsetVtbl
  • ppiRset : _ConnectionVtbl
  • ppNewRequest : CMallocSpy
  • pPower : IUPnPService_DimmingService_SCPDVtbl
  • ppowerVal : IUPnPService_DimmingService_SCPDVtbl
  • ppowerVall : IUPnPService_DimmingService_SCPDVtbl
  • pPrev : CLListImpl< TYPE, ARG_TYPE >::CNode
  • pProcessInfo : CProcessDlg
  • Pprops() : CBasePropertyPage , CClipBookServerParamsPage , CBasePropertyPage , CFileShareSampleParamsPage
  • ppRowPos : ADORecordsetConstructionVtbl
  • ppRowset : ADORecordsetConstructionVtbl
  • pprset : _ConnectionVtbl
  • ppSession : ADOConnectionConstructionVtbl , IAppletVtbl
  • ppTInfo : IMMCControlVtbl , IUPnPService_DimmingService_SCPDVtbl , PropertyVtbl , FieldVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl
  • pPts : _BEZBUFFER
  • ppUnknown() : CInterfaceDlg
  • ppvObject : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , ADOConnectionConstructionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , CProviderFactory , IAppletSessionNotifyVtbl , IAppletSessionVtbl , IAppletVtbl , _ParameterVtbl , IAppletNotifyVtbl , IMMCControlVtbl , PropertiesVtbl , FieldVtbl , _RecordsetVtbl , _CommandVtbl , ErrorsVtbl
  • pQuerySecurityPackageInfo : _SEC_FUNC
  • pRanges : HTTP_REQUEST_PARAM
  • pRasConnection0 : Static_Info_Database
  • pRasConnection1 : Static_Info_Database
  • preAPI() : APIHook< T >
  • precision : FieldInfo
  • PreCreate() : CStorageResource
  • PreCreateWindow() : CWndLite , CMDIObjects , CMDITrace , CMainFrame , CPrintSDIView , CTestView , CAPIView , CMainFrame , CChildView
  • pRecvBuf : _WORK_THREAD_DATA , _ClientContext
  • PreferredProtocol : IWMSCacheAdmin , CachePluginAdmin
  • pRegistryItem : IAppletSessionNotifyVtbl
  • pRegistryKey : IAppletSessionNotifyVtbl
  • PreHandleEvent() : CAnnotator
  • Prepare() : CCommand
  • PrepareForSync() : CSyncMgrHandler
  • PrepareForSyncCall() : CSyncMgrHandler
  • PrepareForSyncCompleted() : CCallbackWrapper
  • PrepareForSyncCompletedMsg : _tagMETHODARGS
  • PrepareForSyncMsg : _tagMETHODARGS
  • PrepareRecord() : CCrmDebugCompensator , CCrmFilesCompensator
  • PrepareRecordVariants() : CCrmDebugCompensator
  • PrepareToHostQuorumResource() : CStorageResource
  • pRequest : IAppletSessionVtbl , IAppletVtbl , IAppletSessionVtbl
  • PresetGestures() : CAdvRecoApp
  • PreTranslateMessage() : CMDIFrameLite , CGenericUCPDlg , CFrameWndLite
  • prev : _SOCK_INFO , Sock_Info
  • PrevBlock : blockTag
  • PrevIndex : tagLABELEXTRACT
  • Previous() : CLinkable
  • PrevPage() : CModel
  • PrevSection() : CModel
  • Pri : tReq , tSReq
  • pRightLink : NODE_STRUCT
  • Print() : CPrintRequest
  • PrintAttributes() : CXmlDOM
  • PrintDimensions() : CGenerateRC
  • PrintDlgProc : CPrintAux
  • Printer : _Queue
  • Printf() : CStdDbOutput , ISAPI_STRING , ISAPI_STRINGW
  • PrintfToResponseBuffer() : ISAPI_REQUEST
  • PrintNode() : CXmlDOM
  • PrintTextToEditBox() : CDeviceProp
  • PrintTo() : CFileViewer , CImpIFileViewer
  • privateData() : CStaticNode::privateData
  • PrivateGetIDsOfNames() : HelloWorld
  • PrivateInvoke() : HelloWorld
  • Process()
: qcnotify::INotify
, qcnotify::INotifyDefault
, qcorder::IOrder
, qcorder::IOrderDefault
, qcorder::Order
, qcship::IShipDefault
, qcship::Ship
, CONotify
, COrder
, COShip
, CONotify
, COrder
, COShip2
, qcship::IShip
, qcnotify::Notify
  • ProcessAsyncFind() : CGenericUCPDlg
  • ProcessDebugInfo : DEB_PROCESS_NODE_INFO_STRUCT
  • ProcessFindByType() : CGenericUCPDlg
  • ProcessFindByUDN() : CGenericUCPDlg
  • ProcessGraphEvent() : CSampleMSPStream
  • ProcessInfo : DEB_STARTUP_INFO_STRUCT
  • ProcessLogRecord() : CCrmFilesCompensator
  • ProcessMessage() : CAddVFileDlg , CBaseDialog , CAddFolderDlg , CAddVFileDlg , CAddDeviceDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddVFileDlg , CAddDeviceDlg , CBaseDialog , CSimpleDialog , CBaseDialog , CAddDeviceDlg
  • ProcessReply() : CMonitor
  • Progress() : CSyncMgrHandler , CCallbackWrapper
  • ProgressMsg : _tagMETHODARGS
  • ProgressSetItemProgMaxValue() : CSyncMgrHandler
  • ProgressSetItemProgValue() : CSyncMgrHandler
  • ProgressSetItemStatusText() : CSyncMgrHandler
  • ProgressSetItemStatusType() : CSyncMgrHandler
  • PromptDataSource() : CDataLinks
  • PromptDataSourceProc() : CMainWindow
  • PromptFileName() : CDataLinks
  • PromptFileNameProc() : CMainWindow
  • propertyID : _PROPIDLIST
  • PROPERTYPAGEX : CClassFactory
  • PropertySheetPageCallback() : CObjSecurity
  • PropPageProc() : CPropPageLite
  • props : ColProps , CellData , TableHdr , _FILESHARESAMPLE_RESOURCE , Title
  • propsActive : _FILESHARESAMPLE_RESOURCE
  • protocol : PersistedConfiguration , Sock_Info
  • protocolInfo : _OPTIONS
  • ProvideEvents() : CProvider_IWbemEventProvider , CMyEventProvider
  • Provider : _WSAOVERLAPPEDPLUS , _ConnectionVtbl , _SOCK_INFO
  • ProviderCritSec : _PROVIDER
  • ProviderInfoProc() : CMDIChild
  • ProviderOverlapped : _WSAOVERLAPPEDPLUS
  • ProviderPathA : _PROVIDER
  • ProviderPathLen : _PROVIDER
  • ProviderPathW : _PROVIDER
  • ProviderSocket : _WSAOVERLAPPEDPLUS , _SOCK_INFO
  • pRowPos : ADORecordsetConstructionVtbl
  • pRowset : ADORecordsetConstructionVtbl
  • ProxyOnDemandCacheMiss : CachePluginAdmin , IWMSCacheAdmin , CachePluginAdmin
  • proxyOnDemandCacheMiss : PersistedConfiguration
  • ProxyRedirectURL : CachePluginAdmin , IWMSCacheAdmin
  • pSD : tagObject
  • psDataType : _ParameterVtbl
  • psdCreator : _tagLogon
  • pSendBuf : _WORK_THREAD_DATA , _ClientContext
  • pServerInfo : CServerDlg , CAPIDoc
  • pSession : IAppletNotifyVtbl
  • pSessionInfo : CSessionDlg , CQueryDlg
  • pSessionKey : IAppletSessionVtbl
  • pSettings : _tagCONFIGSETTINGSLPARAM , _tagITEMCONFIGSETTINGSLPARAM
  • pSetValue : GlobalVars
  • psFile : DebugGlobals
  • pSID : tReq , tSReq
  • pSmf : tag_track
  • pSockList : _AcceptContext
  • pSpy : CEvtStoreSub
  • pstLastModified : HTTP_REQUESTCB_PARAM
  • pstnHandle : tagLINE_INFO
  • pstrFile : tag_seq
  • pstrName : tag_smfopenstruct
  • pstrRep : CONST_DWORD_REP , CONST_GUID_REP
  • pstUnlessModifiedSince : HTTP_REQUEST_PARAM
  • psz : GBGETTEXTA , DWSTR , GBGETTEXTW
  • pszAddr : _PREF , tagUser
  • pszConferenceName : _PREF
  • PszCurrentPropertyName() : CClusPropList
  • pszDest : _RU_SOCKET_CREATE_DATA
  • pszDestFile : CShellExt
  • pszDocument : _Job
  • pszError : tagADSERRMSG
  • pszFileName : _PREF
  • pszName : _NAMEMAP , _RURASREGROOT , tagUser , _RUREGVALUE , t_Ctype
  • pszNewName : pipe_state
  • pszOid : GlobalVars
  • pszOldName : pipe_state
  • pszOwner : _Job
  • pszPasswd : DBCONN
  • pszPassword : _PREF
  • pszPrinterName : _Printer
  • pszServerName : _Printer
  • pszShareName : _Printer
  • pszSrc : _RU_SOCKET_CREATE_DATA
  • pszSrcFile : CShellExt
  • pszSrv : DBCONN
  • pszStatus : _Job
  • pszStr : _stringstruct
  • pszString : _RqsConfigString
  • pszText : CREATEGIZMOA , CREATEGIZMOW
  • PszToolTip() : CFileViewer
  • pszUrl : HTTP_REQUEST_PARAM
  • pszUsageIdentifier : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pszUser : DBCONN
  • pT : IInkRecognitionEventsImpl< T >
  • pTempoMap : tag_smf
  • ptEnd : tagLINE
  • ptEntry : _CUSTOM_ENTRY_DATA_SAMPLE_
  • ptext : CellData , Title
  • pTextStoreACPSink : ADVISE_SINK
  • pThis : _tagWorkerThreadArgs
  • pThreadList : DEB_PROCESS_NODE_INFO_STRUCT
  • ptStart : tagLINE
  • ptype : PropertyVtbl
  • puArgErr : _ParameterVtbl , ParametersVtbl , PropertiesVtbl , IHelloWorldVtbl , IUPnPService_DimmingService_SCPDVtbl , ErrorVtbl , IMMCControlVtbl , _ADOCollectionVtbl , _CommandVtbl , _ADODynaCollectionVtbl , FieldVtbl , FieldsVtbl , IADsErrorVtbl , ErrorsVtbl , PropertyVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , _ADOVtbl
  • PublicKeyBlobFromCertificateRawData() : Sample::MySignedXml
  • publishButton : NewsFlash
  • publishButton_click() : NewsFlash
  • PUBLISHER_NAME : helper::sampleConstants
  • PublishEventBorder : NewsFlash
  • pUIContext : _EAPCB
  • Pull() : CSamplePipe
  • PULL_BUFSIZE : FileRepServer
  • punkDisk : SIndexedDisk
  • punkID : ADVISE_SINK
  • pUnknown() : CInterfaceDlg
  • punkOuter : HTTP_REQUEST_PARAM
  • Purge() : CEmptyVolumeCache
  • pUserAttributes : _EAPCB
  • Push() : Stack_c< T > , CSamplePipe
  • PUSH_BUFSIZE : FileRepServer
  • PushSize : tSReq
  • Put() : CSAFEARRAY
  • put_Audit() : CComSpy
  • put_ColWidth() : CComSpy
  • put_ContextTypes() : CContextAdmin
  • put_CustomerId() : COShip2 , CONotify , COrder , CONotify , COShip
  • put_DeleteStoredProcedure() : CEntity
  • put_EditMode() : CEntity
  • put_Field() : CEntity
  • put_FileName() : CCrmFilesTest
  • put_GridSize() : CGrid
  • put_InsertStoredProcedure() : CEntity
  • put_Key() : CEntity
  • put_KeyField() : CEntity
  • put_Language() : CCrmFilesTest
  • put_LogFile() : CComSpy
  • put_LogToFile() : CComSpy
  • put_myProperty() : CPower , CSimple
  • put_OrderId() : CONotify , COrder , COShip , COShip2
  • put_OutputPath() : CContextAdmin
  • put_ReadStoredProcedure() : CEntity
  • put_Recordset() : CEntity
  • put_ShowGridLines() : CComSpy
  • put_ShowOnScreen() : CComSpy
  • put_SnapIncrement() : CSnap
  • put_SnapOn() : CSnap
  • put_TransactionUOW() : CCrmMonComp
  • put_UpdateStoredProcedure() : CEntity
  • put_x() : CPoint
  • put_x1() : CLine
  • put_x2() : CLine
  • put_y() : CPoint
  • put_y1() : CLine
  • put_y2() : CLine
  • PutClass() : CInstPro , CProvider_IWbemServices , CClassPro , CMethodPro
  • PutClassAsync() : CMethodPro , CInstPro , CClassPro , CProvider_IWbemServices
  • PutColor() : CSecureObject
  • PutInstance() : CMethodPro , CProvider_IWbemServices , CInstPro , CClassPro , CReindeer
  • PutInstanceAsync() : CProvider_IWbemServices , CClassPro , CMethodPro , CInstPro
  • PutProperty() : CProvider_IWbemServices , CBicycle , CPropPro , CBicycle
  • putref_Font() : CComSpy
  • PutUserName() : CSecureObject
  • pval : PropertyVtbl
  • pValue : _QueueHashNode
  • pvar : _ParameterVtbl , _RecordsetVtbl , FieldVtbl
  • pVarResult : PropertiesVtbl , IUPnPService_DimmingService_SCPDVtbl , FieldVtbl , _ADOVtbl , _CommandVtbl , _ParameterVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , ErrorsVtbl , _ConnectionVtbl , ADORecordsetConstructionVtbl , IHelloWorldVtbl , PropertyVtbl , ParametersVtbl , _RecordsetVtbl , FieldsVtbl , ErrorVtbl , IADsErrorVtbl , IMMCControlVtbl
  • pvBookmark : _RecordsetVtbl
  • pVel : _POLYDATA
  • pvFindArg : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pView : tagVIEWLIST
  • pvSource : _RecordsetVtbl
  • pwcKey : InstDef
  • pWorkBuffer : _EAPCB
  • pwstrDescBuffer : _tagPROPSTRUCT
  • pwstrVal : _tagPROPSTRUCT
  • pwszClassId : SClassEntry , SFilterEntry , SHandlerEntry , SLangClassEntry
  • pwszClassIdDescription : SLangClassEntry , SFilterEntry , SHandlerEntry , SClassEntry
  • pwszClassIdFilter : SHandlerEntry
  • pwszComputerName : _FILESHARESAMPLE_RESOURCE
  • pwszDescription : SClassEntry
  • pwszDLL : SLangClassEntry , SFilterEntry
  • pwszEmbeddedLinks : BROWSER_CONFIG
  • pwszError : _ERRORMAP
  • pwszExpandedPath : _FILESHARESAMPLE_RESOURCE
  • pwszExt : SClassEntry
  • pwszHomePage : BROWSER_CONFIG
  • pwszIfName : _INTERFACE_ENTRY
  • pwszInterface : _INTERFACEMAP
  • pwszLangName : SLangRegistry
  • pwszName : _SCHEMAINFO , _WIDENAMEMAP , _WIDEGUIDMAP , _WIDEDBIDMAP
  • pwszPath : _FILESHARESAMPLE_PROPS
  • pwszRemark : _FILESHARESAMPLE_PROPS
  • pwszResourceName : _FILESHARESAMPLE_RESOURCE , _CLIPBOOKSERVER_RESOURCE
  • pwszSchemaName : _SCHEMAINFO
  • pwszShareName : _FILESHARESAMPLE_PROPS
  • pwszShortName : SClassEntry
  • pwszString : MyString , _UNITSTABLE
  • pwszSyntax : ADSTYPEsyntaxmapping
  • pwszThreadingModel : SFilterEntry , SLangClassEntry
  • pwszTypeName : _TYPEMAP , ADSTYPE_TO_STRING_ENTRY
  • pwszUNCSharedPath : _FILESHARESAMPLE_RESOURCE
  • pwszValue : tagMULTI_SZ
  • pwzLast : filebuffer
  • pwzStart : filebuffer
  • pwzText : fileline , CellData
  • pXOR : ICONIMAGE
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- q -

  • qeEventQueueLink : _EVENT_ENTRY
  • qFriend : CSharp_Draw::Form1
  • qMe : CSharp_Draw::Form1
  • qMe_ReceiveCompleted() : CSharp_Draw::Form1
  • qosIoctlSet : _QOS_OPTIONS
  • qosOptions : _OPTIONS
  • qqi : igmp_hdr_query_v3
  • quantityVect
: qcnotify::Notify
, qcorder::Order
, qcship::Ship
  • Query() : Query
  • QueryApplicationFile()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • QueryBufferSize() : ISAPI_STRINGW , ISAPI_BUFFER , ISAPI_STRING
  • QueryCache() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • QueryCacheMissPolicy() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • QueryCB() : ISAPI_STRING , ISAPI_STRINGW
  • QueryCCH() : ISAPI_STRING , ISAPI_STRINGW
  • QueryContextMenu() : CContextMenu , CDeskBand , CContextMenu , CShellExt
  • QueryContinueDrag() : CDropSource , CDragSource , CDropSource
  • QueryDataObject() : CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • QueryDataSize() : ISAPI_BUFFER
  • QueryDispatch() : CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • QueryDrag() : CSimpleDoc
  • QueryDrop() : CDropTarget
  • QueryEcb() : ISAPI_REQUEST
  • QueryElement() : CHtmlElementBag
  • QueryEnlist() : CPooledData
  • QueryForPropertyPage() : CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • QueryGetData() : CDataObject , CTSFDataObject , CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject
  • QueryHtmlElement() : CHtmlIFilter
  • QueryIISMajorVersion() : ISAPI_REQUEST
  • QueryIISMinorVersion() : ISAPI_REQUEST
  • QueryInsert() : CTSFEditWnd
  • QueryInsertEmbedded() : CTSFEditWnd
  • QueryInstances() : CHiPerfProvider
  • QueryInterface() : CComponentData , CComponent , CDataObject , CDownloadBindStatusCallback , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CToolBarExtension , CClassFactory , CPropPro , CEnumTASK , CDataObject , CComponentData , CMgrNotify , CClassFactory , CSnapinAbout , CDataObject , CHtmlIFilterBase , CComponent , CClassFactory , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CPropSheetExtension , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CRTCEvents , CClassFactory , CComponentData , CComponent , CClassFactory , CSnapinAbout , CComponentData , CDataObject , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CGenericEnum , CClassFactory , CSnapinAbout , CDataObject , CSyncMgrHandler , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CExtendPropertySheet , CClassFactory , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CDataObject , CEditSessionBase , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CEnumFormatEtc , CDataObject , CComponentData , CCallbackWrapper , CClassFactory , CSnapinAbout , CEnumSyncMgrItems , CTAPIEventNotification , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CTAPIEventNotification , CComponentData , CConfNotify , CClassFactory , CMgrNotify , CDataObject , CComponentData , CComponent , CTAPIEventNotification , CSnapinAbout , CDataObject , CComponentData , CObjSecurity , CClassFactory , CSnapinAbout , CClassFactory , CDataNotify , CComponent , CSnapinAbout , CComponentData , CClassFactory , CApplet , CDataObject , CSnapinAbout , CComponent , CClassFactory , CSnapinAbout , CProvFactory , AgentNotifySink , CClassFactory , CComponent , CComponentData , CDataObject , AgentNotifySink , CWrapVBComponent , AgentNotifySink , CMySink , CComponentData , CDataObject , CSnapinAbout , InkCollectorEvents , CContextMenuExtension , CClassFactory , CAsyncQuerySink , CMethodPro , CMarkTextService , CComponentData , CDataObject , CRTCOutgoingDlg , CRTCIncomingDlg , IMyPersistStreamImpl< T > , CAdminNotifyHandler , CClassFactory , CPropSheetHost , CSampleDirectory , CSnapinAbout , CProxyPlugin::COpState , CWiaDataCallback , WiaWrap::CProgressDlg , CDropSource , WiaWrap::CEventCallback , CProvFactory , CBitmapWnd , CComponent , MyDataSource , MyClassFactory , CISeqStream , CMallocSpy , CStream , CRowset , CRow , CSampleWordBreaker , CPropertyPage , CImpISpecifyPropertyPages , CDataSource , CConfNotify , CClassFactory , CFileTransferNotify , CMallocSpy , CLangBarItemButton , CStorageBuffer , CListener , CSmartPtrTrace< T > , CSmartPtr< T > , COleClient , CDropTarget , CDropSource , CMonitor , CAggregate , CBase , CImpAuth , CInstPro , CSimpSvrDoc , CFactory , CSimpleSite , CProviderFactory , CSimpleDoc , CSimpleApp , CSimpleSite , CProvFactory , CSimpleApp , CFactory , CSimpleClass , CClassFactory , CDbAlloc , CStdDbOutput , CObject , CSnapinAbout , CHelloClassFactory , CComponent , CCallAs , CComponentData , CSimpleObject , CClassFactory , CSecureObject , CClassFactory , CObject , CClassFactory , CTestCOMPerformance , CSnapinAbout , CSimpleObject , CClassFactory , CSimpleObject , CClassFactory , CSimpleObject , CComponent , CSurrogate , CComponentData , CClassFactory , CDog , CMallocSpy , CUrlmonCallback , CSite , CImpIOleDocumentSite , CImpIOleInPlaceSite , CComponentData , CImpIOleClientSite , CFrame , CPersistStorage , CPersistFile , COleObject , CComponent , COleDocument , CExtendContextMenuEx , COleInPlaceActiveObject , CEnumFormatEtc , CDataObject , CClassFactory , CFactory , CEnumXXX< T, ELT_T, IFACE > , CConnectionPoint , CDataObject , CComponent , CConsumer , CProvFactory , CClassFactory , CCustomPropertyStore , CClassFactory , CSnapinAbout , CClassPro , CClassFactory , CEditSessionBase , CLangBarItemButton , CCompartmentMonitor , CEnumDisplayAttributeInfo , CDisplayAttributeInfo , CHtmlIFilterCF , CExplorerBar , CShellFolder , COleInPlaceObject , CClassFactory , COleDocumentView , CShellIconOverlayID , CCaseTextService , CTSFEditWnd , CToolBand , CProvider_IWbemServices , CDropTarget , CDragSource , CClassFactory , CMyEventProvider , CMainWindow , WiaWrap::CDataCallback , CEnumFormatEtc , CConfNotify , CImpIPersistFile , CFileViewer , CDBSession , CEmptyVolumeCache , CCommand , CBinder , CCallNotify , CConfNotify , CDataObject , CContextMenu , CBackgroundCopyCallback , CAppShareNotify , CSimpSvrObj , CSimpSvrApp , CConsumer , CAsynchNotify , CSimpleDoc , CEnumIDList , CSnapinAbout , CImpIFileViewer , CClassFactory , CHello , CCallAsFactory , CSmpFilter , CShellExt , CShellExtClassFactory , CDataObject , CDeskBand , CClassFactory , CClassFactoryWrapper , CColumnProvider , CExtractIcon , CImpIAdviseSink , CTSFDataObject , CClassFactory , CTSFPersistentPropertyLoader , CLanguageResourceSampleCF , CClassFactory , CShellView , CCommBand , CSmpFilterCF , CClassFactory , CSampleStemmer , CProviderFactory , CConfNotify , CCallNotify , HtmlPropIFilterCF , CDropTarget , CClassFactory , HtmlPropIFilter , CSamplePipe , CMgrNotify , CAppShareNotify , CClassFactory , CProvider_IWbemEventProvider , CSampleDataContainer , CProvider , MyOSPObject , CRefresher , CAppletSession , CMgrNotify , CFileStream , CChannelNotify , CDataXferObj , CMgrNotify , CDataNotify , CDropObject , CProvider , CFtNotify , CFVClassFactory , CHiPerfProvider , CProvider_IWbemEventConsumerProvider , CDataObject , CProvider_IWbemUnboundObjectSink
  • QueryIsClientConnected() : ISAPI_REQUEST
  • QueryMaxAlloc() : ISAPI_STRINGW , ISAPI_STRING , ISAPI_BUFFER
  • QueryMaxResponseBufferSize() : ISAPI_REQUEST
  • QueryMaxSyncWriteSize() : ISAPI_REQUEST
  • QueryModulePath() : ISAPI_EXTENSION
  • QueryMultiSelDataObject() : CComponent
  • QueryName : _Query
  • QueryNewPalette() : CSimpleApp
  • QueryObjectSink() : CMethodPro , CInstPro , CProvider_IWbemServices , CClassPro
  • QueryOsMajorVersion() : ISAPI_REQUEST
  • QueryPagesFor() : CComponent , CPropSheetExtension , CExtendPropertySheet , CComponentData , CComponent , CComponentData , CComponent
  • QueryPtr() : ISAPI_BUFFER
  • QueryService() : CBrowserHost , CImpIServiceProvider
  • QuerySpaceForCacheItem() : CacheProxySamplePlugin::CacheProxyPlugin , CProxyPlugin
  • QueryStatus() : CFrame
  • QueryStr() : ISAPI_STRING , ISAPI_STRINGW
  • Queue : _WORK_QUEUE
  • queuedCascadeCB : NewsSubscriber
  • queuedCB : NewsFlash
  • queuedPersisCB : NewsSubscriber
  • QueueWorkItem() : ISAPITHREAD
  • Quit() : CUnknown
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- r -

  • radioDSDisabled : CSharp_Draw::Form1
  • radioDSEnabled : CSharp_Draw::Form1
  • radioSendExp : CSharp_Draw::Form1
  • radioSendRec : CSharp_Draw::Form1
  • RaiseError() : CUtil
  • RandomShipStatus() : COShip2
  • randomShipStatus() : qcship::Ship
  • RandomShipStatus() : COShip
  • RateResource() : CLDisp
  • rbControl : tag_keyframe
  • rbProgram : tag_keyframe
  • rbTempo : tag_keyframe
  • rc : statel
  • rcCubeBoundary : SPINCUBEINFO
  • rcEdges : tagOPTIONS
  • rclOutput : tagCMTMLTFMT
  • RCText() : CCanvas
  • ReactivateAndUndo() : COleInPlaceObject
  • Read() : CThumbNailPhotoHolder , CAVIFileReader , CComSpy , CSimpleObject , msado15::_Stream , msado15::Stream , CFileLite , CStorageBuffer , CFileStream , CImpIStream , CISeqStream , CSampleDataContainer , CThumbNailPhotoHolder
  • READ_BUFFER_SIZE : ASYNC_REQUESTER
  • READ_BUFSIZE : FileRepServer
  • ReadAllEntity() : ISAPI_REQUEST
  • ReadAt() : CStorageBuffer
  • ReadBuffer() : CStorageBuffer
  • ReadBytes() : CFileLite , CStream
  • ReadFromStream() : CFastVariant
  • ReadPlaylist() : CSDKSamplePlaylistParser
  • ReadPlaylistFromDirectory() : CSDKSamplePlaylistParser
  • ReadSettings() : CSettings
  • ReadString() : CStream
  • ReadTagIntoBuffer() : CHtmlScanner
  • ReadText()
: msado15::_Stream
, msado15::Stream
  • ReadTrustedDomains() : CAPIDoc
  • ReAlloc() : CFileIdx
  • ReAllocBuffer() : WiaWrap::CDataCallback
  • realname : FLAGMAPPING
  • RealTimeStylusDisabled()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RealTimeStylusEnabled()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RealTimeStylusPlugin_Load() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RealTimeStylusPluginApp() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • Reason : _WORK_QUEUE_ITEM
  • Rebind() : CRowset
  • ReBind() : CDataGrid
  • RecalcDependantVariables() : CDlgDest
  • recdData : _SOCK_INFO
  • Receive() : CPlgPin
  • ReceiveMessage() : RqsClient
  • ReceiverName : _JOB_INFO
  • ReceiverNumber : _JOB_INFO
  • ReceiveTSPCallData() : CSampleMSPCall
  • RECEIVING : ASYNC_REQUESTER
  • recent1 : CapJ
  • recent1_click() : CapJ
  • recent2 : CapJ
  • recent2_click() : CapJ
  • recent3 : CapJ
  • recent3_click() : CapJ
  • recent4 : CapJ
  • recent4_click() : CapJ
  • recentSeparator : CapJ
  • Recognize() : PaperForm::PaperForm
  • RecognizeInkData() : InkBlog::InkArea
  • ReconcileDir() : CSyncMgrHandler
  • Reconnect() : CHandler , MSDFHDL::IDataFactoryHandler
  • RecordChangeComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • RecordsAffected : _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl
  • RecordSelectedIndexes() : CS2Dialog
  • RecordsetChangeComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • Rect : tagDRAWINFO
  • rect : tagTrackObject
  • rectangle : RealTimeStylusPlugins::PacketFilterPlugin
  • rectClip : tagTrackObject
  • recv() : DTHandler , SocketMonitor
  • RecvArgs : _WSAOVERLAPPEDPLUS
  • RecvBuf() : RecvBuf
  • recvbuf : _RECV_INFO
  • recvBufSize : _ClientContext
  • RecvBufSize : _WORK_THREAD_DATA
  • recvfrom() : DTHandler
  • RecvFromArgs : _WSAOVERLAPPEDPLUS
  • redPen : InkHitTest::InkHitTest
  • RefCount : CCallAsFactory , CCallAs , _SOCK_INFO , RefCount
  • RefIt() : SmartRefPointer< T >
  • Refresh()
: CDataGrid
, CRefClient
, CRefresher
, CProcessDlg
, CSessionDlg
, CShellView
, msado15::_Collection
, msado15::_DynaCollection
, msado15::Errors
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::Parameters
, msado15::Properties
  • RefreshComponents()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • RefreshControls() : CS1Dialog , CS2Dialog , CS3Dialog , CS4Dialog , CTypesDialog
  • RefreshData() : CDataGrid
  • RefreshEnum() : CFullConnectProvider
  • RefreshNodeList() : CDeviceNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode
  • RefreshOptions() : CFullConnectOptions
  • RefreshProperties() : CFullConnectProperties
  • RefreshProvider() : CFullConnectProvider
  • RefreshRouter()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • RefreshSecurity() : CFullConnectSecurity
  • RefreshTreeControls() : CSchemaDlg
  • Register() : CMallocSpy , CBitmapWnd , WiaWrap::CEventCallback , CMainWindow
  • RegisterAll() : CFactory
  • RegisterAllClasses() : CFrame
  • RegisterAndCreateWindow() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • RegisterCategories() : CCaseTextService , CMarkTextService
  • RegisterChange() : CachePluginAdmin
  • RegisterChangeHandler() : CachePluginAdmin
  • RegisterClass() : CRTCAVSession , CRTCIMSession , CRTCWin
  • RegisteredChangeHandler : CachePluginAdmin
  • RegisterEventSink() : CBicycleFolder
  • RegisterForConnectionNotification() : RqsEngine
  • RegisterFunction() : CacheProxySamplePlugin::CacheProxyPlugin
  • RegisterProfiles() : CCaseTextService , CMarkTextService
  • RegisterProviderProc() : CMainWindow
  • RegisterServer() : COleDocument , CCmdLineConsumerApp , CPermEventsApp , CCaseTextService , CMarkTextService
  • RegisterSink() : CPlgTermSample
  • RegistryConfirm() : CAppletSession
  • RegistryKey : tagAppletRegistryRequest
  • reiRtmEntity : _CONFIGURATION_ENTRY
  • RejectCall() : Conf
  • Release() : CSmpFilter , CSmpFilterCF , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CFactory , CCallAsFactory , CCallAs , CHello , CHelloClassFactory , CString , CImpAuth , CSmartPtr< T > , CSmartPtrTrace< T > , CWiaDataCallback , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCEvents , CTAPIEventNotification , CDownloadBindStatusCallback , InkCollectorEvents , SmartRefPointer< T > , CBackgroundCopyCallback , CMonitor , CSmartComPtr< T > , CMgrNotify , CConfNotify , CDataNotify , RefCount , CApplet , CRefCount , CMgrNotify , CConfNotify , CAppletSession , CFtNotify , RefCount , CMgrNotify , CConfNotify , RefCount , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , RefCount , CMgrNotify , CAppShareNotify , CCallNotify , CConfNotify , CMgrNotify , RefCount , HtmlPropIFilter , HtmlPropIFilterCF , CHtmlIFilterBase , CHtmlIFilterCF , CLanguageResourceSampleCF , CSampleWordBreaker , CSampleStemmer
  • ReleaseAccessor() : CDataAccess , CImpIAccessor
  • ReleaseBuffer() : CString
  • ReleaseCatalog() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg
  • ReleaseChildren() : CBase
  • ReleaseFileObjectList() : CSyncMgrHandler
  • ReleaseHeldRows() : CDataGrid
  • ReleaseIMemberArray() : CConfNotify
  • ReleaseInner() : CAggregate
  • ReleaseInterface() : CSmartComPtr< T >
  • ReleaseIt() : SmartRefPointer< T >
  • ReleaseItemLock() : CSettings
  • ReleaseItemLockX() : CSettings
  • ReleaseMarshalData() : CClassFactoryWrapper , CDynamic , CEntity , CResultset
  • ReleaseObject() : CBase
  • ReleaseRows() : CMSOmniProvRowset , CDataGrid , CRowset , CImpIRowset
  • ReleaseStateMachine() : CRTCIncomingDlg , CRTCOutgoingDlg
  • ReleaseStreamsAndStorage() : CPersistStorage
  • ReleaseThread() : ISAPITHREAD
  • ReleaseTransaction() : CMDIChild
  • relname : direct
  • ReloadConfig() : RqsEngine
  • ReloadTrace() : RqsEngine
  • RemoteFileName : tReq
  • RemoteHungup() : Conf
  • RemoteOpen() : FileRepServer
  • RemoteRead() : FileRepServer
  • RemoteReadAsyncPipe() : FileRepServer
  • Remove() : comadmin::COMAdminCatalogCollection , comadmin::ICatalogCollection , CLinkable , CDynamic , CEntity , NIDequeIter_c< T > , CSimpleArray< T > , CAgentCtlCommandsEx
  • RemoveAll() : CStaticMap , CParameters , CBindings , CColumnInfo , CList< TYPE, ARG_TYPE > , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , CVector< TYPE, IDX > , CProperties , CPropertyInfos , TPropSetBase< TYPE, OBJTYPE > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , CSimpleArray< T > , CAgentCtlCommandsEx
  • RemoveAllCacheItems() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • RemoveAllChildren() : CMainWindow
  • RemoveAllSubscriptions() : CAppInfo
  • RemoveAt() : CList< TYPE, ARG_TYPE > , CVector< TYPE, IDX > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , CSimpleArray< T > , COBLIST
  • RemoveAttribute() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • RemoveCacheItem() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • RemoveChildNode() : CDeviceNode , CFolderNode
  • RemoveChildNodes() : CDeviceNode , CFolderNode , CStaticNode
  • RemoveData() : NIDequeIter_c< T >
  • removeDataSourceListener() : MyDataSource
  • RemoveDevice() : CGenericUCPDlg
  • RemoveDiskFromArray() : CEnumStorageResource
  • RemoveElement() : CVectorEx< TYPE, IDX >
  • RemoveEntryFromDatabase() : CacheProxySamplePlugin::CacheProxyPlugin
  • RemoveEnum() : CRefClient , CRefresher
  • RemoveFromBack() : NIDeque_c< T >
  • RemoveFromFront() : NIDeque_c< T >
  • RemoveFromList() : CMallocSpy , CViewList
  • RemoveFromMediaCapabilities() : CRTCOutgoingDlg
  • RemoveFromOpenedQueuePathNameArray() : CMainFrame
  • RemoveFromPathNameArray() : CMainFrame
  • RemoveFromPluginCollection() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RemoveHead() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • RemoveItem() : ClientList
  • RemoveKey() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • RemoveMember() : CAppletSession
  • RemoveMenus() : COleDocumentView , CFrame
  • RemoveNode() : CObjTree
  • RemoveNodes() : CDeviceNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode
  • RemoveObject() : CObjTree , CRefresher
  • RemoveObjects() : CRefClient
  • removeOLEDBSimpleProviderListener() : MyOSPObject
  • RemoveParent() : CVCExploreDlg
  • RemoveRecentConfig() : CFullConnect
  • RemoveRecentFile() : CFullConnect
  • removeRequest() : RSProxy
  • removeResponse() : RSProxy
  • RemoveSession() : CDataSource , CRTCWin
  • RemoveStream() : CSampleMSPCall
  • RemoveSubscription() : CAppInfo
  • removeSubscription() : NewsSubscriber
  • RemoveTail() : CLListImpl< TYPE, ARG_TYPE > , COBLIST , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • RemoveUser() : IDBAuthAdmin , CDBAuthAdmin , CDBAuthPlugin
  • RemoveVirtualFile() : CFolderNode
  • RenameItem() : CShellView
  • Replace() : NIDequeIter_c< T >
  • ReplaceAll() : CEditBoxLite
  • ReplacePage() : CShellExt , CSCP , CProppageUser
  • ReplaceSel() : CEditBoxLite , CRichEditLite
  • ReplaceWindowModeChange() : CFileViewer
  • Requery()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • Request() : CContext
  • REQUEST_ID : RSProxy
  • REQUEST_MODE : RSProxy
  • REQUEST_MODE_COMPLETE : RSProxy
  • REQUEST_MODE_PARTIAL : RSProxy
  • REQUEST_NEXT : RSProxy
  • REQUEST_PREV : RSProxy
  • REQUEST_THREAD : RSProxy
  • REQUEST_URL : RSProxy
  • REQUEST_URLCONTEXT : RSProxy
  • RequestAttrsAtPosition() : CTSFEditWnd
  • RequestAttrsTransitioningAtPosition() : CTSFEditWnd
  • RequestBorderSpace() : CFrame
  • RequestComplete() : AgentNotifySink , Notify
  • RequesterStatusCallback : ASYNC_REQUESTER
  • RequestFile() : FileRepClient
  • RequestItemLock() : CSettings
  • RequestLock() : CTSFEditWnd
  • RequestNewObjectLayout() : CImpIOleClientSite , CSpyCon , COleClient , CBrowserHost
  • RequestStart() : AgentNotifySink , Notify
  • RequestSupportedAttrs() : CTSFEditWnd
  • RequestToShutdown() : ASYNC_REQUESTER
  • reserved : APMFILEHEADER
  • Reserved1() : comadmin::ICOMAdminCatalog
  • reserved1 : igmp_hdr_report_v3
  • Reserved1() : comadmin::COMAdminCatalog
  • reserved2 : igmp_hdr_report_v3
  • Reserved2()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • ReserveLimit : _VIRTUAL_BUFFER
  • Reset() : CAsyncXXX< T, ISyncFace, IAsyncFace > , CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc , fullsvr::AsyncFullServ , fullsvr::ISynchronize , CMallocSpy , CGenericEnum , CEnumSyncMgrItems , CCertEncodeDateArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeCRLDistInfo , CEnumFormatEtc , CEnumTASK , CRefresherMember< T > , ISAPI_BUFFER , CStorageResource , CEnumFormatEtc , CDataObject , CDisplayAttributeInfo , CEnumDisplayAttributeInfo , CEnumIDList , CEnumStorageResource , CImpIDBBinderProperties , CCertEncodeLongArray , CCallBack
  • ResetAceMaskControls() : CDlgIADsSecurityDescriptor
  • ResetAcePtr() : CDlgIADsSecurityDescriptor
  • ResetColInfo() : CS1Dialog
  • ResetContent() : CComboBoxLite
  • ResetDefaults() : CFullConnect
  • ResetIndexList() : CS2Dialog
  • ResetParser() : CCmdLineLite
  • ResetResource() : CLDisp
  • ResetResults() : CRecoOutputWnd
  • ResetSearchPref() : CADsSearch
  • ResetSlots() : CBitArray
  • ResetTableList() : CS1Dialog
  • ResetTypeLists() : CTypesDialog
  • resid : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • Resize() : ISAPI_BUFFER
  • ResizeBorder() : COleInPlaceActiveObject
  • ResizeBorderDW() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • ResizeBuffer() : ISAPI_STRING , ISAPI_STRINGW
  • ResizeClientWindow() : CFrame
  • Response() : CContext
  • RESPONSE_DATA : RSProxy
  • RESPONSE_MESSAGE : RSProxy
  • RESPONSE_NEXT : RSProxy
  • RESPONSE_REQUESTID : RSProxy
  • RESPONSE_STATUS : RSProxy
  • Restart() : AgentNotifySink , Notify , AgentNotifySink
  • RestartPosition() : CDataGrid , CRowset , CImpIRowset
  • RestoreCursor() : CWaitCursor
  • RestoreREGDB()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • RestoreResultView() : CComponent
  • RestoreSelection() : CComboBoxLite
  • Restrictions : _ConnectionVtbl
  • RestrictionsOnOpenSchema() : CADVCGENDlg
  • result : compitem
  • resultCode : tphys_connect_info
  • resv_suppr_robust : igmp_hdr_query_v3
  • Resync()
: msado15::Recordset
, msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset21
  • RetrieveBaseNodePtr() : CDataObject
  • RetrieveData() : CSCPCMenuDialog
  • RetrieveDataObjPtr() : CDataObject
  • RetrieveDialogInformation() : CContextSamplePropPage
  • RetrieveDisplayString() : CDataObject
  • RetrieveGuidString() : CDataObject
  • RetrieveMultiSelectCookies() : CDataObject
  • RetrieveMultiSelectTypes() : CDataObject
  • RetrieveNodeAttribs() : CDataObject
  • RetrieveNodePropPtr() : CDataObject
  • RetrieveNodeTypeFlg() : CDataObject
  • RetrieveNodeTypeGuid() : CDataObject
  • RetrieveRequestedAttrs() : CTSFEditWnd
  • RetrieveSnapInClassID() : CDataObject
  • RetryCount : _JOB_INFO
  • reverseProxyRedirectURL : PersistedConfiguration
  • Revert() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream
  • Rewind() : CMmStreamConsecBuf
  • rgbBackColor : PROFILE_STRUCT
  • rgbCoreHdr : _DIBDATA
  • rgbForeColor : PROFILE_STRUCT
  • rgBindings : tagACCESSOR , BINDINGINFO
  • rgbyBuffer : _PACKET
  • rgchars : _STDZ
  • rgchFile : _OPEN_FILE
  • rgcmd : _CMDI
  • rgDispId : IUPnPService_DimmingService_SCPDVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _ConnectionVtbl , FieldsVtbl , ParametersVtbl , PropertiesVtbl , IMMCControlVtbl , _ParameterVtbl , ADORecordsetConstructionVtbl , _ADODynaCollectionVtbl , PropertyVtbl , IADsErrorVtbl , IHelloWorldVtbl , _RecordsetVtbl , FieldVtbl , _CommandVtbl , _ADOCollectionVtbl
  • rgFieldInfo : THREAD_STRUCT
  • rgFileInfo : _DIBDATA
  • rgInts : _STANDARDSECINMEM
  • rgIssuer : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • rglMask : tagSERVERINFO
  • rglpsz : _STANDARDSECINMEM
  • rgmsd : _MSDI
  • rgpbmi : _DIBDATA
  • rgpe : LOGPAL
  • rgpjFrame : _DIBDATA
  • rgPropId : _STANDARDSECINMEM , _SECTION
  • rgPropSet : _SUMMARYINFO , _RSUMINFO
  • rgPropValue : _SECTION
  • rgResInfo : _SCHEMAINFO
  • rgSections : _SUMMARYINFO
  • rgslot : tagLSTSLOT
  • rgszNames : PropertyVtbl , _ADODynaCollectionVtbl , IHelloWorldVtbl , PropertiesVtbl , ParametersVtbl , FieldVtbl , _ADOCollectionVtbl , _CommandVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOVtbl , ErrorVtbl , IMMCControlVtbl , _ConnectionVtbl , ErrorsVtbl , _RecordsetVtbl , FieldsVtbl , _ParameterVtbl , ADORecordsetConstructionVtbl , IADsErrorVtbl
  • rgTime : _STANDARDSECINMEM
  • right : RECTI , complist , Margin , compitem , treeitem
  • rightbase : section
  • rightBottomHandle : InkClipboard::InkClipboard
  • rightCenterHandle : InkClipboard::InkClipboard
  • rightTopHandle : InkClipboard::InkClipboard
  • riid : IHelloWorldVtbl , _ADOCollectionVtbl , _RecordsetVtbl , _ConnectionVtbl , _CommandVtbl , _ADODynaCollectionVtbl , _RecordsetVtbl , _ADOVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _CommandVtbl , _ConnectionVtbl , _ParameterVtbl , ErrorsVtbl , IAppletSessionNotifyVtbl , _ADOCollectionVtbl , PropertiesVtbl , IUPnPService_DimmingService_SCPDVtbl , PropertiesVtbl , ADORecordsetConstructionVtbl , IAppletVtbl , ADORecordsetConstructionVtbl , _ADOVtbl , ErrorVtbl , ADOConnectionConstructionVtbl , ErrorsVtbl , FieldsVtbl , _CommandVtbl , IADsErrorVtbl , PropertiesVtbl , _ParameterVtbl , IADsErrorVtbl , FieldVtbl , ErrorVtbl , IHelloWorldVtbl , PropertyVtbl , IMMCControlVtbl , PropertyVtbl , FieldVtbl , IAppletNotifyVtbl , PropertyVtbl , ErrorVtbl , ParametersVtbl , FieldsVtbl , IMMCControlVtbl , ParametersVtbl , _ParameterVtbl , ADORecordsetConstructionVtbl , ParametersVtbl , FieldsVtbl , CProviderFactory , FieldVtbl , IUPnPService_DimmingService_SCPDVtbl , _RecordsetVtbl , IMMCControlVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOVtbl , IHelloWorldVtbl , IAppletSessionVtbl
  • riidInst : CDefClassFactory
  • ROCKET_STATUS : CRocket
  • RollbackTrans()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • RollbackTransComplete()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • root : treeitem
  • Root : NIDeque_c< T >
  • rootname : dirlist
  • RosterReportIndication() : CAppletSession
  • RotateColor() : CSimpSvrObj
  • RoutingInfo : _JOB_INFO
  • row : CellDataList
  • Row : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl , CGridIt
  • RowBookmark() : CDataGrid
  • RowChangeProc() : CMDIChild
  • RowContaining() : CDataGrid
  • rowheight : Table
  • RowOpenProc() : CMDIChild
  • Rows : _RecordsetVtbl
  • rows : view
  • RowTop() : CDataGrid
  • rowwidth : Table
  • rpeEvent : _EVENT_ENTRY
  • RPvlPropertyValue() : CClusPropList
  • RqsClient() : RqsClient
  • RqsConfig() : RqsConfig
  • RqsEngine() : RqsEngine
  • rrpRtmProfile : _CONFIGURATION_ENTRY
  • rsa : KEY_HEADER
  • RSProxy() : RSProxy
  • RSQuery() : CProxy
  • RSQueryRW() : CProxy
  • RSUpdate() : CProxy
  • RTCClientEvent() : CRTCIncomingDlg , CRTCOutgoingDlg
  • RTCMediaEvent() : CRTCOutgoingDlg , CRTCIncomingDlg
  • RTCSessionStateEvent() : CRTCIncomingDlg , CRTCOutgoingDlg
  • rTracks : tag_smf
  • Run() : CBrowserHost , CPropSheetHost , CAdvRecoApp
  • run() : RSProxy
  • Run() : IBrowserHost , CPlgFilter , CBrowserHost , CSpyCon , IBrowserHost , CBrowserHost , CMultiRecoApp , CBrowserHost , CAppLite , IBrowserHost
  • RUNNING : CPlane
  • Running : CMyEventProvider
  • RUNNING : CRocket , CToolBarExtension
  • runUrlDownloadThread() : RSProxy
  • rValue() : APIHook< T >
  • RWL_ReaderCount : _READ_WRITE_LOCK
  • RWL_ReaderDoneEvent : _READ_WRITE_LOCK
  • RWL_ReadWriteBlock : _READ_WRITE_LOCK
  • rwlLock : _NETWORK_ENTRY , _CONFIGURATION_ENTRY , _DYNAMIC_READWRITE_LOCK
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- s -

  • s : _CONNECTEXARGS , _TRANSMITPACKETSARGS , _WSARECVMSGARGS , _DISCONNECTEXARGS
  • s1 : _IID
  • S1 : _DOSDTTM
  • s2 : _IID
  • s_cActiveComponents : CUnknown
  • s_cfDisplayName : CDataObject , CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
  • s_cfInternal : CDataObject
  • s_cfMultiSelect : CDataObject
  • s_cfNodeType : CDataObject , CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
  • s_cfSnapinClsid : CDataObject
  • s_cfSnapInCLSID : CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
  • s_cfSZNodeType : CDataObject
  • s_CommandContextHintValues : CContextPlugin
  • S_COMPLETED : RSProxy
  • s_cServerLocks : CFactory
  • S_HrCreateObject() : CObjData
  • s_LocksInProgress : Provider_Globals
  • s_ObjectsInProgress : Provider_Globals
  • S_PARTIAL : RSProxy
  • S_PENDING : RSProxy
  • s_PresentationContextHintValues : CContextPlugin
  • s_UserContextHintValues : CContextPlugin
  • s_wstrNamedValueContextTypes : CContextPlugin
  • s_wstrNamedValueOutputPath : CContextPlugin
  • sAcceptSocket : _ACCEPTEXARGS
  • SafeAddRef() : CSafeRefCount
  • SafeGetFromPosition() : COBLIST
  • SafeRelease() : CSafeRefCount
  • SafeStrlen() : CString
  • Save() : CHtmlIFilter , CHtmlIFilterBase , CSmpFilter , CCommBand , CDeskBand , CExplorerBar , CToolBand , CImpIPersistFile , CShellExt , CPersistFile , CPersistStorage , msado15::_Recordset , msado15::Recordset , CDynamic , CEntity , CResultset , CEditBoxLite , CXmlDOM , CPropertyPage , CDSLConnectionPage , IMyPersistStreamImpl< T > , CComponentData , HtmlPropIFilter
  • SaveAll() : CBankDlg
  • SaveAndReOpenFile() : CDBFile
  • SaveArray() : CComputer , CHuman
  • SaveAsMenu : Serialization::SerializationForm
  • SaveAsMenu_Click() : Serialization::SerializationForm
  • SaveChanges()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • savecomp : THREADARGS
  • SaveCompleted() : CPersistFile , CPersistStorage , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter , CImpIPersistFile , CShellExt
  • SaveConfigValues() : CContextPlugin
  • saveData() : MyOSPObject
  • SaveDefaults() : CFullConnect
  • SaveHTML() : Serialization::SerializationForm
  • SaveInitString() : CServiceComp
  • SaveISF() : Serialization::SerializationForm
  • savelist : THREADARGS
  • SaveNewProvider() : Microsoft::Uddi::Demo::Publish
  • SaveObject() : CSpyCon , CImpIOleClientSite , COleClient , CBrowserHost
  • SaveOptions() : COptionsSheet
  • SavePlaylist() : CacheProxySamplePlugin::CacheProxyPlugin
  • SaveSelection() : CComboBoxLite
  • SaveSettings() : CSpyCon , CMainWindow
  • SaveStrokeCollection() : CMultiRecoApp
  • SaveToFile() : CComSpy , IComSpy , msado15::_Stream , msado15::Stream
  • SaveToStorage() : CSimpSvrObj
  • SaveToStream() : CEntity
  • SaveViewState() : COleDocumentView , CShellView
  • SaveXML() : Serialization::SerializationForm
  • Say() : IHelloWorld , HelloWorld , IHelloWorld , HelloWorld
  • sbGesture : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • sc : STYLE
  • ScAddExpandSzProp() : CClusPropList
  • ScAddMultiSzProp() : CClusPropList
  • ScAddProp() : CClusPropList
  • scale : FieldInfo
  • Scale() : CCanvas
  • ScAllocPropList() : CClusPropList
  • ScAllocValueList() : CClusPropValueList
  • ScanTag() : CHtmlScanner
  • ScanTagBuffer() : CHtmlScanner
  • ScAppend() : CClusPropList
  • ScCheckIfAtLastProperty() : CClusPropList
  • ScCheckIfAtLastValue() : CClusPropValueList
  • ScCopy() : CClusPropList
  • scenario : _ClientContext
  • ScGetClusterProperties() : CClusPropList
  • ScGetGroupProperties() : CClusPropList
  • ScGetNetInterfaceProperties() : CClusPropList
  • ScGetNetworkProperties() : CClusPropList
  • ScGetNodeProperties() : CClusPropList
  • ScGetResourceProperties() : CClusPropList
  • ScGetResourceTypeProperties() : CClusPropList
  • ScGetResourceTypeValueList() : CClusPropValueList
  • ScGetResourceValueList() : CClusPropValueList
  • sChar : tagDataStruct
  • ScheduleWork() : RqsEngine
  • Schema : _ConnectionVtbl
  • SchemaID : _ConnectionVtbl
  • SchemaRowsetProc() : CSchemaDlg
  • schemaRs : CADVCGENDlg
  • SchemaTreeProc() : CSchemaDlg
  • ScMoveToFirstProperty() : CClusPropList
  • ScMoveToFirstPropertyValue() : CClusPropList
  • ScMoveToFirstValue() : CClusPropValueList
  • ScMoveToNextProperty() : CClusPropList
  • ScMoveToNextPropertyValue() : CClusPropList
  • ScMoveToNextValue() : CClusPropValueList
  • ScMoveToPropertyByName() : CClusPropList
  • scodeVal : VTUNION
  • ScParseProperties() : CBasePropertyPage
  • ScParseUnknownProperty() : CBasePropertyPage
  • Scratch() : CDog
  • Scroll() : CSpyCon , CImpIOleInPlaceSite , CSimpleDoc , CDataGrid , COleClient , CCanvas , CView , CBrowserHost
  • scroll_dx : Table
  • ScrollCaret() : CEditBoxLite
  • ScrollGrid() : CDataGrid
  • scrollscale : Table
  • ScSetPropToDefault() : CClusPropList
  • sd : _RECV_INFO , _SEND_INFO , THREADINFO
  • sDataType : _ParameterVtbl
  • sDisplayName : _EVENT_SINK_INFO
  • sdouble : tagDataStruct
  • sdword : tagDataStruct
  • SearchComplete() : CDeviceFinderCallback
  • SearchDirection : _RecordsetVtbl
  • sec : perf , _SFFS , _DOSDTTM
  • second : THREADARGS
  • SecondAccept : _SEC_CONTEXT
  • SecondInit : _SEC_CONTEXT
  • secs_composite : compitem
  • secs_left : compitem
  • secs_right : compitem
  • section : viewline , _RSUMINFO
  • Seek() : CSimpleObject , msado15::_Recordset , msado15::Recordset , msado15::Recordset21 , CFileLite , CStream , CStorageBuffer , CFileStream , CImpIStream , CISeqStream
  • select : Table , DTHandler
  • Select() : CDelegationBase
  • SelectAllApps() : CSelectEventsDlg
  • SelectApplication() : CSelectEventsDlg
  • SelectApplications() : CComSpy , IComSpy
  • selectedHidden : AutoClaims::AutoClaims
  • selectedIndex : AutoClaims::AutoClaims
  • SelectedInkWidthIncrease : InkClipboard::InkClipboard
  • selectedStrokes : InkClipboard::InkClipboard
  • selection : EDITARGS
  • selectionHandles : InkClipboard::InkClipboard
  • selectionRect : InkClipboard::InkClipboard
  • SelectionRectBuffer : InkClipboard::InkClipboard
  • SelectItem() : CTreeViewLite , CDelegationBase , CShellView
  • selectmode : TableHdr
  • SelectObject() : CObjTree
  • selector : _THUMB
  • SelectTerminal() : CSampleMSPStream
  • selitem : itemlist
  • selvisible : Table
  • Semaphore : _WORK_QUEUE
  • send() : DTHandler , SocketMonitor
  • SendArgs : _WSAOVERLAPPEDPLUS
  • sendBufSize : _ClientContext
  • SendBufSize : _WORK_THREAD_DATA
  • SendData() : CAppletSession
  • SendDataIndication() : CAppletSession
  • SENDING : ASYNC_REQUESTER
  • SendKeystroke() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • SendMouseMovement() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • sendOffset : _DATA_BUFFER
  • SendOnDataChange() : CSimpSvrObj
  • SendPriority : _QOS_OPTIONS
  • SendResponse() : RqsClient
  • sendscroll : TableHdr
  • SendStatusReport() : CMgdClusCfgInit
  • sendto() : DTHandler
  • SendToArgs : _WSAOVERLAPPEDPLUS
  • SeperatorMenu : Serialization::SerializationForm
  • seq_num : tpc_hdr
  • sequence : diritem
  • SerializationForm() : Serialization::SerializationForm
  • Serialize() : CPrintSDIDoc , CTestDoc , CAPIDoc , CCustomPropertyStore
  • SerializedValues : CachePluginAdmin
  • SerializeInkData() : InkBlog::InkArea
  • server : CFactoryData
  • Server() : CContext
  • serverHandle : CProcessDlg , CQueryDlg , CSessionDlg , CShutdownDlg , CWaitSystemDlg
  • serverName : CAPIDoc , CProcessDlg , CQueryDlg , CServerDlg , CSessionDlg , CShutdownDlg , CWaitSystemDlg
  • ServerName : tReq
  • ServiceCheck()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • serviceIDDeviceMap : UPNPDimmerDevice , CDimmer
  • ServiceInstanceDied() : CServiceCallback
  • Session() : CContext
  • SESSION_OPERATION : CRTCIncomingDlg , CRTCOutgoingDlg
  • sessionID : CAPIDoc , CSessionDlg
  • SessionKey : tagAppletRegistryKey , tagAppletProtocolEntity , tagAppletRoster , tagAppletSessionRequest
  • Set() : CImpAuth , CRefresherMember< T > , CQuickStringWrap , SMmStream , XPtr< T > , XInterface< T > , XBStr , XWindow , XBStr , XPtr< T >
  • set : IWMSCacheAdmin
  • set_Catalog() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg
  • set_ComputerName() : CVCExploreDlg
  • set_CurrentCollection() : CVCExploreDlg
  • set_ParentDlg() : CConnectDlg
  • set_UtilityType() : CAppUtilDlg
  • setAbsolutePage()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • setAbsolutePosition()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetAccountClsctx() : CMoveMoney
  • SetActionText() : CDownloadUI
  • setActiveConnection()
: msado15::_Command
, msado15::_Record
, msado15::_Recordset
, msado15::Command
, msado15::Command15
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetActiveObject() : CFrame
  • SetAllowAddNew() : CDataGrid
  • SetAllowArrows() : CDataGrid
  • SetAllowDelete() : CDataGrid
  • SetAllowRowSizing() : CDataGrid
  • SetAllowUpdate() : CDataGrid
  • SetAndGetHostName() : CX224
  • SetAppearance() : CDataGrid
  • SetArray() : CVARIANT
  • SetAt() : CString , CList< TYPE, ARG_TYPE > , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • SetAtIndex() : CStaticMap , CSimpleArray< T >
  • SetAtIndexNoLen() : CStaticMap
  • SetAttribOnly() : CADsSearch
  • SetAttribute() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • SetAttributeInfo() : CDisplayAttributeInfo
  • setAttributes()
: msado15::_Connection
, msado15::_Parameter
, msado15::Connection
, msado15::Connection15
, msado15::Field
, msado15::Parameter
, msado15::Property
  • SetAuthorizedUsers() : CSids
  • SetAutoAnswerMode() : CRTCIncomingDlg
  • SetAutoPopupMenu() : CAgentCtlCharacterEx
  • SetBackColor() : CDataGrid
  • SetBannerText() : CDownloadUI
  • SetBindingType() : COptionsSheet
  • setBookmark()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetBookmark() : CDataGrid
  • SetBool() : CVARIANT
  • SetBorderSpace() : CFrame
  • SetBorderStyle() : CDataGrid
  • SetBuf() : CMmStreamBuf
  • SetBuffer() : CacheProxySamplePlugin::INSSBufferImpl
  • SetBufferedResponseStatus() : ISAPI_REQUEST
  • SetBuffers() : CNullModem
  • SetByte() : CVARIANT
  • setCacheSize()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetCaption() : CDataGrid , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetChannelNum() : CDlgSrc
  • setChapter() : msado15::ADORecordsetConstruction
  • SetCharFormat() : CRichEditLite
  • setCharset()
: msado15::_Stream
, msado15::Stream
  • SetCharTable() : CTextGrid
  • SetClerk() : CCrmMonComp
  • SetClientSite() : COleObject
  • SetCodePage() : CImportRes
  • SetCol() : CDataGrid
  • setCollect()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetColor() : CSimpSvrObj , CConsole , CRichEditLite , InkClipboard::InkClipboard
  • SetColorAttrib() : CConsole , CRichEditLite
  • SetColorScheme() : COleObject
  • SetColumn() : CListViewLite
  • SetColumnBind() : CFileIO
  • SetColumnData() : CDataAccess
  • SetColumnHeaders() : CDataGrid
  • SetColumns() : CImpIRowChange
  • SetColumnWidth() : CListViewLite
  • SetCommandStream() : CCommand
  • SetCommandText() : CCommand , CImpICommandText
  • setCommandText()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • SetCommandTextProc() : CMDIChild
  • setCommandTimeout()
: msado15::_Command
, msado15::_Connection
, msado15::Command
, msado15::Command15
, msado15::Connection
, msado15::Connection15
  • setCommandType()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • SetComponentData() : CDelegationBase
  • SetComPortState() : CNullModem
  • SetConfidence() : CAgentCtlCommandEx
  • SetConfidenceText() : CAgentCtlCommandEx
  • SetConfig() : CMDIChild
  • SetConn() : CUtil
  • SetConnected() : CAgentCtlEx
  • SetConnectedPort() : CNullModem
  • setConnectionString()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • setConnectionTimeout()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetConsoleTracing() : RqsEngine
  • SetConstraint() : CConstraintDlg
  • SetConstraintAndTable() : CConstraintDlg
  • SetContextTypes() : CContextPlugin
  • SetControlbar() : CComponent , CToolBarExtension , CComponent
  • SetCount() : CResultset
  • SetCounter() : CSampleInstance
  • SetCredentials() : CADQIApp
  • SetCSet() : CModel
  • SetCurrentCellModified() : CDataGrid
  • SetCurrentCellVisible() : CDataGrid
  • SetCurSel() : CListBoxLite , CComboBoxLite , CTabLite
  • setCursorLocation()
: msado15::_Connection
, msado15::_Recordset
, msado15::Connection
, msado15::Connection15
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • setCursorType()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • setCustomerId()
: qcnotify::INotify
, qcnotify::INotifyDefault
, qcnotify::Notify
, qcorder::IOrder
, qcorder::IOrderDefault
, qcorder::Order
, qcship::IShip
, qcship::IShipDefault
, qcship::Ship
  • SetData() : CDataObject , CDataXferObj , IRowsetChangeImpl< T, Storage, RowClass > , CDropObject , CImpIRowsetChange , CPropSheetHost , CDataObject , ISAPI_BUFFER , CDataObject , CPidlMgr , CTSFDataObject
  • SetDataChanged() : CDataGrid
  • setDataFormat() : msado15::Field
  • SetDataMember() : CDataGrid
  • setDataMember()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • SetDataSize() : ISAPI_BUFFER
  • setDataSource()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • SetDefaultCommand() : CAgentCtlCommandsEx
  • setDefaultDatabase()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetDefaultFont() : CRichEditLite
  • SetDefColWidth() : CDataGrid
  • setDefinedSize() : msado15::Field
  • setDeletedStatus() : CRocket
  • SetDeleteFlag() : CAppInfo
  • SetDescription() : CBankDlg , CAgentCtlCharacterEx , CPartitionInfo
  • SetDialogPointer() : CDeviceFinderCallback , CServiceCallback
  • SetDimLevel() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • setDirection()
: msado15::_Parameter
, msado15::Parameter
  • SetDirtyFlag() : CContextSamplePropPage
  • SetDispatch() : CVARIANT
  • SetDouble() : CVARIANT
  • SetDriveLetterMappings() : CPartitionInfo , CStorageResource
  • SetEditActive() : CDataGrid
  • SetEffects() : CRichEditLite
  • SetEnabled() : CDataGrid , CAgentCtlCommandEx
  • SetEngine() : RqsClient
  • SetEOS()
: msado15::_Stream
, msado15::Stream
  • SetErrorState() : CImportRes
  • SetExtent() : COleObject
  • setFile() : MyOSPObject
  • setFilter()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetFirstRow() : CDataGrid
  • SetFocus() : CWndLite
  • SetFont() : CWndLite , CTextField , CTextGrid , CCharBlock , CPage
  • SetFontCharSet() : CAgentCtlBalloonEx
  • SetFontName() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • SetFontRange() : CFontRange
  • SetFontSize() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • SetForeColor() : CDataGrid
  • SetFormat() : CBox , CCodeGrid , CPageFormat , CCharBlock , CPage , CModel
  • SetFoundLang() : CImportRes
  • SetGestureName() : CRecoOutputWnd
  • SetGlobalVoiceCommandsEnabled() : CAgentCtlCommandsEx
  • SetGuid() : CComboBoxGuid
  • SetGuide() : CInkInputWnd
  • SetHandle() : CDelegationBase , CBackground , CDelegationBase
  • SetHandles() : CRefClient , CSampleDataSource
  • SetHeading() : CProgress
  • SetHeadLines() : CDataGrid
  • SetHeight() : CAgentCtlCharacterEx
  • SetHelpContextID() : CAgentCtlCharacterEx , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetHelpFile() : CAgentCtlCharacterEx
  • SetHelpModeOn() : CAgentCtlCharacterEx
  • SetHostNames() : COleObject
  • SetHScrollPos() : CScrollableView
  • SetHtmlElement() : CHtmlElemBagEntry
  • SetIdleOn() : CAgentCtlCharacterEx
  • SetImpersonateIID() : CCommand
  • SetIndex() : CFileIdx
  • setIndex()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset21
  • SetInfo() : CException
  • SetIniFile() : CUtil
  • SetInner() : CAggregate
  • SetInPlaceSite() : COleDocumentView
  • SetInRosterFlag() : CMember
  • SetInterface() : CBase , CADsSearch
  • SetInterfaceSafetyOptions() : CPlgTermSample , CGrid , CFactory
  • setIsolationLevel()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetItem() : CTabLite
  • SetItemData() : CShellFolder
  • SetItemImage() : CListViewLite , CTreeViewLite
  • SetItemParam() : CListBoxLite , CListViewLite , CTreeViewLite , CComboBoxLite
  • SetItemState() : CListViewLite , CTreeViewLite
  • SetItemStatus() : CSyncMgrHandler
  • SetItemText() : CListViewLite , CTreeViewLite , CTabLite
  • SetKey() : CStaticMap
  • SetLanguageID() : CAgentCtlCharacterEx
  • SetLeft() : CAgentCtlCharacterEx
  • SetLeftCol() : CDataGrid
  • SetLen() : ISAPI_STRING , ISAPI_STRINGW
  • SetLength() : CacheProxySamplePlugin::INSSBufferImpl
  • setLineSeparator()
: msado15::_Stream
, msado15::Stream
  • SetLoadSchemesButtonState() : WsdlDiscovery::frmMain
  • SetLocale() : CHtmlIFilter
  • SetLocation() : InkClipboard::InkClipboard
  • setLockType()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetLogControl() : CCrmDebugCompensator , CCrmFilesCompensator
  • SetLogControlVariants() : CCrmDebugCompensator
  • SetLONG() : CVARIANT
  • SetManaged() : CStorageResource
  • SetManagedByDefault() : CStorageResource
  • SetMarqueeStyle() : CDataGrid
  • setMarshalOptions()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetMaxAlloc() : ISAPI_BUFFER , ISAPI_STRING , ISAPI_STRINGW
  • setMaxRecords()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetMaxResponseBufferSize() : ISAPI_REQUEST
  • SetMaxSyncWriteSize() : ISAPI_REQUEST
  • SetMediaType() : CPlgPin
  • SetMember() : CAppletSession , CMember
  • SetMenu() : CFrame
  • SetMenuState() : CDelegationBase , CRocket
  • SetMessage() : WiaWrap::CProgressDlg
  • setMode()
: msado15::_Connection
, msado15::_Record
, msado15::_Stream
, msado15::Connection
, msado15::Connection15
, msado15::Record
, msado15::Stream
  • SetMoniker() : COleObject
  • SetMultiNodeCapable() : CStorageResource
  • setName()
: msado15::_Command
, msado15::_Parameter
, msado15::Command
, msado15::Command15
, msado15::Parameter
  • SetName() : CAgentCtlCharacterEx , CPartitionInfo , CStorageResource
  • SetNameCount() : CCertEncodeCRLDistInfo
  • SetNameEntry() : CCertEncodeAltName , CCertEncodeCRLDistInfo
  • SetNameOf() : CShellFolder
  • SetNextHashEntry() : CSpecialCharHashEntry
  • setNumericScale()
: msado15::_Parameter
, msado15::Field
, msado15::Parameter
  • SetObj() : CSCPWiz , CWizExtUser
  • SetObject() : CPropSheetHost , CSCPWiz , CWizExtUser
  • SetObjectDesc() : CBase
  • SetObjectRects() : CComSpy , COleInPlaceObject
  • SetObjects() : CPropertyPage
  • setOLEDBCommand() : msado15::ADOCommandConstruction
  • SetOptions() : CEditBoxLite
  • setOrderId()
: qcnotify::INotify
, qcnotify::INotifyDefault
, qcnotify::Notify
, qcorder::IOrder
, qcorder::IOrderDefault
, qcorder::Order
, qcship::IShip
, qcship::IShipDefault
, qcship::Ship
  • SetOutputPath() : CContextPlugin
  • SetPage() : CModel , CAgentCtlPropertySheet
  • SetPageMode() : CModel
  • SetPageSite() : CPropertyPage
  • SetPageSize() : CADsSearch
  • setPageSize()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetParameterInfoProc() : CMDIChild
  • SetParent() : CPropPageLite
  • setParentRow() : msado15::ADORecordConstruction
  • SetParts() : CStatusBarLite
  • SetPercent() : WiaWrap::CProgressDlg
  • setPosition()
: msado15::_Stream
, msado15::Stream
  • setPrecision()
: msado15::_Parameter
, msado15::Field
, msado15::Parameter
  • setPrepared()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • SetPrivateData() : CDataObject
  • SetProgressCallback() : CSyncMgrHandler
  • SetProperties() : CPropertiesBase , CBinder , CCommand , CPropertiesDlg , CImpIDBBinderProperties , CImpICommandProperties , CImpIDBProperties , CImpISessionProperties , CUtilProp
  • SetPropertiesArgChk() : CUtilProp
  • SetProperty() : CProperties , CPropertyIDs , CPropSets , CPropIDSets , CFullPropSpec
  • SetPropid() : CToken
  • SetPropset() : CToken
  • SetPropSet() : CFullPropSpec
  • setProvider()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetQuorumCapable() : CStorageResource
  • SetQuorumResource() : CStorageResource
  • SetRaiseRequestErrors() : CAgentCtlEx
  • SetRawSql() : Query
  • SetReadOnly() : CEditBoxLite
  • SetRecord() : CCrmMonComp
  • SetRecordSelectors() : CDataGrid
  • SetRect() : COleDocumentView
  • SetRectComplex() : COleDocumentView
  • SetRefDataSource() : CDataGrid
  • SetRefFont() : CDataGrid
  • SetRefHeadFont() : CDataGrid
  • SetReqType() : CEditValueDlg
  • SetResourcePrivateData() : CStorageResource
  • SetReturnValue() : CListener
  • SetRightToLeft() : CDataGrid
  • setRow() : msado15::ADORecordConstruction
  • SetRow() : CDataGrid
  • SetRowDividerStyle() : CDataGrid
  • SetRowHandle() : CRow
  • SetRowHeight() : CDataGrid
  • setRowPosition() : msado15::ADORecordsetConstruction
  • SetRowsCols() : CInkInputWnd
  • setRowset() : msado15::ADORecordsetConstruction
  • SetScale() : CScrollableView
  • SetSchemaInfo() : CMSOmniProvRowset
  • SetScope() : CADsSearch
  • SetScopeItemValue() : CDelegationBase , CLandBasedVehicle , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CSpaceVehicle , CStaticNode
  • SetScroll() : CScrollBarLite
  • SetScrollBars() : CDataGrid
  • SetScrollInfo() : CScrollBarLite
  • SetScrollPos() : CScrollBarLite
  • SetScrollRange() : CScrollBarLite
  • SetSearchLevel() : CADsSearch
  • SetSearchProviderButtonState() : WsdlDiscovery::frmMain
  • SetSearchServiceButtonState() : WsdlDiscovery::frmMain
  • SetSection() : CUtil
  • SetSecurity() : CObjSecurity
  • SetSel() : CEditBoxLite , CRichEditLite
  • SetSelection() : InkClipboard::InkClipboard , CTSFEditWnd
  • SetSelEndCol() : CDataGrid
  • SetSelLength() : CDataGrid
  • SetSelStart() : CDataGrid
  • SetSelStartCol() : CDataGrid
  • SetSelText() : CDataGrid , CComboBoxLite
  • SetSelValue() : CComboBoxLite
  • SetServerName() : CAPIDoc
  • SetServiceHandle() : RqsEngine
  • SetSessionID() : CAPIDoc , CSessionDlg
  • SetShort() : CVARIANT
  • SetSite() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • setSize()
: msado15::_Parameter
, msado15::Parameter
  • SetSize() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream , CView , CMmStream , PMmStream , CMmStreamBuf , XPtr< T >
  • SetSlots() : CBitArray
  • SetSnapOn() : ISnap
  • setsockopt() : DTHandler
  • setSort()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetSoundEffectsOn() : CAgentCtlCharacterEx
  • setSource()
: msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
, msado15::_Record
, msado15::_Recordset
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
  • SetSplit() : CDataGrid
  • SetSplitter() : CSplitterLite
  • SetSpyObj() : CSysLCESub
  • SetSql() : CUtil
  • SetSqlWhere() : Query
  • SetSRModeID() : CAgentCtlCharacterEx
  • SetStartTokenFlag() : CToken
  • SetStatus() : CMySink
  • SetStatusText() : CFrame , CSimpSvrApp , CSimpSvrDoc , CRTCSession , CRTCWin
  • setStayInSync()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • SetStr() : CVARIANT
  • setStream() : msado15::ADOStreamConstruction
  • SetStream() : CMmStreamBuf
  • SetStyle() : CLineGrid , CAgentCtlBalloonEx
  • SetTabAcrossSplits() : CDataGrid
  • SetTabAction() : CDataGrid
  • SetTemplateName() : CRequestInstance
  • SetTerminalInfo() : CPlgTermSample
  • SetText() : CDataGrid , CStatusBarLite , CProgress , XBStr , CTSFEditWnd
  • SetTextOrg() : CTextGrid
  • SetThreadData() : CBankDlg
  • SetTimeouts() : CNullModem
  • SetTitle() : WiaWrap::CProgressDlg
  • SetTokenType() : CHtmlElemBagEntry , CToken
  • SetToolbarButtons() : CToolBarExtension
  • SetTop() : CAgentCtlCharacterEx
  • SetTransactionOptionsProc() : CMDIChild
  • SetTTSModeID() : CAgentCtlCharacterEx
  • setType()
: msado15::_Parameter
, msado15::_Stream
, msado15::Field
, msado15::Parameter
, msado15::Stream
  • SetUIData() : CSCPCMenuDialog , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI
  • SetUIEmployeeID() : CProppageUserUI
  • SetUIPhoto() : CProppageUserUI
  • SetUnicode() : CFileLite
  • SetUnicodeFormat() : CComboBoxEx
  • SetUnknown() : CVARIANT
  • SetupBindings() : CCommand , CDataAccess
  • SetupColAccess() : CRow
  • SetupTransactionCombo() : CMDIChild
  • SetUserCancel() : CDownloadUI
  • setValue()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
, msado15::_Parameter
, msado15::Field
, msado15::Field15
, msado15::Parameter
, msado15::Property
  • SetValue() : CEditValueDlg , CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeStringArray
  • SetVariant() : CEditValueDlg
  • setVariant() : MyOSPObject
  • SetVisible() : CAgentCtlBalloonEx , CAgentCtlCommandEx , CAgentCtlCommandsEx , CAgentCtlPropertySheet
  • SetVoice() : CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetVoiceCaption() : CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetVScrollPos() : CScrollableView
  • SetWbemObject() : CPartitionInfo , CStorageResource , IWMIObject
  • SetWbemServices() : CEnumStorageResource , CPartitionInfo , CStorageResource , IWMIServices
  • SetWeight() : CLineGrid
  • SetWidth() : InkClipboard::InkClipboard , CAgentCtlCharacterEx
  • SetWindowPlacement() : CWndLite
  • SetWindowText() : CWndLite
  • SetWizardButtons() : CSCPPageGeneral , CSCPPageBindingInfo , CSCPPageKeywords , CExtPageUser
  • SetWordWrap() : CRichEditLite
  • SetWrapCellPointer() : CDataGrid
  • sfloat : tagDataStruct
  • sfSupportFunctions : _CONFIGURATION_ENTRY
  • Ship() : qcship::Ship
  • shipStatusValue() : qcship::Ship
  • shipStatusVect : qcnotify::Notify , qcship::Ship
  • ShortQuote()
: CNewsEvent
, cascadeec::CascadeEC
, cascadeec::INewsEvent
, cascadeec::INewsEventDefault
, newseventclass::INewsEvent
, newseventclass::INewsEventDefault
, newseventclass::NewsEvent
, NewsSubscriber
, persistatl::INewsEvent
, persistatl::INewsEventDefault
, persistatl::NewsEvent
  • shorttoken : _CMD
  • ShouldScroll() : CComSpy
  • Show() : COleDocumentView , CWebBrowser , CPropertyPage , CWindow , CDelegationBase , CSpaceVehicle , CSimpleDialog , CAgentCtlCharacterEx , CImpIFileViewer , CLangBarItemButton
  • show_whitespace : Table
  • ShowAppWnd() : CSimpSvrApp
  • ShowAttributes() : CDlgIDirectoryObject
  • ShowAudio() : CRTCAVSession
  • showChains() : Sample::Sample
  • ShowClipformatInfo() : CContextMenu
  • ShowCommentGlyphs() : CAnnotator , IAnnotator
  • ShowContextHelp() : CDelegationBase , CPerson
  • ShowDefaultCharacterProperties() : CAgentCtlEx
  • ShowDocWnd() : CSimpSvrDoc
  • ShowDW() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • ShowEnumeratorData() : CRefClient
  • ShowError() : CSyncMgrHandler
  • ShowErrorCall() : CSyncMgrHandler
  • ShowErrorCompleted() : CCallbackWrapper
  • ShowErrorCompletedMsg : _tagMETHODARGS
  • ShowErrorMsg : _tagMETHODARGS
  • ShowGridLines() : IComSpy
  • ShowHatchWnd() : CSimpSvrDoc
  • ShowInitialize() : CImpIFileViewer
  • ShowItemProperties() : CSettings
  • ShowMessageBox() : CRTCSession , CRTCWin
  • ShowObject() : CSpyCon , CImpIOleClientSite , COleClient , CBrowserHost
  • ShowObjectData() : CRefClient
  • ShowOnScreen() : IComSpy
  • ShowPopupMenu() : CAgentCtlCharacterEx
  • ShowProperties() : CSyncMgrHandler , CSettings , CEmptyVolumeCache
  • ShowPropertiesCall() : CSyncMgrHandler
  • ShowPropertiesCompleted() : CCallbackWrapper
  • ShowPropertiesCompletedMsg : _tagMETHODARGS
  • ShowPropertiesMsg : _tagMETHODARGS
  • ShowSelectedEvents() : CSelectEventsDlg
  • ShowSelectedSystemEvents() : CSelectEventsDlg
  • ShowVideo() : CRTCAVSession
  • ShowWindow() : CWndLite
  • Shrink() : CCustomPropertyStore
  • ShrinkFromFront() : PMmStream
  • Shutdown() : Notify
  • shutdown() : DTHandler
  • Shutdown() : CSampleDataContainer , CSampleDirectory , CSDKSamplePlaylistParser , CWorkerThread , CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices , AgentNotifySink , Notify
  • ShutDown() : CCertPolicySample
  • ShutdownApplication() : CComSpy , comadmin::COMAdminCatalog , comadmin::ICOMAdminCatalog
  • ShutdownFlag : _Shutdown
  • ShutdownMSPCall() : CSampleMSP
  • ShutdownName : _Shutdown
  • ShutdownPlugin() : CContextPlugin , CDBAuthPlugin , CAuthenticatePlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CSDKSamplePlaylistParserPlugin
  • ShutdownRTCApp() : CRTCIncomingDlg , CRTCOutgoingDlg
  • si : TS_VERSION_INFO
  • siDisplaySize : STR_BINDING
  • sidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • SigGenObjectType : _SIGGEN_DATA_DEFINITION
  • Signal() : fullsvr::ISynchronize , CAsyncXXX< T, ISyncFace, IAsyncFace > , CCallBack , fullsvr::AsyncFullServ
  • SignalEvent() : CConnectionPoint
  • Signature : Serialization::SerializationForm , _BLRPLATE
  • signGroupBox : Sample::UI::MainWindow
  • SignXML() : Sample::SignVerify
  • SignXMLX509Data() : Sample::SignVerify
  • SIMPLE_BROWSER : ASYNC_REQUESTER , SIMPLE_BROWSER
  • SimpleQuery() : CADOComponent , COLEDBComponent , CRDOComponent
  • Simulate() : CSampleDataSource
  • SIndexedDisk() : SIndexedDisk
  • SineWaveDef : _SIGGEN_DATA_DEFINITION
  • SINK_ENTRY_INFO() : IInkRecognitionEventsImpl< T > , IInkCollectorEventsImpl< T > , IInkRecognitionEventsImpl< T > , IInkCollectorEventsImpl< T >
  • Size : _Job
  • size : diritem , CellPos , tagDescInfo
  • Size : _CommandVtbl , _STREAM_FIND_DATA , CController , AgentNotifySink , Notify , CMmStream , PMmStream , CMmStreamBuf
  • SizeHigh() : PMmStream , CMmStream
  • SizeLow() : CMmStream , PMmStream
  • SizeToText : CapJ
  • Skip() : CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc , CGenericEnum , CEnumSyncMgrItems , CEnumFormatEtc , CEnumTASK , CEnumStorageResource , CStorageResource , CDataObject , CEnumIDList , CEnumDisplayAttributeInfo
  • SkipCharsUntilNextRelevantToken() : CHtmlScanner
  • SkipCurrent : _RecordsetVtbl
  • SkipLine()
: msado15::_Stream
, msado15::Stream
  • SkipRemainingTextAndGotoNextChunk() : CHtmlElement
  • skybasedvehicleGuid : CComponentData
  • sLastError : DebugGlobals
  • SmallChangeSize : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • SmartRefPointer() : SmartRefPointer< T >
  • SMmStream() : SMmStream
  • smti : tag_track
  • SnapIncrement() : ISnap
  • snapInData : CStaticNode
  • SnapOn() : ISnap
  • SnapRect() : CSnap
  • sndbuf : _SEND_INFO
  • sNext : STR_BINDING
  • sock : _SOCK_INFO , _ClientContext , _socklist
  • SockCritSec : _SOCK_INFO
  • Socket : _PER_SOCKET_CONTEXT
  • socket : Sock_Info , DTHandler
  • Socket : _RU_SOCKET
  • socket_type : Sock_Info
  • SocketAccept : _PER_IO_CONTEXT
  • SocketList : _PROVIDER
  • SockInfo : _WSAOVERLAPPEDPLUS
  • Sort() : CStatusHelper
  • SortItems() : CComponent
  • Source : _RecordsetVtbl
  • source_addr : igmp_group_record_v3
  • sources : igmp_hdr_query_v3
  • Speak() : CAgentCtlCharacterEx
  • SpeakButton : CapJ
  • SpeakButton_click() : CapJ
  • SpeakText : CapJ
  • SpeakTextWndProc : MainDlg
  • SpeechOutputLabel : CapJ
  • SplitContaining() : CDataGrid
  • spOptions : _OPTIONS
  • SprocketCount : _SAMPLE_HELPER_DATA_
  • sProviderAcceptSocket : _ACCEPTEXARGS
  • sqldatatype : tagFieldMetaData
  • sqltype : tagFieldMetaData
  • SquareWaveDef : _SIGGEN_DATA_DEFINITION
  • sRawSocket : _INTERFACE_ENTRY
  • src_portno : udp_hdr , tpc_hdr , port_hdr
  • ssBackOrdered : qcnotify::_ShipStatus
  • ssNotStocked : qcnotify::_ShipStatus
  • ssShipped : qcnotify::_ShipStatus
  • sString : RESULTDATA
  • ssUnprocessed : qcnotify::_ShipStatus
  • ssUnrecognizedItem : qcnotify::_ShipStatus
  • Stack : _ENUMERATE_DIRECTORY_STATE
  • Stack_c() : Stack_c< T >
  • start() : HelloJ , CellPos , filebuffer , RSProxy , Hello2J , Hello3J
  • Start : _RecordsetVtbl , CTIMER , ASYNC_REQUESTER
  • StartAnimation() : CMMCControl , IMMCControl , CWrapVBComponent
  • StartApplication()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • StartCall() : CCallBack
  • startcell : CellDataList , TableSelection
  • startcol : ColPropsList
  • StartMonitor() : CExeModule
  • startMoveLocation : InkClipboard::InkClipboard
  • StartNewStrokeCollection() : CMultiRecoApp
  • startOid : GlobalVars
  • startReceiveUpdateThread() : CDisdrawDlg
  • startRequest() : RSProxy
  • StartRouter()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • startrow : TableSelection
  • StartStream() : CSampleMSPStream
  • StartThread() : CBackgroundFolder
  • StartTracking() : CSplitterLite
  • StartTransactionProc() : CMDIChild
  • StartupInfo : DEB_STARTUP_INFO_STRUCT
  • StartupStatus : CGdiplusInit
  • Stat() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream , CStream
  • state : section
  • State : tSReq , _SEC_CONTEXT
  • state : compitem , _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • STATE : ASYNC_REQUESTER
  • State : tReq
  • StateAddPartyIDC() : CRTCOutgoingDlg
  • StateAddPartyIDCVisible() : CRTCOutgoingDlg
  • StateAnswerIDC() : CRTCIncomingDlg
  • StateAppSharingIDC() : CRTCOutgoingDlg
  • StateChanged() : CConfNotify , CAppShareNotify , CConfNotify , CAppShareNotify , CCallNotify , CConfNotify , CCallNotify , CConfNotify
  • StateCoCreateClient() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateConnectIDC() : CRTCOutgoingDlg
  • StateConnectIDCVisible() : CRTCOutgoingDlg
  • StateDisconnectIDC() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateDUriIDC() : CRTCOutgoingDlg
  • StateInitClient() : CRTCOutgoingDlg , CRTCIncomingDlg
  • StateListenMode() : CRTCIncomingDlg , CRTCOutgoingDlg
  • statels : itemlist
  • StateLUriIDC() : CRTCOutgoingDlg
  • StatePartyListIDC() : CRTCOutgoingDlg
  • StateQueryActiveMedia() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateRemovePartyIDC() : CRTCOutgoingDlg
  • StateSessionControl() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateSinkEvent() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateStartT120() : CRTCOutgoingDlg
  • StateStartTunning() : CRTCOutgoingDlg
  • StateTuneIDC() : CRTCOutgoingDlg
  • StateUnSinkEvent() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateVariableChanged() : CServiceCallback
  • StaticEnumerationCallback() : CReindeer
  • StaticNodeWndProc() : CStaticNode
  • STATUS : CToolBarExtension
  • Status : _DEVICE_INFO , _JOB_INFO , tReq , tSReq
  • statusBar : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm , Sample::UI::MainWindow
  • statusBarPanelDrawing : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelDummy : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelLine : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelParagraph : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelWord : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • STDMETHOD_() : CMallocSpy , CDog , CClassFactory , CClassFactoryWrapper , CSurrogate , CStdDbOutput , CDbAlloc , CCrmFilesTest , CLogFile , CADOComponent , COLEDBComponent , CRDOComponent , CDynamicResultset , COleClient , _NoAddRefReleaseQIOnSmartPtr< T > , CBitmapWnd , WiaWrap::CDataCallback , WiaWrap::CEventCallback , CMainWindow , WiaWrap::CProgressDlg , CProxyPlugin::COpState , CSampleDataContainer , CSampleDirectory , CAdminNotifyHandler , CObjSecurity , CWrapVBComponent , CEventSink , CAsyncQuerySink , CProviderFactory , CAsynchNotify , CDataObject , CDragSource , CDropTarget , CEnumFormatEtc , CDropTarget , CEnumIDList , CExtractIcon , CShellFolder , CShellView , CTSFEditWnd , CShellView , CDataObject , CExtractIcon , CDropTarget , CAdminNotifyHandler , CProviderFactory , CAsyncQuerySink , CBitmapWnd , CSampleDataContainer , CCrmFilesTest , COleClient , CRDOComponent , CClassFactory , CDbAlloc , CMallocSpy
  • STDMETHODIMP_() : CPropSheetExtension , COleInPlaceObject , CSnapinAbout , AgentNotifySink , CProvFactory , CComponentData , CStorageBuffer , CListener , CDataObject , CPersistFile , CLangBarItemButton , CAsyncQuerySink , CClassPro , CFrame , CAccount , CSnapinAbout , CComponentData , CImpIAdviseSink , CSimpleSite , CDataXferObj , CClassFactory , CSimpleSite , CProviderFactory , CSimpleSite , CImpIOleDocumentSite , CComponentData , CProvFactory , CComponent , CUrlmonCallback , CSimpleObject , CDataObject , CProvider_IWbemEventProvider , CSimpleObject , CSnapinAbout , CProvider_IWbemServices , CFactory , CComponent , CSimpleObject , CClassFactory , CProviderFactory , CSimpleObject , CComponent , CProvider_IWbemEventConsumerProvider , CTestCOMPerformance , CImpIOleDocumentSite , CComponentData , CComponent , CObject , CImpIAdviseSink , CDataObject , CImpIOleClientSite , CClassFactory , CPersistStorage , CPersistFile , COleObject , CSimpleObject , COleDocument , CClassPro , CExtendPropertySheet , CObject , CDataObject , CHiPerfProvider , CRefresher , CISeqStream , CMallocSpy , CProvFactory , CSamplePipe , CSimpleDoc , CMySink , CDataObject , CProvFactory , CComponent , CSnapinAbout , MyDataSource , AgentNotifySink , MyClassFactory , CClassFactory , CLangBarItemButton , CPropSheetHost , CComponent , CSnapinAbout , CExplorerBar , CToolBand , CSnapinAbout , CPropSheetHost , MyOSPObject , AgentNotifySink , CSnapinAbout , CImpIPersistFile , CClassFactory , CSnapinAbout , CProvFactory , CSnapinAbout , CUpdateReceipt , CDataObject , CProvider_IWbemEventProvider , CClassFactory , CDataObject , CClassFactory , CSnapinAbout , CSimpSvrDoc , CComponentData , CClassFactory , CShellIconOverlayID , CComponent , CSyncMgrHandler , CCaseTextService , CComponentData , CClassFactory , CCompartmentMonitor , CComponentData , CSettings , CEnumDisplayAttributeInfo , CCommBand , CCallbackWrapper , CComponent , CDropTarget , CMarkTextService , CClassFactory , CDataObject , CCustomPropertyStore , CComponentData , CSnapinAbout , CEnumSyncMgrItems , CDeskBand , CCommBand , CComponent , CInstPro , CComponentData , AgentNotifySink , CPropPro , CComponent , CMallocSpy , CComponentData , CSnapinAbout , CMethodPro , CDataObject , CMarkTextService , CComponentData , CSnapinAbout , CProvFactory , CMallocSpy , CProvider_IWbemEventConsumerProvider , CToolBand , CClassFactory , CLangBarItemButton , CClassFactory , CSnapinAbout , CEnumFormatEtc , CDisplayAttributeInfo , CClassFactory , CComponentData , CComponent , CComponentData , CComponent , CColumnProvider , CSnapinAbout , CClassFactory , AgentNotifySink , CClassFactory , CExplorerBar , CDataObject , CEditSessionBase , CClassFactory , CComponent , CDisplayAttributeInfo , CClassFactory , CEmptyVolumeCache , CDataObject , CCompartmentMonitor , CFVClassFactory , CEditSessionBase , CComponentData , CDataObject , CSnapinAbout , CFileViewer , CLangBarItemButton , CDataObject , CContextMenuExtension , CShellExt , CTSFPersistentPropertyLoader , CClassFactory , CDataObject , CDeskBand , CDataObject , CSnapinAbout , CComponentData , CClassFactory , CColumnProvider , CComponent , CEditSessionBase , CClassFactory , CComponent , CImpIFileViewer , CSnapinAbout , CDataObject , CCaseTextService , CClassFactory , CComponentData , CClassFactory , CSnapinAbout , CClassFactory , CComponentData , CClassFactory , CSnapinAbout , CContextMenu , CClassFactory , CImpIPersistFile , CTSFDataObject , CComponent , CTSFPersistentPropertyLoader , CComponent , CDropSource , CDataObject , CSnapinAbout , CShellIconOverlayID , CDataObject , CComponentData , CDropSource , CDataObject , CComponent , CClassFactory , CShellExtClassFactory , CClassFactory , CComponentData , CShellExt , CContextMenuExtension , CSnapinAbout , CComponentData , CFileViewer , CDataObject , CShellExtClassFactory , CComponentData , CDataObject , CClassFactory , CComponent , CSnapinAbout , CClassFactory , CContextMenu , CSnapinAbout , CShellExt , CComponentData , CEditSessionBase , CImpIFileViewer , CClassFactory , CPropPro , CSnapinAbout , CMallocSpy , CComponentData , CEmptyVolumeCache , CExtendContextMenuEx , CEnumDisplayAttributeInfo , CDataObject , CComponent , CSnapinAbout , CComponent , CSnapinAbout , CClassFactory , CCustomPropertyStore , CMallocSpy , CClassFactory , CEnumSyncMgrItems , CClassFactory , CTSFDataObject , CCallbackWrapper , CClassFactory , CDataObject , CClassFactory , CMallocSpy , CSnapinAbout , MyOSPObject , CClassFactory , AgentNotifySink , MyClassFactory , CExtendPropertySheet , CMySink , CProvider_IWbemEventProvider , CDataObject , CMallocSpy , CProvider_IWbemUnboundObjectSink , CRow , CSimpSvrApp , CMallocSpy , CFVClassFactory , CClassFactory , CSnapinAbout , CMallocSpy , CClassFactory , CRowset , CDataObject , CComponentData , CDataObject , CComponent , CDBSession , CCommand , CComponent , CSnapinAbout , CComponentData , CBinder , CRefresher , CClassFactory , CComponent , CProviderFactory , CSimpSvrApp , CMallocSpy , CDataObject , CMallocSpy , CComponent , CFactory , CMallocSpy , CFileStream , CComponent , CDataObject , CComponentData , CProvider , CClassFactory , CConsumer , CEnumFormatEtc , CDropSource , CDataObject , CAggregate , CComponent , CComponentData , CSnapinAbout , CComponentData , CClassFactory , CMallocSpy , CBase , CMallocSpy , CComponent , CComponentData , CClassFactory , CEnumTASK , CDataObject , CSnapinAbout , CDBSession , CComponent , CSnapinAbout , CDataObject , CEnumTASK , CClassFactory , CComponent , CBinder , CSnapinAbout , CClassFactory , CMallocSpy , CComponentData , CDataObject , CProvider_IWbemUnboundObjectSink , CComponentData , CMallocSpy , CComponent , CDataObject , CMyEventProvider , CComponent , CFileStream , CClassFactory , CDataObject , CClassFactory , CStorageBuffer , CDataObject , CClassFactory , CDropSource , CComponentData , CDropObject , CComponentData , CSnapinAbout , CClassFactory , CProvider_IWbemServices , CSnapinAbout , CUpdateReceipt , CClassFactory , CPropSheetExtension , CComponent , CAccount , CComponentData , CClassFactory , CProviderFactory , CClassFactory , CSnapinAbout , CComponentData , CSnapinAbout , CClassFactory , CSimpleApp , CComponentData , CSettings , CSimpleSite , CImpIAdviseSink , CSnapinAbout , CFactory , CClassFactory , CSimpleClass , CMallocSpy , CComponentData , CClassFactory , CDataObject , CEnumFormatEtc , CMallocSpy , COleInPlaceObject , CSnapinAbout , COleDocumentView , CListener , CToolBarExtension , CFrame , CSimpSvrObj , CImpIAdviseSink , CSimpleDoc , CComponent , CSimpleDoc , CImpIOleInPlaceSite , CComponentData , CSite , CClassFactory , CSnapinAbout , CClassFactory , CComponent , CClassFactory , CImpIOleInPlaceSite , CClassFactory , CObject , CClassFactory , COleObject , CClassFactory , COleInPlaceActiveObject , CClassFactory , CProvFactory , CComponentData , CProvider , CDataObject , CSecureObject , CClassFactory , CSimpleDoc , CDataObject , CDataXferObj , CDataObject , CComponent , CSimpleApp , CComponent , CClassFactory , CSyncMgrHandler , CComponent , CFactory , CDataObject , CGenericEnum , CClassFactory , COleInPlaceActiveObject , CImpIAdviseSink , CSimpleObject , CClassFactory , CComponentData , CClassFactory , CImpIAdviseSink , CUrlmonCallback , CImpIAdviseSink , CClassFactory , CSimpleObject , CTestCOMPerformance , CSite , CSecureObject , CObject , CMallocSpy , COleDocumentView , CComponentData , CSnapinAbout , CSimpleApp , CImpIOleClientSite , CPersistStorage , CSimpSvrDoc , CBase , CSimpleClass , COleDocument , CDropTarget , CMallocSpy , CDataObject , CMallocSpy , CClassFactory , CConsumer , CAsyncQuerySink , CComponentData , CSamplePipe , CConsumer , CMallocSpy , MyDataSource , CISeqStream , CClassFactory , CGenericEnum , CProvider , CComponent , CComponentData , CClassFactory , CMallocSpy , CEnumFormatEtc , CStream , CMallocSpy , CDropObject , CSnapinAbout , CDataObject , CSnapinAbout , CDataObject , CClassFactory , CSimpSvrObj , CProvider_IWbemEventProvider , CClassFactory , CComponent , CSnapinAbout , CRow , CMallocSpy , CAggregate , CComponent , CConsumer , CRowset , CComponent , CExtendContextMenuEx , CClassFactory , CComponentData , CDataObject , CProvider , CDataSource , CSnapinAbout , CDataObject , CComponentData , CClassFactory , CDataObject , CComponentData , CClassFactory , CSnapinAbout , CClassFactory , CMyEventProvider , CClassFactory , CHiPerfProvider , CMallocSpy , CComponent , CDataSource , CClassFactory , CSnapinAbout , CCommand , CClassFactory , CDataObject , CSnapinAbout , CInstPro , CDataObject , CClassFactory , CDataObject , CComponentData , CDataObject , CStream , CMethodPro , CProvFactory , CComponent , CClassFactory
  • Stemmer : SLangRegistry
  • STO_ADDPARTY : CRTCOutgoingDlg
  • STO_ANSWER : CRTCIncomingDlg
  • STO_CREATE : CRTCOutgoingDlg
  • STO_REMOVEPARTY : CRTCOutgoingDlg
  • STO_TERMINATE : CRTCIncomingDlg , CRTCOutgoingDlg
  • Stop() : IBrowserHost , CBrowserHost , CAgentCtlCharacterEx , IBrowserHost , RqsEngine , CTIMER
  • stop() : RSProxy , Hello3J
  • Stop() : CBrowserHost
  • stop() : HelloJ
  • Stop() : CPlgFilter
  • stop() : Hello2J
  • Stop() : IBrowserHost , CBrowserHost
  • StopAll() : CAgentCtlCharacterEx
  • StopAnimation() : CMMCControl , IMMCControl , CWrapVBComponent
  • StopAsyncFindIfStarted() : CGenericUCPDlg
  • StopBeforePlay : CapJ
  • StopButton : CapJ
  • StopButton_click() : CapJ
  • stOpenAsync : msado15::StreamOpenOptionsEnum
  • stOpenFromRecord : msado15::StreamOpenOptionsEnum
  • stOpenFromURL : msado15::StreamOpenOptionsEnum
  • STOPPED : CRocket
  • Stopped : CMyEventProvider
  • STOPPED : CPlane , CToolBarExtension
  • StopRefreshing() : CHiPerfProvider
  • StopRouter()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • StopStream() : CSampleMSPStream
  • StopThread() : CBicycleFolder , CBackgroundFolder , CAdvClientDlg , CBackgroundFolder
  • stopTransfer() : MyOSPObject
  • Storage : mib_entry
  • StoreBuffer() : WiaWrap::CDataCallback
  • StoreInProxy() : CRow
  • STR : FileRepClient , FileRepServer , FileRepClient , FileRepServer
  • strDescription : _ITEM_DESC , _MOF_INFO
  • StreamViewerProc() : CMainWindow
  • strGuid : CacheProxySamplePlugin::CacheProxyPlugin
  • String() : CFileViewer
  • StringToLine() : Util::HelperFunctions
  • StripEndQuotes() : VJQuery
  • strName : CSharp_Draw::Form1
  • StrName() : CObjData
  • Stroke() : InkCollectorEvents , CMyInkEvents
  • StrokePointRadius : InkErase::InkErase
  • strParam : CAsyncQuerySink
  • strPathToConfigDoc : CachePluginAdmin
  • strPluginName : CacheProxySamplePlugin::CacheProxyPlugin
  • strSel : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl
  • strSubKey1 : CacheProxySamplePlugin::CacheProxyPlugin
  • strSubKey2 : CacheProxySamplePlugin::CacheProxyPlugin
  • strType : _MOF_INFO
  • stWriteChar : msado15::StreamWriteEnum
  • stWriteLine : msado15::StreamWriteEnum
  • StylusButtonDown()
: RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkCollection::InkCollection
  • StylusButtonUp()
: RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • StylusDown()
: InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
  • StylusInRange()
: InkCollection::InkCollection
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • StylusOutOfRange()
: RealTimeStylusPlugins::PacketFilterPlugin
, InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • StylusUp()
: RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, InkCollection::InkCollection
  • SubClassWindow() : CWndLite
  • Submitted : _Job
  • SUBSCRIBE_FLAG : helper::sampleConstants
  • subscribePersisButton : NewsSubscriber
  • subscribePersisButton_click() : NewsSubscriber
  • SUBSCRIBER_NAME : helper::sampleConstants
  • subscribeTransButton : NewsSubscriber
  • subscribeTransButton_click() : NewsSubscriber
  • SubscriptionFlag : CacheProxySamplePlugin::ContentInfo
  • SubstituteParameters() : CUtil
  • SuccessMessage : Sample::Messages
  • Sum()
: fullsvr::IFullServ
, fullsvr::FullServ
, CFullServ
  • sumvalid : diritem
  • Supermetric : _SAMPLE_HELPER_DATA_
  • Support : SupportConcurList , SupportOptList
  • SupportIRowsetChange() : CRowset
  • Supports()
: msado15::Recordset15
, msado15::Recordset21
, msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset
  • Suspend() : AgentNotifySink
  • SwapShort() : CFontRange
  • SwapULong() : CFontRange
  • SwitchToNextHtmlElement() : CHtmlElement
  • sword : tagDataStruct
  • symbolLabel : NewsFlash
  • symbolTF : NewsFlash
  • SyncDirs() : CSyncMgrHandler
  • Synchronize() : CSyncMgrHandler
  • SynchronizeCall() : CSyncMgrHandler
  • SynchronizeCompleted() : CCallbackWrapper
  • SynchronizeCompletedMsg : _tagMETHODARGS
  • SynchronizeMsg : _tagMETHODARGS
  • syncmgrItem : _tagSAMPLEITEMSETTINGS
  • SyncSendStatusAndHeaders() : ISAPI_REQUEST
  • SyncWriteClientArgs() : ISAPI_REQUEST
  • SyncWriteClientString() : ISAPI_REQUEST
  • SyncWriteCompleteResponse() : ISAPI_REQUEST
  • SystemGesture()
: InkCollection::InkCollection
, RealTimeStylusPlugins::PacketFilterPlugin
, InkCollectorEvents
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
  • systimeVal : VTUNION
  • sz : tagQtStruct
  • szAccount : AUTH_DATA
  • szApiFailed : GLOBAL_STRUCT
  • szAppName : GLOBAL_STRUCT
  • szBuff : tagSERVERINFO
  • szBuffer : STR_BINDING
  • szClientName : TS_VERSION_INFO
  • szColName : tagQtStruct
  • szColNames : tagQtStruct
  • szComm : _DRVLINE
  • szCommand : _ASYNC_REQUEST
  • szCommands : _DRVLINECONFIG
  • szComputerName : TS_VERSION_INFO
  • szCounterPath : _CounterInfoBlock
  • szData : DOREGSTRUCT , WRITER_PARAMS
  • szDataItem : tagQtStruct
  • szDescFieldName : tagDescInfo , tagDIAGINFO
  • szDescName : tagDescType
  • szDescription : NODESTRUCT , EXTENSION_NODE , EXTENDER_NODE
  • szDomain : _tagLogon
  • szEntryName : _CUSTOM_ENTRY_DATA_SAMPLE_
  • szExpr : CStdDbOutput
  • szFieldName : FieldInfo
  • szFile : CStdDbOutput
  • szFileName : _SFFS , EXEDLLICONINFO
  • szFormatName : ARRAYQ
  • szGDIName : _metalookup
  • szHostname : _OPTIONS
  • szIf : tagADSIIF
  • szInitialDir : PROFILE_STRUCT
  • szInstanceName : _WAVE_DATA
  • szInterface : _AcceptContext
  • szItemName : _tagHANDLERITEMSETTINGS
  • szKeyName : REGENTRY
  • szKeywords : tagSERVERINFO
  • szLength : FieldInfo
  • szLineName : tagLINEINFO
  • szLocalInterface : _OPTIONS
  • szLogFile : tagSERVERINFO
  • szMachine : params
  • szMemo : REQUEST_CONTEXT
  • szMsg : CStdDbOutput , NONDIALTOKENS
  • szName : CPlane , tagENTRY , tag_smf , CPerson , ADDRESS_DATA , CRocket
  • szNodeName : CHILD_PROPERTIES , NODE_PROPERTIES , tag_BASENODE_PROPERTIES
  • szObjectPath : _tag_NODE_ATTRIB_
  • szOriginalDLLFileName : ICONRESOURCE
  • szOriginalICOFileName : ICONRESOURCE
  • szParam : tagQtStruct
  • szParamQuery : tagQtStruct
  • szParams : FieldInfo
  • szPassword : AUTH_DATA
  • szPathName : ARRAYQ
  • szPhoneBookPath : _CUSTOM_ENTRY_DATA_SAMPLE_
  • szPort : _AcceptContext , _DRVLINECONFIG , _ClientContext
  • szPrefix : FieldInfo
  • szRemoteInterface : _OPTIONS
  • szRep : CONST_WORD_REP
  • szServer : _ClientContext , LOGON_DATA
  • szShortAppName : GLOBAL_STRUCT
  • szSource : tagSERVERINFO
  • szSubKey : DOREGSTRUCT
  • szSuffix : FieldInfo
  • szTableName : tagQtStruct , THREAD_STRUCT
  • szTemplate : _QOS_OPTIONS
  • szTest : perf
  • szTest1 : _MYDATA
  • szTest2 : _MYDATA
  • szText : tagSTATUSBARLOOKUP , Note
  • szTitle : ADDRESS_DATA
  • szToken : NONDIALTOKENS
  • szTransport : LOGON_DATA
  • szType : FieldInfo
  • szURI : ADDRESS_DATA
  • szUsage : tagEnhKeyUsage
  • szUserDomain : _RASHOST_DATA
  • szUsername : _tagLogon
  • szUserName : _RASHOST_DATA , TS_VERSION_INFO
  • szUserURI : LOGON_DATA , AUTH_DATA
  • szValidLogin0 : tagSERVERINFO
  • szValidPassword0 : tagSERVERINFO
  • szValidServer0 : tagSERVERINFO
  • szValue : tagCAPSLOOKUP , DOREGSTRUCT , REGENTRY , tagENUMPRTLOOKUP
  • szValueName : REGENTRY
  • szValues : tagQtStruct
  • szVerb : VERBMAPPING
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- t -

  • tabchars : Table
  • TabletAdded()
: InkCollectorEvents
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • TabletRemoved()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkCollectorEvents
  • Tag : _SIGNATURE
  • tag : compitem
  • TagNameToToken() : CHtmlScanner
  • tagSESSION_OPERATION : CRTCOutgoingDlg , CRTCIncomingDlg
  • Tail : NIDeque_c< T >
  • TapeName : STL_LABEL
  • TargetDown() : CComSpySqlAudit , CLBSub , IComSpyAudit
  • TargetUp() : CComSpySqlAudit , CLBSub , IComSpyAudit
  • TaskNotify() : CComponent , CDelegationBase , CBicycleFolder , CSkateboardFolder , CIceSkateFolder
  • tcAcp : _LOCINFO
  • tcLcid : _LOCINFO
  • tcLLang : _LOCINFO
  • tcNCountry : _LOCINFO
  • tcNLang : _LOCINFO
  • tcOem : _LOCINFO
  • tcp_checksum : tpc_hdr
  • tcp_urgentptr : tpc_hdr
  • tDialDlg : _CUSTOM_DIAL_DLG_SAMPLE_
  • tDialParams : _CUSTOM_DIAL_DLG_SAMPLE_
  • TempBuffer() : TempBuffer
  • template_cmd : _OPTIONS
  • tEntryDlg : _CUSTOM_ENTRY_DATA_SAMPLE_
  • Terminate() : CDownloadUI
  • Terminating : _WORK_QUEUE
  • Test1 : CAsyncTest , ITest , CServer , CTestCOMPerformance
  • Test2 : CAsyncTest , ITest , CServer
  • Test23() : CTestCOMPerformance
  • TestCancel()
: fullsvr::AsyncFullServ
, fullsvr::ICancelMethodCalls
  • TestTokenConfirm() : CAppletSession
  • text : fileline , statel
  • Text() : CCanvas
  • TextAlign() : CCanvas
  • textBoxName : CSharp_Draw::InputBox
  • textBoxSign : Sample::UI::MainWindow
  • textBoxVerify : Sample::UI::MainWindow
  • textChars : CSharp_Draw::Form1
  • textChars_KeyPress() : CSharp_Draw::Form1
  • TextData : InkBlog::InkArea
  • textFriendComputer : CSharp_Draw::Form1
  • textFriendComputer_TextChanged() : CSharp_Draw::Form1
  • textFriendName : CSharp_Draw::Form1
  • textFriendName_TextChanged() : CSharp_Draw::Form1
  • ThickInkWidth : InkClipboard::InkClipboard , InkCollection::InkCollection
  • ThinInkWidth : InkClipboard::InkClipboard , InkCollection::InkCollection
  • Think() : CAgentCtlCharacterEx
  • thisGUID : CStaticNode , CDeviceNode , CFolderNode , CVirtualFile
  • thisGuid : CDelegationBase , CStaticNode , CLandBasedVehicle , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CBackground , CBackgroundFolder , CSpaceStation , CSpaceFolder , CPlane , CSkyVehicle
  • thread : Sock_Info
  • ThreadDebugInfo : DEB_THREAD_NODE_INFO_STRUCT
  • ThreadEntry() : CSampleDataSource
  • ThreadExecutionFunction() : CProvider_IWbemEventProvider
  • ThreadFunction() : CWorkerThread
  • threadingModel : CFactoryData
  • threadParam() : CAsyncTest::threadParam
  • ThreadProc() : CBackgroundFolder , CBicycleFolder , CAdvClientDlg , CBackgroundFolder , CAsyncTest , WiaWrap::CProgressDlg
  • ThreadStart() : CMain
  • thumb : _STANDARDSECINMEM
  • THUMBPRINT_LENGTH : storesh::Storesh
  • TID : _INITDATA
  • time : _TIME , _SFFS , tagDataStruct
  • Timeout : _CommandVtbl
  • timestamp : tagDataStruct
  • TimeStamp : STL_LABEL
  • timeVariable : _SFFS
  • titleLabel : About
  • TitleLabel : Sample::UI::AboutBox
  • tkBase : tag_preroll , tag_seq
  • tkDelta : tagEVENT
  • tkEnd : tag_preroll , tag_seq
  • tkLength : tag_seq , tag_track , tag_smf , tag_smffileinfo
  • tkPosition : tag_track , tag_smf
  • tkTempo : tag_tempomapentry
  • tm : FONTENUM , tagArFonts
  • To : _SENDTOARGS
  • ToColumn() : storesh::Storesh
  • ToggleEditControl() : CConnectDlg
  • ToggleRemoteServerState() : CAppInstallDlg
  • ToggleStatus() : CDeviceNode , CStaticNode , CDeviceNode , CStaticNode , CDeviceNode , CStaticNode
  • token : _CMD
  • Token : CGdiplusInit
  • TokenConfirm() : CAppletSession
  • TokenIndication() : CAppletSession
  • Tokenize() : CSampleWordBreaker
  • TOOLBAREXTENSION : CClassFactory
  • ToolBarHeight : GLOBAL_STRUCT
  • top : Margin , RECTI
  • topinner : Margin
  • toprow : Table
  • ToString() : RealTimeStylusPluginApp::PluginListItem
  • TotalPages : _Job
  • TPhysConnectRequest() : CNullModem
  • TPhysDisconnect() : CNullModem
  • TPhysInitialize() : CNullModem
  • TPhysTerminate() : CNullModem
  • TPropBase() : TPropBase< TYPE >
  • TPropSetBase() : TPropSetBase< TYPE, OBJTYPE >
  • Trace() : CGrid , RqsEngine
  • TraceAddRef() : CIntTrace
  • TraceCurrentServerConnections() : RqsEngine
  • TraceMethod() : CIntTrace
  • TraceNotification() : CIntTrace
  • TraceQI() : CIntTrace
  • TraceRelease() : CIntTrace
  • TraceSelf() : RqsConfig , RqsEngine
  • trackline1 : Table
  • trackline2 : Table
  • trackmode : Table
  • tracknr : Table
  • TransactionLevel : _ConnectionVtbl
  • TRANSIENT_NAME : helper::sampleConstants
  • transientHeading : NewsSubscriber
  • TranslateAccelerator() : CAnnotator , CFrame , CShellView , COleInPlaceActiveObject , CPropertyPage
  • TranslateAcceleratorIO() : CExplorerBar , CCommBand , CToolBand , CDeskBand
  • TranslatePathNameToFormatName() : CMainFrame
  • TransmitFileArgs : _WSAOVERLAPPEDPLUS
  • TransmitPacketsArgs : _WSAOVERLAPPEDPLUS
  • TriangleWaveDef : _SIGGEN_DATA_DEFINITION
  • TRUE : Hello2J , HelloJ , Hello3J , Notify
  • TryToSaveChanges() : CVCExploreDlg
  • txtPluginDescription : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • txtResults : InkRecognition::InkRecognition
  • type : igmp_hdr_query_v3 , igmp_group_record_v3
  • Type : _CommandVtbl , tagArFonts , mib_entry
  • type : igmp_hdr_report_v3 , statel
  • TypeIndex : _MOF_INFO
  • typeOfAccept : _AcceptContext
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- u -

  • u : tagLABELEXTRACT
  • U1 : _DOSDTTM
  • uBuffersInMMSYSTEM : tag_seq
  • uChar : tagDataStruct
  • uchCaps : tagUser
  • uCompLen : _IMEUIDATA
  • uDelayID : _DLGITEMS
  • uDeviceID : tag_seq
  • UDNmapping : UPNPDimmerDevice , CDimmer
  • udp_checksum : udp_hdr
  • udp_length : udp_hdr
  • uDPI : tagTOOLDISPLAYDATA
  • udword : tagDataStruct
  • UIActivate() : CShellView , COleDocumentView
  • UIActivateIO() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • uID : CREATEGIZMOA , CREATEGIZMOW , tagSTATMESSAGEMAP , tagPOPUPMENUMAP
  • uId : tagUser
  • UIDeactivate() : COleInPlaceObject
  • uidGiveTo : tagAppletTokenRequest
  • uIDImages : tagTOOLDISPLAYDATA
  • uidInitiator : IAppletSessionNotifyVtbl
  • uidLeave : IAppletSessionNotifyVtbl
  • uidManager : IAppletSessionNotifyVtbl
  • uidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • uiLength : _RqsConfigString
  • uImageSet : MYTOOLINFO
  • uiPort : _RU_SOCKET_CREATE_DATA
  • uiSize : _RU_SOCKET
  • uiTag : tagHeader
  • ulActivityCount : _CONFIGURATION_ENTRY
  • ulColumnSize : PROVTYPEINFO , TYPEINFO , COLDESC
  • ulCount : _IPSAMPLE_IF_BINDING , _DYNAMIC_READWRITE_LOCK
  • ulCountAllocated : _DYNAMIC_LOCKS_STORE
  • ulCountFree : _DYNAMIC_LOCKS_STORE
  • ulCreateParams : COLDESC
  • ulFiles : _DIBDATA
  • ulFrames : _DIBDATA
  • uli : _foo
  • ulIndex : TREEINFO
  • uLine : CStdDbOutput
  • ulMetric : _IPSAMPLE_IF_CONFIG , _INTERFACE_ENTRY
  • ulNumBindings : _INTERFACE_ENTRY
  • ulNumBuckets : _HASH_TABLE
  • ulNumEntries : _HASH_TABLE
  • ulNumInterfaces : _IPSAMPLE_GLOBAL_STATS
  • ulNumPackets : _IPSAMPLE_IF_STATS
  • ulOffset : FILEDEX
  • ULONG() : _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , ADOConnectionConstructionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , IAppletSessionNotifyVtbl , IAppletSessionVtbl , IAppletNotifyVtbl , IAppletVtbl , _ADOCollectionVtbl
  • ulRefCount : tagRowBuff
  • uMCIDeviceID : tag_seq
  • uMCITimeDiv : tag_seq
  • uMCITimeFormat : tag_seq
  • uMessage : _MSD
  • uMsg : _SOCK_INFO , _MSD
  • Unaccess() : CSAFEARRAY
  • Unadvise() : UPNPDimmerService , CDimmerService
  • UnAdvise() : CApplet , CAppletSession
  • Unadvise() : CConnectionPoint , COleObject , CListener , CRTCEvents
  • UnadviseInkCollector() : InkCollectorEvents
  • UnadviseListener() : CContainerBase
  • UnadviseSink() : CTSFEditWnd , CLangBarItemButton
  • Unbind() : CBSTR , CVARIANT , CSAFEARRAY , CBSTR , CVARIANT , CSAFEARRAY
  • Undo16() : CDialogStream
  • UndoChanges() : CMDIChild
  • Unescape() : ISAPI_STRING
  • UnGetChar() : CMemoryMappedInputStream , CSerialStream
  • UnhandledMessage() : CWndLite , CMDIChildLite , CMDIFrameLite
  • UnimpersonateClient() : ISAPI_REQUEST
  • Uninitialize() : CAsynchBase , CImpIDBInitialize , Conf , CPluggableTransport , CCompartmentMonitor
  • Uninstall() : CSysLCESub , ICOMSysLCE
  • UNINSTALL_FLAG : helper::sampleConstants
  • uninstallCascadeEvent() : NewsSubscriber
  • Unload() : CAgentCtlCharacters
  • UnloadOleObject() : CSimpleSite
  • Unlock() : CExeModule , CDBAuthPlugin
  • UnLock() : CLockHandler
  • Unlock() : CExeModule
  • UnlockBuffer() : CString
  • UnlockRegion() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream
  • UnmanagedArrayFree() : Sample::MySignedXml
  • Unmap() : PMmStream , CMmStream
  • UnmarshalInterface() : CClassFactoryWrapper , CDynamic , CEntity , CResultset
  • uNotify : _DLGITEMS
  • Unregister() : CMallocSpy
  • UnregisterAll() : CFactory
  • UnRegisterFunction() : CacheProxySamplePlugin::CacheProxyPlugin
  • UnregisterProfiles() : CCaseTextService , CMarkTextService
  • UnregisterServer() : CCmdLineConsumerApp , CPermEventsApp , CCaseTextService , CMarkTextService
  • UnregisterSink() : CPlgTermSample
  • UnselectTerminal() : CSampleMSPStream
  • UNSUBSCRIBE_FLAG : helper::sampleConstants
  • Update() : vcacct::IUpdateReceipt , CProgress , CDlgDest , vcacct::CUpdateReceipt , msado15::_Recordset , msado15::Recordset , CRow , COleObject , CSite , CUpdateReceipt , msado15::Recordset15 , msado15::Recordset20 , msado15::Recordset21 , msado15::Fields , CFont , CUpdateReceipt
  • UpdateApplicationMode() : InkErase::InkErase
  • UpdateBatch()
: msado15::Recordset21
, msado15::Recordset20
, msado15::Recordset15
, msado15::_Recordset
, msado15::Recordset
  • UpdateBuddyList() : CRTCWin
  • UpdateChanges() : CMDIChild
  • updateCollections() : NewsFlash
  • UpdateControls() : CMDITrace , CMainWindow , CMDIObjects , CMDIChild
  • UpdateCounters() : CMain
  • UpdateData() : CShellView
  • UpdateDialogs() : CChildView
  • UpdateEditMode() : PaperForm::PaperForm
  • UpdateFilename() : CMultiRecoApp
  • UpdateFont() : CRecoOutputWnd
  • UpdateInputScopeMenu() : CAdvRecoApp
  • UpdateInstance() : CSampleDataSource
  • UpdateLayout() : CAdvRecoApp , CMultiRecoApp
  • UpdateMenu() : CShellView , COleDocumentView
  • UpdateMenuRadioItems() : CAdvRecoApp
  • UpdateObjectRects() : CSite
  • UpdateOptions() : CFullConnectOptions
  • UpdatePathNameArrays() : CMainFrame
  • UpdateProperties() : CFullConnectProperties
  • UpdateProvider() : CFullConnectProvider
  • UpdateRecentFiles() : CCapMFCDlg , CapJ , MainDlg
  • UpdateRegistryCLSID() : CMyUIExtModule , CSCPContextMenuModule , CMyWizExtModule , CSCPWizModule , CMyUIExtModule
  • UpdateRow() : CFileIO
  • UpdateRowImmediate() : CDBFile
  • UpdateScrollBars() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • UpdateSecurity() : CFullConnectSecurity
  • UpdateStatus() : CBankDlg
  • UpdateStatusBar() : CMultiRecoApp , CAdvRecoApp
  • UpdateString() : CRecoOutputWnd
  • updateSubscription() : NewsSubscriber
  • UpdateTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • UpdateToolbar() : CShellView
  • UpdateUI() : CMain
  • UpdateWindow() : CWndLite
  • UpdateWndTitle() : CMDIChild
  • UpdateZoomAndScroll() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • Upload() : CPack
  • UPNPDimmerDevice() : UPNPDimmerDevice
  • UPNPDimmerService() : UPNPDimmerService
  • urlLabel : NewsFlash
  • urlTF : NewsFlash
  • Usage() : VJQuery
  • Use : _CREDENTIAL
  • UseBalloon : CapJ
  • UseBalloon_click() : CapJ
  • UseComPlus() : CMoveMoney
  • User : helper::DatabaseSettings , util::DatabaseSettings
  • UseRecognizer() : CAdvRecoApp
  • UserHid : CapJ
  • UserHidViaCharacterMenu : CapJ
  • UserID : _ConnectionVtbl
  • UserName : _MSV1_0_INTERACTIVE_LOGON
  • UseSfx : CapJ
  • UseSfx_click() : CapJ
  • uSide : tagOPTIONS
  • uState : tag_seq , CREATEGIZMOA , CREATEGIZMOW
  • uState1 : _DLGITEMS
  • uState2 : _DLGITEMS
  • uTip1 : _DLGITEMS
  • uTip2 : _DLGITEMS
  • uType : tagUser
  • uValue : GBSETINT
  • uVersion : tagUser
  • uwDescField : tagDIAGINFO , tagDescInfo
  • uwDescType : tagDescType
  • uword : tagDataStruct
  • uwTypeMask : tagDescType
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- v -

  • v : CVARIANT
  • val : _ParameterVtbl
  • Val : FieldVtbl , _ParameterVtbl
  • val : PropertyVtbl
  • valid : Props
  • ValidateAccessor() : CDataAccess
  • ValidateBindArgs() : CImpIBindResource
  • ValidateBookmark() : IRowsetScrollImpl< T, RowsetInterface >
  • ValidateRow() : CRowset
  • VALIDITY_LENGTH : storesh::Storesh
  • value : GlobalVars , FLAGMAPPING , gss_buffer_desc_struct
  • Value : _CommandVtbl , Counter
  • value : _INTS , _RecordsetVtbl
  • Values : _RecordsetVtbl
  • ValueToString() : CConsumer
  • varContext : CacheProxySamplePlugin::ContentInfo
  • varDefaultValue : ATTRIBUTES
  • VarToBstr() : CADVCGENDlg
  • varValue : ATTRIBUTES
  • vBookmark : _RecordsetVtbl
  • vConn : _CommandVtbl , _RecordsetVtbl
  • vCursorLib : tagSERVERINFO
  • vCustomParam : IInkRecognitionEventsImpl< T >
  • Vendor : STL_LABEL
  • VerifyDatabaseCodepage() : CImportRes , CGenerateRC
  • VerifyRequest() : CCertPolicySample
  • VerifySidMembership() : CDBAuthPlugin
  • VerifyUser() : IDBAuthAdmin , CDBAuthAdmin
  • VerifyUserMembership() : CDBAuthPlugin
  • VerifyXML() : Sample::SignVerify
  • Version : _MOF_INFO
  • version : CFactoryData , GlobalVars
  • version_type : igmp_hdr
  • versionLabel : About
  • view : THREADARGS , EDITARGS
  • ViewportResize() : CFileViewer
  • ViewportScrollSet() : CFileViewer
  • ViewportWndProc : CFileViewer
  • ViewWndProc() : COleDocumentView
  • VisibleState() : AgentNotifySink , Notify
  • VOID() : _WORK_THREAD_DATA
  • VScroll() : CController
  • vScrollBar : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • vScrollBar_Scroll() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • vScrollBar_ValueChanged() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • vseparator : TableHdr
  • Vsprintf() : ISAPI_STRING , ISAPI_STRINGW
  • vt : tagFieldMetaData
  • vtByteCount : _STDZ
  • vtNull : CProxy
  • vtType : _INTS , _STDZ , _PROPVALUE , _THUMB , _TIME , _tagPROPSTRUCT
  • vtValue : _PROPVALUE
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- w -

  • w0 : _foo
  • w1 : _foo
  • w2 : _foo
  • w3 : _foo
  • Wait()
: fullsvr::AsyncFullServ
, fullsvr::ISynchronize
  • wait : CAsyncTest::threadParam
  • Wait() : RqsEngine , CAgentCtlCharacterEx , CAsyncXXX< T, ISyncFace, IAsyncFace > , CAsynchNotify , CCallBack
  • WaitCursor() : CWaitCursor
  • WaitForConnection() : CNullModem
  • waitForInput() : storesh::Storesh
  • waitForResponse() : RSProxy
  • WAITING_FOR_DATA : ASYNC_REQUESTER
  • WasLanguagePreviouslyFound() : CImportRes
  • WasteTime() : CSimpleObject
  • wAttr : _SFFS
  • wBitCount : MEMICONDIRENTRY , ICONDIRENTRY
  • wBmkHash : tagRowBuff
  • wchName : SInfo
  • wchVersion : SInfo
  • wCmd : _CMD
  • wCommand : _CMD
  • wcszInstanceName : _APPMEM_INSTANCE
  • wDivision : tag_filehdr
  • wFlags : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , CShellExt
  • wFormat : tag_filehdr
  • wFunc : CShellExt
  • WhiteRect : CHILDWINDOWDATA
  • WhiteTextRect : CHILDWINDOWDATA
  • WhoAmI() : CVCSecuritySampleClass
  • WidgetCount : _SAMPLE_HELPER_DATA_
  • width : statel , Props
  • Width : ICONIMAGE
  • WillChangeField()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • WillChangeRecord()
: msado15::RecordsetEventsVt
, msado15::RecordsetEvents
  • WillChangeRecordset()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • WillConnect()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • WillExecute()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • WillMove()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • Window() : IComSpy , CFrame
  • window_size : tpc_hdr
  • WindowProc() : CChildView , CDlgDest , CDlgSrc , CBitmapWnd , CMainWindow , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCAVSession , CRTCIMSession , CRTCWin , CBackgroundFolder , CBicycleFolder
  • WinStationName : CSessionDlg
  • winwidth : Table
  • WM_DISPLAY_PROPERTY : CMarkTextService
  • wMenuItem : tagMAPMODELOOKUP , tagGRAPHICLOOKUP , tagPENWIDTHLOOKUP , tagPENSTYLELOOKUP , tagBRUSHSTYLELOOKUP , tagSTATUSBARLOOKUP
  • WndProc() : CWndLite , MainDlg , CCommBand , CDeskBand , CExplorerBar , CToolBand , CShellView
  • WordBreaker : SLangRegistry
  • Work() : CFullServ
  • WorkerRoutine : _WORK_QUEUE
  • WorkerThreads : _WORK_QUEUE
  • WorkItem : _SEARCH_REQUEST
  • WorkQueue : _WORK_QUEUE_ITEM
  • wParam : GBMSG
  • wParamSheetClose : _PROPSHEETCFG
  • wPlanes : MEMICONDIRENTRY , ICONDIRENTRY
  • wpMain : _PREF
  • wpProc : _SynchInfo
  • WPUCloseEvent() : DTHandler
  • WPUCloseSocketHandle() : DTHandler
  • WPUCreateEvent() : DTHandler
  • WPUCreateSocketHandle() : DTHandler
  • WPUFDIsSet() : DTHandler
  • WPUGetProviderPath() : DTHandler
  • WPUModifyIFSHandle() : DTHandler
  • WPUPostMessage() : DTHandler
  • WPUQueryBlockingCallback() : DTHandler
  • WPUQuerySocketHandleContext() : DTHandler
  • WPUQueueApc() : DTHandler
  • WPUResetEvent() : DTHandler
  • WPUSetEvent() : DTHandler
  • WrapDSOandSession()
: msado15::ADOConnectionConstruction
, msado15::ADOConnectionConstruction15
  • Write() : CComSpy , CSimpleObject , CLogFile , msado15::_Stream , msado15::Stream , CConsole , CRichEditLite , CFileLite , CSmartPtrTrace< T > , CStorageBuffer , CFileStream , CImpIStream , CISeqStream , CSampleDataContainer , CThumbNailPhotoHolder , CAVIFileWriter
  • WriteAt() : CStorageBuffer
  • WriteBinaries() : CGenerateRC
  • WriteBuffer() : CStorageBuffer
  • WriteBytes() : CFileLite , CStream
  • WriteContextInformation() : CContextPlugin
  • WriteControlToRC() : CGenerateRC
  • WriteData() : CSCPWiz , CWizExtUser
  • WriteDataHelper() : CSCPWiz , CExtPageUser , CWizExtUser
  • WriteDB() : qcnotify::Notify
  • WriteDialogToRC() : CGenerateRC
  • WriteEmployeeID() : CProppageUserUI
  • WriteFormat() : CFileLite
  • WriteItemSettings() : CSettings
  • WriteLine() : CConsole , CSmartPtrTrace< T >
  • WriteOrderDB() : COrder , qcorder::Order , COrder
  • WritePlaylist() : CSDKSamplePlaylistParser
  • WriteQuoted() : CFileLite
  • WriteRadioButtons() : CGenerateRC
  • WriteShipDB() : qcship::Ship , COShip , COShip2
  • WriteStdWinCtrl() : CGenerateRC
  • WriteString() : CStream
  • WriteText()
: msado15::_Stream
, msado15::Stream
  • WriteToStream() : CFastVariant
  • WriteWCharAsUTF8() : CPack
  • WriteWin32Ctrl() : CGenerateRC
  • WriteXMLString() : CPack
  • WSAAccept() : DTHandler
  • WSAAddressToStringA() : DTHandler
  • WSAAddressToStringW() : DTHandler
  • WSAAsyncGetHostByAddr() : DTHandler
  • WSAAsyncGetHostByName() : DTHandler
  • WSAAsyncGetProtoByName() : DTHandler
  • WSAAsyncGetProtoByNumber() : DTHandler
  • WSAAsyncGetServByName() : DTHandler
  • WSAAsyncGetServByPort() : DTHandler
  • WSAAsyncSelect() : DTHandler
  • wsabuf : _PER_IO_CONTEXT
  • wsaBuffer : _PACKET
  • WSACancelAsyncRequest() : DTHandler
  • WSACancelBlockingCall() : DTHandler
  • WSACleanup() : DTHandler , SocketMonitor
  • WSACloseEvent() : DTHandler
  • WSAConnect() : DTHandler
  • WSACreateEvent() : DTHandler
  • WSADuplicateSocketA() : DTHandler
  • WSADuplicateSocketW() : DTHandler
  • WSAEnumNameSpaceProvidersA() : DTHandler
  • WSAEnumNameSpaceProvidersW() : DTHandler
  • WSAEnumNetworkEvents() : DTHandler
  • WSAEnumProtocolsA() : DTHandler
  • WSAEnumProtocolsW() : DTHandler
  • WSAEventSelect() : DTHandler
  • WSAGetLastError() : DTHandler
  • WSAGetOverlappedResult() : DTHandler
  • WSAGetQOSByName() : DTHandler
  • WSAGetServiceClassInfoA() : DTHandler
  • WSAGetServiceClassInfoW() : DTHandler
  • WSAGetServiceClassNameByClassIdA() : DTHandler
  • WSAGetServiceClassNameByClassIdW() : DTHandler
  • WSAHtonl() : DTHandler
  • WSAHtons() : DTHandler
  • WSAInstallServiceClassA() : DTHandler
  • WSAInstallServiceClassW() : DTHandler
  • WSAIoctl() : DTHandler
  • WSAIsBlocking() : DTHandler
  • WSAJoinLeaf() : DTHandler
  • WSALookupServiceBeginA() : DTHandler
  • WSALookupServiceBeginW() : DTHandler
  • WSALookupServiceEnd() : DTHandler
  • WSALookupServiceNextA() : DTHandler
  • WSALookupServiceNextW() : DTHandler
  • WSANtohl() : DTHandler
  • WSANtohs() : DTHandler
  • WSARecv() : DTHandler
  • WSARecvDisconnect() : DTHandler
  • WSARecvFrom() : DTHandler
  • WSARecvMsgArgs : _WSAOVERLAPPEDPLUS
  • WSARemoveServiceClass() : DTHandler
  • WSAResetEvent() : DTHandler
  • WSASend() : DTHandler
  • WSASendDisconnect() : DTHandler
  • WSASendTo() : DTHandler
  • WSASetBlockingHook() : DTHandler
  • WSASetEvent() : DTHandler
  • WSASetLastError() : DTHandler
  • WSASetServiceA() : DTHandler
  • WSASetServiceW() : DTHandler
  • WSASocketA() : DTHandler
  • WSASocketW() : DTHandler
  • WSAStartup() : SocketMonitor , DTHandler
  • WSAStringToAddressA() : DTHandler
  • WSAStringToAddressW() : DTHandler
  • WSAUnhookBlockingHook() : DTHandler
  • WSAWaitForMultipleEvents() : DTHandler
  • WSCDeinstallProvider() : DTHandler
  • WSCEnableNSProvider() : DTHandler
  • WSCEnumProtocols() : DTHandler
  • WSCGetProviderPath() : DTHandler
  • WSCInstallNameSpace() : DTHandler
  • WSCInstallProvider() : DTHandler
  • WSCUnInstallNameSpace() : DTHandler
  • WSPAccept() : DTHandler
  • WSPAddressToString() : DTHandler
  • WSPAsyncSelect() : DTHandler
  • WSPBind() : DTHandler
  • WSPCancelBlockingCall() : DTHandler
  • WSPCleanup() : DTHandler
  • WSPCloseSocket() : DTHandler
  • WSPConnect() : DTHandler
  • WSPDuplicateSocket() : DTHandler
  • WSPEnumNetworkEvents() : DTHandler
  • WSPEventSelect() : DTHandler
  • WSPGetOverlappedResult() : DTHandler
  • WSPGetPeerName() : DTHandler
  • WSPGetQOSByName() : DTHandler
  • WSPGetSockName() : DTHandler
  • WSPGetSockOpt() : DTHandler
  • WSPIoctl() : DTHandler
  • WSPJoinLeaf() : DTHandler
  • WSPListen() : DTHandler
  • WSPRecv() : DTHandler
  • WSPRecvDisconnect() : DTHandler
  • WSPRecvFrom() : DTHandler
  • WSPSelect() : DTHandler
  • WSPSend() : DTHandler
  • WSPSendDisconnect() : DTHandler
  • WSPSendTo() : DTHandler
  • WSPSetSockOpt() : DTHandler
  • WSPShutdown() : DTHandler
  • WSPSocket() : DTHandler
  • WSPStartup() : DTHandler
  • WSPStringToAddress() : DTHandler
  • wSQLType : FieldInfo
  • wstrContextName : ContextNameHint
  • wszCatalogName : TABLEINFO
  • wszColName : PRIMARYKEY , COLDESC , INDEXINFO
  • wszCreateParams : TYPEINFO
  • wszData : tagPIDLDATA
  • wszDescription : PROVIDERINFO , ENUMINFO
  • wszIndexName : INDEXINFO
  • wszLspDll : _LSP_ENTRY
  • wszName : ENUMINFO , tagPIDLDATA , PROVIDERINFO , tagFieldMetaData
  • wszParseName : PROVIDERINFO , ENUMINFO
  • wszPortName : Static_Statistic
  • wszSchemaName : TABLEINFO
  • wszTableName : TABLEINFO
  • wszType : TABLEINFO
  • wszTypeName : TYPEINFO , PROVTYPEINFO , COLDESC
  • wszUserName : Static_Statistic
  • wTag : CONST_WORD_REP
  • wTracks : tag_filehdr
  • wType : TYPEINFO , _TYPEMAP , _tagTools , _SCHEMAINFO , INDEXINFO , COLDESC , PROVIDERINFO , PROVTYPEINFO
  • wVersion : LOGPAL
  • wzBuffer : filebuffer
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- x -

  • x : tagCONSOLEDATA , _IID , POINT3D
  • X : CapJ
  • x : CPoint::POINT
  • X1 : CImp_DrawDlg::Line
  • x1 : CLine::LINEDATA
  • x2 : CLine::LINEDATA
  • X2 : CImp_DrawDlg::Line
  • XBStr() : XBStr
  • xDirection : _BALLDATA
  • xfmChange : tagTrackObject
  • xfmDown : tagTrackObject
  • xForm : _MYXFORM , _BALLDATA , _XFORMDATA
  • XFrom : Util::line
  • XInterface() : XInterface< T >
  • XLabel : CapJ
  • XORImageRect : CHILDWINDOWDATA
  • XORRect : CHILDWINDOWDATA
  • XORTextRect : CHILDWINDOWDATA
  • XPacketIndex : InkErase::InkErase , InkClipboard::InkClipboard
  • xpos : Title
  • xPos : PROFILE_STRUCT
  • xPosition : _BALLDATA
  • xPosOld : GLOBAL_STRUCT
  • XPtr() : XPtr< T >
  • XTo : Util::line
  • XWindow() : XWindow
  • xy : CSimpleObject
  • xZoomUpDown_ValueChanged() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all class members with links to the classes they belong to:

- y -

  • y : tagCONSOLEDATA , CPoint::POINT
  • Y : CapJ
  • y : POINT3D
  • y1 : CLine::LINEDATA
  • Y1 : CImp_DrawDlg::Line
  • y2 : CLine::LINEDATA
  • Y2 : CImp_DrawDlg::Line
  • yDirection : _BALLDATA
  • year : _DOSDTTM
  • YFrom : Util::line
  • YLabel : CapJ
  • YPacketIndex : InkClipboard::InkClipboard , InkErase::InkErase
  • yPos : PROFILE_STRUCT
  • ypos : Title
  • yPosition : _BALLDATA
  • yPosOld : GLOBAL_STRUCT
  • yr : _SFFS
  • YTo : Util::line
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerations

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • f
  • l
  • m
  • o
  • r
  • s
  • t

- _ -

  • _EBufSize : CSampleWordBreaker
  • _enumNameType : CCertEncodeAltName

- f -

  • FACTORY_TYPE : CClassFactory

- l -

  • Listing : storesh::Storesh

- m -

  • METHOD_TYPE : CPropertiesDlg

- o -

  • OpTypes : CProxyPlugin::COpState

- r -

  • ROCKET_STATUS : CRocket

- s -

  • STATE : ASYNC_REQUESTER
  • STATUS : CToolBarExtension

- t -

  • tagSESSION_OPERATION : CRTCIncomingDlg , CRTCOutgoingDlg
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- a -

  • ABOUT : CClassFactory
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- m -

  • MAX_CHILDREN : CBackgroundFolder , CSpaceStation
  • MAX_COOKIES : CDataObject
  • MAX_NUMBER_OF_CHILDREN : CSpaceVehicle
  • mc_cNumMSGestures : CAdvRecoApp
  • mc_cNumSSGestures : CAdvRecoApp
  • mc_cxBoxMargin : CMultiRecoApp , CAdvRecoApp
  • mc_cxGestLVWidth : CAdvRecoApp
  • mc_cyBoxMargin : CAdvRecoApp , CMultiRecoApp
  • mc_iFontHeight : CRecoOutputWnd
  • mc_iGuideColWidth : CAdvRecoApp , CMultiRecoApp
  • mc_iGuideRowHeight : CMultiRecoApp , CAdvRecoApp
  • mc_iInputWndId : CAdvRecoApp , CMultiRecoApp
  • mc_iMarginX : CRecoOutputWnd
  • mc_iMarginY : CRecoOutputWnd
  • mc_iMSGestLVId : CAdvRecoApp
  • mc_iNumResults : CRecoOutputWnd
  • mc_iNumRowsCols : CAdvRecoApp , CMultiRecoApp
  • mc_iOutputWndId : CAdvRecoApp , CMultiRecoApp
  • mc_iPenWidth : CAdvRecoApp , CMultiRecoApp
  • mc_iSSGestLVId : CAdvRecoApp
  • mc_iStatusWndId : CAdvRecoApp , CMultiRecoApp
  • mc_iSubmenuGuides : CAdvRecoApp
  • mc_iSubmenuInputScopes : CAdvRecoApp
  • mc_iSubmenuModes : CAdvRecoApp
  • mc_iSubmenuRecognizers : CAdvRecoApp , CMultiRecoApp
  • METHOD_GETPROPERTIES : CPropertiesDlg
  • METHOD_GETPROPERTYINFO : CPropertiesDlg
  • METHOD_SETPROPERTIES : CPropertiesDlg
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- n -

  • NAMESPACEEXTENSION : CClassFactory
  • NDeers : Deers
  • NUMBER_OF_CHILDREN : CComponentData , CSpaceFolder , CSpaceStation , CIceSkateFolder , CSkateboardFolder , CBicycleFolder , CStaticNode , CSpaceVehicle , CPeoplePoweredVehicle , CSkyVehicle
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- o -

  • OP_QUERY_CACHE : CProxyPlugin::COpState
  • OP_QUERY_CACHE_MISS_POLICY : CProxyPlugin::COpState
  • OPENED : ASYNC_REQUESTER
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- c -

  • CallDone : CAsyncTest
  • CallNone : CAsyncTest
  • CallPending : CAsyncTest
  • CLOSED : ASYNC_REQUESTER
  • CLOSING : ASYNC_REQUESTER
  • COMPONENT : CClassFactory
  • COMPONENTDATA : CClassFactory
  • CONTEXTEXTENSION : CClassFactory
  • CONTEXTMENUX : CClassFactory
  • crm_Total : CCrmFilesTest
  • crm_VB : CCrmFilesTest
  • crm_VC : CCrmFilesTest
  • crm_VJ : CCrmFilesTest
  • cwcAtATime : CSampleWordBreaker
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- d -

  • DATA_AVAILABLE : ASYNC_REQUESTER
  • DATA_EXHAUSTED : ASYNC_REQUESTER
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- e -

  • eCOMPlus : CMain
  • eFree : CMain
  • enumAnsi : CCertEncodeAltName
  • enumBlob : CCertEncodeAltName
  • enumOther : CCertEncodeAltName
  • enumUnicode : CCertEncodeAltName
  • enumUnknown : CCertEncodeAltName
  • epropMAX : CFileShareSampleParamsPage
  • epropMaxUsers : CFileShareSampleParamsPage
  • epropPath : CFileShareSampleParamsPage
  • epropRemark : CFileShareSampleParamsPage
  • epropShareName : CFileShareSampleParamsPage
  • ERROR : ASYNC_REQUESTER
  • eSTA : CMain
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- f -

  • FirstAccept : _SEC_CONTEXT
  • FirstInit : _SEC_CONTEXT
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- g -

  • get_All : CContext
  • get_Application : CContext
  • get_Request : CContext
  • get_Response : CContext
  • get_Server : CContext
  • get_Session : CContext
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- h -

  • HEADERS_AVAILABLE : ASYNC_REQUESTER
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- i -

  • IDD : CAppExportDlg , CAppInstallDlg , CCompImportDlg , CAboutDlg , CADVCGENDlg , CDlgIADsPropertyList , CFileShareSampleParamsPage , CMessageDlg , CDlgIDirectoryObject , CProcessDlg , CQueryDlg , CDlgDest , CDeleteObjectDlg , CServerDlg , CSessionDlg , CDlgIDirectorySearch , CShutdownDlg , CWaitDlg , CVCExploreDlg , CDlgSrc , CDlgIADsSecurityDescriptor , CWaitSystemDlg , FaxDlg , CContextSamplePropPage , NewDocDlg , CDisdrawDlg , CCompInstallDlg , CClipBookServerParamsPage , CBasePropertyPage , CXMLTreeDlg , CCapMFCDlg , CWbemClientDlg , CPermEventsDlg , CCmdLineConsumerDlg , COfficeDlg , CAdvClientDlg , CMMCControl , CGenericUCPDlg , CDeviceProp , CRTCOutgoingDlg , CRTCIncomingDlg , CSendMessageDialog , CReceiveWaitDialog , CReceiveMessageDialog , COpenQueueDialog , CLocateDialog , CDeleteQueueDialog , CCreateQueueDialog , CCloseQueueDialog , CComSpyPropPage , CSCPPageGeneral , CLoginDlg , CImp_DrawDlg , CSCPPageBindingInfo , CSelectEventsDlg , CSCPPageKeywords , CExtPageUser , CAppUtilDlg , CConnectDlg , CDlgIADsOpenDSObject , CDlgIADsLargeInteger , CMoveDlg , CRenameDlg , CDlgIADsContainer , CGetInfoExDlg , CClientDlg , CADQIDlg , CDlgIADs , CMain , CUtilitiesDlg , CBankDlg , CTestDlg
  • Idle : _SEC_CONTEXT
  • IDM_NEW_BACKGROUND : CBackground
  • IDM_NEW_LAND : CLandBasedVehicle
  • IDM_NEW_PEOPLE : CPeoplePoweredVehicle
  • IDM_NEW_SKY : CSkyVehicle , CSkyBasedVehicle
  • IDM_NEW_SPACE : CSpaceFolder , CSpaceVehicle
  • IDM_PAUSE_SKY : CPlane
  • IDM_PAUSE_SPACE : CRocket
  • IDM_START_SKY : CPlane
  • IDM_START_SPACE : CRocket
  • IDM_STOP_SKY : CPlane
  • IDM_STOP_SPACE : CRocket
  • INIT : ASYNC_REQUESTER
  • IO_READ : CSampleDataContainer
  • IO_WRITE : CSampleDataContainer
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- p -

  • PAUSED : CRocket , CPlane , CToolBarExtension
  • Pending : CMyEventProvider
  • PendingStop : CMyEventProvider
  • PROPERTYPAGEX : CClassFactory
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- r -

  • READ_BUFFER_SIZE : ASYNC_REQUESTER
  • RECEIVING : ASYNC_REQUESTER
  • RUNNING : CPlane , CRocket
  • Running : CMyEventProvider
  • RUNNING : CToolBarExtension
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- s -

  • SecondAccept : _SEC_CONTEXT
  • SecondInit : _SEC_CONTEXT
  • SENDING : ASYNC_REQUESTER
  • STO_ADDPARTY : CRTCOutgoingDlg
  • STO_ANSWER : CRTCIncomingDlg
  • STO_CREATE : CRTCOutgoingDlg
  • STO_REMOVEPARTY : CRTCOutgoingDlg
  • STO_TERMINATE : CRTCIncomingDlg , CRTCOutgoingDlg
  • STOPPED : CPlane , CRocket
  • Stopped : CMyEventProvider
  • STOPPED : CToolBarExtension
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- t -

  • Test1 : CAsyncTest
  • Test2 : CAsyncTest
  • TOOLBAREXTENSION : CClassFactory
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Enumerator

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • w

- w -

  • WAITING_FOR_DATA : ASYNC_REQUESTER
  • WM_DISPLAY_PROPERTY : CMarkTextService
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- _ -

  • ___WSAFDIsSet() : DTHandler
  • __WSAFDIsSet() : DTHandler
  • _accept() : DTHandler
  • _AddAuthorityInfoAccessExtension() : CCertPolicySample
  • _AddAuthorityKeyId() : CCertPolicySample
  • _AddCertTypeExtension() : CCertPolicySample
  • _AddDefaultBasicConstraintsExtension() : CCertPolicySample
  • _AddDefaultKeyUsageExtension() : CCertPolicySample
  • _AddEnhancedKeyUsageExtension() : CCertPolicySample
  • _AddOldCertTypeExtension() : CCertPolicySample
  • _AddPagesCallback() : CPropSheetHost
  • _AddPagesForObject() : CPropSheetHost
  • _AddRevocationExtension() : CCertPolicySample
  • _AddStringArray() : CCertPolicySample
  • _AddSubjectAltNameExtension() : CCertPolicySample
  • _Append()
: msado15::Fields
, msado15::Fields20
  • _bind() : DTHandler
  • _CanPlaybackSelection() : CTSFEditWnd
  • _CanReconvertSelection() : CTSFEditWnd
  • _categories_AfterSelect() : WsdlDiscovery::frmMain
  • _Cleanup() : CCertEncodeCRLDistInfo , CCertPolicySample , CRequestInstance , CCertPolicySample , CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeBitString
  • _CleanupEditWnd() : CTSFMainWnd
  • _Clear() : CThumbNailPhotoHolder
  • _ClearAdviseSink() : CTSFEditWnd
  • _ClearCompositionDisplayAttributes() : CMarkTextService
  • _ClearRequestedAttributes() : CTSFEditWnd
  • _ClearText() : CTSFEditWnd
  • _closesocket() : DTHandler
  • _connect() : DTHandler
  • _CreateHiddenWindow() : CPropSheetHost
  • _CreatePropertySheet() : CPropSheetHost
  • _CreateSecondaryPropertySheet() : CPropSheetHost
  • _DisplayPicture() : CThumbNailPhotoHolder
  • _EnumerateExtensions() : CCertPolicySample
  • _ExpandEnvironmentVariables() : CCertExitSample
  • _extensionUrl_TextChanged() : WsdlDiscovery::frmMain
  • _ExtractSecPageInfo() : CPropSheetHost
  • _FreeStringArray() : CCertPolicySample
  • _GetClientId() : CCaseTextService
  • _GetComposing() : CTSFEditWnd
  • _GetComposition() : CMarkTextService
  • _GetCurrentSelection() : CTSFEditWnd
  • _GetDisplayAttributes() : CTSFEditWnd
  • _GetDSDispSpecOption() : CPropSheetHost
  • _GetDSObjectNames() : CPropSheetHost
  • _GetDSPropSheetConfig() : CPropSheetHost
  • _GetFileName() : CTSFMainWnd
  • _gethostbyaddr() : DTHandler
  • _gethostbyname() : DTHandler
  • _gethostname() : DTHandler
  • _GetIssuer() : CCertPolicySample
  • _getpeername() : DTHandler
  • _getprotobyname() : DTHandler
  • _getprotobynumber() : DTHandler
  • _GetReadingText() : CTSFEditWnd
  • _getservbyname() : DTHandler
  • _getservbyport() : DTHandler
  • _getsockname() : DTHandler
  • _getsockopt() : DTHandler
  • _GetText() : CTSFEditWnd
  • _GetTextOwner() : CTSFEditWnd
  • _GetThis() : CSnoopWnd
  • _GetThreadMgr() : CCaseTextService
  • _GetWindow() : CTSFEditWnd
  • _HandleArrowKey() : CMarkTextService
  • _HandleKeyDown() : CMarkTextService
  • _HandleReturn() : CMarkTextService
  • _HiddenWindowProc() : CPropSheetHost
  • _Hide() : CSnoopWnd
  • _htonl() : DTHandler
  • _htons() : DTHandler
  • _inet_addr() : DTHandler
  • _inet_ntoa() : DTHandler
  • _Init() : CSnoopWnd
  • _InitAuthorityInfoAccessExtension() : CCertPolicySample
  • _InitClass() : CSnoopWnd
  • _InitCleanupContextDurationSink() : CMarkTextService
  • _InitCleanupContextSink() : CMarkTextService
  • _InitContextCompartment() : CMarkTextService
  • _InitDisableExtensionList() : CCertPolicySample
  • _InitDisplayAttributeGuidAtom() : CMarkTextService
  • _InitFunctionProvider() : CTSFEditWnd
  • _InitGlobalCompartment() : CMarkTextService
  • _Initialize() : CTSFEditWnd
  • _InitKeystrokeSink() : CCaseTextService , CMarkTextService
  • _InitLanguageBar() : CCaseTextService , CMarkTextService
  • _InitPreservedKey() : CCaseTextService
  • _InitRequestExtensionList() : CCertPolicySample
  • _InitRevocationExtension() : CCertPolicySample
  • _InitSnoopWnd() : CCaseTextService
  • _InitSubjectAltNameExtension() : CCertPolicySample
  • _InitTextEditSink() : CCaseTextService , CMarkTextService
  • _InitThreadMgrSink() : CCaseTextService , CMarkTextService
  • _InitWorkerWnd() : CMarkTextService
  • _inquireUrl_TextChanged() : WsdlDiscovery::frmMain
  • _InternalLockDocument() : CTSFEditWnd
  • _InternalUnlockDocument() : CTSFEditWnd
  • _ioctlsocket() : DTHandler
  • _IsComposing() : CMarkTextService
  • _IsKeyFlipping() : CCaseTextService
  • _IsLocked() : CTSFEditWnd
  • _IsSnoopWndVisible() : CCaseTextService
  • _listen() : DTHandler
  • _Load() : CTSFEditWnd
  • _LoadFromFile() : CTSFEditWnd
  • _loadSchemes_Click() : WsdlDiscovery::frmMain
  • _LockDocument() : CTSFEditWnd
  • _MapDistPoint() : CCertEncodeCRLDistInfo
  • _MapName() : CCertEncodeAltName , CCertEncodeCRLDistInfo
  • _Menu_FlipDoc() : CCaseTextService
  • _Menu_FlipKeys() : CCaseTextService
  • _Menu_FlipSel() : CCaseTextService
  • _Menu_HelloWord() : CCaseTextService
  • _Menu_OnComposition() : CMarkTextService
  • _Menu_OnSetCaseProperty() : CMarkTextService
  • _Menu_OnSetCustomProperty() : CMarkTextService
  • _Menu_OnSetGlobalCompartment() : CMarkTextService
  • _Menu_OnViewCaseProperty() : CMarkTextService
  • _Menu_OnViewCustomProperty() : CMarkTextService
  • _Menu_ShowSnoopWnd() : CCaseTextService
  • _NameType() : CCertEncodeAltName
  • _NewEnum()
: msado15::_Collection
, msado15::_DynaCollection
, msado15::Errors
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::Parameters
, msado15::Properties
, CDynamic
, CEntity
, CResultset
  • _NotifyCRLIssued() : CCertExitSample
  • _NotifyNewCert() : CCertExitSample
  • _NSPAddressToString() : DTHandler
  • _NSPCleanup() : DTHandler
  • _NSPGetAddressByName() : DTHandler
  • _NSPGetServiceClassInfo() : DTHandler
  • _NSPGetServiceClassNameByClassId() : DTHandler
  • _NSPInstallServiceClass() : DTHandler
  • _NSPLookupServiceBegin() : DTHandler
  • _NSPLookupServiceEnd() : DTHandler
  • _NSPLookupServiceNext() : DTHandler
  • _NSPRemoveServiceClass() : DTHandler
  • _NSPSetService() : DTHandler
  • _NSPStringToAddress() : DTHandler
  • _ntohl() : DTHandler
  • _ntohs() : DTHandler
  • _OnActivate() : CTSFMainWnd
  • _OnCommand() : CTSFEditWnd , CTSFMainWnd
  • _OnCreate() : CTSFEditWnd , CTSFMainWnd
  • _OnDestroy() : CTSFEditWnd , CTSFMainWnd
  • _OnEditChange() : CTSFEditWnd
  • _OnEditKillFocus() : CTSFEditWnd
  • _OnEditSetFocus() : CTSFEditWnd
  • _OnGetPreservedKey() : CTSFEditWnd
  • _OnInitMenuPopup() : CTSFEditWnd , CTSFMainWnd
  • _OnKillFocus() : CTSFEditWnd , CTSFMainWnd
  • _OnNotify() : CTSFEditWnd , CTSFMainWnd
  • _OnPaint() : CSnoopWnd
  • _OnSetFocus() : CTSFEditWnd , CTSFMainWnd
  • _OnSize() : CTSFEditWnd , CTSFMainWnd
  • _OnTest() : CTSFEditWnd
  • _OnUpdate() : CTSFEditWnd
  • _Playback() : CTSFEditWnd
  • _providerName_TextChanged() : WsdlDiscovery::frmMain
  • _ReadRegistryString() : CCertPolicySample
  • _ReadRegistryStringArray() : CCertPolicySample
  • _Reconvert() : CTSFEditWnd
  • _recv() : DTHandler
  • _recvfrom() : DTHandler
  • _RequestPropertyEditSession() : CMarkTextService
  • _Save() : CTSFEditWnd
  • _SaveToFile() : CTSFEditWnd
  • _searchCategorization_Click() : WsdlDiscovery::frmMain
  • _searchProvider_Click() : WsdlDiscovery::frmMain
  • _searchService_Click() : WsdlDiscovery::frmMain
  • _select() : DTHandler
  • _send() : DTHandler
  • _sendto() : DTHandler
  • _serviceName_TextChanged() : WsdlDiscovery::frmMain
  • _SetCaseProperty() : CMarkTextService
  • _SetComposition() : CMarkTextService
  • _SetCompositionDisplayAttributes() : CMarkTextService
  • _SetCustomProperty() : CMarkTextService
  • _SetErrorInfo() : CCertEncodeCRLDistInfo , CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeBitString
  • _SetFlagsProperty() : CRequestInstance
  • _SetPictureControl() : CThumbNailPhotoHolder
  • _setsockopt() : DTHandler
  • _SetState() : CCustomPropertyStore
  • _SetSystemStringProp() : CCertPolicySample
  • _SetText() : CTSFDataObject
  • _SetThis() : CSnoopWnd
  • _SetValidityPeriod() : CCertPolicySample
  • _Show() : CSnoopWnd
  • _shutdown() : DTHandler
  • _socket() : DTHandler
  • _TemplateNamesMatch() : CRequestInstance
  • _TerminateAllCompositions() : CTSFEditWnd
  • _TerminateComposition() : CMarkTextService
  • _TerminateCompositionInContext() : CMarkTextService
  • _TestInsert() : CTSFEditWnd
  • _Uninit() : CSnoopWnd
  • _UninitClass() : CSnoopWnd
  • _UninitCleanupContextDurationSink() : CMarkTextService
  • _UninitCleanupContextSink() : CMarkTextService
  • _UninitCompartment() : CMarkTextService
  • _UninitFunctionProvider() : CTSFEditWnd
  • _UninitGlobalCompartment() : CMarkTextService
  • _Uninitialize() : CTSFEditWnd
  • _UninitKeystrokeSink() : CCaseTextService , CMarkTextService
  • _UninitLanguageBar() : CCaseTextService , CMarkTextService
  • _UninitPreservedKey() : CCaseTextService
  • _UninitSnoopWnd() : CCaseTextService
  • _UninitThreadMgrSink() : CCaseTextService , CMarkTextService
  • _UninitWorkerWnd() : CMarkTextService
  • _UnlockDocument() : CTSFEditWnd
  • _UpdateStatusBar() : CTSFEditWnd
  • _UpdateText() : CSnoopWnd
  • _VerifyName() : CCertEncodeAltName
  • _VerifyNames() : CCertEncodeCRLDistInfo
  • _ViewCaseProperty() : CMarkTextService
  • _ViewCustomProperty() : CMarkTextService
  • _WndProc() : CTSFMainWnd , CSnoopWnd , CTSFEditWnd
  • _WorkerWndProc() : CMarkTextService
  • _WPUCloseEvent() : DTHandler
  • _WPUCloseSocketHandle() : DTHandler
  • _WPUCreateEvent() : DTHandler
  • _WPUCreateSocketHandle() : DTHandler
  • _WPUFDIsSet() : DTHandler
  • _WPUGetProviderPath() : DTHandler
  • _WPUModifyIFSHandle() : DTHandler
  • _WPUPostMessage() : DTHandler
  • _WPUQueryBlockingCallback() : DTHandler
  • _WPUQuerySocketHandleContext() : DTHandler
  • _WPUQueueApc() : DTHandler
  • _WPUResetEvent() : DTHandler
  • _WPUSetEvent() : DTHandler
  • _WriteCertToFile() : CCertExitSample
  • _WriteHelper() : CThumbNailPhotoHolder
  • _WSAAccept() : DTHandler
  • _WSAAddressToStringA() : DTHandler
  • _WSAAddressToStringW() : DTHandler
  • _WSAAsyncGetHostByAddr() : DTHandler
  • _WSAAsyncGetHostByName() : DTHandler
  • _WSAAsyncGetProtoByName() : DTHandler
  • _WSAAsyncGetProtoByNumber() : DTHandler
  • _WSAAsyncGetServByName() : DTHandler
  • _WSAAsyncGetServByPort() : DTHandler
  • _WSAAsyncSelect() : DTHandler
  • _WSACancelAsyncRequest() : DTHandler
  • _WSACancelBlockingCall() : DTHandler
  • _WSACleanup() : DTHandler
  • _WSACloseEvent() : DTHandler
  • _WSAConnect() : DTHandler
  • _WSACreateEvent() : DTHandler
  • _WSADuplicateSocketA() : DTHandler
  • _WSADuplicateSocketW() : DTHandler
  • _WSAEnumNameSpaceProvidersA() : DTHandler
  • _WSAEnumNameSpaceProvidersW() : DTHandler
  • _WSAEnumNetworkEvents() : DTHandler
  • _WSAEnumProtocolsA() : DTHandler
  • _WSAEnumProtocolsW() : DTHandler
  • _WSAEventSelect() : DTHandler
  • _WSAGetLastError() : DTHandler
  • _WSAGetOverlappedResult() : DTHandler
  • _WSAGetQOSByName() : DTHandler
  • _WSAGetServiceClassInfoA() : DTHandler
  • _WSAGetServiceClassInfoW() : DTHandler
  • _WSAGetServiceClassNameByClassIdA() : DTHandler
  • _WSAGetServiceClassNameByClassIdW() : DTHandler
  • _WSAHtonl() : DTHandler
  • _WSAHtons() : DTHandler
  • _WSAInstallServiceClassA() : DTHandler
  • _WSAInstallServiceClassW() : DTHandler
  • _WSAIoctl() : DTHandler
  • _WSAIsBlocking() : DTHandler
  • _WSAJoinLeaf() : DTHandler
  • _WSALookupServiceBeginA() : DTHandler
  • _WSALookupServiceBeginW() : DTHandler
  • _WSALookupServiceEnd() : DTHandler
  • _WSALookupServiceNextA() : DTHandler
  • _WSALookupServiceNextW() : DTHandler
  • _WSANtohl() : DTHandler
  • _WSANtohs() : DTHandler
  • _WSARecv() : DTHandler
  • _WSARecvDisconnect() : DTHandler
  • _WSARecvFrom() : DTHandler
  • _WSARemoveServiceClass() : DTHandler
  • _WSAResetEvent() : DTHandler
  • _WSASend() : DTHandler
  • _WSASendDisconnect() : DTHandler
  • _WSASendTo() : DTHandler
  • _WSASetBlockingHook() : DTHandler
  • _WSASetEvent() : DTHandler
  • _WSASetLastError() : DTHandler
  • _WSASetServiceA() : DTHandler
  • _WSASetServiceW() : DTHandler
  • _WSASocketA() : DTHandler
  • _WSASocketW() : DTHandler
  • _WSAStartup() : DTHandler
  • _WSAStringToAddressA() : DTHandler
  • _WSAStringToAddressW() : DTHandler
  • _WSAUnhookBlockingHook() : DTHandler
  • _WSAWaitForMultipleEvents() : DTHandler
  • _WSCDeinstallProvider() : DTHandler
  • _WSCEnableNSProvider() : DTHandler
  • _WSCEnumProtocols() : DTHandler
  • _WSCGetProviderPath() : DTHandler
  • _WSCInstallNameSpace() : DTHandler
  • _WSCInstallProvider() : DTHandler
  • _WSCUnInstallNameSpace() : DTHandler
  • _WSPAccept() : DTHandler
  • _WSPAddressToString() : DTHandler
  • _WSPAsyncSelect() : DTHandler
  • _WSPBind() : DTHandler
  • _WSPCancelBlockingCall() : DTHandler
  • _WSPCleanup() : DTHandler
  • _WSPCloseSocket() : DTHandler
  • _WSPConnect() : DTHandler
  • _WSPDuplicateSocket() : DTHandler
  • _WSPEnumNetworkEvents() : DTHandler
  • _WSPEventSelect() : DTHandler
  • _WSPGetOverlappedResult() : DTHandler
  • _WSPGetPeerName() : DTHandler
  • _WSPGetQOSByName() : DTHandler
  • _WSPGetSockName() : DTHandler
  • _WSPGetSockOpt() : DTHandler
  • _WSPIoctl() : DTHandler
  • _WSPJoinLeaf() : DTHandler
  • _WSPListen() : DTHandler
  • _WSPRecv() : DTHandler
  • _WSPRecvDisconnect() : DTHandler
  • _WSPRecvFrom() : DTHandler
  • _WSPSelect() : DTHandler
  • _WSPSend() : DTHandler
  • _WSPSendDisconnect() : DTHandler
  • _WSPSendTo() : DTHandler
  • _WSPSetSockOpt() : DTHandler
  • _WSPShutdown() : DTHandler
  • _WSPSocket() : DTHandler
  • _WSPStartup() : DTHandler
  • _WSPStringToAddress() : DTHandler
  • _xClone()
: msado15::Recordset21
, msado15::Recordset
, msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset15
  • _xResync()
: msado15::Recordset15
, msado15::_Recordset
, msado15::Recordset20
, msado15::Recordset
, msado15::Recordset21
  • _xSave()
: msado15::Recordset21
, msado15::_Recordset
, msado15::Recordset20
, msado15::Recordset
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- j -

  • JobError() : CBackgroundCopyCallback , CMonitor
  • JobModification() : CMonitor , CBackgroundCopyCallback
  • JobTransferred() : CBackgroundCopyCallback , CMonitor
  • Join() : CAppletSession
  • JoinSessionConfirm() : CAppletSession
  • JoinTransactionProc() : CMDIChild
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- k -

  • KeyDown() : CController
  • KeyUp() : CController
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- l -

  • lAddVerbs() : CSimpleDoc , CSimpSvrDoc
  • Last() : CListHeader , NIDequeIter_c< T >
  • LaunchError() : CWrapVBComponent
  • LaunchPT() : CPTLauncher , IPTLauncher
  • lButtonDown() : CSimpSvrDoc , CSimpSvrObj
  • Lcid() : CExtObject
  • lCommandHandler() : CSimpleApp , CSimpSvrApp
  • lCreateDoc() : CSimpleApp , CSimpSvrApp
  • Leave() : CCriticalSection , CLock , CAppletSession
  • LeaveSessionIndication() : CAppletSession
  • Length() : CComWSTR , CISeqStream
  • libName() : APIHook< T >
  • Line() : CCanvas
  • LineFromChar() : CRichEditLite
  • LineIndex() : CEditBoxLite
  • LineItem()
: qcorder::IOrder
, qcorder::IOrderDefault
, qcorder::Order
, qcship::IShip
, qcship::IShipDefault
, qcship::Ship
, CONotify
, COrder
, COShip
, CONotify
, COrder
, COShip2
, qcnotify::INotify
, qcnotify::INotifyDefault
, qcnotify::Notify
  • LineLength() : CEditBoxLite
  • LineScan() : CComputer
  • LineScroll() : CEditBoxLite
  • LineToString() : Util::HelperFunctions
  • listen() : DTHandler
  • Listen() : CAgentCtlCharacterEx
  • ListeningState() : AgentNotifySink , Notify
  • Load() : IMyPersistStreamImpl< T > , RqsConfig , CComponentData , CAgentCtlCharacters , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CResString , CSmpFilter , CCommBand , CDeskBand , CExplorerBar , CToolBand , CImpIPersistFile , CShellExt , CPersistFile , CPersistStorage , CSimpSvrDoc , CDynamic , CEntity , CResultset , CWebBrowser , CPropertyPage , CDSLConnectionPage
  • LoadAll() : CBankDlg
  • LoadAppCombo() : CCompImportDlg , CCompInstallDlg
  • LoadArray() : CComputer , CHuman
  • LoadBitmaps() : CDelegationBase , CComponentData , CDelegationBase
  • LoadCharacter() : MainDlg , CCapMFCDlg , CapJ , Hello3J
  • LoadConfig() : CacheProxySamplePlugin::CacheProxyPlugin , RqsConfig
  • LoadConfigValues() : CContextPlugin
  • loadData() : MyOSPObject
  • LoadDBPROP() : CUtilProp
  • LoadDBPROPINFO() : CUtilProp
  • LoadDefaults() : CFullConnect
  • LoadDialog() : CImportRes
  • LoadDllServer() : CSurrogate
  • LoadFile() : CXmlDOM , CMultiRecoApp
  • LoadFromFile()
: msado15::_Stream
, msado15::Stream
  • LoadFromStorage() : CSimpSvrObj
  • LoadFromStream() : CEntity
  • LoadInitString() : CServiceComp
  • LoadISF() : Serialization::SerializationForm
  • LoadMenu() : CAdvRecoApp , CMultiRecoApp
  • LoadOptions() : COptionsSheet
  • LoadProperty() : CTSFPersistentPropertyLoader
  • LoadPropertyValues() : CReindeer
  • LoadRecentConfig() : CFullConnect
  • LoadRecentFile() : CFullConnect
  • LoadSettings() : CMainWindow
  • LoadSettingsFromServerNamespace() : CachePluginAdmin
  • LoadSettingsFromXmlFile() : CachePluginAdmin
  • LoadStream() : CXmlDOM
  • LoadString() : CImportRes
  • LoadSurfaces() : CBicycle
  • LoadTModels() : UDDI::Tools::CategoryTreeView
  • LoadTrace() : RqsConfig
  • LoadXML() : CXmlDOM , Serialization::SerializationForm , CXMLTreeDlg
  • Lock() : CDBAuthPlugin , CLockHandler , CSampleInstance
  • LockBuffer() : CString
  • lockCount() : CFactory
  • LockRegion() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream
  • LockServer() : CClassFactory , CSmpFilterCF , CFactory , CClassFactory , CProvFactory , CClassFactory , CProvFactory , CFVClassFactory , CClassFactory , CHtmlIFilterCF , CClassFactoryWrapper , CClassFactory , MyClassFactory , CClassFactory , CShellExtClassFactory , CClassFactory , CCallAsFactory , CHelloClassFactory , CClassFactory , CFactory , CClassFactory , CProvFactory , CClassFactory , HtmlPropIFilterCF , CClassFactory , CLanguageResourceSampleCF , CClassFactory , CProvFactory , CClassFactory
  • LogError() : CSyncMgrHandler , CCallbackWrapper , CSyncMgrHandler
  • LogFile() : IComSpy
  • LoginPrompt() : CImp_DrawDlg
  • LogPrunedDisk() : CEnumStorageResource
  • LogToFile() : IComSpy
  • LongQuote()
: persistatl::INewsEvent
, cascadeec::INewsEvent
, cascadeec::INewsEventDefault
, persistatl::INewsEventDefault
, newseventclass::NewsEvent
, CNewsEvent
, persistatl::NewsEvent
, newseventclass::INewsEventDefault
, newseventclass::INewsEvent
, NewsSubscriber
, cascadeec::CascadeEC
  • Lookup() : COBLIST , CSpecialCharHashTable , CStaticMap , COBLIST , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • LookupFree() : CProxy
  • LPtoDP() : CCanvas
  • lResizeDoc() : CSimpleDoc , CSimpSvrDoc , CSimpleDoc
  • lSizeHandler() : CSimpleApp , CSimpSvrApp
  • lstAnnotationLayer_SelectedIndexChanged() : AutoClaims::AutoClaims
  • LVEventItemChanged() : CSelectEventsDlg
  • LVSystemEventItemChanged() : CSelectEventsDlg
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- m -

  • main() : Class1 , NewsFlash , MyDataSource , VJQuery
  • Main()
: InkCollection::InkCollection
, CSharp_Draw::Form1
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkErase::InkErase
  • main() : MyOSPObject
  • Main()
: Sample::Sample
, InkHitTest::InkHitTest
, InkRecognition::InkRecognition
, storesh::Storesh
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • main() : NewsSubscriber , About
  • Main()
: Sample::Sample
, PaperForm::PaperForm
, Serialization::SerializationForm
, AutoClaims::AutoClaims
, Microsoft::Uddi::Demo::Publish
, WsdlDiscovery::frmMain
  • main() : CapJ
  • Main()
: AutoClaims::AutoClaims
, InkClipboard::InkClipboard
  • MainDlg() : MainDlg
  • MainWindow() : Sample::UI::MainWindow
  • MakeEllipsisPath() : CapJ , MainDlg , CCapMFCDlg
  • MakeTree() : CXMLTreeDlg
  • MakeVariantArray() : CCrmFilesCompensator
  • ManualConstruct() : CPooledData , CProxy
  • ManualConstructData() : CODBCData
  • Map() : CMmStreamConsecBuf , CMmStream , PMmStream
  • MapAll() : CMmStream , PMmStream
  • MapColumnIDs() : CImpIColumnsInfo
  • MapGeneric() : CObjSecurity
  • MapTableInfo() : CTable
  • MapTypes() : CTableCopy
  • MarkAllAppsForDelete() : CSelectEventsDlg
  • MarkItemsAsCut() : CShellView
  • MarshalInterface() : CClassFactoryWrapper , CDynamic , CEntity , CResultset
  • MatchExtendedKeyUsage() : CIsapiCertPolicyFilter
  • MatchIssuerThumbprint() : CIsapiCertPolicyFilter
  • MatchSid() : CSids
  • MDIActivate() : CMDIFrameLite
  • MDIDestroy() : CMDIFrameLite
  • MDIWndProc() : CMDIChildLite
  • MemAlloc() : CFileViewer
  • MemberChanged() : CFtNotify , CConfNotify , CAppShareNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , CAppShareNotify , CConfNotify , CDataNotify , CConfNotify
  • MemFree() : CFileViewer
  • MenuSelect() : CStatusHelper
  • MergeEditMenu() : CShellView
  • MergeFileMenu() : CShellView
  • MergeMenus() : COleDocumentView
  • MergeToolbar() : CShellView
  • MergeViewMenu() : CShellView
  • MessageBox() : CContextSamplePropPage
  • MessageDisplay() : CStatusHelper
  • MessageLoop() : CFrame
  • MessageMap() : CStatusHelper
  • Method1() : COMPlus
  • miAutomaticLayoutAnalysis_Click() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miBlack_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miBlue_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miBMP_Click() : InkClipboard::InkClipboard
  • miClear_Click()
: InkClipboard::InkClipboard
, InkErase::InkErase
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
  • miCopy_Click() : InkClipboard::InkClipboard
  • miCuspErase_Click() : InkErase::InkErase
  • miCut_Click() : InkClipboard::InkClipboard
  • miDivide_Click() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miEdit_Click() : PaperForm::PaperForm
  • miEMF_Click() : InkClipboard::InkClipboard
  • miEnabled_Click() : InkCollection::InkCollection
  • miErase_Click() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miEraser_Click() : PaperForm::PaperForm
  • miExit_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkErase::InkErase
, InkHitTest::InkHitTest
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
  • miGreen_Click()
: InkCollection::InkCollection
, InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miInk_Click()
: InkErase::InkErase
, InkClipboard::InkClipboard
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miIntersectErase_Click() : InkErase::InkErase
  • miISF_Click() : InkClipboard::InkClipboard
  • miLassoSelect_Click() : InkClipboard::InkClipboard
  • miMainEdit_Popup() : InkClipboard::InkClipboard
  • miMedium_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miMetafile_Click() : InkClipboard::InkClipboard
  • miNoOLE_Click() : InkClipboard::InkClipboard
  • miPaste_Click() : InkClipboard::InkClipboard
  • miPen_Click() : PaperForm::PaperForm
  • miRecognize_Click() : PaperForm::PaperForm
  • miRed_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miScalePenWidth_Click() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miSInk_Click() : InkClipboard::InkClipboard
  • miStrokeErase_Click() : InkErase::InkErase
  • miThick_Click()
: InkCollection::InkCollection
, InkClipboard::InkClipboard
  • miThin_Click()
: InkClipboard::InkClipboard
, InkCollection::InkCollection
  • miTInk_Click() : InkClipboard::InkClipboard
  • miZoomToRect_Click() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • ModifyPacketData() : RealTimeStylusPlugins::PacketFilterPlugin
  • ModifySettingsEventHandler() : CachePluginAdmin
  • MonitorShutdown() : CExeModule
  • MouseDown() : InkCollectorEvents
  • MouseMove() : InkCollectorEvents
  • MouseUp() : InkCollectorEvents
  • MouseWheel() : InkCollectorEvents
  • Move() : msado15::Recordset21 , msado15::_Recordset , msado15::Recordset20 , msado15::Recordset , CPropertyPage , AgentNotifySink , msado15::Recordset15 , Notify , CDialogStream , Notify , AgentNotifySink
  • Move_click() : CapJ
  • MoveComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • MoveFirst()
: msado15::Recordset20
, msado15::_Recordset
, msado15::Recordset15
, msado15::Recordset21
, msado15::Recordset
  • MoveLast()
: msado15::Recordset21
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::_Recordset
  • MoveNext()
: msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
, msado15::Recordset
, msado15::_Recordset
  • MovePrevious()
: msado15::_Recordset
, msado15::Recordset20
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset21
  • MoveRecord()
: msado15::_Record
, msado15::Record
  • MoveTo() : CAgentCtlCharacterEx
  • MoveToOpenedQueuePathNameArray() : CMainFrame
  • MoveToPathNameArray() : CMainFrame
  • MSPAddressAddRef() : CSampleMSP
  • MSPAddressRelease() : CSampleMSP
  • MSPCallAddRef() : CSampleMSPCall
  • MSPCallRelease() : CSampleMSPCall
  • MyClassFactory() : MyClassFactory
  • MyDataSource() : MyDataSource
  • myInkCollector_CursorDown() : InkErase::InkErase
  • myInkCollector_NewPackets()
: InkErase::InkErase
, InkClipboard::InkClipboard
  • myInkCollector_Stroke()
: InkErase::InkErase
, InkClipboard::InkClipboard
  • myInkOverlay_Stroke() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myInkOverlay_StrokeDeleted() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myInkOverlay_StrokeDeleting() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myMethod() : CSimple , CPower
  • MyOSPObject() : MyOSPObject
  • myPowerMethod() : CPower
  • MyQuery() : CCallBack
  • MySignedXml() : Sample::MySignedXml
  • MyString() : MyString
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- n -

  • Navigate() : CWebBrowser
  • NavigateTo() : CVCExploreDlg
  • newDataResponse() : RSProxy
  • NewDocDlg() : NewDocDlg
  • newErrorResponse() : RSProxy
  • NewInAirPackets() : InkCollectorEvents
  • NewMenu_Click() : Serialization::SerializationForm
  • NewMove() : CComputer , CHuman
  • NewNode() : CLListImpl< TYPE, ARG_TYPE >
  • NewPackets() : InkCollectorEvents
  • newRequest() : RSProxy
  • NewsFlash()
: CNewsEvent
, cascadeec::CascadeEC
, cascadeec::INewsEvent
, cascadeec::INewsEventDefault
, newseventclass::INewsEvent
, newseventclass::INewsEventDefault
, newseventclass::NewsEvent
, NewsFlash
, NewsSubscriber
, persistatl::INewsEvent
, persistatl::INewsEventDefault
, persistatl::NewsEvent
  • NewsSubscriber() : NewsSubscriber
  • Next() : CEnumFormatEtc , CLinkable , ClientList::Iterator , CGenericEnum , CEnumSyncMgrItems , NIDequeIter_c< T > , CEnumFormatEtc , CEnumTASK , CEnumStorageResource , CStorageResource , CEnumFormatEtc , CDataObject , CEnumIDList , CEnumDisplayAttributeInfo , CEnumXXX< T, ELT_T, IFACE >
  • NextEntity() : CProxy
  • NextLookup() : CProxy
  • NextPage() : CModel
  • NextRecordset()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • NextResultset() : CProxy
  • NextResultsetData() : CODBCData
  • NextSection() : CModel
  • NIDeque_c() : NIDeque_c< T >
  • NIDequeIter_c() : NIDequeIter_c< T >
  • NILNode_c() : NILNode_c< T >
  • NmUI() : CMgrNotify , CConfNotify , CFtNotify , CMgrNotify , CConfNotify , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , CMgrNotify , CAppShareNotify , CCallNotify , CConfNotify , CMgrNotify , CConfNotify , CDataNotify
  • NondelegatingAddRef() : CUnknown
  • NondelegatingQueryInterface() : CAsyncXXX< T, ISyncFace, IAsyncFace > , CUnknown , CServer
  • NondelegatingRelease() : CUnknown
  • Notify() : Notify , CComponent , CComponentData , CComponent , CStorageResType , CComponent , CComponentData , CComponent , CComponentData , Notify , CComponentData , CMgdResType , CComponent , CComponentData , CComponent , CBehavior , CGrid , CComponentData , CComponent , CComponentData , CComponent , CCertExitSample , CComponentData , CCertExitSample , CMyStartupListener , CComponentData , qcnotify::Notify , CComponentData , CComponent , CComponentData , CComponent , CMyMemberSetChangeListener , MyOSPObject , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CAdminNotifyHandler , CComponent , CComponentData
  • NotifyRequestor() : COShip2 , COShip
  • NotifyViews() : CShellFolder
  • NSPAddressToString() : DTHandler
  • NSPGetAddressByName() : DTHandler
  • NSPGetServiceClassInfo() : DTHandler
  • NSPGetServiceClassNameByClassId() : DTHandler
  • NSPInstallServiceClass() : DTHandler
  • NSPLookupServiceBegin() : DTHandler
  • NSPLookupServiceEnd() : DTHandler
  • NSPLookupServiceNext() : DTHandler
  • NSPRemoveServiceClass() : DTHandler
  • NSPSetService() : DTHandler
  • NSPStringToAddress() : DTHandler
  • ntohl() : DTHandler
  • ntohs() : DTHandler
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- o -

  • ObjectAddRef() : CBase
  • ObjectInitialize() : CSite
  • ObjectQI() : CBase
  • ObjectRelease() : CBase
  • Ok() : CMmStream , PMmStream
  • okButton_click() : About
  • OkButton_Click() : Sample::UI::AboutBox
  • OleDuplicateString() : CComponent
  • OnAbort() : CMainWindow
  • OnAbout() : CSpyCon , CComSpy , CMainWindow
  • OnActivate() : CShellView , CWndLite , CDialogLite
  • OnActivateApp() : MainDlg , CCapMFCDlg
  • OnActivityCreate() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityDestroy() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityEnter() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityLeave() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityLeaveSame() : CActivitySub , IComSpyAudit , CComSpySqlAudit
  • OnActivityReenter() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnActivityTimeout() : CComSpySqlAudit , CActivitySub , IComSpyAudit
  • OnAdd() : CBankDlg , CAttributeValueAddButton
  • OnAddDefinedProperties() : CPropertiesDlg
  • OnAddEquipment() : CAdvClientDlg
  • OnAddImages() : CIceSkateFolder , CDelegationBase , CBackgroundFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CComponent , CBackgroundFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CBackgroundFolder , CDelegationBase
  • OnAddMenuItems() : CDelegationBase , CLandBasedVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CDelegationBase , CSpaceVehicle , CDelegationBase , CPlane , CSkyVehicle
  • OnAddParameter() : CExecuteParamDlg
  • OnAddparty() : CRTCOutgoingDlg
  • OnAddRef() : CMainWindow
  • OnAddressBox() : CBrowserHost
  • OnAddSet() : CExecuteParamDlg
  • OnAddValue() : CMultiValuedAttributeEditor
  • OnAdvise() : CMainWindow
  • OnAgentPropertyChange() : CCapMFCDlg
  • OnAggregation() : CInterfaceDlg
  • OnAlwaysOnTop() : CSpyCon
  • OnAmbientPropertyChange() : CMMCControl
  • OnAnswer() : CRTCIncomingDlg
  • OnApiCloseQueue() : CMainFrame
  • OnApiCreateQueue() : CMainFrame
  • OnApiDeleteQueue() : CMainFrame
  • OnApiLocate() : CMainFrame
  • OnApiOpenQueue() : CMainFrame
  • OnApiReceiveMessage() : CMainFrame
  • OnApiSendMessage() : CMainFrame
  • OnAppAbout() : CMultichanApp , CPrintSDIApp , CTestApp , CGenericUCPDlg , CAPIApp
  • OnAppActivation() : CComSpySqlAudit , CAppSub , IComSpyAudit
  • OnAppFileSearch() : CAppInstallDlg
  • OnAppForceShutdown() : CAppSub
  • OnApply() : CFullConnectProvider , CPropPageLite , COptionsDataSource , COptionsCommand , COptionsAccessor , COptionsRowset , COptionsNotify , COptionsError , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI , CBasePropertyPage
  • OnApplyChanges() : CVirtualFile , CExtendPropertySheet
  • OnAppSearch() : CAppUtilDlg
  • OnAppsharing() : CRTCOutgoingDlg
  • OnAppShutdown() : CComSpySqlAudit , CAppSub , IComSpyAudit
  • OnArrangeIcons() : CMainWindow
  • OnAssertOnErrors() : CBankDlg
  • OnAsyncFind() : CGenericUCPDlg
  • OnAuthenticate() : CComSpySqlAudit , CSecuritySub , IComSpyAudit
  • OnAuthenticateFail() : CComSpySqlAudit , CSecuritySub , IComSpyAudit
  • OnAuthentication() : CIsapiCertPolicyFilter
  • OnAuthorizeOpen() : CDBAuthPlugin
  • OnAutoPosition() : CMDIFrameLite
  • OnAutoQI() : CMainWindow
  • OnBalloonUse() : CCapMFCDlg
  • OnBeginDrag() : CTreeViewLite
  • OnBeginLabelEdit() : CTreeViewLite
  • OnBeginPrinting() : CPrintSDIView
  • OnBindGuid() : CDlgIADs
  • OnBorder() : CSplitterLite
  • OnBox1() : CBrowserHost
  • OnBox2() : CBrowserHost
  • OnBox3() : CBrowserHost
  • OnBox4() : CBrowserHost
  • OnBuild() : CADVCGENDlg
  • OnButton1() : CBrowserHost
  • OnButton10() : CBrowserHost
  • OnButton2() : CBrowserHost
  • OnButton3() : CBrowserHost
  • OnButton4() : CBrowserHost
  • OnButton5() : CBrowserHost
  • OnButton6() : CBrowserHost
  • OnButton7() : CBrowserHost
  • OnButton8() : CBrowserHost
  • OnButton9() : CBrowserHost
  • OnButtonAddQueue() : CDisdrawDlg
  • OnButtonAttach() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • OnButtonClick() : CSCPPageBindingInfo , MainDlg
  • OnButtonClicked() : CDelegationBase , CRocket
  • OnCacheClientClose() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnCancel() : CMain , CTestDlg , CPropertiesDlg , CExecuteParamDlg , CDialogLite , CPropPageLite , CDlgDest , CDlgSrc , CADQIDlg , CBaseDialog , CAdvClientDlg , CSimpleDialog , CProcessDlg , CQueryDlg , CSessionDlg
  • OnCancelDownloadContent() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnCascade() : CMainWindow
  • OnChange() : CAttributeValueEditor , CCompartmentMonitor , CMarkTextService
  • OnChangeADsPath() : CADQIDlg , CDlgIADsOpenDSObject
  • OnChangeADspath() : CMoveDlg
  • OnChangeAttribute() : CDlgIDirectoryObject
  • OnChangeCtrl() : CBasePropertyPage
  • OnChangeDelete() : CDeleteObjectDlg
  • OnChangeDomainName() : CServerDlg
  • OnChangeEditFriend() : CDisdrawDlg
  • OnChangeEditFriendComputer() : CDisdrawDlg
  • OnChangeFilename() : CXMLTreeDlg
  • OnChangeFilter() : CDlgIDirectorySearch
  • OnChangePicture() : CProppageUserUI , CExtPageUser
  • OnChangeRequiredField() : CClipBookServerParamsPage , CFileShareSampleParamsPage
  • OnChangeSpeakText() : CCapMFCDlg
  • OnChangeTableList() : CADVCGENDlg
  • OnChangeUsername() : CDlgIADsOpenDSObject
  • OnChar() : CWndLite , CDrawArea
  • OnCharacterCommand() : MainDlg
  • OnCharacterMove() : MainDlg
  • OnCharacterRightClick() : MainDlg
  • OnCheckauto() : CRTCIncomingDlg
  • OnCheckBox() : CBrowserHost
  • OnCheckBoxClick() : CComSpyPropPage
  • OnChooseFont() : CSpyCon , CComSpy
  • OnChooseLogFile() : CSpyCon , CComSpy
  • OnCleanupContext() : CMarkTextService
  • OnClear() : CSpyCon , CComSpy , CAdvRecoApp , CMultiRecoApp
  • OnClearAll() : CPropertiesDlg
  • onClearClick() : InkHitTest::InkHitTest
  • OnClearPicture() : CProppageUserUI , CExtPageUser
  • OnClick() : CEventSink , CLangBarItemButton
  • OnClickedAnimate() : CMMCControl
  • OnClickedRadio_COMPlusSync() : CMain
  • OnClickedRadio_Free() : CMain
  • OnClickedRadio_STA() : CMain
  • OnClickedStart() : CMain
  • OnClose() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg , CVCExploreDlg , CSpyCon , CBankDlg , CWndLite , CFrameWndLite , CMDIChild , CMDIObjects , CMDITrace , CDisdrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCSession , CRTCWin , CGenericUCPDlg , CBaseDialog , CMultiRecoApp , CSimpleDialog
  • OnCloseAll() : CMainWindow
  • OnCloseClick() : CGenericUCPDlg
  • OnCLSID() : CCompImportDlg
  • OnCmdMsg() : CMainFrame
  • OnColumnClick() : CListViewLite , CDataGrid
  • OnComboBitdepth() : CDlgDest
  • OnComboSamplerate() : CDlgDest
  • OnComboSpeaker() : CDlgSrc
  • OnComboWaveformat() : CDlgDest
  • OnCommand() : COleDocumentView , CFrame , CInterfaceDlg , CPropertiesDlg , CFullConnectProvider , CFullConnectProperties , CFullConnectSecurity , CFullConnectOptions , CConstraintDlg , CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg , CExecuteParamDlg , CWndLite , CMDIFrameLite , CMainWindow , CMDIChild , CObjTree , CMDIObjects , COptionsDataSource , COptionsRowset , COptionsError , CIntTrace , CMDITrace , CRTCAVSession , CRTCIMSession , CRTCWin , MainDlg , CCapMFCDlg , CCommBand , CDeskBand , CExplorerBar , CToolBand , CFileViewer , CShellView
  • OnCommandAgent() : CCapMFCDlg
  • OnCommandNotify() : CPropertiesDlg , CFullConnectProvider , CAlterColumnDlg , CWndLite , CMDIFrameLite , CListBoxLite , CComboBoxLite
  • OnCompareContentInformation() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnComponentSearch() : CCompInstallDlg
  • OnCompositionTerminated() : CMarkTextService
  • OnConfigDlgAdd() : CSettings
  • OnConfigDlgCommand() : CSettings
  • OnConfigDlgDestroy() : CSettings
  • OnConfigDlgEdit() : CSettings
  • OnConfigDlgInit() : CSettings
  • OnConfigDlgNotify() : CSettings
  • OnConfigDlgRemove() : CSettings
  • OnConnect() : CMainWindow , CDisdrawDlg , CImp_DrawDlg , CConnectDlg , CRTCOutgoingDlg , CAdvClientDlg , CWbemClientDlg
  • OnContextHelp() : CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • OnContextMenu() : CExecuteParamDlg , CWndLite , CQueryBox , CDataGrid , CObjTree , CIntTrace
  • OnCopy() : CBankDlg , CDlgIADs
  • OnCopyAll() : CBankDlg
  • OnCopyErrors() : CBankDlg
  • OnCreate() : CComSpy , COleDocumentView , CWndLite , CMDIFrameLite , CEditBoxLite , CRichEditLite , CListViewLite , CTreeViewLite , CTabLite , CMainWindow , CMDIChild , CMDIObjects , CMDITrace , CMainFrame , CTestView , CRTCAVSession , CRTCIMSession , CRTCSession , CRTCWin , CAdvRecoApp , CMultiRecoApp , CBrowserHost , CBasePropertyPage , CMainFrame , CShellView
  • OnCreateClient() : CMDIFrameLite
  • OnCreateFileMoniker() : CMainWindow
  • OnCreateRows() : CBankDlg
  • OnCreateTables() : CBankDlg
  • OnCRMAbort() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMAnalyze() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMBegin() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMCheckpoint() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMCommit() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMDeliver() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMDone() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMForce() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMForget() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMIndoubt() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMPrepare() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMRecoveryDone() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMRecoveryStart() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMRelease() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCRMWrite() : CComSpySqlAudit , CCRMSub , IComSpyAudit
  • OnCtlColor() : CDlgDest , CDlgSrc
  • OnCutOrMove() : CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • OnDataAvailable() : CUrlmonCallback , CDownloadBindStatusCallback
  • OnDataLinks() : CMainWindow
  • OnDblClickListView() : CDlgIDirectorySearch
  • OnDblClk() : CListBoxLite
  • OnDblclk() : CWndLite , CObjTree
  • OnDblclkAnimations() : CCapMFCDlg
  • OnDblClkAttrValue() : CDlgIADs
  • OnDblClkChildrenList() : CDlgIADsContainer
  • OnDblClkInterfaces() : CADQIDlg
  • OnDblclkPartylist() : CRTCOutgoingDlg
  • OnDblclkQuerySession() : CQueryDlg
  • OnDeactivate() : CShellView
  • OnDebugApplication() : CComSpy
  • OnDefOperation() : CBase , CBinder , CServiceComp , CDataLinks , CEnumerator , CStream
  • OnDelete() : CStaticNode , CVirtualFile , CDelegationBase , CRocket , CAttributeValueDeleteButton , CDlgIADsContainer , CDlgIDirectoryObject , CDelegationBase , CRocket , CDelegationBase , CRocket , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode
  • OnDeleteScopeItem() : CDelegationBase , CSpaceStation
  • OnDeleteValue() : CMultiValuedAttributeEditor
  • OnDelParameter() : CExecuteParamDlg
  • OnDelSet() : CExecuteParamDlg
  • OnDestroy() : CComSpy , CBankDlg , CWndLite , CFrameWndLite , CMDIFrameLite , CMainWindow , CMDIChild , CMDIObjects , CMDITrace , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI , CRTCAVSession , CRTCIMSession , CRTCSession , CRTCWin , CBaseDialog , CAdvRecoApp , CMultiRecoApp , CSimpleDialog , CBrowserHost , MainDlg , CBasePropertyPage , CShellView
  • OnDestroyDlg() : CSelectEventsDlg
  • OnDevpropClick() : CGenericUCPDlg
  • OnDisableCommit() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnDisconnect() : CMainWindow , CRTCIncomingDlg , CRTCOutgoingDlg
  • OnDisconnectSession() : CSessionDlg
  • OnDiscoveryClicked() : CGenericUCPDlg
  • OnDiskdetails() : CAdvClientDlg
  • OnDiskinfo() : CWbemClientDlg
  • OnDiskPropsDescriptions() : CAdvClientDlg
  • OnDNSNameChange() : CSCPPageGeneral
  • OnDNSNameTypeChange() : CSCPPageGeneral
  • OnDocumentComplete() : CWebBrowser
  • OnDocWindowActivate() : COleInPlaceActiveObject
  • OnDownloadBegin() : CWebBrowser
  • OnDownloadComplete() : CWebBrowser
  • OnDownloadContentFinished() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnDownloadContentProgress() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnDownloadControl() : CWebBrowser
  • OnDraw() : CPrintSDIView , CTestView , CAnnotator , CAPIView
  • OnDrawAdvanced() : CComSpy
  • OnDropDown() : CFullConnectProvider , CComboBoxLite
  • OnDropdownServerList2() : CServerDlg
  • OnDropFiles() : CWndLite , CMainWindow , MainDlg , CCapMFCDlg
  • OnEasterEgg() : CAboutDlg
  • OnEdit() : CAttributeValueEditButton
  • OnEditChange() : CMultiValuedAttributeEditor
  • OnEditupdateFormatnameCombo2() : COpenQueueDialog
  • OnEditupdatePathnameCombo() : COpenQueueDialog
  • OnEditValidbits() : CDlgDest
  • OnEmployeeIDChange() : CProppageUserUI
  • OnEnableCommit() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnEnabled() : CDlgIDirectorySearch
  • OnEndCleanupContext() : CMarkTextService
  • OnEndComposition() : CTSFEditWnd
  • OnEndEdit() : CCaseTextService , CMarkTextService
  • OnEndLabelEdit() : CTreeViewLite
  • OnEndPrinting() : CPrintSDIView
  • OnEnumdisks() : CAdvClientDlg , CWbemClientDlg
  • OnEnumservices() : CAdvClientDlg
  • OnEnumservicesasync() : CAdvClientDlg
  • OnErase() : CSpyCon
  • OnError() : CSCPWiz , CWizExtUser
  • OnEvent() : CContextPlugin
  • OnExceptionUser() : CComSpySqlAudit , CExceptionSub , IComSpyAudit
  • OnExecute() : CDlgIDirectorySearch
  • OnExit() : CSpyCon , CADVCGENDlg , CAdvRecoApp , CMultiRecoApp
  • OnExpand() : CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CBackgroundFolder , CDelegationBase , CPeoplePoweredVehicle , CSpaceFolder , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBackgroundFolder , CDelegationBase , CPeoplePoweredVehicle , CSpaceFolder , CStaticNode , CDelegationBase , CComponentData , CBackgroundFolder , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode , CDelegationBase , CPeoplePoweredVehicle , CStaticNode
  • OnExportClients() : CAppExportDlg
  • OnExportPathSearch() : CAppExportDlg
  • OnExportUsers() : CAppExportDlg
  • OnExportWithoutUsers() : CAppExportDlg
  • OnFieldChange() : CListener
  • OnFileExit() : CCapMFCDlg
  • OnFileFax() : CPrintSDIView
  • OnFileOpen() : CChildView , CMultiRecoApp , CCapMFCDlg
  • OnFileSave() : CChildView , CMultiRecoApp
  • OnFinalRelease() : CCapMFCDlg
  • OnFindByType() : CGenericUCPDlg
  • OnFindbyUDN() : CGenericUCPDlg
  • OnFindConnectionPoint() : CMainWindow
  • OnFrameWindowActivate() : COleInPlaceActiveObject
  • OnFromScannerOrCamera() : CMainWindow
  • OnGesture() : CAdvRecoApp
  • OnGet() : CDlgIADs , CDlgIADsPropertyList , CDlgIDirectoryObject
  • OnGetConnectionInterface() : CMainWindow
  • OnGetContentInformation() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • OnGetDataSource() : CMainWindow
  • OnGetEx() : CDlgIADs
  • OnGetInfo() : CDlgIADs
  • OnGetInfoex() : CDlgIADs
  • OnGetStatus() : CMainWindow
  • OnGo() : CBankDlg
  • OnGuide() : CAdvRecoApp
  • OnHandleClosing() : ASYNC_REQUESTER
  • OnHeadersAvailable() : ASYNC_REQUESTER
  • OnHeartbeat() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • OnHelpAbout() : CCapMFCDlg
  • OnHScroll() : CWndLite , CRTCAVSession
  • OnIdle() : CClientApp
  • OnIISRequestInfo() : CComSpySqlAudit , CIdentitySub , IComSpyAudit
  • OnInit()
: InkBlog::AddBlog
, InkBlog::_Default
  • OnInitDialog() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg , CAboutDlg , CVCExploreDlg , CComSpyPropPage , CSelectEventsDlg , CClientDlg , CMain , CBankDlg , CTestDlg , CADVCGENDlg , CInterfaceDlg , CEditValueDlg , CPropertiesDlg , CFullConnectProvider , CFullConnectProperties , CFullConnectSecurity , CFullConnectOptions , CMultipleResultsDlg , CConstraintDlg , CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg , CExecuteParamDlg , CDialogLite , CAboutDlg , COptionsDataSource , COptionsCommand , COptionsAccessor , COptionsRowset , COptionsNotify , COptionsError , CDlgDest , CDlgSrc , CContextSamplePropPage , CSCPCMenuDialog , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CSCPPageGeneral , CSCPPageBindingInfo , CSCPPageKeywords , CProppageUserUI , CExtPageUser , CADQIDlg , CDlgIADs , CDlgIADsContainer , CRenameDlg , CDlgIADsLargeInteger , CDlgIADsOpenDSObject , CDlgIADsPropertyList , CDlgIDirectoryObject , CDlgIDirectorySearch , CDlgIADsSecurityDescriptor , CDisdrawDlg , CImp_DrawDlg , CCloseQueueDialog , CDeleteQueueDialog , COpenQueueDialog , CReceiveMessageDialog , CSendMessageDialog , CConnectDlg , CDisdrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CDeviceProp , CGenericUCPDlg , CAddDeviceDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddFolderDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAdvClientDlg , CCmdLineConsumerDlg , CPermEventsDlg , CWbemClientDlg , CSimpleDialog , AboutDlg , MainDlg , CAboutDlg , CCapMFCDlg , CXMLTreeDlg , CBasePropertyPage , CClipBookServerParamsPage , CBasePropertyPage , CFileShareSampleParamsPage , CMessageDlg , CProcessDlg , CQueryDlg , CServerDlg , CSessionDlg , CShutdownDlg , CWaitSystemDlg
  • OnInitDocumentMgr() : CCaseTextService , CMarkTextService
  • OnInitialize() : CMainWindow
  • OnInitialUpdate() : CComboBoxString , CWndLite , CComboBoxEx , CWebBrowser , CMainWindow , CMDIChild , CMDIObjects , CMDITrace
  • OnInitMenu() : CSpyCon , CComSpy , CBankDlg
  • OnInitMenuPopup() : CWndLite , CMainWindow , MainDlg , CCapMFCDlg
  • OnInitPropPage() : CVirtualFile , CExtendPropertySheet
  • OnInPlaceActivate() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • OnInPlaceDeactivate() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • OnInputScope() : CAdvRecoApp
  • OnInputScopeCoerce() : CAdvRecoApp
  • OnInstallDirSearch() : CAppInstallDlg
  • OnInstallWithoutUsers() : CAppInstallDlg
  • OnInstallWithUsers() : CAppInstallDlg
  • OnInvokeAction() : CGenericUCPDlg
  • OnIoCompletion() : CSampleDataContainer
  • OnItemActivate() : CListViewLite , CDataGrid
  • OnItemChanged() : CListViewLite
  • OnItemConfigDlgApply() : CSettings
  • OnItemConfigDlgCommand() : CSettings
  • OnItemConfigDlgDestroy() : CSettings
  • OnItemConfigDlgInit() : CSettings
  • OnItemConfigDlgNotify() : CSettings
  • OnJNEC() : CUtilitiesDlg
  • OnKeyDown() : CInitStringBox , CDSLContextBox , CWndLite , CQueryBox , CDataGrid , CObjTree , CDrawArea , CCaseTextService , CMarkTextService
  • OnKeydown() : CBrowserHost
  • OnKeyUp() : CCaseTextService , CMarkTextService
  • OnKillActive() : CFullConnectProvider , CFullConnectProperties , CFullConnectSecurity , CFullConnectOptions , CPropPageLite , CSCPPageGeneral , CSCPPageBindingInfo , CSCPPageKeywords , CExtPageUser
  • OnKillFocus() : CCommBand , CDeskBand , CExplorerBar , CToolBand , CShellView
  • OnKillThreadFocus() : CCaseTextService
  • OnKillThreads() : CBankDlg
  • OnLButtonDblClk() : CDrawArea
  • OnLButtonDown() : CWndLite , CDlgDest , CDlgSrc , CDrawArea
  • OnLButtonUp() : CWndLite , CTreeViewLite , CDlgDest , CDlgSrc
  • OnLink() : CRichEditLite
  • OnListDblClick() : CapJ
  • OnListpad() : CDelegationBase , CBicycleFolder , CIceSkateFolder
  • OnLoad() : CXMLTreeDlg
  • OnLoadRecentConfig() : CMainWindow
  • OnLoadRecentFile() : CMainWindow
  • OnLoadStringFromStorage() : CMainWindow
  • OnLocalComputer() : CConnectDlg
  • OnLogFileChange() : CComSpyPropPage
  • OnLoggedOff() : CRTCWin
  • OnLoggedOn() : CRTCWin
  • OnLoggingOff() : CRTCWin
  • OnLoggingOn() : CRTCWin
  • OnLogoffSession() : CSessionDlg
  • OnLogToFile() : CSpyCon , CComSpy
  • OnLowResource() : CUrlmonCallback , CListener , CDownloadBindStatusCallback , CAsynchNotify
  • OnLVColumnClick() : CAdvRecoApp
  • OnLVItemChanging() : CAdvRecoApp
  • OnMakeoffice() : CWbemClientDlg
  • OnMDIActivate() : CMDIChildLite , CMDIChild , CMDIObjects , CMDITrace
  • OnMenuButtonCommand() : CDelegationBase , CRocket
  • OnMenuCommand() : CDelegationBase , CLandBasedVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CDelegationBase , CSpaceVehicle , CDelegationBase , CPlane , CSkyVehicle
  • OnMenuSelect() : CWndLite , CMainWindow , CLangBarItemButton
  • OnMethodCall() : CComSpySqlAudit , CMethodSub , IComSpyAudit
  • OnMethodException() : CComSpySqlAudit , CMethodSub , IComSpyAudit
  • OnMethodReturn() : CComSpySqlAudit , CMethodSub , IComSpyAudit
  • OnMixerMerge() : CChildView
  • OnMixerPlay() : CChildView , CMainFrame
  • OnMixerStop() : CChildView
  • OnMode() : CAdvRecoApp
  • onMouseMove() : InkHitTest::InkHitTest
  • OnMouseMove() : CWndLite , CTreeViewLite , CDlgDest , CDlgSrc , CDrawArea
  • OnMouseOut() : CEventSink
  • OnMouseOver() : CEventSink
  • OnMove() : CCapMFCDlg , CWndLite , CDlgIADsContainer
  • OnMoveAgent() : CCapMFCDlg
  • OnNameChange() : CSCPPageGeneral
  • OnNavigateComplete() : CWebBrowser
  • OnNCButtonDown() : CWndLite , CSplitterLite
  • OnNcDestroy() : CBaseDialog , CSimpleDialog
  • OnNCDestroy() : CSpyCon , CBrowserHost
  • OnNCMouseMove() : CWndLite , CSplitterLite
  • OnNewDocument() : CPrintSDIDoc , CTestDoc
  • OnNewStrokes() : CMultiRecoApp
  • OnNextWindow() : CMainWindow
  • OnNotify() : CPropertiesDlg , CExecuteParamDlg , CWndLite , CFrameWndLite , CMDIFrameLite , CRichEditLite , CListViewLite , CTreeViewLite , CTabLite , CMDIChild , CMDIObjects , CMDITrace , CRTCWin , CShellView
  • OnNotifyBeginUserSession() : CContextPlugin
  • OnNotifyCache() : CContextPlugin
  • OnNotifyClose() : CContextPlugin
  • OnNotifyConnect() : CContextPlugin
  • OnNotifyCreateDistributionDataPath() : CContextPlugin
  • OnNotifyDescribe() : CContextPlugin
  • OnNotifyDestroyDistributionDataPath() : CContextPlugin
  • OnNotifyDisconnect() : CContextPlugin
  • OnNotifyEndUserSession() : CContextPlugin
  • OnNotifyGetParameter() : CContextPlugin
  • OnNotifyLimitChange() : CContextPlugin
  • OnNotifyLimitHit() : CContextPlugin
  • OnNotifyLog() : CContextPlugin
  • OnNotifyOpen() : CContextPlugin
  • OnNotifyPause() : CContextPlugin
  • OnNotifyPlay() : CContextPlugin
  • OnNotifyPlaylist() : CContextPlugin
  • OnNotifyPlugin() : CContextPlugin
  • OnNotifyPublishingPoint() : CContextPlugin
  • OnNotifyRemoteCacheClose() : CContextPlugin
  • OnNotifyRemoteCacheLog() : CContextPlugin
  • OnNotifyRemoteCacheOpen() : CContextPlugin
  • OnNotifySelectStreams() : CContextPlugin
  • OnNotifyServer() : CContextPlugin
  • OnNotifySetParameter() : CContextPlugin
  • OnNotifyStop() : CContextPlugin
  • OnNotifyValidatePushDistribution() : CContextPlugin
  • OnObjectActivate() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnObjectAvailable() : CUrlmonCallback , CDownloadBindStatusCallback
  • OnObjectConstruct() : CComSpySqlAudit , CObjConstSub , IComSpyAudit
  • OnObjectCreate() : CComSpySqlAudit , CInstanceSub , IComSpyAudit
  • OnObjectDeactivate() : CComSpySqlAudit , CObjSub , IComSpyAudit
  • OnObjectDestroy() : CComSpySqlAudit , CInstanceSub , IComSpyAudit
  • OnObjectsWindow() : CMainWindow
  • OnObjPoolCreateDecision() : CComSpySqlAudit , CObjPool2Sub , IComSpyAudit
  • OnObjPoolCreateObject() : IComSpyAudit , CComSpySqlAudit , CObjPool2Sub
  • OnObjPoolCreatePool() : CComSpySqlAudit , CObjPool2Sub , IComSpyAudit
  • OnObjPoolDestroyObject() : CComSpySqlAudit , CObjPool2Sub , IComSpyAudit
  • OnObjPoolGetFromTx() : CObjPoolSub , CComSpySqlAudit , IComSpyAudit
  • OnObjPoolGetObject() : CComSpySqlAudit , CObjPoolSub , IComSpyAudit
  • OnObjPoolPutObject() : CComSpySqlAudit , CObjPoolSub , IComSpyAudit
  • OnObjPoolRecycleToTx() : CComSpySqlAudit , CObjPoolSub , IComSpyAudit
  • OnObjPoolTimeout() : CObjPool2Sub , CComSpySqlAudit , IComSpyAudit
  • OnOK() : CAddVFileDlg , CAddDeviceDlg , CDlgIADsOpenDSObject , CDlgIADsContainer , CAlterColumnDlg , CMultipleResultsDlg , CBankDlg , CAppInstallDlg
  • OnOk() : CDeviceProp
  • OnOK() : CAppExportDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg , CSelectEventsDlg , CClientDlg , CInterfaceDlg , CEditValueDlg , CPropertiesDlg , CConstraintDlg , CAlterIndexDlg , CAlterTableDlg , CExecuteParamDlg , CDialogLite , CPropPageLite , CDlgDest , CDlgSrc , CADQIDlg , CGetInfoExDlg , CRenameDlg , CMoveDlg , CDlgIADsLargeInteger , CDeleteObjectDlg , CDlgIDirectorySearch , CSendMessageDialog , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddFolderDlg , CAddVFileDlg , CBaseDialog , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CBaseDialog , CSimpleDialog , CXMLTreeDlg , CServerDlg , CWaitSystemDlg
  • OnOpen() : CXMLTreeDlg
  • OnOptions() : CMainWindow
  • OnOverwriteFiles() : CAppInstallDlg , CAppExportDlg
  • OnPaint() : CVCExploreDlg , COleDocumentView , CADVCGENDlg , CChildView , CBitmapWnd , CDrawArea , CDisdrawDlg , CDrawArea , CImp_DrawDlg , CDrawArea , CDisdrawDlg , CRTCIncomingDlg , CGenericUCPDlg , CCmdLineConsumerDlg , CPermEventsDlg , CInkInputWnd , CRecoOutputWnd , CInkInputWnd , CXMLTreeDlg , CAPIView , CCommBand , CDeskBand , CExplorerBar , CToolBand , CCapMFCDlg , CWbemClientDlg , CRTCOutgoingDlg , CADQIDlg , CClientDlg
  • OnParentPath() : CDlgIADs
  • OnPaste() : CSpaceStation , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile , CDelegationBase , CFolderNode
  • OnPcpcradio() : CRTCOutgoingDlg
  • OnPcphradio() : CRTCOutgoingDlg
  • OnPermRegister() : CAdvClientDlg
  • OnPermUnregister() : CAdvClientDlg
  • OnPhphradio() : CRTCOutgoingDlg
  • OnPlay() : CDlgDest , CDlgSrc , CCapMFCDlg
  • OnPopContext() : CCaseTextService , CMarkTextService
  • OnPosRectChange() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • OnPreparePrinting() : CPrintSDIView
  • OnPreservedKey() : CCaseTextService , CMarkTextService
  • OnProcess() : CAPIDoc
  • OnProgID() : CCompImportDlg
  • OnProgress() : CUrlmonCallback , CListener , CDownloadBindStatusCallback , CAsynchNotify
  • OnPromptDataSource() : CMainWindow
  • OnPromptFileName() : CMainWindow
  • OnPropertyChange() : CSCPUIGeneral , CSCPUIKeywords , CDelegationBase , CRocket , CDelegationBase , CBicycle , CRocket , MainDlg , CDelegationBase , CSCPUIBindingInfo
  • OnPropOptionsChange() : CPropertiesDlg
  • OnPropSetChange() : CPropertiesDlg
  • OnPropTypeChange() : CPropertiesDlg
  • OnPropValueChange() : CPropertiesDlg
  • OnProxyStubDll() : CCompInstallDlg
  • OnPurge() : CDlgIADsPropertyList
  • OnPushContext() : CMarkTextService , CCaseTextService
  • OnPut() : CDlgIADs
  • OnPutEx() : CDlgIADs
  • OnQCMoveToDeadQueue() : CQCSub , IComSpyAudit , CComSpySqlAudit
  • OnQCMoveToReTryQueue() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQCPlayback() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQCQueueOpen() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQCReceive() : CQCSub , IComSpyAudit , CComSpySqlAudit
  • OnQCReceiveFail() : CComSpySqlAudit , IComSpyAudit , CQCSub
  • OnQCRecord() : CComSpySqlAudit , CQCSub , IComSpyAudit
  • OnQuery() : CQueryDlg
  • OnQueryDragIcon() : CVCExploreDlg , CClientDlg , CADQIDlg , CDisdrawDlg , CImp_DrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CGenericUCPDlg , CPermEventsDlg , CWbemClientDlg , CCapMFCDlg , CXMLTreeDlg , CCmdLineConsumerDlg , CDisdrawDlg , CADVCGENDlg
  • OnQueryInterface() : CMainWindow
  • OnQueryPaste() : CDelegationBase , CSpaceStation , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CVirtualFile
  • OnQuerySession() : CSessionDlg
  • OnQueryVariable() : CGenericUCPDlg
  • OnRadioPrivatequeue() : CDisdrawDlg
  • OnRadioPublicqueue() : CDisdrawDlg
  • OnRandom() : CBankDlg
  • OnRButtonDown() : CComSpy , CWndLite , CQueryBox , CDataGrid , CObjTree , CIntTrace
  • OnRButtonUp() : CDrawArea , CWndLite
  • OnReadComplete() : ASYNC_REQUESTER
  • OnRecentFile() : MainDlg , CCapMFCDlg , CapJ
  • OnRecognition() : CMultiRecoApp
  • OnRecognitionWithAlternates() : CAdvRecoApp , IInkRecognitionEventsImpl< T >
  • OnRecognize() : CAdvRecoApp
  • OnRecognizer() : CAdvRecoApp
  • OnRefresh() : CUtilitiesDlg , CDelegationBase , CRocket , CDelegationBase , CRocket , CBackgroundFolder , CRocket , CBackgroundFolder , CDelegationBase , CSessionDlg , CBackgroundFolder , CProcessDlg , CDelegationBase
  • OnRegPerm() : CAdvClientDlg
  • OnRegTemp() : CAdvClientDlg
  • OnRelease() : CMainWindow
  • OnReleaseAll() : CMainWindow
  • OnRemix() : CDlgDest
  • OnRemoteComputer() : CConnectDlg
  • OnRemoteServerInstall() : CAppInstallDlg
  • OnRemove() : CBankDlg
  • OnRemoveChildren() : CBaseNode , CDeviceNode , CStaticNode , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CStaticNode , CVirtualFile , CFolderNode
  • OnRemoveparty() : CRTCOutgoingDlg
  • OnRename() : CDelegationBase , CRocket , CDelegationBase , CRocket , CBaseNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CDelegationBase , CRocket , CDelegationBase , CRocket , CDelegationBase , CRocket , CDelegationBase , CRocket , CVirtualFile , CDelegationBase , CStaticNode , CDeviceNode , CRocket , CDlgIADsContainer
  • OnRequesterClosed() : SIMPLE_BROWSER
  • OnRequestError() : ASYNC_REQUESTER
  • OnRequesterStopped() : SIMPLE_BROWSER
  • OnReset() : CPropPageLite
  • OnResize() : InkBlog::InkArea , CGrid , CBehavior
  • OnResourceAllocate() : CComSpySqlAudit , CResourceSub , IComSpyAudit
  • OnResourceCreate() : CComSpySqlAudit , CResourceSub , IComSpyAudit
  • OnResourceDestroy() : CComSpySqlAudit , IComSpyAudit , CResourceSub
  • OnResourceRecycle() : CComSpySqlAudit , CResourceSub , IComSpyAudit
  • OnResourceTrack() : CComSpySqlAudit , CResourceSub , IComSpyAudit
  • OnResponse() : CUrlmonCallback
  • OnRetryOnErrors() : CBankDlg
  • OnRootBinder() : CMainWindow
  • OnRootEnumerator() : CMainWindow
  • OnRouter() : CUtilitiesDlg
  • OnRowChange() : CListener
  • OnRowPositionChange() : CListener
  • OnRowsetChange() : CListener
  • OnRTCBuddyEvent() : CRTCWin
  • OnRTCClientEvent() : CRTCWin
  • OnRTCEvent() : CRTCWin
  • OnRTCIntensityEvent() : CRTCWin
  • OnRTCMediaEvent() : CRTCWin
  • OnRTCMessagingEvent() : CRTCWin
  • OnRTCParticipantStateChangeEvent() : CRTCWin
  • OnRTCRegistrationStateChangeEvent() : CRTCWin
  • OnRTCSessionStateChangeEvent() : CRTCWin
  • OnRTCWatcherEvent() : CRTCWin
  • OnRunSuite() : CBankDlg
  • OnRunTest() : CAPIDoc
  • OnSave() : CComSpy , CBankDlg , CSpyCon
  • OnSaveNow() : CSpyCon
  • OnSchemaPath() : CDlgIADs
  • OnSelChange() : CMultiValuedListBox , CAlterColumnDlg , CPropertiesDlg , CTabLite , CComboBoxLite , CFullConnectProvider
  • OnSelChangeAceList() : CDlgIADsSecurityDescriptor
  • OnSelChangeAttrList() : CDlgIADs
  • OnSelChanged() : CTreeViewLite
  • OnSelchangeFormatnameCombo2() : COpenQueueDialog
  • OnSelChangeObjects() : CVCExploreDlg
  • OnSelChangeParentCollections() : CVCExploreDlg
  • OnSelchangePartylist() : CRTCOutgoingDlg
  • OnSelchangePathnameCombo() : COpenQueueDialog
  • OnSelChangeProperties() : CVCExploreDlg
  • OnSelChangeRelatedCollections() : CVCExploreDlg
  • OnSelchangeTargetCombo() : CSendMessageDialog
  • OnSelChanging() : CTabLite
  • OnSelect() : CRocket , CDelegationBase , CRocket , CDeviceNode , CBaseNode , CVirtualFile , CFolderNode , CDeviceNode , CVirtualFile , CStaticNode , CDelegationBase , CBackgroundFolder , CDelegationBase , CBaseNode , CStaticNode , CRocket , CSpaceStation , CDelegationBase , CBaseNode , CFolderNode , CBaseNode , CFolderNode , CDeviceNode , CFolderNode , CBaseNode , CVirtualFile , CDeviceNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBackgroundFolder , CDelegationBase , CSpaceStation , CBackgroundFolder , CDelegationBase , CIceSkate , CIceSkateFolder , CDelegationBase , CRocket , CDelegationBase , CDeviceNode , CBaseNode , CStaticNode , CVirtualFile , CStaticNode , CFolderNode , CStaticNode , CBaseNode , CStaticNode , CRocket , CBicycle , CRocket
  • OnSelectAccount() : CBankDlg
  • OnSelectAllApps() : CSelectEventsDlg
  • OnSelectApplications() : CComSpy
  • OnSelectChattyDisplay() : CBankDlg
  • OnSelectCoInit() : CBankDlg
  • OnSelectColumn() : CComSpyPropPage
  • OnSelectCreatePerIteration() : CBankDlg
  • OnSelectFilter() : CSpyCon
  • OnSelectLanguage() : CBankDlg
  • OnSelectMoveMoney() : CBankDlg
  • OnSelEndOkComboDevice() : CGenericUCPDlg
  • OnSelEndOkComboService() : CGenericUCPDlg
  • OnSendMessage() : CAPIDoc , CMessageDlg
  • OnSendRequestComplete() : ASYNC_REQUESTER
  • OnServiceClassChange() : CSCPPageGeneral
  • OnServiceComponents() : CMainWindow
  • OnSession() : CAPIDoc
  • OnSet() : CDlgIADsContainer
  • OnSetAbort() : IComSpyAudit , CObjSub , CComSpySqlAudit
  • OnSetActive() : CSCPPageKeywords , CSCPPageBindingInfo , CFullConnectOptions , CFullConnectProperties , CFullConnectSecurity , CSCPPageGeneral , CBasePropertyPage , CFullConnectProvider , CPropPageLite , CExtPageUser , CFileShareSampleParamsPage , CClipBookServerParamsPage
  • OnSetComplete() : IComSpyAudit , CObjSub , CComSpySqlAudit
  • OnSetCursor() : CDrawArea , CWndLite
  • OnSetFocus() : CMainFrame , CMarkTextService , CDeskBand , CCommBand , CCaseTextService , CMDITrace , CMDIObjects , CMDIChild , CDrawArea , CAPIView , CToolBand , CShellView , CMarkTextService , CWndLite , CAdvRecoApp , CExplorerBar , CDrawArea , CCaseTextService
  • OnSetFocusAnimations() : CCapMFCDlg
  • OnSetfocusEditValidbits() : CChildView
  • OnSetFocusMoveX() : CCapMFCDlg
  • OnSetFocusMoveY() : CCapMFCDlg
  • OnSetFocusSpeakText() : CCapMFCDlg
  • OnSetInfo() : CDlgIADs
  • OnSetMenuButton() : CRocket , CDelegationBase
  • OnSetProperty() : CVCExploreDlg
  • OnSetsession() : CSessionDlg
  • OnSetThreadFocus() : CCaseTextService
  • OnSettingChange() : CShellView
  • OnSetToolbar() : CRocket , CDelegationBase
  • OnSfx() : CCapMFCDlg
  • OnShow() : CBaseNode , CBicycleFolder , CSkateboardFolder , CDeviceNode , CStaticNode , CFolderNode , CDelegationBase , CBaseNode , CDeviceNode , CVirtualFile , CFolderNode , CSpaceVehicle , CFolderNode , CSkateboardFolder , CStaticNode , CIceSkateFolder , CDeviceNode , CVirtualFile , CSkateboardFolder , CDelegationBase , CBaseNode , CSpaceVehicle , CSkateboardFolder , CIceSkateFolder , CBicycleFolder , CSpaceStation , CSkyBasedVehicle , CSkateboardFolder , CBicycleFolder , CSpaceVehicle , CSkateboardFolder , CDelegationBase , CDeviceNode , CStaticNode , CFolderNode , CBicycleFolder , CDelegationBase , CIceSkateFolder , CBicycleFolder , CSkyBasedVehicle , CSpaceVehicle , CDelegationBase , CIceSkateFolder , CBicycleFolder , CIceSkateFolder , CDelegationBase , CSpaceVehicle , CBaseNode , CStaticNode , CDeviceNode , CStaticNode , CBaseNode , CVirtualFile , CBaseNode , CStaticNode , CFolderNode , CVirtualFile , CStaticNode , CVirtualFile , CSkateboardFolder , CDelegationBase , CSkateboardFolder , CDelegationBase , CBicycleFolder , CSpaceVehicle , CIceSkateFolder , CDelegationBase , CSpaceVehicle , CDelegationBase , CBicycleFolder , CIceSkateFolder , CSkateboardFolder , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CSpaceVehicle , CBicycleFolder , CIceSkateFolder , CSkyBasedVehicle , CSpaceVehicle , CSkyVehicle , CBicycleFolder , CIceSkateFolder , CSpaceStation
  • OnShowContextHelp() : CDelegationBase , CStaticNode , CDelegationBase
  • OnShowError() : CBankDlg
  • OnShowResults() : CBankDlg
  • OnShowWindow() : CImpIOleClientSite , COleClient , CBrowserHost , CSpyCon
  • OnShutdown() : CShutdownDlg
  • OnShutdownSystem() : CAPIDoc
  • OnSize() : CMultiRecoApp , CToolBand , CRTCIMSession , CSpyCon , CBankDlg , CMainWindow , CShellView , CMDITrace , CRTCWin , CBrowserHost , CAdvRecoApp , CBrowserHost , CDeskBand , CRTCAVSession , CRTCSession , CDataGrid , CMDIChild , CMDIObjects , CMain , CWndLite , CBrowserHost
  • OnSizing() : CMDIChild , CWndLite
  • OnSpeak() : MainDlg , CCapMFCDlg
  • OnStart() : CUtilitiesDlg , CClientDlg
  • OnStartBinding() : CUrlmonCallback , CDownloadBindStatusCallback
  • OnStartCleanupContext() : CMarkTextService
  • OnStartComposition() : CTSFEditWnd
  • OnStatusChange() : CExecuteParamDlg
  • OnStop() : CBankDlg , CDlgSrc , CListener , CUtilitiesDlg , CAsynchNotify , CDlgDest , CCapMFCDlg
  • OnStopBinding() : CDownloadBindStatusCallback , CUrlmonCallback
  • OnStopOnODBCErrors() : CBankDlg
  • OnStroke() : CAdvRecoApp , CMultiRecoApp
  • OnSupportErrorInfo() : CMainWindow
  • OnSysCommand() : CXMLTreeDlg , CCapMFCDlg , CCmdLineConsumerDlg , CPermEventsDlg , CRTCOutgoingDlg , CWndLite , CAdvClientDlg , MainDlg , CSpyCon , CRTCIncomingDlg , CVCExploreDlg , CGenericUCPDlg , CADVCGENDlg , CWbemClientDlg
  • OnSysKeyDown() : CWndLite
  • OnTBtnAbout() : CVCExploreDlg
  • OnTBtnConnect() : CVCExploreDlg
  • OnTBtnDelete() : CVCExploreDlg
  • OnTBtnExportApp() : CVCExploreDlg
  • OnTBtnImportComponent() : CVCExploreDlg
  • OnTBtnInstallApp() : CVCExploreDlg
  • OnTBtnInstallComponent() : CVCExploreDlg
  • OnTBtnNew() : CVCExploreDlg
  • OnTBtnRefresh() : CVCExploreDlg
  • OnTBtnSave() : CVCExploreDlg
  • OnTBtnStartApp() : CVCExploreDlg
  • OnTBtnStopApp() : CVCExploreDlg
  • OnTBtnUtility() : CVCExploreDlg
  • OnTempRegister() : CAdvClientDlg
  • OnTempUnregister() : CAdvClientDlg
  • OnTerminateProcess() : CProcessDlg
  • OnTestKeyDown() : CCaseTextService , CMarkTextService
  • OnTestKeyUp() : CMarkTextService , CCaseTextService
  • OnTextUpdated() : CCustomPropertyStore
  • OnThreadAssignApartment() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadBindToApartment() : IComSpyAudit , CComSpySqlAudit , CThreadSub
  • OnThreadStart() : CComSpySqlAudit , CThreadSub , IComSpyAudit
  • OnThreadTerminate() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadUnassignApartment() : IComSpyAudit , CThreadSub , CComSpySqlAudit
  • OnThreadUnBind() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadWorkEnque() : CThreadSub , IComSpyAudit , CComSpySqlAudit
  • OnThreadWorkPrivate() : CComSpySqlAudit , IComSpyAudit , CThreadSub
  • OnThreadWorkPublic() : CComSpySqlAudit , CThreadSub , IComSpyAudit
  • OnThreadWorkRedirect() : CThreadSub , CComSpySqlAudit , IComSpyAudit
  • OnThreadWorkReject() : IComSpyAudit , CThreadSub , CComSpySqlAudit
  • OnTile() : CMainWindow
  • OnTimer() : CTestDlg , CWndLite , CMain
  • OnToggleAudit() : CComSpy
  • OnToggleGridLines() : CComSpy , CSpyCon
  • OnToggleSaveOnExit() : CSpyCon
  • OnToggleShowOnScreen() : CComSpy , CSpyCon
  • OnToolbarCommand() : CDelegationBase , CRocket
  • OnToolTip() : CFrameWndLite
  • OnTraceWindow() : CMainWindow
  • OnTransactionAbort() : CTxSub
  • OnTransactionAborted() : IComSpyAudit , CComSpySqlAudit
  • OnTransactionCommit() : CTxSub , CComSpySqlAudit , IComSpyAudit
  • OnTransactionPrepare() : CTxSub
  • OnTransactionPrepared() : CComSpySqlAudit , IComSpyAudit
  • OnTransactionStart() : CTxSub , IComSpyAudit , CComSpySqlAudit
  • OnTune() : CRTCOutgoingDlg
  • OnTypeLibrary() : CCompInstallDlg
  • OnUIActivate() : CBrowserHost , CSpyCon , COleClient , CImpIOleInPlaceSite , CBrowserHost
  • OnUIDeactivate() : CBrowserHost , CSpyCon , CBrowserHost , COleClient , CImpIOleInPlaceSite
  • OnUnadvise() : CMainWindow
  • OnUninitDocumentMgr() : CCaseTextService , CMarkTextService
  • OnUninitialize() : CMainWindow
  • OnUpdate() : CInterfaceDlg
  • OnUpdateCommand() : CMDIFrameLite , CMDIObjects , CMDITrace , CMainWindow , CMDIChild , CWndLite , CObjTree , CIntTrace
  • OnUpdateComposition() : CTSFEditWnd
  • OnUpdateFileSave() : CChildView
  • OnUpdateFrameTitle() : CMainFrame
  • OnUpdateItem() : CDelegationBase , CSpaceStation , CDelegationBase , CRocket , CSpaceStation , CRocket , CDelegationBase
  • OnUpdateMixerMerge() : CChildView
  • OnUpdateMixerPlay() : CMainFrame , CChildView
  • OnUpdateMixerStop() : CChildView
  • OnUpdateOutputSelected() : CIntTrace
  • OnUsePing() : CClientDlg
  • OnUserconfig() : CAPIDoc
  • OnUserEvent() : CUserSub
  • OnValueSelChange() : CMultiValuedAttributeEditor
  • OnView() : CDlgIADsContainer
  • OnViewChange() : CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CBaseNode , CDeviceNode , CBaseNode , CVirtualFile , CFolderNode , CBaseNode , CFolderNode , CStaticNode , CVirtualFile
  • OnViewDetails() : CShellView
  • OnViewLarge() : CShellView
  • OnViewList() : CShellView
  • OnViewNext() : CBankDlg
  • OnViewPrev() : CBankDlg
  • OnViewSmall() : CShellView
  • OnVirtualChannel() : CSessionDlg
  • OnVScroll() : CDataGrid , CWndLite
  • OnWaitEvent() : CAPIDoc
  • OnWidthChange() : CComSpyPropPage
  • OnWizardBack() : CBasePropertyPage
  • OnWizardFinish() : CBasePropertyPage
  • OnWizardNext() : CBasePropertyPage
  • OnXecute() : CADVCGENDlg
  • Open() : msado15::_Recordset , ASYNC_REQUESTER , msado15::Recordset20 , msado15::Record , CFileLite , msado15::Stream , msado15::_Stream , CDBFile , SIMPLE_BROWSER , msado15::Connection15 , msado15::Connection , msado15::_Connection , msado15::Recordset15 , msado15::Recordset21 , CImpIRow , COleDocumentView , msado15::_Record , CMmStream , msado15::Recordset , CFileLite , CRow
  • OpenCommentEditBox() : CAnnotator
  • OpenConnection() : CHandler , MSDFHDL::IDataFactoryHandler
  • OpenDataContainer() : CSDKSampleStorageSystem
  • OpenDialog() : CFrame
  • OpenDirectory() : CSDKSampleStorageSystem
  • OpenFile() : CDataSource , CFileStream
  • OpenFileHandler() : Sample::UI::MainWindow
  • openMenu_click() : CapJ
  • OpenMenu_Click() : Serialization::SerializationForm
  • OpenNamespace() : CInstPro , CProvider_IWbemServices , CClassPro , CMethodPro
  • OpenPrivateReceiveQueue() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • OpenReceiveQueue() : CImp_DrawDlg , CDisdrawDlg
  • OpenRorW() : CMmStream
  • OpenRowset() : CImpIOpenRowset , CSession , CRow , CMSOmniProvSession
  • OpenRowsetProc() : CMDIChild
  • OpenSchema()
: msado15::Connection15
, msado15::_Connection
, msado15::Connection
  • openStore() : Sample::Sample
  • OpenStreams() : CPersistStorage
  • OpenTempFile() : CPack
  • Operate() : HelloWorld
  • operator BOOL() : CVARIANT
  • operator BSTR() : CBSTR , BSTRING , CUtilBSTR , BSTRING , CBSTR
  • operator BYTE() : CVARIANT
  • operator CHAR *() : CUtilString
  • operator const CLUSPROP_BUFFER_HELPER() : CClusPropValueList
  • operator const T *() : CSmartComPtr< T > , SmartRefPointer< T >
  • operator CSZ() : CStringException
  • operator delete() : CStdDbOutput , CDbAlloc , CCallAs , CFullPropSpec , CAddrNode
  • operator double() : CVARIANT
  • operator HDC() : CCanvas
  • operator HFONT() : CFont
  • operator HWND() : CWindow
  • operator LONG() : CVARIANT
  • operator LPCWSTR() : CQuickStringWrap , CString
  • operator LPTSTR() : BTSTR
  • operator LPWSTR() : CVARIANT
  • operator new() : CDbAlloc , CAddrNode , CStdDbOutput , CFullPropSpec , CCallAs , CFullPropSpec
  • operator PCLUSPROP_LIST() : CClusPropList
  • operator SAFEARRAY *() : CSAFEARRAY , CVARIANT , CSAFEARRAY
  • operator short() : CVARIANT
  • operator T *() : CSmartPtr< T > , CUtilComPtr< T >
  • operator T **() : WiaWrap::CComPtrArray< T >
  • operator VARIANT *() : CVARIANT
  • operator void *const() : CISeqStream
  • operator WCHAR *() : CUtilString , CComWSTR
  • operator!() : WiaWrap::CComPtrArray< T > , CComWSTR , SMmStream , CSmartPtr< T >
  • operator!=() : CFullPropSpec , CFastVariant
  • operator&() : CEnumConnectionPoints , CUtilComPtr< T > , CComWSTR , CEnumConnections , CVARIANT , CSmartPtr< T > , CEnumConnectionPoints , CEnumConnections , WiaWrap::CComPtrArray< T > , CSmartComPtr< T >
  • operator()() : LessThan< Item > , SIndexedDiskLessThan
  • operator*() : SMmStream , CPoint
  • operator+() : CPoint
  • operator++() : CGridIt
  • operator+=() : CString , MyString , CUtilString , CComWSTR , CString
  • operator-() : CPoint
  • operator->() : XInterface< T > , CSmartPtr< T > , CSmartComPtr< T > , XInterface< T > , SmartRefPointer< T > , XInterface< T > , SMmStream
  • operator/() : CPoint
  • operator<() : CFastVariant
  • operator<<() : CConsole
  • operator=() : CExtBuffer , CClusPropValueList , CString , CFastVariant , CMgdResType , CFastVariant , CMgdClusCfgInit , CFastVariant , CClusPropValueList , CStorageResource , CFullPropSpec , CPartitionInfo , CStorageResType , CFastVariant , CUtilString , CFastVariant , CEnumConnectionPoints , CFastVariant , WiaWrap::CComPtrArray< T > , CFastVariant , CString , CEnumStorageResource , CString , CFastVariant , CSmartComPtr< T > , CString , CMgdClusCfgInit , CFastVariant , CUtilString , SmartRefPointer< T > , CEnumConnections , CClusterUtils , CClusPropValueList , CWiaDataCallback , CFastVariant
  • operator==() : CSmartPtr< T > , CFullPropSpec , CFastVariant
  • operator>() : CFastVariant
  • operator[]() : XPtr< T > , CString , CSimpleArray< T > , CStringTable , XPtr< T > , CVector< TYPE, IDX > , CExtBuffer
  • Order() : qcorder::Order
  • OutPipeSample() : CSimpleClass
  • OutputControls() : CGenerateRC
  • OutputDialog() : CGenerateRC
  • OutputDialogFinalize() : CGenerateRC
  • OutputDialogInit() : CGenerateRC
  • OutputDialogs() : CGenerateRC
  • OutputIndent() : CIntTrace
  • OutputIntoDataGrid() : CADVCGENDlg
  • OutputLineEnd() : CIntTrace
  • OutputPath() : IWMSContextAdmin
  • OutputString() : CGenerateRC
  • OutputStringInit() : CGenerateRC
  • OutputText() : CIntTrace
  • OutputTextFmt() : CIntTrace
  • OutputTime() : CTIMER
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- z -

  • ZeroBuffer() : ISAPI_BUFFER , ISAPI_STRING
  • ZoomToRectangle() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- ~ -

  • ~AboutDlg() : AboutDlg
  • ~AgentNotifySink() : AgentNotifySink
  • ~ASYNC_REQUESTER() : ASYNC_REQUESTER
  • ~BSTRING() : BSTRING
  • ~BTSTR() : BTSTR
  • ~CAccount() : CAccount
  • ~CAddDeviceDlg() : CAddDeviceDlg
  • ~CAddFolderDlg() : CAddFolderDlg
  • ~CAddVFileDlg() : CAddVFileDlg
  • ~CAdminNotifyHandler() : CAdminNotifyHandler
  • ~CADsSearch() : CADsSearch
  • ~CADVCGENDlg() : CADVCGENDlg
  • ~CAdvClientDlg() : CAdvClientDlg
  • ~CAggregate() : CAggregate
  • ~CAlterColumnDlg() : CAlterColumnDlg
  • ~CAlterIndexDlg() : CAlterIndexDlg
  • ~CAlterTableDlg() : CAlterTableDlg
  • ~CAnchorTag() : CAnchorTag
  • ~CAPIDoc() : CAPIDoc
  • ~CAPIView() : CAPIView
  • ~CAppInfo() : CAppInfo
  • ~CApplet() : CApplet
  • ~CAppletSession() : CAppletSession
  • ~CAppLite() : CAppLite
  • ~CAppShareNotify() : CAppShareNotify
  • ~CAssoc() : CAssoc< KEY, VALUE >
  • ~CAsynchBase() : CAsynchBase
  • ~CAsynchNotify() : CAsynchNotify
  • ~CAsyncQuerySink() : CAsyncQuerySink
  • ~CAsyncTest() : CAsyncTest
  • ~CAsyncXXX() : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • ~CAttributeValueAddButton() : CAttributeValueAddButton
  • ~CAttributeValueDeleteButton() : CAttributeValueDeleteButton
  • ~CAttributeValueEditButton() : CAttributeValueEditButton
  • ~CAttributeValueEditor() : CAttributeValueEditor
  • ~CAuthenticateContext() : CAuthenticateContext
  • ~CAuthenticatePlugin() : CAuthenticatePlugin
  • ~CAVIFileReader() : CAVIFileReader
  • ~CAVIFileWriter() : CAVIFileWriter
  • ~CBackground() : CBackground
  • ~CBackgroundFolder() : CBackgroundFolder
  • ~CBankDlg() : CBankDlg
  • ~CBase() : CBase
  • ~CBaseDialog() : CBaseDialog
  • ~CBaseNode() : CBaseNode
  • ~CBaseObj() : CBaseObj
  • ~CBasePropertyPage() : CBasePropertyPage
  • ~CBicycle() : CBicycle
  • ~CBicycleFolder() : CBicycleFolder
  • ~CBinder() : CBinder
  • ~CBindings() : CBindings
  • ~CBitArray() : CBitArray
  • ~CBlackPen() : CBlackPen
  • ~CBlockFrame() : CBlockFrame
  • ~CBrush() : CBrush
  • ~CBSTR() : CBSTR
  • ~CButtonLite() : CButtonLite
  • ~CCallbackWrapper() : CCallbackWrapper
  • ~CCallNotify() : CCallNotify
  • ~CCaseTextService() : CCaseTextService
  • ~CCertEncodeAltName() : CCertEncodeAltName
  • ~CCertEncodeBitString() : CCertEncodeBitString
  • ~CCertEncodeCRLDistInfo() : CCertEncodeCRLDistInfo
  • ~CCertEncodeDateArray() : CCertEncodeDateArray
  • ~CCertEncodeLongArray() : CCertEncodeLongArray
  • ~CCertEncodeStringArray() : CCertEncodeStringArray
  • ~CCertExitSample() : CCertExitSample
  • ~CCertManageExitModuleSample() : CCertManageExitModuleSample
  • ~CCertManagePolicyModuleSample() : CCertManagePolicyModuleSample
  • ~CCertPolicySample() : CCertPolicySample
  • ~CChannelNotify() : CChannelNotify
  • ~CChildView() : CChildView
  • ~CClassFactory() : CClassFactory
  • ~CClassFactoryWrapper() : CClassFactoryWrapper
  • ~CClassPro() : CClassPro
  • ~CClientApp() : CClientApp
  • ~CClusPropList() : CClusPropList
  • ~CClusPropValueList() : CClusPropValueList
  • ~CClusterUtils() : CClusterUtils
  • ~CCmdLineLite() : CCmdLineLite
  • ~CColumnInfo() : CColumnInfo
  • ~CColumnProvider() : CColumnProvider
  • ~CComboBoxEx() : CComboBoxEx
  • ~CComboBoxGuid() : CComboBoxGuid
  • ~CComboBoxLite() : CComboBoxLite
  • ~CComboBoxString() : CComboBoxString
  • ~CCommand() : CCommand
  • ~CCommBand() : CCommBand
  • ~CCompartmentMonitor() : CCompartmentMonitor
  • ~CComponent() : CComponent
  • ~CComponentData() : CComponentData
  • ~CCompositionEditSession() : CCompositionEditSession
  • ~CComPtrArray() : WiaWrap::CComPtrArray< T >
  • ~CComSpy() : CComSpy
  • ~CComWSTR() : CComWSTR
  • ~CConfNotify() : CConfNotify
  • ~CConnectionPoint() : CConnectionPoint
  • ~CConnectionPointContainer() : CConnectionPointContainer
  • ~CConsole() : CConsole
  • ~CConstraintDlg() : CConstraintDlg
  • ~CConsumer() : CConsumer
  • ~CContainerBase() : CContainerBase
  • ~CContextMenu() : CContextMenu
  • ~CContextMenuExtension() : CContextMenuExtension
  • ~CContextPlugin() : CContextPlugin
  • ~CCriticalSection() : CCriticalSection
  • ~CCrmFilesWorker() : CCrmFilesWorker
  • ~CCustomError() : CCustomError
  • ~CCustomPropertyStore() : CCustomPropertyStore
  • ~CDataAccess() : CDataAccess
  • ~CDataGrid() : CDataGrid
  • ~CDataLinks() : CDataLinks
  • ~CDataNotify() : CDataNotify
  • ~CDataObject() : CDataObject
  • ~CDataset() : CDataset
  • ~CDataSource() : CDataSource
  • ~CDataXferObj() : CDataXferObj
  • ~CDbAlloc() : CDbAlloc
  • ~CDBAuthAdmin() : CDBAuthAdmin
  • ~CDBAuthPlugin() : CDBAuthPlugin
  • ~CDBFile() : CDBFile
  • ~CDBSession() : CDBSession
  • ~CDelegationBase() : CDelegationBase
  • ~CDeskBand() : CDeskBand
  • ~CDeviceFinderCallback() : CDeviceFinderCallback
  • ~CDeviceNode() : CDeviceNode
  • ~CDeviceProp() : CDeviceProp
  • ~CDialogBase() : CDialogBase
  • ~CDialogLite() : CDialogLite
  • ~CDialogStream() : CDialogStream
  • ~CDimmer() : CDimmer
  • ~CDimmerService() : CDimmerService
  • ~CDlgDest() : CDlgDest
  • ~CDlgIADs() : CDlgIADs
  • ~CDlgIADsContainer() : CDlgIADsContainer
  • ~CDlgIADsLargeInteger() : CDlgIADsLargeInteger
  • ~CDlgIADsOpenDSObject() : CDlgIADsOpenDSObject
  • ~CDlgIADsPropertyList() : CDlgIADsPropertyList
  • ~CDlgIADsSecurityDescriptor() : CDlgIADsSecurityDescriptor
  • ~CDlgIDirectoryObject() : CDlgIDirectoryObject
  • ~CDlgIDirectorySearch() : CDlgIDirectorySearch
  • ~CDlgSrc() : CDlgSrc
  • ~CDog() : CDog
  • ~CDownloadBindStatusCallback() : CDownloadBindStatusCallback
  • ~CDownloadUI() : CDownloadUI
  • ~CDragSource() : CDragSource
  • ~CDrawArea() : CDrawArea
  • ~CDropObject() : CDropObject
  • ~CDropSource() : CDropSource
  • ~CDropTarget() : CDropTarget
  • ~CDSLAdvancedPage() : CDSLAdvancedPage
  • ~CDSLConnectionPage() : CDSLConnectionPage
  • ~CDynamic() : CDynamic
  • ~CEditBoxLite() : CEditBoxLite
  • ~CEditSessionBase() : CEditSessionBase
  • ~CEditValueDlg() : CEditValueDlg
  • ~CEmptyVolumeCache() : CEmptyVolumeCache
  • ~CEntity() : CEntity
  • ~CEnumConnectionPoints() : CEnumConnectionPoints
  • ~CEnumConnections() : CEnumConnections
  • ~CEnumDisplayAttributeInfo() : CEnumDisplayAttributeInfo
  • ~CEnumerator() : CEnumerator
  • ~CEnumFormatEtc() : CEnumFormatEtc
  • ~CEnumIDList() : CEnumIDList
  • ~CEnumStorageResource() : CEnumStorageResource
  • ~CEnumTASK() : CEnumTASK
  • ~CEnumXXX() : CEnumXXX< T, ELT_T, IFACE >
  • ~CError() : CError
  • ~CEvent() : CEvent
  • ~CEventSink() : CEventSink
  • ~CExList() : CExList< TYPE >
  • ~CExplorerBar() : CExplorerBar
  • ~CExtBuffer() : CExtBuffer
  • ~CExtendContextMenuEx() : CExtendContextMenuEx
  • ~CExtendPropertySheet() : CExtendPropertySheet
  • ~CExtObject() : CExtObject
  • ~CExtPageUser() : CExtPageUser
  • ~CExtractIcon() : CExtractIcon
  • ~CFactory() : CFactory
  • ~CFastVariant() : CFastVariant
  • ~CFileIdx() : CFileIdx
  • ~CFileIO() : CFileIO
  • ~CFileLite() : CFileLite
  • ~CFileStream() : CFileStream
  • ~CFileTransferNotify() : CFileTransferNotify
  • ~CFileViewer() : CFileViewer
  • ~CFixedAlloc() : CFixedAlloc
  • ~CFolderNode() : CFolderNode
  • ~CFont() : CFont
  • ~CFontRange() : CFontRange
  • ~CFontSelect() : CFontSelect
  • ~CFrame() : CFrame
  • ~CFrameWndLite() : CFrameWndLite
  • ~CFtNotify() : CFtNotify
  • ~CFullConnect() : CFullConnect
  • ~CFullPropSpec() : CFullPropSpec
  • ~CFVClassFactory() : CFVClassFactory
  • ~CGdiplusInit() : CGdiplusInit
  • ~CGenerateRC() : CGenerateRC
  • ~CGenericEnum() : CGenericEnum
  • ~CGenericUCPDlg() : CGenericUCPDlg
  • ~CHello() : CHello
  • ~CHelloClassFactory() : CHelloClassFactory
  • ~CHiPerfProvider() : CHiPerfProvider
  • ~CHourglass() : CHourglass
  • ~CHtmlElemBagEntry() : CHtmlElemBagEntry
  • ~CHtmlElement() : CHtmlElement
  • ~CHtmlElementBag() : CHtmlElementBag
  • ~CHtmlIFilter() : CHtmlIFilter
  • ~CHtmlIFilterBase() : CHtmlIFilterBase
  • ~CHtmlIFilterCF() : CHtmlIFilterCF
  • ~CHtmlScanner() : CHtmlScanner
  • ~CIceSkate() : CIceSkate
  • ~CIceSkateFolder() : CIceSkateFolder
  • ~CImp_DrawDlg() : CImp_DrawDlg
  • ~CImpAuth() : CImpAuth
  • ~CImpIAdviseSink() : CImpIAdviseSink
  • ~CImpIFileViewer() : CImpIFileViewer
  • ~CImpIOleClientSite() : CImpIOleClientSite
  • ~CImpIOleDocumentSite() : CImpIOleDocumentSite
  • ~CImpIOleInPlaceSite() : CImpIOleInPlaceSite
  • ~CImpIPersistFile() : CImpIPersistFile
  • ~CImpISpecifyPropertyPages() : CImpISpecifyPropertyPages
  • ~CImportRes() : CImportRes
  • ~CInstPro() : CInstPro
  • ~CInterfaceDlg() : CInterfaceDlg
  • ~CIntTrace() : CIntTrace
  • ~CIsapiCertPolicyFilter() : CIsapiCertPolicyFilter
  • ~CISeqStream() : CISeqStream
  • ~CKeystrokeEditSession() : CKeystrokeEditSession
  • ~CLandBasedVehicle() : CLandBasedVehicle
  • ~CLangBarItemButton() : CLangBarItemButton
  • ~CLanguageResourceSampleCF() : CLanguageResourceSampleCF
  • ~ClientList() : ClientList
  • ~CLinkable() : CLinkable
  • ~CList() : CList< TYPE, ARG_TYPE >
  • ~CListBoxLite() : CListBoxLite
  • ~CListener() : CListener
  • ~CListHeader() : CListHeader
  • ~CListViewLite() : CListViewLite
  • ~CLListImpl() : CLListImpl< TYPE, ARG_TYPE >
  • ~CLock() : CLock
  • ~CLockHandler() : CLockHandler
  • ~CLogFile() : CLogFile
  • ~CMain() : CMain
  • ~CMainFrame() : CMainFrame
  • ~CMainWindow() : CMainWindow
  • ~CMallocSpy() : CMallocSpy
  • ~CMap() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • ~CMarkTextService() : CMarkTextService
  • ~CMDIChild() : CMDIChild
  • ~CMDIChildLite() : CMDIChildLite
  • ~CMDIFrameLite() : CMDIFrameLite
  • ~CMDIObjects() : CMDIObjects
  • ~CMDITrace() : CMDITrace
  • ~CMember() : CMember
  • ~CMemoryMappedInputStream() : CMemoryMappedInputStream
  • ~CMethodPro() : CMethodPro
  • ~CMgdClusCfgInit() : CMgdClusCfgInit
  • ~CMgdResType() : CMgdResType
  • ~CMgrNotify() : CMgrNotify
  • ~CMMCControl() : CMMCControl
  • ~CMmStream() : CMmStream
  • ~CMmStreamBuf() : CMmStreamBuf
  • ~CModel() : CModel
  • ~CMonitor() : CMonitor
  • ~CMSMQEventHandler() : CMSMQEventHandler
  • ~CMSOmniProvRowset() : CMSOmniProvRowset
  • ~CMultichanApp() : CMultichanApp
  • ~CMultipleResults() : CMultipleResults
  • ~CMultipleResultsDlg() : CMultipleResultsDlg
  • ~CMultiValuedAttributeEditor() : CMultiValuedAttributeEditor
  • ~CMultiValuedListBox() : CMultiValuedListBox
  • ~CMyCapabilities() : CMyCapabilities
  • ~CMyEventProvider() : CMyEventProvider
  • ~CMyEvictListener() : CMyEvictListener
  • ~CMyInkCollector() : CMyInkCollector
  • ~CMyMemberSetChangeListener() : CMyMemberSetChangeListener
  • ~CMySink() : CMySink
  • ~CMyStartupListener() : CMyStartupListener
  • ~CNode() : CNode< TYPE >
  • ~CNotify() : CNotify
  • ~CNullModem() : CNullModem
  • ~CObjData() : CObjData
  • ~CObjSecurity() : CObjSecurity
  • ~CObjTree() : CObjTree
  • ~COBLIST() : COBLIST
  • ~CODBCData() : CODBCData
  • ~COleClient() : COleClient
  • ~COleDocument() : COleDocument
  • ~COleDocumentView() : COleDocumentView
  • ~COleInPlaceActiveObject() : COleInPlaceActiveObject
  • ~COleInPlaceObject() : COleInPlaceObject
  • ~COleObject() : COleObject
  • ~Conf() : Conf
  • ~COpState() : CProxyPlugin::COpState
  • ~CPack() : CPack
  • ~CPage() : CPage
  • ~CPaintCanvas() : CPaintCanvas
  • ~CParameters() : CParameters
  • ~CPartitionInfo() : CPartitionInfo
  • ~CPeoplePoweredVehicle() : CPeoplePoweredVehicle
  • ~CPersistFile() : CPersistFile
  • ~CPersistStorage() : CPersistStorage
  • ~CPerson() : CPerson
  • ~CPidlMgr() : CPidlMgr
  • ~CPlane() : CPlane
  • ~CPlgFilter() : CPlgFilter
  • ~CPlgPin() : CPlgPin
  • ~CPlgTermSample() : CPlgTermSample
  • ~CPluggableTransport() : CPluggableTransport
  • ~CPooledData() : CPooledData
  • ~CPrintCanvas() : CPrintCanvas
  • ~CPrintRequest() : CPrintRequest
  • ~CPrintSDIDoc() : CPrintSDIDoc
  • ~CPrintSDIView() : CPrintSDIView
  • ~CProgress() : CProgress
  • ~CProgressDlg() : WiaWrap::CProgressDlg
  • ~CProperties() : CProperties
  • ~CPropertiesBase() : CPropertiesBase
  • ~CPropertiesDlg() : CPropertiesDlg
  • ~CPropertyEditSession() : CPropertyEditSession
  • ~CPropertyIDs() : CPropertyIDs
  • ~CPropertyInfos() : CPropertyInfos
  • ~CPropertyPage() : CPropertyPage
  • ~CPropertyTag() : CPropertyTag
  • ~CPropIDSets() : CPropIDSets
  • ~CPropInfoSets() : CPropInfoSets
  • ~CPropPageLite() : CPropPageLite
  • ~CProppageUser() : CProppageUser
  • ~CProppageUserUI() : CProppageUserUI
  • ~CPropPro() : CPropPro
  • ~CPropSets() : CPropSets
  • ~CPropSheetExtension() : CPropSheetExtension
  • ~CPropSheetHost() : CPropSheetHost
  • ~CPropSheetLite() : CPropSheetLite
  • ~CProvFactory() : CProvFactory
  • ~CProvider() : CProvider
  • ~CProvider_IWbemEventConsumerProvider() : CProvider_IWbemEventConsumerProvider
  • ~CProvider_IWbemEventProvider() : CProvider_IWbemEventProvider
  • ~CProvider_IWbemServices() : CProvider_IWbemServices
  • ~CProvider_IWbemUnboundObjectSink() : CProvider_IWbemUnboundObjectSink
  • ~CProviderFactory() : CProviderFactory
  • ~CProxy() : CProxy
  • ~CProxyPlugin() : CProxyPlugin
  • ~CPSTN() : CPSTN
  • ~CQueryBox() : CQueryBox
  • ~CQuickStringWrap() : CQuickStringWrap
  • ~CRecoOutputWnd() : CRecoOutputWnd
  • ~CRefClient() : CRefClient
  • ~CRefCount() : CRefCount
  • ~CRefresher() : CRefresher
  • ~CRefresherMember() : CRefresherMember< T >
  • ~CRegAccess() : CRegAccess
  • ~CReindeer() : CReindeer
  • ~CRequestInstance() : CRequestInstance
  • ~CResultset() : CResultset
  • ~CRichEditLite() : CRichEditLite
  • ~CRocket() : CRocket
  • ~CRow() : CRow
  • ~CRowPosition() : CRowPosition
  • ~CRowset() : CRowset
  • ~CRTCAVSession() : CRTCAVSession
  • ~CRTCIMSession() : CRTCIMSession
  • ~CRTCSession() : CRTCSession
  • ~CRTCWin() : CRTCWin
  • ~CS1Dialog() : CS1Dialog
  • ~CS2Dialog() : CS2Dialog
  • ~CS3Dialog() : CS3Dialog
  • ~CS4Dialog() : CS4Dialog
  • ~CSAFEARRAY() : CSAFEARRAY
  • ~CSafeRefCount() : CSafeRefCount
  • ~CSampleDataContainer() : CSampleDataContainer
  • ~CSampleDataSource() : CSampleDataSource
  • ~CSampleDirectory() : CSampleDirectory
  • ~CSampleDirectoryInfo() : CSampleDirectoryInfo
  • ~CSampleInstance() : CSampleInstance
  • ~CSampleMSP() : CSampleMSP
  • ~CSampleMSPCall() : CSampleMSPCall
  • ~CSampleMSPStream() : CSampleMSPStream
  • ~CSamplePipe() : CSamplePipe
  • ~CSampleStemmer() : CSampleStemmer
  • ~CSampleWordBreaker() : CSampleWordBreaker
  • ~CSchemaDlg() : CSchemaDlg
  • ~CSCP() : CSCP
  • ~CSCPCMenuDialog() : CSCPCMenuDialog
  • ~CSCPPageBindingInfo() : CSCPPageBindingInfo
  • ~CSCPPageGeneral() : CSCPPageGeneral
  • ~CSCPPageKeywords() : CSCPPageKeywords
  • ~CSCPUIBindingInfo() : CSCPUIBindingInfo
  • ~CSCPUIGeneral() : CSCPUIGeneral
  • ~CSCPUIKeywords() : CSCPUIKeywords
  • ~CSCPWiz() : CSCPWiz
  • ~CScreenCanvas() : CScreenCanvas
  • ~CScrollBarLite() : CScrollBarLite
  • ~CSDKSamplePlaylistParser() : CSDKSamplePlaylistParser
  • ~CSDKSamplePlaylistParserPlugin() : CSDKSamplePlaylistParserPlugin
  • ~CSDKSampleStorageSystem() : CSDKSampleStorageSystem
  • ~CSecureObject() : CSecureObject
  • ~CServer() : CServer
  • ~CServiceCallback() : CServiceCallback
  • ~CServiceComp() : CServiceComp
  • ~CSession() : CSession
  • ~CSettings() : CSettings
  • ~CShellExt() : CShellExt
  • ~CShellExtClassFactory() : CShellExtClassFactory
  • ~CShellFolder() : CShellFolder
  • ~CShellIconOverlayID() : CShellIconOverlayID
  • ~CShellView() : CShellView
  • ~CSids() : CSids
  • ~CSimpleApp() : CSimpleApp
  • ~CSimpleArray() : CSimpleArray< T >
  • ~CSimpleClass() : CSimpleClass
  • ~CSimpleDialog() : CSimpleDialog
  • ~CSimpleDoc() : CSimpleDoc
  • ~CSimpleObject() : CSimpleObject
  • ~CSimpleSite() : CSimpleSite
  • ~CSimpSvrApp() : CSimpSvrApp
  • ~CSimpSvrDoc() : CSimpSvrDoc
  • ~CSimpSvrObj() : CSimpSvrObj
  • ~CSite() : CSite
  • ~CSkateboard() : CSkateboard
  • ~CSkateboardFolder() : CSkateboardFolder
  • ~CSkyBasedVehicle() : CSkyBasedVehicle
  • ~CSkyVehicle() : CSkyVehicle
  • ~CSmartComPtr() : CSmartComPtr< T >
  • ~CSmartPtr() : CSmartPtr< T >
  • ~CSmpFilter() : CSmpFilter
  • ~CSmpFilterCF() : CSmpFilterCF
  • ~CSnapinAbout() : CSnapinAbout
  • ~CSpaceFolder() : CSpaceFolder
  • ~CSpaceStation() : CSpaceStation
  • ~CSpaceVehicle() : CSpaceVehicle
  • ~CSpecialCharHashTable() : CSpecialCharHashTable
  • ~CSpyCon() : CSpyCon
  • ~CStabilize() : CStabilize
  • ~Cstack_c() : Cstack_c
  • ~CStaticMap() : CStaticMap
  • ~CStaticNode() : CStaticNode
  • ~CStatusBarLite() : CStatusBarLite
  • ~CStatusHelper() : CStatusHelper
  • ~CStdDbOutput() : CStdDbOutput
  • ~CStorageBuffer() : CStorageBuffer
  • ~CStorageResource() : CStorageResource
  • ~CStorageResType() : CStorageResType
  • ~CStream() : CStream
  • ~CString() : CString
  • ~CStringTable() : CStringTable
  • ~CSurrogate() : CSurrogate
  • ~CSyncMgrHandler() : CSyncMgrHandler
  • ~CTable() : CTable
  • ~CTableCopy() : CTableCopy
  • ~CTabLite() : CTabLite
  • ~CTAPIEventNotification() : CTAPIEventNotification
  • ~CTerminateCompositionEditSession() : CTerminateCompositionEditSession
  • ~CTestDlg() : CTestDlg
  • ~CTestDoc() : CTestDoc
  • ~CTestView() : CTestView
  • ~CTextGrid() : CTextGrid
  • ~CThumbNailPhotoHolder() : CThumbNailPhotoHolder
  • ~CToolBand() : CToolBand
  • ~CToolBarExtension() : CToolBarExtension
  • ~CToolBarLite() : CToolBarLite
  • ~CTransaction() : CTransaction
  • ~CTransactionOptions() : CTransactionOptions
  • ~CTreeViewLite() : CTreeViewLite
  • ~CTSFDataObject() : CTSFDataObject
  • ~CTSFEditWnd() : CTSFEditWnd
  • ~CTSFMainWnd() : CTSFMainWnd
  • ~CTSFPersistentPropertyLoader() : CTSFPersistentPropertyLoader
  • ~CTypesDialog() : CTypesDialog
  • ~CUnknown() : CUnknown
  • ~CUpdateTextEditSession() : CUpdateTextEditSession
  • ~CUrlmonCallback() : CUrlmonCallback
  • ~CUtil() : CUtil
  • ~CUtilBSTR() : CUtilBSTR
  • ~CUtilComPtr() : CUtilComPtr< T >
  • ~CUtilProp() : CUtilProp
  • ~CUtilString() : CUtilString
  • ~CVARIANT() : CVARIANT
  • ~CVariant() : CVariant
  • ~CVARIANT() : CVARIANT
  • ~CVector() : CVector< TYPE, IDX >
  • ~CVectorEx() : CVectorEx< TYPE, IDX >
  • ~CViewList() : CViewList
  • ~CVirtualFile() : CVirtualFile
  • ~CWaitCursor() : CWaitCursor
  • ~CWbemClientDlg() : CWbemClientDlg
  • ~CWebBrowser() : CWebBrowser
  • ~CWiaDataCallback() : CWiaDataCallback
  • ~CWinApp() : CWinApp
  • ~CWizard() : CWizard
  • ~CWizExtUser() : CWizExtUser
  • ~CWndLite() : CWndLite
  • ~CWorkerThread() : CWorkerThread
  • ~CWrapVBComponent() : CWrapVBComponent
  • ~CX224() : CX224
  • ~CXmlDOM() : CXmlDOM
  • ~GlobalVars() : GlobalVars
  • ~HelloWorld() : HelloWorld
  • ~HtmlPropIFilter() : HtmlPropIFilter
  • ~HtmlPropIFilterCF() : HtmlPropIFilterCF
  • ~InitOle() : InitOle
  • ~InkCollectorEvents() : InkCollectorEvents
  • ~ISAPI_BUFFER() : ISAPI_BUFFER
  • ~ISAPI_EXTENSION() : ISAPI_EXTENSION
  • ~ISAPI_REQUEST() : ISAPI_REQUEST
  • ~ISAPI_STRING() : ISAPI_STRING
  • ~ISAPI_STRINGW() : ISAPI_STRINGW
  • ~ISAPITHREAD() : ISAPITHREAD
  • ~Iterator() : ClientList::Iterator
  • ~MyClassFactory() : MyClassFactory
  • ~MyDataSource() : MyDataSource
  • ~MyOSPObject() : MyOSPObject
  • ~MyString() : MyString
  • ~NIDeque_c() : NIDeque_c< T >
  • ~NIDequeIter_c() : NIDequeIter_c< T >
  • ~PMmStream() : PMmStream
  • ~RecvBuf() : RecvBuf
  • ~RefCount() : RefCount
  • ~RqsClient() : RqsClient
  • ~RqsConfig() : RqsConfig
  • ~RqsEngine() : RqsEngine
  • ~SIMPLE_BROWSER() : SIMPLE_BROWSER
  • ~SmartRefPointer() : SmartRefPointer< T >
  • ~SMmStream() : SMmStream
  • ~Stack_c() : Stack_c< T >
  • ~TempBuffer() : TempBuffer
  • ~TPropBase() : TPropBase< TYPE >
  • ~TPropSetBase() : TPropSetBase< TYPE, OBJTYPE >
  • ~UPNPDimmerDevice() : UPNPDimmerDevice
  • ~UPNPDimmerService() : UPNPDimmerService
  • ~XBStr() : XBStr
  • ~XInterface() : XInterface< T >
  • ~XPtr() : XPtr< T >
  • ~XWindow() : XWindow
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- a -

  • Abort() : CCrmFilesTest , CAsynchBase
  • AbortRecord() : CCrmFilesCompensator , CCrmDebugCompensator
  • AbortRecordVariants() : CCrmDebugCompensator
  • AbortTransaction() : CByotTransObj , CCrmMonComp
  • AbortTransactionProc() : CMDIChild
  • About() : CComSpy , IComSpy , About
  • AboutBox() : Sample::UI::AboutBox
  • AboutBoxHandler() : Sample::UI::MainWindow
  • AboutDlg() : AboutDlg
  • aboutMenu_click() : CapJ
  • Accelerators() : CFrame
  • accept() : DTHandler
  • AcceptCall() : Conf
  • AcceptConnection() : CPluggableTransport
  • Accepted() : CCallNotify
  • Access() : CSAFEARRAY
  • AccessCheck() : CMyEventProvider
  • Acquire() : XInterface< T > , XPtr< T > , XInterface< T > , SMmStream , XPtr< T > , XInterface< T > , XBStr
  • Activate() : CSite , CCrmFilesWorker , CCrmFilesTest , CAccount , CUpdateReceipt , CLogFile , CADOComponent , COLEDBComponent , CRDOComponent , COMPlus , CProxy , CPropertyPage , CAgentCtlCharacterEx , CCaseTextService , CMarkTextService
  • ActivateData() : CPooledData
  • ActivateInPlace() : COleDocumentView
  • ActivateInputState() : AgentNotifySink , Notify
  • ActivateMe() : CImpIOleDocumentSite
  • ActivateUI() : COleDocumentView
  • Active() : CPlgPin
  • ActiveClientChange() : AgentNotifySink , Notify
  • ActiveComponents() : CUnknown
  • Add() : comadmin::COMAdminCatalogCollection , comadmin::ICatalogCollection , CDynamic , CEntity , CStaticMap , CSimpleArray< T > , CAgentCtlCommandsEx , CSpecialCharHashTable
  • Add2OpenedQueuePathNameArray() : CMainFrame
  • Add2PathNameArray() : CMainFrame
  • AddBasicConstraintsCommon() : CCertPolicySample
  • AddBinding() : CAdvClientDlg
  • AddCacheItem() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • addCatalog() : NewsSubscriber
  • AddCDLToContext() : CacheProxySamplePlugin::CacheProxyPlugin
  • AddColumn() : CADsSearch
  • AddColumnProc() : CMDIChild
  • AddComment() : CAnnotator , IAnnotator
  • AddContextMenuItem() : CObjData
  • AddContextMenuItems() : CObjData , CClusterData , CNodeData , CGroupData , CResData , CResTypeData , CNetworkData , CNetInterfaceData , CExtObject , CObjData , CClusterData , CNodeData , CGroupData , CResData , CResTypeData , CNetworkData , CNetInterfaceData
  • addDataSourceListener() : MyDataSource
  • AddDataToResponseBuffer() : ISAPI_REQUEST
  • AddDevice() : CGenericUCPDlg
  • AddDeviceNode() : CStaticNode
  • AddElement() : CVector< TYPE, IDX > , CHtmlElementBag
  • AddEnum() : CRefClient , CRefresher
  • AddEOL() : CRow
  • AddEventToList() : CComSpy
  • AddFilter() : CAdvClientDlg
  • AddFiltersToGraph() : CPlgTermSample
  • AddFolder() : CShellFolder
  • AddFolderNode() : CDeviceNode
  • AddForDownload() : CacheProxySamplePlugin::CacheProxyPlugin
  • AddFrameLevelTools() : CSimpleApp
  • AddFrameLevelUI() : CSimpSvrObj , CSimpleApp
  • AddHead() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • AddHeaderToBufferedResponse() : ISAPI_REQUEST
  • AddImages() : CDelegationBase
  • AddInst() : CDbAlloc
  • AddItem() : CBackgroundFolder , CShellFolder , CShellView
  • AddKeystroke() : CDrawArea
  • AddLine() : CDrawArea , CSharp_Draw::Form1 , CDrawArea
  • AddMenuItems() : CComponent , CComponentData , CContextMenuExtension , CComponentData , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CExtendContextMenuEx , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CComponent , CComponentData
  • AddMultiSelectCookie() : CDataObject
  • AddMultiSelectGuid() : CDataObject
  • AddNew()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • AddNewGame() : CComputer
  • AddNoLen() : CStaticMap
  • AddObject() : CObjTree , CRefresher
  • AddObjects() : CRefClient
  • addOLEDBSimpleProviderListener() : MyOSPObject
  • AddPage() : CPropSheetLite
  • AddPages() : CSCP , CSCPWiz , CProppageUser , CWizExtUser , CShellExt
  • AddParamValueToList() : CComSpy
  • AddParent() : CVCExploreDlg
  • AddProperty() : TPropBase< TYPE >
  • AddPropertySheetPages() : CShellView
  • AddPropSet() : TPropSetBase< TYPE, OBJTYPE >
  • AddRecentConfig() : CFullConnect
  • AddRecentFile() : CFullConnect
  • AddRef() : CMgrNotify , CConfNotify , CAppletSession , CFtNotify , RefCount , CMgrNotify , CConfNotify , RefCount , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , RefCount , CMgrNotify , CAppShareNotify , CCallNotify , CConfNotify , CMgrNotify , RefCount , HtmlPropIFilter , HtmlPropIFilterCF , CHtmlIFilterBase , CHtmlIFilterCF , CLanguageResourceSampleCF , CSampleWordBreaker , CSampleStemmer , CSmpFilter , CSmpFilterCF , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CFactory , CCallAsFactory , CCallAs , CHello , CHelloClassFactory , CImpAuth , CSmartPtr< T > , CSmartPtrTrace< T > , CWiaDataCallback , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCEvents , CTAPIEventNotification , CDownloadBindStatusCallback , InkCollectorEvents , CBackgroundCopyCallback , CMonitor , CMgrNotify , CConfNotify , CDataNotify , RefCount , CApplet , CRefCount
  • AddRefAccessor() : CImpIAccessor , CDataAccess
  • AddReference() : CSmartComPtr< T >
  • AddRefRows() : CDataGrid , CRowset , CImpIRowset
  • AddRow() : CDBFile
  • AddRunningAspsToDebugMenu() : CComSpy
  • AddSearchPref() : CADsSearch
  • AddService() : Microsoft::Uddi::Demo::Publish
  • AddSession() : CRTCWin
  • AddStatusMessage() : CSimpleDialog
  • AddString() : CRecoOutputWnd , CComboBoxLite , CListBoxLite , CComboBoxLite , CComboBoxEx
  • AddSubscription() : CAppInfo
  • AddTail() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE >
  • AddToEnumList() : CEnumIDList
  • AddToList() : CMallocSpy , CViewList
  • AddToMediaCapabilities() : CRTCIncomingDlg , CRTCOutgoingDlg
  • AddToParticipantList() : CRTCOutgoingDlg
  • AddUser() : CDBAuthAdmin , CDBAuthPlugin , IDBAuthAdmin
  • AddV1TemplateNameExtension() : CCertPolicySample
  • AddVirtualFile() : CFolderNode
  • AdjustBindings() : CTable
  • AdjustRect() : CTabLite
  • AdjustStartLocationForEOL() : CRow
  • AdminCreateDataSource() : CDataSource
  • AdminCreateDataSourceProc() : CMDIChild
  • ADOCheck() : msado15::IRecFields
  • ADsError() : ADsError
  • ADsOpenObject() : CADQIApp
  • Advise() : CConnectionPoint , COleObject , CListener , CRTCEvents , UPNPDimmerService , CDimmerService , CApplet , CAppletSession , CListener
  • AdviseInkCollector() : InkCollectorEvents
  • AdviseListener() : CContainerBase
  • AdviseSink() : CLangBarItemButton , CTSFEditWnd , CLangBarItemButton
  • AdviseSource() : CMSMQEventHandler
  • agent1_agentPropertyChange() : CapJ
  • agent1_command() : CapJ
  • agent1_move() : CapJ
  • AgentNotifySink() : AgentNotifySink
  • AgentPropertyChange() : Notify , AgentNotifySink
  • Alert() : CSettings
  • AlertBox() : CController
  • Align16() : CDialogStream
  • Align32() : CDialogStream
  • Alloc() : CFixedAlloc , CLDisp
  • AllocateHandleConfirm() : CAppletSession
  • AllocateProxyBuffers() : CDBFile , CMSOmniProvRowset
  • AllocBeforeWrite() : CString
  • AllocBuffer() : CString
  • AllocCopy() : CString
  • AllocOleStr() : CSnapinAbout
  • AllocPidlTable() : CContextMenu , CDropTarget , CDataObject
  • AllocProxyBuffer() : CRow
  • AlterColumn() : CAlterColumnDlg
  • AlterIndex() : CAlterIndexDlg
  • AlterTable() : CAlterTableDlg
  • AmIAnAdministrator() : CVCSecuritySampleClass
  • AnimationsListBox_doubleClick() : CapJ
  • APIHook() : APIHook< T >
  • Append() : CRichEditLite , msado15::_DynaCollection , msado15::Parameters , CComWSTR , ISAPI_STRINGW , CEntity , ISAPI_STRING , CComWSTR , msado15::Fields
  • AppendA() : ISAPI_STRINGW
  • AppendChunk()
: msado15::_Parameter
, msado15::Field15
, msado15::Parameter
, msado15::Field
  • AppendData() : ISAPI_BUFFER
  • AppendW() : ISAPI_STRING
  • AppInitialize() : CAppLite
  • Application() : CContext
  • Apply() : CPropertyPage , CContextSamplePropPage , CComSpyPropPage
  • ApplyViewState() : COleDocumentView
  • AppName() : CAppInfo
  • AppsListHandler() : CSelectEventsDlg
  • AquireData() : CDlgSrc
  • ArrayEmpty() : CBitArray
  • ARRAYQ() : ARRAYQ
  • Arrived() : CImp_DrawDlg , CMSMQEventHandler
  • ArrivedError() : CMSMQEventHandler
  • AssembleMenus() : CSimpSvrObj
  • Assertion() : CDbAlloc
  • AssignCopy() : CString
  • AssignSocket() : RqsClient
  • AssocFromPos() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • AssociateToMachine() : CAdvClientDlg
  • ASYNC_REQUESTER() : ASYNC_REQUESTER
  • AsyncSendResponseIIS4() : ISAPI_REQUEST
  • AsyncSendResponseIIS5() : ISAPI_REQUEST
  • AsyncSendResponseIIS6() : ISAPI_REQUEST
  • AsyncTransmitBufferedResponse() : ISAPI_REQUEST
  • AtEnd() : ClientList::Iterator
  • Attach() : CVector< TYPE, IDX > , CPropertyIDs , CComWSTR , CParameters , CVariant , CVector< TYPE, IDX > , CFastVariant , CColumnInfo , CPropertyInfos , CProperties
  • AttachAnnotator() : CAnnotator , IAnnotator
  • Audit() : IComSpy , CComSpy , IComSpy
  • Authenticate() : CImpAuth , CAuthenticateContext
  • AuthorizeEvent() : CDBAuthPlugin
  • AutoClaims() : AutoClaims::AutoClaims
  • AutoClaims_Load() : AutoClaims::AutoClaims
  • AutoJoinSessionIndication() : CApplet
  • AutoPosition() : CMDIChildLite , CMDIChild , CMDIObjects , CMDITrace
  • AutoQI() : CStream , CMultipleResults , CDataLinks , CBinder , CAsynchBase , CDataSource , CRow , CRowset , CTransactionOptions , CCustomError , CBase , CTransaction , CDataAccess , CConnectionPoint , CCommand , CPropertiesBase , CDataset , CServiceComp , CUnknown , CEnumerator , CSession , CError , CRowPosition , CContainerBase
  • AutoRelease() : CAsynchBase , CDataset , CBinder , CBase , CContainerBase , CSession , CPropertiesBase , CRowset , CDataLinks , CTransaction , CServiceComp , CEnumerator , CTransactionOptions , CRowPosition , CMultipleResults , CStream , CConnectionPoint , CCommand , CDataAccess , CError , CRow , CUnknown , CDataSource , CCustomError
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- b -

  • Back() : NIDequeIter_c< T >
  • BackupREGDB()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • BalloonVisibleState() : AgentNotifySink , Notify , AgentNotifySink , Notify
  • BAllRequiredFieldsPresent() : CClipBookServerParamsPage , CFileShareSampleParamsPage
  • BandedDataCallback() : WiaWrap::CDataCallback , CWiaDataCallback
  • BApplyChanges() : CBasePropertyPage
  • Bark() : CDog
  • Base64Decode() : ISAPI_BUFFER
  • Base64Encode() : ISAPI_STRING
  • BBackPressed() : CBasePropertyPage
  • BBuildPropList() : CBasePropertyPage
  • Beep() : CEvent , AppEvents
  • Begin() : CAdminNotifyHandler
  • Begin_Sum() : CAsyncFullServ , fullsvr::AsyncFullServ , fullsvr::AsyncIFullServ
  • Begin_Test1() : CAsyncTest
  • Begin_Test2() : CAsyncTest
  • BeginAbort() : CCrmDebugCompensator , CCrmFilesCompensator
  • BeginAbortVariants() : CCrmDebugCompensator
  • BeginCommit() : CCrmDebugCompensator , CCrmFilesCompensator
  • BeginCommitVariants() : CCrmDebugCompensator
  • BeginningTransaction() : CUrlmonCallback
  • BeginPrepare() : CCrmDebugCompensator , CCrmFilesCompensator
  • BeginPrepareVariants() : CCrmDebugCompensator
  • BeginTrans()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • BeginTransaction() : CByotTransObj
  • BeginTransComplete()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • Bind() : CRow , CImpIBindResource
  • bind() : DTHandler
  • BindDSO() : CImpIBindResource
  • BindRegion() : HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter
  • BindResourceProc() : CMainWindow
  • BindResultMetaData() : CODBCData
  • BindRow() : CImpIBindResource
  • BindRowset() : CImpIBindResource
  • BindSession() : CImpIBindResource
  • BindStaticEntity() : CProxy
  • BindStream() : CImpIBindResource
  • BindToObject() : CShellFolder
  • BindToStorage() : CShellFolder
  • BIsListEmpty() : CClusPropList
  • BookMark() : AgentNotifySink , Notify
  • BreakText() : CSampleWordBreaker
  • BrowseEnumeratorProc() : CFullConnect
  • BSaved() : CBasePropertyPage
  • BSetPrivateProps() : CBasePropertyPage
  • BSTRING() : BSTRING
  • btnAttach_Click() : CSharp_Draw::Form1
  • btnCancel_Click()
: CSharp_Draw::InputBox
, CSharp_Draw::Form1
  • btnConnect_Click() : CSharp_Draw::Form1
  • btnMove_Click() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • btnOK_Click() : CSharp_Draw::InputBox
  • btnRecognize_Click() : InkRecognition::InkRecognition
  • BTSTR() : BTSTR
  • BufAlloc() : RecvBuf
  • BufBeg() : RecvBuf
  • BufReset() : RecvBuf
  • BufScanInt() : RecvBuf
  • BufScanStr() : RecvBuf
  • BufShift() : RecvBuf
  • BufSize() : RecvBuf
  • BufSpace() : RecvBuf
  • BuildJoinSessionStructure() : CAppletSession
  • BuildRemoteUrl() : CPack
  • ButtonDown() : CController
  • buttonSign_Click() : Sample::UI::MainWindow
  • ButtonUp() : CController
  • buttonVerify_Click() : Sample::UI::MainWindow
  • BWizard() : CBasePropertyPage , CExtObject , CBasePropertyPage
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- c -

  • CAboutDlg() : CAboutDlg
  • CAccount() : CAccount
  • CacheHint() : CComponent
  • CachePluginAdmin() : CachePluginAdmin
  • CacheProxyPlugin() : CacheProxySamplePlugin::CacheProxyPlugin
  • CActivitySub() : CActivitySub
  • CAddDeviceDlg() : CAddDeviceDlg
  • CAddFolderDlg() : CAddFolderDlg
  • CAddVFileDlg() : CAddVFileDlg
  • CAdminNotifyHandler() : CAdminNotifyHandler
  • CADOComponent() : CADOComponent
  • CADQIApp() : CADQIApp
  • CADQIDlg() : CADQIDlg
  • CADsSearch() : CADsSearch
  • CADVCGENApp() : CADVCGENApp
  • CADVCGENDlg() : CADVCGENDlg
  • CAdvClientDlg() : CAdvClientDlg
  • CAdvRecoApp() : CAdvRecoApp
  • CAgentCtlAnimationNames() : CAgentCtlAnimationNames
  • CAgentCtlAudioObject() : CAgentCtlAudioObject
  • CAgentCtlBalloonEx() : CAgentCtlBalloonEx
  • CAgentCtlCharacterEx() : CAgentCtlCharacterEx
  • CAgentCtlCharacters() : CAgentCtlCharacters
  • CAgentCtlCommandEx() : CAgentCtlCommandEx
  • CAgentCtlCommandsEx() : CAgentCtlCommandsEx
  • CAgentCtlPropertySheet() : CAgentCtlPropertySheet
  • CAgentCtlRequest() : CAgentCtlRequest
  • CAgentCtlUserInput() : CAgentCtlUserInput
  • CAggregate() : CAggregate
  • CalcLen() : ISAPI_STRING , ISAPI_STRINGW
  • CalculateRowData() : CRow
  • CalculateRowDataToDelete() : CRow
  • Call() : Conf
  • CallAccepted() : Conf
  • CallBack() : CCallBack
  • CallbackFunction()
: CallbackIUnknownLib::ServiceCallBackInterface
, CallbackIUnknownLib::DeviceFinderCallBackInterface
  • CallCreated() : CMgrNotify , Conf
  • CallRejected() : Conf
  • CAlterColumnDlg() : CAlterColumnDlg
  • CAlterIndexDlg() : CAlterIndexDlg
  • CAlterTableDlg() : CAlterTableDlg
  • CanBeManaged() : CStorageResource , IStorageProperties
  • CanBePooled() : CCrmFilesWorker , COMPlus , CProxy
  • Cancel()
: fullsvr::AsyncFullServ
, fullsvr::ICancelMethodCalls
, msado15::_Command
, msado15::_Connection
, msado15::_Record
, msado15::_Recordset
, msado15::_Stream
, msado15::Command
, msado15::Connection
, msado15::Record
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
, msado15::Stream
, CImpICommandText
, CProgress
  • CancelAsyncCall() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • CancelBatch()
: msado15::Recordset21
, msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
  • Cancelled() : CPrintRequest , WiaWrap::CProgressDlg
  • cancelRequest() : RSProxy
  • CancelUpdate()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • CAnchorTag() : CAnchorTag
  • CanConnectionBePooled() : CPooledData
  • CanConvert() : CImpIConvertType
  • CanConvertProc() : CMDIChild
  • CanInPlaceActivate() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • CanNextPage() : CModel
  • CanNextSection() : CModel
  • CanNodeBeClustered() : CMyCapabilities
  • CAnnotator() : CAnnotator
  • CanPaste() : CEditBoxLite
  • CanPrevPage() : CModel
  • CanPrevSection() : CModel
  • CAPIApp() : CAPIApp
  • CAPIDoc() : CAPIDoc
  • CAPIView() : CAPIView
  • CapJ() : CapJ
  • CapJ_activate() : CapJ
  • CapJ_closing() : CapJ
  • CapJ_deactivate() : CapJ
  • CAppExportDlg() : CAppExportDlg
  • CAppInfo() : CAppInfo
  • CAppInstallDlg() : CAppInstallDlg
  • CApplet() : CApplet
  • CAppletSession() : CAppletSession
  • CAppLite() : CAppLite
  • CAppShareNotify() : CAppShareNotify
  • CAppSub() : CAppSub
  • CAppUtilDlg() : CAppUtilDlg
  • CaptureImage() : CDataGrid
  • CAssoc() : CAssoc< KEY, VALUE >
  • CastToStruct() : CFullPropSpec
  • CAsyncFullServ() : CAsyncFullServ
  • CAsynchBase() : CAsynchBase
  • CAsynchNotify() : CAsynchNotify
  • CAsyncQuerySink() : CAsyncQuerySink
  • CAsyncTest() : CAsyncTest
  • CAsyncXXX() : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • CategoryTree_BeforeExpand() : UDDI::Tools::CategoryTreeView
  • CategoryTreeNode() : UDDI::Tools::CategoryTreeNode
  • CategoryTreeView() : UDDI::Tools::CategoryTreeView
  • CAttributeValueAddButton() : CAttributeValueAddButton
  • CAttributeValueDeleteButton() : CAttributeValueDeleteButton
  • CAttributeValueEditButton() : CAttributeValueEditButton
  • CAttributeValueEditor() : CAttributeValueEditor
  • CAuthenticateAdmin() : CAuthenticateAdmin
  • CAuthenticateContext() : CAuthenticateContext
  • CAuthenticatePlugin() : CAuthenticatePlugin
  • CAVIFileReader() : CAVIFileReader
  • CAVIFileWriter() : CAVIFileWriter
  • CBackground() : CBackground
  • CBackgroundFolder() : CBackgroundFolder
  • CBankDlg() : CBankDlg
  • CBase() : CBase
  • CBaseDialog() : CBaseDialog
  • CBaseNode() : CBaseNode
  • CBaseObj() : CBaseObj
  • CBasePropertyPage() : CBasePropertyPage
  • CbBufferSize() : CClusPropList
  • CbCurrentValueLength() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • CbDataLeft() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • CbDataSize() : CClusPropValueList
  • CBehavior() : CBehavior
  • CbhCurrentPropertyName() : CClusPropList
  • CbhCurrentValue() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • CbhCurrentValueList() : CClusPropList
  • CbhPropList() : CClusPropList
  • CbhValueList() : CClusPropValueList
  • CBicycle() : CBicycle
  • CBicycleFolder() : CBicycleFolder
  • CBinder() : CBinder
  • CBindings() : CBindings
  • CBitArray() : CBitArray
  • CBitmapWnd() : CBitmapWnd
  • CBlackPen() : CBlackPen
  • CBlockFormat() : CBlockFormat
  • CBlockFrame() : CBlockFrame
  • CBox() : CBox
  • CBoxFormat() : CBoxFormat
  • CbPropList() : CClusPropList
  • CBrowserHost() : CBrowserHost
  • CBrush() : CBrush
  • CBSTR() : CBSTR
  • CButtonLite() : CButtonLite
  • CByotTransObj() : CByotTransObj
  • CCacheMapEl() : CCacheMapEl
  • CCallAs() : CCallAs
  • CCallAsFactory() : CCallAsFactory
  • CCallBack() : CCallBack
  • CCallbackWrapper() : CCallbackWrapper
  • CCallNotify() : CCallNotify
  • CCanvas() : CCanvas
  • CCapMFCApp() : CCapMFCApp
  • CCapMFCDlg() : CCapMFCDlg
  • CCascade() : CCascade
  • CCaseTextService() : CCaseTextService
  • CCertEncodeAltName() : CCertEncodeAltName
  • CCertEncodeBitString() : CCertEncodeBitString
  • CCertEncodeCRLDistInfo() : CCertEncodeCRLDistInfo
  • CCertEncodeDateArray() : CCertEncodeDateArray
  • CCertEncodeLongArray() : CCertEncodeLongArray
  • CCertEncodeStringArray() : CCertEncodeStringArray
  • CCertExitSample() : CCertExitSample
  • CCertManageExitModuleSample() : CCertManageExitModuleSample
  • CCertManagePolicyModuleSample() : CCertManagePolicyModuleSample
  • CCertPolicySample() : CCertPolicySample
  • CChannelNotify() : CChannelNotify
  • CCharBlock() : CCharBlock
  • CCharGrid() : CCharGrid
  • CChildView() : CChildView
  • CClassFactory() : CClassFactory
  • CClassFactoryWrapper() : CClassFactoryWrapper
  • CClassPro() : CClassPro
  • CClientApp() : CClientApp
  • CClientDlg() : CClientDlg
  • CClipBookServerParamsPage() : CClipBookServerParamsPage
  • CCloseQueueDialog() : CCloseQueueDialog
  • CClusPropList() : CClusPropList
  • CClusPropValueList() : CClusPropValueList
  • CClusterUtils() : CClusterUtils
  • CCmdLineConsumerApp() : CCmdLineConsumerApp
  • CCmdLineConsumerDlg() : CCmdLineConsumerDlg
  • CCmdLineLite() : CCmdLineLite
  • CCodeGrid() : CCodeGrid
  • CColumnInfo() : CColumnInfo
  • CColumnProvider() : CColumnProvider
  • CComboBoxEx() : CComboBoxEx
  • CComboBoxGuid() : CComboBoxGuid
  • CComboBoxLite() : CComboBoxLite
  • CComboBoxString() : CComboBoxString
  • CCommand() : CCommand
  • CCommBand() : CCommBand
  • CCompartmentMonitor() : CCompartmentMonitor
  • CCompImportDlg() : CCompImportDlg
  • CCompInstallDlg() : CCompInstallDlg
  • CComponent() : CComponent
  • CComponentData() : CComponentData
  • CCompositionEditSession() : CCompositionEditSession
  • CComPtrArray() : WiaWrap::CComPtrArray< T >
  • CComputer() : CComputer
  • CComSpy() : CComSpy
  • CComSpyPropPage() : CComSpyPropPage
  • CComSpySqlAudit() : CComSpySqlAudit
  • CComSyncTest() : CComSyncTest
  • CComWSTR() : CComWSTR
  • CConfNotify() : CConfNotify
  • CConnectDlg() : CConnectDlg
  • CConnectionPoint() : CConnectionPoint
  • CConnectionPointContainer() : CConnectionPointContainer
  • CConsole() : CConsole
  • CConstraintDlg() : CConstraintDlg
  • CConsumer() : CConsumer
  • CContainerBase() : CContainerBase
  • CContextAdmin() : CContextAdmin
  • CContextMenu() : CContextMenu
  • CContextMenuExtension() : CContextMenuExtension
  • CContextPlugin() : CContextPlugin
  • CContextSamplePropPage() : CContextSamplePropPage
  • CCreateQueueDialog() : CCreateQueueDialog
  • CCreateTable() : CCreateTable
  • CCriticalSection() : CCriticalSection
  • CCrmDebugCompensator() : CCrmDebugCompensator
  • CCrmFilesCompensator() : CCrmFilesCompensator
  • CCrmFilesTest() : CCrmFilesTest
  • CCrmFilesWorker() : CCrmFilesWorker
  • CCrmMonComp() : CCrmMonComp
  • CCRMSub() : CCRMSub
  • CCTypeSet() : CCTypeSet
  • CCustomError() : CCustomError
  • CCustomPropertyStore() : CCustomPropertyStore
  • CDataAccess() : CDataAccess
  • CDataCallback() : WiaWrap::CDataCallback
  • CDataGrid() : CDataGrid
  • CDataLinks() : CDataLinks
  • CDataNotify() : CDataNotify
  • CDataObject() : CDataObject
  • CDataset() : CDataset
  • CDataSource() : CDataSource
  • CDataXferObj() : CDataXferObj
  • CDbAlloc() : CDbAlloc
  • CDBAuthAdmin() : CDBAuthAdmin
  • CDBAuthPlugin() : CDBAuthPlugin
  • CDBFile() : CDBFile
  • CDBSession() : CDBSession
  • CDelegationBase() : CDelegationBase
  • CDeleteObjectDlg() : CDeleteObjectDlg
  • CDeleteQueueDialog() : CDeleteQueueDialog
  • CDeskBand() : CDeskBand
  • CDeviceFinderCallback() : CDeviceFinderCallback
  • CDeviceNode() : CDeviceNode
  • CDeviceProp() : CDeviceProp
  • CDialogBase() : CDialogBase
  • CDialogLite() : CDialogLite
  • CDialogStream() : CDialogStream
  • CDimmer() : CDimmer
  • CDimmerService() : CDimmerService
  • CDisdrawApp() : CDisdrawApp
  • CDisdrawDlg() : CDisdrawDlg
  • CDlgDest() : CDlgDest
  • CDlgIADs() : CDlgIADs
  • CDlgIADsContainer() : CDlgIADsContainer
  • CDlgIADsLargeInteger() : CDlgIADsLargeInteger
  • CDlgIADsOpenDSObject() : CDlgIADsOpenDSObject
  • CDlgIADsPropertyList() : CDlgIADsPropertyList
  • CDlgIADsSecurityDescriptor() : CDlgIADsSecurityDescriptor
  • CDlgIDirectoryObject() : CDlgIDirectoryObject
  • CDlgIDirectorySearch() : CDlgIDirectorySearch
  • CDlgSrc() : CDlgSrc
  • CDog() : CDog
  • CDownloadBindStatusCallback() : CDownloadBindStatusCallback
  • CDownloadUI() : CDownloadUI
  • CDragSource() : CDragSource
  • CDrawArea() : CDrawArea
  • CDropObject() : CDropObject
  • CDropSource() : CDropSource
  • CDropTarget() : CDropTarget
  • CDSLAdvancedPage() : CDSLAdvancedPage
  • CDSLConnectionPage() : CDSLConnectionPage
  • CDynamic() : CDynamic
  • CEapCfg() : CEapCfg
  • CEditBoxLite() : CEditBoxLite
  • CEditSessionBase() : CEditSessionBase
  • CEditValueDlg() : CEditValueDlg
  • CEmptyVolumeCache() : CEmptyVolumeCache
  • CEnlistTransaction() : CEnlistTransaction
  • CenterWindow() : CReceiveWaitDialog
  • CEntity() : CEntity
  • CEnumConnectionPoints() : CEnumConnectionPoints
  • CEnumConnections() : CEnumConnections
  • CEnumDisplayAttributeInfo() : CEnumDisplayAttributeInfo
  • CEnumerator() : CEnumerator
  • CEnumFormatEtc() : CEnumFormatEtc
  • CEnumIDList() : CEnumIDList
  • CEnumStorageResource() : CEnumStorageResource
  • CEnumSyncMgrItems() : CEnumSyncMgrItems
  • CEnumTASK() : CEnumTASK
  • CEnumXXX() : CEnumXXX< T, ELT_T, IFACE >
  • CError() : CError
  • CertEnumSystemStore() : storesh::Win32
  • CertEnumSystemStoreCallback() : storesh::Storesh
  • CertFindChainInStore() : Sample::Win32
  • CertOpenSystemStore() : Sample::Win32
  • CEvent() : CEvent
  • CEventCallback() : WiaWrap::CEventCallback
  • CEventSink() : CEventSink
  • CEvtStoreSub() : CEvtStoreSub
  • CException() : CException
  • CExceptionSub() : CExceptionSub
  • CExecuteParamDlg() : CExecuteParamDlg
  • CExList() : CExList< TYPE >
  • CExplorerBar() : CExplorerBar
  • CExtBuffer() : CExtBuffer
  • CExtendContextMenuEx() : CExtendContextMenuEx
  • CExtendPropertySheet() : CExtendPropertySheet
  • CExtObject() : CExtObject
  • CExtPageUser() : CExtPageUser
  • CExtractIcon() : CExtractIcon
  • CFactory() : CFactory
  • CFastVariant() : CFastVariant
  • CFileIdx() : CFileIdx
  • CFileIO() : CFileIO
  • CFileLite() : CFileLite
  • CFileShareSampleParamsPage() : CFileShareSampleParamsPage
  • CFileStream() : CFileStream
  • CFileTransferNotify() : CFileTransferNotify
  • CFileViewer() : CFileViewer
  • CFixedAlloc() : CFixedAlloc
  • CFlipDocEditSession() : CFlipDocEditSession
  • CFlipEditSession() : CFlipEditSession
  • CFolderNode() : CFolderNode
  • CFont() : CFont
  • CFontSelect() : CFontSelect
  • CFontSet() : CFontSet
  • CFrame() : CFrame
  • CFrameFormat() : CFrameFormat
  • CFrameWndLite() : CFrameWndLite
  • CFreeTest() : CFreeTest
  • CFtNotify() : CFtNotify
  • CFullConnect() : CFullConnect
  • CFullConnectOptions() : CFullConnectOptions
  • CFullConnectProperties() : CFullConnectProperties
  • CFullConnectProvider() : CFullConnectProvider
  • CFullConnectSecurity() : CFullConnectSecurity
  • CFullPropSpec() : CFullPropSpec
  • CFullServ() : CFullServ
  • CFVClassFactory() : CFVClassFactory
  • CGdiplusInit() : CGdiplusInit
  • CGenerateRC() : CGenerateRC
  • CGenericEnum() : CGenericEnum
  • CGenericUCPApp() : CGenericUCPApp
  • CGenericUCPDlg() : CGenericUCPDlg
  • CGetCounter() : Cstack_c
  • CGetInfoExDlg() : CGetInfoExDlg
  • CGetReceipt() : CGetReceipt
  • CGrid() : CGrid
  • CGridIt() : CGridIt
  • CHandler() : CHandler
  • Change() : CThumbNailPhotoHolder
  • ChangeRestrictions() : CSchemaDlg
  • ChangeSelectedRow() : CMDIChild
  • ChangeState() : CHtmlIFilter
  • ChangeTableName() : CS1Dialog
  • ChangeType() : CFastVariant , CVariant
  • ChannelChanged() : CConfNotify
  • ChannelConfirm() : CAppletSession
  • ChannelIndication() : CAppletSession
  • Char() : CCanvas
  • Character() : CAgentCtlCharacters
  • CheckAccess() : CMyEventProvider
  • CheckButton() : CButtonLite
  • CheckCanceledHelper() : CCommand
  • CheckCertPolicy() : CIsapiCertPolicyFilter
  • CheckDlgButton() : CWndLite
  • checkForAppAlreadyInstalled() : NewsFlash , NewsSubscriber
  • checkForApplication() : NewsFlash , NewsSubscriber
  • checkForComponent() : NewsFlash , NewsSubscriber
  • CheckMediaType() : CPlgPin
  • CheckOfficeNamespace() : CAdvClientDlg
  • CheckTable() : CMSOmniProvRowset
  • checkValidity() : Sample::Sample
  • CHello() : CHello
  • CHelloClassFactory() : CHelloClassFactory
  • CHelloEditSession() : CHelloEditSession
  • chHideLayer_CheckedChanged() : AutoClaims::AutoClaims
  • ChildrenResize() : CFileViewer
  • CHiPerfProvider() : CHiPerfProvider
  • chklbPlugins_ItemCheck() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • chklbPlugins_MouseDown() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • CHMMSampleApp() : CHMMSampleApp
  • Choose() : CFont
  • ChooseFont() : CComSpy , IComSpy , CModel
  • ChooseLogFile() : CComSpy , IComSpy
  • CHourglass() : CHourglass
  • CHtmlElemBagEntry() : CHtmlElemBagEntry
  • CHtmlElement() : CHtmlElement
  • CHtmlElementBag() : CHtmlElementBag
  • CHtmlIFilter() : CHtmlIFilter
  • CHtmlIFilterBase() : CHtmlIFilterBase
  • CHtmlIFilterCF() : CHtmlIFilterCF
  • CHtmlScanner() : CHtmlScanner
  • CHuman() : CHuman
  • CIceSkate() : CIceSkate
  • CIceSkateFolder() : CIceSkateFolder
  • CIdentitySub() : CIdentitySub
  • CImageTag() : CImageTag
  • CImp_DrawApp() : CImp_DrawApp
  • CImp_DrawDlg() : CImp_DrawDlg
  • CImpAuth() : CImpAuth
  • CImpIAdviseSink() : CImpIAdviseSink
  • CImpIFileViewer() : CImpIFileViewer
  • CImpIOleClientSite() : CImpIOleClientSite
  • CImpIOleDocumentSite() : CImpIOleDocumentSite
  • CImpIOleInPlaceSite() : CImpIOleInPlaceSite
  • CImpIPersistFile() : CImpIPersistFile
  • CImpISpecifyPropertyPages() : CImpISpecifyPropertyPages
  • CImportRes() : CImportRes
  • CInkInputWnd() : CInkInputWnd
  • CInputTag() : CInputTag
  • CInstanceSub() : CInstanceSub
  • CInstPro() : CInstPro
  • CInterfaceDlg() : CInterfaceDlg
  • CIntTrace() : CIntTrace
  • Circle() : CCanvas
  • CIsapiCertPolicyFilter() : CIsapiCertPolicyFilter
  • CISeqStream() : CISeqStream
  • CKeystrokeEditSession() : CKeystrokeEditSession
  • CLandBasedVehicle() : CLandBasedVehicle
  • CLangBarItemButton() : CLangBarItemButton
  • CLanguageResourceSampleCF() : CLanguageResourceSampleCF
  • ClassToString() : CMainFrame
  • CLBSub() : CLBSub
  • CLDisp() : CLDisp
  • CleanPathNameArray() : CMainFrame
  • CleanUp() : CSids
  • Cleanup() : CStorageResource
  • CleanupSessions() : CRTCWin
  • Clear() : msado15::Errors , CDynamic , CEntity , CResultset , CFastVariant , CVariant , CIntTrace , CISeqStream , CUtilString , CCanvas , WiaWrap::CComPtrArray< T > , CThumbNailPhotoHolder , RqsConfig , RqsEngine , CVARIANT , RealTimeStylusPluginApp::RealTimeStylusPluginApp , SmartRefPointer< T > , CSmartComPtr< T >
  • ClearAll() : CDataGrid
  • ClearAllDataStructures() : CGenericUCPDlg
  • ClearAllEvents() : CComSpy , IComSpy
  • ClearArray() : CProxy , CStaticMap
  • ClearArrays() : CEntity
  • ClearBuddyList() : CRTCWin
  • clearButton_click() : NewsSubscriber
  • clearCheck() : InkHitTest::InkHitTest
  • ClearDataAdviseHolder() : CSimpSvrObj
  • ClearDeviceCombo() : CGenericUCPDlg
  • clearDirty() : CStaticNode
  • ClearDoc() : CSimpSvrApp
  • ClearFields() : CDataGrid
  • ClearInRosterFlag() : CMember
  • ClearObj() : CSimpSvrDoc
  • ClearOleAdviseHolder() : CSimpSvrObj
  • ClearOleClientSite() : CSimpSvrObj
  • ClearPropList() : CClusPropList
  • ClearQueue() : ISAPITHREAD
  • ClearSelCols() : CDataGrid
  • ClearServiceCombo() : CGenericUCPDlg
  • ClearStrings() : RqsConfig
  • Click() : AgentNotifySink , Notify
  • ClientAdd() : RqsEngine
  • ClientAuthenticate() : RqsEngine
  • ClientClearQuarantine() : RqsEngine
  • ClientCompleteCb() : RqsEngine
  • ClientConnect() : RqsEngine
  • ClientConnectCb() : RqsEngine
  • ClientList() : ClientList
  • ClientLogInfo() : RqsEngine
  • ClientReadCb() : RqsEngine
  • ClientReadMessages() : RqsEngine
  • ClientRemove() : RqsEngine
  • CLine() : CLine
  • CLineGrid() : CLineGrid
  • CLinkable() : CLinkable
  • CList() : CList< TYPE, ARG_TYPE >
  • CListBoxLite() : CListBoxLite
  • CListener() : CListener
  • CListHeader() : CListHeader
  • CListViewLite() : CListViewLite
  • CLListImpl() : CLListImpl< TYPE, ARG_TYPE >
  • CLocateDialog() : CLocateDialog
  • CLock() : CLock
  • CLockHandler() : CLockHandler
  • CLogFile() : CLogFile
  • CLoginDlg() : CLoginDlg
  • Clone() : CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc , COleDocumentView , CSimpleObject , msado15::_Recordset , msado15::Recordset , msado15::Recordset20 , msado15::Recordset21 , CStream , CStorageBuffer , CFileStream , CImpIStream , CGenericEnum , CEnumSyncMgrItems , CEnumFormatEtc , CEnumTASK , CEnumStorageResource , CStorageResource , CEnumFormatEtc , CDataObject , CEnumIDList , CEnumDisplayAttributeInfo , CCustomPropertyStore
  • Close() : msado15::Stream , CDBFile , CFileLite , SIMPLE_BROWSER , ASYNC_REQUESTER , CMmStream , PMmStream , CComSpy , COleObject , CFrame , CSite , CSimpleDoc , CSimpSvrDoc , msado15::_Connection , msado15::_Record , msado15::_Recordset , msado15::_Stream , msado15::Connection , msado15::Connection15 , msado15::Record , msado15::Recordset , msado15::Recordset15 , msado15::Recordset20 , msado15::Recordset21
  • CloseCommentEditBox() : CAnnotator
  • CloseComPort() : CPSTN
  • CloseConnection() : IPluggableTransport , CPluggableTransport
  • CloseCurrentStatement() : CODBCData
  • CloseDW() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • CloseFile() : CFileStream
  • CloseListenSocket() : CX224
  • CloseOleObject() : CSimpleSite
  • closesocket() : DTHandler
  • CloseSocket() : CX224
  • CloseTempFile() : CPack
  • CloseView() : COleDocumentView
  • CMain() : CMain
  • CMainFrame() : CMainFrame
  • CMainWindow() : CMainWindow
  • CMallocSpy() : CMallocSpy
  • CMap() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • CMarkTextService() : CMarkTextService
  • CMDIChild() : CMDIChild
  • CMDIChildLite() : CMDIChildLite
  • CMDIFrameLite() : CMDIFrameLite
  • CMDIObjects() : CMDIObjects
  • CMDITrace() : CMDITrace
  • CMember() : CMember
  • CMemoryMappedInputStream() : CMemoryMappedInputStream
  • CMessageDlg() : CMessageDlg
  • CMetaTag() : CMetaTag
  • CMethodPro() : CMethodPro
  • CMethodSub() : CMethodSub
  • CMgdClusCfgInit() : CMgdClusCfgInit
  • CMgdResType() : CMgdResType
  • CMgrNotify() : CMgrNotify
  • CMMCControl() : CMMCControl
  • CMmStream() : CMmStream
  • CMmStreamBuf() : CMmStreamBuf
  • CMmStreamConsecBuf() : CMmStreamConsecBuf
  • CModel() : CModel
  • CMonitor() : CMonitor
  • CMonitorServer() : CMonitorServer
  • CMoveDlg() : CMoveDlg
  • CMoveMoney() : CMoveMoney
  • CMSMQEventHandler() : CMSMQEventHandler
  • CMSOmniProvRowset() : CMSOmniProvRowset
  • CMSOmniProvSession() : CMSOmniProvSession
  • CMultichanApp() : CMultichanApp
  • CMultipleResults() : CMultipleResults
  • CMultipleResultsDlg() : CMultipleResultsDlg
  • CMultiRecoApp() : CMultiRecoApp
  • CMultiValuedAttributeEditor() : CMultiValuedAttributeEditor
  • CMultiValuedListBox() : CMultiValuedListBox
  • CMyCapabilities() : CMyCapabilities
  • CMyEventProvider() : CMyEventProvider
  • CMyEvictListener() : CMyEvictListener
  • CMyInkCollector() : CMyInkCollector
  • CMyInkEvents() : CMyInkEvents
  • CMyMemberSetChangeListener() : CMyMemberSetChangeListener
  • CMySink() : CMySink
  • CMyStartupListener() : CMyStartupListener
  • CNewsEvent() : CNewsEvent
  • CNode() : CNode< TYPE >
  • CNotify() : CNotify
  • CNullModem() : CNullModem
  • Cobj() : CExtObject
  • CObjConstSub() : CObjConstSub
  • CObjData() : CObjData
  • CObject() : CObject
  • CObjPool2Sub() : CObjPool2Sub
  • CObjPoolSub() : CObjPoolSub
  • CObjSecurity() : CObjSecurity
  • CObjSub() : CObjSub
  • CObjTree() : CObjTree
  • COBLIST() : COBLIST
  • CoCreateInstance() : CSmartPtr< T > , CSmartPtrTrace< T >
  • CODBCData() : CODBCData
  • COfficeDlg() : COfficeDlg
  • Col() : CGridIt
  • ColContaining() : CDataGrid
  • COleClient() : COleClient
  • COLEDBComponent() : COLEDBComponent
  • COleDocument() : COleDocument
  • COleDocumentView() : COleDocumentView
  • COleInPlaceActiveObject() : COleInPlaceActiveObject
  • COleInPlaceObject() : COleInPlaceObject
  • COleObject() : COleObject
  • CollectResultRows() : CProxy
  • CollectUserInput() : CSimpleDialog
  • ColumnChangeProc() : CMDIChild
  • ColWidth() : IComSpy
  • Command() : Notify , CVirtualFile , CAgentCtlCommandsEx , CFolderNode , CComponentData , CVirtualFile , CFolderNode , CComponentData , CController , CComponent , CComponentData , CContextMenuExtension , CComponentData , CBaseNode , CComponentData , CDeviceNode , CStaticNode , CExtendContextMenuEx , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CComponentData , CDeviceNode , CStaticNode , CVirtualFile , CBaseNode , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CComponent , CComponentData , AgentNotifySink , Notify
  • CommandPersistProc() : CMDIChild
  • Commit() : CSimpleObject , CCrmFilesTest , CStorageBuffer , CFileStream , CImpIStream
  • CommitChanges() : CStorageResType , CMgdResType
  • CommitRecord() : CCrmDebugCompensator , CCrmFilesCompensator
  • CommitRecordVariants() : CCrmDebugCompensator
  • CommitTrans()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • CommitTransaction() : CByotTransObj
  • CommitTransactionProc() : CMDIChild
  • CommitTransComplete()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • CommonConstruct() : CBasePropertyPage
  • Compare() : COBLIST , CString , IRowsetScrollImpl< T, RowsetInterface > , COBLIST
  • CompareBookmarks()
: msado15::Recordset
, msado15::_Recordset
, msado15::Recordset20
, msado15::Recordset21
  • CompareData() : CISeqStream
  • CompareIDs() : CShellFolder
  • CompareItems() : CShellFolder
  • CompareObjects() : CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent
  • compareString() : MyOSPObject
  • ComposePhrase() : CSampleWordBreaker
  • ConcatCopy() : CString
  • Concatenate() : CPidlMgr
  • ConcatenateProperty() : CPropertyTag
  • ConcatInPlace() : CString
  • Conf() : Conf
  • ConferenceCreated() : CMgrNotify , Conf , CMgrNotify
  • ConfigDlgAddListViewItem() : CSettings
  • ConfigDlgDeleteListViewItem() : CSettings
  • Configure() : CCertManageExitModuleSample , CCertManagePolicyModuleSample
  • ConfigureTransport() : CSampleMSPStream
  • Connect() : comadmin::COMAdminCatalog , comadmin::ICOMAdminCatalog , CDataSource , CS3Dialog , CContextSamplePropPage , CMgrNotify , CDataNotify , CNotify , CMgrNotify , CConfNotify , CFtNotify , CNotify , CConfNotify , CNotify , CAppShareNotify , CChannelNotify , CConfNotify , CDataNotify , CNotify , CMgrNotify , CAppShareNotify , CCallNotify , CConfNotify , CMgrNotify , CNotify , CFileTransferNotify , CCallNotify , CMgrNotify , CConfNotify , CTable
  • connect() : DTHandler
  • ConnectComplete()
: msado15::ConnectionEventsVt
, msado15::ConnectionEvents
  • ConnectFromFile() : CServiceComp
  • ConnectRRAS() : RqsEngine
  • ConnectTerminal() : CSampleMSPStream
  • ConnectToTerminalPin() : CSampleMSPStream
  • CONotify() : CONotify
  • const_cast() : IInkCollectorEventsImpl< T >
  • Construct() : CAccount , CUpdateReceipt , CLogFile , CProxy
  • ConstructData() : CPooledData
  • ConsumeAllMessages() : CBankDlg
  • ContainsInsensitive() : WsdlDiscovery::frmMain
  • ContentInfo() : CacheProxySamplePlugin::ContentInfo
  • ContextSensitiveHelp() : CSpyCon , COleInPlaceActiveObject , CFrame , CImpIOleInPlaceSite , CSimpleApp , CBrowserHost , CCommBand , CDeskBand , CExplorerBar , CShellView , CToolBand , COleClient , COleInPlaceObject
  • ContextTypes() : IWMSContextAdmin
  • ControlbarNotify() : CComponent , CBaseNode , CComponent , CFolderNode , CStaticNode , CVirtualFile , CToolBarExtension , CComponent , CDeviceNode , CComponent
  • ConvertIntToByteArray() : Sample::MySignedXml
  • ConvertSurfaceValue() : CBicycle
  • COpenQueueDialog() : COpenQueueDialog
  • COpState() : CProxyPlugin::COpState
  • COptionsAccessor() : COptionsAccessor
  • COptionsCommand() : COptionsCommand
  • COptionsDataSource() : COptionsDataSource
  • COptionsError() : COptionsError
  • COptionsNotify() : COptionsNotify
  • COptionsRowset() : COptionsRowset
  • COptionsSheet() : COptionsSheet
  • Copy() : CEnumConnections , CEnumConnectionPoints , CFastVariant , CEditBoxLite , CComWSTR , CVariant , WiaWrap::CComPtrArray< T > , ISAPI_STRINGW , CPidlMgr , ISAPI_STRING
  • CopyA() : ISAPI_STRINGW
  • CopyAccessors() : CImpIAccessor
  • CopyAndAddSid() : CSids
  • CopyAndRemoveItem() : CSids
  • CopyAToOffset() : ISAPI_STRINGW
  • CopyBeforeWrite() : CString
  • CopyData() : CTable
  • CopyEmptyProp() : CClusPropList
  • CopyExpandSzProp() : CClusPropList
  • CopyFileFullPath() : CSyncMgrHandler
  • CopyFiles() : CSyncMgrHandler
  • CopyFrom() : CComWSTR
  • CopyHandlerSyncInfo() : CSettings
  • CopyIndexes() : CTable
  • CopyInkToClipboard() : InkClipboard::InkClipboard
  • CopyItems() : CShellFolder
  • CopyMultiSzProp() : CClusPropList
  • CopyObjectToClip() : CSimpleDoc
  • CopyProp() : CClusPropList
  • CopyRecord()
: msado15::Record
, msado15::_Record
  • CopySingleItem() : CPidlMgr
  • CopyTables() : CTableCopy
  • CopyTo() : msado15::_Stream , msado15::Stream , CStorageBuffer , CImpIStream , CFileStream , CSimpleObject
  • CopyToBuffer() : WiaWrap::CDataCallback
  • CopyToOffset() : ISAPI_STRING , ISAPI_STRINGW
  • CopyW() : ISAPI_STRING
  • CopyWToOffset() : ISAPI_STRING
  • COrder() : COrder
  • COShip() : COShip
  • COShip2() : COShip2
  • Cot() : CBasePropertyPage , CObjData , CBasePropertyPage , CExtObject , CObjData , CExtObject
  • Count() : CDynamic , CEntity , CResultset , WiaWrap::CComPtrArray< T > , CEnumStorageResource , CStorageResource
  • CountNumberOfFilesInList() : CSyncMgrHandler
  • CountUCSegments() : CFontRange
  • CPack() : CPack
  • CPage() : CPage
  • CPageFormat() : CPageFormat
  • CPaintCanvas() : CPaintCanvas
  • CParameters() : CParameters
  • CPartitionInfo() : CPartitionInfo
  • CPeoplePoweredVehicle() : CPeoplePoweredVehicle
  • CPermEventsApp() : CPermEventsApp
  • CPermEventsDlg() : CPermEventsDlg
  • CPersistFile() : CPersistFile
  • CPersistStorage() : CPersistStorage
  • CPerson() : CPerson
  • CpfCurrentValueFormat() : CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList , CClusPropList
  • CPidlMgr() : CPidlMgr
  • CPingResponder() : CPingResponder
  • CPlane() : CPlane
  • CPlgFilter() : CPlgFilter
  • CPlgPin() : CPlgPin
  • CPlgTermSample() : CPlgTermSample
  • CPluggableTransport() : CPluggableTransport
  • CPoint() : CPoint
  • CPooledData() : CPooledData
  • CPop() : Cstack_c
  • CPower() : CPower
  • CPrintCanvas() : CPrintCanvas
  • CPrintRequest() : CPrintRequest
  • CPrintSDIApp() : CPrintSDIApp
  • CPrintSDIDoc() : CPrintSDIDoc
  • CPrintSDIView() : CPrintSDIView
  • CProcessDlg() : CProcessDlg
  • CProgress() : CProgress
  • CProgressDlg() : WiaWrap::CProgressDlg
  • CProperties() : CProperties
  • CPropertiesBase() : CPropertiesBase
  • CPropertiesDlg() : CPropertiesDlg
  • CPropertyEditSession() : CPropertyEditSession
  • CPropertyIDs() : CPropertyIDs
  • CPropertyInfos() : CPropertyInfos
  • CPropertyPage() : CPropertyPage
  • CPropertyTag() : CPropertyTag
  • CPropIDSets() : CPropIDSets
  • CPropInfoSets() : CPropInfoSets
  • CPropPageLite() : CPropPageLite
  • CProppageUser() : CProppageUser
  • CProppageUserUI() : CProppageUserUI
  • CPropPro() : CPropPro
  • Cprops() : CBasePropertyPage , CClusPropList , CBasePropertyPage , CClusPropList , CFileShareSampleParamsPage , CClusPropList , CClipBookServerParamsPage
  • CPropSets() : CPropSets
  • CPropSheetExtension() : CPropSheetExtension
  • CPropSheetHost() : CPropSheetHost
  • CPropSheetLite() : CPropSheetLite
  • CProvFactory() : CProvFactory
  • CProvider() : CProvider
  • CProvider_IWbemEventConsumerProvider() : CProvider_IWbemEventConsumerProvider
  • CProvider_IWbemEventProvider() : CProvider_IWbemEventProvider
  • CProvider_IWbemServices() : CProvider_IWbemServices
  • CProvider_IWbemUnboundObjectSink() : CProvider_IWbemUnboundObjectSink
  • CProviderFactory() : CProviderFactory
  • CProxy() : CProxy
  • CProxyPlugin() : CProxyPlugin
  • CpsCurrentValueSyntax() : CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList
  • CPSTN() : CPSTN
  • CptCurrentValueType() : CClusPropList , CClusPropValueList , CClusPropList , CClusPropValueList
  • CPTLauncher() : CPTLauncher
  • CPush() : Cstack_c
  • CQCSub() : CQCSub
  • CQueryBox() : CQueryBox
  • CQueryDlg() : CQueryDlg
  • CQuickStringWrap() : CQuickStringWrap
  • CRDOComponent() : CRDOComponent
  • Create() : CStorageResource , CAgentCtlEx , CServiceCallback , CPlex , CFont , CDataGrid , CEnumerator , CFrameWndLite , CServiceComp , CSimpSvrDoc , CSimpleDoc , CSimpleSite , CSite , CBaseDialog , CSimpleSite , CEnumXXX< T, ELT_T, IFACE > , CStdDbOutput , CSimpleDoc , CDataXferObj , CPlex , CDataLinks , CMDIChildLite , CToolBarLite , CDlgDest , CDlgSrc , CController , CDeviceFinderCallback , CBaseDialog , CPlex , CRecoOutputWnd , CAgentCtlEx , CAsyncXXX< T, ISyncFace, IAsyncFace > , CDbAlloc , CWndLite , CStatusBarLite , CXmlDOM , CDataGrid , CPlex , CBaseDialog , CPidlMgr
  • CreateAcceptSocket() : CX224
  • CreateAccessor() : CDataAccess , CImpIAccessor
  • CreateAccessorProc() : CMDIChild
  • CreateAccessors() : CDataAccess , CTable
  • CreateAccount() : CCreateTable , ICreateTable
  • CreateArrayOfEvents() : CDBAuthPlugin , CContextPlugin
  • CreateAuthenticationContext() : CAuthenticatePlugin
  • CreateBinder() : CBinder
  • CreateCacheItemCollection() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • CreateCacheTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • CreateCall() : fullsvr::FullServ , CFullServ , fullsvr::ICallFactory
  • CreateCatalog() : CVCExploreDlg
  • CreateChildWindows() : CMultiRecoApp , CAdvRecoApp
  • CreateClassEnum() : CProvider_IWbemServices , CInstPro , CMethodPro , CClassPro
  • CreateClassEnumAsync() : CMethodPro , CClassPro , CProvider_IWbemServices , CInstPro
  • CreateColInfo() : CMSOmniProvRowset
  • CreateCommand() : CSession , CRow , CImpIDBCreateCommand
  • CreateCompensator() : CCrmMonComp
  • CreateComponent() : CComponentData
  • CreateComPort() : CPSTN
  • CreateConnection() : CPluggableTransport , IPluggableTransport , CPluggableTransport
  • CreateConnectSocket() : CX224
  • CreateDataSourceDirectory() : CSDKSampleStorageSystem
  • CreateDBInstance() : CServiceComp
  • CreateDefaultRow() : CRow
  • CreateDirFileListFromPath() : CSyncMgrHandler
  • CreateDlg() : CDialogLite
  • CreateEnumChild() : CMDIChild
  • CreateEnumInfo() : CEnumerator
  • CreateEnumList() : CEnumIDList
  • CreateFile() : COleDocument , CCrmFilesWorker , CCrmFilesTest
  • CreateFilter() : CPlgTermSample
  • CreateFolderPidl() : CPidlMgr
  • CreateFont() : CModel
  • CreateFQPidl() : CShellFolder
  • CreateGif() : InkBlog::AddBlog
  • CreateHelperFunctions() : CRowset
  • CreateHFontFromIFont() : CComSpy
  • CreateHRow() : IRowsetChangeImpl< T, Storage, RowClass >
  • CreateHtm() : InkBlog::AddBlog
  • CreateIndexProc() : CMDIChild
  • CreateIndirect() : CWndLite
  • CreateInkCollectionSurface() : InkBlog::InkArea
  • CreateInstance() : CClassFactory , CFactory , CEnlistTransaction , CCallAsFactory , CClassFactory , CClassFactoryWrapper , CFactory , Provider_Globals , CClassFactory , CServer , CClassFactory , CHelloClassFactory , CEnumerator , CClassFactory , MyClassFactory , CClassFactory , Provider_Globals , CClassFactory , CProvFactory , CBackgroundCopyCallback , CSmpFilterCF , CClassFactory , CFVClassFactory , CCaseTextService , CMarkTextService , CProvFactory , CClassFactory , CShellExtClassFactory , CClassFactory , HtmlPropIFilterCF , CClassFactory , CHtmlIFilterCF , CLanguageResourceSampleCF , CProvFactory , CFactory
  • CreateInstanceEnum() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • CreateInstanceEnumAsync() : CMethodPro , CClassPro , CProvider_IWbemServices , CInstPro
  • CreateInstanceEnumAsync_Contacts() : CProvider_IWbemServices
  • CreateInstanceEnumAsync_Process() : CProvider_IWbemServices
  • CreateItemPidl() : CPidlMgr
  • CreateList() : CShellView
  • CreateListenSocket() : CX224
  • CreateMSPCall() : CSampleMSP
  • CreateObject() : CFrame , CBase , CSimpSvrDoc
  • CreateParamAccessor() : CCommand
  • CreateParameter()
: msado15::Command15
, msado15::_Command
, msado15::Command
  • CreatePin() : CPlgFilter
  • CreatePlaylistParser() : CSDKSamplePlaylistParserPlugin
  • CreatePlaylistTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • CreatePropertyPages() : CComponentData , CRocket , CComponent , CExtendPropertySheet , CPropSheetExtension , CStaticNode , CRocket , CComponentData , CDelegationBase , CComponentData , CBicycle , CDelegationBase , CFolderNode , CStaticNode , CVirtualFile , CRocket , CComponent , CRocket , CComponent , CBaseNode , CComponent , CDelegationBase , CComponent , CDeviceNode , CFolderNode , CComponentData , CComponent , CBaseNode , CDeviceNode , CVirtualFile , CStaticNode
  • CreatePropertySheetPages() : CExtObject
  • CreatePropertyStore() : CMarkTextService
  • CreateProviderInstance() : CFullConnect
  • CreateRecoContext() : CMultiRecoApp
  • CreateRecoGuides() : CMultiRecoApp
  • CreateRecord() : IRowsetChangeImpl< T, Storage, RowClass >
  • CreateRefreshableEnum() : CHiPerfProvider
  • CreateRefreshableObject() : CHiPerfProvider
  • CreateRefresher() : CHiPerfProvider
  • CreateResource() : CLDisp
  • CreateResourceFile() : CGenerateRC
  • CreateReverseProxyTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • CreateRow() : CImpICreateRow
  • CreateSession() : CDataSource , CImpIDBCreateSession
  • CreateSQLStmt() : CTable
  • CreateStorage() : CSite
  • CreateStream() : CSampleMSPCall
  • CreateStreamObject() : CSampleMSPCall
  • CreateStreams() : CPersistStorage
  • CreateTable() : CTable
  • CreateTableNode() : CS1Dialog
  • CreateTableProc() : CMDIChild
  • CreateToolbar() : CBrowserHost
  • CreateView() : COleDocument
  • CreateViewObject() : CShellFolder
  • CreateViewWindow() : COleDocumentView , CShellView
  • CreateWizardPages() : CExtObject
  • CreateWorkerThread() : CSyncMgrHandler
  • CReceiveMessageDialog() : CReceiveMessageDialog
  • CReceiveWaitDialog() : CReceiveWaitDialog
  • CRecoOutputWnd() : CRecoOutputWnd
  • CRefClient() : CRefClient
  • CRefCount() : CRefCount
  • CRefresher() : CRefresher
  • CRefresherMember() : CRefresherMember< T >
  • CRegAccess() : CRegAccess
  • CReindeer() : CReindeer
  • CRenameDlg() : CRenameDlg
  • CRequestInstance() : CRequestInstance
  • CResourceSub() : CResourceSub
  • CResString() : CResString
  • CResultset() : CResultset
  • CRichEditLite() : CRichEditLite
  • CRocket() : CRocket
  • CRow() : CRow
  • CRowPosition() : CRowPosition
  • CRowset() : CRowset
  • CRowsetViewerDlg() : CRowsetViewerDlg
  • CRTCAVSession() : CRTCAVSession
  • CRTCEvents() : CRTCEvents
  • CRTCIMSession() : CRTCIMSession
  • CRTCIncomingApp() : CRTCIncomingApp
  • CRTCIncomingDlg() : CRTCIncomingDlg
  • CRTCOutgoingApp() : CRTCOutgoingApp
  • CRTCOutgoingDlg() : CRTCOutgoingDlg
  • CRTCSession() : CRTCSession
  • CRTCWin() : CRTCWin
  • CS1Dialog() : CS1Dialog
  • CS2Dialog() : CS2Dialog
  • CS3Dialog() : CS3Dialog
  • CS4Dialog() : CS4Dialog
  • CSAFEARRAY() : CSAFEARRAY
  • CSafeRefCount() : CSafeRefCount
  • CSampleDataContainer() : CSampleDataContainer
  • CSampleDataSource() : CSampleDataSource
  • CSampleDirectory() : CSampleDirectory
  • CSampleDirectoryInfo() : CSampleDirectoryInfo
  • CSampleInstance() : CSampleInstance
  • CSampleMSP() : CSampleMSP
  • CSampleMSPCall() : CSampleMSPCall
  • CSampleMSPStream() : CSampleMSPStream
  • CSamplePipe() : CSamplePipe
  • CSampleStemmer() : CSampleStemmer
  • CSampleWordBreaker() : CSampleWordBreaker
  • CSchemaDlg() : CSchemaDlg
  • CSCP() : CSCP
  • CSCPCMenuDialog() : CSCPCMenuDialog
  • CSCPPageBindingInfo() : CSCPPageBindingInfo
  • CSCPPageGeneral() : CSCPPageGeneral
  • CSCPPageKeywords() : CSCPPageKeywords
  • CSCPUIBindingInfo() : CSCPUIBindingInfo
  • CSCPUIGeneral() : CSCPUIGeneral
  • CSCPUIKeywords() : CSCPUIKeywords
  • CSCPWiz() : CSCPWiz
  • CScreenCanvas() : CScreenCanvas
  • CScriptTag() : CScriptTag
  • CScrollableView() : CScrollableView
  • CScrollBarLite() : CScrollBarLite
  • CSDKSamplePlaylistParser() : CSDKSamplePlaylistParser
  • CSDKSamplePlaylistParserPlugin() : CSDKSamplePlaylistParserPlugin
  • CSDKSampleStorageSystem() : CSDKSampleStorageSystem
  • CSecureObject() : CSecureObject
  • CSecuritySub() : CSecuritySub
  • CSelectEventsDlg() : CSelectEventsDlg
  • CSendMessageDialog() : CSendMessageDialog
  • CSerialStream() : CSerialStream
  • CServer() : CServer
  • CServerDlg() : CServerDlg
  • CServiceCallback() : CServiceCallback
  • CServiceComp() : CServiceComp
  • CSession() : CSession
  • CSessionDlg() : CSessionDlg
  • CSettings() : CSettings
  • CShellExt() : CShellExt
  • CShellExtClassFactory() : CShellExtClassFactory
  • CShellFolder() : CShellFolder
  • CShellIconOverlayID() : CShellIconOverlayID
  • CShellView() : CShellView
  • CShutdownDlg() : CShutdownDlg
  • CSids() : CSids
  • CSimple() : CSimple
  • CSimpleApp() : CSimpleApp
  • CSimpleArray() : CSimpleArray< T >
  • CSimpleClass() : CSimpleClass
  • CSimpleDialog() : CSimpleDialog
  • CSimpleDoc() : CSimpleDoc
  • CSimpleObject() : CSimpleObject
  • CSimpleSite() : CSimpleSite
  • CSimpSvrApp() : CSimpSvrApp
  • CSimpSvrDoc() : CSimpSvrDoc
  • CSimpSvrObj() : CSimpSvrObj
  • CSite() : CSite
  • CSkateboard() : CSkateboard
  • CSkateboardFolder() : CSkateboardFolder
  • CSkyBasedVehicle() : CSkyBasedVehicle
  • CSkyVehicle() : CSkyVehicle
  • CSmartComPtr() : CSmartComPtr< T >
  • CSmartPtr() : CSmartPtr< T >
  • CSmpFilter() : CSmpFilter
  • CSmpFilterCF() : CSmpFilterCF
  • CSnap() : CSnap
  • CSnapinAbout() : CSnapinAbout
  • CSnoopWnd() : CSnoopWnd
  • CSpaceFolder() : CSpaceFolder
  • CSpaceStation() : CSpaceStation
  • CSpaceVehicle() : CSpaceVehicle
  • CSpecialCharHashEntry() : CSpecialCharHashEntry
  • CSpecialCharHashTable() : CSpecialCharHashTable
  • CSplitterLite() : CSplitterLite
  • CSpyCon() : CSpyCon
  • CStabilize() : CStabilize
  • Cstack_c() : Cstack_c
  • CStartOfFileElement() : CStartOfFileElement
  • CSTATest() : CSTATest
  • CStaticMap() : CStaticMap
  • CStaticNode() : CStaticNode
  • CStatusBarLite() : CStatusBarLite
  • CStatusHelper() : CStatusHelper
  • CStdDbOutput() : CStdDbOutput
  • CStorageBuffer() : CStorageBuffer
  • CStorageResource() : CStorageResource
  • CStorageResType() : CStorageResType
  • CStream() : CStream
  • CString() : CString
  • CStringException() : CStringException
  • CStringTable() : CStringTable
  • CSurrogate() : CSurrogate
  • CSyncMgrHandler() : CSyncMgrHandler
  • CSysLCESub() : CSysLCESub
  • CTable() : CTable
  • CTableCopy() : CTableCopy
  • CTabLite() : CTabLite
  • CTAPIEventNotification() : CTAPIEventNotification
  • CTerminateCompositionEditSession() : CTerminateCompositionEditSession
  • CTestApp() : CTestApp
  • CTestCOMPerformance() : CTestCOMPerformance
  • CTestDlg() : CTestDlg
  • CTestDoc() : CTestDoc
  • CTestView() : CTestView
  • CTextElement() : CTextElement
  • CTextField() : CTextField
  • CTextGrid() : CTextGrid
  • CThreadData() : CThreadData
  • CThreadSub() : CThreadSub
  • CThumbNailPhotoHolder() : CThumbNailPhotoHolder
  • CTIMER() : CTIMER
  • CTitleTag() : CTitleTag
  • CtlColor() : CDrawArea
  • CToolBand() : CToolBand
  • CToolBarExtension() : CToolBarExtension
  • CToolBarLite() : CToolBarLite
  • CTransaction() : CTransaction
  • CTransactionOptions() : CTransactionOptions
  • CTreeViewLite() : CTreeViewLite
  • CTSFDataObject() : CTSFDataObject
  • CTSFEditWnd() : CTSFEditWnd
  • CTSFMainWnd() : CTSFMainWnd
  • CTSFPersistentPropertyLoader() : CTSFPersistentPropertyLoader
  • CTxSub() : CTxSub
  • CTypesDialog() : CTypesDialog
  • CUnknown() : CUnknown
  • CUpdateReceipt() : CUpdateReceipt
  • CUpdateTextEditSession() : CUpdateTextEditSession
  • CUrlmonCallback() : CUrlmonCallback
  • CursorButtonDown() : InkCollectorEvents
  • CursorButtonUp() : InkCollectorEvents
  • CursorDown() : InkCollectorEvents
  • CursorInRange() : InkCollectorEvents
  • CursorOutOfRange() : InkCollectorEvents
  • CUserSub() : CUserSub
  • CustomDynamicRendererPlugin() : RealTimeStylusPlugins::CustomDynamicRendererPlugin
  • CustomStylusDataAdded()
: RealTimeStylusPlugins::CustomDynamicRendererPlugin
, InkCollection::InkCollection
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • Cut() : CEditBoxLite
  • CUtil() : CUtil
  • CUtilBSTR() : CUtilBSTR
  • CUtilComPtr() : CUtilComPtr< T >
  • CUtilitiesDlg() : CUtilitiesDlg
  • CUtilProp() : CUtilProp
  • CUtilString() : CUtilString
  • CVARIANT() : CVARIANT
  • CVariant() : CVariant
  • CVARIANT() : CVARIANT
  • CVCExploreApp() : CVCExploreApp
  • CVCExploreDlg() : CVCExploreDlg
  • CVCSecuritySampleClass() : CVCSecuritySampleClass
  • CVector() : CVector< TYPE, IDX >
  • CVectorEx() : CVectorEx< TYPE, IDX >
  • CView() : CView
  • CViewList() : CViewList
  • CVirtualFile() : CVirtualFile
  • CWaitCursor() : CWaitCursor
  • CWaitDlg() : CWaitDlg
  • CWaitSystemDlg() : CWaitSystemDlg
  • CWbemClientApp() : CWbemClientApp
  • CWbemClientDlg() : CWbemClientDlg
  • CWebBrowser() : CWebBrowser
  • CWiaDataCallback() : CWiaDataCallback
  • CWinApp() : CWinApp
  • CWindow() : CWindow
  • CWizard() : CWizard
  • CWizExtUser() : CWizExtUser
  • CWndLite() : CWndLite
  • CWorkerThread() : CWorkerThread
  • CWrapVBComponent() : CWrapVBComponent
  • Cx() : CGridIt
  • CX224() : CX224
  • CXmlDOM() : CXmlDOM
  • CXMLTreeApp() : CXMLTreeApp
  • CXMLTreeDlg() : CXMLTreeDlg
  • Cy() : CGridIt
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- d -

  • DAdvise() : CDataObject , CDataXferObj , CPropSheetHost , CDataObject , CTSFDataObject , CDataObject , CDropObject , CDataObject
  • data() : CPlex , CStringData , CPlex
  • DataReceived() : CDataNotify
  • DataRefresh() : CADVCGENDlg
  • DataSent() : CDataNotify
  • DblClick() : InkCollectorEvents , AgentNotifySink , Notify
  • Deactivate() : CCrmFilesWorker , COMPlus , CProxy , CPropertyPage , CEmptyVolumeCache , CCaseTextService , CMarkTextService
  • DeactivateAndUndo() : CBrowserHost , CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • DeactivateData() : CODBCData , CPooledData
  • DeactivateInPlace() : COleDocument , COleDocumentView
  • DeactivateUI() : COleDocument , COleDocumentView , CSimpSvrObj
  • DeAlloc() : CLDisp
  • DECLARE_AGGREGATABLE() : CCallBack
  • DECLARE_CLASSFACTORY_SINGLETON() : CLDisp
  • DECLARE_FIXED_ALLOC() : CEntity , CStaticEntity , tagFieldMetaData , CString , CFastVariant
  • DECLARE_GET_CONTROLLING_UNKNOWN() : CCallBack
  • DECLARE_PROTECT_FINAL_CONSTRUCT() : CLDisp
  • DECLARE_REGISTRY() : CCertExitSample , CCertPolicySample , CPower , CSimple , CExtObject
  • DECLARE_REGISTRY_CLSID() : CSCP , CSCPWiz , CProppageUser , CWizExtUser
  • DeclareIEAPProviderConfigMembers() : CEapCfg
  • DecrementCountChildSpaceStations() : CSpaceStation
  • DecrementNestCount() : CSafeRefCount
  • DecrementOpenRowsets() : CCommand
  • DefaultCharacterChange() : AgentNotifySink , Notify
  • DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR() : CImpIConvertType , CImpIGetRow , CImpIGetSourceRow , CImpIStream , CImpIAccessor , CImpIBindResource , CImpICreateRow , CImpIDBBinderProperties , CImpICommandText , CImpICommandProperties , CImpIDBInitialize , CImpIDBCreateSession , CImpIDBProperties , CImpIDBInfo , CImpIPersist , CImpIServiceProvider , CImpIGetDataSource , CImpIOpenRowset , CImpISessionProperties , CImpIDBCreateCommand , CImpIRow , CImpIGetSession , CImpIRowChange , CImpIRowset , CImpIRowsetChange , CImpIColumnsInfo , CImpIRowsetInfo , CImpIRowsetIdentity
  • DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA() : CImpIDBCreateCommand
  • Delete()
: msado15::_DynaCollection
, msado15::_Recordset
, msado15::Fields
, msado15::Fields20
, msado15::Parameters
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
, CMemoryException
, CPidlMgr
  • DeleteAllItems() : CListViewLite , CTreeViewLite , CTabLite
  • DeleteChildItems() : CDeviceNode
  • DeleteClass() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • DeleteClassAsync() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • DeleteColumn() : CListViewLite
  • DeleteDataContainer() : CSDKSampleStorageSystem
  • DeleteDirectory() : CSDKSampleStorageSystem
  • DeleteEntity() : CResultset
  • DeleteFile() : CCrmFilesWorker , CCrmFilesTest
  • DeleteInstance() : CClassPro , CProvider_IWbemServices , CReindeer , CInstPro , CMethodPro
  • DeleteInstanceAsync() : CClassPro , CProvider_IWbemServices , CInstPro , CMethodPro
  • DeleteItem() : CListViewLite , CTreeViewLite , CTabLite , CShellView
  • DeleteItems() : CShellFolder
  • DeleteItemSettings() : CSettings
  • DeleteList() : CEnumIDList , CViewList
  • DeleteLogError() : CCallbackWrapper
  • DeletePropList() : CClusPropList
  • DeleteRecord()
: msado15::_Record
, msado15::Record
  • DeleteRow() : CFileIdx , CFileIO
  • DeleteRowImmediate() : CDBFile
  • deleteRows() : MyOSPObject
  • DeleteRows() : IRowsetChangeImpl< T, Storage, RowClass > , CImpIRowsetChange
  • DeleteScopeItems() : CStaticNode
  • DeleteSelectedRows() : CMDIChild
  • DeleteString() : CListBoxLite , CComboBoxLite
  • DeleteThisObject() : CGenericEnum , CEnumSyncMgrItems
  • DeleteValueList() : CClusPropValueList
  • DelInst() : CDbAlloc
  • DeliverClient() : CRTCAVSession , CRTCSession
  • DeliverIntensity() : CRTCAVSession , CRTCSession
  • DeliverMedia() : CRTCAVSession , CRTCSession
  • DeliverMessage() : CRTCIMSession , CRTCSession
  • DeliverParticipantState() : CRTCSession
  • DeliverSessionState() : CRTCSession
  • DeliverUserStatus() : CRTCIMSession , CRTCSession
  • DeregisterForConnectionNotification() : RqsEngine
  • Destroy() : CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • destroy() : RSProxy , HelloJ , Hello2J , Hello3J
  • Destroy() : CSite , CProgress , CDialogBase , CController , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent
  • DestroyCatalog() : CVCExploreDlg
  • DestroyDocs() : CSimpleApp
  • DestroyPrevStep() : CWizard
  • DestroyResource() : CLDisp
  • DestroyResourceS() : CLDisp
  • DestroyViewWindow() : CShellView
  • DestroyWindow() : CWndLite
  • Detach() : CFastVariant , CComWSTR , CVariant , CVector< TYPE, IDX > , CProperties , CPropertyInfos , CPropertyIDs , CUtilComPtr< T > , CGrid , CBehavior
  • DetachAnnotator() : CAnnotator , IAnnotator
  • DetermineUnicode() : CFileLite
  • DeviceAdded() : CDeviceFinderCallback
  • DeviceNodeWndProc() : CDeviceNode
  • DeviceRemoved() : CDeviceFinderCallback
  • DialogProc() : CPropertyPage , WiaWrap::CProgressDlg , CRocket , CStaticNode , CPropSheetExtension , CRocket , CBicycle , CRocket
  • dimLevel() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • DisableInsertObject() : CSimpleDoc
  • DisablePlugin() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • DisableWinsock() : IPluggableTransport , CPluggableTransport
  • DisassembleMenus() : CSimpSvrObj
  • DiscardUndoState() : CSpyCon , CImpIOleInPlaceSite , COleClient , CBrowserHost
  • Disconnect() : CDataNotify , CNotify , CConfNotify , CChannelNotify , CConfNotify , msado15::ConnectionEvents , msado15::ConnectionEventsVt , CDataSource , CMgrNotify , CConfNotify , CNotify , CMgrNotify , CFtNotify , CNotify , CMgrNotify , CConfNotify , CNotify , CAppShareNotify , CCallNotify , CConfNotify , CDataNotify , CFileTransferNotify , CMgrNotify , CAppShareNotify , CCallNotify , CMgrNotify , CNotify
  • DisconnectObject() : CClassFactoryWrapper , CDynamic , CEntity , CResultset
  • dispatch() : DTHandler
  • Display() : CS1Dialog , CTypesDialog , CFullConnect , CSchemaDlg , CProgress , CDialogBase , CS2Dialog , CS3Dialog , CS4Dialog , CWizard , Query
  • DisplayACE() : CDlgIADsSecurityDescriptor
  • DisplayAceObjectType() : CDlgIADsSecurityDescriptor
  • DisplayBrowseEnumInfo() : CFullConnect
  • DisplayCertificate() : storesh::Storesh
  • displayChain() : Sample::Sample
  • DisplayChildren() : CBicycleFolder
  • DisplayColumnInfo() : CDataGrid
  • DisplayData() : CDataGrid
  • DisplayDialog() : CMDIChild , CMainWindow
  • DisplayEKU() : storesh::Storesh
  • DisplayEvents() : CAdvClientDlg
  • DisplayFetchPosition() : CDataGrid
  • DisplayFileNames() : CDropTarget
  • displayHelp() : Sample::Sample
  • DisplayHelp() : storesh::Storesh
  • DisplayMessageBox() : CComponent
  • DisplayObject() : CBase , CDataset , CRow , CRowset , CStream
  • DisplayOpenedQueuePathNameArray() : CMainFrame
  • DisplayOwnedEntities() : Microsoft::Uddi::Demo::Publish
  • DisplayPathNameArray() : CMainFrame
  • DisplayProperties() : CPropertiesDlg
  • DisplayProperty() : CPropertiesDlg
  • DisplayPropertyValue() : CVCExploreDlg
  • DisplayRows() : CDataGrid
  • DisplaySetPropsError() : CBasePropertyPage
  • DisplayStep() : CWizard
  • DisplayTaxonomy() : Microsoft::Uddi::Demo::Publish
  • DisplayTaxonomyItems() : Microsoft::Uddi::Demo::Publish
  • DisplayTree() : CSchemaDlg
  • Dispose() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • dispose() : About
  • Dispose()
: UDDI::Tools::CategoryTreeView
, CSharp_Draw::Form1
, CSharp_Draw::InputBox
, AutoClaims::AutoClaims
, InkClipboard::InkClipboard
, InkCollection::InkCollection
, InkErase::InkErase
, InkHitTest::InkHitTest
, InkRecognition::InkRecognition
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
, Serialization::SerializationForm
, WsdlDiscovery::frmMain
  • dispose() : NewsFlash , NewsSubscriber , CapJ
  • Dispose()
: InkBlog::InkArea
, Sample::UI::AboutBox
  • DisposeResources()
: AutoClaims::AutoClaims
, InkBlog::InkArea
  • Distance() : CBehavior
  • Divide() : CCustomPropertyStore
  • DivideInk() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • DlgProc() : CBaseDialog , CS4Dialog , CProgress , CSimpleDialog , CBaseDialog , CDialogLite , CS1Dialog , CS2Dialog , CS3Dialog , CBaseDialog , CTypesDialog , CBaseDialog
  • DoAddBuddy() : CRTCWin
  • DoAPing() : CClientApp
  • DoAuth() : CRTCWin
  • DoCall() : CRTCWin
  • DoConnect() : CNullModem
  • DoContextMenu() : CShellView
  • DoCopyOrCut() : CContextMenu
  • DoDataContainerExtendedCommand() : CSampleDataContainer
  • DoDataExchange() : CReceiveMessageDialog , CReceiveWaitDialog , CSendMessageDialog , CDisdrawDlg , CAboutDlg , CDlgIDirectoryObject , CGenericUCPDlg , CAboutDlg , CCmdLineConsumerDlg , CAboutDlg , CBasePropertyPage , CProcessDlg , CQueryDlg , CShutdownDlg , CSessionDlg , CWaitSystemDlg , CAppInstallDlg , CWaitDlg , CMessageDlg , CDlgIADsOpenDSObject , CClipBookServerParamsPage , CAboutDlg , CDlgIADsPropertyList , CFileShareSampleParamsPage , CCapMFCDlg , CXMLTreeDlg , CAboutDlg , CPermEventsDlg , CAboutDlg , CDisdrawDlg , CWbemClientDlg , CLoginDlg , COfficeDlg , CLocateDialog , CAboutDlg , CAdvClientDlg , CAboutDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CConnectDlg , COpenQueueDialog , CCreateQueueDialog , CLoginDlg , FaxDlg , CDeviceProp , CMoveDlg , CDlgIADs , CADVCGENDlg , CLoginDlg , CServerDlg , CAboutDlg , CBasePropertyPage , CAboutDlg , CCompImportDlg , CAboutDlg , CDeleteQueueDialog , CDlgIADsLargeInteger , CADQIDlg , CAppUtilDlg , CConnectDlg , CUtilitiesDlg , CAppExportDlg , CCompInstallDlg , CVCExploreDlg , CClientDlg , CAboutDlg , CDlgDest , CGetInfoExDlg , CRenameDlg , CDlgSrc , CDeleteObjectDlg , CDlgIDirectorySearch , CDlgIADsSecurityDescriptor , NewDocDlg , CImp_DrawDlg , CCloseQueueDialog , CDlgIADsContainer
  • DoDelete() : CContextMenu
  • DoDisplayMessage() : CRTCIMSession
  • DoDisplayTyping() : CRTCIMSession
  • DoDragDrop() : CSimpleDoc
  • DoDrop() : CDropTarget
  • DoEditSession() : CEditSessionBase , CKeystrokeEditSession , CTerminateCompositionEditSession , CHelloEditSession , CFlipEditSession , CUpdateTextEditSession , CCompositionEditSession , CEditSessionBase , CPropertyEditSession , CFlipDocEditSession
  • DoEnablePresence() : CRTCWin
  • DoExplore() : CContextMenu
  • DoGAKMenu1() : CShellExt
  • DoGAKMenu2() : CShellExt
  • DoGAKMenu3() : CShellExt
  • DoGAKMenu4() : CShellExt
  • DoGenerateProvisioning() : CRTCWin
  • DoHelp() : IMMCControl , CMMCControl
  • DoInPlaceActivate() : CSimpSvrObj
  • DoInPlaceHide() : CSimpSvrObj
  • DoLogOff() : CRTCWin
  • DoLogOn() : CRTCWin
  • DoModal() : AboutDlg , CPropSheetLite , CMainWindow , CDialogLite
  • DoModifyData() : CContextMenu
  • DoMute() : CRTCAVSession
  • Done() : CGridIt
  • DoNewFolder() : CContextMenu
  • DoNewItem() : CContextMenu
  • DoOpen() : CMultiRecoApp , CContextMenu
  • DoPaste() : CContextMenu
  • DoRemoveBuddy() : CRTCWin
  • DoRename() : CContextMenu
  • DoSave() : CMultiRecoApp
  • DoSendMessage() : CRTCIMSession
  • DoSendTyping() : CRTCIMSession
  • DoSetPresence() : CRTCWin
  • doSum() : CAsyncFullServ
  • DoTuningWizard() : CRTCWin
  • DoVerb() : COleObject
  • DoVolume() : CRTCAVSession
  • DoWork() : CBankDlg , CAccount
  • DPtoLP() : CCanvas
  • DragComplete() : Notify , AgentNotifySink , Notify
  • DragEnter() : CDropTarget
  • DragLeave() : CDropTarget
  • DragOver() : CDropTarget
  • DragStart() : Notify , AgentNotifySink , Notify , AgentNotifySink
  • Draw() : CGrid , CSimpSvrObj , CBehavior , CBlockFrame
  • DrawArea_Paint() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • DrawChar() : CSharp_Draw::Form1
  • DrawElement() : CCodeGrid , CCharGrid , CTextGrid
  • DrawLasso() : InkClipboard::InkClipboard
  • DrawLassoConnector() : InkClipboard::InkClipboard
  • DrawLine() : CSharp_Draw::Form1
  • DrawSelectionInkDot() : InkClipboard::InkClipboard
  • DrawSplitter() : CSplitterLite
  • DrawStrokes() : InkClipboard::InkClipboard
  • Drop() : CDropTarget
  • DropCall() : CNullModem
  • DropColumnProc() : CMDIChild
  • DropConstraintProc() : CMDIChild
  • DropFiles() : CFileViewer
  • DropIndexProc() : CMDIChild
  • DropTableProc() : CMDIChild
  • DumpContextInformation() : CContextPlugin
  • DumpInst() : CDbAlloc
  • DumpInstTable() : CDbAlloc
  • DumpLeaks() : CMallocSpy
  • DUnadvise() : CDataObject , CTSFDataObject , CDataObject , CDataXferObj , CDataObject , CDropObject , CDataObject , CPropSheetHost , CDataObject
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- e -

  • EatBlanks() : CHtmlScanner
  • EatTag() : CHtmlScanner
  • EatText() : CHtmlScanner
  • EditItem() : CShellView
  • EditLabel() : CListViewLite
  • EditSubclassProc() : CRTCIMSession
  • Empty() : CComWSTR , MyString , CString
  • EmptyChildren() : CBicycleFolder
  • EmptyList() : COBLIST
  • EnableAudit() : CComSpy
  • EnableButton() : CToolBarLite
  • EnableModeless() : COleInPlaceActiveObject , CFrame , CCallbackWrapper , CShellView
  • EnableNext() : CBasePropertyPage
  • EnablePlugin() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • EnableTable() : CS3Dialog
  • EnableWindow() : CWndLite
  • EnableWinsock() : IPluggableTransport , CPluggableTransport
  • Encode() : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeBitString , CCertEncodeCRLDistInfo
  • End() : CAdminNotifyHandler
  • END_COM_MAP() : CPartitionInfo
  • EndAbort() : CCrmDebugCompensator , CCrmFilesCompensator
  • EndAbortVariants() : CCrmDebugCompensator
  • EndCommit() : CCrmDebugCompensator , CCrmFilesCompensator
  • EndCommitVariants() : CCrmDebugCompensator
  • EndDialog() : CDialogLite
  • EndOfRecordset()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • EndPrepare() : CCrmDebugCompensator , CCrmFilesCompensator
  • EndPrepareVariants() : CCrmDebugCompensator
  • endResponse() : RSProxy
  • EngineDefined() : CComSpySqlAudit , CLBSub , IComSpyAudit
  • Enlist() : CAccount , CUpdateReceipt , CODBCData , CPooledData
  • EnlistResource() : CLDisp
  • EnlistTransaction() : CEnlistTransaction
  • EnsureOfficeNamespace() : CAdvClientDlg
  • EnsureVisible() : CListViewLite , CTreeViewLite
  • Enter() : CCriticalSection , CLock
  • enterHitTestMode() : InkHitTest::InkHitTest
  • enterInkMode() : InkHitTest::InkHitTest
  • enterNearestPointMode() : InkHitTest::InkHitTest
  • EnterNewGame() : CHuman
  • EntityDelete() : CProxy
  • EntityInsert() : CProxy
  • EntityLoad() : CProxy
  • EntityLookup() : CProxy
  • EntityQuery() : CProxy
  • EntityRead() : CProxy
  • EntityUpdate() : CProxy
  • EnumAdvise() : COleObject
  • EnumChildren() : CBicycleFolder
  • EnumConnectionPoints() : CConnectionPointContainer
  • EnumConnections() : CConnectionPoint
  • EnumDAdvise() : CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject , CTSFDataObject
  • EnumDisplayAttributeInfo() : CMarkTextService
  • EnumerateChildren() : CDlgIADsContainer
  • EnumerateInfo() : CEnumerator
  • EnumerateInstances() : CReindeer
  • EnumerateInterface() : CADQIDlg
  • EnumerateResultItems() : CFolderNode
  • EnumerationCallback() : CReindeer
  • EnumFormatEtc() : CDataXferObj , CDropObject , CPropSheetHost , CDataObject , CTSFDataObject , CDataObject
  • EnumObjects() : CShellFolder
  • EnumPropertiesProc() : CMainWindow
  • EnumSyncMgrItems() : CSyncMgrHandler , CSettings
  • EnumTasks() : CComponent
  • EnumVerbs() : COleObject
  • EnumViews() : COleDocument
  • Eof() : CMemoryMappedInputStream , CSerialStream , CMmStreamConsecBuf
  • EraseAtCusps() : InkErase::InkErase
  • EraseAtIntersections() : InkErase::InkErase
  • EraseStrokes() : InkErase::InkErase
  • Error()
: CPrintRequest
, InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::PacketFilterPlugin
  • ErrorRecordsProc() : CMainWindow
  • ErrorString() : CBicycleFolder , CConsumer
  • Escape() : ISAPI_STRING
  • EscapeHandler() : Sample::UI::MainWindow
  • EscapeSlashAndQuoteForRC() : CGenerateRC
  • EstablishConnection() : CCallbackWrapper
  • Evaluate() : CComputer
  • Event() : CRTCIncomingDlg , CRTCEvents , CTAPIEventNotification , CRTCOutgoingDlg
  • EventName() : CSysLCESub
  • EventThread() : CMyEventProvider
  • Evict() : CStorageResource
  • EvictNotify() : CMyEvictListener
  • Exec() : CFrame
  • ExecMethod() : CProvider_IWbemServices , CClassPro , CInstPro , CMethodPro , CReindeer
  • ExecMethodAsync() : CProvider_IWbemServices , CClassPro , CInstPro , CMethodPro
  • ExecNotificationQuery() : CProvider_IWbemServices , CInstPro , CMethodPro , CClassPro
  • ExecNotificationQueryAsync() : CMethodPro , CProvider_IWbemServices , CClassPro , CInstPro
  • ExecQuery() : CClassPro , CInstPro , CProvider_IWbemServices , CMethodPro , CReindeer
  • ExecQueryAsync() : CMethodPro , CInstPro , CClassPro , CProvider_IWbemServices
  • Execute() : CProxy , msado15::_Command , RqsEngine , msado15::Connection , msado15::Command , msado15::Command15 , CMSOmniProvCommand , CCommand , Query , msado15::_Connection , msado15::Connection15 , CMSOmniProvSessionTRSchemaRowset , CImpICommandText , CADsSearch , CMSOmniProvRowset , CMSOmniProvSessionPTSchemaRowset , CMSOmniProvSessionColSchemaRowset
  • ExecuteComplete()
: msado15::ConnectionEventsVt
, msado15::ConnectionEvents
  • ExecuteProc() : CMDIChild
  • ExecuteSQL() : CODBCData
  • Exercise() : CSTATest , CFreeTest , CComSyncTest
  • ExitInstance() : CADsFirstExtApp , CGenericUCPApp , CHMMSampleApp , CADsFirstExtApp , CCmdLineConsumerApp , CPermEventsApp , CSCPWizApp , CMyUIExtApp , CClipBookServerApp , CAppLite , CSCPCMenuApp , CMyWizExtApp , CMyUIExtApp , CFileShareSampleApp , CWinApp
  • exitMenu_click() : CapJ
  • ExitMenu_Click() : Serialization::SerializationForm
  • Expand() : CStaticNode , CPeoplePoweredVehicle , CSpaceStation , CTreeViewLite , CDelegationBase
  • ExpandFileAndAdjustRowObjects() : CDBFile
  • ExportApplication()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • Extract() : CShellExt , CExtractIcon
  • ExtractData() : CPropSheetExtension , CComponentData , CToolBarExtension , CContextMenuExtension
  • ExtractObjectTypeGUID() : CPropSheetExtension , CComponentData , CToolBarExtension , CContextMenuExtension
  • ExtractParams() : CEntity
  • ExtractSnapInCLSID() : CToolBarExtension , CPropSheetExtension , CContextMenuExtension , CComponentData
  • ExtractString() : CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- f -

  • Failed() : CCallNotify
  • FaxDlg() : FaxDlg
  • Fetch() : CFileIO
  • FetchColumnString() : CRow
  • FetchComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • FetchData() : CODBCData
  • FetchNameValFromServerNamespace() : CachePluginAdmin
  • FetchProgress()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • FetchRow() : CDBFile
  • fFileExists() : CGenericUCPDlg
  • FFilterContent() : CHtmlIFilter
  • FieldChangeComplete()
: msado15::RecordsetEventsVt
, msado15::RecordsetEvents
  • FileLoad() : CFileViewer
  • FileShow() : CFileViewer
  • FileShowInit() : CFileViewer
  • FillBinding() : CFileIO
  • FillList() : CShellView
  • FillPidlTable() : CContextMenu , CDataObject
  • FillResultsControl() : WsdlDiscovery::frmMain
  • FillRowArray() : CDBFile
  • FinalConstruct() : CLDisp , CProxy , CMSOmniProvSource , CMSOmniProvCommand , CMSOmniProvSession , CPlgTermSample , CComSpySqlAudit , CCallBack , CCrmDebugCompensator , CCrmMonComp , CAccount , CMoveMoney
  • FinalCountruct() : CPower , CSimple
  • FinalRelease() : CSpyCon , CComSpySqlAudit , CComSpy , CAsyncXXX< T, ISyncFace, IAsyncFace > , CEnumConnections , CEnumConnectionPoints , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CUnknown , CServer , CCallBack , CCrmDebugCompensator , CCrmMonComp , CAccount , CUpdateReceipt , CLDisp , CProxy , CMSOmniProvCommand , CSampleMSPStream , CPower , CSimple
  • Find() : msado15::Recordset , msado15::Recordset15 , msado15::Recordset20 , msado15::Recordset21 , CList< TYPE, ARG_TYPE > , CExList< TYPE > , RqsConfig , CLListImpl< TYPE, ARG_TYPE > , CSimpleArray< T >
  • find() : MyOSPObject
  • Find() : msado15::_Recordset
  • FindBehavior() : CGrid , CFactory
  • FindCacheItem() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • FindConnectionPoint() : CConnectionPointContainer , CContainerBase
  • FindConsumer() : CProvider , CProvider_IWbemEventConsumerProvider , CProvider
  • FindElement() : CVectorEx< TYPE, IDX >
  • FindFileItemWithName() : CSyncMgrHandler
  • FindIndex() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • FindItem() : CComponent
  • FindItemPidl() : CShellView
  • FindItemSettings() : CSettings
  • FindKey() : CStaticMap
  • FindKeyword() : CImpIBindResource
  • FindNext() : CRichEditLite
  • FindNextAttrTransition() : CTSFEditWnd
  • FindNextRowProc() : CMDIChild
  • FindPin() : CPlgTermSample
  • FindPrecedingPlugin() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • FindProperty() : TPropBase< TYPE > , CProperties , CPropertyInfos , CPropertyIDs , CPropSets , CPropInfoSets , CPropIDSets
  • FindPropSet() : TPropSetBase< TYPE, OBJTYPE >
  • FindProxyForURL() : CacheProxySamplePlugin::CacheProxyPlugin
  • findRequest() : RSProxy
  • FindSearchPrefence() : CADsSearch
  • FindSession() : CRTCWin
  • FindSet() : CBitArray
  • FindStr() : ISAPI_STRING
  • FindString() : CComboBoxLite , CComboBoxEx
  • FindStringExact() : CComboBoxLite
  • FindTab() : CTabLite
  • FindText() : CRichEditLite
  • FindWindow() : CMDIFrameLite
  • Finish_Sum() : CAsyncFullServ , fullsvr::AsyncFullServ , fullsvr::AsyncIFullServ
  • Finish_Test1() : CAsyncTest
  • Finish_Test2() : CAsyncTest
  • FinishParsingPacketlist() : CSampleDataContainer
  • FinishQI() : CUnknown
  • FInit() : CImpIAccessor , CBitArray , CCommand , CDataSource , CExtBuffer , CRow , CRowset , CStream , CStringTable
  • fInit() : CFileIdx
  • FInit() : CDBSession , CBinder
  • fInit() : CFileIO
  • fInitApplication() : CSimpleApp , CSimpSvrApp
  • FInitFrameControls() : CFileViewer
  • fInitInstance() : CSimpSvrApp , CSimpleApp
  • Fire_OnFieldChange() : CProxyIRowsetNotify< T >
  • Fire_OnRowChange() : CProxyIRowsetNotify< T >
  • Fire_OnRowsetChange() : CProxyIRowsetNotify< T >
  • Fire_RemoteOnFieldChange() : CProxyIRowsetNotify< T >
  • Fire_RemoteOnRowChange() : CProxyIRowsetNotify< T >
  • Fire_RemoteOnRowsetChange() : CProxyIRowsetNotify< T >
  • FireEvent() : CPlgTermSample , CSampleMSPStream
  • First() : CListHeader , NIDequeIter_c< T >
  • Flush() : msado15::Stream , CStorageBuffer , PMmStream , msado15::_Stream , CMmStream , CFileLite
  • FocusChange() : CExplorerBar , CDeskBand , CCommBand , CToolBand
  • FolderNodeWndProc() : CFolderNode
  • Font() : IComSpy
  • FontChange() : CFileViewer
  • FOpenAs() : CFileViewer
  • Form1() : CSharp_Draw::Form1
  • FormatColumn() : CADsSearch
  • Free() : XPtr< T > , XWindow , XBStr , XPtr< T > , CFixedAlloc , XBStr , XInterface< T > , CUtilString
  • FreeAll() : CFixedAlloc
  • FreeAxisInfo() : CDataset
  • FreeColumn() : CADsSearch
  • FreeData() : CString , CBindings
  • FreeDataChain() : CPlex
  • FreeExtra() : CString
  • FreeNode() : CLListImpl< TYPE, ARG_TYPE >
  • FreePidlTable() : CContextMenu , CDropTarget , CDataObject
  • FreeSurrogate() : CSurrogate
  • frmMain() : WsdlDiscovery::frmMain
  • FtUpdate() : CFtNotify , CFileTransferNotify
  • FullConnect() : CFullConnect
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- g -

  • GarbageCollectNode() : CObjTree
  • GatherColumnInfo() : CFileIO
  • GenerateFileInfo() : CFileIO
  • GenerateWordForms() : CSampleStemmer
  • Gesture() : InkCollectorEvents
  • GestureAt() : CAgentCtlCharacterEx
  • Get() : CSAFEARRAY , CResString , SmartRefPointer< T > , CAgentCtlCharacterEx , CMmStreamBuf , CRegAccess , XPtr< T > , CSAFEARRAY , XWindow , XPtr< T >
  • get_ActivityId() : CCrmMonComp
  • get_Audit() : CComSpy
  • get_ColumnHeaders() : CCrmMonComp
  • get_ColWidth() : CComSpy
  • get_ContextTypes() : CContextAdmin
  • get_DeleteCommand() : CEntity
  • get_DeleteStoredProcedure() : CEntity
  • get_Description() : CCrmMonComp
  • get_dimLevel() : UPNPDimmerService , CDimmerService
  • get_EditMode() : CEntity
  • get_Field() : CEntity
  • get_FindClerks() : CCrmMonComp
  • get_FormattedRecord() : CCrmMonComp
  • get_GridSize() : CGrid
  • get_InsertCommand() : CEntity
  • get_InsertStoredProcedure() : CEntity
  • get_Key() : CEntity
  • get_KeyField() : CEntity
  • get_LogFile() : CComSpy
  • get_LogToFile() : CComSpy
  • get_myPowerProperty() : CPower
  • get_myProperty() : CPower , CSimple
  • get_Name() : CSampleMSPStream
  • get_NewEnum()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • get_NumberOfLogRecords() : CCrmMonComp
  • get_OutputPath() : CContextAdmin
  • get_Power() : UPNPDimmerService , CDimmerService
  • get_ProgId() : CCrmMonComp
  • get_ReadCommand() : CEntity
  • get_ReadStoredProcedure() : CEntity
  • get_Record() : CResultset
  • get_ShowGridLines() : CComSpy
  • get_ShowOnScreen() : CComSpy
  • get_SnapIncrement() : CSnap
  • get_SnapOn() : CSnap
  • get_TipURL() : CByotTransObj
  • get_TransactionState() : CCrmMonComp
  • get_UpdateCommand() : CEntity
  • get_UpdateStoredProcedure() : CEntity
  • get_x() : CPoint
  • get_x1() : CLine
  • get_x2() : CLine
  • get_y() : CPoint
  • get_y1() : CLine
  • get_y2() : CLine
  • getAbsolutePage()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getAbsolutePosition()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetAccess() : COpenQueueDialog
  • GetAccessRights() : CObjSecurity
  • GetAcknowledge() : CSendMessageDialog
  • GetACPFromPoint() : CTSFEditWnd
  • GetActive() : CAgentCtlCharacterEx
  • getActiveCommand()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • getActiveConnection()
: msado15::_Command
, msado15::_Record
, msado15::_Recordset
, msado15::Command
, msado15::Command15
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetActiveParam() : CExecuteParamDlg
  • GetActiveValue() : CExecuteParamDlg
  • GetActiveView() : CTSFEditWnd
  • GetActiveWindow() : CMDIFrameLite
  • getActualSize()
: msado15::Field
, msado15::Field15
  • getAddEnabled()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • GetAddNewMode() : CDataGrid
  • GetAddressH() : RqsClient
  • GetAddressN() : RqsClient
  • GetAddressPsz() : RqsClient
  • GetAdminPathName() : CSendMessageDialog
  • GetAdvProperties() : CFullConnect
  • GetAggregate() : CInterfaceDlg
  • GetAllocLength() : CString
  • GetAllocSize() : CFixedAlloc
  • GetAllowAddNew() : CDataGrid
  • GetAllowArrows() : CDataGrid
  • GetAllowDelete() : CDataGrid
  • GetAllowRowSizing() : CDataGrid
  • GetAllowUpdate() : CDataGrid
  • GetAlt1Confidence() : CAgentCtlUserInput
  • GetAlt1Name() : CAgentCtlUserInput
  • GetAlt1Voice() : CAgentCtlUserInput
  • GetAlt2Confidence() : CAgentCtlUserInput
  • GetAlt2Name() : CAgentCtlUserInput
  • GetAlt2Voice() : CAgentCtlUserInput
  • GetAnimationNames() : CAgentCtlCharacterEx
  • GetApp() : CSimpSvrDoc
  • GetAppearance() : CDataGrid
  • getAppletInfo() : RSProxy , HelloJ , Hello2J , Hello3J
  • GetApproxCount() : CDataGrid
  • GetApproximatePosition() : IRowsetScrollImpl< T, RowsetInterface >
  • GetAt() : CString , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • GetAttribute() : CGetInfoExDlg
  • GetAttributeInfo() : CDisplayAttributeInfo
  • GetAttributes() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • getAttributes()
: msado15::_Connection
, msado15::_Parameter
, msado15::Connection
, msado15::Connection15
, msado15::Field
, msado15::Field15
, msado15::Parameter
, msado15::Property
  • GetAttributesOf() : CShellFolder
  • GetAttributeString() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • GetAudioOutput() : CAgentCtlEx
  • GetAuditObj() : CComSpy
  • GetAuthenticated() : CSendMessageDialog
  • GetAuthenticationPlugin() : CAuthenticateContext
  • GetAuthorizedEvents() : CDBAuthPlugin
  • GetAuthorizedUsers() : CSids
  • GetAutoPopupMenu() : CAgentCtlCharacterEx
  • GetAxisInfo() : CDataset
  • GetAxisInfoProc() : CMDIChild
  • GetAxisRowset() : CDataset
  • GetAxisRowsetProc() : CMDIChild
  • GetBackColor() : CDataGrid , CAgentCtlBalloonEx
  • GetBackground() : CComponent
  • GetBalloon() : CAgentCtlCharacterEx
  • GetBandInfo() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • GetBaseNodeObject() : CDataObject
  • GetBaseObjectType() : CBaseObj
  • GetBaseType() : CBase
  • GetBestHeight() : CRecoOutputWnd
  • GetBindInfo() : CUrlmonCallback , CDownloadBindStatusCallback
  • GetBindings() : CParameters , CImpIAccessor
  • GetBindingsProc() : CMDIChild
  • GetBindingType() : COptionsSheet
  • GetBitmapIndex() : CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CPlane , CSkyVehicle , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycleFolder , CBicycle , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle
  • GetBitString() : CCertEncodeBitString
  • GetBlockOfChars() : CHtmlScanner
  • GetBodySize() : CReceiveMessageDialog
  • getBOF()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getBookmark()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetBookmark() : CDataGrid , CRowset
  • GetBool() : CVARIANT
  • GetBorder() : CFrame
  • GetBorderColor() : CAgentCtlBalloonEx
  • GetBorderStyle() : CDataGrid
  • GetBuffer() : CString , CacheProxySamplePlugin::INSSBufferImpl , TempBuffer
  • GetBufferAndLength() : CacheProxySamplePlugin::INSSBufferImpl
  • GetBufferSetLength() : CString
  • GetByPath() : CClassPro , CInstPro
  • GetByte() : CVARIANT
  • getCacheSize()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetCacheUrl() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • GetCallback() : CMgdClusCfgInit
  • GetCallMediaTypes() : CSampleMSP
  • GetCanonicalFormatEtc() : CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject , CTSFDataObject
  • GetCaption() : CDataGrid , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • GetCatalog() : CVCExploreDlg
  • GetCatalogApps() : CSelectEventsDlg
  • GetCellData() : CDataset
  • GetCertByIndex() : storesh::Storesh
  • getChainFromStore() : Sample::Sample
  • GetChangePictureButton() : CProppageUserUI , CExtPageUser
  • GetChapter() : CRowset
  • getChapter() : msado15::ADORecordsetConstruction
  • GetChapteredChild() : CMDIChild
  • GetChar() : CMemoryMappedInputStream , CSerialStream
  • GetCharacterID() : CAgentCtlUserInput
  • GetCharacters() : CAgentCtlEx
  • getCharset()
: msado15::_Stream
, msado15::Stream
  • GetCharsPerLine() : CAgentCtlBalloonEx
  • GetCheckpoint() : RqsEngine
  • GetChildColumnInfo() : CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder
  • GetChildInfo() : CSampleDirectory
  • GetChildItem() : CTreeViewLite
  • GetChildPtr() : CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder , CDelegationBase , CIceSkateFolder
  • GetChildren()
: msado15::_Record
, msado15::Record
, UDDI::Tools::CategoryTreeView
  • GetChunk() : msado15::Field , msado15::Field15 , HtmlPropIFilter , CAnchorTag , CHtmlElement , CHtmlIFilter , CHtmlIFilterBase , CImageTag , CInputTag , CMetaTag , CPropertyTag , CScriptTag , CStartOfFileElement , CTextElement , CTitleTag , CSmpFilter
  • GetClassAndName() : CDlgIADsContainer
  • GetClassIcon() : CSCPWiz , CWizExtUser
  • GetClassID() : CPersistFile , CPersistStorage , CSimpleObject , CDynamic , CEntity , CResultset , CDataSource , CImpIPersist , CPropertyPage , IMyPersistStreamImpl< T > , CComponentData , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter , CCommBand , CDeskBand , CExplorerBar , CToolBand , CImpIPersistFile , CShellFolder , CShellExt
  • GetClassName() : CSCPWiz , CWizExtUser
  • GetClearPictureButton() : CProppageUserUI , CExtPageUser
  • GetClientSite() : COleObject
  • GetClipboardData() : COleObject
  • GetCloneString() : MyString
  • GetCloseEventHandle() : CPluggableTransport
  • GetCLSID() : CServer
  • GetClsid() : CDataGrid , CAgentCtlEx
  • GetClsidOfTypeLib2() : CMethodSub
  • GetCol() : CDataGrid
  • GetColInfo() : CDataAccess , CFileIO , CTable
  • GetColInfoProc() : CMDIChild
  • getCollect()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetCollection()
: comadmin::COMAdminCatalog
, comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, comadmin::ICOMAdminCatalog
  • GetCollectionByQuery()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetColNameHeap() : CFileIO
  • GetColNameHeapSize() : CFileIO
  • GetColor() : CSecureObject
  • GetColorMenu() : CSimpSvrApp
  • GetColumn() : CCrmFilesCompensator , CADsSearch
  • GetColumnCnt() : CFileIO
  • getColumnCount() : MyOSPObject
  • GetColumnCount() : CCrmFilesCompensator
  • GetColumnData() : CDataAccess , CFileIO
  • GetColumnDesc() : CTable
  • GetColumnHeaders() : CCrmFilesCompensator , CDataGrid
  • GetColumnImage() : CDataAccess
  • GetColumnInfo() : CMSOmniProvCommand , CMSOmniProvRowset , CImpIColumnsInfo , CColumnProvider
  • GetColumnName() : CFileIO
  • GetColumnOrdinal() : CRow
  • GetColumns() : CDataGrid , CRow , CImpIRow
  • GetColumnsRowset() : CDataAccess
  • GetColumnsRowsetProc() : CMDIChild
  • GetColumnVariants() : CCrmFilesCompensator
  • GetColumnWidth() : CListViewLite
  • GetCommands() : CAgentCtlCharacterEx
  • GetCommandString() : CContextMenu , CDeskBand , CContextMenu , CShellExt
  • GetCommandsWindow() : CAgentCtlEx
  • GetCommandText() : CCommand , CImpICommandText
  • getCommandText()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • getCommandTimeout()
: msado15::_Command
, msado15::_Connection
, msado15::Command
, msado15::Command15
, msado15::Connection
, msado15::Connection15
  • getCommandType()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • GetCommLink() : CNullModem , CPSTN
  • GetCompSysRef() : CAdvClientDlg
  • GetComputerName() : CImp_DrawDlg
  • GetConfID() : CAppletSession
  • GetConfidence() : CAgentCtlCommandEx , CAgentCtlUserInput
  • GetConfidenceText() : CAgentCtlCommandEx
  • GetConfigDetails() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • GetConfigPath() : RqsConfig
  • GetConn() : CUtil
  • GetConnected() : CAgentCtlEx
  • GetConnection() : CODBCData
  • GetConnectionID() : CPluggableTransport
  • GetConnectionInterface() : CConnectionPoint
  • GetConnectionPoint() : CConnectionPointContainer
  • GetConnectionPointContainer() : CConnectionPoint
  • GetConnectionProps() : CDataSource
  • getConnectionString()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • getConnectionTimeout()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • GetConsole() : CConsole
  • GetConsoleNameSpace() : CComponentData
  • GetConsumer() : CAdvClientDlg
  • GetContainer() : CSpyCon , CImpIOleClientSite , COleClient , CSCPWiz , CWizExtUser , CBrowserHost
  • GetContainerCanonicalName() : CSCPWiz , CWizExtUser
  • GetContainerFormat() : CSampleDataContainer
  • GetContentInfo() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetContentInfoContext() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetContentInfoFromContext() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetContentInformation() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • GetContentSize() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • GetContext() : CDataObject
  • GetContextTypes() : CContextPlugin
  • GetCookie() : CDelegationBase , CDataObject , CDelegationBase
  • GetCopySourceObj() : CSCPWiz , CWizExtUser
  • GetCorrectCRM() : CCrmFilesTest
  • getCount()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, msado15::_Collection
, msado15::_DynaCollection
, msado15::Errors
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::Parameters
, msado15::Properties
  • GetCount() : CListBoxLite , CComboBoxLite , CList< TYPE, ARG_TYPE > , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , CVector< TYPE, IDX > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CacheProxySamplePlugin::IWMSCacheItemCollectionImpl , CCertEncodeStringArray , CLListImpl< TYPE, ARG_TYPE > , CAgentCtlCommandsEx , CAgentCtlUserInput
  • GetCountChildSpaceStations() : CSpaceStation
  • GetCounter() : CSampleInstance
  • GetCountPerPage() : CListViewLite
  • GetCredentials() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetCrmLogControl() : CCrmFilesWorker
  • GetCurFile() : CPersistFile , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter , CImpIPersistFile , CShellExt
  • GetCurHtmlElement() : CHtmlIFilter
  • GetCurrent() : NIDequeIter_c< T >
  • GetCurrentCellModified() : CDataGrid
  • GetCurrentCellVisible() : CDataGrid
  • GetCurrentCommand() : CCommand
  • GetCurrentInfo() : CShellView
  • GetCurrentSelections() : CComponent
  • GetCurrentWindow() : CDownloadUI
  • GetCurSel() : CListBoxLite , CComboBoxLite , CTabLite
  • getCursorLocation()
: msado15::_Connection
, msado15::_Recordset
, msado15::Connection
, msado15::Connection15
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getCursorType()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetCustomAdminInterface() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • GetCustomErrorObject() : CError
  • GetCUtilProp() : CRowset
  • GetData() : CDataObject , CMonitorServer , CDataXferObj , CString , CMSOmniProvRowset , CParameters , CDropObject , CRowset , CImpIRowset , CPropSheetHost , CDataObject , CSimpleArray< T > , CDataObject , CPidlMgr , CTSFDataObject , CCustomPropertyStore
  • getData() : RSProxy , CStaticNode
  • GetDataAdviseHolder() : CSimpSvrObj
  • GetDataChanged() : CDataGrid
  • GetDataContainerVersion() : CSDKSampleStorageSystem
  • getDataFormat() : msado15::Field
  • GetDataFormats() : CDataGrid
  • GetDataHere() : CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject , CTSFDataObject
  • getDataMember()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
, MyDataSource
  • GetDataMember() : CDataGrid
  • getDataMemberCount() : MyDataSource
  • getDataMemberName() : MyDataSource
  • GetDataObject() : CSimpSvrObj
  • GetDataPointer() : CPidlMgr
  • getDataSize() : CStaticNode
  • getDataSource()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • GetDataSource() : CDataGrid , CMSOmniProvRowset , CServiceComp , CSession , CImpIGetDataSource
  • GetDataSourceAttributes() : CSDKSampleStorageSystem
  • GetDataSourcePlugin() : CSampleDataContainer , CSampleDirectory
  • GetDataSourceProc() : CMainWindow
  • getDataStoreMajorVersion()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • getDataStoreMinorVersion()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • GetDataType() : CCustomPropertyStore
  • GetDataTypes() : CFileIO
  • GetDBSession() : CImpICommandText
  • GetDBStatus() : CMSOmniProvSessionTRSchemaRowset , CMSOmniProvSessionColSchemaRowset
  • GetDeadLetter() : CSendMessageDialog
  • GetDebugTrace() : RqsConfig
  • GetDefaultCommand() : CAgentCtlCommandsEx
  • getDefaultDatabase()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • GetDefaultInterface() : CBase , CUnknown , CConnectionPoint , CBinder , CCommand , CServiceComp , CDataLinks , CDataset , CDataSource , CEnumerator , CError , CCustomError , CMultipleResults , CRow , CRowPosition , CRowset , CSession , CStream , CTransaction , CTransactionOptions
  • GetDefaultSummary() : CSCPWiz , CWizExtUser
  • GetDefColWidth() : CDataGrid
  • getDefinedSize()
: msado15::Field
, msado15::Field15
  • getDeletedStatus() : CRocket
  • GetDelivery() : CSendMessageDialog
  • GetDescription() : CError , CCertExitSample , CCertPolicySample , CAgentCtlCharacterEx , CAgentCtlRequest , CPartitionInfo , CTSFEditWnd , CDisplayAttributeInfo
  • getDescription() : msado15::Error
  • GetDescriptionString() : CVirtualFile
  • GetDescriptiveText() : CComponent
  • GetDimLevel() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • getDirection()
: msado15::_Parameter
, msado15::Parameter
  • GetDispatch() : CVARIANT
  • GetDisplayAttributeInfo() : CMarkTextService
  • GetDisplayInfo() : CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent
  • GetDisplayName() : CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceStation , CSpaceFolder , CStaticNode , CDelegationBase , CPlane , CSkyVehicle , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycleFolder , CBicycle , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CMgdClusCfgInit
  • GetDisplayNameOf() : CShellFolder
  • GetDlgItem() : CWndLite
  • GetDllName() : CMgdClusCfgInit
  • GetDoc() : CSimpSvrApp
  • GetDocMiscStatus() : COleDocument
  • GetDocument() : COleDocumentView , CPrintSDIView , CTestView , CAPIView
  • GetDomainSlashUser() : CSecuritySub
  • GetDouble() : CVARIANT
  • GetDriveLetterMappings() : CPartitionInfo , CStorageResource
  • GetDropEffectFromKeyState() : CDropTarget
  • getDSO()
: msado15::ADOConnectionConstruction
, msado15::ADOConnectionConstruction15
  • GetEditActive() : CDataGrid
  • getEditMode()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetElement() : CVector< TYPE, IDX >
  • GetElements() : CVector< TYPE, IDX >
  • GetEmbedded() : CTSFEditWnd
  • GetEnabled() : CDataGrid , CAgentCtlAudioObject , CAgentCtlBalloonEx , CAgentCtlCommandEx
  • GetEncrypted() : CSendMessageDialog
  • GetEndACP() : CTSFEditWnd
  • GetEntity() : CResultset
  • getEOF()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • getEOS()
: msado15::_Stream
, msado15::Stream
  • GetError() : CComSpySqlAudit
  • GetErrorCode() : CException
  • GetErrorInfo() : CError
  • GetErrorMessage() : IADsError , ADsError
  • getErrors()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • GetErrorText() : CDataGrid
  • getEstimatedRows() : MyOSPObject
  • GetEventClass() : CActivitySub , CAppSub , CCRMSub , CEvtStoreSub , CExceptionSub , CIdentitySub , CInstanceSub , CLBSub , CMethodSub , CObjConstSub , CObjPool2Sub , CObjPoolSub , CObjSub , CQCSub , CResourceSub , CSecuritySub , CSysLCESub , CThreadSub , CTxSub , CUserSub , ICOMSysLCE
  • GetEventClassesForIID()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetEventObject() : CBehavior
  • GetEvents() : CAppInfo
  • GetEventType() : CActivitySub , CAppSub , CCRMSub , CEvtStoreSub , CExceptionSub , CIdentitySub , CInstanceSub , CLBSub , CMethodSub , CObjConstSub , CObjPool2Sub , CObjPoolSub , CObjSub , CQCSub , CResourceSub , CSecuritySub , CSysLCESub , CThreadSub , CTxSub , CUserSub , ICOMSysLCE , RqsEngine
  • GetExtent() : COleObject , CTextField
  • GetExtraColCount() : CRow
  • GetExtraColumnInfo() : CRow
  • GetExtraData() : CAgentCtlCharacterEx
  • getFields()
: msado15::_Record
, msado15::_Recordset
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetFileName() : CPack
  • GetFileObj() : CRow , CRowset
  • GetFilePath() : CDataSource
  • GetFileSchemaInfo() : CDBFile
  • GetFilesForDir() : CSyncMgrHandler
  • getFilter()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetFilterType() : CAppInfo
  • GetFilterVersion() : CIsapiCertPolicyFilter
  • GetFirstLastItemH() : CExtBuffer
  • GetFirstLocation() : Microsoft::Uddi::Demo::Publish
  • GetFirstRow() : CDataGrid
  • GetFlags() : CAuthenticatePlugin
  • GetFont() : CDataGrid , CWndLite , CModel
  • GetFontBold() : CAgentCtlBalloonEx
  • GetFontCharSet() : CAgentCtlBalloonEx
  • GetFontItalic() : CAgentCtlBalloonEx
  • GetFontName() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • GetFontSize() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • GetFontStrikethru() : CAgentCtlBalloonEx
  • GetFontUnderline() : CAgentCtlBalloonEx
  • GetForeColor() : CDataGrid , CAgentCtlBalloonEx
  • GetForegroundWindow() : CapJ
  • GetFormat() : CModel , CAVIFileReader
  • GetFormatName() : COpenQueueDialog
  • GetFormattedText() : CTSFEditWnd
  • GetFQPidl() : CShellView
  • GetFrameInfo() : CSimpSvrObj
  • GetFromBack() : NIDeque_c< T >
  • GetFromFront() : NIDeque_c< T >
  • GetFromPosition() : COBLIST
  • GetFullName() : CShellFolder
  • GetFunction() : CTSFEditWnd
  • GetGestureName() : CAdvRecoApp
  • GetGirls() : CBicycle
  • GetGlobalVoiceCommandsEnabled() : CAgentCtlCommandsEx
  • GetGUID() : CError , CDisplayAttributeInfo
  • GetGuid() : CComboBoxGuid , CAgentCtlCharacterEx
  • GetHandle() : CDelegationBase , CBackground , CDelegationBase
  • GetHandledEvents() : CContextPlugin
  • GetHandlerInfo() : CSyncMgrHandler
  • GethAppWnd() : CSimpSvrApp , CSimpSvrDoc
  • GetHasOtherClients() : CAgentCtlCharacterEx
  • GetHCluster() : CClusterData
  • GethDocWnd() : CSimpSvrDoc
  • GetHead() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • GetHeadFont() : CDataGrid
  • GetHeadLines() : CDataGrid
  • GetHeadPosition() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • GetHeight() : CAgentCtlCharacterEx , CAgentCtlPropertySheet
  • GetHelpContext() : CError
  • getHelpContext() : msado15::Error
  • GetHelpContextID() : CAgentCtlCharacterEx , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • GetHelpFile() : CError , CAgentCtlCharacterEx
  • getHelpFile() : msado15::Error
  • GetHelpMenu() : CSimpSvrApp
  • GetHelpModeOn() : CAgentCtlCharacterEx
  • GetHelpPath() : CComponentData
  • GetHelpTopic() : CComponentData
  • GetHGroup() : CGroupData
  • GethHatchWnd() : CSimpSvrDoc
  • GethInst() : CSimpSvrApp
  • GetHNetInterface() : CNetInterfaceData
  • GetHNetwork() : CNetworkData
  • GetHNode() : CNodeData
  • getHost() : CStaticNode
  • gethostbyaddr() : DTHandler
  • gethostbyname() : DTHandler
  • gethostname() : DTHandler
  • GetHResource() : CResData
  • GetHtmlElement() : CHtmlElemBagEntry
  • GetHwnd() : CSimpleDialog , IBrowserHost
  • GetHWnd() : CDataGrid
  • GetHWndEditor() : CDataGrid
  • GetIcon() : CLangBarItemButton
  • GetIconLocation() : CExtractIcon , CShellExt
  • GetId() : CRocket
  • GetID() : CRefresherMember< T >
  • GetIDEdit() : CProppageUserUI , CExtPageUser
  • GetIdleOn() : CAgentCtlCharacterEx
  • GetIDsAdminNewObj() : CSCPWiz , CWizExtUser
  • GetIDsAdminNewObjPrimarySite() : CSCPWiz
  • GetIDsOfNames() : CTestCOMPerformance , COleClient , HelloWorld , CWrapVBComponent , CAsyncQuerySink , CMethodPro , InkCollectorEvents , AgentNotifySink
  • GetIMemberArray() : CConfNotify
  • GetIMemberCount() : CConfNotify
  • GetImpersonationAccountName() : CAuthenticateContext
  • GetImpersonationToken() : CAuthenticateContext
  • getIndex()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset21
  • GetInfo() : CSampleDataContainer , CException , CLangBarItemButton
  • GetInheritTypes() : CObjSecurity
  • GetIniString() : CUtil
  • GetInitString() : CServiceComp
  • GetInPlaceFrame() : CSimpSvrObj
  • GetInPlaceSite() : COleDocumentView , CSimpSvrObj
  • GetInst() : CDbAlloc
  • GetInt16() : CDialogStream
  • GetInt32() : CDialogStream
  • GetInt8() : CDialogStream
  • getInteger() : RSProxy
  • GetInterface() : CComponentData , CActivitySub , CAppSub , CCRMSub , CEvtStoreSub , CExceptionSub , CIdentitySub , CBase , CInstanceSub , CLBSub , CMethodSub , CObjConstSub , CObjPool2Sub , CObjPoolSub , CObjSub , CQCSub , CResourceSub , CSecuritySub , CSysLCESub , CThreadSub , CTxSub , CUserSub , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent
  • GetInterfaceAddress() : CDataSource , CRowset , CMultipleResults , CConnectionPoint , CBase , CUnknown , CContainerBase , CAsynchBase , CPropertiesBase , CBinder , CCommand , CServiceComp , CDataLinks , CDataset , CEnumerator , CError , CCustomError , CRow , CRowPosition , CDataAccess , CSession , CStream , CTransaction , CTransactionOptions
  • GetInterfaceHook() : CMSMQEventHandler
  • GetInterfaceSafetyOptions() : CPlgTermSample
  • GetInternalIpAddress() : RqsEngine
  • GetIpAddressFromInterfaceIndex() : RqsEngine
  • GetIpAddressFromInterfaceName() : RqsEngine
  • getIsolationLevel()
: msado15::Connection15
, msado15::_Connection
, msado15::Connection
  • GetISync() : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • GetItem() : ClientList::Iterator
  • getItem()
: msado15::Errors
, comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::Parameters
, msado15::Properties
  • GetItem() : CTabLite , CacheProxySamplePlugin::IWMSCacheItemCollectionImpl , CAgentCtlCharacters , CAgentCtlCommandsEx
  • GetItemCount() : CTabLite , CListViewLite , COBLIST
  • GetItemData() : CTabLite , CColumnProvider
  • GetItemImage() : CListViewLite
  • GetItemObject() : CSyncMgrHandler , CShellView
  • GetItemOfExtBuffer() : CExtBuffer
  • GetItemParam() : CTreeViewLite , CListBoxLite , CListViewLite , CComboBoxLite
  • GetItemState() : CListViewLite
  • GetItemText() : CListViewLite
  • GetIterator() : ClientList
  • GetIUPointer() : XInterface< T >
  • GetJournal() : CSendMessageDialog
  • getKey()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
  • GetKeywords() : CImpIDBInfo
  • GetLabel() : CCreateQueueDialog , CLocateDialog
  • GetLanguageID() : CAgentCtlCharacterEx
  • GetLastItem() : CPidlMgr
  • GetLCID() : CMgdClusCfgInit
  • GetLeft() : CAgentCtlCharacterEx , CAgentCtlPropertySheet
  • GetLeftCol() : CDataGrid
  • GetLength() : CString , CacheProxySamplePlugin::INSSBufferImpl
  • GetLibrary() : RqsConfig
  • GetLicenseToUse() : CSampleWordBreaker , CSampleStemmer
  • GetLine() : CEditBoxLite
  • GetLineCount() : CEditBoxLite
  • getLineSeparator()
: msado15::_Stream
, msado15::Stream
  • GetLineSize() : CModel
  • GetLinkedTopics() : CComponentData
  • GetListpadInfo() : CSkateboardFolder
  • GetListPadInfo() : CComponent
  • GetListpadInfo() : CDelegationBase , CBicycleFolder , CIceSkateFolder
  • GetListViewValues() : CMDIChild
  • GetLiteralInfo() : CTable , CImpIDBInfo
  • GetLiteralInfoProc() : CMDIChild
  • getLocale() : MyOSPObject
  • GetLocale() : CHtmlIFilter
  • GetLockThreadId() : CLockHandler
  • getLockType()
: msado15::Recordset15
, msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • GetLogicalUserID() : CAuthenticateContext
  • GetLONG() : CVARIANT
  • GetLPBSTR() : BSTRING
  • GetMainMenu() : CSimpSvrApp
  • getMajorVersion()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetManageModule() : CCertExitSample , CCertPolicySample
  • GetMarqueeStyle() : CDataGrid
  • getMarshalOptions()
: msado15::Recordset21
, msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
  • GetMarshalSizeMax() : CResultset , CClassFactoryWrapper , CDynamic , CEntity
  • GetMaxLength() : CacheProxySamplePlugin::INSSBufferImpl
  • GetMaxPage() : CModel
  • getMaxRecords()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetMaxSection() : CModel
  • GetMediaType() : CPlgPin
  • GetMember() : CRefresherMember< T >
  • GetMemberName() : CAppletSession
  • GetMenu() : CRocket
  • getMessage() : RSProxy
  • GetMessageBody() : CSendMessageDialog
  • GetMessageLabel() : CSendMessageDialog
  • GetMessageWnd() : CStaticNode
  • GetMetaFilePict() : CSimpSvrObj
  • GetMethodName() : CMethodSub
  • getMinorVersion()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetMiscStatus() : COleObject
  • getMode()
: msado15::Record
, msado15::_Record
, msado15::_Connection
, msado15::_Stream
, msado15::Connection
, msado15::Connection15
, msado15::Stream
  • GetMoniker() : CBrowserHost , CSpyCon , COleObject , CImpIOleClientSite , COleClient , CBrowserHost
  • GetMove() : CComputer
  • GetMoveCause() : CAgentCtlCharacterEx
  • GetMultipleComponentsInfo()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • GetMultiSelectCookie() : CDataObject
  • getName()
: msado15::Command
, comadmin::ICatalogCollection
  • GetName() : CSpecialCharHashEntry , CRenameDlg , CSampleDirectory , CCertEncodeAltName , CCertEncodeCRLDistInfo , CAgentCtlCharacterEx , CAgentCtlUserInput , CMember , CPartitionInfo , CStorageResource , CPidlMgr
  • getName()
: comadmin::COMAdminCatalogCollection
, comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
, msado15::_Command
, msado15::_Parameter
, msado15::Command15
, msado15::Field
, msado15::Field15
, msado15::Parameter
, msado15::Property
  • GetNameChoice() : CCertEncodeAltName , CCertEncodeCRLDistInfo
  • GetNameCount() : CCertEncodeCRLDistInfo
  • getNativeError() : msado15::Error
  • GetNewMove() : CHuman
  • GetNext() : COBLIST , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • GetNextAssoc() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • GetNextChunkId() : CHtmlIFilter
  • GetNextHashEntry() : CSpecialCharHashEntry
  • GetNextItem() : CListViewLite , CTreeViewLite , CPidlMgr
  • GetNextReceipt() : vcacct::IGetReceipt , CGetReceipt , vcacct::CGetReceipt
  • GetNextRow() : CADsSearch
  • GetNextRows() : CRowset , CMSOmniProvRowset , CDataGrid , CImpIRowset
  • GetNextRowsProc() : CMDIChild
  • GetNextView() : CViewList
  • GetNIDeque() : NIDequeIter_c< T >
  • GetNmManager() : Conf
  • GetNodeGUID() : CDeviceNode , CFolderNode , CBaseNode , CStaticNode , CVirtualFile , CBaseNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CFolderNode , CStaticNode , CVirtualFile , CStaticNode , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile
  • GetNodeName() : CMgdClusCfgInit , CBaseNode , CMgdClusCfgInit
  • getNodeType() : CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CDelegationBase , CStaticNode , CDelegationBase , CBicycle , CBicycleFolder , CSkateboard , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboardFolder , CIceSkate , CIceSkateFolder , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CStaticNode
  • GetNodeType() : CBaseNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CDeviceNode , CFolderNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CFolderNode , CStaticNode , CVirtualFile , CStaticNode , CBaseNode , CDeviceNode , CStaticNode , CVirtualFile
  • getNodeType() : CBicycle
  • GetNodeType() : CFolderNode , CBaseNode , CDeviceNode , CBaseNode
  • getNodeType() : CSpaceVehicle , CIceSkateFolder , CStaticNode , CPeoplePoweredVehicle , CSkateboard , CDelegationBase , CSkateboardFolder , CLandBasedVehicle , CIceSkate , CSkateboard , CDelegationBase , CLandBasedVehicle , CStaticNode , CRocket , CPeoplePoweredVehicle , CBackground , CStaticNode , CSkyBasedVehicle , CLandBasedVehicle , CStaticNode , CSkateboardFolder , CDelegationBase , CSpaceVehicle , CIceSkateFolder , CStaticNode , CSkyBasedVehicle , CLandBasedVehicle , CStaticNode , CPeoplePoweredVehicle , CSkateboard , CSkyBasedVehicle , CSkateboardFolder , CLandBasedVehicle , CDelegationBase , CStaticNode , CDelegationBase , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CBicycle , CBicycleFolder , CSkateboard , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CRocket , CSpaceVehicle , CStaticNode , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboardFolder , CIceSkate , CIceSkateFolder , CSkyBasedVehicle , CRocket , CSpaceVehicle , CBackground , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CRocket , CSpaceStation , CSpaceFolder
  • GetNodeType() : CVirtualFile
  • getNodeType() : CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CStaticNode , CDelegationBase , CStaticNode , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CSkyBasedVehicle , CRocket , CSpaceVehicle , CBackground , CBackgroundFolder , CDelegationBase , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CPeoplePoweredVehicle , CRocket , CSpaceStation , CSpaceFolder , CDelegationBase , CPlane , CSkyVehicle , CBackgroundFolder , CDelegationBase , CLandBasedVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle
  • GetNodeType() : CStaticNode
  • getNodeType() : CSpaceVehicle , CDelegationBase
  • GetNumber() : CAgentCtlRequest
  • getNumber() : msado15::Error
  • GetNumberOfLines() : CAgentCtlBalloonEx
  • GetNumDevices() : WiaWrap::CEventCallback
  • GetNumElements() : CSAFEARRAY
  • getNumericScale()
: msado15::_Parameter
, msado15::Field
, msado15::Field15
, msado15::Parameter
  • GetObj() : CSimpSvrDoc , CSCPWiz , CWizExtUser
  • GetObject() : CMDIChild , CClassPro , CProvider_IWbemServices , CReindeer , CInstPro , CMethodPro
  • getObject() : RSProxy
  • GetObject() : CMainWindow
  • GetObjectAddress() : CMDIChild , CMainWindow
  • GetObjectAsync() : CClassPro , CProvider_IWbemServices , CMethodPro , CInstPro
  • GetObjectDesc() : CBinder , CRowset , CCustomError , CBase , CConnectionPoint , CDataSource , CEnumerator , CError , CRow
  • GetObjectImage() : CStream , CRow , CEnumerator , CServiceComp , CUnknown , CBase , CConnectionPoint , CCommand , CDataLinks , CError , CCustomError , CMultipleResults , CRowPosition , CBinder , CTransaction , CDataset , CDataSource , CRowset , CSession , CTransactionOptions
  • GetObjectInformation() : CObjSecurity
  • GetObjectMenu() : CSession , CMultipleResults , CDataSource , CCommand , CBase , CUnknown , CServiceComp , CDataLinks , CEnumerator , CRow , CRowset , CStream , CRowPosition , CError , CTransactionOptions , CTransaction , CBinder , CDataset , CCustomError , CConnectionPoint
  • GetObjectName() : CMultipleResults , CDataSource , CCommand , CBase , CUnknown , CConnectionPoint , CServiceComp , CEnumerator , CCustomError , CRow , CStream , CTransaction , CSession , CDataset , CDataLinks , CError , CRowset , CDeleteObjectDlg , CTransactionOptions , CRowPosition , CBinder
  • GetObjectPath() : CMoveDlg , CStaticNode , CFolderNode , CVirtualFile , CDeviceNode , CBaseNode
  • GetObjects() : CHiPerfProvider
  • GetObjectType() : CBase
  • GetObjRect() : CSimpleSite
  • GetODBCError() : CODBCData
  • GetOleAdviseHolder() : CSimpSvrObj
  • GetOleClientSite() : CSimpSvrObj
  • getOLEDBCommand() : msado15::ADOCommandConstruction
  • GetOleInPlaceActiveObject() : CSimpSvrObj
  • GetOleInPlaceObject() : CSimpSvrObj
  • GetOleObject() : CSimpSvrApp , CSimpSvrObj
  • GetOptions() : CMainWindow , CMDIChild , CIntTrace , CBase , CRowsetViewerDlg , CDataGrid
  • GetOrdinal() : CBindings , CColumnInfo
  • GetOriginalHeight() : CAgentCtlCharacterEx
  • getOriginalValue()
: msado15::Field15
, msado15::Field
  • GetOriginalWidth() : CAgentCtlCharacterEx
  • GetOriginUrl() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • GetOuterUnknown() : CBaseObj , CUnknown
  • GetOutputPath() : CContextPlugin
  • GetOverlayInfo() : CShellIconOverlayID
  • GetPackageName() : CAuthenticatePlugin
  • GetPage() : CModel , CAgentCtlPropertySheet
  • getPageCount()
: msado15::_Recordset
, msado15::Recordset15
, msado15::Recordset
, msado15::Recordset21
, msado15::Recordset20
  • GetPageData() : CCTypeSet
  • GetPageInfo() : CPropertyPage
  • GetPageMode() : CModel
  • GetPages() : CImpISpecifyPropertyPages
  • getPageSize()
: msado15::Recordset
, msado15::_Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetPainterInfo() : CGrid , CBehavior
  • GetParameterInfo() : CCommand
  • GetParameterInfoProc() : CMDIChild
  • getParameters()
: msado15::_Command
, msado15::Command15
, msado15::Command
  • GetParams() : CParameters
  • GetParent() : CSimpSvrObj , CBase , CPropPageLite , CVirtualFile , CComponent , CRocket
  • GetParentItem() : CTreeViewLite
  • GetParentScopeItem() : CLandBasedVehicle , CBicycleFolder , CPeoplePoweredVehicle , CIceSkateFolder , CStaticNode , CSpaceVehicle , CDelegationBase , CSkyBasedVehicle , CSkateboardFolder
  • getParentURL()
: msado15::_Record
, msado15::Record
  • GetPath() : CShellFolder
  • GetPathEdit() : CExtPageUser , CProppageUserUI
  • GetPathName() : COpenQueueDialog , CSendMessageDialog , CCreateQueueDialog , CDeleteQueueDialog , CReceiveMessageDialog , CCloseQueueDialog
  • getpeername() : DTHandler
  • GetPersistSize() : CEntity
  • GetPersistSizeMax() : CEntity
  • GetPersistStorage() : CSimpSvrObj
  • GetPicture() : CExtPageUser , CProppageUserUI
  • GetPidl() : CShellView
  • GetPin() : CPlgFilter
  • GetPinCount() : CPlgFilter
  • GetPingResponder() : CMonitorServer
  • GetPitch() : CAgentCtlCharacterEx
  • GetPluginSetting() : CContextSamplePropPage
  • GetPointer() : XInterface< T > , XBStr , XInterface< T > , XBStr
  • GetPolicy() : CRequestInstance
  • GetPolicyDescription() : CCertPolicySample
  • GetPort() : RqsConfig
  • GetPosition() : COBLIST
  • getPosition() : msado15::_Stream
  • GetPosition() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , COBLIST
  • getPosition() : msado15::Stream
  • GetPosition() : COBLIST
  • GetPosRect() : CSimpSvrObj
  • GetPowerValue() : UPNPDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , CDimmerService , IUPnPService_DimmingService_SCPD
  • GetPPointer() : XInterface< T >
  • getPrecision()
: msado15::_Parameter
, msado15::Field15
, msado15::Field
, msado15::Parameter
  • getPrepared()
: msado15::Command15
, msado15::Command
, msado15::_Command
  • GetPrev() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE >
  • GetPrimaryKeys() : CS2Dialog
  • getPrimaryNodeType() : CComponentData
  • GetPriority() : CSendMessageDialog , CShellIconOverlayID , CUrlmonCallback , CDownloadBindStatusCallback
  • GetProgID() : CServer
  • GetProgressCallback() : CSyncMgrHandler
  • getProperties()
: msado15::_ADO
, msado15::_Command
, msado15::_Parameter
, msado15::Command15
, msado15::Connection15
, msado15::Field15
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • GetProperties() : CPropertiesDlg , CImpIDBProperties , CImpIRowsetInfo , CBaseNode , CVirtualFile
  • getProperties() : msado15::_Recordset
  • GetProperties() : TPropBase< TYPE >
  • getProperties()
: msado15::_Connection
, msado15::Field
, msado15::Recordset
, msado15::Record
  • GetProperties() : CPropertiesDlg , CStaticNode , CUtilProp , CImpIDBBinderProperties , CFolderNode , CImpICommandProperties , CDeviceNode , CImpISessionProperties
  • getProperties()
: msado15::Command
, msado15::Parameter
, msado15::Connection
, msado15::_Record
  • GetPropertiesArgChk() : CUtilProp
  • GetProperty() : CBaseNode , CDeviceNode , CProvider_IWbemServices , CFolderNode , CStaticNode , CVirtualFile , CComponent , CPropPro
  • GetPropertyInfo() : CPropertiesDlg , CImpIDBBinderProperties , CPropertiesDlg , CImpIDBProperties , CUtilProp
  • GetPropertyName() : CFullPropSpec
  • GetPropertyPropid() : CFullPropSpec
  • GetPropertyRangeCreator() : CCustomPropertyStore
  • GetPropertySheet() : CAgentCtlEx
  • GetPropertySheetPages() : CResData , CObjData
  • GetPropIndex() : CUtilProp
  • GetPropSet() : CFullPropSpec
  • GetPropSets() : TPropSetBase< TYPE, OBJTYPE > , CFullConnect
  • GetPropSpec() : CFullPropSpec
  • getprotobyname() : DTHandler
  • getprotobynumber() : DTHandler
  • GetProtocolName() : CAuthenticatePlugin
  • getProvider() : msado15::Connection
  • GetProvider() : CSnapinAbout
  • getProvider()
: msado15::_Connection
, msado15::Connection15
  • GetProvider() : CSnapinAbout
  • GetProviderCLSID() : MyClassFactory
  • GetProviderName() : CFullConnectProvider
  • GetProviders() : CDataSource
  • GetProviderTypes() : CSession
  • GetProxyData() : CRow
  • GetPtr() : CBicycleFolder
  • GetPublicKey() : Sample::MySignedXml
  • GetPunk() : CNotify
  • GetQIPointer() : XInterface< T >
  • GetQueueHandle() : CMainFrame
  • GetQuotedID() : CTable
  • GetRaiseRequestErrors() : CAgentCtlEx
  • GetReadEventHandle() : CPluggableTransport
  • getRecordCount()
: msado15::Recordset
, msado15::_Recordset
  • GetRecordCount() : CError
  • getRecordCount()
: msado15::Recordset20
, msado15::Recordset21
, msado15::Recordset15
  • GetRecordSelectors() : CDataGrid
  • GetRecordset() : MSDFHDL::IDataFactoryHandler , CHandler
  • getRecordType()
: msado15::Record
, msado15::_Record
  • GetRect() : CPaintCanvas , COleDocumentView
  • GetRecvPointer() : SmartRefPointer< T >
  • GetReference() : XInterface< T >
  • GetReferencedRowset() : CImpIRowsetInfo
  • GetReferencedRowsetProc() : CMDIChild
  • GetRegisterClass() : CSimpSvrApp
  • GetRelativeName() : CPidlMgr
  • getRemoveEnabled()
: comadmin::ICatalogCollection
, comadmin::COMAdminCatalogCollection
  • getRequestID() : RSProxy
  • GetResourcePrivateData() : CStorageResource
  • GetResTypeName() : CMgdClusCfgInit
  • GetResult() : CMultipleResults
  • GetResultViewType() : CSpaceStation , CComponent , CDelegationBase , CComponent , CDelegationBase , CComponent , CDelegationBase , CComponent , CIceSkateFolder , CDelegationBase , CSkyBasedVehicle , CComponent , CDelegationBase , CSkateboardFolder , CComponent , CDelegationBase , CComponent , CDelegationBase , CBicycleFolder , CIceSkateFolder , CSkyBasedVehicle , CComponent , CDelegationBase , CComponent , CDelegationBase , CIceSkateFolder , CSkyBasedVehicle , CComponent , CSpaceStation , CComponent , CDelegationBase , CComponent , CDelegationBase , CComponent , CDelegationBase , CPerson , CComponent , CDelegationBase
  • GetResultViewType2() : CBaseNode , CStaticNode , CFolderNode , CDeviceNode , CFolderNode , CDeviceNode , CBaseNode , CDeviceNode , CVirtualFile , CBaseNode , CStaticNode , CComponent , CBaseNode , CComponent , CBaseNode , CStaticNode , CDeviceNode , CComponent , CVirtualFile , CComponent , CBaseNode , CVirtualFile , CStaticNode , CFolderNode , CStaticNode , CComponent , CVirtualFile , CDeviceNode , CVirtualFile , CStaticNode , CFolderNode , CBaseNode , CComponent , CFolderNode , CDeviceNode , CStaticNode , CComponent
  • GetReturnValue() : CListener
  • GetRightToLeft() : CDataGrid
  • GetRootDirectories() : CSDKSampleStorageSystem
  • GetRotRegister() : CSimpSvrObj
  • GetRow() : CDataGrid
  • getRow() : msado15::ADORecordConstruction
  • GetRowBuff() : CRowset , CRow
  • GetRowCnt() : CFileIO
  • getRowCount() : MyOSPObject
  • GetRowDividerStyle() : CDataGrid
  • GetRowFromHROW() : CRowset , CImpIGetRow
  • GetRowHeight() : CDataGrid
  • GetRowOffset() : CFileIdx
  • getRowPosition() : msado15::ADORecordsetConstruction
  • GetRows()
: msado15::Recordset15
, msado15::Recordset
, msado15::_Recordset
, msado15::Recordset21
, msado15::Recordset20
  • GetRowsAt() : IRowsetScrollImpl< T, RowsetInterface >
  • GetRowsAtRatio() : IRowsetScrollImpl< T, RowsetInterface >
  • GetRowsByBookmark() : IRowsetScrollImpl< T, RowsetInterface >
  • GetRowset() : CRowPosition
  • getRowset() : msado15::ADORecordsetConstruction
  • GetRowset() : CTable
  • GetRowSize() : CFileIO , CParameters
  • GetRunningApps() : CSelectEventsDlg
  • getRWStatus() : MyOSPObject
  • GetScale() : CScrollableView
  • GetSchemaInfo() : CMSOmniProvRowset , CDBFile
  • GetSchemaRowset() : CSession
  • GetScopeCookie() : CComponent
  • GetScreenExt() : CTSFEditWnd
  • GetScrollBars() : CDataGrid
  • GetScrollInfo() : CScrollBarLite
  • GetScrollPos() : CScrollBarLite
  • GetScrollRange() : CScrollBarLite
  • GetSearchIf() : CADsSearch
  • GetSecurity() : CObjSecurity
  • GetSel() : CEditBoxLite , CRichEditLite , CEditBoxLite
  • GetSelBookmarks() : CDataGrid
  • GetSelectedItem() : CTreeViewLite
  • GetSelectedObject() : CObjTree
  • GetSelectedRestrictions() : CSchemaDlg
  • GetSelectedRow() : CDataGrid
  • GetSelectedSchema() : CSchemaDlg
  • GetSelectedText() : CRichEditLite
  • GetSelection() : CTSFEditWnd
  • GetSelEndCol() : CDataGrid
  • GetSelInterface() : CInterfaceDlg
  • GetSelLength() : CDataGrid
  • GetSelPropInfo() : CPropertiesDlg
  • GetSelStart() : CDataGrid
  • GetSelStartCol() : CDataGrid
  • GetSelText() : CComboBoxString , CComboBoxLite , CDataGrid
  • GetSelValue() : CComboBoxLite
  • getservbyname() : DTHandler
  • getservbyport() : DTHandler
  • GetServerName() : CAPIDoc
  • GetServerObject() : CContext
  • GetServerVariable() : ISAPI_REQUEST
  • GetServiceHandle() : RqsEngine
  • GetServiceObject() : CDimmer , UPNPDimmerDevice , CDimmer
  • getSession()
: msado15::ADOConnectionConstruction
, msado15::ADOConnectionConstruction15
  • GetSession() : CImpIGetSession
  • GetSessionID() : CAPIDoc , CSessionDlg
  • GetShellSettings() : CShellView
  • getShipStatusString() : qcnotify::Notify
  • GetShort() : CVARIANT
  • GetSIDFromName() : CDBAuthPlugin
  • GetSignatureKey() : Sample::SignVerify
  • GetSite() : CDeskBand , CToolBand , CCommBand , CExplorerBar
  • getSize()
: msado15::_Parameter
, msado15::Stream
  • GetSize() : CSimpleArray< T > , CSimpSvrObj
  • getSize() : msado15::Parameter
  • GetSize() : CPartitionInfo , CBox , CPidlMgr
  • getSize() : msado15::_Stream
  • GetSize() : CStaticMap
  • GetSizeMax() : CComponentData , CToolBand , CExplorerBar , CDeskBand , CResultset , CCommBand , CEntity , IMyPersistStreamImpl< T > , CDynamic , CComponentData
  • GetSnapinDescription() : CSnapinAbout
  • GetSnapinImage() : CSnapinAbout
  • GetSnapinVersion() : CSnapinAbout
  • GetSnapOn() : ISnap
  • GetSocket() : CX224
  • getsockname() : DTHandler
  • getsockopt() : DTHandler
  • getSort()
: msado15::Recordset
, msado15::Recordset21
, msado15::_Recordset
, msado15::Recordset20
, msado15::Recordset15
  • GetSoundEffects() : CAgentCtlAudioObject
  • GetSoundEffectsOn() : CAgentCtlCharacterEx
  • getSource()
: msado15::_Recordset
, msado15::Error
, msado15::Recordset
  • GetSource() : CError
  • getSource()
: msado15::_Record
, msado15::Recordset20
, msado15::Recordset15
, msado15::Recordset21
, msado15::Record
  • GetSourceRow() : CImpIGetSourceRow
  • GetSourceRowset() : CImpIRow
  • GetSourcesRowset() : CEnumerator
  • GetSourcesRowsetProc() : CMainWindow
  • GetSpaceUsed() : CEmptyVolumeCache
  • GetSpecification() : CImpIRowsetInfo
  • GetSpeechInput() : CAgentCtlEx
  • GetSpeed() : CAgentCtlCharacterEx
  • GetSplit() : CDataGrid
  • GetSplits() : CDataGrid
  • GetSql() : CUtil
  • GetSQLInfo() : CCustomError
  • getSQLState() : msado15::Error
  • GetSRModeID() : CAgentCtlCharacterEx
  • GetSRStatus() : CAgentCtlCharacterEx
  • GetStartPosition() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • getState()
: msado15::Record
, msado15::Stream
, msado15::_Stream
, msado15::_Command
, msado15::Recordset15
, msado15::Recordset
, msado15::Connection
, msado15::Recordset20
, msado15::Recordset21
, msado15::_Connection
, msado15::Connection15
, msado15::Command
, msado15::_Record
, msado15::_Recordset
  • GetState() : RqsClient
  • GetStaticFolderImage() : CSnapinAbout
  • GetStaticNode() : CComponentData
  • GetStatus() : CTSFEditWnd , CLangBarItemButton
  • getStatus()
: msado15::Recordset20
, msado15::Recordset21
, msado15::_Recordset
  • GetStatus() : CAgentCtlRequest , CAsynchBase
  • getStatus() : msado15::Recordset15
  • GetStatus() : CCompartmentMonitor
  • getStatus() : msado15::Recordset , RSProxy
  • getStayInSync()
: msado15::Recordset
, msado15::Recordset21
, msado15::_Recordset
, msado15::Recordset20
  • GetStorage() : CSimpSvrObj
  • GetStr() : CVARIANT , CDialogStream , CVARIANT
  • getStream() : msado15::ADOStreamConstruction
  • GetString()
: msado15::Recordset20
, msado15::Recordset
, RqsClient
, msado15::_Recordset
, MyString
, msado15::Recordset21
  • GetStringFromNSSBuffer() : CacheProxySamplePlugin::CacheProxyPlugin
  • GetStyle() : CAgentCtlBalloonEx
  • GetSummaryInfo() : CWizExtUser , CSCPPageGeneral , CSCPPageBindingInfo , CExtPageUser , CSCPWiz , CSCPPageKeywords
  • GetSupportedMediaTypes() : CPlgTermSample
  • GetSuspended() : CAgentCtlEx
  • GetTabAcrossSplits() : CDataGrid
  • GetTabAction() : CDataGrid
  • GetTableColInfo() : CS1Dialog
  • GetTail() : CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , CExList< TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE >
  • GetTailPosition() : COBLIST , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , COBLIST , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • GetTaskList() : CIceSkateFolder , CDelegationBase , CBicycleFolder , CSkateboardFolder
  • GetTaskpadBackground() : CDelegationBase , CIceSkateFolder , CSkateboardFolder , CBicycleFolder
  • GetTaskpadDescription() : CIceSkateFolder , CBicycleFolder , CSkateboardFolder , CDelegationBase
  • GetTaskpadTitle() : CBicycleFolder , CDelegationBase , CSkateboardFolder , CIceSkateFolder
  • GetTemplateName() : CRequestInstance
  • GetTemplateObjId() : CRequestInstance
  • GetText() : CInputTag , CTitleTag , CComboBoxLite , CTextElement , CDataGrid , CLangBarItemButton , CTSFEditWnd , CHtmlIFilter , CHtmlIFilterBase , CLangBarItemButton , CMetaTag , HtmlPropIFilter , CHtmlElement , CPropertyTag , CListBoxLite , CStartOfFileElement , CImageTag , CScriptTag , CSmpFilter , CAnchorTag
  • GetTextExt() : CTSFEditWnd
  • GetTextLen() : CListBoxLite
  • GetTextLength() : CComboBoxLite
  • GetTextRange() : CEditBoxLite
  • GetThreadData() : CThreadData , CBankDlg
  • GetTimeout() : CReceiveMessageDialog
  • GetTimeToBeReceived() : CSendMessageDialog
  • GetTimeToReachQueue() : CSendMessageDialog
  • GetTitle() : CSCPWiz , CWizExtUser , CComponent
  • GetTModel() : WsdlDiscovery::frmMain
  • GetTokenType() : CToken , CHtmlElemBagEntry
  • getToolbar() : CComponent , CToolBarExtension
  • GetTooltipString() : CLangBarItemButton
  • GetTop() : CAgentCtlPropertySheet , CAgentCtlCharacterEx
  • GetTrace() : CIntTrace
  • GetTraceEnabled() : RqsConfig
  • GetTracePath() : RqsConfig
  • GetTransactionInfo() : CMDIChild
  • GetTransferParameters() : CSampleDataContainer
  • GetTTSModeID() : CAgentCtlCharacterEx
  • GetType() : CTSFEditWnd
  • getType() : msado15::Parameter
  • GetType() : CVARIANT
  • getType() : msado15::Property
  • GetType() : CCustomPropertyStore , CVARIANT
  • getType()
: msado15::_Parameter
, msado15::_Stream
, msado15::Field
, msado15::Stream
, msado15::Field15
  • GetTypeGUID() : CMgdResType , CStorageResType
  • GetTypeInfo() : AgentNotifySink , COleClient , CTable , AgentNotifySink , CMethodPro , HelloWorld , CTestCOMPerformance , AgentNotifySink , InkCollectorEvents , CAsyncQuerySink , CWrapVBComponent
  • GetTypeInfoCount() : CWrapVBComponent , InkCollectorEvents , AgentNotifySink , COleClient , CMethodPro , AgentNotifySink , CAsyncQuerySink , CTestCOMPerformance , HelloWorld
  • GetTypeInfoRowset() : CTable
  • GetTypeName() : CMgdResType , CStorageResType
  • GetTypeNameAndParams() : CTable
  • GetUID() : CStorageResource , CPartitionInfo , CMember , CCacheMapEl
  • GetUIData() : CSCPUIGeneral
  • GetUInt16() : CDialogStream
  • GetUIObjectOf() : CShellFolder
  • GetUIWindow() : CSimpSvrObj
  • getUnderlyingValue()
: msado15::Field
, msado15::Field15
  • GetUniqueName() : CShellFolder
  • GetUnitBBoxes() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • GetUnknown() : CVARIANT
  • GetUnmarshalClass() : CResultset , CEntity , CDynamic , CClassFactoryWrapper
  • GetURLFromHROW() : CImpIGetRow
  • GetUserClassID() : COleObject
  • GetUserName() : CImp_DrawDlg , CSecureObject
  • GetUsername() : CUtil , RqsClient
  • GetUsers() : CDBAuthPlugin , CSids , CDBAuthAdmin , IDBAuthAdmin
  • GetUserType() : COleObject
  • GetUserURI() : CRTCWin
  • GetUtilInterface()
: comadmin::ICatalogCollection
, comadmin::COMAdminCatalogCollection
  • getValid()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
  • GetValue() : CHtmlIFilter , CMetaTag , CCertEncodeDateArray , CSmpFilter
  • getValue()
: msado15::_Parameter
, msado15::Field
  • GetValue() : CCertEncodeStringArray
  • getValue()
: msado15::Parameter
, comadmin::COMAdminCatalogObject
, msado15::Field15
  • GetValue() : CTitleTag , HtmlPropIFilter , CScriptTag
  • getValue() : msado15::Property
  • GetValue() : CHtmlElement , CEditValueDlg , CHtmlIFilterBase
  • getValue() : comadmin::ICatalogObject
  • GetValue() : CCertEncodeLongArray
  • getVariant() : MyOSPObject
  • GetVariant() : CEditValueDlg
  • getVersion()
: msado15::Connection
, msado15::_Connection
  • GetVersion() : CAgentCtlCharacterEx
  • getVersion() : msado15::Connection15
  • GetViewStatus() : CComSpy
  • GetVisibilityCause() : CAgentCtlCharacterEx
  • GetVisible() : CAgentCtlPropertySheet , CAgentCtlCommandsEx , CAgentCtlCommandEx , CAgentCtlCharacterEx , CAgentCtlBalloonEx
  • GetVisibleCols() : CDataGrid
  • GetVisibleRows() : CDataGrid
  • GetVoice() : CAgentCtlUserInput , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • GetVoiceCaption() : CAgentCtlCommandEx , CAgentCtlCommandsEx
  • GetWatermarks() : CFolderNode , CComponent , CComponentData , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CRocket , CStaticNode , CDelegationBase , CComponentData , CDelegationBase , CComponent , CVirtualFile , CRocket , CStaticNode , CBicycle , CComponent , CBaseNode , CFolderNode , CDeviceNode , CDelegationBase , CVirtualFile , CRocket , CComponentData
  • GetWideChar() : CSpecialCharHashEntry
  • GetWidth() : CAgentCtlPropertySheet , CAgentCtlCharacterEx
  • GetWindow() : CDeskBand , CImpIOleInPlaceSite , COleClient , CBrowserHost , COleInPlaceActiveObject , COleInPlaceObject , CBrowserHost , CSpyCon , CToolBand , CFrame , CBrowserHost , CCommBand , CShellView , CBrowserHost , COleDocument , CExplorerBar
  • GetWindowContext() : CBrowserHost , COleClient , CBrowserHost , CSpyCon , CImpIOleInPlaceSite
  • GetWindowPlacement() : CWndLite
  • GetWindowText() : CWndLite , CapJ , CWndLite
  • GetWizardPages() : CObjData , CResData , CObjData
  • GetWnd() : CWndLite , CTSFEditWnd
  • GetWorkItem() : ISAPITHREAD
  • GetWrapCellPointer() : CDataGrid
  • GetWriteEventHandle() : CPluggableTransport
  • GetX509Certificate() : Sample::SignVerify
  • GiveFeedback() : CDropSource , CDragSource
  • Global_Shutdown() : Provider_Globals
  • Global_Startup() : Provider_Globals
  • GlobalVars() : GlobalVars
  • GrabOutPtr() : CSmartComPtr< T >
  • GridSize() : IGrid
  • GrowTagBuffer() : CHtmlScanner
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- h -

  • HandleAccelerators() : CSimpleApp
  • HandleAggregation() : CAggregate
  • HandleErrors() : CImp_DrawDlg
  • handleHitTest() : InkHitTest::InkHitTest
  • HandleMenuPos() : CWndLite
  • HandleMessage() : CMDIChildLite , CDialogLite , CPropPageLite , CPropertyPage , CDSLConnectionPage , CDSLAdvancedPage , CWndLite
  • handleNearestPoint() : InkHitTest::InkHitTest
  • HandleObjectType() : CMainWindow
  • handleResponse() : RSProxy
  • HandleRowset() : CMDIChild
  • HandsOffStorage() : CPersistStorage
  • HangUp() : Conf
  • HasEOL() : CRow
  • HasFocusIO() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • Hash() : IRowsetScrollImpl< T, RowsetInterface > , CSpecialCharHashTable
  • HashBmk() : IRowsetScrollImpl< T, RowsetInterface >
  • HashInst() : CDbAlloc
  • HasPropertySheets() : CRocket , CStaticNode , CDelegationBase , CRocket , CDelegationBase , CBicycle , CRocket , CDelegationBase , CRocket , CDelegationBase
  • HasReadAccess() : CUtil
  • hasResponse() : RSProxy
  • HasSelection() : InkClipboard::InkClipboard
  • HasSubFolder() : CShellFolder
  • HasUserCanceled() : CDownloadUI
  • HasWriteAccess() : CUtil
  • Hcluster() : CBasePropertyPage , CExtObject , CBasePropertyPage , CExtObject
  • Hello2J() : Hello2J
  • Hello3J() : Hello3J
  • HelloJ() : HelloJ
  • HelloProc() : CCallAs , CHello
  • HelloWorld() : HelloWorld
  • Help() : CPropertyPage
  • HelpComplete() : AgentNotifySink , Notify
  • Hfont() : CExtObject
  • Hicon() : CExtObject
  • Hide() : CAgentCtlCharacterEx
  • HideAppWnd() : CSimpSvrApp
  • HideCharacters() : Hello3J
  • HideDocWnd() : CSimpSvrDoc
  • HideHatchWnd() : CSimpSvrDoc
  • Hittest() : CTextField , CBox , CTextGrid , CCharBlock , CPage , CModel , CView
  • HitTest() : CListViewLite , CTreeViewLite
  • HitTestPoint() : CGrid , CBehavior
  • HoldFields() : CDataGrid
  • HowManyTurns() : CComputer , CHuman
  • Hpage() : CBasePropertyPage
  • HrAddLogicalDiskToArray() : CPartitionInfo
  • HrAddObjectToArray() : CEnumStorageResource
  • HrAddPartitionToArray() : CStorageResource
  • HrConvertDeviceVolumeToLogicalDisk() : CEnumStorageResource
  • HrConvertDeviceVolumeToWMIDeviceID() : CEnumStorageResource
  • HrCreateFriendlyName() : CStorageResource
  • HrCreatePage() : CBasePropertyPage
  • HrCreatePartitionInfo() : CStorageResource
  • HrEnumNodeResources() : CClusterUtils
  • HRESULT() : ErrorVtbl , _RecordsetVtbl , ErrorVtbl , _RecordsetVtbl , ErrorVtbl , IAppletVtbl , _RecordsetVtbl , ErrorVtbl , IAppletNotifyVtbl , IAppletSessionVtbl , _RecordsetVtbl , IAppletSessionVtbl , _RecordsetVtbl , ErrorVtbl , IAppletSessionNotifyVtbl , _RecordsetVtbl , IAppletSessionNotifyVtbl , _RecordsetVtbl , ErrorVtbl , IMMCControlVtbl , IUPnPService_DimmingService_SCPDVtbl , _RecordsetVtbl , IUPnPService_DimmingService_SCPDVtbl , _RecordsetVtbl , ErrorsVtbl , IUPnPService_DimmingService_SCPDVtbl , _RecordsetVtbl , IUPnPService_DimmingService_SCPDVtbl , _RecordsetVtbl , ErrorsVtbl , _RecordsetVtbl , ErrorsVtbl , IADsErrorVtbl , _RecordsetVtbl , IADsErrorVtbl , ADORecordsetConstructionVtbl , ErrorsVtbl , IHelloWorldVtbl , ADORecordsetConstructionVtbl , IHelloWorldVtbl , ADORecordsetConstructionVtbl , ErrorsVtbl , IHelloWorldVtbl , PropertiesVtbl , ADORecordsetConstructionVtbl , PropertiesVtbl , ADORecordsetConstructionVtbl , ErrorsVtbl , PropertiesVtbl , ADORecordsetConstructionVtbl , PropertyVtbl , ADORecordsetConstructionVtbl , ErrorsVtbl , ADORecordsetConstructionVtbl , PropertyVtbl , ADORecordsetConstructionVtbl , PropertyVtbl , ErrorsVtbl , ADORecordsetConstructionVtbl , ParametersVtbl , ADORecordsetConstructionVtbl , ParametersVtbl , ErrorsVtbl , FieldVtbl , ParametersVtbl , _ParameterVtbl , FieldVtbl , _ParameterVtbl , ErrorsVtbl , FieldVtbl , _ParameterVtbl , FieldVtbl , _CommandVtbl , FieldVtbl , _CommandVtbl , _ParameterVtbl , FieldVtbl , _ParameterVtbl , FieldVtbl , _CommandVtbl , FieldsVtbl , FieldVtbl , FieldsVtbl , FieldVtbl , _CommandVtbl , FieldsVtbl , FieldVtbl , _CommandVtbl , FieldVtbl , _CommandVtbl , FieldVtbl , _CommandVtbl , FieldVtbl , _CommandVtbl , FieldsVtbl , _CommandVtbl , FieldsVtbl , _CommandVtbl , _ParameterVtbl , _CommandVtbl , _ParameterVtbl , _CommandVtbl , _ParameterVtbl , _CommandVtbl , _ParameterVtbl , _CommandVtbl , _ParameterVtbl , _CommandVtbl , _ParameterVtbl , _CommandVtbl , _ParameterVtbl , _CommandVtbl , _ConnectionVtbl , ParametersVtbl , _ConnectionVtbl , _RecordsetVtbl , _ConnectionVtbl , _RecordsetVtbl , ParametersVtbl , _ConnectionVtbl , _RecordsetVtbl , _ConnectionVtbl , _RecordsetVtbl , ParametersVtbl , _RecordsetVtbl , _ConnectionVtbl , _RecordsetVtbl , _ConnectionVtbl , PropertyVtbl , _RecordsetVtbl , _ConnectionVtbl , _RecordsetVtbl , IAppletVtbl , _ConnectionVtbl , _RecordsetVtbl , IAppletSessionVtbl , _RecordsetVtbl , IAppletSessionVtbl , _RecordsetVtbl , IAppletSessionNotifyVtbl , _RecordsetVtbl , PropertyVtbl , _RecordsetVtbl , ADOConnectionConstructionVtbl , IUPnPService_DimmingService_SCPDVtbl , ADOConnectionConstructionVtbl , _ConnectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ConnectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ConnectionVtbl , IUPnPService_DimmingService_SCPDVtbl , PropertyVtbl , _ConnectionVtbl , IADsErrorVtbl , _ConnectionVtbl , IHelloWorldVtbl , _ConnectionVtbl , IHelloWorldVtbl , _ConnectionVtbl , PropertyVtbl , _ConnectionVtbl , PropertiesVtbl , _ConnectionVtbl , PropertyVtbl , _ConnectionVtbl , PropertiesVtbl , _ConnectionVtbl , IHelloWorldVtbl , _ConnectionVtbl , IHelloWorldVtbl , _ConnectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ConnectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ConnectionVtbl , _ADOCollectionVtbl , _ConnectionVtbl , _ADOCollectionVtbl , _ConnectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOCollectionVtbl , ADOConnectionConstructionVtbl , _ADOCollectionVtbl , _RecordsetVtbl , IMMCControlVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _RecordsetVtbl , _ADODynaCollectionVtbl , _RecordsetVtbl , IAppletSessionVtbl , _ADODynaCollectionVtbl , _RecordsetVtbl , _ADODynaCollectionVtbl , _RecordsetVtbl , IAppletVtbl , _RecordsetVtbl , _ADODynaCollectionVtbl , ErrorVtbl , _RecordsetVtbl , ErrorVtbl , _RecordsetVtbl , ErrorVtbl , _RecordsetVtbl , _ADOVtbl , _RecordsetVtbl , _ADOVtbl , _RecordsetVtbl , _ADODynaCollectionVtbl , _ADOVtbl , _RecordsetVtbl , _ADOVtbl , _RecordsetVtbl , ErrorVtbl , _RecordsetVtbl , ErrorVtbl
  • HrFindDiskWithLogicalDisk() : CEnumStorageResource
  • HrFindDiskWithWMIDeviceID() : CEnumStorageResource
  • HrFixupDisks() : CEnumStorageResource
  • HrGetApplicationCompatibilityInfo() : CMyCapabilities
  • HrGetBootLogicalDisk() : CEnumStorageResource
  • HrGetClusterDiskInfo() : CEnumStorageResource
  • HrGetClusterProperties() : CEnumStorageResource
  • HrGetCrashDumpLogicalDisk() : CEnumStorageResource
  • HrGetDeviceID() : CStorageResource , IStorageProperties
  • HrGetDeviceIndex() : CStorageResource , IStorageProperties
  • HrGetDiskNames() : IStorageProperties , CStorageResource
  • HrGetDisks() : CEnumStorageResource
  • HrGetFriendlyName() : IPartitionProperties , CPartitionInfo
  • HrGetLogicalDisks() : CPartitionInfo
  • HrGetObjectInfo() : CExtObject
  • HrGetPageFileLogicalDisks() : CEnumStorageResource
  • HrGetPartitionInfo() : CStorageResource
  • HrGetQuorumResourceName() : CClusterUtils
  • HrGetSCSIBus() : IStorageProperties , CStorageResource
  • HrGetSCSIInfo() : CEnumStorageResource
  • HrGetSCSIPort() : CStorageResource , IStorageProperties
  • HrGetSignature() : IStorageProperties , CStorageResource
  • HrGetSystemDevice() : CEnumStorageResource
  • HrGetUIInfo() : CExtObject
  • HrInit() : CBasePropertyPage , SIndexedDisk
  • HrInitialize() : CNetworkData , CObjData , CNetInterfaceData , CResTypeData , CGroupData , CNetInterfaceData , CNetworkData , CGroupData , CResTypeData , CClusterData , CNodeData , CObjData , CNodeData , CResData , CClusterData
  • HrIsClusterCapable() : CStorageResource
  • HrIsClusterServiceRunning() : CClusterUtils
  • HrIsCoreResource() : CClusterUtils
  • HrIsDynamicDisk() : IStorageProperties , CStorageResource
  • HrIsGPTDisk() : CStorageResource , IStorageProperties
  • HrIsGroupOwnedByThisNode() : CClusterUtils
  • HrIsLogicalDiskNTFS() : CEnumStorageResource
  • HrIsNodeClustered() : CClusterUtils
  • HrIsNTFS() : CPartitionInfo , IPartitionProperties
  • HrIsPartitionGPT() : CStorageResource
  • HrIsPartitionLDM() : CStorageResource
  • HrIsSystemBusManaged() : CEnumStorageResource
  • HrIsThisLogicalDisk() : IPartitionProperties , CPartitionInfo
  • HrLoadEnum() : CEnumStorageResource
  • HrLoadGroupResources() : CClusterUtils
  • HrLogDiskInfo() : CEnumStorageResource
  • HrLogLogicalDiskInfo() : CPartitionInfo
  • HrNodeResourceCallback() : CClusterUtils , CEnumStorageResource
  • HrProcessWMIDiskObject() : CEnumStorageResource
  • HrPruneCrashDumpBus() : CEnumStorageResource
  • HrPruneDisks() : CEnumStorageResource
  • HrPruneDynamicDisks() : CEnumStorageResource
  • HrPruneGPTDisks() : CEnumStorageResource
  • HrPrunePageFileDiskBuses() : CEnumStorageResource
  • HrPruneSystemDisks() : CEnumStorageResource
  • HrSaveData() : CExtObject
  • HrSendStatusReport() : CMgdClusCfgInit
  • HrSetDeviceID() : IPartitionProperties , CPartitionInfo
  • HrSetFriendlyName() : IStorageProperties , CStorageResource
  • HrSetThisDiskToBeManaged() : CEnumStorageResource
  • HrSortDisksByIndex() : CEnumStorageResource
  • HScroll() : CController
  • hScrollBar_Scroll() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • hScrollBar_ValueChanged() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • HtmlPropIFilter() : HtmlPropIFilter
  • HtmlPropIFilterCF() : HtmlPropIFilterCF
  • htonl() : DTHandler
  • htons() : DTHandler
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- i -

  • IddPropertyPage() : CBasePropertyPage
  • IddWizardPage() : CBasePropertyPage
  • IDFromHMenu() : CStatusHelper
  • Idle() : AgentNotifySink , Notify , AgentNotifySink
  • IdsCaption() : CBasePropertyPage
  • iid() : CSmartPtr< T >
  • IIDLookUp() : IIDLookUp
  • ImageEventCallback() : WiaWrap::CEventCallback
  • ImpersonateClient() : ISAPI_REQUEST
  • ImportComponent()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • ImportDialog() : CImportRes
  • ImportDialogs() : CImportRes
  • ImportDlgInit() : CImportRes
  • ImportPublicKeyBlob() : Sample::MySignedXml
  • ImportStrings() : CImportRes
  • IMyPersistStreamImpl_GetSizeMax() : CLine , CPoint
  • IMyPersistStreamImpl_Load() : CLine , CPoint
  • IMyPersistStreamImpl_Save() : CLine , CPoint
  • In() : CSet , CCTypeSet
  • Inactive() : CPlgPin
  • InAirPackets()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • InCall() : Conf
  • InConnection() : CPluggableTransport
  • IncrementNestCount() : CSafeRefCount
  • IncrementOpenRowsets() : CCommand
  • IncrementProgressBar() : CDownloadUI
  • Indicate() : CMySink
  • IndicateToConsumer() : CConsumer , CProvider_IWbemUnboundObjectSink , CConsumer
  • inet_addr() : DTHandler
  • inet_ntoa() : DTHandler
  • InfoMessage()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • InInOutPipesSample() : CSimpleClass
  • Init() : CVariant , MyDataSource , MyOSPObject , CController , CCanvas , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI , CSampleMSPCall , CMyInkEvents , CMyInkCollector , InkCollectorEvents , CGrid , CBehavior , CContext , MainDlg , CClusPropValueList , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CMemoryMappedInputStream , CMmStreamConsecBuf , CSerialStream , CSampleWordBreaker , CSampleStemmer , CSmpFilter , CFileViewer
  • init() : RSProxy , HelloJ , Hello2J , Hello3J
  • Init() : CComSpySqlAudit , IComSpyAudit , CAsyncTest , CAsyncXXX< T, ISyncFace, IAsyncFace > , CConnectionPointContainer , CEnumXXX< T, ELT_T, IFACE > , CUnknown , CServer , CFrame , CAsyncFullServ , CString
  • initAdminCatlog() : NewsFlash , NewsSubscriber
  • InitArray() : CComputer , CHuman
  • InitControls() : CS1Dialog , CS2Dialog , CS3Dialog , CS4Dialog , CTypesDialog
  • InitDefaultDevices() : CStaticNode
  • InitDefaultFolder() : CDeviceNode
  • InitDefaultVFile() : CFolderNode
  • InitFilterRegion() : CHtmlElement , CTextElement
  • initForm() : NewsFlash , NewsSubscriber , About , CapJ
  • InitFromData() : COleObject
  • InitialControlsState() : CRTCOutgoingDlg
  • Initialise() : CResultset
  • Initialize() : CAuthenticateAdmin , CProvider_IWbemServices , CProvider , CAuthenticateContext , CMyEventProvider , CRefClient , CDBAuthAdmin , CSampleDataSource , CHiPerfProvider , CSampleDataContainer , CRefresher , CInstPro , CSampleDirectory , CMethodPro , ISAPI_EXTENSION , CContextAdmin , Notify , CMember , CSDKSamplePlaylistParser , Conf , CPluggableTransport , CAdminNotifyHandler , CMgdClusCfgInit , CMyCapabilities , CContextMenu , CMyEvictListener , CMyMemberSetChangeListener , CSCP , CMyStartupListener , CEnumStorageResource , CMultiValuedAttributeEditor , CMgdClusCfgInit , CColumnProvider , CSCPWiz , CEmptyVolumeCache , CShellFolder , CMultiValuedAttributeEditor , CShellExt , CTSFMainWnd , CProppageUser , CCompartmentMonitor , CThumbNailPhotoHolder , CWizExtUser , RqsEngine , CSyncMgrHandler , CPlgFilter , CAVIFileWriter , CWorkerThread , CAVIFileReader , UPNPDimmerDevice , CDimmer , NIDequeIter_c< T > , CObjSecurity , CCertExitSample , CCertPolicySample , CRequestInstance , CCertPolicySample , CComponent , CComponentData , CComponent , CComponentData , CPerson , CRocket , CComponent , CComponentData , CRocket , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CRocket , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CComponent , CComponentData , CStaticNode , CBaseNode , CComponent , CComponentData , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CEntity , CComponentData , CRocket , CStaticMap , CComponent , CComponentData , CAsynchBase , CGenerateRC , CImportRes , CRowPosition , CDownloadUI , CClassPro , CImpIDBInitialize , CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider
  • InitializeComponent()
: CSharp_Draw::Form1
, CSharp_Draw::InputBox
, Sample::UI::AboutBox
, Sample::UI::MainWindow
, AutoClaims::AutoClaims
, InkBlog::AddBlog
, InkBlog::_Default
, InkBlog::InkArea
, InkClipboard::InkClipboard
, InkCollection::InkCollection
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkErase::InkErase
, InkHitTest::InkHitTest
, InkRecognition::InkRecognition
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
, Serialization::SerializationForm
, UDDI::Tools::CategoryTreeView
, WsdlDiscovery::frmMain
  • InitializeDevTypeArray() : CGenericUCPDlg
  • InitializeDynamic() : CPlgTermSample
  • InitializeEvents() : RqsEngine
  • InitializeEx() : CEmptyVolumeCache
  • InitializePlugin() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • InitializePrivate() : CPlgFilter
  • InitializeRTCApp() : CRTCIncomingDlg , CRTCOutgoingDlg
  • InitializeServerSocket() : RqsEngine
  • InitializeServerSocketCb() : RqsEngine
  • InitializeUDNList() : CGenericUCPDlg
  • initializeUi() : CDisdrawDlg
  • initializeUI() : CImp_DrawDlg
  • Initialze() : CAppInfo
  • InitInstance() : CVCExploreApp , CClientApp , CADVCGENApp , CAppLite , CWinApp , CMultichanApp , CSCPCMenuApp , CMyUIExtApp , CSCPWizApp , CMyUIExtApp , CMyWizExtApp , CADsFirstExtApp , CADQIApp , CPrintSDIApp , CDisdrawApp , CImp_DrawApp , CTestApp , CDisdrawApp , CRTCIncomingApp , CRTCOutgoingApp , CGenericUCPApp , CHMMSampleApp , CCmdLineConsumerApp , CPermEventsApp , CWbemClientApp , CCapMFCApp , CXMLTreeApp , CClipBookServerApp , CFileShareSampleApp , CAPIApp
  • InitList() : CShellView
  • InitMediaType() : CPlgPin
  • InitMenu() : CLangBarItemButton
  • InitNew() : CPersistStorage , CDynamic , CEntity , CResultset , CPropertyPage
  • InitObject() : CSimpleSite
  • InitOCX() : CDelegationBase
  • InitOle() : InitOle
  • InitOnce() : ISAPI_EXTENSION
  • InitPage() : CPage
  • InitProgressBar() : CDownloadUI
  • InitPropCombo() : CFullConnect
  • InitSchemaCombo() : CSchemaDlg
  • InitSchemas() : CSchemaDlg
  • InitSecurity() : CHMMSampleApp , CWbemClientApp
  • InitSize() : CClusPropList
  • InitStatChunk() : CAnchorTag , CHtmlElement , CImageTag , CInputTag , CMetaTag , CPropertyTag , CScriptTag , CStartOfFileElement , CTextElement
  • InitThreadPool() : ISAPITHREAD
  • InitTreeView() : CSchemaDlg
  • InkArea() : InkBlog::InkArea
  • InkClipboard() : InkClipboard::InkClipboard
  • InkClipboard_Load() : InkClipboard::InkClipboard
  • InkClipboard_MouseDown() : InkClipboard::InkClipboard
  • InkClipboard_MouseMove() : InkClipboard::InkClipboard
  • InkClipboard_MouseUp() : InkClipboard::InkClipboard
  • InkClipboard_Paint() : InkClipboard::InkClipboard
  • InkCollection() : InkCollection::InkCollection
  • InkCollection_Load() : InkCollection::InkCollection
  • InkCollection_Paint() : InkCollection::InkCollection
  • InkCollectorEvents() : InkCollectorEvents
  • InkDividerForm() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • InkDividerForm_Load() : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • inkEdMake_Enter() : AutoClaims::AutoClaims
  • inkEdModel_Enter() : AutoClaims::AutoClaims
  • inkEdYear_Enter() : AutoClaims::AutoClaims
  • InkErase() : InkErase::InkErase
  • InkErase_Load() : InkErase::InkErase
  • InkErase_OnMouseMove() : InkErase::InkErase
  • InkErase_OnPaint() : InkErase::InkErase
  • InkHitTest() : InkHitTest::InkHitTest
  • InkHitTest_Load() : InkHitTest::InkHitTest
  • InkHitTestForm_Paint() : InkHitTest::InkHitTest
  • InkLayer() : AutoClaims::InkLayer
  • inkPictVehicle_Paint() : AutoClaims::AutoClaims
  • InkRecognition() : InkRecognition::InkRecognition
  • InkRecognition_Load() : InkRecognition::InkRecognition
  • InkSpaceToPixel() : InkClipboard::InkClipboard
  • InkZoom() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InkZoom_Load() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InkZoom_Resize() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InOutPipeSample() : CSimpleClass
  • InPipeSample() : CSimpleClass
  • InPlaceDeactivate() : COleInPlaceObject
  • InputBox() : CSharp_Draw::InputBox
  • InquireRosterConfirm() : CAppletSession
  • Insert() : CEntity , CAgentCtlCommandsEx
  • InsertAfter() : CLListImpl< TYPE, ARG_TYPE > , CExList< TYPE > , CLinkable , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • InsertAt() : CVector< TYPE, IDX >
  • InsertBack() : ClientList
  • InsertBackgroundItems() : CContextMenu
  • InsertBefore() : CLListImpl< TYPE, ARG_TYPE > , CLinkable , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • InsertChildItems() : CDeviceNode
  • InsertColumn() : CListViewLite
  • InsertEmbedded() : CTSFEditWnd
  • InsertEmbeddedAtSelection() : CTSFEditWnd
  • InsertFirst() : CListHeader
  • InsertIntoBack() : NIDeque_c< T >
  • InsertIntoExtBuffer() : CExtBuffer
  • InsertIntoFront() : NIDeque_c< T >
  • InsertIntoPluginCollection() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • InsertItem() : CComboBoxEx , CListViewLite , CTreeViewLite , CTabLite
  • InsertItems() : CContextMenu
  • InsertLast() : CListHeader
  • InsertMenus() : CFrame
  • InsertNewRow() : CMDIChild
  • InsertObject() : CSimpleDoc
  • insertRequest() : RSProxy
  • insertResponse() : RSProxy
  • InsertRow() : IRowsetChangeImpl< T, Storage, RowClass > , CImpIRowsetChange
  • InsertRowImmediate() : CDBFile
  • insertRows() : MyOSPObject
  • InsertScopeItems() : CStaticNode
  • InsertTextAtSelection() : CTSFEditWnd
  • INSSBufferImpl() : CacheProxySamplePlugin::INSSBufferImpl
  • Install() : CSysLCESub , ICOMSysLCE
  • InstallApplication()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • installCascadeButton_click() : NewsSubscriber
  • InstallComponent()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • installEventButton_click() : NewsFlash
  • InstallEventClass()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • InstallMultipleComponents()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • InstallMultipleEventClasses()
: comadmin::ICOMAdminCatalog
, comadmin::COMAdminCatalog
  • Instance() : CFrame
  • InstanceThread() : CMyEventProvider
  • InterfaceSupportsErrorInfo() : CAccount , CComputer , CMoveMoney , CResultset , CByotTransObj , CEnlistTransaction , CNewsEvent , CAccount , CMoveMoney , CUpdateReceipt , CAccount , CDynamic , CEntity , CProxy , CHandler , HelloWorld , CMMCControl , CExtObject , CGetReceipt , CLine , CMoveMoney , CContextAdmin , CAuthenticateAdmin , CHuman , CUpdateReceipt , CGetReceipt , CDBAuthAdmin , ADsError , CAccount , CCreateTable
  • InternalBindLookup() : CProxy
  • InternalClear() : CFastVariant
  • InternalCopy() : CFastVariant
  • InternalInsert() : CEntity
  • InternalLookup() : CProxy
  • InternalNextEntity() : CProxy
  • Interrupt() : CAgentCtlCharacterEx
  • iNumberOfInArguments() : CGenericUCPDlg
  • Invalidate() : CView
  • Invoke() : COleClient , HelloWorld , CWrapVBComponent , CAsyncQuerySink , InkCollectorEvents , CBrowserHost , CEventSink , AgentNotifySink , CMethodPro , CBrowserHost , CWebBrowser , CBrowserHost , AgentNotifySink , CTestCOMPerformance
  • InvokeApplet() : CAppletSession
  • InvokeAppletConfirm() : CAppletSession
  • InvokeCommand() : CObjData , CClusterData , CNodeData , CResData , CResTypeData , CExtObject , CClusterData , CGroupData , CNetInterfaceData , CDeskBand , CContextMenu , CShellExt , CNodeData , CNetworkData , CResData , CResTypeData , CGroupData , CObjData , CNetInterfaceData , CContextMenu , CNetworkData
  • InvokeNotify() : qcship::Ship
  • InvokeNotifyIDispatch() : COShip , COShip2
  • InvokeNotifyVtable() : COShip2 , COShip
  • InvokeShip() : COrder , qcorder::Order , COrder
  • InvokeShipIDispatch() : COrder
  • InvokeShipVtable() : COrder
  • ioctlsocket() : DTHandler
  • IPersistStreamInit_Load() : CComSpy
  • IPersistStreamInit_Save() : CComSpy
  • ISAPI_BUFFER() : ISAPI_BUFFER
  • ISAPI_EXTENSION() : ISAPI_EXTENSION
  • ISAPI_REQUEST() : ISAPI_REQUEST
  • ISAPI_STRING() : ISAPI_STRING
  • ISAPI_STRINGW() : ISAPI_STRINGW
  • ISAPITHREAD() : ISAPITHREAD
  • isAsync() : MyOSPObject
  • IsAttributeSet() : CVirtualFile , CDeviceNode , CFolderNode , CVirtualFile , CExtendPropertySheet , CVirtualFile , CBaseNode , CStaticNode , CVirtualFile
  • IsButtonChecked() : CButtonLite
  • IsCARequest() : CRequestInstance
  • IsClassID() : CFactoryData
  • ISCO_DeleteProc() : CMDIChild
  • ISCO_Proc() : CMDIChild
  • IsCommandSet() : CCommand
  • IsConnected() : CTable , CDataSource
  • IsContentCached() : CacheProxySamplePlugin::CacheProxyPlugin
  • IsDeleted() : CFileIO , CFileIdx
  • IsDestroyed() : CWndLite , CMDIFrameLite
  • IsDirty() : CSmpFilter , CHtmlIFilterBase , CComponentData , CToolBand
  • isDirty() : CStaticNode
  • IsDirty() : CResultset , CCommBand , CPersistStorage , HtmlPropIFilter , CImpIPersistFile , CPersistFile , CComponentData , CShellExt , CEntity , CDynamic , IMyPersistStreamImpl< T > , CDeskBand
  • isDirty() : CStaticNode
  • IsDirty() : CExplorerBar , CHtmlIFilter
  • IsDiskSCSI() : CEnumStorageResource
  • IsDlgButtonChecked() : CWndLite
  • IsDownloadInProgress() : CacheProxySamplePlugin::CacheProxyPlugin
  • IsDsEnabledLocaly() : CLoginDlg , CDisdrawDlg , CImp_DrawDlg , CTestApp
  • IsEmpty() : CExList< TYPE > , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , Cstack_c , COBLIST , CList< TYPE, ARG_TYPE > , CListHeader , CLListImpl< TYPE, ARG_TYPE > , NIDeque_c< T > , COBLIST , Stack_c< T > , CDbAlloc , CString , COBLIST
  • isEmpty() : CMmStream , PMmStream
  • IsEmpty() : CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • IsEmptyMember() : CMember
  • IsEmptyUID() : CMember
  • IsEOF() : CFileLite
  • IsEqual() : CDataSource
  • IsFolder() : CPidlMgr
  • IsFormatName() : CMainFrame
  • IsHidden() : CColumnInfo
  • IsInErrorState() : CGenerateRC , CImportRes
  • IsInitialized() : CSimpSvrApp , CAsynchBase
  • IsInList() : CReindeer
  • IsInPlaceActive() : CSimpSvrApp , CSimpSvrObj
  • IsInPlaceVisible() : CSimpSvrObj
  • IsInRoster() : CMember
  • IsLinked() : CLinkable
  • IsLocked() : CFactory
  • IsManaged() : CStorageResource
  • IsManagedByDefault() : CStorageResource
  • IsMatchProperty() : CToken
  • IsMemberOf() : CShellIconOverlayID
  • IsModelPageUsed() : CModel
  • IsMultiNodeCapable() : CStorageResource
  • IsNonHtmlFile() : CHtmlIFilter
  • IsNull() : XBStr , XInterface< T > , XBStr , XPtr< T >
  • IsOpen() : CFileLite
  • IsOpenedQueueArrayEmpty() : CMainFrame
  • IsPageDirty() : CPropertyPage
  • IsPageUsed() : CFontRange
  • IsPropertyName() : CFullPropSpec
  • IsPropertyPropid() : CFullPropSpec
  • IsPropertyReadOnly()
: comadmin::ICatalogObject
, comadmin::COMAdminCatalogObject
  • IsPropertyWriteOnly()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
  • IsQuorumCapable() : CStorageResource
  • IsQuorumResource() : CStorageResource
  • IsReadOnly() : CFileIO
  • IsReadyForDelete() : CAppInfo
  • IsRowsetOpen() : CCommand
  • IsSameMemberID() : CMember
  • IsSameObject() : CBase
  • IsSameRow() : CImpIRowsetIdentity
  • IsSameUID() : CMember
  • IsSelected() : CIceSkate
  • IsSimilar() : CDataSource
  • IsSlotSet() : CBitArray
  • IsStartedByOle() : CSimpSvrApp
  • IsStartToken() : CToken
  • IsStopToken() : CHtmlIFilter
  • IsStoreSerializable() : CMarkTextService
  • IsSubscribed() : CAppInfo
  • IsSubscribedToAny() : CAppInfo
  • IsThisLogicalDisk() : IStorageProperties , CStorageResource
  • IStringFromID() : CStatusHelper
  • IsUIActive() : CSimpSvrObj
  • IsUnicode() : CFileLite
  • IsUnicodeNumber() : CSerialStream
  • IsUpToDate() : COleObject
  • IsValid() : CAsynchNotify , CFullPropSpec
  • IsValidAudioFile() : CAVIFileReader
  • IsValidValue() : CUtilProp
  • IsVisible() : CWndLite
  • IsWin() : CHuman , CComputer
  • isWritable() : PMmStream , CMmStream
  • Item() : CDynamic , CEntity
  • ItemConfigDlgGetItemSettings() : CSettings
  • Iterator() : ClientList::Iterator
  • IWMSCacheItemCollectionImpl() : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl
  • IWMSCacheItemDescriptorImpl() : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- p -

  • PacketFilterPlugin() : RealTimeStylusPlugins::PacketFilterPlugin
  • Packets()
: InkCollection::InkCollection
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
  • PackText() : CPack
  • Page() : CController
  • Page_Load()
: InkBlog::AddBlog
, InkBlog::_Default
  • Paint() : CCharBlock , CBlockFrame , CPage , CModel , CController , CView
  • paint() : RSProxy
  • Paint() : CTextField
  • paint() : HelloJ , Hello2J
  • Paint() : CBox
  • paint() : Hello3J
  • Paint() : CGrid , CLineGrid , CTextGrid
  • PaintApp() : CSimpleApp , CSimpSvrApp
  • PaintCusps() : InkErase::InkErase
  • PaintDoc() : CSimpleDoc , CSimpSvrDoc
  • PaintIntersections() : InkErase::InkErase
  • PaintObj() : CSimpleSite , CSimpSvrObj
  • PaperForm() : PaperForm::PaperForm
  • PaperForm_Load() : PaperForm::PaperForm
  • ParseArgs() : storesh::Storesh
  • ParseCmdLine() : CSimpSvrApp
  • ParseColumnNames() : CFileIO
  • parseCommandLine() : storesh::Storesh
  • ParseCommandLine() : CCmdLineLite
  • ParseConn() : CUtil
  • ParseDataTypes() : CFileIO
  • ParseDisplayName() : CEnumerator , CShellFolder
  • ParseFile() : CCmdLineLite
  • ParseMultiPartBuffer() : CUrlmonCallback
  • ParseMultiPartHeader() : CUrlmonCallback
  • ParseParam() : CCmdLineLite
  • ParseRowValues() : CFileIO
  • ParseURL() : CImpIBindResource
  • ParseUrl() : CProxyPlugin
  • Paste() : CEditBoxLite
  • Pause() : CPlgFilter
  • PauseStream() : CSampleMSPStream
  • PbPropList() : CClusPropList
  • Peo() : CBasePropertyPage
  • PerfCountToTickCount() : CComSpySqlAudit
  • Perform() : CMoveMoney , vcacct::CMoveMoney , vcacct::IMoveMoney , IMoveMoney , CMoveMoney
  • PermitToJoinSessionIndication() : CApplet
  • PermRegistered() : CAdvClientDlg
  • PersistChangesToXmlFile() : CachePluginAdmin
  • PersistNameValToServerNamespace() : CachePluginAdmin
  • PersistSettings() : CacheProxySamplePlugin::CacheProxyPlugin
  • picture1_MouseDown() : CSharp_Draw::Form1
  • picture1_MouseMove() : CSharp_Draw::Form1
  • picture1_MouseUp() : CSharp_Draw::Form1
  • picture1_Paint() : CSharp_Draw::Form1
  • Ping() : CPingResponder
  • PiWizardCallback() : CBasePropertyPage , CExtObject , CBasePropertyPage , CExtObject
  • PixelToInkSpace() : InkClipboard::InkClipboard
  • Play() : CAgentCtlCharacterEx
  • PlayButton_click() : CapJ
  • Plist() : CClusPropList
  • PluginListItem() : RealTimeStylusPluginApp::PluginListItem
  • pnlDrawingArea_MouseDown() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pnlDrawingArea_MouseMove() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pnlDrawingArea_MouseUp() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • PodObjData() : CExtObject
  • Pop() : Stack_c< T >
  • Populate()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
, CComboBoxGuid
, CComboBoxLite
  • PopulateACL() : CDlgIADsSecurityDescriptor
  • PopulateByKey()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • PopulateByQuery()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • PopulateControls() : CContextSamplePropPage
  • PopulateEventList() : CSelectEventsDlg
  • PopulateStaticEntity() : CProxy
  • PopulateSysEventList() : CSelectEventsDlg
  • Post() : IAccount , CAccount , vcacct::CAccount , vcacct::IAccount , CAccount , IAccount
  • PostCreate() : CStorageResource
  • PostEditorEventNotify() : CAnnotator
  • PostHandleEvent() : CAnnotator
  • PostMessage() : CWorkerThread
  • Power() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • PowerOff() : UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
  • PowerOn() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • PPageWndProc0() : CVirtualFile
  • PPageWndProcX() : CExtendPropertySheet
  • Pprops() : CBasePropertyPage , CClipBookServerParamsPage , CBasePropertyPage , CFileShareSampleParamsPage
  • ppUnknown() : CInterfaceDlg
  • preAPI() : APIHook< T >
  • PreCreate() : CStorageResource
  • PreCreateWindow() : CWndLite , CMDIObjects , CMDITrace , CChildView , CMainFrame , CPrintSDIView , CMainFrame , CTestView , CAPIView , CMainFrame
  • PreHandleEvent() : CAnnotator
  • Prepare() : CCommand
  • PrepareForSync() : CSyncMgrHandler
  • PrepareForSyncCall() : CSyncMgrHandler
  • PrepareForSyncCompleted() : CCallbackWrapper
  • PrepareRecord() : CCrmDebugCompensator , CCrmFilesCompensator
  • PrepareRecordVariants() : CCrmDebugCompensator
  • PrepareToHostQuorumResource() : CStorageResource
  • PresetGestures() : CAdvRecoApp
  • PreTranslateMessage() : CMDIFrameLite , CFrameWndLite , CGenericUCPDlg
  • Previous() : CLinkable
  • PrevPage() : CModel
  • PrevSection() : CModel
  • Print() : CPrintRequest
  • PrintAttributes() : CXmlDOM
  • PrintDimensions() : CGenerateRC
  • Printf() : CStdDbOutput , ISAPI_STRING , ISAPI_STRINGW
  • PrintfToResponseBuffer() : ISAPI_REQUEST
  • PrintNode() : CXmlDOM
  • PrintTextToEditBox() : CDeviceProp
  • PrintTo() : CFileViewer , CImpIFileViewer
  • privateData() : CStaticNode::privateData
  • PrivateGetIDsOfNames() : HelloWorld
  • PrivateInvoke() : HelloWorld
  • Process()
: qcship::Ship
, qcorder::IOrderDefault
, qcnotify::INotify
, qcnotify::INotifyDefault
, qcnotify::Notify
, qcorder::IOrder
, qcorder::Order
, qcship::IShip
, qcship::IShipDefault
, CONotify
, COrder
, COShip
, COrder
, COShip2
, CONotify
  • ProcessAsyncFind() : CGenericUCPDlg
  • ProcessFindByType() : CGenericUCPDlg
  • ProcessFindByUDN() : CGenericUCPDlg
  • ProcessGraphEvent() : CSampleMSPStream
  • ProcessLogRecord() : CCrmFilesCompensator
  • ProcessMessage() : CSimpleDialog , CAddVFileDlg , CAddDeviceDlg , CBaseDialog , CAddDeviceDlg , CAddVFileDlg , CAddDeviceDlg , CAddVFileDlg , CBaseDialog , CAddDeviceDlg , CAddFolderDlg , CAddVFileDlg , CBaseDialog , CAddVFileDlg , CBaseDialog , CAddDeviceDlg
  • ProcessReply() : CMonitor
  • Progress() : CSyncMgrHandler , CCallbackWrapper
  • ProgressSetItemProgMaxValue() : CSyncMgrHandler
  • ProgressSetItemProgValue() : CSyncMgrHandler
  • ProgressSetItemStatusText() : CSyncMgrHandler
  • ProgressSetItemStatusType() : CSyncMgrHandler
  • PromptDataSource() : CDataLinks
  • PromptDataSourceProc() : CMainWindow
  • PromptFileName() : CDataLinks
  • PromptFileNameProc() : CMainWindow
  • PropertySheetPageCallback() : CObjSecurity
  • PropPageProc() : CPropPageLite
  • ProvideEvents() : CProvider_IWbemEventProvider , CMyEventProvider
  • ProviderInfoProc() : CMDIChild
  • PszCurrentPropertyName() : CClusPropList
  • PszToolTip() : CFileViewer
  • PublicKeyBlobFromCertificateRawData() : Sample::MySignedXml
  • publishButton_click() : NewsFlash
  • Pull() : CSamplePipe
  • pUnknown() : CInterfaceDlg
  • Purge() : CEmptyVolumeCache
  • Push() : Stack_c< T > , CSamplePipe
  • Put() : CSAFEARRAY
  • put_Audit() : CComSpy
  • put_ColWidth() : CComSpy
  • put_ContextTypes() : CContextAdmin
  • put_CustomerId() : CONotify , COShip , COrder , COShip2 , CONotify , COrder
  • put_DeleteStoredProcedure() : CEntity
  • put_EditMode() : CEntity
  • put_Field() : CEntity
  • put_FileName() : CCrmFilesTest
  • put_GridSize() : CGrid
  • put_InsertStoredProcedure() : CEntity
  • put_Key() : CEntity
  • put_KeyField() : CEntity
  • put_Language() : CCrmFilesTest
  • put_LogFile() : CComSpy
  • put_LogToFile() : CComSpy
  • put_myProperty() : CSimple , CPower
  • put_OrderId() : CONotify , COrder , COShip , COShip2 , CONotify
  • put_OutputPath() : CContextAdmin
  • put_ReadStoredProcedure() : CEntity
  • put_Recordset() : CEntity
  • put_ShowGridLines() : CComSpy
  • put_ShowOnScreen() : CComSpy
  • put_SnapIncrement() : CSnap
  • put_SnapOn() : CSnap
  • put_TransactionUOW() : CCrmMonComp
  • put_UpdateStoredProcedure() : CEntity
  • put_x() : CPoint
  • put_x1() : CLine
  • put_x2() : CLine
  • put_y() : CPoint
  • put_y1() : CLine
  • put_y2() : CLine
  • PutClass() : CInstPro , CMethodPro , CProvider_IWbemServices , CClassPro
  • PutClassAsync() : CClassPro , CMethodPro , CInstPro , CProvider_IWbemServices
  • PutColor() : CSecureObject
  • PutInstance() : CProvider_IWbemServices , CInstPro , CReindeer , CClassPro , CMethodPro
  • PutInstanceAsync() : CMethodPro , CProvider_IWbemServices , CClassPro , CInstPro
  • PutProperty() : CPropPro , CProvider_IWbemServices , CBicycle
  • putref_Font() : CComSpy
  • PutUserName() : CSecureObject
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- q -

  • qMe_ReceiveCompleted() : CSharp_Draw::Form1
  • Query() : Query
  • QueryApplicationFile()
: comadmin::ICOMAdminCatalog
, comadmin::COMAdminCatalog
  • QueryBufferSize() : ISAPI_BUFFER , ISAPI_STRING , ISAPI_STRINGW
  • QueryCache() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • QueryCacheMissPolicy() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • QueryCB() : ISAPI_STRING , ISAPI_STRINGW
  • QueryCCH() : ISAPI_STRING , ISAPI_STRINGW
  • QueryContextMenu() : CContextMenu , CDeskBand , CContextMenu , CShellExt
  • QueryContinueDrag() : CDropSource , CDragSource , CDropSource
  • QueryDataObject() : CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent
  • QueryDataSize() : ISAPI_BUFFER
  • QueryDispatch() : CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData , CComponent , CComponentData
  • QueryDrag() : CSimpleDoc
  • QueryDrop() : CDropTarget
  • QueryEcb() : ISAPI_REQUEST
  • QueryElement() : CHtmlElementBag
  • QueryEnlist() : CPooledData
  • QueryForPropertyPage() : CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • QueryGetData() : CDataObject , CTSFDataObject , CDataObject , CDataXferObj , CDropObject , CPropSheetHost , CDataObject
  • QueryHtmlElement() : CHtmlIFilter
  • QueryIISMajorVersion() : ISAPI_REQUEST
  • QueryIISMinorVersion() : ISAPI_REQUEST
  • QueryInsert() : CTSFEditWnd
  • QueryInsertEmbedded() : CTSFEditWnd
  • QueryInstances() : CHiPerfProvider
  • QueryInterface() : CClassPro , CAsyncQuerySink , CDownloadBindStatusCallback , CDataObject , CComponentData , CComponent , CProvFactory , CSnapinAbout , CDataObject , CComponentData , CConsumer , CClassFactory , CSnapinAbout , CToolBarExtension , CProviderFactory , CSnapinAbout , CEnumTASK , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CPropSheetExtension , CClassFactory , CSnapinAbout , CMgrNotify , CComponentData , CComponent , CClassFactory , CConfNotify , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CComponentData , CDataObject , CObjSecurity , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CDataObject , CComponentData , CComponent , CSnapinAbout , CExtendPropertySheet , CClassFactory , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CClassFactory , CComponentData , CComponent , CClassFactory , CComponent , CDataObject , CComponentData , CClassFactory , CComponentData , CSnapinAbout , CEnumFormatEtc , CDataObject , CComponentData , CComponent , CClassFactory , CSnapinAbout , CDataObject , CClassFactory , CDataObject , CComponentData , CSnapinAbout , CClassFactory , CSnapinAbout , CDataObject , CClassFactory , CComponent , CClassFactory , CSnapinAbout , CConfNotify , CComponentData , CComponent , CMgrNotify , CComponent , CDataObject , CComponentData , CComponent , CComponentData , CSnapinAbout , CDataObject , CWrapVBComponent , CClassFactory , CSnapinAbout , CDataObject , CAppletSession , CComponent , CSnapinAbout , CClassFactory , CComponentData , CComponent , CClassFactory , CFtNotify , CContextMenuExtension , CComponent , CComponentData , CProvider , CConfNotify , CDataObject , CSnapinAbout , CClassFactory , CDataNotify , CSnapinAbout , CApplet , CProvider_IWbemEventConsumerProvider , CMgrNotify , CDataObject , CClassFactory , CProvider_IWbemUnboundObjectSink , CComponentData , AgentNotifySink , CColumnProvider , CLangBarItemButton , CTAPIEventNotification , CEnumSyncMgrItems , CCallbackWrapper , CSyncMgrHandler , CGenericEnum , CClassFactory , CRTCEvents , CRTCOutgoingDlg , CRTCIncomingDlg , IMyPersistStreamImpl< T > , CAdminNotifyHandler , CClassFactory , CPropSheetHost , CConnectionPoint , CSampleDataContainer , CProxyPlugin::COpState , CWiaDataCallback , CFVClassFactory , CMainWindow , WiaWrap::CEventCallback , WiaWrap::CDataCallback , CComponent , MyOSPObject , MyDataSource , MyClassFactory , CSampleStemmer , CMallocSpy , CStream , CRowset , CMgrNotify , CDBSession , CPropertyPage , CImpISpecifyPropertyPages , CDataSource , CCommand , CClassFactory , CBinder , CMallocSpy , CFileStream , CStorageBuffer , CListener , CSmartPtrTrace< T > , CSmartPtr< T > , COleClient , CDropTarget , CProvFactory , CDropObject , CAggregate , CBase , CImpAuth , CSimpSvrObj , CSimpSvrDoc , CSimpSvrApp , CSimpleSite , CDataXferObj , CSimpleDoc , CSimpleApp , CClassFactory , CSimpleDoc , CComponent , CFactory , CClassFactory , CSamplePipe , CDbAlloc , CStdDbOutput , CObject , CClassFactory , CHelloClassFactory , CHello , CCallAs , CCallAsFactory , CDataObject , CClassFactory , CSnapinAbout , CClassFactory , CObject , CClassFactory , CComponent , CClassFactory , CSimpleObject , CClassFactory , CSimpleObject , CClassFactory , CSimpleObject , CClassFactory , CClassFactoryWrapper , CClassFactory , CDog , CDataObject , CUrlmonCallback , CSnapinAbout , CImpIOleDocumentSite , CComponent , CImpIAdviseSink , CImpIOleClientSite , CFrame , CExtendContextMenuEx , CPersistFile , CComponent , COleDocumentView , CComponentData , COleInPlaceObject , CDataObject , CEnumFormatEtc , CClassFactory , CComponentData , CEnumXXX< T, ELT_T, IFACE > , CFactory , CClassFactory , CDataObject , CSnapinAbout , COleInPlaceActiveObject , CClassFactory , CDragSource , COleDocument , COleObject , CEmptyVolumeCache , CPersistStorage , CDataObject , CSmpFilter , CExplorerBar , CMarkTextService , CImpIOleInPlaceSite , CClassFactory , CMyEventProvider , CImpIPersistFile , CFileViewer , CImpIFileViewer , CClassFactory , CContextMenu , CClassFactory , CDropTarget , CProvFactory , WiaWrap::CProgressDlg , CDropSource , CBitmapWnd , CEnumFormatEtc , CISeqStream , CExtractIcon , CRow , AgentNotifySink , CShellExt , CShellExtClassFactory , CClassFactory , CChannelNotify , CTSFDataObject , CShellIconOverlayID , CDropSource , CMgrNotify , CCaseTextService , CTSFEditWnd , CEditSessionBase , CShellFolder , CSimpleSite , CSimpleApp , CSimpleClass , CHtmlIFilterBase , CEnumDisplayAttributeInfo , CDisplayAttributeInfo , CEditSessionBase , CSimpleObject , CSecureObject , CLangBarItemButton , CTestCOMPerformance , CCommBand , CClassFactory , CCustomPropertyStore , CSurrogate , CSite , CToolBand , CMallocSpy , CClassFactory , CSmpFilterCF , CDeskBand , CClassFactory , CAsynchNotify , CLanguageResourceSampleCF , CCompartmentMonitor , CSampleWordBreaker , HtmlPropIFilter , CHtmlIFilterCF , HtmlPropIFilterCF , CProvider_IWbemEventProvider , InkCollectorEvents , CConfNotify , CCallNotify , CTSFPersistentPropertyLoader , CDropTarget , CProvider , CFactory , CRefresher , CSampleDirectory , CMethodPro , CEnumIDList , CMySink , CDataObject , AgentNotifySink , CConfNotify , CCallNotify , CShellView , CDataNotify , CAppShareNotify , CFileTransferNotify , CBackgroundCopyCallback , CAppShareNotify , CMonitor , CProvider_IWbemServices , CInstPro , CProvFactory , CPropPro , CConsumer , CHiPerfProvider , CProviderFactory
  • QueryIsClientConnected() : ISAPI_REQUEST
  • QueryMaxAlloc() : ISAPI_BUFFER , ISAPI_STRINGW , ISAPI_STRING
  • QueryMaxResponseBufferSize() : ISAPI_REQUEST
  • QueryMaxSyncWriteSize() : ISAPI_REQUEST
  • QueryModulePath() : ISAPI_EXTENSION
  • QueryMultiSelDataObject() : CComponent
  • QueryNewPalette() : CSimpleApp
  • QueryObjectSink() : CClassPro , CMethodPro , CProvider_IWbemServices , CInstPro
  • QueryOsMajorVersion() : ISAPI_REQUEST
  • QueryPagesFor() : CComponent , CComponentData , CExtendPropertySheet , CComponentData , CComponent , CPropSheetExtension , CComponentData , CComponent
  • QueryPtr() : ISAPI_BUFFER
  • QueryService() : CBrowserHost , CImpIServiceProvider
  • QuerySpaceForCacheItem() : CacheProxySamplePlugin::CacheProxyPlugin , CProxyPlugin
  • QueryStatus() : CFrame
  • QueryStr() : ISAPI_STRINGW , ISAPI_STRING
  • QueueWorkItem() : ISAPITHREAD
  • Quit() : CUnknown
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- r -

  • RaiseError() : CUtil
  • randomShipStatus() : qcship::Ship
  • RandomShipStatus() : COShip2 , COShip
  • RateResource() : CLDisp
  • RCText() : CCanvas
  • ReactivateAndUndo() : COleInPlaceObject
  • Read() : CComSpy , CImpIStream , CISeqStream , CSimpleObject , CSampleDataContainer , CThumbNailPhotoHolder , msado15::_Stream , CThumbNailPhotoHolder , msado15::Stream , CThumbNailPhotoHolder , CAVIFileReader , CFileLite , CStorageBuffer , CFileStream
  • ReadAllEntity() : ISAPI_REQUEST
  • ReadAt() : CStorageBuffer
  • ReadBuffer() : CStorageBuffer
  • ReadBytes() : CFileLite , CStream
  • ReadFromStream() : CFastVariant
  • ReadPlaylist() : CSDKSamplePlaylistParser
  • ReadPlaylistFromDirectory() : CSDKSamplePlaylistParser
  • ReadSettings() : CSettings
  • ReadString() : CStream
  • ReadTagIntoBuffer() : CHtmlScanner
  • ReadText()
: msado15::_Stream
, msado15::Stream
  • ReadTrustedDomains() : CAPIDoc
  • ReAlloc() : CFileIdx
  • ReAllocBuffer() : WiaWrap::CDataCallback
  • RealTimeStylusDisabled()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RealTimeStylusEnabled()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RealTimeStylusPlugin_Load() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RealTimeStylusPluginApp() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • Rebind() : CRowset
  • ReBind() : CDataGrid
  • RecalcDependantVariables() : CDlgDest
  • Receive() : CPlgPin
  • ReceiveMessage() : RqsClient
  • ReceiveTSPCallData() : CSampleMSPCall
  • recent1_click() : CapJ
  • recent2_click() : CapJ
  • recent3_click() : CapJ
  • recent4_click() : CapJ
  • Recognize() : PaperForm::PaperForm
  • RecognizeInkData() : InkBlog::InkArea
  • ReconcileDir() : CSyncMgrHandler
  • Reconnect() : MSDFHDL::IDataFactoryHandler , CHandler
  • RecordChangeComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • RecordSelectedIndexes() : CS2Dialog
  • RecordsetChangeComplete()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • recv() : DTHandler , SocketMonitor
  • RecvBuf() : RecvBuf
  • recvfrom() : DTHandler
  • RefCount() : RefCount
  • RefIt() : SmartRefPointer< T >
  • Refresh()
: msado15::_Collection
, msado15::_DynaCollection
, msado15::Errors
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::Parameters
, msado15::Properties
, CDataGrid
, CRefClient
, CRefresher
, CProcessDlg
, CSessionDlg
, CShellView
  • RefreshComponents()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • RefreshControls() : CS1Dialog , CS2Dialog , CS3Dialog , CS4Dialog , CTypesDialog
  • RefreshData() : CDataGrid
  • RefreshEnum() : CFullConnectProvider
  • RefreshNodeList() : CDeviceNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode
  • RefreshOptions() : CFullConnectOptions
  • RefreshProperties() : CFullConnectProperties
  • RefreshProvider() : CFullConnectProvider
  • RefreshRouter()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • RefreshSecurity() : CFullConnectSecurity
  • RefreshTreeControls() : CSchemaDlg
  • Register() : CMallocSpy , CBitmapWnd , WiaWrap::CEventCallback , CMainWindow
  • RegisterAll() : CFactory
  • RegisterAllClasses() : CFrame
  • RegisterAndCreateWindow() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • RegisterCategories() : CCaseTextService , CMarkTextService
  • RegisterChange() : CachePluginAdmin
  • RegisterChangeHandler() : CachePluginAdmin
  • RegisterClass() : CRTCAVSession , CRTCIMSession , CRTCWin
  • RegisterEventSink() : CBicycleFolder
  • RegisterForConnectionNotification() : RqsEngine
  • RegisterFunction() : CacheProxySamplePlugin::CacheProxyPlugin
  • RegisterProfiles() : CCaseTextService , CMarkTextService
  • RegisterProviderProc() : CMainWindow
  • RegisterServer() : COleDocument , CCmdLineConsumerApp , CPermEventsApp , CCaseTextService , CMarkTextService
  • RegisterSink() : CPlgTermSample
  • RegistryConfirm() : CAppletSession
  • RejectCall() : Conf
  • Release() : CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CFactory , CCallAsFactory , CCallAs , CHello , CHelloClassFactory , CString , CImpAuth , CSmartPtr< T > , CSmartPtrTrace< T > , CWiaDataCallback , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCEvents , CTAPIEventNotification , CDownloadBindStatusCallback , InkCollectorEvents , SmartRefPointer< T > , CBackgroundCopyCallback , CMonitor , CSmartComPtr< T > , CMgrNotify , CConfNotify , CDataNotify , RefCount , CApplet , CRefCount , CMgrNotify , CConfNotify , CAppletSession , CFtNotify , RefCount , CMgrNotify , CConfNotify , RefCount , CAppShareNotify , CCallNotify , CChannelNotify , CConfNotify , CDataNotify , CFileTransferNotify , RefCount , CMgrNotify , CAppShareNotify , CCallNotify , CConfNotify , CMgrNotify , RefCount , HtmlPropIFilter , HtmlPropIFilterCF , CHtmlIFilterBase , CHtmlIFilterCF , CLanguageResourceSampleCF , CSampleWordBreaker , CSampleStemmer , CSmpFilter , CSmpFilterCF
  • ReleaseAccessor() : CDataAccess , CImpIAccessor
  • ReleaseBuffer() : CString
  • ReleaseCatalog() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg
  • ReleaseChildren() : CBase
  • ReleaseFileObjectList() : CSyncMgrHandler
  • ReleaseHeldRows() : CDataGrid
  • ReleaseIMemberArray() : CConfNotify
  • ReleaseInner() : CAggregate
  • ReleaseInterface() : CSmartComPtr< T >
  • ReleaseIt() : SmartRefPointer< T >
  • ReleaseItemLock() : CSettings
  • ReleaseItemLockX() : CSettings
  • ReleaseMarshalData() : CClassFactoryWrapper , CDynamic , CEntity , CResultset
  • ReleaseObject() : CBase
  • ReleaseRows() : CMSOmniProvRowset , CDataGrid , CRowset , CImpIRowset
  • ReleaseStateMachine() : CRTCIncomingDlg , CRTCOutgoingDlg
  • ReleaseStreamsAndStorage() : CPersistStorage
  • ReleaseThread() : ISAPITHREAD
  • ReleaseTransaction() : CMDIChild
  • ReloadConfig() : RqsEngine
  • ReloadTrace() : RqsEngine
  • RemoteHungup() : Conf
  • RemoteOpen() : FileRepServer
  • RemoteRead() : FileRepServer
  • RemoteReadAsyncPipe() : FileRepServer
  • Remove() : comadmin::COMAdminCatalogCollection , comadmin::ICatalogCollection , CLinkable , CDynamic , CEntity , NIDequeIter_c< T > , CSimpleArray< T > , CAgentCtlCommandsEx
  • RemoveAll() : CStaticMap , CParameters , CBindings , CColumnInfo , CList< TYPE, ARG_TYPE > , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , CVector< TYPE, IDX > , CProperties , CPropertyInfos , TPropSetBase< TYPE, OBJTYPE > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , CSimpleArray< T > , CAgentCtlCommandsEx
  • RemoveAllCacheItems() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • RemoveAllChildren() : CMainWindow
  • RemoveAllSubscriptions() : CAppInfo
  • RemoveAt() : CList< TYPE, ARG_TYPE > , CVector< TYPE, IDX > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , CSimpleArray< T > , COBLIST
  • RemoveAttribute() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • RemoveCacheItem() : CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin
  • RemoveChildNode() : CDeviceNode , CFolderNode
  • RemoveChildNodes() : CDeviceNode , CFolderNode , CStaticNode
  • RemoveData() : NIDequeIter_c< T >
  • removeDataSourceListener() : MyDataSource
  • RemoveDevice() : CGenericUCPDlg
  • RemoveDiskFromArray() : CEnumStorageResource
  • RemoveElement() : CVectorEx< TYPE, IDX >
  • RemoveEntryFromDatabase() : CacheProxySamplePlugin::CacheProxyPlugin
  • RemoveEnum() : CRefClient , CRefresher
  • RemoveFromBack() : NIDeque_c< T >
  • RemoveFromFront() : NIDeque_c< T >
  • RemoveFromList() : CMallocSpy , CViewList
  • RemoveFromMediaCapabilities() : CRTCOutgoingDlg
  • RemoveFromOpenedQueuePathNameArray() : CMainFrame
  • RemoveFromPathNameArray() : CMainFrame
  • RemoveFromPluginCollection() : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • RemoveHead() : COBLIST , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST
  • RemoveItem() : ClientList
  • RemoveKey() : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • RemoveMember() : CAppletSession
  • RemoveMenus() : CFrame , COleDocumentView
  • RemoveNode() : CObjTree
  • RemoveNodes() : CFolderNode , CDeviceNode , CStaticNode , CFolderNode , CStaticNode , CDeviceNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode , CDeviceNode , CFolderNode , CStaticNode
  • RemoveObject() : CObjTree , CRefresher
  • RemoveObjects() : CRefClient
  • removeOLEDBSimpleProviderListener() : MyOSPObject
  • RemoveParent() : CVCExploreDlg
  • RemoveRecentConfig() : CFullConnect
  • RemoveRecentFile() : CFullConnect
  • removeRequest() : RSProxy
  • removeResponse() : RSProxy
  • RemoveSession() : CDataSource , CRTCWin
  • RemoveStream() : CSampleMSPCall
  • RemoveSubscription() : CAppInfo
  • removeSubscription() : NewsSubscriber
  • RemoveTail() : CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE > , COBLIST , CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE >
  • RemoveUser() : IDBAuthAdmin , CDBAuthAdmin , CDBAuthPlugin
  • RemoveVirtualFile() : CFolderNode
  • RenameItem() : CShellView
  • Replace() : NIDequeIter_c< T >
  • ReplaceAll() : CEditBoxLite
  • ReplacePage() : CSCP , CProppageUser , CShellExt
  • ReplaceSel() : CEditBoxLite , CRichEditLite
  • ReplaceWindowModeChange() : CFileViewer
  • Requery()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • Request() : CContext
  • RequestAttrsAtPosition() : CTSFEditWnd
  • RequestAttrsTransitioningAtPosition() : CTSFEditWnd
  • RequestBorderSpace() : CFrame
  • RequestComplete() : Notify , AgentNotifySink , Notify , AgentNotifySink
  • RequestFile() : FileRepClient
  • RequestItemLock() : CSettings
  • RequestLock() : CTSFEditWnd
  • RequestNewObjectLayout() : CBrowserHost , COleClient , CImpIOleClientSite , CBrowserHost , CSpyCon , CBrowserHost
  • RequestStart() : AgentNotifySink , Notify
  • RequestSupportedAttrs() : CTSFEditWnd
  • RequestToShutdown() : ASYNC_REQUESTER
  • Reserved1()
: comadmin::ICOMAdminCatalog
, comadmin::COMAdminCatalog
  • Reserved2()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • Reset() : CEnumFormatEtc , fullsvr::ISynchronize , CCertEncodeDateArray , CDataObject , CCertEncodeCRLDistInfo , CCertEncodeStringArray , ISAPI_BUFFER , CStorageResource , CMallocSpy , CEnumTASK , CCertEncodeAltName , fullsvr::AsyncFullServ , CAsyncXXX< T, ISyncFace, IAsyncFace > , CEnumDisplayAttributeInfo , CDisplayAttributeInfo , CEnumSyncMgrItems , CGenericEnum , CEnumXXX< T, ELT_T, IFACE > , CCallBack , CImpIDBBinderProperties , CCertEncodeLongArray , CEnumFormatEtc , CRefresherMember< T > , CEnumStorageResource , CEnumIDList
  • ResetAceMaskControls() : CDlgIADsSecurityDescriptor
  • ResetAcePtr() : CDlgIADsSecurityDescriptor
  • ResetColInfo() : CS1Dialog
  • ResetContent() : CComboBoxLite
  • ResetDefaults() : CFullConnect
  • ResetIndexList() : CS2Dialog
  • ResetParser() : CCmdLineLite
  • ResetResource() : CLDisp
  • ResetResults() : CRecoOutputWnd
  • ResetSearchPref() : CADsSearch
  • ResetSlots() : CBitArray
  • ResetTableList() : CS1Dialog
  • ResetTypeLists() : CTypesDialog
  • Resize() : ISAPI_BUFFER
  • ResizeBorder() : COleInPlaceActiveObject
  • ResizeBorderDW() : CExplorerBar , CToolBand , CCommBand , CDeskBand
  • ResizeBuffer() : ISAPI_STRING , ISAPI_STRINGW
  • ResizeClientWindow() : CFrame
  • Response() : CContext
  • Restart() : AgentNotifySink , Notify , AgentNotifySink
  • RestartPosition() : CDataGrid , CRowset , CImpIRowset
  • RestoreCursor() : CWaitCursor
  • RestoreREGDB()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • RestoreResultView() : CComponent
  • RestoreSelection() : CComboBoxLite
  • RestrictionsOnOpenSchema() : CADVCGENDlg
  • Resync()
: msado15::_Recordset
, msado15::Recordset20
, msado15::Recordset21
, msado15::Recordset
  • RetrieveBaseNodePtr() : CDataObject
  • RetrieveData() : CSCPCMenuDialog
  • RetrieveDataObjPtr() : CDataObject
  • RetrieveDialogInformation() : CContextSamplePropPage
  • RetrieveDisplayString() : CDataObject
  • RetrieveGuidString() : CDataObject
  • RetrieveMultiSelectCookies() : CDataObject
  • RetrieveMultiSelectTypes() : CDataObject
  • RetrieveNodeAttribs() : CDataObject
  • RetrieveNodePropPtr() : CDataObject
  • RetrieveNodeTypeFlg() : CDataObject
  • RetrieveNodeTypeGuid() : CDataObject
  • RetrieveRequestedAttrs() : CTSFEditWnd
  • RetrieveSnapInClassID() : CDataObject
  • Revert() : CSimpleObject , CImpIStream , CStorageBuffer , CFileStream
  • Rewind() : CMmStreamConsecBuf
  • RollbackTrans()
: msado15::Connection15
, msado15::_Connection
, msado15::Connection
  • RollbackTransComplete()
: msado15::ConnectionEventsVt
, msado15::ConnectionEvents
  • RosterReportIndication() : CAppletSession
  • RotateColor() : CSimpSvrObj
  • Row() : CGridIt
  • RowBookmark() : CDataGrid
  • RowChangeProc() : CMDIChild
  • RowContaining() : CDataGrid
  • RowOpenProc() : CMDIChild
  • RowTop() : CDataGrid
  • RPvlPropertyValue() : CClusPropList
  • RqsClient() : RqsClient
  • RqsConfig() : RqsConfig
  • RqsEngine() : RqsEngine
  • RSProxy() : RSProxy
  • RSQuery() : CProxy
  • RSQueryRW() : CProxy
  • RSUpdate() : CProxy
  • RTCClientEvent() : CRTCOutgoingDlg , CRTCIncomingDlg
  • RTCMediaEvent() : CRTCOutgoingDlg , CRTCIncomingDlg
  • RTCSessionStateEvent() : CRTCOutgoingDlg , CRTCIncomingDlg
  • Run() : CBrowserHost , IBrowserHost , CPlgFilter , CAdvRecoApp , CSpyCon , CBrowserHost , IBrowserHost , CBrowserHost , IBrowserHost , CAppLite , CMultiRecoApp , CPropSheetHost
  • run() : RSProxy
  • runUrlDownloadThread() : RSProxy
  • rValue() : APIHook< T >
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- s -

  • S_HrCreateObject() : CObjData
  • SafeAddRef() : CSafeRefCount
  • SafeGetFromPosition() : COBLIST
  • SafeRelease() : CSafeRefCount
  • SafeStrlen() : CString
  • Save() : CResultset , CToolBand , CImpIPersistFile , CEditBoxLite , CShellExt , CXmlDOM , CPersistFile , CPropertyPage , CDSLConnectionPage , CPersistStorage , IMyPersistStreamImpl< T > , CComponentData , msado15::_Recordset , CComponentData , HtmlPropIFilter , msado15::Recordset , CHtmlIFilter , CHtmlIFilterBase , CDynamic , CSmpFilter , CCommBand , CEntity , CDeskBand , CExplorerBar
  • SaveAll() : CBankDlg
  • SaveAndReOpenFile() : CDBFile
  • SaveArray() : CComputer , CHuman
  • SaveAsMenu_Click() : Serialization::SerializationForm
  • SaveChanges()
: comadmin::COMAdminCatalogCollection
, comadmin::ICatalogCollection
  • SaveCompleted() : CPersistFile , CPersistStorage , HtmlPropIFilter , CHtmlIFilter , CHtmlIFilterBase , CSmpFilter , CImpIPersistFile , CShellExt
  • SaveConfigValues() : CContextPlugin
  • saveData() : MyOSPObject
  • SaveDefaults() : CFullConnect
  • SaveHTML() : Serialization::SerializationForm
  • SaveInitString() : CServiceComp
  • SaveISF() : Serialization::SerializationForm
  • SaveNewProvider() : Microsoft::Uddi::Demo::Publish
  • SaveObject() : CBrowserHost , CSpyCon , CImpIOleClientSite , COleClient , CBrowserHost
  • SaveOptions() : COptionsSheet
  • SavePlaylist() : CacheProxySamplePlugin::CacheProxyPlugin
  • SaveSelection() : CComboBoxLite
  • SaveSettings() : CSpyCon , CMainWindow
  • SaveStrokeCollection() : CMultiRecoApp
  • SaveToFile() : CComSpy , IComSpy , msado15::_Stream , msado15::Stream
  • SaveToStorage() : CSimpSvrObj
  • SaveToStream() : CEntity
  • SaveViewState() : COleDocumentView , CShellView
  • SaveXML() : Serialization::SerializationForm
  • Say() : IHelloWorld , HelloWorld , IHelloWorld , HelloWorld
  • ScAddExpandSzProp() : CClusPropList
  • ScAddMultiSzProp() : CClusPropList
  • ScAddProp() : CClusPropList
  • Scale() : CCanvas
  • ScAllocPropList() : CClusPropList
  • ScAllocValueList() : CClusPropValueList
  • ScanTag() : CHtmlScanner
  • ScanTagBuffer() : CHtmlScanner
  • ScAppend() : CClusPropList
  • ScCheckIfAtLastProperty() : CClusPropList
  • ScCheckIfAtLastValue() : CClusPropValueList
  • ScCopy() : CClusPropList
  • ScGetClusterProperties() : CClusPropList
  • ScGetGroupProperties() : CClusPropList
  • ScGetNetInterfaceProperties() : CClusPropList
  • ScGetNetworkProperties() : CClusPropList
  • ScGetNodeProperties() : CClusPropList
  • ScGetResourceProperties() : CClusPropList
  • ScGetResourceTypeProperties() : CClusPropList
  • ScGetResourceTypeValueList() : CClusPropValueList
  • ScGetResourceValueList() : CClusPropValueList
  • ScheduleWork() : RqsEngine
  • SchemaRowsetProc() : CSchemaDlg
  • SchemaTreeProc() : CSchemaDlg
  • ScMoveToFirstProperty() : CClusPropList
  • ScMoveToFirstPropertyValue() : CClusPropList
  • ScMoveToFirstValue() : CClusPropValueList
  • ScMoveToNextProperty() : CClusPropList
  • ScMoveToNextPropertyValue() : CClusPropList
  • ScMoveToNextValue() : CClusPropValueList
  • ScMoveToPropertyByName() : CClusPropList
  • ScParseProperties() : CBasePropertyPage
  • ScParseUnknownProperty() : CBasePropertyPage
  • Scratch() : CDog
  • Scroll() : CSpyCon , CImpIOleInPlaceSite , CSimpleDoc , CDataGrid , COleClient , CCanvas , CView , CBrowserHost
  • ScrollCaret() : CEditBoxLite
  • ScrollGrid() : CDataGrid
  • ScSetPropToDefault() : CClusPropList
  • SearchComplete() : CDeviceFinderCallback
  • Seek() : CSimpleObject , msado15::_Recordset , msado15::Recordset , msado15::Recordset21 , CFileLite , CStream , CStorageBuffer , CFileStream , CImpIStream , CISeqStream
  • select() : DTHandler
  • Select() : CDelegationBase
  • SelectAllApps() : CSelectEventsDlg
  • SelectApplication() : CSelectEventsDlg
  • SelectApplications() : CComSpy , IComSpy
  • SelectItem() : CTreeViewLite , CDelegationBase , CShellView
  • SelectObject() : CObjTree
  • SelectTerminal() : CSampleMSPStream
  • send() : DTHandler , SocketMonitor
  • SendData() : CAppletSession
  • SendDataIndication() : CAppletSession
  • SendKeystroke() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • SendMouseMovement() : CDisdrawDlg , CImp_DrawDlg , CDisdrawDlg
  • SendOnDataChange() : CSimpSvrObj
  • SendResponse() : RqsClient
  • SendStatusReport() : CMgdClusCfgInit
  • sendto() : DTHandler
  • SerializationForm() : Serialization::SerializationForm
  • Serialize() : CPrintSDIDoc , CTestDoc , CAPIDoc , CCustomPropertyStore
  • SerializeInkData() : InkBlog::InkArea
  • Server() : CContext
  • ServiceCheck()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • ServiceInstanceDied() : CServiceCallback
  • Session() : CContext
  • Set() : CImpAuth , CRefresherMember< T > , CQuickStringWrap , SMmStream , XPtr< T > , XInterface< T > , XBStr , XWindow , XBStr , XPtr< T >
  • set_Catalog() : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg
  • set_ComputerName() : CVCExploreDlg
  • set_CurrentCollection() : CVCExploreDlg
  • set_ParentDlg() : CConnectDlg
  • set_UtilityType() : CAppUtilDlg
  • setAbsolutePage()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • setAbsolutePosition()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetAccountClsctx() : CMoveMoney
  • SetActionText() : CDownloadUI
  • setActiveConnection()
: msado15::_Command
, msado15::_Record
, msado15::_Recordset
, msado15::Command
, msado15::Command15
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetActiveObject() : CFrame
  • SetAllowAddNew() : CDataGrid
  • SetAllowArrows() : CDataGrid
  • SetAllowDelete() : CDataGrid
  • SetAllowRowSizing() : CDataGrid
  • SetAllowUpdate() : CDataGrid
  • SetAndGetHostName() : CX224
  • SetAppearance() : CDataGrid
  • SetArray() : CVARIANT
  • SetAt() : CString , CList< TYPE, ARG_TYPE > , CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > , CList< TYPE, ARG_TYPE > , CExList< TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • SetAtIndex() : CStaticMap , CSimpleArray< T >
  • SetAtIndexNoLen() : CStaticMap
  • SetAttribOnly() : CADsSearch
  • SetAttribute() : CVirtualFile , CBaseNode , CDeviceNode , CFolderNode , CStaticNode , CVirtualFile
  • SetAttributeInfo() : CDisplayAttributeInfo
  • setAttributes()
: msado15::_Connection
, msado15::_Parameter
, msado15::Connection
, msado15::Connection15
, msado15::Field
, msado15::Parameter
, msado15::Property
  • SetAuthorizedUsers() : CSids
  • SetAutoAnswerMode() : CRTCIncomingDlg
  • SetAutoPopupMenu() : CAgentCtlCharacterEx
  • SetBackColor() : CDataGrid
  • SetBannerText() : CDownloadUI
  • SetBindingType() : COptionsSheet
  • setBookmark()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetBookmark() : CDataGrid
  • SetBool() : CVARIANT
  • SetBorderSpace() : CFrame
  • SetBorderStyle() : CDataGrid
  • SetBuf() : CMmStreamBuf
  • SetBuffer() : CacheProxySamplePlugin::INSSBufferImpl
  • SetBufferedResponseStatus() : ISAPI_REQUEST
  • SetBuffers() : CNullModem
  • SetByte() : CVARIANT
  • setCacheSize()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetCaption() : CDataGrid , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetChannelNum() : CDlgSrc
  • setChapter() : msado15::ADORecordsetConstruction
  • SetCharFormat() : CRichEditLite
  • setCharset()
: msado15::_Stream
, msado15::Stream
  • SetCharTable() : CTextGrid
  • SetClerk() : CCrmMonComp
  • SetClientSite() : COleObject
  • SetCodePage() : CImportRes
  • SetCol() : CDataGrid
  • setCollect()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetColor() : CSimpSvrObj , CConsole , CRichEditLite , InkClipboard::InkClipboard
  • SetColorAttrib() : CConsole , CRichEditLite
  • SetColorScheme() : COleObject
  • SetColumn() : CListViewLite
  • SetColumnBind() : CFileIO
  • SetColumnData() : CDataAccess
  • SetColumnHeaders() : CDataGrid
  • SetColumns() : CImpIRowChange
  • SetColumnWidth() : CListViewLite
  • SetCommandStream() : CCommand
  • SetCommandText() : CCommand , CImpICommandText
  • setCommandText()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • SetCommandTextProc() : CMDIChild
  • setCommandTimeout()
: msado15::_Command
, msado15::_Connection
, msado15::Command
, msado15::Command15
, msado15::Connection
, msado15::Connection15
  • setCommandType()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • SetComponentData() : CDelegationBase
  • SetComPortState() : CNullModem
  • SetConfidence() : CAgentCtlCommandEx
  • SetConfidenceText() : CAgentCtlCommandEx
  • SetConfig() : CMDIChild
  • SetConn() : CUtil
  • SetConnected() : CAgentCtlEx
  • SetConnectedPort() : CNullModem
  • setConnectionString()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • setConnectionTimeout()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetConsoleTracing() : RqsEngine
  • SetConstraint() : CConstraintDlg
  • SetConstraintAndTable() : CConstraintDlg
  • SetContextTypes() : CContextPlugin
  • SetControlbar() : CComponent , CToolBarExtension , CComponent
  • SetCount() : CResultset
  • SetCounter() : CSampleInstance
  • SetCredentials() : CADQIApp
  • SetCSet() : CModel
  • SetCurrentCellModified() : CDataGrid
  • SetCurrentCellVisible() : CDataGrid
  • SetCurSel() : CListBoxLite , CComboBoxLite , CTabLite
  • setCursorLocation()
: msado15::_Connection
, msado15::_Recordset
, msado15::Connection
, msado15::Connection15
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • setCursorType()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • setCustomerId()
: qcnotify::INotify
, qcnotify::INotifyDefault
, qcnotify::Notify
, qcorder::IOrder
, qcorder::IOrderDefault
, qcorder::Order
, qcship::IShip
, qcship::IShipDefault
, qcship::Ship
  • SetData() : ISAPI_BUFFER , CDataObject , CPidlMgr , CTSFDataObject , CDataObject , CDataXferObj , IRowsetChangeImpl< T, Storage, RowClass > , CDropObject , CImpIRowsetChange , CPropSheetHost , CDataObject
  • SetDataChanged() : CDataGrid
  • setDataFormat() : msado15::Field
  • SetDataMember() : CDataGrid
  • setDataMember()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • SetDataSize() : ISAPI_BUFFER
  • setDataSource()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • SetDefaultCommand() : CAgentCtlCommandsEx
  • setDefaultDatabase()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetDefaultFont() : CRichEditLite
  • SetDefColWidth() : CDataGrid
  • setDefinedSize() : msado15::Field
  • setDeletedStatus() : CRocket
  • SetDeleteFlag() : CAppInfo
  • SetDescription() : CBankDlg , CAgentCtlCharacterEx , CPartitionInfo
  • SetDialogPointer() : CDeviceFinderCallback , CServiceCallback
  • SetDimLevel() : SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD , UPNPDimmerService , IUPnPService_DimmingService_SCPD , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD , CDimmerService , MYDEVICELib::IUPnPService_DimmingService_SCPD
  • setDirection()
: msado15::_Parameter
, msado15::Parameter
  • SetDirtyFlag() : CContextSamplePropPage
  • SetDispatch() : CVARIANT
  • SetDouble() : CVARIANT
  • SetDriveLetterMappings() : CPartitionInfo , CStorageResource
  • SetEditActive() : CDataGrid
  • SetEffects() : CRichEditLite
  • SetEnabled() : CDataGrid , CAgentCtlCommandEx
  • SetEngine() : RqsClient
  • SetEOS()
: msado15::_Stream
, msado15::Stream
  • SetErrorState() : CImportRes
  • SetExtent() : COleObject
  • setFile() : MyOSPObject
  • setFilter()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetFirstRow() : CDataGrid
  • SetFocus() : CWndLite
  • SetFont() : CWndLite , CTextField , CTextGrid , CCharBlock , CPage
  • SetFontCharSet() : CAgentCtlBalloonEx
  • SetFontName() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • SetFontRange() : CFontRange
  • SetFontSize() : CAgentCtlBalloonEx , CAgentCtlCommandsEx
  • SetForeColor() : CDataGrid
  • SetFormat() : CBox , CCodeGrid , CPageFormat , CCharBlock , CPage , CModel
  • SetFoundLang() : CImportRes
  • SetGestureName() : CRecoOutputWnd
  • SetGlobalVoiceCommandsEnabled() : CAgentCtlCommandsEx
  • SetGuid() : CComboBoxGuid
  • SetGuide() : CInkInputWnd
  • SetHandle() : CDelegationBase , CBackground , CDelegationBase
  • SetHandles() : CRefClient , CSampleDataSource
  • SetHeading() : CProgress
  • SetHeadLines() : CDataGrid
  • SetHeight() : CAgentCtlCharacterEx
  • SetHelpContextID() : CAgentCtlCharacterEx , CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetHelpFile() : CAgentCtlCharacterEx
  • SetHelpModeOn() : CAgentCtlCharacterEx
  • SetHostNames() : COleObject
  • SetHScrollPos() : CScrollableView
  • SetHtmlElement() : CHtmlElemBagEntry
  • SetIdleOn() : CAgentCtlCharacterEx
  • SetImpersonateIID() : CCommand
  • SetIndex() : CFileIdx
  • setIndex()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset21
  • SetInfo() : CException
  • SetIniFile() : CUtil
  • SetInner() : CAggregate
  • SetInPlaceSite() : COleDocumentView
  • SetInRosterFlag() : CMember
  • SetInterface() : CBase , CADsSearch
  • SetInterfaceSafetyOptions() : CPlgTermSample , CGrid , CFactory
  • setIsolationLevel()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetItem() : CTabLite
  • SetItemData() : CShellFolder
  • SetItemImage() : CListViewLite , CTreeViewLite
  • SetItemParam() : CListBoxLite , CListViewLite , CTreeViewLite , CComboBoxLite
  • SetItemState() : CListViewLite , CTreeViewLite
  • SetItemStatus() : CSyncMgrHandler
  • SetItemText() : CListViewLite , CTreeViewLite , CTabLite
  • SetKey() : CStaticMap
  • SetLanguageID() : CAgentCtlCharacterEx
  • SetLeft() : CAgentCtlCharacterEx
  • SetLeftCol() : CDataGrid
  • SetLen() : ISAPI_STRING , ISAPI_STRINGW
  • SetLength() : CacheProxySamplePlugin::INSSBufferImpl
  • setLineSeparator()
: msado15::_Stream
, msado15::Stream
  • SetLoadSchemesButtonState() : WsdlDiscovery::frmMain
  • SetLocale() : CHtmlIFilter
  • SetLocation() : InkClipboard::InkClipboard
  • setLockType()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetLogControl() : CCrmDebugCompensator , CCrmFilesCompensator
  • SetLogControlVariants() : CCrmDebugCompensator
  • SetLONG() : CVARIANT
  • SetManaged() : CStorageResource
  • SetManagedByDefault() : CStorageResource
  • SetMarqueeStyle() : CDataGrid
  • setMarshalOptions()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetMaxAlloc() : ISAPI_BUFFER , ISAPI_STRING , ISAPI_STRINGW
  • setMaxRecords()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetMaxResponseBufferSize() : ISAPI_REQUEST
  • SetMaxSyncWriteSize() : ISAPI_REQUEST
  • SetMediaType() : CPlgPin
  • SetMember() : CAppletSession , CMember
  • SetMenu() : CFrame
  • SetMenuState() : CDelegationBase , CRocket
  • SetMessage() : WiaWrap::CProgressDlg
  • setMode()
: msado15::_Connection
, msado15::_Record
, msado15::_Stream
, msado15::Connection
, msado15::Connection15
, msado15::Record
, msado15::Stream
  • SetMoniker() : COleObject
  • SetMultiNodeCapable() : CStorageResource
  • setName()
: msado15::_Command
, msado15::_Parameter
, msado15::Command
, msado15::Command15
, msado15::Parameter
  • SetName() : CAgentCtlCharacterEx , CPartitionInfo , CStorageResource
  • SetNameCount() : CCertEncodeCRLDistInfo
  • SetNameEntry() : CCertEncodeAltName , CCertEncodeCRLDistInfo
  • SetNameOf() : CShellFolder
  • SetNextHashEntry() : CSpecialCharHashEntry
  • setNumericScale()
: msado15::_Parameter
, msado15::Field
, msado15::Parameter
  • SetObj() : CSCPWiz , CWizExtUser
  • SetObject() : CPropSheetHost , CSCPWiz , CWizExtUser
  • SetObjectDesc() : CBase
  • SetObjectRects() : CComSpy , COleInPlaceObject
  • SetObjects() : CPropertyPage
  • setOLEDBCommand() : msado15::ADOCommandConstruction
  • SetOptions() : CEditBoxLite
  • setOrderId()
: qcnotify::INotify
, qcnotify::INotifyDefault
, qcnotify::Notify
, qcorder::IOrder
, qcorder::IOrderDefault
, qcorder::Order
, qcship::IShip
, qcship::IShipDefault
, qcship::Ship
  • SetOutputPath() : CContextPlugin
  • SetPage() : CModel , CAgentCtlPropertySheet
  • SetPageMode() : CModel
  • SetPageSite() : CPropertyPage
  • SetPageSize() : CADsSearch
  • setPageSize()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetParameterInfoProc() : CMDIChild
  • SetParent() : CPropPageLite
  • setParentRow() : msado15::ADORecordConstruction
  • SetParts() : CStatusBarLite
  • SetPercent() : WiaWrap::CProgressDlg
  • setPosition()
: msado15::_Stream
, msado15::Stream
  • setPrecision()
: msado15::_Parameter
, msado15::Field
, msado15::Parameter
  • setPrepared()
: msado15::_Command
, msado15::Command
, msado15::Command15
  • SetPrivateData() : CDataObject
  • SetProgressCallback() : CSyncMgrHandler
  • SetProperties() : CPropertiesBase , CBinder , CCommand , CPropertiesDlg , CImpIDBBinderProperties , CImpICommandProperties , CImpIDBProperties , CImpISessionProperties , CUtilProp
  • SetPropertiesArgChk() : CUtilProp
  • SetProperty() : CProperties , CPropertyIDs , CPropSets , CPropIDSets , CFullPropSpec
  • SetPropid() : CToken
  • SetPropset() : CToken
  • SetPropSet() : CFullPropSpec
  • setProvider()
: msado15::_Connection
, msado15::Connection
, msado15::Connection15
  • SetQuorumCapable() : CStorageResource
  • SetQuorumResource() : CStorageResource
  • SetRaiseRequestErrors() : CAgentCtlEx
  • SetRawSql() : Query
  • SetReadOnly() : CEditBoxLite
  • SetRecord() : CCrmMonComp
  • SetRecordSelectors() : CDataGrid
  • SetRect() : COleDocumentView
  • SetRectComplex() : COleDocumentView
  • SetRefDataSource() : CDataGrid
  • SetRefFont() : CDataGrid
  • SetRefHeadFont() : CDataGrid
  • SetReqType() : CEditValueDlg
  • SetResourcePrivateData() : CStorageResource
  • SetReturnValue() : CListener
  • SetRightToLeft() : CDataGrid
  • setRow() : msado15::ADORecordConstruction
  • SetRow() : CDataGrid
  • SetRowDividerStyle() : CDataGrid
  • SetRowHandle() : CRow
  • SetRowHeight() : CDataGrid
  • setRowPosition() : msado15::ADORecordsetConstruction
  • SetRowsCols() : CInkInputWnd
  • setRowset() : msado15::ADORecordsetConstruction
  • SetScale() : CScrollableView
  • SetSchemaInfo() : CMSOmniProvRowset
  • SetScope() : CADsSearch
  • SetScopeItemValue() : CDelegationBase , CLandBasedVehicle , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CSpaceVehicle , CStaticNode
  • SetScroll() : CScrollBarLite
  • SetScrollBars() : CDataGrid
  • SetScrollInfo() : CScrollBarLite
  • SetScrollPos() : CScrollBarLite
  • SetScrollRange() : CScrollBarLite
  • SetSearchLevel() : CADsSearch
  • SetSearchProviderButtonState() : WsdlDiscovery::frmMain
  • SetSearchServiceButtonState() : WsdlDiscovery::frmMain
  • SetSection() : CUtil
  • SetSecurity() : CObjSecurity
  • SetSel() : CEditBoxLite , CRichEditLite
  • SetSelection() : InkClipboard::InkClipboard , CTSFEditWnd
  • SetSelEndCol() : CDataGrid
  • SetSelLength() : CDataGrid
  • SetSelStart() : CDataGrid
  • SetSelStartCol() : CDataGrid
  • SetSelText() : CDataGrid , CComboBoxLite
  • SetSelValue() : CComboBoxLite
  • SetServerName() : CAPIDoc
  • SetServiceHandle() : RqsEngine
  • SetSessionID() : CAPIDoc , CSessionDlg
  • SetShort() : CVARIANT
  • SetSite() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • setSize()
: msado15::_Parameter
, msado15::Parameter
  • SetSize() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream , CView , CMmStream , PMmStream , CMmStreamBuf , XPtr< T >
  • SetSlots() : CBitArray
  • SetSnapOn() : ISnap
  • setsockopt() : DTHandler
  • setSort()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetSoundEffectsOn() : CAgentCtlCharacterEx
  • setSource()
: msado15::_Record
, msado15::_Recordset
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, msado15::Recordset20
, msado15::Recordset21
  • SetSplit() : CDataGrid
  • SetSplitter() : CSplitterLite
  • SetSpyObj() : CSysLCESub
  • SetSql() : CUtil
  • SetSqlWhere() : Query
  • SetSRModeID() : CAgentCtlCharacterEx
  • SetStartTokenFlag() : CToken
  • SetStatus() : CMySink
  • SetStatusText() : CFrame , CSimpSvrApp , CSimpSvrDoc , CRTCSession , CRTCWin
  • setStayInSync()
: msado15::_Recordset
, msado15::Recordset
, msado15::Recordset20
, msado15::Recordset21
  • SetStr() : CVARIANT
  • setStream() : msado15::ADOStreamConstruction
  • SetStream() : CMmStreamBuf
  • SetStyle() : CLineGrid , CAgentCtlBalloonEx
  • SetTabAcrossSplits() : CDataGrid
  • SetTabAction() : CDataGrid
  • SetTemplateName() : CRequestInstance
  • SetTerminalInfo() : CPlgTermSample
  • SetText() : CDataGrid , CStatusBarLite , CProgress , XBStr , CTSFEditWnd
  • SetTextOrg() : CTextGrid
  • SetThreadData() : CBankDlg
  • SetTimeouts() : CNullModem
  • SetTitle() : WiaWrap::CProgressDlg
  • SetTokenType() : CHtmlElemBagEntry , CToken
  • SetToolbarButtons() : CToolBarExtension
  • SetTop() : CAgentCtlCharacterEx
  • SetTransactionOptionsProc() : CMDIChild
  • SetTTSModeID() : CAgentCtlCharacterEx
  • setType()
: msado15::_Parameter
, msado15::_Stream
, msado15::Field
, msado15::Parameter
, msado15::Stream
  • SetUIData() : CSCPCMenuDialog , CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI
  • SetUIEmployeeID() : CProppageUserUI
  • SetUIPhoto() : CProppageUserUI
  • SetUnicode() : CFileLite
  • SetUnicodeFormat() : CComboBoxEx
  • SetUnknown() : CVARIANT
  • SetupBindings() : CCommand , CDataAccess
  • SetupColAccess() : CRow
  • SetupTransactionCombo() : CMDIChild
  • SetUserCancel() : CDownloadUI
  • setValue()
: comadmin::COMAdminCatalogObject
, comadmin::ICatalogObject
, msado15::_Parameter
, msado15::Field
, msado15::Field15
, msado15::Parameter
, msado15::Property
  • SetValue() : CEditValueDlg , CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeStringArray
  • SetVariant() : CEditValueDlg
  • setVariant() : MyOSPObject
  • SetVisible() : CAgentCtlBalloonEx , CAgentCtlCommandEx , CAgentCtlCommandsEx , CAgentCtlPropertySheet
  • SetVoice() : CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetVoiceCaption() : CAgentCtlCommandEx , CAgentCtlCommandsEx
  • SetVScrollPos() : CScrollableView
  • SetWbemObject() : CPartitionInfo , CStorageResource , IWMIObject
  • SetWbemServices() : CEnumStorageResource , CPartitionInfo , CStorageResource , IWMIServices
  • SetWeight() : CLineGrid
  • SetWidth() : InkClipboard::InkClipboard , CAgentCtlCharacterEx
  • SetWindowPlacement() : CWndLite
  • SetWindowText() : CWndLite
  • SetWizardButtons() : CSCPPageGeneral , CSCPPageBindingInfo , CSCPPageKeywords , CExtPageUser
  • SetWordWrap() : CRichEditLite
  • SetWrapCellPointer() : CDataGrid
  • Ship() : qcship::Ship
  • shipStatusValue() : qcship::Ship
  • ShortQuote()
: persistatl::NewsEvent
, CNewsEvent
, cascadeec::CascadeEC
, cascadeec::INewsEvent
, cascadeec::INewsEventDefault
, newseventclass::INewsEvent
, newseventclass::INewsEventDefault
, newseventclass::NewsEvent
, NewsSubscriber
, persistatl::INewsEvent
, persistatl::INewsEventDefault
  • ShouldScroll() : CComSpy
  • Show() : COleDocumentView , CWebBrowser , CPropertyPage , CWindow , CDelegationBase , CSpaceVehicle , CSimpleDialog , CAgentCtlCharacterEx , CImpIFileViewer , CLangBarItemButton
  • ShowAppWnd() : CSimpSvrApp
  • ShowAttributes() : CDlgIDirectoryObject
  • ShowAudio() : CRTCAVSession
  • showChains() : Sample::Sample
  • ShowClipformatInfo() : CContextMenu
  • ShowCommentGlyphs() : CAnnotator , IAnnotator
  • ShowContextHelp() : CDelegationBase , CPerson
  • ShowDefaultCharacterProperties() : CAgentCtlEx
  • ShowDocWnd() : CSimpSvrDoc
  • ShowDW() : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • ShowEnumeratorData() : CRefClient
  • ShowError() : CSyncMgrHandler
  • ShowErrorCall() : CSyncMgrHandler
  • ShowErrorCompleted() : CCallbackWrapper
  • ShowGridLines() : IComSpy
  • ShowHatchWnd() : CSimpSvrDoc
  • ShowInitialize() : CImpIFileViewer
  • ShowItemProperties() : CSettings
  • ShowMessageBox() : CRTCSession , CRTCWin
  • ShowObject() : CImpIOleClientSite , COleClient , CBrowserHost , CSpyCon
  • ShowObjectData() : CRefClient
  • ShowOnScreen() : IComSpy
  • ShowPopupMenu() : CAgentCtlCharacterEx
  • ShowProperties() : CSyncMgrHandler , CSettings , CEmptyVolumeCache
  • ShowPropertiesCall() : CSyncMgrHandler
  • ShowPropertiesCompleted() : CCallbackWrapper
  • ShowSelectedEvents() : CSelectEventsDlg
  • ShowSelectedSystemEvents() : CSelectEventsDlg
  • ShowVideo() : CRTCAVSession
  • ShowWindow() : CWndLite
  • Shrink() : CCustomPropertyStore
  • ShrinkFromFront() : PMmStream
  • Shutdown() : CSampleDataContainer , CSampleDirectory , CWorkerThread , CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices , AgentNotifySink , Notify
  • ShutDown() : CCertPolicySample
  • shutdown() : DTHandler
  • Shutdown() : Notify , CSDKSamplePlaylistParser
  • ShutdownApplication() : CComSpy , comadmin::COMAdminCatalog , comadmin::ICOMAdminCatalog
  • ShutdownMSPCall() : CSampleMSP
  • ShutdownPlugin() : CAuthenticatePlugin , CDBAuthPlugin , CProxyPlugin , CacheProxySamplePlugin::CacheProxyPlugin , CSDKSampleStorageSystem , CContextPlugin , CSDKSamplePlaylistParserPlugin
  • ShutdownRTCApp() : CRTCOutgoingDlg , CRTCIncomingDlg
  • Signal() : CAsyncXXX< T, ISyncFace, IAsyncFace > , CCallBack , fullsvr::ISynchronize , fullsvr::AsyncFullServ
  • SignalEvent() : CConnectionPoint
  • SignXML() : Sample::SignVerify
  • SignXMLX509Data() : Sample::SignVerify
  • SIMPLE_BROWSER() : SIMPLE_BROWSER
  • SimpleQuery() : CADOComponent , COLEDBComponent , CRDOComponent
  • Simulate() : CSampleDataSource
  • SIndexedDisk() : SIndexedDisk
  • SINK_ENTRY_INFO() : IInkCollectorEventsImpl< T > , IInkRecognitionEventsImpl< T > , IInkCollectorEventsImpl< T > , IInkRecognitionEventsImpl< T >
  • Size() : AgentNotifySink , Notify , CMmStream , PMmStream , CMmStreamBuf , Notify , CController
  • SizeHigh() : CMmStream , PMmStream
  • SizeLow() : CMmStream , PMmStream
  • Skip() : CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc , CGenericEnum , CEnumFormatEtc , CEnumTASK , CEnumStorageResource , CEnumFormatEtc , CDataObject , CEnumIDList , CEnumDisplayAttributeInfo , CStorageResource , CEnumSyncMgrItems
  • SkipCharsUntilNextRelevantToken() : CHtmlScanner
  • SkipLine()
: msado15::_Stream
, msado15::Stream
  • SkipRemainingTextAndGotoNextChunk() : CHtmlElement
  • SmartRefPointer() : SmartRefPointer< T >
  • SMmStream() : SMmStream
  • SnapIncrement() : ISnap
  • SnapOn() : ISnap
  • SnapRect() : CSnap
  • socket() : DTHandler
  • Sort() : CStatusHelper
  • SortItems() : CComponent
  • Speak() : CAgentCtlCharacterEx
  • SpeakButton_click() : CapJ
  • SplitContaining() : CDataGrid
  • Stack_c() : Stack_c< T >
  • start() : RSProxy , Hello2J , Hello3J
  • Start() : CTIMER , ASYNC_REQUESTER
  • start() : HelloJ
  • StartAnimation() : IMMCControl , CMMCControl , CWrapVBComponent
  • StartApplication()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • StartCall() : CCallBack
  • StartMonitor() : CExeModule
  • StartNewStrokeCollection() : CMultiRecoApp
  • startReceiveUpdateThread() : CDisdrawDlg
  • startRequest() : RSProxy
  • StartRouter()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • StartStream() : CSampleMSPStream
  • StartThread() : CBackgroundFolder
  • StartTracking() : CSplitterLite
  • StartTransactionProc() : CMDIChild
  • Stat() : CSimpleObject , CStream , CStorageBuffer , CImpIStream , CFileStream
  • StateAddPartyIDC() : CRTCOutgoingDlg
  • StateAddPartyIDCVisible() : CRTCOutgoingDlg
  • StateAnswerIDC() : CRTCIncomingDlg
  • StateAppSharingIDC() : CRTCOutgoingDlg
  • StateChanged() : CConfNotify , CAppShareNotify , CCallNotify , CConfNotify , CCallNotify , CConfNotify , CAppShareNotify
  • StateCoCreateClient() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateConnectIDC() : CRTCOutgoingDlg
  • StateConnectIDCVisible() : CRTCOutgoingDlg
  • StateDisconnectIDC() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateDUriIDC() : CRTCOutgoingDlg
  • StateInitClient() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateListenMode() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateLUriIDC() : CRTCOutgoingDlg
  • StatePartyListIDC() : CRTCOutgoingDlg
  • StateQueryActiveMedia() : CRTCOutgoingDlg , CRTCIncomingDlg
  • StateRemovePartyIDC() : CRTCOutgoingDlg
  • StateSessionControl() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateSinkEvent() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateStartT120() : CRTCOutgoingDlg
  • StateStartTunning() : CRTCOutgoingDlg
  • StateTuneIDC() : CRTCOutgoingDlg
  • StateUnSinkEvent() : CRTCIncomingDlg , CRTCOutgoingDlg
  • StateVariableChanged() : CServiceCallback
  • StaticEnumerationCallback() : CReindeer
  • StaticNodeWndProc() : CStaticNode
  • STDMETHOD_() : CMallocSpy , CDog , CClassFactory , CClassFactoryWrapper , CSurrogate , CStdDbOutput , CDbAlloc , CCrmFilesTest , CLogFile , CADOComponent , COLEDBComponent , CRDOComponent , CDynamicResultset , COleClient , _NoAddRefReleaseQIOnSmartPtr< T > , CBitmapWnd , WiaWrap::CDataCallback , WiaWrap::CEventCallback , CMainWindow , WiaWrap::CProgressDlg , CProxyPlugin::COpState , CSampleDataContainer , CSampleDirectory , CAdminNotifyHandler , CObjSecurity , CWrapVBComponent , CEventSink , CAsyncQuerySink , CProviderFactory , CAsynchNotify , CDataObject , CDragSource , CDropTarget , CEnumFormatEtc , CDropTarget , CEnumIDList , CExtractIcon , CShellFolder , CShellView , CTSFEditWnd , CShellView , CExtractIcon , CDropTarget , CDataObject , CProviderFactory , CObjSecurity , CSampleDirectory , CProxyPlugin::COpState , WiaWrap::CDataCallback , _NoAddRefReleaseQIOnSmartPtr< T > , COleClient , CLogFile , CDbAlloc , CSurrogate , CClassFactory , CMallocSpy
  • STDMETHODIMP_() : CDataObject , COleInPlaceObject , CClassFactory , CDeskBand , COleDocumentView , CCommBand , CComponent , CClassFactory , CSimpleClass , CDataObject , CToolBand , COleObject , CMySink , CDataObject , CEnumFormatEtc , CSnapinAbout , CClassFactory , CProvFactory , CMySink , CSnapinAbout , CMallocSpy , CPropSheetExtension , CMallocSpy , MyDataSource , CInstPro , CSnapinAbout , CBinder , CImpIOleInPlaceSite , CPropPro , CClassFactory , CFrame , CSite , CClassFactory , CMallocSpy , CFileStream , CComponentData , MyClassFactory , CProvFactory , CSnapinAbout , CSyncMgrHandler , CShellExt , CClassFactory , CComponentData , CClassFactory , CCommBand , CSettings , CClassFactory , CDataObject , CTSFPersistentPropertyLoader , CComponent , CClassFactory , CExtendContextMenuEx , CClassFactory , CSnapinAbout , MyOSPObject , CSnapinAbout , CRefresher , CSnapinAbout , CClassFactory , CComponent , CFactory , CComponentData , CSamplePipe , CProvider , CComponentData , CDataObject , CComponent , CColumnProvider , CProvider , CDataObject , CSimpleDoc , CClassFactory , CMallocSpy , CEnumSyncMgrItems , CSnapinAbout , CClassFactory , CEnumDisplayAttributeInfo , CSnapinAbout , CDataObject , CProvider_IWbemEventProvider , CMallocSpy , CComponent , CComponentData , CProvider_IWbemEventProvider , CClassFactory , CSimpSvrObj , CClassFactory , CLangBarItemButton , CComponent , CMallocSpy , CSnapinAbout , CProvider_IWbemUnboundObjectSink , CComponent , CClassFactory , CProvider , CComponentData , CMallocSpy , CClassFactory , CFileViewer , CComponentData , CDataObject , CTSFDataObject , CComponentData , CDataObject , CBase , CSnapinAbout , CClassFactory , CDataObject , CProvFactory , CSnapinAbout , CDataObject , CProvider_IWbemEventConsumerProvider , CSnapinAbout , CShellIconOverlayID , CComponentData , CClassPro , CSnapinAbout , CMallocSpy , CFileStream , CMallocSpy , CClassFactory , CComponent , CClassFactory , CDataObject , CClassFactory , CEditSessionBase , CComponent , CClassFactory , CSnapinAbout , CRowset , CContextMenu , CSnapinAbout , AgentNotifySink , CShellExt , CDBSession , CCompartmentMonitor , CDataObject , CClassFactory , CCommand , CComponentData , CComponent , CDataObject , CClassFactory , CSnapinAbout , CAsyncQuerySink , CMallocSpy , CClassPro , CDropSource , CMallocSpy , CClassFactory , CConsumer , CSnapinAbout , CSimpleApp , CClassFactory , CDisplayAttributeInfo , CListener , CProviderFactory , CSnapinAbout , CDropSource , CComponent , CAggregate , CProvider_IWbemEventConsumerProvider , CCustomPropertyStore , CUpdateReceipt , CCallbackWrapper , CToolBarExtension , CContextMenu , CCallbackWrapper , CEnumSyncMgrItems , CComponentData , CToolBarExtension , CSimpleDoc , CDataObject , CPropSheetHost , CSnapinAbout , CEditSessionBase , CPropSheetHost , CCaseTextService , CTSFPersistentPropertyLoader , CComponent , CDataObject , CISeqStream , CComponent , CLangBarItemButton , CComponent , CDataObject , CMallocSpy , CClassFactory , CMallocSpy , CSnapinAbout , CDisplayAttributeInfo , CClassFactory , CComponent , CComponentData , CProvider_IWbemEventProvider , CDataObject , CComponent , CComponentData , CDataObject , CContextMenuExtension , CDataObject , CClassFactory , CRow , CDataSource , CClassFactory , CSnapinAbout , CDataSource , CCompartmentMonitor , CComponentData , CSnapinAbout , CMallocSpy , CComponentData , CProvider_IWbemServices , CComponent , CSnapinAbout , CMallocSpy , CClassFactory , CMallocSpy , CClassFactory , CComponentData , CDataObject , CClassFactory , CComponentData , CEnumTASK , CDataObject , CProvider , CColumnProvider , CLangBarItemButton , CSnapinAbout , CDataObject , CBase , CProviderFactory , CDropTarget , CDropObject , CSnapinAbout , CComponentData , CDropObject , CComponent , CClassFactory , CSnapinAbout , CAccount , CComponentData , CSnapinAbout , CComponentData , CSnapinAbout , CSimpleDoc , CProvider_IWbemEventProvider , CSimpSvrDoc , CSimpleSite , CClassFactory , CComponent , CProvider_IWbemUnboundObjectSink , CComponentData , CDataObject , CSnapinAbout , CClassFactory , CSimpleSite , CDataObject , CClassFactory , CObject , CClassFactory , CSimpleApp , CSimpleClass , CComponent , CComponentData , CConsumer , CDataObject , CComponent , CImpIFileViewer , CComponent , CSimpleObject , CSnapinAbout , CExtendContextMenuEx , CComponent , CTestCOMPerformance , CClassFactory , CSecureObject , CCustomPropertyStore , CDataObject , CFactory , CSnapinAbout , CClassFactory , CSimpSvrApp , CComponentData , CSnapinAbout , AgentNotifySink , CClassFactory , CDataObject , CComponentData , CUrlmonCallback , CProvFactory , CSimpleObject , CDataObject , CSnapinAbout , CSimpleObject , CClassFactory , CSnapinAbout , CStorageBuffer , CDataObject , CImpIOleDocumentSite , CComponent , CDataObject , CComponent , CDataObject , CImpIOleClientSite , CClassFactory , CImpIAdviseSink , CSnapinAbout , CSimpleObject , CPropPro , CComponent , CSnapinAbout , CDataXferObj , CSnapinAbout , CClassFactory , CComponentData , CImpIOleDocumentSite , CClassFactory , CImpIAdviseSink , CEnumFormatEtc , CPersistFile , COleInPlaceObject , COleDocument , COleDocumentView , CSnapinAbout , CDataObject , CProvFactory , CPersistStorage , CAccount , CImpIOleClientSite , CSnapinAbout , CImpIAdviseSink , CComponentData , CMallocSpy , CDataObject , CClassFactory , CMethodPro , CClassFactory , CISeqStream , CMethodPro , CShellIconOverlayID , CSettings , CConsumer , CUrlmonCallback , CDataObject , CEmptyVolumeCache , CRefresher , CClassFactory , CHiPerfProvider , CSnapinAbout , CComponent , CComponentData , CMyEventProvider , CComponentData , CProviderFactory , CFactory , CProviderFactory , CDataObject , CProvider_IWbemServices , CClassFactory , CSimpleApp , CObject , CComponentData , CMarkTextService , CSnapinAbout , CFileViewer , CClassFactory , CDataObject , CSnapinAbout , CComponent , CClassFactory , CEnumDisplayAttributeInfo , CHiPerfProvider , CDataObject , CObject , CSimpleSite , CComponent , CSnapinAbout , CFrame , CExtendPropertySheet , CComponent , CDeskBand , CClassFactory , CDataObject , CComponent , CSnapinAbout , CProvFactory , CMallocSpy , CSnapinAbout , CProvFactory , CComponent , CInstPro , CClassFactory , CSimpleSite , COleObject , AgentNotifySink , COleInPlaceActiveObject , COleDocument , COleInPlaceActiveObject , CPersistFile , CDataObject , CComponentData , CDataObject , CExtendPropertySheet , CClassFactory , CPersistStorage , CComponentData , CCaseTextService , CClassFactory , MyDataSource , CDataObject , MyOSPObject , CGenericEnum , CTSFDataObject , MyClassFactory , CMallocSpy , CComponent , CMallocSpy , CComponentData , CMallocSpy , CComponent , CStream , CPropSheetExtension , CRowset , CClassFactory , CDBSession , CShellExtClassFactory , CCommand , CClassFactory , CBinder , CDataObject , CMallocSpy , CComponent , CMallocSpy , CDataObject , CMallocSpy , CEnumTASK , CStorageBuffer , CComponent , CListener , CClassFactory , CDropSource , CClassFactory , CAggregate , CSnapinAbout , CImpIFileViewer , CUpdateReceipt , CSimpSvrObj , CClassFactory , CSimpSvrApp , CDataObject , CDataXferObj , CEnumFormatEtc , CClassFactory , CComponentData , CSimpleDoc , CSnapinAbout , CFactory , CComponent , CSamplePipe , CMyEventProvider , CClassFactory , CEmptyVolumeCache , CClassFactory , CComponentData , CObject , CComponentData , CClassFactory , CSyncMgrHandler , CEnumFormatEtc , CComponentData , CClassFactory , CStream , CSimpleObject , CClassFactory , CComponent , CTestCOMPerformance , CSite , CImpIOleInPlaceSite , CClassFactory , CImpIAdviseSink , CComponentData , CExplorerBar , CClassFactory , CSimpleObject , CComponentData , CImpIAdviseSink , CSimpleObject , CToolBand , CClassFactory , CComponentData , CComponent , CExplorerBar , CComponent , AgentNotifySink , CComponentData , AgentNotifySink , CClassFactory , CComponent , CProvFactory , CClassFactory , CDataObject , CSecureObject , CComponent , CClassFactory , CDataObject , CSnapinAbout , CFVClassFactory , CDataObject , CFVClassFactory , CSimpleApp , CMarkTextService , CComponentData , CClassFactory , CImpIPersistFile , CComponent , CSimpSvrDoc , CEditSessionBase , CImpIPersistFile , CComponentData , CClassFactory , CDataObject , CDropTarget , CComponentData , CDataObject , CSnapinAbout , CClassFactory , CComponent , CMallocSpy , CClassFactory , CRow , CComponent , CEditSessionBase , CComponent , CDropSource , CMallocSpy , CLangBarItemButton , CDataObject , CComponentData , CComponent , CSnapinAbout , CClassFactory , CContextMenuExtension , CShellExtClassFactory , CClassFactory , CComponentData , CClassFactory , CGenericEnum , CShellExt , CClassFactory
  • stop() : Hello3J
  • Stop() : IBrowserHost
  • stop() : HelloJ
  • Stop() : CBrowserHost , IBrowserHost , CTIMER , IBrowserHost , CBrowserHost
  • stop() : Hello2J
  • Stop() : RqsEngine , CAgentCtlCharacterEx , IBrowserHost , CBrowserHost , CPlgFilter , CBrowserHost
  • stop() : RSProxy
  • StopAll() : CAgentCtlCharacterEx
  • StopAnimation() : CWrapVBComponent , CMMCControl , IMMCControl
  • StopAsyncFindIfStarted() : CGenericUCPDlg
  • StopButton_click() : CapJ
  • StopRefreshing() : CHiPerfProvider
  • StopRouter()
: comadmin::COMAdminCatalog
, comadmin::ICOMAdminCatalog
  • StopStream() : CSampleMSPStream
  • StopThread() : CAdvClientDlg , CBackgroundFolder , CBicycleFolder
  • stopTransfer() : MyOSPObject
  • StoreBuffer() : WiaWrap::CDataCallback
  • StoreInProxy() : CRow
  • StreamViewerProc() : CMainWindow
  • String() : CFileViewer
  • StringToLine() : Util::HelperFunctions
  • StripEndQuotes() : VJQuery
  • StrName() : CObjData
  • Stroke() : InkCollectorEvents , CMyInkEvents
  • StylusButtonDown()
: RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkCollection::InkCollection
  • StylusButtonUp()
: RealTimeStylusPlugins::CustomDynamicRendererPlugin
, InkCollection::InkCollection
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • StylusDown()
: RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • StylusInRange()
: RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, InkCollection::InkCollection
, RealTimeStylusPlugins::PacketFilterPlugin
  • StylusOutOfRange()
: RealTimeStylusPlugins::CustomDynamicRendererPlugin
, InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::PacketFilterPlugin
  • StylusUp()
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::PacketFilterPlugin
  • SubClassWindow() : CWndLite
  • subscribePersisButton_click() : NewsSubscriber
  • subscribeTransButton_click() : NewsSubscriber
  • SubstituteParameters() : CUtil
  • Sum() : CFullServ , fullsvr::IFullServ , fullsvr::FullServ
  • SupportIRowsetChange() : CRowset
  • Supports()
: msado15::Recordset
, msado15::_Recordset
, msado15::Recordset21
, msado15::Recordset20
, msado15::Recordset15
  • Suspend() : AgentNotifySink
  • SwapShort() : CFontRange
  • SwapULong() : CFontRange
  • SwitchToNextHtmlElement() : CHtmlElement
  • SyncDirs() : CSyncMgrHandler
  • Synchronize() : CSyncMgrHandler
  • SynchronizeCall() : CSyncMgrHandler
  • SynchronizeCompleted() : CCallbackWrapper
  • SyncSendStatusAndHeaders() : ISAPI_REQUEST
  • SyncWriteClientArgs() : ISAPI_REQUEST
  • SyncWriteClientString() : ISAPI_REQUEST
  • SyncWriteCompleteResponse() : ISAPI_REQUEST
  • SystemGesture()
: InkCollectorEvents
, RealTimeStylusPlugins::PacketFilterPlugin
, InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- t -

  • TabletAdded()
: InkCollectorEvents
, InkCollection::InkCollection
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
  • TabletRemoved()
: RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPlugins::PacketFilterPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkCollectorEvents
, InkCollection::InkCollection
  • TagNameToToken() : CHtmlScanner
  • TargetDown() : CComSpySqlAudit , CLBSub , IComSpyAudit
  • TargetUp() : CLBSub , IComSpyAudit , CComSpySqlAudit
  • TaskNotify() : CComponent , CDelegationBase , CBicycleFolder , CSkateboardFolder , CIceSkateFolder
  • TempBuffer() : TempBuffer
  • Terminate() : CDownloadUI
  • Test1() : ITest , CServer , CTestCOMPerformance
  • Test2() : ITest , CServer
  • Test23() : CTestCOMPerformance
  • TestCancel()
: fullsvr::AsyncFullServ
, fullsvr::ICancelMethodCalls
  • TestTokenConfirm() : CAppletSession
  • Text() : CCanvas
  • TextAlign() : CCanvas
  • textChars_KeyPress() : CSharp_Draw::Form1
  • textFriendComputer_TextChanged() : CSharp_Draw::Form1
  • textFriendName_TextChanged() : CSharp_Draw::Form1
  • Think() : CAgentCtlCharacterEx
  • ThreadEntry() : CSampleDataSource
  • ThreadExecutionFunction() : CProvider_IWbemEventProvider
  • ThreadFunction() : CWorkerThread
  • threadParam() : CAsyncTest::threadParam
  • ThreadProc() : WiaWrap::CProgressDlg , CBackgroundFolder , CBicycleFolder , CAdvClientDlg , CAsyncTest
  • ThreadStart() : CMain
  • ToColumn() : storesh::Storesh
  • ToggleEditControl() : CConnectDlg
  • ToggleRemoteServerState() : CAppInstallDlg
  • ToggleStatus() : CDeviceNode , CStaticNode , CDeviceNode , CStaticNode , CDeviceNode , CStaticNode
  • TokenConfirm() : CAppletSession
  • TokenIndication() : CAppletSession
  • Tokenize() : CSampleWordBreaker
  • ToString() : RealTimeStylusPluginApp::PluginListItem
  • TPhysConnectRequest() : CNullModem
  • TPhysDisconnect() : CNullModem
  • TPhysInitialize() : CNullModem
  • TPhysTerminate() : CNullModem
  • TPropBase() : TPropBase< TYPE >
  • TPropSetBase() : TPropSetBase< TYPE, OBJTYPE >
  • Trace() : RqsEngine , CGrid
  • TraceAddRef() : CIntTrace
  • TraceCurrentServerConnections() : RqsEngine
  • TraceMethod() : CIntTrace
  • TraceNotification() : CIntTrace
  • TraceQI() : CIntTrace
  • TraceRelease() : CIntTrace
  • TraceSelf() : RqsConfig , RqsEngine
  • TranslateAccelerator() : COleInPlaceActiveObject , CShellView , CPropertyPage , CFrame , CAnnotator
  • TranslateAcceleratorIO() : CExplorerBar , CToolBand , CDeskBand , CCommBand
  • TranslatePathNameToFormatName() : CMainFrame
  • TryToSaveChanges() : CVCExploreDlg
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- u -

  • UIActivate() : COleDocumentView , CShellView
  • UIActivateIO() : CDeskBand , CExplorerBar , CCommBand , CToolBand
  • UIDeactivate() : COleInPlaceObject
  • ULONG() : _ADOCollectionVtbl , ErrorsVtbl , _ParameterVtbl , ErrorsVtbl , ParametersVtbl , _ADOCollectionVtbl , _CommandVtbl , PropertyVtbl , _CommandVtbl , PropertiesVtbl , _ADODynaCollectionVtbl , _ConnectionVtbl , IHelloWorldVtbl , _ConnectionVtbl , IHelloWorldVtbl , _ADODynaCollectionVtbl , ADOConnectionConstructionVtbl , IADsErrorVtbl , ADOConnectionConstructionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOVtbl , _RecordsetVtbl , IUPnPService_DimmingService_SCPDVtbl , _RecordsetVtbl , IMMCControlVtbl , _ADOVtbl , ADORecordsetConstructionVtbl , IAppletSessionNotifyVtbl , ADORecordsetConstructionVtbl , IAppletSessionVtbl , ErrorVtbl , FieldVtbl , IAppletNotifyVtbl , FieldVtbl , IAppletVtbl , ErrorVtbl , FieldsVtbl
  • Unaccess() : CSAFEARRAY
  • Unadvise() : CListener , CRTCEvents , UPNPDimmerService , CDimmerService
  • UnAdvise() : CApplet , CAppletSession
  • Unadvise() : CConnectionPoint , COleObject
  • UnadviseInkCollector() : InkCollectorEvents
  • UnadviseListener() : CContainerBase
  • UnadviseSink() : CTSFEditWnd , CLangBarItemButton
  • Unbind() : CBSTR , CVARIANT , CSAFEARRAY , CBSTR , CVARIANT , CSAFEARRAY
  • Undo16() : CDialogStream
  • UndoChanges() : CMDIChild
  • Unescape() : ISAPI_STRING
  • UnGetChar() : CMemoryMappedInputStream , CSerialStream
  • UnhandledMessage() : CWndLite , CMDIChildLite , CMDIFrameLite
  • UnimpersonateClient() : ISAPI_REQUEST
  • Uninitialize() : CAsynchBase , CImpIDBInitialize , Conf , CPluggableTransport , CCompartmentMonitor
  • Uninstall() : CSysLCESub , ICOMSysLCE
  • uninstallCascadeEvent() : NewsSubscriber
  • Unload() : CAgentCtlCharacters
  • UnloadOleObject() : CSimpleSite
  • UnLock() : CLockHandler
  • Unlock() : CExeModule , CDBAuthPlugin , CExeModule
  • UnlockBuffer() : CString
  • UnlockRegion() : CSimpleObject , CStorageBuffer , CFileStream , CImpIStream
  • UnmanagedArrayFree() : Sample::MySignedXml
  • Unmap() : CMmStream , PMmStream
  • UnmarshalInterface() : CDynamic , CClassFactoryWrapper , CEntity , CResultset
  • Unregister() : CMallocSpy
  • UnregisterAll() : CFactory
  • UnRegisterFunction() : CacheProxySamplePlugin::CacheProxyPlugin
  • UnregisterProfiles() : CCaseTextService , CMarkTextService
  • UnregisterServer() : CCmdLineConsumerApp , CPermEventsApp , CCaseTextService , CMarkTextService
  • UnregisterSink() : CPlgTermSample
  • UnselectTerminal() : CSampleMSPStream
  • Update() : CRow , CProgress , COleObject , CSite , CDlgDest , vcacct::IUpdateReceipt , msado15::Recordset21 , CUpdateReceipt , msado15::Fields , CUpdateReceipt , msado15::Recordset15 , msado15::Recordset20 , vcacct::CUpdateReceipt , msado15::Recordset , CFont , msado15::_Recordset
  • UpdateApplicationMode() : InkErase::InkErase
  • UpdateBatch()
: msado15::_Recordset
, msado15::Recordset15
, msado15::Recordset21
, msado15::Recordset20
, msado15::Recordset
  • UpdateBuddyList() : CRTCWin
  • UpdateChanges() : CMDIChild
  • updateCollections() : NewsFlash
  • UpdateControls() : CMainWindow , CMDIObjects , CMDITrace , CMDIChild
  • UpdateCounters() : CMain
  • UpdateData() : CShellView
  • UpdateDialogs() : CChildView
  • UpdateEditMode() : PaperForm::PaperForm
  • UpdateFilename() : CMultiRecoApp
  • UpdateFont() : CRecoOutputWnd
  • UpdateInputScopeMenu() : CAdvRecoApp
  • UpdateInstance() : CSampleDataSource
  • UpdateLayout() : CAdvRecoApp , CMultiRecoApp
  • UpdateMenu() : COleDocumentView , CShellView
  • UpdateMenuRadioItems() : CAdvRecoApp
  • UpdateObjectRects() : CSite
  • UpdateOptions() : CFullConnectOptions
  • UpdatePathNameArrays() : CMainFrame
  • UpdateProperties() : CFullConnectProperties
  • UpdateProvider() : CFullConnectProvider
  • UpdateRecentFiles() : CCapMFCDlg , CapJ , MainDlg
  • UpdateRegistryCLSID() : CSCPWizModule , CMyWizExtModule , CMyUIExtModule , CSCPContextMenuModule , CMyUIExtModule
  • UpdateRow() : CFileIO
  • UpdateRowImmediate() : CDBFile
  • UpdateScrollBars() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • UpdateSecurity() : CFullConnectSecurity
  • UpdateStatus() : CBankDlg
  • UpdateStatusBar() : CAdvRecoApp , CMultiRecoApp
  • UpdateString() : CRecoOutputWnd
  • updateSubscription() : NewsSubscriber
  • UpdateTable() : CacheProxySamplePlugin::CacheProxyPlugin
  • UpdateToolbar() : CShellView
  • UpdateUI() : CMain
  • UpdateWindow() : CWndLite
  • UpdateWndTitle() : CMDIChild
  • UpdateZoomAndScroll() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • Upload() : CPack
  • UPNPDimmerDevice() : UPNPDimmerDevice
  • UPNPDimmerService() : UPNPDimmerService
  • Usage() : VJQuery
  • UseBalloon_click() : CapJ
  • UseComPlus() : CMoveMoney
  • UseRecognizer() : CAdvRecoApp
  • UseSfx_click() : CapJ
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- v -

  • ValidateAccessor() : CDataAccess
  • ValidateBindArgs() : CImpIBindResource
  • ValidateBookmark() : IRowsetScrollImpl< T, RowsetInterface >
  • ValidateRow() : CRowset
  • ValueToString() : CConsumer
  • VarToBstr() : CADVCGENDlg
  • VerifyDatabaseCodepage() : CImportRes , CGenerateRC
  • VerifyRequest() : CCertPolicySample
  • VerifySidMembership() : CDBAuthPlugin
  • VerifyUser() : IDBAuthAdmin , CDBAuthAdmin
  • VerifyUserMembership() : CDBAuthPlugin
  • VerifyXML() : Sample::SignVerify
  • ViewportResize() : CFileViewer
  • ViewportScrollSet() : CFileViewer
  • ViewWndProc() : COleDocumentView
  • VisibleState() : AgentNotifySink , Notify , AgentNotifySink , Notify
  • VOID() : _WORK_THREAD_DATA
  • VScroll() : CController
  • vScrollBar_Scroll() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • vScrollBar_ValueChanged() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • Vsprintf() : ISAPI_STRING , ISAPI_STRINGW
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- w -

  • Wait() : CAsyncXXX< T, ISyncFace, IAsyncFace > , CCallBack , fullsvr::ISynchronize , RqsEngine , fullsvr::AsyncFullServ , CAgentCtlCharacterEx , CAsynchNotify
  • WaitCursor() : CWaitCursor
  • WaitForConnection() : CNullModem
  • waitForInput() : storesh::Storesh
  • waitForResponse() : RSProxy
  • WasLanguagePreviouslyFound() : CImportRes
  • WasteTime() : CSimpleObject
  • WhoAmI() : CVCSecuritySampleClass
  • WillChangeField()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • WillChangeRecord()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • WillChangeRecordset()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • WillConnect()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • WillExecute()
: msado15::ConnectionEvents
, msado15::ConnectionEventsVt
  • WillMove()
: msado15::RecordsetEvents
, msado15::RecordsetEventsVt
  • Window() : IComSpy , CFrame
  • WindowProc() : CDlgDest , CDlgSrc , CBitmapWnd , CMainWindow , CRTCIncomingDlg , CRTCOutgoingDlg , CRTCAVSession , CRTCIMSession , CRTCWin , CBackgroundFolder , CBicycleFolder , CChildView
  • WndProc() : CWndLite , CCommBand , CDeskBand , CExplorerBar , CToolBand , CShellView
  • Work() : CFullServ
  • WPUCloseEvent() : DTHandler
  • WPUCloseSocketHandle() : DTHandler
  • WPUCreateEvent() : DTHandler
  • WPUCreateSocketHandle() : DTHandler
  • WPUFDIsSet() : DTHandler
  • WPUGetProviderPath() : DTHandler
  • WPUModifyIFSHandle() : DTHandler
  • WPUPostMessage() : DTHandler
  • WPUQueryBlockingCallback() : DTHandler
  • WPUQuerySocketHandleContext() : DTHandler
  • WPUQueueApc() : DTHandler
  • WPUResetEvent() : DTHandler
  • WPUSetEvent() : DTHandler
  • WrapDSOandSession()
: msado15::ADOConnectionConstruction
, msado15::ADOConnectionConstruction15
  • Write() : CComSpy , CSimpleObject , CLogFile , msado15::_Stream , msado15::Stream , CConsole , CRichEditLite , CFileLite , CSmartPtrTrace< T > , CStorageBuffer , CFileStream , CImpIStream , CISeqStream , CSampleDataContainer , CThumbNailPhotoHolder , CAVIFileWriter
  • WriteAt() : CStorageBuffer
  • WriteBinaries() : CGenerateRC
  • WriteBuffer() : CStorageBuffer
  • WriteBytes() : CFileLite , CStream
  • WriteContextInformation() : CContextPlugin
  • WriteControlToRC() : CGenerateRC
  • WriteData() : CSCPWiz , CWizExtUser
  • WriteDataHelper() : CSCPWiz , CExtPageUser , CWizExtUser
  • WriteDB() : qcnotify::Notify
  • WriteDialogToRC() : CGenerateRC
  • WriteEmployeeID() : CProppageUserUI
  • WriteFormat() : CFileLite
  • WriteItemSettings() : CSettings
  • WriteLine() : CConsole , CSmartPtrTrace< T >
  • WriteOrderDB() : qcorder::Order , COrder
  • WritePlaylist() : CSDKSamplePlaylistParser
  • WriteQuoted() : CFileLite
  • WriteRadioButtons() : CGenerateRC
  • WriteShipDB() : qcship::Ship , COShip , COShip2
  • WriteStdWinCtrl() : CGenerateRC
  • WriteString() : CStream
  • WriteText()
: msado15::Stream
, msado15::_Stream
  • WriteToStream() : CFastVariant
  • WriteWCharAsUTF8() : CPack
  • WriteWin32Ctrl() : CGenerateRC
  • WriteXMLString() : CPack
  • WSAAccept() : DTHandler
  • WSAAddressToStringA() : DTHandler
  • WSAAddressToStringW() : DTHandler
  • WSAAsyncGetHostByAddr() : DTHandler
  • WSAAsyncGetHostByName() : DTHandler
  • WSAAsyncGetProtoByName() : DTHandler
  • WSAAsyncGetProtoByNumber() : DTHandler
  • WSAAsyncGetServByName() : DTHandler
  • WSAAsyncGetServByPort() : DTHandler
  • WSAAsyncSelect() : DTHandler
  • WSACancelAsyncRequest() : DTHandler
  • WSACancelBlockingCall() : DTHandler
  • WSACleanup() : DTHandler , SocketMonitor
  • WSACloseEvent() : DTHandler
  • WSAConnect() : DTHandler
  • WSACreateEvent() : DTHandler
  • WSADuplicateSocketA() : DTHandler
  • WSADuplicateSocketW() : DTHandler
  • WSAEnumNameSpaceProvidersA() : DTHandler
  • WSAEnumNameSpaceProvidersW() : DTHandler
  • WSAEnumNetworkEvents() : DTHandler
  • WSAEnumProtocolsA() : DTHandler
  • WSAEnumProtocolsW() : DTHandler
  • WSAEventSelect() : DTHandler
  • WSAGetLastError() : DTHandler
  • WSAGetOverlappedResult() : DTHandler
  • WSAGetQOSByName() : DTHandler
  • WSAGetServiceClassInfoA() : DTHandler
  • WSAGetServiceClassInfoW() : DTHandler
  • WSAGetServiceClassNameByClassIdA() : DTHandler
  • WSAGetServiceClassNameByClassIdW() : DTHandler
  • WSAHtonl() : DTHandler
  • WSAHtons() : DTHandler
  • WSAInstallServiceClassA() : DTHandler
  • WSAInstallServiceClassW() : DTHandler
  • WSAIoctl() : DTHandler
  • WSAIsBlocking() : DTHandler
  • WSAJoinLeaf() : DTHandler
  • WSALookupServiceBeginA() : DTHandler
  • WSALookupServiceBeginW() : DTHandler
  • WSALookupServiceEnd() : DTHandler
  • WSALookupServiceNextA() : DTHandler
  • WSALookupServiceNextW() : DTHandler
  • WSANtohl() : DTHandler
  • WSANtohs() : DTHandler
  • WSARecv() : DTHandler
  • WSARecvDisconnect() : DTHandler
  • WSARecvFrom() : DTHandler
  • WSARemoveServiceClass() : DTHandler
  • WSAResetEvent() : DTHandler
  • WSASend() : DTHandler
  • WSASendDisconnect() : DTHandler
  • WSASendTo() : DTHandler
  • WSASetBlockingHook() : DTHandler
  • WSASetEvent() : DTHandler
  • WSASetLastError() : DTHandler
  • WSASetServiceA() : DTHandler
  • WSASetServiceW() : DTHandler
  • WSASocketA() : DTHandler
  • WSASocketW() : DTHandler
  • WSAStartup() : DTHandler , SocketMonitor
  • WSAStringToAddressA() : DTHandler
  • WSAStringToAddressW() : DTHandler
  • WSAUnhookBlockingHook() : DTHandler
  • WSAWaitForMultipleEvents() : DTHandler
  • WSCDeinstallProvider() : DTHandler
  • WSCEnableNSProvider() : DTHandler
  • WSCEnumProtocols() : DTHandler
  • WSCGetProviderPath() : DTHandler
  • WSCInstallNameSpace() : DTHandler
  • WSCInstallProvider() : DTHandler
  • WSCUnInstallNameSpace() : DTHandler
  • WSPAccept() : DTHandler
  • WSPAddressToString() : DTHandler
  • WSPAsyncSelect() : DTHandler
  • WSPBind() : DTHandler
  • WSPCancelBlockingCall() : DTHandler
  • WSPCleanup() : DTHandler
  • WSPCloseSocket() : DTHandler
  • WSPConnect() : DTHandler
  • WSPDuplicateSocket() : DTHandler
  • WSPEnumNetworkEvents() : DTHandler
  • WSPEventSelect() : DTHandler
  • WSPGetOverlappedResult() : DTHandler
  • WSPGetPeerName() : DTHandler
  • WSPGetQOSByName() : DTHandler
  • WSPGetSockName() : DTHandler
  • WSPGetSockOpt() : DTHandler
  • WSPIoctl() : DTHandler
  • WSPJoinLeaf() : DTHandler
  • WSPListen() : DTHandler
  • WSPRecv() : DTHandler
  • WSPRecvDisconnect() : DTHandler
  • WSPRecvFrom() : DTHandler
  • WSPSelect() : DTHandler
  • WSPSend() : DTHandler
  • WSPSendDisconnect() : DTHandler
  • WSPSendTo() : DTHandler
  • WSPSetSockOpt() : DTHandler
  • WSPShutdown() : DTHandler
  • WSPSocket() : DTHandler
  • WSPStartup() : DTHandler
  • WSPStringToAddress() : DTHandler
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • z
  • ~

- x -

  • XBStr() : XBStr
  • XInterface() : XInterface< T >
  • XPtr() : XPtr< T >
  • XWindow() : XWindow
  • xZoomUpDown_ValueChanged() : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
Generated on Wed Nov 13 2024 16:55:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Properties

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • b
  • c
  • d
  • h
  • i
  • n
  • p
  • t

- a -

  • ActiveColor : AutoClaims::InkLayer
  • ActiveInk : AutoClaims::InkLayer
  • ArchiveQuotaPerStream : CachePluginAdmin , IWMSCacheAdmin , CachePluginAdmin

- b -

  • BackendServer : IWMSCacheAdmin , CachePluginAdmin

- c -

  • CacheDirectoryPath : IWMSCacheAdmin , CachePluginAdmin
  • CacheOnDemandCacheMiss : IWMSCacheAdmin , CachePluginAdmin
  • CategoryValue : UDDI::Tools::CategoryTreeNode
  • Connection : UDDI::Tools::CategoryTreeView

- d -

  • DataInterest
: InkCollection::InkCollection
, RealTimeStylusPlugins::CustomDynamicRendererPlugin
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, RealTimeStylusPlugins::PacketFilterPlugin
  • DiskQuota : CachePluginAdmin

- h -

  • HasDownloadedChildren : UDDI::Tools::CategoryTreeNode
  • Hidden : AutoClaims::InkLayer

- i -

  • InkData : InkBlog::InkArea
  • InkEnabled : InkBlog::InkArea
  • IsSchemeNode : UDDI::Tools::CategoryTreeNode

- n -

  • NamedValues : CachePluginAdmin

- p -

  • PreferredProtocol : IWMSCacheAdmin , CachePluginAdmin
  • ProxyOnDemandCacheMiss : IWMSCacheAdmin , CachePluginAdmin
  • ProxyRedirectURL : CachePluginAdmin , IWMSCacheAdmin , CachePluginAdmin

- t -

  • TextData : InkBlog::InkArea
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Related Functions

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • a
  • c
  • d
  • f
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • v
  • w

- a -

  • AbortProc : CPrintAux
  • AgentNotifySink : MainDlg
  • ASYNC_REQUESTER : SIMPLE_BROWSER

- c -

  • CClassFactory : CSimpSvrApp
  • CCommand : CImpIAccessor
  • CComponent : CComponentData
  • CContextMenu : CShellFolder , CShellView
  • CDataObject : CShellFolder , COleDocument , CSimpSvrObj
  • CDBSession : CDataSource
  • CDropTarget : CShellFolder
  • CExternalConnection : CSimpSvrObj
  • CFactory : CUnknown
  • CImpIAccessor : CImpIAccessor , CCommand , CRowset
  • CImpIBindResource : CBinder , CDBSession
  • CImpIColumnsInfo : CCommand , CRow , CRowset
  • CImpICommandProperties : CCommand
  • CImpICommandText : CCommand
  • CImpIConvertType : CCommand , CRow , CRowset
  • CImpICreateCommand : CDBSession
  • CImpICreateRow : CBinder
  • CImpIDataSource : CDBSession
  • CImpIDBBinderProperties : CBinder
  • CImpIDBCreateSession : CDataSource
  • CImpIDBInfo : CDataSource
  • CImpIDBInitialize : CDataSource
  • CImpIDBProperties : CDataSource
  • CImpIFileViewer : CFileViewer
  • CImpIGetDataSource : CDBSession
  • CImpIGetRow : CRowset
  • CImpIGetSession : CRow , CRowset
  • CImpIGetSourceRow : CStream
  • CImpIOpenRowset : CDBSession
  • CImpIPersist : CDataSource
  • CImpIPersistFile : CFileViewer
  • CImpIRow : CRow , CRowset
  • CImpIRowChange : CRow , CRowset
  • CImpIRowset : CRowset
  • CImpIRowsetChange : CRowset
  • CImpIRowsetIdentity : CRowset
  • CImpIRowsetInfo : CRowset
  • CImpIServiceProvider : CDataSource
  • CImpISessionProperties : CDBSession
  • CImpIStream : CStream
  • ClientWndProc : CFrame
  • CMmStreamBuf : CMmStream
  • COleDocument : COleDocumentView
  • COleDocumentView : COleDocument
  • COleInPlaceActiveObject : COleDocumentView , COleDocument , CSimpSvrObj
  • COleInPlaceObject : CSimpSvrObj , COleDocument
  • COleObject : CSimpSvrObj , COleDocument
  • ColorHookProc : COleDocument
  • ConfigureDlgProc : CSettings
  • CPersistFile : CPersistStorage
  • CPersistStorage : CSimpSvrObj , COleDocument
  • CPlgPin : CPlgFilter
  • CPrintCanvas : CPrintRequest
  • CPrintRequest : CPrintAux
  • CRow : CRowset
  • CRowset : CImpIAccessor
  • CRTCWin : CRTCSession , CRTCAVSession
  • CSampleDirectory : CSampleDirectoryInfo
  • CShellFolder : CShellView
  • CShellView : CShellFolder
  • CSmpFilterCF : CSmpFilter
  • CStream : CRow
  • CSurrogate : CClassFactoryWrapper
  • CTextGrid : CFontRange
  • CUnknown::Quit : CFactory
  • CWizExtUser : CExtPageUser

- d -

  • DlgProc : AboutDlg
  • DllGetClassObject : CSmpFilterCF , CLanguageResourceSampleCF , CHtmlIFilterCF , HtmlPropIFilterCF

- f -

  • FileViewerFrameProc : CFileViewer
  • FrameWndProc : CFrame

- h -

  • HandlerThreadWndProc : CSyncMgrHandler
  • HtmlPropIFilterCF : HtmlPropIFilter

- i -

  • IAsyncFace : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • ItemConfigDlgProc : CSettings

- l -

  • ListBoxWndProc : MainDlg

- m -

  • MoveXWndProc : MainDlg
  • MoveYWndProc : MainDlg

- n -

  • NIDeque_c< T > : NILNode_c< T >
  • NIDequeIter_c< T > : NIDeque_c< T > , NILNode_c< T >

- o -

  • operator+ : CString

- p -

  • PrintDlgProc : CPrintAux

- r -

  • RequesterStatusCallback : ASYNC_REQUESTER

- s -

  • SIMPLE_BROWSER : ASYNC_REQUESTER
  • SpeakTextWndProc : MainDlg

- v -

  • ViewportWndProc : CFileViewer

- w -

  • WndProc : MainDlg
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Typedefs

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _OmniProvBaseClass : CMSOmniProvRowset
  • CHAR_PIPE_TYPE : FileRepServer
  • CHAR_TYPE : FileRepServer
  • enumNameType : CCertEncodeAltName
  • LISTNODE : ClientList
  • LPTEST : ITest
  • SESSION_OPERATION : CRTCIncomingDlg , CRTCOutgoingDlg
  • STR : FileRepClient , FileRepServer , FileRepClient , FileRepServer , FileRepClient , FileRepServer , FileRepClient , FileRepServer
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- _ -

  • _aBagEntry : CHtmlElementBag
  • _achDisplayPropertyText : CMarkTextService
  • _achDisplayText : CMarkTextService
  • _achText : CSnoopWnd
  • _aHashTable : CSpecialCharHashTable
  • _Alias : CBox
  • _apBlock : CPage
  • _aptBlock : CPage
  • _aTempBuffer : CHtmlElement
  • _atomWndClass : CSnoopWnd
  • _awc : CResString
  • _awcName : HtmlPropIFilter
  • _awcReadAheadBuf : CSerialStream
  • _awcTranslatedBuffer : CMemoryMappedInputStream
  • _awszPropSpec : CScriptTag , CMetaTag
  • _Block : CBox
  • _buf : CMmStreamBuf
  • _Buffer : ISAPI_STRING , ISAPI_STRINGW
  • _bUserAbort : CPrintAux
  • _bxf : CBox
  • _bytesReadFromMMBuffer : CMemoryMappedInputStream
  • _c_DefaultDisplayAttribute : CDisplayAttributeInfo
  • _canvas : CFontSelect , CBlackPen , CBrush
  • _categories : WsdlDiscovery::frmMain
  • _categorizationLabel : WsdlDiscovery::frmMain
  • _categoryValue : UDDI::Tools::CategoryTreeNode
  • _cAttributes : CHtmlIFilter
  • _cb : CMmStreamBuf
  • _cbBuffer : ISAPI_BUFFER
  • _cbData : ISAPI_BUFFER
  • _cBlock : CPage
  • _cbMaxToken : _AUTH_SEQ
  • _cCharsReadAhead : CSerialStream
  • _cchText : CSnoopWnd
  • _cCol : CGridIt , CGrid , CBlockFrame
  • _cDigits : CCodeGrid
  • _Char : CCharBlock
  • _charsReadFromTranslatedBuffer : CMemoryMappedInputStream
  • _cHrefChars : CAnchorTag
  • _cHrefCharsFiltered : CAnchorTag
  • _cLowResource : CAsynchNotify
  • _clsidMetaInfo : CMetaTag
  • _clsidScriptInfo : CScriptTag
  • _Code : CCharBlock
  • _Cols : CBlockFrame
  • _connection : Microsoft::Uddi::Demo::Publish , UDDI::Tools::CategoryTreeView
  • _cPropChars : CPropertyTag
  • _cPropCharsFiltered : CPropertyTag
  • _cRef : CAsynchNotify , _CSampleDropExt , CCaseTextService , CEditSessionBase , CLangBarItemButton , CEnumDisplayAttributeInfo , CMarkTextService , CCustomPropertyStore
  • _cRefs : _tagGENERICITEMLIST , CSampleWordBreaker , CSampleStemmer
  • _cRow : CGridIt , CGrid , CBlockFrame
  • _csInit : ISAPI_EXTENSION
  • _cTagCharsRead : CHtmlScanner
  • _cTextChars : CTextElement
  • _ctm : _CSampleDropExt
  • _currFilter : storesh::Storesh
  • _currStoreLocation : storesh::Storesh
  • _currStoreName : storesh::Storesh
  • _cValueChars : CImageTag , CInputTag , CMetaTag
  • _cValueCharsFiltered : CImageTag , CInputTag
  • _cwcMaxToken : CSampleWordBreaker
  • _cwcTranslatedBuffer : CMemoryMappedInputStream
  • _cx : CGridIt
  • _cy : CGridIt
  • _dbgInfo : CException
  • _descriptionLabel : WsdlDiscovery::frmMain
  • _dispatchTable : DTHandler
  • _dwFundsAvailable : _FundsRM
  • _dwGlobalCompartmentEventSinkCookie : CMarkTextService
  • _dwIISMajorVersion : ISAPI_REQUEST
  • _dwIISMinorVersion : ISAPI_REQUEST
  • _dwMaxAlloc : ISAPI_BUFFER
  • _dwMaxSyncWriteSize : ISAPI_REQUEST
  • _dwOsMajorVersion : ISAPI_REQUEST
  • _dwState : CCustomPropertyStore
  • _dwTextEditSinkCookie : CCaseTextService , CMarkTextService
  • _dwThreadFocusSinkCookie : CCaseTextService , CMarkTextService
  • _dwThreadMgrEventSinkCookie : CCaseTextService , CMarkTextService
  • _eState : CAnchorTag , CMetaTag , CPropertyTag , CScriptTag
  • _eTokenType : CToken
  • _eTokType : CHtmlElemBagEntry , CPropertyTag
  • _eTokTypeNext : CTextElement
  • _extensionLabel : WsdlDiscovery::frmMain
  • _extensionUrl : WsdlDiscovery::frmMain
  • _fC1Mask : CCTypeSet
  • _fC2Test : CCTypeSet
  • _fC3Mask : CCTypeSet
  • _fCleaningUp : CMarkTextService
  • _fClientIsConnected : ISAPI_REQUEST
  • _fDel : CFont
  • _fFilterContent : CHtmlIFilter
  • _fFilterMetaTag : CHtmlIFilter
  • _fFilterScriptTag : CHtmlIFilter
  • _fFirstHitInitDone : ISAPI_EXTENSION
  • _fFlipKeys : CCaseTextService
  • _fHaveCredHandle : _AUTH_SEQ
  • _fHaveCtxtHandle : _AUTH_SEQ
  • _fInitialized : ISAPI_EXTENSION
  • _fMetaProperty : HtmlPropIFilter
  • _fNeedDoneWithSession : ISAPI_REQUEST
  • _fNewConversation : _AUTH_SEQ
  • _fNoMoreText : CTextElement
  • _fNonHtmlFile : CHtmlIFilter
  • _font : CTextField , CTextGrid
  • _fontAlias : CBoxFormat
  • _fontBlock : CBox
  • _fontChar : CBlockFormat
  • _fontCode : CBlockFormat
  • _fontCtype : CBoxFormat
  • _fontHeader : CFrameFormat , CBlockFrame
  • _fontLabel : CFrameFormat
  • _fontPageNum : CPageFormat
  • _fPageMode : CModel
  • _fPageUsed : CFontRange
  • _fr : CModel
  • _fShowSnoop : CCaseTextService
  • _fStartToken : CToken
  • _fuFormat : CBox , CBlockFormat , CPageFormat
  • _funAbout : CController
  • _fUnGotChar : CMemoryMappedInputStream , CSerialStream
  • _funProp : CController
  • _fUUEncodeData : _AUTH_SEQ
  • _fWrite : CMmStream
  • _gaDisplayAttribute : CMarkTextService
  • _groupBox1 : WsdlDiscovery::frmMain
  • _groupBox2 : WsdlDiscovery::frmMain
  • _groupBox3 : WsdlDiscovery::frmMain
  • _guidPropset : CToken
  • _guidPropSet : CFullPropSpec
  • _h : XWindow
  • _hasDownloadedChildren : UDDI::Tools::CategoryTreeNode
  • _hBrush : CBrush
  • _hBrushOld : CBrush
  • _hcred : _AUTH_SEQ
  • _hctxt : _AUTH_SEQ
  • _hdc : CCanvas , CPrintRequest
  • _hDevNames : CPrintRequest
  • _hDlgPrint : CPrintAux
  • _HeaderBuffer : ISAPI_REQUEST
  • _hEvent : CAsynchNotify
  • _hFile : CMmStream
  • _hfont : CFont
  • _hfontOld : CFontSelect
  • _hImpersonationToken : ISAPI_REQUEST
  • _hInst : CController , CPage , CModel
  • _hKey : CRegAccess
  • _hkeyProgID : _CSampleDropExt
  • _hMap : CMmStream
  • _hPen : CBlackPen
  • _hPenOld : CBlackPen
  • _hRM : _FundsRM
  • _htmlElementBag : CHtmlIFilter
  • _htmlIFilter : CHtmlElement , CHtmlScanner
  • _hwnd : CWindow , CScreenCanvas , CPaintCanvas , CPrintRequest
  • _hWnd : CSnoopWnd
  • _hWorkerWnd : CMarkTextService
  • _iChar : CBox
  • _iCol : CGridIt
  • _idChunk : CTextElement
  • _iEltOffset : CTextGrid
  • _iIndex : CEnumDisplayAttributeInfo
  • _InlineData : ISAPI_BUFFER
  • _inquireLabel : WsdlDiscovery::frmMain
  • _inquireUrl : WsdlDiscovery::frmMain
  • _iPage : CCTypeSet , CModel
  • _iRow : CGridIt
  • _iScale : CView
  • _iStyle : CLineGrid
  • _lError : CException
  • _libName : APIHook< T >
  • _Line : CCharBlock
  • _liOffset : CMmStreamConsecBuf
  • _List : ASYNC_REQUESTER
  • _loadSchemes : WsdlDiscovery::frmMain
  • _locale : CHtmlIFilter
  • _lRefs : CLanguageResourceSampleCF , HtmlPropIFilter , HtmlPropIFilterCF
  • _macPage : CModel
  • _mmInputStream : CSerialStream
  • _mmStream : CMemoryMappedInputStream
  • _mmStreamBuf : CMemoryMappedInputStream
  • _nFromPage : CPrintRequest
  • _nHScrollPos : CScrollableView
  • _nToPage : CPrintRequest
  • _nVScrollPos : CScrollableView
  • _nWeight : CLineGrid
  • _oCurrStore : storesh::Storesh
  • _okToReloadSchemes : WsdlDiscovery::frmMain
  • _p : XInterface< T > , XPtr< T > , XBStr
  • _PageHeadL : CPage
  • _PageHeadR : CPage
  • _PageNums : CPage
  • _paint : CPaintCanvas
  • _pAttributes : CHtmlIFilter
  • _pBox : CController
  • _pCase : CLangBarItemButton , CSnoopWnd
  • _pCharInSet : CCTypeSet
  • _pCharUsed : CTextGrid
  • _pComposition : CMarkTextService
  • _pContext : CEditSessionBase
  • _pCurChar : CSerialStream
  • _pData : ISAPI_BUFFER
  • _pdtobj : _CSampleDropExt
  • _pEcb : ISAPI_REQUEST
  • _pf : CModel , CPage
  • _pfnCreateInstance : CClassFactory
  • _pfnInit : ISAPI_EXTENSION
  • _pHashEntryNext : CSpecialCharHashEntry
  • _pHtmlElement : CHtmlIFilter , CHtmlElemBagEntry
  • _pHtmlFilter : HtmlPropIFilter
  • _pLangBarItem : CCaseTextService , CMarkTextService
  • _pLangBarItemSink : CLangBarItemButton
  • _pMark : CLangBarItemButton , CKeystrokeEditSession , CPropertyEditSession , CTerminateCompositionEditSession , CCompositionEditSession
  • _pMmStream : CMmStreamConsecBuf
  • _pModel : CPrintRequest , CController
  • _pPage : CModel
  • _pPageInSet : CCTypeSet
  • _pPersistFile : HtmlPropIFilter
  • _pRange : CUpdateTextEditSession
  • _preAPI : APIHook< T >
  • _propid : CToken
  • _propSpec : CPropertyTag
  • _providerLabel : WsdlDiscovery::frmMain
  • _providerName : WsdlDiscovery::frmMain
  • _pRows : CBlockFrame
  • _pSnoopWnd : CUpdateTextEditSession , CCaseTextService
  • _psProperty : CFullPropSpec
  • _pStream : CMmStreamBuf , SMmStream
  • _pt : CGridIt , CPageFormat
  • _ptClient : CView
  • _pTextEditSinkContext : CMarkTextService , CCaseTextService
  • _pThreadMgr : CMarkTextService , CCaseTextService
  • _ptOrg : CView , CTextGrid
  • _ptPE : CPageFormat
  • _ptScroll : CView
  • _pView : CPrintRequest , CController
  • _pwcHrefBuf : CAnchorTag
  • _pwcPropBuf : CPropertyTag
  • _pwcTagBuf : CHtmlScanner
  • _pwcValueBuf : CImageTag , CInputTag , CMetaTag
  • _pwszFileName : CHtmlIFilter
  • _rclsid : CClassFactory
  • _ResponseBuffer : ISAPI_REQUEST
  • _results : WsdlDiscovery::frmMain
  • _resultsLabel : WsdlDiscovery::frmMain
  • _rValue : APIHook< T >
  • _scanner : CHtmlElement
  • _SD : _FundsRM
  • _searchCategorization : WsdlDiscovery::frmMain
  • _searchProvider : WsdlDiscovery::frmMain
  • _searchService : WsdlDiscovery::frmMain
  • _serialStream : CHtmlElement , CHtmlIFilter , CHtmlScanner
  • _serviceLabel : WsdlDiscovery::frmMain
  • _serviceName : WsdlDiscovery::frmMain
  • _size : CView , CGrid , CBlockFrame , CBlockFormat , CGridIt
  • _sizeBox : CBox
  • _sizeHigh : CMmStream
  • _sizeLow : CMmStream
  • _specialCharHash : CSerialStream
  • _status : CPrintRequest
  • _StatusBuffer : ISAPI_REQUEST
  • _strModuleName : ISAPI_EXTENSION
  • _strModulePath : ISAPI_EXTENSION
  • _sxi : _CSampleDropExt
  • _sz : CTextField
  • _szAlloc : CQuickStringWrap
  • _szFormat : CCodeGrid
  • _szHeader : CBlockFrame
  • _szTargetFolder : _CSampleDropExt
  • _tfClientId : CCaseTextService , CMarkTextService
  • _tfLangBarItemInfo : CLangBarItemButton
  • _uCurSize : CHtmlElementBag
  • _ulCallback : CPropertyEditSession
  • _ulChunkID : CHtmlIFilter
  • _ulCodePage : CMemoryMappedInputStream
  • _uLenHrefBuf : CAnchorTag
  • _uLenPropBuf : CPropertyTag
  • _uLenTagBuf : CHtmlScanner
  • _ulIdContentChunk : CPropertyTag
  • _uMaxSize : CHtmlElementBag
  • _uRefs : CHtmlIFilterBase , CHtmlIFilterCF
  • _wch : CMemoryMappedInputStream , CSerialStream , CSpecialCharHashEntry
  • _wcsPath : CRegAccess
  • _wcsPathBuf : CRegAccess
  • _wParam : CKeystrokeEditSession
  • _wszName : CSpecialCharHashEntry
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- j -

  • JobId : _Job
  • JobType : _JOB_INFO
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- k -

  • key : treeitem , APMFILEHEADER
  • keyInfoBox : Sample::UI::MainWindow
  • kpszCharacterWindowTitle : CapJ
  • kpszOptionsWindowTitle : CapJ
  • kpszRecentFilesItem : CapJ
  • kpszRecentFilesSubkey : CapJ
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- l -

  • l : UnionInt64 , _ParameterVtbl
  • label1 : CSharp_Draw::InputBox
  • labelSign : Sample::UI::MainWindow
  • LabelType : STL_LABEL
  • labelVerify : Sample::UI::MainWindow
  • LabelVersion : STL_LABEL
  • LassoPercent : InkClipboard::InkClipboard
  • lassoPoints : InkClipboard::InkClipboard
  • last : section , filebuffer
  • lastDrawnLassoDot : InkClipboard::InkClipboard
  • LastModified : CacheProxySamplePlugin::ContentInfo
  • lastMouseDownEventArgs : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • LastName : Serialization::SerializationForm
  • LastNameBox : Serialization::SerializationForm
  • LastNameLabel : Serialization::SerializationForm
  • LastSize : PickleControlBlock
  • lAttr : _ConnectionVtbl
  • lAttributes : PropertyVtbl
  • LayeredEntries : _LSP_ENTRY
  • LayeredGuidCount : _LSP_ENTRY
  • LayeredGuids : _LSP_ENTRY
  • LayeredProvider : _PROVIDER
  • LayeredSocket : _SOCK_INFO
  • lblDSConnection : CSharp_Draw::Form1
  • lblInstructions : AutoClaims::AutoClaims
  • lblInsuredName : AutoClaims::AutoClaims
  • lblMake : AutoClaims::AutoClaims
  • lblModel : AutoClaims::AutoClaims
  • lblPluginList : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • lblPolicyNumber : AutoClaims::AutoClaims
  • lblRemoteComputer : CSharp_Draw::Form1
  • lblRemoteQueue : CSharp_Draw::Form1
  • lblTitle : AutoClaims::AutoClaims
  • lblVehicleDamage : AutoClaims::AutoClaims
  • lblVehicleDescription : AutoClaims::AutoClaims
  • lblYear : AutoClaims::AutoClaims
  • lblZoom : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • lChapter : ADORecordsetConstructionVtbl
  • lcid : _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , _ADOCollectionVtbl , PropertyVtbl , PropertiesVtbl , _ADOCollectionVtbl , PropertiesVtbl , _ADOCollectionVtbl , IHelloWorldVtbl , _ADODynaCollectionVtbl , IHelloWorldVtbl , IADsErrorVtbl , _ADODynaCollectionVtbl , IADsErrorVtbl , _ADODynaCollectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADOVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , _ADOVtbl , IMMCControlVtbl , _ADOVtbl , SLangRegistry , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl
  • lCmdType : _CommandVtbl
  • lContextHint : ContextNameHint
  • lCursorLoc : _ConnectionVtbl , _RecordsetVtbl
  • lCursorType : _RecordsetVtbl
  • lDOSDttm : _DOSDTTM
  • left : compitem , complist , Margin , treeitem , RECTI
  • leftbase : section
  • leftBottomHandle : InkClipboard::InkClipboard
  • leftCenterHandle : InkClipboard::InkClipboard
  • leftTopHandle : InkClipboard::InkClipboard
  • leIndexSortedList : _NETWORK_ENTRY
  • leIndexSortedListLink : _INTERFACE_ENTRY
  • leInterfaceTableLink : _INTERFACE_ENTRY
  • leLink : _DYNAMIC_READWRITE_LOCK
  • lenflags : tpc_hdr
  • Length : FieldVtbl , CacheProxySamplePlugin::INSSBufferImpl , _UNICODE_STRING
  • length : treeitem , FieldInfo , gss_OID_desc_struct , gss_buffer_desc_struct
  • lError : NONDIALTOKENS
  • Level : _ConnectionVtbl , _MOF_INFO , _ConnectionVtbl
  • lExpiration : CacheProxySamplePlugin::ContentInfo
  • lf : FONTENUM , tagArFonts , _PREF
  • lHeight : CPerson , CPlane , CRocket
  • LibraryPathA : _PROVIDER
  • LibraryPathW : _PROVIDER
  • line : viewline
  • LineHandle : _JOB_INFO
  • linenr : fileline
  • linepos : LineData
  • lines : CSharp_Draw::Form1 , filedata
  • link : fileline , section
  • List : _WORK_QUEUE_ITEM
  • ListBoxSize : GLOBAL_STRUCT
  • listEntry : _AIO_WORK_ITEM
  • ListEntry : _USER_INFO
  • ListError : LIST_STRUCT
  • listopts : THREADARGS
  • lItem : _NAMEMAP , _WIDENAMEMAP
  • live : WRTHANDLE
  • llFreeLocksList : _DYNAMIC_LOCKS_STORE
  • lLockType : _RecordsetVtbl
  • lMaxRecords : _RecordsetVtbl
  • lMode : _ConnectionVtbl
  • lNotifyHandle : _PROPSHEETCFG
  • LocalFileName : tReq , tSReq
  • LocalMachine : storesh::Storesh
  • localname : diritem
  • LocalTime : _INITDATA
  • Lock : tReq
  • lock : _LOCKED_LIST
  • Lock : tSReq
  • LockType : _RecordsetVtbl
  • LogErrorMsg : _tagMETHODARGS
  • LogFont : PROFILE_STRUCT
  • LogonDomainName : _MSV1_0_INTERACTIVE_LOGON
  • LONG : CImpIAdviseSink
  • longVal : _tagPROPSTRUCT
  • loopCount : _ClientContext
  • lParam : GBMSG
  • lParmAttribs : _ParameterVtbl
  • lParmDirection : _ParameterVtbl
  • lPayload : CRocket , CPlane
  • lpBack : tagINTERFACEIMPL
  • lpbAlloc : tag_seq
  • lpBuffer : REQUEST_CONTEXT
  • lpBuffers : _SENDTOARGS , _RECVARGS , _SENDARGS , _RECVFROMARGS
  • lpButtonText : TEXTBUTTON_STRUCT
  • lpbyBuf : _tagLISTPROP , _tagPOSTKEY
  • lpByte : _THUMB
  • lpCallerCompletionRoutine : _WSAOVERLAPPEDPLUS
  • lpCallerOverlapped : _WSAOVERLAPPEDPLUS
  • lpcErrorText : _tagLOGERRORMSG
  • lpContext : _FFSTREAM
  • lpCriticalSection : Queue
  • lpDataBuffer : HTTP_REQUESTCB_PARAM
  • lpfnAcceptEx : _EXT_WSPPROC_TABLE
  • lpfnCI : CDefClassFactory
  • lpfnConnectEx : _EXT_WSPPROC_TABLE
  • lpfnDisconnectEx : _EXT_WSPPROC_TABLE
  • lpfnGetAcceptExSockaddrs : _EXT_WSPPROC_TABLE
  • lpfnTransmitFile : _EXT_WSPPROC_TABLE
  • lpfnTransmitPackets : _EXT_WSPPROC_TABLE
  • lpfnWSARecvMsg : _EXT_WSPPROC_TABLE
  • lpFrom : _RECVFROMARGS
  • lpFromLen : _RECVFROMARGS
  • lpmhFree : tag_seq
  • lpmhPreroll : tag_seq
  • lpMsg : _WSARECVMSGARGS
  • lpOutputBuffer : _ACCEPTEXARGS
  • lpPacketArray : _TRANSMITPACKETSARGS
  • lpPoints : tagSEG
  • lpSendBuffer : _CONNECTEXARGS
  • LPSTGMEDIUM : CImpIAdviseSink
  • lpstrFileName : DEB_PROCESS_NODE_INFO_STRUCT , DEB_STARTUP_INFO_STRUCT , DEB_DLL_NODE_INFO_STRUCT
  • lpstrPathName : DEB_STARTUP_INFO_STRUCT , DEB_DLL_NODE_INFO_STRUCT , DEB_PROCESS_NODE_INFO_STRUCT
  • lpstzName : _THUMB
  • lpSyncLogError : _tagLOGERRORMSG
  • lpSyncProgressItem : _tagPROGRESSMSG
  • lpsz : _tagCol , COL , tagLABELEXTRACT
  • lpszData : REGSTRUCT , _REGSTRUCT
  • lpszSubKey : REGSTRUCT , _REGSTRUCT
  • lpszValueName : DOREGSTRUCT , REGSTRUCT , _REGSTRUCT
  • lpTransmitBuffers : _TRANSMITFILEARGS
  • lpvInBuffer : _IOCTLARGS
  • lpvMapView : _FileInfo
  • lpvOutBuffer : _IOCTLARGS
  • lpVtbl : tagOleStdEnumFmtEtc , CMallocSpy , tagOleStdEnumStatData , tagINTERFACEIMPL
  • lpWSPStartup : _PROVIDER
  • lpwszConnection : _tagESTABLISHCONNECTIONMSG
  • lqEventQueue : _CONFIGURATION_ENTRY
  • lResult : _FUNC_INFO
  • lSpeed : CPerson
  • LspOrder : _LSP_ENTRY
  • lstAnnotationLayer : AutoClaims::AutoClaims
  • lstrObjectID : tagAppletObjectKey
  • lTimeout : _ConnectionVtbl
  • lVal : VTUNION
  • lValue : InstDef
  • lWeight : CPerson , CRocket , CPlane
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- m -

  • m_acePtrList : CDlgIADsSecurityDescriptor
  • m_aCounter : CSampleInstance
  • m_acpEnd : CTSFEditWnd
  • m_acpStart : CTSFEditWnd
  • m_ActionInArgument : CGenericUCPDlg
  • m_ActionName : CGenericUCPDlg
  • m_ActionOutArgument : CGenericUCPDlg
  • m_ActiveSelEnd : CTSFEditWnd
  • m_ActualGraphState : CSampleMSPStream
  • m_AddButton : CMultiValuedAttributeEditor
  • m_addEquipment : CAdvClientDlg
  • m_AdminPathNameCB : CSendMessageDialog
  • m_Adviselimit : CConnectionPoint
  • m_AdviseSink : CSimpleSite , CTSFEditWnd
  • m_Agent : CCapMFCDlg
  • m_AgentEx : HelloJ , Hello2J , Notify , Hello3J
  • m_aInstance : CSampleDataSource
  • m_aKey : CStaticMap
  • m_alHandle : CSampleDataSource
  • m_Animations : CCapMFCDlg
  • m_AnimationsLabel : CCapMFCDlg
  • m_apEnumerator : CRefresher
  • m_aPidls : CContextMenu , CDataObject
  • m_apIMembers : CConfNotify
  • m_apInstances : CRefresher
  • m_apInstMap : CRefresher
  • m_apMembers : CAppletSession
  • m_Applet : Notify
  • m_apstrCDPRevocationURL : CCertPolicySample
  • m_apstrDisableExtensions : CCertPolicySample
  • m_apstrEnableRequestExtensions : CCertPolicySample
  • m_apstrIssuerCertURL : CCertPolicySample
  • m_apwszDisableExtensions : CCertPolicySample
  • m_apwszEnableEnrolleeRequestExtensions : CCertPolicySample
  • m_apwszEnableRequestExtensions : CCertPolicySample
  • m_arrWorkerThreads : ISAPITHREAD
  • m_astrDevType : CGenericUCPDlg
  • m_astrSubjectAltNameObjectId : CCertPolicySample
  • m_astrSubjectAltNameProp : CCertPolicySample
  • m_AsyncFind : CGenericUCPDlg
  • m_aT : CSimpleArray< T >
  • m_Authenticated : CSendMessageDialog
  • m_aValue : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeCRLDistInfo
  • m_backgroundHwnd : CBackgroundFolder
  • m_bAddedCommands : MainDlg
  • m_bAllMSGestures : CAdvRecoApp
  • m_BalloonAutoHide : CCapMFCDlg
  • m_BalloonAutoPace : CCapMFCDlg
  • m_BalloonEnabled : CCapMFCDlg
  • m_BalloonSizeToText : CCapMFCDlg
  • m_bAllSSGestures : CAdvRecoApp
  • m_bAnimating : CMMCControl
  • m_BaseObjectType : CBaseObj
  • m_bAsynch : CDlgIDirectorySearch
  • m_bAtlBrowserHelp : CBrowserHost
  • m_bAttrib : CDlgIDirectorySearch
  • m_bAudit : CComSpy
  • m_bAutoAnswer : CRTCIncomingDlg
  • m_bBackPressed : CBasePropertyPage
  • m_bBMP : WiaWrap::CDataCallback
  • m_bButton10Down : CBrowserHost
  • m_bButton2Down : CBrowserHost
  • m_bButton3Down : CBrowserHost
  • m_bButton4Down : CBrowserHost
  • m_bButton5Down : CBrowserHost
  • m_bButton6Down : CBrowserHost
  • m_bButton7Down : CBrowserHost
  • m_bButton8Down : CBrowserHost
  • m_bButton9Down : CBrowserHost
  • m_bCacheResult : CDlgIDirectorySearch
  • m_bCancelled : WiaWrap::CProgressDlg
  • m_bChangesArePending : CVCExploreDlg
  • m_bClearAll : CPropertiesDlg
  • m_bClearText : CDlgIADsOpenDSObject
  • m_bClosed : CDBFile
  • m_bCoerceInputScope : CAdvRecoApp
  • m_bConstructed : CAccount , CUpdateReceipt , CPooledData
  • m_bCSV : CComSpy
  • m_bDirty : CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords
  • m_bDisplayWaitCursor : CMainWindow
  • m_bDoDetach : CBasePropertyPage
  • m_bEnableCtxMenus : CBrowserHost
  • m_bEnableFilter : CDlgIDirectorySearch
  • m_bEncrypt : CDlgIADsOpenDSObject
  • m_bEOF : CFileLite
  • m_bFastBind : CDlgIADsOpenDSObject
  • m_bFocus : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • m_bHasMRUSeparator : MainDlg , CCapMFCDlg
  • m_bInCall : Conf
  • m_bInConnection : CPluggableTransport
  • m_Bindings : CParameters , CDataAccess
  • m_bInPlaceActive : CSpyCon , CBrowserHost
  • m_bIsChecked : CBrowserHost
  • m_bIsTaskpadPreferred : CComponent
  • m_bKnownSafeContext : CPlgTermSample
  • m_bLogToFile : CComSpy
  • m_blue : CSimpSvrObj
  • m_bmk : CRow
  • m_bNeedCreate : CSCPPageGeneral
  • m_bNewGesture : CRecoOutputWnd
  • m_bNoAuthentication : CDlgIADsOpenDSObject
  • m_bObjectPooled : CAccount , CUpdateReceipt , CPooledData
  • m_bOnlineStatus : CDeviceNode
  • m_bOverwriteFiles : CAppExportDlg , CAppInstallDlg
  • m_bPriority : CSendMessageDialog
  • m_bPrompt : CDlgIADsOpenDSObject
  • m_bReadOnly : CDlgIADsOpenDSObject
  • m_bReadyForDelete : CAppInfo
  • m_bRegisteredForConnectionNotification : RqsEngine
  • m_bRemoteInstall : CAppInstallDlg
  • m_bRequiresSave : CDynamic , CEntity , CLine , CPoint
  • m_bRetrieved : CRow
  • m_bSaved : CBasePropertyPage
  • m_bSaveOnExit : CSpyCon
  • m_bSchemaRowset : CDataAccess
  • m_bSealing : CDlgIADsOpenDSObject
  • m_bSecured : CDlgIADsOpenDSObject
  • m_bSelected : CBackgroundFolder
  • m_bShouldEnlist : CAccount , CUpdateReceipt , CPooledData
  • m_bShowGridLines : CComSpy
  • m_bShowOnScreen : CComSpy
  • m_bSigning : CDlgIADsOpenDSObject
  • m_bSnapOn : CSnap
  • m_bStop : CMain
  • m_bstr : CUtilBSTR , BSTRING
  • m_bstrBootDevice : CEnumStorageResource
  • m_bstrBootLogicalDisk : CEnumStorageResource
  • m_bstrCAName : CCertPolicySample
  • m_bstrCASanitizedDSName : CCertPolicySample
  • m_bstrCASanitizedName : CCertPolicySample
  • m_bstrConn : CUtil
  • m_bstrCrashDumpLogicalDisk : CEnumStorageResource
  • m_bstrCurRecoName : CAdvRecoApp , CMultiRecoApp
  • m_bstrDatasource : CUtil
  • m_bstrDescription : CCertExitSample , CCertPolicySample , CPartitionInfo , CStorageResource
  • m_bstrDeviceID : CStorageResource
  • m_bstrDiskDeviceID : CPartitionInfo
  • m_bstrDisplayName : CMgdClusCfgInit
  • m_bstrDllName : CMgdClusCfgInit
  • m_bstrFileName : CCrmFilesTest
  • m_bstrFriendlyName : CStorageResource
  • m_bstrHost : CProxyPlugin::COpState
  • m_bstrIniFile : CUtil
  • m_bstrMachineDNSName : CCertPolicySample
  • m_bstrMyProperty : CPower , CSimple
  • m_bstrName : CPartitionInfo , CStorageResource
  • m_bstrNodeName : CMgdClusCfgInit
  • m_bstrOriginUrl : CProxyPlugin::COpState
  • m_bstrOrigOutputPath : CContextSamplePropPage
  • m_bstrOutputPath : CContextPlugin , CContextSamplePropPage
  • m_bstrPath : CProxyPlugin::COpState
  • m_bstrProtocol : CProxyPlugin::COpState
  • m_bstrResTypeName : CMgdClusCfgInit
  • m_bstrResults : CRecoOutputWnd
  • m_bstrSectionConn : CUtil
  • m_bstrSectionName : CUtil
  • m_bstrSectionUserlist : CUtil
  • m_bstrSql : CUtil
  • m_bstrSqlSection : CUtil
  • m_bstrSystemDevice : CEnumStorageResource
  • m_bstrSystemLogicalDisk : CEnumStorageResource
  • m_bstrSystemWMIDeviceID : CEnumStorageResource
  • m_bstrTipUrl : CEnlistTransaction
  • m_bstrUID : CPartitionInfo
  • m_bstrUsername : CAuthenticateContext
  • m_bTaskpadView : CComponent
  • m_btnAddParty : CRTCOutgoingDlg
  • m_btnAddQueue : CDisdrawDlg
  • m_btnAnswer : CRTCIncomingDlg
  • m_btnAppSharing : CRTCOutgoingDlg
  • m_btnAttach : CDisdrawDlg , CImp_DrawDlg
  • m_btnConnect : CRTCOutgoingDlg
  • m_btnDisconnect : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_btnPcPc : CRTCOutgoingDlg
  • m_btnPcPh : CRTCOutgoingDlg
  • m_btnPhPh : CRTCOutgoingDlg
  • m_btnRemoveParty : CRTCOutgoingDlg
  • m_btnSetProperty : CVCExploreDlg
  • m_btnTune : CRTCOutgoingDlg
  • m_bTopmost : CSpyCon
  • m_bUnblocking : tagOLESTDMESSAGEFILTER
  • m_bUnicode : CFileLite
  • m_bUnicodeMsg : CWndLite
  • m_bUseComPlus : CMoveMoney
  • m_bUsePing : CClientDlg
  • m_bUsingDefaultCharacter : Hello2J
  • m_butClose : CDlgSrc
  • m_butPlay : CDlgDest , CDlgSrc
  • m_butStop : CDlgDest , CDlgSrc
  • m_bViewUpdated : CBackgroundFolder
  • m_bwIP : CFrame
  • m_bWizard : CExtObject
  • m_CAccessor : COptionsSheet
  • m_cACEList : CDlgIADsSecurityDescriptor
  • m_cADsPath : CADQIDlg
  • m_CADsSearchScope : CDlgIDirectorySearch
  • m_cADsType : CDlgIADsPropertyList
  • m_callInProgress : CAsyncFullServ
  • m_cAllocations : CMallocSpy
  • m_cAllocCalls : CDbAlloc
  • m_CancelButton : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_CAPathLength : CCertPolicySample
  • m_cAttributes : CDlgIDirectoryObject
  • m_cAttrList : CDlgIADs , CDlgIDirectorySearch
  • m_CAType : CCertPolicySample
  • m_cAveBitsPerSec : CDlgDest
  • m_cAxis : CDataset
  • m_cb : CAddrNode
  • m_cBad : CClientDlg
  • m_cbAlloc : CExtBuffer
  • m_cbBufferSize : CClusPropValueList , CClusPropList
  • m_cbBufSize : RecvBuf
  • m_cbData : CDlgDest , CDlgSrc
  • m_cbDataLeft : CClusPropValueList , CClusPropList
  • m_cbDataSize : CClusPropValueList , CClusPropList
  • m_cbhCurrentProp : CClusPropList
  • m_cbhCurrentPropName : CClusPropList
  • m_cbhCurrentValue : CClusPropValueList
  • m_cbHeapUsed : CFileIO
  • m_cbhPropList : CClusPropList
  • m_cbhValueList : CClusPropValueList
  • m_cbItem : CExtBuffer
  • m_cBits : CCertEncodeBitString
  • m_cboApplications : CCompImportDlg , CCompInstallDlg
  • m_cbPage : CBitArray
  • m_CBParam : CUrlmonCallback
  • m_cbRead : CFileLite
  • m_cbRequest : CMallocSpy
  • m_cbRequested : CMallocSpy
  • m_cbReserved : CExtBuffer
  • m_cbRowSize : CRow , CParameters , CDataAccess , CFileIO , CRow , CRowset
  • m_cbTotalRowSize : CRowset
  • m_cBufSize : CISeqStream
  • m_cbWritten : CFileLite
  • m_cCACert : CCertExitSample
  • m_cCacheResult : CDlgIDirectorySearch
  • m_cCDPRevocationURL : CCertPolicySample
  • m_cChannelMask : CDlgDest
  • m_cChannels : CChildView , CDlgDest
  • m_cChaseReferrals : CDlgIDirectorySearch
  • m_cChildList : CDlgIADsContainer
  • m_cchildren : CSpaceVehicle
  • m_cChildSpaceStations : CSpaceStation
  • m_cchOldLength : CTSFEditWnd
  • m_cchRangeDelimiter : CUrlmonCallback
  • m_cColAccess : CRow
  • m_cCols : CDBFile , CMSOmniProvRowset , CRowset
  • m_cColumns : CFileIO , CTable , MyOSPObject , CInkInputWnd
  • m_CComboInterface : CInterfaceDlg
  • m_CComboReserved : CMultipleResultsDlg
  • m_CCommand : COptionsSheet
  • m_cCompositions : CTSFEditWnd
  • m_cComputerInput : CDisdrawDlg , CImp_DrawDlg
  • m_cComputerLabel : CDisdrawDlg , CImp_DrawDlg
  • m_cConnectionMode : CDisdrawDlg
  • m_cContinueButton : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_cCP : CConnectionPointContainer
  • m_cCRLPublishRetryCount : CCertExitSample
  • m_cd : CBankDlg
  • m_cDataCount : CDataObject
  • m_CDataSource : COptionsSheet
  • m_CDefPropSets : CMDIChild
  • m_cDisableExtensions : CCertPolicySample
  • m_cDiskCount : CEnumStorageResource
  • m_cDsFrame : CDisdrawDlg , CImp_DrawDlg
  • m_cElements : CVector< TYPE, IDX >
  • m_cELT : CEnumXXX< T, ELT_T, IFACE >
  • m_cEnableEnrolleeRequestExtensions : CCertPolicySample
  • m_cEnableFilter : CDlgIDirectorySearch
  • m_cEnableRequestExtensions : CCertPolicySample
  • m_cEnumInfo : CEnumerator
  • m_CError : COptionsSheet
  • m_CertType : CCertPolicySample
  • m_cEvents : CComSpy
  • m_cExecute : CDlgIDirectorySearch
  • m_cExtraCols : CRow
  • m_cfDsDisplaySpecOptions : CSCPCMenuDialog
  • m_cfDSDispSpecOptions : CPropSheetHost
  • m_cfDSObjectNames : CPropSheetHost
  • m_cfDsObjectNames : CSCPCMenuDialog
  • m_cfDSPropSheetConfig : CPropSheetHost
  • m_cfe : CEnumFormatEtc
  • m_cfEmbedSource : CDataObject , CEnumFormatEtc
  • m_cFilter : CDlgIDirectorySearch
  • m_cFormatEtc : CDataObject
  • m_cfPrivateData : CContextMenu , CDataObject , CDropTarget
  • m_cFriendFrame : CDisdrawDlg
  • m_cfShellIDList : CDataObject
  • m_cGood : CClientDlg
  • m_cGuidMaps : CComboBoxGuid
  • m_Character : HelloJ , Hello2J , Notify
  • m_CharacterID : HelloJ , Hello2J
  • m_CharacterPathOld : HelloJ , Hello2J
  • m_cHiddenColumns : CColumnInfo
  • m_children : CBackgroundFolder , CBicycleFolder
  • m_chkAutoAnswer : CRTCIncomingDlg
  • m_cIMembers : CConfNotify
  • m_cIndent : UsageStringInfo
  • m_cIndexes : CTable
  • m_cInput : CDlgSrc
  • m_cIssuerCertURL : CCertPolicySample
  • m_cItem : CExtBuffer , COBLIST
  • m_cItems : CSids , CEnumFormatEtc
  • m_cLastIniString : CUtil
  • m_cLines : CImp_DrawDlg
  • m_cListIf : CADQIDlg
  • m_cListView : CDlgIDirectorySearch
  • m_CloseApp : CGenericUCPDlg
  • m_clsctxAccount : CMoveMoney
  • m_ClsId : CFactory
  • m_clsID : CFileViewer
  • m_clsid : CClassFactoryWrapper , CClassFactory , CPropertyPage
  • m_clsidObject : CClassFactory
  • m_clsReg : CCmdLineConsumerApp , CPermEventsApp
  • m_cMaxSize : CStorageBuffer , CStream
  • m_cMembers : CAppletSession
  • m_cMessageFrame : CDisdrawDlg , CImp_DrawDlg
  • m_cMessages : CStatusHelper
  • m_cNest : CSafeRefCount
  • m_CNotify : COptionsSheet
  • m_cobj : CExtObject
  • m_cOffset : CGenericEnum
  • m_cOK : CADQIDlg
  • m_ColDesc : CAlterColumnDlg
  • m_Color : COleDocument
  • m_ColumnInfo : CDataAccess
  • m_comboBindingTypes : COptionsAccessor
  • m_comboBitDepth : CDlgDest
  • m_comboConfig : CFullConnectProvider
  • m_comboConstraintType : CConstraintDlg
  • m_comboDBType : CAlterColumnDlg
  • m_comboDeleteRule : CConstraintDlg
  • m_comboFormat : CDlgDest
  • m_comboMatchType : CConstraintDlg
  • m_comboOptions : CPropertiesDlg
  • m_comboPropSet : CPropertiesDlg
  • m_comboProvider : CFullConnectProvider
  • m_comboSampleRate : CDlgDest
  • m_comboSchema : CSchemaDlg
  • m_comboSpeaker : CDlgSrc
  • m_comboType : CPropertiesDlg
  • m_comboTypeName : CAlterColumnDlg
  • m_comboUpdateRule : CConstraintDlg
  • m_comboValue : CPropertiesDlg
  • m_CommandID : Hello2J , Notify
  • m_Commands : Hello2J
  • m_CommandType : CCrmFilesCompensator
  • m_ComputerName : CProvider_IWbemServices
  • m_Config : RqsEngine
  • m_connect : CAdvClientDlg
  • m_connectHwnd : CBicycleFolder
  • m_ContactInfo_Object : CProvider_IWbemServices
  • m_ContentLength : ASYNC_REQUESTER
  • m_context : CDataObject
  • m_cookie : CConnectionPointContainer , CConnectionPoint
  • m_CookieList : CDataObject
  • m_COptions : CFullConnect
  • m_CoreService : CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_cot : CObjData
  • m_cOutput : CDlgDest
  • m_cPageCurrent : CBitArray
  • m_cPageMax : CBitArray
  • m_cPartitions : CStorageResource
  • m_cPopups : CStatusHelper
  • m_CProperties : CFullConnect
  • m_cPropInfoSets : CPropertiesDlg
  • m_CPropSets : CFullConnect , CSchemaDlg , CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg
  • m_CProvider : CFullConnect
  • m_cProviderInfo : CDataSource
  • m_cProvTypes : CSession
  • m_cQueueFrame : CDisdrawDlg
  • m_cQueueInput : CDisdrawDlg , CImp_DrawDlg
  • m_cQueueLabel : CDisdrawDlg , CImp_DrawDlg
  • m_cRadioDS : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_cRadioExpress : CDisdrawDlg , CImp_DrawDlg
  • m_cRadioPrivate : CDisdrawDlg
  • m_cRadioPublic : CDisdrawDlg
  • m_cRadioRecoverable : CDisdrawDlg , CImp_DrawDlg
  • m_cRadioWorkgroup : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_crColor : CSecureObject
  • m_cRef : CBinder , CClassFactory , CCommand , CDataSource , CImpISpecifyPropertyPages , CPropertyPage , CDBSession , CRow , CRowset , CStream , CISeqStream , MyClassFactory , MyDataSource , MyOSPObject , CBitmapWnd , WiaWrap::CDataCallback , WiaWrap::CEventCallback , CMainWindow , WiaWrap::CProgressDlg , CWiaDataCallback , CProxyPlugin::COpState , CSampleDataContainer , CSampleDirectory , CGenericEnum , CSyncMgrHandler , CCallbackWrapper , CObjSecurity , CSnapinAbout , CComponent , CComponentData , CDataObject , CExtendContextMenuEx , CEnumFormatEtc , CExtendPropertySheet , CClassPro , CProvFactory , CConsumer , CProviderFactory , CProvider , CMyEventProvider , CInstPro , CMethodPro , CPropPro , CMySink , RefCount , CRefCount , CPartitionInfo , CFVClassFactory , CFileViewer , CShellExtClassFactory , CShellExt
  • m_cref : CSnapinAbout , CClassFactory , CComponent , CComponentData , CDataObject , CContextMenuExtension , CPropSheetExtension , CEnumTASK , CToolBarExtension
  • m_cRef : CEvent , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CFactory , CUnknown , CFrame , CImpIOleClientSite , CImpIAdviseSink , CImpIOleInPlaceSite , CImpIOleDocumentSite , CSite , CUrlmonCallback , CMallocSpy , CDog , CClassFactory , CClassFactoryWrapper , CSimpleObject , CClassFactory , CTestCOMPerformance , CSecureObject , CHello , CHelloClassFactory , tagOLESTDMESSAGEFILTER , CSamplePipe , CSimpleClass , CFactory , CBase , CAggregate , CDropObject , CDropSource , CDropTarget , COleClient , CListener , CStorageBuffer , CFileStream
  • m_cRefCount : CDataObject , CDragSource , CDropTarget , CEnumFormatEtc
  • m_cRefs : CSafeRefCount , CSettings , AgentNotifySink
  • m_cRemix : CDlgDest
  • m_cRestrictions : CSchemaDlg
  • m_CriticalSection : CSampleDataContainer , CSampleDirectory , CLockHandler , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_CritSec : CAuthenticateContext , CDBAuthPlugin
  • m_critSect : CBackgroundFolder , CBicycleFolder , CAdvClientDlg
  • m_cRows : CFileIO , CRowset , MyOSPObject , CInkInputWnd
  • m_CRowset : COptionsSheet
  • m_cRowsetsOpen : CCommand
  • m_cRowsToFetch : COptionsSheet
  • m_cRSN : CClientDlg
  • m_cs : CLDisp
  • m_cSamples : CDlgSrc
  • m_cSchemas : CSchemaDlg
  • m_csClientsLock : RqsEngine
  • m_CSecurity : CFullConnect
  • m_csFriendName : CImp_DrawDlg
  • m_csLogin : CImp_DrawDlg
  • m_cslotCurrent : CBitArray
  • m_csQueue : ISAPITHREAD
  • m_csScreenText : CImp_DrawDlg
  • m_CStatusBar : CMainWindow
  • m_cstrDataSource : CDataSource
  • m_cstrDBMS : CDataSource
  • m_cstrDBMSVer : CDataSource
  • m_cStrings : CStringTable
  • m_cstrProviderDesc : CDataSource
  • m_cstrProviderName : CDataSource
  • m_cstrStringBuffer : CColumnInfo
  • m_cTables : CS1Dialog , MyDataSource
  • m_ctlStart : CClientDlg
  • m_ctlSysListView32 : CComSpy
  • m_CToolBar : CMainWindow
  • m_ctrlEditStatus : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_CurrTask : CEnumTASK
  • m_curThreadCount : CMain
  • m_cValidBits : CDlgDest
  • m_cValue : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeCRLDistInfo
  • m_cValueList : CDlgIADs , CDlgIADsPropertyList , CDlgIDirectoryObject
  • m_cValuesSet : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeStringArray
  • m_cWarning : CClientDlg
  • m_cWriteFileErr : CGenerateRC
  • m_cyPPI : CFileViewer
  • m_cyStatus : CFileViewer
  • m_cyTools : CFileViewer
  • m_data : CNode< TYPE >
  • m_DataGridDisplay : CADVCGENDlg
  • m_DataObject : CSimpSvrObj
  • m_dbAlloc : CExtBuffer
  • m_DBFile : CMSOmniProvRowset
  • m_DeadLetter : CSendMessageDialog
  • m_debug : CXMLTreeDlg
  • m_DecodeInfo : CCertEncodeAltName , CCertEncodeBitString , CCertEncodeCRLDistInfo
  • m_DecodeLength : CCertEncodeAltName
  • m_DefaultTimeouts : CNullModem
  • m_DeleteButton : CMultiValuedAttributeEditor
  • m_deleted : Deers
  • m_DesiredGraphState : CSampleMSPStream
  • m_DeviceCombo : CGenericUCPDlg
  • m_DeviceProperties : CGenericUCPDlg
  • m_DeviceType : CDeviceProp
  • m_diskDescriptions : CAdvClientDlg
  • m_diskDetails : CAdvClientDlg
  • m_diskInfo : CWbemClientDlg
  • m_displayInfo : CQueryDlg
  • m_DlgProc : CBaseDialog , CSimpleDialog
  • m_domainName : CServerDlg
  • m_DoneID : Notify
  • m_double : CMSOmniProvSessionColSchemaRowset
  • m_doWork : CBicycleFolder
  • m_drawScribble : CDisdrawDlg , CImp_DrawDlg
  • m_DropSource : CSimpleDoc
  • m_DropTarget : CSimpleDoc
  • m_dwAccessorOpts : COptionsSheet
  • m_dwAddressH : RqsClient
  • m_dwAlignment : CSampleDataContainer
  • m_dwAlignmentLog2 : CSampleDataContainer
  • m_dwAsynchProp : CFullConnectProperties
  • m_dwAttributes : CDeviceNode , CFolderNode , CVirtualFile , CBaseNode
  • m_dwBandID : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • m_dwBlobOpt : CTableCopy
  • m_dwBodySize : CReceiveMessageDialog
  • m_dwBytesReadSoFar : ASYNC_REQUESTER
  • m_dwCacheProp : CFullConnectSecurity
  • m_dwChannelMask : CDlgSrc
  • m_dwCheckPoint : RqsEngine
  • m_dwCLSCTX : CBase , CFullConnectOptions , COptionsSheet
  • m_dwColFlags : CAlterColumnDlg
  • m_dwCommandOpts : COptionsSheet
  • m_dwConnection : CSimpleSite
  • m_dwConnectOpts : CFullConnectOptions
  • m_dwConvFlags : COptionsSheet
  • m_dwCookie : CConnectionPoint , CRTCEvents , InkCollectorEvents , CBrowserHost , CBehavior , CNotify , CApplet , CAppletSession , CCompartmentMonitor
  • m_dwCookie2 : CBrowserHost
  • m_dwCookieAsynchNotify : CAsynchBase
  • m_dwCookieRowPos : CRowPosition
  • m_dwCookieRowsetNotify : CRowset
  • m_dwCookieTransNotify : CTransaction
  • m_dwCreateOpts : COptionsSheet
  • m_dwCurLen : CUtilString
  • m_dwCurrentItem : ISAPITHREAD
  • m_dwDispositionFlags : CCertPolicySample
  • m_dwDLControl : CBrowserHost
  • m_dwDocHostUIDblClk : CBrowserHost
  • m_dwDocHostUIFlags : CBrowserHost
  • m_dwDrawAspect : CSimpleSite
  • m_dwEditFlags : CCertPolicySample
  • m_dwEncryptPasswordProp : CFullConnectSecurity
  • m_dwErrorAPI : ASYNC_REQUESTER
  • m_dwEventCookie : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_dwEventMask : CNullModem
  • m_dwExitPublishFlags : CCertExitSample
  • m_dwFlag : CADQIApp
  • m_dwFlags : CSampleDirectoryInfo , CBaseDialog , CEnumIDList
  • m_dwID : CSite
  • m_dwIDCounter : CFrame
  • m_dwImpersonateProp : CFullConnectSecurity
  • m_dwInComingCallStatus : tagOLESTDMESSAGEFILTER
  • m_dwInPipeSent : CSamplePipe
  • m_dwInsertOpt : CTableCopy
  • m_dwInternalLockType : CTSFEditWnd
  • m_dwIssuerCertURLFlags : CCertPolicySample
  • m_dwItemNum : CSampleDirectory
  • m_dwItemsInQueue : ISAPITHREAD
  • m_dwLastError : ASYNC_REQUESTER
  • m_dwlcidProp : CFullConnectProperties
  • m_dwLockThreadId : CLockHandler
  • m_dwLockType : CTSFEditWnd
  • m_dwMaskPasswordProp : CFullConnectSecurity
  • m_dwMaxLen : CUtilString
  • m_dwMaxLength : COptionsSheet
  • m_dwMaxTime : CMain
  • m_dwMinTime : CMain
  • m_dwModeProp : CFullConnectProperties
  • m_dwMyCookie : CMSMQEventHandler
  • m_dwNotifyOpts : COptionsSheet
  • m_dwNumThreads : ISAPITHREAD
  • m_dwOffset : CUrlmonCallback
  • m_dwOutPipeRcvd : CSamplePipe
  • m_dwPageSize : CSDKSampleStorageSystem
  • m_dwPathNameLength : CSampleDirectory
  • m_dwPersistEncryptProp : CFullConnectSecurity
  • m_dwPersistProp : CFullConnectSecurity
  • m_dwPictureSize : CThumbNailPhotoHolder
  • m_dwPrefCount : CADsSearch
  • m_dwPromptProp : CFullConnectProvider
  • m_dwProtectionProp : CFullConnectSecurity
  • m_dwProtocolIndex : CProxyPlugin::COpState
  • m_dwRangeBeg : CUrlmonCallback
  • m_dwRangeEnd : CUrlmonCallback
  • m_dwRef : CCompartmentMonitor
  • m_dwRefCount : CRTCIncomingDlg , CRTCOutgoingDlg , CRTCEvents , CTAPIEventNotification
  • m_dwRefs : tagOleStdEnumFmtEtc , tagOleStdEnumStatData
  • m_dwReg : CClassFactoryWrapper
  • m_dwRegister : COleDocument , CSimpSvrObj
  • m_dwRegisterClass : CSimpSvrApp
  • m_dwResponseCode : CUrlmonCallback
  • m_dwRevocationFlags : CCertPolicySample
  • m_dwRowOpt : CTableCopy
  • m_dwRowsetOpts : COptionsSheet
  • m_dwSIFlags : CObjSecurity
  • m_dwSignature : CStorageResource
  • m_dwStartingTime : ASYNC_REQUESTER
  • m_dwStatus : CCommand , CRowset
  • m_dwStorageObjects : CDataSource
  • m_dwSyncFlags : CSyncMgrHandler
  • m_dwTemplateMajorVersion : CRequestInstance
  • m_dwTemplateMinorVersion : CRequestInstance
  • m_dwThreadID : CCriticalSection , CLock
  • m_dwTimeLimit : ASYNC_REQUESTER
  • m_dwTimeoutProp : CFullConnectProperties
  • m_dwTimeToBeReceived : CSendMessageDialog
  • m_dwTimeToReachQueue : CSendMessageDialog
  • m_dwTotalIters : CMain
  • m_dwTotalTime : CMain
  • m_dwTraceId : RqsEngine
  • m_dwType : tagProperties
  • m_dwViewMode : CCommBand , CDeskBand , CExplorerBar , CToolBand
  • m_dwWorkItemQueueSize : ISAPITHREAD
  • m_dwXAttribs : CExtendPropertySheet
  • m_DynChnlRegKey : CAppletSession
  • m_eBaseClass : CBase
  • m_eConfig : RqsEngine
  • m_editBaseTableName : CConstraintDlg
  • m_editColumnName : CConstraintDlg , CAlterColumnDlg
  • m_editConstraintName : CConstraintDlg
  • m_editConstraintText : CConstraintDlg
  • m_EditCookie : CTSFEditWnd
  • m_editDesc : CPropertiesDlg
  • m_editDURI : CRTCOutgoingDlg
  • m_editFKColumnName : CConstraintDlg
  • m_editIndexName : CAlterIndexDlg
  • m_editLURI : CRTCOutgoingDlg
  • m_EditMode : CEntity
  • m_editNewColumnName : CAlterColumnDlg
  • m_editNewIndexName : CAlterIndexDlg
  • m_editNewTableName : CAlterTableDlg
  • m_editPath : CFileShareSampleParamsPage
  • m_editPrecision : CAlterColumnDlg
  • m_editReferencedTableName : CConstraintDlg
  • m_editScale : CAlterColumnDlg
  • m_editShareName : CFileShareSampleParamsPage
  • m_editSize : CAlterColumnDlg
  • m_editTableName : CAlterIndexDlg , CAlterTableDlg , CAlterColumnDlg
  • m_editValue : CEditValueDlg
  • m_edtApp : CAppUtilDlg
  • m_edtAppFile : CAppInstallDlg
  • m_edtApplicationID : CAppExportDlg
  • m_edtComponent : CCompInstallDlg
  • m_edtExportPath : CAppExportDlg
  • m_edtID : CCompImportDlg
  • m_edtInstallDir : CAppInstallDlg
  • m_edtPropertyValue : CVCExploreDlg
  • m_edtProxyStub : CCompInstallDlg
  • m_edtPWD : CAppInstallDlg
  • m_edtRemoteComputerName : CConnectDlg
  • m_edtRemoteServerName : CAppInstallDlg
  • m_edtTypeLib : CCompInstallDlg
  • m_edtUID : CAppInstallDlg
  • m_eidMember : CMember
  • m_eidMyself : CAppletSession
  • m_eInterfaceAdded : RqsEngine
  • m_EmbeddedLinks : SIMPLE_BROWSER
  • m_eMethodType : CPropertiesDlg
  • m_Encrypted : CSendMessageDialog
  • m_enState : CRTCSession , CRTCWin
  • m_Enum : CRefClient
  • m_enumDisks : CAdvClientDlg , CWbemClientDlg
  • m_EnumInfo : CFullConnect
  • m_enumServices : CAdvClientDlg
  • m_enumServicesAsync : CAdvClientDlg
  • m_eObjectType : CBase
  • m_eQuit : RqsEngine
  • m_eSocketAccept : RqsEngine
  • m_eSocketRead : RqsEngine
  • m_eStatus : CMyEventProvider
  • m_eTrace : RqsEngine
  • m_eventFlags : CWaitSystemDlg
  • m_eventList : CAdvClientDlg
  • m_EventMap : CAppInfo
  • m_EventObject : CProvider_IWbemEventProvider
  • m_EventSink : CProvider_IWbemEventProvider , ThreadArg_Struct
  • m_EventText : CGenericUCPDlg
  • m_ExternalConnection : CSimpSvrObj
  • m_fAcceptFmt : CDropTarget
  • m_fActive : CSchemaDlg
  • m_factory : CCmdLineConsumerApp , CPermEventsApp
  • m_factoryType : CClassFactory
  • m_FactoryType : CClassFactory
  • m_fAddMyUI : CSimpleDoc
  • m_fAggregation : CInterfaceDlg
  • m_fAllowOverrideMachineNameOut : CStaticNode::privateData
  • m_fAllowStomping : CUtilString
  • m_fAlwaysAddProp : CClusPropList
  • m_fAppActive : CSimpleApp
  • m_fAsyncFindRunning : CGenericUCPDlg
  • m_fAtEnd : CClusPropValueList
  • m_FaxNumber : FaxDlg
  • m_fBackground : CContextMenu
  • m_fCA : CRequestInstance
  • m_fCancel : CProgress
  • m_fCanDropCopy : CSimpleDoc
  • m_fCanDropLink : CSimpleDoc
  • m_fClassReg : CFileViewer
  • m_fClosing : CSimpSvrDoc , ASYNC_REQUESTER
  • m_fCommPortInUse : CNullModem
  • m_fConnected : CDataSource
  • m_fConsoleTrace : RqsEngine
  • m_fConstructing : CCertEncodeDateArray , CCertEncodeLongArray , CCertEncodeAltName , CCertEncodeStringArray , CCertEncodeCRLDistInfo
  • m_fContents : CSmpFilter
  • m_fCopyIndexes : CTableCopy
  • m_fCopyPrimaryKeys : CTableCopy
  • m_fCopyTables : CTableCopy
  • m_fCreated : COleDocument
  • m_fCSHMode : CSimpleApp
  • m_fDBSessionCreated : CDataSource
  • m_fDebuggerTrace : RqsConfig
  • m_fDebugTrace : RqsEngine
  • m_fDenyPutColor : CSecureObject
  • m_fDenyPutUserName : CSecureObject
  • m_fDirty : COleDocument , CUtilString
  • m_fDocObj : CSite
  • m_fDragging : CDlgDest , CDlgSrc
  • m_fDragLeave : CSimpleDoc
  • m_fDsEnabledLocaly : CDisdrawDlg , CImp_DrawDlg , CLoginDlg
  • m_fDSOInitialized : CDataSource
  • m_fEditing : CSchemaDlg , CS1Dialog
  • m_fEnableBusyDialog : tagOLESTDMESSAGEFILTER
  • m_fEnableModeless : COleInPlaceActiveObject
  • m_fEnableNotRespondingDialog : tagOLESTDMESSAGEFILTER
  • m_fEof : CSmpFilter
  • m_fError : CGenerateRC , CImportRes
  • m_fExternalOnly : UsageStringInfo
  • m_fFoundLang : CImportRes
  • m_fHaveObject : CFrame
  • m_fHeapAlloc : TempBuffer
  • m_FileIdx : CFileIO
  • m_filename : CXMLTreeDlg
  • m_FileReadOnly : CFileIO
  • m_FilterType : CAppInfo
  • m_fInContextHelp : CFrame
  • m_FindByType : CGenericUCPDlg
  • m_FindByUDN : CGenericUCPDlg
  • m_FindCombo : CGenericUCPDlg
  • m_fInDelete : CSafeRefCount
  • m_fInEdit : CShellView
  • m_fInitialized : CFrame , CSite , CSimpleApp , CSimpSvrApp , CAsynchBase , CDownloadUI , CNullModem
  • m_fInitializing : CContextSamplePropPage
  • m_fInObjectHelp : CFrame
  • m_fInPlaceActive : COleDocumentView , CSimpleDoc , CSimpleSite , CSimpSvrObj
  • m_fInPlaceVisible : CSimpSvrObj
  • m_fInRoster : CMember
  • m_fInterimChar : CTSFEditWnd
  • m_fInternalOnly : UsageStringInfo
  • m_fIRowsetChange : CDataSource
  • m_fIRowsetUpdate : CDataSource
  • m_fIsDynamicDisk : CStorageResource
  • m_fIsGPTDisk : CStorageResource
  • m_fIsManaged : CStorageResource
  • m_fIsManagedByDefault : CStorageResource
  • m_fIsMultiNodeCapable : CStorageResource
  • m_fIsQuorumCapable : CStorageResource
  • m_fIsQuorumResource : CStorageResource
  • m_fIsRadioLocalMachine : CStaticNode::privateData
  • m_fLastFetchForward : CDataGrid
  • m_fLayoutChanged : CTSFEditWnd
  • m_fLoadCalled : CFileViewer
  • m_fLoadedDevices : CEnumStorageResource
  • m_fLocalDrag : CSimpleDoc
  • m_fLocalDrop : CSimpleDoc
  • m_fLocked : CTSFEditWnd
  • m_fMapped : CStatusHelper
  • m_fMenuMode : CSimpleApp
  • m_fModal : CDialogLite
  • m_fModifiedMenu : CSimpleDoc
  • m_fMultipleParamSets : CDataSource
  • m_fNoScribbleMode : COleDocument , CSimpSvrObj
  • m_fNotify : CTSFEditWnd
  • m_fObjectOpen : CSimpleSite
  • m_FolderSettings : CShellView
  • m_fOleStdInit : CSimpleApp , CSimpSvrApp
  • m_fOpen : COleObject
  • m_FormatEtc : CTSFDataObject
  • m_FormatNameCB : COpenQueueDialog
  • m_fOurMenuShowing : CFrame
  • m_fOutput : CInterfaceDlg
  • m_fPendingDrag : CSimpleDoc
  • m_fPendingLockUpgrade : CTSFEditWnd
  • m_fPlayable : CDlgDest , CDlgSrc
  • m_fPostQuitMsg : CFileViewer
  • m_fPrepareForSync : CSyncMgrHandler
  • m_fPresenceEnabled : CRTCWin
  • m_fPrimaryKeysSupported : CDataSource
  • m_fProxy : CFactoryData
  • m_fProxyAutoDiscovery : ASYNC_REQUESTER
  • m_fProxyFailover : ASYNC_REQUESTER
  • m_FrameInfo : COleDocumentView , CSimpSvrObj
  • m_fReadOnly : CDataSource
  • m_fRegDragDrop : CSimpleDoc
  • m_fRemoveDeleted : CRowset
  • m_FriendlyName : CDeviceProp
  • m_fRtTrace : RqsEngine
  • m_fSameAsLoad : CPersistStorage
  • m_fSaveWithSameAsLoad : CSimpSvrObj
  • m_fSetCodepage : CImportRes
  • m_fShowInit : CFileViewer
  • m_fShowPrev : CRTCAVSession
  • m_fShowQuery : CTableCopy
  • m_fShowRecv : CRTCAVSession
  • m_fShowSupported : CSchemaDlg
  • m_fShutdownInProgress : SIMPLE_BROWSER
  • m_fStartByOle : CSimpSvrApp
  • m_fStatusVisible : CFileViewer
  • m_fStopped : CSyncMgrHandler
  • m_fSupportedType : CResData , CResTypeData
  • m_fSynchronizing : CSyncMgrHandler
  • m_fTerminalConnected : CSampleMSPStream
  • m_fToolsVisible : CFileViewer
  • m_fTopProvider : CAppletSession
  • m_fTraceEnabled : RqsConfig
  • m_fTranslate : CTableCopy
  • m_fTransportConfigured : CSampleMSPStream
  • m_fTyping : CRTCIMSession
  • m_fUIActive : COleDocumentView , CSimpSvrObj
  • m_fUse : CDlgSrc
  • m_fUseColProps : CAlterColumnDlg
  • m_fUseProperties : CSchemaDlg
  • m_fUserCancel : CDownloadUI
  • m_fUseRestrictions : CSchemaDlg
  • m_fUseTableProps : CAlterTableDlg
  • m_fUsingOurHelp : CFrame
  • m_fWroteBinary : CGenerateRC
  • m_Genie : Hello3J
  • m_GenieFilename : Hello3J
  • m_GenieID : Hello3J
  • m_green : CSimpSvrObj
  • m_grfMode : CFileViewer
  • m_guidCmdDialect : CCommand
  • m_guidCompartment : CCompartmentMonitor
  • m_guidDialect : CCommand
  • m_guidImpersonate : CCommand
  • m_GuidList : CDataObject
  • m_guidProv : MyClassFactory
  • m_guidSource : CBase
  • m_hAccel : CFrame , MainDlg , CFileViewer
  • m_hAccels : CShellView
  • m_hAccessor : CDataAccess
  • m_hAddDeviceDlg : CStaticNode
  • m_hAddFolderDlg : CDeviceNode
  • m_hAddVFileDlg : CFolderNode
  • m_handle : CDelegationBase
  • m_hAppIcon : CSnapinAbout
  • m_hAppWnd : CSimpleApp , CSimpSvrApp
  • m_hBitmap : CBitmapWnd
  • m_hBmkAccessor : CDataAccess
  • m_hBuddyList : CRTCWin
  • m_hCascadeMenu : CSimpleApp
  • m_hChapter : CRowset
  • m_hchapter : CMSOmniProvSessionColSchemaRowset
  • m_hCluster : CExtObject , CClusterData
  • m_hColorMenu : CSimpSvrApp
  • m_hConnect : ASYNC_REQUESTER
  • m_hControl : CImportRes
  • m_hCreateThread : CBankDlg
  • m_hCur : CHourglass
  • m_hCurSizeNS : CMainWindow
  • m_hCursorOld : CSplitterLite
  • m_hCursorRight : CSplitterLite
  • m_hCursorTop : CSplitterLite
  • m_hDatabase : CGenerateRC , CImportRes
  • m_hdbc : CComSpySqlAudit , CAccount , CUpdateReceipt , CODBCData
  • m_hDialog : CImportRes
  • m_hDisplay : CRTCIMSession
  • m_hDlg : WiaWrap::CProgressDlg
  • m_hDocWnd : CSimpleDoc , CSimpSvrDoc
  • m_hdr : CTSFPersistentPropertyLoader
  • m_hDraggingItem : CTreeViewLite
  • m_hEdit : CRTCIMSession
  • m_hEditMenu : CSimpleApp
  • m_HelpFile : CComponentData
  • m_henv : CComSpySqlAudit , CAccount , CUpdateReceipt , CODBCData
  • m_hEvtClose : CPluggableTransport
  • m_hevtOverlapped : CNullModem
  • m_hEvtRead : CPluggableTransport
  • m_hEvtWrite : CPluggableTransport
  • m_hExitKey : CCertExitSample
  • m_hFile : CComSpy , CBankDlg , CLogFile , CDBFile , CFileLite , CSampleDataContainer , CGenerateRC , CPack , CSmpFilter
  • m_hFileMenu : CSimpleApp
  • m_hFont : CComSpy , CRecoOutputWnd , CFileViewer
  • m_hfont : CExtObject
  • m_hGroup : CGroupData
  • m_hHatchWnd : CSimpSvrDoc
  • m_hHelpMenu : CSimpleApp , CSimpSvrApp
  • m_hicon : CExtObject
  • m_hIcon : CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CConnectDlg , CUtilitiesDlg , CVCExploreDlg , CClientDlg , CADVCGENDlg , CADQIDlg , CDisdrawDlg , CImp_DrawDlg , CRTCIncomingDlg , CRTCOutgoingDlg , CGenericUCPDlg , CCmdLineConsumerDlg , CPermEventsDlg , CWbemClientDlg , AboutDlg , CCapMFCDlg , CXMLTreeDlg
  • m_hImageList : CMainWindow
  • m_hImageStrip16 : CComponent , CComponentData
  • m_hImageStrip32 : CComponent , CComponentData
  • m_hInitDlg : WiaWrap::CProgressDlg
  • m_hInst : CFrame , CSimpleApp , CSimpSvrApp , CDialogBase , CPropSheetHost , CImportRes , CDownloadUI , CStatusHelper , CStringTable , CFileViewer , CTSFEditWnd , CTSFMainWnd
  • m_hInstance : CAppLite , CSimpleDialog
  • m_hInstMprApi : RqsEngine
  • m_hInstPrev : CFrame
  • m_hkConfig : RqsEngine
  • m_hkTrace : RqsEngine
  • m_hLargeImage : CSnapinAbout
  • m_hLibRichEdit10 : CMainWindow
  • m_hLibRichEdit20 : CMainWindow
  • m_hListenSocket : CX224
  • m_hLog : RqsEngine
  • m_hMainMenu : CSimpleApp , CSimpSvrApp
  • m_hMapFile : CDBFile
  • m_hMDIClient : CMainWindow
  • m_hMemSMM : CStatusHelper
  • m_hMemText : CFileViewer
  • m_hMenu : CBankDlg , CShellView
  • m_hMenuDebug : CComSpy
  • m_hMenuHelp : CFrame
  • m_hMenuOrg : CFrame
  • m_hmenuShared : CSimpSvrObj
  • m_hMenuTop : CFrame
  • m_hMessageWnd : CStaticNode , CFolderNode , CDeviceNode
  • m_hMicLevel : CRTCAVSession
  • m_hMicMute : CRTCAVSession
  • m_hMicText : CRTCAVSession
  • m_hMicVol : CRTCAVSession
  • m_hNetInterface : CNetInterfaceData
  • m_hNetwork : CNetworkData
  • m_hNode : CNodeData
  • m_hNotifyObj : CSCPUIGeneral , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI
  • m_hObjClassIcon : CSCPWiz , CWizExtUser
  • m_hOldCursor : CAnnotator
  • m_hOleMenu : COleDocumentView , CSimpSvrObj
  • m_hOpenImage : CSnapinAbout
  • m_host : CStaticNode::privateData
  • m_hpage : CBasePropertyPage
  • m_hParentHScopeItem : CLandBasedVehicle , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSkyBasedVehicle , CSpaceVehicle , CStaticNode
  • m_hParentNode : CDeviceNode
  • m_hParentWnd : CAddDeviceDlg , CAddVFileDlg , CAddFolderDlg
  • m_hPrevCursor : CWaitCursor
  • m_hPrevInstance : CAppLite
  • m_hPrevVideoParent : CRTCAVSession
  • m_hqIncoming : CDisdrawDlg
  • m_hqOutgoing : CDisdrawDlg
  • m_hQuit : CSampleDataSource
  • m_hr : CAsyncFullServ
  • m_hRadioButton : CImportRes
  • m_hRecvVideoParent : CRTCAVSession
  • m_hRequest : ASYNC_REQUESTER
  • m_hResource : CResData
  • m_hResult : CAsyncTest
  • m_hRichEdit : CRecoOutputWnd
  • m_hrLastUpdateResult : CCertPolicySample
  • m_hrLaunch : CWrapVBComponent
  • m_hRow : CRow
  • m_hrReturn : CListener
  • m_hSearch : CADsSearch
  • m_hSend : CRTCIMSession
  • m_hServer : RqsEngine
  • m_hService : RqsEngine
  • m_hSession : SIMPLE_BROWSER
  • m_hSharedMenu : COleDocumentView
  • m_hShutdownEvent : SIMPLE_BROWSER
  • m_hSmallImage : CSnapinAbout
  • m_hSmallImageOpen : CSnapinAbout
  • m_hSocket : CX224
  • m_hSourceRow : CRow
  • m_hSpkLevel : CRTCAVSession
  • m_hSpkMute : CRTCAVSession
  • m_hSpkText : CRTCAVSession
  • m_hSpkVol : CRTCAVSession
  • m_hStateList : CMainWindow
  • m_hStaticNode : CComponentData , CStaticNode
  • m_hStatusBar : CRTCSession , CRTCWin
  • m_hStdPal : CSimpleApp
  • m_hstmt : CComSpySqlAudit , CAccount , CUpdateReceipt , CODBCData
  • m_hThread : CMyEventProvider , CSampleDataSource
  • m_hThreadHandle : CWorkerThread
  • m_hToken : CAuthenticateContext
  • m_hTreeItem : CBase
  • m_hwnd : CEventSink
  • m_hWnd : CFrame , CSite , CWndLite , CPropertyPage , CDialogBase , CRTCEvents , CRTCSession , CRTCWin , CBaseDialog , CMyInkEvents , CSimpleDialog , AboutDlg , MainDlg , Conf , CCommBand , CDeskBand , CExplorerBar , CToolBand , CStatusHelper , CFileViewer , CShellView , CTSFEditWnd , CTSFMainWnd
  • m_hWndBusyDialog : tagOLESTDMESSAGEFILTER
  • m_hwndCallback : CCallbackWrapper
  • m_hWndCapture : CHourglass
  • m_hWndClient : CFrame
  • m_hwndEdit : CTSFEditWnd
  • m_hWndFileNameEdit : CThumbNailPhotoHolder
  • m_hwndHandler : CSyncMgrHandler
  • m_hwndHidden : CPropSheetHost
  • m_hwndIPObj : CSimpleSite
  • m_hwndList : CShellView
  • m_hWndList : CComSpy
  • m_hWndMDIClient : CMDIFrameLite
  • m_hWndModeless : CAppLite
  • m_hwndMSGestLV : CAdvRecoApp
  • m_hWndObj : CFrame
  • m_hWndOld : CFileViewer
  • m_hWndOwner : CStatusHelper
  • m_hwndParent : CPropSheetHost , CDownloadUI , CCommBand , CDeskBand , CExplorerBar , CToolBand , CShellView , CTSFEditWnd
  • m_hWndParent : tagOLESTDMESSAGEFILTER , CSimpSvrObj , CWndLite , WiaWrap::CProgressDlg
  • m_hWndPictureControl : CThumbNailPhotoHolder
  • m_hwndProgress : CDownloadUI
  • m_hWndProp : CFullConnectProvider
  • m_hWndSchemas : CSchemaDlg
  • m_hwndSSGestLV : CAdvRecoApp
  • m_hwndStatus : CTSFEditWnd
  • m_hWndStatus : CFileViewer
  • m_hwndStatusBar : CAdvRecoApp , CMultiRecoApp
  • m_hWndToolbar : CFileViewer
  • m_hwndToolBar : CVCExploreDlg
  • m_hWndTreeView : CSchemaDlg
  • m_hWndTreeWnd : CSchemaDlg
  • m_hwndUIActiveObj : CSimpleApp
  • m_hwndView : COleDocumentView
  • m_hWndViewport : CFileViewer
  • m_hwndWorker : CSyncMgrHandler
  • m_hWorkerThreadSemaphore : ISAPITHREAD
  • m_i : CAsyncFullServ
  • m_iAccessRight : COpenQueueDialog
  • m_iAck : CSendMessageDialog
  • m_iArraySize : CImp_DrawDlg
  • m_iBorderCX : CSplitterLite
  • m_iBorderCY : CSplitterLite
  • m_iCert : CCertPolicySample
  • m_iChildWindow : CMDIChild
  • m_iColor : CMultiRecoApp
  • m_iCookie : CMain
  • m_iCount : ClientList
  • m_iCRL : CCertPolicySample
  • m_iCtrlResID : CGenerateRC
  • m_iCur : CEnumXXX< T, ELT_T, IFACE > , CEnumFormatEtc
  • m_iCurrent : CDataObject
  • m_id : CCrmFilesWorker , CPerson , CBackground
  • m_iData : CClientDlg
  • m_iddPropertyPage : CBasePropertyPage
  • m_iddWizardPage : CBasePropertyPage
  • m_iDelivery : CDisdrawDlg , CSendMessageDialog
  • m_iDialogID : CPropertyPage
  • m_ids : UsageStringInfo
  • m_idsCaption : CBasePropertyPage
  • m_idsMax : CStatusHelper , CStringTable
  • m_idsMin : CStatusHelper , CStringTable
  • m_idSource : CFullConnect , CMainWindow , CMDIChild
  • m_idxDevice : CStorageResource
  • m_idxEnumNext : CEnumStorageResource
  • m_idxEnumPartitionNext : CStorageResource
  • m_idxNext : CEnumStorageResource
  • m_idxNextLogicalDisk : CPartitionInfo
  • m_idxNextPartition : CStorageResource
  • m_iFontName : CRecoOutputWnd
  • m_iFormatNameList : CDisdrawDlg
  • m_iid : CAsyncXXX< T, ISyncFace, IAsyncFace > , CConnectionPoint , CEnumXXX< T, ELT_T, IFACE > , CInterfaceDlg
  • m_iidProp : CPropertiesDlg
  • m_iIters : CMain
  • m_Image : CBitmapWnd
  • m_imageList : CXMLTreeDlg
  • m_iMidline : CInkInputWnd
  • m_IndexMap : CDynamic
  • m_InitTime : CVirtualFile
  • m_InkEvents : CMyInkCollector
  • m_inst : CBicycle
  • m_Instances : CRefClient
  • m_Interface : SmartRefPointer< T >
  • m_InternalReferenceCount : CProvider_IWbemEventProvider
  • m_InvokeAction : CGenericUCPDlg
  • m_iOldSchemaIndex : CSchemaDlg
  • m_ipConsole : CComponent , CComponentData , CComponent , CComponentData , CComponent
  • m_ipConsole2 : CComponentData , CComponent
  • m_ipConsoleNameSpace : CComponentData
  • m_ipConsoleNameSpace2 : CComponentData
  • m_ipConsoleVerb : CComponent
  • m_ipControlBar : CComponent , CToolBarExtension
  • m_ipControlbar : CComponent
  • m_ipDeviceToolbar : CComponent
  • m_ipDisplayHelp : CComponent
  • m_ipHeaderCtrl : CComponent
  • m_ipHeaderCtrl2 : CComponent
  • m_ipMenuButton : CComponent
  • m_iPos : CStorageBuffer , CStream , CISeqStream
  • m_ipResultData : CComponent
  • m_iPrevStep : CWizard
  • m_ipScopeImage : CComponentData
  • m_ipStaticToolbar : CComponent
  • m_ipToolbar : CComponent , CToolBarExtension
  • m_ipVFileToolbar : CComponent
  • m_iRadio : CImp_DrawDlg
  • m_iRadioDS : CDisdrawDlg , CImp_DrawDlg , CConnectDlg
  • m_iRefCnt : CDownloadBindStatusCallback
  • m_irowFilePos : CRowset
  • m_irowLastFilePos : CRowset
  • m_irowMin : CRowset
  • m_iSavedSel : CComboBoxLite
  • m_iSchemaIndex : CSchemaDlg
  • m_isDirty : CStaticNode::privateData
  • m_iSelCol : CDataGrid
  • m_iSelRow : CDataGrid
  • m_iSelStart : CRecoOutputWnd
  • m_iStrResID : CGenerateRC
  • m_iSurface : CBicycle
  • m_item : COfficeDlg
  • m_itemId : CBackground
  • m_iTimeout : CReceiveMessageDialog
  • m_iType : CDisdrawDlg
  • m_iWasText : CImp_DrawDlg
  • m_j : CAsyncFullServ
  • m_JoinSessionReq : CAppletSession
  • m_Journal : CSendMessageDialog
  • m_key : CAssoc< KEY, VALUE >
  • m_keyInfoEnum : Sample::MySignedXml
  • m_keyMap : CEntity
  • m_lAccess : CUtil
  • m_lastSizedEdge : CMDIChild
  • m_lAsyncFindHandle : CGenericUCPDlg
  • m_lblCollectionName : CVCExploreDlg
  • m_lblComponentDesc : CCompImportDlg
  • m_lblComputerName : CVCExploreDlg
  • m_lbParties : CRTCOutgoingDlg
  • m_lCharacterID : MainDlg
  • m_lcid : CFactoryData , CMgdClusCfgInit , CExtObject , CMyCapabilities , CMyEvictListener , CMyMemberSetChangeListener , CMyStartupListener , CPartitionInfo
  • m_lClerkNumber : CCrmMonComp
  • m_lClientLeft : CGrid
  • m_lClients : RqsEngine
  • m_lClientTop : CGrid
  • m_lCmdPropertiesID : MainDlg
  • m_lCookie : CDataObject , CBehavior
  • m_lCSSlevel : CBrowserHost
  • m_lCurPos : CDataGrid
  • m_lCustomerId : CONotify , COrder , COShip , COShip2
  • m_lDataSourceType : CDataSource
  • m_lFails : CClientDlg
  • m_lGenID : CCacheMapEl
  • m_lGridCookie : CBrowserHost
  • m_lGridSize : CGrid
  • m_lHandle : CCounterData
  • m_lHiPart : CDlgIADsLargeInteger
  • m_LibVersion : CFactoryData
  • m_lID : CRefresherMember< T >
  • m_liFreq : CTIMER
  • m_lIndex : CCacheMapEl
  • m_Line : CLine , CNullModem
  • m_LinksCritSec : SIMPLE_BROWSER
  • m_list : CBankDlg
  • m_listColumnDescFlags : CAlterColumnDlg
  • m_listColumnList : CConstraintDlg
  • m_listConfigs : CFullConnect
  • m_listCPropSets : CSession
  • m_listDeferrability : CConstraintDlg
  • m_listFiles : CFullConnect
  • m_listFKColumnList : CConstraintDlg
  • m_listLines : CDrawArea
  • m_listListeners : MyDataSource , MyOSPObject
  • m_listTransactions : CMainWindow
  • m_listValues : CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >
  • m_listviewProps : CPropertiesDlg
  • m_lLanguage : CCrmFilesTest
  • m_lLastX : CImp_DrawDlg
  • m_lLastY : CImp_DrawDlg
  • m_lLeftBandWidth : CBrowserHost
  • m_lLowPart : CDlgIADsLargeInteger
  • m_lMaxRows : CDataGrid
  • m_Locale : CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_lOrderId : CONotify , COrder , COShip , COShip2
  • m_lpActiveObject : CSimpleDoc
  • m_lpApp : CSimpleDoc , CSimpSvrDoc
  • m_lParam : CCompartmentMonitor
  • m_lPartID : CBehavior
  • m_lpAsyncXXX : CAsyncTest
  • m_lpCntrDoc : CSimpSvrObj
  • m_lpColorStm : CSimpSvrObj
  • m_lpDataAdviseHolder : CSimpSvrObj
  • m_lpDoc : CSimpleApp , CSimpleSite , CSimpSvrApp , CSimpSvrObj
  • m_lpEtc : tagOleStdEnumFmtEtc
  • m_lpEventSink : CConnectionPoint
  • m_lpfnBusyDialogHookCallback : tagOLESTDMESSAGEFILTER
  • m_lpfnHandleInComingCallback : tagOLESTDMESSAGEFILTER
  • m_lpfnMessagePendingCallback : tagOLESTDMESSAGEFILTER
  • m_lpFrame : CSimpSvrObj
  • m_lpfsi : CFileViewer
  • m_lpg : CExtObject
  • m_lPingFailures : CClientDlg
  • m_lPings : CClientDlg
  • m_lpInPlaceObject : CSimpleSite
  • m_lpIPSite : CSimpSvrObj
  • m_lpObj : CAsyncXXX< T, ISyncFace, IAsyncFace > , CSimpSvrDoc
  • m_lpObjStorage : CSimpleSite , CDataXferObj
  • m_lpOleAdviseHolder : CSimpSvrObj
  • m_lpOleClientSite : CSimpSvrObj
  • m_lpOleObject : CSimpleSite , CDataXferObj
  • m_lPrevHeight : CRTCAVSession
  • m_lPrevWidth : CRTCAVSession
  • m_lpSite : CSimpleDoc
  • m_lpSizeStm : CSimpSvrObj
  • m_lpStat : tagOleStdEnumStatData
  • m_lpStorage : CSimpleDoc , CSimpSvrObj
  • m_lpstrClass : CUnknown
  • m_lpSyncface : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • m_lpszAppName : tagOLESTDMESSAGEFILTER
  • m_lpunk : CEnumXXX< T, ELT_T, IFACE >
  • m_lpUnkSync : CAsyncXXX< T, ISyncFace, IAsyncFace >
  • m_lpVtbl : tagOLESTDMESSAGEFILTER
  • m_lpWaveFormatEx : CPlgFilter
  • m_lpwhdr : CDlgDest , CDlgSrc
  • m_lRecordNumber : CCrmMonComp
  • m_lRecvHeight : CRTCAVSession
  • m_lRecvWidth : CRTCAVSession
  • m_lRef : CAsyncQuerySink , CHiPerfProvider , CRefresher , CClassFactory
  • m_lRefCount : CMonitor
  • m_lRefs : CSmpFilter , CSmpFilterCF
  • m_lSinkID : MainDlg
  • m_lSnapIncrement : CBrowserHost , CSnap
  • m_lstObjects : CVCExploreDlg
  • m_lstParentCollections : CVCExploreDlg
  • m_lstProperties : CVCExploreDlg
  • m_lstRelatedCollections : CVCExploreDlg
  • m_lTimeouts : CClientDlg
  • m_lTopBandHeight : CBrowserHost
  • m_lTries : CClientDlg
  • m_lUID : CCacheMapEl
  • m_Manufacturer : CDeviceProp
  • m_ManufacturerUrl : CDeviceProp
  • m_map : CComSpy , CMethodSub , CSelectEventsDlg
  • m_MapIndex : CDynamic
  • m_Merlin : Hello3J
  • m_MerlinFilename : Hello3J
  • m_MerlinID : Hello3J
  • m_message : CMessageDlg
  • m_MetaData : CProxy
  • m_mgw : COleDocumentView
  • m_ModelDescription : CDeviceProp
  • m_ModelName : CDeviceProp
  • m_ModelNumber : CDeviceProp
  • m_ModelUrl : CDeviceProp
  • m_Move : CCapMFCDlg
  • m_MoveX : CCapMFCDlg
  • m_MoveY : CCapMFCDlg
  • m_msgOut : CImp_DrawDlg
  • m_nAlloc : CAddrNode , CResultset
  • m_nAllocSize : CFixedAlloc , CSimpleArray< T >
  • m_Name : Object_Property
  • m_name : Deers
  • m_namespace : CAdvClientDlg , CWbemClientDlg
  • m_Namespace : CProvider_IWbemEventConsumerProvider , CProvider_IWbemEventProvider , CProvider_IWbemServices
  • m_nAppID : CAppLite
  • m_nBlockSize : CFixedAlloc , CLListImpl< TYPE, ARG_TYPE >
  • m_nBreakAtAllocSize : CDbAlloc
  • m_nBreakAtNthAlloc : CDbAlloc
  • m_nChannel : CDlgSrc
  • m_nCmdGuide : CAdvRecoApp
  • m_nCmdInputScope : CAdvRecoApp
  • m_nCmdMode : CAdvRecoApp
  • m_nCmdRecognizer : CAdvRecoApp , CMultiRecoApp
  • m_nCmdShow : CFrame , CAppLite
  • m_nConfID : CAppletSession
  • m_nConnectionID : CNullModem
  • m_nConnectionType : CConnectDlg
  • m_nCookie : CDataObject
  • m_nCount : CResultset , tagOleStdEnumFmtEtc , tagOleStdEnumStatData , CDataXferObj , CSimpleSite , CSimpSvrObj , CEntity , CProxy , WiaWrap::CComPtrArray< T > , CLListImpl< TYPE, ARG_TYPE >
  • m_nDataSize : WiaWrap::CDataCallback
  • m_nDeref : CDlgIDirectorySearch
  • m_nDragDelay : CSimpleApp
  • m_nDragMinDist : CSimpleApp
  • m_nDynamicMulticastChannel : CAppletSession
  • m_nExportType : CAppExportDlg
  • m_next : CAddrNode
  • m_nFailureRetries : ASYNC_REQUESTER
  • m_nGesture : CRecoOutputWnd
  • m_nGrow : CDynamic
  • m_nHeaderSize : WiaWrap::CDataCallback
  • m_nID : ASYNC_REQUESTER , CWndLite , SIMPLE_BROWSER
  • m_nidMember : CMember
  • m_nidMyself : CAppletSession
  • m_nImportType : CCompImportDlg
  • m_nIndex : tagOleStdEnumFmtEtc , tagOleStdEnumStatData
  • m_nInstallType : CAppInstallDlg
  • m_nMaxCount : CEntity
  • m_nMaxRowLength : CBankDlg
  • m_nMaxUsers : CFileShareSampleParamsPage
  • m_nMsgs : CBankDlg
  • m_nNotifyHandle : CVirtualFile
  • m_nNumAttempts : ASYNC_REQUESTER
  • m_nNumberWrites : CTestDlg
  • m_nNumDevices : WiaWrap::CEventCallback
  • m_nNumImages : CMainWindow
  • m_NodeList : CDeviceNode , CStaticNode , CFolderNode
  • m_nPageCount : CExtendPropertySheet
  • m_nPageSize : CDlgIDirectorySearch
  • m_nPrevMaxUsers : CFileShareSampleParamsPage
  • m_nPropPageCount : CBaseNode
  • m_nPropsRemaining : CClusPropList
  • m_nPullSeq : CSamplePipe
  • m_nPushSeq : CSamplePipe
  • m_nRefCount : CClassFactory , CColumnProvider , CEmptyVolumeCache
  • m_nRefs : CImpAuth
  • m_nRequesterIDSeed : SIMPLE_BROWSER
  • m_nReserve : CDynamic
  • m_nRows : CProxy
  • m_nSampleSize : CAVIFileWriter
  • m_nSamplesReadSoFar : CAVIFileReader
  • m_nScrollDelay : CSimpleApp
  • m_nScrollInset : CSimpleApp
  • m_nScrollInterval : CSimpleApp
  • m_nSize : CStaticMap , CSimpleArray< T >
  • m_nSizeLimit : CDlgIDirectorySearch
  • m_nSpeaker : CDlgSrc
  • m_nSuiteIndex : CBankDlg
  • m_nTemplate : CBaseDialog
  • m_nThreadID : CWorkerThread
  • m_nTimeLimit : CDlgIDirectorySearch
  • m_nTimeOut : CDlgIDirectorySearch
  • m_nTotalTests : CBankDlg
  • m_nTransportID : CNullModem
  • m_nUtilityOption : CUtilitiesDlg
  • m_nUtilityType : CAppUtilDlg , CUtilitiesDlg
  • m_nWidth : CComSpy
  • m_ObjRefCount : CShellFolder , CTSFPersistentPropertyLoader , CDropSource , CPropSheetHost , CClassFactory , CEnumFormatEtc , COleDocument , CAdminNotifyHandler , CCommBand , CDeskBand , CExplorerBar , CToolBand , CContextMenu , CDataObject , CDropTarget , CEnumIDList , CExtractIcon , CShellView , CShellIconOverlayID , CTSFDataObject , CTSFEditWnd
  • m_OkButton : CDeviceProp
  • m_OldPath : Hello3J
  • m_OleClientSite : CSimpleSite
  • m_OleInPlaceActiveObject : CSimpSvrObj
  • m_OleInPlaceFrame : CSimpleApp
  • m_OleInPlaceObject : CSimpSvrObj
  • m_OleInPlaceSite : CSimpleSite
  • m_oleMisc : CFactoryData
  • m_OleObject : CSimpSvrApp , CSimpSvrObj
  • m_oleVerbs : CFactoryData
  • m_Op : CProxyPlugin::COpState
  • m_OpenedQueuePathNameArray : CMainFrame
  • m_OperatingSystemVersion : CProvider_IWbemServices
  • m_output : CCmdLineConsumerDlg
  • m_outputList : CAdvClientDlg , CPermEventsDlg , CWbemClientDlg
  • m_Overlapped : CNullModem
  • m_p : CSmartPtr< T > , CUtilComPtr< T >
  • m_pADs : CDlgIADs
  • m_pAgent : MainDlg
  • m_pAggISync : CAsyncFullServ
  • m_pApplet : CAppletSession
  • m_Parameters : CCommand
  • m_Params : CParameters
  • m_parent : CBicycle
  • m_pArray : WiaWrap::CComPtrArray< T >
  • m_PathNameArray : CMainFrame
  • m_PathNameCB : CCloseQueueDialog , CDeleteQueueDialog , COpenQueueDialog , CReceiveMessageDialog , CSendMessageDialog
  • m_pAttribStr : CVirtualFile
  • m_pAttributeEditor : CSCPUIBindingInfo , CSCPUIKeywords , CSCPPageBindingInfo , CSCPPageKeywords
  • m_pAttributeStr : CVirtualFile , CBaseNode
  • m_pAudioStream : CAVIFileWriter , CAVIFileReader
  • m_pAuthenticatePlugin : CAuthenticateAdmin
  • m_pAVIFile : CAVIFileWriter
  • m_pb : CTSFPersistentPropertyLoader
  • m_pBalloon : MainDlg
  • m_pbBufBeg : RecvBuf
  • m_pbBufEnd : RecvBuf
  • m_pbCurrentPos : CDBFile
  • m_pbData : CDlgDest
  • m_pbDataBeg : RecvBuf
  • m_pbDataEnd : RecvBuf
  • m_pBehavior : CEventSink
  • m_pbEOF : CDBFile
  • m_pbHeap : CFileIO
  • m_pBinding : CUrlmonCallback
  • m_pBlocks : CFixedAlloc , CLListImpl< TYPE, ARG_TYPE >
  • m_pBMapLg : CComponentData , CDelegationBase
  • m_pBMapSm : CDelegationBase , CComponentData
  • m_pbProxyData : CRow
  • m_pBrowser : ASYNC_REQUESTER
  • m_pBrowserConfig : SIMPLE_BROWSER
  • m_pbStartLoc : CRow
  • m_pBuf : TempBuffer
  • m_pBuffer : CISeqStream , CSamplePipe , CStorageBuffer , CStream
  • m_pCacheProxyCallback : CProxyPlugin::COpState
  • m_pCAggregate : CInterfaceDlg
  • m_pCallback : CCompartmentMonitor
  • m_pCallNotify : Conf
  • m_pCallObjUnk : CCallBack
  • m_pCaptureStream : CSampleMSPCall
  • m_pCatalog : CConnectDlg , CAppExportDlg , CAppInstallDlg , CAppUtilDlg , CCompImportDlg , CCompInstallDlg , CUtilitiesDlg , CVCExploreDlg
  • m_pCategoryMgr : CTSFEditWnd
  • m_pCCommand : CMDIChild
  • m_pCDataAccess : CMDIChild
  • m_pCDataGrid : CMDIChild
  • m_pCDataLinks : CMainWindow
  • m_pCDataSource : CMDIChild , CDBSession , CTable
  • m_pCEnumerator : CFullConnect
  • m_pCert : CCertPolicySample
  • m_pCFromTable : CTableCopy
  • m_pCFullConnect : CMainWindow
  • m_pch : CDialogStream
  • m_pChannelAs : tagUser
  • m_pChannelAudio : tagUser
  • m_pChannelData : tagUser
  • m_pChannelFt : tagUser
  • m_pCharacter : MainDlg , CapJ
  • m_pchData : CString
  • m_pChildren : CSampleDirectory
  • m_pClassFactory : CSDKSampleStorageSystem
  • m_pClient : CRTCWin
  • m_pCListener : CMainWindow
  • m_pCLSID : CFactoryData
  • m_pCMainWindow : CMDITrace , CMDIChild , CBase , CRowsetViewerDlg , CAppLite , CObjTree , CMDIObjects , CIntTrace
  • m_pCMallocSpy : CWinApp
  • m_pCMDIChild : CQueryBox , CBase , CRowsetViewerDlg , CDataGrid
  • m_pCMDIObjects : CMainWindow
  • m_pCMDITrace : CMainWindow
  • m_pCMultipleResults : CMDIChild
  • m_pcnp : CNotify
  • m_pcnpcnt : CNotify
  • m_pCObjTree : CMDIObjects
  • m_pColNames : CFileIO
  • m_pColorStream : CPersistStorage
  • m_pColumnID : CAlterColumnDlg
  • m_pCompartment : CCompartmentMonitor
  • m_pCompData : CStaticNode , CDeviceNode , CFolderNode , CVirtualFile
  • m_pComponent : CVirtualFile
  • m_pComponentData : CComponent , CDelegationBase , CSpaceStation , CComponent
  • m_pConf : CCallNotify , CConfNotify , CMgrNotify
  • m_pConfig : CRefClient
  • m_pConfNotify : Conf
  • m_pConnectEventObject : WiaWrap::CEventCallback
  • m_pConsDesc : CConstraintDlg
  • m_pConsoleNameSpace : CBackgroundFolder
  • m_pCont : CDlgIADsContainer
  • m_pContents : CEntity
  • m_pContext : CTSFEditWnd
  • m_pContextPlugin : CContextAdmin
  • m_pContextState : CLogFile
  • m_pCOptionsSheet : CMainWindow
  • m_pCParent : CBase
  • m_pCPC : CConnectionPoint
  • m_pCProgress : CWizard
  • m_pCPropSets : CPropertiesDlg
  • m_pCPropSheet : CPropPageLite
  • m_pCQueryBox : CMDIChild
  • m_pCreator : CRowset
  • m_pCRootBinder : CMainWindow
  • m_pCRootEnumerator : CMainWindow
  • m_pcsect : CCriticalSection
  • m_pCServiceComp : CMainWindow
  • m_pCSession : CMDIChild , CCommand
  • m_pCSource : CMainWindow , CMDIChild
  • m_pCTableCopy : CS1Dialog , CS2Dialog , CS3Dialog , CS4Dialog , CTypesDialog , CWizard
  • m_pCToTable : CTableCopy
  • m_pCTrace : CMDITrace
  • m_pCTreeRowset : CSchemaDlg
  • m_pCurrCollection : CVCExploreDlg
  • m_pCurrent : ClientList::Iterator , CEnumIDList
  • m_pCurrentThreadData : CBankDlg
  • m_pCWizard : CTableCopy , CTable
  • m_pCWndBottom : CSplitterLite
  • m_pCWndLeft : CSplitterLite
  • m_pCWndRight : CSplitterLite
  • m_pCWndTop : CSplitterLite
  • m_pData : CDataAccess
  • m_pDataAdviseHolder : CDataObject
  • m_pDataObj : CShellExt
  • m_pDataObject : COleDocument
  • m_pDBAuthPlugin : CDBAuthAdmin
  • m_pdbout : CDbAlloc
  • m_pDescripStr : CVirtualFile
  • m_pDeviceFinder : CGenericUCPDlg
  • m_pDeviceFinderCallback : CGenericUCPDlg
  • m_pDirObject : CDlgIDirectoryObject
  • m_pDisconnectEventObject : WiaWrap::CEventCallback
  • m_pDisplayAttrMgr : CTSFEditWnd
  • m_pDispMan : CLDisp
  • m_pDocMgr : CTSFEditWnd
  • m_pdoFrom : CAdminNotifyHandler
  • m_pdoTo : CAdminNotifyHandler
  • m_pDownloadUI : CDownloadBindStatusCallback
  • m_pDropTargetHelper : CDropTarget
  • m_pDS : CRefresher
  • m_pEditor : CAttributeValueEditButton , CAttributeValueEditor , CMultiValuedListBox , CAttributeValueAddButton , CAttributeValueDeleteButton
  • m_pEngine : RqsClient
  • m_pEntity : CResultset
  • m_pEnumFormatEtc : CDataObject
  • m_peo : CBasePropertyPage
  • m_PerformanceFrequency : CComSpySqlAudit
  • m_perm : CAdvClientDlg
  • m_PersistStorage : CSimpSvrObj
  • m_pEventCallback : CMainWindow
  • m_pEventClassDef : CMyEventProvider
  • m_pEvents : CRTCWin
  • m_pEventSink : CBehavior , CPlgTermSample
  • m_pextbufferAccessor : CImpIAccessor , CRowset
  • m_pExtPageUser : CWizExtUser
  • m_pFactoryData : CFactory
  • m_pFile : CFileStream
  • m_pFileio : CRow , CRowset
  • m_pFileMap : CDBFile
  • m_pFirst : CEnumIDList , CViewList
  • m_pfnDestroy : CFileViewer
  • m_pfnProgressCallback : WiaWrap::CDataCallback
  • m_pFont : CComSpy
  • m_pFormatEtc : CDataObject
  • m_pFR : CSite
  • m_pFTM : CPlgTermSample
  • m_pfUseIndexProps : CAlterIndexDlg
  • m_pGenericItemList : CGenericEnum
  • m_pGenericUCPDlg : CServiceCallback , CDeviceFinderCallback
  • m_pGuidPropertySet : CPropertiesDlg
  • m_pHandler : CImp_DrawDlg
  • m_pHandlerItems : CSettings
  • m_pHead : ClientList , ClientList::Iterator , COBLIST
  • m_pHeadNode : CList< TYPE, ARG_TYPE > , CExList< TYPE >
  • m_phMenu : CFrame
  • m_pHolder : CLDisp
  • m_pHomePageRequester : SIMPLE_BROWSER
  • m_phThread : CSyncMgrHandler
  • m_pI : CSmartComPtr< T >
  • m_pIAccessor : CRowset , CDataAccess , CCommand , CTable
  • m_pIAggregate : CBase
  • m_pIAlterIndex : CSession
  • m_pIAlterTable : CSession
  • m_pIApplet : CApplet
  • m_piApplication : CContext
  • m_pIBindResource : CBinder , CRow , CSession , CBinder , CDBSession
  • m_pIBuffer : CRowset
  • m_pICacheProxyServer : CProxyPlugin
  • m_piccCallback : CMyMemberSetChangeListener , CMyCapabilities , CMyEvictListener , CMyStartupListener
  • m_picccCallback : CMgdClusCfgInit
  • m_pIChapteredRowset : CRowset
  • m_pIColumnsInfo : CCommand , CRow , CRowset , CDataAccess
  • m_pIColumnsInfo2 : CRow
  • m_pIColumnsRowset : CDataAccess
  • m_pICommand : CCommand
  • m_pICommandPersist : CCommand
  • m_pICommandPrepare : CCommand
  • m_pICommandProperties : CCommand
  • m_pICommandStream : CCommand
  • m_pICommandText : CCommand , CDataSource , CCommand
  • m_pICommandWithParameters : CCommand
  • m_pIConnectionPoint : InkCollectorEvents , CConnectionPoint
  • m_pIConnectionPointContainer : CContainerBase
  • m_pIConvertType : CDataAccess , CCommand , CRow , CRowset
  • m_pICreateRow : CBinder , CSession , CBinder , CRow
  • m_pICrmFilesWorker : CCrmFilesTest
  • m_pICrmFilesWorkerCurrent : CCrmFilesTest
  • m_pICrmFormatLogRecords : CCrmMonComp
  • m_pICrmLogControl : CCrmFilesCompensator , CCrmFilesWorker
  • m_pICrmMonitor : CCrmMonComp
  • m_pICrmMonitorClerks : CCrmMonComp
  • m_pICrmMonitorLogRecords : CLERK_ENTRY
  • m_PID : CAppInfo
  • m_piData : CExtObject
  • m_pIDataInitialize : CServiceComp
  • m_pIDBAsynchStatus : CAsynchBase
  • m_pIDBBinderProperties : CBinder
  • m_pIDBCreateCommand : CRow , CSession , CDBSession
  • m_pIDBCreateSession : CDataSource
  • m_pIDBDataSourceAdmin : CDataSource , CPropertiesDlg
  • m_pIDBInfo : CDataSource
  • m_pIDBInitialize : CAsynchBase , CDataSource
  • m_pIDBPromptInitialize : CDataLinks
  • m_pIDBProperties : CPropertiesBase , CBinder , CDataSource
  • m_pIDBPropertyInfo : CPropertiesDlg
  • m_pIDBSchemaRowset : CSession , CDataSource
  • m_pidl : CShellView , CExtractIcon
  • m_pidlFQ : CShellFolder
  • m_pidlRel : CShellFolder
  • m_pIErrorInfo : CError
  • m_pIErrorRecords : CError
  • m_pIFileViewer : CFileViewer
  • m_pIFullServ : CAsyncFullServ
  • m_pIGetDataSource : CSession , CDBSession
  • m_pIGetRow : CRowset
  • m_pIGetSession : CRow
  • m_pIGetSourceRow : CStream
  • m_pIIndexDefinition : CSession , CDataSource
  • m_pILockBytes : CStream
  • m_pIMDDataset : CDataset
  • m_pIMDFind : CDataset
  • m_pIMDRangeRowset : CDataset
  • m_pImpIAdviseSink : CSite
  • m_pImpIOleClientSite : CSite
  • m_pImpIOleDocumentSite : CSite
  • m_pImpIOleIPSite : CSite
  • m_pIMultipleResults : CMultipleResults
  • m_pInkCollector : CMyInkCollector
  • m_pINmCall : Conf
  • m_pINmConf : Conf
  • m_pINmMgr : Conf
  • m_pInPlaceFrame : COleDocumentView
  • m_pInPlaceSite : COleDocumentView
  • m_pInPlaceUIWindow : COleDocumentView
  • m_pInputPin : CPlgFilter
  • m_pInternal : CWrapVBComponent
  • m_pIOleDocView : CSite
  • m_pIOleIPActiveObject : CFrame
  • m_pIOleIPObject : CSite
  • m_pIOleObject : CSite
  • m_pIOpenRowset : CSession , CDBSession , CDataSource
  • m_pIParseDisplayName : CEnumerator , CDataSource
  • m_pIPersist : CDataSource
  • m_pIPersistFile : CDataSource , CFileViewer
  • m_pIPlugTrans : CPluggableTransport
  • m_pIPrevVideo : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_pIPropertyPageSite : CPropertyPage
  • m_pIRecvVideo : CRTCOutgoingDlg , CRTCIncomingDlg
  • m_pIRegisterProvider : CBinder
  • m_piRequest : CContext
  • m_piResponse : CContext
  • m_pIRow : CRow
  • m_pIRowChange : CRow
  • m_pIRowPosition : CRowPosition
  • m_pIRowSchemaChange : CRow
  • m_pIRowset : CRowset , CTable , CRowset
  • m_pIRowsetBookmark : CRowset
  • m_pIRowsetChange : CRowset
  • m_pIRowsetFind : CRowset
  • m_pIRowsetIdentity : CRowset
  • m_pIRowsetIndex : CRowset
  • m_pIRowsetInfo : CRowset
  • m_pIRowsetLocate : CRowset
  • m_pIRowsetRefresh : CRowset
  • m_pIRowsetResynch : CRowset
  • m_pIRowsetScroll : CRowset
  • m_pIRowsetUpdate : CRowset
  • m_pIRowsetView : CRowset
  • m_pIRTCClient : CRTCIncomingDlg , CRTCOutgoingDlg
  • m_pIRTCParty : CRTCOutgoingDlg
  • m_pIRTCSession : CRTCOutgoingDlg , CRTCIncomingDlg
  • m_pIScopedOperations : CRow
  • m_pISequentialStream : CStream
  • m_piServer : CContext
  • m_pIService : CBase
  • m_pIServiceProvider : CDataSource
  • m_pISession : CAppletSession
  • m_piSession : CContext
  • m_pISessionProperties : CSession , CDBSession
  • m_pISourcesRowset : CEnumerator
  • m_pISQLErrorInfo : CCustomError
  • m_pIStorage : CFrame , CSite , CStream
  • m_pIStream : CSite , CStream
  • m_pISupportErrorInfo : CBase
  • m_pITableDefinition : CSession , CDataSource
  • m_pITableDefinitionWithConstraints : CSession
  • m_pItemsToSyncList : CSyncMgrHandler
  • m_pITransaction : CSession , CTransaction
  • m_pITransactionJoin : CSession
  • m_pITransactionLocal : CSession
  • m_pITransactionObject : CSession
  • m_pITransactionOptions : CTransactionOptions
  • m_pIUnknown : CBase , CInterfaceDlg
  • m_pIUnkProperties : CPropertiesDlg
  • m_pIWbemServices : CEnumStorageResource , CAdvClientDlg , CWbemClientDlg , CPartitionInfo , CStorageResource
  • m_piWizardCallback : CExtObject
  • m_pLargeInt : CDlgIADsLargeInteger
  • m_pLast : CEnumIDList , CViewList
  • m_pLastBindBase : CRowset
  • m_pLastNode : CComponent
  • m_Play : CCapMFCDlg
  • m_plCount : WiaWrap::CDataCallback
  • m_pLF : CTestDlg
  • m_pLIBID : CFactoryData
  • m_pLockHandler : CLock
  • m_pMainDlg : AgentNotifySink
  • m_pMalloc : CViewList , CDataObject , CShellFolder , CPidlMgr , CEnumIDList , CContextMenu , CDropTarget , CShellView
  • m_pMember : CRefresherMember< T >
  • m_pMgrNotify : Conf
  • m_pMyCP : CMSMQEventHandler
  • m_pMyOSPObject : MyDataSource
  • m_pNamedValues : CContextPlugin , CSDKSampleStorageSystem
  • m_pNamespace : CClassPro , CInstPro
  • m_pNameSpace : CRefClient
  • m_pNewTableID : CAlterTableDlg
  • m_pNext : CLinkable , CNode< TYPE > , CSampleDirectoryInfo
  • m_pNextItem : CGenericEnum
  • m_pNextNode : CNode< TYPE >
  • m_pNodeAttribs : CExtendPropertySheet
  • m_pNodeFree : CFixedAlloc , CLListImpl< TYPE, ARG_TYPE >
  • m_pNodeHead : CList< TYPE, ARG_TYPE > , CLListImpl< TYPE, ARG_TYPE >
  • m_pNodeTail : CLListImpl< TYPE, ARG_TYPE > , CList< TYPE, ARG_TYPE >
  • m_pNs : CMyEventProvider
  • m_pNullModem : CPSTN
  • m_pObj : CImpIPersistFile , CSite , CImpIFileViewer
  • m_pObjSafeRefCount : CStabilize
  • m_podObjData : CExtObject
  • m_pOfficeService : CAdvClientDlg , CWbemClientDlg
  • m_Point : CPoint
  • m_pointl : CDataXferObj
  • m_pOleAdviseHolder : COleDocument
  • m_pOleClientSite : COleDocument
  • m_pOleDoc : CPersistStorage , COleInPlaceObject , COleDocumentView , COleObject , CPersistFile , CDataObject , COleInPlaceActiveObject
  • m_pOleDocView : COleDocument
  • m_pOleInPlaceActiveObject : COleDocument
  • m_pOleInPlaceObject : COleDocument
  • m_pOleObject : CSpyCon , COleDocument
  • m_PolicyCriticalSection : CCertPolicySample
  • m_polytype : NewDocDlg , CPrintSDIDoc
  • m_pOpenDS : CDlgIADsOpenDSObject
  • m_PositionLabel : CCapMFCDlg
  • m_posRect : CSimpSvrObj
  • m_pOutClass : CMethodPro
  • m_pOutputList : CProvider , CAsyncQuerySink , CConsumer , CProviderFactory
  • m_pOwnerStorageSystem : CSampleDirectory , CSampleDataContainer
  • m_pPaintSite : CBehavior
  • m_pParam : CUrlmonCallback
  • m_pParent : CRocket , CComponent
  • m_pParentDlg : CConnectDlg
  • m_pParentFolder : CVirtualFile
  • m_pParentNode : CDeviceNode , CFolderNode
  • m_pParentObj : CStream , CRow , CRowset
  • m_pPathName : CSampleDirectory
  • m_pPersistFile : COleDocument
  • m_pPersistStorage : CPersistFile , COleDocument
  • m_ppHandle : CPropSheetExtension , CRocket , CBicycle
  • m_pPictureArray : CThumbNailPhotoHolder
  • m_pPidlMgr : CDataObject , CEnumIDList , CExtractIcon , CShellFolder , CContextMenu , CShellView , CDropTarget
  • m_ppIndexID : CAlterIndexDlg
  • m_ppIUnknown : CInterfaceDlg
  • m_pPlgEventSink : CPlgFilter
  • m_pPluginAdmin : CContextSamplePropPage
  • m_pPMM : CStatusHelper
  • m_ppNewIndexID : CAlterIndexDlg
  • m_pPolicy : CRequestInstance
  • m_pppStream : WiaWrap::CDataCallback
  • m_pPresentationContext : CProxyPlugin::COpState
  • m_pPrev : CNode< TYPE > , CLinkable
  • m_pPrevDocMgr : CTSFEditWnd
  • m_pPrevNode : CNode< TYPE >
  • m_pProfile : CRTCWin
  • m_pProgressCallbackParam : WiaWrap::CDataCallback
  • m_pPropList : CDlgIADsPropertyList
  • m_pProppageUIBindingInfo : CSCP
  • m_pProppageUIGeneral : CSCP
  • m_pProppageUIKeywords : CSCP
  • m_pProvider : CRefresher
  • m_ppSD : CObjSecurity
  • m_pPSTN : CPluggableTransport
  • m_ppszTable : CStringTable
  • m_ppTableID : CAlterIndexDlg
  • m_ppUnk : CDlgIADsOpenDSObject
  • m_ppwszTableName : CConstraintDlg
  • m_pQueryCallback : CAdvClientDlg
  • m_pRecentChild : CSampleDirectory
  • m_pRefresher : CRefClient
  • m_pRenderStream : CSampleMSPCall
  • m_Presentation : CGenericUCPDlg
  • m_PresentationUrl : CDeviceProp
  • m_pResultData : CBicycleFolder
  • m_prgColInfo : CDBFile , CMSOmniProvRowset
  • m_prgCP : CConnectionPointContainer
  • m_prgDisks : CEnumStorageResource
  • m_prgELT : CEnumXXX< T, ELT_T, IFACE >
  • m_prgEventIID : CConnectionPointContainer
  • m_prgfe : CEnumFormatEtc
  • m_prgLogicalDisks : CPartitionInfo
  • m_prgPartitions : CStorageResource
  • m_processList : CProcessDlg
  • m_protect : CFixedAlloc
  • m_prowbitsIBuffer : CRowset
  • m_pRowBuff : CRow
  • m_ProxyInfo : ASYNC_REQUESTER
  • m_pSampleDS : CHiPerfProvider
  • m_pScopeCookie : CComponent
  • m_pSearch : CDlgIDirectorySearch , CADsSearch
  • m_pSearchDirName : CSampleDirectory
  • m_pSecurityDesc : CDlgIADsSecurityDescriptor
  • m_pServer : CContextPlugin
  • m_pServerContext : CSDKSampleStorageSystem
  • m_pServiceCallback : CGenericUCPDlg
  • m_pServices : CTSFEditWnd
  • m_pSession : CRTCSession
  • m_psfParent : CDataObject , CDropTarget , CShellFolder , CShellView , CContextMenu
  • m_pSH : CFileViewer
  • m_psHeader : CPropSheetLite
  • m_pShellBrowser : CShellView
  • m_pSidList : CSids
  • m_pSids : CDBAuthPlugin
  • m_pSink : MainDlg , CMyEventProvider
  • m_pSite : CImpIOleClientSite , CImpIOleInPlaceSite , CCommBand , CDeskBand , CExplorerBar , CImpIAdviseSink , CToolBand , CImpIOleDocumentSite , CFrame
  • m_pSMM : CStatusHelper
  • m_pSocket : RqsClient
  • m_pSpaceStation : CRocket
  • m_psPage : CPropPageLite
  • m_pSpy : CSpyCon , CComSpyPropPage , CAppInfo , CSysLCESub
  • m_pSpyObj : CSelectEventsDlg
  • m_pSqlAudit : CComSpy
  • m_pST : CStatusHelper , CFileViewer
  • m_pStaticNode : CComponentData
  • m_pStgMedium : CDataObject
  • m_pstm : CUrlmonCallback
  • m_pStorage : CPersistStorage , CPersistFile
  • m_pStr : CBSTR
  • m_pStrArray : CSendMessageDialog , CReceiveMessageDialog , CCloseQueueDialog , COpenQueueDialog , CDeleteQueueDialog
  • m_pStream : CBicycleFolder , WiaWrap::CDataCallback , CAdvClientDlg
  • m_pStrFE : CEnumFormatEtc
  • m_pStringBuffer : CPropertiesDlg
  • m_pStrings : RqsConfig
  • m_pStubSink : CBicycleFolder
  • m_pSubClassProc : CWndLite
  • m_pSyncMgrSynchronizeCallback : CSyncMgrHandler
  • m_pSysAppInfo : CComSpy , CSelectEventsDlg
  • m_psz : BTSTR
  • m_pszAddress : RqsClient
  • m_pszBuffer : RqsClient
  • m_pszCmdLine : CAppLite , CFrame
  • m_pszCurCharID : CCapMFCDlg
  • m_pszLastIniString : CUtil
  • m_pszLibrary : RqsConfig
  • m_pszMemberName : CMember
  • m_pszMyName : CAppletSession
  • m_pszObjectName : CObjSecurity
  • m_pszPath : CFileViewer
  • m_pszPathName : CSampleDataContainer
  • m_pszRangeDelimiter : CUrlmonCallback
  • m_pszServerName : CObjSecurity
  • m_pszString : RqsClient
  • m_pszStrings : CStringTable
  • m_pszUsername : RqsClient , CUtil
  • m_pszVal : CUtilString
  • m_pszwHelpPath : CComponentData
  • m_pszwName : CSampleDirectoryInfo
  • m_pTableID : CAlterTableDlg , CAlterColumnDlg
  • m_pTail : ClientList , COBLIST , ClientList::Iterator
  • m_pTailNode : CList< TYPE, ARG_TYPE > , CExList< TYPE >
  • m_pTaskList : CEnumTASK
  • m_ptButDown : CSimpleDoc
  • m_pTemplate : CHiPerfProvider
  • m_ptGridLT : CInkInputWnd
  • m_pThreadMgr : CTSFEditWnd
  • m_ptLast : CDrawArea
  • m_ptPolyCorners : CBehavior
  • m_ptPosInCaption : CDlgDest , CDlgSrc
  • m_ptrReady : CBicycleFolder , CAdvClientDlg
  • m_pTSFEditWnd : CTSFMainWnd
  • m_pTypeInfo : HelloWorld
  • m_pUnk : CADQIDlg , CNotify
  • m_punkFTM : InkCollectorEvents
  • m_pUnkMarshaler : CSimple , CCrmDebugCompensator , CCrmMonComp , CLDisp , CPower , CProxy , CComSpySqlAudit
  • m_pUnknown : CPerson
  • m_pUnknownOuter : CUnknown
  • m_pUnkOuter : CImpIOleClientSite , CImpIOleInPlaceSite , CBaseObj , CImpIFileViewer , CImpIAdviseSink , CImpIPersistFile , CImpIOleDocumentSite , CFileViewer , CDataSource
  • m_pUnsecApp : CBicycleFolder
  • m_pUtilProp : CBinder , CDataSource , CCommand , CRowset , CDBSession
  • m_pv : CAddrNode
  • m_pVar : CResultset
  • m_pvData : CDlgSrc
  • m_pvInput : CFileIO
  • m_pvlValues : CClusPropList
  • m_pvsi : CFileViewer
  • m_pWaveFormat : CAVIFileReader
  • m_pWbemSvcs : CMethodPro
  • m_pWin : CRTCSession
  • m_pWizExt : CSCPPageKeywords , CSCPPageGeneral , CSCPPageBindingInfo , CExtPageUser
  • m_pWizPage1 : CSCPWiz
  • m_pWizPage2 : CSCPWiz
  • m_pWizPage3 : CSCPWiz
  • m_pWMSAuthenticationPlugin : CAuthenticateContext
  • m_pwndParent : CDlgDest , CDlgSrc
  • m_pWritableAttrs : CSCPUIGeneral , CSCPUIKeywords , CSCPUIBindingInfo , CProppageUserUI
  • m_pwszCatalog : CDataSource
  • m_pwszCatalogLocation : CDataSource
  • m_pwszCatalogTerm : CDataSource
  • m_pwszClassName : CWndLite
  • m_pwszConfig : CMDIChild
  • m_pwszDataSource : CDataSource
  • m_pwszDBMS : CDataSource
  • m_pwszDBMSVer : CDataSource
  • m_pwszFile : CPersistFile
  • m_pwszFileName : CSmpFilter
  • m_pwszFilename : CPack
  • m_pwszInitString : CServiceComp
  • m_pwszNewLine : CConsole
  • m_pwszNextProxies : ASYNC_REQUESTER
  • m_pwszNodeName : CBaseNode
  • m_pwszPrefix : CPropSheetHost
  • m_pwszProviderFileName : CDataSource
  • m_pwszProviderName : CDataSource
  • m_pwszProviderOLEDBVer : CDataSource
  • m_pwszProviderParseName : CDataSource
  • m_pwszProviderVer : CDataSource
  • m_pwszRegStorageLoc : CCertExitSample
  • m_pwszSchemaTerm : CDataSource
  • m_pwszTableTerm : CDataSource
  • m_pwszText : CTSFDataObject
  • m_pwszTitle : CEditValueDlg , CInterfaceDlg
  • m_pwszURL : CBinder
  • m_pwszUrl : ASYNC_REQUESTER
  • m_pwszVal : CUtilString
  • m_pwszValue : CEditValueDlg
  • m_pX224 : CPluggableTransport
  • m_qevent : CImp_DrawDlg
  • m_qFriend : CImp_DrawDlg
  • m_qFunc : RqsEngine
  • m_querySession : CQueryDlg
  • m_QueryVariable : CGenericUCPDlg
  • m_queue : CImp_DrawDlg
  • m_qwFileSize : CSampleDataContainer
  • m_qwSize : CSampleDirectoryInfo
  • m_rcDrawnBox : CInkInputWnd
  • m_rcIcon : AboutDlg
  • m_RDI : CBaseNode
  • m_ReadBuffer : ASYNC_REQUESTER
  • m_realWMI : CBicycleFolder
  • m_RecipientName : FaxDlg
  • m_Rect : COleDocumentView
  • m_red : CSimpSvrObj
  • m_redNose : Deers
  • m_ReferenceCount : CProvider_IWbemUnboundObjectSink , CProvider_IWbemEventProvider , CProvider_IWbemServices , CProvider_IWbemEventConsumerProvider
  • m_refs : CDbAlloc , CStdDbOutput
  • m_Registrar : ThreadArg_Struct
  • m_RegistryName : CFactoryData
  • m_regPerm : CAdvClientDlg
  • m_regTemp : CAdvClientDlg
  • m_requestHead : RSProxy
  • m_RequestID : HelloJ , Notify , Hello2J , Hello3J
  • m_requestLock : RSProxy
  • m_responseHead : RSProxy
  • m_responseLock : RSProxy
  • m_responseTail : RSProxy
  • m_rganode : CDbAlloc
  • m_rgAttributes : CTSFEditWnd
  • m_rgAxisInfo : CDataset
  • m_rgbBit : CBitArray
  • m_rgbBitMask : CBitArray
  • m_rgbRowData : CRowset
  • m_rgch : CStdDbOutput
  • m_rgchSig : CDbAlloc
  • m_rgchUserName : CSecureObject
  • m_rgColAccess : CRow
  • m_rgColDesc : CTable
  • m_rgCompositions : CTSFEditWnd
  • m_rgdbcolinfo : CFileIO
  • m_rgDex : CFileIdx
  • m_rgDialogSteps : CWizard
  • m_rgdwDataOffsets : CFileIO
  • m_rgElements : CVector< TYPE, IDX >
  • m_rgEnumInfo : CEnumerator
  • m_rgExtracolinfo : CRow
  • m_rgfSigned : CFileIO
  • m_rgGuidMaps : CComboBoxGuid
  • m_rgIndexInfo : CTable
  • m_rgItem : CExtBuffer
  • m_rgPageHandles : CPropSheetHost
  • m_rgpColNames : CFileIO
  • m_rgpColumnData : CFileIO
  • m_rgproperties : CUtilProp
  • m_rgPropInfoSets : CPropertiesDlg
  • m_rgProps : CFileShareSampleParamsPage
  • m_rgProviderInfo : CDataSource
  • m_rgProvTypes : CSession
  • m_rgprtcPSPages : CObjData
  • m_rgprtcWizPages : CObjData
  • m_rgpwszTableName : MyDataSource
  • m_rgResName : CSchemaDlg
  • m_rgRestrictions : CSchemaDlg
  • m_rgRestrictionSupport : CSchemaDlg
  • m_rgResType : CSchemaDlg
  • m_rgResValue : CSchemaDlg
  • m_rgSchemas : CSchemaDlg
  • m_rgsdwMaxLen : CFileIO
  • m_rgswColType : CFileIO
  • m_rgTableInfo : CS1Dialog
  • m_rgudwColSize : CFileIO
  • m_rOSPObject : MyDataSource
  • m_Rows : CDBFile
  • m_RS : Query
  • m_rsTable : MyOSPObject
  • m_rtElemCorners : CBehavior
  • m_running : CBicycleFolder , CBackgroundFolder
  • m_rvTable : MyOSPObject
  • m_rwlConfig : RqsEngine
  • m_sADsPath : CDlgIADs , CDlgIADsOpenDSObject , CADQIDlg , CMoveDlg
  • m_sAgentMajor : AboutDlg
  • m_sAgentMinor : AboutDlg
  • m_sAppID : CAppInfo
  • m_sAppName : CAppInfo
  • m_sAttr : CGetInfoExDlg
  • m_sAttribute : CDlgIADsPropertyList
  • m_sAttributes : CDlgIDirectoryObject
  • m_sAttrText : CGetInfoExDlg
  • m_scale : CSimpSvrObj
  • m_SchemaInfo : CADVCGENDlg , CSchemaDlg
  • m_sClass : CDlgIADs , CDlgIDirectoryObject
  • m_sClassList : CDlgIADsContainer
  • m_sColumnList : CADsSearch
  • m_scopeitem : CBackgroundFolder
  • m_SCPDURL : CGenericUCPDlg
  • m_sDataMember : MyDataSource
  • m_sDelete : CDeleteObjectDlg
  • m_SDI : CBaseNode
  • m_sDN : CDlgIDirectoryObject
  • m_sDSN : CAccount , CUpdateReceipt
  • m_search : CDlgIADsSecurityDescriptor
  • m_sendMessage : CMessageDlg
  • m_SerialNumber : CDeviceProp
  • m_serverList2 : CServerDlg
  • m_serverName : CMessageDlg
  • m_ServerName : CAPIDoc
  • m_serverName : CQueryDlg , CShutdownDlg , CWaitSystemDlg , CSessionDlg , CProcessDlg
  • m_Service : ThreadArg_Struct
  • m_ServiceCombo : CGenericUCPDlg
  • m_sessionInfo : CQueryDlg
  • m_sessionList : CSessionDlg
  • m_SessionList : CRTCWin
  • m_SessionType : CRTCOutgoingDlg
  • m_SetStatusCalled : CAsyncQuerySink
  • m_sFilePath : MyOSPObject
  • m_sFilter : CDlgIADsContainer , CDlgIDirectorySearch
  • m_Sfx : CCapMFCDlg
  • m_sGUID : CDlgIADs
  • m_shutdown : CShutdownDlg
  • m_sidMyself : CAppletSession
  • m_Singleton : CRTCAVSession
  • m_Sink : ThreadArg_Struct , Hello3J , Hello2J
  • m_SinkID : Hello3J , Hello2J
  • m_size : CSimpSvrObj
  • m_sizeInitPos : CChildView
  • m_sizel : CDataXferObj , CSimpleSite
  • m_SKU : COfficeDlg
  • m_sLogFile : CComSpy
  • m_sName : CDlgIADs , CRenameDlg
  • m_sNewName : CRenameDlg
  • m_sOldName : CRenameDlg
  • m_spADObject : CPropSheetHost
  • m_spADsContainerObj : CWizExtUser , CSCPWiz
  • m_spADsCopySourceObj : CWizExtUser , CSCPWiz
  • m_spADsObj : CWizExtUser , CSCPWiz
  • m_sParent : CDlgIADs , CDlgIDirectoryObject
  • m_sPassword : CDlgIADsOpenDSObject
  • m_spClassFactory : CSDKSamplePlaylistParserPlugin , CSDKSamplePlaylistParser
  • m_spCommandContext : CSDKSamplePlaylistParser
  • m_spCommentEditBox : CAnnotator
  • m_spConnection : CProxy
  • m_spDataObj : CSCPCMenuDialog , CContextMenu , CProppageUser , CSCP
  • m_spDesigner : CAnnotator
  • m_spDoc : CBehavior , CBrowserHost , CAnnotator
  • m_spDsAdminNewObj : CSCPWiz , CWizExtUser
  • m_spDsAdminNewObjPrimarySite : CSCPWiz
  • m_spDsObj : CSCPUIKeywords , CSCPUIBindingInfo , CProppageUserUI , CSCPUIGeneral
  • m_Speak : CCapMFCDlg
  • m_SpeakText : CCapMFCDlg
  • m_SpeechOutputLabel : CCapMFCDlg
  • m_spElem : CBehavior
  • m_spGrid : CBrowserHost
  • m_spIInkCollector : CAdvRecoApp , CMultiRecoApp
  • m_spIInkCustomStrokes : CMultiRecoApp
  • m_spIInkDisp : CAdvRecoApp , CMultiRecoApp
  • m_spIInkRecoContext : CMultiRecoApp , CAdvRecoApp
  • m_spIInkRecognizers : CAdvRecoApp , CMultiRecoApp
  • m_spIInkRecoGuide : CAdvRecoApp
  • m_spIInkRecoGuideBoxed : CMultiRecoApp
  • m_spIInkRecoGuideLined : CMultiRecoApp
  • m_spIInkRenderer : CAdvRecoApp
  • m_spIInkStrokes : CAdvRecoApp , CMultiRecoApp
  • m_spInPlaceObject : CBrowserHost
  • m_spLoadStream : CWebBrowser
  • m_spNamedValues : CSDKSamplePlaylistParserPlugin , CDBAuthPlugin , CSDKSamplePlaylistParser , CAuthenticatePlugin
  • m_spObjectContext : CRDOComponent , CADOComponent , COLEDBComponent , CPooledData , CCrmFilesTest
  • m_spOleCmdTarg : CBrowserHost
  • m_spOleObject : CWebBrowser
  • m_spOMSite : CBehavior
  • m_spPaintSite : CGrid
  • m_spParent : CBehavior
  • m_spPresentationContext : CSDKSamplePlaylistParser
  • m_spSel : CBehavior
  • m_spServer : CDBAuthPlugin
  • m_spServerContext : CSDKSamplePlaylistParserPlugin , CSDKSamplePlaylistParser
  • m_spSite : CBehavior , CGrid
  • m_spSnap : CBrowserHost
  • m_spSrcElem : CAnnotator
  • m_spUnkInner : CAggregate
  • m_spUserContext : CSDKSamplePlaylistParser
  • m_spWebBrowser : CBrowserHost
  • m_spWebBrowser2 : CWebBrowser
  • m_spWin : CBehavior
  • m_spXMLDocument : CXmlDOM
  • m_SQLEditBox : CADVCGENDlg
  • m_SqlText : Query
  • m_srchInfo : CADsSearch
  • m_sRDN : CDlgIDirectoryObject , CDeleteObjectDlg
  • m_sSchema : CDlgIDirectoryObject , CDlgIADs
  • m_sServer : RqsEngine
  • m_sSortOn : CDlgIDirectorySearch
  • m_sSQL : CComSpySqlAudit
  • m_sStart : CTIMER
  • m_sStop : CTIMER
  • m_StartDiscovery : CGenericUCPDlg
  • m_State : RqsClient , ASYNC_REQUESTER
  • m_state : CAsyncTest
  • m_State : Object_Property , CAuthenticateContext
  • m_staticIcon : CBasePropertyPage
  • m_staticTitle : CBasePropertyPage
  • m_StatusText : CGenericUCPDlg
  • m_stkClassFactories : CSurrogate
  • m_Stop : CCapMFCDlg
  • m_StopBeforePlay : CCapMFCDlg
  • m_stopThread : CAdvClientDlg
  • m_str : CComWSTR
  • m_strBody : CSendMessageDialog
  • m_strCAName : CCertExitSample , CCertPolicySample
  • m_strCASanitizedDSName : CCertPolicySample
  • m_strCASanitizedName : CCertPolicySample
  • m_strChannelMask : CDlgDest
  • m_strClusterName : CClusterData
  • m_strCmdText : CCommand
  • m_strDescription : CCertExitSample , CCertPolicySample
  • m_strError : CStringException
  • m_strFriend : CDisdrawDlg
  • m_StringType : CCertEncodeStringArray
  • m_strLabel : CCreateQueueDialog , CSendMessageDialog
  • m_strLogin : CLoginDlg , CConnectDlg , CDisdrawDlg
  • m_strMachineDNSName : CCertPolicySample
  • m_strName : CObjData , CDlgSrc
  • m_strObjectDesc : CBase
  • m_strPath : CFileShareSampleParamsPage
  • m_strPathName : CCreateQueueDialog
  • m_strPrevPath : CFileShareSampleParamsPage
  • m_strPrevRemark : CFileShareSampleParamsPage
  • m_strPrevShareName : CFileShareSampleParamsPage
  • m_strrefAttributeList : CMultiValuedAttributeEditor
  • m_strRegStorageLoc : CCertPolicySample
  • m_strRemark : CFileShareSampleParamsPage
  • m_strRemoteComputerName : CImp_DrawDlg , CDisdrawDlg
  • m_strResTypeName : CResData
  • m_strShareName : CFileShareSampleParamsPage
  • m_strTemplateName : CRequestInstance
  • m_strTemplateObjId : CRequestInstance
  • m_strTitle : CBasePropertyPage
  • m_SubscriptionGuid : CSysLCESub
  • m_sum : CAsyncFullServ
  • m_sUserName : CDlgIADsOpenDSObject , CADQIApp
  • m_szAdminPathName : CSendMessageDialog
  • m_szADsPath : CSCPCMenuDialog
  • m_szAppName : CFactoryData
  • m_szBindingInfo : CSCPUIGeneral
  • m_szCaption : CDownloadUI
  • m_szClass : CSCPUIGeneral , CSCPCMenuDialog , CSCPUIBindingInfo , CSCPUIKeywords , CProppageUserUI
  • m_szClassName : CWizExtUser , CSCPWiz
  • m_szComPortName : CPSTN
  • m_szConnID : CPluggableTransport
  • m_szContCanonicalName : CWizExtUser , CSCPWiz
  • m_szDatabase : CImportRes , CGenerateRC
  • m_szDescription : CSCPUIGeneral
  • m_szDLLFile : CImportRes
  • m_szFilePath : MyOSPObject
  • m_szFileUserClickedOn : CShellExt
  • m_szFormatName : COpenQueueDialog
  • m_szGuideBox : CAdvRecoApp
  • m_szHiddenWindowClass : CPropSheetHost
  • m_szHostName : CX224
  • m_szInternalAddress : RqsEngine
  • m_szLabel : CLocateDialog
  • m_szName : CSCPPageGeneral
  • m_szname : CFactoryData
  • m_szOrigDb : CGenerateRC , CImportRes
  • m_szPath : CProppageUserUI , CSCPUIBindingInfo , CSCPUIKeywords , CEnumIDList , CSCPUIGeneral
  • m_szPathName : CCloseQueueDialog , CSendMessageDialog , CReceiveMessageDialog , CDeleteQueueDialog , COpenQueueDialog
  • m_szPrefix : CSCPCMenuDialog
  • m_szProgID : CFactoryData
  • m_szPropSheetFileUserClickedOn : CShellExt
  • m_szServer : CSCPCMenuDialog
  • m_szServerConfigPath : CSCPCMenuDialog
  • m_szServiceClassName : CSCPPageGeneral , CSCPUIGeneral
  • m_szServiceDNSName : CSCPPageGeneral , CSCPUIGeneral
  • m_szServiceDNSNameType : CSCPUIGeneral , CSCPPageGeneral
  • m_szTblNm : CDBFile
  • m_szText : NewDocDlg , CPrintSDIDoc
  • m_szTitle : CSCPWiz , CWizExtUser
  • m_szTmpBuf : TempBuffer
  • m_szUsername : CSCPCMenuDialog
  • m_szValueList : CSCPPageBindingInfo , CSCPPageKeywords , CSCPUIKeywords , CSCPUIBindingInfo
  • m_szVerIndProgID : CFactoryData
  • m_szWritingBox : CInkInputWnd
  • m_TableInfo : CTable
  • m_TableListBox : CADVCGENDlg
  • m_tabParamSets : CExecuteParamDlg
  • m_TaskCount : CEnumTASK
  • m_tcsPropertyName : tagProperties
  • m_td : CThreadData
  • m_temp : CAdvClientDlg
  • m_tfClientID : CTSFEditWnd , CTSFMainWnd
  • m_thisGUID : CStaticNode , CVirtualFile , CDeviceNode , CFolderNode
  • m_thread : CAdvClientDlg , CBackgroundFolder , CBicycleFolder
  • m_threadCmd : CBicycleFolder
  • m_ThreadHandle : CProvider_IWbemEventProvider
  • m_threadId : CAdvClientDlg , CBicycleFolder , CBackgroundFolder
  • m_ThreadTerminate : CProvider_IWbemEventProvider
  • m_thumbNailPhotoHolder : CExtPageUser , CProppageUserUI
  • m_TimeRemaining : ASYNC_REQUESTER
  • m_timerId : CMMCControl
  • m_tree : CXMLTreeDlg
  • m_txuow : CAccount , CUpdateReceipt , CPooledData
  • m_Type : Object_Property , CEntity
  • m_uContext : CDataObject
  • m_uCookie : CDataObject
  • m_UDN : CDeviceProp
  • m_uiBytesRead : RqsClient
  • m_uiCount : RqsConfig
  • m_uIDBlank : CStatusHelper
  • m_uIDCur : CStatusHelper
  • m_uIDD : CDialogLite
  • m_uidMember : CMember
  • m_uidMyself : CAppletSession
  • m_uIDPopupMax : CStatusHelper
  • m_uIDPopupMin : CStatusHelper
  • m_uIDStatic : CStatusHelper
  • m_uIDSysMenu : CStatusHelper
  • m_uiMessageSize : RqsClient
  • m_uiPort : RqsConfig
  • m_uItemCount : CContextMenu , CDataObject
  • m_ulActiveSessions : CDataSource
  • m_ulBlobSize : CTableCopy
  • m_ulBufferLen : CSmpFilter
  • m_ulCharsRead : CSmpFilter
  • m_ulChunkID : CSmpFilter
  • m_ulClientCount : RqsEngine
  • m_ulCodePage : CSmpFilter
  • m_ulDataTypeOffset : CFileIO
  • m_ulDexCnt : CFileIdx
  • m_ulDialogId : CSimpleDialog
  • m_ulElements : CExList< TYPE > , CList< TYPE, ARG_TYPE >
  • m_ulGrowSize : CVector< TYPE, IDX >
  • m_ulLowerBound : CVector< TYPE, IDX >
  • m_ulMaxRows : CTableCopy
  • m_ulMaxSize : CVector< TYPE, IDX >
  • m_ulNestingLevel : CIntTrace
  • m_ulParamSets : CTableCopy
  • m_ulPartitionSize : CPartitionInfo
  • m_ulProgressMax : CDownloadUI
  • m_ulProgressSoFar : CDownloadBindStatusCallback , CDownloadUI
  • m_ulRowRefCount : CRowset
  • m_ulSCSIBus : CStorageResource
  • m_ulSCSILun : CStorageResource
  • m_ulSCSIPort : CStorageResource
  • m_ulSCSITid : CStorageResource
  • m_uNodeTypeFlg : CDataObject
  • m_UPC : CDeviceProp
  • m_User : CProvider_IWbemEventProvider , CProvider_IWbemServices , CProvider_IWbemEventConsumerProvider
  • m_uState : CShellView
  • m_vActivityId : CCrmMonComp
  • m_Value : Object_Property
  • m_value : CAssoc< KEY, VALUE >
  • m_ValueEditor : CMultiValuedAttributeEditor
  • m_ValueList : CMultiValuedAttributeEditor
  • m_varContext : CProxyPlugin::COpState
  • m_VariableName : CGenericUCPDlg
  • m_VarVect : CDynamic
  • m_vDataSource : CDSLConnectionPage
  • m_vecClerks : CCrmMonComp
  • m_veclItemId : COrder , COShip2 , CONotify , COShip
  • m_veclQuantity : COrder , COShip2 , CONotify , COShip
  • m_vecParams : CExecuteParamDlg
  • m_vecShipStatus : COShip , COShip2 , CONotify
  • m_vecValues : CExecuteParamDlg
  • m_ViewSCPD : CGenericUCPDlg
  • m_vIndex : CLERK_ENTRY
  • m_vListeners : MyDataSource , MyOSPObject
  • m_vtFriendName : CImp_DrawDlg
  • m_vtguidDraw : CImp_DrawDlg
  • m_vtLogin : CImp_DrawDlg
  • m_vTxUOWRequired : CCrmMonComp
  • m_WaitID : Hello3J
  • m_wBindingType : COptionsSheet
  • m_wchFile : CMultiRecoApp
  • m_wchFileTitle : CMultiRecoApp
  • m_wClient : CObjSecurity
  • m_wcsBuffer : CSmpFilter
  • m_wcsFormatNameList : CDisdrawDlg
  • m_wcsName : CCounterData
  • m_weight : Deers
  • m_wfExt : CDlgDest
  • m_wfx : CDlgSrc
  • m_wfxFormat : CPlgPin
  • m_Win32_ProcessEx_Object : CProvider_IWbemServices
  • m_wmsContexts : CContextPlugin
  • m_wmsContextTypes : CContextSamplePropPage
  • m_wmsOrigContextTypes : CContextSamplePropPage
  • m_wndAddressBox : CBrowserHost
  • m_wndBox1 : CBrowserHost
  • m_wndBox2 : CBrowserHost
  • m_wndBox3 : CBrowserHost
  • m_wndBox4 : CBrowserHost
  • m_wndButton1 : CBrowserHost
  • m_wndButton2 : CBrowserHost
  • m_wndButton3 : CBrowserHost
  • m_wndButton4 : CBrowserHost
  • m_wndButton5 : CBrowserHost
  • m_wndButton6 : CBrowserHost
  • m_wndButton7 : CBrowserHost
  • m_wndCheckBox : CBrowserHost
  • m_wndDlgBar : CMainFrame
  • m_wndIncrementCombo : CBrowserHost
  • m_wndInput : CMultiRecoApp , CAdvRecoApp
  • m_wndLeftBand : CBrowserHost
  • m_wndPlacement : CWndLite
  • m_wndResults : CAdvRecoApp , CMultiRecoApp
  • m_wndStatusBar : CBrowserHost , CMainFrame
  • m_wndToolBar : CBrowserHost , CMainFrame
  • m_wndTopBand : CBrowserHost
  • m_wndUrlCombo : CBrowserHost
  • m_wndView : CMainFrame
  • m_WorkItemQueue : ISAPITHREAD
  • m_wp : CSpyCon
  • m_wpListBox : MainDlg
  • m_wpMoveX : MainDlg
  • m_wpMoveY : MainDlg
  • m_wpOrigEditProc : CRTCIMSession
  • m_wPort : CProxyPlugin::COpState
  • m_wpSpeakText : MainDlg
  • m_wReqType : CEditValueDlg
  • m_wszASPRevocationURL : CCertPolicySample
  • m_wszCatalog : CFullConnectProperties
  • m_wszConfigName : CFullConnect
  • m_wszConnection : CODBCData
  • m_wszDataSource : CFullConnectProvider
  • m_wszDataSourcePath : CRowset
  • m_wszDeleteStoredProc : CProxy , CResultset , CEntity
  • m_wszFilePath : CRowset , CUtilProp
  • m_wszIDQuote : CTable
  • m_wszIDSeperator : CTable
  • m_wszInsertStoredProc : CProxy , CEntity , CResultset
  • m_wszIntegrated : CFullConnectSecurity
  • m_wszKeyField : CProxy , CEntity , CResultset
  • m_wszLastCmd : CCmdLineLite
  • m_wszLocation : CFullConnectProvider
  • m_wszPassword : CFullConnectProvider , CImpAuth
  • m_wszPath : CDataSource
  • m_wszProvString : CFullConnectProperties
  • m_wszQualTableName : CTable
  • m_wszReadStoredProc : CResultset , CProxy , CEntity
  • m_wszRegStorageLoc : CCertPolicySample , CCertExitSample
  • m_wszRemoteServer : CFullConnectOptions , COptionsSheet
  • m_wszSourceFileName : CCrmFilesCompensator
  • m_wszTempFile : CPack
  • m_wszTempFileName : CCrmFilesCompensator
  • m_wszUpdateStoredProc : CEntity , CProxy , CResultset
  • m_wszUserID : CFullConnectProvider
  • m_wszUserName : CImpAuth
  • m_wType : CStream
  • m_wValidBitsPerSample : CDlgDest
  • m_wzStatus : CDeviceNode
  • m_XLabel : CCapMFCDlg
  • m_xOffset : CSimpSvrObj
  • m_xPos : CFileViewer
  • m_YLabel : CCapMFCDlg
  • m_yOffset : CSimpSvrObj
  • m_yPos : CFileViewer
  • mainMenu
: InkClipboard::InkClipboard
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, PaperForm::PaperForm
, Sample::UI::MainWindow
  • mainMenu1 : InkHitTest::InkHitTest , CapJ
  • margin : PrintContext
  • mask : ENUMSYMDATA
  • MAX_RECENT_FILENAME : CapJ
  • MAX_RECENT_FILES : CapJ
  • max_repetitions : GlobalVars
  • max_resp_time : igmp_hdr_query_v3 , igmp_hdr
  • MaxChainLength : _LSP_ENTRY
  • MaximumLength : _UNICODE_STRING
  • maxrest : view
  • MaxStrLen : GLOBAL_STRUCT
  • maxtag : view
  • mc_AtlFuncInfo : IInkCollectorEventsImpl< T > , IInkRecognitionEventsImpl< T >
  • mc_crColors : CMultiRecoApp
  • mcRef : CObject , CClassFactory
  • MediaID : STL_LABEL
  • MediumInkWidth
: Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, InkClipboard::InkClipboard
, InkErase::InkErase
, InkCollection::InkCollection
  • MenuBar : Serialization::SerializationForm
  • menuItem1 : CapJ
  • menuItem4 : PaperForm::PaperForm
  • MessageId : _SIGNATURE
  • MessageType : _MSV1_0_INTERACTIVE_LOGON , _MESSAGE
  • miAction : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • miActionSeparator : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miAutomaticLayoutAnalysis : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • MibFunc : mib_entry
  • miBlack : InkCollection::InkCollection , InkClipboard::InkClipboard
  • miBlue : InkCollection::InkCollection , InkClipboard::InkClipboard
  • miBMP : InkClipboard::InkClipboard
  • MibNext : mib_entry
  • miClear
: RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkClipboard::InkClipboard
, PaperForm::PaperForm
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, InkErase::InkErase
  • miColor : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miCopy : InkClipboard::InkClipboard
  • miCuspErase : InkErase::InkErase
  • miCut : InkClipboard::InkClipboard
  • miDivide : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miEdit : PaperForm::PaperForm
  • miEditSeparator : InkClipboard::InkClipboard
  • miEMF : InkClipboard::InkClipboard
  • miEnabled : InkCollection::InkCollection
  • miErase : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miEraser : PaperForm::PaperForm
  • miExit
: Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkClipboard::InkClipboard
, InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, PaperForm::PaperForm
, InkErase::InkErase
, InkHitTest::InkHitTest
  • miFile : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom , Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miFormatSeparator : InkClipboard::InkClipboard
  • miGreen : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miInk
: Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, PaperForm::PaperForm
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, InkErase::InkErase
, InkClipboard::InkClipboard
  • miInkSeparator : InkClipboard::InkClipboard
  • miIntersectErase : InkErase::InkErase
  • miISF : InkClipboard::InkClipboard
  • miLassoSelect : InkClipboard::InkClipboard
  • miMain
: InkCollection::InkCollection
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, InkErase::InkErase
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miMainAction : InkErase::InkErase , InkClipboard::InkClipboard
  • miMainEdit : InkClipboard::InkClipboard
  • miMainFile : InkCollection::InkCollection
  • miMainFormat : InkClipboard::InkClipboard
  • miMainInk : InkCollection::InkCollection
  • miMainMode : InkErase::InkErase
  • miMedium : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miMetafile : InkClipboard::InkClipboard
  • miMode : PaperForm::PaperForm , Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miModeSepararator : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miNoOLE : InkClipboard::InkClipboard
  • mint : _DOSDTTM , _SFFS
  • miOther : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miPaste : InkClipboard::InkClipboard
  • miPen : PaperForm::PaperForm
  • miRecognize : PaperForm::PaperForm
  • miRed : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miScalePenWidth : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • miSeparate : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • miSeparator : RealTimeStylusPluginApp::RealTimeStylusPluginApp , InkErase::InkErase
  • miSInk : InkClipboard::InkClipboard
  • miStrokeErase : InkErase::InkErase
  • miStyle : InkClipboard::InkClipboard
  • miThick : InkCollection::InkCollection , InkClipboard::InkClipboard
  • miThin : InkClipboard::InkClipboard , InkCollection::InkCollection
  • miTInk : InkClipboard::InkClipboard
  • miWidth : InkCollection::InkCollection , InkClipboard::InkClipboard
  • miZoomToRect : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • MK_LBUTTON : Notify
  • mMessage : _EVENT_ENTRY
  • mmrcLastErr : tag_seq
  • mode : InkHitTest::InkHitTest , InkErase::InkErase
  • Mode : tagTrackObject
  • ModeItem : InkHitTest::InkHitTest
  • mon : _SFFS
  • month : _DOSDTTM
  • mouseDown : CEventSink
  • Move : CapJ
  • msBase : tag_tempomapentry
  • mtHeaderSize : tagMETA16HEADER
  • mtMaxRecord : tagMETA16HEADER
  • mtNoObjects : tagMETA16HEADER
  • mtNoParameters : tagMETA16HEADER
  • mtSize : tagMETA16HEADER
  • mtType : tagMETA16HEADER
  • mtVersion : tagMETA16HEADER
  • MyChangeEventHandler : CacheProxySamplePlugin::CacheProxyPlugin
  • myColor : AutoClaims::InkLayer
  • myDrawingBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myDynamicRenderer : InkCollection::InkCollection
  • myGraphics : RealTimeStylusPlugins::CustomDynamicRendererPlugin
  • myHidden : AutoClaims::InkLayer
  • myInk : AutoClaims::InkLayer , InkCollection::InkCollection
  • myInkCollector
: InkCollection::InkCollection
, InkRecognition::InkRecognition
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, InkClipboard::InkClipboard
, InkErase::InkErase
  • myInkDivider : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myInkOverlay : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myLineBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myPackets : InkCollection::InkCollection
  • myParagraphBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • myRealTimeStylus : InkCollection::InkCollection , RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • myRecognizers : InkRecognition::InkRecognition
  • myRenderer : InkCollection::InkCollection
  • myWordBoundingBoxes : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- n -

  • n : UnionInt64
  • nAddr : tagLINEINFO
  • nAllocated : _Queue
  • nAllocLength : CStringData , _tagPOSDATA
  • name : FLAGMAPPING
  • Name : _CommandVtbl , WRTHANDLE
  • name : diritem , _CONNECTEXARGS
  • nameLabel : About
  • namelen : _CONNECTEXARGS
  • nAmount : THREADDATA
  • nAppletUserID : tagAppletRecord
  • nBezCurr : _POLYDATA
  • nBezTotal : _POLYDATA
  • nBlockSize : NODE_PROPERTIES
  • nBPP : WININFO
  • nBufferLength : _tagPOSDATA
  • nBufferPos : _tagPOSDATA
  • nBufSize : _OPTIONS
  • nBytesOutstanding : tReq
  • nBytesRecd : _ClientContext
  • nBytesRemainingToBeSent : _ClientContext
  • ncells : CellDataList , TableSelection
  • nChannelID : IAppletSessionNotifyVtbl , IAppletSessionVtbl , tagAppletRegistryRequest , tagAppletChannelRequest , tagAppletRegistryItem , IAppletSessionNotifyVtbl
  • nChar : tagMULTI_SZ
  • nchars : ColProps , CellData
  • nChildCount : NODE_PROPERTIES
  • nColor : _POLYDATA
  • ncols : TableHdr , ColPropsList
  • nConfID : IAppletNotifyVtbl , IAppletVtbl , INVOKE_INFO
  • nCurrentPos : _tagPOSDATA
  • nDataBindLen : tagFieldMetaData
  • nDataLen : tagFieldMetaData
  • nDataLength : CStringData
  • NearestPointItem : InkHitTest::InkHitTest
  • nearestPt : InkHitTest::InkHitTest
  • nElementCount : _TRANSMITPACKETSARGS
  • nEntityID : tagAppletRecord
  • nError : _SNMP_MGR_SESSION
  • nErrorIndex : _SNMP_MGR_SESSION
  • nErrorStatus : _SNMP_MGR_SESSION
  • NEW_EVENT_DLL : helper::sampleConstants
  • NewMenu : Serialization::SerializationForm
  • NewValue : tagDescInfo
  • next : _WSAOVERLAPPEDPLUS
  • Next : tagTrackObject , NILNode_c< T > , _SEC_CONTEXT , _CREDENTIAL
  • next : _SOCK_INFO , Sock_Info
  • NextBlock : blockTag
  • NextProcTable : _PROVIDER
  • NextProcTableExt : _PROVIDER
  • NextProvider : _PROVIDER
  • nFail : CClientApp
  • nFailureRetries : BROWSER_CONFIG
  • nFirstHandle : IAppletSessionNotifyVtbl
  • nFonts : tagArFonts
  • nFormats : tagCMTMLTFMT
  • nFrom : THREADDATA
  • nHeader : REQUEST_CONTEXT
  • nHeight : _BALLDATA , WININFO , PROFILE_STRUCT
  • nHits : _OPEN_FILE
  • nId : CRocket , CPlane
  • nID : MEMICONDIRENTRY
  • NIDeque : NIDequeIter_c< T >
  • nidInitiator : INVOKE_INFO
  • nidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • nInstance : _tagPOSTKEY
  • nInstanceNumber : tagAppletRoster
  • nitems : itemlist
  • nIters : THREADDATA
  • nJobs : _Queue
  • nlines : Table
  • nmAddrType : _PREF
  • nMajor : _tag_MMC_VERSION_INFO
  • nMaxUsers : _FILESHARESAMPLE_PROPS
  • nMaze : _MAZEDATA
  • nmCallType : _PREF
  • nMinor : _tag_MMC_VERSION_INFO
  • nMinOrMax : tagAppletCapabilityClass
  • nNodeID : tagAppletRecord
  • nNonStdCap : tagAppletCapabilityID
  • nNullable : tagFieldMetaData
  • nNumberOfBytesPerSend : _TRANSMITFILEARGS
  • nNumberOfBytesToWrite : _TRANSMITFILEARGS
  • nNumImages : ICONRESOURCE
  • nObject : _DRAWDATA , _XFORMDATA
  • non_repeaters : GlobalVars
  • Nonce : _SEC_CONTEXT
  • notify : THREADARGS
  • nOwnerEntityID : tagAppletRegistryEntryOwner
  • nOwnerNodeID : tagAppletRegistryEntryOwner
  • nPduType : _SNMP_MGR_SESSION
  • nr_left : viewline
  • nr_right : viewline
  • nRead : _AIO_WORK_ITEM
  • nRefs : CStringData , _OPEN_FILE
  • nRepeat : _OPTIONS
  • nReqTag : IAppletSessionNotifyVtbl
  • nRequestId : _SNMP_MGR_SESSION , GlobalVars
  • nResource : REQUEST_CONTEXT
  • nRetries : GlobalVars
  • nrows : TableHdr , TableSelection
  • nRows : CREATEDATA
  • nrtext : view
  • nScale : tagFieldMetaData
  • nSendSize : _TRANSMITPACKETSARGS
  • nSentBytes : _PER_IO_CONTEXT
  • nSessionID : tagAppletSessionKey
  • nStartupChannelType : tagAppletSessionRequest
  • nStdCap : tagAppletCapabilityID
  • nStrLen : tagAppletLongString
  • nT203TimeoutInQ922 : tagPLUGXPRT_PARAMETERS
  • nTestType : THREADDATA
  • nThreads : THREADDATA
  • nTimeLimit : BROWSER_CONFIG
  • nTimeOut : GlobalVars
  • nTo : THREADDATA
  • nTokenID : IAppletSessionNotifyVtbl , tagAppletTokenRequest , IAppletSessionNotifyVtbl , tagAppletRegistryItem , IAppletSessionNotifyVtbl
  • nTotalBytes : _PER_IO_CONTEXT
  • nTotalClients : _RECV_INFO
  • nTotalLength : _BLRPLATECONFIG
  • nTotalRecd : _SOCK_INFO
  • nTotalRows : CREATEDATA
  • nTotalSends : _SEND_INFO
  • nTotalSent : _SOCK_INFO
  • nTotalThreads : _OPTIONS
  • nTranType : THREADDATA
  • nullable : FieldInfo
  • nullRect : CSimpleApp , CSimpSvrApp
  • num_records : igmp_hdr_report_v3
  • num_sources : igmp_hdr_query_v3 , igmp_group_record_v3
  • NumberOfWorkerThreads : _WORK_QUEUE
  • NumRecords : _RecordsetVtbl
  • nURL : REQUEST_CONTEXT
  • nWidth : _BALLDATA , WININFO , PROFILE_STRUCT
  • nWritesOutstanding : tReq
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- o -

  • Object : _ADODynaCollectionVtbl , ParametersVtbl
  • Objects : tagObject
  • ObjectsNotInstalledError : AutoClaims::AutoClaims
  • offsetTitle : _DSA_SEC_PAGE_INFO
  • Oid : mib_entry
  • oid : GlobalVars
  • oidCount : GlobalVars
  • OkButton : Sample::UI::AboutBox
  • okButton : About
  • OldListBoxWndProc : GLOBAL_STRUCT
  • oOverlapped : _PACKET
  • Opcode : _BLRPLATE
  • OPEN_BUFSIZE : FileRepServer
  • openFileMenu : Sample::UI::MainWindow
  • OpenMenu : Serialization::SerializationForm
  • openMenu : CapJ
  • Operation : _WSAOVERLAPPEDPLUS
  • operation : GlobalVars
  • opt_addr : ipv4_option_hdr
  • opt_code : ipv4_option_hdr
  • opt_len : ipv4_option_hdr
  • opt_ptr : ipv4_option_hdr
  • option : EDITARGS
  • Option : SupportOptList , SupportConcurList
  • Options : _RecordsetVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl
  • OrderFunction : LIST_STRUCT
  • orderID
: qcnotify::Notify
, qcorder::Order
, qcship::Ship
  • OriginUrl : CacheProxySamplePlugin::ContentInfo
  • ostrH221NonStdID : tagAppletObjectKey
  • ostrParamValue : tagAppletRegistryRequest , tagAppletRegistryItem
  • ostrResourceID : tagAppletRegistryKey
  • osVersion : _SUMMARYINFO , _RSUMINFO
  • osvi : TS_VERSION_INFO
  • OutPipe : tSReq , tReq
  • ov : _AIO_WORK_ITEM , RECEIVE_CONTEXT
  • overlap : _socklist
  • overLap : WRTHANDLE
  • Overlapped : _COPY_CHUNK , _DRVLINE , _PER_IO_CONTEXT
  • OverlappedIO : _SEARCH_REQUEST
  • ovr : _SEND_INFO
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- z -

  • z : POINT3D
  • zoomFactor : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • zoomRectangle : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • zoomToolBar : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • zoomUpDown : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- a -

  • abEvent : tagEVENT
  • aboutMenu : Sample::UI::MainWindow , CapJ
  • AcceptExArgs : _WSAOVERLAPPEDPLUS
  • acceptor_address : gss_channel_bindings_struct
  • acceptor_addrtype : gss_channel_bindings_struct
  • Access : mib_entry
  • aChannelRegistryKeys : tagAppletSessionRequest
  • achFile : FILE_CONTEXT_TYPE
  • achNTUserName : _USER_INFO
  • achNTUserPassword : _USER_INFO
  • achPassword : _USER_INFO
  • achUserName : _USER_INFO
  • ack_num : tpc_hdr
  • Action : tSReq
  • ActiveConnection : _RecordsetVtbl
  • activePen : InkHitTest::InkHitTest
  • adAddNew : msado15::CursorOptionEnum
  • adAffectAll : msado15::AffectEnum
  • adAffectAllChapters : msado15::AffectEnum
  • adAffectCurrent : msado15::AffectEnum
  • adAffectGroup : msado15::AffectEnum
  • adApproxPosition : msado15::CursorOptionEnum
  • adAsyncConnect : msado15::ConnectOptionEnum
  • adAsyncExecute : msado15::ExecuteOptionEnum
  • adAsyncFetch : msado15::ExecuteOptionEnum
  • adAsyncFetchNonBlocking : msado15::ExecuteOptionEnum
  • adBigInt : msado15::DataTypeEnum
  • adBinary : msado15::DataTypeEnum
  • adBookmark : msado15::CursorOptionEnum
  • adBookmarkCurrent : msado15::BookmarkEnum
  • adBookmarkFirst : msado15::BookmarkEnum
  • adBookmarkLast : msado15::BookmarkEnum
  • adBoolean : msado15::DataTypeEnum
  • adBSTR : msado15::DataTypeEnum
  • adChapter : msado15::DataTypeEnum
  • adChar : msado15::DataTypeEnum
  • adClipString : msado15::StringFormatEnum
  • adCmdFile : msado15::CommandTypeEnum
  • adCmdStoredProc : msado15::CommandTypeEnum
  • adCmdTable : msado15::CommandTypeEnum
  • adCmdTableDirect : msado15::CommandTypeEnum
  • adCmdText : msado15::CommandTypeEnum
  • adCmdUnknown : msado15::CommandTypeEnum
  • adCmdUnspecified : msado15::CommandTypeEnum
  • adCmdURLBind : msado15::CommandTypeEnum
  • adCollectionRecord : msado15::RecordTypeEnum
  • adCompareEqual : msado15::CompareEnum
  • adCompareGreaterThan : msado15::CompareEnum
  • adCompareLessThan : msado15::CompareEnum
  • adCompareNotComparable : msado15::CompareEnum
  • adCompareNotEqual : msado15::CompareEnum
  • adConnectUnspecified : msado15::ConnectOptionEnum
  • adCopyAllowEmulation : msado15::CopyRecordOptionsEnum
  • adCopyNonRecursive : msado15::CopyRecordOptionsEnum
  • adCopyOverWrite : msado15::CopyRecordOptionsEnum
  • adCR : msado15::LineSeparatorEnum
  • adCreateCollection : msado15::RecordCreateOptionsEnum
  • adCreateNonCollection : msado15::RecordCreateOptionsEnum
  • adCreateOverwrite : msado15::RecordCreateOptionsEnum
  • adCreateStructDoc : msado15::RecordCreateOptionsEnum
  • adCriteriaAllCols : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCriteriaKey : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCriteriaTimeStamp : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCriteriaUpdCols : msado15::ADCPROP_UPDATECRITERIA_ENUM
  • adCRLF : msado15::LineSeparatorEnum
  • adCurrency : msado15::DataTypeEnum
  • adDate : msado15::DataTypeEnum
  • adDBDate : msado15::DataTypeEnum
  • adDBFileTime : msado15::DataTypeEnum
  • adDBTime : msado15::DataTypeEnum
  • adDBTimeStamp : msado15::DataTypeEnum
  • adDecimal : msado15::DataTypeEnum
  • adDefaultStream : msado15::FieldEnum
  • adDelayFetchFields : msado15::RecordOpenOptionsEnum
  • adDelayFetchStream : msado15::RecordOpenOptionsEnum
  • adDelete : msado15::CursorOptionEnum
  • adDouble : msado15::DataTypeEnum
  • addr : _RU_SOCKET
  • addressFamily : _AcceptContext , _ClientContext
  • adEditAdd : msado15::EditModeEnum
  • adEditDelete : msado15::EditModeEnum
  • adEditInProgress : msado15::EditModeEnum
  • adEditNone : msado15::EditModeEnum
  • adEmpty : msado15::DataTypeEnum
  • adErrBoundToCommand : msado15::ErrorValueEnum
  • adErrDataConversion : msado15::ErrorValueEnum
  • adErrFeatureNotAvailable : msado15::ErrorValueEnum
  • adErrIllegalOperation : msado15::ErrorValueEnum
  • adErrInTransaction : msado15::ErrorValueEnum
  • adErrInvalidArgument : msado15::ErrorValueEnum
  • adErrInvalidConnection : msado15::ErrorValueEnum
  • adErrInvalidParamInfo : msado15::ErrorValueEnum
  • adErrItemNotFound : msado15::ErrorValueEnum
  • adErrNoCurrentRecord : msado15::ErrorValueEnum
  • adErrNotExecuting : msado15::ErrorValueEnum
  • adErrNotReentrant : msado15::ErrorValueEnum
  • adErrObjectClosed : msado15::ErrorValueEnum
  • adErrObjectInCollection : msado15::ErrorValueEnum
  • adErrObjectNotSet : msado15::ErrorValueEnum
  • adErrObjectOpen : msado15::ErrorValueEnum
  • adErrOpeningFile : msado15::ErrorValueEnum
  • adErrOperationCancelled : msado15::ErrorValueEnum
  • adError : msado15::DataTypeEnum
  • adErrProviderNotFound : msado15::ErrorValueEnum
  • adErrReadFile : msado15::ErrorValueEnum
  • adErrStillConnecting : msado15::ErrorValueEnum
  • adErrStillExecuting : msado15::ErrorValueEnum
  • adErrUnsafeOperation : msado15::ErrorValueEnum
  • adErrWriteFile : msado15::ErrorValueEnum
  • adExecuteNoRecords : msado15::ExecuteOptionEnum
  • adFailIfNotExists : msado15::RecordCreateOptionsEnum
  • adFileTime : msado15::DataTypeEnum
  • adFilterAffectedRecords : msado15::FilterGroupEnum
  • adFilterConflictingRecords : msado15::FilterGroupEnum
  • adFilterFetchedRecords : msado15::FilterGroupEnum
  • adFilterNone : msado15::FilterGroupEnum
  • adFilterPendingRecords : msado15::FilterGroupEnum
  • adFilterPredicate : msado15::FilterGroupEnum
  • adFind : msado15::CursorOptionEnum
  • adFldCacheDeferred : msado15::FieldAttributeEnum
  • adFldFixed : msado15::FieldAttributeEnum
  • adFldIsNullable : msado15::FieldAttributeEnum
  • adFldKeyColumn : msado15::FieldAttributeEnum
  • adFldLong : msado15::FieldAttributeEnum
  • adFldMayBeNull : msado15::FieldAttributeEnum
  • adFldMayDefer : msado15::FieldAttributeEnum
  • adFldNegativeScale : msado15::FieldAttributeEnum
  • adFldRowID : msado15::FieldAttributeEnum
  • adFldRowVersion : msado15::FieldAttributeEnum
  • adFldUnknownUpdatable : msado15::FieldAttributeEnum
  • adFldUnspecified : msado15::FieldAttributeEnum
  • adFldUpdatable : msado15::FieldAttributeEnum
  • adGetRowsRest : msado15::GetRowsOptionEnum
  • adGUID : msado15::DataTypeEnum
  • adHoldRecords : msado15::CursorOptionEnum
  • adIDispatch : msado15::DataTypeEnum
  • adIndex : msado15::CursorOptionEnum
  • adInteger : msado15::DataTypeEnum
  • adIUnknown : msado15::DataTypeEnum
  • adLF : msado15::LineSeparatorEnum
  • adLockBatchOptimistic : msado15::LockTypeEnum
  • adLockOptimistic : msado15::LockTypeEnum
  • adLockPessimistic : msado15::LockTypeEnum
  • adLockReadOnly : msado15::LockTypeEnum
  • adLockUnspecified : msado15::LockTypeEnum
  • adLongVarBinary : msado15::DataTypeEnum
  • adLongVarChar : msado15::DataTypeEnum
  • adLongVarWChar : msado15::DataTypeEnum
  • adMarshalAll : msado15::MarshalOptionsEnum
  • adMarshalModifiedOnly : msado15::MarshalOptionsEnum
  • admin : NewsFlash , NewsSubscriber
  • AdminSettings : CacheProxySamplePlugin::CacheProxyPlugin
  • adModeRead : msado15::ConnectModeEnum
  • adModeReadWrite : msado15::ConnectModeEnum
  • adModeRecursive : msado15::ConnectModeEnum
  • adModeShareDenyNone : msado15::ConnectModeEnum
  • adModeShareDenyRead : msado15::ConnectModeEnum
  • adModeShareDenyWrite : msado15::ConnectModeEnum
  • adModeShareExclusive : msado15::ConnectModeEnum
  • adModeUnknown : msado15::ConnectModeEnum
  • adModeWrite : msado15::ConnectModeEnum
  • adMoveAllowEmulation : msado15::MoveRecordOptionsEnum
  • adMoveDontUpdateLinks : msado15::MoveRecordOptionsEnum
  • adMoveOverWrite : msado15::MoveRecordOptionsEnum
  • adMovePrevious : msado15::CursorOptionEnum
  • adNotify : msado15::CursorOptionEnum
  • adNumeric : msado15::DataTypeEnum
  • adoModeRead : msado15::ConnectModeEnum
  • adoModeReadWrite : msado15::ConnectModeEnum
  • adoModeRecursive : msado15::ConnectModeEnum
  • adoModeShareDenyRead : msado15::ConnectModeEnum
  • adoModeShareDenyWrite : msado15::ConnectModeEnum
  • adoModeShareExclusive : msado15::ConnectModeEnum
  • adoModeShareNone : msado15::ConnectModeEnum
  • adoModeUnknown : msado15::ConnectModeEnum
  • adoModeWrite : msado15::ConnectModeEnum
  • adOpenAsync : msado15::RecordOpenOptionsEnum
  • adOpenDynamic : msado15::CursorTypeEnum
  • adOpenForwardOnly : msado15::CursorTypeEnum
  • adOpenIfExists : msado15::RecordCreateOptionsEnum
  • adOpenKeyset : msado15::CursorTypeEnum
  • adOpenSource : msado15::RecordOpenOptionsEnum
  • adOpenStatic : msado15::CursorTypeEnum
  • adOpenStreamAsync : msado15::StreamOpenOptionsEnum
  • adOpenStreamFromRecord : msado15::StreamOpenOptionsEnum
  • adOpenStreamFromURL : msado15::StreamOpenOptionsEnum
  • adOpenUnspecified : msado15::CursorTypeEnum
  • adOpenURLBind : msado15::RecordOpenOptionsEnum
  • adOptionUnspecified : msado15::ExecuteOptionEnum
  • adParamInput : msado15::ParameterDirectionEnum
  • adParamInputOutput : msado15::ParameterDirectionEnum
  • adParamLong : msado15::ParameterAttributesEnum
  • adParamNullable : msado15::ParameterAttributesEnum
  • adParamOutput : msado15::ParameterDirectionEnum
  • adParamReturnValue : msado15::ParameterDirectionEnum
  • adParamSigned : msado15::ParameterAttributesEnum
  • adParamUnknown : msado15::ParameterDirectionEnum
  • adPersistADTG : msado15::PersistFormatEnum
  • adPersistXML : msado15::PersistFormatEnum
  • adPosBOF : msado15::PositionEnum
  • adPosEOF : msado15::PositionEnum
  • adPosUnknown : msado15::PositionEnum
  • adPriorityAboveNormal : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityBelowNormal : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityHighest : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityLowest : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPriorityNormal : msado15::ADCPROP_ASYNCTHREADPRIORITY_ENUM
  • adPromptAlways : msado15::ConnectPromptEnum
  • adPromptComplete : msado15::ConnectPromptEnum
  • adPromptCompleteRequired : msado15::ConnectPromptEnum
  • adPromptNever : msado15::ConnectPromptEnum
  • adPropNotSupported : msado15::PropertyAttributesEnum
  • adPropOptional : msado15::PropertyAttributesEnum
  • adPropRead : msado15::PropertyAttributesEnum
  • adPropRequired : msado15::PropertyAttributesEnum
  • adPropVariant : msado15::DataTypeEnum
  • adPropWrite : msado15::PropertyAttributesEnum
  • adReadAll : msado15::StreamReadEnum
  • adReadLine : msado15::StreamReadEnum
  • adRecalcAlways : msado15::ADCPROP_AUTORECALC_ENUM
  • adRecalcUpFront : msado15::ADCPROP_AUTORECALC_ENUM
  • adRecCanceled : msado15::RecordStatusEnum
  • adRecCantRelease : msado15::RecordStatusEnum
  • adRecConcurrencyViolation : msado15::RecordStatusEnum
  • adRecDBDeleted : msado15::RecordStatusEnum
  • adRecDeleted : msado15::RecordStatusEnum
  • adRecIntegrityViolation : msado15::RecordStatusEnum
  • adRecInvalid : msado15::RecordStatusEnum
  • adRecMaxChangesExceeded : msado15::RecordStatusEnum
  • adRecModified : msado15::RecordStatusEnum
  • adRecMultipleChanges : msado15::RecordStatusEnum
  • adRecNew : msado15::RecordStatusEnum
  • adRecObjectOpen : msado15::RecordStatusEnum
  • adRecOK : msado15::RecordStatusEnum
  • adRecordURL : msado15::FieldEnum
  • adRecOutOfMemory : msado15::RecordStatusEnum
  • adRecPendingChanges : msado15::RecordStatusEnum
  • adRecPermissionDenied : msado15::RecordStatusEnum
  • adRecSchemaViolation : msado15::RecordStatusEnum
  • adRecUnmodified : msado15::RecordStatusEnum
  • adResync : msado15::CursorOptionEnum
  • adResyncAll : msado15::CEResyncEnum
  • adResyncAllValues : msado15::ResyncEnum
  • adResyncAutoIncrement : msado15::CEResyncEnum
  • adResyncConflicts : msado15::CEResyncEnum
  • adResyncInserts : msado15::CEResyncEnum
  • adResyncNone : msado15::CEResyncEnum
  • adResyncUnderlyingValues : msado15::ResyncEnum
  • adResyncUpdates : msado15::CEResyncEnum
  • adRsnAddNew : msado15::EventReasonEnum
  • adRsnClose : msado15::EventReasonEnum
  • adRsnDelete : msado15::EventReasonEnum
  • adRsnFirstChange : msado15::EventReasonEnum
  • adRsnMove : msado15::EventReasonEnum
  • adRsnMoveFirst : msado15::EventReasonEnum
  • adRsnMoveLast : msado15::EventReasonEnum
  • adRsnMoveNext : msado15::EventReasonEnum
  • adRsnMovePrevious : msado15::EventReasonEnum
  • adRsnRequery : msado15::EventReasonEnum
  • adRsnResynch : msado15::EventReasonEnum
  • adRsnUndoAddNew : msado15::EventReasonEnum
  • adRsnUndoDelete : msado15::EventReasonEnum
  • adRsnUndoUpdate : msado15::EventReasonEnum
  • adRsnUpdate : msado15::EventReasonEnum
  • adSaveCreateNotExist : msado15::SaveOptionsEnum
  • adSaveCreateOverWrite : msado15::SaveOptionsEnum
  • adSchemaAsserts : msado15::SchemaEnum
  • adSchemaCatalogs : msado15::SchemaEnum
  • adSchemaCharacterSets : msado15::SchemaEnum
  • adSchemaCheckConstraints : msado15::SchemaEnum
  • adSchemaCollations : msado15::SchemaEnum
  • adSchemaColumnPrivileges : msado15::SchemaEnum
  • adSchemaColumns : msado15::SchemaEnum
  • adSchemaColumnsDomainUsage : msado15::SchemaEnum
  • adSchemaConstraintColumnUsage : msado15::SchemaEnum
  • adSchemaConstraintTableUsage : msado15::SchemaEnum
  • adSchemaCubes : msado15::SchemaEnum
  • adSchemaDBInfoKeywords : msado15::SchemaEnum
  • adSchemaDBInfoLiterals : msado15::SchemaEnum
  • adSchemaDimensions : msado15::SchemaEnum
  • adSchemaForeignKeys : msado15::SchemaEnum
  • adSchemaHierarchies : msado15::SchemaEnum
  • adSchemaIndexes : msado15::SchemaEnum
  • adSchemaKeyColumnUsage : msado15::SchemaEnum
  • adSchemaLevels : msado15::SchemaEnum
  • adSchemaMeasures : msado15::SchemaEnum
  • adSchemaMembers : msado15::SchemaEnum
  • adSchemaPrimaryKeys : msado15::SchemaEnum
  • adSchemaProcedureColumns : msado15::SchemaEnum
  • adSchemaProcedureParameters : msado15::SchemaEnum
  • adSchemaProcedures : msado15::SchemaEnum
  • adSchemaProperties : msado15::SchemaEnum
  • adSchemaProviderSpecific : msado15::SchemaEnum
  • adSchemaProviderTypes : msado15::SchemaEnum
  • adSchemaReferentialConstraints : msado15::SchemaEnum
  • adSchemaReferentialContraints : msado15::SchemaEnum
  • adSchemaSchemata : msado15::SchemaEnum
  • adSchemaSQLLanguages : msado15::SchemaEnum
  • adSchemaStatistics : msado15::SchemaEnum
  • adSchemaTableConstraints : msado15::SchemaEnum
  • adSchemaTablePrivileges : msado15::SchemaEnum
  • adSchemaTables : msado15::SchemaEnum
  • adSchemaTranslations : msado15::SchemaEnum
  • adSchemaTrustees : msado15::SchemaEnum
  • adSchemaUsagePrivileges : msado15::SchemaEnum
  • adSchemaViewColumnUsage : msado15::SchemaEnum
  • adSchemaViews : msado15::SchemaEnum
  • adSchemaViewTableUsage : msado15::SchemaEnum
  • adSearchBackward : msado15::SearchDirectionEnum
  • adSearchForward : msado15::SearchDirectionEnum
  • adSeek : msado15::CursorOptionEnum
  • adSeekAfter : msado15::SeekEnum
  • adSeekAfterEQ : msado15::SeekEnum
  • adSeekBefore : msado15::SeekEnum
  • adSeekBeforeEQ : msado15::SeekEnum
  • adSeekFirstEQ : msado15::SeekEnum
  • adSeekLastEQ : msado15::SeekEnum
  • adSimpleRecord : msado15::RecordTypeEnum
  • adSingle : msado15::DataTypeEnum
  • adSmallInt : msado15::DataTypeEnum
  • adStateClosed : msado15::ObjectStateEnum
  • adStateConnecting : msado15::ObjectStateEnum
  • adStateExecuting : msado15::ObjectStateEnum
  • adStateFetching : msado15::ObjectStateEnum
  • adStateOpen : msado15::ObjectStateEnum
  • adStatusCancel : msado15::EventStatusEnum
  • adStatusCantDeny : msado15::EventStatusEnum
  • adStatusErrorsOccurred : msado15::EventStatusEnum
  • adStatusOK : msado15::EventStatusEnum
  • adStatusUnwantedEvent : msado15::EventStatusEnum
  • adStructDoc : msado15::RecordTypeEnum
  • AdsType : ADSTYPE_TO_STRING_ENTRY
  • adsType : ADSTYPEsyntaxmapping
  • adTinyInt : msado15::DataTypeEnum
  • adTypeBinary : msado15::StreamTypeEnum
  • adTypeText : msado15::StreamTypeEnum
  • adUnsignedBigInt : msado15::DataTypeEnum
  • adUnsignedInt : msado15::DataTypeEnum
  • adUnsignedSmallInt : msado15::DataTypeEnum
  • adUnsignedTinyInt : msado15::DataTypeEnum
  • adUpdate : msado15::CursorOptionEnum
  • adUpdateBatch : msado15::CursorOptionEnum
  • adUseClient : msado15::CursorLocationEnum
  • adUseClientBatch : msado15::CursorLocationEnum
  • adUseNone : msado15::CursorLocationEnum
  • adUserDefined : msado15::DataTypeEnum
  • adUseServer : msado15::CursorLocationEnum
  • adVarBinary : msado15::DataTypeEnum
  • adVarChar : msado15::DataTypeEnum
  • adVariant : msado15::DataTypeEnum
  • adVarNumeric : msado15::DataTypeEnum
  • adVarWChar : msado15::DataTypeEnum
  • adWChar : msado15::DataTypeEnum
  • adWriteChar : msado15::StreamWriteEnum
  • adWriteLine : msado15::StreamWriteEnum
  • adXactAbortRetaining : msado15::XactAttributeEnum
  • adXactAsyncPhaseOne : msado15::XactAttributeEnum
  • adXactBrowse : msado15::IsolationLevelEnum
  • adXactChaos : msado15::IsolationLevelEnum
  • adXactCommitRetaining : msado15::XactAttributeEnum
  • adXactCursorStability : msado15::IsolationLevelEnum
  • adXactIsolated : msado15::IsolationLevelEnum
  • adXactReadCommitted : msado15::IsolationLevelEnum
  • adXactReadUncommitted : msado15::IsolationLevelEnum
  • adXactRepeatableRead : msado15::IsolationLevelEnum
  • adXactSerializable : msado15::IsolationLevelEnum
  • adXactSyncPhaseOne : msado15::XactAttributeEnum
  • adXactUnspecified : msado15::IsolationLevelEnum
  • aDynamicChannels : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • aemrformat : tagCMTMLTFMT
  • AffectRecords : _RecordsetVtbl
  • agent1 : CapJ
  • agentSockAddr : GlobalVars
  • alignment : Props
  • AllocatedBytes : _LOCAL_HEAP_INFO_BLOCK
  • AllocatedEntries : _LOCAL_HEAP_INFO_BLOCK
  • allowedModes : tagTrackObject
  • analysis : RUN
  • ANDRect : CHILDWINDOWDATA
  • ANDTextRect : CHILDWINDOWDATA
  • AnimationsLabel : CapJ
  • AnimationsListBox : CapJ
  • aNodeIDs : IAppletSessionVtbl
  • aoffset : PRIVCLIPDATA
  • apAppletRecords : tagAppletRoster
  • apAppRosters : IAppletSessionNotifyVtbl
  • apCapabilities : tagAppletRoster , tagAppletRecord
  • apCollapsedCaps : tagAppletSessionRequest
  • apExpectedCapabilities : tagAppletProtocolEntity
  • apNonCollapsedCaps : tagAppletSessionRequest
  • AppletProtocolKey : tagAppletSessionKey
  • Application : STL_LABEL
  • application_data : gss_channel_bindings_struct
  • applicationMode : InkClipboard::InkClipboard
  • AppMemAllocs : _APPMEM_DATA_DEFINITION
  • AppMemAllocsSec : _APPMEM_DATA_DEFINITION
  • AppMemBytesAllocated : _APPMEM_DATA_DEFINITION
  • AppMemFrees : _APPMEM_DATA_DEFINITION
  • AppMemFreesSec : _APPMEM_DATA_DEFINITION
  • AppMemObjectType : _APPMEM_DATA_DEFINITION
  • AppMemReAllocs : _APPMEM_DATA_DEFINITION
  • AppMemReAllocsSec : _APPMEM_DATA_DEFINITION
  • appNameLB : NewsSubscriber
  • appNameTF : NewsSubscriber
  • archiveQuotaPerStream : PersistedConfiguration
  • ArraySize : _ITEM_DESC
  • aStaticChannels : tagAppletSessionRequest
  • Async : tSReq , tReq
  • aszIdentity : _EAPCB
  • aszPassword : _EAPCB
  • attr : diritem
  • attrid : ATTRIBUTES
  • aUsers : tagAppletChannelRequest
  • AuthData : _CREDENTIAL
  • AutoHide : CapJ
  • autoinc : FieldInfo
  • AutoPace : CapJ
  • aux_data_len : igmp_group_record_v3
  • avewidth : Table
  • awcName : SPropertyEntry
  • awszIdentity : _EAP_NAME_DIALOG
  • awszPassword : _EAP_NAME_DIALOG
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- b -

  • Back : NILNode_c< T >
  • backcolour : Props
  • backendServer : PersistedConfiguration
  • bActivity : CExeModule
  • bAllPullsDone : tReq
  • bAlternateQos : _QOS_OPTIONS
  • bAnchor : item_tag
  • base : ENUMSYMDATA
  • Base : _VIRTUAL_BUFFER
  • bAsyncCallFailureReceived : tReq
  • bbox : APMFILEHEADER
  • bBuf : tReq , tSReq
  • bCallCancelled : tReq
  • bCallComplete : tReq
  • bCallMade : tReq
  • bChatty : THREADDATA , CREATEDATA
  • bClosing : _SOCK_INFO
  • bColorCount : MEMICONDIRENTRY , ICONDIRENTRY
  • bConfirmResv : _QOS_OPTIONS
  • bCreatePerIteration : THREADDATA
  • bData : COLUMNDATA , _COLUMNDATA
  • bDataAvailable : tReq
  • bDirectMode : CSharp_Draw::Form1
  • bDisableSignalling : _QOS_OPTIONS
  • bDiscard : compitem , section
  • bDone : CREATEDATA
  • bDropInProgress : _DRVLINE
  • bDSEnabled : CSharp_Draw::Form1
  • bEnabled : _SAMPLE_HELPER_DATA_
  • bExpand : view
  • bExpanded : CDelegationBase , CComponentData
  • bExpandGuard : view
  • bExpanding : view
  • bFailureFromPull : tReq
  • bFailureFromWrite : tReq
  • bFile : dirlist
  • bFineGrainErrorAvail : _QOS_OPTIONS
  • bFit2Wnd : _PRTDATA
  • bFixTemplate : _QOS_OPTIONS
  • bFormatNameOnly : ARRAYQ
  • bGlobalTemplate : _OPTIONS
  • bGraphics : BANDINFOSTRUCT
  • bHasChanged : ICONRESOURCE
  • bHasCtrlChars : _tagPOSTKEY
  • bHeight : MEMICONDIRENTRY , ICONDIRENTRY
  • bImpersonating : tReq , tSReq , ThreadArgs
  • bInProcess : params
  • blackPen : InkHitTest::InkHitTest , Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • BlackPen : CSharp_Draw::Form1
  • BlackRect : CHILDWINDOWDATA
  • BlackTextRect : CHILDWINDOWDATA
  • bLastDataPushIssued : tSReq
  • blob : KEY_HEADER
  • bLocalIsTemp : diritem
  • bMarked : compitem
  • bMulticast : _SP_OPTIONS
  • bMustSetQosInAccept : _QOS_OPTIONS
  • bNewPosition : _BALLDATA
  • bNull : tagFieldMetaData
  • bNullPush : tSReq
  • bOK : item_tag
  • bool : VTUNION
  • boolVal : _tagPROPSTRUCT
  • bottom : Margin , RECTI
  • bottominner : Margin
  • Bound : Counter
  • box : Props
  • BoxRect : CHILDWINDOWDATA
  • bPlayContinuous : _playinfo
  • bPrecision : COLDESC , _ParameterVtbl
  • bProviderSpecific : _QOS_OPTIONS
  • bPullOutstanding : tReq
  • bPushOutstanding : tSReq
  • bQos : _SP_OPTIONS
  • bQosabilityIoctls : _QOS_OPTIONS
  • bQueryBufferSize : _QOS_OPTIONS
  • Branding : _JOB_INFO
  • bRandom : THREADDATA
  • bReadOutstanding : tSReq
  • bReadsDone : tSReq
  • bReceiver : _QOS_OPTIONS
  • bRecvPacketId : _EAPCB
  • bReserved : MEMICONDIRENTRY , ICONDIRENTRY
  • bResult : CSharp_Draw::InputBox
  • bRpcImpersonating : tReq
  • bRunningStatus : tag_track
  • brushText : CSharp_Draw::Form1
  • bScale : COLDESC , _ParameterVtbl
  • bScanned : direct
  • bSelected : CIceSkate
  • bSendComplete : _SEND_INFO
  • bSendEnabled : _SEND_INFO
  • bSetDestaddr : _QOS_OPTIONS
  • bState : MYTOOLINFO
  • bStatus : FILEDEX
  • bStop : CREATEDATA
  • bstr : _ConnectionVtbl , _ParameterVtbl , _CommandVtbl
  • bstrConn : _RecordsetVtbl
  • bstrEventClassID : CEvtStoreSub
  • bstrName : _CommandVtbl , WATCHER_DATA , SESSION_DATA
  • bstrOldURI : AUTH_DATA
  • bstrPublisherID : CEvtStoreSub
  • bstrSubscriptionID : CEvtStoreSub
  • bstrURI : WATCHER_DATA , SESSION_DATA
  • bstrVal : VTUNION
  • bStyle : MYTOOLINFO
  • bSum : dirlist
  • bTaken : Static_Info_Database , Static_Statistic
  • bText : BANDINFOSTRUCT
  • btnAttach : CSharp_Draw::Form1
  • btnCancel : CSharp_Draw::Form1 , CSharp_Draw::InputBox
  • btnConnect : CSharp_Draw::Form1
  • btnMoveDown : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • btnMoveUp : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • btnOK : CSharp_Draw::InputBox
  • btnRecognize : InkRecognition::InkRecognition
  • buf : _OPTIONS , _DATA_BUFFER , tagQtStruct
  • buff : _SFFS
  • Buffer : _PER_IO_CONTEXT , CacheProxySamplePlugin::INSSBufferImpl , _socklist , _MESSAGE , _SEARCH_REQUEST_STATE
  • buffer : filebuffer
  • Buffer : _UNICODE_STRING , _COPY_CHUNK , _RASHOST_DATA
  • BUFFER_SIZE : RSProxy
  • buttonSign : Sample::UI::MainWindow
  • buttonVerify : Sample::UI::MainWindow
  • bVerbose : _OPTIONS
  • bWaitToSend : _QOS_OPTIONS
  • bWidth : ICONDIRENTRY , MEMICONDIRENTRY
  • bWindowed : WININFO
  • byteOffset : _PROPIDLIST , _PROPSETLIST
  • byteOrder : _SUMMARYINFO , _RSUMINFO
  • BytesPrinted : _Job
  • BytesRecv : _SOCK_INFO
  • BytesReturned : CQueryDlg
  • BytesSent : _SOCK_INFO
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- c -

  • c : _ADOCollectionVtbl , _ADODynaCollectionVtbl , FieldsVtbl , ParametersVtbl , ErrorsVtbl , PropertiesVtbl , _IID
  • C_REQUEST : RSProxy
  • C_RESPONSE : RSProxy
  • cacheDirectoryPath : PersistedConfiguration
  • CacheFlags : CacheProxySamplePlugin::ContentInfo
  • CacheID : CacheProxySamplePlugin::PlaylistItem
  • cacheOnDemandCacheMiss : PersistedConfiguration
  • CacheProxyCallback : CacheProxySamplePlugin::ContentInfo
  • CacheProxyServer : CacheProxySamplePlugin::CacheProxyPlugin
  • CacheSize : _RecordsetVtbl
  • CacheUrl : CacheProxySamplePlugin::PlaylistItem , CacheProxySamplePlugin::ContentInfo
  • CallbackType : HTTP_REQUESTCB_PARAM
  • CallerId : _JOB_INFO
  • CallerName : _JOB_INFO
  • CallerNumber : _JOB_INFO
  • CallerSocket : _WSAOVERLAPPEDPLUS
  • CallerThreadId : _WSAOVERLAPPEDPLUS
  • CallHandle : _JOB_INFO
  • CAllocList : CMallocSpy
  • CapClass : tagAppletCapability
  • CAPICOM_ENCODED_DATA_FORMAT_MULTI_LINES : storesh::Storesh
  • CapID : tagAppletCapability , tagAppletCapability2
  • CASCADE_EVENT_CLSID : helper::sampleConstants
  • CASCADE_EVENT_DLL : helper::sampleConstants
  • CASCADE_EVENT_NAME : helper::sampleConstants
  • CASCADE_NAME : helper::sampleConstants
  • cascadeAppName : NewsSubscriber
  • cascadeHeading : NewsSubscriber
  • cascadePersisRB : NewsSubscriber
  • cascadeTransRB : NewsSubscriber
  • cb : CDbAlloc , tagDataStruct
  • cbBmk : tagRowBuff
  • cbBuffer : tag_seq
  • cbBufSize : IAppletSessionVtbl
  • cbBytesReturned : _IOCTLARGS
  • cbCommitCurrent : tagLSTSLOT
  • cbCommitMax : tagLSTSLOT
  • cbData : CTE_ENCODER_STRUCT
  • cbDataLength : HTTP_REQUESTCB_PARAM
  • cbExtra : tagLSTSLOT
  • cbFile : _SFFS
  • cbImage : tag_smf
  • cbInBuffer : _IOCTLARGS
  • cBindings : tagACCESSOR , BINDINGINFO
  • cbLeft : tag_track
  • cbLength : tag_track
  • cbMaxSignature : _AUTH_SEQ
  • cbNumItems : _tagPREPAREFORSYNCMSG , _tagSHOWERRORCOMPLETEDMSG
  • cbOutBuffer : _IOCTLARGS
  • cbPage : tagLSTSLOT
  • cbParm : tagEVENT
  • cbPendingUserEvent : tag_smf
  • cbPhysicalLayerReceiveBufferSize : tagPLUGXPRT_PARAMETERS
  • cbPhysicalLayerSendBufferSize : tagPLUGXPRT_PARAMETERS
  • cbPreroll : tag_seq
  • cbRead : tSReq
  • cbReadFileBufferSize : tagPLUGXPRT_PARAMETERS
  • cbReadSoFar : _IO_WORK_ITEM
  • cbRequest : CMallocSpy
  • cbSecurityTrailer : _AUTH_SEQ
  • cbSize : tagHeader , _tagGENERICITEM , Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA , storesh::CERT_SYSTEM_STORE_INFO
  • cbSlot : tagLSTSLOT
  • cbslotLeftOver : tagLSTSLOT
  • cbStrSize : tagAppletOctetString
  • cbStruct : HTTP_REQUESTCB_PARAM , HTTP_REQUEST_PARAM
  • cbStructSize : tagPLUGXPRT_PARAMETERS
  • cBuff : tagSERVERINFO
  • cBuffer : tag_seq
  • cbValue : tagDescInfo
  • cBytes : _SECTION , _THUMB , _STANDARDSECINMEM
  • cCapabilities : tagAppletRecord , tagAppletRoster
  • cch : GBGETTEXTA , GBGETTEXTW , tagLABELEXTRACT
  • ccmd : _CMDI
  • cCollapsedCaps : tagAppletSessionRequest
  • cdData : tagRowBuff
  • CDL : CacheProxySamplePlugin::ContentInfo
  • CDLData : CacheProxySamplePlugin::PlaylistItem , CacheProxySamplePlugin::ContentInfo
  • cDynamicChannels : tagAppletSessionRequest , IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • centerBottomHandle : InkClipboard::InkClipboard
  • centerTopHandle : InkClipboard::InkClipboard
  • cEntities : tagAppletCapability
  • cErrors : tagSERVERINFO
  • CERT_SYSTEM_STORE_CURRENT_USER : storesh::Storesh
  • CERT_SYSTEM_STORE_LOCAL_MACHINE : storesh::Storesh
  • CERTNAME_LENGTH : storesh::Storesh
  • cEventID : EventID
  • cExpectedCapabilities : tagAppletProtocolEntity
  • cf : CDefClassFactory
  • cHandles : tagAppletRegistryRequest , IAppletSessionNotifyVtbl
  • Changed : _Job
  • changeType : CEvtStoreSub
  • chData : blockTag
  • checksum : diritem , APMFILEHEADER , igmp_hdr , igmp_hdr_query_v3 , igmp_hdr_report_v3
  • chHideLayer : AutoClaims::AutoClaims
  • children : CStaticNode , CBicycleFolder , CSkateboardFolder , CIceSkateFolder , CPeoplePoweredVehicle , CSpaceStation , CSpaceFolder , CComponentData , CSkyVehicle , CIceSkateFolder , CPeoplePoweredVehicle , CSpaceVehicle
  • chklbPlugins : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • ChooseCertKeyAlgorithm : Sample::Messages
  • ChooseCertMessage : Sample::Messages
  • ChooseCertNoPrivateKey : Sample::Messages
  • ChooseCertUnableToConstructKey : Sample::Messages
  • cidl : PRIVCLIPDATA
  • CImpIAdviseSink : CSite
  • CImpIOleClientSite : CSite
  • CImpIOleDocumentSite : CSite
  • CImpIOleInPlaceSite : CSite
  • ciSelect : view
  • cIssuer : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • cJobs : _Printer
  • cl : view
  • classId : _RSUMINFO , _SUMMARYINFO
  • ClassObject : CacheProxySamplePlugin::CacheProxyPlugin
  • clearButton : NewsSubscriber
  • ClearItem : InkHitTest::InkHitTest
  • cLen : _BUFFER
  • ClientList : ClientList::Iterator
  • ClientSize : GLOBAL_STRUCT
  • clipend : CellPos
  • clipFormat : _THUMB
  • clipstart : CellPos
  • CLock : CLockHandler
  • closeMenu : Sample::UI::MainWindow
  • clsid
: fullsvr::AsyncFullServ
, fullsvr::FullServ
, comadmin::COMAdminCatalog
, comadmin::COMAdminCatalogCollection
, comadmin::COMAdminCatalogObject
, msado15::Command
, msado15::Connection
, msado15::Parameter
, msado15::Record
, msado15::Recordset
, msado15::Stream
, vcacct::CAccount
, vcacct::CGetReceipt
, vcacct::CMoveMoney
, vcacct::CUpdateReceipt
  • cMaximumT200TimeoutsInQ922 : tagPLUGXPRT_PARAMETERS
  • cmd : _OPTIONS
  • cmsd : _MSDI
  • cNames : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • cNodes : IAppletSessionVtbl
  • cNonCollapsedCaps : tagAppletSessionRequest
  • Collection : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • Color : CSharp_Draw::Form1
  • Colors : ICONIMAGE
  • COMAdminAccessChecksApplicationComponentLevel : comadmin::COMAdminAccessChecksLevelOptions
  • COMAdminAccessChecksApplicationLevel : comadmin::COMAdminAccessChecksLevelOptions
  • COMAdminActivationInproc : comadmin::COMAdminActivationOptions
  • COMAdminActivationLocal : comadmin::COMAdminActivationOptions
  • COMAdminAuthenticationCall : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationCapabilitiesDynamicCloaking : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationCapabilitiesNone : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationCapabilitiesSecureReference : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationCapabilitiesStaticCloaking : comadmin::COMAdminAuthenticationCapabilitiesOptions
  • COMAdminAuthenticationConnect : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationDefault : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationIntegrity : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationNone : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationPacket : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminAuthenticationPrivacy : comadmin::COMAdminAuthenticationLevelOptions
  • COMAdminCompFlagAlreadyInstalled : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagCOMPlusPropertiesFound : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagInterfacesFound : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagNotInApplication : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagProxyFound : comadmin::COMAdminComponentFlags
  • COMAdminCompFlagTypeInfoFound : comadmin::COMAdminComponentFlags
  • COMAdminErrAlreadyInstalled : comadmin::COMAdminErrorCodes
  • COMAdminErrAppDirNotFound : comadmin::COMAdminErrorCodes
  • COMAdminErrAppFileReadFail : comadmin::COMAdminErrorCodes
  • COMAdminErrAppFileVersion : comadmin::COMAdminErrorCodes
  • COMAdminErrAppFileWriteFail : comadmin::COMAdminErrorCodes
  • COMAdminErrApplicationExists : comadmin::COMAdminErrorCodes
  • COMAdminErrApplidMatchesClsid : comadmin::COMAdminErrorCodes
  • COMAdminErrAuthenticationLevel : comadmin::COMAdminErrorCodes
  • COMAdminErrBadPath : comadmin::COMAdminErrorCodes
  • COMAdminErrBadRegistryLibID : comadmin::COMAdminErrorCodes
  • COMAdminErrBadRegistryProgID : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotExportAppProxy : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotExportSystemApp : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotStartApp : comadmin::COMAdminErrorCodes
  • COMAdminErrCanNotSubscribeToComponent : comadmin::COMAdminErrorCodes
  • COMAdminErrCantCopyFile : comadmin::COMAdminErrorCodes
  • COMAdminErrCLSIDOrIIDMismatch : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileBadTLB : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileClassNotAvail : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileDoesNotExist : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileGetClassObj : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileLoadDLLFail : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileNoRegistrar : comadmin::COMAdminErrorCodes
  • COMAdminErrCompFileNotInstallable : comadmin::COMAdminErrorCodes
  • COMAdminErrCompMoveBadDest : comadmin::COMAdminErrorCodes
  • COMAdminErrCompMoveLocked : comadmin::COMAdminErrorCodes
  • COMAdminErrCoReqCompInstalled : comadmin::COMAdminErrorCodes
  • COMAdminErrDllLoadFailed : comadmin::COMAdminErrorCodes
  • COMAdminErrDllRegisterServer : comadmin::COMAdminErrorCodes
  • COMAdminErrInvalidUserids : comadmin::COMAdminErrorCodes
  • COMAdminErrKeyMissing : comadmin::COMAdminErrorCodes
  • COMAdminErrNoRegistryCLSID : comadmin::COMAdminErrorCodes
  • COMAdminErrNoServerShare : comadmin::COMAdminErrorCodes
  • COMAdminErrNotChangeable : comadmin::COMAdminErrorCodes
  • COMAdminErrNotDeletable : comadmin::COMAdminErrorCodes
  • COMAdminErrNotInRegistry : comadmin::COMAdminErrorCodes
  • COMAdminErrNoUser : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectDoesNotExist : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectErrors : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectExists : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectInvalid : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectNotPoolable : comadmin::COMAdminErrorCodes
  • COMAdminErrObjectParentMissing : comadmin::COMAdminErrorCodes
  • COMAdminErrPropertyOverflow : comadmin::COMAdminErrorCodes
  • COMAdminErrPropertySaveFailed : comadmin::COMAdminErrorCodes
  • COMAdminErrQueuingServiceNotAvailable : comadmin::COMAdminErrorCodes
  • COMAdminErrRegFileCorrupt : comadmin::COMAdminErrorCodes
  • COMAdminErrRegisterTLB : comadmin::COMAdminErrorCodes
  • COMAdminErrRegistrarFailed : comadmin::COMAdminErrorCodes
  • COMAdminErrRemoteInterface : comadmin::COMAdminErrorCodes
  • COMAdminErrRequiresDifferentPlatform : comadmin::COMAdminErrorCodes
  • COMAdminErrRoleDoesNotExist : comadmin::COMAdminErrorCodes
  • COMAdminErrRoleExists : comadmin::COMAdminErrorCodes
  • COMAdminErrServiceNotInstalled : comadmin::COMAdminErrorCodes
  • COMAdminErrSession : comadmin::COMAdminErrorCodes
  • COMAdminErrStartAppNeedsComponents : comadmin::COMAdminErrorCodes
  • COMAdminErrSystemApp : comadmin::COMAdminErrorCodes
  • COMAdminErrUserPasswdNotValid : comadmin::COMAdminErrorCodes
  • COMAdminExportApplicationProxy : comadmin::COMAdminApplicationExportOptions
  • COMAdminExportForceOverwriteOfFiles : comadmin::COMAdminApplicationExportOptions
  • COMAdminExportNoUsers : comadmin::COMAdminApplicationExportOptions
  • COMAdminExportUsers : comadmin::COMAdminApplicationExportOptions
  • COMAdminFileFlagAlreadyInstalled : comadmin::COMAdminFileFlags
  • COMAdminFileFlagBadTLB : comadmin::COMAdminFileFlags
  • COMAdminFileFlagClassNotAvailable : comadmin::COMAdminFileFlags
  • COMAdminFileFlagCOM : comadmin::COMAdminFileFlags
  • COMAdminFileFlagContainsComp : comadmin::COMAdminFileFlags
  • COMAdminFileFlagContainsPS : comadmin::COMAdminFileFlags
  • COMAdminFileFlagContainsTLB : comadmin::COMAdminFileFlags
  • COMAdminFileFlagDLLRegsvrFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagDoesNotExist : comadmin::COMAdminFileFlags
  • COMAdminFileFlagError : comadmin::COMAdminFileFlags
  • COMAdminFileFlagGetClassObjFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagLoadable : comadmin::COMAdminFileFlags
  • COMAdminFileFlagNoRegistrar : comadmin::COMAdminFileFlags
  • COMAdminFileFlagRegistrar : comadmin::COMAdminFileFlags
  • COMAdminFileFlagRegistrarFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagRegTLBFailed : comadmin::COMAdminFileFlags
  • COMAdminFileFlagSelfReg : comadmin::COMAdminFileFlags
  • COMAdminFileFlagSelfUnReg : comadmin::COMAdminFileFlags
  • COMAdminFileFlagUnloadableDLL : comadmin::COMAdminFileFlags
  • COMAdminImpersonationAnonymous : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminImpersonationDelegate : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminImpersonationIdentify : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminImpersonationImpersonate : comadmin::COMAdminImpersonationLevelOptions
  • COMAdminInstallForceOverwriteOfFiles : comadmin::COMAdminApplicationInstallOptions
  • COMAdminInstallNoUsers : comadmin::COMAdminApplicationInstallOptions
  • COMAdminInstallUsers : comadmin::COMAdminApplicationInstallOptions
  • COMAdminOSWindows3_1 : comadmin::COMAdminOS
  • COMAdminOSWindows9x : comadmin::COMAdminOS
  • COMAdminOSWindowsNT : comadmin::COMAdminOS
  • COMAdminOSWindowsNTEnterprise : comadmin::COMAdminOS
  • COMAdminServiceContinuePending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceLoadBalanceRouter : comadmin::COMAdminServiceOptions
  • COMAdminServicePaused : comadmin::COMAdminServiceStatusOptions
  • COMAdminServicePausePending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceRunning : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceStartPending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceStopped : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceStopPending : comadmin::COMAdminServiceStatusOptions
  • COMAdminServiceUnknownState : comadmin::COMAdminServiceStatusOptions
  • COMAdminSynchronizationIgnored : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationNone : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationRequired : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationRequiresNew : comadmin::COMAdminSynchronizationOptions
  • COMAdminSynchronizationSupported : comadmin::COMAdminSynchronizationOptions
  • COMAdminThreadingModelApartment : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelBoth : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelFree : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelMain : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelNeutral : comadmin::COMAdminThreadingModels
  • COMAdminThreadingModelNotSpecified : comadmin::COMAdminThreadingModels
  • COMAdminTransactionIgnored : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionNone : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionRequired : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionRequiresNew : comadmin::COMAdminTransactionOptions
  • COMAdminTransactionSupported : comadmin::COMAdminTransactionOptions
  • CommandText : _ConnectionVtbl
  • CommandType : tagCrmFilesCreateFileLogRecord , tagCrmFilesDeleteFileLogRecord
  • CommitLimit : _VIRTUAL_BUFFER
  • CompletionKey : _JOB_INFO
  • CompletionPortHandle : _JOB_INFO
  • components
: About
, WsdlDiscovery::frmMain
, InkBlog::InkArea
, NewsSubscriber
, CSharp_Draw::Form1
, CSharp_Draw::InputBox
, Sample::UI::MainWindow
, InkCollection::InkCollection
, InkErase::InkErase
, InkRecognition::InkRecognition
, Serialization::SerializationForm
, UDDI::Tools::CategoryTreeView
, CapJ
, Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
, RealTimeStylusPluginApp::RealTimeStylusPluginApp
, PaperForm::PaperForm
, AutoClaims::AutoClaims
, InkHitTest::InkHitTest
, Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
, InkClipboard::InkClipboard
, Sample::UI::AboutBox
, NewsFlash
  • compopts : THREADARGS
  • ConfigPath : CacheProxySamplePlugin::CacheProxyPlugin
  • conn : CADVCGENDlg
  • ConnectExArgs : _WSAOVERLAPPEDPLUS
  • connectionID : tphys_connect_info
  • ConnectionString : _ConnectionVtbl
  • connectorColor : InkClipboard::InkClipboard
  • connectorPen : InkClipboard::InkClipboard
  • connectState : CSessionDlg
  • connInfo : tagLINE_INFO
  • connStr : CADVCGENDlg
  • ConstantValueDef : _SIGGEN_DATA_DEFINITION
  • ContentSize : CacheProxySamplePlugin::ContentInfo
  • ContentType : CacheProxySamplePlugin::ContentInfo
  • ContextFlags : _SEC_CONTEXT
  • ContextId : _SEC_CONTEXT
  • Cookies : _MultiSelectCookies
  • CopyrightLabel : Sample::UI::AboutBox
  • CopyrightMessage : Sample::Messages
  • correspond : section
  • count : CServerDlg , CSessionDlg , _MultiSelectCookies , FONTLIST
  • Count : _LSP_ENTRY
  • count : CProcessDlg , gss_OID_set_desc_struct , CAPIDoc
  • counter : Cstack_c
  • CounterBlock : _APPMEM_COUNTERS , _SIGGEN_COUNTER
  • cpe : LOGPAL
  • cProperties : _SECTION , _STANDARDSECINMEM
  • cRanges : HTTP_REQUEST_PARAM
  • crColor : _BALLDATA
  • created : _LOCKED_LIST
  • CreateInstance : CFactoryData
  • cRecords : tagAppletRoster
  • CredentialId : _SEC_CONTEXT , _CREDENTIAL
  • cRef : tagACCESSOR , CDefClassFactory , tagINTERFACEIMPL
  • cRefs : CCriticalSection , CLock
  • cRestrictions : _SCHEMAINFO
  • Criteria : _RecordsetVtbl
  • CriticalSection : _WORK_QUEUE
  • cRosters : IAppletSessionNotifyVtbl
  • cs : _DEVICE_INFO
  • CS : CSampleInstance
  • cSections : _RSUMINFO , _SUMMARYINFO
  • CSI : _JOB_INFO
  • cSize : _stringstruct
  • cslot : tagSLOT
  • CSpaceStation : CRocket
  • csSync : UPNPDimmerService , CDimmerService
  • cStaticChannels : tagAppletSessionRequest
  • cStreamName : _STREAM_FIND_DATA
  • cTempoMap : tag_smf
  • cTempoMapAlloc : tag_smf
  • cTrk : tag_seq
  • CUpdateTextEditSession : CSnoopWnd
  • curdir : direct
  • Current : NIDequeIter_c< T >
  • CurrentExtendedSize : tReq
  • CurrentOutput : _SEARCH_REQUEST_STATE
  • CurrentUser : storesh::Storesh
  • CursorOptions : _RecordsetVtbl
  • CursorType : _RecordsetVtbl
  • cUsers : tagAppletChannelRequest
  • customDynamicRendererGraphics : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • customerID
: qcorder::Order
, qcnotify::Notify
, qcship::Ship
  • cwWorkerThread : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • cxButton : tagTOOLDISPLAYDATA
  • cxImage : tagTOOLDISPLAYDATA
  • cxWidth : tagOPTIONS
  • cyBar : tagTOOLDISPLAYDATA
  • cyButton : tagTOOLDISPLAYDATA
  • cyHeight : tagOPTIONS
  • cyImage : tagTOOLDISPLAYDATA
  • cySpace : tagArFonts
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- d -

  • d_acctBalance : CAccount
  • Data : item_tag , NILNode_c< T >
  • data : tagDataStruct , CLListImpl< TYPE, ARG_TYPE >::CNode
  • Data : IAppletSessionNotifyVtbl , FieldVtbl
  • data : treeitem , CAsyncTest::threadParam
  • DatabasePath : CacheProxySamplePlugin::CacheProxyPlugin
  • DataBuf : _socklist
  • dataRs : CADVCGENDlg
  • DataSize : _ITEM_DESC
  • dataSize : _DATA_BUFFER
  • date : tagDataStruct , _SFFS
  • dateVariable : _SFFS
  • day : _DOSDTTM
  • dblVal : VTUNION
  • dbType : SPropertyEntry
  • DebugErrorLevel : PROFILE_STRUCT
  • DebuggeePriority : PROFILE_STRUCT
  • DebugMode : PROFILE_STRUCT
  • DECLARE_IUNKNOWN : CPlgPin
  • DefaultVal : tagDescInfo
  • DEFINE_ADDREF_RELEASE : CPropertyPage
  • delay : _ClientContext
  • DeleteLogErrorMsg : _tagMETHODARGS
  • delims : compitem
  • DemoTitle : Sample::Messages
  • Depth : _ENUMERATE_DIRECTORY_STATE
  • Description : RealTimeStylusPluginApp::PluginListItem
  • descriptionDoc : UPNPDimmerDevice , CDimmer
  • dest_portno : udp_hdr , tpc_hdr , port_hdr
  • DeviceId : _DEVICE_INFO
  • DIID__IInkCollectorEvents : IInkCollectorEventsImpl< T >
  • dimnessLevel : UPNPDimmerService , CDimmerService
  • dir1 : _tagHANDLERITEMSETTINGS , _tagSAMPLEITEMSETTINGS
  • dir2 : _tagHANDLERITEMSETTINGS , _tagSAMPLEITEMSETTINGS
  • direct : diritem
  • Direction : _CommandVtbl
  • Directory : _DEVICE_INFO
  • directPersisRB : NewsSubscriber
  • directs : direct
  • directTransRB : NewsSubscriber
  • diritem : filedata
  • diritems : direct
  • DisconnectExArgs : _WSAOVERLAPPEDPLUS
  • diskQuota : PersistedConfiguration
  • DISPID_CEGesture : IInkCollectorEventsImpl< T >
  • dispIdMember : _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl
  • dLastValue : _CounterInfoBlock
  • dLevel : IUPnPService_DimmingService_SCPDVtbl
  • DllDebugInfo : DEB_DLL_NODE_INFO_STRUCT
  • dllPathLB : NewsSubscriber
  • dllPathTF : NewsSubscriber
  • dlsDynamicLocksStore : _CONFIGURATION_ENTRY
  • dom : _SFFS
  • domainFlag : CServerDlg
  • domainName : CAPIDoc
  • doSet : GlobalVars
  • dot : dirlist
  • dotColor : InkClipboard::InkClipboard
  • dotEdgeColor : InkClipboard::InkClipboard
  • dotEdgePen : InkClipboard::InkClipboard
  • dotPen : InkClipboard::InkClipboard
  • DotSize : InkClipboard::InkClipboard
  • DotSpacing : InkClipboard::InkClipboard
  • DrawArea : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • DrawingRect : CHILDWINDOWDATA
  • DS : CacheProxySamplePlugin::CacheProxyPlugin
  • DSN : util::DatabaseSettings , helper::DatabaseSettings
  • dsObjectNames : _DSA_SEC_PAGE_INFO
  • dst_portno : udp_hdr
  • DT : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl
  • dummy : CTitleTag
  • DummyEntry : _LSP_ENTRY
  • dw : _foo , DWSTR
  • dwAccess : ARRAYQ
  • dwAccessorFlags : tagACCESSOR
  • dwAcquirePrivateKeyFlags : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • dwActiveDebuggees : GLOBAL_STRUCT
  • dwActiveDlls : DEB_DLL_LIST_INFO_STRUCT
  • dwActiveProcesses : DEB_PROCESS_LIST_INFO_STRUCT
  • dwActiveThreads : DEB_THREAD_LIST_INFO_STRUCT
  • dwAddress : _IPSAMPLE_IP_ADDRESS , CMD_ARGS
  • dwAllocCalls : _APPMEM_INSTANCE
  • dwAmmount : _ExpenseBuf
  • dwAmplitude : _WAVE_DATA
  • dwAPIVersion : tagLINEINFO
  • dwApplicationBytes : _APPMEM_INSTANCE
  • dwAppMemAllocs : _APPMEM_COUNTERS
  • dwAppMemAllocsSec : _APPMEM_COUNTERS
  • dwAppMemBytesAllocated : _APPMEM_COUNTERS
  • dwAppMemFrees : _APPMEM_COUNTERS
  • dwAppMemFreesSec : _APPMEM_COUNTERS
  • dwAppMemReAllocs : _APPMEM_COUNTERS
  • dwAppMemReAllocsSec : _APPMEM_COUNTERS
  • dwAttributes : NODE_PROPERTIES , tag_BASENODE_PROPERTIES , CHILD_PROPERTIES
  • dwBmk : tagRowBuff
  • dwBmkStatus : tagRowBuff
  • dwBPType : CMD_ARGS
  • dwBufferCount : _RECVARGS , _RECVFROMARGS , _SENDARGS , _SENDTOARGS
  • dwBytes : RESOURCEPOSINFO
  • dwBytesInRes : MEMICONDIRENTRY , ICONDIRENTRY
  • dwBytesReceived : _ACCEPTEXARGS
  • dwBytesSent : _CONNECTEXARGS
  • dwCallState : _DRVLINE
  • dwCallStateMode : _DRVLINE
  • dwChunkSize : CTE_ENCODER_STRUCT
  • dwCollation : INDEXINFO
  • dwCommand : _ASYNC_REQUEST , VERBMAPPING
  • dwConstant : CONST_DWORD_REP
  • dwConstantValue : _SIGGEN_COUNTER
  • dwContentLength : HTTP_REQUESTCB_PARAM
  • dwCookie : IAppletSessionVtbl , IAppletVtbl
  • dwCount : tagEnhKeyUsage
  • dwDataOffset : HTTP_REQUESTCB_PARAM
  • dwDestAttribs : CShellExt
  • dwDevCapFlag : NONDIALTOKENS
  • dwDeviceID : _DRVLINE
  • dwErrorLevel : _tagLOGERRORMSG
  • dwFFStreamMagic : _FFSTREAM
  • dwFillFactor : INDEXINFO
  • dwFirstFreeOffset : _APPMEM_DATA_HEADER
  • dwFirstIndex : _CounterInfoBlock
  • dwFirstInUseOffset : _APPMEM_DATA_HEADER
  • dwFlag : Note
  • dwFlags : _RECVFROMARGS , _TRANSMITFILEARGS , _tagPROPSTRUCT , COLDESC , _INTERFACE_ENTRY , _TRANSMITPACKETSARGS , _DISCONNECTEXARGS , _RECVARGS , _SENDARGS , _SENDTOARGS , tagPLUGXPRT_PARAMETERS , ATTRIBUTES
  • dwFormat : tag_smffileinfo , tag_smf
  • dwFreeCalls : _APPMEM_INSTANCE
  • dwGraphic : tagGRAPHICLOOKUP
  • dwh : _foo
  • dwHighDateTime : _FILETIME
  • dwIdExpected : _EAPCB
  • dwIfIndex : _INTERFACE_ENTRY
  • dwImageOffset : ICONDIRENTRY
  • dwInitialPacketId : _EAPCB
  • dwInitialSize : INDEXINFO
  • dwInstanceCount : _APPMEM_DATA_HEADER
  • dwIoControlCode : _IOCTLARGS
  • dwKey : _node_tag
  • dwKeySpec : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • dwLastIndex : _CounterInfoBlock
  • dwLength : COLUMNDATA , _COLUMNDATA , tag_chunkhdr , _tagPOSTKEY
  • dwLocalAddressLength : _ACCEPTEXARGS
  • dwLoggingLevel : _IPSAMPLE_GLOBAL_CONFIG
  • dwLogLevel : _CONFIGURATION_ENTRY
  • dwLowDateTime : _FILETIME
  • dwMask : _IPSAMPLE_IP_ADDRESS , ADVISE_SINK
  • dwMediaMode : _DRVLINE
  • dwMSPHandle : _DRVLINE
  • dwNextEntry : ECB_QUEUE_ENTRY
  • dwNextIndex : _CounterInfoBlock
  • dwNmch : _PREF
  • dwNullCollation : INDEXINFO
  • dwNulls : INDEXINFO
  • dwNumberOfBytesRecvd : _RECVARGS , _WSARECVMSGARGS , _RECVFROMARGS
  • dwNumberOfBytesSent : _SENDTOARGS , _SENDARGS
  • dwNumBytes : ICONIMAGE
  • dwNumItems : _tagGENERICITEMLIST
  • dwObjectType : params
  • dwOffset : RESOURCEPOSINFO , HTTP_REQUEST_RANGE , _tagPOSTKEY
  • dwOffsetOfNext : _APPMEM_INSTANCE
  • dwOutstandingAsync : _SOCK_INFO
  • dwPendingUserEvent : tag_smf
  • dwPeriod : _WAVE_DATA
  • dwPermanentLineID : tagLINEINFO
  • dwPID : CTestDlg
  • dwPos : tagSEG
  • dwProcessId : _CLIPBOOKSERVER_RESOURCE , DEB_STARTUP_INFO_STRUCT , DEB_PROCESS_NODE_INFO_STRUCT , DEB_THREAD_NODE_INFO_STRUCT , _APPMEM_INSTANCE
  • dwPropertyID : _tagPROPSTRUCT
  • dwReAllocCalls : _APPMEM_INSTANCE
  • dwReceiveDataLength : _ACCEPTEXARGS
  • dwRemoteAddressLength : _ACCEPTEXARGS
  • dwRequestCtx : HTTP_REQUEST_PARAM , HTTP_REQUESTCB_PARAM
  • dwRequestID : _ASYNC_REQUEST
  • dwReserved : _tagDELETELOGERRORMSG , _tagESTABLISHCONNECTIONMSG , _DISCONNECTEXARGS , CPlex , _tagPREPAREFORSYNCMSG , _SIGGEN_COUNTER
  • dwReserved1 : _APPMEM_INSTANCE
  • dwReserved2 : _APPMEM_INSTANCE
  • dwResponseCode : HTTP_REQUESTCB_PARAM
  • dwResult : _EAPCB
  • dwSendDataLength : _CONNECTEXARGS
  • dwSineWaveValue : _SIGGEN_COUNTER
  • dwSize : HTTP_REQUEST_RANGE , _RASHOST_DATA , REQUEST_CONTEXT , _RUREGVALUE
  • dwSizeOfDataFromInteractiveUI : _EAPCB
  • dwSleep : _OPTIONS
  • dwSleepClose : _OPTIONS
  • dwSourceSize : tagCrmFilesCreateFileLogRecord , tagCrmFilesDeleteFileLogRecord
  • dwSquareWaveValue : _SIGGEN_COUNTER
  • dwSrcAttribs : CShellExt
  • dwStart : _DLGITEMS
  • dwState : _IPSAMPLE_IF_BINDING
  • dwStatus : COLUMNDATA , _COLUMNDATA , _Printer , _Job
  • dwSyncMgrResultStatus : _tagHANDLERITEM_SYNCSTATUS
  • dwTempo : tag_tempomapentry
  • dwTempSize : tagCrmFilesDeleteFileLogRecord
  • dwThreadId : DEB_PROCESS_NODE_INFO_STRUCT , DEB_THREAD_NODE_INFO_STRUCT
  • dwThreadID : REQUEST_CONTEXT
  • dwThreadId : RESULTDATA
  • dwThreadID : DBG_THREAD_INFO , CExeModule
  • dwThreadType : params
  • dwTimeDivision : tag_smf , tag_smffileinfo , tag_seq , tag_smfopenstruct
  • dwTotalClients : _OPTIONS
  • dwTotalSize : REQUEST_CONTEXT
  • dwTraceID : _CONFIGURATION_ENTRY
  • dwTracks : tag_smffileinfo , tag_smf
  • dwTriangleWaveValue : _SIGGEN_COUNTER
  • dwType : _ExpenseBuf , _RUREGVALUE
  • dwVal : tagENTRY
  • dwValue : tagENUMPRTLOOKUP , tagEnhKeyUsage
  • dwWidth : COL , _tagCol
  • dwWorkerMsg : _tagMETHODARGS
  • dx : CREATEGIZMOW , CREATEGIZMOA
  • dy : CREATEGIZMOA , CREATEGIZMOW
  • dyRowsFromTop : TableSelection
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- e -

  • e_compType : CMain
  • E_FAIL : RSProxy
  • EapState : _EAPCB
  • eCallControl : tagPLUGXPRT_PARAMETERS
  • eCallState : tagLINE_INFO
  • ecDllNameFT : NewsFlash
  • ecDllNameLabel : NewsFlash
  • eCoInit : THREADDATA
  • eCommand : tagAppletRegistryRequest , tagAppletChannelRequest , tagAppletTokenRequest , IAppletSessionNotifyVtbl
  • eDataPriority : IAppletSessionNotifyVtbl
  • edwp : _MSDI , _CMDI
  • eEvent : _EVENT_SINK_INFO
  • eidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • eLang : THREADDATA
  • elements : gss_OID_desc_struct , gss_OID_set_desc_struct
  • eMarshal : _RecordsetVtbl
  • emptyInk : AutoClaims::AutoClaims
  • enableCaching : PersistedConfiguration
  • EnableModelessMsg : _tagMETHODARGS
  • enableProxy : PersistedConfiguration
  • EntityTags : CacheProxySamplePlugin::ContentInfo
  • Entry : _MOF_INFO , _ITEM_DESC
  • enumPeriod : _UNITSTABLE
  • EOFCheck : FILE_CONTEXT_TYPE
  • eParamModifyRights : tagAppletRegistryRequest
  • ePriority : IAppletSessionVtbl
  • eReason : IAppletSessionNotifyVtbl
  • eRights : IAppletSessionNotifyVtbl
  • Error : _WSAOVERLAPPEDPLUS
  • ErrorID : _tagSHOWERRORMSG , _tagDELETELOGERRORMSG
  • esEventingManager : CDimmerService , UPNPDimmerService
  • EstablishConnectionMsg : _tagMETHODARGS
  • eStartupChannelType : tagAppletRecord , tagAppletProtocolEntity
  • eStatus : IAppletSessionNotifyVtbl
  • eType : tagAppletCapabilityClass , EXTENDER_NODE , ENUMINFO , tagAppletObjectKey , tagAppletCapabilityID
  • EVENT_CLSID : helper::sampleConstants
  • EVENT_NAME : helper::sampleConstants
  • EventCount : _MOF_INFO
  • EventFlag : _Events
  • EventIDs : EventID
  • EventInfo : _USER_EVENT
  • eventList : NewsSubscriber
  • EventName : _Events
  • ExceptionTitle : Sample::Messages
  • ExitEvent : _DEVICE_INFO
  • exitMenu : CapJ
  • ExitMenu : Serialization::SerializationForm
  • EXPECTED_MAX_CONCURRENT_CALLS : RSProxy
  • ExpirationTime : CacheProxySamplePlugin::ContentInfo
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- f -

  • fAccept : SESSION_DATA
  • fActive : DEB_STARTUP_INFO_STRUCT
  • fActual : CMallocSpy
  • fAddBuddy : WATCHER_DATA
  • failed : tagSERVERINFO
  • FailureMessage : Sample::Messages
  • fAllow : WATCHER_DATA
  • FALSE : HelloJ , Hello2J , Hello3J
  • fAND : tagICONEXTRACT
  • fAnimating : CPerson
  • fAsync : _tagMETHODARGS
  • fAuthenticator : _EAPCB
  • fAutoCall : _PREF
  • fAutoChat : _PREF
  • fAutoHide : tagOPTIONS
  • fAutoHost : _PREF
  • fAutoMonitor : _PREF
  • fAutoUpdate : FieldInfo , INDEXINFO
  • fCaller : tagLINE_INFO
  • fCallInvalidated : tSReq
  • fCancelled : _tagHANDLERITEM_SYNCSTATUS
  • fCapabilitiesChanged : tagAppletRoster
  • fChar : STR_BINDING
  • fChat : _PREF
  • fClearOnNew : PROFILE_STRUCT
  • fClustered : INDEXINFO
  • fConductingCapable : tagAppletRecord
  • fConfirm : _PREF
  • fContainer : tagObject
  • fCurrentXRotation : SPINCUBEINFO
  • fCurrentXRotationInc : SPINCUBEINFO
  • fCurrentYRotation : SPINCUBEINFO
  • fCurrentYRotationInc : SPINCUBEINFO
  • fCurrentZRotation : SPINCUBEINFO
  • fCurrentZRotationInc : SPINCUBEINFO
  • fCut : PRIVCLIPDATA
  • fDebug : tagSERVERINFO
  • fDeep : THREADARGS
  • fDefault : tagDescInfo
  • fDescribeFiles : THREADARGS
  • fDirectory : _tagFILEOBJECT
  • fDirty : _tagITEMCONFIGSETTINGSLPARAM
  • fDone : GlobalVars , COLORPICKSTATE
  • fdwProperty : _IMEUIDATA
  • fdwRequestFlags : HTTP_REQUESTCB_PARAM
  • fdwSeq : tag_seq
  • fdwSMF : tag_smf
  • fdwTrack : tag_track
  • fEnable : _tagENABLEMODELESSMSG
  • fEnableProxyFailover : BROWSER_CONFIG
  • fEnrolledActively : tagAppletRecord
  • fEntryOwned : tagAppletRegistryEntryOwner
  • fExit : THREADARGS
  • fFlags : _EAPCB
  • fFolder : tagPIDLDATA
  • fFoundIconOnly : tagLABELEXTRACT
  • fFoundIndex : tagLABELEXTRACT
  • fFoundSource : tagLABELEXTRACT
  • fGettable : tagDescInfo
  • fh : filebuffer
  • fHandleType : tagHANDLES
  • fHeader : tagDescInfo
  • fHelpUsed : GLOBAL_STRUCT
  • fHiding : tagOPTIONS
  • fIconOnly : tagDRAWINFO
  • FieldList : _RecordsetVtbl
  • Fields : _RecordsetVtbl
  • File : _SEARCH_REQUEST
  • FileData : _SEARCH_REQUEST
  • fileerror : diritem
  • FileItem : InkHitTest::InkHitTest
  • fileMenu : Sample::UI::MainWindow , CapJ
  • FileMenu : Serialization::SerializationForm
  • FileName : _JOB_INFO
  • fileOffset : _RSUMINFO
  • FileOl : tReq , tSReq
  • FileReadPos : tSReq
  • FileSize : _SEARCH_REQUEST
  • FileWritePos : tReq
  • fill : _STDZ
  • fillchar : _OPTIONS
  • FindHandle : _ENUMERATE_DIRECTORY_STACK
  • fInputFile : THREADARGS
  • fInputFileSingle : THREADARGS
  • first : THREADARGS , section , tree
  • FirstName : Serialization::SerializationForm
  • FirstNameBox : Serialization::SerializationForm
  • FirstNameLabel : Serialization::SerializationForm
  • fIsAliveFailed : _FILESHARESAMPLE_RESOURCE
  • fIsAutoInc : TYPEINFO , COLDESC
  • fIsNullable : COLDESC , TYPEINFO
  • fIsolate : tagSERVERINFO
  • fIsParent : ENUMINFO
  • fIsPrimaryKey : COLDESC , INDEXINFO
  • fixedcols : TableHdr
  • fixedrows : TableHdr
  • fixedselectable : TableHdr
  • flags : fileline , statel , CellData
  • Flags : _BLRPLATE
  • fLastUpdateValid : _tagFILEOBJECT
  • fLocal : tagUser
  • fLog : tagSERVERINFO
  • fltVal : VTUNION
  • fMaximized : PROFILE_STRUCT
  • fMcu : tagUser
  • fMinimized : PROFILE_STRUCT
  • fMsg : _PREF
  • fMsgNotify : _PREF
  • fMsgObjects : _PREF
  • fMsgState : _PREF
  • fMsgTrace : _PREF
  • fMsgWindow : _PREF
  • fMustBeInvoked : tagAppletProtocolEntity
  • fn : _CMD
  • fnAcceptEx : _PER_SOCKET_CONTEXT
  • fName : _tagFILEOBJECT
  • fNewItem : _tagITEMCONFIGSETTINGSLPARAM
  • fNodesAdded : tagAppletRoster
  • fNodesRemoved : tagAppletRoster
  • fontfamilyText : CSharp_Draw::Form1
  • fOnTop : tagOPTIONS
  • fontText : CSharp_Draw::Form1
  • foot : PrintContext
  • fOpenedFiles : THREADARGS
  • forecolour : Props
  • forecolourws : Props
  • Format : _MIDL_TYPE_FORMAT_STRING , _MIDL_PROC_FORMAT_STRING
  • formatID : _PROPSETLIST
  • formatVersion : _SUMMARYINFO , _RSUMINFO
  • formData : PaperForm::PaperForm
  • formDataFile : PaperForm::PaperForm
  • fourccType : tag_chunkhdr
  • fPermissionGranted : IAppletNotifyVtbl
  • fPrepared : _CommandVtbl
  • fProxyAutoDiscovery : BROWSER_CONFIG
  • fRecursive : _tagHANDLERITEMSETTINGS , _tagSAMPLEITEMSETTINGS
  • FreeBytes : _LOCAL_HEAP_INFO_BLOCK
  • FreeEntries : _LOCAL_HEAP_INFO_BLOCK
  • FRIENDLYNAME_LENGTH : storesh::Storesh
  • fRosterChanged : tagAppletRoster
  • fSavedDirectory : PROFILE_STRUCT
  • fSaveOnExit : PROFILE_STRUCT
  • fSavePreferences : PROFILE_STRUCT
  • fSbar : _PREF
  • fScreen : tagSERVERINFO
  • fSearchable : FieldInfo
  • fSettable : tagDescInfo
  • fShowSymbols : PROFILE_STRUCT
  • fSigned : GBSETINT , GBGETINT
  • fSortBookmarks : INDEXINFO
  • fSpyed : CMallocSpy
  • fSuccess : GBGETINT
  • fSynchronizeComplete : _tagHANDLERITEM_SYNCSTATUS
  • fSynchronizing : _tagHANDLERITEM_SYNCSTATUS
  • fSyncLock : _tagSAMPLEITEMSETTINGS
  • ft : _tagHANDLERITEMSETTINGS , FONTENUM
  • ft_lastwrite : diritem
  • fTbar : _PREF
  • ftLastUpdate : _tagFILEOBJECT
  • fToolBar : PROFILE_STRUCT
  • fTop : tagUser
  • FullPathName : _SEARCH_REQUEST
  • func : CAsyncTest::threadParam
  • fUnicode : filebuffer , filedata
  • fUniformSend : IAppletSessionVtbl , IAppletSessionNotifyVtbl
  • fUnique : INDEXINFO
  • fUnresolvedConflicts : _tagHANDLERITEM_SYNCSTATUS
  • fUnsigned : FieldInfo
  • fUserList : _PREF
  • fVal : t_Ctype
  • fValid : INVOKE_INFO
  • fVerbose : PROFILE_STRUCT
  • fVoiceLine : tagLINEINFO
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- g -

  • g_hInst : GlobalVars
  • g_NamedValues : CachePluginAdmin
  • GatewayUserData : _SAMPLE_HELPER_DATA_
  • gbInkArea : InkRecognition::InkRecognition
  • gbTestArea : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • genericItem : _tagSAMPLEITEMSETTINGS , _tagHANDLERITEM_SYNCSTATUS , _tagFILEOBJECT
  • Gesture : IInkCollectorEventsImpl< T >
  • get : IWMSCacheAdmin
  • GetInboundByte : _tagPOSDATA
  • getOSVersion : _RSUMINFO , _SUMMARYINFO
  • GptAttributes : _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION
  • GraphicsRect : BANDINFOSTRUCT
  • group_addr : igmp_hdr , igmp_hdr_query_v3 , igmp_group_record_v3
  • groupConnectionMode : CSharp_Draw::Form1
  • groupSendType : CSharp_Draw::Form1
  • GUID : NODESTRUCT
  • Guid : _MOF_INFO
  • GUID : EXTENSION_NODE
  • guidDraw : CSharp_Draw::Form1
  • guidExtension : EXTENDER_NODE
  • guidNode : EXTENDER_NODE
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- h -

  • hAcceptWindow : _AcceptContext
  • hAccessor : BINDINGINFO
  • hActivitySemaphore : _CONFIGURATION_ENTRY
  • hAgentEntity : _SNMP_MGR_SESSION
  • handleUpstreamCacheRequests : PersistedConfiguration
  • hash : fileline
  • hBall1 : _BOUNCEDATA
  • hBall2 : _BOUNCEDATA
  • hBall3 : _BOUNCEDATA
  • hBall4 : _BOUNCEDATA
  • hBezBuffer : _POLYDATA
  • hbmCompat : SPINCUBEINFO
  • hBmp : CREATEGIZMOA , CREATEGIZMOW
  • hbmSave : SPINCUBEINFO
  • hCluster : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • hComm : _DRVLINE
  • hCommLink : tagLINE_INFO
  • hConnect : REQUEST_CONTEXT
  • hConnection : Static_Info_Database
  • hConsole : CSimpleObject
  • hCounter : _CounterInfoBlock
  • hdbc : tagSERVERINFO , THREAD_STRUCT , DBCONN
  • hdc : tagArFonts , tagTrackObject
  • hdcCompat : SPINCUBEINFO
  • hDllInst : CDllData
  • hdr : Table
  • head : direct , PrintContext , _LOCKED_LIST
  • Header : _USER_EVENT
  • headlineLabel : NewsFlash
  • headlineTF : NewsFlash
  • height : Props
  • Height : ICONIMAGE
  • HELP_PAD : storesh::Storesh
  • helpMenu : Sample::UI::MainWindow , CapJ
  • henv : tagSERVERINFO , THREAD_STRUCT
  • hEvent : _tagWorkerThreadArgs , WRTHANDLE
  • hEvents : _RECV_INFO , _SEND_INFO
  • hEventShutdown : CExeModule
  • hevtCall : tagLINE_INFO
  • hf : STYLE
  • hFile : _FileInfo , FILE_CONTEXT_TYPE , _TRANSMITFILEARGS , _OPEN_FILE , _AIO_WORK_ITEM , _FFSTREAM
  • hFileRepClient : tReq , tSReq
  • hFileRepServer : tReq , ThreadArgs
  • hFont : Props
  • hGlobalHeap : _CONFIGURATION_ENTRY
  • hHandle : tagHANDLES , ARRAYQ
  • hHeap : _DYNAMIC_LOCKS_STORE
  • hIcon : tagICONEXTRACT , _tagTools
  • hImpToken : _tagLogon
  • hInstance : WININFO , GLOBAL_STRUCT , EXEDLLICONINFO
  • hIocp : _SOCK_INFO
  • hItem : TREEINFO
  • HitSize : InkHitTest::InkHitTest
  • HitTestItem : InkHitTest::InkHitTest
  • HitTestRadius : InkErase::InkErase
  • hkeyParameters : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • hkRegRoot : _RURASREGROOT
  • hLine : tagLINEINFO
  • hList : FONTLIST
  • hListCand : _IMEUIDATA
  • hListCandMem : _IMEUIDATA
  • hLoadedInst : tagSERVERINFO
  • hLocalFile : tReq , tSReq , ThreadArgs
  • hLogHandle : _CONFIGURATION_ENTRY
  • hLogon : _tagLogon
  • hManagerEntity : _SNMP_MGR_SESSION
  • hMapFile : _FileInfo
  • hMem : blockTag
  • hMemAND : tagICONEXTRACT
  • hMenu : tagPOPUPMENUMAP
  • hMetaf : _PRTDATA
  • hmf : APMFILEHEADER
  • hMgmHandle : _CONFIGURATION_ENTRY
  • hMgrNotificationEvent : _CONFIGURATION_ENTRY
  • hmidi : tag_seq
  • hNew : pipe_state
  • hOld : pipe_state
  • hOpen : REQUEST_CONTEXT
  • host : CStaticNode::privateData
  • hours : _DOSDTTM
  • HP : CSharp_Draw::Form1
  • hParent : TREEINFO
  • hpbImage : tag_track , tag_smf
  • hpbParm : tagEVENT
  • hpbPendingUserEvent : tag_smf
  • hPdu : _SNMP_MGR_SESSION
  • hPeriodicTimer : _INTERFACE_ENTRY
  • hPipe : WRITER_PARAMS , WRTHANDLE
  • hPort : _WORK_THREAD_DATA
  • hPrevThread : _threadparameters
  • hPrinter : _Printer , _threadparameters
  • hProcessHeap : _APPMEM_INSTANCE
  • hProvider : _PROVIDER
  • hQueue : RECEIVE_CONTEXT
  • hr : _RUREGVALUE , _tagWorkerThreadArgs , _tagPREPAREFORSYNCCOMPLETEDMSG , _tagSYNCHRONIZECOMPLETEDMSG , _tagSHOWPROPERTIESCOMPLETEDMSG , _tagSHOWERRORCOMPLETEDMSG , _tagMETHODARGS , _tagITEMCONFIGSETTINGSLPARAM , _tagCONFIGSETTINGSLPARAM , tagADSERRMSG , _SFFS , CADVCGENDlg , _ERRORMAP
  • hReceiveEvent : _INTERFACE_ENTRY
  • hReceiveWait : _INTERFACE_ENTRY
  • hRequest : REQUEST_CONTEXT
  • hResource : REQUEST_CONTEXT , _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • hResourceHandle : _FILESHARESAMPLE_RESOURCE , _CLIPBOOKSERVER_RESOURCE
  • hResult : IADsErrorVtbl , CAsyncQuerySink
  • hrGiveResponse : tagAppletTokenRequest
  • hrLastError : DebugGlobals
  • hRootKey : DOREGSTRUCT , _REGSTRUCT , REGSTRUCT , REGENTRY
  • hrRequest : HTTP_REQUESTCB_PARAM
  • hrResult : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • hRtmHandle : _CONFIGURATION_ENTRY
  • hRtmNotificationHandle : _CONFIGURATION_ENTRY
  • hScrollBar : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • hseparator : TableHdr
  • hService : _CLIPBOOKSERVER_RESOURCE
  • hseTf : _AIO_WORK_ITEM
  • hSmf : tag_smfopenstruct , tag_seq
  • hSnmpSession : _SNMP_MGR_SESSION
  • hstmt : DBCONN , tagSERVERINFO
  • htask : tag_smf
  • htCall : _DRVLINE
  • hTempoMap : tag_smf
  • hThread : THREADINFO , DBG_THREAD_INFO , REQUEST_CONTEXT , WRTHANDLE
  • hTimerQueue : _CONFIGURATION_ENTRY
  • htLine : _DRVLINE
  • htMSPLineHandle : _DRVLINE
  • hTokenHandle : tSReq , tReq
  • hTreeItem : tagObject
  • hVbl : _SNMP_MGR_SESSION
  • hViewContext : _SNMP_MGR_SESSION
  • hWindow : REQUEST_CONTEXT
  • hwnd : view , _tagStatus , _tagWorkerThreadArgs , tagSERVERINFO
  • hWnd : _threadparameters , _SOCK_INFO , _SNMP_MGR_SESSION , tag_seq
  • hwnd : _tagTools
  • hWnd : _BALLDATA
  • hWndButton : TEXTBUTTON_STRUCT
  • hWndFormatListBox : CHILDWINDOWDATA
  • hwndHidden : _PROPSHEETCFG
  • hWndListBox : GLOBAL_STRUCT , DEB_STARTUP_INFO_STRUCT
  • hWndMain : GLOBAL_STRUCT
  • hwndOwner : COLORPICKSTATE
  • hWndParent : _tagSYNCHRONIZEMSG , CREATEGIZMOA , _tagSHOWERRORMSG , _tagSHOWPROPERTIESMSG , _tagPREPAREFORSYNCMSG , CREATEGIZMOW
  • hwndParentSheet : _PROPSHEETCFG , _DSA_SEC_PAGE_INFO
  • hWndResults : CREATEDATA
  • hWndStopButton : CREATEDATA
  • hWndSynch : _SynchInfo
  • hWndToolBar : GLOBAL_STRUCT
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- i -

  • i : UnionInt64
  • iBrushStyle : tagBRUSHSTYLELOOKUP
  • ic : Serialization::SerializationForm , InkHitTest::InkHitTest
  • icmp6_checksum : icmpv6_hdr
  • icmp6_code : icmpv6_hdr
  • icmp6_echo_id : icmpv6_echo_request
  • icmp6_echo_sequence : icmpv6_echo_request
  • icmp6_type : icmpv6_hdr
  • icmp_checksum : icmp_hdr
  • icmp_code : icmp_hdr
  • icmp_id : icmp_hdr
  • icmp_sequence : icmp_hdr
  • icmp_type : icmp_hdr
  • iComment : tagCMTMLTFMT
  • IconBox : Sample::UI::AboutBox
  • IconImages : ICONRESOURCE
  • iCurrentXTranslation : SPINCUBEINFO
  • iCurrentXTranslationInc : SPINCUBEINFO
  • iCurrentYTranslation : SPINCUBEINFO
  • iCurrentYTranslationInc : SPINCUBEINFO
  • iCurrentZTranslation : SPINCUBEINFO
  • iCurrentZTranslationInc : SPINCUBEINFO
  • id : CBicycle , CSkateboard , CIceSkate , CSkyVehicle , statel , TableHdr , ColPropsList , CellDataList , TableSelection , PrintContext , CAsyncTest::threadParam , IIDLookUp
  • iDataSize : WRITER_PARAMS
  • idButton : TEXTBUTTON_STRUCT
  • idCommand : MYTOOLINFO
  • idCount : MEMICONDIR , ICONDIR
  • ident : tagCMTMLTFMT
  • idEntries : MEMICONDIR , ICONDIR
  • idReserved : MEMICONDIR , ICONDIR
  • idsMsg : tagSTATMESSAGEMAP
  • idString : MYTOOLINFO
  • idType : MEMICONDIR , ICONDIR
  • idxDisk : SIndexedDisk
  • idxTrack : tag_track
  • iField : FieldInfo
  • iForm : SStemForm
  • iGiveWidth : _tagStatus
  • iGizmo : CREATEGIZMOA , CREATEGIZMOW
  • igsStats : _CONFIGURATION_ENTRY
  • iHeight : _tagTools
  • iHelloCount : CDllShared
  • iIcon : tagLABELEXTRACT
  • iid
: fullsvr::ICallFactory
, vcacct::CGetReceipt
, vcacct::CMoveMoney
, fullsvr::ICancelMethodCalls
, vcacct::CUpdateReceipt
, vcacct::IAccount
, fullsvr::IFullServ
, vcacct::IGetReceipt
, vcacct::IMoveMoney
, fullsvr::ISynchronize
, vcacct::IUpdateReceipt
, cascadeec::INewsEvent
, cascadeec::INewsEventDefault
, comadmin::COMAdminCatalog
, comadmin::COMAdminCatalogCollection
, comadmin::COMAdminCatalogObject
, comadmin::ICatalogCollection
, comadmin::ICatalogObject
, comadmin::ICOMAdminCatalog
, newseventclass::INewsEvent
, newseventclass::INewsEventDefault
, persistatl::INewsEvent
, persistatl::INewsEventDefault
, qcnotify::INotify
, qcnotify::INotifyDefault
, qcorder::IOrder
, qcorder::IOrderDefault
, qcship::IShip
, qcship::IShipDefault
, msado15::_ADO
, msado15::_Collection
, msado15::_Command
, msado15::_Connection
, msado15::_DynaCollection
, msado15::_Parameter
, msado15::_Record
, msado15::_Recordset
, msado15::_Stream
, msado15::ADOCommandConstruction
, msado15::ADOConnectionConstruction
, msado15::ADOConnectionConstruction15
, msado15::ADORecordConstruction
, msado15::ADORecordsetConstruction
, msado15::ADOStreamConstruction
, msado15::Command
, msado15::Command15
, msado15::Connection
, msado15::Connection15
, msado15::ConnectionEvents
, msado15::ConnectionEventsVt
, msado15::Error
, msado15::Errors
, msado15::Field
, msado15::Field15
, msado15::Fields
, msado15::Fields15
, msado15::Fields20
, msado15::IRecFields
, msado15::Parameter
, msado15::Parameters
, msado15::Properties
, msado15::Property
, msado15::Record
, msado15::Recordset
, msado15::Recordset15
, fullsvr::AsyncFullServ
, msado15::Recordset20
, msado15::Recordset21
, fullsvr::AsyncIFullServ
, msado15::RecordsetEvents
, msado15::RecordsetEventsVt
, fullsvr::FullServ
, msado15::Stream
, vcacct::CAccount
  • iImage : CREATEGIZMOA , CREATEGIZMOW , MYTOOLINFO
  • iInfo : tagRGPT
  • iInit : _PREF
  • iInUse : blockTag
  • iisStats : _INTERFACE_ENTRY
  • iItem : tagUser
  • iLastX : CSharp_Draw::Form1
  • iLastY : CSharp_Draw::Form1
  • iLen : item_tag , RUN
  • iLine : DebugGlobals
  • iList : SStemForm
  • iMapMode : tagMAPMODELOOKUP
  • iMaxScale : PROVTYPEINFO
  • iMaxWidth : _tagStatus
  • ImeState : _IMEUIDATA
  • IMGID_IfIndex : _IPSAMPLE_MIB_GET_INPUT_DATA
  • IMGID_TypeID : _IPSAMPLE_MIB_GET_INPUT_DATA
  • IMGOD_Buffer : _IPSAMPLE_MIB_GET_OUTPUT_DATA
  • IMGOD_IfIndex : _IPSAMPLE_MIB_GET_OUTPUT_DATA
  • IMGOD_TypeID : _IPSAMPLE_MIB_GET_OUTPUT_DATA
  • iMinWidth : _tagStatus
  • iMRNumber : _metalookup
  • iMsg : GBMSG
  • IMSID_Buffer : _IPSAMPLE_MIB_SET_INPUT_DATA
  • IMSID_BufferSize : _IPSAMPLE_MIB_SET_INPUT_DATA
  • IMSID_IfIndex : _IPSAMPLE_MIB_SET_INPUT_DATA
  • IMSID_TypeID : _IPSAMPLE_MIB_SET_INPUT_DATA
  • inch : APMFILEHEADER
  • Index : ParametersVtbl , _ADODynaCollectionVtbl , tagLABELEXTRACT , ErrorsVtbl , _RecordsetVtbl , FieldsVtbl , PropertiesVtbl
  • indPtr : STR_BINDING
  • iNext : blockTag
  • InfoClass : _Query
  • initiator_address : gss_channel_bindings_struct
  • initiator_addrtype : gss_channel_bindings_struct
  • inkCollector : InkBlog::InkArea
  • inkEdMake : AutoClaims::AutoClaims
  • inkEdModel : AutoClaims::AutoClaims
  • inkEdName : AutoClaims::AutoClaims
  • inkEdPolicyNumber : AutoClaims::AutoClaims
  • inkEdYear : AutoClaims::AutoClaims
  • InkItem : InkHitTest::InkHitTest
  • inkLayers : AutoClaims::AutoClaims
  • inkPicture1 : PaperForm::PaperForm
  • inkPictVehicle : AutoClaims::AutoClaims
  • InkSpaceHeight : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • InkSpaceWidth : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • iNode : _SCHEMAINFO
  • inputArea : InkBlog::InkArea
  • INSTALL_FLAG : helper::sampleConstants
  • installCascadeButton : NewsSubscriber
  • InstallEventBorder : NewsFlash
  • installEventButton : NewsFlash
  • InterfaceID : _SAMPLE_HELPER_DATA_
  • invalidateRect : InkHitTest::InkHitTest
  • Iocp : _WSAOVERLAPPEDPLUS
  • IoctlArgs : _WSAOVERLAPPEDPLUS
  • IOOperation : _PER_IO_CONTEXT
  • iOption : tagOPTIONS
  • iOptions : SPINCUBEINFO
  • iOrdinal : INDEXINFO , COLDESC
  • ip_checksum : ip_hdr
  • ip_destaddr : ip_hdr
  • ip_id : ip_hdr
  • ip_offset : ip_hdr
  • ip_protocol : ip_hdr
  • ip_srcaddr : ip_hdr
  • ip_tos : ip_hdr
  • ip_totallength : ip_hdr
  • ip_ttl : ip_hdr
  • ip_verlen : ip_hdr
  • ipAddress : _INTERFACE_ENTRY , _BINDING_ENTRY
  • IpAddress : Static_Statistic
  • iPenStyle : tagPENSTYLELOOKUP
  • iPenWidth : tagPENWIDTHLOOKUP
  • ipMask : _BINDING_ENTRY
  • iProtocol : _SP_OPTIONS
  • ipSource : _PACKET
  • ipv6_destaddr : ipv6_hdr
  • ipv6_frag_id : ipv6_fragment_hdr
  • ipv6_frag_nexthdr : ipv6_fragment_hdr
  • ipv6_frag_offset : ipv6_fragment_hdr
  • ipv6_frag_reserved : ipv6_fragment_hdr
  • ipv6_hoplimit : ipv6_hdr
  • ipv6_nexthdr : ipv6_hdr
  • ipv6_payloadlen : ipv6_hdr
  • ipv6_srcaddr : ipv6_hdr
  • ipv6_vertcflow : ipv6_hdr
  • iRecord : _playinfo , _htdata
  • irecRecNumber : tagDIAGINFO
  • iResult : COLORPICKSTATE
  • irowbuffNext : tagRowBuff
  • iscStatus : _CONFIGURATION_ENTRY
  • isDeleted : CRocket
  • isDirty : CStaticNode::privateData
  • iSel : COLORPICKSTATE
  • isFdCloseRecd : _SOCK_INFO
  • islotFirst : tagLSTSLOT
  • islotMax : tagLSTSLOT
  • islotMin : tagLSTSLOT
  • islotNext : tagSLOT
  • islotPrev : tagSLOT
  • islotRov : tagLSTSLOT
  • isNewData : _DATA_BUFFER
  • isselected : itemlist
  • isSocketListening : _SOCK_INFO
  • iStatus : CRocket , CPlane , CRocket , CToolBarExtension , CRocket
  • iStyle : RUN
  • ItemHeader : _MOF_INFO
  • ItemID : _tagCONFIGITEMLISTVIEWLPARAM , _tagHANDLERITEMSETTINGS , _tagPROGRESSMSG , _tagSHOWPROPERTIESMSG , _tagHANDLERITEM_SYNCSTATUS , _tagITEMCONFIGSETTINGSLPARAM
  • items : complist
  • Items : PersistedConfigurationDataSet
  • ItemType : _ITEM_DESC , tagAppletRegistryItem
  • itemVect
: qcorder::Order
, qcnotify::Notify
, qcship::Ship
  • iTInfo : _RecordsetVtbl , _ParameterVtbl , FieldsVtbl , FieldVtbl , IADsErrorVtbl , _ConnectionVtbl , ADORecordsetConstructionVtbl , PropertyVtbl , _ADOCollectionVtbl , _ADOVtbl , ParametersVtbl , IUPnPService_DimmingService_SCPDVtbl , ErrorVtbl , _CommandVtbl , _ADODynaCollectionVtbl , IHelloWorldVtbl , ErrorsVtbl , IMMCControlVtbl , PropertiesVtbl
  • iToLen : _SENDTOARGS
  • iType : CREATEGIZMOA , CREATEGIZMOW
  • iUserCount : CDllShared , CDllData
  • iVal : VTUNION
  • iValue : tagCAPSLOOKUP
  • iWidth : _tagTools
  • iXScale : tagOPTIONS
  • iYScale : tagOPTIONS
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- p -

  • p : CSAFEARRAY
  • pA : CAsyncTest::threadParam
  • pAcquireCredentialsHandle : _SEC_FUNC
  • Pad : _MIDL_TYPE_FORMAT_STRING , _MIDL_PROC_FORMAT_STRING
  • Page : _RecordsetVtbl
  • PageCount : _JOB_INFO
  • pAgentCommunity : GlobalVars
  • pAgentStrAddr : GlobalVars
  • PageSize : _RecordsetVtbl , _VIRTUAL_BUFFER
  • PagesPrinted : _Job
  • pAND : ICONIMAGE
  • pAPE : IAppletSessionVtbl
  • PARALLEL_FLAG : helper::sampleConstants
  • parallelCB : NewsFlash
  • Parameters : _CommandVtbl
  • parent : direct
  • Parent : tagObject
  • Pass : helper::DatabaseSettings
  • pass : util::DatabaseSettings
  • Password : _ConnectionVtbl , _MSV1_0_INTERACTIVE_LOGON
  • Path : _ENUMERATE_DIRECTORY_STATE
  • PathEnd : _ENUMERATE_DIRECTORY_STACK
  • pb : _RecordsetVtbl
  • pbBmk : tagRowBuff
  • pbBuf : tReq , ThreadArgs
  • pbData : _RUREGVALUE
  • pbDATAFromClient : _IO_WORK_ITEM
  • pbeBindingTable : _INTERFACE_ENTRY
  • pbi : ICONIMAGE
  • pBits : ICONIMAGE
  • pbitsSlot : tagLSTSLOT
  • pBlock : item_tag
  • pbMsg : IADsErrorVtbl
  • pbNumericScale : FieldVtbl
  • pbPrecision : FieldVtbl , _ParameterVtbl
  • pbReadBuf : tSReq
  • pbScale : _ParameterVtbl
  • pbstr : ErrorVtbl , _CommandVtbl , _ConnectionVtbl , FieldVtbl , _ParameterVtbl , PropertyVtbl
  • pbstrName : _CommandVtbl
  • pBuf : _BUFFER
  • pBuffer : IAppletSessionVtbl
  • pBufferStart : PickleControlBlock
  • pbValue : tagAppletOctetString
  • pCapData : tagAppletCapability2
  • pcellpos : Table
  • pchBuffer : _AIO_WORK_ITEM
  • pChildList : _tagFILEOBJECT
  • pChildProps : NODE_PROPERTIES
  • pClient : ClientList::_tag_LIST_NODE , _RqsEngineCbInfo
  • pcmd : _RecordsetVtbl
  • pcolhdr : Table
  • pCompleteAuthToken : _SEC_FUNC
  • pComponentData : tag_BASENODE_PROPERTIES , NODE_PROPERTIES
  • pCon : _CommandVtbl
  • pconn : _RecordsetVtbl
  • PCONTEXT_HANDLE_TYPE : FileRepServer
  • pCookies : CDataObject
  • pCounterArray : _CounterInfoBlock
  • pcRefDll : CDefClassFactory
  • pctinfo : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • pCtxtBack : _PER_SOCKET_CONTEXT
  • pCtxtForward : _PER_SOCKET_CONTEXT
  • pCurrentDevice : CDeviceProp
  • pCurrentNode : LIST_STRUCT
  • pd : PrintContext
  • pdata : LineData , Table
  • pData : tagFieldMetaData , _QueueNode , _node_tag , CTE_ENCODER_STRUCT , _tagPOSDATA
  • pDataFromInteractiveUI : _EAPCB
  • pDataType : FieldVtbl
  • pDBID : _WIDEDBIDMAP
  • pDeleteSecurityContext : _SEC_FUNC
  • pDescription : dirlist
  • pDeviceInfo : _JOB_INFO
  • pdhCurrentStats : _CounterInfoBlock
  • pdimLevel : IUPnPService_DimmingService_SCPDVtbl
  • pDispParams : IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl
  • pDisPtrs : UPNPDimmerDevice , CDimmer
  • pdLevel : IUPnPService_DimmingService_SCPDVtbl
  • pDlg : CClientApp
  • pDllList : DEB_PROCESS_NODE_INFO_STRUCT
  • pdwCookie : IAppletSessionVtbl , IAppletVtbl
  • pdwIssuerChainIndex : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pdwIssuerElementIndex : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pecb : _IO_WORK_ITEM , _AIO_WORK_ITEM
  • pECB : CTE_ENCODER_STRUCT , _tagPOSDATA , ECB_QUEUE_ENTRY
  • peMarshal : _RecordsetVtbl
  • pEngine : _RqsEngineCbInfo
  • penPt : InkHitTest::InkHitTest
  • pEntryOwner : IAppletSessionNotifyVtbl
  • pEnumerateSecurityPackages : _SEC_FUNC
  • PERSIS_EVENT_NAME : helper::sampleConstants
  • PERSIS_NAME : helper::sampleConstants
  • PERSIST_EVENT_DLL : helper::sampleConstants
  • persistentHeading : NewsSubscriber
  • pExcepInfo : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • pFirst : Queue
  • pFirstGenericItem : _tagGENERICITEMLIST
  • pFirstNode : LIST_STRUCT
  • pFn : tagADSIIF
  • pfncmd : _CMD
  • pfnCompare : _HASH_TABLE
  • pfnDisplay : _HASH_TABLE
  • pfnEventProc : _DRVLINE
  • pfnFindCallback : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pfnFree : _HASH_TABLE
  • pfnHash : _HASH_TABLE
  • pfnmsg : _MSD
  • pfnRequestCB : HTTP_REQUEST_PARAM
  • pfPrepared : _CommandVtbl
  • pFreeContextBuffer : _SEC_FUNC
  • pFreeCredentialsHandle : _SEC_FUNC
  • pfTopProvider : IAppletSessionVtbl
  • pGuid : _WIDEGUIDMAP
  • pguidConstant : CONST_GUID_REP
  • pguidSchema : _SCHEMAINFO
  • phContext : tReq , ThreadArgs
  • pHead : _tagPOSTKEY
  • phtInterfaceTable : _NETWORK_ENTRY
  • pictCheckmarks : AutoClaims::AutoClaims
  • pictHorzontalBar1 : AutoClaims::AutoClaims
  • pictHorzontalBar2 : AutoClaims::AutoClaims
  • pictHorzontalBar3 : AutoClaims::AutoClaims
  • pictPolicyBox : AutoClaims::AutoClaims
  • picture1 : CSharp_Draw::Form1
  • picture1Graphics : CSharp_Draw::Form1
  • pictVehicleBox : AutoClaims::AutoClaims
  • pID : EXEDLLICONINFO
  • PID : _INITDATA
  • pidl : tagENUMLIST
  • pidlFQ : ITEMINFO
  • pidlRel : ITEMINFO
  • pIDName : IIDLookUp
  • pIID : _INTERFACEMAP , tagADSIIF
  • pInitializeSecurityContext : _SEC_FUNC
  • pInkStroke : IInkCollectorEventsImpl< T >
  • pIOContext : _PER_SOCKET_CONTEXT
  • pIOContextForward : _PER_IO_CONTEXT
  • pipName : AutoClaims::AutoClaims
  • pipPolicyNumber : AutoClaims::AutoClaims
  • pipShared : AutoClaims::AutoClaims
  • pIR : CHILDWINDOWDATA
  • pItem : COBNODE
  • pItemIDs : _tagPREPAREFORSYNCMSG , _tagSHOWERRORCOMPLETEDMSG
  • pItems : view
  • pItemSettings : _tagITEMCONFIGSETTINGSLPARAM
  • pitNext : item_tag
  • pitPrev : item_tag
  • pJobInfo : _DEVICE_INFO
  • pJobs : _Queue
  • pKey : _QueueHashNode
  • pl : ErrorVtbl , _CommandVtbl , _RecordsetVtbl , FieldVtbl , _ParameterVtbl
  • pLast : Queue
  • pLastNode : LIST_STRUCT
  • plAttr : _ConnectionVtbl
  • plAttributes : PropertyVtbl
  • PlayButton : CapJ
  • plChapter : ADORecordsetConstructionVtbl
  • plCmdType : _CommandVtbl
  • plCursorLoc : _ConnectionVtbl , _RecordsetVtbl
  • plCursorType : _RecordsetVtbl
  • pleBuckets : _HASH_TABLE
  • pLeftLink : NODE_STRUCT
  • plField : CComputer , CHuman
  • pLines : view
  • plist : ColPropsList , CellDataList
  • pListData : LIST_STRUCT
  • plLockType : _RecordsetVtbl
  • plMaxRecords : _RecordsetVtbl
  • plMode : _ConnectionVtbl
  • plObjState : _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl
  • pLockHandler : _tagSAMPLEITEMSETTINGS
  • plParmAttribs : _ParameterVtbl
  • plParmDirection : _ParameterVtbl
  • plTimeout : _ConnectionVtbl
  • Plugin : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl , RealTimeStylusPluginApp::PluginListItem
  • pMember : tagUser
  • pMemBuffer : PickleControlBlock
  • pMonitor : CClientApp
  • pMonitorCallFactory : CClientApp
  • pMonitorResponder : CClientApp
  • pMPPEKeyAttributes : _EAPCB
  • pMsgBox : CDllData
  • pmsgprops : RECEIVE_CONTEXT
  • pnConfID : IAppletSessionVtbl
  • pneNetworkEntry : _CONFIGURATION_ENTRY
  • pNext : CPlex , CFixedAlloc::CNode , tag_seq , _QueueNode , ClientList::_tag_LIST_NODE , _ASYNC_REQUEST , _node_tag , CLListImpl< TYPE, ARG_TYPE >::CNode , _tagPOSTKEY , _OPEN_FILE , COBNODE , _CounterInfoBlock , _MEMORY_ALLOC_BLOCK , RUN , tagENUMLIST , tagVIEWLIST
  • pNextDeviceInfo : _DEVICE_INFO
  • pNextGenericItem : _tagGENERICITEM
  • pnlDrawingArea : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pnlPlugins : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • pnlZoom : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • pNodeData : NODE_STRUCT
  • pNotify : IAppletSessionVtbl , IAppletVtbl
  • pnReqTag : IAppletSessionVtbl
  • pnValue : tagAppletLongString
  • pObjArray : CAsyncQuerySink
  • pObject : _XFORMDATA
  • pObjParam : CAsyncQuerySink
  • point : _htdata
  • port : _OPTIONS
  • pos : direct
  • Position : _RecordsetVtbl
  • PositionLabel : CapJ
  • Potential : _SAMPLE_HELPER_DATA_
  • pOtherDirList : dirlist
  • power : UPNPDimmerService , CDimmerService
  • pParentFolder : ITEMINFO
  • pParentObject : tag_BASENODE_PROPERTIES , NODE_PROPERTIES
  • pPattern : dirlist
  • ppDSO : ADOConnectionConstructionVtbl
  • ppiprm : _CommandVtbl
  • ppirs : _CommandVtbl
  • ppiRs : _RecordsetVtbl
  • ppiRset : _ConnectionVtbl
  • ppNewRequest : CMallocSpy
  • pPower : IUPnPService_DimmingService_SCPDVtbl
  • ppowerVal : IUPnPService_DimmingService_SCPDVtbl
  • ppowerVall : IUPnPService_DimmingService_SCPDVtbl
  • pPrev : CLListImpl< TYPE, ARG_TYPE >::CNode
  • pProcessInfo : CProcessDlg
  • ppRowPos : ADORecordsetConstructionVtbl
  • ppRowset : ADORecordsetConstructionVtbl
  • pprset : _ConnectionVtbl
  • ppSession : ADOConnectionConstructionVtbl , IAppletVtbl
  • ppTInfo : ErrorVtbl , _ParameterVtbl , _RecordsetVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • pPts : _BEZBUFFER
  • ppvObject : _ConnectionVtbl , FieldVtbl , _RecordsetVtbl , ErrorsVtbl , _ADODynaCollectionVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , ADOConnectionConstructionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IMMCControlVtbl , CProviderFactory , IAppletSessionNotifyVtbl , IAppletSessionVtbl , IAppletNotifyVtbl , IAppletVtbl , IUPnPService_DimmingService_SCPDVtbl , ParametersVtbl , PropertiesVtbl
  • pQuerySecurityPackageInfo : _SEC_FUNC
  • pRanges : HTTP_REQUEST_PARAM
  • pRasConnection0 : Static_Info_Database
  • pRasConnection1 : Static_Info_Database
  • precision : FieldInfo
  • pRecvBuf : _ClientContext , _WORK_THREAD_DATA
  • pRegistryItem : IAppletSessionNotifyVtbl
  • pRegistryKey : IAppletSessionNotifyVtbl
  • PrepareForSyncCompletedMsg : _tagMETHODARGS
  • PrepareForSyncMsg : _tagMETHODARGS
  • pRequest : IAppletSessionVtbl , IAppletVtbl
  • prev : _SOCK_INFO , Sock_Info
  • PrevBlock : blockTag
  • PrevIndex : tagLABELEXTRACT
  • Pri : tReq , tSReq
  • pRightLink : NODE_STRUCT
  • Printer : _Queue
  • ProcessDebugInfo : DEB_PROCESS_NODE_INFO_STRUCT
  • ProcessInfo : DEB_STARTUP_INFO_STRUCT
  • ProgressMsg : _tagMETHODARGS
  • propertyID : _PROPIDLIST
  • props : Title , _FILESHARESAMPLE_RESOURCE , ColProps , TableHdr , CellData
  • propsActive : _FILESHARESAMPLE_RESOURCE
  • protocol : PersistedConfiguration , Sock_Info
  • protocolInfo : _OPTIONS
  • Provider : _ConnectionVtbl , _SOCK_INFO , _WSAOVERLAPPEDPLUS
  • ProviderCritSec : _PROVIDER
  • ProviderOverlapped : _WSAOVERLAPPEDPLUS
  • ProviderPathA : _PROVIDER
  • ProviderPathLen : _PROVIDER
  • ProviderPathW : _PROVIDER
  • ProviderSocket : _SOCK_INFO , _WSAOVERLAPPEDPLUS
  • pRowPos : ADORecordsetConstructionVtbl
  • pRowset : ADORecordsetConstructionVtbl
  • proxyOnDemandCacheMiss : PersistedConfiguration
  • pSD : tagObject
  • psDataType : _ParameterVtbl
  • psdCreator : _tagLogon
  • pSendBuf : _WORK_THREAD_DATA , _ClientContext
  • pServerInfo : CAPIDoc , CServerDlg
  • pSession : IAppletNotifyVtbl
  • pSessionInfo : CQueryDlg , CSessionDlg
  • pSessionKey : IAppletSessionVtbl
  • pSettings : _tagCONFIGSETTINGSLPARAM , _tagITEMCONFIGSETTINGSLPARAM
  • pSetValue : GlobalVars
  • psFile : DebugGlobals
  • pSID : tReq , tSReq
  • pSmf : tag_track
  • pSockList : _AcceptContext
  • pSpy : CEvtStoreSub
  • pstLastModified : HTTP_REQUESTCB_PARAM
  • pstnHandle : tagLINE_INFO
  • pstrFile : tag_seq
  • pstrName : tag_smfopenstruct
  • pstrRep : CONST_DWORD_REP , CONST_GUID_REP
  • pstUnlessModifiedSince : HTTP_REQUEST_PARAM
  • psz : DWSTR , GBGETTEXTA , GBGETTEXTW
  • pszAddr : _PREF , tagUser
  • pszConferenceName : _PREF
  • pszDest : _RU_SOCKET_CREATE_DATA
  • pszDestFile : CShellExt
  • pszDocument : _Job
  • pszError : tagADSERRMSG
  • pszFileName : _PREF
  • pszName : t_Ctype , _NAMEMAP , tagUser , _RURASREGROOT , _RUREGVALUE
  • pszNewName : pipe_state
  • pszOid : GlobalVars
  • pszOldName : pipe_state
  • pszOwner : _Job
  • pszPasswd : DBCONN
  • pszPassword : _PREF
  • pszPrinterName : _Printer
  • pszServerName : _Printer
  • pszShareName : _Printer
  • pszSrc : _RU_SOCKET_CREATE_DATA
  • pszSrcFile : CShellExt
  • pszSrv : DBCONN
  • pszStatus : _Job
  • pszStr : _stringstruct
  • pszString : _RqsConfigString
  • pszText : CREATEGIZMOW , CREATEGIZMOA
  • pszUrl : HTTP_REQUEST_PARAM
  • pszUsageIdentifier : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pszUser : DBCONN
  • pT : IInkRecognitionEventsImpl< T >
  • pTempoMap : tag_smf
  • ptEnd : tagLINE
  • ptEntry : _CUSTOM_ENTRY_DATA_SAMPLE_
  • ptext : Title , CellData
  • pTextStoreACPSink : ADVISE_SINK
  • pThis : _tagWorkerThreadArgs
  • pThreadList : DEB_PROCESS_NODE_INFO_STRUCT
  • ptStart : tagLINE
  • ptype : PropertyVtbl
  • puArgErr : _ADODynaCollectionVtbl , _ADOVtbl , IMMCControlVtbl , IADsErrorVtbl , PropertiesVtbl , _ConnectionVtbl , _ADOCollectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , ErrorVtbl , _RecordsetVtbl , ParametersVtbl , IHelloWorldVtbl , ErrorsVtbl , ADORecordsetConstructionVtbl , _CommandVtbl , FieldsVtbl , FieldVtbl , PropertyVtbl
  • publishButton : NewsFlash
  • PUBLISHER_NAME : helper::sampleConstants
  • PublishEventBorder : NewsFlash
  • pUIContext : _EAPCB
  • PULL_BUFSIZE : FileRepServer
  • punkDisk : SIndexedDisk
  • punkID : ADVISE_SINK
  • punkOuter : HTTP_REQUEST_PARAM
  • pUserAttributes : _EAPCB
  • PUSH_BUFSIZE : FileRepServer
  • PushSize : tSReq
  • pval : PropertyVtbl
  • pValue : _QueueHashNode
  • pvar : FieldVtbl , _RecordsetVtbl , _ParameterVtbl , _RecordsetVtbl
  • pVarResult : IADsErrorVtbl , IHelloWorldVtbl , ErrorsVtbl , _ADOCollectionVtbl , IUPnPService_DimmingService_SCPDVtbl , _ParameterVtbl , PropertiesVtbl , _ADOVtbl , _CommandVtbl , ADORecordsetConstructionVtbl , ErrorVtbl , PropertyVtbl , FieldsVtbl , _ADODynaCollectionVtbl , FieldVtbl , _RecordsetVtbl , IMMCControlVtbl , _ConnectionVtbl , ParametersVtbl
  • pvBookmark : _RecordsetVtbl
  • pVel : _POLYDATA
  • pvFindArg : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • pView : tagVIEWLIST
  • pvSource : _RecordsetVtbl
  • pwcKey : InstDef
  • pWorkBuffer : _EAPCB
  • pwstrDescBuffer : _tagPROPSTRUCT
  • pwstrVal : _tagPROPSTRUCT
  • pwszClassId : SFilterEntry , SHandlerEntry , SClassEntry , SLangClassEntry
  • pwszClassIdDescription : SFilterEntry , SClassEntry , SLangClassEntry , SHandlerEntry
  • pwszClassIdFilter : SHandlerEntry
  • pwszComputerName : _FILESHARESAMPLE_RESOURCE
  • pwszDescription : SClassEntry
  • pwszDLL : SFilterEntry , SLangClassEntry
  • pwszEmbeddedLinks : BROWSER_CONFIG
  • pwszError : _ERRORMAP
  • pwszExpandedPath : _FILESHARESAMPLE_RESOURCE
  • pwszExt : SClassEntry
  • pwszHomePage : BROWSER_CONFIG
  • pwszIfName : _INTERFACE_ENTRY
  • pwszInterface : _INTERFACEMAP
  • pwszLangName : SLangRegistry
  • pwszName : _WIDEGUIDMAP , _WIDENAMEMAP , _SCHEMAINFO , _WIDEDBIDMAP
  • pwszPath : _FILESHARESAMPLE_PROPS
  • pwszRemark : _FILESHARESAMPLE_PROPS
  • pwszResourceName : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • pwszSchemaName : _SCHEMAINFO
  • pwszShareName : _FILESHARESAMPLE_PROPS
  • pwszShortName : SClassEntry
  • pwszString : MyString , _UNITSTABLE
  • pwszSyntax : ADSTYPEsyntaxmapping
  • pwszThreadingModel : SFilterEntry , SLangClassEntry
  • pwszTypeName : ADSTYPE_TO_STRING_ENTRY , _TYPEMAP
  • pwszUNCSharedPath : _FILESHARESAMPLE_RESOURCE
  • pwszValue : tagMULTI_SZ
  • pwzLast : filebuffer
  • pwzStart : filebuffer
  • pwzText : fileline , CellData
  • pXOR : ICONIMAGE
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- q -

  • qeEventQueueLink : _EVENT_ENTRY
  • qFriend : CSharp_Draw::Form1
  • qMe : CSharp_Draw::Form1
  • qosIoctlSet : _QOS_OPTIONS
  • qosOptions : _OPTIONS
  • qqi : igmp_hdr_query_v3
  • quantityVect
: qcorder::Order
, qcship::Ship
, qcnotify::Notify
  • QueryName : _Query
  • Queue : _WORK_QUEUE
  • queuedCascadeCB : NewsSubscriber
  • queuedCB : NewsFlash
  • queuedPersisCB : NewsSubscriber
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- r -

  • radioDSDisabled : CSharp_Draw::Form1
  • radioDSEnabled : CSharp_Draw::Form1
  • radioSendExp : CSharp_Draw::Form1
  • radioSendRec : CSharp_Draw::Form1
  • rbControl : tag_keyframe
  • rbProgram : tag_keyframe
  • rbTempo : tag_keyframe
  • rc : statel
  • rcCubeBoundary : SPINCUBEINFO
  • rcEdges : tagOPTIONS
  • rclOutput : tagCMTMLTFMT
  • READ_BUFSIZE : FileRepServer
  • realname : FLAGMAPPING
  • Reason : _WORK_QUEUE_ITEM
  • recdData : _SOCK_INFO
  • ReceiverName : _JOB_INFO
  • ReceiverNumber : _JOB_INFO
  • recent1 : CapJ
  • recent2 : CapJ
  • recent3 : CapJ
  • recent4 : CapJ
  • recentSeparator : CapJ
  • RecordsAffected : _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl
  • Rect : tagDRAWINFO
  • rect : tagTrackObject
  • rectangle : RealTimeStylusPlugins::PacketFilterPlugin
  • rectClip : tagTrackObject
  • RecvArgs : _WSAOVERLAPPEDPLUS
  • recvbuf : _RECV_INFO
  • recvBufSize : _ClientContext
  • RecvBufSize : _WORK_THREAD_DATA
  • RecvFromArgs : _WSAOVERLAPPEDPLUS
  • redPen : InkHitTest::InkHitTest
  • RefCount : CCallAsFactory , CCallAs , _SOCK_INFO
  • RegisteredChangeHandler : CachePluginAdmin
  • RegistryKey : tagAppletRegistryRequest
  • reiRtmEntity : _CONFIGURATION_ENTRY
  • relname : direct
  • RemoteFileName : tReq
  • REQUEST_ID : RSProxy
  • REQUEST_MODE : RSProxy
  • REQUEST_MODE_COMPLETE : RSProxy
  • REQUEST_MODE_PARTIAL : RSProxy
  • REQUEST_NEXT : RSProxy
  • REQUEST_PREV : RSProxy
  • REQUEST_THREAD : RSProxy
  • REQUEST_URL : RSProxy
  • REQUEST_URLCONTEXT : RSProxy
  • reserved : APMFILEHEADER
  • reserved1 : igmp_hdr_report_v3
  • reserved2 : igmp_hdr_report_v3
  • ReserveLimit : _VIRTUAL_BUFFER
  • resid : _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • RESPONSE_DATA : RSProxy
  • RESPONSE_MESSAGE : RSProxy
  • RESPONSE_NEXT : RSProxy
  • RESPONSE_REQUESTID : RSProxy
  • RESPONSE_STATUS : RSProxy
  • Restrictions : _ConnectionVtbl
  • result : compitem
  • resultCode : tphys_connect_info
  • resv_suppr_robust : igmp_hdr_query_v3
  • RetryCount : _JOB_INFO
  • reverseProxyRedirectURL : PersistedConfiguration
  • rgbBackColor : PROFILE_STRUCT
  • rgbCoreHdr : _DIBDATA
  • rgbForeColor : PROFILE_STRUCT
  • rgBindings : tagACCESSOR , BINDINGINFO
  • rgbyBuffer : _PACKET
  • rgchars : _STDZ
  • rgchFile : _OPEN_FILE
  • rgcmd : _CMDI
  • rgDispId : _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl
  • rgFieldInfo : THREAD_STRUCT
  • rgFileInfo : _DIBDATA
  • rgInts : _STANDARDSECINMEM
  • rgIssuer : Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
  • rglMask : tagSERVERINFO
  • rglpsz : _STANDARDSECINMEM
  • rgmsd : _MSDI
  • rgpbmi : _DIBDATA
  • rgpe : LOGPAL
  • rgpjFrame : _DIBDATA
  • rgPropId : _SECTION , _STANDARDSECINMEM
  • rgPropSet : _RSUMINFO , _SUMMARYINFO
  • rgPropValue : _SECTION
  • rgResInfo : _SCHEMAINFO
  • rgSections : _SUMMARYINFO
  • rgslot : tagLSTSLOT
  • rgszNames : ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , _ParameterVtbl , _RecordsetVtbl , ErrorVtbl , _ADOCollectionVtbl , _ADODynaCollectionVtbl , _ADOVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl
  • rgTime : _STANDARDSECINMEM
  • right : compitem , complist , Margin , RECTI , treeitem
  • rightbase : section
  • rightBottomHandle : InkClipboard::InkClipboard
  • rightCenterHandle : InkClipboard::InkClipboard
  • rightTopHandle : InkClipboard::InkClipboard
  • riid : PropertiesVtbl , IHelloWorldVtbl , ADOConnectionConstructionVtbl , _ConnectionVtbl , _ParameterVtbl , IMMCControlVtbl , ErrorVtbl , IADsErrorVtbl , _ADOVtbl , _ADODynaCollectionVtbl , _ADOCollectionVtbl , IUPnPService_DimmingService_SCPDVtbl , PropertyVtbl , IAppletVtbl , _CommandVtbl , CProviderFactory , _ConnectionVtbl , FieldsVtbl , PropertyVtbl , _ADOVtbl , ErrorsVtbl , IHelloWorldVtbl , ErrorsVtbl , ErrorVtbl , ErrorsVtbl , ErrorVtbl , _ADOCollectionVtbl , PropertiesVtbl , IMMCControlVtbl , IAppletNotifyVtbl , ADORecordsetConstructionVtbl , _CommandVtbl , IUPnPService_DimmingService_SCPDVtbl , IMMCControlVtbl , _CommandVtbl , _ADOVtbl , IUPnPService_DimmingService_SCPDVtbl , ParametersVtbl , _ParameterVtbl , PropertiesVtbl , _ADODynaCollectionVtbl , _RecordsetVtbl , _ADOCollectionVtbl , PropertyVtbl , FieldsVtbl , _ConnectionVtbl , _ParameterVtbl , IHelloWorldVtbl , IAppletSessionNotifyVtbl , _RecordsetVtbl , ParametersVtbl , ADORecordsetConstructionVtbl , ParametersVtbl , _RecordsetVtbl , IAppletSessionVtbl , FieldVtbl , FieldsVtbl , ADORecordsetConstructionVtbl , FieldVtbl , IADsErrorVtbl
  • riidInst : CDefClassFactory
  • root : treeitem
  • Root : NIDeque_c< T >
  • rootname : dirlist
  • RoutingInfo : _JOB_INFO
  • row : CellDataList
  • Row : CacheProxySamplePlugin::IWMSCacheItemDescriptorImpl
  • rowheight : Table
  • rows : view
  • Rows : _RecordsetVtbl
  • rowwidth : Table
  • rpeEvent : _EVENT_ENTRY
  • rrpRtmProfile : _CONFIGURATION_ENTRY
  • rsa : KEY_HEADER
  • rTracks : tag_smf
  • RWL_ReaderCount : _READ_WRITE_LOCK
  • RWL_ReaderDoneEvent : _READ_WRITE_LOCK
  • RWL_ReadWriteBlock : _READ_WRITE_LOCK
  • rwlLock : _DYNAMIC_READWRITE_LOCK , _CONFIGURATION_ENTRY , _NETWORK_ENTRY
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- s -

  • s : _CONNECTEXARGS , _TRANSMITPACKETSARGS , _WSARECVMSGARGS , _DISCONNECTEXARGS
  • s1 : _IID
  • S1 : _DOSDTTM
  • s2 : _IID
  • s_cActiveComponents : CUnknown
  • s_cfDisplayName : CDataObject , CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
  • s_cfInternal : CDataObject
  • s_cfMultiSelect : CDataObject
  • s_cfNodeType : CDataObject , CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
  • s_cfSnapinClsid : CDataObject
  • s_cfSnapInCLSID : CContextMenuExtension , CComponentData , CPropSheetExtension , CToolBarExtension
  • s_cfSZNodeType : CDataObject
  • s_CommandContextHintValues : CContextPlugin
  • S_COMPLETED : RSProxy
  • s_cServerLocks : CFactory
  • s_LocksInProgress : Provider_Globals
  • s_ObjectsInProgress : Provider_Globals
  • S_PARTIAL : RSProxy
  • S_PENDING : RSProxy
  • s_PresentationContextHintValues : CContextPlugin
  • s_UserContextHintValues : CContextPlugin
  • s_wstrNamedValueContextTypes : CContextPlugin
  • s_wstrNamedValueOutputPath : CContextPlugin
  • sAcceptSocket : _ACCEPTEXARGS
  • SaveAsMenu : Serialization::SerializationForm
  • savecomp : THREADARGS
  • savelist : THREADARGS
  • sbGesture : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • sc : STYLE
  • scale : FieldInfo
  • scenario : _ClientContext
  • sChar : tagDataStruct
  • Schema : _ConnectionVtbl
  • SchemaID : _ConnectionVtbl
  • schemaRs : CADVCGENDlg
  • scodeVal : VTUNION
  • scroll_dx : Table
  • scrollscale : Table
  • sd : _RECV_INFO , _SEND_INFO , THREADINFO
  • sDataType : _ParameterVtbl
  • sDisplayName : _EVENT_SINK_INFO
  • sdouble : tagDataStruct
  • sdword : tagDataStruct
  • SearchDirection : _RecordsetVtbl
  • sec : perf , _SFFS , _DOSDTTM
  • second : THREADARGS
  • secs_composite : compitem
  • secs_left : compitem
  • secs_right : compitem
  • section : viewline , _RSUMINFO
  • select : Table
  • selectedHidden : AutoClaims::AutoClaims
  • selectedIndex : AutoClaims::AutoClaims
  • SelectedInkWidthIncrease : InkClipboard::InkClipboard
  • selectedStrokes : InkClipboard::InkClipboard
  • selection : EDITARGS
  • selectionHandles : InkClipboard::InkClipboard
  • selectionRect : InkClipboard::InkClipboard
  • SelectionRectBuffer : InkClipboard::InkClipboard
  • selectmode : TableHdr
  • selector : _THUMB
  • selitem : itemlist
  • selvisible : Table
  • Semaphore : _WORK_QUEUE
  • SendArgs : _WSAOVERLAPPEDPLUS
  • sendBufSize : _ClientContext
  • SendBufSize : _WORK_THREAD_DATA
  • sendOffset : _DATA_BUFFER
  • SendPriority : _QOS_OPTIONS
  • sendscroll : TableHdr
  • SendToArgs : _WSAOVERLAPPEDPLUS
  • SeperatorMenu : Serialization::SerializationForm
  • seq_num : tpc_hdr
  • sequence : diritem
  • SerializedValues : CachePluginAdmin
  • server : CFactoryData
  • serverHandle : CProcessDlg , CQueryDlg , CSessionDlg , CShutdownDlg , CWaitSystemDlg
  • serverName : CAPIDoc , CProcessDlg , CQueryDlg , CServerDlg , CSessionDlg , CShutdownDlg , CWaitSystemDlg
  • ServerName : tReq
  • serviceIDDeviceMap : UPNPDimmerDevice , CDimmer
  • sessionID : CAPIDoc , CSessionDlg
  • SessionKey : tagAppletRegistryKey , tagAppletProtocolEntity , tagAppletRoster , tagAppletSessionRequest
  • set : IWMSCacheAdmin
  • sfloat : tagDataStruct
  • sfSupportFunctions : _CONFIGURATION_ENTRY
  • shipStatusVect : qcnotify::Notify , qcship::Ship
  • shorttoken : _CMD
  • show_whitespace : Table
  • ShowErrorCompletedMsg : _tagMETHODARGS
  • ShowErrorMsg : _tagMETHODARGS
  • ShowPropertiesCompletedMsg : _tagMETHODARGS
  • ShowPropertiesMsg : _tagMETHODARGS
  • ShutdownFlag : _Shutdown
  • ShutdownName : _Shutdown
  • si : TS_VERSION_INFO
  • siDisplaySize : STR_BINDING
  • sidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • SigGenObjectType : _SIGGEN_DATA_DEFINITION
  • Signature : _BLRPLATE , Serialization::SerializationForm
  • signGroupBox : Sample::UI::MainWindow
  • SineWaveDef : _SIGGEN_DATA_DEFINITION
  • size : diritem , CellPos , tagDescInfo
  • Size : _CommandVtbl , _Job , _STREAM_FIND_DATA
  • SizeToText : CapJ
  • SkipCurrent : _RecordsetVtbl
  • skybasedvehicleGuid : CComponentData
  • sLastError : DebugGlobals
  • SmallChangeSize : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • smti : tag_track
  • snapInData : CStaticNode
  • sndbuf : _SEND_INFO
  • sNext : STR_BINDING
  • sock : _SOCK_INFO , _ClientContext , _socklist
  • SockCritSec : _SOCK_INFO
  • socket : Sock_Info
  • Socket : _RU_SOCKET , _PER_SOCKET_CONTEXT
  • socket_type : Sock_Info
  • SocketAccept : _PER_IO_CONTEXT
  • SocketList : _PROVIDER
  • SockInfo : _WSAOVERLAPPEDPLUS
  • Source : _RecordsetVtbl
  • source_addr : igmp_group_record_v3
  • sources : igmp_hdr_query_v3
  • SpeakButton : CapJ
  • SpeakText : CapJ
  • SpeechOutputLabel : CapJ
  • spOptions : _OPTIONS
  • SprocketCount : _SAMPLE_HELPER_DATA_
  • sProviderAcceptSocket : _ACCEPTEXARGS
  • sqldatatype : tagFieldMetaData
  • sqltype : tagFieldMetaData
  • SquareWaveDef : _SIGGEN_DATA_DEFINITION
  • sRawSocket : _INTERFACE_ENTRY
  • src_portno : udp_hdr , tpc_hdr , port_hdr
  • ssBackOrdered : qcnotify::_ShipStatus
  • ssNotStocked : qcnotify::_ShipStatus
  • ssShipped : qcnotify::_ShipStatus
  • sString : RESULTDATA
  • ssUnprocessed : qcnotify::_ShipStatus
  • ssUnrecognizedItem : qcnotify::_ShipStatus
  • Stack : _ENUMERATE_DIRECTORY_STATE
  • Start : _RecordsetVtbl
  • start : CellPos , filebuffer
  • Start : _RecordsetVtbl
  • startcell : CellDataList , TableSelection
  • startcol : ColPropsList
  • startMoveLocation : InkClipboard::InkClipboard
  • startOid : GlobalVars
  • startrow : TableSelection
  • StartupInfo : DEB_STARTUP_INFO_STRUCT
  • StartupStatus : CGdiplusInit
  • state : compitem
  • State : tReq , tSReq , _SEC_CONTEXT
  • state : section , _CLIPBOOKSERVER_RESOURCE , _FILESHARESAMPLE_RESOURCE
  • statels : itemlist
  • Status : _DEVICE_INFO , _JOB_INFO , tReq , tSReq
  • statusBar : Sample::UI::MainWindow , Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelDrawing : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelDummy : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelLine : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelParagraph : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • statusBarPanelWord : Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm
  • Stemmer : SLangRegistry
  • StopBeforePlay : CapJ
  • StopButton : CapJ
  • stOpenAsync : msado15::StreamOpenOptionsEnum
  • stOpenFromRecord : msado15::StreamOpenOptionsEnum
  • stOpenFromURL : msado15::StreamOpenOptionsEnum
  • Storage : mib_entry
  • strDescription : _MOF_INFO , _ITEM_DESC
  • strGuid : CacheProxySamplePlugin::CacheProxyPlugin
  • strName : CSharp_Draw::Form1
  • StrokePointRadius : InkErase::InkErase
  • strParam : CAsyncQuerySink
  • strPathToConfigDoc : CachePluginAdmin
  • strPluginName : CacheProxySamplePlugin::CacheProxyPlugin
  • strSel : CacheProxySamplePlugin::IWMSCacheItemCollectionImpl
  • strSubKey1 : CacheProxySamplePlugin::CacheProxyPlugin
  • strSubKey2 : CacheProxySamplePlugin::CacheProxyPlugin
  • strType : _MOF_INFO
  • stWriteChar : msado15::StreamWriteEnum
  • stWriteLine : msado15::StreamWriteEnum
  • Submitted : _Job
  • SUBSCRIBE_FLAG : helper::sampleConstants
  • subscribePersisButton : NewsSubscriber
  • SUBSCRIBER_NAME : helper::sampleConstants
  • subscribeTransButton : NewsSubscriber
  • SubscriptionFlag : CacheProxySamplePlugin::ContentInfo
  • SuccessMessage : Sample::Messages
  • sumvalid : diritem
  • Supermetric : _SAMPLE_HELPER_DATA_
  • Support : SupportConcurList , SupportOptList
  • sword : tagDataStruct
  • symbolLabel : NewsFlash
  • symbolTF : NewsFlash
  • SynchronizeCompletedMsg : _tagMETHODARGS
  • SynchronizeMsg : _tagMETHODARGS
  • syncmgrItem : _tagSAMPLEITEMSETTINGS
  • systimeVal : VTUNION
  • sz : tagQtStruct
  • szAccount : AUTH_DATA
  • szApiFailed : GLOBAL_STRUCT
  • szAppName : GLOBAL_STRUCT
  • szBuff : tagSERVERINFO
  • szBuffer : STR_BINDING
  • szClientName : TS_VERSION_INFO
  • szColName : tagQtStruct
  • szColNames : tagQtStruct
  • szComm : _DRVLINE
  • szCommand : _ASYNC_REQUEST
  • szCommands : _DRVLINECONFIG
  • szComputerName : TS_VERSION_INFO
  • szCounterPath : _CounterInfoBlock
  • szData : WRITER_PARAMS , DOREGSTRUCT
  • szDataItem : tagQtStruct
  • szDescFieldName : tagDescInfo , tagDIAGINFO
  • szDescName : tagDescType
  • szDescription : NODESTRUCT , EXTENSION_NODE , EXTENDER_NODE
  • szDomain : _tagLogon
  • szEntryName : _CUSTOM_ENTRY_DATA_SAMPLE_
  • szExpr : CStdDbOutput
  • szFieldName : FieldInfo
  • szFile : CStdDbOutput
  • szFileName : _SFFS , EXEDLLICONINFO
  • szFormatName : ARRAYQ
  • szGDIName : _metalookup
  • szHostname : _OPTIONS
  • szIf : tagADSIIF
  • szInitialDir : PROFILE_STRUCT
  • szInstanceName : _WAVE_DATA
  • szInterface : _AcceptContext
  • szItemName : _tagHANDLERITEMSETTINGS
  • szKeyName : REGENTRY
  • szKeywords : tagSERVERINFO
  • szLength : FieldInfo
  • szLineName : tagLINEINFO
  • szLocalInterface : _OPTIONS
  • szLogFile : tagSERVERINFO
  • szMachine : params
  • szMemo : REQUEST_CONTEXT
  • szMsg : NONDIALTOKENS , CStdDbOutput
  • szName : CRocket , tagENTRY , CPlane , ADDRESS_DATA , tag_smf , CPerson
  • szNodeName : NODE_PROPERTIES , CHILD_PROPERTIES , tag_BASENODE_PROPERTIES
  • szObjectPath : _tag_NODE_ATTRIB_
  • szOriginalDLLFileName : ICONRESOURCE
  • szOriginalICOFileName : ICONRESOURCE
  • szParam : tagQtStruct
  • szParamQuery : tagQtStruct
  • szParams : FieldInfo
  • szPassword : AUTH_DATA
  • szPathName : ARRAYQ
  • szPhoneBookPath : _CUSTOM_ENTRY_DATA_SAMPLE_
  • szPort : _ClientContext , _DRVLINECONFIG , _AcceptContext
  • szPrefix : FieldInfo
  • szRemoteInterface : _OPTIONS
  • szRep : CONST_WORD_REP
  • szServer : LOGON_DATA , _ClientContext
  • szShortAppName : GLOBAL_STRUCT
  • szSource : tagSERVERINFO
  • szSubKey : DOREGSTRUCT
  • szSuffix : FieldInfo
  • szTableName : THREAD_STRUCT , tagQtStruct
  • szTemplate : _QOS_OPTIONS
  • szTest : perf
  • szTest1 : _MYDATA
  • szTest2 : _MYDATA
  • szText : Note , tagSTATUSBARLOOKUP
  • szTitle : ADDRESS_DATA
  • szToken : NONDIALTOKENS
  • szTransport : LOGON_DATA
  • szType : FieldInfo
  • szURI : ADDRESS_DATA
  • szUsage : tagEnhKeyUsage
  • szUserDomain : _RASHOST_DATA
  • szUserName : _RASHOST_DATA
  • szUsername : _tagLogon
  • szUserName : TS_VERSION_INFO
  • szUserURI : LOGON_DATA , AUTH_DATA
  • szValidLogin0 : tagSERVERINFO
  • szValidPassword0 : tagSERVERINFO
  • szValidServer0 : tagSERVERINFO
  • szValue : tagENUMPRTLOOKUP , tagCAPSLOOKUP , DOREGSTRUCT , REGENTRY
  • szValueName : REGENTRY
  • szValues : tagQtStruct
  • szVerb : VERBMAPPING
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- t -

  • tabchars : Table
  • Tag : _SIGNATURE
  • tag : compitem
  • Tail : NIDeque_c< T >
  • TapeName : STL_LABEL
  • tcAcp : _LOCINFO
  • tcLcid : _LOCINFO
  • tcLLang : _LOCINFO
  • tcNCountry : _LOCINFO
  • tcNLang : _LOCINFO
  • tcOem : _LOCINFO
  • tcp_checksum : tpc_hdr
  • tcp_urgentptr : tpc_hdr
  • tDialDlg : _CUSTOM_DIAL_DLG_SAMPLE_
  • tDialParams : _CUSTOM_DIAL_DLG_SAMPLE_
  • template_cmd : _OPTIONS
  • tEntryDlg : _CUSTOM_ENTRY_DATA_SAMPLE_
  • Terminating : _WORK_QUEUE
  • text : fileline , statel
  • textBoxName : CSharp_Draw::InputBox
  • textBoxSign : Sample::UI::MainWindow
  • textBoxVerify : Sample::UI::MainWindow
  • textChars : CSharp_Draw::Form1
  • textFriendComputer : CSharp_Draw::Form1
  • textFriendName : CSharp_Draw::Form1
  • ThickInkWidth : InkClipboard::InkClipboard , InkCollection::InkCollection
  • ThinInkWidth : InkClipboard::InkClipboard , InkCollection::InkCollection
  • thisGUID : CDeviceNode , CFolderNode , CVirtualFile
  • thisGuid : CDelegationBase , CStaticNode , CLandBasedVehicle , CPerson , CPeoplePoweredVehicle , CSkyBasedVehicle , CRocket , CSpaceVehicle , CBicycle , CBicycleFolder , CSkateboard , CSkateboardFolder , CIceSkate , CIceSkateFolder , CBackground , CBackgroundFolder , CSpaceStation , CSpaceFolder , CPlane , CSkyVehicle
  • thisGUID : CStaticNode
  • thread : Sock_Info
  • ThreadDebugInfo : DEB_THREAD_NODE_INFO_STRUCT
  • threadingModel : CFactoryData
  • thumb : _STANDARDSECINMEM
  • THUMBPRINT_LENGTH : storesh::Storesh
  • TID : _INITDATA
  • time : tagDataStruct , _TIME , _SFFS
  • Timeout : _CommandVtbl
  • timestamp : tagDataStruct
  • TimeStamp : STL_LABEL
  • timeVariable : _SFFS
  • TitleLabel : Sample::UI::AboutBox
  • titleLabel : About
  • tkBase : tag_preroll , tag_seq
  • tkDelta : tagEVENT
  • tkEnd : tag_preroll , tag_seq
  • tkLength : tag_smffileinfo , tag_track , tag_smf , tag_seq
  • tkPosition : tag_track , tag_smf
  • tkTempo : tag_tempomapentry
  • tm : tagArFonts , FONTENUM
  • To : _SENDTOARGS
  • token : _CMD
  • Token : CGdiplusInit
  • ToolBarHeight : GLOBAL_STRUCT
  • top : Margin , RECTI
  • topinner : Margin
  • toprow : Table
  • TotalPages : _Job
  • trackline1 : Table
  • trackline2 : Table
  • trackmode : Table
  • tracknr : Table
  • TransactionLevel : _ConnectionVtbl
  • TRANSIENT_NAME : helper::sampleConstants
  • transientHeading : NewsSubscriber
  • TransmitFileArgs : _WSAOVERLAPPEDPLUS
  • TransmitPacketsArgs : _WSAOVERLAPPEDPLUS
  • TriangleWaveDef : _SIGGEN_DATA_DEFINITION
  • TRUE : HelloJ , Hello3J , Hello2J , Notify
  • txtPluginDescription : RealTimeStylusPluginApp::RealTimeStylusPluginApp
  • txtResults : InkRecognition::InkRecognition
  • type : statel
  • Type : _CommandVtbl
  • type : igmp_hdr_query_v3 , igmp_group_record_v3
  • Type : tagArFonts , mib_entry
  • type : igmp_hdr_report_v3
  • TypeIndex : _MOF_INFO
  • typeOfAccept : _AcceptContext
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- u -

  • u : tagLABELEXTRACT
  • U1 : _DOSDTTM
  • uBuffersInMMSYSTEM : tag_seq
  • uChar : tagDataStruct
  • uchCaps : tagUser
  • uCompLen : _IMEUIDATA
  • uDelayID : _DLGITEMS
  • uDeviceID : tag_seq
  • UDNmapping : UPNPDimmerDevice , CDimmer
  • udp_checksum : udp_hdr
  • udp_length : udp_hdr
  • uDPI : tagTOOLDISPLAYDATA
  • udword : tagDataStruct
  • uID : CREATEGIZMOW , tagSTATMESSAGEMAP , tagPOPUPMENUMAP
  • uId : tagUser
  • uID : CREATEGIZMOA
  • uidGiveTo : tagAppletTokenRequest
  • uIDImages : tagTOOLDISPLAYDATA
  • uidInitiator : IAppletSessionNotifyVtbl
  • uidLeave : IAppletSessionNotifyVtbl
  • uidManager : IAppletSessionNotifyVtbl
  • uidMyself : IAppletSessionNotifyVtbl , IAppletNotifyVtbl
  • uiLength : _RqsConfigString
  • uImageSet : MYTOOLINFO
  • uiPort : _RU_SOCKET_CREATE_DATA
  • uiSize : _RU_SOCKET
  • uiTag : tagHeader
  • ulActivityCount : _CONFIGURATION_ENTRY
  • ulColumnSize : PROVTYPEINFO , TYPEINFO , COLDESC
  • ulCount : _IPSAMPLE_IF_BINDING , _DYNAMIC_READWRITE_LOCK
  • ulCountAllocated : _DYNAMIC_LOCKS_STORE
  • ulCountFree : _DYNAMIC_LOCKS_STORE
  • ulCreateParams : COLDESC
  • ulFiles : _DIBDATA
  • ulFrames : _DIBDATA
  • uli : _foo
  • ulIndex : TREEINFO
  • uLine : CStdDbOutput
  • ulMetric : _IPSAMPLE_IF_CONFIG , _INTERFACE_ENTRY
  • ulNumBindings : _INTERFACE_ENTRY
  • ulNumBuckets : _HASH_TABLE
  • ulNumEntries : _HASH_TABLE
  • ulNumInterfaces : _IPSAMPLE_GLOBAL_STATS
  • ulNumPackets : _IPSAMPLE_IF_STATS
  • ulOffset : FILEDEX
  • ulRefCount : tagRowBuff
  • uMCIDeviceID : tag_seq
  • uMCITimeDiv : tag_seq
  • uMCITimeFormat : tag_seq
  • uMessage : _MSD
  • uMsg : _SOCK_INFO , _MSD
  • UNINSTALL_FLAG : helper::sampleConstants
  • uNotify : _DLGITEMS
  • UNSUBSCRIBE_FLAG : helper::sampleConstants
  • urlLabel : NewsFlash
  • urlTF : NewsFlash
  • Use : _CREDENTIAL
  • UseBalloon : CapJ
  • User : util::DatabaseSettings , helper::DatabaseSettings
  • UserHid : CapJ
  • UserHidViaCharacterMenu : CapJ
  • UserID : _ConnectionVtbl
  • UserName : _MSV1_0_INTERACTIVE_LOGON
  • UseSfx : CapJ
  • uSide : tagOPTIONS
  • uState : CREATEGIZMOW , CREATEGIZMOA , tag_seq
  • uState1 : _DLGITEMS
  • uState2 : _DLGITEMS
  • uTip1 : _DLGITEMS
  • uTip2 : _DLGITEMS
  • uType : tagUser
  • uValue : GBSETINT
  • uVersion : tagUser
  • uwDescField : tagDIAGINFO , tagDescInfo
  • uwDescType : tagDescType
  • uword : tagDataStruct
  • uwTypeMask : tagDescType
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- v -

  • v : CVARIANT
  • val : _ParameterVtbl
  • Val : FieldVtbl , _ParameterVtbl
  • val : PropertyVtbl
  • valid : Props
  • VALIDITY_LENGTH : storesh::Storesh
  • Value : _CommandVtbl , Counter
  • value : _INTS , _RecordsetVtbl , GlobalVars , FLAGMAPPING , gss_buffer_desc_struct
  • Values : _RecordsetVtbl
  • varContext : CacheProxySamplePlugin::ContentInfo
  • varDefaultValue : ATTRIBUTES
  • varValue : ATTRIBUTES
  • vBookmark : _RecordsetVtbl
  • vConn : _CommandVtbl , _RecordsetVtbl
  • vCursorLib : tagSERVERINFO
  • vCustomParam : IInkRecognitionEventsImpl< T >
  • Vendor : STL_LABEL
  • version : GlobalVars
  • Version : _MOF_INFO
  • version : CFactoryData
  • version_type : igmp_hdr
  • versionLabel : About
  • view : EDITARGS , THREADARGS
  • vScrollBar : Microsoft::Samples::Ink::Cs::InkZoom::InkZoom
  • vseparator : TableHdr
  • vt : tagFieldMetaData
  • vtByteCount : _STDZ
  • vtNull : CProxy
  • vtType : _tagPROPSTRUCT , _STDZ , _THUMB , _TIME , _PROPVALUE , _INTS
  • vtValue : _PROPVALUE
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- w -

  • w0 : _foo
  • w1 : _foo
  • w2 : _foo
  • w3 : _foo
  • wait : CAsyncTest::threadParam
  • wAttr : _SFFS
  • wBitCount : ICONDIRENTRY , MEMICONDIRENTRY
  • wBmkHash : tagRowBuff
  • wchName : SInfo
  • wchVersion : SInfo
  • wCmd : _CMD
  • wCommand : _CMD
  • wcszInstanceName : _APPMEM_INSTANCE
  • wDivision : tag_filehdr
  • wFlags : _ADOCollectionVtbl , IADsErrorVtbl , IUPnPService_DimmingService_SCPDVtbl , _ADODynaCollectionVtbl , IMMCControlVtbl , CShellExt , _ADOVtbl , ErrorVtbl , ErrorsVtbl , _CommandVtbl , _ConnectionVtbl , _RecordsetVtbl , ADORecordsetConstructionVtbl , FieldVtbl , FieldsVtbl , _ParameterVtbl , ParametersVtbl , PropertyVtbl , PropertiesVtbl , IHelloWorldVtbl
  • wFormat : tag_filehdr
  • wFunc : CShellExt
  • WhiteRect : CHILDWINDOWDATA
  • WhiteTextRect : CHILDWINDOWDATA
  • WidgetCount : _SAMPLE_HELPER_DATA_
  • width : statel , Props
  • Width : ICONIMAGE
  • window_size : tpc_hdr
  • WinStationName : CSessionDlg
  • winwidth : Table
  • wMenuItem : tagMAPMODELOOKUP , tagGRAPHICLOOKUP , tagPENWIDTHLOOKUP , tagPENSTYLELOOKUP , tagBRUSHSTYLELOOKUP , tagSTATUSBARLOOKUP
  • WordBreaker : SLangRegistry
  • WorkerRoutine : _WORK_QUEUE
  • WorkerThreads : _WORK_QUEUE
  • WorkItem : _SEARCH_REQUEST
  • WorkQueue : _WORK_QUEUE_ITEM
  • wParam : GBMSG
  • wParamSheetClose : _PROPSHEETCFG
  • wPlanes : MEMICONDIRENTRY , ICONDIRENTRY
  • wpMain : _PREF
  • wpProc : _SynchInfo
  • wsabuf : _PER_IO_CONTEXT
  • wsaBuffer : _PACKET
  • WSARecvMsgArgs : _WSAOVERLAPPEDPLUS
  • wSQLType : FieldInfo
  • wstrContextName : ContextNameHint
  • wszCatalogName : TABLEINFO
  • wszColName : INDEXINFO , COLDESC , PRIMARYKEY
  • wszCreateParams : TYPEINFO
  • wszData : tagPIDLDATA
  • wszDescription : PROVIDERINFO , ENUMINFO
  • wszIndexName : INDEXINFO
  • wszLspDll : _LSP_ENTRY
  • wszName : ENUMINFO , tagPIDLDATA , PROVIDERINFO , tagFieldMetaData
  • wszParseName : PROVIDERINFO , ENUMINFO
  • wszPortName : Static_Statistic
  • wszSchemaName : TABLEINFO
  • wszTableName : TABLEINFO
  • wszType : TABLEINFO
  • wszTypeName : PROVTYPEINFO , TYPEINFO , COLDESC
  • wszUserName : Static_Statistic
  • wTag : CONST_WORD_REP
  • wTracks : tag_filehdr
  • wType : _tagTools , _SCHEMAINFO , _TYPEMAP , PROVTYPEINFO , TYPEINFO , PROVIDERINFO , INDEXINFO , COLDESC
  • wVersion : LOGPAL
  • wzBuffer : filebuffer
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- x -

  • x : tagCONSOLEDATA , _IID , POINT3D
  • X : CapJ
  • x : CPoint::POINT
  • X1 : CImp_DrawDlg::Line
  • x1 : CLine::LINEDATA
  • x2 : CLine::LINEDATA
  • X2 : CImp_DrawDlg::Line
  • xDirection : _BALLDATA
  • xfmChange : tagTrackObject
  • xfmDown : tagTrackObject
  • xForm : _MYXFORM , _BALLDATA , _XFORMDATA
  • XFrom : Util::line
  • XLabel : CapJ
  • XORImageRect : CHILDWINDOWDATA
  • XORRect : CHILDWINDOWDATA
  • XORTextRect : CHILDWINDOWDATA
  • XPacketIndex : InkClipboard::InkClipboard , InkErase::InkErase
  • xPos : PROFILE_STRUCT
  • xpos : Title
  • xPosition : _BALLDATA
  • xPosOld : GLOBAL_STRUCT
  • XTo : Util::line
  • xy : CSimpleObject
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members - Variables

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Properties
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- y -

  • y : tagCONSOLEDATA , CPoint::POINT
  • Y : CapJ
  • y : POINT3D
  • y1 : CLine::LINEDATA
  • Y1 : CImp_DrawDlg::Line
  • y2 : CLine::LINEDATA
  • Y2 : CImp_DrawDlg::Line
  • yDirection : _BALLDATA
  • year : _DOSDTTM
  • YFrom : Util::line
  • YLabel : CapJ
  • YPacketIndex : InkClipboard::InkClipboard , InkErase::InkErase
  • yPos : PROFILE_STRUCT
  • ypos : Title
  • yPosition : _BALLDATA
  • yPosOld : GLOBAL_STRUCT
  • yr : _SFFS
  • YTo : Util::line
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- j -

  • j : fullsvr.Idl , suminfo.Cpp
  • Java : bankdlg.h
  • JETERROR_FROM_HRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • jFont : Paint.h
  • JOB_INFO : NewFsp.h
  • JOB_RECEIVE : NewFsp.h
  • JOB_SEND : NewFsp.h
  • JOB_UNKNOWN : NewFsp.h
  • JOBDATA : queue.h
  • JoinMulticastGroup() : Mcastws1.c
  • Juggler() : AsyncDemo.cpp
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- k -

  • k : suminfo.Cpp
  • Key() : data.Idl
  • KEY_USAGE_SIZE : CreateCert.c
  • KeyboardHook() : Hook.c
  • KeyField() : data.Idl
  • KEYFRAME : SMF.c
  • KEYLENGTH : Decrypt.c , Encrypt.c
  • KEYQUAL : UtilLib.h
  • KF_EMPTY : SMF.c
  • kpszAppTitle : Cap.Cpp , CapMFC.Cpp , MainDlg.Cpp , Error.Cpp
  • kpszRegRoot : MainDlg.Cpp
  • KRB5_CALLCONV : GssAPI.h
  • KRB5_CALLCONV_C : GssAPI.h
  • KRB5_DLLIMP : GssAPI.h
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- l -

  • l : suminfo.Cpp
  • L_MATCH_START : sdkdiff.h
  • L_MATCH_WIDTH : sdkdiff.h
  • L_POS_START : sdkdiff.h
  • L_POS_WIDTH : sdkdiff.h
  • L_UNMATCH_START : sdkdiff.h
  • L_UNMATCH_WIDTH : sdkdiff.h
  • LABEL_BUFFER_SIZE : app.cpp
  • LABELEXTRACT : Common.h
  • lAmount : Account.Idl
  • LANGBAR_ITEM_DESC : globals.h
  • Language() : CrmFilesTest.Idl
  • LARGEBUFF : quiktest.h
  • LARGENUMBER : utils.cpp
  • LAST_ROW_FETCHED : cdbfile.h
  • LASTCOL : FullIME.h , HalfIME.h
  • LASTROW : FullIME.h , HalfIME.h
  • LaunchDlgProc() : Dlg.Cpp
  • LaunchModemControlPanelAdd() : TapiCode.c
  • LaunchTutorial() : Tutorial.cpp
  • LB2 : MousInfo.h
  • LB_ADDSTRING : winres.h
  • LBD : MousInfo.h
  • LBS_DISABLENOSCROLL : winres.h
  • LBS_EXTENDEDSEL : winres.h
  • LBS_HASSTRINGS : winres.h
  • LBS_MULTICOLUMN : winres.h
  • LBS_MULTIPLESEL : winres.h
  • LBS_NOINTEGRALHEIGHT : winres.h
  • LBS_NOREDRAW : winres.h
  • LBS_NOTIFY : winres.h
  • LBS_OWNERDRAWFIXED : winres.h
  • LBS_OWNERDRAWVARIABLE : winres.h
  • LBS_SORT : winres.h
  • LBS_STANDARD : winres.h
  • LBS_USETABSTOPS : winres.h
  • LBS_WANTKEYBOARDINPUT : winres.h
  • LBU : MousInfo.h
  • LcbDiskFreeSpace : wn_dos.h
  • LcbDiskFreeSpaceWin() : wn_dos.h
  • lcd() : FTPJr.cpp
  • LcidDlgProc() : nlsapi.c
  • LcidFromHttpAcceptLanguage() : QSample.Cxx
  • lcidLOCALE_INVARIANT : msistuff.cpp , setup.cpp
  • LD_SOCKET : Globals.h
  • LD_STATUS : Globals.h
  • LDAP_PROV : attributes.cpp
  • LDM_CONNECTED : Globals.h
  • LEAK_TIMER : LeakyBin.h
  • LEAVE_SAMPLE_API : defs.h
  • LEAVE_SAMPLE_WORKER : defs.h
  • LeaveSampleWorker() : utils.c , utils.h
  • LEFT : Rebar.c
  • LENGTH_IS_BOUND : common.h
  • LENGTH_OFFSET : spy.cpp
  • LENGTHSIZE : spy.cpp
  • lenof : FindStream.c
  • LESSTHAN : common.h
  • lf : FontView.c , Font.c , Data.c , IMEApps.h
  • LF_DISCARD : line.cpp
  • LF_HASHVALID : line.cpp
  • LfcrToNull() : Commands.Cpp , Commands.h
  • LFSIZE : Font.c
  • lfWM_CF_LF : Font.c
  • LIBID_ADODB : adoint.h
  • LIBID_ADSERRORLib : ADsError.h , ADsError_i.c
  • LIBID_ADSFIRSTEXTLib : ADsFirstExt.h , ADsFirstExt_i.c , ADsFirstExt.h , ADsFirstExt_i.c
  • LIBID_ATLCONTROLLib : atlcontrol.h
  • LIBID_MYDEVICELib : MyDevice.h , MyDevice_i.c , MyDevice.h , MyDevice_i.c
  • LIBID_NmApplet : iapplet.c , iapplet.h
  • LIBID_THEPROVIDERLib : theprovider.h
  • LibMain() : gutils.cpp , dllstub.c , DropExt.C
  • LibMain32() : MainDll.Cpp
  • LICENSE_EXT_STR : Server.h
  • LICENSE_FILE_EXT : AppUtil.h
  • LICSERVE_TUTFILE_STR : LicClien.h
  • LIGHTGRAY : MfEdit.h
  • lindex : ias.h
  • LINE : line.h , DrawArea.h , drawarea.h
  • line_compare() : line.cpp , line.h
  • line_delete() : line.cpp , line.h
  • line_gethashcode() : line.cpp , line.h
  • line_getlinenr() : line.cpp , line.h
  • line_getlink() : line.cpp , line.h
  • line_gettabbedlength() : line.cpp , line.h
  • line_gettext() : line.cpp , line.h
  • line_gettextlen() : line.cpp , line.h
  • line_gettextW() : line.cpp , line.h
  • LINE_INFO : nullmdm.h
  • line_isblank() : line.cpp , line.h
  • LINE_LEN : Client32.h , Server32.h , Monkey.h
  • line_link() : line.cpp , line.h
  • line_new() : line.cpp , line.h
  • line_numbers : sdkdiff.cpp , sdkdiff.h
  • line_reset() : line.cpp , line.h
  • lineCallbackFunc() : TapiCode.c
  • LINECONFIG_SIZE : Atsp.c
  • LINEINFO : Dialer.c
  • LineInUseProc() : Dialer.c
  • LineItem() : QCNotify.Idl , QCOrder.Idl , QCShip.Idl , QCNotify.Idl , QCOrder.Idl , QCShip2.Idl
  • lineNextPrev() : dbh.cpp
  • LINENOTUSEABLE_ALLOCATED : TapiCode.c
  • LINENOTUSEABLE_ERROR : TapiCode.c
  • LINENOTUSEABLE_INUSE : TapiCode.c
  • LINENOTUSEABLE_NOCOMMDATAMODEM : TapiCode.c
  • LINENOTUSEABLE_NODATAMODEM : TapiCode.c
  • LINENOTUSEABLE_NOMAKECALL : TapiCode.c
  • LINENOTUSEABLE_NOVOICE : TapiCode.c
  • LINENUMBER_OFFSET : spy.cpp
  • LINENUMBERSIZE : spy.cpp
  • LinesMatch() : section.cpp
  • LINETO : Common.h
  • LISet32() : suminfo.Cpp
  • LIST : list.h , LinkList.h
  • List_AddAfter() : list.cpp , list.h
  • List_AddBefore() : list.cpp , list.h
  • List_AddFirst() : list.cpp , list.h
  • List_AddLast() : list.cpp , list.h
  • list_Alloc() : list.cpp
  • List_Card() : list.cpp , list.h
  • List_Check() : list.cpp , list.h
  • List_Clear() : list.cpp , list.h
  • List_CompareProc() : list.cpp
  • List_Create() : list.cpp , list.h , list.cpp , list.h
  • List_Delete() : list.cpp , list.h
  • List_DeleteBackwards() : list.cpp
  • List_DeleteFirst() : list.cpp , list.h
  • List_DeleteForwards() : list.cpp
  • List_DeleteLast() : list.cpp , list.h
  • List_Destroy() : list.cpp , list.h
  • List_DisplayFolder() : list.cpp , list.h
  • List_DoBackgroundMenu() : list.cpp
  • List_DoContextMenu() : list.cpp , list.h
  • List_DoDefault() : list.cpp
  • List_DoItemMenu() : list.cpp
  • List_Dump() : list.cpp , list.h
  • List_EnumObjects() : list.cpp
  • LIST_ERROR_DEREFERENCE_NULL : LinkList.h
  • LIST_ERROR_NO_FREE_MEM : LinkList.h
  • LIST_ERROR_NO_MATCH : LinkList.h
  • LIST_ERROR_NO_NODE : LinkList.h
  • List_First() : list.cpp , list.h
  • list_Free() : list.cpp
  • List_Init() : list.cpp , list.h
  • List_InsertListAfter() : list.cpp , list.h
  • List_InsertListBefore() : list.cpp , list.h
  • List_IsEmpty() : list.cpp , list.h
  • List_IsOK() : list.cpp , list.h
  • List_ItemLength() : list.cpp , list.h
  • List_Join() : list.cpp , list.h
  • List_Last() : list.cpp , list.h
  • LIST_LEFT_OF : LinkList.h
  • List_LockCurrentFolder() : list.cpp
  • List_MakeOK() : list.cpp , list.h
  • LIST_MATCH : LinkList.h
  • List_NewAfter() : list.cpp , list.h
  • List_NewBefore() : list.cpp , list.h
  • List_NewFirst() : list.cpp , list.h
  • List_NewLast() : list.cpp , list.h
  • List_Next() : list.cpp , list.h
  • LIST_NO_ERROR : LinkList.h
  • List_Notify() : list.cpp , list.h
  • List_Prev() : list.cpp , list.h
  • List_Recover() : list.cpp , list.h
  • List_Refresh() : list.cpp , list.h
  • List_ReleaseCurrentFolder() : list.cpp , list.h
  • LIST_REORDER_THRESHOLD : cache.c
  • List_REVERSETRAVERSE : list.h
  • LIST_RIGHT_OF : LinkList.h
  • List_Show() : list.cpp , list.h
  • List_SplitAfter() : list.cpp , list.h
  • List_SplitBefore() : list.cpp , list.h
  • List_Term() : list.cpp , list.h
  • List_TRAVERSE : list.h
  • ListACL() : DComPerm.h , ListAcl.Cpp
  • ListAppIDAccessACL() : DComPerm.h , Wrappers.Cpp
  • ListAppIDLaunchACL() : DComPerm.h , Wrappers.Cpp
  • ListBoxInsert() : DebMisc.c , DebMisc.h
  • ListBoxPrintF() : DebMisc.c , DebMisc.h
  • ListBoxWndProc() : MainDlg.Cpp
  • ListCards() : SCQuery.Cpp
  • ListClasses() : security.cpp
  • ListDefaultAccessACL() : DComPerm.h , Wrappers.Cpp
  • ListDefaultLaunchACL() : DComPerm.h , Wrappers.Cpp
  • Listen() : Listen.c
  • ListenOnAddress() : tapirecv.cpp
  • ListenOnAddresses() : FileTerm.cpp , FileTerm.h , Incoming.Cpp
  • ListenOnThisAddress() : FileTerm.cpp , FileTerm.h , Incoming.Cpp
  • ListGroups() : SCQuery.Cpp
  • ListIn() : Server.c
  • ListMachineAccessACL() : DComPerm.h , Wrappers.Cpp
  • ListMachineLaunchACL() : DComPerm.h , Wrappers.Cpp
  • ListNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • ListObject() : RendSam.Cpp
  • ListOut1() : Server.c
  • ListOut2() : Server.c
  • LISTPOS : list.h
  • LISTPROP : keys.cpp
  • ListReaders() : SCQuery.Cpp
  • ListView_GetCheckState : AdvReco.cpp
  • ListView_SetCheckState : selectEventsDlg.Cpp , AdvReco.cpp
  • ListViewNotify() : VListVw.c
  • ListWalkProc() : Xmitu.c , Xmitu.h
  • llfromuls() : PMMStrm.Hxx
  • LO_BYTE : parser.h
  • Load() : ips.h , PAPINT.Idl
  • LoadAndStretch() : bitmaps.Cxx , bitmaps.h
  • LoadBalancing : comspyctl.idl
  • LoadCharacter() : Hello3.Cpp
  • LoadDIB() : Dibapi.h , File.c
  • LoadDll() : common.h
  • Loaded() : PAPINT.Idl
  • LoadExtensionFunction() : extension.cpp
  • LoadFileAsByteArray() : util.cpp , util.h , util.cpp , util.h
  • LoadInstalledCodecs() : InstCodc.Cpp
  • LoadLanguageResource() : global.c
  • LoadModuleConfig() : Redir401.cpp
  • LoadRcString() : gutils.h , sdkdiff.cpp
  • LoadResourceString() : common.h , utils.cpp
  • LoadSecurityLibrary() : WebClient.c , WebServer.c
  • LoadWTSAPI() : Tst4Wts.c
  • LOCAL : cfactory.h
  • LOCAL_CREATE_ERR_STR : DComDraw.h
  • LOCAL_HEAP_INFO : PerfUtil.h
  • LOCAL_NUMBER : Dialer.c
  • LocalAllocString() : Privobji.Cpp
  • LocaleToCodepage() : CodePage.Cxx , CodePage.Hxx , QSample.Cxx
  • LocalFreeString() : Privobji.Cpp
  • LocalToAnsi() : Utility.Cpp , Utility.h
  • LocalToWideChar() : Main.cpp , ADEvent.cpp , Utility.Cpp , Utility.h , IcnOvrly.Cpp , IcnOvrly.h
  • LocateBuffer() : Stubs.c
  • LocateContext() : Stubs.c
  • LocateCredential() : Stubs.c
  • LocateQueue() : DrawDlg.Cpp , drawdlg.cpp
  • LocateSecBuffer() : Stubs.c
  • LocateSigBuffer() : Stubs.c
  • LocateTargetQueue() : MqTrans.Cpp
  • LOCINFO : global.h
  • Lock() : PAPINT.Idl
  • LOCK_MODE : sync.h
  • Locked() : PAPINT.Idl
  • LOCKED_LIST : sync.h
  • LOCKED_LIST_INITIALIZED : sync.h
  • LOCKED_QUEUE : sync.h
  • LOCKED_QUEUE_INITIALIZED : sync.h
  • LockServer() : icf.h
  • LOCKSTORE : defs.h
  • LockTypeEnum : adoint.h
  • LockVolume() : Mfmt.c
  • LockWindowInfo() : GdiDemo.h , Wininfo.c
  • LODWORD : sdksamplestoragesystem.h
  • Log() : Debug.Cpp , Global.h
  • LOG : AppUtil.h , keys.cpp
  • LOG_DEBUG : Perfmsg.h
  • LOG_MAX_LINE : PoolWrap.cpp
  • LOG_MSG : Global.h
  • LOG_NONE : Perfmsg.h
  • LOG_RM_ABORT_REQUEST : SimpleLog.Idl
  • LOG_RM_CHECKPOINT : SimpleLog.Idl
  • LOG_RM_COMMAND : SimpleLog.Idl
  • LOG_RM_COMMIT_REQUEST : SimpleLog.Idl
  • LOG_RM_ENDOFLOG : SimpleLog.Idl
  • LOG_RM_PRIVATE : SimpleLog.Idl
  • LOG_RM_XACT_BEGIN : SimpleLog.Idl
  • LOG_RM_XACT_COMMIT : SimpleLog.Idl
  • LOG_RM_XACT_END : SimpleLog.Idl
  • LOG_RM_XACT_PREPARE : SimpleLog.Idl
  • LOG_STATUS_REPORT : Common.h
  • LOG_STATUS_REPORT_MINOR : Common.h
  • LOG_STATUS_REPORT_MINOR_STRING : Common.h
  • LOG_STATUS_REPORT_STRING : Common.h
  • LOG_STATUS_REPORT_STRING2 : Common.h
  • LOG_STATUS_REPORT_STRING3 : Common.h
  • LOG_STATUS_REPORT_STRING4 : Common.h
  • LOG_USER : Perfmsg.h
  • LOG_VERBOSE : Perfmsg.h
  • LOGASSERT : AppUtil.h
  • LOGERR : defs.h
  • LOGERR0 : defs.h
  • LOGERR1 : defs.h
  • LOGERR2 : defs.h
  • LOGERR3 : defs.h
  • LOGERR4 : defs.h
  • LOGERROR : AppUtil.h
  • LogError : adoisapi.cpp , common.h , tapisend.cpp
  • LOGERRORMSG : Handler.h
  • LOGF1 : AppUtil.h
  • LOGF2 : AppUtil.h
  • LOGF3 : AppUtil.h
  • LogFile : FaxSiren.Cpp , Admapit.c , ComSpyCtl.Idl , MtsSpyCtl.Idl
  • LOGFILE : SubAuth.c
  • logfile : GssServer.c
  • LogFileCount : tracedmp.cpp
  • LogFileHandle : Dt.h , Dt_Dll.Cpp
  • LogFontProc() : Font.c
  • LogFormat() : common.h , tapirecv.cpp , common.h , tapisend.cpp
  • LoggerHandle : TraceDp.c
  • LOGHANDLE : defs.h
  • LOGID : AppUtil.h
  • LOGINFO : defs.h
  • LOGINFO0 : defs.h
  • LOGINFO1 : defs.h
  • LOGINFO2 : defs.h
  • LOGINFO3 : defs.h
  • LOGINFO4 : defs.h
  • LogInValid : Admapit.c
  • LOGLEVEL : defs.h
  • LogMessage() : tapirecv.cpp , common.h , tapisend.cpp
  • LogMsg() : Debug.Cpp , Global.h
  • LOGMSG() : Utils.cpp , Utils.h
  • LOGMSGERROR() : Utils.h , Utils.cpp , Utils.h
  • LOGNAME : log.c , FaxSiren.Cpp
  • LOGOFF : Global.h
  • LOGOFF_PAGE : CustomAuth.h
  • LOGON : Security.Cpp , Global.h
  • LOGON_PAGE : CustomAuth.h
  • LogonDialogProc() : rtcdialogs.cpp
  • LogonDlgProc() : Main.h , Security.Cpp
  • LogOnOffDlgProc() : Dlg.Cpp
  • Logons : Security.Cpp
  • LogonToDB() : MqTrans.Cpp
  • LogResult() : Global.h
  • LOGSAMPVER : log.c
  • LOGSOURCE : log.c
  • LogStackWalk() : DebugHandler.Cpp
  • LogTestCancel() : Global.h
  • LogTestStart() : Global.h
  • LogTestStop() : Global.h
  • LogToFile() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • LOGWARN : defs.h
  • LOGWARN0 : defs.h
  • LOGWARN1 : defs.h
  • LOGWARN2 : defs.h
  • LOGWARN3 : defs.h
  • LOGWARN4 : defs.h
  • LOGWARNDATA : defs.h
  • LOGWARNDATA2 : defs.h
  • long2bstr : dynamic.h
  • LONG2POINT : Mypal.h , Menu.h
  • LONG_DISTANCE_NUMBER : Dialer.c
  • LongQuote() : news.Idl
  • LONGSTRING : prsample.h , helper.h
  • LookupAccountOtherSid() : Check_SD.h , Helper.c
  • LookupCatalog() : QSample.Cxx
  • LookupColumnName() : dump.cpp , sampclnt.h
  • LookupFree() : data.Idl
  • lookupStringFromMsgDll() : log.c
  • LookupUserInCache() : AuthFilt.h , cache.c
  • LookupUserInDb() : AuthFilt.h , db.c
  • LookupWSAEventSelect() : rusocket.cpp , rusocket.h
  • loop : PrPerf.c
  • LOOP_FOREVER : Sockdupc.c
  • LOOPCOUNT : ComSyncTest.Cpp , FreeTest.Cpp , STATest.Cpp
  • LOOPS : ComPerf.Cpp
  • looptot : PrPerf.c
  • LOW : nshsamp.h
  • LowerRect() : status.cpp
  • LowLevelFormat() : Mfmt.c
  • lp : suminfo.h
  • lpAbortDlg : tprint.cpp
  • lpAbortProc : tprint.cpp
  • lpAdviseSink : OleStd.h
  • LPASYNCITEST : main.cpp
  • LPBALLDATA : Bounce.h
  • LPBASENODE : basenode.h
  • LPBEZBUFFER : Poly.h
  • LPBITARRAY : bitarray.h
  • LPBOOL : Utils.h
  • LPBOUNCEDATA : Bounce.h
  • lpBuffer : Client32.c , Server32.c
  • LPCALLFACTORY : main.cpp , DCOMServer.h , CAsyncXXX.h
  • lpCandList : Data.c , IMEApps.h
  • LPCClassFactory : Cfact.h
  • lpCellData : table.h
  • lpCellDataList : table.h
  • lpCellPos : table.h
  • lpcfFmt : OleStd.h
  • LPCHILDPROPS : basenode.h
  • lpClassFactory : SimpSvr.Cpp
  • LPCLIENTSECURITY : ComPerf.Cpp
  • lpclsid : OleStd.h
  • LPCMALLOCSPY : malspy.c
  • LPCMD : Global.h
  • LPCMDI : GLOBALS.h , Globals.h
  • LPCOL : Main.Cpp , Global.h , Main.Cpp
  • lpColProps : table.h
  • lpColPropsList : table.h
  • LPCOMPERFORMANCE : ComPerf.Cpp
  • LPCREATEGIZMO : GizmoBar.h
  • LPCREATEGIZMOA : GizmoBar.h
  • LPCREATEGIZMOW : GizmoBar.h
  • LPCSHELLEXT : ShellExt.h
  • LPCSHELLEXTCLASSFACTORY : ShellExt.h
  • lpCSimpleApp : SimpCntr.Cpp , SimpDnd.Cpp
  • lpCSimpSvrApp : SimpSvr.Cpp
  • lpCurrentTime : Prof.cpp , prof.cpp
  • lpData : ClipText.c
  • LPDOREGSTRUCT : OLEDoc.Cpp , BandObjs.Cpp
  • LPDRAWDATA : Draw.h
  • LPDRAWINFO : Common.h
  • lpdwIDTable : ImeMenu.c
  • LPDWORD : OleStd.h , enablerouter.c
  • lpdwRegister : OleStd.h
  • lpDX : OleStd.h
  • LPENUMLIST : Enumidl.h
  • LPEVENTID : CConnectionPT.h
  • LPEXTBUFFER : extbuff.h
  • LPFFSTREAM : FindStream.c
  • LPFILEDEX : fileidx.h
  • LPFILEOBJECT : Handler.h
  • LPFILEOBJECTLIST : Handler.h
  • lpfnCallback : msgfiltr.h
  • LPFNDLLFUNC : Cmd.Cpp
  • LPFNDTHANDLER : Handlers.h
  • lpfnFilterProc() : Find.h , Find.c
  • lpfnInputEdit : EDITCTLS.c
  • lpfnKeyHook : WinCap.c
  • lpfnOldHook : WinCap.c
  • lpfnOleUIHook : msgfiltr.h
  • LPFNOLEUIHOOK : OleStd.h
  • LPFNREG : ComPerf.Cpp
  • LPFNWSAEXCEPTIONNOTIFY : Dt_Dll.h
  • LPFNWSANOTIFY : Dt_Dll.h
  • LPFONTLIST : Dialogs.c
  • LPFONTSTRUCT : Dialogs.c
  • lpFr : Find.c
  • lpFrequency : prof.cpp , Prof.cpp , prof.cpp
  • LPGBGETINT : GizmoBar.h
  • LPGBGETTEXT : GizmoBar.h
  • LPGBGETTEXTA : GizmoBar.h
  • LPGBGETTEXTW : GizmoBar.h
  • LPGBMSG : GizmoBar.h
  • LPGBSETINT : GizmoBar.h
  • LPGENERICITEM : Enum.h
  • LPGENERICITEMLIST : Enum.h
  • LPHANDLERITEM_SYNCSTATUS : Handler.h
  • LPHANDLERITEMSETTINGS : Settings.h
  • lpHANDLES : quiktest.c
  • lpHatchRect : OleStd.h
  • LPHEADER : malspy.c
  • LPICMP_HDR : iphdr.h
  • LPICONEXTRACT : Common.h
  • LPINTERFACEIMPL : OleStd.h
  • lpInterfaceInfo : msgfiltr.h
  • LPIPV4_HDR : iphdr.h
  • LPIPV4_OPTION_HDR : iphdr.h
  • LPIPV6_FRAGMENT_HDR : iphdr.h
  • LPIPV6_HDR : iphdr.h
  • LPITEMINFO : enumdesk.h
  • LPLABELEXTRACT : Common.h
  • lpLineData : tpriv.h
  • LPLINEINFO : Dialer.c
  • LPLOCINFO : global.h
  • LPLPFNDTHANDLER : Handlers.h
  • lplpmk : OleStd.h
  • lplpszType : OleStd.h
  • LPLPVOID : sampprov.h
  • lpMalloc : OleStd.h
  • lpMargin : table.h
  • LPMAZEDATA : Maze.h
  • lpMedium : OleStd.h
  • lpmedium : OleStd.h
  • LPMETA16HEADER : MfEdit.h
  • lpmfp : suminfo.Cpp
  • lpmkFull : OleStd.h
  • LPMSD : Global.h , Msg.Cpp , Global.h
  • LPMSDI : Globals.h , GLOBALS.h
  • LPMYDATA : ComDlg32.C
  • LPMYIMEMENUITEMINFO : Wapi.h
  • LPMYSTR : Wapi.h
  • LPMYTOOLINFO : Tools.h
  • LPMYXFORM : Bounce.h
  • lpNil : Global.h
  • LPNODE_PROPERTIES : basenode.h
  • LPNODEPROPS : basenode.h
  • lpObj : OleStd.h
  • LPOLESTDENUMFMTETC : enumfetc.c
  • LPOLESTDENUMSTATDATA : enumStat.c
  • LPOLESTDMESSAGEFILTER : msgfiltr.c
  • LPOLESTR : OleStd.h
  • LPOPEN_FILE : openf.c
  • LPOPTIONSTRUCT : WinCap.h
  • LPOVERLAPPED : enablerouter.c
  • LPPIDLDATA : PidlMgr.h
  • LPPOLYDATA : Poly.h
  • LPPREROLL : SEQ.h
  • lpPrintContext : table.h
  • lpPriorityList : OleStd.h
  • LPPRIVCLIPDATA : Utility.h
  • lpProcEdit : Main.Cpp , Init.Cpp , ui.cpp
  • lpProps : table.h
  • LPPROVIDER : provider.h
  • lpptOffset : OleStd.h
  • lprcClipRect : OleStd.h
  • lprcHatchRect : OleStd.h
  • lprcIPObjRect : OleStd.h
  • lprcLogical : OleStd.h
  • lprcPhysical : OleStd.h
  • lprcViewportOld : OleStd.h
  • lprcWindowOld : OleStd.h
  • LPRECT : OleStd.h
  • lpRect : OleStd.h
  • LPREGSTRUCT : ADEvent.cpp , SampView.Cpp , IcnOvrly.Cpp
  • LPRGPT : Mypal.h
  • lProcessDIDClear() : MfEdit.c
  • lProcessDIDFf() : MfEdit.c
  • lProcessDIDOpen() : MfEdit.c
  • lProcessDIDPlay() : MfEdit.c
  • lProcessDIDPlayStep() : MfEdit.c
  • lProcessDIDPlayTenPlus() : MfEdit.c
  • lProcessDIDRec() : MfEdit.c
  • lProcessDIDStop() : MfEdit.c
  • lProcessMMAbout() : MfEdit.c
  • lProcessMMBrush() : MfEdit.c
  • lProcessMMCopy() : MfEdit.c
  • lProcessMMDel() : MfEdit.c
  • lProcessMMExport3X() : MfEdit.c
  • lProcessMMFit2Wnd() : MfEdit.c
  • lProcessMMFont() : MfEdit.c
  • lProcessMMHittest() : MfEdit.c
  • lProcessMMImport3X() : MfEdit.c
  • lProcessMMLEAbout() : MfEdit.c
  • lProcessMMLoadBmp() : MfEdit.c
  • lProcessMMLoadMaskBmp() : MfEdit.c
  • lProcessMMMltfmts() : MfEdit.c
  • lProcessMMPaste() : MfEdit.c
  • lProcessMMPen() : MfEdit.c
  • lProcessMMPolyDraw() : MfEdit.c
  • lProcessMMPrint() : MfEdit.c
  • lProcessMMRec() : MfEdit.c
  • lProcessMMSaveBmp() : MfEdit.c
  • lProcessMMStrokeFill() : MfEdit.c
  • lProcessWmCommand() : MfEdit.c
  • lProcessWmCreate() : MfEdit.c
  • lProcessWmDestroy() : MfEdit.c
  • lProcessWmDrawClip() : MfEdit.c
  • lProcessWmSize() : MfEdit.c
  • LPRSI : suminfo.Cpp
  • lps : suminfo.Cpp
  • LPSAMPLEITEMSETTINGS : Settings.h
  • lpSERVERINFO : autotest.h , custom.c
  • lpSI : quiktest.c
  • LPSIZEL : OleStd.h
  • lpSizelHim : OleStd.h
  • lpSSIM : suminfo.Cpp
  • lpStartTime : prof.cpp , Prof.cpp , prof.cpp
  • LPSTDZ : suminfo.h
  • lpStg : OleStd.h
  • LPSTR : OleStd.h
  • LPSTR2BSTR() : nmsession.cpp , plugxprt.cpp , utils.cpp
  • LPSTREAM_FIND_DATA : FindStream.h
  • LPSTZR : suminfo.h
  • lpSumInfo : suminfo.Cpp
  • LPSUMINFO : suminfo.h
  • LPSYNCHRONIZE : CAsyncXXX.h , main.cpp , DCOMServer.h
  • lpsz : suminfo.h
  • lpszAgent : AsyncDemo.cpp
  • lpszAuxUserType : OleStd.h
  • lpszContainerApp : OleStd.h
  • lpszContainerObj : OleStd.h
  • lpszCustFilterString : Open.h
  • lpszDst : OleStd.h
  • lpszFilterString : Open.h
  • lpszFullUserTypeName : OleStd.h
  • lpszIface : OleStd.h
  • lpszMsg : OleStd.h
  • lpszName : suminfo.h , OleStd.h
  • lpszPrefix : OleStd.h
  • lpszServerName : Admapit.c
  • lpszSrcOfCopy : OleStd.h
  • lpszStgName : OleStd.h
  • lpszString : OleStd.h
  • lpszUserType : OleStd.h
  • lpTable : tpriv.h
  • lpTableHdr : table.h
  • lpTableSelection : table.h
  • lpTargetDevice : OleStd.h
  • lpTestFunc : custom.c
  • LPTEXTBUTTON : ToolBar.h
  • LPTHUMB : suminfo.h
  • lpTitle : table.h
  • LPTOOLDISPLAYDATA : BttnCur.h
  • LPTSTR : Utils.h , APP.h
  • lpuUnique : OleStd.h
  • LpvAlloc() : Util.Cpp , Global.h , Util.Cpp , Global.h
  • LPVERBMAPPING : ContMenu.Cpp
  • LPVIEWLIST : Viewlist.h
  • LPVOID : suminfo.Cpp
  • lpVtbl : atlcontrol.h , ADsError.h , MyDevice.h , iapplet.h , ADsFirstExt.h , adoint.h
  • lpwAlign() : OpenDIB.c , DynDlg.c
  • LPWSAOVERLAPPEDPLUS : provider.h
  • LPXFORMDATA : XForm.h
  • lRandom() : GdiDemo.c , AppUtil.h , GdiDemo.h , AppUtil.h , AppUtil.Cpp
  • lSecondAccount : Account.Idl
  • LSP_ENTRY : instlsp.cpp
  • LSP_OP_ACCEPTEX : provider.h
  • LSP_OP_CONNECTEX : provider.h
  • LSP_OP_DISCONNECTEX : provider.h
  • LSP_OP_IOCTL : provider.h
  • LSP_OP_RECV : provider.h
  • LSP_OP_RECVFROM : provider.h
  • LSP_OP_SEND : provider.h
  • LSP_OP_SENDTO : provider.h
  • LSP_OP_TRANSMITFILE : provider.h
  • LSP_OP_TRANSMITPACKETS : provider.h
  • LSP_OP_WSARECVMSG : provider.h
  • LspCatalog32Only : install.h
  • LspCatalog64Only : install.h
  • LspCatalogBoth : install.h
  • LSTRCPYN : OleStd.h
  • lstrcpyn() : Utils.Cpp
  • lstrcpyW : Helper.h
  • lstrcpyX() : Helper.h , Helper.Cpp
  • lstrncat : AppUtil.h , DoServer.h
  • LSTSLOT : hashtbl.h
  • lTranType : Account.Idl
  • LV_ALLITEMS : common.h
  • LV_ALLSELITEMS : common.h
  • LV_FindItem() : cdialoglite.cpp , winmain.cpp , cdialoglite.h , winmain.h
  • LV_GetAllItems() : cdialoglite.h , cdialoglite.cpp
  • LV_GetItemImage() : cdialoglite.h , cdialoglite.cpp
  • LV_GetItemParam() : cdialoglite.h , cdialoglite.cpp
  • LV_GetItemState() : cdialoglite.cpp , cdialoglite.h
  • LV_GetItemText() : cdialoglite.h , cdialoglite.cpp
  • LV_GetSelItems() : cdialoglite.h , cdialoglite.cpp
  • LV_InsertColumn() : winmain.cpp , winmain.h , cdialoglite.cpp , cdialoglite.h
  • LV_InsertItem() : winmain.cpp , cdialoglite.cpp , winmain.h , cdialoglite.h
  • LV_SetItemImage() : cdialoglite.cpp , cdialoglite.h
  • LV_SetItemParam() : cdialoglite.h , cdialoglite.cpp
  • LV_SetItemState() : cdialoglite.h , winmain.h , cdialoglite.cpp , winmain.cpp
  • LV_SetItemText() : cdialoglite.h , cdialoglite.cpp , winmain.h , winmain.cpp
  • LVM_ERR : common.h , winmain.h
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- m -

  • m : suminfo.Cpp
  • m_dwLastScrollDir : idt.h
  • m_dwNextScrollTime : idt.h
  • m_dwSrcAspect : idt.h
  • m_dwStrong : iec.h
  • m_dwTimeEnterScrollArea : idt.h
  • m_fCanDropCopy : idt.h
  • m_fCanDropLink : idt.h
  • m_fDragFeedbackDrawn : idt.h
  • m_fOpen : ioo.h
  • m_fSameAsLoad : ips.h
  • m_hModule : RecoDll.cpp
  • m_lpApp : icf.h
  • m_nCount : ioipao.h , ioipo.h , ioo.h , ips.h , ido.h , iec.h
  • m_pApp : ioipf.h
  • m_pDoc : ids.h , idt.h
  • m_pSite : ias.h , iocs.h , ioips.h , ias.h , iocs.h
  • m_ptLast : idt.h
  • m_rcDragRect : idt.h
  • MACHINE_NAME : log.c
  • MACRO_AbortCleanup : keys.cpp
  • MAILSLOT : Bcast.c
  • main() : RootDSE.cpp , FileRep.cpp , FileRepServer.cpp , main.cxx , FileRepService.cpp , filerep.cpp , Simple.c , AdsiDump.cpp , filerepservice.cpp , filerep.cpp , main.cxx , filerepservice.cpp , filerep.cpp , main.cpp , Binding.cpp , filerepserver.cpp , filerepservice.cpp , Child.cpp , Cxhndlc.c , Cxhndls.c , main.cpp , Create.cpp , Usrdefc.c , Usrdefs.c , Delete.cpp , Helloc.c , Hellos.c , Range.c , Enum.cpp , Picklpc.c , Pickltc.c , Filter.cpp , Pipec.c , Pipes.c , callbackclient.Cpp , First.cpp , RPCssmc.c , RPCssms.c , Move.cpp , Client.C , Service.C , cppclient.Cpp , Parent.cpp , Client.c , Server.c , Read.cpp , Admapit.c , sampletest.cxx , scaledemo.Cpp , Rename.cpp , loadprotocol.c , main.cpp , Schema.cpp , main.cpp , SnmpUtil.C , Test.Cxx , Search.cpp , WSnmpUtil.Cpp , RendSam.Cpp , Write.cpp , tapirecv.cpp , tapisend.cpp , SServer.Cpp , bthcxn.cpp , RegDevice.cpp , main.cpp , dhcpnotify.cpp , TestAccept.cpp , PrPerf.c , SServer.Cpp , dhcppersist.cpp , ATMEvent.Cpp , Bcast.c , dhcprequest.cpp , IocpClient.Cpp , IocpServer.Cpp , ComPerf.Cpp , DNSQuery.Cpp , IocpServerex.Cpp , rawudp.c , ModifyRecords.cpp , instlsp.cpp , Mcastws1.c , Client.Cpp , Simple.c , Mcastws2.c , Overlap.c , QosEvent.Cpp , Ping.cpp , rcvall.c , sclient.cpp , Qoslist.Cpp , rnrcs.cpp , Ioctl.c , enablerouter.c , Simplec.c , Simples.c , sserver.cpp , IPArp.Cpp , Sockdupc.c , Sockdups.c , IPChange.Cpp , AclApi.c , AuthzCli.c , Client.c , IPConfig.Cpp , AuthzSvr.c , Client.c , IPRenew.Cpp , Server.c , SecFile.c , Server.Cxx , IPRoute.Cpp , SidClean.c , TakeOwn.c , IPStat.Cpp , TextSid.c , CreateCert.c , Client.Cxx , DirEncrypt.Cpp , Decrypt.c , Encrypt.c , Main.Cpp , EnumAlgs.c , InitUser.c , Server.Cxx , Main.Cpp , LsaPrivs.c , GssClient.c , MQPort.Cpp , GssServer.c , HttpGet.c , client.cxx , MqTestOA.Cpp , Client.cpp , Server.cpp , MqTrans.Cpp , WebClient.c , WI_SSL_Client.Cpp , Driver.Cpp , MSMQTest.c , WebServer.c , sa.Cpp , customentry.c , SamplCli.Cpp , MethCli.Cpp , Driver.Cpp , RasGetConnectionStatistics.c , PathParser.cpp , QueryParser.cpp , RasDial.c , Consumer.Cpp , WMIDiskPerf.Cpp , main.cpp , RasDialAsync.c , Main.Cpp , FTPJr.cpp , RasEnumConnections.c , httpauth.cpp , RetOptions.cpp , sampclnt.cpp , RasEnumDevices.c , SetOptions.cpp , SimpleBrowser.cpp , RasEnumentries.c , BPSampTest.c , Main.c , sampclnt.h , AsyncRPCc.c , dbh.cpp , DebugHandler.Cpp , AsyncRPCs.c , log.c , tracedmp.cpp , utiltest.cpp , ClUuidc.c , TraceDp.c , TraceLog.c , ClUuids.c , AsyncIO.c , EnumMountPoints.c , attributes.cpp , DUnionc.c , FCopy.Cpp , Mfmt.c , DUnions.c , Mount.Cpp , UnMount.Cpp , Credentials.cpp , InOutc.c , app.cpp , UnBufCp1.c , InOuts.c , UnBufCp2.c , NmPipe.c , gcallusers.cpp , Repasc.c , Client.c , Service.c , Repass.c , Tst4Wts.c , getdomainmode.cpp , Xmitc.c , Xmits.c , main.cpp , Dyneptc.c , Dynepts.c , main.cpp , DynOutc.c , DynOuts.c
  • MAIN_APP_NAME_STR : DComDraw.h , RESDEF.h , StoClien.h
  • MAIN_CLASS_NAME : Common.h
  • MAIN_CLASS_STYLE : Common.h
  • Main_CreateImageList() : enumdesk.cpp
  • MAIN_ICON : Resource.h
  • Main_InitApplication() : enumdesk.cpp
  • Main_InitInstance() : enumdesk.cpp
  • MAIN_KEY_STRING : Utility.Cpp
  • MAIN_MENU_NAME : Common.h
  • Main_OnActivate() : WndProc.c
  • Main_OnCommand() : enumdesk.cpp , WndProc.c
  • Main_OnCreate() : WndProc.c
  • Main_OnDestroy() : WndProc.c
  • Main_OnLButtonDown() : WndProc.c
  • Main_OnLButtonUp() : WndProc.c
  • Main_OnMouseMove() : WndProc.c
  • Main_OnMove() : WndProc.c
  • Main_OnNCHitTest() : WndProc.c
  • Main_OnPaint() : WndProc.c
  • Main_OnRButtonDown() : WndProc.c
  • Main_OnSize() : WndProc.c
  • Main_OnTimer() : WndProc.c
  • Main_OnWindowPosChanged() : WndProc.c
  • Main_SizeChildren() : enumdesk.cpp
  • Main_UpdateMenu() : enumdesk.cpp
  • MAIN_WINDOW_CLASS_MENU : DfV.h
  • MAIN_WINDOW_CLASS_MENU_STR : DfV.h , AptClien.h , AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , LocServe.h , RESDEF.h , RemClien.h , StoClien.h
  • MAIN_WINDOW_CLASS_NAME : DfV.h
  • MAIN_WINDOW_CLASS_NAME_STR : AptClien.h , AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , LocServe.h , RESDEF.h , RemClien.h , StoClien.h
  • MAIN_WINDOW_MASTER_STR : DComDraw.h
  • MAIN_WINDOW_SLAVE_STR : DComDraw.h
  • MAIN_WINDOW_TITLE_STR : AptClien.h , AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , LocServe.h , RESDEF.h , RemClien.h , StoClien.h
  • MAIN_WND_STYLE : Common.h
  • MAIN_WND_TITLE : Common.h
  • Main_WndProc() : enumdesk.cpp
  • MainConsole() : main.cpp
  • MainDialogProc() : FileTerm.cpp , FileTerm.h , Incoming.Cpp , Outgoing.Cpp
  • MainDlgProc() : DoServer.Cpp , DoServer.h , ui.cpp
  • MainExecute() : main.cpp
  • MainThread() : main.cpp
  • MainUI_OnClose() : InstCodc.Cpp
  • MainUI_OnCommand() : InstCodc.Cpp
  • MainUI_OnDestroy() : InstCodc.Cpp
  • MainUI_OnInitDialog() : InstCodc.Cpp
  • MainUIProc() : InstCodc.Cpp
  • MainUpCallTable : provider.h , spi.cpp
  • MainWindowProc() : MousInfo.c , MousInfo.h
  • MainWndProc() : sdkdiff.cpp , OleImp.Cpp , OleApt.Cpp , SimpCntr.Cpp , SimpCntr.h , SimpDnd.Cpp , SimpDnd.h , SimpSvr.Cpp , SimpSvr.h , MfEdit.c , MfEdit.h , Printer.c , Printer.h , PlgBlt.c , PlgBlt.h , WxForm.c , WxForm.h , Dialer.c , ASAccept.cpp , DebMain.c , Client32.h , Server32.c , Server32.h , ClipText.c , CDTest.c , CDTest.h , ComDlg32.C , ComDlg32.h , Property.c , Rebar.c , VListVw.c , VListVw.h , SpinTest.c , SpinTest.h , Cursor.c , Cursor.h , IMEApps.c , IMEApps.h , MultiUI.C , MultiUI.h , DynDlg.c , DynDlg.h , Globals.h , WndProc.c , DragImg.Cpp
  • MAKE_STR_LOCAL_COPYA2W : ansiapi.h
  • MAKE_STR_LOCAL_COPYW2A : ansiapi.h
  • MAKE_TSTRPTR_FROMWIDE : globals.h , Globals.h , globals.h
  • MAKE_WIDEPTR_FROMTSTR : globals.h , Globals.h , globals.h
  • MAKE_WIDEPTR_FROMTSTR_ALLOC : globals.h , Globals.h , globals.h
  • MAKEADSENTRY : StdAfx.h
  • MakeAuthenticationAttributes() : Eap.c , Eap.h
  • MakeCanonicalNumber() : Dialer.c
  • MakeCommonDebugEventString() : DebMisc.c , DebMisc.h
  • MAKEDWORDLONG : Cleanup.h
  • MakeFamilyPath() : AppUtil.Cpp , AppUtil.h
  • MakeIconFromResource() : Icons.C , Icons.h
  • MAKEINTI : SERVER.CPP
  • MAKEINTS1 : SERVER.CPP
  • MAKEINTS2 : SERVER.CPP
  • MAKEINTVERB : SERVER.CPP
  • MakeJobStatusStr() : printjob.c , quecore.h
  • MakeMap() : section.cpp
  • MAKEMPOINT : Select.h
  • MakeMPPEKeyAttributes() : Eap.c , Eap.h
  • MakeNewANDMaskBasedOnPoint() : Icons.C , Icons.h
  • MakeOctetADSVALUE() : main.cpp
  • MakePaintString() : Comp.c
  • MakePrinterStatusStr() : printjob.c
  • MAKEQWORD : sdksamplestoragesystem.h
  • MakeRequestMessage() : Eap.c
  • MakeResponseMessage() : Eap.c , Eap.h
  • MakeResponseMessage1() : Eap.c , Eap.h
  • MakeResultMessage() : Eap.c , Eap.h
  • MakeSDAbsolute() : DComPerm.h , SDMgmt.Cpp
  • MakeSignature() : Stubs.c
  • MakeTheCall() : Outgoing.Cpp
  • MAKEULONGLONG : sdksamplestoragesystem.h
  • MAKEVERSION : cfactory.h , SERVER.CPP
  • MakeWindowClass() : APP.Cxx , APP.Hxx
  • MALLOC : dballoc.Cpp , defs.h , PropCert.Cpp
  • Malloc : ATMEvent.h
  • MallocSpy_QueryInterface() : malspy.c
  • MallocSpyDump() : spy.cpp , spy.h
  • MallocSpyRegister() : spy.cpp , spy.h
  • MallocSpyUnRegister() : spy.cpp , spy.h
  • ManageAssistedTelephony() : Dialer.c
  • ManagerSid : AuthzSvr.c
  • ManagerSidBuf : AuthzSvr.c
  • ManualConstruct() : data.Idl
  • map() : client.cxx
  • MAP_LOGHIM_TO_PIX : OleStd.h , site.Cpp
  • MAP_PIX_TO_LOGHIM : OleStd.h
  • MapAdsTypeFromString() : UserProps.cpp , UserProps.h
  • MapCarList : list.h
  • MapCarQueue : list.h
  • MapCarStack : list.h
  • MapEvent() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • MapMandatoryUserAttribToType() : UserProps.cpp , UserProps.h
  • MAPMODELOOKUP : Printer.h
  • MapNewEntriesToOld() : instlsp.cpp
  • MapOptionalUserAttribToType() : UserProps.cpp , UserProps.h
  • MappedFileIO : AsyncIO.h
  • MapStateToString() : bits_ie.cpp
  • MapStringToAppInfo : StdAfx.h
  • MapTypeToADSTYPE() : UserProps.cpp , UserProps.h
  • MapUserAttribToType() : UserProps.cpp , UserProps.h
  • MARK_DESC : globals.h
  • MARK_DESC_A : globals.h
  • MARK_ICON_INDEX : globals.h
  • MARK_LANGBARITEMSINK_COOKIE : langbar.cpp
  • MARK_LANGID : globals.h
  • MARK_MODEL : globals.h
  • MARSHAL_TUTFILE_STR : AptClien.h , DComDraw.h , LocClien.h , RemClien.h
  • MarshalOptionsEnum : adoint.h
  • MASK_bACCESS : wn_dos.h
  • MASK_bSHARE : wn_dos.h
  • MASK_CLIENT_ACCESS_BIND : Service.cpp , EvProv.Cpp
  • MASK_fINH : wn_dos.h
  • MASKROOT : Grid.Hxx
  • MATCH_DEFAULT : table.cpp
  • MATCH_EXACT : table.cpp
  • MATCH_SIZE : table.cpp
  • MATCH_TYPE : table.cpp
  • MatchedFileCount : AsyncIO.h
  • MatchedLineCount : AsyncIO.h
  • MATERIAL_COL : people.Cpp
  • MAX : sampprov.h , defs.h , instlsp.cpp
  • MAX_ACCOUNT_LENGTH : sa.Cpp
  • MAX_ADDLEN : Bcast.c
  • MAX_ADS_ENUM : enum.cxx
  • MAX_ADS_FILTERS : enum.cxx
  • MAX_ADSPATH_CHARS : Main.cpp
  • MAX_ALLOWED_ENTITY_SIZE : DumpRequestInfo.cpp
  • MAX_ALLOWED_REQUEST_ENTITY : UpCaseMap.cpp
  • MAX_APPNAME_SIZE : selectEventsDlg.Cpp
  • MAX_ARRAYSIZE : MfEdit.h
  • MAX_ASYNC_RETRIES : asyncselect.cpp
  • MAX_ATM_INTERFACE_LEN : ATMEvent.h
  • MAX_ATTRIBS : main.cpp
  • MAX_ATTRIBUTES : Enumprt.h
  • MAX_BEZIER : Poly.h
  • MAX_BIND_ARRAY_ELEMENT : quiktest.h
  • MAX_BIND_ELEMENTS : quiktest.h
  • MAX_BIND_LEN : sampprov.h
  • MAX_BINDINGS : sampclnt.h
  • MAX_BLOCK_SIZE : common.h , tablecopy.h , common.h
  • MAX_BRUSHSTYLES : Printer.h
  • MAX_BUF_SIZE : PhoneEntry.c , areadcli.c
  • MAX_BUFF_SIZE : IocpServer.h
  • MAX_BUFFER : MqTestOA.Cpp , MSMQTest.c , formdump.cpp
  • MAX_BUFFER_LEN : WSnmpUtil.h
  • MAX_BUFFER_SIZE : Pipeproc.c , util.h , ftrans.c , fwasync.c , fwrite.c
  • MAX_BUFFERED_RESPONSE_SIZE : DumpRequestInfo.cpp
  • MAX_BUTTONTEXT_LEN : ShortName.h , Cleanup.h
  • MAX_CACHED_USERS : cache.c
  • MAX_CBFMT : TIMEWND.c
  • MAX_CHARS_PER_LINE : FullIME.h
  • MAX_CLIENTS : common.h
  • MAX_CLIP_CAPS : Getcaps.h
  • MAX_CMD_ARGS : cmsample.cpp
  • MAX_COL_DIST : MfEdit.h
  • MAX_COL_SIZE : prsample.h , common.h , tablecopy.h
  • MAX_COLOR : Enumprt.h
  • MAX_COLOR_FORMAT : MDIChild.C
  • MAX_COLUMN_LIST_SIZE : quiktest.h
  • MAX_COLUMN_NAME_SIZE : quiktest.h
  • MAX_COLUMNS : fileio.h
  • MAX_COLUMNSIZE : crow.h
  • MAX_COMMAND_LENGTH : sa.Cpp
  • MAX_COMP_STRING_LEN : FullIME.h
  • MAX_COMPOSITIONS : tsfedit.h
  • MAX_CONCURRENT_IO : UnBufCp1.c , UnBufCp2.c
  • MAX_CONFIG_LINE : Redir401.cpp , ReMapUrl.cpp
  • MAX_COUNT : adoheader.h
  • MAX_CRL_PROP : exit.cpp , Exit.Cpp
  • MAX_CURVE_CAPS : Getcaps.h
  • MAX_DATA : PidlMgr.h
  • MAX_DATA_LEN : Monkey.h
  • MAX_DATA_SIZE : quiktest.h
  • MAX_DEBUG_OUTPUT : IsapiDebug.h
  • MAX_DEBUGSTR : customentry.c
  • MAX_DEFAULTSOURCE : Enumprt.h
  • MAX_DEPTH : AsyncIO.h
  • MAX_DESC_BUF : quiktest.h
  • MAX_DESCRIPTION_LEN : ShortName.h , Cleanup.h
  • MAX_DEV_NAME_LENGTH : Atsp.h
  • MAX_DEVICE_CAPS : Getcaps.h
  • MAX_DIALOGS : msiloc.cpp
  • MAX_DISPLAY_LEN : ShortName.h , Cleanup.h
  • MAX_DISPLAY_SIZE : prsample.h
  • MAX_DTCODE : Dt_Dll.h , Dt_Dll.Hpp
  • MAX_DUPLEX : Enumprt.h
  • MAX_ELEMENTS : Repasc.c , Xmitc.c
  • MAX_ENTRY_SIZE_NOMSG : Prof.cpp , prof.cpp
  • MAX_ENUMERATORS : BasicHiPerf.h
  • MAX_ERR_STRING : MfEdit.h
  • MAX_ERROR_SIZE : quiktest.h
  • MAX_FIELD : quiktest.h
  • MAX_FIELD_DATA_SIZE : limits.h
  • MAX_FIELDS : Enumprt.h
  • MAX_FILE : MfEdit.h
  • MAX_FILEPATH : MidiPlyr.h
  • MAX_FORMAT : MqTrans.Cpp , MSMQTest.c
  • MAX_FORMAT_NAME_LEN : DrawDlg.Cpp , drawdlg.cpp
  • MAX_FORMAT_STRINGS : dbh.cpp
  • MAX_FP : Dt.h
  • MAX_FRAME : MfEdit.h
  • MAX_GETBLK_OIDS : WSnmpUtil.h
  • MAX_GRAPHICS : Common.h
  • MAX_GUID_STRING : sampclnt.h
  • MAX_GUID_STRING_LEN : WiaWrap.cpp
  • MAX_GUID_STRING_LENGTH : util.h
  • MAX_GUIDSTR_LEN : Common.h
  • MAX_HASH : ssl.c
  • MAX_HEAP_SIZE : sampprov.h
  • MAX_IBUFFER_SIZE : sampprov.h
  • MAX_ICON_HEIGHT : IconPRO.h
  • MAX_ICON_WIDTH : IconPRO.h
  • MAX_INPUT_BUFFER : fileio.h , myospobject.h
  • MAX_INSERT_VALUES_SIZE : quiktest.h
  • MAX_INSTANCES : BasicHiPerf.h
  • MAX_IO_PEND : Overlap.c
  • MAX_IP_SIZE : parser.h
  • MAX_KEY_NAME_LENGTH : keys.cpp
  • MAX_KEYWORD_LEN : autotest.h
  • MAX_LENGTH_GUID : setup.h
  • MAX_LICENSEKEY : Server.h
  • MAX_LINE_CAPS : Getcaps.h
  • MAX_LINE_CHARS : AppUtil.h
  • MAX_LINE_LENGTH : gutils.h
  • MAX_LINE_NUM : AppUtil.h
  • MAX_LISTCAND : FullIME.h
  • MAX_LOADSTRING : EventSink.cpp
  • MAX_LOG_LINES : AppUtil.h
  • MAX_LOGONS : Security.Cpp
  • MAX_LONG : msptrmac.cpp
  • MAX_MAP_MODES : Printer.h
  • MAX_MEMBERS : precomp.h
  • MAX_MESSAGES : MsgTest.c
  • MAX_MODES : SetDisp.h
  • MAX_MSG_BODY_LEN : DrawArea.h , drawarea.h
  • MAX_MSG_BUF_SIZE : errors.c
  • MAX_MSG_LENGTH : ComSpy.Cpp , log.c , MsgTest.c
  • MAX_MSG_SIZE : KList.c , SecFile.c
  • MAX_MSGLEN : Bcast.c
  • MAX_MSLOTNAME : Bcast.c
  • MAX_NAME : Security.Cpp , PidlMgr.h
  • MAX_NAME_LEN : prsample.h , common.h , tablecopy.h , common.h , basenode.h
  • MAX_NAME_STRING : sampclnt.h
  • MAX_NOSERVICE_PER_DEVICE : DimmerDeviceDCO.h , Dimmer.h
  • MAX_NUM_BUFFER : quiktest.h
  • MAX_NUM_FORMAT : DataObj.h
  • MAX_OBJECT_PATH : globals.h
  • MAX_OPENROWS : common.h
  • MAX_ORIENTATION : Enumprt.h
  • MAX_OUTPUT_BUFFER : myospobject.h
  • MAX_PACKET : rawudp.c
  • MAX_PACKET_FRAGMENTS : rawudp.c
  • MAX_PACKET_LENGTH : defs.h
  • MAX_PAPERSIZE : Enumprt.h
  • MAX_PARAM_SIZE : quiktest.h
  • MAX_PASSWORD : Security.Cpp
  • MAX_PASSWORD_LENGTH : sa.Cpp
  • MAX_PATH : ComDlg32.h
  • MAX_PATH_LEN : NewFsp.h
  • MAX_PENSTYLES : Printer.h
  • MAX_PENWIDTHS : Printer.h
  • MAX_PID_DIGITS : SuperUsr.cpp
  • MAX_PIPE_INSTANCES : Server32.h
  • MAX_POINTS : MfEdit.h
  • MAX_POINTS_BMP : MfEdit.h
  • MAX_POINTS_MF : MfEdit.h
  • MAX_POINTS_PER_FACET : Paint.h
  • MAX_POLYGON_CAPS : Getcaps.h
  • MAX_PREFIX : quiktest.h
  • MAX_PRINTQUALITY : Enumprt.h
  • MAX_PRIORITIES : Enumprt.h
  • MAX_PROC_COUNT : overlap.cpp
  • MAX_PROPSPEC_STRING_LENGTH : HtmlElem.Hxx
  • MAX_PROVIDERS : instlsp.cpp
  • MAX_Q_FORMATNAME_LEN : MqApiTst.h
  • MAX_Q_PATHNAME_LEN : MqApiTst.h
  • MAX_QUERY_LEN : common.h , sampprov.h , tablecopy.h
  • MAX_QUERY_SIZE : quiktest.h
  • MAX_RASTER_CAPS : Getcaps.h
  • MAX_REC_TIME : CallNot.h
  • MAX_RECENT_FILENAME : MainDlg.Cpp
  • MAX_RECENT_FILES : MainDlg.Cpp
  • MAX_RECENTCONFIGS : cdialog.h
  • MAX_RECENTFILES : cdialog.h
  • MAX_RECORD_SIZE : cdbfile.h
  • MAX_RECV_BUF_LEN : Ping.cpp
  • MAX_RESTRICTIONS : cdialog.h
  • MAX_ROW_ITEM_LIMIT : quiktest.h
  • MAX_ROWS : prsample.h
  • MAX_RTCTIMEOUT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • MAX_SEARCH_PREF : DirectorySearch.h
  • MAX_SHOW_LINES : ListWIN.h
  • MAX_SIZE : strmHelp.Cxx
  • MAX_SIZEOF_INSTANCE_NAME : AppMemi.h
  • MAX_SLIDE_INDEX : main.cpp
  • MAX_SNOOP_TEXT : snoop.h
  • MAX_SPECIAL_CHAR_LENGTH : SerStrm.Hxx
  • MAX_STATUS : Enumprt.h
  • MAX_STR : dbh.cpp , global.h
  • MAX_STR_CAPTION : setupui.h
  • MAX_STR_LENGTH : setup.h
  • MAX_STREAM_BLOCK_SIZE : tablecopy.h
  • MAX_STRING : ReadTut.h , register.h , StdAfx.h , bits_ie.cpp
  • MAX_STRING_LEN : TestMIB.h
  • MAX_STRING_LENGTH : message.h , AppUtil.h , Reg.h
  • MAX_STRING_SIZE : quiktest.h
  • MAX_STRINGS : msiloc.cpp
  • MAX_STRLEN : enablerouter.c , IPStat.h
  • MAX_STYLES : Global.h
  • MAX_SUFFIX : quiktest.h
  • MAX_SZ : ui.cpp
  • MAX_TABLE_NAME : quiktest.h
  • MAX_TABLE_NAME_SIZE : cdbfile.h
  • MAX_TAG_LENGTH : CharHash.Hxx
  • MAX_TECHNOLOGY_CAPS : Getcaps.h
  • MAX_TEXT : Global.h
  • MAX_TEXT_CAPS : Getcaps.h
  • MAX_TEXT_SIZE : TextWIN.h
  • MAX_THREADS : Utils.c , DebugHandler.Cpp
  • MAX_TICKS : SMF.h
  • MAX_TIME_LENGTH : sa.Cpp
  • MAX_TITLE_LEN : MousInfo.h
  • MAX_TOTAL_ROWBUFF_SIZE : sampprov.h
  • MAX_TYPE_NAME : quiktest.h
  • MAX_TYPES_SUPPORTED : quiktest.h
  • MAX_ULONG_STR : main.c
  • MAX_USER_INFO : autotest.h
  • MAX_USER_NAME : OleImp.Cpp
  • MAX_USERNAME_LEN : DisDraw.Cpp , mqfdraw.cpp
  • MAX_VALUE_NAME : Monkey.h
  • MAX_VAR : DrawDlg.Cpp , MqApiTst.h , logindlg.cpp , mqfdraw.cpp , MqTestOA.Cpp , MqTrans.Cpp , MSMQTest.c
  • MAX_VAR_NAME : DumpRequestInfo.cpp
  • MAX_VERB : ContMenu.Cpp
  • MAX_WIDE_BUFFER : myospobject.h
  • MAX_WORKER_THREAD : IocpServer.h
  • MAX_XML_STRING : StdAfx.h
  • MAXBUF : Open.h
  • MAXBUFSIZE : Dialer.h
  • MAXCHARS : PlgBlt.h , WxForm.h , DspFormt.Cpp
  • MAXCLIENTS : Receiver.Cpp
  • MAXCOL : FullIME.h , HalfIME.h
  • MAXCTRLS : Tools.c
  • MAXCUSTFILTER : Open.h
  • MaxDebuggeesMessageBox() : DebMisc.c , DebMisc.h
  • MAXDEPTH : fulldrag.c
  • MAXDISPLAYSIZE : EDITCTLS.c
  • MAXENTITYSTRLEN : WSnmpUtil.h
  • maxEntries : HtmlProp.Cxx
  • MAXEVENTITEMS : WaitSystemDlg.h
  • MaxEvents : TraceDp.c
  • MAXFILENAMELEN : Dlgopen.c
  • MAXFILLPOINTS : Fx.h
  • MAXFILTERS : Open.h
  • MAXFLUSH : autotest.h
  • MAXGLYPHS : DspFormt.Cpp
  • MAXGUIDESEGMENTS : GuidE.h
  • MAXHOSTNAMELENGTH : x224.h
  • MAXIMUM_LOGGERS : TraceLog.c
  • MAXIMUM_WORKER_THREADS : AsyncIO.h
  • MAXINDEX : MainFrm.Cpp
  • MAXINPUTSIZE : EDITCTLS.c
  • MAXINTS : suminfo.h
  • MAXITEM : DspFormt.Cpp
  • MAXITOA : UtilLib.h
  • MAXLINE_SIZE : ListWIN.h
  • MAXLOGFILES : tracedmp.h
  • MAXLOGST : AppUtil.h
  • MaxMediaLabel() : stl_mll.cpp , stl_mll.h
  • MAXNUMLEN : Imp_Dlg.h
  • MAXNUMLENGTH : Dialer.h
  • MAXOUTPUTSTRINGLENGTH : TapiInfo.c
  • MAXPROPS : tracedmp.h
  • MAXQUERYITEMS : QueryDlg.h
  • MAXROW : FullIME.h , HalfIME.h
  • MAXRUN : DspFormt.Cpp
  • MAXSDWORD : quiktest.h
  • MAXSHUTDOWNITEMS : ShutdownDlg.h
  • MAXSIZE_STR : MultiUI.h
  • MaxSpendingEmployee : AuthzSvr.c
  • MaxSpendingManager : AuthzSvr.c
  • MaxSpendingVP : AuthzSvr.c
  • MAXSTATUS : Status.c
  • MAXSTDZ : suminfo.h
  • MAXSTR : tracedmp.h , TraceDp.c , TraceLog.c
  • MAXTERMINALS : Incoming.Cpp , Outgoing.Cpp
  • MAXTHREADS : IocpClient.Cpp
  • MaxThroughPut : PrPerf.c
  • MAXTIME : suminfo.h
  • MAXTITLE : Title.c
  • MAXTYPE : tracedmp.h
  • MAXUDWORD : quiktest.h
  • MaxUserReqs : Service.cpp , Service.h , service.cpp , service.h
  • MAXWORD : suminfo.h
  • MaybeDeleteObject() : Util.Cpp , Global.h , Util.Cpp , Global.h , Util.Cpp
  • MAZECLASS : Maze.h
  • MazeCommandProc() : Maze.c , Maze.h
  • MazeCreateProc() : Maze.c , Maze.h
  • MAZEDATA : Maze.h
  • MazeDestroyProc() : Maze.c , Maze.h
  • MazePaintProc() : Maze.h , Maze.c
  • MazeProc() : Maze.c , Maze.h
  • MAZETITLE : GdiDemo.h
  • MB2 : MousInfo.h
  • MBCS : main.cpp
  • MBD : MousInfo.h
  • MBERROR : Grid.Cxx
  • MBERRORFLAGS : Grid.Cxx
  • mbsMachineName : MqTestOA.Cpp , MSMQTest.c
  • MBU : MousInfo.h
  • MCASTADDRV4 : Mcastws1.c , Mcastws2.c
  • MCASTADDRV6 : Mcastws1.c , Mcastws2.c
  • MCASTPORT : Mcastws1.c , Mcastws2.c
  • MCIPLAY_APP_CLASS : MciPlay.c
  • MCIPLAY_DOC_CLASS : MciPlay.c
  • mclass : MainFrm.Cpp
  • MEASUREITEMHEIGHT : Menu.h
  • MEASUREITEMWIDTH : Menu.h
  • MEDBUFF : quiktest.h
  • MEDIUM : nshsamp.h
  • MEM_ALLOC_THRESHOLD : areadcli.c
  • MemAllocMacro : Macros.h
  • MEMCMP : dballoc.Cpp
  • MEMCPY : dballoc.Cpp
  • memfill() : rawudp.c
  • MemFreeMacro : Macros.h
  • MemInitializeMacro : Macros.h
  • MEMORY_ALLOC_BLOCK : LeakyBin.h
  • MemReAllocMacro : Macros.h
  • memrev() : CertGetKey.c
  • MEMSET : dballoc.Cpp
  • MENU_ABOUT : MciPlay.h
  • MENU_CHOICE : Dialer.h
  • MENU_CLOSE : MciPlay.h
  • MENU_EXIT : MciPlay.h
  • MENU_FLIPKEYS_INDEX : langbar.cpp
  • MENU_MAX : ShlView.Cpp
  • MENU_NEW : MciPlay.h
  • MENU_OPEN : MciPlay.h
  • MENU_SHOWSNOOP_INDEX : langbar.cpp
  • MENUHACK : STATBAR.c
  • MenuInit() : Menu.c , Menu.h
  • MenuWindowProc() : Menu.c , Menu.h
  • Message() : SServer.Cpp
  • MESSAGE : SampSSP.H
  • Message() : Cancel.Cpp , SServer.Cpp , ComPerf.Cpp , Client.Cpp , sclient.cpp , sserver.cpp , client.cxx
  • MESSAGE_LEVEL : Perfmsg.h , PerfUtil.c , Perfmsg.h , PerfUtil.c
  • MESSAGE_LEVEL_DEFAULT : Perfmsg.h
  • MESSAGE_SIZE : SampSSP.H
  • MESSAGE_TYPE : SampSSP.H
  • MessageBoxA : altassrt.Cxx
  • MessageBoxFromStringIds() : message.Cxx , message.h
  • MessageBoxFromStringIdsAndArgs() : message.Cxx , message.h
  • MessagePump() : MidiPlyr.h , UIUTILS.c
  • META16HEADER : MfEdit.h
  • META32_SIGNATURE : MfEdit.h
  • METALOOKUP : MfEdit.h
  • MetaTagState : MetaTag.Hxx
  • MetaToken : HtmlScan.Hxx
  • Method : comspyctl.idl
  • METHODARGS : Handler.h
  • methoddata : ComPerf.Cpp
  • MetricsDlgProc() : Dialogs.c , FontView.c
  • MH : MousInfo.h
  • Mib : TestMIB.C , TestMIB.h
  • MIB_ACCESS_READ : TestMIB.h
  • MIB_ACCESS_READWRITE : TestMIB.h
  • MIB_ACCESS_WRITE : TestMIB.h
  • MIB_ACTION_GET : TestMIB.h
  • MIB_ACTION_GETNEXT : TestMIB.h
  • MIB_ACTION_SET : TestMIB.h
  • MIB_control_func() : TestMIB.C , TestMIB.h
  • MIB_doneness_func() : TestMIB.h , TestMIB.C
  • MIB_ENTRY : TestMIB.h
  • MIB_leaf_func() : TestMIB.C , TestMIB.h
  • MIB_num_variables : TestMIB.C , TestMIB.h
  • MIB_OidPrefix : TestMIB.C , TestMIB.h
  • MIB_PREFIX_LEN : TestMIB.h
  • MIB_toaster : TestMIB.C
  • MIB_TOASTER_BURNT : TestMIB.h
  • MIB_TOASTER_DOWN : TestMIB.h
  • MIB_TOASTER_LIGHTLYWARM : TestMIB.h
  • MIB_TOASTER_OTHERBREAD : TestMIB.h
  • MIB_TOASTER_UP : TestMIB.h
  • MIB_TOASTER_WHITEBREAD : TestMIB.h
  • MIB_toasterControl : TestMIB.C
  • MIB_toasterControlStor : TestMIB.C
  • MIB_toasterDoneness : TestMIB.C
  • MIB_toasterDonenessStor : TestMIB.C
  • MIB_toasterManStor : TestMIB.C
  • MIB_toasterManufacturer : TestMIB.C
  • MIB_toasterModelNumber : TestMIB.C
  • MIB_toasterModelStor : TestMIB.C
  • MIB_toasterToastType : TestMIB.C
  • MIB_toasterToastTypeStor : TestMIB.C
  • MIB_toasttype_func() : TestMIB.C , TestMIB.h
  • MibCreate() : rmapi.c
  • MibDelete() : rmapi.c
  • MibGet() : rmapi.c
  • MibGetFirst() : rmapi.c
  • MibGetNext() : rmapi.c
  • MibGetTrapInfo() : rmapi.c
  • MibSet() : rmapi.c
  • MibSetTrapInfo() : rmapi.c
  • MID_DEAD : Server32.h
  • MID_LIVE : Server32.h
  • MID_SZ : InstCodc.Cpp
  • MIDI_CHANPRESSURE : SMFI.h
  • MIDI_CONTROLCHANGE : SMFI.h
  • MIDI_DEFAULT_TEMPO : SMFI.h
  • MIDI_META : SMFI.h
  • MIDI_META_EOT : SMFI.h
  • MIDI_META_KEYSIG : SMFI.h
  • MIDI_META_SEQSPECIFIC : SMFI.h
  • MIDI_META_TEMPO : SMFI.h
  • MIDI_META_TIMESIG : SMFI.h
  • MIDI_META_TRACKNAME : SMFI.h
  • MIDI_MSG : SMFI.h
  • MIDI_NOTEOFF : SMFI.h
  • MIDI_NOTEON : SMFI.h
  • MIDI_PITCHBEND : SMFI.h
  • MIDI_POLYPRESSURE : SMFI.h
  • MIDI_PROGRAMCHANGE : SMFI.h
  • MIDI_SYSEX : SMFI.h
  • MIDI_SYSEXEND : SMFI.h
  • MIDL_PROC_FORMAT_STRING : ADsFirstExt_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c , EdCommands_p.c , ADsError_p.c
  • MIDL_TYPE_FORMAT_STRING : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , Render_p.c , EdHost_p.c , ADsFirstExt_p.c
  • midl_user_allocate() : AsyncRPCc.c , AsyncRPCs.c , ClUuids.c , DUnionc.c , DUnions.c , InOuts.c , Repascu.c , Repassu.c , Xmitu.c , Xmitu.h , Dyneptc.c , Dynepts.c , DynOuts.c , FileRep.cpp , Service.cpp , service.cpp , filerep.cpp , service.cpp , Cxhndlc.c , Cxhndls.c , Usrdefc.c , Usrdefs.c , Helloc.c , Hellos.c , Pipes.c , RPCssms.c , Client.c
  • MIDL_user_allocate() : theprovider.h , adoint.h , ADsFirstExt.h , ADsError.h , Picklpc.c , Pickltc.c , Client.C , Server.c , MyDevice.h , CertPSam.Cpp , atlcontrol.h , iapplet.h , certpsam.cpp
  • midl_user_allocate() : Server.c
  • MIDL_user_allocate() : ADsFirstExt.h
  • midl_user_allocate() : Pipec.c , filerep.cpp , DynOutc.c , ClUuidc.c , InOutc.c
  • midl_user_free() : Hellos.c
  • MIDL_user_free() : adoint.h , ADsFirstExt.h , Picklpc.c , Pickltc.c , Client.C , Server.c , MyDevice.h , certpsam.cpp , atlcontrol.h , iapplet.h
  • midl_user_free() : AsyncRPCc.c , ClUuidc.c , ClUuids.c , DUnionc.c , InOutc.c , InOuts.c , Repascu.c , Repassu.c , Xmitu.c , Xmitu.h , Dyneptc.c , DynOutc.c , DynOuts.c , FileRep.cpp , filerep.cpp , service.cpp , filerep.cpp , service.cpp , Cxhndlc.c , Cxhndls.c , Usrdefc.c , Usrdefs.c , Helloc.c , Pipec.c , Pipes.c , RPCssms.c , Server.c , Client.c , Service.cpp , service.cpp , Dynepts.c , AsyncRPCs.c , DUnions.c
  • MIDL_user_free() : CertPSam.Cpp , theprovider.h , ADsError.h
  • MIIM_FTYPE : AdvReco.cpp
  • MIIM_STRING : AdvReco.cpp
  • MILLISECONDS_PER_WEEK : SubAuth.c
  • MimimumWindowsPlatform() : utils.cpp
  • MIN : sampprov.h , FontView.c , defs.h , instlsp.cpp
  • MIN_DISPLAY_SIZE : prsample.h
  • MIN_FREQUENCY : SetDisp.h
  • MIN_HEIGHT : DebMain.c
  • MIN_ICON_HEIGHT : IconPRO.h
  • MIN_ICON_WIDTH : IconPRO.h
  • MIN_INDEX : TIMEWND.c
  • MIN_IP_HDR_SIZE : parser.h
  • MIN_SEP_INDEX : TIMEWND.c
  • MIN_SIZE : enumdesk.cpp
  • MIN_SIZE_X : ExplrBar.h
  • MIN_SIZE_Y : ExplrBar.h
  • MIN_WIDTH : SetDisp.h
  • MINIMUM_SUPPORTED_MSI_VERSION : setup.h
  • MinimumThreads : Server.c
  • MINSDWORD : quiktest.h
  • MinThroughPut : PrPerf.c
  • MINVARBINDLEN : WSnmpUtil.h
  • MirroringDlgProc() : global.h
  • ML : MousInfo.h
  • MM_ABOUT : MfEdit.h
  • MM_BRUSH : MfEdit.h
  • MM_C_BEGIN_GP : MfEdit.h
  • MM_C_END_GP : MfEdit.h
  • MM_C_MLTFMTS : MfEdit.h
  • MM_C_WND_MF : MfEdit.h
  • MM_COPY : MfEdit.h
  • MM_CUT : MfEdit.h
  • MM_DECREASE : MfEdit.h
  • MM_DEL : MfEdit.h
  • MM_EXPORT_3X : MfEdit.h
  • MM_FIT2WND : MfEdit.h
  • MM_FONT : MfEdit.h
  • MM_HITTEST : MfEdit.h
  • MM_IMPORT_3X : MfEdit.h
  • MM_INCREASE : MfEdit.h
  • MM_INSERT : MfEdit.h
  • MM_LEABOUT : MfEdit.h
  • MM_LOAD : MfEdit.h
  • MM_LOAD_BMP : MfEdit.h
  • MM_LOAD_MASKBMP : MfEdit.h
  • MM_MibGet() : mibmgr.c , mibmgr.h
  • MM_MibSet() : mibmgr.c , mibmgr.h
  • MM_NORMAL : MfEdit.h
  • MM_PAGESETUP : MfEdit.h
  • MM_PASTE : MfEdit.h
  • MM_PEN : MfEdit.h
  • MM_PRINT : MfEdit.h
  • MM_PRINTSETUP : MfEdit.h
  • MM_RECORD : MfEdit.h
  • MM_REMOVE : MfEdit.h
  • MM_REPEAT : MfEdit.h
  • MM_SAVE_BMP : MfEdit.h
  • MM_TTOUTLN_POLYDRAW : MfEdit.h
  • MM_TTOUTLN_STROKEFILL : MfEdit.h
  • MMCControl : atlcontrol.h
  • MMCN_Crack() : mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , Globals.h , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp
  • mmGetProfileIntA : profile.h
  • mmGetProfileString : profile.h
  • MMPROFILECACHE : profile.h
  • MMSG_DONE : SEQ.h
  • mmWriteProfileString : profile.h
  • mn : suminfo.h
  • mo : suminfo.h
  • MODE : networkentry.h , Bcast.c
  • MODE_EXPAND : sdkdiff.cpp
  • MODE_NULL : sdkdiff.cpp
  • MODE_OUTLINE : sdkdiff.cpp
  • ModifyListProc() : Xmitp.c
  • ModifyMyString() : Repasp.c
  • ModifyMyWString() : Repasp.c
  • ModifySecurity() : SuperUsr.cpp
  • ModifySurface() : dxsurf2.cpp
  • MODULE_NAME : PoolWrap.h , CustomAuth.h , WildCardMap.cpp , CacheIsapi.cpp , ReMapUrl.cpp
  • MODULESTRING : virtualfile.cpp , staticnode.cpp , basesnap.cpp , virtualfile.cpp , compdata.cpp , basesnap.cpp , compdata.cpp , registry.cpp , staticnode.cpp , registry.cpp , dataobj.cpp , compdata.cpp , dataobj.cpp , devicenode.cpp , registry.cpp , comp.cpp , dataobj.cpp , foldernode.cpp , basesnap.cpp , comp.cpp , compdata.cpp , devicenode.cpp , virtualfile.cpp , proppagex.cpp , comp.cpp , compdata.cpp , dataobj.cpp , devicenode.cpp , registry.cpp , foldernode.cpp , staticnode.cpp , dataobj.cpp , devicenode.cpp , comp.cpp , basesnap.cpp , virtualfile.cpp , basesnap.cpp , staticnode.cpp , basesnap.cpp , comp.cpp , foldernode.cpp , registry.cpp , comp.cpp , staticnode.cpp , registry.cpp , basesnap.cpp , compdata.cpp , foldernode.cpp , staticnode.cpp , compdata.cpp , dataobj.cpp , virtualfile.cpp , devicenode.cpp , basesnap.cpp , devicenode.cpp , foldernode.cpp , comp.cpp , registry.cpp , compdata.cpp , registry.cpp , contextmenuex.cpp , foldernode.cpp , comp.cpp
  • MOF_INFO : tracedmp.h
  • MOFSTR : tracedmp.h
  • MOFWSTR : tracedmp.h
  • MonBuildInstanceDefinition() : PerfUtil.c , PerfUtil.h
  • MonCloseEventLog() : PerfUtil.c , PerfUtil.h , PerfUtil.c
  • MonitorCallback() : compart.cpp
  • MONITORPOLLDELAY : Client.h
  • MonkeyDlgProc() : Monkey.c , Monkey.h
  • mono_colours : sdkdiff.cpp
  • MonOpenEventLog() : PerfUtil.h , PerfUtil.c
  • month : utils.h
  • MOUNT_WAIT : app.cpp
  • MouseDlgProc() : WxForm.h , WxForm.c
  • MouseHandler() : Main.C
  • MouseMove() : Track.h , Track.c , WxForm.h , WxForm.c
  • MOUSINFO_ICON : MousInfo.h
  • MOVEBACK : list.cpp
  • MoveCaret() : Main.C , FullIME.h
  • MoveCompCandWindow() : Subs.c , IMEApps.h
  • MoveFileTx() : TxFileDisp.Idl
  • MOVEMONEY : resource.h
  • MoveMoneyThread() : bankthrds.Cpp , bankdlg.Cpp
  • MOVEPROC : section.cpp
  • MoveRebar() : Rebar.c
  • MoveWindow() : common.h , common.cpp
  • MoveXWndProc() : MainDlg.Cpp
  • MoveYWndProc() : MainDlg.Cpp
  • MPOINT : Cursor.h , Mypal.h , Select.h
  • MPOINT2POINT : Select.h , Cursor.h
  • MprAdminAcceptNewConnection() : AdminDll.c
  • MprAdminAcceptNewLink() : AdminDll.c
  • MprAdminConnectionHangupNotification() : AdminDll.c
  • MprAdminGetIpAddressForUser() : AdminDll.c
  • MprAdminLinkHangupNotification() : AdminDll.c
  • MprAdminReleaseIpAddress() : AdminDll.c
  • MprAdminTerminateDll() : AdminDll.c
  • MS_INTRA_L2_USER_1_THUMBPRINT : isapiCertPolicy.cpp
  • MS_INTRA_L2_USER_2_THUMBPRINT : isapiCertPolicy.cpp
  • MS_INTRA_L2_USER_3_THUMBPRINT : isapiCertPolicy.cpp
  • MS_IP_SAMPLE : ipsamplerm.h
  • MSD : Globals.h , GLOBALS.h , Global.h , Msg.Cpp
  • MSDFMAP_PROGID : handler.h
  • MSDFMAP_PROGIDVER : handler.h
  • MSDI : Globals.h , GLOBALS.h
  • msdiAbout : ABOUT.c , About.c
  • msdiConnect : Connect.c
  • msdiListen : Listen.c
  • msdiMain : GLOBALS.h , TapiComm.c , IpxChat.c , Globals.h
  • msg : list.cpp , CpyImage.Idl
  • MSG_BUF_SIZE : bankthrds.Cpp
  • MSG_ID_MASK : MsgTest.c , log.c
  • MSG_RECEIVED : cData.h
  • MSG_SENT : cData.h
  • MSG_SIZE : common.h
  • MsgAboutCommand() : About.c , ABOUT.c
  • MsgAboutInit() : ABOUT.c , About.c
  • MsgActivate() : Msg.Cpp
  • MsgBox : globals.h
  • MSGBOX_NAME : FileTerm.h
  • MsgBoxIMbd() : Global.h
  • MsgBoxIMbdDw() : Global.h
  • MsgBoxIMbdSz() : Global.h
  • MsgClose() : Msg.Cpp , TapiComm.c , GLOBALS.h
  • MsgCmdMain() : Msg.Cpp , Cmd.Cpp , Msg.Cpp , Cmd.Cpp , ui.cpp , Msg.Cpp
  • MsgCommand() : Globals.h , IpxChat.c , GLOBALS.h , TapiComm.c
  • MsgConnectCommand() : Connect.c
  • MsgConnectInit() : Connect.c
  • MsgCreate() : TapiComm.c , IpxChat.c , Globals.h , GLOBALS.h , Msg.Cpp
  • MsgDataready() : Globals.h , IpxChat.c
  • MsgDestroy() : Msg.Cpp , IpxChat.c , TapiComm.c , Msg.Cpp , GLOBALS.h , Globals.h
  • MsgDisconnected() : IpxChat.c , Globals.h
  • MsgDrawItem() : Msg.Cpp
  • MsgGetMinMax() : Msg.Cpp
  • MsgListenCommand() : Listen.c
  • MsgListenConnected() : Listen.c
  • MsgListenInit() : Listen.c
  • MsgMenuSelect() : STATBAR.c , Msg.Cpp , GLOBALS.h , sBar.Cpp
  • MsgMousemove() : GLOBALS.h
  • MsgNotify() : Msg.Cpp , ToolBar.c , GLOBALS.h , Msg.Cpp
  • MsgNotifyAppList() : chWnd.Cpp , Global.h
  • MsgNotifyTbar() : sBar.Cpp , Msg.Cpp
  • MsgPaint() : GLOBALS.h , TapiComm.c
  • MSGPENDINGPROC : msgfiltr.h
  • MSGPROPS : DirEncrypt.Cpp
  • MsgRefreshdisplay() : IpxChat.c , Globals.h
  • MsgSetfocus() : IpxChat.c , Globals.h
  • MsgSetFocus() : TapiComm.c , GLOBALS.h
  • MsgSize() : TapiComm.c , Msg.Cpp , GLOBALS.h , Msg.Cpp , IpxChat.c , Globals.h
  • MsgTimer() : GLOBALS.h
  • MSI : vertrust.cpp , setup.cpp
  • MSI_DLL : setup.cpp
  • MSIAPI_MsiApplyPatch : setup.cpp
  • MSIAPI_MsiCloseHandle : setup.cpp
  • MSIAPI_MsiDatabaseOpenView : setup.cpp
  • MSIAPI_MsiInstallProduct : setup.cpp
  • MSIAPI_MsiOpenDatabase : setup.cpp
  • MSIAPI_MsiQueryProductState : setup.cpp
  • MSIAPI_MsiRecordGetString : setup.cpp
  • MSIAPI_MsiReinstallProduct : setup.cpp
  • MSIAPI_MsiSetInternalUI : setup.cpp
  • MSIAPI_MsiViewExecute : setup.cpp
  • MSIAPI_MsiViewFetch : setup.cpp
  • MSISIPAPI_DllRegisterServer : upgrdmsi.cpp
  • MSOmniProv : theprovider.h
  • MSPB_IsBadWritePtr : precomp.h
  • MSV1_0_AUTH_TYPE : LogonNP.c
  • MSV1_0_INTERACTIVE_LOGON : Npaux.h
  • MSV1_0_LOGON_SUBMIT_TYPE : Npaux.h
  • Msv1_0SubAuthenticationFilter() : SubAuth.c
  • Msv1_0SubAuthenticationRoutine() : SubAuth.c
  • MTS_OBJID : MtsAudit.Idl
  • MTS_RESID : MtsAudit.Idl
  • MulDiv32() : MulDiv32.h
  • muldiv32 : MulDiv32.h
  • MulDivRD() : MulDiv32.h
  • muldivrd32 : MulDiv32.h
  • MulDivRN() : MulDiv32.h
  • MulDivRU() : MulDiv32.h
  • muldivru32 : MulDiv32.h
  • MULTI_SZ : multisz.h
  • MULTICAST : SendMDlg.Cpp
  • MULTISELECT_COOKIES : dataobj.h
  • MultiSzAppend() : multisz.h , multisz.c
  • MultiSzErase() : multisz.h , multisz.c
  • MultiSzFind() : multisz.h , multisz.c
  • MultiSzFree() : multisz.c , multisz.h
  • MultiSzInit() : multisz.c , multisz.h
  • MultiSzQuery() : multisz.c , multisz.h
  • MultiSzSet() : multisz.h , multisz.c
  • MultiThreadColorDlg() : Colors.c
  • MultiThreadFontDlg() : Font.c
  • MultiThreadOpenSave() : Open.c
  • MultiThreadPrintDlg() : Print.c
  • MUTEX_NAME : StdAfx.h
  • MW : MousInfo.h
  • MW_DATAREADY : Globals.h
  • MW_DISCONNECTED : Globals.h
  • MW_DISPLAYREFRESH : Globals.h
  • MWnd_OnCommand() : MainWND.c
  • MWnd_OnCommandToggleChild() : MainWND.c
  • MWnd_OnCreate() : MainWND.c
  • MWnd_OnDestroy() : MainWND.c
  • MWnd_OnDropFiles() : MainWND.c
  • MWnd_OnFileOpen() : MainWND.c
  • MWnd_OnGetMinMaxInfo() : MainWND.c
  • MWnd_OnPaint() : MainWND.c
  • MWnd_OnSize() : MainWND.c
  • MWnd_WndProc() : MidiPlyr.h , MainWND.c
  • MY_BUFSIZE : TextSid.c
  • MY_CLASS_NAME : ui.cpp
  • MY_DEFPORT : QosEvent.h
  • MY_ENCODING : RSACert.cpp
  • MY_KEY_SIZE : session.cpp
  • My_lstrcpyW() : Atsp.c , Atsp.h
  • My_mbschr() : sdkdiff.cpp , gutils.h
  • My_mbsistr() : view.cpp , sdkdiff.cpp
  • My_mbslen : Printer.c
  • My_mbsncmp() : sdkdiff.cpp , gutils.h
  • My_mbsncpy() : sdkdiff.cpp , gutils.h
  • My_mbsnicmp() : sdkdiff.cpp
  • My_mbspbrk() : sdkdiff.cpp , gutils.h
  • My_mbsrchr() : gutils.h , sdkdiff.cpp
  • My_mbsstr() : view.cpp , sdkdiff.cpp
  • My_mbstok : Precomp.h
  • myAddProperty() : datasource.cpp , prsample.h
  • myAddRowsetProperties() : rowset.cpp , prsample.h
  • MyAtol() : Open.c , Print.c , Find.c , CDTest.c , Colors.c , Font.c , Title.c
  • MyBoolean : CallAs.Idl
  • MyChangeFont() : MultiWnd.C
  • MyChangePasswordDlgProc() : GinaDlg.c
  • MYCHAR : Wapi.h
  • MyCharNext : Wapi.h
  • MyCharPrev : Wapi.h
  • MYCMF_MULTISELECT : ContMenu.h
  • MyComboProc() : Tools.c
  • myCreateAccessor() : rowset.cpp , prsample.h
  • myCreateCommand() : command.cpp , prsample.h
  • myCreateDataSource() : datasource.cpp , prsample.h
  • myCreateEnumerator() : prsample.h , enum.cpp
  • myCreateRowset() : rowset.cpp , prsample.h
  • myCreateSchemaRowset() : prsample.h , session.cpp
  • myCreateSession() : session.cpp , prsample.h
  • MyCryptEnumProviders() : CreateCert.c , CreateCert.h
  • MYDATA : ComDlg32.C
  • MYDBG : MfEdit.c
  • MYDEBUG : FaxSiren.Cpp
  • MyDefs : Sample.h , InstProv.Cpp , Sample.h , ClassProv.Cpp
  • myDisplayColumnNames() : rowset.cpp , prsample.h
  • myDisplayErrorInfo() : error.cpp , prsample.h , helper.h
  • myDisplayErrorRecord() : helper.h , error.cpp , prsample.h
  • myDisplayInstructions() : main.cpp , prsample.h
  • myDisplayRow() : rowset.cpp , prsample.h
  • myDisplayRowset() : prsample.h , rowset.cpp
  • myDoInitialization() : datasource.cpp , prsample.h
  • MyDrawString() : MultiWnd.C
  • MyEnumCopy() : Paint.h , Paint.c
  • MyEnumCount() : Paint.c , Paint.h
  • MyEnumFaces() : Paint.h , Paint.c
  • MyEnumProcedure() : Icons.C
  • myExecuteCommand() : command.cpp , prsample.h
  • myFindColumn() : prsample.h , rowset.cpp
  • myFreeBindings() : rowset.cpp , prsample.h
  • myFWPrintf() : UtilLib.h
  • myGetChar() : main.cpp , prsample.h
  • MyGetIcmpStatistics() : IPStat.h , IPStat.Cpp
  • myGetInputFromUser() : prsample.h , main.cpp
  • MyGetIpAddrTable() : IPArp.h , IPArp.Cpp , IPRoute.h , IPRoute.Cpp
  • MyGetIpForwardTable() : IPRoute.h , IPRoute.Cpp
  • MyGetIpNetTable() : IPArp.Cpp , IPArp.h
  • MyGetIpStatistics() : IPStat.h , IPStat.Cpp
  • myGetProperty() : prsample.h , datasource.cpp
  • myGetSqlErrorInfo() : helper.h , prsample.h , error.cpp
  • MyGetTcpStatistics() : IPStat.h , IPStat.Cpp
  • MyGetTcpTable() : IPStat.h , IPStat.Cpp
  • MyGetUdpStatistics() : IPStat.Cpp , IPStat.h
  • MyGetUdpTable() : IPStat.h , IPStat.Cpp
  • MYGWL_FONT : MultiUI.h
  • MYGWL_IMC : MultiUI.h
  • MYGWL_IMEWND : MultiUI.h
  • MYGWL_STR : MultiUI.h
  • myHandleResult() : prsample.h , error.cpp , helper.h
  • MyhInstance : FaxSiren.Cpp
  • MYIMEMENUITEMINFO : Wapi.h
  • MyImmGetCompositionString : Wapi.h
  • MyImmGetImeMenuItems : Wapi.h
  • MyInitialize() : GinaHook.c , GinaStub.c
  • myInteractWithRowset() : rowset.cpp , prsample.h
  • Mylstrcat : Wapi.h
  • Mylstrcmp : Wapi.h
  • Mylstrcpy : Wapi.h
  • Mylstrlen : Wapi.h
  • myMethod() : CatlSmpl.Idl , Catlpwr.Idl
  • myParseCommandLine() : prsample.h , main.cpp
  • myPowerMethod() : Catlpwr.Idl
  • myPowerProperty() : Catlpwr.Idl
  • MyPrintf() : SuperUsr.cpp
  • myprintf() : IocpServer.Cpp
  • MyPrintf() : MyToken.cpp , SignHash.cpp , RSACert.cpp
  • myprintf() : IocpServerex.Cpp
  • MyPrintf() : RSAKey.cpp
  • myProperty() : CatlSmpl.Idl , Catlpwr.Idl , CatlSmpl.Idl
  • myPutMsg() : MsgTest.c
  • MyRegisterClass() : LeakyBin.c , Generic.C , StatList.c , EventSink.cpp
  • MyReindeerProvSet : FrameworkProv.Cpp
  • MYRES_DEPENDENCY_MODE : CStorageResource.h
  • MyServiceHandler() : secSvr.Cpp
  • MyServiceMain() : secSvr.Cpp
  • MySetCompositionFont() : MultiWnd.C
  • MySetCompositionForm() : MultiWnd.C
  • mySetupBindings() : prsample.h , rowset.cpp
  • MYSTATE : Eap.h
  • MYSTATE_Done : Eap.h
  • MYSTATE_Initial : Eap.h
  • MYSTATE_ReqSent : Eap.h
  • MYSTATE_WaitForAuthenticationToComplete : Eap.h
  • MYSTATE_WaitForRequest : Eap.h
  • MYSTATE_WaitForUserOK : Eap.h
  • MYTEXT : Wapi.h
  • myUpdateDisplaySize() : prsample.h , rowset.cpp
  • MyWlxDialogBoxParam() : GinaDlg.c
  • MyWlxLoggedOutSASDlgProc() : GinaDlg.c
  • MyWlxWkstaLockedSASDlgProc() : GinaDlg.c
  • MYWM_NOTIFYICON : SetDisp.h , App32.C
  • MYXFORM : Bounce.h
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- n -

  • n : suminfo.Cpp
  • N_TIME_FORMATS : MidiPlyr.h
  • NALLOCATIONS : Test.Cxx
  • NAME : dxsurf1.cpp , dxsurf2.cpp
  • NAME_COL : people.Cpp
  • NAME_SIZE : Server32.h , Client32.h
  • NAME_X : Server32.h
  • NAME_Y : Server32.h
  • NAMEMAP : error.h
  • NAMEMAXLENGTH : nmsession.h
  • NAMEPROP : UtilLib.h
  • Namespace : resource.h
  • NameSpaceExtension : extend.h
  • NAMESPACEPROP : UtilLib.h
  • Namespaces : resource.h
  • NameToBthAddr() : bthcxn.cpp
  • NBR_PS_PAGE : global.h
  • NBSP : Grid.Cxx
  • NBSTRCompareW() : StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h
  • NBYTES : Grid.Cxx
  • nChars : suminfo.h
  • nCopyAnsiToWideChar() : OpenDIB.c , DynDlg.c
  • nDbgMsgLogSize : DbgMsg.cpp , dbgmsg.cpp
  • nDllRefCount : ShortName.Cpp , ShortName.h , Cleanup.Cpp , Cleanup.h
  • Ndsou : resource.h
  • NE_Create() : networkentry.c , networkentry.h
  • NE_Destroy() : networkentry.c , networkentry.h
  • NE_Display : networkentry.h
  • NEAR : GssAPI.h
  • NeedAuth() : httpauth.cpp
  • Negotiate : SampSSP.H
  • nErrFnf : wn_dos.h
  • nErrNoAcc : wn_dos.h
  • NETINTERFACE_MENU_BASE_ID : ExtObjData.cpp
  • NETINTERFACE_MENU_ID_1 : ExtObjData.cpp
  • NetpSecondsToDeltaTime() : SubAuth.c
  • NETWORK_ENTRY : networkentry.h
  • NETWORK_MENU_BASE_ID : ExtObjData.cpp
  • NETWORK_MENU_ID_1 : ExtObjData.cpp
  • Never : Stubs.c
  • NEW_DIB_FORMAT : DIBSectn.c
  • NEW_FOLDER_NAME : ShlFldr.Cpp
  • NEW_ITEM_NAME : ShlFldr.Cpp
  • NEWFSP_DEVICE_DIRECTORY : Reg.h
  • NEWFSP_DEVICE_ID_PREFIX : NewFsp.h
  • NEWFSP_DEVICE_LIMIT : NewFsp.h
  • NEWFSP_DEVICE_NAME_PREFIX : NewFsp.h
  • NEWFSP_DEVICES : Reg.h
  • NEWFSP_LOG_FILE : NewFsp.h
  • NEWFSP_LOGGING_DIRECTORY : Reg.h
  • NEWFSP_LOGGING_ENABLED : Reg.h
  • NEWFSP_PROVIDER : Reg.h
  • NEWFSP_PROVIDER_FRIENDLYNAME : Reg.h
  • NEWFSP_PROVIDER_IMAGENAME : Reg.h
  • NEWFSP_PROVIDER_PROVIDERNAME : Reg.h
  • newk : Global.Hxx
  • NEWLINE : cdialoglite.h
  • NewListBoxWndProc() : DebMain.c
  • NewLogon() : Main.h , Security.Cpp
  • NewMove() : TServer.Idl
  • NewObject() : Main.h , Security.Cpp
  • NewTreeNode() : AdvQuery.Cxx
  • NextEntity() : data.Idl
  • NextId : Stubs.c
  • NextLookup() : data.Idl
  • NextNonIgnorable() : section.cpp
  • NextResultset() : data.Idl
  • nFaces : Paint.h
  • NFIELDS : queue.h
  • nFindMsg : CDTest.h
  • nFmtEtc : OleStd.h
  • nHdcType : Font.c
  • nHelpMessage : CDTest.h
  • NIBSTRCompareW() : StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h
  • nIDTable : ImeMenu.c
  • nIndent : OleStd.h
  • NIStringCompareW() : PropList.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , PropList.cpp
  • NITER : Cursor.c
  • nLangID : Dllinit.c , Errors.c
  • NLASTDIALED : Dialer.h
  • nLineItemsPerOrder : Driver.Cpp
  • NLSDlgProc() : global.h , nlsapi.c
  • NlsPutMsg() : main.c , precomp.h
  • NM_AddInterface() : networkmgr.c , networkmgr.h
  • NM_APPID_NETMEETING : PreComp.h
  • NM_CallbackNetworkEvent() : networkmgr.c , networkmgr.h
  • NM_CallbackPeriodicTimer() : networkmgr.c , networkmgr.h
  • NM_DeleteInterface() : networkmgr.c , networkmgr.h
  • NM_DoUpdateRoutes() : networkmgr.c , networkmgr.h
  • NM_GetInterfaceInfo() : networkmgr.c , networkmgr.h
  • NM_InterfaceStatus() : networkmgr.c , networkmgr.h
  • NM_NT_DISPLAY_DRIVER_KEY : Dlg.Cpp
  • NM_ProcessRouteChange() : networkmgr.c , networkmgr.h
  • NM_SetInterfaceInfo() : networkmgr.c , networkmgr.h
  • NmApplet : iapplet.h
  • NmApplet_Ver_Major : iapplet.h
  • NmApplet_Ver_Minor : iapplet.h
  • nMaxChars : OleStd.h
  • nMinMax : sdkdiff.cpp
  • NMUI_CHAT_PROTOCOL : PreComp.h
  • nNumBLRPLATEProps : blrplate.c
  • nNumTabStops : MainWnd.c
  • NO_CONTAINER : app.cpp
  • NO_EXPIRATION : IsapiRequest.h
  • NO_MATCH : table.cpp
  • NO_MESSAGE : MousInfo.h
  • NO_OUTPUT : Dt.h
  • NOBROWSE_ERROR_STR : AppUtil.h
  • NOCOM_ERROR_STR : AppUtil.h
  • NOCOMOBJ_ERROR_STR : FreClien.h
  • NODE : Collect.cpp , LinkList.h
  • NODE_ATTRIBS : globals.h
  • NODE_MENU_BASE_ID : ExtObjData.cpp
  • NODE_MENU_ID_1 : ExtObjData.cpp
  • NODE_PROPERTIES : basenode.h
  • NODEPROPS : basenode.h
  • NODETYPE_DEVICE : globals.h
  • NODETYPE_FOLDER : globals.h
  • NODETYPE_RESULT : globals.h
  • NODETYPE_STATIC : globals.h
  • NODETYPE_VFILE : globals.h
  • NOEDITOR_ERROR_STR : AppUtil.h
  • NOFILE_STR : RESDEF.h
  • NoFilter : appinfo.h
  • NOGDI : precomp.h
  • NOHTM_ERROR_STR : AppUtil.h
  • NOMINMAX : Tools.c , Dialogs.c , FontView.c , Status.c , precomp.h
  • NoMoreContent : PropTag.Hxx
  • NoMoreProperty : PropTag.Hxx
  • NoMoreValue : MetaTag.Hxx
  • NoMoreValueProperty : PropTag.Hxx
  • NON_BLOCKING_ACCEPT : common.h
  • NONAMELESSUNION : OleStd.h , OleStd.c
  • NonAsyncFunc() : AsyncRPC.Idl , AsyncRPCp.c
  • NonBlockingAcceptMain() : NBAccept.cpp , common.h
  • NONE : InstCodc.Cpp
  • nOpenColorDlgCount : Colors.c
  • nOpenDialogCount : Print.c , Open.c
  • nOpenFontDialogCount : Font.c
  • nOpenShareVMsg : CDTest.h
  • nOrdersPerDriver : Driver.Cpp
  • NormalizeRect() : WinCap.c , WinCap.h
  • NormalizeScope() : QSample.Cxx
  • NOTE : sampclnt.h
  • NOTEQUAL : common.h
  • NOTHING : AsyncIO.h
  • NOTHREAD_ERROR_STR : FreClien.h
  • NOTICE_TITLE_STR : AppUtil.h
  • NOTIFICATION_CLASS : WSnmpUtil.h
  • NotificationUpdate() : threads.c , threads.h
  • NotificationWndProc() : WSnmpUtil.Cpp , WSnmpUtil.h
  • NOTIFY_ADDREF : coptions.h
  • NOTIFY_IDBASYNCHNOTIFY : coptions.h
  • NOTIFY_IPOOLNOTIFY : coptions.h
  • NOTIFY_IROWPOSITIONCHANGE : coptions.h
  • NOTIFY_IROWSETNOTIFY : coptions.h
  • NOTIFY_MSG : Global.h
  • NOTIFY_OLEDB : coptions.h
  • NOTIFY_OPTIONS : coptions.h
  • NOTIFY_PROMPTVETO : coptions.h
  • NOTIFY_QI : coptions.h
  • NOTIFY_RELEASE : coptions.h
  • NOTIFY_TRACEPROVIDER : coptions.h
  • NotifyAdd() : SetDisp.c , App32.C , SetDisp.h
  • notifyChange() : log.c
  • NotifyChange() : App32.C
  • NotifyDelete() : SetDisp.h , App32.C , SetDisp.c
  • NotReached : Global.h
  • NOTSET : cdialog.cpp
  • NOTUTORIAL_ERROR_STR : AppUtil.h
  • NOTXT_ERROR_STR : AppUtil.h
  • NoUINoIMCWndProc() : MultiWnd.C , MultiUI.h
  • NoUIOwnIMCWndProc() : MultiUI.h , MultiWnd.C
  • NOW : defs.h
  • NP_FORMATETC : globals.h
  • npage : tprint.cpp
  • nPage : suminfo.h
  • nPartsWidthTbl : Status.c
  • NPBALLDATA : Bounce.h
  • NPBEZBUFFER : Poly.h
  • NPBOUNCEDATA : Bounce.h
  • NPDRAWDATA : Draw.h
  • NPFONTLIST : Dialogs.c
  • NPFONTSTRUCT : Dialogs.c
  • NPGetCaps() : LogonNP.c
  • NPLogonNotify() : LogonNP.c
  • NPMAZEDATA : Maze.h
  • NPMYXFORM : Bounce.h
  • NPPasswordChangeNotify() : LogonNP.c
  • NPPOLYDATA : Poly.h
  • nProfLogSize : prof.cpp , Prof.cpp , prof.cpp
  • NPXFORMDATA : XForm.h
  • nReturn : Title.c
  • NS_CLASS_NAME : Utility.h
  • NSCERTTYPE_CA : Policy.Cpp , policy.cpp
  • NSCERTTYPE_CLIENT : policy.cpp , Policy.Cpp
  • NSCERTTYPE_SERVER : Policy.Cpp , policy.cpp
  • NSCERTTYPE_SMIME : policy.cpp , Policy.Cpp
  • nSizeOfVtbl : OleStd.h
  • nSleepMilliseconds : Driver.Cpp
  • nSortKeys : main.cxx
  • NSPEEDDIALS : Dialer.h
  • nSpin : PlgBlt.c
  • nStatusHeight : IMEApps.h , Data.c
  • NStringCompareW() : StringUtils.h , StringUtils.cpp , PropList.cpp , StringUtils.cpp , StringUtils.h , PropList.cpp , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h
  • NT4_DLL_NAME : WebClient.c , WebServer.c
  • NT_DLL_NAME : Security.cpp
  • NT_DRIVER_START_DISABLED : Dlg.Cpp
  • nTabStops : MainWnd.c
  • nThreadsAtClientCompletionPort : FileRepClientProc.cpp , Service.cpp
  • nThreadsAtServerCompletionPort : Service.cpp , FileRepServerProc.cpp
  • NTOHS : tracedmp.h
  • nToolBarHeight : Data.c
  • NTSTATUS : Except.Cxx
  • NULL_CHAR : Common.h
  • NULL_PARTID : app.cpp
  • NULL_STRING : PerfUtil.h , PerfUtil.c , PerfUtil.h , PerfUtil.c
  • NULL_TERMINATED : main.hxx
  • NULL_UUID_STRING : ClUuids.c
  • NullHandleCase() : enablerouter.c
  • NullOverlappedCase() : enablerouter.c
  • NUM_AUTHORIZED_EVENTS : dbauthplugin.cpp
  • NUM_COLUMNS : columnprovider.Cpp
  • NUM_CONCURRENT_CALLS : scaledemo.Cpp
  • NUM_CONTROLS : TPCInfo.cpp
  • NUM_FINDSTRINGS : findgoto.h
  • NUM_GRAPHICS_XSLOTS : Paint.h
  • NUM_GRAPHICS_YSLOTS : Paint.h
  • NUM_HANDLED_EVENTS : ContextPlugin.cpp
  • NUM_ICONS : DebMain.c
  • NUM_INSTANCES : BasicHiPerf.h
  • Num_Ip_Address : AdminDll.c
  • NUM_OBJECTS : BasicHiPerf.h
  • NUM_PARTS : Status.c
  • NUM_QUIKREBIND_ROWSETS : quiktest.h
  • NUM_SPINCUBE_STYLES : SpinCube.h
  • NUM_STAT_SAMPLES : MainWnd.c
  • NUM_STATIC_COLORS : MfEdit.h
  • NUM_SUPPORTED_ATTRS : tsfedit.h
  • NUM_TEMPLATE_UDNS_IN_DESCDOC : Dimmer.h , DimmerDeviceDCO.h
  • NUM_THREAD : quiktest.h
  • NUMBER_COLUMNS : Resource.h
  • NUMBER_OF_COLUMNS : bankdlg.Cpp
  • Number_Of_Flags : AdminDll.c , Admapit.c
  • NUMBER_OF_PROPERTY_SHEETS : PhoneEntry.c
  • NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_PROPERTY_SETS : utilprop.h
  • NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_SESSION_PROPERTIES : utilprop.h
  • NumberOfLogRecords() : CrmMonComp.Idl
  • NumberOfWorkerThreads : AsyncIO.h
  • NumberTypes : Dialer.c
  • NumCtrs : BasicHiPerf.h , RefClint.Cpp
  • NUMELE : common.h
  • NUMELEM : common.h , sampprov.h , sampclnt.h
  • NUMFACETS : Paint.h
  • NUMIMAGES : ToolBar.c , Global.h , ToolBar.c
  • NumItems : autotest.h
  • NUMLOGICALFONTS : DspLogcl.Cpp
  • NUMPIXELSTODRAW : dxsurf3.cpp
  • NumPriGroups : service.cpp , service.h , Service.h , Service.cpp
  • NUMROWS_CHUNK : sampclnt.h
  • NUMVERTICES : Paint.h
  • nWords : suminfo.h
  • nXBorder : Mypal.c
  • nXStart : OleStd.h
  • nXTitle : Mypal.c
  • nYStart : OleStd.h
  • nYTitle : Mypal.c
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- o -

  • OBJ_CHORD : Draw.h
  • OBJ_ELLIPSE : Draw.h
  • OBJ_PIE : Draw.h
  • OBJ_RECTANGLE : Draw.h
  • OBJ_ROUNDRECT : Draw.h
  • OBJECT : Main.h
  • Object : comspyctl.idl
  • OBJECT_CONSTRUCTED : sampprov.h
  • OBJECT_CREATED : Globals.h , globals.h
  • OBJECT_DESTROYED : globals.h , Globals.h , globals.h
  • OBJECT_DESTRUCTED : sampprov.h
  • OBJECT_MSG : Global.h
  • Object_StubDesc : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • ObjectConstruction : comspyctl.idl
  • ObjectCount : Server.Cxx
  • ObjectCreated() : Server.Cxx , OleSrvr.Cpp , cHello.Cxx
  • ObjectDestroyed() : cHello.Cxx , Server.Cxx , OleSrvr.Cpp , FileView.Cpp , FileView.h
  • ObjectPool : comspyctl.idl
  • ObjectPool2 : comspyctl.idl
  • ObjectStateEnum : adoint.h
  • OBJEFFERROR : HuError.h
  • ObjMap : Privobji.Cpp , Security.Cpp
  • OBJNOTINIT : HuError.h
  • OBM_BTNCORNERS : winres.h
  • OBM_BTSIZE : winres.h
  • OBM_CHECK : winres.h
  • OBM_CHECKBOXES : winres.h
  • OBM_CLOSE : winres.h
  • OBM_COMBO : winres.h
  • OBM_DNARROW : winres.h
  • OBM_DNARROWD : winres.h
  • OBM_DNARROWI : winres.h
  • OBM_LFARROW : winres.h
  • OBM_LFARROWD : winres.h
  • OBM_LFARROWI : winres.h
  • OBM_MNARROW : winres.h
  • OBM_OLD_CLOSE : winres.h
  • OBM_OLD_DNARROW : winres.h
  • OBM_OLD_LFARROW : winres.h
  • OBM_OLD_REDUCE : winres.h
  • OBM_OLD_RESTORE : winres.h
  • OBM_OLD_RGARROW : winres.h
  • OBM_OLD_UPARROW : winres.h
  • OBM_OLD_ZOOM : winres.h
  • OBM_REDUCE : winres.h
  • OBM_REDUCED : winres.h
  • OBM_RESTORE : winres.h
  • OBM_RESTORED : winres.h
  • OBM_RGARROW : winres.h
  • OBM_RGARROWD : winres.h
  • OBM_RGARROWI : winres.h
  • OBM_SIZE : winres.h
  • OBM_UPARROW : winres.h
  • OBM_UPARROWD : winres.h
  • OBM_UPARROWI : winres.h
  • OBM_ZOOM : winres.h
  • OBM_ZOOMD : winres.h
  • OBS_COMPLETELYCOVERED : Obscure.c
  • OBS_COMPLETELYVISIBLE : Obscure.c
  • OBS_PARTIALLYVISIBLE : Obscure.c
  • Obscure_EnsureTimerRunning() : Obscure.c
  • Obscure_EnsureTimerStopped() : Obscure.c
  • Obscure_OnPaint() : Obscure.c
  • Obscure_TimerProc() : Obscure.c
  • Obscure_WndProc() : Obscure.c
  • OBTAIN_INTERFACE : cbase.h
  • oBytes : suminfo.Cpp
  • OCR_CROSS : winres.h
  • OCR_IBEAM : winres.h
  • OCR_ICOCUR : winres.h
  • OCR_ICON : winres.h
  • OCR_NORMAL : winres.h
  • OCR_SIZE : winres.h
  • OCR_SIZEALL : winres.h
  • OCR_SIZENESW : winres.h
  • OCR_SIZENS : winres.h
  • OCR_SIZENWSE : winres.h
  • OCR_SIZEWE : winres.h
  • OCR_UP : winres.h
  • OCR_WAIT : winres.h
  • OctetVariantToString() : helper.cpp , helper.h
  • OD_BTN_CNT : MfEdit.h
  • OD_TOOL_CNT : MfEdit.h
  • ODF1 : AppUtil.h
  • ODF2 : AppUtil.h
  • ODF3 : AppUtil.h
  • ODS : debug.h , AppUtil.h , DbgOut.h , ShellExt.h
  • ODSlu : debug.h , DbgOut.h
  • ODSsz : debug.h , DbgOut.h
  • ODSszlu : debug.h , DbgOut.h
  • ODSszu : debug.h , DbgOut.h
  • ODSu : debug.h , DbgOut.h
  • Offroad() : MICARS.Idl
  • OFFSET : rnrcs.cpp
  • OFFSET_NIL : suminfo.h
  • OFFSETERROR : Grid.Cxx
  • OffsetPoint : idt.Cpp
  • ofn : Open.h
  • OFN_DEFAULTFILES_STR : AptClien.h , ComUser.h , ConClien.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h
  • OFN_DEFAULTTITLE_STR : AptClien.h , ComUser.h , ConClien.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h
  • OFN_SOURCEFILES_STR : AppUtil.h
  • OFN_SOURCETITLE_STR : AppUtil.h
  • ofnThread1 : Open.c
  • ofnThread2 : Open.c
  • ohDeers : FrameworkProv.Cpp
  • OIC_BANG : winres.h
  • OIC_HAND : winres.h
  • OIC_NOTE : winres.h
  • OIC_QUES : winres.h
  • OIC_SAMPLE : winres.h
  • OID_Prefix : TestMIB.C
  • OID_SIZEOF : TestMIB.h
  • OLEDB_Trace() : asserts.h
  • OLEDBG_BEGIN : OleStd.h
  • OLEDBG_BEGIN1 : OleStd.h
  • OLEDBG_BEGIN2 : OleStd.h
  • OLEDBG_BEGIN3 : OleStd.h
  • OLEDBG_BEGIN4 : OleStd.h
  • OLEDBG_END : OleStd.h
  • OLEDBG_END1 : OleStd.h
  • OLEDBG_END2 : OleStd.h
  • OLEDBG_END3 : OleStd.h
  • OLEDBG_END4 : OleStd.h
  • OleDbgAddRefMethod : OleStd.h
  • OleDbgAssert : OleStd.h
  • OleDbgAssertSz : OleStd.h
  • OLEDBGDATA : OleStd.h
  • OLEDBGDATA_MAIN : OleStd.h
  • OleDbgOut : OleStd.h
  • OleDbgOut1 : OleStd.h
  • OleDbgOut2 : OleStd.h
  • OleDbgOut3 : OleStd.h
  • OleDbgOut4 : OleStd.h
  • OleDbgOutHResult : OleStd.h
  • OleDbgOutNoPrefix : OleStd.h
  • OleDbgOutNoPrefix1 : OleStd.h
  • OleDbgOutNoPrefix2 : OleStd.h
  • OleDbgOutNoPrefix3 : OleStd.h
  • OleDbgOutNoPrefix4 : OleStd.h
  • OleDbgOutRect : OleStd.h
  • OleDbgOutRect1 : OleStd.h
  • OleDbgOutRect2 : OleStd.h
  • OleDbgOutRect3 : OleStd.h
  • OleDbgOutRect4 : OleStd.h
  • OleDbgOutRefCnt : OleStd.h
  • OleDbgOutRefCnt1 : OleStd.h
  • OleDbgOutRefCnt2 : OleStd.h
  • OleDbgOutRefCnt3 : OleStd.h
  • OleDbgOutRefCnt4 : OleStd.h
  • OleDbgOutScode : OleStd.h
  • OleDbgQueryInterfaceMethod : OleStd.h
  • OleDbgReleaseMethod : OleStd.h
  • OleDbgVerify : OleStd.h
  • OleDbgVerifySz : OleStd.h
  • OLEDBVER : Guids.Cpp , AdvQuery.Cxx
  • OleFree() : site.Cpp
  • OLESTDCANCELRETRY : OleStd.h
  • OleStdCopyMetafilePict : OleStd.h
  • OleStdCopyStatData() : enumStat.c , OleStd.h
  • OleStdCreateDbAlloc() : dballoc.Cpp
  • OleStdCreateStandardPalette() : OleStd.h
  • OleStdDestroyAllElements() : OleStd.h , OleStd.c
  • OleStdDoConvert() : OleStd.h , OleStd.c
  • OleStdDoTreatAsClass() : OleStd.h , OleStd.c
  • OLESTDDROP_DEFAULT : OleStd.h
  • OLESTDDROP_NONDEFAULT : OleStd.h
  • OLESTDDROP_NONE : OleStd.h
  • OLESTDENUMFMTETC : enumfetc.c
  • OleStdEnumFmtEtc_AddRef() : enumfetc.c
  • OleStdEnumFmtEtc_Clone() : enumfetc.c
  • OleStdEnumFmtEtc_Create() : OleStd.h , enumfetc.c
  • OleStdEnumFmtEtc_Destroy() : enumfetc.c
  • OleStdEnumFmtEtc_Next() : enumfetc.c
  • OleStdEnumFmtEtc_QueryInterface() : enumfetc.c
  • OleStdEnumFmtEtc_Release() : enumfetc.c
  • OleStdEnumFmtEtc_Reset() : enumfetc.c
  • OleStdEnumFmtEtc_Skip() : enumfetc.c
  • OLESTDENUMSTATDATA : enumStat.c
  • OleStdEnumStatData_AddRef() : enumStat.c
  • OleStdEnumStatData_Clone() : enumStat.c
  • OleStdEnumStatData_Create() : OleStd.h , enumStat.c
  • OleStdEnumStatData_Destroy() : enumStat.c
  • OleStdEnumStatData_Next() : enumStat.c
  • OleStdEnumStatData_QueryInterface() : enumStat.c
  • OleStdEnumStatData_Release() : enumStat.c
  • OleStdEnumStatData_Reset() : enumStat.c
  • OleStdEnumStatData_Skip() : enumStat.c
  • OleStdGetDropEffect : OleStd.h , DropTgt.Cpp
  • OleStdGetLinkSourceData() : OleStd.h , OleStd.c
  • OleStdGetOleObjectData() : OleStd.h , OleStd.c
  • OLESTDMESSAGEFILTER : msgfiltr.c
  • OleStdMkParseDisplayName() : OleStd.h , OleStd.c
  • OleStdMsgFilter_QueryInterface() : msgfiltr.c
  • OleStdMsgFilter_SetHandleInComingCallbackProc() : msgfiltr.h , msgfiltr.c
  • OleStdNullMethod() : OleStd.h , OleStd.c
  • OleStdQueryFormatMedium : OleStd.h
  • OleStdQueryLinkSourceData : OleStd.h
  • OleStdQueryObjectDescriptorData : OleStd.h
  • OleStdQueryOleObjectData : OleStd.h
  • OLESTDRETRYDELAY : OleStd.h
  • OleStdSetIconInCache() : OleStd.h , OleStd.c
  • OleStdSwitchDisplayAspect() : OleStd.h , OleStd.c
  • OLESTRCAT : ansiapi.h
  • OLESTRCMP : ansiapi.h
  • OLESTRCMPI : ansiapi.h
  • OLESTRCPY : ansiapi.h
  • OLESTRLEN : ansiapi.h
  • OLEUI_CCHCLSIDSTRING : OleStd.h
  • OLEUI_CCHFILEMAX : OleStd.h
  • OLEUI_CCHKEYMAX : OleStd.h
  • OLEUI_CCHLABELMAX : OleStd.h
  • OLEUI_CCHPATHMAX : OleStd.h
  • OLEUI_CCHVERBMAX : OleStd.h
  • OLEUI_HANDLES_INSIDE : OleStd.h
  • OLEUI_HANDLES_NOBORDER : OleStd.h
  • OLEUI_HANDLES_OUTSIDE : OleStd.h
  • OLEUI_HANDLES_USEINVERSE : OleStd.h
  • OLEUI_OBJECTMENUMAX : OleStd.h
  • OLEUI_SHADE_BORDERIN : OleStd.h
  • OLEUI_SHADE_BORDEROUT : OleStd.h
  • OLEUI_SHADE_FULLRECT : OleStd.h
  • OLEUI_VERSION_MAGIC : OleStd.h
  • OleUICanUnloadNow() : OleStd.h , ole2ui.c
  • OleUILockLibrary() : OleStd.h
  • OleUIMetafilePictFromIconAndLabel : OleStd.h
  • OM_uint32 : GssAPI.h
  • ON_COMMAND : cdialoglite.h
  • ON_COMMAND_UI : cdialoglite.h
  • ON_COMMAND_UI_CHECKED : cdialoglite.h
  • ON_COMMAND_UI_ENABLED : cdialoglite.h
  • OnActivityCreate() : ComSpyAudit.Idl
  • OnActivityDestroy() : ComSpyAudit.Idl
  • OnActivityEnter() : ComSpyAudit.Idl
  • OnActivityLeave() : ComSpyAudit.Idl
  • OnActivityLeaveSame() : ComSpyAudit.Idl
  • OnActivityReenter() : ComSpyAudit.Idl
  • OnActivityTimeout() : ComSpyAudit.Idl
  • OnAppActivation() : ComSpyAudit.Idl
  • OnAppShutdown() : ComSpyAudit.Idl
  • OnAuthenticate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnAuthenticateFail() : ComSpyAudit.Idl
  • OnCommand() : IconPRO.C
  • OnCRMAbort() : ComSpyAudit.Idl
  • OnCRMAnalyze() : ComSpyAudit.Idl
  • OnCRMBegin() : ComSpyAudit.Idl
  • OnCRMCheckpoint() : ComSpyAudit.Idl
  • OnCRMCommit() : ComSpyAudit.Idl
  • OnCRMDeliver() : ComSpyAudit.Idl
  • OnCRMDone() : ComSpyAudit.Idl
  • OnCRMForce() : ComSpyAudit.Idl
  • OnCRMForget() : ComSpyAudit.Idl
  • OnCRMIndoubt() : ComSpyAudit.Idl
  • OnCRMPrepare() : ComSpyAudit.Idl
  • OnCRMRecoveryDone() : ComSpyAudit.Idl
  • OnCRMRecoveryStart() : ComSpyAudit.Idl
  • OnCRMRelease() : ComSpyAudit.Idl
  • OnCRMWrite() : ComSpyAudit.Idl
  • onDefault : Global.Hxx
  • OnDisableCommit() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnDocWindowActivate() : ioipao.h
  • OnEnableCommit() : MtsAudit.Idl , ComSpyAudit.Idl
  • OnExceptionUser() : ComSpyAudit.Idl
  • OnFileOpen() : dxsurf1.cpp
  • OnFrameWindowActivate() : ioipao.h
  • OnIISRequestInfo() : ComSpyAudit.Idl
  • OnInPlaceActivate() : ioips.h
  • OnInPlaceDeactivate() : ioips.h
  • OnMethodCall() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnMethodException() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnMethodReturn() : MtsAudit.Idl , ComSpyAudit.Idl
  • OnObjectActivate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnObjectConstruct() : ComSpyAudit.Idl
  • OnObjectCreate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnObjectDeactivate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnObjectDestroy() : ComSpyAudit.Idl
  • OnObjectRelease() : MtsAudit.Idl
  • OnObjPoolCreateDecision() : ComSpyAudit.Idl
  • OnObjPoolCreateObject() : ComSpyAudit.Idl
  • OnObjPoolCreatePool() : ComSpyAudit.Idl
  • OnObjPoolDestroyObject() : ComSpyAudit.Idl
  • OnObjPoolGetFromTx() : ComSpyAudit.Idl
  • OnObjPoolGetObject() : ComSpyAudit.Idl
  • OnObjPoolPutObject() : ComSpyAudit.Idl
  • OnObjPoolRecycleToTx() : ComSpyAudit.Idl
  • OnObjPoolTimeout() : ComSpyAudit.Idl
  • OnPackageActivation() : MtsAudit.Idl
  • OnPackageShutdown() : MtsAudit.Idl
  • OnPosRectChange() : ioips.h
  • OnPrinterNotificationOption() : printjob.c
  • OnQCMoveToDeadQueue() : ComSpyAudit.Idl
  • OnQCMoveToReTryQueue() : ComSpyAudit.Idl
  • OnQCPlayback() : ComSpyAudit.Idl
  • OnQCQueueOpen() : ComSpyAudit.Idl
  • OnQCReceive() : ComSpyAudit.Idl
  • OnQCReceiveFail() : ComSpyAudit.Idl
  • OnQCRecord() : ComSpyAudit.Idl
  • OnResourceAllocate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnResourceCreate() : MtsAudit.Idl , ComSpyAudit.Idl
  • OnResourceDestroy() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnResourceRecycle() : MtsAudit.Idl , ComSpyAudit.Idl
  • OnResourceTrack() : ComSpyAudit.Idl
  • OnRightClick() : sdkdiff.cpp
  • OnSelectPrinter() : printjob.c
  • OnSetAbort() : ComSpyAudit.Idl
  • OnSetComplete() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnShowWindow() : iocs.h
  • OnStartup() : Cmd.Cpp , Global.h
  • OnTapiEvent() : CallNot.h , Callnot.Cpp , Callnot.h , Processing.cpp , common.h , CallNot.cpp
  • OnThreadAssignApartment() : ComSpyAudit.Idl
  • OnThreadAssignToActivity() : MtsAudit.Idl
  • OnThreadBindToApartment() : ComSpyAudit.Idl
  • OnThreadStart() : MtsAudit.Idl
  • OnThreadTerminate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnThreadUnassignApartment() : ComSpyAudit.Idl
  • OnThreadUnassignFromActivity() : MtsAudit.Idl
  • OnThreadUnBind() : ComSpyAudit.Idl
  • OnThreadWorkEnque() : ComSpyAudit.Idl
  • OnThreadWorkPrivate() : ComSpyAudit.Idl
  • OnThreadWorkPublic() : ComSpyAudit.Idl
  • OnThreadWorkRedirect() : ComSpyAudit.Idl
  • OnThreadWorkReject() : ComSpyAudit.Idl
  • OnTransactionAborted() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnTransactionCommit() : ComSpyAudit.Idl
  • OnTransactionPrepared() : MtsAudit.Idl , ComSpyAudit.Idl
  • OnTransactionStart() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnUIActivate() : ioips.h
  • OnUIDeactivate() : ioips.h
  • OnUpdate() : sdkdiff.cpp
  • OP_READ : Overlap.c
  • OP_WRITE : Overlap.c
  • Open() : FTPJr.cpp
  • OPEN_FILE : openf.c
  • OpenAppMemPerformanceData : Perfmem.c
  • OpenEdit() : ioo.h
  • OpenFileError() : Utility.h , Utility.c
  • OpenFunc() : Open.c , Open.h
  • OpenILS() : RendSam.Cpp
  • OPENING : Dialogs.h
  • OpenLogFile() : Util.c , NewFsp.h
  • OpenMultiThreadEnableButtons() : Open.c
  • OpenPolicy() : Audit.c , LsaPrivs.c
  • OPENQDLG_CLEAR_COMBOBOX : OpenQDlg.h
  • OpenQueueForAsyncReceiveWithCompletionPort() : MQPort.Cpp
  • OpenRegKey() : common.cpp , common.h
  • OpenSaveHookProc() : Open.c
  • OpenSaveThread1Proc() : Open.c
  • OpenSaveThread2Proc() : Open.c
  • OpenSessionWithWait() : app.cpp
  • OpenSigGenPerformanceData() : Perfgen.c
  • OpenSocketRegisterAndListen() : PrPerf.c , PrSamp.h
  • OPENSTATE_NO : IPageS.h
  • OPENSTATE_NONE : IPageS.h
  • OPENSTATE_YES : IPageS.h
  • OpenStreams() : ips.h
  • OpenTheFile() : ComDlg32.C , ComDlg32.h
  • OpenWinSNMPSession() : WSnmpUtil.Cpp , WSnmpUtil.h
  • operator delete() : Alloc.h , minici.hxx , Alloc.Cpp , heap.h , heap.Cpp
  • operator new() : PropSpec.Cxx , Alloc.Cpp , minici.hxx , heap.h , Alloc.h , heap.Cpp
  • operator!=() : string.h
  • operator+() : string.Cpp
  • operator<() : dynamic.h , string.h
  • operator<<() : marshalhelpers.h
  • operator<=() : string.h
  • operator==() : string.h , dynamic.h , string.h
  • operator>() : string.h
  • operator>=() : string.h
  • operator>>() : marshalhelpers.h
  • OPTIMUM_SIZE : pipe.hxx
  • OPTION_FILE : WinCap.h
  • OPTION_PRINTER : WinCap.h
  • OPTIONAL : AsyncIO.h
  • OptionList : quiktest.c
  • OPTIONS : IocpClient.Cpp , AppBar.h , ATMEvent.h , Qoslist.Cpp , QosEvent.h
  • Options_OnCommand() : PropSht.c
  • Options_OnDestroy() : PropSht.c
  • Options_OnInitDialog() : PropSht.c
  • Options_OnNotify() : PropSht.c
  • OptionsDlgProc() : Dlg.Cpp
  • OptionsPageProc() : PropSht.c
  • OPTIONSTRUCT : WinCap.h
  • or : defs.h
  • OrderId() : QCOrder.Idl , QCShip.Idl , QCShip2.Idl , QCNotify.Idl , QCOrder.Idl , QCNotify.Idl
  • ORG_X : IMEApps.h
  • ORG_Y : IMEApps.h
  • Organization : resource.h
  • OrgX : Cursor.c , Demo.c
  • OrgY : Cursor.c , Demo.c
  • OrMaps() : section.cpp
  • OsDateWin : wn_dos.h
  • osMac : suminfo.h
  • OSSERROR_FROM_HRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp
  • OsTimeWin : wn_dos.h
  • osWinNT : suminfo.h
  • osWinOnDos : suminfo.h
  • OTHER : Monkey.h
  • OTHERERROR : HuError.h
  • OUR_BAR : stl_mll.cpp
  • OUR_BRACE : stl_mll.cpp
  • OUR_STRING : stl_mll.cpp
  • OUT : AsyncIO.h
  • OUT_BUF_SIZE : Server32.h , Client32.h
  • OUT_BUFFER_SIZE : SessionKey.cpp , RSAKey.cpp , RSACert.cpp
  • OUT_LINE_FILE : cdbfile.h
  • OUTBOUND_PIPE : Server.c
  • outline_include : sdkdiff.h , sdkdiff.cpp
  • outnum : Enumprt.h
  • OutOfMemory() : ClipText.c , winmain.cpp , winmain.h , ClipText.c
  • OutOfMemoryMessageBox() : DebMisc.c , DebMisc.h
  • OutPipeSample() : pipesample.Idl
  • OUTPUT_BUFFER_WCHAR_SIZE : app.cpp
  • OUTPUT_SPECIAL : cdialoglite.h
  • OutputDebugFmt() : AppUtil.Cpp , AppUtil.h
  • OutputDebugLastError : TapiInfo.h
  • OutputDebugLastErrorFileLine() : TapiInfo.h , TapiInfo.c
  • OutputDebugLineCallback() : TapiInfo.c , TapiInfo.h
  • OutputDebugLineError : TapiInfo.h
  • OutputDebugLineErrorFileLine() : TapiInfo.h , TapiInfo.c
  • OutputDebugPrintf() : TapiInfo.h , TapiInfo.c
  • OutputError() : dhcprequest.cpp , ErrorOut.cpp , dhcpnotify.cpp , ErrorOut.h , dhcppersist.cpp
  • OutputErrors() : adoisapi.cpp
  • OutputString() : adoisapi.cpp
  • OutputStyle : Dt.h , Dt_Dll.Cpp
  • OutputTime() : sclient.cpp
  • OutputTraceString() : customentry.c , customdialreg.cpp , customdial.cpp
  • OutstandingIOOperations : AsyncIO.h
  • outstr : Getpdriv.h , Enumprt.h
  • outstr2 : Enumprt.h
  • outstr3 : Enumprt.h
  • OverFlowText() : MultiWnd.C
  • Overlapped : enablerouter.c
  • OVERLAPPED_IO : NmPipe.c
  • OverlappedManagerThread() : overlap.cpp
  • OverlappedPool : overlap.cpp
  • OverlappedUnenableRouter : enablerouter.c
  • OWNER_COL : people.Cpp
  • OWNERNAME : queue.h
  • OwnUIOwnIMCWndProc() : MultiUI.h , MultiWnd.C
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- z -

  • ZERO_WIDTH_SPACE : lrsample.HXX
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- ~ -

  • ~CAdviseSink() : ias.h
  • ~CDropSource() : ids.h
  • ~CDropTarget() : idt.h
  • ~COleClientSite() : iocs.h
  • ~COleInPlaceFrame() : ioipf.h
  • ~COleInPlaceSite() : ioips.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- a -

  • a : suminfo.Cpp
  • A2CT() : StrConv.h
  • A2CW : StrConv.h
  • A2T() : StrConv.h
  • A2W : StrConv.h , debug.h , ansiapi.h
  • A2WHelper() : StrConv.h
  • A2WHELPER : StrConv.h
  • A_StgCreateDocfile() : AppUtil.Cpp , AppUtil.h
  • A_StgIsStorageFile() : AppUtil.h , AppUtil.Cpp , AppUtil.h
  • A_StgOpenStorage() : AppUtil.Cpp , AppUtil.h
  • A_StringFromGUID2() : AppUtil.Cpp , AppUtil.h
  • A_WriteFmtUserTypeStg() : AppUtil.Cpp , AppUtil.h
  • Abort() : CrmFilesTest.Idl
  • ABORT : quiktest.h
  • AbortDlg() : tprint.cpp
  • AbortDlgProc() : Printer.c , Printer.h
  • AbortProc() : APP.Cxx , View.Hxx , Printer.c , Printer.h , tprint.cpp
  • AbortTest : autotest.h
  • AbortTransaction() : BYOTTransaction.Idl , CrmMonComp.Idl
  • AbortTx() : RmWorker.Idl
  • About() : About.c , EventSink.cpp , AboutDlg.c , AboutDlg.h , StatList.c , LeakyBin.c , ClipText.c , ComDlg32.C , ComDlg32.h , Property.c , Rebar.c , Cursor.c , Cursor.h , DynDlg.c , DragImg.h , Demo.c , Demo.h , Generic.C , ComSpyCtl.Idl , MtsSpyCtl.Idl , SimpCntr.Cpp , SimpCntr.h , SimpDnd.Cpp , SimpDnd.h , SimpSvr.Cpp , SimpSvr.h , MfEdit.c , MfEdit.h , dialogs.c , dialogs.h , SetDisp.c , SetDisp.h , TextFx.c , TextFx.h , ViewDIB.c , halftone.c , PlgBlt.c , PlgBlt.h , ABOUT.c
  • ABOUT_TITLE_STR : ComObjI.h , Server.h , DllSkelI.h , Server.h
  • ABOUTBOX : MciPlay.h , GdiDemo.h
  • AboutBox() : sdkdiff.cpp
  • AboutDialogProc() : Menu.c , Menu.h
  • AboutDlg() : IMEApps.c , IMEApps.h , Dlgs.C , MultiUI.h
  • AboutDlgProc() : APP.Cxx , APP.Hxx , Dialog.c , GdiDemo.h , Printer.c , Printer.h , Dialogs.c , WinCap.h , DebMain.c , VListVw.c , VListVw.h , IconPRO.C , WndProc.c , DragImg.Cpp
  • AboutProc() : Framer.Cpp , Framer.h , Dialer.c , CDTest.c , CDTest.h , FVProc.Cpp , FVText.h
  • abs : tpriv.h
  • ABS : common.h
  • AbsorbAnyBlanks() : section.cpp
  • ACCEL_ID : MfEdit.h
  • AcceptAuthSocket() : Server.cpp
  • AcceptCondFunc() : Receiver.Cpp
  • AcceptContext : common.h
  • ACCEPTEXARGS : provider.h
  • AcceptSecurityContext() : Stubs.c
  • AcceptTypeImage() : main.cpp
  • ACCESS_ALL : Main.h
  • ACCESS_ALLOW : SecPrint.c
  • ACCESS_DELETE : Main.h
  • ACCESS_DENY : SecPrint.c
  • ACCESS_FUND_CORPORATE : common.h
  • ACCESS_FUND_PERSONAL : common.h
  • ACCESS_FUND_TRANSFER : common.h
  • ACCESS_MODIFY : Main.h
  • ACCESS_READ : Main.h
  • ACCESSBUFFERSIZE : MqApiTst.h
  • ACCESSOR : sampprov.h
  • ACCESSOR_BIND_BOOKMARK : coptions.h
  • ACCESSOR_BIND_LENGTH : coptions.h
  • ACCESSOR_BIND_STATUS : coptions.h
  • ACCESSOR_BIND_VALUE : coptions.h
  • ACCESSOR_BLOB_ILOCKBYTES : coptions.h
  • ACCESSOR_BLOB_ISEQSTREAM : coptions.h
  • ACCESSOR_BLOB_ISTORAGE : coptions.h
  • ACCESSOR_BLOB_ISTREAM : coptions.h
  • ACCESSOR_OPTIONS : coptions.h
  • ACCESSOR_OWNED_PROVIDER : coptions.h
  • ACCOUNT : resource.h
  • AccountRestrictions() : SubAuth.c
  • AccountThread() : bankdlg.Cpp , bankthrds.Cpp
  • ACE_TYPE_ALL : DComPerm.h
  • achAuth : Get_Sock.c
  • ACQUIRE_LIST_LOCK : sync.h
  • ACQUIRE_QUEUE_LOCK : sync.h
  • ACQUIRE_READ_DLOCK : defs.h
  • ACQUIRE_READ_LOCK : sync.h
  • ACQUIRE_WRITE_DLOCK : defs.h
  • ACQUIRE_WRITE_LOCK : sync.h
  • AcquireAndGetRSAKey() : RSACert.cpp
  • AcquireCredentialsHandleW() : Stubs.c
  • AcquireDynamicReadwriteLock() : sync.c , sync.h
  • AcquireReadLock() : sync.c , sync.h
  • AcquireShutdownPrivilege() : setup.h , utils.cpp
  • AcquireSocketLock() : provider.h , sockinfo.cpp
  • AcquireWriteLock() : sync.c , sync.h
  • ACTION_ENABLE : TraceLog.c
  • ACTION_HELP : TraceLog.c
  • ACTION_LIST : TraceLog.c
  • ACTION_QUERY : TraceLog.c
  • ACTION_START : TraceLog.c
  • ACTION_STOP : TraceLog.c
  • ACTION_UNDEFINED : TraceLog.c
  • ACTION_UPDATE : TraceLog.c
  • ActionType : FileRepClientProc.cpp , FileRepServerProc.cpp
  • Activate : FileRepClientProc.cpp , FileRepServerProc.cpp
  • ActiveUpdateThread() : threads.c , threads.h
  • Activity : comspyctl.idl
  • ActivityId() : CrmMonComp.Idl
  • adAddNew : adoint.h
  • adAffectAll : adoint.h
  • adAffectCurrent : adoint.h
  • adAffectGroup : adoint.h
  • adApproxPosition : adoint.h
  • adBigInt : adoint.h
  • adBinary : adoint.h
  • adBookmark : adoint.h
  • adBookmarkCurrent : adoint.h
  • adBookmarkFirst : adoint.h
  • adBookmarkLast : adoint.h
  • adBoolean : adoint.h
  • adBSTR : adoint.h
  • adChar : adoint.h
  • adCmdStoredProc : adoint.h
  • adCmdTable : adoint.h
  • adCmdText : adoint.h
  • adCmdUnknown : adoint.h
  • adCmdUnspecified : adoint.h
  • adCurrency : adoint.h
  • Add() : data.Idl
  • ADD_ACE_MASK_BITS : app.cpp
  • ADD_KNOWN_HEADER : main.c
  • add_thread() : BPSamp.h , Utils.c
  • AddAccessAllowedACEToACL() : AclMgmt.Cpp , DComPerm.h
  • AddAccessDeniedACEToACL() : AclMgmt.Cpp , DComPerm.h
  • AddAccessRights() : SecPrint.c
  • ADDADSERROR : StdAfx.h
  • AddApp() : chWnd.Cpp
  • adDate : adoint.h
  • AddAuthorizationHeader() : HttpAuth.c , HttpAuth.h
  • adDBDate : adoint.h
  • adDBTime : adoint.h
  • adDBTimeStamp : adoint.h
  • AddCert() : PropCert.Cpp
  • AddChange() : queue.c , queue.h
  • AddConference() : RendSam.Cpp
  • AddContext() : Stubs.c
  • AddCredential() : Stubs.c
  • adDecimal : adoint.h
  • adDelete : adoint.h
  • AddEntry() : Collect.cpp , Collect.h
  • AddEtype : KList.c
  • AddFile() : RmWorker.Idl , CopyFileRm.Idl
  • AddFileMenuItems() : Utility.Cpp , Utility.h
  • AddFormatDlgProc() : MDIChild.C
  • AddIDTableEntry() : ImeMenu.c
  • AddInterface() : rmapi.c
  • AddItemToList() : Enum.Cpp , Enum.h
  • AddItemToTemplate() : OpenDIB.c
  • AddItemToTree() : Main.Cpp
  • AddJob() : sa.Cpp
  • AddJobData() : queue.c , queue.h
  • AddMachineAccount() : MachAcct.c
  • AddMember() : cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h
  • AddMofInfo() : tracewmi.cpp
  • AddNewItemToList() : Enum.Cpp , Enum.h
  • AddNode() : clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h
  • adDouble : adoint.h
  • AddPrincipalToNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • AddProtocolToServer() : loadprotocol.c
  • addr : Globals.h
  • AddReadersToGroup() : SCIntro.Cpp
  • ADDREF : MqTestOA.Cpp
  • AddRef_ItemList() : Enum.Cpp , Enum.h
  • AddRegNamedValue() : AppUtil.Cpp , AppUtil.h , Reg.Cpp , Reg.h
  • AddressDialogProc() : rtcdialogs.cpp
  • ADDRESSLENGTH : Outgoing.Cpp
  • AddressSupportsAudio() : tapirecv.cpp
  • AddressSupportsMediaType() : Incoming.Cpp , Outgoing.Cpp
  • AddressSupportsMST() : tapirecv.cpp
  • AddResultString() : MultiWnd.C
  • addrlen : Globals.h
  • AddRpcEEInfo() : Service.cpp , Service.h , service.cpp , service.h
  • AddRpcEEInfoAndRaiseException() : Service.cpp , Service.h , service.cpp , service.h
  • AddrStringToBtAddr() : bthcxn.cpp
  • AddSegment() : Fx.c
  • AddSlotToList() : hashtbl.cpp , hashtbl.h
  • AddSockInfoToList() : common.h , SockInfo.cpp
  • addSourceToRegistry() : log.c
  • AddStatusField() : FontView.c , Status.c
  • AddStroke() : RecoDll.cpp
  • AddThreadingModel() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • AddToMessageLog() : debug.c , Service.cpp , Service.h , service.cpp , service.h , service.cpp , service.h , service.cpp , service.h , Service.C , Service.H , Service.c , Service.H
  • AddToMessageLogProcFailure() : Service.cpp , Service.h , service.cpp , service.h
  • AddToMessageLogProcFailureEEInfo() : Service.cpp , Service.h , service.cpp , service.h
  • AddToolButton() : FontView.c , Tools.c
  • AddToolCombo() : FontView.c , Tools.c
  • AddToolLabel() : FontView.c , Tools.c
  • AddToolSpace() : FontView.c , Tools.c
  • AddToRedialList() : Dialer.c
  • AddTransientSubscription() : Adminwrap.Cpp , Adminwrap.h
  • AddUser() : RendSam.Cpp , Commands.Cpp , Commands.h
  • AddUserToCache() : AuthFilt.h , cache.c
  • AddUserToUList() : cMemb.h , Dlg.Cpp
  • AddValueToOtherWKOProperty() : otherwko.cpp , otherwko1.cpp
  • AddViewMenuItems() : Utility.Cpp , Utility.h
  • AddWorkQueueEntry() : ThreadPool.c , ThreadPool.h
  • adEditAdd : adoint.h
  • adEditInProgress : adoint.h
  • adEditNone : adoint.h
  • adEmpty : adoint.h
  • adErrBoundToCommand : adoint.h
  • adErrDataConversion : adoint.h
  • adErrFeatureNotAvailable : adoint.h
  • adErrIllegalOperation : adoint.h
  • adErrInTransaction : adoint.h
  • adErrInvalidArgument : adoint.h
  • adErrInvalidConnection : adoint.h
  • adErrInvalidParamInfo : adoint.h
  • adErrItemNotFound : adoint.h
  • ADErrMsgBox() : ADSIhelpers.cpp , ADSIhelpers.h
  • adErrNoCurrentRecord : adoint.h
  • adErrObjectClosed : adoint.h
  • adErrObjectInADOCollection : adoint.h
  • adErrObjectNotSet : adoint.h
  • adErrObjectOpen : adoint.h
  • adError : adoint.h
  • adErrProviderNotFound : adoint.h
  • adErrStillConnecting : adoint.h
  • adErrStillExecuting : adoint.h
  • adFilterAffectedRecords : adoint.h
  • adFilterFetchedRecords : adoint.h
  • adFilterNone : adoint.h
  • adFilterPendingRecords : adoint.h
  • adFilterPredicate : adoint.h
  • adFldCacheDeferred : adoint.h
  • adFldFixed : adoint.h
  • adFldIsNullable : adoint.h
  • adFldLong : adoint.h
  • adFldMayBeNull : adoint.h
  • adFldMayDefer : adoint.h
  • adFldRowID : adoint.h
  • adFldRowVersion : adoint.h
  • adFldUnknownUpdatable : adoint.h
  • adFldUpdatable : adoint.h
  • adGetRowsRest : adoint.h
  • adGUID : adoint.h
  • adHoldRecords : adoint.h
  • adIDispatch : adoint.h
  • adInteger : adoint.h
  • adIUnknown : adoint.h
  • Adjust() : MICARS.Idl
  • ADJUST_SIZE : common.h
  • AdjustIconImagePointers() : Icons.C
  • AdjustStatusBar() : FontView.c , Status.c
  • AdjustTallMenu() : tallmenu.c
  • AdjustToolBar() : FontView.c , Tools.c
  • adLockBatchOptimistic : adoint.h
  • adLockOptimistic : adoint.h
  • adLockPessimistic : adoint.h
  • adLockReadOnly : adoint.h
  • adLockUnspecified : adoint.h
  • adLongVarBinary : adoint.h
  • adLongVarChar : adoint.h
  • adLongVarWChar : adoint.h
  • adMarshalAll : adoint.h
  • adMarshalModifiedOnly : adoint.h
  • ADMINTYPE : Adminwrap.h
  • adModeRead : adoint.h
  • adModeReadWrite : adoint.h
  • adModeShareDenyNone : adoint.h
  • adModeShareDenyRead : adoint.h
  • adModeShareDenyWrite : adoint.h
  • adModeShareExclusive : adoint.h
  • adModeUnknown : adoint.h
  • adModeWrite : adoint.h
  • adMovePrevious : adoint.h
  • adNotify : adoint.h
  • adNumeric : adoint.h
  • ADO_MAJOR : adoid.h
  • ADOCollection : adoint.h
  • ADOCommand : adoint.h
  • ADOConnection : adoint.h
  • ADOConnectionConstruction : adoint.h
  • ADOConnectionConstruction_get_DSO_Proxy() : adoint.h
  • ADOConnectionConstruction_get_DSO_Stub() : adoint.h
  • ADOConnectionConstruction_get_Session_Proxy() : adoint.h
  • ADOConnectionConstruction_get_Session_Stub() : adoint.h
  • ADOConnectionConstructionVtbl : adoint.h
  • ADODynaCollection : adoint.h
  • ADOParameter : adoint.h
  • adOpenDynamic : adoint.h
  • adOpenForwardOnly : adoint.h
  • adOpenKeyset : adoint.h
  • adOpenStatic : adoint.h
  • adOpenUnspecified : adoint.h
  • adOptionUnspecified : adoint.h
  • ADORecordset : adoint.h
  • ADORecordsetConstruction : adoint.h
  • ADORecordsetConstruction_get_Chapter_Proxy() : adoint.h
  • ADORecordsetConstruction_get_Chapter_Stub() : adoint.h
  • ADORecordsetConstruction_get_RowPosition_Proxy() : adoint.h
  • ADORecordsetConstruction_get_RowPosition_Stub() : adoint.h
  • ADORecordsetConstruction_get_Rowset_Proxy() : adoint.h
  • ADORecordsetConstruction_get_Rowset_Stub() : adoint.h
  • ADORecordsetConstruction_put_Chapter_Proxy() : adoint.h
  • ADORecordsetConstruction_put_Chapter_Stub() : adoint.h
  • ADORecordsetConstruction_put_RowPosition_Proxy() : adoint.h
  • ADORecordsetConstruction_put_RowPosition_Stub() : adoint.h
  • ADORecordsetConstruction_put_Rowset_Proxy() : adoint.h
  • ADORecordsetConstruction_put_Rowset_Stub() : adoint.h
  • ADORecordsetConstructionVtbl : adoint.h
  • adParamInput : adoint.h
  • adParamInputOutput : adoint.h
  • adParamLong : adoint.h
  • adParamNullable : adoint.h
  • adParamOutput : adoint.h
  • adParamReturnValue : adoint.h
  • adParamSigned : adoint.h
  • adParamUnknown : adoint.h
  • adPosBOF : adoint.h
  • adPosEOF : adoint.h
  • adPosUnknown : adoint.h
  • adPromptAlways : adoint.h
  • adPromptComplete : adoint.h
  • adPromptCompleteRequired : adoint.h
  • adPromptNever : adoint.h
  • adPropNotSupported : adoint.h
  • adPropOptional : adoint.h
  • adPropRead : adoint.h
  • adPropRequired : adoint.h
  • adPropWrite : adoint.h
  • adRecCanceled : adoint.h
  • adRecCantRelease : adoint.h
  • adRecConcurrencyViolation : adoint.h
  • adRecDBDeleted : adoint.h
  • adRecDeleted : adoint.h
  • adRecIntegrityViolation : adoint.h
  • adRecInvalid : adoint.h
  • adRecMaxChangesExceeded : adoint.h
  • adRecModified : adoint.h
  • adRecMultipleChanges : adoint.h
  • adRecNew : adoint.h
  • adRecObjectOpen : adoint.h
  • adRecOK : adoint.h
  • adRecOutOfMemory : adoint.h
  • adRecPendingChanges : adoint.h
  • adRecPermissionDenied : adoint.h
  • adRecSchemaViolation : adoint.h
  • adRecUnmodified : adoint.h
  • adResync : adoint.h
  • adRunAsync : adoint.h
  • ADS_FREE : main.hxx
  • ADS_SYSTEMFLAG_ATTR_IS_CONSTRUCTED : attributes.cpp
  • ADS_SYSTEMFLAG_ATTR_NOT_REPLICATED : attributes.cpp
  • adSchemaAsserts : adoint.h
  • adSchemaCatalogs : adoint.h
  • adSchemaCharacterSets : adoint.h
  • adSchemaCheckConstraints : adoint.h
  • adSchemaCollations : adoint.h
  • adSchemaColumnPrivileges : adoint.h
  • adSchemaColumns : adoint.h
  • adSchemaColumnsDomainUsage : adoint.h
  • adSchemaConstraintColumnUsage : adoint.h
  • adSchemaConstraintTableUsage : adoint.h
  • adSchemaForeignKeys : adoint.h
  • adSchemaIndexes : adoint.h
  • adSchemaKeyColumnUsage : adoint.h
  • adSchemaPrimaryKeys : adoint.h
  • adSchemaProcedureColumns : adoint.h
  • adSchemaProcedureParameters : adoint.h
  • adSchemaProcedures : adoint.h
  • adSchemaProviderSpecific : adoint.h
  • adSchemaProviderTypes : adoint.h
  • adSchemaReferentialContraints : adoint.h
  • adSchemaSchemata : adoint.h
  • adSchemaSQLLanguages : adoint.h
  • adSchemaStatistics : adoint.h
  • adSchemaTableConstraints : adoint.h
  • adSchemaTablePrivileges : adoint.h
  • adSchemaTables : adoint.h
  • adSchemaTranslations : adoint.h
  • adSchemaUsagePrivileges : adoint.h
  • adSchemaViewColumnUsage : adoint.h
  • adSchemaViews : adoint.h
  • adSchemaViewTableUsage : adoint.h
  • ADSDLGPROC : StdAfx.h
  • adSearchBackward : adoint.h
  • adSearchForward : adoint.h
  • adsErr : helper.cpp
  • ADSERRMSG : StdAfx.h
  • ADsError : ADsError.h
  • ADsError_ProxyFileInfo : ADsError_p.c
  • ADsFirstExt_ProxyFileInfo : ADsFirstExt_p.c
  • ADSIIF : StdAfx.h
  • adsiIfs : ADQIDlg.cpp , ADs.cpp , helper.cpp
  • adSingle : adoint.h
  • adSmallInt : adoint.h
  • adStateClosed : adoint.h
  • adStateConnecting : adoint.h
  • adStateExecuting : adoint.h
  • adStateOpen : adoint.h
  • ADsToStringList() : helper.cpp , helper.h
  • AdsTypeToChar() : ADSIhelpers.cpp
  • adTinyInt : adoint.h
  • adUnsignedBigInt : adoint.h
  • adUnsignedInt : adoint.h
  • adUnsignedSmallInt : adoint.h
  • adUnsignedTinyInt : adoint.h
  • adUpdate : adoint.h
  • adUpdateBatch : adoint.h
  • adUseClient : adoint.h
  • adUseClientBatch : adoint.h
  • adUseNone : adoint.h
  • adUserDefined : adoint.h
  • adUseServer : adoint.h
  • ADVAPI32_DLL : utils.cpp
  • ADVAPI32API_AdjustTokenPrivileges : utils.cpp
  • ADVAPI32API_CheckTokenMembership : utils.cpp
  • ADVAPI32API_LookupPrivilegeValue : utils.cpp
  • ADVAPI32API_OpenProcessToken : utils.cpp
  • adVarBinary : adoint.h
  • adVarChar : adoint.h
  • adVariant : adoint.h
  • adVarWChar : adoint.h
  • Advertise() : rnrcs.cpp
  • Advise() : ioo.h
  • AdviseInkChange() : RecoDll.cpp
  • AdviseSingleSink() : globals.cpp , globals.h
  • AdviseSink() : globals.cpp , globals.h
  • adWChar : adoint.h
  • adXactAbortRetaining : adoint.h
  • adXactBrowse : adoint.h
  • adXactChaos : adoint.h
  • adXactCommitRetaining : adoint.h
  • adXactCursorStability : adoint.h
  • adXactIsolated : adoint.h
  • adXactReadCommitted : adoint.h
  • adXactReadUncommitted : adoint.h
  • adXactRepeatableRead : adoint.h
  • adXactSerializable : adoint.h
  • adXactUnspecified : adoint.h
  • AffectEnum : adoint.h
  • AFImage() : main.cpp , TestAccept.cpp
  • AFX_CONTROLBAR_MASK : afxres.h
  • AFX_ID_PREVIEW_CLOSE : afxres.h
  • AFX_ID_PREVIEW_NEXT : afxres.h
  • AFX_ID_PREVIEW_NUMPAGE : afxres.h
  • AFX_ID_PREVIEW_PREV : afxres.h
  • AFX_ID_PREVIEW_PRINT : afxres.h
  • AFX_ID_PREVIEW_ZOOMIN : afxres.h
  • AFX_ID_PREVIEW_ZOOMOUT : afxres.h
  • AFX_IDC_CHANGE : afxres.h
  • AFX_IDC_CONTEXTHELP : afxres.h
  • AFX_IDC_HSPLITBAR : afxres.h
  • AFX_IDC_LISTBOX : afxres.h
  • AFX_IDC_MAGNIFY : afxres.h
  • AFX_IDC_MOVE4WAY : afxres.h
  • AFX_IDC_NODROPCRSR : afxres.h
  • AFX_IDC_PRINT_DOCNAME : afxres.h
  • AFX_IDC_PRINT_PAGENUM : afxres.h
  • AFX_IDC_PRINT_PORTNAME : afxres.h
  • AFX_IDC_PRINT_PRINTERNAME : afxres.h
  • AFX_IDC_SMALLARROWS : afxres.h
  • AFX_IDC_TRACK4WAY : afxres.h
  • AFX_IDC_TRACKNESW : afxres.h
  • AFX_IDC_TRACKNS : afxres.h
  • AFX_IDC_TRACKNWSE : afxres.h
  • AFX_IDC_TRACKWE : afxres.h
  • AFX_IDC_VSPLITBAR : afxres.h
  • AFX_IDD_BUSY : afxres.h
  • AFX_IDD_CHANGEICON : afxres.h
  • AFX_IDD_COLOR : afxres.h
  • AFX_IDD_CONVERT : afxres.h
  • AFX_IDD_EDITLINKS : afxres.h
  • AFX_IDD_FILEBROWSE : afxres.h
  • AFX_IDD_FILEOPEN : afxres.h
  • AFX_IDD_FILESAVE : afxres.h
  • AFX_IDD_FIND : afxres.h
  • AFX_IDD_FONT : afxres.h
  • AFX_IDD_INSERTOBJECT : afxres.h
  • AFX_IDD_NEWTYPEDLG : afxres.h
  • AFX_IDD_PASTESPECIAL : afxres.h
  • AFX_IDD_PREVIEW_TOOLBAR : afxres.h
  • AFX_IDD_PRINT : afxres.h
  • AFX_IDD_PRINTDLG : afxres.h
  • AFX_IDD_PRINTSETUP : afxres.h
  • AFX_IDD_REPLACE : afxres.h
  • AFX_IDI_STD_FRAME : afxres.h
  • AFX_IDI_STD_MDIFRAME : afxres.h
  • AFX_IDM_FIRST_MDICHILD : afxres.h
  • AFX_IDM_WINDOW_FIRST : afxres.h
  • AFX_IDM_WINDOW_LAST : afxres.h
  • AFX_IDP_ASK_TO_DISCARD : afxres.h
  • AFX_IDP_ASK_TO_SAVE : afxres.h
  • AFX_IDP_ASK_TO_UPDATE : afxres.h
  • AFX_IDP_BAD_VERB : afxres.h
  • AFX_IDP_COMMAND_FAILURE : afxres.h
  • AFX_IDP_FAILED_ACCESS_READ : afxres.h
  • AFX_IDP_FAILED_ACCESS_WRITE : afxres.h
  • AFX_IDP_FAILED_DISK_FULL : afxres.h
  • AFX_IDP_FAILED_INVALID_FORMAT : afxres.h
  • AFX_IDP_FAILED_INVALID_PATH : afxres.h
  • AFX_IDP_FAILED_IO_ERROR_READ : afxres.h
  • AFX_IDP_FAILED_IO_ERROR_WRITE : afxres.h
  • AFX_IDP_FAILED_MEMORY_ALLOC : afxres.h
  • AFX_IDP_FAILED_TO_AUTO_REGISTER : afxres.h
  • AFX_IDP_FAILED_TO_CONNECT : afxres.h
  • AFX_IDP_FAILED_TO_CONVERT : afxres.h
  • AFX_IDP_FAILED_TO_CREATE_DOC : afxres.h
  • AFX_IDP_FAILED_TO_LAUNCH : afxres.h
  • AFX_IDP_FAILED_TO_LAUNCH_HELP : afxres.h
  • AFX_IDP_FAILED_TO_NOTIFY : afxres.h
  • AFX_IDP_FAILED_TO_OPEN_DOC : afxres.h
  • AFX_IDP_FAILED_TO_REGISTER : afxres.h
  • AFX_IDP_FAILED_TO_SAVE_DOC : afxres.h
  • AFX_IDP_FAILED_TO_START_PRINT : afxres.h
  • AFX_IDP_FAILED_TO_UPDATE : afxres.h
  • AFX_IDP_FILE_TOO_LARGE : afxres.h
  • AFX_IDP_GET_NOT_SUPPORTED : afxres.h
  • AFX_IDP_INTERNAL_FAILURE : afxres.h
  • AFX_IDP_INVALID_FILENAME : afxres.h
  • AFX_IDP_PARSE_INT : afxres.h
  • AFX_IDP_PARSE_INT_RANGE : afxres.h
  • AFX_IDP_PARSE_RADIO_BUTTON : afxres.h
  • AFX_IDP_PARSE_REAL : afxres.h
  • AFX_IDP_PARSE_REAL_RANGE : afxres.h
  • AFX_IDP_PARSE_STRING_SIZE : afxres.h
  • AFX_IDP_SERVER_BUSY : afxres.h
  • AFX_IDP_SET_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_API_CONFORMANCE : afxres.h
  • AFX_IDP_SQL_CONNECT_FAIL : afxres.h
  • AFX_IDP_SQL_DATA_TRUNCATED : afxres.h
  • AFX_IDP_SQL_DYNASET_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_EMPTY_COLUMN_LIST : afxres.h
  • AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH : afxres.h
  • AFX_IDP_SQL_FIRST : afxres.h
  • AFX_IDP_SQL_ILLEGAL_MODE : afxres.h
  • AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED : afxres.h
  • AFX_IDP_SQL_NO_CURRENT_RECORD : afxres.h
  • AFX_IDP_SQL_NO_DATA_FOUND : afxres.h
  • AFX_IDP_SQL_NO_POSITIONED_UPDATES : afxres.h
  • AFX_IDP_SQL_NO_ROWS_AFFECTED : afxres.h
  • AFX_IDP_SQL_ODBC_LOAD_FAILED : afxres.h
  • AFX_IDP_SQL_ODBC_V2_REQUIRED : afxres.h
  • AFX_IDP_SQL_RECORDSET_FORWARD_ONLY : afxres.h
  • AFX_IDP_SQL_RECORDSET_READONLY : afxres.h
  • AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_SQL_CONFORMANCE : afxres.h
  • AFX_IDP_SQL_SQL_NO_TOTAL : afxres.h
  • AFX_IDP_STATIC_OBJECT : afxres.h
  • AFX_IDP_VB2APICALLED : afxres.h
  • AFX_IDS_ACTIVATE_VERB : afxres.h
  • AFX_IDS_ALL_FILES : afxres.h
  • AFX_IDS_ALLFILTER : afxres.h
  • AFX_IDS_APP_TITLE : afxres.h
  • AFX_IDS_APP_TITLE_EMBEDDING : afxres.h
  • AFX_IDS_APP_TITLE_INPLACE : afxres.h
  • AFX_IDS_AUTO : afxres.h
  • AFX_IDS_BITMAP_FORMAT : afxres.h
  • AFX_IDS_CHANGE_LINK : afxres.h
  • AFX_IDS_DESKACCESSORY : afxres.h
  • AFX_IDS_DIB_FORMAT : afxres.h
  • AFX_IDS_EDIT_VERB : afxres.h
  • AFX_IDS_EMBED_FORMAT : afxres.h
  • AFX_IDS_EXIT_MENU : afxres.h
  • AFX_IDS_FROZEN : afxres.h
  • AFX_IDS_HELPMODEMESSAGE : afxres.h
  • AFX_IDS_IDLEMESSAGE : afxres.h
  • AFX_IDS_LINKSOURCE_FORMAT : afxres.h
  • AFX_IDS_MANUAL : afxres.h
  • AFX_IDS_MDICHILD : afxres.h
  • AFX_IDS_METAFILE_FORMAT : afxres.h
  • AFX_IDS_OBJECT_MENUITEM : afxres.h
  • AFX_IDS_ONEPAGE : afxres.h
  • AFX_IDS_OPENFILE : afxres.h
  • AFX_IDS_PREVIEW_CLOSE : afxres.h
  • AFX_IDS_PREVIEWPAGEDESC : afxres.h
  • AFX_IDS_PRINTONPORT : afxres.h
  • AFX_IDS_PRINTPAGENUM : afxres.h
  • AFX_IDS_SAVE_AS_MENU : afxres.h
  • AFX_IDS_SAVE_COPY_AS_MENU : afxres.h
  • AFX_IDS_SAVE_MENU : afxres.h
  • AFX_IDS_SAVEFILE : afxres.h
  • AFX_IDS_SAVEFILECOPY : afxres.h
  • AFX_IDS_SCCLOSE : afxres.h
  • AFX_IDS_SCFIRST : afxres.h
  • AFX_IDS_SCMAXIMIZE : afxres.h
  • AFX_IDS_SCMINIMIZE : afxres.h
  • AFX_IDS_SCMOVE : afxres.h
  • AFX_IDS_SCNEXTWINDOW : afxres.h
  • AFX_IDS_SCPREVWINDOW : afxres.h
  • AFX_IDS_SCRESTORE : afxres.h
  • AFX_IDS_SCSIZE : afxres.h
  • AFX_IDS_SCTASKLIST : afxres.h
  • AFX_IDS_TWOPAGE : afxres.h
  • AFX_IDS_UNTITLED : afxres.h
  • AFX_IDS_UPDATE_MENU : afxres.h
  • AFX_IDS_UPDATING_ITEMS : afxres.h
  • AFX_IDW_CONTROLBAR_FIRST : afxres.h
  • AFX_IDW_CONTROLBAR_LAST : afxres.h
  • AFX_IDW_HSCROLL_FIRST : afxres.h
  • AFX_IDW_PANE_FIRST : afxres.h
  • AFX_IDW_PANE_LAST : afxres.h
  • AFX_IDW_PANE_SAVE : afxres.h
  • AFX_IDW_PREVIEW_BAR : afxres.h
  • AFX_IDW_RESIZE_BAR : afxres.h
  • AFX_IDW_SIZE_BOX : afxres.h
  • AFX_IDW_STATUS_BAR : afxres.h
  • AFX_IDW_TOOLBAR : afxres.h
  • AFX_IDW_VSCROLL_FIRST : afxres.h
  • AFX_STDAFX_H__AA22C995_FD72_11D0_B5DC_00C04FB957D8__INCLUDED_ : StdAfx.h
  • AFX_WS_DEFAULT_VIEW : afxres.h
  • ahextoi() : TraceLog.c
  • aHtmlFiltClasses : Register.Cxx
  • aHtmlPropClasses : HtmlProp.Cxx
  • aiKeyExch : WebClient.c
  • AIO_WORK_ITEM : ftrans.c , fwasync.c
  • ALDUS_ID : MfEdit.h
  • Algorithm2 : sdkdiff.cpp
  • AliasAdminsSid : TakeOwn.c
  • ALIGN_ON_DWORD : PerfUtil.h
  • ALIGN_TO8 : Picklpc.c , Pickltc.c
  • ALL : nshsamp.h
  • ALL_RESOURCES_MENU_BASE_ID : ExtObjData.cpp
  • ALL_RESOURCES_MENU_ID_1 : ExtObjData.cpp
  • ALL_RESTYPES_MENU_BASE_ID : ExtObjData.cpp
  • ALL_RESTYPES_MENU_ID_1 : ExtObjData.cpp
  • ALLGRAPHICS : Common.h
  • AllNullParamCase() : enablerouter.c
  • ALLOC() : Alloc.Cpp , Alloc.h
  • ALLOC_MEM : main.c
  • AllocAndCopy() : AdvQuery.Cxx
  • AllocAndInitSockInfo() : common.h , SockInfo.cpp
  • ALLOCATE_WAIT : app.cpp
  • AllocateAndFormatErrorMessage() : PoolWrap.cpp
  • AllocateBindings() : odbcsql.c
  • AllocateEventItem() : mspaddr.cpp
  • AllocateEvents() : Processing.cpp
  • AllocateFreePool() : overlap.cpp
  • AllocateList() : RPCssmc.c
  • AllocateMemory() : tapirecv.cpp , autotest.h , common.h , tapisend.cpp
  • AllocateSmList() : RPCssmc.c , RPCssmp.c
  • AllocateStreamSamples() : Processing.cpp
  • AllocateUnicodeString() : main.hxx , util.cxx
  • ALLOCATION_MULTIPLIER : FCopy.Cpp
  • ALLOCATION_SIZE : LeakyBin.h
  • AllocDllNode() : DebDebug.c
  • ALLOCERROR : HuError.h
  • AllocHdbc() : quiktest.c
  • AllocHenv() : quiktest.c
  • AllocHstmt() : quiktest.c
  • AllocMsgProps() : MQPort.Cpp
  • AllocProcessNode() : DebDebug.c
  • AllocQueueData() : queue.c , queue.h
  • AllocRoomForDIB() : Dibutil.c , Dibutil.h
  • ALLOCSIGN : spy.cpp
  • AllocThreadNode() : DebDebug.c
  • AllocUser() : cMemb.Cpp
  • AllocWindowInfo() : GdiDemo.h , Wininfo.c
  • AllowedType() : quiktest.c
  • ALLPAGES : Grid.Hxx
  • AllSecurityFlagsEqNone : suminfo.h
  • ALREADYCONN : HuError.h
  • AlreadyInProgress() : setup.h , utils.cpp
  • ALREADYLIST : HuError.h
  • AmpersandCompensate() : Dialer.c
  • AmpersandDeCompensate() : Dialer.c
  • AnchorTagState : Anchor.Hxx
  • AnchorToken : HtmlScan.Hxx
  • and : defs.h
  • AndMaps() : section.cpp
  • ANON_DOMAIN : AuthenticateContext.cpp
  • ANON_PSWD : AuthenticateContext.cpp
  • ANON_USER : AuthenticateContext.cpp
  • ANSI : debug.c
  • Ansi2Unicode() : debug.h , globals.cpp , globals.h , debug.c
  • AnsiStringToUnicode() : MainFrm.Cpp
  • AnsiToLocal() : Utility.Cpp
  • AnsiToUc() : AppUtil.Cpp , AppUtil.h
  • AnsiToUnicodeString() : main.hxx , util.cxx , main.hxx , util.cxx
  • AnswerTheCall() : FileTerm.cpp , FileTerm.h , Incoming.Cpp
  • ANY_SIZE : ipsamplerm.h
  • APCNotificationRoutine() : AsyncRPCc.c
  • API : suminfo.h
  • APIENTRY : Dialogs.c , Status.c , Tools.c
  • APMSIZE : MfEdit.h
  • App : ADQI.h
  • APP_CLASS : StdAfx.h
  • APP_ERROR : StdAfx.h , stdafx.h , StdAfx.h
  • APP_HEIGHT : StdAfx.h
  • APP_ICON : MfEdit.h
  • APP_INSTALL_TYPE_UNDEFINED : AppInstallDlg.Cpp
  • APP_INSTALL_TYPE_WITH_USERS : AppInstallDlg.Cpp
  • APP_INSTALL_TYPE_WITHOUT_USERS : AppInstallDlg.Cpp
  • APP_MEM_NUM_PERF_OBJECT_TYPES : DataMem.h
  • APP_NAME : Perfmsg.h
  • APP_TITLE : StdAfx.h
  • APP_WIDTH : StdAfx.h
  • AppAbout() : MciPlay.c
  • APPALLOCS : MemCtrnm.h
  • APPALLOCSSEC : MemCtrnm.h
  • AppBar_AutoHide() : AppBar.c
  • APPBAR_BOTTOM : AppBar.h
  • AppBar_Callback() : AppBar.h
  • APPBAR_CALLBACK : Globals.h
  • AppBar_Callback() : AppBar.c
  • AppBar_Hide() : AppBar.h , AppBar.c
  • APPBAR_LEFT : AppBar.h
  • AppBar_NoAutoHide() : AppBar.c
  • AppBar_PosChanged() : AppBar.c , AppBar.h
  • AppBar_QueryPos() : AppBar.c , AppBar.h
  • AppBar_QuerySetPos() : AppBar.c , AppBar.h
  • AppBar_Register() : AppBar.h , AppBar.c
  • APPBAR_RIGHT : AppBar.h
  • AppBar_SetAlwaysOnTop() : AppBar.h , AppBar.c
  • AppBar_SetAutoHide() : AppBar.h , AppBar.c
  • AppBar_SetAutoHideTimer() : AppBar.c , AppBar.h
  • AppBar_SetAutoUnhideTimer() : AppBar.h , AppBar.c
  • AppBar_SetSide() : AppBar.h , AppBar.c
  • AppBar_Size() : AppBar.h , AppBar.c
  • APPBAR_TOP : AppBar.h
  • AppBar_UnHide() : AppBar.c , AppBar.h
  • AppBar_UnRegister() : AppBar.c , AppBar.h
  • APPCLASS : GdiDemo.h
  • Append() : data.Idl
  • AppendFileNametoLogFile() : FaxSiren.Cpp
  • AppendSzWild : wn_dos.h
  • APPFREES : MemCtrnm.h
  • APPFREESSEC : MemCtrnm.h
  • APPICON : GdiDemo.h
  • AppID : appinfo.h
  • APPLET_ADMIT_CHANNEL : iapplet.h
  • APPLET_ALLOCATE_HANDLE : iapplet.h
  • APPLET_ASSIGN_TOKEN : iapplet.h
  • APPLET_CONVENE_CHANNEL : iapplet.h
  • APPLET_DELETE_ENTRY : iapplet.h
  • APPLET_DISBAND_CHANNEL : iapplet.h
  • APPLET_DYNAMIC_MULTICAST_CHANNEL : iapplet.h
  • APPLET_DYNAMIC_PRIVATE_CHANNEL : iapplet.h
  • APPLET_DYNAMIC_USER_ID_CHANNEL : iapplet.h
  • APPLET_E_ALREADY_ADVISED : iapplet.h
  • APPLET_E_ALREADY_JOIN : iapplet.h
  • APPLET_E_ALREADY_REGISTERED : iapplet.h
  • APPLET_E_ENTRY_ALREADY_EXISTS : iapplet.h
  • APPLET_E_ENTRY_DOES_NOT_EXIST : iapplet.h
  • APPLET_E_INVALID_CONFERENCE : iapplet.h
  • APPLET_E_INVALID_COOKIE : iapplet.h
  • APPLET_E_INVALID_JOIN_REQUEST : iapplet.h
  • APPLET_E_NO_SERVICE : iapplet.h
  • APPLET_E_NOT_ADVISED : iapplet.h
  • APPLET_E_NOT_JOINED : iapplet.h
  • APPLET_E_NOT_OWNER : iapplet.h
  • APPLET_E_NOT_REGISTERED : iapplet.h
  • APPLET_E_SERVICE_FAIL : iapplet.h
  • APPLET_EXPEL_CHANNEL : iapplet.h
  • APPLET_GIVE_TOKEN : iapplet.h
  • APPLET_GIVE_TOKEN_RESPONSE : iapplet.h
  • APPLET_GRAB_TOKEN : iapplet.h
  • APPLET_GRAB_TOKEN_REQUEST : iapplet.h
  • APPLET_H221_NONSTD_KEY : iapplet.h
  • APPLET_HIGH_PRIORITY : iapplet.h
  • APPLET_INHIBIT_TOKEN : iapplet.h
  • APPLET_JOIN_CHANNEL : iapplet.h
  • APPLET_JOIN_DYNAMIC_CHANNEL : iapplet.h
  • APPLET_LEAVE_CHANNEL : iapplet.h
  • APPLET_LOGICAL_CAPABILITY : iapplet.h
  • APPLET_LOW_PRIORITY : iapplet.h
  • APPLET_MEDIUM_PRIORITY : iapplet.h
  • APPLET_MONITOR : iapplet.h
  • APPLET_NO_CHANNEL_TYPE_SPECIFIED : iapplet.h
  • APPLET_NO_MODIFICATION_RIGHTS_SPECIFIED : iapplet.h
  • APPLET_NONSTD_CAPABILITY : iapplet.h
  • APPLET_OBJECT_KEY : iapplet.h
  • APPLET_OWNER_RIGHTS : iapplet.h
  • APPLET_PLEASE_TOKEN : iapplet.h
  • APPLET_PUBLIC_RIGHTS : iapplet.h
  • APPLET_R_CONFERENCE_GONE : iapplet.h
  • APPLET_R_RESOURCE_PURGED : iapplet.h
  • APPLET_R_UNSPECIFIED : iapplet.h
  • APPLET_R_USER_REJECTED : iapplet.h
  • APPLET_REGISTER_CHANNEL : iapplet.h
  • APPLET_REGISTRY_CHANNEL_ID : iapplet.h
  • APPLET_REGISTRY_NONE : iapplet.h
  • APPLET_REGISTRY_PARAMETER : iapplet.h
  • APPLET_REGISTRY_TOKEN_ID : iapplet.h
  • APPLET_RELEASE_TOKEN : iapplet.h
  • APPLET_RETRIEVE_ENTRY : iapplet.h
  • APPLET_SESSION_RIGHTS : iapplet.h
  • APPLET_SET_PARAMETER : iapplet.h
  • APPLET_STANDARD_CAPABILITY : iapplet.h
  • APPLET_STATIC_CHANNEL : iapplet.h
  • APPLET_TEST_TOKEN : iapplet.h
  • APPLET_TOKEN_NOT_IN_USE : iapplet.h
  • APPLET_TOKEN_OTHER_GIVING : iapplet.h
  • APPLET_TOKEN_OTHER_GRABBED : iapplet.h
  • APPLET_TOKEN_OTHER_INHIBITED : iapplet.h
  • APPLET_TOKEN_SELF_GIVING : iapplet.h
  • APPLET_TOKEN_SELF_GRABBED : iapplet.h
  • APPLET_TOKEN_SELF_INHIBITED : iapplet.h
  • APPLET_TOKEN_SELF_RECIPIENT : iapplet.h
  • APPLET_TOP_PRIORITY : iapplet.h
  • APPLET_UNKNOWN_CAP_TYPE : iapplet.h
  • APPLET_UNSIGNED_MAXIMUM_CAPABILITY : iapplet.h
  • APPLET_UNSIGNED_MINIMUM_CAPABILITY : iapplet.h
  • AppletCapability : iapplet.h
  • AppletCapability2 : iapplet.h
  • AppletCapabilityClass : iapplet.h
  • AppletCapabilityID : iapplet.h
  • AppletCapabilityType : iapplet.h
  • AppletCapIDType : iapplet.h
  • AppletChannelCommand : iapplet.h
  • AppletChannelID : iapplet.h
  • AppletChannelRequest : iapplet.h
  • AppletChannelType : iapplet.h
  • AppletConfID : iapplet.h
  • AppletEntityID : iapplet.h
  • AppletKeyType : iapplet.h
  • AppletLongString : iapplet.h
  • AppletModificationRights : iapplet.h
  • AppletNodeID : iapplet.h
  • AppletObjectKey : iapplet.h
  • AppletOctetString : iapplet.h
  • AppletPriority : iapplet.h
  • AppletProtocolEntity : iapplet.h
  • AppletReason : iapplet.h
  • AppletRecord : iapplet.h
  • AppletRegistryCommand : iapplet.h
  • AppletRegistryEntryOwner : iapplet.h
  • AppletRegistryItem : iapplet.h
  • AppletRegistryItemType : iapplet.h
  • AppletRegistryKey : iapplet.h
  • AppletRegistryRequest : iapplet.h
  • AppletRequestTag : iapplet.h
  • AppletResourceAllocCommand : iapplet.h
  • AppletRoster : iapplet.h
  • AppletSessionID : iapplet.h
  • AppletSessionKey : iapplet.h
  • AppletSessionRequest : iapplet.h
  • AppletTokenCommand : iapplet.h
  • AppletTokenID : iapplet.h
  • AppletTokenRequest : iapplet.h
  • AppletTokenStatus : iapplet.h
  • AppletUserID : iapplet.h
  • APPLICATION : Adminwrap.h
  • Application : comspyctl.idl
  • ApplyControlToken() : Stubs.c
  • APPMEM_COUNTERS : DataMem.h
  • APPMEM_DATA_DEFINITION : DataMem.h
  • APPMEM_DATA_HEADER : AppMemi.h
  • APPMEM_INST : AppMemi.h
  • APPMEM_INSTANCE : AppMemi.h
  • APPMEMALLOC : MemCtrnm.h
  • AppMemDataDefinition : Perfmem.c , DataMem.c
  • APPMEMOBJ : MemCtrnm.h
  • APPMENU : GdiDemo.h
  • APPNAME : sdkdiff.h , Service.h , GLOBALS.h , Generic.C , service.h , StatList.c , LeakyBin.c , service.h , StatList.h
  • APPNAMEA : Global.h
  • APPNAMEW : Global.h
  • APPREALLOCS : MemCtrnm.h
  • APPREALLOCSSEC : MemCtrnm.h
  • appSource : main.cpp
  • APPTITLE : GdiDemo.h
  • AppTitle : sdkdiff.cpp
  • APPTITLEA : Global.h
  • APPTITLEW : Global.h
  • AppWndProc() : MciPlay.c
  • AptFreeAutoTest() : ComPerf.Cpp
  • AptFreeCOMTest() : ComPerf.Cpp
  • AptThreadProc() : Server.Cpp
  • AR_Allocate() : areadcli.c
  • AR_Free() : areadcli.c
  • ARC : Common.h
  • arDelay : MonitorServer.Cpp
  • AreRectsEqual : OleStd.h
  • AretheGUIDsEqual() : ADSIhelpers.cpp
  • ARFONTS : Paint.h
  • arg1 : FTPJr.cpp
  • arg2 : FTPJr.cpp
  • arg3 : FTPJr.cpp
  • ARGUMENT_PRESENT : AsyncIO.h
  • arIDs : ADSIhelpers.cpp
  • ARR_SIZE : Simple.c
  • ARRAY_ELEMENTS : precomp.h , Global.h , stdafx.h
  • ARRAY_SIZE : isapiCertPolicy.cpp
  • ARRAY_VERSION : stdafx.h
  • ARRAYLEN : tbarext.Cpp , comp.Cpp , dsmenu.cpp , comp.Cpp
  • ARRAYSIZE : IcnOvrly.h , ADEvent.cpp , CDTest.h , DropExt.C
  • ArraySize : minici.hxx
  • ARRAYSIZE : App32.C , Globals.h , globals.h , CtxMenu.Cpp , Cleanup.h , globals.h , Render.Cpp , DragImg.Cpp , ShortName.h , util.h , DoServer.h , CeLibW2k.h , ComDlg32.C , CeLibW2k.h , Utility.h , SpinCube.h
  • ArrayWalkProc() : Xmitu.c , Xmitu.h
  • arrFmtEtc : OleStd.h
  • ARROW_SYMBOL : StdAfx.h
  • ascii : Display.c
  • asmpClasses : SmpFilt.Cxx
  • aSpincubeStyleFlags : SpinCube.c
  • ASSERT : PropList.h , common.h , AppUtil.h , dballoc.Cpp
  • Assert : Debug.h
  • ASSERT : Global.h , common.h , Global.h , PropList.h , Global.h , precomp.h , Global.h , PropList.h
  • assert : Debug.h , asserts.h
  • ASSERT : utils.h , Global.h , defs.h , asserts.h , winmain.h , AppUtil.h
  • Assert : StdAfx.h
  • assert : assert.h
  • ASSERT : suminfo.Cpp
  • ASSERT_LOCKHELD : Critsect.h
  • ASSERT_LOCKNOTHELD : Critsect.h
  • ASSERT_SQL_SUCCESS : odbcdata.h , bankthrds.Cpp , stdafx.h
  • ASSERTC : common.h
  • ASSERTE : common.h
  • ASSERTFAIL_ERROR_STR : AppUtil.h
  • ASSERTHR : Global.h
  • AssertProc() : Debug.Cpp
  • ASSERTS : Global.h
  • AssertSz : Global.h
  • ASSERTSZ : dballoc.Cpp
  • AssertSz : Global.h , Debug.h , Global.h
  • AssertTakeOwnership() : TakeOwn.c
  • AssignPersistentDriveLetter() : DLEdit.Cpp
  • AssignTemporaryDriveLetter() : DLEdit.Cpp
  • AssociateEventsWithSamples() : Processing.cpp
  • aStemForms : lrsample.CXX
  • aStems : lrsample.CXX
  • ASTRING : Printer.c
  • ASYNC_CANCEL_CHECK : AsyncRPCp.c
  • ASYNC_REQUEST : Atsp.h
  • ASYNC_SELECT_ACCEPT : common.h
  • ASYNC_TIMEOUT : asyncselect.cpp
  • AsyncCallback() : AsyncDemo.cpp
  • AsyncCompletion() : DumpRequestInfo.cpp
  • AsyncDialog() : AsyncDemo.cpp
  • AsyncDirect() : AsyncDemo.cpp
  • AsyncFunc() : AsyncRPCp.c , AsyncRPC.Idl
  • ASyncIO : AsyncIO.h
  • AsyncMultiGraphEvent() : mspcall.cpp
  • AsyncReadClientIoCompletion() : areadcli.c
  • AsyncSelectAcceptMain() : ASAccept.cpp , common.h
  • AsyncURL() : AsyncDemo.cpp
  • aSyntaxMap : UserProps.cpp
  • AtlA2WHelper() : helper.cpp
  • AtlW2AHelper() : helper.cpp
  • ATMEVENT_MAIN : ATMEvent.Cpp
  • AtoH() : Globals.h , Misc.c
  • ATSP_TIMEOUT : Atsp.h
  • AttachDlgProc() : DebMain.c
  • Attached : blrplate.c
  • AttachToDebuggee() : DebMisc.h , DebMisc.c
  • AttemptFileOpen() : MainWND.c
  • ATTR_FLAG_DEFAULT : tsfedit.h
  • ATTR_FLAG_NONE : tsfedit.h
  • ATTR_FLAG_REQUESTED : tsfedit.h
  • ATTR_INDEX_MODEBIAS : tsfedit.h
  • ATTR_INDEX_TEXT_ORIENTATION : tsfedit.h
  • ATTR_INDEX_TEXT_VERTICALWRITING : tsfedit.h
  • AttribPsffs : wn_dos.h
  • ATTRIBUTE_BACKUP_DEVICE : globals.h
  • ATTRIBUTE_DATA_ARCHIVE : globals.h
  • ATTRIBUTE_DATA_COMPRESSED : globals.h
  • ATTRIBUTE_DATA_ENCRYPTED : globals.h
  • ATTRIBUTE_DATA_HIDDEN : globals.h
  • ATTRIBUTE_DATA_LOCKED : globals.h
  • ATTRIBUTE_DATA_READONLY : globals.h
  • ATTRIBUTEBUTTON_DISABLED : BttnCur.h
  • ATTRIBUTEBUTTON_DOWN : BttnCur.h
  • ATTRIBUTEBUTTON_DOWNDISABLED : BttnCur.h
  • ATTRIBUTEBUTTON_INDETERMINATE : BttnCur.h
  • ATTRIBUTEBUTTON_MOUSEDOWN : BttnCur.h
  • ATTRIBUTEBUTTON_UP : BttnCur.h
  • aTypeEntries : HtmlProp.Cxx
  • AUDIOCODEC : InstCodc.Cpp
  • AudioDlgProc() : Dlg.Cpp
  • Audit() : ComSpyCtl.Idl , MtsSpyCtl.Idl , ComSpyCtl.Idl , MtsSpyCtl.Idl
  • AUTH_SEQ : Security.cpp , HttpAuth.c
  • AuthConverse() : HttpAuth.c
  • AuthDialogProc() : rtcdialogs.cpp
  • AuthenticateeMakeMessage() : Eap.h , Eap.c
  • AuthenticatorMakeMessage() : Eap.h , Eap.c
  • AuthInit() : HttpAuth.c
  • AuthorizeAndExecuteExpense() : AuthzSvr.c
  • AUTHORIZED_USERS_PROPERTY : dbauthplugin.cpp
  • AuthTerminate() : HttpAuth.c
  • AuthzAccessCheckCallback() : AuthzSvr.c
  • AuthzComputeGroupsCallback() : AuthzSvr.c
  • AuthzFreeGroupsCallback() : AuthzSvr.c
  • AUTO_MAX_TEST_NAME : autotest.h
  • AUTO_MAX_TESTCASE_NAME : autotest.h
  • AUTO_MAX_TESTDESC_NAME : autotest.h
  • AutoHeapAlloc() : common.cpp , common.h , common.cpp , Service.h , common.h , common.cpp , service.h , common.h
  • AutoHeapFree() : Service.h , common.cpp , common.h , common.cpp , common.h , common.cpp , service.h , common.h , common.cpp , common.h
  • AutoTestDesc() : custom.c , quiktest.c
  • AutoTestFunc() : custom.c , quiktest.c
  • AutoTestName() : custom.c , quiktest.c
  • AV_CLASS : StdAfx.h
  • AV_HEIGHT : StdAfx.h
  • AV_TITLE : StdAfx.h
  • AV_WIDTH : StdAfx.h
  • AvgThroughPut : PrPerf.c
  • aWTSEnumerateServers : Tst4Wts.c
  • aWTSFreeMemory : Tst4Wts.c
  • AX_MAX_VOLUME : msptrmar.cpp
  • AX_MIN_VOLUME : msptrmar.cpp
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- b -

  • b : suminfo.Cpp
  • bAbort : complist.cpp , sdkdiff.cpp , Print.c , scandir.cpp
  • BACKGROUNDBRUSH : PlgBlt.c
  • bActiveSession : FTPJr.cpp
  • BAD_RECORD_FORMAT : crow.h
  • BAIL_ON_FAILURE : main.hxx , main.cxx , main.hxx
  • BAIL_ON_NULL : main.hxx , main.cxx , main.hxx
  • ballBounce() : Bounce.h , Bounce.c
  • ballCreate() : Bounce.c , Bounce.h
  • BALLDATA : Bounce.h
  • ballDestroy() : Bounce.c , Bounce.h
  • ballGetDimensions() : Bounce.c , Bounce.h
  • ballGetDirection() : Bounce.c , Bounce.h
  • ballGetPosition() : Bounce.c , Bounce.h
  • ballSetDimensions() : Bounce.c , Bounce.h
  • ballSetDirection() : Bounce.c , Bounce.h
  • ballSetPosition() : Bounce.c , Bounce.h
  • BallThreadProc() : GUIBALL.Cpp
  • BankLang : bankdlg.h
  • BAR_WIN_WIDTH : sdkdiff.h
  • BarClick() : bar.cpp
  • BarDrawPosition() : bar.cpp , sdkdiff.h
  • Bark() : iDog.Idl
  • BarPaint() : bar.cpp
  • BarWndProc() : bar.cpp
  • Base64DecodeChunk() : IsapiBuffer.cpp
  • Base64EncodeChunk() : IsapiString.cpp
  • BASE_CLASS : cbase.h
  • bCaptureOn : Mypal.c
  • bChooseNewColor() : MfEdit.c , MfEdit.h
  • bChooseNewFont() : MfEdit.c , MfEdit.h
  • bCleanUpRC() : MfEdit.c , MfEdit.h
  • BCODE : GLOBAL.h
  • bCompAttr : Data.c , IMEApps.h
  • bCompReadAttr : Data.c , IMEApps.h
  • bConnect : Mcastws1.c
  • bDBCS : sdkdiff.cpp , sdkdiff.h
  • bDebug : Service.C , Service.c
  • bDoFindDlg : Find.h
  • bDoHitTest() : MfEdit.c , MfEdit.h
  • bDontJoin : Mcastws1.c , Mcastws2.c
  • bDoOpenDlg : Open.h
  • bDrawStuff() : MfEdit.c , MfEdit.h
  • bdtBinaryDataType : msiloc.cpp
  • bdtBitmap : msiloc.cpp
  • bdtEXE_DLL_SCRIPT : msiloc.cpp
  • bdtIcon : msiloc.cpp
  • bdtJPEG : msiloc.cpp
  • BE_CreateTable() : networkentry.c , networkentry.h
  • BE_DestroyTable() : networkentry.c , networkentry.h
  • BE_Display : networkentry.h
  • BE_FindTable : networkentry.h
  • bEditACLs : SidClean.c
  • BEZ_CURVES : Poly.h
  • BEZ_PTS : Poly.h
  • BEZBUFFER : Poly.h
  • BF : suminfo.Cpp
  • bFailIfExists : RmWorker.Idl
  • bFreeDibFile() : MfEdit.c , MfEdit.h
  • bGetBMP() : MfEdit.c , MfEdit.h
  • bGetEPSBounds() : MfEdit.c , MfEdit.h
  • bGetWord() : MfEdit.c , MfEdit.h
  • bGoNextLine() : MfEdit.c , MfEdit.h
  • bHitTest() : MfEdit.c , MfEdit.h
  • BIG_BUFF : Client.cpp
  • Bind() : Sample1.Cpp , Sample1.h
  • BIND_ALLCOLS : crowset.h
  • BIND_ALLCOLSEXPECTBOOKMARK : crowset.h
  • BIND_PARM_OFFSET : quiktest.h
  • BIND_SIZE : quiktest.h
  • BIND_UPDATEABLECOLS : crowset.h
  • BindAllColumns() : quiktest.c
  • BINDCOLS : crowset.h
  • BindFetchColumns() : quiktest.c
  • BINDING : odbcsql.c
  • BINDING_ENTRY : networkentry.h
  • BINDING_LENGTH : common.h
  • BINDING_STATUS : common.h
  • BINDING_VALUE : common.h
  • bInitOK : Perfgen.c
  • BinToHex() : quiktest.c
  • bIsAdobe() : MfEdit.c , MfEdit.h
  • bIsBndBox() : MfEdit.c , MfEdit.h
  • bIsEOF() : MfEdit.c , MfEdit.h
  • bIsEPS() : MfEdit.h , MfEdit.c
  • bIsNT() : WbemSec.Cpp
  • BIT_ALL_PROPERTIES : FrameworkProv.Cpp
  • BIT_CLEAR : common.h
  • BIT_REDNOSE : FrameworkProv.Cpp
  • BIT_SET : common.h
  • BIT_WEIGHT : FrameworkProv.Cpp
  • bitmap : section.cpp
  • BITMAP_COUNT : MainWND.c
  • BITMAP_X : Server32.h
  • BITMAP_Y : Server32.h
  • BITMAPHEIGHT : mwclass.Cxx
  • BitmapToDIB() : Dibapi.h , Dibutil.c
  • BITMAPWIDTH : mwclass.Cxx
  • BITSCheckHR() : bits_ie.cpp
  • BitsInMap() : section.cpp
  • BITSTOBYTES : CeLibW2k.h
  • bJapan : sdkdiff.cpp , sdkdiff.h
  • bJustCount : SidClean.c
  • BKL_Abort() : keys.cpp
  • BKL_Alloc() : keys.cpp
  • BKL_Dealloc() : keys.cpp
  • BLACK : MfEdit.h
  • BLANKBUTTON_DOWN : BttnCur.h
  • BLANKBUTTON_INDETERMINATE : BttnCur.h
  • BLANKBUTTON_MOUSEDOWN : BttnCur.h
  • BLANKBUTTON_UP : BttnCur.h
  • BLANKS : Enumprt.h , Getcaps.h
  • BLOCK : list.cpp
  • BLOCK_SIZE : persist.cpp
  • BLOCKSIZE : list.cpp , PrPerf.c , AdvClientdlg.cpp , Consumer.Cpp , UtilLib.h
  • bLogFontParam : Font.c
  • bLoopBack : Mcastws1.c , Mcastws2.c
  • BLRPLATE_AttachProperties() : blrplate.c
  • BLRPLATE_Deregister() : blrplate.c
  • BLRPLATE_FLAGS_FLAGS : blrplate.h
  • BLRPLATE_FLAGS_SUMMARY : blrplate.h
  • BLRPLATE_FormatProperties() : blrplate.c
  • BLRPLATE_FormatSummary() : blrplate.c
  • BLRPLATE_OPCODE : blrplate.h
  • BLRPLATE_RecognizeFrame() : blrplate.c
  • BLRPLATE_Register() : blrplate.c
  • BLRPLATE_SIGNATURE : blrplate.h
  • BLRPLATE_SUMMARY : blrplate.h
  • BLRPLATECONFIG : blrplate.h
  • BLRPLATEEntryPoints : blrplate.c
  • BLRPLATEFlags : blrplate.c
  • BLRPLATEFlagsSET : blrplate.c
  • BLRPLATEHDR : blrplate.h
  • BLRPLATEOpCodes : blrplate.c
  • BLRPLATEOpCodesSET : blrplate.c
  • BLRPLATEPropertyTable : blrplate.c
  • BLUE_COLOR : DoServer.h
  • BMID_BASED : MfEdit.h
  • BMID_BASEU : MfEdit.h
  • BMID_BEZIERD : MfEdit.h
  • BMID_BEZIERU : MfEdit.h
  • BMID_BMPOBJD : MfEdit.h
  • BMID_BMPOBJU : MfEdit.h
  • BMID_ELLIPSED : MfEdit.h
  • BMID_ELLIPSEU : MfEdit.h
  • BMID_FFD : MfEdit.h
  • BMID_FFU : MfEdit.h
  • BMID_FILLELLIPSED : MfEdit.h
  • BMID_FILLELLIPSEU : MfEdit.h
  • BMID_FILLRECTD : MfEdit.h
  • BMID_FILLRECTU : MfEdit.h
  • BMID_LINED : MfEdit.h
  • BMID_LINEU : MfEdit.h
  • BMID_METAFD : MfEdit.h
  • BMID_METAFU : MfEdit.h
  • BMID_OPEND : MfEdit.h
  • BMID_OPENU : MfEdit.h
  • BMID_PEND : MfEdit.h
  • BMID_PENU : MfEdit.h
  • BMID_PLAYD : MfEdit.h
  • BMID_PLAYU : MfEdit.h
  • BMID_RECORDD : MfEdit.h
  • BMID_RECORDU : MfEdit.h
  • BMID_RECTD : MfEdit.h
  • BMID_RECTU : MfEdit.h
  • BMID_STOPD : MfEdit.h
  • BMID_STOPU : MfEdit.h
  • BMID_TEXTD : MfEdit.h
  • BMID_TEXTU : MfEdit.h
  • BMID_TOOLBASED : MfEdit.h
  • BMID_TOOLBASEU : MfEdit.h
  • BMP_STORAGE : DfV.h
  • BMP_STREAM : DfV.h
  • bNoFileIO : Service.cpp , Service.h
  • BookmarkEnum : adoint.h
  • BOOL : suminfo.Cpp , GinaHook.h , GinaStub.h , LinkList.h , OleStd.h , rqsengine.h , GinaHook.h , GinaStub.h , Tst4Wts.c
  • BOOT_INI : Monkey.h
  • bOpCode : Utils.c
  • BORDER : Paint.h , SpinTest.h
  • BOT_BINDER : baseobj.h
  • BOT_COMMAND : baseobj.h
  • BOT_DATASOURCE : baseobj.h
  • BOT_ROW : baseobj.h
  • BOT_ROWSET : baseobj.h
  • BOT_SESSION : baseobj.h
  • BOT_STREAM : baseobj.h
  • BOT_UNDEFINED : baseobj.h
  • BOTTOM : Rebar.c
  • BOTTOM_BORDER : DebMain.c
  • BottomRight() : status.cpp
  • BOUNCECLASS : Bounce.h
  • BounceCommandProc() : Bounce.h , Bounce.c
  • BounceCreateProc() : Bounce.c , Bounce.h
  • BOUNCEDATA : Bounce.h
  • BounceDestroyProc() : Bounce.c , Bounce.h
  • BounceObjects() : Bounce.c , Bounce.h
  • BouncePaintProc() : Bounce.c , Bounce.h
  • BounceProc() : Bounce.c , Bounce.h
  • BounceRefresh() : Bounce.c , Bounce.h
  • BOUNCETITLE : GdiDemo.h
  • BOUNDARY_MAXSIZE : callback.Cpp
  • bPassWordSet : security.cpp
  • BPITEM_BREAKPOINT : DbgCmd.c
  • BPITEM_WATCHPOINT : DbgCmd.c
  • bPlayRecord() : MfEdit.c , MfEdit.h
  • bPlgBlt() : MfEdit.c , MfEdit.h
  • bPrintMf() : MfEdit.h , MfEdit.c
  • BRANCH : Monkey.h
  • BREAK_ON_ERROR : globals.h
  • BREAKINTO : common.h
  • BreakRun() : DspFormt.Cpp
  • BreakToken : HtmlScan.Hxx
  • bRecordRoute : Ping.cpp
  • bRecurse : SidClean.c
  • bReuseAddr : Mcastws1.c
  • BrochureMachine_ProxyFileInfo : BrochureMachine_p.c
  • Browse() : Utility.h , Utility.c
  • BrowseOpenFileName() : common.cpp , common.h
  • BrowserConfigs : SimpleBrowser.cpp
  • BrowserSessions : SimpleBrowser.cpp
  • BrowseSaveFileName() : common.cpp , common.h
  • BRUSHSTYLELOOKUP : Printer.h
  • BS_3STATE : winres.h
  • BS_AUTO3STATE : winres.h
  • BS_AUTOCHECKBOX : winres.h
  • BS_AUTORADIOBUTTON : winres.h
  • BS_CHECKBOX : winres.h
  • BS_DEFPUSHBUTTON : winres.h
  • BS_GROUPBOX : winres.h
  • BS_LEFTTEXT : winres.h
  • BS_OWNERDRAW : winres.h
  • BS_PUSHBUTTON : winres.h
  • BS_RADIOBUTTON : winres.h
  • BS_USERBUTTON : winres.h
  • bsADsPathContainer : main.cpp
  • bScreen : Font.c
  • BSEG : GLOBAL.h
  • bSelectDIBPal() : MfEdit.c , MfEdit.h
  • bSender : Mcastws1.c , Mcastws2.c
  • bServerListening : Service.h , filerepservice.cpp , Service.cpp
  • bSetAdvancedGraphics() : MfEdit.h , MfEdit.c
  • bSetRC2MatchEmfRC() : MfEdit.c
  • bSetupRC() : MfEdit.h , MfEdit.c
  • bsFILE : main.cpp
  • bSHARE_DENYNONE : wn_dos.h
  • bSHARE_DENYRDWR : wn_dos.h
  • bSHARE_DENYWR : wn_dos.h
  • bsLDAP : main.cpp
  • bsNT5GroupName : main.cpp
  • bsPASS : main.cpp
  • bsSamAcctName : main.cpp
  • bsSAMNAME : main.cpp
  • BST2STATE : cdialoglite.h
  • BST3STATE : cdialoglite.h
  • BSTACK : GLOBAL.h
  • bStartup : WinCap.c
  • bstr2long : dynamic.h
  • BSTR2LPSTR() : plugxprt.cpp , utils.cpp , nmsession.cpp
  • BSTR_UserFree() : ADsError.h
  • BSTR_UserMarshal() : ADsError.h
  • BSTR_UserSize() : ADsError.h
  • BSTR_UserUnmarshal() : ADsError.h
  • BSTRC : policy.h
  • BSTRCompareW() : StringUtils.cpp , StringUtils.h , StringUtils.cpp , PropList.cpp , StringUtils.cpp , PropList.cpp , PropList.h
  • bstrtEMPTY : RendSam.Cpp
  • bsUNAME : main.cpp
  • bsUSER : main.cpp
  • bTakeOwnership : SidClean.c
  • BtoH() : Globals.h , Misc.c
  • bTrace : sdkdiff.cpp
  • bTrack : Cursor.c , Demo.c
  • buf : Admapit.c , quiktest.c
  • BUF_SIZE : pipe.hxx
  • BUFF_SIZE : Redirect.cpp
  • BUFFER : HttpAuth.c
  • Buffer : Dt.h , Dt_Dll.Cpp
  • BUFFER_FILENAME : spy.cpp
  • BUFFER_GROWTH_FACTOR : PropList.cpp
  • BUFFER_ID : spy.cpp
  • BUFFER_LEN : WSnmpUtil.h
  • BUFFER_LENGTH : spy.cpp , readcli.c , spy.cpp
  • BUFFER_LINENUMBER : spy.cpp
  • BUFFER_SIZE : Client.c , UnBufCp1.c , SignHash.cpp , UnBufCp2.c , gutils.h , DebDebug.c
  • BufferCallback() : tracedmp.cpp
  • BufferIn1() : Server.c
  • BufferIn2() : Server.c
  • BufferIn3() : Server.c
  • BufferInit() : HttpAuth.c
  • BufferOut1() : Server.c
  • BufferOut2() : Server.c
  • BufferOut3() : Server.c
  • BufferOut4() : Server.c
  • BufferQueryPtr() : HttpAuth.c
  • BufferResize() : HttpAuth.c
  • BUFFERSIZE : MqApiTst.h , RequestCert.Cpp
  • BufferTerminate() : HttpAuth.c
  • BUFFLEN : utils.cpp
  • BUFFSIZE : Generic.C
  • BUFSIZE : Common.h , MciPlay.c , Mcastws1.c , Mcastws2.c
  • BuildAdministratorsExplicitAccess() : SuperUsr.cpp
  • BuildAppletKey() : session.cpp
  • BuildCreateStmt() : quiktest.c
  • BuildDataFileName() : Utility.h , Utility.Cpp
  • BuildExecCommand() : utils.h , utils.Cpp
  • BuildFilterStrs() : MfEdit.c , MfEdit.h
  • BuildFontList() : Paint.c , Paint.h
  • BuildGenericAccessAcl() : common.c
  • BuildGlobalObjects() : server.cpp
  • BuildInsertStmt() : quiktest.c
  • BuildKeyList() : keys.cpp
  • BuildKeyValues() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • BuildLspMap() : instlsp.cpp
  • BuildNamedPipeAcl() : Server.c
  • BuildParaRunList() : DspFormt.Cpp
  • BuildRebar() : Rebar.c
  • BuildVisualDisplayOrder() : DspFormt.Cpp
  • bUserMode : tracedmp.cpp
  • bUserNameSet : security.cpp
  • Busy() : winmain.cpp , SServer.Cpp , winmain.h
  • BusyError() : sdkdiff.cpp
  • BUTTON_BORDER : ToolBar.c
  • BUTTON_COUNT : MainWND.c
  • BUTTONBAR_BORDER : ToolBar.c
  • ButtonFontSetup() : Dialer.c
  • BUTTONGROUP_ACTIVE : BttnCur.h
  • BUTTONGROUP_BLANK : BttnCur.h
  • BUTTONGROUP_DISABLED : BttnCur.h
  • BUTTONGROUP_DOWN : BttnCur.h
  • BUTTONGROUP_LIGHTFACE : BttnCur.h
  • BUTTONHEIGHT : ToolBar.c , Global.h
  • ButtonsDlgProc() : Property.c
  • BUTTONWIDTH : ToolBar.c , Global.h , ToolBar.c
  • bViewFull : WinCap.c
  • BYTE : suminfo.Cpp
  • BYTE_OFFSET : util.h , scpcmenuui.h
  • BYTE_SIZE : globals.h
  • byteCount : suminfo.h
  • byteOffset : suminfo.Cpp
  • BytesPerLine() : Dib.h
  • BYTESPERLINE : strmvwr.Cxx
  • BytesPerLine() : Dib.c
  • BYTESPERLINE : DIBSectn.c
  • bZero : ComPerf.Cpp , OleApt.Cpp , OleImp.Cpp
  • bZoomed : FontView.c
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- c -

  • c_clsidCaseTextService : globals.cpp , globals.h
  • c_clsidMarkTextService : globals.h , globals.cpp
  • c_guidCaseProfile : globals.cpp , globals.h
  • c_guidCaseProperty : globals.h , globals.cpp
  • c_guidCustomProperty : globals.cpp , globals.h
  • c_guidLangBarItemButton : globals.cpp , globals.h , globals.cpp , globals.h
  • c_guidMarkContextCompartment : globals.h , globals.cpp
  • c_guidMarkDisplayAttribute : globals.cpp , globals.h
  • c_guidMarkGlobalCompartment : globals.cpp , globals.h
  • c_guidMarkProfile : globals.cpp , globals.h
  • C_MIDI_BUFFERS : MidiPlyr.h
  • c_rgCategories : register.cpp
  • c_rgclrPredef : fakemenu.c
  • c_rgMenuItems : langbar.cpp
  • c_SampleDropExt_CTMVtbl : DropExt.C
  • c_SampleDropExt_SXIVtbl : DropExt.C
  • c_szDataFile : Utility.h , SampView.Cpp
  • c_szSection : SampView.Cpp , Utility.h
  • c_szWorkerWndClass : property.cpp
  • C_TEMPO_MAP_CHK : SMFI.h
  • c_vtblAppUIClassFactory : DefClsF.C
  • c_wchMagic : utils.cpp
  • CA_AUTO_COLOR : cdialoglite.h
  • CA_BOLD : cdialoglite.h
  • CA_COLOR : cdialoglite.h
  • CA_DISABLE : cdialoglite.h
  • CA_ITALIC : cdialoglite.h
  • CA_LINK : cdialoglite.h
  • CA_NORMAL : cdialoglite.h
  • CA_PROTECTED : cdialoglite.h
  • CA_STRIKEOUT : cdialoglite.h
  • CA_UNDERLINE : cdialoglite.h
  • CACCELERATORS : Resource.h
  • CACHE_PAGE : CacheIsapi.cpp
  • CacheListHead : cache.c
  • CAdviseSink() : ias.h
  • caHalf : halftone.c
  • CalcListViewWidth() : Helper.Cpp , Helper.h
  • CalcPrettyPrintMaxColWidth() : dump.cpp , sampclnt.h
  • CalcRot() : Display.c
  • CalculateImageOffset() : Icons.C
  • CalculatePrintRect() : Print.c
  • Call() : tapisend.cpp
  • call_server() : GssClient.c
  • CALL_STATE : nullmdm.h
  • CALL_STATE_ANSWER : nullmdm.h
  • CALL_STATE_CONNECTED : nullmdm.h
  • CALL_STATE_DROP : nullmdm.h
  • CALL_STATE_IDLE : nullmdm.h
  • CALL_STATE_MAKE : nullmdm.h
  • CALLBACK : cdialog.h
  • CallbackNumber : Admapit.c
  • CallConfDlgProc() : Dlg.Cpp
  • CallDlgProc() : Dlg.Cpp
  • callObjFullArray : scaledemo.Cpp
  • callObjSampleArray : scaledemo.Cpp
  • CALLTIMEOUT : Client.h
  • CALLTIMEOUTWHENPINGING : Client.h
  • CallUserApcProc() : overlap.cpp
  • CallWorkerThread() : RasHost.Cpp , RasHost.h
  • CanAllocHdesc() : quiktest.c
  • CANCEL_DlgProc() : Cancel.Cpp
  • CANCEL_OnCommand() : Cancel.Cpp
  • CANCEL_OnInitDialog() : Cancel.Cpp
  • CANCEL_OnTimer() : Cancel.Cpp
  • CAND_CX : IMEApps.h
  • CandListWndProc() : IMEApps.c , IMEApps.h
  • CandUIPaint() : CANDUI.C , FullIME.h
  • CandWndProc() : CANDUI.C , FullIME.h
  • CanInPlaceActivate() : ioips.h
  • CAPICOM_SMART_CARD_LOGON_OID_W : isapiCertPolicy.cpp
  • CAPSLOOKUP : Getcaps.h
  • CARET_HEIGHT : MfEdit.h
  • CARET_SECTION_FORMATTED : Global.h
  • CARET_SECTION_LOGICAL : Global.h
  • CARET_SECTION_PLAINTEXT : Global.h
  • CaretHandling() : DspFormt.Cpp
  • CaretWidth : FullIME.h , Global.C , Main.C
  • CASE_DESC : globals.h
  • CASE_DESC_A : globals.h
  • CASE_ICON_INDEX : globals.h
  • CASE_LANGBARITEMSINK_COOKIE : langbar.cpp
  • CASE_LANGID : globals.h
  • CASE_MODEL : globals.h
  • CASE_OF : AsyncDemo.cpp
  • CASE_SCODE : dbgUtil.c
  • CASEMSG : Range.c
  • CATCHDB : adoheader.h
  • cAuthnEntries : secClnt.Cpp
  • cAuthnLevelEntries : secClnt.Cpp , secSvr.Cpp
  • cAuthzEntries : secClnt.Cpp
  • CB_ADDSTRING : winres.h
  • CB_CLASS_NAME : CommBand.h
  • CB_MIDI_BUFFERS : MidiPlyr.h
  • CB_TIME_FORMATS : MidiPlyr.h
  • CbActualFromCbUser() : malspy.c
  • cbBytes : SimpleLog.Idl
  • CBCLIENTWNDEXTRA : Framer.h
  • CBCREATEGIZMO : GizmoBar.h
  • cbDefault : sclient.cpp
  • cbEnumSymbols() : dbh.cpp
  • CbFileSizePsffs : wn_dos.h
  • CBFRAMEWNDEXTRA : Framer.h
  • CBGBGETINT : GizmoBar.h
  • CBGBGETTEXT : GizmoBar.h
  • CBGBMSG : GizmoBar.h
  • CBGBSETINT : GizmoBar.h
  • cbIoBuffer : WebServer.c
  • CBitArray : bitarray.h
  • cbMaxFile : wn_dos.h
  • cbNewSection : suminfo.h
  • cbNewSummaryInfo : suminfo.h
  • CbReadHfile : wn_dos.h
  • CbReadOsfn : wn_dos.h
  • CbReadOsfnWin : wn_dos.h
  • CBRS_BOTTOM : afxres.h
  • CBRS_LEFT : afxres.h
  • CBRS_NOALIGN : afxres.h
  • CBRS_RIGHT : afxres.h
  • CBRS_TOP : afxres.h
  • CBS_AUTOHSCROLL : winres.h
  • CBS_DISABLENOSCROLL : winres.h
  • CBS_DROPDOWN : winres.h
  • CBS_DROPDOWNLIST : winres.h
  • CBS_HASSTRINGS : winres.h
  • CBS_NOINTEGRALHEIGHT : winres.h
  • CBS_OEMCONVERT : winres.h
  • CBS_OWNERDRAWFIXED : winres.h
  • CBS_OWNERDRAWVARIABLE : winres.h
  • CBS_SIMPLE : winres.h
  • CBS_SORT : winres.h
  • cbSrcFiles() : dbh.cpp
  • cbSymbol() : dbh.cpp
  • CbSzFilePsffs : wn_dos.h
  • cbtsval : quiktest.c
  • CbUserFromCbActual() : malspy.c
  • cbValue : quiktest.c
  • cbValueMax : quiktest.c
  • CBWNDEXTRAFRAME : FVText.h
  • CBWNDEXTRAVIEWPORT : FVText.h
  • cbWritten : suminfo.Cpp
  • cBytes : suminfo.Cpp
  • cc : Colors.c
  • cCacheItems : cache.c
  • cch : OleStd.h
  • CCH_FINDSTRING : findgoto.h
  • CCH_GETPROPERTYINFO_DESCRIP_BUFFER_SIZE : utilprop.h
  • CCH_MAXDIGITS : findgoto.h
  • CCHMAX : Global.h , precomp.h , Global.h
  • CCHSTATUSMSGMAX : Resource.h
  • cchString : OleStd.h
  • CCHSTRINGMAX : Resource.h
  • CCHSTYLE : SpinCube.h
  • CchSzLen() : AdsiDump.cpp
  • CCLRPREDEF : fakemenu.c
  • CComSDKSamplePlaylistParser : SDKSamplePlaylistParser.h
  • ccThread1 : Colors.c
  • ccThread2 : Colors.c
  • CD_NETWORK : Globals.h
  • CD_NODE : Globals.h
  • CD_SOCKET : Globals.h
  • CD_STATUS : Globals.h
  • CDefClassFactory_AddRef() : DefClsF.C
  • CDefClassFactory_Create() : DefClsF.C
  • CDefClassFactory_CreateInstance() : DefClsF.C
  • CDefClassFactory_LockServer() : DefClsF.C
  • CDefClassFactory_QueryInterface() : DefClsF.C
  • CDefClassFactory_Release() : DefClsF.C
  • cdmsgFileOK : ComDlg32.C
  • cdmsgHelp : ComDlg32.C
  • cdmsgShareViolation : ComDlg32.C
  • CDropSource() : ids.h
  • CDropTarget() : idt.h
  • cdrSpeakers : dlgsrc.cpp , stdafx.h
  • cdwNumReps : RefClint.h
  • CE_Cleanup() : configentry.c , configentry.h
  • CE_Create() : configentry.c , configentry.h
  • CE_Destroy() : configentry.c , configentry.h
  • CE_Display : configentry.h
  • CE_Initialize() : configentry.c , configentry.h
  • ceBuildPathAndExt() : CeLib.Cpp , celib.cpp
  • ceConvertSzToBstr() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceConvertSzToWsz() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceConvertWszToBstr() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceConvertWszToSz() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDateToFileTime() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDbgPrintf() : CeDebug.Cpp , CeLibW2k.h , cedebug.cpp , CeDebug.Cpp , CeLibW2k.h , cedebug.cpp
  • ceDecodeObject() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDispatchSetErrorInfo() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDispatchSetErrorInfoSub() : CeLib.Cpp , celib.cpp
  • ceDuplicateString() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDupString() : ceformat.cpp , CeFormat.Cpp
  • ceEncodeObject() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceErrorPrintLine() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceERRORPRINTLINE : CeLibW2k.h
  • ceEXITEVENTS : exit.cpp , Exit.Cpp
  • ceFileTimeToDate() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceFormatCertsrvStringArray() : CeLibW2k.h , ceformat.cpp , CeFormat.Cpp , CeLibW2k.h
  • ceFreeBstr() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceGetComputerNames() : CeLib.Cpp , celib.cpp
  • ceGetErrorMessageText() : CeError.Cpp , ceerror.cpp , CeError.Cpp , CeLibW2k.h , ceerror.cpp , CeError.Cpp , CeLibW2k.h
  • ceGetErrorMessageText1() : CeError.Cpp , ceerror.cpp
  • ceGetErrorMessageTextEx() : CeError.Cpp , ceerror.cpp
  • ceGetMachineDnsName() : CeLib.Cpp , celib.cpp
  • ceGetOIDName() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceGetOIDNameA() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceHError() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceHExceptionCode() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceHLastError() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceHResultToString() : CeError.Cpp , ceerror.cpp , CeError.Cpp , CeLibW2k.h , ceerror.cpp , CeError.Cpp , CeLibW2k.h
  • ceHResultToStringEx() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceHResultToStringRaw() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceInitErrorMessageText() : CeError.Cpp , ceerror.cpp , CeError.Cpp , CeLibW2k.h , ceerror.cpp , CeError.Cpp , CeLibW2k.h
  • ceInternetCanonicalizeUrl() : CeLibW2k.h , ceformat.cpp , CeFormat.Cpp , CeLibW2k.h
  • ceIsConfigLocal() : CeLib.Cpp , celib.cpp
  • ceIsDelayLoadHResult() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceJetHResult() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • CELEMS : customdial.cpp , customentry.c , PhoneEntry.c , RasGetConnectionStatistics.c , RasDial.c , RasDialAsync.c , RasEnumConnections.c , RasEnumDevices.c , RasEnumentries.c , RasHost.Cpp , Admapit.c , AdminDll.c , packet.c , test.c
  • CELL_VALID : tpriv.h
  • celstrcmpiL() : CeLib.Cpp , celib.cpp
  • ceMakeExprDate() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceMakeExprDateTime() : CeLib.Cpp , celib.cpp , CeLib.Cpp , celib.cpp , CeLib.Cpp
  • CENCODEMAX : CeLibW2k.h
  • CenterDialog() : common.cpp , common.h , winmain.cpp , winmain.h , Main.Cpp
  • CenterOrigin() : WxForm.c , WxForm.h
  • CenterWindow() : Generic.C , DoServer.Cpp , Dialogs.c , FontView.c , printjob.c , printjob.h , TextFx.c , WinCap.c , WinCap.h , halftone.c , GLOBALS.h , Misc.c , Globals.h , Misc.c , Global.h , Util.Cpp , StatList.c , WinUtils.c , WinUtils.h , LeakyBin.c
  • cEntries : OleStd.h
  • cErr : main.cxx
  • cErrLogInValid : Admapit.c
  • CERTLIB_12BITERRORMASK : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • CERTLIB_WIN32ERRORMASK : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • CERTTYPE_ATTR_NAME : Exit.Cpp
  • ceSanitizedNameToDSName() : ceformat.cpp , CeFormat.Cpp
  • ceTranslatePeriodUnits() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceVerifyAltNameString() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceVerifyObjId() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceVerifyObjIdA() : CeLib.Cpp , celib.cpp
  • ceWtoI() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • CExtBuffer : extbuff.h
  • cf : Font.c
  • CF_CUSTOMLINKSOURCE : OleStd.h
  • CF_EMBEDDEDOBJECT : OleStd.h
  • CF_EMBEDSOURCE : DataObj.h , OleStd.h
  • CF_FILENAME : OleStd.h
  • CF_LINKSOURCE : OleStd.h
  • CF_LINKSRCDESCRIPTOR : OleStd.h
  • CF_OBJECTDESCRIPTOR : OleStd.h
  • CF_OWNERLINK : OleStd.h
  • CFD_BASE : FontView.h
  • CFD_CHARSET : FontView.h
  • CFD_CLIPPRECISION : FontView.h
  • CFD_DEFAULT : FontView.h
  • CFD_ESCAPEMENT : FontView.h
  • CFD_FACENAME : FontView.h
  • CFD_HEIGHT : FontView.h
  • CFD_ITALIC : FontView.h
  • CFD_ORIENTATION : FontView.h
  • CFD_OUTPUTPRECISION : FontView.h
  • CFD_PITCHANDFAMILY : FontView.h
  • CFD_QUALITY : FontView.h
  • CFD_STRIKEOUT : FontView.h
  • CFD_UNDERLINE : FontView.h
  • CFD_WEIGHT : FontView.h
  • CFD_WIDTH : FontView.h
  • cfEmbeddedObject : Common.h , ole2ui.c
  • cfEmbedSource : Common.h , ole2ui.c
  • cfFileName : Common.h , ole2ui.c
  • cfFormat : OleStd.h
  • cfLinkSource : Common.h , ole2ui.c
  • cfLinkSrcDescriptor : Common.h , ole2ui.c
  • cfObjectDescriptor : Common.h , ole2ui.c
  • cfOwnerLink : Common.h , ole2ui.c
  • CFP_BASE : FontView.h
  • CFP_CHARSET : FontView.h
  • CFP_CLIPPRECISION : FontView.h
  • CFP_ESCAPEMENT : FontView.h
  • CFP_FACENAME : FontView.h
  • CFP_FAMILY : FontView.h
  • CFP_HEIGHT : FontView.h
  • CFP_ITALIC : FontView.h
  • CFP_ORIENTATION : FontView.h
  • CFP_OUTPUTPRECISION : FontView.h
  • CFP_PITCH : FontView.h
  • CFP_QUALITY : FontView.h
  • CFP_STRIKEOUT : FontView.h
  • CFP_UNDERLINE : FontView.h
  • CFP_WEIGHT : FontView.h
  • CFP_WIDTH : FontView.h
  • CFSTR_DS_PARENTHWND : PropSheetHost.h
  • CFSTR_DS_PARENTHWND_A : PropSheetHost.h
  • CFSTR_DS_PARENTHWND_W : PropSheetHost.h
  • CFSTR_DS_PROPSHEETCONFIG : PropSheetHost.h
  • CFSTR_DS_PROPSHEETCONFIG_A : PropSheetHost.h
  • CFSTR_DS_PROPSHEETCONFIG_W : PropSheetHost.h
  • CFSTR_SAMPVIEWDATA : Utility.h
  • cfThread1 : Font.c
  • cfThread2 : Font.c
  • cgrFormats : dlgdest.cpp
  • Challenge : SampSSP.H
  • ChallengeResponse : SampSSP.H
  • CHANGE : Check_SD.h
  • CHANGE_DURATION_PAGE : CacheIsapi.cpp
  • ChangeAppIDAccessACL() : DComPerm.h , Wrappers.Cpp
  • ChangeAppIDLaunchAndActivateACL() : DComPerm.h , Wrappers.Cpp
  • ChangeBitmapFormat() : Dibapi.h , Dibutil.c
  • CHANGECELL_ABOUTTODO : myospobject.h
  • CHANGECELL_DIDEVENT : myospobject.h
  • ChangeDefaultAccessACL() : DComPerm.h , Wrappers.Cpp
  • ChangeDefaultLaunchAndActivateACL() : DComPerm.h , Wrappers.Cpp
  • ChangeDIBFormat() : Dibapi.h , Dibutil.c
  • ChangeFont() : Settings.Cpp
  • ChangeMachineAccessACL() : DComPerm.h , Wrappers.Cpp
  • ChangeMachineLaunchAndActivateACL() : DComPerm.h , Wrappers.Cpp
  • ChangeResolution() : SetDisp.c , SetDisp.h
  • CHANNELNAME : SysInfo.h
  • CHAR : suminfo.Cpp , APP.h
  • CHAR_CONVERSION : debug.h , main.cpp , registry.cpp
  • CHAR_STRING_free_inst() : Repassu.c
  • CHAR_STRING_free_local() : Repassu.c
  • CHAR_STRING_from_local() : Repassu.c
  • CHAR_STRING_to_local() : Repassu.c
  • CharHandler() : Main.C
  • chDOSPath : wn_dos.h
  • chDOSWildAll : wn_dos.h
  • chDOSWildSingle : wn_dos.h
  • CHECK_ERROR : httpauth.cpp
  • CHECK_HR : helper.h , prsample.h
  • CHECK_MEMORY : prsample.h , common.h , sampprov.h , winmain.h , common.h
  • CHECK_POINTER : LinkList.c
  • CHECK_STATUS : DynOuts.c
  • CheckAccess() : Main.h , Security.Cpp , Service.cpp , WbemSec.Cpp
  • CheckADHRESULT() : main.cpp , CreateUserHelpers.cpp , CreateUserHelpers.h , ADSIhelpers.h
  • CheckAmount() : caccount.Cpp , mvmoney.Cpp
  • CheckAndLocalFree : MyToken.cpp , SuperUsr.cpp , RSACert.cpp , RSAKey.cpp , SignHash.cpp
  • CheckAndReAllocBuffer() : TapiCode.c
  • CheckAvailableNameSpaceProviders() : rnrcs.cpp
  • CHECKC : common.h
  • CheckConformanceLevel() : quiktest.c
  • CheckData() : quiktest.c
  • CheckDataChannel() : cData.Cpp , cData.h
  • CheckDataResults() : quiktest.c
  • CheckDescOp() : quiktest.c
  • CheckDescRecord() : quiktest.c
  • CheckDescriptor() : quiktest.c
  • CheckDomainModeOfObject() : getdomainmode.cpp
  • CheckEdgePosition() : Bounce.c , Bounce.h
  • CHECKERRS : custom.c
  • CheckFile() : tracedmp.cpp
  • CheckForContextCleanup() : overlap.cpp
  • CheckForMatchIPv4() : parser.c
  • CheckForRecv() : PrPerf.c , PrSamp.h
  • CheckForSelf() : customdialreg.cpp , customentry.c
  • CheckForSend() : PrPerf.c , PrSamp.h
  • CheckHR() : Driver.Cpp , bits_ie.cpp
  • CheckHRESULT() : ADSIhelpers.cpp , ADSIhelpers.h , ADSIhelpers.cpp , ADSIhelpers.h
  • CheckHresult : AdsiDump.cpp
  • CheckHresultADs : AdsiDump.cpp
  • CHECKMENU : sdkdiff.cpp
  • CHECKPOINTER : debug.h
  • CheckProperty : FullIME.h
  • CheckRequestProperties() : Policy.Cpp
  • CheckRunningOnWhistler() : nshsamp.cpp , nshsamp.h
  • CheckSecurity() : Server.c
  • CheckStreamDir() : CallNot.cpp
  • CheckStreamMT() : CallNot.cpp
  • checksum() : rawudp.c , Ping.cpp
  • CHECKSUM : gutils.h
  • checksum_file() : gutils.h , utils.cpp
  • CHECKTEST : custom.c
  • CheckTest() : custom.c
  • CHELPITEMS : Resource.h
  • ChFromHex() : Global.h , Util.Cpp
  • CHILD : Monkey.h , Sockdups.c
  • CHILDPROPS : basenode.h
  • ChkQosSend() : ChkQos.Cpp , QosEvent.h
  • chMinMsiVer : msistuff.cpp
  • chNull : Global.h
  • ChooseAuthScheme() : WinHttpPostSample.cpp
  • ChooseFont() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ChooseFontHookProc() : DebMisc.c
  • ChooseIconFromEXEFile() : Icons.C
  • ChooseLogFile() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ChooseNewBackColor() : DebMisc.c , DebMisc.h
  • ChooseNewFont() : DebMisc.c , DebMisc.h
  • chOperation : msistuff.cpp
  • ChopText() : Utility.c , Utility.h
  • chPeriod : Utility.c
  • chProperties : msistuff.cpp
  • chSpace : Utility.c
  • CHUNKHDR : SMFI.h
  • ci_AddTimeString() : compitem.cpp
  • CI_COMP : compitem.h
  • ci_compare() : compitem.cpp
  • ci_copytext() : compitem.cpp
  • CI_LEFT : compitem.h
  • ci_makecomposite() : compitem.cpp
  • ci_onesection() : compitem.cpp
  • CI_RIGHT : compitem.h
  • CIB : MainWnd.h
  • cImpLevelEntries : secClnt.Cpp , secSvr.Cpp
  • CIMTYPEQUAL : UtilLib.h
  • CINTERFACE_PROXY_VTABLE() : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • CiPtrToUint : minici.hxx
  • CiPtrToUlong() : minici.hxx
  • CircleBlt() : Display.c
  • CKHR : AppUtil.h
  • ClaimMediaLabel() : stl_mll.cpp , stl_mll.h
  • CLASS_GIZMOBAR : GizmoBar.h
  • CLASS_HATCH : hatch.c
  • classmodel : dballoc.Cpp
  • CLASSPROP : UtilLib.h
  • Cleanup() : sa.Cpp , AsyncDemo.cpp
  • cleanup() : client.cxx , dbh.cpp
  • CleanUp() : quiktest.c , Globals.h , Misc.c , BasicRecognition.cpp
  • CleanupAW() : ftrans.c , fwasync.c
  • CleanupEventList() : tracedmp.cpp
  • CleanupFileHandleCache() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • CleanupLabel() : DDxDDv.cpp , DDxDDv.h , DDxDDv.cpp , DDxDDv.h
  • CleanupRowset() : sampclnt.cpp , sampclnt.h
  • CleanUpServer() : Pipes.c , Server.c
  • CleanupTx() : RmWorker.Idl
  • CleanUserURI() : rtcdialogs.cpp
  • clear_codebreakpoint() : BPSamp.h , Utils.c
  • clear_databreakpoint() : BPSamp.h , Utils.c
  • ClearAllEvents() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • CLEARBIT : CeLibW2k.h
  • ClearChanges() : queue.c , queue.h
  • ClearConvModeParts() : IMEApps.h , Status.c
  • ClearErrorQueue() : quiktest.c
  • ClearLog() : Debug.Cpp , Global.h
  • ClearSecret() : Create.Cpp , Process.cpp
  • ClearSelection() : Select.c , Select.h
  • ClearStruct : Global.h
  • ClearSumInf : suminfo.h
  • ClearText() : Global.h , Util.Cpp , Global.h , Util.Cpp
  • clearthread_databreakpoint() : Utils.c
  • CLIENT : Bcast.c
  • CLIENT_BUFFER_SIZE : Pipec.c
  • client_establish_context() : GssClient.c
  • CLIENT_RESPONSE_TIMEOUT : RasHost.h
  • CLIENT_WINDOW_TITLE : AptServe.h , LocServe.h
  • ClientActiveReqBounds : Service.cpp , Service.h , service.cpp , service.h
  • ClientActiveReqHashCounters : Service.cpp , Service.h , service.cpp , service.h
  • ClientActiveReqHashQueues : service.cpp , service.h
  • ClientCharSetProc() : FontView.c
  • ClientCompletionPort : FileRepClientProc.cpp , Service.cpp
  • ClientCompletionPortTimeout : FileRepClientProc.cpp
  • ClientContext : TestAccept.cpp
  • clientCount : Server32.c
  • ClientDialogProc() : secClnt.Cpp
  • ClientDlgProc() : Client32.c , Client32.h
  • ClientError : rqsclient.h
  • ClientGlyphProc() : FontView.c
  • ClientIoAccept : IocpServer.h
  • ClientIoRead : IocpServer.h
  • ClientIoWrite : IocpServer.h
  • ClientProc() : FontView.c
  • ClientReqBounds : Service.cpp , Service.h , service.cpp , service.h
  • ClientReqQueues : Service.cpp , Service.h , service.cpp , service.h
  • clients : Server32.c
  • ClientSend() : rnrcs.cpp
  • ClientShutdownRequest() : FileRepClientProc.cpp
  • ClientThreadProc() : ComPerf.Cpp
  • CLIENTWL_STRUCTURE : Framer.h
  • CLIENTWND : GdiDemo.h
  • ClientWndProc() : Framer.Cpp , Framer.h
  • clip : suminfo.h
  • CLIPBOOKSERVER_RESOURCE : ClipBook Server.cpp
  • CLIPBOOKSERVER_SINGLE_INSTANCE_SEMAPHORE : ClipBook Server.cpp
  • CLIPBOOKSERVER_SVCNAME : ClRes.h
  • ClipBookServerCheckIsAlive() : ClipBook Server.cpp
  • ClipBookServerClose() : ClipBook Server.cpp
  • ClipBookServerDllMain() : ClipBook Server.cpp , ClRes.h
  • ClipBookServerGetRequiredDependencies() : ClipBook Server.cpp
  • ClipBookServerIsAlive() : ClipBook Server.cpp
  • ClipBookServerLooksAlive() : ClipBook Server.cpp
  • ClipBookServerOffline() : ClipBook Server.cpp
  • ClipBookServerOfflineThread() : ClipBook Server.cpp
  • ClipBookServerOnline() : ClipBook Server.cpp
  • ClipBookServerOnlineThread() : ClipBook Server.cpp
  • ClipBookServerOpen() : ClipBook Server.cpp
  • ClipBookServerResourceControl() : ClipBook Server.cpp
  • ClipBookServerSetNameHandler() : ClipBook Server.cpp
  • ClipBookServerStartup() : ClipBook Server.cpp , ClRes.h
  • ClipBookServerTerminate() : ClipBook Server.cpp
  • ClipBookServerVerifyRequiredDependencies() : ClipBook Server.cpp
  • clipFormatNo : suminfo.h
  • ClntName : Client32.c
  • clNumInstances : RefClint.h
  • cLogFile : Admapit.c
  • CloneAccess() : BasicHiPerf.Cpp
  • CloneContext() : RecoDll.cpp
  • clOption : client.cxx
  • Close() : ioo.h , FTPJr.cpp
  • CloseAndFreeSocketInfo() : provider.h , sockinfo.cpp
  • CloseAppMemPerformanceData : Perfmem.c
  • CloseAuthSocket() : Client.cpp , Server.cpp
  • CloseClient() : IocpServer.Cpp , IocpServer.h , IocpServerex.Cpp
  • CLOSEEVENT : Overlap.c
  • CloseInstance() : printjob.c
  • CloseKeys : profile.h
  • CloseLogFile() : NewFsp.h , Util.c
  • CloseReadThread() : CommCode.c
  • CloseRegKey() : common.cpp , common.h
  • CloseSigGenPerformanceData : Perfgen.c
  • CLOSESOCK : Overlap.c
  • CloseTAPI() : Dialer.c
  • CloseWinSNMPSession() : WSnmpUtil.Cpp , WSnmpUtil.h
  • CloseWriteThread() : CommCode.c
  • CLR_BLUE : ChildWnds.cpp
  • CLR_GRAY : ChildWnds.cpp
  • CLRES_V1_FUNCTION_TABLE() : ClipBook Server.cpp , File Share Sample.cpp
  • CLSID : ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c , iapplet.c
  • CLSID_ADsError : ADsError.h , ADsError_i.c
  • CLSID_AsyncTest : DCOMServer.h
  • CLSID_CallAs : Client.c , Server.Cxx
  • CLSID_CIM_REINDEER : MainDll.Cpp
  • CLSID_CleanupSample : Cleanup.Cpp
  • CLSID_ComSpyPropPage : ComSpyproppage.h
  • CLSID_ContextSamplePropPage : ContextSamplePropPageImpl.h
  • CLSID_CSmpFilter : SmpFilt.Hxx
  • CLSID_DEFINED : ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c , iapplet.c
  • CLSID_Dimmer : MyDevice.h , MyDevice_i.c , MyDevice.h , MyDevice_i.c
  • CLSID_EapCfg : CeapCfg.h , Exports.Cpp
  • CLSID_HelloWorld : ADsFirstExt.h , ADsFirstExt_i.c , ADsFirstExt.h , ADsFirstExt_i.c
  • CLSID_HtmlClass : HtmlIFlt.Cxx
  • CLSID_HtmlIFilter : HtmlProp.Cxx , HtmlIFlt.Cxx , HtmlIFlt.Hxx
  • CLSID_HtmlInformation : HtmlGuid.Cxx , HtmlGuid.Hxx
  • CLSID_HtmlPropClass : HtmlProp.Cxx
  • CLSID_HtmlPropIFilter : HtmlProp.Cxx
  • CLSID_KEY : RecoDll.cpp
  • CLSID_MetaProperty : HtmlProp.Cxx
  • CLSID_MMCControl : atlcontrol.h
  • CLSID_MSOmniProv : theprovider.h
  • CLSID_NmApplet : iapplet.c , iapplet.h
  • CLSID_OHello : cHello.Cxx , Client.Cxx , Server.Cxx
  • CLSID_ospsampc : myclassfactory.cpp
  • CLSID_ProppageSCP : SCPProppage.h
  • CLSID_ProppageUser : userproppage.h
  • CLSID_SampleStemmer : lrsample.CXX
  • CLSID_SampleWordBreaker : lrsample.CXX
  • CLSID_SCPContextMenu : SCPCMenu.h
  • CLSID_SCPWizard : SCPWizard.h
  • CLSID_ShortNameColumnProvider : ShortName.Cpp
  • CLSID_Storage : HtmlGuid.Cxx , HtmlGuid.Hxx
  • CLSID_STRING_SIZE : registry.cpp
  • CLSID_STRLEN : register.cpp
  • CLSID_SummaryInformation : HtmlGuid.Cxx , HtmlGuid.Hxx
  • CLSID_SyncMgrHandler : Cfact.Cpp , DllMain.Cpp
  • CLSID_TF_ThreadMgr : TPCInfo.cpp
  • CLSID_WizExtUser : userwizard.h
  • CLSIDFromProgIDA : ansiapi.h
  • CLSIDFromProgIDEx() : common.h
  • CLSIDFromStringA : ansiapi.h
  • CLSIDFromStringEx() : common.h
  • CLSIDtochar() : registry.cpp
  • CLSIDToStringA() : register.cpp
  • CLUSCTL_RESOURCE_FILESHARESAMPLE_CALL_ISALIVE : File Share Sample.cpp , StdAfx.h
  • CLUSDISK_SRB_SIGNATURE : CStorageResource.cpp
  • CLUSTER_MENU_BASE_ID : ExtObjData.cpp
  • CLUSTER_MENU_ID_1 : ExtObjData.cpp
  • CLUSTER_RESTYPE_DEFAULT_IS_ALIVE : CMgdResType.cpp , CStorageResType.cpp
  • CLUSTER_RESTYPE_DEFAULT_LOOKS_ALIVE : CMgdResType.cpp , CStorageResType.cpp
  • Clutch() : MICARS.Idl
  • CM_GetEventMessage() : configmgr.c , configmgr.h
  • CM_GetGlobalInfo() : configmgr.c , configmgr.h
  • CM_SetGlobalInfo() : configmgr.c , configmgr.h
  • CM_StartProtocol() : configmgr.c , configmgr.h
  • CM_StopProtocol() : configmgr.c , configmgr.h
  • CM_WorkerFinishStopProtocol() : configmgr.c
  • CMALLOCSPY : malspy.c
  • CMAPHEX : Grid.Cxx
  • cMaxCallsExecute : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • cMaxCallsListen : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • cMaxStemForms : lrsample.CXX
  • CMD : GLOBALS.h , Globals.h , Global.h , dbh.cpp
  • CMD_ADD_OBJECT : nshsamp.h
  • CMD_ENUMERATOR : ATMEvent.h
  • CMD_EXEC_CANCELED : command.h
  • CMD_EXECUTING : command.h
  • CMD_INITIALIZED : command.h
  • CMD_LINE_ARGS : WSnmpUtil.h
  • CMD_OPTION_ADD : Qoslist.Cpp
  • CMD_OPTION_DEL : Qoslist.Cpp
  • CMD_OPTION_LIST : Qoslist.Cpp
  • CMD_RECEIVER : ATMEvent.h
  • CMD_RESET_OBJECT : nshsamp.h
  • CMD_RESET_OBJECT_ALL : nshsamp.h
  • CMD_RESET_OBJECT_SPROCKETS : nshsamp.h
  • CMD_RESET_OBJECT_WIDGETS : nshsamp.h
  • CMD_SENDER : ATMEvent.h
  • CMD_SET_GATEWAY : nshsamp.h
  • CMD_SET_INTERFACE : nshsamp.h
  • CMD_SET_OBJECT : nshsamp.h
  • CMD_SET_RANDOM_STUFF : nshsamp.h
  • CMD_SHOW_OBJECT : nshsamp.h
  • CMD_SHOW_RANDOM : nshsamp.h
  • CMD_SHOWERROR : nshsamp.h
  • CMD_STATUS_MASK : command.h
  • CMD_TEXT_SET : command.h
  • CMD_TYPE : ATMEvent.h
  • CmdAbout() : ABOUT.c , GLOBALS.h , About.c , Globals.h , Cmd.Cpp , ui.cpp , Cmd.Cpp
  • CmdAboutDone() : ABOUT.c , About.c
  • cmdAdd : dbh.cpp
  • cmdAddr : dbh.cpp
  • CmdAudio() : Cmd.Cpp
  • cmdBase : dbh.cpp
  • CmdCall() : Cmd.Cpp
  • CmdCallAccept() : Cmd.Cpp
  • CmdCallCancel() : Cmd.Cpp
  • CmdCallConf() : Cmd.Cpp
  • CmdCallReject() : Cmd.Cpp
  • CmdChannelData() : Cmd.Cpp
  • CmdChat() : Cmd.Cpp , Init.Cpp
  • CmdClear() : Cmd.Cpp
  • CmdClose() : Global.h , Msg.Cpp
  • CmdCollaborate() : Cmd.Cpp
  • CmdConfAppLeak() : Cmd.Cpp
  • CmdConfInfo() : Cmd.Cpp
  • CmdConfLeak() : Cmd.Cpp
  • CmdConfStart() : Cmd.Cpp
  • CmdConfStop() : Cmd.Cpp
  • CmdConnect() : Connect.c , Globals.h
  • CmdConnectDone() : Connect.c
  • CmdConnectNow() : Connect.c
  • CmdCreateFile1() : TapiComm.c
  • CmdCreateFile2() : TapiComm.c
  • CmdDataEnable() : Cmd.Cpp
  • CmdDebugService() : Service.C , Service.c
  • cmdDelete : dbh.cpp
  • CmdDisconnect() : IpxChat.c , Globals.h
  • CmdEject() : Cmd.Cpp
  • CmdEnableAppSharing() : Cmd.Cpp
  • cmdEnum : dbh.cpp
  • cmdEnumForAddr : dbh.cpp
  • CmdExec() : AppUtil.Cpp , AppUtil.h
  • CmdExit() : Cmd.Cpp , Msg.Cpp , GLOBALS.h , TapiComm.c , Globals.h , IpxChat.c , Msg.Cpp , ui.cpp , Cmd.Cpp , Msg.Cpp
  • cmdFindFile : dbh.cpp
  • CmdFont() : Cmd.Cpp
  • CmdFtCancel() : Cmd.Cpp
  • CmdHangupCall() : GLOBALS.h , TapiComm.c
  • CmdHelp() : Cmd.Cpp
  • cmdHelp : dbh.cpp
  • CMDI : GLOBALS.h , Globals.h
  • cmdiAbout : ABOUT.c , About.c
  • cmdiConnect : Connect.c
  • cmdiListen : Listen.c
  • cmdiMain : GLOBALS.h , TapiComm.c , Globals.h , IpxChat.c
  • CmdInControl() : Cmd.Cpp
  • cmdInfo : dbh.cpp
  • CmdInstallService() : Service.C , Service.c
  • CmdInvokeRemote() : ui.cpp
  • CmdIsSharingEnabled() : Cmd.Cpp
  • CmdLaunch() : Cmd.Cpp
  • cmdLine : dbh.cpp
  • cmdline() : dbh.cpp
  • cmdLineNext : dbh.cpp
  • cmdLinePrev : dbh.cpp
  • CmdListen() : Listen.c , Globals.h
  • CmdListenDone() : Listen.c
  • CmdListenNow() : Listen.c
  • CMDLN_STATE : cmsample.cpp
  • cmdLoad : dbh.cpp
  • cmdLocals : dbh.cpp
  • CmdMakeCall() : GLOBALS.h , TapiComm.c
  • cmdMax : dbh.cpp
  • CmdMonitor() : Cmd.Cpp
  • cmdName : dbh.cpp
  • cmdNext : dbh.cpp
  • CmdOptions() : Cmd.Cpp
  • CmdOutbox() : IpxChat.c , Globals.h
  • cmdPrev : dbh.cpp
  • CMDPROC : dbh.cpp
  • cmdQuit : dbh.cpp
  • CmdRefresh() : Cmd.Cpp
  • CmdRegisterLocal() : ui.cpp
  • CmdRemoveService() : Service.C , Service.c
  • CmdSendFile() : Cmd.Cpp
  • CmdShare() : Cmd.Cpp
  • CmdShowLocal() : Cmd.Cpp
  • CmdStub() : GLOBALS.h , Misc.c
  • CmdSysInfo() : Cmd.Cpp
  • CmdSysLogOnOff() : Cmd.Cpp
  • CmdToolbar() : sBar.Cpp
  • CmdTopMost() : Cmd.Cpp
  • cmdType : dbh.cpp
  • cmdUndec : dbh.cpp
  • cmdUnload : dbh.cpp
  • CmdUpdate() : Cmd.Cpp
  • cmdVerbose : dbh.cpp
  • CmdViewChat() : Cmd.Cpp
  • CmdViewMsg() : Cmd.Cpp
  • CmdViewSbar() : Cmd.Cpp
  • CmdViewTbar() : Cmd.Cpp
  • CmdViewUsers() : Cmd.Cpp
  • CmdWorkAlone() : Cmd.Cpp
  • CMENUS : Resource.h
  • cMinimumThreads : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • CmpODBCtoCHAR() : quiktest.h
  • CMSAMPLE_STARTING_BUF_SIZE : cmsample.cpp
  • CMTMLTFMT : MfEdit.h
  • cntStatusField : Status.c
  • cntToolCtrls : Tools.c
  • cNumResSetCols : quiktest.h
  • CoCreateInstanceEx() : cenum.cpp
  • CODECTYPE : InstCodc.Cpp
  • COINIT_APARTMENTTHREADED : OleApt.Cpp , OleImp.Cpp
  • CoInitMTA : bankdlg.h
  • CoInitRandom : bankdlg.h
  • CoInitSTA : bankdlg.h
  • COL : Main.Cpp , Global.h
  • COL_AUTOUPDATE : step2.cpp
  • COL_COLISFIXED : step1.cpp , step4.cpp
  • COL_COLISLONG : step1.cpp , step4.cpp
  • COL_COLISNULLABLE : step1.cpp , step4.cpp
  • COL_COLISROWID : step1.cpp , step4.cpp
  • COL_COLISROWVER : step1.cpp , step4.cpp
  • COL_COLLATION : step2.cpp
  • COL_COLNAME : step4.cpp , step1.cpp
  • COL_COLORDINAL : step1.cpp , step4.cpp
  • COL_COLPREC : step1.cpp , step4.cpp
  • COL_COLSCALE : step1.cpp , step4.cpp
  • COL_COLSIZE : step4.cpp , step1.cpp
  • COL_COLTYPE : step1.cpp , step4.cpp
  • COL_COLTYPENAME : step4.cpp
  • COL_COLWRITE : step1.cpp , step4.cpp
  • COL_HEADERS : step1.cpp , step4.cpp , step2.cpp
  • COL_INDEXCOLNAME : step2.cpp
  • COL_INDEXNAME : step2.cpp
  • COL_NULLS : step2.cpp
  • COL_PRIMARYKEY : step2.cpp
  • COL_UNIQUE : step2.cpp
  • COleClientSite() : iocs.h
  • colEditAdd : data.Idl
  • colEditDelete : data.Idl
  • colEditDeleted : data.Idl
  • colEditInProgress : data.Idl
  • ColEditModeEnum : data.Idl
  • colEditNone : data.Idl
  • COleInPlaceFrame() : ioipf.h
  • COleInPlaceSite() : ioips.h
  • COLINFO_SIZE : tablecopy.h
  • CollectAppMemPerformanceData : Perfmem.c
  • COLLECTION_VERSION : stdafx.h
  • CollectSigGenPerformanceData : Perfgen.c
  • COLNAME_START : quiktest.h
  • CoLoadLibraryA : ansiapi.h
  • COLOR_COL : people.Cpp
  • COLOR_SCALE_BLUE : AppUtil.h , GdiDemo.h
  • COLOR_SCALE_GRAY : AppUtil.h , GdiDemo.h
  • COLOR_SCALE_GREEN : AppUtil.h , GdiDemo.h , AppUtil.h
  • COLOR_SCALE_RED : AppUtil.h , GdiDemo.h
  • COLOR_USED : MfEdit.h
  • COLORA : cdialoglite.h
  • ColorHookProc() : DoServer.Cpp
  • ColorPick_ChangeSel() : fakemenu.c
  • ColorPick_ChooseLocation() : fakemenu.c
  • ColorPick_GetColorRect() : fakemenu.c
  • ColorPick_OnCreate() : fakemenu.c
  • ColorPick_OnKeyDown() : fakemenu.c
  • ColorPick_OnLButtonUp() : fakemenu.c
  • ColorPick_OnMouseMove() : fakemenu.c
  • ColorPick_OnPaint() : fakemenu.c
  • ColorPick_Popup() : fakemenu.c
  • ColorPick_WndProc() : fakemenu.c
  • COLORPICKSTATE : fakemenu.c
  • ColorsHookProc() : Colors.c
  • ColorsProc() : Colors.c , Colors.h
  • ColorThreadProc1() : Colors.c
  • ColorThreadProc2() : Colors.c
  • COLUMN_ACP : global.h
  • COLUMN_ALIGNVAL : sampclnt.h , sampprov.h
  • COLUMN_DATATYPE : cmainwindow.h
  • COLUMN_DBCID : cmainwindow.h
  • COLUMN_DESC : cmainwindow.h
  • COLUMN_ID : cmainwindow.h
  • COLUMN_ISCO : cmainwindow.h
  • COLUMN_ISCO_DESTURL : cmainwindow.h
  • COLUMN_ISCO_SRCURL : cmainwindow.h
  • COLUMN_LANGID : global.h
  • COLUMN_LANGUAGE : global.h
  • COLUMN_NATIVECOUNTRY : global.h
  • COLUMN_NATIVELANG : global.h
  • COLUMN_OEMCP : global.h
  • COLUMN_ORDER : cmainwindow.h
  • COLUMN_PREC : cmainwindow.h
  • COLUMN_SCALE : cmainwindow.h
  • COLUMN_SIZE : cmainwindow.h
  • COLUMN_TYPENAME : cmainwindow.h
  • COLUMNDATA : hashtbl.h
  • ColumnHeaders() : CrmMonComp.Idl
  • ColumnHeadingSize : quelist.h
  • ColWidth() : ComSpyCtl.Idl , MtsSpyCtl.Idl , ComSpyCtl.Idl
  • COM_RIGHTS_ACTIVATE_LOCAL : DComPerm.h
  • COM_RIGHTS_ACTIVATE_REMOTE : DComPerm.h
  • COM_RIGHTS_EXECUTE_LOCAL : DComPerm.h
  • COM_RIGHTS_EXECUTE_REMOTE : DComPerm.h
  • COMBINED_SIZE : quiktest.h
  • CombineProperties() : property.cpp , property.h
  • COMBO1 : resource.h
  • ComboDlgProc() : Property.c
  • COMCTL32 : setupui.cpp
  • ComDlg32DlgProc() : ComDlg32.h , ComDlg32.C
  • COMM_PORT_BAUD_RATE : nullmdm.h
  • COMM_PORT_DATA_BITS : nullmdm.h
  • COMM_PORT_STOP_BITS : nullmdm.h
  • COMM_PORT_TIMEOUT : nullmdm.h
  • Command : adoint.h , Settings.Cpp
  • COMMAND_OPTIONS : coptions.h
  • COMMAND_RELEASE_OPENOBJECTS : coptions.h
  • COMMAND_ROWSAFFECTED : coptions.h
  • COMMAND_STATUS_FLAG : command.h
  • COMMANDBUTTON_DISABLED : BttnCur.h
  • COMMANDBUTTON_MOUSEDOWN : BttnCur.h
  • COMMANDBUTTON_UP : BttnCur.h
  • COMMANDLINE : Server.c
  • CommandLineUsage() : enablerouter.c
  • CommandProc() : GdiDemo.c , GdiDemo.h
  • CommandTypeEnum : adoint.h
  • CommentToken : HtmlScan.Hxx
  • Commit() : CrmFilesTest.Idl
  • CommitFn() : nshsamp.cpp
  • CommitTransaction() : BYOTTransaction.Idl
  • CommitTx() : RmWorker.Idl
  • COMMON_PAGE_SIZE : PMMStrm.Hxx
  • CommonPageRound() : PMMStrm.Hxx
  • CommonPageTrunc() : PMMStrm.Hxx
  • CommThread() : Atsp.c
  • ComObjAboutBox() : ComObj.Cpp
  • ComObjInitMsgLog() : ComObj.Cpp
  • CompareAnsiToUnicode() : quiktest.c
  • CompareAnsiUnicodeResults() : quiktest.c
  • CompareDescField() : quiktest.c
  • CompareDescriptor() : quiktest.c
  • CompareDevModes() : SetDisp.c , SetDisp.h
  • CompareFileTime() : scandir.h
  • CompareFunc() : nlsapi.c
  • CompareItems() : Utility.Cpp , Utility.h
  • CompareVariant() : common.cpp , common.h
  • CompareWithExpected() : quiktest.c
  • CompForm : Main.C
  • COMPILE_MULTIMON_STUBS : fakemenu.c , tallmenu.c
  • COMPITEM : compitem.h , complist.h , view.h
  • compitem_delete() : compitem.cpp , compitem.h
  • compitem_discardsections() : compitem.cpp , compitem.h
  • compitem_freefilename() : compitem.h , compitem.cpp
  • compitem_getcomposite() : compitem.cpp , compitem.h
  • compitem_getfilename() : compitem.h , compitem.cpp
  • compitem_getleftfile() : compitem.cpp , compitem.h
  • compitem_getleftsections() : compitem.h , compitem.cpp
  • compitem_getmark() : compitem.cpp , compitem.h
  • compitem_getrightfile() : compitem.cpp , compitem.h
  • compitem_getrightsections() : compitem.cpp , compitem.h
  • compitem_getstate() : compitem.h , compitem.cpp
  • compitem_gettext_result() : compitem.cpp , compitem.h
  • compitem_gettext_tag() : compitem.h , compitem.cpp
  • compitem_new() : compitem.cpp , compitem.h
  • compitem_rescan() : compitem.h , compitem.cpp
  • compitem_savecomp() : compitem.cpp , compitem.h
  • compitem_SetCopyPaths() : compitem.cpp , compitem.h
  • compitem_setmark() : compitem.cpp , compitem.h
  • compitem_writefile() : compitem.h , compitem.cpp
  • CompleteAuthToken() : Stubs.c
  • CompletionPortThread() : MQPort.Cpp
  • ComplexDeviceCapsLine() : Getcaps.h , Getcaps.c
  • ComplexEnumPrintersLine() : Enumprt.c , Enumprt.h
  • COMPLIST : complist.h , view.h , compitem.h
  • complist_append() : complist.cpp , complist.h
  • complist_appendfinished() : complist.cpp , complist.h
  • complist_args() : complist.cpp , complist.h
  • complist_copyfiles() : complist.cpp , complist.h
  • complist_delete() : complist.cpp , complist.h
  • complist_dirdialog() : complist.cpp , complist.h
  • complist_dodlg_copyfiles() : complist.cpp
  • complist_dodlg_dir() : complist.cpp
  • complist_dodlg_savelist() : complist.cpp
  • complist_filedialog() : complist.cpp , complist.h
  • complist_freedescription() : complist.h , complist.cpp
  • complist_getdescription() : complist.cpp , complist.h
  • complist_getitems() : complist.cpp , complist.h
  • complist_itemcount() : complist.cpp , complist.h
  • complist_markpattern() : complist.h , complist.cpp
  • complist_match() : complist.cpp
  • complist_new() : complist.cpp
  • complist_querytime() : complist.h , complist.cpp
  • complist_savelist() : complist.h , complist.cpp
  • complist_setdialogdefault() : complist.cpp
  • complist_togglemark() : complist.h , complist.cpp
  • COMPONENT : Adminwrap.h
  • COMPORTNAMEMAXLENGTH : nullmdm.h
  • COMPREAD_X : IMEApps.h
  • COMPREAD_Y : IMEApps.h
  • COMPSTR_X : IMEApps.h
  • COMPSTR_Y : IMEApps.h
  • CompStrWndProc() : IMEApps.h , IMEApps.c
  • ComputeIcmp6PseudoHeaderChecksum() : Ping.cpp
  • ComputeIcmpChecksum() : Ping.cpp
  • Computer : resource.h
  • ComputeRotationTransformation() : Paint.h , Paint.c
  • ComputeUdpPseudoHeaderChecksumV4() : rawudp.c
  • ComputeUdpPseudoHeaderChecksumV6() : rawudp.c
  • CompWindowMode : Main.C
  • COMSYNC_OFFSET : Resource.h
  • ConcurList : quiktest.c
  • ConDisFile : AdminDll.c
  • ConferenceDlgProc() : Dlg.Cpp
  • ConfErrToSz() : Global.h
  • ConfigBLRPLATEDlg_DlgProc() : config.cpp
  • ConfigBLRPLATEDlg_Do() : config.cpp , blrplate.h
  • ConfigBLRPLATEDlg_OnCancelButton() : config.cpp
  • ConfigBLRPLATEDlg_OnCommand() : config.cpp
  • ConfigBLRPLATEDlg_OnHelpButton() : config.cpp
  • ConfigBLRPLATEDlg_OnInitDialog() : config.cpp
  • ConfigBLRPLATEDlg_OnOKButton() : config.cpp
  • ConfigConference() : RendSam.Cpp
  • ConfigDlgProc() : Atsp.h , Atsp.c
  • CONFIGITEMLISTVIEWLPARAM : Settings.h
  • ConfigServerSocket : rqsengine.h
  • CONFIGSETTINGSLPARAM : Settings.h
  • CONFIGURATION_ENTRY : configentry.h
  • Configure() : blrplate.cpp , blrplate.h
  • ConfigureDlgProc() : Settings.h , Settings.Cpp
  • ConfigUser() : RendSam.Cpp
  • Connect() : TxFileDisp.Idl , CopyFileRm.Idl , quiktest.c , rqsengine.h , Connect.c
  • connect_to_server() : GssClient.c
  • ConnectAuthSocket() : Client.cpp
  • ConnectDisconnectInValid : AdminDll.c
  • CONNECTEXARGS : provider.h
  • ConnectFn() : nshsamp.cpp
  • CONNECTION : Account.cpp
  • Connection : adoint.h
  • CONNECTION() : CreateTable.cpp
  • Connection_Handle : AdminDll.c
  • CONNECTION_TYPE_LOCAL : ConnectDlg.Cpp
  • CONNECTION_TYPE_REMOTE : ConnectDlg.Cpp
  • CONNECTION_TYPE_UNDEFINED : ConnectDlg.Cpp
  • ConnectModeEnum : adoint.h
  • ConnectPromptEnum : adoint.h
  • ConnectUsingProc() : Dialer.c
  • CONNIDMAXLENGTH : nmsession.h , plugxprt.h
  • CONSOLE_VERSION : globals.h
  • ConsoleCtrlHandler() : Sockdups.c , Sockdupc.c
  • CONSOLEDATA : SServer.Cpp
  • ConsoleEventHandler() : SimpleBrowser.cpp
  • CONST : scandir.h
  • CONST_VTABLE : Priv.h
  • CONSTANT : InOutp.c
  • CONSTANT_VALUE : GenCtrnm.h
  • CONSTANT_VALUE_VALUE : Perfgen.c
  • ConstructWellKnownSID() : UtilS.Cpp
  • CONTAINING_RECORD : defs.h
  • CONTENT_BUF_LENGTH : keys.cpp
  • CONTEXT_SAMPLE_ARRAY_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_BSTR_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_COMMAND_REQUEST_CONTEXT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_COMMAND_RESPONSE_CONTEXT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_CY_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_DATE_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_DECIMAL_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_DISPATCH_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_I4_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_NEW_EVENT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_PRESENTATION_CONTEXT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_UI8_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_UNKNOWN_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_USER_CONTEXT_HEADER : ContextPlugin.cpp
  • ContextList : Stubs.c
  • ContextMenuExtension : extend.h
  • ContextNameHint : ContextPlugin.h
  • ContextSensitiveHelp() : ioipo.h , ioipf.h , ioipao.h , ioips.h
  • CONTRACT_FILE : cdbfile.h
  • CONTROL : cfactory.h
  • control_C_handler() : BPSamp.h , Main.c
  • ControlCallback() : TraceDp.c
  • ControlGuid : TraceDp.c
  • ControlHandler() : Service.c , Service.C
  • CONV_ALPHABOOL : common.h
  • CONV_BINARY : common.h
  • CONV_DECIMAL : common.h
  • CONV_FLAGS : common.h
  • CONV_HEX : common.h
  • CONV_MSDADC_ONLY : common.h
  • CONV_NONE : common.h
  • CONV_OCTAL : common.h
  • CONV_TYPENAME : common.h
  • CONV_VARBOOL : common.h
  • CONVERT_WCHAR : ssl.c
  • ConvertBinarySidToName() : MyToken.cpp
  • ConvertDIBFormat() : Dib.c , Dib.h
  • ConvertGuidToString() : util.h , util.cpp
  • ConvertHexToDec() : adoisapi.cpp
  • ConvertLUIDToName() : MyToken.cpp
  • ConvertSid() : Helper.c , Check_SD.h
  • ConvertStringToSmiValue() : WSnmpUtil.h , Helper.Cpp
  • ConvertTexttoIp() : WSnmpUtil.h , Helper.Cpp
  • ConvertToLONG() : common.h , common.cpp
  • ConvertToMBCS() : common.h , asserts.h , common.h , common.cpp , asserts.cpp , common.cpp , common.h , common.cpp
  • ConvertToSystemTime() : sa.Cpp
  • ConvertToWCHAR() : common.cpp , asserts.cpp , common.cpp , common.h , common.cpp , common.h , asserts.h , common.h
  • ConvertUTCFromStringToUTCTime() : main.cpp
  • ConvertValueToString() : propdump.cpp
  • ConvertVarTypeToString() : propdump.cpp
  • COORD : APP.h
  • copy : Is2Foot.Inc
  • COPY_CHUNK : UnBufCp2.c , UnBufCp1.c
  • COPY_FROMLEFT : complist.h
  • COPY_FROMRIGHT : complist.h
  • COPY_HITREADONLY : complist.h
  • CopyACL() : AclMgmt.Cpp , DComPerm.h
  • CopyBinding() : common.cpp , common.h
  • CopyBuffer() : provider.h , globals.cpp , spi.cpp , globals.h
  • CopyChunk : UnBufCp1.c , UnBufCp2.c
  • CopyColorTable() : Dib.c
  • CopyDirTx() : TxFileDisp.Idl
  • CopyFilesInCopyList() : TxFileDisp.Idl
  • CopyFileTx() : TxFileDisp.Idl
  • CopyListBoxToClipboard() : DebMisc.c , DebMisc.h
  • CopyListTx() : RmWorker.Idl
  • CopyLoop() : UnBufCp1.c
  • CopyOffset() : provider.h , spi.cpp
  • CopyPalette() : MfEdit.c , MfEdit.h
  • CopyScreenToBitmap() : Copy.c , Dibapi.h
  • CopyScreenToDIB() : Copy.c , Dibapi.h
  • CopyStringAndTerminate() : Extension.cpp
  • CopySzFilePsffs : wn_dos.h
  • CopyT2W() : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp
  • CopyUnicodeString() : SubAuth.c
  • CopyWindowToBitmap() : Copy.c , Dibapi.h
  • CopyWindowToDIB() : Dibapi.h , Copy.c
  • CORP_HIGH_ASSUR_OID_W : isapiCertPolicy.cpp
  • COSTLY_STRING : PerfUtil.h , PerfUtil.c , PerfUtil.h , PerfUtil.c
  • Count() : data.Idl , enablerouter.c
  • COUNT_OF_HTML_ELEMENTS : Bag.Hxx
  • CountBits() : DIBSectn.c
  • COUNTER_STRING_SIZE : MainWnd.h
  • CounterCreate() : Resources.cpp , resources.cpp , resources.h , Resources.h
  • CounterDecrement() : resources.cpp , resources.h , Resources.h , Resources.cpp
  • CounterDelete() : resources.h , Resources.cpp , resources.cpp , Resources.h
  • CounterHandles : BasicHiPerf.h
  • CounterIncrement() : Resources.h , resources.h , Resources.cpp , resources.cpp
  • CountersCheckForNonzero() : Resources.h , resources.cpp , resources.h , Resources.cpp
  • CountersCreate() : Resources.h , resources.cpp , resources.h , Resources.cpp
  • CountersDelete() : Resources.h , resources.h , resources.cpp , Resources.cpp
  • countof : AdvReco.cpp , TPCInfo.cpp
  • COUNTOF : StdAfx.h
  • countof : MultiReco.cpp
  • CountPoints() : Fx.c
  • Country : resource.h
  • CP_LENGTH : tablecopy.h
  • CP_MAXLENGTH : tablecopy.h
  • CP_PRECISION : tablecopy.h
  • CP_SCALE : tablecopy.h
  • CPageList : ExtObj.h , BasePage.h , ExtObj.h , BasePage.h
  • cpeAppPal : stdpal.c , app.Cpp
  • cPIDSI_STANDARD : suminfo.h
  • CPP_CLASS_NAME : Server.Cpp
  • cpp_quote() : myProp.Idl , IMSConf2.Idl , ComSpyCtl.Idl , MtsSpyCtl.Idl , myProp.Idl , IMSConf2.Idl
  • CQBITS : autotest.h
  • CrackADError() : CreateUserHelpers.h , ADSIhelpers.h , main.cpp , CreateUserHelpers.cpp , ADSIhelpers.cpp
  • CrackArgs() : SidClean.c
  • CrackUserAndDomain() : HttpAuth.c
  • Create1() : DynDlg.c
  • Create2() : DynDlg.c
  • CREATE_CURSORENGINE : coptions.h
  • CREATE_DETERMINE_TYPE : coptions.h
  • CREATE_FINDWINDOW : coptions.h
  • CREATE_INITIALIZE : coptions.h
  • CREATE_NEWWINDOW : coptions.h
  • CREATE_NEWWINDOW_IFEXISTS : coptions.h
  • CREATE_NO_AUTOSAVE : coptions.h
  • CREATE_NODISPLAY : coptions.h
  • CREATE_OPTIONS : coptions.h
  • CREATE_QI_MANDATORY : coptions.h
  • CREATE_QI_OPTIONAL : coptions.h
  • CREATE_READ_WRITE_LOCK : sync.h
  • CREATE_RESTARTPOSITION : coptions.h
  • CREATE_SETPROPERTIES : coptions.h
  • create_socket() : GssServer.c
  • CREATE_TIMER : defs.h
  • CREATE_USESERVICECOMP : coptions.h
  • CreateAcceptSocket() : IocpServer.h , IocpServerex.Cpp
  • CreateAcceptWindow() : ASAccept.cpp
  • CreateAccessor() : sampclnt.h , sampclnt.cpp
  • CreateAndConnectCall() : tapisend.cpp
  • CreateAndSelectFileRecordTerminal() : CallNot.cpp , CallNot.h
  • CreateAndSelectMST() : Processing.cpp
  • CreateAndSelectTerminal() : tapisend.cpp
  • CreateAppSecurityDescriptor() : Util.Cpp , Util.h
  • CreateAppWindow() : Init.c , GdiDemo.h
  • CreateBlankNewFormatIcon() : Icons.C , Icons.h
  • CreateBounceWindow() : Bounce.h , Bounce.c
  • CreateBSTRfromString() : tapisend.cpp
  • CreateCall() : helpdll.Cpp
  • CreateCallParams() : TapiCode.c
  • CreateCaptureMediaStreamingTerminal() : tapisend.cpp
  • CreateCar() : ComObj.h , ComObj.Cpp
  • CreateCertificate() : CreateCert.c , CreateCert.h
  • CreateChildListBox() : MDIChild.C
  • CreateChildren() : MDIChild.C
  • CreateClass() : Sample.h , Utils.Cpp
  • CreateClientSocket() : TestAccept.cpp
  • CreateColorScalePalette() : AppUtil.h , AppUtil.Cpp , GdiDemo.h , Dialog.c
  • CreateContext() : RecoDll.cpp
  • CreateCruiseCar() : ComObj.Cpp , ComObj.h
  • CreateDacl() : RegisterServer.Cpp
  • CreateDefFileName() : common.cpp , common.h
  • CreateDescRecord() : quiktest.c
  • CreateDialogTemplate() : OpenDIB.c
  • CreateDIB() : Dibutil.c , Dibapi.h
  • CreateDIBPalette() : Dibutil.c , Dibapi.h
  • CreateDlgProc() : FontView.c , Dialogs.c
  • CreateDllList() : DebDebug.c
  • CreateDrawWindow() : Draw.h , Draw.c
  • CreateDummyEntry() : instlsp.cpp
  • CreateEditWindow() : ui.cpp
  • CreateEntry() : customentry.c
  • CreateFile() : CrmFilesTest.Idl
  • CreateFileContents() : Render.Cpp , Render.h
  • CreateFileGroupDescriptor() : Render.h , Render.Cpp
  • CreateFileMonikerA : ansiapi.h
  • CREATEGIZMO : GizmoBar.h
  • CreateGroup() : main.cpp
  • CreateHandlerItemPrefKey() : Reg.Cpp
  • CreateHandlerPrefKey() : Reg.h , Reg.Cpp
  • CreateICommand() : AdvQuery.Cxx
  • CreateIconWindow() : DebMisc.c , DebMisc.h
  • CreateImageLists() : Utility.h , Utility.Cpp
  • CreateImeMenu() : IMEApps.h , ImeMenu.c
  • CreateInst() : Sample.h , Utils.Cpp , Sample.h , Utils.Cpp
  • CreateInstance() : TxEnlister.Idl , icf.h , client.cxx
  • CreateItemList() : Enum.h , Enum.Cpp
  • CreateJob() : bits_ie.cpp
  • CreateLayeredEntries() : instlsp.cpp
  • CreateList() : LinkList.h , LinkList.c
  • CreateListeningSockets() : common.h , common.cpp
  • CreateListenSocket() : IocpServerex.Cpp , IocpServer.h , IocpServer.Cpp
  • CreateListView() : DragImg.Cpp , VListVw.c , VListVw.h
  • CreateMazeWindow() : Maze.c , Maze.h
  • CreateMDIClientWindow() : GdiDemo.h , Init.c
  • CreateMsgWindow() : ui.cpp
  • CreateMyDACL() : Simple.c , Server32.c , NmPipe.c
  • CreateNewListItem() : Enum.Cpp , Enum.h
  • CreateNewMDIChildWindow() : IconPRO.C
  • CreateNewSD() : DComPerm.h , SDMgmt.Cpp
  • CreateNode() : LinkList.h , LinkList.c
  • CreateNotificationWindow() : WSnmpUtil.Cpp , WSnmpUtil.h
  • CreateNullDacl() : RegisterServer.Cpp
  • CreateObject() : bankthrds.Cpp
  • CreateObjSecurityInfo() : Main.h , Privobji.Cpp
  • CreateOrder() : Driver.Cpp
  • CreateParamQuery() : quiktest.c
  • CreatePduSendRequest() : WSnmpUtil.h , WSnmpUtil.Cpp
  • CreatePolyWindow() : Poly.h , Poly.c
  • CreatePrivateClipboardData() : Utility.h , Utility.Cpp
  • CreateProc() : GdiDemo.h , GdiDemo.c
  • CreateProcessList() : DebDebug.c
  • CreatePropertySetInStorage() : stgcreatepropsetstg.cpp
  • CreatePropSheet() : global.c
  • CreateQueList() : quelist.c , quelist.h
  • CreateQueryTree() : AdvQuery.Cxx
  • CreateQueue() : MqTrans.Cpp
  • CreateReadWriteLock() : sync.h , sync.c
  • CreateRecognizer() : RecoDll.cpp
  • CreateRegistryKey() : customentry.c
  • CreateRegKey() : common.h , common.cpp
  • CreateRemote() : RemClien.Cpp
  • CreateRenderMediaStreamingTerminal() : Processing.cpp
  • CreateResourcePath() : globals.h , people.Cpp
  • CreateRows() : bankdlg.Cpp , bankthrds.Cpp
  • CREATEROWS : resource.h
  • CreateRowsThread() : bankthrds.Cpp , bankdlg.Cpp
  • CreateSBar() : STATBAR.h , STATBAR.c
  • CreateScaledFont() : MidiPlyr.h , UIUTILS.c
  • CreateSchema() : bankthrds.Cpp , bankdlg.Cpp
  • CreateSchemaThread() : bankthrds.Cpp , bankdlg.Cpp
  • CreateShellIDList() : Utility.h , Utility.Cpp
  • CreateSocket() : IocpServerex.Cpp
  • CreateSockInfo() : provider.h , sockinfo.cpp
  • CreateStandardPalette() : app.Cpp
  • CreateStartupLink() : bits_ie.cpp
  • CreateStatus() : Status.c , IMEApps.h
  • CreateStatusBar() : FontView.c , Status.c
  • CreateStreams() : ips.h
  • CreateTBar() : ToolBar.h , ToolBar.c , IMEApps.h , ToolBar.c
  • CreateTestEntry() : customdialreg.cpp
  • CreateTextButtonBar() : DebMisc.c , DebMisc.h
  • CreateTextWindow() : TextWnd.Cpp , Global.h
  • CreateThreadList() : DebDebug.c
  • CreateThreadSyncResources() : threads.c , threads.h
  • CreateToolBar() : FontView.c , Tools.c
  • CreateTools() : sdkdiff.cpp
  • CreateUI() : bits_ie.cpp
  • CreateUser() : main.cpp , RendSam.Cpp
  • CreateUserAccount() : Create.Cpp
  • CreateUserFromFile() : main.cpp
  • CreateUserIADsContainer() : Create.cpp
  • CreateUserIDirectoryObject() : Create.cpp
  • CreateUserList() : ui.cpp
  • CreateUtilityCar() : ComObj.Cpp , ComObj.h
  • CreateUtilityCruiseCar() : UTCRUCAR.Cpp
  • CreateVbl() : WSnmpUtil.h , WSnmpUtil.Cpp
  • CreateVirtualBuffer() : AsyncIO.c , AsyncIO.h
  • CreateWellKnownSids() : Service.h , Service.cpp , service.h , service.cpp
  • CreateWiaDevice() : wiassamp.cpp
  • CreateWiaDeviceAndDoSomeStuff() : wiassamp.cpp
  • CreateWiaDeviceManager() : wiassamp.cpp
  • CreateWorkingThreads() : MQPort.Cpp
  • CreateWorkQueue() : AsyncIO.h , AsyncIO.c
  • CreateWorldSid() : SecFile.c
  • CreateXFormWindow() : XForm.h , XForm.c
  • CREDENTIAL : SampSSP.H
  • CredentialList : Stubs.c
  • CREDIT : resource.h
  • CriticalSectionOwned : common.h
  • CritSec : list.cpp
  • CRL_PUBLISH_RETRY_DEFAULT : Exit.h
  • CRM : comspyctl.idl
  • CrmFilesCommandType : CrmFilesWorker.h
  • CrmFilesCreateFileLogRecord : CrmFilesWorker.h
  • CrmFilesDeleteFileLogRecord : CrmFilesWorker.h
  • CRYPT32_DLL : vertrust.cpp
  • CRYPTOAPI_CertCompareCertificate : vertrust.cpp
  • CRYPTOAPI_CertDuplicateCertificateContext : vertrust.cpp
  • CRYPTOAPI_CertFreeCertificateContext : vertrust.cpp
  • CryptPropCert() : PropCert.Cpp
  • CS_BEGIN_QUOTE : cmsample.cpp
  • CS_CHAR : cmsample.cpp
  • CS_DONE : cmsample.cpp
  • CS_END_QUOTE : cmsample.cpp
  • CS_END_SPACE : cmsample.cpp
  • CSampleDropExt : DropExt.C
  • csCacheLock : cache.c
  • CSCONST : stdpal.h
  • cServerEntries : secClnt.Cpp
  • cServerThreads : ComPerf.Cpp , OleApt.Cpp , OleImp.Cpp
  • cSize : OleStd.h
  • csQueueLock : ThreadPool.h
  • csRoute : FaxSiren.Cpp
  • CSSdkdiff : sdkdiff.cpp
  • cStandardProperties : msistuff.cpp
  • cStemForms : lrsample.CXX
  • CSZ : StdAfx.h
  • CT_ANK : utils.cpp
  • CT_CONNECT : people.h
  • ct_CreateFile : CrmFilesWorker.h
  • ct_DeleteFile : CrmFilesWorker.h
  • CT_EXIT : people.h
  • CT_GET_PTR : people.h
  • CT_INVALID : utils.cpp
  • CT_LEAD : utils.cpp
  • CT_TRAIL : utils.cpp
  • CTBBITMAPS : Resource.h
  • CTBBUTTONS : Resource.h
  • CTE_ENCODER : cte_enc.c
  • CTE_ENCODER_SIZE : cte_enc.c
  • CTE_MAX_CHUNK_HEADER_SIZE : cte_enc.c
  • CTE_MAX_ENCODING_OVERHEAD : cte_enc.c
  • CteBeginWrite() : ctetest.h , cte_enc.c
  • CteEndWrite() : cte_enc.c , ctetest.h
  • CteWrite() : cte_enc.c , ctetest.h
  • ctr1 : BasicHiPerf.h
  • Ctr1 : RefClint.Cpp
  • Ctr2 : RefClint.Cpp
  • ctr2 : BasicHiPerf.h
  • Ctr3 : RefClint.Cpp
  • ctr3 : BasicHiPerf.h
  • ctr4 : BasicHiPerf.h
  • Ctr4 : RefClint.Cpp
  • ctr5 : BasicHiPerf.h
  • Ctr5 : RefClint.Cpp
  • ctree_create() : tree.cpp , tree.h
  • ctree_delete() : tree.h , tree.cpp
  • ctree_find() : tree.h , tree.cpp
  • ctree_getcount() : tree.h , tree.cpp
  • ctree_update() : tree.h , tree.cpp
  • CtrlCHandler() : Bcast.c
  • CtrlHandler() : tapisend.cpp , rnrcs.cpp , IocpServer.h , tapirecv.cpp , dhcpnotify.cpp , IocpServerex.Cpp , IocpServer.Cpp
  • CtrlPanelDlgProc() : MfEdit.h , MfEdit.c
  • CtxtAllocate() : IocpServer.Cpp , IocpServerex.Cpp , IocpServer.h
  • CtxtListAddTo() : IocpServerex.Cpp , IocpServer.Cpp , IocpServer.h
  • CtxtListDeleteFrom() : IocpServer.h , IocpServerex.Cpp , IocpServer.Cpp
  • CtxtListFree() : IocpServer.Cpp , IocpServer.h , IocpServerex.Cpp
  • cTypeEntries : HtmlProp.Cxx
  • CUNITSTABLEMAX : CeLib.Cpp , celib.cpp , CeLib.Cpp
  • curr_size : Overlap.c
  • current_view : sdkdiff.cpp , findgoto.cpp
  • CursorLocationEnum : adoint.h
  • CursorOptionEnum : adoint.h
  • CursorTypeEnum : adoint.h
  • CustomControlInfo() : SpinCube.c
  • CustomDialDlgProc() : customdial.cpp
  • CustomEntryDlgProc() : customdial.cpp
  • CustomerId() : QCShip.Idl , QCOrder.Idl , QCShip2.Idl , QCNotify.Idl , QCOrder.Idl
  • CUtilString_padsize : util.h
  • cvt() : Utils.Cpp , UtilLib.h
  • CVT_BASE : CeLibW2k.h
  • CVT_DAYS : CeLibW2k.h
  • CVT_HOURS : CeLibW2k.h
  • CVT_MINUTES : CeLibW2k.h
  • CVT_SECONDS : CeLibW2k.h
  • CVT_WEEKS : CeLibW2k.h
  • CVTBUFSIZE : Consumer.Cpp , AdvClientdlg.cpp , UtilLib.h
  • CvtCHARtoODBC() : quiktest.h
  • CVTFAILED : UtilLib.h
  • cwcCHOPBASE : ceformat.cpp , CeFormat.Cpp
  • cwcCHOPHASHMAX : ceformat.cpp , CeFormat.Cpp
  • cwcCNMAX : CeFormat.Cpp , ceformat.cpp
  • cwCenter() : WinCap.h
  • cwcFILENAMESUFFIXMAX : CeLibW2k.h
  • cwcHRESULTSTRING : CeLibW2k.h
  • cwcMaxName : HtmlProp.Hxx
  • cwcsObjectPath : RefClint.h
  • cwcSUFFIXMAX : CeLibW2k.h
  • cWidth : OleStd.h
  • CX_DEFWIDTH : AppBar.h
  • CXFAKEMENU : fakemenu.c
  • cxFrame : Status.c
  • cxMetrics : FullIME.h , Main.C , Global.C
  • CXN_BDADDR_STR_LEN : bthcxn.cpp
  • CXN_DELAY_NEXT_INQUIRY : bthcxn.cpp
  • CXN_MAX_INQUIRY_RETRY : bthcxn.cpp
  • CXN_TRANSFER_DATA_LENGTH : bthcxn.cpp
  • cxOverTypeCaret : Global.C , Main.C , FullIME.h
  • cxStatusBorder : Status.c
  • cxToolBorder : Tools.c
  • CY_DEFHEIGHT : AppBar.h
  • CYBUTTONBAR120 : BttnCur.h
  • CYBUTTONBAR72 : BttnCur.h
  • CYBUTTONBAR96 : BttnCur.h
  • CYCOLOR : fakemenu.c
  • cyFrame : Status.c
  • cyMetrics : FullIME.h , Main.C , Global.C
  • cyStatusBorder : Status.c
  • cyToolBorder : Tools.c
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- d -

  • D : debug.h , DbgOut.h
  • D1 : Debug.h
  • D2 : Debug.h
  • D3 : Debug.h
  • D4 : Debug.h
  • DA_ARCHIVE : wn_dos.h
  • DA_HIDDEN : wn_dos.h
  • DA_NIL : wn_dos.h
  • DA_NORMAL : wn_dos.h
  • DA_READONLY : wn_dos.h
  • DA_SUBDIR : wn_dos.h
  • DA_SYSTEM : wn_dos.h
  • DA_VOLUME : wn_dos.h
  • DAdvise() : ido.h
  • DARKGRAY : MfEdit.h
  • DAT : wn_dos.h
  • DATA_BUFFER : common.h
  • DATA_BUFSIZE : deviceprop.cpp , genericucpdlg.h
  • DATA_HANDLE_TYPE_bind() : Usrdefc.c
  • DATA_HANDLE_TYPE_unbind() : Usrdefc.c
  • DataConvert() : common.cpp , common.h
  • DataString : PrPerf.c
  • DATASUFFIX : FindStream.c
  • DataToHex() : Global.h , Util.Cpp
  • DataTypeEnum : adoint.h
  • DateStamp() : wn_dos.h
  • DB_CLASS_NAME : DeskBand.h
  • DB_MIN_SIZE_X : DeskBand.h
  • DB_MIN_SIZE_Y : DeskBand.h
  • DBCONN : MqTrans.Cpp
  • DBCScharType() : utils.cpp
  • DBCSFillChar : FullIME.h , Global.C , Main.C
  • DBCSTYPE : utils.cpp
  • DBFILE_FLUSH_ERROR : cdbfile.h
  • DBG_PRINT : ClRes.h
  • DBGCMD_BREAKPOINT : DbgCmd.c
  • DBGCMD_CLEARBP : DbgCmd.c
  • DBGCMD_GO : DbgCmd.c
  • DBGCMD_QUIT : DbgCmd.c
  • DBGCMD_SHOWHELP : DbgCmd.c
  • DBGCMD_UNKNOWN : DbgCmd.c
  • DBGCMD_WATCHPOINT : DbgCmd.c
  • DbgEnable : Debug.h
  • DbgInitialize : Debug.h
  • DbgMsgCloseLog() : DbgMsg.cpp , DbgMsg.h , dbgmsg.cpp , dbgmsg.h
  • DbgMsgCriticalSection : DbgMsg.cpp , DbgMsg.h , dbgmsg.cpp , dbgmsg.h
  • DbgMsgOpenLog() : dbgmsg.h , DbgMsg.cpp , DbgMsg.h , dbgmsg.cpp
  • DbgMsgRecord() : DbgMsg.cpp , DbgMsg.h , dbgmsg.cpp , dbgmsg.h
  • DBGOUT : Atsp.h
  • DbgPrint() : Admapit.c , AdminDll.c
  • dbgprint() : provider.h , spi.cpp
  • DBGPRINT : CeLibW2k.h
  • DbgSetLevel : Debug.h
  • DBGUID_MSSQLXML : error.cpp
  • DBGUID_XPATH : error.cpp
  • DbgWrite : AuthFilt.h
  • DBIDCopy() : common.cpp , common.h
  • DBIDEqual() : common.cpp , common.h
  • DBIDFree() : common.cpp , common.h
  • DBIDToString() : common.cpp , common.h
  • DBINITCONSTANTS : oledbcomponent.h , Guids.Cpp , main.cpp , common.cpp , sampclnt.cpp , globals.cpp , tablecopy.cpp , common.cpp , AdvQuery.Cxx , QSample.Cxx
  • DBLOGGER() : Utils.cpp , Utils.h , Utils.cpp , Utils.h
  • DBNTWIN32 : bankdlg.Cpp , MqTrans.Cpp
  • DBTYPE_SRC_DST : common.h
  • DC_DATA : ShlFldr.Cpp
  • DC_NAME : ShlFldr.Cpp
  • DComOk() : AppUtil.Cpp , AppUtil.h
  • DD_DEFDRAGDELAY : OleStd.h
  • DD_DEFDRAGMINDIST : OleStd.h
  • DD_DEFSCROLLINTERVAL : OleStd.h
  • DDBChangeColor() : bitmaps.Cxx , bitmaps.h
  • DDV_RequiredText() : DDxDDv.cpp , DDxDDv.h , DDxDDv.cpp , DDxDDv.h
  • DDX_Number() : DDxDDv.cpp , DDxDDv.h , DDxDDv.cpp , DDxDDv.h
  • DeactivateAndUndo() : ioips.h
  • DeAlloc() : Disp1.Idl
  • DEB_DLL_LIST_INFO : DebDebug.h
  • DEB_DLL_NODE_INFO : DebDebug.h
  • DEB_PROCESS_LIST_INFO : DebDebug.h
  • DEB_PROCESS_NODE_INFO : DebDebug.h
  • DEB_STARTUP_INFO : DebDebug.h
  • DEB_THREAD_LIST_INFO : DebDebug.h
  • DEB_THREAD_NODE_INFO : DebDebug.h
  • DEBIT : resource.h
  • DEBUG : Comp.c , Paint.c
  • DEBUG_FMT_CHARS : AppUtil.h
  • DEBUG_LOG_MAX_SIZE : DbgMsg.h , dbgmsg.h
  • DEBUG_MAX_LINE_LEN : Debug.h
  • DEBUG_MODULE_NAME : Debug.h
  • DEBUG_PRINT : FCopy.Cpp , Mount.Cpp
  • Debug_Print_Connection0() : Admapit.c
  • Debug_Print_Connection1() : Admapit.c
  • Debug_Print_RAS_PORT0() : Admapit.c
  • Debug_Print_RAS_PORT1() : Admapit.c
  • Debug_Print_RasConnection() : AdminDll.c
  • Debug_Print_RasPort() : AdminDll.c
  • DEBUG_SECTION : Debug.h
  • DEBUG_SIMPLE : Simple.c
  • DEBUGCODE : asserts.h
  • DebugEventThread() : DebDebug.c , DebDebug.h
  • DEBUGGER : Dt.h
  • DebugHr() : Debug.Cpp , Global.h
  • DebugLog() : adoisapi.cpp
  • DebugMsg() : setup.h , utils.cpp , Debug.Cpp , Global.h , Globals.h , Main.c
  • DebugNewProcess() : DebDebug.c
  • DEBUGOUT : GdiDemo.h
  • DebugPrint() : FaxSiren.Cpp , Mount.Cpp
  • DebugTextOut() : InstCodc.Cpp
  • DEBUGTRACE : debug.h
  • DebugTrace() : debug.h
  • DECIMAL : Grid.Hxx
  • DECLARE_DEBUG : Debug.Hxx , Global.Hxx
  • DECLARE_FIXED_ALLOC : heap.h
  • DECLARE_HANDLE() : SMF.h
  • DECLARE_INFOLEVEL : Debug.Hxx
  • DECLARE_INTERFACE_() : IBALL.h , ICARS.h , IPageS.h , IPAPER.h , mmcsample.h
  • DECLARE_IUNKNOWN : cunknown.h
  • DECLARE_REGISTRY_CLSID : StdAfx.h , stdafx.h
  • DECLARE_UNKNOWN : UNK.H
  • DECLAREADSPROC : StdAfx.h
  • DECLSPEC_UUID : adoint.h
  • DecodeAndDecryptCredentials() : CustomAuth.cpp
  • DecodeIGMPHeader() : parser.h
  • DecodeIPHeader() : parser.c , parser.h
  • DecodeTCPHeader() : parser.h
  • DecodeUDPHeader() : parser.h
  • DecoupleSlot() : hashtbl.cpp , hashtbl.h
  • DecrementLockCount() : cHello.Cxx , Server.Cxx
  • DecrementRefCount() : Server.Cxx
  • DecryptThis() : Security.cpp , Security.h
  • DEF_PTSIZE : status.cpp
  • DEF_QUEUE_LEN : PrPerf.c
  • DEF_SERVER_NAME : PrPerf.c
  • DEF_SERVER_TYPE : PrPerf.c
  • DEF_SERVER_ZONE : PrPerf.c
  • DEFAULT_ADDRESS_FAMILY : common.h , TestAccept.cpp
  • DEFAULT_ADDRESS_IP : WSnmpUtil.h
  • DEFAULT_ALLOW_UNMAPPED : ReMapUrl.cpp
  • DEFAULT_ASYNC_DELAY : AsyncRPC.Idl
  • DEFAULT_BACKLOG : Overlap.c
  • DEFAULT_BUFFER_LEN : Ioctl.c , Simplec.c , Simples.c
  • DEFAULT_CACHE_SECONDS : CacheIsapi.cpp
  • DEFAULT_CAND_NUM_PER_PAGE : FullIME.h
  • DEFAULT_CBMAXLENGTH : sampclnt.h
  • DEFAULT_CHUNK_SIZE : ctetest.c
  • DEFAULT_COLOR : DoServer.h
  • DEFAULT_COUNT : rawudp.c , Mcastws1.c , Mcastws2.c
  • DEFAULT_DATA : ShlFldr.Cpp
  • DEFAULT_DATA_SIZE : Ping.cpp
  • DEFAULT_DELAY : TestAccept.cpp
  • DEFAULT_DEVICE_LIFETIME : RegDevice.cpp
  • DEFAULT_ENDPOINT : AsyncRPC.Idl
  • DEFAULT_EVENTS : TraceDp.c
  • DEFAULT_FONT : global.h
  • default_g711 : QosEvent.Cpp , QosEvent.h
  • DEFAULT_HATCHBORDER_WIDTH : OleStd.h
  • DEFAULT_HEADERS : IsapiRequest.h
  • DEFAULT_INTERFACE : common.h
  • DEFAULT_ITERATIONS : Sockdupc.c
  • DEFAULT_LOGFILE_NAME : TraceLog.c
  • DEFAULT_LOGOFF_URL : CustomAuth.h
  • DEFAULT_LOGON_SUCCESS_URL : CustomAuth.h
  • DEFAULT_LOGON_TIMEOUT : CustomAuth.h
  • DEFAULT_LOGON_TYPE : CustomAuth.h
  • DEFAULT_LOGON_URL : CustomAuth.h
  • DEFAULT_LOOP_COUNT : TestAccept.cpp
  • DEFAULT_LSP_NAME : instlsp.cpp
  • DEFAULT_M_TIMETOBERECEIVED : MqApiTst.h
  • DEFAULT_M_TIMETOREACHQUEUE : MqApiTst.h
  • DEFAULT_MAX_ALLOC_SIZE : IsapiBuffer.h
  • DEFAULT_MAX_CALLS : AsyncRPCs.c
  • DEFAULT_MESSAGE : AsyncRPCc.c , rawudp.c
  • DEFAULT_MIN_CALLS : AsyncRPCs.c
  • DEFAULT_MTU : rawudp.c
  • DEFAULT_MULTICASTGROUP : QosEvent.h
  • DEFAULT_NAMESPACE : tracedmp.h
  • DEFAULT_NONASYNC_DELAY : AsyncRPCp.c
  • DEFAULT_NOTIFICATION : AsyncRPCc.c
  • default_notraffic : QosEvent.Cpp , QosEvent.h
  • default_options : QosEvent.Cpp
  • DEFAULT_PATH_LEN : instlsp.cpp
  • DEFAULT_POOL_COUNT : overlap.cpp
  • DEFAULT_PORT : common.h , TestAccept.cpp , IocpServer.h , rawudp.c , Overlap.c , Ioctl.c , Simplec.c , Simples.c , Sockdupc.c , Sockdups.c
  • DEFAULT_PROMPT : DoServer.h
  • DEFAULT_PROTO : Simplec.c , Simples.c
  • DEFAULT_PROTOCOL_SEQUENCE : AsyncRPC.Idl
  • default_qostest : Qoslist.Cpp
  • DEFAULT_QUEUE : PoolWrap.cpp
  • DEFAULT_RDI_MASK : basenode.h
  • DEFAULT_RECV_BUFFER_SIZE : TestAccept.cpp
  • DEFAULT_RECV_TIMEOUT : Ping.cpp
  • DEFAULT_RESPONSE_BUFFER_SIZE : IsapiRequest.h
  • DEFAULT_SCENARIO : TestAccept.cpp
  • DEFAULT_SDI_MASK : basenode.h
  • DEFAULT_SEND_BUFFER_SIZE : TestAccept.cpp
  • DEFAULT_SEND_COUNT : rawudp.c , Ping.cpp
  • DEFAULT_SERVER : TestAccept.cpp
  • DEFAULT_STATUS : IsapiRequest.h
  • DEFAULT_STREAM : row.h
  • DEFAULT_STREAM_ORDINAL : row.h
  • DEFAULT_STRING_LEN : rnrcs.cpp
  • DEFAULT_STRING_SIZE : StdAfx.h
  • DEFAULT_THREADS : PoolWrap.cpp
  • DEFAULT_TTL : rawudp.c , Mcastws1.c , Mcastws2.c , Ping.cpp
  • DEFAULT_TYPE_OF_ACCEPT : common.h
  • DEFAULT_USE_BUILTIN_LOGOFF : CustomAuth.h
  • DEFAULT_USE_BUILTIN_LOGON : CustomAuth.h
  • DEFAULT_USE_CLIENT_IP : CustomAuth.h
  • DEFAULT_USE_SSL : CustomAuth.h
  • DEFAULT_WAIT_FLAG : AsyncRPCs.c
  • DEFAULT_X : DoServer.h
  • DEFAULT_Y : DoServer.h
  • DEFAULTCOMPORT : ui.cpp
  • DefaultUser() : Main.h , Security.Cpp
  • DEFBKGDCOLOR : Main.c
  • DEFEXTSIZE : Open.h
  • DEFIMC1 : MultiUI.h
  • DEFIMC2 : MultiUI.h
  • DEFINE_ADDREF_RELEASE : sampprov.h
  • DEFINE_DAOGUID : adoid.h
  • DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE : sampprov.h
  • DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR : sampprov.h
  • DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA : sampprov.h
  • DEFINE_DLLREGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_DLLREGISTERFILTER2 : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_GUID() : guids.h , MainDll.Cpp , EvProv.h , Server.Cpp , MainDll.Cpp , Guids.h , MyCapabilities.h , MyEvictListener.h , MyMemberSetChangeListener.h , MyStartupListener.h , guids.h , Guid.h , DropExt.h , FVText.h , Guid.h , ShellExt.h , IcnOvrly.h , DoServer.Cpp , DoServer.h , Cancel.Cpp , SServer.Cpp , ComPerf.Cpp , Client.Cpp , OleImp.Cpp , sclient.cpp , sserver.cpp , OleApt.Cpp , app.Cpp , ips.Cpp , BALLGUID.h , CARGUIDS.h , PageGUID.h , PAPGUIDS.h , sampclnt.h , guids.h , ADEvent.cpp , bthcxn.cpp , Guid.h , Atsp.h , guids.h , plgtermpriv.h , guids.h , mmcsample.h , guids.h , Guids.h , guids.h
  • DEFINE_REGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_REGISTERFILTER2 : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_REGISTERFILTERBASE : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_SOFT_DLLREGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_SOFT_REGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFNAME : NmPipe.c
  • DeinitAppInstance() : InstCodc.Cpp
  • DeInitializeDynamicLocksStore() : sync.c , sync.h
  • DeinstallProvider() : instlsp.cpp
  • DelayBox() : AppUtil.Cpp
  • DELAYBOX_DURATION : AppUtil.h
  • DELAYLOAD_FROM_WIN32 : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • DELETE_ACE : app.cpp
  • DELETE_COOKIE : CustomAuth.h
  • DELETE_LOCKED_LIST : sync.h
  • DELETE_LOCKED_QUEUE : sync.h
  • DELETE_POINTER : AppUtil.h
  • DELETE_READ_WRITE_LOCK : sync.h
  • DELETE_RESULTITEM : globals.h
  • DELETE_SCOPEITEM : globals.h
  • DELETE_TIMER : defs.h
  • DeleteACEsAsAppropriate() : SidClean.c
  • DeleteCommand() : data.Idl
  • DeleteConference() : RendSam.Cpp
  • DeleteContext() : Stubs.c
  • DeleteCredential() : Stubs.c
  • DeleteCurrentDllNode() : DebDebug.c
  • DeleteCurrentNode() : LinkList.c , LinkList.h
  • DeleteCurrentProcessNode() : DebDebug.c
  • DeleteCurrentThreadNode() : DebDebug.c
  • DeleteDirectory() : Utility.Cpp , Utility.h
  • DeleteDllNode() : DebDebug.c
  • DeleteEntireKey() : ADEvent.cpp , SampView.Cpp , IcnOvrly.Cpp , IcnOvrly.h
  • DeleteEntry() : Collect.cpp , Collect.h
  • DeleteFile() : CrmFilesTest.Idl , icrmFiles.Idl
  • DeleteFile_AW : ansiapi.h
  • DeleteFileTx() : TxFileDisp.Idl
  • DeleteFontObject : global.h
  • DeleteInterface() : rmapi.c
  • DeleteInterfaceImp : Framer.h
  • DeleteItemFromList() : Enum.Cpp , Enum.h
  • DeleteJob() : sa.Cpp
  • DELETELOGERRORMSG : Handler.h
  • DeleteProcessNode() : DebDebug.c
  • DeleteReadWriteLock() : sync.c , sync.h
  • DELETEROWS_ABOUTTODO : myospobject.h
  • DELETEROWS_DIDEVENT : myospobject.h
  • DeleteSecurityContext() : Stubs.c
  • DeleteSockInfoFromList() : common.h , SockInfo.cpp
  • DeleteStartupLink() : bits_ie.cpp
  • DeleteStoredProcedure() : data.Idl
  • DeleteThreadNode() : DebDebug.c
  • DeleteTools() : sdkdiff.cpp
  • DeleteUser() : RendSam.Cpp , Commands.Cpp , Commands.h
  • DeleteWellKnownSids() : Service.cpp , Service.h , service.cpp , service.h
  • DELIMITER : PerfUtil.c
  • Delphi : bankdlg.h
  • DelRegEntry() : common.cpp , common.h , common.cpp , common.h
  • DemoInit() : Demo.c , Demo.h
  • DemoWndProc() : Demo.c , Demo.h
  • DEPENDENCIES : Service.h , service.h
  • Dequeue : list.h
  • DequeueEvent() : configentry.c , configentry.h
  • DequeueOverlappedOperation() : overlap.cpp
  • DESC_AD : quiktest.h
  • DESC_ALL : quiktest.h
  • DESC_APD : quiktest.h
  • DESC_ARD : quiktest.h
  • DESC_ID : quiktest.h
  • DESC_IPD : quiktest.h
  • DESC_IRD : quiktest.h
  • DESC_MOST : quiktest.h
  • DESC_NONE : quiktest.h
  • DESC_PD : quiktest.h
  • DESC_RD : quiktest.h
  • DESC_UPDATE_MODE_READ : quiktest.h
  • DESC_UPDATE_MODE_WRITE : quiktest.h
  • DescBindCol() : quiktest.c
  • DescBindParameter() : quiktest.c
  • DescBuf : quiktest.c
  • DESCRIPTION : InOutc.c
  • Description() : CrmMonComp.Idl
  • DescriptionDocToBSTR() : RegDevice.cpp
  • DescTypes : quiktest.c
  • DestFile : UnBufCp1.c , UnBufCp2.c
  • DestroyAlternate() : RecoDll.cpp
  • DestroyContext() : RecoDll.cpp
  • DestroyDIB() : Dibapi.h , File.c
  • DestroyDllList() : DebDebug.c
  • DestroyDllNode() : DebDebug.c
  • DestroyImageLists() : Utility.Cpp , Utility.h
  • DestroyKeyValues() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DestroyList() : LinkList.c , LinkList.h
  • DestroyListeningSockets() : common.cpp , common.h
  • DestroyNode() : LinkList.c , LinkList.h
  • DestroyNotificationWindow() : WSnmpUtil.Cpp , WSnmpUtil.h
  • DestroyProc() : GdiDemo.c , GdiDemo.h
  • DestroyProcessList() : DebDebug.c
  • DestroyProcessNode() : DebDebug.c
  • DestroyRecognizer() : RecoDll.cpp
  • DestroyStatusBar() : Status.c
  • DestroyStringBuffer() : MultiWnd.C
  • DestroyThreadList() : DebDebug.c
  • DestroyThreadNode() : DebDebug.c
  • DestroyThreadSyncResources() : threads.c , threads.h
  • DestroyToolBar() : Tools.c
  • DestroyWorkQueue() : AsyncIO.c , AsyncIO.h
  • DetectDsConnection() : MQPort.Cpp , MqTestOA.Cpp , MSMQTest.c
  • DetermineAdapter() : dhcpnotify.cpp , dhcppersist.cpp , dhcprequest.cpp
  • DetermineObjectType() : cbase.cpp , cbase.h
  • DetermineVersion() : Main.c
  • DevCapsXDlgProc() : Common.h
  • DEVICE_ABORTING : NewFsp.h
  • DEVICE_IDLE : NewFsp.h
  • DEVICE_INFO : NewFsp.h
  • DEVICE_RECEIVE : NewFsp.h
  • DEVICE_SEND : NewFsp.h
  • DEVICE_START : NewFsp.h
  • DeviceReceiveThread() : NewFsp.c
  • DevmodeProc() : Print.c , Print.h
  • DevnamesProc() : Print.c , Print.h
  • DHCP_PERSISTENT_APP_STRING : dhcppersist.cpp
  • DIAGRETCHECK : quiktest.h
  • DialCall() : TapiCode.c , TapiCode.h
  • DialCallInParts() : TapiCode.c
  • DialDialogProc() : TapiCode.c
  • DialerAlloc() : Dialer.c
  • DialerCleanup() : Dialer.c
  • DialerFree() : Dialer.c
  • DialerLineClose() : Dialer.c
  • DialingProc() : Dialer.c
  • dialog_autocopy : complist.cpp
  • dialog_fastscan : complist.cpp
  • dialog_leftname : complist.cpp
  • dialog_recursive : complist.cpp
  • dialog_rightname : complist.cpp
  • dialog_servername : complist.cpp
  • DIALOGHEIGHT : PlgBlt.h
  • DialogProc() : AppUtil.Cpp , AppUtil.h , cDialog.Cxx , cDialog.h , bits_ie.cpp , compart.cpp
  • DIB_HEADER_MARKER : File.c
  • DIBColorTableSize() : DIBSectn.c
  • DIBDATA : MfEdit.h
  • DIBError() : Dibapi.h , Errors.c
  • DIBHeight() : Dibapi.h , Dibutil.c
  • DIBNumColors() : DIBSectn.c , Dibapi.h , Dibutil.c , Dib.c , Dib.h
  • DIBToBitmap() : Dibapi.h , Dibutil.c
  • DIBToIconImage() : Icons.C
  • DIBWidth() : Dibapi.h , Dibutil.c
  • DID_BEZIER : MfEdit.h
  • DID_BMPOBJ : MfEdit.h
  • DID_CANCEL : Resource.h
  • DID_CLEAR : MfEdit.h
  • DID_COUNTER : MfEdit.h
  • DID_CTRLPANEL : MfEdit.h
  • DID_DRAW : PlgBlt.h
  • DID_EDITTEXT : Resource.h
  • DID_EIGHT : MfEdit.h
  • DID_ELLIPSE : MfEdit.h
  • DID_ERASE : SpinCube.h
  • DID_FF : MfEdit.h
  • DID_FILLELLIPSE : MfEdit.h
  • DID_FILLRECT : MfEdit.h
  • DID_FIVE : MfEdit.h
  • DID_FOUR : MfEdit.h
  • DID_HEIGHT : PlgBlt.h
  • DID_INMOTION : SpinCube.h
  • DID_LINE : MfEdit.h
  • DID_LISTBOX : Resource.h
  • DID_METAF : MfEdit.h
  • DID_NEWMASK : PlgBlt.h
  • DID_NEWSRC : PlgBlt.h
  • DID_NINE : MfEdit.h
  • DID_OK : Resource.h , SpinCube.h
  • DID_ONE : MfEdit.h
  • DID_OPEN : MfEdit.h
  • DID_P1X : PlgBlt.h
  • DID_P1Y : PlgBlt.h
  • DID_P2X : PlgBlt.h
  • DID_P2Y : PlgBlt.h
  • DID_P3X : PlgBlt.h
  • DID_P3Y : PlgBlt.h
  • DID_PEN : MfEdit.h
  • DID_PLAY : MfEdit.h
  • DID_RECORD : MfEdit.h
  • DID_RECT : MfEdit.h
  • DID_SEVEN : MfEdit.h
  • DID_SIX : MfEdit.h
  • DID_STOP : MfEdit.h
  • DID_TEN_PLUS : MfEdit.h
  • DID_TEXT : MfEdit.h
  • DID_THREE : MfEdit.h
  • DID_TMP : MfEdit.h
  • DID_TWO : MfEdit.h
  • DID_WIDTH : PlgBlt.h
  • DID_XMASK : PlgBlt.h
  • DID_XSRC : PlgBlt.h
  • DID_YMASK : PlgBlt.h
  • DID_YSRC : PlgBlt.h
  • DID_ZERO : MfEdit.h
  • DiffFileTimeInMilliseconds() : IsapiTime.h , IsapiTime.cpp
  • DiffFileTimeInSeconds() : IsapiTime.h , IsapiTime.cpp
  • difftime() : UtilLib.h , Utils.Cpp
  • DIGIT : PerfUtil.c
  • DIM : dballoc.Cpp
  • DIMA : dbh.cpp
  • DIMAT : dbh.cpp
  • DimensionOf : gutils.h
  • Dimmer : MyDevice.h
  • DIMMINGSERVICE_SCPD_DISPIDS : DimmingService_SCPD.idl , MyDevice.h , DimmingService_SCPD.idl , MyDevice.h
  • DINV : WinCap.c
  • dir_adddirect() : scandir.cpp
  • dir_addfile() : scandir.cpp
  • dir_appendlist() : scandir.cpp , scandir.h
  • dir_buildlist() : scandir.cpp , scandir.h
  • dir_cleardirect() : scandir.cpp
  • dir_closefile() : scandir.cpp , scandir.h
  • dir_compsequencenumber() : scandir.cpp , scandir.h
  • dir_compwildcard() : scandir.cpp , scandir.h
  • dir_copy() : scandir.cpp , scandir.h
  • dir_delete() : scandir.cpp , scandir.h
  • dir_dirinit() : scandir.cpp
  • dir_endcopy() : scandir.cpp , scandir.h
  • dir_extractwildportions() : scandir.cpp
  • dir_fileerror() : scandir.cpp , scandir.h
  • dir_fileinit() : scandir.cpp
  • dir_finalelem() : scandir.cpp
  • dir_findnextfile() : scandir.cpp
  • dir_firstitem() : scandir.cpp , scandir.h
  • dir_freeopenname() : scandir.cpp , scandir.h
  • dir_freerelname() : scandir.cpp , scandir.h
  • dir_freerootdescription() : scandir.cpp , scandir.h
  • dir_freerootpath() : scandir.cpp , scandir.h
  • dir_getattr() : scandir.cpp , scandir.h
  • dir_getchecksum() : scandir.cpp , scandir.h
  • dir_getfilesize() : scandir.cpp , scandir.h
  • dir_GetFileTime() : scandir.cpp , scandir.h
  • dir_getlist() : scandir.cpp , scandir.h
  • dir_getopenname() : scandir.cpp , scandir.h
  • dir_getpathsizeetc() : scandir.cpp
  • dir_getrelname() : scandir.cpp , scandir.h
  • dir_getrootdescription() : scandir.cpp , scandir.h
  • dir_getrootpath() : scandir.cpp , scandir.h
  • dir_isfile() : scandir.cpp , scandir.h
  • dir_isvaliddir() : scandir.cpp , scandir.h
  • dir_isvalidfile() : scandir.cpp
  • dir_iswildcard() : scandir.cpp , scandir.h
  • dir_MakeValidPath() : scandir.cpp , scandir.h
  • DIR_MASK : sdksamplestoragesystem.h
  • DIR_MASK_LENGTH : sdksamplestoragesystem.h
  • dir_nextitem() : scandir.cpp , scandir.h
  • dir_openfile() : scandir.cpp , scandir.h
  • dir_rescanfile() : scandir.cpp , scandir.h
  • dir_scan() : scandir.cpp
  • dir_setdescription() : scandir.cpp , scandir.h
  • dir_setotherdirlist() : scandir.cpp , scandir.h
  • dir_startcopy() : scandir.cpp , scandir.h
  • dir_validchecksum() : scandir.cpp , scandir.h
  • DIRECT : MSMQTest.c , scandir.cpp
  • DirectoryPath : AsyncIO.h
  • DirectSender() : MqTestOA.Cpp , MSMQTest.c
  • DIRITEM : scandir.h
  • DIRLIST : scandir.h
  • DisableButton() : Callnot.Cpp , Incoming.Cpp , Outgoing.Cpp
  • DISABLED : nshsamp.h
  • DisableDialButtons() : Dialer.c
  • DiscardUndoState() : ioips.h
  • Disconnect() : TxFileDisp.Idl , CopyFileRm.Idl
  • DisconnectAndReleaseCall() : tapirecv.cpp
  • DISCONNECTEXARGS : provider.h
  • DisconnectTheCall() : FileTerm.cpp , FileTerm.h , Incoming.Cpp , Outgoing.Cpp
  • DiskPerfDetails() : DpDetail.Cpp , WMIDiskPerf.Cpp
  • DismountVolume() : Mfmt.c
  • DISP_FILE_LINE : common.h
  • dispaddr : dbh.cpp
  • DispatchChild() : Sockdups.c
  • DispatchDebugEventThread() : DebugHandler.Cpp
  • DispCommand() : DISPATCH.c , GLOBALS.h , Dispatch.c , Globals.h
  • DispDefault() : DISPATCH.c , Dispatch.c
  • DISPID_CEGesture : EventSinks.h
  • DISPID_CEStroke : EventSinks.h
  • DISPID_DIMLEVEL : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_GETCONFIGDETAILS : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_GETDIMLEVEL : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_GETHWND : EdCommands.idl , EdGlyphs.idl , EdHost.idl
  • DISPID_GETPOWERVALUE : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_POWER : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_POWEROFF : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_POWERON : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_RERecognition : EventSinks.h
  • DISPID_RERecognitionWithAlternates : EventSinks.h
  • DISPID_SETDIMLEVEL : DimmingService_SCPD.idl , MyDevice.h
  • dispidICOMPerformance_Test1 : ComPerf.Cpp
  • dispidICOMPerformance_Test23 : ComPerf.Cpp
  • display_ctx_flags() : GssMisc.c
  • display_file : Gss-Misc.h , GssMisc.c
  • display_help() : BPSamp.h , DbgCmd.c
  • DISPLAY_INSTRUCTIONS : prsample.h
  • DISPLAY_METHODCALLS : prsample.h
  • DISPLAY_SETTINGS_COUNT : Utility.Cpp
  • display_status() : GssMisc.c
  • display_status_1() : GssMisc.c
  • display_thread_registers() : BPSamp.h , Utils.c
  • DisplayAccess() : ListAcl.Cpp
  • DisplayAccessorErrors() : error.cpp , error.h
  • DisplayAllErrors() : quiktest.c , error.cpp , error.h , error.cpp , error.h
  • DisplayAPIError() : common.c , common.h
  • DisplayAudit() : Audit.c
  • DisplayAuditEventOption() : Audit.c
  • DisplayBindingErrors() : error.cpp , error.h
  • DisplayBitmapInWindow() : OpenDIB.c
  • DisplayCallerAccessTokenInformation() : MyToken.cpp
  • DisplayCandStrings() : CANDUI.C , FullIME.h
  • DisplayChatMsg() : cData.Cpp , cData.h
  • DisplayColAccessErrors() : error.cpp , error.h
  • DisplayColumnErrors() : error.cpp , error.h
  • DisplayCommandTree() : AdvQuery.Cxx , DispTree.Cxx , QSample.Cxx
  • DisplayCompString() : FullIME.h , ImeUI.C
  • DisplayContextMenu() : cdialoglite.cpp , cdialoglite.h
  • DisplayDeviceCapsInfo() : Getcaps.c , Getcaps.h
  • DisplayDialog() : cdialoglite.cpp , cdialoglite.h
  • DisplayDialogBox() : Dialog.c , GdiDemo.h
  • DisplayDlg() : Global.h
  • DisplayDollars() : MqTrans.Cpp
  • DisplayEnumPrintersInfo() : Enumprt.c , Enumprt.h
  • DisplayError() : Check_SD.h , Helper.c , MachAcct.c , QSample.Cxx , SysInf_C.c , SysInfo.h , SysInf_S.c
  • DISPLAYERROR : quiktest.h
  • DisplayErrorInfo() : error.cpp , error.h
  • DisplayErrorMessage() : util.cpp , util.h
  • DisplayErrorRecords() : error.cpp , error.h
  • DisplayErrorText() : ChngPass.c
  • DisplayFileToDialog() : OpenDIB.c
  • DisplayGroupsInfo() : MyToken.cpp
  • DisplayHelp() : SidClean.c , msistuff.cpp , sa.Cpp , FTPJr.cpp
  • DisplayHRESULT() : error.cpp , error.h
  • DisplayIndexInterfaceEntry : networkentry.c
  • DisplayInstallResource() : msistuff.cpp
  • DisplayInterfaceEntry : networkentry.c
  • DisplayKeyData() : Monkey.c , Monkey.h
  • DisplayLastError() : AclApi.c , Server.c
  • DisplayMessage() : cData.Cpp , Global.h
  • DisplayMode : sdkdiff.cpp
  • DisplayMsg() : cData.Cpp , Global.h , Util.Cpp
  • DisplayNtStatus() : Audit.c , LsaPrivs.c
  • DisplayOptions() : security.cpp
  • DisplayOwnerInfo() : MyToken.cpp
  • DisplayPhoneNumber() : TapiCode.c
  • DisplayPrimaryGroupInfo() : MyToken.cpp
  • DisplayPrinterDriverInfo() : Getpdriv.c , Getpdriv.h
  • DisplayPrinterDriversInfo() : Enumprt.c , Enumprt.h
  • DisplayPrivileges() : MyToken.cpp
  • DisplayPropErrors() : error.cpp , error.h
  • DisplayProperty() : propdump.cpp
  • DisplayPropertySet() : propdump.cpp
  • DisplayPropertySetsInStorage() : propdump.cpp
  • DisplayRefCountErrors() : error.cpp , error.h
  • DisplayResources() : msistuff.cpp
  • DisplayResults() : odbcsql.c
  • DisplayResultString() : FullIME.h , ImeUI.C
  • DisplayRowErrors() : error.cpp , error.h
  • DisplayRowsetStatus() : QSample.Cxx
  • DisplayRtmDestInfo : rtmapi.c
  • DisplaySource() : MyToken.cpp
  • DisplayStat() : QSample.Cxx
  • DisplayStatistics() : MyToken.cpp
  • DisplayStatus() : Global.h , QSample.Cxx
  • DisplayStorageTree() : propdump.cpp
  • DisplaySysMsg() : cData.Cpp , Global.h
  • DisplayTestName() : quiktest.c
  • DisplayTitles() : odbcsql.c
  • DisplayTokenInformation() : MyToken.cpp
  • DisplayUnionValue() : DUnionc.c
  • DisplayUpToDate() : QSample.Cxx
  • DisplayUsage() : Check_SD.c , setup.h , utils.cpp
  • DisplayUserInfo() : MyToken.cpp
  • DisplayValue() : QSample.Cxx
  • DisplayVariant() : DispTree.Cxx
  • DisplayWin32Error() : QSample.Cxx
  • DisplayWinError() : error.cpp , error.h , Audit.c , Client.c , TextSid.c , LsaPrivs.c
  • DispMessage() : DISPATCH.c , GLOBALS.h , Dispatch.c , Globals.h
  • dispsymtag() : dbh.cpp
  • DIVIDER : MDIChild.C
  • DIVISIONPOINTS : strmvwr.Cxx
  • DKGRAY_PEN : ToolBar.c
  • DL_DIRS : scandir.cpp
  • DL_FILES : scandir.cpp
  • DLG_ABOUT : VCExploreDlg.Cpp
  • DLG_APP_EXPORT : VCExploreDlg.Cpp
  • DLG_APP_INSTALL : VCExploreDlg.Cpp
  • DLG_APP_UTIL_START : VCExploreDlg.Cpp
  • DLG_APP_UTIL_STOP : VCExploreDlg.Cpp
  • dlg_caption : utils.cpp
  • DLG_COMPONENT_IMPORT : VCExploreDlg.Cpp
  • DLG_COMPONENT_INSTALL : VCExploreDlg.Cpp
  • DLG_CONNECT : VCExploreDlg.Cpp
  • dlg_default : utils.cpp
  • dlg_differ : complist.cpp
  • dlg_file : complist.cpp
  • DLG_FONT : resource.h , res.h
  • DLG_GENERAL : resource.h , res.h
  • dlg_identical : complist.cpp
  • dlg_IgnoreAttributes : complist.cpp
  • dlg_IgnoreMarks : complist.cpp
  • DLG_LCID : resource.h , res.h
  • dlg_left : complist.cpp
  • DLG_MIRRORING : resource.h , res.h
  • DLG_MUI : resource.h , res.h
  • DLG_NLS : resource.h , res.h
  • dlg_options : complist.cpp
  • Dlg_Proc1() : PhoneEntry.c
  • Dlg_Proc2() : PhoneEntry.c
  • dlg_prompt : utils.cpp
  • dlg_result : utils.cpp
  • dlg_right : complist.cpp
  • dlg_root : complist.cpp
  • dlg_size : utils.cpp
  • dlg_sums : complist.cpp
  • DLG_TEXT : resource.h , res.h
  • DLG_USP : resource.h , res.h
  • DLG_UTILITIES : VCExploreDlg.Cpp
  • DLG_VERFIRST : Generic.H , Resource.h , resource.h , StatList.h , LeakyBin.h
  • DLG_VERLAST : Generic.H , Resource.h , StatList.h , LeakyBin.h
  • DlgAudio() : Dlg.Cpp , Global.h
  • DlgCallConf() : Dlg.Cpp , Global.h
  • DlgDisplayInstalledCodecs() : InstCodc.Cpp
  • DlgEject() : Dlg.Cpp , Global.h
  • DlgEnumFontNames() : Dialogs.c
  • DlgEnumFontSizes() : Dialogs.c
  • DlgExit() : Global.h
  • DlgLaunch() : Dlg.Cpp , Global.h
  • DlgLogOnOff() : Dlg.Cpp , Global.h
  • DlgNewCall() : Dlg.Cpp , Global.h
  • DlgNewConference() : Dlg.Cpp , Global.h
  • DLGOPEN_BIG : Dialogs.h
  • DLGOPEN_DIR_LISTBOX : Dialogs.h
  • DLGOPEN_EDIT : Dialogs.h
  • DLGOPEN_FILE_LISTBOX : Dialogs.h
  • DLGOPEN_FOLDOUT : Dialogs.h
  • DLGOPEN_PATH : Dialogs.h
  • DLGOPEN_SMALL : Dialogs.h
  • DLGOPEN_TEXT : Dialogs.h
  • DlgOptions() : Dlg.Cpp , Global.h
  • dlgproc() : childview.cpp
  • DlgProc() : PlgBlt.c , PlgBlt.h , Main.Cpp , Main.h , TPCInfo.cpp , About.Cpp , SpinTest.c , SpinTest.h , CustomDrawButtonDlg.cpp
  • DlgProcIADsOpenDSObject() : ADQIDlg.h , ADsOpenDSObject.cpp
  • DlgSendFile() : Dlg.Cpp , Global.h
  • DlgShare() : Dlg.Cpp , Global.h
  • DlgShowLocal() : Dlg.Cpp , Global.h
  • DLGTITLESIZE : Open.h
  • DLL_NAME : WebClient.c , WebServer.c
  • DLL_TUTFILE_STR : ComUser.h , DllUser.h
  • DllAddRef() : globals.h , server.cpp , globals.h , server.cpp
  • DllCanUnloadNow() : ComSpyAudit.Cpp , ComSpyCtl.Cpp , Dog.Cpp , SServer.Cpp , PingResp.Cpp , ConServe.Cpp , DllServe.Cpp , FreServe.Cpp , LicServe.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , StoServe.Cpp , BYOTTransaction.Cpp , TxEnlister.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , STAObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , cascadeec.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , Account.Cpp , LogWriter.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip2.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , ADOKB.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , theprovider.cpp , classfac.cpp , myclassfactory.cpp , msdfmap.cpp , Authenticate.cpp , dbauth.cpp , proxyplugin.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , SCPCMenu.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , ADsError.cpp , GraphObj.Cpp , Exports.Cpp , DllMain.Cpp , DllMain.h , SampMsp.Cpp , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , certpsam.cpp , CertPSam.Cpp , basesnap.Cpp , basesnap.h , atlcontrol.Cpp , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , BaseSnap.Cpp , BaseSnap.h , basesnap.Cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , MainDll.Cpp , OleSrvr.Cpp , MainDll.Cpp , Server.Cpp , MainDll.Cpp , BrochureMachine.cpp , EDAnnotator.cpp , Render.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , ClRes.cpp , ClipBook ServerEx.cpp , File Share SampleEx.cpp , Dll.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , HtmlProp.Cxx , HtmlProp.Hxx , HtmlIFlt.Cxx , HtmlIFlt.Hxx , lrsample.CXX , lrsample.HXX , SmpFilt.Cxx , BandObjs.Cpp , ShortName.Cpp , Cleanup.Cpp , DropExt.C , FileView.Cpp , FileView.h , SampView.Cpp , ShellExt.Cpp , IcnOvrly.Cpp , server.cpp
  • DllCritSect : Init.c , SampSSP.H
  • DllEntry() : FaxSiren.Cpp
  • DLLENTRY : ComObj.h , ConServe.h , DllServe.h , DllSkel.h , FreServe.h , LicServe.h , PerDraw.h , PerServe.h , PerText.h , StoServe.h
  • DllEntryPoint() : NewFsp.c
  • DllGetClassObject() : ComSpyAudit.Cpp , ComSpyCtl.Cpp , Dog.Cpp , SServer.Cpp , PingResp.Cpp , ConServe.Cpp , DllServe.Cpp , FreServe.Cpp , LicServe.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , StoServe.Cpp , BYOTTransaction.Cpp , TxEnlister.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , STAObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , cascadeec.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , Account.Cpp , LogWriter.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip2.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , ADOKB.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , theprovider.cpp , classfac.cpp , myclassfactory.cpp , msdfmap.cpp , Authenticate.cpp , dbauth.cpp , proxyplugin.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , SCPCMenu.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , ADsError.cpp , GraphObj.Cpp , Exports.Cpp , DllMain.Cpp , DllMain.h , SampMsp.Cpp , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , certpsam.cpp , CertPSam.Cpp , basesnap.Cpp , basesnap.h , atlcontrol.Cpp , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , BaseSnap.Cpp , BaseSnap.h , basesnap.Cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , MainDll.Cpp , OleSrvr.Cpp , MainDll.Cpp , Server.Cpp , MainDll.Cpp , BrochureMachine.cpp , EDAnnotator.cpp , Render.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , ClRes.cpp , ClipBook ServerEx.cpp , File Share SampleEx.cpp , Dll.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , HtmlProp.Cxx , HtmlProp.Hxx , HtmlIFlt.Cxx , HtmlIFlt.Hxx , lrsample.CXX , lrsample.HXX , SmpFilt.Cxx , BandObjs.Cpp , ShortName.Cpp , Cleanup.Cpp , DropExt.C , FileView.Cpp , FileView.h , SampView.Cpp , ShellExt.Cpp , IcnOvrly.Cpp , server.cpp
  • DllInit() : Init.c
  • DllMain() : FreServe.Cpp , gres409.c , dllmain.cpp , FileView.Cpp , AuthFilt.c , ToolBar.c , dll.cpp , helpdll.Cpp , Server.Cpp , ctetest.c , Render.cpp , basesnap.cpp , basesnap.Cpp , atlcontrol.Cpp , basesnap.Cpp , SampMsp.Cpp , spi.cpp , MyDevice.cpp , customdial.cpp , blrplate.cpp , OLEDBKB.Cpp , Dllinit.c , theprovider.cpp , cascadeec.Cpp , QCShip.Cpp , Account.Cpp , PerServe.Cpp , TxEnlister.Cpp
  • DLLMAIN() : rqsmsg.cpp
  • DllMain() : Select.c , ComSpyAudit.Cpp , ComSpyCtl.Cpp , Dog.Cpp , SServer.Cpp , PingResp.Cpp , ComObj.Cpp , ConServe.Cpp , DllServe.Cpp , DllSkel.Cpp , LicServe.Cpp , Marshal2.Cpp , PerDraw.Cpp , PerText.Cpp , StoServe.Cpp , BYOTTransaction.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , STAObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , LogWriter.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip2.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , ADOKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , classfac.cpp , myclassfactory.cpp , msdfmap.cpp , Authenticate.cpp , dbauth.cpp , proxyplugin.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , ADsError.cpp , dllmain.c , GraphObj.Cpp , blrplate.h , blrplate.c , cmsample.cpp , RasHost.Cpp , AdminDll.c , Exports.Cpp , ipsample.c , TestDll.C , DllMain.Cpp , Atsp.c , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , Dt_Dll.Cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , certpsam.cpp , CertPSam.Cpp , LogonNP.c , basesnap.Cpp , BaseSnap.Cpp , basesnap.cpp , basesnap.Cpp , OleSrvr.Cpp , MainDll.Cpp , RecoDll.cpp , BrochureMachine.cpp , EDAnnotator.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , InvokObjThreads.cpp , areadcli.c , ftrans.c , fwasync.c , fwrite.c , KeepAliveP.c , Simple.cpp , ClRes.cpp , Dll.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , Main.Cxx , lrsample.CXX , SmpFilt.Cxx , dllmain.cpp , DllInit.c , SysInf_C.c , SpinCube.c , BandObjs.Cpp , ShortName.Cpp , Cleanup.Cpp , SampView.Cpp , ShellExt.Cpp , IcnOvrly.Cpp , dllmain.cpp
  • DllOrderFunction() : DebDebug.c
  • DllRegisterCluAdminExtension() : ClipBook ServerEx.cpp , File Share SampleEx.cpp
  • DllRegisterServer() : Dll.cpp , MyStorageResource.cpp , lrsample.CXX , BandObjs.Cpp , RegisterServer.Cpp , SampView.Cpp , IcnOvrly.Cpp , server.cpp , Catlpwr.Cpp , dll.cpp , ClipBook ServerEx.cpp , basesnap.Cpp , Server.Cpp , basesnap.Cpp , basesnap.cpp , MyDevice.cpp , basesnap.Cpp , certpsam.cpp , ADsFirstExt.cpp , Exports.Cpp , FaxSiren.Cpp , classfac.cpp , ContextSamplePropPage.cpp , dbauth.cpp , LogWriter.Cpp , VCSecuritySample.Cpp , QCNotify.Cpp , StoServe.Cpp , CrmFiles.Cpp , ComSyncObject.Cpp , PingResp.Cpp , LicServe.h , DllServe.h , ComSpyAudit.Cpp , ComSpyCtl.Cpp , Dog.Cpp , ConServe.Cpp , ConServe.h , DllServe.Cpp , FreServe.Cpp , FreServe.h , LicServe.Cpp , Marshal2.Cpp , PerDraw.Cpp , PerDraw.h , PerServe.Cpp , PerServe.h , PerText.Cpp , PerText.h , StoServe.h , BYOTTransaction.Cpp , TxEnlister.Cpp , FreeObject.Cpp , STAObject.Cpp , CrmDebug.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , cascadeec.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , Account.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip.Cpp , QCOrder.Cpp , QCShip2.Cpp , Disp1.Cpp , TServer.Cpp , ADOKB.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , theprovider.cpp , myclassfactory.cpp , msdfmap.cpp , Authenticate.cpp , proxyplugin.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , SCPCMenu.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , ADsError.cpp , NewFsp.c , dllmain.c , GraphObj.Cpp , customdialreg.cpp , DllMain.Cpp , DllMain.h , SampMsp.Cpp , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , CertPSam.Cpp , basesnap.Cpp , atlcontrol.Cpp , basesnap.Cpp , BaseSnap.Cpp , basesnap.Cpp , basesnap.cpp , basesnap.Cpp , MainDll.Cpp , OleSrvr.Cpp , MainDll.Cpp , RecoDll.cpp , BrochureMachine.cpp , EDAnnotator.cpp , Render.cpp , BankVC.cpp , CatlSmpl.Cpp , ClRes.cpp , File Share SampleEx.cpp , Dll.cpp , dll.cpp
  • DllRelease() : globals.h , server.cpp
  • DLLSERVE_TUTFILE_STR : LicClien.h
  • DLLSKELSHARED_STR : DllSkel.Cpp
  • DllUnregisterCluAdminExtension() : ClipBook ServerEx.cpp , File Share SampleEx.cpp
  • DllUnregisterServer() : ComSpyAudit.Cpp , ComSpyCtl.Cpp , Dog.Cpp , PingResp.Cpp , ConServe.Cpp , DllServe.Cpp , DllServe.h , FreServe.Cpp , LicServe.Cpp , LicServe.h , Marshal2.Cpp , PerDraw.h , PerServe.Cpp , PerServe.h , PerText.Cpp , PerText.h , StoServe.Cpp , StoServe.h , TxEnlister.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , cascadeec.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , Account.Cpp , LogWriter.Cpp , QCNotify.Cpp , QCShip.Cpp , QCNotify.Cpp , QCOrder.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , theprovider.cpp , classfac.cpp , myclassfactory.cpp , Authenticate.cpp , dbauth.cpp , proxyplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , SCPCMenu.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , dllmain.c , GraphObj.Cpp , customdialreg.cpp , DllMain.Cpp , DllMain.h , SampMsp.Cpp , DeviceDll.cpp , MyDevice.cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , CertPSam.Cpp , basesnap.Cpp , atlcontrol.Cpp , basesnap.Cpp , BaseSnap.Cpp , basesnap.Cpp , basesnap.cpp , basesnap.Cpp , MainDll.Cpp , OleSrvr.Cpp , MainDll.Cpp , BrochureMachine.cpp , EDAnnotator.cpp , Render.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , ClRes.cpp , File Share SampleEx.cpp , Dll.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , lrsample.CXX , UnRegisterServer.Cpp , SampView.Cpp , IcnOvrly.Cpp , server.cpp , ClipBook ServerEx.cpp , UnRegisterServer.Cpp , dll.cpp , basesnap.Cpp , RecoDll.cpp , Server.Cpp , basesnap.cpp , basesnap.Cpp , basesnap.cpp , certpsam.cpp , basesnap.Cpp , ADsError.cpp , pluggable.cpp , Exports.Cpp , msdfmap.cpp , ADEvent.cpp , sdksamplestorageplugin.cpp , QCOrder.Cpp , ADOKB.Cpp , QCShip2.Cpp , BYOTTransaction.Cpp , CrmMonComp.Cpp , STAObject.Cpp , ConServe.h , PerDraw.Cpp , FreServe.h
  • do_debug_command() : BPSamp.h , DbgCmd.c
  • do_editfile() : sdkdiff.cpp
  • do_editthread() : sdkdiff.cpp
  • DO_ERASE : SpinCube.h
  • DO_EXCEPTION : Common.h
  • do_getdata() : sdkdiff.cpp
  • do_gethdr() : sdkdiff.cpp
  • do_getprops() : sdkdiff.cpp
  • DoActivateDataChannel() : cData.h , cData.Cpp
  • DoAllDirsInOneDir() : SidClean.c
  • DoAsyncReadClient() : areadcli.c
  • DoAuthentication() : Client.cpp , Server.cpp
  • DOC_NAME : DoServer.h
  • DoCacheable() : CacheIsapi.cpp
  • DoCallConference() : CCall.h , CCall.Cpp
  • DoCallCreate() : CCall.Cpp , CCall.h
  • DoCallMedia() : CallNot.h , CallNot.cpp
  • DoCallNotification() : CallNot.cpp , CallNot.h
  • DoCallState() : CallNot.h , CallNot.cpp
  • DoCancel() : bits_ie.cpp
  • DoCancelCall() : CCall.Cpp , CCall.h
  • DoCapture() : WinCap.c , WinCap.h
  • DoChangeDuration() : CacheIsapi.cpp
  • DoChild() : Sockdups.c
  • DoChooseColorStuff() : Colors.c
  • DoChooseFontStuff() : Font.c
  • DoCleanup() : Bcast.c
  • DoCleanUp() : areadcli.c
  • DoCleanup() : Sockdups.c
  • DoClient() : PrPerf.c , PrSamp.h
  • DoClose() : bits_ie.cpp
  • DoCollaborate() : cShare.Cpp , cShare.h
  • DoColorsDialog() : Colors.c , Colors.h
  • DoConferenceCreate() : CConf.Cpp , CConf.h
  • DoConferenceLeave() : CConf.Cpp , CConf.h
  • DoContextMenu() : VListVw.c
  • DoCreateAppShareChannel() : cshare.h
  • DoCreateDataChannel() : cData.h , cData.Cpp
  • DOCUMENTNAME : queue.h
  • DoCustomError() : ReMapUrl.cpp
  • DoCustomUI() : httpauth.cpp
  • DocWndProc() : SimpCntr.Cpp , SimpCntr.h , SimpDnd.Cpp , SimpDnd.h , SimpSvr.Cpp , SimpSvr.h
  • DoDeleteIpForwardEntry() : IPRoute.Cpp , IPRoute.h
  • DoDeleteIpNetEntry() : IPArp.Cpp , IPArp.h
  • DoDisplayInfoDesc() : custom.c
  • dodlg_stringin() : utils.cpp
  • DoDragScroll() : idt.h
  • DoDrop() : sendto.c
  • DoDump() : dump.cxx , main.hxx
  • DoEndOfRequest() : Redir401.cpp
  • DoEnumAll() : Debug.Cpp , Global.h
  • DoEnumApps() : cShare.Cpp , cShare.h , cshare.cpp , Global.h
  • DoEnumChannelMember() : Global.h , Debug.Cpp
  • DoEnumConferenceMember() : Debug.Cpp , Global.h
  • DoEnumMemberLeak() : Global.h , Debug.Cpp
  • DoesFileExist() : Utility.c , Utility.h
  • DoFileEvent() : CallNot.h , CallNot.cpp
  • DoFindDialog() : Find.c , Find.h
  • DoFindRepStuff() : Find.c
  • DoFinish() : bits_ie.cpp
  • DoFontDialog() : Font.c , Font.h
  • DoFtCancel() : cft.cpp , cft.h , CChan.h
  • DoGetConnTable() : IPStat.Cpp , IPStat.h
  • DoGetIpForwardTable() : IPRoute.Cpp , IPRoute.h
  • DoGetIpNetTable() : IPArp.Cpp , IPArp.h
  • DoGetStat() : IPStat.Cpp , IPStat.h
  • DoGracefulShutdown() : Sockdupc.c , Sockdups.c
  • DoHandleCall() : CCall.Cpp , CCall.h
  • DoHelloWorld() : custom.c
  • DoHelp() : CacheIsapi.cpp
  • DoIdealSendRecv() : TestAccept.cpp
  • DoInit() : areadcli.c
  • DoInvalidate() : CacheIsapi.cpp
  • DoIpDelete() : iplisten.c
  • DoIpListen() : precomp.h , iplisten.c
  • DoIpQuery() : iplisten.c
  • DoIpSet() : iplisten.c
  • DoIpx() : Bcast.c
  • DoIpxClient() : Bcast.c
  • DoIpxServer() : Bcast.c
  • DoLineCallState() : TapiCode.c
  • DoLineClose() : TapiCode.c
  • DoLineCreate() : TapiCode.c
  • DoLineDevState() : TapiCode.c
  • DoLineReply() : TapiCode.c
  • DoList() : main.hxx , enum.cxx
  • DoMailSlot() : Bcast.c
  • DoMailSlotClient() : Bcast.c
  • DoMailSlotServer() : Bcast.c
  • Domain : resource.h
  • DoMain() : Main.c
  • DoMatchingFilesInOneDir() : SidClean.c
  • DoMessage() : Callnot.Cpp , FileTerm.cpp , FileTerm.h , Outgoing.Cpp , Incoming.Cpp
  • DoModalPropSheet() : Property.c
  • DoModelessPropSheet() : Property.c
  • DONE : APP.h
  • DoOneFileOrDir() : SidClean.c
  • DoOpenDialog() : Open.c , Open.h
  • DoOpenSaveStuff() : Open.c
  • DoPaint() : WinCap.h , WinCap.c
  • DoParent() : Sockdups.c
  • DoPreprocHeaders() : Redir401.cpp
  • DoPrint() : sdkdiff.cpp
  • DoPrintDialog() : Print.c , Print.h
  • DoPrintDlgStuff() : Print.c
  • DoQuery() : QSample.Cxx , AdvQuery.Cxx
  • DoQueryFile() : QSample.Cxx
  • DoReceiveRequests() : main.c
  • DoRecvOnce() : TestAccept.cpp
  • DoRecvUntilDone() : TestAccept.cpp
  • DoReplaceDialog() : Replace.h , Replace.c
  • DoResize() : sdkdiff.cpp
  • DoRnrClient() : rnrcs.cpp
  • DoRnrServer() : rnrcs.cpp
  • DoSaveDialog() : Save.c , Save.h
  • DoScroll() : WinCap.c , WinCap.h
  • DOSDTTM : wn_dos.h
  • DoSendChatMsg() : cData.Cpp , cData.h
  • DoSendNoRecv() : TestAccept.cpp
  • DoSendOnce() : TestAccept.cpp
  • DoSendRawData() : Redir401.cpp
  • DoSendResponse() : Redir401.cpp
  • DoSendThenRecv() : TestAccept.cpp
  • DoSendUntilDone() : TestAccept.cpp
  • DoSendWaitRecv() : TestAccept.cpp
  • DoServer() : PrPerf.c , PrSamp.h
  • DoSetIpForwardEntry() : IPRoute.Cpp , IPRoute.h
  • DoSetIpNetEntry() : IPArp.Cpp , IPArp.h
  • DoSharableAppLeak() : Global.h , Debug.Cpp
  • DoShutDown() : TestAccept.cpp
  • DoSimpleConnect() : custom.c
  • DoSize() : WinCap.h , WinCap.c
  • DoSQLError() : MqTrans.Cpp
  • DoSsl() : ssl.c , precomp.h
  • DoSslDelete() : ssl.c
  • DoSslQuery() : ssl.c
  • DoSslSet() : ssl.c
  • DoStartup() : Bcast.c
  • DosxError() : wn_dos.h
  • dosxSharing : wn_dos.h
  • DoTakeControl() : cShare.h , cShare.Cpp
  • DoTests() : sampclnt.h , ComPerf.Cpp , sampclnt.cpp
  • DoTimings() : Client.C
  • DoTitleDialog() : Title.c , Title.h
  • doTrackObject() : WxForm.c , Track.h , Track.c , WxForm.h
  • DottedLine() : DspLogcl.Cpp
  • DOUBLE_LINK_TYPE_free_inst() : Xmitu.c , Xmitu.h
  • DOUBLE_LINK_TYPE_free_xmit() : Xmitu.c , Xmitu.h
  • DOUBLE_LINK_TYPE_from_xmit() : Xmitu.h , Xmitu.c
  • DOUBLE_LINK_TYPE_to_xmit() : Xmitu.h , Xmitu.c
  • DoUdp() : Bcast.c
  • DoUdpClient() : Bcast.c
  • DoUdpServer() : Bcast.c
  • DoUpdateRoutes() : rmapi.c
  • DoUrlAcl() : url.c , precomp.h
  • DoUrlAclDelete() : url.c
  • DoUrlAclQuery() : url.c
  • DoUrlAclSet() : url.c
  • DoVerb() : ioo.h
  • DoWait() : Overlap.c
  • DoWaitSendRecv() : TestAccept.cpp
  • DoWizardPropSheet() : Property.c
  • Download() : Sample1.Cpp , Sample1.h
  • DownloadAndUpgradeMsi() : setup.h , upgrdmsi.cpp
  • DoWork() : TraceDp.c
  • DoWorkAlone() : cShare.Cpp , cShare.h
  • DPF : Debug.h
  • dprintf() : dbh.cpp
  • DR7CLEAR : Utils.c
  • DR7SET : Utils.c
  • DragEnter() : idt.h
  • DragLeave() : idt.h
  • DragOver() : idt.h
  • DrainBuffer() : pipe.hxx , pipe.cxx
  • Draw3DRect() : MDIChild.C
  • DRAW_WINDOW_CLASS_MENU_STR : RESDEF.h
  • DRAW_WINDOW_CLASS_NAME_STR : RESDEF.h
  • DRAW_WINDOW_NAME_STR : RESDEF.h
  • DrawANDMask() : Icons.h , Icons.C
  • DrawAscii() : FontView.c , Display.c
  • DRAWAXIS : Common.h
  • DrawBitmap() : BitMap.c , BitMap.h
  • DrawBranch() : Server32.c , Server32.h
  • DrawButton() : Tools.c , Dialer.c
  • DrawButtonText() : Dialer.c
  • DRAWCLASS : Draw.h
  • DrawCommandProc() : Draw.h , Draw.c
  • DrawCreateProc() : Draw.c , Draw.h
  • DRAWDATA : Draw.h
  • DrawDestroyProc() : Draw.h , Draw.c
  • DrawDragFeedback() : idt.h
  • DrawFonts() : Paint.c , Paint.h
  • DrawGlyph() : Display.c , FontView.c
  • DrawGrids() : PlgBlt.c , PlgBlt.h
  • DrawIndent() : WinCap.h
  • DRAWINFO : Common.h
  • DrawLink() : bar.cpp
  • DrawMaze() : Maze.h , Maze.c
  • DrawObject() : Draw.h , Draw.c
  • DrawPaintProc() : Draw.h , Draw.c
  • DrawProc() : Draw.c , Draw.h
  • DrawSample() : Dialogs.c
  • DrawSection() : bar.cpp
  • DrawSelect() : WinCap.c , WinCap.h
  • DrawSurfWndProc() : MfEdit.h , MfEdit.c
  • DRAWTITLE : GdiDemo.h
  • DrawUserItem() : Global.h , Dlg.Cpp
  • DrawXForm() : XForm.c
  • DrawXORMask() : Icons.h , Icons.C
  • Drop() : idt.h
  • DropActiveCall() : Atsp.c , Atsp.h
  • DropExt_CheckForHDROP() : DropExt.C
  • DropExt_CheckForHNRES() : DropExt.C
  • DropExt_CreateInstance() : DropExt.C
  • DropExt_CTM_QueryInterface() : DropExt.C
  • DropExt_GetCommandString() : DropExt.C
  • DropExt_GetNetResource() : DropExt.C
  • DropExt_Initialize() : DropExt.C
  • DropExt_InvokeCommand() : DropExt.C
  • DropExt_QueryContextMenu() : DropExt.C
  • DropExt_SXI_QueryInterface() : DropExt.C
  • DropHdbc() : quiktest.c
  • DropHenv() : quiktest.c
  • DropTable() : quiktest.c
  • DRV_ENABLE_DEBUG : Debug.h
  • DRV_SET_DEBUG_LEVEL : Debug.h
  • DrvAlloc() : Atsp.c , Atsp.h
  • DrvFree() : Atsp.h , Atsp.c
  • DRVLINE : Atsp.h
  • DRVLINECONFIG : Atsp.h
  • DS_ABSALIGN : winres.h
  • DS_DISABLED : MSMQTest.c
  • DS_ENABLED : MSMQTest.c
  • DS_LOCALEDIT : winres.h
  • DS_MODALFRAME : winres.h
  • DS_NOIDLEMSG : winres.h
  • DS_SETFONT : winres.h
  • DS_SYSMODAL : winres.h
  • DSA_SEC_PAGE_INFO : PropSheetHost.h
  • DSBitsPerPixel() : DIBSectn.c , DIBSectn.h
  • DSColorTableSize() : DIBSectn.c , DIBSectn.h
  • DSCopyBitmap() : DIBSectn.c , DIBSectn.h
  • DSCopyBitmapEx() : DIBSectn.c , DIBSectn.h
  • DSCreateDDBForDS() : DIBSectn.c
  • DSCreateDIBSection() : DIBSectn.c , DIBSectn.h
  • DSCreatePaletteForDIBSection() : DIBSectn.h , DIBSectn.c
  • DSCreateSpectrumPalette() : DIBSectn.c , DIBSectn.h
  • DSDrawDIBSectionOnDC() : DIBSectn.h , DIBSectn.c
  • DSGetBITMAPINFOForDIBSection() : DIBSectn.h , DIBSectn.c
  • DSGetDIBFromDIBSection() : DIBSectn.h , DIBSectn.c
  • DSGetDIBSectionFromClipboard() : DIBSectn.c , DIBSectn.h
  • DSGetOptimalDIBFormat() : DIBSectn.h , DIBSectn.c
  • DSGetPointerToDIBSectionImageBits() : DIBSectn.c , DIBSectn.h
  • DSGetRGBBitsPerPixel() : DIBSectn.h , DIBSectn.c
  • DSImageBitsSize() : DIBSectn.h , DIBSectn.c
  • DSLoadDIBSectionFromBMPFile() : DIBSectn.h , DIBSectn.c
  • DSPDxax : bitmaps.h
  • DSPutDIBSectionOnClipboard() : DIBSectn.c , DIBSectn.h
  • DSStoreDIBSectionInBMPFile() : DIBSectn.c , DIBSectn.h
  • DSTotalBytesSize() : DIBSectn.c , DIBSectn.h
  • DSTRUCT : quiktest.h
  • DtcGetTransactionManager() : MqTrans.Cpp
  • DTCODE___WSAFDIsSet : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_accept : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_bind : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_closesocket : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_connect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_freeaddrinfo : Dt_Dll.Hpp
  • DTCODE_getaddrinfo : Dt_Dll.Hpp
  • DTCODE_gethostbyaddr : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_gethostbyname : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_gethostname : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getnameinfo : Dt_Dll.Hpp
  • DTCODE_getpeername : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getprotobyname : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getprotobynumber : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getservbyname : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getservbyport : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_getsockname : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getsockopt : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_htonl : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_htons : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_inet_addr : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_inet_ntoa : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_ioctlsocket : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_listen : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPAddressToString : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_NSPEnumNameSpaceProviders : Dt_Dll.h
  • DTCODE_NSPGetAddressByName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPGetServiceClassInfo : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPGetServiceClassNameByClassId : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPInstallServiceClass : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPIoctl : Dt_Dll.Hpp
  • DTCODE_NSPLookupServiceBegin : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_NSPLookupServiceEnd : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPLookupServiceNext : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_NSPRemoveServiceClass : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_NSPSetService : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_NSPStartup : Dt_Dll.Hpp
  • DTCODE_NSPStringToAddress : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_ntohl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_ntohs : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_recv : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_recvfrom : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_select : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_send : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_sendto : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_setsockopt : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_shutdown : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_socket : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUCloseEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUCloseSocketHandle : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUCloseThread : Dt_Dll.Hpp
  • DTCODE_WPUCompleteOverlappedRequest : Dt_Dll.Hpp
  • DTCODE_WPUCreateEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUCreateSocketHandle : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUFDIsSet : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUGetProviderPath : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUModifyIFSHandle : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUOpenCurrentThread : Dt_Dll.Hpp
  • DTCODE_WPUPostMessage : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUQueryBlockingCallback : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUQuerySocketHandleContext : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUQueueApc : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUResetEvent : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUSetEvent : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAccept : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAddressToStringA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAddressToStringW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAsyncGetHostByAddr : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAsyncGetHostByName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAsyncGetProtoByName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAsyncGetProtoByNumber : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAsyncGetServByName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAsyncGetServByPort : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAsyncSelect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSACancelAsyncRequest : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSACancelBlockingCall : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSACleanup : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSACloseEvent : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAConnect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSACreateEvent : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSADuplicateSocketA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSADuplicateSocketW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAEnumNameSpaceProvidersA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAEnumNameSpaceProvidersW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAEnumNetworkEvents : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAEnumProtocolsA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAEnumProtocolsW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAEventSelect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetLastError : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAGetOverlappedResult : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetQOSByName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetServiceClassInfoA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetServiceClassInfoW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetServiceClassNameByClassIdA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetServiceClassNameByClassIdW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAHtonl : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAHtons : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAInstallServiceClassA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAInstallServiceClassW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAIoctl : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAIsBlocking : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAJoinLeaf : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSALookupServiceBeginA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSALookupServiceBeginW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSALookupServiceEnd : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSALookupServiceNextA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSALookupServiceNextW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSANSPIoctl : Dt_Dll.Hpp
  • DTCODE_WSANtohl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSANtohs : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAProviderConfigChange : Dt_Dll.Hpp
  • DTCODE_WSARecv : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSARecvDisconnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSARecvFrom : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSARemoveServiceClass : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAResetEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSASend : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASendDisconnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSASendTo : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASetBlockingHook : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASetEvent : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASetLastError : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASetServiceA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASetServiceW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASocketA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASocketW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAStartup : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAStringToAddressA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAStringToAddressW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAUnhookBlockingHook : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAWaitForMultipleEvents : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCDeinstallProvider : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCEnableNSProvider : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCEnumProtocols : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCGetProviderPath : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCInstallNameSpace : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCInstallProvider : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCUnInstallNameSpace : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCUpdateProvider : Dt_Dll.Hpp
  • DTCODE_WSCWriteNameSpaceOrder : Dt_Dll.Hpp
  • DTCODE_WSCWriteProviderOrder : Dt_Dll.Hpp
  • DTCODE_WSPAccept : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPAddressToString : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPAsyncSelect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPBind : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPCancelBlockingCall : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPCleanup : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPCloseSocket : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPConnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPDuplicateSocket : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPEnumNetworkEvents : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPEventSelect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPGetOverlappedResult : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPGetPeerName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPGetQOSByName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPGetSockName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPGetSockOpt : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPIoctl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPJoinLeaf : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPListen : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPRecv : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPRecvDisconnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPRecvFrom : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPSelect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSend : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSendDisconnect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPSendTo : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSetSockOpt : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPShutdown : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSocket : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPStartup : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPStringToAddress : Dt_Dll.h , Dt_Dll.Hpp
  • DTHandler___WSAFDIsSet() : Handlers.Cpp , Handlers.h
  • DTHandler_accept() : Handlers.h , Handlers.Cpp
  • DTHandler_bind() : Handlers.Cpp , Handlers.h
  • DTHandler_closesocket() : Handlers.h , Handlers.Cpp
  • DTHandler_connect() : Handlers.h , Handlers.Cpp
  • DTHandler_gethostbyaddr() : Handlers.h , Handlers.Cpp
  • DTHandler_gethostbyname() : Handlers.Cpp , Handlers.h
  • DTHandler_gethostname() : Handlers.h , Handlers.Cpp
  • DTHandler_getpeername() : Handlers.h , Handlers.Cpp
  • DTHandler_getprotobyname() : Handlers.h , Handlers.Cpp
  • DTHandler_getprotobynumber() : Handlers.h , Handlers.Cpp
  • DTHandler_getservbyname() : Handlers.h , Handlers.Cpp
  • DTHandler_getservbyport() : Handlers.Cpp , Handlers.h
  • DTHandler_getsockname() : Handlers.Cpp , Handlers.h
  • DTHandler_getsockopt() : Handlers.Cpp , Handlers.h
  • DTHandler_htonl() : Handlers.h , Handlers.Cpp
  • DTHandler_htons() : Handlers.Cpp , Handlers.h
  • DTHandler_inet_addr() : Handlers.Cpp , Handlers.h
  • DTHandler_inet_ntoa() : Handlers.Cpp , Handlers.h
  • DTHandler_ioctlsocket() : Handlers.h , Handlers.Cpp
  • DTHandler_listen() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPAddressToString() : Handlers.Cpp
  • DTHandler_NSPCleanup() : Handlers.h
  • DTHandler_NSPGetAddressByName() : Handlers.Cpp
  • DTHandler_NSPGetServiceClassInfo() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPGetServiceClassNameByClassId() : Handlers.Cpp
  • DTHandler_NSPInstallServiceClass() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPLookupServiceBegin() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPLookupServiceEnd() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPLookupServiceNext() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPRemoveServiceClass() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPSetService() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPStringToAddress() : Handlers.Cpp
  • DTHandler_ntohl() : Handlers.Cpp , Handlers.h
  • DTHandler_ntohs() : Handlers.Cpp , Handlers.h
  • DTHandler_recv() : Handlers.h , Handlers.Cpp
  • DTHandler_recvfrom() : Handlers.Cpp , Handlers.h
  • DTHandler_select() : Handlers.Cpp , Handlers.h
  • DTHandler_send() : Handlers.Cpp , Handlers.h
  • DTHandler_sendto() : Handlers.h , Handlers.Cpp
  • DTHandler_setsockopt() : Handlers.Cpp , Handlers.h
  • DTHandler_shutdown() : Handlers.h , Handlers.Cpp
  • DTHandler_socket() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUCloseEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUCloseSocketHandle() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUCreateEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUCreateSocketHandle() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUFDIsSet() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUGetProviderPath() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUModifyIFSHandle() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUPostMessage() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUQueryBlockingCallback() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUQuerySocketHandleContext() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUQueueApc() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUResetEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUSetEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAccept() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAddressToStringA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAddressToStringW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAsyncGetHostByAddr() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAsyncGetHostByName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAsyncGetProtoByName() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncGetProtoByNumber() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAsyncGetServByName() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncGetServByPort() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncSelect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSACancelAsyncRequest() : Handlers.h , Handlers.Cpp
  • DTHandler_WSACancelBlockingCall() : Handlers.Cpp , Handlers.h
  • DTHandler_WSACleanup() : Handlers.Cpp , Handlers.h
  • DTHandler_WSACloseEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAConnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSACreateEvent() : Handlers.h , Handlers.Cpp
  • DTHandler_WSADuplicateSocketA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSADuplicateSocketW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAEnumNameSpaceProvidersA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAEnumNameSpaceProvidersW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAEnumNetworkEvents() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAEnumProtocolsA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAEnumProtocolsW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAEventSelect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetAddressByNameA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetAddressByNameW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetLastError() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetOverlappedResult() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetQOSByName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetServiceClassInfoA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetServiceClassInfoW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetServiceClassNameByClassIdA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetServiceClassNameByClassIdW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAHtonl() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAHtons() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAInstallServiceClassA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAInstallServiceClassW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAIoctl() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAIsBlocking() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAJoinLeaf() : Handlers.Cpp , Handlers.h
  • DTHandler_WSALookupServiceBeginA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSALookupServiceBeginW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSALookupServiceEnd() : Handlers.h , Handlers.Cpp
  • DTHandler_WSALookupServiceNextA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSALookupServiceNextW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSANtohl() : Handlers.h , Handlers.Cpp
  • DTHandler_WSANtohs() : Handlers.Cpp , Handlers.h
  • DTHandler_WSARecv() : Handlers.h , Handlers.Cpp
  • DTHandler_WSARecvDisconnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSARecvFrom() : Handlers.h , Handlers.Cpp
  • DTHandler_WSARemoveServiceClass() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAResetEvent() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASend() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASendDisconnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSASendTo() : Handlers.Cpp , Handlers.h
  • DTHandler_WSASetBlockingHook() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASetEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WSASetLastError() : Handlers.Cpp , Handlers.h
  • DTHandler_WSASetServiceA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASetServiceW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASocketA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASocketW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAStartup() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAStringToAddressA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAStringToAddressW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAUnhookBlockingHook() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAWaitForMultipleEvents() : Handlers.Cpp , Handlers.h
  • DTHandler_WSCDeinstallProvider() : Handlers.h , Handlers.Cpp
  • DTHandler_WSCEnumProtocols() : Handlers.h , Handlers.Cpp
  • DTHandler_WSCInstallProvider() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPAccept() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPAsyncSelect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPBind() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPCancelBlockingCall() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPCleanup() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPCloseSocket() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPConnect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPDuplicateSocket() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPEnumNetworkEvents() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPEventSelect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPGetOverlappedResult() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPGetPeerName() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPGetQOSByName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPGetSockName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPGetSockOpt() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPIoctl() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPJoinLeaf() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPListen() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPRecv() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPRecvDisconnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPRecvFrom() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPSelect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSend() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSendDisconnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSendTo() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPSetSockOpt() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPShutdown() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPSocket() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPStartup() : Handlers.Cpp , Handlers.h
  • DTHandlerInit() : Handlers.Cpp , Handlers.h
  • DTTextOut() : Dt_Dll.Cpp , Dt.h
  • Dummy : Npaux.h , resource.h
  • DUMMY : Resource.h
  • DummyExtension : extend.h
  • DummyLib : SyncComp.Idl , PoolTest.Idl
  • dummyStore : msomniprovrs.h
  • Dump() : AsyncDemo.cpp
  • dump : utiltest.cpp
  • dump_com_error() : QueueDef.h
  • dump_debug_event_info() : Utils.c , BPSamp.h
  • DUMP_ERROR_LINENUMBER : sampclnt.h
  • DUMP_FILE_NAME : tracedmp.h
  • DUMP_SAMP : nshsamp.h
  • DUMP_SAMP_BASE : nshsamp.h
  • DUMP_SAMPINTERFACE : nshsamp.h
  • DumpAce() : security.cpp
  • DumpAclInfo() : SD.c , Check_SD.h
  • DumpAllCalls() : Global.h , Debug.Cpp
  • DumpBytes() : Range.c
  • DumpCallInfo() : Global.h , Debug.Cpp
  • DumpChannelInfo() : Global.h , Debug.Cpp
  • DumpClassName() : PathParser.cpp
  • DumpColumnHeadings() : sampclnt.h , dump.cpp
  • DumpColumnsInfo() : dump.cpp , sampclnt.h
  • DumpConferenceInfo() : Debug.Cpp , Global.h
  • DumpControl() : Check_SD.h , SD.c
  • DumpDacl() : SD.c , Check_SD.h
  • DumpData() : Pickltc.c , Picklpc.c
  • dumpdbi() : dbh.cpp
  • DumpErrorHResult() : dump.cpp , sampclnt.h
  • DumpErrorMsg() : sampclnt.h , dump.cpp
  • DumpEvent() : tracedmp.cpp
  • DumpFeatureMasks() : QueryParser.cpp
  • DumpFile() : SecObjects.c , Check_SD.h , tracedmp.cpp
  • DumpFromClause() : QueryParser.cpp
  • DumpKernelObject() : SecObjects.c , Check_SD.h
  • DumpKeyList() : PathParser.cpp
  • DumpLaunchInfo() : cMgr.h , cMgr.Cpp
  • dumpLine() : dbh.cpp
  • DumpMemberInfo() : Global.h , Debug.Cpp
  • DumpNamespaces() : PathParser.cpp
  • DumpNetShare() : Check_SD.h , SecObjects.c
  • DumpObject() : main.hxx , dump.cxx
  • DumpOwnerGroup() : SD.c , Check_SD.h
  • DumpPrinter() : Check_SD.h , SecObjects.c
  • DumpRegistryKey() : Check_SD.h , SecObjects.c
  • DumpRow() : sampclnt.h , dump.cpp
  • DumpRpn() : QueryParser.cpp
  • DumpSample() : sample.cpp , nshsamp.h
  • DumpSampleInterface() : sampinterface.cpp , nshsamp.h
  • DumpSD() : Check_SD.h , security.cpp , SD.c
  • DumpSDInfo() : SD.c , Check_SD.h
  • DumpSelectList() : QueryParser.cpp
  • DumpServerName() : PathParser.cpp
  • DumpService() : Check_SD.h , SecObjects.c
  • DumpServiceClassInfo() : rnrcs.cpp
  • dumpsi() : dbh.cpp
  • DumpStatusMsg() : dump.cpp , sampclnt.h
  • DumpSubexpression() : QueryParser.cpp
  • dumpsym : dbh.cpp
  • dumpsym32() : dbh.cpp
  • DumpSysInfo() : cMgr.h , cMgr.Cpp
  • DumpTcpTable() : IPStat.Cpp , IPStat.h
  • DumpUdpTable() : IPStat.h , IPStat.Cpp
  • DumpUserObject() : SecObjects.c , Check_SD.h
  • DumpVariable() : formdump.cpp
  • DumpWhereClause() : QueryParser.cpp
  • DUnadvise() : ido.h
  • DUPE : GssServer.c , GssClient.c
  • DuplicateItemList() : Enum.Cpp , Enum.h
  • DuplicateWSTR() : Sample1.Cpp , Sample1.h
  • dwACEsDeleted : SidClean.c
  • dwAspect : OleStd.h
  • dwAuthFlags : main.cxx
  • dwBytesWritten : Admapit.c
  • dwColor : Colors.c
  • dwColorThreadID1 : Colors.c
  • dwColorThreadID2 : Colors.c
  • dwColorThreadParm1 : Colors.c
  • dwColorThreadParm2 : Colors.c
  • dwCompAttrLen : IMEApps.h , Data.c
  • dwCompCls : IMEApps.h , Data.c
  • dwCompClsLen : Data.c , IMEApps.h
  • dwCompReadAttrLen : Data.c , IMEApps.h
  • dwCompReadCls : IMEApps.h , Data.c
  • dwCompReadClsLen : Data.c , IMEApps.h
  • dwCompReadStrLen : Data.c , IMEApps.h
  • dwCompStrLen : Data.c , IMEApps.h
  • dwCurrentEntry : ThreadPool.c
  • dwCurrPref : main.cxx
  • dwCustColors : Colors.c
  • dwDrawAspect : OleStd.h
  • dwErr : Service.C , Service.c
  • dwFilesChecked : SidClean.c
  • dwFilesOwned : SidClean.c
  • dwFlags : OleStd.h , Open.h
  • dwFontFlag : Font.c
  • dwFontThreadID1 : Font.c
  • dwFontThreadID2 : Font.c
  • dwFontThreadParm1 : Font.c
  • dwFontThreadParm2 : Font.c
  • dwgrfMode : OleStd.h
  • dwHandle : Server.Cxx
  • dwID : LogWriter.Idl
  • dwInComingCallStatus : msgfiltr.h
  • dwIndex : Mypal.c
  • DWL_THREADWNDPROCCLASS : Handler.h
  • dwLastEntry : ThreadPool.c
  • dwLogUsers : PerfUtil.c , Perfmsg.h , PerfUtil.c , Perfmsg.h
  • dwMaxRows : main.cxx
  • dwMaxViewSize : FCopy.Cpp
  • dwNumberAttributes : main.cxx
  • dwNumColors : Mypal.c
  • dwOpenCount : Perfgen.c
  • DWORD : suminfo.Cpp , GinaHook.h , msgfiltr.h , rqsengine.h , GinaStub.h , enablerouter.c
  • DWORD_MULTIPLE : PerfUtil.h
  • DWORDALIGN : malspy.c
  • DWORDSWAP : SMFI.h
  • dwPageSize : main.cxx
  • dwPal : Mypal.c
  • dwPause : EdCommands.cpp , EdGlyphs.cpp , fullsvr.Cpp , EdCommands.cpp , EdHost.cpp
  • dwPrintThreadID1 : Print.c
  • dwPrintThreadID2 : Print.c
  • dwPrintThreadParm1 : Print.c
  • dwPrintThreadParm2 : Print.c
  • dwProtocol : WebServer.c , WebClient.c
  • dwRegister : OleStd.h , secSvr.Cpp
  • dwResult : Admapit.c
  • dwResultCls : IMEApps.h , Data.c
  • dwResultClsLen : IMEApps.h , Data.c
  • dwResultReadCls : IMEApps.h , Data.c
  • dwResultReadClsLen : Data.c , IMEApps.h
  • dwResultReadStrLen : Data.c , IMEApps.h
  • dwResultStrLen : IMEApps.h , Data.c
  • dwSearchScope : main.cxx
  • dwSize : main.cpp
  • dwStatus : OleStd.h
  • dwSubEntry : main.cpp
  • dwThreadCnt : ComSpyAudit.Idl
  • dwThreadId : enablerouter.c
  • dwThreadID1 : Open.c
  • dwThreadID2 : Open.c
  • dwThreadParm1 : Open.c
  • dwThreadParm2 : Open.c
  • dwTickCount : msgfiltr.h
  • dwTimeOut : EdHost.cpp , EdCommands.cpp , EdGlyphs.cpp , EdCommands.cpp , fullsvr.Cpp , main.cxx
  • dwTimeZero : TestDll.C
  • dwType : FTPJr.cpp , classfac.cpp
  • DXP_SEND : Global.h
  • DXP_ULIST : Global.h
  • DXP_USER : ui.cpp , Global.h
  • dy : suminfo.h
  • dyCombo : Tools.c
  • dyField : Status.c
  • DYNAMIC_CHANNEL_RESOURCE_ID : session.cpp
  • DYNAMIC_LOCKS_HIGH_THRESHOLD : sync.h
  • DYNAMIC_LOCKS_STORE : sync.h
  • DYNAMIC_LOCKS_STORE_INITIALIZED : sync.h
  • DYNAMIC_READWRITE_LOCK : sync.h
  • DynamicExtension : extend.h
  • DYP_EDIT : Global.h , ui.cpp
  • DYP_MSG : Global.h
  • DYP_SEND : Global.h
  • DYP_ULIST : Global.h
  • dyStatus : Status.c
  • dyTools : Tools.c
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- e -

  • E_DELAYLOAD_MOD_NOT_FOUND : CeError.Cpp , ceerror.cpp , CeError.Cpp
  • E_DELAYLOAD_PROC_NOT_FOUND : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • E_PROPTYPEMISMATCH : StdAfx.h
  • EAN_NAMEOBJECTID : AltName.Cpp
  • EAP_NAME_DIALOG : Eap.h
  • EapBegin() : Eap.c , Eap.h
  • EAPCB : Eap.h
  • EapEnd() : Eap.c , Eap.h
  • EapMakeMessage() : Eap.c , Eap.h
  • EapTrace() : Eap.c , Eap.h
  • EB_CLASS_NAME : ExplrBar.h
  • EB_HATCHRECT_BOTTOM : hatch.c
  • EB_HATCHRECT_LEFT : hatch.c
  • EB_HATCHRECT_RIGHT : hatch.c
  • EB_HATCHRECT_TOP : hatch.c
  • EB_HATCHWIDTH : hatch.c
  • EBaseObjectType : baseobj.h
  • EC_CHILD : Dt.h
  • eCAsynchBase : cbase.h
  • eCBase : cbase.h
  • eCBinder : cbase.h
  • ECBqueue : ThreadPool.c
  • eCCommand : cbase.h
  • eCConnectionPoint : cbase.h
  • eCContainerBase : cbase.h
  • eCCustomError : cbase.h
  • eCDataAccess : cbase.h
  • eCDataLinks : cbase.h
  • eCDataset : cbase.h
  • eCDataSource : cbase.h
  • eCEnumerator : cbase.h
  • eCError : cbase.h
  • EcFindFirst4dm : wn_dos.h
  • EcFindFirstCore : wn_dos.h
  • EcFindNext4dm : wn_dos.h
  • eCMultipleResults : cbase.h
  • eCPropertiesBase : cbase.h
  • eCRow : cbase.h
  • eCRowPosition : cbase.h
  • eCRowset : cbase.h
  • eCServiceComp : cbase.h
  • eCSession : cbase.h
  • eCStream : cbase.h
  • eCTransaction : cbase.h
  • eCTransactionOptions : cbase.h
  • eCUnknown : cbase.h
  • ED_BASE : FontView.h
  • ED_HEX : FontView.h
  • ED_NEXT : FontView.h
  • ED_PREV : FontView.h
  • ED_SAMPLE : FontView.h
  • ED_SET : FontView.h
  • ED_TYPE : FontView.h
  • EDAnnotator_ProxyFileInfo : EDAnnotator_p.c
  • EdCommands_ProxyFileInfo : EdCommands_p.c
  • EdGlyphs_ProxyFileInfo : EdGlyphs_p.c
  • EdHost_ProxyFileInfo : EdHost_p.c
  • EDIT1 : resource.h
  • EDIT2 : resource.h
  • EDIT3 : resource.h
  • EDIT4 : resource.h
  • EDIT_VIEW_COOKIE : tsfedit.h
  • EditChar() : Edit.Cpp , Global.h
  • EditFreeCaches() : Global.h
  • EditInsertUnicode() : Global.h
  • EditKeyDown() : Edit.Cpp , Global.h
  • EditMode() : data.Idl
  • EditModeEnum : adoint.h
  • editor_cmdline : sdkdiff.cpp
  • EDITOR_EXE_STR : AppUtil.h
  • EDWP : GLOBALS.h , Globals.h
  • edwpDialog : GLOBALS.h , Globals.h
  • edwpMDIChild : GLOBALS.h , Globals.h
  • edwpMDIFrame : GLOBALS.h , Globals.h
  • edwpNone : GLOBALS.h , Globals.h
  • edwpWindow : GLOBALS.h , Globals.h
  • EE_Create() : configentry.c , configentry.h
  • EE_Destroy() : configentry.c , configentry.h
  • EE_Display : configentry.h
  • EICON : step1.cpp , step4.cpp
  • eInvalid : cbase.h
  • EjectDlgProc() : Dlg.Cpp
  • ELLIPSE : Common.h
  • emAdminInstall : setup.h
  • EMBEDDINGFLAG : Utils.h , OleStd.h
  • EmbossedTextOut() : MidiPlyr.h , UIUTILS.c
  • emEnum : setup.h
  • emHelp : setup.h
  • EmployeeSid : AuthzSvr.c
  • EmployeeSidBuf : AuthzSvr.c
  • emPreset : setup.h
  • EMPTY : main.cpp
  • emVerify : setup.h
  • ENABLE_BIT : common.h
  • EnableAsyncReceive() : MQPort.Cpp
  • EnableButton() : Callnot.Cpp , Incoming.Cpp , Outgoing.Cpp
  • EnableChildren() : Atsp.c
  • EnableColorButtons() : Colors.c
  • EnableCRTAllocHook() : spy.cpp , spy.h
  • EnableCRTReportHook() : spy.cpp , spy.h
  • ENABLED : nshsamp.h
  • EnableDebugPriv() : SuperUsr.cpp
  • EnableFlags : TraceDp.c
  • EnableFontButtons() : Font.c
  • EnableHangupCall() : ToolBar.c , ToolBar.h
  • EnableLevel : TraceDp.c
  • EnableMakeCall() : ToolBar.c , ToolBar.h
  • EnableModeless() : ioipf.h , ioipao.h
  • ENABLEMODELESSMSG : Handler.h
  • EnablePreview() : Incoming.Cpp , Outgoing.Cpp
  • EnablePrintControls() : Print.c
  • ENCODING : CreateCert.c , SignHash.cpp
  • ENCRYPT_ALGORITHM : Decrypt.c , Encrypt.c
  • ENCRYPT_BLOCK_SIZE : Decrypt.c , Encrypt.c
  • EncryptAndEncodeCredentials() : CustomAuth.cpp
  • EncryptDecryptFile() : RSACert.cpp , RSAKey.cpp
  • EncryptThis() : Security.cpp , Security.h
  • END_DEAD : Server32.h
  • END_LIVE : Server32.h
  • END_POINT : Common.h
  • END_STEP : RendSam.Cpp
  • END_WIZ : wizard.h
  • EndAnchor : Anchor.Hxx
  • EndInkInput() : RecoDll.cpp
  • EndMenuItemIDTable() : IMEApps.h , ImeMenu.c
  • EndSelection() : Select.c , Select.h
  • EndTime() : Client.C
  • Engage() : MICARS.Idl
  • EngineDefined() : ComSpyAudit.Idl
  • English_Sample_LangRes : lrsample.CXX
  • ENHKEYUSAGE : CreateCert.c
  • ENONE : HuError.h
  • Enqueue : list.h
  • EnqueueEvent() : configentry.c , configentry.h
  • EnqueueOverlappedOperation() : overlap.cpp
  • ENTER_SAMPLE_API : defs.h
  • ENTER_SAMPLE_WORKER : defs.h
  • EnterNew() : ComDlg32.h
  • EnterSampleAPI() : utils.c , utils.h
  • EnterSampleWorker() : utils.c , utils.h
  • ENTITY_BANKS : limits.h
  • ENTITY_PER_BANK : limits.h
  • EntityDelete() : data.Idl
  • EntityInsert() : data.Idl
  • EntityLoad() : data.Idl
  • EntityLookup() : data.Idl
  • EntityQuery() : data.Idl
  • EntityRead() : data.Idl
  • EntityUpdate() : data.Idl
  • ENTRY : secClnt.Cpp , secSvr.Cpp , secClnt.Cpp , secSvr.Cpp
  • Enum() : Sample1.Cpp , Sample1.h
  • ENUM_PERIOD : CeLibW2k.h
  • ENUM_PERIOD_DAYS : CeLibW2k.h
  • ENUM_PERIOD_HOURS : CeLibW2k.h
  • ENUM_PERIOD_INVALID : CeLibW2k.h
  • ENUM_PERIOD_MINUTES : CeLibW2k.h
  • ENUM_PERIOD_MONTHS : CeLibW2k.h
  • ENUM_PERIOD_SECONDS : CeLibW2k.h
  • ENUM_PERIOD_WEEKS : CeLibW2k.h
  • ENUM_PERIOD_YEARS : CeLibW2k.h
  • EnumAdvise() : ioo.h
  • EnumCalendarInfoProc() : nlsapi.c
  • EnumCoInit : bankdlg.h
  • EnumDAdvise() : ido.h
  • EnumDialogCallback() : msiloc.cpp
  • EnumDlgProc() : Dialogs.c , FontView.c
  • ENUMERATE_DIRECTORY_STACK : AsyncIO.h
  • ENUMERATE_DIRECTORY_STATE : AsyncIO.h
  • EnumerateAttributes() : policy.cpp , Policy.Cpp
  • EnumerateDirectoryTree() : AsyncIO.c , AsyncIO.h
  • EnumerateItems() : wiassamp.cpp
  • EnumerateJobs() : sa.Cpp
  • EnumerateLevel() : Monkey.c , Monkey.h
  • EnumerateObjectType() : app.cpp
  • EnumerateParent() : Sample1.Cpp , Sample1.h
  • EnumerateProviders() : install.h , provider.cpp
  • EnumerateSecurityPackagesW() : Stubs.c
  • EnumerateServers() : Tst4Wts.c
  • EnumerateUserQuotas() : Commands.Cpp , Commands.h
  • EnumerateUsers() : Commands.Cpp , Commands.h
  • EnumerateWiaDevices() : wiassamp.cpp
  • EnumerateWithRowsetPointer() : Sample1.Cpp , Sample1.h
  • Enumerator() : ATMEvent.h , Enumerator.Cpp
  • EnumFontNames() : FontView.c
  • ENUMFONTS : Common.h
  • EnumFontsProc() : Font.c
  • EnumFormatEtc() : ido.h
  • EnumLanguageCallback() : msiloc.cpp
  • EnumLDateFormatsProc() : nlsapi.c
  • ENUMLIST : Enumidl.h
  • EnumLocalesProc() : nlsapi.c
  • EnumMetafileExtractIcon() : Common.h , drawIcon.c
  • EnumMetafileExtractIconSource() : Common.h , drawIcon.c
  • EnumMetafileExtractLabel() : Common.h , drawIcon.c
  • EnumMetafileIconDraw() : Common.h , drawIcon.c
  • EnumObject() : enum.cxx , main.hxx
  • EnumObjects() : RendSam.Cpp
  • EnumPrinterDriversDlgProc() : Common.h , Enumprt.c
  • EnumPrintersDlgProc() : Common.h , Enumprt.c
  • EnumPrintersOptionsDlgProc() : Enumprt.c , Enumprt.h
  • EnumProcessListFunc() : DebMisc.c , DebMisc.h
  • ENUMPRTLOOKUP : Enumprt.h
  • EnumResNamesProc() : msistuff.cpp
  • EnumSDateFormatsProc() : nlsapi.c
  • EnumStringCallback() : msiloc.cpp
  • EnumTimeFormatsProc() : nlsapi.c
  • EnumVerbs() : ioo.h
  • EOAC_DYNAMIC_CLOAKING : Main.cpp
  • EofToken : HtmlScan.Hxx
  • EOL : common.h , sampprov.h , common.h
  • eOp : SimpleLog.Idl
  • EOSPEVENTS : myospobject.h
  • EP_ERRORINFO_ALWAYS : error.h
  • EP_ERRORINFO_FAILURE : error.h
  • EP_ERRORINFO_NEVER : error.h
  • EP_HRESULT_ALWAYS : error.h
  • EP_HRESULT_FAILURE : error.h
  • EP_HRESULT_NEVER : error.h
  • EP_HRESULT_NOERRORINFO : error.h
  • EP_IMALLOC_ALLOCS : error.h
  • EP_IMALLOC_SPY : error.h
  • EP_REFCOUNT_FAILURE : error.h
  • epChNil : string.Cpp , string.h
  • epEmptyString : string.h
  • EpGetEmptyString() : string.h
  • Epilog : Atsp.h
  • ePOTENTIAL : nshsamp.h
  • EPSILON : Track.c
  • EQUAL : common.h
  • EqualComputerName() : SubAuth.c
  • Erase() : PAPINT.Idl
  • EraseBackground() : MDIChild.C
  • Erased() : PAPINT.Idl
  • ERR : Overlap.c
  • ERR_911WARN : Dialer.h
  • ERR_CREATEDDB : Dibapi.h
  • ERR_CREATEPAL : Dibapi.h
  • ERR_DIBFUNCTION : Dibapi.h
  • ERR_ENDDOC : Dibapi.h
  • ERR_ENDPAGE : Dibapi.h
  • ERR_FILENOTFOUND : Dibapi.h
  • ERR_GETDC : Dibapi.h
  • ERR_INVALID_ERROR_CODE : nshsamp.h
  • ERR_INVALID_NUM_ARGS : nshsamp.h
  • ERR_INVALIDHANDLE : Dibapi.h
  • ERR_LINECLOSE : Dialer.h
  • ERR_LOCK : Dibapi.h
  • ERR_MAX : Dibapi.h
  • ERR_MEMORY : Dibapi.h
  • ERR_MIN : Dibapi.h
  • ERR_MOD_NAME : Enumprt.h , Getcaps.h , Getpdriv.h , Paint.h , Printer.h
  • ERR_NEWDEFAULT : Dialer.h
  • ERR_NEWFRAME : Dibapi.h
  • ERR_NO_VALID_COUNT : nshsamp.h
  • ERR_NOGDIMODULE : Dibapi.h
  • ERR_NOLINES : Dialer.h
  • ERR_NONE : Dialer.h
  • ERR_NOT_DIB : Dibapi.h
  • ERR_NOVOICELINE : Dialer.h
  • ERR_OPEN : Dibapi.h
  • ERR_READ : Dibapi.h
  • ERR_SAMP_BASE : nshsamp.h
  • ERR_SETABORTPROC : Dibapi.h
  • ERR_SETDIBITS : Dibapi.h
  • ERR_SETDIBITSTODEVICE : Dibapi.h
  • ERR_STARTDOC : Dibapi.h
  • ERR_STARTPAGE : Dibapi.h
  • ERR_STRETCHBLT : Dibapi.h
  • ERR_STRETCHDIBITS : Dibapi.h
  • errFormatMessage() : CeError.Cpp , ceerror.cpp
  • ErrLogFile : Admapit.c , AdminDll.c
  • ErrLogFileIP : AdminDll.c
  • ErrLogInValid : Admapit.c
  • ErrLogIPInValid : AdminDll.c
  • ErrMsgBox : Common.h
  • Error() : MqTrans.Cpp , adoint.h , enablerouter.c , rqsengine.h , DComPerm.Cpp , MidiPlyr.h , UIUTILS.c , MSMQTest.c , msiloc.cpp
  • ERROR_BUFFER_SIZE : DebMisc.c
  • ERROR_COLUMN : bankdlg.Cpp
  • Error_get_Description_Proxy() : adoint.h
  • Error_get_Description_Stub() : adoint.h
  • Error_get_HelpContext_Proxy() : adoint.h
  • Error_get_HelpContext_Stub() : adoint.h
  • Error_get_HelpFile_Proxy() : adoint.h
  • Error_get_HelpFile_Stub() : adoint.h
  • Error_get_NativeError_Proxy() : adoint.h
  • Error_get_NativeError_Stub() : adoint.h
  • Error_get_Number_Proxy() : adoint.h
  • Error_get_Number_Stub() : adoint.h
  • Error_get_Source_Proxy() : adoint.h
  • Error_get_Source_Stub() : adoint.h
  • Error_get_SQLState_Proxy() : adoint.h
  • Error_get_SQLState_Stub() : adoint.h
  • ERROR_IN_ROW_DATA : cdbfile.h
  • ERROR_INSUFFICIENT_FUNDS : common.h
  • ERROR_LENGTH : ErrorOut.h
  • ERROR_MAX : ErrorOut.h
  • ERROR_MODE_PRINTFIELDS : UtilLib.h
  • ERROR_MODE_PRINTMOF : UtilLib.h
  • ERROR_MSG : Global.h
  • ERROR_TITLE_STR : AppUtil.h
  • ErrorBox() : AppUtil.Cpp , errors.c , errors.h
  • ErrorBoxID() : register.Cpp
  • ErrorCode_e : HuError.h
  • ErrorHandler : VListVw.c , Globals.h
  • ErrorHandlerEx() : VListVw.c , Main.c , Globals.h
  • ErrorIf() : msiloc.cpp
  • ErrorLogInValid : AdminDll.c
  • ERRORMAP : error.cpp
  • ErrorMessage() : Util.Cpp , Util.h , secClnt.Cpp , secSvr.Cpp
  • ErrorMessageBox() : DebMisc.c , DebMisc.h
  • ErrorMsg() : WbemClientDlg.Cpp , Global.h , Debug.Cpp
  • ErrorOut() : FTPJr.cpp , HeadDump.cpp
  • ERRORPOST : error.h
  • Errors : adoint.h
  • Errors_Clear_Proxy() : adoint.h
  • Errors_Clear_Stub() : adoint.h
  • Errors_get_Item_Proxy() : adoint.h
  • Errors_get_Item_Stub() : adoint.h
  • ERRORSTART : HuError.h
  • ErrorString() : AdvClientdlg.cpp , AdvClientdlg.h
  • ErrorsVtbl : adoint.h
  • ErrorValueEnum : adoint.h
  • ErrorVtbl : adoint.h
  • ErrorWithFile() : Utility.h , Utility.c
  • ERRSHANDLE : quiktest.h
  • ErrsHandle() : quiktest.c
  • errString() : Dialer.c
  • ES_AUTOHSCROLL : winres.h
  • ES_AUTOVSCROLL : winres.h
  • ES_CENTER : winres.h
  • ES_LEFT : winres.h
  • ES_LOWERCASE : winres.h
  • ES_MULTILINE : winres.h
  • ES_NOHIDESEL : winres.h
  • ES_OEMCONVERT : winres.h
  • ES_PASSWORD : winres.h
  • ES_READONLY : winres.h
  • ES_RIGHT : winres.h
  • ES_UPPERCASE : winres.h
  • ES_WANTRETURN : winres.h
  • ESQL_CREATE_TABLE : table.h
  • ESQL_DROP_TABLE : table.h
  • ESQL_INSERT : table.h
  • ESQL_SELECT : table.h
  • ESQL_STMT : table.h
  • ESTABLISHCONNECTIONMSG : Handler.h
  • EvalThisChar : PerfUtil.c
  • EVENT : SMFI.h
  • EVENT_CH_B1 : SMFI.h
  • EVENT_CH_B2 : SMFI.h
  • EVENT_ENTRY : configentry.h
  • EVENT_LENGTH : Resource.h
  • EVENT_LEVEL_DEFAULT : tracedmp.h
  • EVENT_META_TYPE : SMFI.h
  • EVENT_SINK_INFO : selectEventsDlg.Cpp
  • EVENT_TYPE : SMFI.h
  • EVENT_TYPE_DEFAULT : tracedmp.h
  • EVENT_VERSION_DEFAULT : tracedmp.h
  • EVENTCLASS : EvProv.h
  • EventCount : TraceDp.c
  • EventEnum : comspyctl.idl , ComSpyCtl.Idl , MtsSpyCtl.Idl
  • EventFlags : WaitSystemDlg.Cpp
  • EventInfo : selectEventsDlg.Cpp
  • EventListHead : tracedmp.cpp , tracewmi.cpp
  • Events : WaitSystemDlg.h
  • EventStore : comspyctl.idl
  • EvmFile : tracedmp.cpp
  • EX_BUF : common.h
  • EXACT_MATCH : MfEdit.h
  • Exception : comspyctl.idl
  • EXCEPTION_VDM_EVENT : DebDebug.h
  • ExecEndTran() : quiktest.c
  • ExecSQLStmt() : Driver.Cpp
  • ExecUrlCompletion() : WildCardMap.cpp
  • ExecuteOptionEnum : adoint.h
  • ExecuteOverlappedOperation() : overlap.cpp
  • ExecuteQuery() : Consumer.Cpp
  • ExecuteStatement() : MqTrans.Cpp
  • ExecuteUpgradeMsi() : setup.h , upgrdmsi.cpp
  • ExecuteVerifyUpdate() : setup.h , upgrdmsi.cpp
  • EXECUTION_FAILED : Common.h
  • EXECUTION_OK : Common.h
  • Exists() : mwclass.Cxx
  • exit : Adminwrap.Cpp
  • EXIT_IF_FAIL : common.h , Common.h , common.h
  • exitGetProperty() : exit.h , exit.cpp
  • exitGetRequestAttribute() : exit.cpp
  • ExNames : common.h
  • EXPAND_FILE : cdbfile.h
  • expand_include : sdkdiff.cpp , sdkdiff.h
  • expand_mode : sdkdiff.cpp , sdkdiff.h
  • EXPENSE_APPROVED : common.h
  • EXPENSE_UNKNOWN_ERROR : common.h
  • EXPORT : SimpCntr.h , OleStd.h
  • EXPORT_TYPE_UNDEFINED : AppExportDlg.Cpp
  • EXPORT_TYPE_WITH_CLIENTS : AppExportDlg.Cpp
  • EXPORT_TYPE_WITH_USERS : AppExportDlg.Cpp
  • EXPORT_TYPE_WITHOUT_USERS : AppExportDlg.Cpp
  • ExportTx() : RmWorker.Idl , CopyFileRm.Idl
  • EXT_WSPPROC_TABLE : provider.h
  • ExtAcceptEx() : extension.cpp , provider.h
  • ExtConnectEx() : provider.h , extension.cpp
  • ExtDisconnectEx() : provider.h , extension.cpp
  • EXTEND_SIZE : PerfUtil.c
  • EXTENDED_LOCAL_NUMBER : Dialer.c
  • EXTENDED_LONG_DISTANCE_NUMBER : Dialer.c
  • ExtendVirtualBuffer() : AsyncIO.c , AsyncIO.h
  • EXTENSION_TYPE : extend.h
  • ExtensionCallback() : FaxSiren.Cpp
  • EXTENSIONFRIENDLYNAME : FaxSiren.Cpp
  • EXTENSIONNAME : FaxSiren.Cpp
  • EXTENSIONPATH : FaxSiren.Cpp
  • EXTERN_GUID() : dbauth.idl , sdksamplestorageplugin.idl , proxyplugin.idl , Authenticate.idl , dbauth.idl , ContextDll.idl , dbauth.idl , Authenticate.idl , dbauth.idl , Authenticate.idl , sdksamplestorageplugin.idl , ContextDll.idl , proxyplugin.idl , ContextDll.idl
  • EXTFUN : autotest.h
  • EXTFUNCDECL : autotest.h
  • EXTRA_COLUMNS : row.h
  • ExtractBaseNodePtr() : globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • ExtractDataObjPtr() : globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp
  • ExtractDlgProc() : Icons.C
  • ExtractFromDataObject() : dataobj.h , globals.cpp , dataobj.h , globals.cpp , dataobj.h , globals.h , dataobj.h , Dataobj.h , globals.cpp , globals.h , dataobj.h , globals.h , globals.cpp , dataobj.h , globals.cpp , globals.h , dataobj.h , globals.h , dataobj.h
  • ExtractNodeTypeFlg() : globals.cpp , globals.h
  • ExtTransmitFile() : provider.h , extension.cpp
  • ExtTransmitPackets() : extension.cpp , provider.h
  • ExtWSARecvMsg() : provider.h , extension.cpp
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- f -

  • f1() : BPSampTest.c
  • f2() : BPSampTest.c
  • f3() : BPSampTest.c
  • F_ANSIONLY : Font.h
  • F_FIXEDPITCHONLY : Font.h
  • F_NOOEMFONTS : Font.h
  • F_NOSIMULATIONS : Font.h
  • F_NOVECTORFONTS : Font.h
  • F_PRINTERFONTS : Font.h
  • F_SCALABLEONLY : Font.h
  • F_SCREENFONTS : Font.h
  • F_TTONLY : Font.h
  • F_WYSIWYG : Font.h
  • FACILITY_ADSI : IADsError.cpp
  • FACILITY_DELAYLOAD : CeError.Cpp
  • FACILITY_MASK : MsgTest.c
  • FAIL_PRINT : enablerouter.c
  • FAILURE : FCopy.Cpp
  • FakeMenuDemo_OnContextMenu() : fakemenu.c
  • FakeMenuDemo_OnEraseBkgnd() : fakemenu.c
  • FakeMenuDemo_WndProc() : fakemenu.c
  • false : dbh.cpp
  • FALSE : LinkList.h
  • FAR : GssAPI.h
  • fASynchronous : main.cxx
  • fAttrsOnly : main.cxx
  • fAutoExpand : sdkdiff.cpp
  • FAutoRegister() : OleApt.Cpp , ComPerf.Cpp , OleImp.Cpp , secSvr.Cpp
  • FAX_PROVIDERS_REGKEY : Reg.h
  • FaxDevAbortOperation() : NewFsp.c
  • FaxDevEndJob() : NewFsp.c
  • FaxDevInitialize() : NewFsp.c
  • FaxDevReceive() : NewFsp.c
  • FaxDevReportStatus() : NewFsp.c
  • FaxDevSend() : NewFsp.c
  • FaxDevStartJob() : NewFsp.c
  • FaxDevVirtualDeviceCreation() : NewFsp.c
  • FaxLineCallback() : NewFsp.c
  • FaxRouteAddFile : FaxSiren.Cpp
  • FaxRouteDeleteFile : FaxSiren.Cpp
  • FaxRouteDeviceChangeNotification() : FaxSiren.Cpp
  • FaxRouteDeviceEnable() : FaxSiren.Cpp
  • FaxRouteEnumFiles : FaxSiren.Cpp
  • FaxRouteGetFile : FaxSiren.Cpp
  • FaxRouteGetRoutingInfo() : FaxSiren.Cpp
  • FaxRouteInitialize() : FaxSiren.Cpp
  • FaxRouteModifyRoutingData : FaxSiren.Cpp
  • FaxRouteSetRoutingInfo() : FaxSiren.Cpp
  • FAXSIREN : FaxSiren.Cpp
  • FAXSIRENFRIENDLYNAME : FaxSiren.Cpp
  • FAXSIRENFUNCTION : FaxSiren.Cpp
  • FAXSIRENMETHOD : FaxSiren.Cpp
  • fBindParameter : quiktest.c
  • fBusy : sdkdiff.cpp
  • fCacheInitialized : cache.c
  • FcCloseFile() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • fClassRegistered : Server.Cxx
  • fClientActiveReqCountersCreated : Service.cpp , filerepservice.cpp
  • fClientActiveReqHashCountersCreated : Service.cpp , filerepservice.cpp
  • fClientActiveReqHashQueuesCreated : filerepservice.cpp
  • fClientAuth : WebServer.c
  • fClientReqCountersCreated : Service.cpp , filerepservice.cpp
  • fClientReqQueuesCreated : Service.cpp , filerepservice.cpp
  • fCloseApp : threads.c
  • FcOpenFile() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • FcReadFromFile() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • fCreate : OleStd.h
  • FCreateAppWindow() : Main.Cpp
  • FCreateChatWindow() : Init.Cpp
  • FCreateEditWindow() : Main.Cpp
  • FCreateLView() : Init.Cpp
  • FCreateMsgWindow() : Main.Cpp , Init.Cpp
  • FCreateSbar() : Global.h , sBar.Cpp
  • FCreateTbar() : Global.h , sBar.Cpp
  • FCreateUserList() : Main.Cpp
  • FD_SETSIZE : pchsample.h
  • fDebug : exit.cpp , Exit.Cpp , policy.cpp , policy.h , Policy.Cpp
  • fDeleteOnRelease : OleStd.h
  • fDerefAliases : main.cxx
  • fDiagFieldSupported : quiktest.c
  • fDiagRecSupported : quiktest.c
  • FDImage() : ASAccept.cpp
  • FDotPsffs : wn_dos.h
  • fDraw : OleStd.h
  • fdwProperty : Main.C , Data.c , IMEApps.h
  • FEmptySz : Global.h
  • fEnable : msgfiltr.h
  • fEndProgram : rnrcs.cpp
  • fEnhEncrypted : DirEncrypt.Cpp
  • FEqSumInfFMTID : suminfo.h
  • FETCH_SUCCESS : cdbfile.h
  • FetchData() : adoisapi.cpp
  • fFalse : suminfo.Cpp
  • FFileExists() : Global.h , Util.Cpp
  • fFinished : DebDebug.c
  • FFSTREAM : FindStream.c
  • FFSTREAMMAGIC : FindStream.c
  • FGetDirectory() : Global.h , Util.Cpp
  • FGetFileName() : Global.h , Util.Cpp , Global.h , Util.Cpp
  • FHfileToSffsDate : wn_dos.h
  • FIconFileFromClass() : getIcon.c , Utility.h
  • Field : adoint.h , data.Idl
  • Field_AppendChunk_Proxy() : adoint.h
  • Field_AppendChunk_Stub() : adoint.h
  • Field_get_ActualSize_Proxy() : adoint.h
  • Field_get_ActualSize_Stub() : adoint.h
  • Field_get_Attributes_Proxy() : adoint.h
  • Field_get_Attributes_Stub() : adoint.h
  • Field_get_DefinedSize_Proxy() : adoint.h
  • Field_get_DefinedSize_Stub() : adoint.h
  • Field_get_Name_Proxy() : adoint.h
  • Field_get_Name_Stub() : adoint.h
  • Field_get_NumericScale_Proxy() : adoint.h
  • Field_get_NumericScale_Stub() : adoint.h
  • Field_get_OriginalValue_Proxy() : adoint.h
  • Field_get_OriginalValue_Stub() : adoint.h
  • Field_get_Precision_Proxy() : adoint.h
  • Field_get_Precision_Stub() : adoint.h
  • Field_get_Type_Proxy() : adoint.h
  • Field_get_Type_Stub() : adoint.h
  • Field_get_UnderlyingValue_Proxy() : adoint.h
  • Field_get_UnderlyingValue_Stub() : adoint.h
  • Field_get_Value_Proxy() : adoint.h
  • Field_get_Value_Stub() : adoint.h
  • Field_GetChunk_Proxy() : adoint.h
  • Field_GetChunk_Stub() : adoint.h
  • Field_put_Value_Proxy() : adoint.h
  • Field_put_Value_Stub() : adoint.h
  • FieldAttributeEnum : adoint.h
  • FIELDINFO : quiktest.h
  • FieldMetaData : pooleddata.h
  • FIELDNAME_MAXSIZE : limits.h
  • Fields : adoint.h
  • Fields_get_Item_Proxy() : adoint.h
  • Fields_get_Item_Stub() : adoint.h
  • FieldsVtbl : adoint.h
  • FieldVtbl : adoint.h
  • FILE_AND_WINDOW : Dt.h
  • file_checksum() : file.cpp , file.h
  • FILE_COUNT : DragImg.Cpp
  • file_delete() : file.cpp , file.h
  • FILE_DEVICE_SCSI : CStorageResource.cpp
  • file_discardlines() : file.cpp , file.h
  • FILE_EXT : DoServer.h
  • file_getdiritem() : file.cpp , file.h
  • file_getlinelist() : file.cpp , file.h
  • file_GetTime() : file.cpp , file.h
  • file_IsUnicode() : file.cpp , file.h
  • FILE_MAPPING_BASE_NAME : Sockdups.c
  • file_new() : file.cpp , file.h
  • FILE_ONLY : Dt.h
  • FILE_OPERATION : RmWorker.Idl
  • File_Print_Connection0() : Admapit.c
  • File_Print_Connection1() : Admapit.c
  • File_Print_RAS_PORT0() : Admapit.c
  • File_Print_RAS_PORT1() : Admapit.c
  • File_Print_RasConnection() : AdminDll.c
  • File_Print_RasPort() : AdminDll.c
  • file_readlines() : file.cpp
  • file_reset() : file.cpp , file.h
  • file_retrievechecksum() : file.cpp , file.h
  • FILE_SIZE_EXTENSION : FileRepClientProc.cpp
  • FILE_VERSION : bankdlg.Cpp
  • FILEBUFFER : gutils.h
  • FileCopyTx() : CopyFileRm.Idl
  • FILEDATA : file.h
  • FileDeleteTx() : RmWorker.Idl , CopyFileRm.Idl
  • FileExist() : AppUtil.Cpp , AppUtil.h
  • FILEHDR : SMFI.h
  • FILEINFO : MfEdit.h
  • FileMoveTxt() : RmWorker.Idl , CopyFileRm.Idl
  • FILENAME : SecFile.c
  • FILENAME_OFFSET : spy.cpp
  • FILENAMESIZE : Open.h , spy.cpp
  • FILEOBJECT : Handler.h
  • FILEOBJECTLIST : Handler.h
  • FileRenameTx() : RmWorker.Idl , CopyFileRm.Idl
  • FileSaveHookProc() : Dlgopen.c
  • FileShare : resource.h
  • FILESHARESAMPLE_PROPS : File Share Sample.cpp
  • FILESHARESAMPLE_RESOURCE : File Share Sample.cpp
  • FILESHARESAMPLE_SVCNAME : ClRes.h
  • FileShareSampleCheckIsAlive() : File Share Sample.cpp
  • FileShareSampleClose() : File Share Sample.cpp
  • FileShareSampleDllMain() : ClRes.h , File Share Sample.cpp
  • FileShareSampleGetPrivateResProperties() : File Share Sample.cpp
  • FileShareSampleIsAlive() : File Share Sample.cpp
  • FileShareSampleLooksAlive() : File Share Sample.cpp
  • FileShareSampleOffline() : File Share Sample.cpp
  • FileShareSampleOfflineThread() : File Share Sample.cpp
  • FileShareSampleOnline() : File Share Sample.cpp
  • FileShareSampleOnlineThread() : File Share Sample.cpp
  • FileShareSampleOpen() : File Share Sample.cpp
  • FileShareSampleResourceControl() : File Share Sample.cpp
  • FileShareSampleResourcePrivateProperties : File Share Sample.cpp
  • FileShareSampleResourceTypeControl() : File Share Sample.cpp
  • FileShareSampleSetNameHandler() : File Share Sample.cpp
  • FileShareSampleSetPrivateResProperties() : File Share Sample.cpp
  • FileShareSampleStartup() : ClRes.h , File Share Sample.cpp
  • FileShareSampleTerminate() : File Share Sample.cpp
  • FileShareSampleValidatePrivateResProperties() : File Share Sample.cpp
  • FILETIME : scandir.h
  • FileTime : PrPerf.c
  • FILETITLESIZE : Open.h
  • FileViewerFrameProc() : FVProc.Cpp , FVText.h
  • FillColorDlg() : Colors.c
  • FillCountryCodeList() : TapiCode.c
  • FillDevmodeDlg() : Print.c
  • FillDevnamesDlg() : Print.c
  • FillEnumFields() : Dialogs.c
  • FillFindDlg() : Find.c
  • FillFontDlg() : Font.c
  • FillFontsBox() : Font.c
  • FillInParam() : FontView.c
  • FillInValue() : FontView.c
  • FillLocationInfo() : TapiCode.c
  • FillLogFontDlg() : Font.c
  • FillMenuItemInfo() : ImeMenu.c
  • FillOpenDlg() : Open.c , Open.h
  • FillOut() : Fx.c , Fx.h
  • FillPrintDlg() : Print.c
  • FillTAPILine() : TapiCode.c
  • FILTER_ATTRIBUTES : Utility.h
  • FILTER_MASK_DESTINATION_ADDRESS : parser.h
  • FILTER_MASK_DESTINATION_PORT : parser.h
  • FILTER_MASK_SOURCE_ADDRESS : parser.h
  • FILTER_MASK_SOURCE_PORT : parser.h
  • FILTER_STATE : Redir401.cpp
  • FilterGroupEnum : adoint.h
  • FilteringContent : PropTag.Hxx
  • FilteringProperty : PropTag.Hxx
  • FilteringPropertyButContentNotFiltered : PropTag.Hxx
  • FilteringValue : MetaTag.Hxx
  • FilteringValueProperty : PropTag.Hxx
  • FilterType : appinfo.h
  • FILTERTYPE : appinfo.h
  • Finalize() : AdminDll.c
  • FindAddress() : tapisend.cpp
  • FindAllUsersInGC() : gcallusers.cpp
  • FindAnAddress() : Outgoing.Cpp
  • FindAndActivateCReq() : FileRepClientProc.cpp
  • FindAndActivateSReq() : FileRepServerProc.cpp
  • FindAndLockSocketContext() : provider.h , sockinfo.cpp
  • FindAttribFromName() : UserProps.cpp
  • FindAttribute() : DialIn.c
  • FindAttributesByType() : attributes.cpp
  • FindAttributesOrClasses() : getschemainfo.cpp
  • FindAudioStream() : tapisend.cpp
  • FindCertificate() : CreateCert.c , CreateCert.h
  • FindChar() : Display.c , FontView.c
  • FindClerks() : CrmMonComp.Idl
  • FindCloseStream() : FindStream.c , FindStream.h
  • FindConnectionByName() : main.cpp
  • FindCReq() : FileRepClientProc.cpp
  • FindDelimiters() : compitem.cpp
  • FindDIBBits() : Dibapi.h , Dibutil.c , Dib.c , Dib.h
  • FindDlgProc() : findgoto.cpp , findgoto.h , sdkdiff.h
  • FindEndOfMatched() : section.cpp
  • FindEndOfUnmatched() : section.cpp
  • FindError() : quiktest.c
  • FindFirstStream() : FindStream.c , FindStream.h
  • FindFirstWithLink() : section.cpp
  • FindGCAttributes() : attributes.cpp
  • findImportPool() : app.cpp
  • FindIndexedAttributes() : attributes.cpp
  • FindItemData() : IMEApps.h , ImeMenu.c
  • FindKey() : keys.cpp , keys.h
  • findLibrary() : app.cpp
  • FindList : list.h
  • findMediaType() : app.cpp
  • FindNextChange : sdkdiff.cpp
  • FindNextStream() : FindStream.c , FindStream.h
  • FindNumWithParameter() : dxsurf3.cpp
  • FindOneOf() : ComSpy.Cpp , fullsvr.Cpp , Server.Cpp , OPBank.Cpp , EdCommands.cpp , EdGlyphs.cpp , EdHost.cpp
  • FindParameter() : dxsurf3.cpp
  • FindPrevChange : sdkdiff.cpp
  • FindProc() : Find.c , Find.h
  • FindProperty() : property.cpp , property.h
  • FindPropSet() : property.cpp , property.h
  • FindReplaceHookProc() : Find.c
  • FindServiceProvider() : Findsp.Cpp , QosEvent.h
  • FindSlot() : OleImp.Cpp
  • FindSortedList : list.h
  • FindSReq() : FileRepServerProc.cpp
  • FindString() : findgoto.h , findgoto.cpp
  • FindUserByName() : bindtoparent.cpp , objectSid.cpp , iasuser.cpp
  • FindUsers() : queryusers.cpp
  • FINISH_SAMPLE_IO : socket.c
  • FInitApp() : Global.h , Main.Cpp , Init.Cpp
  • FInitMain() : Main.Cpp , Init.Cpp
  • FInitNm() : CConf.Cpp , CConf.h
  • FInitPref() : Main.Cpp
  • fInsertMode : FullIME.h , Global.C , Main.C
  • FIntelOrder : suminfo.h
  • First_Call : Admapit.c , AdminDll.c
  • FIRST_FREE : AppMemi.h
  • FIRST_INUSE : AppMemi.h
  • FIRST_MDI_CHILD : resource.h
  • FirstAce : AuthzSvr.c
  • FirstCall : Admapit.c
  • FIRSTCOL : FullIME.h , HalfIME.h
  • FIRSTROW : FullIME.h , HalfIME.h
  • fIsLink : OleStd.h
  • FitTextToButton() : Dialer.c
  • flags : Cursor.c
  • fLastReleaseCloses : iec.h
  • FlushMofList() : tracewmi.cpp
  • fMachineStore : WebServer.c
  • fmtid : writeread.cpp
  • FMTID_FullPath : columnprovider.Cpp
  • FMTID_ShortFilename : columnprovider.Cpp
  • fnAdd() : dbh.cpp
  • fnAddr() : dbh.cpp
  • fnBase() : dbh.cpp
  • fnDelete() : dbh.cpp
  • fnEnum() : dbh.cpp
  • fnEnumForAddr() : dbh.cpp
  • FNEXPORT : GLOBAL.h
  • fnFindFile() : dbh.cpp
  • FNGLOBAL : GLOBAL.h
  • fnHelp() : dbh.cpp
  • fnInfo() : dbh.cpp
  • fnLine() : dbh.cpp
  • fnLineNext() : dbh.cpp
  • fnLinePrev() : dbh.cpp
  • fnLoad() : dbh.cpp
  • FNLOCAL : GLOBAL.h
  • fnLocals() : dbh.cpp
  • fnName() : dbh.cpp
  • fnNext() : dbh.cpp
  • fnNextPrev() : dbh.cpp
  • fnPrev() : dbh.cpp
  • fnQuit() : dbh.cpp
  • fnType() : dbh.cpp
  • fnUndec() : dbh.cpp
  • fnUnload() : dbh.cpp
  • fnVerbose() : dbh.cpp
  • fnWscUpdateProvider : instlsp.cpp
  • Font() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • FONT_TYPE_WYSIWYG : Font.c
  • FontDlgProc() : global.h
  • FontHookProc() : Font.c
  • FONTLIST : Dialogs.c
  • FONTNAME : TextFx.c
  • FontProc() : Font.c , Font.h
  • FONTSIZEDELTALARGE : FVText.h
  • FONTSIZEDELTAMEDIUM : FVText.h
  • FONTSIZEDELTASMALL : FVText.h
  • FONTSIZETHRESHOLDLOW : FVText.h
  • FONTSIZETHRESHOLDMAX : FVText.h
  • FONTSIZETHRESHOLDMID : FVText.h
  • FONTSIZETHRESHOLDMIN : FVText.h
  • FONTSTRUCT : Dialogs.c
  • FontThreadProc1() : Font.c
  • FontThreadProc2() : Font.c
  • Foo : suminfo.Cpp
  • FOOTERSIZE : spy.cpp
  • for() : Utils.Cpp , suminfo.Cpp
  • FOREIGN_STRING : PerfUtil.c , PerfUtil.h
  • Forever : Stubs.c
  • Format() : utils.cpp , gutils.h
  • FORMAT_NAME_LIST_LEN : drawdlg.cpp
  • FormatAddress() : resolve.c , resolve.h , resolve.cpp , resolve.h , resolve.c , resolve.h
  • FormatDateTime() : Helper.Cpp , Helper.h
  • FormatError() : QSample.Cxx , ClipBook ServerEx.h , File Share SampleEx.cpp , File Share SampleEx.h , ClipBook ServerEx.cpp
  • FORMATETC_MAX : OleStd.c
  • FORMATFLOAT : WxForm.h
  • FormatLastError() : TapiInfo.h , TapiInfo.c
  • FormatLineCallback() : TapiInfo.h , TapiInfo.c
  • FormatLineError() : TapiInfo.h , TapiInfo.c
  • FormattedRecord() : CrmMonComp.Idl
  • FORWARD_WM_MOVING : Globals.h
  • FOsfnIsFile() : wn_dos.h
  • FOURCC_data : SMFI.h
  • FOURCC_MThd : SMFI.h
  • FOURCC_MTrk : SMFI.h
  • FOURCC_RMID : SMFI.h
  • fpCharSetProc : FontView.c
  • fpGlyphProc : FontView.c
  • FPrintResults() : ComPerf.Cpp
  • fQueueEmpty : ThreadPool.c
  • fr : Find.c
  • FRAGMENT_HEADER_PROTOCOL : rawudp.c
  • FrameWindow() : WinCap.c , WinCap.h
  • FRAMEWL_STRUCTURE : Framer.h
  • FrameWndProc() : Framer.Cpp , Framer.h
  • FRAMING_LEGACY_PSTN : iplgxprt.idl
  • FRAMING_X224 : iplgxprt.idl
  • fRDM : PrPerf.c
  • FREE : dballoc.Cpp , Alloc.Cpp
  • Free() : MfEdit.h
  • FREE() : Alloc.h
  • Free : ATMEvent.h , MfEdit.c
  • FREE : PropCert.Cpp , defs.h
  • FREE_BSTR : main.hxx
  • FREE_BSTR_IF : Utils.h
  • FREE_INTERFACE : main.hxx
  • FREE_MEM : main.c
  • FREE_NOT_NULL : defs.h
  • FREE_OFFSET : Resource.h
  • FREE_UNICODE_STRING : main.hxx
  • FreeAllApps() : chWnd.Cpp , cShare.h
  • FreeAllComObjects() : Global.h , Init.Cpp
  • FreeAllocatedMemory() : LeakyBin.c
  • FreeAllUsers() : cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp
  • FreeApplet() : applet.h , applet.cpp
  • FreeAppSecurityDescriptor() : Util.h , Util.Cpp
  • FreeAppShareChannel() : cShare.h , cshare.h , cShare.Cpp
  • FreeAs() : CChan.h , cshare.cpp
  • FreeBindingData() : common.cpp , common.h , common.cpp
  • FreeBindings() : common.cpp , common.h , common.cpp
  • FreeBuffer() : spi.cpp , provider.h
  • FreeCalls() : CCall.Cpp , CCall.h
  • FreeChannels() : CChan.Cpp , CChan.h
  • FreeColAccess() : common.cpp , common.h
  • FreeConference() : conf.cpp , conf.h , CConf.Cpp , CConf.h , CConf.Cpp
  • FreeConferences() : CConf.Cpp , CConf.h
  • FreeConfMgr() : conf.cpp , CConf.Cpp , cMgr.Cpp , CConf.h , cMgr.h , CConf.h , conf.h , CConf.Cpp
  • FreeConnection() : bankdlg.Cpp , bankthrds.Cpp
  • FreeConstraintDesc() : common.cpp , common.h
  • FreeContextBuffer() : Stubs.c
  • FreeCredentialsHandle() : Stubs.c
  • FreeData() : common.cpp , common.h
  • FreeDataChannel() : cData.Cpp , cData.h
  • FreeDllNodeInfo() : DebDebug.c
  • FreeDynamicReadwriteLock() : sync.c
  • FreeEventInfo() : dtevntsk.cpp
  • FreeEventItem() : mspaddr.cpp
  • FreeFontList() : Paint.h , Paint.c
  • FreeFreeAutoTest() : ComPerf.Cpp
  • FreeFreeCOMTest() : ComPerf.Cpp
  • FreeFt() : CChan.h , cft.cpp
  • FreeFtChannel() : CConf.Cpp
  • FreeGlobalObjects() : server.cpp
  • FreeJobs() : queue.h , queue.c
  • FreeKeyList() : keys.h , keys.cpp
  • FreeList : list.h , RPCssmc.c
  • FREELOCALSTRING : ansiapi.h
  • FreeLspMap() : instlsp.cpp
  • FreeMemory() : common.h , tapirecv.cpp , common.h , tapisend.cpp
  • FreeNmObjects() : CConf.h , CConf.Cpp
  • FreeNullDacl() : RegisterServer.Cpp
  • FreeODBCHandles() : MqTrans.Cpp
  • FreePlpv() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h , Util.Cpp
  • FreePool : overlap.cpp
  • FreeProcessNodeInfo() : DebDebug.c
  • FreeProperties() : asserts.cpp , property.cpp , property.h , property.cpp , property.h , asserts.cpp , property.h , property.cpp , property.h , asserts.h , property.cpp , property.h , asserts.h
  • FreeProviders() : provider.cpp , install.h
  • FreeQueue : list.h
  • FreeQueueData() : queue.h , queue.c
  • FreeRecvBuffer() : TestAccept.cpp
  • FreeSendBuffer() : TestAccept.cpp
  • FreeShareList() : Dlg.Cpp
  • FREESIGN : spy.cpp
  • FreeSocket() : Ioctl.c
  • FreeSocketsAndMemory() : spi.cpp
  • FreeSockInfo() : provider.h , sockinfo.cpp , common.h , SockInfo.cpp
  • FreeStack : list.h
  • FreeStmt() : quiktest.c
  • FreeStyle() : Style.Cpp
  • FreeStyles() : Style.Cpp , Global.h
  • FreeThreadNodeInfo() : DebDebug.c
  • FreeUnicodeString() : util.cxx , main.hxx , util.cxx
  • FreeUser() : cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h
  • FreeVariants() : property.cpp , property.h
  • FreeVblandPdu() : WSnmpUtil.Cpp , WSnmpUtil.h
  • FreeVirtualBuffer() : AsyncIO.c , AsyncIO.h
  • FreeWindowInfo() : Wininfo.c , GdiDemo.h
  • fSecurityLockedForAnnotations : suminfo.h
  • fSecurityPassworded : suminfo.h
  • fSecurityRO : suminfo.h
  • fSecurityRORecommended : suminfo.h
  • fServerActiveReqCountersCreated : Service.cpp
  • fServerActiveReqHashCountersCreated : Service.cpp
  • FServerFromClass() : Utility.c , Utility.h
  • fServerReqCountersCreated : Service.cpp , filerepservice.cpp
  • fServerReqQueuesCreated : Service.cpp
  • fShowCand : IMEApps.h , Data.c
  • fSizeLimit : main.cxx
  • fStarted : Bcast.c
  • fSummaryOnly : tracedmp.cpp
  • FSzEqPropStreamName : suminfo.h
  • fTimeLimit : main.cxx
  • FtpEnumDirectory() : FTPJr.cpp
  • fTrue : suminfo.Cpp
  • FULL_PATH_VALUE : RecoDll.cpp
  • FullDisconnect() : quiktest.c
  • FullViewWndProc() : WinCap.h , WinCap.c
  • FUNC_INFO : Atsp.h
  • FUNDSRM : AuthzSvr.c
  • fuOptions : OleStd.h
  • fUseProxy : WebClient.c
  • FVerbGet() : Utility.h
  • fVerbose : WebServer.c , WebClient.c
  • fVerify : PrPerf.c
  • FVerifyFile() : Main.Cpp
  • FVWL_OBJECTPOINTER : FVText.h
  • FWPRINTF : UtilLib.h
Generated on Wed Nov 13 2024 16:58:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- g -

  • g_AcceptContext : common.h , main.cpp
  • g_aCounterProps : BasicHiPerf.Cpp
  • g_aCounters : RefClint.Cpp
  • g_aCSAddr : rnrcs.cpp
  • g_adwSampleMenuHelpIDs : TapiCode.c
  • g_aEntries : HtmlProp.Cxx
  • G_ALLOC : LeakyBin.h
  • g_aSock : rnrcs.cpp
  • g_aSockAddr : rnrcs.cpp
  • g_aut : CeLib.Cpp , celib.cpp , CeLib.Cpp , celib.cpp , CeLib.Cpp
  • g_bAbort : tprint.cpp
  • g_bActive : dxsurf1.cpp , dxsurf2.cpp
  • g_bAssertOnErrors : bankdlg.Cpp , bankthrds.Cpp
  • g_bBrighten : dxsurf2.cpp
  • g_bCallStateReceived : TapiCode.c
  • g_bConnected : TapiCode.c
  • g_bEndServer : IocpServer.Cpp , IocpServerex.Cpp
  • g_bExitRequested : tapisend.cpp
  • g_bFontCharSet : sdkdiff.cpp
  • g_bInitializing : TapiCode.c
  • g_bInProc : MethCli.Cpp , security.cpp
  • g_bnds : dxsurf2.cpp
  • g_bndsMod : main.cpp
  • g_bndsWnd : main.cpp
  • g_bReplyRecieved : TapiCode.c
  • g_bRestart : IocpServer.Cpp , IocpServerex.Cpp
  • g_bRetry : bankdlg.Cpp , bankthrds.Cpp
  • g_bShuttingDown : TapiCode.c
  • g_bStop : bankdlg.Cpp , bankthrds.Cpp
  • g_bStopOnODBCErrors : bankdlg.Cpp , bankthrds.Cpp
  • g_bStoppingCall : TapiCode.c
  • g_bstrAllApps() : selectEventsDlg.Cpp
  • g_bstrAppType_Application() : selectEventsDlg.Cpp
  • g_bstrAppType_Process() : selectEventsDlg.Cpp
  • g_bstrCRITERIA : Adminwrap.Cpp
  • g_bstrECID : Adminwrap.Cpp
  • g_bstrIID : Adminwrap.Cpp
  • g_bstrMETHOD : Adminwrap.Cpp
  • g_bstrNAME : Adminwrap.Cpp
  • g_bstrPUBID : Adminwrap.Cpp
  • g_bstrSUBINT : Adminwrap.Cpp
  • g_bstrTRANSPUBPROP : Adminwrap.Cpp
  • g_bstrTRANSSUB : Adminwrap.Cpp
  • g_bstrVALUE : Adminwrap.Cpp
  • g_bTapiInUse : TapiCode.c
  • g_bUnattended : bankdlg.Cpp , OPBank.Cpp
  • g_bVerbose : IocpServer.Cpp , IocpServerex.Cpp
  • g_bWin95 : Property.c
  • g_Callback : bits_ie.cpp
  • g_CallBackCritSec : AsyncDemo.cpp
  • g_cAttachedProcesses : myclassfactory.cpp
  • g_cBindURLMaps : error.h
  • g_cCDFlagsMaps : error.h
  • g_cchQueueFullHeaders : PoolWrap.cpp
  • g_cchQueueFullResponse : PoolWrap.cpp
  • g_cColFlagsMaps : error.h
  • g_cConsTypeMaps : error.h
  • g_cDBTypes : error.h
  • g_cDeferrabilityMaps : error.h
  • g_cDialectMaps : error.h
  • g_ce : configmgr.c , configmgr.h
  • g_cEntries : HtmlProp.Cxx
  • g_cFactoryDataEntries : cfactory.cpp , main.cpp , SERVER.CPP
  • g_cfBaseNodePtr : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfDataObjPtr : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfDisplayName : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfEmbeddedObject : dxferObj.Cpp
  • g_cfFileContents : DataObj.Cpp , DragImg.Cpp
  • g_cfFileGroupDescriptor : DataObj.Cpp , DragImg.Cpp
  • g_cfMS_Cookies : globals.h , globals.cpp
  • g_cfMS_IsMsObj : globals.cpp , globals.h
  • g_cfMS_Objects : globals.cpp , globals.h
  • g_cfMS_Snapins : globals.cpp , globals.h
  • g_cfNetResource : DropExt.C
  • g_cfNodeAttrPtr : globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfNodePropPtr : globals.cpp , globals.h
  • g_cfNodeType : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfNodeTypeFlg : globals.cpp , globals.h
  • g_cfObjectDescriptor : dxferObj.Cpp , idt.Cpp
  • g_cfSnapinClsid : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfszNodeType : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cInstances : HtmlProp.Cxx , lrsample.CXX , lrsample.HXX
  • g_cInterfaceMaps : error.h
  • g_cIsoLevels : error.h
  • g_ClassFactory : SServer.Cpp , sserver.cpp
  • g_cLCID : error.h
  • g_ClientContext : TestAccept.cpp
  • g_ClipBookServerFunctionTable : ClipBook Server.cpp
  • g_cLock : myclassfactory.cpp , MainDll.Cpp , Sample.h , MainDll.Cpp , Sample.h , MainDll.Cpp , MethProv.h , MainDll.Cpp , Sample.h , FileView.Cpp
  • g_cLocks : Dog.Cpp
  • g_CloseEvent : cfactory.cpp , DCOMServer.cpp , main.cpp
  • g_clsid : cfactory.cpp , DCOMServer.h , main.cpp , registry.cpp
  • g_cMatchTypeMaps : error.h
  • g_cObj : myclassfactory.cpp , MainDll.Cpp , Sample.h , MainDll.Cpp , Sample.h , MainDll.Cpp , MethProv.h , MainDll.Cpp , Sample.h , FileView.Cpp
  • g_cObjectCount : ComPerf.Cpp
  • g_cObjects : cDog.h , Dog.Cpp , Dogcf.h
  • g_cObjectTypeMaps : error.h
  • g_Col0Name : blrplate.cpp
  • g_Col1Name : blrplate.cpp
  • g_CompletionKey : NewFsp.h
  • g_CompletionPort : NewFsp.h
  • g_ConsoleData : SServer.Cpp
  • g_Contact_Properties : Service.cpp
  • g_Count : SServer.Cpp
  • g_cPromptOptions : error.h
  • g_cPropSetMaps : error.h
  • g_cRefDll : globals.cpp , globals.h , globals.cpp , globals.h
  • g_cRefThisDll : Cfact.Cpp , DllMain.Cpp , Handler.Cpp , DropExt.C , PropShet.Cpp , ShellExt.Cpp
  • g_cResources : msistuff.cpp
  • g_cResultFlagMaps : error.h
  • g_CriticalSection : IocpServer.Cpp , IocpServerex.Cpp
  • g_cRowColMaps : error.h
  • g_cs : SServer.Cpp , BYOTtransObj.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_csOpenFiles : openf.c
  • g_cSourceType : error.h
  • g_csSync : FreeObject.Cpp , FreeTest.Cpp
  • g_csWorkItems : ftrans.c , fwasync.c
  • g_cUpDelRuleMaps : error.h
  • g_CurrentCallCritSection : common.h , tapirecv.cpp
  • g_CurrentData : nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp
  • g_CV : globals.cpp , globals.h
  • g_cVariantTypes : error.h
  • g_cXACTTC : error.h
  • g_cxWidth : AppBar.c
  • g_cyHeight : AppBar.c
  • g_destaddr : QosEvent.Cpp , QosEvent.h
  • g_DisplayAttributeInfo : dap.cpp
  • g_DllRefCount : clsfact.Cpp , DoServer.Cpp , OLEDoc.Cpp , ADEvent.cpp , BandObjs.Cpp , Globals.h , SampView.Cpp , Utility.h , IcnOvrly.Cpp
  • g_dmDiagnosticMode : utils.cpp
  • g_dtSlideHide : Util.c
  • g_dtSlideShow : Util.c
  • g_dwAPIVersion : TapiCode.c
  • g_dwBreakID : error.cpp , error.h
  • g_dwCacheSeconds : CacheIsapi.cpp
  • g_dwCallState : TapiCode.c
  • g_dwCodeAddress : BPSamp.h , Utils.c
  • g_dwCreateFileFlags : openf.c
  • g_dwCreateFileShareMode : openf.c
  • g_dwCurrentThreadID : BPSamp.h , DbgCmd.c
  • g_dwDeviceID : TapiCode.c
  • g_dwEapTraceId : Eap.h , Exports.Cpp
  • g_dwEntries : PhoneEntry.c
  • g_dwErrorPost : error.cpp , error.h
  • g_dwFlags : main.cpp , prsample.h
  • g_dwIoControlCode : rcvall.c
  • g_dwLockCount : ole2ui.c
  • g_dwMessages : CallNot.cpp
  • g_dwNumDevs : TapiCode.c
  • g_dwNumNs : rnrcs.cpp
  • g_dwObjectCount : OleStd.h , dballoc.Cpp , ole2ui.c
  • g_dwProtocol : rcvall.c
  • g_dwReadThreadID : CommCode.c
  • g_dwRegister : DoServer.Cpp , cHello.Cxx
  • g_dwRegisterClass : server.cxx
  • g_dwRequestedID : TapiCode.c
  • g_dwSizeDeviceConfig : TapiCode.c
  • g_dwThread : Range.c
  • g_dwThreadCount : IocpServer.Cpp , WorkerThread.c
  • g_dwTLS : cfactory.cpp , main.cpp
  • g_dwWriteThreadID : CommCode.c
  • g_EnableLogging : PoolWrap.cpp
  • g_EnhKeyUsage : CreateCert.c
  • g_EventName : blrplate.cpp
  • g_ExpertName : blrplate.cpp
  • g_Extension : CacheIsapi.cpp , CustomAuth.cpp , CustomAuth.h
  • g_f3XDriver : quiktest.c
  • g_fActiveConference : CConf.Cpp , CConf.h , conf.cpp
  • g_FactoryDataArray : cfactory.cpp , main.cpp , SERVER.CPP
  • g_fAppRegistered : AppBar.c , AppBar.h
  • g_fAtCodeBreakpoint : BPSamp.h , DbgCmd.c
  • g_fClassRegistered : cHello.Cxx
  • g_fDragging : fulldrag.c
  • g_fFilterInitialized : CustomAuth.cpp , CustomAuth.h
  • g_fFlag : PhoneEntry.c
  • g_fFontBold : sdkdiff.cpp
  • g_FileShareSampleFunctionTable : File Share Sample.cpp
  • g_fInDbgCmd : BPSamp.h , DbgCmd.c
  • g_fNtds : rnrcs.cpp
  • g_fOpacity : dxsurf2.cpp
  • g_fPaintDeferred : fulldrag.c
  • g_fpLogFile : sampclnt.cpp , sampclnt.h
  • g_fQuiet : Global.h , Main.Cpp
  • G_FREE : LeakyBin.h
  • g_fSap : rnrcs.cpp
  • g_fTimerActive : Obscure.c
  • g_ftInitTime : IsapiTime.cpp
  • g_fUseBuiltInLogoff : CustomAuth.cpp , CustomAuth.h
  • g_fUseBuiltInLogon : CustomAuth.cpp , CustomAuth.h
  • g_fUseClientIpForEncryption : CustomAuth.cpp , CustomAuth.h
  • g_fUseList : DragImg.Cpp
  • g_fUseSSLForSubmission : CustomAuth.cpp , CustomAuth.h
  • g_fValidEntry : PhoneEntry.c
  • g_fWndRegistered : Handler.Cpp
  • g_guid : cMgr.Cpp , cMgr.h
  • g_guidApp : CConf.Cpp , Global.h , CConf.Cpp , Global.h , CConf.Cpp
  • g_guidNM2Chat : CConf.Cpp , Global.h
  • g_guidNMUIChat : cMgr.Cpp , cMgr.h
  • g_hAccel : bankdlg.Cpp , OPBank.Cpp
  • g_hAccelTable : ui.cpp
  • g_hbrColor : fakemenu.c
  • g_hCall : TapiCode.c
  • g_hCleanupEvent : IocpServerex.Cpp
  • g_hCloseEvent : CommCode.c
  • g_hCommFile : CommCode.c
  • g_hCompletionPort : PoolWrap.cpp
  • g_hDialog : TapiCode.c
  • g_hDlg : bankdlg.Cpp , bankthrds.Cpp , CallNot.cpp , FileTerm.cpp , nlsapi.c
  • g_hDlgParentWindow : TapiCode.c
  • g_hDllInst : Marshal2.Cpp
  • g_HeapHandle : Macros.h , NewFsp.c
  • g_hEnv : MqTrans.Cpp
  • g_hEvent : server.cxx
  • g_hEventDone : SServer.Cpp
  • g_hExitEvent : dhcpnotify.cpp , common.h , tapirecv.cpp
  • g_hExpertKey : config.cpp
  • g_hFont : sdkdiff.cpp
  • g_hForceRefreshEvent : threads.c
  • g_hGeneralHeap : heap.Cpp
  • g_hHtmlDll : HtmlProp.Cxx
  • g_hID : BasicHiPerf.Cpp
  • g_himlLarge : SampView.Cpp , Utility.h
  • g_himlSmall : SampView.Cpp , Utility.h
  • g_hinst : BaseSnap.Cpp , Globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , sendto.c , fakemenu.c , App32.C , App32.h
  • g_hInst : DoServer.Cpp , DoServer.h , Dog.Cpp , dialogs.c , printjob.c , quelist.c , ADEvent.cpp , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , dxsurf2.cpp , Cap.Cpp , MainDlg.Cpp , ComDlg32.C , Property.c , Rebar.c , VListVw.c , global.h , BandObjs.Cpp , Globals.h , DragImg.Cpp , enumdesk.cpp , enumdesk.h , FileView.Cpp , SampView.Cpp , Utility.h , IcnOvrly.Cpp , globals.cpp , globals.h , globals.cpp , globals.h
  • g_hinst : SetDisp.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h
  • g_hInstance : SServer.Cpp , myclassfactory.cpp , GetImage.cpp , StdAfx.h , NewFsp.h , blrplate.cpp , blrplate.h , customdial.cpp , customdialreg.cpp , PhoneEntry.c , Eap.h , Exports.Cpp , Main.Cpp , Privobji.Cpp , exit.cpp , Exit.Cpp , Policy.Cpp , Server.Cpp , ClRes.cpp , ClRes.h , Globals.h , Main.c
  • g_hInstExe : precomp.h , ui.cpp
  • g_hIOCP : IocpServer.Cpp , IocpServerex.Cpp
  • g_hLine : TapiCode.c
  • g_hLineApp : TapiCode.c
  • g_hLogFile : NewFsp.h , PoolWrap.cpp
  • g_hMenu : ui.cpp
  • g_hmenuSendTo : sendto.c
  • g_hmodThisDll : Cfact.Cpp , DllMain.Cpp , Enum.Cpp , Handler.Cpp , Settings.Cpp , IconHdlr.Cpp , PropShet.Cpp , ShellExt.Cpp
  • g_hModule : cfactory.cpp , main.cpp , nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp , CertEnc.Cpp , lrsample.CXX
  • g_hProcDebuggee : BPSamp.h , Main.c
  • g_hReadThread : CommCode.c
  • g_hRes : global.h
  • g_hSafeToExitEvent : main.cpp , main.h
  • g_hSecurity : WebClient.c , WebServer.c
  • g_hTerminateEvent : threads.c
  • g_hwndDlg : bits_ie.cpp
  • g_hwndEdit : ui.cpp
  • g_hwndList : nlsapi.c
  • g_hwndMain : precomp.h , ui.cpp , Property.c , DragImg.Cpp , DropTgt.Cpp , enumdesk.cpp
  • g_hWndMainWindow : TapiCode.c
  • g_hwndMsg : ui.cpp
  • g_hwndPropSheet : Property.c
  • g_hWndResults : bankdlg.Cpp , bankthrds.Cpp
  • g_hWndStop : bankdlg.Cpp , bankthrds.Cpp
  • g_hWndSubmit : bankdlg.Cpp , bankthrds.Cpp
  • g_hwndUser : ui.cpp
  • g_hwo : childview.cpp , dlgdest.h , wave.h
  • g_hWriteThread : CommCode.c
  • g_iAddressFamily : rcvall.c
  • g_iCounter : nlsapi.c
  • g_iCurLocale : nlsapi.c
  • g_iFamilyMap : rcvall.c
  • g_iFrameIndex : main.cpp
  • g_iMinHeight : Global.h
  • g_iMinWidth : Global.h
  • g_InitResultCode : PoolWrap.cpp
  • g_InitSuccess : PoolWrap.cpp
  • g_Interface : nshsamp.h
  • g_InvokeInfo : session.cpp , session.h
  • g_iObjDefAccess : Privobji.Cpp
  • g_iOutputLevel : bthcxn.cpp
  • g_iSettingsHeight : Global.h
  • g_iSettingsWidth : Global.h
  • g_iTemp : PhoneEntry.c
  • g_ItemsInQueue : PoolWrap.cpp
  • g_iWidthBuf : Global.h
  • g_JobId : bits_ie.cpp
  • g_JobManager : main.cpp , main.h
  • g_Justification : blrplate.cpp
  • g_lAsyncReply : TapiCode.c
  • g_lDone : Hello2.Cpp , Notify.Cpp , Hello3.Cpp , Notify.Cpp
  • g_LineAppHandle : NewFsp.h
  • g_lInstances : SmpFilt.Hxx
  • g_listSources : childview.cpp , dlgsrc.h
  • g_lLocks : Factory.Cpp , Server.Cpp
  • g_lObjects : BasicHiPerf.Cpp , Factory.Cpp , Server.Cpp
  • g_LockCount : Server.Cxx
  • g_LogFileLock : PoolWrap.cpp
  • g_LogonTimeoutSeconds : CustomAuth.cpp , CustomAuth.h
  • g_LogonType : CustomAuth.cpp , CustomAuth.h
  • g_lpDeviceConfig : TapiCode.c
  • g_lpRasEntry : PhoneEntry.c
  • g_lRequests : CacheIsapi.cpp
  • g_lWorkItems : ftrans.c , fwasync.c
  • g_MyGuid : rnrcs.cpp
  • g_nAddressTypeConstants : tapisend.cpp
  • g_nColumn : SampView.Cpp , Utility.h
  • g_nConnID : nullmdm.cpp
  • g_nFontHeight : sdkdiff.cpp
  • g_nMaxNumOfCSAddr : rnrcs.cpp
  • g_nMaxNumOfSocks : rnrcs.cpp
  • g_nNumberOfAddressTypes : tapisend.cpp
  • g_nNumOfUsedSocks : rnrcs.cpp
  • g_Nodes : basesnap.Cpp , registry.Cpp , basesnap.Cpp , registry.Cpp
  • g_nOSWinNT : Main.Cxx , osv.Hxx
  • g_NotificationReceiver : main.cpp , main.h
  • g_NotifyPrimarySTAEvent : Cancel.Cpp
  • g_nPollIntervalms : threads.c
  • g_nRows : bankdlg.Cpp , bankthrds.Cpp
  • g_nTAPINotificationCookie : tapirecv.cpp
  • g_nThreadsRunning : bankdlg.Cpp
  • g_NumThreads : PoolWrap.cpp
  • g_ObjectCount : Server.Cxx
  • g_ObjectGuid : nshsamp.h
  • g_OfflineData : nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp
  • g_OnlineData : nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp
  • g_pApplet : applet.cpp , applet.h
  • g_pCall : CallNot.cpp , FileTerm.cpp
  • g_pCAppLite : cdialoglite.cpp
  • g_pChannelAppShare : cShare.Cpp , cShare.h , cshare.cpp , cshare.h
  • g_pChannelData : cData.Cpp , cData.h , cData.Cpp , cData.h
  • g_pChannelFt : CConf.Cpp , CConf.h , cft.cpp , Init.Cpp
  • g_pChildView : childview.cpp , childview.h
  • g_pcm2 : enumdesk.cpp , enumdesk.h
  • g_pConference : CConf.Cpp , CConf.h , conf.cpp , CConf.Cpp , CConf.h , CConf.Cpp , CConf.h
  • g_pConferenceNotify : CConf.Cpp , conf.cpp , conf.h , CConf.Cpp
  • g_pCtxtList : IocpServer.Cpp , IocpServerex.Cpp
  • g_pCtxtListenSocket : IocpServerex.Cpp
  • g_pCurrCatalog : VCExplore.Cpp
  • g_pCurrCollection : VCExplore.Cpp
  • g_pCurrentCall : common.h , tapirecv.cpp
  • g_pDeviceInfo : NewFsp.h
  • g_pDialog : main.cpp , main.h
  • g_pdlgDest : childview.cpp , dlgdest.h
  • g_pDll : ComObj.Cpp , DllSkel.Cpp
  • g_pDoc : APIDoc.Cpp , APIDoc.h
  • g_pDXImageSurf : dxsurf1.cpp
  • g_pDXOutSurf : dxsurf2.cpp
  • g_pDXSurf1 : dxsurf2.cpp
  • g_pDXSurf2 : dxsurf2.cpp
  • g_pDXSurfOnSurfMod : dxsurf2.cpp
  • g_PerfFreq : bankdlg.Cpp , bankthrds.Cpp
  • g_pfnInvalidateCacheUrl : CacheIsapi.cpp
  • g_pfnLogEvent : ClRes.cpp , ClRes.h , ClRes.cpp , ClRes.h
  • g_pfnSetResourceStatus : ClRes.cpp , ClRes.h , ClRes.cpp , ClRes.h
  • g_pFt : CConf.Cpp , CConf.h , cft.cpp
  • g_pGIT : StdAfx.h , SyncComp.Cpp
  • g_pHandles : bankdlg.Cpp
  • g_pidlCurFQ : list.cpp
  • g_pIInkCollector : BasicRecognition.cpp
  • g_pIInkDisp : BasicRecognition.cpp
  • g_pIInkRecoContext : BasicRecognition.cpp
  • g_pIMalloc : sampclnt.cpp , sampclnt.h
  • g_pITaskScheduler : sa.Cpp
  • g_pJob : bits_ie.cpp
  • g_pListApp : chWnd.Cpp
  • g_pListCall : CCall.Cpp , CCall.h
  • g_pListCallNotify : CCall.Cpp , CCall.h
  • g_pListChannel : CChan.Cpp , CChan.h
  • g_pListChannelNotify : CChan.Cpp , CChan.h
  • g_pListConference : CConf.Cpp , CConf.h
  • g_pListConferenceNotify : CConf.Cpp , CConf.h
  • g_pListUser : cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h
  • g_pLookupTable : main.cpp
  • g_pLUTBuilder : main.cpp
  • g_pMainDlg : Cap.Cpp , MainDlg.Cpp
  • g_pMalloc : sendto.c , enumdesk.cpp , enumdesk.h
  • g_pManager : bits_ie.cpp
  • g_pMember : CConf.Cpp , CConf.h
  • g_pMemberLocal : cMemb.Cpp , cMemb.h
  • g_pMgr : CConf.Cpp , CConf.h , conf.cpp , CConf.Cpp , CConf.h , CConf.Cpp , CConf.h , cMgr.Cpp , cMgr.h
  • g_pMgrNotify : CConf.Cpp , conf.cpp , CConf.Cpp , cMgr.Cpp
  • g_pMsgLog : AptClien.Cpp , AptServe.Cpp , Server.h , ComObj.Cpp , ComObjI.h , ComUser.Cpp , DllClien.Cpp , DllServe.Cpp , Server.h , LicClien.Cpp , LicServe.Cpp , Server.h , LocClien.Cpp , LocServe.Cpp , Server.h , RemClien.Cpp
  • g_pNameSpace : SamplCli.Cpp
  • g_pNotifyAppShare : cShare.Cpp , cShare.h , cshare.cpp , cshare.h
  • g_pNotifyData : cData.Cpp , cData.h , cData.Cpp , cData.h
  • g_pNotifyFileTransfer : cft.cpp , Init.Cpp
  • g_pNotifyFt : CConf.Cpp , CConf.h
  • g_pOpenFiles : openf.c
  • g_Port : IocpServer.Cpp , IocpServerex.Cpp
  • g_ppBLRPLATEConfig : config.cpp
  • g_pPlayFileTerm : CallNot.cpp , FileTerm.cpp
  • g_pPrimaryDXSurf : dxsurf1.cpp
  • g_pQuery : QueryParser.cpp
  • g_pRecordFileTerm : CallNot.cpp , FileTerm.cpp
  • g_Process_Properties : Service.cpp
  • g_progID : cfactory.cpp , DCOMServer.h , main.cpp , registry.cpp
  • g_ProxyProtocols : proxypluginimpl.cpp
  • g_pServer : AptServe.Cpp , Server.h , ConServe.Cpp , Server.h , DcdServe.Cpp , Server.h , DllServe.Cpp , Server.h , FreServe.Cpp , Server.h , LicServe.Cpp , Server.h , LocServe.Cpp , Server.h , PerDraw.Cpp , Server.h , PerServe.Cpp , Server.h , PerText.Cpp , Server.h , StoServe.Cpp
  • g_pSession : session.cpp , session.h
  • g_pSettings : DllMain.Cpp , Handler.Cpp , Settings.Cpp
  • g_psfCurFolder : list.cpp
  • g_psfDesktop : sendto.c
  • g_pSSPI : WebClient.c , WebServer.c
  • g_pSuite : bankdlg.Cpp
  • g_pSurf1 : main.cpp
  • g_pSurf2 : main.cpp
  • g_pSurfFact : dxsurf1.cpp , dxsurf2.cpp , main.cpp
  • g_pSurfMod : dxsurf2.cpp , main.cpp
  • g_pSurfModSurf : main.cpp
  • g_pszConnection : adoisapi.cpp
  • g_pTapi : FileTerm.cpp , common.h , tapirecv.cpp , tapisend.cpp
  • g_pthdParam : CAsyncTest.cpp
  • g_pThreadMgr : globals.h , tsfapp.cpp
  • g_pThreads : PoolWrap.cpp
  • g_pTransFact : main.cpp
  • g_pViewList : SampView.Cpp , ShlFldr.Cpp , ShlView.Cpp
  • g_pWinlogon : GinaStub.c
  • g_qinfo : MQPort.Cpp
  • g_QS : rnrcs.cpp
  • g_QueueFullHeaders : PoolWrap.cpp
  • g_QueueFullPages : PoolWrap.cpp , PoolWrap.h
  • g_QueueFullResponse : PoolWrap.cpp
  • g_QueueSize : PoolWrap.cpp
  • g_RandomCommands : nshsamp.cpp
  • g_RasDevInfo : PhoneEntry.c
  • g_rcAppBar : AppBar.c , AppBar.h
  • G_REALLOC : LeakyBin.h
  • g_RefreshOnTimer : bits_ie.cpp
  • g_RegTable : server.cxx
  • g_ResetObjects : nshsamp.cpp
  • g_rgBindURLMaps : error.h
  • g_rgCDFlagsMaps : error.h
  • g_rgColFlagsMaps : error.h
  • g_rgConsTypeMaps : error.h
  • g_rgDBTypes : error.h
  • g_rgDeferrabilityMaps : error.h
  • g_rgDialectMaps : error.h
  • g_rgInterfaceMaps : error.h
  • g_rgIsoLevels : error.h
  • g_rgLCID : error.h
  • g_rgMatchTypeMaps : error.h
  • g_rgObjectTypeMaps : error.h
  • g_rgPromptOptions : error.h
  • g_rgPropSetMaps : error.h
  • g_rgResultFlagMaps : error.h
  • g_rgRowColMaps : error.h
  • g_rgSourceType : error.h
  • g_rgUpDelRuleMaps : error.h
  • g_rgVariableList : DumpRequestInfo.cpp
  • g_rgVariantTypes : error.h
  • g_rgXACTTC : error.h
  • g_RootGuid : nshsamp.h
  • g_saDestinationAddress : rcvall.c
  • g_saLocalInterface : rcvall.c
  • g_Sample_Commands : nshsamp.cpp
  • g_SampleInterface : nshsamp.h
  • g_SampleInterface_Commands : nshsamp.cpp
  • g_saSourceAddress : rcvall.c
  • g_schSCMHandle : ClRes.cpp , ClRes.h
  • g_sDlgItems : SetDisp.c , App32.C
  • g_sdListen : IocpServer.Cpp , IocpServerex.Cpp
  • g_ServerInfo : DComDraw.Cpp , RemClien.Cpp
  • g_ShowError : nshsamp.cpp
  • g_siObjAccesses : Privobji.Cpp
  • g_siObjInheritTypes : Privobji.Cpp
  • g_sizeofNonDialable : TapiCode.c
  • g_sNonDialable : TapiCode.c
  • g_spDataConvert : common.cpp , common.h
  • g_StartTime : Extension.cpp
  • g_StatusString : blrplate.cpp , blrplate.h
  • g_strCacheUrl : CacheIsapi.cpp
  • g_strIniFile : CustomAuth.cpp , CustomAuth.h , ReMapUrl.cpp
  • g_strLogoffUrl : CustomAuth.cpp , CustomAuth.h
  • g_strLogonSuccessUrl : CustomAuth.cpp , CustomAuth.h
  • g_strLogonUrl : CustomAuth.cpp , CustomAuth.h
  • g_strRedirectResponse : Redir401.cpp
  • g_style : Global.h
  • g_SubContext : nshsamp.h
  • g_SymTagNames : dbh.cpp
  • g_szAddressTypes : tapisend.cpp
  • g_szAppClassName : Main.Cpp
  • g_szAppName : printjob.c
  • g_szCaption : main.cpp
  • g_szClassName : Property.c , VListVw.c , DragImg.Cpp , enumdesk.cpp
  • g_szDialableAddress : TapiCode.c
  • g_szDisplayableAddress : TapiCode.c
  • g_szEmpty : CreateCert.c
  • g_szEntryName : PhoneEntry.c
  • g_szErrorResponse : DumpRequestInfo.cpp
  • g_szExtTitle : SampView.Cpp , Utility.h
  • g_szFile : Global.h , Main.Cpp
  • g_szFileName : bits_ie.cpp , sendto.c
  • g_szFontFaceName : sdkdiff.cpp
  • g_szHttpError403_16 : ErrorTxt.h
  • g_szHttpError500 : ErrorTxt.h
  • g_szHttpHeader : isapiCertPolicy.cpp
  • g_szLogFile : bankdlg.Cpp , OPBank.Cpp
  • g_szMachineName : DComDraw.Cpp , RemClien.Cpp
  • g_szMainTitle : ADEvent.cpp
  • g_szMessage : client.cxx
  • g_szModuleName : IsapiDebug.h , IsapiTools.h , IsapiModule.cpp
  • g_szMyStore : CreateCert.c
  • g_szNameSpaceRoot : CEnumStorageResource.h
  • g_szNotes : main.cpp
  • g_szNULLMStartString : nullmdm.cpp
  • g_szPageTitle : PerClien.Cpp
  • g_szPhysicalDriveFormat : CEnumStorageResource.h
  • g_szRemoteAddr : bthcxn.cpp
  • g_szRemoteName : bthcxn.cpp
  • g_szSigAlg : CreateCert.c
  • g_szStoragePath : SampView.Cpp , Utility.h
  • g_szTitle : printjob.c , DragImg.Cpp
  • g_szTSFAppTitle : tsfwnd.cpp
  • g_szTSFEditClassName : tsfedit.cpp
  • g_szTSFMainClassName : tsfwnd.cpp
  • g_tabwidth : sdkdiff.cpp , sdkdiff.h
  • g_tcsTemp : global.h
  • g_Thread : mspthrd.cpp
  • g_ThreadHandles : IocpServer.Cpp , IocpServerex.Cpp
  • g_ThreadTerminate : Main.cpp
  • g_Tools : ShlView.Cpp , Tools.h
  • g_TopLevelCommands : nshsamp.cpp
  • g_TopLevelSubInterfaceCommands : nshsamp.cpp
  • g_TotalRequests : PoolWrap.cpp , PoolWrap.h
  • g_uiCodePage : msiloc.cpp
  • g_ulAdvise : FileTerm.cpp
  • g_ulFilterMask : rcvall.c
  • g_ulMaxCxnCycles : bthcxn.cpp
  • g_uObjectCount : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_uObjects : basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , BaseSnap.h , Globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h
  • g_UpdateTimerSet : bits_ie.cpp
  • g_uPosition : enumdesk.cpp
  • g_uServerLocks : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_UseThreadPool : PoolWrap.cpp
  • g_uSrvLock : basesnap.h , BaseSnap.h , basesnap.h
  • g_VerbMap : ContMenu.Cpp
  • g_wcBuf : Global.h
  • g_wCurLang : global.h
  • g_wLangId : msiloc.cpp
  • g_WorkerThread : common.h , Processing.cpp
  • g_wSide : Rebar.c
  • g_wszDataSourceKeyword : binder.cpp , sampprov.h
  • g_wszFileKeyword : binder.cpp , sampprov.h
  • g_wszMachineName : DComDraw.Cpp , RemClien.Cpp , MqTrans.Cpp
  • g_wszResourceTypeNames : StdAfx.cpp , StdAfx.h , StdAfx.cpp , StdAfx.h
  • g_wszRowKeyword : binder.cpp , sampprov.h
  • gaAttributes : Enumprt.h
  • gaBrushStyles : Printer.h
  • gaCaps : Getcaps.h
  • gaClipCaps : Getcaps.h
  • gaColor : Enumprt.h
  • gaCurveCaps : Getcaps.h
  • gAddContextEvent : asyncselect.cpp , sockinfo.cpp , spi.cpp
  • gAddressFamily : rawudp.c , Ping.cpp
  • gaDefaultSource : Enumprt.h
  • gaDriverInfo : Enumprt.h
  • gaDrvInfo : Getpdriv.h
  • gaDuplex : Enumprt.h
  • gaEnumPrt : Enumprt.h
  • gaFields : Enumprt.h
  • gaGraphicLookup : Printer.h
  • gahwndSpin : SpinTest.h
  • GAKPageCallback() : PropShet.Cpp
  • GAKPageDlgProc() : PropShet.Cpp
  • gaLineCaps : Getcaps.h
  • GAMMA_CORRECTION : MfEdit.h
  • gaMMLookup : Printer.h
  • ganPosX : TIMEWND.c
  • gaOrientation : Enumprt.h
  • GAP_SIZE : enumdesk.cpp
  • gaPaperSize : Enumprt.h
  • gaPenStyles : Printer.h
  • gaPenWidths : Printer.h
  • gaPolygonCaps : Getcaps.h
  • gaPrintQuality : Enumprt.h
  • gaPriorities : Enumprt.h
  • gaRasterCaps : Getcaps.h
  • garMsgStrings : MousInfo.c
  • gaStatus : Enumprt.h
  • gatbButton : MainWND.c
  • gaTechnologyCaps : Getcaps.h
  • gaTextCaps : Getcaps.h
  • gb3D : MfEdit.h
  • gbAbort : Printer.h
  • gBase : dbh.cpp
  • gBaseInfo : sockinfo.cpp , spi.cpp
  • gbAutoPlay : MainWND.c
  • gbCaptRect : Dialogs.c , WinCap.c
  • gbDB : MfEdit.h
  • gbDebug : MfEdit.h
  • gbExport3X : MfEdit.h
  • gbFit2Wnd : MfEdit.h
  • GBGETTEXT : GizmoBar.h
  • GBGizmoAdd : GizmoBar.h
  • GBGizmoAddA() : GizmoBar.h
  • GBGizmoAddW() : GizmoBar.h
  • GBGizmoCheck() : GizmoBar.h
  • GBGizmoDataGet() : GizmoBar.h
  • GBGizmoDataSet() : GizmoBar.h
  • GBGizmoEnable() : GizmoBar.h
  • GBGizmoExist() : GizmoBar.h
  • GBGizmoFocusSet() : GizmoBar.h
  • GBGizmoIntGet() : GizmoBar.h
  • GBGizmoIntSet() : GizmoBar.h
  • GBGizmoNotifyGet() : GizmoBar.h
  • GBGizmoNotifySet() : GizmoBar.h
  • GBGizmoRemove() : GizmoBar.h
  • GBGizmoSendMessage() : GizmoBar.h
  • GBGizmoShow() : GizmoBar.h
  • GBGizmoTextGet : GizmoBar.h
  • GBGizmoTextGetA() : GizmoBar.h
  • GBGizmoTextGetW() : GizmoBar.h
  • GBGizmoTextSet : GizmoBar.h
  • GBGizmoTextSetA() : GizmoBar.h
  • GBGizmoTextSetW() : GizmoBar.h
  • GBGizmoTypeGet() : GizmoBar.h
  • gbHitTest : MfEdit.h
  • GBHwndAssociateGet() : GizmoBar.h
  • GBHwndAssociateSet() : GizmoBar.h
  • gbImport3X : MfEdit.h
  • gBindAddr : Mcastws1.c
  • gbit_alloc() : gutils.h
  • gbit_findfree() : gutils.h
  • gbit_free() : gutils.h
  • gbit_init() : gutils.h
  • gbLButtonDown : WinCap.c
  • GBM_GIZMOADD : GizmoBar.h
  • GBM_GIZMOADDA : GizmoBar.h
  • GBM_GIZMOADDW : GizmoBar.h
  • GBM_GIZMOCHECK : GizmoBar.h
  • GBM_GIZMODATAGET : GizmoBar.h
  • GBM_GIZMODATASET : GizmoBar.h
  • GBM_GIZMOENABLE : GizmoBar.h
  • GBM_GIZMOEXIST : GizmoBar.h
  • GBM_GIZMOFOCUSSET : GizmoBar.h
  • GBM_GIZMOINTGET : GizmoBar.h
  • GBM_GIZMOINTSET : GizmoBar.h
  • GBM_GIZMONOTIFYGET : GizmoBar.h
  • GBM_GIZMONOTIFYSET : GizmoBar.h
  • GBM_GIZMOREMOVE : GizmoBar.h
  • GBM_GIZMOSENDMESSAGE : GizmoBar.h
  • GBM_GIZMOSHOW : GizmoBar.h
  • GBM_GIZMOTEXTGET : GizmoBar.h
  • GBM_GIZMOTEXTGETA : GizmoBar.h
  • GBM_GIZMOTEXTGETW : GizmoBar.h
  • GBM_GIZMOTEXTSET : GizmoBar.h
  • GBM_GIZMOTEXTSETA : GizmoBar.h
  • GBM_GIZMOTEXTSETW : GizmoBar.h
  • GBM_GIZMOTYPEGET : GizmoBar.h
  • GBM_HWNDASSOCIATEGET : GizmoBar.h
  • GBM_HWNDASSOCIATESET : GizmoBar.h
  • GBN_ASSOCIATEGAIN : GizmoBar.h
  • GBN_ASSOCIATELOSS : GizmoBar.h
  • GBN_GIZMOADDED : GizmoBar.h
  • GBN_GIZMOREMOVED : GizmoBar.h
  • gbNowCapturing : Dialogs.c , WinCap.c
  • gbPDOutln : MfEdit.h
  • gbPerverseCompare : sdkdiff.cpp
  • gbRCSet : MfEdit.h
  • gbRecording : MfEdit.h
  • gbRepaint : TIMEWND.c
  • gbSave : WinCap.c
  • gbSFOutln : MfEdit.h
  • gbstrVideo : Callnot.Cpp
  • gbTT : MfEdit.h
  • gBufferSize : Mcastws1.c , Mcastws2.c
  • gbUseDIB : MfEdit.h
  • gbUseMfPFD : MfEdit.h
  • gc_igtMultiStrokeGestures : AdvReco.cpp
  • gc_igtSingleStrokeGestures : AdvReco.cpp
  • gc_lMaxInputScopeMenuItemLength : AdvReco.cpp
  • gc_nRecommendedForMixedMode : AdvReco.cpp
  • gc_pwsInputScopes : AdvReco.cpp
  • gc_szAppName : AdvReco.cpp , BasicRecognition.cpp , MultiReco.cpp
  • gc_uiCtrlId : TPCInfo.cpp
  • gc_wszAppName : TPCInfo.cpp
  • gc_wszProgId : TPCInfo.cpp
  • gc_wszSpeechKey : TPCInfo.cpp
  • gCallAsClassFactory : Server.Cxx
  • gCmd : dbh.cpp
  • gCount : Mcastws1.c , Mcastws2.c
  • gCriticalSection : asyncselect.cpp , sockinfo.cpp , spi.cpp
  • gCrText : MfEdit.h
  • gCurrentLineInfo : Dialer.c
  • gcUsers : cMemb.Cpp
  • gDataSize : Ping.cpp
  • gDebugCritSec : spi.cpp
  • gDefaultBase : dbh.cpp
  • gDefaultBaseForVirtualMods : dbh.cpp
  • gDestAddress : rawudp.c
  • gDestination : Ping.cpp
  • gDestPort : rawudp.c
  • gDib : MfEdit.h
  • GDICOMMENT_IDENTIFIER : MfEdit.h
  • GDICOMMENT_MULTIFORMATS : MfEdit.h
  • gDropCallRequestID : Dialer.c
  • gdwBrushColor : Printer.h
  • gdwCurCtrl : MfEdit.h
  • gdwCurTool : MfEdit.h
  • gdwEndSel : Dialer.c
  • gdwEnumFlags : Enumprt.h
  • gdwGraphicsOptions : Paint.h , Printer.h
  • gdwLineDeviceIDBase : Atsp.h
  • gdwPenColor : Printer.h
  • gdwPermanentProviderID : Atsp.h
  • gdwPLID : Dialer.c
  • gdwStartSel : Dialer.c
  • gdwTextColor : Printer.h
  • gdwThreadCount : overlap.cpp
  • gdxWndMin : Global.h , Main.Cpp
  • gdyWndMin : Global.h , Main.Cpp
  • GEN_CMD_OKAY : nshsamp.h
  • GEN_CONNECT_SHOWSTRING : nshsamp.h
  • GEN_CURRENT_COUNT : nshsamp.h
  • GEN_SAMP_BASE : nshsamp.h
  • GEN_SAMPLEGATEWAY_SETTINGS : nshsamp.h
  • GEN_SAMPLEINTERFACE_SETTINGS : nshsamp.h
  • GenClientContext() : Security.cpp , Security.h
  • GeneralDlgProc() : gentab.c , global.h
  • GenerateUserName() : main.cpp
  • GENERICITEM : Enum.h
  • GENERICITEMLIST : Enum.h
  • GenericPull() : pipe.cxx , pipe.hxx
  • GenericPush() : pipe.cxx , pipe.hxx
  • GenericStopHelper() : nshsamp.cpp
  • GenericToken : HtmlScan.Hxx
  • GenServerContext() : Security.cpp , Security.h
  • GET : SnmpUtil.C , WSnmpUtil.h
  • GET_BULK : WSnmpUtil.h
  • GET_EXACT : networkentry.h
  • GET_FIRST : networkentry.h
  • GET_NEXT : WSnmpUtil.h , networkentry.h
  • GET_SCROLL_OPCODE : gutils.h
  • GET_SCROLL_POS : gutils.h
  • GET_WM_COMMAND_CMD : gutils.h , VListVw.h
  • GET_WM_COMMAND_HWND : gutils.h , VListVw.h
  • GET_WM_COMMAND_ID : gutils.h , VListVw.h
  • GET_WM_CTLCOLOR_HDC : MfEdit.h
  • GET_WM_CTLCOLOR_HWND : MfEdit.h
  • GET_WM_CTLCOLOR_TYPE : MfEdit.h
  • GetAccountSid() : LsaPrivs.c
  • GetActiveConference() : CConf.Cpp
  • GetAddress() : main.c , precomp.h
  • GetAddressFromCall() : Processing.cpp
  • GetAddressName() : Dialer.c
  • GetAddressToDial() : TapiCode.c
  • GetAddressType() : tapisend.cpp
  • GetAddrString() : Globals.h , Misc.c
  • GetAdminInstallInfo() : setup.h , utils.cpp
  • GetADSIError() : helper.cpp , helper.h , IADsError.cpp
  • GetAllocedPropInfo() : error.cpp , error.h
  • GetAlternateList() : RecoDll.cpp
  • GetAnInterface() : download.Cpp
  • GetApiErrorString() : AsyncDemo.cpp
  • GetAppbarData() : AppBar.c , AppBar.h
  • GetAppIDFromClsid() : custsur.Cpp
  • GetAppLite() : cdialoglite.cpp , cdialoglite.h
  • GetArgV() : cmsample.cpp
  • GetArraySize() : tracewmi.cpp
  • GetAssociatedExecutable() : getIcon.c , Utility.h
  • GetAsynchPhase() : error.cpp , error.h
  • GetAsynchReason() : error.cpp , error.h
  • GetAudioFormat() : Processing.cpp
  • GetAuthImp() : WbemSec.Cpp , WbemSec.h
  • GetBestAlternate() : RecoDll.cpp
  • GetBestResultString() : RecoDll.cpp
  • GETBIT : autotest.h , CeLibW2k.h
  • GetBitmap() : BitMap.c , BitMap.h
  • GetBitMapName() : error.cpp , error.h
  • GetBorder() : ioipf.h
  • GetBoundIpxAddr() : rnrcs.cpp
  • GetCallAsFactory() : Server.Cxx
  • GetCallerSocket() : provider.h , sockinfo.cpp
  • GetCallStateSz() : Debug.Cpp , Global.h
  • GetCanonicalFormatEtc() : ido.h
  • GetCert() : PropCert.Cpp
  • GetCertificateContextFromName() : RSACert.cpp , SignHash.cpp
  • GetCharFromGUID() : ADSIhelpers.h , ADSIhelpers.cpp
  • GETCLASSBRUSH : AppUtil.h , GdiDemo.h
  • GetClassID() : ips.h
  • GetClientAndServerAddresses() : main.cpp
  • GetClientCoords() : common.cpp , common.h
  • GetClientDescriptor() : Main.h , Security.Cpp
  • GetClientImpToken() : Main.h , Security.Cpp
  • GetClientObscuredness() : Obscure.c
  • GetClientResponse() : RasHost.Cpp , RasHost.h
  • GetClientSite() : ioo.h
  • GetClientSize() : common.cpp , common.h
  • GetClientToken() : Security.Cpp , Main.h , Privobji.Cpp
  • GetClipboardData() : ioo.h
  • GetCollaborationStateSz() : Debug.Cpp , Global.h
  • GetCollection() : Adminwrap.Cpp , Adminwrap.h
  • GetColName() : common.cpp , common.h
  • GetColorDlg() : Colors.c
  • GetColorsResHandle() : Colors.c
  • GetColumnData() : queue.c , queue.h
  • GetColumnsInfo() : sampclnt.cpp , sampclnt.h
  • GetComponentInfo() : TPCInfo.cpp
  • GetCompositionStr() : FullIME.h , ImeUI.C
  • GetConferenceStateSz() : Debug.Cpp , Global.h
  • GetConfidenceLevel() : RecoDll.cpp
  • GetConfnSz() : Debug.Cpp , Global.h
  • GetConnection() : caccount.Cpp , updrec.Cpp , bankdlg.Cpp , bankthrds.Cpp
  • GetConsoleVersion() : globals.cpp , globals.h
  • GetContainer() : iocs.h
  • GetControlScrollPos : halftone.c
  • GetCorrectResourceHandle() : Open.c
  • GetCreateParams() : common.cpp , common.h
  • GetCreatorSD() : Main.h , Security.Cpp
  • GetCurrentCall() : CCall.Cpp , CCall.h
  • GetCurrentConference() : CConf.Cpp , CConf.h , cMgr.h
  • GetCurrentImpersonationLevel() : BasicHiPerf.Cpp , MethProv.h , Service.cpp , Sample.h , Utils.Cpp , MethProv.Cpp , PropProv.Cpp , WbemSec.Cpp
  • GetCurrentNode() : LinkList.c , LinkList.h
  • GetCurrentTimeAsFileTime() : IsapiTime.h , IsapiTime.cpp
  • GetCurrentTimeAsString() : IsapiTime.h , IsapiTime.cpp
  • GetCurrentTimeInMilliseconds() : IsapiTime.h , IsapiTime.cpp
  • GetCurrentTimeInSeconds() : IsapiTime.cpp , IsapiTime.h
  • GetCurrentUserPriority() : service.h , Service.cpp , Service.h , service.cpp
  • GetCurrentUserSID() : DComPerm.h , UtilS.Cpp
  • GetData() : ido.h , sampclnt.cpp , sampclnt.h
  • GetDataBuffer() : keys.cpp , keys.h
  • GetDataFromRowset() : sampclnt.cpp , sampclnt.h
  • GetDataHere() : ido.h
  • GetDBSessionFromDataSource() : sampclnt.h , sampclnt.cpp
  • GetDBType() : common.cpp , common.h
  • GetDBTypeMaxSize() : common.h , common.cpp
  • GetDBTypeName() : common.cpp , common.h , common.cpp , common.h
  • GetDebuggeeFileName() : DebMisc.c , DebMisc.h
  • GetDefaultCodepage() : SmpFilt.Cxx
  • GetDefaultGUIFont() : MultiUI.h , MultiWnd.C
  • GetDefaultHardLimit() : Commands.Cpp , Commands.h
  • GetDefaultQuota() : Commands.Cpp , Commands.h
  • GetDefaultThreshold() : Commands.Cpp , Commands.h
  • GetDeviceCapsDlgProc() : Common.h , Getcaps.c
  • GetDevmodeDlg() : Print.c
  • GetDevModes() : SetDisp.c , SetDisp.h
  • GetDevnamesDlg() : Print.c
  • GetDiagRecs() : quiktest.c
  • GetDialectName() : error.h , error.cpp
  • GetDIBFilename() : OpenDIB.c , OpenDIB.h
  • GetDirectoryObjectAttrib() : getdomainmode.cpp
  • GetDiskGeometry() : Mfmt.c
  • GetDlgItemPsz() : Global.h , Util.Cpp
  • GetDlgItemsRc() : Global.h
  • GetDllFileName() : DebDebug.c
  • GetDllFileNameFromList() : DebDebug.c
  • GetDMVersion() : quiktest.c
  • GetDomainMode() : getdomainmode.cpp
  • GetDTCUnknown() : RmWorker.Idl
  • GetDynamicReadwriteLock() : sync.c
  • GetEditBoxValue() : winmain.cpp , common.cpp , common.h , winmain.h
  • GetEEInfoText() : common.cpp , common.h
  • GetEncodedTicket() : KList.c
  • GetEntry() : Collect.h , Collect.cpp
  • GetError() : stdafx.h , odbcdata.h
  • GetErrorMessage() : helper.cpp , helper.h , IADsError.cpp
  • GetErrorMsg() : AppUtil.h , AppUtil.Cpp , AppUtil.h
  • GetErrorName() : error.h , error.cpp , error.h , error.cpp
  • GetErrorPosting() : error.cpp , error.h
  • GetErrorRecords() : error.h , error.cpp
  • GetErrors() : quiktest.c
  • GetEventClass() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • GetEventMessage() : rmapi.c
  • GetExecutionMode() : setup.h , utils.cpp
  • GetExeName() : AppUtil.h , AppUtil.Cpp , AppUtil.h
  • GetExtensionVersion() : Extension.cpp , UpCaseMap.cpp , DumpVars.cpp , WorkerThread.c , ftrans.c , adoisapi.cpp , ctetest.c , formdump.cpp , InvokObjThreads.cpp , areadcli.c , fwasync.c , readcli.c , fwrite.c , KeepAlive.c , KeepAliveP.c , Redirect.cpp , Simple.cpp , CacheIsapi.cpp , CustomAuth.cpp , DumpRequestInfo.cpp , HelloIsapi.cpp , Extension.cpp , ReMapUrl.cpp , WildCardMap.cpp
  • GetExtensionVersionWrapper() : PoolWrap.cpp
  • GetExtent() : ioo.h
  • GetField() : secClnt.Cpp , secSvr.Cpp
  • GetFileHandleAndSize() : WinHttpFormSubmitSample.cpp , WinHttpPostSample.cpp
  • GetFileName() : Dlgopen.c , WinCap.h
  • GetFileTimeAsString() : IsapiTime.h , IsapiTime.cpp
  • GetFileTimeFromString() : IsapiTime.h , IsapiTime.cpp
  • GetFileVersionNumber() : setup.h , utils.cpp
  • GetFilterVersion() : AuthFilt.c , UpCase.c , Redir401.cpp
  • GetFindDlg() : Find.c
  • GetFindDlgHandle() : Find.c
  • GetFirstByte() : keys.cpp
  • GetFirstGraphicSlot() : Paint.c , Paint.h
  • GetFirstNode() : LinkList.c , LinkList.h
  • GetFontDlg() : Font.c
  • GetFontDlgHandle() : Font.c
  • GetFontPref() : sdkdiff.cpp
  • GetFtChannel() : CConf.Cpp
  • GetFullFileOrDirName() : SidClean.c
  • GetGlobalInfo() : rmapi.c
  • GetGlobalSettings() : Utility.Cpp , Utility.h
  • GetGroupSidFromToken() : Util.Cpp , Util.h
  • GetGuide() : RecoDll.cpp
  • GetGuideIndex() : RecoDll.cpp
  • GetGuideLine() : GuidE.c , GuidE.h
  • GetGuids() : tracewmi.cpp
  • GetHdc() : Font.c
  • GetHelpFilePath() : globals.cpp , globals.h
  • GetHrSz() : Debug.Cpp , Global.h
  • GetIADsPropertyValueAsBSTR() : ADSIhelpers.cpp , ADSIhelpers.h
  • GetIconFromInstance() : Icons.C
  • GetIconOfClass : OleStd.h
  • GetIconOfFile : OleStd.h
  • GetIdentity() : CeapCfg.Cpp , Eap.c , Eap.h
  • GetImageDirectoryAndFileName() : dxsurf3.cpp , main.cpp
  • GETINBOUNDBYTE : keys.cpp
  • GetIniBool() : Util.Cpp , Global.h
  • GetIniHex() : Global.h , Util.Cpp
  • GetIniInt() : Util.Cpp , Global.h
  • GetIniStr() : Global.h , Util.Cpp
  • GetInk() : PAPINT.Idl
  • GETINSTANCE : AppUtil.h , GdiDemo.h
  • GetInterfaceConfigInfo() : rmapi.c
  • GetInterfaceName() : error.cpp , error.h , error.cpp
  • GetInternalTypeFromCSVType() : rowset.h , rowset.cpp
  • GetIntFromConfig() : Redir401.cpp
  • GetInvokeInfo() : session.cpp , session.h
  • GetItemType() : tracewmi.cpp
  • GetKeyBuffer() : keys.cpp , keys.h
  • GetKeyInfo() : keys.cpp , keys.h
  • GetKeyList() : keys.cpp , keys.h
  • GetKeyOffset() : keys.h , keys.cpp
  • GETLASTERROR : common.h
  • GetLastErrorBox() : TextFx.c , ViewDIB.c
  • GETLASTERRORC : common.h
  • GetLastErrorText() : Service.C , SecFile.c , Service.c
  • GetLastNode() : LinkList.c , LinkList.h
  • GetLatticePtr() : RecoDll.cpp
  • GetLayeredEntriesByGuid() : instlsp.cpp
  • GetLBoxDw() : Dlg.Cpp
  • GetLineInfo() : Dialer.c
  • GetLineInfoFailed() : Dialer.c
  • GetListError() : LinkList.h , LinkList.c
  • GetLocaleString() : QSample.Cxx
  • GetLogFontDlg() : Font.c
  • GetLogonName() : Security.Cpp , Main.h
  • GetLPBYTEtoOctetString() : objectSid.cpp
  • GetMachineName() : MqTrans.Cpp
  • GetMapName() : error.h , error.cpp , error.h
  • GetMapping() : ReMapUrl.cpp
  • GetMaxDisplaySize() : common.cpp , common.h
  • GetMemoryInfo() : SysInf_C.c
  • GetMenuData() : common.h , common.cpp
  • GetMessageHelper() : IADsError.cpp
  • GetMetrics() : RecoDll.cpp
  • GetMiscStatus() : ioo.h
  • GetModuleFileNameFromHeader() : DebDebug.c
  • GetMofInfoHead() : tracedmp.cpp , tracewmi.cpp
  • GetMoniker() : iocs.h , ioo.h
  • GetNamedObjectFromCollection() : Adminwrap.Cpp , Adminwrap.h
  • GetNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • GetNewFspRegistryData() : NewFsp.h , Reg.c
  • GetNewId() : Stubs.c
  • GetNewMofInfo() : tracewmi.cpp
  • GetNewMove() : TServer.Idl
  • GETNEXT : SnmpUtil.C
  • GetNextArgument() : setup.h , utils.cpp
  • GetNextByte() : keys.cpp
  • GetNextGraphicSlot() : Paint.h , Paint.c
  • GetNextLine() : main.cpp
  • GetNextName() : Render.Cpp
  • GetNextNode() : LinkList.h , LinkList.c
  • GetNextReceipt() : account.Idl
  • GetNextSlots() : hashtbl.cpp , hashtbl.h
  • GetNextToken() : sdkdiff.cpp
  • GetNmchSz() : Debug.Cpp , Global.h
  • GetNoteString() : dump.cpp , sampclnt.h
  • GetNoteStringBitvals() : dump.cpp , sampclnt.h
  • GetNumberOfSamplesOnStream() : Processing.cpp
  • GetObjectClsid() : clsid.Cpp , ShortName.h
  • GetObjectNameProperty() : Adminwrap.h
  • GetObjectTypeName() : error.cpp , error.h
  • GetODBCError() : updrec.Cpp , caccount.Cpp
  • GetOdbcError() : bankthrds.Cpp
  • GetOfflineLib() : app.cpp
  • GetOleDBErrorInfo() : QSample.Cxx
  • GetOleError() : Except.Cxx , Except.Hxx
  • GetOleObjectDataHere() : Utils.Cpp , Utils.h
  • GetOpenDlg() : Open.c , Open.h
  • GetOpenIconFileName() : IconPRO.C , IconPRO.h
  • GetOSVersion() : osv.Hxx
  • GetOurDataObject() : dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , Dataobj.Cpp , Dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h
  • GetOutputDebugString() : DebDebug.c
  • GetOverlappedStructure() : provider.h , overlap.cpp
  • GetParameters() : dbh.cpp
  • GetParentObject() : bindtoparent.cpp
  • GetParentUrl() : Sample1.Cpp , Sample1.h
  • GetPasswordExpired() : SubAuth.c
  • GetPasswordFromResponse() : Eap.c , Eap.h
  • GetPathFromFullPathName() : DebMisc.c , DebMisc.h
  • GetPhaseName() : error.cpp , error.h
  • GetPingResponder() : Server.Idl
  • GetPostedByte() : keys.cpp
  • GetPostKeys() : keys.cpp
  • GetPreferredPacketDescription() : RecoDll.cpp
  • GetPrevNode() : LinkList.c , LinkList.h
  • GetPrincipalSID() : DComPerm.h , UtilS.Cpp
  • GetPrintDlg() : Print.c
  • GetPrintDlgHandle() : Print.c
  • GetPrinterDACL() : SecPrint.c
  • GetPrinterDC() : Print.c
  • GetPrinterDlgProc() : dialogs.c , dialogs.h
  • GetPrinterDriverDlgProc() : Common.h , Getpdriv.c
  • GetPrinterPath() : dialogs.h , dialogs.c
  • GetPrivateProfileSettings() : DebMisc.h , DebMisc.c
  • GetProcessSid() : SidClean.c
  • GetProgID() : common.cpp , common.h
  • GetPromotedType() : common.cpp , common.h
  • GetPropAddr() : keys.cpp
  • GetPropertiesFromWBEM() : tracewmi.cpp
  • GetProperty() : property.h , property.cpp , property.h , property.cpp , property.h , property.cpp , property.h
  • GetPropertyList() : main.hxx , dump.cxx
  • GetPropertyName() : error.h , error.cpp
  • GetPropertyRanges() : RecoDll.cpp
  • GetPropInfo() : property.cpp , property.h , property.cpp , property.h
  • GetPropInfoFlags() : property.cpp , property.h , property.cpp , property.h
  • GetPropSetName() : error.cpp , error.h
  • GetPropStatusName() : error.cpp , error.h
  • GetProviderCount() : instlsp.cpp
  • getPublicKeyBlob() : DirEncrypt.Cpp
  • getqbit : autotest.h
  • GetQos() : QosEvent.h , GetQos.Cpp
  • GetQueryByte() : keys.cpp
  • GetQueryType() : PerfUtil.c , PerfUtil.h , PerfUtil.c , PerfUtil.h
  • GetQueue() : printjob.c
  • GetQuotaLogFlags() : Commands.h , Commands.Cpp
  • GetRadioButton() : Util.Cpp , Global.h
  • GetRangePropertyValue() : RecoDll.cpp
  • GetRCString() : autotest.h
  • GetRealTextExtent() : Fx.c
  • GetReasonName() : error.cpp , error.h
  • GetRecoAttributes() : RecoDll.cpp
  • GetRegDWORD() : clUtil.h , clUtil.Cpp
  • GetRegEntry() : common.cpp , common.h , common.cpp , common.h , common.cpp , common.h
  • GetRegEnumKey() : common.h , common.cpp
  • GetRegEnumValue() : common.cpp , common.h , common.cpp
  • GetRegKeyValue() : Reg.Cpp
  • GetRemoteEnv() : Remote.c
  • GetReplaceDlgHandle() : Find.c
  • GetRequestId() : policy.cpp
  • GetResultPropertyList() : RecoDll.cpp
  • GetResultStr() : FullIME.h , ImeUI.C
  • GetRowCnt() : quiktest.c
  • GetRowColName() : error.h , error.cpp
  • GetRowCount() : bankthrds.Cpp , bankdlg.Cpp
  • GetRowsetFromDBSession() : sampclnt.h , sampclnt.cpp
  • GetRowsOptionEnum : adoint.h
  • GetRSAKeyFromCert() : SignHash.cpp
  • GetRSAKeyFromContainer() : SignHash.cpp
  • GetRunAsPassword() : SrvcMgmt.Cpp , DComPerm.h
  • GetSampleID() : Processing.cpp
  • GetSampprovDataSource() : sampclnt.cpp , sampclnt.h
  • GetSaveIconFileName() : IconPRO.C , IconPRO.h
  • GetSchemaName() : cdialog.cpp , cdialog.h
  • GetScreenCenterCoord() : setupui.cpp
  • GetSegmentAlternateList() : RecoDll.cpp
  • GetSelectedMember() : cMemb.Cpp , cMemb.h
  • GetServerCallbackInterface() : Policy.Cpp , exit.cpp , Exit.h , exit.h , Exit.Cpp , Policy.h
  • GetSetupDlgHandle() : Print.c
  • GetSharedMemoryDataHeader() : AppMemi.h , ShareMem.c
  • GetSockAddrString() : rnrcs.cpp
  • GetSocket() : Sockdups.c
  • GetSomeData() : quiktest.c
  • GetSpecialFolder() : sendto.c
  • GetSqlErrorInfo() : error.cpp , error.h , error.cpp , error.h
  • GetState() : RmWorker.Idl
  • GetStaticPropInfo() : error.cpp , error.h
  • GetStaticPropValues() : error.h , error.cpp
  • GetStatusName() : error.h , error.cpp
  • GetStatusValue() : error.h , error.cpp
  • getstr() : dbh.cpp
  • GetStream() : SimpleLog.Idl
  • GetString() : bits_ie.cpp , RecoDll.cpp
  • GetStringAttribute() : util.h , util.cpp
  • GetStringByteSize() : ShortName.h , Cleanup.h
  • GetStringByteSizeUnicode() : Cleanup.h , ShortName.h
  • GetStringFromConfig() : Redir401.cpp
  • GetStringRes() : MfEdit.h , Printer.c , PlgBlt.h , StatList.c , WinUtils.c , WinUtils.h , SpinCube.c , Generic.C , WxForm.c , Globals.h , PlgBlt.c , SpinTest.c , Common.h , LeakyBin.c , Misc.c , MfEdit.c
  • GetStringRes2() : Common.h , Printer.c , MfEdit.h , MfEdit.c
  • GetStrokeRanges() : RecoDll.cpp
  • GetSupportedGeometrys() : Mfmt.c
  • GetSystemPalette() : Dibapi.h , Dibutil.c
  • GetSystemTimeAsUINT64() : bits_ie.cpp
  • GetTapeGUID() : stl_write.cpp
  • GetTargetClause() : Setcomp.c
  • GetTerminal() : FileTerm.h , Outgoing.Cpp , Incoming.Cpp
  • GetTerminalFromMediaEvent() : Processing.cpp
  • GetTerminalFromStreamEvent() : Processing.cpp , CallNot.cpp
  • GetTextExtent() : tprint.cpp
  • GetTextFromSTRRET() : Utility.Cpp , Utility.h
  • GetTextualSid() : TextSid.c , MainFrm.Cpp
  • GetThis() : common.cpp , common.h
  • GetTmWhereabouts() : CopyFileRm.Idl
  • GetTokenHandle() : TakeOwn.c
  • GetTransactionId() : RmWorker.Idl
  • GetTypeInfo() : quiktest.c
  • GetUIObjectOfAbsPidl() : sendto.c
  • GetUIObjectOfPath() : sendto.c
  • GetUrlKeys() : keys.cpp
  • GetUserClassID() : ioo.h
  • GetUserGroups() : service.cpp , service.h , Service.h , Service.cpp
  • GetUserInfoAndUpdateCookie() : CustomAuth.cpp
  • GetUsernameAndPassword() : Eap.h , Eap.c
  • GetUserPropertyMethods() : iasuser.cpp
  • GetUserQuotaInfo() : Commands.Cpp , Commands.h
  • GetUserSID() : Service.cpp , Service.h
  • GetUserSid() : SecFile.c
  • GetUserSID() : service.h , service.cpp
  • GetUserSidFromToken() : Util.Cpp , Util.h
  • GetUserType() : ioo.h
  • GetVariantSize() : marshalhelpers.h
  • GetVariantStyle() : ADSIhelpers.h , ADSIhelpers.cpp , ADSIhelpers.h
  • GetVariantType() : common.cpp , common.h
  • GetVariantTypeName() : common.h , common.cpp
  • GetVersionInfo() : SysInf_C.c
  • GetVideoRenderTerminal() : Incoming.Cpp , Outgoing.Cpp
  • GetVideoRenderTerminalFromStreamEvent() : Callnot.Cpp
  • GetViewInterface() : Utility.Cpp , Utility.h
  • GetWindow() : ioips.h , ioipo.h , ioipao.h , ioipf.h
  • GetWindowContext() : ioips.h
  • GetWindowPos() : common.cpp , common.h
  • GetWindowSize() : common.h , common.cpp
  • GetWKDomainObject() : wkguid.cpp
  • GetWKOObject() : otherwko.cpp , otherwko1.cpp
  • GetWorkArea() : tallmenu.c
  • GetWorkerWindow() : asyncselect.cpp , provider.h
  • GetWorkQueueEntry() : ThreadPool.h , ThreadPool.c
  • GetXORImageRect() : Icons.C , Icons.h
  • gEvent_handle : RasDialAsync.c
  • gExecCmd : dbh.cpp
  • gfAutoAnswer : Callnot.Cpp , Incoming.Cpp
  • gfCallRequest : Dialer.c
  • gfCurrentLineAvail : Dialer.c
  • gfile_new() : gfile.cpp , gutils.h
  • gfile_open() : gfile.cpp , gutils.h
  • gfMakeCallReplyPending : Dialer.c
  • gfNeedToReinit : Dialer.c
  • gfRegistered : Dialer.c
  • gfThreadProc() : mspthrd.cpp
  • ghAccelApp : MciPlay.c
  • ghAccelTable : Main.Cpp , Global.h , Main.Cpp , Global.h
  • ghBitmap : WinCap.c
  • ghbmLogo : WinCap.c
  • ghBmp : MfEdit.h
  • ghBmpDn : MfEdit.h
  • ghBmpMask : MfEdit.h
  • ghBmpUp : MfEdit.h
  • ghbrAppBkgd : MfEdit.h
  • ghbrCur : MfEdit.h
  • ghbrRed : MfEdit.h
  • ghCall : Dialer.c
  • ghChildFileMappingEvent : Sockdups.c
  • ghCurFont : MfEdit.h
  • ghdc : Printer.h
  • ghDCMem : MfEdit.h
  • ghDCMetaf : MfEdit.h
  • ghDlg : Outgoing.Cpp , Incoming.Cpp , Callnot.Cpp
  • ghdlgStatus : Global.h
  • ghDLLInst : Dllinit.c , Print.c , Hook.c
  • gHeight : odbcsql.c
  • ghEventEnd : SysInfo.h
  • ghFont : TIMEWND.c
  • ghFontBtn : Dialer.c
  • ghFontBtnStar : Dialer.c
  • ghFontBtnText : Dialer.c
  • ghfontEntry : Global.h , Main.Cpp
  • ghfontMsg : Main.Cpp
  • ghHT : MfEdit.h
  • ghInst : MidiPlyr.c , Dialogs.c , Dialer.c , Main.Cpp , Outgoing.Cpp , Global.h , Main.Cpp , SpinTest.h , DynDlg.c , Dlgopen.c , Printer.h , Global.h , MousInfo.c , ui.cpp , Atsp.h , Global.h , Incoming.Cpp , ole2ui.c , MidiPlyr.h , Paint.h , WinCap.c , Main.Cpp , Global.h , Common.h
  • ghInstance : InstCodc.Cpp
  • ghInstApp : MciPlay.c
  • ghIocp : overlap.cpp , spi.cpp
  • ghLibHandle : RasHost.Cpp
  • ghLineApp : Dialer.c
  • ghMenu : Global.h , Main.Cpp , Global.h , Main.Cpp
  • ghMetaf : MfEdit.h
  • ghmf : MfEdit.h
  • ghMMFileMap : Sockdups.c
  • ghMod : SpinCube.c
  • ghModule : MainDll.Cpp , MfEdit.h , MainDll.Cpp
  • ghPal : MfEdit.h , WinCap.c
  • ghParentFileMappingEvent : Sockdups.c
  • ghpnCur : MfEdit.h
  • ghpnWide : MfEdit.h
  • ghTextWnd : MfEdit.h
  • ghToolBmpDn : MfEdit.h
  • ghToolBmpUp : MfEdit.h
  • ghVerifyDlg : SetDisp.h
  • ghWakeupSemaphore : overlap.cpp
  • ghWnd : halftone.c
  • ghwndAbort : Printer.h
  • ghwndApp : Main.Cpp , MciPlay.c , Global.h
  • ghWndCapture : WinCap.c
  • ghwndChat : Global.h , Main.Cpp
  • ghwndClient : MfEdit.h
  • ghwndCtrlPanel : MfEdit.h
  • ghwndDevCaps : Getcaps.h
  • ghWndDialing : Dialer.c
  • ghwndDrawSurf : MfEdit.h
  • ghwndEdit : Main.Cpp , Global.h
  • ghwndEntry : Main.Cpp
  • ghwndEnumPrt : Enumprt.h
  • ghwndLView : Global.h , Main.Cpp
  • ghwndMain : Global.h , Getcaps.h , Getpdriv.h , Global.h
  • ghWndMain : Dialer.c
  • ghwndMain : MfEdit.h , Enumprt.h , Main.Cpp , Global.h , Main.Cpp
  • ghWndMain : Dllinit.c
  • ghwndMain : Printer.h
  • ghWndMain : Hook.c , WinCap.c
  • ghwndMain : Main.Cpp
  • ghWndMain : Dialogs.c
  • ghwndMain : Paint.h
  • ghwndMdi : MciPlay.c
  • ghwndMsg : Global.h , Main.Cpp , Global.h , Main.Cpp
  • ghwndNext : MfEdit.h
  • ghwndProgress : CConf.Cpp
  • ghwndSbar : Global.h , Main.Cpp , Global.h
  • ghwndSend : Main.Cpp , Global.h
  • ghWndStatus : MainWND.c
  • ghwndTbar : Main.Cpp , Global.h
  • ghWndTime : MainWND.c
  • ghWndToolbar : MainWND.c
  • ghwndTools : MfEdit.h
  • ghwndUList : Global.h , Main.Cpp
  • ghwndUser : Global.h , Main.Cpp
  • giBrushStyle : Printer.h
  • giColumn : Paint.h
  • giCurrentAddress : Dialer.c
  • giCurrentLine : Dialer.c
  • giDeltaX : Paint.h
  • giDeltaY : Paint.h
  • gImageName : dbh.cpp
  • giMapMode : Printer.h , Paint.h
  • gImeUIData : Global.C , FullIME.h
  • GINASTUB_VERSION : GinaStub.c , GinaHook.c
  • gInterface : Mcastws2.c , Mcastws1.c
  • giNumSpincubesAllProcesses : SpinCube.c
  • giNumSpincubesThisProcess : SpinCube.c
  • giPenStyle : Printer.h
  • giPenWidth : Printer.h
  • GiveFeedback() : ids.h
  • GiveUsage() : Simple.c
  • GIZMO_DISABLED : GizmoBar.h
  • GIZMO_NORMAL : GizmoBar.h
  • GIZMOTYPE_BUTTONATTRIBUTEEX : GizmoBar.h
  • GIZMOTYPE_BUTTONATTRIBUTEIN : GizmoBar.h
  • GIZMOTYPE_BUTTONCOMMAND : GizmoBar.h
  • GIZMOTYPE_BUTTONNORMAL : GizmoBar.h
  • GIZMOTYPE_COMBOBOX : GizmoBar.h
  • GIZMOTYPE_EDIT : GizmoBar.h
  • GIZMOTYPE_LISTBOX : GizmoBar.h
  • GIZMOTYPE_SEPARATOR : GizmoBar.h
  • GIZMOTYPE_TEXT : GizmoBar.h
  • gLayerCount : sockinfo.cpp , spi.cpp
  • glcyMenu : Printer.h , Paint.h
  • glcyStatus : MfEdit.h
  • glf : MfEdit.h
  • gLine : dbh.cpp
  • gListCritSec : PrPerf.c
  • glNumInst : ClassProv.Cpp , Sample.h , InstProv.Cpp
  • GLOBAL : Global.h , DebMain.h
  • Global : DebMain.h , DebMain.c
  • GLOBAL_() : sampprov.h
  • global_asc_flags : GssServer.c
  • GLOBAL_HEAP : defs.h
  • GLOBAL_STRING : PerfUtil.h , PerfUtil.c , PerfUtil.h
  • GlobalAddAtom_AW : ansiapi.h
  • GlobalAllocP() : AppMema.c , AppMem.h
  • GlobalFreeP() : AppMema.c , AppMem.h
  • GlobalGetAtomName_AW : ansiapi.h
  • GLOBALINIT() : Global.h
  • GlobalReAllocP() : AppMema.c , AppMem.h
  • GLOBALS_HERE : CSSamp.Cpp
  • gLoopBack : Mcastws2.c , Mcastws1.c
  • gM : Paint.h
  • gMakeCallRequestID : Dialer.c
  • gMessage : rawudp.c
  • gModName : dbh.cpp
  • gMtuSize : rawudp.c
  • gMulticast : Mcastws2.c , Mcastws1.c
  • gnAddr : Dialer.c
  • gnAvailDevices : Dialer.c
  • GNB_DECODED_CHAR : keys.cpp
  • GNB_NORMAL_CHAR : keys.cpp
  • GNB_NOTHING_LEFT : keys.cpp
  • gnCurrentMode : SetDisp.h
  • gnModes : SetDisp.h
  • gnPosY : TIMEWND.c
  • gnSB_TFPaneSize : MainWND.c
  • gnTimeFormat : MidiPlyr.c , MidiPlyr.h
  • gnTimerOn : TIMEWND.c
  • gNumTimes : PrPerf.c
  • gObj : dbh.cpp
  • gOptions : dbh.cpp
  • GoToLineDlgProc() : findgoto.cpp , sdkdiff.h , findgoto.h
  • gOverlappedCS : spi.cpp , overlap.cpp
  • GoWeb() : AppUtil.h , AppUtil.Cpp , AppUtil.h
  • gpAddress : Outgoing.Cpp
  • gpCall : Incoming.Cpp , Outgoing.Cpp , Callnot.Cpp
  • gpccs : SpinCube.c
  • gpCurrentMode : SetDisp.h
  • gpDevModes : SetDisp.h
  • gpfnCompletionProc : Atsp.h
  • gpfnGetEnhMetaFilePixelFormat : MfEdit.h
  • gpfnReceiveProc : RasHost.h , RasHost.Cpp
  • gpfnSendProc : RasHost.h , RasHost.Cpp
  • gpnAudCapOrderedIndex : InstCodc.Cpp
  • gPort : Mcastws1.c , Mcastws2.c
  • gPref : Main.Cpp , Global.h , Main.Cpp , Global.h
  • gProtocol : rawudp.c , Mcastws1.c , Mcastws2.c , Ping.cpp
  • gProtocolName : PrPerf.c
  • gpsAudCapInfoList : InstCodc.Cpp
  • gpSeq : MidiPlyr.h , MidiPlyr.c
  • GPT_BASIC_DATA_ATTRIBUTE_HIDDEN : DLEdit.Cpp
  • gpTapi : Outgoing.Cpp , Incoming.Cpp
  • gpWFmt : InstCodc.Cpp
  • GrabChunk() : DynOutp.c
  • GRAPHICLOOKUP : Printer.h
  • grbChanMsgLen : SMFREAD.c
  • grcTWnd : MidiPlyr.h , MidiPlyr.c
  • gReadRaw : rawudp.c
  • GREATERTHAN : common.h
  • GREEN_COLOR : DoServer.h
  • grfMode : OleStd.h
  • grgszTimeFormats : MidiPlyr.h , MidiPlyr.c
  • grHwndCtrlBtn : MfEdit.h
  • grHwndToolBtn : MfEdit.h
  • GRIDCOLOR : PlgBlt.h , WxForm.h
  • GrokInt : callback.Cpp
  • GrokStr : callback.Cpp
  • Group : resource.h
  • GROUP_MENU_BASE_ID : ExtObjData.cpp
  • GROUP_MENU_ID_1 : ExtObjData.cpp
  • gsAccept : Sockdups.c
  • gsConnect : Sockdupc.c
  • GSCRP_BEGIN_FORM : scripts.h
  • GSCRP_DELETE_BUTTON : scripts.h
  • GSCRP_END_FORM : scripts.h
  • GSCRP_LINK_HOMEPAGE : scripts.h
  • GSCRP_RENAME_BUTTON : scripts.h
  • gSendCount : rawudp.c
  • gSender : rawudp.c
  • gSendSize : rawudp.c
  • gServerName : PrPerf.c
  • gServerType : PrPerf.c
  • gServerZone : PrPerf.c
  • gsListen : Sockdups.c
  • gSocketList : PrPerf.c
  • gSocketMonitor : Dt_Dll.Cpp
  • gSocketType : Mcastws2.c , Mcastws1.c , rawudp.c
  • gSrcAddress : rawudp.c
  • gSrcFileName : dbh.cpp
  • gSrcPort : rawudp.c
  • gss_buffer_desc : GssAPI.h
  • gss_buffer_t : GssAPI.h
  • GSS_C_ACCEPT : GssAPI.h
  • GSS_C_AF_APPLETALK : GssAPI.h
  • GSS_C_AF_BSC : GssAPI.h
  • GSS_C_AF_CCITT : GssAPI.h
  • GSS_C_AF_CHAOS : GssAPI.h
  • GSS_C_AF_DATAKIT : GssAPI.h
  • GSS_C_AF_DECnet : GssAPI.h
  • GSS_C_AF_DLI : GssAPI.h
  • GSS_C_AF_DSS : GssAPI.h
  • GSS_C_AF_ECMA : GssAPI.h
  • GSS_C_AF_HYLINK : GssAPI.h
  • GSS_C_AF_IMPLINK : GssAPI.h
  • GSS_C_AF_INET : GssAPI.h
  • GSS_C_AF_LAT : GssAPI.h
  • GSS_C_AF_LOCAL : GssAPI.h
  • GSS_C_AF_NBS : GssAPI.h
  • GSS_C_AF_NS : GssAPI.h
  • GSS_C_AF_NULLADDR : GssAPI.h
  • GSS_C_AF_OSI : GssAPI.h
  • GSS_C_AF_PUP : GssAPI.h
  • GSS_C_AF_SNA : GssAPI.h
  • GSS_C_AF_UNSPEC : GssAPI.h
  • GSS_C_AF_X25 : GssAPI.h
  • GSS_C_ANON_FLAG : GssAPI.h
  • GSS_C_BOTH : GssAPI.h
  • GSS_C_CALLING_ERROR_MASK : GssAPI.h
  • GSS_C_CALLING_ERROR_OFFSET : GssAPI.h
  • GSS_C_CONF_FLAG : GssAPI.h
  • GSS_C_DELEG_FLAG : GssAPI.h
  • GSS_C_EMPTY_BUFFER : GssAPI.h
  • GSS_C_GSS_CODE : GssAPI.h
  • GSS_C_INDEFINITE : GssAPI.h
  • GSS_C_INITIATE : GssAPI.h
  • GSS_C_INTEG_FLAG : GssAPI.h
  • GSS_C_MECH_CODE : GssAPI.h
  • GSS_C_MUTUAL_FLAG : GssAPI.h
  • GSS_C_NO_BUFFER : GssAPI.h
  • GSS_C_NO_CHANNEL_BINDINGS : GssAPI.h
  • GSS_C_NO_CONTEXT : GssAPI.h
  • GSS_C_NO_CREDENTIAL : GssAPI.h
  • GSS_C_NO_OID : GssAPI.h
  • GSS_C_NO_OID_SET : GssAPI.h
  • GSS_C_NULL_OID : GssAPI.h
  • GSS_C_NULL_OID_SET : GssAPI.h
  • GSS_C_QOP_DEFAULT : GssAPI.h
  • GSS_C_REPLAY_FLAG : GssAPI.h
  • GSS_C_ROUTINE_ERROR_MASK : GssAPI.h
  • GSS_C_ROUTINE_ERROR_OFFSET : GssAPI.h
  • GSS_C_SEQUENCE_FLAG : GssAPI.h
  • GSS_C_SUPPLEMENTARY_MASK : GssAPI.h
  • GSS_C_SUPPLEMENTARY_OFFSET : GssAPI.h
  • GSS_CALLING_ERROR : GssAPI.h
  • GSS_CALLING_ERROR_FIELD : GssAPI.h
  • gss_channel_bindings_t : GssAPI.h
  • gss_cred_id_t : GssAPI.h
  • gss_cred_usage_t : GssAPI.h
  • gss_ctx_id_t : GssAPI.h
  • GSS_ERROR : GssAPI.h
  • gss_int32 : GssAPI.h
  • gss_name_t : GssAPI.h
  • gss_OID : GssAPI.h
  • gss_OID_desc : GssAPI.h
  • gss_OID_set : GssAPI.h
  • gss_OID_set_desc : GssAPI.h
  • gss_qop_t : GssAPI.h
  • GSS_ROUTINE_ERROR : GssAPI.h
  • GSS_ROUTINE_ERROR_FIELD : GssAPI.h
  • GSS_S_BAD_BINDINGS : GssAPI.h
  • GSS_S_BAD_MECH : GssAPI.h
  • GSS_S_BAD_NAME : GssAPI.h
  • GSS_S_BAD_NAMETYPE : GssAPI.h
  • GSS_S_BAD_QOP : GssAPI.h
  • GSS_S_BAD_SIG : GssAPI.h
  • GSS_S_BAD_STATUS : GssAPI.h
  • GSS_S_CALL_BAD_STRUCTURE : GssAPI.h
  • GSS_S_CALL_INACCESSIBLE_READ : GssAPI.h
  • GSS_S_CALL_INACCESSIBLE_WRITE : GssAPI.h
  • GSS_S_COMPLETE : GssAPI.h
  • GSS_S_CONTEXT_EXPIRED : GssAPI.h
  • GSS_S_CONTINUE_NEEDED : GssAPI.h
  • GSS_S_CRED_UNAVAIL : GssAPI.h
  • GSS_S_CREDENTIALS_EXPIRED : GssAPI.h
  • GSS_S_DEFECTIVE_CREDENTIAL : GssAPI.h
  • GSS_S_DEFECTIVE_TOKEN : GssAPI.h
  • GSS_S_DUPLICATE_ELEMENT : GssAPI.h
  • GSS_S_DUPLICATE_TOKEN : GssAPI.h
  • GSS_S_FAILURE : GssAPI.h
  • GSS_S_GAP_TOKEN : GssAPI.h
  • GSS_S_NO_CONTEXT : GssAPI.h
  • GSS_S_NO_CRED : GssAPI.h
  • GSS_S_OLD_TOKEN : GssAPI.h
  • GSS_S_UNAUTHORIZED : GssAPI.h
  • GSS_S_UNAVAILABLE : GssAPI.h
  • GSS_S_UNSEQ_TOKEN : GssAPI.h
  • GSS_SIZEOF_INT : GssAPI.h
  • GSS_SIZEOF_LONG : GssAPI.h
  • GSS_SIZEOF_SHORT : GssAPI.h
  • GSS_SUPPLEMENTARY_INFO : GssAPI.h
  • GSS_SUPPLEMENTARY_INFO_FIELD : GssAPI.h
  • gss_uint32 : GssAPI.h
  • gSymbolSearchPath : dbh.cpp
  • gszAddr : Init.Cpp
  • gszAddrType : Init.Cpp
  • gszAppClassName : Main.Cpp , Init.Cpp , Main.Cpp
  • gszAppLongName : MidiPlyr.h , MidiPlyr.c
  • gszAppName : Main.Cpp , Init.Cpp , Main.Cpp , Global.h
  • gszAppTitle : MainWND.c , Main.Cpp
  • gszAppTitleMask : MidiPlyr.c , MidiPlyr.h
  • gszAtspKey : Atsp.h
  • gszBuffer : MciPlay.c
  • gszChat : Init.Cpp
  • gszConferenceName : Outgoing.Cpp , Init.Cpp
  • gszCurrentName : Dialer.c
  • gszCurrentNumber : Dialer.c
  • gszDefExtension : MainWND.c
  • gszDefLineConfigParams : Atsp.h
  • gszDevice : Print.c
  • gszDeviceName : Getpdriv.h , Getcaps.h , Printer.h
  • gszDriverName : Getcaps.h , Printer.h , Getpdriv.h
  • gszEmailName : Outgoing.Cpp
  • gszEnumName : Enumprt.h
  • gszFileName : Init.Cpp
  • gszFilter : MainWND.c
  • gszFormatHMS : TIMEWND.c
  • gszFormatTicks : TIMEWND.c
  • gszHRError : InstCodc.Cpp
  • gszIniAutoCall : Init.Cpp
  • gszIniAutoChat : Init.Cpp
  • gszIniAutoHost : Init.Cpp
  • gszIniAutoMonitor : Init.Cpp
  • gszIniCallType : Init.Cpp
  • gszIniInit : Init.Cpp
  • gszIniMsgNotify : Init.Cpp
  • gszIniMsgObjects : Init.Cpp
  • gszIniMsgState : Init.Cpp
  • gszIniMsgTrace : Init.Cpp
  • gszIniName : Init.Cpp , Global.h
  • gszIPAddress : Outgoing.Cpp
  • gszMachineName : Outgoing.Cpp
  • gszMainWnd : Init.Cpp
  • gszMsg : Init.Cpp
  • gszMsgFont : Init.Cpp
  • gszMWndClass : MidiPlyr.c , MidiPlyr.h
  • gszNULL : Dialer.c
  • gszNumLines : Atsp.h
  • gszOpenName : MainWND.c
  • gszOpenTitle : MainWND.c
  • gszOutput : Print.c
  • gszPhoneNumber : Outgoing.Cpp
  • gszPort : Printer.h , Getpdriv.h , Getcaps.h
  • gszSbar : Init.Cpp
  • gszSDNumber : Dialer.c
  • gszTapi30 : Incoming.Cpp , Outgoing.Cpp
  • gszTbar : Init.Cpp
  • gszTWndClass : MidiPlyr.c , MidiPlyr.h
  • gszUntitled : MidiPlyr.c , MidiPlyr.h
  • gszWindowText : WinCap.c
  • gtab_alloclinedata() : table.cpp , tpriv.h
  • gtab_append() : table.cpp
  • gtab_boxcell() : tpaint.cpp , tpriv.h
  • gtab_buildtable() : table.cpp
  • gtab_calcwidths() : table.cpp , tpriv.h
  • gtab_changesel() : tscroll.cpp
  • gtab_createtools() : table.cpp
  • gtab_dblclick() : tpriv.h , tscroll.cpp
  • gtab_delcr() : tpaint.cpp
  • gtab_delcrW() : tpaint.cpp
  • gtab_deltable() : tpriv.h , table.cpp
  • gtab_deltools() : table.cpp
  • gtab_dohscroll() : tscroll.cpp , tpriv.h
  • gtab_dovscroll() : tscroll.cpp , tpriv.h
  • gtab_drawvertline() : tpriv.h , tpaint.cpp
  • gtab_enter() : tpriv.h , tscroll.cpp
  • gtab_extendsel() : tscroll.cpp
  • gtab_freelinedata() : table.cpp
  • gtab_hsep() : tpriv.h , tpaint.cpp
  • gtab_init() : tpriv.h , gutils.cpp , table.cpp
  • gtab_insideselection() : tscroll.cpp
  • gtab_invallines() : tpriv.h , table.cpp
  • gtab_invertsel() : tpriv.h , tpaint.cpp
  • gtab_isborder() : tscroll.cpp
  • gtab_key() : tpriv.h , tscroll.cpp
  • gtab_linetorow() : tscroll.cpp , tpriv.h
  • gtab_mousewheel() : tscroll.cpp , tpriv.h
  • gtab_move() : tpriv.h , tscroll.cpp
  • gtab_msg_hscroll() : tpriv.h , tscroll.cpp
  • gtab_msg_vscroll() : tpriv.h , tscroll.cpp
  • gtab_msgcode : table.cpp
  • gtab_newsize() : table.cpp
  • gtab_paint() : tpaint.cpp , tpriv.h
  • gtab_paintcell() : tpaint.cpp
  • gtab_paintline() : tpaint.cpp , tpriv.h
  • gtab_paintunused() : tpriv.h
  • gtab_press() : tscroll.cpp , tpriv.h
  • gtab_print() : tprint.cpp , tpriv.h
  • gtab_printhead() : tprint.cpp
  • gtab_printjob() : tprint.cpp
  • gtab_printpage() : tprint.cpp
  • gtab_printsetup() : tprint.cpp
  • gtab_prtwidths() : tprint.cpp
  • gtab_release() : tpriv.h , tscroll.cpp
  • gtab_rightclick() : tscroll.cpp , tpriv.h
  • gtab_rowtoline() : tscroll.cpp , tpriv.h
  • gtab_select() : tscroll.cpp , tpriv.h
  • gtab_selhome() : tscroll.cpp
  • gtab_sendtq() : tpriv.h , table.cpp
  • gtab_setrects() : tprint.cpp
  • gtab_setsize() : table.cpp , tpriv.h
  • gtab_showsel() : tpriv.h , tscroll.cpp
  • gtab_showsel_middle() : tpriv.h , tscroll.cpp
  • gtab_trackcol() : tscroll.cpp
  • gtab_updatecontig() : tpaint.cpp
  • gtab_updateline() : tpaint.cpp
  • gtab_vsep() : tpaint.cpp , tpriv.h
  • gtab_wndproc() : table.cpp
  • gtab_xtocol() : tscroll.cpp
  • gtab_ytoline() : tscroll.cpp
  • gtCodec : InstCodc.Cpp
  • gTID : dbh.cpp
  • gTtl : Mcastws1.c , Ping.cpp , Mcastws2.c
  • guDevice : MainWND.c
  • GUID_SIZE : AppUtil.h , Reg.h
  • GUID_TYPE_DEFAULT : tracedmp.h
  • GUID_TYPE_EVENTTRACE : tracedmp.h
  • GUID_TYPE_HEADER : tracedmp.h
  • GUID_TYPE_UNKNOWN : tracedmp.h
  • guidDrawType : drawdlg.cpp , DrawDlg.Cpp
  • GuidEventId() : MtsUserEventObj.Idl
  • guidStorage : SmpFilt.Hxx
  • GUIDSTR_MAX : DComPerm.h
  • GUIDSTRING : MainDll.Cpp
  • GUIDtoBindableString() : otherwko.cpp , otherwko1.cpp
  • GuidToBstr() : qcsub.h , Methodsub.h , Identitysub.h , ObjPoolsub.h , activitysub.h , evtstoresub.h , ComSpy.Cpp , instancesub.h , securitysub.h , txsub.Cpp , ObjPool2sub.h , crmsub.h , appsub.h , Objsub.h , exceptionsub.h , usersub.h , threadsub.h , lbsub.h , Resourcesub.h , Objconstsub.h
  • GUIDToIndex() : RecoDll.cpp
  • GuidToSourceType() : cbase.h , cbase.cpp
  • GuidToString() : tracedmp.cpp , tracewmi.cpp
  • GuidToSz() : Global.h , Util.Cpp
  • guiFileOKMsg : WinCap.c , Dlgopen.c
  • gulAdvise : Incoming.Cpp
  • gulcInstances : HtmlIFlt.Cxx
  • guwRowCount : quiktest.c
  • gVars : WSnmpUtil.h , WSnmpUtil.Cpp
  • gWInfo : InstCodc.Cpp
  • GWL_SPINCUBEDATA : SpinCube.h
  • gWorkerThread : overlap.cpp
  • gXformedVertices : Paint.h
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- h -

  • hAbortWnd : tprint.cpp
  • haccel : sdkdiff.cpp
  • hAccTable : ClipText.c
  • HalftoneDialog() : halftone.c
  • Handle : enablerouter.c
  • HANDLE : GinaHook.h , GinaStub.h , rqsengine.h
  • HANDLE_GETINTERFACE : cbase.h
  • HANDLE_RADIUS : Behavior.h
  • HANDLE_WM_MOVING : Globals.h
  • HandleActiveReq() : filerepclientproc.cpp
  • HandleAddObjectCommand() : nshsamp.h , sample.cpp
  • HandleApplicationAccessOption() : DComPerm.Cpp
  • HandleApplicationLaunchAndActivateOption() : DComPerm.Cpp
  • HandleBreakPointException() : DebDebug.c
  • HandleCandPaint() : IMEApps.h , Paint.c
  • HandleChangeAttr() : IMEApps.h , Setcomp.c
  • HandleChangeColors() : Menu.c
  • HandleChar() : Comp.c , IMEApps.h
  • HandleCOMCallback() : bits_ie.cpp
  • HandleCommand() : Rebar.c
  • HandleCommEvent() : CommCode.c
  • HandleCompletion() : CacheIsapi.cpp , ReMapUrl.cpp , UpCaseMap.cpp
  • HandleComposition() : IMEApps.h , Comp.c
  • HandleConvertCommand() : IMEApps.h , Mode.c
  • HandleCreate() : Menu.c
  • HandleCreateProcessEvent() : DebDebug.c
  • HandleCreateThreadEvent() : DebDebug.c
  • HANDLED_MSG : common.h , winmain.h
  • HandleDefaultAccessOption() : DComPerm.Cpp
  • HandleDefaultLaunchOption() : DComPerm.Cpp
  • HandleDragDrop() : DragImg.Cpp
  • HandleDrawItem() : Menu.c
  • HandleEndComposition() : Comp.c , IMEApps.h
  • HandleError() : odbcsql.c , common.c , common.h , main.cpp
  • HandleErrors() : MQPort.Cpp
  • HandleEvent() : Overlap.c
  • HandleExceptionEvent() : DebDebug.c
  • HandleExecUrlCompletion() : CustomAuth.cpp
  • HandleExitProcessEvent() : DebDebug.c
  • HandleExitThreadEvent() : DebDebug.c
  • HandleFontCheckBox() : Font.c
  • HandleIniFileCorrupt() : TapiCode.c
  • HandleLineErr() : TapiCode.c
  • HandleLoadDllEvent() : DebDebug.c
  • HandleMachineAccessOption() : DComPerm.Cpp
  • HandleMachineLaunchAndActivateOption() : DComPerm.Cpp
  • HandleMenuPopup() : Rebar.c
  • HandleModeCommand() : Mode.c , IMEApps.h
  • HandleNoDevicesInstalled() : TapiCode.c
  • HandleNoDriver() : TapiCode.c
  • HandleNoMem() : TapiCode.c
  • HandleNoMultipleInstance() : TapiCode.c
  • HandleNotify() : OpenDIB.c , Comp.c , IMEApps.h , DragImg.Cpp
  • HandleOperationFailed() : TapiCode.c
  • HandleOutputDebugStringEvent() : DebDebug.c
  • HandlePaint() : IMEApps.h , Paint.c , Menu.c
  • HandlePopupMenu() : SetDisp.c , SetDisp.h , Menu.c
  • HandleReadData() : CommCode.c
  • HandleReadEvent() : CommCode.c
  • HandleReceivedMessage() : MQPort.Cpp
  • HandleReInit() : TapiCode.c
  • HandleReq() : FileRepClientProc.cpp , filerepclientproc.cpp
  • HandleResetAllCommand() : nshsamp.h , sample.cpp
  • HandleResetSprocketCommand() : nshsamp.h , sample.cpp
  • HandleResetWidgetCommand() : nshsamp.h , sample.cpp
  • HandleResourceUnavail() : TapiCode.c
  • HandleRipEvent() : DebDebug.c
  • HANDLERITEM_SYNCSTATUS : Handler.h
  • HANDLERITEMSETTINGS : Settings.h
  • HANDLERITEMSKEY : Reg.Cpp
  • HandlerRoutine() : SysInfo.h , SysInf_S.c
  • HandlerThreadWndProc() : Handler.Cpp , Handler.h
  • HandleRunAsOption() : DComPerm.Cpp
  • HANDLERVALUE_DIR1 : Reg.Cpp
  • HANDLERVALUE_DIR2 : Reg.Cpp
  • HANDLERVALUE_DISPLAYNAME : Reg.Cpp
  • HANDLERVALUE_FILETIME : Reg.Cpp
  • HANDLERVALUE_RECURSIVE : Reg.Cpp
  • HANDLES : quiktest.c
  • HandleSendPageCompletion() : CustomAuth.cpp
  • HandleSetGatewayCommand() : nshsamp.h , sampinterface.cpp
  • HandleSetInterfaceCommand() : nshsamp.h , sampinterface.cpp
  • HandleSetObjectCommand() : nshsamp.h , sample.cpp
  • HandleShowErrorCommand() : nshsamp.h , subcontext.cpp
  • HandleShowObjectCommand() : nshsamp.h , sample.cpp
  • HandleShowRandomSettingsCommand() : nshsamp.h , sampinterface.cpp
  • HandleSReq() : FileRepServerProc.cpp
  • HandleStartComposition() : Comp.c , IMEApps.h
  • HandleTheCommand() : CDTest.c , CDTest.h
  • HandleTimerTick() : bits_ie.cpp
  • HandleUnknownEvent() : DebDebug.c
  • HandleUnloadDllEvent() : DebDebug.c
  • HandleUpdate() : bits_ie.cpp
  • HandleWriteData() : CommCode.c
  • HandsOffStorage() : ips.h
  • HangupCall() : TapiCode.c , TapiCode.h
  • hAppMemSharedMemory : DllInit.c
  • HAS_BIT_STYLE : ADSIhelpers.h
  • hash_string() : gutils.h , utils.cpp
  • HASH_TABLE : hashtable.h
  • HatchWndProc() : hatch.c
  • hBigMenu : Menu.c
  • hBLRPLATE : blrplate.c
  • hbmCheckOff : Menu.c
  • hbmCheckOn : Menu.c
  • hbmMask : PlgBlt.c
  • hBmpLoadBitmapFile() : MfEdit.c , MfEdit.h
  • hbmSrc : PlgBlt.c
  • hbrBackground : status.cpp
  • hbrBtnFace : Status.c , Tools.c
  • hBrCreateBrush() : MfEdit.c , MfEdit.h
  • hbrLeft : bar.cpp
  • hbrRight : bar.cpp
  • hbrSame : bar.cpp
  • hbrSideBar : bar.cpp
  • hBrushButton : Find.c , Open.c , Print.c
  • hBrushDlg : Find.c , Open.c , Print.c
  • hBrushEdit : Find.c , Open.c , Print.c
  • hbrWindow : Tools.c
  • hButton : AsyncDemo.cpp
  • hChildMenu : MfEdit.h
  • hChildMenuWindow : MfEdit.h
  • hColorThread1 : Colors.c
  • hColorThread2 : Colors.c
  • HCOMMDEV : iplgxprt.idl
  • hConnect : FTPJr.cpp
  • hCreateRGBPalette() : MfEdit.c
  • HCTE_ENCODER : ctetest.h
  • hCurKL : FullIME.h , Global.C
  • HD_AUTHENTICATE : Get_Sock.c
  • HD_CONNECTION : Get_Sock.c
  • HD_LENGTH : Get_Sock.c
  • hData : ClipText.c
  • hdbc : quiktest.h
  • hDbgMsgLog : DbgMsg.cpp , dbgmsg.cpp
  • hdc : OleStd.h , Font.c
  • hdcDest : PlgBlt.c
  • hDCGlobal : Mypal.c
  • hdcGlobal : Paint.h
  • HDCINVALID : Font.c
  • hdcMask : PlgBlt.c
  • HDCNULL : Font.c
  • HDCPRINTER : Font.c
  • hDCRecordMetafileAs() : MfEdit.c , MfEdit.h
  • HDCSCREEN : Font.c
  • hdcSrc : PlgBlt.c
  • hdesc : quiktest.h
  • HDESK : GinaHook.h , GinaStub.h
  • hDevMode : Print.c
  • hDevNames : Print.c
  • hDialog : Open.c
  • hDialogColors : Colors.c
  • hDialogFind : Find.c
  • hDialogFont : Font.c
  • hDialogPrint : Print.c
  • HDIB : Dibapi.h
  • hDlg : Monkey.c
  • hDlgAbort : Print.c
  • hDllInstance : asyncselect.cpp , spi.cpp , clsid.Cpp , RegisterServer.Cpp , ShortName.Cpp , ShortName.h , UnRegisterServer.Cpp , Cleanup.Cpp , Cleanup.h , RegisterServer.Cpp , UnRegisterServer.Cpp
  • HEAD_OFFSET : spy.cpp
  • HEAD_SIGNITURE : spy.cpp
  • HEADER : malspy.c
  • Header() : AsyncDemo.cpp , TextWnd.Cpp
  • HEADER_OFFSET : spy.cpp
  • HEADERSIZE : CMallSpy.Cxx , spy.cpp
  • Heading1Token : HtmlScan.Hxx
  • Heading2Token : HtmlScan.Hxx
  • Heading3Token : HtmlScan.Hxx
  • Heading4Token : HtmlScan.Hxx
  • Heading5Token : HtmlScan.Hxx
  • Heading6Token : HtmlScan.Hxx
  • Headline : news.Idl
  • HEADSIGN : spy.cpp
  • HEADSIZE : spy.cpp
  • HEAP_PROBE : PerfUtil.h
  • HEAPMIN : dballoc.Cpp
  • HEAPREALLOC : StdAfx.h
  • hEditMenu : FontView.c
  • HelloProc() : Hellop.c , CallAs.Idl , OHello.Idl , ClUuidp.c , Dyneptp.c
  • HelloProc2() : ClUuidp.c , ClUuids.c
  • HelloWorld : ADsFirstExt.h
  • HELP_DEFAULT : mmcsample.h
  • HELP_FILE_EXT : AppUtil.h
  • HELP_INTRO : mmcsample.h
  • HELP_PAGE : CacheIsapi.cpp
  • HELP_STEPFOUR : mmcsample.h
  • HELP_STEPONE : mmcsample.h
  • HELP_STEPTHREE : mmcsample.h
  • HELP_STEPTWO : mmcsample.h
  • HelpDlgProc() : WinCap.h
  • HELPFILE_STR : DfV.h
  • HelpScreen() : tapisend.cpp
  • helpstring() : ComSpy.Idl , MtsUserEventObj.Idl , BYOTTransaction.Idl , TxEnlister.Idl , CrmFilesTest.Idl , CrmMonComp.Idl , news.Idl , VCSecuritySample.Idl , ADOKB.Idl , OLEDBKB.Idl , RDOKB.Idl , data.Idl , GraphObj.Idl
  • hemfLoadMetafile() : MfEdit.c , MfEdit.h
  • henv : quiktest.h
  • HEVENT : iplgxprt.idl
  • hEvent : RasHost.h
  • hEventLog : Perfmsg.h , PerfUtil.c , Perfmsg.h , PerfUtil.c
  • hevtDone : sserver.cpp
  • HEX_0 : stl_mll.cpp
  • HEX_9 : stl_mll.cpp
  • HEX_A : stl_mll.cpp
  • HEX_F : stl_mll.cpp
  • HEXADECIMAL : Grid.Hxx
  • HexDigitToInt() : keys.cpp
  • HexDumper() : formdump.cpp
  • HexToBin() : Util.Cpp
  • HexToData() : Global.h , Util.Cpp
  • HexToInt() : Settings.Cpp
  • hFileMenu : FontView.c
  • hfntFixed : FullIME.h , Global.C , Main.C
  • hfntOld : FullIME.h , Global.C , Main.C
  • hFont : status.cpp , OleStd.h , Data.c , IMEApps.h
  • hFontCopyright : ABOUT.c , About.c
  • hfontDlg : Connect.c , Listen.c
  • hfontNil : Global.h
  • hfontStatus : Status.c
  • hFontThread1 : Font.c
  • hFontThread2 : Font.c
  • hfontTools : Tools.c
  • hgdiNil : Global.h
  • HGLOBAL : OleStd.h
  • hHeap : file.cpp , sdkdiff.h , FaxSiren.Cpp , DebDebug.c , Monkey.c
  • hHelpMenu : FontView.c
  • hHook : Find.h
  • hHourGlass : Cursor.c
  • HI_BYTE : parser.h
  • hIcon : halftone.c
  • HIconAndSourceFromClass() : getIcon.c , Utility.h
  • HIconFromClass() : Utility.c , Utility.h
  • HIDDEN_PARTITION_FLAG : DLEdit.Cpp
  • hide_markedfiles : sdkdiff.cpp , sdkdiff.h
  • HIDWORD : sdksamplestoragesystem.h
  • HIGH : nshsamp.h
  • HIGHBIT : policy.cpp , Policy.Cpp
  • Hilbert() : fulldrag.c
  • Hilbert_OnPaint() : fulldrag.c
  • Hilbert_WndProc() : fulldrag.c
  • HIMETRIC_PER_INCH : OleStd.h , site.Cpp
  • hInst : Demo.c , Generic.C , sdkdiff.cpp , sdkdiff.h , OleStd.h , Tools.c , TextFx.c , ViewDIB.c , halftone.c , PlgBlt.c , WxForm.h , GLOBALS.h , INIT.c , Globals.h , Init.c , EventSink.cpp , Client32.c , Server32.c , Monkey.c , StatList.c , LeakyBin.c , ClipText.c , CDTest.h , Cursor.c , Data.c , IMEApps.h , Data.C , MultiUI.h , Menu.c , IconPRO.C , Icons.C , MDIChild.C
  • Hinstance : enablerouter.c
  • HINT_UPDATE_ALL_ITEMS : globals.h
  • HINT_UPDATE_ITEM : globals.h
  • hInWnd : Globals.h
  • hKey : OleStd.h
  • HKEY : OleStd.h
  • HKEY_ROWSETVIEWER : common.h
  • HKEYLIST : keys.h
  • hKillSvr : ComPerf.Cpp
  • hLibInst : gutils.cpp , table.cpp , tprint.cpp , utils.cpp
  • hLoadedInst : autotest.h , dllstub.c
  • HLP_ADD_OBJECT : nshsamp.h
  • HLP_ADD_OBJECT_BASE : nshsamp.h
  • HLP_ADD_OBJECT_EX : nshsamp.h
  • HLP_RANDOM_BASE : nshsamp.h
  • HLP_RESET_OBJECT : nshsamp.h
  • HLP_RESET_OBJECT_ALL : nshsamp.h
  • HLP_RESET_OBJECT_ALL_EX : nshsamp.h
  • HLP_RESET_OBJECT_BASE : nshsamp.h
  • HLP_RESET_OBJECT_SPROCKETS : nshsamp.h
  • HLP_RESET_OBJECT_SPROCKETS_EX : nshsamp.h
  • HLP_RESET_OBJECT_WIDGETS : nshsamp.h
  • HLP_RESET_OBJECT_WIDGETS_EX : nshsamp.h
  • HLP_SAMP_BASE : nshsamp.h
  • HLP_SET_GATEWAY : nshsamp.h
  • HLP_SET_GATEWAY_EX : nshsamp.h
  • HLP_SET_INTERFACE : nshsamp.h
  • HLP_SET_INTERFACE_EX : nshsamp.h
  • HLP_SET_OBJECT : nshsamp.h
  • HLP_SET_OBJECT_BASE : nshsamp.h
  • HLP_SET_OBJECT_EX : nshsamp.h
  • HLP_SET_RANDOM_STUFF : nshsamp.h
  • HLP_SHOW_OBJECT : nshsamp.h
  • HLP_SHOW_OBJECT_BASE : nshsamp.h
  • HLP_SHOW_OBJECT_EX : nshsamp.h
  • HLP_SHOW_RANDOM : nshsamp.h
  • HLP_SHOW_RANDOM_EX : nshsamp.h
  • HLP_SHOWERROR : nshsamp.h
  • HLP_SHOWERROR_BASE : nshsamp.h
  • HLP_SHOWERROR_EX : nshsamp.h
  • hLspHeap : overlap.cpp , sockinfo.cpp , spi.cpp
  • hMDIClientWnd : IconPRO.C , MDIChild.C
  • hMenu : sdkdiff.cpp , FontView.c , MfEdit.h
  • hMenuWindow : MfEdit.h
  • hMetricsMenu : FontView.c
  • hModelessDlg : WinCap.c
  • hModule : instlsp.cpp
  • hMonitorThread : fullsvr.Cpp
  • hMyCertStore : WebClient.c , WebServer.c
  • hNormCurs : table.cpp , tpriv.h
  • HookAppShare() : cshare.cpp , cshare.h
  • HookCall() : CCall.Cpp , CCall.h
  • HookChannel() : cShare.Cpp , cShare.h , CChan.Cpp , CChan.h
  • HookConference() : CConf.Cpp , CConf.h , CConf.Cpp , CConf.h
  • HookData() : cData.Cpp , cData.h , cData.Cpp , cData.h
  • HookFileTransfer() : cft.cpp , cft.h
  • HookFtChannel() : CConf.Cpp
  • HookWlxDialogBoxParam() : GinaDlg.c , GinaDlg.h
  • hOpen : AsyncDemo.cpp , FTPJr.cpp
  • hOpenSaveThread1 : Open.c
  • hOpenSaveThread2 : Open.c
  • HostToWireFormat16() : Eap.c
  • HostToWireFormat32() : Eap.c
  • HostWindow() : Callnot.Cpp
  • HOUR : FontView.c
  • HOUR_INDEX : TIMEWND.c
  • HourGlassOff() : Utility.c , Utility.h
  • HourGlassOn() : Utility.c , Utility.h
  • hOutWnd : Globals.h
  • hPal : Mypal.c
  • HPBYTE : SMF.h
  • hpenBlack : status.cpp
  • hpenDotted : table.cpp , tpriv.h
  • hpenHilight : status.cpp
  • hpenLeft : bar.cpp
  • hpenLowlight : status.cpp
  • hpenNeutral : status.cpp
  • hpenRight : bar.cpp
  • hpenSame : bar.cpp
  • hPolicy : mapname.c
  • hPrintThread1 : Print.c
  • hPrintThread2 : Print.c
  • hProcessHeap : common.cpp
  • hProfLog : Prof.cpp , prof.cpp
  • hProfMutex : prof.cpp , prof.h , prof.cpp , prof.h
  • hr : suminfo.h
  • hrasconn : main.cpp
  • HrCreateArgVariants() : util.cpp , util.h
  • HrCreateSafeArray() : util.cpp , util.h
  • HrDestroyArgVariants() : util.cpp , util.h
  • hReceiveEvent : FaxSiren.Cpp
  • hRectangleDlg : WinCap.c
  • HRErrorToString() : InstCodc.Cpp
  • hRes : Open.c
  • hResColors : Colors.c
  • hResFind : Find.c
  • hResFont : Font.c
  • hResPrint : Print.c
  • HRESULT() : cfactory.h , Priv.h
  • HRESULT_FROM_JETERROR : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • HRESULT_FROM_JETWARNING : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • HrFormatStringIntoBSTR() : StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h
  • HrFormatStringWithVAListIntoBSTR() : StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp
  • HrGetSafeArrayBounds() : util.cpp , util.h
  • HrGetVariantElement() : util.h , util.cpp
  • HrGetWMIProperty() : WMIHelpers.cpp , WMIHelpers.h
  • HrInitializeWbemConnection() : WMIHelpers.h , WMIHelpers.cpp
  • HrLoadStringIntoBSTR() : StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h
  • HrMsg() : AppUtil.Cpp , AppUtil.h
  • HrMsgId() : AppUtil.Cpp , AppUtil.h
  • HrSetBlanket() : WMIHelpers.h , WMIHelpers.cpp
  • HrSetInitialize() : StdAfx.cpp , StdAfx.h
  • HrSetWbemServices() : WMIHelpers.h , WMIHelpers.cpp
  • hSaveCursor : Cursor.c
  • HseIoCompletion() : fwasync.c , ftrans.c
  • hSelectDlg : WinCap.c
  • hServerStopEvent : Simple.c
  • hSession : AsyncDemo.cpp
  • hSimulateTrap : TestDll.C
  • hSlot : Bcast.c
  • HSOCKET : rusocket.h
  • hStatus : secSvr.Cpp
  • hstmt : quiktest.h
  • hSysMenuAdv : FontView.c
  • hSysMenuMain : FontView.c
  • HT_Cleanup() : hashtable.c , hashtable.h
  • HT_Create() : hashtable.c , hashtable.h
  • HT_DeleteEntry() : hashtable.h , hashtable.c
  • HT_Destroy() : hashtable.c , hashtable.h
  • HT_Display : hashtable.h
  • HT_GetEntry() : hashtable.h , hashtable.c
  • HT_InsertEntry() : hashtable.c , hashtable.h
  • HT_IsEmpty : hashtable.h
  • HT_IsPresentEntry() : hashtable.h , hashtable.c
  • HT_MapCar() : hashtable.c , hashtable.h
  • HT_RemoveEntry : hashtable.h
  • HT_Size : hashtable.h
  • htaskCaller : msgfiltr.h
  • HTDATA : MfEdit.h
  • hText : ClipText.c
  • hThread : enablerouter.c
  • HTML_FILE_EXT : AppUtil.h
  • HTML_FILTER_CHUNK_SIZE : InpStrm.Hxx
  • HtmlBeginAddress() : html.cpp , html.h
  • HtmlBeginBlockQuote() : html.h , html.cpp
  • HtmlBeginBold() : html.h , html.cpp
  • HtmlBeginCitation() : html.h , html.cpp
  • HtmlBeginCode() : html.h , html.cpp
  • HtmlBeginDefine() : html.h , html.cpp
  • HtmlBeginDefinition() : html.cpp , html.h
  • HtmlBeginDefinitionList() : html.h , html.cpp
  • HtmlBeginDefinitionTerm() : html.h , html.cpp
  • HtmlBeginEmphasis() : html.h , html.cpp
  • HtmlBeginFixed() : html.h , html.cpp
  • HtmlBeginHeading() : html.h , html.cpp
  • HtmlBeginItalic() : html.h , html.cpp
  • HtmlBeginKeyboard() : html.h , html.cpp
  • HtmlBeginListItem() : html.cpp , html.h
  • HtmlBeginNumberedList() : html.h , html.cpp
  • HtmlBeginPreformattedText() : html.h , html.cpp
  • HtmlBeginStatus() : html.h , html.cpp
  • HtmlBeginStrong() : html.cpp , html.h
  • HtmlBeginUnnumberedList() : html.h , html.cpp
  • HtmlBeginVariable() : html.h , html.cpp
  • HtmlBold() : html.h , html.cpp
  • HtmlBookmarkLink() : html.h , html.cpp
  • HtmlCreatePage() : html.h , html.cpp
  • htmlDebugOut : Global.Hxx
  • HtmlDefinition() : html.cpp , html.h
  • HtmlEndAddress() : html.h , html.cpp
  • HtmlEndBlockQuote() : html.cpp , html.h
  • HtmlEndBold() : html.cpp , html.h
  • HtmlEndCitation() : html.cpp , html.h
  • HtmlEndCode() : html.cpp , html.h
  • HtmlEndDefine() : html.cpp , html.h
  • HtmlEndDefinitionList() : html.cpp , html.h
  • HtmlEndEmphasis() : html.h , html.cpp
  • HtmlEndFixed() : html.cpp , html.h
  • HtmlEndHeading() : html.cpp , html.h
  • HtmlEndItalic() : html.cpp , html.h
  • HtmlEndKeyboard() : html.cpp , html.h
  • HtmlEndNumberedList() : html.cpp , html.h
  • HtmlEndPage() : html.h , html.cpp
  • HtmlEndParagraph() : html.cpp , html.h
  • HtmlEndPreformattedText() : html.cpp , html.h
  • HtmlEndStatus() : html.h , html.cpp
  • HtmlEndString() : html.h
  • HtmlEndStrong() : html.cpp
  • HtmlEndUnnumberedList() : html.cpp , html.h
  • HtmlEndVariable() : html.h , html.cpp
  • HtmlFiltFilter : Register.Cxx
  • HtmlFiltHandler : Register.Cxx
  • HtmlFixed() : html.h , html.cpp
  • HtmlHeading() : html.cpp , html.h
  • HtmlHorizontalRule() : html.h , html.cpp
  • HtmlHyperLink() : html.h , html.cpp
  • HtmlHyperLinkAndBookmark() : html.cpp , html.h
  • HtmlImage() : html.h , html.cpp
  • HtmlItalic() : html.cpp , html.h
  • HtmlLineBreak() : html.h , html.cpp
  • HtmlNew : Global.Hxx
  • HtmlPrintf() : html.cpp , html.h
  • HtmlPropFilter : HtmlProp.Cxx
  • HtmlPropHandler : HtmlProp.Cxx
  • HtmlTokenType : HtmlScan.Hxx
  • HtmlWriteText() : html.h , html.cpp
  • HtmlWriteTextLine() : html.cpp , html.h
  • HtoA() : Misc.c , Globals.h
  • HtoB() : Globals.h , Misc.c
  • HTTP_REQUEST_ACCEPT_RANGES : Range.h
  • HTTP_REQUEST_FROM_CACHE : Range.h
  • HTTP_REQUESTCB_TYPE : Range.h
  • HTTPCFG_TYPE : precomp.h
  • HttpCfgTypeDelete : precomp.h
  • HttpCfgTypeMax : precomp.h
  • HttpCfgTypeQuery : precomp.h
  • HttpCfgTypeSet : precomp.h
  • HttpExtensionProc() : WorkerThread.c , ftrans.c , Extension.cpp , DumpRequestInfo.cpp , ReMapUrl.cpp , InvokObjThreads.cpp , CustomAuth.cpp , adoisapi.cpp , Redirect.cpp , UpCaseMap.cpp , DumpVars.cpp , readcli.c , WildCardMap.cpp , ctetest.c , Extension.cpp , HelloIsapi.cpp , fwrite.c , KeepAlive.c , CacheIsapi.cpp , Simple.cpp , KeepAliveP.c , areadcli.c , fwasync.c , formdump.cpp
  • HttpExtensionProcWrapper() : PoolWrap.cpp
  • HttpFilterProc() : AuthFilt.c , Redir401.cpp , UpCase.c
  • HttpGetSocket() : Get_Sock.c , Proto.H
  • HttpReadFromCache() : cache.Cpp
  • HttpReadFromServer() : download.Cpp , Range.h
  • HttpReadRequest() : Range.h , cache.Cpp
  • HUGE : GLOBAL.h
  • HUGetLastError() : HuError.Cpp , HuError.h
  • HUPrintError() : HuError.h , HuError.Cpp
  • HUSetLastError() : HuError.Cpp , HuError.h
  • hVertCurs : table.cpp , tpriv.h
  • hViewMenu : FontView.c
  • hwnd : ClipText.c
  • hWnd : Server32.c
  • hwndBar : sdkdiff.cpp
  • hWndCandList : Data.c , IMEApps.h
  • hwndClient : sdkdiff.h
  • hWndClient : Client32.c
  • hwndClient : sdkdiff.cpp , FontView.c
  • hWndCompStr : Data.c , IMEApps.h
  • hwndCreateParam : FontView.c
  • hwndCreateValue : FontView.c
  • hWndDef1 : MultiUI.h , Data.C
  • hWndDef2 : Data.C , MultiUI.h
  • hWndDialog : Cancel.Cpp
  • hWndDisplayCtl : EDITCTLS.c
  • hwndDlg : PlgBlt.c
  • hwndFind : Find.c
  • hwndHelp : WxForm.h
  • hWndIMC1 : MultiUI.h , Data.C
  • hWndIMC2 : Data.C , MultiUI.h
  • hWndIMCUI1 : MultiUI.h , Data.C
  • hWndIMCUI2 : Data.C , MultiUI.h
  • hWndInputCtl : EDITCTLS.c
  • hwndLabel1 : FontView.c
  • hwndMain : PlgBlt.c
  • hWndMain : IconPRO.C , Data.c , IMEApps.h
  • hwndMain : WxForm.h , FontView.c
  • hWndMain : MultiUI.h , halftone.c , Icons.C , MDIChild.C , Data.C
  • hwndMain : Tools.c
  • hwndMainColor : Colors.c
  • hwndMainDialog : Find.c , Open.c
  • hwndMainFont : Font.c
  • hwndMainPrint : Print.c
  • hwndMDIClient : GLOBALS.h
  • hWndMDIClient : GdiDemo.c
  • hwndMDIIPXChat : Globals.h
  • hwndMenuField : FontView.c
  • hwndMouse : WxForm.h
  • hwndNil : Global.h
  • hWndParent : EDITCTLS.c , msgfiltr.h
  • hwndRCD : sdkdiff.cpp , sdkdiff.h
  • hWndStatus : Data.c
  • hwndStatus : Status.c , sdkdiff.cpp
  • hWndStatus : IMEApps.h
  • hWndStatusbar : STATBAR.h , STATBAR.c
  • hwndTimeField : FontView.c
  • hWndToolBar : Data.c
  • hWndToolbar : ToolBar.h
  • hWndToolBar : IMEApps.h
  • hWndToolbar : ToolBar.c , ToolBar.h
  • hWndToolBarOwner : ToolBar.c
  • hwndToolButton : Tools.c
  • hwndToolCombo : Tools.c
  • hwndTools : Tools.c
  • hwndToolText : Tools.c
  • hwndTransform : WxForm.h
  • hwndZoom : FontView.c
  • hWorkSem : ThreadPool.h
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- i -

  • i : Utils.Cpp , suminfo.Cpp , enablerouter.c
  • I_LINECALLSTATE_ANY : TapiCode.c
  • I_lineGetAddressCaps() : TapiCode.c
  • I_lineGetAddressStatus() : TapiCode.c
  • I_lineGetCallStatus() : TapiCode.c
  • I_lineGetDevCaps() : TapiCode.c
  • I_lineNegotiateAPIVersion() : TapiCode.c
  • I_lineNegotiateLegacyAPIVersion() : TapiCode.c
  • I_lineTranslateAddress() : TapiCode.c
  • i_should_sleep : Globals.h , Init.c
  • IADsError : ADsError.h
  • IADsError_GetErrorMessage_Proxy() : ADsError.h
  • IADsError_GetErrorMessage_Stub() : ADsError.h
  • IADsError_ServerInfo : ADsError_p.c
  • IADsErrorVtbl : ADsError.h
  • IAnnotator_ServerInfo : EDAnnotator_p.c
  • IApplet : iapplet.h
  • IApplet_Advise_Proxy() : iapplet.h
  • IApplet_Advise_Stub() : iapplet.h
  • IApplet_CreateSession_Proxy() : iapplet.h
  • IApplet_CreateSession_Stub() : iapplet.h
  • IApplet_Initialize_Proxy() : iapplet.h
  • IApplet_Initialize_Stub() : iapplet.h
  • IApplet_RegisterAutoJoin_Proxy() : iapplet.h
  • IApplet_RegisterAutoJoin_Stub() : iapplet.h
  • IApplet_UnAdvise_Proxy() : iapplet.h
  • IApplet_UnAdvise_Stub() : iapplet.h
  • IApplet_UnregisterAutoJoin_Proxy() : iapplet.h
  • IApplet_UnregisterAutoJoin_Stub() : iapplet.h
  • IAppletNotify : iapplet.h
  • IAppletNotify_AutoJoinSessionIndication_Proxy() : iapplet.h
  • IAppletNotify_AutoJoinSessionIndication_Stub() : iapplet.h
  • IAppletNotify_PermitToJoinSessionIndication_Proxy() : iapplet.h
  • IAppletNotify_PermitToJoinSessionIndication_Stub() : iapplet.h
  • IAppletNotifyVtbl : iapplet.h
  • IAppletSession : iapplet.h
  • IAppletSession_Advise_Proxy() : iapplet.h
  • IAppletSession_Advise_Stub() : iapplet.h
  • IAppletSession_ChannelRequest_Proxy() : iapplet.h
  • IAppletSession_ChannelRequest_Stub() : iapplet.h
  • IAppletSession_GetConfID_Proxy() : iapplet.h
  • IAppletSession_GetConfID_Stub() : iapplet.h
  • IAppletSession_InquireRoster_Proxy() : iapplet.h
  • IAppletSession_InquireRoster_Stub() : iapplet.h
  • IAppletSession_InvokeApplet_Proxy() : iapplet.h
  • IAppletSession_InvokeApplet_Stub() : iapplet.h
  • IAppletSession_IsThisNodeTopProvider_Proxy() : iapplet.h
  • IAppletSession_IsThisNodeTopProvider_Stub() : iapplet.h
  • IAppletSession_Join_Proxy() : iapplet.h
  • IAppletSession_Join_Stub() : iapplet.h
  • IAppletSession_Leave_Proxy() : iapplet.h
  • IAppletSession_Leave_Stub() : iapplet.h
  • IAppletSession_RegistryRequest_Proxy() : iapplet.h
  • IAppletSession_RegistryRequest_Stub() : iapplet.h
  • IAppletSession_SendData_Proxy() : iapplet.h
  • IAppletSession_SendData_Stub() : iapplet.h
  • IAppletSession_TokenRequest_Proxy() : iapplet.h
  • IAppletSession_TokenRequest_Stub() : iapplet.h
  • IAppletSession_UnAdvise_Proxy() : iapplet.h
  • IAppletSession_UnAdvise_Stub() : iapplet.h
  • IAppletSessionNotify : iapplet.h
  • IAppletSessionNotify_AllocateHandleConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_AllocateHandleConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_ChannelConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_ChannelConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_ChannelIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_ChannelIndication_Stub() : iapplet.h
  • IAppletSessionNotify_InquireRosterConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_InquireRosterConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_InvokeAppletConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_InvokeAppletConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_JoinSessionConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_JoinSessionConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_LeaveSessionIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_LeaveSessionIndication_Stub() : iapplet.h
  • IAppletSessionNotify_RegistryConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_RegistryConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_RosterReportIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_RosterReportIndication_Stub() : iapplet.h
  • IAppletSessionNotify_SendDataIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_SendDataIndication_Stub() : iapplet.h
  • IAppletSessionNotify_TestTokenConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_TestTokenConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_TokenConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_TokenConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_TokenIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_TokenIndication_Stub() : iapplet.h
  • IAppletSessionNotifyVtbl : iapplet.h
  • IAppletSessionVtbl : iapplet.h
  • IAppletVtbl : iapplet.h
  • ibcData : msiloc.cpp
  • ibcName : msiloc.cpp
  • IBrowserHost_ServerInfo : EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c
  • IBSTRCompareW() : StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h
  • iccAttrib : msiloc.cpp
  • iccHt : msiloc.cpp
  • iccName : msiloc.cpp
  • iccProperty : msiloc.cpp
  • ICCR_BACKGROUND : resource.h
  • iccText : msiloc.cpp
  • iccType : msiloc.cpp
  • iccWd : msiloc.cpp
  • iccX : msiloc.cpp
  • iccY : msiloc.cpp
  • ICEnrollProgID : RequestCert.Cpp
  • iciHeight : msiloc.cpp
  • iciText : msiloc.cpp
  • iciWidth : msiloc.cpp
  • iciX : msiloc.cpp
  • iciY : msiloc.cpp
  • ICMP_HDR : iphdr.h
  • ICMPV4_ECHO_REPLY_CODE : iphdr.h
  • ICMPV4_ECHO_REPLY_TYPE : iphdr.h
  • ICMPV4_ECHO_REQUEST_CODE : iphdr.h
  • ICMPV4_ECHO_REQUEST_TYPE : iphdr.h
  • ICMPV4_MINIMUM_HEADER : iphdr.h
  • ICMPV6_ECHO_REPLY_CODE : iphdr.h
  • ICMPV6_ECHO_REPLY_TYPE : iphdr.h
  • ICMPV6_ECHO_REQUEST : iphdr.h
  • ICMPV6_ECHO_REQUEST_CODE : iphdr.h
  • ICMPV6_ECHO_REQUEST_TYPE : iphdr.h
  • ICMPV6_HDR : iphdr.h
  • ICO_AUDIO : Resource.h
  • ICO_MAIN : Resource.h , resource.h , Resource.h
  • ICO_NOAUDIO : Resource.h
  • ICO_PHONE : Resource.h
  • ICO_SPEAKER : Resource.h
  • ICO_TOPMOST : Resource.h
  • ICON : resource.h
  • ICON_CATALOG : step1.cpp
  • ICON_COLUMN : step1.cpp , step4.cpp
  • ICON_INDEX_FOLDER : ExtrIcon.h
  • ICON_INDEX_FOLDEROPEN : ExtrIcon.h
  • ICON_INDEX_ITEM : ExtrIcon.h
  • ICON_LONG : step1.cpp , step4.cpp
  • ICON_READONLY : step1.cpp , step4.cpp
  • ICON_SCHEMA : step1.cpp
  • ICON_SYNONYM : step1.cpp
  • ICON_SYSTABLE : step1.cpp
  • ICON_TABLE : step1.cpp
  • ICON_TYPE : step1.cpp
  • ICON_VIEW : step1.cpp
  • IconChildWndProc() : MDIChild.C , MDIChild.h
  • IconDrawItem() : App32.C
  • ICONEXTRACT : Common.h
  • ICONFILE : GLOBALS.h
  • IconImageFromBMPFile() : Icons.C , Icons.h
  • IconImageFromClipBoard() : Icons.C , Icons.h
  • IconImageToBMPFile() : Icons.C , Icons.h
  • IconImageToClipBoard() : Icons.C , Icons.h
  • ICONPRO_ABOUT_DLG : Resource.h
  • ICONPRO_ICON : Resource.h
  • ICONPRO_ICON1 : Resource.h
  • ICONPRO_MENU : Resource.h
  • iConvertStrToInt() : nlsapi.c
  • iCREATE_NEW_DB : msiloc.cpp
  • ID : nshsamp.h
  • id() : ComSpyCtl.Idl , MtsSpyCtl.Idl , MtsUserEventObj.Idl , CrmFilesTest.Idl , data.Idl , GraphObj.Idl
  • ID_ABOUT : Menu.h
  • ID_AC_CREDIT : resource.h
  • ID_AC_DEBIT : resource.h
  • ID_ACTION_ADDBUDDY : resource.h
  • ID_ACTION_CALL : resource.h
  • ID_ACTION_MESSAGE : resource.h
  • ID_ADD1 : Print.h
  • ID_ADD1C : Colors.h
  • ID_ADD1DM : DevMode.h
  • ID_ADD1O : Open.h
  • ID_ADD1P : Print.h
  • ID_ADD2 : Print.h
  • ID_ADD2O : Open.h
  • ID_ADD2P : Print.h
  • ID_ADDRESSBOX : resource.h
  • ID_API_CLOSE_QUEUE : Resource.h
  • ID_API_CREATE_QUEUE : Resource.h
  • ID_API_DELETE_QUEUE : Resource.h
  • ID_API_LOCATE : Resource.h
  • ID_API_OPEN_QUEUE : Resource.h
  • ID_API_RECEIVE_MESSAGE : Resource.h
  • ID_API_SEND_MESSAGE : Resource.h
  • ID_APP_ABOUT : afxres.h
  • ID_APP_EXIT : afxres.h
  • ID_APPACCEL : Resource.h , resource.h , Resource.h
  • ID_APPBAR_AUTOHIDE : Resource.h
  • ID_APPBAR_BOTTOM : Resource.h
  • ID_APPBAR_LEFT : Resource.h
  • ID_APPBAR_NOAUTOHIDE : Resource.h
  • ID_APPBAR_REGISTER : Resource.h
  • ID_APPBAR_RIGHT : Resource.h
  • ID_APPBAR_TOP : Resource.h
  • ID_APPBAR_UNREGISTER : Resource.h
  • ID_ASSERT_ON_ERRORS : resource.h
  • ID_AUDIT : Resource.h
  • ID_BOX1 : resource.h
  • ID_BOX2 : resource.h
  • ID_BOX3 : resource.h
  • ID_BOX4 : resource.h
  • ID_BROWSE : OleStd.h
  • ID_BUDDY_CALL : resource.h
  • ID_BUDDY_MESSAGE : resource.h
  • ID_BUDDY_REMOVE : resource.h
  • ID_BUFFSIZETI : Title.h
  • ID_BUTTON : Rebar.c
  • ID_BUTTON1 : resource.h
  • ID_BUTTON10 : resource.h
  • ID_BUTTON2 : resource.h
  • ID_BUTTON3 : resource.h
  • ID_BUTTON4 : resource.h
  • ID_BUTTON40001 : resource.h
  • ID_BUTTON40002 : resource.h
  • ID_BUTTON40003 : resource.h
  • ID_BUTTON40004 : resource.h
  • ID_BUTTON40016 : resource.h
  • ID_BUTTON40017 : resource.h
  • ID_BUTTON40018 : resource.h
  • ID_BUTTON40019 : resource.h
  • ID_BUTTON40020 : resource.h
  • ID_BUTTON40021 : resource.h
  • ID_BUTTON40022 : resource.h
  • ID_BUTTON40023 : resource.h
  • ID_BUTTON40024 : resource.h
  • ID_BUTTON40025 : resource.h
  • ID_BUTTON40026 : resource.h
  • ID_BUTTON40100 : Resource.h
  • ID_BUTTON40101 : Resource.h
  • ID_BUTTON40102 : Resource.h
  • ID_BUTTON40103 : Resource.h
  • ID_BUTTON40104 : Resource.h
  • ID_BUTTON40105 : Resource.h
  • ID_BUTTON40106 : Resource.h
  • ID_BUTTON40107 : Resource.h
  • ID_BUTTON40108 : Resource.h
  • ID_BUTTON40109 : Resource.h
  • ID_BUTTON40110 : Resource.h
  • ID_BUTTON40111 : Resource.h
  • ID_BUTTON40112 : Resource.h
  • ID_BUTTON40113 : Resource.h
  • ID_BUTTON40114 : Resource.h
  • ID_BUTTON40115 : Resource.h
  • ID_BUTTON40116 : Resource.h
  • ID_BUTTON40117 : Resource.h
  • ID_BUTTON40118 : Resource.h
  • ID_BUTTON40119 : Resource.h
  • ID_BUTTON40120 : Resource.h
  • ID_BUTTON40121 : Resource.h
  • ID_BUTTON40122 : Resource.h
  • ID_BUTTON40123 : Resource.h
  • ID_BUTTON40124 : Resource.h
  • ID_BUTTON40125 : Resource.h
  • ID_BUTTON40126 : Resource.h
  • ID_BUTTON40127 : Resource.h
  • ID_BUTTON40140 : Resource.h
  • ID_BUTTON5 : resource.h
  • ID_BUTTON6 : resource.h
  • ID_BUTTON7 : resource.h
  • ID_BUTTON8 : resource.h
  • ID_BUTTON9 : resource.h
  • ID_BUTTONPAUSE : resource.h
  • ID_BUTTONSTART : resource.h
  • ID_BUTTONSTOP : resource.h
  • ID_CALL : resource.h
  • ID_CAPSFIELD : FontView.h
  • ID_CHECKBOX : resource.h
  • ID_CHOOSE_LOG_FILE_NAME : Resource.h
  • ID_CHOOSEFONT : Resource.h
  • ID_CLEAR : Resource.h , resource.h
  • ID_CLEAR1 : Print.h
  • ID_CLEAR1C : Colors.h
  • ID_CLEAR1DM : DevMode.h
  • ID_CLEAR1O : Open.h
  • ID_CLEAR1P : Print.h
  • ID_CLEAR2O : Open.h
  • ID_CLEAR2P : Print.h
  • ID_COINIT_MTA : resource.h
  • ID_COINIT_RANDOM : resource.h
  • ID_COINIT_STA : resource.h
  • ID_COLORSDIALOG : Colors.h
  • ID_COLORSLIDER : Resource.h
  • ID_COLORTEXT : Resource.h
  • ID_COMBOBOX : Resource.h , Rebar.c
  • ID_COMMAND_COMMAND1 : resource.h
  • ID_COMMAND_COMMAND2 : resource.h
  • ID_COMMAND_COMMAND3 : resource.h
  • ID_COMMAND_COMMAND4 : resource.h
  • ID_COMMAND_PAUSE : resource.h
  • ID_COMMAND_START : resource.h
  • ID_COMMAND_STOP : resource.h
  • ID_CONNECT : resource.h
  • ID_CONTEXT_HELP : afxres.h
  • ID_CONTROL : resource.h
  • ID_COPIESP : Print.h
  • ID_CREATEPARAM : FontView.h
  • ID_CREATEVALUE : FontView.h
  • ID_CURRENT : OleStd.h
  • ID_CURRENTICON : OleStd.h
  • ID_CUSTCOLORSC : Colors.h
  • ID_CUSTDATAC : Colors.h
  • ID_CUSTDATAF : Font.h
  • ID_CUSTDATAFT : Find.h
  • ID_CUSTDATAO : Open.h
  • ID_CUSTDATAP : Print.h
  • ID_CUSTFILTO : Open.h
  • ID_CUSTOM_BUTTON : Resource.h
  • ID_DEBUG_BEGIN : Resource.h
  • ID_DEBUG_END : Resource.h
  • ID_DEFAULT : OleStd.h
  • ID_DEFAULT_HELP : afxres.h
  • ID_DEFAULTICON : OleStd.h
  • ID_DEFSTRINGS : Find.h
  • ID_DEVMODEDIALOG : DevMode.h
  • ID_DEVNAMESDIALOG : DevNames.h
  • ID_DMBITSPERPEL : DevMode.h
  • ID_DMCOLLATE : DevMode.h
  • ID_DMCOLOR : DevMode.h
  • ID_DMCOPIES : DevMode.h
  • ID_DMDEFAULTSOURCE : DevMode.h
  • ID_DMDEVNAME : DevMode.h
  • ID_DMDISPLAYFREQ : DevMode.h
  • ID_DMDRIVERDATA : DevMode.h
  • ID_DMDRIVEREXTRA : DevMode.h
  • ID_DMDRIVERVER : DevMode.h
  • ID_DMDUPLEX : DevMode.h
  • ID_DMFIELDS : DevMode.h
  • ID_DMFORMNAME : DevMode.h
  • ID_DMORIENTATION : DevMode.h
  • ID_DMPAPERLENGTH : DevMode.h
  • ID_DMPAPERSIZE : DevMode.h
  • ID_DMPAPERWIDTH : DevMode.h
  • ID_DMPELSHEIGHT : DevMode.h
  • ID_DMPELSWIDTH : DevMode.h
  • ID_DMPRINTQUALITY : DevMode.h
  • ID_DMRESETDEV : DevMode.h
  • ID_DMSCALE : DevMode.h
  • ID_DMSIZEDEV : DevMode.h
  • ID_DMSPECVER : DevMode.h
  • ID_DUMMY : OleStd.h
  • ID_EDIT_ADDFORMAT : Resource.h
  • ID_EDIT_CLEAR : afxres.h
  • ID_EDIT_CLEAR_ALL : afxres.h
  • ID_EDIT_COPY : afxres.h , Resource.h
  • ID_EDIT_CUT : afxres.h
  • ID_EDIT_EXPORTBMP : Resource.h
  • ID_EDIT_FIND : afxres.h
  • ID_EDIT_IMPORTBMP : Resource.h
  • ID_EDIT_INSERTOBJECT : Resource.h
  • ID_EDIT_PASTE : afxres.h , Resource.h
  • ID_EDIT_PASTE_LINK : afxres.h
  • ID_EDIT_PASTE_SPECIAL : afxres.h
  • ID_EDIT_REDO : afxres.h
  • ID_EDIT_REMOVEFORMAT : Resource.h
  • ID_EDIT_REPEAT : afxres.h
  • ID_EDIT_REPLACE : afxres.h
  • ID_EDIT_SELECT_ALL : afxres.h
  • ID_EDIT_STRETCHIMPORTBMP : Resource.h
  • ID_EDIT_STRETCHPASTE : Resource.h
  • ID_EDIT_UNDO : afxres.h
  • ID_EDITCHILD : ComDlg32.h
  • ID_EDITDEVMODE : Print.h
  • ID_EDITDEVNAMES : Print.h
  • ID_EDITLOGFONT : Font.h
  • ID_EL_AUTOMATIC : OleStd.h
  • ID_EL_CANCELLINK : OleStd.h
  • ID_EL_CHANGESOURCE : OleStd.h
  • ID_EL_CLOSE : OleStd.h
  • ID_EL_COL1 : OleStd.h
  • ID_EL_COL2 : OleStd.h
  • ID_EL_COL3 : OleStd.h
  • ID_EL_LINKSLISTBOX : OleStd.h
  • ID_EL_LINKSOURCE : OleStd.h
  • ID_EL_LINKTYPE : OleStd.h
  • ID_EL_MANUAL : OleStd.h
  • ID_EL_NULL : OleStd.h
  • ID_EL_OPENSOURCE : OleStd.h
  • ID_EL_UPDATE : OleStd.h
  • ID_EL_UPDATENOW : OleStd.h
  • ID_ERRORC : Colors.h
  • ID_ERRORF : Font.h
  • ID_ERRORFT : Find.h
  • ID_ERRORO : Open.h
  • ID_ERRORP : Print.h
  • ID_EXIT : resource.h
  • ID_F_ABOUT : Resource.h
  • ID_F_EXIT : Resource.h
  • ID_F_MENUOPTION1 : Resource.h
  • ID_FILE_ABOUT : resource.h
  • ID_FILE_CLOSE : afxres.h , Resource.h
  • ID_FILE_DASH : resource.h
  • ID_FILE_EXIT : resource.h , Resource.h
  • ID_FILE_EXTRACT : Resource.h
  • ID_FILE_FAX : Resource.h
  • ID_FILE_FROM_SCANNER_OR_CAMERA : resource.h
  • ID_FILE_LOGOFF : resource.h
  • ID_FILE_LOGON : resource.h
  • ID_FILE_MRU_FILE1 : afxres.h
  • ID_FILE_MRU_FILE2 : afxres.h
  • ID_FILE_MRU_FILE3 : afxres.h
  • ID_FILE_MRU_FILE4 : afxres.h
  • ID_FILE_NEW : afxres.h , resource.h , Resource.h
  • ID_FILE_OPEN : afxres.h , resource.h , Resource.h
  • ID_FILE_OPENCHARACTER : Resource.h
  • ID_FILE_PAGE_SETUP : afxres.h
  • ID_FILE_PRESENCESTATUS_AWAY : resource.h
  • ID_FILE_PRESENCESTATUS_BERIGHTBACK : resource.h
  • ID_FILE_PRESENCESTATUS_BUSY : resource.h
  • ID_FILE_PRESENCESTATUS_IDLE : resource.h
  • ID_FILE_PRESENCESTATUS_OFFLINE : resource.h
  • ID_FILE_PRESENCESTATUS_ONLINE : resource.h
  • ID_FILE_PRESENCESTATUS_ONTHEPHONE : resource.h
  • ID_FILE_PRESENCESTATUS_OUTTOLUNCH : resource.h
  • ID_FILE_PRINT : afxres.h
  • ID_FILE_PRINT_PREVIEW : afxres.h
  • ID_FILE_PRINT_SETUP : afxres.h
  • ID_FILE_PROPERTYSHEET : resource.h
  • ID_FILE_REFRESH : resource.h
  • ID_FILE_SAVE : afxres.h , resource.h , Resource.h
  • ID_FILE_SAVE_AS : afxres.h
  • ID_FILE_SAVE_COPY_AS : afxres.h
  • ID_FILE_SAVEAS : resource.h , Resource.h
  • ID_FILE_UPDATE : afxres.h
  • ID_FILEEXTO : Open.h
  • ID_FILEOFFO : Open.h
  • ID_FILEPREVIEW : Open.h
  • ID_FILTERO : Open.h
  • ID_FILTINDEXO : Open.h
  • ID_FINDDIALOG : Find.h
  • ID_FINDLEFT : Find.h
  • ID_FINDRIGHT : Find.h
  • ID_FINDWHATFT : Find.h
  • ID_FINDWHATLENFT : Find.h
  • ID_FLAGSC : Colors.h
  • ID_FLAGSF : Font.h
  • ID_FLAGSFT : Find.h
  • ID_FLAGSMSG : Find.h
  • ID_FLAGSO : Open.h
  • ID_FLAGSP : Print.h
  • ID_FONTDIALOG : Font.h
  • ID_FONTLIST : Font.h
  • ID_FONTTYPEF : Font.h
  • ID_FORMAT_BOX : MDIChild.h
  • ID_FRNULLSTRUCT : Find.h
  • ID_FROMFILE : OleStd.h
  • ID_FROMFILEEDIT : OleStd.h
  • ID_FROMPAGEP : Print.h
  • ID_GETNUMFORMATS : Resource.h
  • ID_GROUP : OleStd.h
  • ID_GUIDE_BOXES : resource.h
  • ID_GUIDE_LINES : resource.h
  • ID_GUIDE_NONE : resource.h
  • ID_HASFILECHANGED : Resource.h
  • ID_HDCF : Font.h
  • ID_HDCINVALID : Font.h
  • ID_HDCNULL : Font.h
  • ID_HDCP : Print.h
  • ID_HDCPRINTER : Font.h
  • ID_HDCSCREEN : Font.h
  • ID_HDEVMODEP : Print.h
  • ID_HDEVNAMESP : Print.h
  • ID_HEIGHTSLIDER : Resource.h
  • ID_HEIGHTTEXT : Resource.h
  • ID_HELP : afxres.h
  • ID_HELP_ABOUT : resource.h , Resource.h
  • ID_HELP_CONTENTS : Resource.h
  • ID_HELP_INDEX : afxres.h
  • ID_HELP_USING : afxres.h
  • ID_HINSTANCEC : Colors.h
  • ID_HINSTANCEF : Font.h
  • ID_HINSTANCEFT : Find.h
  • ID_HINSTANCEO : Open.h
  • ID_HINSTANCEP : Print.h
  • ID_HOOKC : Colors.h
  • ID_HOOKF : Font.h
  • ID_HOOKFT : Find.h
  • ID_HOOKO : Open.h
  • ID_HPRINTTEMPP : Print.h
  • ID_HSETUPTEMPP : Print.h
  • ID_HWNDOWNERC : Colors.h
  • ID_HWNDOWNERF : Font.h
  • ID_HWNDOWNERFT : Find.h
  • ID_HWNDOWNERO : Open.h
  • ID_HWNDOWNERP : Print.h
  • ID_ICON : MidiPlyr.h , FullIME.h , HalfIME.h
  • ID_ICONLIST : OleStd.h
  • ID_INBOX : Globals.h
  • ID_INDICATOR_CAPS : afxres.h
  • ID_INDICATOR_EXT : afxres.h
  • ID_INDICATOR_NUM : afxres.h
  • ID_INDICATOR_OVR : afxres.h
  • ID_INDICATOR_REC : afxres.h
  • ID_INDICATOR_SCRL : afxres.h
  • ID_INPUTSCOPE_COERCE : resource.h
  • ID_INPUTSCOPE_FIRST : resource.h
  • ID_INPUTSCOPE_LAST : resource.h
  • ID_IO_CHANGEICON : OleStd.h
  • ID_IO_CREATEFROMFILE : OleStd.h
  • ID_IO_CREATENEW : OleStd.h
  • ID_IO_DISPLAYASICON : OleStd.h
  • ID_IO_FILE : OleStd.h
  • ID_IO_FILEDISPLAY : OleStd.h
  • ID_IO_FILETEXT : OleStd.h
  • ID_IO_FILETYPE : OleStd.h
  • ID_IO_ICONDISPLAY : OleStd.h
  • ID_IO_LINKFILE : OleStd.h
  • ID_IO_OBJECTTYPELIST : OleStd.h
  • ID_IO_OBJECTTYPETEXT : OleStd.h
  • ID_IO_RESULTIMAGE : OleStd.h
  • ID_IO_RESULTTEXT : OleStd.h
  • ID_LABEL : OleStd.h
  • ID_LABELEDIT : OleStd.h
  • ID_LANG_C : resource.h
  • ID_LANG_DELPHI : resource.h
  • ID_LANG_JAVA : resource.h
  • ID_LANG_VB : resource.h
  • ID_LEFTBAND : resource.h
  • ID_LFCHARSET : LogFont.h
  • ID_LFCLIPP : LogFont.h
  • ID_LFESCAPEMENT : LogFont.h
  • ID_LFFACENAME : LogFont.h
  • ID_LFHEIGHT : LogFont.h
  • ID_LFITALIC : LogFont.h
  • ID_LFORIENTATION : LogFont.h
  • ID_LFOUTP : LogFont.h
  • ID_LFPITCHANDFAM : LogFont.h
  • ID_LFQUALITY : LogFont.h
  • ID_LFSTRIKEOUT : LogFont.h
  • ID_LFUNDERLINE : LogFont.h
  • ID_LFWEIGHT : LogFont.h
  • ID_LFWIDTH : LogFont.h
  • ID_LISTVIEW : VListVw.h , DragImg.Cpp , ShlView.h
  • ID_LOG : Resource.h
  • ID_LOGFONTDIALOG : LogFont.h
  • ID_LOGFONTF : Font.h
  • ID_LPPRINTTEMPP : Print.h
  • ID_LPSETUPTEMPP : Print.h
  • ID_MAXCUSTFILTO : Open.h
  • ID_MAXPAGEP : Print.h
  • ID_MAXSZFILEO : Open.h
  • ID_MAXSZFILETITLEO : Open.h
  • ID_MDICLIENT : resource.h
  • ID_MDIOBJECTS : resource.h
  • ID_MDITRACE : resource.h
  • ID_MENU : MidiPlyr.h , FullIME.h , HalfIME.h
  • ID_MENUFIELD : FontView.h
  • ID_MENUFILE : Resource.h
  • ID_MENUHELP : Resource.h
  • ID_MENUMAX : Resource.h
  • ID_MENUMIN : Resource.h
  • ID_MENUSYS : Resource.h
  • ID_MENUVIEW : Resource.h
  • ID_MINPAGEP : Print.h
  • ID_MM_CREDIT : resource.h
  • ID_MM_DEBIT : resource.h
  • ID_MM_TRANSFER : resource.h
  • ID_MODE_GESTURES : resource.h
  • ID_MODE_INK : resource.h
  • ID_MODE_INK_AND_GESTURES : resource.h
  • ID_MSGCHOOSEOPEN : Resource.h
  • ID_MSGEMPTY : Resource.h
  • ID_MSGREADY : Resource.h
  • ID_MULTIOPEN : Open.h
  • ID_MULTITHREADCOLORS : Colors.h
  • ID_MULTITHREADFINDREP : Find.h
  • ID_MULTITHREADFONT : Font.h
  • ID_MULTITHREADPRINT : Print.h
  • ID_NEXT_PANE : afxres.h
  • ID_NULLSTRUCTCOLOR : Colors.h
  • ID_NULLSTRUCTFONT : Font.h
  • ID_NULLSTRUCTO : Open.h
  • ID_NULLSTRUCTP : Print.h
  • ID_NUMFIELD : FontView.h
  • ID_OBJECTTREE : resource.h
  • ID_OD_BTN_BASE : MfEdit.h
  • ID_OD_TOOL_BASE : MfEdit.h
  • ID_OFFSET : spy.cpp
  • ID_OLE_EDIT_CHANGE_ICON : afxres.h
  • ID_OLE_EDIT_CONVERT : afxres.h
  • ID_OLE_EDIT_LINKS : afxres.h
  • ID_OLE_INSERT_NEW : afxres.h
  • ID_OLE_VERB_FIRST : afxres.h
  • ID_OLE_VERB_LAST : afxres.h
  • ID_OLEUIHELP : OleStd.h
  • ID_OPENDIALOG : Open.h
  • ID_OPTIONS_GRID_LINES : Resource.h
  • ID_OUTBOX : Globals.h
  • ID_OVRFIELD : FontView.h
  • ID_PATHTI : Title.h
  • ID_POINTSIZEF : Font.h
  • ID_PRELOADEDCOLORS : Colors.h
  • ID_PRELOADEDFIND : Find.h
  • ID_PRELOADEDFONT : Font.h
  • ID_PREPRINTP : Print.h
  • ID_PRESETUPP : Print.h
  • ID_PREV_PANE : afxres.h
  • ID_PRINTDIALOG : Print.h
  • ID_PRINTHOOKP : Print.h
  • ID_PROCESS : Resource.h
  • ID_PROPERTIES : Resource.h
  • ID_PS_CHANGEICON : OleStd.h
  • ID_PS_DISPLAYASICON : OleStd.h
  • ID_PS_DISPLAYLIST : OleStd.h
  • ID_PS_ICONDISPLAY : OleStd.h
  • ID_PS_PASTE : OleStd.h
  • ID_PS_PASTELINK : OleStd.h
  • ID_PS_PASTELINKLIST : OleStd.h
  • ID_PS_PASTELIST : OleStd.h
  • ID_PS_RESULTGROUP : OleStd.h
  • ID_PS_RESULTIMAGE : OleStd.h
  • ID_PS_RESULTTEXT : OleStd.h
  • ID_PS_SOURCETEXT : OleStd.h
  • ID_PS_STXAS : OleStd.h
  • ID_PS_STXSOURCE : OleStd.h
  • ID_PU_BROWSE : OleStd.h
  • ID_PU_CONVERT : OleStd.h
  • ID_PU_LINKS : OleStd.h
  • ID_PU_METER : OleStd.h
  • ID_PU_PERCENT : OleStd.h
  • ID_PU_STOP : OleStd.h
  • ID_PU_TEXT : OleStd.h
  • ID_REBAR : Rebar.c
  • ID_RECENT_FILE_0 : MainDlg.Cpp
  • ID_RECOGNIZE : resource.h
  • ID_RECOGNIZER_DEFAULT : resource.h
  • ID_RECOGNIZER_FIRST : resource.h
  • ID_RECOGNIZER_LAST : resource.h
  • ID_RECORD_FIRST : afxres.h
  • ID_RECORD_LAST : afxres.h
  • ID_RECORD_NEXT : afxres.h
  • ID_RECORD_PREV : afxres.h
  • ID_REFRESH : resource.h
  • ID_REPLACEWITHFT : Find.h
  • ID_REPLACEWITHLENFT : Find.h
  • ID_RESETC : Colors.h
  • ID_RESETDEVNAMES : DevNames.h
  • ID_RESETFIND : Find.h
  • ID_RESETFONT : Font.h
  • ID_RESETLF : LogFont.h
  • ID_RESETOPEN : Open.h
  • ID_RESETPRINT : Print.h
  • ID_RESETTITLE : Title.h
  • ID_RESULTICON : OleStd.h
  • ID_RESULTLABEL : OleStd.h
  • ID_RETURNC : Colors.h
  • ID_RETURNF : Font.h
  • ID_RETURNFT : Find.h
  • ID_RETURNO : Open.h
  • ID_RETURNP : Print.h
  • ID_RETURNTI : Title.h
  • ID_RGBCOLORSF : Font.h
  • ID_RGBRESULTC : Colors.h
  • ID_RUN_TEST : Resource.h
  • ID_SAVE : Resource.h
  • ID_SAVE_NOW : Resource.h
  • ID_SAVE_ON_EXIT : Resource.h
  • ID_SCROLLFIELD : FontView.h
  • ID_SEND_MESSAGE : Resource.h
  • ID_SEND_WM_CF_LF_MSG : Font.h
  • ID_SEPARATOR : afxres.h
  • ID_SERVER : Resource.h
  • ID_SESSION : Resource.h
  • ID_SETUPHOOKP : Print.h
  • ID_SHOW_ON_SCREEN : Resource.h
  • ID_SHUTDOWN_SYSTEM : Resource.h
  • ID_SIZEMAXF : Font.h
  • ID_SIZEMINF : Font.h
  • ID_SNAPINCBOX : resource.h
  • ID_SPY_DEBUG_NORUNNINGAPPLICATIONS : Resource.h
  • ID_STATIC : OleStd.h
  • ID_STATUSBAR : resource.h , FontView.h , FVText.h
  • ID_STRUCTSIZEC : Colors.h
  • ID_STRUCTSIZEF : Font.h
  • ID_STRUCTSIZEFT : Find.h
  • ID_STRUCTSIZEO : Open.h
  • ID_STRUCTSIZEP : Print.h
  • ID_STYLEF : Font.h
  • ID_SZDEFEXTO : Open.h
  • ID_SZDEVMODEP : Print.h
  • ID_SZDEVNAMESP : Print.h
  • ID_SZFILEO : Open.h
  • ID_SZFILETITLEO : Open.h
  • ID_SZINITDIRO : Open.h
  • ID_SZTITLEO : Open.h
  • ID_TBLCPY_MENU : resource.h
  • ID_TBTN_ABOUT : Resource.h
  • ID_TBTN_CONNECT : Resource.h
  • ID_TBTN_DELETE : Resource.h
  • ID_TBTN_EXPORT_APP : Resource.h
  • ID_TBTN_IMPORT_COMPONENT : Resource.h
  • ID_TBTN_INSTALL_APP : Resource.h
  • ID_TBTN_INSTALL_COMPONENT : Resource.h
  • ID_TBTN_NEW : Resource.h
  • ID_TBTN_REFRESH : Resource.h
  • ID_TBTN_SAVE : Resource.h
  • ID_TBTN_START_APP : Resource.h
  • ID_TBTN_STOP_APP : Resource.h
  • ID_TBTN_UTILITY : Resource.h
  • ID_TEMPLATEC : Colors.h
  • ID_TEMPLATEF : Font.h
  • ID_TEMPLATEFT : Find.h
  • ID_TEMPLATEO : Open.h
  • ID_TERMINATE_PROCESS : Resource.h
  • ID_TIMEFIELD : FontView.h
  • ID_TIMER : resource.h
  • ID_TIPFONTDEC : Resource.h
  • ID_TIPFONTINC : Resource.h
  • ID_TITLEDIALOG : Title.h
  • ID_TITLETI : Title.h
  • ID_TOOLBAR : resource.h , FontView.h , FVText.h
  • ID_TOOLBARWND : resource.h
  • ID_TOOLS_TUNINGWIZARD : resource.h
  • ID_TOPAGEP : Print.h
  • ID_TOPBAND : resource.h
  • ID_TREEVIEW : resource.h
  • ID_UPDATETITLE : Resource.h
  • ID_URLBOX : resource.h
  • ID_USEHINSTO : Open.h
  • ID_VIEW_STATUS_BAR : afxres.h
  • ID_VIEW_TOOLBAR : afxres.h
  • ID_VIEWPORT : FVText.h
  • ID_VIRTUAL_CHANNEL : Resource.h
  • ID_WAIT_EVENT : Resource.h
  • ID_WDEFAULT : DevNames.h
  • ID_WDEVICEOFF : DevNames.h
  • ID_WDRIVEROFF : DevNames.h
  • ID_WIDTHSLIDER : Resource.h
  • ID_WIDTHTEXT : Resource.h
  • ID_WINDOW_ARRANGE : afxres.h
  • ID_WINDOW_ARRANGE_ICONS : resource.h
  • ID_WINDOW_ARRANGEICONS : Resource.h
  • ID_WINDOW_CASCADE : resource.h , afxres.h , Resource.h
  • ID_WINDOW_NEW : afxres.h
  • ID_WINDOW_SPLIT : afxres.h
  • ID_WINDOW_TILE : Resource.h
  • ID_WINDOW_TILE_HORIZONTALLY : resource.h
  • ID_WINDOW_TILE_HORZ : afxres.h
  • ID_WINDOW_TILE_VERT : afxres.h
  • ID_WINDOW_TILE_VERTICALLY : resource.h
  • ID_WINDOW_TILEVERTICAL : Resource.h
  • ID_WOUTPUTOFF : DevNames.h
  • ID_ZOOM : FontView.h
  • IDA_DIALER : Resource.h
  • IDABORT : winres.h
  • IDB_ACTIVATE : Resource.h
  • IDB_ADD : resource.h
  • IDB_ADDCOL : resource.h
  • IDB_ADDDEFINEDPROPS : resource.h
  • IDB_ADDFKCOL : resource.h
  • IDB_ADDSET : resource.h
  • IDB_ADTG : resource.h
  • IDB_AGGREGATION : resource.h
  • IDB_ALIGN : resource.h , res.h
  • IDB_ALWAYSRELEASEROWS : resource.h
  • IDB_ANNOTATOR : resource.h
  • IDB_APPBAR : Resource.h
  • IDB_APPIMG_16 : resource.h
  • IDB_APPIMG_32 : resource.h
  • IDB_AUTOSAVE : resource.h
  • IDB_BACK : Monkey.h
  • IDB_BACKGROUND : Resource.h
  • IDB_BASE : Resource.h
  • IDB_BIKE : resource.h , Resource.h , resource.h
  • IDB_BIKE2 : resource.h , Resource.h , resource.h
  • IDB_BIND_BOOKMARK : resource.h
  • IDB_BIND_LENGTH : resource.h
  • IDB_BIND_STATUS : resource.h
  • IDB_BIND_VALUE : resource.h
  • IDB_BITMAP1 : resource.h , res.h
  • IDB_BLOB_ILOCKBYTES : resource.h
  • IDB_BLOB_INLINE : resource.h
  • IDB_BLOB_ISEQSTREAM : resource.h
  • IDB_BLOB_ISTORAGE : resource.h
  • IDB_BLOB_ISTREAM : resource.h
  • IDB_BMP : ToolBar.h , Resource.h
  • IDB_BREAKID : resource.h
  • IDB_BROWSE : Resource.h
  • IDB_BROWSE_DATASOURCE : resource.h
  • IDB_BROWSE_DIRECTORY : resource.h
  • IDB_BROWSE_INTEGRATED : resource.h
  • IDB_BROWSE_LOCATION : resource.h
  • IDB_BROWSE_PROVIDER : resource.h
  • IDB_BROWSE_PROVSTRING : resource.h
  • IDB_CACHEINFO : resource.h
  • IDB_CAR : resource.h , Resource.h , resource.h
  • IDB_CAR2 : resource.h , Resource.h , resource.h
  • IDB_CASEINSENSITIVE : resource.h
  • IDB_CASESENSITIVE : resource.h
  • IDB_CLEAR : resource.h , res.h
  • IDB_CLEARALL : resource.h
  • IDB_CLOSED : resource.h , Resource.h , resource.h
  • IDB_CLOSED2 : resource.h , Resource.h , resource.h
  • IDB_COLLAB : Resource.h
  • IDB_COLPROP : resource.h
  • IDB_CONFIG_REMOVE : resource.h
  • IDB_CONFIG_SAVE : resource.h
  • IDB_CONNECT : resource.h
  • IDB_CURSORENGINE : resource.h
  • IDB_DEFAULTFETCH : resource.h
  • IDB_DEFAULTS : resource.h
  • IDB_DELCOL : resource.h
  • IDB_DELETE : resource.h
  • IDB_DELETESET : resource.h
  • IDB_DELFKCOL : resource.h
  • IDB_DIRECTORY : resource.h
  • IDB_DISPLAY_ADDREF : resource.h
  • IDB_DISPLAY_HEXADECIMAL : resource.h
  • IDB_DISPLAY_IDBASYNCHNOTIFY : resource.h
  • IDB_DISPLAY_IROWPOSITIONCHANGE : resource.h
  • IDB_DISPLAY_IROWSETNOTIFY : resource.h
  • IDB_DISPLAY_OLEDB : resource.h
  • IDB_DISPLAY_PROMPTVETO : resource.h
  • IDB_DISPLAY_QI : resource.h
  • IDB_DISPLAY_RELEASE : resource.h
  • IDB_DISPLAY_ROWSAFFECTED : resource.h
  • IDB_DISPLAYTREE : resource.h
  • IDB_DRAG_IMAGE : Resource.h
  • IDB_ENCRYPTINFO : resource.h
  • IDB_ENCRYPTPASSWORD : resource.h
  • IDB_ERRORINFO_ALWAYS : resource.h
  • IDB_ERRORINFO_FAILURE : resource.h
  • IDB_ERRORINFO_NEVER : resource.h
  • IDB_EXISTING_DSO : resource.h
  • IDB_FETCHDATA : resource.h
  • IDB_FILENAME : resource.h
  • IDB_FINISH : resource.h
  • IDB_FONT : resource.h , res.h
  • IDB_FROM_ARRAY : resource.h
  • IDB_FROM_BYREF : resource.h
  • IDB_FROM_CONNECT : resource.h
  • IDB_FROM_VECTOR : resource.h
  • IDB_HEADER : resource.h
  • IDB_HIDDENCOLUMNS : resource.h
  • IDB_HRESULT_ALWAYS : resource.h
  • IDB_HRESULT_FAILURE : resource.h
  • IDB_HRESULT_NEVER : resource.h
  • IDB_HRESULT_NOERRORINFO : resource.h
  • IDB_IMAGE : resource.h
  • IDB_IMALLOC_ALLOCS : resource.h
  • IDB_IMALLOC_SPY : resource.h
  • IDB_INDEXPROPERTIES : resource.h
  • IDB_INIT_INITIALIZE : resource.h
  • IDB_INIT_SETPROPERTIES : resource.h
  • IDB_INITOK : Client32.h
  • IDB_INPROC_HANDLER : resource.h
  • IDB_INPROC_SERVER : resource.h
  • IDB_LGBMP : resource.h , Resource.h , resource.h
  • IDB_LOCAL_SERVER : resource.h
  • IDB_LOGO : Resource.h
  • IDB_MASKPASSWORD : resource.h
  • IDB_MMCCONTROL : resource.h
  • IDB_MOREPROPERTIES : resource.h
  • IDB_MSDADC_ONLY : resource.h
  • IDB_NEXT : Monkey.h
  • IDB_NODEIMAGES_16 : resource.h
  • IDB_NODEIMAGES_32 : resource.h
  • IDB_OPEN : resource.h , Resource.h , resource.h
  • IDB_OPEN2 : resource.h , Resource.h , resource.h
  • IDB_OPTIONS : resource.h
  • IDB_OUTPUT : resource.h
  • IDB_OWNED_PROVIDER : resource.h
  • IDB_PERSISTINFO : resource.h
  • IDB_PLANE : resource.h , Resource.h , resource.h
  • IDB_PLANE2 : resource.h , Resource.h , resource.h
  • IDB_PREV : resource.h
  • IDB_PRINT : Monkey.h
  • IDB_QI_MANDATORY : resource.h
  • IDB_QI_OPTIONAL : resource.h
  • IDB_READING : resource.h , res.h
  • IDB_REFCOUNT_FAILURE : resource.h
  • IDB_RELEASE_OPENOBJECTS : resource.h
  • IDB_REMOTE_SERVER : resource.h
  • IDB_RESET : resource.h
  • IDB_RESULTSEGA : OleStd.h
  • IDB_RESULTSHIRESVGA : OleStd.h
  • IDB_RESULTSVGA : OleStd.h
  • IDB_ROCKET : resource.h , Resource.h , resource.h
  • IDB_ROCKET2 : resource.h , Resource.h , resource.h
  • IDB_ROWSETPROPERTIES : resource.h
  • IDB_ROWSTOFETCH : resource.h
  • IDB_SELECTALL : resource.h
  • IDB_SEND : Client32.h
  • IDB_SET_LEVEL : Resource.h
  • IDB_SETCOMMANDNONE : resource.h
  • IDB_SETCOMMANDSTREAM : resource.h
  • IDB_SETCOMMANDTEXT : resource.h
  • IDB_SETDEFAULTPROPS : resource.h
  • IDB_SETPARAMS : resource.h
  • IDB_SETPROPERTIES : resource.h
  • IDB_SHARE : Resource.h
  • IDB_SHOWSUPPORTED : resource.h
  • IDB_SMBMP : resource.h , Resource.h , resource.h
  • IDB_SMOPEN : resource.h , Resource.h , resource.h
  • IDB_STANDARDIMAGES : BttnCur.h
  • IDB_STANDARDIMAGES120 : BttnCur.h
  • IDB_STANDARDIMAGES72 : BttnCur.h
  • IDB_STANDARDIMAGES96 : BttnCur.h
  • IDB_STANDARDIMAGESMIN : BttnCur.h
  • IDB_STATE : resource.h
  • IDB_SWITCH : Resource.h
  • IDB_TABLEPROPERTIES : resource.h
  • IDB_TBAR : Resource.h
  • IDB_TEST : resource.h
  • IDB_TO_ARRAY : resource.h
  • IDB_TO_BYREF : resource.h
  • IDB_TO_CONNECT : resource.h
  • IDB_TO_VECTOR : resource.h
  • IDB_TOOLBAR : resource.h , MidiPlyr.h
  • IDB_TOOLS : Resource.h
  • IDB_TREEICON : resource.h
  • IDB_UNCOLLAB : Resource.h
  • IDB_UNICODE : resource.h
  • IDB_UNSELECTALL : resource.h
  • IDB_UNSHARE : Resource.h
  • IDB_UPDATE : Resource.h
  • IDB_USE_TRACEPROVIDER : resource.h
  • IDB_USEOPTCOLUMNS : resource.h
  • IDB_USEPARAMS : resource.h
  • IDB_USEPROPERTIES : resource.h
  • IDB_USERESTRICTIONS : resource.h
  • IDB_USESERVICECOMP : resource.h
  • IDB_WATERMARK : resource.h
  • IDB_WINDOW : Resource.h
  • IDB_XML : resource.h
  • IDB_XML_BROWSER : resource.h
  • IDB_XML_DOM : resource.h
  • IDB_XML_EDITBOX : resource.h
  • IDBASIC : Resource.h
  • IDBT_FONTSIZEDECREASE : Resource.h
  • IDBT_FONTSIZEINCREASE : Resource.h
  • IDBT_OPENAS : Resource.h
  • IDBZ_ICON : OleStd.h
  • IDBZ_MESSAGE1 : OleStd.h
  • IDBZ_RETRY : OleStd.h
  • IDBZ_SWITCHTO : OleStd.h
  • IDC_ABOUT : Dialogs.h
  • IDC_ACCESSCHECK : Resource.h
  • IDC_ACCOUNT : resource.h
  • IDC_ACCTNAME : resource.h
  • IDC_ACELIST : resource.h
  • IDC_ACETYPE : resource.h
  • IDC_ACK_FULL_RADIO : Resource.h
  • IDC_ACK_FULL_REACH_QUEUE_RADIO : Resource.h
  • IDC_ACK_FULL_RECEIVE_RADIO : Resource.h
  • IDC_ACK_NEG_RADIO : Resource.h
  • IDC_ACK_NONE_RADIO : Resource.h
  • IDC_ACODE : Resource.h
  • IDC_ACP : resource.h , res.h
  • IDC_ACTIONINARGUMENT : resource.h
  • IDC_ACTIONNAME : resource.h
  • IDC_ACTIONOUTARGUMENT : resource.h
  • IDC_ACTIVE : Resource.h
  • IDC_ADD : resource.h , Resource.h
  • IDC_ADD_BUTTON : resource.h
  • IDC_ADDACCESS : Resource.h
  • IDC_ADDCOL : resource.h
  • IDC_ADDEQUIPMENT : resource.h
  • IDC_ADDFKCOL : resource.h
  • IDC_ADDPARTY : Resource.h
  • IDC_ADDRESS : Resource.h
  • IDC_ADDRESSTYPE : Resource.h
  • IDC_ADDUSER : resource.h
  • IDC_ADMIN_COMBO : Resource.h
  • IDC_ADSPATH : resource.h
  • IDC_ADSTYPE : resource.h
  • IDC_AGENT : Resource.h
  • IDC_AGENTVERSION : Resource.h
  • IDC_Aggregate : resource.h
  • IDC_AMOUNT : resource.h
  • IDC_ANIMATE : resource.h
  • IDC_ANIMATIONS : Resource.h
  • IDC_ANIMATIONS_LABEL : Resource.h
  • IDC_ANIMATIONSTATE : resource.h
  • IDC_ANSIFILL : FullIME.h , HalfIME.h
  • IDC_ANSWER : Resource.h
  • IDC_APP_CODE : Resource.h
  • IDC_APPBAR : Resource.h
  • IDC_APPLICATION_COPYRIGHT : Resource.h
  • IDC_APPLICATION_ICON : Resource.h
  • IDC_APPLICATION_TITLE : Resource.h
  • IDC_APPLICATION_VERSION : Resource.h
  • IDC_APPLYDIGITSUBST : Resource.h
  • IDC_APPSHARING : Resource.h
  • IDC_ARANUMCONTEXT : Resource.h
  • IDC_ARCHIVE_ATTR : resource.h
  • IDC_AREACODE : Resource.h
  • IDC_ASYNCFIND : resource.h
  • IDC_ASYNCH : resource.h
  • IDC_ATTR : resource.h
  • IDC_ATTR_COMPRESSED : resource.h
  • IDC_ATTR_ENCRYPTED : resource.h
  • IDC_ATTRIBONLY : resource.h
  • IDC_ATTRIBUTE : resource.h
  • IDC_ATTRLIST : resource.h
  • IDC_ATTRVALUE : resource.h
  • IDC_AUDIT_TO_DB : Resource.h
  • IDC_AUTHENTICATED : Resource.h
  • IDC_AUTO_CHAT : Resource.h
  • IDC_AUTOANSWER : Resource.h
  • IDC_AUTOHIDE : Resource.h
  • IDC_AVEBITS : resource.h
  • IDC_AVGTIME1 : Resource.h
  • IDC_AVGTIME2 : Resource.h
  • IDC_AVGTIME3 : Resource.h
  • IDC_AVGTIMEBASE : Resource.h
  • IDC_BACKUP_FLAG : resource.h
  • IDC_BAD : Resource.h
  • IDC_BALLOON_AUTOHIDE : Resource.h
  • IDC_BALLOON_AUTOPACE : Resource.h
  • IDC_BALLOON_SIZETOTEXT : Resource.h
  • IDC_BALLOON_USE : Resource.h
  • IDC_BAR : wdiffrc.h
  • IDC_BESTFIT : Dialogs.h
  • IDC_BINDGUID : resource.h
  • IDC_BINDING_INFO_EDIT : resource.h
  • IDC_BINDINGTYPE : resource.h
  • IDC_BITDEPTH : resource.h
  • IDC_BITMAP1 : Dialogs.h
  • IDC_BITMAP2 : Dialogs.h
  • IDC_BLUE : Resource.h
  • IDC_BLUEGAMMA : resource.h
  • IDC_BLUEGAMMASLIDER : resource.h
  • IDC_BODY : Resource.h
  • IDC_BOX1 : Dialogs.h , Dibdll.h
  • IDC_BOX2 : Dialogs.h
  • IDC_BOX3 : Dialogs.h
  • IDC_BOX4 : Dialogs.h
  • IDC_BRIGHTNESS : resource.h
  • IDC_BRIGHTNESSSLIDER : resource.h
  • IDC_BROWSE : resource.h
  • IDC_BUDDYLIST : resource.h
  • IDC_BUTTON1 : resource.h , Resource.h
  • IDC_BUTTON2 : resource.h , Resource.h
  • IDC_BUTTON_ADDQUEUE : resource.h
  • IDC_BUTTON_APPLICATION_FILE_SEARCH : Resource.h
  • IDC_BUTTON_APPLICATON_ID_SEARCH : Resource.h
  • IDC_BUTTON_ATTACH : Resource.h , resource.h
  • IDC_BUTTON_CHANGE_PICTURE : resource.h
  • IDC_BUTTON_CLEAR_PICTURE : resource.h
  • IDC_BUTTON_COMPONENT_SEARCH : Resource.h
  • IDC_BUTTON_EXPORT_PATH_SEARCH : Resource.h
  • IDC_BUTTON_INSTALL_DIRECTORY_SEARCH : Resource.h
  • IDC_BUTTON_PROXY_STUB_DLL : Resource.h
  • IDC_BUTTON_SESSION_ACCEPT : resource.h
  • IDC_BUTTON_SESSION_REJECT : resource.h
  • IDC_BUTTON_SET_PROPERTY : Resource.h
  • IDC_BUTTON_TYPE_LIBRARY : Resource.h
  • IDC_BUTTON_WATCHER_ALLOW : resource.h
  • IDC_BUTTON_WATCHER_BLOCK : resource.h
  • IDC_CACHERESULTS : resource.h
  • IDC_CALFORMAT : resource.h , res.h
  • IDC_CALL_USER : Resource.h
  • IDC_CallbackList : resource.h
  • IDC_CALLINGCARD : Resource.h
  • IDC_CANCEL : gutilsrc.h , resource.h , Resource.h
  • IDC_CANCEL2 : resource.h
  • IDC_CANONICALNUMBER : Resource.h
  • IDC_CAPTIONBARONLY : Dialogs.h
  • IDC_CATALOG : resource.h
  • IDC_CBLIST : resource.h
  • IDC_CCODE : Resource.h
  • IDC_CENTER : Resource.h
  • IDC_CHANGE_CREATE_CHILD : resource.h
  • IDC_CHANGE_CREATE_CHILD2 : resource.h
  • IDC_CHANGE_CREATE_CHILD3 : resource.h
  • IDC_CHANGE_CREATE_CHILD4 : resource.h
  • IDC_ChangeIndexID : resource.h
  • IDC_CHANGEUSER : resource.h
  • IDC_CHANNELNUM : resource.h
  • IDC_CHANNELS : resource.h
  • IDC_CHASEREFERRAL : resource.h
  • IDC_CHASEREFERRAL_TXT : resource.h
  • IDC_CHATTY : resource.h
  • IDC_CHECK1 : resource.h , Resource.h
  • IDC_CHECK2 : resource.h , Resource.h
  • IDC_CHECK3 : Resource.h
  • IDC_CHECK4 : Resource.h
  • IDC_CHECK5 : Resource.h
  • IDC_CHECK6 : Resource.h
  • IDC_CHECK7 : Resource.h
  • IDC_CHECK8 : Resource.h
  • IDC_CHECK_ALLAPPS : Resource.h
  • IDC_CHECK_COMMAND_REQUEST_CONTEXT : resource.h
  • IDC_CHECK_COMMAND_RESPONSE_CONTEXT : resource.h
  • IDC_CHECK_OVERWRITE_FILES : Resource.h
  • IDC_CHECK_PRESENTATION_CONTEXT : resource.h
  • IDC_CHECK_REMOTE_SERVER_INSTALL : Resource.h
  • IDC_CHECK_USER_CONTEXT : resource.h
  • IDC_CHECK_WATCHER_ADD_BUDDY : resource.h
  • IDC_CHECKAUTO : Resource.h
  • IDC_CHILDRENLIST : resource.h
  • IDC_CHK_MATCHCASE : wdiffrc.h
  • IDC_CHK_WHOLEWORD : wdiffrc.h
  • IDC_CHOOSECOLOR : Resource.h , secClnt.h , secSvr.h
  • IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES : resource.h
  • IDC_CHOOSER_CHECK_OVERRIDE_MACHINE_NAME : resource.h
  • IDC_CHOOSER_EDIT_MACHINE_NAME : resource.h
  • IDC_CHOOSER_GROUP_TARGET_MACHINE : resource.h
  • IDC_CHOOSER_RADIO_LOCAL_MACHINE : resource.h
  • IDC_CHOOSER_RADIO_SPECIFIC_MACHINE : resource.h
  • IDC_CHOOSER_STATIC : resource.h
  • IDC_CIRCLE : Resource.h
  • IDC_CLASS : resource.h
  • IDC_CLASS_EDIT : resource.h
  • IDC_CLEAR : FullIME.h , HalfIME.h
  • IDC_CLEAR_ON_NEW : Deb.h
  • IDC_CLEARTEXT : resource.h
  • IDC_CLIENT_AUTHNLEVEL : secClnt.h
  • IDC_CLIENT_IMPLEVEL : secClnt.h
  • IDC_CLIENTAREAONLY : Dialogs.h
  • IDC_CLOSE : resource.h
  • IDC_CLOSEIME : FullIME.h , HalfIME.h
  • IDC_CODEPOINT : Resource.h
  • IDC_COLLIST : resource.h
  • IDC_COLNAME : resource.h
  • IDC_COLOR : Resource.h , secClnt.h , secSvr.h
  • IDC_COLORFULNESS : resource.h
  • IDC_COLORFULNESSSLIDER : resource.h
  • IDC_COLORTEXT : Resource.h , secSvr.h
  • IDC_COLUMN : resource.h
  • IDC_COLUMN_NAMES : Resource.h
  • IDC_COLUMNS : resource.h
  • IDC_COMBO : Resource.h
  • IDC_COMBO1 : secClnt.h , resource.h , Resource.h , resource.h , Resource.h
  • IDC_COMBO2 : Resource.h
  • IDC_COMBO3 : Resource.h
  • IDC_COMBO_APPLICATION : Resource.h
  • IDC_COMBO_BITDEPTH : resource.h
  • IDC_COMBO_CHANNEL : resource.h
  • IDC_COMBO_GUIDFORMAT : resource.h
  • IDC_COMBO_LOGON_TRANSPORT : resource.h
  • IDC_COMBO_SAMPLERATE : resource.h
  • IDC_COMBO_SPEAKER : resource.h
  • IDC_COMBO_WAVEFORMAT : resource.h
  • IDC_COMBODEVICE : resource.h
  • IDC_COMBOFIND : resource.h
  • IDC_COMBOSERVICE : resource.h
  • IDC_COMMANDS : Resource.h
  • IDC_COMMENT : Resource.h
  • IDC_COMPANY : Generic.H , StatList.h , LeakyBin.h
  • IDC_COMPANYNAME : resource.h
  • IDC_COMPAREOP : resource.h
  • IDC_COMPLETE2 : resource.h
  • IDC_COMPLETIONTIME : resource.h
  • IDC_COMPLETIONTIMETXT : resource.h
  • IDC_CONFIG : resource.h
  • IDC_CONFIGDIALOG_ADD : Resource.h
  • IDC_CONFIGDIALOG_CONFIGTEXT : Resource.h
  • IDC_CONFIGDIALOG_EDIT : Resource.h
  • IDC_CONFIGDIALOG_ITEMLIST : Resource.h
  • IDC_CONFIGDIALOG_REMOVE : Resource.h
  • IDC_CONFIGDIALOG_SUMMARYTEXT : Resource.h
  • IDC_CONFIGURATIONCHANGED : Resource.h
  • IDC_CONFIGURELINE : Resource.h
  • IDC_CONNECT : Resource.h , resource.h , Resource.h , resource.h
  • IDC_CONNECTED : Resource.h
  • IDC_CONNECTION : resource.h
  • IDC_CONNECTSTRING : resource.h
  • IDC_CONSTYPE : resource.h
  • IDC_CONTEXTHELP : BttnCur.h
  • IDC_CONTINUE : Resource.h , resource.h
  • IDC_CONTRAST : resource.h
  • IDC_CONTRASTSLIDER : resource.h
  • IDC_CONTROL1 : resource.h
  • IDC_CONTROL2 : resource.h
  • IDC_CONTROL_CHARS : Resource.h
  • IDC_CONTROL_CONTEXT : Resource.h
  • IDC_COORDINATES : resource.h
  • IDC_COPY : resource.h
  • IDC_COPYRIGHT : Generic.H , Dialogs.h , StatList.h , LeakyBin.h
  • IDC_COUNTRYCODE : Resource.h
  • IDC_CREATE : secClnt.h , resource.h
  • IDC_CREATE_CHILD : resource.h
  • IDC_CREATE_FILE : Resource.h
  • IDC_CREATE_ROWS : resource.h
  • IDC_CREATE_TABLES : resource.h
  • IDC_CREATECHILD : resource.h
  • IDC_CREATECHILD_EDIT : resource.h
  • IDC_CREATIONTIMETXT : resource.h
  • IDC_CREDIT : resource.h
  • IDC_CTL1_NAME : resource.h
  • IDC_CTL1_VER : resource.h
  • IDC_CTL2_NAME : resource.h
  • IDC_CTL2_VER : resource.h
  • IDC_CURRENTCREDENTIAL : resource.h
  • IDC_CUSTOM1 : Resource.h
  • IDC_CUSTOMDRAWBUTTONDLG : Resource.h
  • IDC_DATA : Resource.h
  • IDC_DATAGRID1 : resource.h
  • IDC_DATATYPE : resource.h
  • IDC_DBCSFILL : FullIME.h , HalfIME.h
  • IDC_DEAD_LETTER : Resource.h
  • IDC_DEBIT : resource.h
  • IDC_DEBUG : resource.h
  • IDC_DEBUG_MODE_ERROR : Deb.h
  • IDC_DEBUG_MODE_MINORERROR : Deb.h
  • IDC_DEBUG_MODE_NONE : Deb.h
  • IDC_DEBUG_MODE_WARNING : Deb.h
  • IDC_DEBUG_ONLY_THIS_PROCESS : Deb.h
  • IDC_DEBUG_PROCESS : Deb.h
  • IDC_DEFAULT_HW_RECO : resource.h
  • IDC_DEFAULT_POS : HalfIME.h
  • IDC_DEFAULT_SPEECH_RECO : resource.h
  • IDC_DEFAULTDIALECT : resource.h
  • IDC_DEFERRABILITY : resource.h
  • IDC_DELAY1 : Resource.h
  • IDC_DELAY2 : Resource.h
  • IDC_DELAY3 : Resource.h
  • IDC_DELCOL : resource.h
  • IDC_DELETE : resource.h
  • IDC_DELETE_BUTTON : resource.h
  • IDC_DELETE_QUEUE_COMBO : Resource.h
  • IDC_DELETECHILD : resource.h
  • IDC_DELETECHILD_EDIT : resource.h
  • IDC_DELETEOBJECT : resource.h
  • IDC_DELETERULE : resource.h
  • IDC_DELETETREE : resource.h
  • IDC_DELFKCOL : resource.h
  • IDC_DELIVERY_EXPRESS_RADIO : Resource.h
  • IDC_DELIVERY_RECOVERABLE_RADIO : Resource.h
  • IDC_DEREF : resource.h
  • IDC_DEREF_TXT : resource.h
  • IDC_DESCRIPTION : resource.h
  • IDC_DESCRIPTION_EDIT : resource.h
  • IDC_DEVICES : Resource.h
  • IDC_DEVNAME_EDIT : resource.h
  • IDC_DEVPROP : resource.h
  • IDC_DIAL : Resource.h
  • IDC_DIALABLENUMBER : Resource.h
  • IDC_DIALECT : resource.h
  • IDC_DIALINGPROPERTIES : Resource.h
  • IDC_DIGIT_SUBSTITUTE : Resource.h
  • IDC_DIMENSIONS : resource.h
  • IDC_DIRECTORIES : Dialogs.h
  • IDC_DIRS : gutilsrc.h
  • IDC_DISCONNECT : Resource.h
  • IDC_DISCONNECT_SESSION : Resource.h
  • IDC_DISCONNECTED : Resource.h
  • IDC_DISCOVERY : resource.h
  • IDC_DISK_PROPS_DESCRIPTIONS : resource.h
  • IDC_DISKDETAILS : resource.h
  • IDC_DISKINFO : Resource.h
  • IDC_DISPLAYABLENUMBER : Resource.h
  • IDC_DISPLAYBOX : Resource.h
  • IDC_DISPLAYICON : Resource.h
  • IDC_DISPLAYNAME : resource.h
  • IDC_DIVIDINGLINE : Dialogs.h
  • IDC_DN : resource.h
  • IDC_DNS_NAME_EDIT : resource.h
  • IDC_DNS_NAME_TYPE_EDIT : resource.h
  • IDC_DOMAIN : Resource.h , resource.h , Resource.h
  • IDC_DOMAIN_NAME : Resource.h
  • IDC_DOWN : Resource.h
  • IDC_Download : resource.h
  • IDC_DOWNLOAD : resource.h
  • IDC_DOWNLOAD_ACTIONTEXT : resource.h
  • IDC_DOWNLOAD_BANNER : resource.h
  • IDC_DOWNLOAD_CANCEL : resource.h
  • IDC_DOWNLOAD_ICON : resource.h
  • IDC_DOWNLOAD_PROGRESSBAR : resource.h
  • IDC_DRAGPENDING : Resource.h
  • IDC_DRAWAREA_SCRIBLLE : Resource.h , resource.h
  • IDC_DRD_FINDWHAT : wdiffrc.h
  • IDC_DURI : Resource.h
  • IDC_DURISTATIC : Resource.h
  • IDC_DWUSERID : Resource.h
  • IDC_E_AUTOSIZE : Resource.h
  • IDC_ECAC : Resource.h
  • IDC_EDIT : tsfedit.h
  • IDC_EDIT1 : resource.h , Resource.h , resource.h
  • IDC_EDIT2 : Resource.h
  • IDC_EDIT3 : Resource.h
  • IDC_EDIT4 : Resource.h
  • IDC_EDIT5 : Resource.h
  • IDC_EDIT6 : Resource.h
  • IDC_EDIT7 : Resource.h
  • IDC_EDIT8 : Resource.h
  • IDC_EDIT_ADDRESS_NAME : resource.h
  • IDC_EDIT_ADDRESS_URI : resource.h
  • IDC_EDIT_APPLICATION_FILE : Resource.h
  • IDC_EDIT_APPLICATION_ID : Resource.h
  • IDC_EDIT_APPLICATION_ID_VALUE : Resource.h
  • IDC_EDIT_AUTH_ACCOUNT : resource.h
  • IDC_EDIT_AUTH_PASSWORD : resource.h
  • IDC_EDIT_AUTH_USERURI : resource.h
  • IDC_EDIT_AVEBITS : resource.h
  • IDC_EDIT_BUTTON : resource.h
  • IDC_EDIT_COMPONENT : Resource.h
  • IDC_EDIT_CONTAINER : resource.h
  • IDC_EDIT_DOMAIN : resource.h
  • IDC_EDIT_EMPLOYEE_ID : resource.h
  • IDC_EDIT_ENTRYNAME : resource.h
  • IDC_EDIT_EXPORT_PATH : Resource.h
  • IDC_EDIT_FRIEND : Resource.h , resource.h
  • IDC_EDIT_FRIEND_COMPUTER : Resource.h , resource.h
  • IDC_EDIT_INSTALL_DIRECTORY : Resource.h
  • IDC_EDIT_LOGIN : Resource.h , resource.h
  • IDC_EDIT_LOGON_SERVER : resource.h
  • IDC_EDIT_LOGON_USERURI : resource.h
  • IDC_EDIT_MACHINE : DComDraw.h , RemClien.h
  • IDC_EDIT_NAME : Resource.h
  • IDC_EDIT_OUTPUT_PATH : resource.h
  • IDC_EDIT_PASSWD : Resource.h
  • IDC_EDIT_PASSWORD : resource.h
  • IDC_EDIT_PGTITLE : RESDEF.h
  • IDC_EDIT_PHONENO : resource.h
  • IDC_EDIT_PICTURE_PATH : resource.h
  • IDC_EDIT_PROPERTY_VALUE : Resource.h
  • IDC_EDIT_PROXY_STUB_DLL : Resource.h
  • IDC_EDIT_PWD : Resource.h
  • IDC_EDIT_REMOTE_COMPUTER_NAME : Resource.h
  • IDC_EDIT_REMOTE_SERVER_NAME : Resource.h
  • IDC_EDIT_TYPE_LIBRARY : Resource.h
  • IDC_EDIT_UID : Resource.h
  • IDC_EDIT_USERNAME : resource.h
  • IDC_EDIT_VALIDBITS : resource.h
  • IDC_EDITBOX : resource.h
  • IDC_EDITDEVICETYPE : resource.h
  • IDC_EDITFILE : Dialogs.h
  • IDC_EDITFRIENDLYNAME : resource.h
  • IDC_EDITMANUFACTURER : resource.h
  • IDC_EDITMANUFACTURERURL : resource.h
  • IDC_EDITMODELDESCRIPTION : resource.h
  • IDC_EDITMODELNAME : resource.h
  • IDC_EDITMODELNUMBER : resource.h
  • IDC_EDITMODELURL : resource.h
  • IDC_EDITPRESENTATIONURL : resource.h
  • IDC_EDITSELECTPRINTER : resource.h
  • IDC_EDITSERIALNUMBER : resource.h
  • IDC_EDITUDN : resource.h
  • IDC_EDITUPC : resource.h
  • IDC_EDITWIN : resource.h , res.h
  • IDC_EDT_BODY_SIZE : Resource.h
  • IDC_EDT_GOTOLINE : wdiffrc.h
  • IDC_ENABLED : resource.h
  • IDC_ENCRYPT : resource.h
  • IDC_ENCRYPTED : Resource.h
  • IDC_ENTIRESCREEN : Dialogs.h
  • IDC_ENTIREWINDOW : Dialogs.h
  • IDC_ENTRYNAME : Resource.h
  • IDC_ENUMDISKS : resource.h , Resource.h
  • IDC_ENUMSERVICES : resource.h
  • IDC_ENUMSERVICESASYNC : resource.h
  • IDC_ERRORMSG : resource.h
  • IDC_ERRORMSGTXT : resource.h
  • IDC_ESTIMATEDTIME : resource.h
  • IDC_ESTIMATEDTIMETXT : resource.h
  • IDC_EVENT_FLAGS : Resource.h
  • IDC_EVENTLIST : resource.h
  • IDC_EVENTS : resource.h
  • IDC_EVENTS_FRAME : Resource.h
  • IDC_EVENTSINK : Resource.h
  • IDC_EXECUTE : resource.h
  • IDC_EXIT : Resource.h , resource.h
  • IDC_EXTENDEDRIGHT : resource.h
  • IDC_EXTENDEDRIGHT_EDIT : resource.h
  • IDC_FAILS : Resource.h
  • IDC_FANCY_BOLD1 : Resource.h
  • IDC_FANCY_BOLD2 : Resource.h
  • IDC_FANCY_BOLD3 : Resource.h
  • IDC_FANCY_BOLD4 : Resource.h
  • IDC_FANCY_FONT1 : Resource.h
  • IDC_FANCY_FONT2 : Resource.h
  • IDC_FANCY_FONT3 : Resource.h
  • IDC_FANCY_FONT4 : Resource.h
  • IDC_FANCY_ITALIC1 : Resource.h
  • IDC_FANCY_ITALIC2 : Resource.h
  • IDC_FANCY_ITALIC3 : Resource.h
  • IDC_FANCY_ITALIC4 : Resource.h
  • IDC_FANCY_SIZE1 : Resource.h
  • IDC_FANCY_SIZE2 : Resource.h
  • IDC_FANCY_SIZE3 : Resource.h
  • IDC_FANCY_SIZE4 : Resource.h
  • IDC_FANCY_UNDERLINE1 : Resource.h
  • IDC_FANCY_UNDERLINE2 : Resource.h
  • IDC_FANCY_UNDERLINE3 : Resource.h
  • IDC_FANCY_UNDERLINE4 : Resource.h
  • IDC_FAR : Resource.h
  • IDC_FASTBIND : resource.h
  • IDC_FILE : Dialogs.h
  • IDC_FILEDESC : Generic.H , StatList.h , LeakyBin.h
  • IDC_FILEDESCRIPTION : resource.h
  • IDC_FILEINFO : OpenDIB.c
  • IDC_FILENAME : resource.h
  • IDC_FILES : gutilsrc.h
  • IDC_FILETEXT : Dialogs.h
  • IDC_FILTER : resource.h
  • IDC_FINDBYTYPE : resource.h
  • IDC_FINDBYUDN : resource.h
  • IDC_FINDSOMEONE : Resource.h
  • IDC_FINISH : resource.h
  • IDC_FKCOLLIST : resource.h
  • IDC_FKCOLNAME : resource.h
  • IDC_FLAGS : resource.h
  • IDC_FLDRNAME_EDIT : resource.h
  • IDC_FNAME : gutilsrc.h
  • IDC_FOLD : Dialogs.h
  • IDC_FORMAT1 : Resource.h
  • IDC_FORMAT2 : Resource.h
  • IDC_FORMAT3 : Resource.h
  • IDC_FORMAT4 : Resource.h
  • IDC_FORMATNAME_COMBO2 : Resource.h
  • IDC_FORMATTED : Resource.h
  • IDC_FRAME_CATALOG_INFO : Resource.h
  • IDC_FRAME_EXPORT_CLIENT_ONLY : Resource.h
  • IDC_FRAME_FRIEND : resource.h
  • IDC_FRAME_IMPORT_BY : Resource.h
  • IDC_FRAME_INSTALL_OPTIONS : Resource.h
  • IDC_FRAME_OBJECTS_AND_PROP_INFO : Resource.h
  • IDC_FRAME_PREVIOUS_COLLECTIONS : Resource.h
  • IDC_FRAME_RELATED_COLLECTIONS : Resource.h
  • IDC_FRAME_UTILITY_OPTIONS : Resource.h
  • IDC_FRAME_UTILITY_TYPE : Resource.h
  • IDC_FROM : resource.h
  • IDC_FROMTYPE : resource.h
  • IDC_GET : resource.h
  • IDC_GETEX : resource.h
  • IDC_GETINFO : resource.h
  • IDC_GETINFOEX : resource.h
  • IDC_GIRLS : resource.h
  • IDC_GLOBALDEV : res.h
  • IDC_GOOD : Resource.h
  • IDC_GREEN : Resource.h
  • IDC_GREENGAMMA : resource.h
  • IDC_GREENGAMMASLIDER : resource.h
  • IDC_GROUPBOX1 : Dialogs.h
  • IDC_GUID : resource.h
  • IDC_HARROWS : BttnCur.h
  • IDC_HCONFNOTIFY : Resource.h
  • IDC_Header1 : resource.h
  • IDC_HEADER1 : resource.h
  • IDC_Header2 : resource.h
  • IDC_HEADER2 : resource.h
  • IDC_HIDDEN_ATTR : resource.h
  • IDC_HIGH_PRIORITY_CLASS : Deb.h
  • IDC_HIGHLIGHT_FROM : Resource.h
  • IDC_HIGHLIGHT_TO : Resource.h
  • IDC_HIPART : resource.h
  • IDC_HORIZ : Resource.h
  • IDC_HOST : Resource.h
  • IDC_HSIZEBAR : BttnCur.h
  • IDC_HSPLITBAR : BttnCur.h
  • IDC_HWR_NAME : resource.h
  • IDC_HWR_VENDOR : resource.h
  • IDC_ICONAREA : Dialogs.h
  • IDC_ICONPOS : Resource.h
  • IDC_IDC_MQ_RECEIVE_ACCESS : Resource.h
  • IDC_IDLE_PRIORITY_CLASS : Deb.h
  • IDC_ILLUMINATE : resource.h
  • IDC_IM_DISPLAY : resource.h
  • IDC_IM_EDIT : resource.h
  • IDC_IM_SEND : resource.h
  • IDC_IMAGE : OpenDIB.c
  • IDC_IMPERSONATE : resource.h , Resource.h
  • IDC_INHERITANCE : resource.h
  • IDC_INITIALDIR : Deb.h
  • IDC_INITIALIZE : secClnt.h , secSvr.h
  • IDC_INPROC_MTA2STA : Resource.h
  • IDC_INPROC_MTA2STA_CANCELACT : Resource.h
  • IDC_INPROC_MTA2STA_CANCELCALL : Resource.h
  • IDC_INPROC_STA2MTA : Resource.h
  • IDC_INPROC_STA2MTA_CANCELACT : Resource.h
  • IDC_INPROC_STA2MTA_CANCELCALL : Resource.h
  • IDC_INPROC_STA2STA : Resource.h
  • IDC_INPROC_STA2STA_CANCELACT : Resource.h
  • IDC_INPROC_STA2STA_CANCELCALL : Resource.h
  • IDC_INPUT : resource.h
  • IDC_INSERT_CODEPOINT : Resource.h
  • IDC_INSTALL : Resource.h
  • IDC_INTERFACE : resource.h
  • IDC_INTERFACES : resource.h
  • IDC_INTERFACESTREAM : resource.h
  • IDC_INVOKEACTION : resource.h
  • IDC_ISCO_FLAGS : resource.h
  • IDC_ISOLEVEL : resource.h
  • IDC_ITEM : resource.h
  • IDC_ITEMCONFIGDIALOG_EDIT_DIR1NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_EDIT_DIR2NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_EDIT_DISPLAYNAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_INCLUDESUBDIRS : Resource.h
  • IDC_ITEMCONFIGDIALOG_STATIC_DIR1NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_STATIC_DIR2NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_STATIC_DISPLAYNAME : Resource.h
  • IDC_ITERCOUNT : Resource.h
  • IDC_ITERS : resource.h
  • IDC_ITERTOTAL : Resource.h
  • IDC_JOBSTATUS : resource.h
  • IDC_JOURNAL : Resource.h
  • IDC_JUSTIFY : Resource.h
  • IDC_KEYWORD_EDIT : resource.h
  • IDC_KEYWORD_LIST : resource.h
  • IDC_LABEL : Generic.H , Resource.h , StatList.h , LeakyBin.h
  • IDC_LABEL_APPLICATION : Resource.h
  • IDC_LABEL_APPLICATION_FILE : Resource.h
  • IDC_LABEL_APPLICATION_ID : Resource.h
  • IDC_LABEL_COLLECTION_NAME_DESC : Resource.h
  • IDC_LABEL_COLLECTION_NAME_VALUE : Resource.h
  • IDC_LABEL_COMPONENT : Resource.h
  • IDC_LABEL_COMPUTER_NAME_DESC : Resource.h
  • IDC_LABEL_COMPUTER_NAME_VALUE : Resource.h
  • IDC_LABEL_EXPORT_PATH : Resource.h
  • IDC_LABEL_INSTALL_DIRECTORY : Resource.h
  • IDC_LABEL_OBJECTS_DESC : Resource.h
  • IDC_LABEL_PROPERTIES_DESC2 : Resource.h
  • IDC_LABEL_PROPERTY_VALUE_DESC : Resource.h
  • IDC_LABEL_PROXY_STUB_DLL : Resource.h
  • IDC_LABEL_PWD : Resource.h
  • IDC_LABEL_REMOTE_SERVER_NAME : Resource.h
  • IDC_LABEL_TYPE_LIBRARY : Resource.h
  • IDC_LABEL_UID : Resource.h
  • IDC_LANGNAME : resource.h , res.h
  • IDC_LANGUAGE : Resource.h
  • IDC_LANGUAGES : resource.h , res.h
  • IDC_LARGEARROWS : BttnCur.h
  • IDC_LASTVALUE : Resource.h
  • IDC_LBINSTALLEDCODECS : Resource.h
  • IDC_LCID : resource.h
  • IDC_LDATEFORMAT : resource.h , res.h
  • IDC_LDATESAMPLE : resource.h , res.h
  • IDC_LDIRS : gutilsrc.h
  • IDC_LEFT : Resource.h
  • IDC_LEGACY_BIDI : Resource.h
  • IDC_LEGALCOPYRIGHT : resource.h
  • IDC_LEGALTRADEMARKS : resource.h
  • IDC_LEVEL : Resource.h
  • IDC_LFILES : gutilsrc.h
  • IDC_LFNAME : gutilsrc.h
  • IDC_LINECREATE : Resource.h
  • IDC_LINEFILL : Resource.h
  • IDC_LINEICON : Resource.h
  • IDC_LIST : Resource.h
  • IDC_LIST1 : resource.h , Resource.h , FullIME.h , Resource.h
  • IDC_LIST2 : Resource.h
  • IDC_LIST32 : FullIME.h
  • IDC_LIST_APPS : Resource.h
  • IDC_LIST_EVENTS : Resource.h
  • IDC_LIST_MODEMS : resource.h
  • IDC_LIST_OBJECTS : Resource.h
  • IDC_LIST_PARENT_COLLECTIONS : Resource.h
  • IDC_LIST_PROPERTIES : Resource.h
  • IDC_LIST_RELATED_COLLECTIONS : Resource.h
  • IDC_LIST_SERVERS : Resource.h
  • IDC_LIST_SESSION : Resource.h
  • IDC_LISTBOX : DfV.h , resource.h
  • IDC_LISTCONTENT : resource.h
  • IDC_LISTEN : resource.h
  • IDC_LISTOBJECT : resource.h
  • IDC_LISTVIEW : resource.h , enumdesk.h
  • IDC_LISTVIEWEVENTS : Resource.h
  • IDC_LISTVIEWSYSEVENTS : Resource.h
  • IDC_LISTWIN : ListWIN.h
  • IDC_LOAD : resource.h
  • IDC_LOCAL : Resource.h
  • IDC_LOCALE : resource.h
  • IDC_LOCATE_LABEL : Resource.h
  • IDC_LOCATION : OpenDIB.c , Resource.h
  • IDC_LOCKED_ATTR : resource.h
  • IDC_LOG_FILE : Resource.h
  • IDC_LOG_TO_FILE : Resource.h
  • IDC_LOGICAL : Resource.h
  • IDC_LOGICAL_ORDER : Resource.h
  • IDC_LOGICAL_STYLES : Resource.h
  • IDC_LOGICAL_WIDTH : Resource.h
  • IDC_LOGOFF_SESSION : Resource.h
  • IDC_LOOKSD : Resource.h
  • IDC_LOWPART : resource.h
  • IDC_LPAGENR : gutilsrc.h
  • IDC_LSDIR : gutilsrc.h
  • IDC_LTR : Resource.h
  • IDC_LURI : Resource.h
  • IDC_LURISTATIC : Resource.h
  • IDC_LV_LCID : resource.h , res.h
  • IDC_MACHINE : Resource.h
  • IDC_MACHINENAME : secClnt.h
  • IDC_MAGNIFY : BttnCur.h
  • IDC_MAKEOFFICE : Resource.h
  • IDC_MANUAL_SERVER_NAME : Resource.h
  • IDC_MATCHTYPE : resource.h
  • IDC_MAXTIME1 : Resource.h
  • IDC_MAXTIME2 : Resource.h
  • IDC_MAXTIME3 : Resource.h
  • IDC_MAXTIMEBASE : Resource.h
  • IDC_MDICHILD : resource.h
  • IDC_MENUBARONLY : Dialogs.h
  • IDC_MESSAGE : resource.h
  • IDC_MESSAGE_PRIORITY : Resource.h
  • IDC_MIC_MUTE : resource.h
  • IDC_MIC_VOL : resource.h
  • IDC_MINTIME1 : Resource.h
  • IDC_MINTIME2 : Resource.h
  • IDC_MINTIME3 : Resource.h
  • IDC_MINTIMEBASE : Resource.h
  • IDC_MODIFICATIONTIME : resource.h
  • IDC_MODIFICATONTIMETXT : resource.h
  • IDC_MODIFYOWNER : resource.h
  • IDC_MODIFYPERMISSION : resource.h
  • IDC_MONITOR : Resource.h
  • IDC_MOVE : resource.h , Resource.h
  • IDC_MOVE_X : Resource.h
  • IDC_MOVE_Y : Resource.h
  • IDC_MOVEMONEY : resource.h
  • IDC_MQ_PEEK_ACCESS : Resource.h
  • IDC_MQ_SEND_ACCESS : Resource.h
  • IDC_MSG_NOTIFY : Resource.h
  • IDC_MSG_OBJECTS : Resource.h
  • IDC_MSG_STATE : Resource.h
  • IDC_MSG_TRACE : Resource.h
  • IDC_MTA : resource.h
  • IDC_MUIWEB : res.h
  • IDC_MUIWEB2 : res.h
  • IDC_MULTILINGUAL : res.h
  • IDC_MYICON : Resource.h
  • IDC_NACK_REACH_QUEUE_RADIO : Resource.h
  • IDC_NACK_RECEIVE_RADIO : Resource.h
  • IDC_NAME : resource.h , Resource.h , resource.h
  • IDC_NAME_EDIT : resource.h
  • IDC_NAMESPACE : resource.h , Resource.h
  • IDC_NCOUNTRYNAME : resource.h , res.h
  • IDC_NEAR : Resource.h
  • IDC_NEARCARET_POS : HalfIME.h
  • IDC_NEG_CURRENCY : resource.h , res.h
  • IDC_NEG_NUMBER : resource.h , res.h
  • IDC_NESWARROWS : BttnCur.h
  • IDC_NEW_CONTAINER : Resource.h
  • IDC_NEW_MMF : Resource.h
  • IDC_NEW_OBJECT : Resource.h
  • IDC_NEW_PIPE : Resource.h
  • IDC_NEW_TREE : Resource.h
  • IDC_NEWUICURSORMAX : BttnCur.h
  • IDC_NEWUICURSORMIN : BttnCur.h
  • IDC_NLANGNAME : resource.h , res.h
  • IDC_NLSWEB : res.h
  • IDC_NMCH_AS : Resource.h
  • IDC_NMCH_AUDIO : Resource.h
  • IDC_NMCH_DATA : Resource.h
  • IDC_NMCH_FIRST : Resource.h
  • IDC_NMCH_FT : Resource.h
  • IDC_NMCH_LAST : Resource.h
  • IDC_NMCH_SKIPP_THIS_ONE : Resource.h
  • IDC_NO_GLYPH_INDEX : Resource.h
  • IDC_NOAUTHENTICATION : resource.h
  • IDC_NODROP : BttnCur.h
  • IDC_NOHELPCONTROLS : Resource.h
  • IDC_NOPUTCOLOR : secSvr.h
  • IDC_NOPUTUSERNAME : secSvr.h
  • IDC_NORMAL_PRIORITY_CLASS : Deb.h
  • IDC_NOTIFY1 : Resource.h
  • IDC_NOTIFY2 : Resource.h
  • IDC_NOTIFY3 : Resource.h
  • IDC_NOUI : Resource.h
  • IDC_NUMBERWRITES : Resource.h
  • IDC_NWSEARROWS : BttnCur.h
  • IDC_OBJECT_TREE : Resource.h
  • IDC_OBJECTS : secSvr.h
  • IDC_OBJECTTYPE : resource.h
  • IDC_ODBC_STOP : resource.h
  • IDC_OEM : resource.h , res.h
  • IDC_OK : resource.h , Resource.h
  • IDC_ONTOP : Resource.h
  • IDC_OPEN : gutilsrc.h , resource.h
  • IDC_OPENIME : FullIME.h , HalfIME.h
  • IDC_OPT_DOWN : wdiffrc.h
  • IDC_OPT_UP : wdiffrc.h
  • IDC_OPTIONSBUTTON : Dialogs.h
  • IDC_ORDER : resource.h
  • IDC_OSVERSION : Generic.H , StatList.h , LeakyBin.h
  • IDC_OUTPROC_MTA2MTA : Resource.h
  • IDC_OUTPROC_MTA2MTA_CANCELACT : Resource.h
  • IDC_OUTPROC_MTA2MTA_CANCELCALL : Resource.h
  • IDC_OUTPROC_MTA2STA : Resource.h
  • IDC_OUTPROC_MTA2STA_CANCELACT : Resource.h
  • IDC_OUTPROC_MTA2STA_CANCELCALL : Resource.h
  • IDC_OUTPROC_STA2MTA : Resource.h
  • IDC_OUTPROC_STA2MTA_CANCELACT : Resource.h
  • IDC_OUTPROC_STA2MTA_CANCELCALL : Resource.h
  • IDC_OUTPROC_STA2STA : Resource.h
  • IDC_OUTPROC_STA2STA_CANCELACT : Resource.h
  • IDC_OUTPROC_STA2STA_CANCELCALL : Resource.h
  • IDC_OUTPUT : resource.h
  • IDC_OUTPUTLIST : resource.h , Resource.h
  • IDC_OVERRIDE : Resource.h
  • IDC_PAGESIZE : resource.h
  • IDC_PAGESIZE_TXT : resource.h
  • IDC_PARENT : resource.h
  • IDC_PARENTPATH : resource.h
  • IDC_PARTIALSCREEN : Dialogs.h
  • IDC_PARTYLIST : Resource.h
  • IDC_PARTYSTATIC : Resource.h
  • IDC_PASSWORD : resource.h , Resource.h
  • IDC_PATH_EDIT : resource.h
  • IDC_PATHNAME_COMBO : Resource.h
  • IDC_PAUSE : Resource.h
  • IDC_PB_AUTOSIZE : Resource.h
  • IDC_PCPCRADIO : Resource.h
  • IDC_PCPHRADIO : Resource.h
  • IDC_PEOPLE_COLOR : resource.h
  • IDC_PEOPLE_GIRLS : resource.h
  • IDC_PEOPLE_MATERIAL : resource.h
  • IDC_PEOPLE_NAME : resource.h
  • IDC_PEOPLE_OWNER : resource.h
  • IDC_PEOPLE_SURFACE : resource.h
  • IDC_PERCENTAGE : Dialogs.h , Dibdll.h
  • IDC_PHONE : Resource.h
  • IDC_PHONENUMBER : Resource.h
  • IDC_PHPHRADIO : Resource.h
  • IDC_PICTURE : Resource.h
  • IDC_PICTURE_DISPLAY : resource.h
  • IDC_PINGFAILS : Resource.h
  • IDC_PINGS : Resource.h
  • IDC_PLAINTEXT : Resource.h
  • IDC_PLAINTEXT_BOLD : Resource.h
  • IDC_PLAINTEXT_CLIP : Resource.h
  • IDC_PLAINTEXT_DX : Resource.h
  • IDC_PLAINTEXT_FALLBACK : Resource.h
  • IDC_PLAINTEXT_FIT : Resource.h
  • IDC_PLAINTEXT_FONT : Resource.h
  • IDC_PLAINTEXT_HOTKEY : Resource.h
  • IDC_PLAINTEXT_ITALIC : Resource.h
  • IDC_PLAINTEXT_LINK : Resource.h
  • IDC_PLAINTEXT_PASSWORD : Resource.h
  • IDC_PLAINTEXT_SIZE : Resource.h
  • IDC_PLAINTEXT_TAB : Resource.h
  • IDC_PLAINTEXT_UNDERLINE : Resource.h
  • IDC_PLAY : resource.h , Resource.h
  • IDC_PORT : Resource.h
  • IDC_POS_CURRENCY : resource.h , res.h
  • IDC_POS_NUMBER : resource.h , res.h
  • IDC_POSITION_LABEL : Resource.h
  • IDC_PP_FILESHARESAMPLE_MAXUSERS : resource.h
  • IDC_PP_FILESHARESAMPLE_MAXUSERS_LABEL : resource.h
  • IDC_PP_FILESHARESAMPLE_PATH : resource.h
  • IDC_PP_FILESHARESAMPLE_PATH_LABEL : resource.h
  • IDC_PP_FILESHARESAMPLE_REMARK : resource.h
  • IDC_PP_FILESHARESAMPLE_REMARK_LABEL : resource.h
  • IDC_PP_FILESHARESAMPLE_SHARENAME : resource.h
  • IDC_PP_FILESHARESAMPLE_SHARENAME_LABEL : resource.h
  • IDC_PP_ICON : resource.h
  • IDC_PP_TITLE : resource.h
  • IDC_PREFER_POS : HalfIME.h
  • IDC_PREFIX_EDIT : resource.h
  • IDC_PRESENTATION : resource.h , Resource.h
  • IDC_PRINTER : Dialogs.h
  • IDC_PRINTTEXT1 : Dialogs.h , Dibdll.h
  • IDC_PRINTTEXT2 : Dialogs.h , Dibdll.h
  • IDC_PRIORITY : resource.h
  • IDC_PRIORITYTXT : resource.h
  • IDC_PROCESS : Resource.h
  • IDC_PROCESSLIST : Deb.h
  • IDC_PRODUCT_GUID_EDIT : resource.h
  • IDC_PRODUCT_NAME_EDIT : resource.h
  • IDC_PRODUCT_VERSION_EDIT : resource.h
  • IDC_PRODUCTVERSION : resource.h
  • IDC_PRODVER : Generic.H , StatList.h , LeakyBin.h
  • IDC_PROGRESS : resource.h , Resource.h
  • IDC_PROGRESS_BAR : resource.h
  • IDC_PROGRESSBAR : resource.h
  • IDC_PROGRESSINFO : resource.h
  • IDC_PROGRESSINFOTXT : resource.h
  • IDC_PROMPT : gutilsrc.h , resource.h
  • IDC_PROMPTCREDENTIAL : resource.h
  • IDC_PROPEDIT_OPTIONS : resource.h
  • IDC_PROPEDIT_TYPE : resource.h
  • IDC_PROPEDIT_VALUE : resource.h
  • IDC_PROPLIST : Resource.h
  • IDC_PROPSET : resource.h
  • IDC_PROTECTION : resource.h
  • IDC_PROVIDER : resource.h
  • IDC_PROVIDER_NAME : resource.h
  • IDC_PROXY_AUTHN : secClnt.h
  • IDC_PROXY_AUTHNLEVEL : secClnt.h
  • IDC_PROXY_AUTHZ : secClnt.h
  • IDC_PROXY_IMPLEVEL : secClnt.h
  • IDC_PROXY_PRINCIPLENAME : secClnt.h
  • IDC_PSTN : resource.h
  • IDC_PURGE : resource.h
  • IDC_PURPOSE : resource.h , res.h
  • IDC_PUT : resource.h
  • IDC_PUTEX : resource.h
  • IDC_QUERY_SESSION : Resource.h
  • IDC_QUERYVARIABLE : resource.h
  • IDC_QUEUE_LABEL : Resource.h
  • IDC_QUEUE_PATHNAME : Resource.h
  • IDC_RADIO1 : Resource.h , resource.h , Resource.h
  • IDC_RADIO2 : Resource.h , resource.h , Resource.h
  • IDC_RADIO3 : Resource.h
  • IDC_RADIO4 : Resource.h
  • IDC_RADIO_BASE : Resource.h
  • IDC_RADIO_CLSID : Resource.h
  • IDC_RADIO_COMSYNC : Resource.h
  • IDC_RADIO_DO_NOT_EXPORT_USERS : Resource.h
  • IDC_RADIO_DS : Resource.h , resource.h
  • IDC_RADIO_EXPORT_CLIENTS : Resource.h
  • IDC_RADIO_EXPORT_USERS : Resource.h
  • IDC_RADIO_EXPRESS : Resource.h , resource.h
  • IDC_RADIO_FREE : Resource.h
  • IDC_RADIO_INSTALL_WITH_USERS : Resource.h
  • IDC_RADIO_INSTALL_WITHOUT_USERS : Resource.h
  • IDC_RADIO_JNEC : Resource.h
  • IDC_RADIO_PRIVATEQUEUE : resource.h
  • IDC_RADIO_PROG_ID : Resource.h
  • IDC_RADIO_PUBLICQUEUE : resource.h
  • IDC_RADIO_RECOVERABLE : Resource.h , resource.h
  • IDC_RADIO_REFRESH : Resource.h
  • IDC_RADIO_REMOTE_COMPUTER : Resource.h
  • IDC_RADIO_ROUTER : Resource.h
  • IDC_RADIO_SETSTREAM : resource.h
  • IDC_RADIO_SETTEXT : resource.h
  • IDC_RADIO_STA : Resource.h
  • IDC_RADIO_START : Resource.h
  • IDC_RADIO_STOP : Resource.h
  • IDC_RADIO_THIS_COMPUTER : Resource.h
  • IDC_RADIO_WORKGROUP : Resource.h , resource.h
  • IDC_RCDISP1 : wdiffrc.h
  • IDC_RDN : resource.h
  • IDC_READONLY : resource.h
  • IDC_READONLY_ATTR : resource.h
  • IDC_READPERMISSION : resource.h
  • IDC_READPROP : resource.h
  • IDC_READPROP_EDIT : resource.h
  • IDC_REALTIME_PRIORITY_CLASS : Deb.h
  • IDC_RECORD : resource.h
  • IDC_RED : Resource.h
  • IDC_REDGAMMA : resource.h
  • IDC_REDGAMMASLIDER : resource.h
  • IDC_REFBLACK : resource.h
  • IDC_REFBLACKSLIDER : resource.h
  • IDC_REFIID : resource.h
  • IDC_REFRESH : Resource.h
  • IDC_REFWHITE : resource.h
  • IDC_REFWHITESLIDER : resource.h
  • IDC_REGISTER : Resource.h
  • IDC_REGPERM : resource.h
  • IDC_REGTEMP : resource.h
  • IDC_RELEASE : secClnt.h
  • IDC_REMIX : resource.h
  • IDC_REMOVE : resource.h , Resource.h
  • IDC_REMOVEPARTY : Resource.h
  • IDC_RENAME : resource.h
  • IDC_REORDER : Resource.h
  • IDC_RESERVED : resource.h
  • IDC_Resource1 : resource.h
  • IDC_RESOURCE1 : resource.h
  • IDC_Resource2 : resource.h
  • IDC_RESOURCE2 : resource.h
  • IDC_RESTRICTION1 : resource.h
  • IDC_RESTRICTION2 : resource.h
  • IDC_RESTRICTION3 : resource.h
  • IDC_RESTRICTION4 : resource.h
  • IDC_RESTRICTION5 : resource.h
  • IDC_RESTRICTION6 : resource.h
  • IDC_RESTRICTION7 : resource.h
  • IDC_RESULTLIST : resource.h
  • IDC_RESULTS : resource.h
  • IDC_RESUME : resource.h
  • IDC_RESUME2 : resource.h
  • IDC_RETAINING : resource.h
  • IDC_RIGHT : Resource.h
  • IDC_RIGHTARROW : BttnCur.h
  • IDC_ROCKET_HEIGHT : resource.h
  • IDC_ROCKET_NAME : resource.h
  • IDC_ROCKET_PAYLOAD : resource.h
  • IDC_ROCKET_STATUS : resource.h
  • IDC_ROCKET_WEIGHT : resource.h
  • IDC_ROWS : resource.h
  • IDC_RSN : Resource.h
  • IDC_RTL : Resource.h
  • IDC_RUN_SUITE : resource.h
  • IDC_S_AUTOSIZE : Resource.h
  • IDC_SAMPLERATE : resource.h
  • IDC_SAMPLETEXT : resource.h
  • IDC_SAVE_PREFERENCES : Deb.h
  • IDC_SCALE : Dialogs.h
  • IDC_SCHEMA : resource.h
  • IDC_SCHEMAPATH : resource.h
  • IDC_SCHEMAS : resource.h
  • IDC_SCPDURL : resource.h
  • IDC_SCROLLBAR : resource.h
  • IDC_SDATEFORMAT : resource.h , res.h
  • IDC_SDATESAMPLE : resource.h , res.h
  • IDC_SDIR : gutilsrc.h
  • IDC_SEALING : resource.h
  • IDC_SEARCHSCOPE : resource.h
  • IDC_SEARCHSCOPE_TXT : resource.h
  • IDC_SECURED : resource.h
  • IDC_SECURITY : Resource.h
  • IDC_SELECTPRINTER : Dialogs.h
  • IDC_SELECTTEXT : Dialogs.h
  • IDC_SEND_MESSAGE : Resource.h
  • IDC_SERVER_AUTHNLEVEL : secSvr.h
  • IDC_SERVER_CLASS : secClnt.h
  • IDC_SERVER_CONFIG_PATH_EDIT : resource.h
  • IDC_SERVER_EDIT : resource.h
  • IDC_SERVER_IMPLEVEL : secSvr.h
  • IDC_SERVER_LIST : Resource.h
  • IDC_SERVER_LIST2 : Resource.h
  • IDC_SERVER_NAME : Resource.h
  • IDC_SERVERNAME : Resource.h
  • IDC_SERVICE_CLASS_EDIT : resource.h
  • IDC_SESSION_INFO : Resource.h
  • IDC_SESSION_LIST : Resource.h
  • IDC_SET : resource.h
  • IDC_SETINFO : resource.h
  • IDC_SETSESSION : Resource.h
  • IDC_SFX : Resource.h
  • IDC_SHORT : Resource.h
  • IDC_SHOW_AS : Resource.h
  • IDC_SHOW_CHAT : Resource.h
  • IDC_SHOW_FT : Resource.h
  • IDC_SHOW_GRID_LINES : Resource.h
  • IDC_SHOW_ON_SCREEN : Resource.h
  • IDC_SHOW_SYMBOLS : Deb.h
  • IDC_SHOW_T126WB : Resource.h
  • IDC_SHOW_WB : Resource.h
  • IDC_SHOWLEVELS : Resource.h
  • IDC_SHUTDOWN_PARAMETERS : Resource.h
  • IDC_SIGNING : resource.h
  • IDC_SINGLEWINDOW : Dialogs.h
  • IDC_SIZELIMIT : resource.h
  • IDC_SIZELIMIT_TXT : resource.h
  • IDC_SKU : resource.h
  • IDC_SMALLARROWS : BttnCur.h
  • IDC_SORTON : resource.h
  • IDC_SORTON_TXT : resource.h
  • IDC_SPEAK : Resource.h
  • IDC_SPEAKERFLAGS : resource.h
  • IDC_SPEAKTEXT : Resource.h
  • IDC_SPEECHOUTPUT_LABEL : Resource.h
  • IDC_SPIN : Resource.h
  • IDC_SPIN_COUNT : resource.h
  • IDC_SPIN_OFFSET : resource.h
  • IDC_SPK_MUTE : resource.h
  • IDC_SPK_VOL : resource.h
  • IDC_SPLIT_CURSOR : resource.h
  • IDC_SPR_NAME : resource.h
  • IDC_SPR_VENDOR : resource.h
  • IDC_SQUARE : Resource.h
  • IDC_SQUAREONLY : Resource.h
  • IDC_STA : resource.h
  • IDC_START : Resource.h
  • IDC_STARTTIME : resource.h
  • IDC_STATBAR : MidiPlyr.h
  • IDC_STATE11 : Resource.h
  • IDC_STATE12 : Resource.h
  • IDC_STATE21 : Resource.h
  • IDC_STATE22 : Resource.h
  • IDC_STATE31 : Resource.h
  • IDC_STATE32 : Resource.h
  • IDC_STATIC : Generic.H , wdiffrc.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , afxres.h , Resource.h , StatList.h , LeakyBin.h , Resource.h
  • IDC_STATIC_C_LABEL : Resource.h , resource.h
  • IDC_STATIC_CHOOSE_DS : Resource.h , resource.h
  • IDC_STATIC_CHOOSE_MESSAGE : Resource.h , resource.h
  • IDC_STATIC_CHOOSE_QUEUE : resource.h
  • IDC_STATIC_CURRENTAPP : Resource.h
  • IDC_STATIC_DSFRAME : resource.h
  • IDC_STATIC_EVENTPLACEHOLDER : Resource.h
  • IDC_STATIC_ICON : resource.h
  • IDC_STATIC_MACHINE : DComDraw.h , RemClien.h
  • IDC_STATIC_PGTITLE : RESDEF.h
  • IDC_STATIC_Q_LABEL : Resource.h , resource.h
  • IDC_STATIC_RECT2 : Resource.h
  • IDC_STATIC_RECT3 : Resource.h
  • IDC_STATIC_SELECT2 : Resource.h
  • IDC_STATIC_SELECT3 : Resource.h
  • IDC_STATIC_SESSION_NAME : resource.h
  • IDC_STATIC_SESSION_URI : resource.h
  • IDC_STATIC_TYPE : Resource.h
  • IDC_STATIC_WATCHER_NAME : resource.h
  • IDC_STATIC_WATCHER_URI : resource.h
  • IDC_STATICAREACODE : Resource.h
  • IDC_STATICCALLINGCARD : Resource.h
  • IDC_STATICCANONICAL : Resource.h
  • IDC_STATICCONNECTUSING : Resource.h
  • IDC_STATICCOUNTRYCODE : Resource.h
  • IDC_STATICDIALABLE : Resource.h
  • IDC_STATICDISPLAYABLE : Resource.h
  • IDC_STATICHOWTODIAL : Resource.h
  • IDC_STATICLOCATION : Resource.h
  • IDC_STATICPHONENUMBER : Resource.h
  • IDC_STATICPHONENUMBERS : Resource.h
  • IDC_STATICTAPILINE : Resource.h
  • IDC_STATICWHERETODIAL : Resource.h
  • IDC_STATUS : wdiffrc.h , Resource.h , resource.h
  • IDC_STATUSBAR : Dialogs.h , resource.h , tsfedit.h
  • IDC_STATUSTXT : resource.h
  • IDC_STOP : resource.h , Resource.h
  • IDC_STOPBEFOREPLAY : Resource.h
  • IDC_STREAMVIEW : DfV.h
  • IDC_STRETCHTOPAGE : Dialogs.h
  • IDC_SUBMIT : resource.h
  • IDC_SUITE_STATUS : resource.h
  • IDC_SUSPEND : resource.h
  • IDC_SUSPEND2 : resource.h
  • IDC_TABLELIST : resource.h
  • IDC_TABLETOP : BttnCur.h
  • IDC_TABLETPC : resource.h
  • IDC_TABLETPC_DISABLED : resource.h
  • IDC_TABLETPC_ENABLED : resource.h
  • IDC_TALL : Resource.h
  • IDC_TAPILINE : Resource.h
  • IDC_TARGET_COMBO : Resource.h
  • IDC_TEXT : resource.h
  • IDC_TEXT1 : Dialogs.h
  • IDC_TEXTWIN : TextWIN.h
  • IDC_THIN : Resource.h
  • IDC_THREADCOUNT : Resource.h
  • IDC_THREADRUNNING : Resource.h
  • IDC_THREADS : resource.h
  • IDC_TIME_TO_BE_RECEIVED : Resource.h
  • IDC_TIME_TO_REACH_QUEUE : Resource.h
  • IDC_TIMEFORMAT : resource.h , res.h
  • IDC_TIMELIMIT : resource.h
  • IDC_TIMELIMIT_TXT : resource.h
  • IDC_TIMEOUT : resource.h , Resource.h
  • IDC_TIMEOUT_TXT : resource.h
  • IDC_TIMEOUTS : Resource.h
  • IDC_TIMESAMPLE : resource.h , res.h
  • IDC_TINT : resource.h
  • IDC_TINTSLIDER : resource.h
  • IDC_TIP11 : Resource.h
  • IDC_TIP12 : Resource.h
  • IDC_TIP21 : Resource.h
  • IDC_TIP22 : Resource.h
  • IDC_TIP31 : Resource.h
  • IDC_TIP32 : Resource.h
  • IDC_TITLE : Dialogs.h
  • IDC_TITLE1 : Dialogs.h
  • IDC_TITLE2 : Dialogs.h
  • IDC_TO : resource.h
  • IDC_TOOLBAR : MidiPlyr.h , Resource.h
  • IDC_TOPMOST : Resource.h
  • IDC_TOTAL : resource.h
  • IDC_TOTYPE : resource.h
  • IDC_TRADEMARK : Generic.H , StatList.h , LeakyBin.h
  • IDC_TRANSACTION : resource.h
  • IDC_TRANSFERRATE : resource.h
  • IDC_TRANSFERRATETXT : resource.h
  • IDC_TREE : resource.h
  • IDC_TREEVIEW : resource.h , enumdesk.h
  • IDC_TRIANGLE : Resource.h
  • IDC_TRIES : Resource.h
  • IDC_TSF : resource.h
  • IDC_TUNE : Resource.h
  • IDC_TYPE : resource.h
  • IDC_TYPENAME : resource.h
  • IDC_UI_APP_SHARE : Resource.h
  • IDC_UI_CALL : Resource.h
  • IDC_UI_FT : Resource.h
  • IDC_UI_JOIN : Resource.h
  • IDC_UNINSTALL : Resource.h
  • IDC_UP : Resource.h
  • IDC_UPDATE : resource.h , Resource.h
  • IDC_UPDATERULE : resource.h
  • IDC_UPLOADREPLY_CHECKBOX : resource.h
  • IDC_URL1 : resource.h
  • IDC_URL2 : resource.h
  • IDC_URLs : resource.h
  • IDC_USAGE_TEXT : wdiffrc.h
  • IDC_USE : resource.h
  • IDC_USEDIALINGRULES : Resource.h
  • IDC_USEPING : Resource.h
  • IDC_USER1 : Resource.h
  • IDC_USER_EDIT : resource.h
  • IDC_USERID : Resource.h
  • IDC_USERLIST : Resource.h
  • IDC_USERNAME : secClnt.h , secSvr.h , resource.h , Resource.h
  • IDC_USERNAME_TXT : resource.h
  • IDC_VALIDBITS : resource.h
  • IDC_VALUELIST : resource.h
  • IDC_VARIABLENAME : resource.h
  • IDC_VARROWS : BttnCur.h
  • IDC_VENDOR_GUID_EDIT : resource.h
  • IDC_VENDOR_NAME_EDIT : resource.h
  • IDC_VERBOSE : Deb.h
  • IDC_VERSION : Dialogs.h , Resource.h
  • IDC_VERSION_GUIO_EDIT : resource.h
  • IDC_VERT : Resource.h
  • IDC_VIEW : resource.h
  • IDC_VIEW_NEXT : resource.h
  • IDC_VIEW_PREV : resource.h
  • IDC_VIEWSCPD : resource.h
  • IDC_VIRTUAL_CHANNEL : Resource.h
  • IDC_VIRTUALDIR : resource.h
  • IDC_VISIBLE : Resource.h
  • IDC_VRECV : Resource.h
  • IDC_VRECVS : Resource.h
  • IDC_VRECVSTATIC : Resource.h
  • IDC_VSEND : Resource.h
  • IDC_VSENDS : Resource.h
  • IDC_VSENDSTATIC : Resource.h
  • IDC_VSIZEBAR : BttnCur.h
  • IDC_VSPLITBAR : BttnCur.h
  • IDC_WARNING : Resource.h
  • IDC_WIDE : Resource.h
  • IDC_WIDTH : Resource.h
  • IDC_WINDOW : Resource.h
  • IDC_WLXLOGGEDOUTSAS_DOMAIN : GinaDlg.c
  • IDC_WLXLOGGEDOUTSAS_PASSWORD : GinaDlg.c
  • IDC_WLXLOGGEDOUTSAS_USERNAME : GinaDlg.c
  • IDC_WLXWKSTALOCKEDSAS_DOMAIN : GinaDlg.c
  • IDC_WRITEPROP : resource.h
  • IDC_WRITEPROP_EDIT : resource.h
  • IDC_X224 : resource.h
  • IDC_X_LABEL : Resource.h
  • IDC_XACTTC : resource.h
  • IDC_XAXIS : Dialogs.h
  • IDC_XTEXT : Dialogs.h
  • IDC_Y_LABEL : Resource.h
  • IDC_YAXIS : Dialogs.h
  • IDC_YTEXT : Dialogs.h
  • IDCANCEL : winres.h
  • idcAttrib : msiloc.cpp
  • IDCB_LOADBG : resource.h
  • IDCB_LOADFG : resource.h
  • IDCC_FILLCOLOR : resource.h
  • IDCC_FOREGROUND : resource.h
  • IDCE_BGA : resource.h
  • IDCE_BGB : resource.h
  • IDCE_BGBOUNDSX : resource.h
  • IDCE_BGBOUNDSY : resource.h
  • IDCE_BGG : resource.h
  • IDCE_BGR : resource.h
  • IDCE_BGSURFACE : resource.h
  • IDCE_FGSURFACE : resource.h
  • IDCE_FGTILEX : resource.h
  • IDCE_FGTILEY : resource.h
  • IDCE_OPACITY : resource.h
  • IDCHANGE : Resource.h
  • idcHt : msiloc.cpp
  • idcName : msiloc.cpp
  • IDCOLORS_POS : Menu.h
  • IDCOMBO_AXIS : resource.h
  • IDCR_BOUNDS : resource.h
  • IDCR_FGPLACE : resource.h
  • IDCR_FGTILE : resource.h
  • idcTitle : msiloc.cpp
  • IDCV_ACTIVATEAS : OleStd.h
  • IDCV_ACTIVATELIST : OleStd.h
  • IDCV_CHANGEICON : OleStd.h
  • IDCV_CONVERTLIST : OleStd.h
  • IDCV_CONVERTTO : OleStd.h
  • IDCV_DISPLAYASICON : OleStd.h
  • IDCV_GRPRESULT : OleStd.h
  • IDCV_ICON : OleStd.h
  • IDCV_ICONLABEL1 : OleStd.h
  • IDCV_ICONLABEL2 : OleStd.h
  • IDCV_OBJECTTYPE : OleStd.h
  • IDCV_RESULTTEXT : OleStd.h
  • IDCV_STXCONVERTTO : OleStd.h
  • IDCV_STXCURTYPE : OleStd.h
  • idcWd : msiloc.cpp
  • idcX : msiloc.cpp
  • idcY : msiloc.cpp
  • IDD : StdAfx.h
  • IDD_1 : WinCap.h
  • IDD_13 : WxForm.h
  • IDD_23 : WxForm.h
  • IDD_24 : WinCap.h
  • IDD_33 : WxForm.h
  • IDD_4 : WinCap.h
  • IDD_8 : WinCap.h
  • IDD_ABOUT : Resource.h , resource.h , Resource.h
  • IDD_ABOUT_DIALOG : Resource.h , resource.h
  • IDD_ABOUTBOX : Resource.h , ComObjI.h , Server.h , DllSkelI.h , Server.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h
  • IDD_ADDCOLUMN : resource.h
  • IDD_ADDCONSTRAINTDESC : resource.h
  • IDD_ADDDEVICE_DLG : resource.h
  • IDD_ADDFOLDER_DLG : resource.h
  • IDD_ADDFORMATDLG : Resource.h
  • IDD_ADDVFILE_DLG : resource.h
  • IDD_ADQI_DIALOG : resource.h
  • IDD_ADVCGEN_DIALOG : resource.h
  • IDD_AGGREGATION : resource.h
  • IDD_AICON : Resource.h
  • IDD_ALTERCOLUMN : resource.h
  • IDD_ALTERINDEX : resource.h
  • IDD_ALTERTABLE : resource.h
  • IDD_APP32 : Resource.h
  • IDD_APP_UTILITY : Resource.h
  • IDD_ATEXTCOPYRIGHT : Resource.h
  • IDD_ATEXTFREEMEM : Resource.h
  • IDD_ATEXTRESOURCE : Resource.h
  • IDD_ATEXTTITLE : Resource.h
  • IDD_ATEXTVERSION : Resource.h
  • IDD_ATEXTWINMODE : Resource.h
  • IDD_ATTRIBUTES : wdiffrc.h
  • IDD_AUDIO : Resource.h
  • IDD_AUTOCOPY : wdiffrc.h
  • IDD_BANKDLG : resource.h
  • IDD_BASE_DIALOG : resource.h
  • IDD_BINDRESOURCE : resource.h
  • IDD_BLRPLATE_CONFIG_DIALOG : resrc1.h
  • IDD_BOTHREMOTE : wdiffrc.h
  • IDD_BPP : WinCap.h
  • IDD_BROWSE_ENUM : resource.h
  • IDD_BUTTONS : Resource.h
  • IDD_CALL : Resource.h
  • IDD_CALL_CONF : Resource.h
  • IDD_CALLFAILED : Resource.h
  • IDD_CANCEL_DIALOG : Resource.h
  • IDD_CANCONVERT : resource.h
  • IDD_CAP : Resource.h
  • IDD_CAPMFC_DIALOG : Resource.h
  • IDD_CFTEXT : Resource.h
  • IDD_CHANGE_PASSWORD_DIALOG : GinaDlg.c
  • IDD_CHOOSER_CHOOSE_MACHINE : resource.h
  • IDD_CLIENT_DIALOG : Resource.h
  • IDD_CLNTEDIT : Client32.h
  • IDD_CLOSE_QUEUE_DIALOG : Resource.h
  • IDD_CMDLINECONSUMER_DIALOG : Resource.h
  • IDD_COLOR_DIALOG : Resource.h
  • IDD_COMBOBOXES : Resource.h
  • IDD_COMDLG32 : Resource.h
  • IDD_COMMANDPERSIST : resource.h
  • IDD_COMSPYPROPPAGE : Resource.h
  • IDD_CONFERENCE : Resource.h
  • IDD_CONFIGDIALOG : Resource.h
  • IDD_CONFIGUREEVENTSDLG : Resource.h
  • IDD_CONNECT : Resource.h
  • IDD_CONNECTUSING : Resource.h
  • IDD_CONTEXTSAMPLEPROPPAGE : resource.h
  • IDD_CREATE_QUEUE_DIALOG : Resource.h
  • IDD_CREATEACCESSOR : resource.h
  • IDD_CREATEINDEX : resource.h
  • IDD_CREATETABLE : resource.h
  • IDD_CUERRORTEXT : Resource.h
  • IDD_CULISTADDRESS : Resource.h
  • IDD_CULISTLINE : Resource.h
  • IDD_CUPROPERTIES : Resource.h
  • IDD_CUSIMPLETAPICHKBOX : Resource.h
  • IDD_CUSTOMDIALDLG : resource.h
  • IDD_CUSTOMDRAWBUTTONDLG_DIALOG : Resource.h
  • IDD_CUSTOMENTRYDLG : resource.h
  • IDD_CUTEXTADDRESS : Resource.h
  • IDD_CUTEXTLINE : Resource.h
  • IDD_DATA_TYPES : resource.h
  • IDD_DATAINIT_GETDATASOURCE : resource.h
  • IDD_DATASOURCEADMIN_CREATEDATASOURCE : resource.h
  • IDD_DBUTTON0 : Resource.h
  • IDD_DBUTTON1 : Resource.h
  • IDD_DBUTTON2 : Resource.h
  • IDD_DBUTTON3 : Resource.h
  • IDD_DBUTTON4 : Resource.h
  • IDD_DBUTTON5 : Resource.h
  • IDD_DBUTTON6 : Resource.h
  • IDD_DBUTTON7 : Resource.h
  • IDD_DBUTTON8 : Resource.h
  • IDD_DBUTTON9 : Resource.h
  • IDD_DBUTTONPOUND : Resource.h
  • IDD_DBUTTONSTAR : Resource.h
  • IDD_DCOMBO : Resource.h
  • IDD_DDIAL : Resource.h
  • IDD_DELETE_QUEUE_DIALOG : Resource.h
  • IDD_DELETEOBJECT : resource.h
  • IDD_DEVICEX : WxForm.h
  • IDD_DEVICEY : WxForm.h
  • IDD_DEVPROP_DIALOG : resource.h
  • IDD_DGNAMETEXT : Resource.h
  • IDD_DGNUMBER : Resource.h
  • IDD_DGNUMBERTEXT : Resource.h
  • IDD_DIALER : Resource.h
  • IDD_DIALING : Resource.h
  • IDD_DIALOG : Resource.h , resource.h , Resource.h , resource.h
  • IDD_DIALOG1 : resource.h , Resource.h , resource.h , Resource.h
  • IDD_DIALOG2 : resource.h , Resource.h
  • IDD_DIALOG3 : Resource.h
  • IDD_DIALOG4 : Resource.h
  • IDD_DIALOG7 : Resource.h
  • IDD_DIALOG_ADDRESS : resource.h
  • IDD_DIALOG_ADDRESS_NAME : resource.h
  • IDD_DIALOG_AUTH : resource.h
  • IDD_DIALOG_LOGON : resource.h
  • IDD_DIALOG_MAIN : Resource.h
  • IDD_DIALOG_SESSION : resource.h
  • IDD_DIALOG_WATCHER : resource.h
  • IDD_DIFFER : wdiffrc.h
  • IDD_DIR1 : wdiffrc.h
  • IDD_DIR2 : wdiffrc.h
  • IDD_DISDRAW_DIALOG : Resource.h , resource.h
  • IDD_DNUMTODIAL : Resource.h
  • IDD_DRECTSEPARATOR : Resource.h
  • IDD_DROPCOLUMN : resource.h
  • IDD_DROPCONSTRAINT : resource.h
  • IDD_DROPINDEX : resource.h
  • IDD_DROPTABLE : resource.h
  • IDD_DS : resource.h
  • IDD_DSL_ADVANCED : resource.h
  • IDD_DSL_CONNECTION : resource.h
  • IDD_DSPEEDDIAL1 : Resource.h
  • IDD_DSPEEDDIAL2 : Resource.h
  • IDD_DSPEEDDIAL3 : Resource.h
  • IDD_DSPEEDDIAL4 : Resource.h
  • IDD_DSPEEDDIAL5 : Resource.h
  • IDD_DSPEEDDIAL6 : Resource.h
  • IDD_DSPEEDDIAL7 : Resource.h
  • IDD_DSPEEDDIAL8 : Resource.h
  • IDD_DSPEEDDIALGRP : Resource.h
  • IDD_DSPEEDDIALTEXT1 : Resource.h
  • IDD_DSPEEDDIALTEXT2 : Resource.h
  • IDD_DSPEEDDIALTEXT3 : Resource.h
  • IDD_DSPEEDDIALTEXT4 : Resource.h
  • IDD_DSPEEDDIALTEXT5 : Resource.h
  • IDD_DSPEEDDIALTEXT6 : Resource.h
  • IDD_DSPEEDDIALTEXT7 : Resource.h
  • IDD_DSPEEDDIALTEXT8 : Resource.h
  • IDD_DST : resource.h
  • IDD_EDITREAD : Client32.h
  • IDD_EDITWRITE : Client32.h
  • IDD_EDX : WxForm.h
  • IDD_EDY : WxForm.h
  • IDD_EJECT : Resource.h
  • IDD_EM11 : WxForm.h
  • IDD_EM12 : WxForm.h
  • IDD_EM21 : WxForm.h
  • IDD_EM22 : WxForm.h
  • IDD_ERRORRECORDS : resource.h
  • IDD_EVENTSINK_DIALOG : Resource.h
  • IDD_EXECUTE : resource.h
  • IDD_EXPORT_APPLICATION : Resource.h
  • IDD_EXTRACTDLG : Resource.h
  • IDD_FASTSCAN : wdiffrc.h
  • IDD_FAX : Resource.h
  • IDD_FILE : wdiffrc.h
  • IDD_FILEOPEN : OleStd.h
  • IDD_FILETYPE : WinCap.h
  • IDD_FILETYPEGROUP : WinCap.h
  • IDD_FIND : wdiffrc.h
  • IDD_FINDNEXTROW : resource.h
  • IDD_FROM_INFO : resource.h
  • IDD_FROMGROUP : wdiffrc.h
  • IDD_FROMLEFT : wdiffrc.h
  • IDD_FROMRIGHT : wdiffrc.h
  • IDD_FULLCONNECT_OPTIONS : resource.h
  • IDD_FULLCONNECT_PROPERTIES : resource.h
  • IDD_FULLCONNECT_PROVIDER : resource.h
  • IDD_FULLCONNECT_SECURITY : resource.h
  • IDD_GAKPAGE : Resource.h
  • IDD_GENERICUCP_DIALOG : resource.h
  • IDD_GETAXISINFO : resource.h
  • IDD_GETAXISROWSET : resource.h
  • IDD_GETCOLUMNSROWSET : resource.h
  • IDD_GETINFOEX : resource.h
  • IDD_GETLISTVIEW : resource.h
  • IDD_GETNEXTROWS : resource.h
  • IDD_GETREFERENCEDROWSET : resource.h
  • IDD_GETSOURCESROWSET : resource.h
  • IDD_GOTOLINE : wdiffrc.h
  • IDD_GUTILS_FILE : gutilsrc.h
  • IDD_GUTILS_LABEL : gutilsrc.h
  • IDD_IADS : resource.h
  • IDD_IADSCONTAINER : resource.h
  • IDD_IADSOPENDSOBJECT : resource.h
  • IDD_ICON : wdiffrc.h
  • IDD_IDENTICAL : wdiffrc.h
  • IDD_IDENTITY : WxForm.h
  • IDD_IDIRECTORYOBJECT : resource.h
  • IDD_IDIRECTORYSEARCH : resource.h
  • IDD_IGNOREMARK : wdiffrc.h
  • IDD_IMP_DRAW_DIALOG : Resource.h
  • IDD_IMPORT_COMPONENT : Resource.h
  • IDD_INDEX_INFO : resource.h
  • IDD_INSTALL_APPLICATION : Resource.h
  • IDD_INSTALL_COMPONENT : Resource.h
  • IDD_INTERFACE : resource.h
  • IDD_INUSE : Resource.h
  • IDD_ISCO_COPY : resource.h
  • IDD_ISCO_DELETE : resource.h
  • IDD_ITEMCONFIGDIALOG : Resource.h
  • IDD_ITEMDATADLG : Resource.h
  • IDD_IUICON : Resource.h
  • IDD_IUTEXT1 : Resource.h
  • IDD_IUTEXT2 : Resource.h
  • IDD_LAB1 : wdiffrc.h
  • IDD_LAB2 : wdiffrc.h
  • IDD_LAB3 : wdiffrc.h
  • IDD_LABEL : wdiffrc.h
  • IDD_LARGEINTEGER : resource.h
  • IDD_LAUNCH : Resource.h
  • IDD_LEFT : wdiffrc.h
  • IDD_LOAD_REMOTE : DComDraw.h
  • IDD_LOADING_MSG : ReadTut.h
  • IDD_LOCATE_DIALOG : Resource.h
  • IDD_LOGFILE : wdiffrc.h
  • IDD_LOGIN : Resource.h , resource.h
  • IDD_LOGON : Resource.h
  • IDD_LOGONOFF : Resource.h
  • IDD_LOGTEXT : wdiffrc.h
  • IDD_MAIN : Resource.h
  • IDD_MAIN_DIALOG : Resource.h
  • IDD_MAINDLG : Resource.h
  • IDD_MAINUI : Resource.h
  • IDD_MDICHILD : resource.h
  • IDD_MMCCONTROL : resource.h
  • IDD_MOVE : resource.h
  • IDD_MSPERSIST : resource.h
  • IDD_MULTIPLERESULTS : resource.h
  • IDD_NEWDIALOG : Resource.h
  • IDD_OFFICEEQUIP : resource.h
  • IDD_OPEN_QUEUE_DIALOG : Resource.h
  • IDD_OPENROWSET : resource.h
  • IDD_OPTIONS : resource.h , Resource.h
  • IDD_OPTIONS_ACCESSOR : resource.h
  • IDD_OPTIONS_COMMAND : resource.h
  • IDD_OPTIONS_ERRORS : resource.h
  • IDD_OPTIONS_NOTIFICATIONS : resource.h
  • IDD_OPTIONS_ROWSET : resource.h
  • IDD_PAGE_PROPS : RESDEF.h
  • IDD_PARAMEXECUTE : resource.h
  • IDD_PASSWORD : wdiffrc.h
  • IDD_PERMEVENTS_DIALOG : Resource.h
  • IDD_PLUGTRANSPORT : resource.h
  • IDD_PM : WinCap.h
  • IDD_PP_CLIPBOOKSERVER_PARAMETERS : resource.h
  • IDD_PP_FILESHARESAMPLE_PARAMETERS : resource.h
  • IDD_PPAGE0 : resource.h
  • IDD_PROCESS : Resource.h
  • IDD_PROGRESS : resource.h , Resource.h
  • IDD_PROMPTDATASOURCE : resource.h
  • IDD_PROMPTFILENAME : resource.h
  • IDD_PROP : resource.h
  • IDD_PROPERTYLIST : resource.h
  • IDD_PROPPAGE_LARGE : resource.h
  • IDD_PROPPAGE_PEOPLE : resource.h
  • IDD_PROVIDERINFO : resource.h
  • IDD_QUERY_SESSION : Resource.h
  • IDD_RECEIVE_MESSAGE_DIALOG : Resource.h
  • IDD_RECURSIVE : wdiffrc.h
  • IDD_REMOTE_INFO : RemClien.h
  • IDD_RENAME : resource.h
  • IDD_REORDER : Resource.h
  • IDD_RGB : WinCap.h
  • IDD_RIGHT : wdiffrc.h
  • IDD_RLE4 : WinCap.h
  • IDD_RLE8 : WinCap.h
  • IDD_ROW_OPEN : resource.h
  • IDD_ROWCHANGE : resource.h
  • IDD_RTCINCOMING_DIALOG : Resource.h
  • IDD_RTCOUTGOING_DIALOG : Resource.h
  • IDD_SAMPLE_DIALOG : resource.h
  • IDD_SCHEMAROWSET : resource.h
  • IDD_SCHEMATREEVIEW : resource.h
  • IDD_SCP_BINDING_INFO_PAGE : resource.h
  • IDD_SCP_GENERAL_PAGE : resource.h
  • IDD_SCP_KEYWORDS_PAGE : resource.h
  • IDD_SCP_MENU_DIALOG : resource.h
  • IDD_SCP_PAGE_BINDING_INFO : resource.h
  • IDD_SCP_PAGE_GENERAL : resource.h
  • IDD_SCP_PAGE_KEYWORDS : resource.h
  • IDD_SCREENX : WxForm.h
  • IDD_SCREENY : WxForm.h
  • IDD_SD1 : Resource.h
  • IDD_SD1EDITNAME : Resource.h
  • IDD_SD1EDITNUMBER : Resource.h
  • IDD_SD1RECTSEPARATOR : Resource.h
  • IDD_SD1SPEEDDIAL1 : Resource.h
  • IDD_SD1SPEEDDIAL2 : Resource.h
  • IDD_SD1SPEEDDIAL3 : Resource.h
  • IDD_SD1SPEEDDIAL4 : Resource.h
  • IDD_SD1SPEEDDIAL5 : Resource.h
  • IDD_SD1SPEEDDIAL6 : Resource.h
  • IDD_SD1SPEEDDIAL7 : Resource.h
  • IDD_SD1SPEEDDIAL8 : Resource.h
  • IDD_SD1SPEEDDIALTEXT1 : Resource.h
  • IDD_SD1SPEEDDIALTEXT2 : Resource.h
  • IDD_SD1SPEEDDIALTEXT3 : Resource.h
  • IDD_SD1SPEEDDIALTEXT4 : Resource.h
  • IDD_SD1SPEEDDIALTEXT5 : Resource.h
  • IDD_SD1SPEEDDIALTEXT6 : Resource.h
  • IDD_SD1SPEEDDIALTEXT7 : Resource.h
  • IDD_SD1SPEEDDIALTEXT8 : Resource.h
  • IDD_SD1TEXTCHOOSE : Resource.h
  • IDD_SD1TEXTENTER : Resource.h
  • IDD_SD1TEXTNAME : Resource.h
  • IDD_SD1TEXTNUMBER : Resource.h
  • IDD_SD2 : Resource.h
  • IDD_SD2EDITNAME : Resource.h
  • IDD_SD2EDITNUMBER : Resource.h
  • IDD_SD2SAVEANDDIAL : Resource.h
  • IDD_SD2TEXTENTER : Resource.h
  • IDD_SD2TEXTNAME : Resource.h
  • IDD_SD2TEXTNUMBER : Resource.h
  • IDD_SECCLNT : secClnt.h
  • IDD_SECSVR : secSvr.h
  • IDD_SECURITY : resource.h
  • IDD_SELECT : Resource.h
  • IDD_SELECTPRINTER : resource.h
  • IDD_SEND_MESSAGE : Resource.h
  • IDD_SEND_MESSAGE_DIALOG : Resource.h
  • IDD_SENDFILE : Resource.h
  • IDD_SERVER : wdiffrc.h
  • IDD_SERVER_PROCESS : Resource.h
  • IDD_SERVERDLG : Resource.h
  • IDD_SESSION : Resource.h
  • IDD_SETCOMMANDSTREAM : resource.h
  • IDD_SETCOMMANDTEXT : resource.h
  • IDD_SETDISP : Resource.h
  • IDD_SETPARAMETERINFO : resource.h
  • IDD_SETPROPERTIES : resource.h
  • IDD_SETSESSION : Resource.h
  • IDD_SETVALUE : resource.h
  • IDD_SETXFORM : WxForm.h
  • IDD_SHARE : Resource.h
  • IDD_SHOW_TYPES : resource.h
  • IDD_SHOWLOCAL : Resource.h
  • IDD_SHUTDOWN : Resource.h
  • IDD_SIMPLE_LISTBOX : resource.h
  • IDD_SRC : resource.h
  • IDD_STREAM_VIEWER : resource.h
  • IDD_SUCCESS_MSG : register.h
  • IDD_SUMS : wdiffrc.h
  • IDD_SVREDIT : Client32.h
  • IDD_SWITCH : Resource.h
  • IDD_TESTDLG : Resource.h
  • IDD_TO_INFO : resource.h
  • IDD_TRANSACTION_ABORT : resource.h
  • IDD_TRANSACTION_COMMIT : resource.h
  • IDD_TRANSACTION_GETINFO : resource.h
  • IDD_TRANSACTION_JOIN : resource.h
  • IDD_TRANSACTION_RELEASE : resource.h
  • IDD_TRANSACTION_SETOPTIONS : resource.h
  • IDD_TRANSACTION_START : resource.h
  • IDD_UPLOADSAMPLECLIENTDIALOG : resource.h
  • IDD_URLMAPPING : resource.h
  • IDD_USAGE : wdiffrc.h
  • IDD_USER_PAGE_EXT : resource.h
  • IDD_USERINFO : resource.h
  • IDD_UTILITIES : Resource.h
  • IDD_VCEXPLORE : Resource.h
  • IDD_VCEXPLORE_DIALOG : Resource.h
  • IDD_VERFIRST : GLOBALS.h , Globals.h
  • IDD_VERIFYRES : Resource.h
  • IDD_VERLAST : GLOBALS.h , Globals.h
  • IDD_VERSION : wdiffrc.h
  • IDD_VFILE_PPAGE0 : resource.h
  • IDD_WAIT_DIALOG : Resource.h
  • IDD_WAIT_SYSTEM_EVENT : Resource.h
  • IDD_WBEMCLIENT_DIALOG : Resource.h
  • IDD_WBEMPERMEVENTS_DIALOG : Resource.h
  • IDD_WBEMSAMP_DIALOG : resource.h
  • IDD_WBEMSAMPLE_DIALOG : resource.h
  • IDD_WIZ_CLIPBOOKSERVER_PARAMETERS : resource.h
  • IDD_WIZ_FILESHARESAMPLE_PARAMETERS : resource.h
  • IDD_WLXDIAPLAYSASNOTICE_DIALOG : GinaDlg.c
  • IDD_WLXLOGGEDONSAS_DIALOG : GinaDlg.c
  • IDD_WLXLOGGEDOUTSAS_DIALOG : GinaDlg.c
  • IDD_WLXWKSTALOCKEDSAS_DIALOG : GinaDlg.c
  • IDD_WORLDX : WxForm.h
  • IDD_WORLDY : WxForm.h
  • IDD_XMLTREE_DIALOG : resource.h
  • IDE_ACL : Monkey.h
  • IDE_ADDR : Resource.h
  • IDE_APPLICATION : Resource.h
  • IDE_BLOB_SIZE : resource.h
  • IDE_BREAKID : resource.h
  • IDE_CLASS : Monkey.h
  • IDE_COLNAME : resource.h
  • IDE_COLUMN : resource.h
  • IDE_COLUMNID : resource.h
  • IDE_COMMANDID : resource.h
  • IDE_COMMANDLINE : Resource.h
  • IDE_COMMANDTEXT : resource.h
  • IDE_CONFERENCE : Resource.h
  • IDE_CONFERENCE_NAME : Resource.h
  • IDE_CONSNAME : resource.h
  • IDE_CONSTEXT : resource.h
  • IDE_CONSTRAINTID : resource.h
  • IDE_COUNT : resource.h
  • IDE_CVALUES : Monkey.h
  • IDE_DATA : resource.h , Resource.h
  • IDE_DATASOURCE : resource.h
  • IDE_DESCRIPTION : resource.h
  • IDE_DEST : Resource.h
  • IDE_DIRECTORY : resource.h , Resource.h
  • IDE_FILENAME : resource.h , Resource.h
  • IDE_FKCOLNAME : resource.h
  • IDE_FROM_TABLE : resource.h
  • IDE_HCONF : Resource.h
  • IDE_INDEXID : resource.h
  • IDE_INITSTRING : resource.h
  • IDE_INTEGRATED : resource.h
  • IDE_ISCO_DESTINATION : resource.h
  • IDE_ISCO_SOURCE : resource.h
  • IDE_LASTWRT : Monkey.h
  • IDE_LEVEL : Resource.h
  • IDE_LOCATION : resource.h
  • IDE_MAXLENGTH : resource.h
  • IDE_NAME : Resource.h , Monkey.h
  • IDE_NewIndexID : resource.h
  • IDE_NewTableID : resource.h
  • IDE_OFFSET : resource.h
  • IDE_ORDINAL : resource.h
  • IDE_PARAM_SETS : resource.h
  • IDE_PASSWORD : resource.h , Resource.h
  • IDE_PATH : Resource.h
  • IDE_PRECISION : resource.h
  • IDE_PROPEDIT_NAME : resource.h
  • IDE_PROPERTY_HELP : resource.h
  • IDE_PROPINFO_FLAGS : resource.h
  • IDE_PROPINFO_VALUE : resource.h
  • IDE_PROVSTRING : resource.h
  • IDE_REFERENCEDTABLE : resource.h
  • IDE_REMOTESERVER : resource.h
  • IDE_RESTRICTION1 : resource.h
  • IDE_RESTRICTION2 : resource.h
  • IDE_RESTRICTION3 : resource.h
  • IDE_RESTRICTION4 : resource.h
  • IDE_RESTRICTION5 : resource.h
  • IDE_RESTRICTION6 : resource.h
  • IDE_RESTRICTION7 : resource.h
  • IDE_ROW_COUNT : resource.h
  • IDE_ROWSTOFETCH : resource.h
  • IDE_SCALE : resource.h
  • IDE_SELECTED : Resource.h
  • IDE_SEND : Resource.h
  • IDE_SIZE : resource.h
  • IDE_TABLEID : resource.h
  • IDE_TEXTOUT : Monkey.h
  • IDE_TIMEOUT : resource.h
  • IDE_TITLEINDEX : Monkey.h
  • IDE_TO_TABLE : resource.h
  • IDE_URL : resource.h
  • IDE_USER_NAME : Resource.h
  • IDE_USERID : resource.h , Resource.h
  • IDE_VALUE : resource.h
  • IDE_VALUE1 : Monkey.h
  • IDE_VALUE2 : Monkey.h
  • IDE_VALUE3 : Monkey.h
  • Identity : comspyctl.idl
  • IDFILE_POS : Menu.h
  • IDH_DIALER_BUTTONS : Dialhelp.h
  • IDH_DIALER_CHANGE_DIAL_HELPER : Dialhelp.h
  • IDH_DIALER_CHANGE_DIGITS : Dialhelp.h
  • IDH_DIALER_CHANGE_OPTIONS : Dialhelp.h
  • IDH_DIALER_CHANGE_REDIAL_BUTTON : Dialhelp.h
  • IDH_DIALER_DIAL_BUTTON : Dialhelp.h
  • IDH_DIALER_DIAL_KEYPAD : Dialhelp.h
  • IDH_DIALER_DIAL_NUMBER : Dialhelp.h
  • IDH_DIALER_DIAL_SPEED_CHOOSE : Dialhelp.h
  • IDH_DIALER_DIALING_LOGNAME : Dialhelp.h
  • IDH_DIALER_DIALING_STATUS : Dialhelp.h
  • IDH_DIALER_HANGUP : Dialhelp.h
  • IDH_DIALER_LOG : Dialhelp.h
  • IDH_DIALER_LOG_IN : Dialhelp.h
  • IDH_DIALER_LOG_OUT : Dialhelp.h
  • IDH_DIALER_OPTIONS_ADDRESS : Dialhelp.h
  • IDH_DIALER_OPTIONS_LINE : Dialhelp.h
  • IDH_DIALER_OPTIONS_NONVOICE : Dialhelp.h
  • IDH_DIALER_OPTIONS_PROPERTIES : Dialhelp.h
  • IDH_DIALER_OPTIONS_VOICE : Dialhelp.h
  • IDH_DIALER_PAUSE_CONTINUE : Dialhelp.h
  • IDH_DIALER_SPEED_CHOOSE : Dialhelp.h
  • IDH_DIALER_SPEED_NAME : Dialhelp.h
  • IDH_DIALER_SPEED_NUMBER : Dialhelp.h
  • IDH_DIALER_SPEED_SAVE : Dialhelp.h
  • IDH_DIALER_SPEED_SAVE_DIAL : Dialhelp.h
  • IDHELP_POS : Menu.h
  • IDI_ABOUTICON : resource.h
  • IDI_APP : resource.h , Resource.h
  • IDI_APP32 : Resource.h
  • IDI_APP_ICON : Resource.h , resource.h
  • IDI_APPICON : Resource.h
  • IDI_BACKCOLOR : Resource.h
  • IDI_CATALOG : resource.h
  • IDI_CHECK : resource.h
  • IDI_COLUMN : resource.h
  • IDI_COLUMNLONG : resource.h
  • IDI_COLUMNREAD : resource.h
  • IDI_CONNECT : Resource.h
  • IDI_DIALER : Resource.h
  • IDI_DISK : Resource.h
  • IDI_DXS3 : resource.h
  • IDI_DXTICON : resource.h
  • IDI_EVENTSINK : Resource.h
  • IDI_EXPORT : Resource.h
  • IDI_FOLDER : resource.h
  • IDI_ICON : resource.h , Resource.h
  • IDI_ICON1 : resource.h , Resource.h , resource.h , Resource.h
  • IDI_ICON2 : Resource.h
  • IDI_ICON3 : Resource.h
  • IDI_ICON4 : Resource.h
  • IDI_ICON5 : Resource.h
  • IDI_ICON6 : Resource.h
  • IDI_IMPORT : Resource.h
  • IDI_INDEX : resource.h
  • IDI_INK_ICON : resource.h
  • IDI_INSTALL : Resource.h
  • IDI_INSTALLER : resource.h
  • IDI_INSTCODC : Resource.h
  • IDI_LARGE : Resource.h
  • IDI_LINEBUSY : Resource.h
  • IDI_LOGO : Resource.h
  • IDI_MAIN : Resource.h
  • IDI_MAIN_ICON : resource.h
  • IDI_MAINICON : Resource.h , resource.h , Resource.h
  • IDI_MSDEV : Resource.h
  • IDI_OPENFOLDER : resource.h
  • IDI_OVERLAY_ICON : Resource.h
  • IDI_PBGN_GIF : resource.h
  • IDI_PRIMARYKEY : resource.h
  • IDI_PSI_LANDBASED : resource.h
  • IDI_PSI_ROCKET : resource.h
  • IDI_SAMPLEHANDLERICON : Resource.h
  • IDI_SAMPLEHANDLERITEMICON : Resource.h
  • IDI_SCHEMA : resource.h
  • IDI_SELTABLE : resource.h
  • IDI_SETDISP : Resource.h
  • IDI_SMALL : Resource.h
  • IDI_START : Resource.h
  • IDI_STATE11 : Resource.h
  • IDI_STATE12 : Resource.h
  • IDI_STATE21 : Resource.h
  • IDI_STATE22 : Resource.h
  • IDI_STATE31 : Resource.h
  • IDI_STATE32 : Resource.h
  • IDI_STOP : Resource.h
  • IDI_SYNONYM : resource.h
  • IDI_SYSTABLE : resource.h
  • IDI_TABLE : resource.h
  • IDI_TABLE_COPY : resource.h
  • IDI_TABLES : resource.h
  • IDI_TABLESYN : resource.h
  • IDI_TABLESYS : resource.h
  • IDI_TABLEVIEW : resource.h
  • IDI_TYPE : resource.h
  • IDI_UTILITIES : Resource.h
  • IDI_VIEW : resource.h
  • iDIALOGS : msiloc.cpp
  • IDIGNORE : winres.h
  • idiHCentering : msiloc.cpp
  • idiHeight : msiloc.cpp
  • idiTitle : msiloc.cpp
  • idiVCentering : msiloc.cpp
  • idiWidth : msiloc.cpp
  • idl : ComSpy.Idl , ComSpyAudit.Idl , ComSpyCtl.Idl , CpyImage.Idl , MtsAudit.Idl , MtsSpyCtl.Idl , MtsUserEventObj.Idl , RmWorker.Idl , TxFileDisp.Idl , CopyFileRm.Idl , SimpleLog.Idl , fullsvr.Idl , myProp.Idl , PingResp.Idl , Server.Idl , pipesample.Idl , BYOTTransaction.Idl , TxEnlister.Idl , ComSyncObject.Idl , FreeObject.Idl , STAObject.Idl , CrmDebug.Idl , CrmFilesTest.Idl , CrmMonComp.Idl , icrmFiles.Idl , cascadeec.Idl , news.Idl , newseventclass.Idl , persistatl.Idl , Account.Idl , OPBank.Idl , LogWriter.Idl , QCNotify.Idl , QCOrder.Idl , QCShip.Idl , QCNotify.Idl , QCOrder.Idl , QCShip2.Idl , Disp1.Idl , VCSecuritySample.Idl , TServer.Idl , ADOKB.Idl , OLEDBKB.Idl , RDOKB.Idl , account.Idl , data.Idl , GraphObj.Idl , SampMsp.Idl , CertXSam.Idl , CertPSam.Idl , IMSConf2.Idl
  • IDL_ADDR_TYPE : Resource.h
  • IDL_APP : Resource.h
  • IDL_AXISINFO : resource.h
  • IDL_BINDFLAGS : resource.h
  • IDL_CALL_TYPE : Resource.h
  • IDL_CDFLAGS : resource.h
  • IDL_COLUMNDESC : resource.h
  • IDL_COLUMNS : resource.h
  • IDL_CONFERENCE : Resource.h
  • IDL_CONVFLAGS : resource.h
  • IDL_FLAGS : resource.h
  • IDL_FROM_TYPES : resource.h
  • IDL_GUID : Resource.h
  • IDL_INDEXCOLUMNDESC : resource.h
  • IDL_INDEXES : resource.h
  • IDL_LISTBOX : Monkey.h
  • IDL_LISTBOX2 : Monkey.h
  • IDL_LISTVIEW : resource.h
  • IDL_MODE : resource.h
  • IDL_NAMES : wdiffrc.h , resource.h
  • IDL_OPTIONS : resource.h
  • IDL_PARAMNAMES : resource.h
  • IDL_PARAMVALUES : resource.h
  • IDL_PROPERTY : resource.h
  • IDL_PROVIDERFILTER : resource.h
  • IDL_STATLAB : wdiffrc.h
  • IDL_TABLES : resource.h
  • IDL_TO_TYPES : resource.h
  • IDL_TYPEFILTER : resource.h
  • IDL_URLs : resource.h
  • IDL_USERS : Resource.h
  • IDL_VALUES : resource.h
  • IDM_ABORT : wdiffrc.h
  • IDM_ABOUT : Demo.h , Generic.H , wdiffrc.h , Resource.h , DfV.h , SimpCntr.h , SimpDnd.h , SimpSvr.h , resource.h , MidiPlyr.h , FontView.h , APP.h , Resource.h , resource.h , Resource.h , WinCap.h , resource.h , PlgBlt.h , Resource.h , GLOBALS.h , Globals.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , StatList.h , LeakyBin.h , ClipText.h , CDTest.h , Resource.h , SpinTest.h , Cursor.h , Resource.h , MousInfo.h , Menu.h , DynDlg.h , Resource.h , resource.h
  • IDM_ABOUTBOX : Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h
  • IDM_ACCEL_HELP : Resource.h
  • IDM_ACCEL_NUMTODIAL : Resource.h
  • IDM_ACCESSOR_ADDREF : resource.h
  • IDM_ACCOUNT_ALL : resource.h
  • IDM_ACTIVEWINDOW : WinCap.h
  • IDM_ADD : resource.h
  • IDM_ADD_COUNTERS : StatList.h
  • IDM_ADDREFROWS : resource.h
  • IDM_ALG2 : wdiffrc.h
  • IDM_ALLGRAPHICS : Resource.h
  • IDM_ALLPAGES : APP.h
  • IDM_ALPHA : resource.h
  • IDM_ANISOTROPIC : Resource.h
  • IDM_APP : Resource.h , resource.h , Resource.h
  • IDM_ARC : Resource.h
  • IDM_ARRANGEICONS : resource.h
  • IDM_AUTOPLAY : MidiPlyr.h
  • IDM_AUTOPOSITION : resource.h
  • IDM_BINDER_ADDREF : resource.h
  • IDM_BINDERMENU : resource.h
  • IDM_BINDING_VARIANT : resource.h
  • IDM_BLACK : Menu.h
  • IDM_BLOCK : Demo.h
  • IDM_BLUE : Resource.h , Menu.h
  • IDM_BOTH : PlgBlt.h
  • IDM_BOTHFILES : wdiffrc.h
  • IDM_BOTTOM : Resource.h
  • IDM_BOX : Demo.h
  • IDM_BRIGHTNESS : resource.h
  • IDM_BROWSE_ENUM : resource.h
  • IDM_BROWSE_FILE : resource.h
  • IDM_BROWSE_OPTION : resource.h
  • IDM_BROWSE_TABLENAME : resource.h
  • IDM_BRUSHSTYLE_BDIAGONAL : Resource.h
  • IDM_BRUSHSTYLE_CROSS : Resource.h
  • IDM_BRUSHSTYLE_DIAGCROSS : Resource.h
  • IDM_BRUSHSTYLE_FDIAGONAL : Resource.h
  • IDM_BRUSHSTYLE_HORIZONTAL : Resource.h
  • IDM_BRUSHSTYLE_VERTICAL : Resource.h
  • IDM_BUTTON1 : globals.h , Globals.h , globals.h
  • IDM_BUTTON2 : globals.h , Globals.h , globals.h
  • IDM_CALL : Resource.h
  • IDM_CALL_ACCEPT : Resource.h
  • IDM_CALL_CANCEL : Resource.h
  • IDM_CALL_CONF : Resource.h
  • IDM_CALL_REJECT : Resource.h
  • IDM_CANCEL : Resource.h
  • IDM_CAPTCLIENT : WinCap.h
  • IDM_CAPTRECT : WinCap.h
  • IDM_CAPTUREHIDE : WinCap.h
  • IDM_CAPTWINDOW : WinCap.h
  • IDM_CAR_CLUTCH : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_CREATE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_RELEASE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_SHIFT : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_SPEED : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_STEER : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CASCADE : resource.h
  • IDM_CCAR_ADJUST : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_CLUTCH : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_CREATE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_ENGAGE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_RELEASE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_SHIFT : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_SPEED : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_STEER : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CD15BPP : Resource.h
  • IDM_CD16BPP : Resource.h
  • IDM_CD1BPP : Resource.h
  • IDM_CD24BPP : Resource.h
  • IDM_CD32BPP : Resource.h
  • IDM_CD4BPP : Resource.h
  • IDM_CD8BPP : Resource.h
  • IDM_CHANGESTATUS : resource.h
  • IDM_CHANGEVALUE : resource.h
  • IDM_CHANNEL_AUDIO : Resource.h
  • IDM_CHANNEL_DATA : Resource.h
  • IDM_CHANNEL_FT : Resource.h
  • IDM_CHANNEL_SHARE : Resource.h
  • IDM_CHAPTERED_ADDREFCHAPTER : resource.h
  • IDM_CHAPTERED_RELEASECHAPTER : resource.h
  • IDM_CHARCODE : Resource.h
  • IDM_CHARSET : FontView.h
  • IDM_CHOOSEFONT : Resource.h
  • IDM_CLEAR : ClipText.h
  • IDM_CLEAR_ALL : StatList.h
  • IDM_CLEAR_ATTRIBS : globals.h
  • IDM_CLEAREDITWINDOW : resource.h
  • IDM_CLEARNOTIFYWINDOW : resource.h
  • IDM_CLOSE : wdiffrc.h , DfV.h , FontView.h , resource.h
  • IDM_CLOSEALL : resource.h
  • IDM_CLOSECAND : Resource.h
  • IDM_CLOSEWINDOW : resource.h
  • IDM_CMD_CANCELTRANSFER : Resource.h
  • IDM_CMD_CONNECT : Resource.h
  • IDM_CMD_DISCONNECT : Resource.h
  • IDM_CMD_ENUMCONF : Resource.h
  • IDM_CMD_ENUMUSER : Resource.h
  • IDM_CMD_GETINFO : Resource.h
  • IDM_CMD_ISWINDOWSHARED : Resource.h
  • IDM_CMD_LAUNCHREMOTE : Resource.h
  • IDM_CMD_LISTEN : Resource.h
  • IDM_CMD_REMOVENOTIFY : Resource.h
  • IDM_CMD_SENDDATA : Resource.h
  • IDM_CMD_SENDFILE : Resource.h
  • IDM_CMD_SETGUID : Resource.h
  • IDM_CMD_SETINFO : Resource.h
  • IDM_CMD_SETNOTIFY : Resource.h
  • IDM_CMD_SETRECDIR : Resource.h
  • IDM_CMD_SHAREWINDOW : Resource.h
  • IDM_CMD_UNSHAREWINDOW : Resource.h
  • IDM_COLLABORATE : Resource.h
  • IDM_COLLAPSE : DfV.h
  • IDM_COLLAPSEALL : DfV.h
  • IDM_COLOR : CDTest.h
  • IDM_COLOROWNERDR : Menu.h
  • IDM_COMMAND : DeskBand.h
  • IDM_COMMAND_ADDREF : resource.h
  • IDM_COMMAND_CANCEL : resource.h
  • IDM_COMMAND_CLEARCOMMAND : resource.h
  • IDM_COMMAND_GETDBSESSION : resource.h
  • IDM_COMMAND_GETPROPERTIES : resource.h
  • IDM_COMMAND_SETPROPERTIES : resource.h
  • IDM_COMMANDMENU : resource.h
  • IDM_COMMANDPERSIST_DELETECOMMAND : resource.h
  • IDM_COMMANDPERSIST_GETCURRENTCOMMAND : resource.h
  • IDM_COMMANDPERSIST_LOADCOMMAND : resource.h
  • IDM_COMMANDPERSIST_SAVECOMMAND : resource.h
  • IDM_COMMANDPREPARE : resource.h
  • IDM_COMMANDTEXT_EXECUTE : resource.h
  • IDM_COMMANDUNPREPARE : resource.h
  • IDM_COMPLETE : Resource.h
  • IDM_CONF_LEAK : Resource.h
  • IDM_CONF_LEAK2 : Resource.h
  • IDM_CONF_START : Resource.h
  • IDM_CONF_STOP : Resource.h
  • IDM_CONFINFO : Resource.h
  • IDM_CONNECT : Globals.h
  • IDM_CONNECTIONPOINT_ADDREF : resource.h
  • IDM_CONNECTIONPOINTMENU : resource.h
  • IDM_CONNECTUSING : Resource.h
  • IDM_CONTENTS : wdiffrc.h
  • IDM_CONTEXT_MENU : Resource.h
  • IDM_CONVERT : Resource.h
  • IDM_COPY : Generic.H , Resource.h , resource.h , FontView.h , resource.h , Resource.h , PlgBlt.h , ClipText.h , Commands.h
  • IDM_COPYALL : resource.h
  • IDM_COPYEDITWINDOW : resource.h
  • IDM_COPYERRORS : resource.h
  • IDM_COPYFILES : wdiffrc.h
  • IDM_COPYNOTIFYWINDOW : resource.h
  • IDM_COPYTEXT : resource.h
  • IDM_CREATE_DATALINKS : resource.h
  • IDM_CREATE_ROOTBINDER : resource.h
  • IDM_CREATE_ROOTENUMERATOR : resource.h
  • IDM_CREATE_ROWPOSITION : resource.h
  • IDM_CREATE_SERVICECOMPONENTS : resource.h
  • IDM_CREATEFILEMONIKER : resource.h
  • IDM_CREATEFONT : FontView.h
  • IDM_CURSORSELECT : WinCap.h
  • IDM_CUSTOMERROR_ADDREF : resource.h
  • IDM_CUSTOMERRORMENU : resource.h
  • IDM_CUSTOMHELPMIN : Resource.h
  • IDM_CUT : Generic.H , Resource.h , FontView.h , resource.h , ClipText.h , Commands.h
  • IDM_CUTEDITWINDOW : resource.h
  • IDM_DATA_ENABLE : Resource.h
  • IDM_DATALINKS_ADDREF : resource.h
  • IDM_DATALINKSMENU : resource.h
  • IDM_DATASET_ADDREF : resource.h
  • IDM_DATASET_FREEAXISINFO : resource.h
  • IDM_DATASET_GETAXISINFO : resource.h
  • IDM_DATASET_GETAXISROWSET : resource.h
  • IDM_DATASET_GETCELLDATA : resource.h
  • IDM_DATASET_GETNEXTAXISROW : resource.h
  • IDM_DATASET_GETSPECIFICATION : resource.h
  • IDM_DATASETMENU : resource.h
  • IDM_DATASOURCE_ADDREF : resource.h
  • IDM_DATASOURCEMENU : resource.h
  • IDM_DBSTATUS_S_DEFAULT : resource.h
  • IDM_DBSTATUS_S_IGNORE : resource.h
  • IDM_DBSTATUS_S_ISNULL : resource.h
  • IDM_DBSTATUS_S_OK : resource.h
  • IDM_DECIMAL : APP.h
  • IDM_DECIMALMODE : CDTest.h
  • IDM_DELETE : FontView.h , Commands.h
  • IDM_DELETE_COUNTER : StatList.h
  • IDM_DELETEROWS : resource.h
  • IDM_DEMO_BOUNCE : GdiDemo.h
  • IDM_DEMO_DRAW : GdiDemo.h
  • IDM_DEMO_MAZE : GdiDemo.h
  • IDM_DEMO_POLYBEZIER : GdiDemo.h
  • IDM_DEMO_XFORM : GdiDemo.h
  • IDM_DESKTOP : WinCap.h
  • IDM_DEVICES : MidiPlyr.h
  • IDM_DEVMAX : MidiPlyr.h
  • IDM_DEVMIN : MidiPlyr.h
  • IDM_DHELP_ABOUT : RESDEF.h
  • IDM_DHELP_CONTENTS : RESDEF.h
  • IDM_DHELP_READSOURCE : RESDEF.h
  • IDM_DHELP_TUTORIAL : RESDEF.h
  • IDM_DHELP_TUTSERVER : RESDEF.h
  • IDM_DIALOG : FontView.h
  • IDM_DIALOG1 : DynDlg.h
  • IDM_DIALOG2 : DynDlg.h
  • IDM_DIBINFO : Resource.h
  • IDM_DIR : wdiffrc.h
  • IDM_DISCONNECT : Globals.h
  • IDM_DISPLAY_HEX : resource.h
  • IDM_DISPLAYALLERRORS : resource.h
  • IDM_DISPLAYERRORINFO : resource.h
  • IDM_DLGEDITDIALOG : SpinTest.h
  • IDM_DRAW_CLEAR : RESDEF.h
  • IDM_DRAW_ERASE : DComDraw.h , StoClien.h
  • IDM_DRAW_EXIT : RESDEF.h
  • IDM_DRAW_MASTER : DComDraw.h
  • IDM_DRAW_OFF : StoClien.h
  • IDM_DRAW_ON : StoClien.h
  • IDM_DRAW_REDRAW : DComDraw.h , StoClien.h
  • IDM_DRAW_SAVE : RESDEF.h
  • IDM_DRAW_SLAVE : DComDraw.h
  • IDM_DRAWAXIS : Resource.h
  • IDM_EDIT : FontView.h
  • IDM_EDIT_COPY : RESDEF.h , Resource.h , Deb.h
  • IDM_EDIT_CUT : RESDEF.h , Resource.h , Deb.h
  • IDM_EDIT_DELETE : RESDEF.h , Resource.h , Deb.h
  • IDM_EDIT_PASTE : RESDEF.h , Resource.h
  • IDM_EDIT_SELECTALL : RESDEF.h
  • IDM_EDIT_SPEEDDIAL : Resource.h
  • IDM_EDIT_UNDO : RESDEF.h
  • IDM_EDITCLEAR : GLOBALS.h
  • IDM_EDITCOMP : wdiffrc.h
  • IDM_EDITCOPY : wdiffrc.h , WinCap.h , GLOBALS.h
  • IDM_EDITCUT : GLOBALS.h
  • IDM_EDITLEFT : wdiffrc.h
  • IDM_EDITMENU : resource.h
  • IDM_EDITPASTE : GLOBALS.h
  • IDM_EDITRIGHT : wdiffrc.h
  • IDM_EDITUNDO : GLOBALS.h
  • IDM_EJECT : Resource.h , resource.h , Resource.h
  • IDM_ELLIPSE : Resource.h
  • IDM_ENABLE_APPSHARING : Resource.h
  • IDM_END : MciPlay.h
  • IDM_ENTERCONTEXTHELP : Resource.h
  • IDM_ENUMERATOR : resource.h
  • IDM_ENUMERATOR_ADDREF : resource.h
  • IDM_ENUMERATORMENU : resource.h
  • IDM_ENUMFONTS : FontView.h , Resource.h
  • IDM_ENUMPRINTERDRIVERS : Resource.h
  • IDM_ENUMPRINTERS : Resource.h
  • IDM_ERROR_ADDREF : resource.h
  • IDM_ERRORINFO_GETDESCRIPTION : resource.h
  • IDM_ERRORINFO_GETGUID : resource.h
  • IDM_ERRORINFO_GETHELPCONTEXT : resource.h
  • IDM_ERRORINFO_GETHELPFILE : resource.h
  • IDM_ERRORINFO_GETSOURCE : resource.h
  • IDM_ERRORMENU : resource.h
  • IDM_ERRORMESSAGE : resource.h
  • IDM_ERRORRECORDS : resource.h
  • IDM_ERRORRECORDS_ADDERRORRECORD : resource.h
  • IDM_ERRORRECORDS_GETBASICERRORINFO : resource.h
  • IDM_ERRORRECORDS_GETCUSTOMERROROBJECT : resource.h
  • IDM_ERRORRECORDS_GETERRORINFO : resource.h
  • IDM_ERRORRECORDS_GETERRORPARAMETERS : resource.h
  • IDM_ERRORRECORDS_GETRECORDCOUNT : resource.h
  • IDM_ESCAPECONTEXTHELP : Resource.h
  • IDM_EUDC : Resource.h
  • IDM_EXECUTE : resource.h
  • IDM_EXIT : Generic.H , wdiffrc.h , Resource.h , DfV.h , Resource.h , resource.h , MidiPlyr.h , FontView.h , APP.h , Resource.h , resource.h , Resource.h , WinCap.h , resource.h , Resource.h , GLOBALS.h , Globals.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , StatList.h , LeakyBin.h , ClipText.h , CDTest.h , Resource.h , Menu.h , DynDlg.h , Resource.h , resource.h
  • IDM_EXPAND : wdiffrc.h , DfV.h
  • IDM_EXPAND_INCLEFT : wdiffrc.h
  • IDM_EXPAND_INCMOVEDLEFT : wdiffrc.h
  • IDM_EXPAND_INCMOVEDRIGHT : wdiffrc.h
  • IDM_EXPAND_INCRIGHT : wdiffrc.h
  • IDM_EXPAND_INCSAME : wdiffrc.h
  • IDM_EXPAND_INCSIMILARLEFT : wdiffrc.h
  • IDM_EXPAND_INCSIMILARRIGHT : wdiffrc.h
  • IDM_EXPANDALL : DfV.h
  • IDM_EXPANDBRANCH : DfV.h
  • IDM_EXPLORE : Commands.h
  • IDM_FCHANGE : wdiffrc.h
  • IDM_FCHANGE_LAURIE : wdiffrc.h
  • IDM_FILE : wdiffrc.h , FontView.h
  • IDM_FILE_ATTACH : Deb.h
  • IDM_FILE_COPYTABLE : resource.h
  • IDM_FILE_EXIT : AptClien.h , AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , LocServe.h , RESDEF.h , RemClien.h , StoClien.h , resource.h , Deb.h
  • IDM_FILE_LOADLOCAL : DComDraw.h
  • IDM_FILE_LOADREMOTE : DComDraw.h
  • IDM_FILE_MACHINE : RemClien.h
  • IDM_FILE_NEW : RESDEF.h
  • IDM_FILE_OPEN : RESDEF.h , StoClien.h , Deb.h
  • IDM_FILE_SAVE : DComDraw.h , RESDEF.h , StoClien.h
  • IDM_FILE_SAVEAS : RESDEF.h , StoClien.h
  • IDM_FILECLOSE : Resource.h , GLOBALS.h
  • IDM_FILEEXIT : Resource.h
  • IDM_FILENEW : GLOBALS.h
  • IDM_FILEOPEN : Resource.h , GLOBALS.h , Resource.h
  • IDM_FILEOPENAS : Resource.h
  • IDM_FILEPAGESETUP : Resource.h
  • IDM_FILEPAGESU : GLOBALS.h
  • IDM_FILEPRINT : GLOBALS.h , Resource.h
  • IDM_FILEPRINTSU : GLOBALS.h
  • IDM_FILESAVE : GLOBALS.h
  • IDM_FILESAVEAS : GLOBALS.h
  • IDM_FIND : wdiffrc.h , FontView.h , CDTest.h
  • IDM_FINDNEXT : wdiffrc.h
  • IDM_FINDPREV : wdiffrc.h
  • IDM_FIRSTPAGE : APP.h
  • IDM_FLIPONCE : PlgBlt.h
  • IDM_FONT : APP.h , CDTest.h , Resource.h , Menu.h
  • IDM_FPCHANGE : wdiffrc.h
  • IDM_FPCHANGE_LAURIE : wdiffrc.h
  • IDM_FROM_BITMAP : Resource.h
  • IDM_FROM_WINDOW : Resource.h
  • IDM_FT_CANCEL : Resource.h
  • IDM_FULLCONNECT : resource.h
  • IDM_FULLDISCONNECT : resource.h
  • IDM_FULLHALF : Resource.h
  • IDM_GENERICMENU : Resource.h
  • IDM_GET_COMPOSING : resource.h
  • IDM_GET_DATA : StatList.h
  • IDM_GET_READING : resource.h
  • IDM_GET_TEXTOWNER : resource.h
  • IDM_GETCOMMANDSTREAM : resource.h
  • IDM_GETCOMMANDTEXT : resource.h
  • IDM_GETDATA : resource.h
  • IDM_GETDATASOURCE : resource.h
  • IDM_GETDEVICECAPS : Resource.h
  • IDM_GETDISPATTR : resource.h
  • IDM_GETERRORINFO : resource.h
  • IDM_GETLASTVISIBLEDATA : resource.h
  • IDM_GETNEXTROWS : resource.h
  • IDM_GETORIGINALDATA : resource.h
  • IDM_GETPARAMETERINFO : resource.h
  • IDM_GETPENDINGROWS : resource.h
  • IDM_GETPRESERVEDKEY : resource.h
  • IDM_GETPRINTERDRIVER : Resource.h
  • IDM_GETREFERENCEDROWSET : resource.h
  • IDM_GETROWFROMHROW : resource.h
  • IDM_GETROWSTATUS : resource.h
  • IDM_GETSCHEMAROWSET : resource.h
  • IDM_GETSCHEMAS : resource.h
  • IDM_GETSPECIFICATION : resource.h
  • IDM_GETURLFROMHROW : resource.h
  • IDM_GETVISIBLEDATA : resource.h
  • IDM_GLYPH : FontView.h
  • IDM_GO : resource.h
  • IDM_GOTOLINE : wdiffrc.h
  • IDM_GREEN : Resource.h , Menu.h
  • IDM_HANGUPCALL : GLOBALS.h
  • IDM_HANJA : Resource.h
  • IDM_HELP : DfV.h , resource.h , FontView.h , APP.h , resrc1.h , Resource.h , DynDlg.h
  • IDM_HELP_ABOUT : AptClien.h , AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , LocServe.h , RESDEF.h , RemClien.h , StoClien.h , resource.h , GdiDemo.h , Deb.h
  • IDM_HELP_ABOUTDLL : ComUser.h
  • IDM_HELP_ABOUTDLLSERVER : LicClien.h
  • IDM_HELP_ABOUTLICSERVER : LicClien.h
  • IDM_HELP_ABOUTSERVER : AptClien.h , ConClien.h , DllClien.h , FreClien.h , LocClien.h , StoClien.h
  • IDM_HELP_CONTENTS : AptClien.h , ComUser.h , ConClien.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h , FontView.h , Resource.h , Deb.h
  • IDM_HELP_DEMO : FontView.h
  • IDM_HELP_GLOSSARY : FontView.h
  • IDM_HELP_HELP : resource.h , FontView.h
  • IDM_HELP_HOWTOUSE : Deb.h
  • IDM_HELP_INDEX : FontView.h
  • IDM_HELP_OVERVIEW : FontView.h
  • IDM_HELP_PERDRAW : RESDEF.h
  • IDM_HELP_PERSERVE : RESDEF.h
  • IDM_HELP_PERTEXT : RESDEF.h
  • IDM_HELP_READSOURCE : AptClien.h , ComUser.h , ConClien.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h
  • IDM_HELP_SEARCH : Deb.h
  • IDM_HELP_TUTDLL : DllUser.h , ComUser.h
  • IDM_HELP_TUTDLLSERVER : LicClien.h
  • IDM_HELP_TUTLICSERVER : LicClien.h
  • IDM_HELP_TUTMARSH : DComDraw.h
  • IDM_HELP_TUTMARSHAL : AptClien.h , LocClien.h , RemClien.h
  • IDM_HELP_TUTORIAL : FontView.h , LocClien.h , ComUser.h , AptClien.h , ConClien.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , RESDEF.h , RemClien.h , StoClien.h
  • IDM_HELP_TUTREGISTER : DllClien.h
  • IDM_HELP_TUTSERVER : DComDraw.h , AptClien.h , ConClien.h , DllClien.h , FreClien.h , LocClien.h , RemClien.h , StoClien.h
  • IDM_HELPABOUT : Resource.h
  • IDM_HELPCONTENTS : Generic.H , resource.h , Resource.h
  • IDM_HELPHELP : resource.h , Generic.H
  • IDM_HELPSEARCH : Generic.H , resource.h
  • IDM_HELPTOPICS : StatList.h , Generic.H , LeakyBin.h
  • IDM_HEXMODE : CDTest.h
  • IDM_HIDEMARK : wdiffrc.h
  • IDM_HIENGLISH : Resource.h
  • IDM_HIMETRIC : Resource.h
  • IDM_HOME : MciPlay.h
  • IDM_HOVER : MousInfo.h
  • IDM_HUE : resource.h
  • IDM_IACCESSOR_ADDREFACCESSOR : resource.h
  • IDM_IACCESSOR_CREATEACCESSOR : resource.h
  • IDM_IACCESSOR_GETBINDINGS : resource.h
  • IDM_IACCESSOR_RELEASEACCESSOR : resource.h
  • IDM_IBINDRESOURCE_BIND : resource.h
  • IDM_ICOLUMNSINFO2_GETRESTRICTEDCOLUMNINFO : resource.h
  • IDM_ICOLUMNSINFO_GETCOLUMNINFO : resource.h
  • IDM_ICOLUMNSINFO_MAPCOLUMNIDS : resource.h
  • IDM_ICOLUMNSROWSET_GETAVAILABLECOLUMNS : resource.h
  • IDM_ICOLUMNSROWSET_GETCOLUMNSROWSET : resource.h
  • IDM_ICONNECTIONPOINT_ADVISE : resource.h
  • IDM_ICONNECTIONPOINT_ENUMCONNECTIONS : resource.h
  • IDM_ICONNECTIONPOINT_GETCONNECTIONINTERFACE : resource.h
  • IDM_ICONNECTIONPOINT_GETCONNECTIONPOINTCONTAINER : resource.h
  • IDM_ICONNECTIONPOINT_UNADVISE : resource.h
  • IDM_ICONVERTTYPE_CANCONVERT : resource.h
  • IDM_ICPC_ENUMCONNECTIONPOINTS : resource.h
  • IDM_ICPC_FINDCONNECTIONPOINT : resource.h
  • IDM_ICREATEROW_CREATEROW : resource.h
  • IDM_IDATAINITIALIZE_CREATEDBINSTANCE : resource.h
  • IDM_IDATAINITIALIZE_CREATEDBINSTANCEEX : resource.h
  • IDM_IDATAINITIALIZE_GETDATASOURCE : resource.h
  • IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING : resource.h
  • IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING_NOPASSWORD : resource.h
  • IDM_IDATAINITIALIZE_LOADSTRINGFROMSTORAGE : resource.h
  • IDM_IDATAINITIALIZE_WRITESTRINGTOSTORAGE : resource.h
  • IDM_IDATASOURCEADMIN_CREATEDATASOURCE : resource.h
  • IDM_IDATASOURCEADMIN_DESTROYDATASOURCE : resource.h
  • IDM_IDATASOURCEADMIN_GETCREATIONPROPERTIES : resource.h
  • IDM_IDATASOURCEADMIN_MODIFYDATASOURCE : resource.h
  • IDM_IDBASYNCHNOTIFY_E_FAIL : resource.h
  • IDM_IDBASYNCHNOTIFY_S_FALSE : resource.h
  • IDM_IDBASYNCHNOTIFY_S_OK : resource.h
  • IDM_IDBASYNCHNOTIFY_S_UNWANTEDPHASE : resource.h
  • IDM_IDBASYNCHNOTIFY_S_UNWANTEDREASON : resource.h
  • IDM_IDBASYNCHSTATUS_ABORT : resource.h
  • IDM_IDBASYNCHSTATUS_GETSTATUS : resource.h
  • IDM_IDBBINDERPROPERTIES_RESET : resource.h
  • IDM_IDBCREATECOMMAND_CREATECOMMAND : resource.h
  • IDM_IDBCREATESESSION_CREATESESSION : resource.h
  • IDM_IDBINFO_GETKEYWORDS : resource.h
  • IDM_IDBINFO_GETLITERALINFO : resource.h
  • IDM_IDBINITIALIZE_INITIALIZE : resource.h
  • IDM_IDBINITIALIZE_UNINITIALIZE : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE_ADVANCED : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME_ADVANCED : resource.h
  • IDM_IDBPROPERTIES_GETPROPERTIES : resource.h
  • IDM_IDBPROPERTIES_GETPROPERTYINFO : resource.h
  • IDM_IDBPROPERTIES_SETPROPERTIES : resource.h
  • IDM_IGETPOOL_GETPOOL : resource.h
  • IDM_IGETPOOL_GETPOOLSTATE : resource.h
  • IDM_IGETSESSION_GETSESSION : resource.h
  • IDM_IGNBLANKS : wdiffrc.h
  • IDM_ILOCKBYTES_FLUSH : resource.h
  • IDM_ILOCKBYTES_LOCKREGION : resource.h
  • IDM_ILOCKBYTES_READAT : resource.h
  • IDM_ILOCKBYTES_SETSIZE : resource.h
  • IDM_ILOCKBYTES_STAT : resource.h
  • IDM_ILOCKBYTES_UNLOCKREGION : resource.h
  • IDM_ILOCKBYTES_WRITE : resource.h
  • IDM_IMDFIND_FINDCELL : resource.h
  • IDM_IMDFIND_FINDTUPEL : resource.h
  • IDM_IMDRANGEROWSET_GETRANGEROWSET : resource.h
  • IDM_IMULTIPLERESULTS_GETRESULT : resource.h
  • IDM_IN_CONTROL : Resource.h
  • IDM_INDEX_ALTERINDEX : resource.h
  • IDM_INDEX_CREATEINDEX : resource.h
  • IDM_INDEX_DROPINDEX : resource.h
  • IDM_INSERT : SimpDnd.h , SimpCntr.h , SimpSvr.h
  • IDM_INSERTOBJECT : Resource.h
  • IDM_INSERTROW : resource.h
  • IDM_INVALID : resource.h
  • IDM_INVOKE_ALL : resource.h
  • IDM_IPERSIST_GETCLASSID : resource.h
  • IDM_IPERSISTFILE_GETCURFILE : resource.h
  • IDM_IPERSISTFILE_ISDIRTY : resource.h
  • IDM_IPERSISTFILE_LOAD : resource.h
  • IDM_IPERSISTFILE_SAVE : resource.h
  • IDM_IPERSISTFILE_SAVECOMPLETED : resource.h
  • IDM_IPOOLINFO_GETCOUNT : resource.h
  • IDM_IPOOLINFO_GETPOOLID : resource.h
  • IDM_IPOOLINFO_GETPOOLTIMEOUT : resource.h
  • IDM_IPOOLINFO_GETPROTOTYPE : resource.h
  • IDM_IPOOLINFO_GETRETRYTIMEOUT : resource.h
  • IDM_IPOOLINFO_REFRESH : resource.h
  • IDM_IPOOLINFO_SETPOOLTIMEOUT : resource.h
  • IDM_IPOOLINFO_SETRETRYTIMEOUT : resource.h
  • IDM_IREGISTERPROVIDER_GETURLMAPPING : resource.h
  • IDM_IREGISTERPROVIDER_SETURLMAPPING : resource.h
  • IDM_IREGISTERPROVIDER_UNREGISTERPROVIDER : resource.h
  • IDM_IROW_ADDCOLUMNS : resource.h
  • IDM_IROW_DELETECOLUMNS : resource.h
  • IDM_IROW_GETCOLUMNS : resource.h
  • IDM_IROW_GETSOURCEROWSET : resource.h
  • IDM_IROW_OPEN : resource.h
  • IDM_IROW_SETCOLUMNS : resource.h
  • IDM_IROWPOS_CLEARROWPOSITION : resource.h
  • IDM_IROWPOS_GETROWPOSITION : resource.h
  • IDM_IROWPOS_GETROWSET : resource.h
  • IDM_IROWPOS_INITIALIZE : resource.h
  • IDM_IROWPOS_SETROWPOSITION : resource.h
  • IDM_IROWPOSITION_E_FAIL : resource.h
  • IDM_IROWPOSITION_S_FALSE : resource.h
  • IDM_IROWPOSITION_S_OK : resource.h
  • IDM_IROWPOSITION_S_UNWANTEDPHASE : resource.h
  • IDM_IROWPOSITION_S_UNWANTEDREASON : resource.h
  • IDM_IROWSET_CURSORENGINE : resource.h
  • IDM_IROWSET_GETPROPERTIES : resource.h
  • IDM_IROWSETBOOKMARK_POSITIONONBOOKMARK : resource.h
  • IDM_IROWSETFIND_FINDNEXTROW : resource.h
  • IDM_IROWSETINDENTITY_ISSAMEROW : resource.h
  • IDM_IROWSETLOCATE_COMPARE : resource.h
  • IDM_IROWSETLOCATE_GETDATA : resource.h
  • IDM_IROWSETLOCATE_GETROWSAT : resource.h
  • IDM_IROWSETLOCATE_GETROWSBYBOOKMARK : resource.h
  • IDM_IROWSETLOCATE_HASH : resource.h
  • IDM_IROWSETNOTIFY_E_FAIL : resource.h
  • IDM_IROWSETNOTIFY_S_FALSE : resource.h
  • IDM_IROWSETNOTIFY_S_OK : resource.h
  • IDM_IROWSETNOTIFY_S_UNWANTEDPHASE : resource.h
  • IDM_IROWSETNOTIFY_S_UNWANTEDREASON : resource.h
  • IDM_IROWSETPROPERTIES : resource.h
  • IDM_IROWSETSCROLL_GETAPPROXIMATEPOSITION : resource.h
  • IDM_IROWSETSCROLL_GETDATA : resource.h
  • IDM_IROWSETSCROLL_GETROWSATRATIO : resource.h
  • IDM_IROWSETVIEW_CREATEVIEW : resource.h
  • IDM_IROWSETVIEW_GETVIEW : resource.h
  • IDM_IS_SHARING_ENABLED : Resource.h
  • IDM_ISCOPEDOPERATIONS_COPY : resource.h
  • IDM_ISCOPEDOPERATIONS_DELETE : resource.h
  • IDM_ISCOPEDOPERATIONS_MOVE : resource.h
  • IDM_ISCOPEDOPERATIONS_OPENROWSET : resource.h
  • IDM_ISEQSTREAM_READ : resource.h
  • IDM_ISEQSTREAM_WRITE : resource.h
  • IDM_ISERVICEPROVIDER : resource.h
  • IDM_ISESSIONPROPERTIES_GETPROPERTIES : resource.h
  • IDM_ISESSIONPROPERTIES_SETPROPERTIES : resource.h
  • IDM_ISOTROPIC : Resource.h
  • IDM_ISOURCESROWSET_GETSOURCESROWSET : resource.h
  • IDM_ISTREAM_CLONE : resource.h
  • IDM_ISTREAM_COMMIT : resource.h
  • IDM_ISTREAM_COPYTO : resource.h
  • IDM_ISTREAM_LOCKREGION : resource.h
  • IDM_ISTREAM_READ : resource.h
  • IDM_ISTREAM_REVERT : resource.h
  • IDM_ISTREAM_SEEK : resource.h
  • IDM_ISTREAM_SETSIZE : resource.h
  • IDM_ISTREAM_STAT : resource.h
  • IDM_ISTREAM_UNLOCKREGION : resource.h
  • IDM_ISTREAM_WRITE : resource.h
  • IDM_ISUPPORTERRORINFO : resource.h
  • IDM_ITRANSACTION_ABORT : resource.h
  • IDM_ITRANSACTION_COMMIT : resource.h
  • IDM_ITRANSACTION_GETTRANSACTIONINFO : resource.h
  • IDM_ITRANSACTION_RELEASETRANSACTION : resource.h
  • IDM_ITRANSACTIONDISPENSOR_BEGINTRANSACTION : resource.h
  • IDM_ITRANSACTIONJOIN_GETOPTIONSOBJECT : resource.h
  • IDM_ITRANSACTIONJOIN_JOINTRANSACTION : resource.h
  • IDM_ITRANSACTIONJOIN_RELEASETRANSACTION : resource.h
  • IDM_ITRANSACTIONLOCAL_GETOPTIONSOBJECT : resource.h
  • IDM_ITRANSACTIONLOCAL_STARTTRANSACTION : resource.h
  • IDM_ITRANSACTIONOBJECT_GETTRANSACTIONOBJECT : resource.h
  • IDM_ITRANSACTIONOPTIONS_GETOPTIONS : resource.h
  • IDM_ITRANSACTIONOPTIONS_SETOPTIONS : resource.h
  • IDM_IUNKNOWN_AUTOQI : resource.h
  • IDM_IUNKNOWN_QUERYINTERFACE : resource.h
  • IDM_IUNKNOWN_RELEASE : resource.h
  • IDM_IUNKNOWN_RELEASEALL : resource.h
  • IDM_IUNKNOWN_RELEASECHILDREN : resource.h
  • IDM_KILL_THREADS : resource.h
  • IDM_LARGE_ICONS : Resource.h , resource.h
  • IDM_LARGEICONS : Resource.h
  • IDM_LAST : Commands.h
  • IDM_LASTPAGE : APP.h
  • IDM_LAUNCH : Resource.h
  • IDM_LAZY : wdiffrc.h
  • IDM_LEAVE : MousInfo.h
  • IDM_LEFT : Resource.h
  • IDM_LINETO : Resource.h
  • IDM_LINK : Generic.H , resource.h
  • IDM_LINKS : Generic.H , resource.h
  • IDM_LIST : Resource.h , resource.h
  • IDM_LISTEN : Globals.h
  • IDM_LNRS : wdiffrc.h
  • IDM_LOAD : resource.h
  • IDM_LOADDIB : Resource.h , resource.h
  • IDM_LOCATION : Resource.h
  • IDM_LOENGLISH : Resource.h
  • IDM_LOG_COPYCLIP : RemClien.h , AptClien.h , AptServe.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , LocServe.h
  • IDM_LOG_DLLSERVER : LicClien.h
  • IDM_LOG_LICSERVER : LicClien.h
  • IDM_LOG_LOGCLEAR : AptServe.h , LocClien.h , AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocServe.h , RemClien.h
  • IDM_LOG_LOGGING : RemClien.h , AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h
  • IDM_LOGONOFF : Resource.h
  • IDM_LOMETRIC : Resource.h
  • IDM_LONLY : wdiffrc.h
  • IDM_MAIN_MENU : Resource.h , resource.h
  • IDM_MAKECALL : GLOBALS.h
  • IDM_MAPPARAMETERNAMES : resource.h
  • IDM_MAPPER : MidiPlyr.h
  • IDM_MARK : wdiffrc.h
  • IDM_MARKPATTERN : wdiffrc.h
  • IDM_MENU : Resource.h , MousInfo.h
  • IDM_MIXER_MERGE : resource.h
  • IDM_MIXER_OPTIONS : resource.h
  • IDM_MIXER_PLAY : resource.h
  • IDM_MIXER_STOP : resource.h
  • IDM_MODAL : Resource.h
  • IDM_MODE_BLACKONWHITE : PlgBlt.h
  • IDM_MODE_COLORONCOLOR : PlgBlt.h
  • IDM_MODE_HALFTONE : PlgBlt.h
  • IDM_MODE_WHITEONBLACK : PlgBlt.h
  • IDM_MODELESS : Resource.h
  • IDM_MODIFY_DATA : Commands.h
  • IDM_MONITOR : Resource.h
  • IDM_MONOCOLS : wdiffrc.h
  • IDM_MSPERSIST_ROWSET_LOAD : resource.h
  • IDM_MSPERSIST_ROWSET_SAVE : resource.h
  • IDM_MULTIPLERESULTS_ADDREF : resource.h
  • IDM_MULTIPLERESULTSMENU : resource.h
  • IDM_MULTITHREAD2 : CDTest.h
  • IDM_NATIVEMODE : Resource.h
  • IDM_NEW : FontView.h , Commands.h , Generic.H , Resource.h , resource.h , StatList.h , ClipText.h
  • IDM_NEW_DEVICE : globals.h
  • IDM_NEW_FOLDER : globals.h , Commands.h
  • IDM_NEW_ITEM : Commands.h
  • IDM_NEW_VIRTFILE : globals.h
  • IDM_NEXTCAND : Resource.h
  • IDM_NEXTCLAUSE : Resource.h
  • IDM_NEXTPAGE : APP.h
  • IDM_NEXTSECTION : APP.h
  • IDM_NEXTWINDOW : resource.h
  • IDM_NOGRAPHICS : Resource.h
  • IDM_NONRS : wdiffrc.h
  • IDM_NOTIFY_E_FAIL : resource.h
  • IDM_NOTIFY_S_FALSE : resource.h
  • IDM_NOTIFY_S_OK : resource.h
  • IDM_NOTIFY_S_UNWANTEDPHASE : resource.h
  • IDM_NOTIFY_S_UNWANTEDREASON : resource.h
  • IDM_NOTIFYMENU : resource.h
  • IDM_OBJECTSWINDOW : resource.h
  • IDM_ON_TOP : Resource.h
  • IDM_OPEN : resource.h , sendto.h , Resource.h , Generic.H , wdiffrc.h , DfV.h , Resource.h , MidiPlyr.h , FontView.h , resource.h , StatList.h , ClipText.h , CDTest.h , Commands.h
  • IDM_OPENCAND : Resource.h
  • IDM_OPENROWSET : resource.h
  • IDM_OPENSTATUS : Resource.h
  • IDM_OPTION_CHATTY : resource.h
  • IDM_OPTION_CREATE_ITERATION : resource.h
  • IDM_OPTION_ODBC_ASSERT : resource.h
  • IDM_OPTION_ODBC_STOP : resource.h
  • IDM_OPTIONS : Resource.h , resource.h , Resource.h
  • IDM_OPTIONS_COLOR : Deb.h
  • IDM_OPTIONS_FONT : Deb.h
  • IDM_OPTIONS_PREFERENCES : Deb.h
  • IDM_OPTIONS_SAVEDDIR : Deb.h
  • IDM_OPTIONS_SAVENOW : Deb.h
  • IDM_OPTIONS_SAVEONEXIT : Deb.h
  • IDM_OPTIONS_TOOLBAR : Deb.h
  • IDM_OUTLINE : wdiffrc.h , Resource.h
  • IDM_OUTLINE_INCDIFFER : wdiffrc.h
  • IDM_OUTLINE_INCLEFT : wdiffrc.h
  • IDM_OUTLINE_INCRIGHT : wdiffrc.h
  • IDM_OUTLINE_INCSAME : wdiffrc.h
  • IDM_OUTLINEMETRICS : FontView.h
  • IDM_OVER : resource.h
  • IDM_PAGE_DELETE : RESDEF.h
  • IDM_PAGE_NEWDRAW : RESDEF.h
  • IDM_PAGE_NEWTEXT : RESDEF.h
  • IDM_PAGE_OPEN : RESDEF.h
  • IDM_PAGE_TITLE : RESDEF.h
  • IDM_PARSEDISPLAYNAME : resource.h
  • IDM_PASTE : Generic.H , Resource.h , FontView.h , resource.h , PlgBlt.h , ClipText.h , Commands.h , Resource.h
  • IDM_PASTEEDITWINDOW : resource.h
  • IDM_PAUSE : MciPlay.h , MidiPlyr.h
  • IDM_PEN_COLOR : DComDraw.h , StoClien.h , RESDEF.h
  • IDM_PEN_MEDIUM : DComDraw.h , RESDEF.h , StoClien.h
  • IDM_PEN_THICK : DComDraw.h , RESDEF.h , StoClien.h
  • IDM_PEN_THIN : RESDEF.h , StoClien.h , DComDraw.h
  • IDM_PENCOLOR_DASH : Resource.h
  • IDM_PENCOLOR_DASHDOT : Resource.h
  • IDM_PENCOLOR_DASHDOTDOT : Resource.h
  • IDM_PENCOLOR_DOT : Resource.h
  • IDM_PENCOLOR_INSIDEFRAME : Resource.h
  • IDM_PENCOLOR_NULL : Resource.h
  • IDM_PENCOLOR_SOLID : Resource.h
  • IDM_PENWIDTH_1 : Resource.h
  • IDM_PENWIDTH_2 : Resource.h
  • IDM_PENWIDTH_3 : Resource.h
  • IDM_PENWIDTH_4 : Resource.h
  • IDM_PENWIDTH_5 : Resource.h
  • IDM_PENWIDTH_6 : Resource.h
  • IDM_PENWIDTH_7 : Resource.h
  • IDM_PENWIDTH_8 : Resource.h
  • IDM_PICTURE : wdiffrc.h
  • IDM_PIE : Resource.h
  • IDM_PLAY : MidiPlyr.h , MciPlay.h
  • IDM_PLAYBACK : resource.h
  • IDM_PLGBLT : Resource.h
  • IDM_POLYBEZIER : Resource.h
  • IDM_POLYGON : Resource.h
  • IDM_POLYLINE : Resource.h
  • IDM_POLYPOLYGON : Resource.h
  • IDM_POOL_TEST : resource.h
  • IDM_POOLINFO_ADDREF : resource.h
  • IDM_POOLMENU : resource.h
  • IDM_POOLMNGR_ENUMPOOLS : resource.h
  • IDM_POOLMNGR_REFRESH : resource.h
  • IDM_PREV : resource.h
  • IDM_PREVCAND : Resource.h
  • IDM_PREVCLAUSE : Resource.h
  • IDM_PREVPAGE : APP.h
  • IDM_PREVSECTION : APP.h
  • IDM_PREVWINDOW : resource.h
  • IDM_PRINT : Generic.H , Resource.h , FontView.h , APP.h , Resource.h , resource.h , WinCap.h , ClipText.h , CDTest.h , Resource.h , wdiffrc.h
  • IDM_PRINTDLG : Resource.h
  • IDM_PRINTERNOTIFICATION : resource.h
  • IDM_PRINTSET : FontView.h
  • IDM_PRINTSETUP : Generic.H , resource.h
  • IDM_PROPERTIES : resource.h
  • IDM_PROVIDERINFO : resource.h
  • IDM_QUERY_ATTRIBS : globals.h
  • IDM_QUICKTEST : Resource.h
  • IDM_RANDOM : resource.h
  • IDM_RANDOM_COINIT : resource.h
  • IDM_RECENTCONFIG1 : resource.h
  • IDM_RECENTCONFIG10 : resource.h
  • IDM_RECENTCONFIG2 : resource.h
  • IDM_RECENTCONFIG3 : resource.h
  • IDM_RECENTCONFIG4 : resource.h
  • IDM_RECENTCONFIG5 : resource.h
  • IDM_RECENTCONFIG6 : resource.h
  • IDM_RECENTCONFIG7 : resource.h
  • IDM_RECENTCONFIG8 : resource.h
  • IDM_RECENTCONFIG9 : resource.h
  • IDM_RECENTFILE1 : resource.h
  • IDM_RECENTFILE10 : resource.h
  • IDM_RECENTFILE2 : resource.h
  • IDM_RECENTFILE3 : resource.h
  • IDM_RECENTFILE4 : resource.h
  • IDM_RECENTFILE5 : resource.h
  • IDM_RECENTFILE6 : resource.h
  • IDM_RECENTFILE7 : resource.h
  • IDM_RECENTFILE8 : resource.h
  • IDM_RECENTFILE9 : resource.h
  • IDM_RECONVERT : resource.h
  • IDM_RECTANGLE : Resource.h
  • IDM_RED : Resource.h , Menu.h
  • IDM_REFRESH : resource.h , Resource.h , resource.h
  • IDM_REFRESHVISIBLEDATA : resource.h
  • IDM_REGISTER_LOCAL : resource.h
  • IDM_RELEASE_JOINEDTRANSACTION : resource.h
  • IDM_RELEASEALLROWS : resource.h
  • IDM_RELEASEROWS : resource.h
  • IDM_REMOVE : resource.h
  • IDM_RENAME : Commands.h
  • IDM_RENDER : Resource.h
  • IDM_REPLACE : FontView.h , CDTest.h
  • IDM_REPORT : Resource.h
  • IDM_RESCAN : wdiffrc.h
  • IDM_RESET : LeakyBin.h
  • IDM_RESTARTPOSITION : resource.h
  • IDM_RESYNCHROWS : resource.h
  • IDM_RETAIN : Demo.h
  • IDM_RETRY : resource.h
  • IDM_REVERT : Resource.h
  • IDM_RIGHT : Resource.h
  • IDM_RNRS : wdiffrc.h
  • IDM_ROMAN : Resource.h
  • IDM_RONLY : wdiffrc.h
  • IDM_ROTATE : Resource.h
  • IDM_ROUNDRECT : Resource.h
  • IDM_ROW_ADDREF : resource.h
  • IDM_ROWMENU : resource.h
  • IDM_ROWPOS_ADDREF : resource.h
  • IDM_ROWPOSITIONMENU : resource.h
  • IDM_ROWSET_ADDREF : resource.h
  • IDM_ROWSETMENU : resource.h
  • IDM_RPLAY : MciPlay.h
  • IDM_RSTEP : MciPlay.h
  • IDM_RUN_SUITE : resource.h
  • IDM_SAutosizeMovie : MciPlay.h
  • IDM_SAutosizeWindow : MciPlay.h
  • IDM_SAVE : Generic.H , Resource.h , FontView.h , resource.h , WinCap.h , ClipText.h , CDTest.h , resource.h , Resource.h , StatList.h
  • IDM_SAVE_AS : Resource.h
  • IDM_SAVEAS : Generic.H , Resource.h , FontView.h , resource.h , ClipText.h , StatList.h , Resource.h
  • IDM_SAVEDIB : Resource.h
  • IDM_SAVELIST : wdiffrc.h
  • IDM_SELECT_APPLICATIONS : Resource.h
  • IDM_SELECTPRINTER : resource.h
  • IDM_SELECTRECT : WinCap.h
  • IDM_SENDTOFIRST : sendto.h
  • IDM_SENDTOLAST : sendto.h
  • IDM_SENDTOPOPUP : sendto.h
  • IDM_SEPARATOR : Commands.h
  • IDM_SErrorDlg : MciPlay.h
  • IDM_SERVICECOMP_ADDREF : resource.h
  • IDM_SERVICECOMPMENU : resource.h
  • IDM_SESSION_ADDREF : resource.h
  • IDM_SESSIONMENU : resource.h
  • IDM_SETBRUSHCOLOR : Resource.h
  • IDM_SETCOMMANDSTREAM : resource.h
  • IDM_SETCOMMANDTEXT : resource.h
  • IDM_SETDATA : resource.h
  • IDM_SETEDIT : wdiffrc.h
  • IDM_SETERRORINFO : resource.h
  • IDM_SETFONT : wdiffrc.h
  • IDM_SETPARAMETERINFO : resource.h
  • IDM_SETPENCOLOR : Resource.h
  • IDM_SETTABWIDTH : wdiffrc.h
  • IDM_SETTINGS : StatList.h
  • IDM_SHARE : Resource.h
  • IDM_SHOWCAND : Resource.h
  • IDM_SHOWGUIDES : Resource.h
  • IDM_SHOWLOCAL : Resource.h
  • IDM_SHOWPROP : Resource.h
  • IDM_SHOWWHITESPACE : wdiffrc.h
  • IDM_SINK_OFF : StoClien.h
  • IDM_SINK_ON : StoClien.h
  • IDM_SIZE : Menu.h
  • IDM_SMALL_ICONS : Resource.h , resource.h
  • IDM_SMALLICONS : Resource.h
  • IDM_SMenu : MciPlay.h
  • IDM_SNotifyMedia : MciPlay.h
  • IDM_SNotifyMode : MciPlay.h
  • IDM_SNotifyPos : MciPlay.h
  • IDM_SNotifySize : MciPlay.h
  • IDM_SOFTKBD : Resource.h
  • IDM_SOUND_BALL_OFF : ConClien.h
  • IDM_SOUND_BALL_ON : ConClien.h
  • IDM_SPIN10 : PlgBlt.h
  • IDM_SPIN30 : PlgBlt.h
  • IDM_SPIN5 : PlgBlt.h
  • IDM_SPIN60 : PlgBlt.h
  • IDM_SPIN90 : PlgBlt.h
  • IDM_SPINCENTER : PlgBlt.h
  • IDM_SPINOFF : PlgBlt.h
  • IDM_SPINTESTSTATS : SpinTest.h
  • IDM_SPINTOPLEFT : PlgBlt.h
  • IDM_SPlaybar : MciPlay.h
  • IDM_SQLERRORINFO_GETSQLINFO : resource.h
  • IDM_SRecord : MciPlay.h
  • IDM_SShowMode : MciPlay.h
  • IDM_SShowName : MciPlay.h
  • IDM_SShowPos : MciPlay.h
  • IDM_START : LeakyBin.h
  • IDM_STARTIMEMENU : Resource.h
  • IDM_STATE1 : Menu.h
  • IDM_STATE2 : Menu.h
  • IDM_STATE3 : Menu.h
  • IDM_STATE4 : Menu.h
  • IDM_STATUS : MidiPlyr.h
  • IDM_STATUSBAR : FontView.h , STATBAR.h
  • IDM_STEP : MciPlay.h
  • IDM_STOP : resource.h , MciPlay.h , MidiPlyr.h , LeakyBin.h
  • IDM_STREAM_ADDREF : resource.h
  • IDM_STREAMMENU : resource.h
  • IDM_STRETCHBLT : Resource.h
  • IDM_STYLE : Menu.h
  • IDM_SWITCH : Resource.h
  • IDM_SYMBOL : Resource.h
  • IDM_SYNCUI : MidiPlyr.h
  • IDM_SYS_LOGOFF : Resource.h
  • IDM_SYS_LOGON : Resource.h
  • IDM_SYSINFO : Resource.h
  • IDM_SYSMENU : FontView.h
  • IDM_TABLE_ADDCOLUMN : resource.h
  • IDM_TABLE_ADDCONSTRAINT : resource.h
  • IDM_TABLE_ALTERCOLUMN : resource.h
  • IDM_TABLE_ALTERTABLE : resource.h
  • IDM_TABLE_CREATETABLE : resource.h
  • IDM_TABLE_CREATETABLEWITHCONSTRAINTS : resource.h
  • IDM_TABLE_DROPCOLUMN : resource.h
  • IDM_TABLE_DROPCONSTRAINT : resource.h
  • IDM_TABLE_DROPTABLE : resource.h
  • IDM_TABWIDTH4 : wdiffrc.h
  • IDM_TABWIDTH8 : wdiffrc.h
  • IDM_TERMINATE_COMPOSITION : resource.h
  • IDM_TEST : resource.h
  • IDM_TEST_DLLABOUT : DllUser.h
  • IDM_TEST_DLLHELLO : DllUser.h
  • IDM_TEXT : Resource.h
  • IDM_TEXT_CLEAR : RESDEF.h
  • IDM_TEXT_EXIT : RESDEF.h
  • IDM_TEXT_SAVE : RESDEF.h
  • IDM_TEXTCOLOR : Resource.h
  • IDM_TEXTMETRIC : FontView.h
  • IDM_THELP_ABOUT : RESDEF.h
  • IDM_THELP_CONTENTS : RESDEF.h
  • IDM_THELP_READSOURCE : RESDEF.h
  • IDM_THELP_TUTORIAL : RESDEF.h
  • IDM_THELP_TUTSERVER : RESDEF.h
  • IDM_TILEHORIZONTAL : resource.h
  • IDM_TILEVERTICAL : resource.h
  • IDM_TIME : wdiffrc.h
  • IDM_TIMER : STATBAR.h
  • IDM_TITLE : CDTest.h
  • IDM_TOGGLE : DfV.h
  • IDM_TOGGLE_STATUS : globals.h
  • IDM_TOGGLEMARK : wdiffrc.h
  • IDM_TOMOVED : wdiffrc.h
  • IDM_TOOLBAR : FontView.h , ToolBar.h , MidiPlyr.h
  • IDM_TOP : Resource.h
  • IDM_TOPMOST : Resource.h
  • IDM_TRACE : wdiffrc.h
  • IDM_TRACEOFF : wdiffrc.h
  • IDM_TRACEWINDOW : resource.h
  • IDM_TRACK : MousInfo.h
  • IDM_TRANSACTION_ADDREF : resource.h
  • IDM_TRANSACTIONMENU : resource.h
  • IDM_TRANSACTIONOPTIONS_ADDREF : resource.h
  • IDM_TRANSACTIONOPTIONSMENU : resource.h
  • IDM_TREESCHEMA : resource.h
  • IDM_TWIPS : Resource.h
  • IDM_UCAR_CLUTCH : AptClien.h , DllClien.h , LicClien.h , LocClien.h , ComUser.h , RemClien.h
  • IDM_UCAR_CREATE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCAR_OFFROAD : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCAR_RELEASE : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCAR_SHIFT : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCAR_SPEED : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCAR_STEER : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCAR_WINCH : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCRU_ADJUST : AptClien.h , DllClien.h , LicClien.h , LocClien.h , ComUser.h , RemClien.h
  • IDM_UCRU_CLEARLICKEY : LicClien.h
  • IDM_UCRU_CLUTCH : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCRU_CREATE : ComUser.h , DllClien.h , LicClien.h , RemClien.h , LocClien.h , AptClien.h
  • IDM_UCRU_ENGAGE : AptClien.h , ComUser.h , LicClien.h , LocClien.h , RemClien.h , DllClien.h
  • IDM_UCRU_GETLICKEY : LicClien.h
  • IDM_UCRU_OFFROAD : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCRU_RELEASE : AptClien.h , DllClien.h , LicClien.h , LocClien.h , ComUser.h , RemClien.h
  • IDM_UCRU_SHIFT : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCRU_SPEED : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCRU_STEER : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCRU_WINCH : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UNDO : Generic.H , Resource.h , resource.h , FontView.h , resource.h , Resource.h , ClipText.h
  • IDM_UNKNOWN_ADDREF : resource.h
  • IDM_UNKNOWNMENU : resource.h
  • IDM_UPDATE : wdiffrc.h , resource.h , Resource.h
  • IDM_VERB0 : SimpCntr.h , SimpDnd.h , SimpSvr.h
  • IDM_VIEW : FontView.h , Commands.h
  • IDM_VIEW_CHAT : Resource.h
  • IDM_VIEW_CLEAR : resource.h , Resource.h
  • IDM_VIEW_DETAILS : Commands.h
  • IDM_VIEW_ENVIRON : Resource.h
  • IDM_VIEW_FONT : Resource.h
  • IDM_VIEW_LARGE : Commands.h
  • IDM_VIEW_LIST : Commands.h
  • IDM_VIEW_MSG : Resource.h
  • IDM_VIEW_NAME : Resource.h
  • IDM_VIEW_NEXT : resource.h
  • IDM_VIEW_SBAR : Resource.h
  • IDM_VIEW_SMALL : Commands.h
  • IDM_VIEW_TBAR : Resource.h
  • IDM_VIEW_TIME : Resource.h
  • IDM_VIEW_USERLIST : Resource.h
  • IDM_VIEW_USERS : Resource.h
  • IDM_VIEWCLEAR : WinCap.h
  • IDM_VIEWFONT : Resource.h
  • IDM_VIEWFONTDECREASE : Resource.h
  • IDM_VIEWFONTINCREASE : Resource.h
  • IDM_VIEWFULL : WinCap.h
  • IDM_VIEWREPLACE : Resource.h
  • IDM_VIEWRESTORED : WinCap.h
  • IDM_VIEWSTATUSBAR : Resource.h
  • IDM_VIEWTOOLBAR : Resource.h
  • IDM_WINDOW_CASCADE : GdiDemo.h
  • IDM_WINDOW_ICON : GdiDemo.h
  • IDM_WINDOW_TILE : GdiDemo.h
  • IDM_WINDOWCHILD : Resource.h
  • IDM_WIZARD : Resource.h
  • IDM_WORK_ALONE : Resource.h
  • IDM_ZOOMIN : APP.h
  • IDM_ZOOMOUT : APP.h
  • IDNEW : Resource.h
  • IDNO : winres.h
  • IDOK : winres.h
  • IDOK2 : Resource.h
  • IDP_TABS : resource.h
  • idPopup : STATBAR.c
  • IDQUERY : Resource.h
  • IDR_ACCELERATOR1 : Resource.h
  • IDR_ACCELERATOR2 : Resource.h
  • IDR_ACCELERATOR3 : Resource.h
  • IDR_ACCELERATOR4 : Resource.h
  • IDR_ACCELERATOR5 : Resource.h
  • IDR_ACCELERATORS : Resource.h , resource.h , Resource.h
  • IDR_ACCELS : resource.h , Resource.h
  • IDR_Account : resource.h , Resource.h
  • IDR_ACCOUNT : resource.h
  • IDR_Account : Resource.h
  • IDR_ADOCOMPONENT : Resource.h
  • IDR_ADsError : resource.h
  • IDR_ALL_ROWS : resource.h
  • IDR_ANNOTATOR : resource.h
  • IDR_APITYPE : Resource.h
  • IDR_APPICON : resource.h
  • IDR_AUTHENTICATEADMIN : resource.h
  • IDR_AUTHENTICATECONTEXT : resource.h
  • IDR_AUTHENTICATEPLUGIN : resource.h
  • IDR_BEHAVIOR : Resource.h
  • IDR_BLOB_SIZE : resource.h
  • IDR_BR_GIF : resource.h
  • IDR_BROWSE_PROPERTY : resource.h
  • IDR_BROWSERHOST : resource.h
  • IDR_BYOTTRANSOBJ : Resource.h
  • IDR_CASCADE : resource.h
  • IDR_CEnumStorageResource : resource.h
  • IDR_CMgdResType : Resource.h
  • IDR_COLOR_MENU : Resource.h
  • IDR_COLUMNCOUNT : resource.h
  • IDR_COLUMNWIDTHS : resource.h
  • IDR_Computer : resource.h
  • IDR_COMSPY : Resource.h
  • IDR_ComSpy : Resource.h
  • IDR_COMSpy1 : Resource.h
  • IDR_COMSPYPROPPAGE : Resource.h
  • IDR_COMSPYSQLAUDIT : Resource.h
  • IDR_COMSYNCTEST : Resource.h
  • IDR_CONTEXTMENU : Resource.h
  • IDR_CONTEXTPLUGIN : Resource.h
  • IDR_CONTEXTSAMPLEPROPPAGE : resource.h
  • IDR_CPartitionInfo : resource.h
  • IDR_CREATETABLE : resource.h
  • IDR_CRMDEBUGCOMPENSATOR : Resource.h
  • IDR_CRMFILESCOMPENSATOR : Resource.h
  • IDR_CRMFILESTEST : Resource.h
  • IDR_CRMFILESWORKER : Resource.h
  • IDR_CRMMONCOMP : Resource.h
  • IDR_CStorageResource : resource.h
  • IDR_CStorageResType : resource.h
  • IDR_DBAUTHADMIN : resource.h
  • IDR_DBAUTHPLUGIN : resource.h
  • IDR_DEVICE_TOOLBAR : resource.h
  • IDR_DIMMER : resource.h
  • IDR_DIMMERSERVICE : resource.h
  • IDR_DXSURFMENU : resource.h
  • IDR_DYNAMIC : resource.h
  • IDR_EAPCFG : Resource.h
  • IDR_EdCommands : resource.h
  • IDR_EdGlyphs : resource.h
  • IDR_EdHost : resource.h
  • IDR_ENLISTTRANSACTION : Resource.h
  • IDR_ENTITY : resource.h
  • IDR_EVENTSINK : Resource.h
  • IDR_FACTORY : Resource.h
  • IDR_FREETEST : Resource.h
  • IDR_FULL : Monkey.h
  • IDR_FULLSERV : resource.h
  • IDR_FullSvr : resource.h
  • IDR_GENERIC : Resource.h
  • IDR_GetReceipt : Resource.h , resource.h , Resource.h
  • IDR_GIFS1 : resource.h
  • IDR_GIFS10 : resource.h
  • IDR_GIFS11 : resource.h
  • IDR_GIFS12 : resource.h
  • IDR_GIFS13 : resource.h
  • IDR_GIFS14 : resource.h
  • IDR_GIFS15 : resource.h
  • IDR_GIFS16 : resource.h
  • IDR_GIFS17 : resource.h
  • IDR_GIFS18 : resource.h
  • IDR_GIFS19 : resource.h
  • IDR_GIFS2 : resource.h
  • IDR_GIFS3 : resource.h
  • IDR_GIFS4 : resource.h
  • IDR_GIFS5 : resource.h
  • IDR_GIFS6 : resource.h
  • IDR_GIFS7 : resource.h
  • IDR_GIFS8 : resource.h
  • IDR_GIFS9 : resource.h
  • IDR_GRID : resource.h
  • IDR_Handler1 : resource.h
  • IDR_HelloWorld : resource.h
  • IDR_HELP : Resource.h
  • IDR_Human : resource.h
  • IDR_ICON : resource.h
  • IDR_INIT_BACKGROUND : Resource.h
  • IDR_INIT_CONTROL : Resource.h
  • IDR_INIT_NO_LAUNCH : Resource.h
  • IDR_INIT_NORMAL : Resource.h
  • IDR_INSERTROW_BUFFERED : resource.h
  • IDR_INSERTROW_IMMEDIATE : resource.h
  • IDR_ISEQ_STREAM : resource.h
  • IDR_LDISP : Resource.h
  • IDR_LGICONS : resource.h , Resource.h , resource.h
  • IDR_LINE : Resource.h
  • IDR_LOGFILE : Resource.h
  • IDR_MAIN_MENU : Resource.h , resource.h
  • IDR_MAINFRAME : Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h
  • IDR_MAINMENU : Resource.h
  • IDR_MENU : Resource.h , resource.h , Resource.h , resource.h , Resource.h
  • IDR_MENU1 : Resource.h , resource.h , Resource.h
  • IDR_MENU2 : Resource.h
  • IDR_MENU_APP : resource.h
  • IDR_MENU_AV : resource.h
  • IDR_MENU_BUDDY : resource.h
  • IDR_MENU_IM : resource.h
  • IDR_MENUBUTTON : resource.h
  • IDR_MENUGC : resource.h
  • IDR_MENUHELP : Resource.h
  • IDR_MENUVIEWPORT : Resource.h
  • IDR_MMCCONTROL : resource.h
  • IDR_MonitorServer : Resource.h
  • IDR_MoveMoney : resource.h , Resource.h
  • IDR_MOVEMONEY : resource.h
  • IDR_MoveMoney : Resource.h
  • IDR_MSOMNIPROV : resource.h
  • IDR_MULTICTYPE : resource.h
  • IDR_MYCAPABILITIES : Resource.h
  • IDR_MYEVICTLISTENER : resource.h
  • IDR_MYMEMBERSETCHANGELISTENER : resource.h
  • IDR_MYSTARTUPLISTENER : resource.h
  • IDR_NEWSEVENT : resource.h
  • IDR_NOTIFY : Resource.h
  • IDR_OLEDBCOMPONENT : Resource.h
  • IDR_OPBank : resource.h
  • IDR_ORDER : Resource.h
  • IDR_PARAM_SETS : resource.h
  • IDR_PINGRESP : Resource.h
  • IDR_PLG_TEST : resource.h
  • IDR_POINT : Resource.h
  • IDR_PoolTest : Resource.h
  • IDR_PRINTJOB : resource.h
  • IDR_PRINTSTYPE : Resource.h
  • IDR_PRIVOBJ_ACC : Resource.h
  • IDR_PROXY : resource.h
  • IDR_PROXYPLUGIN : Resource.h
  • IDR_PTLAUNCHER : resource.h
  • IDR_RDOCOMPONENT : Resource.h
  • IDR_RESOLUTIONS : Resource.h
  • IDR_RESULTSET : resource.h
  • IDR_ROW_COUNT : resource.h
  • IDR_ROWSETVIEWER : resource.h
  • IDR_SampleMSP : Resource.h
  • IDR_SDKSAMPLEPLAYLISTPARSER : resource.h
  • IDR_SDKSAMPLESTORAGESYSTEM : resource.h
  • IDR_Server : Resource.h
  • IDR_SHIP : Resource.h
  • IDR_SHIP2 : Resource.h
  • IDR_SHOWEVENTS : Resource.h
  • IDR_SMICONS : resource.h , Resource.h , resource.h
  • IDR_SNAP : resource.h
  • IDR_SPYCON : Resource.h
  • IDR_SPYMENU : Resource.h
  • IDR_STATE_MENU : resource.h
  • IDR_STATEST : Resource.h
  • IDR_STATIC_TOOLBAR : resource.h
  • IDR_STATMESSAGEMAP : Resource.h
  • IDR_Test1 : Resource.h
  • IDR_TESTTYPE : Resource.h
  • IDR_TOOLBAR1 : resource.h
  • IDR_TOOLBAR_MAIN : Resource.h
  • IDR_TRANSACTIONMENU : resource.h
  • IDR_TRIMMED : Monkey.h
  • IDR_TXSINK : Resource.h
  • IDR_UpdateReceipt : Resource.h , resource.h , Resource.h
  • IDR_UpdateReceipt1 : Resource.h , resource.h
  • IDR_UPLOADSAMPLE : resource.h
  • IDR_UPNPDIMMERDEVICE : resource.h
  • IDR_USAGE : QSample.Hxx
  • IDR_VCSECURITYSAMPLECLASS : Resource.h
  • IDR_VFILE_TOOLBAR : resource.h
  • IDR_WAVEHEAD : resource.h
  • IDR_XMLTREE : resource.h
  • IDRETRY : winres.h
  • IDS : StdAfx.h
  • IDS_AAFMT : Resource.h
  • IDS_ABORT : wdiffrc.h
  • IDS_ABORT_PENDING : wdiffrc.h
  • IDS_ABORTSTRING : Dibdll.h
  • IDS_ABOUTBOX : resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h
  • IDS_ABOUTNAME : resource.h , Resource.h , resource.h
  • IDS_ACCOUNT_DESC : Resource.h , resource.h , Resource.h
  • IDS_ACKNOWLEDGED : resource.h
  • IDS_ADDCMNTFAIL : MfEdit.h
  • IDS_ADSERROR_DESC : resource.h
  • IDS_ALDUSMF : MfEdit.h
  • IDS_ALLFILES : resource.h
  • IDS_ALLOCFAIL : SpinCube.h
  • IDS_ALLOCPALFAIL : MfEdit.h
  • IDS_ALLOW_MSI_UPDATE : resource.h
  • IDS_ALLRESOURCES_MENU_ITEM_1 : resource.h
  • IDS_ALLRESOURCES_MENU_ITEM_1_DESC : resource.h
  • IDS_ALLRESTYPES_MENU_ITEM_1 : resource.h
  • IDS_ALLRESTYPES_MENU_ITEM_1_DESC : resource.h
  • IDS_ALREADYFINISHED : resource.h
  • IDS_ALREADYFINISHEDCAPTION : resource.h
  • IDS_ANIMATIONS_LABEL : Resource.h
  • IDS_ANSIFONT : APP.h
  • IDS_API_FAILED_MSG : Deb.h
  • IDS_APP_NAME : resource.h
  • IDS_APP_TITLE : Generic.H , resource.h , Resource.h , LeakyBin.h , Resource.h , StatList.h , resource.h
  • IDS_APPERR : MciPlay.h
  • IDS_APPINITFAILED : AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h , LocServe.h , ExeSkel.h , AptClien.h
  • IDS_APPLY_PARAM_CHANGES_ERROR : resource.h
  • IDS_APPNAME : Demo.h , MciPlay.h , MidiPlyr.h , GLOBALS.h , Globals.h , Deb.h
  • IDS_APPTITLE : Resource.h
  • IDS_APPTITLEMASK : MidiPlyr.h
  • IDS_ASK_SAVE : DComDraw.h , RESDEF.h , StoClien.h
  • IDS_ASKDOMSRVNM : Resource.h
  • IDS_ASKSELPRT : Resource.h
  • IDS_ASSERT_FAIL : AptClien.h , ComObjI.h , ComUser.h , ConClien.h , Server.h , DcdServe.h , DComDraw.h , DllClien.h , DllSkelI.h , DllUser.h , ExeSkel.h , Server.h , LicClien.h , Server.h , LocServe.h , RESDEF.h , ReadTut.h , register.h , RemClien.h , StoClien.h , Server.h , FreClien.h , LocClien.h , AptServe.h
  • IDS_AUTHOR : resrc1.h
  • IDS_BAD_ARGUMENT : wdiffrc.h
  • IDS_BAD_SD_INI : wdiffrc.h
  • IDS_BAD_TABWIDTH : wdiffrc.h
  • IDS_BANDNMBR : Dibdll.h
  • IDS_BANNER_TEXT : resource.h
  • IDS_BIKE_TITLE : resource.h
  • IDS_BITMAP_WINDOW_TITLE : resource.h
  • IDS_BLANKPG : Resource.h
  • IDS_BMPFILTERSTRING : Resource.h
  • IDS_BOTH_UNREADABLE : wdiffrc.h
  • IDS_BR_GLYPHSTRING : resource.h
  • IDS_BROWSE : OleStd.h
  • IDS_BUFFERTOOSMALL : ComDlg32.h , Resource.h
  • IDS_BUTTON_ATTACH : Deb.h
  • IDS_BUTTON_COPY : Deb.h
  • IDS_BUTTON_CUT : Deb.h
  • IDS_BUTTON_DELETE : Deb.h
  • IDS_BUTTON_HELP : Deb.h
  • IDS_BUTTON_OPEN : Deb.h
  • IDS_BUTTONTEXT : Resource.h
  • IDS_BYTEFORMAT : resource.h
  • IDS_BZRESULTTEXTBUSY : OleStd.h
  • IDS_BZRESULTTEXTNOTRESPONDING : OleStd.h
  • IDS_CANCEL : resource.h
  • IDS_CANCELCAPTION : resource.h
  • IDS_CANCELLED : resource.h
  • IDS_CANCELTEXT : resource.h
  • IDS_CANDCLASS : FullIME.h
  • IDS_CANDTITLE : FullIME.h
  • IDS_CANDUI : FullIME.h
  • IDS_CANT_OPEN : wdiffrc.h
  • IDS_CANT_OPEN_TMP_FILE : wdiffrc.h
  • IDS_CANTADDTOFILTER : resrc1.h
  • IDS_CANTALLOCMEM : resrc1.h
  • IDS_CANTCAPWNDW : Resource.h
  • IDS_CANTCONVERTTOUNICODE : QSample.Hxx
  • IDS_CANTCREATEFILTER : resrc1.h
  • IDS_CANTDISPLAYSTATUS : QSample.Hxx
  • IDS_CANTFINDCATALOG : QSample.Hxx
  • IDS_CANTFINDPIPE : Client32.h
  • IDS_CANTGETFILESIZE : QSample.Hxx
  • IDS_CANTGETMEMORY : QSample.Hxx
  • IDS_CANTOPENFILE : QSample.Hxx
  • IDS_CANTOPENKEY : Monkey.h
  • IDS_CANTREADFROMFILE : QSample.Hxx
  • IDS_CANTSAVE : Resource.h
  • IDS_CAPTEDALREADY : Resource.h
  • IDS_CAPTION : Resource.h
  • IDS_CAPTURE_STREAM : Resource.h
  • IDS_CERTENCODEALTNAME_DESC : Resource.h
  • IDS_CERTENCODEBITSTRING_DESC : Resource.h
  • IDS_CERTENCODECRLDIST_DESC : Resource.h
  • IDS_CERTENCODEDATEARRAY_DESC : Resource.h
  • IDS_CERTENCODELONGARRAY_DESC : Resource.h
  • IDS_CERTENCODESTRINGARRAY_DESC : Resource.h
  • IDS_CERTEXIT_DESC : resource.h , Resource.h
  • IDS_CERTMANAGEEXITMODULE_DESC : resource.h , Resource.h
  • IDS_CERTMANAGEPOLICYMODULE_DESC : resource.h , Resource.h
  • IDS_CERTPOLICY_DESC : resource.h , Resource.h
  • IDS_CHANGEADDITIONALLINKS : OleStd.h
  • IDS_CHANGESOURCE : OleStd.h
  • IDS_CHOOSER_INVALID_COMPUTERNAME : resource.h
  • IDS_CIFILEACCESS : OleStd.h
  • IDS_CIFILEOPENFAIL : OleStd.h
  • IDS_CIFILESHARE : OleStd.h
  • IDS_CIINVALIDFILE : OleStd.h
  • IDS_CINOICONSINFILE : OleStd.h
  • IDS_CLASS : FullIME.h , HalfIME.h
  • IDS_CLASSFRAME : Resource.h
  • IDS_CLASSNAME : APP.h
  • IDS_CLASSVIEWPORT : Resource.h
  • IDS_CLIENTDBG : Client32.h
  • IDS_CLOSE : OleStd.h
  • IDS_CLOSECAPTION : resource.h
  • IDS_CLOSETEXT : resource.h
  • IDS_CLSID : Resource.h
  • IDS_CLUADMEX_COMOBJ_DESC : resource.h
  • IDS_CLUSCFG_ERROR_CONFIGURING_RESTYPE_FAILED : Resource.h
  • IDS_CLUSCFG_ERROR_GETCOMPUTERNAME_FAILED : Resource.h
  • IDS_CLUSCFG_INFO_CONFIGURED_RESTYPE : Resource.h
  • IDS_CLUSCFG_INFO_CONFIGURING_RESTYPE : Resource.h
  • IDS_CLUSTER_MENU_ITEM_1 : resource.h
  • IDS_CLUSTER_MENU_ITEM_1_DESC : resource.h
  • IDS_CNVEMFTO3X : MfEdit.h
  • IDS_CNVFAIL : MfEdit.h
  • IDS_COLONE : resrc1.h
  • IDS_COLUMN1 : resource.h , Resource.h
  • IDS_COLUMN2 : resource.h , Resource.h
  • IDS_COLUMN3 : resource.h
  • IDS_COLUMN4 : resource.h
  • IDS_COLUMN5 : resource.h
  • IDS_COLUMN6 : resource.h
  • IDS_COLZERO : resrc1.h
  • IDS_COMINITFAILED : AptClien.h , AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllSkelI.h , DllUser.h , ExeSkel.h , LicClien.h , LocClien.h , LocServe.h , ReadTut.h , register.h , RemClien.h , StoClien.h , FreClien.h , RESDEF.h , DllClien.h
  • IDS_COMMAND_PROPERTIES : Resource.h
  • IDS_COMMENT : resrc1.h
  • IDS_COMMENT_GLYPHSTRING : resource.h
  • IDS_COMPARING : wdiffrc.h
  • IDS_COMPTITLE : FullIME.h
  • IDS_COMPUTER_BROWSER_CAPTION : resource.h
  • IDS_COMPUTER_DESC : resource.h
  • IDS_CONFIG_TAB : Resource.h
  • IDS_CONFIG_TITLE : Resource.h
  • IDS_CONFIGURED_EXTENSION : resource.h
  • IDS_CONFIGURED_RESTYPE : resource.h
  • IDS_CONFIGURING_RESTYPE : resource.h
  • IDS_CONFIGURING_RESTYPE_FAILED : resource.h
  • IDS_CONNECTBROKEN : Client32.h
  • IDS_CONNECTING : resource.h
  • IDS_CONTEXTSAMPLE_CONTEXT_TYPES_LABEL : resource.h
  • IDS_CONTEXTSAMPLE_OUTPUT_PATH_LABEL : resource.h
  • IDS_COPY : Resource.h
  • IDS_COPY_ABORTED : wdiffrc.h
  • IDS_COPY_COMPLETE : wdiffrc.h
  • IDS_COPY_FAILED : wdiffrc.h
  • IDS_COPY_FILES : wdiffrc.h
  • IDS_COPYING : wdiffrc.h
  • IDS_COPYING_NFILES : wdiffrc.h
  • IDS_COULDNT_FIND : wdiffrc.h
  • IDS_COULDNT_FIND_ANYTHING : wdiffrc.h
  • IDS_CPY3XMFTOCLP : MfEdit.h
  • IDS_CPYEMFTOCLP : MfEdit.h
  • IDS_CPYPALFAIL : MfEdit.h
  • IDS_CREATE_DIFF_LIST : wdiffrc.h
  • IDS_CREATEBITMAPFAIL : SpinCube.h
  • IDS_CREATEDCFAIL : SpinCube.h
  • IDS_CREATEICFAILURE : ComDlg32.h , Resource.h
  • IDS_CREMAPFILEFAIL : MfEdit.h
  • IDS_CREMFDCFAIL : MfEdit.h
  • IDS_CREPALFAIL : MfEdit.h
  • IDS_CREPBYTEFAIL : MfEdit.h
  • IDS_CREPNTFAIL : MfEdit.h
  • IDS_CREPRTDCFAIL : MfEdit.h
  • IDS_CREPRTTHRDFAIL : MfEdit.h
  • IDS_CUT : Resource.h
  • IDS_CVRESULTACTIVATEAS : OleStd.h
  • IDS_CVRESULTACTIVATEDIFF : OleStd.h
  • IDS_CVRESULTCONVERTLINK : OleStd.h
  • IDS_CVRESULTCONVERTTO : OleStd.h
  • IDS_CVRESULTDISPLAYASICON : OleStd.h
  • IDS_CVRESULTNOCHANGE : OleStd.h
  • IDS_DAYSFORMAT : resource.h
  • IDS_DBGTITLE : Monkey.h
  • IDS_DBPROP_ABORTPRESERVE : resource.h
  • IDS_DBPROP_ACTIVESESSIONS : resource.h
  • IDS_DBPROP_APPENDONLY : resource.h
  • IDS_DBPROP_ASYNCTXNABORT : resource.h
  • IDS_DBPROP_ASYNCTXNCOMMIT : resource.h
  • IDS_DBPROP_AUTH_CACHE_AUTHINFO : resource.h
  • IDS_DBPROP_AUTH_ENCRYPT_PASSWORD : resource.h
  • IDS_DBPROP_AUTH_INTEGRATED : resource.h
  • IDS_DBPROP_AUTH_MASK_PASSWORD : resource.h
  • IDS_DBPROP_AUTH_PASSWORD : resource.h
  • IDS_DBPROP_AUTH_PERSIST_ENCRYPTED : resource.h
  • IDS_DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO : resource.h
  • IDS_DBPROP_AUTH_USERID : resource.h
  • IDS_DBPROP_BLOCKINGSTORAGEOBJECTS : resource.h
  • IDS_DBPROP_BOOKMARKS : resource.h
  • IDS_DBPROP_BOOKMARKSKIPPED : resource.h
  • IDS_DBPROP_BOOKMARKTYPE : resource.h
  • IDS_DBPROP_BYREFACCESSORS : resource.h
  • IDS_DBPROP_CANFETCHBACKWARDS : resource.h
  • IDS_DBPROP_CANHOLDROWS : resource.h
  • IDS_DBPROP_CANSCROLLBACKWARDS : resource.h
  • IDS_DBPROP_CATALOGLOCATION : resource.h
  • IDS_DBPROP_CATALOGTERM : resource.h
  • IDS_DBPROP_CATALOGUSAGE : resource.h
  • IDS_DBPROP_CHANGEINSERTEDROWS : resource.h
  • IDS_DBPROP_COLUMNDEFINITION : resource.h
  • IDS_DBPROP_COLUMNRESTRICT : resource.h
  • IDS_DBPROP_COMMANDTIMEOUT : resource.h
  • IDS_DBPROP_COMMITPRESERVE : resource.h
  • IDS_DBPROP_CONCATNULLBEHAVIOR : resource.h
  • IDS_DBPROP_DATASOURCENAME : resource.h
  • IDS_DBPROP_DATASOURCEREADONLY : resource.h
  • IDS_DBPROP_DBMSNAME : resource.h
  • IDS_DBPROP_DBMSVER : resource.h
  • IDS_DBPROP_DELAYSTORAGEOBJECTS : resource.h
  • IDS_DBPROP_DSOTHREADMODEL : resource.h
  • IDS_DBPROP_GROUPBY : resource.h
  • IDS_DBPROP_HETEROGENEOUSTABLES : resource.h
  • IDS_DBPROP_IAccessor : resource.h
  • IDS_DBPROP_IColumnsInfo : resource.h
  • IDS_DBPROP_IColumnsRowset : resource.h
  • IDS_DBPROP_IConnectionPointContainer : resource.h
  • IDS_DBPROP_IConvertType : resource.h
  • IDS_DBPROP_IDENTIFIERCASE : resource.h
  • IDS_DBPROP_IMMOBILEROWS : resource.h
  • IDS_DBPROP_INIT_DATASOURCE : resource.h
  • IDS_DBPROP_INIT_HWND : resource.h
  • IDS_DBPROP_INIT_IMPERSONATION_LEVEL : resource.h
  • IDS_DBPROP_INIT_LCID : resource.h
  • IDS_DBPROP_INIT_LOCATION : resource.h
  • IDS_DBPROP_INIT_MODE : resource.h
  • IDS_DBPROP_INIT_OLEDBSERVICES : resource.h
  • IDS_DBPROP_INIT_PROMPT : resource.h
  • IDS_DBPROP_INIT_PROTECTION_LEVEL : resource.h
  • IDS_DBPROP_INIT_PROVIDERSTRING : resource.h
  • IDS_DBPROP_INIT_TIMEOUT : resource.h
  • IDS_DBPROP_IProvideMoniker : resource.h
  • IDS_DBPROP_IRowset : resource.h
  • IDS_DBPROP_IRowsetChange : resource.h
  • IDS_DBPROP_IRowsetIdentity : resource.h
  • IDS_DBPROP_IRowsetInfo : resource.h
  • IDS_DBPROP_IRowsetLocate : resource.h
  • IDS_DBPROP_IRowsetResynch : resource.h
  • IDS_DBPROP_IRowsetScroll : resource.h
  • IDS_DBPROP_IRowsetUpdate : resource.h
  • IDS_DBPROP_ISequentialStream : resource.h
  • IDS_DBPROP_ISupportErrorInfo : resource.h
  • IDS_DBPROP_LITERALBOOKMARKS : resource.h
  • IDS_DBPROP_LITERALIDENTITY : resource.h
  • IDS_DBPROP_LOCKMODES : resource.h
  • IDS_DBPROP_MAXINDEXSIZE : resource.h
  • IDS_DBPROP_MAXOPENROWS : resource.h
  • IDS_DBPROP_MAXPENDINGROWS : resource.h
  • IDS_DBPROP_MAXROWS : resource.h
  • IDS_DBPROP_MAXROWSIZE : resource.h
  • IDS_DBPROP_MAXROWSIZEINCLUDESBLOB : resource.h
  • IDS_DBPROP_MAXTABLESINSELECT : resource.h
  • IDS_DBPROP_MULTIPLEPARAMSETS : resource.h
  • IDS_DBPROP_MULTIPLERESULTS : resource.h
  • IDS_DBPROP_MULTIPLESTORAGEOBJECTS : resource.h
  • IDS_DBPROP_MULTITABLEUPDATE : resource.h
  • IDS_DBPROP_NOTIFICATIONPHASES : resource.h
  • IDS_DBPROP_NOTIFYCOLUMNSET : resource.h
  • IDS_DBPROP_NOTIFYROWDELETE : resource.h
  • IDS_DBPROP_NOTIFYROWFIRSTCHANGE : resource.h
  • IDS_DBPROP_NOTIFYROWINSERT : resource.h
  • IDS_DBPROP_NOTIFYROWRESYNCH : resource.h
  • IDS_DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE : resource.h
  • IDS_DBPROP_NOTIFYROWSETRELEASE : resource.h
  • IDS_DBPROP_NOTIFYROWUNDOCHANGE : resource.h
  • IDS_DBPROP_NOTIFYROWUNDODELETE : resource.h
  • IDS_DBPROP_NOTIFYROWUNDOINSERT : resource.h
  • IDS_DBPROP_NOTIFYROWUPDATE : resource.h
  • IDS_DBPROP_NULLCOLLATION : resource.h
  • IDS_DBPROP_OLEOBJECTS : resource.h
  • IDS_DBPROP_ORDERBYCOLUMNSINSELECT : resource.h
  • IDS_DBPROP_ORDEREDBOOKMARKS : resource.h
  • IDS_DBPROP_OTHERINSERT : resource.h
  • IDS_DBPROP_OTHERUPDATEDELETE : resource.h
  • IDS_DBPROP_OUTPUTPARAMETERAVAILABILITY : resource.h
  • IDS_DBPROP_OWNINSERT : resource.h
  • IDS_DBPROP_OWNUPDATEDELETE : resource.h
  • IDS_DBPROP_PERSISTENTIDTYPE : resource.h
  • IDS_DBPROP_PREPAREABORTBEHAVIOR : resource.h
  • IDS_DBPROP_PREPARECOMMITBEHAVIOR : resource.h
  • IDS_DBPROP_PROCEDURETERM : resource.h
  • IDS_DBPROP_PROVIDERNAME : resource.h
  • IDS_DBPROP_PROVIDEROLEDBVER : resource.h
  • IDS_DBPROP_PROVIDERVER : resource.h
  • IDS_DBPROP_QUICKRESTART : resource.h
  • IDS_DBPROP_QUOTEDIDENTIFIERCASE : resource.h
  • IDS_DBPROP_REENTRANTEVENTS : resource.h
  • IDS_DBPROP_REMOVEDELETED : resource.h
  • IDS_DBPROP_REPORTMULTIPLECHANGES : resource.h
  • IDS_DBPROP_RETURNPENDINGINSERTS : resource.h
  • IDS_DBPROP_ROWRESTRICT : resource.h
  • IDS_DBPROP_ROWSETCONVERSIONSONCOMMAND : resource.h
  • IDS_DBPROP_ROWTHREADMODEL : resource.h
  • IDS_DBPROP_SCHEMATERM : resource.h
  • IDS_DBPROP_SCHEMAUSAGE : resource.h
  • IDS_DBPROP_SERVERCURSOR : resource.h
  • IDS_DBPROP_SESS_AUTOCOMMITISOLEVELS : resource.h
  • IDS_DBPROP_SQLSUPPORT : resource.h
  • IDS_DBPROP_STRONGIDENTITY : resource.h
  • IDS_DBPROP_STRUCTUREDSTORAGE : resource.h
  • IDS_DBPROP_SUBQUERIES : resource.h
  • IDS_DBPROP_SUPPORTEDTXNDDL : resource.h
  • IDS_DBPROP_SUPPORTEDTXNISOLEVELS : resource.h
  • IDS_DBPROP_SUPPORTEDTXNISORETAIN : resource.h
  • IDS_DBPROP_TABLETERM : resource.h
  • IDS_DBPROP_TRANSACTEDOBJECT : resource.h
  • IDS_DBPROP_UPDATABILITY : resource.h
  • IDS_DBPROP_USERNAME : resource.h
  • IDS_DEBUG : Monkey.h
  • IDS_DEBUG_EVENTS : Deb.h
  • IDS_DEBUGINFO : Server32.h
  • IDS_DEBUGLAST : Server32.h
  • IDS_DEBUGTITLE : Client32.h , Server32.h
  • IDS_DEFAULT_PRODUCT : resource.h
  • IDS_DEFICONLABEL : OleStd.h
  • IDS_DELETE : Resource.h
  • IDS_DESCRIPTION : Globals.h , Resource.h , resrc1.h , GLOBALS.h , Resource.h
  • IDS_DIALOGFAILURE : ComDlg32.h , Resource.h
  • IDS_DIFF_BLANK_ONLY : wdiffrc.h
  • IDS_DIFFERENT : wdiffrc.h
  • IDS_DIFFERING : wdiffrc.h
  • IDS_DISK : resource.h
  • IDS_DISPLAY : Resource.h
  • IDS_DISPLAYCHANGED : LeakyBin.h , Generic.H , StatList.h
  • IDS_DISPLAYERRORCODE : resource.h
  • IDS_DLGABOUTCREFAIL : MfEdit.h
  • IDS_DLGBOXFAIL : SpinCube.h
  • IDS_DLLINITFAILED : DllSkelI.h
  • IDS_DLLNAME : Resource.h
  • IDS_DLLREG_FAIL : register.h
  • IDS_DLLUNREG_FAIL : register.h
  • IDS_DNDMMISMATCH : Resource.h , ComDlg32.h
  • IDS_DOCSTRINGComSpyPropPage : Resource.h
  • IDS_DOCSTRINGContextSamplePropPage : resource.h
  • IDS_DOCUMENTTYPE : Resource.h
  • IDS_DOWNLOADING_PACKAGE : resource.h
  • IDS_DOWNLOADING_UPDATE : resource.h
  • IDS_DRAW_PAGE : RESDEF.h
  • IDS_DRAWING_CHANGED : DComDraw.h , StoClien.h
  • IDS_DRAWSFCLR : MfEdit.h
  • IDS_E_UNEXPECTED : Resource.h
  • IDS_EDITMENU : GLOBALS.h
  • IDS_EDITOR_COMMAND : wdiffrc.h
  • IDS_ELLIPSE : MfEdit.h
  • IDS_EMF : MfEdit.h
  • IDS_EMPTYVC_SUBKEY : Resource.h
  • IDS_ENTER_DIR_NAME : wdiffrc.h
  • IDS_ENTER_PASSWORD : wdiffrc.h
  • IDS_ENTER_SUBSTRING1 : wdiffrc.h
  • IDS_ENTER_SUBSTRING2 : wdiffrc.h
  • IDS_ENTIRESCRN : Resource.h
  • IDS_ENUMELEMENTSFAILED : DfV.h
  • IDS_ENUMPRT1FAIL : Resource.h
  • IDS_ENUMPRTDRVRET0 : Resource.h
  • IDS_ENUMPRTFAIL : Resource.h
  • IDS_ENUMPRTLALLOCFAIL : Resource.h
  • IDS_ENUMSTATSTGFAILED : DfV.h
  • IDS_ENUMSTORAGERESOURCE_DESC : resource.h
  • IDS_ERR_ADDSTRING : OleStd.h
  • IDS_ERR_ENUMPRT : Resource.h
  • IDS_ERR_GETCAPS : Resource.h
  • IDS_ERR_GETLINKSOURCE : OleStd.h
  • IDS_ERR_GETLINKUPDATEOPTIONS : OleStd.h
  • IDS_ERR_GETPDRIV : Resource.h
  • IDS_ERR_OPENING_FILE : wdiffrc.h
  • IDS_ERR_PAINT : Resource.h
  • IDS_ERR_PRINTER : Resource.h
  • IDS_ERROR : resource.h , DfV.h , MfEdit.h
  • IDS_ERROR_CANTLOADRICHEDIT : wdiffrc.h
  • IDS_ERROR_DISK_CLUSTER_CAPABLE : resource.h
  • IDS_ERROR_DISK_CLUSTER_CAPABLE_REF : resource.h
  • IDS_ERROR_DISK_NO_FILE_SYSTEM : resource.h
  • IDS_ERROR_DISK_NO_FILE_SYSTEM_REF : resource.h
  • IDS_ERROR_DISK_SIGNATURE : resource.h
  • IDS_ERROR_DISK_SIGNATURE_REF : resource.h
  • IDS_ERROR_FOUND_NON_SCSI_DISK : resource.h
  • IDS_ERROR_FOUND_NON_SCSI_DISK_REF : resource.h
  • IDS_ERROR_GET_IMAGE_DLG : resource.h
  • IDS_ERROR_GETCOMPUTERNAME_FAILED : resource.h
  • IDS_ERROR_IARGS : wdiffrc.h
  • IDS_ERROR_IARGS_OPENFILE : wdiffrc.h
  • IDS_ERROR_INVALIDARG : resource.h
  • IDS_ERROR_INVALIDARG_REF : resource.h
  • IDS_ERROR_L_OPTION : wdiffrc.h
  • IDS_ERROR_LD_OPTION : wdiffrc.h
  • IDS_ERROR_LDM_DISK : resource.h
  • IDS_ERROR_LDM_DISK_REF : resource.h
  • IDS_ERROR_LO_UNC : wdiffrc.h
  • IDS_ERROR_MSG_ID : resource.h
  • IDS_ERROR_NO_INTERFACE : resource.h
  • IDS_ERROR_NULL_POINTER : resource.h
  • IDS_ERROR_NULL_POINTER_REF : resource.h
  • IDS_ERROR_OUTOFMEMORY : resource.h
  • IDS_ERROR_OUTOFMEMORY_REF : resource.h
  • IDS_ERROR_OVSD_OPTION : wdiffrc.h
  • IDS_ERROR_SETTING_PROPERTIES : resource.h
  • IDS_ERROR_TITLE : register.h , ReadTut.h
  • IDS_ERROR_VALIDATING_PROPERTIES : resource.h
  • IDS_ERROR_WBEM_CONNECTION_FAILURE : resource.h
  • IDS_ERROR_WBEM_CONNECTION_FAILURE_REF : resource.h
  • IDS_ERROR_WMI_DISKDRIVEPARTITIONS_QRY_FAILED : resource.h
  • IDS_ERROR_WMI_DISKDRIVEPARTITIONS_QRY_FAILED_REF : resource.h
  • IDS_ERROR_WMI_DISKS_QRY_FAILED : resource.h
  • IDS_ERROR_WMI_DISKS_QRY_FAILED_REF : resource.h
  • IDS_ERROR_WMI_GET_LOGICALDISK_FAILED : resource.h
  • IDS_ERROR_WMI_GET_LOGICALDISK_FAILED_REF : resource.h
  • IDS_ERROR_WQL_QRY_NEXT_FAILED : resource.h
  • IDS_ERROR_WQL_QRY_NEXT_FAILED_REF : resource.h
  • IDS_ERRORBOXTITLE : resource.h
  • IDS_ERRORCODE : Server32.h
  • IDS_ESCPRT : MfEdit.h
  • IDS_EVENTNAME : resrc1.h
  • IDS_EXEFILTERSTRING : Resource.h
  • IDS_EXERUN_FAIL : register.h
  • IDS_EXIT : wdiffrc.h
  • IDS_EXIT_BOX_TEXT : Deb.h
  • IDS_EXIT_BOX_TITLE : Deb.h
  • IDS_EXPAND : wdiffrc.h
  • IDS_EXPERTNAME : resrc1.h
  • IDS_EXPLORE : Resource.h
  • IDS_EXT_TITLE : Resource.h
  • IDS_FAILED : OleStd.h
  • IDS_FAILED_TO_COPY : wdiffrc.h
  • IDS_FAILED_TO_LAUNCH_EDT : wdiffrc.h
  • IDS_FAILED_TO_UPGRADE_MSI : resource.h
  • IDS_FATALERROR : resource.h
  • IDS_FILE_CHANGED : RESDEF.h
  • IDS_FILE_DOESNT_EXIST : wdiffrc.h
  • IDS_FILEDLGTITLE : resource.h
  • IDS_FILEMENU : GLOBALS.h
  • IDS_FILEOPNFAIL : MfEdit.h
  • IDS_FILES_LISTED : wdiffrc.h
  • IDS_FILLELLIPSE : MfEdit.h
  • IDS_FILLRECT : MfEdit.h
  • IDS_FILTER : Resource.h
  • IDS_FILTERS : OleStd.h
  • IDS_FILTERSTRING : Resource.h , MciPlay.h , ComDlg32.h , Resource.h
  • IDS_FIND_NOTFOUND : wdiffrc.h
  • IDS_FINDRESFAILURE : ComDlg32.h , Resource.h
  • IDS_FM_DIB : MfEdit.h
  • IDS_FM_EMF : MfEdit.h
  • IDS_FM_EPS : MfEdit.h
  • IDS_FM_RLE : MfEdit.h
  • IDS_FM_WMF : MfEdit.h
  • IDS_FMT_CREDCFAIL : Resource.h
  • IDS_FMT_CREMAPFILEFAIL : MfEdit.h
  • IDS_FMT_FILEOPNFAIL : MfEdit.h
  • IDS_FMT_GETMFFAIL : MfEdit.h
  • IDS_FMT_HIT : MfEdit.h
  • IDS_FMT_MAPVWMAPFOFAIL : MfEdit.h
  • IDS_FMT_MOREDSPFNTNL : Resource.h
  • IDS_FMT_NOHTST : MfEdit.h
  • IDS_FMT_OPNPRTFAIL : Resource.h
  • IDS_FMT_PLAYEMFFAIL : MfEdit.h
  • IDS_FMT_PLAYMF : MfEdit.h
  • IDS_FMT_PLAYMFFAIL : MfEdit.h
  • IDS_FMT_SETWMFBTSFAIL : MfEdit.h
  • IDS_FMT_SETWMFBTSXFAIL : MfEdit.h
  • IDS_FOLDER : Resource.h
  • IDS_FOLDER_DATA : Resource.h
  • IDS_FOREGROUND : resource.h
  • IDS_FROM_DSN : resource.h
  • IDS_FT_DIB : MfEdit.h
  • IDS_FT_EMF : MfEdit.h
  • IDS_FT_EPS : MfEdit.h
  • IDS_FT_RLE : MfEdit.h
  • IDS_FT_WMF : MfEdit.h
  • IDS_GENERALERROR : Client32.h
  • IDS_GESTURE_UNKNOWN : resource.h
  • IDS_GET3XFRMCLPFAIL : MfEdit.h
  • IDS_GETBNDBOTFAIL : MfEdit.h
  • IDS_GETBNDLFTFAIL : MfEdit.h
  • IDS_GETBNDRGTFAIL : MfEdit.h
  • IDS_GETBNDTOPFAIL : MfEdit.h
  • IDS_GETDCFAIL : Resource.h
  • IDS_GETDEVMODEFAIL : ComDlg32.h , Resource.h
  • IDS_GETEMFFROMCLPFAIL : MfEdit.h
  • IDS_GETIAUDIO : Resource.h
  • IDS_GETMFBTSXFAIL : MfEdit.h
  • IDS_GETMFBTSXFAIL2 : MfEdit.h
  • IDS_GETPRTDRVFAIL : Resource.h
  • IDS_GETRECEIPT_DESC : resource.h , Resource.h
  • IDS_GETWMFBTSFAIL : MfEdit.h
  • IDS_GETWMFBTSFAIL2 : MfEdit.h
  • IDS_GETWMFBTSFAIL2X : MfEdit.h
  • IDS_GIGAFORMAT : resource.h
  • IDS_GLOBALDEV : resource.h , res.h
  • IDS_GOTOLINE_INVALIDSTRING : wdiffrc.h
  • IDS_GOTOLINE_NOLINES : wdiffrc.h
  • IDS_GPT : resource.h
  • IDS_GROUP_MENU_ITEM_1 : resource.h
  • IDS_GROUP_MENU_ITEM_1_DESC : resource.h
  • IDS_H3ABS_GLYPHSTRING : resource.h
  • IDS_H3BGN_GLYPHSTRING : resource.h
  • IDS_H3END_GLYPHSTRING : resource.h
  • IDS_H4_GLYPHSTRING : resource.h
  • IDS_HANDLER_DESC1 : resource.h
  • IDS_HEADER_LINE_STR : wdiffrc.h
  • IDS_HEADERFONT : APP.h
  • IDS_HELLOCOUNTFMT : DllSkelI.h
  • IDS_HELLOTITLE : DllSkelI.h
  • IDS_HELLOWORLD_DESC : resource.h
  • IDS_HELPFILE : resource.h , Resource.h , resource.h
  • IDS_HELPFILEComSpyPropPage : Resource.h
  • IDS_HELPFILEContextSamplePropPage : resource.h
  • IDS_HELPMENU : GLOBALS.h
  • IDS_HFTONEPALNULL : MfEdit.h
  • IDS_HIGH : resource.h
  • IDS_HMS : MidiPlyr.h
  • IDS_HOURSFORMAT : resource.h
  • IDS_HUMAN_DESC : resource.h
  • IDS_IAFMT : Resource.h
  • IDS_ICONFILTERS : OleStd.h
  • IDS_IDENTICAL : wdiffrc.h
  • IDS_IDENTICAL_COMMA : wdiffrc.h
  • IDS_IDENTICAL_TIMES : wdiffrc.h
  • IDS_INCORRECT_UPDATE : resource.h
  • IDS_INFO_BOOTDISK_PRUNED : resource.h
  • IDS_INFO_BOOTDISK_PRUNED_REF : resource.h
  • IDS_INFO_CRASHDUMPDISK_PRUNED : resource.h
  • IDS_INFO_CRASHDUMPDISK_PRUNED_REF : resource.h
  • IDS_INFO_DISK_CLUSTER_CAPABLE : resource.h
  • IDS_INFO_DISK_CREATE : resource.h
  • IDS_INFO_DISK_NOT_CLUSTER_CAPABLE : resource.h
  • IDS_INFO_DISK_NOT_CLUSTER_CAPABLE_REF : resource.h
  • IDS_INFO_DISK_PRECREATE : resource.h
  • IDS_INFO_GPT_DISK : resource.h
  • IDS_INFO_GPT_DISK_REF : resource.h
  • IDS_INFO_NON_SCSI_DISKS : resource.h
  • IDS_INFO_NON_SCSI_DISKS_REF : resource.h
  • IDS_INFO_PAGEFILEDISK_PRUNED : resource.h
  • IDS_INFO_PAGEFILEDISK_PRUNED_REF : resource.h
  • IDS_INFO_PRUNING_BOOTDISK_BUS : resource.h
  • IDS_INFO_PRUNING_CRASHDUMP_BUS : resource.h
  • IDS_INFO_PRUNING_PAGEFILEDISK_BUS : resource.h
  • IDS_INFO_PRUNING_SYSTEMDISK_BUS : resource.h
  • IDS_INFO_SYSTEMDISK_PRUNED : resource.h
  • IDS_INFO_SYSTEMDISK_PRUNED_REF : resource.h
  • IDS_INH_ALL : Resource.h
  • IDS_INH_CONTAINER : Resource.h
  • IDS_INH_NONE : Resource.h
  • IDS_INH_OBJECT : Resource.h
  • IDS_INITAPPFAIL : MfEdit.h
  • IDS_INITFAILURE : ComDlg32.h , Resource.h
  • IDS_INITIALIZATION : Resource.h , ComDlg32.h
  • IDS_INITIALIZING : resrc1.h
  • IDS_INSERTSTRINGFAILED : DfV.h
  • IDS_INSTALL_ERROR : resource.h
  • IDS_INTERROR : Resource.h
  • IDS_INVALID : PlgBlt.h
  • IDS_INVALID_OPERATION : resource.h
  • IDS_INVALID_PATH : resource.h
  • IDS_INVALID_VER_STR : resource.h
  • IDS_INVALIDFILENAME : ComDlg32.h , Resource.h
  • IDS_INVALIDSOURCE : OleStd.h
  • IDS_IORESULTFROMFILE1 : OleStd.h
  • IDS_IORESULTFROMFILE2 : OleStd.h
  • IDS_IORESULTFROMFILEICON2 : OleStd.h
  • IDS_IORESULTLINKFILE1 : OleStd.h
  • IDS_IORESULTLINKFILE2 : OleStd.h
  • IDS_IORESULTLINKFILEICON1 : OleStd.h
  • IDS_IORESULTLINKFILEICON2 : OleStd.h
  • IDS_IORESULTNEW : OleStd.h
  • IDS_IORESULTNEWICON : OleStd.h
  • IDS_IS_MORE_RECENT : wdiffrc.h
  • IDS_IS_READONLY : wdiffrc.h
  • IDS_ITEM : Resource.h
  • IDS_ITEMCONFIG_TAB : Resource.h
  • IDS_JUSTIFICATION_FORMAT : resrc1.h
  • IDS_KILOFORMAT : resource.h
  • IDS_LABELFONT : APP.h
  • IDS_LALLOCFAIL : Resource.h
  • IDS_LDBM : MfEdit.h
  • IDS_LDM : resource.h
  • IDS_LDMF : MfEdit.h
  • IDS_LDMFMTFILEFAIL : MfEdit.h
  • IDS_LDMSK : MfEdit.h
  • IDS_LDMSKBM : MfEdit.h
  • IDS_LEFT_ONLY_COMMA : wdiffrc.h
  • IDS_LEFT_UNREADABLE : wdiffrc.h
  • IDS_LINE_NOT_VISIBLE : wdiffrc.h
  • IDS_LINK_AUTO : OleStd.h
  • IDS_LINK_MANUAL : OleStd.h
  • IDS_LINK_UNKNOWN : OleStd.h
  • IDS_LINKS : OleStd.h
  • IDS_LN : MfEdit.h
  • IDS_LOADACCFAIL : MfEdit.h
  • IDS_LOADBITMAPSFAILED : DfV.h
  • IDS_LOADDRVFAILURE : ComDlg32.h , Resource.h
  • IDS_LOADLIB_FAIL : register.h
  • IDS_LOADRESFAILURE : ComDlg32.h , Resource.h
  • IDS_LOADSTRFAILURE : ComDlg32.h , Resource.h
  • IDS_LOCKRESFAILURE : Resource.h , ComDlg32.h
  • IDS_LOGTO_CLIENT : AptServe.h , LocServe.h
  • IDS_LOGTO_SERVER : LocServe.h , AptServe.h
  • IDS_LONGPROGRESS : resource.h
  • IDS_LOW : resource.h
  • IDS_MACHINE : resrc1.h
  • IDS_MAIN_WINDOW_TITLE : resource.h
  • IDS_MAINWINDOWTITLE : Resource.h
  • IDS_MAINWNDTITLE : Resource.h
  • IDS_MALLOCERR : Monkey.h
  • IDS_MALLOCFAIL : MfEdit.h
  • IDS_MALLOCFAIL2 : MfEdit.h
  • IDS_MALLOCFAILNOHIT : MfEdit.h
  • IDS_MAPFCREFAIL : MfEdit.h
  • IDS_MAPVWMAPFOFAIL : MfEdit.h
  • IDS_MAPVWOFMAPFOFAIL : MfEdit.h
  • IDS_MARK_FILES : wdiffrc.h
  • IDS_MAX : Resource.h , resource.h
  • IDS_MEGAFORMAT : resource.h
  • IDS_MEMALLOCFAILURE : ComDlg32.h , Resource.h
  • IDS_MEMLOCKFAILURE : ComDlg32.h , Resource.h
  • IDS_MEMORY_ALLOC_FAIL : gutilsrc.h
  • IDS_MFDEMOCL : MfEdit.h
  • IDS_MI_COMMAND : Resource.h
  • IDS_MI_FILEITEM : Resource.h
  • IDS_MIN : Resource.h
  • IDS_MINUTESFORMAT : resource.h
  • IDS_MISSING_RESOURCE : resource.h
  • IDS_MODIFY_DATA : Resource.h
  • IDS_MONITORSERVER_DESC : Resource.h
  • IDS_MONOCHROME : PlgBlt.h
  • IDS_MOVEMONEY_DESC : Resource.h , resource.h , Resource.h
  • IDS_MSGCAPTION : APP.h
  • IDS_MSGCHOOSEOPEN : Resource.h
  • IDS_MSGEMPTY : Resource.h
  • IDS_MSGESTURE_FIRST : resource.h
  • IDS_MSGFILE : Resource.h
  • IDS_MSGFILEEXIT : Resource.h
  • IDS_MSGFILEOPENAS : Resource.h
  • IDS_MSGFILEPAGESETUP : Resource.h
  • IDS_MSGFILEPRINT : Resource.h
  • IDS_MSGHELP : Resource.h
  • IDS_MSGHELPABOUT : Resource.h
  • IDS_MSGHELPCONTENTS : Resource.h
  • IDS_MSGREADY : Resource.h
  • IDS_MSGSYS : Resource.h
  • IDS_MSGSYSCLOSE : Resource.h
  • IDS_MSGSYSMAXIMIZE : Resource.h
  • IDS_MSGSYSMINIMIZE : Resource.h
  • IDS_MSGSYSMOVE : Resource.h
  • IDS_MSGSYSRESTORE : Resource.h
  • IDS_MSGSYSSIZE : Resource.h
  • IDS_MSGSYSTASKLIST : Resource.h
  • IDS_MSGTIPFONTDEC : Resource.h
  • IDS_MSGTIPFONTINC : Resource.h
  • IDS_MSGVIEW : Resource.h
  • IDS_MSGVIEWFONT : Resource.h
  • IDS_MSGVIEWSTATUSBAR : Resource.h
  • IDS_MSGVIEWTOOLBAR : Resource.h
  • IDS_MSTLBCLKFORBZ : MfEdit.h
  • IDS_MUIWEB : res.h , resource.h
  • IDS_MULTILINGUAL : res.h , resource.h
  • IDS_MUST3CLKFORBM : MfEdit.h
  • IDS_MUST3CLKFORXMF : MfEdit.h
  • IDS_MUSTESCHTSTMD : MfEdit.h
  • IDS_MUSTMSKMCHROMEBM : MfEdit.h
  • IDS_MUSTNOTEOF : MfEdit.h
  • IDS_NAME : resource.h , Resource.h , resource.h , Monkey.h , resource.h
  • IDS_NETINTERFACE_MENU_ITEM_1 : resource.h
  • IDS_NETINTERFACE_MENU_ITEM_1_DESC : resource.h
  • IDS_NETWORK_MENU_ITEM_1 : resource.h
  • IDS_NETWORK_MENU_ITEM_1_DESC : resource.h
  • IDS_NEW : Resource.h
  • IDS_NEW_FOLDER : Resource.h
  • IDS_NEW_ITEM : Resource.h
  • IDS_NLSWEB : resource.h , res.h
  • IDS_NO_HELP : Generic.H , StatList.h , LeakyBin.h
  • IDS_NO_MORE_CHANGES : wdiffrc.h
  • IDS_NO_PREV_CHANGES : wdiffrc.h
  • IDS_NO_WINTRUST : resource.h
  • IDS_NOBMFOREMBED : MfEdit.h
  • IDS_NOCOMPUNICODE : wdiffrc.h
  • IDS_NODCOM : FreClien.h , DcdServe.h , DComDraw.h , RemClien.h
  • IDS_NODE_MENU_ITEM_1 : resource.h
  • IDS_NODE_MENU_ITEM_1_DESC : resource.h
  • IDS_NODEFAULTPRN : ComDlg32.h , Resource.h
  • IDS_NODEVICES : ComDlg32.h , Resource.h
  • IDS_NODLLSERVER : LicClien.h
  • IDS_NOFILE : MidiPlyr.h
  • IDS_NOFONTS : Resource.h , ComDlg32.h
  • IDS_NOHELP : Resource.h
  • IDS_NOHELPFILE : DllSkelI.h , AptServe.h , DfV.h , DcdServe.h , LocServe.h
  • IDS_NOHINSTANCE : ComDlg32.h , Resource.h
  • IDS_NOHIT : MfEdit.h
  • IDS_NOHOOK : ComDlg32.h , Resource.h
  • IDS_NOHTTPORHTTPS : resource.h
  • IDS_NOIMAGE : Resource.h
  • IDS_NOINFO3XMFX : MfEdit.h
  • IDS_NOLICENSE : LicClien.h
  • IDS_NOLICSERVER : LicClien.h
  • IDS_NOMEM : Demo.h
  • IDS_NOMFFORCPY : MfEdit.h
  • IDS_NOMFFOREMBED : MfEdit.h
  • IDS_NOMFFORPLAY : MfEdit.h
  • IDS_NOMFFORPRT : MfEdit.h
  • IDS_NOMFLDFORHTST : MfEdit.h
  • IDS_NOMFTOPRT : MfEdit.h
  • IDS_NOMSI : resource.h
  • IDS_NONAME : Monkey.h
  • IDS_NOOPEN : MciPlay.h
  • IDS_NOPALENTRYFORCPY : MfEdit.h
  • IDS_NOPRTLST : Resource.h
  • IDS_NORMAL : resource.h
  • IDS_NORUNLICENSE : LicClien.h
  • IDS_NOSERVER : AptClien.h , LocServe.h , RESDEF.h , FreClien.h , DComDraw.h , RemClien.h , ConClien.h , AptServe.h , DcdServe.h , DllClien.h , LocClien.h , StoClien.h
  • IDS_NOTADOBE : MfEdit.h
  • IDS_NOTDIBBMFILE : MfEdit.h
  • IDS_NOTEMPLATE : ComDlg32.h , Resource.h
  • IDS_NOTHING_RESCANNED : wdiffrc.h
  • IDS_NOTHING_TO_EDIT : wdiffrc.h
  • IDS_NOTIMPLEM : APP.h
  • IDS_NOTIMPLEMENTED : AptServe.h , DComDraw.h , DllClien.h , ConClien.h , LicClien.h , ReadTut.h , DllSkelI.h , RESDEF.h , LocServe.h , ComUser.h , StoClien.h , AptClien.h , DcdServe.h , DllUser.h , ExeSkel.h , FreClien.h , LocClien.h , register.h , RemClien.h
  • IDS_NOUNICODE : ConClien.h , AptClien.h , RESDEF.h , RemClien.h , LocClien.h , StoClien.h , DComDraw.h , DcdServe.h , AptServe.h , DllClien.h , FreClien.h , LicClien.h , LocServe.h
  • IDS_NOUPDATE : resource.h
  • IDS_NTONLY : PlgBlt.h , WxForm.h
  • IDS_NULLPTR : MfEdit.h
  • IDS_NULLRGNHTSTFAIL : MfEdit.h
  • IDS_OFN_DEBUGGEE_TITLE : Deb.h
  • IDS_OFN_FILTER : Deb.h
  • IDS_OFN_FILTERNAME : Deb.h
  • IDS_OFN_PAGFILES : RESDEF.h
  • IDS_OFN_PAGOPEN : RESDEF.h
  • IDS_OFN_PAGSAVE : RESDEF.h
  • IDS_OFN_PAPFILES : StoClien.h
  • IDS_OFN_PAPOPEN : StoClien.h
  • IDS_OFN_PAPSAVE : StoClien.h
  • IDS_OFN_TITLE : Deb.h
  • IDS_OLE2UICONVERT : OleStd.h
  • IDS_OLE2UIEDIT : OleStd.h
  • IDS_OLE2UIEDITLINKCMD_1VERB : OleStd.h
  • IDS_OLE2UIEDITLINKCMD_NVERB : OleStd.h
  • IDS_OLE2UIEDITNOOBJCMD : OleStd.h
  • IDS_OLE2UIEDITOBJECTCMD_1VERB : OleStd.h
  • IDS_OLE2UIEDITOBJECTCMD_NVERB : OleStd.h
  • IDS_OLE2UILINK : OleStd.h
  • IDS_OLE2UIOBJECT : OleStd.h
  • IDS_OLE2UIPASTELINKEDTYPE : OleStd.h
  • IDS_OLE2UIUNKNOWN : OleStd.h
  • IDS_OLEINCOMPATIBLE : DfV.h
  • IDS_OLEINITFAILED : DfV.h
  • IDS_OLESTDDISKFULL : OleStd.h
  • IDS_OLESTDNOCREATEFILE : OleStd.h
  • IDS_OLESTDNOOPENFILE : OleStd.h
  • IDS_ONLY_IN : wdiffrc.h
  • IDS_OPEN : Resource.h
  • IDS_OPENDRAWPAGE : RESDEF.h
  • IDS_OPENED : MidiPlyr.h
  • IDS_OPENFAILED : MidiPlyr.h
  • IDS_OPENKEYERR : Monkey.h
  • IDS_OPENSTORAGEFAILED : DfV.h
  • IDS_OPENSTREAMFAILED : DfV.h
  • IDS_OPENTEXTPAGE : RESDEF.h
  • IDS_OS_NOT_SUPPORTED : resource.h
  • IDS_OUT_OF_MEMORY : gutilsrc.h
  • IDS_OUTLINE : wdiffrc.h
  • IDS_OUTOFMEM : resource.h
  • IDS_OUTOFMEMORY : DllUser.h , ExeSkel.h , DllClien.h , register.h , RemClien.h , DcdServe.h , RESDEF.h , StoClien.h , FreClien.h , ComUser.h , LocServe.h , AptServe.h , AptClien.h , DfV.h , ConClien.h , DComDraw.h , DllSkelI.h , LicClien.h , LocClien.h , ReadTut.h
  • IDS_PAGE : wdiffrc.h
  • IDS_PAGE_STR : gutilsrc.h
  • IDS_PAGEFULL : RESDEF.h
  • IDS_PALNULL : MfEdit.h
  • IDS_PARSEFAILURE : Resource.h , ComDlg32.h
  • IDS_PARTITIONINFO_DESC : resource.h
  • IDS_PASTE : Resource.h
  • IDS_PAUSED : MidiPlyr.h
  • IDS_PBEG_GLYPHSTRING : resource.h
  • IDS_PEN : MfEdit.h
  • IDS_PEND_GLYPHSTRING : resource.h
  • IDS_PLAYING : MidiPlyr.h
  • IDS_PLEASE_WAIT : wdiffrc.h
  • IDS_PLUGIN_PROPS_ERROR : resource.h
  • IDS_POWER_DESC : Resource.h
  • IDS_PREROLLED : MidiPlyr.h
  • IDS_PREROLLFAILED : MidiPlyr.h
  • IDS_PREROLLING : MidiPlyr.h
  • IDS_PRINTERNOTFOUND : ComDlg32.h , Resource.h
  • IDS_PRINTERR : APP.h
  • IDS_PRINTMSG : Dibdll.h
  • IDS_PRIV_ALL : Resource.h
  • IDS_PRIV_DELETE : Resource.h
  • IDS_PRIV_MODIFY : Resource.h
  • IDS_PRIV_READ : Resource.h
  • IDS_PRIV_ROOT : Resource.h
  • IDS_PROGNAME : Resource.h
  • IDS_PROJNAME : resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h
  • IDS_PRT : MfEdit.h
  • IDS_PRTDLGFAIL : Resource.h
  • IDS_PRTTHRDDONE : MfEdit.h
  • IDS_PRTTST : Resource.h
  • IDS_PSNONOLE : OleStd.h
  • IDS_PSPASTEDATA : OleStd.h
  • IDS_PSPASTELINKDATA : OleStd.h
  • IDS_PSPASTELINKOBJECT : OleStd.h
  • IDS_PSPASTELINKOBJECTASICON : OleStd.h
  • IDS_PSPASTEOBJECT : OleStd.h
  • IDS_PSPASTEOBJECTASICON : OleStd.h
  • IDS_PST3XMF : MfEdit.h
  • IDS_PST_LANDBASED : resource.h
  • IDS_PST_ROCKET : resource.h
  • IDS_PST_ROCKET_EXT : resource.h
  • IDS_PSTEMF : MfEdit.h
  • IDS_PSUNKNOWNAPP : OleStd.h
  • IDS_PSUNKNOWNSRC : OleStd.h
  • IDS_PSUNKNOWNTYPE : OleStd.h
  • IDS_QUERYDONE : QSample.Hxx
  • IDS_QUERYFAILED : QSample.Hxx
  • IDS_QUERYTIMEDOUT : QSample.Hxx
  • IDS_QUEUED : resource.h
  • IDS_RAFMT : Resource.h
  • IDS_READERROR : Server32.h
  • IDS_READFAILED : Client32.h
  • IDS_REBOOT_REQUIRED : resource.h
  • IDS_REC : MfEdit.h
  • IDS_RECT : MfEdit.h
  • IDS_RECT2 : Resource.h
  • IDS_RECT3 : Resource.h
  • IDS_REGBIGEND : Monkey.h
  • IDS_REGBIN : Monkey.h
  • IDS_REGCLASSFAIL : SpinTest.h , SpinCube.h
  • IDS_REGDWORD : Monkey.h
  • IDS_REGENUMERR : Monkey.h
  • IDS_REGERR : Monkey.h
  • IDS_REGEXPSZ : Monkey.h
  • IDS_REGFULLDESC : Monkey.h
  • IDS_REGKEY_COLUMNPROVIDER : Resource.h
  • IDS_REGLINK : Monkey.h
  • IDS_REGMULTI : Monkey.h
  • IDS_REGNONE : Monkey.h
  • IDS_REGOPENERR : Monkey.h
  • IDS_REGQUERYERR : Monkey.h
  • IDS_REGRESLST : Monkey.h
  • IDS_REGSZ : Monkey.h
  • IDS_REGUNDEFINE : Monkey.h
  • IDS_RENAME : Resource.h
  • IDS_RENDER_STREAM : Resource.h
  • IDS_REQUIRED_FIELD_EMPTY : resource.h
  • IDS_REQUIRES_ADMIN_PRIV : resource.h
  • IDS_REQUIRES_NEWER_VERSION : resource.h
  • IDS_RESDLL_VER : sampver.h , version.h
  • IDS_RESOURCE_DESCRIPTION : resource.h
  • IDS_RESOURCE_MENU_ITEM_1 : resource.h
  • IDS_RESOURCE_MENU_ITEM_1_DESC : resource.h
  • IDS_RESOURCE_MENU_ITEM_CALL_ISALIVE : resource.h
  • IDS_RESOURCE_MENU_ITEM_CALL_ISALIVE_DESC : resource.h
  • IDS_RESTART : res.h , resource.h
  • IDS_RESTYPE_DISPLAYNAME : resource.h , Resource.h
  • IDS_RESTYPE_MENU_ITEM_1 : resource.h
  • IDS_RESTYPE_MENU_ITEM_1_DESC : resource.h
  • IDS_RETDEFFAILURE : Resource.h , ComDlg32.h
  • IDS_RIGHT_ONLY_COMMA : wdiffrc.h
  • IDS_RIGHT_UNREADABLE : wdiffrc.h
  • IDS_ROWSET_STAT_CONTENT_OUT_OF_DATE : QSample.Hxx
  • IDS_ROWSET_STAT_CONTENT_QUERY_INCOMPLETE : QSample.Hxx
  • IDS_ROWSET_STAT_ERROR : QSample.Hxx
  • IDS_ROWSET_STAT_NOISE_WORDS : QSample.Hxx
  • IDS_ROWSET_STAT_PARTIAL_SCOPE : QSample.Hxx
  • IDS_ROWSET_STAT_REFRESH : QSample.Hxx
  • IDS_ROWSET_STAT_REFRESH_INCOMPLETE : QSample.Hxx
  • IDS_ROWSET_STAT_SHARING_VIOLATION : QSample.Hxx
  • IDS_ROWSET_STAT_TIME_LIMIT_EXCEEDED : QSample.Hxx
  • IDS_SAFE_CAT : ErrorOut.h
  • IDS_SAFE_COPY : ErrorOut.h
  • IDS_SAFE_PRINTF : ErrorOut.h
  • IDS_SAME_SIZE : wdiffrc.h
  • IDS_SAVE_COMPFILE : wdiffrc.h
  • IDS_SAVEASTITLE : WinCap.h
  • IDS_SAVEBMP : Resource.h
  • IDS_SAVEERROR : Resource.h
  • IDS_SAVEFILTER : Resource.h
  • IDS_SAVEMF : MfEdit.h
  • IDS_SAVEMFAS : MfEdit.h
  • IDS_SCANNING : wdiffrc.h
  • IDS_SCP_MENU : resource.h
  • IDS_SCRIPT_GLYPHSTRING : resource.h
  • IDS_SDKDIFF_ERROR : wdiffrc.h
  • IDS_SDKDIFF_USAGE : wdiffrc.h
  • IDS_SECONDS : wdiffrc.h
  • IDS_SECONDSFORMAT : resource.h
  • IDS_SELECT2 : Resource.h
  • IDS_SELECT3 : Resource.h
  • IDS_SELECT_COMPUTER : resource.h
  • IDS_SELECT_FIRST_FILE : wdiffrc.h
  • IDS_SELECT_SECOND_FILE : wdiffrc.h
  • IDS_SELECTMSG : Monkey.h
  • IDS_SENDINGBAND : Dibdll.h
  • IDS_SENT_TO_PRINTER : wdiffrc.h
  • IDS_SERVER_CONNECT_ERROR : resource.h
  • IDS_SETADVGRPHMDFAIL : MfEdit.h
  • IDS_SETUPDD_FUNC : Resource.h
  • IDS_SETUPFAILURE : Resource.h , ComDlg32.h
  • IDS_SHORT_APPNAME : Deb.h
  • IDS_SHORTPROGRESS : resource.h
  • IDS_SIMPLE_DESC : Resource.h
  • IDS_SKPTOEOL : MfEdit.h
  • IDS_SNAPINDESC : resource.h , Resource.h , resource.h
  • IDS_SNAPINNAME : resource.h , Resource.h , resource.h
  • IDS_SSGESTURE_FIRST : resource.h
  • IDS_START_MESSAGE_LOG : RemClien.h , AptClien.h , ComUser.h , LicClien.h , DllClien.h , LocClien.h
  • IDS_STARTUPLINK : resource.h
  • IDS_STAT_BATTERY_POWER : QSample.Hxx
  • IDS_STAT_CATALOG : QSample.Hxx
  • IDS_STAT_DOCUMENTS : QSample.Hxx
  • IDS_STAT_FILTEREDDOCUMENTS : QSample.Hxx
  • IDS_STAT_FRESHTEST : QSample.Hxx
  • IDS_STAT_HIGH_IO : QSample.Hxx
  • IDS_STAT_INDEXSIZE : QSample.Hxx
  • IDS_STAT_LOW_MEMORY : QSample.Hxx
  • IDS_STAT_MACHINE : QSample.Hxx
  • IDS_STAT_MERGE_ANNEALING : QSample.Hxx
  • IDS_STAT_MERGE_INDEX_MIGRATION : QSample.Hxx
  • IDS_STAT_MERGE_MASTER : QSample.Hxx
  • IDS_STAT_MERGE_MASTER_PAUSED : QSample.Hxx
  • IDS_STAT_MERGE_SHADOW : QSample.Hxx
  • IDS_STAT_NOT_UP_TO_DATE : QSample.Hxx
  • IDS_STAT_PENDINGSCANS : QSample.Hxx
  • IDS_STAT_PERSISTENTINDEX : QSample.Hxx
  • IDS_STAT_PROPCACHESIZE : QSample.Hxx
  • IDS_STAT_QUERIES : QSample.Hxx
  • IDS_STAT_READ_ONLY : QSample.Hxx
  • IDS_STAT_READING_USNS : QSample.Hxx
  • IDS_STAT_RECOVERING : QSample.Hxx
  • IDS_STAT_SCANS : QSample.Hxx
  • IDS_STAT_SECQDOCUMENTS : QSample.Hxx
  • IDS_STAT_STARTING : QSample.Hxx
  • IDS_STAT_TOTALDOCUMENTS : QSample.Hxx
  • IDS_STAT_UNIQUEKEYS : QSample.Hxx
  • IDS_STAT_UP_TO_DATE : QSample.Hxx
  • IDS_STAT_USER_ACTIVE : QSample.Hxx
  • IDS_STAT_WORDLIST : QSample.Hxx
  • IDS_STATES : MidiPlyr.h
  • IDS_STATUS_PROCESSING_DATA : resource.h
  • IDS_STATUS_TRANSFER_FROM_DEVICE : resource.h
  • IDS_STATUS_TRANSFER_TO_CLIENT : resource.h
  • IDS_STATUSMSGMAX : Resource.h
  • IDS_STATUSMSGMIN : Resource.h
  • IDS_STGOPENSTORAGEFAILED : DfV.h
  • IDS_STMREADFAILED : DfV.h
  • IDS_STMSEEKFAILED : DfV.h
  • IDS_STMSTATFAILED : DfV.h
  • IDS_STMTITLETEXT : DfV.h
  • IDS_STOP : MfEdit.h
  • IDS_STOPFAILED : MidiPlyr.h
  • IDS_STOPPING : MidiPlyr.h
  • IDS_STORAGERESOURCE_DESC : resource.h
  • IDS_STORAGERESTYPE_DESC : resource.h
  • IDS_STRING101 : resource.h
  • IDS_STRING102 : resource.h
  • IDS_STRING103 : resource.h
  • IDS_STRING104 : resource.h
  • IDS_STRING105 : resource.h
  • IDS_STRING106 : resource.h
  • IDS_STRING107 : resource.h
  • IDS_STRING108 : resource.h
  • IDS_STRING109 : resource.h
  • IDS_STRING110 : resource.h
  • IDS_STRING111 : resource.h
  • IDS_STRING112 : resource.h
  • IDS_STRING113 : resource.h
  • IDS_STRING114 : resource.h
  • IDS_STRING115 : resource.h
  • IDS_STRING116 : resource.h
  • IDS_STRING117 : resource.h
  • IDS_STRING118 : resource.h
  • IDS_STRING119 : resource.h
  • IDS_STRING120 : resource.h
  • IDS_STRING121 : resource.h
  • IDS_STRING122 : resource.h
  • IDS_STRING123 : resource.h
  • IDS_STRING124 : resource.h
  • IDS_STRING125 : resource.h
  • IDS_STRING126 : resource.h
  • IDS_STRING127 : resource.h
  • IDS_STRING128 : resource.h
  • IDS_STRING129 : resource.h
  • IDS_STRING130 : resource.h
  • IDS_STRING131 : resource.h
  • IDS_STRING132 : resource.h
  • IDS_STRING133 : resource.h
  • IDS_STRING134 : resource.h
  • IDS_STRING135 : resource.h
  • IDS_STRING136 : resource.h
  • IDS_STRING201 : resource.h
  • IDS_STRING202 : resource.h
  • IDS_STRING203 : resource.h
  • IDS_STRING204 : resource.h
  • IDS_STRING205 : resource.h
  • IDS_STRING206 : resource.h
  • IDS_STRING207 : resource.h
  • IDS_STRUCTSIZE : ComDlg32.h , Resource.h
  • IDS_STYLE_GLYPHSTRING : resource.h
  • IDS_SUBCLASSFAILURE : Resource.h , ComDlg32.h
  • IDS_SUSPENDED : resource.h
  • IDS_SVDRAWSFASBM : MfEdit.h
  • IDS_SYSMENU : STATBAR.h , resource.h , Resource.h
  • IDS_T_GLYPHSTRING : resource.h
  • IDS_TABWIDTH : wdiffrc.h
  • IDS_TB_COMMAND : Resource.h
  • IDS_TERMINAL_NAME : resource.h
  • IDS_TEST_STRING : resource.h
  • IDS_TESTERR : MidiPlyr.h
  • IDS_TEXT_PAGE : RESDEF.h
  • IDS_TF_FIRST : MidiPlyr.h
  • IDS_TF_LAST : MidiPlyr.h
  • IDS_TICKS : MidiPlyr.h
  • IDS_TITLE : HalfIME.h , Resource.h , FullIME.h
  • IDS_TITLEComSpyPropPage : Resource.h
  • IDS_TITLEContextSamplePropPage : resource.h
  • IDS_TOOL_DESCRIPTION : wdiffrc.h
  • IDS_TOOLTIPFONTDEC : Resource.h
  • IDS_TOOLTIPFONTINC : Resource.h
  • IDS_TOOLTIPOPENAS : Resource.h
  • IDS_TOOMANYOPEN : RESDEF.h
  • IDS_TOPLEVEL : Monkey.h
  • IDS_TRACING_DISABLED : wdiffrc.h
  • IDS_TRACING_ENABLED : wdiffrc.h
  • IDS_TRANSFERRED : resource.h
  • IDS_TRANSFERRING : resource.h
  • IDS_TRANSIENTERROR : resource.h
  • IDS_TXT : MfEdit.h
  • IDS_UAFMT : Resource.h
  • IDS_UCFONT : APP.h
  • IDS_UNABLE_TO_OPEN_COMPUTER_SELECTOR : resource.h
  • IDS_UNABLE_TO_PRINT : wdiffrc.h
  • IDS_UNICODEFAIL : ComUser.h , ExeSkel.h , DllUser.h
  • IDS_UNKNOWN : resource.h
  • IDS_UNKNOWN_ERROR_CODE : Resource.h
  • IDS_UNKNOWNERROR : ComDlg32.h , QSample.Hxx , Resource.h
  • IDS_UNREADABLE : wdiffrc.h
  • IDS_UNREGFAIL : SpinCube.h
  • IDS_UNTITLED : MidiPlyr.h
  • IDS_UNTITLLED : MciPlay.h
  • IDS_UNTRUSTED : resource.h
  • IDS_UPDATERECEIPT_DESC : resource.h , Resource.h
  • IDS_UPDATERECEIPT_DESC1 : Resource.h , resource.h
  • IDS_USAGE : resource.h
  • IDS_USAGE_STR00 : wdiffrc.h
  • IDS_USAGE_STR01 : wdiffrc.h
  • IDS_USAGE_STR02 : wdiffrc.h
  • IDS_USAGE_STR03 : wdiffrc.h
  • IDS_USAGE_STR04 : wdiffrc.h
  • IDS_USAGE_STR05 : wdiffrc.h
  • IDS_USAGE_STR06 : wdiffrc.h
  • IDS_USAGE_STR07 : wdiffrc.h
  • IDS_USAGE_STR08 : wdiffrc.h
  • IDS_USAGE_STR08B : wdiffrc.h
  • IDS_USAGE_STR09 : wdiffrc.h
  • IDS_USAGE_STR10 : wdiffrc.h
  • IDS_USAGE_STR11 : wdiffrc.h
  • IDS_USAGE_STR12 : wdiffrc.h
  • IDS_USAGE_STR12B : wdiffrc.h
  • IDS_USAGE_STR12C : wdiffrc.h
  • IDS_USAGE_STR13 : wdiffrc.h
  • IDS_USAGE_STR14 : wdiffrc.h
  • IDS_USAGE_STR15 : wdiffrc.h
  • IDS_USAGE_STR16 : wdiffrc.h
  • IDS_USAGE_STR17 : wdiffrc.h
  • IDS_USAGE_STR18 : wdiffrc.h
  • IDS_USAGE_STR19 : wdiffrc.h
  • IDS_USAGE_STR20 : wdiffrc.h
  • IDS_USAGE_STR21 : wdiffrc.h
  • IDS_USAGE_STR22 : wdiffrc.h
  • IDS_USAGE_STR23 : wdiffrc.h
  • IDS_USAGE_STR24 : wdiffrc.h
  • IDS_USAGE_STR25 : wdiffrc.h
  • IDS_USAGE_STR26 : wdiffrc.h
  • IDS_USER_CANCELLED : resource.h
  • IDS_USERSELECT : Resource.h
  • IDS_VALIDATING_SIGNATURE : resource.h
  • IDS_VER_INFO_LANG : StatList.h , Generic.H , LeakyBin.h
  • IDS_VERSION : Resource.h , resource.h , Resource.h
  • IDS_VERSION_ERROR : LeakyBin.h , StatList.h , Generic.H
  • IDS_VFWTOOOLD : MciPlay.h
  • IDS_VIEW : Resource.h
  • IDS_VIEW_DETAILS : Resource.h
  • IDS_VIEW_LARGE : Resource.h
  • IDS_VIEW_LIST : Resource.h
  • IDS_VIEW_SMALL : Resource.h
  • IDS_VWFULLSCRN : Resource.h
  • IDS_WAIT : resource.h
  • IDS_WARN_BOOT_PARTITION_NOT_NTFS : resource.h
  • IDS_WARN_BOOT_PARTITION_NOT_NTFS_REF : resource.h
  • IDS_WARN_DISK_NOT_NTFS : resource.h
  • IDS_WARN_DISK_NOT_NTFS_REF : resource.h
  • IDS_WINCAPRUNNING : Resource.h
  • IDS_WINDOWS_NT_REQUIRED : Deb.h
  • IDS_WINDOWS_NT_REQUIRED_TITLE : Deb.h
  • IDS_WINDOWTITLE : WxForm.h , Server32.h , SpinTest.h , PlgBlt.h
  • IDS_WNDWNOTVIS : Resource.h
  • IDS_WRONGOS : Server32.h
  • IDSBP_ICON : Global.h
  • IDSBP_MSG : Global.h
  • IDSBP_USERCOUNT : Global.h
  • IDSCRIPT : Resource.h
  • idsDisplayInfo : custom.h
  • idsDisplayInfoDesc : custom.h
  • IDSECURITY : Resource.h
  • IDSELECTALL : resource.h
  • IDSERVER : Resource.h
  • idsHelloWorld : custom.h
  • idsHelloWorldDesc : custom.h
  • IDSHUTDOWN : Resource.h
  • IDSIZE : spy.cpp
  • idsSimpleConnect : custom.h
  • idsSimpleConnectDesc : custom.h
  • IDSTART : Resource.h
  • IDSTATES_POS : Menu.h
  • idsTestName : custom.h
  • IDT_AUTOHIDE : AppBar.h
  • IDT_AUTOUNHIDE : AppBar.h
  • IDT_CATALOG : resource.h
  • IDT_CMD_LAUNCHREMOTE : Resource.h
  • IDT_COLUMN_LIST : resource.h
  • IDT_COLUMNNAME : resource.h
  • IDT_CONNECT : resource.h
  • IDT_CONNECTSTATUS : resource.h
  • IDT_DATASOURCE : resource.h
  • IDT_DBMS : resource.h
  • IDT_FILEDESC : resource.h
  • IDT_FILEINFO : resource.h
  • IDT_FROM_CONNECT : resource.h
  • IDT_FROM_INFO : resource.h
  • IDT_FROM_PROVIDER : resource.h
  • IDT_FROMTABLEHELP : resource.h
  • IDT_HELPMSG : resource.h
  • IDT_INDEXES : resource.h
  • IDT_INDEXMSG : resource.h
  • IDT_MAX_ROWS : resource.h
  • IDT_OPTIONMSG : resource.h
  • IDT_PROVIDERDESC : resource.h
  • IDT_PROVIDERFILENAME : resource.h
  • IDT_PROVIDERVERSION : resource.h
  • IDT_READONLY : resource.h
  • IDT_RESTRICTION1 : resource.h
  • IDT_RESTRICTION2 : resource.h
  • IDT_RESTRICTION3 : resource.h
  • IDT_RESTRICTION4 : resource.h
  • IDT_RESTRICTION5 : resource.h
  • IDT_RESTRICTION6 : resource.h
  • IDT_RESTRICTION7 : resource.h
  • IDT_RESULT : resource.h
  • IDT_SHOW_GROUP : resource.h
  • IDT_SOURCE : resource.h
  • IDT_STAT_INFO : resource.h
  • IDT_STATIC : resource.h
  • IDT_STATIC10 : resource.h
  • IDT_STATIC11 : resource.h
  • IDT_STATIC2 : resource.h
  • IDT_STATIC3 : resource.h
  • IDT_STATIC4 : resource.h
  • IDT_STATIC5 : resource.h
  • IDT_STATIC6 : resource.h
  • IDT_STATIC7 : resource.h
  • IDT_STATIC8 : resource.h
  • IDT_STATIC9 : resource.h
  • IDT_STATUS : resource.h
  • IDT_TABLE_LIST : resource.h
  • IDT_TARGET : resource.h
  • IDT_THREADMODEL : resource.h
  • IDT_TO_CONNECT : resource.h
  • IDT_TO_PROVIDER : resource.h
  • IDT_TO_TITLE : resource.h
  • IDT_TOTABLEHELP : resource.h
  • IDT_UIUPDATE : Main.Cpp
  • IDT_VALUE : resource.h
  • IDTBB_ALPHA : ToolBar.c
  • IDTBB_CANCEL : ToolBar.c
  • IDTBB_CHARCODE : ToolBar.c
  • IDTBB_CLOSE : ToolBar.c
  • IDTBB_CLOSECAND : ToolBar.c
  • IDTBB_COMPLETE : ToolBar.c
  • IDTBB_CONVERT : ToolBar.c
  • IDTBB_EUDC : ToolBar.c
  • IDTBB_FONT : ToolBar.c
  • IDTBB_FULL : ToolBar.c
  • IDTBB_HALF : ToolBar.c
  • IDTBB_HANJA : ToolBar.c
  • IDTBB_KATAKANA : ToolBar.c
  • IDTBB_MODE : ToolBar.c
  • IDTBB_NATIVE : ToolBar.c
  • IDTBB_NEXTCAND : ToolBar.c
  • IDTBB_NEXTCLAUSE : ToolBar.c
  • IDTBB_NOCHARCODE : ToolBar.c
  • IDTBB_NOEUDC : ToolBar.c
  • IDTBB_NOHANJA : ToolBar.c
  • IDTBB_NOROMAN : ToolBar.c
  • IDTBB_NOSHOWCAND : ToolBar.c
  • IDTBB_NOSOFTKBD : ToolBar.c
  • IDTBB_NOSYMBOL : ToolBar.c
  • IDTBB_OPEN : ToolBar.c
  • IDTBB_OPENCAND : ToolBar.c
  • IDTBB_PREVCAND : ToolBar.c
  • IDTBB_PREVCLAUSE : ToolBar.c
  • IDTBB_REVERT : ToolBar.c
  • IDTBB_ROMAN : ToolBar.c
  • IDTBB_SHOWCAND : ToolBar.c
  • IDTBB_SOFTKBD : ToolBar.c
  • IDTBB_SYMBOL : ToolBar.c
  • IDUNSELECTALL : resource.h
  • IDW_APP : Global.h
  • IDW_CHAT : Global.h
  • IDW_EDIT : Global.h , ui.cpp
  • IDW_LVIEW : Global.h
  • IDW_MSG : Global.h , ui.cpp , Global.h
  • IDW_SBAR : Global.h
  • IDW_SEND : Global.h
  • IDW_TBAR : Global.h
  • IDW_USER : Global.h , ui.cpp
  • IDX25 : Resource.h
  • IDX_COPY_DATA : resource.h
  • IDX_COPY_INDEXES : resource.h
  • IDX_COPY_PRIMARYKEYS : resource.h
  • IDX_COPY_SCHEMA : resource.h
  • IDX_COPY_TABLE : resource.h
  • IDX_SHOW_SQL : resource.h
  • IDYES : winres.h
  • IE_ActivateInterface() : networkentry.c , networkentry.h
  • IE_BindInterface() : networkentry.c , networkentry.h
  • IE_Create() : networkentry.c , networkentry.h
  • IE_DeactivateInterface() : networkentry.h , networkentry.c
  • IE_Delete() : networkentry.c , networkentry.h
  • IE_Destroy() : networkentry.c , networkentry.h
  • IE_Display : networkentry.h
  • IE_Get() : networkentry.h , networkentry.c
  • IE_GetIndex() : networkentry.h , networkentry.c
  • IE_Insert() : networkentry.h , networkentry.c
  • IE_IsPresent() : networkentry.h , networkentry.c
  • IE_UnBindInterface() : networkentry.c , networkentry.h
  • IEFLAG_ACTIVE : networkentry.h
  • IEFLAG_BOUND : networkentry.h
  • IEFLAG_MULTIACCESS : networkentry.h
  • iEXPORT_MSI : msiloc.cpp
  • if() : suminfo.Cpp , Utils.Cpp , suminfo.Cpp , Utils.Cpp , suminfo.Cpp , Utils.Cpp
  • IF_AUDIT_DO : ccomspy.h
  • iFace : Paint.h
  • igc : loadprotocol.c
  • iGlobalXOffset : Mypal.c
  • iGlobalYOffset : Mypal.c
  • IGMP_GROUP_RECORD_V3 : iphdr.h
  • IGMP_HDR : iphdr.h
  • IGMP_HDR_QUERY_V3 : iphdr.h
  • IGMP_HDR_REPORT_V3 : iphdr.h
  • ignore_blanks : sdkdiff.cpp , sdkdiff.h
  • IGNORE_CHAR : Common.h
  • IgnoreCase : AsyncIO.h
  • IGNORED : quiktest.h
  • IgnoreNotification : Redir401.cpp
  • IgnoreType() : quiktest.c
  • IGrid_ServerInfo : EdHost_p.c
  • iGroupType : main.cpp
  • IHelloCallAs_HelloProc_Proxy() : call_as.c
  • IHelloCallAs_HelloProc_Stub() : call_as.c
  • IHelloWorld : ADsFirstExt.h
  • IHelloWorld_Say_Proxy() : ADsFirstExt.h
  • IHelloWorld_Say_Stub() : ADsFirstExt.h
  • IHelloWorld_ServerInfo : ADsFirstExt_p.c
  • IHelloWorldVtbl : ADsFirstExt.h
  • IID : iapplet.c , MyDevice_i.c , ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c , ADsFirstExt_i.c
  • IID__ADO : adoint.h
  • IID__ADOCollection : adoint.h
  • IID__ADODynaCollection : adoint.h
  • IID__Command : adoint.h
  • IID__Connection : adoint.h
  • IID__Parameter : adoint.h
  • IID__Recordset : adoint.h
  • IID_ADOConnectionConstruction : adoint.h
  • IID_ADORecordsetConstruction : adoint.h
  • IID_DataSourceListener : common.h
  • IID_DEFINED : account.Cpp , Catlpwr.Cpp , bankdlg.Cpp , Account.cpp , CatlSmpl.Cpp , ComSpyCtl.Cpp , Account.Cpp
  • IID_Error : adoint.h
  • IID_Errors : adoint.h
  • IID_Field : adoint.h
  • IID_Fields : adoint.h
  • IID_IADsError : ADsError_i.c , ADsError.h
  • IID_IAggregate : cbase.h
  • IID_IApplet : iapplet.h , iapplet.c
  • IID_IAppletNotify : iapplet.h , iapplet.c
  • IID_IAppletSession : iapplet.h , iapplet.c
  • IID_IAppletSessionNotify : iapplet.c , iapplet.h
  • IID_IDownloadBindStatusCallback : setupui.cpp
  • IID_IEAPProviderConfig : Exports.Cpp
  • IID_IHelloWorld : ADsFirstExt.h , ADsFirstExt_i.c , ADsFirstExt.h
  • IID_IMMCControl : atlcontrol.h
  • IID_IUnknown : setupui.cpp
  • IID_IUPnPService_DimmingService_SCPD : MyDevice.h , MyDevice_i.c
  • IID_OLEDBSimpleProvider : common.h
  • IID_OLEDBSimpleProviderListener : common.h
  • IID_Parameters : adoint.h
  • IID_Properties : adoint.h
  • IID_Property : adoint.h
  • iIMPORT_RES : msiloc.cpp
  • ikszAppFriendlyName : Resource.h
  • ikszAppName : Resource.h
  • ikszDisconnectedBusy : Resource.h
  • ikszDisconnectedCantDo : Resource.h
  • ikszDisconnectedIncompatible : Resource.h
  • ikszDisconnectedNetwork : Resource.h
  • ikszDisconnectedNoAnswer : Resource.h
  • ikszDisconnectedNoDialTone : Resource.h
  • ikszDisconnectedReject : Resource.h
  • ikszErrAddrBlocked : Resource.h
  • ikszErrBadTAPIAddr : Resource.h
  • ikszErrBillingRejected : Resource.h
  • ikszErrDefault : Resource.h
  • ikszErrInvalAddress : Resource.h
  • ikszErrInvalCallState : Resource.h
  • ikszErrInvalidCountryCode : Resource.h
  • ikszErrLineClose : Resource.h
  • ikszErrLineInitBadIniFile : Resource.h
  • ikszErrLineInitNoDevice : Resource.h
  • ikszErrLineInitNoDriver : Resource.h
  • ikszErrLineInitWrongDrivers : Resource.h
  • ikszErrNoMultipleInstance : Resource.h
  • ikszErrNoVoiceLine : Resource.h
  • ikszErrOOM : Resource.h
  • ikszErrResUnavail : Resource.h
  • ikszErrTAPI : Resource.h
  • ikszWarning911 : Resource.h
  • ikszWarningFor911 : Resource.h
  • ikszWarningNewDefault : Resource.h
  • ikszWarningRegisterSTapi : Resource.h
  • ikszWarningTapiReInit : Resource.h
  • ikszWarningTitle : Resource.h
  • ILIST : status.cpp
  • ILV_ADDR : Global.h
  • ILV_AS : Global.h
  • ILV_AS_HWND : Dlg.Cpp
  • ILV_AS_NAME : Dlg.Cpp
  • ILV_AS_STATUS : Dlg.Cpp
  • ILV_AUDIO : Global.h
  • ILV_CAPS : Global.h
  • ILV_FT : Global.h
  • ILV_HWND : Global.h
  • ILV_ID : Global.h
  • ILV_LOCAL : Global.h
  • ILV_MCU : Global.h
  • ILV_NAME : ui.cpp , Global.h
  • ILV_STATUS : Global.h
  • ILV_TEXT : Global.h , ui.cpp
  • ILV_TIME : ui.cpp , Global.h
  • ILV_VERSION : Global.h
  • IM_CLASS : StdAfx.h
  • IM_HEIGHT : StdAfx.h
  • IM_TITLE : StdAfx.h
  • IM_WIDTH : StdAfx.h
  • IMAGE_ARROW_DOWN : cmainwindow.h
  • IMAGE_ARROW_UP : cmainwindow.h
  • IMAGE_BASE_OFFSET : DebDebug.c
  • IMAGE_CHANGE : cmainwindow.h
  • IMAGE_CHAPTER : cmainwindow.h
  • IMAGE_CHECKED : cmainwindow.h
  • IMAGE_COMMAND : cmainwindow.h
  • IMAGE_CUBE : cmainwindow.h
  • IMAGE_DATALINKS : cmainwindow.h
  • IMAGE_DATASOURCE : cmainwindow.h
  • IMAGE_DELETE : cmainwindow.h
  • IMAGE_DRAWNPOOL : cmainwindow.h
  • IMAGE_ERROR : cmainwindow.h
  • IMAGE_EXPORT_TABLE_RVA_OFFSET : DebDebug.c
  • IMAGE_FORM : cmainwindow.h
  • IMAGE_INSERT : cmainwindow.h
  • IMAGE_INTERFACE : cmainwindow.h
  • IMAGE_LOCK : cmainwindow.h
  • IMAGE_MULTIPLE : cmainwindow.h
  • IMAGE_NAME_RVA_OFFSET : DebDebug.c
  • IMAGE_NONE : common.h
  • IMAGE_NORMAL : cmainwindow.h
  • IMAGE_OBJECTS : cmainwindow.h
  • IMAGE_POOLING : cmainwindow.h
  • IMAGE_QUESTION : cmainwindow.h
  • IMAGE_REMOTING : cmainwindow.h
  • IMAGE_SECOND_HEADER_OFFSET : DebDebug.c
  • IMAGE_SERVICECOMP : cmainwindow.h
  • IMAGE_SESSION : cmainwindow.h
  • IMAGE_STREAM : cmainwindow.h
  • IMAGE_TABLE : cmainwindow.h
  • IMAGE_UNCHECKED : cmainwindow.h
  • IMAGEHEIGHT : Global.h , ToolBar.c
  • IMAGEICONS : cmainwindow.h
  • ImageToken : HtmlScan.Hxx
  • IMAGEWIDTH : Global.h , ToolBar.c
  • iMaxResStrLen : msiloc.cpp
  • IMC1 : MultiUI.h
  • IMC2 : MultiUI.h
  • IMCUI1 : MultiUI.h
  • IMCUI2 : MultiUI.h
  • IME_IN_CHOSECAND : FullIME.h
  • IME_IN_COMPOSITION : FullIME.h
  • IMESTATUS_CY : IMEApps.h
  • ImeUIChangeCandidate() : ImeUI.C , FullIME.h
  • ImeUIClearData() : ImeUI.C , FullIME.h
  • ImeUICloseCandidate() : ImeUI.C , FullIME.h
  • ImeUIComposition() : ImeUI.C , FullIME.h
  • IMEUIDATA : FullIME.h
  • ImeUIEndComposition() : ImeUI.C , FullIME.h
  • ImeUIMoveCandWin() : ImeUI.C , FullIME.h
  • ImeUINotify() : FullIME.h , ImeUI.C
  • ImeUIOpenCandidate() : ImeUI.C , FullIME.h
  • ImeUISetOpenStatus() : FullIME.h , ImeUI.C
  • ImeUIStartComposition() : FullIME.h , ImeUI.C
  • IMG_CDROM_DEFAULT : globals.h
  • IMG_DATA_FILE : globals.h
  • IMG_DEVICE_DEFAULT : globals.h
  • IMG_DEVICE_OFFLINE : globals.h
  • IMG_DRIVE_DEFAULT : globals.h
  • IMG_DRIVE_OFFLINE : globals.h
  • IMG_FOLDER_DEFAULT : globals.h
  • IMG_REMOVABLE_MEDIA : globals.h
  • iMinMsiAllowedVer : msistuff.cpp
  • IMMCControl : atlcontrol.h
  • IMMCControl_DoHelp_Proxy() : atlcontrol.h
  • IMMCControl_DoHelp_Stub() : atlcontrol.h
  • IMMCControl_StartAnimation_Proxy() : atlcontrol.h
  • IMMCControl_StartAnimation_Stub() : atlcontrol.h
  • IMMCControl_StopAnimation_Proxy() : atlcontrol.h
  • IMMCControl_StopAnimation_Stub() : atlcontrol.h
  • IMMCControlVtbl : atlcontrol.h
  • IMMEDIATE_EXPIRATION : IsapiRequest.h
  • IMoniker_GetDisplayNameA : ansiapi.h
  • ImpersonateContext() : Security.h , Security.cpp
  • ImpersonateSecurityContext() : Stubs.c
  • IMPL : CeapCfg.h
  • IMPLEMENT_FIXED_ALLOC() : entity.Cpp , pooleddata.Cpp , utils.Cpp , heap.h , string.Cpp
  • IMPLEMENTED_CLSID : Server.Cpp
  • Implies : StdAfx.h
  • IMPORT_TYPE_CLSID : CompImportDlg.Cpp
  • IMPORT_TYPE_PROGID : CompImportDlg.Cpp
  • IMPORT_TYPE_UNDEFINED : CompImportDlg.Cpp
  • ImportCertificate() : CreateCert.c , CreateCert.h
  • importlib() : CrmDebug.Idl , CrmFiles.Idl , CertPSam.Idl , GraphObj.Idl , data.Idl , OLEDBKB.Idl , pipesample.Idl , QCOrder.Idl , TServer.Idl , FreeObject.Idl , Disp1.Idl , QCNotify.Idl , VCSecuritySample.Idl , LogWriter.Idl , persistatl.Idl , Account.Idl , newseventclass.Idl , CrmMonComp.Idl , Server.Idl , ADOKB.Idl , TServer.Idl , STAObject.Idl , QCNotify.Idl , FreeObject.Idl , ComSyncObject.Idl , TxEnlister.Idl , BYOTTransaction.Idl , PingResp.Idl , SampMsp.Idl , fullsvr.Idl , TxEnlister.Idl , ComSpyAudit.Idl , PingResp.Idl , CpyImage.Idl , ComSpy.Idl , CertXSam.Idl , data.Idl , VCSecuritySample.Idl , data.Idl , ComSyncObject.Idl , iDog.Idl , ComSpy.Idl , CrmFiles.Idl , STAObject.Idl , ComSpyAudit.Idl , fullsvr.Idl , Server.Idl , OPBank.Idl , newseventclass.Idl , CrmMonComp.Idl , RDOKB.Idl , Catlpwr.Idl , cascadeec.Idl , persistatl.Idl , CrmFilesTest.Idl , OPBank.Idl , LogWriter.Idl , iDog.Idl , CrmFilesTest.Idl , QCShip2.Idl , QCOrder.Idl , Disp1.Idl , QCShip.Idl , ADOKB.Idl , OLEDBKB.Idl , GraphObj.Idl , SampMsp.Idl , account.Idl , CatlSmpl.Idl , RDOKB.Idl
  • IN : AsyncIO.h
  • IN_BUF_SIZE : Client32.h , Server32.h
  • IN_BUFFER_SIZE : RSACert.cpp , SessionKey.cpp , RSAKey.cpp
  • IN_MOTION : SpinCube.h
  • in_out_pipe_state : Pipec.c
  • INBOUND_PIPE : Server.c
  • INC : PlgBlt.h , WxForm.h
  • INC_OLE2 : Util.Cpp , secClnt.Cpp , Server.Cxx , sampclnt.h , call_as.c , ADSIhelpers.cpp , main.cpp , sserver.cpp , FileView.h , main.cxx , secSvr.Cpp , main.hxx , Priv.h , ADSIhelpers.cpp , CreateUserHelpers.cpp , main.cpp , headers.h , main.cpp , Client.c , OleApt.Cpp , Client.Cpp , Framer.h , UserProps.cpp , ComPerf.Cpp , MciPlay.c , sclient.cpp , OleImp.Cpp , main.cpp
  • INC_VIEW_COMPLIST : compitem.h , complist.h , view.h
  • INCH1 : APP.h
  • INCH10 : APP.h
  • INCH2 : APP.h
  • INCH4 : APP.h
  • INCH8 : APP.h
  • INCLUDE_ALL : sdkdiff.h
  • INCLUDE_DIFFER : sdkdiff.h
  • INCLUDE_LEFTONLY : sdkdiff.h
  • INCLUDE_MOVEDLEFT : sdkdiff.h
  • INCLUDE_MOVEDRIGHT : sdkdiff.h
  • INCLUDE_RIGHTONLY : sdkdiff.h
  • INCLUDE_SAME : sdkdiff.h
  • INCLUDE_SIMILARLEFT : sdkdiff.h
  • INCLUDE_SIMILARRIGHT : sdkdiff.h
  • IncrementLockCount() : cHello.Cxx , Server.Cxx
  • IncrementRefCount() : Server.Cxx
  • INDENT : mwclass.Cxx
  • INDEX : cdialoglite.h
  • INDEX_BACKGROUND : localres.h
  • INDEX_CLOSEDFOLDER : localres.h
  • INDEX_CLOUD : localres.h
  • INDEX_COLUMN_DESC : cmainwindow.h
  • INDEX_LANDICON : localres.h
  • INDEX_NONE : localres.h
  • INDEX_OPENFOLDER : localres.h
  • INDEX_PEOPLEICON : localres.h
  • INDEX_RAIN : localres.h
  • INDEX_SKYICON : localres.h
  • INDEX_SNOW : localres.h
  • INDEX_SPACEICON : localres.h
  • INDEX_STATION : localres.h
  • INDEX_SUN : localres.h
  • INDEX_THUNDER : localres.h
  • INDEX_TYPE : step2.cpp
  • INDEX_WORLD : localres.h
  • IndexInstalledCodecs() : InstCodc.Cpp
  • IndexToGUID() : RecoDll.cpp
  • INDEXTYPE_INDEX : step2.cpp
  • INDEXTYPE_PRIMARYKEY : step2.cpp
  • INET_NTOA : defs.h
  • INFINITE_INTERVAL : defs.h
  • INHERIT_FULL : Privobji.Cpp
  • IniFile : FaxSiren.Cpp
  • ININAME : FaxSiren.Cpp
  • InInOutPipesSample() : pipesample.Idl
  • init() : dbh.cpp
  • Init() : SimpleLog.Idl , AdminDll.c , sa.Cpp , ComSpyAudit.Idl , MtsAudit.Idl , RmWorker.Idl
  • Init1() : Admapit.c
  • Init2() : AdminDll.c , Admapit.c
  • INIT_DEFAULT_NODE : globals.h
  • INIT_INTERFACEIMPL : OleStd.h
  • InitAddressTypeComboBox() : Outgoing.Cpp
  • InitApp() : MidiPlyr.c , DoServer.Cpp , sendto.c
  • InitAppInstance() : InstCodc.Cpp
  • InitApplet() : applet.h , applet.cpp
  • InitApplication() : Property.c , DragImg.h , Main.c , DragImg.Cpp , Generic.C , sdkdiff.cpp , Cursor.c , MultiUI.h , ClipText.c , VListVw.h , Globals.h , SimpDnd.h , WinMain.Cxx , ComUser.Cpp , AptClien.Cpp , AptServe.Cpp , ConClien.Cpp , Cursor.h , IMEApps.h , ExeSkel.Cpp , DcdServe.Cpp , LocClien.Cpp , VListVw.c , Rebar.c , PerClien.Cpp , DllUser.Cpp , halftone.c , printjob.c , Main.h , halftone.c , StoClien.Cpp , ComDlg32.C , ViewDIB.c , INIT.c , TextFx.h , GLOBALS.h , StatList.c , LeakyBin.c , Globals.h , Init.c , CDTest.h , printjob.c , TextFx.c , LocServe.Cpp , CDTest.c , DComDraw.Cpp , LicClien.Cpp , IconPRO.C , MultiUI.C , FreClien.Cpp , SimpSvr.h , IMEApps.c , SimpCntr.h , ComDlg32.h , DllClien.Cpp , RemClien.Cpp
  • InitAuthorizationHeader() : HttpAuth.c , HttpAuth.h
  • InitBarClass() : bar.cpp , sdkdiff.h
  • InitClasses() : fakemenu.c
  • InitClipboardFormats() : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • InitColorStruct() : Colors.c
  • InitComServer() : Main.cpp
  • InitConfMgr() : cMgr.h , CConf.Cpp , CConf.h , conf.cpp , CConf.Cpp , cMgr.Cpp , CConf.h , conf.h
  • InitCustFilterString() : Open.c , Open.h
  • INITDATA : Dt.h
  • InitDbg() : Global.h
  • InitDC() : status.cpp
  • InitDialog() : bits_ie.cpp
  • INITDIRSIZE : Open.h
  • InitDlgProc() : Client32.c , Client32.h
  • InitDllNodeInfo() : DebDebug.c
  • InitDragFeedback() : idt.h
  • InitEditCtls() : EDITCTLS.c , EDITCTLS.h
  • InitFaceLists() : Settings.Cpp
  • InitFail() : dxsurf2.cpp , dxsurf1.cpp
  • InitFileHandleCache() : openf.h , openf.c , openf.h , openf.c
  • InitFilterString() : Open.h , Open.c
  • InitFindStruct() : Find.c
  • InitFontStruct() : Font.c
  • InitFromData() : ioo.h
  • InitGlobals() : CDTest.c
  • INITGUID : BandObjs.Cpp , oledbcomponent.h , SampView.Cpp , stdafx.cpp , ShellExt.Cpp , sampclnt.cpp , globals.cpp , Guid.c , const.cpp , common.cpp , Globals.cpp , MqTrans.Cpp , Framer.Cpp , EnumerateKeys.cpp , DropExt.C , Guids.Cpp , tablecopy.cpp , common.cpp , Guids.Cpp
  • INITGUIDS : DskQuota.Cpp , FileView.Cpp
  • InitGutils() : gutils.h
  • InitHashChars() : bar.cpp
  • InitHelperDll() : nshsamp.h , nshsamp.cpp
  • INITIAL_BUFFER_SIZE : dhcprequest.cpp , dhcppersist.cpp
  • INITIAL_COLUMN_SIZE : Utility.h
  • INITIAL_SIZE : PerfUtil.c
  • Initialise() : CSSamp.Cpp
  • Initialize() : CacheIsapi.cpp , data.Idl
  • INITIALIZE_HTTP_RESPONSE : main.c
  • INITIALIZE_LOCKED_LIST : sync.h
  • INITIALIZE_LOCKED_QUEUE : sync.h
  • InitializeAddressBox() : Dialer.c
  • InitializeApp() : MfEdit.c , MfEdit.h
  • InitializeCache() : AuthFilt.h , cache.c
  • InitializeChangeNotify() : PwdFilt.c
  • InitializeDynamicLocksStore() : sync.h , sync.c
  • InitializeFont() : textapi.c
  • InitializeFundsRM() : AuthzSvr.c
  • InitializeIsapiTime() : IsapiTime.cpp , IsapiTime.h
  • InitializeIsapiTools() : IsapiModule.cpp , IsapiModule.h
  • InitializeLineBox() : Dialer.c
  • InitializeListHead : defs.h , list.h , tracedmp.h , openf.h , AsyncIO.h , openf.h
  • InitializeMallocSpy() : malspy.h
  • InitializeNm() : cMgr.Cpp
  • InitializeQueueHead : list.h
  • InitializeRegistry() : Client.c
  • InitializeSecurity() : WbemSec.h , WbemSec.Cpp
  • InitializeSecurityContextW() : Stubs.c
  • InitializeSlotList() : hashtbl.cpp , hashtbl.h
  • InitializeStackHead : list.h
  • InitializeStatusBar() : STATBAR.c , STATBAR.h
  • InitializeTAPI() : TapiCode.c , Dialer.c , TapiCode.h
  • InitializeTapi() : Incoming.Cpp
  • InitializeTAPI() : tapisend.cpp
  • InitializeTapi() : Outgoing.Cpp
  • InitializeTAPI() : tapirecv.cpp
  • InitializeTapi() : FileTerm.h , FileTerm.cpp
  • InitializeUserDatabase() : AuthFilt.h , db.c
  • InitializeUserList() : Global.h , Dlg.Cpp
  • InitiateAsyncReceiveWithCompletionPort() : MQPort.Cpp
  • InitiateCall() : Dialer.c
  • InitIcmp6Header() : Ping.cpp
  • InitIcmpHeader() : Ping.cpp
  • InitIMEUIPosition() : IMEApps.c
  • InitInstance() : ComDlg32.C , VListVw.h , EventSink.cpp , VListVw.c , printjob.c , Cursor.h , SimpCntr.h , Main.c , sdkdiff.cpp , ViewDIB.c , MidiPlyr.c , ClipText.c , CDTest.h , Cursor.c , IMEApps.h , halftone.c , TextFx.c , MultiUI.h , CDTest.c , LeakyBin.c , Main.h , Main.Cpp , StatList.c , dxsurf3.cpp , ClipText.c , Property.c , Rebar.c , ComDlg32.h , halftone.c , DragImg.Cpp , printjob.c , Generic.C , SimpDnd.h , IconPRO.C , TextFx.h , MultiUI.C , SimpSvr.h , DragImg.h , Globals.h , IMEApps.c
  • InitIpv4Header() : rawudp.c
  • InitIpv6FragmentHeader() : rawudp.c
  • InitIpv6Header() : rawudp.c
  • InitLangList() : gentab.c
  • InitLBox() : Dlg.Cpp
  • InitList() : RPCssmc.c , RPCssmp.c
  • InitListView() : VListVw.c , VListVw.h , DragImg.Cpp
  • InitLogFontStruct() : Font.c
  • InitLsaString() : Audit.c , LsaPrivs.c
  • InitMainUI() : ui.cpp
  • InitMenuItemIDTable() : ImeMenu.c , IMEApps.h
  • InitNew() : ips.h
  • InitNLSFields() : nlsapi.c
  • InitOneFace() : Settings.Cpp
  • InitOneSize() : Settings.Cpp
  • InitOpenStruct() : Open.c , Open.h
  • InitOSVersion() : osv.Hxx , Main.Cxx
  • InitOverlappedCS() : provider.h
  • InitOverlappedManager() : overlap.cpp , provider.h
  • InitPackage() : Security.h , Security.cpp
  • InitPaper() : PAPINT.Idl
  • InitPrintStruct() : Print.c
  • InitProcessNodeInfo() : DebDebug.c
  • InitSecurity() : WMIDiskPerf.Cpp
  • InitSecurityInterfaceW() : Stubs.c
  • InitSelection() : Settings.Cpp
  • InitSession() : Security.h , Security.cpp
  • InitShareList() : Dlg.Cpp
  • InitStatusBar() : MainWND.c , Status.c , FontView.c
  • InitStringBuffer() : MultiWnd.C
  • InitStruct : Global.h
  • InitStyles() : Style.Cpp , Global.h
  • InitTest : autotest.h
  • InitText() : Global.h , Text.Cpp
  • InitThread() : PoolWrap.h , Extension.cpp
  • InitThreadNodeInfo() : DebDebug.c
  • InitThreadPool() : PoolWrap.cpp , ThreadPool.h , ThreadPool.c
  • InitToolBar() : FontView.c
  • InitToolbar() : MainWND.c , MidiPlyr.h
  • InitToolBar() : Tools.c
  • InitUdpHeader() : rawudp.c
  • InitUnicodeString() : KList.c , SubAuth.c
  • InitUserLBox() : Dlg.Cpp
  • InitUsernameDialog() : Eap.c , Eap.h
  • InitVariants() : property.cpp , property.h
  • InitWinsock() : Comm.h , Comm.cpp
  • INK_MEDIUM : DComDraw.h , StoClien.h
  • INK_THICK : DComDraw.h , StoClien.h
  • INK_THIN : StoClien.h , DComDraw.h
  • InkDraw() : PAPINT.Idl
  • InkStart() : PAPINT.Idl
  • InkStop() : PAPINT.Idl
  • INLINE : MulDiv32.h
  • INLINE_BUFFER_SIZE : IsapiBuffer.h
  • INLINE_READ_SIZE : IsapiRequest.h
  • InOutList() : RPCssmp.c
  • InOutPipeSample() : pipesample.Idl
  • InOutProc() : InOutp.c
  • InPaletteBasedVideoMode() : Mypal.c
  • InPlaceDeactivate() : ioipo.h
  • INPROC : cfactory.h
  • INPUTBUFFERSIZE : CommCode.c
  • InputChangeHandler() : Main.C
  • InputLoop() : dbh.cpp
  • InputToken : HtmlScan.Hxx
  • INSERT : fileio.h
  • Insert() : data.Idl
  • INSERT_FAIL : quiktest.h
  • InsertCommand() : data.Idl
  • InsertDllNode() : DebDebug.c
  • InsertHeadList : openf.h , defs.h , AsyncIO.h , list.h , openf.h
  • InsertionSort() : InsertionSort.h
  • InsertListViewItems() : DragImg.Cpp , VListVw.c
  • InsertMenus() : ioipf.h
  • insertMsgString() : log.c
  • InsertNewNode() : Xmitu.h , Xmitp.c , Xmitu.c
  • InsertNode() : LinkList.h , LinkList.c
  • InsertOneRow() : quiktest.c
  • InsertProcessNode() : DebDebug.c
  • INSERTROWS_ABOUTTODO : myospobject.h
  • INSERTROWS_DIDEVENT : myospobject.h
  • InsertSocketInfo() : provider.h , sockinfo.cpp
  • InsertSockInfo() : PrPerf.c
  • InsertSortedList : list.h
  • InsertStoredProcedure() : data.Idl
  • InsertTailList : openf.h , AsyncIO.h , defs.h , openf.h , tracedmp.h , list.h
  • InsertTextAtSelection() : hello.cpp , globals.h
  • InsertThreadNode() : DebDebug.c
  • Install() : MtsSpyCtl.Idl , ComSpyCtl.Idl
  • InstallClass() : rnrcs.cpp
  • InstallDebugger() : DebugHandler.Cpp
  • InstallHook() : Hook.c , WinCap.h
  • InstallProvider() : instlsp.cpp
  • Instance : comspyctl.idl
  • int : OleStd.h , GinaStub.h , GinaHook.h
  • INT2DWORD : Select.h
  • INT_DISPLAY_SIZE : sampprov.h
  • INTERACTIVE_PURGE : KList.c
  • interface : EventSink.cpp
  • INTERFACE : GssAPI.h
  • INTERFACE_C : GssAPI.h
  • INTERFACE_CAST : Server.Cpp
  • INTERFACE_ENTRY : networkentry.h
  • INTERFACE_IS_ACTIVE : networkentry.h
  • INTERFACE_IS_BOUND : networkentry.h
  • INTERFACE_IS_INACTIVE : networkentry.h
  • INTERFACE_IS_MULTIACCESS : networkentry.h
  • INTERFACE_IS_POINTTOPOINT : networkentry.h
  • INTERFACE_IS_UNBOUND : networkentry.h
  • INTERFACE_TABLE_BUCKETS : defs.h
  • interfacedata : ComPerf.Cpp
  • InterfaceIdxToInterfaceIp() : IPArp.h , IPArp.Cpp , IPRoute.Cpp , IPRoute.h
  • INTERFACEIMPL : OleStd.h
  • InterfaceIpToIdxAndMask() : IPRoute.Cpp , IPRoute.h
  • INTERFACEMAP : error.cpp
  • InterfaceStatus() : rmapi.c
  • IntermediateCompletionRoutine() : provider.h , overlap.cpp
  • InternalAssert() : winmain.cpp , winmain.h
  • InternalTrace() : common.h , winmain.cpp , winmain.h , winmain.cpp , common.cpp , winmain.h
  • InternalTraceFmt() : common.cpp , common.h
  • InterpretCustomFilterString() : Open.c
  • IntroduceCardType() : SCIntro.Cpp
  • IntroduceReaderGroup() : SCIntro.Cpp
  • INTS : suminfo.h
  • INVALID : PerfUtil.c
  • INVALID_INDEX : cdialoglite.h
  • INVALID_LINE : Dialer.h
  • INVALID_SEND_PRIORITY : QosEvent.h
  • INVALIDARG : HuError.h
  • INVALIDATE_PAGE : CacheIsapi.cpp
  • InvalidateClient() : Printer.h , Printer.c
  • InvalidateText() : Global.h , TextWnd.Cpp
  • IO_BUFFER_SIZE : WebClient.c , WebServer.c
  • IO_OPERATION : IocpServer.h
  • IO_WORK_ITEM : areadcli.c
  • IoBuffer : WebServer.c
  • IoCompletedEvent : AsyncIO.h
  • IoCompletionType : FileRepServerProc.cpp , FileRepClientProc.cpp
  • IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE : CStorageResource.cpp
  • IOCTL_VOLUME_GET_GPT_ATTRIBUTES : DLEdit.Cpp
  • IOCTLARGS : provider.h
  • IoFile : FileRepClientProc.cpp , FileRepServerProc.cpp
  • IoFileRep : FileRepServerProc.cpp , FileRepClientProc.cpp
  • IoPipe : FileRepClientProc.cpp , FileRepServerProc.cpp
  • IoPort : UnBufCp1.c
  • IP1 : rqs.h
  • IP2 : rqs.h
  • IP3 : rqs.h
  • IP4 : rqs.h
  • IP_ASSIGN : defs.h
  • IP_COMPARE : defs.h
  • IP_HIGHEST : defs.h
  • IP_LOWEST : defs.h
  • IP_RECORD_ROUTE : iphdr.h
  • IP_VALID : defs.h
  • IPADDRESS : defs.h
  • IPADDRLEN : WSnmpUtil.h
  • IPersistFile_LoadA : ansiapi.h
  • IPFile : AdminDll.c
  • IPFileInValid : AdminDll.c
  • iPortNumber : WebServer.c , WebClient.c
  • IPPROTO_ICMP6 : iphdr.h
  • iProxyPort : WebClient.c
  • IPSAMPLE_GLOBAL_CONFIG : ipsamplerm.h
  • IPSAMPLE_GLOBAL_CONFIG_ID : ipsamplerm.h
  • IPSAMPLE_GLOBAL_STATS : ipsamplerm.h
  • IPSAMPLE_GLOBAL_STATS_ID : ipsamplerm.h
  • IPSAMPLE_IF_ADDRESS_TABLE : ipsamplerm.h
  • IPSAMPLE_IF_BINDING : ipsamplerm.h
  • IPSAMPLE_IF_BINDING_ID : ipsamplerm.h
  • IPSAMPLE_IF_BINDING_SIZE : ipsamplerm.h
  • IPSAMPLE_IF_CONFIG : ipsamplerm.h
  • IPSAMPLE_IF_CONFIG_ID : ipsamplerm.h
  • IPSAMPLE_IF_STATS : ipsamplerm.h
  • IPSAMPLE_IF_STATS_ID : ipsamplerm.h
  • IPSAMPLE_IP_ADDRESS : ipsamplerm.h
  • IPSAMPLE_LOGGING_ERROR : ipsamplerm.h
  • IPSAMPLE_LOGGING_INFO : ipsamplerm.h
  • IPSAMPLE_LOGGING_NONE : ipsamplerm.h
  • IPSAMPLE_LOGGING_WARN : ipsamplerm.h
  • IPSAMPLE_METRIC_INFINITE : ipsamplerm.h
  • IPSAMPLE_MIB_GET_INPUT_DATA : ipsamplerm.h
  • IPSAMPLE_MIB_GET_OUTPUT_DATA : ipsamplerm.h
  • IPSAMPLE_MIB_SET_INPUT_DATA : ipsamplerm.h
  • IPSAMPLE_STATE_ACTIVE : ipsamplerm.h
  • IPSAMPLE_STATE_BOUND : ipsamplerm.h
  • IPSAMPLE_STATUS_CODE : configentry.h
  • IPSAMPLE_STATUS_RUNNING : configentry.h
  • IPSAMPLE_STATUS_STOPPED : configentry.h
  • IPSAMPLE_STATUS_STOPPING : configentry.h
  • IPSAMPLE_TRACE_ANY : defs.h
  • IPSAMPLE_TRACE_CONFIGURATION : defs.h
  • IPSAMPLE_TRACE_DEBUG : defs.h
  • IPSAMPLE_TRACE_ENTER : defs.h
  • IPSAMPLE_TRACE_LEAVE : defs.h
  • IPSAMPLE_TRACE_MIB : defs.h
  • IPSAMPLE_TRACE_NETWORK : defs.h
  • IPSAMPLE_TRACE_PACKET : defs.h
  • IPSAMPLE_TRACE_TIMER : defs.h
  • IPSAMPLELOG_BASE : log.h
  • IPSAMPLELOG_BIND_IF_FAILED : log.h
  • IPSAMPLELOG_CORRUPT_GLOBAL_CONFIG : log.h
  • IPSAMPLELOG_CORRUPT_INTERFACE_CONFIG : log.h
  • IPSAMPLELOG_CREATE_EVENT_FAILED : log.h
  • IPSAMPLELOG_CREATE_HASHTABLE_FAILED : log.h
  • IPSAMPLELOG_CREATE_RWL_FAILED : log.h
  • IPSAMPLELOG_CREATE_SEMAPHORE_FAILED : log.h
  • IPSAMPLELOG_CREATE_SOCKET_FAILED : log.h
  • IPSAMPLELOG_CREATE_TIMER_FAILED : log.h
  • IPSAMPLELOG_CREATE_TIMER_QUEUE_FAILED : log.h
  • IPSAMPLELOG_DESTROY_SOCKET_FAILED : log.h
  • IPSAMPLELOG_ENUM_NETWORK_EVENTS_FAILED : log.h
  • IPSAMPLELOG_EVENT_QUEUE_EMPTY : log.h
  • IPSAMPLELOG_EVENTSELECT_FAILED : log.h
  • IPSAMPLELOG_HEAP_ALLOC_FAILED : log.h
  • IPSAMPLELOG_HEAP_CREATE_FAILED : log.h
  • IPSAMPLELOG_INIT_CRITSEC_FAILED : log.h
  • IPSAMPLELOG_INPUT_RECORD_ERROR : log.h
  • IPSAMPLELOG_INTERFACE_ABSENT : log.h
  • IPSAMPLELOG_INTERFACE_PRESENT : log.h
  • IPSAMPLELOG_JOIN_GROUP_FAILED : log.h
  • IPSAMPLELOG_NETWORK_MODULE_ERROR : log.h
  • IPSAMPLELOG_PACKET_HEADER_CORRUPT : log.h
  • IPSAMPLELOG_PACKET_TOO_SMALL : log.h
  • IPSAMPLELOG_PACKET_VERSION_INVALID : log.h
  • IPSAMPLELOG_PROTOCOL_MODULE_ERROR : log.h
  • IPSAMPLELOG_RECVFROM_FAILED : log.h
  • IPSAMPLELOG_REGISTER_WAIT_FAILED : log.h
  • IPSAMPLELOG_RTM_REGISTER_FAILED : log.h
  • IPSAMPLELOG_SAMPLE_ALREADY_STARTED : log.h
  • IPSAMPLELOG_SAMPLE_ALREADY_STOPPED : log.h
  • IPSAMPLELOG_SAMPLE_START_FAILED : log.h
  • IPSAMPLELOG_SAMPLE_STARTED : log.h
  • IPSAMPLELOG_SAMPLE_STOP_FAILED : log.h
  • IPSAMPLELOG_SAMPLE_STOPPED : log.h
  • IPSAMPLELOG_SENDTO_FAILED : log.h
  • IPSAMPLELOG_SET_MCAST_IF_FAILED : log.h
  • IPSAMPLELOG_TIMER_MODULE_ERROR : log.h
  • IPSAMPLELOG_WSASTARTUP_FAILED : log.h
  • IPTLauncher_ServerInfo : BrochureMachine_p.c
  • IPV4_HDR : iphdr.h
  • IPv4_LENGTH_OFFSET : socket.c
  • IPV4_OPTION_HDR : iphdr.h
  • IPv4_PREVIEW_SIZE : socket.c
  • IPV6_FRAGMENT_HDR : iphdr.h
  • IPV6_HDR : iphdr.h
  • IPX : Bcast.c
  • IpxnetAddr() : Bcast.c
  • iRasterCaps : Mypal.c
  • irbcHt : msiloc.cpp
  • irbcOrder : msiloc.cpp
  • irbcText : msiloc.cpp
  • irbcWd : msiloc.cpp
  • irbcX : msiloc.cpp
  • irbcY : msiloc.cpp
  • irbiHeight : msiloc.cpp
  • irbiText : msiloc.cpp
  • irbiWidth : msiloc.cpp
  • irmCancel : setupui.h
  • irmNotInitialized : setupui.h
  • irmOK : setupui.h
  • irmProgress : setupui.h
  • is : defs.h
  • Is3XDriver() : quiktest.c
  • Is4OrMore() : MainDll.Cpp
  • Is911() : Dialer.c
  • IS_BLANK : utils.cpp , line.cpp
  • IS_BUFFER_ENOUGH() : queryusers.cpp , otherwko1.cpp , main.cpp , CreateUserHelpers.cpp , getschemainfo.cpp
  • IS_EVEN : common.h
  • IS_FILENAME_DELIM : getIcon.c
  • IS_NT : printjob.c , StatList.h , Generic.C , LeakyBin.c
  • IS_SEPARATOR : getIcon.c
  • IS_SIGNIFICANT_MSG : msgfiltr.c
  • IS_WIN30_DIB : Dibutil.h
  • IS_WIN32 : Generic.C , LeakyBin.c , StatList.h
  • IS_WIN32S : Generic.C , StatList.h
  • IS_WIN95 : Generic.C , StatList.h
  • IsAdmin() : setup.h , utils.cpp
  • ISAPI_ASSERT : IsapiTools.h
  • IsapiAssert() : IsapiDebug.cpp , IsapiDebug.h
  • IsapiWriteLog() : PoolWrap.h , PoolWrap.cpp
  • IsAudioStream() : Processing.cpp
  • IsBusy() : sdkdiff.cpp
  • iscCallback : AsyncDemo.cpp
  • IsChanged() : queue.h , queue.c
  • ISCHECKED : MciPlay.c
  • IsCName() : compitem.cpp
  • IsCompositeDataObject() : globals.cpp , globals.h
  • IsCreateExisting() : MMStrm.Cxx
  • IsDBCSTrailByte() : Main.C
  • ISDELAYLOADHRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ISDELAYLOADHRESULTFACILITY : ceerror.cpp , CeError.Cpp
  • ISDIGIT : Dialer.c
  • IsDirty() : ips.h
  • IsDocName() : compitem.cpp
  • IsDriveLetter() : DLEdit.Cpp
  • IsDsEnabledLocaly() : MqTrans.Cpp
  • IsEqualDBID() : common.h , common.cpp
  • IsEqualFORMATETC : OleStd.h
  • IsEqualGUID : tracedmp.h
  • IsEqualProtocolEntries() : instlsp.cpp
  • IsEqualUnknown() : globals.h , globals.cpp
  • IsEscapeSequence() : IsapiString.cpp
  • ISETUPPROPNAME_BASEURL : common.h
  • ISETUPPROPNAME_DATABASE : common.h
  • ISETUPPROPNAME_MINIMUM_MSI : common.h
  • ISETUPPROPNAME_OPERATION : common.h
  • ISETUPPROPNAME_PATCH : common.h
  • ISETUPPROPNAME_PRODUCTNAME : common.h
  • ISETUPPROPNAME_PROPERTIES : common.h
  • ISETUPPROPNAME_UPDATE : common.h
  • ISETUPPROPNAME_UPDATELOCATION : common.h
  • IsFileTrusted() : vertrust.cpp , setup.h
  • IsFixedType() : common.cpp , common.h
  • IsGroupMember() : service.h , service.cpp , Service.cpp , Service.h
  • ISHTTPERROR : ceerror.cpp , CeError.Cpp
  • ISHTTPHRESULT : ceerror.cpp , CeError.Cpp , ceerror.cpp
  • IsIdInChain() : instlsp.cpp
  • IsInAuthorizationSequence() : HttpAuth.h , HttpAuth.c
  • ISJETERROR : ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ISJETHRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • IsKeyEaten() : keys.cpp
  • IsKeySeparator() : keys.cpp
  • iSKIP_BINARY : msiloc.cpp
  • IsLegacySecurityModel() : UtilS.Cpp , DComPerm.h
  • IsListEmpty : list.h , openf.h , defs.h , openf.h , AsyncIO.h
  • IsMessageForActiveCall() : Processing.cpp
  • IsMMCMultiSelectDataObject() : dataobj.h , Dataobj.h , dataobj.h
  • IsMsiUpgradeNecessary() : upgrdmsi.cpp , setup.h
  • ISnap_ServerInfo : EdGlyphs_p.c , EdHost_p.c , EdCommands_p.c
  • IsNodeOnList() : defs.h , msputils.cpp
  • IsNT() : SetDisp.c , SetDisp.h
  • IsNT4OrBetter() : main.cpp
  • IsNumberInUnicodeList() : PerfUtil.c , PerfUtil.h , PerfUtil.c , PerfUtil.h
  • IsNumericType() : common.cpp , common.h
  • ISO() : Sample1.Cpp , Sample1.h
  • ISO_COPY : Sample1.h
  • ISO_DELETE : Sample1.h
  • ISO_MKDIR : Sample1.h
  • ISO_MOVE : Sample1.h
  • ISO_OPS : Sample1.h
  • IsolationLevelEnum : adoint.h
  • IsOleError() : Except.Cxx
  • ISOSSERROR : ceerror.cpp , CeError.Cpp
  • IsOSSupported() : utils.cpp , setup.h
  • IsPackageTrusted() : vertrust.cpp , setup.h
  • IsPartitionHidden() : DLEdit.Cpp
  • IsPrinterHandle() : printjob.c
  • IsQueueEmpty : list.h
  • IsRangeCovered() : globals.h , globals.cpp
  • ISRDEBUG : Debug.h
  • IsRenderingStream() : Processing.cpp
  • ISSCERT_FILEURL : Policy.Cpp
  • ISSCERT_FTPURL : Policy.Cpp
  • ISSCERT_HTTPURL : Policy.Cpp
  • ISSCERT_LDAPURL : Policy.Cpp
  • IsSecureClient() : filerepclientproc.cpp , FileRepClientProc.cpp
  • IsServiceRunning() : Admapit.c
  • IsSettableProperty() : property.h , property.cpp , property.h
  • ISSETUPHRESULT : ceerror.cpp , CeError.Cpp
  • IsSharingEnabled() : Dlg.Cpp , Global.h
  • IsSpecialPropSet() : error.cpp , error.h
  • IsStackEmpty : list.h
  • IsStringInList() : Policy.Cpp
  • IssueQuery() : QSample.Cxx
  • IsSupportedProperty() : property.cpp , property.h , property.cpp , property.h
  • IStringCompareW() : PropList.h , PropList.cpp , StringUtils.h , PropList.cpp , StringUtils.cpp , StringUtils.h , PropList.h , StringUtils.h , PropList.cpp , StringUtils.cpp , StringUtils.h , PropList.h , PropList.cpp , StringUtils.cpp , StringUtils.h , PropList.h , StringUtils.h
  • iSTRINGS : msiloc.cpp
  • IsUnicodeOS() : common.h , common.cpp
  • IsUpdateRequiredVersion() : upgrdmsi.cpp , setup.h
  • IsUpToDate() : ioo.h
  • IsValidAddress() : llistimpl.h , llistimpl.cpp , llistimpl.h , llistimpl.cpp , llistimpl.h , llistimpl.cpp , llistimpl.h , llistimpl.cpp , llistimpl.h
  • IsValidAudioFile() : tapisend.cpp
  • IsValidDir() : Helper.h , Helper.Cpp
  • IsValidHandle : stdafx.h
  • IsVariableType() : common.cpp , common.h , common.cpp , common.h
  • IsVideoCaptureStream() : Outgoing.Cpp , Incoming.Cpp
  • IsViewWindow() : Utility.Cpp , Utility.h
  • ISWHITE : AuthFilt.h
  • iswildpath() : scandir.cpp
  • ISWIN32ERROR : ceerror.cpp , CeError.Cpp
  • ISWIN32HRESULT : CeError.Cpp , ceerror.cpp
  • IsWindowsXP_orLater() : DLEdit.Cpp
  • IsWordChar() : lrsample.CXX
  • ITEM : list.cpp
  • ITEM_COUNT : VListVw.c
  • ITEM_DESC : tracedmp.h
  • ITEM_TYPE : globals.h , tracedmp.h
  • ItemBool : tracedmp.h
  • ItemChar : tracedmp.h
  • ItemCharShort : tracedmp.h
  • ItemConfigDlgProc() : Settings.h , Settings.Cpp
  • ITEMCONFIGSETTINGSLPARAM : Settings.h
  • ItemDataDlgProc() : Utility.Cpp , Utility.h
  • ItemDouble : tracedmp.h
  • ItemDSString : tracedmp.h
  • ItemDSWString : tracedmp.h
  • ItemFloat : tracedmp.h
  • ItemFromPApp() : chWnd.Cpp
  • ItemFromPUser() : cMemb.Cpp
  • ItemGuid : tracedmp.h
  • ItemIPAddr : tracedmp.h
  • ItemLong : tracedmp.h
  • ItemLongLong : tracedmp.h
  • ItemMLString : tracedmp.h
  • ItemNWString : tracedmp.h
  • ItemPort : tracedmp.h
  • ItemPString : tracedmp.h
  • ItemPtr : tracedmp.h
  • ItemPWString : tracedmp.h
  • ItemShort : tracedmp.h
  • ItemSid : tracedmp.h
  • ItemString : tracedmp.h
  • ItemUChar : tracedmp.h
  • ItemULong : tracedmp.h
  • ItemULongLong : tracedmp.h
  • ItemULongX : tracedmp.h
  • ItemUnknown : tracedmp.h
  • ItemUShort : tracedmp.h
  • ItemWChar : tracedmp.h
  • ItemWString : tracedmp.h
  • iTestNames : quiktest.c
  • itoa : Dialer.h
  • IToClass : Priv.h
  • IToClassN : Priv.h
  • iTT() : MfEdit.h , MfEdit.c
  • itvEnum : setup.h
  • itvTrusted : setup.h
  • itvUnTrusted : setup.h
  • itvWintrustNotOnMachine : setup.h
  • IUPnPService_DimmingService_SCPD : MyDevice.h
  • IUPnPService_DimmingService_SCPD_get_dimLevel_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_get_dimLevel_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_get_Power_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_get_Power_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetConfigDetails_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetConfigDetails_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetDimLevel_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetDimLevel_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetPowerValue_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetPowerValue_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOff_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOff_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOn_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOn_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_SetDimLevel_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_SetDimLevel_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPDVtbl : MyDevice.h
  • iYMiddle : Mypal.c
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- p -

  • P_ALIGN : table.h
  • P_BCOLOUR : table.h
  • P_BOX : table.h
  • P_BOXALL : table.h
  • P_BOXBOTTOM : table.h
  • P_BOXLEFT : table.h
  • P_BOXRIGHT : table.h
  • P_BOXTOP : table.h
  • P_BROWSER_CONFIG : browser.h
  • P_CENTRE : table.h
  • P_FCOLOUR : table.h
  • P_FCOLOURWS : table.h
  • P_FONT : table.h
  • P_HEIGHT : table.h
  • P_LEFT : table.h
  • P_RIGHT : table.h
  • P_WIDTH : table.h
  • PACCESSOR : sampprov.h
  • PACKAGE_CAPABILITIES : SampSSP.H
  • PACKAGE_COMMENT : SampSSP.H
  • PACKAGE_MAXTOKEN : SampSSP.H
  • PACKAGE_NAME : SampSSP.H
  • PACKAGE_RPCID : SampSSP.H
  • PACKAGE_SIGNATURE_SIZE : SampSSP.H
  • PACKAGE_SIGNATURE_TAG : SampSSP.H
  • PACKAGE_VERSION : SampSSP.H
  • PackageConnectLookup() : KList.c
  • PACKET : packet.h
  • PACKET_NAME : AuthenticatePlugin.cpp
  • PacketCreate() : packet.c , packet.h
  • PacketDestroy() : packet.c , packet.h
  • PacketDisplay : packet.h
  • PacketizeIpv4() : rawudp.c
  • PacketizeIpv6() : rawudp.c
  • PActualFromPUser() : malspy.c
  • pAdminSID : Service.cpp , Service.h , service.cpp
  • PADMINTYPE : Adminwrap.h
  • pAdsTypeToStringList : UserProps.cpp
  • PADVISE_SINK : tsfedit.h
  • Page0Proc() : PhoneEntry.c
  • Page1Proc() : PhoneEntry.c
  • Page2Proc() : PhoneEntry.c
  • PAGE_NAME_SIZE : IPageS.h
  • PAGE_TITLE_SIZE : IPageS.h
  • PAGEELEMS : Grid.Hxx
  • PAGEHEIGHT : APP.h
  • PAGELIST_USTR : IPageS.h
  • PAGEPRINT : Grid.Hxx
  • pages : tprint.cpp
  • PageSize : UnBufCp1.c , UnBufCp2.c
  • PAGESIZE : UtilLib.h
  • PAGETYPE_DELETED : IPageS.h
  • PAGETYPE_DRAWING : IPageS.h
  • PAGETYPE_NONE : IPageS.h
  • PAGETYPE_TEXT : IPageS.h
  • PAGEWIDTH : APP.h
  • Paint() : Paint.c , SpinCube.c , TextWnd.Cpp , Common.h , Paint.c
  • PaintBitmap() : Copy.c , Dibapi.h
  • PaintDIB() : Copy.c , Dibapi.h
  • PaintFormattedRun() : DspFormt.Cpp
  • PaintFormattedText() : DspFormt.Cpp , Global.h
  • PaintFormattedTextLine() : DspFormt.Cpp
  • PaintFormattedTextPara() : DspFormt.Cpp
  • PaintLogical() : DspLogcl.Cpp , Global.h
  • PaintPlainText() : DspPlain.Cpp , Global.h
  • PaintPlainTextLine() : DspPlain.Cpp
  • PaintProc() : GdiDemo.c , GdiDemo.h
  • PaintTime() : TIMEWND.c
  • PaintWindow() : AppUtil.Cpp , AppUtil.h , Dialog.c , GdiDemo.h
  • PalEntriesOnDevice() : Dibapi.h , Dibutil.c
  • PaletteSize() : Dibapi.h , Dibutil.c , Dib.c , Dib.h
  • PALETTESIZE : Mypal.h
  • palSVGA : stdpal.h
  • PALVERSION : Dibutil.h
  • pAnonSID : Service.cpp , Service.h , service.cpp
  • PAPMFILEHEADER : MfEdit.h
  • pAppData : AppMema.h , DllInit.c
  • PAPPMEM_COUNTERS : DataMem.h
  • PAPPMEM_DATA_HEADER : AppMemi.h
  • PAPPMEM_INSTANCE : AppMemi.h
  • PARAM_NONE : common.h
  • PARAM_SIZE : log.c
  • paramdata : ComPerf.Cpp
  • Parameter : adoint.h
  • ParameterAttributesEnum : adoint.h
  • ParameterDirectionEnum : adoint.h
  • Parameters : adoint.h
  • Parameters_get_Item_Proxy() : adoint.h
  • Parameters_get_Item_Stub() : adoint.h
  • ParametersVtbl : adoint.h
  • PARAMS : Cancel.Cpp
  • PARENT : Sockdups.c
  • PARFONTS : Paint.h
  • parFontsGlobal : Paint.h
  • parse_command() : DbgCmd.c
  • PARSE_DIRECTORYNAME : Utility.c
  • PARSE_EMPTYSTRING : Utility.c
  • PARSE_EXTENTIONTOOLONG : Utility.c
  • PARSE_FILETOOLONG : Utility.c
  • PARSE_INVALIDCHAR : Utility.c
  • PARSE_INVALIDDIRCHAR : Utility.c
  • PARSE_INVALIDDRIVE : Utility.c
  • PARSE_INVALIDNETPATH : Utility.c
  • PARSE_INVALIDPERIOD : Utility.c
  • PARSE_INVALIDSPACE : Utility.c
  • PARSE_WILDCARDINDIR : Utility.c
  • ParseAndDump() : PathParser.cpp
  • ParseAndPrintv2Trap() : Helper.Cpp , WSnmpUtil.h
  • ParseArgs() : sdkdiff.cpp
  • ParseArguments() : main.cpp , TestAccept.cpp
  • ParseAuthorityUserArgs() : WbemSec.Cpp
  • ParseCmdLine() : bthcxn.cpp , Main.Cpp
  • ParseCommand() : FTPJr.cpp
  • ParseCommandLine() : main.cpp , Helper.Cpp , WSnmpUtil.h , msistuff.cpp , dxsurf3.cpp
  • ParseDateTime() : HtmlProp.Cxx
  • ParseParams() : HeadDump.cpp
  • ParsePropertyFile() : HtmlProp.Cxx
  • ParserAutoInstallInfo() : blrplate.c
  • parwszUserMandatoryProps : UserProps.cpp
  • parwszUserOptionalProps : UserProps.cpp
  • PasswordChangeNotify() : PwdFilt.c
  • PasswordFilter() : PwdFilt.c
  • PASYNC_REQUEST : Atsp.h
  • PatchQuery() : adoisapi.cpp
  • PATHPROP : UtilLib.h
  • PATTRIBUTES : tsfedit.h
  • PAUTH_SEQ : Security.cpp
  • pAutoApt : ComPerf.Cpp
  • pAutoAptRmt : ComPerf.Cpp
  • pAutoFree : ComPerf.Cpp
  • pAutoFreeRmt : ComPerf.Cpp
  • PAWI : ftrans.c , fwasync.c
  • PBALLDATA : Bounce.h
  • PBEZBUFFER : Poly.h
  • PBINDING_ENTRY : networkentry.h
  • pBindingVector : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • PBLOCK : list.cpp
  • PBLRPLATECONFIG : blrplate.h
  • PBLRPLATEHDR : blrplate.h
  • PBOUNCEDATA : Bounce.h
  • pbstrResult : Account.Idl
  • pByte : SimpleLog.Idl
  • PCBINDER : binder.h
  • PCClassPro : Sample.h
  • pcClientBuffer : Pipec.c
  • PCCOMMAND : command.h
  • PCDATASOURCE : datasrc.h
  • PCDBSESSION : dbsess.h
  • PCEnumFormatEtc : enumformatetc.h
  • PCFILEIO : fileio.h
  • PCFileViewer : FVText.h
  • PCFrame : Framer.h
  • PCFVClassFactory : FileView.h
  • pchDesc : langbar.cpp
  • PCHILDWINDOWDATA : MDIChild.h
  • PCHourglass : Framer.h
  • PCHUNKHDR : SMFI.h
  • PCIB : MainWnd.h
  • PCImpIAdviseSink : Site.h
  • PCImpIOleClientSite : Site.h
  • PCImpIOleDocumentSite : Site.h
  • PCImpIOleInPlaceSite : Site.h
  • PCInstPro : Sample.h
  • pClientActiveReqCounters : Service.cpp , Service.h , service.cpp , service.h
  • pClientReqCounters : Service.cpp , Service.h , service.cpp , service.h
  • PCLIPBOOKSERVER_RESOURCE : ClipBook Server.cpp
  • PCMD : dbh.cpp
  • PCMD_ARGS : DbgCmd.c
  • PCMethodPro : MethProv.h
  • PCOLORPICKSTATE : fakemenu.c
  • PCOLUMNDATA : hashtbl.h
  • pCOMApt : ComPerf.Cpp
  • pCOMAptRmt : ComPerf.Cpp
  • pCOMFree : ComPerf.Cpp
  • pCOMFreeRmt : ComPerf.Cpp
  • PCOMPARE_FUNCTION : hashtable.h
  • PCOMPARE_ROUTINE : AsyncIO.h
  • PCOMPARTMENTMONITORPROC : monitor.h
  • PCONFIGURATION_ENTRY : configentry.h
  • PCONST_DWORD_REP : stdafx.h
  • PCONST_GUID_REP : stdafx.h
  • PCONST_WORD_REP : stdafx.h
  • PCONTEXT_HANDLE_TYPE_rundown() : filerepserverproc.cpp , Cxhndlp.c
  • PCOPY_CHUNK : UnBufCp1.c , UnBufCp2.c
  • pCount : Tst4Wts.c
  • PCProvFactory : Sample.h , MethProv.h , Sample.h
  • PCREDENTIAL : SampSSP.H
  • PCROWSET : rowset.h
  • PCRTTHREADPROC : AppUtil.h
  • pCSet : APP.Cxx
  • PCSite : Site.h
  • PCStatusHelper : CStatHlp.h
  • PCStringTable : CStrTabl.h
  • PCTM2PSMX : DropExt.C
  • pCurrent : list.cpp
  • PCUTILPROP : utilprop.h
  • pd : Print.c
  • pDataHeader : AppMema.h , DllInit.c
  • PDBG_THREAD_INFO : Utils.c
  • PDEB_DLL_LIST_INFO : DebDebug.h
  • PDEB_DLL_NODE_INFO : DebDebug.h
  • PDEB_PROCESS_LIST_INFO : DebDebug.h
  • PDEB_PROCESS_NODE_INFO : DebDebug.h
  • PDEB_STARTUP_INFO : DebDebug.h
  • PDEB_THREAD_LIST_INFO : DebDebug.h
  • PDEB_THREAD_NODE_INFO : DebDebug.h
  • PDEVICE_INFO : NewFsp.h
  • PDIBDATA : MfEdit.h
  • PDIRECTORY_ENUMERATE_ROUTINE : AsyncIO.h
  • PDISPLAY_FUNCTION : hashtable.h
  • PDRAWDATA : Draw.h
  • PDRVLINE : Atsp.h
  • PDRVLINECONFIG : Atsp.h
  • PDSA_SEC_PAGE_INFO : PropSheetHost.h
  • pdThread1 : Print.c
  • pdThread2 : Print.c
  • PDWORD : GinaHook.h , GinaStub.h
  • PDYNAMIC_LOCKS_STORE : sync.h
  • PDYNAMIC_READWRITE_LOCK : sync.h
  • PEDITARGS : sdkdiff.cpp
  • PENCUR_MEDIUM : DComDraw.h
  • PENCUR_OFF : DComDraw.h
  • PENCUR_ON : DComDraw.h
  • PENCUR_THICK : DComDraw.h
  • PENCUR_THIN : DComDraw.h
  • PendingEnd : overlap.cpp
  • PendingStart : overlap.cpp
  • PENSTYLELOOKUP : Printer.h
  • PENTRY : secClnt.Cpp , secSvr.Cpp
  • PENUMERATE_DIRECTORY_STACK : AsyncIO.h
  • PENUMERATE_DIRECTORY_STATE : AsyncIO.h
  • PENUMSYMDATA : dbh.cpp
  • PENWIDTHLOOKUP : Printer.h
  • PER_IO_CONTEXT : IocpServer.h
  • PER_SOCKET_CONTEXT : IocpServer.h
  • PERCENT : AsyncRPCp.c
  • PERF : ComPerf.Cpp
  • Perform() : account.Idl
  • PerformanceFrequency : ComSpy.Cpp , Methodsub.Cpp
  • PerfThread() : PrPerf.c , PrSamp.h
  • PERIODIC_INTERVAL : defs.h
  • PERR : SecFile.c , SidClean.c , log.c , NmPipe.c
  • PERS_HANDSOFF : AppUtil.h
  • PERS_NOSCRIBBLE : AppUtil.h
  • PERS_SCRIBBLE : AppUtil.h
  • PERS_UNINIT : AppUtil.h
  • persistMediaID() : app.cpp , app_utls.cpp
  • persistPoolID() : app.cpp , app_utls.cpp
  • PERSTGSTATE : AppUtil.h
  • petcSrc : OleStd.h
  • PEVENT_ENTRY : configentry.h
  • PEX_BUF : common.h
  • PEXEDLLICONINFO : Icons.C
  • pfd : Font.c
  • pfEmbedFlag : Utils.Cpp
  • pFetcRight : OleStd.h
  • PFILEHDR : SMFI.h
  • PFILEINFO : MfEdit.h
  • PFILESHARESAMPLE_PROPS : File Share Sample.cpp
  • PFILESHARESAMPLE_RESOURCE : File Share Sample.cpp
  • PFLAGMAPPING : Gss-Misc.h
  • PFN_FIRST_HIT_INIT : IsapiExtension.h
  • PFN_REQUESTCB : Range.h
  • PFnAdjustTokenPrivileges : utils.cpp
  • pfnArrayCallback : AdsiDump.cpp
  • PFnCertCompareCertificate : vertrust.cpp
  • PFnCertDuplicateCertificateContext : vertrust.cpp
  • PFnCertFreeCertificateContext : vertrust.cpp
  • PFnCheckTokenMembership : utils.cpp
  • PFNCMD : GLOBALS.h , Globals.h , Global.h
  • PFNDESTROYED : FileView.h
  • pfnHandler : langbar.cpp
  • PFnLookupPrivilegeValue : utils.cpp
  • PFNMSG : GLOBALS.h , Globals.h , Global.h , Msg.Cpp , Global.h
  • PFnMsiApplyPatch : setup.cpp
  • PFnMsiCloseHandle : setup.cpp
  • PFnMsiDatabaseOpenView : setup.cpp
  • PFnMsiInstallProduct : setup.cpp
  • PFnMsiOpenDatabase : setup.cpp
  • PFnMsiQueryProductState : setup.cpp
  • PFnMsiRecordGetString : setup.cpp
  • PFnMsiReinstallProduct : setup.cpp
  • PFnMsiSetInternalUI : setup.cpp
  • PFnMsiSIPDllRegisterServer : upgrdmsi.cpp
  • PFnMsiViewExecute : setup.cpp
  • PFnMsiViewFetch : setup.cpp
  • PFnOpenProcessToken : utils.cpp
  • PFnWinVerifyTrust : vertrust.cpp
  • pfnWSAEventSelectSpec : rusocket.h
  • PFnWTHelperGetProvCertFromChain : vertrust.cpp
  • PFnWTHelperGetProvSignerFromChain : vertrust.cpp
  • PFnWTHelperProvDataFromStateData : vertrust.cpp
  • PFONTLIST : Dialogs.c
  • PFONTSTRUCT : Dialogs.c
  • PFREE_FUNCTION : hashtable.h
  • PFUNC_INFO : Atsp.h
  • PFUNDSRM : AuthzSvr.c
  • pfWlxActivateUserShell : GinaStub.c
  • pfWlxDisplayLockedNotice : GinaStub.c
  • pfWlxDisplaySASNotice : GinaStub.c
  • pfWlxDisplayStatusMessage : GinaStub.c
  • pfWlxGetStatusMessage : GinaStub.c
  • pfWlxInitialize : GinaStub.c
  • pfWlxIsLockOk : GinaStub.c
  • pfWlxIsLogoffOk : GinaStub.c
  • pfWlxLoggedOnSAS : GinaStub.c
  • pfWlxLoggedOutSAS : GinaStub.c
  • pfWlxLogoff : GinaStub.c
  • pfWlxNegotiate : GinaStub.c
  • pfWlxNetworkProviderLoad : GinaStub.c
  • pfWlxRemoveStatusMessage : GinaStub.c
  • pfWlxScreenSaverNotify : GinaStub.c
  • pfWlxShutdown : GinaStub.c
  • pfWlxStartApplication : GinaStub.c
  • pfWlxWkstaLockedSAS : GinaStub.c
  • PGLOBAL : DebMain.h
  • pguid : register.cpp
  • pguidCategory : register.cpp
  • PHANDLE : GinaHook.h , GinaStub.h
  • PHASH_FUNCTION : hashtable.h
  • PHASH_TABLE : hashtable.h
  • phRasServer : Admapit.c
  • PHTTP_REQUEST_PARAM : Range.h
  • PHTTP_REQUEST_RANGE : Range.h
  • PHTTP_REQUESTCB_PARAM : Range.h
  • PHTTPCFG_TYPE : precomp.h
  • phwnd : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • PhysAddrToString() : IPArp.Cpp , IPArp.h
  • PHYSICAL_HANDLE : nullmdm.h
  • PicAlloc() : Picklpc.c , Pickltc.c
  • PickleControlBlock : Picklpc.c , Pickltc.c
  • PickUpProfile() : sdkdiff.cpp
  • PICMP_HDR : iphdr.h
  • PICONDIR : Icons.h
  • PICONDIRENTRY : Icons.h
  • PICONIMAGE : Icons.h
  • PICONRESOURCE : Icons.h
  • PicRead() : Picklpc.c , Pickltc.c
  • picture_mode : sdkdiff.cpp
  • PicWrite() : Picklpc.c , Pickltc.c
  • pid : suminfo.h
  • PID_HEADING_1 : HtmlGuid.Hxx
  • PID_HEADING_2 : HtmlGuid.Hxx
  • PID_HEADING_3 : HtmlGuid.Hxx
  • PID_HEADING_4 : HtmlGuid.Hxx
  • PID_HEADING_5 : HtmlGuid.Hxx
  • PID_HEADING_6 : HtmlGuid.Hxx
  • PID_HREF : HtmlGuid.Hxx
  • PID_TITLE : HtmlGuid.Hxx
  • Pidl_Concatenate() : enumdesk.cpp , enumdesk.h
  • Pidl_Copy() : enumdesk.cpp , enumdesk.h
  • Pidl_Create() : enumdesk.cpp
  • Pidl_Free() : enumdesk.cpp , enumdesk.h
  • Pidl_GetNextItem() : enumdesk.cpp
  • Pidl_GetSize() : enumdesk.cpp
  • PIDLDATA : PidlMgr.h
  • PidlFromPath() : sendto.c
  • PIE : Common.h
  • PIGMP_GROUP_RECORD_V3 : iphdr.h
  • PIGMP_HDR : iphdr.h
  • PIGMP_HDR_QUERY_V3 : iphdr.h
  • PIGMP_HDR_REPORT_V3 : iphdr.h
  • PILIST : status.cpp
  • PIMPCONVERTTYPE : row.h
  • PIMPIACCESSOR : rowset.h
  • PIMPIBINDRESOURCE : binder.h , dbsess.h
  • PIMPICOLUMNSINFO : command.h , row.h , rowset.h
  • PIMPICOMMANDPROPERTIES : command.h
  • PIMPICOMMANDTEXT : command.h
  • PIMPICONVERTTYPE : command.h , rowset.h
  • PIMPICREATEROW : binder.h
  • PIMPIDBBINDERPROPERTIES : binder.h
  • PIMPIDBCREATECOMMAND : dbsess.h
  • PIMPIDBCREATESESSION : datasrc.h
  • PIMPIDBINFO : datasrc.h
  • PIMPIDBINITIALIZE : datasrc.h
  • PIMPIDBProperties : datasrc.h
  • PIMPIFILEVIEWER : FVText.h
  • PIMPIGETDATASOURCE : dbsess.h
  • PIMPIGETROW : rowset.h
  • PIMPIGETSESSION : row.h
  • PIMPIOPENROWSET : dbsess.h
  • PIMPIPERSIST : datasrc.h
  • PIMPIPERSISTFILE : FVText.h
  • PIMPIROW : row.h
  • PIMPIROWCHANGE : row.h
  • PIMPIROWSET : rowset.h
  • PIMPIROWSETCHANGE : rowset.h
  • PIMPIROWSETIDENTITY : rowset.h
  • PIMPIROWSETINFO : rowset.h
  • PIMPISESSIONPROPERTIES : dbsess.h
  • Ping() : Server.c
  • PINGTIMEOUT : Client.h
  • PINITDATA : Dt.h
  • PINTERFACE_ENTRY : networkentry.h
  • PIO_OPERATION : IocpServer.h
  • PIOWI : areadcli.c
  • PIPADDRESS : defs.h
  • PIPE_AS_IN_OUT_PARAMETER : client.cxx
  • PIPE_AS_IN_PARAMETER : client.cxx
  • PIPE_AS_OUT_PARAMETER : client.cxx
  • pipe_in() : client.cxx
  • pipe_in_out() : client.cxx
  • pipe_out() : client.cxx
  • PIPE_SIZE : component.cxx
  • PipeAlloc() : Pipec.c
  • pipeCheck() : NmPipe.c
  • PipePull() : Pipec.c
  • PipePush() : Pipec.c
  • PIPES_AS_IN_IN_OUT_PARAMETERS : client.cxx
  • pipes_in_in_out() : client.cxx
  • PIPSAMPLE_GLOBAL_CONFIG : ipsamplerm.h
  • PIPSAMPLE_GLOBAL_STATS : ipsamplerm.h
  • PIPSAMPLE_IF_BINDING : ipsamplerm.h
  • PIPSAMPLE_IF_CONFIG : ipsamplerm.h
  • PIPSAMPLE_IF_STATS : ipsamplerm.h
  • PIPSAMPLE_IP_ADDRESS : ipsamplerm.h
  • PIPSAMPLE_MIB_GET_INPUT_DATA : ipsamplerm.h
  • PIPSAMPLE_MIB_GET_OUTPUT_DATA : ipsamplerm.h
  • PIPSAMPLE_MIB_SET_INPUT_DATA : ipsamplerm.h
  • PIPSAMPLE_STATUS_CODE : configentry.h
  • PIPV4_HDR : iphdr.h
  • PIPV4_OPTION_HDR : iphdr.h
  • PIPV6_FRAGMENT_HDR : iphdr.h
  • PIPV6_HDR : iphdr.h
  • PITEM_DESC : tracedmp.h
  • pJAustin : Disp1.Idl
  • PJOB_INFO : NewFsp.h
  • PKEYFRAME : SMF.c
  • PLAY_FILENAME : CallNot.h
  • PLAYINFO : MfEdit.h
  • PLEASE_READ : Client32.h , Server32.h
  • PLEASE_WRITE : Client32.h , Server32.h
  • PLG_BLT : Common.h
  • PLIST : list.h , LinkList.h
  • PLISTPROP : keys.cpp
  • pLoadMltFmtFile() : MfEdit.c , MfEdit.h
  • PLOCAL_HEAP_INFO : PerfUtil.h
  • PLOCKED_LIST : sync.h
  • PLOCKED_QUEUE : sync.h
  • PLOGON : Security.Cpp
  • plReceiptNo : Account.Idl
  • PLSTSLOT : hashtbl.h
  • PLUGABLE_PORT_NUMBER : nmsession.h
  • PLUGXPRT_CALL_TYPE : iplgxprt.idl
  • PLUGXPRT_CALLEE : iplgxprt.idl
  • PLUGXPRT_CALLER : iplgxprt.idl
  • PLUGXPRT_FRAMING : iplgxprt.idl
  • PLUGXPRT_PARAMETERS : iplgxprt.idl
  • PLUGXPRT_PSTN_CALL_CONTROL : iplgxprt.idl
  • PLUGXPRT_PSTN_CALL_CONTROL_MANUAL : iplgxprt.idl
  • PLUGXPRT_PSTN_CALL_CONTROL_PORT_HANDLE : iplgxprt.idl
  • PLUGXPRT_UNKNOWN_CALL_TYPE : iplgxprt.idl
  • PLUID : GinaHook.h , GinaStub.h
  • pMainView : MainFrm.h , MqApiTst.Cpp
  • PMAZEDATA : Maze.h
  • PMEMICONDIR : Icons.h
  • PMEMICONDIRENTRY : Icons.h
  • PMEMORY_ALLOC_BLOCK : LeakyBin.h
  • PMESSAGE : SampSSP.H
  • PMOF_INFO : tracedmp.h
  • PMSG : SidClean.c
  • PMSG_META : SMF.h
  • PMSV1_0_INTERACTIVE_LOGON : Npaux.h
  • PMSV1_0_LOGON_SUBMIT_TYPE : Npaux.h
  • PMULTI_SZ : multisz.h
  • PMYXFORM : Bounce.h
  • pName : FrameworkProv.h
  • PNETWORK_ENTRY : networkentry.h
  • PNODE : Collect.cpp , LinkList.h
  • POBJECT : Main.h
  • POINT2MPOINT : Select.h , Cursor.h
  • POINTER_DISPLAYSIZE : common.h
  • PointerSize : tracedmp.cpp
  • PointerToNthField() : getIcon.c , Utility.h
  • pointl : OleStd.h
  • POINTSIZE : ABOUT.c , About.c
  • polFindObjIdInList() : policy.cpp , policy.h
  • polGetCertificateExtension() : policy.cpp , policy.h
  • polGetCertificateLongProperty() : policy.cpp , policy.h
  • polGetCertificateStringProperty() : policy.cpp , policy.h
  • polGetLongProperty() : policy.cpp
  • polGetProperty() : policy.cpp
  • polGetRequestAttribute() : policy.cpp , policy.h
  • polGetRequestLongProperty() : policy.cpp , policy.h
  • polGetRequestStringProperty() : policy.cpp , policy.h
  • polGetServerCallbackInterface() : policy.cpp , policy.h
  • polGetStringProperty() : policy.cpp
  • Poll() : sdkdiff.cpp , sdkdiff.h
  • PollingUpdate() : threads.c , threads.h
  • polSetCertificateExtension() : policy.cpp , policy.h
  • POLYBEZIER : Common.h
  • POLYCLASS : Poly.h
  • PolyCommandProc() : Poly.c , Poly.h
  • PolyCreateProc() : Poly.c , Poly.h
  • POLYDATA : Poly.h
  • PolyDestroyProc() : Poly.c , Poly.h
  • PolyDraw95() : MfEdit.c , Fx.c
  • PolyDrawBez() : Poly.c , Poly.h
  • POLYGON : Common.h
  • PolyInitPoints() : Poly.c , Poly.h
  • POLYLINE : Common.h
  • PolyNewVel() : Poly.c , Poly.h
  • PolyPaintProc() : Poly.c , Poly.h
  • POLYPOLYGON : Common.h
  • PolyProc() : Poly.c , Poly.h
  • PolyRedraw() : Poly.c , Poly.h
  • POLYTITLE : GdiDemo.h
  • POOL_THREADS : ThreadPool.h
  • POOLTEST : resource.h
  • Pop : list.h
  • POPTIONS : AppBar.h
  • PopulateADSAttrInfo() : main.cpp
  • PopulateAttrInfoFromFile() : main.cpp
  • PopulateBuffer() : pipe.cxx , pipe.hxx
  • PopulateComboBoxFromStringList() : helper.cpp , helper.h
  • PopulateListBoxFromStringList() : helper.cpp , helper.h
  • PopUpAssert() : altassrt.Cxx , assert.h
  • PopUpError() : altassrt.Cxx
  • POPUPMENUMAP : CStatHlp.h
  • PORT_HDR : iphdr.h
  • POS : cexlist.h
  • POS_ACTIONS : MidiPlyr.h
  • POS_FILE : MidiPlyr.h
  • POS_OPTIONS : MidiPlyr.h
  • POS_PLAYTHRU : MidiPlyr.h
  • POSDATA : keys.cpp
  • POSITION : clUtil.h , list.h , llistimpl.h
  • PositionEnum : adoint.h
  • PositionHeader() : VListVw.c
  • Post() : account.Idl
  • PostError() : setup.h , utils.cpp
  • PostFormattedError() : setup.h , utils.cpp
  • PostHangupCall() : TapiCode.c , TapiCode.h
  • PostJobStatus() : NewFsp.h , Util.c
  • POSTKEY : keys.cpp
  • PostMsiError() : setup.h , utils.cpp
  • PostProcessString() : common.cpp , common.h
  • PostRecvfrom() : Ping.cpp
  • PostResourceNotFoundError() : setup.h , utils.cpp
  • PostWriteToDisplayCtl() : EDITCTLS.c , EDITCTLS.h
  • POTENTIAL : nshsamp.h
  • PPACKET : packet.h
  • PPER_IO_CONTEXT : IocpServer.h
  • PPER_SOCKET_CONTEXT : IocpServer.h
  • PPOLYDATA : Poly.h
  • PPOPUPMENUMAP : CStatHlp.h
  • PPORT_HDR : iphdr.h
  • PPOSDATA : keys.cpp
  • PPOSTKEY : keys.cpp
  • PPP_EAP_PROTOCOL_ID : Eap.h
  • ppRasUser0 : Admapit.c
  • pProcessList : DebDebug.c
  • PPROFILE : DebMain.h
  • PPROPSHEETCFG : PropSheetHost.h
  • PPRTDATA : MfEdit.h
  • ppServerInfo : Tst4Wts.c
  • ppvObject : Priv.h
  • PPVOID : AppUtil.h , Sample.h , MethProv.h , Sample.h , FileView.h
  • pQueryAllInterfacesOut : ADSIhelpers.cpp
  • PQUEUE_ENTRY : list.h
  • pr2six : HttpAuth.c
  • PRASHOST_DATA : RasHost.h
  • PREAD_WRITE_LOCK : sync.h
  • PreConfigureDevice() : TapiCode.c
  • PRECTI : Paint.h
  • pRedNose : FrameworkProv.h
  • PREF : Global.h
  • PreferencesDlgProc() : DebMain.c
  • PREFIX_FORMAT : Utility.c
  • PREFIX_SIZE : quiktest.h , Utility.c
  • prefNameLookup : main.cxx
  • pRemAddr : Globals.h
  • PREPAREFORSYNCCOMPLETEDMSG : Handler.h
  • PREPAREFORSYNCMSG : Handler.h
  • PrepareRecvBuffer() : TestAccept.cpp
  • PrepareSendBuffer() : TestAccept.cpp
  • PrepareSendMessageProperties() : MqTrans.Cpp
  • PrepareTx() : RmWorker.Idl
  • PREQ_CANCEL : View.Hxx
  • PREQ_ERRENDPAGE : View.Hxx
  • PREQ_ERROR : View.Hxx
  • PREQ_ERRSTARTDOC : View.Hxx
  • PREQ_ERRSTARTPAGE : View.Hxx
  • PREQ_SUCCESS : View.Hxx
  • PREQ_USERABORT : View.Hxx
  • PREROLL : SEQ.h
  • PrerollAndWait() : MainWND.c
  • PRESERVE_ALL : BttnCur.h
  • PRESERVE_BLACK : BttnCur.h
  • PRESERVE_DKGRAY : BttnCur.h
  • PRESERVE_LTGRAY : BttnCur.h
  • PRESERVE_NONE : BttnCur.h
  • PRESERVE_WHITE : BttnCur.h
  • PRESOURCEPOSINFO : Icons.C
  • PRETTYPRINT_MAXTOTALWIDTH : sampclnt.h
  • PRETTYPRINT_MINCOLWIDTH : sampclnt.h
  • PreviewWindowHookProc() : OpenDIB.c
  • PREVVID_BOTTOM : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • PREVVID_LEFT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • PREVVID_RIGHT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • PREVVID_TOP : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • PrevX : Demo.c , Cursor.c
  • PrevY : Demo.c , Cursor.c
  • PrGlobal : APP.Cxx , View.Cxx
  • PrimarySTAThreadProc() : Cancel.Cpp
  • print_token() : GssMisc.c
  • PrintAbortDlg() : Print.c
  • PrintAbortProc() : Print.c
  • PrintAddress() : resolve.c , resolve.h , resolve.cpp , resolve.h , resolve.c , resolve.h
  • PrintAddressString() : TestAccept.cpp , common.cpp , common.h , Sockdups.c
  • PrintAppStyleAPIError : SidClean.c
  • PrintBand() : Print.c
  • PrintClearStats() : Admapit.c
  • PrintColumn() : util.cxx , dump.cpp , sampclnt.h , main.hxx
  • PrintDbgMessage() : Helper.Cpp , WSnmpUtil.h
  • PrintDefaultLimitsMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintDefaultQuotaMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintDeviceStatus() : Simple.c
  • PrintDIB() : Dibapi.h , Print.c
  • PrintDIBSection() : ViewDIB.c
  • PrintDlgProc() : View.Hxx , APP.Cxx , Dialogs.c , WinCap.h
  • PrintDumpHeader() : tracedmp.cpp
  • PRINTERDATA : queue.h
  • PrinterNameSize : printjob.c
  • PrintError() : Commands.Cpp
  • PRINTERROR : MqTestOA.Cpp
  • PrintError() : MqTestOA.Cpp , Bcast.c , rnrcs.cpp , UtilLib.h , Utils.Cpp , Commands.h
  • PrintErrorAndAsk() : UtilLib.h , Utils.Cpp
  • PrintErrorAndExit() : UtilLib.h , Utils.Cpp
  • PrintErrorMessage() : Server.Cxx , Client.Cxx , error.Cxx
  • PrintErrorText() : util.cpp , util.h
  • PrintEType() : KList.c
  • PrintEvent() : tracedmp.cpp
  • Printf() : dballoc.h
  • printf() : Test.Cxx
  • PrintGeometry() : Mfmt.c
  • PrintGetStringError() : Admapit.c
  • PrintHelpMessage() : tracedmp.cpp , TraceLog.c
  • PrintHexDump() : Security.h , Security.cpp
  • PrintHookProc() : Print.c
  • PrintIADSObject() : CreateUserHelpers.h , main.cpp , CreateUserHelpers.cpp , ADSIhelpers.cpp , ADSIhelpers.h
  • PrintIcmpStats() : IPStat.Cpp , IPStat.h
  • PrintIgmpHeader() : parser.c
  • PrintInterfaceList() : rcvall.c
  • PrintIpAddrTable() : IPArp.h , IPArp.Cpp
  • PrintIpForwardTable() : IPRoute.Cpp , IPRoute.h
  • PrintIpListenRecords() : iplisten.c
  • PrintIpNetTable() : IPArp.Cpp , IPArp.h
  • PrintIpStats() : IPStat.Cpp , IPStat.h
  • PrintIpv4Header() : parser.c
  • PrintItemName() : wiassamp.cpp
  • PrintKerbName() : KList.c
  • PrintList() : RPCssmc.c , RPCssmp.c
  • PrintLoggerStatus() : TraceLog.c
  • PrintLongFormat() : enum.cxx
  • PrintLspMap() : instlsp.cpp
  • PrintMainMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintMe() : WinCap.c , WinCap.h
  • PrintMultiProc1() : Print.c
  • PrintMultiProc2() : Print.c
  • PrintOidValue() : Helper.Cpp , WSnmpUtil.h
  • PrintPayload() : Ping.cpp
  • PrintPriv() : Admapit.c
  • PrintProc() : Print.c , Print.h
  • PrintProcFailureEEInfo() : common.cpp , common.h , common.cpp , common.h
  • PrintProcTable() : spi.cpp
  • PrintProperty() : main.hxx , util.cxx
  • PrintProtocolInfo() : prnpinfo.cpp , install.h
  • PrintProviders() : instlsp.cpp
  • PrintQos() : ATMEvent.h , PrintQos.Cpp , QosEvent.h
  • PrintQueue : resource.h
  • PrintQuotaLogFlagMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintQuotaManagerMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintRawBytes() : parser.h
  • PrintResultCode() : Range.c
  • PrintSafeArray() : QSample.Cxx
  • PrintScreen() : Dibapi.h , Print.c
  • PrintSpace() : DispTree.Cxx
  • PrintSslRecord() : ssl.c
  • PrintSummary() : tracedmp.cpp
  • PrintTcpHeader() : parser.c
  • PrintTcpStats() : IPStat.Cpp , IPStat.h
  • PrintThread() : Printer.c , Printer.h
  • PrintTime() : KList.c
  • PrintTktFlags() : KList.c
  • PrintToScreen() : MainFrm.h , MqApiTst.Cpp
  • PrintUdpHeader() : parser.c
  • PrintUdpStats() : IPStat.Cpp , IPStat.h
  • PrintUrlAclRecord() : url.c
  • PrintUsage() : HttpGet.c , RSACert.cpp , TestAccept.cpp , main.hxx , Sample1.Cpp , Sample1.h , main.hxx , util.cxx , FileRep.cpp , filerep.cpp , main.cpp , RequestCert.Cpp , CreateCert.c , CreateCert.h , RSAKey.cpp , SessionKey.cpp , SignHash.cpp
  • PrintUserManagerMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintVarBind() : Helper.Cpp , WSnmpUtil.h
  • PrintVariant() : main.hxx , util.cxx
  • PrintVariantArray() : util.cxx , main.hxx
  • PrintVectorItems() : DispTree.Cxx , QSample.Cxx
  • PrintWindowSamp() : Dibapi.h , Print.c
  • PRIV_ERROR_DRIVE_LETTER_IN_USE : DLEdit.Cpp
  • PRIV_ERROR_PARTITION_HIDDEN : DLEdit.Cpp
  • PRIV_ERROR_PARTITION_NOT_RECOGNIZED : DLEdit.Cpp
  • PRIVATE : GLOBAL.h
  • PRIVATE_ERROR_BIT : common.h
  • PRIVATE_USE_MAPPING_FOR_GT : CharHash.Hxx
  • PRIVATE_USE_MAPPING_FOR_LT : CharHash.Hxx
  • Privilege() : Check_SD.h , Helper.c
  • PROC_FORMAT_STRING_SIZE : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c , EdCommands_p.c , ADsFirstExt_p.c
  • ProcConnectionClearStat() : Admapit.c
  • ProcConnectionGetInfo() : Admapit.c
  • Process() : RecoDll.cpp , QCOrder.Idl , Main.cpp , QCNotify.Idl , QCShip.Idl , QCOrder.Idl , Main.cpp , QCShip2.Idl
  • Process_DecoupledEvent() : Main.cpp
  • Process_DecoupledEventConsumer() : Main.cpp
  • Process_DecoupledInstance() : Main.cpp
  • Process_DecoupledRestrictedEvent() : Main.cpp
  • PROCESS_SQL_ERROR : odbcdata.h
  • ProcessAcceptEvent() : common.h , common.cpp
  • ProcessAgentResponse() : WSnmpUtil.Cpp , WSnmpUtil.h
  • ProcessArgs() : main.hxx , main.cxx
  • ProcessArguments() : security.cpp
  • ProcessAsyncSelectMessage() : ASAccept.cpp
  • ProcessCallMediaEvent() : Processing.cpp
  • ProcessCallNotificationEvent() : Processing.cpp
  • ProcessCallStateEvent() : Processing.cpp
  • ProcessCDError() : ComDlg32.h , ComDlg32.C
  • ProcessCleanup() : ui.cpp
  • ProcessCommandLineArguments() : AsyncIO.h , AsyncIO.c
  • ProcessCommandsWndProc() : DebMain.c
  • ProcessDefaultLimitsMenu() : ProcessMenu.Cpp , ProcessMenu.h
  • ProcessDefaultQuotaMenu() : ProcessMenu.Cpp , ProcessMenu.h
  • processFlagLateBound : processFlags.h
  • processFlagQueuedComponents : processFlags.h
  • processFlagWriteDB : processFlags.h
  • ProcessID : appinfo.h
  • ProcessLogoff() : CustomAuth.cpp
  • ProcessLogon() : CustomAuth.cpp
  • ProcessMainMenu() : ProcessMenu.h , ProcessMenu.Cpp
  • ProcessNotification() : WSnmpUtil.Cpp , WSnmpUtil.h
  • ProcessOrderFunction() : DebDebug.c
  • ProcessQuotaLogFlagMenu() : ProcessMenu.Cpp , ProcessMenu.h
  • ProcessQuotaManagerMenu() : ProcessMenu.h , ProcessMenu.Cpp
  • ProcessReadEvent() : common.cpp , common.h
  • ProcessReadFileCompletion() : AsyncIO.c , AsyncIO.h
  • ProcessRequest() : DumpRequestInfo.cpp , AsyncIO.h , AsyncIO.c
  • ProcessRetCode() : MqTrans.Cpp
  • ProcessSearchFile() : AsyncIO.c , AsyncIO.h
  • ProcessStartup() : ui.cpp
  • ProcessUserAccounts() : Process.cpp
  • ProcessUserManagerMenu() : ProcessMenu.Cpp , ProcessMenu.h
  • ProcPortClearStat() : Admapit.c
  • ProcPortDisconnect() : Admapit.c
  • ProcPortGetInfo() : Admapit.c
  • ProcPortReset() : Admapit.c
  • PROF_LOG : Prof.cpp , prof.cpp
  • PROF_LOG_MAX_SIZE : prof.h , Prof.h
  • ProfCloseLog() : Prof.cpp , prof.cpp , Prof.h , prof.h , prof.cpp , prof.h
  • ProfCriticalSection : Prof.cpp , prof.cpp , Prof.h , prof.h
  • Profile : DebMain.h , DebMain.c
  • PROFILE : DebMain.h
  • ProfOpenLog() : Prof.h , Prof.cpp , prof.h , prof.cpp , prof.h , prof.cpp
  • ProfRecordTime() : Prof.h , prof.h , prof.cpp , Prof.cpp , prof.cpp
  • PROG_ID : DoServer.h
  • ProgId() : CrmMonComp.Idl
  • ProgIDFromCLSIDA : ansiapi.h
  • PROGRESS : queue.h
  • PROGRESSMSG : Handler.h
  • ProgressProc() : setupui.cpp
  • Prolog : Atsp.h
  • prompt() : dbh.cpp
  • PROMPT : FTPJr.cpp
  • PROP_BUFFER_SLOP : PropTag.Hxx
  • PROP_COLID : cdialog.cpp
  • PROP_COLUMNS : cdialog.cpp
  • PROP_DEFAULT__MAXUSERS : File Share Sample.cpp
  • PROP_DESC : cdialog.cpp
  • PROP_DWORD : BasicHiPerf.h
  • PROP_FLAGS : cdialog.cpp
  • PROP_MAX__MAXUSERS : File Share Sample.cpp
  • PROP_MIN__MAXUSERS : File Share Sample.cpp
  • PROP_NAME : cdialog.cpp
  • PROP_NAME__MAXUSERS : File Share Sample.cpp
  • PROP_NAME__PATH : File Share Sample.cpp
  • PROP_NAME__REMARK : File Share Sample.cpp
  • PROP_NAME__SHARENAME : File Share Sample.cpp
  • PROP_QWORD : BasicHiPerf.h
  • PROP_SHEET_HOST_ID : PropSheetHost.h
  • PROP_SHEET_PREFIX_ADMIN : PropSheetHost.h
  • PROP_SHEET_PREFIX_SHELL : PropSheetHost.h
  • PROP_TYPE : cdialog.cpp
  • PROP_VALUE : cdialog.cpp , BasicHiPerf.h
  • PropDlgProc() : APP.Hxx , APP.Cxx
  • Properties : adoint.h
  • Properties_get_Item_Proxy() : adoint.h
  • Properties_get_Item_Stub() : adoint.h
  • PropertiesVtbl : adoint.h
  • Property : adoint.h
  • Property_get_Attributes_Proxy() : adoint.h
  • Property_get_Attributes_Stub() : adoint.h
  • Property_get_Name_Proxy() : adoint.h
  • Property_get_Name_Stub() : adoint.h
  • Property_get_Type_Proxy() : adoint.h
  • Property_get_Type_Stub() : adoint.h
  • Property_get_Value_Proxy() : adoint.h
  • Property_get_Value_Stub() : adoint.h
  • Property_put_Attributes_Proxy() : adoint.h
  • Property_put_Attributes_Stub() : adoint.h
  • Property_put_Value_Proxy() : adoint.h
  • Property_put_Value_Stub() : adoint.h
  • PropertyAttributesEnum : adoint.h
  • PropertySheetExtension : extend.h
  • PropertyValueToString() : helper.cpp , helper.h
  • PropertyVtbl : adoint.h
  • PROPIDLIST : suminfo.h
  • propidPK : DirEncrypt.Cpp
  • PropListHeader : DpDetail.Cpp
  • PROPSET_DSO : utilprop.h
  • PROPSET_DSOINIT : utilprop.h
  • PROPSET_INIT : utilprop.h
  • PROPSET_ROWSET : utilprop.h
  • PROPSET_SESSION : utilprop.h
  • PROPSETLIST : suminfo.h
  • PropSheet() : PhoneEntry.c
  • PropSheetCallback() : Property.c
  • PROPSHEETCFG : PropSheetHost.h
  • PropStreamName : suminfo.h
  • PropStreamNamePrefixByte : suminfo.h
  • PROPSTRUCT : utilprop.h
  • PropTagState : PropTag.Hxx
  • PROPVALUE : suminfo.h
  • PROTO_IP_SAMPLE : ipsamplerm.h
  • PROTOCOL : Bcast.c
  • PROTOCOL_LEN : PrPerf.c
  • PROTOCOL_NAME : AuthenticatePlugin.cpp
  • PROTOCOL_SEQUENCE : Common.h
  • ProtocolArray : Server.c
  • ProtocolBuffer : Server.c
  • protocolEnum : cacheproxysampleplugin.cs
  • PROTOTYPE() : GssAPI.h , Gss-Misc.h , GssAPI.h , Gss-Misc.h , GssAPI.h , Gss-Misc.h , GssAPI.h , Gss-Misc.h , GssAPI.h , Gss-Misc.h , GssMisc.c , GssAPI.h
  • PROVIDER : provider.h
  • PROVIDER_ALLOC : sampprov.h
  • PROVIDER_CLASS : asyncselect.cpp
  • PROVIDER_INFO_SIZE : Atsp.c
  • PROVIDER_NAME_REINDEERPROV : FrameworkProv.h
  • PROVIDER_REALLOC : sampprov.h
  • ProviderGuid : lspguid.cpp , install.h
  • ProviderInstall() : Atsp.c , Atsp.h
  • ProviderPath : install.h , lspguid.cpp
  • PROWBUFF : hashtbl.h
  • PROXY_DELEGATION : dlldata.c , Dlldata.c , dlldata.c
  • PRTDATA : MfEdit.h
  • PruneLspMap() : instlsp.cpp
  • PRUREGVALUE : rureg.h
  • PSAMPLE_CUSTOM_DIAL_DLG : customdial.cpp
  • PSAMPLE_CUSTOM_ENTRY_DATA : customdial.cpp
  • PSAMPLE_HELPER_DATA : nshsamp.h
  • PSAMPLEDROPEXT : DropExt.C
  • PSEARCH_REQUEST : AsyncIO.h
  • PSEARCH_REQUEST_STATE : AsyncIO.h
  • pSearchPref : main.cxx
  • PSEC_CONTEXT : SampSSP.H
  • PSEQ : SEQ.h
  • pServerActiveReqCounters : Service.h , Service.cpp
  • pServerReqCounters : Service.h , service.h , Service.cpp , service.cpp
  • PSID : GinaStub.h , GinaHook.h
  • psidProcessOwnerSID : SidClean.c
  • PSIGGEN_COUNTER : DataGen.h
  • PSIGNATURE : SampSSP.H
  • PSLOT : hashtbl.h
  • PSMF : SMFI.h
  • PSMFFILEINFO : SMF.h
  • PSMFOPENFILESTRUCT : SMF.h
  • PSNMP_MGR_SESSION : WSnmpUtil.h
  • PSOCK_INFO : common.h
  • pSockAddr : Globals.h
  • pSortKey : main.cxx
  • PSPINCUBEINFO : SpinCube.h
  • PSTACK_ENTRY : list.h
  • PSTATEL : status.cpp
  • PSTATMESSAGEMAP : CStatHlp.h
  • pStgmed : ias.h
  • PSXI2PSMX : DropExt.C
  • pSystemSID : Service.cpp , Service.h , service.cpp
  • psz_dwMsg : TapiInfo.c
  • PszAlloc() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h , Util.Cpp
  • pszAttrList : main.cxx
  • pszAttrNames : main.cxx
  • pszCmdLine : Utils.Cpp
  • pszDesc1 : ComPerf.Cpp
  • pszDescription : MainFrm.Cpp
  • pszFileName : Utils.Cpp , WebClient.c
  • pszfLINEADDRESSSTATE : TapiInfo.c
  • pszfLINEBUSYMODE : TapiInfo.c
  • pszfLINECALLINFOSTATE : TapiInfo.c
  • pszfLINECALLPRIVILEGE : TapiInfo.c
  • pszfLINECALLSTATE : TapiInfo.c
  • pszfLINEDEVSTATE : TapiInfo.c
  • pszfLINEDIALTONEMODE : TapiInfo.c
  • pszfLINEDIGITMODE : TapiInfo.c
  • pszfLINEDISCONNECTED : TapiInfo.c
  • pszfLINEGATHERTERM : TapiInfo.c
  • pszfLINEGENERATETERM : TapiInfo.c
  • pszfLINEMEDIAMODE : TapiInfo.c
  • pszfLINEREQUESTMODE : TapiInfo.c
  • pszfLINESPECIALINFO : TapiInfo.c
  • PszFromBstr() : clUtil.h , clUtil.Cpp , session.cpp , clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp
  • PszFromPsffs : wn_dos.h
  • pszGuidApp : ComSpyAudit.Idl
  • pszLineErrorNameArray : TapiInfo.c
  • pszOrderDSN : DataSourceNames.h
  • pszPassword : DataSourceNames.h , main.cxx , DataSourceNames.h
  • pszProxyServer : WebClient.c
  • pszSearchBase : main.cxx
  • pszSearchFilter : main.cxx
  • pszSecurity : AsyncRPCs.c
  • pszServerName : WebClient.c
  • pszShipDSN : DataSourceNames.h
  • pszThreadID : ComSpyAudit.Idl
  • pszUserFile : db.c
  • pszUserId : DataSourceNames.h
  • pszUserName : main.cxx , WebClient.c , WebServer.c
  • pszW2KThreadID : ComSpyAudit.Idl
  • pszWorkingDirectoryName : sdkdiff.cpp
  • PTCP_HDR : iphdr.h
  • ptCursor : Cursor.c
  • ptd : OleStd.h
  • ptdRight : OleStd.h
  • PTEMPOMAPENTRY : SMFI.h
  • PTEST_INFO : PrPerf.c
  • PTHREADARGS : sdkdiff.cpp
  • pThreadPool : InvokObjThreads.cpp
  • PTICKS : SMF.h
  • ptImeUIPos : IMEApps.h , Data.c
  • ptoDest : PlgBlt.c
  • ptoMask : PlgBlt.c
  • ptoRect : WxForm.h
  • ptoSrc : PlgBlt.c
  • PTPHYS_CONNECT_INFO : nullmdm.h
  • PTRACK : SMFI.h
  • PTrackObject : WxForm.h , Track.h
  • PTREEITEM : tree.h
  • PTRegister() : pluggable.cpp
  • PTRegisterPluggable() : pluggable.cpp
  • PTS : Fx.c
  • PTS_PER_INCH : OleStd.h
  • PTUnregister() : pluggable.cpp
  • PUBLIC : GLOBAL.h
  • PUBPROP : Adminwrap.h
  • PUDP_HDR : iphdr.h
  • Pull : FileRepClientProc.cpp
  • PUNICODE_STRING : Npaux.h
  • pUnkOuter : helpdll.Cpp
  • PURE : dballoc.h
  • PurgeTicket() : KList.c
  • PURPOSE : RPCssms.c , InOuts.c , DUnions.c , InOutc.c , Xmits.c , Usrdefs.c , Picklpc.c , Repasc.c , Cxhndlc.c , Pickltc.c , Dynepts.c , ClUuids.c , ComPerf.Cpp , Xmitc.c , Hellos.c , Repass.c , Cxhndls.c , RPCssmc.c
  • PUSER : cMemb.h
  • PUSER_EVENT : TraceDp.c
  • PUSER_INFO : cache.c
  • PUserFromINmMember() : cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp
  • PUserFromPActual() : malspy.c
  • PUserLocal() : cMemb.Cpp , cMemb.h
  • Push : list.h , FileRepServerProc.cpp
  • PutbackOverlappedStructure() : provider.h , overlap.cpp
  • PutPlayList() : FileTerm.h , FileTerm.cpp
  • Puts : Debug.h
  • pVal : GraphObj.Idl , data.Idl
  • pvarEvent : MtsAudit.Idl
  • pvarRet : data.Idl
  • pvGameID : TServer.Idl
  • PVIEWLINE : view.cpp
  • PVIRTUAL_BUFFER : AsyncIO.h
  • pvName : TServer.Idl
  • pvNonPersistent : RPCssmp.c
  • PVOID : OleStd.h , LinkList.h , GinaHook.h , GinaStub.h
  • PVOID2PSMX : DropExt.C
  • PVOID_FUNCTION : hashtable.h
  • PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION : DLEdit.Cpp
  • pvOrder : TServer.Idl
  • pvPersistent : RPCssmp.c
  • pvX : TServer.Idl
  • pvY : TServer.Idl
  • PW_BESTFIT : Dibapi.h
  • PW_CLIENT : Dibapi.h
  • PW_SCALE : Dibapi.h
  • PW_STRETCHTOPAGE : Dibapi.h
  • PW_WINDOW : Dibapi.h
  • PWAVE_DATA : Perfgen.c
  • pWbemServices : tracewmi.cpp
  • pwcHTMLFilter : HtmlProp.Cxx
  • pwcHTMLPropertyFile : HtmlProp.Cxx
  • pwcMetaProperty : HtmlProp.Cxx
  • pWeight : FrameworkProv.h
  • PWLX_MPR_NOTIFY_INFO : GinaStub.h , GinaHook.h
  • PWM_COMMWRITE : CommCode.c
  • PWM_WRITESTRING : EDITCTLS.c
  • PWORK_QUEUE : AsyncIO.h
  • PWORK_QUEUE_ITEM : AsyncIO.h
  • PWORK_THREAD_DATA : RasHost.h
  • PWORKER_ROUTINE : AsyncIO.h
  • PWSTR : GinaStub.h , GinaHook.h
  • pwszDllType : dllmain.c , mapname.c
  • pwszUsage : main.cpp
  • PWTSENUMERATESERVERS : Tst4Wts.c
  • pWTSEnumerateServers : Tst4Wts.c
  • pWTSFreeMemory : Tst4Wts.c
  • PWTSFREEMEMORY : Tst4Wts.c
  • PXFORMDATA : XForm.h
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- q -

  • QC : comspyctl.idl
  • QCIF_CX_SIZE : StdAfx.h
  • QCIF_CY_SIZE : StdAfx.h
  • QMPROPS : DirEncrypt.Cpp
  • QOS_DEFAULTNAME : QosEvent.h
  • QOS_IOCTL_SET : QosEvent.h
  • QOS_IOCTL_SET_AFTER : QosEvent.h
  • QOS_IOCTL_SET_BEFORE : QosEvent.h
  • QOS_IOCTL_SET_DURING : QosEvent.h
  • QOS_IOCTL_SET_QOS : QosEvent.h
  • QOS_OPTIONS : QosEvent.h
  • QOSTEST : Qoslist.Cpp
  • QQCIF_CX_SIZE : StdAfx.h
  • QQCIF_CY_SIZE : StdAfx.h
  • qtDisplayError() : quiktest.h , quiktest.c
  • QTESTC : common.h
  • qtMakeData() : quiktest.c , quiktest.h
  • QTSTRUCT : quiktest.h
  • Query : QueryDlg.h
  • QUERY_COSTLY : PerfUtil.h
  • QUERY_FOREIGN : PerfUtil.h
  • QUERY_GLOBAL : PerfUtil.h
  • QUERY_INTERVAL : SysInfo.h
  • QUERY_ITEMS : PerfUtil.h
  • QueryAllInterfaces() : ADSIhelpers.h , ADSIhelpers.cpp
  • QueryCards() : SCQuery.Cpp
  • QueryCloseAllChildren() : IconPRO.C
  • QueryContextAttributesW() : Stubs.c
  • QueryContinueDrag() : ids.h
  • QueryData() : AsyncDemo.cpp
  • QueryDrop() : idt.h
  • queryEventLog() : log.c
  • QueryFunc() : callbackclient.Cpp , callbackclient.h
  • QueryGetData() : ido.h
  • QueryHeaders() : cache.Cpp
  • QueryInterface() : ias.h , iocs.h , ioipf.h , ioips.h , ias.h , ids.h , idt.h , iocs.h , icf.h , ido.h , iec.h , ioipao.h , ioipo.h , ioo.h , ips.h
  • QueryItems : QueryDlg.Cpp
  • QueryKey() : Monkey.c , Monkey.h
  • QuerySecurityPackageInfoW() : Stubs.c
  • QuerySystemTime() : SubAuth.c
  • QUEUE_ENTRY : list.h
  • QueueAdd() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueCreate() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QUEUEDATA : queue.h
  • QueueDelete() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashAdd() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashAddToSubqueue() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashDecrementCounter() : Resources.h , resources.cpp , resources.h , Resources.cpp
  • QueueHashIncrementCounter() : Resources.h , resources.cpp , resources.h , Resources.cpp
  • QueueHashLookup() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashNode : Resources.h , resources.h
  • QueueHashRemoveFromSubqueue() : Resources.h , resources.cpp , Resources.cpp , resources.h
  • QueueIsEmpty() : resources.cpp , Resources.h , resources.h , Resources.cpp
  • QueueMoveToBack() : resources.cpp , Resources.cpp , Resources.h , resources.h
  • QueueNode : resources.h , Resources.h
  • QueueOverlappedOperation() : provider.h , overlap.cpp
  • QueueRemove() : resources.cpp , Resources.h , Resources.cpp , resources.h
  • QueueRemoveData() : Resources.cpp , Resources.h
  • QueueRequest() : PoolWrap.cpp
  • QueueSampleWorker() : utils.h , utils.c
  • QueuesCreate() : resources.cpp , Resources.h , resources.h , Resources.cpp
  • QueuesDelete() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueSearchFile() : AsyncIO.h , AsyncIO.c
  • QueueWorkItem() : AsyncIO.c , AsyncIO.h
  • QUICKTESTPOINTS : TextFx.c
  • QUIKTEST : quiktest.c
  • Quit : Admapit.c , AsyncRPCs.c , rqsengine.h
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- r -

  • R_MATCH_START : sdkdiff.h
  • R_MATCH_WIDTH : sdkdiff.h
  • R_POS_START : sdkdiff.h
  • R_POS_WIDTH : sdkdiff.h
  • R_UNMATCH_START : sdkdiff.h
  • R_UNMATCH_WIDTH : sdkdiff.h
  • Radian() : Display.c
  • RADIUS_ATTR_NOT_FOUND : radutil.h
  • RadiusAlloc() : radutil.c , radutil.h
  • RadiusExtensionInit() : DialIn.c , mapname.c
  • RadiusExtensionInstall() : radutil.c , radutil.h
  • RadiusExtensionProcess() : DialIn.c
  • RadiusExtensionProcess2() : mapname.c
  • RadiusExtensionTerm() : mapname.c
  • RadiusFindFirstAttribute() : radutil.c , radutil.h
  • RadiusFindFirstIndex() : radutil.c , radutil.h
  • RadiusFree() : radutil.c , radutil.h
  • RadiusReplaceFirstAttribute() : radutil.c , radutil.h
  • RaiseRect() : status.cpp
  • RandInt() : bankthrds.Cpp
  • random : TextFx.c
  • RasAdminClearDisc() : Admapit.c
  • RASCONN_V401_A : main.cpp
  • RasCustomDeleteEntryNotify() : customdial.cpp
  • RasCustomDial() : customdial.cpp
  • RASCUSTOMDIAL_ENTRYNAME : customdialreg.cpp , customentry.c
  • RASCUSTOMDIAL_KEYPATH : customdialreg.cpp , customentry.c
  • RASCUSTOMDIAL_PHONENO : customdialreg.cpp
  • RASCUSTOMDIAL_VALUENAME : customdialreg.cpp , customentry.c
  • RasCustomDialDlg() : customdial.cpp
  • RasCustomEntryDlg() : customdial.cpp
  • RasCustomHangUp() : customdial.cpp
  • RasDialFunc() : RasDialAsync.c
  • RasEapFreeMemory() : CeapCfg.Cpp , Eap.c
  • RasEapGetIdentity() : Eap.c
  • RasEapGetInfo() : Eap.c
  • RASEAPGLOBALS : Eap.c
  • RasEapInvokeConfigUI() : CeapCfg.Cpp , Eap.c
  • RasEapInvokeInteractiveUI() : Eap.c
  • RASHOST_DATA : RasHost.h
  • RasSecurityDialogBegin() : RasHost.Cpp
  • RasSecurityDialogEnd() : RasHost.Cpp
  • RASSECURITYDIALOGRECEIVEPROC : RasHost.h
  • RASSECURITYDIALOGSENDPROC : RasHost.h
  • RasSrv : Admapit.c
  • RasUser0 : Admapit.c
  • RB2 : MousInfo.h
  • RBD : MousInfo.h
  • RBU : MousInfo.h
  • RC_NOTSUCCESSFUL : quiktest.h
  • RC_SUCCESSFUL : quiktest.h
  • rcd() : FTPJr.cpp
  • rClientRect : Mypal.c
  • ReactivateAndUndo() : ioipo.h
  • READ : Check_SD.h
  • Read : FileRepServerProc.cpp , rqsengine.h
  • read_all() : GssMisc.c
  • READ_BUFFER_SIZE : AuthzSvr.c
  • read_file() : GssClient.c
  • READ_MODE : sync.h
  • READ_WRITE_LOCK : sync.h
  • READ_WRITE_LOCK_CREATED : sync.h
  • ReadACL() : security.cpp
  • ReadBMPFile() : Dib.c , Dib.h
  • ReadCommand() : data.Idl
  • ReadData() : filerepserverproc.cpp , AsyncDemo.cpp
  • ReadDataForPaw() : fwasync.c
  • ReadDataFromFile() : Picklpc.c , Pickltc.c
  • ReadDataFromLine() : main.cpp
  • ReadDIBFile() : File.c
  • ReadDouble() : strmHelp.Cxx , strmHelp.h
  • reader() : NmPipe.c
  • readfile_delete() : gutils.h , utils.cpp
  • readfile_new() : gutils.h , utils.cpp
  • readfile_next() : gutils.h , utils.cpp
  • readfile_setdelims() : gutils.h , utils.cpp
  • ReadFileIntoTerminal() : tapisend.cpp
  • ReadFromPipe() : common.c , common.h
  • ReadFunc() : Client.c
  • ReadHelp() : AppUtil.Cpp , AppUtil.h
  • ReadICOHeader() : Icons.C
  • ReadIconFromEXEFile() : Icons.C , Icons.h
  • ReadIconFromICOFile() : Icons.C , Icons.h
  • ReadINI() : Dialer.c
  • ReadKey : UnBufCp1.c
  • ReadLoop() : UnBufCp2.c
  • ReadPipe() : Client32.c , Client32.h
  • ReadPort : UnBufCp2.c
  • ReadPref() : Global.h , Init.Cpp
  • ReadProcessMemory64() : DebugHandler.Cpp
  • ReadProxyServerByTunnelAddressFromFile() : cmsample.cpp
  • ReadSomeWiaProperties() : wiassamp.cpp
  • ReadSource() : AppUtil.Cpp , AppUtil.h
  • ReadStoredProcedure() : data.Idl
  • ReadTutorial() : AppUtil.Cpp , AppUtil.h
  • REALGINA_PATH : GinaHook.c , GinaStub.c
  • REALLOC : dballoc.Cpp , defs.h , Alloc.Cpp , Alloc.h
  • ReallyGetClientRect() : WinCap.c , WinCap.h
  • REALM_NAME : AuthenticateContext.cpp
  • ReAuthenticate : SampSSP.H
  • REC_COUNT_UNK : quiktest.h
  • REC_E_BEGINUNDO_SEQUENCE : RmWorker.Idl
  • REC_E_COMMIT_SEQUENCE : RmWorker.Idl
  • REC_E_END_TRANSACTION_SEQUENCE : RmWorker.Idl
  • REC_E_ENDUNDO_SEQUENCE : RmWorker.Idl
  • REC_E_FORGET_SEQUENCE : RmWorker.Idl
  • REC_E_INDOUBT_INVALID : RmWorker.Idl
  • REC_E_INVALID_LOG_RECORD : RmWorker.Idl
  • REC_E_INVALID_STATE : RmWorker.Idl
  • REC_E_LOG_FAILURE : RmWorker.Idl
  • REC_E_NO_MEMORY : RmWorker.Idl
  • REC_E_ORPHANED_TRANSACTION : RmWorker.Idl
  • REC_E_OUTCOMEACTION : RmWorker.Idl
  • REC_E_PREPARE_SEQUENCE : RmWorker.Idl
  • REC_E_REENLIST : RmWorker.Idl
  • REC_E_STATE_UNKNOWN : RmWorker.Idl
  • REC_E_TM_DOWN : RmWorker.Idl
  • REC_E_TRANSACTION_DUPLICATED : RmWorker.Idl
  • REC_E_UNDO_INCOMPLETE : RmWorker.Idl
  • REC_E_UNDO_SEQUENCE : RmWorker.Idl
  • REC_FILEEXT : CallNot.h
  • REC_FILENAME : CallNot.h
  • REC_S_SUCCESS : RmWorker.Idl
  • REC_STATE_ABORTING : RmWorker.Idl
  • REC_STATE_ACTIVE : RmWorker.Idl
  • REC_STATE_COMPLETED : RmWorker.Idl
  • REC_STATE_DORMANT : RmWorker.Idl
  • REC_STATE_INDOUBT : RmWorker.Idl
  • RecalcMsgWindow() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h , rtns.Cpp
  • recallMediaID() : app.cpp , app_utls.cpp
  • recallPoolID() : app.cpp , app_utls.cpp
  • ReceiveBytes() : Comm.cpp , Comm.h
  • ReceiveComplete : rqsclient.h
  • ReceiveInBox() : Globals.h , Misc.c
  • ReceiveMsg() : Comm.cpp , Comm.h
  • Receiver() : QosEvent.h , Receiver.Cpp , MqTestOA.Cpp , MqTrans.Cpp , MSMQTest.c , ATMEvent.h , Receiver.Cpp
  • ReceiverThread() : TestAccept.cpp
  • ReceiveUpdates() : DrawDlg.Cpp , drawdlg.cpp
  • Receiving : rqsclient.h
  • RECO_CAPABILITIES : RecoDll.cpp
  • RECO_LANGUAGES : RecoDll.cpp
  • RECO_MANAGER_KEY : RecoDll.cpp
  • RECO_SHORT_NAME : RecoDll.cpp
  • RECO_SUBKEY : RecoDll.cpp
  • RECO_VENDOR_NAME : RecoDll.cpp
  • RECOCLSID_SUBKEY : RecoDll.cpp
  • RECOGNIZER_SUBKEY : RecoDll.cpp
  • RECOGNIZER_SUBPATH : RecoDll.cpp
  • RECOPROC_SUBKEY : RecoDll.cpp
  • RecordMessage() : Processing.cpp
  • Recordset : adoint.h , data.Idl
  • RecordStatusEnum : adoint.h
  • Recover() : RmWorker.Idl
  • RECOVERY_STATE : RmWorker.Idl
  • RecoveryInfo() : SimpleLog.Idl
  • RECOVERYRC : RmWorker.Idl
  • Rect : Demo.c , Cursor.c
  • RECTANGLE : Common.h
  • RectangleDlgProc() : Dialogs.c , WinCap.h
  • RectHeight : IconPRO.h
  • RECTHEIGHT : Dibutil.h
  • RECTSIZE : Track.c
  • RECTWIDTH : Dibutil.h
  • RectWidth : IconPRO.h
  • RecurseDeleteKey() : register.cpp
  • recursiveDeleteKey() : registry.Cpp
  • RecursiveDeleteKey() : registry.cpp
  • recursiveDeleteKey() : registry.cpp , registry.Cpp , Registry.Cpp , registry.Cpp
  • RECV_BUF_SIZE : callback.Cpp
  • RECV_DATA_SIZE : common.h
  • RECV_INFO : Receiver.Cpp
  • recv_token() : GssMisc.c
  • RECVARGS : provider.h
  • recvbuf : Ping.cpp
  • recvbuflen : Ping.cpp
  • RECVFROMARGS : provider.h
  • RECVVID_BOTTOM : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RECVVID_LEFT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RECVVID_RIGHT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RECVVID_TOP : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RED_COLOR : DoServer.h
  • REDIRECT_ENTITY : CustomAuth.h , ReMapUrl.cpp
  • refcnt : OleStd.h
  • REFERENCE_PROXY_FILE() : dlldata.c , Dlldata.c
  • REFPOINTS : cdialoglite.h
  • REFRECT : cdialoglite.h
  • Refresh() : printjob.c , quecore.h
  • RefreshFromNotification() : printjob.c , quecore.h
  • RefreshLoop() : SamplCli.Cpp
  • RefreshPrinterCombobox() : Printer.c , Printer.h
  • Reg_DeleteItemIdForHandlerItem() : Reg.Cpp , Reg.h
  • REG_ERR : log.c
  • Reg_GetItemSettingsForHandlerItem() : Reg.Cpp , Reg.h
  • Reg_SetItemSettingsForHandlerItem() : Reg.Cpp , Reg.h
  • REG_VALUE_ADMIN_EXTENSIONS : RegExt.cpp
  • RegGetTimeStamp() : Reg.Cpp
  • Register() : blrplate.cpp , blrplate.h
  • REGISTER : main.cpp
  • REGISTER_TUTFILE_STR : DllClien.h
  • RegisterAClass() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterAClassAndExt() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterACLSID() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterADsExt() : ADsFirstExt.cpp
  • RegisterAFilter() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterAHandler() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterALanguageClass() : langreg.hxx
  • RegisterALanguageResource() : langreg.hxx
  • RegisterAppClass() : GdiDemo.h , Init.c
  • RegisterCallback() : tapirecv.cpp
  • RegisterClassFactory() : cHello.Cxx , Server.Cxx
  • RegisterCluAdminAllGroupsExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllNetInterfacesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllNetworksExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllNodesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllResourcesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllResourceTypesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminClusterExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminResourceTypeExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterComCat() : BandObjs.Cpp
  • RegisterDecoupledEvent() : Main.cpp
  • RegisterDecoupledEventConsumer() : Main.cpp
  • RegisterDecoupledInstance() : Main.cpp
  • RegisterDecoupledRestrictedEvent() : Main.cpp
  • RegisterHandlerWndClasses() : Handler.Cpp , Handler.h
  • RegisterInvokeInfo() : session.cpp
  • RegisterLibrary() : registry.cpp , registry.h
  • RegisterLocalServer() : Server.Cxx
  • RegisterNonStandardAppletInvokeInfo() : session.cpp , session.h
  • RegisterProtocol() : rmapi.c , rmapi.h
  • RegisterProxy() : registry.cpp , registry.h
  • RegisterProxyDll() : Server.Cxx
  • RegisterServer() : registry.cpp , registry.h , server.cxx , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , Registry.Cpp , Registry.h , registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , BandObjs.Cpp
  • RegisterSnapin() : registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , Registry.Cpp , Registry.h , registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp
  • RegisterStandardAppletInvokeInfo() : session.cpp , session.h
  • RegisterTapiEventInterface() : FileTerm.cpp , FileTerm.h , Incoming.Cpp
  • RegisterToolBand() : BandObjs.Cpp
  • RegisterWindowClass() : BasicRecognition.cpp
  • RegistrationHandle : TraceDp.c
  • REGISTRY_TXT : Monkey.h
  • RegOpenKey_AW : ansiapi.h
  • REGPARAM_FILESHARESAMPLE_MAXUSERS : File Share SampleEx.h
  • REGPARAM_FILESHARESAMPLE_PATH : File Share SampleEx.h
  • REGPARAM_FILESHARESAMPLE_REMARK : File Share SampleEx.h
  • REGPARAM_FILESHARESAMPLE_SHARENAME : File Share SampleEx.h
  • REGSTRUCT : ADEvent.cpp
  • RegUsersPri : Service.cpp , Service.h , service.cpp , service.h
  • REGVAL_INSTALL_DIR : Dlg.Cpp
  • REGVAL_NM_NT_DISPLAY_DRIVER_ENABLED : Dlg.Cpp
  • RegWriteTimeStamp() : Reg.Cpp
  • RELEASE : MqTestOA.Cpp , UtilLib.h
  • RELEASE_ALL_PARENT_OBJECTS : VCExploreDlg.Cpp
  • RELEASE_COM_IF : RendSam.Cpp
  • RELEASE_INTERFACE : AppUtil.h , cbase.h
  • Release_ItemList() : Enum.Cpp , Enum.h
  • RELEASE_LIST_LOCK : sync.h
  • RELEASE_QUEUE_LOCK : sync.h
  • RELEASE_READ_DLOCK : defs.h
  • RELEASE_READ_LOCK : sync.h
  • RELEASE_WRITE_DLOCK : defs.h
  • RELEASE_WRITE_LOCK : sync.h
  • ReleaseAllObjects() : main.cpp
  • ReleaseDynamicReadwriteLock() : sync.c , sync.h
  • ReleaseEvents() : Processing.cpp
  • ReleaseInterface : Framer.h
  • RELEASEINTERFACE : debug.h
  • ReleaseMemory : autotest.h
  • ReleaseObj() : util.cpp , util.h
  • ReleaseReadLock() : sync.c , sync.h
  • ReleaseSamples() : Processing.cpp
  • ReleaseSlotList() : hashtbl.cpp , hashtbl.h
  • ReleaseSlots() : hashtbl.cpp , hashtbl.h
  • ReleaseSocketLock() : provider.h , sockinfo.cpp
  • ReleaseStreamsAndStorage() : ips.h
  • ReleaseTheCall() : FileTerm.cpp , FileTerm.h , Incoming.Cpp
  • ReleaseWriteLock() : sync.c , sync.h
  • RELPATHPROP : UtilLib.h
  • RemAddr : Globals.h
  • REMOTE : cfactory.h
  • REMOTE_CREATE_ERR_STR : DComDraw.h
  • REMOTE_MSG_DLL_PATH : log.c
  • RemoteClose() : Cxhndlp.c
  • RemoteHelloProc() : CallAs.Idl
  • RemoteOpen() : Cxhndlp.c
  • RemoteRead() : Cxhndlp.c
  • Remove() : data.Idl
  • REMOVE_ACE_MASK_BITS : app.cpp
  • remove_thread() : BPSamp.h , Utils.c
  • RemoveAClass() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RemoveAClassName() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RemoveAllLayeredEntries() : instlsp.cpp
  • RemoveEntryList : list.h , defs.h , openf.h , tracedmp.h , AsyncIO.h
  • RemoveHeadList : AsyncIO.h , list.h , openf.h , defs.h
  • RemoveIdFromChain() : instlsp.cpp
  • RemoveMember() : cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h
  • RemoveMenus() : ioipf.h
  • RemoveMofInfo() : tracedmp.cpp , tracewmi.cpp
  • RemoveNamedObjectFromCollection() : Adminwrap.Cpp , Adminwrap.h
  • RemoveNode() : clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp
  • RemovePersistentDriveLetter() : DLEdit.Cpp
  • RemovePrincipalFromACL() : AclMgmt.Cpp , DComPerm.h
  • RemovePrincipalFromNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • RemoveProvider() : instlsp.cpp
  • RemoveQuotes() : msistuff.cpp
  • RemoveSocketInfo() : provider.h , sockinfo.cpp
  • RemoveSockInfo() : PrPerf.c
  • RemoveSpecialChars() : main.cpp
  • RemoveTailList : defs.h , list.h , openf.h
  • RemoveTemporaryDriveLetter() : DLEdit.Cpp
  • RemoveTransientSubscription() : Adminwrap.Cpp , Adminwrap.h
  • RemoveTxStream() : SimpleLog.Idl
  • RemoveUserAccount() : Remove.cpp
  • RemoveUserFromUList() : cMemb.h , Dlg.Cpp
  • RemoveWhiteSpaces() : main.cxx , main.hxx
  • Render() : QSample.Cxx
  • Render_ProxyFileInfo : Render_p.c
  • RenderAndFillPath() : Fx.h
  • RenderPathPoints() : Fx.c , Fx.h
  • RenderToWindow() : dxsurf2.cpp
  • ReorderACatalog() : instlsp.cpp
  • ReorderCatalog() : instlsp.cpp
  • ReorderUI_OnClose() : InstCodc.Cpp
  • ReorderUI_OnCommand() : InstCodc.Cpp
  • ReorderUI_OnDestroy() : InstCodc.Cpp
  • ReorderUI_OnInitDialog() : InstCodc.Cpp
  • ReorderUIProc() : InstCodc.Cpp
  • REPAINT_BKGND : SpinCube.h
  • repeat : Cursor.c
  • ReplaceCharWithNull() : Utility.c , Utility.h
  • ReplaceDataWithRedirectBlob : Redir401.cpp
  • REPORT_ERROR : Perfmsg.h
  • REPORT_ERROR_DATA : Perfmsg.h
  • REPORT_INFORMATION : Perfmsg.h
  • REPORT_INFORMATION_DATA : Perfmsg.h
  • REPORT_SUCCESS : Perfmsg.h
  • REPORT_WARNING : Perfmsg.h
  • REPORT_WARNING_DATA : Perfmsg.h
  • reportAnEvent() : log.c
  • ReportError() : debug.c , Credentials.cpp , helper.cpp , helper.h , wiassamp.cpp
  • ReportErrorOutOfMemory() : utils.cpp , setup.h
  • ReportStatusToSCMgr() : Service.cpp , Service.h , service.h , service.cpp , service.h , service.cpp , service.h , Service.C , Service.H , Service.c , service.cpp
  • ReportUserCancelled() : setup.h , utils.cpp
  • Req : filerepclientproc.cpp , FileRepClientProc.cpp
  • ReqCleanup() : policy.h , request.cpp
  • ReqInitialize() : request.cpp , policy.h
  • ReqState : FileRepClientProc.cpp , filerepclientproc.cpp
  • REQUEST_ICONSOLE : globals.h
  • REQUEST_ICONSOLENAMESPACE : globals.h
  • REQUEST_ICONSOLENAMESPACE2 : globals.h
  • REQUEST_ICONSOLEVERB : globals.h
  • REQUEST_ICONTROLBAR : globals.h
  • REQUEST_IDEVICETOOLBAR : globals.h
  • REQUEST_IDISPLAYHELP : globals.h
  • REQUEST_IHEADERCTRL : globals.h
  • REQUEST_IHEADERCTRL2 : globals.h
  • REQUEST_IRESULTDATA : globals.h
  • REQUEST_ISTATICTOOLBAR : globals.h
  • REQUEST_IVFILETOOLBAR : globals.h
  • RequestBorderSpace() : ioipf.h
  • RequestCallback() : Range.c
  • REQUESTCB_DATA : Range.h
  • REQUESTCB_DONE : Range.h
  • REQUESTCB_STARTED : Range.h
  • RequesterStatusCallback() : browser.cpp
  • RequestFile() : FileRepClientProc.cpp , filerepclientproc.cpp
  • REQUESTING_ONE_DISMOUNT : app.cpp
  • REQUESTING_ONE_MOUNT : app.cpp
  • RequestNewObjectLayout() : iocs.h
  • resBitmap : msiloc.cpp
  • resButtonClass : msiloc.cpp
  • RescanFile() : sdkdiff.cpp
  • resCheckBox : msiloc.cpp
  • resComboBoxClass : msiloc.cpp
  • resControl : msiloc.cpp
  • resDialog : msiloc.cpp
  • resEditClass : msiloc.cpp
  • Reserved : Tst4Wts.c
  • reserved : iec.h
  • Reset() : RmWorker.Idl
  • ResetCaret() : TextWnd.Cpp , FullIME.h , Main.C , Global.h
  • ResetCheckBoxes() : Font.c
  • ResetConnection() : CopyFileRm.Idl
  • ResetContext() : RecoDll.cpp
  • ResetHstmt() : quiktest.c
  • ResetIMECompWin() : Main.C
  • ResetSecurity() : SuperUsr.cpp
  • ResetSlotList() : hashtbl.cpp , hashtbl.h
  • ResetToolbar() : sBar.Cpp
  • ResetXForm() : XForm.c
  • resGroupBox : msiloc.cpp
  • resIcon : msiloc.cpp
  • Resize() : PAPINT.Idl
  • ResizeBorder() : ioipao.h
  • Resized() : PAPINT.Idl
  • ResizeListView() : VListVw.c , VListVw.h , DragImg.Cpp
  • ResizeQueList() : quelist.h , quelist.c
  • ResizeStatusBar() : MainWND.c
  • resJPEG : msiloc.cpp
  • resListBoxClass : msiloc.cpp
  • resListViewClass : msiloc.cpp
  • ResolveAddress() : resolve.c , resolve.h , resolve.c , resolve.cpp , resolve.h
  • ResolveVarBind() : TestMIB.C , TestMIB.h
  • Resource : comspyctl.idl
  • RESOURCE_MENU_BASE_ID : ExtObjData.cpp
  • RESOURCE_MENU_ID_1 : ExtObjData.cpp
  • RESOURCE_STRING_LEN : NewFsp.h
  • RESOURCE_TYPE_IP_ADDRESS : ClRes.h
  • RESOURCE_TYPE_NETWORK_NAME : ClRes.h
  • RespondComplete : rqsclient.h
  • Responding : rqsclient.h
  • RESPONSE_MAX_BUFFER : PoolWrap.cpp
  • resProgBar32Class : msiloc.cpp
  • resPushButton : msiloc.cpp
  • resRadioButton : msiloc.cpp
  • resRichEditClass : msiloc.cpp
  • resSelTreeClass : msiloc.cpp
  • resStaticClass : msiloc.cpp
  • resStringTable : msiloc.cpp
  • RESTART_TIMER : defs.h
  • RestoreImeUI() : ImeUI.C , FullIME.h
  • RestoreLostSurfaces() : dxsurf1.cpp
  • RestrictedThreadExecutionFunction() : Main.cpp
  • RESTYPE_DLL_NAME : StdAfx.h , ClRes.h
  • RESTYPE_MENU_BASE_ID : ExtObjData.cpp
  • RESTYPE_MENU_ID_1 : ExtObjData.cpp
  • RESTYPE_NAME : ClRes.h , StdAfx.h
  • Result : data.Idl
  • RESULT : globals.h
  • RESULT_X : IMEApps.h
  • RESULT_Y : IMEApps.h
  • ResultFromShort : Priv.h
  • RESULTREAD_X : IMEApps.h
  • RESULTREAD_Y : IMEApps.h
  • ResumeJob() : bits_ie.cpp
  • RetainShape : Demo.c
  • RETCHECK : quiktest.h
  • RetcodeToTCHAR() : quiktest.c
  • RETHROW_ERR : stdafx.h , StdAfx.h
  • RETRIES : SnmpUtil.C
  • RetrieveData() : quiktest.c
  • RetrieveTokenInformationClass() : MyToken.cpp
  • return : suminfo.Cpp
  • RETURN_FAILURE : enablerouter.c
  • RETURN_IF_FAILED : RendSam.Cpp
  • RETURN_ON_FAILURE : Child.cpp , helper.h
  • RETURN_SUCCESS : enablerouter.c
  • ReturnCheck() : quiktest.h , quiktest.c
  • returnval : RDOKB.Idl , ADOKB.Idl , OLEDBKB.Idl
  • ReverseLookup() : resolve.c , resolve.h , resolve.cpp , resolve.c
  • RevertContext() : Security.cpp , Security.h
  • RevertSecurityContext() : Stubs.c
  • REVEXT_CDPFILEURL : Policy.Cpp
  • REVEXT_CDPFTPURL : Policy.Cpp
  • REVEXT_CDPHTTPURL : Policy.Cpp
  • REVEXT_CDPLDAPURL : Policy.Cpp
  • RevokeClassFactory() : Server.Cxx , cHello.Cxx
  • rgAuthnEntries : secClnt.Cpp
  • rgAuthnLevelEntries : secSvr.Cpp , secClnt.Cpp
  • rgAuthzEntries : secClnt.Cpp
  • rgb : quiktest.h
  • rgb_barcurrent : sdkdiff.h , sdkdiff.cpp
  • rgb_barleft : sdkdiff.h , sdkdiff.cpp
  • rgb_barright : sdkdiff.cpp , sdkdiff.h
  • RGB_BLUE : common.h
  • RGB_BROWN : common.h
  • RGB_DARK_BLUE : common.h
  • RGB_DARK_GREEN : common.h
  • RGB_DARK_RED : common.h
  • rgb_defaultback : sdkdiff.cpp
  • rgb_defaultfore : sdkdiff.cpp
  • rgb_defaultforews : sdkdiff.cpp
  • rgb_fileleftback : sdkdiff.cpp
  • rgb_fileleftfore : sdkdiff.cpp
  • rgb_filerightback : sdkdiff.cpp
  • rgb_filerightfore : sdkdiff.cpp
  • RGB_FROM_COLOREF : common.h
  • RGB_GREEN : common.h
  • rgb_leftback : sdkdiff.cpp , sdkdiff.h
  • rgb_leftfore : sdkdiff.h , sdkdiff.cpp
  • rgb_mleftback : sdkdiff.h , sdkdiff.cpp
  • rgb_mleftfore : sdkdiff.h , sdkdiff.cpp
  • rgb_mrightback : sdkdiff.h , sdkdiff.cpp
  • rgb_mrightfore : sdkdiff.h , sdkdiff.cpp
  • RGB_NONE : common.h
  • rgb_outlinehi : sdkdiff.cpp , sdkdiff.h
  • RGB_RED : common.h
  • rgb_rightback : sdkdiff.cpp , sdkdiff.h
  • rgb_rightfore : sdkdiff.cpp , sdkdiff.h
  • rgb_similar : sdkdiff.cpp
  • rgb_similarleft : sdkdiff.cpp
  • rgb_similarright : sdkdiff.cpp
  • rgchResSwitch : msistuff.cpp
  • rgcmd : TapiComm.c , IpxChat.c
  • rgcmdAbout : ABOUT.c , About.c
  • rgcmdConnect : Connect.c
  • rgcmdListen : Listen.c
  • rgDBTypes : common.cpp
  • rgDescInfo : quiktest.c
  • rgDiagInfo : quiktest.c
  • rgErrorMap : error.cpp
  • rgImpLevelEntries : secSvr.Cpp , secClnt.Cpp
  • rgInterfaceMap : error.cpp
  • rgMetaName : MfEdit.h
  • rgmsd : IpxChat.c , TapiComm.c
  • rgmsdAbout : About.c , ABOUT.c
  • rgmsdConnect : Connect.c
  • rgmsdListen : Listen.c
  • rgnBitDepth : dlgdest.cpp
  • rgnSampleRate : dlgdest.cpp
  • RGPT : Mypal.h
  • rgRegInfo : myclassfactory.cpp
  • rgServerEntries : secClnt.Cpp
  • RGSIZEOF : secClnt.Cpp , secSvr.Cpp
  • rgszCommandOptions : msistuff.cpp
  • rgszResName : msistuff.cpp
  • RIGHT : Rebar.c
  • riid : Priv.h , OleStd.h
  • riid1 : helpdll.Cpp
  • riid2 : helpdll.Cpp
  • RM_COPY : RmWorker.Idl
  • RM_DELETE : RmWorker.Idl
  • RM_FORGET : RmWorker.Idl
  • RM_MOVE : RmWorker.Idl
  • RM_NONE : RmWorker.Idl
  • RM_RENAME : RmWorker.Idl
  • RM_STATUS_COPY_FAILURE : RmWorker.Idl
  • RM_STATUS_DELETE_FAILURE : RmWorker.Idl
  • RM_STATUS_ENLIST_ERROR : RmWorker.Idl
  • RM_STATUS_FAILURE : RmWorker.Idl
  • RM_STATUS_FILE_NOT_FOUND : RmWorker.Idl
  • RM_STATUS_IMPORT_ERROR : RmWorker.Idl
  • RM_STATUS_IN_MEMORY_LIST : RmWorker.Idl
  • RM_STATUS_INTERFACE : RmWorker.Idl
  • RM_STATUS_INVALID_PARM : RmWorker.Idl
  • RM_STATUS_INVALID_STATE : RmWorker.Idl
  • RM_STATUS_LOG_ERROR : RmWorker.Idl
  • RM_STATUS_MOVE_FAILURE : RmWorker.Idl
  • RM_STATUS_NO_MEMORY : RmWorker.Idl
  • RM_STATUS_OVERWRITE_EXISTING : RmWorker.Idl
  • RM_STATUS_RECOVERY_FAILURE : RmWorker.Idl
  • RM_STATUS_RENAME_FAILURE : RmWorker.Idl
  • RM_STATUS_SUCCESS : RmWorker.Idl
  • RM_STATUS_TM_DOWN : RmWorker.Idl
  • RM_STATUS_UNDO_ERROR : RmWorker.Idl
  • RM_UNDO : RmWorker.Idl
  • RM_UNDO_BEGIN : RmWorker.Idl
  • RM_UNDO_END : RmWorker.Idl
  • RMSTATUS : RmWorker.Idl
  • RND_MAX_STRING_FORMAT : RendSam.Cpp
  • ROOTSTGSTR : mwclass.Cxx
  • ROP_PSDPxax : Menu.h
  • ROUND : string.Cpp
  • ROUND4 : string.Cpp
  • ROUND_DOWN : sampprov.h , AsyncIO.h
  • ROUND_UP : AsyncIO.h , sampclnt.h , sampprov.h
  • ROUNDRECT : Common.h
  • ROUNDUP : prsample.h , common.h
  • ROUNDUP_ : common.h , prsample.h
  • ROUNDUP_AMOUNT : prsample.h , common.h
  • RouteIt() : FaxSiren.Cpp
  • ROUTEITGUID : FaxSiren.Cpp
  • ROWBUFF : hashtbl.h
  • ROWSAVAILABLE_DIDEVENT : myospobject.h
  • ROWSET_ALWAYSRELEASEROWS : coptions.h
  • ROWSET_HIDDENCOLUMNS : coptions.h
  • ROWSET_NODATA : coptions.h
  • ROWSET_OPTIONS : coptions.h
  • ROWSET_ROWSTOFETCH : coptions.h
  • ROWSET_SETDEFAULTPROPS : coptions.h
  • RowsProcessed : quiktest.c
  • RPC_EEINFO_EXIT_IF_FAIL : common.h
  • RPC_HEAP_SIZE_INIT : service.h , Service.h
  • RPC_HEAP_SIZE_MAX : service.h , Service.h , service.h
  • RpcHeap : Service.cpp , service.cpp , Service.h , service.h , service.cpp , service.h , service.cpp
  • RpcServerIfCallback() : filerepservice.cpp , Service.cpp
  • RqcTrace() : main.cpp
  • RQS_CONTROLS_ACCEPTED : main.cpp
  • RQS_MESSAGE_LENGH_SIZE : rqsclient.h
  • RQS_MESSAGE_PREFIX_SIZE : rqsclient.h
  • RQS_MESSAGE_SIZE : rqsclient.h
  • RqsClientState : rqsclient.h
  • RqsConfigString : rqsconfig.h
  • RqsEngineCbInfo : rqsengine.cpp
  • RqsEvent : rqsengine.h
  • RSM_APPSAMPLE_LABEL_EXPORT : stl_mll.h
  • RSQuery() : data.Idl
  • RSQueryRW() : data.Idl
  • RSUMINFO : suminfo.Cpp
  • RSUpdate() : data.Idl
  • RT_DLGINIT : afxres.h
  • RT_INSTALL_PROPERTY : common.h
  • RTL_NUMBER_OF : StdAfx.h , ClRes.h
  • RTM_CallbackEvent() : rtmapi.h , rtmapi.c
  • RTM_DeregisterEntity : rtmapi.h
  • RTM_DeregisterFromChangeNotification : rtmapi.h
  • RTM_DisplayDestInfo : rtmapi.h
  • RTM_GetAddress : rtmapi.h
  • RTM_GetChangedDests : rtmapi.h
  • RTM_GetMostSpecificDestination : rtmapi.h
  • RTM_GetOpaqueInformationPointer : rtmapi.h
  • RTM_IsMarkedForChangeNotification : rtmapi.h
  • RTM_MarkDestForChangeNotification : rtmapi.h
  • RTM_NextHop() : rtmapi.h , rtmapi.c
  • RTM_RegisterEntity : rtmapi.h
  • RTM_RegisterForChangeNotification : rtmapi.h
  • RTM_ReleaseChangedDests : rtmapi.h
  • RTM_ReleaseDestInfo : rtmapi.h
  • RTM_SetAddress : rtmapi.h
  • RTN_ERROR : Audit.c , LsaPrivs.c , NetShare.c , TextSid.c , Server.c , Client.c , MachAcct.c , ChngPass.c , AclApi.c
  • RTN_OK : NetShare.c , MachAcct.c , Server.c , TextSid.c , ChngPass.c , LsaPrivs.c , AclApi.c , Client.c , Audit.c
  • RTN_USAGE : Client.c , ChngPass.c , NetShare.c , Audit.c , AclApi.c , LsaPrivs.c , MachAcct.c
  • RU_BREAK_HR_IF_NULL : rasutil.h
  • RU_BREAK_IF_NOT_OK : rasutil.h
  • RU_BREAK_IF_NULL : rasutil.h
  • RU_ELEMENT_COUNT : rasutil.h
  • RU_LEAVE_HR_IF_NULL : rasutil.h
  • RU_LEAVE_IF_NOT_OK : rasutil.h
  • RU_LEAVE_IF_NULL : rasutil.h
  • RU_RETURN_IF_NOT_OK : rasutil.h
  • RU_RETURN_IF_NULL_PARAM : rasutil.h
  • RU_SOCKET : rusocket.cpp
  • RU_SOCKET_CREATE_DATA : rusocket.h
  • RuAlloc() : rumem.cpp , rumem.h
  • RubberBandScreen() : WinCap.c , WinCap.h
  • RuFree() : rumem.h , rumem.cpp
  • Run() : blrplate.h , blrplate.cpp
  • RunClientMode() : bthcxn.cpp
  • RunGetImage() : GetImage.cpp
  • RunServerMode() : bthcxn.cpp
  • RunSysCommand() : common.h
  • RURASREGROOT : rureg.cpp
  • RURASREGROOTNUM : rureg.cpp
  • RuRegFreeValues() : rureg.h , rureg.cpp
  • RuRegGet() : rureg.h , rureg.cpp
  • RuRegOpenKey() : rureg.h , rureg.cpp
  • RUREGVALUE : rureg.h
  • RuSocketCleanup() : rusocket.cpp , rusocket.h
  • RuSocketClose() : rusocket.cpp , rusocket.h
  • RuSocketCreate() : rusocket.cpp , rusocket.h
  • RuSocketCreateServer() : rusocket.cpp , rusocket.h
  • RuSocketGetAddress() : rusocket.cpp , rusocket.h
  • RuSocketInit() : rusocket.h , rusocket.cpp
  • RuSocketListen() : rusocket.cpp , rusocket.h
  • RuSocketRead() : rusocket.cpp , rusocket.h
  • RuSocketReadBlock() : rusocket.h , rusocket.cpp
  • RuSocketReadCurrent() : rusocket.cpp , rusocket.h
  • RuSocketReadLine() : rusocket.cpp , rusocket.h
  • RuSocketWrite() : rusocket.cpp , rusocket.h
  • RuSocketWriteLine() : rusocket.h , rusocket.cpp
  • RuStringDupAtoW() : rustring.h , rustring.cpp
  • RuStringDupWtoA() : rustring.h , rustring.cpp
Generated on Wed Nov 13 2024 16:58:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- s -

  • s : bar.cpp , sdkdiff.cpp , suminfo.Cpp
  • s_cInstances : secSvr.Cpp
  • s_ClassFactory : secSvr.Cpp
  • s_crCurrent : secClnt.Cpp
  • s_csDone : secSvr.Cpp
  • s_fDone : secSvr.Cpp
  • s_fServer : secSvr.Cpp
  • s_fService : secSvr.Cpp
  • s_hbrCurrent : secClnt.Cpp
  • s_hevtDone : secSvr.Cpp
  • s_hwndDlg : secSvr.Cpp
  • s_RemoteOpen() : filerepserverproc.cpp
  • s_RemoteRead() : filerepserverproc.cpp
  • s_RemoteReadAsyncPipe() : FileRepServerProc.cpp
  • s_rgprop : utilprop.cpp
  • s_rgsteServices : secSvr.Cpp
  • S_RU_EQUALS : rasutil.h
  • S_RU_GREATER : rasutil.h
  • S_RU_LESS : rasutil.h
  • s_Service : secSvr.Cpp
  • sa_ipx : rnrcs.cpp
  • SAFE_ADDREF : common.h , sampprov.h , common.h
  • SAFE_ALLOC : common.h , sampprov.h , common.h
  • SAFE_APPEND() : CreateUserHelpers.cpp , otherwko1.cpp
  • SAFE_BSTRALLOC : common.h
  • SAFE_BSTRFREE : common.h
  • SAFE_DELETE : common.h , sampprov.h
  • SAFE_DELETE_ARRAY : sampprov.h
  • SAFE_FREE : common.h , sampprov.h , common.h
  • SAFE_FREE_BITMAP() : globals.h
  • SAFE_FREE_ICON() : globals.h
  • SAFE_FREE_STRING : StdAfx.h
  • SAFE_REALLOC : common.h , sampprov.h , common.h
  • SAFE_RELEASE : common.h , sampprov.h , common.h , StdAfx.h , dxsurf1.cpp , dxsurf2.cpp , dxsurf3.cpp , globals.h
  • SAFE_SUBTRACT_POINTERS : CeLibW2k.h
  • SAFE_SYSALLOC : sampprov.h , common.h
  • SAFE_SYSFREE : sampprov.h , common.h
  • SafeArrayToString() : common.cpp , common.h
  • SafeCat() : bits_ie.cpp
  • SafeCloseHandle : stdafx.h
  • SafeCopy() : bits_ie.cpp
  • SafeLocalFree : stdafx.h
  • SAFERELEASE : Adminwrap.Cpp
  • SafeRelease : StdAfx.h , stdafx.h , globals.h
  • SafeReleaseClear : globals.h
  • SafeStrCopy() : util.cpp , util.h
  • SafeStringCopy() : globals.h
  • SafeStringPrintf() : bits_ie.cpp
  • SameCall() : CallNot.cpp , CallNot.h
  • SAMPLE_CLASS : BasicHiPerf.h
  • SAMPLE_CLASS_NAME : ClassProv.Cpp
  • SAMPLE_CUSTOM_DIAL_DLG : customdial.cpp
  • SAMPLE_CUSTOM_ENTRY_DATA : customdial.cpp
  • SAMPLE_HELPER_DATA : nshsamp.h
  • SAMPLE_HELPER_VERSION : nshsamp.h
  • SAMPLE_PROTOCOL_MULTICAST_GROUP : ipsamplerm.h
  • SAMPLE_TAPI_VERSION : TapiCode.c
  • SAMPLEAPI : ipsample.c , ipsample.h
  • SAMPLEITEMSETTINGS : Settings.h
  • SampMatchworkstation() : SubAuth.c
  • SAMPPROV_URL_PREFIX : sampprov.h
  • Save() : ips.h , PAPINT.Idl
  • SaveCompleted() : ips.h
  • Saved() : PAPINT.Idl
  • SaveDIB() : Dibapi.h , File.c
  • SaveDIBFile() : File.c
  • SaveGlobalSettings() : Utility.Cpp , Utility.h
  • SaveMe() : WinCap.c , WinCap.h
  • SaveObject() : iocs.h
  • SaveStaticEntries() : MfEdit.c
  • SaveToFile() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • SavingDlgProc() : Dialogs.c , WinCap.h
  • SB_N_PANES : MidiPlyr.h
  • SB_PANE_STATE : MidiPlyr.h
  • SB_PANE_TFMT : MidiPlyr.h
  • SBITEM_CHARCODE : Status.c
  • SBITEM_CMODEFIRST : Status.c
  • SBITEM_CMODELAST : Status.c
  • SBITEM_EUDC : Status.c
  • SBITEM_FULLSHAPE : Status.c
  • SBITEM_HANJA : Status.c
  • SBITEM_NATIVEMODE : Status.c
  • SBITEM_NOCONVERSION : Status.c
  • SBITEM_OPENSTATUS : Status.c
  • SBITEM_ROMAN : Status.c
  • SBITEM_SOFTKBD : Status.c
  • SBITEM_SYMBOL : Status.c
  • SBS_BOTTOMALIGN : winres.h
  • SBS_HORZ : winres.h
  • SBS_LEFTALIGN : winres.h
  • SBS_RIGHTALIGN : winres.h
  • SBS_SIZEBOX : winres.h
  • SBS_SIZEBOXBOTTOMRIGHTALIGN : winres.h
  • SBS_SIZEBOXTOPLEFTALIGN : winres.h
  • SBS_TOPALIGN : winres.h
  • SBS_VERT : winres.h
  • sc : OleStd.h , suminfo.Cpp , suminfo.h
  • SC_ARRANGE : winres.h
  • SC_CLOSE : winres.h
  • SC_HOTKEY : winres.h
  • SC_HSCROLL : winres.h
  • SC_IDEAL_SEND_RECV : TestAccept.cpp
  • SC_KEYMENU : winres.h
  • SC_MAXIMIZE : winres.h
  • SC_MINIMIZE : winres.h
  • SC_MOUSEMENU : winres.h
  • SC_MOVE : winres.h
  • SC_NEXTWINDOW : winres.h
  • SC_NUM_SCENARIOS : TestAccept.cpp
  • SC_PREVWINDOW : winres.h
  • SC_RESTORE : winres.h
  • SC_SCREENSAVE : winres.h
  • SC_SEND_NO_RECV : TestAccept.cpp
  • SC_SEND_THEN_RECV : TestAccept.cpp
  • SC_SEND_WAIT_RECV : TestAccept.cpp
  • SC_SIZE : winres.h
  • SC_TASKLIST : winres.h
  • SC_VSCROLL : winres.h
  • SC_WAIT_SEND_RECV : TestAccept.cpp
  • SCALEDIFF : quiktest.h
  • ScaleDownloadEstimate() : bits_ie.cpp
  • ScaleDownloadRate() : bits_ie.cpp
  • ScanChunk() : lrsample.CXX
  • SCardPropCert() : PropCert.Cpp
  • SCFree() : SCCommon.Cpp , SCCommon.h
  • SCGetAttrib() : SCCommon.Cpp , SCCommon.h
  • SCGetResponse() : SCCommon.Cpp , SCCommon.h
  • SchannelCred : WebClient.c
  • SchemaEnum : adoint.h
  • SCHEMAINFO : cdialog.h
  • sci : columnprovider.Cpp
  • SCListCards() : SCCommon.Cpp , SCCommon.h
  • SCListGroups() : SCCommon.Cpp , SCCommon.h
  • SCListReaders() : SCCommon.Cpp , SCCommon.h
  • SCMalloc() : SCCommon.Cpp , SCCommon.h
  • SCOPE : globals.h
  • SCRAMBLE : Common.h
  • ScrambleFile() : Pipeproc.c
  • Scratch() : iDog.Idl
  • SCRATCH_BUFFER : Dt_Dll.Cpp
  • sCreateTable : ComSpysqlAudit.Cpp
  • ScriptToken : HtmlScan.Hxx
  • Scroll() : ioips.h
  • SCROLL_RATIO : WinCap.c
  • SCROLLDIR : idt.h
  • SCROLLDIR_DOWN : idt.h
  • SCROLLDIR_LEFT : idt.h
  • SCROLLDIR_NULL : idt.h
  • SCROLLDIR_RIGHT : idt.h
  • SCROLLDIR_UP : idt.h
  • SCSelectFile() : SCCommon.Cpp , SCCommon.h
  • SD_SIZE : Security.Cpp
  • SDEBUGGLOBALS : Eap.c
  • sDescription : CpyImage.Idl
  • sDestination : RmWorker.Idl , TxFileDisp.Idl
  • sdkdiff_UI() : sdkdiff.cpp , sdkdiff.h
  • sdkdiff_usage() : sdkdiff.cpp
  • SDTYPE_ACCESS : DComPerm.h
  • SDTYPE_APPLICATION_ACCESS : DComPerm.h
  • SDTYPE_APPLICATION_LAUNCH : DComPerm.h
  • SDTYPE_DEFAULT_ACCESS : DComPerm.h
  • SDTYPE_DEFAULT_LAUNCH : DComPerm.h
  • SDTYPE_MACHINE_ACCESS : DComPerm.h
  • SDTYPE_MACHINE_LAUNCH : DComPerm.h
  • sdw : quiktest.h
  • SDWORD : sampprov.h
  • Search() : Sample1.Cpp , Sample1.h
  • SEARCH_REQUEST : AsyncIO.h
  • SEARCH_REQUEST_STATE : AsyncIO.h
  • SearchDirection : adoint.h
  • SearchDirectionEnum : adoint.h
  • SearchedFileCount : AsyncIO.h
  • SearchForError() : quiktest.c
  • SearchFunction : AsyncIO.h
  • SearchString : AsyncIO.h
  • SearchStringLength : AsyncIO.h
  • SEC : FontView.c
  • SEC_CONTEXT : SampSSP.H
  • SEC_FUNC : HttpAuth.c
  • SEC_INDEX : TIMEWND.c
  • SEC_SEP_INDEX : TIMEWND.c
  • SEC_SUCCESS : KList.c , HttpAuth.c , Security.cpp
  • SecTableW : Stubs.c
  • SECTION : section.h , suminfo.h
  • section_delete() : section.cpp , section.h
  • section_deletelist() : section.cpp , section.h
  • section_expandanchor() : section.cpp
  • section_getcorrespond() : section.cpp , section.h
  • section_getfirstline() : section.cpp , section.h
  • section_getlastline() : section.cpp , section.h
  • section_getleftbasenr() : section.cpp , section.h
  • section_getlinecount() : section.cpp , section.h
  • section_getlink() : section.cpp , section.h
  • section_getrightbasenr() : section.cpp , section.h
  • section_getstate() : section.cpp , section.h
  • section_makecomposite() : section.cpp , section.h
  • section_makectree() : section.cpp
  • section_makelist() : section.cpp , section.h
  • section_match() : section.cpp , section.h
  • section_matchlists() : section.cpp , section.h
  • section_new() : section.cpp , section.h
  • section_setleftbasenr() : section.cpp
  • section_setrightbasenr() : section.cpp
  • section_setstate() : section.cpp , section.h
  • section_takesection() : section.cpp
  • SECTOMILLISEC : defs.h
  • Security : comspyctl.idl
  • security : suminfo.h
  • SECURITY_WIN32 : StdAfx.h , FileRepServer.cpp , FileRepService.cpp , Service.cpp , filerepservice.cpp , SampSSP.H , AuthzSvr.c , KList.c , Gss-Misc.h , HttpAuth.c , Client.cpp , Security.cpp , Server.cpp , WebClient.c , WebServer.c
  • SEEK_FROM_BEGINNING : wn_dos.h
  • SEEK_FROM_END : wn_dos.h
  • SeekHfile : wn_dos.h
  • SeenDialogNames : complist.cpp
  • SelectAndInitializeTerminal() : Processing.cpp
  • SelectApplications() : ComSpyCtl.Idl
  • SelectDevice() : Atsp.c
  • SelectDlgProc() : Dialogs.c , WinCap.h
  • SelectEntry() : secClnt.Cpp , secSvr.Cpp
  • SelectFromTable() : quiktest.c
  • SelectFromTableFetch() : quiktest.c
  • selection : sdkdiff.cpp , view.cpp
  • selection_nrows : sdkdiff.cpp , view.cpp
  • selector : suminfo.Cpp
  • SelectPackages() : MtsSpyCtl.Idl
  • SelectTerminalsOnCall() : Incoming.Cpp , Outgoing.Cpp
  • SEND_INFO : Sender.Cpp
  • send_token() : GssMisc.c
  • SENDARGS : provider.h
  • SendBuiltinLogonPage() : CustomAuth.cpp
  • SendBytes() : Comm.cpp , Comm.h
  • SendData() : common.cpp , common.h
  • SendDataForPaw() : fwasync.c
  • Sender() : QosEvent.h , Sender.Cpp , MqTestOA.Cpp , MqTrans.Cpp , MSMQTest.c , ATMEvent.h , Sender.Cpp
  • SendErrorToClient() : readcli.c
  • SendExtensionInitFailed() : PoolWrap.cpp
  • SendFile() : CConf.Cpp , CConf.h , CChan.h , cft.cpp , cft.h
  • SendFileDlgProc() : Dlg.Cpp
  • SendFileOver() : ftrans.c , fwasync.c , fwrite.c
  • SendFileToClient() : ftrans.c , fwasync.c , fwrite.c
  • SendHeaders() : Extension.cpp
  • SendHeaderToClient() : ftrans.c , fwasync.c , fwrite.c
  • SendHelpPage() : Extension.cpp
  • SendHttpHeaders() : formdump.cpp , WorkerThread.c
  • SendHttpPostResponse() : main.c
  • SendHttpResponse() : main.c
  • SendInstructionPage() : Redirect.cpp
  • SendMsg() : Comm.cpp , Comm.h
  • SendMSGToClient() : areadcli.c
  • SendOutBox() : Globals.h , Misc.c
  • SendQueueFull() : PoolWrap.cpp
  • SendRedirectResponse() : ReMapUrl.cpp
  • SendRequest() : AsyncDemo.cpp
  • SendServerError() : WildCardMap.cpp
  • SendSomeMessages() : MQPort.Cpp
  • SendStatisticsPage() : Extension.cpp
  • SendText() : Global.h , Util.Cpp
  • SendThreadInitFailed() : PoolWrap.cpp
  • SendTo_FillSendToMenu() : sendto.c
  • SendTo_OnCommand() : sendto.c
  • SendTo_OnCreate() : sendto.c
  • SendTo_OnDestroy() : sendto.c
  • SendTo_OnInitMenuPopup() : sendto.c
  • SendTo_OnOpen() : sendto.c
  • SendTo_ResetSendToMenu() : sendto.c
  • SendTo_SendToItem() : sendto.c
  • SendTo_WndProc() : sendto.c
  • SENDTOARGS : provider.h
  • SendVariables() : formdump.cpp
  • SendWmSizeMessage() : DebMisc.c , DebMisc.h
  • SEPARATORHEIGHT : TextWnd.Cpp
  • SEPARATORWIDTH : PlgBlt.h
  • SEQ : SEQ.h
  • SEQ_F_COLONIZED : SEQ.h
  • SEQ_F_EOF : SEQ.h
  • SEQ_F_WAITING : SEQ.h
  • SEQ_S_NOFILE : SEQ.h
  • SEQ_S_OPENED : SEQ.h
  • SEQ_S_PAUSED : SEQ.h
  • SEQ_S_PLAYING : SEQ.h
  • SEQ_S_PREROLLED : SEQ.h
  • SEQ_S_PREROLLING : SEQ.h
  • SEQ_S_RESET : SEQ.h
  • SEQ_S_STOPPING : SEQ.h
  • SEQ_VERSION : SEQ.h
  • seqAllocBuffers() : SEQ.h , SEQUENCE.c
  • seqCloseFile() : SEQ.h , SEQUENCE.c
  • seqFreeBuffers() : SEQ.h , SEQUENCE.c
  • seqMIDICallback() : SEQUENCE.c
  • seqMillisecsToTicks() : SEQ.h , SEQUENCE.c
  • seqOpenFile() : SEQ.h , SEQUENCE.c
  • seqPause() : SEQ.h , SEQUENCE.c
  • seqPreroll() : SEQ.h , SEQUENCE.c
  • seqRestart() : SEQ.h , SEQUENCE.c
  • seqStart() : SEQ.h , SEQUENCE.c
  • seqStop() : SEQ.h , SEQUENCE.c
  • seqTicksToMillisecs() : SEQ.h , SEQUENCE.c
  • seqTime() : SEQ.h , SEQUENCE.c
  • SERVER : Bcast.c
  • server_acquire_creds() : GssServer.c
  • SERVER_ERROR : CustomAuth.h , IsapiRequest.cpp
  • server_establish_context() : GssServer.c
  • SERVER_PERDRAW_STR : RESDEF.h
  • SERVER_PERSERVE_STR : RESDEF.h
  • SERVER_PERTEXT_STR : RESDEF.h
  • SERVER_REGISTRY_COMMENT : Server.Cpp
  • SERVER_TUTFILE_STR : AptClien.h , ConClien.h , DComDraw.h , DllClien.h , FreClien.h , LocClien.h , RemClien.h , StoClien.h
  • SERVER_WINDOW_TITLE_STR : AptClien.h , LocClien.h
  • ServerActiveReqBounds : Service.cpp , Service.h
  • ServerActiveReqHashCounters : Service.cpp , Service.h
  • ServerCompletionPort : FileRepServerProc.cpp , Service.cpp
  • ServerCompletionPortTimeout : FileRepServerProc.cpp
  • ServerDialogProc() : secSvr.Cpp
  • SERVERFLAGS : main.cpp
  • SERVERINFO : autotest.h
  • ServerProc() : Server32.c , Server32.h
  • SERVERPROP : UtilLib.h
  • ServerProtocolArray : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • ServerRecv() : rnrcs.cpp
  • ServerReqBounds : Service.cpp , Service.h , service.cpp , service.h
  • ServerReqQueues : Service.cpp , Service.h
  • ServerShutdownRequest() : FileRepServerProc.cpp
  • ServerStop() : Service.cpp , Service.h
  • ServerThread() : Simples.c
  • ServerThreadProc() : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • SERVERTYPE : cfactory.h
  • Service : resource.h
  • service_ctrl() : Service.C , Service.c
  • service_main() : Service.C , Service.c
  • ServiceCtrl() : FileRepService.cpp , filerepservice.cpp
  • SERVICEDISPLAYNAME : Service.h , service.h
  • ServiceHandlerEx() : main.cpp
  • ServiceMain() : FileRepService.cpp , filerepservice.cpp , main.cpp
  • SERVICENAME : Service.h , service.h
  • ServiceRequests() : FileRepClientProc.cpp , filerepclientproc.cpp
  • ServiceStart() : FileRepService.cpp , filerepservice.cpp , Server.c , Service.H , Simple.c
  • ServiceStop() : FileRepService.cpp , filerepservice.cpp , Server.c , Service.H , Simple.c
  • SessionDialogProc() : rtcdialogs.cpp
  • SET : WSnmpUtil.h
  • SET_CASE_PROPERTY : property.cpp
  • set_codebreakpoint() : BPSamp.h , Utils.c
  • SET_CUSTOM_PROPERTY : property.cpp
  • set_databreakpoint() : BPSamp.h , Utils.c
  • Set_String() : Service.cpp
  • set_thread_eip_back() : BPSamp.h , Utils.c
  • Set_Uint32() : Service.cpp
  • Set_Uint64() : Service.cpp
  • SetAbort() : CpyImage.Idl
  • SETABORT : stdafx.h
  • SetAccessMaskFromCommandLine() : DComPerm.Cpp
  • SetAccountClsctx() : Account.Idl
  • SetAccountRights() : DComPerm.h , SrvcMgmt.Cpp
  • SetAclDefaults() : DComPerm.h , SDMgmt.Cpp
  • SetActiveObject() : ioipf.h
  • SetAllocatorProperties() : Processing.cpp , tapisend.cpp
  • SetAppLite() : cdialoglite.cpp , cdialoglite.h
  • SetAttrColor() : Paint.c
  • SetAudioFormat() : Processing.cpp
  • SetAuditEvent() : Audit.c
  • SetAuditMode() : Audit.c
  • SETAUTHIDENTITY : cunknown.h
  • SETAUTHINFO : cunknown.h
  • SETBIT : CeLibW2k.h
  • SetBlockingProvider : spi.cpp
  • SetBorderSpace() : ioipf.h
  • SetBottomRight : idt.Cpp
  • SetBusy() : sdkdiff.cpp
  • SetButtonText() : sdkdiff.cpp
  • SetByteArrayAsOctetString() : util.cpp , util.h , util.cpp , util.h
  • SetCACMode() : RecoDll.cpp
  • SetCallState() : Atsp.c , Atsp.h
  • SetClerk() : CrmMonComp.Idl
  • SetClientSite() : ioo.h
  • SetColorScheme() : ioo.h
  • SetColours() : sdkdiff.cpp
  • SetCommandProperties() : AdvQuery.Cxx , QSample.Cxx
  • SetComplete() : CpyImage.Idl
  • SETCOMPLETE : stdafx.h
  • SetConnectionAttributes() : quiktest.c
  • SetConnectionIP() : RendSam.Cpp
  • SetConnectionMode() : MqTestOA.Cpp , MSMQTest.c
  • SetConsole() : odbcsql.c
  • SetConvModeParts() : IMEApps.h , Status.c
  • SetCurrentDllNode() : DebDebug.c
  • SetCurrentNode() : LinkList.c , LinkList.h
  • SetCurrentNodeEx() : LinkList.c , LinkList.h
  • SetCurrentPrivilege() : MachAcct.c
  • SetCurrentProcessNode() : DebDebug.c
  • SetCurrentThreadNode() : DebDebug.c
  • SetData() : ido.h
  • SETDEFAULTFORMATETC : OleStd.h
  • SetDefaultHardLimit() : Commands.Cpp , Commands.h
  • SetDefaultThreshold() : Commands.Cpp , Commands.h
  • SETDEFAUTHINFO : cunknown.h
  • SETDefFormatEtc : DataObj.h
  • SETDEFSERVERINFO : cunknown.h
  • SetDiagnosticMode() : utils.cpp
  • SetDispDlgProc() : SetDisp.c , SetDisp.h
  • SetDlgItemValue() : Dialogs.c
  • SetEmptySz : Global.h
  • SetEnumPrintersDlgFields() : Enumprt.c , Enumprt.h
  • SetErrorCondition() : quiktest.c
  • SetErrorPosting() : error.cpp , error.h
  • SetExtensionKey() : registry.cpp
  • SetExtent() : ioo.h
  • SetFileSize() : FileRepClientProc.cpp
  • SetFocusEditCtls() : EDITCTLS.c , EDITCTLS.h
  • SETFORMATETC : OleStd.h
  • SetGlobalInfo() : rmapi.c
  • SetGuide() : RecoDll.cpp
  • SetHostNames() : ioo.h
  • SetIcmpSequence() : Ping.cpp
  • SetIMECompFormPos() : FullIME.h , Main.C
  • SetInitProps() : oledbcomponent.Cpp
  • SetInterfaceConfigInfo() : rmapi.c
  • SetInterfaceSecurity() : WbemSec.Cpp , WbemSec.h
  • SetIpPort() : rnrcs.cpp
  • SetIUnknownProperty() : Adminwrap.Cpp , Adminwrap.h
  • SetJobData() : queue.c , queue.h
  • setKeyAndValue() : registry.cpp , registry.Cpp , Registry.Cpp , registry.Cpp
  • SetKeyAndValue() : registry.cpp
  • SetLegacyAclDefaults() : SDMgmt.Cpp
  • SetLogFont() : Global.h , Style.Cpp
  • SetMenu() : ioipf.h
  • SetMenuCheck() : Global.h , Util.Cpp , Global.h , Util.Cpp
  • SetMenuData() : common.cpp , common.h
  • SetModuleName() : IsapiDebug.h
  • SetMoniker() : ioo.h
  • SetMonoColours() : sdkdiff.cpp
  • SetMonoDIBPixel() : Dib.c , Dib.h
  • SetMulticastLoopBack() : Mcastws1.c , Mcastws2.c
  • SetMulticastTtl() : Mcastws1.c , Mcastws2.c
  • SetNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • SetNames() : sdkdiff.cpp , sdkdiff.h
  • SetNewFspRegistryData() : NewFsp.h , Reg.c
  • SetNodeTypesKey() : registry.cpp
  • SetNotBusy() : sdkdiff.cpp
  • SetNullGuid() : app.cpp
  • SetObjectRects() : ioipo.h
  • SetOneAction() : MainWND.c
  • SetOpenStatusParts() : IMEApps.h , Status.c
  • SetOs : suminfo.h
  • SetOverlappedInProgress() : overlap.cpp
  • SetPoolDACL() : app.cpp
  • SetPrinterDACL() : SecPrint.c
  • SetPrinterQueueData() : queue.c , queue.h
  • SetPrivilegeOnAccount() : LsaPrivs.c
  • SetProperty() : property.cpp , property.h , property.cpp , property.h , Service.cpp
  • SetPropResult : Global.h
  • SetProxySecurity() : security.cpp
  • SetProxyUsingTunnelAddress() : cmsample.cpp
  • SetQos() : QosEvent.h , SetQos.Cpp
  • SetQueListContents() : quelist.c , quelist.h
  • SetRecord() : CrmMonComp.Idl
  • SetRegEntry() : common.cpp , common.h , common.cpp , common.h
  • SetRegKeyValue() : AppUtil.Cpp , AppUtil.h , Reg.Cpp , Reg.h
  • SetResolutionMenu() : SetDisp.c , SetDisp.h
  • SetRestriction() : property.cpp , property.h
  • SetRunAsPassword() : DComPerm.h , SrvcMgmt.Cpp
  • SetScopeCatalogAndMachine() : AdvQuery.Cxx
  • SetSelection() : sdkdiff.cpp
  • SetSendInterface() : Mcastws1.c , Mcastws2.c
  • SetSliderPos : halftone.c
  • setSnapInExtensionNode() : registry.Cpp
  • SetSnapInKeyAndValue() : registry.cpp
  • setSnapInKeyAndValue() : registry.Cpp , Registry.Cpp , registry.Cpp
  • setStandard() : suminfo.Cpp
  • SetState() : RmWorker.Idl
  • SetStateAndTag() : compitem.cpp
  • SetStatementAttributes() : quiktest.c
  • SetStatus() : sdkdiff.cpp , sdkdiff.h
  • SetStatusItems() : IMEApps.h , Status.c
  • SetStatusMessage() : FileTerm.cpp , FileTerm.h , Callnot.Cpp , Incoming.Cpp
  • SetStatusText() : ioipf.h
  • SetStringAttribute() : util.cpp , util.h , util.cpp , util.h , util.cpp , util.h , util.cpp , util.h
  • SetStringListAttribute() : util.cpp , util.h
  • SetStringProperty() : Adminwrap.Cpp , Adminwrap.h
  • SetStyle() : Global.h , Style.Cpp
  • SetSubMenuData() : common.cpp , common.h
  • SetSumInfFMTID : suminfo.h
  • SetTableName() : quiktest.c
  • SetTerminalFormat() : tapisend.cpp
  • SetThis() : common.cpp , common.h
  • setthread_databreakpoint() : Utils.c
  • SettingsDlgProc() : Global.h , Settings.Cpp
  • SetToolbarCheck() : Global.h , sBar.Cpp
  • SetTooltipText() : IMEApps.h , ToolBar.c
  • SetTopLeft : idt.Cpp
  • SetTtl() : Ping.cpp
  • SetupBindings() : sampclnt.cpp , sampclnt.h
  • SetupCommEvent() : CommCode.c
  • SetupControls() : halftone.c
  • SetupLoadResourceString() : common.h , utils.cpp
  • SetupNamedPipe() : common.c , common.h
  • SetupNamedPipes() : Server.c
  • SetupReadEvent() : CommCode.c
  • SetupScrollBars() : WinCap.c , WinCap.h
  • SetUserHardLimit() : Commands.Cpp , Commands.h
  • SetUserThreshold() : Commands.Cpp , Commands.h
  • SetValue() : registry.cpp
  • setValue() : registry.Cpp , Registry.Cpp , registry.Cpp
  • SetWindowTime() : bits_ie.cpp
  • SetWindowTitle() : ViewDIB.c
  • SetWinstaDesktopSecurity() : Server.c
  • SEVERITY_MASK : MsgTest.c
  • SeWorldSid : TakeOwn.c
  • SF_BEGINNING : wn_dos.h
  • SF_BUTTON : gutils.h
  • SF_CURRENT : wn_dos.h
  • SF_END : wn_dos.h
  • SF_LEFT : gutils.h
  • SF_LOWER : gutils.h
  • SF_MAXLABEL : status.cpp
  • SF_RAISE : gutils.h
  • SF_RIGHT : gutils.h
  • SF_STATIC : gutils.h
  • SF_SZMAX : gutils.h
  • SF_SZMIN : gutils.h
  • SF_VAR : gutils.h
  • SFFS : wn_dos.h
  • SFGAO_BROWSABLE : Utility.h
  • Shape : Demo.c
  • ShapePlaceRun() : DspFormt.Cpp
  • SHARED_MEMORY_ITEM_COUNT : AppMemi.h
  • SHARED_MEMORY_MUTEX_NAME : AppMemi.h
  • SHARED_MEMORY_MUTEX_TIMEOUT : AppMemi.h
  • SHARED_MEMORY_OBJECT_NAME : AppMemi.h
  • SHARED_MEMORY_OBJECT_SIZE : AppMemi.h
  • ShareDlgProc() : Dlg.Cpp
  • SHCreateDefClassObject() : DefClsF.C , Priv.h
  • Shell_CreateDefClassObject() : DefClsF.C
  • ShellExec() : wn_dos.h
  • ShellFree() : sendto.c
  • SHGDN_INCLUDE_NONFILESYS : Utility.h
  • Shift() : MICARS.Idl
  • ShipStatus : QCNotify.Idl
  • ShortQuote() : news.Idl
  • ShouldEscape() : IsapiString.cpp
  • show_whitespace : sdkdiff.cpp , sdkdiff.h
  • ShowAddressDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShowAuthDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShowCmdLineHelp() : bthcxn.cpp
  • ShowColor() : Mypal.c , Mypal.h
  • SHOWERRORCOMPLETEDMSG : Handler.h
  • SHOWERRORMSG : Handler.h
  • ShowGridLines() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ShowGuide() : GuidE.c , GuidE.h
  • showHelp : WxForm.h
  • ShowHwnd() : Global.h , Util.Cpp , Global.h , rtns.Cpp
  • ShowLastError() : KList.c
  • ShowLocalDlgProc() : Dlg.Cpp
  • ShowLogonDialog() : rtcdialogs.cpp , rtcdialogs.h
  • showMouse : WxForm.h
  • ShowNTError() : KList.c
  • ShowObject() : iocs.h
  • ShowOnScreen() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ShowOptions() : Globals.h , PropSht.c
  • SHOWPROPERTIESCOMPLETEDMSG : Handler.h
  • SHOWPROPERTIESMSG : Handler.h
  • ShowPropInfo() : DpDetail.Cpp
  • ShowResults() : bankdlg.Cpp , bankthrds.Cpp
  • ShowSessionDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShowTgt() : KList.c
  • ShowTickets() : KList.c
  • showTransform : WxForm.h
  • ShowUsage() : DComPerm.Cpp , FTPJr.cpp
  • ShowWatcherDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShrinkBitmap() : Menu.c
  • ShrName : Client32.c
  • Shutdown : ShutdownDlg.h , AsyncRPC.Idl , AsyncRPCp.c , ClUuidp.c , DUnionp.c , InOutp.c , Repasp.c , Xmitp.c , Dyneptp.c , Cxhndlp.c , Usrdefp.c , Hellop.c , RPCssmp.c
  • ShutDown() : Pipeproc.c , Remote.c
  • ShutdownItems : ShutdownDlg.Cpp
  • ShutdownTapi() : tapirecv.cpp
  • ShutdownTAPI() : TapiCode.c , TapiCode.h , tapisend.cpp
  • ShutdownTapi() : FileTerm.cpp , FileTerm.h , Incoming.Cpp , Outgoing.Cpp
  • ShutdownThread() : filerepclientproc.cpp
  • ShutdownThreadPool() : PoolWrap.cpp
  • SI_BUFFER_SIZE : dbh.cpp
  • SID_BUF_SIZE : log.c
  • SID_SIZE : NetShare.c
  • SIDE_BORDER : DebMain.c
  • sieve() : Cursor.c , Cursor.h
  • SIGGEN_COUNTER : DataGen.h
  • SIGGEN_DATA_DEFINITION : DataGen.h
  • SIGGEN_NUM_PERF_OBJECT_TYPES : DataGen.h
  • SIGGEN_OBJ : GenCtrnm.h
  • SigGenDataDefinition : DataGen.c , Perfgen.c
  • sign_server() : GssServer.c
  • SignalAlert() : bits_ie.cpp
  • SIGNATURE : SampSSP.H
  • SignOnly : GssClient.c
  • SignThis() : Security.cpp , Security.h
  • SignVerifyFile() : SignHash.cpp
  • SimpleDlgProc() : Dialogs.c , FontView.c
  • SINE_WAVE : GenCtrnm.h
  • SINK_ID : EventSinks.h
  • SIRENDIR : FaxSiren.Cpp
  • six2pr : HttpAuth.c
  • SIZE : Cursor.c
  • SIZE_64K : hashtbl.h
  • SIZE_DATE : IsapiTime.cpp
  • SIZE_ENCODED_CHUNK : IsapiBuffer.cpp , IsapiString.cpp
  • SIZE_FOR_FIRST_TRY : app.cpp
  • SIZE_MSG_BUFFER : DComPerm.h
  • SIZE_NAME_BUFFER : DComPerm.h
  • SIZE_TIME : IsapiTime.cpp
  • SIZE_TIME_STRING : IsapiTime.cpp
  • SIZE_UNENCODED_CHUNK : IsapiBuffer.cpp , IsapiString.cpp
  • SizeDouble() : strmHelp.Cxx , strmHelp.h
  • SizeEditCtls() : EDITCTLS.c , EDITCTLS.h
  • sizel : OleStd.h
  • SizeMsgWindow() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h , rtns.Cpp
  • sizeofArray : TapiInfo.c
  • SIZEOFCAPTIONTEXT : MfEdit.h
  • SizeStatus() : Global.h , rtns.Cpp
  • SkipAnsi() : AppUtil.Cpp , AppUtil.h
  • SkipAnsiString() : register.Cpp
  • SkipNonWhite() : Get_Sock.c
  • SkipValue() : msiloc.cpp , msistuff.cpp
  • SkipWhite() : Get_Sock.c
  • SkipWhiteSpace() : msiloc.cpp , msistuff.cpp
  • SL_BLOCK : Select.h
  • SL_BOX : Select.h
  • SL_EXTEND : Select.h
  • SL_SPECIAL : Select.h
  • SL_TYPE : Select.h
  • sleeptime : Admapit.c
  • SlideWindow() : Globals.h , Util.c
  • SLONG : sampprov.h
  • SLOT : hashtbl.h
  • SM_NEW : gutils.h
  • SM_SETTEXT : gutils.h
  • SM_TABLETPC : TPCInfo.cpp
  • sMainColor : CpyImage.Idl
  • SMALL_BUFF : Client.cpp , Server.cpp
  • SMALLBUFF : quiktest.h
  • SmartAppendBackslash() : Utility.Cpp , Utility.h
  • SmartEnumFilesPointer : bits_ie.cpp
  • SmartEnumJobsPointer : bits_ie.cpp
  • SmartFilePointer : bits_ie.cpp
  • SmartIUnknownPointer : bits_ie.cpp
  • SmartJob2Pointer : bits_ie.cpp
  • SmartJobErrorPointer : bits_ie.cpp
  • SmartJobPointer : bits_ie.cpp
  • SmartManagerPointer : bits_ie.cpp
  • SmartPersistFilePointer : bits_ie.cpp
  • SmartShellLinkPointer : bits_ie.cpp
  • SMF : SMFI.h
  • SMF_ALREADY_OPEN : SMF.h
  • SMF_END_OF_FILE : SMF.h
  • SMF_END_OF_TRACK : SMF.h
  • SMF_F_EOF : SMFI.h
  • SMF_F_INSERTSYSEX : SMFI.h
  • SMF_INVALID_BUFFER : SMF.h
  • SMF_INVALID_FILE : SMF.h
  • SMF_INVALID_PARM : SMF.h
  • SMF_INVALID_TRACK : SMF.h
  • SMF_META_PENDING : SMF.h
  • SMF_NO_MEMORY : SMF.h
  • SMF_NO_META : SMF.h
  • SMF_OPEN_FAILED : SMF.h
  • SMF_REACHED_TKMAX : SMF.h
  • SMF_SUCCESS : SMF.h
  • SMF_TF_EOT : SMFI.h
  • SMF_TF_INVALID : SMFI.h
  • smfBuildFileIndex() : SMFI.h , SMFREAD.c
  • smfCloseFile() : SMF.c , SMF.h
  • SMFFILEINFO : SMF.h
  • smfGetFileInfo() : SMF.c , SMF.h
  • smfGetNextEvent() : SMFI.h , SMFREAD.c
  • smfGetStateMaxSize() : SMF.c , SMF.h
  • smfGetVDword() : SMFI.h , SMFREAD.c
  • smfInsertParmData() : SMF.c
  • smfMillisecsToTicks() : SMF.c , SMF.h
  • smfOpenFile() : SMF.c , SMF.h
  • SMFOPENFILESTRUCT : SMF.h
  • smfReadEvents() : SMF.c , SMF.h
  • SMFRESULT : SMF.h
  • smfSeek() : SMF.c , SMF.h
  • smfTicksToMillisecs() : SMF.c , SMF.h
  • smpFilter : SmpFilt.Cxx
  • smpHandler : SmpFilt.Cxx
  • SMX_OFFSETOF : DropExt.C
  • sMyData : ComDlg32.C
  • SNMP_FAILURE : WSnmpUtil.h
  • SNMP_MGR_SESSION : WSnmpUtil.h
  • SnmpExtensionInit() : TestDll.C
  • SnmpExtensionQuery() : TestDll.C
  • SnmpExtensionTrap() : TestDll.C
  • SNMPTRAPOIDINDEX : WSnmpUtil.h
  • SNOOP_HEIGHT : snoop.cpp
  • SNOOP_WIDTH : snoop.cpp
  • SNOOP_X_POS : snoop.cpp
  • SNOOP_Y_POS : snoop.cpp
  • sock : Bcast.c , Globals.h
  • SOCK_INFO : common.h , provider.h
  • SOCKET_BUFF_SIZE : Client.cpp , Server.cpp
  • SOCKET_COUNT : PrPerf.c
  • SocketCallbackSendCompletion() : socket.c
  • SocketCreate() : socket.c , socket.h
  • SocketDestroy() : socket.c , socket.h
  • SocketReceive() : socket.c , socket.h
  • SocketReceiveEvent() : socket.c , socket.h
  • SOCKETS_METHOD : HttpGet.c
  • SocketSend() : socket.c , socket.h
  • Socklist : Overlap.c
  • SOURCE : cbase.h
  • SOURCE_GETINTERFACE : cbase.h
  • SOURCE_GETOBJECT : cbase.h
  • SOURCE_GETPARENT : cbase.h
  • SourceFile : UnBufCp1.c , UnBufCp2.c
  • SP_OPTIONS : QosEvent.h
  • SPACE : common.h
  • SPEAKER_NOT_SPECIFIED : childview.h
  • SPEAKERS_USED : childview.h
  • SpeakTextWndProc() : MainDlg.Cpp
  • SPECIAL_CHAR_HASH_TABLE_SIZE : CharHash.Hxx
  • Speed() : MICARS.Idl
  • SpeedDial1Proc() : Dialer.c
  • SpeedDial2Proc() : Dialer.c
  • SPEVENT : SMFI.h
  • SPIN_EVENT : SpinCube.h
  • SPIN_INTERVAL : SpinCube.h
  • SPINCUBE_EXTRA : SpinCube.h
  • SPINCUBE_REPAINT_BKGND : SpinCube.h
  • SPINCUBECLASS : SpinCube.h
  • SPINCUBEDEFAULTTEXT : SpinCube.h
  • SPINCUBEDESCRIPTION : SpinCube.h
  • SpincubeDlgProc() : SpinCube.c , SpinCube.h
  • SpincubeSizeToText() : SpinCube.c , SpinCube.h
  • SpincubeStyle() : SpinCube.c , SpinCube.h
  • SpincubeWndProc() : SpinCube.c , SpinCube.h
  • SPROCKETS : nshsamp.h
  • SQL_BUF_SIZE : ComSpysqlAudit.h
  • SQL_COPT_SS_BASE : MqTrans.Cpp
  • SQL_COPT_SS_ENLIST_IN_DTC : MqTrans.Cpp
  • SQL_DTC_DONE : MqTrans.Cpp
  • SQL_EXEC : Events.Cpp
  • SQL_FAILED : stdafx.h , bankthrds.Cpp , odbcdata.h
  • sqlBinary : msiloc.cpp
  • sqlControl : msiloc.cpp
  • sqlControlImport : msiloc.cpp
  • sqlControlInstallerName : msiloc.cpp
  • sqlCreateCtrlMark : msiloc.cpp
  • sqlCreateDlgMap : msiloc.cpp
  • sqlCreateStrMap : msiloc.cpp
  • sqlCtrlMark : msiloc.cpp
  • sqlDialog : msiloc.cpp
  • sqlDialogImport : msiloc.cpp
  • sqlDialogInstallerName : msiloc.cpp
  • sqlDialogSpecific : msiloc.cpp
  • sqlDlgMap : msiloc.cpp
  • sqlFindResId : msiloc.cpp
  • sqlFindStrResId : msiloc.cpp
  • sqlInsertCtrl : msiloc.cpp
  • sqlInsertStr : msiloc.cpp
  • sqlProductCode : setup.h
  • sqlRadioButton : msiloc.cpp
  • sqlRadioButtonImport : msiloc.cpp
  • sqlSelMaxRcId : msiloc.cpp
  • sqlSelMaxStrRcId : msiloc.cpp
  • sqlStrCol : msiloc.cpp
  • sqlStringImport : msiloc.cpp
  • sqlStringInstallerName : msiloc.cpp
  • sqlStrMark : msiloc.cpp
  • sqlStrTemp : msiloc.cpp
  • SQUARE_WAVE : GenCtrnm.h
  • SReq : FileRepServerProc.cpp
  • SReqState : FileRepServerProc.cpp
  • SrvSock : Globals.h
  • SS_BLACKFRAME : winres.h
  • SS_BLACKRECT : winres.h
  • SS_CENTER : winres.h
  • SS_ERASE : SpinCube.h , SpinTest.h
  • SS_GRAYFRAME : winres.h
  • SS_GRAYRECT : winres.h
  • SS_ICON : winres.h
  • ss_in : rnrcs.cpp
  • SS_INMOTION : SpinCube.h , SpinTest.h , DynDlg.c
  • SS_LEFT : winres.h
  • SS_LEFTNOWORDWRAP : winres.h
  • SS_NOPREFIX : winres.h
  • SS_RIGHT : winres.h
  • SS_SIMPLE : winres.h
  • SS_WHITEFRAME : winres.h
  • SS_WHITERECT : winres.h
  • ssBackOrdered : QCNotify.Idl
  • SServiceRequests() : FileRepServerProc.cpp
  • sshStatusHandle : Service.cpp , Service.h , filerepservice.cpp , Service.C , Service.c
  • SSLBIT_CASIGN : policy.cpp , Policy.Cpp
  • SSLBIT_CASMIME : policy.cpp , Policy.Cpp
  • SSLBIT_CASSL : policy.cpp , Policy.Cpp
  • SSLBIT_CLIENT : policy.cpp , Policy.Cpp
  • SSLBIT_RESERVED : policy.cpp , Policy.Cpp
  • SSLBIT_SERVER : policy.cpp , Policy.Cpp
  • SSLBIT_SIGN : policy.cpp , Policy.Cpp
  • SSLBIT_SMIME : policy.cpp , Policy.Cpp
  • ssNotStocked : QCNotify.Idl
  • sSource : TxFileDisp.Idl
  • ssShipped : QCNotify.Idl
  • ssStatus : Service.cpp , Service.h , filerepservice.cpp , Service.C , Service.c
  • ssUnprocessed : QCNotify.Idl
  • ssUnrecognizedItem : QCNotify.Idl
  • STA_OFFSET : Resource.h
  • sTables : ComSpysqlAudit.Cpp
  • STACK_ENTRY : list.h
  • StackFormat() : common.cpp , common.h
  • STANDARD : MSMQTest.c
  • STANDARDSECINMEM : suminfo.h
  • StandardSender() : MqTestOA.Cpp , MSMQTest.c
  • STAR : defs.h
  • START_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES : utilprop.h
  • START_OF_SUPPORTED_DBINIT_PROPERTIES : utilprop.h
  • START_OF_SUPPORTED_ROWSET_PROPERTIES : utilprop.h
  • START_OF_SUPPORTED_SESSION_PROPERTIES : utilprop.h
  • START_SAMPLE_IO : socket.c
  • START_STEP : RendSam.Cpp
  • StartAnchor : Anchor.Hxx
  • StartComm() : CommCode.c , CommCode.h
  • StartComplete() : rmapi.c
  • StartDebuggee() : DebMisc.c , DebMisc.h
  • StartFileRepServer() : Service.cpp , Service.h
  • StartHelpers() : nshsamp.cpp , nshsamp.h
  • StartListening() : tapirecv.cpp
  • StartNotifications() : threads.c , threads.h
  • StartOfFileToken : HtmlScan.Hxx
  • StartOverlappedManager() : overlap.cpp
  • StartPolling() : threads.c , threads.h
  • StartProtocol() : rmapi.c
  • StartReadThreadProc() : CommCode.c
  • StartSelection() : Select.h , Select.c
  • StartThread() : Server.Cpp
  • StartTime() : Client.C
  • Startup() : ClRes.cpp
  • StartWriteThreadProc() : CommCode.c
  • STAT_ENDOFCURSOR : sampprov.h
  • STATE_CHECKED : cmainwindow.h
  • STATE_COMPARABLE : state.h
  • STATE_DIFFER : state.h
  • STATE_FILELEFTONLY : state.h
  • STATE_FILERIGHTONLY : state.h
  • STATE_LEFTONLY : state.h
  • STATE_MARKED : state.h
  • STATE_MOVEDLEFT : state.h
  • STATE_MOVEDRIGHT : state.h
  • STATE_MSG : Global.h
  • STATE_NONE : common.h
  • STATE_NORMAL : cmainwindow.h
  • STATE_RIGHTONLY : state.h
  • STATE_SAME : state.h
  • STATE_SIMILAR : state.h
  • STATE_SIMILARLEFT : state.h
  • STATE_SIMILARRIGHT : state.h
  • STATE_SIZE : quiktest.h
  • STATE_UNCHECKED : cmainwindow.h
  • StateActive : filerepclientproc.cpp , FileRepClientProc.cpp , FileRepServerProc.cpp
  • StateArrived : FileRepClientProc.cpp , FileRepServerProc.cpp , filerepclientproc.cpp
  • StateChange() : App32.C
  • STATEICONS : cmainwindow.h
  • STATEIMAGEINDEX : cdialoglite.h
  • STATEL : status.cpp
  • StateQueued : FileRepClientProc.cpp , FileRepServerProc.cpp , filerepclientproc.cpp
  • StateToColour() : sdkdiff.cpp
  • Static_Check_Stats : AdminDll.c
  • STATIC_COLORS : MfEdit.h
  • Static_Connection_Info : AdminDll.c
  • Static_Info_Database : AdminDll.c
  • Static_Statistic : AdminDll.c
  • STATMESSAGEMAP : CStatHlp.h
  • status : filerepservice.cpp
  • Status : Admapit.c , Status.c , secSvr.Cpp
  • STATUS : queue.h
  • status : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • STATUS_ARRAY_SIZE : quiktest.h
  • status_charheight : status.cpp
  • status_charwidth : status.cpp
  • status_height : sdkdiff.cpp
  • STATUS_ID : Resource.h
  • STATUS_INVALID_PARAMETER : Audit.c
  • STATUS_IS_BOUND : common.h
  • STATUS_OFFLINE : globals.h
  • STATUS_ONLINE : globals.h
  • STATUS_REPORT : Common.h
  • STATUS_REPORT_REF : Common.h
  • STATUS_REPORT_STRING : Common.h
  • STATUS_REPORT_STRING2 : Common.h
  • STATUS_REPORT_STRING2_REF : Common.h
  • STATUS_REPORT_STRING_REF : Common.h
  • STATUS_SUCCESS : HttpAuth.c , Audit.c , LsaPrivs.c , PwdFilt.c
  • StatusAddItem() : gutils.h , status.cpp
  • StatusAlloc() : gutils.h , status.cpp
  • StatusArray : quiktest.c
  • STATUSBAR : cmainwindow.cpp
  • STATUSBAR_DESC : cmainwindow.cpp
  • STATUSBAR_TEXT : cmainwindow.cpp
  • StatusBarHeight() : FontView.c , Status.c
  • STATUSBARLOOKUP : Printer.h
  • StatusButtonDown() : status.cpp
  • StatusButtonUp() : status.cpp
  • StatusCalcHeight() : status.cpp
  • StatusCalcWidth() : status.cpp
  • StatusCreate() : gutils.h , status.cpp
  • StatusCreateTools() : status.cpp
  • StatusDeleteTools() : status.cpp
  • statusField : Status.c
  • StatusFieldProc() : Status.c
  • StatusGetItem() : status.cpp
  • StatusHeight() : status.cpp , gutils.h
  • STATUSICONSIZE : Global.h
  • StatusInit() : gutils.cpp , status.cpp
  • StatusMsg() : Global.h , sBar.Cpp
  • StatusPaint() : status.cpp
  • StatusProc() : Status.c
  • StatusResize() : status.cpp
  • StatusWndProc() : status.cpp
  • STDAPI_() : getIcon.c , monitor.cpp , propldr.cpp , targtdev.c , suminfo.Cpp , regdb.c , OleStd.c , ole2ui.c , msgfiltr.c , drawIcon.c , OleStd.h , msgfiltr.h , Utils.Cpp , Utils.h , msgfiltr.h , OleStd.h , dbgUtil.c , drawIcon.c , hatch.c , msgfiltr.c , Objfdbk.c , ole2ui.c , OleStd.c , oleutl.c , regdb.c , stdpal.c , suminfo.Cpp , suminfo.h , targtdev.c , case.cpp , langbar.cpp , server.cpp , dap.cpp , langbar.cpp , mark.cpp , pstore.cpp , server.cpp
  • STDENTRY : PerDraw.h , DllServe.h , ComObj.h , ConServe.h , DllSkel.h , FreServe.h , LicServe.h , PerServe.h , PerText.h , StoServe.h
  • STDENTRY_ : ComObj.h , DllSkel.h , PerText.h , ConServe.h , DllServe.h , DllSkel.h , FreServe.h , LicServe.h , PerDraw.h , PerServe.h , StoServe.h , ComObj.h , DllSkel.Cpp
  • STDMETHOD_() : dballoc.h
  • STDMETHODIMP_() : dxferObj.Cpp , UtilCAR.Cpp , UTCRUCAR.Cpp , CRUCAR.Cpp , Sample.Cpp , BALL.Cpp , UTCRUCAR.Cpp , Connect.Cpp , PAPER.Cpp , SINK.Cpp , UtilCAR.Cpp , CAR.Cpp , ips.Cpp , Obj.Cpp , ioipo.Cpp , ido.Cpp , app.Cpp , icf.Cpp , idt.h , ias.h , ids.h , ioips.h , app.Cpp , iocs.h , ias.Cpp , ias.h , component.cxx , msgfiltr.c , malspy.c , enumStat.c , callback.Cpp , ICliSite.Cpp , IIpSite.Cpp , perstor.Cpp , OLEDoc.Cpp , clsfact.Cpp , dataobj.cpp , ShlView.Cpp , ClassFac.Cpp , basesnap.Cpp , MethProv.Cpp , DataObj.Cpp , ShlFldr.Cpp , DataObj.Cpp , oipaObj.Cpp , oipObj.Cpp , OLEDocVw.Cpp , OLEObj.Cpp , perfile.Cpp , ExtrIcon.Cpp , Framer.Cpp , IAdvSink.Cpp , DropTgt.Cpp , IDocSite.Cpp , Site.Cpp , Dogcf.Cpp , iDog.Cpp , cfWrap.Cpp , csur.Cpp , ClsFact.Cpp , enumfetc.c , malspy.c , FileView.Cpp , msgfiltr.c , pipe.cxx , ToolBand.Cpp , DataObj.Cpp , app.Cpp , doc.Cpp , ias.Cpp , Dragsrc.Cpp , ias.h , iocs.Cpp , EmptyVolumeCache.Cpp , ioipf.Cpp , ioipf.h , ioips.Cpp , columnprovider.Cpp , site.Cpp , doc.Cpp , CommBand.Cpp , ias.Cpp , ias.h , DeskBand.Cpp , ids.Cpp , idt.Cpp , ClsFact.Cpp , iocs.Cpp , iocs.h , site.Cpp , Notify.Cpp , doc.Cpp , icf.h , comp.Cpp , compdata.Cpp , Provider.Cpp , ido.h , iec.Cpp , iec.h , ioipao.Cpp , ioipao.h , InstProv.Cpp , ioipo.h , ioo.Cpp , ioo.h , Factory.Cpp , ips.h , UTCRUCAR.Cpp , CRUCAR.Cpp , Factory.Cpp , UtilCAR.Cpp , CAR.Cpp , Consumer.Cpp , CRUCAR.Cpp , UTCRUCAR.Cpp , Events.cpp , BALL.Cpp , Connect.Cpp , Factory.Cpp , Provider.Cpp , Factory.Cpp , SINK.Cpp , dataobj.Cpp , CAR.Cpp , CRUCAR.Cpp , Factory.Cpp , ClassFac.Cpp , UtilCAR.Cpp , Factory.Cpp , compdata.Cpp , CRUCAR.Cpp , Factory.Cpp , Sample.Cpp , basesnap.Cpp , CAR.Cpp , Factory.Cpp , basesnap.Cpp , DRAWSINK.Cpp , ListSINK.Cpp , TextSINK.Cpp , comp.Cpp , DRAWPage.Cpp , Connect.Cpp , about.Cpp , PageList.Cpp , Connect.Cpp , Factory.Cpp , basesnap.Cpp , UTCRUCAR.Cpp , Connect.Cpp , compdata.Cpp , comp.Cpp , tsfedit.cpp , PAPER.Cpp , cbase.cpp , cdialoglite.cpp , Enumidl.Cpp , DropSrc.Cpp , binder.cpp , IPerFile.Cpp , binder.cpp , classfac.cpp , basesnap.Cpp , datasrc.cpp , ClassFactory.Cpp , dbsess.cpp , row.cpp , Notify.Cpp , dataobj.Cpp , stream.cpp , MainWnd.cpp , ClassFac.Cpp , BasicHiPerf.Cpp , ADEvent.cpp , Service.cpp , Events.cpp , Cfact.Cpp , Enum.Cpp , Handler.Cpp , dataobj.Cpp , Settings.Cpp , basesnap.Cpp , compdata.Cpp , tbarext.Cpp , dataobj.Cpp , about.Cpp , compdata.Cpp , comp.Cpp , compdata.Cpp , comp.Cpp , dataobj.Cpp , compdata.Cpp , basesnap.Cpp , dataobj.Cpp , comp.Cpp , compdata.Cpp , dataobj.Cpp , about.Cpp , cMenuext.Cpp , about.Cpp , compdata.cpp , comp.Cpp , dataobj.cpp , comp.cpp , basesnap.Cpp , comp.Cpp , comp.cpp , about.cpp , compdata.cpp , comp.cpp , dataobj.cpp , comp.cpp , basesnap.cpp , compdata.Cpp , comp.cpp , about.cpp , basesnap.cpp , about.Cpp , basesnap.cpp , about.cpp , about.Cpp , comp.Cpp , compdata.Cpp , basesnap.Cpp , Dataobj.Cpp , CompData.Cpp , about.Cpp , dataobj.Cpp , about.Cpp , basesnap.Cpp , compdata.Cpp , About.Cpp , nameext.Cpp , Comp.Cpp , comp.Cpp , compdata.cpp , comp.cpp , about.cpp , basesnap.cpp , comp.cpp , compdata.cpp , dataobj.cpp , compdata.cpp , dataobj.cpp , enumformatetc.cpp , about.cpp , compdata.cpp , basesnap.cpp , dataobj.cpp , basesnap.cpp , proppagex.cpp , compdata.cpp , basesnap.cpp , dataobj.cpp , dataobj.Cpp , about.Cpp , basesnap.Cpp , about.cpp , compdata.cpp , comp.Cpp , basesnap.Cpp , compdata.Cpp , about.Cpp , basesnap.Cpp , ppgeext.Cpp , basesnap.Cpp , basesnap.cpp , basesnap.Cpp , contextmenuex.cpp , dataobj.Cpp , enumtask.Cpp , about.Cpp , comp.cpp , compdata.Cpp , about.Cpp , comp.Cpp , ClassProv.Cpp , Consumer.Cpp , Factory.Cpp , dataobj.Cpp , comp.Cpp , Factory.Cpp , about.Cpp , ClassFac.Cpp , PropProv.Cpp , Notify.Cpp , BaseSnap.Cpp , dataobj.Cpp , ExplrBar.Cpp , comp.Cpp , DataObj.cpp , DropTgt.Cpp , Enumfe.Cpp , DropExt.C , FVInit.Cpp , IFileVW.Cpp , basesnap.Cpp , ContMenu.Cpp , dataobj.Cpp , CopyHook.Cpp , ShellExt.Cpp , IcnOvrly.Cpp , about.Cpp , basesnap.Cpp , dataobj.Cpp , about.Cpp , compdata.Cpp , basesnap.Cpp , comp.Cpp , about.Cpp , UTCRUCAR.Cpp , BitmapWnd.cpp , rowset.cpp , command.cpp , clistener.cpp , Factory.Cpp , SINK.Cpp , TextPage.Cpp , Factory.Cpp , Connect.Cpp
  • STDZ : suminfo.h
  • SteCommand() : Main.C
  • SteCreate() : Main.C
  • Steer() : MICARS.Idl
  • SteIMECompWindowPos() : Main.C
  • SteImeOpenClose() : Main.C
  • StemCompare() : lrsample.CXX
  • StepOverPidl() : sendto.c
  • SteRegister() : Main.C
  • SteWndProc() : FullIME.h , Main.C
  • StgCreateDocfile : AppUtil.h
  • StgIsStorageFile : AppUtil.h
  • STGM_DFALL : OleStd.h
  • STGM_DFRALL : OleStd.h
  • STGM_SALL : OleStd.h
  • StgOpenStorage : AppUtil.h
  • StgOpenStorageA : ansiapi.h
  • sTheme : CpyImage.Idl
  • STL_LABEL_Application : stl.h
  • STL_LABEL_ApplicationSize : stl.h
  • STL_LABEL_LabelType : stl.h
  • STL_LABEL_LabelTypeSize : stl.h
  • STL_LABEL_MediaIDBlank : stl.h
  • STL_LABEL_MediaIDSize : stl.h
  • STL_LABEL_TapeNameSize : stl.h
  • STL_LABEL_TimeStampSize : stl.h
  • STL_LABEL_Vendor : stl.h
  • STL_LABEL_VendorSize : stl.h
  • STL_LABEL_Version : stl.h
  • STL_LABEL_VersionSize : stl.h
  • sToFile : CpyImage.Idl
  • StopAsyncWindowManager() : provider.h , asyncselect.cpp
  • StopComm() : CommCode.c , CommCode.h
  • StopOverlappedManager() : provider.h , overlap.cpp
  • StopProtocol() : rmapi.c
  • StopUpdateThread() : threads.c , threads.h
  • StoreChar() : Main.C
  • StoreDBCSChar() : Main.C
  • StoreSD() : security.cpp
  • str : Cursor.c
  • STR2UNI : DComPerm.h
  • STR_ACP : res.h , resource.h
  • STR_APPTITLE : resource.h
  • STR_CPLEN : global.h
  • STR_EXT_TITLE : IcnOvrly.Cpp
  • STR_FMTID_FullPath : columnprovider.Cpp
  • STR_FMTID_ShortFilename : columnprovider.Cpp
  • STR_ItemBool : tracedmp.h
  • STR_ItemChar : tracedmp.h
  • STR_ItemCharShort : tracedmp.h
  • STR_ItemDouble : tracedmp.h
  • STR_ItemDSString : tracedmp.h
  • STR_ItemDSWString : tracedmp.h
  • STR_ItemFloat : tracedmp.h
  • STR_ItemGuid : tracedmp.h
  • STR_ItemIPAddr : tracedmp.h
  • STR_ItemLong : tracedmp.h
  • STR_ItemLongLong : tracedmp.h
  • STR_ItemMLString : tracedmp.h
  • STR_ItemNWString : tracedmp.h
  • STR_ItemPort : tracedmp.h
  • STR_ItemPString : tracedmp.h
  • STR_ItemPtr : tracedmp.h
  • STR_ItemPWString : tracedmp.h
  • STR_ItemShort : tracedmp.h
  • STR_ItemSid : tracedmp.h
  • STR_ItemString : tracedmp.h
  • STR_ItemUChar : tracedmp.h
  • STR_ItemULong : tracedmp.h
  • STR_ItemULongLong : tracedmp.h
  • STR_ItemULongX : tracedmp.h
  • STR_ItemUShort : tracedmp.h
  • STR_ItemWChar : tracedmp.h
  • STR_ItemWString : tracedmp.h
  • STR_JOBNAME_DEFAULT : cdialog.cpp
  • STR_LANG : res.h , resource.h
  • STR_LANGID : resource.h , res.h
  • STR_LARGENEGNUMBER : resource.h
  • STR_LARGEPOSNUMBER : resource.h
  • STR_LEN : MqTrans.Cpp , global.h
  • STR_NCOUNTRY : resource.h , res.h
  • STR_NEGCURRENCY : resource.h
  • STR_NLANG : res.h , resource.h
  • STR_OEMCP : res.h , resource.h
  • STR_POSCURRENCY : resource.h
  • STR_QUEUE_LABEL : QueueDef.h
  • STR_QUEUE_NAME : QueueDef.h
  • STR_REG_PATH : IcnOvrly.Cpp
  • STR_RESDLL_NOTFOUND : resource.h
  • STR_SAMPLETEXT_DEFAULT : cdialog.cpp
  • STR_TITLE : resource.h
  • STR_VIRTUALDIR_NOTIFICATIONS : cdialog.cpp
  • STR_VIRTUALDIR_PLAIN : cdialog.cpp
  • StrChr() : Global.h , Util.Cpp
  • strDuplicate() : common.h , common.cpp
  • StrDupWFromA() : Admapit.c , AdminDll.c
  • STREAM_FIND_DATA : FindStream.h
  • STREAM_VIEW_CLASS_NAME : DfV.h
  • StreamFile() : tapisend.cpp
  • STRETCH_BLT : Common.h
  • StretchIconToWindow() : WinCap.h
  • STRICT : EnumerateKeys.cpp , StdAfx.h , stdafx.h , Cancel.Cpp , OleImp.Cpp , fakemenu.h , StdAfx.h , OleApt.Cpp , dbgUtil.c , getIcon.c , App32.h , ole2ui.c , suminfo.Cpp , targtdev.c , Priv.h , StdAfx.h , Obscure.c , StdAfx.h , SysInfo.h , stdafx.h , StdAfx.h , Property.c , StdAfx.h , ToolBar.c , StdAfx.h , Monkey.c , headers.h , Fontsize.c , Client32.c , Server32.c , StdAfx.h , Copy.c , Dibutil.c , Dllinit.c , Print.c , DebDebug.c , stdafx.h , Hello3.h , StdAfx.h , config.cpp , stdafx.h , StdAfx.h , SidClean.c , StdAfx.h , Stdafx.h , StdAfx.h , dxsurf3.cpp , StdAfx.h , DebMain.c , StdAfx.h , quelist.c , Rebar.c , fulldrag.h , sendto.h , tallmenu.h , StdAfx.h , Check_SD.h , RasHost.h , StdAfx.h , stdafx.h , StdAfx.h , PhoneEntry.c , blrplate.cpp , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , Wepcode.c , oleutl.c , WinCap.c , StdAfx.h , File.c , Dialogs.c , Hook.c , Errors.c , Dlgopen.c , threads.c , dialogs.c , SetDisp.h , errors.c , queue.c , printjob.c , stdafx.h , MciPlay.c , stdafx.h , winmain.h , headers.h , regdb.c , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , Utility.c , StdAfx.h , hatch.c , msgfiltr.c , Objfdbk.c , enumfetc.c , StdAfx.h , enumStat.c , drawIcon.c , dballoc.Cpp , secSvr.Cpp , stdafx.h , sserver.cpp , Util.Cpp , ComPerf.Cpp , stdafx.h , StdAfx.h , OleStd.c , stdafx.h , Hello2.h , DebMisc.c , VListVw.c
  • STRING_BUFFER : Extension.cpp
  • STRING_CASE : Debug.Cpp
  • STRING_LENGTH : readcli.c
  • STRING_SEPARATOR : ADs.cpp
  • STRING_SIZE : HelloIsapi.cpp
  • StringAppendF() : DebMisc.h , DebMisc.c
  • StringClass : MainFrm.Cpp
  • StringCompare() : common.cpp , common.h
  • StringCompareI() : common.h , common.cpp
  • StringCompareW() : StringUtils.cpp , PropList.h , PropList.cpp , StringUtils.cpp , PropList.cpp , StringUtils.cpp , StringUtils.h , PropList.h , StringUtils.cpp , PropList.h , PropList.cpp , StringUtils.h , StringUtils.cpp , PropList.h , StringUtils.h
  • StringCopy() : common.h , common.cpp
  • StringFormat() : common.cpp , common.h
  • StringFromCLSID2A : ansiapi.h
  • StringFromCLSIDA : ansiapi.h
  • StringFromGUID2 : AppUtil.h
  • StringFromGUID2A : ansiapi.h
  • StringFromIID2A : ansiapi.h
  • StringInput() : gutils.h , utils.cpp
  • StringListToString() : helper.cpp , helper.h
  • StringListToVariant() : util.cpp , util.h , helper.h , helper.cpp
  • StringPrintF() : DebMisc.h , DebMisc.c
  • STRINGS_ONLY : registry.Cpp , Registry.Cpp , registry.Cpp
  • StringToClsid() : RegAcc32.Cxx , RegAcc32.Hxx
  • StringToGuid() : TraceLog.c
  • StringToPhysAddr() : IPArp.Cpp , IPArp.h
  • StringToSafeArray() : common.cpp , common.h
  • StringToStringList() : helper.h , helper.cpp
  • StringToVariant() : common.h , common.cpp
  • StringToVector() : common.cpp , common.h
  • stringW : AdsiDump.cpp
  • strOverLimit : msiloc.cpp
  • strRegKey : classfac.cpp
  • StrRetToStr() : sendto.c
  • STRSAFE_LIB : StdAfx.h , Globals.h , StdAfx.h
  • STRSAFE_NO_DEPRECATE : space.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , Server.Cpp , mmccrack.Cpp , space.Cpp , Utils.Cpp , space.Cpp , mmccrack.Cpp , UtilLib.h , space.Cpp , BasicHiPerf.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp
  • STRSAFE_WITH_GETS : httpauth.cpp , FTPJr.cpp
  • STRSIZE : dialogs.c
  • STRSUBFUNC : view.cpp
  • strTitle : drawdlg.cpp
  • StructsIn1() : Server.c
  • StructsIn2() : Server.c
  • StructsIn3() : Server.c
  • strValue : classfac.cpp
  • strValueName : classfac.cpp
  • StyleCheckRange() : Style.Cpp , Global.h
  • StyleDeleteRange() : Style.Cpp , Global.h
  • StyleExtendRange() : Style.Cpp , Global.h
  • StyleSetRange() : Global.h , Style.Cpp
  • SUB_TREE : WSnmpUtil.h
  • SubclassInputEditProc() : EDITCTLS.c
  • SubclassWindow() : DebMisc.h , DebMisc.c
  • SubClsEdit() : Init.Cpp , Main.Cpp , ui.cpp
  • SUBLANG_ENGLISH_SAMPLE : lrsample.HXX
  • SUBMITTED : queue.h
  • SUBSCRIBERMAP : StdAfx.h
  • SUBSCRIPTION : Adminwrap.h
  • SubVersion : sdkdiff.cpp
  • SUCCESS : FCopy.Cpp , TapiCode.c
  • SUCCESS_PRINT : enablerouter.c
  • SUI_F_CANPAUSE : MainWND.c
  • SUI_F_CANPLAY : MainWND.c
  • SUI_F_CANSELDEVICE : MainWND.c
  • SUI_F_CANSTOP : MainWND.c
  • sum : fullsvr.Idl
  • SUMMARY_FILE_NAME : tracedmp.h
  • SummaryFile : tracedmp.cpp
  • SUMMARYINFO : suminfo.h
  • SUPERMETRIC : nshsamp.h
  • SUPPORTCONCURINFO : quiktest.h
  • Supported() : quiktest.c
  • SupportedGeometry : Mfmt.c
  • SupportedGeometryCount : Mfmt.c
  • SUPPORTOPTINFO : quiktest.h
  • SuppressData : Redir401.cpp
  • SvrClose() : sdkdiff.cpp
  • sw : quiktest.h
  • SWAP : DIBSectn.c , WinCap.c
  • SwapPalE : MfEdit.c
  • swBindOffset : quiktest.c
  • SwitchLists() : list.cpp
  • SwitchView() : DragImg.Cpp , VListVw.c
  • SWORD : sampprov.h , custom.c
  • SYM_BUFFER_SIZE : dbh.cpp
  • Symbol : news.Idl
  • SymbolFromName() : dbh.cpp
  • SymTagMax : dbh.cpp
  • SYNCHINFO : common.cpp
  • SYNCHRONIZECOMPLETEDMSG : Handler.h
  • SYNCHRONIZEMSG : Handler.h
  • SynchSubProc() : common.cpp , common.h
  • SyncIO : AsyncIO.h
  • SyncSendGenericServerError() : IsapiRequest.cpp , IsapiRequest.h
  • SyncSibling() : winmain.cpp , winmain.h , common.h , common.cpp
  • SyncUI() : MainWND.c
  • Syntax() : MSMQTest.c , resource.h , MqTestOA.Cpp , MqTrans.Cpp
  • SysLogOnOff() : cMgr.h , cMgr.Cpp
  • SYSTEMCLASS : UtilLib.h
  • SystemEndTime : PrPerf.c
  • SystemError() : Error.Cpp , Error.h
  • SystemEventInfo : selectEventsDlg.Cpp
  • SystemExceptionTranslator() : Except.Cxx , Except.Hxx
  • SystemMessage() : DComPerm.h , UtilS.Cpp
  • SYSTEMPREFIX : UtilLib.h
  • SystemStartTime : PrPerf.c
  • SYSUPTIMEINDEX : WSnmpUtil.h
  • SZ : StdAfx.h
  • sz2addr() : dbh.cpp
  • SZ_ABS_SD_BUF : SidClean.c
  • SZ_ACCT_NAME_BUF : SidClean.c
  • SZ_DACL_BUF : SidClean.c
  • SZ_DMN_NAME_BUF : SidClean.c
  • SZ_NAME_BUF : SidClean.c
  • SZ_OUTPUTFILENAME : Processing.cpp
  • SZ_REL_SD_BUF : SidClean.c
  • SZ_SACL_BUF : SidClean.c
  • SZ_SAMPLESYNCMGRHANDLERWNDCLASS : Handler.h
  • SZ_SAMPLESYNCMGRWORKERWNDCLASS : Handler.h
  • SZ_SID_OWN_BUF : SidClean.c
  • SZ_SID_PG_BUF : SidClean.c
  • SZABOUT : GLOBALS.h
  • szAddress : custom.c
  • szAdminInstallProperty : setup.h
  • szAppidValueName : Common.h
  • SZAPPNAME : Service.H
  • szAppName : LeakyBin.c , INIT.c , Globals.h , halftone.c , Init.c , msgfiltr.h , Main.Cpp
  • SZAPPNAME : GLOBALS.h
  • szAppName : FontView.c , GLOBALS.h , WinCap.c , Generic.C , TextFx.c , ViewDIB.c , IconPRO.C , MousInfo.h
  • SZAPPNAME : Service.H
  • szAppName : StatList.c , Dialogs.c
  • szAppTitle : FontView.c
  • szBuf : Admapit.c , Utils.Cpp
  • szBuff : BPSampTest.c
  • szCandClass : FullIME.h , Global.C
  • szCertReq : RequestCert.Cpp
  • szChildClassName : IconPRO.C
  • szClass : CDTest.c
  • SZCLASSCLIENT : Framer.h
  • SZCLASSFRAME : Framer.h
  • szClassName : MousInfo.h
  • szCloseQuery : OleImp.Cpp , OleApt.Cpp
  • szCLSIDDescription : DllMain.Cpp
  • szClsidKeyName : Common.h
  • szCmd : DbgCmd.c
  • szCmdLine : Utils.Cpp , FTPJr.cpp
  • szCodepageExport : msiloc.cpp
  • szCodepageFile : msiloc.cpp
  • szColNames : ComSpyproppage.Cpp
  • szCommaTab : msiloc.cpp
  • szCommCtrlHdrFile : msiloc.cpp
  • szCommdlgHelp : ComDlg32.C
  • szCompReadStr : Data.c , IMEApps.h
  • szCompStr : Data.c , IMEApps.h
  • szConnectNetwork : Init.c , Globals.h
  • szConnectNode : Globals.h , Init.c
  • szConnectSocket : Globals.h , Init.c
  • szCRLF : msiloc.cpp
  • szCurlyBeg : msiloc.cpp
  • szCurlyEnd : msiloc.cpp
  • szCustFilterString : Open.h
  • szCustFiltInits : Open.h
  • szDebugEnvVar : setup.h
  • szDefaultInstallUpdCommandLine : setup.h
  • szDefaultMinPatchCommandLine : setup.h
  • szDefaultOperation : setup.h
  • szDefExt : Open.h
  • szDelayReboot : setup.h
  • szDelayRebootQuiet : setup.h
  • SZDEPENDENCIES : Service.H
  • szDescription : secSvr.Cpp
  • SZDESCRIPTION : GLOBALS.h
  • szDeviceName : main.cpp
  • szDeviceOffset : Print.c
  • szDeviceType : main.cpp
  • szDlgTitle : Open.h
  • szDriverOffset : Print.c
  • szDtRegKey : Dt_Dll.Cpp
  • szEntryName : main.cpp
  • szErr : Service.c , Service.C
  • szExePathName : DebMain.c
  • szExpr : dballoc.h
  • szFaceName : Font.c
  • szFile : dballoc.h
  • szFileName : Open.h
  • szFileTitle : Open.h
  • szFilterInits : Open.h
  • szFilterString : Open.h
  • SzFindLastCh() : Global.h , Util.Cpp
  • szFindWhat : Find.c
  • szFontStyle : Font.c
  • szFontTemplate : Font.c
  • szForceCodepage : msiloc.cpp
  • szHelpFileName : IconPRO.C
  • szHelpPathName : DebMain.c
  • szIcon : CDTest.c
  • szIgmpMode : parser.c
  • szIgmpType : parser.c
  • szImeAlpha : Status.c
  • szImeClose : Status.c
  • szImeCode : Status.c
  • szImeEUDC : Status.c
  • szImeFull : Status.c
  • szImeHalf : Status.c
  • szImeHanja : Status.c
  • szImeKatakana : Status.c
  • szImeNative : Status.c
  • szImeNoConv : Status.c
  • szImeNull : Status.c
  • szImeOpen : Status.c
  • szImeRoman : Status.c
  • szImeSoftKbd : Status.c
  • szImeSymbol : Status.c
  • szIniPathName : DebMain.c
  • szInitialClientAreaText : ClipText.c
  • szInitialDir : Open.h
  • szInsertStmt : quiktest.c
  • szInstall : msistuff.cpp
  • szInstallOperation : setup.h
  • szInstallUpd : msistuff.cpp
  • szInstallUpdOperation : setup.h
  • szLanguage : Settings.Cpp
  • szLastMessageBody : SendMDlg.h , MainFrm.Cpp
  • szLastMessageLabel : MainFrm.Cpp , SendMDlg.h
  • szLineFeed : msiloc.cpp
  • szListenSocket : Globals.h , Init.c
  • szLogPrintf() : autotest.h
  • szLongFilter : CDTest.h
  • szMajPatch : msistuff.cpp
  • szMajPatchOperation : setup.h
  • szMenu : CDTest.c
  • szMessageBox() : autotest.h
  • szMinPatch : msistuff.cpp
  • szMinPatchOperation : setup.h
  • szmsgFILEOK : ComDlg32.C
  • szmsgSHAREVIOLATION : ComDlg32.C
  • szMsiBillboard : msiloc.cpp
  • szMsiBitmap : msiloc.cpp
  • szMsiCheckBox : msiloc.cpp
  • szMsiComboBox : msiloc.cpp
  • szMsiDirCombo : msiloc.cpp
  • szMsiDirList : msiloc.cpp
  • szMsiEdit : msiloc.cpp
  • szMsiGroupBox : msiloc.cpp
  • szMsiIcon : msiloc.cpp
  • szMsiLine : msiloc.cpp
  • szMsiList : msiloc.cpp
  • szMsiListBox : msiloc.cpp
  • szMsiMaskedEdit : msiloc.cpp
  • szMsiPathEdit : msiloc.cpp
  • szMsiProgressBar : msiloc.cpp
  • szMsiPushbutton : msiloc.cpp
  • szMsiRadioButton : msiloc.cpp
  • szMsiRadioButtonGroup : msiloc.cpp
  • szMsiScrollableText : msiloc.cpp
  • szMsiSelTree : msiloc.cpp
  • szMsiText : msiloc.cpp
  • szMsiVolSelCombo : msiloc.cpp
  • szMsiVolumeCostList : msiloc.cpp
  • szOID_CERTTYPE_EXTENSION : Policy.Cpp , Exit.Cpp
  • SZOLEUI_MSG_FILEOKSTRING : OleStd.h
  • szOutputOffset : Print.c
  • szPaintResult : Data.c , IMEApps.h
  • szPaintResultRead : IMEApps.h , Data.c
  • szParamName : quiktest.c
  • szPath : Title.c , DebMain.c
  • szPathSep : setup.h
  • szPhonebook : main.cpp
  • szPointerFilter : CDTest.h
  • szPrintDlg : Print.c
  • szPrintTempName : Print.c
  • szProgLog : adoisapi.cpp
  • szProto : parser.c
  • szProxy : FTPJr.cpp
  • szQuotes : msiloc.cpp
  • SZRAPPNAME : Globals.h , GLOBALS.h
  • SZRCOMPANYNAME : GLOBALS.h , Globals.h
  • SZRCOPYRIGHT : GLOBALS.h , Globals.h
  • szRcvBuf : Globals.h
  • SZRDESCRIPTION : Globals.h , GLOBALS.h
  • szReplaceWith : Find.c
  • szResultReadStr : Data.c , IMEApps.h
  • szResultStr : IMEApps.h , Data.c
  • SZRPRODNAME : GLOBALS.h , Globals.h
  • SZRPRODVER : Globals.h , GLOBALS.h
  • SZRTRADEMARK : Globals.h , GLOBALS.h
  • SZRVERSION : Globals.h , GLOBALS.h
  • szSdkDiff : findgoto.cpp , sdkdiff.h , sdkdiff.cpp
  • szServer : FTPJr.cpp
  • SZSERVICEDISPLAYNAME : Service.H
  • szServiceName : secSvr.Cpp
  • SZSERVICENAME : Service.H
  • szSetupTempName : Print.c
  • szShortFilter : CDTest.h
  • szSndBuf : Globals.h
  • szSQL : CreateTable.cpp
  • szSteCandTitle : FullIME.h , Global.C
  • szSteCandUIClass : FullIME.h , Global.C
  • szSteClass : Global.C , FullIME.h , Main.C
  • szSteCompTitle : FullIME.h , Global.C
  • szSteTitle : FullIME.h , Global.C , Main.C
  • szTab : msiloc.cpp
  • szTemp : CDTest.h
  • SZTEMP_SIZE : HeadDump.cpp
  • szTemplate : Find.c
  • szTemplateNameC : Colors.c
  • szTempName : Open.h
  • SZTERMNAME : plgterm.h
  • szText : RendSam.Cpp
  • szTitle : Generic.C , GLOBALS.h , CDTest.c , EventSink.cpp , Globals.h , halftone.c , ViewDIB.c , INIT.c , Init.c , TextFx.c , IconPRO.C , Title.c , StatList.c , LeakyBin.c
  • szTitlebuf : Mypal.c
  • szTitleClient : ComPerf.Cpp , OleApt.Cpp
  • szTitleServer : OleImp.Cpp , ComPerf.Cpp , OleApt.Cpp
  • SzToGuid() : Global.h , Util.Cpp
  • szTokenSeps : msiloc.cpp
  • szUniChar : Settings.Cpp
  • szUrlPathSep : setup.h
  • szUserAccountServer : Admapit.c
  • SZVERSION : GLOBALS.h
  • szWindowClass : OleImp.Cpp , OleApt.Cpp , EventSink.cpp
  • szWndwHdrFile : msiloc.cpp
  • szWrite() : quiktest.c
  • szwTempBuffer : RequestCert.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- t -

  • T2A() : StrConv.h
  • T2CA() : StrConv.h
  • T2CW : StrConv.h
  • T2W : globals.h , StrConv.h
  • T_CCF_ATTRIB_PTR : globals.h
  • T_CCF_BASENODE_PTR : globals.h
  • T_CCF_DATAOBJ_PTR : globals.h
  • T_CCF_DISPLAY_NAME : globals.h
  • T_CCF_MMC_MULTISELECT_DATAOBJECT : globals.h
  • T_CCF_MULTI_SELECT_SNAPINS : globals.h
  • T_CCF_MULTISELECT_COOKIES : globals.h
  • T_CCF_NODEPROP_PTR : globals.h
  • T_CCF_NODETYPE : globals.h
  • T_CCF_NODETYPE_FLG : globals.h
  • T_CCF_OBJECT_TYPES_IN_MULTI_SELECT : globals.h
  • T_CCF_SNAPIN_CLASSID : globals.h
  • T_CCF_SZNODETYPE : globals.h
  • TABID_PRINTER : sdkdiff.cpp
  • table_msgcode : sdkdiff.cpp
  • TableClassName : table.h
  • TableMessage : table.h
  • TableServer() : sdkdiff.cpp
  • TABSTOP : HalfIME.h , FullIME.h
  • TABWIDTH_DEFAULT : table.h
  • TAG_BUFFER_SIZE : HtmlScan.Hxx
  • tagAppletCapabilityType : iapplet.h
  • tagAppletCapIDType : iapplet.h
  • tagAppletChannelCommand : iapplet.h
  • tagAppletChannelType : iapplet.h
  • tagAppletErrorCode : iapplet.h
  • tagAppletKeyType : iapplet.h
  • tagAppletModificationRights : iapplet.h
  • tagAppletPriority : iapplet.h
  • tagAppletReason : iapplet.h
  • tagAppletRegistryCommand : iapplet.h
  • tagAppletRegistryItemType : iapplet.h
  • tagAppletResourceAllocCommand : iapplet.h
  • tagAppletTokenCommand : iapplet.h
  • tagAppletTokenStatus : iapplet.h
  • tagCALL_STATE : nullmdm.h
  • tagPLUGXPRT_CALL_TYPE : iplgxprt.idl
  • tagPLUGXPRT_FRAMING : iplgxprt.idl
  • tagPLUGXPRT_PSTN_CALL_CONTROL : iplgxprt.idl
  • tagRECOVERY_STATE : RmWorker.Idl
  • tagRECOVERYRC : RmWorker.Idl
  • tagRMSTATUS : RmWorker.Idl
  • tagSCROLLDIR : idt.h
  • tagTPhysicalError : nullmdm.h
  • tagVERSION : Globals.h
  • TAIL_OFFSET : spy.cpp
  • TAIL_SIGNITURE : spy.cpp
  • TAILSIGN : spy.cpp
  • TAILSIZE : spy.cpp
  • TakeOwnershipIfAppropriate() : SidClean.c
  • TakeTwoSections() : section.cpp
  • TallMenu_WndProc() : tallmenu.c
  • TAPI_CURRENT_VERSION : Atsp.c , Dialer.h
  • TAPI_TIMEOUT : FileTerm.h
  • TAPI_VERSION_1_0 : Dialer.h
  • TAPI_VERSION_1_4 : Dialer.h
  • TAPI_VERSION_2_0 : Dialer.h
  • tapiCallback() : Dialer.c
  • TargetDown() : ComSpyAudit.Idl
  • TargetUp() : ComSpyAudit.Idl
  • TaskExtension : extend.h
  • TB_CLASS_NAME : ToolBand.h
  • TB_MAX_SIZE_Y : ToolBand.h
  • TB_MIN_SIZE_X : ToolBand.h
  • TB_MIN_SIZE_Y : ToolBand.h
  • TB_SPACE : ToolBar.h
  • tbButton : ToolBar.c
  • TC_BUTTON : Tools.c
  • TC_COMBO : Tools.c
  • TC_LABEL : Tools.c
  • TC_SPACE : Tools.c
  • TCHAR : APP.h
  • TCHAR2BSTR() : StdAfx.h
  • TCHAR_LEN_IN_BYTES : CmdLineConsumer.Cpp , PermEvents.Cpp
  • TCP_HDR : iphdr.h
  • TellAll() : Server32.c , Server32.h
  • TEMP_BUF : people.Cpp
  • TEMP_BUFFER_SIZE : HtmlElem.Hxx
  • TempIpAddress : AdminDll.c
  • TEMPLATE_CMD : Qoslist.Cpp
  • TEMPNAMESIZE : Open.h
  • TEMPOMAPENTRY : SMFI.h
  • TermApp() : sendto.c
  • TerminateApp() : Main.Cpp
  • TerminateAuthorizationHeader() : HttpAuth.c , HttpAuth.h
  • TerminateCache() : AuthFilt.h , cache.c
  • TerminateExtension() : adoisapi.cpp , ctetest.c , DumpVars.cpp , formdump.cpp , InvokObjThreads.cpp , areadcli.c , ftrans.c , fwasync.c , readcli.c , fwrite.c , KeepAlive.c , KeepAliveP.c , Redirect.cpp , Simple.cpp , WorkerThread.c , Extension.cpp
  • TerminateExtensionWrapper() : PoolWrap.cpp
  • TerminateInstance() : MidiPlyr.c
  • TerminateUserDatabase() : AuthFilt.h , db.c
  • TermPackage() : Security.cpp , Security.h
  • TermSession() : Security.cpp , Security.h
  • TermWinsock() : Comm.cpp , Comm.h
  • TEST : common.h , sampprov.h , common.h
  • Test() : CpyImage.Idl , Client.c
  • Test1() : psperf.Idl
  • Test23() : psperf.Idl
  • TEST_ABORTED : autotest.h
  • TEST_CONNECT_OPTION : quiktest.h
  • TEST_INFO : PrPerf.c
  • TEST_STMT_OPTION : quiktest.h
  • TestAppDlgProc() : App32.C
  • TestBindParam() : quiktest.c
  • TESTC : common.h , sampprov.h , common.h
  • TESTC_ : common.h
  • TestCases : custom.c
  • TestConnectAttr() : quiktest.c
  • TestConnectionOptions() : quiktest.c
  • TestCopyDesc() : quiktest.c
  • TestCursorName() : quiktest.c
  • TestData() : quiktest.c
  • TestDescDefaults() : quiktest.c
  • TestDiagField() : quiktest.c
  • TestDiagRec() : quiktest.c
  • TestDll() : Client.c
  • TestEndTran() : quiktest.c
  • TestEnvAttr() : quiktest.c
  • TestExtendedFetch() : quiktest.c
  • TestFetchScroll() : quiktest.c
  • TestGetDescField() : quiktest.c
  • TestGetDescRec() : quiktest.c
  • TestLargeQuery() : quiktest.c
  • TestLikeQuery() : quiktest.c
  • TestMetaData() : quiktest.c
  • TestMixedAnsiUnicode() : quiktest.c
  • TestNotify() : ComDlg32.C , ComDlg32.h
  • TestNumResCols() : quiktest.c
  • TestOJCap() : quiktest.c
  • TestProtocol() : ipsample.h , test.c
  • TestQuery() : QueryParser.cpp
  • TestQuickRebind() : quiktest.c
  • TestSearchedQuery() : quiktest.c
  • TestSetDescField() : quiktest.c
  • TestSetDescRec() : quiktest.c
  • TestSQLBrowseConnect() : quiktest.c
  • TestSQLColumnPrivileges() : quiktest.c
  • TestSQLDataSources() : quiktest.c
  • TestSQLDescribeParam() : quiktest.c
  • TestSQLDrivers() : quiktest.c
  • TestSQLForeignKeys() : quiktest.c
  • TestSQLMoreResults() : quiktest.c
  • TestSQLNativeSQL() : quiktest.c
  • TestSQLNumParams() : quiktest.c
  • TestSQLParamOptions() : quiktest.c
  • TestSQLPrimaryKeys() : quiktest.c
  • TestSQLProcedureColumns() : quiktest.c
  • TestSQLProcedures() : quiktest.c
  • TestSQLSetConnectAttr() : quiktest.c
  • TestSQLSetScrollOptions() : quiktest.c
  • TestSQLSetStmtAttr() : quiktest.c
  • TestSQLSpecialCols() : quiktest.c
  • TestSQLStatistics() : quiktest.c
  • TestSQLTablePrivileges() : quiktest.c
  • TestSQLTables() : quiktest.c
  • TestStmtOptions() : quiktest.c
  • TestThreading() : quiktest.c
  • TestUseDesc() : quiktest.c
  • TEXT : APP.h
  • TEXT1 : SysInf_S.c
  • TEXT_FILTER_CHUNK_SIZE : SmpFilt.Hxx
  • TEXT_LEN : Dt.h
  • TEXT_WINDOW_CLASS_MENU_STR : RESDEF.h
  • TEXT_WINDOW_CLASS_NAME_STR : RESDEF.h
  • TEXT_WINDOW_NAME_STR : RESDEF.h
  • textbuf : FullIME.h , Global.C , Main.C
  • TEXTBUTTON : ToolBar.h
  • TextButtonBar() : ToolBar.c , ToolBar.h
  • TextButtonBarProc() : ToolBar.c
  • TextDelete() : Global.h , Text.Cpp
  • TextDlgProc() : global.h , textapi.c
  • TextEffect() : Fx.c , Fx.h
  • TextInsert() : Global.h , Text.Cpp
  • TextToken : HtmlScan.Hxx
  • TextWndProc() : MfEdit.c , MfEdit.h , Global.h , TextWnd.Cpp
  • tfprintf() : dump.cpp , sampclnt.h
  • theApp : VCExplore.Cpp , Client.Cpp , Client.h , advcgen.cpp , cwinapp.cpp , multichan.cpp , SCPCMenu.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , ADQI.cpp , PrintSdi.Cpp , DisDraw.Cpp , Imp_Draw.Cpp , MqApiTst.Cpp , mqfdraw.cpp , RTCIncoming.cpp , RTCOutgoing.cpp , genericucp.cpp , isapiCertPolicy.cpp , AdvClient.cpp , CmdLineConsumer.Cpp , PermEvents.Cpp , WbemClient.Cpp , CapMFC.Cpp , XMLTree.cpp , ClipBook ServerEx.cpp , File Share SampleEx.cpp , API.Cpp
  • theFilter : isapiCertPolicy.cpp
  • theLocalServer : DialIn.c
  • THIS_POINTER_OFFSET : tsfedit.cpp , tsfwnd.cpp
  • ThisDLLHandle : DllInit.c
  • Thread : comspyctl.idl
  • Threader() : AsyncDemo.cpp
  • ThreadExecutionFunction() : Main.cpp
  • THREADINFO : IocpClient.Cpp
  • ThreadLoop() : quiktest.c
  • ThreadOrderFunction() : DebDebug.c
  • THREADPARAM : threads.c
  • ThreadProc() : Cancel.Cpp
  • ThreadProcRequest() : filerepclientproc.cpp
  • Throughput : PrPerf.c
  • THROW_ERR : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h
  • THROW_STR : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h
  • ThrowHR() : util.h
  • THUMB : suminfo.h
  • THUMBNAIL : suminfo.h
  • TICKS : SMF.h
  • TICKSPACE : PlgBlt.c , WxForm.h
  • TID : AppUtil.h
  • TIM : wn_dos.h
  • TIME : suminfo.h
  • Time : Client.C
  • TIME_INTERVAL : LeakyBin.h
  • TIME_OUT : Server32.h
  • TimeMap : Methodsub.h
  • TIMEOUT : SnmpUtil.C , onaddequipment.cpp , onenumdisks.cpp , onenumsvcs.cpp
  • TIMEOUT_ANIMATED_ICON : DebMain.c
  • TIMER_ID : TIMEWND.c , CallNot.h , dxsurf2.cpp
  • TIMER_INTERVAL : TIMEWND.c
  • TIMER_TIMEOUT : STATBAR.h
  • TimerProc() : Main.Cpp , DebMain.c
  • TimeStack : Methodsub.h
  • TipURL() : BYOTTransaction.Idl
  • TITLE : dxsurf1.cpp , dxsurf2.cpp
  • TITLE_SIZE : Utility.h
  • TitleProc() : Title.c , Title.h
  • TitleToken : HtmlScan.Hxx
  • TlsIndex : AsyncIO.h
  • TM_APPEND : table.h
  • TM_CELL : table.h
  • TM_CURRENTVIEW : sdkdiff.h
  • TM_ENDROW : table.h
  • TM_FOCUS : table.h
  • TM_GETSELECTION : table.h
  • TM_MANY : table.h
  • TM_NEWID : table.h
  • TM_NEWLAYOUT : table.h
  • TM_PRINT : table.h
  • TM_REFRESH : table.h
  • TM_ROW : table.h
  • TM_SELECT : table.h
  • TM_SERVER_PROCESS : MainFrm.h
  • TM_SERVERDLG : MainFrm.h
  • TM_SETTABWIDTH : table.h
  • TM_SINGLE : table.h
  • TM_SOLID : table.h
  • TM_TOPROW : table.h
  • tmain : ProcList.c
  • TMALL : Track.h
  • TMD_ASCENT : FontView.h
  • TMD_AVEWIDTH : FontView.h
  • TMD_BASE : FontView.h
  • TMD_BREAKCHAR : FontView.h
  • TMD_CHARSET : FontView.h
  • TMD_DEFAULTCHAR : FontView.h
  • TMD_DESCENT : FontView.h
  • TMD_DIGITIZEDASPECTX : FontView.h
  • TMD_DIGITIZEDASPECTY : FontView.h
  • TMD_EXTERNAL : FontView.h
  • TMD_FIRSTCHAR : FontView.h
  • TMD_HEIGHT : FontView.h
  • TMD_INTERNAL : FontView.h
  • TMD_ITALIC : FontView.h
  • TMD_LASTCHAR : FontView.h
  • TMD_MAXWIDTH : FontView.h
  • TMD_OVERHANG : FontView.h
  • TMD_PITCHANDFAMILY : FontView.h
  • TMD_SET : FontView.h
  • TMD_STRUCKOUT : FontView.h
  • TMD_UNDERLINE : FontView.h
  • TMD_WEIGHT : FontView.h
  • TMDown() : RmWorker.Idl , CopyFileRm.Idl
  • TMMOVE : Track.h , WxForm.h
  • TMNONE : Track.h , WxForm.h
  • TMROTATE : Track.h , WxForm.h
  • TMSHEARX : Track.h , WxForm.h
  • TMSHEARY : Track.h , WxForm.h
  • TMSIZEX : Track.h , WxForm.h
  • TMSIZEXY : Track.h , WxForm.h
  • TMSIZEY : Track.h , WxForm.h
  • tmStatusFont : Status.c
  • tmToolFont : Tools.c
  • ToExpand() : sdkdiff.cpp
  • ToggleCase() : globals.cpp , globals.h
  • ToggleChar() : globals.cpp
  • tokCaption : msiloc.cpp
  • TOKEN : malspy.c
  • TOKEN_ADD : nshsamp.h
  • TOKEN_ALL : nshsamp.h
  • TOKEN_DISABLED : nshsamp.h
  • TOKEN_ENABLED : nshsamp.h
  • TOKEN_GATEWAY : nshsamp.h
  • TOKEN_HIGH : nshsamp.h
  • TOKEN_IA64 : nshsamp.h
  • TOKEN_ID : nshsamp.h
  • TOKEN_INTERFACE : nshsamp.h
  • TOKEN_LOW : nshsamp.h
  • TOKEN_MEDIUM : nshsamp.h
  • TOKEN_POTENTIAL : nshsamp.h
  • TOKEN_RESET : nshsamp.h
  • TOKEN_SAMPLE : nshsamp.h
  • TOKEN_SAMPLEINTERFACE : nshsamp.h
  • TOKEN_SET : nshsamp.h
  • TOKEN_SHOW : nshsamp.h
  • TOKEN_SHOWERROR : nshsamp.h
  • TOKEN_SOURCE_NAME : HttpAuth.c , Security.cpp
  • TOKEN_SPROCKETS : nshsamp.h
  • TOKEN_SUBCONTEXT : nshsamp.h
  • TOKEN_SUPERMETRIC : nshsamp.h
  • TOKEN_UNKNOWN : nshsamp.h
  • TOKEN_USERDATA : nshsamp.h
  • TOKEN_WIDGETS : nshsamp.h
  • TOKEN_X86 : nshsamp.h
  • ToMoved() : sdkdiff.cpp
  • TOOLBAR_ID : Resource.h
  • ToolBarExtension : extend.h
  • ToolBarHeight() : Tools.c , FontView.c
  • TOOLBUTTON_STD120HEIGHT : BttnCur.h
  • TOOLBUTTON_STD120IMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STD120IMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STD120WIDTH : BttnCur.h
  • TOOLBUTTON_STD72HEIGHT : BttnCur.h
  • TOOLBUTTON_STD72IMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STD72IMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STD72WIDTH : BttnCur.h
  • TOOLBUTTON_STD96HEIGHT : BttnCur.h
  • TOOLBUTTON_STD96IMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STD96IMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STD96WIDTH : BttnCur.h
  • TOOLBUTTON_STDHEIGHT : BttnCur.h
  • TOOLBUTTON_STDIMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STDIMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STDWIDTH : BttnCur.h
  • toolCtrl : Tools.c
  • TOOLDISPLAYDATA : BttnCur.h
  • TOOLIMAGE_EDITCOPY : BttnCur.h
  • TOOLIMAGE_EDITCUT : BttnCur.h
  • TOOLIMAGE_EDITPASTE : BttnCur.h
  • TOOLIMAGE_FILENEW : BttnCur.h
  • TOOLIMAGE_FILEOPEN : BttnCur.h
  • TOOLIMAGE_FILEPRINT : BttnCur.h
  • TOOLIMAGE_FILESAVE : BttnCur.h
  • TOOLIMAGE_HELP : BttnCur.h
  • TOOLIMAGE_HELPCONTEXT : BttnCur.h
  • TOOLIMAGE_MAX : BttnCur.h
  • TOOLIMAGE_MIN : BttnCur.h
  • Tools : Tools.c
  • ToolsProc() : Tools.c
  • ToOutline() : sdkdiff.cpp
  • TOP : Rebar.c
  • Top : resource.h
  • TOP_BORDER : DebMain.c
  • TopLeft() : status.cpp
  • TOTAL_EVENTS : Sender.Cpp
  • TPG_SUBPATH : RecoDll.cpp
  • TPHYS_CONNECT_INFO : nullmdm.h
  • TPHYS_CONNECT_RESPONSE_FAILED : nullmdm.h
  • TPHYS_RESULT_COMM_PORT_BUSY : nullmdm.h
  • TPHYS_RESULT_CONNECT_FAILED : nullmdm.h
  • TPHYS_RESULT_CONNECT_REJECTED : nullmdm.h
  • TPHYS_RESULT_FAIL : nullmdm.h
  • TPHYS_RESULT_INUSE : nullmdm.h
  • TPHYS_RESULT_INVALID_ADDRESS : nullmdm.h
  • TPHYS_RESULT_INVALID_CONNECTION : nullmdm.h
  • TPHYS_RESULT_NOT_INITIALIZED : nullmdm.h
  • TPHYS_RESULT_NOT_LISTENING : nullmdm.h
  • TPHYS_RESULT_SUCCESS_ALTERNATE : nullmdm.h
  • TPHYS_RESULT_WAITING_FOR_CONNECTION : nullmdm.h
  • TPHYS_SUCCESS : nullmdm.h
  • TPhysicalError : nullmdm.h
  • TQ_CLOSE : table.h
  • TQ_ENTER : table.h
  • TQ_GETCOLPROPS : table.h
  • TQ_GETDATA : table.h
  • TQ_GETSIZE : table.h
  • TQ_PUTDATA : table.h
  • TQ_SCROLL : table.h
  • TQ_SELECT : table.h
  • TQ_SHOWWHITESPACE : table.h
  • TQ_TABS : table.h
  • TRACE : common.h , asserts.h , winmain.h , Debug.h , DynOuts.c
  • TRACE0 : defs.h
  • TRACE1 : defs.h
  • TRACE2 : defs.h
  • TRACE3 : defs.h
  • TRACE4 : defs.h
  • TRACE5 : defs.h
  • TRACE_ADDREF : ctrace.h
  • Trace_Close() : gutils.h , utils.cpp
  • TRACE_ERROR : list.cpp
  • Trace_Error() : gutils.h , utils.cpp
  • TRACE_ERROR : sdkdiff.h
  • Trace_Event() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • TRACE_EVENT : tracemacro.h
  • Trace_Event() : tracemacro.h
  • TRACE_EVENT : tracemacro.h
  • Trace_Event() : tracemacro.h
  • Trace_File() : gutils.h , utils.cpp
  • Trace_HR() : tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • TRACE_HRESULT : tracemacro.h
  • TRACE_METHOD : ctrace.h
  • TRACE_MSG : Global.h
  • TRACE_NOTIFICATION : ctrace.h
  • Trace_Pointer() : tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp
  • TRACE_PTR : tracemacro.h
  • TRACE_QI : ctrace.h
  • TRACE_RELEASE : ctrace.h
  • TRACE_RELEASE_ : ctrace.h
  • Trace_Start() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • TRACE_START : tracemacro.h
  • Trace_Start() : tracemacro.h
  • TRACE_START : tracemacro.h
  • Trace_Start() : tracemacro.h
  • TRACE_START : tracemacro.h
  • Trace_Status() : sdkdiff.cpp
  • Trace_Unattended() : utils.cpp , gutils.h
  • TRACE_VAL : tracemacro.h
  • Trace_Value() : tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp
  • TRACEFMT : common.h
  • TraceGuidReg : TraceDp.c
  • TRACEID : defs.h
  • TraceMsg() : Debug.Cpp
  • TRACEMSG : Global.h
  • TraceMsg() : Global.h
  • TraceOnFlag : TraceDp.c
  • TRACK : SMFI.h
  • TRACK_CELL : tpriv.h
  • TRACK_COLUMN : tpriv.h
  • TRACK_NONE : tpriv.h
  • TrackDifferent : sdkdiff.cpp , sdkdiff.h
  • TrackLeftOnly : sdkdiff.cpp , sdkdiff.h
  • TrackObject : Track.h , WxForm.h
  • TrackReadonly : sdkdiff.cpp , sdkdiff.h
  • TrackRightOnly : sdkdiff.cpp , sdkdiff.h
  • TrackSame : sdkdiff.h , sdkdiff.cpp
  • Transaction : comspyctl.idl
  • TransactionGuid : TraceDp.c
  • TransactionState() : CrmMonComp.Idl
  • TRANSFER : resource.h
  • TransferAndDeleteBuffers() : AsyncDemo.cpp
  • transferClip : suminfo.h
  • TRANSFERCOMPLETE_DIDEVENT : myospobject.h
  • TRANSFERCOMPLETE_FAILEDTODO : myospobject.h
  • TransferWiaItem() : wiassamp.cpp
  • TransformDlgProc() : WxForm.h , WxForm.c
  • TransformVertices() : Paint.h , Paint.c
  • TRANSIENTPUBPROP : Adminwrap.h
  • TRANSIENTSUB : Adminwrap.h
  • Translate() : HtmlProp.Cxx
  • TranslateAccelerator() : ioipao.h , ioipf.h
  • TRANSLATED_CHAR_BUFFER_LENGTH : InpStrm.Hxx
  • TranslateDeviceCaps() : Getcaps.h , Getcaps.c
  • TRANSMITFILEARGS : provider.h
  • TRANSMITPACKETSARGS : provider.h
  • TRAP : WSnmpUtil.h , SnmpUtil.C
  • TrapMMError() : wave.h , wave.cpp
  • TrayMessage() : SetDisp.c , App32.C , SetDisp.h
  • TRC : SetDisp.c
  • TREE : tree.h
  • tree_addafter() : tree.cpp , tree.h
  • Tree_CompareProc() : tree.cpp
  • Tree_Create() : tree.h , tree.cpp
  • tree_create() : tree.cpp , tree.h
  • tree_delete() : tree.h , tree.cpp
  • tree_delitem() : tree.cpp
  • Tree_DoContextMenu() : tree.cpp , tree.h
  • Tree_DoItemMenu() : tree.cpp
  • Tree_EnumObjects() : tree.cpp
  • tree_find() : tree.h , tree.cpp
  • Tree_GetChildItems() : tree.cpp
  • tree_getitem() : tree.cpp
  • Tree_GetRootItems() : tree.cpp
  • Tree_Init() : tree.h , tree.cpp
  • tree_newitem() : tree.cpp
  • Tree_Notify() : tree.cpp , tree.h
  • tree_search() : tree.cpp , tree.h
  • tree_update() : tree.h , tree.cpp
  • TREEITEM : tree.h
  • TREEKEY : tree.h
  • tReqState : filerepclientproc.cpp , FileRepClientProc.cpp
  • TRIANGLE_WAVE : GenCtrnm.h
  • TriggerUpdateThreadRefresh() : threads.h , threads.c
  • Trim() : main.cpp
  • TrimCommentAndTrailingWhitespace() : Redir401.cpp , ReMapUrl.cpp
  • TrimVirtualBuffer() : AsyncIO.h , AsyncIO.c
  • TROB_CENTER : WxForm.h
  • TROB_DELETE : WxForm.h , Track.h
  • TROB_HITTEST : WxForm.h , Track.h
  • TROB_NEW : WxForm.h , Track.h
  • TROB_PAINT : WxForm.h , Track.h
  • TROB_SETXFORM : WxForm.h
  • TRUE : LinkList.h
  • true : dbh.cpp
  • TRYDB : adoheader.h
  • TSDLL : SysInf_C.c
  • tServerThread : filerepclientproc.cpp
  • TSMEMORYINFO : SysInfo.h
  • TSPI_lineClose() : Atsp.c
  • TSPI_lineCloseCall() : Atsp.c
  • TSPI_lineCloseMSPInstance() : Atsp.c
  • TSPI_lineConditionalMediaDetection() : Atsp.c
  • TSPI_lineCreateMSPInstance() : Atsp.c
  • TSPI_lineDrop() : Atsp.c
  • TSPI_lineGetAddressCaps() : Atsp.c
  • TSPI_lineGetAddressStatus() : Atsp.c
  • TSPI_lineGetCallAddressID() : Atsp.c
  • TSPI_lineGetCallInfo() : Atsp.c
  • TSPI_lineGetCallStatus() : Atsp.c
  • TSPI_lineGetDevCaps() : Atsp.c
  • TSPI_lineGetID() : Atsp.c
  • TSPI_lineGetLineDevStatus() : Atsp.c
  • TSPI_lineGetNumAddressIDs() : Atsp.c
  • TSPI_lineMakeCall() : Atsp.c
  • TSPI_lineMSPIdentify() : Atsp.c
  • TSPI_lineNegotiateTSPIVersion() : Atsp.c
  • TSPI_lineOpen() : Atsp.c
  • TSPI_lineReceiveMSPData() : Atsp.c
  • TSPI_lineSetDefaultMediaDetection() : Atsp.c
  • TSPI_providerConfig() : Atsp.c
  • TSPI_providerEnumDevices() : Atsp.c
  • TSPI_providerGenericDialogData() : Atsp.c
  • TSPI_providerInit() : Atsp.c
  • TSPI_providerInstall() : Atsp.c
  • TSPI_providerRemove() : Atsp.c
  • TSPI_providerShutdown() : Atsp.c
  • TSPI_providerUIIdentify() : Atsp.c
  • tSReqState : FileRepServerProc.cpp
  • tsval : quiktest.c
  • TSVERSIONINFO : SysInfo.h
  • TUISPI_lineConfigDialog() : Atsp.c
  • TUISPI_providerConfig() : Atsp.c
  • TUISPI_providerInstall() : Atsp.c
  • TUISPI_providerRemove() : Atsp.c
  • TUTORIAL_EXE_STR : AppUtil.h
  • TV_FindItem() : cdialoglite.cpp , cdialoglite.h
  • TV_GetItemParam() : cdialoglite.cpp , cdialoglite.h
  • TV_GetItemText() : cdialoglite.h , cdialoglite.cpp
  • TV_InsertItem() : winmain.h , cdialoglite.cpp , cdialoglite.h , winmain.cpp
  • TV_SetItemState() : cdialoglite.h , cdialoglite.cpp
  • tvfprintf() : sampclnt.h , dump.cpp
  • TWnd_OnCommand() : TIMEWND.c
  • TWnd_OnCreate() : TIMEWND.c
  • TWnd_OnDestroy() : TIMEWND.c
  • TWnd_OnPaint() : TIMEWND.c
  • TWnd_OnSize() : TIMEWND.c
  • TWnd_OnTimer() : TIMEWND.c
  • TWnd_WndProc() : TIMEWND.c , MidiPlyr.h
  • TX_ABORTED : RmWorker.Idl
  • TX_ABORTING : RmWorker.Idl
  • TX_COMMITTED : RmWorker.Idl
  • TX_COMMITTING : RmWorker.Idl
  • TX_DONE : RmWorker.Idl
  • TX_ENLISTED : RmWorker.Idl
  • TX_ENLISTING : RmWorker.Idl
  • TX_INITIALIZED : RmWorker.Idl
  • TX_INITIALIZING : RmWorker.Idl
  • TX_INVALID_STATE : RmWorker.Idl
  • TX_PREPARED : RmWorker.Idl
  • TX_PREPARING : RmWorker.Idl
  • TX_TMDOWN : RmWorker.Idl
  • TX_UNINITIALIZED : RmWorker.Idl
  • TXSTATE : RmWorker.Idl
  • TXT_FILE_EXT : AppUtil.h
  • type() : FTPJr.cpp
  • TYPE_FORMAT_STRING_SIZE : EdCommands_p.c , BrochureMachine_p.c , ADsError_p.c , EdGlyphs_p.c , EdHost_p.c , EDAnnotator_p.c , ADsFirstExt_p.c , Render_p.c
  • TYPE_PORTION : quiktest.h
  • TYPEMAP : common.cpp
  • TypeSafeParams : ClRes.h , StdAfx.h
  • TypeSafeQI : ClRes.h , StdAfx.h
  • TypeToString() : Utils.Cpp , UtilLib.h , Utils.Cpp , UtilLib.h
  • TYPID_HtmlPropIFilter : HtmlProp.Cxx
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- u -

  • UC : tracedmp.h
  • ucase() : dbh.cpp
  • uchar : suminfo.Cpp
  • UCHAR : APP.h
  • UClassFromDescription() : Utility.c , Utility.h
  • UcToAnsi() : AppUtil.h , AppUtil.Cpp
  • UDescriptionFromClass() : Utility.c , Utility.h
  • UDP : Bcast.c
  • UDP_HDR : iphdr.h
  • uDriverODBCVer : quiktest.c
  • udw : quiktest.h
  • UDWORD : sampprov.h
  • UiAddMember() : precomp.h , ui.cpp
  • UiClearText() : ui.cpp
  • UICursorLoad() : BttnCur.h
  • UIDeactivate() : ioipo.h
  • uiDesc : custom.c
  • UiDisplayMessage() : ui.cpp
  • UiDisplayMsg() : precomp.h , ui.cpp
  • UiDisplaySysMsg() : precomp.h , ui.cpp
  • UiGetSelectedMember() : ui.cpp
  • uiName : custom.c
  • UINT : OleStd.h
  • UiRemoveMember() : precomp.h , ui.cpp
  • UiSendText() : ui.cpp
  • UiSizeMsgWindow() : ui.cpp
  • UIToolButtonDraw() : BttnCur.h
  • UIToolButtonDrawTDD() : BttnCur.h
  • UIToolConfigureForDisplay() : BttnCur.h
  • uLine : dballoc.h
  • ulInfoBufferSize : PerfUtil.c
  • ULONG : sampprov.h
  • ulong : suminfo.Cpp
  • ulSize : OleStd.h
  • UM_CREATE_LISTBOX : Deb.h
  • uMode : CDTest.c , Colors.c , Find.c , Font.c , Open.c , Print.c , Title.c
  • UMSG_DECREMENTDLGCOUNT : CDTest.h
  • uMsgBrowse : ole2ui.c
  • uMsgChangeIcon : ole2ui.c
  • uMsgCloseBusyDlg : ole2ui.c
  • uMsgEndDialog : ole2ui.c
  • uMsgFileOKString : ole2ui.c
  • uMsgHelp : ole2ui.c
  • Unadvise() : ioo.h
  • UnadviseSingleSink() : globals.cpp , globals.h
  • UnadviseSink() : globals.cpp , globals.h
  • UNDERSCORE : common.h
  • UndrawDragFeedback() : idt.h
  • UNHANDLED_MSG : common.h , winmain.h
  • UnHookChannel() : cShare.Cpp , cShare.h , CChan.Cpp , CChan.h
  • UNI2STR : DComPerm.h
  • UNICODE : secClnt.Cpp , secSvr.Cpp , oledbcomponent.h , propdump.cpp , stgcreatepropsetstg.cpp , writeread.cpp , main.cpp , CreateUserHelpers.cpp , main.cpp , UserProps.cpp , StdAfx.h , ADSIhelpers.cpp , main.cpp , ADSIhelpers.cpp , main.cpp , main.hxx , MqTrans.Cpp , nshsamp.cpp , nshsamp.h , customdial.cpp , customdialreg.cpp , loadprotocol.c , StdAfx.h , Outgoing.Cpp , SubAuth.c , KList.c , MyToken.cpp , SecPrint.c , Main.Cpp , Privobji.Cpp , Security.Cpp , SuperUsr.cpp , RSAKey.cpp , SignHash.cpp , LogonNP.c , Create.Cpp , Process.cpp , Remove.cpp , SamplCli.Cpp , BasicHiPerf.Cpp , BasicHiPerf.h , Factory.Cpp , AsyncDemo.cpp , ClRes.h , DispTree.Cxx , HtmlProp.Cxx , DispTree.Cxx , QSample.Cxx , DLEdit.Cpp , app.cpp
  • UniCode2Ansi() : debug.c , debug.h
  • Unicode2Ansi() : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • UNICODE_NULL : Npaux.h
  • UNICODE_STRING : Npaux.h
  • UnicodeOk() : AptClien.Cpp , AptServe.Cpp , ComObj.Cpp , ComUser.Cpp , ConClien.Cpp , ConServe.Cpp , DcdServe.Cpp , DComDraw.Cpp , DllClien.Cpp , DllServe.Cpp , DllSkel.Cpp , DllUser.Cpp , ExeSkel.Cpp , FreClien.Cpp , FreServe.Cpp , LicClien.Cpp , LicServe.Cpp , LocClien.Cpp , LocServe.Cpp , Marshal2.Cpp , PerClien.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , RemClien.Cpp , StoClien.Cpp , StoServe.Cpp
  • UNICODEOLE32 : ansiapi.h
  • UnicodeStringToAnsiString() : MainFrm.Cpp
  • UnicodeToAnsiString() : main.hxx
  • UninitComServer() : Main.cpp
  • UNINITIALIZED : Main.Cxx
  • UninitializeMallocSpy() : malspy.c , malspy.h
  • UninitThread() : Extension.cpp , PoolWrap.h
  • Uninstall() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • UninstallUserAccounts() : Process.cpp
  • UnionCall1() : Server.c
  • UnionCall2() : Server.c
  • UnionParamProc() : DUnionp.c
  • UnionStructProc() : DUnionp.c
  • UNITSTABLE : CeLib.Cpp , celib.cpp , CeLib.Cpp , celib.cpp , CeLib.Cpp
  • UNKNOWNSIDS : Check_SD.h
  • UnloadSecurityLibrary() : WebClient.c , WebServer.c
  • Unlocked() : PAPINT.Idl
  • UnlockSocketContext() : provider.h , sockinfo.cpp
  • UnlockVolume() : Mfmt.c
  • UnlockWindowInfo() : GdiDemo.h , Wininfo.c
  • UNREACHED : dballoc.Cpp
  • UnreadableRand() : enablerouter.c
  • UNREFERENCED : UtilLib.h
  • UNREGISTER : main.cpp
  • UnRegisterADsExt() : ADsFirstExt.cpp
  • UnRegisterAFilter() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • UnRegisterAHandler() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • UnRegisterALanguageClass() : langreg.hxx
  • UnRegisterALanguageResource() : langreg.hxx
  • UnRegisterAnExt() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • UnregisterAppClass() : GdiDemo.h , Init.c
  • UnRegisterCallBack() : tapirecv.cpp
  • UnregisterCluAdminAllGroupsExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllNetInterfacesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllNetworksExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllNodesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllResourcesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllResourceTypesExtension() : RegExt.h , RegExt.cpp , RegExt.h , RegExt.cpp
  • UnregisterCluAdminClusterExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminResourceTypeExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterLocalServer() : Server.Cxx
  • UnRegisterProxy() : registry.cpp , registry.h
  • UnregisterProxyDll() : Server.Cxx
  • UnregisterServer() : registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , Registry.Cpp , Registry.h , registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h
  • UnRegisterServer() : server.cxx
  • UnregisterSnapin() : registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , Registry.Cpp , Registry.h , registry.Cpp , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h
  • UnRegisterTapiEventInterface() : FileTerm.cpp , FileTerm.h
  • UNSCRAMBLE : Common.h
  • UNTOUCHED : quiktest.h
  • UNUSED : StdAfx.h
  • UnwriteableRand() : enablerouter.c
  • upcase : recvbuf.Cpp
  • UPCASE_ANSI_CHAR : IsapiString.cpp , UpCaseMap.cpp
  • Update() : ioo.h , account.Idl
  • UPDATE : fileio.h
  • UPDATE_RESULTITEM : globals.h
  • UPDATE_SCOPEITEM : globals.h
  • UPDATE_VIEWS_HINT : globals.h
  • UpdateApp() : cShare.h , chWnd.Cpp
  • UpdateAppList() : chWnd.Cpp , cShare.h
  • UpdateAudioSettings() : Dlg.Cpp
  • UpdateButton() : IMEApps.h , ToolBar.c
  • UpdateCapInfoListsFromIndex() : InstCodc.Cpp
  • UpdateChannelState() : CChan.h , CChan.Cpp
  • UpdateCommand() : data.Idl
  • UpdateCompletionPort() : IocpServer.Cpp , IocpServerex.Cpp , IocpServer.h
  • UpdateConfig : rqsengine.h
  • UpdateConfView() : cMemb.h , cMemb.Cpp
  • UpdateDialog() : bits_ie.cpp
  • UpdateHdlgIdInt() : Global.h
  • UpdateHdlgIdText() : Global.h
  • UpdateJobData() : queue.c , queue.h
  • UPDATELINKS_STARTDELAY : OleStd.h
  • UpdateLspMap() : instlsp.cpp
  • UpdateMenu() : VListVw.c
  • UpdateMenuSettings() : DebMisc.c , DebMisc.h
  • UpdateMenuState() : IconPRO.C
  • UpdateModeButton() : IMEApps.h , ToolBar.c
  • UpdatePositions() : Tools.c
  • UpdatePrincipalInACL() : AclMgmt.Cpp , DComPerm.h
  • UpdatePrincipalInNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • UpdatePrinterData() : queue.h , queue.c
  • UpdateProgress() : CConf.Cpp
  • UpdatePropertyFields() : secClnt.Cpp
  • UpdateQueue() : queue.h , printjob.c
  • UpdateRegistery() : main.cpp
  • UpdateSecurityFields() : secClnt.Cpp
  • UpdateSelection() : Select.h , Select.c
  • UpdateShareList() : Dlg.Cpp
  • UpdateShowCandButton() : IMEApps.h , ToolBar.c
  • UpdateShowOpenStatusButton() : IMEApps.h , ToolBar.c
  • UpdateStatusBar() : Global.h , STATBAR.h , STATBAR.c , sBar.Cpp
  • UpdateStatusIcon() : sBar.Cpp , Global.h
  • UpdateStoredProcedure() : data.Idl
  • UpdateTrace : rqsengine.h
  • UpdateUserChannel() : cMemb.h , cMemb.Cpp
  • UpdateUserCount() : cMemb.Cpp
  • UpdateUserDisplay() : cMemb.Cpp
  • UpdateUserInfo() : cMemb.Cpp
  • UpdateWindowTitle() : printjob.c , quecore.h
  • UPDTYPE : fileio.h
  • UpgradeMsi() : upgrdmsi.cpp , setup.h
  • Upload() : Sample1.h , Sample1.Cpp
  • URL : news.Idl
  • URL_ESCAPE_UNSAFE : cpack.cpp
  • URL_SCHEME : sdksamplestoragesystem.h
  • URL_SCHEME_LENGTH : sdksamplestoragesystem.h
  • UrlCombineW() : cpack.cpp
  • usage() : Mcastws2.c , PrSamp.h
  • Usage() : IPStat.Cpp
  • usage() : Ping.cpp
  • Usage() : Overlap.c , customentry.c , RasDialAsync.c
  • usage() : GssServer.c
  • Usage() : ModifyRecords.cpp , DUnions.c , Xmits.c , HeadDump.cpp , Simplec.c , Sockdupc.c , rnrcs.cpp , Bcast.c , Usrdefc.c , InOuts.c , Repass.c , DirEncrypt.Cpp , Dynepts.c , Usrdefs.c , Pickltc.c , Ioctl.c , IPRenew.Cpp , DNSQuery.Cpp
  • usage() : GssClient.c
  • Usage() : InOutc.c , IPChange.Cpp , Helper.Cpp , Xmitc.c , Server.cpp , ComPerf.Cpp , Cxhndlc.c
  • usage() : rcvall.c , rawudp.c
  • Usage() : AuthzCli.c , msiloc.cpp
  • usage() : instlsp.cpp
  • Usage() : Dyneptc.c
  • usage() : client.cxx
  • Usage() : ClUuidc.c , WebServer.c , Repasc.c , Helloc.c , Pipec.c , QSample.Cxx , Client.cpp , WSnmpUtil.h , Picklpc.c , AdvQuery.Cxx , ChgState.Cxx
  • usage() : log.c
  • Usage() : IPArp.Cpp , Sockdups.c , RasDial.c , Simples.c , Client.c , AsyncRPCc.c , AsyncRPCs.c , DUnionc.c , Cxhndls.c , Server.c , Pipes.c , Hellos.c , RPCssmc.c , RPCssms.c , IPRoute.Cpp , WebClient.c
  • usage() : PrPerf.c
  • Usage() : ClUuids.c
  • usage() : Mcastws1.c
  • Usage() : Client.C
  • UsageDlgProc() : sdkdiff.cpp
  • USE_COMMAND : prsample.h
  • USE_ENUMERATOR : prsample.h
  • USE_ISEQSTREAM : prsample.h
  • USE_MEMORY : keys.cpp
  • USE_PROMPTDATASOURCE : prsample.h
  • USE_STUBLESS_PROXY : ADsError_p.c , ADsFirstExt_p.c , EdHost_p.c , EdCommands_p.c , ADsFirstExt_p.c , EDAnnotator_p.c , Render_p.c , BrochureMachine_p.c , EdGlyphs_p.c
  • USE_WORK_QUEUE : fwasync.c , ftrans.c
  • UseCase1() : app.cpp
  • UseCase2() : app.cpp
  • UseCase3() : app.cpp
  • UseCase4() : app.cpp
  • UseCase5() : app.cpp
  • UseCase6() : app.cpp
  • UseDialingRules() : TapiCode.c
  • USEDONLY : Grid.Hxx
  • USER : cMemb.h
  • User : resource.h , comspyctl.idl
  • USER : cMemb.h
  • USER_ACCESS : SecFile.c
  • USER_EVENT : TraceDp.c
  • USER_INFO : cache.c
  • USER_LIST_FILE : db.c
  • UserMarshalRoutines : ADsError_p.c
  • UsernameCommand() : Eap.c , Eap.h
  • UsernameDialogProc() : Eap.h , Eap.c
  • USERNAMELEN : securitysub.h
  • UserPrivilege() : Admapit.c
  • USERS_OFFSET : spy.cpp
  • USES_CONVERSION : StrConv.h
  • USESTRINGSALSO : profile.h
  • USHORT : sampprov.h
  • USPDlgProc() : global.h
  • UsrdefProc() : Usrdefp.c
  • UtDupStringA2W : ansiapi.h
  • UTIL_NOACCESS : util.h
  • UTIL_READONLY : util.h
  • UTIL_READWRITE : util.h
  • UtilAllocMem() : Util.Cpp , Util.h
  • UtilFreeMem() : Util.Cpp , Util.h
  • UTILITY_OPTION_REFRESH : UtilitiesDlg.Cpp
  • UTILITY_OPTION_START : UtilitiesDlg.Cpp
  • UTILITY_OPTION_STOP : UtilitiesDlg.Cpp
  • UTILITY_OPTION_UNDEFINED : UtilitiesDlg.Cpp
  • UTILITY_TYPE_JNEC : UtilitiesDlg.Cpp
  • UTILITY_TYPE_ROUTER : UtilitiesDlg.Cpp
  • UTILITY_TYPE_START_APP : AppUtilDlg.h
  • UTILITY_TYPE_STOP_APP : AppUtilDlg.h
  • UTILITY_TYPE_UNDEFINED : UtilitiesDlg.Cpp , AppUtilDlg.h
  • utils_CompPath() : gutils.h , utils.cpp
  • utils_isblank() : utils.cpp , gutils.h
  • uudecode() : HttpAuth.c
  • uuencode() : HttpAuth.c
  • uuid() : myProp.Idl
  • UUID_IPluggableTransport : iplgxprt.idl
  • uw : quiktest.h
  • UWORD : sampprov.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- v -

  • ValidateArgs() : rawudp.c , Mcastws1.c , Ping.cpp , rcvall.c , Mcastws2.c
  • ValidateAuthenticationMethods() : HttpAuth.c , HttpAuth.h
  • ValidateCallingUser() : RasHost.Cpp , RasHost.h
  • ValidateGlobalConfig() : configmgr.c
  • ValidateInterfaceConfig() : networkmgr.c
  • ValidateUpdate() : setup.h , upgrdmsi.cpp
  • ValidateUser() : AuthFilt.h , db.c
  • validnum() : dbh.cpp
  • ValidOptions() : IocpServer.Cpp , IocpServer.h , IocpServerex.Cpp
  • ValidString : FaxSiren.Cpp
  • Value() : MtsUserEventObj.Idl
  • VALUE_CHAR : common.h
  • VALUE_CHAR_HR : common.h
  • VALUE_IS_BOUND : common.h
  • VALUE_PWCHAR : common.h
  • VALUE_STRING : Utility.Cpp
  • VALUE_WCHAR : common.h , common.cpp , error.cpp
  • ValueToString() : AdvClientdlg.h , UtilLib.h , Utils.Cpp , AdvClientdlg.cpp
  • VAR_BUFFER_SIZE : DumpVars.cpp
  • VariableInitialization() : TakeOwn.c
  • VariantChangeFast() : common.cpp , common.h
  • VariantClearFast() : common.cpp , common.h
  • VariantCopyFast() : common.cpp , common.h
  • VariantInitFast() : common.cpp , common.h
  • VariantSetArray() : util.cpp , util.h
  • VariantSetVar() : util.cpp , util.h
  • VariantToPtrList() : helper.cpp , helper.h
  • VariantToString() : common.cpp , common.h
  • VariantToStringList() : helper.cpp , helper.h
  • varvect : dynamic.h
  • VB : bankdlg.h
  • VC : bankdlg.h
  • VC_EXTRALEAN : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h
  • vclassfactory : OleImp.Cpp , OleApt.Cpp
  • VCName : SessionDlg.Cpp
  • vCtype : APP.Cxx
  • VDumpArray() : AdsiDump.cpp
  • VDumpAttribute() : AdsiDump.cpp
  • VDumpObject() : AdsiDump.cpp
  • VDumpTree() : AdsiDump.cpp
  • VEC_CLERKS : CrmMonCompObj.h
  • VectorToString() : common.cpp , common.h
  • VELMAX : Poly.h
  • VELMIN : Poly.h
  • vEndCount : Grid.Cxx
  • ver : UnBufCp1.c , UnBufCp2.c
  • VER_COMPANYNAME_STR : version.h , sampver.h , version.h
  • VER_FILEDESCRIPTION_STR : DfV.h
  • VER_FILEFLAGS : version.h , sampver.h , version.h
  • VER_FILEFLAGSMASK : version.h , sampver.h , version.h
  • VER_FILEOS : version.h , sampver.h , version.h
  • VER_FILEVERSION : version.h , sampver.h , version.h
  • VER_FILEVERSION_STR : version.h , sampver.h , version.h
  • VER_INTERNALNAME_STR : DfV.h
  • VER_LEGALCOPYRIGHT_STR : version.h , sampver.h , version.h
  • VER_ORIGINALFILENAME_STR : DfV.h
  • VER_PRODUCTNAME_STR : sampver.h , version.h
  • VER_PRODUCTVERSION : version.h , sampver.h , version.h
  • VER_PRODUCTVERSION_STR : version.h , sampver.h , version.h
  • VERB_OPEN : ioo.Cpp
  • Verbose : AsyncIO.h
  • VERBOSE : Const.H
  • verbose : GssServer.c
  • Verify : StdAfx.h
  • VERIFY_RESCHANGE : SetDisp.h
  • VERIFY_SCHEMA : resource.h
  • VERIFY_TIMEOUT : SetDisp.h
  • VerifyAndWarnUsableLine() : TapiCode.c
  • VerifyDlgProc() : SetDisp.c , SetDisp.h
  • VerifyFileSignature() : setup.h , utils.cpp
  • VerifyIndex() : quiktest.c
  • VerifyProcTable() : spi.cpp
  • VerifySchema() : bankdlg.Cpp , bankthrds.Cpp
  • VerifySignature() : Stubs.c
  • VerifyThis() : Security.cpp , Security.h
  • VerifyTimerProc() : SetDisp.c , SetDisp.h
  • VerifyUsableLine() : TapiCode.c
  • vErrOut() : MfEdit.c
  • VERSION : Globals.h
  • Version : Tst4Wts.c , sdkdiff.cpp
  • version : Globals.h , Main.c
  • VERSION_MAJOR : SEQ.h
  • VERSION_MAJOR_W2K_XP_W2K3 : UtilS.Cpp
  • VERSION_MINOR : SEQ.h
  • VERSION_MINOR_W2K : UtilS.Cpp
  • VERSION_MINOR_W2K3 : UtilS.Cpp
  • VERSION_MINOR_XP : UtilS.Cpp
  • vfRemote : ComPerf.Cpp
  • vfServer : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • vhEventCliDone : ComPerf.Cpp
  • vhEventCliStart : ComPerf.Cpp
  • vhEventServer : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • vhrThreadStatus : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • vhwndMain : OleImp.Cpp , OleApt.Cpp
  • VIEW : compitem.h , complist.h , view.h
  • VIEW_CASE_PROPERTY : property.cpp
  • view_changediffoptions() : view.cpp , view.h
  • view_changeviewoptions() : view.cpp , view.h
  • VIEW_CLASS_NAME : OLEDocVw.h
  • view_close() : view.cpp , view.h
  • VIEW_CUSTOM_PROPERTY : property.cpp
  • view_delete() : view.cpp , view.h
  • view_expand() : view.h , view.cpp
  • view_expand_item() : view.cpp
  • view_expanding() : view.cpp , view.h
  • view_expandstart() : view.cpp , view.h
  • view_findchange() : view.cpp , view.h
  • view_findrow() : view.cpp
  • view_findstring() : view.cpp , view.h
  • view_freemappings() : view.cpp
  • view_getcomplist() : view.cpp , view.h
  • view_getcurrenttag() : view.cpp , view.h
  • view_gethwnd() : view.cpp , view.h
  • view_getitem() : view.cpp , view.h
  • view_getlinenr_left() : view.cpp , view.h
  • view_getlinenr_right() : view.cpp , view.h
  • view_getmarkstate() : view.cpp , view.h
  • view_getrowcount() : view.cpp , view.h
  • view_getrowstate() : view.cpp , view.h
  • view_getstate() : view.cpp , view.h
  • view_gettext() : view.cpp , view.h
  • view_gettextW() : view.cpp , view.h
  • view_getwidth() : view.cpp , view.h
  • view_gototableline() : view.cpp , view.h
  • view_isexpanded() : view.cpp , view.h
  • view_new() : view.cpp , view.h
  • view_newitem() : view.cpp , view.h
  • view_outline() : view.cpp , view.h
  • view_outline_opt() : view.cpp
  • VIEW_POINTER_OFFSET : PropSheetHost.h , Utility.h
  • view_setcomplist() : view.h , view.cpp
  • view_setmarkstate() : view.cpp , view.h
  • ViewEnter : view.cpp
  • VIEWFONT_DECREASESIZE : FVText.h
  • VIEWFONT_INCREASESIZE : FVText.h
  • VIEWFONT_SELECT : FVText.h
  • VIEWFONTOPTION : FVText.h
  • ViewLeave : view.cpp
  • VIEWLINE : view.cpp
  • VIEWLIST : Viewlist.h
  • ViewportWndProc() : FVProc.Cpp , FVText.h
  • viNextThread : ComPerf.Cpp , OleApt.Cpp
  • VIRTUAL_BUFFER : AsyncIO.h
  • VirtualBufferExceptionFilter() : AsyncIO.c , AsyncIO.h
  • VirtualChannelEntry() : SysInf_C.c
  • VirtualChannelInitEventProc() : SysInf_C.c
  • VirtualChannelOpenEvent() : SysInf_C.c
  • VirtualKeyHandler() : Main.C
  • VIterateSafeArray() : AdsiDump.cpp
  • VK_ADD : winres.h
  • VK_BACK : winres.h
  • VK_CANCEL : winres.h
  • VK_CAPITAL : winres.h
  • VK_CLEAR : winres.h
  • VK_CONTROL : winres.h
  • VK_DECIMAL : winres.h
  • VK_DELETE : winres.h
  • VK_DIVIDE : winres.h
  • VK_DOWN : winres.h
  • VK_END : winres.h
  • VK_ESCAPE : winres.h
  • VK_EXECUTE : winres.h
  • VK_F1 : winres.h
  • VK_F10 : winres.h
  • VK_F11 : winres.h
  • VK_F12 : winres.h
  • VK_F13 : winres.h
  • VK_F14 : winres.h
  • VK_F15 : winres.h
  • VK_F16 : winres.h
  • VK_F17 : winres.h
  • VK_F18 : winres.h
  • VK_F19 : winres.h
  • VK_F2 : winres.h
  • VK_F20 : winres.h
  • VK_F21 : winres.h
  • VK_F22 : winres.h
  • VK_F23 : winres.h
  • VK_F24 : winres.h
  • VK_F3 : winres.h
  • VK_F4 : winres.h
  • VK_F5 : winres.h
  • VK_F6 : winres.h
  • VK_F7 : winres.h
  • VK_F8 : winres.h
  • VK_F9 : winres.h
  • VK_HELP : winres.h
  • VK_HOME : winres.h
  • VK_INSERT : winres.h
  • VK_LBUTTON : winres.h
  • VK_LEFT : winres.h
  • VK_MBUTTON : winres.h
  • VK_MENU : winres.h
  • VK_MULTIPLY : winres.h
  • VK_NEXT : winres.h
  • VK_NUMLOCK : winres.h
  • VK_NUMPAD0 : winres.h
  • VK_NUMPAD1 : winres.h
  • VK_NUMPAD2 : winres.h
  • VK_NUMPAD3 : winres.h
  • VK_NUMPAD4 : winres.h
  • VK_NUMPAD5 : winres.h
  • VK_NUMPAD6 : winres.h
  • VK_NUMPAD7 : winres.h
  • VK_NUMPAD8 : winres.h
  • VK_NUMPAD9 : winres.h
  • VK_PAUSE : winres.h
  • VK_PRINT : winres.h
  • VK_PRIOR : winres.h
  • VK_RBUTTON : winres.h
  • VK_RETURN : winres.h
  • VK_RIGHT : winres.h
  • VK_SCROLL : winres.h
  • VK_SELECT : winres.h
  • VK_SEPARATOR : winres.h
  • VK_SHIFT : winres.h
  • VK_SNAPSHOT : winres.h
  • VK_SPACE : winres.h
  • VK_SUBTRACT : winres.h
  • VK_TAB : winres.h
  • VK_UP : winres.h
  • VOID : GinaHook.h , GinaStub.h , GinaHook.h
  • VOLUME_GET_GPT_ATTRIBUTES_INFORMATION : DLEdit.Cpp
  • vpCSet : Grid.Cxx
  • VPSid : AuthzSvr.c
  • VPSidBuf : AuthzSvr.c
  • vpstmMarshalling : OleApt.Cpp , OleImp.Cpp , ComPerf.Cpp
  • vpunkService : OleApt.Cpp
  • VPWL_OBJECTPOINTER : FVText.h
  • vrgcObjects : OleApt.Cpp , OleImp.Cpp
  • vrghEvent : ComPerf.Cpp , OleApt.Cpp , OleImp.Cpp
  • vrghThread : ComPerf.Cpp , OleApt.Cpp , OleImp.Cpp
  • vrgperfloc : ComPerf.Cpp
  • vrgperfrmt : ComPerf.Cpp
  • vrgpSid : OleImp.Cpp
  • vrgpszAptUser : OleImp.Cpp
  • vrgtid : ComPerf.Cpp , OleApt.Cpp , OleImp.Cpp
  • vSegCount : Grid.Cxx
  • vStartCount : Grid.Cxx
  • VT_CF_BYTES : suminfo.h
  • VT_CF_EMPTY : suminfo.h
  • VT_CF_FMTID : suminfo.h
  • VT_CF_MAC : suminfo.h
  • VT_CF_NAME : suminfo.h
  • VT_CF_OOM : suminfo.h
  • VT_CF_WIN : suminfo.h
  • VTCB : suminfo.h
  • vtcfNo : suminfo.h
  • VThrowAdsError() : AdsiDump.cpp
  • VWP_LEFT : Callnot.Cpp
  • VWP_TOP : Callnot.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- w -

  • W2A : debug.h , ansiapi.h , StrConv.h , ansiapi.h
  • W2AHELPER : StrConv.h
  • W2AHelper() : StrConv.h
  • W2CA : StrConv.h
  • W2CT : StrConv.h
  • W2T : globals.h , StrConv.h , globals.h
  • Wait : FileRepClientProc.cpp , FileRepServerProc.cpp , helpdll.Cpp
  • WAITERR_WAITABORTED : TapiCode.c
  • WAITERR_WAITTIMEDOUT : TapiCode.c
  • WaitForCallState() : TapiCode.c
  • WaitForProcess() : setup.h , upgrdmsi.cpp
  • WaitForQueryToComplete() : AdvQuery.Cxx
  • WaitForReply() : TapiCode.c
  • WaitForTheWrite() : SysInf_C.c
  • WaitForTraps() : WSnmpUtil.h , WSnmpUtil.Cpp
  • WaitThread() : WMIDiskPerf.Cpp
  • WAITTIMEOUT : TapiCode.c
  • WALK : SnmpUtil.C , WSnmpUtil.h
  • WARN_MSG : Global.h
  • WarnIfGlobalPolicySet() : ListAcl.Cpp
  • WarningBox() : TapiCode.c
  • WarnMsg() : Debug.Cpp , Global.h
  • WASANSI : ansiapi.h
  • WatcherDialogProc() : rtcdialogs.cpp
  • wAuxUserType : OleStd.h
  • WAVE_DATA : Perfgen.c
  • WAVE_TOGGLE_ALLOW : wave.h
  • WAVE_TOGGLE_DESTINATION : wave.h
  • WAVE_TOGGLE_DISABLE : wave.h
  • WaveOpenFile() : wave.cpp , wave.h
  • WavePlayFileCB() : wave.cpp , wave.h
  • WaveSaveFile() : wave.cpp , wave.h
  • WaveTogglePlayback() : wave.cpp , wave.h
  • WbemConnect() : tracewmi.cpp
  • WbemErrorString() : UtilLib.h , Utils.Cpp
  • wBufSize : Title.c
  • WCHAR_STRING_free_inst() : Repascu.c
  • WCHAR_STRING_free_local() : Repascu.c
  • WCHAR_STRING_from_local() : Repascu.c
  • WCHAR_STRING_to_local() : Repascu.c
  • WCSCMP : stdafx.h
  • wcscmp_fast() : string_fast.Cpp , string_fast.h
  • WCSCPY : stdafx.h
  • wcscpy_count() : string_fast.Cpp , string_fast.h
  • wcscpy_fast() : string_fast.Cpp , string_fast.h
  • wcsDuplicate() : common.cpp , common.h , common.cpp , common.h
  • WCSNCMP : stdafx.h
  • wcsncmp_fast() : string_fast.Cpp , string_fast.h
  • WCSNCPY : stdafx.h
  • wcsncpy_fast() : string_fast.Cpp , string_fast.h
  • wd_copy() : sdkdiff.cpp
  • wd_dirdialog() : sdkdiff.cpp
  • wd_initial() : sdkdiff.cpp
  • WDEnter : sdkdiff.cpp
  • WDLeave : sdkdiff.cpp
  • wEOL : common.h , sampprov.h
  • WEP() : gutils.cpp , dllstub.c , Wepcode.c
  • wFullUserName : security.cpp
  • wGetDlgItemText() : winmain.cpp , winmain.h
  • wGetWindowText() : common.cpp , common.h
  • while() : Utils.Cpp
  • WHITE : MfEdit.h
  • WhoAmI() : VCSecuritySample.Idl , formdump.cpp
  • WideCharToLocal() : ADEvent.cpp , Utility.Cpp , Utility.h , IcnOvrly.Cpp , IcnOvrly.h
  • WIDEDBIDMAP : error.h
  • WIDEGUIDMAP : error.h
  • WIDENAMEMAP : error.h
  • WIDESTRING : common.h
  • WIDGETS : nshsamp.h
  • WIDTHBYTES : Dibapi.h , Dib.h
  • WILD_UNDERSCORE : dbh.cpp
  • WIN : wn_dos.h , setup.cpp , setupui.cpp , upgrdmsi.cpp , utils.cpp , vertrust.cpp
  • WIN32_LEAN_AND_MEAN : StdAfx.h , sampclnt.h , headers.h , StdAfx.h , stdafx.h , StdAfx.h , RasDial.c , RasDialAsync.c , StdAfx.h , IocpServer.Cpp , IocpServerex.Cpp , Ioctl.c , Simplec.c , Simples.c , StdAfx.h , DumpVars.cpp , formdump.cpp , html.cpp , keys.cpp , readcli.c , fwrite.c , KeepAlive.c , KeepAliveP.c , ThreadPool.c , Redirect.cpp , Simple.cpp , WorkerThread.c , Commands.Cpp , DskQuota.Cpp , PrintMenu.Cpp , ProcessMenu.Cpp , DLEdit.Cpp , FCopy.Cpp , ProcList.c , AboutDlg.c , MainWnd.c , StatList.c , WinUtils.c , stdafx.h , stgcreatepropsetstg.cpp , writeread.cpp
  • WIN32ERROR_FROM_DELAYLOAD : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • WIN32ERROR_FROM_HRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • WIN32S : Globals.h
  • Win4Assert : Debug.Hxx
  • Win4AssertEx() : Assert.Cxx
  • WIN95 : Globals.h
  • WINAPI_MY_PIPE_PULL : common.h
  • WINAPI_MY_PIPE_PUSH : common.h
  • Winch() : MICARS.Idl
  • WINDLL : dballoc.Cpp , ole2ui.c
  • WINDOW_HEIGHT : IconPRO.h
  • WINDOW_MENU_POSITION : resource.h
  • WINDOW_ONLY : Dt.h
  • WINDOW_WIDTH : IconPRO.h
  • WindowProc() : AppUtil.Cpp , AppUtil.h , cwindow.Cxx , cwindow.h
  • WINDOWS_LEAN_AND_MEAN : Create.Cpp , msiloc.cpp , Process.cpp , Remove.cpp , Tutorial.cpp
  • WindowsDispatch() : Main.cpp
  • WindowsInit() : Main.cpp
  • WindowsMainProc() : Main.cpp
  • WindowsStart() : Main.cpp
  • WindowsStop() : Main.cpp
  • WinHttpFormSubmitSample() : WinHttpFormSubmitSample.cpp
  • WinHttpSamplePost() : WinHttpPostSample.cpp
  • WinMain() : MciPlay.c , MidiPlyr.c , FontView.c , APP.Cxx , APP.Hxx , Fontsize.c , GdiDemo.c , MfEdit.c , Mypal.c , Printer.c , printjob.c , SetDisp.c , TextFx.c , ViewDIB.c , WinCap.c , halftone.c , PlgBlt.c , WxForm.c , GetImage.cpp , PhoneEntry.c , rtcsample.cpp , Dialer.c , WinMain.c , FileTerm.cpp , Incoming.Cpp , Outgoing.Cpp , WinMain.c , Main.Cpp , setup.cpp , Main.cpp , AdvReco.cpp , BasicRecognition.cpp , EventSink.cpp , MultiReco.cpp , TPCInfo.cpp , bits_ie.cpp , main.cpp , dxsurf1.cpp , dxsurf2.cpp , dxsurf3.cpp , main.cpp , Cap.Cpp , Hello.Cpp , Hello2.Cpp , Hello3.Cpp , InstCodc.Cpp , Main.Cpp , ui.cpp , Main.Cpp , ui.cpp , AsyncDemo.cpp , DebMain.c , Client32.c , Server32.c , Monkey.c , StatList.c , LeakyBin.c , ClipText.c , CDTest.c , ComDlg32.C , Property.c , Rebar.c , VListVw.c , VListVw.h , Cursor.c , fulldrag.c , CSSamp.Cpp , Main.C , IMEApps.c , MultiUI.C , MultiUI.h , MousInfo.c , MousInfo.h , Menu.c , Obscure.c , DynDlg.c , IconPRO.C , sendto.c , Main.c , CustomDrawButtonDlg.cpp , DragImg.Cpp , enumdesk.cpp , fakemenu.c , App32.C , tallmenu.c , tsfapp.cpp , compart.cpp , Demo.c , Generic.C , sdkdiff.cpp , WinMain.Cxx , DoServer.Cpp , Framer.Cpp , custsur.Cpp , Cancel.Cpp , OleImp.Cpp , secClnt.Cpp , secSvr.Cpp , OleApt.Cpp , server.cxx , SimpCntr.Cpp , SimpCntr.h , SimpDnd.Cpp , SimpDnd.h , SimpSvr.Cpp , SimpSvr.h , AptClien.Cpp , AptServe.Cpp , ComUser.Cpp , ConClien.Cpp , DcdServe.Cpp , DComDraw.Cpp , DllClien.Cpp , DllUser.Cpp , ExeSkel.Cpp , FreClien.Cpp , LicClien.Cpp , LocClien.Cpp , LocServe.Cpp , PerClien.Cpp , ReadTut.Cpp , register.Cpp , RemClien.Cpp , StoClien.Cpp , cdialoglite.cpp , winmain.cpp
  • WINNT : Globals.h
  • WINOLEAPI_() : OleStd.h
  • WinOpenFile : wn_dos.h
  • WINPROCTYPE : gutils.h
  • WINSOCK_CATALOG : install.h
  • WINTRUST_DLL : vertrust.cpp
  • WINTRUSTAPI_WinVerifyTrust : vertrust.cpp
  • WINTRUSTAPI_WTHelperGetProvCertFromChain : vertrust.cpp
  • WINTRUSTAPI_WTHelperGetProvSignerFromChain : vertrust.cpp
  • WINTRUSTAPI_WTHelperProvDataFromStateData : vertrust.cpp
  • WINVER : Qoslist.Cpp , customdial.cpp , customdialreg.cpp , StdAfx.h , EnumerateKeys.cpp
  • WireToHostFormat16() : Eap.c
  • WIZ_STEP : wizard.h
  • WIZ_STEP1 : wizard.h
  • WIZ_STEP2 : wizard.h
  • WIZ_STEP3 : wizard.h
  • WIZ_STEP4 : wizard.h
  • WIZ_TYPES : wizard.h
  • WL_TABLE : tpriv.h
  • wLibDataSeg : gutils.cpp
  • WLTOTAL : tpriv.h
  • WlxActivateUserShell() : GinaHook.c , GinaStub.c
  • WlxDisplayLockedNotice() : GinaHook.c , GinaStub.c
  • WlxDisplaySASNotice() : GinaHook.c , GinaStub.c
  • WlxDisplayStatusMessage() : GinaHook.c , GinaStub.c
  • WlxGetStatusMessage() : GinaHook.c , GinaStub.c
  • WlxInitialize() : GinaHook.c , GinaStub.c
  • WlxIsLockOk() : GinaHook.c , GinaStub.c
  • WlxIsLogoffOk() : GinaHook.c , GinaStub.c
  • WlxLoggedOnSAS() : GinaHook.c , GinaStub.c
  • WlxLoggedOutSAS() : GinaHook.c , GinaStub.c
  • WlxLogoff() : GinaHook.c , GinaStub.c
  • WlxNegotiate() : GinaHook.c , GinaStub.c
  • WlxNetworkProviderLoad() : GinaHook.c , GinaStub.c
  • WlxRemoveStatusMessage() : GinaHook.c , GinaStub.c
  • WlxScreenSaverNotify() : GinaHook.c , GinaStub.c
  • WlxShutdown() : GinaHook.c , GinaStub.c
  • WlxStartApplication() : GinaHook.c , GinaStub.c
  • WlxWkstaLockedSAS() : GinaHook.c , GinaStub.c
  • WM_ADD_DEVICENODE : globals.h
  • WM_ADD_VIRTUALFILE : globals.h
  • WM_ADDNEW_NODE : globals.h
  • WM_ADSPROP_SHEET_CREATE : PropSheetHost.h
  • WM_APP : Deb.h , Client32.h
  • WM_CF_LF : Font.h
  • WM_CONNECTED : nmsession.h
  • WM_CONNECTING : nmsession.h
  • WM_DEL_DEVICENODES : globals.h
  • WM_DELETE_NODE : globals.h
  • WM_DEVICENODE_CLOSED : globals.h
  • WM_DIALOG_CLOSED : globals.h
  • WM_DISCONNECTED : nmsession.h
  • WM_DISCOVERYCOMPLETE : backgrnd.Cpp
  • WM_DOCAPTURE : WinCap.c
  • WM_DSA_SHEET_CLOSE_NOTIFY : PropSheetHost.h
  • WM_DSA_SHEET_CREATE_NOTIFY : PropSheetHost.h
  • WM_GETFIRSTKEY : Monkey.h
  • WM_GO_AWAY : Client32.h
  • WM_INITCLIENT : Client32.h
  • WM_NEWOBJECT : backgrnd.Cpp
  • WM_PLGBLT : PlgBlt.h
  • WM_PLUGABLE_SOCKET : nmsession.h
  • WM_PRIVATETAPIEVENT : CallNot.h , Callnot.h , common.h
  • WM_PUTUPFLOATS : WxForm.h
  • WM_PUTUPLPOINTS : PlgBlt.h
  • WM_PUTUPMASKPT : PlgBlt.h
  • WM_PUTUPSRCRECT : PlgBlt.h
  • WM_REFRESH_EVENT : people.Cpp
  • WM_RTC_EVENT : rtcwin.h
  • WM_RTCCORE_EVENT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • WM_SHOWERROR : bankdlg.h
  • WM_SHOWRESULTS : bankdlg.h
  • WM_SNMP_DONE : WSnmpUtil.h
  • WM_SNMP_INCOMING : WSnmpUtil.h
  • WM_SOCKET : provider.h
  • WM_SPIN : PlgBlt.h
  • WM_START_PLAYBACK : childview.h
  • WM_STOP_PLAYBACK : childview.h
  • WM_U_UPDATELINK : ole2ui.c
  • WM_USER : winres.h
  • WM_USER_ASYNCSELECT_MSG : common.h
  • WM_USER_PAGECHANGED : IPageS.h
  • WM_USER_PAGECLOSED : IPageS.h
  • WM_VBXINIT : afxres.h
  • WM_VIRTUALFILE_CLOSED : globals.h
  • WM_WMI_CONNECTED : people.Cpp
  • WM_WORKERMSG_DELETELOGERROR : Handler.h
  • WM_WORKERMSG_ENABLEMODELESS : Handler.h
  • WM_WORKERMSG_ESTABLISHCONNECTION : Handler.h
  • WM_WORKERMSG_LOGERROR : Handler.h
  • WM_WORKERMSG_PREPAREFORSYNCCOMPLETED : Handler.h
  • WM_WORKERMSG_PREPFORSYNC : Handler.h
  • WM_WORKERMSG_PROGRESS : Handler.h
  • WM_WORKERMSG_RELEASE : Handler.h
  • WM_WORKERMSG_SHOWERROR : Handler.h
  • WM_WORKERMSG_SHOWERRORCOMPLETED : Handler.h
  • WM_WORKERMSG_SHOWPROPERTIES : Handler.h
  • WM_WORKERMSG_SHOWPROPERTIESCOMPLETED : Handler.h
  • WM_WORKERMSG_SYNCHRONIZE : Handler.h
  • WM_WORKERMSG_SYNCHRONIZECOMPLETED : Handler.h
  • wmain() : wkguid.cpp , main.c , ChngPass.c , NetShare.c , Audit.c , KList.c , MachAcct.c , security.cpp , EnumerateKeys.cpp , AdvQuery.Cxx , ChgState.Cxx , QSample.Cxx , DskQuota.Cpp , propdump.cpp , stgcreatepropsetstg.cpp , writeread.cpp , Sample1.Cpp , main.cpp , bindtoparent.cpp , main.cpp , getschemainfo.cpp , otherwko.cpp , otherwko1.cpp , queryusers.cpp , objectSid.cpp , iasuser.cpp
  • WMAX : Print.c
  • WMAXDEV : Print.c
  • WMCOMMANDWPARAM : MultiUI.h
  • wMessageBox() : common.cpp , common.h , winmain.cpp , winmain.h
  • WMS_CONTEXT_PLUGIN_COMMAND_REQUEST_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_COMMAND_RESPONSE_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_CONTEXT_TYPE : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_NO_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_PRESENTATION_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_USER_CONTEXT : ContextDll.idl
  • wNameSpace : security.cpp
  • WndEOL : common.h
  • WNDEXTRA_NOUINOIMC : MultiUI.h
  • WNDEXTRA_NOUIOWNIMC : MultiUI.h
  • WNDEXTRA_OWNUIOWNIMC : MultiUI.h
  • WndProc() : Generic.C , FontView.c , APP.Cxx , APP.Hxx , GdiDemo.c , GdiDemo.h , printjob.c , printjob.h , TextFx.c , ViewDIB.c , WinCap.c , WinCap.h , GLOBALS.h , TapiComm.c , Globals.h , IpxChat.c , BasicRecognition.cpp , EventSink.cpp , dxsurf1.cpp , dxsurf3.cpp , main.cpp , MainDlg.Cpp , Msg.Cpp , ui.cpp , Global.h , Msg.Cpp , Global.h , Msg.Cpp , MainWnd.c , MainWnd.h , StatList.c , IconPRO.C , DragImg.h , dxsurf2.cpp , LeakyBin.c , Msg.Cpp , Global.h , halftone.c , TextFx.h , Mypal.c
  • WORD : suminfo.Cpp
  • WORDMAX : suminfo.h
  • WORDSWAP : SMFI.h
  • WORK_INITIALIZE_ITEM : AsyncIO.h
  • WORK_ITEM : AsyncIO.h
  • WORK_QUEUE : AsyncIO.h
  • WORK_QUEUE_ENTRIES : ThreadPool.h
  • WORK_QUEUE_ITEM : AsyncIO.h
  • WORK_TERMINATE_ITEM : AsyncIO.h
  • WORK_THREAD_DATA : RasHost.h
  • WorkerFcn() : fullserv.Cpp
  • WorkerFunction() : KeepAliveP.c , ThreadPool.h , WorkerThread.c
  • WorkerThread() : Handler.Cpp , Handler.h , IocpServer.h , IocpServerex.Cpp , InvokObjThreads.cpp , AsyncIO.h , SysInf_C.c , AsyncIO.c , IocpServer.Cpp
  • WorkerThreadArgs : Handler.h
  • WorkerThreadProc() : PoolWrap.cpp
  • WorkerThreadWndProc() : Handler.Cpp , Handler.h
  • WORLD_ACCESS : SecFile.c
  • wPassWord : security.cpp
  • wPath : security.cpp
  • WrapCompareString() : StringUtils.cpp , PropList.cpp , StringUtils.cpp
  • WRITE : Check_SD.h
  • write_all() : GssMisc.c
  • WRITE_BUFFER_SIZE : WildCardMap.cpp
  • WRITE_LOCK_TO_READ_LOCK : sync.h
  • WRITE_LOG_FILE : Admapit.c
  • WRITE_MODE : sync.h
  • WriteBMPFile() : Dib.c , Dib.h
  • WriteChars() : string_fast.Cpp , string_fast.h , string_fast.Cpp , string_fast.h , string_fast.Cpp
  • WriteColumnInfo() : dump.cpp , sampclnt.h
  • WriteCommString() : CommCode.c , CommCode.h
  • WriteDataToFile() : Picklpc.c , Pickltc.c
  • WriteDebug() : IsapiDebug.h , IsapiDebug.cpp , WildCardMap.cpp
  • WriteDebugArgs() : IsapiDebug.cpp
  • WriteDebugString() : NewFsp.h , Util.c
  • WriteDIB() : File.c
  • WriteDouble() : strmHelp.h , strmHelp.Cxx
  • WriteEcbDump() : DumpRequestInfo.cpp
  • WriteFmtUserTypeStg : AppUtil.h
  • WriteFunc() : Client.c
  • WriteICOHeader() : Icons.C
  • WriteIconToICOFile() : Icons.C , Icons.h
  • WriteIniBool() : Global.h , Util.Cpp
  • WriteIniHex() : Global.h , Util.Cpp
  • WriteIniInt() : Global.h , Util.Cpp
  • WriteIniStr() : Global.h , Util.Cpp
  • WriteIniTbar() : Global.h , sBar.Cpp
  • WriteKey : UnBufCp1.c
  • WriteLoop() : UnBufCp2.c
  • WriteNamedParam() : utils.Cpp , utils.h
  • writeOmid() : app.cpp , stl_write.cpp
  • WritePort : UnBufCp2.c
  • WritePref() : Global.h , Init.Cpp
  • WritePrivateProfileInt() : DebMisc.h , DebMisc.c
  • WritePrivateProfileSettings() : DebMisc.c , DebMisc.h
  • WriteProfileInt() : sdkdiff.cpp
  • WriteProxyServerSettingToFile() : cmsample.cpp
  • writer() : NmPipe.c
  • WriteRequestEntity() : DumpRequestInfo.cpp
  • WriteRequestHeaders() : DumpRequestInfo.cpp
  • WriteRoutingInfoIntoIniFile() : FaxSiren.Cpp
  • WriteSampleToFile() : Processing.cpp
  • WriteServerVariables() : DumpRequestInfo.cpp
  • WriteStreamToFile() : Processing.cpp
  • WriteStreamToLog() : SimpleLog.Idl
  • WriteString() : html.cpp , html.h
  • WriteToDisplayCtl() : EDITCTLS.h , EDITCTLS.c
  • WriteToPipe() : common.c , common.h
  • WriteVariantToLog() : SimpleLog.Idl
  • WS_BORDER : winres.h
  • WS_CAPTION : winres.h
  • WS_CHILD : winres.h
  • WS_CHILDWINDOW : winres.h
  • WS_CLIPCHILDREN : winres.h
  • WS_CLIPSIBLINGS : winres.h
  • WS_DISABLED : winres.h
  • WS_DLGFRAME : winres.h
  • WS_EX_LAYOUTRTL : global.h
  • WS_EX_NOINHERITLAYOUT : global.h
  • WS_GROUP : winres.h
  • WS_HSCROLL : winres.h
  • WS_ICONIC : winres.h
  • WS_MAXIMIZE : winres.h
  • WS_MAXIMIZEBOX : winres.h
  • WS_MINIMIZE : winres.h
  • WS_MINIMIZEBOX : winres.h
  • WS_OVERLAPPED : winres.h
  • WS_OVERLAPPEDWINDOW : winres.h
  • WS_POPUP : winres.h
  • WS_POPUPWINDOW : winres.h
  • WS_SIZEBOX : winres.h
  • WS_SYSMENU : winres.h
  • WS_TABSTOP : winres.h
  • WS_THICKFRAME : winres.h
  • WS_TILED : winres.h
  • WS_TILEDWINDOW : winres.h
  • WS_VER : Overlap.c
  • WS_VISIBLE : winres.h
  • WS_VSCROLL : winres.h
  • WSAEVENTSELECT_EVENT : Sender.Cpp
  • WSAExceptionNotify() : Dt_Dll.h
  • WSAOVERLAPPEDPLUS : provider.h
  • WSAPostApiNotify() : Dt_Dll.Cpp , Dt_Dll.h
  • WSAPreApiNotify() : Dt_Dll.h , Dt_Dll.Cpp
  • WSARECVMSGARGS : provider.h
  • WSASEND_EVENT : Sender.Cpp
  • wSelectPalette() : app.Cpp , app.h
  • wSendMessage() : asserts.cpp , common.cpp , common.h , asserts.h , winmain.cpp , winmain.h
  • wSendMessageFmt() : common.h , common.cpp
  • wServerName : security.cpp
  • wSetDlgItemText() : winmain.cpp , winmain.h
  • WSIZECC : Colors.c
  • WSIZEFO : Font.c
  • WSIZEFR : Find.c
  • WSPAccept() : spi.cpp
  • WSPAddressToString() : spi.cpp
  • WSPAsyncSelect() : spi.cpp
  • WSPBind() : spi.cpp
  • WSPCancelBlockingCall() : spi.cpp
  • WSPCleanup() : spi.cpp
  • WSPCloseSocket() : spi.cpp
  • WSPConnect() : spi.cpp
  • WSPDuplicateSocket() : spi.cpp
  • WSPEnumNetworkEvents() : spi.cpp
  • WSPEventSelect() : spi.cpp
  • WSPGetOverlappedResult() : spi.cpp
  • WSPGetPeerName() : spi.cpp
  • WSPGetQOSByName() : spi.cpp
  • WSPGetSockName() : spi.cpp
  • WSPGetSockOpt() : spi.cpp
  • WSPIoctl() : spi.cpp
  • WSPJoinLeaf() : spi.cpp
  • WSPListen() : spi.cpp
  • WSPRecv() : spi.cpp
  • WSPRecvDisconnect() : spi.cpp
  • WSPRecvFrom() : spi.cpp
  • WSPSelect() : spi.cpp
  • WSPSend() : spi.cpp
  • WSPSendDisconnect() : spi.cpp
  • WSPSendTo() : spi.cpp
  • WSPSetSockOpt() : spi.cpp
  • WSPShutdown() : spi.cpp
  • WSPSocket() : spi.cpp
  • WSPStartup() : spi.cpp
  • WSPStringToAddress() : spi.cpp
  • wsz_ASK_DROP_TABLE_ : common.cpp , common.h
  • wsz_BOGUS_WHERE : common.h , common.cpp
  • wsz_CANCEL : common.cpp , common.h
  • wsz_CANCEL_OP : common.cpp , common.h
  • wsz_COMMA : common.cpp , common.h
  • wsz_CONNECT_STRING_ : common.h , common.cpp
  • wsz_COPIED_RECORDS : common.cpp , common.h
  • wsz_COPY_FAILURE : common.h , common.cpp
  • wsz_COPY_SUCCESS : common.cpp , common.h
  • wsz_COPYING : common.h , common.cpp
  • wsz_CREATE_INDEX_ : common.h , common.cpp
  • wsz_CREATE_TABLE : common.cpp , common.h
  • wsz_DROP_TABLE_ : common.cpp , common.h
  • wsz_ERROR : common.h , common.cpp
  • wsz_ERRORINFO : common.h , common.cpp
  • wsz_EXCEPTION : common.cpp , common.h
  • wsz_FROM : common.cpp , common.h
  • wsz_FROMQUALTABLE_ : common.cpp , common.h
  • wsz_FROMTABLEHELP_ : common.cpp , common.h
  • wsz_INDEX_DESC : common.cpp , common.h
  • wsz_INDEX_FAILED_ : common.h , common.cpp
  • wsz_INFO : common.h , common.cpp , common.h
  • wsz_INSERT_INTO : common.h , common.cpp
  • wsz_INVALID_VALUE_ : common.h , common.cpp , common.h , common.cpp
  • wsz_LPAREN : common.h , common.cpp
  • wsz_NO_TYPE_FOUND_ : common.cpp , common.h
  • wsz_NO_TYPE_MATCH_ : common.h , common.cpp
  • wsz_NOT_CONNECTED : common.h , common.cpp
  • wsz_OLEDB : common.cpp , common.h
  • wsz_PARAM : common.h , common.cpp
  • wsz_PERIOD : common.cpp , common.h
  • wsz_PRIMARY_KEY : common.cpp , common.h
  • wsz_PROVIDER_INFO_ : common.h , common.cpp
  • wsz_READONLY_DATASOURCE_ : common.cpp , common.h
  • wsz_RPAREN : common.h , common.cpp
  • wsz_SAME_TABLE_NAME : common.h , common.cpp
  • wsz_SAMPLE_COPYRIGHT : pch.cpp , Policy.h , pch.cpp , Exit.h
  • wsz_SAMPLE_DESCRIPTION : pch.cpp , Exit.h , pch.cpp , Policy.h
  • wsz_SAMPLE_FILEVER : Policy.h , Exit.h , pch.cpp
  • wsz_SAMPLE_NAME : Exit.h , Policy.h , pch.cpp
  • wsz_SAMPLE_PRODUCTVER : pch.cpp , Policy.h , Exit.h
  • wsz_SELECT : common.cpp , common.h
  • wsz_SHOW_SQL_ : common.h , common.cpp
  • wsz_SPACE : common.cpp , common.h
  • wsz_SUCCESS : common.cpp , common.h
  • wsz_TOTABLEHELP_ : common.cpp , common.h
  • wsz_TYPEMAPPING_FAILURE : common.h , common.cpp
  • wsz_TYPES_STRING_ : common.h , common.cpp
  • wsz_UNIQUE_INDEX : common.h , common.cpp
  • wsz_VALUES_CLAUSE : common.h , common.cpp
  • wsz_WARNING : common.h , common.cpp
  • wszATTREMAIL1 : Policy.h , policy.h
  • wszATTREMAIL2 : policy.h , Policy.h
  • wszCERTENROLLSHAREPATH : CeLibW2k.h
  • wszCertFile : Exit.Cpp
  • wszCERTTYPE_CROSS_CA : policy.h
  • wszCERTTYPE_SUBORDINATE_CA : policy.h , Policy.Cpp
  • wszCLASS_CERTENCODEALTNAME : AltName.h
  • wszCLASS_CERTENCODEBITSTRING : BitStr.h
  • wszCLASS_CERTENCODECRLDISTINFO : CrlDist.h
  • wszCLASS_CERTENCODEDATEARRAY : ADate.h
  • wszCLASS_CERTENCODELONGARRAY : ALong.h
  • wszCLASS_CERTENCODESTRINGARRAY : AString.h
  • wszCLASS_CERTEXITSAMPLE : pch.cpp , Exit.h
  • wszCLASS_CERTEXITSAMPLEPREFIX : pch.cpp , Exit.h
  • wszCLASS_CERTMANAGEEXITMODULESAMPLE : pch.cpp
  • wszCLASS_CERTMANAGEPOLICYMODULESAMPLE : pch.cpp
  • wszCLASS_CERTMANAGESAMPLE : Exit.h , Policy.h
  • wszCLASS_CERTPOLICYSAMPLE : pch.cpp , Policy.h
  • wszCLASS_CERTPOLICYSAMPLEPREFIX : Policy.h , pch.cpp
  • wszCLSIDDescription : DllMain.Cpp
  • wszCOLONSPACE : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • wszCONFIG_KEY : common.h
  • wszDSSEARCHBASECRLATTRIBUTE : CeFormat.Cpp , ceformat.cpp
  • wszDSSEARCHCACERTATTRIBUTE : ceformat.cpp , CeFormat.Cpp
  • wszDSSEARCHCROSSCERTPAIRATTRIBUTE : ceformat.cpp
  • wszDSSEARCHDELTACRLATTRIBUTE : ceformat.cpp , CeFormat.Cpp
  • wszDSSEARCHKRACERTATTRIBUTE : ceformat.cpp
  • wszDSSEARCHUSERCERTATTRIBUTE : ceformat.cpp
  • wszDURATIONUNITSDAYS : CeLib.Cpp
  • wszDURATIONUNITSHOURS : CeLib.Cpp
  • wszDURATIONUNITSMINUTES : CeLib.Cpp
  • wszDURATIONUNITSMONTHS : CeLib.Cpp
  • wszDURATIONUNITSSECONDS : CeLib.Cpp
  • wszDURATIONUNITSWEEKS : CeLib.Cpp
  • wszDURATIONUNITSYEARS : CeLib.Cpp
  • wszFCSAPARM_CERTFILENAMESUFFIX : CeLibW2k.h
  • wszFCSAPARM_CONFIGDN : CeLibW2k.h
  • wszFCSAPARM_CRLDELTAFILENAMESUFFIX : CeLibW2k.h
  • wszFCSAPARM_CRLFILENAMESUFFIX : CeLibW2k.h
  • wszFCSAPARM_DOMAINDN : CeLibW2k.h
  • wszFCSAPARM_DSCACERTATTRIBUTE : CeLibW2k.h
  • wszFCSAPARM_DSCRLATTRIBUTE : CeLibW2k.h
  • wszFCSAPARM_SANITIZEDCANAME : CeLibW2k.h
  • wszFCSAPARM_SANITIZEDCANAMEHASH : CeLibW2k.h
  • wszFCSAPARM_SERVERDNSNAME : CeLibW2k.h
  • wszFCSAPARM_SERVERSHORTNAME : CeLibW2k.h
  • wszFORMATREQUESTID : policy.cpp
  • wszHTTPERRORPREFIX : ceerror.cpp , CeError.Cpp
  • wszJETERRORPREFIX : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • wszMachineName : DirEncrypt.Cpp
  • wszMDICHILD_KEY : common.h
  • wszOBJECTS_KEY : common.h
  • wszOPTIONS_KEY : common.h
  • wszOSSERRORPREFIX : ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • wszPROPVALIDITYPERIODCOUNT : Policy.Cpp
  • wszPROPVALIDITYPERIODSTRING : Policy.Cpp
  • wszRECENTCONFIG_KEY : common.h
  • wszRECENTFILE_KEY : common.h
  • wszRECENTINITSTRING_KEY : common.h
  • wszRECENTURL_KEY : common.h
  • wszREGFILEISSUERCERTURL : Policy.Cpp
  • wszREGFILEREVOCATIONCRLURL : Policy.Cpp
  • wszREGFTPISSUERCERTURL : Policy.Cpp
  • wszREGFTPREVOCATIONCRLURL : Policy.Cpp
  • wszREGISSUERCERTURL : Policy.Cpp
  • wszREGLDAPISSUERCERTURL : Policy.Cpp
  • wszREGLDAPREVOCATIONCRLURL : Policy.Cpp
  • wszREGREVOCATIONCRLURL : Policy.Cpp
  • wszROWSETVIEWER_KEY : common.h
  • wszSETUPERRORPREFIX : ceerror.cpp , CeError.Cpp
  • wszTRACE_KEY : common.h
  • wszWIN32ERRORPREFIX : CeError.Cpp , ceerror.cpp
  • WW_HEAP : tpriv.h
  • WW_OWNER : tpriv.h
  • wWndEOL : common.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- x -

  • X : Demo.c , Cursor.c
  • x : SCPProppage.cpp , GraphObj.Idl , SCPWizard.cpp , SCPCMenu.cpp , userproppage.cpp , userwizard.cpp
  • x1() : GraphObj.Idl
  • x2() : GraphObj.Idl
  • X86INT3 : Utils.c
  • X_INDENT : FullIME.h
  • XactAttributeEnum : adoint.h
  • XCHECK_HR : helper.h , prsample.h
  • xCurrent : Tools.c
  • XFORMCLASS : XForm.h
  • XFormClear() : Bounce.c
  • XFormCommandProc() : XForm.c , XForm.h
  • XFormCreateProc() : XForm.c , XForm.h
  • XFORMDATA : XForm.h
  • XFormDestroyProc() : XForm.c , XForm.h
  • XformHeightInHimetricToPixels() : site.Cpp
  • XFormPaintProc() : XForm.c , XForm.h
  • XFormPoint() : Bounce.c
  • XFormProc() : XForm.c , XForm.h
  • XFormScale() : Bounce.c
  • XFORMTITLE : GdiDemo.h
  • XFormTrans() : Bounce.c
  • XformWidthInHimetricToPixels() : site.Cpp
  • XFREE : Overlap.c
  • xfree : IocpClient.Cpp , IocpServer.Cpp , IocpServerex.Cpp
  • XLARGEBUFF : quiktest.h
  • XlatSMFErr() : SEQUENCE.c
  • XMALLOC : Overlap.c
  • xmalloc : IocpClient.Cpp , IocpServer.Cpp , IocpServerex.Cpp
  • XP_LEFT : ui.cpp , Global.h
  • xPos : Global.C , FullIME.h , Main.C
  • XTEST : common.h
  • XTEST_ : common.h
  • XTESTC : common.h
  • XTESTC_ : common.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~
Here is a list of all file members with links to the files they belong to:

- y -

  • y() : GraphObj.Idl
  • Y : Cursor.c , Demo.c
  • y1() : GraphObj.Idl
  • y2() : GraphObj.Idl
  • Y_INDENT : FullIME.h
  • YOUR_PROTOCOL_BLOCK_SIZE : loadprotocol.c
  • YOUR_PROTOCOL_ID : loadprotocol.c
  • YOUR_PROTOCOL_INFO_BLOCK_DATA : loadprotocol.c
  • YP_TOP : ui.cpp , Global.h
  • yPos : Global.C , Main.C , FullIME.h
  • yr : suminfo.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- _ -

  • _ : SysInfo.h
  • ___ADO_FWD_DEFINED__ : adoint.h
  • ___ADO_INTERFACE_DEFINED__ : adoint.h
  • ___ADOCollection_FWD_DEFINED__ : adoint.h
  • ___ADOCollection_INTERFACE_DEFINED__ : adoint.h
  • ___ADODynaCollection_FWD_DEFINED__ : adoint.h
  • ___ADODynaCollection_INTERFACE_DEFINED__ : adoint.h
  • ___Command_FWD_DEFINED__ : adoint.h
  • ___Command_INTERFACE_DEFINED__ : adoint.h
  • ___Connection_FWD_DEFINED__ : adoint.h
  • ___Connection_INTERFACE_DEFINED__ : adoint.h
  • ___Parameter_FWD_DEFINED__ : adoint.h
  • ___Parameter_INTERFACE_DEFINED__ : adoint.h
  • ___Recordset_FWD_DEFINED__ : adoint.h
  • ___Recordset_INTERFACE_DEFINED__ : adoint.h
  • __ADOConnectionConstruction_FWD_DEFINED__ : adoint.h
  • __ADOConnectionConstruction_INTERFACE_DEFINED__ : adoint.h
  • __ADODB_LIBRARY_DEFINED__ : adoint.h
  • __ADORecordsetConstruction_FWD_DEFINED__ : adoint.h
  • __ADORecordsetConstruction_INTERFACE_DEFINED__ : adoint.h
  • __ADsError_FWD_DEFINED__ : ADsError.h
  • __ADSERRORLib_LIBRARY_DEFINED__ : ADsError.h
  • __ADSFIRSTEXTLib_LIBRARY_DEFINED__ : ADsFirstExt.h
  • __ATLCONTROLLib_LIBRARY_DEFINED__ : atlcontrol.h
  • __BSTRC__DEFINED__ : policy.h
  • __Command_FWD_DEFINED__ : adoint.h
  • __COMMON_PIPE_SAMPLE__ : Common.h
  • __COMMON_STROUT__ : Common.h
  • __Connection_FWD_DEFINED__ : adoint.h
  • __Dimmer_FWD_DEFINED__ : MyDevice.h
  • __Error_FWD_DEFINED__ : adoint.h
  • __Error_INTERFACE_DEFINED__ : adoint.h
  • __Errors_FWD_DEFINED__ : adoint.h
  • __Errors_INTERFACE_DEFINED__ : adoint.h
  • __Field_FWD_DEFINED__ : adoint.h
  • __Field_INTERFACE_DEFINED__ : adoint.h
  • __Fields_FWD_DEFINED__ : adoint.h
  • __Fields_INTERFACE_DEFINED__ : adoint.h
  • __HelloWorld_FWD_DEFINED__ : ADsFirstExt.h
  • __IADsError_FWD_DEFINED__ : ADsError.h
  • __IADsError_INTERFACE_DEFINED__ : ADsError.h
  • __IApplet_FWD_DEFINED__ : iapplet.h
  • __IApplet_INTERFACE_DEFINED__ : iapplet.h
  • __IAppletNotify_FWD_DEFINED__ : iapplet.h
  • __IAppletNotify_INTERFACE_DEFINED__ : iapplet.h
  • __IAppletSession_FWD_DEFINED__ : iapplet.h
  • __IAppletSession_INTERFACE_DEFINED__ : iapplet.h
  • __IAppletSessionNotify_FWD_DEFINED__ : iapplet.h
  • __IAppletSessionNotify_INTERFACE_DEFINED__ : iapplet.h
  • __IHelloWorld_FWD_DEFINED__ : ADsFirstExt.h
  • __IHelloWorld_INTERFACE_DEFINED__ : ADsFirstExt.h
  • __IID_DEFINED__ : ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c , iapplet.c
  • __IMMCControl_FWD_DEFINED__ : atlcontrol.h
  • __IMMCControl_INTERFACE_DEFINED__ : atlcontrol.h
  • __IUPnPService_DimmingService_SCPD_FWD_DEFINED__ : MyDevice.h
  • __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__ : MyDevice.h
  • __LONGSTRING : helper.h , prsample.h
  • __m_bobj_h__ : adoint.h
  • __MMCControl_FWD_DEFINED__ : atlcontrol.h
  • __MSOmniProv_FWD_DEFINED__ : theprovider.h
  • __MYDEVICELib_LIBRARY_DEFINED__ : MyDevice.h
  • __NmApplet_FWD_DEFINED__ : iapplet.h
  • __NmApplet_LIBRARY_DEFINED__ : iapplet.h
  • __Parameter_FWD_DEFINED__ : adoint.h
  • __Parameters_FWD_DEFINED__ : adoint.h
  • __Parameters_INTERFACE_DEFINED__ : adoint.h
  • __PLG_TERMSAMPLE_IDL__ : plgtermsample.idl
  • __Properties_FWD_DEFINED__ : adoint.h
  • __Properties_INTERFACE_DEFINED__ : adoint.h
  • __Property_FWD_DEFINED__ : adoint.h
  • __Property_INTERFACE_DEFINED__ : adoint.h
  • __Recordset_FWD_DEFINED__ : adoint.h
  • __REQUIRED_RPCNDR_H_VERSION__ : theprovider.h , ADsFirstExt.h , ADsError.h , MyDevice.h , atlcontrol.h , iapplet.h
  • __REQUIRED_RPCPROXY_H_VERSION__ : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • __T : utilprop.cpp
  • __THEPROVIDERLib_LIBRARY_DEFINED__ : theprovider.h
  • __WIDESTRING : common.h
  • _ADsError_CHECK_IID : ADsError_p.c
  • _ADsFirstExt_CHECK_IID : ADsFirstExt_p.c
  • _AFXRES : afxres.h
  • _APS_NEXT_COMMAND_VALUE : Resource.h
  • _APS_NEXT_CONTROL_VALUE : Resource.h
  • _APS_NEXT_RESOURCE_VALUE : Resource.h
  • _APS_NEXT_SYMED_VALUE : Resource.h
  • _assert : assert.h
  • _ATL_APARTMENT_THREADED : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , CeapCfg.h , StdAfx.h , Stdafx.h , StdAfx.h , ClRes.h , StdAfx.h , stdafx.h , StdAfx.h
  • _ATL_DEBUG_QI : StdAfx.h , stdafx.h , Line.h
  • _ATL_DEBUG_REFCOUNT : StdAfx.h , Line.h
  • _ATL_FREE_THREADED : stdafx.h
  • _ATL_STATIC_REGISTRY : StdAfx.h
  • _BrochureMachine_CHECK_IID : BrochureMachine_p.c
  • _CRTAPI2 : assert.h
  • _DECL_DLLMAIN : Main.Cxx
  • _DLLEXPORT_ : ComObj.Cpp , ConServe.Cpp , DllServe.Cpp , DllSkel.Cpp , FreServe.Cpp , LicServe.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , StoServe.Cpp
  • _DumpStringArray : policy.h , Policy.h
  • _EDAnnotator_CHECK_IID : EDAnnotator_p.c
  • _EdCommands_CHECK_IID : EdCommands_p.c
  • _EdGlyphs_CHECK_IID : EdGlyphs_p.c
  • _EdHost_CHECK_IID : EdHost_p.c
  • _FVTEXT_H_ : FVText.h
  • _INC_OLE : SetDisp.h , Priv.h , App32.h
  • _INC_SHELLAPI : MainWND.c , MidiPlyr.c , TIMEWND.c , UIUTILS.c
  • _IOffset : Priv.h
  • _JumpError : CeLibW2k.h
  • _JumpErrorStr : CeLibW2k.h
  • _JumpIfError : CeLibW2k.h
  • _JumpIfError2 : CeLibW2k.h
  • _JumpIfErrorStr : CeLibW2k.h
  • _JumpIfErrorStr2 : CeLibW2k.h
  • _lcreat_AW : ansiapi.h
  • _LOCALCALLS_ : CRUCAR.Cpp , UtilCAR.Cpp
  • _lopen_AW : ansiapi.h
  • _MBCS : Monkey.c
  • _mqscpy : MainFrm.Cpp
  • _NOANSIMACROS_ : AppUtil.Cpp
  • _OLEIVERB_HIDE : SERVER.CPP
  • _OLEIVERB_OPEN : SERVER.CPP
  • _OLEIVERB_PRIMARY : SERVER.CPP
  • _OLEIVERB_PROPERTIES : SERVER.CPP
  • _OLEIVERB_SHOW : SERVER.CPP
  • _PrintError : CeLibW2k.h
  • _PrintError2 : CeLibW2k.h
  • _PrintErrorStr : CeLibW2k.h
  • _PrintErrorStr2 : CeLibW2k.h
  • _PrintIfError : CeLibW2k.h
  • _PrintIfError2 : CeLibW2k.h
  • _PrintIfErrorStr : CeLibW2k.h
  • _PrintIfErrorStr2 : CeLibW2k.h
  • _Render_CHECK_IID : Render_p.c
  • _T_CCF_DISPLAY_NAME : dataobj.Cpp , cMenuext.Cpp , dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp , nameext.Cpp , dataobj.Cpp , ppgeext.Cpp , dataobj.Cpp , tbarext.Cpp , dataobj.Cpp
  • _T_CCF_INTERNAL_SNAPIN : dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp
  • _T_CCF_NODETYPE : dataobj.Cpp , nameext.Cpp , dataobj.Cpp , ppgeext.Cpp , dataobj.Cpp , tbarext.Cpp , dataobj.Cpp , cMenuext.Cpp , dataobj.Cpp , Dataobj.Cpp
  • _T_CCF_OBJECT_TYPES_IN_MULTI_SELECT : dataobj.Cpp
  • _T_CCF_SNAPIN_CLASSID : dataobj.Cpp , cMenuext.Cpp , dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp , nameext.Cpp , dataobj.Cpp , ppgeext.Cpp , dataobj.Cpp , tbarext.Cpp , dataobj.Cpp
  • _T_CCF_SZNODETYPE : dataobj.Cpp , Dataobj.Cpp , dataobj.Cpp
  • _tcerr : HeadDump.cpp
  • _tcin : HeadDump.cpp
  • _tcout : HeadDump.cpp
  • _TEXT : utilprop.cpp
  • _UNICODE : main.hxx , DLEdit.Cpp , bits_ie.cpp , ClRes.h , BasicHiPerf.Cpp , SuperUsr.cpp , SecPrint.c , main.hxx , StdAfx.h , Security.Cpp , stgcreatepropsetstg.cpp , writeread.cpp , propdump.cpp , unicode.h , StdAfx.h , SubAuth.c , KList.c , MyToken.cpp , Main.Cpp , Privobji.Cpp , RSAKey.cpp , LogonNP.c , BasicHiPerf.h , StdAfx.h , ClRes.h , StdAfx.h , app.cpp , SignHash.cpp , Factory.Cpp
  • _WIN32_DCOM : common.h , main.cpp , MethProv.Cpp , ADSIhelpers.cpp , main.cpp , UserProps.cpp , main.cpp , PreComp.h , EnumerateKeys.cpp , ADSIhelpers.cpp , common.h , CreateUserHelpers.cpp
  • _WIN32_WINDOWS : sendto.h
  • _WIN32_WINNT : Consumer.Cpp , StdAfx.h , otherwko1.cpp , StdAfx.h , wkguid.cpp , PreComp.h , StdAfx.h , UpCaseMap.cpp , SessionKey.cpp , ADSIhelpers.cpp , AdvReco.cpp , ChildWnds.cpp , StdAfx.h , HelloIsapi.cpp , objectSid.cpp , StdAfx.h , BasicHiPerf.Cpp , StdAfx.h , Extension.cpp , StdAfx.h , stdafx.h , StdAfx.h , PropProv.Cpp , stdafx.h , StdAfx.h , ChildWnds.cpp , RasEnumentries.c , stdafx.h , StdAfx.h , PreComp.h , SamplCli.Cpp , PropCert.Cpp , StdAfx.h , EvProv.Cpp , StdAfx.h , GinaStub.c , StdAfx.h , GinaHook.c , stdafx.h , InvokObjThreads.cpp , StdAfx.h , stdafx.h , ClRes.h , StdAfx.h , stdafx.h , StdAfx.h , InstProv.Cpp , PoolWrap.cpp , IsapiExtension.cpp , StdAfx.h , FaxSiren.Cpp , StdAfx.h , Redir401.cpp , Cancel.Cpp , ComPerf.Cpp , customentry.c , stdafx.h , StdAfx.h , stdafx.h , queryusers.cpp , StdAfx.h , DumpRequestInfo.cpp , StdAfx.h , PreComp.h , stdafx.h , getschemainfo.cpp , MultiReco.cpp , RasDial.c , iasuser.cpp , StdAfx.h , Extension.cpp , StdAfx.h , SignHash.cpp , StdAfx.h , RSAKey.cpp , stdafx.h , StdAfx.h , QueryParser.cpp , stdafx.h , StdAfx.h , SServer.Cpp , Stdafx.h , StdAfx.h , RasEnumDevices.c , RasGetConnectionStatistics.c , otherwko.cpp , ClRes.h , StdAfx.h , RasEnumConnections.c , RasDialAsync.c , WildCardMap.cpp , stdafx.h , StdAfx.h , GinaDlg.c , stdafx.h , StdAfx.h , SuperUsr.cpp , Common.h , SServer.Cpp
  • _WINSOCKAPI_ : Stack.h , Dt_Dll.Cpp , DtHandler.Hpp , Handlers.Cpp , Nideque.h , CStack.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- j -

  • JETERROR_FROM_HRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp
  • JOB_RECEIVE : NewFsp.h
  • JOB_SEND : NewFsp.h
  • JOB_UNKNOWN : NewFsp.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- k -

  • KEY_USAGE_SIZE : CreateCert.c
  • KEYLENGTH : Decrypt.c , Encrypt.c
  • KEYQUAL : UtilLib.h
  • KF_EMPTY : SMF.c
  • KRB5_CALLCONV : GssAPI.h
  • KRB5_CALLCONV_C : GssAPI.h
  • KRB5_DLLIMP : GssAPI.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- l -

  • L_MATCH_START : sdkdiff.h
  • L_MATCH_WIDTH : sdkdiff.h
  • L_POS_START : sdkdiff.h
  • L_POS_WIDTH : sdkdiff.h
  • L_UNMATCH_START : sdkdiff.h
  • L_UNMATCH_WIDTH : sdkdiff.h
  • LABEL_BUFFER_SIZE : app.cpp
  • LANGBAR_ITEM_DESC : globals.h
  • LARGEBUFF : quiktest.h
  • LARGENUMBER : utils.cpp
  • LAST_ROW_FETCHED : cdbfile.h
  • LASTCOL : FullIME.h , HalfIME.h
  • LASTROW : HalfIME.h , FullIME.h
  • LB2 : MousInfo.h
  • LB_ADDSTRING : winres.h
  • LBD : MousInfo.h
  • LBS_DISABLENOSCROLL : winres.h
  • LBS_EXTENDEDSEL : winres.h
  • LBS_HASSTRINGS : winres.h
  • LBS_MULTICOLUMN : winres.h
  • LBS_MULTIPLESEL : winres.h
  • LBS_NOINTEGRALHEIGHT : winres.h
  • LBS_NOREDRAW : winres.h
  • LBS_NOTIFY : winres.h
  • LBS_OWNERDRAWFIXED : winres.h
  • LBS_OWNERDRAWVARIABLE : winres.h
  • LBS_SORT : winres.h
  • LBS_STANDARD : winres.h
  • LBS_USETABSTOPS : winres.h
  • LBS_WANTKEYBOARDINPUT : winres.h
  • LBU : MousInfo.h
  • LcbDiskFreeSpace : wn_dos.h
  • LD_SOCKET : Globals.h
  • LD_STATUS : Globals.h
  • LDAP_PROV : attributes.cpp
  • LDM_CONNECTED : Globals.h
  • LEAK_TIMER : LeakyBin.h
  • LEAVE_SAMPLE_API : defs.h
  • LEAVE_SAMPLE_WORKER : defs.h
  • LEFT : Rebar.c
  • LENGTH_IS_BOUND : common.h
  • LENGTH_OFFSET : spy.cpp
  • lenof : FindStream.c
  • LESSTHAN : common.h
  • LF_DISCARD : line.cpp
  • LF_HASHVALID : line.cpp
  • LFSIZE : Font.c
  • LICENSE_EXT_STR : Server.h
  • LICENSE_FILE_EXT : AppUtil.h
  • LICSERVE_TUTFILE_STR : LicClien.h
  • LIGHTGRAY : MfEdit.h
  • LINE_LEN : Client32.h , Server32.h , Monkey.h
  • LINECONFIG_SIZE : Atsp.c
  • LINENOTUSEABLE_ALLOCATED : TapiCode.c
  • LINENOTUSEABLE_ERROR : TapiCode.c
  • LINENOTUSEABLE_INUSE : TapiCode.c
  • LINENOTUSEABLE_NOCOMMDATAMODEM : TapiCode.c
  • LINENOTUSEABLE_NODATAMODEM : TapiCode.c
  • LINENOTUSEABLE_NOMAKECALL : TapiCode.c
  • LINENOTUSEABLE_NOVOICE : TapiCode.c
  • LINENUMBER_OFFSET : spy.cpp
  • LINETO : Common.h
  • LIST_ERROR_DEREFERENCE_NULL : LinkList.h
  • LIST_ERROR_NO_FREE_MEM : LinkList.h
  • LIST_ERROR_NO_MATCH : LinkList.h
  • LIST_ERROR_NO_NODE : LinkList.h
  • LIST_LEFT_OF : LinkList.h
  • LIST_MATCH : LinkList.h
  • LIST_NO_ERROR : LinkList.h
  • LIST_REORDER_THRESHOLD : cache.c
  • List_REVERSETRAVERSE : list.h
  • LIST_RIGHT_OF : LinkList.h
  • List_TRAVERSE : list.h
  • ListView_GetCheckState : AdvReco.cpp
  • ListView_SetCheckState : selectEventsDlg.Cpp , AdvReco.cpp
  • LO_BYTE : parser.h
  • LOCAL_CREATE_ERR_STR : DComDraw.h
  • LOCKED_LIST_INITIALIZED : sync.h
  • LOCKED_QUEUE : sync.h
  • LOCKED_QUEUE_INITIALIZED : sync.h
  • LOCKSTORE : defs.h
  • LODWORD : sdksamplestoragesystem.h
  • LOG : AppUtil.h , keys.cpp
  • LOG_DEBUG : Perfmsg.h
  • LOG_MAX_LINE : PoolWrap.cpp
  • LOG_MSG : Global.h
  • LOG_NONE : Perfmsg.h
  • LOG_STATUS_REPORT : Common.h
  • LOG_STATUS_REPORT_MINOR : Common.h
  • LOG_STATUS_REPORT_MINOR_STRING : Common.h
  • LOG_STATUS_REPORT_STRING : Common.h
  • LOG_STATUS_REPORT_STRING2 : Common.h
  • LOG_STATUS_REPORT_STRING3 : Common.h
  • LOG_STATUS_REPORT_STRING4 : Common.h
  • LOG_USER : Perfmsg.h
  • LOG_VERBOSE : Perfmsg.h
  • LOGASSERT : AppUtil.h
  • LOGERR : defs.h
  • LOGERR0 : defs.h
  • LOGERR1 : defs.h
  • LOGERR2 : defs.h
  • LOGERR3 : defs.h
  • LOGERR4 : defs.h
  • LogError : common.h
  • LOGERROR : AppUtil.h
  • LogError : adoisapi.cpp , common.h , tapisend.cpp
  • LOGF1 : AppUtil.h
  • LOGF2 : AppUtil.h
  • LOGF3 : AppUtil.h
  • LOGFILE : SubAuth.c
  • LOGHANDLE : defs.h
  • LOGID : AppUtil.h
  • LOGINFO : defs.h
  • LOGINFO0 : defs.h
  • LOGINFO1 : defs.h
  • LOGINFO2 : defs.h
  • LOGINFO3 : defs.h
  • LOGINFO4 : defs.h
  • LOGLEVEL : defs.h
  • LOGNAME : log.c , FaxSiren.Cpp
  • LOGOFF : Global.h
  • LOGOFF_PAGE : CustomAuth.h
  • LOGON : Global.h
  • LOGON_PAGE : CustomAuth.h
  • LOGSAMPVER : log.c
  • LOGSOURCE : log.c
  • LOGWARN : defs.h
  • LOGWARN0 : defs.h
  • LOGWARN1 : defs.h
  • LOGWARN2 : defs.h
  • LOGWARN3 : defs.h
  • LOGWARN4 : defs.h
  • LOGWARNDATA : defs.h
  • LOGWARNDATA2 : defs.h
  • LONG2POINT : Menu.h , Mypal.h
  • LONGSTRING : prsample.h , helper.h
  • LOOPCOUNT : FreeTest.Cpp , ComSyncTest.Cpp , STATest.Cpp
  • LOOPS : ComPerf.Cpp
  • LPMYIMEMENUITEMINFO : Wapi.h
  • lpNil : Global.h
  • LPTSTR : APP.h
  • LPVOID : suminfo.Cpp
  • LSP_OP_ACCEPTEX : provider.h
  • LSP_OP_CONNECTEX : provider.h
  • LSP_OP_DISCONNECTEX : provider.h
  • LSP_OP_IOCTL : provider.h
  • LSP_OP_RECV : provider.h
  • LSP_OP_RECVFROM : provider.h
  • LSP_OP_SEND : provider.h
  • LSP_OP_SENDTO : provider.h
  • LSP_OP_TRANSMITFILE : provider.h
  • LSP_OP_TRANSMITPACKETS : provider.h
  • LSP_OP_WSARECVMSG : provider.h
  • LSTRCPYN : OleStd.h
  • lstrcpyW : Helper.h
  • lstrncat : DoServer.h , AppUtil.h
  • LV_ALLITEMS : common.h
  • LV_ALLSELITEMS : common.h
  • LVM_ERR : winmain.h , common.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- m -

  • MACHINE_NAME : log.c
  • MACRO_AbortCleanup : keys.cpp
  • MAIN_APP_NAME_STR : RESDEF.h , StoClien.h , DComDraw.h
  • MAIN_CLASS_NAME : Common.h
  • MAIN_CLASS_STYLE : Common.h
  • MAIN_ICON : Resource.h
  • MAIN_KEY_STRING : Utility.Cpp
  • MAIN_MENU_NAME : Common.h
  • MAIN_WINDOW_CLASS_MENU : DfV.h
  • MAIN_WINDOW_CLASS_MENU_STR : ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , DfV.h , LocClien.h , LocServe.h , AptClien.h , RESDEF.h , RemClien.h , AptServe.h , StoClien.h , ComUser.h
  • MAIN_WINDOW_CLASS_NAME : DfV.h
  • MAIN_WINDOW_CLASS_NAME_STR : ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , LocServe.h , RESDEF.h , RemClien.h , StoClien.h , AptClien.h , AptServe.h
  • MAIN_WINDOW_MASTER_STR : DComDraw.h
  • MAIN_WINDOW_SLAVE_STR : DComDraw.h
  • MAIN_WINDOW_TITLE_STR : AptClien.h , AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , LocServe.h , RESDEF.h , RemClien.h , StoClien.h
  • MAIN_WND_STYLE : Common.h
  • MAIN_WND_TITLE : Common.h
  • MAKE_STR_LOCAL_COPYA2W : ansiapi.h
  • MAKE_STR_LOCAL_COPYW2A : ansiapi.h
  • MAKE_TSTRPTR_FROMWIDE : globals.h , Globals.h , globals.h
  • MAKE_WIDEPTR_FROMTSTR : globals.h , Globals.h , globals.h
  • MAKE_WIDEPTR_FROMTSTR_ALLOC : globals.h , Globals.h , globals.h
  • MAKEADSENTRY : StdAfx.h
  • MAKEDWORDLONG : Cleanup.h
  • MAKEINTI : SERVER.CPP
  • MAKEINTS1 : SERVER.CPP
  • MAKEINTS2 : SERVER.CPP
  • MAKEINTVERB : SERVER.CPP
  • MAKEMPOINT : Select.h
  • MAKEQWORD : sdksamplestoragesystem.h
  • MAKEULONGLONG : sdksamplestoragesystem.h
  • MAKEVERSION : cfactory.h , SERVER.CPP
  • MALLOC : dballoc.Cpp , defs.h , PropCert.Cpp
  • Malloc : ATMEvent.h
  • MAP_LOGHIM_TO_PIX : OleStd.h , site.Cpp
  • MAP_PIX_TO_LOGHIM : OleStd.h
  • MapCarList : list.h
  • MapCarQueue : list.h
  • MapCarStack : list.h
  • MARK_DESC : globals.h
  • MARK_DESC_A : globals.h
  • MARK_ICON_INDEX : globals.h
  • MARK_LANGBARITEMSINK_COOKIE : langbar.cpp
  • MARK_LANGID : globals.h
  • MARK_MODEL : globals.h
  • MARSHAL_TUTFILE_STR : AptClien.h , DComDraw.h , LocClien.h , RemClien.h
  • MASK_bACCESS : wn_dos.h
  • MASK_bSHARE : wn_dos.h
  • MASK_CLIENT_ACCESS_BIND : Service.cpp , EvProv.Cpp
  • MASK_fINH : wn_dos.h
  • MASKROOT : Grid.Hxx
  • MATCH_DEFAULT : table.cpp
  • MATCH_EXACT : table.cpp
  • MATCH_SIZE : table.cpp
  • MATCH_TYPE : table.cpp
  • MATERIAL_COL : people.Cpp
  • MAX : sampprov.h , defs.h , instlsp.cpp
  • MAX_ADDLEN : Bcast.c
  • MAX_ADS_ENUM : enum.cxx
  • MAX_ADS_FILTERS : enum.cxx
  • MAX_ADSPATH_CHARS : Main.cpp
  • MAX_ALLOWED_ENTITY_SIZE : DumpRequestInfo.cpp
  • MAX_ALLOWED_REQUEST_ENTITY : UpCaseMap.cpp
  • MAX_APPNAME_SIZE : selectEventsDlg.Cpp
  • MAX_ARRAYSIZE : MfEdit.h
  • MAX_ASYNC_RETRIES : asyncselect.cpp
  • MAX_ATM_INTERFACE_LEN : ATMEvent.h
  • MAX_ATTRIBS : main.cpp
  • MAX_ATTRIBUTES : Enumprt.h
  • MAX_BEZIER : Poly.h
  • MAX_BIND_ARRAY_ELEMENT : quiktest.h
  • MAX_BIND_ELEMENTS : quiktest.h
  • MAX_BIND_LEN : sampprov.h
  • MAX_BINDINGS : sampclnt.h
  • MAX_BLOCK_SIZE : common.h , tablecopy.h , common.h
  • MAX_BRUSHSTYLES : Printer.h
  • MAX_BUF_SIZE : PhoneEntry.c , areadcli.c
  • MAX_BUFF_SIZE : IocpServer.h
  • MAX_BUFFER : MqTestOA.Cpp , MSMQTest.c , formdump.cpp
  • MAX_BUFFER_LEN : WSnmpUtil.h
  • MAX_BUFFER_SIZE : Pipeproc.c , util.h , ftrans.c , fwasync.c , fwrite.c
  • MAX_BUFFERED_RESPONSE_SIZE : DumpRequestInfo.cpp
  • MAX_BUTTONTEXT_LEN : ShortName.h , Cleanup.h
  • MAX_CACHED_USERS : cache.c
  • MAX_CBFMT : TIMEWND.c
  • MAX_CHARS_PER_LINE : FullIME.h
  • MAX_CLIENTS : common.h
  • MAX_CLIP_CAPS : Getcaps.h
  • MAX_CMD_ARGS : cmsample.cpp
  • MAX_COL_DIST : MfEdit.h
  • MAX_COL_SIZE : prsample.h , common.h , tablecopy.h
  • MAX_COLOR : Enumprt.h
  • MAX_COLOR_FORMAT : MDIChild.C
  • MAX_COLUMN_LIST_SIZE : quiktest.h
  • MAX_COLUMN_NAME_SIZE : quiktest.h
  • MAX_COLUMNS : fileio.h
  • MAX_COLUMNSIZE : crow.h
  • MAX_COMP_STRING_LEN : FullIME.h
  • MAX_COMPOSITIONS : tsfedit.h
  • MAX_CONCURRENT_IO : UnBufCp1.c , UnBufCp2.c
  • MAX_CONFIG_LINE : Redir401.cpp , ReMapUrl.cpp
  • MAX_COUNT : adoheader.h
  • MAX_CRL_PROP : exit.cpp , Exit.Cpp
  • MAX_CURVE_CAPS : Getcaps.h
  • MAX_DATA : PidlMgr.h
  • MAX_DATA_LEN : Monkey.h
  • MAX_DATA_SIZE : quiktest.h
  • MAX_DEBUG_OUTPUT : IsapiDebug.h
  • MAX_DEBUGSTR : customentry.c
  • MAX_DEFAULTSOURCE : Enumprt.h
  • MAX_DEPTH : AsyncIO.h
  • MAX_DESC_BUF : quiktest.h
  • MAX_DESCRIPTION_LEN : ShortName.h , Cleanup.h
  • MAX_DEV_NAME_LENGTH : Atsp.h
  • MAX_DEVICE_CAPS : Getcaps.h
  • MAX_DISPLAY_LEN : ShortName.h , Cleanup.h
  • MAX_DISPLAY_SIZE : prsample.h
  • MAX_DTCODE : Dt_Dll.h , Dt_Dll.Hpp
  • MAX_DUPLEX : Enumprt.h
  • MAX_ELEMENTS : Xmitc.c , Repasc.c
  • MAX_ENTRY_SIZE_NOMSG : Prof.cpp , prof.cpp
  • MAX_ENUMERATORS : BasicHiPerf.h
  • MAX_ERR_STRING : MfEdit.h
  • MAX_ERROR_SIZE : quiktest.h
  • MAX_FIELD : quiktest.h
  • MAX_FIELD_DATA_SIZE : limits.h
  • MAX_FIELDS : Enumprt.h
  • MAX_FILE : MfEdit.h
  • MAX_FILEPATH : MidiPlyr.h
  • MAX_FORMAT : MqTrans.Cpp , MSMQTest.c
  • MAX_FORMAT_NAME_LEN : DrawDlg.Cpp , drawdlg.cpp
  • MAX_FORMAT_STRINGS : dbh.cpp
  • MAX_FP : Dt.h
  • MAX_FRAME : MfEdit.h
  • MAX_GETBLK_OIDS : WSnmpUtil.h
  • MAX_GRAPHICS : Common.h
  • MAX_GUID_STRING : sampclnt.h
  • MAX_GUID_STRING_LEN : WiaWrap.cpp
  • MAX_GUID_STRING_LENGTH : util.h
  • MAX_GUIDSTR_LEN : Common.h
  • MAX_HASH : ssl.c
  • MAX_HEAP_SIZE : sampprov.h
  • MAX_IBUFFER_SIZE : sampprov.h
  • MAX_ICON_HEIGHT : IconPRO.h
  • MAX_ICON_WIDTH : IconPRO.h
  • MAX_INPUT_BUFFER : fileio.h , myospobject.h
  • MAX_INSERT_VALUES_SIZE : quiktest.h
  • MAX_INSTANCES : BasicHiPerf.h
  • MAX_IO_PEND : Overlap.c
  • MAX_IP_SIZE : parser.h
  • MAX_KEY_NAME_LENGTH : keys.cpp
  • MAX_KEYWORD_LEN : autotest.h
  • MAX_LENGTH_GUID : setup.h
  • MAX_LICENSEKEY : Server.h
  • MAX_LINE_CAPS : Getcaps.h
  • MAX_LINE_CHARS : AppUtil.h
  • MAX_LINE_LENGTH : gutils.h
  • MAX_LINE_NUM : AppUtil.h
  • MAX_LISTCAND : FullIME.h
  • MAX_LOADSTRING : EventSink.cpp
  • MAX_LOG_LINES : AppUtil.h
  • MAX_LOGONS : Security.Cpp
  • MAX_LONG : msptrmac.cpp
  • MAX_MAP_MODES : Printer.h
  • MAX_MEMBERS : precomp.h
  • MAX_MESSAGES : MsgTest.c
  • MAX_MODES : SetDisp.h
  • MAX_MSG_BODY_LEN : DrawArea.h , drawarea.h
  • MAX_MSG_BUF_SIZE : errors.c
  • MAX_MSG_LENGTH : ComSpy.Cpp , log.c , MsgTest.c
  • MAX_MSG_SIZE : KList.c , SecFile.c
  • MAX_MSGLEN : Bcast.c
  • MAX_MSLOTNAME : Bcast.c
  • MAX_NAME : Security.Cpp , PidlMgr.h
  • MAX_NAME_LEN : prsample.h , common.h , tablecopy.h , common.h , basenode.h
  • MAX_NAME_STRING : sampclnt.h
  • MAX_NOSERVICE_PER_DEVICE : DimmerDeviceDCO.h , Dimmer.h
  • MAX_NUM_BUFFER : quiktest.h
  • MAX_NUM_FORMAT : DataObj.h
  • MAX_OBJECT_PATH : globals.h
  • MAX_OPENROWS : common.h
  • MAX_ORIENTATION : Enumprt.h
  • MAX_OUTPUT_BUFFER : myospobject.h
  • MAX_PACKET : rawudp.c
  • MAX_PACKET_FRAGMENTS : rawudp.c
  • MAX_PACKET_LENGTH : defs.h
  • MAX_PAPERSIZE : Enumprt.h
  • MAX_PARAM_SIZE : quiktest.h
  • MAX_PASSWORD : Security.Cpp
  • MAX_PATH : ComDlg32.h
  • MAX_PATH_LEN : NewFsp.h
  • MAX_PENSTYLES : Printer.h
  • MAX_PENWIDTHS : Printer.h
  • MAX_PID_DIGITS : SuperUsr.cpp
  • MAX_PIPE_INSTANCES : Server32.h
  • MAX_POINTS : MfEdit.h
  • MAX_POINTS_BMP : MfEdit.h
  • MAX_POINTS_MF : MfEdit.h
  • MAX_POINTS_PER_FACET : Paint.h
  • MAX_POLYGON_CAPS : Getcaps.h
  • MAX_PREFIX : quiktest.h
  • MAX_PRINTQUALITY : Enumprt.h
  • MAX_PRIORITIES : Enumprt.h
  • MAX_PROC_COUNT : overlap.cpp
  • MAX_PROVIDERS : instlsp.cpp
  • MAX_Q_FORMATNAME_LEN : MqApiTst.h
  • MAX_Q_PATHNAME_LEN : MqApiTst.h
  • MAX_QUERY_LEN : common.h , sampprov.h , tablecopy.h
  • MAX_QUERY_SIZE : quiktest.h
  • MAX_RASTER_CAPS : Getcaps.h
  • MAX_REC_TIME : CallNot.h
  • MAX_RECENT_FILENAME : MainDlg.Cpp
  • MAX_RECENT_FILES : MainDlg.Cpp
  • MAX_RECENTCONFIGS : cdialog.h
  • MAX_RECENTFILES : cdialog.h
  • MAX_RECORD_SIZE : cdbfile.h
  • MAX_RECV_BUF_LEN : Ping.cpp
  • MAX_RESTRICTIONS : cdialog.h
  • MAX_ROW_ITEM_LIMIT : quiktest.h
  • MAX_ROWS : prsample.h
  • MAX_RTCTIMEOUT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • MAX_SEARCH_PREF : DirectorySearch.h
  • MAX_SHOW_LINES : ListWIN.h
  • MAX_SIZE : strmHelp.Cxx
  • MAX_SIZEOF_INSTANCE_NAME : AppMemi.h
  • MAX_SLIDE_INDEX : main.cpp
  • MAX_SNOOP_TEXT : snoop.h
  • MAX_STATUS : Enumprt.h
  • MAX_STR : dbh.cpp , global.h
  • MAX_STR_CAPTION : setupui.h
  • MAX_STR_LENGTH : setup.h
  • MAX_STREAM_BLOCK_SIZE : tablecopy.h
  • MAX_STRING : bits_ie.cpp , ReadTut.h , register.h , StdAfx.h
  • MAX_STRING_LEN : TestMIB.h
  • MAX_STRING_LENGTH : AppUtil.h , message.h , AppUtil.h , Reg.h
  • MAX_STRING_SIZE : quiktest.h
  • MAX_STRLEN : IPStat.h , enablerouter.c
  • MAX_SUFFIX : quiktest.h
  • MAX_SZ : ui.cpp
  • MAX_TABLE_NAME : quiktest.h
  • MAX_TABLE_NAME_SIZE : cdbfile.h
  • MAX_TECHNOLOGY_CAPS : Getcaps.h
  • MAX_TEXT_CAPS : Getcaps.h
  • MAX_TEXT_SIZE : TextWIN.h
  • MAX_THREADS : Utils.c , DebugHandler.Cpp
  • MAX_TICKS : SMF.h
  • MAX_TITLE_LEN : MousInfo.h
  • MAX_TOTAL_ROWBUFF_SIZE : sampprov.h
  • MAX_TYPE_NAME : quiktest.h
  • MAX_TYPES_SUPPORTED : quiktest.h
  • MAX_ULONG_STR : main.c
  • MAX_USER_INFO : autotest.h
  • MAX_USER_NAME : OleImp.Cpp
  • MAX_USERNAME_LEN : DisDraw.Cpp , mqfdraw.cpp
  • MAX_VALUE_NAME : Monkey.h
  • MAX_VAR : mqfdraw.cpp , DrawDlg.Cpp , MqApiTst.h , logindlg.cpp , MqTestOA.Cpp , MqTrans.Cpp , MSMQTest.c
  • MAX_VAR_NAME : DumpRequestInfo.cpp
  • MAX_VERB : ContMenu.Cpp
  • MAX_WIDE_BUFFER : myospobject.h
  • MAX_WORKER_THREAD : IocpServer.h
  • MAX_XML_STRING : StdAfx.h
  • MAXBUF : Open.h
  • MAXBUFSIZE : Dialer.h
  • MAXCHARS : PlgBlt.h , WxForm.h
  • MAXCLIENTS : Receiver.Cpp
  • MAXCOL : HalfIME.h , FullIME.h
  • MAXCTRLS : Tools.c
  • MAXCUSTFILTER : Open.h
  • MAXDEPTH : fulldrag.c
  • MAXDISPLAYSIZE : EDITCTLS.c
  • MAXENTITYSTRLEN : WSnmpUtil.h
  • MAXEVENTITEMS : WaitSystemDlg.h
  • MAXFILENAMELEN : Dlgopen.c
  • MAXFILLPOINTS : Fx.h
  • MAXFILTERS : Open.h
  • MAXFLUSH : autotest.h
  • MAXGUIDESEGMENTS : GuidE.h
  • MAXHOSTNAMELENGTH : x224.h
  • MAXIMUM_LOGGERS : TraceLog.c
  • MAXIMUM_WORKER_THREADS : AsyncIO.h
  • MAXINDEX : MainFrm.Cpp
  • MAXINPUTSIZE : EDITCTLS.c
  • MAXINTS : suminfo.h
  • MAXITOA : UtilLib.h
  • MAXLINE_SIZE : ListWIN.h
  • MAXLOGFILES : tracedmp.h
  • MAXLOGST : AppUtil.h
  • MAXNUMLEN : Imp_Dlg.h
  • MAXNUMLENGTH : Dialer.h
  • MAXOUTPUTSTRINGLENGTH : TapiInfo.c
  • MAXPROPS : tracedmp.h
  • MAXQUERYITEMS : QueryDlg.h
  • MAXROW : FullIME.h , HalfIME.h
  • MAXSDWORD : quiktest.h
  • MAXSHUTDOWNITEMS : ShutdownDlg.h
  • MAXSIZE_STR : MultiUI.h
  • MAXSTATUS : Status.c
  • MAXSTDZ : suminfo.h
  • MAXSTR : TraceDp.c , tracedmp.h , TraceLog.c
  • MAXTHREADS : IocpClient.Cpp
  • MAXTIME : suminfo.h
  • MAXTITLE : Title.c
  • MAXTYPE : tracedmp.h
  • MAXUDWORD : quiktest.h
  • MAXWORD : suminfo.h
  • MAZECLASS : Maze.h
  • MAZETITLE : GdiDemo.h
  • MB2 : MousInfo.h
  • MBCS : main.cpp
  • MBD : MousInfo.h
  • MBERROR : Grid.Cxx
  • MBERRORFLAGS : Grid.Cxx
  • MBU : MousInfo.h
  • MCASTADDRV4 : Mcastws1.c , Mcastws2.c
  • MCASTADDRV6 : Mcastws1.c , Mcastws2.c
  • MCASTPORT : Mcastws2.c , Mcastws1.c
  • MCIPLAY_APP_CLASS : MciPlay.c
  • MCIPLAY_DOC_CLASS : MciPlay.c
  • MEASUREITEMHEIGHT : Menu.h
  • MEASUREITEMWIDTH : Menu.h
  • MEDBUFF : quiktest.h
  • MEM_ALLOC_THRESHOLD : areadcli.c
  • MemAllocMacro : Macros.h
  • MEMCMP : dballoc.Cpp
  • MEMCPY : dballoc.Cpp
  • MemFreeMacro : Macros.h
  • MemInitializeMacro : Macros.h
  • MemReAllocMacro : Macros.h
  • MEMSET : dballoc.Cpp
  • MENU_ABOUT : MciPlay.h
  • MENU_CHOICE : Dialer.h
  • MENU_CLOSE : MciPlay.h
  • MENU_EXIT : MciPlay.h
  • MENU_FLIPKEYS_INDEX : langbar.cpp
  • MENU_MAX : ShlView.Cpp
  • MENU_NEW : MciPlay.h
  • MENU_OPEN : MciPlay.h
  • MENU_SHOWSNOOP_INDEX : langbar.cpp
  • MENUHACK : STATBAR.c
  • MESSAGE_LEVEL_DEFAULT : Perfmsg.h
  • MESSAGE_SIZE : SampSSP.H
  • MessageBoxA : altassrt.Cxx
  • META32_SIGNATURE : MfEdit.h
  • MH : MousInfo.h
  • MIB_ACCESS_READ : TestMIB.h
  • MIB_ACCESS_READWRITE : TestMIB.h
  • MIB_ACCESS_WRITE : TestMIB.h
  • MIB_ACTION_GET : TestMIB.h
  • MIB_ACTION_GETNEXT : TestMIB.h
  • MIB_ACTION_SET : TestMIB.h
  • MIB_PREFIX_LEN : TestMIB.h
  • MIB_TOASTER_BURNT : TestMIB.h
  • MIB_TOASTER_DOWN : TestMIB.h
  • MIB_TOASTER_LIGHTLYWARM : TestMIB.h
  • MIB_TOASTER_OTHERBREAD : TestMIB.h
  • MIB_TOASTER_UP : TestMIB.h
  • MIB_TOASTER_WHITEBREAD : TestMIB.h
  • MID_DEAD : Server32.h
  • MID_LIVE : Server32.h
  • MIDI_CHANPRESSURE : SMFI.h
  • MIDI_CONTROLCHANGE : SMFI.h
  • MIDI_DEFAULT_TEMPO : SMFI.h
  • MIDI_META : SMFI.h
  • MIDI_META_EOT : SMFI.h
  • MIDI_META_KEYSIG : SMFI.h
  • MIDI_META_SEQSPECIFIC : SMFI.h
  • MIDI_META_TEMPO : SMFI.h
  • MIDI_META_TIMESIG : SMFI.h
  • MIDI_META_TRACKNAME : SMFI.h
  • MIDI_MSG : SMFI.h
  • MIDI_NOTEOFF : SMFI.h
  • MIDI_NOTEON : SMFI.h
  • MIDI_PITCHBEND : SMFI.h
  • MIDI_POLYPRESSURE : SMFI.h
  • MIDI_PROGRAMCHANGE : SMFI.h
  • MIDI_SYSEX : SMFI.h
  • MIDI_SYSEXEND : SMFI.h
  • MIIM_FTYPE : AdvReco.cpp
  • MIIM_STRING : AdvReco.cpp
  • MILLISECONDS_PER_WEEK : SubAuth.c
  • MIN : sampprov.h , defs.h , FontView.c , instlsp.cpp
  • MIN_DISPLAY_SIZE : prsample.h
  • MIN_FREQUENCY : SetDisp.h
  • MIN_HEIGHT : DebMain.c
  • MIN_ICON_HEIGHT : IconPRO.h
  • MIN_ICON_WIDTH : IconPRO.h
  • MIN_INDEX : TIMEWND.c
  • MIN_IP_HDR_SIZE : parser.h
  • MIN_SEP_INDEX : TIMEWND.c
  • MIN_SIZE : enumdesk.cpp
  • MIN_SIZE_X : ExplrBar.h
  • MIN_SIZE_Y : ExplrBar.h
  • MIN_WIDTH : SetDisp.h
  • MINIMUM_SUPPORTED_MSI_VERSION : setup.h
  • MINSDWORD : quiktest.h
  • MINVARBINDLEN : WSnmpUtil.h
  • ML : MousInfo.h
  • MM_ABOUT : MfEdit.h
  • MM_BRUSH : MfEdit.h
  • MM_C_BEGIN_GP : MfEdit.h
  • MM_C_END_GP : MfEdit.h
  • MM_C_MLTFMTS : MfEdit.h
  • MM_C_WND_MF : MfEdit.h
  • MM_COPY : MfEdit.h
  • MM_CUT : MfEdit.h
  • MM_DECREASE : MfEdit.h
  • MM_DEL : MfEdit.h
  • MM_EXPORT_3X : MfEdit.h
  • MM_FIT2WND : MfEdit.h
  • MM_FONT : MfEdit.h
  • MM_HITTEST : MfEdit.h
  • MM_IMPORT_3X : MfEdit.h
  • MM_INCREASE : MfEdit.h
  • MM_INSERT : MfEdit.h
  • MM_LEABOUT : MfEdit.h
  • MM_LOAD : MfEdit.h
  • MM_LOAD_BMP : MfEdit.h
  • MM_LOAD_MASKBMP : MfEdit.h
  • MM_NORMAL : MfEdit.h
  • MM_PAGESETUP : MfEdit.h
  • MM_PASTE : MfEdit.h
  • MM_PEN : MfEdit.h
  • MM_PRINT : MfEdit.h
  • MM_PRINTSETUP : MfEdit.h
  • MM_RECORD : MfEdit.h
  • MM_REMOVE : MfEdit.h
  • MM_REPEAT : MfEdit.h
  • MM_SAVE_BMP : MfEdit.h
  • MM_TTOUTLN_POLYDRAW : MfEdit.h
  • MM_TTOUTLN_STROKEFILL : MfEdit.h
  • mmGetProfileIntA : profile.h
  • mmGetProfileString : profile.h
  • MMPROFILECACHE : profile.h
  • MMSG_DONE : SEQ.h
  • mmWriteProfileString : profile.h
  • MODE_EXPAND : sdkdiff.cpp
  • MODE_NULL : sdkdiff.cpp
  • MODE_OUTLINE : sdkdiff.cpp
  • MODULE_NAME : CustomAuth.h , PoolWrap.h , WildCardMap.cpp , CacheIsapi.cpp , ReMapUrl.cpp
  • MODULESTRING : registry.cpp , devicenode.cpp , registry.cpp , staticnode.cpp , compdata.cpp , virtualfile.cpp , dataobj.cpp , compdata.cpp , basesnap.cpp , comp.cpp , foldernode.cpp , comp.cpp , compdata.cpp , devicenode.cpp , basesnap.cpp , foldernode.cpp , virtualfile.cpp , devicenode.cpp , proppagex.cpp , dataobj.cpp , compdata.cpp , devicenode.cpp , virtualfile.cpp , compdata.cpp , devicenode.cpp , dataobj.cpp , compdata.cpp , devicenode.cpp , comp.cpp , dataobj.cpp , registry.cpp , comp.cpp , foldernode.cpp , registry.cpp , contextmenuex.cpp , basesnap.cpp , registry.cpp , dataobj.cpp , staticnode.cpp , registry.cpp , virtualfile.cpp , basesnap.cpp , comp.cpp , basesnap.cpp , compdata.cpp , foldernode.cpp , comp.cpp , registry.cpp , staticnode.cpp , virtualfile.cpp , staticnode.cpp , registry.cpp , foldernode.cpp , basesnap.cpp , dataobj.cpp , basesnap.cpp , compdata.cpp , comp.cpp , staticnode.cpp
  • MOFSTR : tracedmp.h
  • MOFWSTR : tracedmp.h
  • MONITORPOLLDELAY : Client.h
  • MOUNT_WAIT : app.cpp
  • MOUSINFO_ICON : MousInfo.h
  • MOVEBACK : list.cpp
  • MOVEMONEY : resource.h
  • MPOINT2POINT : Cursor.h , Select.h
  • MS_IP_SAMPLE : ipsamplerm.h
  • MSDFMAP_PROGID : handler.h
  • MSDFMAP_PROGIDVER : handler.h
  • MSG_BUF_SIZE : bankthrds.Cpp
  • MSG_ID_MASK : log.c , MsgTest.c
  • MSG_RECEIVED : cData.h
  • MSG_SENT : cData.h
  • MSG_SIZE : common.h
  • MsgBox : globals.h
  • MSGBOX_NAME : FileTerm.h
  • MSGPROPS : DirEncrypt.Cpp
  • MSI : vertrust.cpp , setup.cpp
  • MSI_DLL : setup.cpp
  • MSIAPI_MsiApplyPatch : setup.cpp
  • MSIAPI_MsiCloseHandle : setup.cpp
  • MSIAPI_MsiDatabaseOpenView : setup.cpp
  • MSIAPI_MsiInstallProduct : setup.cpp
  • MSIAPI_MsiOpenDatabase : setup.cpp
  • MSIAPI_MsiQueryProductState : setup.cpp
  • MSIAPI_MsiRecordGetString : setup.cpp
  • MSIAPI_MsiReinstallProduct : setup.cpp
  • MSIAPI_MsiSetInternalUI : setup.cpp
  • MSIAPI_MsiViewExecute : setup.cpp
  • MSIAPI_MsiViewFetch : setup.cpp
  • MSISIPAPI_DllRegisterServer : upgrdmsi.cpp
  • MSPB_IsBadWritePtr : precomp.h
  • MSV1_0_AUTH_TYPE : LogonNP.c
  • muldiv32 : MulDiv32.h
  • muldivrd32 : MulDiv32.h
  • muldivru32 : MulDiv32.h
  • MUTEX_NAME : StdAfx.h
  • MW : MousInfo.h
  • MW_DATAREADY : Globals.h
  • MW_DISCONNECTED : Globals.h
  • MW_DISPLAYREFRESH : Globals.h
  • MY_BUFSIZE : TextSid.c
  • MY_CLASS_NAME : ui.cpp
  • MY_DEFPORT : QosEvent.h
  • MY_ENCODING : RSACert.cpp
  • MY_KEY_SIZE : session.cpp
  • My_mbslen : Printer.c
  • My_mbstok : Precomp.h
  • MyCharNext : Wapi.h
  • MyCharPrev : Wapi.h
  • MYCMF_MULTISELECT : ContMenu.h
  • MYDBG : MfEdit.c
  • MYDEBUG : FaxSiren.Cpp
  • MYGWL_FONT : MultiUI.h
  • MYGWL_IMC : MultiUI.h
  • MYGWL_IMEWND : MultiUI.h
  • MYGWL_STR : MultiUI.h
  • MYIMEMENUITEMINFO : Wapi.h
  • MyImmGetCompositionString : Wapi.h
  • MyImmGetImeMenuItems : Wapi.h
  • Mylstrcat : Wapi.h
  • Mylstrcmp : Wapi.h
  • Mylstrcpy : Wapi.h
  • Mylstrlen : Wapi.h
  • MYRES_DEPENDENCY_MODE : CStorageResource.h
  • MYTEXT : Wapi.h
  • MYWM_NOTIFYICON : App32.C , SetDisp.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- n -

  • N_TIME_FORMATS : MidiPlyr.h
  • NAME : dxsurf1.cpp , dxsurf2.cpp
  • NAME_COL : people.Cpp
  • NAME_SIZE : Client32.h , Server32.h
  • NAME_X : Server32.h
  • NAME_Y : Server32.h
  • NAMEMAXLENGTH : nmsession.h
  • NAMEPROP : UtilLib.h
  • Namespace : resource.h
  • NAMESPACEPROP : UtilLib.h
  • Namespaces : resource.h
  • NBR_PS_PAGE : global.h
  • NBSP : Grid.Cxx
  • NBYTES : Grid.Cxx
  • Ndsou : resource.h
  • NE_Display : networkentry.h
  • NEAR : GssAPI.h
  • nErrFnf : wn_dos.h
  • nErrNoAcc : wn_dos.h
  • NETINTERFACE_MENU_BASE_ID : ExtObjData.cpp
  • NETINTERFACE_MENU_ID_1 : ExtObjData.cpp
  • NETWORK_MENU_BASE_ID : ExtObjData.cpp
  • NETWORK_MENU_ID_1 : ExtObjData.cpp
  • NEW_DIB_FORMAT : DIBSectn.c
  • NEW_FOLDER_NAME : ShlFldr.Cpp
  • NEW_ITEM_NAME : ShlFldr.Cpp
  • NEWFSP_DEVICE_DIRECTORY : Reg.h
  • NEWFSP_DEVICE_ID_PREFIX : NewFsp.h
  • NEWFSP_DEVICE_LIMIT : NewFsp.h
  • NEWFSP_DEVICE_NAME_PREFIX : NewFsp.h
  • NEWFSP_DEVICES : Reg.h
  • NEWFSP_LOG_FILE : NewFsp.h
  • NEWFSP_LOGGING_DIRECTORY : Reg.h
  • NEWFSP_LOGGING_ENABLED : Reg.h
  • NEWFSP_PROVIDER : Reg.h
  • NEWFSP_PROVIDER_FRIENDLYNAME : Reg.h
  • NEWFSP_PROVIDER_IMAGENAME : Reg.h
  • NEWFSP_PROVIDER_PROVIDERNAME : Reg.h
  • newk : Global.Hxx
  • NFIELDS : queue.h
  • NITER : Cursor.c
  • NLASTDIALED : Dialer.h
  • NM_APPID_NETMEETING : PreComp.h
  • NM_NT_DISPLAY_DRIVER_KEY : Dlg.Cpp
  • NMUI_CHAT_PROTOCOL : PreComp.h
  • NO_CONTAINER : app.cpp
  • NO_EXPIRATION : IsapiRequest.h
  • NO_MATCH : table.cpp
  • NO_MESSAGE : MousInfo.h
  • NO_OUTPUT : Dt.h
  • NOBROWSE_ERROR_STR : AppUtil.h
  • NOCOM_ERROR_STR : AppUtil.h
  • NOCOMOBJ_ERROR_STR : FreClien.h
  • NODE_MENU_BASE_ID : ExtObjData.cpp
  • NODE_MENU_ID_1 : ExtObjData.cpp
  • NODETYPE_DEVICE : globals.h
  • NODETYPE_FOLDER : globals.h
  • NODETYPE_RESULT : globals.h
  • NODETYPE_STATIC : globals.h
  • NODETYPE_VFILE : globals.h
  • NOEDITOR_ERROR_STR : AppUtil.h
  • NOFILE_STR : RESDEF.h
  • NOGDI : precomp.h
  • NOHTM_ERROR_STR : AppUtil.h
  • NOMINMAX : precomp.h , Dialogs.c , FontView.c , Status.c , Tools.c
  • NONAMELESSUNION : OleStd.h , OleStd.c
  • NOTE : sampclnt.h
  • NOTEQUAL : common.h
  • NOTHING : AsyncIO.h
  • NOTHREAD_ERROR_STR : FreClien.h
  • NOTICE_TITLE_STR : AppUtil.h
  • NOTIFICATION_CLASS : WSnmpUtil.h
  • NOTIFY_MSG : Global.h
  • NotReached : Global.h
  • NOTSET : cdialog.cpp
  • NOTUTORIAL_ERROR_STR : AppUtil.h
  • NOTXT_ERROR_STR : AppUtil.h
  • NOW : defs.h
  • NP_FORMATETC : globals.h
  • NS_CLASS_NAME : Utility.h
  • NSCERTTYPE_CA : Policy.Cpp , policy.cpp
  • NSCERTTYPE_CLIENT : policy.cpp , Policy.Cpp
  • NSCERTTYPE_SERVER : policy.cpp , Policy.Cpp
  • NSCERTTYPE_SMIME : policy.cpp , Policy.Cpp
  • NSPEEDDIALS : Dialer.h
  • NT4_DLL_NAME : WebServer.c , WebClient.c
  • NT_DLL_NAME : Security.cpp
  • NT_DRIVER_START_DISABLED : Dlg.Cpp
  • NTOHS : tracedmp.h
  • NULL_CHAR : Common.h
  • NULL_PARTID : app.cpp
  • NULL_TERMINATED : main.hxx
  • NULL_UUID_STRING : ClUuids.c
  • NUM_COLUMNS : columnprovider.Cpp
  • NUM_CONTROLS : TPCInfo.cpp
  • NUM_FINDSTRINGS : findgoto.h
  • NUM_GRAPHICS_XSLOTS : Paint.h
  • NUM_GRAPHICS_YSLOTS : Paint.h
  • NUM_ICONS : DebMain.c
  • NUM_INSTANCES : BasicHiPerf.h
  • Num_Ip_Address : AdminDll.c
  • NUM_OBJECTS : BasicHiPerf.h
  • NUM_PARTS : Status.c
  • NUM_QUIKREBIND_ROWSETS : quiktest.h
  • NUM_SPINCUBE_STYLES : SpinCube.h
  • NUM_STAT_SAMPLES : MainWnd.c
  • NUM_STATIC_COLORS : MfEdit.h
  • NUM_SUPPORTED_ATTRS : tsfedit.h
  • NUM_TEMPLATE_UDNS_IN_DESCDOC : Dimmer.h , DimmerDeviceDCO.h
  • NUM_THREAD : quiktest.h
  • NUMBER_COLUMNS : Resource.h
  • NUMBER_OF_COLUMNS : bankdlg.Cpp
  • Number_Of_Flags : AdminDll.c , Admapit.c
  • NUMBER_OF_PROPERTY_SHEETS : PhoneEntry.c
  • NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_PROPERTY_SETS : utilprop.h
  • NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES : utilprop.h
  • NUMBER_OF_SUPPORTED_SESSION_PROPERTIES : utilprop.h
  • NUMELE : common.h
  • NUMELEM : sampprov.h , common.h , sampclnt.h
  • NUMFACETS : Paint.h
  • NUMIMAGES : ToolBar.c , Global.h , ToolBar.c
  • NumItems : autotest.h
  • NUMLOGICALFONTS : DspLogcl.Cpp
  • NUMPIXELSTODRAW : dxsurf3.cpp
  • NUMROWS_CHUNK : sampclnt.h
  • NUMVERTICES : Paint.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- o -

  • OBJ_CHORD : Draw.h
  • OBJ_ELLIPSE : Draw.h
  • OBJ_PIE : Draw.h
  • OBJ_RECTANGLE : Draw.h
  • OBJ_ROUNDRECT : Draw.h
  • OBJECT_CONSTRUCTED : sampprov.h
  • OBJECT_CREATED : globals.h , Globals.h , globals.h
  • OBJECT_DESTROYED : globals.h , Globals.h , globals.h
  • OBJECT_DESTRUCTED : sampprov.h
  • OBJECT_MSG : Global.h
  • OBM_BTNCORNERS : winres.h
  • OBM_BTSIZE : winres.h
  • OBM_CHECK : winres.h
  • OBM_CHECKBOXES : winres.h
  • OBM_CLOSE : winres.h
  • OBM_COMBO : winres.h
  • OBM_DNARROW : winres.h
  • OBM_DNARROWD : winres.h
  • OBM_DNARROWI : winres.h
  • OBM_LFARROW : winres.h
  • OBM_LFARROWD : winres.h
  • OBM_LFARROWI : winres.h
  • OBM_MNARROW : winres.h
  • OBM_OLD_CLOSE : winres.h
  • OBM_OLD_DNARROW : winres.h
  • OBM_OLD_LFARROW : winres.h
  • OBM_OLD_REDUCE : winres.h
  • OBM_OLD_RESTORE : winres.h
  • OBM_OLD_RGARROW : winres.h
  • OBM_OLD_UPARROW : winres.h
  • OBM_OLD_ZOOM : winres.h
  • OBM_REDUCE : winres.h
  • OBM_REDUCED : winres.h
  • OBM_RESTORE : winres.h
  • OBM_RESTORED : winres.h
  • OBM_RGARROW : winres.h
  • OBM_RGARROWD : winres.h
  • OBM_RGARROWI : winres.h
  • OBM_SIZE : winres.h
  • OBM_UPARROW : winres.h
  • OBM_UPARROWD : winres.h
  • OBM_UPARROWI : winres.h
  • OBM_ZOOM : winres.h
  • OBM_ZOOMD : winres.h
  • OBS_COMPLETELYCOVERED : Obscure.c
  • OBS_COMPLETELYVISIBLE : Obscure.c
  • OBS_PARTIALLYVISIBLE : Obscure.c
  • OBTAIN_INTERFACE : cbase.h
  • OCR_CROSS : winres.h
  • OCR_IBEAM : winres.h
  • OCR_ICOCUR : winres.h
  • OCR_ICON : winres.h
  • OCR_NORMAL : winres.h
  • OCR_SIZE : winres.h
  • OCR_SIZEALL : winres.h
  • OCR_SIZENESW : winres.h
  • OCR_SIZENS : winres.h
  • OCR_SIZENWSE : winres.h
  • OCR_SIZEWE : winres.h
  • OCR_UP : winres.h
  • OCR_WAIT : winres.h
  • OD_BTN_CNT : MfEdit.h
  • OD_TOOL_CNT : MfEdit.h
  • ODF1 : AppUtil.h
  • ODF2 : AppUtil.h
  • ODF3 : AppUtil.h
  • ODS : debug.h , AppUtil.h , DbgOut.h , ShellExt.h
  • ODSlu : debug.h , DbgOut.h
  • ODSsz : debug.h , DbgOut.h
  • ODSszlu : debug.h , DbgOut.h
  • ODSszu : debug.h , DbgOut.h
  • ODSu : debug.h , DbgOut.h
  • OFFSET : rnrcs.cpp
  • OFFSET_NIL : suminfo.h
  • OFFSETERROR : Grid.Cxx
  • OffsetPoint : idt.Cpp
  • OFN_DEFAULTFILES_STR : ComUser.h , ConClien.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h , AptClien.h
  • OFN_DEFAULTTITLE_STR : AptClien.h , ComUser.h , RemClien.h , ConClien.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , StoClien.h
  • OFN_SOURCEFILES_STR : AppUtil.h
  • OFN_SOURCETITLE_STR : AppUtil.h
  • OIC_BANG : winres.h
  • OIC_HAND : winres.h
  • OIC_NOTE : winres.h
  • OIC_QUES : winres.h
  • OIC_SAMPLE : winres.h
  • OID_SIZEOF : TestMIB.h
  • OLEDBG_BEGIN : OleStd.h
  • OLEDBG_BEGIN1 : OleStd.h
  • OLEDBG_BEGIN2 : OleStd.h
  • OLEDBG_BEGIN3 : OleStd.h
  • OLEDBG_BEGIN4 : OleStd.h
  • OLEDBG_END : OleStd.h
  • OLEDBG_END1 : OleStd.h
  • OLEDBG_END2 : OleStd.h
  • OLEDBG_END3 : OleStd.h
  • OLEDBG_END4 : OleStd.h
  • OleDbgAddRefMethod : OleStd.h
  • OleDbgAssert : OleStd.h
  • OleDbgAssertSz : OleStd.h
  • OLEDBGDATA : OleStd.h
  • OLEDBGDATA_MAIN : OleStd.h
  • OleDbgOut : OleStd.h
  • OleDbgOut1 : OleStd.h
  • OleDbgOut2 : OleStd.h
  • OleDbgOut3 : OleStd.h
  • OleDbgOut4 : OleStd.h
  • OleDbgOutHResult : OleStd.h
  • OleDbgOutNoPrefix : OleStd.h
  • OleDbgOutNoPrefix1 : OleStd.h
  • OleDbgOutNoPrefix2 : OleStd.h
  • OleDbgOutNoPrefix3 : OleStd.h
  • OleDbgOutNoPrefix4 : OleStd.h
  • OleDbgOutRect : OleStd.h
  • OleDbgOutRect1 : OleStd.h
  • OleDbgOutRect2 : OleStd.h
  • OleDbgOutRect3 : OleStd.h
  • OleDbgOutRect4 : OleStd.h
  • OleDbgOutRefCnt : OleStd.h
  • OleDbgOutRefCnt1 : OleStd.h
  • OleDbgOutRefCnt2 : OleStd.h
  • OleDbgOutRefCnt3 : OleStd.h
  • OleDbgOutRefCnt4 : OleStd.h
  • OleDbgOutScode : OleStd.h
  • OleDbgQueryInterfaceMethod : OleStd.h
  • OleDbgReleaseMethod : OleStd.h
  • OleDbgVerify : OleStd.h
  • OleDbgVerifySz : OleStd.h
  • OLEDBVER : AdvQuery.Cxx , Guids.Cpp
  • OLESTDCANCELRETRY : OleStd.h
  • OleStdCopyMetafilePict : OleStd.h
  • OLESTDDROP_DEFAULT : OleStd.h
  • OLESTDDROP_NONDEFAULT : OleStd.h
  • OLESTDDROP_NONE : OleStd.h
  • OleStdGetDropEffect : DropTgt.Cpp , OleStd.h
  • OleStdQueryFormatMedium : OleStd.h
  • OleStdQueryLinkSourceData : OleStd.h
  • OleStdQueryObjectDescriptorData : OleStd.h
  • OleStdQueryOleObjectData : OleStd.h
  • OLESTDRETRYDELAY : OleStd.h
  • OLESTRCAT : ansiapi.h
  • OLESTRCMP : ansiapi.h
  • OLESTRCMPI : ansiapi.h
  • OLESTRCPY : ansiapi.h
  • OLESTRLEN : ansiapi.h
  • OLEUI_CCHCLSIDSTRING : OleStd.h
  • OLEUI_CCHFILEMAX : OleStd.h
  • OLEUI_CCHKEYMAX : OleStd.h
  • OLEUI_CCHLABELMAX : OleStd.h
  • OLEUI_CCHPATHMAX : OleStd.h
  • OLEUI_CCHVERBMAX : OleStd.h
  • OLEUI_HANDLES_INSIDE : OleStd.h
  • OLEUI_HANDLES_NOBORDER : OleStd.h
  • OLEUI_HANDLES_OUTSIDE : OleStd.h
  • OLEUI_HANDLES_USEINVERSE : OleStd.h
  • OLEUI_OBJECTMENUMAX : OleStd.h
  • OLEUI_SHADE_BORDERIN : OleStd.h
  • OLEUI_SHADE_BORDEROUT : OleStd.h
  • OLEUI_SHADE_FULLRECT : OleStd.h
  • OLEUI_VERSION_MAGIC : OleStd.h
  • OleUIMetafilePictFromIconAndLabel : OleStd.h
  • ON_COMMAND : cdialoglite.h
  • ON_COMMAND_UI : cdialoglite.h
  • ON_COMMAND_UI_CHECKED : cdialoglite.h
  • ON_COMMAND_UI_ENABLED : cdialoglite.h
  • OP_READ : Overlap.c
  • OP_WRITE : Overlap.c
  • OPENING : Dialogs.h
  • OPENQDLG_CLEAR_COMBOBOX : OpenQDlg.h
  • OPENSTATE_NO : IPageS.h
  • OPENSTATE_NONE : IPageS.h
  • OPENSTATE_YES : IPageS.h
  • OPTIMUM_SIZE : pipe.hxx
  • OPTION_FILE : WinCap.h
  • OPTION_PRINTER : WinCap.h
  • OPTIONAL : AsyncIO.h
  • or : defs.h
  • ORG_X : IMEApps.h
  • ORG_Y : IMEApps.h
  • Organization : resource.h
  • OsDateWin : wn_dos.h
  • osMac : suminfo.h
  • OSSERROR_FROM_HRESULT : CeError.Cpp , ceerror.cpp
  • OsTimeWin : wn_dos.h
  • osWinNT : suminfo.h
  • osWinOnDos : suminfo.h
  • OTHER : Monkey.h
  • OUR_BAR : stl_mll.cpp
  • OUR_BRACE : stl_mll.cpp
  • OUR_STRING : stl_mll.cpp
  • OUT : AsyncIO.h
  • OUT_BUF_SIZE : Server32.h , Client32.h
  • OUT_LINE_FILE : cdbfile.h
  • OUTBOUND_PIPE : Server.c
  • outnum : Enumprt.h
  • OUTPUT_BUFFER_WCHAR_SIZE : app.cpp
  • OutputDebugLastError : TapiInfo.h
  • OutputDebugLineError : TapiInfo.h
  • outstr : Enumprt.h , Getpdriv.h
  • outstr2 : Enumprt.h
  • outstr3 : Enumprt.h
  • OVERLAPPED_IO : NmPipe.c
  • OWNER_COL : people.Cpp
  • OWNERNAME : queue.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- a -

  • A2CW : StrConv.h
  • A2W : debug.h , ansiapi.h , StrConv.h , ansiapi.h
  • A2WHELPER : StrConv.h
  • ABORT : quiktest.h
  • AbortTest : autotest.h
  • ABOUT_TITLE_STR : ComObjI.h , Server.h , DllSkelI.h , Server.h
  • ABOUTBOX : MciPlay.h , GdiDemo.h
  • ABS : common.h
  • abs : tpriv.h
  • ACCEL_ID : MfEdit.h
  • ACCESS_ALL : Main.h
  • ACCESS_ALLOW : SecPrint.c
  • ACCESS_DELETE : Main.h
  • ACCESS_DENY : SecPrint.c
  • ACCESS_FUND_CORPORATE : common.h
  • ACCESS_FUND_PERSONAL : common.h
  • ACCESS_FUND_TRANSFER : common.h
  • ACCESS_MODIFY : Main.h
  • ACCESS_READ : Main.h
  • ACCESSBUFFERSIZE : MqApiTst.h
  • ACCOUNT : resource.h
  • ACE_TYPE_ALL : DComPerm.h
  • ACQUIRE_LIST_LOCK : sync.h
  • ACQUIRE_QUEUE_LOCK : sync.h
  • ACQUIRE_READ_DLOCK : defs.h
  • ACQUIRE_READ_LOCK : sync.h
  • ACQUIRE_WRITE_DLOCK : defs.h
  • ACQUIRE_WRITE_LOCK : sync.h
  • ACTION_ENABLE : TraceLog.c
  • ACTION_HELP : TraceLog.c
  • ACTION_LIST : TraceLog.c
  • ACTION_QUERY : TraceLog.c
  • ACTION_START : TraceLog.c
  • ACTION_STOP : TraceLog.c
  • ACTION_UNDEFINED : TraceLog.c
  • ACTION_UPDATE : TraceLog.c
  • ADD_ACE_MASK_BITS : app.cpp
  • ADD_KNOWN_HEADER : main.c
  • ADDADSERROR : StdAfx.h
  • AddEtype : KList.c
  • ADDREF : MqTestOA.Cpp
  • ADJUST_SIZE : common.h
  • ADO_MAJOR : adoid.h
  • ADOCollection : adoint.h
  • ADOCommand : adoint.h
  • ADOConnection : adoint.h
  • ADODynaCollection : adoint.h
  • ADOParameter : adoint.h
  • ADORecordset : adoint.h
  • ADS_FREE : main.hxx
  • ADS_SYSTEMFLAG_ATTR_IS_CONSTRUCTED : attributes.cpp
  • ADS_SYSTEMFLAG_ATTR_NOT_REPLICATED : attributes.cpp
  • ADVAPI32_DLL : utils.cpp
  • ADVAPI32API_AdjustTokenPrivileges : utils.cpp
  • ADVAPI32API_CheckTokenMembership : utils.cpp
  • ADVAPI32API_LookupPrivilegeValue : utils.cpp
  • ADVAPI32API_OpenProcessToken : utils.cpp
  • AFX_CONTROLBAR_MASK : afxres.h
  • AFX_ID_PREVIEW_CLOSE : afxres.h
  • AFX_ID_PREVIEW_NEXT : afxres.h
  • AFX_ID_PREVIEW_NUMPAGE : afxres.h
  • AFX_ID_PREVIEW_PREV : afxres.h
  • AFX_ID_PREVIEW_PRINT : afxres.h
  • AFX_ID_PREVIEW_ZOOMIN : afxres.h
  • AFX_ID_PREVIEW_ZOOMOUT : afxres.h
  • AFX_IDC_CHANGE : afxres.h
  • AFX_IDC_CONTEXTHELP : afxres.h
  • AFX_IDC_HSPLITBAR : afxres.h
  • AFX_IDC_LISTBOX : afxres.h
  • AFX_IDC_MAGNIFY : afxres.h
  • AFX_IDC_MOVE4WAY : afxres.h
  • AFX_IDC_NODROPCRSR : afxres.h
  • AFX_IDC_PRINT_DOCNAME : afxres.h
  • AFX_IDC_PRINT_PAGENUM : afxres.h
  • AFX_IDC_PRINT_PORTNAME : afxres.h
  • AFX_IDC_PRINT_PRINTERNAME : afxres.h
  • AFX_IDC_SMALLARROWS : afxres.h
  • AFX_IDC_TRACK4WAY : afxres.h
  • AFX_IDC_TRACKNESW : afxres.h
  • AFX_IDC_TRACKNS : afxres.h
  • AFX_IDC_TRACKNWSE : afxres.h
  • AFX_IDC_TRACKWE : afxres.h
  • AFX_IDC_VSPLITBAR : afxres.h
  • AFX_IDD_BUSY : afxres.h
  • AFX_IDD_CHANGEICON : afxres.h
  • AFX_IDD_COLOR : afxres.h
  • AFX_IDD_CONVERT : afxres.h
  • AFX_IDD_EDITLINKS : afxres.h
  • AFX_IDD_FILEBROWSE : afxres.h
  • AFX_IDD_FILEOPEN : afxres.h
  • AFX_IDD_FILESAVE : afxres.h
  • AFX_IDD_FIND : afxres.h
  • AFX_IDD_FONT : afxres.h
  • AFX_IDD_INSERTOBJECT : afxres.h
  • AFX_IDD_NEWTYPEDLG : afxres.h
  • AFX_IDD_PASTESPECIAL : afxres.h
  • AFX_IDD_PREVIEW_TOOLBAR : afxres.h
  • AFX_IDD_PRINT : afxres.h
  • AFX_IDD_PRINTDLG : afxres.h
  • AFX_IDD_PRINTSETUP : afxres.h
  • AFX_IDD_REPLACE : afxres.h
  • AFX_IDI_STD_FRAME : afxres.h
  • AFX_IDI_STD_MDIFRAME : afxres.h
  • AFX_IDM_FIRST_MDICHILD : afxres.h
  • AFX_IDM_WINDOW_FIRST : afxres.h
  • AFX_IDM_WINDOW_LAST : afxres.h
  • AFX_IDP_ASK_TO_DISCARD : afxres.h
  • AFX_IDP_ASK_TO_SAVE : afxres.h
  • AFX_IDP_ASK_TO_UPDATE : afxres.h
  • AFX_IDP_BAD_VERB : afxres.h
  • AFX_IDP_COMMAND_FAILURE : afxres.h
  • AFX_IDP_FAILED_ACCESS_READ : afxres.h
  • AFX_IDP_FAILED_ACCESS_WRITE : afxres.h
  • AFX_IDP_FAILED_DISK_FULL : afxres.h
  • AFX_IDP_FAILED_INVALID_FORMAT : afxres.h
  • AFX_IDP_FAILED_INVALID_PATH : afxres.h
  • AFX_IDP_FAILED_IO_ERROR_READ : afxres.h
  • AFX_IDP_FAILED_IO_ERROR_WRITE : afxres.h
  • AFX_IDP_FAILED_MEMORY_ALLOC : afxres.h
  • AFX_IDP_FAILED_TO_AUTO_REGISTER : afxres.h
  • AFX_IDP_FAILED_TO_CONNECT : afxres.h
  • AFX_IDP_FAILED_TO_CONVERT : afxres.h
  • AFX_IDP_FAILED_TO_CREATE_DOC : afxres.h
  • AFX_IDP_FAILED_TO_LAUNCH : afxres.h
  • AFX_IDP_FAILED_TO_LAUNCH_HELP : afxres.h
  • AFX_IDP_FAILED_TO_NOTIFY : afxres.h
  • AFX_IDP_FAILED_TO_OPEN_DOC : afxres.h
  • AFX_IDP_FAILED_TO_REGISTER : afxres.h
  • AFX_IDP_FAILED_TO_SAVE_DOC : afxres.h
  • AFX_IDP_FAILED_TO_START_PRINT : afxres.h
  • AFX_IDP_FAILED_TO_UPDATE : afxres.h
  • AFX_IDP_FILE_TOO_LARGE : afxres.h
  • AFX_IDP_GET_NOT_SUPPORTED : afxres.h
  • AFX_IDP_INTERNAL_FAILURE : afxres.h
  • AFX_IDP_INVALID_FILENAME : afxres.h
  • AFX_IDP_PARSE_INT : afxres.h
  • AFX_IDP_PARSE_INT_RANGE : afxres.h
  • AFX_IDP_PARSE_RADIO_BUTTON : afxres.h
  • AFX_IDP_PARSE_REAL : afxres.h
  • AFX_IDP_PARSE_REAL_RANGE : afxres.h
  • AFX_IDP_PARSE_STRING_SIZE : afxres.h
  • AFX_IDP_SERVER_BUSY : afxres.h
  • AFX_IDP_SET_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_API_CONFORMANCE : afxres.h
  • AFX_IDP_SQL_CONNECT_FAIL : afxres.h
  • AFX_IDP_SQL_DATA_TRUNCATED : afxres.h
  • AFX_IDP_SQL_DYNASET_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_EMPTY_COLUMN_LIST : afxres.h
  • AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH : afxres.h
  • AFX_IDP_SQL_FIRST : afxres.h
  • AFX_IDP_SQL_ILLEGAL_MODE : afxres.h
  • AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED : afxres.h
  • AFX_IDP_SQL_NO_CURRENT_RECORD : afxres.h
  • AFX_IDP_SQL_NO_DATA_FOUND : afxres.h
  • AFX_IDP_SQL_NO_POSITIONED_UPDATES : afxres.h
  • AFX_IDP_SQL_NO_ROWS_AFFECTED : afxres.h
  • AFX_IDP_SQL_ODBC_LOAD_FAILED : afxres.h
  • AFX_IDP_SQL_ODBC_V2_REQUIRED : afxres.h
  • AFX_IDP_SQL_RECORDSET_FORWARD_ONLY : afxres.h
  • AFX_IDP_SQL_RECORDSET_READONLY : afxres.h
  • AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED : afxres.h
  • AFX_IDP_SQL_SQL_CONFORMANCE : afxres.h
  • AFX_IDP_SQL_SQL_NO_TOTAL : afxres.h
  • AFX_IDP_STATIC_OBJECT : afxres.h
  • AFX_IDP_VB2APICALLED : afxres.h
  • AFX_IDS_ACTIVATE_VERB : afxres.h
  • AFX_IDS_ALL_FILES : afxres.h
  • AFX_IDS_ALLFILTER : afxres.h
  • AFX_IDS_APP_TITLE : afxres.h
  • AFX_IDS_APP_TITLE_EMBEDDING : afxres.h
  • AFX_IDS_APP_TITLE_INPLACE : afxres.h
  • AFX_IDS_AUTO : afxres.h
  • AFX_IDS_BITMAP_FORMAT : afxres.h
  • AFX_IDS_CHANGE_LINK : afxres.h
  • AFX_IDS_DESKACCESSORY : afxres.h
  • AFX_IDS_DIB_FORMAT : afxres.h
  • AFX_IDS_EDIT_VERB : afxres.h
  • AFX_IDS_EMBED_FORMAT : afxres.h
  • AFX_IDS_EXIT_MENU : afxres.h
  • AFX_IDS_FROZEN : afxres.h
  • AFX_IDS_HELPMODEMESSAGE : afxres.h
  • AFX_IDS_IDLEMESSAGE : afxres.h
  • AFX_IDS_LINKSOURCE_FORMAT : afxres.h
  • AFX_IDS_MANUAL : afxres.h
  • AFX_IDS_MDICHILD : afxres.h
  • AFX_IDS_METAFILE_FORMAT : afxres.h
  • AFX_IDS_OBJECT_MENUITEM : afxres.h
  • AFX_IDS_ONEPAGE : afxres.h
  • AFX_IDS_OPENFILE : afxres.h
  • AFX_IDS_PREVIEW_CLOSE : afxres.h
  • AFX_IDS_PREVIEWPAGEDESC : afxres.h
  • AFX_IDS_PRINTONPORT : afxres.h
  • AFX_IDS_PRINTPAGENUM : afxres.h
  • AFX_IDS_SAVE_AS_MENU : afxres.h
  • AFX_IDS_SAVE_COPY_AS_MENU : afxres.h
  • AFX_IDS_SAVE_MENU : afxres.h
  • AFX_IDS_SAVEFILE : afxres.h
  • AFX_IDS_SAVEFILECOPY : afxres.h
  • AFX_IDS_SCCLOSE : afxres.h
  • AFX_IDS_SCFIRST : afxres.h
  • AFX_IDS_SCMAXIMIZE : afxres.h
  • AFX_IDS_SCMINIMIZE : afxres.h
  • AFX_IDS_SCMOVE : afxres.h
  • AFX_IDS_SCNEXTWINDOW : afxres.h
  • AFX_IDS_SCPREVWINDOW : afxres.h
  • AFX_IDS_SCRESTORE : afxres.h
  • AFX_IDS_SCSIZE : afxres.h
  • AFX_IDS_SCTASKLIST : afxres.h
  • AFX_IDS_TWOPAGE : afxres.h
  • AFX_IDS_UNTITLED : afxres.h
  • AFX_IDS_UPDATE_MENU : afxres.h
  • AFX_IDS_UPDATING_ITEMS : afxres.h
  • AFX_IDW_CONTROLBAR_FIRST : afxres.h
  • AFX_IDW_CONTROLBAR_LAST : afxres.h
  • AFX_IDW_HSCROLL_FIRST : afxres.h
  • AFX_IDW_PANE_FIRST : afxres.h
  • AFX_IDW_PANE_LAST : afxres.h
  • AFX_IDW_PANE_SAVE : afxres.h
  • AFX_IDW_PREVIEW_BAR : afxres.h
  • AFX_IDW_RESIZE_BAR : afxres.h
  • AFX_IDW_SIZE_BOX : afxres.h
  • AFX_IDW_STATUS_BAR : afxres.h
  • AFX_IDW_TOOLBAR : afxres.h
  • AFX_IDW_VSCROLL_FIRST : afxres.h
  • AFX_STDAFX_H__AA22C995_FD72_11D0_B5DC_00C04FB957D8__INCLUDED_ : StdAfx.h
  • AFX_WS_DEFAULT_VIEW : afxres.h
  • ALDUS_ID : MfEdit.h
  • ALIGN_ON_DWORD : PerfUtil.h
  • ALIGN_TO8 : Picklpc.c , Pickltc.c
  • ALL : nshsamp.h
  • ALL_RESOURCES_MENU_BASE_ID : ExtObjData.cpp
  • ALL_RESOURCES_MENU_ID_1 : ExtObjData.cpp
  • ALL_RESTYPES_MENU_BASE_ID : ExtObjData.cpp
  • ALL_RESTYPES_MENU_ID_1 : ExtObjData.cpp
  • ALLGRAPHICS : Common.h
  • ALLOC_MEM : main.c
  • ALLOCATE_WAIT : app.cpp
  • AllocateMemory : autotest.h
  • ALLOCATION_SIZE : LeakyBin.h
  • ALLPAGES : Grid.Hxx
  • AllSecurityFlagsEqNone : suminfo.h
  • and : defs.h
  • ANON_DOMAIN : AuthenticateContext.cpp
  • ANON_PSWD : AuthenticateContext.cpp
  • ANON_USER : AuthenticateContext.cpp
  • ANSI : debug.c
  • ANY_SIZE : ipsamplerm.h
  • API : suminfo.h
  • APIENTRY : Dialogs.c , Status.c , Tools.c
  • APMSIZE : MfEdit.h
  • App : ADQI.h
  • APP_CLASS : StdAfx.h
  • APP_ERROR : stdafx.h , StdAfx.h , stdafx.h , StdAfx.h
  • APP_HEIGHT : StdAfx.h
  • APP_ICON : MfEdit.h
  • APP_INSTALL_TYPE_UNDEFINED : AppInstallDlg.Cpp
  • APP_INSTALL_TYPE_WITH_USERS : AppInstallDlg.Cpp
  • APP_INSTALL_TYPE_WITHOUT_USERS : AppInstallDlg.Cpp
  • APP_MEM_NUM_PERF_OBJECT_TYPES : DataMem.h
  • APP_NAME : Perfmsg.h
  • APP_TITLE : StdAfx.h
  • APP_WIDTH : StdAfx.h
  • APPALLOCS : MemCtrnm.h
  • APPALLOCSSEC : MemCtrnm.h
  • APPBAR_BOTTOM : AppBar.h
  • APPBAR_CALLBACK : Globals.h
  • APPBAR_LEFT : AppBar.h
  • APPBAR_RIGHT : AppBar.h
  • APPBAR_TOP : AppBar.h
  • APPCLASS : GdiDemo.h
  • AppendSzWild : wn_dos.h
  • APPFREES : MemCtrnm.h
  • APPFREESSEC : MemCtrnm.h
  • APPICON : GdiDemo.h
  • APPMEM_INST : AppMemi.h
  • APPMEMALLOC : MemCtrnm.h
  • APPMEMOBJ : MemCtrnm.h
  • APPMENU : GdiDemo.h
  • APPNAME : GLOBALS.h , Generic.C , sdkdiff.h , service.h , LeakyBin.c , Service.h
  • APPNAMEA : Global.h
  • APPNAMEW : Global.h
  • APPREALLOCS : MemCtrnm.h
  • APPREALLOCSSEC : MemCtrnm.h
  • APPTITLE : GdiDemo.h
  • APPTITLEA : Global.h
  • APPTITLEW : Global.h
  • ARC : Common.h
  • AreRectsEqual : OleStd.h
  • ARGUMENT_PRESENT : AsyncIO.h
  • ARR_SIZE : Simple.c
  • ARRAY_ELEMENTS : stdafx.h , Global.h , precomp.h , Global.h
  • ARRAY_SIZE : isapiCertPolicy.cpp
  • ARRAY_VERSION : stdafx.h
  • ARRAYLEN : comp.Cpp , tbarext.Cpp , dsmenu.cpp , comp.Cpp
  • ARRAYSIZE : DropExt.C , CDTest.h
  • ArraySize : minici.hxx
  • ARRAYSIZE : CeLibW2k.h , util.h , SpinCube.h , DragImg.Cpp , CtxMenu.Cpp , globals.h , DoServer.h , ADEvent.cpp , App32.C , Utility.h , globals.h , IcnOvrly.h , Globals.h , ComDlg32.C , Render.Cpp , Cleanup.h , ShortName.h , CeLibW2k.h
  • ARROW_SYMBOL : StdAfx.h
  • ASSERT : common.h
  • assert : Debug.h
  • ASSERT : defs.h , asserts.h , Global.h , winmain.h , precomp.h , Global.h , PropList.h
  • Assert : Debug.h
  • ASSERT : AppUtil.h , Global.h , utils.h , common.h , Global.h
  • assert : assert.h
  • ASSERT : suminfo.Cpp , PropList.h
  • Assert : StdAfx.h
  • ASSERT : AppUtil.h , dballoc.Cpp , Global.h , PropList.h
  • assert : asserts.h
  • ASSERT_LOCKHELD : Critsect.h
  • ASSERT_LOCKNOTHELD : Critsect.h
  • ASSERT_SQL_SUCCESS : bankthrds.Cpp , stdafx.h , odbcdata.h
  • ASSERTC : common.h
  • ASSERTE : common.h
  • ASSERTFAIL_ERROR_STR : AppUtil.h
  • ASSERTHR : Global.h
  • ASSERTS : Global.h
  • AssertSz : Global.h
  • ASSERTSZ : dballoc.Cpp
  • AssertSz : Debug.h , Global.h
  • ASTRING : Printer.c
  • ASYNC_TIMEOUT : asyncselect.cpp
  • ATMEVENT_MAIN : ATMEvent.Cpp
  • ATSP_TIMEOUT : Atsp.h
  • ATTR_FLAG_DEFAULT : tsfedit.h
  • ATTR_FLAG_NONE : tsfedit.h
  • ATTR_FLAG_REQUESTED : tsfedit.h
  • ATTR_INDEX_MODEBIAS : tsfedit.h
  • ATTR_INDEX_TEXT_ORIENTATION : tsfedit.h
  • ATTR_INDEX_TEXT_VERTICALWRITING : tsfedit.h
  • AttribPsffs : wn_dos.h
  • ATTRIBUTE_BACKUP_DEVICE : globals.h
  • ATTRIBUTE_DATA_ARCHIVE : globals.h
  • ATTRIBUTE_DATA_COMPRESSED : globals.h
  • ATTRIBUTE_DATA_ENCRYPTED : globals.h
  • ATTRIBUTE_DATA_HIDDEN : globals.h
  • ATTRIBUTE_DATA_LOCKED : globals.h
  • ATTRIBUTE_DATA_READONLY : globals.h
  • ATTRIBUTEBUTTON_DISABLED : BttnCur.h
  • ATTRIBUTEBUTTON_DOWN : BttnCur.h
  • ATTRIBUTEBUTTON_DOWNDISABLED : BttnCur.h
  • ATTRIBUTEBUTTON_INDETERMINATE : BttnCur.h
  • ATTRIBUTEBUTTON_MOUSEDOWN : BttnCur.h
  • ATTRIBUTEBUTTON_UP : BttnCur.h
  • AUTHORIZED_USERS_PROPERTY : dbauthplugin.cpp
  • AUTO_MAX_TEST_NAME : autotest.h
  • AUTO_MAX_TESTCASE_NAME : autotest.h
  • AUTO_MAX_TESTDESC_NAME : autotest.h
  • AV_CLASS : StdAfx.h
  • AV_HEIGHT : StdAfx.h
  • AV_TITLE : StdAfx.h
  • AV_WIDTH : StdAfx.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- b -

  • BACKGROUNDBRUSH : PlgBlt.c
  • BAD_RECORD_FORMAT : crow.h
  • BAIL_ON_FAILURE : main.cxx , main.hxx
  • BAIL_ON_NULL : main.hxx , main.cxx
  • BAR_WIN_WIDTH : sdkdiff.h
  • BCODE : GLOBAL.h
  • BE_Display : networkentry.h
  • BE_FindTable : networkentry.h
  • BEZ_CURVES : Poly.h
  • BEZ_PTS : Poly.h
  • BF : suminfo.Cpp
  • BIG_BUFF : Client.cpp
  • BIND_PARM_OFFSET : quiktest.h
  • BIND_SIZE : quiktest.h
  • BINDING_LENGTH : common.h
  • BINDING_STATUS : common.h
  • BINDING_VALUE : common.h
  • BIT_ALL_PROPERTIES : FrameworkProv.Cpp
  • BIT_CLEAR : common.h
  • BIT_REDNOSE : FrameworkProv.Cpp
  • BIT_SET : common.h
  • BIT_WEIGHT : FrameworkProv.Cpp
  • BITMAP_COUNT : MainWND.c
  • BITMAP_X : Server32.h
  • BITMAP_Y : Server32.h
  • BITMAPHEIGHT : mwclass.Cxx
  • BITMAPWIDTH : mwclass.Cxx
  • BITSTOBYTES : CeLibW2k.h
  • BLACK : MfEdit.h
  • BLANKBUTTON_DOWN : BttnCur.h
  • BLANKBUTTON_INDETERMINATE : BttnCur.h
  • BLANKBUTTON_MOUSEDOWN : BttnCur.h
  • BLANKBUTTON_UP : BttnCur.h
  • BLANKS : Enumprt.h , Getcaps.h
  • BLOCK_SIZE : persist.cpp
  • BLOCKSIZE : list.cpp , PrPerf.c , AdvClientdlg.cpp , Consumer.Cpp , UtilLib.h
  • BLUE_COLOR : DoServer.h
  • BMID_BASED : MfEdit.h
  • BMID_BASEU : MfEdit.h
  • BMID_BEZIERD : MfEdit.h
  • BMID_BEZIERU : MfEdit.h
  • BMID_BMPOBJD : MfEdit.h
  • BMID_BMPOBJU : MfEdit.h
  • BMID_ELLIPSED : MfEdit.h
  • BMID_ELLIPSEU : MfEdit.h
  • BMID_FFD : MfEdit.h
  • BMID_FFU : MfEdit.h
  • BMID_FILLELLIPSED : MfEdit.h
  • BMID_FILLELLIPSEU : MfEdit.h
  • BMID_FILLRECTD : MfEdit.h
  • BMID_FILLRECTU : MfEdit.h
  • BMID_LINED : MfEdit.h
  • BMID_LINEU : MfEdit.h
  • BMID_METAFD : MfEdit.h
  • BMID_METAFU : MfEdit.h
  • BMID_OPEND : MfEdit.h
  • BMID_OPENU : MfEdit.h
  • BMID_PEND : MfEdit.h
  • BMID_PENU : MfEdit.h
  • BMID_PLAYD : MfEdit.h
  • BMID_PLAYU : MfEdit.h
  • BMID_RECORDD : MfEdit.h
  • BMID_RECORDU : MfEdit.h
  • BMID_RECTD : MfEdit.h
  • BMID_RECTU : MfEdit.h
  • BMID_STOPD : MfEdit.h
  • BMID_STOPU : MfEdit.h
  • BMID_TEXTD : MfEdit.h
  • BMID_TEXTU : MfEdit.h
  • BMID_TOOLBASED : MfEdit.h
  • BMID_TOOLBASEU : MfEdit.h
  • BMP_STORAGE : DfV.h
  • BMP_STREAM : DfV.h
  • BOOL : suminfo.Cpp
  • BOOT_INI : Monkey.h
  • BORDER : Paint.h , SpinTest.h
  • BOTTOM : Rebar.c
  • BOTTOM_BORDER : DebMain.c
  • BOUNCECLASS : Bounce.h
  • BOUNCETITLE : GdiDemo.h
  • BOUNDARY_MAXSIZE : callback.Cpp
  • BPITEM_BREAKPOINT : DbgCmd.c
  • BPITEM_WATCHPOINT : DbgCmd.c
  • BRANCH : Monkey.h
  • BREAK_ON_ERROR : globals.h
  • BREAKINTO : common.h
  • BS_3STATE : winres.h
  • BS_AUTO3STATE : winres.h
  • BS_AUTOCHECKBOX : winres.h
  • BS_AUTORADIOBUTTON : winres.h
  • BS_CHECKBOX : winres.h
  • BS_DEFPUSHBUTTON : winres.h
  • BS_GROUPBOX : winres.h
  • BS_LEFTTEXT : winres.h
  • BS_OWNERDRAW : winres.h
  • BS_PUSHBUTTON : winres.h
  • BS_RADIOBUTTON : winres.h
  • BS_USERBUTTON : winres.h
  • BSEG : GLOBAL.h
  • bSHARE_DENYNONE : wn_dos.h
  • bSHARE_DENYRDWR : wn_dos.h
  • bSHARE_DENYWR : wn_dos.h
  • BST2STATE : cdialoglite.h
  • BST3STATE : cdialoglite.h
  • BSTACK : GLOBAL.h
  • BUF_SIZE : pipe.hxx
  • BUFF_SIZE : Redirect.cpp
  • BUFFER_FILENAME : spy.cpp
  • BUFFER_ID : spy.cpp
  • BUFFER_LEN : WSnmpUtil.h
  • BUFFER_LENGTH : spy.cpp , readcli.c , spy.cpp
  • BUFFER_LINENUMBER : spy.cpp
  • BUFFER_SIZE : UnBufCp1.c , Client.c , gutils.h , UnBufCp2.c , DebDebug.c
  • BUFFERSIZE : MqApiTst.h , RequestCert.Cpp
  • BUFFLEN : utils.cpp
  • BUFFSIZE : Generic.C
  • BUFSIZE : Mcastws1.c , MciPlay.c , Common.h , Mcastws2.c
  • BUTTON_BORDER : ToolBar.c
  • BUTTON_COUNT : MainWND.c
  • BUTTONBAR_BORDER : ToolBar.c
  • BUTTONGROUP_ACTIVE : BttnCur.h
  • BUTTONGROUP_BLANK : BttnCur.h
  • BUTTONGROUP_DISABLED : BttnCur.h
  • BUTTONGROUP_DOWN : BttnCur.h
  • BUTTONGROUP_LIGHTFACE : BttnCur.h
  • BUTTONHEIGHT : ToolBar.c , Global.h
  • BUTTONWIDTH : ToolBar.c , Global.h , ToolBar.c
  • BYTE : suminfo.Cpp
  • BYTE_OFFSET : util.h , scpcmenuui.h
  • BYTE_SIZE : globals.h
  • BYTESPERLINE : strmvwr.Cxx , DIBSectn.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- c -

  • C_MIDI_BUFFERS : MidiPlyr.h
  • C_TEMPO_MAP_CHK : SMFI.h
  • CACCELERATORS : Resource.h
  • CACHE_PAGE : CacheIsapi.cpp
  • CALLBACK : cdialog.h
  • CALLTIMEOUT : Client.h
  • CALLTIMEOUTWHENPINGING : Client.h
  • CAND_CX : IMEApps.h
  • CARET_HEIGHT : MfEdit.h
  • CASE_DESC : globals.h
  • CASE_DESC_A : globals.h
  • CASE_ICON_INDEX : globals.h
  • CASE_LANGBARITEMSINK_COOKIE : langbar.cpp
  • CASE_LANGID : globals.h
  • CASE_MODEL : globals.h
  • CASE_OF : AsyncDemo.cpp
  • CASE_SCODE : dbgUtil.c
  • CASEMSG : Range.c
  • CATCHDB : adoheader.h
  • cAuthnEntries : secClnt.Cpp
  • cAuthnLevelEntries : secClnt.Cpp , secSvr.Cpp
  • cAuthzEntries : secClnt.Cpp
  • CB_ADDSTRING : winres.h
  • CB_CLASS_NAME : CommBand.h
  • CB_MIDI_BUFFERS : MidiPlyr.h
  • CB_TIME_FORMATS : MidiPlyr.h
  • CBCLIENTWNDEXTRA : Framer.h
  • CBCREATEGIZMO : GizmoBar.h
  • CbFileSizePsffs : wn_dos.h
  • CBFRAMEWNDEXTRA : Framer.h
  • CBGBGETINT : GizmoBar.h
  • CBGBGETTEXT : GizmoBar.h
  • CBGBMSG : GizmoBar.h
  • CBGBSETINT : GizmoBar.h
  • cbMaxFile : wn_dos.h
  • cbNewSection : suminfo.h
  • cbNewSummaryInfo : suminfo.h
  • CbReadHfile : wn_dos.h
  • CbReadOsfn : wn_dos.h
  • CbReadOsfnWin : wn_dos.h
  • CBRS_BOTTOM : afxres.h
  • CBRS_LEFT : afxres.h
  • CBRS_NOALIGN : afxres.h
  • CBRS_RIGHT : afxres.h
  • CBRS_TOP : afxres.h
  • CBS_AUTOHSCROLL : winres.h
  • CBS_DISABLENOSCROLL : winres.h
  • CBS_DROPDOWN : winres.h
  • CBS_DROPDOWNLIST : winres.h
  • CBS_HASSTRINGS : winres.h
  • CBS_NOINTEGRALHEIGHT : winres.h
  • CBS_OEMCONVERT : winres.h
  • CBS_OWNERDRAWFIXED : winres.h
  • CBS_OWNERDRAWVARIABLE : winres.h
  • CBS_SIMPLE : winres.h
  • CBS_SORT : winres.h
  • CbSzFilePsffs : wn_dos.h
  • CBWNDEXTRAFRAME : FVText.h
  • CBWNDEXTRAVIEWPORT : FVText.h
  • CCH_FINDSTRING : findgoto.h
  • CCH_GETPROPERTYINFO_DESCRIP_BUFFER_SIZE : utilprop.h
  • CCH_MAXDIGITS : findgoto.h
  • CCHMAX : Global.h , precomp.h , Global.h
  • CCHSTATUSMSGMAX : Resource.h
  • CCHSTRINGMAX : Resource.h
  • CCHSTYLE : SpinCube.h
  • CCLRPREDEF : fakemenu.c
  • CD_NETWORK : Globals.h
  • CD_NODE : Globals.h
  • CD_SOCKET : Globals.h
  • CD_STATUS : Globals.h
  • CE_Display : configentry.h
  • ceERRORPRINTLINE : CeLibW2k.h
  • ceEXITEVENTS : exit.cpp , Exit.Cpp
  • CELEMS : customdial.cpp , customentry.c , PhoneEntry.c , RasGetConnectionStatistics.c , RasDial.c , RasDialAsync.c , RasEnumConnections.c , RasEnumDevices.c , RasEnumentries.c , RasHost.Cpp , Admapit.c , AdminDll.c , packet.c , test.c
  • CELL_VALID : tpriv.h
  • CENCODEMAX : CeLibW2k.h
  • CERTLIB_12BITERRORMASK : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • CERTLIB_WIN32ERRORMASK : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • CERTTYPE_ATTR_NAME : Exit.Cpp
  • CF_CUSTOMLINKSOURCE : OleStd.h
  • CF_EMBEDDEDOBJECT : OleStd.h
  • CF_EMBEDSOURCE : DataObj.h , OleStd.h
  • CF_FILENAME : OleStd.h
  • CF_LINKSOURCE : OleStd.h
  • CF_LINKSRCDESCRIPTOR : OleStd.h
  • CF_OBJECTDESCRIPTOR : OleStd.h
  • CF_OWNERLINK : OleStd.h
  • CFD_BASE : FontView.h
  • CFD_CHARSET : FontView.h
  • CFD_CLIPPRECISION : FontView.h
  • CFD_DEFAULT : FontView.h
  • CFD_ESCAPEMENT : FontView.h
  • CFD_FACENAME : FontView.h
  • CFD_HEIGHT : FontView.h
  • CFD_ITALIC : FontView.h
  • CFD_ORIENTATION : FontView.h
  • CFD_OUTPUTPRECISION : FontView.h
  • CFD_PITCHANDFAMILY : FontView.h
  • CFD_QUALITY : FontView.h
  • CFD_STRIKEOUT : FontView.h
  • CFD_UNDERLINE : FontView.h
  • CFD_WEIGHT : FontView.h
  • CFD_WIDTH : FontView.h
  • CFP_BASE : FontView.h
  • CFP_CHARSET : FontView.h
  • CFP_CLIPPRECISION : FontView.h
  • CFP_ESCAPEMENT : FontView.h
  • CFP_FACENAME : FontView.h
  • CFP_FAMILY : FontView.h
  • CFP_HEIGHT : FontView.h
  • CFP_ITALIC : FontView.h
  • CFP_ORIENTATION : FontView.h
  • CFP_OUTPUTPRECISION : FontView.h
  • CFP_PITCH : FontView.h
  • CFP_QUALITY : FontView.h
  • CFP_STRIKEOUT : FontView.h
  • CFP_UNDERLINE : FontView.h
  • CFP_WEIGHT : FontView.h
  • CFP_WIDTH : FontView.h
  • CFSTR_DS_PARENTHWND : PropSheetHost.h
  • CFSTR_DS_PARENTHWND_A : PropSheetHost.h
  • CFSTR_DS_PARENTHWND_W : PropSheetHost.h
  • CFSTR_DS_PROPSHEETCONFIG : PropSheetHost.h
  • CFSTR_DS_PROPSHEETCONFIG_A : PropSheetHost.h
  • CFSTR_DS_PROPSHEETCONFIG_W : PropSheetHost.h
  • CFSTR_SAMPVIEWDATA : Utility.h
  • CHANGE : Check_SD.h
  • CHANGE_DURATION_PAGE : CacheIsapi.cpp
  • CHANNELNAME : SysInfo.h
  • CHAR : suminfo.Cpp , APP.h
  • CHAR_CONVERSION : debug.h
  • chDOSPath : wn_dos.h
  • chDOSWildAll : wn_dos.h
  • chDOSWildSingle : wn_dos.h
  • CHECK_ERROR : httpauth.cpp
  • CHECK_HR : helper.h , prsample.h
  • CHECK_MEMORY : prsample.h , common.h , sampprov.h , winmain.h , common.h
  • CHECK_POINTER : LinkList.c
  • CHECK_STATUS : DynOuts.c
  • CheckAndLocalFree : MyToken.cpp , SuperUsr.cpp , RSACert.cpp , RSAKey.cpp , SignHash.cpp
  • CHECKC : common.h
  • CHECKERRS : custom.c
  • CheckHresult : AdsiDump.cpp
  • CheckHresultADs : AdsiDump.cpp
  • CHECKMENU : sdkdiff.cpp
  • CHECKPOINTER : debug.h
  • CheckProperty : FullIME.h
  • CHECKTEST : custom.c
  • CHELPITEMS : Resource.h
  • CHILD : Monkey.h
  • chNull : Global.h
  • chPeriod : Utility.c
  • chSpace : Utility.c
  • CI_COMP : compitem.h
  • CI_LEFT : compitem.h
  • CI_RIGHT : compitem.h
  • cImpLevelEntries : secClnt.Cpp , secSvr.Cpp
  • CIMTYPEQUAL : UtilLib.h
  • CiPtrToUint : minici.hxx
  • CKHR : AppUtil.h
  • CLASS_GIZMOBAR : GizmoBar.h
  • CLASS_HATCH : hatch.c
  • classmodel : dballoc.Cpp
  • CLASSPROP : UtilLib.h
  • CLEARBIT : CeLibW2k.h
  • ClearStruct : Global.h
  • ClearSumInf : suminfo.h
  • CLIENT_BUFFER_SIZE : Pipec.c
  • CLIENT_RESPONSE_TIMEOUT : RasHost.h
  • CLIENT_WINDOW_TITLE : LocServe.h , AptServe.h
  • ClientCompletionPortTimeout : FileRepClientProc.cpp
  • CLIENTWL_STRUCTURE : Framer.h
  • CLIENTWND : GdiDemo.h
  • CLIPBOOKSERVER_SINGLE_INSTANCE_SEMAPHORE : ClipBook Server.cpp
  • CLIPBOOKSERVER_SVCNAME : ClRes.h
  • CLOSEEVENT : Overlap.c
  • CloseKeys : profile.h
  • CLOSESOCK : Overlap.c
  • CLR_BLUE : ChildWnds.cpp
  • CLR_GRAY : ChildWnds.cpp
  • CLSID_DEFINED : iapplet.c , ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c
  • CLSID_STRLEN : register.cpp
  • CLSIDFromProgIDA : ansiapi.h
  • CLSIDFromStringA : ansiapi.h
  • CLUSCTL_RESOURCE_FILESHARESAMPLE_CALL_ISALIVE : File Share Sample.cpp , StdAfx.h
  • CLUSDISK_SRB_SIGNATURE : CStorageResource.cpp
  • CLUSTER_MENU_BASE_ID : ExtObjData.cpp
  • CLUSTER_MENU_ID_1 : ExtObjData.cpp
  • CLUSTER_RESTYPE_DEFAULT_IS_ALIVE : CMgdResType.cpp , CStorageResType.cpp
  • CLUSTER_RESTYPE_DEFAULT_LOOKS_ALIVE : CMgdResType.cpp , CStorageResType.cpp
  • CMAPHEX : Grid.Cxx
  • CMD_ADD_OBJECT : nshsamp.h
  • CMD_LINE_ARGS : WSnmpUtil.h
  • CMD_RESET_OBJECT : nshsamp.h
  • CMD_RESET_OBJECT_ALL : nshsamp.h
  • CMD_RESET_OBJECT_SPROCKETS : nshsamp.h
  • CMD_RESET_OBJECT_WIDGETS : nshsamp.h
  • CMD_SET_GATEWAY : nshsamp.h
  • CMD_SET_INTERFACE : nshsamp.h
  • CMD_SET_OBJECT : nshsamp.h
  • CMD_SET_RANDOM_STUFF : nshsamp.h
  • CMD_SHOW_OBJECT : nshsamp.h
  • CMD_SHOW_RANDOM : nshsamp.h
  • CMD_SHOWERROR : nshsamp.h
  • CMENUS : Resource.h
  • CMSAMPLE_STARTING_BUF_SIZE : cmsample.cpp
  • COINIT_APARTMENTTHREADED : OleApt.Cpp , OleImp.Cpp
  • COLINFO_SIZE : tablecopy.h
  • COLLECTION_VERSION : stdafx.h
  • COLNAME_START : quiktest.h
  • CoLoadLibraryA : ansiapi.h
  • COLOR_COL : people.Cpp
  • COLOR_SCALE_BLUE : AppUtil.h , GdiDemo.h , AppUtil.h
  • COLOR_SCALE_GRAY : AppUtil.h , GdiDemo.h
  • COLOR_SCALE_GREEN : AppUtil.h , GdiDemo.h
  • COLOR_SCALE_RED : AppUtil.h , GdiDemo.h , AppUtil.h
  • COLOR_USED : MfEdit.h
  • COLUMN_ACP : global.h
  • COLUMN_ALIGNVAL : sampclnt.h , sampprov.h
  • COLUMN_LANGID : global.h
  • COLUMN_LANGUAGE : global.h
  • COLUMN_NATIVECOUNTRY : global.h
  • COLUMN_NATIVELANG : global.h
  • COLUMN_OEMCP : global.h
  • ColumnHeadingSize : quelist.h
  • COM_RIGHTS_ACTIVATE_LOCAL : DComPerm.h
  • COM_RIGHTS_ACTIVATE_REMOTE : DComPerm.h
  • COM_RIGHTS_EXECUTE_LOCAL : DComPerm.h
  • COM_RIGHTS_EXECUTE_REMOTE : DComPerm.h
  • COMBINED_SIZE : quiktest.h
  • COMBO1 : resource.h
  • COMCTL32 : setupui.cpp
  • COMM_PORT_BAUD_RATE : nullmdm.h
  • COMM_PORT_DATA_BITS : nullmdm.h
  • COMM_PORT_STOP_BITS : nullmdm.h
  • COMM_PORT_TIMEOUT : nullmdm.h
  • COMMANDBUTTON_DISABLED : BttnCur.h
  • COMMANDBUTTON_MOUSEDOWN : BttnCur.h
  • COMMANDBUTTON_UP : BttnCur.h
  • COMMANDLINE : Server.c
  • COMPILE_MULTIMON_STUBS : tallmenu.c , fakemenu.c
  • COMPORTNAMEMAXLENGTH : nullmdm.h
  • COMPREAD_X : IMEApps.h
  • COMPREAD_Y : IMEApps.h
  • COMPSTR_X : IMEApps.h
  • COMPSTR_Y : IMEApps.h
  • Computer : resource.h
  • COMSYNC_OFFSET : Resource.h
  • CONNECTION_TYPE_LOCAL : ConnectDlg.Cpp
  • CONNECTION_TYPE_REMOTE : ConnectDlg.Cpp
  • CONNECTION_TYPE_UNDEFINED : ConnectDlg.Cpp
  • CONNIDMAXLENGTH : plugxprt.h , nmsession.h
  • CONST : scandir.h
  • CONST_VTABLE : Priv.h
  • CONSTANT : InOutp.c
  • CONSTANT_VALUE : GenCtrnm.h
  • CONSTANT_VALUE_VALUE : Perfgen.c
  • CONTAINING_RECORD : defs.h
  • CONTENT_BUF_LENGTH : keys.cpp
  • CONTRACT_FILE : cdbfile.h
  • CONVERT_WCHAR : ssl.c
  • COORD : APP.h
  • COPY_FROMLEFT : complist.h
  • COPY_FROMRIGHT : complist.h
  • COPY_HITREADONLY : complist.h
  • CopySzFilePsffs : wn_dos.h
  • COUNTER_STRING_SIZE : MainWnd.h
  • COUNTOF : StdAfx.h
  • countof : AdvReco.cpp , TPCInfo.cpp , MultiReco.cpp
  • Country : resource.h
  • CP_LENGTH : tablecopy.h
  • CP_MAXLENGTH : tablecopy.h
  • CP_PRECISION : tablecopy.h
  • CP_SCALE : tablecopy.h
  • cpeAppPal : app.Cpp , stdpal.c
  • cPIDSI_STANDARD : suminfo.h
  • CPP_CLASS_NAME : Server.Cpp
  • CQBITS : autotest.h
  • CREATE_READ_WRITE_LOCK : sync.h
  • CREATE_TIMER : defs.h
  • CreateFileMonikerA : ansiapi.h
  • CREATEROWS : resource.h
  • CREDIT : resource.h
  • CriticalSectionOwned : common.h
  • CRL_PUBLISH_RETRY_DEFAULT : Exit.h
  • CRYPT32_DLL : vertrust.cpp
  • CRYPTOAPI_CertCompareCertificate : vertrust.cpp
  • CRYPTOAPI_CertDuplicateCertificateContext : vertrust.cpp
  • CRYPTOAPI_CertFreeCertificateContext : vertrust.cpp
  • CSCONST : stdpal.h
  • cServerEntries : secClnt.Cpp
  • cServerThreads : OleImp.Cpp , OleApt.Cpp , ComPerf.Cpp
  • CT_CONNECT : people.h
  • CT_EXIT : people.h
  • CT_GET_PTR : people.h
  • CTBBITMAPS : Resource.h
  • CTBBUTTONS : Resource.h
  • CTE_ENCODER_SIZE : cte_enc.c
  • CTE_MAX_CHUNK_HEADER_SIZE : cte_enc.c
  • CTE_MAX_ENCODING_OVERHEAD : cte_enc.c
  • CUNITSTABLEMAX : celib.cpp , CeLib.Cpp , celib.cpp , CeLib.Cpp
  • CVT_BASE : CeLibW2k.h
  • CVT_DAYS : CeLibW2k.h
  • CVT_HOURS : CeLibW2k.h
  • CVT_MINUTES : CeLibW2k.h
  • CVT_SECONDS : CeLibW2k.h
  • CVT_WEEKS : CeLibW2k.h
  • CVTBUFSIZE : Consumer.Cpp , UtilLib.h , AdvClientdlg.cpp
  • CVTFAILED : UtilLib.h
  • cwcCHOPBASE : CeFormat.Cpp , ceformat.cpp
  • cwcCHOPHASHMAX : ceformat.cpp , CeFormat.Cpp
  • cwcCNMAX : CeFormat.Cpp , ceformat.cpp
  • cwcFILENAMESUFFIXMAX : CeLibW2k.h
  • cwcHRESULTSTRING : CeLibW2k.h
  • cwcSUFFIXMAX : CeLibW2k.h
  • CX_DEFWIDTH : AppBar.h
  • CXFAKEMENU : fakemenu.c
  • CXN_BDADDR_STR_LEN : bthcxn.cpp
  • CXN_DELAY_NEXT_INQUIRY : bthcxn.cpp
  • CXN_MAX_INQUIRY_RETRY : bthcxn.cpp
  • CXN_TRANSFER_DATA_LENGTH : bthcxn.cpp
  • CY_DEFHEIGHT : AppBar.h
  • CYBUTTONBAR120 : BttnCur.h
  • CYBUTTONBAR72 : BttnCur.h
  • CYBUTTONBAR96 : BttnCur.h
  • CYCOLOR : fakemenu.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- d -

  • D : debug.h , DbgOut.h
  • D1 : Debug.h
  • D2 : Debug.h
  • D3 : Debug.h
  • D4 : Debug.h
  • DA_ARCHIVE : wn_dos.h
  • DA_HIDDEN : wn_dos.h
  • DA_NIL : wn_dos.h
  • DA_NORMAL : wn_dos.h
  • DA_READONLY : wn_dos.h
  • DA_SUBDIR : wn_dos.h
  • DA_SYSTEM : wn_dos.h
  • DA_VOLUME : wn_dos.h
  • DARKGRAY : MfEdit.h
  • DAT : wn_dos.h
  • DATA_BUFSIZE : deviceprop.cpp , genericucpdlg.h
  • DATASUFFIX : FindStream.c
  • DB_CLASS_NAME : DeskBand.h
  • DB_MIN_SIZE_X : DeskBand.h
  • DB_MIN_SIZE_Y : DeskBand.h
  • DBFILE_FLUSH_ERROR : cdbfile.h
  • DBG_PRINT : ClRes.h
  • DBGCMD_BREAKPOINT : DbgCmd.c
  • DBGCMD_CLEARBP : DbgCmd.c
  • DBGCMD_GO : DbgCmd.c
  • DBGCMD_QUIT : DbgCmd.c
  • DBGCMD_SHOWHELP : DbgCmd.c
  • DBGCMD_UNKNOWN : DbgCmd.c
  • DBGCMD_WATCHPOINT : DbgCmd.c
  • DbgEnable : Debug.h
  • DbgInitialize : Debug.h
  • DBGOUT : Atsp.h
  • DBGPRINT : CeLibW2k.h
  • DbgSetLevel : Debug.h
  • DbgWrite : AuthFilt.h
  • DBINITCONSTANTS : oledbcomponent.h , Guids.Cpp , main.cpp , common.cpp , sampclnt.cpp , globals.cpp , tablecopy.cpp , common.cpp , AdvQuery.Cxx , QSample.Cxx
  • DBNTWIN32 : bankdlg.Cpp , MqTrans.Cpp
  • DBTYPE_SRC_DST : common.h
  • DC_DATA : ShlFldr.Cpp
  • DC_NAME : ShlFldr.Cpp
  • DD_DEFDRAGDELAY : OleStd.h
  • DD_DEFDRAGMINDIST : OleStd.h
  • DD_DEFSCROLLINTERVAL : OleStd.h
  • DEBIT : resource.h
  • DEBUG : Comp.c , Paint.c
  • DEBUG_FMT_CHARS : AppUtil.h
  • DEBUG_LOG_MAX_SIZE : dbgmsg.h , DbgMsg.h
  • DEBUG_MAX_LINE_LEN : Debug.h
  • DEBUG_MODULE_NAME : Debug.h
  • DEBUG_PRINT : FCopy.Cpp , Mount.Cpp
  • DEBUG_SECTION : Debug.h
  • DEBUG_SIMPLE : Simple.c
  • DEBUGCODE : asserts.h
  • DEBUGGER : Dt.h
  • DEBUGOUT : GdiDemo.h
  • DEBUGTRACE : debug.h
  • DECIMAL : Grid.Hxx
  • DECLARE_DEBUG : Debug.Hxx
  • DECLARE_FIXED_ALLOC : heap.h
  • DECLARE_INFOLEVEL : Debug.Hxx
  • DECLARE_IUNKNOWN : cunknown.h
  • DECLARE_REGISTRY_CLSID : StdAfx.h , stdafx.h
  • DECLARE_UNKNOWN : UNK.H
  • DECLAREADSPROC : StdAfx.h
  • DECLSPEC_UUID : adoint.h
  • DEF_PTSIZE : status.cpp
  • DEF_QUEUE_LEN : PrPerf.c
  • DEF_SERVER_NAME : PrPerf.c
  • DEF_SERVER_TYPE : PrPerf.c
  • DEF_SERVER_ZONE : PrPerf.c
  • DEFAULT_ADDRESS_FAMILY : common.h , TestAccept.cpp
  • DEFAULT_ADDRESS_IP : WSnmpUtil.h
  • DEFAULT_ALLOW_UNMAPPED : ReMapUrl.cpp
  • DEFAULT_BACKLOG : Overlap.c
  • DEFAULT_BUFFER_LEN : Ioctl.c , Simplec.c , Simples.c
  • DEFAULT_CACHE_SECONDS : CacheIsapi.cpp
  • DEFAULT_CAND_NUM_PER_PAGE : FullIME.h
  • DEFAULT_CBMAXLENGTH : sampclnt.h
  • DEFAULT_CHUNK_SIZE : ctetest.c
  • DEFAULT_COLOR : DoServer.h
  • DEFAULT_COUNT : rawudp.c , Mcastws1.c , Mcastws2.c
  • DEFAULT_DATA : ShlFldr.Cpp
  • DEFAULT_DATA_SIZE : Ping.cpp
  • DEFAULT_DELAY : TestAccept.cpp
  • DEFAULT_DEVICE_LIFETIME : RegDevice.cpp
  • DEFAULT_EVENTS : TraceDp.c
  • DEFAULT_FONT : global.h
  • DEFAULT_HATCHBORDER_WIDTH : OleStd.h
  • DEFAULT_HEADERS : IsapiRequest.h
  • DEFAULT_INTERFACE : common.h
  • DEFAULT_LOGFILE_NAME : TraceLog.c
  • DEFAULT_LOGOFF_URL : CustomAuth.h
  • DEFAULT_LOGON_SUCCESS_URL : CustomAuth.h
  • DEFAULT_LOGON_TIMEOUT : CustomAuth.h
  • DEFAULT_LOGON_TYPE : CustomAuth.h
  • DEFAULT_LOGON_URL : CustomAuth.h
  • DEFAULT_LOOP_COUNT : TestAccept.cpp
  • DEFAULT_LSP_NAME : instlsp.cpp
  • DEFAULT_M_TIMETOBERECEIVED : MqApiTst.h
  • DEFAULT_M_TIMETOREACHQUEUE : MqApiTst.h
  • DEFAULT_MAX_ALLOC_SIZE : IsapiBuffer.h
  • DEFAULT_MESSAGE : AsyncRPCc.c , rawudp.c
  • DEFAULT_MTU : rawudp.c
  • DEFAULT_MULTICASTGROUP : QosEvent.h
  • DEFAULT_NAMESPACE : tracedmp.h
  • DEFAULT_NOTIFICATION : AsyncRPCc.c
  • DEFAULT_PATH_LEN : instlsp.cpp
  • DEFAULT_POOL_COUNT : overlap.cpp
  • DEFAULT_PORT : common.h , TestAccept.cpp , IocpServer.h , rawudp.c , Overlap.c , Ioctl.c , Simplec.c , Simples.c
  • DEFAULT_PROMPT : DoServer.h
  • DEFAULT_PROTO : Simplec.c , Simples.c
  • DEFAULT_QUEUE : PoolWrap.cpp
  • DEFAULT_RDI_MASK : basenode.h
  • DEFAULT_RECV_BUFFER_SIZE : TestAccept.cpp
  • DEFAULT_RECV_TIMEOUT : Ping.cpp
  • DEFAULT_RESPONSE_BUFFER_SIZE : IsapiRequest.h
  • DEFAULT_SCENARIO : TestAccept.cpp
  • DEFAULT_SDI_MASK : basenode.h
  • DEFAULT_SEND_BUFFER_SIZE : TestAccept.cpp
  • DEFAULT_SEND_COUNT : rawudp.c , Ping.cpp
  • DEFAULT_SERVER : TestAccept.cpp
  • DEFAULT_STATUS : IsapiRequest.h
  • DEFAULT_STREAM : row.h
  • DEFAULT_STREAM_ORDINAL : row.h
  • DEFAULT_STRING_LEN : rnrcs.cpp
  • DEFAULT_STRING_SIZE : StdAfx.h
  • DEFAULT_THREADS : PoolWrap.cpp
  • DEFAULT_TTL : rawudp.c , Mcastws1.c , Mcastws2.c , Ping.cpp
  • DEFAULT_TYPE_OF_ACCEPT : common.h
  • DEFAULT_USE_BUILTIN_LOGOFF : CustomAuth.h
  • DEFAULT_USE_BUILTIN_LOGON : CustomAuth.h
  • DEFAULT_USE_CLIENT_IP : CustomAuth.h
  • DEFAULT_USE_SSL : CustomAuth.h
  • DEFAULT_X : DoServer.h
  • DEFAULT_Y : DoServer.h
  • DEFAULTCOMPORT : ui.cpp
  • DEFBKGDCOLOR : Main.c
  • DEFEXTSIZE : Open.h
  • DEFIMC1 : MultiUI.h
  • DEFIMC2 : MultiUI.h
  • DEFINE_ADDREF_RELEASE : sampprov.h
  • DEFINE_DAOGUID : adoid.h
  • DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE : sampprov.h
  • DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR : sampprov.h
  • DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA : sampprov.h
  • DEFINE_DLLREGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_DLLREGISTERFILTER2 : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_REGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_REGISTERFILTER2 : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_REGISTERFILTERBASE : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_SOFT_DLLREGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFINE_SOFT_REGISTERFILTER : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DEFNAME : NmPipe.c
  • DELAYBOX_DURATION : AppUtil.h
  • DELAYLOAD_FROM_WIN32 : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • DELETE_ACE : app.cpp
  • DELETE_COOKIE : CustomAuth.h
  • DELETE_LOCKED_LIST : sync.h
  • DELETE_LOCKED_QUEUE : sync.h
  • DELETE_POINTER : AppUtil.h
  • DELETE_READ_WRITE_LOCK : sync.h
  • DELETE_TIMER : defs.h
  • DeleteFile_AW : ansiapi.h
  • DeleteFontObject : global.h
  • DeleteInterfaceImp : Framer.h
  • DELIMITER : PerfUtil.c
  • DEPENDENCIES : Service.h , service.h
  • Dequeue : list.h
  • DESC_AD : quiktest.h
  • DESC_ALL : quiktest.h
  • DESC_APD : quiktest.h
  • DESC_ARD : quiktest.h
  • DESC_ID : quiktest.h
  • DESC_IPD : quiktest.h
  • DESC_IRD : quiktest.h
  • DESC_MOST : quiktest.h
  • DESC_NONE : quiktest.h
  • DESC_PD : quiktest.h
  • DESC_RD : quiktest.h
  • DESC_UPDATE_MODE_READ : quiktest.h
  • DESC_UPDATE_MODE_WRITE : quiktest.h
  • DESCRIPTION : InOutc.c
  • DEVICE_ABORTING : NewFsp.h
  • DEVICE_IDLE : NewFsp.h
  • DEVICE_RECEIVE : NewFsp.h
  • DEVICE_SEND : NewFsp.h
  • DEVICE_START : NewFsp.h
  • DHCP_PERSISTENT_APP_STRING : dhcppersist.cpp
  • DIAGRETCHECK : quiktest.h
  • DIALOGHEIGHT : PlgBlt.h
  • DIB_HEADER_MARKER : File.c
  • DID_BEZIER : MfEdit.h
  • DID_BMPOBJ : MfEdit.h
  • DID_CANCEL : Resource.h
  • DID_CLEAR : MfEdit.h
  • DID_COUNTER : MfEdit.h
  • DID_CTRLPANEL : MfEdit.h
  • DID_DRAW : PlgBlt.h
  • DID_EDITTEXT : Resource.h
  • DID_EIGHT : MfEdit.h
  • DID_ELLIPSE : MfEdit.h
  • DID_ERASE : SpinCube.h
  • DID_FF : MfEdit.h
  • DID_FILLELLIPSE : MfEdit.h
  • DID_FILLRECT : MfEdit.h
  • DID_FIVE : MfEdit.h
  • DID_FOUR : MfEdit.h
  • DID_HEIGHT : PlgBlt.h
  • DID_INMOTION : SpinCube.h
  • DID_LINE : MfEdit.h
  • DID_LISTBOX : Resource.h
  • DID_METAF : MfEdit.h
  • DID_NEWMASK : PlgBlt.h
  • DID_NEWSRC : PlgBlt.h
  • DID_NINE : MfEdit.h
  • DID_OK : Resource.h , SpinCube.h
  • DID_ONE : MfEdit.h
  • DID_OPEN : MfEdit.h
  • DID_P1X : PlgBlt.h
  • DID_P1Y : PlgBlt.h
  • DID_P2X : PlgBlt.h
  • DID_P2Y : PlgBlt.h
  • DID_P3X : PlgBlt.h
  • DID_P3Y : PlgBlt.h
  • DID_PEN : MfEdit.h
  • DID_PLAY : MfEdit.h
  • DID_RECORD : MfEdit.h
  • DID_RECT : MfEdit.h
  • DID_SEVEN : MfEdit.h
  • DID_SIX : MfEdit.h
  • DID_STOP : MfEdit.h
  • DID_TEN_PLUS : MfEdit.h
  • DID_TEXT : MfEdit.h
  • DID_THREE : MfEdit.h
  • DID_TMP : MfEdit.h
  • DID_TWO : MfEdit.h
  • DID_WIDTH : PlgBlt.h
  • DID_XMASK : PlgBlt.h
  • DID_XSRC : PlgBlt.h
  • DID_YMASK : PlgBlt.h
  • DID_YSRC : PlgBlt.h
  • DID_ZERO : MfEdit.h
  • DIGIT : PerfUtil.c
  • DIM : dballoc.Cpp
  • DIMA : dbh.cpp
  • DIMAT : dbh.cpp
  • DimensionOf : gutils.h
  • DINV : WinCap.c
  • DIR_MASK : sdksamplestoragesystem.h
  • DIR_MASK_LENGTH : sdksamplestoragesystem.h
  • DIRECT : MSMQTest.c
  • DISABLED : nshsamp.h
  • DISP_FILE_LINE : common.h
  • dispaddr : dbh.cpp
  • DISPID_CEGesture : EventSinks.h
  • DISPID_CEStroke : EventSinks.h
  • DISPID_GETHWND : EdCommands.idl , EdGlyphs.idl , EdHost.idl
  • DISPID_RERecognition : EventSinks.h
  • DISPID_RERecognitionWithAlternates : EventSinks.h
  • dispidICOMPerformance_Test1 : ComPerf.Cpp
  • dispidICOMPerformance_Test23 : ComPerf.Cpp
  • DISPLAY_SETTINGS_COUNT : Utility.Cpp
  • DISPLAYERROR : quiktest.h
  • DisplayIndexInterfaceEntry : networkentry.c
  • DisplayInterfaceEntry : networkentry.c
  • DisplayRtmDestInfo : rtmapi.c
  • DIVIDER : MDIChild.C
  • DIVISIONPOINTS : strmvwr.Cxx
  • DKGRAY_PEN : ToolBar.c
  • DL_DIRS : scandir.cpp
  • DL_FILES : scandir.cpp
  • DLG_ABOUT : VCExploreDlg.Cpp
  • DLG_APP_EXPORT : VCExploreDlg.Cpp
  • DLG_APP_INSTALL : VCExploreDlg.Cpp
  • DLG_APP_UTIL_START : VCExploreDlg.Cpp
  • DLG_APP_UTIL_STOP : VCExploreDlg.Cpp
  • DLG_COMPONENT_IMPORT : VCExploreDlg.Cpp
  • DLG_COMPONENT_INSTALL : VCExploreDlg.Cpp
  • DLG_CONNECT : VCExploreDlg.Cpp
  • DLG_FONT : resource.h , res.h
  • DLG_GENERAL : resource.h , res.h
  • DLG_LCID : resource.h , res.h
  • DLG_MIRRORING : resource.h , res.h
  • DLG_MUI : resource.h , res.h
  • DLG_NLS : resource.h , res.h
  • DLG_TEXT : resource.h , res.h
  • DLG_USP : resource.h , res.h
  • DLG_UTILITIES : VCExploreDlg.Cpp
  • DLG_VERFIRST : Generic.H , Resource.h , resource.h , StatList.h , LeakyBin.h
  • DLG_VERLAST : Generic.H , Resource.h , StatList.h , LeakyBin.h
  • DLGOPEN_BIG : Dialogs.h
  • DLGOPEN_DIR_LISTBOX : Dialogs.h
  • DLGOPEN_EDIT : Dialogs.h
  • DLGOPEN_FILE_LISTBOX : Dialogs.h
  • DLGOPEN_FOLDOUT : Dialogs.h
  • DLGOPEN_PATH : Dialogs.h
  • DLGOPEN_SMALL : Dialogs.h
  • DLGOPEN_TEXT : Dialogs.h
  • DLGTITLESIZE : Open.h
  • DLL_NAME : WebClient.c , WebServer.c
  • DLL_TUTFILE_STR : ComUser.h , DllUser.h
  • DLLENTRY : ComObj.h , FreServe.h , ConServe.h , DllServe.h , DllSkel.h , LicServe.h , PerDraw.h , PerServe.h , PerText.h , StoServe.h
  • DLLSERVE_TUTFILE_STR : LicClien.h
  • DLLSKELSHARED_STR : DllSkel.Cpp
  • DO_ERASE : SpinCube.h
  • DO_EXCEPTION : Common.h
  • DOC_NAME : DoServer.h
  • DOCUMENTNAME : queue.h
  • Domain : resource.h
  • DONE : APP.h
  • dosxSharing : wn_dos.h
  • DPF : Debug.h
  • DR7CLEAR : Utils.c
  • DR7SET : Utils.c
  • DRAW_WINDOW_CLASS_MENU_STR : RESDEF.h
  • DRAW_WINDOW_CLASS_NAME_STR : RESDEF.h
  • DRAW_WINDOW_NAME_STR : RESDEF.h
  • DRAWAXIS : Common.h
  • DRAWCLASS : Draw.h
  • DRAWTITLE : GdiDemo.h
  • DRV_ENABLE_DEBUG : Debug.h
  • DRV_SET_DEBUG_LEVEL : Debug.h
  • DS_ABSALIGN : winres.h
  • DS_DISABLED : MSMQTest.c
  • DS_ENABLED : MSMQTest.c
  • DS_LOCALEDIT : winres.h
  • DS_MODALFRAME : winres.h
  • DS_NOIDLEMSG : winres.h
  • DS_SETFONT : winres.h
  • DS_SYSMODAL : winres.h
  • DSPDxax : bitmaps.h
  • DTCODE___WSAFDIsSet : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_accept : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_bind : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_closesocket : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_connect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_freeaddrinfo : Dt_Dll.Hpp
  • DTCODE_getaddrinfo : Dt_Dll.Hpp
  • DTCODE_gethostbyaddr : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_gethostbyname : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_gethostname : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_getnameinfo : Dt_Dll.Hpp
  • DTCODE_getpeername : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getprotobyname : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_getprotobynumber : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getservbyname : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_getservbyport : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_getsockname : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_getsockopt : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_htonl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_htons : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_inet_addr : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_inet_ntoa : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_ioctlsocket : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_listen : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_NSPAddressToString : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPEnumNameSpaceProviders : Dt_Dll.h
  • DTCODE_NSPGetAddressByName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPGetServiceClassInfo : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPGetServiceClassNameByClassId : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPInstallServiceClass : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPIoctl : Dt_Dll.Hpp
  • DTCODE_NSPLookupServiceBegin : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPLookupServiceEnd : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_NSPLookupServiceNext : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPRemoveServiceClass : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPSetService : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_NSPStartup : Dt_Dll.Hpp
  • DTCODE_NSPStringToAddress : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_ntohl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_ntohs : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_recv : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_recvfrom : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_select : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_send : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_sendto : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_setsockopt : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_shutdown : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_socket : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUCloseEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUCloseSocketHandle : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUCloseThread : Dt_Dll.Hpp
  • DTCODE_WPUCompleteOverlappedRequest : Dt_Dll.Hpp
  • DTCODE_WPUCreateEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUCreateSocketHandle : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUFDIsSet : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUGetProviderPath : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUModifyIFSHandle : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WPUOpenCurrentThread : Dt_Dll.Hpp
  • DTCODE_WPUPostMessage : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUQueryBlockingCallback : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUQuerySocketHandleContext : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUQueueApc : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUResetEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WPUSetEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAccept : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAddressToStringA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAddressToStringW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAsyncGetHostByAddr : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAsyncGetHostByName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAsyncGetProtoByName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAAsyncGetProtoByNumber : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAsyncGetServByName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAsyncGetServByPort : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAAsyncSelect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSACancelAsyncRequest : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSACancelBlockingCall : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSACleanup : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSACloseEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAConnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSACreateEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSADuplicateSocketA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSADuplicateSocketW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAEnumNameSpaceProvidersA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAEnumNameSpaceProvidersW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAEnumNetworkEvents : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAEnumProtocolsA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAEnumProtocolsW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAEventSelect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAGetLastError : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAGetOverlappedResult : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAGetQOSByName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetServiceClassInfoA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAGetServiceClassInfoW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAGetServiceClassNameByClassIdA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAGetServiceClassNameByClassIdW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAHtonl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAHtons : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAInstallServiceClassA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAInstallServiceClassW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAIoctl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAIsBlocking : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAJoinLeaf : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSALookupServiceBeginA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSALookupServiceBeginW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSALookupServiceEnd : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSALookupServiceNextA : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSALookupServiceNextW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSANSPIoctl : Dt_Dll.Hpp
  • DTCODE_WSANtohl : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSANtohs : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAProviderConfigChange : Dt_Dll.Hpp
  • DTCODE_WSARecv : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSARecvDisconnect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSARecvFrom : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSARemoveServiceClass : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAResetEvent : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASend : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSASendDisconnect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASendTo : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASetBlockingHook : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSASetEvent : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSASetLastError : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSASetServiceA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASetServiceW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSASocketA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSASocketW : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAStartup : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSAStringToAddressA : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAStringToAddressW : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAUnhookBlockingHook : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSAWaitForMultipleEvents : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCDeinstallProvider : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCEnableNSProvider : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCEnumProtocols : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCGetProviderPath : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCInstallNameSpace : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSCInstallProvider : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCUnInstallNameSpace : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSCUpdateProvider : Dt_Dll.Hpp
  • DTCODE_WSCWriteNameSpaceOrder : Dt_Dll.Hpp
  • DTCODE_WSCWriteProviderOrder : Dt_Dll.Hpp
  • DTCODE_WSPAccept : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPAddressToString : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPAsyncSelect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPBind : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPCancelBlockingCall : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPCleanup : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPCloseSocket : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPConnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPDuplicateSocket : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPEnumNetworkEvents : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPEventSelect : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPGetOverlappedResult : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPGetPeerName : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPGetQOSByName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPGetSockName : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPGetSockOpt : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPIoctl : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPJoinLeaf : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPListen : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPRecv : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPRecvDisconnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPRecvFrom : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSelect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSend : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSendDisconnect : Dt_Dll.h , Dt_Dll.Hpp
  • DTCODE_WSPSendTo : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPSetSockOpt : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPShutdown : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPSocket : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPStartup : Dt_Dll.Hpp , Dt_Dll.h
  • DTCODE_WSPStringToAddress : Dt_Dll.h , Dt_Dll.Hpp
  • Dummy : resource.h
  • DUMMY : Resource.h
  • dump : utiltest.cpp
  • DUMP_ERROR_LINENUMBER : sampclnt.h
  • DUMP_FILE_NAME : tracedmp.h
  • DUMP_SAMP : nshsamp.h
  • DUMP_SAMP_BASE : nshsamp.h
  • DUMP_SAMPINTERFACE : nshsamp.h
  • dumpsym : dbh.cpp
  • DUPE : GssClient.c , GssServer.c
  • DWL_THREADWNDPROCCLASS : Handler.h
  • DWORD : suminfo.Cpp
  • DWORD_MULTIPLE : PerfUtil.h
  • DWORDALIGN : malspy.c
  • DWORDSWAP : SMFI.h
  • DXP_SEND : Global.h
  • DXP_ULIST : Global.h
  • DYNAMIC_CHANNEL_RESOURCE_ID : session.cpp
  • DYNAMIC_LOCKS_HIGH_THRESHOLD : sync.h
  • DYNAMIC_LOCKS_STORE_INITIALIZED : sync.h
  • DYP_SEND : Global.h
  • DYP_ULIST : Global.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- e -

  • E_DELAYLOAD_MOD_NOT_FOUND : CeError.Cpp , ceerror.cpp , CeError.Cpp
  • E_DELAYLOAD_PROC_NOT_FOUND : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • EAN_NAMEOBJECTID : AltName.Cpp
  • EB_CLASS_NAME : ExplrBar.h
  • EB_HATCHRECT_BOTTOM : hatch.c
  • EB_HATCHRECT_LEFT : hatch.c
  • EB_HATCHRECT_RIGHT : hatch.c
  • EB_HATCHRECT_TOP : hatch.c
  • EB_HATCHWIDTH : hatch.c
  • EC_CHILD : Dt.h
  • EcFindFirst4dm : wn_dos.h
  • EcFindFirstCore : wn_dos.h
  • EcFindNext4dm : wn_dos.h
  • ED_BASE : FontView.h
  • ED_HEX : FontView.h
  • ED_NEXT : FontView.h
  • ED_PREV : FontView.h
  • ED_SAMPLE : FontView.h
  • ED_SET : FontView.h
  • ED_TYPE : FontView.h
  • EDIT1 : resource.h
  • EDIT2 : resource.h
  • EDIT3 : resource.h
  • EDIT4 : resource.h
  • EDIT_VIEW_COOKIE : tsfedit.h
  • EDITOR_EXE_STR : AppUtil.h
  • EE_Display : configentry.h
  • ELLIPSE : Common.h
  • EMBEDDINGFLAG : Utils.h , OleStd.h
  • ENABLE_BIT : common.h
  • ENABLED : nshsamp.h
  • ENCODING : CreateCert.c , SignHash.cpp
  • ENCRYPT_ALGORITHM : Decrypt.c , Encrypt.c
  • ENCRYPT_BLOCK_SIZE : Decrypt.c , Encrypt.c
  • END_DEAD : Server32.h
  • END_LIVE : Server32.h
  • END_POINT : Common.h
  • END_STEP : RendSam.Cpp
  • Enqueue : list.h
  • ENTER_SAMPLE_API : defs.h
  • ENTER_SAMPLE_WORKER : defs.h
  • ENTITY_BANKS : limits.h
  • ENTITY_PER_BANK : limits.h
  • ENTRY : secClnt.Cpp , secSvr.Cpp
  • ENUMFONTS : Common.h
  • EOAC_DYNAMIC_CLOAKING : Main.cpp
  • EOL : common.h , sampprov.h , common.h
  • epEmptyString : string.h
  • Epilog : Atsp.h
  • EPSILON : Track.c
  • EQUAL : common.h
  • ERR : Overlap.c
  • ERR_911WARN : Dialer.h
  • ERR_INVALID_ERROR_CODE : nshsamp.h
  • ERR_INVALID_NUM_ARGS : nshsamp.h
  • ERR_LINECLOSE : Dialer.h
  • ERR_MOD_NAME : Enumprt.h , Getcaps.h , Getpdriv.h , Paint.h , Printer.h
  • ERR_NEWDEFAULT : Dialer.h
  • ERR_NO_VALID_COUNT : nshsamp.h
  • ERR_NOLINES : Dialer.h
  • ERR_NONE : Dialer.h
  • ERR_NOVOICELINE : Dialer.h
  • ERR_SAMP_BASE : nshsamp.h
  • ErrMsgBox : Common.h
  • ERROR_BUFFER_SIZE : DebMisc.c
  • ERROR_COLUMN : bankdlg.Cpp
  • ERROR_IN_ROW_DATA : cdbfile.h
  • ERROR_INSUFFICIENT_FUNDS : common.h
  • ERROR_LENGTH : ErrorOut.h
  • ERROR_MAX : ErrorOut.h
  • ERROR_MODE_PRINTFIELDS : UtilLib.h
  • ERROR_MODE_PRINTMOF : UtilLib.h
  • ERROR_MSG : Global.h
  • ERROR_TITLE_STR : AppUtil.h
  • ErrorHandler : VListVw.c , Globals.h
  • ERRSHANDLE : quiktest.h
  • ES_AUTOHSCROLL : winres.h
  • ES_AUTOVSCROLL : winres.h
  • ES_CENTER : winres.h
  • ES_LEFT : winres.h
  • ES_LOWERCASE : winres.h
  • ES_MULTILINE : winres.h
  • ES_NOHIDESEL : winres.h
  • ES_OEMCONVERT : winres.h
  • ES_PASSWORD : winres.h
  • ES_READONLY : winres.h
  • ES_RIGHT : winres.h
  • ES_UPPERCASE : winres.h
  • ES_WANTRETURN : winres.h
  • EvalThisChar : PerfUtil.c
  • EVENT_CH_B1 : SMFI.h
  • EVENT_CH_B2 : SMFI.h
  • EVENT_LENGTH : Resource.h
  • EVENT_LEVEL_DEFAULT : tracedmp.h
  • EVENT_META_TYPE : SMFI.h
  • EVENT_TYPE : SMFI.h
  • EVENT_TYPE_DEFAULT : tracedmp.h
  • EVENT_VERSION_DEFAULT : tracedmp.h
  • EVENTCLASS : EvProv.h
  • EXACT_MATCH : MfEdit.h
  • EXCEPTION_VDM_EVENT : DebDebug.h
  • EXECUTION_FAILED : Common.h
  • EXECUTION_OK : Common.h
  • exit : Adminwrap.Cpp
  • EXIT_IF_FAIL : Common.h , common.h , Common.h , common.h
  • EXPAND_FILE : cdbfile.h
  • EXPENSE_APPROVED : common.h
  • EXPENSE_UNKNOWN_ERROR : common.h
  • EXPORT : SimpCntr.h , OleStd.h
  • EXPORT_TYPE_UNDEFINED : AppExportDlg.Cpp
  • EXPORT_TYPE_WITH_CLIENTS : AppExportDlg.Cpp
  • EXPORT_TYPE_WITH_USERS : AppExportDlg.Cpp
  • EXPORT_TYPE_WITHOUT_USERS : AppExportDlg.Cpp
  • EXTEND_SIZE : PerfUtil.c
  • EXTENSIONFRIENDLYNAME : FaxSiren.Cpp
  • EXTENSIONNAME : FaxSiren.Cpp
  • EXTENSIONPATH : FaxSiren.Cpp
  • EXTFUN : autotest.h
  • EXTFUNCDECL : autotest.h
  • EXTRA_COLUMNS : row.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- f -

  • F_ANSIONLY : Font.h
  • F_FIXEDPITCHONLY : Font.h
  • F_NOOEMFONTS : Font.h
  • F_NOSIMULATIONS : Font.h
  • F_NOVECTORFONTS : Font.h
  • F_PRINTERFONTS : Font.h
  • F_SCALABLEONLY : Font.h
  • F_SCREENFONTS : Font.h
  • F_TTONLY : Font.h
  • F_WYSIWYG : Font.h
  • FACILITY_ADSI : IADsError.cpp
  • FACILITY_DELAYLOAD : CeError.Cpp
  • FACILITY_MASK : MsgTest.c
  • FAIL_PRINT : enablerouter.c
  • false : dbh.cpp
  • FALSE : LinkList.h
  • FAR : GssAPI.h
  • FAX_PROVIDERS_REGKEY : Reg.h
  • FAXSIREN : FaxSiren.Cpp
  • FAXSIRENFRIENDLYNAME : FaxSiren.Cpp
  • FAXSIRENFUNCTION : FaxSiren.Cpp
  • FAXSIRENMETHOD : FaxSiren.Cpp
  • FD_SETSIZE : pchsample.h
  • FDotPsffs : wn_dos.h
  • FEmptySz : Global.h
  • FEqSumInfFMTID : suminfo.h
  • FETCH_SUCCESS : cdbfile.h
  • fFalse : suminfo.Cpp
  • FFSTREAMMAGIC : FindStream.c
  • FHfileToSffsDate : wn_dos.h
  • FIELDNAME_MAXSIZE : limits.h
  • FILE_AND_WINDOW : Dt.h
  • FILE_COUNT : DragImg.Cpp
  • FILE_DEVICE_SCSI : CStorageResource.cpp
  • FILE_EXT : DoServer.h
  • FILE_ONLY : Dt.h
  • FILE_SIZE_EXTENSION : FileRepClientProc.cpp
  • FILE_VERSION : bankdlg.Cpp
  • FILENAME : SecFile.c
  • FILENAME_OFFSET : spy.cpp
  • FILENAMESIZE : Open.h
  • FileShare : resource.h
  • FILESHARESAMPLE_SVCNAME : ClRes.h
  • FILETITLESIZE : Open.h
  • FILTER_ATTRIBUTES : Utility.h
  • FILTER_MASK_DESTINATION_ADDRESS : parser.h
  • FILTER_MASK_DESTINATION_PORT : parser.h
  • FILTER_MASK_SOURCE_ADDRESS : parser.h
  • FILTER_MASK_SOURCE_PORT : parser.h
  • FindList : list.h
  • FindNextChange : sdkdiff.cpp
  • FindPrevChange : sdkdiff.cpp
  • FindSortedList : list.h
  • FINISH_SAMPLE_IO : socket.c
  • FIntelOrder : suminfo.h
  • FIRST_FREE : AppMemi.h
  • FIRST_INUSE : AppMemi.h
  • FIRST_MDI_CHILD : resource.h
  • FirstAce : AuthzSvr.c
  • FIRSTCOL : HalfIME.h , FullIME.h
  • FIRSTROW : FullIME.h , HalfIME.h
  • FNEXPORT : GLOBAL.h
  • FNGLOBAL : GLOBAL.h
  • FNLOCAL : GLOBAL.h
  • FONT_TYPE_WYSIWYG : Font.c
  • FONTNAME : TextFx.c
  • FONTSIZEDELTALARGE : FVText.h
  • FONTSIZEDELTAMEDIUM : FVText.h
  • FONTSIZEDELTASMALL : FVText.h
  • FONTSIZETHRESHOLDLOW : FVText.h
  • FONTSIZETHRESHOLDMAX : FVText.h
  • FONTSIZETHRESHOLDMID : FVText.h
  • FONTSIZETHRESHOLDMIN : FVText.h
  • FORMAT_NAME_LIST_LEN : drawdlg.cpp
  • FORMATETC_MAX : OleStd.c
  • FORMATFLOAT : WxForm.h
  • FORWARD_WM_MOVING : Globals.h
  • FOURCC_data : SMFI.h
  • FOURCC_MThd : SMFI.h
  • FOURCC_MTrk : SMFI.h
  • FOURCC_RMID : SMFI.h
  • FRAGMENT_HEADER_PROTOCOL : rawudp.c
  • FRAMEWL_STRUCTURE : Framer.h
  • FREE : PropCert.Cpp , dballoc.Cpp , defs.h
  • Free : ATMEvent.h
  • FREE_BSTR : main.hxx
  • FREE_BSTR_IF : Utils.h
  • FREE_INTERFACE : main.hxx
  • FREE_MEM : main.c
  • FREE_NOT_NULL : defs.h
  • FREE_OFFSET : Resource.h
  • FREE_UNICODE_STRING : main.hxx
  • FreeList : list.h
  • FREELOCALSTRING : ansiapi.h
  • FreeQueue : list.h
  • FreeStack : list.h
  • fSecurityLockedForAnnotations : suminfo.h
  • fSecurityPassworded : suminfo.h
  • fSecurityRO : suminfo.h
  • fSecurityRORecommended : suminfo.h
  • FSzEqPropStreamName : suminfo.h
  • fTrue : suminfo.Cpp
  • FVWL_OBJECTPOINTER : FVText.h
  • FWPRINTF : UtilLib.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- g -

  • G_ALLOC : LeakyBin.h
  • G_FREE : LeakyBin.h
  • g_iObjDefAccess : Privobji.Cpp
  • G_REALLOC : LeakyBin.h
  • g_sizeofNonDialable : TapiCode.c
  • GAMMA_CORRECTION : MfEdit.h
  • GAP_SIZE : enumdesk.cpp
  • GBGizmoAdd : GizmoBar.h
  • GBGizmoTextGet : GizmoBar.h
  • GBGizmoTextSet : GizmoBar.h
  • GBM_GIZMOADD : GizmoBar.h
  • GBM_GIZMOADDA : GizmoBar.h
  • GBM_GIZMOADDW : GizmoBar.h
  • GBM_GIZMOCHECK : GizmoBar.h
  • GBM_GIZMODATAGET : GizmoBar.h
  • GBM_GIZMODATASET : GizmoBar.h
  • GBM_GIZMOENABLE : GizmoBar.h
  • GBM_GIZMOEXIST : GizmoBar.h
  • GBM_GIZMOFOCUSSET : GizmoBar.h
  • GBM_GIZMOINTGET : GizmoBar.h
  • GBM_GIZMOINTSET : GizmoBar.h
  • GBM_GIZMONOTIFYGET : GizmoBar.h
  • GBM_GIZMONOTIFYSET : GizmoBar.h
  • GBM_GIZMOREMOVE : GizmoBar.h
  • GBM_GIZMOSENDMESSAGE : GizmoBar.h
  • GBM_GIZMOSHOW : GizmoBar.h
  • GBM_GIZMOTEXTGET : GizmoBar.h
  • GBM_GIZMOTEXTGETA : GizmoBar.h
  • GBM_GIZMOTEXTGETW : GizmoBar.h
  • GBM_GIZMOTEXTSET : GizmoBar.h
  • GBM_GIZMOTEXTSETA : GizmoBar.h
  • GBM_GIZMOTEXTSETW : GizmoBar.h
  • GBM_GIZMOTYPEGET : GizmoBar.h
  • GBM_HWNDASSOCIATEGET : GizmoBar.h
  • GBM_HWNDASSOCIATESET : GizmoBar.h
  • GBN_ASSOCIATEGAIN : GizmoBar.h
  • GBN_ASSOCIATELOSS : GizmoBar.h
  • GBN_GIZMOADDED : GizmoBar.h
  • GBN_GIZMOREMOVED : GizmoBar.h
  • GDICOMMENT_IDENTIFIER : MfEdit.h
  • GDICOMMENT_MULTIFORMATS : MfEdit.h
  • GEN_CMD_OKAY : nshsamp.h
  • GEN_CONNECT_SHOWSTRING : nshsamp.h
  • GEN_CURRENT_COUNT : nshsamp.h
  • GEN_SAMP_BASE : nshsamp.h
  • GEN_SAMPLEGATEWAY_SETTINGS : nshsamp.h
  • GEN_SAMPLEINTERFACE_SETTINGS : nshsamp.h
  • GET : SnmpUtil.C , WSnmpUtil.h
  • GET_BULK : WSnmpUtil.h
  • GET_NEXT : WSnmpUtil.h
  • GET_SCROLL_OPCODE : gutils.h
  • GET_SCROLL_POS : gutils.h
  • GET_WM_COMMAND_CMD : gutils.h , VListVw.h
  • GET_WM_COMMAND_HWND : gutils.h , VListVw.h
  • GET_WM_COMMAND_ID : gutils.h , VListVw.h
  • GET_WM_CTLCOLOR_HDC : MfEdit.h
  • GET_WM_CTLCOLOR_HWND : MfEdit.h
  • GET_WM_CTLCOLOR_TYPE : MfEdit.h
  • GETBIT : CeLibW2k.h , autotest.h
  • GETCLASSBRUSH : AppUtil.h , GdiDemo.h
  • GetControlScrollPos : halftone.c
  • GetIconOfClass : OleStd.h
  • GetIconOfFile : OleStd.h
  • GETINSTANCE : AppUtil.h , GdiDemo.h
  • GETLASTERROR : common.h
  • GETLASTERRORC : common.h
  • GETNEXT : SnmpUtil.C
  • getqbit : autotest.h
  • GINASTUB_VERSION : GinaHook.c , GinaStub.c
  • GIZMO_DISABLED : GizmoBar.h
  • GIZMO_NORMAL : GizmoBar.h
  • GIZMOTYPE_BUTTONATTRIBUTEEX : GizmoBar.h
  • GIZMOTYPE_BUTTONATTRIBUTEIN : GizmoBar.h
  • GIZMOTYPE_BUTTONCOMMAND : GizmoBar.h
  • GIZMOTYPE_BUTTONNORMAL : GizmoBar.h
  • GIZMOTYPE_COMBOBOX : GizmoBar.h
  • GIZMOTYPE_EDIT : GizmoBar.h
  • GIZMOTYPE_LISTBOX : GizmoBar.h
  • GIZMOTYPE_SEPARATOR : GizmoBar.h
  • GIZMOTYPE_TEXT : GizmoBar.h
  • GLOBAL : Global.h
  • GLOBAL_ : sampprov.h
  • GLOBAL_HEAP : defs.h
  • GlobalAddAtom_AW : ansiapi.h
  • GlobalGetAtomName_AW : ansiapi.h
  • GLOBALINIT : Global.h
  • GLOBALS_HERE : CSSamp.Cpp
  • GNB_DECODED_CHAR : keys.cpp
  • GNB_NORMAL_CHAR : keys.cpp
  • GNB_NOTHING_LEFT : keys.cpp
  • GPT_BASIC_DATA_ATTRIBUTE_HIDDEN : DLEdit.Cpp
  • GREATERTHAN : common.h
  • GREEN_COLOR : DoServer.h
  • GRIDCOLOR : PlgBlt.h , WxForm.h
  • GrokInt : callback.Cpp
  • GrokStr : callback.Cpp
  • Group : resource.h
  • GROUP_MENU_BASE_ID : ExtObjData.cpp
  • GROUP_MENU_ID_1 : ExtObjData.cpp
  • GSS_C_ACCEPT : GssAPI.h
  • GSS_C_AF_APPLETALK : GssAPI.h
  • GSS_C_AF_BSC : GssAPI.h
  • GSS_C_AF_CCITT : GssAPI.h
  • GSS_C_AF_CHAOS : GssAPI.h
  • GSS_C_AF_DATAKIT : GssAPI.h
  • GSS_C_AF_DECnet : GssAPI.h
  • GSS_C_AF_DLI : GssAPI.h
  • GSS_C_AF_DSS : GssAPI.h
  • GSS_C_AF_ECMA : GssAPI.h
  • GSS_C_AF_HYLINK : GssAPI.h
  • GSS_C_AF_IMPLINK : GssAPI.h
  • GSS_C_AF_INET : GssAPI.h
  • GSS_C_AF_LAT : GssAPI.h
  • GSS_C_AF_LOCAL : GssAPI.h
  • GSS_C_AF_NBS : GssAPI.h
  • GSS_C_AF_NS : GssAPI.h
  • GSS_C_AF_NULLADDR : GssAPI.h
  • GSS_C_AF_OSI : GssAPI.h
  • GSS_C_AF_PUP : GssAPI.h
  • GSS_C_AF_SNA : GssAPI.h
  • GSS_C_AF_UNSPEC : GssAPI.h
  • GSS_C_AF_X25 : GssAPI.h
  • GSS_C_ANON_FLAG : GssAPI.h
  • GSS_C_BOTH : GssAPI.h
  • GSS_C_CALLING_ERROR_MASK : GssAPI.h
  • GSS_C_CALLING_ERROR_OFFSET : GssAPI.h
  • GSS_C_CONF_FLAG : GssAPI.h
  • GSS_C_DELEG_FLAG : GssAPI.h
  • GSS_C_EMPTY_BUFFER : GssAPI.h
  • GSS_C_GSS_CODE : GssAPI.h
  • GSS_C_INDEFINITE : GssAPI.h
  • GSS_C_INITIATE : GssAPI.h
  • GSS_C_INTEG_FLAG : GssAPI.h
  • GSS_C_MECH_CODE : GssAPI.h
  • GSS_C_MUTUAL_FLAG : GssAPI.h
  • GSS_C_NO_BUFFER : GssAPI.h
  • GSS_C_NO_CHANNEL_BINDINGS : GssAPI.h
  • GSS_C_NO_CONTEXT : GssAPI.h
  • GSS_C_NO_CREDENTIAL : GssAPI.h
  • GSS_C_NO_OID : GssAPI.h
  • GSS_C_NO_OID_SET : GssAPI.h
  • GSS_C_NULL_OID : GssAPI.h
  • GSS_C_NULL_OID_SET : GssAPI.h
  • GSS_C_QOP_DEFAULT : GssAPI.h
  • GSS_C_REPLAY_FLAG : GssAPI.h
  • GSS_C_ROUTINE_ERROR_MASK : GssAPI.h
  • GSS_C_ROUTINE_ERROR_OFFSET : GssAPI.h
  • GSS_C_SEQUENCE_FLAG : GssAPI.h
  • GSS_C_SUPPLEMENTARY_MASK : GssAPI.h
  • GSS_C_SUPPLEMENTARY_OFFSET : GssAPI.h
  • GSS_CALLING_ERROR : GssAPI.h
  • GSS_CALLING_ERROR_FIELD : GssAPI.h
  • GSS_ERROR : GssAPI.h
  • GSS_ROUTINE_ERROR : GssAPI.h
  • GSS_ROUTINE_ERROR_FIELD : GssAPI.h
  • GSS_S_BAD_BINDINGS : GssAPI.h
  • GSS_S_BAD_MECH : GssAPI.h
  • GSS_S_BAD_NAME : GssAPI.h
  • GSS_S_BAD_NAMETYPE : GssAPI.h
  • GSS_S_BAD_QOP : GssAPI.h
  • GSS_S_BAD_SIG : GssAPI.h
  • GSS_S_BAD_STATUS : GssAPI.h
  • GSS_S_CALL_BAD_STRUCTURE : GssAPI.h
  • GSS_S_CALL_INACCESSIBLE_READ : GssAPI.h
  • GSS_S_CALL_INACCESSIBLE_WRITE : GssAPI.h
  • GSS_S_COMPLETE : GssAPI.h
  • GSS_S_CONTEXT_EXPIRED : GssAPI.h
  • GSS_S_CONTINUE_NEEDED : GssAPI.h
  • GSS_S_CRED_UNAVAIL : GssAPI.h
  • GSS_S_CREDENTIALS_EXPIRED : GssAPI.h
  • GSS_S_DEFECTIVE_CREDENTIAL : GssAPI.h
  • GSS_S_DEFECTIVE_TOKEN : GssAPI.h
  • GSS_S_DUPLICATE_ELEMENT : GssAPI.h
  • GSS_S_DUPLICATE_TOKEN : GssAPI.h
  • GSS_S_FAILURE : GssAPI.h
  • GSS_S_GAP_TOKEN : GssAPI.h
  • GSS_S_NO_CONTEXT : GssAPI.h
  • GSS_S_NO_CRED : GssAPI.h
  • GSS_S_OLD_TOKEN : GssAPI.h
  • GSS_S_UNAUTHORIZED : GssAPI.h
  • GSS_S_UNAVAILABLE : GssAPI.h
  • GSS_S_UNSEQ_TOKEN : GssAPI.h
  • GSS_SIZEOF_INT : GssAPI.h
  • GSS_SIZEOF_LONG : GssAPI.h
  • GSS_SIZEOF_SHORT : GssAPI.h
  • GSS_SUPPLEMENTARY_INFO : GssAPI.h
  • GSS_SUPPLEMENTARY_INFO_FIELD : GssAPI.h
  • GUID_SIZE : Reg.h , AppUtil.h
  • GUID_TYPE_DEFAULT : tracedmp.h
  • GUID_TYPE_EVENTTRACE : tracedmp.h
  • GUID_TYPE_HEADER : tracedmp.h
  • GUID_TYPE_UNKNOWN : tracedmp.h
  • GUIDSTR_MAX : DComPerm.h
  • GWL_SPINCUBEDATA : SpinCube.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- h -

  • HANDLE_GETINTERFACE : cbase.h
  • HANDLE_RADIUS : Behavior.h
  • HANDLE_WM_MOVING : Globals.h
  • HANDLERITEMSKEY : Reg.Cpp
  • HANDLERVALUE_DIR1 : Reg.Cpp
  • HANDLERVALUE_DIR2 : Reg.Cpp
  • HANDLERVALUE_DISPLAYNAME : Reg.Cpp
  • HANDLERVALUE_FILETIME : Reg.Cpp
  • HANDLERVALUE_RECURSIVE : Reg.Cpp
  • HAS_BIT_STYLE : ADSIhelpers.h
  • HD_AUTHENTICATE : Get_Sock.c
  • HD_CONNECTION : Get_Sock.c
  • HD_LENGTH : Get_Sock.c
  • HDCINVALID : Font.c
  • HDCNULL : Font.c
  • HDCPRINTER : Font.c
  • HDCSCREEN : Font.c
  • HDIB : Dibapi.h
  • HEAD_OFFSET : spy.cpp
  • HEAD_SIGNITURE : spy.cpp
  • HEADER_OFFSET : spy.cpp
  • HEAP_PROBE : PerfUtil.h
  • HEAPMIN : dballoc.Cpp
  • HEAPREALLOC : StdAfx.h
  • HELP_DEFAULT : mmcsample.h
  • HELP_FILE_EXT : AppUtil.h
  • HELP_INTRO : mmcsample.h
  • HELP_PAGE : CacheIsapi.cpp
  • HELP_STEPFOUR : mmcsample.h
  • HELP_STEPONE : mmcsample.h
  • HELP_STEPTHREE : mmcsample.h
  • HELP_STEPTWO : mmcsample.h
  • HELPFILE_STR : DfV.h
  • HEX_0 : stl_mll.cpp
  • HEX_9 : stl_mll.cpp
  • HEX_A : stl_mll.cpp
  • HEX_F : stl_mll.cpp
  • HEXADECIMAL : Grid.Hxx
  • hfontNil : Global.h
  • hgdiNil : Global.h
  • HI_BYTE : parser.h
  • HIDDEN_PARTITION_FLAG : DLEdit.Cpp
  • HIDWORD : sdksamplestoragesystem.h
  • HIGHBIT : policy.cpp , Policy.Cpp
  • HIMETRIC_PER_INCH : OleStd.h , site.Cpp
  • HINT_UPDATE_ALL_ITEMS : globals.h
  • HINT_UPDATE_ITEM : globals.h
  • HKEY_ROWSETVIEWER : common.h
  • HLP_ADD_OBJECT : nshsamp.h
  • HLP_ADD_OBJECT_BASE : nshsamp.h
  • HLP_ADD_OBJECT_EX : nshsamp.h
  • HLP_RANDOM_BASE : nshsamp.h
  • HLP_RESET_OBJECT : nshsamp.h
  • HLP_RESET_OBJECT_ALL : nshsamp.h
  • HLP_RESET_OBJECT_ALL_EX : nshsamp.h
  • HLP_RESET_OBJECT_BASE : nshsamp.h
  • HLP_RESET_OBJECT_SPROCKETS : nshsamp.h
  • HLP_RESET_OBJECT_SPROCKETS_EX : nshsamp.h
  • HLP_RESET_OBJECT_WIDGETS : nshsamp.h
  • HLP_RESET_OBJECT_WIDGETS_EX : nshsamp.h
  • HLP_SAMP_BASE : nshsamp.h
  • HLP_SET_GATEWAY : nshsamp.h
  • HLP_SET_GATEWAY_EX : nshsamp.h
  • HLP_SET_INTERFACE : nshsamp.h
  • HLP_SET_INTERFACE_EX : nshsamp.h
  • HLP_SET_OBJECT : nshsamp.h
  • HLP_SET_OBJECT_BASE : nshsamp.h
  • HLP_SET_OBJECT_EX : nshsamp.h
  • HLP_SET_RANDOM_STUFF : nshsamp.h
  • HLP_SHOW_OBJECT : nshsamp.h
  • HLP_SHOW_OBJECT_BASE : nshsamp.h
  • HLP_SHOW_OBJECT_EX : nshsamp.h
  • HLP_SHOW_RANDOM : nshsamp.h
  • HLP_SHOW_RANDOM_EX : nshsamp.h
  • HLP_SHOWERROR : nshsamp.h
  • HLP_SHOWERROR_BASE : nshsamp.h
  • HLP_SHOWERROR_EX : nshsamp.h
  • HOUR : FontView.c
  • HOUR_INDEX : TIMEWND.c
  • HRESULT_FROM_JETERROR : CeError.Cpp , ceerror.cpp , CeError.Cpp
  • HRESULT_FROM_JETWARNING : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • HT_Display : hashtable.h
  • HT_IsEmpty : hashtable.h
  • HT_RemoveEntry : hashtable.h
  • HT_Size : hashtable.h
  • HTML_FILE_EXT : AppUtil.h
  • htmlDebugOut : Global.Hxx
  • HTTP_REQUEST_ACCEPT_RANGES : Range.h
  • HTTP_REQUEST_FROM_CACHE : Range.h
  • HUGE : GLOBAL.h
  • hwndMDIClient : GLOBALS.h
  • hwndMDIIPXChat : Globals.h
  • hwndNil : Global.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- i -

  • I_LINECALLSTATE_ANY : TapiCode.c
  • ICCR_BACKGROUND : resource.h
  • ICMPV4_ECHO_REPLY_CODE : iphdr.h
  • ICMPV4_ECHO_REPLY_TYPE : iphdr.h
  • ICMPV4_ECHO_REQUEST_CODE : iphdr.h
  • ICMPV4_ECHO_REQUEST_TYPE : iphdr.h
  • ICMPV4_MINIMUM_HEADER : iphdr.h
  • ICMPV6_ECHO_REPLY_CODE : iphdr.h
  • ICMPV6_ECHO_REPLY_TYPE : iphdr.h
  • ICMPV6_ECHO_REQUEST_CODE : iphdr.h
  • ICMPV6_ECHO_REQUEST_TYPE : iphdr.h
  • ICO_AUDIO : Resource.h
  • ICO_MAIN : Resource.h , resource.h , Resource.h
  • ICO_NOAUDIO : Resource.h
  • ICO_PHONE : Resource.h
  • ICO_SPEAKER : Resource.h
  • ICO_TOPMOST : Resource.h
  • ICON : resource.h
  • ICON_INDEX_FOLDER : ExtrIcon.h
  • ICON_INDEX_FOLDEROPEN : ExtrIcon.h
  • ICON_INDEX_ITEM : ExtrIcon.h
  • ICONFILE : GLOBALS.h
  • ICONPRO_ABOUT_DLG : Resource.h
  • ICONPRO_ICON : Resource.h
  • ICONPRO_ICON1 : Resource.h
  • ICONPRO_MENU : Resource.h
  • ID : nshsamp.h
  • ID_ABOUT : Menu.h
  • ID_AC_CREDIT : resource.h
  • ID_AC_DEBIT : resource.h
  • ID_ACTION_ADDBUDDY : resource.h
  • ID_ACTION_CALL : resource.h
  • ID_ACTION_MESSAGE : resource.h
  • ID_ADD1 : Print.h
  • ID_ADD1C : Colors.h
  • ID_ADD1DM : DevMode.h
  • ID_ADD1O : Open.h
  • ID_ADD1P : Print.h
  • ID_ADD2 : Print.h
  • ID_ADD2O : Open.h
  • ID_ADD2P : Print.h
  • ID_ADDRESSBOX : resource.h
  • ID_API_CLOSE_QUEUE : Resource.h
  • ID_API_CREATE_QUEUE : Resource.h
  • ID_API_DELETE_QUEUE : Resource.h
  • ID_API_LOCATE : Resource.h
  • ID_API_OPEN_QUEUE : Resource.h
  • ID_API_RECEIVE_MESSAGE : Resource.h
  • ID_API_SEND_MESSAGE : Resource.h
  • ID_APP_ABOUT : afxres.h
  • ID_APP_EXIT : afxres.h
  • ID_APPACCEL : Resource.h , resource.h , Resource.h
  • ID_APPBAR_AUTOHIDE : Resource.h
  • ID_APPBAR_BOTTOM : Resource.h
  • ID_APPBAR_LEFT : Resource.h
  • ID_APPBAR_NOAUTOHIDE : Resource.h
  • ID_APPBAR_REGISTER : Resource.h
  • ID_APPBAR_RIGHT : Resource.h
  • ID_APPBAR_TOP : Resource.h
  • ID_APPBAR_UNREGISTER : Resource.h
  • ID_ASSERT_ON_ERRORS : resource.h
  • ID_AUDIT : Resource.h
  • ID_BOX1 : resource.h
  • ID_BOX2 : resource.h
  • ID_BOX3 : resource.h
  • ID_BOX4 : resource.h
  • ID_BROWSE : OleStd.h
  • ID_BUDDY_CALL : resource.h
  • ID_BUDDY_MESSAGE : resource.h
  • ID_BUDDY_REMOVE : resource.h
  • ID_BUFFSIZETI : Title.h
  • ID_BUTTON : Rebar.c
  • ID_BUTTON1 : resource.h
  • ID_BUTTON10 : resource.h
  • ID_BUTTON2 : resource.h
  • ID_BUTTON3 : resource.h
  • ID_BUTTON4 : resource.h
  • ID_BUTTON40001 : resource.h
  • ID_BUTTON40002 : resource.h
  • ID_BUTTON40003 : resource.h
  • ID_BUTTON40004 : resource.h
  • ID_BUTTON40016 : resource.h
  • ID_BUTTON40017 : resource.h
  • ID_BUTTON40018 : resource.h
  • ID_BUTTON40019 : resource.h
  • ID_BUTTON40020 : resource.h
  • ID_BUTTON40021 : resource.h
  • ID_BUTTON40022 : resource.h
  • ID_BUTTON40023 : resource.h
  • ID_BUTTON40024 : resource.h
  • ID_BUTTON40025 : resource.h
  • ID_BUTTON40026 : resource.h
  • ID_BUTTON40100 : Resource.h
  • ID_BUTTON40101 : Resource.h
  • ID_BUTTON40102 : Resource.h
  • ID_BUTTON40103 : Resource.h
  • ID_BUTTON40104 : Resource.h
  • ID_BUTTON40105 : Resource.h
  • ID_BUTTON40106 : Resource.h
  • ID_BUTTON40107 : Resource.h
  • ID_BUTTON40108 : Resource.h
  • ID_BUTTON40109 : Resource.h
  • ID_BUTTON40110 : Resource.h
  • ID_BUTTON40111 : Resource.h
  • ID_BUTTON40112 : Resource.h
  • ID_BUTTON40113 : Resource.h
  • ID_BUTTON40114 : Resource.h
  • ID_BUTTON40115 : Resource.h
  • ID_BUTTON40116 : Resource.h
  • ID_BUTTON40117 : Resource.h
  • ID_BUTTON40118 : Resource.h
  • ID_BUTTON40119 : Resource.h
  • ID_BUTTON40120 : Resource.h
  • ID_BUTTON40121 : Resource.h
  • ID_BUTTON40122 : Resource.h
  • ID_BUTTON40123 : Resource.h
  • ID_BUTTON40124 : Resource.h
  • ID_BUTTON40125 : Resource.h
  • ID_BUTTON40126 : Resource.h
  • ID_BUTTON40127 : Resource.h
  • ID_BUTTON40140 : Resource.h
  • ID_BUTTON5 : resource.h
  • ID_BUTTON6 : resource.h
  • ID_BUTTON7 : resource.h
  • ID_BUTTON8 : resource.h
  • ID_BUTTON9 : resource.h
  • ID_BUTTONPAUSE : resource.h
  • ID_BUTTONSTART : resource.h
  • ID_BUTTONSTOP : resource.h
  • ID_CALL : resource.h
  • ID_CAPSFIELD : FontView.h
  • ID_CHECKBOX : resource.h
  • ID_CHOOSE_LOG_FILE_NAME : Resource.h
  • ID_CHOOSEFONT : Resource.h
  • ID_CLEAR : Resource.h , resource.h
  • ID_CLEAR1 : Print.h
  • ID_CLEAR1C : Colors.h
  • ID_CLEAR1DM : DevMode.h
  • ID_CLEAR1O : Open.h
  • ID_CLEAR1P : Print.h
  • ID_CLEAR2O : Open.h
  • ID_CLEAR2P : Print.h
  • ID_COINIT_MTA : resource.h
  • ID_COINIT_RANDOM : resource.h
  • ID_COINIT_STA : resource.h
  • ID_COLORSDIALOG : Colors.h
  • ID_COLORSLIDER : Resource.h
  • ID_COLORTEXT : Resource.h
  • ID_COMBOBOX : Resource.h , Rebar.c
  • ID_COMMAND_COMMAND1 : resource.h
  • ID_COMMAND_COMMAND2 : resource.h
  • ID_COMMAND_COMMAND3 : resource.h
  • ID_COMMAND_COMMAND4 : resource.h
  • ID_COMMAND_PAUSE : resource.h
  • ID_COMMAND_START : resource.h
  • ID_COMMAND_STOP : resource.h
  • ID_CONNECT : resource.h
  • ID_CONTEXT_HELP : afxres.h
  • ID_CONTROL : resource.h
  • ID_COPIESP : Print.h
  • ID_CREATEPARAM : FontView.h
  • ID_CREATEVALUE : FontView.h
  • ID_CURRENT : OleStd.h
  • ID_CURRENTICON : OleStd.h
  • ID_CUSTCOLORSC : Colors.h
  • ID_CUSTDATAC : Colors.h
  • ID_CUSTDATAF : Font.h
  • ID_CUSTDATAFT : Find.h
  • ID_CUSTDATAO : Open.h
  • ID_CUSTDATAP : Print.h
  • ID_CUSTFILTO : Open.h
  • ID_CUSTOM_BUTTON : Resource.h
  • ID_DEBUG_BEGIN : Resource.h
  • ID_DEBUG_END : Resource.h
  • ID_DEFAULT : OleStd.h
  • ID_DEFAULT_HELP : afxres.h
  • ID_DEFAULTICON : OleStd.h
  • ID_DEFSTRINGS : Find.h
  • ID_DEVMODEDIALOG : DevMode.h
  • ID_DEVNAMESDIALOG : DevNames.h
  • ID_DMBITSPERPEL : DevMode.h
  • ID_DMCOLLATE : DevMode.h
  • ID_DMCOLOR : DevMode.h
  • ID_DMCOPIES : DevMode.h
  • ID_DMDEFAULTSOURCE : DevMode.h
  • ID_DMDEVNAME : DevMode.h
  • ID_DMDISPLAYFREQ : DevMode.h
  • ID_DMDRIVERDATA : DevMode.h
  • ID_DMDRIVEREXTRA : DevMode.h
  • ID_DMDRIVERVER : DevMode.h
  • ID_DMDUPLEX : DevMode.h
  • ID_DMFIELDS : DevMode.h
  • ID_DMFORMNAME : DevMode.h
  • ID_DMORIENTATION : DevMode.h
  • ID_DMPAPERLENGTH : DevMode.h
  • ID_DMPAPERSIZE : DevMode.h
  • ID_DMPAPERWIDTH : DevMode.h
  • ID_DMPELSHEIGHT : DevMode.h
  • ID_DMPELSWIDTH : DevMode.h
  • ID_DMPRINTQUALITY : DevMode.h
  • ID_DMRESETDEV : DevMode.h
  • ID_DMSCALE : DevMode.h
  • ID_DMSIZEDEV : DevMode.h
  • ID_DMSPECVER : DevMode.h
  • ID_DUMMY : OleStd.h
  • ID_EDIT_ADDFORMAT : Resource.h
  • ID_EDIT_CLEAR : afxres.h
  • ID_EDIT_CLEAR_ALL : afxres.h
  • ID_EDIT_COPY : afxres.h , Resource.h
  • ID_EDIT_CUT : afxres.h
  • ID_EDIT_EXPORTBMP : Resource.h
  • ID_EDIT_FIND : afxres.h
  • ID_EDIT_IMPORTBMP : Resource.h
  • ID_EDIT_INSERTOBJECT : Resource.h
  • ID_EDIT_PASTE : afxres.h , Resource.h
  • ID_EDIT_PASTE_LINK : afxres.h
  • ID_EDIT_PASTE_SPECIAL : afxres.h
  • ID_EDIT_REDO : afxres.h
  • ID_EDIT_REMOVEFORMAT : Resource.h
  • ID_EDIT_REPEAT : afxres.h
  • ID_EDIT_REPLACE : afxres.h
  • ID_EDIT_SELECT_ALL : afxres.h
  • ID_EDIT_STRETCHIMPORTBMP : Resource.h
  • ID_EDIT_STRETCHPASTE : Resource.h
  • ID_EDIT_UNDO : afxres.h
  • ID_EDITCHILD : ComDlg32.h
  • ID_EDITDEVMODE : Print.h
  • ID_EDITDEVNAMES : Print.h
  • ID_EDITLOGFONT : Font.h
  • ID_EL_AUTOMATIC : OleStd.h
  • ID_EL_CANCELLINK : OleStd.h
  • ID_EL_CHANGESOURCE : OleStd.h
  • ID_EL_CLOSE : OleStd.h
  • ID_EL_COL1 : OleStd.h
  • ID_EL_COL2 : OleStd.h
  • ID_EL_COL3 : OleStd.h
  • ID_EL_LINKSLISTBOX : OleStd.h
  • ID_EL_LINKSOURCE : OleStd.h
  • ID_EL_LINKTYPE : OleStd.h
  • ID_EL_MANUAL : OleStd.h
  • ID_EL_NULL : OleStd.h
  • ID_EL_OPENSOURCE : OleStd.h
  • ID_EL_UPDATE : OleStd.h
  • ID_EL_UPDATENOW : OleStd.h
  • ID_ERRORC : Colors.h
  • ID_ERRORF : Font.h
  • ID_ERRORFT : Find.h
  • ID_ERRORO : Open.h
  • ID_ERRORP : Print.h
  • ID_EXIT : resource.h
  • ID_F_ABOUT : Resource.h
  • ID_F_EXIT : Resource.h
  • ID_F_MENUOPTION1 : Resource.h
  • ID_FILE_ABOUT : resource.h
  • ID_FILE_CLOSE : afxres.h , Resource.h
  • ID_FILE_DASH : resource.h
  • ID_FILE_EXIT : resource.h , Resource.h
  • ID_FILE_EXTRACT : Resource.h
  • ID_FILE_FAX : Resource.h
  • ID_FILE_FROM_SCANNER_OR_CAMERA : resource.h
  • ID_FILE_LOGOFF : resource.h
  • ID_FILE_LOGON : resource.h
  • ID_FILE_MRU_FILE1 : afxres.h
  • ID_FILE_MRU_FILE2 : afxres.h
  • ID_FILE_MRU_FILE3 : afxres.h
  • ID_FILE_MRU_FILE4 : afxres.h
  • ID_FILE_NEW : afxres.h , resource.h , Resource.h
  • ID_FILE_OPEN : afxres.h , resource.h , Resource.h
  • ID_FILE_OPENCHARACTER : Resource.h
  • ID_FILE_PAGE_SETUP : afxres.h
  • ID_FILE_PRESENCESTATUS_AWAY : resource.h
  • ID_FILE_PRESENCESTATUS_BERIGHTBACK : resource.h
  • ID_FILE_PRESENCESTATUS_BUSY : resource.h
  • ID_FILE_PRESENCESTATUS_IDLE : resource.h
  • ID_FILE_PRESENCESTATUS_OFFLINE : resource.h
  • ID_FILE_PRESENCESTATUS_ONLINE : resource.h
  • ID_FILE_PRESENCESTATUS_ONTHEPHONE : resource.h
  • ID_FILE_PRESENCESTATUS_OUTTOLUNCH : resource.h
  • ID_FILE_PRINT : afxres.h
  • ID_FILE_PRINT_PREVIEW : afxres.h
  • ID_FILE_PRINT_SETUP : afxres.h
  • ID_FILE_PROPERTYSHEET : resource.h
  • ID_FILE_REFRESH : resource.h
  • ID_FILE_SAVE : afxres.h , resource.h , Resource.h
  • ID_FILE_SAVE_AS : afxres.h
  • ID_FILE_SAVE_COPY_AS : afxres.h
  • ID_FILE_SAVEAS : resource.h , Resource.h
  • ID_FILE_UPDATE : afxres.h
  • ID_FILEEXTO : Open.h
  • ID_FILEOFFO : Open.h
  • ID_FILEPREVIEW : Open.h
  • ID_FILTERO : Open.h
  • ID_FILTINDEXO : Open.h
  • ID_FINDDIALOG : Find.h
  • ID_FINDLEFT : Find.h
  • ID_FINDRIGHT : Find.h
  • ID_FINDWHATFT : Find.h
  • ID_FINDWHATLENFT : Find.h
  • ID_FLAGSC : Colors.h
  • ID_FLAGSF : Font.h
  • ID_FLAGSFT : Find.h
  • ID_FLAGSMSG : Find.h
  • ID_FLAGSO : Open.h
  • ID_FLAGSP : Print.h
  • ID_FONTDIALOG : Font.h
  • ID_FONTLIST : Font.h
  • ID_FONTTYPEF : Font.h
  • ID_FORMAT_BOX : MDIChild.h
  • ID_FRNULLSTRUCT : Find.h
  • ID_FROMFILE : OleStd.h
  • ID_FROMFILEEDIT : OleStd.h
  • ID_FROMPAGEP : Print.h
  • ID_GETNUMFORMATS : Resource.h
  • ID_GROUP : OleStd.h
  • ID_GUIDE_BOXES : resource.h
  • ID_GUIDE_LINES : resource.h
  • ID_GUIDE_NONE : resource.h
  • ID_HASFILECHANGED : Resource.h
  • ID_HDCF : Font.h
  • ID_HDCINVALID : Font.h
  • ID_HDCNULL : Font.h
  • ID_HDCP : Print.h
  • ID_HDCPRINTER : Font.h
  • ID_HDCSCREEN : Font.h
  • ID_HDEVMODEP : Print.h
  • ID_HDEVNAMESP : Print.h
  • ID_HEIGHTSLIDER : Resource.h
  • ID_HEIGHTTEXT : Resource.h
  • ID_HELP : afxres.h
  • ID_HELP_ABOUT : resource.h , Resource.h
  • ID_HELP_CONTENTS : Resource.h
  • ID_HELP_INDEX : afxres.h
  • ID_HELP_USING : afxres.h
  • ID_HINSTANCEC : Colors.h
  • ID_HINSTANCEF : Font.h
  • ID_HINSTANCEFT : Find.h
  • ID_HINSTANCEO : Open.h
  • ID_HINSTANCEP : Print.h
  • ID_HOOKC : Colors.h
  • ID_HOOKF : Font.h
  • ID_HOOKFT : Find.h
  • ID_HOOKO : Open.h
  • ID_HPRINTTEMPP : Print.h
  • ID_HSETUPTEMPP : Print.h
  • ID_HWNDOWNERC : Colors.h
  • ID_HWNDOWNERF : Font.h
  • ID_HWNDOWNERFT : Find.h
  • ID_HWNDOWNERO : Open.h
  • ID_HWNDOWNERP : Print.h
  • ID_ICON : MidiPlyr.h , FullIME.h , HalfIME.h
  • ID_ICONLIST : OleStd.h
  • ID_INBOX : Globals.h
  • ID_INDICATOR_CAPS : afxres.h
  • ID_INDICATOR_EXT : afxres.h
  • ID_INDICATOR_NUM : afxres.h
  • ID_INDICATOR_OVR : afxres.h
  • ID_INDICATOR_REC : afxres.h
  • ID_INDICATOR_SCRL : afxres.h
  • ID_INPUTSCOPE_COERCE : resource.h
  • ID_INPUTSCOPE_FIRST : resource.h
  • ID_INPUTSCOPE_LAST : resource.h
  • ID_IO_CHANGEICON : OleStd.h
  • ID_IO_CREATEFROMFILE : OleStd.h
  • ID_IO_CREATENEW : OleStd.h
  • ID_IO_DISPLAYASICON : OleStd.h
  • ID_IO_FILE : OleStd.h
  • ID_IO_FILEDISPLAY : OleStd.h
  • ID_IO_FILETEXT : OleStd.h
  • ID_IO_FILETYPE : OleStd.h
  • ID_IO_ICONDISPLAY : OleStd.h
  • ID_IO_LINKFILE : OleStd.h
  • ID_IO_OBJECTTYPELIST : OleStd.h
  • ID_IO_OBJECTTYPETEXT : OleStd.h
  • ID_IO_RESULTIMAGE : OleStd.h
  • ID_IO_RESULTTEXT : OleStd.h
  • ID_LABEL : OleStd.h
  • ID_LABELEDIT : OleStd.h
  • ID_LANG_C : resource.h
  • ID_LANG_DELPHI : resource.h
  • ID_LANG_JAVA : resource.h
  • ID_LANG_VB : resource.h
  • ID_LEFTBAND : resource.h
  • ID_LFCHARSET : LogFont.h
  • ID_LFCLIPP : LogFont.h
  • ID_LFESCAPEMENT : LogFont.h
  • ID_LFFACENAME : LogFont.h
  • ID_LFHEIGHT : LogFont.h
  • ID_LFITALIC : LogFont.h
  • ID_LFORIENTATION : LogFont.h
  • ID_LFOUTP : LogFont.h
  • ID_LFPITCHANDFAM : LogFont.h
  • ID_LFQUALITY : LogFont.h
  • ID_LFSTRIKEOUT : LogFont.h
  • ID_LFUNDERLINE : LogFont.h
  • ID_LFWEIGHT : LogFont.h
  • ID_LFWIDTH : LogFont.h
  • ID_LISTVIEW : VListVw.h , DragImg.Cpp , ShlView.h
  • ID_LOG : Resource.h
  • ID_LOGFONTDIALOG : LogFont.h
  • ID_LOGFONTF : Font.h
  • ID_LPPRINTTEMPP : Print.h
  • ID_LPSETUPTEMPP : Print.h
  • ID_MAXCUSTFILTO : Open.h
  • ID_MAXPAGEP : Print.h
  • ID_MAXSZFILEO : Open.h
  • ID_MAXSZFILETITLEO : Open.h
  • ID_MDICLIENT : resource.h
  • ID_MDIOBJECTS : resource.h
  • ID_MDITRACE : resource.h
  • ID_MENU : MidiPlyr.h , FullIME.h , HalfIME.h
  • ID_MENUFIELD : FontView.h
  • ID_MENUFILE : Resource.h
  • ID_MENUHELP : Resource.h
  • ID_MENUMAX : Resource.h
  • ID_MENUMIN : Resource.h
  • ID_MENUSYS : Resource.h
  • ID_MENUVIEW : Resource.h
  • ID_MINPAGEP : Print.h
  • ID_MM_CREDIT : resource.h
  • ID_MM_DEBIT : resource.h
  • ID_MM_TRANSFER : resource.h
  • ID_MODE_GESTURES : resource.h
  • ID_MODE_INK : resource.h
  • ID_MODE_INK_AND_GESTURES : resource.h
  • ID_MSGCHOOSEOPEN : Resource.h
  • ID_MSGEMPTY : Resource.h
  • ID_MSGREADY : Resource.h
  • ID_MULTIOPEN : Open.h
  • ID_MULTITHREADCOLORS : Colors.h
  • ID_MULTITHREADFINDREP : Find.h
  • ID_MULTITHREADFONT : Font.h
  • ID_MULTITHREADPRINT : Print.h
  • ID_NEXT_PANE : afxres.h
  • ID_NULLSTRUCTCOLOR : Colors.h
  • ID_NULLSTRUCTFONT : Font.h
  • ID_NULLSTRUCTO : Open.h
  • ID_NULLSTRUCTP : Print.h
  • ID_NUMFIELD : FontView.h
  • ID_OBJECTTREE : resource.h
  • ID_OD_BTN_BASE : MfEdit.h
  • ID_OD_TOOL_BASE : MfEdit.h
  • ID_OFFSET : spy.cpp
  • ID_OLE_EDIT_CHANGE_ICON : afxres.h
  • ID_OLE_EDIT_CONVERT : afxres.h
  • ID_OLE_EDIT_LINKS : afxres.h
  • ID_OLE_INSERT_NEW : afxres.h
  • ID_OLE_VERB_FIRST : afxres.h
  • ID_OLE_VERB_LAST : afxres.h
  • ID_OLEUIHELP : OleStd.h
  • ID_OPENDIALOG : Open.h
  • ID_OPTIONS_GRID_LINES : Resource.h
  • ID_OUTBOX : Globals.h
  • ID_OVRFIELD : FontView.h
  • ID_PATHTI : Title.h
  • ID_POINTSIZEF : Font.h
  • ID_PRELOADEDCOLORS : Colors.h
  • ID_PRELOADEDFIND : Find.h
  • ID_PRELOADEDFONT : Font.h
  • ID_PREPRINTP : Print.h
  • ID_PRESETUPP : Print.h
  • ID_PREV_PANE : afxres.h
  • ID_PRINTDIALOG : Print.h
  • ID_PRINTHOOKP : Print.h
  • ID_PROCESS : Resource.h
  • ID_PROPERTIES : Resource.h
  • ID_PS_CHANGEICON : OleStd.h
  • ID_PS_DISPLAYASICON : OleStd.h
  • ID_PS_DISPLAYLIST : OleStd.h
  • ID_PS_ICONDISPLAY : OleStd.h
  • ID_PS_PASTE : OleStd.h
  • ID_PS_PASTELINK : OleStd.h
  • ID_PS_PASTELINKLIST : OleStd.h
  • ID_PS_PASTELIST : OleStd.h
  • ID_PS_RESULTGROUP : OleStd.h
  • ID_PS_RESULTIMAGE : OleStd.h
  • ID_PS_RESULTTEXT : OleStd.h
  • ID_PS_SOURCETEXT : OleStd.h
  • ID_PS_STXAS : OleStd.h
  • ID_PS_STXSOURCE : OleStd.h
  • ID_PU_BROWSE : OleStd.h
  • ID_PU_CONVERT : OleStd.h
  • ID_PU_LINKS : OleStd.h
  • ID_PU_METER : OleStd.h
  • ID_PU_PERCENT : OleStd.h
  • ID_PU_STOP : OleStd.h
  • ID_PU_TEXT : OleStd.h
  • ID_REBAR : Rebar.c
  • ID_RECENT_FILE_0 : MainDlg.Cpp
  • ID_RECOGNIZE : resource.h
  • ID_RECOGNIZER_DEFAULT : resource.h
  • ID_RECOGNIZER_FIRST : resource.h
  • ID_RECOGNIZER_LAST : resource.h
  • ID_RECORD_FIRST : afxres.h
  • ID_RECORD_LAST : afxres.h
  • ID_RECORD_NEXT : afxres.h
  • ID_RECORD_PREV : afxres.h
  • ID_REFRESH : resource.h
  • ID_REPLACEWITHFT : Find.h
  • ID_REPLACEWITHLENFT : Find.h
  • ID_RESETC : Colors.h
  • ID_RESETDEVNAMES : DevNames.h
  • ID_RESETFIND : Find.h
  • ID_RESETFONT : Font.h
  • ID_RESETLF : LogFont.h
  • ID_RESETOPEN : Open.h
  • ID_RESETPRINT : Print.h
  • ID_RESETTITLE : Title.h
  • ID_RESULTICON : OleStd.h
  • ID_RESULTLABEL : OleStd.h
  • ID_RETURNC : Colors.h
  • ID_RETURNF : Font.h
  • ID_RETURNFT : Find.h
  • ID_RETURNO : Open.h
  • ID_RETURNP : Print.h
  • ID_RETURNTI : Title.h
  • ID_RGBCOLORSF : Font.h
  • ID_RGBRESULTC : Colors.h
  • ID_RUN_TEST : Resource.h
  • ID_SAVE : Resource.h
  • ID_SAVE_NOW : Resource.h
  • ID_SAVE_ON_EXIT : Resource.h
  • ID_SCROLLFIELD : FontView.h
  • ID_SEND_MESSAGE : Resource.h
  • ID_SEND_WM_CF_LF_MSG : Font.h
  • ID_SEPARATOR : afxres.h
  • ID_SERVER : Resource.h
  • ID_SESSION : Resource.h
  • ID_SETUPHOOKP : Print.h
  • ID_SHOW_ON_SCREEN : Resource.h
  • ID_SHUTDOWN_SYSTEM : Resource.h
  • ID_SIZEMAXF : Font.h
  • ID_SIZEMINF : Font.h
  • ID_SNAPINCBOX : resource.h
  • ID_SPY_DEBUG_NORUNNINGAPPLICATIONS : Resource.h
  • ID_STATIC : OleStd.h
  • ID_STATUSBAR : resource.h , FontView.h , FVText.h
  • ID_STRUCTSIZEC : Colors.h
  • ID_STRUCTSIZEF : Font.h
  • ID_STRUCTSIZEFT : Find.h
  • ID_STRUCTSIZEO : Open.h
  • ID_STRUCTSIZEP : Print.h
  • ID_STYLEF : Font.h
  • ID_SZDEFEXTO : Open.h
  • ID_SZDEVMODEP : Print.h
  • ID_SZDEVNAMESP : Print.h
  • ID_SZFILEO : Open.h
  • ID_SZFILETITLEO : Open.h
  • ID_SZINITDIRO : Open.h
  • ID_SZTITLEO : Open.h
  • ID_TBLCPY_MENU : resource.h
  • ID_TBTN_ABOUT : Resource.h
  • ID_TBTN_CONNECT : Resource.h
  • ID_TBTN_DELETE : Resource.h
  • ID_TBTN_EXPORT_APP : Resource.h
  • ID_TBTN_IMPORT_COMPONENT : Resource.h
  • ID_TBTN_INSTALL_APP : Resource.h
  • ID_TBTN_INSTALL_COMPONENT : Resource.h
  • ID_TBTN_NEW : Resource.h
  • ID_TBTN_REFRESH : Resource.h
  • ID_TBTN_SAVE : Resource.h
  • ID_TBTN_START_APP : Resource.h
  • ID_TBTN_STOP_APP : Resource.h
  • ID_TBTN_UTILITY : Resource.h
  • ID_TEMPLATEC : Colors.h
  • ID_TEMPLATEF : Font.h
  • ID_TEMPLATEFT : Find.h
  • ID_TEMPLATEO : Open.h
  • ID_TERMINATE_PROCESS : Resource.h
  • ID_TIMEFIELD : FontView.h
  • ID_TIMER : resource.h
  • ID_TIPFONTDEC : Resource.h
  • ID_TIPFONTINC : Resource.h
  • ID_TITLEDIALOG : Title.h
  • ID_TITLETI : Title.h
  • ID_TOOLBAR : resource.h , FontView.h , FVText.h
  • ID_TOOLBARWND : resource.h
  • ID_TOOLS_TUNINGWIZARD : resource.h
  • ID_TOPAGEP : Print.h
  • ID_TOPBAND : resource.h
  • ID_TREEVIEW : resource.h
  • ID_UPDATETITLE : Resource.h
  • ID_URLBOX : resource.h
  • ID_USEHINSTO : Open.h
  • ID_VIEW_STATUS_BAR : afxres.h
  • ID_VIEW_TOOLBAR : afxres.h
  • ID_VIEWPORT : FVText.h
  • ID_VIRTUAL_CHANNEL : Resource.h
  • ID_WAIT_EVENT : Resource.h
  • ID_WDEFAULT : DevNames.h
  • ID_WDEVICEOFF : DevNames.h
  • ID_WDRIVEROFF : DevNames.h
  • ID_WIDTHSLIDER : Resource.h
  • ID_WIDTHTEXT : Resource.h
  • ID_WINDOW_ARRANGE : afxres.h
  • ID_WINDOW_ARRANGE_ICONS : resource.h
  • ID_WINDOW_ARRANGEICONS : Resource.h
  • ID_WINDOW_CASCADE : resource.h , afxres.h , Resource.h
  • ID_WINDOW_NEW : afxres.h
  • ID_WINDOW_SPLIT : afxres.h
  • ID_WINDOW_TILE : Resource.h
  • ID_WINDOW_TILE_HORIZONTALLY : resource.h
  • ID_WINDOW_TILE_HORZ : afxres.h
  • ID_WINDOW_TILE_VERT : afxres.h
  • ID_WINDOW_TILE_VERTICALLY : resource.h
  • ID_WINDOW_TILEVERTICAL : Resource.h
  • ID_WOUTPUTOFF : DevNames.h
  • ID_ZOOM : FontView.h
  • IDA_DIALER : Resource.h
  • IDABORT : winres.h
  • IDB_ACTIVATE : Resource.h
  • IDB_ADD : resource.h
  • IDB_ADDCOL : resource.h
  • IDB_ADDDEFINEDPROPS : resource.h
  • IDB_ADDFKCOL : resource.h
  • IDB_ADDSET : resource.h
  • IDB_ADTG : resource.h
  • IDB_AGGREGATION : resource.h
  • IDB_ALIGN : resource.h , res.h
  • IDB_ALWAYSRELEASEROWS : resource.h
  • IDB_ANNOTATOR : resource.h
  • IDB_APPBAR : Resource.h
  • IDB_APPIMG_16 : resource.h
  • IDB_APPIMG_32 : resource.h
  • IDB_AUTOSAVE : resource.h
  • IDB_BACK : Monkey.h
  • IDB_BACKGROUND : Resource.h
  • IDB_BASE : Resource.h
  • IDB_BIKE : resource.h , Resource.h , resource.h
  • IDB_BIKE2 : resource.h , Resource.h , resource.h
  • IDB_BIND_BOOKMARK : resource.h
  • IDB_BIND_LENGTH : resource.h
  • IDB_BIND_STATUS : resource.h
  • IDB_BIND_VALUE : resource.h
  • IDB_BITMAP1 : resource.h , res.h
  • IDB_BLOB_ILOCKBYTES : resource.h
  • IDB_BLOB_INLINE : resource.h
  • IDB_BLOB_ISEQSTREAM : resource.h
  • IDB_BLOB_ISTORAGE : resource.h
  • IDB_BLOB_ISTREAM : resource.h
  • IDB_BMP : ToolBar.h , Resource.h
  • IDB_BREAKID : resource.h
  • IDB_BROWSE : Resource.h
  • IDB_BROWSE_DATASOURCE : resource.h
  • IDB_BROWSE_DIRECTORY : resource.h
  • IDB_BROWSE_INTEGRATED : resource.h
  • IDB_BROWSE_LOCATION : resource.h
  • IDB_BROWSE_PROVIDER : resource.h
  • IDB_BROWSE_PROVSTRING : resource.h
  • IDB_CACHEINFO : resource.h
  • IDB_CAR : resource.h , Resource.h , resource.h
  • IDB_CAR2 : resource.h , Resource.h , resource.h
  • IDB_CASEINSENSITIVE : resource.h
  • IDB_CASESENSITIVE : resource.h
  • IDB_CLEAR : resource.h , res.h
  • IDB_CLEARALL : resource.h
  • IDB_CLOSED : resource.h , Resource.h , resource.h
  • IDB_CLOSED2 : resource.h , Resource.h , resource.h
  • IDB_COLLAB : Resource.h
  • IDB_COLPROP : resource.h
  • IDB_CONFIG_REMOVE : resource.h
  • IDB_CONFIG_SAVE : resource.h
  • IDB_CONNECT : resource.h
  • IDB_CURSORENGINE : resource.h
  • IDB_DEFAULTFETCH : resource.h
  • IDB_DEFAULTS : resource.h
  • IDB_DELCOL : resource.h
  • IDB_DELETE : resource.h
  • IDB_DELETESET : resource.h
  • IDB_DELFKCOL : resource.h
  • IDB_DIRECTORY : resource.h
  • IDB_DISPLAY_ADDREF : resource.h
  • IDB_DISPLAY_HEXADECIMAL : resource.h
  • IDB_DISPLAY_IDBASYNCHNOTIFY : resource.h
  • IDB_DISPLAY_IROWPOSITIONCHANGE : resource.h
  • IDB_DISPLAY_IROWSETNOTIFY : resource.h
  • IDB_DISPLAY_OLEDB : resource.h
  • IDB_DISPLAY_PROMPTVETO : resource.h
  • IDB_DISPLAY_QI : resource.h
  • IDB_DISPLAY_RELEASE : resource.h
  • IDB_DISPLAY_ROWSAFFECTED : resource.h
  • IDB_DISPLAYTREE : resource.h
  • IDB_DRAG_IMAGE : Resource.h
  • IDB_ENCRYPTINFO : resource.h
  • IDB_ENCRYPTPASSWORD : resource.h
  • IDB_ERRORINFO_ALWAYS : resource.h
  • IDB_ERRORINFO_FAILURE : resource.h
  • IDB_ERRORINFO_NEVER : resource.h
  • IDB_EXISTING_DSO : resource.h
  • IDB_FETCHDATA : resource.h
  • IDB_FILENAME : resource.h
  • IDB_FINISH : resource.h
  • IDB_FONT : resource.h , res.h
  • IDB_FROM_ARRAY : resource.h
  • IDB_FROM_BYREF : resource.h
  • IDB_FROM_CONNECT : resource.h
  • IDB_FROM_VECTOR : resource.h
  • IDB_HEADER : resource.h
  • IDB_HIDDENCOLUMNS : resource.h
  • IDB_HRESULT_ALWAYS : resource.h
  • IDB_HRESULT_FAILURE : resource.h
  • IDB_HRESULT_NEVER : resource.h
  • IDB_HRESULT_NOERRORINFO : resource.h
  • IDB_IMAGE : resource.h
  • IDB_IMALLOC_ALLOCS : resource.h
  • IDB_IMALLOC_SPY : resource.h
  • IDB_INDEXPROPERTIES : resource.h
  • IDB_INIT_INITIALIZE : resource.h
  • IDB_INIT_SETPROPERTIES : resource.h
  • IDB_INITOK : Client32.h
  • IDB_INPROC_HANDLER : resource.h
  • IDB_INPROC_SERVER : resource.h
  • IDB_LGBMP : resource.h , Resource.h , resource.h
  • IDB_LOCAL_SERVER : resource.h
  • IDB_LOGO : Resource.h
  • IDB_MASKPASSWORD : resource.h
  • IDB_MMCCONTROL : resource.h
  • IDB_MOREPROPERTIES : resource.h
  • IDB_MSDADC_ONLY : resource.h
  • IDB_NEXT : Monkey.h
  • IDB_NODEIMAGES_16 : resource.h
  • IDB_NODEIMAGES_32 : resource.h
  • IDB_OPEN : resource.h , Resource.h , resource.h
  • IDB_OPEN2 : resource.h , Resource.h , resource.h
  • IDB_OPTIONS : resource.h
  • IDB_OUTPUT : resource.h
  • IDB_OWNED_PROVIDER : resource.h
  • IDB_PERSISTINFO : resource.h
  • IDB_PLANE : resource.h , Resource.h , resource.h
  • IDB_PLANE2 : resource.h , Resource.h , resource.h
  • IDB_PREV : resource.h
  • IDB_PRINT : Monkey.h
  • IDB_QI_MANDATORY : resource.h
  • IDB_QI_OPTIONAL : resource.h
  • IDB_READING : resource.h , res.h
  • IDB_REFCOUNT_FAILURE : resource.h
  • IDB_RELEASE_OPENOBJECTS : resource.h
  • IDB_REMOTE_SERVER : resource.h
  • IDB_RESET : resource.h
  • IDB_RESULTSEGA : OleStd.h
  • IDB_RESULTSHIRESVGA : OleStd.h
  • IDB_RESULTSVGA : OleStd.h
  • IDB_ROCKET : resource.h , Resource.h , resource.h
  • IDB_ROCKET2 : resource.h , Resource.h , resource.h
  • IDB_ROWSETPROPERTIES : resource.h
  • IDB_ROWSTOFETCH : resource.h
  • IDB_SELECTALL : resource.h
  • IDB_SEND : Client32.h
  • IDB_SET_LEVEL : Resource.h
  • IDB_SETCOMMANDNONE : resource.h
  • IDB_SETCOMMANDSTREAM : resource.h
  • IDB_SETCOMMANDTEXT : resource.h
  • IDB_SETDEFAULTPROPS : resource.h
  • IDB_SETPARAMS : resource.h
  • IDB_SETPROPERTIES : resource.h
  • IDB_SHARE : Resource.h
  • IDB_SHOWSUPPORTED : resource.h
  • IDB_SMBMP : resource.h , Resource.h , resource.h
  • IDB_SMOPEN : resource.h , Resource.h , resource.h
  • IDB_STANDARDIMAGES : BttnCur.h
  • IDB_STANDARDIMAGES120 : BttnCur.h
  • IDB_STANDARDIMAGES72 : BttnCur.h
  • IDB_STANDARDIMAGES96 : BttnCur.h
  • IDB_STANDARDIMAGESMIN : BttnCur.h
  • IDB_STATE : resource.h
  • IDB_SWITCH : Resource.h
  • IDB_TABLEPROPERTIES : resource.h
  • IDB_TBAR : Resource.h
  • IDB_TEST : resource.h
  • IDB_TO_ARRAY : resource.h
  • IDB_TO_BYREF : resource.h
  • IDB_TO_CONNECT : resource.h
  • IDB_TO_VECTOR : resource.h
  • IDB_TOOLBAR : resource.h , MidiPlyr.h
  • IDB_TOOLS : Resource.h
  • IDB_TREEICON : resource.h
  • IDB_UNCOLLAB : Resource.h
  • IDB_UNICODE : resource.h
  • IDB_UNSELECTALL : resource.h
  • IDB_UNSHARE : Resource.h
  • IDB_UPDATE : Resource.h
  • IDB_USE_TRACEPROVIDER : resource.h
  • IDB_USEOPTCOLUMNS : resource.h
  • IDB_USEPARAMS : resource.h
  • IDB_USEPROPERTIES : resource.h
  • IDB_USERESTRICTIONS : resource.h
  • IDB_USESERVICECOMP : resource.h
  • IDB_WATERMARK : resource.h
  • IDB_WINDOW : Resource.h
  • IDB_XML : resource.h
  • IDB_XML_BROWSER : resource.h
  • IDB_XML_DOM : resource.h
  • IDB_XML_EDITBOX : resource.h
  • IDBASIC : Resource.h
  • IDBT_FONTSIZEDECREASE : Resource.h
  • IDBT_FONTSIZEINCREASE : Resource.h
  • IDBT_OPENAS : Resource.h
  • IDBZ_ICON : OleStd.h
  • IDBZ_MESSAGE1 : OleStd.h
  • IDBZ_RETRY : OleStd.h
  • IDBZ_SWITCHTO : OleStd.h
  • IDC_ABOUT : Dialogs.h
  • IDC_ACCESSCHECK : Resource.h
  • IDC_ACCOUNT : resource.h
  • IDC_ACCTNAME : resource.h
  • IDC_ACELIST : resource.h
  • IDC_ACETYPE : resource.h
  • IDC_ACK_FULL_RADIO : Resource.h
  • IDC_ACK_FULL_REACH_QUEUE_RADIO : Resource.h
  • IDC_ACK_FULL_RECEIVE_RADIO : Resource.h
  • IDC_ACK_NEG_RADIO : Resource.h
  • IDC_ACK_NONE_RADIO : Resource.h
  • IDC_ACODE : Resource.h
  • IDC_ACP : resource.h , res.h
  • IDC_ACTIONINARGUMENT : resource.h
  • IDC_ACTIONNAME : resource.h
  • IDC_ACTIONOUTARGUMENT : resource.h
  • IDC_ACTIVE : Resource.h
  • IDC_ADD : resource.h , Resource.h
  • IDC_ADD_BUTTON : resource.h
  • IDC_ADDACCESS : Resource.h
  • IDC_ADDCOL : resource.h
  • IDC_ADDEQUIPMENT : resource.h
  • IDC_ADDFKCOL : resource.h
  • IDC_ADDPARTY : Resource.h
  • IDC_ADDRESS : Resource.h
  • IDC_ADDRESSTYPE : Resource.h
  • IDC_ADDUSER : resource.h
  • IDC_ADMIN_COMBO : Resource.h
  • IDC_ADSPATH : resource.h
  • IDC_ADSTYPE : resource.h
  • IDC_AGENT : Resource.h
  • IDC_AGENTVERSION : Resource.h
  • IDC_Aggregate : resource.h
  • IDC_AMOUNT : resource.h
  • IDC_ANIMATE : resource.h
  • IDC_ANIMATIONS : Resource.h
  • IDC_ANIMATIONS_LABEL : Resource.h
  • IDC_ANIMATIONSTATE : resource.h
  • IDC_ANSIFILL : FullIME.h , HalfIME.h
  • IDC_ANSWER : Resource.h
  • IDC_APP_CODE : Resource.h
  • IDC_APPBAR : Resource.h
  • IDC_APPLICATION_COPYRIGHT : Resource.h
  • IDC_APPLICATION_ICON : Resource.h
  • IDC_APPLICATION_TITLE : Resource.h
  • IDC_APPLICATION_VERSION : Resource.h
  • IDC_APPLYDIGITSUBST : Resource.h
  • IDC_APPSHARING : Resource.h
  • IDC_ARANUMCONTEXT : Resource.h
  • IDC_ARCHIVE_ATTR : resource.h
  • IDC_AREACODE : Resource.h
  • IDC_ASYNCFIND : resource.h
  • IDC_ASYNCH : resource.h
  • IDC_ATTR : resource.h
  • IDC_ATTR_COMPRESSED : resource.h
  • IDC_ATTR_ENCRYPTED : resource.h
  • IDC_ATTRIBONLY : resource.h
  • IDC_ATTRIBUTE : resource.h
  • IDC_ATTRLIST : resource.h
  • IDC_ATTRVALUE : resource.h
  • IDC_AUDIT_TO_DB : Resource.h
  • IDC_AUTHENTICATED : Resource.h
  • IDC_AUTO_CHAT : Resource.h
  • IDC_AUTOANSWER : Resource.h
  • IDC_AUTOHIDE : Resource.h
  • IDC_AVEBITS : resource.h
  • IDC_AVGTIME1 : Resource.h
  • IDC_AVGTIME2 : Resource.h
  • IDC_AVGTIME3 : Resource.h
  • IDC_AVGTIMEBASE : Resource.h
  • IDC_BACKUP_FLAG : resource.h
  • IDC_BAD : Resource.h
  • IDC_BALLOON_AUTOHIDE : Resource.h
  • IDC_BALLOON_AUTOPACE : Resource.h
  • IDC_BALLOON_SIZETOTEXT : Resource.h
  • IDC_BALLOON_USE : Resource.h
  • IDC_BAR : wdiffrc.h
  • IDC_BESTFIT : Dialogs.h
  • IDC_BINDGUID : resource.h
  • IDC_BINDING_INFO_EDIT : resource.h
  • IDC_BINDINGTYPE : resource.h
  • IDC_BITDEPTH : resource.h
  • IDC_BITMAP1 : Dialogs.h
  • IDC_BITMAP2 : Dialogs.h
  • IDC_BLUE : Resource.h
  • IDC_BLUEGAMMA : resource.h
  • IDC_BLUEGAMMASLIDER : resource.h
  • IDC_BODY : Resource.h
  • IDC_BOX1 : Dialogs.h , Dibdll.h
  • IDC_BOX2 : Dialogs.h
  • IDC_BOX3 : Dialogs.h
  • IDC_BOX4 : Dialogs.h
  • IDC_BRIGHTNESS : resource.h
  • IDC_BRIGHTNESSSLIDER : resource.h
  • IDC_BROWSE : resource.h
  • IDC_BUDDYLIST : resource.h
  • IDC_BUTTON1 : resource.h , Resource.h
  • IDC_BUTTON2 : resource.h , Resource.h
  • IDC_BUTTON_ADDQUEUE : resource.h
  • IDC_BUTTON_APPLICATION_FILE_SEARCH : Resource.h
  • IDC_BUTTON_APPLICATON_ID_SEARCH : Resource.h
  • IDC_BUTTON_ATTACH : Resource.h , resource.h
  • IDC_BUTTON_CHANGE_PICTURE : resource.h
  • IDC_BUTTON_CLEAR_PICTURE : resource.h
  • IDC_BUTTON_COMPONENT_SEARCH : Resource.h
  • IDC_BUTTON_EXPORT_PATH_SEARCH : Resource.h
  • IDC_BUTTON_INSTALL_DIRECTORY_SEARCH : Resource.h
  • IDC_BUTTON_PROXY_STUB_DLL : Resource.h
  • IDC_BUTTON_SESSION_ACCEPT : resource.h
  • IDC_BUTTON_SESSION_REJECT : resource.h
  • IDC_BUTTON_SET_PROPERTY : Resource.h
  • IDC_BUTTON_TYPE_LIBRARY : Resource.h
  • IDC_BUTTON_WATCHER_ALLOW : resource.h
  • IDC_BUTTON_WATCHER_BLOCK : resource.h
  • IDC_CACHERESULTS : resource.h
  • IDC_CALFORMAT : resource.h , res.h
  • IDC_CALL_USER : Resource.h
  • IDC_CallbackList : resource.h
  • IDC_CALLINGCARD : Resource.h
  • IDC_CANCEL : gutilsrc.h , resource.h , Resource.h
  • IDC_CANCEL2 : resource.h
  • IDC_CANONICALNUMBER : Resource.h
  • IDC_CAPTIONBARONLY : Dialogs.h
  • IDC_CATALOG : resource.h
  • IDC_CBLIST : resource.h
  • IDC_CCODE : Resource.h
  • IDC_CENTER : Resource.h
  • IDC_CHANGE_CREATE_CHILD : resource.h
  • IDC_CHANGE_CREATE_CHILD2 : resource.h
  • IDC_CHANGE_CREATE_CHILD3 : resource.h
  • IDC_CHANGE_CREATE_CHILD4 : resource.h
  • IDC_ChangeIndexID : resource.h
  • IDC_CHANGEUSER : resource.h
  • IDC_CHANNELNUM : resource.h
  • IDC_CHANNELS : resource.h
  • IDC_CHASEREFERRAL : resource.h
  • IDC_CHASEREFERRAL_TXT : resource.h
  • IDC_CHATTY : resource.h
  • IDC_CHECK1 : resource.h , Resource.h
  • IDC_CHECK2 : resource.h , Resource.h
  • IDC_CHECK3 : Resource.h
  • IDC_CHECK4 : Resource.h
  • IDC_CHECK5 : Resource.h
  • IDC_CHECK6 : Resource.h
  • IDC_CHECK7 : Resource.h
  • IDC_CHECK8 : Resource.h
  • IDC_CHECK_ALLAPPS : Resource.h
  • IDC_CHECK_COMMAND_REQUEST_CONTEXT : resource.h
  • IDC_CHECK_COMMAND_RESPONSE_CONTEXT : resource.h
  • IDC_CHECK_OVERWRITE_FILES : Resource.h
  • IDC_CHECK_PRESENTATION_CONTEXT : resource.h
  • IDC_CHECK_REMOTE_SERVER_INSTALL : Resource.h
  • IDC_CHECK_USER_CONTEXT : resource.h
  • IDC_CHECK_WATCHER_ADD_BUDDY : resource.h
  • IDC_CHECKAUTO : Resource.h
  • IDC_CHILDRENLIST : resource.h
  • IDC_CHK_MATCHCASE : wdiffrc.h
  • IDC_CHK_WHOLEWORD : wdiffrc.h
  • IDC_CHOOSECOLOR : Resource.h , secClnt.h , secSvr.h
  • IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES : resource.h
  • IDC_CHOOSER_CHECK_OVERRIDE_MACHINE_NAME : resource.h
  • IDC_CHOOSER_EDIT_MACHINE_NAME : resource.h
  • IDC_CHOOSER_GROUP_TARGET_MACHINE : resource.h
  • IDC_CHOOSER_RADIO_LOCAL_MACHINE : resource.h
  • IDC_CHOOSER_RADIO_SPECIFIC_MACHINE : resource.h
  • IDC_CHOOSER_STATIC : resource.h
  • IDC_CIRCLE : Resource.h
  • IDC_CLASS : resource.h
  • IDC_CLASS_EDIT : resource.h
  • IDC_CLEAR : FullIME.h , HalfIME.h
  • IDC_CLEAR_ON_NEW : Deb.h
  • IDC_CLEARTEXT : resource.h
  • IDC_CLIENT_AUTHNLEVEL : secClnt.h
  • IDC_CLIENT_IMPLEVEL : secClnt.h
  • IDC_CLIENTAREAONLY : Dialogs.h
  • IDC_CLOSE : resource.h
  • IDC_CLOSEIME : FullIME.h , HalfIME.h
  • IDC_CODEPOINT : Resource.h
  • IDC_COLLIST : resource.h
  • IDC_COLNAME : resource.h
  • IDC_COLOR : Resource.h , secClnt.h , secSvr.h
  • IDC_COLORFULNESS : resource.h
  • IDC_COLORFULNESSSLIDER : resource.h
  • IDC_COLORTEXT : Resource.h , secSvr.h
  • IDC_COLUMN : resource.h
  • IDC_COLUMN_NAMES : Resource.h
  • IDC_COLUMNS : resource.h
  • IDC_COMBO : Resource.h
  • IDC_COMBO1 : secClnt.h , resource.h , Resource.h , resource.h , Resource.h
  • IDC_COMBO2 : Resource.h
  • IDC_COMBO3 : Resource.h
  • IDC_COMBO_APPLICATION : Resource.h
  • IDC_COMBO_BITDEPTH : resource.h
  • IDC_COMBO_CHANNEL : resource.h
  • IDC_COMBO_GUIDFORMAT : resource.h
  • IDC_COMBO_LOGON_TRANSPORT : resource.h
  • IDC_COMBO_SAMPLERATE : resource.h
  • IDC_COMBO_SPEAKER : resource.h
  • IDC_COMBO_WAVEFORMAT : resource.h
  • IDC_COMBODEVICE : resource.h
  • IDC_COMBOFIND : resource.h
  • IDC_COMBOSERVICE : resource.h
  • IDC_COMMANDS : Resource.h
  • IDC_COMMENT : Resource.h
  • IDC_COMPANY : Generic.H , StatList.h , LeakyBin.h
  • IDC_COMPANYNAME : resource.h
  • IDC_COMPAREOP : resource.h
  • IDC_COMPLETE2 : resource.h
  • IDC_COMPLETIONTIME : resource.h
  • IDC_COMPLETIONTIMETXT : resource.h
  • IDC_CONFIG : resource.h
  • IDC_CONFIGDIALOG_ADD : Resource.h
  • IDC_CONFIGDIALOG_CONFIGTEXT : Resource.h
  • IDC_CONFIGDIALOG_EDIT : Resource.h
  • IDC_CONFIGDIALOG_ITEMLIST : Resource.h
  • IDC_CONFIGDIALOG_REMOVE : Resource.h
  • IDC_CONFIGDIALOG_SUMMARYTEXT : Resource.h
  • IDC_CONFIGURATIONCHANGED : Resource.h
  • IDC_CONFIGURELINE : Resource.h
  • IDC_CONNECT : Resource.h , resource.h , Resource.h , resource.h
  • IDC_CONNECTED : Resource.h
  • IDC_CONNECTION : resource.h
  • IDC_CONNECTSTRING : resource.h
  • IDC_CONSTYPE : resource.h
  • IDC_CONTEXTHELP : BttnCur.h
  • IDC_CONTINUE : Resource.h , resource.h
  • IDC_CONTRAST : resource.h
  • IDC_CONTRASTSLIDER : resource.h
  • IDC_CONTROL1 : resource.h
  • IDC_CONTROL2 : resource.h
  • IDC_CONTROL_CHARS : Resource.h
  • IDC_CONTROL_CONTEXT : Resource.h
  • IDC_COORDINATES : resource.h
  • IDC_COPY : resource.h
  • IDC_COPYRIGHT : Generic.H , Dialogs.h , StatList.h , LeakyBin.h
  • IDC_COUNTRYCODE : Resource.h
  • IDC_CREATE : secClnt.h , resource.h
  • IDC_CREATE_CHILD : resource.h
  • IDC_CREATE_FILE : Resource.h
  • IDC_CREATE_ROWS : resource.h
  • IDC_CREATE_TABLES : resource.h
  • IDC_CREATECHILD : resource.h
  • IDC_CREATECHILD_EDIT : resource.h
  • IDC_CREATIONTIMETXT : resource.h
  • IDC_CREDIT : resource.h
  • IDC_CTL1_NAME : resource.h
  • IDC_CTL1_VER : resource.h
  • IDC_CTL2_NAME : resource.h
  • IDC_CTL2_VER : resource.h
  • IDC_CURRENTCREDENTIAL : resource.h
  • IDC_CUSTOM1 : Resource.h
  • IDC_CUSTOMDRAWBUTTONDLG : Resource.h
  • IDC_DATA : Resource.h
  • IDC_DATAGRID1 : resource.h
  • IDC_DATATYPE : resource.h
  • IDC_DBCSFILL : FullIME.h , HalfIME.h
  • IDC_DEAD_LETTER : Resource.h
  • IDC_DEBIT : resource.h
  • IDC_DEBUG : resource.h
  • IDC_DEBUG_MODE_ERROR : Deb.h
  • IDC_DEBUG_MODE_MINORERROR : Deb.h
  • IDC_DEBUG_MODE_NONE : Deb.h
  • IDC_DEBUG_MODE_WARNING : Deb.h
  • IDC_DEBUG_ONLY_THIS_PROCESS : Deb.h
  • IDC_DEBUG_PROCESS : Deb.h
  • IDC_DEFAULT_HW_RECO : resource.h
  • IDC_DEFAULT_POS : HalfIME.h
  • IDC_DEFAULT_SPEECH_RECO : resource.h
  • IDC_DEFAULTDIALECT : resource.h
  • IDC_DEFERRABILITY : resource.h
  • IDC_DELAY1 : Resource.h
  • IDC_DELAY2 : Resource.h
  • IDC_DELAY3 : Resource.h
  • IDC_DELCOL : resource.h
  • IDC_DELETE : resource.h
  • IDC_DELETE_BUTTON : resource.h
  • IDC_DELETE_QUEUE_COMBO : Resource.h
  • IDC_DELETECHILD : resource.h
  • IDC_DELETECHILD_EDIT : resource.h
  • IDC_DELETEOBJECT : resource.h
  • IDC_DELETERULE : resource.h
  • IDC_DELETETREE : resource.h
  • IDC_DELFKCOL : resource.h
  • IDC_DELIVERY_EXPRESS_RADIO : Resource.h
  • IDC_DELIVERY_RECOVERABLE_RADIO : Resource.h
  • IDC_DEREF : resource.h
  • IDC_DEREF_TXT : resource.h
  • IDC_DESCRIPTION : resource.h
  • IDC_DESCRIPTION_EDIT : resource.h
  • IDC_DEVICES : Resource.h
  • IDC_DEVNAME_EDIT : resource.h
  • IDC_DEVPROP : resource.h
  • IDC_DIAL : Resource.h
  • IDC_DIALABLENUMBER : Resource.h
  • IDC_DIALECT : resource.h
  • IDC_DIALINGPROPERTIES : Resource.h
  • IDC_DIGIT_SUBSTITUTE : Resource.h
  • IDC_DIMENSIONS : resource.h
  • IDC_DIRECTORIES : Dialogs.h
  • IDC_DIRS : gutilsrc.h
  • IDC_DISCONNECT : Resource.h
  • IDC_DISCONNECT_SESSION : Resource.h
  • IDC_DISCONNECTED : Resource.h
  • IDC_DISCOVERY : resource.h
  • IDC_DISK_PROPS_DESCRIPTIONS : resource.h
  • IDC_DISKDETAILS : resource.h
  • IDC_DISKINFO : Resource.h
  • IDC_DISPLAYABLENUMBER : Resource.h
  • IDC_DISPLAYBOX : Resource.h
  • IDC_DISPLAYICON : Resource.h
  • IDC_DISPLAYNAME : resource.h
  • IDC_DIVIDINGLINE : Dialogs.h
  • IDC_DN : resource.h
  • IDC_DNS_NAME_EDIT : resource.h
  • IDC_DNS_NAME_TYPE_EDIT : resource.h
  • IDC_DOMAIN : Resource.h , resource.h , Resource.h
  • IDC_DOMAIN_NAME : Resource.h
  • IDC_DOWN : Resource.h
  • IDC_Download : resource.h
  • IDC_DOWNLOAD : resource.h
  • IDC_DOWNLOAD_ACTIONTEXT : resource.h
  • IDC_DOWNLOAD_BANNER : resource.h
  • IDC_DOWNLOAD_CANCEL : resource.h
  • IDC_DOWNLOAD_ICON : resource.h
  • IDC_DOWNLOAD_PROGRESSBAR : resource.h
  • IDC_DRAGPENDING : Resource.h
  • IDC_DRAWAREA_SCRIBLLE : Resource.h , resource.h
  • IDC_DRD_FINDWHAT : wdiffrc.h
  • IDC_DURI : Resource.h
  • IDC_DURISTATIC : Resource.h
  • IDC_DWUSERID : Resource.h
  • IDC_E_AUTOSIZE : Resource.h
  • IDC_ECAC : Resource.h
  • IDC_EDIT : tsfedit.h
  • IDC_EDIT1 : resource.h , Resource.h , resource.h
  • IDC_EDIT2 : Resource.h
  • IDC_EDIT3 : Resource.h
  • IDC_EDIT4 : Resource.h
  • IDC_EDIT5 : Resource.h
  • IDC_EDIT6 : Resource.h
  • IDC_EDIT7 : Resource.h
  • IDC_EDIT8 : Resource.h
  • IDC_EDIT_ADDRESS_NAME : resource.h
  • IDC_EDIT_ADDRESS_URI : resource.h
  • IDC_EDIT_APPLICATION_FILE : Resource.h
  • IDC_EDIT_APPLICATION_ID : Resource.h
  • IDC_EDIT_APPLICATION_ID_VALUE : Resource.h
  • IDC_EDIT_AUTH_ACCOUNT : resource.h
  • IDC_EDIT_AUTH_PASSWORD : resource.h
  • IDC_EDIT_AUTH_USERURI : resource.h
  • IDC_EDIT_AVEBITS : resource.h
  • IDC_EDIT_BUTTON : resource.h
  • IDC_EDIT_COMPONENT : Resource.h
  • IDC_EDIT_CONTAINER : resource.h
  • IDC_EDIT_DOMAIN : resource.h
  • IDC_EDIT_EMPLOYEE_ID : resource.h
  • IDC_EDIT_ENTRYNAME : resource.h
  • IDC_EDIT_EXPORT_PATH : Resource.h
  • IDC_EDIT_FRIEND : Resource.h , resource.h
  • IDC_EDIT_FRIEND_COMPUTER : Resource.h , resource.h
  • IDC_EDIT_INSTALL_DIRECTORY : Resource.h
  • IDC_EDIT_LOGIN : Resource.h , resource.h
  • IDC_EDIT_LOGON_SERVER : resource.h
  • IDC_EDIT_LOGON_USERURI : resource.h
  • IDC_EDIT_MACHINE : DComDraw.h , RemClien.h
  • IDC_EDIT_NAME : Resource.h
  • IDC_EDIT_OUTPUT_PATH : resource.h
  • IDC_EDIT_PASSWD : Resource.h
  • IDC_EDIT_PASSWORD : resource.h
  • IDC_EDIT_PGTITLE : RESDEF.h
  • IDC_EDIT_PHONENO : resource.h
  • IDC_EDIT_PICTURE_PATH : resource.h
  • IDC_EDIT_PROPERTY_VALUE : Resource.h
  • IDC_EDIT_PROXY_STUB_DLL : Resource.h
  • IDC_EDIT_PWD : Resource.h
  • IDC_EDIT_REMOTE_COMPUTER_NAME : Resource.h
  • IDC_EDIT_REMOTE_SERVER_NAME : Resource.h
  • IDC_EDIT_TYPE_LIBRARY : Resource.h
  • IDC_EDIT_UID : Resource.h
  • IDC_EDIT_USERNAME : resource.h
  • IDC_EDIT_VALIDBITS : resource.h
  • IDC_EDITBOX : resource.h
  • IDC_EDITDEVICETYPE : resource.h
  • IDC_EDITFILE : Dialogs.h
  • IDC_EDITFRIENDLYNAME : resource.h
  • IDC_EDITMANUFACTURER : resource.h
  • IDC_EDITMANUFACTURERURL : resource.h
  • IDC_EDITMODELDESCRIPTION : resource.h
  • IDC_EDITMODELNAME : resource.h
  • IDC_EDITMODELNUMBER : resource.h
  • IDC_EDITMODELURL : resource.h
  • IDC_EDITPRESENTATIONURL : resource.h
  • IDC_EDITSELECTPRINTER : resource.h
  • IDC_EDITSERIALNUMBER : resource.h
  • IDC_EDITUDN : resource.h
  • IDC_EDITUPC : resource.h
  • IDC_EDITWIN : resource.h , res.h
  • IDC_EDT_BODY_SIZE : Resource.h
  • IDC_EDT_GOTOLINE : wdiffrc.h
  • IDC_ENABLED : resource.h
  • IDC_ENCRYPT : resource.h
  • IDC_ENCRYPTED : Resource.h
  • IDC_ENTIRESCREEN : Dialogs.h
  • IDC_ENTIREWINDOW : Dialogs.h
  • IDC_ENTRYNAME : Resource.h
  • IDC_ENUMDISKS : resource.h , Resource.h
  • IDC_ENUMSERVICES : resource.h
  • IDC_ENUMSERVICESASYNC : resource.h
  • IDC_ERRORMSG : resource.h
  • IDC_ERRORMSGTXT : resource.h
  • IDC_ESTIMATEDTIME : resource.h
  • IDC_ESTIMATEDTIMETXT : resource.h
  • IDC_EVENT_FLAGS : Resource.h
  • IDC_EVENTLIST : resource.h
  • IDC_EVENTS : resource.h
  • IDC_EVENTS_FRAME : Resource.h
  • IDC_EVENTSINK : Resource.h
  • IDC_EXECUTE : resource.h
  • IDC_EXIT : Resource.h , resource.h
  • IDC_EXTENDEDRIGHT : resource.h
  • IDC_EXTENDEDRIGHT_EDIT : resource.h
  • IDC_FAILS : Resource.h
  • IDC_FANCY_BOLD1 : Resource.h
  • IDC_FANCY_BOLD2 : Resource.h
  • IDC_FANCY_BOLD3 : Resource.h
  • IDC_FANCY_BOLD4 : Resource.h
  • IDC_FANCY_FONT1 : Resource.h
  • IDC_FANCY_FONT2 : Resource.h
  • IDC_FANCY_FONT3 : Resource.h
  • IDC_FANCY_FONT4 : Resource.h
  • IDC_FANCY_ITALIC1 : Resource.h
  • IDC_FANCY_ITALIC2 : Resource.h
  • IDC_FANCY_ITALIC3 : Resource.h
  • IDC_FANCY_ITALIC4 : Resource.h
  • IDC_FANCY_SIZE1 : Resource.h
  • IDC_FANCY_SIZE2 : Resource.h
  • IDC_FANCY_SIZE3 : Resource.h
  • IDC_FANCY_SIZE4 : Resource.h
  • IDC_FANCY_UNDERLINE1 : Resource.h
  • IDC_FANCY_UNDERLINE2 : Resource.h
  • IDC_FANCY_UNDERLINE3 : Resource.h
  • IDC_FANCY_UNDERLINE4 : Resource.h
  • IDC_FAR : Resource.h
  • IDC_FASTBIND : resource.h
  • IDC_FILE : Dialogs.h
  • IDC_FILEDESC : Generic.H , StatList.h , LeakyBin.h
  • IDC_FILEDESCRIPTION : resource.h
  • IDC_FILEINFO : OpenDIB.c
  • IDC_FILENAME : resource.h
  • IDC_FILES : gutilsrc.h
  • IDC_FILETEXT : Dialogs.h
  • IDC_FILTER : resource.h
  • IDC_FINDBYTYPE : resource.h
  • IDC_FINDBYUDN : resource.h
  • IDC_FINDSOMEONE : Resource.h
  • IDC_FINISH : resource.h
  • IDC_FKCOLLIST : resource.h
  • IDC_FKCOLNAME : resource.h
  • IDC_FLAGS : resource.h
  • IDC_FLDRNAME_EDIT : resource.h
  • IDC_FNAME : gutilsrc.h
  • IDC_FOLD : Dialogs.h
  • IDC_FORMAT1 : Resource.h
  • IDC_FORMAT2 : Resource.h
  • IDC_FORMAT3 : Resource.h
  • IDC_FORMAT4 : Resource.h
  • IDC_FORMATNAME_COMBO2 : Resource.h
  • IDC_FORMATTED : Resource.h
  • IDC_FRAME_CATALOG_INFO : Resource.h
  • IDC_FRAME_EXPORT_CLIENT_ONLY : Resource.h
  • IDC_FRAME_FRIEND : resource.h
  • IDC_FRAME_IMPORT_BY : Resource.h
  • IDC_FRAME_INSTALL_OPTIONS : Resource.h
  • IDC_FRAME_OBJECTS_AND_PROP_INFO : Resource.h
  • IDC_FRAME_PREVIOUS_COLLECTIONS : Resource.h
  • IDC_FRAME_RELATED_COLLECTIONS : Resource.h
  • IDC_FRAME_UTILITY_OPTIONS : Resource.h
  • IDC_FRAME_UTILITY_TYPE : Resource.h
  • IDC_FROM : resource.h
  • IDC_FROMTYPE : resource.h
  • IDC_GET : resource.h
  • IDC_GETEX : resource.h
  • IDC_GETINFO : resource.h
  • IDC_GETINFOEX : resource.h
  • IDC_GIRLS : resource.h
  • IDC_GLOBALDEV : res.h
  • IDC_GOOD : Resource.h
  • IDC_GREEN : Resource.h
  • IDC_GREENGAMMA : resource.h
  • IDC_GREENGAMMASLIDER : resource.h
  • IDC_GROUPBOX1 : Dialogs.h
  • IDC_GUID : resource.h
  • IDC_HARROWS : BttnCur.h
  • IDC_HCONFNOTIFY : Resource.h
  • IDC_Header1 : resource.h
  • IDC_HEADER1 : resource.h
  • IDC_Header2 : resource.h
  • IDC_HEADER2 : resource.h
  • IDC_HIDDEN_ATTR : resource.h
  • IDC_HIGH_PRIORITY_CLASS : Deb.h
  • IDC_HIGHLIGHT_FROM : Resource.h
  • IDC_HIGHLIGHT_TO : Resource.h
  • IDC_HIPART : resource.h
  • IDC_HORIZ : Resource.h
  • IDC_HOST : Resource.h
  • IDC_HSIZEBAR : BttnCur.h
  • IDC_HSPLITBAR : BttnCur.h
  • IDC_HWR_NAME : resource.h
  • IDC_HWR_VENDOR : resource.h
  • IDC_ICONAREA : Dialogs.h
  • IDC_ICONPOS : Resource.h
  • IDC_IDC_MQ_RECEIVE_ACCESS : Resource.h
  • IDC_IDLE_PRIORITY_CLASS : Deb.h
  • IDC_ILLUMINATE : resource.h
  • IDC_IM_DISPLAY : resource.h
  • IDC_IM_EDIT : resource.h
  • IDC_IM_SEND : resource.h
  • IDC_IMAGE : OpenDIB.c
  • IDC_IMPERSONATE : resource.h , Resource.h
  • IDC_INHERITANCE : resource.h
  • IDC_INITIALDIR : Deb.h
  • IDC_INITIALIZE : secClnt.h , secSvr.h
  • IDC_INPROC_MTA2STA : Resource.h
  • IDC_INPROC_MTA2STA_CANCELACT : Resource.h
  • IDC_INPROC_MTA2STA_CANCELCALL : Resource.h
  • IDC_INPROC_STA2MTA : Resource.h
  • IDC_INPROC_STA2MTA_CANCELACT : Resource.h
  • IDC_INPROC_STA2MTA_CANCELCALL : Resource.h
  • IDC_INPROC_STA2STA : Resource.h
  • IDC_INPROC_STA2STA_CANCELACT : Resource.h
  • IDC_INPROC_STA2STA_CANCELCALL : Resource.h
  • IDC_INPUT : resource.h
  • IDC_INSERT_CODEPOINT : Resource.h
  • IDC_INSTALL : Resource.h
  • IDC_INTERFACE : resource.h
  • IDC_INTERFACES : resource.h
  • IDC_INTERFACESTREAM : resource.h
  • IDC_INVOKEACTION : resource.h
  • IDC_ISCO_FLAGS : resource.h
  • IDC_ISOLEVEL : resource.h
  • IDC_ITEM : resource.h
  • IDC_ITEMCONFIGDIALOG_EDIT_DIR1NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_EDIT_DIR2NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_EDIT_DISPLAYNAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_INCLUDESUBDIRS : Resource.h
  • IDC_ITEMCONFIGDIALOG_STATIC_DIR1NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_STATIC_DIR2NAME : Resource.h
  • IDC_ITEMCONFIGDIALOG_STATIC_DISPLAYNAME : Resource.h
  • IDC_ITERCOUNT : Resource.h
  • IDC_ITERS : resource.h
  • IDC_ITERTOTAL : Resource.h
  • IDC_JOBSTATUS : resource.h
  • IDC_JOURNAL : Resource.h
  • IDC_JUSTIFY : Resource.h
  • IDC_KEYWORD_EDIT : resource.h
  • IDC_KEYWORD_LIST : resource.h
  • IDC_LABEL : Generic.H , Resource.h , StatList.h , LeakyBin.h
  • IDC_LABEL_APPLICATION : Resource.h
  • IDC_LABEL_APPLICATION_FILE : Resource.h
  • IDC_LABEL_APPLICATION_ID : Resource.h
  • IDC_LABEL_COLLECTION_NAME_DESC : Resource.h
  • IDC_LABEL_COLLECTION_NAME_VALUE : Resource.h
  • IDC_LABEL_COMPONENT : Resource.h
  • IDC_LABEL_COMPUTER_NAME_DESC : Resource.h
  • IDC_LABEL_COMPUTER_NAME_VALUE : Resource.h
  • IDC_LABEL_EXPORT_PATH : Resource.h
  • IDC_LABEL_INSTALL_DIRECTORY : Resource.h
  • IDC_LABEL_OBJECTS_DESC : Resource.h
  • IDC_LABEL_PROPERTIES_DESC2 : Resource.h
  • IDC_LABEL_PROPERTY_VALUE_DESC : Resource.h
  • IDC_LABEL_PROXY_STUB_DLL : Resource.h
  • IDC_LABEL_PWD : Resource.h
  • IDC_LABEL_REMOTE_SERVER_NAME : Resource.h
  • IDC_LABEL_TYPE_LIBRARY : Resource.h
  • IDC_LABEL_UID : Resource.h
  • IDC_LANGNAME : resource.h , res.h
  • IDC_LANGUAGE : Resource.h
  • IDC_LANGUAGES : resource.h , res.h
  • IDC_LARGEARROWS : BttnCur.h
  • IDC_LASTVALUE : Resource.h
  • IDC_LBINSTALLEDCODECS : Resource.h
  • IDC_LCID : resource.h
  • IDC_LDATEFORMAT : resource.h , res.h
  • IDC_LDATESAMPLE : resource.h , res.h
  • IDC_LDIRS : gutilsrc.h
  • IDC_LEFT : Resource.h
  • IDC_LEGACY_BIDI : Resource.h
  • IDC_LEGALCOPYRIGHT : resource.h
  • IDC_LEGALTRADEMARKS : resource.h
  • IDC_LEVEL : Resource.h
  • IDC_LFILES : gutilsrc.h
  • IDC_LFNAME : gutilsrc.h
  • IDC_LINECREATE : Resource.h
  • IDC_LINEFILL : Resource.h
  • IDC_LINEICON : Resource.h
  • IDC_LIST : Resource.h
  • IDC_LIST1 : resource.h , Resource.h , FullIME.h , Resource.h
  • IDC_LIST2 : Resource.h
  • IDC_LIST32 : FullIME.h
  • IDC_LIST_APPS : Resource.h
  • IDC_LIST_EVENTS : Resource.h
  • IDC_LIST_MODEMS : resource.h
  • IDC_LIST_OBJECTS : Resource.h
  • IDC_LIST_PARENT_COLLECTIONS : Resource.h
  • IDC_LIST_PROPERTIES : Resource.h
  • IDC_LIST_RELATED_COLLECTIONS : Resource.h
  • IDC_LIST_SERVERS : Resource.h
  • IDC_LIST_SESSION : Resource.h
  • IDC_LISTBOX : DfV.h , resource.h
  • IDC_LISTCONTENT : resource.h
  • IDC_LISTEN : resource.h
  • IDC_LISTOBJECT : resource.h
  • IDC_LISTVIEW : resource.h , enumdesk.h
  • IDC_LISTVIEWEVENTS : Resource.h
  • IDC_LISTVIEWSYSEVENTS : Resource.h
  • IDC_LISTWIN : ListWIN.h
  • IDC_LOAD : resource.h
  • IDC_LOCAL : Resource.h
  • IDC_LOCALE : resource.h
  • IDC_LOCATE_LABEL : Resource.h
  • IDC_LOCATION : OpenDIB.c , Resource.h
  • IDC_LOCKED_ATTR : resource.h
  • IDC_LOG_FILE : Resource.h
  • IDC_LOG_TO_FILE : Resource.h
  • IDC_LOGICAL : Resource.h
  • IDC_LOGICAL_ORDER : Resource.h
  • IDC_LOGICAL_STYLES : Resource.h
  • IDC_LOGICAL_WIDTH : Resource.h
  • IDC_LOGOFF_SESSION : Resource.h
  • IDC_LOOKSD : Resource.h
  • IDC_LOWPART : resource.h
  • IDC_LPAGENR : gutilsrc.h
  • IDC_LSDIR : gutilsrc.h
  • IDC_LTR : Resource.h
  • IDC_LURI : Resource.h
  • IDC_LURISTATIC : Resource.h
  • IDC_LV_LCID : resource.h , res.h
  • IDC_MACHINE : Resource.h
  • IDC_MACHINENAME : secClnt.h
  • IDC_MAGNIFY : BttnCur.h
  • IDC_MAKEOFFICE : Resource.h
  • IDC_MANUAL_SERVER_NAME : Resource.h
  • IDC_MATCHTYPE : resource.h
  • IDC_MAXTIME1 : Resource.h
  • IDC_MAXTIME2 : Resource.h
  • IDC_MAXTIME3 : Resource.h
  • IDC_MAXTIMEBASE : Resource.h
  • IDC_MDICHILD : resource.h
  • IDC_MENUBARONLY : Dialogs.h
  • IDC_MESSAGE : resource.h
  • IDC_MESSAGE_PRIORITY : Resource.h
  • IDC_MIC_MUTE : resource.h
  • IDC_MIC_VOL : resource.h
  • IDC_MINTIME1 : Resource.h
  • IDC_MINTIME2 : Resource.h
  • IDC_MINTIME3 : Resource.h
  • IDC_MINTIMEBASE : Resource.h
  • IDC_MODIFICATIONTIME : resource.h
  • IDC_MODIFICATONTIMETXT : resource.h
  • IDC_MODIFYOWNER : resource.h
  • IDC_MODIFYPERMISSION : resource.h
  • IDC_MONITOR : Resource.h
  • IDC_MOVE : resource.h , Resource.h
  • IDC_MOVE_X : Resource.h
  • IDC_MOVE_Y : Resource.h
  • IDC_MOVEMONEY : resource.h
  • IDC_MQ_PEEK_ACCESS : Resource.h
  • IDC_MQ_SEND_ACCESS : Resource.h
  • IDC_MSG_NOTIFY : Resource.h
  • IDC_MSG_OBJECTS : Resource.h
  • IDC_MSG_STATE : Resource.h
  • IDC_MSG_TRACE : Resource.h
  • IDC_MTA : resource.h
  • IDC_MUIWEB : res.h
  • IDC_MUIWEB2 : res.h
  • IDC_MULTILINGUAL : res.h
  • IDC_MYICON : Resource.h
  • IDC_NACK_REACH_QUEUE_RADIO : Resource.h
  • IDC_NACK_RECEIVE_RADIO : Resource.h
  • IDC_NAME : resource.h , Resource.h , resource.h
  • IDC_NAME_EDIT : resource.h
  • IDC_NAMESPACE : resource.h , Resource.h
  • IDC_NCOUNTRYNAME : resource.h , res.h
  • IDC_NEAR : Resource.h
  • IDC_NEARCARET_POS : HalfIME.h
  • IDC_NEG_CURRENCY : resource.h , res.h
  • IDC_NEG_NUMBER : resource.h , res.h
  • IDC_NESWARROWS : BttnCur.h
  • IDC_NEW_CONTAINER : Resource.h
  • IDC_NEW_MMF : Resource.h
  • IDC_NEW_OBJECT : Resource.h
  • IDC_NEW_PIPE : Resource.h
  • IDC_NEW_TREE : Resource.h
  • IDC_NEWUICURSORMAX : BttnCur.h
  • IDC_NEWUICURSORMIN : BttnCur.h
  • IDC_NLANGNAME : resource.h , res.h
  • IDC_NLSWEB : res.h
  • IDC_NMCH_AS : Resource.h
  • IDC_NMCH_AUDIO : Resource.h
  • IDC_NMCH_DATA : Resource.h
  • IDC_NMCH_FIRST : Resource.h
  • IDC_NMCH_FT : Resource.h
  • IDC_NMCH_LAST : Resource.h
  • IDC_NMCH_SKIPP_THIS_ONE : Resource.h
  • IDC_NO_GLYPH_INDEX : Resource.h
  • IDC_NOAUTHENTICATION : resource.h
  • IDC_NODROP : BttnCur.h
  • IDC_NOHELPCONTROLS : Resource.h
  • IDC_NOPUTCOLOR : secSvr.h
  • IDC_NOPUTUSERNAME : secSvr.h
  • IDC_NORMAL_PRIORITY_CLASS : Deb.h
  • IDC_NOTIFY1 : Resource.h
  • IDC_NOTIFY2 : Resource.h
  • IDC_NOTIFY3 : Resource.h
  • IDC_NOUI : Resource.h
  • IDC_NUMBERWRITES : Resource.h
  • IDC_NWSEARROWS : BttnCur.h
  • IDC_OBJECT_TREE : Resource.h
  • IDC_OBJECTS : secSvr.h
  • IDC_OBJECTTYPE : resource.h
  • IDC_ODBC_STOP : resource.h
  • IDC_OEM : resource.h , res.h
  • IDC_OK : resource.h , Resource.h
  • IDC_ONTOP : Resource.h
  • IDC_OPEN : gutilsrc.h , resource.h
  • IDC_OPENIME : FullIME.h , HalfIME.h
  • IDC_OPT_DOWN : wdiffrc.h
  • IDC_OPT_UP : wdiffrc.h
  • IDC_OPTIONSBUTTON : Dialogs.h
  • IDC_ORDER : resource.h
  • IDC_OSVERSION : Generic.H , StatList.h , LeakyBin.h
  • IDC_OUTPROC_MTA2MTA : Resource.h
  • IDC_OUTPROC_MTA2MTA_CANCELACT : Resource.h
  • IDC_OUTPROC_MTA2MTA_CANCELCALL : Resource.h
  • IDC_OUTPROC_MTA2STA : Resource.h
  • IDC_OUTPROC_MTA2STA_CANCELACT : Resource.h
  • IDC_OUTPROC_MTA2STA_CANCELCALL : Resource.h
  • IDC_OUTPROC_STA2MTA : Resource.h
  • IDC_OUTPROC_STA2MTA_CANCELACT : Resource.h
  • IDC_OUTPROC_STA2MTA_CANCELCALL : Resource.h
  • IDC_OUTPROC_STA2STA : Resource.h
  • IDC_OUTPROC_STA2STA_CANCELACT : Resource.h
  • IDC_OUTPROC_STA2STA_CANCELCALL : Resource.h
  • IDC_OUTPUT : resource.h
  • IDC_OUTPUTLIST : resource.h , Resource.h
  • IDC_OVERRIDE : Resource.h
  • IDC_PAGESIZE : resource.h
  • IDC_PAGESIZE_TXT : resource.h
  • IDC_PARENT : resource.h
  • IDC_PARENTPATH : resource.h
  • IDC_PARTIALSCREEN : Dialogs.h
  • IDC_PARTYLIST : Resource.h
  • IDC_PARTYSTATIC : Resource.h
  • IDC_PASSWORD : resource.h , Resource.h
  • IDC_PATH_EDIT : resource.h
  • IDC_PATHNAME_COMBO : Resource.h
  • IDC_PAUSE : Resource.h
  • IDC_PB_AUTOSIZE : Resource.h
  • IDC_PCPCRADIO : Resource.h
  • IDC_PCPHRADIO : Resource.h
  • IDC_PEOPLE_COLOR : resource.h
  • IDC_PEOPLE_GIRLS : resource.h
  • IDC_PEOPLE_MATERIAL : resource.h
  • IDC_PEOPLE_NAME : resource.h
  • IDC_PEOPLE_OWNER : resource.h
  • IDC_PEOPLE_SURFACE : resource.h
  • IDC_PERCENTAGE : Dialogs.h , Dibdll.h
  • IDC_PHONE : Resource.h
  • IDC_PHONENUMBER : Resource.h
  • IDC_PHPHRADIO : Resource.h
  • IDC_PICTURE : Resource.h
  • IDC_PICTURE_DISPLAY : resource.h
  • IDC_PINGFAILS : Resource.h
  • IDC_PINGS : Resource.h
  • IDC_PLAINTEXT : Resource.h
  • IDC_PLAINTEXT_BOLD : Resource.h
  • IDC_PLAINTEXT_CLIP : Resource.h
  • IDC_PLAINTEXT_DX : Resource.h
  • IDC_PLAINTEXT_FALLBACK : Resource.h
  • IDC_PLAINTEXT_FIT : Resource.h
  • IDC_PLAINTEXT_FONT : Resource.h
  • IDC_PLAINTEXT_HOTKEY : Resource.h
  • IDC_PLAINTEXT_ITALIC : Resource.h
  • IDC_PLAINTEXT_LINK : Resource.h
  • IDC_PLAINTEXT_PASSWORD : Resource.h
  • IDC_PLAINTEXT_SIZE : Resource.h
  • IDC_PLAINTEXT_TAB : Resource.h
  • IDC_PLAINTEXT_UNDERLINE : Resource.h
  • IDC_PLAY : resource.h , Resource.h
  • IDC_PORT : Resource.h
  • IDC_POS_CURRENCY : resource.h , res.h
  • IDC_POS_NUMBER : resource.h , res.h
  • IDC_POSITION_LABEL : Resource.h
  • IDC_PP_FILESHARESAMPLE_MAXUSERS : resource.h
  • IDC_PP_FILESHARESAMPLE_MAXUSERS_LABEL : resource.h
  • IDC_PP_FILESHARESAMPLE_PATH : resource.h
  • IDC_PP_FILESHARESAMPLE_PATH_LABEL : resource.h
  • IDC_PP_FILESHARESAMPLE_REMARK : resource.h
  • IDC_PP_FILESHARESAMPLE_REMARK_LABEL : resource.h
  • IDC_PP_FILESHARESAMPLE_SHARENAME : resource.h
  • IDC_PP_FILESHARESAMPLE_SHARENAME_LABEL : resource.h
  • IDC_PP_ICON : resource.h
  • IDC_PP_TITLE : resource.h
  • IDC_PREFER_POS : HalfIME.h
  • IDC_PREFIX_EDIT : resource.h
  • IDC_PRESENTATION : resource.h , Resource.h
  • IDC_PRINTER : Dialogs.h
  • IDC_PRINTTEXT1 : Dialogs.h , Dibdll.h
  • IDC_PRINTTEXT2 : Dialogs.h , Dibdll.h
  • IDC_PRIORITY : resource.h
  • IDC_PRIORITYTXT : resource.h
  • IDC_PROCESS : Resource.h
  • IDC_PROCESSLIST : Deb.h
  • IDC_PRODUCT_GUID_EDIT : resource.h
  • IDC_PRODUCT_NAME_EDIT : resource.h
  • IDC_PRODUCT_VERSION_EDIT : resource.h
  • IDC_PRODUCTVERSION : resource.h
  • IDC_PRODVER : Generic.H , StatList.h , LeakyBin.h
  • IDC_PROGRESS : resource.h , Resource.h
  • IDC_PROGRESS_BAR : resource.h
  • IDC_PROGRESSBAR : resource.h
  • IDC_PROGRESSINFO : resource.h
  • IDC_PROGRESSINFOTXT : resource.h
  • IDC_PROMPT : gutilsrc.h , resource.h
  • IDC_PROMPTCREDENTIAL : resource.h
  • IDC_PROPEDIT_OPTIONS : resource.h
  • IDC_PROPEDIT_TYPE : resource.h
  • IDC_PROPEDIT_VALUE : resource.h
  • IDC_PROPLIST : Resource.h
  • IDC_PROPSET : resource.h
  • IDC_PROTECTION : resource.h
  • IDC_PROVIDER : resource.h
  • IDC_PROVIDER_NAME : resource.h
  • IDC_PROXY_AUTHN : secClnt.h
  • IDC_PROXY_AUTHNLEVEL : secClnt.h
  • IDC_PROXY_AUTHZ : secClnt.h
  • IDC_PROXY_IMPLEVEL : secClnt.h
  • IDC_PROXY_PRINCIPLENAME : secClnt.h
  • IDC_PSTN : resource.h
  • IDC_PURGE : resource.h
  • IDC_PURPOSE : resource.h , res.h
  • IDC_PUT : resource.h
  • IDC_PUTEX : resource.h
  • IDC_QUERY_SESSION : Resource.h
  • IDC_QUERYVARIABLE : resource.h
  • IDC_QUEUE_LABEL : Resource.h
  • IDC_QUEUE_PATHNAME : Resource.h
  • IDC_RADIO1 : Resource.h , resource.h , Resource.h
  • IDC_RADIO2 : Resource.h , resource.h , Resource.h
  • IDC_RADIO3 : Resource.h
  • IDC_RADIO4 : Resource.h
  • IDC_RADIO_BASE : Resource.h
  • IDC_RADIO_CLSID : Resource.h
  • IDC_RADIO_COMSYNC : Resource.h
  • IDC_RADIO_DO_NOT_EXPORT_USERS : Resource.h
  • IDC_RADIO_DS : Resource.h , resource.h
  • IDC_RADIO_EXPORT_CLIENTS : Resource.h
  • IDC_RADIO_EXPORT_USERS : Resource.h
  • IDC_RADIO_EXPRESS : Resource.h , resource.h
  • IDC_RADIO_FREE : Resource.h
  • IDC_RADIO_INSTALL_WITH_USERS : Resource.h
  • IDC_RADIO_INSTALL_WITHOUT_USERS : Resource.h
  • IDC_RADIO_JNEC : Resource.h
  • IDC_RADIO_PRIVATEQUEUE : resource.h
  • IDC_RADIO_PROG_ID : Resource.h
  • IDC_RADIO_PUBLICQUEUE : resource.h
  • IDC_RADIO_RECOVERABLE : Resource.h , resource.h
  • IDC_RADIO_REFRESH : Resource.h
  • IDC_RADIO_REMOTE_COMPUTER : Resource.h
  • IDC_RADIO_ROUTER : Resource.h
  • IDC_RADIO_SETSTREAM : resource.h
  • IDC_RADIO_SETTEXT : resource.h
  • IDC_RADIO_STA : Resource.h
  • IDC_RADIO_START : Resource.h
  • IDC_RADIO_STOP : Resource.h
  • IDC_RADIO_THIS_COMPUTER : Resource.h
  • IDC_RADIO_WORKGROUP : Resource.h , resource.h
  • IDC_RCDISP1 : wdiffrc.h
  • IDC_RDN : resource.h
  • IDC_READONLY : resource.h
  • IDC_READONLY_ATTR : resource.h
  • IDC_READPERMISSION : resource.h
  • IDC_READPROP : resource.h
  • IDC_READPROP_EDIT : resource.h
  • IDC_REALTIME_PRIORITY_CLASS : Deb.h
  • IDC_RECORD : resource.h
  • IDC_RED : Resource.h
  • IDC_REDGAMMA : resource.h
  • IDC_REDGAMMASLIDER : resource.h
  • IDC_REFBLACK : resource.h
  • IDC_REFBLACKSLIDER : resource.h
  • IDC_REFIID : resource.h
  • IDC_REFRESH : Resource.h
  • IDC_REFWHITE : resource.h
  • IDC_REFWHITESLIDER : resource.h
  • IDC_REGISTER : Resource.h
  • IDC_REGPERM : resource.h
  • IDC_REGTEMP : resource.h
  • IDC_RELEASE : secClnt.h
  • IDC_REMIX : resource.h
  • IDC_REMOVE : resource.h , Resource.h
  • IDC_REMOVEPARTY : Resource.h
  • IDC_RENAME : resource.h
  • IDC_REORDER : Resource.h
  • IDC_RESERVED : resource.h
  • IDC_Resource1 : resource.h
  • IDC_RESOURCE1 : resource.h
  • IDC_Resource2 : resource.h
  • IDC_RESOURCE2 : resource.h
  • IDC_RESTRICTION1 : resource.h
  • IDC_RESTRICTION2 : resource.h
  • IDC_RESTRICTION3 : resource.h
  • IDC_RESTRICTION4 : resource.h
  • IDC_RESTRICTION5 : resource.h
  • IDC_RESTRICTION6 : resource.h
  • IDC_RESTRICTION7 : resource.h
  • IDC_RESULTLIST : resource.h
  • IDC_RESULTS : resource.h
  • IDC_RESUME : resource.h
  • IDC_RESUME2 : resource.h
  • IDC_RETAINING : resource.h
  • IDC_RIGHT : Resource.h
  • IDC_RIGHTARROW : BttnCur.h
  • IDC_ROCKET_HEIGHT : resource.h
  • IDC_ROCKET_NAME : resource.h
  • IDC_ROCKET_PAYLOAD : resource.h
  • IDC_ROCKET_STATUS : resource.h
  • IDC_ROCKET_WEIGHT : resource.h
  • IDC_ROWS : resource.h
  • IDC_RSN : Resource.h
  • IDC_RTL : Resource.h
  • IDC_RUN_SUITE : resource.h
  • IDC_S_AUTOSIZE : Resource.h
  • IDC_SAMPLERATE : resource.h
  • IDC_SAMPLETEXT : resource.h
  • IDC_SAVE_PREFERENCES : Deb.h
  • IDC_SCALE : Dialogs.h
  • IDC_SCHEMA : resource.h
  • IDC_SCHEMAPATH : resource.h
  • IDC_SCHEMAS : resource.h
  • IDC_SCPDURL : resource.h
  • IDC_SCROLLBAR : resource.h
  • IDC_SDATEFORMAT : resource.h , res.h
  • IDC_SDATESAMPLE : resource.h , res.h
  • IDC_SDIR : gutilsrc.h
  • IDC_SEALING : resource.h
  • IDC_SEARCHSCOPE : resource.h
  • IDC_SEARCHSCOPE_TXT : resource.h
  • IDC_SECURED : resource.h
  • IDC_SECURITY : Resource.h
  • IDC_SELECTPRINTER : Dialogs.h
  • IDC_SELECTTEXT : Dialogs.h
  • IDC_SEND_MESSAGE : Resource.h
  • IDC_SERVER_AUTHNLEVEL : secSvr.h
  • IDC_SERVER_CLASS : secClnt.h
  • IDC_SERVER_CONFIG_PATH_EDIT : resource.h
  • IDC_SERVER_EDIT : resource.h
  • IDC_SERVER_IMPLEVEL : secSvr.h
  • IDC_SERVER_LIST : Resource.h
  • IDC_SERVER_LIST2 : Resource.h
  • IDC_SERVER_NAME : Resource.h
  • IDC_SERVERNAME : Resource.h
  • IDC_SERVICE_CLASS_EDIT : resource.h
  • IDC_SESSION_INFO : Resource.h
  • IDC_SESSION_LIST : Resource.h
  • IDC_SET : resource.h
  • IDC_SETINFO : resource.h
  • IDC_SETSESSION : Resource.h
  • IDC_SFX : Resource.h
  • IDC_SHORT : Resource.h
  • IDC_SHOW_AS : Resource.h
  • IDC_SHOW_CHAT : Resource.h
  • IDC_SHOW_FT : Resource.h
  • IDC_SHOW_GRID_LINES : Resource.h
  • IDC_SHOW_ON_SCREEN : Resource.h
  • IDC_SHOW_SYMBOLS : Deb.h
  • IDC_SHOW_T126WB : Resource.h
  • IDC_SHOW_WB : Resource.h
  • IDC_SHOWLEVELS : Resource.h
  • IDC_SHUTDOWN_PARAMETERS : Resource.h
  • IDC_SIGNING : resource.h
  • IDC_SINGLEWINDOW : Dialogs.h
  • IDC_SIZELIMIT : resource.h
  • IDC_SIZELIMIT_TXT : resource.h
  • IDC_SKU : resource.h
  • IDC_SMALLARROWS : BttnCur.h
  • IDC_SORTON : resource.h
  • IDC_SORTON_TXT : resource.h
  • IDC_SPEAK : Resource.h
  • IDC_SPEAKERFLAGS : resource.h
  • IDC_SPEAKTEXT : Resource.h
  • IDC_SPEECHOUTPUT_LABEL : Resource.h
  • IDC_SPIN : Resource.h
  • IDC_SPIN_COUNT : resource.h
  • IDC_SPIN_OFFSET : resource.h
  • IDC_SPK_MUTE : resource.h
  • IDC_SPK_VOL : resource.h
  • IDC_SPLIT_CURSOR : resource.h
  • IDC_SPR_NAME : resource.h
  • IDC_SPR_VENDOR : resource.h
  • IDC_SQUARE : Resource.h
  • IDC_SQUAREONLY : Resource.h
  • IDC_STA : resource.h
  • IDC_START : Resource.h
  • IDC_STARTTIME : resource.h
  • IDC_STATBAR : MidiPlyr.h
  • IDC_STATE11 : Resource.h
  • IDC_STATE12 : Resource.h
  • IDC_STATE21 : Resource.h
  • IDC_STATE22 : Resource.h
  • IDC_STATE31 : Resource.h
  • IDC_STATE32 : Resource.h
  • IDC_STATIC : Generic.H , wdiffrc.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , afxres.h , Resource.h , StatList.h , LeakyBin.h , Resource.h
  • IDC_STATIC_C_LABEL : Resource.h , resource.h
  • IDC_STATIC_CHOOSE_DS : Resource.h , resource.h
  • IDC_STATIC_CHOOSE_MESSAGE : Resource.h , resource.h
  • IDC_STATIC_CHOOSE_QUEUE : resource.h
  • IDC_STATIC_CURRENTAPP : Resource.h
  • IDC_STATIC_DSFRAME : resource.h
  • IDC_STATIC_EVENTPLACEHOLDER : Resource.h
  • IDC_STATIC_ICON : resource.h
  • IDC_STATIC_MACHINE : DComDraw.h , RemClien.h
  • IDC_STATIC_PGTITLE : RESDEF.h
  • IDC_STATIC_Q_LABEL : Resource.h , resource.h
  • IDC_STATIC_RECT2 : Resource.h
  • IDC_STATIC_RECT3 : Resource.h
  • IDC_STATIC_SELECT2 : Resource.h
  • IDC_STATIC_SELECT3 : Resource.h
  • IDC_STATIC_SESSION_NAME : resource.h
  • IDC_STATIC_SESSION_URI : resource.h
  • IDC_STATIC_TYPE : Resource.h
  • IDC_STATIC_WATCHER_NAME : resource.h
  • IDC_STATIC_WATCHER_URI : resource.h
  • IDC_STATICAREACODE : Resource.h
  • IDC_STATICCALLINGCARD : Resource.h
  • IDC_STATICCANONICAL : Resource.h
  • IDC_STATICCONNECTUSING : Resource.h
  • IDC_STATICCOUNTRYCODE : Resource.h
  • IDC_STATICDIALABLE : Resource.h
  • IDC_STATICDISPLAYABLE : Resource.h
  • IDC_STATICHOWTODIAL : Resource.h
  • IDC_STATICLOCATION : Resource.h
  • IDC_STATICPHONENUMBER : Resource.h
  • IDC_STATICPHONENUMBERS : Resource.h
  • IDC_STATICTAPILINE : Resource.h
  • IDC_STATICWHERETODIAL : Resource.h
  • IDC_STATUS : wdiffrc.h , Resource.h , resource.h
  • IDC_STATUSBAR : Dialogs.h , resource.h , tsfedit.h
  • IDC_STATUSTXT : resource.h
  • IDC_STOP : resource.h , Resource.h
  • IDC_STOPBEFOREPLAY : Resource.h
  • IDC_STREAMVIEW : DfV.h
  • IDC_STRETCHTOPAGE : Dialogs.h
  • IDC_SUBMIT : resource.h
  • IDC_SUITE_STATUS : resource.h
  • IDC_SUSPEND : resource.h
  • IDC_SUSPEND2 : resource.h
  • IDC_TABLELIST : resource.h
  • IDC_TABLETOP : BttnCur.h
  • IDC_TABLETPC : resource.h
  • IDC_TABLETPC_DISABLED : resource.h
  • IDC_TABLETPC_ENABLED : resource.h
  • IDC_TALL : Resource.h
  • IDC_TAPILINE : Resource.h
  • IDC_TARGET_COMBO : Resource.h
  • IDC_TEXT : resource.h
  • IDC_TEXT1 : Dialogs.h
  • IDC_TEXTWIN : TextWIN.h
  • IDC_THIN : Resource.h
  • IDC_THREADCOUNT : Resource.h
  • IDC_THREADRUNNING : Resource.h
  • IDC_THREADS : resource.h
  • IDC_TIME_TO_BE_RECEIVED : Resource.h
  • IDC_TIME_TO_REACH_QUEUE : Resource.h
  • IDC_TIMEFORMAT : resource.h , res.h
  • IDC_TIMELIMIT : resource.h
  • IDC_TIMELIMIT_TXT : resource.h
  • IDC_TIMEOUT : resource.h , Resource.h
  • IDC_TIMEOUT_TXT : resource.h
  • IDC_TIMEOUTS : Resource.h
  • IDC_TIMESAMPLE : resource.h , res.h
  • IDC_TINT : resource.h
  • IDC_TINTSLIDER : resource.h
  • IDC_TIP11 : Resource.h
  • IDC_TIP12 : Resource.h
  • IDC_TIP21 : Resource.h
  • IDC_TIP22 : Resource.h
  • IDC_TIP31 : Resource.h
  • IDC_TIP32 : Resource.h
  • IDC_TITLE : Dialogs.h
  • IDC_TITLE1 : Dialogs.h
  • IDC_TITLE2 : Dialogs.h
  • IDC_TO : resource.h
  • IDC_TOOLBAR : MidiPlyr.h , Resource.h
  • IDC_TOPMOST : Resource.h
  • IDC_TOTAL : resource.h
  • IDC_TOTYPE : resource.h
  • IDC_TRADEMARK : Generic.H , StatList.h , LeakyBin.h
  • IDC_TRANSACTION : resource.h
  • IDC_TRANSFERRATE : resource.h
  • IDC_TRANSFERRATETXT : resource.h
  • IDC_TREE : resource.h
  • IDC_TREEVIEW : resource.h , enumdesk.h
  • IDC_TRIANGLE : Resource.h
  • IDC_TRIES : Resource.h
  • IDC_TSF : resource.h
  • IDC_TUNE : Resource.h
  • IDC_TYPE : resource.h
  • IDC_TYPENAME : resource.h
  • IDC_UI_APP_SHARE : Resource.h
  • IDC_UI_CALL : Resource.h
  • IDC_UI_FT : Resource.h
  • IDC_UI_JOIN : Resource.h
  • IDC_UNINSTALL : Resource.h
  • IDC_UP : Resource.h
  • IDC_UPDATE : resource.h , Resource.h
  • IDC_UPDATERULE : resource.h
  • IDC_UPLOADREPLY_CHECKBOX : resource.h
  • IDC_URL1 : resource.h
  • IDC_URL2 : resource.h
  • IDC_URLs : resource.h
  • IDC_USAGE_TEXT : wdiffrc.h
  • IDC_USE : resource.h
  • IDC_USEDIALINGRULES : Resource.h
  • IDC_USEPING : Resource.h
  • IDC_USER1 : Resource.h
  • IDC_USER_EDIT : resource.h
  • IDC_USERID : Resource.h
  • IDC_USERLIST : Resource.h
  • IDC_USERNAME : secClnt.h , secSvr.h , resource.h , Resource.h
  • IDC_USERNAME_TXT : resource.h
  • IDC_VALIDBITS : resource.h
  • IDC_VALUELIST : resource.h
  • IDC_VARIABLENAME : resource.h
  • IDC_VARROWS : BttnCur.h
  • IDC_VENDOR_GUID_EDIT : resource.h
  • IDC_VENDOR_NAME_EDIT : resource.h
  • IDC_VERBOSE : Deb.h
  • IDC_VERSION : Dialogs.h , Resource.h
  • IDC_VERSION_GUIO_EDIT : resource.h
  • IDC_VERT : Resource.h
  • IDC_VIEW : resource.h
  • IDC_VIEW_NEXT : resource.h
  • IDC_VIEW_PREV : resource.h
  • IDC_VIEWSCPD : resource.h
  • IDC_VIRTUAL_CHANNEL : Resource.h
  • IDC_VIRTUALDIR : resource.h
  • IDC_VISIBLE : Resource.h
  • IDC_VRECV : Resource.h
  • IDC_VRECVS : Resource.h
  • IDC_VRECVSTATIC : Resource.h
  • IDC_VSEND : Resource.h
  • IDC_VSENDS : Resource.h
  • IDC_VSENDSTATIC : Resource.h
  • IDC_VSIZEBAR : BttnCur.h
  • IDC_VSPLITBAR : BttnCur.h
  • IDC_WARNING : Resource.h
  • IDC_WIDE : Resource.h
  • IDC_WIDTH : Resource.h
  • IDC_WINDOW : Resource.h
  • IDC_WLXLOGGEDOUTSAS_DOMAIN : GinaDlg.c
  • IDC_WLXLOGGEDOUTSAS_PASSWORD : GinaDlg.c
  • IDC_WLXLOGGEDOUTSAS_USERNAME : GinaDlg.c
  • IDC_WLXWKSTALOCKEDSAS_DOMAIN : GinaDlg.c
  • IDC_WRITEPROP : resource.h
  • IDC_WRITEPROP_EDIT : resource.h
  • IDC_X224 : resource.h
  • IDC_X_LABEL : Resource.h
  • IDC_XACTTC : resource.h
  • IDC_XAXIS : Dialogs.h
  • IDC_XTEXT : Dialogs.h
  • IDC_Y_LABEL : Resource.h
  • IDC_YAXIS : Dialogs.h
  • IDC_YTEXT : Dialogs.h
  • IDCANCEL : winres.h
  • IDCB_LOADBG : resource.h
  • IDCB_LOADFG : resource.h
  • IDCC_FILLCOLOR : resource.h
  • IDCC_FOREGROUND : resource.h
  • IDCE_BGA : resource.h
  • IDCE_BGB : resource.h
  • IDCE_BGBOUNDSX : resource.h
  • IDCE_BGBOUNDSY : resource.h
  • IDCE_BGG : resource.h
  • IDCE_BGR : resource.h
  • IDCE_BGSURFACE : resource.h
  • IDCE_FGSURFACE : resource.h
  • IDCE_FGTILEX : resource.h
  • IDCE_FGTILEY : resource.h
  • IDCE_OPACITY : resource.h
  • IDCHANGE : Resource.h
  • IDCOLORS_POS : Menu.h
  • IDCOMBO_AXIS : resource.h
  • IDCR_BOUNDS : resource.h
  • IDCR_FGPLACE : resource.h
  • IDCR_FGTILE : resource.h
  • IDCV_ACTIVATEAS : OleStd.h
  • IDCV_ACTIVATELIST : OleStd.h
  • IDCV_CHANGEICON : OleStd.h
  • IDCV_CONVERTLIST : OleStd.h
  • IDCV_CONVERTTO : OleStd.h
  • IDCV_DISPLAYASICON : OleStd.h
  • IDCV_GRPRESULT : OleStd.h
  • IDCV_ICON : OleStd.h
  • IDCV_ICONLABEL1 : OleStd.h
  • IDCV_ICONLABEL2 : OleStd.h
  • IDCV_OBJECTTYPE : OleStd.h
  • IDCV_RESULTTEXT : OleStd.h
  • IDCV_STXCONVERTTO : OleStd.h
  • IDCV_STXCURTYPE : OleStd.h
  • IDD_1 : WinCap.h
  • IDD_13 : WxForm.h
  • IDD_23 : WxForm.h
  • IDD_24 : WinCap.h
  • IDD_33 : WxForm.h
  • IDD_4 : WinCap.h
  • IDD_8 : WinCap.h
  • IDD_ABOUT : Resource.h , resource.h , Resource.h
  • IDD_ABOUT_DIALOG : Resource.h , resource.h
  • IDD_ABOUTBOX : Resource.h , ComObjI.h , Server.h , DllSkelI.h , Server.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h
  • IDD_ADDCOLUMN : resource.h
  • IDD_ADDCONSTRAINTDESC : resource.h
  • IDD_ADDDEVICE_DLG : resource.h
  • IDD_ADDFOLDER_DLG : resource.h
  • IDD_ADDFORMATDLG : Resource.h
  • IDD_ADDVFILE_DLG : resource.h
  • IDD_ADQI_DIALOG : resource.h
  • IDD_ADVCGEN_DIALOG : resource.h
  • IDD_AGGREGATION : resource.h
  • IDD_AICON : Resource.h
  • IDD_ALTERCOLUMN : resource.h
  • IDD_ALTERINDEX : resource.h
  • IDD_ALTERTABLE : resource.h
  • IDD_APP32 : Resource.h
  • IDD_APP_UTILITY : Resource.h
  • IDD_ATEXTCOPYRIGHT : Resource.h
  • IDD_ATEXTFREEMEM : Resource.h
  • IDD_ATEXTRESOURCE : Resource.h
  • IDD_ATEXTTITLE : Resource.h
  • IDD_ATEXTVERSION : Resource.h
  • IDD_ATEXTWINMODE : Resource.h
  • IDD_ATTRIBUTES : wdiffrc.h
  • IDD_AUDIO : Resource.h
  • IDD_AUTOCOPY : wdiffrc.h
  • IDD_BANKDLG : resource.h
  • IDD_BASE_DIALOG : resource.h
  • IDD_BINDRESOURCE : resource.h
  • IDD_BLRPLATE_CONFIG_DIALOG : resrc1.h
  • IDD_BOTHREMOTE : wdiffrc.h
  • IDD_BPP : WinCap.h
  • IDD_BROWSE_ENUM : resource.h
  • IDD_BUTTONS : Resource.h
  • IDD_CALL : Resource.h
  • IDD_CALL_CONF : Resource.h
  • IDD_CALLFAILED : Resource.h
  • IDD_CANCEL_DIALOG : Resource.h
  • IDD_CANCONVERT : resource.h
  • IDD_CAP : Resource.h
  • IDD_CAPMFC_DIALOG : Resource.h
  • IDD_CFTEXT : Resource.h
  • IDD_CHANGE_PASSWORD_DIALOG : GinaDlg.c
  • IDD_CHOOSER_CHOOSE_MACHINE : resource.h
  • IDD_CLIENT_DIALOG : Resource.h
  • IDD_CLNTEDIT : Client32.h
  • IDD_CLOSE_QUEUE_DIALOG : Resource.h
  • IDD_CMDLINECONSUMER_DIALOG : Resource.h
  • IDD_COLOR_DIALOG : Resource.h
  • IDD_COMBOBOXES : Resource.h
  • IDD_COMDLG32 : Resource.h
  • IDD_COMMANDPERSIST : resource.h
  • IDD_COMSPYPROPPAGE : Resource.h
  • IDD_CONFERENCE : Resource.h
  • IDD_CONFIGDIALOG : Resource.h
  • IDD_CONFIGUREEVENTSDLG : Resource.h
  • IDD_CONNECT : Resource.h
  • IDD_CONNECTUSING : Resource.h
  • IDD_CONTEXTSAMPLEPROPPAGE : resource.h
  • IDD_CREATE_QUEUE_DIALOG : Resource.h
  • IDD_CREATEACCESSOR : resource.h
  • IDD_CREATEINDEX : resource.h
  • IDD_CREATETABLE : resource.h
  • IDD_CUERRORTEXT : Resource.h
  • IDD_CULISTADDRESS : Resource.h
  • IDD_CULISTLINE : Resource.h
  • IDD_CUPROPERTIES : Resource.h
  • IDD_CUSIMPLETAPICHKBOX : Resource.h
  • IDD_CUSTOMDIALDLG : resource.h
  • IDD_CUSTOMDRAWBUTTONDLG_DIALOG : Resource.h
  • IDD_CUSTOMENTRYDLG : resource.h
  • IDD_CUTEXTADDRESS : Resource.h
  • IDD_CUTEXTLINE : Resource.h
  • IDD_DATA_TYPES : resource.h
  • IDD_DATAINIT_GETDATASOURCE : resource.h
  • IDD_DATASOURCEADMIN_CREATEDATASOURCE : resource.h
  • IDD_DBUTTON0 : Resource.h
  • IDD_DBUTTON1 : Resource.h
  • IDD_DBUTTON2 : Resource.h
  • IDD_DBUTTON3 : Resource.h
  • IDD_DBUTTON4 : Resource.h
  • IDD_DBUTTON5 : Resource.h
  • IDD_DBUTTON6 : Resource.h
  • IDD_DBUTTON7 : Resource.h
  • IDD_DBUTTON8 : Resource.h
  • IDD_DBUTTON9 : Resource.h
  • IDD_DBUTTONPOUND : Resource.h
  • IDD_DBUTTONSTAR : Resource.h
  • IDD_DCOMBO : Resource.h
  • IDD_DDIAL : Resource.h
  • IDD_DELETE_QUEUE_DIALOG : Resource.h
  • IDD_DELETEOBJECT : resource.h
  • IDD_DEVICEX : WxForm.h
  • IDD_DEVICEY : WxForm.h
  • IDD_DEVPROP_DIALOG : resource.h
  • IDD_DGNAMETEXT : Resource.h
  • IDD_DGNUMBER : Resource.h
  • IDD_DGNUMBERTEXT : Resource.h
  • IDD_DIALER : Resource.h
  • IDD_DIALING : Resource.h
  • IDD_DIALOG : Resource.h , resource.h , Resource.h , resource.h
  • IDD_DIALOG1 : resource.h , Resource.h , resource.h , Resource.h
  • IDD_DIALOG2 : resource.h , Resource.h
  • IDD_DIALOG3 : Resource.h
  • IDD_DIALOG4 : Resource.h
  • IDD_DIALOG7 : Resource.h
  • IDD_DIALOG_ADDRESS : resource.h
  • IDD_DIALOG_ADDRESS_NAME : resource.h
  • IDD_DIALOG_AUTH : resource.h
  • IDD_DIALOG_LOGON : resource.h
  • IDD_DIALOG_MAIN : Resource.h
  • IDD_DIALOG_SESSION : resource.h
  • IDD_DIALOG_WATCHER : resource.h
  • IDD_DIFFER : wdiffrc.h
  • IDD_DIR1 : wdiffrc.h
  • IDD_DIR2 : wdiffrc.h
  • IDD_DISDRAW_DIALOG : Resource.h , resource.h
  • IDD_DNUMTODIAL : Resource.h
  • IDD_DRECTSEPARATOR : Resource.h
  • IDD_DROPCOLUMN : resource.h
  • IDD_DROPCONSTRAINT : resource.h
  • IDD_DROPINDEX : resource.h
  • IDD_DROPTABLE : resource.h
  • IDD_DS : resource.h
  • IDD_DSL_ADVANCED : resource.h
  • IDD_DSL_CONNECTION : resource.h
  • IDD_DSPEEDDIAL1 : Resource.h
  • IDD_DSPEEDDIAL2 : Resource.h
  • IDD_DSPEEDDIAL3 : Resource.h
  • IDD_DSPEEDDIAL4 : Resource.h
  • IDD_DSPEEDDIAL5 : Resource.h
  • IDD_DSPEEDDIAL6 : Resource.h
  • IDD_DSPEEDDIAL7 : Resource.h
  • IDD_DSPEEDDIAL8 : Resource.h
  • IDD_DSPEEDDIALGRP : Resource.h
  • IDD_DSPEEDDIALTEXT1 : Resource.h
  • IDD_DSPEEDDIALTEXT2 : Resource.h
  • IDD_DSPEEDDIALTEXT3 : Resource.h
  • IDD_DSPEEDDIALTEXT4 : Resource.h
  • IDD_DSPEEDDIALTEXT5 : Resource.h
  • IDD_DSPEEDDIALTEXT6 : Resource.h
  • IDD_DSPEEDDIALTEXT7 : Resource.h
  • IDD_DSPEEDDIALTEXT8 : Resource.h
  • IDD_DST : resource.h
  • IDD_EDITREAD : Client32.h
  • IDD_EDITWRITE : Client32.h
  • IDD_EDX : WxForm.h
  • IDD_EDY : WxForm.h
  • IDD_EJECT : Resource.h
  • IDD_EM11 : WxForm.h
  • IDD_EM12 : WxForm.h
  • IDD_EM21 : WxForm.h
  • IDD_EM22 : WxForm.h
  • IDD_ERRORRECORDS : resource.h
  • IDD_EVENTSINK_DIALOG : Resource.h
  • IDD_EXECUTE : resource.h
  • IDD_EXPORT_APPLICATION : Resource.h
  • IDD_EXTRACTDLG : Resource.h
  • IDD_FASTSCAN : wdiffrc.h
  • IDD_FAX : Resource.h
  • IDD_FILE : wdiffrc.h
  • IDD_FILEOPEN : OleStd.h
  • IDD_FILETYPE : WinCap.h
  • IDD_FILETYPEGROUP : WinCap.h
  • IDD_FIND : wdiffrc.h
  • IDD_FINDNEXTROW : resource.h
  • IDD_FROM_INFO : resource.h
  • IDD_FROMGROUP : wdiffrc.h
  • IDD_FROMLEFT : wdiffrc.h
  • IDD_FROMRIGHT : wdiffrc.h
  • IDD_FULLCONNECT_OPTIONS : resource.h
  • IDD_FULLCONNECT_PROPERTIES : resource.h
  • IDD_FULLCONNECT_PROVIDER : resource.h
  • IDD_FULLCONNECT_SECURITY : resource.h
  • IDD_GAKPAGE : Resource.h
  • IDD_GENERICUCP_DIALOG : resource.h
  • IDD_GETAXISINFO : resource.h
  • IDD_GETAXISROWSET : resource.h
  • IDD_GETCOLUMNSROWSET : resource.h
  • IDD_GETINFOEX : resource.h
  • IDD_GETLISTVIEW : resource.h
  • IDD_GETNEXTROWS : resource.h
  • IDD_GETREFERENCEDROWSET : resource.h
  • IDD_GETSOURCESROWSET : resource.h
  • IDD_GOTOLINE : wdiffrc.h
  • IDD_GUTILS_FILE : gutilsrc.h
  • IDD_GUTILS_LABEL : gutilsrc.h
  • IDD_IADS : resource.h
  • IDD_IADSCONTAINER : resource.h
  • IDD_IADSOPENDSOBJECT : resource.h
  • IDD_ICON : wdiffrc.h
  • IDD_IDENTICAL : wdiffrc.h
  • IDD_IDENTITY : WxForm.h
  • IDD_IDIRECTORYOBJECT : resource.h
  • IDD_IDIRECTORYSEARCH : resource.h
  • IDD_IGNOREMARK : wdiffrc.h
  • IDD_IMP_DRAW_DIALOG : Resource.h
  • IDD_IMPORT_COMPONENT : Resource.h
  • IDD_INDEX_INFO : resource.h
  • IDD_INSTALL_APPLICATION : Resource.h
  • IDD_INSTALL_COMPONENT : Resource.h
  • IDD_INTERFACE : resource.h
  • IDD_INUSE : Resource.h
  • IDD_ISCO_COPY : resource.h
  • IDD_ISCO_DELETE : resource.h
  • IDD_ITEMCONFIGDIALOG : Resource.h
  • IDD_ITEMDATADLG : Resource.h
  • IDD_IUICON : Resource.h
  • IDD_IUTEXT1 : Resource.h
  • IDD_IUTEXT2 : Resource.h
  • IDD_LAB1 : wdiffrc.h
  • IDD_LAB2 : wdiffrc.h
  • IDD_LAB3 : wdiffrc.h
  • IDD_LABEL : wdiffrc.h
  • IDD_LARGEINTEGER : resource.h
  • IDD_LAUNCH : Resource.h
  • IDD_LEFT : wdiffrc.h
  • IDD_LOAD_REMOTE : DComDraw.h
  • IDD_LOADING_MSG : ReadTut.h
  • IDD_LOCATE_DIALOG : Resource.h
  • IDD_LOGFILE : wdiffrc.h
  • IDD_LOGIN : Resource.h , resource.h
  • IDD_LOGON : Resource.h
  • IDD_LOGONOFF : Resource.h
  • IDD_LOGTEXT : wdiffrc.h
  • IDD_MAIN : Resource.h
  • IDD_MAIN_DIALOG : Resource.h
  • IDD_MAINDLG : Resource.h
  • IDD_MAINUI : Resource.h
  • IDD_MDICHILD : resource.h
  • IDD_MMCCONTROL : resource.h
  • IDD_MOVE : resource.h
  • IDD_MSPERSIST : resource.h
  • IDD_MULTIPLERESULTS : resource.h
  • IDD_NEWDIALOG : Resource.h
  • IDD_OFFICEEQUIP : resource.h
  • IDD_OPEN_QUEUE_DIALOG : Resource.h
  • IDD_OPENROWSET : resource.h
  • IDD_OPTIONS : resource.h , Resource.h
  • IDD_OPTIONS_ACCESSOR : resource.h
  • IDD_OPTIONS_COMMAND : resource.h
  • IDD_OPTIONS_ERRORS : resource.h
  • IDD_OPTIONS_NOTIFICATIONS : resource.h
  • IDD_OPTIONS_ROWSET : resource.h
  • IDD_PAGE_PROPS : RESDEF.h
  • IDD_PARAMEXECUTE : resource.h
  • IDD_PASSWORD : wdiffrc.h
  • IDD_PERMEVENTS_DIALOG : Resource.h
  • IDD_PLUGTRANSPORT : resource.h
  • IDD_PM : WinCap.h
  • IDD_PP_CLIPBOOKSERVER_PARAMETERS : resource.h
  • IDD_PP_FILESHARESAMPLE_PARAMETERS : resource.h
  • IDD_PPAGE0 : resource.h
  • IDD_PROCESS : Resource.h
  • IDD_PROGRESS : resource.h , Resource.h
  • IDD_PROMPTDATASOURCE : resource.h
  • IDD_PROMPTFILENAME : resource.h
  • IDD_PROP : resource.h
  • IDD_PROPERTYLIST : resource.h
  • IDD_PROPPAGE_LARGE : resource.h
  • IDD_PROPPAGE_PEOPLE : resource.h
  • IDD_PROVIDERINFO : resource.h
  • IDD_QUERY_SESSION : Resource.h
  • IDD_RECEIVE_MESSAGE_DIALOG : Resource.h
  • IDD_RECURSIVE : wdiffrc.h
  • IDD_REMOTE_INFO : RemClien.h
  • IDD_RENAME : resource.h
  • IDD_REORDER : Resource.h
  • IDD_RGB : WinCap.h
  • IDD_RIGHT : wdiffrc.h
  • IDD_RLE4 : WinCap.h
  • IDD_RLE8 : WinCap.h
  • IDD_ROW_OPEN : resource.h
  • IDD_ROWCHANGE : resource.h
  • IDD_RTCINCOMING_DIALOG : Resource.h
  • IDD_RTCOUTGOING_DIALOG : Resource.h
  • IDD_SAMPLE_DIALOG : resource.h
  • IDD_SCHEMAROWSET : resource.h
  • IDD_SCHEMATREEVIEW : resource.h
  • IDD_SCP_BINDING_INFO_PAGE : resource.h
  • IDD_SCP_GENERAL_PAGE : resource.h
  • IDD_SCP_KEYWORDS_PAGE : resource.h
  • IDD_SCP_MENU_DIALOG : resource.h
  • IDD_SCP_PAGE_BINDING_INFO : resource.h
  • IDD_SCP_PAGE_GENERAL : resource.h
  • IDD_SCP_PAGE_KEYWORDS : resource.h
  • IDD_SCREENX : WxForm.h
  • IDD_SCREENY : WxForm.h
  • IDD_SD1 : Resource.h
  • IDD_SD1EDITNAME : Resource.h
  • IDD_SD1EDITNUMBER : Resource.h
  • IDD_SD1RECTSEPARATOR : Resource.h
  • IDD_SD1SPEEDDIAL1 : Resource.h
  • IDD_SD1SPEEDDIAL2 : Resource.h
  • IDD_SD1SPEEDDIAL3 : Resource.h
  • IDD_SD1SPEEDDIAL4 : Resource.h
  • IDD_SD1SPEEDDIAL5 : Resource.h
  • IDD_SD1SPEEDDIAL6 : Resource.h
  • IDD_SD1SPEEDDIAL7 : Resource.h
  • IDD_SD1SPEEDDIAL8 : Resource.h
  • IDD_SD1SPEEDDIALTEXT1 : Resource.h
  • IDD_SD1SPEEDDIALTEXT2 : Resource.h
  • IDD_SD1SPEEDDIALTEXT3 : Resource.h
  • IDD_SD1SPEEDDIALTEXT4 : Resource.h
  • IDD_SD1SPEEDDIALTEXT5 : Resource.h
  • IDD_SD1SPEEDDIALTEXT6 : Resource.h
  • IDD_SD1SPEEDDIALTEXT7 : Resource.h
  • IDD_SD1SPEEDDIALTEXT8 : Resource.h
  • IDD_SD1TEXTCHOOSE : Resource.h
  • IDD_SD1TEXTENTER : Resource.h
  • IDD_SD1TEXTNAME : Resource.h
  • IDD_SD1TEXTNUMBER : Resource.h
  • IDD_SD2 : Resource.h
  • IDD_SD2EDITNAME : Resource.h
  • IDD_SD2EDITNUMBER : Resource.h
  • IDD_SD2SAVEANDDIAL : Resource.h
  • IDD_SD2TEXTENTER : Resource.h
  • IDD_SD2TEXTNAME : Resource.h
  • IDD_SD2TEXTNUMBER : Resource.h
  • IDD_SECCLNT : secClnt.h
  • IDD_SECSVR : secSvr.h
  • IDD_SECURITY : resource.h
  • IDD_SELECT : Resource.h
  • IDD_SELECTPRINTER : resource.h
  • IDD_SEND_MESSAGE : Resource.h
  • IDD_SEND_MESSAGE_DIALOG : Resource.h
  • IDD_SENDFILE : Resource.h
  • IDD_SERVER : wdiffrc.h
  • IDD_SERVER_PROCESS : Resource.h
  • IDD_SERVERDLG : Resource.h
  • IDD_SESSION : Resource.h
  • IDD_SETCOMMANDSTREAM : resource.h
  • IDD_SETCOMMANDTEXT : resource.h
  • IDD_SETDISP : Resource.h
  • IDD_SETPARAMETERINFO : resource.h
  • IDD_SETPROPERTIES : resource.h
  • IDD_SETSESSION : Resource.h
  • IDD_SETVALUE : resource.h
  • IDD_SETXFORM : WxForm.h
  • IDD_SHARE : Resource.h
  • IDD_SHOW_TYPES : resource.h
  • IDD_SHOWLOCAL : Resource.h
  • IDD_SHUTDOWN : Resource.h
  • IDD_SIMPLE_LISTBOX : resource.h
  • IDD_SRC : resource.h
  • IDD_STREAM_VIEWER : resource.h
  • IDD_SUCCESS_MSG : register.h
  • IDD_SUMS : wdiffrc.h
  • IDD_SVREDIT : Client32.h
  • IDD_SWITCH : Resource.h
  • IDD_TESTDLG : Resource.h
  • IDD_TO_INFO : resource.h
  • IDD_TRANSACTION_ABORT : resource.h
  • IDD_TRANSACTION_COMMIT : resource.h
  • IDD_TRANSACTION_GETINFO : resource.h
  • IDD_TRANSACTION_JOIN : resource.h
  • IDD_TRANSACTION_RELEASE : resource.h
  • IDD_TRANSACTION_SETOPTIONS : resource.h
  • IDD_TRANSACTION_START : resource.h
  • IDD_UPLOADSAMPLECLIENTDIALOG : resource.h
  • IDD_URLMAPPING : resource.h
  • IDD_USAGE : wdiffrc.h
  • IDD_USER_PAGE_EXT : resource.h
  • IDD_USERINFO : resource.h
  • IDD_UTILITIES : Resource.h
  • IDD_VCEXPLORE : Resource.h
  • IDD_VCEXPLORE_DIALOG : Resource.h
  • IDD_VERFIRST : GLOBALS.h , Globals.h
  • IDD_VERIFYRES : Resource.h
  • IDD_VERLAST : GLOBALS.h , Globals.h
  • IDD_VERSION : wdiffrc.h
  • IDD_VFILE_PPAGE0 : resource.h
  • IDD_WAIT_DIALOG : Resource.h
  • IDD_WAIT_SYSTEM_EVENT : Resource.h
  • IDD_WBEMCLIENT_DIALOG : Resource.h
  • IDD_WBEMPERMEVENTS_DIALOG : Resource.h
  • IDD_WBEMSAMP_DIALOG : resource.h
  • IDD_WBEMSAMPLE_DIALOG : resource.h
  • IDD_WIZ_CLIPBOOKSERVER_PARAMETERS : resource.h
  • IDD_WIZ_FILESHARESAMPLE_PARAMETERS : resource.h
  • IDD_WLXDIAPLAYSASNOTICE_DIALOG : GinaDlg.c
  • IDD_WLXLOGGEDONSAS_DIALOG : GinaDlg.c
  • IDD_WLXLOGGEDOUTSAS_DIALOG : GinaDlg.c
  • IDD_WLXWKSTALOCKEDSAS_DIALOG : GinaDlg.c
  • IDD_WORLDX : WxForm.h
  • IDD_WORLDY : WxForm.h
  • IDD_XMLTREE_DIALOG : resource.h
  • IDE_ACL : Monkey.h
  • IDE_ADDR : Resource.h
  • IDE_APPLICATION : Resource.h
  • IDE_BLOB_SIZE : resource.h
  • IDE_BREAKID : resource.h
  • IDE_CLASS : Monkey.h
  • IDE_COLNAME : resource.h
  • IDE_COLUMN : resource.h
  • IDE_COLUMNID : resource.h
  • IDE_COMMANDID : resource.h
  • IDE_COMMANDLINE : Resource.h
  • IDE_COMMANDTEXT : resource.h
  • IDE_CONFERENCE : Resource.h
  • IDE_CONFERENCE_NAME : Resource.h
  • IDE_CONSNAME : resource.h
  • IDE_CONSTEXT : resource.h
  • IDE_CONSTRAINTID : resource.h
  • IDE_COUNT : resource.h
  • IDE_CVALUES : Monkey.h
  • IDE_DATA : resource.h , Resource.h
  • IDE_DATASOURCE : resource.h
  • IDE_DESCRIPTION : resource.h
  • IDE_DEST : Resource.h
  • IDE_DIRECTORY : resource.h , Resource.h
  • IDE_FILENAME : resource.h , Resource.h
  • IDE_FKCOLNAME : resource.h
  • IDE_FROM_TABLE : resource.h
  • IDE_HCONF : Resource.h
  • IDE_INDEXID : resource.h
  • IDE_INITSTRING : resource.h
  • IDE_INTEGRATED : resource.h
  • IDE_ISCO_DESTINATION : resource.h
  • IDE_ISCO_SOURCE : resource.h
  • IDE_LASTWRT : Monkey.h
  • IDE_LEVEL : Resource.h
  • IDE_LOCATION : resource.h
  • IDE_MAXLENGTH : resource.h
  • IDE_NAME : Resource.h , Monkey.h
  • IDE_NewIndexID : resource.h
  • IDE_NewTableID : resource.h
  • IDE_OFFSET : resource.h
  • IDE_ORDINAL : resource.h
  • IDE_PARAM_SETS : resource.h
  • IDE_PASSWORD : resource.h , Resource.h
  • IDE_PATH : Resource.h
  • IDE_PRECISION : resource.h
  • IDE_PROPEDIT_NAME : resource.h
  • IDE_PROPERTY_HELP : resource.h
  • IDE_PROPINFO_FLAGS : resource.h
  • IDE_PROPINFO_VALUE : resource.h
  • IDE_PROVSTRING : resource.h
  • IDE_REFERENCEDTABLE : resource.h
  • IDE_REMOTESERVER : resource.h
  • IDE_RESTRICTION1 : resource.h
  • IDE_RESTRICTION2 : resource.h
  • IDE_RESTRICTION3 : resource.h
  • IDE_RESTRICTION4 : resource.h
  • IDE_RESTRICTION5 : resource.h
  • IDE_RESTRICTION6 : resource.h
  • IDE_RESTRICTION7 : resource.h
  • IDE_ROW_COUNT : resource.h
  • IDE_ROWSTOFETCH : resource.h
  • IDE_SCALE : resource.h
  • IDE_SELECTED : Resource.h
  • IDE_SEND : Resource.h
  • IDE_SIZE : resource.h
  • IDE_TABLEID : resource.h
  • IDE_TEXTOUT : Monkey.h
  • IDE_TIMEOUT : resource.h
  • IDE_TITLEINDEX : Monkey.h
  • IDE_TO_TABLE : resource.h
  • IDE_URL : resource.h
  • IDE_USER_NAME : Resource.h
  • IDE_USERID : resource.h , Resource.h
  • IDE_VALUE : resource.h
  • IDE_VALUE1 : Monkey.h
  • IDE_VALUE2 : Monkey.h
  • IDE_VALUE3 : Monkey.h
  • IDFILE_POS : Menu.h
  • IDH_DIALER_BUTTONS : Dialhelp.h
  • IDH_DIALER_CHANGE_DIAL_HELPER : Dialhelp.h
  • IDH_DIALER_CHANGE_DIGITS : Dialhelp.h
  • IDH_DIALER_CHANGE_OPTIONS : Dialhelp.h
  • IDH_DIALER_CHANGE_REDIAL_BUTTON : Dialhelp.h
  • IDH_DIALER_DIAL_BUTTON : Dialhelp.h
  • IDH_DIALER_DIAL_KEYPAD : Dialhelp.h
  • IDH_DIALER_DIAL_NUMBER : Dialhelp.h
  • IDH_DIALER_DIAL_SPEED_CHOOSE : Dialhelp.h
  • IDH_DIALER_DIALING_LOGNAME : Dialhelp.h
  • IDH_DIALER_DIALING_STATUS : Dialhelp.h
  • IDH_DIALER_HANGUP : Dialhelp.h
  • IDH_DIALER_LOG : Dialhelp.h
  • IDH_DIALER_LOG_IN : Dialhelp.h
  • IDH_DIALER_LOG_OUT : Dialhelp.h
  • IDH_DIALER_OPTIONS_ADDRESS : Dialhelp.h
  • IDH_DIALER_OPTIONS_LINE : Dialhelp.h
  • IDH_DIALER_OPTIONS_NONVOICE : Dialhelp.h
  • IDH_DIALER_OPTIONS_PROPERTIES : Dialhelp.h
  • IDH_DIALER_OPTIONS_VOICE : Dialhelp.h
  • IDH_DIALER_PAUSE_CONTINUE : Dialhelp.h
  • IDH_DIALER_SPEED_CHOOSE : Dialhelp.h
  • IDH_DIALER_SPEED_NAME : Dialhelp.h
  • IDH_DIALER_SPEED_NUMBER : Dialhelp.h
  • IDH_DIALER_SPEED_SAVE : Dialhelp.h
  • IDH_DIALER_SPEED_SAVE_DIAL : Dialhelp.h
  • IDHELP_POS : Menu.h
  • IDI_ABOUTICON : resource.h
  • IDI_APP : resource.h , Resource.h
  • IDI_APP32 : Resource.h
  • IDI_APP_ICON : Resource.h , resource.h
  • IDI_APPICON : Resource.h
  • IDI_BACKCOLOR : Resource.h
  • IDI_CATALOG : resource.h
  • IDI_CHECK : resource.h
  • IDI_COLUMN : resource.h
  • IDI_COLUMNLONG : resource.h
  • IDI_COLUMNREAD : resource.h
  • IDI_CONNECT : Resource.h
  • IDI_DIALER : Resource.h
  • IDI_DISK : Resource.h
  • IDI_DXS3 : resource.h
  • IDI_DXTICON : resource.h
  • IDI_EVENTSINK : Resource.h
  • IDI_EXPORT : Resource.h
  • IDI_FOLDER : resource.h
  • IDI_ICON : resource.h , Resource.h
  • IDI_ICON1 : resource.h , Resource.h , resource.h , Resource.h
  • IDI_ICON2 : Resource.h
  • IDI_ICON3 : Resource.h
  • IDI_ICON4 : Resource.h
  • IDI_ICON5 : Resource.h
  • IDI_ICON6 : Resource.h
  • IDI_IMPORT : Resource.h
  • IDI_INDEX : resource.h
  • IDI_INK_ICON : resource.h
  • IDI_INSTALL : Resource.h
  • IDI_INSTALLER : resource.h
  • IDI_INSTCODC : Resource.h
  • IDI_LARGE : Resource.h
  • IDI_LINEBUSY : Resource.h
  • IDI_LOGO : Resource.h
  • IDI_MAIN : Resource.h
  • IDI_MAIN_ICON : resource.h
  • IDI_MAINICON : Resource.h , resource.h , Resource.h
  • IDI_MSDEV : Resource.h
  • IDI_OPENFOLDER : resource.h
  • IDI_OVERLAY_ICON : Resource.h
  • IDI_PBGN_GIF : resource.h
  • IDI_PRIMARYKEY : resource.h
  • IDI_PSI_LANDBASED : resource.h
  • IDI_PSI_ROCKET : resource.h
  • IDI_SAMPLEHANDLERICON : Resource.h
  • IDI_SAMPLEHANDLERITEMICON : Resource.h
  • IDI_SCHEMA : resource.h
  • IDI_SELTABLE : resource.h
  • IDI_SETDISP : Resource.h
  • IDI_SMALL : Resource.h
  • IDI_START : Resource.h
  • IDI_STATE11 : Resource.h
  • IDI_STATE12 : Resource.h
  • IDI_STATE21 : Resource.h
  • IDI_STATE22 : Resource.h
  • IDI_STATE31 : Resource.h
  • IDI_STATE32 : Resource.h
  • IDI_STOP : Resource.h
  • IDI_SYNONYM : resource.h
  • IDI_SYSTABLE : resource.h
  • IDI_TABLE : resource.h
  • IDI_TABLE_COPY : resource.h
  • IDI_TABLES : resource.h
  • IDI_TABLESYN : resource.h
  • IDI_TABLESYS : resource.h
  • IDI_TABLEVIEW : resource.h
  • IDI_TYPE : resource.h
  • IDI_UTILITIES : Resource.h
  • IDI_VIEW : resource.h
  • IDIGNORE : winres.h
  • IDL_ADDR_TYPE : Resource.h
  • IDL_APP : Resource.h
  • IDL_AXISINFO : resource.h
  • IDL_BINDFLAGS : resource.h
  • IDL_CALL_TYPE : Resource.h
  • IDL_CDFLAGS : resource.h
  • IDL_COLUMNDESC : resource.h
  • IDL_COLUMNS : resource.h
  • IDL_CONFERENCE : Resource.h
  • IDL_CONVFLAGS : resource.h
  • IDL_FLAGS : resource.h
  • IDL_FROM_TYPES : resource.h
  • IDL_GUID : Resource.h
  • IDL_INDEXCOLUMNDESC : resource.h
  • IDL_INDEXES : resource.h
  • IDL_LISTBOX : Monkey.h
  • IDL_LISTBOX2 : Monkey.h
  • IDL_LISTVIEW : resource.h
  • IDL_MODE : resource.h
  • IDL_NAMES : wdiffrc.h , resource.h
  • IDL_OPTIONS : resource.h
  • IDL_PARAMNAMES : resource.h
  • IDL_PARAMVALUES : resource.h
  • IDL_PROPERTY : resource.h
  • IDL_PROVIDERFILTER : resource.h
  • IDL_STATLAB : wdiffrc.h
  • IDL_TABLES : resource.h
  • IDL_TO_TYPES : resource.h
  • IDL_TYPEFILTER : resource.h
  • IDL_URLs : resource.h
  • IDL_USERS : Resource.h
  • IDL_VALUES : resource.h
  • IDM_ABORT : wdiffrc.h
  • IDM_ABOUT : Demo.h , Generic.H , wdiffrc.h , Resource.h , DfV.h , SimpCntr.h , SimpDnd.h , SimpSvr.h , resource.h , MidiPlyr.h , FontView.h , APP.h , Resource.h , resource.h , Resource.h , WinCap.h , resource.h , PlgBlt.h , Resource.h , GLOBALS.h , Globals.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , StatList.h , LeakyBin.h , ClipText.h , CDTest.h , Resource.h , SpinTest.h , Cursor.h , Resource.h , MousInfo.h , Menu.h , DynDlg.h , Resource.h , resource.h
  • IDM_ABOUTBOX : Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h
  • IDM_ACCEL_HELP : Resource.h
  • IDM_ACCEL_NUMTODIAL : Resource.h
  • IDM_ACCESSOR_ADDREF : resource.h
  • IDM_ACCOUNT_ALL : resource.h
  • IDM_ACTIVEWINDOW : WinCap.h
  • IDM_ADD : resource.h
  • IDM_ADD_COUNTERS : StatList.h
  • IDM_ADDREFROWS : resource.h
  • IDM_ALG2 : wdiffrc.h
  • IDM_ALLGRAPHICS : Resource.h
  • IDM_ALLPAGES : APP.h
  • IDM_ALPHA : resource.h
  • IDM_ANISOTROPIC : Resource.h
  • IDM_APP : Resource.h , resource.h , Resource.h
  • IDM_ARC : Resource.h
  • IDM_ARRANGEICONS : resource.h
  • IDM_AUTOPLAY : MidiPlyr.h
  • IDM_AUTOPOSITION : resource.h
  • IDM_BINDER_ADDREF : resource.h
  • IDM_BINDERMENU : resource.h
  • IDM_BINDING_VARIANT : resource.h
  • IDM_BLACK : Menu.h
  • IDM_BLOCK : Demo.h
  • IDM_BLUE : Resource.h , Menu.h
  • IDM_BOTH : PlgBlt.h
  • IDM_BOTHFILES : wdiffrc.h
  • IDM_BOTTOM : Resource.h
  • IDM_BOX : Demo.h
  • IDM_BRIGHTNESS : resource.h
  • IDM_BROWSE_ENUM : resource.h
  • IDM_BROWSE_FILE : resource.h
  • IDM_BROWSE_OPTION : resource.h
  • IDM_BROWSE_TABLENAME : resource.h
  • IDM_BRUSHSTYLE_BDIAGONAL : Resource.h
  • IDM_BRUSHSTYLE_CROSS : Resource.h
  • IDM_BRUSHSTYLE_DIAGCROSS : Resource.h
  • IDM_BRUSHSTYLE_FDIAGONAL : Resource.h
  • IDM_BRUSHSTYLE_HORIZONTAL : Resource.h
  • IDM_BRUSHSTYLE_VERTICAL : Resource.h
  • IDM_BUTTON1 : globals.h , Globals.h , globals.h
  • IDM_BUTTON2 : globals.h , Globals.h , globals.h
  • IDM_CALL : Resource.h
  • IDM_CALL_ACCEPT : Resource.h
  • IDM_CALL_CANCEL : Resource.h
  • IDM_CALL_CONF : Resource.h
  • IDM_CALL_REJECT : Resource.h
  • IDM_CANCEL : Resource.h
  • IDM_CAPTCLIENT : WinCap.h
  • IDM_CAPTRECT : WinCap.h
  • IDM_CAPTUREHIDE : WinCap.h
  • IDM_CAPTWINDOW : WinCap.h
  • IDM_CAR_CLUTCH : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_CREATE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_RELEASE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_SHIFT : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_SPEED : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CAR_STEER : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CASCADE : resource.h
  • IDM_CCAR_ADJUST : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_CLUTCH : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_CREATE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_ENGAGE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_RELEASE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_SHIFT : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_SPEED : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CCAR_STEER : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_CD15BPP : Resource.h
  • IDM_CD16BPP : Resource.h
  • IDM_CD1BPP : Resource.h
  • IDM_CD24BPP : Resource.h
  • IDM_CD32BPP : Resource.h
  • IDM_CD4BPP : Resource.h
  • IDM_CD8BPP : Resource.h
  • IDM_CHANGESTATUS : resource.h
  • IDM_CHANGEVALUE : resource.h
  • IDM_CHANNEL_AUDIO : Resource.h
  • IDM_CHANNEL_DATA : Resource.h
  • IDM_CHANNEL_FT : Resource.h
  • IDM_CHANNEL_SHARE : Resource.h
  • IDM_CHAPTERED_ADDREFCHAPTER : resource.h
  • IDM_CHAPTERED_RELEASECHAPTER : resource.h
  • IDM_CHARCODE : Resource.h
  • IDM_CHARSET : FontView.h
  • IDM_CHOOSEFONT : Resource.h
  • IDM_CLEAR : ClipText.h
  • IDM_CLEAR_ALL : StatList.h
  • IDM_CLEAR_ATTRIBS : globals.h
  • IDM_CLEAREDITWINDOW : resource.h
  • IDM_CLEARNOTIFYWINDOW : resource.h
  • IDM_CLOSE : wdiffrc.h , DfV.h , FontView.h , resource.h
  • IDM_CLOSEALL : resource.h
  • IDM_CLOSECAND : Resource.h
  • IDM_CLOSEWINDOW : resource.h
  • IDM_CMD_CANCELTRANSFER : Resource.h
  • IDM_CMD_CONNECT : Resource.h
  • IDM_CMD_DISCONNECT : Resource.h
  • IDM_CMD_ENUMCONF : Resource.h
  • IDM_CMD_ENUMUSER : Resource.h
  • IDM_CMD_GETINFO : Resource.h
  • IDM_CMD_ISWINDOWSHARED : Resource.h
  • IDM_CMD_LAUNCHREMOTE : Resource.h
  • IDM_CMD_LISTEN : Resource.h
  • IDM_CMD_REMOVENOTIFY : Resource.h
  • IDM_CMD_SENDDATA : Resource.h
  • IDM_CMD_SENDFILE : Resource.h
  • IDM_CMD_SETGUID : Resource.h
  • IDM_CMD_SETINFO : Resource.h
  • IDM_CMD_SETNOTIFY : Resource.h
  • IDM_CMD_SETRECDIR : Resource.h
  • IDM_CMD_SHAREWINDOW : Resource.h
  • IDM_CMD_UNSHAREWINDOW : Resource.h
  • IDM_COLLABORATE : Resource.h
  • IDM_COLLAPSE : DfV.h
  • IDM_COLLAPSEALL : DfV.h
  • IDM_COLOR : CDTest.h
  • IDM_COLOROWNERDR : Menu.h
  • IDM_COMMAND : DeskBand.h
  • IDM_COMMAND_ADDREF : resource.h
  • IDM_COMMAND_CANCEL : resource.h
  • IDM_COMMAND_CLEARCOMMAND : resource.h
  • IDM_COMMAND_GETDBSESSION : resource.h
  • IDM_COMMAND_GETPROPERTIES : resource.h
  • IDM_COMMAND_SETPROPERTIES : resource.h
  • IDM_COMMANDMENU : resource.h
  • IDM_COMMANDPERSIST_DELETECOMMAND : resource.h
  • IDM_COMMANDPERSIST_GETCURRENTCOMMAND : resource.h
  • IDM_COMMANDPERSIST_LOADCOMMAND : resource.h
  • IDM_COMMANDPERSIST_SAVECOMMAND : resource.h
  • IDM_COMMANDPREPARE : resource.h
  • IDM_COMMANDTEXT_EXECUTE : resource.h
  • IDM_COMMANDUNPREPARE : resource.h
  • IDM_COMPLETE : Resource.h
  • IDM_CONF_LEAK : Resource.h
  • IDM_CONF_LEAK2 : Resource.h
  • IDM_CONF_START : Resource.h
  • IDM_CONF_STOP : Resource.h
  • IDM_CONFINFO : Resource.h
  • IDM_CONNECT : Globals.h
  • IDM_CONNECTIONPOINT_ADDREF : resource.h
  • IDM_CONNECTIONPOINTMENU : resource.h
  • IDM_CONNECTUSING : Resource.h
  • IDM_CONTENTS : wdiffrc.h
  • IDM_CONTEXT_MENU : Resource.h
  • IDM_CONVERT : Resource.h
  • IDM_COPY : Generic.H , Resource.h , resource.h , FontView.h , resource.h , Resource.h , PlgBlt.h , ClipText.h , Commands.h
  • IDM_COPYALL : resource.h
  • IDM_COPYEDITWINDOW : resource.h
  • IDM_COPYERRORS : resource.h
  • IDM_COPYFILES : wdiffrc.h
  • IDM_COPYNOTIFYWINDOW : resource.h
  • IDM_COPYTEXT : resource.h
  • IDM_CREATE_DATALINKS : resource.h
  • IDM_CREATE_ROOTBINDER : resource.h
  • IDM_CREATE_ROOTENUMERATOR : resource.h
  • IDM_CREATE_ROWPOSITION : resource.h
  • IDM_CREATE_SERVICECOMPONENTS : resource.h
  • IDM_CREATEFILEMONIKER : resource.h
  • IDM_CREATEFONT : FontView.h
  • IDM_CURSORSELECT : WinCap.h
  • IDM_CUSTOMERROR_ADDREF : resource.h
  • IDM_CUSTOMERRORMENU : resource.h
  • IDM_CUSTOMHELPMIN : Resource.h
  • IDM_CUT : Commands.h , Resource.h , Generic.H , Resource.h , FontView.h , resource.h , ClipText.h
  • IDM_CUTEDITWINDOW : resource.h
  • IDM_DATA_ENABLE : Resource.h
  • IDM_DATALINKS_ADDREF : resource.h
  • IDM_DATALINKSMENU : resource.h
  • IDM_DATASET_ADDREF : resource.h
  • IDM_DATASET_FREEAXISINFO : resource.h
  • IDM_DATASET_GETAXISINFO : resource.h
  • IDM_DATASET_GETAXISROWSET : resource.h
  • IDM_DATASET_GETCELLDATA : resource.h
  • IDM_DATASET_GETNEXTAXISROW : resource.h
  • IDM_DATASET_GETSPECIFICATION : resource.h
  • IDM_DATASETMENU : resource.h
  • IDM_DATASOURCE_ADDREF : resource.h
  • IDM_DATASOURCEMENU : resource.h
  • IDM_DBSTATUS_S_DEFAULT : resource.h
  • IDM_DBSTATUS_S_IGNORE : resource.h
  • IDM_DBSTATUS_S_ISNULL : resource.h
  • IDM_DBSTATUS_S_OK : resource.h
  • IDM_DECIMAL : APP.h
  • IDM_DECIMALMODE : CDTest.h
  • IDM_DELETE : FontView.h , Commands.h
  • IDM_DELETE_COUNTER : StatList.h
  • IDM_DELETEROWS : resource.h
  • IDM_DEMO_BOUNCE : GdiDemo.h
  • IDM_DEMO_DRAW : GdiDemo.h
  • IDM_DEMO_MAZE : GdiDemo.h
  • IDM_DEMO_POLYBEZIER : GdiDemo.h
  • IDM_DEMO_XFORM : GdiDemo.h
  • IDM_DESKTOP : WinCap.h
  • IDM_DEVICES : MidiPlyr.h
  • IDM_DEVMAX : MidiPlyr.h
  • IDM_DEVMIN : MidiPlyr.h
  • IDM_DHELP_ABOUT : RESDEF.h
  • IDM_DHELP_CONTENTS : RESDEF.h
  • IDM_DHELP_READSOURCE : RESDEF.h
  • IDM_DHELP_TUTORIAL : RESDEF.h
  • IDM_DHELP_TUTSERVER : RESDEF.h
  • IDM_DIALOG : FontView.h
  • IDM_DIALOG1 : DynDlg.h
  • IDM_DIALOG2 : DynDlg.h
  • IDM_DIBINFO : Resource.h
  • IDM_DIR : wdiffrc.h
  • IDM_DISCONNECT : Globals.h
  • IDM_DISPLAY_HEX : resource.h
  • IDM_DISPLAYALLERRORS : resource.h
  • IDM_DISPLAYERRORINFO : resource.h
  • IDM_DLGEDITDIALOG : SpinTest.h
  • IDM_DRAW_CLEAR : RESDEF.h
  • IDM_DRAW_ERASE : DComDraw.h , StoClien.h
  • IDM_DRAW_EXIT : RESDEF.h
  • IDM_DRAW_MASTER : DComDraw.h
  • IDM_DRAW_OFF : StoClien.h
  • IDM_DRAW_ON : StoClien.h
  • IDM_DRAW_REDRAW : DComDraw.h , StoClien.h
  • IDM_DRAW_SAVE : RESDEF.h
  • IDM_DRAW_SLAVE : DComDraw.h
  • IDM_DRAWAXIS : Resource.h
  • IDM_EDIT : FontView.h
  • IDM_EDIT_COPY : Deb.h , RESDEF.h , Resource.h
  • IDM_EDIT_CUT : RESDEF.h , Resource.h , Deb.h
  • IDM_EDIT_DELETE : RESDEF.h , Resource.h , Deb.h
  • IDM_EDIT_PASTE : RESDEF.h , Resource.h
  • IDM_EDIT_SELECTALL : RESDEF.h
  • IDM_EDIT_SPEEDDIAL : Resource.h
  • IDM_EDIT_UNDO : RESDEF.h
  • IDM_EDITCLEAR : GLOBALS.h
  • IDM_EDITCOMP : wdiffrc.h
  • IDM_EDITCOPY : GLOBALS.h , wdiffrc.h , WinCap.h
  • IDM_EDITCUT : GLOBALS.h
  • IDM_EDITLEFT : wdiffrc.h
  • IDM_EDITMENU : resource.h
  • IDM_EDITPASTE : GLOBALS.h
  • IDM_EDITRIGHT : wdiffrc.h
  • IDM_EDITUNDO : GLOBALS.h
  • IDM_EJECT : Resource.h , resource.h , Resource.h
  • IDM_ELLIPSE : Resource.h
  • IDM_ENABLE_APPSHARING : Resource.h
  • IDM_END : MciPlay.h
  • IDM_ENTERCONTEXTHELP : Resource.h
  • IDM_ENUMERATOR : resource.h
  • IDM_ENUMERATOR_ADDREF : resource.h
  • IDM_ENUMERATORMENU : resource.h
  • IDM_ENUMFONTS : FontView.h , Resource.h
  • IDM_ENUMPRINTERDRIVERS : Resource.h
  • IDM_ENUMPRINTERS : Resource.h
  • IDM_ERROR_ADDREF : resource.h
  • IDM_ERRORINFO_GETDESCRIPTION : resource.h
  • IDM_ERRORINFO_GETGUID : resource.h
  • IDM_ERRORINFO_GETHELPCONTEXT : resource.h
  • IDM_ERRORINFO_GETHELPFILE : resource.h
  • IDM_ERRORINFO_GETSOURCE : resource.h
  • IDM_ERRORMENU : resource.h
  • IDM_ERRORMESSAGE : resource.h
  • IDM_ERRORRECORDS : resource.h
  • IDM_ERRORRECORDS_ADDERRORRECORD : resource.h
  • IDM_ERRORRECORDS_GETBASICERRORINFO : resource.h
  • IDM_ERRORRECORDS_GETCUSTOMERROROBJECT : resource.h
  • IDM_ERRORRECORDS_GETERRORINFO : resource.h
  • IDM_ERRORRECORDS_GETERRORPARAMETERS : resource.h
  • IDM_ERRORRECORDS_GETRECORDCOUNT : resource.h
  • IDM_ESCAPECONTEXTHELP : Resource.h
  • IDM_EUDC : Resource.h
  • IDM_EXECUTE : resource.h
  • IDM_EXIT : resource.h , Menu.h , LeakyBin.h , resource.h , Resource.h , resource.h , MidiPlyr.h , Resource.h , Generic.H , wdiffrc.h , Resource.h , DfV.h , Resource.h , resource.h , FontView.h , APP.h , Resource.h , WinCap.h , resource.h , Resource.h , GLOBALS.h , Globals.h , resource.h , Resource.h , StatList.h , ClipText.h , CDTest.h , Resource.h , DynDlg.h , Resource.h , resource.h
  • IDM_EXPAND : wdiffrc.h , DfV.h
  • IDM_EXPAND_INCLEFT : wdiffrc.h
  • IDM_EXPAND_INCMOVEDLEFT : wdiffrc.h
  • IDM_EXPAND_INCMOVEDRIGHT : wdiffrc.h
  • IDM_EXPAND_INCRIGHT : wdiffrc.h
  • IDM_EXPAND_INCSAME : wdiffrc.h
  • IDM_EXPAND_INCSIMILARLEFT : wdiffrc.h
  • IDM_EXPAND_INCSIMILARRIGHT : wdiffrc.h
  • IDM_EXPANDALL : DfV.h
  • IDM_EXPANDBRANCH : DfV.h
  • IDM_EXPLORE : Commands.h
  • IDM_FCHANGE : wdiffrc.h
  • IDM_FCHANGE_LAURIE : wdiffrc.h
  • IDM_FILE : wdiffrc.h , FontView.h
  • IDM_FILE_ATTACH : Deb.h
  • IDM_FILE_COPYTABLE : resource.h
  • IDM_FILE_EXIT : AptServe.h , ComUser.h , ConClien.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h , Deb.h , resource.h , LocServe.h , AptClien.h
  • IDM_FILE_LOADLOCAL : DComDraw.h
  • IDM_FILE_LOADREMOTE : DComDraw.h
  • IDM_FILE_MACHINE : RemClien.h
  • IDM_FILE_NEW : RESDEF.h
  • IDM_FILE_OPEN : RESDEF.h , StoClien.h , Deb.h
  • IDM_FILE_SAVE : DComDraw.h , RESDEF.h , StoClien.h
  • IDM_FILE_SAVEAS : StoClien.h , RESDEF.h
  • IDM_FILECLOSE : Resource.h , GLOBALS.h
  • IDM_FILEEXIT : Resource.h
  • IDM_FILENEW : GLOBALS.h
  • IDM_FILEOPEN : Resource.h , GLOBALS.h , Resource.h
  • IDM_FILEOPENAS : Resource.h
  • IDM_FILEPAGESETUP : Resource.h
  • IDM_FILEPAGESU : GLOBALS.h
  • IDM_FILEPRINT : GLOBALS.h , Resource.h
  • IDM_FILEPRINTSU : GLOBALS.h
  • IDM_FILESAVE : GLOBALS.h
  • IDM_FILESAVEAS : GLOBALS.h
  • IDM_FIND : wdiffrc.h , FontView.h , CDTest.h
  • IDM_FINDNEXT : wdiffrc.h
  • IDM_FINDPREV : wdiffrc.h
  • IDM_FIRSTPAGE : APP.h
  • IDM_FLIPONCE : PlgBlt.h
  • IDM_FONT : APP.h , CDTest.h , Resource.h , Menu.h
  • IDM_FPCHANGE : wdiffrc.h
  • IDM_FPCHANGE_LAURIE : wdiffrc.h
  • IDM_FROM_BITMAP : Resource.h
  • IDM_FROM_WINDOW : Resource.h
  • IDM_FT_CANCEL : Resource.h
  • IDM_FULLCONNECT : resource.h
  • IDM_FULLDISCONNECT : resource.h
  • IDM_FULLHALF : Resource.h
  • IDM_GENERICMENU : Resource.h
  • IDM_GET_COMPOSING : resource.h
  • IDM_GET_DATA : StatList.h
  • IDM_GET_READING : resource.h
  • IDM_GET_TEXTOWNER : resource.h
  • IDM_GETCOMMANDSTREAM : resource.h
  • IDM_GETCOMMANDTEXT : resource.h
  • IDM_GETDATA : resource.h
  • IDM_GETDATASOURCE : resource.h
  • IDM_GETDEVICECAPS : Resource.h
  • IDM_GETDISPATTR : resource.h
  • IDM_GETERRORINFO : resource.h
  • IDM_GETLASTVISIBLEDATA : resource.h
  • IDM_GETNEXTROWS : resource.h
  • IDM_GETORIGINALDATA : resource.h
  • IDM_GETPARAMETERINFO : resource.h
  • IDM_GETPENDINGROWS : resource.h
  • IDM_GETPRESERVEDKEY : resource.h
  • IDM_GETPRINTERDRIVER : Resource.h
  • IDM_GETREFERENCEDROWSET : resource.h
  • IDM_GETROWFROMHROW : resource.h
  • IDM_GETROWSTATUS : resource.h
  • IDM_GETSCHEMAROWSET : resource.h
  • IDM_GETSCHEMAS : resource.h
  • IDM_GETSPECIFICATION : resource.h
  • IDM_GETURLFROMHROW : resource.h
  • IDM_GETVISIBLEDATA : resource.h
  • IDM_GLYPH : FontView.h
  • IDM_GO : resource.h
  • IDM_GOTOLINE : wdiffrc.h
  • IDM_GREEN : Resource.h , Menu.h , Resource.h
  • IDM_HANGUPCALL : GLOBALS.h
  • IDM_HANJA : Resource.h
  • IDM_HELP : DfV.h , resource.h , FontView.h , APP.h , Resource.h , DynDlg.h , resrc1.h
  • IDM_HELP_ABOUT : AptClien.h , AptServe.h , ComUser.h , DcdServe.h , DComDraw.h , DllClien.h , DllUser.h , ExeSkel.h , FreClien.h , LicClien.h , LocServe.h , RESDEF.h , RemClien.h , resource.h , GdiDemo.h , Deb.h , StoClien.h , LocClien.h , ConClien.h
  • IDM_HELP_ABOUTDLL : ComUser.h
  • IDM_HELP_ABOUTDLLSERVER : LicClien.h
  • IDM_HELP_ABOUTLICSERVER : LicClien.h
  • IDM_HELP_ABOUTSERVER : AptClien.h , ConClien.h , DllClien.h , FreClien.h , LocClien.h , StoClien.h
  • IDM_HELP_CONTENTS : AptClien.h , ComUser.h , ConClien.h , DllClien.h , DllUser.h , ExeSkel.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h , FontView.h , Resource.h , Deb.h , Resource.h , FreClien.h , DComDraw.h
  • IDM_HELP_DEMO : FontView.h
  • IDM_HELP_GLOSSARY : FontView.h
  • IDM_HELP_HELP : resource.h , FontView.h
  • IDM_HELP_HOWTOUSE : Deb.h
  • IDM_HELP_INDEX : FontView.h
  • IDM_HELP_OVERVIEW : FontView.h
  • IDM_HELP_PERDRAW : RESDEF.h
  • IDM_HELP_PERSERVE : RESDEF.h
  • IDM_HELP_PERTEXT : RESDEF.h
  • IDM_HELP_READSOURCE : AptClien.h , ComUser.h , ConClien.h , DllClien.h , DllUser.h , ExeSkel.h , LicClien.h , LocClien.h , RESDEF.h , StoClien.h , FreClien.h , RemClien.h , DComDraw.h
  • IDM_HELP_SEARCH : Deb.h
  • IDM_HELP_TUTDLL : ComUser.h , DllUser.h
  • IDM_HELP_TUTDLLSERVER : LicClien.h
  • IDM_HELP_TUTLICSERVER : LicClien.h
  • IDM_HELP_TUTMARSH : DComDraw.h
  • IDM_HELP_TUTMARSHAL : LocClien.h , RemClien.h , AptClien.h
  • IDM_HELP_TUTORIAL : AptClien.h , ConClien.h , DComDraw.h , DllClien.h , ExeSkel.h , FreClien.h , LicClien.h , LocClien.h , RESDEF.h , RemClien.h , StoClien.h , FontView.h , DllUser.h , ComUser.h
  • IDM_HELP_TUTREGISTER : DllClien.h
  • IDM_HELP_TUTSERVER : AptClien.h , ConClien.h , DllClien.h , FreClien.h , LocClien.h , StoClien.h , RemClien.h , DComDraw.h
  • IDM_HELPABOUT : Resource.h
  • IDM_HELPCONTENTS : Generic.H , resource.h , Resource.h
  • IDM_HELPHELP : Generic.H , resource.h
  • IDM_HELPSEARCH : Generic.H , resource.h
  • IDM_HELPTOPICS : Generic.H , LeakyBin.h , StatList.h
  • IDM_HEXMODE : CDTest.h
  • IDM_HIDEMARK : wdiffrc.h
  • IDM_HIENGLISH : Resource.h
  • IDM_HIMETRIC : Resource.h
  • IDM_HOME : MciPlay.h
  • IDM_HOVER : MousInfo.h
  • IDM_HUE : resource.h
  • IDM_IACCESSOR_ADDREFACCESSOR : resource.h
  • IDM_IACCESSOR_CREATEACCESSOR : resource.h
  • IDM_IACCESSOR_GETBINDINGS : resource.h
  • IDM_IACCESSOR_RELEASEACCESSOR : resource.h
  • IDM_IBINDRESOURCE_BIND : resource.h
  • IDM_ICOLUMNSINFO2_GETRESTRICTEDCOLUMNINFO : resource.h
  • IDM_ICOLUMNSINFO_GETCOLUMNINFO : resource.h
  • IDM_ICOLUMNSINFO_MAPCOLUMNIDS : resource.h
  • IDM_ICOLUMNSROWSET_GETAVAILABLECOLUMNS : resource.h
  • IDM_ICOLUMNSROWSET_GETCOLUMNSROWSET : resource.h
  • IDM_ICONNECTIONPOINT_ADVISE : resource.h
  • IDM_ICONNECTIONPOINT_ENUMCONNECTIONS : resource.h
  • IDM_ICONNECTIONPOINT_GETCONNECTIONINTERFACE : resource.h
  • IDM_ICONNECTIONPOINT_GETCONNECTIONPOINTCONTAINER : resource.h
  • IDM_ICONNECTIONPOINT_UNADVISE : resource.h
  • IDM_ICONVERTTYPE_CANCONVERT : resource.h
  • IDM_ICPC_ENUMCONNECTIONPOINTS : resource.h
  • IDM_ICPC_FINDCONNECTIONPOINT : resource.h
  • IDM_ICREATEROW_CREATEROW : resource.h
  • IDM_IDATAINITIALIZE_CREATEDBINSTANCE : resource.h
  • IDM_IDATAINITIALIZE_CREATEDBINSTANCEEX : resource.h
  • IDM_IDATAINITIALIZE_GETDATASOURCE : resource.h
  • IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING : resource.h
  • IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING_NOPASSWORD : resource.h
  • IDM_IDATAINITIALIZE_LOADSTRINGFROMSTORAGE : resource.h
  • IDM_IDATAINITIALIZE_WRITESTRINGTOSTORAGE : resource.h
  • IDM_IDATASOURCEADMIN_CREATEDATASOURCE : resource.h
  • IDM_IDATASOURCEADMIN_DESTROYDATASOURCE : resource.h
  • IDM_IDATASOURCEADMIN_GETCREATIONPROPERTIES : resource.h
  • IDM_IDATASOURCEADMIN_MODIFYDATASOURCE : resource.h
  • IDM_IDBASYNCHNOTIFY_E_FAIL : resource.h
  • IDM_IDBASYNCHNOTIFY_S_FALSE : resource.h
  • IDM_IDBASYNCHNOTIFY_S_OK : resource.h
  • IDM_IDBASYNCHNOTIFY_S_UNWANTEDPHASE : resource.h
  • IDM_IDBASYNCHNOTIFY_S_UNWANTEDREASON : resource.h
  • IDM_IDBASYNCHSTATUS_ABORT : resource.h
  • IDM_IDBASYNCHSTATUS_GETSTATUS : resource.h
  • IDM_IDBBINDERPROPERTIES_RESET : resource.h
  • IDM_IDBCREATECOMMAND_CREATECOMMAND : resource.h
  • IDM_IDBCREATESESSION_CREATESESSION : resource.h
  • IDM_IDBINFO_GETKEYWORDS : resource.h
  • IDM_IDBINFO_GETLITERALINFO : resource.h
  • IDM_IDBINITIALIZE_INITIALIZE : resource.h
  • IDM_IDBINITIALIZE_UNINITIALIZE : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE_ADVANCED : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME : resource.h
  • IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME_ADVANCED : resource.h
  • IDM_IDBPROPERTIES_GETPROPERTIES : resource.h
  • IDM_IDBPROPERTIES_GETPROPERTYINFO : resource.h
  • IDM_IDBPROPERTIES_SETPROPERTIES : resource.h
  • IDM_IGETPOOL_GETPOOL : resource.h
  • IDM_IGETPOOL_GETPOOLSTATE : resource.h
  • IDM_IGETSESSION_GETSESSION : resource.h
  • IDM_IGNBLANKS : wdiffrc.h
  • IDM_ILOCKBYTES_FLUSH : resource.h
  • IDM_ILOCKBYTES_LOCKREGION : resource.h
  • IDM_ILOCKBYTES_READAT : resource.h
  • IDM_ILOCKBYTES_SETSIZE : resource.h
  • IDM_ILOCKBYTES_STAT : resource.h
  • IDM_ILOCKBYTES_UNLOCKREGION : resource.h
  • IDM_ILOCKBYTES_WRITE : resource.h
  • IDM_IMDFIND_FINDCELL : resource.h
  • IDM_IMDFIND_FINDTUPEL : resource.h
  • IDM_IMDRANGEROWSET_GETRANGEROWSET : resource.h
  • IDM_IMULTIPLERESULTS_GETRESULT : resource.h
  • IDM_IN_CONTROL : Resource.h
  • IDM_INDEX_ALTERINDEX : resource.h
  • IDM_INDEX_CREATEINDEX : resource.h
  • IDM_INDEX_DROPINDEX : resource.h
  • IDM_INSERT : SimpCntr.h , SimpSvr.h , SimpDnd.h
  • IDM_INSERTOBJECT : Resource.h
  • IDM_INSERTROW : resource.h
  • IDM_INVALID : resource.h
  • IDM_INVOKE_ALL : resource.h
  • IDM_IPERSIST_GETCLASSID : resource.h
  • IDM_IPERSISTFILE_GETCURFILE : resource.h
  • IDM_IPERSISTFILE_ISDIRTY : resource.h
  • IDM_IPERSISTFILE_LOAD : resource.h
  • IDM_IPERSISTFILE_SAVE : resource.h
  • IDM_IPERSISTFILE_SAVECOMPLETED : resource.h
  • IDM_IPOOLINFO_GETCOUNT : resource.h
  • IDM_IPOOLINFO_GETPOOLID : resource.h
  • IDM_IPOOLINFO_GETPOOLTIMEOUT : resource.h
  • IDM_IPOOLINFO_GETPROTOTYPE : resource.h
  • IDM_IPOOLINFO_GETRETRYTIMEOUT : resource.h
  • IDM_IPOOLINFO_REFRESH : resource.h
  • IDM_IPOOLINFO_SETPOOLTIMEOUT : resource.h
  • IDM_IPOOLINFO_SETRETRYTIMEOUT : resource.h
  • IDM_IREGISTERPROVIDER_GETURLMAPPING : resource.h
  • IDM_IREGISTERPROVIDER_SETURLMAPPING : resource.h
  • IDM_IREGISTERPROVIDER_UNREGISTERPROVIDER : resource.h
  • IDM_IROW_ADDCOLUMNS : resource.h
  • IDM_IROW_DELETECOLUMNS : resource.h
  • IDM_IROW_GETCOLUMNS : resource.h
  • IDM_IROW_GETSOURCEROWSET : resource.h
  • IDM_IROW_OPEN : resource.h
  • IDM_IROW_SETCOLUMNS : resource.h
  • IDM_IROWPOS_CLEARROWPOSITION : resource.h
  • IDM_IROWPOS_GETROWPOSITION : resource.h
  • IDM_IROWPOS_GETROWSET : resource.h
  • IDM_IROWPOS_INITIALIZE : resource.h
  • IDM_IROWPOS_SETROWPOSITION : resource.h
  • IDM_IROWPOSITION_E_FAIL : resource.h
  • IDM_IROWPOSITION_S_FALSE : resource.h
  • IDM_IROWPOSITION_S_OK : resource.h
  • IDM_IROWPOSITION_S_UNWANTEDPHASE : resource.h
  • IDM_IROWPOSITION_S_UNWANTEDREASON : resource.h
  • IDM_IROWSET_CURSORENGINE : resource.h
  • IDM_IROWSET_GETPROPERTIES : resource.h
  • IDM_IROWSETBOOKMARK_POSITIONONBOOKMARK : resource.h
  • IDM_IROWSETFIND_FINDNEXTROW : resource.h
  • IDM_IROWSETINDENTITY_ISSAMEROW : resource.h
  • IDM_IROWSETLOCATE_COMPARE : resource.h
  • IDM_IROWSETLOCATE_GETDATA : resource.h
  • IDM_IROWSETLOCATE_GETROWSAT : resource.h
  • IDM_IROWSETLOCATE_GETROWSBYBOOKMARK : resource.h
  • IDM_IROWSETLOCATE_HASH : resource.h
  • IDM_IROWSETNOTIFY_E_FAIL : resource.h
  • IDM_IROWSETNOTIFY_S_FALSE : resource.h
  • IDM_IROWSETNOTIFY_S_OK : resource.h
  • IDM_IROWSETNOTIFY_S_UNWANTEDPHASE : resource.h
  • IDM_IROWSETNOTIFY_S_UNWANTEDREASON : resource.h
  • IDM_IROWSETPROPERTIES : resource.h
  • IDM_IROWSETSCROLL_GETAPPROXIMATEPOSITION : resource.h
  • IDM_IROWSETSCROLL_GETDATA : resource.h
  • IDM_IROWSETSCROLL_GETROWSATRATIO : resource.h
  • IDM_IROWSETVIEW_CREATEVIEW : resource.h
  • IDM_IROWSETVIEW_GETVIEW : resource.h
  • IDM_IS_SHARING_ENABLED : Resource.h
  • IDM_ISCOPEDOPERATIONS_COPY : resource.h
  • IDM_ISCOPEDOPERATIONS_DELETE : resource.h
  • IDM_ISCOPEDOPERATIONS_MOVE : resource.h
  • IDM_ISCOPEDOPERATIONS_OPENROWSET : resource.h
  • IDM_ISEQSTREAM_READ : resource.h
  • IDM_ISEQSTREAM_WRITE : resource.h
  • IDM_ISERVICEPROVIDER : resource.h
  • IDM_ISESSIONPROPERTIES_GETPROPERTIES : resource.h
  • IDM_ISESSIONPROPERTIES_SETPROPERTIES : resource.h
  • IDM_ISOTROPIC : Resource.h
  • IDM_ISOURCESROWSET_GETSOURCESROWSET : resource.h
  • IDM_ISTREAM_CLONE : resource.h
  • IDM_ISTREAM_COMMIT : resource.h
  • IDM_ISTREAM_COPYTO : resource.h
  • IDM_ISTREAM_LOCKREGION : resource.h
  • IDM_ISTREAM_READ : resource.h
  • IDM_ISTREAM_REVERT : resource.h
  • IDM_ISTREAM_SEEK : resource.h
  • IDM_ISTREAM_SETSIZE : resource.h
  • IDM_ISTREAM_STAT : resource.h
  • IDM_ISTREAM_UNLOCKREGION : resource.h
  • IDM_ISTREAM_WRITE : resource.h
  • IDM_ISUPPORTERRORINFO : resource.h
  • IDM_ITRANSACTION_ABORT : resource.h
  • IDM_ITRANSACTION_COMMIT : resource.h
  • IDM_ITRANSACTION_GETTRANSACTIONINFO : resource.h
  • IDM_ITRANSACTION_RELEASETRANSACTION : resource.h
  • IDM_ITRANSACTIONDISPENSOR_BEGINTRANSACTION : resource.h
  • IDM_ITRANSACTIONJOIN_GETOPTIONSOBJECT : resource.h
  • IDM_ITRANSACTIONJOIN_JOINTRANSACTION : resource.h
  • IDM_ITRANSACTIONJOIN_RELEASETRANSACTION : resource.h
  • IDM_ITRANSACTIONLOCAL_GETOPTIONSOBJECT : resource.h
  • IDM_ITRANSACTIONLOCAL_STARTTRANSACTION : resource.h
  • IDM_ITRANSACTIONOBJECT_GETTRANSACTIONOBJECT : resource.h
  • IDM_ITRANSACTIONOPTIONS_GETOPTIONS : resource.h
  • IDM_ITRANSACTIONOPTIONS_SETOPTIONS : resource.h
  • IDM_IUNKNOWN_AUTOQI : resource.h
  • IDM_IUNKNOWN_QUERYINTERFACE : resource.h
  • IDM_IUNKNOWN_RELEASE : resource.h
  • IDM_IUNKNOWN_RELEASEALL : resource.h
  • IDM_IUNKNOWN_RELEASECHILDREN : resource.h
  • IDM_KILL_THREADS : resource.h
  • IDM_LARGE_ICONS : Resource.h , resource.h
  • IDM_LARGEICONS : Resource.h
  • IDM_LAST : Commands.h
  • IDM_LASTPAGE : APP.h
  • IDM_LAUNCH : Resource.h
  • IDM_LAZY : wdiffrc.h
  • IDM_LEAVE : MousInfo.h
  • IDM_LEFT : Resource.h
  • IDM_LINETO : Resource.h
  • IDM_LINK : Generic.H , resource.h
  • IDM_LINKS : Generic.H , resource.h
  • IDM_LIST : Resource.h , resource.h
  • IDM_LISTEN : Globals.h
  • IDM_LNRS : wdiffrc.h
  • IDM_LOAD : resource.h
  • IDM_LOADDIB : Resource.h , resource.h
  • IDM_LOCATION : Resource.h
  • IDM_LOENGLISH : Resource.h
  • IDM_LOG_COPYCLIP : AptClien.h , AptServe.h , ComUser.h , LicClien.h , LocClien.h , LocServe.h , RemClien.h , DllClien.h
  • IDM_LOG_DLLSERVER : LicClien.h
  • IDM_LOG_LICSERVER : LicClien.h
  • IDM_LOG_LOGCLEAR : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocServe.h , RemClien.h , LocClien.h , AptServe.h
  • IDM_LOG_LOGGING : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_LOGONOFF : Resource.h
  • IDM_LOMETRIC : Resource.h
  • IDM_LONLY : wdiffrc.h
  • IDM_MAIN_MENU : resource.h , Resource.h
  • IDM_MAKECALL : GLOBALS.h
  • IDM_MAPPARAMETERNAMES : resource.h
  • IDM_MAPPER : MidiPlyr.h
  • IDM_MARK : wdiffrc.h
  • IDM_MARKPATTERN : wdiffrc.h
  • IDM_MENU : Resource.h , MousInfo.h
  • IDM_MIXER_MERGE : resource.h
  • IDM_MIXER_OPTIONS : resource.h
  • IDM_MIXER_PLAY : resource.h
  • IDM_MIXER_STOP : resource.h
  • IDM_MODAL : Resource.h
  • IDM_MODE_BLACKONWHITE : PlgBlt.h
  • IDM_MODE_COLORONCOLOR : PlgBlt.h
  • IDM_MODE_HALFTONE : PlgBlt.h
  • IDM_MODE_WHITEONBLACK : PlgBlt.h
  • IDM_MODELESS : Resource.h
  • IDM_MODIFY_DATA : Commands.h
  • IDM_MONITOR : Resource.h
  • IDM_MONOCOLS : wdiffrc.h
  • IDM_MSPERSIST_ROWSET_LOAD : resource.h
  • IDM_MSPERSIST_ROWSET_SAVE : resource.h
  • IDM_MULTIPLERESULTS_ADDREF : resource.h
  • IDM_MULTIPLERESULTSMENU : resource.h
  • IDM_MULTITHREAD2 : CDTest.h
  • IDM_NATIVEMODE : Resource.h
  • IDM_NEW : Generic.H , Resource.h , resource.h , StatList.h , ClipText.h , Commands.h , FontView.h
  • IDM_NEW_DEVICE : globals.h
  • IDM_NEW_FOLDER : globals.h , Commands.h , globals.h
  • IDM_NEW_ITEM : Commands.h
  • IDM_NEW_VIRTFILE : globals.h
  • IDM_NEXTCAND : Resource.h
  • IDM_NEXTCLAUSE : Resource.h
  • IDM_NEXTPAGE : APP.h
  • IDM_NEXTSECTION : APP.h
  • IDM_NEXTWINDOW : resource.h
  • IDM_NOGRAPHICS : Resource.h
  • IDM_NONRS : wdiffrc.h
  • IDM_NOTIFY_E_FAIL : resource.h
  • IDM_NOTIFY_S_FALSE : resource.h
  • IDM_NOTIFY_S_OK : resource.h
  • IDM_NOTIFY_S_UNWANTEDPHASE : resource.h
  • IDM_NOTIFY_S_UNWANTEDREASON : resource.h
  • IDM_NOTIFYMENU : resource.h
  • IDM_OBJECTSWINDOW : resource.h
  • IDM_ON_TOP : Resource.h
  • IDM_OPEN : Generic.H , DfV.h , Resource.h , MidiPlyr.h , FontView.h , resource.h , StatList.h , ClipText.h , CDTest.h , Commands.h , sendto.h , resource.h , wdiffrc.h
  • IDM_OPENCAND : Resource.h
  • IDM_OPENROWSET : resource.h
  • IDM_OPENSTATUS : Resource.h
  • IDM_OPTION_CHATTY : resource.h
  • IDM_OPTION_CREATE_ITERATION : resource.h
  • IDM_OPTION_ODBC_ASSERT : resource.h
  • IDM_OPTION_ODBC_STOP : resource.h
  • IDM_OPTIONS : resource.h , Resource.h
  • IDM_OPTIONS_COLOR : Deb.h
  • IDM_OPTIONS_FONT : Deb.h
  • IDM_OPTIONS_PREFERENCES : Deb.h
  • IDM_OPTIONS_SAVEDDIR : Deb.h
  • IDM_OPTIONS_SAVENOW : Deb.h
  • IDM_OPTIONS_SAVEONEXIT : Deb.h
  • IDM_OPTIONS_TOOLBAR : Deb.h
  • IDM_OUTLINE : Resource.h , wdiffrc.h
  • IDM_OUTLINE_INCDIFFER : wdiffrc.h
  • IDM_OUTLINE_INCLEFT : wdiffrc.h
  • IDM_OUTLINE_INCRIGHT : wdiffrc.h
  • IDM_OUTLINE_INCSAME : wdiffrc.h
  • IDM_OUTLINEMETRICS : FontView.h
  • IDM_OVER : resource.h
  • IDM_PAGE_DELETE : RESDEF.h
  • IDM_PAGE_NEWDRAW : RESDEF.h
  • IDM_PAGE_NEWTEXT : RESDEF.h
  • IDM_PAGE_OPEN : RESDEF.h
  • IDM_PAGE_TITLE : RESDEF.h
  • IDM_PARSEDISPLAYNAME : resource.h
  • IDM_PASTE : Generic.H , Resource.h , FontView.h , resource.h , Resource.h , PlgBlt.h , ClipText.h , Commands.h , Resource.h
  • IDM_PASTEEDITWINDOW : resource.h
  • IDM_PAUSE : MciPlay.h , MidiPlyr.h
  • IDM_PEN_COLOR : DComDraw.h , StoClien.h , RESDEF.h
  • IDM_PEN_MEDIUM : DComDraw.h , RESDEF.h , StoClien.h
  • IDM_PEN_THICK : DComDraw.h , RESDEF.h , StoClien.h
  • IDM_PEN_THIN : DComDraw.h , RESDEF.h , StoClien.h
  • IDM_PENCOLOR_DASH : Resource.h
  • IDM_PENCOLOR_DASHDOT : Resource.h
  • IDM_PENCOLOR_DASHDOTDOT : Resource.h
  • IDM_PENCOLOR_DOT : Resource.h
  • IDM_PENCOLOR_INSIDEFRAME : Resource.h
  • IDM_PENCOLOR_NULL : Resource.h
  • IDM_PENCOLOR_SOLID : Resource.h
  • IDM_PENWIDTH_1 : Resource.h
  • IDM_PENWIDTH_2 : Resource.h
  • IDM_PENWIDTH_3 : Resource.h
  • IDM_PENWIDTH_4 : Resource.h
  • IDM_PENWIDTH_5 : Resource.h
  • IDM_PENWIDTH_6 : Resource.h
  • IDM_PENWIDTH_7 : Resource.h
  • IDM_PENWIDTH_8 : Resource.h
  • IDM_PICTURE : wdiffrc.h
  • IDM_PIE : Resource.h
  • IDM_PLAY : MciPlay.h , MidiPlyr.h
  • IDM_PLAYBACK : resource.h
  • IDM_PLGBLT : Resource.h
  • IDM_POLYBEZIER : Resource.h
  • IDM_POLYGON : Resource.h
  • IDM_POLYLINE : Resource.h
  • IDM_POLYPOLYGON : Resource.h
  • IDM_POOL_TEST : resource.h
  • IDM_POOLINFO_ADDREF : resource.h
  • IDM_POOLMENU : resource.h
  • IDM_POOLMNGR_ENUMPOOLS : resource.h
  • IDM_POOLMNGR_REFRESH : resource.h
  • IDM_PREV : resource.h
  • IDM_PREVCAND : Resource.h
  • IDM_PREVCLAUSE : Resource.h
  • IDM_PREVPAGE : APP.h
  • IDM_PREVSECTION : APP.h
  • IDM_PREVWINDOW : resource.h
  • IDM_PRINT : Generic.H , Resource.h , APP.h , Resource.h , resource.h , Resource.h , WinCap.h , ClipText.h , CDTest.h , FontView.h , wdiffrc.h
  • IDM_PRINTDLG : Resource.h
  • IDM_PRINTERNOTIFICATION : resource.h
  • IDM_PRINTSET : FontView.h
  • IDM_PRINTSETUP : Generic.H , resource.h
  • IDM_PROPERTIES : resource.h
  • IDM_PROVIDERINFO : resource.h
  • IDM_QUERY_ATTRIBS : globals.h
  • IDM_QUICKTEST : Resource.h
  • IDM_RANDOM : resource.h
  • IDM_RANDOM_COINIT : resource.h
  • IDM_RECENTCONFIG1 : resource.h
  • IDM_RECENTCONFIG10 : resource.h
  • IDM_RECENTCONFIG2 : resource.h
  • IDM_RECENTCONFIG3 : resource.h
  • IDM_RECENTCONFIG4 : resource.h
  • IDM_RECENTCONFIG5 : resource.h
  • IDM_RECENTCONFIG6 : resource.h
  • IDM_RECENTCONFIG7 : resource.h
  • IDM_RECENTCONFIG8 : resource.h
  • IDM_RECENTCONFIG9 : resource.h
  • IDM_RECENTFILE1 : resource.h
  • IDM_RECENTFILE10 : resource.h
  • IDM_RECENTFILE2 : resource.h
  • IDM_RECENTFILE3 : resource.h
  • IDM_RECENTFILE4 : resource.h
  • IDM_RECENTFILE5 : resource.h
  • IDM_RECENTFILE6 : resource.h
  • IDM_RECENTFILE7 : resource.h
  • IDM_RECENTFILE8 : resource.h
  • IDM_RECENTFILE9 : resource.h
  • IDM_RECONVERT : resource.h
  • IDM_RECTANGLE : Resource.h
  • IDM_RED : Resource.h , Menu.h
  • IDM_REFRESH : resource.h , Resource.h , resource.h
  • IDM_REFRESHVISIBLEDATA : resource.h
  • IDM_REGISTER_LOCAL : resource.h
  • IDM_RELEASE_JOINEDTRANSACTION : resource.h
  • IDM_RELEASEALLROWS : resource.h
  • IDM_RELEASEROWS : resource.h
  • IDM_REMOVE : resource.h
  • IDM_RENAME : Commands.h
  • IDM_RENDER : Resource.h
  • IDM_REPLACE : FontView.h , CDTest.h
  • IDM_REPORT : Resource.h
  • IDM_RESCAN : wdiffrc.h
  • IDM_RESET : LeakyBin.h
  • IDM_RESTARTPOSITION : resource.h
  • IDM_RESYNCHROWS : resource.h
  • IDM_RETAIN : Demo.h
  • IDM_RETRY : resource.h
  • IDM_REVERT : Resource.h
  • IDM_RIGHT : Resource.h
  • IDM_RNRS : wdiffrc.h
  • IDM_ROMAN : Resource.h
  • IDM_RONLY : wdiffrc.h
  • IDM_ROTATE : Resource.h
  • IDM_ROUNDRECT : Resource.h
  • IDM_ROW_ADDREF : resource.h
  • IDM_ROWMENU : resource.h
  • IDM_ROWPOS_ADDREF : resource.h
  • IDM_ROWPOSITIONMENU : resource.h
  • IDM_ROWSET_ADDREF : resource.h
  • IDM_ROWSETMENU : resource.h
  • IDM_RPLAY : MciPlay.h
  • IDM_RSTEP : MciPlay.h
  • IDM_RUN_SUITE : resource.h
  • IDM_SAutosizeMovie : MciPlay.h
  • IDM_SAutosizeWindow : MciPlay.h
  • IDM_SAVE : Generic.H , Resource.h , FontView.h , resource.h , WinCap.h , ClipText.h , CDTest.h , resource.h , StatList.h , Resource.h
  • IDM_SAVE_AS : Resource.h
  • IDM_SAVEAS : Generic.H , Resource.h , FontView.h , resource.h , ClipText.h , StatList.h
  • IDM_SAVEDIB : Resource.h
  • IDM_SAVELIST : wdiffrc.h
  • IDM_SELECT_APPLICATIONS : Resource.h
  • IDM_SELECTPRINTER : resource.h
  • IDM_SELECTRECT : WinCap.h
  • IDM_SENDTOFIRST : sendto.h
  • IDM_SENDTOLAST : sendto.h
  • IDM_SENDTOPOPUP : sendto.h
  • IDM_SEPARATOR : Commands.h
  • IDM_SErrorDlg : MciPlay.h
  • IDM_SERVICECOMP_ADDREF : resource.h
  • IDM_SERVICECOMPMENU : resource.h
  • IDM_SESSION_ADDREF : resource.h
  • IDM_SESSIONMENU : resource.h
  • IDM_SETBRUSHCOLOR : Resource.h
  • IDM_SETCOMMANDSTREAM : resource.h
  • IDM_SETCOMMANDTEXT : resource.h
  • IDM_SETDATA : resource.h
  • IDM_SETEDIT : wdiffrc.h
  • IDM_SETERRORINFO : resource.h
  • IDM_SETFONT : wdiffrc.h
  • IDM_SETPARAMETERINFO : resource.h
  • IDM_SETPENCOLOR : Resource.h
  • IDM_SETTABWIDTH : wdiffrc.h
  • IDM_SETTINGS : StatList.h
  • IDM_SHARE : Resource.h
  • IDM_SHOWCAND : Resource.h
  • IDM_SHOWGUIDES : Resource.h
  • IDM_SHOWLOCAL : Resource.h
  • IDM_SHOWPROP : Resource.h
  • IDM_SHOWWHITESPACE : wdiffrc.h
  • IDM_SINK_OFF : StoClien.h
  • IDM_SINK_ON : StoClien.h
  • IDM_SIZE : Menu.h
  • IDM_SMALL_ICONS : Resource.h , resource.h
  • IDM_SMALLICONS : Resource.h
  • IDM_SMenu : MciPlay.h
  • IDM_SNotifyMedia : MciPlay.h
  • IDM_SNotifyMode : MciPlay.h
  • IDM_SNotifyPos : MciPlay.h
  • IDM_SNotifySize : MciPlay.h
  • IDM_SOFTKBD : Resource.h
  • IDM_SOUND_BALL_OFF : ConClien.h
  • IDM_SOUND_BALL_ON : ConClien.h
  • IDM_SPIN10 : PlgBlt.h
  • IDM_SPIN30 : PlgBlt.h
  • IDM_SPIN5 : PlgBlt.h
  • IDM_SPIN60 : PlgBlt.h
  • IDM_SPIN90 : PlgBlt.h
  • IDM_SPINCENTER : PlgBlt.h
  • IDM_SPINOFF : PlgBlt.h
  • IDM_SPINTESTSTATS : SpinTest.h
  • IDM_SPINTOPLEFT : PlgBlt.h
  • IDM_SPlaybar : MciPlay.h
  • IDM_SQLERRORINFO_GETSQLINFO : resource.h
  • IDM_SRecord : MciPlay.h
  • IDM_SShowMode : MciPlay.h
  • IDM_SShowName : MciPlay.h
  • IDM_SShowPos : MciPlay.h
  • IDM_START : LeakyBin.h
  • IDM_STARTIMEMENU : Resource.h
  • IDM_STATE1 : Menu.h
  • IDM_STATE2 : Menu.h
  • IDM_STATE3 : Menu.h
  • IDM_STATE4 : Menu.h
  • IDM_STATUS : MidiPlyr.h
  • IDM_STATUSBAR : FontView.h , STATBAR.h
  • IDM_STEP : MciPlay.h
  • IDM_STOP : resource.h , MciPlay.h , MidiPlyr.h , LeakyBin.h
  • IDM_STREAM_ADDREF : resource.h
  • IDM_STREAMMENU : resource.h
  • IDM_STRETCHBLT : Resource.h
  • IDM_STYLE : Menu.h
  • IDM_SWITCH : Resource.h
  • IDM_SYMBOL : Resource.h
  • IDM_SYNCUI : MidiPlyr.h
  • IDM_SYS_LOGOFF : Resource.h
  • IDM_SYS_LOGON : Resource.h
  • IDM_SYSINFO : Resource.h
  • IDM_SYSMENU : FontView.h
  • IDM_TABLE_ADDCOLUMN : resource.h
  • IDM_TABLE_ADDCONSTRAINT : resource.h
  • IDM_TABLE_ALTERCOLUMN : resource.h
  • IDM_TABLE_ALTERTABLE : resource.h
  • IDM_TABLE_CREATETABLE : resource.h
  • IDM_TABLE_CREATETABLEWITHCONSTRAINTS : resource.h
  • IDM_TABLE_DROPCOLUMN : resource.h
  • IDM_TABLE_DROPCONSTRAINT : resource.h
  • IDM_TABLE_DROPTABLE : resource.h
  • IDM_TABWIDTH4 : wdiffrc.h
  • IDM_TABWIDTH8 : wdiffrc.h
  • IDM_TERMINATE_COMPOSITION : resource.h
  • IDM_TEST : resource.h
  • IDM_TEST_DLLABOUT : DllUser.h
  • IDM_TEST_DLLHELLO : DllUser.h
  • IDM_TEXT : Resource.h
  • IDM_TEXT_CLEAR : RESDEF.h
  • IDM_TEXT_EXIT : RESDEF.h
  • IDM_TEXT_SAVE : RESDEF.h
  • IDM_TEXTCOLOR : Resource.h
  • IDM_TEXTMETRIC : FontView.h
  • IDM_THELP_ABOUT : RESDEF.h
  • IDM_THELP_CONTENTS : RESDEF.h
  • IDM_THELP_READSOURCE : RESDEF.h
  • IDM_THELP_TUTORIAL : RESDEF.h
  • IDM_THELP_TUTSERVER : RESDEF.h
  • IDM_TILEHORIZONTAL : resource.h
  • IDM_TILEVERTICAL : resource.h
  • IDM_TIME : wdiffrc.h
  • IDM_TIMER : STATBAR.h
  • IDM_TITLE : CDTest.h
  • IDM_TOGGLE : DfV.h
  • IDM_TOGGLE_STATUS : globals.h
  • IDM_TOGGLEMARK : wdiffrc.h
  • IDM_TOMOVED : wdiffrc.h
  • IDM_TOOLBAR : FontView.h , ToolBar.h , MidiPlyr.h
  • IDM_TOP : Resource.h
  • IDM_TOPMOST : Resource.h
  • IDM_TRACE : wdiffrc.h
  • IDM_TRACEOFF : wdiffrc.h
  • IDM_TRACEWINDOW : resource.h
  • IDM_TRACK : MousInfo.h
  • IDM_TRANSACTION_ADDREF : resource.h
  • IDM_TRANSACTIONMENU : resource.h
  • IDM_TRANSACTIONOPTIONS_ADDREF : resource.h
  • IDM_TRANSACTIONOPTIONSMENU : resource.h
  • IDM_TREESCHEMA : resource.h
  • IDM_TWIPS : Resource.h
  • IDM_UCAR_CLUTCH : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCAR_CREATE : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCAR_OFFROAD : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCAR_RELEASE : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCAR_SHIFT : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCAR_SPEED : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCAR_STEER : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCAR_WINCH : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCRU_ADJUST : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCRU_CLEARLICKEY : LicClien.h
  • IDM_UCRU_CLUTCH : AptClien.h , ComUser.h , LicClien.h , LocClien.h , RemClien.h , DllClien.h
  • IDM_UCRU_CREATE : AptClien.h , ComUser.h , DllClien.h , LicClien.h , RemClien.h , LocClien.h
  • IDM_UCRU_ENGAGE : AptClien.h , ComUser.h , LicClien.h , LocClien.h , RemClien.h , DllClien.h
  • IDM_UCRU_GETLICKEY : LicClien.h
  • IDM_UCRU_OFFROAD : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCRU_RELEASE : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UCRU_SHIFT : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCRU_SPEED : AptClien.h , ComUser.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h
  • IDM_UCRU_STEER : AptClien.h , ComUser.h , DllClien.h , LocClien.h , RemClien.h , LicClien.h
  • IDM_UCRU_WINCH : AptClien.h , DllClien.h , LicClien.h , LocClien.h , RemClien.h , ComUser.h
  • IDM_UNDO : Generic.H , Resource.h , resource.h , FontView.h , resource.h , ClipText.h , Resource.h
  • IDM_UNKNOWN_ADDREF : resource.h
  • IDM_UNKNOWNMENU : resource.h
  • IDM_UPDATE : wdiffrc.h , Resource.h , resource.h
  • IDM_VERB0 : SimpCntr.h , SimpDnd.h , SimpSvr.h
  • IDM_VIEW : FontView.h , Commands.h
  • IDM_VIEW_CHAT : Resource.h
  • IDM_VIEW_CLEAR : resource.h , Resource.h
  • IDM_VIEW_DETAILS : Commands.h
  • IDM_VIEW_ENVIRON : Resource.h
  • IDM_VIEW_FONT : Resource.h
  • IDM_VIEW_LARGE : Commands.h
  • IDM_VIEW_LIST : Commands.h
  • IDM_VIEW_MSG : Resource.h
  • IDM_VIEW_NAME : Resource.h
  • IDM_VIEW_NEXT : resource.h
  • IDM_VIEW_SBAR : Resource.h
  • IDM_VIEW_SMALL : Commands.h
  • IDM_VIEW_TBAR : Resource.h
  • IDM_VIEW_TIME : Resource.h
  • IDM_VIEW_USERLIST : Resource.h
  • IDM_VIEW_USERS : Resource.h
  • IDM_VIEWCLEAR : WinCap.h
  • IDM_VIEWFONT : Resource.h
  • IDM_VIEWFONTDECREASE : Resource.h
  • IDM_VIEWFONTINCREASE : Resource.h
  • IDM_VIEWFULL : WinCap.h
  • IDM_VIEWREPLACE : Resource.h
  • IDM_VIEWRESTORED : WinCap.h
  • IDM_VIEWSTATUSBAR : Resource.h
  • IDM_VIEWTOOLBAR : Resource.h
  • IDM_WINDOW_CASCADE : GdiDemo.h
  • IDM_WINDOW_ICON : GdiDemo.h
  • IDM_WINDOW_TILE : GdiDemo.h
  • IDM_WINDOWCHILD : Resource.h
  • IDM_WIZARD : Resource.h
  • IDM_WORK_ALONE : Resource.h
  • IDM_ZOOMIN : APP.h
  • IDM_ZOOMOUT : APP.h
  • IDNEW : Resource.h
  • IDNO : winres.h
  • IDOK : winres.h
  • IDOK2 : Resource.h
  • IDP_TABS : resource.h
  • IDQUERY : Resource.h
  • IDR_ACCELERATOR1 : Resource.h
  • IDR_ACCELERATOR2 : Resource.h
  • IDR_ACCELERATOR3 : Resource.h
  • IDR_ACCELERATOR4 : Resource.h
  • IDR_ACCELERATOR5 : Resource.h
  • IDR_ACCELERATORS : Resource.h , resource.h , Resource.h
  • IDR_ACCELS : resource.h , Resource.h
  • IDR_Account : Resource.h , resource.h , Resource.h
  • IDR_ACCOUNT : resource.h
  • IDR_ADOCOMPONENT : Resource.h
  • IDR_ADsError : resource.h
  • IDR_ALL_ROWS : resource.h
  • IDR_ANNOTATOR : resource.h
  • IDR_APITYPE : Resource.h
  • IDR_APPICON : resource.h
  • IDR_AUTHENTICATEADMIN : resource.h
  • IDR_AUTHENTICATECONTEXT : resource.h
  • IDR_AUTHENTICATEPLUGIN : resource.h
  • IDR_BEHAVIOR : Resource.h
  • IDR_BLOB_SIZE : resource.h
  • IDR_BR_GIF : resource.h
  • IDR_BROWSE_PROPERTY : resource.h
  • IDR_BROWSERHOST : resource.h
  • IDR_BYOTTRANSOBJ : Resource.h
  • IDR_CASCADE : resource.h
  • IDR_CEnumStorageResource : resource.h
  • IDR_CMgdResType : Resource.h
  • IDR_COLOR_MENU : Resource.h
  • IDR_COLUMNCOUNT : resource.h
  • IDR_COLUMNWIDTHS : resource.h
  • IDR_Computer : resource.h
  • IDR_COMSPY : Resource.h
  • IDR_ComSpy : Resource.h
  • IDR_COMSpy1 : Resource.h
  • IDR_COMSPYPROPPAGE : Resource.h
  • IDR_COMSPYSQLAUDIT : Resource.h
  • IDR_COMSYNCTEST : Resource.h
  • IDR_CONTEXTMENU : Resource.h
  • IDR_CONTEXTPLUGIN : Resource.h
  • IDR_CONTEXTSAMPLEPROPPAGE : resource.h
  • IDR_CPartitionInfo : resource.h
  • IDR_CREATETABLE : resource.h
  • IDR_CRMDEBUGCOMPENSATOR : Resource.h
  • IDR_CRMFILESCOMPENSATOR : Resource.h
  • IDR_CRMFILESTEST : Resource.h
  • IDR_CRMFILESWORKER : Resource.h
  • IDR_CRMMONCOMP : Resource.h
  • IDR_CStorageResource : resource.h
  • IDR_CStorageResType : resource.h
  • IDR_DBAUTHADMIN : resource.h
  • IDR_DBAUTHPLUGIN : resource.h
  • IDR_DEVICE_TOOLBAR : resource.h
  • IDR_DIMMER : resource.h
  • IDR_DIMMERSERVICE : resource.h
  • IDR_DXSURFMENU : resource.h
  • IDR_DYNAMIC : resource.h
  • IDR_EAPCFG : Resource.h
  • IDR_EdCommands : resource.h
  • IDR_EdGlyphs : resource.h
  • IDR_EdHost : resource.h
  • IDR_ENLISTTRANSACTION : Resource.h
  • IDR_ENTITY : resource.h
  • IDR_EVENTSINK : Resource.h
  • IDR_FACTORY : Resource.h
  • IDR_FREETEST : Resource.h
  • IDR_FULL : Monkey.h
  • IDR_FULLSERV : resource.h
  • IDR_FullSvr : resource.h
  • IDR_GENERIC : Resource.h
  • IDR_GetReceipt : Resource.h , resource.h
  • IDR_GIFS1 : resource.h
  • IDR_GIFS10 : resource.h
  • IDR_GIFS11 : resource.h
  • IDR_GIFS12 : resource.h
  • IDR_GIFS13 : resource.h
  • IDR_GIFS14 : resource.h
  • IDR_GIFS15 : resource.h
  • IDR_GIFS16 : resource.h
  • IDR_GIFS17 : resource.h
  • IDR_GIFS18 : resource.h
  • IDR_GIFS19 : resource.h
  • IDR_GIFS2 : resource.h
  • IDR_GIFS3 : resource.h
  • IDR_GIFS4 : resource.h
  • IDR_GIFS5 : resource.h
  • IDR_GIFS6 : resource.h
  • IDR_GIFS7 : resource.h
  • IDR_GIFS8 : resource.h
  • IDR_GIFS9 : resource.h
  • IDR_GRID : resource.h
  • IDR_Handler1 : resource.h
  • IDR_HelloWorld : resource.h
  • IDR_HELP : Resource.h
  • IDR_Human : resource.h
  • IDR_ICON : resource.h
  • IDR_INIT_BACKGROUND : Resource.h
  • IDR_INIT_CONTROL : Resource.h
  • IDR_INIT_NO_LAUNCH : Resource.h
  • IDR_INIT_NORMAL : Resource.h
  • IDR_INSERTROW_BUFFERED : resource.h
  • IDR_INSERTROW_IMMEDIATE : resource.h
  • IDR_ISEQ_STREAM : resource.h
  • IDR_LDISP : Resource.h
  • IDR_LGICONS : resource.h , Resource.h , resource.h
  • IDR_LINE : Resource.h
  • IDR_LOGFILE : Resource.h
  • IDR_MAIN_MENU : Resource.h , resource.h
  • IDR_MAINFRAME : Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h
  • IDR_MAINMENU : Resource.h
  • IDR_MENU : Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h
  • IDR_MENU1 : resource.h , Resource.h , resource.h
  • IDR_MENU2 : Resource.h
  • IDR_MENU_APP : resource.h
  • IDR_MENU_AV : resource.h
  • IDR_MENU_BUDDY : resource.h
  • IDR_MENU_IM : resource.h
  • IDR_MENUBUTTON : resource.h
  • IDR_MENUGC : resource.h
  • IDR_MENUHELP : Resource.h
  • IDR_MENUVIEWPORT : Resource.h
  • IDR_MMCCONTROL : resource.h
  • IDR_MonitorServer : Resource.h
  • IDR_MoveMoney : resource.h
  • IDR_MOVEMONEY : resource.h
  • IDR_MoveMoney : Resource.h
  • IDR_MSOMNIPROV : resource.h
  • IDR_MULTICTYPE : resource.h
  • IDR_MYCAPABILITIES : Resource.h
  • IDR_MYEVICTLISTENER : resource.h
  • IDR_MYMEMBERSETCHANGELISTENER : resource.h
  • IDR_MYSTARTUPLISTENER : resource.h
  • IDR_NEWSEVENT : resource.h
  • IDR_NOTIFY : Resource.h
  • IDR_OLEDBCOMPONENT : Resource.h
  • IDR_OPBank : resource.h
  • IDR_ORDER : Resource.h
  • IDR_PARAM_SETS : resource.h
  • IDR_PINGRESP : Resource.h
  • IDR_PLG_TEST : resource.h
  • IDR_POINT : Resource.h
  • IDR_PoolTest : Resource.h
  • IDR_PRINTJOB : resource.h
  • IDR_PRINTSTYPE : Resource.h
  • IDR_PRIVOBJ_ACC : Resource.h
  • IDR_PROXY : resource.h
  • IDR_PROXYPLUGIN : Resource.h
  • IDR_PTLAUNCHER : resource.h
  • IDR_RDOCOMPONENT : Resource.h
  • IDR_RESOLUTIONS : Resource.h
  • IDR_RESULTSET : resource.h
  • IDR_ROW_COUNT : resource.h
  • IDR_ROWSETVIEWER : resource.h
  • IDR_SampleMSP : Resource.h
  • IDR_SDKSAMPLEPLAYLISTPARSER : resource.h
  • IDR_SDKSAMPLESTORAGESYSTEM : resource.h
  • IDR_Server : Resource.h
  • IDR_SHIP : Resource.h
  • IDR_SHIP2 : Resource.h
  • IDR_SHOWEVENTS : Resource.h
  • IDR_SMICONS : resource.h , Resource.h , resource.h
  • IDR_SNAP : resource.h
  • IDR_SPYCON : Resource.h
  • IDR_SPYMENU : Resource.h
  • IDR_STATE_MENU : resource.h
  • IDR_STATEST : Resource.h
  • IDR_STATIC_TOOLBAR : resource.h
  • IDR_STATMESSAGEMAP : Resource.h
  • IDR_Test1 : Resource.h
  • IDR_TESTTYPE : Resource.h
  • IDR_TOOLBAR1 : resource.h
  • IDR_TOOLBAR_MAIN : Resource.h
  • IDR_TRANSACTIONMENU : resource.h
  • IDR_TRIMMED : Monkey.h
  • IDR_TXSINK : Resource.h
  • IDR_UpdateReceipt : resource.h , Resource.h
  • IDR_UpdateReceipt1 : Resource.h , resource.h
  • IDR_UPLOADSAMPLE : resource.h
  • IDR_UPNPDIMMERDEVICE : resource.h
  • IDR_USAGE : QSample.Hxx
  • IDR_VCSECURITYSAMPLECLASS : Resource.h
  • IDR_VFILE_TOOLBAR : resource.h
  • IDR_WAVEHEAD : resource.h
  • IDR_XMLTREE : resource.h
  • IDRETRY : winres.h
  • IDS_AAFMT : Resource.h
  • IDS_ABORT : wdiffrc.h
  • IDS_ABORT_PENDING : wdiffrc.h
  • IDS_ABORTSTRING : Dibdll.h
  • IDS_ABOUTBOX : resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h
  • IDS_ABOUTNAME : resource.h , Resource.h , resource.h
  • IDS_ACCOUNT_DESC : resource.h , Resource.h
  • IDS_ACKNOWLEDGED : resource.h
  • IDS_ADDCMNTFAIL : MfEdit.h
  • IDS_ADSERROR_DESC : resource.h
  • IDS_ALDUSMF : MfEdit.h
  • IDS_ALLFILES : resource.h
  • IDS_ALLOCFAIL : SpinCube.h
  • IDS_ALLOCPALFAIL : MfEdit.h
  • IDS_ALLOW_MSI_UPDATE : resource.h
  • IDS_ALLRESOURCES_MENU_ITEM_1 : resource.h
  • IDS_ALLRESOURCES_MENU_ITEM_1_DESC : resource.h
  • IDS_ALLRESTYPES_MENU_ITEM_1 : resource.h
  • IDS_ALLRESTYPES_MENU_ITEM_1_DESC : resource.h
  • IDS_ALREADYFINISHED : resource.h
  • IDS_ALREADYFINISHEDCAPTION : resource.h
  • IDS_ANIMATIONS_LABEL : Resource.h
  • IDS_ANSIFONT : APP.h
  • IDS_API_FAILED_MSG : Deb.h
  • IDS_APP_NAME : resource.h
  • IDS_APP_TITLE : resource.h , Resource.h , Generic.H , resource.h , Resource.h , StatList.h , LeakyBin.h , Resource.h
  • IDS_APPERR : MciPlay.h
  • IDS_APPINITFAILED : DComDraw.h , StoClien.h , LocClien.h , DllUser.h , ConClien.h , LicClien.h , RemClien.h , AptClien.h , ComUser.h , DcdServe.h , ExeSkel.h , FreClien.h , LocServe.h , AptServe.h , RESDEF.h , DllClien.h
  • IDS_APPLY_PARAM_CHANGES_ERROR : resource.h
  • IDS_APPNAME : MciPlay.h , GLOBALS.h , Deb.h , Demo.h , MidiPlyr.h , Globals.h
  • IDS_APPTITLE : Resource.h
  • IDS_APPTITLEMASK : MidiPlyr.h
  • IDS_ASK_SAVE : RESDEF.h , DComDraw.h , StoClien.h
  • IDS_ASKDOMSRVNM : Resource.h
  • IDS_ASKSELPRT : Resource.h
  • IDS_ASSERT_FAIL : RemClien.h , Server.h , ReadTut.h , DcdServe.h , Server.h , ExeSkel.h , DllClien.h , ConClien.h , AptClien.h , Server.h , LicClien.h , AptServe.h , ComUser.h , Server.h , DllSkelI.h , DllUser.h , FreClien.h , LocClien.h , RESDEF.h , register.h , ComObjI.h , DComDraw.h , LocServe.h , StoClien.h
  • IDS_AUTHOR : resrc1.h
  • IDS_BAD_ARGUMENT : wdiffrc.h
  • IDS_BAD_SD_INI : wdiffrc.h
  • IDS_BAD_TABWIDTH : wdiffrc.h
  • IDS_BANDNMBR : Dibdll.h
  • IDS_BANNER_TEXT : resource.h
  • IDS_BIKE_TITLE : resource.h
  • IDS_BITMAP_WINDOW_TITLE : resource.h
  • IDS_BLANKPG : Resource.h
  • IDS_BMPFILTERSTRING : Resource.h
  • IDS_BOTH_UNREADABLE : wdiffrc.h
  • IDS_BR_GLYPHSTRING : resource.h
  • IDS_BROWSE : OleStd.h
  • IDS_BUFFERTOOSMALL : ComDlg32.h , Resource.h
  • IDS_BUTTON_ATTACH : Deb.h
  • IDS_BUTTON_COPY : Deb.h
  • IDS_BUTTON_CUT : Deb.h
  • IDS_BUTTON_DELETE : Deb.h
  • IDS_BUTTON_HELP : Deb.h
  • IDS_BUTTON_OPEN : Deb.h
  • IDS_BUTTONTEXT : Resource.h
  • IDS_BYTEFORMAT : resource.h
  • IDS_BZRESULTTEXTBUSY : OleStd.h
  • IDS_BZRESULTTEXTNOTRESPONDING : OleStd.h
  • IDS_CANCEL : resource.h
  • IDS_CANCELCAPTION : resource.h
  • IDS_CANCELLED : resource.h
  • IDS_CANCELTEXT : resource.h
  • IDS_CANDCLASS : FullIME.h
  • IDS_CANDTITLE : FullIME.h
  • IDS_CANDUI : FullIME.h
  • IDS_CANT_OPEN : wdiffrc.h
  • IDS_CANT_OPEN_TMP_FILE : wdiffrc.h
  • IDS_CANTADDTOFILTER : resrc1.h
  • IDS_CANTALLOCMEM : resrc1.h
  • IDS_CANTCAPWNDW : Resource.h
  • IDS_CANTCONVERTTOUNICODE : QSample.Hxx
  • IDS_CANTCREATEFILTER : resrc1.h
  • IDS_CANTDISPLAYSTATUS : QSample.Hxx
  • IDS_CANTFINDCATALOG : QSample.Hxx
  • IDS_CANTFINDPIPE : Client32.h
  • IDS_CANTGETFILESIZE : QSample.Hxx
  • IDS_CANTGETMEMORY : QSample.Hxx
  • IDS_CANTOPENFILE : QSample.Hxx
  • IDS_CANTOPENKEY : Monkey.h
  • IDS_CANTREADFROMFILE : QSample.Hxx
  • IDS_CANTSAVE : Resource.h
  • IDS_CAPTEDALREADY : Resource.h
  • IDS_CAPTION : Resource.h
  • IDS_CAPTURE_STREAM : Resource.h
  • IDS_CERTENCODEALTNAME_DESC : Resource.h
  • IDS_CERTENCODEBITSTRING_DESC : Resource.h
  • IDS_CERTENCODECRLDIST_DESC : Resource.h
  • IDS_CERTENCODEDATEARRAY_DESC : Resource.h
  • IDS_CERTENCODELONGARRAY_DESC : Resource.h
  • IDS_CERTENCODESTRINGARRAY_DESC : Resource.h
  • IDS_CERTEXIT_DESC : Resource.h , resource.h
  • IDS_CERTMANAGEEXITMODULE_DESC : resource.h , Resource.h
  • IDS_CERTMANAGEPOLICYMODULE_DESC : resource.h , Resource.h
  • IDS_CERTPOLICY_DESC : resource.h , Resource.h
  • IDS_CHANGEADDITIONALLINKS : OleStd.h
  • IDS_CHANGESOURCE : OleStd.h
  • IDS_CHOOSER_INVALID_COMPUTERNAME : resource.h
  • IDS_CIFILEACCESS : OleStd.h
  • IDS_CIFILEOPENFAIL : OleStd.h
  • IDS_CIFILESHARE : OleStd.h
  • IDS_CIINVALIDFILE : OleStd.h
  • IDS_CINOICONSINFILE : OleStd.h
  • IDS_CLASS : HalfIME.h , FullIME.h
  • IDS_CLASSFRAME : Resource.h
  • IDS_CLASSNAME : APP.h
  • IDS_CLASSVIEWPORT : Resource.h
  • IDS_CLIENTDBG : Client32.h
  • IDS_CLOSE : OleStd.h
  • IDS_CLOSECAPTION : resource.h
  • IDS_CLOSETEXT : resource.h
  • IDS_CLSID : Resource.h
  • IDS_CLUADMEX_COMOBJ_DESC : resource.h
  • IDS_CLUSCFG_ERROR_CONFIGURING_RESTYPE_FAILED : Resource.h
  • IDS_CLUSCFG_ERROR_GETCOMPUTERNAME_FAILED : Resource.h
  • IDS_CLUSCFG_INFO_CONFIGURED_RESTYPE : Resource.h
  • IDS_CLUSCFG_INFO_CONFIGURING_RESTYPE : Resource.h
  • IDS_CLUSTER_MENU_ITEM_1 : resource.h
  • IDS_CLUSTER_MENU_ITEM_1_DESC : resource.h
  • IDS_CNVEMFTO3X : MfEdit.h
  • IDS_CNVFAIL : MfEdit.h
  • IDS_COLONE : resrc1.h
  • IDS_COLUMN1 : Resource.h , resource.h
  • IDS_COLUMN2 : resource.h , Resource.h
  • IDS_COLUMN3 : resource.h
  • IDS_COLUMN4 : resource.h
  • IDS_COLUMN5 : resource.h
  • IDS_COLUMN6 : resource.h
  • IDS_COLZERO : resrc1.h
  • IDS_COMINITFAILED : RemClien.h , ConClien.h , LocServe.h , ExeSkel.h , DComDraw.h , AptServe.h , LicClien.h , LocClien.h , AptClien.h , ComUser.h , DllClien.h , DllSkelI.h , DllUser.h , FreClien.h , RESDEF.h , register.h , StoClien.h , DcdServe.h , ReadTut.h
  • IDS_COMMAND_PROPERTIES : Resource.h
  • IDS_COMMENT : resrc1.h
  • IDS_COMMENT_GLYPHSTRING : resource.h
  • IDS_COMPARING : wdiffrc.h
  • IDS_COMPTITLE : FullIME.h
  • IDS_COMPUTER_BROWSER_CAPTION : resource.h
  • IDS_COMPUTER_DESC : resource.h
  • IDS_CONFIG_TAB : Resource.h
  • IDS_CONFIG_TITLE : Resource.h
  • IDS_CONFIGURED_EXTENSION : resource.h
  • IDS_CONFIGURED_RESTYPE : resource.h
  • IDS_CONFIGURING_RESTYPE : resource.h
  • IDS_CONFIGURING_RESTYPE_FAILED : resource.h
  • IDS_CONNECTBROKEN : Client32.h
  • IDS_CONNECTING : resource.h
  • IDS_CONTEXTSAMPLE_CONTEXT_TYPES_LABEL : resource.h
  • IDS_CONTEXTSAMPLE_OUTPUT_PATH_LABEL : resource.h
  • IDS_COPY : Resource.h
  • IDS_COPY_ABORTED : wdiffrc.h
  • IDS_COPY_COMPLETE : wdiffrc.h
  • IDS_COPY_FAILED : wdiffrc.h
  • IDS_COPY_FILES : wdiffrc.h
  • IDS_COPYING : wdiffrc.h
  • IDS_COPYING_NFILES : wdiffrc.h
  • IDS_COULDNT_FIND : wdiffrc.h
  • IDS_COULDNT_FIND_ANYTHING : wdiffrc.h
  • IDS_CPY3XMFTOCLP : MfEdit.h
  • IDS_CPYEMFTOCLP : MfEdit.h
  • IDS_CPYPALFAIL : MfEdit.h
  • IDS_CREATE_DIFF_LIST : wdiffrc.h
  • IDS_CREATEBITMAPFAIL : SpinCube.h
  • IDS_CREATEDCFAIL : SpinCube.h
  • IDS_CREATEICFAILURE : Resource.h , ComDlg32.h
  • IDS_CREMAPFILEFAIL : MfEdit.h
  • IDS_CREMFDCFAIL : MfEdit.h
  • IDS_CREPALFAIL : MfEdit.h
  • IDS_CREPBYTEFAIL : MfEdit.h
  • IDS_CREPNTFAIL : MfEdit.h
  • IDS_CREPRTDCFAIL : MfEdit.h
  • IDS_CREPRTTHRDFAIL : MfEdit.h
  • IDS_CUT : Resource.h
  • IDS_CVRESULTACTIVATEAS : OleStd.h
  • IDS_CVRESULTACTIVATEDIFF : OleStd.h
  • IDS_CVRESULTCONVERTLINK : OleStd.h
  • IDS_CVRESULTCONVERTTO : OleStd.h
  • IDS_CVRESULTDISPLAYASICON : OleStd.h
  • IDS_CVRESULTNOCHANGE : OleStd.h
  • IDS_DAYSFORMAT : resource.h
  • IDS_DBGTITLE : Monkey.h
  • IDS_DBPROP_ABORTPRESERVE : resource.h
  • IDS_DBPROP_ACTIVESESSIONS : resource.h
  • IDS_DBPROP_APPENDONLY : resource.h
  • IDS_DBPROP_ASYNCTXNABORT : resource.h
  • IDS_DBPROP_ASYNCTXNCOMMIT : resource.h
  • IDS_DBPROP_AUTH_CACHE_AUTHINFO : resource.h
  • IDS_DBPROP_AUTH_ENCRYPT_PASSWORD : resource.h
  • IDS_DBPROP_AUTH_INTEGRATED : resource.h
  • IDS_DBPROP_AUTH_MASK_PASSWORD : resource.h
  • IDS_DBPROP_AUTH_PASSWORD : resource.h
  • IDS_DBPROP_AUTH_PERSIST_ENCRYPTED : resource.h
  • IDS_DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO : resource.h
  • IDS_DBPROP_AUTH_USERID : resource.h
  • IDS_DBPROP_BLOCKINGSTORAGEOBJECTS : resource.h
  • IDS_DBPROP_BOOKMARKS : resource.h
  • IDS_DBPROP_BOOKMARKSKIPPED : resource.h
  • IDS_DBPROP_BOOKMARKTYPE : resource.h
  • IDS_DBPROP_BYREFACCESSORS : resource.h
  • IDS_DBPROP_CANFETCHBACKWARDS : resource.h
  • IDS_DBPROP_CANHOLDROWS : resource.h
  • IDS_DBPROP_CANSCROLLBACKWARDS : resource.h
  • IDS_DBPROP_CATALOGLOCATION : resource.h
  • IDS_DBPROP_CATALOGTERM : resource.h
  • IDS_DBPROP_CATALOGUSAGE : resource.h
  • IDS_DBPROP_CHANGEINSERTEDROWS : resource.h
  • IDS_DBPROP_COLUMNDEFINITION : resource.h
  • IDS_DBPROP_COLUMNRESTRICT : resource.h
  • IDS_DBPROP_COMMANDTIMEOUT : resource.h
  • IDS_DBPROP_COMMITPRESERVE : resource.h
  • IDS_DBPROP_CONCATNULLBEHAVIOR : resource.h
  • IDS_DBPROP_DATASOURCENAME : resource.h
  • IDS_DBPROP_DATASOURCEREADONLY : resource.h
  • IDS_DBPROP_DBMSNAME : resource.h
  • IDS_DBPROP_DBMSVER : resource.h
  • IDS_DBPROP_DELAYSTORAGEOBJECTS : resource.h
  • IDS_DBPROP_DSOTHREADMODEL : resource.h
  • IDS_DBPROP_GROUPBY : resource.h
  • IDS_DBPROP_HETEROGENEOUSTABLES : resource.h
  • IDS_DBPROP_IAccessor : resource.h
  • IDS_DBPROP_IColumnsInfo : resource.h
  • IDS_DBPROP_IColumnsRowset : resource.h
  • IDS_DBPROP_IConnectionPointContainer : resource.h
  • IDS_DBPROP_IConvertType : resource.h
  • IDS_DBPROP_IDENTIFIERCASE : resource.h
  • IDS_DBPROP_IMMOBILEROWS : resource.h
  • IDS_DBPROP_INIT_DATASOURCE : resource.h
  • IDS_DBPROP_INIT_HWND : resource.h
  • IDS_DBPROP_INIT_IMPERSONATION_LEVEL : resource.h
  • IDS_DBPROP_INIT_LCID : resource.h
  • IDS_DBPROP_INIT_LOCATION : resource.h
  • IDS_DBPROP_INIT_MODE : resource.h
  • IDS_DBPROP_INIT_OLEDBSERVICES : resource.h
  • IDS_DBPROP_INIT_PROMPT : resource.h
  • IDS_DBPROP_INIT_PROTECTION_LEVEL : resource.h
  • IDS_DBPROP_INIT_PROVIDERSTRING : resource.h
  • IDS_DBPROP_INIT_TIMEOUT : resource.h
  • IDS_DBPROP_IProvideMoniker : resource.h
  • IDS_DBPROP_IRowset : resource.h
  • IDS_DBPROP_IRowsetChange : resource.h
  • IDS_DBPROP_IRowsetIdentity : resource.h
  • IDS_DBPROP_IRowsetInfo : resource.h
  • IDS_DBPROP_IRowsetLocate : resource.h
  • IDS_DBPROP_IRowsetResynch : resource.h
  • IDS_DBPROP_IRowsetScroll : resource.h
  • IDS_DBPROP_IRowsetUpdate : resource.h
  • IDS_DBPROP_ISequentialStream : resource.h
  • IDS_DBPROP_ISupportErrorInfo : resource.h
  • IDS_DBPROP_LITERALBOOKMARKS : resource.h
  • IDS_DBPROP_LITERALIDENTITY : resource.h
  • IDS_DBPROP_LOCKMODES : resource.h
  • IDS_DBPROP_MAXINDEXSIZE : resource.h
  • IDS_DBPROP_MAXOPENROWS : resource.h
  • IDS_DBPROP_MAXPENDINGROWS : resource.h
  • IDS_DBPROP_MAXROWS : resource.h
  • IDS_DBPROP_MAXROWSIZE : resource.h
  • IDS_DBPROP_MAXROWSIZEINCLUDESBLOB : resource.h
  • IDS_DBPROP_MAXTABLESINSELECT : resource.h
  • IDS_DBPROP_MULTIPLEPARAMSETS : resource.h
  • IDS_DBPROP_MULTIPLERESULTS : resource.h
  • IDS_DBPROP_MULTIPLESTORAGEOBJECTS : resource.h
  • IDS_DBPROP_MULTITABLEUPDATE : resource.h
  • IDS_DBPROP_NOTIFICATIONPHASES : resource.h
  • IDS_DBPROP_NOTIFYCOLUMNSET : resource.h
  • IDS_DBPROP_NOTIFYROWDELETE : resource.h
  • IDS_DBPROP_NOTIFYROWFIRSTCHANGE : resource.h
  • IDS_DBPROP_NOTIFYROWINSERT : resource.h
  • IDS_DBPROP_NOTIFYROWRESYNCH : resource.h
  • IDS_DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE : resource.h
  • IDS_DBPROP_NOTIFYROWSETRELEASE : resource.h
  • IDS_DBPROP_NOTIFYROWUNDOCHANGE : resource.h
  • IDS_DBPROP_NOTIFYROWUNDODELETE : resource.h
  • IDS_DBPROP_NOTIFYROWUNDOINSERT : resource.h
  • IDS_DBPROP_NOTIFYROWUPDATE : resource.h
  • IDS_DBPROP_NULLCOLLATION : resource.h
  • IDS_DBPROP_OLEOBJECTS : resource.h
  • IDS_DBPROP_ORDERBYCOLUMNSINSELECT : resource.h
  • IDS_DBPROP_ORDEREDBOOKMARKS : resource.h
  • IDS_DBPROP_OTHERINSERT : resource.h
  • IDS_DBPROP_OTHERUPDATEDELETE : resource.h
  • IDS_DBPROP_OUTPUTPARAMETERAVAILABILITY : resource.h
  • IDS_DBPROP_OWNINSERT : resource.h
  • IDS_DBPROP_OWNUPDATEDELETE : resource.h
  • IDS_DBPROP_PERSISTENTIDTYPE : resource.h
  • IDS_DBPROP_PREPAREABORTBEHAVIOR : resource.h
  • IDS_DBPROP_PREPARECOMMITBEHAVIOR : resource.h
  • IDS_DBPROP_PROCEDURETERM : resource.h
  • IDS_DBPROP_PROVIDERNAME : resource.h
  • IDS_DBPROP_PROVIDEROLEDBVER : resource.h
  • IDS_DBPROP_PROVIDERVER : resource.h
  • IDS_DBPROP_QUICKRESTART : resource.h
  • IDS_DBPROP_QUOTEDIDENTIFIERCASE : resource.h
  • IDS_DBPROP_REENTRANTEVENTS : resource.h
  • IDS_DBPROP_REMOVEDELETED : resource.h
  • IDS_DBPROP_REPORTMULTIPLECHANGES : resource.h
  • IDS_DBPROP_RETURNPENDINGINSERTS : resource.h
  • IDS_DBPROP_ROWRESTRICT : resource.h
  • IDS_DBPROP_ROWSETCONVERSIONSONCOMMAND : resource.h
  • IDS_DBPROP_ROWTHREADMODEL : resource.h
  • IDS_DBPROP_SCHEMATERM : resource.h
  • IDS_DBPROP_SCHEMAUSAGE : resource.h
  • IDS_DBPROP_SERVERCURSOR : resource.h
  • IDS_DBPROP_SESS_AUTOCOMMITISOLEVELS : resource.h
  • IDS_DBPROP_SQLSUPPORT : resource.h
  • IDS_DBPROP_STRONGIDENTITY : resource.h
  • IDS_DBPROP_STRUCTUREDSTORAGE : resource.h
  • IDS_DBPROP_SUBQUERIES : resource.h
  • IDS_DBPROP_SUPPORTEDTXNDDL : resource.h
  • IDS_DBPROP_SUPPORTEDTXNISOLEVELS : resource.h
  • IDS_DBPROP_SUPPORTEDTXNISORETAIN : resource.h
  • IDS_DBPROP_TABLETERM : resource.h
  • IDS_DBPROP_TRANSACTEDOBJECT : resource.h
  • IDS_DBPROP_UPDATABILITY : resource.h
  • IDS_DBPROP_USERNAME : resource.h
  • IDS_DEBUG : Monkey.h
  • IDS_DEBUG_EVENTS : Deb.h
  • IDS_DEBUGINFO : Server32.h
  • IDS_DEBUGLAST : Server32.h
  • IDS_DEBUGTITLE : Server32.h , Client32.h
  • IDS_DEFAULT_PRODUCT : resource.h
  • IDS_DEFICONLABEL : OleStd.h
  • IDS_DELETE : Resource.h
  • IDS_DESCRIPTION : Globals.h , Resource.h , resrc1.h , GLOBALS.h
  • IDS_DIALOGFAILURE : Resource.h , ComDlg32.h
  • IDS_DIFF_BLANK_ONLY : wdiffrc.h
  • IDS_DIFFERENT : wdiffrc.h
  • IDS_DIFFERING : wdiffrc.h
  • IDS_DISK : resource.h
  • IDS_DISPLAY : Resource.h
  • IDS_DISPLAYCHANGED : Generic.H , LeakyBin.h , StatList.h
  • IDS_DISPLAYERRORCODE : resource.h
  • IDS_DLGABOUTCREFAIL : MfEdit.h
  • IDS_DLGBOXFAIL : SpinCube.h
  • IDS_DLLINITFAILED : DllSkelI.h
  • IDS_DLLNAME : Resource.h
  • IDS_DLLREG_FAIL : register.h
  • IDS_DLLUNREG_FAIL : register.h
  • IDS_DNDMMISMATCH : ComDlg32.h , Resource.h
  • IDS_DOCSTRINGComSpyPropPage : Resource.h
  • IDS_DOCSTRINGContextSamplePropPage : resource.h
  • IDS_DOCUMENTTYPE : Resource.h
  • IDS_DOWNLOADING_PACKAGE : resource.h
  • IDS_DOWNLOADING_UPDATE : resource.h
  • IDS_DRAW_PAGE : RESDEF.h
  • IDS_DRAWING_CHANGED : DComDraw.h , StoClien.h
  • IDS_DRAWSFCLR : MfEdit.h
  • IDS_E_UNEXPECTED : Resource.h
  • IDS_EDITMENU : GLOBALS.h
  • IDS_EDITOR_COMMAND : wdiffrc.h
  • IDS_ELLIPSE : MfEdit.h
  • IDS_EMF : MfEdit.h
  • IDS_EMPTYVC_SUBKEY : Resource.h
  • IDS_ENTER_DIR_NAME : wdiffrc.h
  • IDS_ENTER_PASSWORD : wdiffrc.h
  • IDS_ENTER_SUBSTRING1 : wdiffrc.h
  • IDS_ENTER_SUBSTRING2 : wdiffrc.h
  • IDS_ENTIRESCRN : Resource.h
  • IDS_ENUMELEMENTSFAILED : DfV.h
  • IDS_ENUMPRT1FAIL : Resource.h
  • IDS_ENUMPRTDRVRET0 : Resource.h
  • IDS_ENUMPRTFAIL : Resource.h
  • IDS_ENUMPRTLALLOCFAIL : Resource.h
  • IDS_ENUMSTATSTGFAILED : DfV.h
  • IDS_ENUMSTORAGERESOURCE_DESC : resource.h
  • IDS_ERR_ADDSTRING : OleStd.h
  • IDS_ERR_ENUMPRT : Resource.h
  • IDS_ERR_GETCAPS : Resource.h
  • IDS_ERR_GETLINKSOURCE : OleStd.h
  • IDS_ERR_GETLINKUPDATEOPTIONS : OleStd.h
  • IDS_ERR_GETPDRIV : Resource.h
  • IDS_ERR_OPENING_FILE : wdiffrc.h
  • IDS_ERR_PAINT : Resource.h
  • IDS_ERR_PRINTER : Resource.h
  • IDS_ERROR : DfV.h , resource.h , MfEdit.h
  • IDS_ERROR_CANTLOADRICHEDIT : wdiffrc.h
  • IDS_ERROR_DISK_CLUSTER_CAPABLE : resource.h
  • IDS_ERROR_DISK_CLUSTER_CAPABLE_REF : resource.h
  • IDS_ERROR_DISK_NO_FILE_SYSTEM : resource.h
  • IDS_ERROR_DISK_NO_FILE_SYSTEM_REF : resource.h
  • IDS_ERROR_DISK_SIGNATURE : resource.h
  • IDS_ERROR_DISK_SIGNATURE_REF : resource.h
  • IDS_ERROR_FOUND_NON_SCSI_DISK : resource.h
  • IDS_ERROR_FOUND_NON_SCSI_DISK_REF : resource.h
  • IDS_ERROR_GET_IMAGE_DLG : resource.h
  • IDS_ERROR_GETCOMPUTERNAME_FAILED : resource.h
  • IDS_ERROR_IARGS : wdiffrc.h
  • IDS_ERROR_IARGS_OPENFILE : wdiffrc.h
  • IDS_ERROR_INVALIDARG : resource.h
  • IDS_ERROR_INVALIDARG_REF : resource.h
  • IDS_ERROR_L_OPTION : wdiffrc.h
  • IDS_ERROR_LD_OPTION : wdiffrc.h
  • IDS_ERROR_LDM_DISK : resource.h
  • IDS_ERROR_LDM_DISK_REF : resource.h
  • IDS_ERROR_LO_UNC : wdiffrc.h
  • IDS_ERROR_MSG_ID : resource.h
  • IDS_ERROR_NO_INTERFACE : resource.h
  • IDS_ERROR_NULL_POINTER : resource.h
  • IDS_ERROR_NULL_POINTER_REF : resource.h
  • IDS_ERROR_OUTOFMEMORY : resource.h
  • IDS_ERROR_OUTOFMEMORY_REF : resource.h
  • IDS_ERROR_OVSD_OPTION : wdiffrc.h
  • IDS_ERROR_SETTING_PROPERTIES : resource.h
  • IDS_ERROR_TITLE : register.h , ReadTut.h
  • IDS_ERROR_VALIDATING_PROPERTIES : resource.h
  • IDS_ERROR_WBEM_CONNECTION_FAILURE : resource.h
  • IDS_ERROR_WBEM_CONNECTION_FAILURE_REF : resource.h
  • IDS_ERROR_WMI_DISKDRIVEPARTITIONS_QRY_FAILED : resource.h
  • IDS_ERROR_WMI_DISKDRIVEPARTITIONS_QRY_FAILED_REF : resource.h
  • IDS_ERROR_WMI_DISKS_QRY_FAILED : resource.h
  • IDS_ERROR_WMI_DISKS_QRY_FAILED_REF : resource.h
  • IDS_ERROR_WMI_GET_LOGICALDISK_FAILED : resource.h
  • IDS_ERROR_WMI_GET_LOGICALDISK_FAILED_REF : resource.h
  • IDS_ERROR_WQL_QRY_NEXT_FAILED : resource.h
  • IDS_ERROR_WQL_QRY_NEXT_FAILED_REF : resource.h
  • IDS_ERRORBOXTITLE : resource.h
  • IDS_ERRORCODE : Server32.h
  • IDS_ESCPRT : MfEdit.h
  • IDS_EVENTNAME : resrc1.h
  • IDS_EXEFILTERSTRING : Resource.h
  • IDS_EXERUN_FAIL : register.h
  • IDS_EXIT : wdiffrc.h
  • IDS_EXIT_BOX_TEXT : Deb.h
  • IDS_EXIT_BOX_TITLE : Deb.h
  • IDS_EXPAND : wdiffrc.h
  • IDS_EXPERTNAME : resrc1.h
  • IDS_EXPLORE : Resource.h
  • IDS_EXT_TITLE : Resource.h
  • IDS_FAILED : OleStd.h
  • IDS_FAILED_TO_COPY : wdiffrc.h
  • IDS_FAILED_TO_LAUNCH_EDT : wdiffrc.h
  • IDS_FAILED_TO_UPGRADE_MSI : resource.h
  • IDS_FATALERROR : resource.h
  • IDS_FILE_CHANGED : RESDEF.h
  • IDS_FILE_DOESNT_EXIST : wdiffrc.h
  • IDS_FILEDLGTITLE : resource.h
  • IDS_FILEMENU : GLOBALS.h
  • IDS_FILEOPNFAIL : MfEdit.h
  • IDS_FILES_LISTED : wdiffrc.h
  • IDS_FILLELLIPSE : MfEdit.h
  • IDS_FILLRECT : MfEdit.h
  • IDS_FILTER : Resource.h
  • IDS_FILTERS : OleStd.h
  • IDS_FILTERSTRING : Resource.h , MciPlay.h , ComDlg32.h , Resource.h
  • IDS_FIND_NOTFOUND : wdiffrc.h
  • IDS_FINDRESFAILURE : ComDlg32.h , Resource.h
  • IDS_FM_DIB : MfEdit.h
  • IDS_FM_EMF : MfEdit.h
  • IDS_FM_EPS : MfEdit.h
  • IDS_FM_RLE : MfEdit.h
  • IDS_FM_WMF : MfEdit.h
  • IDS_FMT_CREDCFAIL : Resource.h
  • IDS_FMT_CREMAPFILEFAIL : MfEdit.h
  • IDS_FMT_FILEOPNFAIL : MfEdit.h
  • IDS_FMT_GETMFFAIL : MfEdit.h
  • IDS_FMT_HIT : MfEdit.h
  • IDS_FMT_MAPVWMAPFOFAIL : MfEdit.h
  • IDS_FMT_MOREDSPFNTNL : Resource.h
  • IDS_FMT_NOHTST : MfEdit.h
  • IDS_FMT_OPNPRTFAIL : Resource.h
  • IDS_FMT_PLAYEMFFAIL : MfEdit.h
  • IDS_FMT_PLAYMF : MfEdit.h
  • IDS_FMT_PLAYMFFAIL : MfEdit.h
  • IDS_FMT_SETWMFBTSFAIL : MfEdit.h
  • IDS_FMT_SETWMFBTSXFAIL : MfEdit.h
  • IDS_FOLDER : Resource.h
  • IDS_FOLDER_DATA : Resource.h
  • IDS_FOREGROUND : resource.h
  • IDS_FROM_DSN : resource.h
  • IDS_FT_DIB : MfEdit.h
  • IDS_FT_EMF : MfEdit.h
  • IDS_FT_EPS : MfEdit.h
  • IDS_FT_RLE : MfEdit.h
  • IDS_FT_WMF : MfEdit.h
  • IDS_GENERALERROR : Client32.h
  • IDS_GESTURE_UNKNOWN : resource.h
  • IDS_GET3XFRMCLPFAIL : MfEdit.h
  • IDS_GETBNDBOTFAIL : MfEdit.h
  • IDS_GETBNDLFTFAIL : MfEdit.h
  • IDS_GETBNDRGTFAIL : MfEdit.h
  • IDS_GETBNDTOPFAIL : MfEdit.h
  • IDS_GETDCFAIL : Resource.h
  • IDS_GETDEVMODEFAIL : ComDlg32.h , Resource.h
  • IDS_GETEMFFROMCLPFAIL : MfEdit.h
  • IDS_GETIAUDIO : Resource.h
  • IDS_GETMFBTSXFAIL : MfEdit.h
  • IDS_GETMFBTSXFAIL2 : MfEdit.h
  • IDS_GETPRTDRVFAIL : Resource.h
  • IDS_GETRECEIPT_DESC : resource.h , Resource.h
  • IDS_GETWMFBTSFAIL : MfEdit.h
  • IDS_GETWMFBTSFAIL2 : MfEdit.h
  • IDS_GETWMFBTSFAIL2X : MfEdit.h
  • IDS_GIGAFORMAT : resource.h
  • IDS_GLOBALDEV : resource.h , res.h
  • IDS_GOTOLINE_INVALIDSTRING : wdiffrc.h
  • IDS_GOTOLINE_NOLINES : wdiffrc.h
  • IDS_GPT : resource.h
  • IDS_GROUP_MENU_ITEM_1 : resource.h
  • IDS_GROUP_MENU_ITEM_1_DESC : resource.h
  • IDS_H3ABS_GLYPHSTRING : resource.h
  • IDS_H3BGN_GLYPHSTRING : resource.h
  • IDS_H3END_GLYPHSTRING : resource.h
  • IDS_H4_GLYPHSTRING : resource.h
  • IDS_HANDLER_DESC1 : resource.h
  • IDS_HEADER_LINE_STR : wdiffrc.h
  • IDS_HEADERFONT : APP.h
  • IDS_HELLOCOUNTFMT : DllSkelI.h
  • IDS_HELLOTITLE : DllSkelI.h
  • IDS_HELLOWORLD_DESC : resource.h
  • IDS_HELPFILE : resource.h , Resource.h , resource.h
  • IDS_HELPFILEComSpyPropPage : Resource.h
  • IDS_HELPFILEContextSamplePropPage : resource.h
  • IDS_HELPMENU : GLOBALS.h
  • IDS_HFTONEPALNULL : MfEdit.h
  • IDS_HIGH : resource.h
  • IDS_HMS : MidiPlyr.h
  • IDS_HOURSFORMAT : resource.h
  • IDS_HUMAN_DESC : resource.h
  • IDS_IAFMT : Resource.h
  • IDS_ICONFILTERS : OleStd.h
  • IDS_IDENTICAL : wdiffrc.h
  • IDS_IDENTICAL_COMMA : wdiffrc.h
  • IDS_IDENTICAL_TIMES : wdiffrc.h
  • IDS_INCORRECT_UPDATE : resource.h
  • IDS_INFO_BOOTDISK_PRUNED : resource.h
  • IDS_INFO_BOOTDISK_PRUNED_REF : resource.h
  • IDS_INFO_CRASHDUMPDISK_PRUNED : resource.h
  • IDS_INFO_CRASHDUMPDISK_PRUNED_REF : resource.h
  • IDS_INFO_DISK_CLUSTER_CAPABLE : resource.h
  • IDS_INFO_DISK_CREATE : resource.h
  • IDS_INFO_DISK_NOT_CLUSTER_CAPABLE : resource.h
  • IDS_INFO_DISK_NOT_CLUSTER_CAPABLE_REF : resource.h
  • IDS_INFO_DISK_PRECREATE : resource.h
  • IDS_INFO_GPT_DISK : resource.h
  • IDS_INFO_GPT_DISK_REF : resource.h
  • IDS_INFO_NON_SCSI_DISKS : resource.h
  • IDS_INFO_NON_SCSI_DISKS_REF : resource.h
  • IDS_INFO_PAGEFILEDISK_PRUNED : resource.h
  • IDS_INFO_PAGEFILEDISK_PRUNED_REF : resource.h
  • IDS_INFO_PRUNING_BOOTDISK_BUS : resource.h
  • IDS_INFO_PRUNING_CRASHDUMP_BUS : resource.h
  • IDS_INFO_PRUNING_PAGEFILEDISK_BUS : resource.h
  • IDS_INFO_PRUNING_SYSTEMDISK_BUS : resource.h
  • IDS_INFO_SYSTEMDISK_PRUNED : resource.h
  • IDS_INFO_SYSTEMDISK_PRUNED_REF : resource.h
  • IDS_INH_ALL : Resource.h
  • IDS_INH_CONTAINER : Resource.h
  • IDS_INH_NONE : Resource.h
  • IDS_INH_OBJECT : Resource.h
  • IDS_INITAPPFAIL : MfEdit.h
  • IDS_INITFAILURE : ComDlg32.h , Resource.h
  • IDS_INITIALIZATION : ComDlg32.h , Resource.h
  • IDS_INITIALIZING : resrc1.h
  • IDS_INSERTSTRINGFAILED : DfV.h
  • IDS_INSTALL_ERROR : resource.h
  • IDS_INTERROR : Resource.h
  • IDS_INVALID : PlgBlt.h
  • IDS_INVALID_OPERATION : resource.h
  • IDS_INVALID_PATH : resource.h
  • IDS_INVALID_VER_STR : resource.h
  • IDS_INVALIDFILENAME : ComDlg32.h , Resource.h
  • IDS_INVALIDSOURCE : OleStd.h
  • IDS_IORESULTFROMFILE1 : OleStd.h
  • IDS_IORESULTFROMFILE2 : OleStd.h
  • IDS_IORESULTFROMFILEICON2 : OleStd.h
  • IDS_IORESULTLINKFILE1 : OleStd.h
  • IDS_IORESULTLINKFILE2 : OleStd.h
  • IDS_IORESULTLINKFILEICON1 : OleStd.h
  • IDS_IORESULTLINKFILEICON2 : OleStd.h
  • IDS_IORESULTNEW : OleStd.h
  • IDS_IORESULTNEWICON : OleStd.h
  • IDS_IS_MORE_RECENT : wdiffrc.h
  • IDS_IS_READONLY : wdiffrc.h
  • IDS_ITEM : Resource.h
  • IDS_ITEMCONFIG_TAB : Resource.h
  • IDS_JUSTIFICATION_FORMAT : resrc1.h
  • IDS_KILOFORMAT : resource.h
  • IDS_LABELFONT : APP.h
  • IDS_LALLOCFAIL : Resource.h
  • IDS_LDBM : MfEdit.h
  • IDS_LDM : resource.h
  • IDS_LDMF : MfEdit.h
  • IDS_LDMFMTFILEFAIL : MfEdit.h
  • IDS_LDMSK : MfEdit.h
  • IDS_LDMSKBM : MfEdit.h
  • IDS_LEFT_ONLY_COMMA : wdiffrc.h
  • IDS_LEFT_UNREADABLE : wdiffrc.h
  • IDS_LINE_NOT_VISIBLE : wdiffrc.h
  • IDS_LINK_AUTO : OleStd.h
  • IDS_LINK_MANUAL : OleStd.h
  • IDS_LINK_UNKNOWN : OleStd.h
  • IDS_LINKS : OleStd.h
  • IDS_LN : MfEdit.h
  • IDS_LOADACCFAIL : MfEdit.h
  • IDS_LOADBITMAPSFAILED : DfV.h
  • IDS_LOADDRVFAILURE : ComDlg32.h , Resource.h
  • IDS_LOADLIB_FAIL : register.h
  • IDS_LOADRESFAILURE : Resource.h , ComDlg32.h
  • IDS_LOADSTRFAILURE : Resource.h , ComDlg32.h
  • IDS_LOCKRESFAILURE : Resource.h , ComDlg32.h
  • IDS_LOGTO_CLIENT : AptServe.h , LocServe.h
  • IDS_LOGTO_SERVER : AptServe.h , LocServe.h
  • IDS_LONGPROGRESS : resource.h
  • IDS_LOW : resource.h
  • IDS_MACHINE : resrc1.h
  • IDS_MAIN_WINDOW_TITLE : resource.h
  • IDS_MAINWINDOWTITLE : Resource.h
  • IDS_MAINWNDTITLE : Resource.h
  • IDS_MALLOCERR : Monkey.h
  • IDS_MALLOCFAIL : MfEdit.h
  • IDS_MALLOCFAIL2 : MfEdit.h
  • IDS_MALLOCFAILNOHIT : MfEdit.h
  • IDS_MAPFCREFAIL : MfEdit.h
  • IDS_MAPVWMAPFOFAIL : MfEdit.h
  • IDS_MAPVWOFMAPFOFAIL : MfEdit.h
  • IDS_MARK_FILES : wdiffrc.h
  • IDS_MAX : resource.h , Resource.h
  • IDS_MEGAFORMAT : resource.h
  • IDS_MEMALLOCFAILURE : Resource.h , ComDlg32.h
  • IDS_MEMLOCKFAILURE : ComDlg32.h , Resource.h
  • IDS_MEMORY_ALLOC_FAIL : gutilsrc.h
  • IDS_MFDEMOCL : MfEdit.h
  • IDS_MI_COMMAND : Resource.h
  • IDS_MI_FILEITEM : Resource.h
  • IDS_MIN : Resource.h
  • IDS_MINUTESFORMAT : resource.h
  • IDS_MISSING_RESOURCE : resource.h
  • IDS_MODIFY_DATA : Resource.h
  • IDS_MONITORSERVER_DESC : Resource.h
  • IDS_MONOCHROME : PlgBlt.h
  • IDS_MOVEMONEY_DESC : Resource.h , resource.h , Resource.h
  • IDS_MSGCAPTION : APP.h
  • IDS_MSGCHOOSEOPEN : Resource.h
  • IDS_MSGEMPTY : Resource.h
  • IDS_MSGESTURE_FIRST : resource.h
  • IDS_MSGFILE : Resource.h
  • IDS_MSGFILEEXIT : Resource.h
  • IDS_MSGFILEOPENAS : Resource.h
  • IDS_MSGFILEPAGESETUP : Resource.h
  • IDS_MSGFILEPRINT : Resource.h
  • IDS_MSGHELP : Resource.h
  • IDS_MSGHELPABOUT : Resource.h
  • IDS_MSGHELPCONTENTS : Resource.h
  • IDS_MSGREADY : Resource.h
  • IDS_MSGSYS : Resource.h
  • IDS_MSGSYSCLOSE : Resource.h
  • IDS_MSGSYSMAXIMIZE : Resource.h
  • IDS_MSGSYSMINIMIZE : Resource.h
  • IDS_MSGSYSMOVE : Resource.h
  • IDS_MSGSYSRESTORE : Resource.h
  • IDS_MSGSYSSIZE : Resource.h
  • IDS_MSGSYSTASKLIST : Resource.h
  • IDS_MSGTIPFONTDEC : Resource.h
  • IDS_MSGTIPFONTINC : Resource.h
  • IDS_MSGVIEW : Resource.h
  • IDS_MSGVIEWFONT : Resource.h
  • IDS_MSGVIEWSTATUSBAR : Resource.h
  • IDS_MSGVIEWTOOLBAR : Resource.h
  • IDS_MSTLBCLKFORBZ : MfEdit.h
  • IDS_MUIWEB : resource.h , res.h
  • IDS_MULTILINGUAL : res.h , resource.h
  • IDS_MUST3CLKFORBM : MfEdit.h
  • IDS_MUST3CLKFORXMF : MfEdit.h
  • IDS_MUSTESCHTSTMD : MfEdit.h
  • IDS_MUSTMSKMCHROMEBM : MfEdit.h
  • IDS_MUSTNOTEOF : MfEdit.h
  • IDS_NAME : resource.h , Resource.h , resource.h , Monkey.h , resource.h
  • IDS_NETINTERFACE_MENU_ITEM_1 : resource.h
  • IDS_NETINTERFACE_MENU_ITEM_1_DESC : resource.h
  • IDS_NETWORK_MENU_ITEM_1 : resource.h
  • IDS_NETWORK_MENU_ITEM_1_DESC : resource.h
  • IDS_NEW : Resource.h
  • IDS_NEW_FOLDER : Resource.h
  • IDS_NEW_ITEM : Resource.h
  • IDS_NLSWEB : resource.h , res.h
  • IDS_NO_HELP : Generic.H , LeakyBin.h , StatList.h
  • IDS_NO_MORE_CHANGES : wdiffrc.h
  • IDS_NO_PREV_CHANGES : wdiffrc.h
  • IDS_NO_WINTRUST : resource.h
  • IDS_NOBMFOREMBED : MfEdit.h
  • IDS_NOCOMPUNICODE : wdiffrc.h
  • IDS_NODCOM : DcdServe.h , FreClien.h , RemClien.h , DComDraw.h
  • IDS_NODE_MENU_ITEM_1 : resource.h
  • IDS_NODE_MENU_ITEM_1_DESC : resource.h
  • IDS_NODEFAULTPRN : ComDlg32.h , Resource.h
  • IDS_NODEVICES : ComDlg32.h , Resource.h
  • IDS_NODLLSERVER : LicClien.h
  • IDS_NOFILE : MidiPlyr.h
  • IDS_NOFONTS : ComDlg32.h , Resource.h
  • IDS_NOHELP : Resource.h
  • IDS_NOHELPFILE : LocServe.h , AptServe.h , DllSkelI.h , DcdServe.h , DfV.h
  • IDS_NOHINSTANCE : ComDlg32.h , Resource.h
  • IDS_NOHIT : MfEdit.h
  • IDS_NOHOOK : Resource.h , ComDlg32.h
  • IDS_NOHTTPORHTTPS : resource.h
  • IDS_NOIMAGE : Resource.h
  • IDS_NOINFO3XMFX : MfEdit.h
  • IDS_NOLICENSE : LicClien.h
  • IDS_NOLICSERVER : LicClien.h
  • IDS_NOMEM : Demo.h
  • IDS_NOMFFORCPY : MfEdit.h
  • IDS_NOMFFOREMBED : MfEdit.h
  • IDS_NOMFFORPLAY : MfEdit.h
  • IDS_NOMFFORPRT : MfEdit.h
  • IDS_NOMFLDFORHTST : MfEdit.h
  • IDS_NOMFTOPRT : MfEdit.h
  • IDS_NOMSI : resource.h
  • IDS_NONAME : Monkey.h
  • IDS_NOOPEN : MciPlay.h
  • IDS_NOPALENTRYFORCPY : MfEdit.h
  • IDS_NOPRTLST : Resource.h
  • IDS_NORMAL : resource.h
  • IDS_NORUNLICENSE : LicClien.h
  • IDS_NOSERVER : LocClien.h , DComDraw.h , AptServe.h , ConClien.h , DcdServe.h , FreClien.h , RemClien.h , LocServe.h , StoClien.h , RESDEF.h , DllClien.h , AptClien.h
  • IDS_NOTADOBE : MfEdit.h
  • IDS_NOTDIBBMFILE : MfEdit.h
  • IDS_NOTEMPLATE : Resource.h , ComDlg32.h
  • IDS_NOTHING_RESCANNED : wdiffrc.h
  • IDS_NOTHING_TO_EDIT : wdiffrc.h
  • IDS_NOTIMPLEM : APP.h
  • IDS_NOTIMPLEMENTED : DllUser.h , LocServe.h , DcdServe.h , DComDraw.h , FreClien.h , ExeSkel.h , register.h , LocClien.h , StoClien.h , LicClien.h , RESDEF.h , AptClien.h , DllClien.h , AptServe.h , ConClien.h , DllSkelI.h , ReadTut.h , RemClien.h , ComUser.h
  • IDS_NOUNICODE : DComDraw.h , DcdServe.h , RESDEF.h , DllClien.h , AptServe.h , ConClien.h , RemClien.h , LocServe.h , LocClien.h , FreClien.h , LicClien.h , AptClien.h , StoClien.h
  • IDS_NOUPDATE : resource.h
  • IDS_NTONLY : PlgBlt.h , WxForm.h
  • IDS_NULLPTR : MfEdit.h
  • IDS_NULLRGNHTSTFAIL : MfEdit.h
  • IDS_OFN_DEBUGGEE_TITLE : Deb.h
  • IDS_OFN_FILTER : Deb.h
  • IDS_OFN_FILTERNAME : Deb.h
  • IDS_OFN_PAGFILES : RESDEF.h
  • IDS_OFN_PAGOPEN : RESDEF.h
  • IDS_OFN_PAGSAVE : RESDEF.h
  • IDS_OFN_PAPFILES : StoClien.h
  • IDS_OFN_PAPOPEN : StoClien.h
  • IDS_OFN_PAPSAVE : StoClien.h
  • IDS_OFN_TITLE : Deb.h
  • IDS_OLE2UICONVERT : OleStd.h
  • IDS_OLE2UIEDIT : OleStd.h
  • IDS_OLE2UIEDITLINKCMD_1VERB : OleStd.h
  • IDS_OLE2UIEDITLINKCMD_NVERB : OleStd.h
  • IDS_OLE2UIEDITNOOBJCMD : OleStd.h
  • IDS_OLE2UIEDITOBJECTCMD_1VERB : OleStd.h
  • IDS_OLE2UIEDITOBJECTCMD_NVERB : OleStd.h
  • IDS_OLE2UILINK : OleStd.h
  • IDS_OLE2UIOBJECT : OleStd.h
  • IDS_OLE2UIPASTELINKEDTYPE : OleStd.h
  • IDS_OLE2UIUNKNOWN : OleStd.h
  • IDS_OLEINCOMPATIBLE : DfV.h
  • IDS_OLEINITFAILED : DfV.h
  • IDS_OLESTDDISKFULL : OleStd.h
  • IDS_OLESTDNOCREATEFILE : OleStd.h
  • IDS_OLESTDNOOPENFILE : OleStd.h
  • IDS_ONLY_IN : wdiffrc.h
  • IDS_OPEN : Resource.h
  • IDS_OPENDRAWPAGE : RESDEF.h
  • IDS_OPENED : MidiPlyr.h
  • IDS_OPENFAILED : MidiPlyr.h
  • IDS_OPENKEYERR : Monkey.h
  • IDS_OPENSTORAGEFAILED : DfV.h
  • IDS_OPENSTREAMFAILED : DfV.h
  • IDS_OPENTEXTPAGE : RESDEF.h
  • IDS_OS_NOT_SUPPORTED : resource.h
  • IDS_OUT_OF_MEMORY : gutilsrc.h
  • IDS_OUTLINE : wdiffrc.h
  • IDS_OUTOFMEM : resource.h
  • IDS_OUTOFMEMORY : StoClien.h , LicClien.h , LocClien.h , LocServe.h , register.h , DllSkelI.h , DllUser.h , ExeSkel.h , AptClien.h , DfV.h , ConClien.h , RemClien.h , DComDraw.h , AptServe.h , RESDEF.h , ReadTut.h , DcdServe.h , DllClien.h , ComUser.h , FreClien.h
  • IDS_PAGE : wdiffrc.h
  • IDS_PAGE_STR : gutilsrc.h
  • IDS_PAGEFULL : RESDEF.h
  • IDS_PALNULL : MfEdit.h
  • IDS_PARSEFAILURE : Resource.h , ComDlg32.h
  • IDS_PARTITIONINFO_DESC : resource.h
  • IDS_PASTE : Resource.h
  • IDS_PAUSED : MidiPlyr.h
  • IDS_PBEG_GLYPHSTRING : resource.h
  • IDS_PEN : MfEdit.h
  • IDS_PEND_GLYPHSTRING : resource.h
  • IDS_PLAYING : MidiPlyr.h
  • IDS_PLEASE_WAIT : wdiffrc.h
  • IDS_PLUGIN_PROPS_ERROR : resource.h
  • IDS_POWER_DESC : Resource.h
  • IDS_PREROLLED : MidiPlyr.h
  • IDS_PREROLLFAILED : MidiPlyr.h
  • IDS_PREROLLING : MidiPlyr.h
  • IDS_PRINTERNOTFOUND : ComDlg32.h , Resource.h
  • IDS_PRINTERR : APP.h
  • IDS_PRINTMSG : Dibdll.h
  • IDS_PRIV_ALL : Resource.h
  • IDS_PRIV_DELETE : Resource.h
  • IDS_PRIV_MODIFY : Resource.h
  • IDS_PRIV_READ : Resource.h
  • IDS_PRIV_ROOT : Resource.h
  • IDS_PROGNAME : Resource.h
  • IDS_PROJNAME : resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h , Resource.h , resource.h
  • IDS_PRT : MfEdit.h
  • IDS_PRTDLGFAIL : Resource.h
  • IDS_PRTTHRDDONE : MfEdit.h
  • IDS_PRTTST : Resource.h
  • IDS_PSNONOLE : OleStd.h
  • IDS_PSPASTEDATA : OleStd.h
  • IDS_PSPASTELINKDATA : OleStd.h
  • IDS_PSPASTELINKOBJECT : OleStd.h
  • IDS_PSPASTELINKOBJECTASICON : OleStd.h
  • IDS_PSPASTEOBJECT : OleStd.h
  • IDS_PSPASTEOBJECTASICON : OleStd.h
  • IDS_PST3XMF : MfEdit.h
  • IDS_PST_LANDBASED : resource.h
  • IDS_PST_ROCKET : resource.h
  • IDS_PST_ROCKET_EXT : resource.h
  • IDS_PSTEMF : MfEdit.h
  • IDS_PSUNKNOWNAPP : OleStd.h
  • IDS_PSUNKNOWNSRC : OleStd.h
  • IDS_PSUNKNOWNTYPE : OleStd.h
  • IDS_QUERYDONE : QSample.Hxx
  • IDS_QUERYFAILED : QSample.Hxx
  • IDS_QUERYTIMEDOUT : QSample.Hxx
  • IDS_QUEUED : resource.h
  • IDS_RAFMT : Resource.h
  • IDS_READERROR : Server32.h
  • IDS_READFAILED : Client32.h
  • IDS_REBOOT_REQUIRED : resource.h
  • IDS_REC : MfEdit.h
  • IDS_RECT : MfEdit.h
  • IDS_RECT2 : Resource.h
  • IDS_RECT3 : Resource.h
  • IDS_REGBIGEND : Monkey.h
  • IDS_REGBIN : Monkey.h
  • IDS_REGCLASSFAIL : SpinTest.h , SpinCube.h
  • IDS_REGDWORD : Monkey.h
  • IDS_REGENUMERR : Monkey.h
  • IDS_REGERR : Monkey.h
  • IDS_REGEXPSZ : Monkey.h
  • IDS_REGFULLDESC : Monkey.h
  • IDS_REGKEY_COLUMNPROVIDER : Resource.h
  • IDS_REGLINK : Monkey.h
  • IDS_REGMULTI : Monkey.h
  • IDS_REGNONE : Monkey.h
  • IDS_REGOPENERR : Monkey.h
  • IDS_REGQUERYERR : Monkey.h
  • IDS_REGRESLST : Monkey.h
  • IDS_REGSZ : Monkey.h
  • IDS_REGUNDEFINE : Monkey.h
  • IDS_RENAME : Resource.h
  • IDS_RENDER_STREAM : Resource.h
  • IDS_REQUIRED_FIELD_EMPTY : resource.h
  • IDS_REQUIRES_ADMIN_PRIV : resource.h
  • IDS_REQUIRES_NEWER_VERSION : resource.h
  • IDS_RESDLL_VER : version.h , sampver.h
  • IDS_RESOURCE_DESCRIPTION : resource.h
  • IDS_RESOURCE_MENU_ITEM_1 : resource.h
  • IDS_RESOURCE_MENU_ITEM_1_DESC : resource.h
  • IDS_RESOURCE_MENU_ITEM_CALL_ISALIVE : resource.h
  • IDS_RESOURCE_MENU_ITEM_CALL_ISALIVE_DESC : resource.h
  • IDS_RESTART : res.h , resource.h
  • IDS_RESTYPE_DISPLAYNAME : Resource.h , resource.h
  • IDS_RESTYPE_MENU_ITEM_1 : resource.h
  • IDS_RESTYPE_MENU_ITEM_1_DESC : resource.h
  • IDS_RETDEFFAILURE : Resource.h , ComDlg32.h
  • IDS_RIGHT_ONLY_COMMA : wdiffrc.h
  • IDS_RIGHT_UNREADABLE : wdiffrc.h
  • IDS_ROWSET_STAT_CONTENT_OUT_OF_DATE : QSample.Hxx
  • IDS_ROWSET_STAT_CONTENT_QUERY_INCOMPLETE : QSample.Hxx
  • IDS_ROWSET_STAT_ERROR : QSample.Hxx
  • IDS_ROWSET_STAT_NOISE_WORDS : QSample.Hxx
  • IDS_ROWSET_STAT_PARTIAL_SCOPE : QSample.Hxx
  • IDS_ROWSET_STAT_REFRESH : QSample.Hxx
  • IDS_ROWSET_STAT_REFRESH_INCOMPLETE : QSample.Hxx
  • IDS_ROWSET_STAT_SHARING_VIOLATION : QSample.Hxx
  • IDS_ROWSET_STAT_TIME_LIMIT_EXCEEDED : QSample.Hxx
  • IDS_SAFE_CAT : ErrorOut.h
  • IDS_SAFE_COPY : ErrorOut.h
  • IDS_SAFE_PRINTF : ErrorOut.h
  • IDS_SAME_SIZE : wdiffrc.h
  • IDS_SAVE_COMPFILE : wdiffrc.h
  • IDS_SAVEASTITLE : WinCap.h
  • IDS_SAVEBMP : Resource.h
  • IDS_SAVEERROR : Resource.h
  • IDS_SAVEFILTER : Resource.h
  • IDS_SAVEMF : MfEdit.h
  • IDS_SAVEMFAS : MfEdit.h
  • IDS_SCANNING : wdiffrc.h
  • IDS_SCP_MENU : resource.h
  • IDS_SCRIPT_GLYPHSTRING : resource.h
  • IDS_SDKDIFF_ERROR : wdiffrc.h
  • IDS_SDKDIFF_USAGE : wdiffrc.h
  • IDS_SECONDS : wdiffrc.h
  • IDS_SECONDSFORMAT : resource.h
  • IDS_SELECT2 : Resource.h
  • IDS_SELECT3 : Resource.h
  • IDS_SELECT_COMPUTER : resource.h
  • IDS_SELECT_FIRST_FILE : wdiffrc.h
  • IDS_SELECT_SECOND_FILE : wdiffrc.h
  • IDS_SELECTMSG : Monkey.h
  • IDS_SENDINGBAND : Dibdll.h
  • IDS_SENT_TO_PRINTER : wdiffrc.h
  • IDS_SERVER_CONNECT_ERROR : resource.h
  • IDS_SETADVGRPHMDFAIL : MfEdit.h
  • IDS_SETUPDD_FUNC : Resource.h
  • IDS_SETUPFAILURE : Resource.h , ComDlg32.h
  • IDS_SHORT_APPNAME : Deb.h
  • IDS_SHORTPROGRESS : resource.h
  • IDS_SIMPLE_DESC : Resource.h
  • IDS_SKPTOEOL : MfEdit.h
  • IDS_SNAPINDESC : resource.h , Resource.h , resource.h
  • IDS_SNAPINNAME : resource.h , Resource.h , resource.h
  • IDS_SSGESTURE_FIRST : resource.h
  • IDS_START_MESSAGE_LOG : AptClien.h , RemClien.h , LocClien.h , LicClien.h , DllClien.h , ComUser.h
  • IDS_STARTUPLINK : resource.h
  • IDS_STAT_BATTERY_POWER : QSample.Hxx
  • IDS_STAT_CATALOG : QSample.Hxx
  • IDS_STAT_DOCUMENTS : QSample.Hxx
  • IDS_STAT_FILTEREDDOCUMENTS : QSample.Hxx
  • IDS_STAT_FRESHTEST : QSample.Hxx
  • IDS_STAT_HIGH_IO : QSample.Hxx
  • IDS_STAT_INDEXSIZE : QSample.Hxx
  • IDS_STAT_LOW_MEMORY : QSample.Hxx
  • IDS_STAT_MACHINE : QSample.Hxx
  • IDS_STAT_MERGE_ANNEALING : QSample.Hxx
  • IDS_STAT_MERGE_INDEX_MIGRATION : QSample.Hxx
  • IDS_STAT_MERGE_MASTER : QSample.Hxx
  • IDS_STAT_MERGE_MASTER_PAUSED : QSample.Hxx
  • IDS_STAT_MERGE_SHADOW : QSample.Hxx
  • IDS_STAT_NOT_UP_TO_DATE : QSample.Hxx
  • IDS_STAT_PENDINGSCANS : QSample.Hxx
  • IDS_STAT_PERSISTENTINDEX : QSample.Hxx
  • IDS_STAT_PROPCACHESIZE : QSample.Hxx
  • IDS_STAT_QUERIES : QSample.Hxx
  • IDS_STAT_READ_ONLY : QSample.Hxx
  • IDS_STAT_READING_USNS : QSample.Hxx
  • IDS_STAT_RECOVERING : QSample.Hxx
  • IDS_STAT_SCANS : QSample.Hxx
  • IDS_STAT_SECQDOCUMENTS : QSample.Hxx
  • IDS_STAT_STARTING : QSample.Hxx
  • IDS_STAT_TOTALDOCUMENTS : QSample.Hxx
  • IDS_STAT_UNIQUEKEYS : QSample.Hxx
  • IDS_STAT_UP_TO_DATE : QSample.Hxx
  • IDS_STAT_USER_ACTIVE : QSample.Hxx
  • IDS_STAT_WORDLIST : QSample.Hxx
  • IDS_STATES : MidiPlyr.h
  • IDS_STATUS_PROCESSING_DATA : resource.h
  • IDS_STATUS_TRANSFER_FROM_DEVICE : resource.h
  • IDS_STATUS_TRANSFER_TO_CLIENT : resource.h
  • IDS_STATUSMSGMAX : Resource.h
  • IDS_STATUSMSGMIN : Resource.h
  • IDS_STGOPENSTORAGEFAILED : DfV.h
  • IDS_STMREADFAILED : DfV.h
  • IDS_STMSEEKFAILED : DfV.h
  • IDS_STMSTATFAILED : DfV.h
  • IDS_STMTITLETEXT : DfV.h
  • IDS_STOP : MfEdit.h
  • IDS_STOPFAILED : MidiPlyr.h
  • IDS_STOPPING : MidiPlyr.h
  • IDS_STORAGERESOURCE_DESC : resource.h
  • IDS_STORAGERESTYPE_DESC : resource.h
  • IDS_STRING101 : resource.h
  • IDS_STRING102 : resource.h
  • IDS_STRING103 : resource.h
  • IDS_STRING104 : resource.h
  • IDS_STRING105 : resource.h
  • IDS_STRING106 : resource.h
  • IDS_STRING107 : resource.h
  • IDS_STRING108 : resource.h
  • IDS_STRING109 : resource.h
  • IDS_STRING110 : resource.h
  • IDS_STRING111 : resource.h
  • IDS_STRING112 : resource.h
  • IDS_STRING113 : resource.h
  • IDS_STRING114 : resource.h
  • IDS_STRING115 : resource.h
  • IDS_STRING116 : resource.h
  • IDS_STRING117 : resource.h
  • IDS_STRING118 : resource.h
  • IDS_STRING119 : resource.h
  • IDS_STRING120 : resource.h
  • IDS_STRING121 : resource.h
  • IDS_STRING122 : resource.h
  • IDS_STRING123 : resource.h
  • IDS_STRING124 : resource.h
  • IDS_STRING125 : resource.h
  • IDS_STRING126 : resource.h
  • IDS_STRING127 : resource.h
  • IDS_STRING128 : resource.h
  • IDS_STRING129 : resource.h
  • IDS_STRING130 : resource.h
  • IDS_STRING131 : resource.h
  • IDS_STRING132 : resource.h
  • IDS_STRING133 : resource.h
  • IDS_STRING134 : resource.h
  • IDS_STRING135 : resource.h
  • IDS_STRING136 : resource.h
  • IDS_STRING201 : resource.h
  • IDS_STRING202 : resource.h
  • IDS_STRING203 : resource.h
  • IDS_STRING204 : resource.h
  • IDS_STRING205 : resource.h
  • IDS_STRING206 : resource.h
  • IDS_STRING207 : resource.h
  • IDS_STRUCTSIZE : Resource.h , ComDlg32.h
  • IDS_STYLE_GLYPHSTRING : resource.h
  • IDS_SUBCLASSFAILURE : ComDlg32.h , Resource.h
  • IDS_SUSPENDED : resource.h
  • IDS_SVDRAWSFASBM : MfEdit.h
  • IDS_SYSMENU : resource.h , Resource.h , STATBAR.h , Resource.h
  • IDS_T_GLYPHSTRING : resource.h
  • IDS_TABWIDTH : wdiffrc.h
  • IDS_TB_COMMAND : Resource.h
  • IDS_TERMINAL_NAME : resource.h
  • IDS_TEST_STRING : resource.h
  • IDS_TESTERR : MidiPlyr.h
  • IDS_TEXT_PAGE : RESDEF.h
  • IDS_TF_FIRST : MidiPlyr.h
  • IDS_TF_LAST : MidiPlyr.h
  • IDS_TICKS : MidiPlyr.h
  • IDS_TITLE : Resource.h , FullIME.h , HalfIME.h
  • IDS_TITLEComSpyPropPage : Resource.h
  • IDS_TITLEContextSamplePropPage : resource.h
  • IDS_TOOL_DESCRIPTION : wdiffrc.h
  • IDS_TOOLTIPFONTDEC : Resource.h
  • IDS_TOOLTIPFONTINC : Resource.h
  • IDS_TOOLTIPOPENAS : Resource.h
  • IDS_TOOMANYOPEN : RESDEF.h
  • IDS_TOPLEVEL : Monkey.h
  • IDS_TRACING_DISABLED : wdiffrc.h
  • IDS_TRACING_ENABLED : wdiffrc.h
  • IDS_TRANSFERRED : resource.h
  • IDS_TRANSFERRING : resource.h
  • IDS_TRANSIENTERROR : resource.h
  • IDS_TXT : MfEdit.h
  • IDS_UAFMT : Resource.h
  • IDS_UCFONT : APP.h
  • IDS_UNABLE_TO_OPEN_COMPUTER_SELECTOR : resource.h
  • IDS_UNABLE_TO_PRINT : wdiffrc.h
  • IDS_UNICODEFAIL : ExeSkel.h , ComUser.h , DllUser.h
  • IDS_UNKNOWN : resource.h
  • IDS_UNKNOWN_ERROR_CODE : Resource.h
  • IDS_UNKNOWNERROR : Resource.h , QSample.Hxx , ComDlg32.h
  • IDS_UNREADABLE : wdiffrc.h
  • IDS_UNREGFAIL : SpinCube.h
  • IDS_UNTITLED : MidiPlyr.h
  • IDS_UNTITLLED : MciPlay.h
  • IDS_UNTRUSTED : resource.h
  • IDS_UPDATERECEIPT_DESC : resource.h , Resource.h
  • IDS_UPDATERECEIPT_DESC1 : resource.h , Resource.h
  • IDS_USAGE : resource.h
  • IDS_USAGE_STR00 : wdiffrc.h
  • IDS_USAGE_STR01 : wdiffrc.h
  • IDS_USAGE_STR02 : wdiffrc.h
  • IDS_USAGE_STR03 : wdiffrc.h
  • IDS_USAGE_STR04 : wdiffrc.h
  • IDS_USAGE_STR05 : wdiffrc.h
  • IDS_USAGE_STR06 : wdiffrc.h
  • IDS_USAGE_STR07 : wdiffrc.h
  • IDS_USAGE_STR08 : wdiffrc.h
  • IDS_USAGE_STR08B : wdiffrc.h
  • IDS_USAGE_STR09 : wdiffrc.h
  • IDS_USAGE_STR10 : wdiffrc.h
  • IDS_USAGE_STR11 : wdiffrc.h
  • IDS_USAGE_STR12 : wdiffrc.h
  • IDS_USAGE_STR12B : wdiffrc.h
  • IDS_USAGE_STR12C : wdiffrc.h
  • IDS_USAGE_STR13 : wdiffrc.h
  • IDS_USAGE_STR14 : wdiffrc.h
  • IDS_USAGE_STR15 : wdiffrc.h
  • IDS_USAGE_STR16 : wdiffrc.h
  • IDS_USAGE_STR17 : wdiffrc.h
  • IDS_USAGE_STR18 : wdiffrc.h
  • IDS_USAGE_STR19 : wdiffrc.h
  • IDS_USAGE_STR20 : wdiffrc.h
  • IDS_USAGE_STR21 : wdiffrc.h
  • IDS_USAGE_STR22 : wdiffrc.h
  • IDS_USAGE_STR23 : wdiffrc.h
  • IDS_USAGE_STR24 : wdiffrc.h
  • IDS_USAGE_STR25 : wdiffrc.h
  • IDS_USAGE_STR26 : wdiffrc.h
  • IDS_USER_CANCELLED : resource.h
  • IDS_USERSELECT : Resource.h
  • IDS_VALIDATING_SIGNATURE : resource.h
  • IDS_VER_INFO_LANG : LeakyBin.h , Generic.H , StatList.h
  • IDS_VERSION : Resource.h , resource.h
  • IDS_VERSION_ERROR : StatList.h , Generic.H , LeakyBin.h
  • IDS_VFWTOOOLD : MciPlay.h
  • IDS_VIEW : Resource.h
  • IDS_VIEW_DETAILS : Resource.h
  • IDS_VIEW_LARGE : Resource.h
  • IDS_VIEW_LIST : Resource.h
  • IDS_VIEW_SMALL : Resource.h
  • IDS_VWFULLSCRN : Resource.h
  • IDS_WAIT : resource.h
  • IDS_WARN_BOOT_PARTITION_NOT_NTFS : resource.h
  • IDS_WARN_BOOT_PARTITION_NOT_NTFS_REF : resource.h
  • IDS_WARN_DISK_NOT_NTFS : resource.h
  • IDS_WARN_DISK_NOT_NTFS_REF : resource.h
  • IDS_WINCAPRUNNING : Resource.h
  • IDS_WINDOWS_NT_REQUIRED : Deb.h
  • IDS_WINDOWS_NT_REQUIRED_TITLE : Deb.h
  • IDS_WINDOWTITLE : PlgBlt.h , SpinTest.h , WxForm.h , Server32.h
  • IDS_WNDWNOTVIS : Resource.h
  • IDS_WRONGOS : Server32.h
  • IDSBP_ICON : Global.h
  • IDSBP_MSG : Global.h
  • IDSBP_USERCOUNT : Global.h
  • IDSCRIPT : Resource.h
  • idsDisplayInfo : custom.h
  • idsDisplayInfoDesc : custom.h
  • IDSECURITY : Resource.h
  • IDSELECTALL : resource.h
  • IDSERVER : Resource.h
  • idsHelloWorld : custom.h
  • idsHelloWorldDesc : custom.h
  • IDSHUTDOWN : Resource.h
  • idsSimpleConnect : custom.h
  • idsSimpleConnectDesc : custom.h
  • IDSTART : Resource.h
  • IDSTATES_POS : Menu.h
  • idsTestName : custom.h
  • IDT_AUTOHIDE : AppBar.h
  • IDT_AUTOUNHIDE : AppBar.h
  • IDT_CATALOG : resource.h
  • IDT_CMD_LAUNCHREMOTE : Resource.h
  • IDT_COLUMN_LIST : resource.h
  • IDT_COLUMNNAME : resource.h
  • IDT_CONNECT : resource.h
  • IDT_CONNECTSTATUS : resource.h
  • IDT_DATASOURCE : resource.h
  • IDT_DBMS : resource.h
  • IDT_FILEDESC : resource.h
  • IDT_FILEINFO : resource.h
  • IDT_FROM_CONNECT : resource.h
  • IDT_FROM_INFO : resource.h
  • IDT_FROM_PROVIDER : resource.h
  • IDT_FROMTABLEHELP : resource.h
  • IDT_HELPMSG : resource.h
  • IDT_INDEXES : resource.h
  • IDT_INDEXMSG : resource.h
  • IDT_MAX_ROWS : resource.h
  • IDT_OPTIONMSG : resource.h
  • IDT_PROVIDERDESC : resource.h
  • IDT_PROVIDERFILENAME : resource.h
  • IDT_PROVIDERVERSION : resource.h
  • IDT_READONLY : resource.h
  • IDT_RESTRICTION1 : resource.h
  • IDT_RESTRICTION2 : resource.h
  • IDT_RESTRICTION3 : resource.h
  • IDT_RESTRICTION4 : resource.h
  • IDT_RESTRICTION5 : resource.h
  • IDT_RESTRICTION6 : resource.h
  • IDT_RESTRICTION7 : resource.h
  • IDT_RESULT : resource.h
  • IDT_SHOW_GROUP : resource.h
  • IDT_SOURCE : resource.h
  • IDT_STAT_INFO : resource.h
  • IDT_STATIC : resource.h
  • IDT_STATIC10 : resource.h
  • IDT_STATIC11 : resource.h
  • IDT_STATIC2 : resource.h
  • IDT_STATIC3 : resource.h
  • IDT_STATIC4 : resource.h
  • IDT_STATIC5 : resource.h
  • IDT_STATIC6 : resource.h
  • IDT_STATIC7 : resource.h
  • IDT_STATIC8 : resource.h
  • IDT_STATIC9 : resource.h
  • IDT_STATUS : resource.h
  • IDT_TABLE_LIST : resource.h
  • IDT_TARGET : resource.h
  • IDT_THREADMODEL : resource.h
  • IDT_TO_CONNECT : resource.h
  • IDT_TO_PROVIDER : resource.h
  • IDT_TO_TITLE : resource.h
  • IDT_TOTABLEHELP : resource.h
  • IDT_UIUPDATE : Main.Cpp
  • IDT_VALUE : resource.h
  • IDTBB_ALPHA : ToolBar.c
  • IDTBB_CANCEL : ToolBar.c
  • IDTBB_CHARCODE : ToolBar.c
  • IDTBB_CLOSE : ToolBar.c
  • IDTBB_CLOSECAND : ToolBar.c
  • IDTBB_COMPLETE : ToolBar.c
  • IDTBB_CONVERT : ToolBar.c
  • IDTBB_EUDC : ToolBar.c
  • IDTBB_FONT : ToolBar.c
  • IDTBB_FULL : ToolBar.c
  • IDTBB_HALF : ToolBar.c
  • IDTBB_HANJA : ToolBar.c
  • IDTBB_KATAKANA : ToolBar.c
  • IDTBB_MODE : ToolBar.c
  • IDTBB_NATIVE : ToolBar.c
  • IDTBB_NEXTCAND : ToolBar.c
  • IDTBB_NEXTCLAUSE : ToolBar.c
  • IDTBB_NOCHARCODE : ToolBar.c
  • IDTBB_NOEUDC : ToolBar.c
  • IDTBB_NOHANJA : ToolBar.c
  • IDTBB_NOROMAN : ToolBar.c
  • IDTBB_NOSHOWCAND : ToolBar.c
  • IDTBB_NOSOFTKBD : ToolBar.c
  • IDTBB_NOSYMBOL : ToolBar.c
  • IDTBB_OPEN : ToolBar.c
  • IDTBB_OPENCAND : ToolBar.c
  • IDTBB_PREVCAND : ToolBar.c
  • IDTBB_PREVCLAUSE : ToolBar.c
  • IDTBB_REVERT : ToolBar.c
  • IDTBB_ROMAN : ToolBar.c
  • IDTBB_SHOWCAND : ToolBar.c
  • IDTBB_SOFTKBD : ToolBar.c
  • IDTBB_SYMBOL : ToolBar.c
  • IDUNSELECTALL : resource.h
  • IDW_APP : Global.h
  • IDW_CHAT : Global.h
  • IDW_EDIT : ui.cpp , Global.h
  • IDW_LVIEW : Global.h
  • IDW_MSG : Global.h , ui.cpp
  • IDW_SBAR : Global.h
  • IDW_SEND : Global.h
  • IDW_TBAR : Global.h
  • IDW_USER : Global.h , ui.cpp
  • IDX25 : Resource.h
  • IDX_COPY_DATA : resource.h
  • IDX_COPY_INDEXES : resource.h
  • IDX_COPY_PRIMARYKEYS : resource.h
  • IDX_COPY_SCHEMA : resource.h
  • IDX_COPY_TABLE : resource.h
  • IDX_SHOW_SQL : resource.h
  • IDYES : winres.h
  • IE_Display : networkentry.h
  • IEFLAG_ACTIVE : networkentry.h
  • IEFLAG_BOUND : networkentry.h
  • IEFLAG_MULTIACCESS : networkentry.h
  • IF_AUDIT_DO : ccomspy.h
  • IGNORE_CHAR : Common.h
  • IGNORED : quiktest.h
  • IID_DEFINED : Catlpwr.Cpp , ComSpyCtl.Cpp , bankdlg.Cpp , Account.Cpp , Account.cpp , CatlSmpl.Cpp , account.Cpp
  • ikszAppFriendlyName : Resource.h
  • ikszAppName : Resource.h
  • ikszDisconnectedBusy : Resource.h
  • ikszDisconnectedCantDo : Resource.h
  • ikszDisconnectedIncompatible : Resource.h
  • ikszDisconnectedNetwork : Resource.h
  • ikszDisconnectedNoAnswer : Resource.h
  • ikszDisconnectedNoDialTone : Resource.h
  • ikszDisconnectedReject : Resource.h
  • ikszErrAddrBlocked : Resource.h
  • ikszErrBadTAPIAddr : Resource.h
  • ikszErrBillingRejected : Resource.h
  • ikszErrDefault : Resource.h
  • ikszErrInvalAddress : Resource.h
  • ikszErrInvalCallState : Resource.h
  • ikszErrInvalidCountryCode : Resource.h
  • ikszErrLineClose : Resource.h
  • ikszErrLineInitBadIniFile : Resource.h
  • ikszErrLineInitNoDevice : Resource.h
  • ikszErrLineInitNoDriver : Resource.h
  • ikszErrLineInitWrongDrivers : Resource.h
  • ikszErrNoMultipleInstance : Resource.h
  • ikszErrNoVoiceLine : Resource.h
  • ikszErrOOM : Resource.h
  • ikszErrResUnavail : Resource.h
  • ikszErrTAPI : Resource.h
  • ikszWarning911 : Resource.h
  • ikszWarningFor911 : Resource.h
  • ikszWarningNewDefault : Resource.h
  • ikszWarningRegisterSTapi : Resource.h
  • ikszWarningTapiReInit : Resource.h
  • ikszWarningTitle : Resource.h
  • ILV_ADDR : Global.h
  • ILV_AS : Global.h
  • ILV_AS_HWND : Dlg.Cpp
  • ILV_AS_NAME : Dlg.Cpp
  • ILV_AS_STATUS : Dlg.Cpp
  • ILV_AUDIO : Global.h
  • ILV_CAPS : Global.h
  • ILV_FT : Global.h
  • ILV_HWND : Global.h
  • ILV_ID : Global.h
  • ILV_LOCAL : Global.h
  • ILV_MCU : Global.h
  • ILV_NAME : Global.h , ui.cpp
  • ILV_STATUS : Global.h
  • ILV_TEXT : Global.h , ui.cpp
  • ILV_TIME : ui.cpp , Global.h
  • ILV_VERSION : Global.h
  • IM_CLASS : StdAfx.h
  • IM_HEIGHT : StdAfx.h
  • IM_TITLE : StdAfx.h
  • IM_WIDTH : StdAfx.h
  • IMAGE_BASE_OFFSET : DebDebug.c
  • IMAGE_EXPORT_TABLE_RVA_OFFSET : DebDebug.c
  • IMAGE_NAME_RVA_OFFSET : DebDebug.c
  • IMAGE_NONE : common.h
  • IMAGE_SECOND_HEADER_OFFSET : DebDebug.c
  • IMAGEHEIGHT : Global.h , ToolBar.c
  • IMAGEWIDTH : ToolBar.c , Global.h
  • IMC1 : MultiUI.h
  • IMC2 : MultiUI.h
  • IMCUI1 : MultiUI.h
  • IMCUI2 : MultiUI.h
  • IME_IN_CHOSECAND : FullIME.h
  • IME_IN_COMPOSITION : FullIME.h
  • IMESTATUS_CY : IMEApps.h
  • IMG_CDROM_DEFAULT : globals.h
  • IMG_DATA_FILE : globals.h
  • IMG_DEVICE_DEFAULT : globals.h
  • IMG_DEVICE_OFFLINE : globals.h
  • IMG_DRIVE_DEFAULT : globals.h
  • IMG_DRIVE_OFFLINE : globals.h
  • IMG_FOLDER_DEFAULT : globals.h
  • IMG_REMOVABLE_MEDIA : globals.h
  • IMMEDIATE_EXPIRATION : IsapiRequest.h
  • IMoniker_GetDisplayNameA : ansiapi.h
  • IMPL : CeapCfg.h
  • IMPLEMENT_FIXED_ALLOC : heap.h
  • IMPLEMENTED_CLSID : Server.Cpp
  • Implies : StdAfx.h
  • IMPORT_TYPE_CLSID : CompImportDlg.Cpp
  • IMPORT_TYPE_PROGID : CompImportDlg.Cpp
  • IMPORT_TYPE_UNDEFINED : CompImportDlg.Cpp
  • IN : AsyncIO.h
  • IN_BUF_SIZE : Server32.h , Client32.h
  • IN_MOTION : SpinCube.h
  • INBOUND_PIPE : Server.c
  • INC : PlgBlt.h , WxForm.h
  • INC_OLE2 : Server.Cxx , CreateUserHelpers.cpp , main.hxx , main.cpp , secClnt.Cpp , main.cpp , call_as.c , MciPlay.c , secSvr.Cpp , main.cxx , main.cpp , OleApt.Cpp , FileView.h , Priv.h , main.hxx , UserProps.cpp , Framer.h , OleImp.Cpp , Client.Cpp , headers.h , sampclnt.h , ADSIhelpers.cpp , Util.Cpp , Client.c , sclient.cpp , main.cpp , ADSIhelpers.cpp , ComPerf.Cpp , sserver.cpp
  • INC_VIEW_COMPLIST : complist.h , view.h , compitem.h
  • INCH1 : APP.h
  • INCH10 : APP.h
  • INCH2 : APP.h
  • INCH4 : APP.h
  • INCH8 : APP.h
  • INCLUDE_ALL : sdkdiff.h
  • INCLUDE_DIFFER : sdkdiff.h
  • INCLUDE_LEFTONLY : sdkdiff.h
  • INCLUDE_MOVEDLEFT : sdkdiff.h
  • INCLUDE_MOVEDRIGHT : sdkdiff.h
  • INCLUDE_RIGHTONLY : sdkdiff.h
  • INCLUDE_SAME : sdkdiff.h
  • INCLUDE_SIMILARLEFT : sdkdiff.h
  • INCLUDE_SIMILARRIGHT : sdkdiff.h
  • INDENT : mwclass.Cxx
  • INDEX_BACKGROUND : localres.h
  • INDEX_CLOSEDFOLDER : localres.h
  • INDEX_CLOUD : localres.h
  • INDEX_LANDICON : localres.h
  • INDEX_NONE : localres.h
  • INDEX_OPENFOLDER : localres.h
  • INDEX_PEOPLEICON : localres.h
  • INDEX_RAIN : localres.h
  • INDEX_SKYICON : localres.h
  • INDEX_SNOW : localres.h
  • INDEX_SPACEICON : localres.h
  • INDEX_STATION : localres.h
  • INDEX_SUN : localres.h
  • INDEX_THUNDER : localres.h
  • INDEX_WORLD : localres.h
  • INET_NTOA : defs.h
  • INFINITE_INTERVAL : defs.h
  • INHERIT_FULL : Privobji.Cpp
  • ININAME : FaxSiren.Cpp
  • INIT_DEFAULT_NODE : globals.h
  • INIT_INTERFACEIMPL : OleStd.h
  • INITDIRSIZE : Open.h
  • INITGUID : globals.cpp , DropExt.C , Globals.cpp , const.cpp , oledbcomponent.h , EnumerateKeys.cpp , Framer.Cpp , SampView.Cpp , ShellExt.Cpp , Guid.c , common.cpp , BandObjs.Cpp , common.cpp , tablecopy.cpp , MqTrans.Cpp , sampclnt.cpp , Guids.Cpp , stdafx.cpp , Guids.Cpp
  • INITGUIDS : FileView.Cpp , DskQuota.Cpp
  • INITIAL_BUFFER_SIZE : dhcprequest.cpp , dhcppersist.cpp
  • INITIAL_COLUMN_SIZE : Utility.h
  • INITIAL_SIZE : PerfUtil.c
  • INITIALIZE_HTTP_RESPONSE : main.c
  • INITIALIZE_LOCKED_LIST : sync.h
  • INITIALIZE_LOCKED_QUEUE : sync.h
  • InitializeListHead : openf.h , tracedmp.h , AsyncIO.h , defs.h , openf.h , list.h
  • InitializeQueueHead : list.h
  • InitializeStackHead : list.h
  • InitStruct : Global.h
  • InitTest : autotest.h
  • INLINE : MulDiv32.h
  • INLINE_BUFFER_SIZE : IsapiBuffer.h
  • INLINE_READ_SIZE : IsapiRequest.h
  • INPUTBUFFERSIZE : CommCode.c
  • INSERT_FAIL : quiktest.h
  • InsertHeadList : openf.h , list.h , openf.h , defs.h , AsyncIO.h , openf.h
  • InsertSortedList : list.h
  • InsertTailList : list.h , tracedmp.h , AsyncIO.h , openf.h , defs.h , openf.h
  • INT2DWORD : Select.h
  • INT_DISPLAY_SIZE : sampprov.h
  • INTERACTIVE_PURGE : KList.c
  • INTERFACE : GssAPI.h
  • interface : EventSink.cpp
  • INTERFACE_C : GssAPI.h
  • INTERFACE_CAST : Server.Cpp
  • INTERFACE_IS_ACTIVE : networkentry.h
  • INTERFACE_IS_BOUND : networkentry.h
  • INTERFACE_IS_INACTIVE : networkentry.h
  • INTERFACE_IS_MULTIACCESS : networkentry.h
  • INTERFACE_IS_POINTTOPOINT : networkentry.h
  • INTERFACE_IS_UNBOUND : networkentry.h
  • INTERFACE_TABLE_BUCKETS : defs.h
  • INVALID : PerfUtil.c
  • INVALID_LINE : Dialer.h
  • INVALID_SEND_PRIORITY : QosEvent.h
  • INVALIDATE_PAGE : CacheIsapi.cpp
  • IO_BUFFER_SIZE : WebServer.c , WebClient.c
  • IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE : CStorageResource.cpp
  • IOCTL_VOLUME_GET_GPT_ATTRIBUTES : DLEdit.Cpp
  • IP1 : rqs.h
  • IP2 : rqs.h
  • IP3 : rqs.h
  • IP4 : rqs.h
  • IP_ASSIGN : defs.h
  • IP_COMPARE : defs.h
  • IP_HIGHEST : defs.h
  • IP_LOWEST : defs.h
  • IP_RECORD_ROUTE : iphdr.h
  • IP_VALID : defs.h
  • IPADDRLEN : WSnmpUtil.h
  • IPersistFile_LoadA : ansiapi.h
  • IPPROTO_ICMP6 : iphdr.h
  • IPSAMPLE_GLOBAL_CONFIG_ID : ipsamplerm.h
  • IPSAMPLE_GLOBAL_STATS_ID : ipsamplerm.h
  • IPSAMPLE_IF_ADDRESS_TABLE : ipsamplerm.h
  • IPSAMPLE_IF_BINDING_ID : ipsamplerm.h
  • IPSAMPLE_IF_BINDING_SIZE : ipsamplerm.h
  • IPSAMPLE_IF_CONFIG_ID : ipsamplerm.h
  • IPSAMPLE_IF_STATS_ID : ipsamplerm.h
  • IPSAMPLE_LOGGING_ERROR : ipsamplerm.h
  • IPSAMPLE_LOGGING_INFO : ipsamplerm.h
  • IPSAMPLE_LOGGING_NONE : ipsamplerm.h
  • IPSAMPLE_LOGGING_WARN : ipsamplerm.h
  • IPSAMPLE_METRIC_INFINITE : ipsamplerm.h
  • IPSAMPLE_STATE_ACTIVE : ipsamplerm.h
  • IPSAMPLE_STATE_BOUND : ipsamplerm.h
  • IPSAMPLE_TRACE_ANY : defs.h
  • IPSAMPLE_TRACE_CONFIGURATION : defs.h
  • IPSAMPLE_TRACE_DEBUG : defs.h
  • IPSAMPLE_TRACE_ENTER : defs.h
  • IPSAMPLE_TRACE_LEAVE : defs.h
  • IPSAMPLE_TRACE_MIB : defs.h
  • IPSAMPLE_TRACE_NETWORK : defs.h
  • IPSAMPLE_TRACE_PACKET : defs.h
  • IPSAMPLE_TRACE_TIMER : defs.h
  • IPSAMPLELOG_BASE : log.h
  • IPSAMPLELOG_BIND_IF_FAILED : log.h
  • IPSAMPLELOG_CORRUPT_GLOBAL_CONFIG : log.h
  • IPSAMPLELOG_CORRUPT_INTERFACE_CONFIG : log.h
  • IPSAMPLELOG_CREATE_EVENT_FAILED : log.h
  • IPSAMPLELOG_CREATE_HASHTABLE_FAILED : log.h
  • IPSAMPLELOG_CREATE_RWL_FAILED : log.h
  • IPSAMPLELOG_CREATE_SEMAPHORE_FAILED : log.h
  • IPSAMPLELOG_CREATE_SOCKET_FAILED : log.h
  • IPSAMPLELOG_CREATE_TIMER_FAILED : log.h
  • IPSAMPLELOG_CREATE_TIMER_QUEUE_FAILED : log.h
  • IPSAMPLELOG_DESTROY_SOCKET_FAILED : log.h
  • IPSAMPLELOG_ENUM_NETWORK_EVENTS_FAILED : log.h
  • IPSAMPLELOG_EVENT_QUEUE_EMPTY : log.h
  • IPSAMPLELOG_EVENTSELECT_FAILED : log.h
  • IPSAMPLELOG_HEAP_ALLOC_FAILED : log.h
  • IPSAMPLELOG_HEAP_CREATE_FAILED : log.h
  • IPSAMPLELOG_INIT_CRITSEC_FAILED : log.h
  • IPSAMPLELOG_INPUT_RECORD_ERROR : log.h
  • IPSAMPLELOG_INTERFACE_ABSENT : log.h
  • IPSAMPLELOG_INTERFACE_PRESENT : log.h
  • IPSAMPLELOG_JOIN_GROUP_FAILED : log.h
  • IPSAMPLELOG_NETWORK_MODULE_ERROR : log.h
  • IPSAMPLELOG_PACKET_HEADER_CORRUPT : log.h
  • IPSAMPLELOG_PACKET_TOO_SMALL : log.h
  • IPSAMPLELOG_PACKET_VERSION_INVALID : log.h
  • IPSAMPLELOG_PROTOCOL_MODULE_ERROR : log.h
  • IPSAMPLELOG_RECVFROM_FAILED : log.h
  • IPSAMPLELOG_REGISTER_WAIT_FAILED : log.h
  • IPSAMPLELOG_RTM_REGISTER_FAILED : log.h
  • IPSAMPLELOG_SAMPLE_ALREADY_STARTED : log.h
  • IPSAMPLELOG_SAMPLE_ALREADY_STOPPED : log.h
  • IPSAMPLELOG_SAMPLE_START_FAILED : log.h
  • IPSAMPLELOG_SAMPLE_STARTED : log.h
  • IPSAMPLELOG_SAMPLE_STOP_FAILED : log.h
  • IPSAMPLELOG_SAMPLE_STOPPED : log.h
  • IPSAMPLELOG_SENDTO_FAILED : log.h
  • IPSAMPLELOG_SET_MCAST_IF_FAILED : log.h
  • IPSAMPLELOG_TIMER_MODULE_ERROR : log.h
  • IPSAMPLELOG_WSASTARTUP_FAILED : log.h
  • IPv4_LENGTH_OFFSET : socket.c
  • IPv4_PREVIEW_SIZE : socket.c
  • is : defs.h
  • IS_BLANK : line.cpp , utils.cpp
  • IS_EVEN : common.h
  • IS_FILENAME_DELIM : getIcon.c
  • IS_NT : Generic.C , StatList.h , printjob.c , LeakyBin.c
  • IS_SEPARATOR : getIcon.c
  • IS_SIGNIFICANT_MSG : msgfiltr.c
  • IS_WIN30_DIB : Dibutil.h
  • IS_WIN32 : StatList.h , LeakyBin.c , Generic.C
  • IS_WIN32S : StatList.h , Generic.C
  • IS_WIN95 : Generic.C , StatList.h
  • ISAPI_ASSERT : IsapiTools.h
  • ISCHECKED : MciPlay.c
  • ISDELAYLOADHRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp
  • ISDELAYLOADHRESULTFACILITY : CeError.Cpp , ceerror.cpp
  • ISDIGIT : Dialer.c
  • IsEqualFORMATETC : OleStd.h
  • IsEqualGUID : tracedmp.h
  • ISETUPPROPNAME_BASEURL : common.h
  • ISETUPPROPNAME_DATABASE : common.h
  • ISETUPPROPNAME_MINIMUM_MSI : common.h
  • ISETUPPROPNAME_OPERATION : common.h
  • ISETUPPROPNAME_PATCH : common.h
  • ISETUPPROPNAME_PRODUCTNAME : common.h
  • ISETUPPROPNAME_PROPERTIES : common.h
  • ISETUPPROPNAME_UPDATE : common.h
  • ISETUPPROPNAME_UPDATELOCATION : common.h
  • ISHTTPERROR : ceerror.cpp , CeError.Cpp
  • ISHTTPHRESULT : ceerror.cpp , CeError.Cpp
  • ISJETERROR : CeError.Cpp , ceerror.cpp
  • ISJETHRESULT : ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • IsListEmpty : AsyncIO.h , openf.h , defs.h , list.h , openf.h
  • ISOSSERROR : ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • IsQueueEmpty : list.h
  • ISRDEBUG : Debug.h
  • ISSCERT_FILEURL : Policy.Cpp
  • ISSCERT_FTPURL : Policy.Cpp
  • ISSCERT_HTTPURL : Policy.Cpp
  • ISSCERT_LDAPURL : Policy.Cpp
  • ISSETUPHRESULT : ceerror.cpp , CeError.Cpp , ceerror.cpp
  • IsStackEmpty : list.h
  • IsValidHandle : stdafx.h
  • ISWHITE : AuthFilt.h
  • ISWIN32ERROR : ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ISWIN32HRESULT : CeError.Cpp , ceerror.cpp
  • ITEM_COUNT : VListVw.c
  • itoa : Dialer.h
  • IToClass : Priv.h
  • IToClassN : Priv.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- p -

  • P_ALIGN : table.h
  • P_BCOLOUR : table.h
  • P_BOX : table.h
  • P_BOXALL : table.h
  • P_BOXBOTTOM : table.h
  • P_BOXLEFT : table.h
  • P_BOXRIGHT : table.h
  • P_BOXTOP : table.h
  • P_CENTRE : table.h
  • P_FCOLOUR : table.h
  • P_FCOLOURWS : table.h
  • P_FONT : table.h
  • P_HEIGHT : table.h
  • P_LEFT : table.h
  • P_RIGHT : table.h
  • P_WIDTH : table.h
  • PACKAGE_CAPABILITIES : SampSSP.H
  • PACKAGE_COMMENT : SampSSP.H
  • PACKAGE_MAXTOKEN : SampSSP.H
  • PACKAGE_NAME : SampSSP.H
  • PACKAGE_RPCID : SampSSP.H
  • PACKAGE_SIGNATURE_SIZE : SampSSP.H
  • PACKAGE_SIGNATURE_TAG : SampSSP.H
  • PACKAGE_VERSION : SampSSP.H
  • PACKET_NAME : AuthenticatePlugin.cpp
  • PacketDisplay : packet.h
  • PAGE_NAME_SIZE : IPageS.h
  • PAGE_TITLE_SIZE : IPageS.h
  • PAGEELEMS : Grid.Hxx
  • PAGEHEIGHT : APP.h
  • PAGELIST_USTR : IPageS.h
  • PAGEPRINT : Grid.Hxx
  • PAGESIZE : UtilLib.h
  • PAGETYPE_DELETED : IPageS.h
  • PAGETYPE_DRAWING : IPageS.h
  • PAGETYPE_NONE : IPageS.h
  • PAGETYPE_TEXT : IPageS.h
  • PAGEWIDTH : APP.h
  • PALETTESIZE : Mypal.h
  • PALVERSION : Dibutil.h
  • PARAM_NONE : common.h
  • PARAM_SIZE : log.c
  • PARSE_DIRECTORYNAME : Utility.c
  • PARSE_EMPTYSTRING : Utility.c
  • PARSE_EXTENTIONTOOLONG : Utility.c
  • PARSE_FILETOOLONG : Utility.c
  • PARSE_INVALIDCHAR : Utility.c
  • PARSE_INVALIDDIRCHAR : Utility.c
  • PARSE_INVALIDDRIVE : Utility.c
  • PARSE_INVALIDNETPATH : Utility.c
  • PARSE_INVALIDPERIOD : Utility.c
  • PARSE_INVALIDSPACE : Utility.c
  • PARSE_WILDCARDINDIR : Utility.c
  • PATHPROP : UtilLib.h
  • PCTM2PSMX : DropExt.C
  • PENCUR_MEDIUM : DComDraw.h
  • PENCUR_OFF : DComDraw.h
  • PENCUR_ON : DComDraw.h
  • PENCUR_THICK : DComDraw.h
  • PENCUR_THIN : DComDraw.h
  • PERIODIC_INTERVAL : defs.h
  • PERR : log.c , NmPipe.c , SecFile.c , SidClean.c
  • PIE : Common.h
  • PINGTIMEOUT : Client.h
  • PIPE_SIZE : component.cxx
  • PLAY_FILENAME : CallNot.h
  • PLEASE_READ : Client32.h , Server32.h
  • PLEASE_WRITE : Client32.h , Server32.h
  • PLG_BLT : Common.h
  • PLOCKED_QUEUE : sync.h
  • PLUGABLE_PORT_NUMBER : nmsession.h
  • PMSG : SidClean.c
  • PMSG_META : SMF.h
  • POINT2MPOINT : Select.h , Cursor.h
  • POINTER_DISPLAYSIZE : common.h
  • POINTSIZE : ABOUT.c , About.c
  • POLYBEZIER : Common.h
  • POLYCLASS : Poly.h
  • POLYGON : Common.h
  • POLYLINE : Common.h
  • POLYPOLYGON : Common.h
  • POLYTITLE : GdiDemo.h
  • POOL_THREADS : ThreadPool.h
  • POOLTEST : resource.h
  • Pop : list.h
  • POS_ACTIONS : MidiPlyr.h
  • POS_FILE : MidiPlyr.h
  • POS_OPTIONS : MidiPlyr.h
  • POS_PLAYTHRU : MidiPlyr.h
  • POSITION : clUtil.h
  • POTENTIAL : nshsamp.h
  • PPP_EAP_PROTOCOL_ID : Eap.h
  • PQUEUE_ENTRY : list.h
  • PREFIX_FORMAT : Utility.c
  • PREFIX_SIZE : Utility.c , quiktest.h
  • PREQ_CANCEL : View.Hxx
  • PREQ_ERRENDPAGE : View.Hxx
  • PREQ_ERROR : View.Hxx
  • PREQ_ERRSTARTDOC : View.Hxx
  • PREQ_ERRSTARTPAGE : View.Hxx
  • PREQ_SUCCESS : View.Hxx
  • PREQ_USERABORT : View.Hxx
  • PRESERVE_ALL : BttnCur.h
  • PRESERVE_BLACK : BttnCur.h
  • PRESERVE_DKGRAY : BttnCur.h
  • PRESERVE_LTGRAY : BttnCur.h
  • PRESERVE_NONE : BttnCur.h
  • PRESERVE_WHITE : BttnCur.h
  • PRETTYPRINT_MAXTOTALWIDTH : sampclnt.h
  • PRETTYPRINT_MINCOLWIDTH : sampclnt.h
  • PREVVID_BOTTOM : RTCOutgoingDlg.h , RTCIncomingDlg.h
  • PREVVID_LEFT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • PREVVID_RIGHT : RTCOutgoingDlg.h , RTCIncomingDlg.h
  • PREVVID_TOP : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • PrintAppStyleAPIError : SidClean.c
  • PrinterNameSize : printjob.c
  • PRINTERROR : MqTestOA.Cpp
  • PrintQueue : resource.h
  • PRIVATE : GLOBAL.h
  • PRIVATE_ERROR_BIT : common.h
  • PROC_FORMAT_STRING_SIZE : ADsFirstExt_p.c , ADsError_p.c , EDAnnotator_p.c , EdCommands_p.c , EdHost_p.c , Render_p.c , EdGlyphs_p.c , BrochureMachine_p.c
  • PROCESS_SQL_ERROR : odbcdata.h
  • PROF_LOG_MAX_SIZE : Prof.h , prof.h
  • PROG_ID : DoServer.h
  • ProgIDFromCLSIDA : ansiapi.h
  • PROGRESS : queue.h
  • Prolog : Atsp.h
  • PROMPT : FTPJr.cpp
  • PROP_DEFAULT__MAXUSERS : File Share Sample.cpp
  • PROP_DWORD : BasicHiPerf.h
  • PROP_MAX__MAXUSERS : File Share Sample.cpp
  • PROP_MIN__MAXUSERS : File Share Sample.cpp
  • PROP_NAME__MAXUSERS : File Share Sample.cpp
  • PROP_NAME__PATH : File Share Sample.cpp
  • PROP_NAME__REMARK : File Share Sample.cpp
  • PROP_NAME__SHARENAME : File Share Sample.cpp
  • PROP_QWORD : BasicHiPerf.h
  • PROP_SHEET_HOST_ID : PropSheetHost.h
  • PROP_SHEET_PREFIX_ADMIN : PropSheetHost.h
  • PROP_SHEET_PREFIX_SHELL : PropSheetHost.h
  • PROP_VALUE : BasicHiPerf.h
  • PropStreamName : suminfo.h
  • PropStreamNamePrefixByte : suminfo.h
  • PROTO_IP_SAMPLE : ipsamplerm.h
  • PROTOCOL_LEN : PrPerf.c
  • PROTOCOL_NAME : AuthenticatePlugin.cpp
  • PROTOCOL_SEQUENCE : Common.h
  • PROTOTYPE : GssAPI.h , Gss-Misc.h
  • PROVIDER_ALLOC : sampprov.h
  • PROVIDER_CLASS : asyncselect.cpp
  • PROVIDER_INFO_SIZE : Atsp.c
  • PROVIDER_NAME_REINDEERPROV : FrameworkProv.h
  • PROVIDER_REALLOC : sampprov.h
  • PROXY_DELEGATION : dlldata.c , Dlldata.c , dlldata.c
  • PSTACK_ENTRY : list.h
  • PSXI2PSMX : DropExt.C
  • PszFromPsffs : wn_dos.h
  • PTS_PER_INCH : OleStd.h
  • PUBLIC : GLOBAL.h
  • PURPOSE : InOuts.c , ClUuids.c , Xmits.c , Picklpc.c , RPCssmc.c , Usrdefs.c , Hellos.c , Cxhndlc.c , Cxhndls.c , Repass.c , Repasc.c , InOutc.c , Xmitc.c , RPCssms.c , Dynepts.c , Pickltc.c , ComPerf.Cpp , DUnions.c
  • Push : list.h
  • Puts : Debug.h
  • PVOID2PSMX : DropExt.C
  • PW_BESTFIT : Dibapi.h
  • PW_CLIENT : Dibapi.h
  • PW_SCALE : Dibapi.h
  • PW_STRETCHTOPAGE : Dibapi.h
  • PW_WINDOW : Dibapi.h
  • PWM_COMMWRITE : CommCode.c
  • PWM_WRITESTRING : EDITCTLS.c
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- q -

  • QCIF_CX_SIZE : StdAfx.h
  • QCIF_CY_SIZE : StdAfx.h
  • QMPROPS : DirEncrypt.Cpp
  • QOS_DEFAULTNAME : QosEvent.h
  • QOSTEST : Qoslist.Cpp
  • QQCIF_CX_SIZE : StdAfx.h
  • QQCIF_CY_SIZE : StdAfx.h
  • QTESTC : common.h
  • QUERY_COSTLY : PerfUtil.h
  • QUERY_FOREIGN : PerfUtil.h
  • QUERY_GLOBAL : PerfUtil.h
  • QUERY_INTERVAL : SysInfo.h
  • QUERY_ITEMS : PerfUtil.h
  • QUEUE_ENTRY : list.h
  • QUICKTESTPOINTS : TextFx.c
  • QUIKTEST : quiktest.c
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- r -

  • R_MATCH_START : sdkdiff.h
  • R_MATCH_WIDTH : sdkdiff.h
  • R_POS_START : sdkdiff.h
  • R_POS_WIDTH : sdkdiff.h
  • R_UNMATCH_START : sdkdiff.h
  • R_UNMATCH_WIDTH : sdkdiff.h
  • RADIUS_ATTR_NOT_FOUND : radutil.h
  • random : TextFx.c
  • RASCONN_V401_A : main.cpp
  • RASCUSTOMDIAL_ENTRYNAME : customdialreg.cpp , customentry.c
  • RASCUSTOMDIAL_KEYPATH : customdialreg.cpp , customentry.c
  • RASCUSTOMDIAL_PHONENO : customdialreg.cpp
  • RASCUSTOMDIAL_VALUENAME : customentry.c , customdialreg.cpp
  • RASEAPGLOBALS : Eap.c
  • RB2 : MousInfo.h
  • RBD : MousInfo.h
  • RBU : MousInfo.h
  • RC_NOTSUCCESSFUL : quiktest.h
  • RC_SUCCESSFUL : quiktest.h
  • READ : Check_SD.h
  • READ_BUFFER_SIZE : AuthzSvr.c
  • READ_WRITE_LOCK_CREATED : sync.h
  • ReadKey : UnBufCp1.c
  • REALGINA_PATH : GinaHook.c , GinaStub.c
  • REALLOC : dballoc.Cpp , defs.h
  • REALM_NAME : AuthenticateContext.cpp
  • REC_COUNT_UNK : quiktest.h
  • REC_FILEEXT : CallNot.h
  • REC_FILENAME : CallNot.h
  • RECTANGLE : Common.h
  • RectHeight : IconPRO.h
  • RECTHEIGHT : Dibutil.h
  • RECTSIZE : Track.c
  • RECTWIDTH : Dibutil.h
  • RectWidth : IconPRO.h
  • RECV_BUF_SIZE : callback.Cpp
  • RECV_DATA_SIZE : common.h
  • RECVVID_BOTTOM : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RECVVID_LEFT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RECVVID_RIGHT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RECVVID_TOP : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • RED_COLOR : DoServer.h
  • REDIRECT_ENTITY : CustomAuth.h , ReMapUrl.cpp
  • REFPOINTS : cdialoglite.h
  • REFRECT : cdialoglite.h
  • REG_ERR : log.c
  • REGISTER_TUTFILE_STR : DllClien.h
  • REGISTRY_TXT : Monkey.h
  • RegOpenKey_AW : ansiapi.h
  • REGPARAM_FILESHARESAMPLE_MAXUSERS : File Share SampleEx.h
  • REGPARAM_FILESHARESAMPLE_PATH : File Share SampleEx.h
  • REGPARAM_FILESHARESAMPLE_REMARK : File Share SampleEx.h
  • REGPARAM_FILESHARESAMPLE_SHARENAME : File Share SampleEx.h
  • REGVAL_INSTALL_DIR : Dlg.Cpp
  • REGVAL_NM_NT_DISPLAY_DRIVER_ENABLED : Dlg.Cpp
  • RELEASE : MqTestOA.Cpp , UtilLib.h
  • RELEASE_ALL_PARENT_OBJECTS : VCExploreDlg.Cpp
  • RELEASE_COM_IF : RendSam.Cpp
  • RELEASE_INTERFACE : AppUtil.h , cbase.h
  • RELEASE_LIST_LOCK : sync.h
  • RELEASE_QUEUE_LOCK : sync.h
  • RELEASE_READ_DLOCK : defs.h
  • RELEASE_READ_LOCK : sync.h
  • RELEASE_WRITE_DLOCK : defs.h
  • RELEASE_WRITE_LOCK : sync.h
  • ReleaseInterface : Framer.h
  • RELEASEINTERFACE : debug.h
  • ReleaseMemory : autotest.h
  • RELPATHPROP : UtilLib.h
  • REMOTE_CREATE_ERR_STR : DComDraw.h
  • REMOTE_MSG_DLL_PATH : log.c
  • REMOVE_ACE_MASK_BITS : app.cpp
  • RemoveEntryList : list.h , openf.h , defs.h , tracedmp.h , AsyncIO.h
  • RemoveHeadList : list.h , openf.h , defs.h , AsyncIO.h
  • RemoveTailList : list.h , openf.h , defs.h
  • REPAINT_BKGND : SpinCube.h
  • REPORT_ERROR : Perfmsg.h
  • REPORT_ERROR_DATA : Perfmsg.h
  • REPORT_INFORMATION : Perfmsg.h
  • REPORT_INFORMATION_DATA : Perfmsg.h
  • REPORT_SUCCESS : Perfmsg.h
  • REPORT_WARNING : Perfmsg.h
  • REPORT_WARNING_DATA : Perfmsg.h
  • REQUEST_ICONSOLE : globals.h
  • REQUEST_ICONSOLENAMESPACE : globals.h
  • REQUEST_ICONSOLENAMESPACE2 : globals.h
  • REQUEST_ICONSOLEVERB : globals.h
  • REQUEST_ICONTROLBAR : globals.h
  • REQUEST_IDEVICETOOLBAR : globals.h
  • REQUEST_IDISPLAYHELP : globals.h
  • REQUEST_IHEADERCTRL : globals.h
  • REQUEST_IHEADERCTRL2 : globals.h
  • REQUEST_IRESULTDATA : globals.h
  • REQUEST_ISTATICTOOLBAR : globals.h
  • REQUEST_IVFILETOOLBAR : globals.h
  • REQUESTING_ONE_DISMOUNT : app.cpp
  • REQUESTING_ONE_MOUNT : app.cpp
  • RESOURCE_MENU_BASE_ID : ExtObjData.cpp
  • RESOURCE_MENU_ID_1 : ExtObjData.cpp
  • RESOURCE_STRING_LEN : NewFsp.h
  • RESOURCE_TYPE_IP_ADDRESS : ClRes.h
  • RESOURCE_TYPE_NETWORK_NAME : ClRes.h
  • RESPONSE_MAX_BUFFER : PoolWrap.cpp
  • RESTART_TIMER : defs.h
  • RESTYPE_DLL_NAME : ClRes.h , StdAfx.h , ClRes.h
  • RESTYPE_MENU_BASE_ID : ExtObjData.cpp
  • RESTYPE_MENU_ID_1 : ExtObjData.cpp
  • RESTYPE_NAME : ClRes.h , StdAfx.h
  • RESULT_X : IMEApps.h
  • RESULT_Y : IMEApps.h
  • ResultFromShort : Priv.h
  • RESULTREAD_X : IMEApps.h
  • RESULTREAD_Y : IMEApps.h
  • RETCHECK : quiktest.h
  • RETHROW_ERR : StdAfx.h , stdafx.h
  • RETRIES : SnmpUtil.C
  • RETURN_FAILURE : enablerouter.c
  • RETURN_IF_FAILED : RendSam.Cpp
  • RETURN_ON_FAILURE : helper.h , Child.cpp
  • RETURN_SUCCESS : enablerouter.c
  • REVEXT_CDPFILEURL : Policy.Cpp
  • REVEXT_CDPFTPURL : Policy.Cpp
  • REVEXT_CDPHTTPURL : Policy.Cpp
  • REVEXT_CDPLDAPURL : Policy.Cpp
  • RGB_FROM_COLOREF : common.h
  • RGSIZEOF : secClnt.Cpp , secSvr.Cpp
  • RIGHT : Rebar.c
  • RND_MAX_STRING_FORMAT : RendSam.Cpp
  • ROOTSTGSTR : mwclass.Cxx
  • ROP_PSDPxax : Menu.h
  • ROUND : string.Cpp
  • ROUND4 : string.Cpp
  • ROUND_DOWN : AsyncIO.h , sampprov.h
  • ROUND_UP : sampprov.h , AsyncIO.h , sampclnt.h
  • ROUNDRECT : Common.h
  • ROUNDUP : common.h , prsample.h
  • ROUNDUP_ : common.h , prsample.h , common.h
  • ROUNDUP_AMOUNT : common.h , prsample.h , common.h
  • ROUTEITGUID : FaxSiren.Cpp
  • RPC_EEINFO_EXIT_IF_FAIL : common.h
  • RPC_HEAP_SIZE_INIT : Service.h , service.h
  • RPC_HEAP_SIZE_MAX : service.h , Service.h , service.h
  • RQS_CONTROLS_ACCEPTED : main.cpp
  • RQS_MESSAGE_LENGH_SIZE : rqsclient.h
  • RQS_MESSAGE_PREFIX_SIZE : rqsclient.h
  • RQS_MESSAGE_SIZE : rqsclient.h
  • RSM_APPSAMPLE_LABEL_EXPORT : stl_mll.h
  • RT_DLGINIT : afxres.h
  • RT_INSTALL_PROPERTY : common.h
  • RTL_NUMBER_OF : StdAfx.h , ClRes.h
  • RTM_DeregisterEntity : rtmapi.h
  • RTM_DeregisterFromChangeNotification : rtmapi.h
  • RTM_DisplayDestInfo : rtmapi.h
  • RTM_GetAddress : rtmapi.h
  • RTM_GetChangedDests : rtmapi.h
  • RTM_GetMostSpecificDestination : rtmapi.h
  • RTM_GetOpaqueInformationPointer : rtmapi.h
  • RTM_IsMarkedForChangeNotification : rtmapi.h
  • RTM_MarkDestForChangeNotification : rtmapi.h
  • RTM_RegisterEntity : rtmapi.h
  • RTM_RegisterForChangeNotification : rtmapi.h
  • RTM_ReleaseChangedDests : rtmapi.h
  • RTM_ReleaseDestInfo : rtmapi.h
  • RTM_SetAddress : rtmapi.h
  • RTN_ERROR : TextSid.c , AclApi.c , Client.c , NetShare.c , MachAcct.c , ChngPass.c , Server.c , Audit.c , LsaPrivs.c
  • RTN_OK : Server.c , MachAcct.c , ChngPass.c , Audit.c , TextSid.c , NetShare.c , AclApi.c , Client.c , LsaPrivs.c
  • RTN_USAGE : NetShare.c , Audit.c , ChngPass.c , AclApi.c , MachAcct.c , LsaPrivs.c , Client.c
  • RU_BREAK_HR_IF_NULL : rasutil.h
  • RU_BREAK_IF_NOT_OK : rasutil.h
  • RU_BREAK_IF_NULL : rasutil.h
  • RU_ELEMENT_COUNT : rasutil.h
  • RU_LEAVE_HR_IF_NULL : rasutil.h
  • RU_LEAVE_IF_NOT_OK : rasutil.h
  • RU_LEAVE_IF_NULL : rasutil.h
  • RU_RETURN_IF_NOT_OK : rasutil.h
  • RU_RETURN_IF_NULL_PARAM : rasutil.h
  • RURASREGROOTNUM : rureg.cpp
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- s -

  • S_RU_EQUALS : rasutil.h
  • S_RU_GREATER : rasutil.h
  • S_RU_LESS : rasutil.h
  • SAFE_ADDREF : common.h , sampprov.h , common.h
  • SAFE_ALLOC : common.h , sampprov.h , common.h
  • SAFE_BSTRALLOC : common.h
  • SAFE_BSTRFREE : common.h
  • SAFE_DELETE : common.h , sampprov.h
  • SAFE_DELETE_ARRAY : sampprov.h
  • SAFE_FREE : common.h , sampprov.h , common.h
  • SAFE_FREE_STRING : StdAfx.h
  • SAFE_REALLOC : common.h , sampprov.h , common.h
  • SAFE_RELEASE : dxsurf2.cpp , dxsurf3.cpp , common.h , sampprov.h , common.h , StdAfx.h , dxsurf1.cpp
  • SAFE_SUBTRACT_POINTERS : CeLibW2k.h
  • SAFE_SYSALLOC : sampprov.h , common.h
  • SAFE_SYSFREE : sampprov.h , common.h
  • SafeCloseHandle : stdafx.h
  • SafeLocalFree : stdafx.h
  • SAFERELEASE : Adminwrap.Cpp
  • SafeRelease : StdAfx.h , stdafx.h , globals.h
  • SafeReleaseClear : globals.h
  • SAMPLE_CLASS : BasicHiPerf.h
  • SAMPLE_CLASS_NAME : ClassProv.Cpp
  • SAMPLE_HELPER_VERSION : nshsamp.h
  • SAMPLE_PROTOCOL_MULTICAST_GROUP : ipsamplerm.h
  • SAMPLE_TAPI_VERSION : TapiCode.c
  • SAMPLEAPI : ipsample.c , ipsample.h
  • SAMPPROV_URL_PREFIX : sampprov.h
  • SB_N_PANES : MidiPlyr.h
  • SB_PANE_STATE : MidiPlyr.h
  • SB_PANE_TFMT : MidiPlyr.h
  • SBITEM_CHARCODE : Status.c
  • SBITEM_CMODEFIRST : Status.c
  • SBITEM_CMODELAST : Status.c
  • SBITEM_EUDC : Status.c
  • SBITEM_FULLSHAPE : Status.c
  • SBITEM_HANJA : Status.c
  • SBITEM_NATIVEMODE : Status.c
  • SBITEM_NOCONVERSION : Status.c
  • SBITEM_OPENSTATUS : Status.c
  • SBITEM_ROMAN : Status.c
  • SBITEM_SOFTKBD : Status.c
  • SBITEM_SYMBOL : Status.c
  • SBS_BOTTOMALIGN : winres.h
  • SBS_HORZ : winres.h
  • SBS_LEFTALIGN : winres.h
  • SBS_RIGHTALIGN : winres.h
  • SBS_SIZEBOX : winres.h
  • SBS_SIZEBOXBOTTOMRIGHTALIGN : winres.h
  • SBS_SIZEBOXTOPLEFTALIGN : winres.h
  • SBS_TOPALIGN : winres.h
  • SBS_VERT : winres.h
  • SC_ARRANGE : winres.h
  • SC_CLOSE : winres.h
  • SC_HOTKEY : winres.h
  • SC_HSCROLL : winres.h
  • SC_KEYMENU : winres.h
  • SC_MAXIMIZE : winres.h
  • SC_MINIMIZE : winres.h
  • SC_MOUSEMENU : winres.h
  • SC_MOVE : winres.h
  • SC_NEXTWINDOW : winres.h
  • SC_PREVWINDOW : winres.h
  • SC_RESTORE : winres.h
  • SC_SCREENSAVE : winres.h
  • SC_SIZE : winres.h
  • SC_TASKLIST : winres.h
  • SC_VSCROLL : winres.h
  • SCALEDIFF : quiktest.h
  • SCRAMBLE : Common.h
  • SCRATCH_BUFFER : Dt_Dll.Cpp
  • SCROLL_RATIO : WinCap.c
  • SD_SIZE : Security.Cpp
  • SDEBUGGLOBALS : Eap.c
  • SDTYPE_ACCESS : DComPerm.h
  • SDTYPE_APPLICATION_ACCESS : DComPerm.h
  • SDTYPE_APPLICATION_LAUNCH : DComPerm.h
  • SDTYPE_DEFAULT_ACCESS : DComPerm.h
  • SDTYPE_DEFAULT_LAUNCH : DComPerm.h
  • SDTYPE_MACHINE_ACCESS : DComPerm.h
  • SDTYPE_MACHINE_LAUNCH : DComPerm.h
  • SEC : FontView.c
  • SEC_INDEX : TIMEWND.c
  • SEC_SEP_INDEX : TIMEWND.c
  • SEC_SUCCESS : KList.c , HttpAuth.c , Security.cpp
  • SECTOMILLISEC : defs.h
  • SECURITY_WIN32 : AuthzSvr.c , KList.c , Gss-Misc.h , HttpAuth.c , Client.cpp , Security.cpp , Server.cpp , WebClient.c , WebServer.c , StdAfx.h , FileRepServer.cpp , FileRepService.cpp , Service.cpp , filerepservice.cpp , SampSSP.H
  • SEEK_FROM_BEGINNING : wn_dos.h
  • SEEK_FROM_END : wn_dos.h
  • SeekHfile : wn_dos.h
  • SEPARATORWIDTH : PlgBlt.h
  • SEQ_F_COLONIZED : SEQ.h
  • SEQ_F_EOF : SEQ.h
  • SEQ_F_WAITING : SEQ.h
  • SEQ_S_NOFILE : SEQ.h
  • SEQ_S_OPENED : SEQ.h
  • SEQ_S_PAUSED : SEQ.h
  • SEQ_S_PLAYING : SEQ.h
  • SEQ_S_PREROLLED : SEQ.h
  • SEQ_S_PREROLLING : SEQ.h
  • SEQ_S_RESET : SEQ.h
  • SEQ_S_STOPPING : SEQ.h
  • SEQ_VERSION : SEQ.h
  • SERVER_ERROR : CustomAuth.h , IsapiRequest.cpp
  • SERVER_PERDRAW_STR : RESDEF.h
  • SERVER_PERSERVE_STR : RESDEF.h
  • SERVER_PERTEXT_STR : RESDEF.h
  • SERVER_REGISTRY_COMMENT : Server.Cpp
  • SERVER_TUTFILE_STR : AptClien.h , ConClien.h , DComDraw.h , DllClien.h , FreClien.h , LocClien.h , RemClien.h , StoClien.h
  • SERVER_WINDOW_TITLE_STR : AptClien.h , LocClien.h
  • ServerCompletionPortTimeout : FileRepServerProc.cpp
  • SERVERPROP : UtilLib.h
  • Service : resource.h
  • SERVICEDISPLAYNAME : Service.h , service.h
  • SERVICENAME : Service.h , service.h
  • SET : WSnmpUtil.h
  • SET_CASE_PROPERTY : property.cpp
  • SET_CUSTOM_PROPERTY : property.cpp
  • SETABORT : stdafx.h
  • SETAUTHIDENTITY : cunknown.h
  • SETAUTHINFO : cunknown.h
  • SETBIT : CeLibW2k.h
  • SetBlockingProvider : spi.cpp
  • SetBottomRight : idt.Cpp
  • SETCOMPLETE : stdafx.h
  • SETDEFAULTFORMATETC : OleStd.h
  • SETDEFAUTHINFO : cunknown.h
  • SETDefFormatEtc : DataObj.h
  • SETDEFSERVERINFO : cunknown.h
  • SetEmptySz : Global.h
  • SETFORMATETC : OleStd.h
  • SetOs : suminfo.h
  • SetPropResult : Global.h
  • SetSliderPos : halftone.c
  • SetSumInfFMTID : suminfo.h
  • SetTopLeft : idt.Cpp
  • SEVERITY_MASK : MsgTest.c
  • SF_BEGINNING : wn_dos.h
  • SF_BUTTON : gutils.h
  • SF_CURRENT : wn_dos.h
  • SF_END : wn_dos.h
  • SF_LEFT : gutils.h
  • SF_LOWER : gutils.h
  • SF_MAXLABEL : status.cpp
  • SF_RAISE : gutils.h
  • SF_RIGHT : gutils.h
  • SF_STATIC : gutils.h
  • SF_SZMAX : gutils.h
  • SF_SZMIN : gutils.h
  • SF_VAR : gutils.h
  • SFGAO_BROWSABLE : Utility.h
  • SHARED_MEMORY_ITEM_COUNT : AppMemi.h
  • SHARED_MEMORY_MUTEX_NAME : AppMemi.h
  • SHARED_MEMORY_MUTEX_TIMEOUT : AppMemi.h
  • SHARED_MEMORY_OBJECT_NAME : AppMemi.h
  • SHARED_MEMORY_OBJECT_SIZE : AppMemi.h
  • SHGDN_INCLUDE_NONFILESYS : Utility.h
  • SI_BUFFER_SIZE : dbh.cpp
  • SID_BUF_SIZE : log.c
  • SID_SIZE : NetShare.c
  • SIDE_BORDER : DebMain.c
  • SIGGEN_NUM_PERF_OBJECT_TYPES : DataGen.h
  • SIGGEN_OBJ : GenCtrnm.h
  • SINE_WAVE : GenCtrnm.h
  • SINK_ID : EventSinks.h
  • SIRENDIR : FaxSiren.Cpp
  • SIZE : Cursor.c
  • SIZE_64K : hashtbl.h
  • SIZE_DATE : IsapiTime.cpp
  • SIZE_ENCODED_CHUNK : IsapiBuffer.cpp , IsapiString.cpp
  • SIZE_FOR_FIRST_TRY : app.cpp
  • SIZE_MSG_BUFFER : DComPerm.h
  • SIZE_NAME_BUFFER : DComPerm.h
  • SIZE_TIME : IsapiTime.cpp
  • SIZE_TIME_STRING : IsapiTime.cpp
  • SIZE_UNENCODED_CHUNK : IsapiBuffer.cpp , IsapiString.cpp
  • sizeofArray : TapiInfo.c
  • SIZEOFCAPTIONTEXT : MfEdit.h
  • SL_BLOCK : Select.h
  • SL_BOX : Select.h
  • SL_EXTEND : Select.h
  • SL_SPECIAL : Select.h
  • SL_TYPE : Select.h
  • sleeptime : Admapit.c
  • SM_NEW : gutils.h
  • SM_SETTEXT : gutils.h
  • SM_TABLETPC : TPCInfo.cpp
  • SMALL_BUFF : Client.cpp , Server.cpp
  • SMALLBUFF : quiktest.h
  • SMF_ALREADY_OPEN : SMF.h
  • SMF_END_OF_FILE : SMF.h
  • SMF_END_OF_TRACK : SMF.h
  • SMF_F_EOF : SMFI.h
  • SMF_F_INSERTSYSEX : SMFI.h
  • SMF_INVALID_BUFFER : SMF.h
  • SMF_INVALID_FILE : SMF.h
  • SMF_INVALID_PARM : SMF.h
  • SMF_INVALID_TRACK : SMF.h
  • SMF_META_PENDING : SMF.h
  • SMF_NO_MEMORY : SMF.h
  • SMF_NO_META : SMF.h
  • SMF_OPEN_FAILED : SMF.h
  • SMF_REACHED_TKMAX : SMF.h
  • SMF_SUCCESS : SMF.h
  • SMF_TF_EOT : SMFI.h
  • SMF_TF_INVALID : SMFI.h
  • SMX_OFFSETOF : DropExt.C
  • SNMP_FAILURE : WSnmpUtil.h
  • SNMPTRAPOIDINDEX : WSnmpUtil.h
  • SNOOP_HEIGHT : snoop.cpp
  • SNOOP_WIDTH : snoop.cpp
  • SNOOP_X_POS : snoop.cpp
  • SNOOP_Y_POS : snoop.cpp
  • SOCKET_BUFF_SIZE : Client.cpp , Server.cpp
  • SOCKET_COUNT : PrPerf.c
  • SOCKETS_METHOD : HttpGet.c
  • SOURCE_GETINTERFACE : cbase.h
  • SOURCE_GETOBJECT : cbase.h
  • SOURCE_GETPARENT : cbase.h
  • SPACE : common.h
  • SPEAKER_NOT_SPECIFIED : childview.h
  • SPEAKERS_USED : childview.h
  • SPIN_EVENT : SpinCube.h
  • SPIN_INTERVAL : SpinCube.h
  • SPINCUBE_EXTRA : SpinCube.h
  • SPINCUBE_REPAINT_BKGND : SpinCube.h
  • SPINCUBECLASS : SpinCube.h
  • SPINCUBEDEFAULTTEXT : SpinCube.h
  • SPINCUBEDESCRIPTION : SpinCube.h
  • SPROCKETS : nshsamp.h
  • SQL_BUF_SIZE : ComSpysqlAudit.h
  • SQL_COPT_SS_BASE : MqTrans.Cpp
  • SQL_COPT_SS_ENLIST_IN_DTC : MqTrans.Cpp
  • SQL_DTC_DONE : MqTrans.Cpp
  • SQL_EXEC : Events.Cpp
  • SQL_FAILED : stdafx.h , bankthrds.Cpp , odbcdata.h
  • SQUARE_WAVE : GenCtrnm.h
  • SS_BLACKFRAME : winres.h
  • SS_BLACKRECT : winres.h
  • SS_CENTER : winres.h
  • SS_ERASE : SpinCube.h , SpinTest.h
  • SS_GRAYFRAME : winres.h
  • SS_GRAYRECT : winres.h
  • SS_ICON : winres.h
  • SS_INMOTION : SpinCube.h , SpinTest.h , DynDlg.c
  • SS_LEFT : winres.h
  • SS_LEFTNOWORDWRAP : winres.h
  • SS_NOPREFIX : winres.h
  • SS_RIGHT : winres.h
  • SS_SIMPLE : winres.h
  • SS_WHITEFRAME : winres.h
  • SS_WHITERECT : winres.h
  • SSLBIT_CASIGN : policy.cpp , Policy.Cpp
  • SSLBIT_CASMIME : policy.cpp , Policy.Cpp
  • SSLBIT_CASSL : policy.cpp , Policy.Cpp
  • SSLBIT_CLIENT : policy.cpp , Policy.Cpp
  • SSLBIT_RESERVED : policy.cpp , Policy.Cpp
  • SSLBIT_SERVER : policy.cpp , Policy.Cpp
  • SSLBIT_SIGN : policy.cpp , Policy.Cpp
  • SSLBIT_SMIME : policy.cpp , Policy.Cpp
  • STA_OFFSET : Resource.h
  • STACK_ENTRY : list.h
  • STANDARD : MSMQTest.c
  • STAR : defs.h
  • START_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES : utilprop.h
  • START_OF_SUPPORTED_DBINIT_PROPERTIES : utilprop.h
  • START_OF_SUPPORTED_ROWSET_PROPERTIES : utilprop.h
  • START_OF_SUPPORTED_SESSION_PROPERTIES : utilprop.h
  • START_SAMPLE_IO : socket.c
  • START_STEP : RendSam.Cpp
  • STAT_ENDOFCURSOR : sampprov.h
  • STATE_COMPARABLE : state.h
  • STATE_DIFFER : state.h
  • STATE_FILELEFTONLY : state.h
  • STATE_FILERIGHTONLY : state.h
  • STATE_LEFTONLY : state.h
  • STATE_MARKED : state.h
  • STATE_MOVEDLEFT : state.h
  • STATE_MOVEDRIGHT : state.h
  • STATE_MSG : Global.h
  • STATE_NONE : common.h
  • STATE_RIGHTONLY : state.h
  • STATE_SAME : state.h
  • STATE_SIMILAR : state.h
  • STATE_SIMILARLEFT : state.h
  • STATE_SIMILARRIGHT : state.h
  • STATE_SIZE : quiktest.h
  • STATEIMAGEINDEX : cdialoglite.h
  • STATIC_COLORS : MfEdit.h
  • STATUS : queue.h
  • STATUS_ARRAY_SIZE : quiktest.h
  • STATUS_ID : Resource.h
  • STATUS_INVALID_PARAMETER : Audit.c
  • STATUS_IS_BOUND : common.h
  • STATUS_OFFLINE : globals.h
  • STATUS_ONLINE : globals.h
  • STATUS_REPORT : Common.h
  • STATUS_REPORT_REF : Common.h
  • STATUS_REPORT_STRING : Common.h
  • STATUS_REPORT_STRING2 : Common.h
  • STATUS_REPORT_STRING2_REF : Common.h
  • STATUS_REPORT_STRING_REF : Common.h
  • STATUS_SUCCESS : Audit.c , LsaPrivs.c , PwdFilt.c , HttpAuth.c
  • STATUSICONSIZE : Global.h
  • STDENTRY : PerServe.h , DllSkel.h , ComObj.h , ConServe.h , DllServe.h , FreServe.h , LicServe.h , PerDraw.h , PerText.h , StoServe.h
  • STDENTRY_ : StoServe.h , ConServe.h , ComObj.h , DllServe.h , DllSkel.h , FreServe.h , LicServe.h , PerDraw.h , PerServe.h , PerText.h
  • StgCreateDocfile : AppUtil.h
  • StgIsStorageFile : AppUtil.h
  • STGM_DFALL : OleStd.h
  • STGM_DFRALL : OleStd.h
  • STGM_SALL : OleStd.h
  • StgOpenStorage : AppUtil.h
  • StgOpenStorageA : ansiapi.h
  • STL_LABEL_Application : stl.h
  • STL_LABEL_ApplicationSize : stl.h
  • STL_LABEL_LabelType : stl.h
  • STL_LABEL_LabelTypeSize : stl.h
  • STL_LABEL_MediaIDBlank : stl.h
  • STL_LABEL_MediaIDSize : stl.h
  • STL_LABEL_TapeNameSize : stl.h
  • STL_LABEL_TimeStampSize : stl.h
  • STL_LABEL_Vendor : stl.h
  • STL_LABEL_VendorSize : stl.h
  • STL_LABEL_Version : stl.h
  • STL_LABEL_VersionSize : stl.h
  • STR2UNI : DComPerm.h
  • STR_ACP : resource.h , res.h
  • STR_APPTITLE : resource.h
  • STR_CPLEN : global.h
  • STR_EXT_TITLE : IcnOvrly.Cpp
  • STR_FMTID_FullPath : columnprovider.Cpp
  • STR_FMTID_ShortFilename : columnprovider.Cpp
  • STR_ItemBool : tracedmp.h
  • STR_ItemChar : tracedmp.h
  • STR_ItemCharShort : tracedmp.h
  • STR_ItemDouble : tracedmp.h
  • STR_ItemDSString : tracedmp.h
  • STR_ItemDSWString : tracedmp.h
  • STR_ItemFloat : tracedmp.h
  • STR_ItemGuid : tracedmp.h
  • STR_ItemIPAddr : tracedmp.h
  • STR_ItemLong : tracedmp.h
  • STR_ItemLongLong : tracedmp.h
  • STR_ItemMLString : tracedmp.h
  • STR_ItemNWString : tracedmp.h
  • STR_ItemPort : tracedmp.h
  • STR_ItemPString : tracedmp.h
  • STR_ItemPtr : tracedmp.h
  • STR_ItemPWString : tracedmp.h
  • STR_ItemShort : tracedmp.h
  • STR_ItemSid : tracedmp.h
  • STR_ItemString : tracedmp.h
  • STR_ItemUChar : tracedmp.h
  • STR_ItemULong : tracedmp.h
  • STR_ItemULongLong : tracedmp.h
  • STR_ItemULongX : tracedmp.h
  • STR_ItemUShort : tracedmp.h
  • STR_ItemWChar : tracedmp.h
  • STR_ItemWString : tracedmp.h
  • STR_LANG : resource.h , res.h
  • STR_LANGID : resource.h , res.h
  • STR_LARGENEGNUMBER : resource.h
  • STR_LARGEPOSNUMBER : resource.h
  • STR_LEN : MqTrans.Cpp , global.h
  • STR_NCOUNTRY : resource.h , res.h
  • STR_NEGCURRENCY : resource.h
  • STR_NLANG : resource.h , res.h
  • STR_OEMCP : res.h , resource.h
  • STR_POSCURRENCY : resource.h
  • STR_QUEUE_LABEL : QueueDef.h
  • STR_QUEUE_NAME : QueueDef.h
  • STR_REG_PATH : IcnOvrly.Cpp
  • STR_RESDLL_NOTFOUND : resource.h
  • STR_TITLE : resource.h
  • STREAM_VIEW_CLASS_NAME : DfV.h
  • STRETCH_BLT : Common.h
  • STRICT : stdafx.h , StdAfx.h , Obscure.c , stdafx.h , OleImp.Cpp , Util.Cpp , secSvr.Cpp , sserver.cpp , StdAfx.h , Dibutil.c , Dialogs.c , StdAfx.h , OleApt.Cpp , stdafx.h , StdAfx.h , stdafx.h , headers.h , dbgUtil.c , enumfetc.c , StdAfx.h , getIcon.c , hatch.c , StdAfx.h , ole2ui.c , stdafx.h , OleStd.c , StdAfx.h , oleutl.c , suminfo.Cpp , targtdev.c , Utility.c , StdAfx.h , drawIcon.c , StdAfx.h , stdafx.h , regdb.c , Cancel.Cpp , stdafx.h , StdAfx.h , Objfdbk.c , StdAfx.h , enumStat.c , msgfiltr.c , Fontsize.c , dballoc.Cpp , quelist.c , queue.c , threads.c , Copy.c , Dllinit.c , File.c , Print.c , ComPerf.Cpp , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , config.cpp , PhoneEntry.c , RasHost.h , StdAfx.h , SidClean.c , StdAfx.h , Stdafx.h , dxsurf3.cpp , StdAfx.h , App32.h , DebMain.c , Check_SD.h , fulldrag.h , Server32.c , SysInfo.h , Rebar.c , Monkey.c , sendto.h , fakemenu.h , tallmenu.h , VListVw.c , Property.c , MciPlay.c , ToolBar.c , StdAfx.h , winmain.h , Client32.c , printjob.c , StdAfx.h , DebMisc.c , DebDebug.c , SetDisp.h , Hello3.h , stdafx.h , StdAfx.h , Hello2.h , EnumerateKeys.cpp , Hook.c , StdAfx.h , Errors.c , StdAfx.h , stdafx.h , Dlgopen.c , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , blrplate.cpp , StdAfx.h , WinCap.c , Wepcode.c , StdAfx.h , errors.c , dialogs.c , stdafx.h , headers.h , stdafx.h , StdAfx.h , Priv.h , StdAfx.h
  • STRING_BUFFER : Extension.cpp
  • STRING_CASE : Debug.Cpp
  • STRING_LENGTH : readcli.c
  • STRING_SEPARATOR : ADs.cpp
  • STRING_SIZE : HelloIsapi.cpp
  • StringFromCLSID2A : ansiapi.h
  • StringFromCLSIDA : ansiapi.h
  • StringFromGUID2 : AppUtil.h
  • StringFromGUID2A : ansiapi.h
  • StringFromIID2A : ansiapi.h
  • STRINGS_ONLY : registry.Cpp , Registry.Cpp , registry.Cpp
  • STRSAFE_LIB : StdAfx.h , Globals.h , StdAfx.h
  • STRSAFE_NO_DEPRECATE : space.Cpp , Utils.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , space.Cpp , BasicHiPerf.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , space.Cpp , UtilLib.h , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , space.Cpp , mmccrack.Cpp , Server.Cpp , mmccrack.Cpp , space.Cpp
  • STRSAFE_WITH_GETS : FTPJr.cpp , httpauth.cpp
  • SUB_TREE : WSnmpUtil.h
  • SUBMITTED : queue.h
  • SUCCESS : TapiCode.c
  • SUCCESS_PRINT : enablerouter.c
  • SUI_F_CANPAUSE : MainWND.c
  • SUI_F_CANPLAY : MainWND.c
  • SUI_F_CANSELDEVICE : MainWND.c
  • SUI_F_CANSTOP : MainWND.c
  • SUMMARY_FILE_NAME : tracedmp.h
  • SUPERMETRIC : nshsamp.h
  • SWAP : DIBSectn.c , WinCap.c
  • SwapPalE : MfEdit.c
  • SYM_BUFFER_SIZE : dbh.cpp
  • SymTagMax : dbh.cpp
  • Syntax : resource.h
  • SYSTEMCLASS : UtilLib.h
  • SYSTEMPREFIX : UtilLib.h
  • SYSUPTIMEINDEX : WSnmpUtil.h
  • SZ_ABS_SD_BUF : SidClean.c
  • SZ_ACCT_NAME_BUF : SidClean.c
  • SZ_DACL_BUF : SidClean.c
  • SZ_DMN_NAME_BUF : SidClean.c
  • SZ_NAME_BUF : SidClean.c
  • SZ_OUTPUTFILENAME : Processing.cpp
  • SZ_REL_SD_BUF : SidClean.c
  • SZ_SACL_BUF : SidClean.c
  • SZ_SAMPLESYNCMGRHANDLERWNDCLASS : Handler.h
  • SZ_SAMPLESYNCMGRWORKERWNDCLASS : Handler.h
  • SZ_SID_OWN_BUF : SidClean.c
  • SZ_SID_PG_BUF : SidClean.c
  • SZABOUT : GLOBALS.h
  • szAddress : custom.c
  • SZAPPNAME : GLOBALS.h , Service.H
  • szClass : CDTest.c
  • SZCLASSCLIENT : Framer.h
  • SZCLASSFRAME : Framer.h
  • szCloseQuery : OleApt.Cpp , OleImp.Cpp
  • SZDEPENDENCIES : Service.H
  • SZDESCRIPTION : GLOBALS.h
  • szIcon : CDTest.c
  • szMenu : CDTest.c
  • szOID_CERTTYPE_EXTENSION : Exit.Cpp , Policy.Cpp
  • SZOLEUI_MSG_FILEOKSTRING : OleStd.h
  • SZRAPPNAME : Globals.h , GLOBALS.h
  • SZRCOMPANYNAME : GLOBALS.h , Globals.h
  • SZRCOPYRIGHT : GLOBALS.h , Globals.h
  • SZRDESCRIPTION : GLOBALS.h , Globals.h
  • SZRPRODNAME : Globals.h , GLOBALS.h
  • SZRPRODVER : GLOBALS.h , Globals.h
  • SZRTRADEMARK : GLOBALS.h , Globals.h
  • SZRVERSION : GLOBALS.h , Globals.h
  • SZSERVICEDISPLAYNAME : Service.H
  • SZSERVICENAME : Service.H
  • SZTEMP_SIZE : HeadDump.cpp
  • SZTERMNAME : plgterm.h
  • szTitle : CDTest.c
  • szTitleClient : OleApt.Cpp , ComPerf.Cpp
  • szTitleServer : OleImp.Cpp , OleApt.Cpp , ComPerf.Cpp
  • SZVERSION : GLOBALS.h
  • szWindowClass : OleApt.Cpp , OleImp.Cpp
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- t -

  • T2CW : StrConv.h
  • T2W : globals.h , StrConv.h
  • T_CCF_ATTRIB_PTR : globals.h
  • T_CCF_BASENODE_PTR : globals.h
  • T_CCF_DATAOBJ_PTR : globals.h
  • T_CCF_DISPLAY_NAME : globals.h
  • T_CCF_MMC_MULTISELECT_DATAOBJECT : globals.h
  • T_CCF_MULTI_SELECT_SNAPINS : globals.h
  • T_CCF_MULTISELECT_COOKIES : globals.h
  • T_CCF_NODEPROP_PTR : globals.h
  • T_CCF_NODETYPE : globals.h
  • T_CCF_NODETYPE_FLG : globals.h
  • T_CCF_OBJECT_TYPES_IN_MULTI_SELECT : globals.h
  • T_CCF_SNAPIN_CLASSID : globals.h
  • T_CCF_SZNODETYPE : globals.h
  • TABID_PRINTER : sdkdiff.cpp
  • TableClassName : table.h
  • TableMessage : table.h
  • TABSTOP : FullIME.h , HalfIME.h
  • TABWIDTH_DEFAULT : table.h
  • TAIL_OFFSET : spy.cpp
  • TAIL_SIGNITURE : spy.cpp
  • TAPI_CURRENT_VERSION : Atsp.c , Dialer.h
  • TAPI_TIMEOUT : FileTerm.h
  • TAPI_VERSION_1_0 : Dialer.h
  • TAPI_VERSION_1_4 : Dialer.h
  • TAPI_VERSION_2_0 : Dialer.h
  • TB_CLASS_NAME : ToolBand.h
  • TB_MAX_SIZE_Y : ToolBand.h
  • TB_MIN_SIZE_X : ToolBand.h
  • TB_MIN_SIZE_Y : ToolBand.h
  • TB_SPACE : ToolBar.h
  • TC_BUTTON : Tools.c
  • TC_COMBO : Tools.c
  • TC_LABEL : Tools.c
  • TC_SPACE : Tools.c
  • TCHAR : APP.h
  • TCHAR_LEN_IN_BYTES : CmdLineConsumer.Cpp , PermEvents.Cpp
  • TEMP_BUF : people.Cpp
  • TEMPNAMESIZE : Open.h
  • TEST : common.h , sampprov.h , common.h
  • TEST_ABORTED : autotest.h
  • TEST_CONNECT_OPTION : quiktest.h
  • TEST_STMT_OPTION : quiktest.h
  • TESTC : common.h , sampprov.h , common.h
  • TESTC_ : common.h
  • TEXT : APP.h
  • TEXT1 : SysInf_S.c
  • TEXT_LEN : Dt.h
  • TEXT_WINDOW_CLASS_MENU_STR : RESDEF.h
  • TEXT_WINDOW_CLASS_NAME_STR : RESDEF.h
  • TEXT_WINDOW_NAME_STR : RESDEF.h
  • THIS_POINTER_OFFSET : tsfedit.cpp , tsfwnd.cpp
  • THROW_ERR : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h
  • THROW_STR : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h
  • TICKSPACE : PlgBlt.c , WxForm.h
  • TID : AppUtil.h
  • TIM : wn_dos.h
  • TIME_INTERVAL : LeakyBin.h
  • TIME_OUT : Server32.h
  • TIMEOUT : SnmpUtil.C , onaddequipment.cpp , onenumdisks.cpp , onenumsvcs.cpp
  • TIMEOUT_ANIMATED_ICON : DebMain.c
  • TIMER_ID : TIMEWND.c , CallNot.h , dxsurf2.cpp
  • TIMER_INTERVAL : TIMEWND.c
  • TIMER_TIMEOUT : STATBAR.h
  • TITLE : dxsurf1.cpp , dxsurf2.cpp
  • TITLE_SIZE : Utility.h
  • TM_APPEND : table.h
  • TM_CELL : table.h
  • TM_CURRENTVIEW : sdkdiff.h
  • TM_ENDROW : table.h
  • TM_FOCUS : table.h
  • TM_GETSELECTION : table.h
  • TM_MANY : table.h
  • TM_NEWID : table.h
  • TM_NEWLAYOUT : table.h
  • TM_PRINT : table.h
  • TM_REFRESH : table.h
  • TM_ROW : table.h
  • TM_SELECT : table.h
  • TM_SERVER_PROCESS : MainFrm.h
  • TM_SERVERDLG : MainFrm.h
  • TM_SETTABWIDTH : table.h
  • TM_SINGLE : table.h
  • TM_SOLID : table.h
  • TM_TOPROW : table.h
  • tmain : ProcList.c
  • TMALL : Track.h
  • TMD_ASCENT : FontView.h
  • TMD_AVEWIDTH : FontView.h
  • TMD_BASE : FontView.h
  • TMD_BREAKCHAR : FontView.h
  • TMD_CHARSET : FontView.h
  • TMD_DEFAULTCHAR : FontView.h
  • TMD_DESCENT : FontView.h
  • TMD_DIGITIZEDASPECTX : FontView.h
  • TMD_DIGITIZEDASPECTY : FontView.h
  • TMD_EXTERNAL : FontView.h
  • TMD_FIRSTCHAR : FontView.h
  • TMD_HEIGHT : FontView.h
  • TMD_INTERNAL : FontView.h
  • TMD_ITALIC : FontView.h
  • TMD_LASTCHAR : FontView.h
  • TMD_MAXWIDTH : FontView.h
  • TMD_OVERHANG : FontView.h
  • TMD_PITCHANDFAMILY : FontView.h
  • TMD_SET : FontView.h
  • TMD_STRUCKOUT : FontView.h
  • TMD_UNDERLINE : FontView.h
  • TMD_WEIGHT : FontView.h
  • TMMOVE : Track.h , WxForm.h
  • TMNONE : Track.h , WxForm.h
  • TMROTATE : Track.h , WxForm.h
  • TMSHEARX : Track.h , WxForm.h
  • TMSHEARY : Track.h , WxForm.h
  • TMSIZEX : Track.h , WxForm.h
  • TMSIZEXY : Track.h , WxForm.h
  • TMSIZEY : WxForm.h , Track.h
  • TOKEN : malspy.c
  • TOKEN_ADD : nshsamp.h
  • TOKEN_ALL : nshsamp.h
  • TOKEN_DISABLED : nshsamp.h
  • TOKEN_ENABLED : nshsamp.h
  • TOKEN_GATEWAY : nshsamp.h
  • TOKEN_HIGH : nshsamp.h
  • TOKEN_IA64 : nshsamp.h
  • TOKEN_ID : nshsamp.h
  • TOKEN_INTERFACE : nshsamp.h
  • TOKEN_LOW : nshsamp.h
  • TOKEN_MEDIUM : nshsamp.h
  • TOKEN_POTENTIAL : nshsamp.h
  • TOKEN_RESET : nshsamp.h
  • TOKEN_SAMPLE : nshsamp.h
  • TOKEN_SAMPLEINTERFACE : nshsamp.h
  • TOKEN_SET : nshsamp.h
  • TOKEN_SHOW : nshsamp.h
  • TOKEN_SHOWERROR : nshsamp.h
  • TOKEN_SOURCE_NAME : HttpAuth.c , Security.cpp
  • TOKEN_SPROCKETS : nshsamp.h
  • TOKEN_SUBCONTEXT : nshsamp.h
  • TOKEN_SUPERMETRIC : nshsamp.h
  • TOKEN_UNKNOWN : nshsamp.h
  • TOKEN_USERDATA : nshsamp.h
  • TOKEN_WIDGETS : nshsamp.h
  • TOKEN_X86 : nshsamp.h
  • TOOLBAR_ID : Resource.h
  • TOOLBUTTON_STD120HEIGHT : BttnCur.h
  • TOOLBUTTON_STD120IMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STD120IMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STD120WIDTH : BttnCur.h
  • TOOLBUTTON_STD72HEIGHT : BttnCur.h
  • TOOLBUTTON_STD72IMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STD72IMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STD72WIDTH : BttnCur.h
  • TOOLBUTTON_STD96HEIGHT : BttnCur.h
  • TOOLBUTTON_STD96IMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STD96IMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STD96WIDTH : BttnCur.h
  • TOOLBUTTON_STDHEIGHT : BttnCur.h
  • TOOLBUTTON_STDIMAGEHEIGHT : BttnCur.h
  • TOOLBUTTON_STDIMAGEWIDTH : BttnCur.h
  • TOOLBUTTON_STDWIDTH : BttnCur.h
  • TOOLIMAGE_EDITCOPY : BttnCur.h
  • TOOLIMAGE_EDITCUT : BttnCur.h
  • TOOLIMAGE_EDITPASTE : BttnCur.h
  • TOOLIMAGE_FILENEW : BttnCur.h
  • TOOLIMAGE_FILEOPEN : BttnCur.h
  • TOOLIMAGE_FILEPRINT : BttnCur.h
  • TOOLIMAGE_FILESAVE : BttnCur.h
  • TOOLIMAGE_HELP : BttnCur.h
  • TOOLIMAGE_HELPCONTEXT : BttnCur.h
  • TOOLIMAGE_MAX : BttnCur.h
  • TOOLIMAGE_MIN : BttnCur.h
  • TOP : Rebar.c
  • Top : resource.h
  • TOP_BORDER : DebMain.c
  • TOTAL_EVENTS : Sender.Cpp
  • TQ_CLOSE : table.h
  • TQ_ENTER : table.h
  • TQ_GETCOLPROPS : table.h
  • TQ_GETDATA : table.h
  • TQ_GETSIZE : table.h
  • TQ_PUTDATA : table.h
  • TQ_SCROLL : table.h
  • TQ_SELECT : table.h
  • TQ_SHOWWHITESPACE : table.h
  • TQ_TABS : table.h
  • TRACE : asserts.h , DynOuts.c , winmain.h , Debug.h , common.h
  • TRACE0 : defs.h
  • TRACE1 : defs.h
  • TRACE2 : defs.h
  • TRACE3 : defs.h
  • TRACE4 : defs.h
  • TRACE5 : defs.h
  • TRACE_ADDREF : ctrace.h
  • TRACE_ERROR : sdkdiff.h , list.cpp
  • TRACE_EVENT : tracemacro.h
  • TRACE_HRESULT : tracemacro.h
  • TRACE_METHOD : ctrace.h
  • TRACE_MSG : Global.h
  • TRACE_NOTIFICATION : ctrace.h
  • TRACE_PTR : tracemacro.h
  • TRACE_QI : ctrace.h
  • TRACE_RELEASE : ctrace.h
  • TRACE_RELEASE_ : ctrace.h
  • TRACE_START : tracemacro.h
  • TRACE_VAL : tracemacro.h
  • TRACEFMT : common.h
  • TRACEID : defs.h
  • TRACEMSG : Global.h
  • TRACK_CELL : tpriv.h
  • TRACK_COLUMN : tpriv.h
  • TRACK_NONE : tpriv.h
  • TRANSFER : resource.h
  • TRAP : SnmpUtil.C , WSnmpUtil.h
  • TRC : SetDisp.c
  • TRIANGLE_WAVE : GenCtrnm.h
  • TROB_CENTER : WxForm.h
  • TROB_DELETE : WxForm.h , Track.h
  • TROB_HITTEST : WxForm.h , Track.h
  • TROB_NEW : WxForm.h , Track.h
  • TROB_PAINT : WxForm.h , Track.h
  • TROB_SETXFORM : WxForm.h
  • TRUE : LinkList.h
  • true : dbh.cpp
  • TRYDB : adoheader.h
  • TSDLL : SysInf_C.c
  • TSMEMORYINFO : SysInfo.h
  • TSVERSIONINFO : SysInfo.h
  • TUTORIAL_EXE_STR : AppUtil.h
  • TXT_FILE_EXT : AppUtil.h
  • TYPE_FORMAT_STRING_SIZE : ADsFirstExt_p.c , EdCommands_p.c , Render_p.c , ADsFirstExt_p.c , EDAnnotator_p.c , EdHost_p.c , ADsError_p.c , EdCommands_p.c , BrochureMachine_p.c , EdGlyphs_p.c
  • TYPE_PORTION : quiktest.h
  • TypeSafeParams : ClRes.h , StdAfx.h
  • TypeSafeQI : StdAfx.h , ClRes.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- u -

  • UC : tracedmp.h
  • UCHAR : APP.h
  • uchar : suminfo.Cpp
  • ulong : suminfo.Cpp
  • UM_CREATE_LISTBOX : Deb.h
  • UMSG_DECREMENTDLGCOUNT : CDTest.h
  • UNDERSCORE : common.h
  • UNI2STR : DComPerm.h
  • UNICODE : CreateUserHelpers.cpp , StdAfx.h , Outgoing.Cpp , main.cpp , SubAuth.c , KList.c , secClnt.Cpp , UserProps.cpp , MyToken.cpp , SecPrint.c , StdAfx.h , Main.Cpp , Privobji.Cpp , secSvr.Cpp , ADSIhelpers.cpp , Security.Cpp , SuperUsr.cpp , main.cpp , RSAKey.cpp , SignHash.cpp , oledbcomponent.h , ADSIhelpers.cpp , LogonNP.c , Create.Cpp , main.cpp , Process.cpp , Remove.cpp , propdump.cpp , main.hxx , SamplCli.Cpp , BasicHiPerf.Cpp , main.hxx , BasicHiPerf.h , Factory.Cpp , stgcreatepropsetstg.cpp , MqTrans.Cpp , AsyncDemo.cpp , nshsamp.cpp , ClRes.h , writeread.cpp , nshsamp.h , DispTree.Cxx , HtmlProp.Cxx , customdial.cpp , DispTree.Cxx , app.cpp , QSample.Cxx , main.cpp , customdialreg.cpp , DLEdit.Cpp , loadprotocol.c
  • UNICODE_NULL : Npaux.h
  • UNICODEOLE32 : ansiapi.h
  • UNINITIALIZED : Main.Cxx
  • UNKNOWNSIDS : Check_SD.h
  • UNREACHED : dballoc.Cpp
  • UNREFERENCED : UtilLib.h
  • UNSCRAMBLE : Common.h
  • UNTOUCHED : quiktest.h
  • UNUSED : StdAfx.h
  • upcase : recvbuf.Cpp
  • UPCASE_ANSI_CHAR : IsapiString.cpp , UpCaseMap.cpp
  • UPDATELINKS_STARTDELAY : OleStd.h
  • URL_ESCAPE_UNSAFE : cpack.cpp
  • URL_SCHEME : sdksamplestoragesystem.h
  • URL_SCHEME_LENGTH : sdksamplestoragesystem.h
  • USE_MEMORY : keys.cpp
  • USE_STUBLESS_PROXY : ADsError_p.c , EdCommands_p.c , BrochureMachine_p.c , ADsFirstExt_p.c , EDAnnotator_p.c , EdHost_p.c , Render_p.c , EdGlyphs_p.c , EdCommands_p.c
  • USE_WORK_QUEUE : ftrans.c , fwasync.c
  • USEDONLY : Grid.Hxx
  • User : resource.h
  • USER_ACCESS : SecFile.c
  • USER_LIST_FILE : db.c
  • USERNAMELEN : securitysub.h
  • USERS_OFFSET : spy.cpp
  • USES_CONVERSION : StrConv.h
  • USESTRINGSALSO : profile.h
  • UtDupStringA2W : ansiapi.h
  • UTIL_NOACCESS : util.h
  • UTIL_READONLY : util.h
  • UTIL_READWRITE : util.h
  • UTILITY_OPTION_REFRESH : UtilitiesDlg.Cpp
  • UTILITY_OPTION_START : UtilitiesDlg.Cpp
  • UTILITY_OPTION_STOP : UtilitiesDlg.Cpp
  • UTILITY_OPTION_UNDEFINED : UtilitiesDlg.Cpp
  • UTILITY_TYPE_JNEC : UtilitiesDlg.Cpp
  • UTILITY_TYPE_ROUTER : UtilitiesDlg.Cpp
  • UTILITY_TYPE_START_APP : AppUtilDlg.h
  • UTILITY_TYPE_STOP_APP : AppUtilDlg.h
  • UTILITY_TYPE_UNDEFINED : UtilitiesDlg.Cpp , AppUtilDlg.h
  • UUID_IPluggableTransport : iplgxprt.idl
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- v -

  • ValidString : FaxSiren.Cpp
  • VALUE_CHAR : common.h
  • VALUE_CHAR_HR : common.h
  • VALUE_IS_BOUND : common.h
  • VALUE_PWCHAR : common.h
  • VALUE_STRING : Utility.Cpp
  • VALUE_WCHAR : common.h , common.cpp , error.cpp
  • VAR_BUFFER_SIZE : DumpVars.cpp
  • VC_EXTRALEAN : StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h
  • VELMAX : Poly.h
  • VELMIN : Poly.h
  • VER_COMPANYNAME_STR : version.h , sampver.h , version.h
  • VER_FILEDESCRIPTION_STR : DfV.h
  • VER_FILEFLAGS : version.h , sampver.h , version.h
  • VER_FILEFLAGSMASK : version.h , sampver.h , version.h
  • VER_FILEOS : version.h , sampver.h , version.h
  • VER_FILEVERSION : version.h , sampver.h , version.h
  • VER_FILEVERSION_STR : version.h , sampver.h , version.h
  • VER_INTERNALNAME_STR : DfV.h
  • VER_LEGALCOPYRIGHT_STR : sampver.h , version.h , sampver.h
  • VER_ORIGINALFILENAME_STR : DfV.h
  • VER_PRODUCTNAME_STR : version.h , sampver.h , version.h
  • VER_PRODUCTVERSION : version.h , sampver.h , version.h
  • VER_PRODUCTVERSION_STR : version.h , sampver.h , version.h
  • VERB_OPEN : ioo.Cpp
  • VERBOSE : Const.H
  • Verify : StdAfx.h
  • VERIFY_RESCHANGE : SetDisp.h
  • VERIFY_SCHEMA : resource.h
  • VERIFY_TIMEOUT : SetDisp.h
  • VERSION_MAJOR : SEQ.h
  • VERSION_MAJOR_W2K_XP_W2K3 : UtilS.Cpp
  • VERSION_MINOR : SEQ.h
  • VERSION_MINOR_W2K : UtilS.Cpp
  • VERSION_MINOR_W2K3 : UtilS.Cpp
  • VERSION_MINOR_XP : UtilS.Cpp
  • VIEW_CASE_PROPERTY : property.cpp
  • VIEW_CLASS_NAME : OLEDocVw.h
  • VIEW_CUSTOM_PROPERTY : property.cpp
  • VIEW_POINTER_OFFSET : Utility.h , PropSheetHost.h
  • ViewEnter : view.cpp
  • ViewLeave : view.cpp
  • VK_ADD : winres.h
  • VK_BACK : winres.h
  • VK_CANCEL : winres.h
  • VK_CAPITAL : winres.h
  • VK_CLEAR : winres.h
  • VK_CONTROL : winres.h
  • VK_DECIMAL : winres.h
  • VK_DELETE : winres.h
  • VK_DIVIDE : winres.h
  • VK_DOWN : winres.h
  • VK_END : winres.h
  • VK_ESCAPE : winres.h
  • VK_EXECUTE : winres.h
  • VK_F1 : winres.h
  • VK_F10 : winres.h
  • VK_F11 : winres.h
  • VK_F12 : winres.h
  • VK_F13 : winres.h
  • VK_F14 : winres.h
  • VK_F15 : winres.h
  • VK_F16 : winres.h
  • VK_F17 : winres.h
  • VK_F18 : winres.h
  • VK_F19 : winres.h
  • VK_F2 : winres.h
  • VK_F20 : winres.h
  • VK_F21 : winres.h
  • VK_F22 : winres.h
  • VK_F23 : winres.h
  • VK_F24 : winres.h
  • VK_F3 : winres.h
  • VK_F4 : winres.h
  • VK_F5 : winres.h
  • VK_F6 : winres.h
  • VK_F7 : winres.h
  • VK_F8 : winres.h
  • VK_F9 : winres.h
  • VK_HELP : winres.h
  • VK_HOME : winres.h
  • VK_INSERT : winres.h
  • VK_LBUTTON : winres.h
  • VK_LEFT : winres.h
  • VK_MBUTTON : winres.h
  • VK_MENU : winres.h
  • VK_MULTIPLY : winres.h
  • VK_NEXT : winres.h
  • VK_NUMLOCK : winres.h
  • VK_NUMPAD0 : winres.h
  • VK_NUMPAD1 : winres.h
  • VK_NUMPAD2 : winres.h
  • VK_NUMPAD3 : winres.h
  • VK_NUMPAD4 : winres.h
  • VK_NUMPAD5 : winres.h
  • VK_NUMPAD6 : winres.h
  • VK_NUMPAD7 : winres.h
  • VK_NUMPAD8 : winres.h
  • VK_NUMPAD9 : winres.h
  • VK_PAUSE : winres.h
  • VK_PRINT : winres.h
  • VK_PRIOR : winres.h
  • VK_RBUTTON : winres.h
  • VK_RETURN : winres.h
  • VK_RIGHT : winres.h
  • VK_SCROLL : winres.h
  • VK_SELECT : winres.h
  • VK_SEPARATOR : winres.h
  • VK_SHIFT : winres.h
  • VK_SNAPSHOT : winres.h
  • VK_SPACE : winres.h
  • VK_SUBTRACT : winres.h
  • VK_TAB : winres.h
  • VK_UP : winres.h
  • VPWL_OBJECTPOINTER : FVText.h
  • VT_CF_BYTES : suminfo.h
  • VT_CF_EMPTY : suminfo.h
  • VT_CF_FMTID : suminfo.h
  • VT_CF_MAC : suminfo.h
  • VT_CF_NAME : suminfo.h
  • VT_CF_OOM : suminfo.h
  • VT_CF_WIN : suminfo.h
  • VTCB : suminfo.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- w -

  • W2A : debug.h , ansiapi.h , StrConv.h , ansiapi.h
  • W2AHELPER : StrConv.h
  • W2CA : StrConv.h
  • W2CT : StrConv.h
  • W2T : globals.h , StrConv.h , globals.h
  • WAITERR_WAITABORTED : TapiCode.c
  • WAITERR_WAITTIMEDOUT : TapiCode.c
  • WAITTIMEOUT : TapiCode.c
  • WALK : SnmpUtil.C , WSnmpUtil.h
  • WARN_MSG : Global.h
  • WASANSI : ansiapi.h
  • WAVE_TOGGLE_ALLOW : wave.h
  • WAVE_TOGGLE_DESTINATION : wave.h
  • WAVE_TOGGLE_DISABLE : wave.h
  • WCSCMP : stdafx.h
  • WCSCPY : stdafx.h
  • WCSNCMP : stdafx.h
  • WCSNCPY : stdafx.h
  • WDEnter : sdkdiff.cpp
  • WDLeave : sdkdiff.cpp
  • wEOL : common.h , sampprov.h
  • WHITE : MfEdit.h
  • WIDESTRING : common.h
  • WIDGETS : nshsamp.h
  • WIDTHBYTES : Dibapi.h , Dib.h
  • WILD_UNDERSCORE : dbh.cpp
  • WIN : wn_dos.h , setup.cpp , setupui.cpp , upgrdmsi.cpp , utils.cpp , vertrust.cpp
  • WIN32_LEAN_AND_MEAN : IocpServer.Cpp , IocpServerex.Cpp , Ioctl.c , Simplec.c , Simples.c , StdAfx.h , DumpVars.cpp , formdump.cpp , html.cpp , keys.cpp , readcli.c , fwrite.c , KeepAlive.c , KeepAliveP.c , ThreadPool.c , Redirect.cpp , Simple.cpp , WorkerThread.c , Commands.Cpp , DskQuota.Cpp , PrintMenu.Cpp , ProcessMenu.Cpp , DLEdit.Cpp , FCopy.Cpp , ProcList.c , AboutDlg.c , MainWnd.c , StatList.c , WinUtils.c , stdafx.h , stgcreatepropsetstg.cpp , writeread.cpp , StdAfx.h , sampclnt.h , headers.h , StdAfx.h , stdafx.h , StdAfx.h , RasDial.c , RasDialAsync.c , StdAfx.h
  • WIN32ERROR_FROM_DELAYLOAD : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • WIN32ERROR_FROM_HRESULT : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • Win4Assert : Debug.Hxx
  • WINDLL : dballoc.Cpp , ole2ui.c
  • WINDOW_HEIGHT : IconPRO.h
  • WINDOW_MENU_POSITION : resource.h
  • WINDOW_ONLY : Dt.h
  • WINDOW_WIDTH : IconPRO.h
  • WINDOWS_LEAN_AND_MEAN : Create.Cpp , msiloc.cpp , Process.cpp , Remove.cpp , Tutorial.cpp
  • WinOpenFile : wn_dos.h
  • WINPROCTYPE : gutils.h
  • WINTRUST_DLL : vertrust.cpp
  • WINTRUSTAPI_WinVerifyTrust : vertrust.cpp
  • WINTRUSTAPI_WTHelperGetProvCertFromChain : vertrust.cpp
  • WINTRUSTAPI_WTHelperGetProvSignerFromChain : vertrust.cpp
  • WINTRUSTAPI_WTHelperProvDataFromStateData : vertrust.cpp
  • WINVER : Qoslist.Cpp , customdial.cpp , customdialreg.cpp , StdAfx.h , EnumerateKeys.cpp
  • WL_TABLE : tpriv.h
  • WLTOTAL : tpriv.h
  • WM_ADD_DEVICENODE : globals.h
  • WM_ADD_VIRTUALFILE : globals.h
  • WM_ADDNEW_NODE : globals.h
  • WM_ADSPROP_SHEET_CREATE : PropSheetHost.h
  • WM_APP : Deb.h , Client32.h
  • WM_CF_LF : Font.h
  • WM_CONNECTED : nmsession.h
  • WM_CONNECTING : nmsession.h
  • WM_DEL_DEVICENODES : globals.h
  • WM_DELETE_NODE : globals.h
  • WM_DEVICENODE_CLOSED : globals.h
  • WM_DIALOG_CLOSED : globals.h
  • WM_DISCONNECTED : nmsession.h
  • WM_DISCOVERYCOMPLETE : backgrnd.Cpp
  • WM_DOCAPTURE : WinCap.c
  • WM_DSA_SHEET_CLOSE_NOTIFY : PropSheetHost.h
  • WM_DSA_SHEET_CREATE_NOTIFY : PropSheetHost.h
  • WM_GETFIRSTKEY : Monkey.h
  • WM_GO_AWAY : Client32.h
  • WM_INITCLIENT : Client32.h
  • WM_NEWOBJECT : backgrnd.Cpp
  • WM_PLGBLT : PlgBlt.h
  • WM_PLUGABLE_SOCKET : nmsession.h
  • WM_PRIVATETAPIEVENT : CallNot.h , Callnot.h , common.h
  • WM_PUTUPFLOATS : WxForm.h
  • WM_PUTUPLPOINTS : PlgBlt.h
  • WM_PUTUPMASKPT : PlgBlt.h
  • WM_PUTUPSRCRECT : PlgBlt.h
  • WM_REFRESH_EVENT : people.Cpp
  • WM_RTC_EVENT : rtcwin.h
  • WM_RTCCORE_EVENT : RTCIncomingDlg.h , RTCOutgoingDlg.h
  • WM_SHOWERROR : bankdlg.h
  • WM_SHOWRESULTS : bankdlg.h
  • WM_SNMP_DONE : WSnmpUtil.h
  • WM_SNMP_INCOMING : WSnmpUtil.h
  • WM_SOCKET : provider.h
  • WM_SPIN : PlgBlt.h
  • WM_START_PLAYBACK : childview.h
  • WM_STOP_PLAYBACK : childview.h
  • WM_U_UPDATELINK : ole2ui.c
  • WM_USER : winres.h
  • WM_USER_ASYNCSELECT_MSG : common.h
  • WM_USER_PAGECHANGED : IPageS.h
  • WM_USER_PAGECLOSED : IPageS.h
  • WM_VBXINIT : afxres.h
  • WM_VIRTUALFILE_CLOSED : globals.h
  • WM_WMI_CONNECTED : people.Cpp
  • WM_WORKERMSG_DELETELOGERROR : Handler.h
  • WM_WORKERMSG_ENABLEMODELESS : Handler.h
  • WM_WORKERMSG_ESTABLISHCONNECTION : Handler.h
  • WM_WORKERMSG_LOGERROR : Handler.h
  • WM_WORKERMSG_PREPAREFORSYNCCOMPLETED : Handler.h
  • WM_WORKERMSG_PREPFORSYNC : Handler.h
  • WM_WORKERMSG_PROGRESS : Handler.h
  • WM_WORKERMSG_RELEASE : Handler.h
  • WM_WORKERMSG_SHOWERROR : Handler.h
  • WM_WORKERMSG_SHOWERRORCOMPLETED : Handler.h
  • WM_WORKERMSG_SHOWPROPERTIES : Handler.h
  • WM_WORKERMSG_SHOWPROPERTIESCOMPLETED : Handler.h
  • WM_WORKERMSG_SYNCHRONIZE : Handler.h
  • WM_WORKERMSG_SYNCHRONIZECOMPLETED : Handler.h
  • WMAX : Print.c
  • WMAXDEV : Print.c
  • WMCOMMANDWPARAM : MultiUI.h
  • WndEOL : common.h
  • WNDEXTRA_NOUINOIMC : MultiUI.h
  • WNDEXTRA_NOUIOWNIMC : MultiUI.h
  • WNDEXTRA_OWNUIOWNIMC : MultiUI.h
  • WORD : suminfo.Cpp
  • WORDMAX : suminfo.h
  • WORDSWAP : SMFI.h
  • WORK_INITIALIZE_ITEM : AsyncIO.h
  • WORK_ITEM : AsyncIO.h
  • WORK_QUEUE_ENTRIES : ThreadPool.h
  • WORK_TERMINATE_ITEM : AsyncIO.h
  • WORLD_ACCESS : SecFile.c
  • WRITE : Check_SD.h
  • WRITE_BUFFER_SIZE : WildCardMap.cpp
  • WRITE_LOCK_TO_READ_LOCK : sync.h
  • WRITE_LOG_FILE : Admapit.c
  • WriteFmtUserTypeStg : AppUtil.h
  • WriteKey : UnBufCp1.c
  • WS_BORDER : winres.h
  • WS_CAPTION : winres.h
  • WS_CHILD : winres.h
  • WS_CHILDWINDOW : winres.h
  • WS_CLIPCHILDREN : winres.h
  • WS_CLIPSIBLINGS : winres.h
  • WS_DISABLED : winres.h
  • WS_DLGFRAME : winres.h
  • WS_EX_LAYOUTRTL : global.h
  • WS_EX_NOINHERITLAYOUT : global.h
  • WS_GROUP : winres.h
  • WS_HSCROLL : winres.h
  • WS_ICONIC : winres.h
  • WS_MAXIMIZE : winres.h
  • WS_MAXIMIZEBOX : winres.h
  • WS_MINIMIZE : winres.h
  • WS_MINIMIZEBOX : winres.h
  • WS_OVERLAPPED : winres.h
  • WS_OVERLAPPEDWINDOW : winres.h
  • WS_POPUP : winres.h
  • WS_POPUPWINDOW : winres.h
  • WS_SIZEBOX : winres.h
  • WS_SYSMENU : winres.h
  • WS_TABSTOP : winres.h
  • WS_THICKFRAME : winres.h
  • WS_TILED : winres.h
  • WS_TILEDWINDOW : winres.h
  • WS_VER : Overlap.c
  • WS_VISIBLE : winres.h
  • WS_VSCROLL : winres.h
  • WSAEVENTSELECT_EVENT : Sender.Cpp
  • WSASEND_EVENT : Sender.Cpp
  • WSIZECC : Colors.c
  • WSIZEFO : Font.c
  • WSIZEFR : Find.c
  • wsz_SAMPLE_COPYRIGHT : pch.cpp , Exit.h , Policy.h , pch.cpp
  • wsz_SAMPLE_DESCRIPTION : pch.cpp , Exit.h , pch.cpp , Policy.h
  • wsz_SAMPLE_FILEVER : Exit.h , pch.cpp , Policy.h , pch.cpp
  • wsz_SAMPLE_NAME : pch.cpp , Exit.h , Policy.h , pch.cpp
  • wsz_SAMPLE_PRODUCTVER : pch.cpp , Exit.h , Policy.h , pch.cpp
  • wszATTREMAIL1 : Policy.h , policy.h
  • wszATTREMAIL2 : Policy.h , policy.h
  • wszCERTENROLLSHAREPATH : CeLibW2k.h
  • wszCertFile : Exit.Cpp
  • wszCERTTYPE_CROSS_CA : policy.h
  • wszCERTTYPE_SUBORDINATE_CA : Policy.Cpp , policy.h
  • wszCLASS_CERTENCODEALTNAME : AltName.h
  • wszCLASS_CERTENCODEBITSTRING : BitStr.h
  • wszCLASS_CERTENCODECRLDISTINFO : CrlDist.h
  • wszCLASS_CERTENCODEDATEARRAY : ADate.h
  • wszCLASS_CERTENCODELONGARRAY : ALong.h
  • wszCLASS_CERTENCODESTRINGARRAY : AString.h
  • wszCLASS_CERTEXITSAMPLE : Exit.h , pch.cpp
  • wszCLASS_CERTEXITSAMPLEPREFIX : Exit.h , pch.cpp
  • wszCLASS_CERTMANAGEEXITMODULESAMPLE : pch.cpp
  • wszCLASS_CERTMANAGEPOLICYMODULESAMPLE : pch.cpp
  • wszCLASS_CERTMANAGESAMPLE : Policy.h , Exit.h
  • wszCLASS_CERTPOLICYSAMPLE : pch.cpp , Policy.h
  • wszCLASS_CERTPOLICYSAMPLEPREFIX : Policy.h , pch.cpp
  • wszCOLONSPACE : CeError.Cpp , ceerror.cpp , CeError.Cpp
  • wszCONFIG_KEY : common.h
  • wszDSSEARCHBASECRLATTRIBUTE : CeFormat.Cpp , ceformat.cpp
  • wszDSSEARCHCACERTATTRIBUTE : ceformat.cpp , CeFormat.Cpp
  • wszDSSEARCHCROSSCERTPAIRATTRIBUTE : ceformat.cpp
  • wszDSSEARCHDELTACRLATTRIBUTE : ceformat.cpp , CeFormat.Cpp
  • wszDSSEARCHKRACERTATTRIBUTE : ceformat.cpp
  • wszDSSEARCHUSERCERTATTRIBUTE : ceformat.cpp
  • wszDURATIONUNITSDAYS : CeLib.Cpp
  • wszDURATIONUNITSHOURS : CeLib.Cpp
  • wszDURATIONUNITSMINUTES : CeLib.Cpp
  • wszDURATIONUNITSMONTHS : CeLib.Cpp
  • wszDURATIONUNITSSECONDS : CeLib.Cpp
  • wszDURATIONUNITSWEEKS : CeLib.Cpp
  • wszDURATIONUNITSYEARS : CeLib.Cpp
  • wszFCSAPARM_CERTFILENAMESUFFIX : CeLibW2k.h
  • wszFCSAPARM_CONFIGDN : CeLibW2k.h
  • wszFCSAPARM_CRLDELTAFILENAMESUFFIX : CeLibW2k.h
  • wszFCSAPARM_CRLFILENAMESUFFIX : CeLibW2k.h
  • wszFCSAPARM_DOMAINDN : CeLibW2k.h
  • wszFCSAPARM_DSCACERTATTRIBUTE : CeLibW2k.h
  • wszFCSAPARM_DSCRLATTRIBUTE : CeLibW2k.h
  • wszFCSAPARM_SANITIZEDCANAME : CeLibW2k.h
  • wszFCSAPARM_SANITIZEDCANAMEHASH : CeLibW2k.h
  • wszFCSAPARM_SERVERDNSNAME : CeLibW2k.h
  • wszFCSAPARM_SERVERSHORTNAME : CeLibW2k.h
  • wszFORMATREQUESTID : policy.cpp
  • wszHTTPERRORPREFIX : ceerror.cpp , CeError.Cpp , ceerror.cpp
  • wszJETERRORPREFIX : ceerror.cpp , CeError.Cpp
  • wszMDICHILD_KEY : common.h
  • wszOBJECTS_KEY : common.h
  • wszOPTIONS_KEY : common.h
  • wszOSSERRORPREFIX : CeError.Cpp , ceerror.cpp
  • wszPROPVALIDITYPERIODCOUNT : Policy.Cpp
  • wszPROPVALIDITYPERIODSTRING : Policy.Cpp
  • wszRECENTCONFIG_KEY : common.h
  • wszRECENTFILE_KEY : common.h
  • wszRECENTINITSTRING_KEY : common.h
  • wszRECENTURL_KEY : common.h
  • wszREGFILEISSUERCERTURL : Policy.Cpp
  • wszREGFILEREVOCATIONCRLURL : Policy.Cpp
  • wszREGFTPISSUERCERTURL : Policy.Cpp
  • wszREGFTPREVOCATIONCRLURL : Policy.Cpp
  • wszREGISSUERCERTURL : Policy.Cpp
  • wszREGLDAPISSUERCERTURL : Policy.Cpp
  • wszREGLDAPREVOCATIONCRLURL : Policy.Cpp
  • wszREGREVOCATIONCRLURL : Policy.Cpp
  • wszROWSETVIEWER_KEY : common.h
  • wszSETUPERRORPREFIX : ceerror.cpp , CeError.Cpp
  • wszTRACE_KEY : common.h
  • wszWIN32ERRORPREFIX : CeError.Cpp , ceerror.cpp
  • WW_HEAP : tpriv.h
  • WW_OWNER : tpriv.h
  • wWndEOL : common.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- x -

  • X_INDENT : FullIME.h
  • XCHECK_HR : helper.h , prsample.h
  • XFORMCLASS : XForm.h
  • XFORMTITLE : GdiDemo.h
  • xfree : IocpServer.Cpp , IocpServerex.Cpp
  • XFREE : Overlap.c
  • xfree : IocpClient.Cpp
  • XLARGEBUFF : quiktest.h
  • XMALLOC : Overlap.c
  • xmalloc : IocpServer.Cpp , IocpClient.Cpp , IocpServerex.Cpp
  • XTEST : common.h
  • XTEST_ : common.h
  • XTESTC : common.h
  • XTESTC_ : common.h
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y

- y -

  • Y_INDENT : FullIME.h
  • YOUR_PROTOCOL_BLOCK_SIZE : loadprotocol.c
  • YOUR_PROTOCOL_ID : loadprotocol.c
  • YOUR_PROTOCOL_INFO_BLOCK_DATA : loadprotocol.c
Generated on Wed Nov 13 2024 16:58:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- _ -

  • _CMDLN_STATE : cmsample.cpp
  • _HTTPCFG_TYPE : precomp.h
  • _IO_OPERATION : IocpServer.h
  • _IPSAMPLE_STATUS_CODE : configentry.h
  • _ITEM_TYPE : tracedmp.h
  • _MODE : Bcast.c
  • _MSV1_0_LOGON_SUBMIT_TYPE : Npaux.h
  • _MYSTATE : Eap.h
  • _options : client.cxx
  • _PROTOCOL : Bcast.c
  • _ShipStatus : QCNotify.Idl

- a -

  • ACCESSOR_OPTIONS : coptions.h
  • ActionType : FileRepClientProc.cpp , FileRepServerProc.cpp
  • ADMINTYPE : Adminwrap.h
  • AffectEnum : adoint.h
  • AnchorTagState : Anchor.Hxx

- b -

  • BankLang : bankdlg.h
  • BASE_CLASS : cbase.h
  • bdtBinaryDataType : msiloc.cpp
  • BINDCOLS : crowset.h
  • BookmarkEnum : adoint.h

- c -

  • CMD_TYPE : ATMEvent.h
  • CODECTYPE : InstCodc.Cpp
  • COL_HEADERS : step2.cpp , step4.cpp , step1.cpp
  • ColEditModeEnum : data.Idl
  • COLORA : cdialoglite.h
  • COLUMN_DESC : cmainwindow.h
  • COLUMN_ISCO : cmainwindow.h
  • COMMAND_OPTIONS : coptions.h
  • COMMAND_STATUS_FLAG : command.h
  • CommandTypeEnum : adoint.h
  • ConnectModeEnum : adoint.h
  • ConnectPromptEnum : adoint.h
  • CONV_FLAGS : common.h
  • CounterHandles : BasicHiPerf.h
  • CREATE_OPTIONS : coptions.h
  • CrmFilesCommandType : CrmFilesWorker.h
  • CursorLocationEnum : adoint.h
  • CursorOptionEnum : adoint.h
  • CursorTypeEnum : adoint.h

- d -

  • DataTypeEnum : adoint.h
  • DBCSTYPE : utils.cpp
  • DIMMINGSERVICE_SCPD_DISPIDS : MyDevice.h , DimmingService_SCPD.idl , MyDevice.h

- e -

  • EBaseObjectType : baseobj.h
  • EditModeEnum : adoint.h
  • EDWP : Globals.h , GLOBALS.h
  • EICON : step1.cpp , step4.cpp
  • emEnum : setup.h
  • ENUM_PERIOD : CeLibW2k.h
  • EnumCoInit : bankdlg.h
  • EOSPEVENTS : myospobject.h
  • ePOTENTIAL : nshsamp.h
  • ErrorCode_e : HuError.h
  • ERRORPOST : error.h
  • ErrorValueEnum : adoint.h
  • ESQL_STMT : table.h
  • EventEnum : comspyctl.idl
  • ExecuteOptionEnum : adoint.h
  • EXTENSION_TYPE : extend.h

- f -

  • FieldAttributeEnum : adoint.h
  • FILE_OPERATION : RmWorker.Idl
  • FILTER_STATE : Redir401.cpp
  • FilterGroupEnum : adoint.h
  • FilterType : appinfo.h

- g -

  • GetRowsOptionEnum : adoint.h

- h -

  • HtmlNew : Global.Hxx
  • HtmlTokenType : HtmlScan.Hxx
  • HTTP_REQUESTCB_TYPE : Range.h

- i -

  • IMAGEICONS : cmainwindow.h
  • INDEX_COLUMN_DESC : cmainwindow.h
  • INDEX_TYPE : step2.cpp
  • IoCompletionType : FileRepClientProc.cpp , FileRepServerProc.cpp
  • irmProgress : setupui.h
  • ISO_OPS : Sample1.h
  • IsolationLevelEnum : adoint.h
  • ITEM_TYPE : globals.h
  • itvEnum : setup.h

- l -

  • LOCK_MODE : sync.h
  • LockTypeEnum : adoint.h

- m -

  • MarshalOptionsEnum : adoint.h
  • MESSAGE_TYPE : SampSSP.H
  • MetaTagState : MetaTag.Hxx
  • MODE : networkentry.h

- n -

  • NOTIFY_OPTIONS : coptions.h
  • NumberTypes : Dialer.c

- o -

  • ObjectStateEnum : adoint.h
  • OUTPUT_SPECIAL : cdialoglite.h

- p -

  • ParameterAttributesEnum : adoint.h
  • ParameterDirectionEnum : adoint.h
  • PERSTGSTATE : AppUtil.h
  • PositionEnum : adoint.h
  • PROP_COLUMNS : cdialog.cpp
  • PropertyAttributesEnum : adoint.h
  • PropTagState : PropTag.Hxx
  • protocolEnum : cacheproxysampleplugin.cs

- q -

  • QOS_IOCTL_SET : QosEvent.h

- r -

  • RecordStatusEnum : adoint.h
  • ROWSET_OPTIONS : coptions.h
  • RqsClientState : rqsclient.h
  • RqsEvent : rqsengine.h

- s -

  • SchemaEnum : adoint.h
  • SearchDirection : adoint.h
  • SERVERFLAGS : main.cpp
  • SERVERTYPE : cfactory.h
  • SOURCE : cbase.h
  • STATEICONS : cmainwindow.h

- t -

  • tagAppletCapabilityType : iapplet.h
  • tagAppletCapIDType : iapplet.h
  • tagAppletChannelCommand : iapplet.h
  • tagAppletChannelType : iapplet.h
  • tagAppletErrorCode : iapplet.h
  • tagAppletKeyType : iapplet.h
  • tagAppletModificationRights : iapplet.h
  • tagAppletPriority : iapplet.h
  • tagAppletReason : iapplet.h
  • tagAppletRegistryCommand : iapplet.h
  • tagAppletRegistryItemType : iapplet.h
  • tagAppletResourceAllocCommand : iapplet.h
  • tagAppletTokenCommand : iapplet.h
  • tagAppletTokenStatus : iapplet.h
  • tagCALL_STATE : nullmdm.h
  • tagPLUGXPRT_CALL_TYPE : iplgxprt.idl
  • tagPLUGXPRT_FRAMING : iplgxprt.idl
  • tagPLUGXPRT_PSTN_CALL_CONTROL : iplgxprt.idl
  • tagRECOVERY_STATE : RmWorker.Idl
  • tagRECOVERYRC : RmWorker.Idl
  • tagRMSTATUS : RmWorker.Idl
  • tagSCROLLDIR : idt.h
  • tagTPhysicalError : nullmdm.h
  • tagVERSION : Globals.h
  • TEMPLATE_CMD : Qoslist.Cpp
  • tReqState : filerepclientproc.cpp , FileRepClientProc.cpp
  • tSReqState : FileRepServerProc.cpp
  • TXSTATE : RmWorker.Idl

- u -

  • UPDATE_VIEWS_HINT : globals.h
  • UPDTYPE : fileio.h

- v -

  • VIEWFONTOPTION : FVText.h

- w -

  • WINSOCK_CATALOG : install.h
  • WIZ_STEP : wizard.h
  • WMS_CONTEXT_PLUGIN_CONTEXT_TYPE : ContextDll.idl

- x -

  • XactAttributeEnum : adoint.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- a -

  • ACCESSOR_BIND_BOOKMARK : coptions.h
  • ACCESSOR_BIND_LENGTH : coptions.h
  • ACCESSOR_BIND_STATUS : coptions.h
  • ACCESSOR_BIND_VALUE : coptions.h
  • ACCESSOR_BLOB_ILOCKBYTES : coptions.h
  • ACCESSOR_BLOB_ISEQSTREAM : coptions.h
  • ACCESSOR_BLOB_ISTORAGE : coptions.h
  • ACCESSOR_BLOB_ISTREAM : coptions.h
  • ACCESSOR_OWNED_PROVIDER : coptions.h
  • Activate : FileRepClientProc.cpp , FileRepServerProc.cpp
  • Activity : comspyctl.idl
  • adAddNew : adoint.h
  • adAffectAll : adoint.h
  • adAffectCurrent : adoint.h
  • adAffectGroup : adoint.h
  • adApproxPosition : adoint.h
  • adBigInt : adoint.h
  • adBinary : adoint.h
  • adBookmark : adoint.h
  • adBookmarkCurrent : adoint.h
  • adBookmarkFirst : adoint.h
  • adBookmarkLast : adoint.h
  • adBoolean : adoint.h
  • adBSTR : adoint.h
  • adChar : adoint.h
  • adCmdStoredProc : adoint.h
  • adCmdTable : adoint.h
  • adCmdText : adoint.h
  • adCmdUnknown : adoint.h
  • adCmdUnspecified : adoint.h
  • adCurrency : adoint.h
  • adDate : adoint.h
  • adDBDate : adoint.h
  • adDBTime : adoint.h
  • adDBTimeStamp : adoint.h
  • adDecimal : adoint.h
  • adDelete : adoint.h
  • adDouble : adoint.h
  • adEditAdd : adoint.h
  • adEditInProgress : adoint.h
  • adEditNone : adoint.h
  • adEmpty : adoint.h
  • adErrBoundToCommand : adoint.h
  • adErrDataConversion : adoint.h
  • adErrFeatureNotAvailable : adoint.h
  • adErrIllegalOperation : adoint.h
  • adErrInTransaction : adoint.h
  • adErrInvalidArgument : adoint.h
  • adErrInvalidConnection : adoint.h
  • adErrInvalidParamInfo : adoint.h
  • adErrItemNotFound : adoint.h
  • adErrNoCurrentRecord : adoint.h
  • adErrObjectClosed : adoint.h
  • adErrObjectInADOCollection : adoint.h
  • adErrObjectNotSet : adoint.h
  • adErrObjectOpen : adoint.h
  • adError : adoint.h
  • adErrProviderNotFound : adoint.h
  • adErrStillConnecting : adoint.h
  • adErrStillExecuting : adoint.h
  • adFilterAffectedRecords : adoint.h
  • adFilterFetchedRecords : adoint.h
  • adFilterNone : adoint.h
  • adFilterPendingRecords : adoint.h
  • adFilterPredicate : adoint.h
  • adFldCacheDeferred : adoint.h
  • adFldFixed : adoint.h
  • adFldIsNullable : adoint.h
  • adFldLong : adoint.h
  • adFldMayBeNull : adoint.h
  • adFldMayDefer : adoint.h
  • adFldRowID : adoint.h
  • adFldRowVersion : adoint.h
  • adFldUnknownUpdatable : adoint.h
  • adFldUpdatable : adoint.h
  • adGetRowsRest : adoint.h
  • adGUID : adoint.h
  • adHoldRecords : adoint.h
  • adIDispatch : adoint.h
  • adInteger : adoint.h
  • adIUnknown : adoint.h
  • adLockBatchOptimistic : adoint.h
  • adLockOptimistic : adoint.h
  • adLockPessimistic : adoint.h
  • adLockReadOnly : adoint.h
  • adLockUnspecified : adoint.h
  • adLongVarBinary : adoint.h
  • adLongVarChar : adoint.h
  • adLongVarWChar : adoint.h
  • adMarshalAll : adoint.h
  • adMarshalModifiedOnly : adoint.h
  • adModeRead : adoint.h
  • adModeReadWrite : adoint.h
  • adModeShareDenyNone : adoint.h
  • adModeShareDenyRead : adoint.h
  • adModeShareDenyWrite : adoint.h
  • adModeShareExclusive : adoint.h
  • adModeUnknown : adoint.h
  • adModeWrite : adoint.h
  • adMovePrevious : adoint.h
  • adNotify : adoint.h
  • adNumeric : adoint.h
  • adOpenDynamic : adoint.h
  • adOpenForwardOnly : adoint.h
  • adOpenKeyset : adoint.h
  • adOpenStatic : adoint.h
  • adOpenUnspecified : adoint.h
  • adOptionUnspecified : adoint.h
  • adParamInput : adoint.h
  • adParamInputOutput : adoint.h
  • adParamLong : adoint.h
  • adParamNullable : adoint.h
  • adParamOutput : adoint.h
  • adParamReturnValue : adoint.h
  • adParamSigned : adoint.h
  • adParamUnknown : adoint.h
  • adPosBOF : adoint.h
  • adPosEOF : adoint.h
  • adPosUnknown : adoint.h
  • adPromptAlways : adoint.h
  • adPromptComplete : adoint.h
  • adPromptCompleteRequired : adoint.h
  • adPromptNever : adoint.h
  • adPropNotSupported : adoint.h
  • adPropOptional : adoint.h
  • adPropRead : adoint.h
  • adPropRequired : adoint.h
  • adPropWrite : adoint.h
  • adRecCanceled : adoint.h
  • adRecCantRelease : adoint.h
  • adRecConcurrencyViolation : adoint.h
  • adRecDBDeleted : adoint.h
  • adRecDeleted : adoint.h
  • adRecIntegrityViolation : adoint.h
  • adRecInvalid : adoint.h
  • adRecMaxChangesExceeded : adoint.h
  • adRecModified : adoint.h
  • adRecMultipleChanges : adoint.h
  • adRecNew : adoint.h
  • adRecObjectOpen : adoint.h
  • adRecOK : adoint.h
  • adRecOutOfMemory : adoint.h
  • adRecPendingChanges : adoint.h
  • adRecPermissionDenied : adoint.h
  • adRecSchemaViolation : adoint.h
  • adRecUnmodified : adoint.h
  • adResync : adoint.h
  • adRunAsync : adoint.h
  • adSchemaAsserts : adoint.h
  • adSchemaCatalogs : adoint.h
  • adSchemaCharacterSets : adoint.h
  • adSchemaCheckConstraints : adoint.h
  • adSchemaCollations : adoint.h
  • adSchemaColumnPrivileges : adoint.h
  • adSchemaColumns : adoint.h
  • adSchemaColumnsDomainUsage : adoint.h
  • adSchemaConstraintColumnUsage : adoint.h
  • adSchemaConstraintTableUsage : adoint.h
  • adSchemaForeignKeys : adoint.h
  • adSchemaIndexes : adoint.h
  • adSchemaKeyColumnUsage : adoint.h
  • adSchemaPrimaryKeys : adoint.h
  • adSchemaProcedureColumns : adoint.h
  • adSchemaProcedureParameters : adoint.h
  • adSchemaProcedures : adoint.h
  • adSchemaProviderSpecific : adoint.h
  • adSchemaProviderTypes : adoint.h
  • adSchemaReferentialContraints : adoint.h
  • adSchemaSchemata : adoint.h
  • adSchemaSQLLanguages : adoint.h
  • adSchemaStatistics : adoint.h
  • adSchemaTableConstraints : adoint.h
  • adSchemaTablePrivileges : adoint.h
  • adSchemaTables : adoint.h
  • adSchemaTranslations : adoint.h
  • adSchemaUsagePrivileges : adoint.h
  • adSchemaViewColumnUsage : adoint.h
  • adSchemaViews : adoint.h
  • adSchemaViewTableUsage : adoint.h
  • adSearchBackward : adoint.h
  • adSearchForward : adoint.h
  • adSingle : adoint.h
  • adSmallInt : adoint.h
  • adStateClosed : adoint.h
  • adStateConnecting : adoint.h
  • adStateExecuting : adoint.h
  • adStateOpen : adoint.h
  • adTinyInt : adoint.h
  • adUnsignedBigInt : adoint.h
  • adUnsignedInt : adoint.h
  • adUnsignedSmallInt : adoint.h
  • adUnsignedTinyInt : adoint.h
  • adUpdate : adoint.h
  • adUpdateBatch : adoint.h
  • adUseClient : adoint.h
  • adUseClientBatch : adoint.h
  • adUseNone : adoint.h
  • adUserDefined : adoint.h
  • adUseServer : adoint.h
  • adVarBinary : adoint.h
  • adVarChar : adoint.h
  • adVariant : adoint.h
  • adVarWChar : adoint.h
  • adWChar : adoint.h
  • adXactAbortRetaining : adoint.h
  • adXactBrowse : adoint.h
  • adXactChaos : adoint.h
  • adXactCommitRetaining : adoint.h
  • adXactCursorStability : adoint.h
  • adXactIsolated : adoint.h
  • adXactReadCommitted : adoint.h
  • adXactReadUncommitted : adoint.h
  • adXactRepeatableRead : adoint.h
  • adXactSerializable : adoint.h
  • adXactUnspecified : adoint.h
  • ALLOCERROR : HuError.h
  • ALREADYCONN : HuError.h
  • ALREADYLIST : HuError.h
  • AnchorToken : HtmlScan.Hxx
  • AppID : appinfo.h
  • APPLET_ADMIT_CHANNEL : iapplet.h
  • APPLET_ALLOCATE_HANDLE : iapplet.h
  • APPLET_ASSIGN_TOKEN : iapplet.h
  • APPLET_CONVENE_CHANNEL : iapplet.h
  • APPLET_DELETE_ENTRY : iapplet.h
  • APPLET_DISBAND_CHANNEL : iapplet.h
  • APPLET_DYNAMIC_MULTICAST_CHANNEL : iapplet.h
  • APPLET_DYNAMIC_PRIVATE_CHANNEL : iapplet.h
  • APPLET_DYNAMIC_USER_ID_CHANNEL : iapplet.h
  • APPLET_E_ALREADY_ADVISED : iapplet.h
  • APPLET_E_ALREADY_JOIN : iapplet.h
  • APPLET_E_ALREADY_REGISTERED : iapplet.h
  • APPLET_E_ENTRY_ALREADY_EXISTS : iapplet.h
  • APPLET_E_ENTRY_DOES_NOT_EXIST : iapplet.h
  • APPLET_E_INVALID_CONFERENCE : iapplet.h
  • APPLET_E_INVALID_COOKIE : iapplet.h
  • APPLET_E_INVALID_JOIN_REQUEST : iapplet.h
  • APPLET_E_NO_SERVICE : iapplet.h
  • APPLET_E_NOT_ADVISED : iapplet.h
  • APPLET_E_NOT_JOINED : iapplet.h
  • APPLET_E_NOT_OWNER : iapplet.h
  • APPLET_E_NOT_REGISTERED : iapplet.h
  • APPLET_E_SERVICE_FAIL : iapplet.h
  • APPLET_EXPEL_CHANNEL : iapplet.h
  • APPLET_GIVE_TOKEN : iapplet.h
  • APPLET_GIVE_TOKEN_RESPONSE : iapplet.h
  • APPLET_GRAB_TOKEN : iapplet.h
  • APPLET_GRAB_TOKEN_REQUEST : iapplet.h
  • APPLET_H221_NONSTD_KEY : iapplet.h
  • APPLET_HIGH_PRIORITY : iapplet.h
  • APPLET_INHIBIT_TOKEN : iapplet.h
  • APPLET_JOIN_CHANNEL : iapplet.h
  • APPLET_JOIN_DYNAMIC_CHANNEL : iapplet.h
  • APPLET_LEAVE_CHANNEL : iapplet.h
  • APPLET_LOGICAL_CAPABILITY : iapplet.h
  • APPLET_LOW_PRIORITY : iapplet.h
  • APPLET_MEDIUM_PRIORITY : iapplet.h
  • APPLET_MONITOR : iapplet.h
  • APPLET_NO_CHANNEL_TYPE_SPECIFIED : iapplet.h
  • APPLET_NO_MODIFICATION_RIGHTS_SPECIFIED : iapplet.h
  • APPLET_NONSTD_CAPABILITY : iapplet.h
  • APPLET_OBJECT_KEY : iapplet.h
  • APPLET_OWNER_RIGHTS : iapplet.h
  • APPLET_PLEASE_TOKEN : iapplet.h
  • APPLET_PUBLIC_RIGHTS : iapplet.h
  • APPLET_R_CONFERENCE_GONE : iapplet.h
  • APPLET_R_RESOURCE_PURGED : iapplet.h
  • APPLET_R_UNSPECIFIED : iapplet.h
  • APPLET_R_USER_REJECTED : iapplet.h
  • APPLET_REGISTER_CHANNEL : iapplet.h
  • APPLET_REGISTRY_CHANNEL_ID : iapplet.h
  • APPLET_REGISTRY_NONE : iapplet.h
  • APPLET_REGISTRY_PARAMETER : iapplet.h
  • APPLET_REGISTRY_TOKEN_ID : iapplet.h
  • APPLET_RELEASE_TOKEN : iapplet.h
  • APPLET_RETRIEVE_ENTRY : iapplet.h
  • APPLET_SESSION_RIGHTS : iapplet.h
  • APPLET_SET_PARAMETER : iapplet.h
  • APPLET_STANDARD_CAPABILITY : iapplet.h
  • APPLET_STATIC_CHANNEL : iapplet.h
  • APPLET_TEST_TOKEN : iapplet.h
  • APPLET_TOKEN_NOT_IN_USE : iapplet.h
  • APPLET_TOKEN_OTHER_GIVING : iapplet.h
  • APPLET_TOKEN_OTHER_GRABBED : iapplet.h
  • APPLET_TOKEN_OTHER_INHIBITED : iapplet.h
  • APPLET_TOKEN_SELF_GIVING : iapplet.h
  • APPLET_TOKEN_SELF_GRABBED : iapplet.h
  • APPLET_TOKEN_SELF_INHIBITED : iapplet.h
  • APPLET_TOKEN_SELF_RECIPIENT : iapplet.h
  • APPLET_TOP_PRIORITY : iapplet.h
  • APPLET_UNKNOWN_CAP_TYPE : iapplet.h
  • APPLET_UNSIGNED_MAXIMUM_CAPABILITY : iapplet.h
  • APPLET_UNSIGNED_MINIMUM_CAPABILITY : iapplet.h
  • APPLICATION : Adminwrap.h
  • Application : comspyctl.idl
  • AUDIOCODEC : InstCodc.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- j -

  • Java : bankdlg.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- l -

  • LoadBalancing : comspyctl.idl
  • LOCAL : cfactory.h
  • LOCAL_NUMBER : Dialer.c
  • LONG_DISTANCE_NUMBER : Dialer.c
  • LOW : nshsamp.h
  • LspCatalog32Only : install.h
  • LspCatalog64Only : install.h
  • LspCatalogBoth : install.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- m -

  • MAILSLOT : Bcast.c
  • MEDIUM : nshsamp.h
  • MetaToken : HtmlScan.Hxx
  • Method : comspyctl.idl
  • MYSTATE_Done : Eap.h
  • MYSTATE_Initial : Eap.h
  • MYSTATE_ReqSent : Eap.h
  • MYSTATE_WaitForAuthenticationToComplete : Eap.h
  • MYSTATE_WaitForRequest : Eap.h
  • MYSTATE_WaitForUserOK : Eap.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- n -

  • NameSpaceExtension : extend.h
  • Negotiate : SampSSP.H
  • NEWLINE : cdialoglite.h
  • NmApplet_Ver_Major : iapplet.h
  • NmApplet_Ver_Minor : iapplet.h
  • NoFilter : appinfo.h
  • NoMoreContent : PropTag.Hxx
  • NoMoreProperty : PropTag.Hxx
  • NoMoreValue : MetaTag.Hxx
  • NoMoreValueProperty : PropTag.Hxx
  • NONE : InstCodc.Cpp
  • NOTIFY_ADDREF : coptions.h
  • NOTIFY_IDBASYNCHNOTIFY : coptions.h
  • NOTIFY_IPOOLNOTIFY : coptions.h
  • NOTIFY_IROWPOSITIONCHANGE : coptions.h
  • NOTIFY_IROWSETNOTIFY : coptions.h
  • NOTIFY_OLEDB : coptions.h
  • NOTIFY_PROMPTVETO : coptions.h
  • NOTIFY_QI : coptions.h
  • NOTIFY_RELEASE : coptions.h
  • NOTIFY_TRACEPROVIDER : coptions.h
  • NumCtrs : RefClint.Cpp , BasicHiPerf.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- o -

  • Object : comspyctl.idl
  • ObjectConstruction : comspyctl.idl
  • ObjectPool : comspyctl.idl
  • ObjectPool2 : comspyctl.idl
  • OBJEFFERROR : HuError.h
  • OBJNOTINIT : HuError.h
  • onDefault : Global.Hxx
  • OTHERERROR : HuError.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- b -

  • bdtBitmap : msiloc.cpp
  • bdtEXE_DLL_SCRIPT : msiloc.cpp
  • bdtIcon : msiloc.cpp
  • bdtJPEG : msiloc.cpp
  • BIND_ALLCOLS : crowset.h
  • BIND_ALLCOLSEXPECTBOOKMARK : crowset.h
  • BIND_UPDATEABLECOLS : crowset.h
  • BLRPLATE_FLAGS_FLAGS : blrplate.h
  • BLRPLATE_FLAGS_SUMMARY : blrplate.h
  • BLRPLATE_OPCODE : blrplate.h
  • BLRPLATE_SIGNATURE : blrplate.h
  • BLRPLATE_SUMMARY : blrplate.h
  • BOT_BINDER : baseobj.h
  • BOT_COMMAND : baseobj.h
  • BOT_DATASOURCE : baseobj.h
  • BOT_ROW : baseobj.h
  • BOT_ROWSET : baseobj.h
  • BOT_SESSION : baseobj.h
  • BOT_STREAM : baseobj.h
  • BOT_UNDEFINED : baseobj.h
  • BreakToken : HtmlScan.Hxx
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- c -

  • CA_AUTO_COLOR : cdialoglite.h
  • CA_BOLD : cdialoglite.h
  • CA_COLOR : cdialoglite.h
  • CA_DISABLE : cdialoglite.h
  • CA_ITALIC : cdialoglite.h
  • CA_LINK : cdialoglite.h
  • CA_NORMAL : cdialoglite.h
  • CA_PROTECTED : cdialoglite.h
  • CA_STRIKEOUT : cdialoglite.h
  • CA_UNDERLINE : cdialoglite.h
  • CALL_STATE_ANSWER : nullmdm.h
  • CALL_STATE_CONNECTED : nullmdm.h
  • CALL_STATE_DROP : nullmdm.h
  • CALL_STATE_IDLE : nullmdm.h
  • CALL_STATE_MAKE : nullmdm.h
  • Challenge : SampSSP.H
  • ChallengeResponse : SampSSP.H
  • CHANGECELL_ABOUTTODO : myospobject.h
  • CHANGECELL_DIDEVENT : myospobject.h
  • CLIENT : Bcast.c
  • ClientError : rqsclient.h
  • ClientIoAccept : IocpServer.h
  • ClientIoRead : IocpServer.h
  • ClientIoWrite : IocpServer.h
  • CMD_ENUMERATOR : ATMEvent.h
  • CMD_EXEC_CANCELED : command.h
  • CMD_EXECUTING : command.h
  • CMD_INITIALIZED : command.h
  • CMD_OPTION_ADD : Qoslist.Cpp
  • CMD_OPTION_DEL : Qoslist.Cpp
  • CMD_OPTION_LIST : Qoslist.Cpp
  • CMD_RECEIVER : ATMEvent.h
  • CMD_SENDER : ATMEvent.h
  • CMD_STATUS_MASK : command.h
  • CMD_TEXT_SET : command.h
  • cmdAdd : dbh.cpp
  • cmdAddr : dbh.cpp
  • cmdBase : dbh.cpp
  • cmdDelete : dbh.cpp
  • cmdEnum : dbh.cpp
  • cmdEnumForAddr : dbh.cpp
  • cmdFindFile : dbh.cpp
  • cmdHelp : dbh.cpp
  • cmdInfo : dbh.cpp
  • cmdLine : dbh.cpp
  • cmdLineNext : dbh.cpp
  • cmdLinePrev : dbh.cpp
  • cmdLoad : dbh.cpp
  • cmdLocals : dbh.cpp
  • cmdMax : dbh.cpp
  • cmdName : dbh.cpp
  • cmdNext : dbh.cpp
  • cmdPrev : dbh.cpp
  • cmdQuit : dbh.cpp
  • cmdType : dbh.cpp
  • cmdUndec : dbh.cpp
  • cmdUnload : dbh.cpp
  • cmdVerbose : dbh.cpp
  • CoInitMTA : bankdlg.h
  • CoInitRandom : bankdlg.h
  • CoInitSTA : bankdlg.h
  • COL_AUTOUPDATE : step2.cpp
  • COL_COLISFIXED : step4.cpp , step1.cpp
  • COL_COLISLONG : step1.cpp , step4.cpp
  • COL_COLISNULLABLE : step1.cpp , step4.cpp
  • COL_COLISROWID : step1.cpp , step4.cpp
  • COL_COLISROWVER : step1.cpp , step4.cpp
  • COL_COLLATION : step2.cpp
  • COL_COLNAME : step1.cpp , step4.cpp
  • COL_COLORDINAL : step1.cpp , step4.cpp
  • COL_COLPREC : step1.cpp , step4.cpp
  • COL_COLSCALE : step1.cpp , step4.cpp
  • COL_COLSIZE : step1.cpp , step4.cpp
  • COL_COLTYPE : step1.cpp , step4.cpp
  • COL_COLTYPENAME : step4.cpp
  • COL_COLWRITE : step1.cpp , step4.cpp
  • COL_INDEXCOLNAME : step2.cpp
  • COL_INDEXNAME : step2.cpp
  • COL_NULLS : step2.cpp
  • COL_PRIMARYKEY : step2.cpp
  • COL_UNIQUE : step2.cpp
  • colEditAdd : data.Idl
  • colEditDelete : data.Idl
  • colEditDeleted : data.Idl
  • colEditInProgress : data.Idl
  • colEditNone : data.Idl
  • COLUMN_DATATYPE : cmainwindow.h
  • COLUMN_DBCID : cmainwindow.h
  • COLUMN_ID : cmainwindow.h
  • COLUMN_ISCO_DESTURL : cmainwindow.h
  • COLUMN_ISCO_SRCURL : cmainwindow.h
  • COLUMN_ORDER : cmainwindow.h
  • COLUMN_PREC : cmainwindow.h
  • COLUMN_SCALE : cmainwindow.h
  • COLUMN_SIZE : cmainwindow.h
  • COLUMN_TYPENAME : cmainwindow.h
  • COMMAND_RELEASE_OPENOBJECTS : coptions.h
  • COMMAND_ROWSAFFECTED : coptions.h
  • CommentToken : HtmlScan.Hxx
  • COMPONENT : Adminwrap.h
  • ConfigServerSocket : rqsengine.h
  • Connect : rqsengine.h
  • ContextMenuExtension : extend.h
  • CONTROL : cfactory.h
  • CONV_ALPHABOOL : common.h
  • CONV_BINARY : common.h
  • CONV_DECIMAL : common.h
  • CONV_HEX : common.h
  • CONV_MSDADC_ONLY : common.h
  • CONV_NONE : common.h
  • CONV_OCTAL : common.h
  • CONV_TYPENAME : common.h
  • CONV_VARBOOL : common.h
  • CREATE_CURSORENGINE : coptions.h
  • CREATE_DETERMINE_TYPE : coptions.h
  • CREATE_FINDWINDOW : coptions.h
  • CREATE_INITIALIZE : coptions.h
  • CREATE_NEWWINDOW : coptions.h
  • CREATE_NEWWINDOW_IFEXISTS : coptions.h
  • CREATE_NO_AUTOSAVE : coptions.h
  • CREATE_NODISPLAY : coptions.h
  • CREATE_QI_MANDATORY : coptions.h
  • CREATE_QI_OPTIONAL : coptions.h
  • CREATE_RESTARTPOSITION : coptions.h
  • CREATE_SETPROPERTIES : coptions.h
  • CREATE_USESERVICECOMP : coptions.h
  • CRM : comspyctl.idl
  • CS_BEGIN_QUOTE : cmsample.cpp
  • CS_CHAR : cmsample.cpp
  • CS_DONE : cmsample.cpp
  • CS_END_QUOTE : cmsample.cpp
  • CS_END_SPACE : cmsample.cpp
  • CT_ANK : utils.cpp
  • ct_CreateFile : CrmFilesWorker.h
  • ct_DeleteFile : CrmFilesWorker.h
  • CT_INVALID : utils.cpp
  • CT_LEAD : utils.cpp
  • CT_TRAIL : utils.cpp
  • Ctr1 : RefClint.Cpp
  • ctr1 : BasicHiPerf.h
  • ctr2 : BasicHiPerf.h
  • Ctr2 : RefClint.Cpp
  • ctr3 : BasicHiPerf.h
  • Ctr3 : RefClint.Cpp
  • Ctr4 : RefClint.Cpp
  • ctr4 : BasicHiPerf.h
  • Ctr5 : RefClint.Cpp
  • ctr5 : BasicHiPerf.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- d -

  • DELETE_RESULTITEM : globals.h
  • DELETE_SCOPEITEM : globals.h
  • DELETEROWS_ABOUTTODO : myospobject.h
  • DELETEROWS_DIDEVENT : myospobject.h
  • Delphi : bankdlg.h
  • DISPID_DIMLEVEL : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_GETCONFIGDETAILS : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_GETDIMLEVEL : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_GETPOWERVALUE : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_POWER : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_POWEROFF : MyDevice.h , DimmingService_SCPD.idl , MyDevice.h
  • DISPID_POWERON : DimmingService_SCPD.idl , MyDevice.h
  • DISPID_SETDIMLEVEL : MyDevice.h , DimmingService_SCPD.idl
  • DISPLAY_INSTRUCTIONS : prsample.h
  • DISPLAY_METHODCALLS : prsample.h
  • Dummy : Npaux.h
  • DummyExtension : extend.h
  • DynamicExtension : extend.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- e -

  • eCAsynchBase : cbase.h
  • eCBase : cbase.h
  • eCBinder : cbase.h
  • eCCommand : cbase.h
  • eCConnectionPoint : cbase.h
  • eCContainerBase : cbase.h
  • eCCustomError : cbase.h
  • eCDataAccess : cbase.h
  • eCDataLinks : cbase.h
  • eCDataset : cbase.h
  • eCDataSource : cbase.h
  • eCEnumerator : cbase.h
  • eCError : cbase.h
  • eCMultipleResults : cbase.h
  • eCPropertiesBase : cbase.h
  • eCRow : cbase.h
  • eCRowPosition : cbase.h
  • eCRowset : cbase.h
  • eCServiceComp : cbase.h
  • eCSession : cbase.h
  • eCStream : cbase.h
  • eCTransaction : cbase.h
  • eCTransactionOptions : cbase.h
  • eCUnknown : cbase.h
  • edwpDialog : GLOBALS.h , Globals.h
  • edwpMDIChild : GLOBALS.h , Globals.h
  • edwpMDIFrame : GLOBALS.h , Globals.h
  • edwpNone : Globals.h , GLOBALS.h
  • edwpWindow : GLOBALS.h , Globals.h
  • eInvalid : cbase.h
  • emAdminInstall : setup.h
  • emHelp : setup.h
  • emPreset : setup.h
  • EMPTY : main.cpp
  • emVerify : setup.h
  • END_WIZ : wizard.h
  • EndAnchor : Anchor.Hxx
  • ENONE : HuError.h
  • ENUM_PERIOD_DAYS : CeLibW2k.h
  • ENUM_PERIOD_HOURS : CeLibW2k.h
  • ENUM_PERIOD_INVALID : CeLibW2k.h
  • ENUM_PERIOD_MINUTES : CeLibW2k.h
  • ENUM_PERIOD_MONTHS : CeLibW2k.h
  • ENUM_PERIOD_SECONDS : CeLibW2k.h
  • ENUM_PERIOD_WEEKS : CeLibW2k.h
  • ENUM_PERIOD_YEARS : CeLibW2k.h
  • EofToken : HtmlScan.Hxx
  • EP_ERRORINFO_ALWAYS : error.h
  • EP_ERRORINFO_FAILURE : error.h
  • EP_ERRORINFO_NEVER : error.h
  • EP_HRESULT_ALWAYS : error.h
  • EP_HRESULT_FAILURE : error.h
  • EP_HRESULT_NEVER : error.h
  • EP_HRESULT_NOERRORINFO : error.h
  • EP_IMALLOC_ALLOCS : error.h
  • EP_IMALLOC_SPY : error.h
  • EP_REFCOUNT_FAILURE : error.h
  • ERR_CREATEDDB : Dibapi.h
  • ERR_CREATEPAL : Dibapi.h
  • ERR_DIBFUNCTION : Dibapi.h
  • ERR_ENDDOC : Dibapi.h
  • ERR_ENDPAGE : Dibapi.h
  • ERR_FILENOTFOUND : Dibapi.h
  • ERR_GETDC : Dibapi.h
  • ERR_INVALIDHANDLE : Dibapi.h
  • ERR_LOCK : Dibapi.h
  • ERR_MAX : Dibapi.h
  • ERR_MEMORY : Dibapi.h
  • ERR_MIN : Dibapi.h
  • ERR_NEWFRAME : Dibapi.h
  • ERR_NOGDIMODULE : Dibapi.h
  • ERR_NOT_DIB : Dibapi.h
  • ERR_OPEN : Dibapi.h
  • ERR_READ : Dibapi.h
  • ERR_SETABORTPROC : Dibapi.h
  • ERR_SETDIBITS : Dibapi.h
  • ERR_SETDIBITSTODEVICE : Dibapi.h
  • ERR_STARTDOC : Dibapi.h
  • ERR_STARTPAGE : Dibapi.h
  • ERR_STRETCHBLT : Dibapi.h
  • ERR_STRETCHDIBITS : Dibapi.h
  • Error : rqsengine.h
  • ESQL_CREATE_TABLE : table.h
  • ESQL_DROP_TABLE : table.h
  • ESQL_INSERT : table.h
  • ESQL_SELECT : table.h
  • EventStore : comspyctl.idl
  • Exception : comspyctl.idl
  • EXTENDED_LOCAL_NUMBER : Dialer.c
  • EXTENDED_LONG_DISTANCE_NUMBER : Dialer.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- f -

  • FilteringContent : PropTag.Hxx
  • FilteringProperty : PropTag.Hxx
  • FilteringPropertyButContentNotFiltered : PropTag.Hxx
  • FilteringValue : MetaTag.Hxx
  • FilteringValueProperty : PropTag.Hxx
  • FRAMING_LEGACY_PSTN : iplgxprt.idl
  • FRAMING_X224 : iplgxprt.idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- g -

  • GenericToken : HtmlScan.Hxx
  • GET_EXACT : networkentry.h
  • GET_FIRST : networkentry.h
  • GET_NEXT : networkentry.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- h -

  • Heading1Token : HtmlScan.Hxx
  • Heading2Token : HtmlScan.Hxx
  • Heading3Token : HtmlScan.Hxx
  • Heading4Token : HtmlScan.Hxx
  • Heading5Token : HtmlScan.Hxx
  • Heading6Token : HtmlScan.Hxx
  • HIGH : nshsamp.h
  • HttpCfgTypeDelete : precomp.h
  • HttpCfgTypeMax : precomp.h
  • HttpCfgTypeQuery : precomp.h
  • HttpCfgTypeSet : precomp.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- i -

  • ICON_CATALOG : step1.cpp
  • ICON_COLUMN : step1.cpp , step4.cpp
  • ICON_LONG : step1.cpp , step4.cpp
  • ICON_READONLY : step1.cpp , step4.cpp
  • ICON_SCHEMA : step1.cpp
  • ICON_SYNONYM : step1.cpp
  • ICON_SYSTABLE : step1.cpp
  • ICON_TABLE : step1.cpp
  • ICON_TYPE : step1.cpp
  • ICON_VIEW : step1.cpp
  • Identity : comspyctl.idl
  • IgnoreNotification : Redir401.cpp
  • IMAGE_ARROW_DOWN : cmainwindow.h
  • IMAGE_ARROW_UP : cmainwindow.h
  • IMAGE_CHANGE : cmainwindow.h
  • IMAGE_CHAPTER : cmainwindow.h
  • IMAGE_CHECKED : cmainwindow.h
  • IMAGE_COMMAND : cmainwindow.h
  • IMAGE_CUBE : cmainwindow.h
  • IMAGE_DATALINKS : cmainwindow.h
  • IMAGE_DATASOURCE : cmainwindow.h
  • IMAGE_DELETE : cmainwindow.h
  • IMAGE_DRAWNPOOL : cmainwindow.h
  • IMAGE_ERROR : cmainwindow.h
  • IMAGE_FORM : cmainwindow.h
  • IMAGE_INSERT : cmainwindow.h
  • IMAGE_INTERFACE : cmainwindow.h
  • IMAGE_LOCK : cmainwindow.h
  • IMAGE_MULTIPLE : cmainwindow.h
  • IMAGE_NORMAL : cmainwindow.h
  • IMAGE_OBJECTS : cmainwindow.h
  • IMAGE_POOLING : cmainwindow.h
  • IMAGE_QUESTION : cmainwindow.h
  • IMAGE_REMOTING : cmainwindow.h
  • IMAGE_SERVICECOMP : cmainwindow.h
  • IMAGE_SESSION : cmainwindow.h
  • IMAGE_STREAM : cmainwindow.h
  • IMAGE_TABLE : cmainwindow.h
  • IMAGE_UNCHECKED : cmainwindow.h
  • ImageToken : HtmlScan.Hxx
  • INDEXTYPE_INDEX : step2.cpp
  • INDEXTYPE_PRIMARYKEY : step2.cpp
  • INK_MEDIUM : DComDraw.h , StoClien.h
  • INK_THICK : DComDraw.h , StoClien.h
  • INK_THIN : DComDraw.h , StoClien.h
  • INPROC : cfactory.h
  • InputToken : HtmlScan.Hxx
  • INSERT : fileio.h
  • INSERTROWS_ABOUTTODO : myospobject.h
  • INSERTROWS_DIDEVENT : myospobject.h
  • Instance : comspyctl.idl
  • INVALIDARG : HuError.h
  • IoFile : FileRepClientProc.cpp , FileRepServerProc.cpp
  • IoFileRep : FileRepClientProc.cpp , FileRepServerProc.cpp
  • IoPipe : FileRepServerProc.cpp , FileRepClientProc.cpp
  • IPSAMPLE_STATUS_RUNNING : configentry.h
  • IPSAMPLE_STATUS_STOPPED : configentry.h
  • IPSAMPLE_STATUS_STOPPING : configentry.h
  • IPX : Bcast.c
  • irmCancel : setupui.h
  • irmNotInitialized : setupui.h
  • irmOK : setupui.h
  • ISO_COPY : Sample1.h
  • ISO_DELETE : Sample1.h
  • ISO_MKDIR : Sample1.h
  • ISO_MOVE : Sample1.h
  • ItemBool : tracedmp.h
  • ItemChar : tracedmp.h
  • ItemCharShort : tracedmp.h
  • ItemDouble : tracedmp.h
  • ItemDSString : tracedmp.h
  • ItemDSWString : tracedmp.h
  • ItemFloat : tracedmp.h
  • ItemGuid : tracedmp.h
  • ItemIPAddr : tracedmp.h
  • ItemLong : tracedmp.h
  • ItemLongLong : tracedmp.h
  • ItemMLString : tracedmp.h
  • ItemNWString : tracedmp.h
  • ItemPort : tracedmp.h
  • ItemPString : tracedmp.h
  • ItemPtr : tracedmp.h
  • ItemPWString : tracedmp.h
  • ItemShort : tracedmp.h
  • ItemSid : tracedmp.h
  • ItemString : tracedmp.h
  • ItemUChar : tracedmp.h
  • ItemULong : tracedmp.h
  • ItemULongLong : tracedmp.h
  • ItemULongX : tracedmp.h
  • ItemUnknown : tracedmp.h
  • ItemUShort : tracedmp.h
  • ItemWChar : tracedmp.h
  • ItemWString : tracedmp.h
  • itvTrusted : setup.h
  • itvUnTrusted : setup.h
  • itvWintrustNotOnMachine : setup.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- p -

  • PERS_HANDSOFF : AppUtil.h
  • PERS_NOSCRIBBLE : AppUtil.h
  • PERS_SCRIBBLE : AppUtil.h
  • PERS_UNINIT : AppUtil.h
  • PIPE_AS_IN_OUT_PARAMETER : client.cxx
  • PIPE_AS_IN_PARAMETER : client.cxx
  • PIPE_AS_OUT_PARAMETER : client.cxx
  • PIPES_AS_IN_IN_OUT_PARAMETERS : client.cxx
  • PLUGXPRT_CALLEE : iplgxprt.idl
  • PLUGXPRT_CALLER : iplgxprt.idl
  • PLUGXPRT_PSTN_CALL_CONTROL_MANUAL : iplgxprt.idl
  • PLUGXPRT_PSTN_CALL_CONTROL_PORT_HANDLE : iplgxprt.idl
  • PLUGXPRT_UNKNOWN_CALL_TYPE : iplgxprt.idl
  • ProcessID : appinfo.h
  • PROP_COLID : cdialog.cpp
  • PROP_DESC : cdialog.cpp
  • PROP_FLAGS : cdialog.cpp
  • PROP_NAME : cdialog.cpp
  • PROP_TYPE : cdialog.cpp
  • PROP_VALUE : cdialog.cpp
  • PropertySheetExtension : extend.h
  • PUBPROP : Adminwrap.h
  • Pull : FileRepClientProc.cpp
  • Push : FileRepServerProc.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- q -

  • QC : comspyctl.idl
  • QOS_IOCTL_SET_AFTER : QosEvent.h
  • QOS_IOCTL_SET_BEFORE : QosEvent.h
  • QOS_IOCTL_SET_DURING : QosEvent.h
  • QOS_IOCTL_SET_QOS : QosEvent.h
  • Quit : rqsengine.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- r -

  • Read : FileRepServerProc.cpp , rqsengine.h
  • READ_MODE : sync.h
  • ReAuthenticate : SampSSP.H
  • REC_E_BEGINUNDO_SEQUENCE : RmWorker.Idl
  • REC_E_COMMIT_SEQUENCE : RmWorker.Idl
  • REC_E_END_TRANSACTION_SEQUENCE : RmWorker.Idl
  • REC_E_ENDUNDO_SEQUENCE : RmWorker.Idl
  • REC_E_FORGET_SEQUENCE : RmWorker.Idl
  • REC_E_INDOUBT_INVALID : RmWorker.Idl
  • REC_E_INVALID_LOG_RECORD : RmWorker.Idl
  • REC_E_INVALID_STATE : RmWorker.Idl
  • REC_E_LOG_FAILURE : RmWorker.Idl
  • REC_E_NO_MEMORY : RmWorker.Idl
  • REC_E_ORPHANED_TRANSACTION : RmWorker.Idl
  • REC_E_OUTCOMEACTION : RmWorker.Idl
  • REC_E_PREPARE_SEQUENCE : RmWorker.Idl
  • REC_E_REENLIST : RmWorker.Idl
  • REC_E_STATE_UNKNOWN : RmWorker.Idl
  • REC_E_TM_DOWN : RmWorker.Idl
  • REC_E_TRANSACTION_DUPLICATED : RmWorker.Idl
  • REC_E_UNDO_INCOMPLETE : RmWorker.Idl
  • REC_E_UNDO_SEQUENCE : RmWorker.Idl
  • REC_S_SUCCESS : RmWorker.Idl
  • REC_STATE_ABORTING : RmWorker.Idl
  • REC_STATE_ACTIVE : RmWorker.Idl
  • REC_STATE_COMPLETED : RmWorker.Idl
  • REC_STATE_DORMANT : RmWorker.Idl
  • REC_STATE_INDOUBT : RmWorker.Idl
  • ReceiveComplete : rqsclient.h
  • Receiving : rqsclient.h
  • REGISTER : main.cpp
  • REMOTE : cfactory.h
  • ReplaceDataWithRedirectBlob : Redir401.cpp
  • REQUESTCB_DATA : Range.h
  • REQUESTCB_DONE : Range.h
  • REQUESTCB_STARTED : Range.h
  • Resource : comspyctl.idl
  • RespondComplete : rqsclient.h
  • Responding : rqsclient.h
  • RESULT : globals.h
  • RM_COPY : RmWorker.Idl
  • RM_DELETE : RmWorker.Idl
  • RM_FORGET : RmWorker.Idl
  • RM_MOVE : RmWorker.Idl
  • RM_NONE : RmWorker.Idl
  • RM_RENAME : RmWorker.Idl
  • RM_STATUS_COPY_FAILURE : RmWorker.Idl
  • RM_STATUS_DELETE_FAILURE : RmWorker.Idl
  • RM_STATUS_ENLIST_ERROR : RmWorker.Idl
  • RM_STATUS_FAILURE : RmWorker.Idl
  • RM_STATUS_FILE_NOT_FOUND : RmWorker.Idl
  • RM_STATUS_IMPORT_ERROR : RmWorker.Idl
  • RM_STATUS_IN_MEMORY_LIST : RmWorker.Idl
  • RM_STATUS_INTERFACE : RmWorker.Idl
  • RM_STATUS_INVALID_PARM : RmWorker.Idl
  • RM_STATUS_INVALID_STATE : RmWorker.Idl
  • RM_STATUS_LOG_ERROR : RmWorker.Idl
  • RM_STATUS_MOVE_FAILURE : RmWorker.Idl
  • RM_STATUS_NO_MEMORY : RmWorker.Idl
  • RM_STATUS_OVERWRITE_EXISTING : RmWorker.Idl
  • RM_STATUS_RECOVERY_FAILURE : RmWorker.Idl
  • RM_STATUS_RENAME_FAILURE : RmWorker.Idl
  • RM_STATUS_SUCCESS : RmWorker.Idl
  • RM_STATUS_TM_DOWN : RmWorker.Idl
  • RM_STATUS_UNDO_ERROR : RmWorker.Idl
  • RM_UNDO : RmWorker.Idl
  • RM_UNDO_BEGIN : RmWorker.Idl
  • RM_UNDO_END : RmWorker.Idl
  • ROWSAVAILABLE_DIDEVENT : myospobject.h
  • ROWSET_ALWAYSRELEASEROWS : coptions.h
  • ROWSET_HIDDENCOLUMNS : coptions.h
  • ROWSET_NODATA : coptions.h
  • ROWSET_ROWSTOFETCH : coptions.h
  • ROWSET_SETDEFAULTPROPS : coptions.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- s -

  • SC_IDEAL_SEND_RECV : TestAccept.cpp
  • SC_NUM_SCENARIOS : TestAccept.cpp
  • SC_SEND_NO_RECV : TestAccept.cpp
  • SC_SEND_THEN_RECV : TestAccept.cpp
  • SC_SEND_WAIT_RECV : TestAccept.cpp
  • SC_WAIT_SEND_RECV : TestAccept.cpp
  • SCOPE : globals.h
  • ScriptToken : HtmlScan.Hxx
  • SCROLLDIR_DOWN : idt.h
  • SCROLLDIR_LEFT : idt.h
  • SCROLLDIR_NULL : idt.h
  • SCROLLDIR_RIGHT : idt.h
  • SCROLLDIR_UP : idt.h
  • Security : comspyctl.idl
  • SERVER : Bcast.c
  • ssBackOrdered : QCNotify.Idl
  • ssNotStocked : QCNotify.Idl
  • ssShipped : QCNotify.Idl
  • ssUnprocessed : QCNotify.Idl
  • ssUnrecognizedItem : QCNotify.Idl
  • StartAnchor : Anchor.Hxx
  • StartOfFileToken : HtmlScan.Hxx
  • STATE_CHECKED : cmainwindow.h
  • STATE_NORMAL : cmainwindow.h
  • STATE_UNCHECKED : cmainwindow.h
  • StateActive : FileRepClientProc.cpp , FileRepServerProc.cpp , filerepclientproc.cpp
  • StateArrived : filerepclientproc.cpp , FileRepClientProc.cpp , FileRepServerProc.cpp
  • StateQueued : filerepclientproc.cpp , FileRepServerProc.cpp , FileRepClientProc.cpp
  • STATUSBAR_DESC : cmainwindow.cpp
  • STATUSBAR_TEXT : cmainwindow.cpp
  • SUBSCRIPTION : Adminwrap.h
  • SuppressData : Redir401.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- t -

  • TaskExtension : extend.h
  • TextToken : HtmlScan.Hxx
  • Thread : comspyctl.idl
  • TitleToken : HtmlScan.Hxx
  • ToolBarExtension : extend.h
  • TPHYS_CONNECT_RESPONSE_FAILED : nullmdm.h
  • TPHYS_RESULT_COMM_PORT_BUSY : nullmdm.h
  • TPHYS_RESULT_CONNECT_FAILED : nullmdm.h
  • TPHYS_RESULT_CONNECT_REJECTED : nullmdm.h
  • TPHYS_RESULT_FAIL : nullmdm.h
  • TPHYS_RESULT_INUSE : nullmdm.h
  • TPHYS_RESULT_INVALID_ADDRESS : nullmdm.h
  • TPHYS_RESULT_INVALID_CONNECTION : nullmdm.h
  • TPHYS_RESULT_NOT_INITIALIZED : nullmdm.h
  • TPHYS_RESULT_NOT_LISTENING : nullmdm.h
  • TPHYS_RESULT_SUCCESS_ALTERNATE : nullmdm.h
  • TPHYS_RESULT_WAITING_FOR_CONNECTION : nullmdm.h
  • TPHYS_SUCCESS : nullmdm.h
  • Transaction : comspyctl.idl
  • TRANSFERCOMPLETE_DIDEVENT : myospobject.h
  • TRANSFERCOMPLETE_FAILEDTODO : myospobject.h
  • TRANSIENTPUBPROP : Adminwrap.h
  • TRANSIENTSUB : Adminwrap.h
  • TX_ABORTED : RmWorker.Idl
  • TX_ABORTING : RmWorker.Idl
  • TX_COMMITTED : RmWorker.Idl
  • TX_COMMITTING : RmWorker.Idl
  • TX_DONE : RmWorker.Idl
  • TX_ENLISTED : RmWorker.Idl
  • TX_ENLISTING : RmWorker.Idl
  • TX_INITIALIZED : RmWorker.Idl
  • TX_INITIALIZING : RmWorker.Idl
  • TX_INVALID_STATE : RmWorker.Idl
  • TX_PREPARED : RmWorker.Idl
  • TX_PREPARING : RmWorker.Idl
  • TX_TMDOWN : RmWorker.Idl
  • TX_UNINITIALIZED : RmWorker.Idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- u -

  • UDP : Bcast.c
  • UNREGISTER : main.cpp
  • UPDATE : fileio.h
  • UPDATE_RESULTITEM : globals.h
  • UPDATE_SCOPEITEM : globals.h
  • UpdateConfig : rqsengine.h
  • UpdateTrace : rqsengine.h
  • USE_COMMAND : prsample.h
  • USE_ENUMERATOR : prsample.h
  • USE_ISEQSTREAM : prsample.h
  • USE_PROMPTDATASOURCE : prsample.h
  • User : comspyctl.idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- v -

  • VB : bankdlg.h
  • VC : bankdlg.h
  • VIEWFONT_DECREASESIZE : FVText.h
  • VIEWFONT_INCREASESIZE : FVText.h
  • VIEWFONT_SELECT : FVText.h
  • VWP_LEFT : Callnot.Cpp
  • VWP_TOP : Callnot.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w

- w -

  • Wait : FileRepClientProc.cpp , FileRepServerProc.cpp
  • WIN32S : Globals.h
  • WIN95 : Globals.h
  • WINNT : Globals.h
  • WIZ_STEP1 : wizard.h
  • WIZ_STEP2 : wizard.h
  • WIZ_STEP3 : wizard.h
  • WIZ_STEP4 : wizard.h
  • WIZ_TYPES : wizard.h
  • WMS_CONTEXT_PLUGIN_COMMAND_REQUEST_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_COMMAND_RESPONSE_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_NO_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_PRESENTATION_CONTEXT : ContextDll.idl
  • WMS_CONTEXT_PLUGIN_USER_CONTEXT : ContextDll.idl
  • WRITE_MODE : sync.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- _ -

  • __declspec() : utils.cpp , helpdll.Cpp , CertGetKey.c , SpinTest.c , plgtermpriv.h
  • _ADO_get_Properties_Proxy() : adoint.h
  • _ADO_get_Properties_Stub() : adoint.h
  • _ADOCollection__NewEnum_Proxy() : adoint.h
  • _ADOCollection__NewEnum_Stub() : adoint.h
  • _ADOCollection_Refresh_Proxy() : adoint.h
  • _ADOCollection_Refresh_Stub() : adoint.h
  • _ADODynaCollection_Append_Proxy() : adoint.h
  • _ADODynaCollection_Append_Stub() : adoint.h
  • _ADODynaCollection_Delete_Proxy() : adoint.h
  • _ADODynaCollection_Delete_Stub() : adoint.h
  • _ADsError_IID_Lookup() : ADsError_p.c
  • _ADsFirstExt_IID_Lookup() : ADsFirstExt_p.c
  • _BrochureMachine_IID_Lookup() : BrochureMachine_p.c
  • _ClearAttribute() : util.cpp
  • _Collection_get_Count_Proxy() : adoint.h
  • _Collection_get_Count_Stub() : adoint.h
  • _com_issue_error() : security.cpp
  • _COM_SMARTPTR_TYPEDEF() : UtilLib.h
  • _Command_Cancel_Proxy() : adoint.h
  • _Command_Cancel_Stub() : adoint.h
  • _Command_CreateParameter_Proxy() : adoint.h
  • _Command_CreateParameter_Stub() : adoint.h
  • _Command_Execute_Proxy() : adoint.h
  • _Command_Execute_Stub() : adoint.h
  • _Command_get_ActiveConnection_Proxy() : adoint.h
  • _Command_get_ActiveConnection_Stub() : adoint.h
  • _Command_get_CommandText_Proxy() : adoint.h
  • _Command_get_CommandText_Stub() : adoint.h
  • _Command_get_CommandTimeout_Proxy() : adoint.h
  • _Command_get_CommandTimeout_Stub() : adoint.h
  • _Command_get_CommandType_Proxy() : adoint.h
  • _Command_get_CommandType_Stub() : adoint.h
  • _Command_get_Name_Proxy() : adoint.h
  • _Command_get_Name_Stub() : adoint.h
  • _Command_get_Parameters_Proxy() : adoint.h
  • _Command_get_Parameters_Stub() : adoint.h
  • _Command_get_Prepared_Proxy() : adoint.h
  • _Command_get_Prepared_Stub() : adoint.h
  • _Command_get_State_Proxy() : adoint.h
  • _Command_get_State_Stub() : adoint.h
  • _Command_put_ActiveConnection_Proxy() : adoint.h
  • _Command_put_ActiveConnection_Stub() : adoint.h
  • _Command_put_CommandText_Proxy() : adoint.h
  • _Command_put_CommandText_Stub() : adoint.h
  • _Command_put_CommandTimeout_Proxy() : adoint.h
  • _Command_put_CommandTimeout_Stub() : adoint.h
  • _Command_put_CommandType_Proxy() : adoint.h
  • _Command_put_CommandType_Stub() : adoint.h
  • _Command_put_Name_Proxy() : adoint.h
  • _Command_put_Name_Stub() : adoint.h
  • _Command_put_Prepared_Proxy() : adoint.h
  • _Command_put_Prepared_Stub() : adoint.h
  • _Command_putref_ActiveConnection_Proxy() : adoint.h
  • _Command_putref_ActiveConnection_Stub() : adoint.h
  • _Connection_BeginTrans_Proxy() : adoint.h
  • _Connection_BeginTrans_Stub() : adoint.h
  • _Connection_Cancel_Proxy() : adoint.h
  • _Connection_Cancel_Stub() : adoint.h
  • _Connection_Close_Proxy() : adoint.h
  • _Connection_Close_Stub() : adoint.h
  • _Connection_CommitTrans_Proxy() : adoint.h
  • _Connection_CommitTrans_Stub() : adoint.h
  • _Connection_Execute_Proxy() : adoint.h
  • _Connection_Execute_Stub() : adoint.h
  • _Connection_get_Attributes_Proxy() : adoint.h
  • _Connection_get_Attributes_Stub() : adoint.h
  • _Connection_get_CommandTimeout_Proxy() : adoint.h
  • _Connection_get_CommandTimeout_Stub() : adoint.h
  • _Connection_get_ConnectionString_Proxy() : adoint.h
  • _Connection_get_ConnectionString_Stub() : adoint.h
  • _Connection_get_ConnectionTimeout_Proxy() : adoint.h
  • _Connection_get_ConnectionTimeout_Stub() : adoint.h
  • _Connection_get_CursorLocation_Proxy() : adoint.h
  • _Connection_get_CursorLocation_Stub() : adoint.h
  • _Connection_get_DefaultDatabase_Proxy() : adoint.h
  • _Connection_get_DefaultDatabase_Stub() : adoint.h
  • _Connection_get_Errors_Proxy() : adoint.h
  • _Connection_get_Errors_Stub() : adoint.h
  • _Connection_get_IsolationLevel_Proxy() : adoint.h
  • _Connection_get_IsolationLevel_Stub() : adoint.h
  • _Connection_get_Mode_Proxy() : adoint.h
  • _Connection_get_Mode_Stub() : adoint.h
  • _Connection_get_Provider_Proxy() : adoint.h
  • _Connection_get_Provider_Stub() : adoint.h
  • _Connection_get_State_Proxy() : adoint.h
  • _Connection_get_State_Stub() : adoint.h
  • _Connection_get_Version_Proxy() : adoint.h
  • _Connection_get_Version_Stub() : adoint.h
  • _Connection_Open_Proxy() : adoint.h
  • _Connection_Open_Stub() : adoint.h
  • _Connection_OpenSchema_Proxy() : adoint.h
  • _Connection_OpenSchema_Stub() : adoint.h
  • _Connection_put_Attributes_Proxy() : adoint.h
  • _Connection_put_Attributes_Stub() : adoint.h
  • _Connection_put_CommandTimeout_Proxy() : adoint.h
  • _Connection_put_CommandTimeout_Stub() : adoint.h
  • _Connection_put_ConnectionString_Proxy() : adoint.h
  • _Connection_put_ConnectionString_Stub() : adoint.h
  • _Connection_put_ConnectionTimeout_Proxy() : adoint.h
  • _Connection_put_ConnectionTimeout_Stub() : adoint.h
  • _Connection_put_CursorLocation_Proxy() : adoint.h
  • _Connection_put_CursorLocation_Stub() : adoint.h
  • _Connection_put_DefaultDatabase_Proxy() : adoint.h
  • _Connection_put_DefaultDatabase_Stub() : adoint.h
  • _Connection_put_IsolationLevel_Proxy() : adoint.h
  • _Connection_put_IsolationLevel_Stub() : adoint.h
  • _Connection_put_Mode_Proxy() : adoint.h
  • _Connection_put_Mode_Stub() : adoint.h
  • _Connection_put_Provider_Proxy() : adoint.h
  • _Connection_put_Provider_Stub() : adoint.h
  • _Connection_RollbackTrans_Proxy() : adoint.h
  • _Connection_RollbackTrans_Stub() : adoint.h
  • _CRT_INIT() : SpinCube.c
  • _dispaddr() : dbh.cpp
  • _dumpsym() : dbh.cpp
  • _EDAnnotator_IID_Lookup() : EDAnnotator_p.c
  • _EdCommands_IID_Lookup() : EdCommands_p.c
  • _EdGlyphs_IID_Lookup() : EdGlyphs_p.c
  • _EdHost_IID_Lookup() : EdHost_p.c
  • _FindNextChange() : sdkdiff.cpp
  • _FindPrevChange() : sdkdiff.cpp
  • _GetDefaultTbb() : sBar.Cpp
  • _InitGuidLBox() : Dlg.Cpp
  • _InsertMenuHelper() : dsmenu.cpp
  • _IsConfigLocal() : CeLib.Cpp , celib.cpp
  • _NewEnum() : data.Idl
  • _Offset2Ptr() : DropExt.C
  • _Parameter_AppendChunk_Proxy() : adoint.h
  • _Parameter_AppendChunk_Stub() : adoint.h
  • _Parameter_get_Attributes_Proxy() : adoint.h
  • _Parameter_get_Attributes_Stub() : adoint.h
  • _Parameter_get_Direction_Proxy() : adoint.h
  • _Parameter_get_Direction_Stub() : adoint.h
  • _Parameter_get_Name_Proxy() : adoint.h
  • _Parameter_get_Name_Stub() : adoint.h
  • _Parameter_get_NumericScale_Proxy() : adoint.h
  • _Parameter_get_NumericScale_Stub() : adoint.h
  • _Parameter_get_Precision_Proxy() : adoint.h
  • _Parameter_get_Precision_Stub() : adoint.h
  • _Parameter_get_Size_Proxy() : adoint.h
  • _Parameter_get_Size_Stub() : adoint.h
  • _Parameter_get_Type_Proxy() : adoint.h
  • _Parameter_get_Type_Stub() : adoint.h
  • _Parameter_get_Value_Proxy() : adoint.h
  • _Parameter_get_Value_Stub() : adoint.h
  • _Parameter_put_Attributes_Proxy() : adoint.h
  • _Parameter_put_Attributes_Stub() : adoint.h
  • _Parameter_put_Direction_Proxy() : adoint.h
  • _Parameter_put_Direction_Stub() : adoint.h
  • _Parameter_put_Name_Proxy() : adoint.h
  • _Parameter_put_Name_Stub() : adoint.h
  • _Parameter_put_NumericScale_Proxy() : adoint.h
  • _Parameter_put_NumericScale_Stub() : adoint.h
  • _Parameter_put_Precision_Proxy() : adoint.h
  • _Parameter_put_Precision_Stub() : adoint.h
  • _Parameter_put_Size_Proxy() : adoint.h
  • _Parameter_put_Size_Stub() : adoint.h
  • _Parameter_put_Type_Proxy() : adoint.h
  • _Parameter_put_Type_Stub() : adoint.h
  • _Parameter_put_Value_Proxy() : adoint.h
  • _Parameter_put_Value_Stub() : adoint.h
  • _Recordset_AddNew_Proxy() : adoint.h
  • _Recordset_AddNew_Stub() : adoint.h
  • _Recordset_Cancel_Proxy() : adoint.h
  • _Recordset_Cancel_Stub() : adoint.h
  • _Recordset_CancelBatch_Proxy() : adoint.h
  • _Recordset_CancelBatch_Stub() : adoint.h
  • _Recordset_CancelUpdate_Proxy() : adoint.h
  • _Recordset_CancelUpdate_Stub() : adoint.h
  • _Recordset_Clone_Proxy() : adoint.h
  • _Recordset_Clone_Stub() : adoint.h
  • _Recordset_Close_Proxy() : adoint.h
  • _Recordset_Close_Stub() : adoint.h
  • _Recordset_Delete_Proxy() : adoint.h
  • _Recordset_Delete_Stub() : adoint.h
  • _Recordset_Find_Proxy() : adoint.h
  • _Recordset_Find_Stub() : adoint.h
  • _Recordset_get_AbsolutePage_Proxy() : adoint.h
  • _Recordset_get_AbsolutePage_Stub() : adoint.h
  • _Recordset_get_AbsolutePosition_Proxy() : adoint.h
  • _Recordset_get_AbsolutePosition_Stub() : adoint.h
  • _Recordset_get_ActiveConnection_Proxy() : adoint.h
  • _Recordset_get_ActiveConnection_Stub() : adoint.h
  • _Recordset_get_BOF_Proxy() : adoint.h
  • _Recordset_get_BOF_Stub() : adoint.h
  • _Recordset_get_Bookmark_Proxy() : adoint.h
  • _Recordset_get_Bookmark_Stub() : adoint.h
  • _Recordset_get_CacheSize_Proxy() : adoint.h
  • _Recordset_get_CacheSize_Stub() : adoint.h
  • _Recordset_get_Collect_Proxy() : adoint.h
  • _Recordset_get_Collect_Stub() : adoint.h
  • _Recordset_get_CursorLocation_Proxy() : adoint.h
  • _Recordset_get_CursorLocation_Stub() : adoint.h
  • _Recordset_get_CursorType_Proxy() : adoint.h
  • _Recordset_get_CursorType_Stub() : adoint.h
  • _Recordset_get_EditMode_Proxy() : adoint.h
  • _Recordset_get_EditMode_Stub() : adoint.h
  • _Recordset_get_EOF_Proxy() : adoint.h
  • _Recordset_get_EOF_Stub() : adoint.h
  • _Recordset_get_Fields_Proxy() : adoint.h
  • _Recordset_get_Fields_Stub() : adoint.h
  • _Recordset_get_Filter_Proxy() : adoint.h
  • _Recordset_get_Filter_Stub() : adoint.h
  • _Recordset_get_LockType_Proxy() : adoint.h
  • _Recordset_get_LockType_Stub() : adoint.h
  • _Recordset_get_MarshalOptions_Proxy() : adoint.h
  • _Recordset_get_MarshalOptions_Stub() : adoint.h
  • _Recordset_get_MaxRecords_Proxy() : adoint.h
  • _Recordset_get_MaxRecords_Stub() : adoint.h
  • _Recordset_get_PageCount_Proxy() : adoint.h
  • _Recordset_get_PageCount_Stub() : adoint.h
  • _Recordset_get_PageSize_Proxy() : adoint.h
  • _Recordset_get_PageSize_Stub() : adoint.h
  • _Recordset_get_RecordCount_Proxy() : adoint.h
  • _Recordset_get_RecordCount_Stub() : adoint.h
  • _Recordset_get_Sort_Proxy() : adoint.h
  • _Recordset_get_Sort_Stub() : adoint.h
  • _Recordset_get_Source_Proxy() : adoint.h
  • _Recordset_get_Source_Stub() : adoint.h
  • _Recordset_get_State_Proxy() : adoint.h
  • _Recordset_get_State_Stub() : adoint.h
  • _Recordset_get_Status_Proxy() : adoint.h
  • _Recordset_get_Status_Stub() : adoint.h
  • _Recordset_GetRows_Proxy() : adoint.h
  • _Recordset_GetRows_Stub() : adoint.h
  • _Recordset_Move_Proxy() : adoint.h
  • _Recordset_Move_Stub() : adoint.h
  • _Recordset_MoveFirst_Proxy() : adoint.h
  • _Recordset_MoveFirst_Stub() : adoint.h
  • _Recordset_MoveLast_Proxy() : adoint.h
  • _Recordset_MoveLast_Stub() : adoint.h
  • _Recordset_MoveNext_Proxy() : adoint.h
  • _Recordset_MoveNext_Stub() : adoint.h
  • _Recordset_MovePrevious_Proxy() : adoint.h
  • _Recordset_MovePrevious_Stub() : adoint.h
  • _Recordset_NextRecordset_Proxy() : adoint.h
  • _Recordset_NextRecordset_Stub() : adoint.h
  • _Recordset_Open_Proxy() : adoint.h
  • _Recordset_Open_Stub() : adoint.h
  • _Recordset_put_AbsolutePage_Proxy() : adoint.h
  • _Recordset_put_AbsolutePage_Stub() : adoint.h
  • _Recordset_put_AbsolutePosition_Proxy() : adoint.h
  • _Recordset_put_AbsolutePosition_Stub() : adoint.h
  • _Recordset_put_ActiveConnection_Proxy() : adoint.h
  • _Recordset_put_ActiveConnection_Stub() : adoint.h
  • _Recordset_put_Bookmark_Proxy() : adoint.h
  • _Recordset_put_Bookmark_Stub() : adoint.h
  • _Recordset_put_CacheSize_Proxy() : adoint.h
  • _Recordset_put_CacheSize_Stub() : adoint.h
  • _Recordset_put_Collect_Proxy() : adoint.h
  • _Recordset_put_Collect_Stub() : adoint.h
  • _Recordset_put_CursorLocation_Proxy() : adoint.h
  • _Recordset_put_CursorLocation_Stub() : adoint.h
  • _Recordset_put_CursorType_Proxy() : adoint.h
  • _Recordset_put_CursorType_Stub() : adoint.h
  • _Recordset_put_Filter_Proxy() : adoint.h
  • _Recordset_put_Filter_Stub() : adoint.h
  • _Recordset_put_LockType_Proxy() : adoint.h
  • _Recordset_put_LockType_Stub() : adoint.h
  • _Recordset_put_MarshalOptions_Proxy() : adoint.h
  • _Recordset_put_MarshalOptions_Stub() : adoint.h
  • _Recordset_put_MaxRecords_Proxy() : adoint.h
  • _Recordset_put_MaxRecords_Stub() : adoint.h
  • _Recordset_put_PageSize_Proxy() : adoint.h
  • _Recordset_put_PageSize_Stub() : adoint.h
  • _Recordset_put_Sort_Proxy() : adoint.h
  • _Recordset_put_Sort_Stub() : adoint.h
  • _Recordset_put_Source_Proxy() : adoint.h
  • _Recordset_put_Source_Stub() : adoint.h
  • _Recordset_putref_ActiveConnection_Proxy() : adoint.h
  • _Recordset_putref_ActiveConnection_Stub() : adoint.h
  • _Recordset_putref_Source_Proxy() : adoint.h
  • _Recordset_putref_Source_Stub() : adoint.h
  • _Recordset_Requery_Proxy() : adoint.h
  • _Recordset_Requery_Stub() : adoint.h
  • _Recordset_Resync_Proxy() : adoint.h
  • _Recordset_Resync_Stub() : adoint.h
  • _Recordset_Supports_Proxy() : adoint.h
  • _Recordset_Supports_Stub() : adoint.h
  • _Recordset_Update_Proxy() : adoint.h
  • _Recordset_Update_Stub() : adoint.h
  • _Recordset_UpdateBatch_Proxy() : adoint.h
  • _Recordset_UpdateBatch_Stub() : adoint.h
  • _Render_IID_Lookup() : Render_p.c
  • _tmain() : Main.cpp , HeadDump.cpp , wiassamp.cpp , DLEdit.Cpp , SignHash.cpp , WinHttpPostSample.cpp , SysInf_S.c , EnumStreams.c , RSAKey.cpp , odbcsql.c , SCIntro.Cpp , msiloc.cpp , SessionKey.cpp , SecPrint.c , RequestCert.Cpp , SCQuery.Cpp , WinHttpFormSubmitSample.cpp , DComPerm.Cpp , SuperUsr.cpp , MsgTest.c , PropCert.Cpp , msistuff.cpp , RSACert.cpp , Store.cpp , MyToken.cpp , Check_SD.c
  • _tWinMain() : ComSpy.Cpp , fullsvr.Cpp , global.c , SyncComp.Cpp , EdGlyphs.cpp , EdCommands.cpp , OPBank.Cpp , EdHost.cpp , PoolTest.Cpp , EdCommands.cpp , Server.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- j -

  • JoinMulticastGroup() : Mcastws1.c
  • Juggler() : AsyncDemo.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- k -

  • Key() : data.Idl
  • KeyboardHook() : Hook.c
  • KeyField() : data.Idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- l -

  • Language() : CrmFilesTest.Idl
  • LaunchDlgProc() : Dlg.Cpp
  • LaunchModemControlPanelAdd() : TapiCode.c
  • LaunchTutorial() : Tutorial.cpp
  • LcbDiskFreeSpaceWin() : wn_dos.h
  • lcd() : FTPJr.cpp
  • LcidDlgProc() : nlsapi.c
  • LcidFromHttpAcceptLanguage() : QSample.Cxx
  • LeaveSampleWorker() : utils.c , utils.h
  • LfcrToNull() : Commands.Cpp , Commands.h
  • LibMain() : gutils.cpp , dllstub.c , DropExt.C
  • LibMain32() : MainDll.Cpp
  • line_compare() : line.cpp , line.h
  • line_delete() : line.cpp , line.h
  • line_gethashcode() : line.cpp , line.h
  • line_getlinenr() : line.cpp , line.h
  • line_getlink() : line.cpp , line.h
  • line_gettabbedlength() : line.cpp , line.h
  • line_gettext() : line.cpp , line.h
  • line_gettextlen() : line.cpp , line.h
  • line_gettextW() : line.cpp , line.h
  • line_isblank() : line.cpp , line.h
  • line_link() : line.cpp , line.h
  • line_new() : line.cpp , line.h
  • line_reset() : line.cpp , line.h
  • lineCallbackFunc() : TapiCode.c
  • LineInUseProc() : Dialer.c
  • LineItem() : QCNotify.Idl , QCOrder.Idl , QCShip.Idl , QCNotify.Idl , QCOrder.Idl , QCShip2.Idl
  • lineNextPrev() : dbh.cpp
  • LinesMatch() : section.cpp
  • LISet32() : suminfo.Cpp
  • List_AddAfter() : list.cpp , list.h
  • List_AddBefore() : list.cpp , list.h
  • List_AddFirst() : list.cpp , list.h
  • List_AddLast() : list.h , list.cpp
  • list_Alloc() : list.cpp
  • List_Card() : list.cpp , list.h
  • List_Check() : list.cpp , list.h
  • List_Clear() : list.cpp , list.h
  • List_CompareProc() : list.cpp
  • List_Create() : list.cpp , list.h , list.cpp , list.h
  • List_Delete() : list.cpp , list.h
  • List_DeleteBackwards() : list.cpp
  • List_DeleteFirst() : list.cpp , list.h
  • List_DeleteForwards() : list.cpp
  • List_DeleteLast() : list.cpp , list.h
  • List_Destroy() : list.cpp , list.h
  • List_DisplayFolder() : list.cpp , list.h
  • List_DoBackgroundMenu() : list.cpp
  • List_DoContextMenu() : list.cpp , list.h
  • List_DoDefault() : list.cpp
  • List_DoItemMenu() : list.cpp
  • List_Dump() : list.cpp , list.h
  • List_EnumObjects() : list.cpp
  • List_First() : list.cpp , list.h
  • list_Free() : list.cpp
  • List_Init() : list.cpp , list.h
  • List_InsertListAfter() : list.cpp , list.h
  • List_InsertListBefore() : list.cpp , list.h
  • List_IsEmpty() : list.cpp , list.h
  • List_IsOK() : list.cpp , list.h
  • List_ItemLength() : list.cpp , list.h
  • List_Join() : list.cpp , list.h
  • List_Last() : list.cpp , list.h
  • List_LockCurrentFolder() : list.cpp
  • List_MakeOK() : list.cpp , list.h
  • List_NewAfter() : list.cpp , list.h
  • List_NewBefore() : list.cpp , list.h
  • List_NewFirst() : list.cpp , list.h
  • List_NewLast() : list.cpp , list.h
  • List_Next() : list.h , list.cpp
  • List_Notify() : list.cpp , list.h
  • List_Prev() : list.cpp , list.h
  • List_Recover() : list.cpp , list.h
  • List_Refresh() : list.cpp , list.h
  • List_ReleaseCurrentFolder() : list.cpp , list.h
  • List_Show() : list.cpp , list.h
  • List_SplitAfter() : list.cpp , list.h
  • List_SplitBefore() : list.cpp , list.h
  • List_Term() : list.cpp , list.h
  • ListACL() : DComPerm.h , ListAcl.Cpp
  • ListAppIDAccessACL() : DComPerm.h , Wrappers.Cpp
  • ListAppIDLaunchACL() : DComPerm.h , Wrappers.Cpp
  • ListBoxInsert() : DebMisc.c , DebMisc.h
  • ListBoxPrintF() : DebMisc.c , DebMisc.h
  • ListBoxWndProc() : MainDlg.Cpp
  • ListCards() : SCQuery.Cpp
  • ListClasses() : security.cpp
  • ListDefaultAccessACL() : DComPerm.h , Wrappers.Cpp
  • ListDefaultLaunchACL() : DComPerm.h , Wrappers.Cpp
  • Listen() : Listen.c
  • ListenOnAddress() : tapirecv.cpp
  • ListenOnAddresses() : FileTerm.cpp , FileTerm.h , Incoming.Cpp
  • ListenOnThisAddress() : FileTerm.cpp , FileTerm.h , Incoming.Cpp
  • ListGroups() : SCQuery.Cpp
  • ListIn() : Server.c
  • ListMachineAccessACL() : DComPerm.h , Wrappers.Cpp
  • ListMachineLaunchACL() : DComPerm.h , Wrappers.Cpp
  • ListNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • ListObject() : RendSam.Cpp
  • ListOut1() : Server.c
  • ListOut2() : Server.c
  • ListReaders() : SCQuery.Cpp
  • ListViewNotify() : VListVw.c
  • ListWalkProc() : Xmitu.c , Xmitu.h
  • llfromuls() : PMMStrm.Hxx
  • Load() : ips.h , PAPINT.Idl
  • LoadAndStretch() : bitmaps.Cxx , bitmaps.h
  • LoadCharacter() : Hello3.Cpp
  • LoadDIB() : Dibapi.h , File.c
  • LoadDll() : common.h
  • Loaded() : PAPINT.Idl
  • LoadExtensionFunction() : extension.cpp
  • LoadFileAsByteArray() : util.h , util.cpp , util.h
  • LoadInstalledCodecs() : InstCodc.Cpp
  • LoadLanguageResource() : global.c
  • LoadModuleConfig() : Redir401.cpp
  • LoadRcString() : gutils.h , sdkdiff.cpp
  • LoadResourceString() : common.h , utils.cpp
  • LoadSecurityLibrary() : WebClient.c , WebServer.c
  • LoadWTSAPI() : Tst4Wts.c
  • LocalAllocString() : Privobji.Cpp
  • LocaleToCodepage() : QSample.Cxx , CodePage.Cxx , CodePage.Hxx
  • LocalFreeString() : Privobji.Cpp
  • LocalToAnsi() : Utility.Cpp , Utility.h
  • LocalToWideChar() : IcnOvrly.Cpp , Main.cpp , ADEvent.cpp , Utility.Cpp , Utility.h , IcnOvrly.h
  • LocateBuffer() : Stubs.c
  • LocateContext() : Stubs.c
  • LocateCredential() : Stubs.c
  • LocateQueue() : DrawDlg.Cpp , drawdlg.cpp
  • LocateSecBuffer() : Stubs.c
  • LocateSigBuffer() : Stubs.c
  • LocateTargetQueue() : MqTrans.Cpp
  • Lock() : PAPINT.Idl
  • Locked() : PAPINT.Idl
  • LockServer() : icf.h
  • LockVolume() : Mfmt.c
  • LockWindowInfo() : GdiDemo.h , Wininfo.c
  • Log() : Debug.Cpp , Global.h
  • LogFile() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • LogFontProc() : Font.c
  • LogFormat() : tapirecv.cpp , common.h , tapisend.cpp
  • LogMessage() : tapirecv.cpp , common.h , tapisend.cpp
  • LOGMSG() : Utils.cpp , Utils.h
  • LogMsg() : Global.h , Debug.Cpp
  • LOGMSGERROR() : Utils.cpp , Utils.h
  • LogonDialogProc() : rtcdialogs.cpp
  • LogonDlgProc() : Security.Cpp , Main.h
  • LogOnOffDlgProc() : Dlg.Cpp
  • LogonToDB() : MqTrans.Cpp
  • LogResult() : Global.h
  • LogStackWalk() : DebugHandler.Cpp
  • LogTestCancel() : Global.h
  • LogTestStart() : Global.h
  • LogTestStop() : Global.h
  • LogToFile() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • LongQuote() : news.Idl
  • LookupAccountOtherSid() : Helper.c , Check_SD.h
  • LookupCatalog() : QSample.Cxx
  • LookupColumnName() : dump.cpp , sampclnt.h
  • LookupFree() : data.Idl
  • lookupStringFromMsgDll() : log.c
  • LookupUserInCache() : AuthFilt.h , cache.c
  • LookupUserInDb() : AuthFilt.h , db.c
  • LookupWSAEventSelect() : rusocket.cpp , rusocket.h
  • LowerRect() : status.cpp
  • LowLevelFormat() : Mfmt.c
  • lpfnFilterProc() : Find.c , Find.h
  • lProcessDIDClear() : MfEdit.c
  • lProcessDIDFf() : MfEdit.c
  • lProcessDIDOpen() : MfEdit.c
  • lProcessDIDPlay() : MfEdit.c
  • lProcessDIDPlayStep() : MfEdit.c
  • lProcessDIDPlayTenPlus() : MfEdit.c
  • lProcessDIDRec() : MfEdit.c
  • lProcessDIDStop() : MfEdit.c
  • lProcessMMAbout() : MfEdit.c
  • lProcessMMBrush() : MfEdit.c
  • lProcessMMCopy() : MfEdit.c
  • lProcessMMDel() : MfEdit.c
  • lProcessMMExport3X() : MfEdit.c
  • lProcessMMFit2Wnd() : MfEdit.c
  • lProcessMMFont() : MfEdit.c
  • lProcessMMHittest() : MfEdit.c
  • lProcessMMImport3X() : MfEdit.c
  • lProcessMMLEAbout() : MfEdit.c
  • lProcessMMLoadBmp() : MfEdit.c
  • lProcessMMLoadMaskBmp() : MfEdit.c
  • lProcessMMMltfmts() : MfEdit.c
  • lProcessMMPaste() : MfEdit.c
  • lProcessMMPen() : MfEdit.c
  • lProcessMMPolyDraw() : MfEdit.c
  • lProcessMMPrint() : MfEdit.c
  • lProcessMMRec() : MfEdit.c
  • lProcessMMSaveBmp() : MfEdit.c
  • lProcessMMStrokeFill() : MfEdit.c
  • lProcessWmCommand() : MfEdit.c
  • lProcessWmCreate() : MfEdit.c
  • lProcessWmDestroy() : MfEdit.c
  • lProcessWmDrawClip() : MfEdit.c
  • lProcessWmSize() : MfEdit.c
  • LPSTR2BSTR() : nmsession.cpp , utils.cpp , plugxprt.cpp
  • LpvAlloc() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h
  • lpwAlign() : DynDlg.c , OpenDIB.c
  • lRandom() : GdiDemo.h , GdiDemo.c , AppUtil.h , AppUtil.Cpp
  • lstrcpyn() : Utils.Cpp
  • lstrcpyX() : Helper.Cpp , Helper.h
  • LV_FindItem() : winmain.cpp , winmain.h , cdialoglite.cpp , cdialoglite.h
  • LV_GetAllItems() : cdialoglite.h , cdialoglite.cpp
  • LV_GetItemImage() : cdialoglite.h , cdialoglite.cpp
  • LV_GetItemParam() : cdialoglite.h , cdialoglite.cpp
  • LV_GetItemState() : cdialoglite.cpp , cdialoglite.h
  • LV_GetItemText() : cdialoglite.cpp , cdialoglite.h
  • LV_GetSelItems() : cdialoglite.h , cdialoglite.cpp
  • LV_InsertColumn() : cdialoglite.h , winmain.cpp , cdialoglite.cpp , winmain.h
  • LV_InsertItem() : winmain.cpp , winmain.h , cdialoglite.cpp , cdialoglite.h
  • LV_SetItemImage() : cdialoglite.cpp , cdialoglite.h
  • LV_SetItemParam() : cdialoglite.cpp , cdialoglite.h
  • LV_SetItemState() : cdialoglite.h , winmain.h , cdialoglite.cpp , winmain.cpp
  • LV_SetItemText() : winmain.h , cdialoglite.cpp , cdialoglite.h , winmain.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- m -

  • main() : Simple.c , main.cpp , Range.c , Test.Cxx , Server.Cxx , RootDSE.cpp , IPRoute.Cpp , WSnmpUtil.Cpp , RendSam.Cpp , IPStat.Cpp , tapirecv.cpp , tapisend.cpp , main.cxx , DirEncrypt.Cpp , RegDevice.cpp , main.cpp , Main.Cpp , TestAccept.cpp , PrPerf.c , Client.Cxx , AdsiDump.cpp , Main.Cpp , ATMEvent.Cpp , Bcast.c , MQPort.Cpp , IocpClient.Cpp , IocpServer.Cpp , main.cxx , MqTestOA.Cpp , IocpServerex.Cpp , rawudp.c , MqTrans.Cpp , instlsp.cpp , Mcastws1.c , SServer.Cpp , Server.Cxx , Binding.cpp , MSMQTest.c , Mcastws2.c , Overlap.c , customentry.c , Ping.cpp , rcvall.c , Child.cpp , RasGetConnectionStatistics.c , rnrcs.cpp , Ioctl.c , RasDial.c , Simplec.c , Simples.c , client.cxx , Create.cpp , RasDialAsync.c , Sockdupc.c , Sockdups.c , RasEnumConnections.c , AclApi.c , AuthzCli.c , Delete.cpp , RasEnumDevices.c , AuthzSvr.c , Client.c , RasEnumentries.c , Server.c , SecFile.c , callbackclient.Cpp , SServer.Cpp , Driver.Cpp , Enum.cpp , AsyncRPCc.c , SidClean.c , TakeOwn.c , AsyncRPCs.c , TextSid.c , CreateCert.c , Filter.cpp , ClUuidc.c , Decrypt.c , Encrypt.c , ClUuids.c , EnumAlgs.c , InitUser.c , Driver.Cpp , First.cpp , DUnionc.c , LsaPrivs.c , GssClient.c , DUnions.c , GssServer.c , HttpGet.c , Move.cpp , InOutc.c , Client.cpp , Server.cpp , InOuts.c , WebClient.c , WI_SSL_Client.Cpp , ComPerf.Cpp , main.cpp , Parent.cpp , Repasc.c , WebServer.c , sa.Cpp , Repass.c , SamplCli.Cpp , MethCli.Cpp , Read.cpp , Xmitc.c , PathParser.cpp , QueryParser.cpp , Xmits.c , Consumer.Cpp , WMIDiskPerf.Cpp , sampclnt.cpp , Rename.cpp , Dyneptc.c , Main.Cpp , FTPJr.cpp , Dynepts.c , httpauth.cpp , RetOptions.cpp , Schema.cpp , DynOutc.c , SetOptions.cpp , SimpleBrowser.cpp , DynOuts.c , BPSampTest.c , Main.c , main.cpp , cppclient.Cpp , Client.Cpp , sampclnt.h , Search.cpp , FileRep.cpp , dbh.cpp , DebugHandler.Cpp , FileRepServer.cpp , log.c , tracedmp.cpp , Write.cpp , FileRepService.cpp , TraceDp.c , TraceLog.c , filerep.cpp , AsyncIO.c , EnumMountPoints.c , utiltest.cpp , bthcxn.cpp , filerepservice.cpp , FCopy.Cpp , Mfmt.c , filerep.cpp , Mount.Cpp , UnMount.Cpp , dhcpnotify.cpp , filerepservice.cpp , app.cpp , UnBufCp1.c , filerep.cpp , UnBufCp2.c , NmPipe.c , sclient.cpp , attributes.cpp , dhcppersist.cpp , filerepserver.cpp , Client.c , Service.c , filerepservice.cpp , Tst4Wts.c , dhcprequest.cpp , Cxhndlc.c , Cxhndls.c , Credentials.cpp , DNSQuery.Cpp , Usrdefc.c , Usrdefs.c , ModifyRecords.cpp , Helloc.c , Hellos.c , scaledemo.Cpp , sserver.cpp , gcallusers.cpp , Simple.c , Picklpc.c , Pickltc.c , QosEvent.Cpp , Pipec.c , Pipes.c , getdomainmode.cpp , Qoslist.Cpp , RPCssmc.c , RPCssms.c , enablerouter.c , Client.C , Service.C , Client.c , main.cpp , IPArp.Cpp , Client.c , Server.c , IPChange.Cpp , Admapit.c , sampletest.cxx , main.cpp , IPConfig.Cpp , loadprotocol.c , main.cpp , IPRenew.Cpp , main.cpp , SnmpUtil.C
  • Main_CreateImageList() : enumdesk.cpp
  • Main_InitApplication() : enumdesk.cpp
  • Main_InitInstance() : enumdesk.cpp
  • Main_OnActivate() : WndProc.c
  • Main_OnCommand() : WndProc.c , enumdesk.cpp
  • Main_OnCreate() : WndProc.c
  • Main_OnDestroy() : WndProc.c
  • Main_OnLButtonDown() : WndProc.c
  • Main_OnLButtonUp() : WndProc.c
  • Main_OnMouseMove() : WndProc.c
  • Main_OnMove() : WndProc.c
  • Main_OnNCHitTest() : WndProc.c
  • Main_OnPaint() : WndProc.c
  • Main_OnRButtonDown() : WndProc.c
  • Main_OnSize() : WndProc.c
  • Main_OnTimer() : WndProc.c
  • Main_OnWindowPosChanged() : WndProc.c
  • Main_SizeChildren() : enumdesk.cpp
  • Main_UpdateMenu() : enumdesk.cpp
  • Main_WndProc() : enumdesk.cpp
  • MainConsole() : main.cpp
  • MainDialogProc() : FileTerm.cpp , FileTerm.h , Incoming.Cpp , Outgoing.Cpp
  • MainDlgProc() : DoServer.Cpp , DoServer.h , ui.cpp
  • MainExecute() : main.cpp
  • MainThread() : main.cpp
  • MainUI_OnClose() : InstCodc.Cpp
  • MainUI_OnCommand() : InstCodc.Cpp
  • MainUI_OnDestroy() : InstCodc.Cpp
  • MainUI_OnInitDialog() : InstCodc.Cpp
  • MainUIProc() : InstCodc.Cpp
  • MainWindowProc() : MousInfo.c , MousInfo.h
  • MainWndProc() : SimpSvr.Cpp , SimpSvr.h , MfEdit.c , MfEdit.h , Printer.c , Printer.h , PlgBlt.c , PlgBlt.h , WxForm.c , WxForm.h , Dialer.c , ASAccept.cpp , DebMain.c , Client32.h , Server32.c , Server32.h , ClipText.c , CDTest.c , CDTest.h , ComDlg32.C , ComDlg32.h , Property.c , Rebar.c , VListVw.c , VListVw.h , SpinTest.c , SpinTest.h , Cursor.c , Cursor.h , IMEApps.c , IMEApps.h , MultiUI.C , MultiUI.h , DynDlg.c , DynDlg.h , Globals.h , WndProc.c , DragImg.Cpp , sdkdiff.cpp , OleImp.Cpp , OleApt.Cpp , SimpCntr.Cpp , SimpCntr.h , SimpDnd.Cpp , SimpDnd.h
  • MakeAuthenticationAttributes() : Eap.c , Eap.h
  • MakeCanonicalNumber() : Dialer.c
  • MakeCommonDebugEventString() : DebMisc.c , DebMisc.h
  • MakeFamilyPath() : AppUtil.Cpp , AppUtil.h
  • MakeIconFromResource() : Icons.C , Icons.h
  • MakeJobStatusStr() : printjob.c , quecore.h
  • MakeMap() : section.cpp
  • MakeMPPEKeyAttributes() : Eap.c , Eap.h
  • MakeNewANDMaskBasedOnPoint() : Icons.C , Icons.h
  • MakeOctetADSVALUE() : main.cpp
  • MakePaintString() : Comp.c
  • MakePrinterStatusStr() : printjob.c
  • MakeRequestMessage() : Eap.c
  • MakeResponseMessage() : Eap.c , Eap.h
  • MakeResponseMessage1() : Eap.c , Eap.h
  • MakeResultMessage() : Eap.c , Eap.h
  • MakeSDAbsolute() : DComPerm.h , SDMgmt.Cpp
  • MakeSignature() : Stubs.c
  • MakeTheCall() : Outgoing.Cpp
  • MakeWindowClass() : APP.Cxx , APP.Hxx
  • MallocSpy_QueryInterface() : malspy.c
  • MallocSpyDump() : spy.cpp , spy.h
  • MallocSpyRegister() : spy.cpp , spy.h
  • MallocSpyUnRegister() : spy.cpp , spy.h
  • ManageAssistedTelephony() : Dialer.c
  • ManualConstruct() : data.Idl
  • map() : client.cxx
  • MapAdsTypeFromString() : UserProps.cpp , UserProps.h
  • MapEvent() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • MapMandatoryUserAttribToType() : UserProps.cpp , UserProps.h
  • MapNewEntriesToOld() : instlsp.cpp
  • MapOptionalUserAttribToType() : UserProps.cpp , UserProps.h
  • MapStateToString() : bits_ie.cpp
  • MapTypeToADSTYPE() : UserProps.cpp , UserProps.h
  • MapUserAttribToType() : UserProps.cpp , UserProps.h
  • MaxDebuggeesMessageBox() : DebMisc.c , DebMisc.h
  • MaxMediaLabel() : stl_mll.cpp , stl_mll.h
  • MaybeDeleteObject() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h , Util.Cpp
  • MazeCommandProc() : Maze.c , Maze.h
  • MazeCreateProc() : Maze.c , Maze.h
  • MazeDestroyProc() : Maze.c , Maze.h
  • MazePaintProc() : Maze.c , Maze.h
  • MazeProc() : Maze.c , Maze.h
  • memfill() : rawudp.c
  • memrev() : CertGetKey.c
  • MenuInit() : Menu.c , Menu.h
  • MenuWindowProc() : Menu.c , Menu.h
  • Message() : Cancel.Cpp , SServer.Cpp , ComPerf.Cpp , Client.Cpp , sclient.cpp , sserver.cpp , client.cxx
  • MessageBoxFromStringIds() : message.Cxx , message.h
  • MessageBoxFromStringIdsAndArgs() : message.Cxx , message.h
  • MessagePump() : MidiPlyr.h , UIUTILS.c
  • MetricsDlgProc() : Dialogs.c , FontView.c
  • MIB_control_func() : TestMIB.C , TestMIB.h
  • MIB_doneness_func() : TestMIB.C , TestMIB.h
  • MIB_leaf_func() : TestMIB.C , TestMIB.h
  • MIB_toasttype_func() : TestMIB.C , TestMIB.h
  • MibCreate() : rmapi.c
  • MibDelete() : rmapi.c
  • MibGet() : rmapi.c
  • MibGetFirst() : rmapi.c
  • MibGetNext() : rmapi.c
  • MibGetTrapInfo() : rmapi.c
  • MibSet() : rmapi.c
  • MibSetTrapInfo() : rmapi.c
  • MIDL_user_allocate() : certpsam.cpp , Client.C
  • midl_user_allocate() : Usrdefc.c , Server.c , Pipec.c , filerep.cpp , AsyncRPCc.c , AsyncRPCs.c , ClUuidc.c , DynOutc.c , ClUuids.c , DUnionc.c , DUnions.c , InOutc.c , InOuts.c , Repascu.c , Repassu.c , Xmitu.c , Xmitu.h , Dyneptc.c , Dynepts.c , DynOuts.c , FileRep.cpp , Service.cpp , service.cpp , filerep.cpp , service.cpp , filerep.cpp , service.cpp , Cxhndlc.c , Cxhndls.c , Usrdefs.c , Helloc.c , Hellos.c , Pipes.c , RPCssms.c , Client.c
  • MIDL_user_allocate() : theprovider.h , adoint.h , ADsFirstExt.h , ADsError.h , Picklpc.c , Pickltc.c , Server.c , MyDevice.h , CertPSam.Cpp , atlcontrol.h , iapplet.h
  • midl_user_free() : filerep.cpp , service.cpp , filerep.cpp , service.cpp , filerep.cpp , service.cpp , Cxhndlc.c , Usrdefc.c , Usrdefs.c , Helloc.c , Pipec.c , Pipes.c , RPCssms.c , Server.c , Client.c , Hellos.c , Cxhndls.c , Service.cpp , Dynepts.c , Repassu.c , AsyncRPCs.c
  • MIDL_user_free() : CertPSam.Cpp , Server.c , theprovider.h , adoint.h , ADsFirstExt.h , ADsError.h , Picklpc.c , Pickltc.c , Client.C , MyDevice.h , certpsam.cpp , atlcontrol.h , iapplet.h
  • midl_user_free() : AsyncRPCc.c , ClUuidc.c , ClUuids.c , DUnionc.c , DUnions.c , InOutc.c , InOuts.c , Repascu.c , Xmitu.c , Xmitu.h , Dyneptc.c , DynOutc.c , DynOuts.c , FileRep.cpp
  • MimimumWindowsPlatform() : utils.cpp
  • MirroringDlgProc() : global.h
  • MM_MibGet() : mibmgr.c , mibmgr.h
  • MM_MibSet() : mibmgr.c , mibmgr.h
  • MMCN_Crack() : mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , Globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h , mmccrack.Cpp , globals.h
  • ModifyListProc() : Xmitp.c
  • ModifyMyString() : Repasp.c
  • ModifyMyWString() : Repasp.c
  • ModifySecurity() : SuperUsr.cpp
  • ModifySurface() : dxsurf2.cpp
  • MonBuildInstanceDefinition() : PerfUtil.c , PerfUtil.h
  • MonCloseEventLog() : PerfUtil.c , PerfUtil.h , PerfUtil.c , PerfUtil.h
  • MonitorCallback() : compart.cpp
  • MonkeyDlgProc() : Monkey.h , Monkey.c
  • MonOpenEventLog() : PerfUtil.c , PerfUtil.h , PerfUtil.c
  • MouseDlgProc() : WxForm.c , WxForm.h
  • MouseHandler() : Main.C
  • MouseMove() : WxForm.h , Track.h , Track.c , WxForm.c
  • MoveCaret() : FullIME.h , Main.C
  • MoveCompCandWindow() : Subs.c , IMEApps.h
  • MoveFileTx() : TxFileDisp.Idl
  • MoveMoneyThread() : bankthrds.Cpp , bankdlg.Cpp
  • MoveRebar() : Rebar.c
  • MoveWindow() : common.cpp , common.h
  • MoveXWndProc() : MainDlg.Cpp
  • MoveYWndProc() : MainDlg.Cpp
  • MprAdminAcceptNewConnection() : AdminDll.c
  • MprAdminAcceptNewLink() : AdminDll.c
  • MprAdminConnectionHangupNotification() : AdminDll.c
  • MprAdminGetIpAddressForUser() : AdminDll.c
  • MprAdminLinkHangupNotification() : AdminDll.c
  • MprAdminReleaseIpAddress() : AdminDll.c
  • MprAdminTerminateDll() : AdminDll.c
  • MsgAboutCommand() : About.c , ABOUT.c
  • MsgAboutInit() : ABOUT.c , About.c
  • MsgActivate() : Msg.Cpp
  • MsgBoxIMbd() : Global.h
  • MsgBoxIMbdDw() : Global.h
  • MsgBoxIMbdSz() : Global.h
  • MsgClose() : Msg.Cpp , TapiComm.c , GLOBALS.h , Msg.Cpp
  • MsgCmdMain() : Cmd.Cpp , ui.cpp , Cmd.Cpp , Msg.Cpp
  • MsgCommand() : Globals.h , IpxChat.c , TapiComm.c , GLOBALS.h
  • MsgConnectCommand() : Connect.c
  • MsgConnectInit() : Connect.c
  • MsgCreate() : Globals.h , TapiComm.c , GLOBALS.h , Msg.Cpp , IpxChat.c
  • MsgDataready() : IpxChat.c , Globals.h
  • MsgDestroy() : Msg.Cpp , TapiComm.c , Msg.Cpp , GLOBALS.h , Msg.Cpp , Globals.h , IpxChat.c
  • MsgDisconnected() : IpxChat.c , Globals.h
  • MsgDrawItem() : Msg.Cpp
  • MsgGetMinMax() : Msg.Cpp
  • MsgListenCommand() : Listen.c
  • MsgListenConnected() : Listen.c
  • MsgListenInit() : Listen.c
  • MsgMenuSelect() : GLOBALS.h , STATBAR.c , Msg.Cpp , sBar.Cpp
  • MsgMousemove() : GLOBALS.h
  • MsgNotify() : ToolBar.c , GLOBALS.h , Msg.Cpp
  • MsgNotifyAppList() : Global.h , chWnd.Cpp
  • MsgNotifyTbar() : sBar.Cpp , Msg.Cpp
  • MsgPaint() : TapiComm.c , GLOBALS.h
  • MsgRefreshdisplay() : IpxChat.c , Globals.h
  • MsgSetfocus() : IpxChat.c
  • MsgSetFocus() : TapiComm.c , GLOBALS.h
  • MsgSetfocus() : Globals.h
  • MsgSize() : GLOBALS.h , TapiComm.c , IpxChat.c , Msg.Cpp , Globals.h , Msg.Cpp
  • MsgTimer() : GLOBALS.h
  • Msv1_0SubAuthenticationFilter() : SubAuth.c
  • Msv1_0SubAuthenticationRoutine() : SubAuth.c
  • MulDiv32() : MulDiv32.h
  • MulDivRD() : MulDiv32.h
  • MulDivRN() : MulDiv32.h
  • MulDivRU() : MulDiv32.h
  • MultiSzAppend() : multisz.c , multisz.h
  • MultiSzErase() : multisz.c , multisz.h
  • MultiSzFind() : multisz.c , multisz.h
  • MultiSzFree() : multisz.h , multisz.c
  • MultiSzInit() : multisz.c , multisz.h
  • MultiSzQuery() : multisz.c , multisz.h
  • MultiSzSet() : multisz.h , multisz.c
  • MultiThreadColorDlg() : Colors.c
  • MultiThreadFontDlg() : Font.c
  • MultiThreadOpenSave() : Open.c
  • MultiThreadPrintDlg() : Print.c
  • MWnd_OnCommand() : MainWND.c
  • MWnd_OnCommandToggleChild() : MainWND.c
  • MWnd_OnCreate() : MainWND.c
  • MWnd_OnDestroy() : MainWND.c
  • MWnd_OnDropFiles() : MainWND.c
  • MWnd_OnFileOpen() : MainWND.c
  • MWnd_OnGetMinMaxInfo() : MainWND.c
  • MWnd_OnPaint() : MainWND.c
  • MWnd_OnSize() : MainWND.c
  • MWnd_WndProc() : MainWND.c , MidiPlyr.h
  • My_lstrcpyW() : Atsp.h , Atsp.c
  • My_mbschr() : gutils.h , sdkdiff.cpp
  • My_mbsistr() : view.cpp , sdkdiff.cpp
  • My_mbsncmp() : sdkdiff.cpp , gutils.h
  • My_mbsncpy() : gutils.h , sdkdiff.cpp
  • My_mbsnicmp() : sdkdiff.cpp
  • My_mbspbrk() : sdkdiff.cpp , gutils.h
  • My_mbsrchr() : sdkdiff.cpp , gutils.h
  • My_mbsstr() : view.cpp , sdkdiff.cpp
  • myAddProperty() : datasource.cpp , prsample.h
  • myAddRowsetProperties() : prsample.h , rowset.cpp
  • MyAtol() : Open.c , Print.c , Title.c , Find.c , Colors.c , CDTest.c , Font.c
  • MyChangeFont() : MultiWnd.C
  • MyChangePasswordDlgProc() : GinaDlg.c
  • MyComboProc() : Tools.c
  • myCreateAccessor() : prsample.h , rowset.cpp
  • myCreateCommand() : prsample.h , command.cpp
  • myCreateDataSource() : prsample.h , datasource.cpp
  • myCreateEnumerator() : enum.cpp , prsample.h
  • myCreateRowset() : rowset.cpp , prsample.h
  • myCreateSchemaRowset() : session.cpp , prsample.h
  • myCreateSession() : session.cpp , prsample.h
  • MyCryptEnumProviders() : CreateCert.c , CreateCert.h
  • myDisplayColumnNames() : prsample.h , rowset.cpp
  • myDisplayErrorInfo() : error.cpp , prsample.h , helper.h
  • myDisplayErrorRecord() : prsample.h , helper.h , error.cpp
  • myDisplayInstructions() : prsample.h , main.cpp
  • myDisplayRow() : rowset.cpp , prsample.h
  • myDisplayRowset() : prsample.h , rowset.cpp
  • myDoInitialization() : datasource.cpp , prsample.h
  • MyDrawString() : MultiWnd.C
  • MyEnumCopy() : Paint.c , Paint.h
  • MyEnumCount() : Paint.c , Paint.h
  • MyEnumFaces() : Paint.c , Paint.h
  • MyEnumProcedure() : Icons.C
  • myExecuteCommand() : prsample.h , command.cpp
  • myFindColumn() : rowset.cpp , prsample.h
  • myFreeBindings() : rowset.cpp , prsample.h
  • myFWPrintf() : UtilLib.h
  • myGetChar() : prsample.h , main.cpp
  • MyGetIcmpStatistics() : IPStat.h , IPStat.Cpp
  • myGetInputFromUser() : main.cpp , prsample.h
  • MyGetIpAddrTable() : IPRoute.h , IPRoute.Cpp , IPArp.h , IPArp.Cpp
  • MyGetIpForwardTable() : IPRoute.h , IPRoute.Cpp
  • MyGetIpNetTable() : IPArp.h , IPArp.Cpp
  • MyGetIpStatistics() : IPStat.h , IPStat.Cpp
  • myGetProperty() : prsample.h , datasource.cpp
  • myGetSqlErrorInfo() : prsample.h , helper.h , error.cpp
  • MyGetTcpStatistics() : IPStat.h , IPStat.Cpp
  • MyGetTcpTable() : IPStat.Cpp , IPStat.h
  • MyGetUdpStatistics() : IPStat.Cpp , IPStat.h
  • MyGetUdpTable() : IPStat.Cpp , IPStat.h
  • myHandleResult() : helper.h , prsample.h , error.cpp
  • MyInitialize() : GinaStub.c , GinaHook.c
  • myInteractWithRowset() : rowset.cpp , prsample.h
  • myMethod() : CatlSmpl.Idl , Catlpwr.Idl
  • myParseCommandLine() : main.cpp , prsample.h
  • myPowerMethod() : Catlpwr.Idl
  • myPowerProperty() : Catlpwr.Idl
  • MyPrintf() : SuperUsr.cpp
  • myprintf() : IocpServer.Cpp , IocpServerex.Cpp
  • MyPrintf() : MyToken.cpp , RSAKey.cpp , RSACert.cpp , SignHash.cpp
  • myProperty() : CatlSmpl.Idl , Catlpwr.Idl , CatlSmpl.Idl , Catlpwr.Idl
  • myPutMsg() : MsgTest.c
  • MyRegisterClass() : EventSink.cpp , LeakyBin.c , Generic.C , StatList.c
  • MyServiceHandler() : secSvr.Cpp
  • MyServiceMain() : secSvr.Cpp
  • MySetCompositionFont() : MultiWnd.C
  • MySetCompositionForm() : MultiWnd.C
  • mySetupBindings() : prsample.h , rowset.cpp
  • myUpdateDisplaySize() : prsample.h , rowset.cpp
  • MyWlxDialogBoxParam() : GinaDlg.c
  • MyWlxLoggedOutSASDlgProc() : GinaDlg.c
  • MyWlxWkstaLockedSASDlgProc() : GinaDlg.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- n -

  • NameToBthAddr() : bthcxn.cpp
  • NBSTRCompareW() : StringUtils.cpp , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h
  • nCopyAnsiToWideChar() : OpenDIB.c , DynDlg.c
  • NE_Create() : networkentry.c , networkentry.h
  • NE_Destroy() : networkentry.c , networkentry.h
  • NeedAuth() : httpauth.cpp
  • NetpSecondsToDeltaTime() : SubAuth.c
  • NewListBoxWndProc() : DebMain.c
  • NewLogon() : Main.h , Security.Cpp
  • NewMove() : TServer.Idl
  • NewObject() : Main.h , Security.Cpp
  • NewTreeNode() : AdvQuery.Cxx
  • NextEntity() : data.Idl
  • NextLookup() : data.Idl
  • NextNonIgnorable() : section.cpp
  • NextResultset() : data.Idl
  • NIBSTRCompareW() : StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h
  • NIStringCompareW() : StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h
  • NLSDlgProc() : global.h , nlsapi.c
  • NlsPutMsg() : main.c , precomp.h
  • NM_AddInterface() : networkmgr.c , networkmgr.h
  • NM_CallbackNetworkEvent() : networkmgr.c , networkmgr.h
  • NM_CallbackPeriodicTimer() : networkmgr.c , networkmgr.h
  • NM_DeleteInterface() : networkmgr.c , networkmgr.h
  • NM_DoUpdateRoutes() : networkmgr.c , networkmgr.h
  • NM_GetInterfaceInfo() : networkmgr.c , networkmgr.h
  • NM_InterfaceStatus() : networkmgr.c , networkmgr.h
  • NM_ProcessRouteChange() : networkmgr.c , networkmgr.h
  • NM_SetInterfaceInfo() : networkmgr.c , networkmgr.h
  • NonAsyncFunc() : AsyncRPC.Idl , AsyncRPCp.c
  • NonBlockingAcceptMain() : NBAccept.cpp , common.h
  • NormalizeRect() : WinCap.c , WinCap.h
  • NormalizeScope() : QSample.Cxx
  • NotificationUpdate() : threads.c , threads.h
  • NotificationWndProc() : WSnmpUtil.Cpp , WSnmpUtil.h
  • NotifyAdd() : SetDisp.h , App32.C , SetDisp.c
  • notifyChange() : log.c
  • NotifyChange() : App32.C
  • NotifyDelete() : SetDisp.h , SetDisp.c , App32.C
  • NoUINoIMCWndProc() : MultiUI.h , MultiWnd.C
  • NoUIOwnIMCWndProc() : MultiWnd.C , MultiUI.h
  • NPGetCaps() : LogonNP.c
  • NPLogonNotify() : LogonNP.c
  • NPPasswordChangeNotify() : LogonNP.c
  • NStringCompareW() : StringUtils.cpp , StringUtils.h , StringUtils.cpp , PropList.cpp , StringUtils.h , PropList.h , PropList.cpp , StringUtils.cpp , PropList.h , StringUtils.h , PropList.h , PropList.cpp , StringUtils.cpp , StringUtils.h , StringUtils.cpp , PropList.h , PropList.cpp , StringUtils.cpp
  • NullHandleCase() : enablerouter.c
  • NullOverlappedCase() : enablerouter.c
  • NumberOfLogRecords() : CrmMonComp.Idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- o -

  • ObjectCreated() : cHello.Cxx , Server.Cxx , OleSrvr.Cpp
  • ObjectDestroyed() : cHello.Cxx , FileView.h , Server.Cxx , OleSrvr.Cpp , FileView.Cpp
  • Obscure_EnsureTimerRunning() : Obscure.c
  • Obscure_EnsureTimerStopped() : Obscure.c
  • Obscure_OnPaint() : Obscure.c
  • Obscure_TimerProc() : Obscure.c
  • Obscure_WndProc() : Obscure.c
  • OctetVariantToString() : helper.cpp , helper.h
  • Offroad() : MICARS.Idl
  • OLEDB_Trace() : asserts.h
  • OleFree() : site.Cpp
  • OleStdCopyStatData() : OleStd.h , enumStat.c
  • OleStdCreateDbAlloc() : dballoc.Cpp
  • OleStdCreateStandardPalette() : OleStd.h
  • OleStdDestroyAllElements() : OleStd.h , OleStd.c
  • OleStdDoConvert() : OleStd.h , OleStd.c
  • OleStdDoTreatAsClass() : OleStd.h , OleStd.c
  • OleStdEnumFmtEtc_AddRef() : enumfetc.c
  • OleStdEnumFmtEtc_Clone() : enumfetc.c
  • OleStdEnumFmtEtc_Create() : OleStd.h , enumfetc.c
  • OleStdEnumFmtEtc_Destroy() : enumfetc.c
  • OleStdEnumFmtEtc_Next() : enumfetc.c
  • OleStdEnumFmtEtc_QueryInterface() : enumfetc.c
  • OleStdEnumFmtEtc_Release() : enumfetc.c
  • OleStdEnumFmtEtc_Reset() : enumfetc.c
  • OleStdEnumFmtEtc_Skip() : enumfetc.c
  • OleStdEnumStatData_AddRef() : enumStat.c
  • OleStdEnumStatData_Clone() : enumStat.c
  • OleStdEnumStatData_Create() : OleStd.h , enumStat.c
  • OleStdEnumStatData_Destroy() : enumStat.c
  • OleStdEnumStatData_Next() : enumStat.c
  • OleStdEnumStatData_QueryInterface() : enumStat.c
  • OleStdEnumStatData_Release() : enumStat.c
  • OleStdEnumStatData_Reset() : enumStat.c
  • OleStdEnumStatData_Skip() : enumStat.c
  • OleStdGetLinkSourceData() : OleStd.h , OleStd.c
  • OleStdGetOleObjectData() : OleStd.h , OleStd.c
  • OleStdMkParseDisplayName() : OleStd.h , OleStd.c
  • OleStdMsgFilter_QueryInterface() : msgfiltr.c
  • OleStdMsgFilter_SetHandleInComingCallbackProc() : msgfiltr.h , msgfiltr.c
  • OleStdNullMethod() : OleStd.h , OleStd.c
  • OleStdSetIconInCache() : OleStd.h , OleStd.c
  • OleStdSwitchDisplayAspect() : OleStd.c , OleStd.h
  • OleUICanUnloadNow() : OleStd.h , ole2ui.c
  • OleUILockLibrary() : OleStd.h
  • OnActivityCreate() : ComSpyAudit.Idl
  • OnActivityDestroy() : ComSpyAudit.Idl
  • OnActivityEnter() : ComSpyAudit.Idl
  • OnActivityLeave() : ComSpyAudit.Idl
  • OnActivityLeaveSame() : ComSpyAudit.Idl
  • OnActivityReenter() : ComSpyAudit.Idl
  • OnActivityTimeout() : ComSpyAudit.Idl
  • OnAppActivation() : ComSpyAudit.Idl
  • OnAppShutdown() : ComSpyAudit.Idl
  • OnAuthenticate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnAuthenticateFail() : ComSpyAudit.Idl
  • OnCommand() : IconPRO.C
  • OnCRMAbort() : ComSpyAudit.Idl
  • OnCRMAnalyze() : ComSpyAudit.Idl
  • OnCRMBegin() : ComSpyAudit.Idl
  • OnCRMCheckpoint() : ComSpyAudit.Idl
  • OnCRMCommit() : ComSpyAudit.Idl
  • OnCRMDeliver() : ComSpyAudit.Idl
  • OnCRMDone() : ComSpyAudit.Idl
  • OnCRMForce() : ComSpyAudit.Idl
  • OnCRMForget() : ComSpyAudit.Idl
  • OnCRMIndoubt() : ComSpyAudit.Idl
  • OnCRMPrepare() : ComSpyAudit.Idl
  • OnCRMRecoveryDone() : ComSpyAudit.Idl
  • OnCRMRecoveryStart() : ComSpyAudit.Idl
  • OnCRMRelease() : ComSpyAudit.Idl
  • OnCRMWrite() : ComSpyAudit.Idl
  • OnDisableCommit() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnDocWindowActivate() : ioipao.h
  • OnEnableCommit() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnExceptionUser() : ComSpyAudit.Idl
  • OnFileOpen() : dxsurf1.cpp
  • OnFrameWindowActivate() : ioipao.h
  • OnIISRequestInfo() : ComSpyAudit.Idl
  • OnInPlaceActivate() : ioips.h
  • OnInPlaceDeactivate() : ioips.h
  • OnMethodCall() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnMethodException() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnMethodReturn() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnObjectActivate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnObjectConstruct() : ComSpyAudit.Idl
  • OnObjectCreate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnObjectDeactivate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnObjectDestroy() : ComSpyAudit.Idl
  • OnObjectRelease() : MtsAudit.Idl
  • OnObjPoolCreateDecision() : ComSpyAudit.Idl
  • OnObjPoolCreateObject() : ComSpyAudit.Idl
  • OnObjPoolCreatePool() : ComSpyAudit.Idl
  • OnObjPoolDestroyObject() : ComSpyAudit.Idl
  • OnObjPoolGetFromTx() : ComSpyAudit.Idl
  • OnObjPoolGetObject() : ComSpyAudit.Idl
  • OnObjPoolPutObject() : ComSpyAudit.Idl
  • OnObjPoolRecycleToTx() : ComSpyAudit.Idl
  • OnObjPoolTimeout() : ComSpyAudit.Idl
  • OnPackageActivation() : MtsAudit.Idl
  • OnPackageShutdown() : MtsAudit.Idl
  • OnPosRectChange() : ioips.h
  • OnPrinterNotificationOption() : printjob.c
  • OnQCMoveToDeadQueue() : ComSpyAudit.Idl
  • OnQCMoveToReTryQueue() : ComSpyAudit.Idl
  • OnQCPlayback() : ComSpyAudit.Idl
  • OnQCQueueOpen() : ComSpyAudit.Idl
  • OnQCReceive() : ComSpyAudit.Idl
  • OnQCReceiveFail() : ComSpyAudit.Idl
  • OnQCRecord() : ComSpyAudit.Idl
  • OnResourceAllocate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnResourceCreate() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnResourceDestroy() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnResourceRecycle() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnResourceTrack() : ComSpyAudit.Idl
  • OnRightClick() : sdkdiff.cpp
  • OnSelectPrinter() : printjob.c
  • OnSetAbort() : ComSpyAudit.Idl
  • OnSetComplete() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnShowWindow() : iocs.h
  • OnStartup() : Cmd.Cpp , Global.h
  • OnTapiEvent() : CallNot.cpp , CallNot.h , Callnot.Cpp , Callnot.h , common.h , Processing.cpp
  • OnThreadAssignApartment() : ComSpyAudit.Idl
  • OnThreadAssignToActivity() : MtsAudit.Idl
  • OnThreadBindToApartment() : ComSpyAudit.Idl
  • OnThreadStart() : MtsAudit.Idl
  • OnThreadTerminate() : MtsAudit.Idl , ComSpyAudit.Idl
  • OnThreadUnassignApartment() : ComSpyAudit.Idl
  • OnThreadUnassignFromActivity() : MtsAudit.Idl
  • OnThreadUnBind() : ComSpyAudit.Idl
  • OnThreadWorkEnque() : ComSpyAudit.Idl
  • OnThreadWorkPrivate() : ComSpyAudit.Idl
  • OnThreadWorkPublic() : ComSpyAudit.Idl
  • OnThreadWorkRedirect() : ComSpyAudit.Idl
  • OnThreadWorkReject() : ComSpyAudit.Idl
  • OnTransactionAborted() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnTransactionCommit() : ComSpyAudit.Idl
  • OnTransactionPrepared() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnTransactionStart() : ComSpyAudit.Idl , MtsAudit.Idl
  • OnUIActivate() : ioips.h
  • OnUIDeactivate() : ioips.h
  • OnUpdate() : sdkdiff.cpp
  • Open() : FTPJr.cpp
  • OpenAppMemPerformanceData() : Perfmem.c
  • OpenEdit() : ioo.h
  • OpenFileError() : Utility.c , Utility.h
  • OpenFunc() : Open.c , Open.h
  • OpenILS() : RendSam.Cpp
  • OpenLogFile() : NewFsp.h , Util.c
  • OpenMultiThreadEnableButtons() : Open.c
  • OpenPolicy() : Audit.c , LsaPrivs.c
  • OpenQueueForAsyncReceiveWithCompletionPort() : MQPort.Cpp
  • OpenRegKey() : common.cpp , common.h
  • OpenSaveHookProc() : Open.c
  • OpenSaveThread1Proc() : Open.c
  • OpenSaveThread2Proc() : Open.c
  • OpenSessionWithWait() : app.cpp
  • OpenSigGenPerformanceData() : Perfgen.c
  • OpenSocketRegisterAndListen() : PrSamp.h , PrPerf.c
  • OpenStreams() : ips.h
  • OpenTheFile() : ComDlg32.C , ComDlg32.h
  • OpenWinSNMPSession() : WSnmpUtil.h , WSnmpUtil.Cpp
  • operator delete() : minici.hxx , Alloc.h , heap.Cpp , Alloc.Cpp , heap.h
  • operator new() : heap.Cpp , heap.h , Alloc.Cpp , Alloc.h , minici.hxx , PropSpec.Cxx
  • operator!=() : string.h
  • operator+() : string.Cpp
  • operator<() : string.h , dynamic.h , string.h
  • operator<<() : marshalhelpers.h
  • operator<=() : string.h
  • operator==() : string.h , dynamic.h , string.h
  • operator>() : string.h
  • operator>=() : string.h
  • operator>>() : marshalhelpers.h
  • Options_OnCommand() : PropSht.c
  • Options_OnDestroy() : PropSht.c
  • Options_OnInitDialog() : PropSht.c
  • Options_OnNotify() : PropSht.c
  • OptionsDlgProc() : Dlg.Cpp
  • OptionsPageProc() : PropSht.c
  • OrderId() : QCOrder.Idl , QCNotify.Idl , QCShip2.Idl , QCOrder.Idl , QCShip.Idl
  • OrMaps() : section.cpp
  • OutOfMemory() : ClipText.c , winmain.cpp , ClipText.c , winmain.h
  • OutOfMemoryMessageBox() : DebMisc.h , DebMisc.c
  • OutPipeSample() : pipesample.Idl
  • OutputDebugFmt() : AppUtil.Cpp , AppUtil.h
  • OutputDebugLastErrorFileLine() : TapiInfo.c , TapiInfo.h
  • OutputDebugLineCallback() : TapiInfo.c , TapiInfo.h
  • OutputDebugLineErrorFileLine() : TapiInfo.h , TapiInfo.c
  • OutputDebugPrintf() : TapiInfo.c , TapiInfo.h
  • OutputError() : dhcpnotify.cpp , ErrorOut.cpp , ErrorOut.h , dhcppersist.cpp , dhcprequest.cpp
  • OutputErrors() : adoisapi.cpp
  • OutputString() : adoisapi.cpp
  • OutputTime() : sclient.cpp
  • OutputTraceString() : customdialreg.cpp , customentry.c , customdial.cpp
  • OverFlowText() : MultiWnd.C
  • OverlappedManagerThread() : overlap.cpp
  • OwnUIOwnIMCWndProc() : MultiWnd.C , MultiUI.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- ~ -

  • ~CAdviseSink() : ias.h
  • ~CDropSource() : ids.h
  • ~CDropTarget() : idt.h
  • ~COleClientSite() : iocs.h
  • ~COleInPlaceFrame() : ioipf.h
  • ~COleInPlaceSite() : ioips.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- a -

  • A2CT() : StrConv.h
  • A2T() : StrConv.h
  • A2WHelper() : StrConv.h
  • A_StgCreateDocfile() : AppUtil.Cpp , AppUtil.h
  • A_StgIsStorageFile() : AppUtil.h , AppUtil.Cpp
  • A_StgOpenStorage() : AppUtil.Cpp , AppUtil.h
  • A_StringFromGUID2() : AppUtil.Cpp , AppUtil.h
  • A_WriteFmtUserTypeStg() : AppUtil.Cpp , AppUtil.h
  • Abort() : CrmFilesTest.Idl
  • AbortDlg() : tprint.cpp
  • AbortDlgProc() : Printer.c , Printer.h
  • AbortProc() : tprint.cpp , APP.Cxx , View.Hxx , Printer.c , Printer.h
  • AbortTransaction() : BYOTTransaction.Idl , CrmMonComp.Idl
  • AbortTx() : RmWorker.Idl
  • About() : Demo.h , Property.c , Rebar.c , Generic.C , Cursor.c , Cursor.h , ComSpyCtl.Idl , DynDlg.c , DragImg.h , MtsSpyCtl.Idl , SimpCntr.Cpp , SimpCntr.h , SimpDnd.Cpp , SimpDnd.h , SimpSvr.Cpp , SimpSvr.h , MfEdit.c , MfEdit.h , dialogs.c , dialogs.h , SetDisp.c , SetDisp.h , TextFx.c , TextFx.h , ViewDIB.c , halftone.c , PlgBlt.c , PlgBlt.h , ABOUT.c , About.c , EventSink.cpp , AboutDlg.c , AboutDlg.h , StatList.c , LeakyBin.c , ClipText.c , Demo.c , ComDlg32.C , ComDlg32.h
  • AboutBox() : sdkdiff.cpp
  • AboutDialogProc() : Menu.c , Menu.h
  • AboutDlg() : IMEApps.c , IMEApps.h , Dlgs.C , MultiUI.h
  • AboutDlgProc() : APP.Cxx , APP.Hxx , Dialog.c , GdiDemo.h , Printer.c , Printer.h , Dialogs.c , WinCap.h , DebMain.c , VListVw.c , VListVw.h , IconPRO.C , WndProc.c , DragImg.Cpp
  • AboutProc() : Framer.Cpp , Framer.h , Dialer.c , CDTest.c , CDTest.h , FVProc.Cpp , FVText.h
  • AbsorbAnyBlanks() : section.cpp
  • AcceptAuthSocket() : Server.cpp
  • AcceptCondFunc() : Receiver.Cpp
  • AcceptSecurityContext() : Stubs.c
  • AcceptTypeImage() : main.cpp
  • AccountRestrictions() : SubAuth.c
  • AccountThread() : bankdlg.Cpp , bankthrds.Cpp
  • AcquireAndGetRSAKey() : RSACert.cpp
  • AcquireCredentialsHandleW() : Stubs.c
  • AcquireDynamicReadwriteLock() : sync.c , sync.h
  • AcquireReadLock() : sync.c , sync.h
  • AcquireShutdownPrivilege() : setup.h , utils.cpp
  • AcquireSocketLock() : provider.h , sockinfo.cpp
  • AcquireWriteLock() : sync.c , sync.h
  • ActiveUpdateThread() : threads.c , threads.h
  • ActivityId() : CrmMonComp.Idl
  • Add() : data.Idl
  • add_thread() : BPSamp.h , Utils.c
  • AddAccessAllowedACEToACL() : AclMgmt.Cpp , DComPerm.h
  • AddAccessDeniedACEToACL() : AclMgmt.Cpp , DComPerm.h
  • AddAccessRights() : SecPrint.c
  • AddApp() : chWnd.Cpp
  • AddAuthorizationHeader() : HttpAuth.c , HttpAuth.h
  • AddCert() : PropCert.Cpp
  • AddChange() : queue.c , queue.h
  • AddConference() : RendSam.Cpp
  • AddContext() : Stubs.c
  • AddCredential() : Stubs.c
  • AddEntry() : Collect.cpp , Collect.h
  • AddFile() : RmWorker.Idl , CopyFileRm.Idl
  • AddFileMenuItems() : Utility.Cpp , Utility.h
  • AddFormatDlgProc() : MDIChild.C
  • AddIDTableEntry() : ImeMenu.c
  • AddInterface() : rmapi.c
  • AddItemToList() : Enum.Cpp , Enum.h
  • AddItemToTemplate() : OpenDIB.c
  • AddItemToTree() : Main.Cpp
  • AddJob() : sa.Cpp
  • AddJobData() : queue.c , queue.h
  • AddMachineAccount() : MachAcct.c
  • AddMember() : cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h
  • AddMofInfo() : tracewmi.cpp
  • AddNewItemToList() : Enum.Cpp , Enum.h
  • AddNode() : clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h
  • AddPrincipalToNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • AddProtocolToServer() : loadprotocol.c
  • AddReadersToGroup() : SCIntro.Cpp
  • AddRef_ItemList() : Enum.Cpp , Enum.h
  • AddRegNamedValue() : AppUtil.Cpp , AppUtil.h , Reg.Cpp , Reg.h
  • AddressDialogProc() : rtcdialogs.cpp
  • AddressSupportsAudio() : tapirecv.cpp
  • AddressSupportsMediaType() : Incoming.Cpp , Outgoing.Cpp
  • AddressSupportsMST() : tapirecv.cpp
  • AddResultString() : MultiWnd.C
  • AddRpcEEInfo() : Service.cpp , Service.h , service.cpp , service.h
  • AddRpcEEInfoAndRaiseException() : Service.cpp , Service.h , service.cpp , service.h
  • AddrStringToBtAddr() : bthcxn.cpp
  • AddSegment() : Fx.c
  • AddSlotToList() : hashtbl.cpp , hashtbl.h
  • AddSockInfoToList() : common.h , SockInfo.cpp
  • addSourceToRegistry() : log.c
  • AddStatusField() : FontView.c , Status.c
  • AddStroke() : RecoDll.cpp
  • AddThreadingModel() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • AddToMessageLog() : debug.c , Service.cpp , Service.h , service.cpp , service.h , service.cpp , service.h , service.cpp , service.h , Service.C , Service.H , Service.c , Service.H
  • AddToMessageLogProcFailure() : Service.cpp , Service.h , service.cpp , service.h
  • AddToMessageLogProcFailureEEInfo() : Service.cpp , Service.h , service.cpp , service.h
  • AddToolButton() : FontView.c , Tools.c
  • AddToolCombo() : FontView.c , Tools.c
  • AddToolLabel() : Tools.c , FontView.c
  • AddToolSpace() : FontView.c , Tools.c
  • AddToRedialList() : Dialer.c
  • AddTransientSubscription() : Adminwrap.Cpp , Adminwrap.h
  • AddUser() : Commands.h , RendSam.Cpp , Commands.Cpp
  • AddUserToCache() : AuthFilt.h , cache.c
  • AddUserToUList() : Dlg.Cpp , cMemb.h
  • AddValueToOtherWKOProperty() : otherwko.cpp , otherwko1.cpp
  • AddViewMenuItems() : Utility.h , Utility.Cpp
  • AddWorkQueueEntry() : ThreadPool.c , ThreadPool.h
  • ADErrMsgBox() : ADSIhelpers.cpp , ADSIhelpers.h
  • Adjust() : MICARS.Idl
  • AdjustIconImagePointers() : Icons.C
  • AdjustStatusBar() : Status.c , FontView.c
  • AdjustTallMenu() : tallmenu.c
  • AdjustToolBar() : FontView.c , Tools.c
  • ADOConnectionConstruction_get_DSO_Proxy() : adoint.h
  • ADOConnectionConstruction_get_DSO_Stub() : adoint.h
  • ADOConnectionConstruction_get_Session_Proxy() : adoint.h
  • ADOConnectionConstruction_get_Session_Stub() : adoint.h
  • ADORecordsetConstruction_get_Chapter_Proxy() : adoint.h
  • ADORecordsetConstruction_get_Chapter_Stub() : adoint.h
  • ADORecordsetConstruction_get_RowPosition_Proxy() : adoint.h
  • ADORecordsetConstruction_get_RowPosition_Stub() : adoint.h
  • ADORecordsetConstruction_get_Rowset_Proxy() : adoint.h
  • ADORecordsetConstruction_get_Rowset_Stub() : adoint.h
  • ADORecordsetConstruction_put_Chapter_Proxy() : adoint.h
  • ADORecordsetConstruction_put_Chapter_Stub() : adoint.h
  • ADORecordsetConstruction_put_RowPosition_Proxy() : adoint.h
  • ADORecordsetConstruction_put_RowPosition_Stub() : adoint.h
  • ADORecordsetConstruction_put_Rowset_Proxy() : adoint.h
  • ADORecordsetConstruction_put_Rowset_Stub() : adoint.h
  • ADsToStringList() : helper.cpp , helper.h
  • AdsTypeToChar() : ADSIhelpers.cpp
  • Advertise() : rnrcs.cpp
  • Advise() : ioo.h
  • AdviseInkChange() : RecoDll.cpp
  • AdviseSingleSink() : globals.cpp , globals.h
  • AdviseSink() : globals.cpp , globals.h
  • AFImage() : main.cpp , TestAccept.cpp
  • ahextoi() : TraceLog.c
  • AllNullParamCase() : enablerouter.c
  • ALLOC() : Alloc.Cpp , Alloc.h
  • AllocAndCopy() : AdvQuery.Cxx
  • AllocAndInitSockInfo() : common.h , SockInfo.cpp
  • AllocateAndFormatErrorMessage() : PoolWrap.cpp
  • AllocateBindings() : odbcsql.c
  • AllocateEventItem() : mspaddr.cpp
  • AllocateEvents() : Processing.cpp
  • AllocateFreePool() : overlap.cpp
  • AllocateList() : RPCssmc.c
  • AllocateMemory() : common.h , tapirecv.cpp , tapisend.cpp , common.h
  • AllocateSmList() : RPCssmc.c , RPCssmp.c
  • AllocateStreamSamples() : Processing.cpp
  • AllocateUnicodeString() : util.cxx , main.hxx
  • AllocDllNode() : DebDebug.c
  • AllocHdbc() : quiktest.c
  • AllocHenv() : quiktest.c
  • AllocHstmt() : quiktest.c
  • AllocMsgProps() : MQPort.Cpp
  • AllocProcessNode() : DebDebug.c
  • AllocQueueData() : queue.c , queue.h
  • AllocRoomForDIB() : Dibutil.h , Dibutil.c
  • AllocThreadNode() : DebDebug.c
  • AllocUser() : cMemb.Cpp
  • AllocWindowInfo() : GdiDemo.h , Wininfo.c
  • AllowedType() : quiktest.c
  • AlreadyInProgress() : utils.cpp , setup.h
  • AmpersandCompensate() : Dialer.c
  • AmpersandDeCompensate() : Dialer.c
  • AndMaps() : section.cpp
  • Ansi2Unicode() : globals.cpp , globals.h , debug.c , debug.h
  • AnsiStringToUnicode() : MainFrm.Cpp
  • AnsiToLocal() : Utility.Cpp
  • AnsiToUc() : AppUtil.Cpp , AppUtil.h
  • AnsiToUnicodeString() : util.cxx , main.hxx , util.cxx , main.hxx
  • AnswerTheCall() : FileTerm.h , FileTerm.cpp , Incoming.Cpp
  • APCNotificationRoutine() : AsyncRPCc.c
  • AppAbout() : MciPlay.c
  • AppBar_AutoHide() : AppBar.c
  • AppBar_Callback() : AppBar.h , AppBar.c
  • AppBar_Hide() : AppBar.h , AppBar.c
  • AppBar_NoAutoHide() : AppBar.c
  • AppBar_PosChanged() : AppBar.h , AppBar.c
  • AppBar_QueryPos() : AppBar.c , AppBar.h
  • AppBar_QuerySetPos() : AppBar.c , AppBar.h
  • AppBar_Register() : AppBar.c , AppBar.h
  • AppBar_SetAlwaysOnTop() : AppBar.h , AppBar.c
  • AppBar_SetAutoHide() : AppBar.h , AppBar.c
  • AppBar_SetAutoHideTimer() : AppBar.c , AppBar.h
  • AppBar_SetAutoUnhideTimer() : AppBar.h , AppBar.c
  • AppBar_SetSide() : AppBar.c , AppBar.h
  • AppBar_Size() : AppBar.c , AppBar.h
  • AppBar_UnHide() : AppBar.h , AppBar.c
  • AppBar_UnRegister() : AppBar.c , AppBar.h
  • Append() : data.Idl
  • AppendFileNametoLogFile() : FaxSiren.Cpp
  • ApplyControlToken() : Stubs.c
  • AppWndProc() : MciPlay.c
  • AptFreeAutoTest() : ComPerf.Cpp
  • AptFreeCOMTest() : ComPerf.Cpp
  • AptThreadProc() : Server.Cpp
  • AR_Allocate() : areadcli.c
  • AR_Free() : areadcli.c
  • AretheGUIDsEqual() : ADSIhelpers.cpp
  • ArrayWalkProc() : Xmitu.h , Xmitu.c
  • AssertProc() : Debug.Cpp
  • AssertTakeOwnership() : TakeOwn.c
  • AssignPersistentDriveLetter() : DLEdit.Cpp
  • AssignTemporaryDriveLetter() : DLEdit.Cpp
  • AssociateEventsWithSamples() : Processing.cpp
  • AsyncCallback() : AsyncDemo.cpp
  • AsyncCompletion() : DumpRequestInfo.cpp
  • AsyncDialog() : AsyncDemo.cpp
  • AsyncDirect() : AsyncDemo.cpp
  • AsyncFunc() : AsyncRPC.Idl , AsyncRPCp.c
  • AsyncMultiGraphEvent() : mspcall.cpp
  • AsyncReadClientIoCompletion() : areadcli.c
  • AsyncSelectAcceptMain() : ASAccept.cpp , common.h
  • AsyncURL() : AsyncDemo.cpp
  • AtlA2WHelper() : helper.cpp
  • AtlW2AHelper() : helper.cpp
  • AtoH() : Misc.c , Globals.h
  • AttachDlgProc() : DebMain.c
  • AttachToDebuggee() : DebMisc.h , DebMisc.c
  • AttemptFileOpen() : MainWND.c
  • AudioDlgProc() : Dlg.Cpp
  • Audit() : ComSpyCtl.Idl , MtsSpyCtl.Idl , ComSpyCtl.Idl
  • AuthConverse() : HttpAuth.c
  • AuthDialogProc() : rtcdialogs.cpp
  • AuthenticateeMakeMessage() : Eap.c , Eap.h
  • AuthenticatorMakeMessage() : Eap.h , Eap.c
  • AuthInit() : HttpAuth.c
  • AuthorizeAndExecuteExpense() : AuthzSvr.c
  • AuthTerminate() : HttpAuth.c
  • AuthzAccessCheckCallback() : AuthzSvr.c
  • AuthzComputeGroupsCallback() : AuthzSvr.c
  • AuthzFreeGroupsCallback() : AuthzSvr.c
  • AutoHeapAlloc() : common.h , service.h , common.cpp , Service.h , common.h , common.cpp
  • AutoHeapFree() : common.h , service.h , Service.h , common.cpp , common.h , common.cpp , common.h , common.cpp
  • AutoTestDesc() : quiktest.c , custom.c
  • AutoTestFunc() : custom.c , quiktest.c
  • AutoTestName() : custom.c , quiktest.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- b -

  • ballBounce() : Bounce.c , Bounce.h
  • ballCreate() : Bounce.h , Bounce.c
  • ballDestroy() : Bounce.c , Bounce.h
  • ballGetDimensions() : Bounce.h , Bounce.c
  • ballGetDirection() : Bounce.c , Bounce.h
  • ballGetPosition() : Bounce.c , Bounce.h
  • ballSetDimensions() : Bounce.c , Bounce.h
  • ballSetDirection() : Bounce.h , Bounce.c
  • ballSetPosition() : Bounce.c , Bounce.h
  • BallThreadProc() : GUIBALL.Cpp
  • BarClick() : bar.cpp
  • BarDrawPosition() : bar.cpp , sdkdiff.h
  • Bark() : iDog.Idl
  • BarPaint() : bar.cpp
  • BarWndProc() : bar.cpp
  • Base64DecodeChunk() : IsapiBuffer.cpp
  • Base64EncodeChunk() : IsapiString.cpp
  • bChooseNewColor() : MfEdit.c , MfEdit.h
  • bChooseNewFont() : MfEdit.c , MfEdit.h
  • bCleanUpRC() : MfEdit.c , MfEdit.h
  • bDoHitTest() : MfEdit.c , MfEdit.h
  • bDrawStuff() : MfEdit.c , MfEdit.h
  • BE_CreateTable() : networkentry.c , networkentry.h
  • BE_DestroyTable() : networkentry.c , networkentry.h
  • bFreeDibFile() : MfEdit.c , MfEdit.h
  • bGetBMP() : MfEdit.c , MfEdit.h
  • bGetEPSBounds() : MfEdit.c , MfEdit.h
  • bGetWord() : MfEdit.c , MfEdit.h
  • bGoNextLine() : MfEdit.c , MfEdit.h
  • bHitTest() : MfEdit.c , MfEdit.h
  • Bind() : Sample1.Cpp , Sample1.h
  • BindAllColumns() : quiktest.c
  • BindFetchColumns() : quiktest.c
  • BinToHex() : quiktest.c
  • bIsAdobe() : MfEdit.c , MfEdit.h
  • bIsBndBox() : MfEdit.c , MfEdit.h
  • bIsEOF() : MfEdit.h , MfEdit.c
  • bIsEPS() : MfEdit.c , MfEdit.h
  • bIsNT() : WbemSec.Cpp
  • BitmapToDIB() : Dibapi.h , Dibutil.c
  • BITSCheckHR() : bits_ie.cpp
  • BitsInMap() : section.cpp
  • BKL_Abort() : keys.cpp
  • BKL_Alloc() : keys.cpp
  • BKL_Dealloc() : keys.cpp
  • BLRPLATE_AttachProperties() : blrplate.c
  • BLRPLATE_Deregister() : blrplate.c
  • BLRPLATE_FormatProperties() : blrplate.c
  • BLRPLATE_FormatSummary() : blrplate.c
  • BLRPLATE_RecognizeFrame() : blrplate.c
  • BLRPLATE_Register() : blrplate.c
  • BOOL() : GinaHook.h , GinaStub.h , Tst4Wts.c
  • BottomRight() : status.cpp
  • BounceCommandProc() : Bounce.c , Bounce.h
  • BounceCreateProc() : Bounce.c , Bounce.h
  • BounceDestroyProc() : Bounce.c , Bounce.h
  • BounceObjects() : Bounce.c , Bounce.h
  • BouncePaintProc() : Bounce.c , Bounce.h
  • BounceProc() : Bounce.c , Bounce.h
  • BounceRefresh() : Bounce.c , Bounce.h
  • bPlayRecord() : MfEdit.c , MfEdit.h
  • bPlgBlt() : MfEdit.c , MfEdit.h
  • bPrintMf() : MfEdit.c , MfEdit.h
  • BreakRun() : DspFormt.Cpp
  • Browse() : Utility.h , Utility.c
  • BrowseOpenFileName() : common.cpp , common.h
  • BrowseSaveFileName() : common.h , common.cpp
  • bSelectDIBPal() : MfEdit.c , MfEdit.h
  • bSetAdvancedGraphics() : MfEdit.c , MfEdit.h
  • bSetRC2MatchEmfRC() : MfEdit.c
  • bSetupRC() : MfEdit.c , MfEdit.h
  • BSTR2LPSTR() : nmsession.cpp , plugxprt.cpp , utils.cpp
  • BSTR_UserFree() : ADsError.h
  • BSTR_UserMarshal() : ADsError.h
  • BSTR_UserSize() : ADsError.h
  • BSTR_UserUnmarshal() : ADsError.h
  • BSTRCompareW() : StringUtils.h , StringUtils.cpp , PropList.cpp , PropList.h , StringUtils.cpp , PropList.cpp , StringUtils.h , StringUtils.cpp , PropList.h
  • BtoH() : Globals.h , Misc.c
  • BufferCallback() : tracedmp.cpp
  • BufferIn1() : Server.c
  • BufferIn2() : Server.c
  • BufferIn3() : Server.c
  • BufferInit() : HttpAuth.c
  • BufferOut1() : Server.c
  • BufferOut2() : Server.c
  • BufferOut3() : Server.c
  • BufferOut4() : Server.c
  • BufferQueryPtr() : HttpAuth.c
  • BufferResize() : HttpAuth.c
  • BufferTerminate() : HttpAuth.c
  • BuildAdministratorsExplicitAccess() : SuperUsr.cpp
  • BuildAppletKey() : session.cpp
  • BuildCreateStmt() : quiktest.c
  • BuildDataFileName() : Utility.h , Utility.Cpp
  • BuildExecCommand() : utils.Cpp , utils.h
  • BuildFilterStrs() : MfEdit.h , MfEdit.c
  • BuildFontList() : Paint.h , Paint.c
  • BuildGenericAccessAcl() : common.c
  • BuildGlobalObjects() : server.cpp
  • BuildInsertStmt() : quiktest.c
  • BuildKeyList() : keys.cpp
  • BuildKeyValues() : filtreg.hxx , FiltReg.Hxx
  • BuildLspMap() : instlsp.cpp
  • BuildNamedPipeAcl() : Server.c
  • BuildParaRunList() : DspFormt.Cpp
  • BuildRebar() : Rebar.c
  • BuildVisualDisplayOrder() : DspFormt.Cpp
  • Busy() : SServer.Cpp , winmain.h , winmain.cpp , SServer.Cpp
  • BusyError() : sdkdiff.cpp
  • ButtonFontSetup() : Dialer.c
  • ButtonsDlgProc() : Property.c
  • BytesPerLine() : Dib.c , Dib.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- c -

  • CAdviseSink() : ias.h
  • CalcListViewWidth() : Helper.h , Helper.Cpp
  • CalcPrettyPrintMaxColWidth() : dump.cpp , sampclnt.h
  • CalcRot() : Display.c
  • CalculateImageOffset() : Icons.C
  • CalculatePrintRect() : Print.c
  • Call() : tapisend.cpp
  • call_server() : GssClient.c
  • CallConfDlgProc() : Dlg.Cpp
  • CallDlgProc() : Dlg.Cpp
  • CallUserApcProc() : overlap.cpp
  • CallWorkerThread() : RasHost.h , RasHost.Cpp
  • CanAllocHdesc() : quiktest.c
  • CANCEL_DlgProc() : Cancel.Cpp
  • CANCEL_OnCommand() : Cancel.Cpp
  • CANCEL_OnInitDialog() : Cancel.Cpp
  • CANCEL_OnTimer() : Cancel.Cpp
  • CandListWndProc() : IMEApps.c , IMEApps.h
  • CandUIPaint() : CANDUI.C , FullIME.h
  • CandWndProc() : CANDUI.C , FullIME.h
  • CanInPlaceActivate() : ioips.h
  • CaretHandling() : DspFormt.Cpp
  • CbActualFromCbUser() : malspy.c
  • cbEnumSymbols() : dbh.cpp
  • cbSrcFiles() : dbh.cpp
  • cbSymbol() : dbh.cpp
  • CbUserFromCbActual() : malspy.c
  • CchSzLen() : AdsiDump.cpp
  • CDefClassFactory_AddRef() : DefClsF.C
  • CDefClassFactory_Create() : DefClsF.C
  • CDefClassFactory_CreateInstance() : DefClsF.C
  • CDefClassFactory_LockServer() : DefClsF.C
  • CDefClassFactory_QueryInterface() : DefClsF.C
  • CDefClassFactory_Release() : DefClsF.C
  • CDropSource() : ids.h
  • CDropTarget() : idt.h
  • CE_Cleanup() : configentry.c , configentry.h
  • CE_Create() : configentry.c , configentry.h
  • CE_Destroy() : configentry.c , configentry.h
  • CE_Initialize() : configentry.c , configentry.h
  • ceBuildPathAndExt() : CeLib.Cpp , celib.cpp
  • ceConvertSzToBstr() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceConvertSzToWsz() : CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h , CeLib.Cpp , celib.cpp
  • ceConvertWszToBstr() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceConvertWszToSz() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDateToFileTime() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDbgPrintf() : cedebug.cpp , CeDebug.Cpp , CeLibW2k.h , cedebug.cpp , CeDebug.Cpp , CeLibW2k.h
  • ceDecodeObject() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDispatchSetErrorInfo() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDispatchSetErrorInfoSub() : CeLib.Cpp , celib.cpp
  • ceDuplicateString() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceDupString() : ceformat.cpp , CeFormat.Cpp
  • ceEncodeObject() : CeLibW2k.h , CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp
  • ceErrorPrintLine() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceFileTimeToDate() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceFormatCertsrvStringArray() : CeLibW2k.h , ceformat.cpp , CeFormat.Cpp , CeLibW2k.h
  • ceFreeBstr() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceGetComputerNames() : CeLib.Cpp , celib.cpp
  • ceGetErrorMessageText() : CeError.Cpp , ceerror.cpp , CeError.Cpp , CeLibW2k.h , ceerror.cpp , CeError.Cpp , CeLibW2k.h
  • ceGetErrorMessageText1() : CeError.Cpp , ceerror.cpp
  • ceGetErrorMessageTextEx() : CeError.Cpp , ceerror.cpp
  • ceGetMachineDnsName() : CeLib.Cpp , celib.cpp
  • ceGetOIDName() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceGetOIDNameA() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceHError() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceHExceptionCode() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceHLastError() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceHResultToString() : CeError.Cpp , ceerror.cpp , CeError.Cpp , CeLibW2k.h , ceerror.cpp , CeError.Cpp , CeLibW2k.h
  • ceHResultToStringEx() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceHResultToStringRaw() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceInitErrorMessageText() : CeError.Cpp , ceerror.cpp , CeError.Cpp , CeLibW2k.h , ceerror.cpp , CeError.Cpp , CeLibW2k.h
  • ceInternetCanonicalizeUrl() : CeLibW2k.h , ceformat.cpp , CeFormat.Cpp , CeLibW2k.h
  • ceIsConfigLocal() : CeLib.Cpp , celib.cpp
  • ceIsDelayLoadHResult() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • ceJetHResult() : CeError.Cpp , ceerror.cpp , CeError.Cpp , ceerror.cpp , CeError.Cpp
  • celstrcmpiL() : CeLib.Cpp , celib.cpp
  • ceMakeExprDate() : CeLibW2k.h , CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp
  • ceMakeExprDateTime() : CeLib.Cpp , celib.cpp , CeLib.Cpp , celib.cpp , CeLib.Cpp
  • CenterDialog() : common.cpp , common.h , winmain.cpp , winmain.h , Main.Cpp
  • CenterOrigin() : WxForm.c , WxForm.h
  • CenterWindow() : Generic.C , DoServer.Cpp , Dialogs.c , FontView.c , printjob.c , printjob.h , TextFx.c , WinCap.c , WinCap.h , halftone.c , GLOBALS.h , Misc.c , Globals.h , Misc.c , Global.h , Util.Cpp , StatList.c , WinUtils.c , WinUtils.h , LeakyBin.c
  • ceSanitizedNameToDSName() : ceformat.cpp , CeFormat.Cpp
  • ceTranslatePeriodUnits() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceVerifyAltNameString() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceVerifyObjId() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ceVerifyObjIdA() : CeLib.Cpp , celib.cpp
  • ceWtoI() : CeLib.Cpp , celib.cpp , CeLib.Cpp , CeLibW2k.h , celib.cpp , CeLib.Cpp , CeLibW2k.h
  • ChangeAppIDAccessACL() : DComPerm.h , Wrappers.Cpp
  • ChangeAppIDLaunchAndActivateACL() : DComPerm.h , Wrappers.Cpp
  • ChangeBitmapFormat() : Dibapi.h , Dibutil.c
  • ChangeDefaultAccessACL() : DComPerm.h , Wrappers.Cpp
  • ChangeDefaultLaunchAndActivateACL() : DComPerm.h , Wrappers.Cpp
  • ChangeDIBFormat() : Dibapi.h , Dibutil.c
  • ChangeFont() : Settings.Cpp
  • ChangeMachineAccessACL() : DComPerm.h , Wrappers.Cpp
  • ChangeMachineLaunchAndActivateACL() : DComPerm.h , Wrappers.Cpp
  • ChangeResolution() : SetDisp.c , SetDisp.h
  • CHAR_STRING_free_inst() : Repassu.c
  • CHAR_STRING_free_local() : Repassu.c
  • CHAR_STRING_from_local() : Repassu.c
  • CHAR_STRING_to_local() : Repassu.c
  • CharHandler() : Main.C
  • CheckAccess() : Main.h , Security.Cpp , Service.cpp , WbemSec.Cpp
  • CheckADHRESULT() : main.cpp , CreateUserHelpers.cpp , CreateUserHelpers.h , ADSIhelpers.h
  • CheckAmount() : caccount.Cpp , mvmoney.Cpp
  • CheckAndReAllocBuffer() : TapiCode.c
  • CheckAvailableNameSpaceProviders() : rnrcs.cpp
  • CheckConformanceLevel() : quiktest.c
  • CheckData() : quiktest.c
  • CheckDataChannel() : cData.Cpp , cData.h
  • CheckDataResults() : quiktest.c
  • CheckDescOp() : quiktest.c
  • CheckDescRecord() : quiktest.c
  • CheckDescriptor() : quiktest.c
  • CheckDomainModeOfObject() : getdomainmode.cpp
  • CheckEdgePosition() : Bounce.c , Bounce.h
  • CheckFile() : tracedmp.cpp
  • CheckForContextCleanup() : overlap.cpp
  • CheckForMatchIPv4() : parser.c
  • CheckForRecv() : PrPerf.c , PrSamp.h
  • CheckForSelf() : customdialreg.cpp , customentry.c
  • CheckForSend() : PrPerf.c , PrSamp.h
  • CheckHR() : Driver.Cpp , bits_ie.cpp
  • CheckHRESULT() : ADSIhelpers.cpp , ADSIhelpers.h , ADSIhelpers.cpp , ADSIhelpers.h
  • CheckRequestProperties() : Policy.Cpp
  • CheckRunningOnWhistler() : nshsamp.cpp , nshsamp.h
  • CheckSecurity() : Server.c
  • CheckStreamDir() : CallNot.cpp
  • CheckStreamMT() : CallNot.cpp
  • checksum() : rawudp.c , Ping.cpp
  • checksum_file() : gutils.h , utils.cpp
  • CheckTest() : custom.c
  • ChFromHex() : Global.h , Util.Cpp
  • ChkQosSend() : ChkQos.Cpp , QosEvent.h
  • ChooseAuthScheme() : WinHttpPostSample.cpp
  • ChooseFont() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ChooseFontHookProc() : DebMisc.c
  • ChooseIconFromEXEFile() : Icons.C
  • ChooseLogFile() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ChooseNewBackColor() : DebMisc.c , DebMisc.h
  • ChooseNewFont() : DebMisc.c , DebMisc.h
  • ChopText() : Utility.c , Utility.h
  • ci_AddTimeString() : compitem.cpp
  • ci_compare() : compitem.cpp
  • ci_copytext() : compitem.cpp
  • ci_makecomposite() : compitem.cpp
  • ci_onesection() : compitem.cpp
  • CINTERFACE_PROXY_VTABLE() : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • CiPtrToUlong() : minici.hxx
  • CircleBlt() : Display.c
  • ClaimMediaLabel() : stl_mll.cpp , stl_mll.h
  • Cleanup() : sa.Cpp , AsyncDemo.cpp
  • cleanup() : client.cxx , dbh.cpp
  • CleanUp() : quiktest.c , Globals.h , Misc.c , BasicRecognition.cpp
  • CleanupAW() : ftrans.c , fwasync.c
  • CleanupEventList() : tracedmp.cpp
  • CleanupFileHandleCache() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • CleanupLabel() : DDxDDv.cpp , DDxDDv.h , DDxDDv.cpp , DDxDDv.h
  • CleanupRowset() : sampclnt.cpp , sampclnt.h
  • CleanUpServer() : Pipes.c , Server.c
  • CleanupTx() : RmWorker.Idl
  • CleanUserURI() : rtcdialogs.cpp
  • clear_codebreakpoint() : BPSamp.h , Utils.c
  • clear_databreakpoint() : BPSamp.h , Utils.c
  • ClearAllEvents() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ClearChanges() : queue.c , queue.h
  • ClearConvModeParts() : IMEApps.h , Status.c
  • ClearErrorQueue() : quiktest.c
  • ClearLog() : Debug.Cpp , Global.h
  • ClearSecret() : Create.Cpp , Process.cpp
  • ClearSelection() : Select.c , Select.h
  • ClearText() : Global.h , Util.Cpp , Global.h , Util.Cpp
  • clearthread_databreakpoint() : Utils.c
  • client_establish_context() : GssClient.c
  • ClientCharSetProc() : FontView.c
  • ClientDialogProc() : secClnt.Cpp
  • ClientDlgProc() : Client32.c , Client32.h
  • ClientGlyphProc() : FontView.c
  • ClientProc() : FontView.c
  • ClientSend() : rnrcs.cpp
  • ClientShutdownRequest() : FileRepClientProc.cpp
  • ClientThreadProc() : ComPerf.Cpp
  • ClientWndProc() : Framer.Cpp , Framer.h
  • ClipBookServerCheckIsAlive() : ClipBook Server.cpp
  • ClipBookServerClose() : ClipBook Server.cpp
  • ClipBookServerDllMain() : ClipBook Server.cpp , ClRes.h
  • ClipBookServerGetRequiredDependencies() : ClipBook Server.cpp
  • ClipBookServerIsAlive() : ClipBook Server.cpp
  • ClipBookServerLooksAlive() : ClipBook Server.cpp
  • ClipBookServerOffline() : ClipBook Server.cpp
  • ClipBookServerOfflineThread() : ClipBook Server.cpp
  • ClipBookServerOnline() : ClipBook Server.cpp
  • ClipBookServerOnlineThread() : ClipBook Server.cpp
  • ClipBookServerOpen() : ClipBook Server.cpp
  • ClipBookServerResourceControl() : ClipBook Server.cpp
  • ClipBookServerSetNameHandler() : ClipBook Server.cpp
  • ClipBookServerStartup() : ClipBook Server.cpp , ClRes.h
  • ClipBookServerTerminate() : ClipBook Server.cpp
  • ClipBookServerVerifyRequiredDependencies() : ClipBook Server.cpp
  • CloneAccess() : BasicHiPerf.Cpp
  • CloneContext() : RecoDll.cpp
  • Close() : ioo.h , FTPJr.cpp
  • CloseAndFreeSocketInfo() : provider.h , sockinfo.cpp
  • CloseAppMemPerformanceData() : Perfmem.c
  • CloseAuthSocket() : Client.cpp , Server.cpp
  • CloseClient() : IocpServer.Cpp , IocpServer.h , IocpServerex.Cpp
  • CloseInstance() : printjob.c
  • CloseLogFile() : NewFsp.h , Util.c
  • CloseReadThread() : CommCode.c
  • CloseRegKey() : common.cpp , common.h
  • CloseSigGenPerformanceData() : Perfgen.c
  • CloseTAPI() : Dialer.c
  • CloseWinSNMPSession() : WSnmpUtil.Cpp , WSnmpUtil.h
  • CloseWriteThread() : CommCode.c
  • CLRES_V1_FUNCTION_TABLE() : ClipBook Server.cpp , File Share Sample.cpp
  • CLSIDFromProgIDEx() : common.h
  • CLSIDFromStringEx() : common.h
  • CLSIDtochar() : registry.cpp
  • CLSIDToStringA() : register.cpp
  • Clutch() : MICARS.Idl
  • CM_GetEventMessage() : configmgr.c , configmgr.h
  • CM_GetGlobalInfo() : configmgr.c , configmgr.h
  • CM_SetGlobalInfo() : configmgr.c , configmgr.h
  • CM_StartProtocol() : configmgr.c , configmgr.h
  • CM_StopProtocol() : configmgr.c , configmgr.h
  • CM_WorkerFinishStopProtocol() : configmgr.c
  • CmdAbout() : ABOUT.c , GLOBALS.h , About.c , Globals.h , Cmd.Cpp , ui.cpp , Cmd.Cpp
  • CmdAboutDone() : ABOUT.c , About.c
  • CmdAudio() : Cmd.Cpp
  • CmdCall() : Cmd.Cpp
  • CmdCallAccept() : Cmd.Cpp
  • CmdCallCancel() : Cmd.Cpp
  • CmdCallConf() : Cmd.Cpp
  • CmdCallReject() : Cmd.Cpp
  • CmdChannelData() : Cmd.Cpp
  • CmdChat() : Cmd.Cpp , Init.Cpp
  • CmdClear() : Cmd.Cpp
  • CmdClose() : Global.h , Msg.Cpp
  • CmdCollaborate() : Cmd.Cpp
  • CmdConfAppLeak() : Cmd.Cpp
  • CmdConfInfo() : Cmd.Cpp
  • CmdConfLeak() : Cmd.Cpp
  • CmdConfStart() : Cmd.Cpp
  • CmdConfStop() : Cmd.Cpp
  • CmdConnect() : Connect.c , Globals.h
  • CmdConnectDone() : Connect.c
  • CmdConnectNow() : Connect.c
  • CmdCreateFile1() : TapiComm.c
  • CmdCreateFile2() : TapiComm.c
  • CmdDataEnable() : Cmd.Cpp
  • CmdDebugService() : Service.C , Service.c
  • CmdDisconnect() : Globals.h , IpxChat.c
  • CmdEject() : Cmd.Cpp
  • CmdEnableAppSharing() : Cmd.Cpp
  • CmdExec() : AppUtil.Cpp , AppUtil.h
  • CmdExit() : GLOBALS.h , TapiComm.c , Globals.h , IpxChat.c , Cmd.Cpp , Msg.Cpp , ui.cpp , Cmd.Cpp , Msg.Cpp , Cmd.Cpp , Msg.Cpp
  • CmdFont() : Cmd.Cpp
  • CmdFtCancel() : Cmd.Cpp
  • CmdHangupCall() : GLOBALS.h , TapiComm.c
  • CmdHelp() : Cmd.Cpp
  • CmdInControl() : Cmd.Cpp
  • CmdInstallService() : Service.C , Service.c
  • CmdInvokeRemote() : ui.cpp
  • CmdIsSharingEnabled() : Cmd.Cpp
  • CmdLaunch() : Cmd.Cpp
  • cmdline() : dbh.cpp
  • CmdListen() : Globals.h , Listen.c
  • CmdListenDone() : Listen.c
  • CmdListenNow() : Listen.c
  • CmdMakeCall() : GLOBALS.h , TapiComm.c
  • CmdMonitor() : Cmd.Cpp
  • CmdOptions() : Cmd.Cpp
  • CmdOutbox() : Globals.h , IpxChat.c
  • CmdRefresh() : Cmd.Cpp
  • CmdRegisterLocal() : ui.cpp
  • CmdRemoveService() : Service.C , Service.c
  • CmdSendFile() : Cmd.Cpp
  • CmdShare() : Cmd.Cpp
  • CmdShowLocal() : Cmd.Cpp
  • CmdStub() : GLOBALS.h , Misc.c
  • CmdSysInfo() : Cmd.Cpp
  • CmdSysLogOnOff() : Cmd.Cpp
  • CmdToolbar() : sBar.Cpp
  • CmdTopMost() : Cmd.Cpp
  • CmdUpdate() : Cmd.Cpp
  • CmdViewChat() : Cmd.Cpp
  • CmdViewMsg() : Cmd.Cpp
  • CmdViewSbar() : Cmd.Cpp
  • CmdViewTbar() : Cmd.Cpp
  • CmdViewUsers() : Cmd.Cpp
  • CmdWorkAlone() : Cmd.Cpp
  • CmpODBCtoCHAR() : quiktest.h
  • CoCreateInstanceEx() : cenum.cpp
  • COleClientSite() : iocs.h
  • COleInPlaceFrame() : ioipf.h
  • COleInPlaceSite() : ioips.h
  • CollectAppMemPerformanceData() : Perfmem.c
  • CollectSigGenPerformanceData() : Perfgen.c
  • ColorHookProc() : DoServer.Cpp
  • ColorPick_ChangeSel() : fakemenu.c
  • ColorPick_ChooseLocation() : fakemenu.c
  • ColorPick_GetColorRect() : fakemenu.c
  • ColorPick_OnCreate() : fakemenu.c
  • ColorPick_OnKeyDown() : fakemenu.c
  • ColorPick_OnLButtonUp() : fakemenu.c
  • ColorPick_OnMouseMove() : fakemenu.c
  • ColorPick_OnPaint() : fakemenu.c
  • ColorPick_Popup() : fakemenu.c
  • ColorPick_WndProc() : fakemenu.c
  • ColorsHookProc() : Colors.c
  • ColorsProc() : Colors.c , Colors.h
  • ColorThreadProc1() : Colors.c
  • ColorThreadProc2() : Colors.c
  • ColumnHeaders() : CrmMonComp.Idl
  • ColWidth() : MtsSpyCtl.Idl , ComSpyCtl.Idl , MtsSpyCtl.Idl
  • CombineProperties() : property.h , property.cpp , property.h
  • ComboDlgProc() : Property.c
  • ComDlg32DlgProc() : ComDlg32.C , ComDlg32.h
  • Command() : Settings.Cpp
  • CommandLineUsage() : enablerouter.c
  • CommandProc() : GdiDemo.c , GdiDemo.h
  • Commit() : CrmFilesTest.Idl
  • CommitFn() : nshsamp.cpp
  • CommitTransaction() : BYOTTransaction.Idl
  • CommitTx() : RmWorker.Idl
  • CommonPageRound() : PMMStrm.Hxx
  • CommonPageTrunc() : PMMStrm.Hxx
  • CommThread() : Atsp.c
  • ComObjAboutBox() : ComObj.Cpp
  • ComObjInitMsgLog() : ComObj.Cpp
  • CompareAnsiToUnicode() : quiktest.c
  • CompareAnsiUnicodeResults() : quiktest.c
  • CompareDescField() : quiktest.c
  • CompareDescriptor() : quiktest.c
  • CompareDevModes() : SetDisp.c , SetDisp.h
  • CompareFileTime() : scandir.h
  • CompareFunc() : nlsapi.c
  • CompareItems() : Utility.Cpp , Utility.h
  • CompareVariant() : common.cpp , common.h
  • CompareWithExpected() : quiktest.c
  • compitem_delete() : compitem.h , compitem.cpp
  • compitem_discardsections() : compitem.cpp , compitem.h
  • compitem_freefilename() : compitem.h , compitem.cpp
  • compitem_getcomposite() : compitem.cpp , compitem.h
  • compitem_getfilename() : compitem.cpp , compitem.h
  • compitem_getleftfile() : compitem.cpp , compitem.h
  • compitem_getleftsections() : compitem.h , compitem.cpp
  • compitem_getmark() : compitem.cpp , compitem.h
  • compitem_getrightfile() : compitem.h , compitem.cpp
  • compitem_getrightsections() : compitem.cpp , compitem.h
  • compitem_getstate() : compitem.h , compitem.cpp
  • compitem_gettext_result() : compitem.cpp , compitem.h
  • compitem_gettext_tag() : compitem.cpp , compitem.h
  • compitem_new() : compitem.cpp , compitem.h
  • compitem_rescan() : compitem.cpp , compitem.h
  • compitem_savecomp() : compitem.cpp , compitem.h
  • compitem_SetCopyPaths() : compitem.cpp , compitem.h
  • compitem_setmark() : compitem.cpp , compitem.h
  • compitem_writefile() : compitem.cpp , compitem.h
  • CompleteAuthToken() : Stubs.c
  • CompletionPortThread() : MQPort.Cpp
  • ComplexDeviceCapsLine() : Getcaps.c , Getcaps.h
  • ComplexEnumPrintersLine() : Enumprt.c , Enumprt.h
  • complist_append() : complist.cpp , complist.h
  • complist_appendfinished() : complist.cpp , complist.h
  • complist_args() : complist.cpp , complist.h
  • complist_copyfiles() : complist.cpp , complist.h
  • complist_delete() : complist.cpp , complist.h
  • complist_dirdialog() : complist.cpp , complist.h
  • complist_dodlg_copyfiles() : complist.cpp
  • complist_dodlg_dir() : complist.cpp
  • complist_dodlg_savelist() : complist.cpp
  • complist_filedialog() : complist.cpp , complist.h
  • complist_freedescription() : complist.h , complist.cpp
  • complist_getdescription() : complist.cpp , complist.h
  • complist_getitems() : complist.h , complist.cpp
  • complist_itemcount() : complist.cpp , complist.h
  • complist_markpattern() : complist.h , complist.cpp
  • complist_match() : complist.cpp
  • complist_new() : complist.cpp
  • complist_querytime() : complist.cpp , complist.h
  • complist_savelist() : complist.cpp , complist.h
  • complist_setdialogdefault() : complist.cpp
  • complist_togglemark() : complist.cpp , complist.h
  • CompStrWndProc() : IMEApps.c , IMEApps.h
  • ComputeIcmp6PseudoHeaderChecksum() : Ping.cpp
  • ComputeIcmpChecksum() : Ping.cpp
  • ComputeRotationTransformation() : Paint.c , Paint.h
  • ComputeUdpPseudoHeaderChecksumV4() : rawudp.c
  • ComputeUdpPseudoHeaderChecksumV6() : rawudp.c
  • ConferenceDlgProc() : Dlg.Cpp
  • ConfErrToSz() : Global.h
  • ConfigBLRPLATEDlg_DlgProc() : config.cpp
  • ConfigBLRPLATEDlg_Do() : blrplate.h , config.cpp
  • ConfigBLRPLATEDlg_OnCancelButton() : config.cpp
  • ConfigBLRPLATEDlg_OnCommand() : config.cpp
  • ConfigBLRPLATEDlg_OnHelpButton() : config.cpp
  • ConfigBLRPLATEDlg_OnInitDialog() : config.cpp
  • ConfigBLRPLATEDlg_OnOKButton() : config.cpp
  • ConfigConference() : RendSam.Cpp
  • ConfigDlgProc() : Atsp.c , Atsp.h
  • Configure() : blrplate.h , blrplate.cpp
  • ConfigureDlgProc() : Settings.Cpp , Settings.h
  • ConfigUser() : RendSam.Cpp
  • Connect() : TxFileDisp.Idl , CopyFileRm.Idl , quiktest.c , Connect.c
  • connect_to_server() : GssClient.c
  • ConnectAuthSocket() : Client.cpp
  • ConnectFn() : nshsamp.cpp
  • CONNECTION() : CreateTable.cpp
  • ConnectUsingProc() : Dialer.c
  • ConsoleCtrlHandler() : Sockdupc.c , Sockdups.c
  • ConsoleEventHandler() : SimpleBrowser.cpp
  • ConstructWellKnownSID() : UtilS.Cpp
  • ContextSensitiveHelp() : ioipao.h , ioips.h , ioipf.h , ioipo.h
  • control_C_handler() : Main.c , BPSamp.h
  • ControlCallback() : TraceDp.c
  • ControlHandler() : Service.C , Service.c
  • ConvertBinarySidToName() : MyToken.cpp
  • ConvertDIBFormat() : Dib.h , Dib.c
  • ConvertGuidToString() : util.cpp , util.h
  • ConvertHexToDec() : adoisapi.cpp
  • ConvertLUIDToName() : MyToken.cpp
  • ConvertSid() : Helper.c , Check_SD.h
  • ConvertStringToSmiValue() : WSnmpUtil.h , Helper.Cpp
  • ConvertTexttoIp() : WSnmpUtil.h , Helper.Cpp
  • ConvertToLONG() : common.h , common.cpp
  • ConvertToMBCS() : common.cpp , common.h , common.cpp , common.h , common.cpp , common.h , asserts.h , common.cpp , common.h , common.cpp , asserts.cpp
  • ConvertToSystemTime() : sa.Cpp
  • ConvertToWCHAR() : common.h , asserts.h , common.cpp , common.h , common.cpp , asserts.cpp , common.cpp , common.h , common.cpp , common.h
  • ConvertUTCFromStringToUTCTime() : main.cpp
  • ConvertValueToString() : propdump.cpp
  • ConvertVarTypeToString() : propdump.cpp
  • CopyACL() : DComPerm.h , AclMgmt.Cpp
  • CopyBinding() : common.cpp , common.h
  • CopyBuffer() : globals.cpp , provider.h , spi.cpp , globals.h
  • CopyColorTable() : Dib.c
  • CopyDirTx() : TxFileDisp.Idl
  • CopyFilesInCopyList() : TxFileDisp.Idl
  • CopyFileTx() : TxFileDisp.Idl
  • CopyListBoxToClipboard() : DebMisc.h , DebMisc.c
  • CopyListTx() : RmWorker.Idl
  • CopyLoop() : UnBufCp1.c
  • CopyOffset() : provider.h , spi.cpp
  • CopyPalette() : MfEdit.c , MfEdit.h
  • CopyScreenToBitmap() : Copy.c , Dibapi.h
  • CopyScreenToDIB() : Copy.c , Dibapi.h
  • CopyStringAndTerminate() : Extension.cpp
  • CopyT2W() : globals.h , globals.cpp , globals.h , globals.cpp
  • CopyUnicodeString() : SubAuth.c
  • CopyWindowToBitmap() : Copy.c , Dibapi.h
  • CopyWindowToDIB() : Copy.c , Dibapi.h
  • Count() : data.Idl
  • CountBits() : DIBSectn.c
  • CounterCreate() : resources.cpp , Resources.cpp , resources.h , Resources.h
  • CounterDecrement() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • CounterDelete() : resources.cpp , Resources.cpp , Resources.h , resources.h
  • CounterIncrement() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • CountersCheckForNonzero() : resources.cpp , Resources.cpp , Resources.h , resources.h
  • CountersCreate() : resources.cpp , Resources.h , Resources.cpp , resources.h
  • CountersDelete() : resources.cpp , Resources.cpp , Resources.h , resources.h
  • CountPoints() : Fx.c
  • cpp_quote() : IMSConf2.Idl , ComSpyCtl.Idl , MtsSpyCtl.Idl , myProp.Idl , IMSConf2.Idl
  • CrackADError() : CreateUserHelpers.cpp , ADSIhelpers.cpp , main.cpp , CreateUserHelpers.h , ADSIhelpers.h
  • CrackArgs() : SidClean.c
  • CrackUserAndDomain() : HttpAuth.c
  • Create1() : DynDlg.c
  • Create2() : DynDlg.c
  • create_socket() : GssServer.c
  • CreateAcceptSocket() : IocpServerex.Cpp , IocpServer.h
  • CreateAcceptWindow() : ASAccept.cpp
  • CreateAccessor() : sampclnt.cpp , sampclnt.h
  • CreateAndConnectCall() : tapisend.cpp
  • CreateAndSelectFileRecordTerminal() : CallNot.h , CallNot.cpp
  • CreateAndSelectMST() : Processing.cpp
  • CreateAndSelectTerminal() : tapisend.cpp
  • CreateAppSecurityDescriptor() : Util.h , Util.Cpp
  • CreateAppWindow() : GdiDemo.h , Init.c
  • CreateBlankNewFormatIcon() : Icons.C , Icons.h
  • CreateBounceWindow() : Bounce.h , Bounce.c
  • CreateBSTRfromString() : tapisend.cpp
  • CreateCall() : helpdll.Cpp
  • CreateCallParams() : TapiCode.c
  • CreateCaptureMediaStreamingTerminal() : tapisend.cpp
  • CreateCar() : ComObj.h , ComObj.Cpp
  • CreateCertificate() : CreateCert.c , CreateCert.h
  • CreateChildListBox() : MDIChild.C
  • CreateChildren() : MDIChild.C
  • CreateClass() : Sample.h , Utils.Cpp
  • CreateClientSocket() : TestAccept.cpp
  • CreateColorScalePalette() : AppUtil.Cpp , Dialog.c , AppUtil.h , GdiDemo.h , AppUtil.h
  • CreateContext() : RecoDll.cpp
  • CreateCruiseCar() : ComObj.h , ComObj.Cpp
  • CreateDacl() : RegisterServer.Cpp
  • CreateDefFileName() : common.cpp , common.h
  • CreateDescRecord() : quiktest.c
  • CreateDialogTemplate() : OpenDIB.c
  • CreateDIB() : Dibutil.c , Dibapi.h
  • CreateDIBPalette() : Dibapi.h , Dibutil.c
  • CreateDlgProc() : Dialogs.c , FontView.c
  • CreateDllList() : DebDebug.c
  • CreateDrawWindow() : Draw.h , Draw.c
  • CreateDummyEntry() : instlsp.cpp
  • CreateEditWindow() : ui.cpp
  • CreateEntry() : customentry.c
  • CreateFile() : CrmFilesTest.Idl
  • CreateFileContents() : Render.Cpp , Render.h
  • CreateFileGroupDescriptor() : Render.h , Render.Cpp
  • CreateGroup() : main.cpp
  • CreateHandlerItemPrefKey() : Reg.Cpp
  • CreateHandlerPrefKey() : Reg.Cpp , Reg.h
  • CreateICommand() : AdvQuery.Cxx
  • CreateIconWindow() : DebMisc.c , DebMisc.h
  • CreateImageLists() : Utility.Cpp , Utility.h
  • CreateImeMenu() : ImeMenu.c , IMEApps.h
  • CreateInst() : Utils.Cpp , Sample.h , Utils.Cpp , Sample.h
  • CreateInstance() : icf.h , TxEnlister.Idl , client.cxx
  • CreateItemList() : Enum.h , Enum.Cpp
  • CreateJob() : bits_ie.cpp
  • CreateLayeredEntries() : instlsp.cpp
  • CreateList() : LinkList.c , LinkList.h
  • CreateListeningSockets() : common.cpp , common.h
  • CreateListenSocket() : IocpServerex.Cpp , IocpServer.Cpp , IocpServer.h
  • CreateListView() : VListVw.c , VListVw.h , DragImg.Cpp
  • CreateMazeWindow() : Maze.c , Maze.h
  • CreateMDIClientWindow() : Init.c , GdiDemo.h
  • CreateMsgWindow() : ui.cpp
  • CreateMyDACL() : Simple.c , NmPipe.c , Server32.c
  • CreateNewListItem() : Enum.Cpp , Enum.h
  • CreateNewMDIChildWindow() : IconPRO.C
  • CreateNewSD() : SDMgmt.Cpp , DComPerm.h
  • CreateNode() : LinkList.c , LinkList.h
  • CreateNotificationWindow() : WSnmpUtil.Cpp , WSnmpUtil.h
  • CreateNullDacl() : RegisterServer.Cpp
  • CreateObject() : bankthrds.Cpp
  • CreateObjSecurityInfo() : Main.h , Privobji.Cpp
  • CreateOrder() : Driver.Cpp
  • CreateParamQuery() : quiktest.c
  • CreatePduSendRequest() : WSnmpUtil.h , WSnmpUtil.Cpp
  • CreatePolyWindow() : Poly.c , Poly.h
  • CreatePrivateClipboardData() : Utility.Cpp , Utility.h
  • CreateProc() : GdiDemo.c , GdiDemo.h
  • CreateProcessList() : DebDebug.c
  • CreatePropertySetInStorage() : stgcreatepropsetstg.cpp
  • CreatePropSheet() : global.c
  • CreateQueList() : quelist.c , quelist.h
  • CreateQueryTree() : AdvQuery.Cxx
  • CreateQueue() : MqTrans.Cpp
  • CreateReadWriteLock() : sync.h , sync.c
  • CreateRecognizer() : RecoDll.cpp
  • CreateRegistryKey() : customentry.c
  • CreateRegKey() : common.h , common.cpp
  • CreateRemote() : RemClien.Cpp
  • CreateRenderMediaStreamingTerminal() : Processing.cpp
  • CreateResourcePath() : people.Cpp , globals.h
  • CreateRows() : bankdlg.Cpp , bankthrds.Cpp
  • CreateRowsThread() : bankthrds.Cpp , bankdlg.Cpp
  • CreateSBar() : STATBAR.c , STATBAR.h
  • CreateScaledFont() : MidiPlyr.h , UIUTILS.c
  • CreateSchema() : bankdlg.Cpp , bankthrds.Cpp
  • CreateSchemaThread() : bankthrds.Cpp , bankdlg.Cpp
  • CreateShellIDList() : Utility.Cpp , Utility.h
  • CreateSocket() : IocpServerex.Cpp
  • CreateSockInfo() : provider.h , sockinfo.cpp
  • CreateStandardPalette() : app.Cpp
  • CreateStartupLink() : bits_ie.cpp
  • CreateStatus() : IMEApps.h , Status.c
  • CreateStatusBar() : FontView.c , Status.c
  • CreateStreams() : ips.h
  • CreateTBar() : ToolBar.h , ToolBar.c , IMEApps.h
  • CreateTestEntry() : customdialreg.cpp
  • CreateTextButtonBar() : DebMisc.h , DebMisc.c
  • CreateTextWindow() : TextWnd.Cpp , Global.h
  • CreateThreadList() : DebDebug.c
  • CreateThreadSyncResources() : threads.h , threads.c
  • CreateToolBar() : Tools.c , FontView.c
  • CreateTools() : sdkdiff.cpp
  • CreateUI() : bits_ie.cpp
  • CreateUser() : RendSam.Cpp , main.cpp
  • CreateUserAccount() : Create.Cpp
  • CreateUserFromFile() : main.cpp
  • CreateUserIADsContainer() : Create.cpp
  • CreateUserIDirectoryObject() : Create.cpp
  • CreateUserList() : ui.cpp
  • CreateUtilityCar() : ComObj.h , ComObj.Cpp
  • CreateUtilityCruiseCar() : UTCRUCAR.Cpp
  • CreateVbl() : WSnmpUtil.Cpp , WSnmpUtil.h
  • CreateVirtualBuffer() : AsyncIO.h , AsyncIO.c
  • CreateWellKnownSids() : Service.h , Service.cpp , service.h , service.cpp
  • CreateWiaDevice() : wiassamp.cpp
  • CreateWiaDeviceAndDoSomeStuff() : wiassamp.cpp
  • CreateWiaDeviceManager() : wiassamp.cpp
  • CreateWorkingThreads() : MQPort.Cpp
  • CreateWorkQueue() : AsyncIO.h , AsyncIO.c
  • CreateWorldSid() : SecFile.c
  • CreateXFormWindow() : XForm.c , XForm.h
  • CryptPropCert() : PropCert.Cpp
  • CSCONST() : stdpal.h
  • CteBeginWrite() : cte_enc.c , ctetest.h
  • CteEndWrite() : cte_enc.c , ctetest.h
  • CteWrite() : cte_enc.c , ctetest.h
  • ctree_create() : tree.cpp , tree.h
  • ctree_delete() : tree.h , tree.cpp
  • ctree_find() : tree.h , tree.cpp
  • ctree_getcount() : tree.cpp , tree.h
  • ctree_update() : tree.h , tree.cpp
  • CtrlCHandler() : Bcast.c
  • CtrlHandler() : dhcpnotify.cpp , rnrcs.cpp , IocpServer.Cpp , tapirecv.cpp , tapisend.cpp , IocpServerex.Cpp , IocpServer.h
  • CtrlPanelDlgProc() : MfEdit.h , MfEdit.c
  • CtxtAllocate() : IocpServer.h , IocpServerex.Cpp , IocpServer.Cpp
  • CtxtListAddTo() : IocpServerex.Cpp , IocpServer.Cpp , IocpServer.h
  • CtxtListDeleteFrom() : IocpServer.Cpp , IocpServerex.Cpp , IocpServer.h
  • CtxtListFree() : IocpServer.Cpp , IocpServer.h , IocpServerex.Cpp
  • CustomControlInfo() : SpinCube.c
  • CustomDialDlgProc() : customdial.cpp
  • CustomEntryDlgProc() : customdial.cpp
  • CustomerId() : QCNotify.Idl , QCOrder.Idl , QCShip2.Idl , QCShip.Idl , QCNotify.Idl
  • cvt() : Utils.Cpp , UtilLib.h
  • CvtCHARtoODBC() : quiktest.h
  • cwCenter() : WinCap.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- d -

  • DAdvise() : ido.h
  • DATA_HANDLE_TYPE_bind() : Usrdefc.c
  • DATA_HANDLE_TYPE_unbind() : Usrdefc.c
  • DataConvert() : common.cpp , common.h
  • DataToHex() : Global.h , Util.Cpp
  • DateStamp() : wn_dos.h
  • DBCScharType() : utils.cpp
  • DbgMsgCloseLog() : DbgMsg.cpp , DbgMsg.h , dbgmsg.cpp , dbgmsg.h
  • DbgMsgOpenLog() : dbgmsg.cpp , dbgmsg.h , DbgMsg.cpp , DbgMsg.h
  • DbgMsgRecord() : DbgMsg.cpp , DbgMsg.h , dbgmsg.cpp , dbgmsg.h
  • DbgPrint() : Admapit.c , AdminDll.c
  • dbgprint() : provider.h , spi.cpp
  • DBIDCopy() : common.cpp , common.h
  • DBIDEqual() : common.cpp , common.h
  • DBIDFree() : common.cpp , common.h
  • DBIDToString() : common.cpp , common.h
  • DBLOGGER() : Utils.cpp , Utils.h , Utils.cpp , Utils.h
  • DComOk() : AppUtil.Cpp , AppUtil.h
  • DDBChangeColor() : bitmaps.Cxx , bitmaps.h
  • DDV_RequiredText() : DDxDDv.cpp , DDxDDv.h , DDxDDv.cpp , DDxDDv.h
  • DDX_Number() : DDxDDv.cpp , DDxDDv.h , DDxDDv.cpp , DDxDDv.h
  • DeactivateAndUndo() : ioips.h
  • DeAlloc() : Disp1.Idl
  • Debug_Print_Connection0() : Admapit.c
  • Debug_Print_Connection1() : Admapit.c
  • Debug_Print_RAS_PORT0() : Admapit.c
  • Debug_Print_RAS_PORT1() : Admapit.c
  • Debug_Print_RasConnection() : AdminDll.c
  • Debug_Print_RasPort() : AdminDll.c
  • DebugEventThread() : DebDebug.c , DebDebug.h
  • DebugHr() : Global.h , Debug.Cpp
  • DebugLog() : adoisapi.cpp
  • DebugMsg() : setup.h , utils.cpp , Debug.Cpp , Global.h , Globals.h , Main.c
  • DebugNewProcess() : DebDebug.c
  • DebugPrint() : FaxSiren.Cpp , Mount.Cpp
  • DebugTextOut() : InstCodc.Cpp
  • DebugTrace() : debug.h
  • DECLARE_DEBUG() : Global.Hxx
  • DECLARE_HANDLE() : SMF.h
  • DECLARE_INTERFACE_() : IBALL.h , ICARS.h , IPageS.h , IPAPER.h , mmcsample.h
  • DecodeAndDecryptCredentials() : CustomAuth.cpp
  • DecodeIGMPHeader() : parser.h
  • DecodeIPHeader() : parser.c , parser.h
  • DecodeTCPHeader() : parser.h
  • DecodeUDPHeader() : parser.h
  • DecoupleSlot() : hashtbl.cpp , hashtbl.h
  • DecrementLockCount() : cHello.Cxx , Server.Cxx
  • DecrementRefCount() : Server.Cxx
  • DecryptThis() : Security.cpp , Security.h
  • DefaultUser() : Main.h , Security.Cpp
  • DEFINE_DAOGUID() : adoid.h
  • DEFINE_GUID() : guids.h , MainDll.Cpp , EvProv.h , Server.Cpp , MainDll.Cpp , Guids.h , MyCapabilities.h , MyEvictListener.h , MyMemberSetChangeListener.h , MyStartupListener.h , DoServer.Cpp , guids.h , DoServer.h , guids.h , Cancel.Cpp , guids.h , Cancel.Cpp , guids.h , Cancel.Cpp , guids.h , SServer.Cpp , guids.h , SServer.Cpp , guids.h , SServer.Cpp , guids.h , SServer.Cpp , guids.h , SServer.Cpp , guids.h , ComPerf.Cpp , guids.h , Client.Cpp , guids.h , OleImp.Cpp , guids.h , sclient.cpp , guids.h , sserver.cpp , guids.h , OleApt.Cpp , guids.h , app.Cpp , guids.h , ips.Cpp , guids.h , BALLGUID.h , guids.h , BALLGUID.h , guids.h , BALLGUID.h , guids.h , BALLGUID.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , CARGUIDS.h , guids.h , Guid.h , CARGUIDS.h , Guid.h , CARGUIDS.h , Guid.h , DropExt.h , CARGUIDS.h , FVText.h , CARGUIDS.h , Guid.h , ShellExt.h , CARGUIDS.h , IcnOvrly.h , CARGUIDS.h , PageGUID.h , PAPGUIDS.h , sampclnt.h , guids.h , ADEvent.cpp , bthcxn.cpp , Guid.h , Atsp.h , guids.h , plgtermpriv.h , guids.h , mmcsample.h , guids.h , Guids.h , guids.h
  • DeinitAppInstance() : InstCodc.Cpp
  • DeInitializeDynamicLocksStore() : sync.c , sync.h
  • DeinstallProvider() : instlsp.cpp
  • DelayBox() : AppUtil.Cpp
  • DeleteACEsAsAppropriate() : SidClean.c
  • DeleteCommand() : data.Idl
  • DeleteConference() : RendSam.Cpp
  • DeleteContext() : Stubs.c
  • DeleteCredential() : Stubs.c
  • DeleteCurrentDllNode() : DebDebug.c
  • DeleteCurrentNode() : LinkList.c , LinkList.h
  • DeleteCurrentProcessNode() : DebDebug.c
  • DeleteCurrentThreadNode() : DebDebug.c
  • DeleteDirectory() : Utility.Cpp , Utility.h
  • DeleteDllNode() : DebDebug.c
  • DeleteEntireKey() : ADEvent.cpp , SampView.Cpp , IcnOvrly.Cpp , IcnOvrly.h
  • DeleteEntry() : Collect.cpp , Collect.h
  • DeleteFile() : CrmFilesTest.Idl , icrmFiles.Idl
  • DeleteFileTx() : TxFileDisp.Idl
  • DeleteInterface() : rmapi.c
  • DeleteItemFromList() : Enum.Cpp , Enum.h
  • DeleteJob() : sa.Cpp
  • DeleteProcessNode() : DebDebug.c
  • DeleteReadWriteLock() : sync.c , sync.h
  • DeleteSecurityContext() : Stubs.c
  • DeleteSockInfoFromList() : common.h , SockInfo.cpp
  • DeleteStartupLink() : bits_ie.cpp
  • DeleteStoredProcedure() : data.Idl
  • DeleteThreadNode() : DebDebug.c
  • DeleteTools() : sdkdiff.cpp
  • DeleteUser() : RendSam.Cpp , Commands.Cpp , Commands.h
  • DeleteWellKnownSids() : Service.cpp , Service.h , service.cpp , service.h
  • DelRegEntry() : common.cpp , common.h , common.cpp , common.h
  • DemoInit() : Demo.c , Demo.h
  • DemoWndProc() : Demo.c , Demo.h
  • DequeueEvent() : configentry.c , configentry.h
  • DequeueOverlappedOperation() : overlap.cpp
  • DescBindCol() : quiktest.c
  • DescBindParameter() : quiktest.c
  • Description() : CrmMonComp.Idl
  • DescriptionDocToBSTR() : RegDevice.cpp
  • DestroyAlternate() : RecoDll.cpp
  • DestroyContext() : RecoDll.cpp
  • DestroyDIB() : Dibapi.h , File.c
  • DestroyDllList() : DebDebug.c
  • DestroyDllNode() : DebDebug.c
  • DestroyImageLists() : Utility.Cpp , Utility.h
  • DestroyKeyValues() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • DestroyList() : LinkList.c , LinkList.h
  • DestroyListeningSockets() : common.cpp , common.h
  • DestroyNode() : LinkList.c , LinkList.h
  • DestroyNotificationWindow() : WSnmpUtil.Cpp , WSnmpUtil.h
  • DestroyProc() : GdiDemo.c , GdiDemo.h
  • DestroyProcessList() : DebDebug.c
  • DestroyProcessNode() : DebDebug.c
  • DestroyRecognizer() : RecoDll.cpp
  • DestroyStatusBar() : Status.c
  • DestroyStringBuffer() : MultiWnd.C
  • DestroyThreadList() : DebDebug.c
  • DestroyThreadNode() : DebDebug.c
  • DestroyThreadSyncResources() : threads.c , threads.h
  • DestroyToolBar() : Tools.c
  • DestroyWorkQueue() : AsyncIO.c , AsyncIO.h
  • DetectDsConnection() : MQPort.Cpp , MqTestOA.Cpp , MSMQTest.c
  • DetermineAdapter() : dhcpnotify.cpp , dhcppersist.cpp , dhcprequest.cpp
  • DetermineObjectType() : cbase.cpp , cbase.h
  • DetermineVersion() : Main.c
  • DevCapsXDlgProc() : Common.h
  • DeviceReceiveThread() : NewFsp.c
  • DevmodeProc() : Print.c , Print.h
  • DevnamesProc() : Print.c , Print.h
  • DialCall() : TapiCode.c , TapiCode.h
  • DialCallInParts() : TapiCode.c
  • DialDialogProc() : TapiCode.c
  • DialerAlloc() : Dialer.c
  • DialerCleanup() : Dialer.c
  • DialerFree() : Dialer.c
  • DialerLineClose() : Dialer.c
  • DialingProc() : Dialer.c
  • DialogProc() : AppUtil.Cpp , AppUtil.h , cDialog.Cxx , cDialog.h , bits_ie.cpp , compart.cpp
  • DIBColorTableSize() : DIBSectn.c
  • DIBError() : Dibapi.h , Errors.c
  • DIBHeight() : Dibapi.h , Dibutil.c
  • DIBNumColors() : DIBSectn.c , Dibapi.h , Dibutil.c , Dib.c , Dib.h
  • DIBToBitmap() : Dibapi.h , Dibutil.c
  • DIBToIconImage() : Icons.C
  • DIBWidth() : Dibapi.h , Dibutil.c
  • DiffFileTimeInMilliseconds() : IsapiTime.h , IsapiTime.cpp
  • DiffFileTimeInSeconds() : IsapiTime.h , IsapiTime.cpp
  • difftime() : UtilLib.h , Utils.Cpp
  • dir_adddirect() : scandir.cpp
  • dir_addfile() : scandir.cpp
  • dir_appendlist() : scandir.cpp , scandir.h
  • dir_buildlist() : scandir.cpp , scandir.h
  • dir_cleardirect() : scandir.cpp
  • dir_closefile() : scandir.cpp , scandir.h
  • dir_compsequencenumber() : scandir.cpp , scandir.h
  • dir_compwildcard() : scandir.cpp , scandir.h
  • dir_copy() : scandir.cpp , scandir.h
  • dir_delete() : scandir.cpp , scandir.h
  • dir_dirinit() : scandir.cpp
  • dir_endcopy() : scandir.cpp , scandir.h
  • dir_extractwildportions() : scandir.cpp
  • dir_fileerror() : scandir.cpp , scandir.h
  • dir_fileinit() : scandir.cpp
  • dir_finalelem() : scandir.cpp
  • dir_findnextfile() : scandir.cpp
  • dir_firstitem() : scandir.cpp , scandir.h
  • dir_freeopenname() : scandir.cpp , scandir.h
  • dir_freerelname() : scandir.cpp , scandir.h
  • dir_freerootdescription() : scandir.cpp , scandir.h
  • dir_freerootpath() : scandir.cpp , scandir.h
  • dir_getattr() : scandir.cpp , scandir.h
  • dir_getchecksum() : scandir.cpp , scandir.h
  • dir_getfilesize() : scandir.cpp , scandir.h
  • dir_GetFileTime() : scandir.cpp , scandir.h
  • dir_getlist() : scandir.cpp , scandir.h
  • dir_getopenname() : scandir.cpp , scandir.h
  • dir_getpathsizeetc() : scandir.cpp
  • dir_getrelname() : scandir.cpp , scandir.h
  • dir_getrootdescription() : scandir.cpp , scandir.h
  • dir_getrootpath() : scandir.cpp , scandir.h
  • dir_isfile() : scandir.cpp , scandir.h
  • dir_isvaliddir() : scandir.cpp , scandir.h
  • dir_isvalidfile() : scandir.cpp
  • dir_iswildcard() : scandir.cpp , scandir.h
  • dir_MakeValidPath() : scandir.cpp , scandir.h
  • dir_nextitem() : scandir.cpp , scandir.h
  • dir_openfile() : scandir.cpp , scandir.h
  • dir_rescanfile() : scandir.cpp , scandir.h
  • dir_scan() : scandir.cpp
  • dir_setdescription() : scandir.cpp , scandir.h
  • dir_setotherdirlist() : scandir.cpp , scandir.h
  • dir_startcopy() : scandir.cpp , scandir.h
  • dir_validchecksum() : scandir.cpp , scandir.h
  • DirectSender() : MqTestOA.Cpp , MSMQTest.c
  • DisableButton() : Callnot.Cpp , Incoming.Cpp , Outgoing.Cpp
  • DisableDialButtons() : Dialer.c
  • DiscardUndoState() : ioips.h
  • Disconnect() : TxFileDisp.Idl , CopyFileRm.Idl
  • DisconnectAndReleaseCall() : tapirecv.cpp
  • DisconnectTheCall() : FileTerm.cpp , FileTerm.h , Incoming.Cpp , Outgoing.Cpp
  • DiskPerfDetails() : DpDetail.Cpp , WMIDiskPerf.Cpp
  • DismountVolume() : Mfmt.c
  • DispatchChild() : Sockdups.c
  • DispatchDebugEventThread() : DebugHandler.Cpp
  • DispCommand() : DISPATCH.c , GLOBALS.h , Dispatch.c , Globals.h
  • DispDefault() : DISPATCH.c , Dispatch.c
  • display_ctx_flags() : GssMisc.c
  • display_help() : BPSamp.h , DbgCmd.c
  • display_status() : GssMisc.c
  • display_status_1() : GssMisc.c
  • display_thread_registers() : BPSamp.h , Utils.c
  • DisplayAccess() : ListAcl.Cpp
  • DisplayAccessorErrors() : error.cpp , error.h
  • DisplayAllErrors() : quiktest.c , error.cpp , error.h , error.cpp , error.h
  • DisplayAPIError() : common.c , common.h
  • DisplayAudit() : Audit.c
  • DisplayAuditEventOption() : Audit.c
  • DisplayBindingErrors() : error.cpp , error.h
  • DisplayBitmapInWindow() : OpenDIB.c
  • DisplayCallerAccessTokenInformation() : MyToken.cpp
  • DisplayCandStrings() : CANDUI.C , FullIME.h
  • DisplayChatMsg() : cData.Cpp , cData.h
  • DisplayColAccessErrors() : error.cpp , error.h
  • DisplayColumnErrors() : error.cpp , error.h
  • DisplayCommandTree() : AdvQuery.Cxx , DispTree.Cxx , QSample.Cxx
  • DisplayCompString() : FullIME.h , ImeUI.C
  • DisplayContextMenu() : cdialoglite.cpp , cdialoglite.h
  • DisplayDeviceCapsInfo() : Getcaps.c , Getcaps.h
  • DisplayDialog() : cdialoglite.cpp , cdialoglite.h
  • DisplayDialogBox() : Dialog.c , GdiDemo.h
  • DisplayDlg() : Global.h
  • DisplayDollars() : MqTrans.Cpp
  • DisplayEnumPrintersInfo() : Enumprt.c , Enumprt.h
  • DisplayError() : Check_SD.h , Helper.c , MachAcct.c , QSample.Cxx , SysInf_C.c , SysInfo.h , SysInf_S.c
  • DisplayErrorInfo() : error.cpp , error.h
  • DisplayErrorMessage() : util.cpp , util.h
  • DisplayErrorRecords() : error.cpp , error.h
  • DisplayErrorText() : ChngPass.c
  • DisplayFileToDialog() : OpenDIB.c
  • DisplayGroupsInfo() : MyToken.cpp
  • DisplayHelp() : SidClean.c , msistuff.cpp , sa.Cpp , FTPJr.cpp
  • DisplayHRESULT() : error.cpp , error.h
  • DisplayInstallResource() : msistuff.cpp
  • DisplayKeyData() : Monkey.c , Monkey.h
  • DisplayLastError() : AclApi.c , Server.c
  • DisplayMessage() : cData.Cpp , Global.h
  • DisplayMsg() : cData.Cpp , Global.h , Util.Cpp
  • DisplayNtStatus() : Audit.c , LsaPrivs.c
  • DisplayOptions() : security.cpp
  • DisplayOwnerInfo() : MyToken.cpp
  • DisplayPhoneNumber() : TapiCode.c
  • DisplayPrimaryGroupInfo() : MyToken.cpp
  • DisplayPrinterDriverInfo() : Getpdriv.c , Getpdriv.h
  • DisplayPrinterDriversInfo() : Enumprt.c , Enumprt.h
  • DisplayPrivileges() : MyToken.cpp
  • DisplayPropErrors() : error.cpp , error.h
  • DisplayProperty() : propdump.cpp
  • DisplayPropertySet() : propdump.cpp
  • DisplayPropertySetsInStorage() : propdump.cpp
  • DisplayRefCountErrors() : error.cpp , error.h
  • DisplayResources() : msistuff.cpp
  • DisplayResults() : odbcsql.c
  • DisplayResultString() : FullIME.h , ImeUI.C
  • DisplayRowErrors() : error.cpp , error.h
  • DisplayRowsetStatus() : QSample.Cxx
  • DisplaySource() : MyToken.cpp
  • DisplayStat() : QSample.Cxx
  • DisplayStatistics() : MyToken.cpp
  • DisplayStatus() : Global.h , QSample.Cxx
  • DisplayStorageTree() : propdump.cpp
  • DisplaySysMsg() : cData.Cpp , Global.h
  • DisplayTestName() : quiktest.c
  • DisplayTitles() : odbcsql.c
  • DisplayTokenInformation() : MyToken.cpp
  • DisplayUnionValue() : DUnionc.c
  • DisplayUpToDate() : QSample.Cxx
  • DisplayUsage() : Check_SD.c , setup.h , utils.cpp
  • DisplayUserInfo() : MyToken.cpp
  • DisplayValue() : QSample.Cxx
  • DisplayVariant() : DispTree.Cxx
  • DisplayWin32Error() : QSample.Cxx
  • DisplayWinError() : error.cpp , error.h , Audit.c , Client.c , TextSid.c , LsaPrivs.c
  • DispMessage() : DISPATCH.c , GLOBALS.h , Dispatch.c , Globals.h
  • dispsymtag() : dbh.cpp
  • Dlg_Proc1() : PhoneEntry.c
  • Dlg_Proc2() : PhoneEntry.c
  • DlgAudio() : Dlg.Cpp , Global.h
  • DlgCallConf() : Dlg.Cpp , Global.h
  • DlgDisplayInstalledCodecs() : InstCodc.Cpp
  • DlgEject() : Dlg.Cpp , Global.h
  • DlgEnumFontNames() : Dialogs.c
  • DlgEnumFontSizes() : Dialogs.c
  • DlgExit() : Global.h
  • DlgLaunch() : Dlg.Cpp , Global.h
  • DlgLogOnOff() : Dlg.Cpp , Global.h
  • DlgNewCall() : Dlg.Cpp , Global.h
  • DlgNewConference() : Dlg.Cpp , Global.h
  • DlgOptions() : Dlg.Cpp , Global.h
  • dlgproc() : childview.cpp
  • DlgProc() : PlgBlt.c , PlgBlt.h , Main.Cpp , Main.h , TPCInfo.cpp , About.Cpp , SpinTest.c , SpinTest.h , CustomDrawButtonDlg.cpp
  • DlgProcIADsOpenDSObject() : ADQIDlg.h , ADsOpenDSObject.cpp
  • DlgSendFile() : Dlg.Cpp , Global.h
  • DlgShare() : Dlg.Cpp , Global.h
  • DlgShowLocal() : Dlg.Cpp , Global.h
  • DllAddRef() : globals.h , server.cpp , globals.h , server.cpp
  • DllCanUnloadNow() : ComSpyAudit.Cpp , ComSpyCtl.Cpp , Dog.Cpp , SServer.Cpp , PingResp.Cpp , ConServe.Cpp , DllServe.Cpp , FreServe.Cpp , LicServe.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , StoServe.Cpp , BYOTTransaction.Cpp , TxEnlister.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , STAObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , cascadeec.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , Account.Cpp , LogWriter.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip2.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , ADOKB.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , theprovider.cpp , classfac.cpp , myclassfactory.cpp , msdfmap.cpp , Authenticate.cpp , dbauth.cpp , proxyplugin.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , SCPCMenu.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , ADsError.cpp , GraphObj.Cpp , Exports.Cpp , DllMain.Cpp , DllMain.h , SampMsp.Cpp , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , certpsam.cpp , CertPSam.Cpp , basesnap.Cpp , basesnap.h , atlcontrol.Cpp , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , BaseSnap.Cpp , BaseSnap.h , basesnap.Cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , MainDll.Cpp , OleSrvr.Cpp , MainDll.Cpp , Server.Cpp , MainDll.Cpp , BrochureMachine.cpp , EDAnnotator.cpp , Render.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , ClRes.cpp , ClipBook ServerEx.cpp , File Share SampleEx.cpp , Dll.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , HtmlProp.Cxx , HtmlProp.Hxx , HtmlIFlt.Cxx , HtmlIFlt.Hxx , lrsample.CXX , lrsample.HXX , SmpFilt.Cxx , BandObjs.Cpp , ShortName.Cpp , Cleanup.Cpp , DropExt.C , FileView.Cpp , FileView.h , SampView.Cpp , ShellExt.Cpp , IcnOvrly.Cpp , server.cpp
  • DllEntry() : FaxSiren.Cpp
  • DllEntryPoint() : NewFsp.c
  • DllGetClassObject() : Dog.Cpp , SServer.Cpp , PingResp.Cpp , ConServe.Cpp , DllServe.Cpp , FreServe.Cpp , LicServe.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , StoServe.Cpp , BYOTTransaction.Cpp , TxEnlister.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , STAObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , cascadeec.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , Account.Cpp , LogWriter.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip2.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , ADOKB.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , theprovider.cpp , classfac.cpp , myclassfactory.cpp , msdfmap.cpp , Authenticate.cpp , dbauth.cpp , proxyplugin.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , SCPCMenu.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , ADsError.cpp , GraphObj.Cpp , Exports.Cpp , DllMain.Cpp , DllMain.h , SampMsp.Cpp , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , certpsam.cpp , CertPSam.Cpp , basesnap.Cpp , basesnap.h , atlcontrol.Cpp , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , BaseSnap.Cpp , BaseSnap.h , basesnap.Cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , basesnap.Cpp , basesnap.h , MainDll.Cpp , OleSrvr.Cpp , MainDll.Cpp , Server.Cpp , MainDll.Cpp , BrochureMachine.cpp , EDAnnotator.cpp , Render.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , ClRes.cpp , ClipBook ServerEx.cpp , File Share SampleEx.cpp , Dll.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , HtmlProp.Cxx , HtmlProp.Hxx , HtmlIFlt.Cxx , HtmlIFlt.Hxx , lrsample.CXX , lrsample.HXX , SmpFilt.Cxx , BandObjs.Cpp , ShortName.Cpp , Cleanup.Cpp , DropExt.C , FileView.Cpp , FileView.h , SampView.Cpp , ShellExt.Cpp , IcnOvrly.Cpp , server.cpp , ComSpyAudit.Cpp , ComSpyCtl.Cpp
  • DllInit() : Init.c
  • DllMain() : Cleanup.Cpp , CrmMonComp.Cpp , SpinCube.c , SmpFilt.Cxx , Dll.cpp , STAObject.Cpp , Simple.cpp , ftrans.c , EDAnnotator.cpp , MainDll.Cpp , basesnap.Cpp , basesnap.cpp , PerDraw.Cpp , basesnap.cpp , basesnap.Cpp , DllSkel.Cpp , MyDevice.cpp , Atsp.c , Exports.Cpp , PingResp.Cpp , GraphObj.Cpp , SDKSamplePlaylistPlugin.cpp , proxyplugin.cpp , data.Cpp , ADOKB.Cpp , QCShip2.Cpp
  • DLLMAIN() : rqsmsg.cpp
  • DllMain() : Select.c , ComSpyAudit.Cpp , ComSpyCtl.Cpp , helpdll.Cpp , Dog.Cpp , SServer.Cpp , ComObj.Cpp , ConServe.Cpp , DllServe.Cpp , FreServe.Cpp , LicServe.Cpp , Marshal2.Cpp , PerServe.Cpp , PerText.Cpp , StoServe.Cpp , BYOTTransaction.Cpp , TxEnlister.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , cascadeec.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.Cpp , LogWriter.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip.Cpp , QCNotify.Cpp , QCOrder.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , theprovider.cpp , classfac.cpp , myclassfactory.cpp , msdfmap.cpp , Dllinit.c , Authenticate.cpp , dbauth.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , ADEvent.cpp , ADsError.cpp , dllmain.c , blrplate.cpp , blrplate.h , blrplate.c , cmsample.cpp , customdial.cpp , RasHost.Cpp , AdminDll.c , ipsample.c , TestDll.C , DllMain.Cpp , SampMsp.Cpp , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , Dt_Dll.Cpp , spi.cpp , CertEnc.Cpp , certxsam.cpp , CertXSam.Cpp , certpsam.cpp , CertPSam.Cpp , LogonNP.c , atlcontrol.Cpp , basesnap.Cpp , BaseSnap.Cpp , basesnap.Cpp , basesnap.cpp , basesnap.Cpp , OleSrvr.Cpp , Server.Cpp , RecoDll.cpp , BrochureMachine.cpp , Render.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , ctetest.c , InvokObjThreads.cpp , areadcli.c , fwasync.c , fwrite.c , KeepAliveP.c , AuthFilt.c , ClRes.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , ToolBar.c , Main.Cxx , lrsample.CXX , dllmain.cpp , DllInit.c , SysInf_C.c , gres409.c , BandObjs.Cpp , ShortName.Cpp , FileView.Cpp , SampView.Cpp , ShellExt.Cpp , IcnOvrly.Cpp , dllmain.cpp , Account.cpp
  • DllOrderFunction() : DebDebug.c
  • DllRegisterCluAdminExtension() : ClipBook ServerEx.cpp , File Share SampleEx.cpp
  • DllRegisterServer() : Account.Cpp , cascadeec.Cpp , TxEnlister.Cpp , PerText.h , PerDraw.h , DllServe.Cpp , Dog.Cpp , ComSpyAudit.Cpp , ComSpyCtl.Cpp , PingResp.Cpp , ConServe.Cpp , ConServe.h , DllServe.h , FreServe.Cpp , FreServe.h , LicServe.Cpp , LicServe.h , Marshal2.Cpp , PerDraw.Cpp , PerServe.Cpp , PerServe.h , PerText.Cpp , StoServe.Cpp , StoServe.h , BYOTTransaction.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , STAObject.Cpp , CrmDebug.Cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , newseventclass.Cpp , persistatl.Cpp , Account.cpp , LogWriter.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCNotify.Cpp , QCOrder.Cpp , QCShip2.Cpp , Disp1.Cpp , VCSecuritySample.Cpp , TServer.Cpp , ADOKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , classfac.cpp , myclassfactory.cpp , msdfmap.cpp , dbauth.cpp , proxyplugin.cpp , sdksamplestorageplugin.cpp , ContextDll.cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , ADsFirstExt.cpp , ADsError.cpp , FaxSiren.Cpp , dllmain.c , GraphObj.Cpp , customdialreg.cpp , Exports.Cpp , DllMain.Cpp , DllMain.h , pluggable.cpp , DeviceDll.cpp , MyDevice.cpp , CertEnc.Cpp , certxsam.cpp , certpsam.cpp , CertPSam.Cpp , basesnap.Cpp , atlcontrol.Cpp , basesnap.Cpp , BaseSnap.Cpp , basesnap.cpp , basesnap.Cpp , MainDll.Cpp , OleSrvr.Cpp , MainDll.Cpp , Server.Cpp , MainDll.Cpp , RecoDll.cpp , BrochureMachine.cpp , EDAnnotator.cpp , Catlpwr.Cpp , BankVC.cpp , CatlSmpl.Cpp , ClipBook ServerEx.cpp , File Share SampleEx.cpp , Dll.cpp , dll.cpp , Dll.cpp , MyStorageResource.cpp , BandObjs.Cpp , RegisterServer.Cpp , IcnOvrly.Cpp , server.cpp , basesnap.cpp , SampView.Cpp , lrsample.CXX , ClRes.cpp , Render.cpp , MainDll.Cpp , basesnap.Cpp , QCShip.Cpp , basesnap.Cpp , CertXSam.Cpp , MyDevice.cpp , SampMsp.Cpp , NewFsp.c , userwizard.cpp , SCPCMenu.cpp , Authenticate.cpp , theprovider.cpp , OLEDBKB.Cpp
  • DllRelease() : server.cpp , globals.h , server.cpp , globals.h
  • DllUnregisterCluAdminExtension() : ClipBook ServerEx.cpp , File Share SampleEx.cpp
  • DllUnregisterServer() : dll.cpp , Dll.cpp , server.cpp , ComSpyAudit.Cpp , ComSpyCtl.Cpp , UnRegisterServer.Cpp , PingResp.Cpp , ConServe.Cpp , ConServe.h , DllServe.h , FreServe.Cpp , FreServe.h , DllMain.Cpp , LicServe.h , Marshal2.Cpp , PerDraw.Cpp , PerDraw.h , PerServe.Cpp , PerServe.h , PerText.Cpp , File Share SampleEx.cpp , StoServe.Cpp , StoServe.h , BYOTTransaction.Cpp , ComSyncObject.Cpp , FreeObject.Cpp , STAObject.Cpp , BankVC.cpp , CrmFiles.Cpp , CrmFilesTest.Cpp , CrmMonComp.Cpp , newseventclass.Cpp , persistatl.Cpp , ClRes.cpp , BrochureMachine.cpp , Catlpwr.Cpp , LogWriter.Cpp , QCOrder.Cpp , QCNotify.Cpp , QCOrder.Cpp , Render.cpp , MainDll.Cpp , VCSecuritySample.Cpp , TServer.Cpp , ADOKB.Cpp , OLEDBKB.Cpp , RDOKB.Cpp , account.Cpp , data.Cpp , MainDll.Cpp , Server.Cpp , classfac.cpp , msdfmap.cpp , dbauth.cpp , proxyplugin.cpp , MainDll.Cpp , basesnap.Cpp , ContextSamplePropPage.cpp , SDKSamplePlaylistPlugin.cpp , ADEvent.cpp , SCPProppage.cpp , SCPWizard.cpp , basesnap.Cpp , ADsFirstExt.cpp , ADsError.cpp , server.cpp , GraphObj.Cpp , customdialreg.cpp , basesnap.Cpp , basesnap.cpp , DllMain.h , SampMsp.Cpp , pluggable.cpp , CertXSam.Cpp , DeviceDll.cpp , RecoDll.cpp , MyDevice.cpp , basesnap.Cpp , basesnap.cpp , certxsam.cpp , certpsam.cpp , basesnap.Cpp , basesnap.cpp , atlcontrol.Cpp , basesnap.cpp , basesnap.Cpp , BaseSnap.Cpp , basesnap.Cpp , basesnap.cpp , basesnap.Cpp , CertPSam.Cpp , basesnap.Cpp , OleSrvr.Cpp , CertEnc.Cpp , MainDll.Cpp , EDAnnotator.cpp , CatlSmpl.Cpp , ClipBook ServerEx.cpp , Dll.cpp , LicServe.Cpp , MyStorageResource.cpp , lrsample.CXX , UnRegisterServer.Cpp , SampView.Cpp , IcnOvrly.Cpp , dllmain.c , Exports.Cpp , userwizard.cpp , SCPCMenu.cpp , userproppage.cpp , ContextDll.cpp , Authenticate.cpp , sdksamplestorageplugin.cpp , theprovider.cpp , myclassfactory.cpp , Disp1.Cpp , QCShip.Cpp , QCShip2.Cpp , Account.Cpp , QCNotify.Cpp , cascadeec.Cpp , Account.cpp , CrmDebug.Cpp , TxEnlister.Cpp , PerText.h , DllServe.Cpp , Dog.Cpp
  • do_debug_command() : BPSamp.h , DbgCmd.c
  • do_editfile() : sdkdiff.cpp
  • do_editthread() : sdkdiff.cpp
  • do_getdata() : sdkdiff.cpp
  • do_gethdr() : sdkdiff.cpp
  • do_getprops() : sdkdiff.cpp
  • DoActivateDataChannel() : cData.Cpp , cData.h
  • DoAllDirsInOneDir() : SidClean.c
  • DoAsyncReadClient() : areadcli.c
  • DoAuthentication() : Client.cpp , Server.cpp
  • DoCacheable() : CacheIsapi.cpp
  • DoCallConference() : CCall.h , CCall.Cpp
  • DoCallCreate() : CCall.Cpp , CCall.h
  • DoCallMedia() : CallNot.h , CallNot.cpp
  • DoCallNotification() : CallNot.cpp , CallNot.h
  • DoCallState() : CallNot.h , CallNot.cpp
  • DoCancel() : bits_ie.cpp
  • DoCancelCall() : CCall.h , CCall.Cpp
  • DoCapture() : WinCap.c , WinCap.h
  • DoChangeDuration() : CacheIsapi.cpp
  • DoChild() : Sockdups.c
  • DoChooseColorStuff() : Colors.c
  • DoChooseFontStuff() : Font.c
  • DoCleanUp() : areadcli.c
  • DoCleanup() : Sockdups.c , Bcast.c
  • DoClient() : PrPerf.c , PrSamp.h
  • DoClose() : bits_ie.cpp
  • DoCollaborate() : cShare.Cpp , cShare.h
  • DoColorsDialog() : Colors.h , Colors.c
  • DoConferenceCreate() : CConf.Cpp , CConf.h
  • DoConferenceLeave() : CConf.Cpp , CConf.h
  • DoContextMenu() : VListVw.c
  • DoCreateAppShareChannel() : cshare.h
  • DoCreateDataChannel() : cData.h , cData.Cpp , cData.h
  • DoCustomError() : ReMapUrl.cpp
  • DoCustomUI() : httpauth.cpp
  • DocWndProc() : SimpCntr.h , SimpSvr.h , SimpSvr.Cpp , SimpDnd.Cpp , SimpDnd.h , SimpCntr.Cpp
  • DoDeleteIpForwardEntry() : IPRoute.h , IPRoute.Cpp
  • DoDeleteIpNetEntry() : IPArp.h , IPArp.Cpp
  • DoDisplayInfoDesc() : custom.c
  • dodlg_stringin() : utils.cpp
  • DoDragScroll() : idt.h
  • DoDrop() : sendto.c
  • DoDump() : main.hxx , dump.cxx
  • DoEndOfRequest() : Redir401.cpp
  • DoEnumAll() : Debug.Cpp , Global.h
  • DoEnumApps() : cshare.cpp , cShare.Cpp , cShare.h , Global.h
  • DoEnumChannelMember() : Debug.Cpp , Global.h
  • DoEnumConferenceMember() : Debug.Cpp , Global.h
  • DoEnumMemberLeak() : Debug.Cpp , Global.h
  • DoesFileExist() : Utility.c , Utility.h
  • DoFileEvent() : CallNot.cpp , CallNot.h
  • DoFindDialog() : Find.c , Find.h
  • DoFindRepStuff() : Find.c
  • DoFinish() : bits_ie.cpp
  • DoFontDialog() : Font.c , Font.h
  • DoFtCancel() : CChan.h , cft.h , cft.cpp
  • DoGetConnTable() : IPStat.h , IPStat.Cpp
  • DoGetIpForwardTable() : IPRoute.h , IPRoute.Cpp
  • DoGetIpNetTable() : IPArp.h , IPArp.Cpp
  • DoGetStat() : IPStat.Cpp , IPStat.h
  • DoGracefulShutdown() : Sockdupc.c , Sockdups.c
  • DoHandleCall() : CCall.h , CCall.Cpp
  • DoHelloWorld() : custom.c
  • DoHelp() : CacheIsapi.cpp
  • DoIdealSendRecv() : TestAccept.cpp
  • DoInit() : areadcli.c
  • DoInvalidate() : CacheIsapi.cpp
  • DoIpDelete() : iplisten.c
  • DoIpListen() : precomp.h , iplisten.c
  • DoIpQuery() : iplisten.c
  • DoIpSet() : iplisten.c
  • DoIpx() : Bcast.c
  • DoIpxClient() : Bcast.c
  • DoIpxServer() : Bcast.c
  • DoLineCallState() : TapiCode.c
  • DoLineClose() : TapiCode.c
  • DoLineCreate() : TapiCode.c
  • DoLineDevState() : TapiCode.c
  • DoLineReply() : TapiCode.c
  • DoList() : main.hxx , enum.cxx
  • DoMailSlot() : Bcast.c
  • DoMailSlotClient() : Bcast.c
  • DoMailSlotServer() : Bcast.c
  • DoMain() : Main.c
  • DoMatchingFilesInOneDir() : SidClean.c
  • DoMessage() : FileTerm.cpp , FileTerm.h , Callnot.Cpp , Incoming.Cpp , Outgoing.Cpp
  • DoModalPropSheet() : Property.c
  • DoModelessPropSheet() : Property.c
  • DoOneFileOrDir() : SidClean.c
  • DoOpenDialog() : Open.c , Open.h
  • DoOpenSaveStuff() : Open.c
  • DoPaint() : WinCap.h , WinCap.c
  • DoParent() : Sockdups.c
  • DoPreprocHeaders() : Redir401.cpp
  • DoPrint() : sdkdiff.cpp
  • DoPrintDialog() : Print.h , Print.c
  • DoPrintDlgStuff() : Print.c
  • DoQuery() : AdvQuery.Cxx , QSample.Cxx
  • DoQueryFile() : QSample.Cxx
  • DoReceiveRequests() : main.c
  • DoRecvOnce() : TestAccept.cpp
  • DoRecvUntilDone() : TestAccept.cpp
  • DoReplaceDialog() : Replace.c , Replace.h
  • DoResize() : sdkdiff.cpp
  • DoRnrClient() : rnrcs.cpp
  • DoRnrServer() : rnrcs.cpp
  • DoSaveDialog() : Save.h , Save.c
  • DoScroll() : WinCap.h , WinCap.c
  • DoSendChatMsg() : cData.Cpp , cData.h
  • DoSendNoRecv() : TestAccept.cpp
  • DoSendOnce() : TestAccept.cpp
  • DoSendRawData() : Redir401.cpp
  • DoSendResponse() : Redir401.cpp
  • DoSendThenRecv() : TestAccept.cpp
  • DoSendUntilDone() : TestAccept.cpp
  • DoSendWaitRecv() : TestAccept.cpp
  • DoServer() : PrPerf.c , PrSamp.h
  • DoSetIpForwardEntry() : IPRoute.Cpp , IPRoute.h
  • DoSetIpNetEntry() : IPArp.h , IPArp.Cpp
  • DoSharableAppLeak() : Debug.Cpp , Global.h
  • DoShutDown() : TestAccept.cpp
  • DoSimpleConnect() : custom.c
  • DoSize() : WinCap.c , WinCap.h
  • DoSQLError() : MqTrans.Cpp
  • DoSsl() : ssl.c , precomp.h
  • DoSslDelete() : ssl.c
  • DoSslQuery() : ssl.c
  • DoSslSet() : ssl.c
  • DoStartup() : Bcast.c
  • DosxError() : wn_dos.h
  • DoTakeControl() : cShare.h , cShare.Cpp
  • DoTests() : ComPerf.Cpp , sampclnt.h , sampclnt.cpp
  • DoTimings() : Client.C
  • DoTitleDialog() : Title.c , Title.h
  • doTrackObject() : WxForm.c , Track.h , Track.c , WxForm.h
  • DottedLine() : DspLogcl.Cpp
  • DOUBLE_LINK_TYPE_free_inst() : Xmitu.h , Xmitu.c
  • DOUBLE_LINK_TYPE_free_xmit() : Xmitu.h , Xmitu.c
  • DOUBLE_LINK_TYPE_from_xmit() : Xmitu.h , Xmitu.c
  • DOUBLE_LINK_TYPE_to_xmit() : Xmitu.c , Xmitu.h
  • DoUdp() : Bcast.c
  • DoUdpClient() : Bcast.c
  • DoUdpServer() : Bcast.c
  • DoUpdateRoutes() : rmapi.c
  • DoUrlAcl() : url.c , precomp.h
  • DoUrlAclDelete() : url.c
  • DoUrlAclQuery() : url.c
  • DoUrlAclSet() : url.c
  • DoVerb() : ioo.h
  • DoWait() : Overlap.c
  • DoWaitSendRecv() : TestAccept.cpp
  • DoWizardPropSheet() : Property.c
  • Download() : Sample1.Cpp , Sample1.h
  • DownloadAndUpgradeMsi() : upgrdmsi.cpp , setup.h
  • DoWork() : TraceDp.c
  • DoWorkAlone() : cShare.h , cShare.Cpp
  • dprintf() : dbh.cpp
  • DragEnter() : idt.h
  • DragLeave() : idt.h
  • DragOver() : idt.h
  • DrainBuffer() : pipe.hxx , pipe.cxx
  • Draw3DRect() : MDIChild.C
  • DrawANDMask() : Icons.h , Icons.C
  • DrawAscii() : Display.c , FontView.c
  • DrawBitmap() : BitMap.c , BitMap.h
  • DrawBranch() : Server32.h , Server32.c
  • DrawButton() : Tools.c , Dialer.c
  • DrawButtonText() : Dialer.c
  • DrawCommandProc() : Draw.c , Draw.h
  • DrawCreateProc() : Draw.c , Draw.h
  • DrawDestroyProc() : Draw.c , Draw.h
  • DrawDragFeedback() : idt.h
  • DrawFonts() : Paint.h , Paint.c
  • DrawGlyph() : FontView.c , Display.c
  • DrawGrids() : PlgBlt.h , PlgBlt.c
  • DrawIndent() : WinCap.h
  • DrawLink() : bar.cpp
  • DrawMaze() : Maze.h , Maze.c
  • DrawObject() : Draw.h , Draw.c
  • DrawPaintProc() : Draw.h , Draw.c
  • DrawProc() : Draw.c , Draw.h
  • DrawSample() : Dialogs.c
  • DrawSection() : bar.cpp
  • DrawSelect() : WinCap.c , WinCap.h
  • DrawSurfWndProc() : MfEdit.c , MfEdit.h
  • DrawUserItem() : Dlg.Cpp , Global.h
  • DrawXForm() : XForm.c
  • DrawXORMask() : Icons.h , Icons.C
  • Drop() : idt.h
  • DropActiveCall() : Atsp.c , Atsp.h
  • DropExt_CheckForHDROP() : DropExt.C
  • DropExt_CheckForHNRES() : DropExt.C
  • DropExt_CreateInstance() : DropExt.C
  • DropExt_CTM_QueryInterface() : DropExt.C
  • DropExt_GetCommandString() : DropExt.C
  • DropExt_GetNetResource() : DropExt.C
  • DropExt_Initialize() : DropExt.C
  • DropExt_InvokeCommand() : DropExt.C
  • DropExt_QueryContextMenu() : DropExt.C
  • DropExt_SXI_QueryInterface() : DropExt.C
  • DropHdbc() : quiktest.c
  • DropHenv() : quiktest.c
  • DropTable() : quiktest.c
  • DrvAlloc() : Atsp.h , Atsp.c
  • DrvFree() : Atsp.h , Atsp.c
  • DSBitsPerPixel() : DIBSectn.c , DIBSectn.h
  • DSColorTableSize() : DIBSectn.h , DIBSectn.c
  • DSCopyBitmap() : DIBSectn.h , DIBSectn.c
  • DSCopyBitmapEx() : DIBSectn.h , DIBSectn.c
  • DSCreateDDBForDS() : DIBSectn.c
  • DSCreateDIBSection() : DIBSectn.c , DIBSectn.h
  • DSCreatePaletteForDIBSection() : DIBSectn.c , DIBSectn.h
  • DSCreateSpectrumPalette() : DIBSectn.c , DIBSectn.h
  • DSDrawDIBSectionOnDC() : DIBSectn.c , DIBSectn.h
  • DSGetBITMAPINFOForDIBSection() : DIBSectn.c , DIBSectn.h
  • DSGetDIBFromDIBSection() : DIBSectn.h , DIBSectn.c
  • DSGetDIBSectionFromClipboard() : DIBSectn.c , DIBSectn.h
  • DSGetOptimalDIBFormat() : DIBSectn.c , DIBSectn.h
  • DSGetPointerToDIBSectionImageBits() : DIBSectn.h , DIBSectn.c
  • DSGetRGBBitsPerPixel() : DIBSectn.c , DIBSectn.h
  • DSImageBitsSize() : DIBSectn.c , DIBSectn.h
  • DSLoadDIBSectionFromBMPFile() : DIBSectn.h , DIBSectn.c
  • DSPutDIBSectionOnClipboard() : DIBSectn.c , DIBSectn.h
  • DSStoreDIBSectionInBMPFile() : DIBSectn.h , DIBSectn.c
  • DSTotalBytesSize() : DIBSectn.h , DIBSectn.c
  • DtcGetTransactionManager() : MqTrans.Cpp
  • DTHandler___WSAFDIsSet() : Handlers.h , Handlers.Cpp
  • DTHandler_accept() : Handlers.Cpp , Handlers.h
  • DTHandler_bind() : Handlers.h , Handlers.Cpp
  • DTHandler_closesocket() : Handlers.h , Handlers.Cpp
  • DTHandler_connect() : Handlers.Cpp , Handlers.h
  • DTHandler_gethostbyaddr() : Handlers.h , Handlers.Cpp
  • DTHandler_gethostbyname() : Handlers.h , Handlers.Cpp
  • DTHandler_gethostname() : Handlers.h , Handlers.Cpp
  • DTHandler_getpeername() : Handlers.h , Handlers.Cpp
  • DTHandler_getprotobyname() : Handlers.h , Handlers.Cpp
  • DTHandler_getprotobynumber() : Handlers.Cpp , Handlers.h
  • DTHandler_getservbyname() : Handlers.Cpp , Handlers.h
  • DTHandler_getservbyport() : Handlers.Cpp , Handlers.h
  • DTHandler_getsockname() : Handlers.Cpp , Handlers.h
  • DTHandler_getsockopt() : Handlers.h , Handlers.Cpp
  • DTHandler_htonl() : Handlers.Cpp , Handlers.h
  • DTHandler_htons() : Handlers.Cpp , Handlers.h
  • DTHandler_inet_addr() : Handlers.Cpp , Handlers.h
  • DTHandler_inet_ntoa() : Handlers.h , Handlers.Cpp
  • DTHandler_ioctlsocket() : Handlers.Cpp , Handlers.h
  • DTHandler_listen() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPAddressToString() : Handlers.Cpp
  • DTHandler_NSPCleanup() : Handlers.h
  • DTHandler_NSPGetAddressByName() : Handlers.Cpp
  • DTHandler_NSPGetServiceClassInfo() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPGetServiceClassNameByClassId() : Handlers.Cpp
  • DTHandler_NSPInstallServiceClass() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPLookupServiceBegin() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPLookupServiceEnd() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPLookupServiceNext() : Handlers.h , Handlers.Cpp
  • DTHandler_NSPRemoveServiceClass() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPSetService() : Handlers.Cpp , Handlers.h
  • DTHandler_NSPStringToAddress() : Handlers.Cpp
  • DTHandler_ntohl() : Handlers.h , Handlers.Cpp
  • DTHandler_ntohs() : Handlers.h , Handlers.Cpp
  • DTHandler_recv() : Handlers.h , Handlers.Cpp
  • DTHandler_recvfrom() : Handlers.h , Handlers.Cpp
  • DTHandler_select() : Handlers.Cpp , Handlers.h
  • DTHandler_send() : Handlers.h , Handlers.Cpp
  • DTHandler_sendto() : Handlers.h , Handlers.Cpp
  • DTHandler_setsockopt() : Handlers.h , Handlers.Cpp
  • DTHandler_shutdown() : Handlers.h , Handlers.Cpp
  • DTHandler_socket() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUCloseEvent() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUCloseSocketHandle() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUCreateEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUCreateSocketHandle() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUFDIsSet() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUGetProviderPath() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUModifyIFSHandle() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUPostMessage() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUQueryBlockingCallback() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUQuerySocketHandleContext() : Handlers.Cpp , Handlers.h
  • DTHandler_WPUQueueApc() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUResetEvent() : Handlers.h , Handlers.Cpp
  • DTHandler_WPUSetEvent() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAccept() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAddressToStringA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAddressToStringW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncGetHostByAddr() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncGetHostByName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAsyncGetProtoByName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAAsyncGetProtoByNumber() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncGetServByName() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncGetServByPort() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAAsyncSelect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSACancelAsyncRequest() : Handlers.Cpp , Handlers.h
  • DTHandler_WSACancelBlockingCall() : Handlers.h , Handlers.Cpp
  • DTHandler_WSACleanup() : Handlers.h , Handlers.Cpp
  • DTHandler_WSACloseEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAConnect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSACreateEvent() : Handlers.Cpp , Handlers.h
  • DTHandler_WSADuplicateSocketA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSADuplicateSocketW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAEnumNameSpaceProvidersA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAEnumNameSpaceProvidersW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAEnumNetworkEvents() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAEnumProtocolsA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAEnumProtocolsW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAEventSelect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetAddressByNameA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetAddressByNameW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetLastError() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetOverlappedResult() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetQOSByName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetServiceClassInfoA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAGetServiceClassInfoW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetServiceClassNameByClassIdA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAGetServiceClassNameByClassIdW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAHtonl() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAHtons() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAInstallServiceClassA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAInstallServiceClassW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAIoctl() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAIsBlocking() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAJoinLeaf() : Handlers.Cpp , Handlers.h
  • DTHandler_WSALookupServiceBeginA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSALookupServiceBeginW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSALookupServiceEnd() : Handlers.Cpp , Handlers.h
  • DTHandler_WSALookupServiceNextA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSALookupServiceNextW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSANtohl() : Handlers.Cpp , Handlers.h
  • DTHandler_WSANtohs() : Handlers.Cpp , Handlers.h
  • DTHandler_WSARecv() : Handlers.Cpp , Handlers.h
  • DTHandler_WSARecvDisconnect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSARecvFrom() : Handlers.Cpp , Handlers.h
  • DTHandler_WSARemoveServiceClass() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAResetEvent() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASend() : Handlers.Cpp , Handlers.h
  • DTHandler_WSASendDisconnect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASendTo() : Handlers.Cpp , Handlers.h
  • DTHandler_WSASetBlockingHook() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASetEvent() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASetLastError() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASetServiceA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASetServiceW() : Handlers.h , Handlers.Cpp
  • DTHandler_WSASocketA() : Handlers.Cpp , Handlers.h
  • DTHandler_WSASocketW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAStartup() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAStringToAddressA() : Handlers.h , Handlers.Cpp
  • DTHandler_WSAStringToAddressW() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAUnhookBlockingHook() : Handlers.Cpp , Handlers.h
  • DTHandler_WSAWaitForMultipleEvents() : Handlers.Cpp , Handlers.h
  • DTHandler_WSCDeinstallProvider() : Handlers.Cpp , Handlers.h
  • DTHandler_WSCEnumProtocols() : Handlers.Cpp , Handlers.h
  • DTHandler_WSCInstallProvider() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPAccept() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPAsyncSelect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPBind() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPCancelBlockingCall() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPCleanup() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPCloseSocket() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPConnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPDuplicateSocket() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPEnumNetworkEvents() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPEventSelect() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPGetOverlappedResult() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPGetPeerName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPGetQOSByName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPGetSockName() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPGetSockOpt() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPIoctl() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPJoinLeaf() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPListen() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPRecv() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPRecvDisconnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPRecvFrom() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSelect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSend() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSendDisconnect() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSendTo() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSetSockOpt() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPShutdown() : Handlers.Cpp , Handlers.h
  • DTHandler_WSPSocket() : Handlers.h , Handlers.Cpp
  • DTHandler_WSPStartup() : Handlers.Cpp , Handlers.h
  • DTHandlerInit() : Handlers.h , Handlers.Cpp
  • DTTextOut() : Dt_Dll.Cpp , Dt.h
  • Dump() : AsyncDemo.cpp
  • dump_com_error() : QueueDef.h
  • dump_debug_event_info() : BPSamp.h , Utils.c
  • DumpAce() : security.cpp
  • DumpAclInfo() : SD.c , Check_SD.h
  • DumpAllCalls() : Debug.Cpp , Global.h
  • DumpBytes() : Range.c
  • DumpCallInfo() : Global.h , Debug.Cpp
  • DumpChannelInfo() : Debug.Cpp , Global.h
  • DumpClassName() : PathParser.cpp
  • DumpColumnHeadings() : sampclnt.h , dump.cpp
  • DumpColumnsInfo() : dump.cpp , sampclnt.h
  • DumpConferenceInfo() : Debug.Cpp , Global.h
  • DumpControl() : SD.c , Check_SD.h
  • DumpDacl() : Check_SD.h , SD.c
  • DumpData() : Pickltc.c , Picklpc.c
  • dumpdbi() : dbh.cpp
  • DumpErrorHResult() : dump.cpp , sampclnt.h
  • DumpErrorMsg() : sampclnt.h , dump.cpp
  • DumpEvent() : tracedmp.cpp
  • DumpFeatureMasks() : QueryParser.cpp
  • DumpFile() : Check_SD.h , SecObjects.c
  • DumpFromClause() : QueryParser.cpp
  • DumpKernelObject() : SecObjects.c , Check_SD.h
  • DumpKeyList() : PathParser.cpp
  • DumpLaunchInfo() : cMgr.h , cMgr.Cpp
  • dumpLine() : dbh.cpp
  • DumpMemberInfo() : Global.h , Debug.Cpp
  • DumpNamespaces() : PathParser.cpp
  • DumpNetShare() : Check_SD.h , SecObjects.c
  • DumpObject() : main.hxx , dump.cxx
  • DumpOwnerGroup() : SD.c , Check_SD.h
  • DumpPrinter() : Check_SD.h , SecObjects.c
  • DumpRegistryKey() : Check_SD.h , SecObjects.c
  • DumpRow() : dump.cpp , sampclnt.h
  • DumpRpn() : QueryParser.cpp
  • DumpSample() : nshsamp.h , sample.cpp
  • DumpSampleInterface() : nshsamp.h , sampinterface.cpp
  • DumpSD() : security.cpp , Check_SD.h , SD.c
  • DumpSDInfo() : Check_SD.h , SD.c
  • DumpSelectList() : QueryParser.cpp
  • DumpServerName() : PathParser.cpp
  • DumpService() : Check_SD.h , SecObjects.c
  • DumpServiceClassInfo() : rnrcs.cpp
  • dumpsi() : dbh.cpp
  • DumpStatusMsg() : sampclnt.h , dump.cpp
  • DumpSubexpression() : QueryParser.cpp
  • dumpsym32() : dbh.cpp
  • DumpSysInfo() : cMgr.h , cMgr.Cpp
  • DumpTcpTable() : IPStat.h , IPStat.Cpp
  • DumpUdpTable() : IPStat.h , IPStat.Cpp
  • DumpUserObject() : SecObjects.c , Check_SD.h
  • DumpVariable() : formdump.cpp
  • DumpWhereClause() : QueryParser.cpp
  • DUnadvise() : ido.h
  • DuplicateItemList() : Enum.Cpp , Enum.h
  • DuplicateWSTR() : Sample1.Cpp , Sample1.h
  • DWORD() : rqsengine.h , msgfiltr.h , enablerouter.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- e -

  • EapBegin() : Eap.c , Eap.h
  • EapEnd() : Eap.h , Eap.c
  • EapMakeMessage() : Eap.c , Eap.h
  • EapTrace() : Eap.h , Eap.c
  • EditChar() : Edit.Cpp , Global.h
  • EditFreeCaches() : Global.h
  • EditInsertUnicode() : Global.h
  • EditKeyDown() : Edit.Cpp , Global.h
  • EditMode() : data.Idl
  • EE_Create() : configentry.c , configentry.h
  • EE_Destroy() : configentry.c , configentry.h
  • EjectDlgProc() : Dlg.Cpp
  • EmbossedTextOut() : MidiPlyr.h , UIUTILS.c
  • EnableAsyncReceive() : MQPort.Cpp
  • EnableButton() : Callnot.Cpp , Incoming.Cpp , Outgoing.Cpp
  • EnableChildren() : Atsp.c
  • EnableColorButtons() : Colors.c
  • EnableCRTAllocHook() : spy.cpp , spy.h
  • EnableCRTReportHook() : spy.cpp , spy.h
  • EnableDebugPriv() : SuperUsr.cpp
  • EnableFontButtons() : Font.c
  • EnableHangupCall() : ToolBar.c , ToolBar.h
  • EnableMakeCall() : ToolBar.c , ToolBar.h
  • EnableModeless() : ioipf.h , ioipao.h
  • EnablePreview() : Incoming.Cpp , Outgoing.Cpp
  • EnablePrintControls() : Print.c
  • EncryptAndEncodeCredentials() : CustomAuth.cpp
  • EncryptDecryptFile() : RSACert.cpp , RSAKey.cpp
  • EncryptThis() : Security.cpp , Security.h
  • EndInkInput() : RecoDll.cpp
  • EndMenuItemIDTable() : IMEApps.h , ImeMenu.c
  • EndSelection() : Select.c , Select.h
  • EndTime() : Client.C
  • Engage() : MICARS.Idl
  • EngineDefined() : ComSpyAudit.Idl
  • EnqueueEvent() : configentry.c , configentry.h
  • EnqueueOverlappedOperation() : overlap.cpp
  • EnterNew() : ComDlg32.h
  • EnterSampleAPI() : utils.h , utils.c
  • EnterSampleWorker() : utils.c , utils.h
  • EntityDelete() : data.Idl
  • EntityInsert() : data.Idl
  • EntityLoad() : data.Idl
  • EntityLookup() : data.Idl
  • EntityQuery() : data.Idl
  • EntityRead() : data.Idl
  • EntityUpdate() : data.Idl
  • Enum() : Sample1.Cpp , Sample1.h
  • EnumAdvise() : ioo.h
  • EnumCalendarInfoProc() : nlsapi.c
  • EnumDAdvise() : ido.h
  • EnumDialogCallback() : msiloc.cpp
  • EnumDlgProc() : Dialogs.c , FontView.c
  • EnumerateAttributes() : policy.cpp , Policy.Cpp
  • EnumerateDirectoryTree() : AsyncIO.c , AsyncIO.h
  • EnumerateItems() : wiassamp.cpp
  • EnumerateJobs() : sa.Cpp
  • EnumerateLevel() : Monkey.c , Monkey.h
  • EnumerateObjectType() : app.cpp
  • EnumerateParent() : Sample1.Cpp , Sample1.h
  • EnumerateProviders() : install.h , provider.cpp
  • EnumerateSecurityPackagesW() : Stubs.c
  • EnumerateServers() : Tst4Wts.c
  • EnumerateUserQuotas() : Commands.Cpp , Commands.h
  • EnumerateUsers() : Commands.Cpp , Commands.h
  • EnumerateWiaDevices() : wiassamp.cpp
  • EnumerateWithRowsetPointer() : Sample1.Cpp , Sample1.h
  • Enumerator() : ATMEvent.h , Enumerator.Cpp
  • EnumFontNames() : FontView.c
  • EnumFontsProc() : Font.c
  • EnumFormatEtc() : ido.h
  • EnumLanguageCallback() : msiloc.cpp
  • EnumLDateFormatsProc() : nlsapi.c
  • EnumLocalesProc() : nlsapi.c
  • EnumMetafileExtractIcon() : Common.h , drawIcon.c
  • EnumMetafileExtractIconSource() : Common.h , drawIcon.c
  • EnumMetafileExtractLabel() : Common.h , drawIcon.c
  • EnumMetafileIconDraw() : Common.h , drawIcon.c
  • EnumObject() : enum.cxx , main.hxx
  • EnumObjects() : RendSam.Cpp
  • EnumPrinterDriversDlgProc() : Common.h , Enumprt.c
  • EnumPrintersDlgProc() : Common.h , Enumprt.c
  • EnumPrintersOptionsDlgProc() : Enumprt.h , Enumprt.c
  • EnumProcessListFunc() : DebMisc.c , DebMisc.h
  • EnumResNamesProc() : msistuff.cpp
  • EnumSDateFormatsProc() : nlsapi.c
  • EnumStringCallback() : msiloc.cpp
  • EnumTimeFormatsProc() : nlsapi.c
  • EnumVerbs() : ioo.h
  • EpGetEmptyString() : string.h
  • EqualComputerName() : SubAuth.c
  • Erase() : PAPINT.Idl
  • EraseBackground() : MDIChild.C
  • Erased() : PAPINT.Idl
  • errFormatMessage() : CeError.Cpp , ceerror.cpp
  • Error() : DComPerm.Cpp , MidiPlyr.h , UIUTILS.c , MqTrans.Cpp , MSMQTest.c , msiloc.cpp
  • Error_get_Description_Proxy() : adoint.h
  • Error_get_Description_Stub() : adoint.h
  • Error_get_HelpContext_Proxy() : adoint.h
  • Error_get_HelpContext_Stub() : adoint.h
  • Error_get_HelpFile_Proxy() : adoint.h
  • Error_get_HelpFile_Stub() : adoint.h
  • Error_get_NativeError_Proxy() : adoint.h
  • Error_get_NativeError_Stub() : adoint.h
  • Error_get_Number_Proxy() : adoint.h
  • Error_get_Number_Stub() : adoint.h
  • Error_get_Source_Proxy() : adoint.h
  • Error_get_Source_Stub() : adoint.h
  • Error_get_SQLState_Proxy() : adoint.h
  • Error_get_SQLState_Stub() : adoint.h
  • ErrorBox() : AppUtil.Cpp , errors.c , errors.h
  • ErrorBoxID() : register.Cpp
  • ErrorHandlerEx() : VListVw.c , Globals.h , Main.c
  • ErrorIf() : msiloc.cpp
  • ErrorMessage() : Util.Cpp , Util.h , secClnt.Cpp , secSvr.Cpp
  • ErrorMessageBox() : DebMisc.c , DebMisc.h
  • ErrorMsg() : WbemClientDlg.Cpp , Debug.Cpp , Global.h
  • ErrorOut() : FTPJr.cpp , HeadDump.cpp
  • Errors_Clear_Proxy() : adoint.h
  • Errors_Clear_Stub() : adoint.h
  • Errors_get_Item_Proxy() : adoint.h
  • Errors_get_Item_Stub() : adoint.h
  • ErrorString() : AdvClientdlg.cpp , AdvClientdlg.h
  • ErrorWithFile() : Utility.c , Utility.h
  • ErrsHandle() : quiktest.c
  • errString() : Dialer.c
  • ExecEndTran() : quiktest.c
  • ExecSQLStmt() : Driver.Cpp
  • ExecUrlCompletion() : WildCardMap.cpp
  • ExecuteOverlappedOperation() : overlap.cpp
  • ExecuteQuery() : Consumer.Cpp
  • ExecuteStatement() : MqTrans.Cpp
  • ExecuteUpgradeMsi() : setup.h , upgrdmsi.cpp
  • ExecuteVerifyUpdate() : setup.h , upgrdmsi.cpp
  • Exists() : mwclass.Cxx
  • exitGetProperty() : exit.cpp , exit.h
  • exitGetRequestAttribute() : exit.cpp
  • ExportTx() : CopyFileRm.Idl , RmWorker.Idl
  • ExtAcceptEx() : provider.h , extension.cpp
  • ExtConnectEx() : extension.cpp , provider.h
  • ExtDisconnectEx() : provider.h , extension.cpp
  • ExtendVirtualBuffer() : AsyncIO.c , AsyncIO.h
  • ExtensionCallback() : FaxSiren.Cpp
  • EXTERN_GUID() : Authenticate.idl , sdksamplestorageplugin.idl , Authenticate.idl , ContextDll.idl , dbauth.idl , proxyplugin.idl , Authenticate.idl , proxyplugin.idl , ContextDll.idl , Authenticate.idl , dbauth.idl , sdksamplestorageplugin.idl , ContextDll.idl
  • ExtractBaseNodePtr() : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp
  • ExtractDataObjPtr() : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • ExtractDlgProc() : Icons.C
  • ExtractFromDataObject() : dataobj.h , globals.cpp , dataobj.h , globals.h , dataobj.h , globals.cpp , dataobj.h , globals.cpp , globals.h , globals.cpp , dataobj.h , globals.h , Dataobj.h , globals.cpp , globals.h , dataobj.h
  • ExtractNodeTypeFlg() : globals.h , globals.cpp
  • ExtTransmitFile() : extension.cpp , provider.h
  • ExtTransmitPackets() : extension.cpp , provider.h
  • ExtWSARecvMsg() : provider.h , extension.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- f -

  • f1() : BPSampTest.c
  • f2() : BPSampTest.c
  • f3() : BPSampTest.c
  • FakeMenuDemo_OnContextMenu() : fakemenu.c
  • FakeMenuDemo_OnEraseBkgnd() : fakemenu.c
  • FakeMenuDemo_WndProc() : fakemenu.c
  • FAutoRegister() : OleImp.Cpp , secSvr.Cpp , OleApt.Cpp , ComPerf.Cpp
  • FaxDevAbortOperation() : NewFsp.c
  • FaxDevEndJob() : NewFsp.c
  • FaxDevInitialize() : NewFsp.c
  • FaxDevReceive() : NewFsp.c
  • FaxDevReportStatus() : NewFsp.c
  • FaxDevSend() : NewFsp.c
  • FaxDevStartJob() : NewFsp.c
  • FaxDevVirtualDeviceCreation() : NewFsp.c
  • FaxLineCallback() : NewFsp.c
  • FaxRouteDeviceChangeNotification() : FaxSiren.Cpp
  • FaxRouteDeviceEnable() : FaxSiren.Cpp
  • FaxRouteGetRoutingInfo() : FaxSiren.Cpp
  • FaxRouteInitialize() : FaxSiren.Cpp
  • FaxRouteSetRoutingInfo() : FaxSiren.Cpp
  • FcCloseFile() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • FcOpenFile() : openf.h , openf.c , openf.h , openf.c , openf.h , openf.c
  • FcReadFromFile() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • FCreateAppWindow() : Main.Cpp
  • FCreateChatWindow() : Init.Cpp
  • FCreateEditWindow() : Main.Cpp
  • FCreateLView() : Init.Cpp
  • FCreateMsgWindow() : Main.Cpp , Init.Cpp
  • FCreateSbar() : Global.h , sBar.Cpp
  • FCreateTbar() : Global.h , sBar.Cpp
  • FCreateUserList() : Main.Cpp
  • FDImage() : ASAccept.cpp
  • FetchData() : adoisapi.cpp
  • FFileExists() : Global.h , Util.Cpp
  • FGetDirectory() : Global.h , Util.Cpp
  • FGetFileName() : Global.h , Util.Cpp , Global.h , Util.Cpp
  • FIconFileFromClass() : getIcon.c , Utility.h
  • Field() : data.Idl
  • Field_AppendChunk_Proxy() : adoint.h
  • Field_AppendChunk_Stub() : adoint.h
  • Field_get_ActualSize_Proxy() : adoint.h
  • Field_get_ActualSize_Stub() : adoint.h
  • Field_get_Attributes_Proxy() : adoint.h
  • Field_get_Attributes_Stub() : adoint.h
  • Field_get_DefinedSize_Proxy() : adoint.h
  • Field_get_DefinedSize_Stub() : adoint.h
  • Field_get_Name_Proxy() : adoint.h
  • Field_get_Name_Stub() : adoint.h
  • Field_get_NumericScale_Proxy() : adoint.h
  • Field_get_NumericScale_Stub() : adoint.h
  • Field_get_OriginalValue_Proxy() : adoint.h
  • Field_get_OriginalValue_Stub() : adoint.h
  • Field_get_Precision_Proxy() : adoint.h
  • Field_get_Precision_Stub() : adoint.h
  • Field_get_Type_Proxy() : adoint.h
  • Field_get_Type_Stub() : adoint.h
  • Field_get_UnderlyingValue_Proxy() : adoint.h
  • Field_get_UnderlyingValue_Stub() : adoint.h
  • Field_get_Value_Proxy() : adoint.h
  • Field_get_Value_Stub() : adoint.h
  • Field_GetChunk_Proxy() : adoint.h
  • Field_GetChunk_Stub() : adoint.h
  • Field_put_Value_Proxy() : adoint.h
  • Field_put_Value_Stub() : adoint.h
  • Fields_get_Item_Proxy() : adoint.h
  • Fields_get_Item_Stub() : adoint.h
  • file_checksum() : file.cpp , file.h
  • file_delete() : file.cpp , file.h
  • file_discardlines() : file.cpp , file.h
  • file_getdiritem() : file.cpp , file.h
  • file_getlinelist() : file.cpp , file.h
  • file_GetTime() : file.cpp , file.h
  • file_IsUnicode() : file.cpp , file.h
  • file_new() : file.cpp , file.h
  • File_Print_Connection0() : Admapit.c
  • File_Print_Connection1() : Admapit.c
  • File_Print_RAS_PORT0() : Admapit.c
  • File_Print_RAS_PORT1() : Admapit.c
  • File_Print_RasConnection() : AdminDll.c
  • File_Print_RasPort() : AdminDll.c
  • file_readlines() : file.cpp
  • file_reset() : file.cpp , file.h
  • file_retrievechecksum() : file.cpp , file.h
  • FileCopyTx() : CopyFileRm.Idl
  • FileDeleteTx() : RmWorker.Idl , CopyFileRm.Idl
  • FileExist() : AppUtil.h , AppUtil.Cpp
  • FileMoveTxt() : RmWorker.Idl , CopyFileRm.Idl
  • FileRenameTx() : RmWorker.Idl , CopyFileRm.Idl
  • FileSaveHookProc() : Dlgopen.c
  • FileShareSampleCheckIsAlive() : File Share Sample.cpp
  • FileShareSampleClose() : File Share Sample.cpp
  • FileShareSampleDllMain() : ClRes.h , File Share Sample.cpp
  • FileShareSampleGetPrivateResProperties() : File Share Sample.cpp
  • FileShareSampleIsAlive() : File Share Sample.cpp
  • FileShareSampleLooksAlive() : File Share Sample.cpp
  • FileShareSampleOffline() : File Share Sample.cpp
  • FileShareSampleOfflineThread() : File Share Sample.cpp
  • FileShareSampleOnline() : File Share Sample.cpp
  • FileShareSampleOnlineThread() : File Share Sample.cpp
  • FileShareSampleOpen() : File Share Sample.cpp
  • FileShareSampleResourceControl() : File Share Sample.cpp
  • FileShareSampleResourceTypeControl() : File Share Sample.cpp
  • FileShareSampleSetNameHandler() : File Share Sample.cpp
  • FileShareSampleSetPrivateResProperties() : File Share Sample.cpp
  • FileShareSampleStartup() : ClRes.h , File Share Sample.cpp
  • FileShareSampleTerminate() : File Share Sample.cpp
  • FileShareSampleValidatePrivateResProperties() : File Share Sample.cpp
  • FileViewerFrameProc() : FVProc.Cpp , FVText.h
  • FillColorDlg() : Colors.c
  • FillCountryCodeList() : TapiCode.c
  • FillDevmodeDlg() : Print.c
  • FillDevnamesDlg() : Print.c
  • FillEnumFields() : Dialogs.c
  • FillFindDlg() : Find.c
  • FillFontDlg() : Font.c
  • FillFontsBox() : Font.c
  • FillInParam() : FontView.c
  • FillInValue() : FontView.c
  • FillLocationInfo() : TapiCode.c
  • FillLogFontDlg() : Font.c
  • FillMenuItemInfo() : ImeMenu.c
  • FillOpenDlg() : Open.c , Open.h
  • FillOut() : Fx.c , Fx.h
  • FillPrintDlg() : Print.c
  • FillTAPILine() : TapiCode.c
  • Finalize() : AdminDll.c
  • FindAddress() : tapisend.cpp
  • FindAllUsersInGC() : gcallusers.cpp
  • FindAnAddress() : Outgoing.Cpp
  • FindAndActivateCReq() : FileRepClientProc.cpp
  • FindAndActivateSReq() : FileRepServerProc.cpp
  • FindAndLockSocketContext() : provider.h , sockinfo.cpp
  • FindAttribFromName() : UserProps.cpp
  • FindAttribute() : DialIn.c
  • FindAttributesByType() : attributes.cpp
  • FindAttributesOrClasses() : getschemainfo.cpp
  • FindAudioStream() : tapisend.cpp
  • FindCertificate() : CreateCert.c , CreateCert.h
  • FindChar() : Display.c , FontView.c
  • FindClerks() : CrmMonComp.Idl
  • FindCloseStream() : FindStream.c , FindStream.h
  • FindConnectionByName() : main.cpp
  • FindCReq() : FileRepClientProc.cpp
  • FindDelimiters() : compitem.cpp
  • FindDIBBits() : Dibapi.h , Dibutil.c , Dib.c , Dib.h
  • FindDlgProc() : findgoto.cpp , findgoto.h , sdkdiff.h
  • FindEndOfMatched() : section.cpp
  • FindEndOfUnmatched() : section.cpp
  • FindError() : quiktest.c
  • FindFirstStream() : FindStream.c , FindStream.h
  • FindFirstWithLink() : section.cpp
  • FindGCAttributes() : attributes.cpp
  • findImportPool() : app.cpp
  • FindIndexedAttributes() : attributes.cpp
  • FindItemData() : IMEApps.h , ImeMenu.c
  • FindKey() : keys.cpp , keys.h
  • findLibrary() : app.cpp
  • findMediaType() : app.cpp
  • FindNextStream() : FindStream.c , FindStream.h
  • FindNumWithParameter() : dxsurf3.cpp
  • FindOneOf() : ComSpy.Cpp , fullsvr.Cpp , Server.Cpp , OPBank.Cpp , EdCommands.cpp , EdGlyphs.cpp , EdHost.cpp
  • FindParameter() : dxsurf3.cpp
  • FindProc() : Find.c , Find.h
  • FindProperty() : property.cpp , property.h
  • FindPropSet() : property.cpp , property.h
  • FindReplaceHookProc() : Find.c
  • FindServiceProvider() : Findsp.Cpp , QosEvent.h
  • FindSlot() : OleImp.Cpp
  • FindSReq() : FileRepServerProc.cpp
  • FindString() : findgoto.cpp , findgoto.h
  • FindUserByName() : bindtoparent.cpp , objectSid.cpp , iasuser.cpp
  • FindUsers() : queryusers.cpp
  • FInitApp() : Main.Cpp , Global.h , Init.Cpp
  • FInitMain() : Main.Cpp , Init.Cpp , Main.Cpp
  • FInitNm() : CConf.Cpp , CConf.h
  • FInitPref() : Main.Cpp
  • FitTextToButton() : Dialer.c
  • FlushMofList() : tracewmi.cpp
  • fnAdd() : dbh.cpp
  • fnAddr() : dbh.cpp
  • fnBase() : dbh.cpp
  • fnDelete() : dbh.cpp
  • fnEnum() : dbh.cpp
  • fnEnumForAddr() : dbh.cpp
  • fnFindFile() : dbh.cpp
  • fnHelp() : dbh.cpp
  • fnInfo() : dbh.cpp
  • fnLine() : dbh.cpp
  • fnLineNext() : dbh.cpp
  • fnLinePrev() : dbh.cpp
  • fnLoad() : dbh.cpp
  • fnLocals() : dbh.cpp
  • fnName() : dbh.cpp
  • fnNext() : dbh.cpp
  • fnNextPrev() : dbh.cpp
  • fnPrev() : dbh.cpp
  • fnQuit() : dbh.cpp
  • fnType() : dbh.cpp
  • fnUndec() : dbh.cpp
  • fnUnload() : dbh.cpp
  • fnVerbose() : dbh.cpp
  • Font() : ComSpyCtl.Idl , MtsSpyCtl.Idl , ComSpyCtl.Idl
  • FontDlgProc() : global.h
  • FontHookProc() : Font.c
  • FontProc() : Font.c , Font.h
  • FontThreadProc1() : Font.c
  • FontThreadProc2() : Font.c
  • for() : Utils.Cpp , suminfo.Cpp
  • Format() : gutils.h , utils.cpp
  • FormatAddress() : resolve.c , resolve.h , resolve.c , resolve.cpp , resolve.h , resolve.c , resolve.h
  • FormatDateTime() : Helper.Cpp , Helper.h
  • FormatError() : ClipBook ServerEx.cpp , File Share SampleEx.cpp , File Share SampleEx.h , QSample.Cxx , ClipBook ServerEx.h
  • FormatLastError() : TapiInfo.h , TapiInfo.c
  • FormatLineCallback() : TapiInfo.c , TapiInfo.h
  • FormatLineError() : TapiInfo.h , TapiInfo.c
  • FormattedRecord() : CrmMonComp.Idl
  • FOsfnIsFile() : wn_dos.h
  • FPrintResults() : ComPerf.Cpp
  • FrameWindow() : WinCap.c , WinCap.h
  • FrameWndProc() : Framer.Cpp , Framer.h
  • FREE() : Alloc.Cpp , Alloc.h
  • Free() : MfEdit.c , MfEdit.h
  • FreeAllApps() : cShare.h , chWnd.Cpp
  • FreeAllComObjects() : Init.Cpp , Global.h
  • FreeAllocatedMemory() : LeakyBin.c
  • FreeAllUsers() : cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp
  • FreeApplet() : applet.h , applet.cpp
  • FreeAppSecurityDescriptor() : Util.Cpp , Util.h
  • FreeAppShareChannel() : cshare.h , cShare.h , cShare.Cpp
  • FreeAs() : CChan.h , cshare.cpp
  • FreeBindingData() : common.cpp , common.h
  • FreeBindings() : common.h , common.cpp , common.h
  • FreeBuffer() : spi.cpp , provider.h
  • FreeCalls() : CCall.Cpp , CCall.h
  • FreeChannels() : CChan.Cpp , CChan.h
  • FreeColAccess() : common.cpp , common.h
  • FreeConference() : conf.cpp , CConf.Cpp , CConf.h , CConf.Cpp , CConf.h , conf.h
  • FreeConferences() : CConf.Cpp , CConf.h
  • FreeConfMgr() : CConf.Cpp , conf.cpp , CConf.Cpp , cMgr.h , CConf.h , cMgr.Cpp , CConf.h , conf.h
  • FreeConnection() : bankdlg.Cpp , bankthrds.Cpp
  • FreeConstraintDesc() : common.cpp , common.h
  • FreeContextBuffer() : Stubs.c
  • FreeCredentialsHandle() : Stubs.c
  • FreeData() : common.cpp , common.h
  • FreeDataChannel() : cData.Cpp , cData.h
  • FreeDllNodeInfo() : DebDebug.c
  • FreeDynamicReadwriteLock() : sync.c
  • FreeEventInfo() : dtevntsk.cpp
  • FreeEventItem() : mspaddr.cpp
  • FreeFontList() : Paint.c , Paint.h
  • FreeFreeAutoTest() : ComPerf.Cpp
  • FreeFreeCOMTest() : ComPerf.Cpp
  • FreeFt() : CChan.h , cft.cpp
  • FreeFtChannel() : CConf.Cpp
  • FreeGlobalObjects() : server.cpp
  • FreeJobs() : queue.h , queue.c
  • FreeKeyList() : keys.cpp , keys.h
  • FreeList() : RPCssmc.c
  • FreeLspMap() : instlsp.cpp
  • FreeMemory() : common.h , tapirecv.cpp , tapisend.cpp
  • FreeNmObjects() : CConf.Cpp , CConf.h
  • FreeNullDacl() : RegisterServer.Cpp
  • FreeODBCHandles() : MqTrans.Cpp
  • FreePlpv() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h
  • FreeProcessNodeInfo() : DebDebug.c
  • FreeProperties() : property.cpp , property.h , asserts.h , property.h , property.cpp , property.h , asserts.cpp , property.h , asserts.h , property.cpp , asserts.cpp , property.h , property.cpp
  • FreeProviders() : install.h , provider.cpp
  • FreeQueueData() : queue.c , queue.h
  • FreeRecvBuffer() : TestAccept.cpp
  • FreeSendBuffer() : TestAccept.cpp
  • FreeShareList() : Dlg.Cpp
  • FreeSocket() : Ioctl.c
  • FreeSocketsAndMemory() : spi.cpp
  • FreeSockInfo() : common.h , sockinfo.cpp , SockInfo.cpp , provider.h
  • FreeStmt() : quiktest.c
  • FreeStyle() : Style.Cpp
  • FreeStyles() : Global.h , Style.Cpp
  • FreeThreadNodeInfo() : DebDebug.c
  • FreeUnicodeString() : util.cxx , main.hxx
  • FreeUser() : cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h
  • FreeVariants() : property.cpp , property.h
  • FreeVblandPdu() : WSnmpUtil.h , WSnmpUtil.Cpp
  • FreeVirtualBuffer() : AsyncIO.c , AsyncIO.h
  • FreeWindowInfo() : GdiDemo.h , Wininfo.c
  • FServerFromClass() : Utility.h , Utility.c
  • FtpEnumDirectory() : FTPJr.cpp
  • FullDisconnect() : quiktest.c
  • FullViewWndProc() : WinCap.c , WinCap.h
  • FVerbGet() : Utility.h
  • FVerifyFile() : Main.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- g -

  • g_bstrAllApps() : selectEventsDlg.Cpp
  • g_bstrAppType_Application() : selectEventsDlg.Cpp
  • g_bstrAppType_Process() : selectEventsDlg.Cpp
  • GAKPageCallback() : PropShet.Cpp
  • GAKPageDlgProc() : PropShet.Cpp
  • GBGizmoAddA() : GizmoBar.h
  • GBGizmoAddW() : GizmoBar.h
  • GBGizmoCheck() : GizmoBar.h
  • GBGizmoDataGet() : GizmoBar.h
  • GBGizmoDataSet() : GizmoBar.h
  • GBGizmoEnable() : GizmoBar.h
  • GBGizmoExist() : GizmoBar.h
  • GBGizmoFocusSet() : GizmoBar.h
  • GBGizmoIntGet() : GizmoBar.h
  • GBGizmoIntSet() : GizmoBar.h
  • GBGizmoNotifyGet() : GizmoBar.h
  • GBGizmoNotifySet() : GizmoBar.h
  • GBGizmoRemove() : GizmoBar.h
  • GBGizmoSendMessage() : GizmoBar.h
  • GBGizmoShow() : GizmoBar.h
  • GBGizmoTextGetA() : GizmoBar.h
  • GBGizmoTextGetW() : GizmoBar.h
  • GBGizmoTextSetA() : GizmoBar.h
  • GBGizmoTextSetW() : GizmoBar.h
  • GBGizmoTypeGet() : GizmoBar.h
  • GBHwndAssociateGet() : GizmoBar.h
  • GBHwndAssociateSet() : GizmoBar.h
  • gbit_alloc() : gutils.h
  • gbit_findfree() : gutils.h
  • gbit_free() : gutils.h
  • gbit_init() : gutils.h
  • GenClientContext() : Security.cpp , Security.h
  • GeneralDlgProc() : gentab.c , global.h
  • GenerateUserName() : main.cpp
  • GenericPull() : pipe.cxx , pipe.hxx
  • GenericPush() : pipe.cxx , pipe.hxx
  • GenericStopHelper() : nshsamp.cpp
  • GenServerContext() : Security.cpp , Security.h
  • GetAccountSid() : LsaPrivs.c
  • GetActiveConference() : CConf.Cpp
  • GetAddress() : main.c , precomp.h
  • GetAddressFromCall() : Processing.cpp
  • GetAddressName() : Dialer.c
  • GetAddressToDial() : TapiCode.c
  • GetAddressType() : tapisend.cpp
  • GetAddrString() : Globals.h , Misc.c
  • GetAdminInstallInfo() : setup.h , utils.cpp
  • GetADSIError() : helper.cpp , helper.h , IADsError.cpp
  • GetAllocedPropInfo() : error.cpp , error.h
  • GetAlternateList() : RecoDll.cpp
  • GetAnInterface() : download.Cpp
  • GetApiErrorString() : AsyncDemo.cpp
  • GetAppbarData() : AppBar.c , AppBar.h
  • GetAppIDFromClsid() : custsur.Cpp
  • GetAppLite() : cdialoglite.cpp , cdialoglite.h
  • GetArgV() : cmsample.cpp
  • GetArraySize() : tracewmi.cpp
  • GetAssociatedExecutable() : getIcon.c , Utility.h
  • GetAsynchPhase() : error.cpp , error.h
  • GetAsynchReason() : error.cpp , error.h
  • GetAudioFormat() : Processing.cpp
  • GetAuthImp() : WbemSec.Cpp , WbemSec.h
  • GetBestAlternate() : RecoDll.cpp
  • GetBestResultString() : RecoDll.cpp
  • GetBitmap() : BitMap.c , BitMap.h
  • GetBitMapName() : error.cpp , error.h
  • GetBorder() : ioipf.h
  • GetBoundIpxAddr() : rnrcs.cpp
  • GetCallAsFactory() : Server.Cxx
  • GetCallerSocket() : provider.h , sockinfo.cpp
  • GetCallStateSz() : Debug.Cpp , Global.h
  • GetCanonicalFormatEtc() : ido.h
  • GetCert() : PropCert.Cpp
  • GetCertificateContextFromName() : RSACert.cpp , SignHash.cpp
  • GetCharFromGUID() : ADSIhelpers.cpp , ADSIhelpers.h
  • GetClassID() : ips.h
  • GetClientAndServerAddresses() : main.cpp
  • GetClientCoords() : common.cpp , common.h
  • GetClientDescriptor() : Main.h , Security.Cpp
  • GetClientImpToken() : Main.h , Security.Cpp
  • GetClientObscuredness() : Obscure.c
  • GetClientResponse() : RasHost.Cpp , RasHost.h
  • GetClientSite() : ioo.h
  • GetClientSize() : common.cpp , common.h
  • GetClientToken() : Main.h , Privobji.Cpp , Security.Cpp
  • GetClipboardData() : ioo.h
  • GetCollaborationStateSz() : Debug.Cpp , Global.h
  • GetCollection() : Adminwrap.Cpp , Adminwrap.h
  • GetColName() : common.cpp , common.h
  • GetColorDlg() : Colors.c
  • GetColorsResHandle() : Colors.c
  • GetColumnData() : queue.h , queue.c
  • GetColumnsInfo() : sampclnt.cpp , sampclnt.h
  • GetComponentInfo() : TPCInfo.cpp
  • GetCompositionStr() : FullIME.h , ImeUI.C
  • GetConferenceStateSz() : Debug.Cpp , Global.h
  • GetConfidenceLevel() : RecoDll.cpp
  • GetConfnSz() : Debug.Cpp , Global.h
  • GetConnection() : caccount.Cpp , updrec.Cpp , bankdlg.Cpp , bankthrds.Cpp
  • GetConsoleVersion() : globals.cpp , globals.h
  • GetContainer() : iocs.h
  • GetCorrectResourceHandle() : Open.c
  • GetCreateParams() : common.cpp , common.h
  • GetCreatorSD() : Main.h , Security.Cpp
  • GetCurrentCall() : CCall.Cpp , CCall.h
  • GetCurrentConference() : CConf.Cpp , CConf.h , cMgr.h
  • GetCurrentImpersonationLevel() : Service.cpp , BasicHiPerf.Cpp , Sample.h , Utils.Cpp , MethProv.Cpp , MethProv.h , PropProv.Cpp , WbemSec.Cpp
  • GetCurrentNode() : LinkList.c , LinkList.h
  • GetCurrentTimeAsFileTime() : IsapiTime.h , IsapiTime.cpp
  • GetCurrentTimeAsString() : IsapiTime.h , IsapiTime.cpp
  • GetCurrentTimeInMilliseconds() : IsapiTime.h , IsapiTime.cpp
  • GetCurrentTimeInSeconds() : IsapiTime.h , IsapiTime.cpp
  • GetCurrentUserPriority() : Service.cpp , Service.h , service.cpp , service.h
  • GetCurrentUserSID() : DComPerm.h , UtilS.Cpp
  • GetData() : ido.h , sampclnt.cpp , sampclnt.h
  • GetDataBuffer() : keys.cpp , keys.h
  • GetDataFromRowset() : sampclnt.cpp , sampclnt.h
  • GetDataHere() : ido.h
  • GetDBSessionFromDataSource() : sampclnt.cpp , sampclnt.h
  • GetDBType() : common.cpp , common.h
  • GetDBTypeMaxSize() : common.cpp , common.h
  • GetDBTypeName() : common.cpp , common.h , common.cpp , common.h
  • GetDebuggeeFileName() : DebMisc.c , DebMisc.h
  • GetDefaultCodepage() : SmpFilt.Cxx
  • GetDefaultGUIFont() : MultiUI.h , MultiWnd.C
  • GetDefaultHardLimit() : Commands.Cpp , Commands.h
  • GetDefaultQuota() : Commands.Cpp , Commands.h
  • GetDefaultThreshold() : Commands.Cpp , Commands.h
  • GetDeviceCapsDlgProc() : Common.h , Getcaps.c
  • GetDevmodeDlg() : Print.c
  • GetDevModes() : SetDisp.c , SetDisp.h
  • GetDevnamesDlg() : Print.c
  • GetDiagRecs() : quiktest.c
  • GetDialectName() : error.cpp , error.h
  • GetDIBFilename() : OpenDIB.c , OpenDIB.h
  • GetDirectoryObjectAttrib() : getdomainmode.cpp
  • GetDiskGeometry() : Mfmt.c
  • GetDlgItemPsz() : Global.h , Util.Cpp
  • GetDlgItemsRc() : Global.h
  • GetDllFileName() : DebDebug.c
  • GetDllFileNameFromList() : DebDebug.c
  • GetDMVersion() : quiktest.c
  • GetDomainMode() : getdomainmode.cpp
  • GetDTCUnknown() : RmWorker.Idl
  • GetDynamicReadwriteLock() : sync.c
  • GetEditBoxValue() : common.cpp , common.h , winmain.cpp , winmain.h
  • GetEEInfoText() : common.cpp , common.h , common.cpp , common.h
  • GetEncodedTicket() : KList.c
  • GetEntry() : Collect.cpp , Collect.h
  • GetError() : stdafx.h , odbcdata.h
  • GetErrorMessage() : helper.cpp , helper.h , IADsError.cpp
  • GetErrorMsg() : AppUtil.Cpp , AppUtil.h
  • GetErrorName() : error.cpp , error.h , error.cpp , error.h
  • GetErrorPosting() : error.h , error.cpp
  • GetErrorRecords() : error.cpp , error.h
  • GetErrors() : quiktest.c
  • GetEventClass() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • GetEventMessage() : rmapi.c
  • GetExecutionMode() : setup.h , utils.cpp
  • GetExeName() : AppUtil.Cpp , AppUtil.h
  • GetExtensionVersion() : adoisapi.cpp , ctetest.c , DumpVars.cpp , formdump.cpp , InvokObjThreads.cpp , areadcli.c , ftrans.c , fwasync.c , readcli.c , fwrite.c , KeepAlive.c , KeepAliveP.c , Redirect.cpp , Simple.cpp , WorkerThread.c , CacheIsapi.cpp , CustomAuth.cpp , DumpRequestInfo.cpp , Extension.cpp , HelloIsapi.cpp , Extension.cpp , ReMapUrl.cpp , UpCaseMap.cpp , WildCardMap.cpp
  • GetExtensionVersionWrapper() : PoolWrap.cpp
  • GetExtent() : ioo.h
  • GetField() : secClnt.Cpp , secSvr.Cpp
  • GetFileHandleAndSize() : WinHttpFormSubmitSample.cpp , WinHttpPostSample.cpp
  • GetFileName() : Dlgopen.c , WinCap.h
  • GetFileTimeAsString() : IsapiTime.h , IsapiTime.cpp
  • GetFileTimeFromString() : IsapiTime.h , IsapiTime.cpp
  • GetFileVersionNumber() : setup.h , utils.cpp
  • GetFilterVersion() : AuthFilt.c , UpCase.c , Redir401.cpp
  • GetFindDlg() : Find.c
  • GetFindDlgHandle() : Find.c
  • GetFirstByte() : keys.cpp
  • GetFirstGraphicSlot() : Paint.c , Paint.h
  • GetFirstNode() : LinkList.c , LinkList.h
  • GetFontDlg() : Font.c
  • GetFontDlgHandle() : Font.c
  • GetFontPref() : sdkdiff.cpp
  • GetFtChannel() : CConf.Cpp
  • GetFullFileOrDirName() : SidClean.c
  • GetGlobalInfo() : rmapi.c
  • GetGlobalSettings() : Utility.Cpp , Utility.h
  • GetGroupSidFromToken() : Util.Cpp , Util.h
  • GetGuide() : RecoDll.cpp
  • GetGuideIndex() : RecoDll.cpp
  • GetGuideLine() : GuidE.c , GuidE.h
  • GetGuids() : tracewmi.cpp
  • GetHdc() : Font.c
  • GetHelpFilePath() : globals.cpp , globals.h
  • GetHrSz() : Debug.Cpp , Global.h
  • GetIADsPropertyValueAsBSTR() : ADSIhelpers.cpp , ADSIhelpers.h , ADSIhelpers.cpp , ADSIhelpers.h
  • GetIconFromInstance() : Icons.C
  • GetIdentity() : CeapCfg.Cpp , Eap.c , Eap.h
  • GetImageDirectoryAndFileName() : dxsurf3.cpp , main.cpp
  • GetIniBool() : Global.h , Util.Cpp
  • GetIniHex() : Global.h , Util.Cpp
  • GetIniInt() : Global.h , Util.Cpp
  • GetIniStr() : Global.h , Util.Cpp
  • GetInk() : PAPINT.Idl
  • GetInterfaceConfigInfo() : rmapi.c
  • GetInterfaceName() : error.cpp , error.h , error.cpp
  • GetInternalTypeFromCSVType() : rowset.cpp , rowset.h
  • GetIntFromConfig() : Redir401.cpp
  • GetInvokeInfo() : session.cpp , session.h
  • GetItemType() : tracewmi.cpp
  • GetKeyBuffer() : keys.cpp , keys.h
  • GetKeyInfo() : keys.cpp , keys.h
  • GetKeyList() : keys.cpp , keys.h
  • GetKeyOffset() : keys.cpp , keys.h
  • GetLastErrorBox() : TextFx.c , ViewDIB.c
  • GetLastErrorText() : Service.C , SecFile.c , Service.c
  • GetLastNode() : LinkList.c , LinkList.h
  • GetLatticePtr() : RecoDll.cpp
  • GetLayeredEntriesByGuid() : instlsp.cpp
  • GetLBoxDw() : Dlg.Cpp
  • GetLineInfo() : Dialer.c
  • GetLineInfoFailed() : Dialer.c
  • GetListError() : LinkList.c , LinkList.h
  • GetLocaleString() : QSample.Cxx
  • GetLogFontDlg() : Font.c
  • GetLogonName() : Main.h , Security.Cpp
  • GetLPBYTEtoOctetString() : objectSid.cpp
  • GetMachineName() : MqTrans.Cpp
  • GetMapName() : error.cpp , error.h
  • GetMapping() : ReMapUrl.cpp
  • GetMaxDisplaySize() : common.cpp , common.h
  • GetMemoryInfo() : SysInf_C.c
  • GetMenuData() : common.cpp , common.h
  • GetMessageHelper() : IADsError.cpp
  • GetMetrics() : RecoDll.cpp
  • GetMiscStatus() : ioo.h
  • GetModuleFileNameFromHeader() : DebDebug.c
  • GetMofInfoHead() : tracedmp.cpp , tracewmi.cpp
  • GetMoniker() : iocs.h , ioo.h
  • GetNamedObjectFromCollection() : Adminwrap.Cpp , Adminwrap.h
  • GetNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • GetNewFspRegistryData() : NewFsp.h , Reg.c
  • GetNewId() : Stubs.c
  • GetNewMofInfo() : tracewmi.cpp
  • GetNewMove() : TServer.Idl
  • GetNextArgument() : setup.h , utils.cpp
  • GetNextByte() : keys.cpp
  • GetNextGraphicSlot() : Paint.c , Paint.h
  • GetNextLine() : main.cpp
  • GetNextName() : Render.Cpp
  • GetNextNode() : LinkList.c , LinkList.h
  • GetNextReceipt() : account.Idl
  • GetNextSlots() : hashtbl.cpp , hashtbl.h
  • GetNextToken() : sdkdiff.cpp
  • GetNmchSz() : Debug.Cpp , Global.h
  • GetNoteString() : dump.cpp , sampclnt.h
  • GetNoteStringBitvals() : dump.cpp , sampclnt.h
  • GetNumberOfSamplesOnStream() : Processing.cpp
  • GetObjectClsid() : clsid.Cpp , ShortName.h
  • GetObjectNameProperty() : Adminwrap.h
  • GetObjectTypeName() : error.cpp , error.h
  • GetODBCError() : caccount.Cpp , updrec.Cpp
  • GetOdbcError() : bankthrds.Cpp
  • GetOfflineLib() : app.cpp
  • GetOleDBErrorInfo() : QSample.Cxx
  • GetOleError() : Except.Cxx , Except.Hxx
  • GetOleObjectDataHere() : Utils.Cpp , Utils.h
  • GetOpenDlg() : Open.c , Open.h
  • GetOpenIconFileName() : IconPRO.C , IconPRO.h
  • GetOSVersion() : osv.Hxx
  • GetOurDataObject() : dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , Dataobj.Cpp , Dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp , dataobj.h , dataobj.Cpp
  • GetOutputDebugString() : DebDebug.c
  • GetOverlappedStructure() : overlap.cpp , provider.h
  • GetParameters() : dbh.cpp
  • GetParentObject() : bindtoparent.cpp
  • GetParentUrl() : Sample1.Cpp , Sample1.h
  • GetPasswordExpired() : SubAuth.c
  • GetPasswordFromResponse() : Eap.c , Eap.h
  • GetPathFromFullPathName() : DebMisc.c , DebMisc.h
  • GetPhaseName() : error.cpp , error.h
  • GetPingResponder() : Server.Idl
  • GetPostedByte() : keys.cpp
  • GetPostKeys() : keys.cpp
  • GetPreferredPacketDescription() : RecoDll.cpp
  • GetPrevNode() : LinkList.c , LinkList.h
  • GetPrincipalSID() : DComPerm.h , UtilS.Cpp
  • GetPrintDlg() : Print.c
  • GetPrintDlgHandle() : Print.c
  • GetPrinterDACL() : SecPrint.c
  • GetPrinterDC() : Print.c
  • GetPrinterDlgProc() : dialogs.c , dialogs.h
  • GetPrinterDriverDlgProc() : Common.h , Getpdriv.c
  • GetPrinterPath() : dialogs.c , dialogs.h
  • GetPrivateProfileSettings() : DebMisc.c , DebMisc.h
  • GetProcessSid() : SidClean.c
  • GetProgID() : common.h , common.cpp
  • GetPromotedType() : common.cpp , common.h
  • GetPropAddr() : keys.cpp
  • GetPropertiesFromWBEM() : tracewmi.cpp
  • GetProperty() : property.cpp , property.h , property.cpp , property.h , property.cpp
  • GetPropertyList() : dump.cxx , main.hxx
  • GetPropertyName() : error.cpp , error.h
  • GetPropertyRanges() : RecoDll.cpp
  • GetPropInfo() : property.cpp , property.h , property.cpp
  • GetPropInfoFlags() : property.cpp , property.h , property.cpp
  • GetPropSetName() : error.cpp , error.h
  • GetPropStatusName() : error.h , error.cpp
  • GetProviderCount() : instlsp.cpp
  • getPublicKeyBlob() : DirEncrypt.Cpp
  • GetQos() : GetQos.Cpp , QosEvent.h
  • GetQueryByte() : keys.cpp
  • GetQueryType() : PerfUtil.c , PerfUtil.h
  • GetQueue() : printjob.c
  • GetQuotaLogFlags() : Commands.h , Commands.Cpp
  • GetRadioButton() : Global.h , Util.Cpp
  • GetRangePropertyValue() : RecoDll.cpp
  • GetRCString() : autotest.h
  • GetRealTextExtent() : Fx.c
  • GetReasonName() : error.cpp , error.h
  • GetRecoAttributes() : RecoDll.cpp
  • GetRegDWORD() : clUtil.Cpp , clUtil.h
  • GetRegEntry() : common.cpp , common.h , common.cpp , common.h , common.cpp , common.h , common.cpp
  • GetRegEnumKey() : common.cpp , common.h
  • GetRegEnumValue() : common.cpp , common.h
  • GetRegKeyValue() : Reg.Cpp
  • GetRemoteEnv() : Remote.c
  • GetReplaceDlgHandle() : Find.c
  • GetRequestId() : policy.cpp
  • GetResultPropertyList() : RecoDll.cpp
  • GetResultStr() : ImeUI.C , FullIME.h
  • GetRowCnt() : quiktest.c
  • GetRowColName() : error.cpp , error.h
  • GetRowCount() : bankthrds.Cpp , bankdlg.Cpp
  • GetRowsetFromDBSession() : sampclnt.cpp , sampclnt.h
  • GetRSAKeyFromCert() : SignHash.cpp
  • GetRSAKeyFromContainer() : SignHash.cpp
  • GetRunAsPassword() : SrvcMgmt.Cpp , DComPerm.h
  • GetSampleID() : Processing.cpp
  • GetSampprovDataSource() : sampclnt.cpp , sampclnt.h
  • GetSaveIconFileName() : IconPRO.h , IconPRO.C
  • GetSchemaName() : cdialog.cpp , cdialog.h
  • GetScreenCenterCoord() : setupui.cpp
  • GetSegmentAlternateList() : RecoDll.cpp
  • GetSelectedMember() : cMemb.h , cMemb.Cpp
  • GetServerCallbackInterface() : Policy.h , exit.h , exit.cpp , Exit.Cpp , Policy.Cpp , Exit.h
  • GetSetupDlgHandle() : Print.c
  • GetSharedMemoryDataHeader() : AppMemi.h , ShareMem.c
  • GetSockAddrString() : rnrcs.cpp
  • GetSocket() : Sockdups.c
  • GetSomeData() : quiktest.c
  • GetSpecialFolder() : sendto.c
  • GetSqlErrorInfo() : error.cpp , error.h , error.cpp , error.h
  • GetState() : RmWorker.Idl
  • GetStaticPropInfo() : error.cpp , error.h
  • GetStaticPropValues() : error.h , error.cpp
  • GetStatusName() : error.cpp , error.h
  • GetStatusValue() : error.h , error.cpp
  • getstr() : dbh.cpp
  • GetStream() : SimpleLog.Idl
  • GetString() : bits_ie.cpp , RecoDll.cpp
  • GetStringAttribute() : util.h , util.cpp , util.h
  • GetStringByteSize() : ShortName.h , Cleanup.h
  • GetStringByteSizeUnicode() : Cleanup.h , ShortName.h
  • GetStringFromConfig() : Redir401.cpp
  • GetStringRes() : PlgBlt.c , Common.h , Printer.c , WxForm.c , WinUtils.c , LeakyBin.c , SpinTest.c , Generic.C , MfEdit.c , PlgBlt.h , StatList.c , MfEdit.h , SpinCube.c , WinUtils.h , Misc.c , Globals.h
  • GetStringRes2() : Printer.c , Common.h , MfEdit.h , MfEdit.c
  • GetStrokeRanges() : RecoDll.cpp
  • GetSupportedGeometrys() : Mfmt.c
  • GetSystemPalette() : Dibutil.c , Dibapi.h
  • GetSystemTimeAsUINT64() : bits_ie.cpp
  • GetTapeGUID() : stl_write.cpp
  • GetTargetClause() : Setcomp.c
  • GetTerminal() : FileTerm.h , Outgoing.Cpp , Incoming.Cpp
  • GetTerminalFromMediaEvent() : Processing.cpp
  • GetTerminalFromStreamEvent() : CallNot.cpp , Processing.cpp
  • GetTextExtent() : tprint.cpp
  • GetTextFromSTRRET() : Utility.h , Utility.Cpp
  • GetTextualSid() : TextSid.c , MainFrm.Cpp
  • GetThis() : common.h , common.cpp
  • GetTmWhereabouts() : CopyFileRm.Idl
  • GetTokenHandle() : TakeOwn.c
  • GetTransactionId() : RmWorker.Idl
  • GetTypeInfo() : quiktest.c
  • GetUIObjectOfAbsPidl() : sendto.c
  • GetUIObjectOfPath() : sendto.c
  • GetUrlKeys() : keys.cpp
  • GetUserClassID() : ioo.h
  • GetUserGroups() : service.h , Service.h , service.cpp , Service.cpp
  • GetUserInfoAndUpdateCookie() : CustomAuth.cpp
  • GetUsernameAndPassword() : Eap.c , Eap.h
  • GetUserPropertyMethods() : iasuser.cpp
  • GetUserQuotaInfo() : Commands.h , Commands.Cpp
  • GetUserSID() : Service.h , service.h , service.cpp
  • GetUserSid() : SecFile.c
  • GetUserSID() : Service.cpp
  • GetUserSidFromToken() : Util.Cpp , Util.h
  • GetUserType() : ioo.h
  • GetVariantSize() : marshalhelpers.h
  • GetVariantStyle() : ADSIhelpers.cpp , ADSIhelpers.h
  • GetVariantType() : common.cpp , common.h
  • GetVariantTypeName() : common.h , common.cpp
  • GetVersionInfo() : SysInf_C.c
  • GetVideoRenderTerminal() : Outgoing.Cpp , Incoming.Cpp
  • GetVideoRenderTerminalFromStreamEvent() : Callnot.Cpp
  • GetViewInterface() : Utility.Cpp , Utility.h
  • GetWindow() : ioipo.h , ioipao.h , ioips.h , ioipf.h
  • GetWindowContext() : ioips.h
  • GetWindowPos() : common.h , common.cpp
  • GetWindowSize() : common.h , common.cpp
  • GetWKDomainObject() : wkguid.cpp
  • GetWKOObject() : otherwko1.cpp , otherwko.cpp
  • GetWorkArea() : tallmenu.c
  • GetWorkerWindow() : asyncselect.cpp , provider.h
  • GetWorkQueueEntry() : ThreadPool.c , ThreadPool.h
  • GetXORImageRect() : Icons.C , Icons.h
  • gfile_new() : gfile.cpp , gutils.h
  • gfile_open() : gfile.cpp , gutils.h
  • gfThreadProc() : mspthrd.cpp
  • GiveFeedback() : ids.h
  • GiveUsage() : Simple.c
  • GLOBAL_() : sampprov.h
  • GlobalAllocP() : AppMem.h , AppMema.c
  • GlobalFreeP() : AppMema.c , AppMem.h
  • GLOBALINIT() : Global.h
  • GlobalReAllocP() : AppMem.h , AppMema.c
  • GoToLineDlgProc() : findgoto.h , findgoto.cpp , sdkdiff.h
  • GoWeb() : AppUtil.h , AppUtil.Cpp , AppUtil.h
  • GrabChunk() : DynOutp.c
  • gtab_alloclinedata() : table.cpp , tpriv.h
  • gtab_append() : table.cpp
  • gtab_boxcell() : tpaint.cpp , tpriv.h
  • gtab_buildtable() : table.cpp
  • gtab_calcwidths() : table.cpp , tpriv.h
  • gtab_changesel() : tscroll.cpp
  • gtab_createtools() : table.cpp
  • gtab_dblclick() : tscroll.cpp , tpriv.h
  • gtab_delcr() : tpaint.cpp
  • gtab_delcrW() : tpaint.cpp
  • gtab_deltable() : table.cpp , tpriv.h
  • gtab_deltools() : table.cpp
  • gtab_dohscroll() : tscroll.cpp , tpriv.h
  • gtab_dovscroll() : tscroll.cpp , tpriv.h
  • gtab_drawvertline() : tpaint.cpp , tpriv.h
  • gtab_enter() : tpriv.h , tscroll.cpp
  • gtab_extendsel() : tscroll.cpp
  • gtab_freelinedata() : table.cpp
  • gtab_hsep() : tpriv.h , tpaint.cpp
  • gtab_init() : gutils.cpp , tpriv.h , table.cpp
  • gtab_insideselection() : tscroll.cpp
  • gtab_invallines() : table.cpp , tpriv.h
  • gtab_invertsel() : tpaint.cpp , tpriv.h
  • gtab_isborder() : tscroll.cpp
  • gtab_key() : tscroll.cpp , tpriv.h
  • gtab_linetorow() : tpriv.h , tscroll.cpp
  • gtab_mousewheel() : tscroll.cpp , tpriv.h
  • gtab_move() : tpriv.h , tscroll.cpp
  • gtab_msg_hscroll() : tscroll.cpp , tpriv.h
  • gtab_msg_vscroll() : tscroll.cpp , tpriv.h
  • gtab_newsize() : table.cpp
  • gtab_paint() : tpaint.cpp , tpriv.h
  • gtab_paintcell() : tpaint.cpp
  • gtab_paintline() : tpriv.h , tpaint.cpp
  • gtab_paintunused() : tpriv.h
  • gtab_press() : tpriv.h , tscroll.cpp
  • gtab_print() : tprint.cpp , tpriv.h
  • gtab_printhead() : tprint.cpp
  • gtab_printjob() : tprint.cpp
  • gtab_printpage() : tprint.cpp
  • gtab_printsetup() : tprint.cpp
  • gtab_prtwidths() : tprint.cpp
  • gtab_release() : tpriv.h , tscroll.cpp
  • gtab_rightclick() : tscroll.cpp , tpriv.h
  • gtab_rowtoline() : tscroll.cpp , tpriv.h
  • gtab_select() : tscroll.cpp , tpriv.h
  • gtab_selhome() : tscroll.cpp
  • gtab_sendtq() : tpriv.h , table.cpp
  • gtab_setrects() : tprint.cpp
  • gtab_setsize() : tpriv.h , table.cpp
  • gtab_showsel() : tpriv.h , tscroll.cpp
  • gtab_showsel_middle() : tpriv.h , tscroll.cpp
  • gtab_trackcol() : tscroll.cpp
  • gtab_updatecontig() : tpaint.cpp
  • gtab_updateline() : tpaint.cpp
  • gtab_vsep() : tpriv.h , tpaint.cpp
  • gtab_wndproc() : table.cpp
  • gtab_xtocol() : tscroll.cpp
  • gtab_ytoline() : tscroll.cpp
  • GuidEventId() : MtsUserEventObj.Idl
  • GUIDtoBindableString() : otherwko1.cpp , otherwko.cpp
  • GuidToBstr() : activitysub.h , lbsub.h , qcsub.h , ObjPool2sub.h , appsub.h , exceptionsub.h , ComSpy.Cpp , Methodsub.h , evtstoresub.h , Identitysub.h , usersub.h , Objconstsub.h , txsub.Cpp , ObjPoolsub.h , Resourcesub.h , securitysub.h , instancesub.h , threadsub.h , Objsub.h , crmsub.h
  • GUIDToIndex() : RecoDll.cpp
  • GuidToSourceType() : cbase.cpp , cbase.h
  • GuidToString() : tracewmi.cpp , tracedmp.cpp
  • GuidToSz() : Global.h , Util.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- h -

  • HalftoneDialog() : halftone.c
  • HandleActiveReq() : filerepclientproc.cpp
  • HandleAddObjectCommand() : sample.cpp , nshsamp.h
  • HandleApplicationAccessOption() : DComPerm.Cpp
  • HandleApplicationLaunchAndActivateOption() : DComPerm.Cpp
  • HandleBreakPointException() : DebDebug.c
  • HandleCandPaint() : IMEApps.h , Paint.c
  • HandleChangeAttr() : IMEApps.h , Setcomp.c
  • HandleChangeColors() : Menu.c
  • HandleChar() : Comp.c , IMEApps.h
  • HandleCOMCallback() : bits_ie.cpp
  • HandleCommand() : Rebar.c
  • HandleCommEvent() : CommCode.c
  • HandleCompletion() : CacheIsapi.cpp , ReMapUrl.cpp , UpCaseMap.cpp
  • HandleComposition() : Comp.c , IMEApps.h
  • HandleConvertCommand() : IMEApps.h , Mode.c
  • HandleCreate() : Menu.c
  • HandleCreateProcessEvent() : DebDebug.c
  • HandleCreateThreadEvent() : DebDebug.c
  • HandleDefaultAccessOption() : DComPerm.Cpp
  • HandleDefaultLaunchOption() : DComPerm.Cpp
  • HandleDragDrop() : DragImg.Cpp
  • HandleDrawItem() : Menu.c
  • HandleEndComposition() : Comp.c , IMEApps.h
  • HandleError() : odbcsql.c , common.c , common.h , main.cpp
  • HandleErrors() : MQPort.Cpp
  • HandleEvent() : Overlap.c
  • HandleExceptionEvent() : DebDebug.c
  • HandleExecUrlCompletion() : CustomAuth.cpp
  • HandleExitProcessEvent() : DebDebug.c
  • HandleExitThreadEvent() : DebDebug.c
  • HandleFontCheckBox() : Font.c
  • HandleIniFileCorrupt() : TapiCode.c
  • HandleLineErr() : TapiCode.c
  • HandleLoadDllEvent() : DebDebug.c
  • HandleMachineAccessOption() : DComPerm.Cpp
  • HandleMachineLaunchAndActivateOption() : DComPerm.Cpp
  • HandleMenuPopup() : Rebar.c
  • HandleModeCommand() : IMEApps.h , Mode.c
  • HandleNoDevicesInstalled() : TapiCode.c
  • HandleNoDriver() : TapiCode.c
  • HandleNoMem() : TapiCode.c
  • HandleNoMultipleInstance() : TapiCode.c
  • HandleNotify() : OpenDIB.c , Comp.c , IMEApps.h , DragImg.Cpp
  • HandleOperationFailed() : TapiCode.c
  • HandleOutputDebugStringEvent() : DebDebug.c
  • HandlePaint() : Paint.c , Menu.c , IMEApps.h
  • HandlePopupMenu() : SetDisp.c , SetDisp.h , Menu.c
  • HandleReadData() : CommCode.c
  • HandleReadEvent() : CommCode.c
  • HandleReceivedMessage() : MQPort.Cpp
  • HandleReInit() : TapiCode.c
  • HandleReq() : FileRepClientProc.cpp , filerepclientproc.cpp
  • HandleResetAllCommand() : nshsamp.h , sample.cpp
  • HandleResetSprocketCommand() : nshsamp.h , sample.cpp
  • HandleResetWidgetCommand() : nshsamp.h , sample.cpp
  • HandleResourceUnavail() : TapiCode.c
  • HandleRipEvent() : DebDebug.c
  • HandlerRoutine() : SysInfo.h , SysInf_S.c
  • HandlerThreadWndProc() : Handler.Cpp , Handler.h
  • HandleRunAsOption() : DComPerm.Cpp
  • HandleSendPageCompletion() : CustomAuth.cpp
  • HandleSetGatewayCommand() : nshsamp.h , sampinterface.cpp
  • HandleSetInterfaceCommand() : nshsamp.h , sampinterface.cpp
  • HandleSetObjectCommand() : nshsamp.h , sample.cpp
  • HandleShowErrorCommand() : nshsamp.h , subcontext.cpp
  • HandleShowObjectCommand() : nshsamp.h , sample.cpp
  • HandleShowRandomSettingsCommand() : nshsamp.h , sampinterface.cpp
  • HandleSReq() : FileRepServerProc.cpp
  • HandleStartComposition() : Comp.c , IMEApps.h
  • HandleTheCommand() : CDTest.c , CDTest.h
  • HandleTimerTick() : bits_ie.cpp
  • HandleUnknownEvent() : DebDebug.c
  • HandleUnloadDllEvent() : DebDebug.c
  • HandleUpdate() : bits_ie.cpp
  • HandleWriteData() : CommCode.c
  • HandsOffStorage() : ips.h
  • HangupCall() : TapiCode.c , TapiCode.h
  • hash_string() : gutils.h , utils.cpp
  • HatchWndProc() : hatch.c
  • hBmpLoadBitmapFile() : MfEdit.c , MfEdit.h
  • hBrCreateBrush() : MfEdit.c , MfEdit.h
  • hCreateRGBPalette() : MfEdit.c
  • hDCRecordMetafileAs() : MfEdit.c , MfEdit.h
  • Header() : AsyncDemo.cpp , TextWnd.Cpp
  • HelloProc() : OHello.Idl , ClUuidp.c , Dyneptp.c , Hellop.c , CallAs.Idl
  • HelloProc2() : ClUuidp.c , ClUuids.c
  • HelpDlgProc() : WinCap.h
  • HelpScreen() : tapisend.cpp
  • helpstring() : ComSpy.Idl , MtsUserEventObj.Idl , BYOTTransaction.Idl , TxEnlister.Idl , CrmFilesTest.Idl , CrmMonComp.Idl , news.Idl , VCSecuritySample.Idl , ADOKB.Idl , OLEDBKB.Idl , RDOKB.Idl , data.Idl , GraphObj.Idl
  • hemfLoadMetafile() : MfEdit.c , MfEdit.h
  • HexDigitToInt() : keys.cpp
  • HexDumper() : formdump.cpp
  • HexToBin() : Util.Cpp
  • HexToData() : Global.h , Util.Cpp
  • HexToInt() : Settings.Cpp
  • HIconAndSourceFromClass() : getIcon.c , Utility.h
  • HIconFromClass() : Utility.c , Utility.h
  • Hilbert() : fulldrag.c
  • Hilbert_OnPaint() : fulldrag.c
  • Hilbert_WndProc() : fulldrag.c
  • HookAppShare() : cshare.cpp , cshare.h
  • HookCall() : CCall.Cpp , CCall.h
  • HookChannel() : cShare.Cpp , cShare.h , CChan.Cpp , CChan.h
  • HookConference() : CConf.Cpp , CConf.h , CConf.Cpp , CConf.h , CConf.Cpp , CConf.h
  • HookData() : cData.Cpp , cData.h , cData.Cpp , cData.h
  • HookFileTransfer() : cft.cpp , cft.h
  • HookFtChannel() : CConf.Cpp
  • HookWlxDialogBoxParam() : GinaDlg.c , GinaDlg.h
  • HostToWireFormat16() : Eap.c
  • HostToWireFormat32() : Eap.c
  • HostWindow() : Callnot.Cpp
  • HourGlassOff() : Utility.c , Utility.h
  • HourGlassOn() : Utility.c , Utility.h
  • HrCreateArgVariants() : util.cpp , util.h
  • HrCreateSafeArray() : util.cpp , util.h
  • HrDestroyArgVariants() : util.cpp , util.h
  • HRErrorToString() : InstCodc.Cpp
  • HRESULT() : cfactory.h , Priv.h
  • HrFormatStringIntoBSTR() : StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h
  • HrFormatStringWithVAListIntoBSTR() : StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h
  • HrGetSafeArrayBounds() : util.cpp , util.h
  • HrGetVariantElement() : util.cpp , util.h
  • HrGetWMIProperty() : WMIHelpers.cpp , WMIHelpers.h
  • HrInitializeWbemConnection() : WMIHelpers.cpp , WMIHelpers.h
  • HrLoadStringIntoBSTR() : StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h , StringUtils.cpp , StringUtils.h
  • HrMsg() : AppUtil.Cpp , AppUtil.h
  • HrMsgId() : AppUtil.Cpp , AppUtil.h
  • HrSetBlanket() : WMIHelpers.h , WMIHelpers.cpp
  • HrSetInitialize() : StdAfx.cpp , StdAfx.h
  • HrSetWbemServices() : WMIHelpers.h , WMIHelpers.cpp
  • HseIoCompletion() : ftrans.c , fwasync.c
  • HT_Cleanup() : hashtable.c , hashtable.h
  • HT_Create() : hashtable.c , hashtable.h
  • HT_DeleteEntry() : hashtable.h , hashtable.c
  • HT_Destroy() : hashtable.c , hashtable.h
  • HT_GetEntry() : hashtable.h , hashtable.c
  • HT_InsertEntry() : hashtable.c , hashtable.h
  • HT_IsPresentEntry() : hashtable.h , hashtable.c
  • HT_MapCar() : hashtable.c , hashtable.h
  • HtmlBeginAddress() : html.cpp , html.h
  • HtmlBeginBlockQuote() : html.cpp , html.h
  • HtmlBeginBold() : html.h , html.cpp
  • HtmlBeginCitation() : html.cpp , html.h
  • HtmlBeginCode() : html.h , html.cpp
  • HtmlBeginDefine() : html.cpp , html.h
  • HtmlBeginDefinition() : html.cpp , html.h
  • HtmlBeginDefinitionList() : html.h , html.cpp
  • HtmlBeginDefinitionTerm() : html.h , html.cpp
  • HtmlBeginEmphasis() : html.h , html.cpp
  • HtmlBeginFixed() : html.h , html.cpp
  • HtmlBeginHeading() : html.h , html.cpp
  • HtmlBeginItalic() : html.h , html.cpp
  • HtmlBeginKeyboard() : html.cpp , html.h
  • HtmlBeginListItem() : html.cpp , html.h
  • HtmlBeginNumberedList() : html.cpp , html.h
  • HtmlBeginPreformattedText() : html.h , html.cpp
  • HtmlBeginStatus() : html.h , html.cpp
  • HtmlBeginStrong() : html.h , html.cpp
  • HtmlBeginUnnumberedList() : html.h , html.cpp
  • HtmlBeginVariable() : html.h , html.cpp
  • HtmlBold() : html.h , html.cpp
  • HtmlBookmarkLink() : html.h , html.cpp
  • HtmlCreatePage() : html.h , html.cpp
  • HtmlDefinition() : html.h , html.cpp
  • HtmlEndAddress() : html.cpp , html.h
  • HtmlEndBlockQuote() : html.h , html.cpp
  • HtmlEndBold() : html.h , html.cpp
  • HtmlEndCitation() : html.h , html.cpp
  • HtmlEndCode() : html.cpp , html.h
  • HtmlEndDefine() : html.h , html.cpp
  • HtmlEndDefinitionList() : html.cpp , html.h
  • HtmlEndEmphasis() : html.h , html.cpp
  • HtmlEndFixed() : html.cpp , html.h
  • HtmlEndHeading() : html.h , html.cpp
  • HtmlEndItalic() : html.h , html.cpp
  • HtmlEndKeyboard() : html.cpp , html.h
  • HtmlEndNumberedList() : html.h , html.cpp
  • HtmlEndPage() : html.h , html.cpp
  • HtmlEndParagraph() : html.cpp , html.h
  • HtmlEndPreformattedText() : html.cpp , html.h
  • HtmlEndStatus() : html.h , html.cpp
  • HtmlEndString() : html.h
  • HtmlEndStrong() : html.cpp
  • HtmlEndUnnumberedList() : html.cpp , html.h
  • HtmlEndVariable() : html.cpp , html.h
  • HtmlFixed() : html.h , html.cpp
  • HtmlHeading() : html.cpp , html.h
  • HtmlHorizontalRule() : html.cpp , html.h
  • HtmlHyperLink() : html.cpp , html.h
  • HtmlHyperLinkAndBookmark() : html.cpp , html.h
  • HtmlImage() : html.h , html.cpp
  • HtmlItalic() : html.h , html.cpp
  • HtmlLineBreak() : html.cpp , html.h
  • HtmlPrintf() : html.h , html.cpp
  • HtmlWriteText() : html.h , html.cpp
  • HtmlWriteTextLine() : html.h , html.cpp
  • HtoA() : Misc.c , Globals.h
  • HtoB() : Globals.h , Misc.c
  • HttpExtensionProc() : adoisapi.cpp , KeepAlive.c , Extension.cpp , readcli.c , HelloIsapi.cpp , UpCaseMap.cpp , fwasync.c , InvokObjThreads.cpp , Redirect.cpp , fwrite.c , KeepAliveP.c , Simple.cpp , Extension.cpp , CustomAuth.cpp , ctetest.c , DumpVars.cpp , ftrans.c , CacheIsapi.cpp , formdump.cpp , WorkerThread.c , DumpRequestInfo.cpp , WildCardMap.cpp , ReMapUrl.cpp , areadcli.c
  • HttpExtensionProcWrapper() : PoolWrap.cpp
  • HttpFilterProc() : UpCase.c , Redir401.cpp , AuthFilt.c
  • HttpGetSocket() : Proto.H , Get_Sock.c
  • HttpReadFromCache() : cache.Cpp
  • HttpReadFromServer() : download.Cpp , Range.h
  • HttpReadRequest() : Range.h , cache.Cpp
  • HUGetLastError() : HuError.Cpp , HuError.h
  • HUPrintError() : HuError.Cpp , HuError.h
  • HUSetLastError() : HuError.Cpp , HuError.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- i -

  • I_lineGetAddressCaps() : TapiCode.c
  • I_lineGetAddressStatus() : TapiCode.c
  • I_lineGetCallStatus() : TapiCode.c
  • I_lineGetDevCaps() : TapiCode.c
  • I_lineNegotiateAPIVersion() : TapiCode.c
  • I_lineNegotiateLegacyAPIVersion() : TapiCode.c
  • I_lineTranslateAddress() : TapiCode.c
  • IADsError_GetErrorMessage_Proxy() : ADsError.h
  • IADsError_GetErrorMessage_Stub() : ADsError.h
  • IApplet_Advise_Proxy() : iapplet.h
  • IApplet_Advise_Stub() : iapplet.h
  • IApplet_CreateSession_Proxy() : iapplet.h
  • IApplet_CreateSession_Stub() : iapplet.h
  • IApplet_Initialize_Proxy() : iapplet.h
  • IApplet_Initialize_Stub() : iapplet.h
  • IApplet_RegisterAutoJoin_Proxy() : iapplet.h
  • IApplet_RegisterAutoJoin_Stub() : iapplet.h
  • IApplet_UnAdvise_Proxy() : iapplet.h
  • IApplet_UnAdvise_Stub() : iapplet.h
  • IApplet_UnregisterAutoJoin_Proxy() : iapplet.h
  • IApplet_UnregisterAutoJoin_Stub() : iapplet.h
  • IAppletNotify_AutoJoinSessionIndication_Proxy() : iapplet.h
  • IAppletNotify_AutoJoinSessionIndication_Stub() : iapplet.h
  • IAppletNotify_PermitToJoinSessionIndication_Proxy() : iapplet.h
  • IAppletNotify_PermitToJoinSessionIndication_Stub() : iapplet.h
  • IAppletSession_Advise_Proxy() : iapplet.h
  • IAppletSession_Advise_Stub() : iapplet.h
  • IAppletSession_ChannelRequest_Proxy() : iapplet.h
  • IAppletSession_ChannelRequest_Stub() : iapplet.h
  • IAppletSession_GetConfID_Proxy() : iapplet.h
  • IAppletSession_GetConfID_Stub() : iapplet.h
  • IAppletSession_InquireRoster_Proxy() : iapplet.h
  • IAppletSession_InquireRoster_Stub() : iapplet.h
  • IAppletSession_InvokeApplet_Proxy() : iapplet.h
  • IAppletSession_InvokeApplet_Stub() : iapplet.h
  • IAppletSession_IsThisNodeTopProvider_Proxy() : iapplet.h
  • IAppletSession_IsThisNodeTopProvider_Stub() : iapplet.h
  • IAppletSession_Join_Proxy() : iapplet.h
  • IAppletSession_Join_Stub() : iapplet.h
  • IAppletSession_Leave_Proxy() : iapplet.h
  • IAppletSession_Leave_Stub() : iapplet.h
  • IAppletSession_RegistryRequest_Proxy() : iapplet.h
  • IAppletSession_RegistryRequest_Stub() : iapplet.h
  • IAppletSession_SendData_Proxy() : iapplet.h
  • IAppletSession_SendData_Stub() : iapplet.h
  • IAppletSession_TokenRequest_Proxy() : iapplet.h
  • IAppletSession_TokenRequest_Stub() : iapplet.h
  • IAppletSession_UnAdvise_Proxy() : iapplet.h
  • IAppletSession_UnAdvise_Stub() : iapplet.h
  • IAppletSessionNotify_AllocateHandleConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_AllocateHandleConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_ChannelConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_ChannelConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_ChannelIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_ChannelIndication_Stub() : iapplet.h
  • IAppletSessionNotify_InquireRosterConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_InquireRosterConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_InvokeAppletConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_InvokeAppletConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_JoinSessionConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_JoinSessionConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_LeaveSessionIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_LeaveSessionIndication_Stub() : iapplet.h
  • IAppletSessionNotify_RegistryConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_RegistryConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_RosterReportIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_RosterReportIndication_Stub() : iapplet.h
  • IAppletSessionNotify_SendDataIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_SendDataIndication_Stub() : iapplet.h
  • IAppletSessionNotify_TestTokenConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_TestTokenConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_TokenConfirm_Proxy() : iapplet.h
  • IAppletSessionNotify_TokenConfirm_Stub() : iapplet.h
  • IAppletSessionNotify_TokenIndication_Proxy() : iapplet.h
  • IAppletSessionNotify_TokenIndication_Stub() : iapplet.h
  • IBSTRCompareW() : StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , StringUtils.h
  • IconChildWndProc() : MDIChild.C , MDIChild.h
  • IconDrawItem() : App32.C
  • IconImageFromBMPFile() : Icons.C , Icons.h
  • IconImageFromClipBoard() : Icons.C , Icons.h
  • IconImageToBMPFile() : Icons.C , Icons.h
  • IconImageToClipBoard() : Icons.C , Icons.h
  • iConvertStrToInt() : nlsapi.c
  • id() : ComSpyCtl.Idl , MtsSpyCtl.Idl , MtsUserEventObj.Idl , CrmFilesTest.Idl , data.Idl , GraphObj.Idl
  • IE_ActivateInterface() : networkentry.c , networkentry.h
  • IE_BindInterface() : networkentry.c , networkentry.h
  • IE_Create() : networkentry.c , networkentry.h
  • IE_DeactivateInterface() : networkentry.c , networkentry.h
  • IE_Delete() : networkentry.c , networkentry.h
  • IE_Destroy() : networkentry.c , networkentry.h
  • IE_Get() : networkentry.c , networkentry.h
  • IE_GetIndex() : networkentry.c , networkentry.h
  • IE_Insert() : networkentry.c , networkentry.h
  • IE_IsPresent() : networkentry.c , networkentry.h
  • IE_UnBindInterface() : networkentry.c , networkentry.h
  • if() : Utils.Cpp , suminfo.Cpp , Utils.Cpp
  • IgnoreType() : quiktest.c
  • IHelloCallAs_HelloProc_Proxy() : call_as.c
  • IHelloCallAs_HelloProc_Stub() : call_as.c
  • IHelloWorld_Say_Proxy() : ADsFirstExt.h
  • IHelloWorld_Say_Stub() : ADsFirstExt.h
  • ImeUIChangeCandidate() : FullIME.h , ImeUI.C
  • ImeUIClearData() : FullIME.h , ImeUI.C
  • ImeUICloseCandidate() : FullIME.h , ImeUI.C
  • ImeUIComposition() : FullIME.h , ImeUI.C
  • ImeUIEndComposition() : FullIME.h , ImeUI.C
  • ImeUIMoveCandWin() : FullIME.h , ImeUI.C
  • ImeUINotify() : FullIME.h , ImeUI.C
  • ImeUIOpenCandidate() : FullIME.h , ImeUI.C
  • ImeUISetOpenStatus() : FullIME.h , ImeUI.C
  • ImeUIStartComposition() : FullIME.h , ImeUI.C
  • IMMCControl_DoHelp_Proxy() : atlcontrol.h
  • IMMCControl_DoHelp_Stub() : atlcontrol.h
  • IMMCControl_StartAnimation_Proxy() : atlcontrol.h
  • IMMCControl_StartAnimation_Stub() : atlcontrol.h
  • IMMCControl_StopAnimation_Proxy() : atlcontrol.h
  • IMMCControl_StopAnimation_Stub() : atlcontrol.h
  • ImpersonateContext() : Security.cpp , Security.h
  • ImpersonateSecurityContext() : Stubs.c
  • IMPLEMENT_FIXED_ALLOC() : entity.Cpp , pooleddata.Cpp , string.Cpp , utils.Cpp
  • ImportCertificate() : CreateCert.c , CreateCert.h
  • importlib() : ComSpy.Idl , ComSpyAudit.Idl , CpyImage.Idl , fullsvr.Idl , iDog.Idl , PingResp.Idl , Server.Idl , pipesample.Idl , BYOTTransaction.Idl , TxEnlister.Idl , ComSyncObject.Idl , FreeObject.Idl , STAObject.Idl , CrmDebug.Idl , CrmFiles.Idl , CrmFilesTest.Idl , CrmMonComp.Idl , cascadeec.Idl , newseventclass.Idl , persistatl.Idl , Account.Idl , OPBank.Idl , LogWriter.Idl , QCNotify.Idl , QCOrder.Idl , QCShip.Idl , QCNotify.Idl , QCOrder.Idl , QCShip2.Idl , Disp1.Idl , VCSecuritySample.Idl , TServer.Idl , ADOKB.Idl , OLEDBKB.Idl , RDOKB.Idl , account.Idl , data.Idl , GraphObj.Idl , SampMsp.Idl , CertXSam.Idl , CertPSam.Idl , Catlpwr.Idl , CatlSmpl.Idl
  • IncrementLockCount() : cHello.Cxx , Server.Cxx
  • IncrementRefCount() : Server.Cxx
  • IndexInstalledCodecs() : InstCodc.Cpp
  • IndexToGUID() : RecoDll.cpp
  • InInOutPipesSample() : pipesample.Idl
  • init() : dbh.cpp
  • Init() : ComSpyAudit.Idl , MtsAudit.Idl , RmWorker.Idl , SimpleLog.Idl , AdminDll.c , sa.Cpp
  • Init1() : Admapit.c
  • Init2() : Admapit.c , AdminDll.c
  • InitAddressTypeComboBox() : Outgoing.Cpp
  • InitApp() : DoServer.Cpp , MidiPlyr.c , sendto.c
  • InitAppInstance() : InstCodc.Cpp
  • InitApplet() : applet.cpp , applet.h
  • InitApplication() : Generic.C , sdkdiff.cpp , WinMain.Cxx , SimpCntr.h , SimpDnd.h , SimpSvr.h , AptClien.Cpp , AptServe.Cpp , ComUser.Cpp , ConClien.Cpp , DcdServe.Cpp , DComDraw.Cpp , DllClien.Cpp , DllUser.Cpp , ExeSkel.Cpp , FreClien.Cpp , LicClien.Cpp , LocClien.Cpp , LocServe.Cpp , PerClien.Cpp , RemClien.Cpp , StoClien.Cpp , printjob.c , TextFx.c , TextFx.h , ViewDIB.c , halftone.c , GLOBALS.h , INIT.c , Globals.h , Init.c , Main.h , StatList.c , LeakyBin.c , ClipText.c , CDTest.c , CDTest.h , ComDlg32.C , ComDlg32.h , Property.c , Rebar.c , VListVw.c , VListVw.h , Cursor.c , Cursor.h , IMEApps.c , IMEApps.h , MultiUI.C , MultiUI.h , IconPRO.C , Globals.h , Main.c , DragImg.Cpp , DragImg.h
  • InitAuthorizationHeader() : HttpAuth.c , HttpAuth.h
  • InitBarClass() : bar.cpp , sdkdiff.h
  • InitClasses() : fakemenu.c
  • InitClipboardFormats() : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • InitColorStruct() : Colors.c
  • InitComServer() : Main.cpp
  • InitConfMgr() : CConf.Cpp , CConf.h , conf.cpp , conf.h , CConf.Cpp , CConf.h , cMgr.Cpp , cMgr.h
  • InitCustFilterString() : Open.c , Open.h
  • InitDbg() : Global.h
  • InitDC() : status.cpp
  • InitDialog() : bits_ie.cpp
  • InitDlgProc() : Client32.c , Client32.h
  • InitDllNodeInfo() : DebDebug.c
  • InitDragFeedback() : idt.h
  • InitEditCtls() : EDITCTLS.c , EDITCTLS.h
  • InitFaceLists() : Settings.Cpp
  • InitFail() : dxsurf1.cpp , dxsurf2.cpp
  • InitFileHandleCache() : openf.c , openf.h , openf.c , openf.h , openf.c , openf.h
  • InitFilterString() : Open.c , Open.h
  • InitFindStruct() : Find.c
  • InitFontStruct() : Font.c
  • InitFromData() : ioo.h
  • InitGlobals() : CDTest.c
  • InitGutils() : gutils.h
  • InitHashChars() : bar.cpp
  • InitHelperDll() : nshsamp.cpp , nshsamp.h
  • Initialise() : CSSamp.Cpp
  • Initialize() : data.Idl , CacheIsapi.cpp
  • InitializeAddressBox() : Dialer.c
  • InitializeApp() : MfEdit.c , MfEdit.h
  • InitializeCache() : AuthFilt.h , cache.c
  • InitializeChangeNotify() : PwdFilt.c
  • InitializeDynamicLocksStore() : sync.c , sync.h
  • InitializeFont() : textapi.c
  • InitializeFundsRM() : AuthzSvr.c
  • InitializeIsapiTime() : IsapiTime.h , IsapiTime.cpp
  • InitializeIsapiTools() : IsapiModule.h , IsapiModule.cpp
  • InitializeLineBox() : Dialer.c
  • InitializeMallocSpy() : malspy.h
  • InitializeNm() : cMgr.Cpp
  • InitializeRegistry() : Client.c
  • InitializeSecurity() : WbemSec.Cpp , WbemSec.h
  • InitializeSecurityContextW() : Stubs.c
  • InitializeSlotList() : hashtbl.cpp , hashtbl.h
  • InitializeStatusBar() : STATBAR.c , STATBAR.h
  • InitializeTapi() : FileTerm.cpp
  • InitializeTAPI() : TapiCode.c , Dialer.c , TapiCode.h , tapirecv.cpp , tapisend.cpp
  • InitializeTapi() : FileTerm.h , Incoming.Cpp , Outgoing.Cpp
  • InitializeUserDatabase() : AuthFilt.h , db.c
  • InitializeUserList() : Dlg.Cpp , Global.h
  • InitiateAsyncReceiveWithCompletionPort() : MQPort.Cpp
  • InitiateCall() : Dialer.c
  • InitIcmp6Header() : Ping.cpp
  • InitIcmpHeader() : Ping.cpp
  • InitIMEUIPosition() : IMEApps.c
  • InitInstance() : IconPRO.C , DragImg.h , ClipText.c , IMEApps.c , ComDlg32.C , SimpDnd.h , EventSink.cpp , printjob.c , Generic.C , sdkdiff.cpp , SimpCntr.h , SimpSvr.h , MidiPlyr.c , printjob.c , TextFx.c , TextFx.h , ViewDIB.c , halftone.c , Main.Cpp , Main.h , dxsurf3.cpp , StatList.c , LeakyBin.c , ClipText.c , CDTest.c , CDTest.h , ComDlg32.h , Property.c , Rebar.c , VListVw.c , VListVw.h , Cursor.c , Cursor.h , IMEApps.h , MultiUI.C , MultiUI.h , Globals.h , Main.c , DragImg.Cpp
  • InitIpv4Header() : rawudp.c
  • InitIpv6FragmentHeader() : rawudp.c
  • InitIpv6Header() : rawudp.c
  • InitLangList() : gentab.c
  • InitLBox() : Dlg.Cpp
  • InitList() : RPCssmc.c , RPCssmp.c
  • InitListView() : VListVw.c , VListVw.h , DragImg.Cpp
  • InitLogFontStruct() : Font.c
  • InitLsaString() : Audit.c , LsaPrivs.c
  • InitMainUI() : ui.cpp
  • InitMenuItemIDTable() : ImeMenu.c , IMEApps.h
  • InitNew() : ips.h
  • InitNLSFields() : nlsapi.c
  • InitOneFace() : Settings.Cpp
  • InitOneSize() : Settings.Cpp
  • InitOpenStruct() : Open.c , Open.h
  • InitOSVersion() : osv.Hxx , Main.Cxx
  • InitOverlappedCS() : provider.h
  • InitOverlappedManager() : overlap.cpp , provider.h
  • InitPackage() : Security.cpp , Security.h
  • InitPaper() : PAPINT.Idl
  • InitPrintStruct() : Print.c
  • InitProcessNodeInfo() : DebDebug.c
  • InitSecurity() : WMIDiskPerf.Cpp
  • InitSecurityInterfaceW() : Stubs.c
  • InitSelection() : Settings.Cpp
  • InitSession() : Security.cpp , Security.h
  • InitShareList() : Dlg.Cpp
  • InitStatusBar() : MainWND.c , Status.c , FontView.c
  • InitStringBuffer() : MultiWnd.C
  • InitStyles() : Global.h , Style.Cpp
  • InitText() : Global.h , Text.Cpp
  • InitThread() : Extension.cpp , PoolWrap.h
  • InitThreadNodeInfo() : DebDebug.c
  • InitThreadPool() : ThreadPool.c , ThreadPool.h , PoolWrap.cpp
  • InitToolBar() : FontView.c , Tools.c
  • InitToolbar() : MainWND.c , MidiPlyr.h
  • InitUdpHeader() : rawudp.c
  • InitUnicodeString() : SubAuth.c , KList.c
  • InitUserLBox() : Dlg.Cpp
  • InitUsernameDialog() : Eap.c , Eap.h
  • InitVariants() : property.cpp , property.h
  • InitWinsock() : Comm.cpp , Comm.h
  • InkDraw() : PAPINT.Idl
  • InkStart() : PAPINT.Idl
  • InkStop() : PAPINT.Idl
  • InOutList() : RPCssmp.c
  • InOutPipeSample() : pipesample.Idl
  • InOutProc() : InOutp.c
  • InPaletteBasedVideoMode() : Mypal.c
  • InPlaceDeactivate() : ioipo.h
  • InputChangeHandler() : Main.C
  • InputLoop() : dbh.cpp
  • Insert() : data.Idl
  • InsertCommand() : data.Idl
  • InsertDllNode() : DebDebug.c
  • InsertionSort() : InsertionSort.h
  • InsertListViewItems() : VListVw.c , DragImg.Cpp
  • InsertMenus() : ioipf.h
  • insertMsgString() : log.c
  • InsertNewNode() : Xmitu.h , Xmitp.c , Xmitu.c
  • InsertNode() : LinkList.h , LinkList.c
  • InsertOneRow() : quiktest.c
  • InsertProcessNode() : DebDebug.c
  • InsertSocketInfo() : provider.h , sockinfo.cpp
  • InsertSockInfo() : PrPerf.c
  • InsertStoredProcedure() : data.Idl
  • InsertTextAtSelection() : globals.h , hello.cpp
  • InsertThreadNode() : DebDebug.c
  • Install() : MtsSpyCtl.Idl , ComSpyCtl.Idl
  • InstallClass() : rnrcs.cpp
  • InstallDebugger() : DebugHandler.Cpp
  • InstallHook() : WinCap.h , Hook.c
  • InstallProvider() : instlsp.cpp
  • int() : GinaHook.h , GinaStub.h
  • InterfaceIdxToInterfaceIp() : IPRoute.Cpp , IPRoute.h , IPArp.Cpp , IPArp.h
  • InterfaceIpToIdxAndMask() : IPRoute.Cpp , IPRoute.h
  • InterfaceStatus() : rmapi.c
  • IntermediateCompletionRoutine() : overlap.cpp , provider.h
  • InternalAssert() : winmain.h , winmain.cpp
  • InternalTrace() : common.h , winmain.cpp , winmain.h , common.cpp , winmain.cpp
  • InternalTraceFmt() : common.h , common.cpp
  • InterpretCustomFilterString() : Open.c
  • IntroduceCardType() : SCIntro.Cpp
  • IntroduceReaderGroup() : SCIntro.Cpp
  • InvalidateClient() : Printer.c , Printer.h
  • InvalidateText() : Global.h , TextWnd.Cpp
  • IpxnetAddr() : Bcast.c
  • Is3XDriver() : quiktest.c
  • Is4OrMore() : MainDll.Cpp
  • Is911() : Dialer.c
  • IS_BUFFER_ENOUGH() : main.cpp , queryusers.cpp , otherwko1.cpp , CreateUserHelpers.cpp , getschemainfo.cpp
  • IsAdmin() : utils.cpp , setup.h
  • IsapiAssert() : IsapiDebug.h , IsapiDebug.cpp
  • IsapiWriteLog() : PoolWrap.h , PoolWrap.cpp
  • IsAudioStream() : Processing.cpp
  • IsBusy() : sdkdiff.cpp
  • IsChanged() : queue.c , queue.h
  • IsCName() : compitem.cpp
  • IsCompositeDataObject() : globals.h , globals.cpp
  • IsCreateExisting() : MMStrm.Cxx
  • IsDBCSTrailByte() : Main.C
  • IsDirty() : ips.h
  • IsDocName() : compitem.cpp
  • IsDriveLetter() : DLEdit.Cpp
  • IsDsEnabledLocaly() : MqTrans.Cpp
  • IsEqualDBID() : common.h , common.cpp
  • IsEqualProtocolEntries() : instlsp.cpp
  • IsEqualUnknown() : globals.h , globals.cpp
  • IsEscapeSequence() : IsapiString.cpp
  • IsFileTrusted() : setup.h , vertrust.cpp
  • IsFixedType() : common.cpp , common.h , common.cpp
  • IsGroupMember() : Service.cpp , service.cpp , service.h , Service.h
  • IsIdInChain() : instlsp.cpp
  • IsInAuthorizationSequence() : HttpAuth.h , HttpAuth.c
  • IsKeyEaten() : keys.cpp
  • IsKeySeparator() : keys.cpp
  • IsLegacySecurityModel() : UtilS.Cpp , DComPerm.h
  • IsMessageForActiveCall() : Processing.cpp
  • IsMMCMultiSelectDataObject() : dataobj.h , Dataobj.h
  • IsMsiUpgradeNecessary() : upgrdmsi.cpp , setup.h
  • IsNodeOnList() : msputils.cpp , defs.h
  • IsNT() : SetDisp.h , SetDisp.c
  • IsNT4OrBetter() : main.cpp
  • IsNumberInUnicodeList() : PerfUtil.h , PerfUtil.c , PerfUtil.h , PerfUtil.c
  • IsNumericType() : common.h , common.cpp , common.h
  • ISO() : Sample1.Cpp , Sample1.h
  • IsOleError() : Except.Cxx
  • IsOSSupported() : utils.cpp , setup.h
  • IsPackageTrusted() : setup.h , vertrust.cpp
  • IsPartitionHidden() : DLEdit.Cpp
  • IsPrinterHandle() : printjob.c
  • IsRangeCovered() : globals.h , globals.cpp
  • IsRenderingStream() : Processing.cpp
  • IsSecureClient() : filerepclientproc.cpp , FileRepClientProc.cpp
  • IsServiceRunning() : Admapit.c
  • IsSettableProperty() : property.cpp , property.h , property.cpp , property.h
  • IsSharingEnabled() : Dlg.Cpp , Global.h
  • IsSpecialPropSet() : error.h , error.cpp
  • IsStringInList() : Policy.Cpp
  • IssueQuery() : QSample.Cxx
  • IsSupportedProperty() : property.h , property.cpp
  • IStringCompareW() : PropList.cpp , StringUtils.cpp , PropList.cpp , StringUtils.h , StringUtils.cpp , PropList.cpp , StringUtils.cpp , StringUtils.h , StringUtils.cpp , PropList.h , PropList.cpp , StringUtils.h , PropList.h , StringUtils.cpp
  • IsUnicodeOS() : common.cpp , common.h
  • IsUpdateRequiredVersion() : upgrdmsi.cpp , setup.h
  • IsUpToDate() : ioo.h
  • IsValidAddress() : llistimpl.cpp , llistimpl.h , llistimpl.cpp , llistimpl.h , llistimpl.cpp , llistimpl.h , llistimpl.cpp , llistimpl.h , llistimpl.cpp
  • IsValidAudioFile() : tapisend.cpp
  • IsValidDir() : Helper.Cpp , Helper.h
  • IsVariableType() : common.cpp , common.h , common.cpp , common.h
  • IsVideoCaptureStream() : Incoming.Cpp , Outgoing.Cpp
  • IsViewWindow() : Utility.h , Utility.Cpp
  • iswildpath() : scandir.cpp
  • IsWindowsXP_orLater() : DLEdit.Cpp
  • IsWordChar() : lrsample.CXX
  • ItemConfigDlgProc() : Settings.h , Settings.Cpp
  • ItemDataDlgProc() : Utility.h , Utility.Cpp
  • ItemFromPApp() : chWnd.Cpp
  • ItemFromPUser() : cMemb.Cpp
  • iTT() : MfEdit.h , MfEdit.c
  • IUPnPService_DimmingService_SCPD_get_dimLevel_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_get_dimLevel_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_get_Power_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_get_Power_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetConfigDetails_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetConfigDetails_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetDimLevel_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetDimLevel_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetPowerValue_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_GetPowerValue_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOff_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOff_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOn_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_PowerOn_Stub() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_SetDimLevel_Proxy() : MyDevice.h
  • IUPnPService_DimmingService_SCPD_SetDimLevel_Stub() : MyDevice.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- p -

  • PackageConnectLookup() : KList.c
  • PacketCreate() : packet.c , packet.h
  • PacketDestroy() : packet.c , packet.h
  • PacketizeIpv4() : rawudp.c
  • PacketizeIpv6() : rawudp.c
  • PActualFromPUser() : malspy.c
  • Page0Proc() : PhoneEntry.c
  • Page1Proc() : PhoneEntry.c
  • Page2Proc() : PhoneEntry.c
  • Paint() : TextWnd.Cpp , Common.h , Paint.c , SpinCube.c
  • PaintBitmap() : Copy.c , Dibapi.h
  • PaintDIB() : Copy.c , Dibapi.h
  • PaintFormattedRun() : DspFormt.Cpp
  • PaintFormattedText() : DspFormt.Cpp , Global.h
  • PaintFormattedTextLine() : DspFormt.Cpp
  • PaintFormattedTextPara() : DspFormt.Cpp
  • PaintLogical() : DspLogcl.Cpp , Global.h
  • PaintPlainText() : DspPlain.Cpp , Global.h
  • PaintPlainTextLine() : DspPlain.Cpp
  • PaintProc() : GdiDemo.h , GdiDemo.c
  • PaintTime() : TIMEWND.c
  • PaintWindow() : AppUtil.Cpp , AppUtil.h , Dialog.c , GdiDemo.h
  • PalEntriesOnDevice() : Dibapi.h , Dibutil.c
  • PaletteSize() : Dibapi.h , Dibutil.c , Dib.c , Dib.h
  • Parameters_get_Item_Proxy() : adoint.h
  • Parameters_get_Item_Stub() : adoint.h
  • parse_command() : DbgCmd.c
  • ParseAndDump() : PathParser.cpp
  • ParseAndPrintv2Trap() : Helper.Cpp , WSnmpUtil.h
  • ParseArgs() : sdkdiff.cpp
  • ParseArguments() : main.cpp , TestAccept.cpp
  • ParseAuthorityUserArgs() : WbemSec.Cpp
  • ParseCmdLine() : bthcxn.cpp , Main.Cpp
  • ParseCommand() : FTPJr.cpp
  • ParseCommandLine() : main.cpp , Helper.Cpp , WSnmpUtil.h , msistuff.cpp , dxsurf3.cpp
  • ParseDateTime() : HtmlProp.Cxx
  • ParseParams() : HeadDump.cpp
  • ParsePropertyFile() : HtmlProp.Cxx
  • ParserAutoInstallInfo() : blrplate.c
  • PasswordChangeNotify() : PwdFilt.c
  • PasswordFilter() : PwdFilt.c
  • PatchQuery() : adoisapi.cpp
  • PCONTEXT_HANDLE_TYPE_rundown() : filerepserverproc.cpp , Cxhndlp.c
  • Perform() : account.Idl
  • PerfThread() : PrPerf.c , PrSamp.h
  • persistMediaID() : app.cpp , app_utls.cpp
  • persistPoolID() : app.cpp , app_utls.cpp
  • PhysAddrToString() : IPArp.Cpp , IPArp.h
  • PicAlloc() : Picklpc.c , Pickltc.c
  • PickUpProfile() : sdkdiff.cpp
  • PicRead() : Picklpc.c , Pickltc.c
  • PicWrite() : Picklpc.c , Pickltc.c
  • Pidl_Concatenate() : enumdesk.cpp , enumdesk.h
  • Pidl_Copy() : enumdesk.cpp , enumdesk.h
  • Pidl_Create() : enumdesk.cpp
  • Pidl_Free() : enumdesk.cpp , enumdesk.h
  • Pidl_GetNextItem() : enumdesk.cpp
  • Pidl_GetSize() : enumdesk.cpp
  • PidlFromPath() : sendto.c
  • Ping() : Server.c
  • pipe_in() : client.cxx
  • pipe_in_out() : client.cxx
  • pipe_out() : client.cxx
  • PipeAlloc() : Pipec.c
  • pipeCheck() : NmPipe.c
  • PipePull() : Pipec.c
  • PipePush() : Pipec.c
  • pipes_in_in_out() : client.cxx
  • pLoadMltFmtFile() : MfEdit.c , MfEdit.h
  • PointerToNthField() : getIcon.c , Utility.h
  • polFindObjIdInList() : policy.cpp , policy.h
  • polGetCertificateExtension() : policy.cpp , policy.h
  • polGetCertificateLongProperty() : policy.cpp , policy.h
  • polGetCertificateStringProperty() : policy.cpp , policy.h
  • polGetLongProperty() : policy.cpp
  • polGetProperty() : policy.cpp
  • polGetRequestAttribute() : policy.cpp , policy.h
  • polGetRequestLongProperty() : policy.cpp , policy.h
  • polGetRequestStringProperty() : policy.cpp , policy.h
  • polGetServerCallbackInterface() : policy.cpp , policy.h
  • polGetStringProperty() : policy.cpp
  • Poll() : sdkdiff.cpp , sdkdiff.h
  • PollingUpdate() : threads.c , threads.h
  • polSetCertificateExtension() : policy.cpp , policy.h
  • PolyCommandProc() : Poly.c , Poly.h
  • PolyCreateProc() : Poly.c , Poly.h
  • PolyDestroyProc() : Poly.c , Poly.h
  • PolyDraw95() : MfEdit.c , Fx.c
  • PolyDrawBez() : Poly.c , Poly.h
  • PolyInitPoints() : Poly.c , Poly.h
  • PolyNewVel() : Poly.c , Poly.h
  • PolyPaintProc() : Poly.c , Poly.h
  • PolyProc() : Poly.c , Poly.h
  • PolyRedraw() : Poly.c , Poly.h
  • PopulateADSAttrInfo() : main.cpp
  • PopulateAttrInfoFromFile() : main.cpp
  • PopulateBuffer() : pipe.cxx , pipe.hxx
  • PopulateComboBoxFromStringList() : helper.cpp , helper.h
  • PopulateListBoxFromStringList() : helper.cpp , helper.h
  • PopUpAssert() : altassrt.Cxx , assert.h
  • PopUpError() : altassrt.Cxx
  • PositionHeader() : VListVw.c
  • Post() : account.Idl
  • PostError() : setup.h , utils.cpp
  • PostFormattedError() : setup.h , utils.cpp
  • PostHangupCall() : TapiCode.c , TapiCode.h
  • PostJobStatus() : NewFsp.h , Util.c
  • PostMsiError() : setup.h , utils.cpp
  • PostProcessString() : common.cpp , common.h
  • PostRecvfrom() : Ping.cpp
  • PostResourceNotFoundError() : setup.h , utils.cpp
  • PostWriteToDisplayCtl() : EDITCTLS.c , EDITCTLS.h
  • PreConfigureDevice() : TapiCode.c
  • PreferencesDlgProc() : DebMain.c
  • PrepareRecvBuffer() : TestAccept.cpp
  • PrepareSendBuffer() : TestAccept.cpp
  • PrepareSendMessageProperties() : MqTrans.Cpp
  • PrepareTx() : RmWorker.Idl
  • PrerollAndWait() : MainWND.c
  • PreviewWindowHookProc() : OpenDIB.c
  • PrimarySTAThreadProc() : Cancel.Cpp
  • print_token() : GssMisc.c
  • PrintAbortDlg() : Print.c
  • PrintAbortProc() : Print.c
  • PrintAddress() : resolve.c , resolve.h , resolve.c , resolve.h , resolve.cpp , resolve.h , resolve.c , resolve.h
  • PrintAddressString() : common.cpp , common.h , TestAccept.cpp , Sockdups.c
  • PrintBand() : Print.c
  • PrintClearStats() : Admapit.c
  • PrintColumn() : dump.cpp , sampclnt.h , main.hxx , util.cxx
  • PrintDbgMessage() : Helper.Cpp , WSnmpUtil.h
  • PrintDefaultLimitsMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintDefaultQuotaMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintDeviceStatus() : Simple.c
  • PrintDIB() : Dibapi.h , Print.c
  • PrintDIBSection() : ViewDIB.c
  • PrintDlgProc() : APP.Cxx , View.Hxx , Dialogs.c , WinCap.h
  • PrintDumpHeader() : tracedmp.cpp
  • PrintError() : MqTestOA.Cpp , Bcast.c , rnrcs.cpp , UtilLib.h , Utils.Cpp , Commands.Cpp , Commands.h
  • PrintErrorAndAsk() : UtilLib.h , Utils.Cpp
  • PrintErrorAndExit() : UtilLib.h , Utils.Cpp
  • PrintErrorMessage() : Client.Cxx , error.Cxx , Server.Cxx
  • PrintErrorText() : util.cpp , util.h
  • PrintEType() : KList.c
  • PrintEvent() : tracedmp.cpp
  • Printf() : dballoc.h
  • printf() : Test.Cxx
  • PrintGeometry() : Mfmt.c
  • PrintGetStringError() : Admapit.c
  • PrintHelpMessage() : tracedmp.cpp , TraceLog.c
  • PrintHexDump() : Security.cpp , Security.h
  • PrintHookProc() : Print.c
  • PrintIADSObject() : main.cpp , CreateUserHelpers.cpp , CreateUserHelpers.h , ADSIhelpers.cpp , ADSIhelpers.h
  • PrintIcmpStats() : IPStat.Cpp , IPStat.h
  • PrintIgmpHeader() : parser.c
  • PrintInterfaceList() : rcvall.c
  • PrintIpAddrTable() : IPArp.Cpp , IPArp.h
  • PrintIpForwardTable() : IPRoute.Cpp , IPRoute.h
  • PrintIpListenRecords() : iplisten.c
  • PrintIpNetTable() : IPArp.Cpp , IPArp.h
  • PrintIpStats() : IPStat.Cpp , IPStat.h
  • PrintIpv4Header() : parser.c
  • PrintItemName() : wiassamp.cpp
  • PrintKerbName() : KList.c
  • PrintList() : RPCssmc.c , RPCssmp.c
  • PrintLoggerStatus() : TraceLog.c
  • PrintLongFormat() : enum.cxx
  • PrintLspMap() : instlsp.cpp
  • PrintMainMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintMe() : WinCap.c , WinCap.h
  • PrintMultiProc1() : Print.c
  • PrintMultiProc2() : Print.c
  • PrintOidValue() : Helper.Cpp , WSnmpUtil.h
  • PrintPayload() : Ping.cpp
  • PrintPriv() : Admapit.c
  • PrintProc() : Print.c , Print.h
  • PrintProcFailureEEInfo() : common.cpp , common.h , common.cpp , common.h
  • PrintProcTable() : spi.cpp
  • PrintProperty() : util.cxx , main.hxx
  • PrintProtocolInfo() : install.h , prnpinfo.cpp
  • PrintProviders() : instlsp.cpp
  • PrintQos() : PrintQos.Cpp , QosEvent.h , ATMEvent.h
  • PrintQuotaLogFlagMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintQuotaManagerMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintRawBytes() : parser.h
  • PrintResultCode() : Range.c
  • PrintSafeArray() : QSample.Cxx
  • PrintScreen() : Dibapi.h , Print.c
  • PrintSpace() : DispTree.Cxx
  • PrintSslRecord() : ssl.c
  • PrintSummary() : tracedmp.cpp
  • PrintTcpHeader() : parser.c
  • PrintTcpStats() : IPStat.Cpp , IPStat.h
  • PrintThread() : Printer.c , Printer.h
  • PrintTime() : KList.c
  • PrintTktFlags() : KList.c
  • PrintToScreen() : MainFrm.h , MqApiTst.Cpp
  • PrintUdpHeader() : parser.c
  • PrintUdpStats() : IPStat.Cpp , IPStat.h
  • PrintUrlAclRecord() : url.c
  • PrintUsage() : Sample1.Cpp , Sample1.h , main.hxx , util.cxx , FileRep.cpp , filerep.cpp , main.cpp , TestAccept.cpp , RequestCert.Cpp , CreateCert.c , RSACert.cpp , RSAKey.cpp , SessionKey.cpp , HttpGet.c , CreateCert.h , SignHash.cpp , filerep.cpp , util.cxx
  • PrintUserManagerMenu() : PrintMenu.Cpp , PrintMenu.h
  • PrintVarBind() : WSnmpUtil.h , Helper.Cpp
  • PrintVariant() : main.hxx , util.cxx
  • PrintVariantArray() : main.hxx , util.cxx
  • PrintVectorItems() : DispTree.Cxx , QSample.Cxx
  • PrintWindowSamp() : Dibapi.h , Print.c
  • Privilege() : Check_SD.h , Helper.c
  • ProcConnectionClearStat() : Admapit.c
  • ProcConnectionGetInfo() : Admapit.c
  • Process() : RecoDll.cpp , Main.cpp , QCShip2.Idl , QCNotify.Idl , QCShip.Idl , QCNotify.Idl , QCOrder.Idl , Main.cpp , QCOrder.Idl
  • Process_DecoupledEvent() : Main.cpp
  • Process_DecoupledEventConsumer() : Main.cpp
  • Process_DecoupledInstance() : Main.cpp
  • Process_DecoupledRestrictedEvent() : Main.cpp
  • ProcessAcceptEvent() : common.cpp , common.h
  • ProcessAgentResponse() : WSnmpUtil.Cpp , WSnmpUtil.h
  • ProcessArgs() : main.cxx , main.hxx
  • ProcessArguments() : security.cpp
  • ProcessAsyncSelectMessage() : ASAccept.cpp
  • ProcessCallMediaEvent() : Processing.cpp
  • ProcessCallNotificationEvent() : Processing.cpp
  • ProcessCallStateEvent() : Processing.cpp
  • ProcessCDError() : ComDlg32.C , ComDlg32.h
  • ProcessCleanup() : ui.cpp
  • ProcessCommandLineArguments() : AsyncIO.h , AsyncIO.c
  • ProcessCommandsWndProc() : DebMain.c
  • ProcessDefaultLimitsMenu() : ProcessMenu.Cpp , ProcessMenu.h
  • ProcessDefaultQuotaMenu() : ProcessMenu.Cpp , ProcessMenu.h
  • ProcessLogoff() : CustomAuth.cpp
  • ProcessLogon() : CustomAuth.cpp
  • ProcessMainMenu() : ProcessMenu.Cpp , ProcessMenu.h
  • ProcessNotification() : WSnmpUtil.Cpp , WSnmpUtil.h
  • ProcessOrderFunction() : DebDebug.c
  • ProcessQuotaLogFlagMenu() : ProcessMenu.h , ProcessMenu.Cpp
  • ProcessQuotaManagerMenu() : ProcessMenu.h , ProcessMenu.Cpp
  • ProcessReadEvent() : common.h , common.cpp
  • ProcessReadFileCompletion() : AsyncIO.c , AsyncIO.h
  • ProcessRequest() : AsyncIO.h , DumpRequestInfo.cpp , AsyncIO.c
  • ProcessRetCode() : MqTrans.Cpp
  • ProcessSearchFile() : AsyncIO.h , AsyncIO.c
  • ProcessStartup() : ui.cpp
  • ProcessUserAccounts() : Process.cpp
  • ProcessUserManagerMenu() : ProcessMenu.h , ProcessMenu.Cpp
  • ProcPortClearStat() : Admapit.c
  • ProcPortDisconnect() : Admapit.c
  • ProcPortGetInfo() : Admapit.c
  • ProcPortReset() : Admapit.c
  • ProfCloseLog() : prof.cpp , prof.h , prof.cpp , prof.h , Prof.cpp , prof.h , Prof.h
  • ProfOpenLog() : Prof.cpp , prof.h , prof.cpp , Prof.h , prof.h
  • ProfRecordTime() : Prof.cpp , Prof.h , prof.cpp , prof.h , prof.cpp , prof.h , prof.cpp , prof.h
  • ProgId() : CrmMonComp.Idl
  • ProgressProc() : setupui.cpp
  • prompt() : dbh.cpp
  • PropDlgProc() : APP.Cxx , APP.Hxx
  • Properties_get_Item_Proxy() : adoint.h
  • Properties_get_Item_Stub() : adoint.h
  • Property_get_Attributes_Proxy() : adoint.h
  • Property_get_Attributes_Stub() : adoint.h
  • Property_get_Name_Proxy() : adoint.h
  • Property_get_Name_Stub() : adoint.h
  • Property_get_Type_Proxy() : adoint.h
  • Property_get_Type_Stub() : adoint.h
  • Property_get_Value_Proxy() : adoint.h
  • Property_get_Value_Stub() : adoint.h
  • Property_put_Attributes_Proxy() : adoint.h
  • Property_put_Attributes_Stub() : adoint.h
  • Property_put_Value_Proxy() : adoint.h
  • Property_put_Value_Stub() : adoint.h
  • PropertyValueToString() : helper.cpp , helper.h
  • PropSheet() : PhoneEntry.c
  • PropSheetCallback() : Property.c
  • PROTOTYPE() : GssAPI.h , Gss-Misc.h , GssAPI.h , Gss-Misc.h , GssAPI.h , Gss-Misc.h , GssMisc.c
  • ProviderInstall() : Atsp.h , Atsp.c
  • PruneLspMap() : instlsp.cpp
  • PszAlloc() : Util.Cpp , Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h
  • PszFromBstr() : clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp , session.cpp
  • PTRegister() : pluggable.cpp
  • PTRegisterPluggable() : pluggable.cpp
  • PTUnregister() : pluggable.cpp
  • PurgeTicket() : KList.c
  • PUserFromINmMember() : cMemb.Cpp , cMemb.h , cMemb.Cpp
  • PUserFromPActual() : malspy.c
  • PUserLocal() : cMemb.h , cMemb.Cpp
  • PutbackOverlappedStructure() : provider.h , overlap.cpp
  • PutPlayList() : FileTerm.h , FileTerm.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- q -

  • qtDisplayError() : quiktest.c , quiktest.h
  • qtMakeData() : quiktest.h , quiktest.c
  • QueryAllInterfaces() : ADSIhelpers.cpp , ADSIhelpers.h
  • QueryCards() : SCQuery.Cpp
  • QueryCloseAllChildren() : IconPRO.C
  • QueryContextAttributesW() : Stubs.c
  • QueryContinueDrag() : ids.h
  • QueryData() : AsyncDemo.cpp
  • QueryDrop() : idt.h
  • queryEventLog() : log.c
  • QueryFunc() : callbackclient.h , callbackclient.Cpp
  • QueryGetData() : ido.h
  • QueryHeaders() : cache.Cpp
  • QueryInterface() : ioo.h , ips.h , ias.h , iocs.h , ioipf.h , ioips.h , ias.h , ids.h , idt.h , iocs.h , icf.h , ido.h , iec.h , ioipao.h , ioipo.h
  • QueryKey() : Monkey.c , Monkey.h
  • QuerySecurityPackageInfoW() : Stubs.c
  • QuerySystemTime() : SubAuth.c
  • QueueAdd() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueCreate() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueDelete() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashAdd() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashAddToSubqueue() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashDecrementCounter() : Resources.h , Resources.cpp , resources.cpp , resources.h
  • QueueHashIncrementCounter() : resources.cpp , resources.h , Resources.h , Resources.cpp
  • QueueHashLookup() : Resources.cpp , Resources.h , resources.cpp , resources.h
  • QueueHashRemoveFromSubqueue() : Resources.cpp , resources.h , resources.cpp , Resources.h
  • QueueIsEmpty() : resources.cpp , Resources.cpp , resources.h , Resources.h
  • QueueMoveToBack() : resources.cpp , resources.h , Resources.h , Resources.cpp
  • QueueOverlappedOperation() : overlap.cpp , provider.h
  • QueueRemove() : resources.cpp , resources.h , Resources.h , Resources.cpp
  • QueueRemoveData() : Resources.h , Resources.cpp
  • QueueRequest() : PoolWrap.cpp
  • QueueSampleWorker() : utils.c , utils.h
  • QueuesCreate() : Resources.h , Resources.cpp , resources.cpp , resources.h
  • QueuesDelete() : Resources.h , resources.cpp , Resources.cpp , resources.h
  • QueueSearchFile() : AsyncIO.h , AsyncIO.c
  • QueueWorkItem() : AsyncIO.h , AsyncIO.c
  • Quit() : AsyncRPCs.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- r -

  • Radian() : Display.c
  • RadiusAlloc() : radutil.c , radutil.h
  • RadiusExtensionInit() : DialIn.c , mapname.c
  • RadiusExtensionInstall() : radutil.c , radutil.h
  • RadiusExtensionProcess() : DialIn.c
  • RadiusExtensionProcess2() : mapname.c
  • RadiusExtensionTerm() : mapname.c
  • RadiusFindFirstAttribute() : radutil.c , radutil.h
  • RadiusFindFirstIndex() : radutil.c , radutil.h
  • RadiusFree() : radutil.h , radutil.c
  • RadiusReplaceFirstAttribute() : radutil.c , radutil.h
  • RaiseRect() : status.cpp
  • RandInt() : bankthrds.Cpp
  • RasAdminClearDisc() : Admapit.c
  • RasCustomDeleteEntryNotify() : customdial.cpp
  • RasCustomDial() : customdial.cpp
  • RasCustomDialDlg() : customdial.cpp
  • RasCustomEntryDlg() : customdial.cpp
  • RasCustomHangUp() : customdial.cpp
  • RasDialFunc() : RasDialAsync.c
  • RasEapFreeMemory() : CeapCfg.Cpp , Eap.c
  • RasEapGetIdentity() : Eap.c
  • RasEapGetInfo() : Eap.c
  • RasEapInvokeConfigUI() : CeapCfg.Cpp , Eap.c
  • RasEapInvokeInteractiveUI() : Eap.c
  • RasSecurityDialogBegin() : RasHost.Cpp
  • RasSecurityDialogEnd() : RasHost.Cpp
  • rcd() : FTPJr.cpp
  • ReactivateAndUndo() : ioipo.h
  • read_all() : GssMisc.c
  • read_file() : GssClient.c
  • ReadACL() : security.cpp
  • ReadBMPFile() : Dib.c , Dib.h
  • ReadCommand() : data.Idl
  • ReadData() : filerepserverproc.cpp , AsyncDemo.cpp
  • ReadDataForPaw() : fwasync.c
  • ReadDataFromFile() : Picklpc.c , Pickltc.c
  • ReadDataFromLine() : main.cpp
  • ReadDIBFile() : File.c
  • ReadDouble() : strmHelp.Cxx , strmHelp.h
  • reader() : NmPipe.c
  • readfile_delete() : gutils.h , utils.cpp
  • readfile_new() : gutils.h , utils.cpp
  • readfile_next() : gutils.h , utils.cpp
  • readfile_setdelims() : utils.cpp , gutils.h
  • ReadFileIntoTerminal() : tapisend.cpp
  • ReadFromPipe() : common.c , common.h
  • ReadFunc() : Client.c
  • ReadHelp() : AppUtil.Cpp , AppUtil.h
  • ReadICOHeader() : Icons.C
  • ReadIconFromEXEFile() : Icons.C , Icons.h
  • ReadIconFromICOFile() : Icons.C , Icons.h
  • ReadINI() : Dialer.c
  • ReadLoop() : UnBufCp2.c
  • ReadPipe() : Client32.c , Client32.h
  • ReadPref() : Global.h , Init.Cpp
  • ReadProcessMemory64() : DebugHandler.Cpp
  • ReadProxyServerByTunnelAddressFromFile() : cmsample.cpp
  • ReadSomeWiaProperties() : wiassamp.cpp
  • ReadSource() : AppUtil.Cpp , AppUtil.h
  • ReadStoredProcedure() : data.Idl
  • ReadTutorial() : AppUtil.Cpp , AppUtil.h
  • REALLOC() : Alloc.Cpp , Alloc.h
  • ReallyGetClientRect() : WinCap.c , WinCap.h
  • RecalcMsgWindow() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h , rtns.Cpp
  • recallMediaID() : app.cpp , app_utls.cpp
  • recallPoolID() : app.cpp , app_utls.cpp
  • ReceiveBytes() : Comm.cpp , Comm.h
  • ReceiveInBox() : Globals.h , Misc.c
  • ReceiveMsg() : Comm.cpp , Comm.h
  • Receiver() : QosEvent.h , Receiver.Cpp , MqTestOA.Cpp , MqTrans.Cpp , MSMQTest.c , ATMEvent.h , Receiver.Cpp
  • ReceiverThread() : TestAccept.cpp
  • ReceiveUpdates() : DrawDlg.Cpp , drawdlg.cpp
  • RecordMessage() : Processing.cpp
  • Recordset() : data.Idl
  • Recover() : RmWorker.Idl
  • RecoveryInfo() : SimpleLog.Idl
  • RectangleDlgProc() : Dialogs.c , WinCap.h
  • RecurseDeleteKey() : register.cpp
  • RecursiveDeleteKey() : registry.cpp
  • recursiveDeleteKey() : registry.cpp , registry.Cpp , Registry.Cpp , registry.Cpp
  • recv_token() : GssMisc.c
  • REFERENCE_PROXY_FILE() : dlldata.c , Dlldata.c
  • Refresh() : printjob.c , quecore.h
  • RefreshFromNotification() : printjob.c , quecore.h
  • RefreshLoop() : SamplCli.Cpp
  • RefreshPrinterCombobox() : Printer.c , Printer.h
  • Reg_DeleteItemIdForHandlerItem() : Reg.Cpp , Reg.h
  • Reg_GetItemSettingsForHandlerItem() : Reg.Cpp , Reg.h
  • Reg_SetItemSettingsForHandlerItem() : Reg.Cpp , Reg.h
  • RegGetTimeStamp() : Reg.Cpp
  • Register() : blrplate.cpp , blrplate.h
  • RegisterAClass() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterAClassAndExt() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterACLSID() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterADsExt() : ADsFirstExt.cpp
  • RegisterAFilter() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterAHandler() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RegisterALanguageClass() : langreg.hxx
  • RegisterALanguageResource() : langreg.hxx
  • RegisterAppClass() : GdiDemo.h , Init.c
  • RegisterCallback() : tapirecv.cpp
  • RegisterClassFactory() : cHello.Cxx , Server.Cxx
  • RegisterCluAdminAllGroupsExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllNetInterfacesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllNetworksExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllNodesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllResourcesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminAllResourceTypesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminClusterExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterCluAdminResourceTypeExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • RegisterComCat() : BandObjs.Cpp
  • RegisterDecoupledEvent() : Main.cpp
  • RegisterDecoupledEventConsumer() : Main.cpp
  • RegisterDecoupledInstance() : Main.cpp
  • RegisterDecoupledRestrictedEvent() : Main.cpp
  • RegisterHandlerWndClasses() : Handler.Cpp , Handler.h
  • RegisterInvokeInfo() : session.cpp
  • RegisterLibrary() : registry.cpp , registry.h
  • RegisterLocalServer() : Server.Cxx
  • RegisterNonStandardAppletInvokeInfo() : session.cpp , session.h
  • RegisterProtocol() : rmapi.c , rmapi.h
  • RegisterProxy() : registry.cpp , registry.h
  • RegisterProxyDll() : Server.Cxx
  • RegisterServer() : registry.cpp , registry.h , server.cxx , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , Registry.Cpp , Registry.h , registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , BandObjs.Cpp , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h
  • RegisterSnapin() : registry.h , Registry.h , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , Registry.Cpp , registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp
  • RegisterStandardAppletInvokeInfo() : session.cpp , session.h
  • RegisterTapiEventInterface() : FileTerm.h , FileTerm.cpp , Incoming.Cpp
  • RegisterToolBand() : BandObjs.Cpp
  • RegisterWindowClass() : BasicRecognition.cpp
  • RegWriteTimeStamp() : Reg.Cpp
  • Release_ItemList() : Enum.Cpp , Enum.h
  • ReleaseAllObjects() : main.cpp
  • ReleaseDynamicReadwriteLock() : sync.h , sync.c
  • ReleaseEvents() : Processing.cpp
  • ReleaseObj() : util.cpp , util.h
  • ReleaseReadLock() : sync.c , sync.h
  • ReleaseSamples() : Processing.cpp
  • ReleaseSlotList() : hashtbl.h , hashtbl.cpp
  • ReleaseSlots() : hashtbl.cpp , hashtbl.h
  • ReleaseSocketLock() : provider.h , sockinfo.cpp
  • ReleaseStreamsAndStorage() : ips.h
  • ReleaseTheCall() : FileTerm.cpp , Incoming.Cpp , FileTerm.h
  • ReleaseWriteLock() : sync.c , sync.h
  • RemoteClose() : Cxhndlp.c
  • RemoteHelloProc() : CallAs.Idl
  • RemoteOpen() : Cxhndlp.c
  • RemoteRead() : Cxhndlp.c
  • Remove() : data.Idl
  • remove_thread() : BPSamp.h , Utils.c
  • RemoveAClass() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • RemoveAClassName() : FiltReg.Hxx , filtreg.hxx
  • RemoveAllLayeredEntries() : instlsp.cpp
  • RemoveIdFromChain() : instlsp.cpp
  • RemoveMember() : cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp
  • RemoveMenus() : ioipf.h
  • RemoveMofInfo() : tracedmp.cpp , tracewmi.cpp
  • RemoveNamedObjectFromCollection() : Adminwrap.h , Adminwrap.Cpp
  • RemoveNode() : clUtil.Cpp , clUtil.h , clUtil.Cpp , clUtil.h , clUtil.Cpp
  • RemovePersistentDriveLetter() : DLEdit.Cpp
  • RemovePrincipalFromACL() : AclMgmt.Cpp , DComPerm.h
  • RemovePrincipalFromNamedValueSD() : SDMgmt.Cpp , DComPerm.h
  • RemoveProvider() : instlsp.cpp
  • RemoveQuotes() : msistuff.cpp
  • RemoveSocketInfo() : provider.h , sockinfo.cpp
  • RemoveSockInfo() : PrPerf.c
  • RemoveSpecialChars() : main.cpp
  • RemoveTemporaryDriveLetter() : DLEdit.Cpp
  • RemoveTransientSubscription() : Adminwrap.Cpp , Adminwrap.h
  • RemoveTxStream() : SimpleLog.Idl
  • RemoveUserAccount() : Remove.cpp
  • RemoveUserFromUList() : cMemb.h , Dlg.Cpp
  • RemoveWhiteSpaces() : main.cxx , main.hxx
  • Render() : QSample.Cxx
  • RenderAndFillPath() : Fx.h
  • RenderPathPoints() : Fx.c , Fx.h
  • RenderToWindow() : dxsurf2.cpp
  • ReorderACatalog() : instlsp.cpp
  • ReorderCatalog() : instlsp.cpp
  • ReorderUI_OnClose() : InstCodc.Cpp
  • ReorderUI_OnCommand() : InstCodc.Cpp
  • ReorderUI_OnDestroy() : InstCodc.Cpp
  • ReorderUI_OnInitDialog() : InstCodc.Cpp
  • ReorderUIProc() : InstCodc.Cpp
  • ReplaceCharWithNull() : Utility.c , Utility.h
  • reportAnEvent() : log.c
  • ReportError() : wiassamp.cpp , helper.h , helper.cpp , debug.c , Credentials.cpp
  • ReportErrorOutOfMemory() : setup.h , utils.cpp
  • ReportStatusToSCMgr() : service.h , Service.C , Service.H , Service.c , service.cpp , service.h , service.cpp , Service.cpp , Service.h , service.h
  • ReportUserCancelled() : setup.h , utils.cpp
  • ReqCleanup() : request.cpp , policy.h
  • ReqInitialize() : request.cpp , policy.h
  • RequestBorderSpace() : ioipf.h
  • RequestCallback() : Range.c
  • RequesterStatusCallback() : browser.cpp
  • RequestFile() : filerepclientproc.cpp , FileRepClientProc.cpp , filerepclientproc.cpp
  • RequestNewObjectLayout() : iocs.h
  • RescanFile() : sdkdiff.cpp
  • Reset() : RmWorker.Idl
  • ResetCaret() : FullIME.h , Global.h , TextWnd.Cpp , Main.C
  • ResetCheckBoxes() : Font.c
  • ResetConnection() : CopyFileRm.Idl
  • ResetContext() : RecoDll.cpp
  • ResetHstmt() : quiktest.c
  • ResetIMECompWin() : Main.C
  • ResetSecurity() : SuperUsr.cpp
  • ResetSlotList() : hashtbl.h , hashtbl.cpp
  • ResetToolbar() : sBar.Cpp
  • ResetXForm() : XForm.c
  • Resize() : PAPINT.Idl
  • ResizeBorder() : ioipao.h
  • Resized() : PAPINT.Idl
  • ResizeListView() : VListVw.c , VListVw.h , DragImg.Cpp
  • ResizeQueList() : quelist.c , quelist.h
  • ResizeStatusBar() : MainWND.c
  • ResolveAddress() : resolve.c , resolve.h , resolve.cpp , resolve.h , resolve.c
  • ResolveVarBind() : TestMIB.h , TestMIB.C
  • RestoreImeUI() : FullIME.h , ImeUI.C
  • RestoreLostSurfaces() : dxsurf1.cpp
  • RestrictedThreadExecutionFunction() : Main.cpp
  • ResumeJob() : bits_ie.cpp
  • RetcodeToTCHAR() : quiktest.c
  • RetrieveData() : quiktest.c
  • RetrieveTokenInformationClass() : MyToken.cpp
  • ReturnCheck() : quiktest.c , quiktest.h
  • ReverseLookup() : resolve.h , resolve.c , resolve.h , resolve.c , resolve.cpp , resolve.c
  • RevertContext() : Security.h , Security.cpp
  • RevertSecurityContext() : Stubs.c
  • RevokeClassFactory() : Server.Cxx , cHello.Cxx
  • RouteIt() : FaxSiren.Cpp
  • RpcServerIfCallback() : filerepservice.cpp , Service.cpp , filerepservice.cpp
  • RqcTrace() : main.cpp
  • RSQuery() : data.Idl
  • RSQueryRW() : data.Idl
  • RSUpdate() : data.Idl
  • RTM_CallbackEvent() : rtmapi.c , rtmapi.h
  • RTM_NextHop() : rtmapi.c , rtmapi.h
  • RuAlloc() : rumem.h , rumem.cpp
  • RubberBandScreen() : WinCap.h , WinCap.c
  • RuFree() : rumem.h , rumem.cpp
  • Run() : blrplate.h , blrplate.cpp
  • RunClientMode() : bthcxn.cpp
  • RunGetImage() : GetImage.cpp
  • RunServerMode() : bthcxn.cpp
  • RunSysCommand() : common.h
  • RuRegFreeValues() : rureg.h , rureg.cpp
  • RuRegGet() : rureg.cpp , rureg.h
  • RuRegOpenKey() : rureg.h , rureg.cpp
  • RuSocketCleanup() : rusocket.cpp , rusocket.h
  • RuSocketClose() : rusocket.cpp , rusocket.h
  • RuSocketCreate() : rusocket.cpp , rusocket.h
  • RuSocketCreateServer() : rusocket.cpp , rusocket.h
  • RuSocketGetAddress() : rusocket.cpp , rusocket.h
  • RuSocketInit() : rusocket.h , rusocket.cpp
  • RuSocketListen() : rusocket.cpp , rusocket.h
  • RuSocketRead() : rusocket.cpp , rusocket.h
  • RuSocketReadBlock() : rusocket.h , rusocket.cpp
  • RuSocketReadCurrent() : rusocket.h , rusocket.cpp
  • RuSocketReadLine() : rusocket.cpp , rusocket.h
  • RuSocketWrite() : rusocket.cpp , rusocket.h
  • RuSocketWriteLine() : rusocket.cpp , rusocket.h
  • RuStringDupAtoW() : rustring.cpp , rustring.h
  • RuStringDupWtoA() : rustring.h , rustring.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- s -

  • s_RemoteOpen() : filerepserverproc.cpp
  • s_RemoteRead() : filerepserverproc.cpp
  • s_RemoteReadAsyncPipe() : FileRepServerProc.cpp
  • SAFE_APPEND() : CreateUserHelpers.cpp , otherwko1.cpp
  • SAFE_FREE_BITMAP() : globals.h
  • SAFE_FREE_ICON() : globals.h
  • SAFE_RELEASE() : globals.h
  • SafeArrayToString() : common.cpp , common.h
  • SafeCat() : bits_ie.cpp
  • SafeCopy() : bits_ie.cpp
  • SafeStrCopy() : util.cpp , util.h
  • SafeStringCopy() : globals.h
  • SafeStringPrintf() : bits_ie.cpp
  • SameCall() : CallNot.cpp , CallNot.h
  • SampMatchworkstation() : SubAuth.c
  • Save() : ips.h , PAPINT.Idl
  • SaveCompleted() : ips.h
  • Saved() : PAPINT.Idl
  • SaveDIB() : Dibapi.h , File.c
  • SaveDIBFile() : File.c
  • SaveGlobalSettings() : Utility.Cpp , Utility.h
  • SaveMe() : WinCap.c , WinCap.h
  • SaveObject() : iocs.h
  • SaveStaticEntries() : MfEdit.c
  • SaveToFile() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • SavingDlgProc() : Dialogs.c , WinCap.h
  • ScaleDownloadEstimate() : bits_ie.cpp
  • ScaleDownloadRate() : bits_ie.cpp
  • ScanChunk() : lrsample.CXX
  • SCardPropCert() : PropCert.Cpp
  • SCFree() : SCCommon.Cpp , SCCommon.h
  • SCGetAttrib() : SCCommon.Cpp , SCCommon.h
  • SCGetResponse() : SCCommon.Cpp , SCCommon.h
  • SCListCards() : SCCommon.Cpp , SCCommon.h
  • SCListGroups() : SCCommon.Cpp , SCCommon.h
  • SCListReaders() : SCCommon.Cpp , SCCommon.h
  • SCMalloc() : SCCommon.Cpp , SCCommon.h
  • ScrambleFile() : Pipeproc.c
  • Scratch() : iDog.Idl
  • Scroll() : ioips.h
  • SCSelectFile() : SCCommon.Cpp , SCCommon.h
  • sdkdiff_UI() : sdkdiff.cpp , sdkdiff.h
  • sdkdiff_usage() : sdkdiff.cpp
  • Search() : Sample1.Cpp , Sample1.h
  • SearchForError() : quiktest.c
  • section_delete() : section.cpp , section.h
  • section_deletelist() : section.cpp , section.h
  • section_expandanchor() : section.cpp
  • section_getcorrespond() : section.cpp , section.h
  • section_getfirstline() : section.cpp , section.h
  • section_getlastline() : section.cpp , section.h
  • section_getleftbasenr() : section.cpp , section.h
  • section_getlinecount() : section.cpp , section.h
  • section_getlink() : section.cpp , section.h
  • section_getrightbasenr() : section.cpp , section.h
  • section_getstate() : section.cpp , section.h
  • section_makecomposite() : section.cpp , section.h
  • section_makectree() : section.cpp
  • section_makelist() : section.cpp , section.h
  • section_match() : section.cpp , section.h
  • section_matchlists() : section.cpp , section.h
  • section_new() : section.h , section.cpp
  • section_setleftbasenr() : section.cpp
  • section_setrightbasenr() : section.cpp
  • section_setstate() : section.cpp , section.h
  • section_takesection() : section.cpp
  • SelectAndInitializeTerminal() : Processing.cpp
  • SelectApplications() : ComSpyCtl.Idl
  • SelectDevice() : Atsp.c
  • SelectDlgProc() : Dialogs.c , WinCap.h
  • SelectEntry() : secClnt.Cpp , secSvr.Cpp
  • SelectFromTable() : quiktest.c
  • SelectFromTableFetch() : quiktest.c
  • SelectPackages() : MtsSpyCtl.Idl
  • SelectTerminalsOnCall() : Incoming.Cpp , Outgoing.Cpp
  • send_token() : GssMisc.c
  • SendBuiltinLogonPage() : CustomAuth.cpp
  • SendBytes() : Comm.cpp , Comm.h
  • SendData() : common.cpp , common.h
  • SendDataForPaw() : fwasync.c
  • Sender() : QosEvent.h , Sender.Cpp , MqTestOA.Cpp , MqTrans.Cpp , MSMQTest.c , ATMEvent.h , Sender.Cpp
  • SendErrorToClient() : readcli.c
  • SendExtensionInitFailed() : PoolWrap.cpp
  • SendFile() : CConf.Cpp , CConf.h , CChan.h , cft.cpp , cft.h
  • SendFileDlgProc() : Dlg.Cpp
  • SendFileOver() : ftrans.c , fwasync.c , fwrite.c
  • SendFileToClient() : ftrans.c , fwasync.c , fwrite.c
  • SendHeaders() : Extension.cpp
  • SendHeaderToClient() : ftrans.c , fwasync.c , fwrite.c
  • SendHelpPage() : Extension.cpp
  • SendHttpHeaders() : formdump.cpp , WorkerThread.c
  • SendHttpPostResponse() : main.c
  • SendHttpResponse() : main.c
  • SendInstructionPage() : Redirect.cpp
  • SendMsg() : Comm.cpp , Comm.h
  • SendMSGToClient() : areadcli.c
  • SendOutBox() : Globals.h , Misc.c
  • SendQueueFull() : PoolWrap.cpp
  • SendRedirectResponse() : ReMapUrl.cpp
  • SendRequest() : AsyncDemo.cpp
  • SendServerError() : WildCardMap.cpp
  • SendSomeMessages() : MQPort.Cpp
  • SendStatisticsPage() : Extension.cpp
  • SendText() : Global.h , Util.Cpp
  • SendThreadInitFailed() : PoolWrap.cpp
  • SendTo_FillSendToMenu() : sendto.c
  • SendTo_OnCommand() : sendto.c
  • SendTo_OnCreate() : sendto.c
  • SendTo_OnDestroy() : sendto.c
  • SendTo_OnInitMenuPopup() : sendto.c
  • SendTo_OnOpen() : sendto.c
  • SendTo_ResetSendToMenu() : sendto.c
  • SendTo_SendToItem() : sendto.c
  • SendTo_WndProc() : sendto.c
  • SendVariables() : formdump.cpp
  • SendWmSizeMessage() : DebMisc.c , DebMisc.h
  • seqAllocBuffers() : SEQ.h , SEQUENCE.c
  • seqCloseFile() : SEQ.h , SEQUENCE.c
  • seqFreeBuffers() : SEQ.h , SEQUENCE.c
  • seqMIDICallback() : SEQUENCE.c
  • seqMillisecsToTicks() : SEQ.h , SEQUENCE.c
  • seqOpenFile() : SEQ.h , SEQUENCE.c
  • seqPause() : SEQ.h , SEQUENCE.c
  • seqPreroll() : SEQ.h , SEQUENCE.c
  • seqRestart() : SEQ.h , SEQUENCE.c
  • seqStart() : SEQ.h , SEQUENCE.c
  • seqStop() : SEQ.h , SEQUENCE.c
  • seqTicksToMillisecs() : SEQ.h , SEQUENCE.c
  • seqTime() : SEQ.h , SEQUENCE.c
  • server_acquire_creds() : GssServer.c
  • server_establish_context() : GssServer.c
  • ServerDialogProc() : secSvr.Cpp
  • ServerProc() : Server32.c , Server32.h
  • ServerRecv() : rnrcs.cpp
  • ServerShutdownRequest() : FileRepServerProc.cpp
  • ServerStop() : Service.cpp , Service.h
  • ServerThread() : Simples.c
  • ServerThreadProc() : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • service_ctrl() : Service.C , Service.c
  • service_main() : Service.C , Service.c
  • ServiceCtrl() : filerepservice.cpp , FileRepService.cpp , filerepservice.cpp
  • ServiceHandlerEx() : main.cpp
  • ServiceMain() : FileRepService.cpp , filerepservice.cpp , main.cpp
  • ServiceRequests() : FileRepClientProc.cpp , filerepclientproc.cpp
  • ServiceStart() : FileRepService.cpp , filerepservice.cpp , Server.c , Service.H , Simple.c
  • ServiceStop() : FileRepService.cpp , filerepservice.cpp , Server.c , Service.H , Simple.c
  • SessionDialogProc() : rtcdialogs.cpp
  • set_codebreakpoint() : BPSamp.h , Utils.c
  • set_databreakpoint() : BPSamp.h , Utils.c
  • Set_String() : Service.cpp
  • set_thread_eip_back() : BPSamp.h , Utils.c
  • Set_Uint32() : Service.cpp
  • Set_Uint64() : Service.cpp
  • SetAbort() : CpyImage.Idl
  • SetAccessMaskFromCommandLine() : DComPerm.Cpp
  • SetAccountClsctx() : Account.Idl
  • SetAccountRights() : DComPerm.h , SrvcMgmt.Cpp
  • SetAclDefaults() : DComPerm.h , SDMgmt.Cpp
  • SetActiveObject() : ioipf.h
  • SetAllocatorProperties() : Processing.cpp , tapisend.cpp
  • SetAppLite() : cdialoglite.cpp , cdialoglite.h
  • SetAttrColor() : Paint.c
  • SetAudioFormat() : Processing.cpp
  • SetAuditEvent() : Audit.c
  • SetAuditMode() : Audit.c
  • SetBorderSpace() : ioipf.h
  • SetBusy() : sdkdiff.cpp
  • SetButtonText() : sdkdiff.cpp
  • SetByteArrayAsOctetString() : util.cpp , util.h , util.cpp , util.h
  • SetCACMode() : RecoDll.cpp
  • SetCallState() : Atsp.c , Atsp.h
  • SetClerk() : CrmMonComp.Idl
  • SetClientSite() : ioo.h
  • SetColorScheme() : ioo.h
  • SetColours() : sdkdiff.cpp
  • SetCommandProperties() : AdvQuery.Cxx , QSample.Cxx
  • SetComplete() : CpyImage.Idl
  • SetConnectionAttributes() : quiktest.c
  • SetConnectionIP() : RendSam.Cpp
  • SetConnectionMode() : MqTestOA.Cpp , MSMQTest.c
  • SetConsole() : odbcsql.c
  • SetConvModeParts() : IMEApps.h , Status.c
  • SetCurrentDllNode() : DebDebug.c
  • SetCurrentNode() : LinkList.c , LinkList.h
  • SetCurrentNodeEx() : LinkList.c , LinkList.h
  • SetCurrentPrivilege() : MachAcct.c
  • SetCurrentProcessNode() : DebDebug.c
  • SetCurrentThreadNode() : DebDebug.c
  • SetData() : ido.h
  • SetDefaultHardLimit() : Commands.Cpp , Commands.h
  • SetDefaultThreshold() : Commands.Cpp , Commands.h
  • SetDiagnosticMode() : utils.cpp
  • SetDispDlgProc() : SetDisp.c , SetDisp.h
  • SetDlgItemValue() : Dialogs.c
  • SetEnumPrintersDlgFields() : Enumprt.c , Enumprt.h
  • SetErrorCondition() : quiktest.c
  • SetErrorPosting() : error.cpp , error.h
  • SetExtensionKey() : registry.cpp
  • SetExtent() : ioo.h
  • SetFileSize() : FileRepClientProc.cpp
  • SetFocusEditCtls() : EDITCTLS.c , EDITCTLS.h
  • SetGlobalInfo() : rmapi.c
  • SetGuide() : RecoDll.cpp
  • SetHostNames() : ioo.h
  • SetIcmpSequence() : Ping.cpp
  • SetIMECompFormPos() : FullIME.h , Main.C
  • SetInitProps() : oledbcomponent.Cpp
  • SetInterfaceConfigInfo() : rmapi.c
  • SetInterfaceSecurity() : WbemSec.Cpp , WbemSec.h
  • SetIpPort() : rnrcs.cpp
  • SetIUnknownProperty() : Adminwrap.Cpp , Adminwrap.h
  • SetJobData() : queue.c , queue.h
  • setKeyAndValue() : registry.cpp , registry.Cpp , Registry.Cpp , registry.Cpp
  • SetKeyAndValue() : registry.cpp
  • SetLegacyAclDefaults() : SDMgmt.Cpp
  • SetLogFont() : Global.h , Style.Cpp
  • SetMenu() : ioipf.h
  • SetMenuCheck() : Global.h , Util.Cpp , Global.h , Util.Cpp
  • SetMenuData() : common.cpp , common.h
  • SetModuleName() : IsapiDebug.h
  • SetMoniker() : ioo.h
  • SetMonoColours() : sdkdiff.cpp
  • SetMonoDIBPixel() : Dib.c , Dib.h
  • SetMulticastLoopBack() : Mcastws1.c , Mcastws2.c
  • SetMulticastTtl() : Mcastws1.c , Mcastws2.c
  • SetNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • SetNames() : sdkdiff.cpp , sdkdiff.h
  • SetNewFspRegistryData() : NewFsp.h , Reg.c
  • SetNodeTypesKey() : registry.cpp
  • SetNotBusy() : sdkdiff.cpp
  • SetNullGuid() : app.cpp
  • SetObjectRects() : ioipo.h
  • SetOneAction() : MainWND.c
  • SetOpenStatusParts() : IMEApps.h , Status.c
  • SetOverlappedInProgress() : overlap.cpp
  • SetPoolDACL() : app.cpp
  • SetPrinterDACL() : SecPrint.c
  • SetPrinterQueueData() : queue.c , queue.h
  • SetPrivilegeOnAccount() : LsaPrivs.c
  • SetProperty() : property.cpp , property.h , property.cpp , property.h , Service.cpp
  • SetProxySecurity() : security.cpp
  • SetProxyUsingTunnelAddress() : cmsample.cpp
  • SetQos() : QosEvent.h , SetQos.Cpp
  • SetQueListContents() : quelist.c , quelist.h
  • SetRecord() : CrmMonComp.Idl
  • SetRegEntry() : common.cpp , common.h , common.cpp , common.h
  • SetRegKeyValue() : AppUtil.Cpp , AppUtil.h , Reg.Cpp , Reg.h
  • SetResolutionMenu() : SetDisp.c , SetDisp.h
  • SetRestriction() : property.cpp , property.h
  • SetRunAsPassword() : DComPerm.h , SrvcMgmt.Cpp
  • SetScopeCatalogAndMachine() : AdvQuery.Cxx
  • SetSelection() : sdkdiff.cpp
  • SetSendInterface() : Mcastws1.c , Mcastws2.c
  • setSnapInExtensionNode() : registry.Cpp
  • setSnapInKeyAndValue() : registry.Cpp
  • SetSnapInKeyAndValue() : registry.cpp
  • setSnapInKeyAndValue() : registry.Cpp , Registry.Cpp , registry.Cpp
  • setStandard() : suminfo.Cpp
  • SetState() : RmWorker.Idl
  • SetStateAndTag() : compitem.cpp
  • SetStatementAttributes() : quiktest.c
  • SetStatus() : sdkdiff.cpp , sdkdiff.h
  • SetStatusItems() : IMEApps.h , Status.c
  • SetStatusMessage() : FileTerm.cpp , FileTerm.h , Callnot.Cpp , Incoming.Cpp
  • SetStatusText() : ioipf.h
  • SetStringAttribute() : util.cpp , util.h , util.cpp , util.h , util.cpp , util.h , util.cpp , util.h
  • SetStringListAttribute() : util.cpp , util.h
  • SetStringProperty() : Adminwrap.Cpp , Adminwrap.h
  • SetStyle() : Global.h , Style.Cpp
  • SetSubMenuData() : common.cpp , common.h
  • SetTableName() : quiktest.c
  • SetTerminalFormat() : tapisend.cpp
  • SetThis() : common.cpp , common.h
  • setthread_databreakpoint() : Utils.c
  • SettingsDlgProc() : Global.h , Settings.Cpp
  • SetToolbarCheck() : Global.h , sBar.Cpp
  • SetTooltipText() : IMEApps.h , ToolBar.c
  • SetTtl() : Ping.cpp
  • SetupBindings() : sampclnt.cpp , sampclnt.h
  • SetupCommEvent() : CommCode.c
  • SetupControls() : halftone.c
  • SetupLoadResourceString() : common.h , utils.cpp
  • SetupNamedPipe() : common.c , common.h
  • SetupNamedPipes() : Server.c
  • SetupReadEvent() : CommCode.c
  • SetupScrollBars() : WinCap.c , WinCap.h
  • SetUserHardLimit() : Commands.Cpp , Commands.h
  • SetUserThreshold() : Commands.Cpp , Commands.h
  • SetValue() : registry.cpp
  • setValue() : registry.Cpp , Registry.Cpp , registry.Cpp
  • SetWindowTime() : bits_ie.cpp
  • SetWindowTitle() : ViewDIB.c
  • SetWinstaDesktopSecurity() : Server.c
  • ShapePlaceRun() : DspFormt.Cpp
  • ShareDlgProc() : Dlg.Cpp
  • SHCreateDefClassObject() : DefClsF.C , Priv.h
  • Shell_CreateDefClassObject() : DefClsF.C
  • ShellExec() : wn_dos.h
  • ShellFree() : sendto.c
  • Shift() : MICARS.Idl
  • ShortQuote() : news.Idl
  • ShouldEscape() : IsapiString.cpp
  • ShowAddressDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShowAuthDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShowCmdLineHelp() : bthcxn.cpp
  • ShowColor() : Mypal.c , Mypal.h
  • ShowGridLines() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ShowGuide() : GuidE.c , GuidE.h
  • ShowHwnd() : Global.h , Util.Cpp , Global.h , rtns.Cpp
  • ShowLastError() : KList.c
  • ShowLocalDlgProc() : Dlg.Cpp
  • ShowLogonDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShowNTError() : KList.c
  • ShowObject() : iocs.h
  • ShowOnScreen() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • ShowOptions() : Globals.h , PropSht.c
  • ShowPropInfo() : DpDetail.Cpp
  • ShowResults() : bankdlg.Cpp , bankthrds.Cpp
  • ShowSessionDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShowTgt() : KList.c
  • ShowTickets() : KList.c
  • ShowUsage() : DComPerm.Cpp , FTPJr.cpp
  • ShowWatcherDialog() : rtcdialogs.cpp , rtcdialogs.h
  • ShrinkBitmap() : Menu.c
  • Shutdown() : AsyncRPC.Idl , AsyncRPCp.c , ClUuidp.c , DUnionp.c , InOutp.c , Repasp.c , Xmitp.c , Dyneptp.c , Cxhndlp.c , Usrdefp.c , Hellop.c , RPCssmp.c
  • ShutDown() : Pipeproc.c , Remote.c
  • ShutdownTapi() : FileTerm.cpp , FileTerm.h , Incoming.Cpp , Outgoing.Cpp , tapirecv.cpp
  • ShutdownTAPI() : TapiCode.c , TapiCode.h , tapisend.cpp
  • ShutdownThread() : filerepclientproc.cpp
  • ShutdownThreadPool() : PoolWrap.cpp
  • sieve() : Cursor.c , Cursor.h
  • sign_server() : GssServer.c
  • SignalAlert() : bits_ie.cpp
  • SignThis() : Security.cpp , Security.h
  • SignVerifyFile() : SignHash.cpp
  • SimpleDlgProc() : Dialogs.c , FontView.c
  • SizeDouble() : strmHelp.Cxx , strmHelp.h
  • SizeEditCtls() : EDITCTLS.c , EDITCTLS.h
  • SizeMsgWindow() : Global.h , Util.Cpp , Global.h , Util.Cpp , Global.h , rtns.Cpp
  • SizeStatus() : Global.h , rtns.Cpp
  • SkipAnsi() : AppUtil.h , AppUtil.Cpp , AppUtil.h
  • SkipAnsiString() : register.Cpp
  • SkipNonWhite() : Get_Sock.c
  • SkipValue() : msistuff.cpp , msiloc.cpp
  • SkipWhite() : Get_Sock.c
  • SkipWhiteSpace() : msiloc.cpp , msistuff.cpp
  • SlideWindow() : Globals.h , Util.c
  • SmartAppendBackslash() : Utility.Cpp , Utility.h
  • smfBuildFileIndex() : SMFI.h , SMFREAD.c
  • smfCloseFile() : SMF.c , SMF.h
  • smfGetFileInfo() : SMF.c , SMF.h
  • smfGetNextEvent() : SMFI.h , SMFREAD.c
  • smfGetStateMaxSize() : SMF.c , SMF.h
  • smfGetVDword() : SMFI.h , SMFREAD.c
  • smfInsertParmData() : SMF.c
  • smfMillisecsToTicks() : SMF.c , SMF.h
  • smfOpenFile() : SMF.h , SMF.c
  • smfReadEvents() : SMF.c , SMF.h
  • smfSeek() : SMF.h , SMF.c
  • smfTicksToMillisecs() : SMF.c , SMF.h
  • SnmpExtensionInit() : TestDll.C
  • SnmpExtensionQuery() : TestDll.C
  • SnmpExtensionTrap() : TestDll.C
  • SocketCallbackSendCompletion() : socket.c
  • SocketCreate() : socket.c , socket.h
  • SocketDestroy() : socket.c , socket.h
  • SocketReceive() : socket.h , socket.c
  • SocketReceiveEvent() : socket.c , socket.h
  • SocketSend() : socket.h , socket.c
  • SpeakTextWndProc() : MainDlg.Cpp
  • Speed() : MICARS.Idl
  • SpeedDial1Proc() : Dialer.c
  • SpeedDial2Proc() : Dialer.c
  • SpincubeDlgProc() : SpinCube.c , SpinCube.h
  • SpincubeSizeToText() : SpinCube.c , SpinCube.h
  • SpincubeStyle() : SpinCube.c , SpinCube.h
  • SpincubeWndProc() : SpinCube.c , SpinCube.h
  • SServiceRequests() : FileRepServerProc.cpp
  • StackFormat() : common.h , common.cpp
  • StandardSender() : MqTestOA.Cpp , MSMQTest.c
  • StartComm() : CommCode.h , CommCode.c
  • StartComplete() : rmapi.c
  • StartDebuggee() : DebMisc.c , DebMisc.h
  • StartFileRepServer() : Service.cpp , Service.h
  • StartHelpers() : nshsamp.cpp , nshsamp.h
  • StartListening() : tapirecv.cpp
  • StartNotifications() : threads.c , threads.h
  • StartOverlappedManager() : overlap.cpp
  • StartPolling() : threads.c , threads.h
  • StartProtocol() : rmapi.c
  • StartReadThreadProc() : CommCode.c
  • StartSelection() : Select.c , Select.h
  • StartThread() : Server.Cpp
  • StartTime() : Client.C
  • Startup() : ClRes.cpp
  • StartWriteThreadProc() : CommCode.c
  • StateChange() : App32.C
  • StateToColour() : sdkdiff.cpp
  • StatusAddItem() : gutils.h , status.cpp
  • StatusAlloc() : status.cpp , gutils.h
  • StatusBarHeight() : FontView.c , Status.c
  • StatusButtonDown() : status.cpp
  • StatusButtonUp() : status.cpp
  • StatusCalcHeight() : status.cpp
  • StatusCalcWidth() : status.cpp
  • StatusCreate() : gutils.h , status.cpp
  • StatusCreateTools() : status.cpp
  • StatusDeleteTools() : status.cpp
  • StatusFieldProc() : Status.c
  • StatusGetItem() : status.cpp
  • StatusHeight() : gutils.h , status.cpp
  • StatusInit() : status.cpp , gutils.cpp
  • StatusMsg() : Global.h , sBar.Cpp
  • StatusPaint() : status.cpp
  • StatusProc() : Status.c
  • StatusResize() : status.cpp
  • StatusWndProc() : status.cpp
  • STDAPI_() : regdb.c , server.cpp , ole2ui.c , OleStd.c , dbgUtil.c , msgfiltr.c , drawIcon.c , OleStd.h , msgfiltr.h , Utils.Cpp , Utils.h , msgfiltr.h , OleStd.h , dbgUtil.c , drawIcon.c , getIcon.c , hatch.c , msgfiltr.c , Objfdbk.c , ole2ui.c , OleStd.c , oleutl.c , regdb.c , stdpal.c , suminfo.Cpp , suminfo.h , targtdev.c , propldr.cpp , case.cpp , langbar.cpp , monitor.cpp , dap.cpp , langbar.cpp , mark.cpp , pstore.cpp , server.cpp , suminfo.Cpp , targtdev.c , suminfo.h
  • STDENTRY_() : DllSkel.Cpp , ComObj.h , DllSkel.h
  • STDMETHOD_() : dballoc.h
  • STDMETHODIMP_() : about.cpp , basesnap.cpp , IAdvSink.Cpp , dxferObj.Cpp , app.Cpp , about.cpp , nameext.Cpp , iocs.h , ias.h , Sample.Cpp , iDog.Cpp , about.Cpp , dataobj.Cpp , msgfiltr.c , enumStat.c , malspy.c , basesnap.Cpp , UtilCAR.Cpp , malspy.c , basesnap.Cpp , IIpSite.Cpp , IDocSite.Cpp , comp.Cpp , perstor.Cpp , OLEObj.Cpp , BALL.Cpp , doc.Cpp , basesnap.Cpp , basesnap.cpp , UTCRUCAR.Cpp , SINK.Cpp , CAR.Cpp , ias.Cpp , Connect.Cpp , DRAWPage.Cpp , BasicHiPerf.Cpp , ias.h , ioips.Cpp , Sample.Cpp , ias.Cpp , msgfiltr.c , pipe.cxx , TextPage.Cpp , comp.Cpp , Factory.Cpp , clistener.cpp , binder.cpp , ids.h , compdata.Cpp , doc.Cpp , rowset.cpp , basesnap.cpp , site.Cpp , comp.cpp , ids.Cpp , idt.Cpp , about.Cpp , compdata.cpp , Handler.Cpp , enumtask.Cpp , comp.cpp , iec.Cpp , tbarext.Cpp , basesnap.Cpp , iocs.Cpp , dataobj.Cpp , about.Cpp , basesnap.Cpp , basesnap.cpp , about.Cpp , dataobj.Cpp , about.cpp , doc.Cpp , about.cpp , comp.Cpp , CAR.Cpp , compdata.Cpp , BaseSnap.Cpp , UTCRUCAR.Cpp , compdata.Cpp , about.Cpp , ido.h , enumformatetc.cpp , Factory.Cpp , iec.Cpp , compdata.cpp , dataobj.cpp , comp.cpp , contextmenuex.cpp , comp.cpp , iec.h , UTCRUCAR.Cpp , ioo.Cpp , compdata.cpp , SINK.Cpp , basesnap.cpp , dataobj.Cpp , dataobj.cpp , ioipo.h , icf.h , Factory.Cpp , UtilCAR.Cpp , about.Cpp , basesnap.cpp , compdata.cpp , comp.Cpp , dataobj.cpp , Enumidl.Cpp , about.Cpp , Connect.Cpp , comp.Cpp , basesnap.cpp , basesnap.Cpp , ClassProv.Cpp , about.Cpp , CRUCAR.Cpp , compdata.Cpp , UtilCAR.Cpp , about.Cpp , comp.Cpp , ClassFac.Cpp , dataobj.Cpp , CRUCAR.Cpp , dataobj.Cpp , basesnap.Cpp , comp.cpp , Consumer.Cpp , Events.cpp , basesnap.Cpp , BALL.Cpp , CRUCAR.Cpp , Provider.Cpp , IcnOvrly.Cpp , basesnap.Cpp , Consumer.Cpp , datasrc.cpp , ADEvent.cpp , ToolBand.Cpp , Factory.Cpp , about.Cpp , basesnap.Cpp , MainWnd.cpp , Factory.Cpp , PAPER.Cpp , FVInit.Cpp , dataobj.Cpp , Notify.Cpp , UTCRUCAR.Cpp , Dataobj.Cpp , DeskBand.Cpp , Factory.Cpp , PageList.Cpp , ContMenu.Cpp , PropProv.Cpp , tsfedit.cpp , CAR.Cpp , Factory.Cpp , DataObj.Cpp , FileView.Cpp , DRAWSINK.Cpp , basesnap.Cpp , ShlFldr.Cpp , ShellExt.Cpp , Events.cpp , DropTgt.Cpp , dataobj.Cpp , dataobj.cpp , basesnap.Cpp , Provider.Cpp , CopyHook.Cpp , dataobj.Cpp , CRUCAR.Cpp , comp.Cpp , stream.cpp , DropSrc.Cpp , compdata.Cpp , cMenuext.Cpp , ClassFactory.Cpp , compdata.Cpp , ClassFac.Cpp , comp.Cpp , IPerFile.Cpp , MethProv.Cpp , Factory.Cpp , about.Cpp , compdata.Cpp , Notify.Cpp , compdata.Cpp , DropExt.C , BitmapWnd.cpp , basesnap.Cpp , comp.Cpp , Dragsrc.Cpp , about.Cpp , ExplrBar.Cpp , dbsess.cpp , DataObj.Cpp , Enumfe.Cpp , Settings.Cpp , columnprovider.Cpp , Enum.Cpp , DropTgt.Cpp , ClassFactory.Cpp , SINK.Cpp , classfac.cpp , ClassFac.Cpp , ClsFact.Cpp , row.cpp , Cfact.Cpp , CommBand.Cpp , Connect.Cpp , dataobj.Cpp , cdialoglite.cpp , cbase.cpp , Notify.Cpp , Connect.Cpp , EmptyVolumeCache.Cpp , InstProv.Cpp , basesnap.Cpp , Factory.Cpp , Connect.Cpp , ClsFact.Cpp , ClassFac.Cpp , Factory.Cpp , dataobj.Cpp , TextSINK.Cpp , ListSINK.Cpp , ips.h , Factory.Cpp , comp.Cpp , IFileVW.Cpp , dataobj.Cpp , PAPER.Cpp , basesnap.Cpp , about.Cpp , dataobj.Cpp , Obj.Cpp , ioipf.h , iec.h , DataObj.Cpp , oipObj.Cpp , idt.h , compdata.Cpp , Framer.Cpp , ioips.h , about.Cpp , ias.Cpp , Dogcf.Cpp , cfWrap.Cpp , enumfetc.c , csur.Cpp , malspy.c , ICliSite.Cpp , msgfiltr.c , OLEDocVw.Cpp , app.Cpp , component.cxx , about.Cpp , basesnap.cpp , UTCRUCAR.Cpp , dataobj.cpp , UtilCAR.Cpp , compdata.Cpp , compdata.cpp , Factory.Cpp , comp.cpp , comp.Cpp , dataobj.cpp , Comp.Cpp , about.Cpp , basesnap.Cpp , ido.Cpp , basesnap.cpp , ShlView.Cpp , compdata.cpp , ioo.h , Service.cpp , CompData.Cpp , dataobj.Cpp , compdata.Cpp , comp.Cpp , dataobj.Cpp , about.cpp , Factory.Cpp , UTCRUCAR.Cpp , ExtrIcon.Cpp , basesnap.cpp , About.Cpp , compdata.cpp , comp.Cpp , dataobj.cpp , site.Cpp , about.Cpp , ioipao.h , compdata.Cpp , comp.cpp , basesnap.Cpp , about.cpp , compdata.Cpp , Factory.Cpp , iocs.h , dataobj.cpp , proppagex.cpp , command.cpp , DataObj.cpp , ias.h , app.Cpp , comp.Cpp , oipaObj.Cpp , CRUCAR.Cpp , comp.cpp , iocs.Cpp , ioipao.Cpp , compdata.Cpp , ioipo.Cpp , malspy.c , ppgeext.Cpp , OLEDoc.Cpp , malspy.c , Site.Cpp , compdata.Cpp , callback.Cpp , icf.Cpp , basesnap.Cpp , perfile.Cpp , dataobj.Cpp , IAdvSink.Cpp , about.Cpp , ias.h , clsfact.Cpp , ias.Cpp , ioipf.Cpp , basesnap.Cpp , ips.Cpp , comp.Cpp , CAR.Cpp , Connect.Cpp
  • SteCommand() : Main.C
  • SteCreate() : Main.C
  • Steer() : MICARS.Idl
  • SteIMECompWindowPos() : Main.C
  • SteImeOpenClose() : Main.C
  • StemCompare() : lrsample.CXX
  • StepOverPidl() : sendto.c
  • SteRegister() : Main.C
  • SteWndProc() : Main.C , FullIME.h , Main.C
  • StopAsyncWindowManager() : asyncselect.cpp , provider.h
  • StopComm() : CommCode.c , CommCode.h
  • StopOverlappedManager() : provider.h , overlap.cpp
  • StopProtocol() : rmapi.c
  • StopUpdateThread() : threads.c , threads.h
  • StoreChar() : Main.C
  • StoreDBCSChar() : Main.C
  • StoreSD() : security.cpp
  • StrChr() : Util.Cpp , Global.h
  • strDuplicate() : common.cpp , common.h
  • StrDupWFromA() : AdminDll.c , Admapit.c
  • StreamFile() : tapisend.cpp
  • StretchIconToWindow() : WinCap.h
  • StringAppendF() : DebMisc.h , DebMisc.c
  • StringCompare() : common.cpp , common.h
  • StringCompareI() : common.cpp , common.h
  • StringCompareW() : StringUtils.cpp , PropList.h , StringUtils.h , PropList.h , StringUtils.h , PropList.cpp , StringUtils.cpp , StringUtils.h , StringUtils.cpp , PropList.cpp , StringUtils.h , PropList.cpp , PropList.h , StringUtils.cpp , PropList.cpp , StringUtils.h , StringUtils.cpp , PropList.h
  • StringCopy() : common.h , common.cpp
  • StringFormat() : common.h , common.cpp
  • StringInput() : gutils.h , utils.cpp
  • StringListToString() : helper.h , helper.cpp
  • StringListToVariant() : helper.cpp , util.cpp , util.h , helper.h
  • StringPrintF() : DebMisc.c , DebMisc.h
  • StringToClsid() : RegAcc32.Hxx , RegAcc32.Cxx
  • StringToGuid() : TraceLog.c
  • StringToPhysAddr() : IPArp.h , IPArp.Cpp
  • StringToSafeArray() : common.h , common.cpp
  • StringToStringList() : helper.cpp , helper.h
  • StringToVariant() : common.h , common.cpp
  • StringToVector() : common.h , common.cpp
  • StrRetToStr() : sendto.c
  • StructsIn1() : Server.c
  • StructsIn2() : Server.c
  • StructsIn3() : Server.c
  • StyleCheckRange() : Style.Cpp , Global.h
  • StyleDeleteRange() : Style.Cpp , Global.h
  • StyleExtendRange() : Global.h , Style.Cpp
  • StyleSetRange() : Global.h , Style.Cpp
  • SubclassInputEditProc() : EDITCTLS.c
  • SubclassWindow() : DebMisc.h , DebMisc.c
  • SubClsEdit() : Main.Cpp , Init.Cpp , ui.cpp
  • Supported() : quiktest.c
  • SvrClose() : sdkdiff.cpp
  • SwitchLists() : list.cpp
  • SwitchView() : VListVw.c , DragImg.Cpp
  • SWORD() : custom.c
  • SymbolFromName() : dbh.cpp
  • SynchSubProc() : common.h , common.cpp
  • SyncSendGenericServerError() : IsapiRequest.h , IsapiRequest.cpp
  • SyncSibling() : winmain.cpp , common.h , common.cpp , winmain.h
  • SyncUI() : MainWND.c
  • Syntax() : MqTestOA.Cpp , MSMQTest.c , MqTrans.Cpp
  • SysLogOnOff() : cMgr.h , cMgr.Cpp
  • SystemError() : Error.h , Error.Cpp
  • SystemExceptionTranslator() : Except.Cxx , Except.Hxx
  • SystemMessage() : DComPerm.h , UtilS.Cpp
  • sz2addr() : dbh.cpp
  • SzFindLastCh() : Global.h , Util.Cpp
  • szLogPrintf() : autotest.h
  • szMessageBox() : autotest.h
  • SzToGuid() : Util.Cpp , Global.h
  • szWrite() : quiktest.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- t -

  • T2A() : StrConv.h
  • T2CA() : StrConv.h
  • TableServer() : sdkdiff.cpp
  • TakeOwnershipIfAppropriate() : SidClean.c
  • TakeTwoSections() : section.cpp
  • TallMenu_WndProc() : tallmenu.c
  • tapiCallback() : Dialer.c
  • TargetDown() : ComSpyAudit.Idl
  • TargetUp() : ComSpyAudit.Idl
  • TCHAR2BSTR() : StdAfx.h
  • TellAll() : Server32.c , Server32.h
  • TermApp() : sendto.c
  • TerminateApp() : Main.Cpp
  • TerminateAuthorizationHeader() : HttpAuth.c , HttpAuth.h
  • TerminateCache() : AuthFilt.h , cache.c
  • TerminateExtension() : KeepAlive.c , KeepAliveP.c , Redirect.cpp , Simple.cpp , WorkerThread.c , Extension.cpp , adoisapi.cpp , ctetest.c , DumpVars.cpp , formdump.cpp , InvokObjThreads.cpp , areadcli.c , ftrans.c , fwasync.c , readcli.c , fwrite.c
  • TerminateExtensionWrapper() : PoolWrap.cpp
  • TerminateInstance() : MidiPlyr.c
  • TerminateUserDatabase() : AuthFilt.h , db.c
  • TermPackage() : Security.cpp , Security.h
  • TermSession() : Security.cpp , Security.h
  • TermWinsock() : Comm.cpp , Comm.h
  • Test() : CpyImage.Idl , Client.c
  • Test1() : psperf.Idl
  • Test23() : psperf.Idl
  • TestAppDlgProc() : App32.C
  • TestBindParam() : quiktest.c
  • TestConnectAttr() : quiktest.c
  • TestConnectionOptions() : quiktest.c
  • TestCopyDesc() : quiktest.c
  • TestCursorName() : quiktest.c
  • TestData() : quiktest.c
  • TestDescDefaults() : quiktest.c
  • TestDiagField() : quiktest.c
  • TestDiagRec() : quiktest.c
  • TestDll() : Client.c
  • TestEndTran() : quiktest.c
  • TestEnvAttr() : quiktest.c
  • TestExtendedFetch() : quiktest.c
  • TestFetchScroll() : quiktest.c
  • TestGetDescField() : quiktest.c
  • TestGetDescRec() : quiktest.c
  • TestLargeQuery() : quiktest.c
  • TestLikeQuery() : quiktest.c
  • TestMetaData() : quiktest.c
  • TestMixedAnsiUnicode() : quiktest.c
  • TestNotify() : ComDlg32.C , ComDlg32.h
  • TestNumResCols() : quiktest.c
  • TestOJCap() : quiktest.c
  • TestProtocol() : ipsample.h , test.c
  • TestQuery() : QueryParser.cpp
  • TestQuickRebind() : quiktest.c
  • TestSearchedQuery() : quiktest.c
  • TestSetDescField() : quiktest.c
  • TestSetDescRec() : quiktest.c
  • TestSQLBrowseConnect() : quiktest.c
  • TestSQLColumnPrivileges() : quiktest.c
  • TestSQLDataSources() : quiktest.c
  • TestSQLDescribeParam() : quiktest.c
  • TestSQLDrivers() : quiktest.c
  • TestSQLForeignKeys() : quiktest.c
  • TestSQLMoreResults() : quiktest.c
  • TestSQLNativeSQL() : quiktest.c
  • TestSQLNumParams() : quiktest.c
  • TestSQLParamOptions() : quiktest.c
  • TestSQLPrimaryKeys() : quiktest.c
  • TestSQLProcedureColumns() : quiktest.c
  • TestSQLProcedures() : quiktest.c
  • TestSQLSetConnectAttr() : quiktest.c
  • TestSQLSetScrollOptions() : quiktest.c
  • TestSQLSetStmtAttr() : quiktest.c
  • TestSQLSpecialCols() : quiktest.c
  • TestSQLStatistics() : quiktest.c
  • TestSQLTablePrivileges() : quiktest.c
  • TestSQLTables() : quiktest.c
  • TestStmtOptions() : quiktest.c
  • TestThreading() : quiktest.c
  • TestUseDesc() : quiktest.c
  • TextButtonBar() : ToolBar.c , ToolBar.h
  • TextButtonBarProc() : ToolBar.c
  • TextDelete() : Global.h , Text.Cpp
  • TextDlgProc() : global.h , textapi.c
  • TextEffect() : Fx.c , Fx.h
  • TextInsert() : Global.h , Text.Cpp
  • TextWndProc() : MfEdit.c , MfEdit.h , Global.h , TextWnd.Cpp
  • tfprintf() : dump.cpp , sampclnt.h
  • Threader() : AsyncDemo.cpp
  • ThreadExecutionFunction() : Main.cpp
  • ThreadLoop() : quiktest.c
  • ThreadOrderFunction() : DebDebug.c
  • ThreadProc() : Cancel.Cpp
  • ThreadProcRequest() : filerepclientproc.cpp
  • ThrowHR() : util.h
  • TimerProc() : Main.Cpp , DebMain.c
  • TipURL() : BYOTTransaction.Idl
  • TitleProc() : Title.c , Title.h
  • tmain() : ProcList.c
  • TMDown() : RmWorker.Idl , CopyFileRm.Idl
  • ToExpand() : sdkdiff.cpp
  • ToggleCase() : globals.cpp , globals.h
  • ToggleChar() : globals.cpp
  • ToMoved() : sdkdiff.cpp
  • ToolBarHeight() : FontView.c , Tools.c
  • ToolsProc() : Tools.c
  • ToOutline() : sdkdiff.cpp
  • TopLeft() : status.cpp
  • Trace_Close() : gutils.h , utils.cpp
  • Trace_Error() : gutils.h , utils.cpp
  • Trace_Event() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • Trace_File() : gutils.h , utils.cpp
  • Trace_HR() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • Trace_Pointer() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • Trace_Start() : tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h
  • Trace_Status() : sdkdiff.cpp
  • Trace_Unattended() : utils.cpp , gutils.h
  • Trace_Value() : tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp , tracemacro.h , tracemacro.cpp
  • TraceMsg() : Global.h , Debug.Cpp
  • TransactionState() : CrmMonComp.Idl
  • TransferAndDeleteBuffers() : AsyncDemo.cpp
  • TransferWiaItem() : wiassamp.cpp
  • TransformDlgProc() : WxForm.c , WxForm.h
  • TransformVertices() : Paint.h , Paint.c
  • Translate() : HtmlProp.Cxx
  • TranslateAccelerator() : ioipao.h , ioipf.h
  • TranslateDeviceCaps() : Getcaps.c , Getcaps.h
  • TrapMMError() : wave.cpp , wave.h
  • TrayMessage() : SetDisp.c , App32.C , SetDisp.h
  • tree_addafter() : tree.h , tree.cpp
  • Tree_CompareProc() : tree.cpp
  • Tree_Create() : tree.cpp
  • tree_create() : tree.cpp
  • Tree_Create() : tree.h
  • tree_create() : tree.h
  • tree_delete() : tree.cpp , tree.h
  • tree_delitem() : tree.cpp
  • Tree_DoContextMenu() : tree.h , tree.cpp
  • Tree_DoItemMenu() : tree.cpp
  • Tree_EnumObjects() : tree.cpp
  • tree_find() : tree.cpp , tree.h
  • Tree_GetChildItems() : tree.cpp
  • tree_getitem() : tree.cpp
  • Tree_GetRootItems() : tree.cpp
  • Tree_Init() : tree.cpp , tree.h
  • tree_newitem() : tree.cpp
  • Tree_Notify() : tree.cpp , tree.h
  • tree_search() : tree.h , tree.cpp
  • tree_update() : tree.h , tree.cpp
  • TriggerUpdateThreadRefresh() : threads.h , threads.c
  • Trim() : main.cpp
  • TrimCommentAndTrailingWhitespace() : ReMapUrl.cpp , Redir401.cpp
  • TrimVirtualBuffer() : AsyncIO.h , AsyncIO.c
  • TSPI_lineClose() : Atsp.c
  • TSPI_lineCloseCall() : Atsp.c
  • TSPI_lineCloseMSPInstance() : Atsp.c
  • TSPI_lineConditionalMediaDetection() : Atsp.c
  • TSPI_lineCreateMSPInstance() : Atsp.c
  • TSPI_lineDrop() : Atsp.c
  • TSPI_lineGetAddressCaps() : Atsp.c
  • TSPI_lineGetAddressStatus() : Atsp.c
  • TSPI_lineGetCallAddressID() : Atsp.c
  • TSPI_lineGetCallInfo() : Atsp.c
  • TSPI_lineGetCallStatus() : Atsp.c
  • TSPI_lineGetDevCaps() : Atsp.c
  • TSPI_lineGetID() : Atsp.c
  • TSPI_lineGetLineDevStatus() : Atsp.c
  • TSPI_lineGetNumAddressIDs() : Atsp.c
  • TSPI_lineMakeCall() : Atsp.c
  • TSPI_lineMSPIdentify() : Atsp.c
  • TSPI_lineNegotiateTSPIVersion() : Atsp.c
  • TSPI_lineOpen() : Atsp.c
  • TSPI_lineReceiveMSPData() : Atsp.c
  • TSPI_lineSetDefaultMediaDetection() : Atsp.c
  • TSPI_providerConfig() : Atsp.c
  • TSPI_providerEnumDevices() : Atsp.c
  • TSPI_providerGenericDialogData() : Atsp.c
  • TSPI_providerInit() : Atsp.c
  • TSPI_providerInstall() : Atsp.c
  • TSPI_providerRemove() : Atsp.c
  • TSPI_providerShutdown() : Atsp.c
  • TSPI_providerUIIdentify() : Atsp.c
  • TUISPI_lineConfigDialog() : Atsp.c
  • TUISPI_providerConfig() : Atsp.c
  • TUISPI_providerInstall() : Atsp.c
  • TUISPI_providerRemove() : Atsp.c
  • TV_FindItem() : cdialoglite.h , cdialoglite.cpp
  • TV_GetItemParam() : cdialoglite.cpp , cdialoglite.h
  • TV_GetItemText() : cdialoglite.h , cdialoglite.cpp
  • TV_InsertItem() : winmain.cpp , cdialoglite.h , cdialoglite.cpp , winmain.h
  • TV_SetItemState() : cdialoglite.cpp , cdialoglite.h
  • tvfprintf() : sampclnt.h , dump.cpp
  • TWnd_OnCommand() : TIMEWND.c
  • TWnd_OnCreate() : TIMEWND.c
  • TWnd_OnDestroy() : TIMEWND.c
  • TWnd_OnPaint() : TIMEWND.c
  • TWnd_OnSize() : TIMEWND.c
  • TWnd_OnTimer() : TIMEWND.c
  • TWnd_WndProc() : TIMEWND.c , MidiPlyr.h
  • type() : FTPJr.cpp
  • TypeToString() : Utils.Cpp , UtilLib.h , Utils.Cpp , UtilLib.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- u -

  • ucase() : dbh.cpp
  • UClassFromDescription() : Utility.c , Utility.h
  • UcToAnsi() : AppUtil.Cpp , AppUtil.h
  • UDescriptionFromClass() : Utility.h , Utility.c
  • UiAddMember() : precomp.h , ui.cpp
  • UiClearText() : ui.cpp
  • UICursorLoad() : BttnCur.h
  • UIDeactivate() : ioipo.h
  • UiDisplayMessage() : ui.cpp
  • UiDisplayMsg() : ui.cpp , precomp.h
  • UiDisplaySysMsg() : precomp.h , ui.cpp
  • UiGetSelectedMember() : ui.cpp
  • UiRemoveMember() : precomp.h , ui.cpp
  • UiSendText() : ui.cpp
  • UiSizeMsgWindow() : ui.cpp
  • UIToolButtonDraw() : BttnCur.h
  • UIToolButtonDrawTDD() : BttnCur.h
  • UIToolConfigureForDisplay() : BttnCur.h
  • Unadvise() : ioo.h
  • UnadviseSingleSink() : globals.cpp , globals.h
  • UnadviseSink() : globals.cpp , globals.h
  • UndrawDragFeedback() : idt.h
  • UnHookChannel() : cShare.Cpp , cShare.h , CChan.Cpp , CChan.h
  • UniCode2Ansi() : debug.c , debug.h
  • Unicode2Ansi() : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • UnicodeOk() : ConServe.Cpp , DcdServe.Cpp , DComDraw.Cpp , DllClien.Cpp , DllServe.Cpp , DllSkel.Cpp , DllUser.Cpp , ExeSkel.Cpp , FreClien.Cpp , FreServe.Cpp , LicClien.Cpp , LicServe.Cpp , LocClien.Cpp , LocServe.Cpp , Marshal2.Cpp , PerClien.Cpp , PerDraw.Cpp , PerServe.Cpp , PerText.Cpp , RemClien.Cpp , StoClien.Cpp , StoServe.Cpp , AptClien.Cpp , AptServe.Cpp , ComObj.Cpp , ComUser.Cpp , ConClien.Cpp
  • UnicodeStringToAnsiString() : MainFrm.Cpp
  • UnicodeToAnsiString() : main.hxx
  • UninitComServer() : Main.cpp
  • UninitializeMallocSpy() : malspy.c , malspy.h
  • UninitThread() : Extension.cpp , PoolWrap.h
  • Uninstall() : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • UninstallUserAccounts() : Process.cpp
  • UnionCall1() : Server.c
  • UnionCall2() : Server.c
  • UnionParamProc() : DUnionp.c
  • UnionStructProc() : DUnionp.c
  • UnloadSecurityLibrary() : WebClient.c , WebServer.c
  • Unlocked() : PAPINT.Idl
  • UnlockSocketContext() : provider.h , sockinfo.cpp
  • UnlockVolume() : Mfmt.c
  • UnlockWindowInfo() : GdiDemo.h , Wininfo.c
  • UnreadableRand() : enablerouter.c
  • UnRegisterADsExt() : ADsFirstExt.cpp
  • UnRegisterAFilter() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • UnRegisterAHandler() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • UnRegisterALanguageClass() : langreg.hxx
  • UnRegisterALanguageResource() : langreg.hxx
  • UnRegisterAnExt() : FiltReg.Hxx , filtreg.hxx , FiltReg.Hxx
  • UnregisterAppClass() : Init.c , GdiDemo.h
  • UnRegisterCallBack() : tapirecv.cpp
  • UnregisterCluAdminAllGroupsExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllNetInterfacesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllNetworksExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllNodesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllResourcesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminAllResourceTypesExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminClusterExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterCluAdminResourceTypeExtension() : RegExt.cpp , RegExt.h , RegExt.cpp , RegExt.h
  • UnregisterLocalServer() : Server.Cxx
  • UnRegisterProxy() : registry.cpp , registry.h
  • UnregisterProxyDll() : Server.Cxx
  • UnregisterServer() : registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , Registry.Cpp , Registry.h , registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h
  • UnRegisterServer() : server.cxx
  • UnregisterSnapin() : registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.cpp , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , registry.Cpp , registry.h , Registry.Cpp , Registry.h , registry.Cpp , registry.h , registry.cpp , registry.h , registry.cpp , registry.h
  • UnRegisterTapiEventInterface() : FileTerm.cpp , FileTerm.h
  • UnwriteableRand() : enablerouter.c
  • Update() : ioo.h , account.Idl
  • UpdateApp() : chWnd.Cpp , cShare.h
  • UpdateAppList() : chWnd.Cpp , cShare.h
  • UpdateAudioSettings() : Dlg.Cpp
  • UpdateButton() : ToolBar.c , IMEApps.h
  • UpdateCapInfoListsFromIndex() : InstCodc.Cpp
  • UpdateChannelState() : CChan.Cpp , CChan.h
  • UpdateCommand() : data.Idl
  • UpdateCompletionPort() : IocpServer.Cpp , IocpServer.h , IocpServerex.Cpp
  • UpdateConfView() : cMemb.Cpp , cMemb.h
  • UpdateDialog() : bits_ie.cpp
  • UpdateHdlgIdInt() : Global.h
  • UpdateHdlgIdText() : Global.h
  • UpdateJobData() : queue.h , queue.c
  • UpdateLspMap() : instlsp.cpp
  • UpdateMenu() : VListVw.c
  • UpdateMenuSettings() : DebMisc.c , DebMisc.h
  • UpdateMenuState() : IconPRO.C
  • UpdateModeButton() : IMEApps.h , ToolBar.c
  • UpdatePositions() : Tools.c
  • UpdatePrincipalInACL() : AclMgmt.Cpp , DComPerm.h
  • UpdatePrincipalInNamedValueSD() : DComPerm.h , SDMgmt.Cpp
  • UpdatePrinterData() : queue.c , queue.h
  • UpdateProgress() : CConf.Cpp
  • UpdatePropertyFields() : secClnt.Cpp
  • UpdateQueue() : printjob.c , queue.h
  • UpdateRegistery() : main.cpp
  • UpdateSecurityFields() : secClnt.Cpp
  • UpdateSelection() : Select.h , Select.c
  • UpdateShareList() : Dlg.Cpp
  • UpdateShowCandButton() : IMEApps.h , ToolBar.c
  • UpdateShowOpenStatusButton() : IMEApps.h , ToolBar.c
  • UpdateStatusBar() : Global.h , STATBAR.h , sBar.Cpp , STATBAR.c
  • UpdateStatusIcon() : Global.h , sBar.Cpp
  • UpdateStoredProcedure() : data.Idl
  • UpdateUserChannel() : cMemb.Cpp , cMemb.h
  • UpdateUserCount() : cMemb.Cpp
  • UpdateUserDisplay() : cMemb.Cpp
  • UpdateUserInfo() : cMemb.Cpp
  • UpdateWindowTitle() : quecore.h , printjob.c
  • UpgradeMsi() : setup.h , upgrdmsi.cpp
  • Upload() : Sample1.h , Sample1.Cpp
  • UrlCombineW() : cpack.cpp
  • Usage() : Cxhndlc.c , Pipec.c , InOutc.c , Picklpc.c
  • usage() : PrSamp.h
  • Usage() : msiloc.cpp , rnrcs.cpp , Overlap.c
  • usage() : rcvall.c
  • Usage() : ModifyRecords.cpp , Sockdupc.c , Ioctl.c , IPChange.Cpp
  • usage() : Mcastws1.c
  • Usage() : Pickltc.c , ChgState.Cxx , RasDialAsync.c , AdvQuery.Cxx , Hellos.c , WSnmpUtil.h , Pipes.c , Server.cpp , Client.cpp , Bcast.c , RPCssmc.c , Xmitc.c , Repass.c , ClUuids.c , ComPerf.Cpp , IPStat.Cpp , Sockdups.c , RPCssms.c , Xmits.c , DUnionc.c , AuthzCli.c , Repasc.c , InOuts.c , IPRenew.Cpp , Simples.c , DUnions.c , AsyncRPCc.c , Client.c , ClUuidc.c , IPArp.Cpp
  • usage() : rawudp.c
  • Usage() : Usrdefs.c , QSample.Cxx , Server.c
  • usage() : Ping.cpp
  • Usage() : Dyneptc.c
  • usage() : client.cxx
  • Usage() : Helper.Cpp , RasDial.c , Simplec.c , Dynepts.c , Cxhndls.c
  • usage() : PrPerf.c
  • Usage() : Usrdefc.c , WebServer.c , HeadDump.cpp , AsyncRPCs.c
  • usage() : instlsp.cpp
  • Usage() : WebClient.c , customentry.c , IPRoute.Cpp , Helloc.c , Client.C
  • usage() : log.c , GssClient.c
  • Usage() : DNSQuery.Cpp
  • usage() : GssServer.c
  • Usage() : DirEncrypt.Cpp
  • usage() : Mcastws2.c
  • UsageDlgProc() : sdkdiff.cpp
  • UseCase1() : app.cpp
  • UseCase2() : app.cpp
  • UseCase3() : app.cpp
  • UseCase4() : app.cpp
  • UseCase5() : app.cpp
  • UseCase6() : app.cpp
  • UseDialingRules() : TapiCode.c
  • UsernameCommand() : Eap.h , Eap.c
  • UsernameDialogProc() : Eap.c , Eap.h
  • UserPrivilege() : Admapit.c
  • USPDlgProc() : global.h
  • UsrdefProc() : Usrdefp.c
  • UtilAllocMem() : Util.h , Util.Cpp
  • UtilFreeMem() : Util.Cpp , Util.h
  • utils_CompPath() : gutils.h , utils.cpp
  • utils_isblank() : gutils.h , utils.cpp
  • uudecode() : HttpAuth.c
  • uuencode() : HttpAuth.c
  • uuid() : myProp.Idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- v -

  • ValidateArgs() : rawudp.c , Mcastws1.c , Ping.cpp , rcvall.c , Mcastws2.c
  • ValidateAuthenticationMethods() : HttpAuth.c , HttpAuth.h
  • ValidateCallingUser() : RasHost.Cpp , RasHost.h
  • ValidateGlobalConfig() : configmgr.c
  • ValidateInterfaceConfig() : networkmgr.c
  • ValidateUpdate() : setup.h , upgrdmsi.cpp
  • ValidateUser() : AuthFilt.h , db.c
  • validnum() : dbh.cpp
  • ValidOptions() : IocpServer.Cpp , IocpServer.h , IocpServerex.Cpp
  • Value() : MtsUserEventObj.Idl
  • ValueToString() : AdvClientdlg.cpp , AdvClientdlg.h , UtilLib.h , Utils.Cpp
  • VariableInitialization() : TakeOwn.c
  • VariantChangeFast() : common.cpp , common.h
  • VariantClearFast() : common.cpp , common.h
  • VariantCopyFast() : common.cpp , common.h
  • VariantInitFast() : common.cpp , common.h
  • VariantSetArray() : util.cpp , util.h
  • VariantSetVar() : util.cpp , util.h
  • VariantToPtrList() : helper.cpp , helper.h
  • VariantToString() : common.cpp , common.h
  • VariantToStringList() : helper.cpp , helper.h
  • VDumpArray() : AdsiDump.cpp
  • VDumpAttribute() : AdsiDump.cpp
  • VDumpObject() : AdsiDump.cpp
  • VDumpTree() : AdsiDump.cpp
  • VectorToString() : common.cpp , common.h
  • VerifyAndWarnUsableLine() : TapiCode.c
  • VerifyDlgProc() : SetDisp.c , SetDisp.h
  • VerifyFileSignature() : setup.h , utils.cpp
  • VerifyIndex() : quiktest.c
  • VerifyProcTable() : spi.cpp
  • VerifySchema() : bankdlg.Cpp , bankthrds.Cpp
  • VerifySignature() : Stubs.c
  • VerifyThis() : Security.cpp , Security.h
  • VerifyTimerProc() : SetDisp.c , SetDisp.h
  • VerifyUsableLine() : TapiCode.c
  • vErrOut() : MfEdit.c
  • view_changediffoptions() : view.cpp , view.h
  • view_changeviewoptions() : view.cpp , view.h
  • view_close() : view.cpp , view.h
  • view_delete() : view.cpp , view.h
  • view_expand() : view.h , view.cpp
  • view_expand_item() : view.cpp
  • view_expanding() : view.cpp , view.h
  • view_expandstart() : view.h , view.cpp
  • view_findchange() : view.cpp , view.h
  • view_findrow() : view.cpp
  • view_findstring() : view.cpp , view.h
  • view_freemappings() : view.cpp
  • view_getcomplist() : view.h , view.cpp
  • view_getcurrenttag() : view.cpp , view.h
  • view_gethwnd() : view.h , view.cpp
  • view_getitem() : view.cpp , view.h
  • view_getlinenr_left() : view.cpp , view.h
  • view_getlinenr_right() : view.cpp , view.h
  • view_getmarkstate() : view.h , view.cpp
  • view_getrowcount() : view.cpp , view.h
  • view_getrowstate() : view.h , view.cpp
  • view_getstate() : view.cpp , view.h
  • view_gettext() : view.cpp , view.h
  • view_gettextW() : view.cpp , view.h
  • view_getwidth() : view.h , view.cpp
  • view_gototableline() : view.h , view.cpp
  • view_isexpanded() : view.h , view.cpp
  • view_new() : view.h , view.cpp
  • view_newitem() : view.cpp , view.h
  • view_outline() : view.h , view.cpp
  • view_outline_opt() : view.cpp
  • view_setcomplist() : view.cpp , view.h
  • view_setmarkstate() : view.h , view.cpp
  • ViewportWndProc() : FVProc.Cpp , FVText.h
  • VirtualBufferExceptionFilter() : AsyncIO.h , AsyncIO.c
  • VirtualChannelEntry() : SysInf_C.c
  • VirtualChannelInitEventProc() : SysInf_C.c
  • VirtualChannelOpenEvent() : SysInf_C.c
  • VirtualKeyHandler() : Main.C
  • VIterateSafeArray() : AdsiDump.cpp
  • VOID() : GinaHook.h , GinaStub.h
  • VThrowAdsError() : AdsiDump.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- w -

  • W2AHelper() : StrConv.h
  • Wait() : helpdll.Cpp
  • WaitForCallState() : TapiCode.c
  • WaitForProcess() : setup.h , upgrdmsi.cpp
  • WaitForQueryToComplete() : AdvQuery.Cxx
  • WaitForReply() : TapiCode.c
  • WaitForTheWrite() : SysInf_C.c
  • WaitForTraps() : WSnmpUtil.Cpp , WSnmpUtil.h
  • WaitThread() : WMIDiskPerf.Cpp
  • WarnIfGlobalPolicySet() : ListAcl.Cpp
  • WarningBox() : TapiCode.c
  • WarnMsg() : Debug.Cpp , Global.h
  • WatcherDialogProc() : rtcdialogs.cpp
  • WaveOpenFile() : wave.cpp , wave.h
  • WavePlayFileCB() : wave.cpp , wave.h
  • WaveSaveFile() : wave.cpp , wave.h
  • WaveTogglePlayback() : wave.cpp , wave.h
  • WbemConnect() : tracewmi.cpp
  • WbemErrorString() : UtilLib.h , Utils.Cpp
  • WCHAR_STRING_free_inst() : Repascu.c
  • WCHAR_STRING_free_local() : Repascu.c
  • WCHAR_STRING_from_local() : Repascu.c
  • WCHAR_STRING_to_local() : Repascu.c
  • wcscmp_fast() : string_fast.Cpp , string_fast.h
  • wcscpy_count() : string_fast.Cpp , string_fast.h
  • wcscpy_fast() : string_fast.Cpp , string_fast.h
  • wcsDuplicate() : common.cpp , common.h , common.cpp , common.h
  • wcsncmp_fast() : string_fast.Cpp , string_fast.h
  • wcsncpy_fast() : string_fast.Cpp , string_fast.h
  • wd_copy() : sdkdiff.cpp
  • wd_dirdialog() : sdkdiff.cpp
  • wd_initial() : sdkdiff.cpp
  • WEP() : gutils.cpp , dllstub.c , Wepcode.c
  • wGetDlgItemText() : winmain.cpp , winmain.h
  • wGetWindowText() : common.cpp , common.h
  • while() : Utils.Cpp
  • WhoAmI() : VCSecuritySample.Idl , formdump.cpp
  • WideCharToLocal() : IcnOvrly.h , ADEvent.cpp , Utility.Cpp , Utility.h , IcnOvrly.Cpp
  • Win4AssertEx() : Assert.Cxx
  • Winch() : MICARS.Idl
  • WindowProc() : AppUtil.Cpp , AppUtil.h , cwindow.Cxx , cwindow.h
  • WindowsDispatch() : Main.cpp
  • WindowsInit() : Main.cpp
  • WindowsMainProc() : Main.cpp
  • WindowsStart() : Main.cpp
  • WindowsStop() : Main.cpp
  • WinHttpFormSubmitSample() : WinHttpFormSubmitSample.cpp
  • WinHttpSamplePost() : WinHttpPostSample.cpp
  • WinMain() : winmain.cpp , MciPlay.c , MidiPlyr.c , FontView.c , APP.Cxx , APP.Hxx , Fontsize.c , GdiDemo.c , MfEdit.c , Mypal.c , Printer.c , printjob.c , SetDisp.c , TextFx.c , ViewDIB.c , WinCap.c , halftone.c , PlgBlt.c , WxForm.c , GetImage.cpp , PhoneEntry.c , rtcsample.cpp , Dialer.c , WinMain.c , FileTerm.cpp , Incoming.Cpp , Outgoing.Cpp , WinMain.c , Main.Cpp , setup.cpp , Main.cpp , AdvReco.cpp , BasicRecognition.cpp , EventSink.cpp , MultiReco.cpp , TPCInfo.cpp , bits_ie.cpp , main.cpp , dxsurf1.cpp , dxsurf2.cpp , dxsurf3.cpp , main.cpp , Cap.Cpp , Hello.Cpp , Hello2.Cpp , Hello3.Cpp , InstCodc.Cpp , Main.Cpp , ui.cpp , Main.Cpp , Demo.c , Main.Cpp , ui.cpp , Generic.C , AsyncDemo.cpp , sdkdiff.cpp , AsyncDemo.cpp , DebMain.c , WinMain.Cxx , Client32.c , Server32.c , DoServer.Cpp , Monkey.c , StatList.c , Framer.Cpp , LeakyBin.c , ClipText.c , custsur.Cpp , CDTest.c , ComDlg32.C , Cancel.Cpp , Property.c , Rebar.c , OleImp.Cpp , VListVw.c , VListVw.h , secClnt.Cpp , Cursor.c , fulldrag.c , secSvr.Cpp , CSSamp.Cpp , Main.C , OleApt.Cpp , Main.C , IMEApps.c , server.cxx , MultiUI.C , MultiUI.h , SimpCntr.Cpp , MousInfo.c , MousInfo.h , SimpCntr.h , Menu.c , Obscure.c , SimpDnd.Cpp , DynDlg.c , IconPRO.C , SimpDnd.h , sendto.c , Main.c , SimpSvr.Cpp , CustomDrawButtonDlg.cpp , DragImg.Cpp , SimpSvr.h , enumdesk.cpp , fakemenu.c , AptClien.Cpp , App32.C , tallmenu.c , AptServe.Cpp , tsfapp.cpp , compart.cpp , ComUser.Cpp , ConClien.Cpp , DcdServe.Cpp , DComDraw.Cpp , DllClien.Cpp , DllUser.Cpp , ExeSkel.Cpp , FreClien.Cpp , LicClien.Cpp , LocClien.Cpp , LocServe.Cpp , PerClien.Cpp , ReadTut.Cpp , register.Cpp , RemClien.Cpp , StoClien.Cpp , cdialoglite.cpp
  • WINOLEAPI_() : OleStd.h
  • WireToHostFormat16() : Eap.c
  • WlxActivateUserShell() : GinaHook.c , GinaStub.c
  • WlxDisplayLockedNotice() : GinaHook.c , GinaStub.c
  • WlxDisplaySASNotice() : GinaHook.c , GinaStub.c
  • WlxDisplayStatusMessage() : GinaHook.c , GinaStub.c
  • WlxGetStatusMessage() : GinaHook.c , GinaStub.c
  • WlxInitialize() : GinaHook.c , GinaStub.c
  • WlxIsLockOk() : GinaHook.c , GinaStub.c
  • WlxIsLogoffOk() : GinaHook.c , GinaStub.c
  • WlxLoggedOnSAS() : GinaHook.c , GinaStub.c
  • WlxLoggedOutSAS() : GinaHook.c , GinaStub.c
  • WlxLogoff() : GinaHook.c , GinaStub.c
  • WlxNegotiate() : GinaStub.c , GinaHook.c
  • WlxNetworkProviderLoad() : GinaHook.c , GinaStub.c
  • WlxRemoveStatusMessage() : GinaStub.c , GinaHook.c
  • WlxScreenSaverNotify() : GinaHook.c , GinaStub.c
  • WlxShutdown() : GinaStub.c , GinaHook.c
  • WlxStartApplication() : GinaHook.c , GinaStub.c
  • WlxWkstaLockedSAS() : GinaHook.c , GinaStub.c
  • wmain() : propdump.cpp , stgcreatepropsetstg.cpp , writeread.cpp , main.cpp , bindtoparent.cpp , main.cpp , otherwko.cpp , otherwko1.cpp , queryusers.cpp , iasuser.cpp , wkguid.cpp , main.c , ChngPass.c , NetShare.c , Audit.c , MachAcct.c , security.cpp , EnumerateKeys.cpp , ChgState.Cxx , QSample.Cxx , DskQuota.Cpp , AdvQuery.Cxx , KList.c , getschemainfo.cpp , objectSid.cpp , Sample1.Cpp
  • wMessageBox() : common.h , winmain.cpp , winmain.h , common.cpp
  • WndProc() : ui.cpp , Generic.C , FontView.c , APP.Cxx , APP.Hxx , GdiDemo.h , Mypal.c , printjob.c , TextFx.c , TextFx.h , ViewDIB.c , WinCap.h , halftone.c , GLOBALS.h , TapiComm.c , Globals.h , IpxChat.c , BasicRecognition.cpp , dxsurf1.cpp , dxsurf2.cpp , dxsurf3.cpp , MainDlg.Cpp , IconPRO.C , Global.h , MainWnd.c , Msg.Cpp , Global.h , Msg.Cpp , Global.h , Msg.Cpp , Global.h , StatList.c , LeakyBin.c , DragImg.h , MainWnd.h , EventSink.cpp , main.cpp , printjob.h , WinCap.c , GdiDemo.c
  • WorkerFcn() : fullserv.Cpp
  • WorkerFunction() : KeepAliveP.c , ThreadPool.h , WorkerThread.c
  • WorkerThread() : IocpServer.Cpp , InvokObjThreads.cpp , IocpServerex.Cpp , AsyncIO.c , Handler.Cpp , Handler.h , IocpServer.h , AsyncIO.h , SysInf_C.c
  • WorkerThreadProc() : PoolWrap.cpp
  • WorkerThreadWndProc() : Handler.Cpp , Handler.h
  • WrapCompareString() : StringUtils.cpp , PropList.cpp , StringUtils.cpp
  • write_all() : GssMisc.c
  • WriteBMPFile() : Dib.h , Dib.c
  • WriteChars() : string_fast.Cpp , string_fast.h , string_fast.Cpp , string_fast.h , string_fast.Cpp , string_fast.h
  • WriteColumnInfo() : dump.cpp , sampclnt.h
  • WriteCommString() : CommCode.h , CommCode.c
  • WriteDataToFile() : Picklpc.c , Pickltc.c
  • WriteDebug() : IsapiDebug.h , WildCardMap.cpp , IsapiDebug.cpp
  • WriteDebugArgs() : IsapiDebug.cpp
  • WriteDebugString() : NewFsp.h , Util.c
  • WriteDIB() : File.c
  • WriteDouble() : strmHelp.Cxx , strmHelp.h
  • WriteEcbDump() : DumpRequestInfo.cpp
  • WriteFunc() : Client.c
  • WriteICOHeader() : Icons.C
  • WriteIconToICOFile() : Icons.C , Icons.h
  • WriteIniBool() : Global.h , Util.Cpp
  • WriteIniHex() : Global.h , Util.Cpp
  • WriteIniInt() : Util.Cpp , Global.h
  • WriteIniStr() : Util.Cpp , Global.h
  • WriteIniTbar() : Global.h , sBar.Cpp
  • WriteLoop() : UnBufCp2.c
  • WriteNamedParam() : utils.Cpp , utils.h
  • writeOmid() : app.cpp , stl_write.cpp
  • WritePref() : Global.h , Init.Cpp
  • WritePrivateProfileInt() : DebMisc.h , DebMisc.c
  • WritePrivateProfileSettings() : DebMisc.c , DebMisc.h
  • WriteProfileInt() : sdkdiff.cpp
  • WriteProxyServerSettingToFile() : cmsample.cpp
  • writer() : NmPipe.c
  • WriteRequestEntity() : DumpRequestInfo.cpp
  • WriteRequestHeaders() : DumpRequestInfo.cpp
  • WriteRoutingInfoIntoIniFile() : FaxSiren.Cpp
  • WriteSampleToFile() : Processing.cpp
  • WriteServerVariables() : DumpRequestInfo.cpp
  • WriteStreamToFile() : Processing.cpp
  • WriteStreamToLog() : SimpleLog.Idl
  • WriteString() : html.h , html.cpp
  • WriteToDisplayCtl() : EDITCTLS.c , EDITCTLS.h
  • WriteToPipe() : common.c , common.h
  • WriteVariantToLog() : SimpleLog.Idl
  • WSAExceptionNotify() : Dt_Dll.h
  • WSAPostApiNotify() : Dt_Dll.Cpp , Dt_Dll.h , Dt_Dll.Cpp
  • WSAPreApiNotify() : Dt_Dll.h , Dt_Dll.Cpp
  • wSelectPalette() : app.h , app.Cpp
  • wSendMessage() : asserts.cpp , winmain.h , asserts.h , common.cpp , winmain.cpp , common.h
  • wSendMessageFmt() : common.h , common.cpp
  • wSetDlgItemText() : winmain.cpp , winmain.h
  • WSPAccept() : spi.cpp
  • WSPAddressToString() : spi.cpp
  • WSPAsyncSelect() : spi.cpp
  • WSPBind() : spi.cpp
  • WSPCancelBlockingCall() : spi.cpp
  • WSPCleanup() : spi.cpp
  • WSPCloseSocket() : spi.cpp
  • WSPConnect() : spi.cpp
  • WSPDuplicateSocket() : spi.cpp
  • WSPEnumNetworkEvents() : spi.cpp
  • WSPEventSelect() : spi.cpp
  • WSPGetOverlappedResult() : spi.cpp
  • WSPGetPeerName() : spi.cpp
  • WSPGetQOSByName() : spi.cpp
  • WSPGetSockName() : spi.cpp
  • WSPGetSockOpt() : spi.cpp
  • WSPIoctl() : spi.cpp
  • WSPJoinLeaf() : spi.cpp
  • WSPListen() : spi.cpp
  • WSPRecv() : spi.cpp
  • WSPRecvDisconnect() : spi.cpp
  • WSPRecvFrom() : spi.cpp
  • WSPSelect() : spi.cpp
  • WSPSend() : spi.cpp
  • WSPSendDisconnect() : spi.cpp
  • WSPSendTo() : spi.cpp
  • WSPSetSockOpt() : spi.cpp
  • WSPShutdown() : spi.cpp
  • WSPSocket() : spi.cpp
  • WSPStartup() : spi.cpp
  • WSPStringToAddress() : spi.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- x -

  • x() : GraphObj.Idl
  • x1() : GraphObj.Idl
  • x2() : GraphObj.Idl
  • XFormClear() : Bounce.c
  • XFormCommandProc() : XForm.c , XForm.h
  • XFormCreateProc() : XForm.c , XForm.h
  • XFormDestroyProc() : XForm.c , XForm.h
  • XformHeightInHimetricToPixels() : site.Cpp
  • XFormPaintProc() : XForm.c , XForm.h
  • XFormPoint() : Bounce.c
  • XFormProc() : XForm.c , XForm.h
  • XFormScale() : Bounce.c
  • XFormTrans() : Bounce.c
  • XformWidthInHimetricToPixels() : site.Cpp
  • XlatSMFErr() : SEQUENCE.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

- y -

  • y() : GraphObj.Idl
  • y1() : GraphObj.Idl
  • y2() : GraphObj.Idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- _ -

  • _ADO : adoint.h
  • _ADOCollection : adoint.h
  • _ADOCollectionVtbl : adoint.h
  • _ADODynaCollection : adoint.h
  • _ADODynaCollectionVtbl : adoint.h
  • _ADOVtbl : adoint.h
  • _Command : adoint.h
  • _CommandVtbl : adoint.h
  • _Connection : adoint.h
  • _ConnectionVtbl : adoint.h
  • _Parameter : adoint.h
  • _ParameterVtbl : adoint.h
  • _Recordset : adoint.h
  • _RecordsetVtbl : adoint.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- j -

  • JOB_INFO : NewFsp.h
  • JOBDATA : queue.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- k -

  • KEYFRAME : SMF.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- l -

  • LABELEXTRACT : Common.h
  • LINE : line.h , DrawArea.h , drawarea.h , DrawArea.h
  • LINE_INFO : nullmdm.h
  • LINEINFO : Dialer.c
  • LIST : list.h , LinkList.h
  • LISTPOS : list.h
  • LISTPROP : keys.cpp
  • LOCAL_HEAP_INFO : PerfUtil.h
  • LOCINFO : global.h
  • LOCKED_LIST : sync.h
  • LockTypeEnum : adoint.h
  • LOG_RM_COMMAND : SimpleLog.Idl
  • LOGERRORMSG : Handler.h
  • LOGON : Security.Cpp
  • long2bstr : dynamic.h
  • LPASYNCITEST : main.cpp
  • LPBALLDATA : Bounce.h
  • LPBASENODE : basenode.h
  • LPBEZBUFFER : Poly.h
  • LPBITARRAY : bitarray.h
  • LPBOUNCEDATA : Bounce.h
  • LPCALLFACTORY : CAsyncXXX.h , DCOMServer.h , main.cpp
  • LPCClassFactory : Cfact.h
  • lpCellData : table.h
  • lpCellDataList : table.h
  • lpCellPos : table.h
  • LPCHILDPROPS : basenode.h
  • LPCLIENTSECURITY : ComPerf.Cpp
  • LPCMALLOCSPY : malspy.c
  • LPCMD : Global.h
  • LPCMDI : GLOBALS.h , Globals.h
  • LPCOL : Main.Cpp , Global.h
  • lpColProps : table.h
  • lpColPropsList : table.h
  • LPCOMPERFORMANCE : ComPerf.Cpp
  • LPCREATEGIZMO : GizmoBar.h
  • LPCREATEGIZMOA : GizmoBar.h
  • LPCREATEGIZMOW : GizmoBar.h
  • LPCSHELLEXT : ShellExt.h
  • LPCSHELLEXTCLASSFACTORY : ShellExt.h
  • LPDOREGSTRUCT : OLEDoc.Cpp , BandObjs.Cpp
  • LPDRAWDATA : Draw.h
  • LPDRAWINFO : Common.h
  • LPENUMLIST : Enumidl.h
  • LPEVENTID : CConnectionPT.h
  • LPEXTBUFFER : extbuff.h
  • LPFFSTREAM : FindStream.c
  • LPFILEDEX : fileidx.h
  • LPFILEOBJECT : Handler.h
  • LPFILEOBJECTLIST : Handler.h
  • LPFNDLLFUNC : Cmd.Cpp
  • LPFNDTHANDLER : Handlers.h
  • LPFNOLEUIHOOK : OleStd.h
  • LPFNREG : ComPerf.Cpp
  • LPFNWSAEXCEPTIONNOTIFY : Dt_Dll.h
  • LPFNWSANOTIFY : Dt_Dll.h
  • LPFONTLIST : Dialogs.c
  • LPFONTSTRUCT : Dialogs.c
  • LPGBGETINT : GizmoBar.h
  • LPGBGETTEXT : GizmoBar.h
  • LPGBGETTEXTA : GizmoBar.h
  • LPGBGETTEXTW : GizmoBar.h
  • LPGBMSG : GizmoBar.h
  • LPGBSETINT : GizmoBar.h
  • LPGENERICITEM : Enum.h
  • LPGENERICITEMLIST : Enum.h
  • LPHANDLERITEM_SYNCSTATUS : Handler.h
  • LPHANDLERITEMSETTINGS : Settings.h
  • lpHANDLES : quiktest.c
  • LPHEADER : malspy.c
  • LPICMP_HDR : iphdr.h
  • LPICONEXTRACT : Common.h
  • LPINTERFACEIMPL : OleStd.h
  • lpInterfaceInfo : msgfiltr.h
  • LPIPV4_HDR : iphdr.h
  • LPIPV4_OPTION_HDR : iphdr.h
  • LPIPV6_FRAGMENT_HDR : iphdr.h
  • LPIPV6_HDR : iphdr.h
  • LPITEMINFO : enumdesk.h
  • LPLABELEXTRACT : Common.h
  • lpLineData : tpriv.h
  • LPLINEINFO : Dialer.c
  • LPLOCINFO : global.h
  • LPLPFNDTHANDLER : Handlers.h
  • LPLPVOID : sampprov.h
  • lpMargin : table.h
  • LPMAZEDATA : Maze.h
  • LPMETA16HEADER : MfEdit.h
  • LPMSD : Global.h , Msg.Cpp , Global.h
  • LPMSDI : Globals.h , GLOBALS.h
  • LPMYDATA : ComDlg32.C
  • LPMYSTR : Wapi.h
  • LPMYTOOLINFO : Tools.h
  • LPMYXFORM : Bounce.h
  • LPNODE_PROPERTIES : basenode.h
  • LPNODEPROPS : basenode.h
  • LPOLESTDENUMFMTETC : enumfetc.c
  • LPOLESTDENUMSTATDATA : enumStat.c
  • LPOLESTDMESSAGEFILTER : msgfiltr.c
  • LPOPEN_FILE : openf.c
  • LPOPTIONSTRUCT : WinCap.h
  • LPPIDLDATA : PidlMgr.h
  • LPPOLYDATA : Poly.h
  • LPPREROLL : SEQ.h
  • lpPrintContext : table.h
  • LPPRIVCLIPDATA : Utility.h
  • lpProps : table.h
  • LPPROVIDER : provider.h
  • LPREGSTRUCT : ADEvent.cpp , SampView.Cpp , IcnOvrly.Cpp
  • LPRGPT : Mypal.h
  • LPRSI : suminfo.Cpp
  • LPSAMPLEITEMSETTINGS : Settings.h
  • lpSERVERINFO : custom.c , autotest.h
  • LPSTDZ : suminfo.h
  • LPSTREAM_FIND_DATA : FindStream.h
  • LPSTZR : suminfo.h
  • LPSUMINFO : suminfo.h
  • LPSYNCHRONIZE : main.cpp , CAsyncXXX.h , DCOMServer.h
  • lpTable : tpriv.h
  • lpTableHdr : table.h
  • lpTableSelection : table.h
  • LPTEXTBUTTON : ToolBar.h
  • LPTHUMB : suminfo.h
  • lpTitle : table.h
  • LPTOOLDISPLAYDATA : BttnCur.h
  • LPVERBMAPPING : ContMenu.Cpp
  • LPVIEWLIST : Viewlist.h
  • LPWSAOVERLAPPEDPLUS : provider.h
  • LPXFORMDATA : XForm.h
  • LSP_ENTRY : instlsp.cpp
  • LSTSLOT : hashtbl.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- m -

  • MAPMODELOOKUP : Printer.h
  • MapStringToAppInfo : StdAfx.h
  • MarshalOptionsEnum : adoint.h
  • MAZEDATA : Maze.h
  • MEMORY_ALLOC_BLOCK : LeakyBin.h
  • MESSAGE : SampSSP.H
  • META16HEADER : MfEdit.h
  • METALOOKUP : MfEdit.h
  • METHODARGS : Handler.h
  • MIB_ENTRY : TestMIB.h
  • MIDL_PROC_FORMAT_STRING : EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c , ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c
  • MIDL_TYPE_FORMAT_STRING : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • MMCControl : atlcontrol.h
  • MODE : Bcast.c
  • MOF_INFO : tracedmp.h
  • MOVEPROC : section.cpp
  • MPOINT : Select.h , Mypal.h , Cursor.h
  • MSD : GLOBALS.h , Global.h , Msg.Cpp , Global.h , Globals.h , Global.h
  • MSDI : GLOBALS.h , Globals.h
  • MSGPENDINGPROC : msgfiltr.h
  • MSOmniProv : theprovider.h
  • MSV1_0_INTERACTIVE_LOGON : Npaux.h
  • MSV1_0_LOGON_SUBMIT_TYPE : Npaux.h
  • MTS_OBJID : MtsAudit.Idl
  • MTS_RESID : MtsAudit.Idl
  • MULTI_SZ : multisz.h
  • MULTISELECT_COOKIES : dataobj.h
  • MyBoolean : CallAs.Idl
  • MYCHAR : Wapi.h
  • MYDATA : ComDlg32.C
  • MYSTATE : Eap.h
  • MYXFORM : Bounce.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- n -

  • NAMEMAP : error.h
  • NETWORK_ENTRY : networkentry.h
  • NmApplet : iapplet.h
  • NODE : Collect.cpp , LinkList.h
  • NODE_ATTRIBS : globals.h
  • NODE_PROPERTIES : basenode.h
  • NODEPROPS : basenode.h
  • NPBALLDATA : Bounce.h
  • NPBEZBUFFER : Poly.h
  • NPBOUNCEDATA : Bounce.h
  • NPDRAWDATA : Draw.h
  • NPFONTLIST : Dialogs.c
  • NPFONTSTRUCT : Dialogs.c
  • NPMAZEDATA : Maze.h
  • NPMYXFORM : Bounce.h
  • NPPOLYDATA : Poly.h
  • NPXFORMDATA : XForm.h
  • NTSTATUS : Except.Cxx
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- o -

  • OBJECT : Main.h
  • ObjectStateEnum : adoint.h
  • OLESTDENUMFMTETC : enumfetc.c
  • OLESTDENUMSTATDATA : enumStat.c
  • OLESTDMESSAGEFILTER : msgfiltr.c
  • OM_uint32 : GssAPI.h
  • OPEN_FILE : openf.c
  • OPTIONS : Qoslist.Cpp , ATMEvent.h , IocpClient.Cpp , QosEvent.h , AppBar.h
  • OPTIONSTRUCT : WinCap.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- a -

  • AcceptContext : common.h
  • ACCEPTEXARGS : provider.h
  • ACCESSOR : sampprov.h
  • ADOConnectionConstruction : adoint.h
  • ADOConnectionConstructionVtbl : adoint.h
  • ADORecordsetConstruction : adoint.h
  • ADORecordsetConstructionVtbl : adoint.h
  • ADSDLGPROC : StdAfx.h
  • ADSERRMSG : StdAfx.h
  • ADsError : ADsError.h
  • ADSIIF : StdAfx.h
  • AffectEnum : adoint.h
  • AIO_WORK_ITEM : ftrans.c , fwasync.c
  • AppletCapability : iapplet.h
  • AppletCapability2 : iapplet.h
  • AppletCapabilityClass : iapplet.h
  • AppletCapabilityID : iapplet.h
  • AppletCapabilityType : iapplet.h
  • AppletCapIDType : iapplet.h
  • AppletChannelCommand : iapplet.h
  • AppletChannelID : iapplet.h
  • AppletChannelRequest : iapplet.h
  • AppletChannelType : iapplet.h
  • AppletConfID : iapplet.h
  • AppletEntityID : iapplet.h
  • AppletKeyType : iapplet.h
  • AppletLongString : iapplet.h
  • AppletModificationRights : iapplet.h
  • AppletNodeID : iapplet.h
  • AppletObjectKey : iapplet.h
  • AppletOctetString : iapplet.h
  • AppletPriority : iapplet.h
  • AppletProtocolEntity : iapplet.h
  • AppletReason : iapplet.h
  • AppletRecord : iapplet.h
  • AppletRegistryCommand : iapplet.h
  • AppletRegistryEntryOwner : iapplet.h
  • AppletRegistryItem : iapplet.h
  • AppletRegistryItemType : iapplet.h
  • AppletRegistryKey : iapplet.h
  • AppletRegistryRequest : iapplet.h
  • AppletRequestTag : iapplet.h
  • AppletResourceAllocCommand : iapplet.h
  • AppletRoster : iapplet.h
  • AppletSessionID : iapplet.h
  • AppletSessionKey : iapplet.h
  • AppletSessionRequest : iapplet.h
  • AppletTokenCommand : iapplet.h
  • AppletTokenID : iapplet.h
  • AppletTokenRequest : iapplet.h
  • AppletTokenStatus : iapplet.h
  • AppletUserID : iapplet.h
  • APPMEM_COUNTERS : DataMem.h
  • APPMEM_DATA_DEFINITION : DataMem.h
  • APPMEM_DATA_HEADER : AppMemi.h
  • APPMEM_INSTANCE : AppMemi.h
  • ARFONTS : Paint.h
  • ASYNC_REQUEST : Atsp.h
  • AUTH_SEQ : HttpAuth.c , Security.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- b -

  • BALLDATA : Bounce.h
  • BEZBUFFER : Poly.h
  • BINDING : odbcsql.c
  • BINDING_ENTRY : networkentry.h
  • bitmap : section.cpp
  • BLOCK : list.cpp
  • BLRPLATECONFIG : blrplate.h
  • BLRPLATEHDR : blrplate.h
  • BookmarkEnum : adoint.h
  • BOOL : GinaStub.h , GinaHook.h , LinkList.h
  • BOUNCEDATA : Bounce.h
  • BRUSHSTYLELOOKUP : Printer.h
  • bstr2long : dynamic.h
  • BSTRC : policy.h
  • BUFFER : HttpAuth.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- c -

  • CALL_STATE : nullmdm.h
  • CAPSLOOKUP : Getcaps.h
  • CComSDKSamplePlaylistParser : SDKSamplePlaylistParser.h
  • CHECKSUM : gutils.h
  • CHILDPROPS : basenode.h
  • CHUNKHDR : SMFI.h
  • CIB : MainWnd.h
  • ClientContext : TestAccept.cpp
  • CLIPBOOKSERVER_RESOURCE : ClipBook Server.cpp
  • clOption : client.cxx
  • CLSID : iapplet.c , ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c
  • CMALLOCSPY : malspy.c
  • CMD : GLOBALS.h , Globals.h , Global.h , dbh.cpp
  • CMDI : GLOBALS.h , Globals.h
  • CMDLN_STATE : cmsample.cpp
  • CMDPROC : dbh.cpp
  • CMTMLTFMT : MfEdit.h
  • COL : Main.Cpp , Global.h
  • COLORPICKSTATE : fakemenu.c
  • COLUMNDATA : hashtbl.h
  • Command : adoint.h
  • CommandTypeEnum : adoint.h
  • COMPITEM : compitem.h , complist.h , view.h
  • COMPLIST : compitem.h , complist.h , view.h
  • CONFIGITEMLISTVIEWLPARAM : Settings.h
  • CONFIGSETTINGSLPARAM : Settings.h
  • CONFIGURATION_ENTRY : configentry.h
  • CONNECTEXARGS : provider.h
  • Connection : adoint.h
  • ConnectModeEnum : adoint.h
  • ConnectPromptEnum : adoint.h
  • CONSOLE_VERSION : globals.h
  • CONSOLEDATA : SServer.Cpp
  • ContextNameHint : ContextPlugin.h
  • COPY_CHUNK : UnBufCp1.c , UnBufCp2.c
  • CPageList : ExtObj.h , BasePage.h , ExtObj.h
  • CREATEGIZMO : GizmoBar.h
  • CREDENTIAL : SampSSP.H
  • CrmFilesCreateFileLogRecord : CrmFilesWorker.h
  • CrmFilesDeleteFileLogRecord : CrmFilesWorker.h
  • CSampleDropExt : DropExt.C
  • CSZ : StdAfx.h
  • CTE_ENCODER : cte_enc.c
  • CursorLocationEnum : adoint.h
  • CursorOptionEnum : adoint.h
  • CursorTypeEnum : adoint.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- d -

  • DATA_BUFFER : common.h
  • DataTypeEnum : adoint.h
  • DBCONN : MqTrans.Cpp
  • DEB_DLL_LIST_INFO : DebDebug.h
  • DEB_DLL_NODE_INFO : DebDebug.h
  • DEB_PROCESS_LIST_INFO : DebDebug.h
  • DEB_PROCESS_NODE_INFO : DebDebug.h
  • DEB_STARTUP_INFO : DebDebug.h
  • DEB_THREAD_LIST_INFO : DebDebug.h
  • DEB_THREAD_NODE_INFO : DebDebug.h
  • DELETELOGERRORMSG : Handler.h
  • DEVICE_INFO : NewFsp.h
  • DIBDATA : MfEdit.h
  • Dimmer : MyDevice.h
  • DIMMINGSERVICE_SCPD_DISPIDS : DimmingService_SCPD.idl , MyDevice.h
  • DIRECT : scandir.cpp
  • DIRITEM : scandir.h
  • DIRLIST : scandir.h
  • DISCONNECTEXARGS : provider.h
  • DOSDTTM : wn_dos.h
  • DRAWDATA : Draw.h
  • DRAWINFO : Common.h
  • DRVLINE : Atsp.h
  • DRVLINECONFIG : Atsp.h
  • DSA_SEC_PAGE_INFO : PropSheetHost.h
  • DSTRUCT : quiktest.h
  • dummyStore : msomniprovrs.h
  • DWORD : GinaStub.h , GinaHook.h
  • dwTickCount : msgfiltr.h
  • DYNAMIC_LOCKS_STORE : sync.h
  • DYNAMIC_READWRITE_LOCK : sync.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- e -

  • EAP_NAME_DIALOG : Eap.h
  • EAPCB : Eap.h
  • EditModeEnum : adoint.h
  • ENABLEMODELESSMSG : Handler.h
  • ENHKEYUSAGE : CreateCert.c
  • ENTRY : secClnt.Cpp , secSvr.Cpp
  • ENUMERATE_DIRECTORY_STACK : AsyncIO.h
  • ENUMERATE_DIRECTORY_STATE : AsyncIO.h
  • ENUMLIST : Enumidl.h
  • ENUMPRTLOOKUP : Enumprt.h
  • Error : adoint.h
  • ERRORMAP : error.cpp
  • Errors : adoint.h
  • ErrorsVtbl : adoint.h
  • ErrorValueEnum : adoint.h
  • ErrorVtbl : adoint.h
  • ESTABLISHCONNECTIONMSG : Handler.h
  • EVENT : SMFI.h
  • EVENT_ENTRY : configentry.h
  • EVENT_SINK_INFO : selectEventsDlg.Cpp
  • Events : WaitSystemDlg.h
  • EX_BUF : common.h
  • ExecuteOptionEnum : adoint.h
  • EXT_WSPPROC_TABLE : provider.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- f -

  • FFSTREAM : FindStream.c
  • Field : adoint.h
  • FieldAttributeEnum : adoint.h
  • FIELDINFO : quiktest.h
  • FieldMetaData : pooleddata.h
  • Fields : adoint.h
  • FieldsVtbl : adoint.h
  • FieldVtbl : adoint.h
  • FILEBUFFER : gutils.h
  • FILEDATA : file.h
  • FILEHDR : SMFI.h
  • FILEINFO : MfEdit.h
  • FILEOBJECT : Handler.h
  • FILEOBJECTLIST : Handler.h
  • FILESHARESAMPLE_PROPS : File Share Sample.cpp
  • FILESHARESAMPLE_RESOURCE : File Share Sample.cpp
  • FILETIME : scandir.h
  • FilterGroupEnum : adoint.h
  • FILTERTYPE : appinfo.h
  • FONTLIST : Dialogs.c
  • FONTSTRUCT : Dialogs.c
  • Foo : suminfo.Cpp
  • FUNC_INFO : Atsp.h
  • FUNDSRM : AuthzSvr.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- g -

  • GBGETTEXT : GizmoBar.h
  • GENERICITEM : Enum.h
  • GENERICITEMLIST : Enum.h
  • GETINBOUNDBYTE : keys.cpp
  • GetRowsOptionEnum : adoint.h
  • GLOBAL : DebMain.h
  • GRAPHICLOOKUP : Printer.h
  • gss_buffer_desc : GssAPI.h
  • gss_buffer_t : GssAPI.h
  • gss_channel_bindings_t : GssAPI.h
  • gss_cred_id_t : GssAPI.h
  • gss_cred_usage_t : GssAPI.h
  • gss_ctx_id_t : GssAPI.h
  • gss_int32 : GssAPI.h
  • gss_name_t : GssAPI.h
  • gss_OID : GssAPI.h
  • gss_OID_desc : GssAPI.h
  • gss_OID_set : GssAPI.h
  • gss_OID_set_desc : GssAPI.h
  • gss_qop_t : GssAPI.h
  • gss_uint32 : GssAPI.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- h -

  • HANDLE : GinaHook.h , GinaStub.h
  • HANDLERITEM_SYNCSTATUS : Handler.h
  • HANDLERITEMSETTINGS : Settings.h
  • HANDLES : quiktest.c
  • HASH_TABLE : hashtable.h
  • HCOMMDEV : iplgxprt.idl
  • HCTE_ENCODER : ctetest.h
  • HEADER : malspy.c
  • HelloWorld : ADsFirstExt.h
  • HEVENT : iplgxprt.idl
  • HKEYLIST : keys.h
  • HPBYTE : SMF.h
  • HSOCKET : rusocket.h
  • htaskCaller : msgfiltr.h
  • HTDATA : MfEdit.h
  • HTTPCFG_TYPE : precomp.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- i -

  • IADsError : ADsError.h
  • IADsErrorVtbl : ADsError.h
  • IApplet : iapplet.h
  • IAppletNotify : iapplet.h
  • IAppletNotifyVtbl : iapplet.h
  • IAppletSession : iapplet.h
  • IAppletSessionNotify : iapplet.h
  • IAppletSessionNotifyVtbl : iapplet.h
  • IAppletSessionVtbl : iapplet.h
  • IAppletVtbl : iapplet.h
  • ICMP_HDR : iphdr.h
  • ICMPV6_ECHO_REQUEST : iphdr.h
  • ICMPV6_HDR : iphdr.h
  • ICONEXTRACT : Common.h
  • IDD : StdAfx.h
  • IDS : StdAfx.h
  • IGMP_GROUP_RECORD_V3 : iphdr.h
  • IGMP_HDR : iphdr.h
  • IGMP_HDR_QUERY_V3 : iphdr.h
  • IGMP_HDR_REPORT_V3 : iphdr.h
  • IHelloWorld : ADsFirstExt.h
  • IHelloWorldVtbl : ADsFirstExt.h
  • IID : iapplet.c , ADsFirstExt_i.c , ADsError_i.c , MyDevice_i.c
  • ILIST : status.cpp
  • IMEUIDATA : FullIME.h
  • IMMCControl : atlcontrol.h
  • IMMCControlVtbl : atlcontrol.h
  • INDEX : cdialoglite.h
  • INITDATA : Dt.h
  • INTERFACE_ENTRY : networkentry.h
  • INTERFACEIMPL : OleStd.h
  • INTERFACEMAP : error.cpp
  • INTS : suminfo.h
  • IO_OPERATION : IocpServer.h
  • IO_WORK_ITEM : areadcli.c
  • IOCTLARGS : provider.h
  • IPADDRESS : defs.h
  • IPSAMPLE_GLOBAL_CONFIG : ipsamplerm.h
  • IPSAMPLE_GLOBAL_STATS : ipsamplerm.h
  • IPSAMPLE_IF_BINDING : ipsamplerm.h
  • IPSAMPLE_IF_CONFIG : ipsamplerm.h
  • IPSAMPLE_IF_STATS : ipsamplerm.h
  • IPSAMPLE_IP_ADDRESS : ipsamplerm.h
  • IPSAMPLE_MIB_GET_INPUT_DATA : ipsamplerm.h
  • IPSAMPLE_MIB_GET_OUTPUT_DATA : ipsamplerm.h
  • IPSAMPLE_MIB_SET_INPUT_DATA : ipsamplerm.h
  • IPSAMPLE_STATUS_CODE : configentry.h
  • IPV4_HDR : iphdr.h
  • IPV4_OPTION_HDR : iphdr.h
  • IPV6_FRAGMENT_HDR : iphdr.h
  • IPV6_HDR : iphdr.h
  • IsolationLevelEnum : adoint.h
  • ITEM : list.cpp
  • ITEM_DESC : tracedmp.h
  • ITEM_TYPE : tracedmp.h
  • ITEMCONFIGSETTINGSLPARAM : Settings.h
  • IUPnPService_DimmingService_SCPD : MyDevice.h
  • IUPnPService_DimmingService_SCPDVtbl : MyDevice.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- p -

  • P_BROWSER_CONFIG : browser.h
  • PACCESSOR : sampprov.h
  • PACKET : packet.h
  • PADMINTYPE : Adminwrap.h
  • PADVISE_SINK : tsfedit.h
  • PAPMFILEHEADER : MfEdit.h
  • PAPPMEM_COUNTERS : DataMem.h
  • PAPPMEM_DATA_HEADER : AppMemi.h
  • PAPPMEM_INSTANCE : AppMemi.h
  • Parameter : adoint.h
  • ParameterAttributesEnum : adoint.h
  • ParameterDirectionEnum : adoint.h
  • Parameters : adoint.h
  • ParametersVtbl : adoint.h
  • PARAMS : Cancel.Cpp
  • PARFONTS : Paint.h
  • PASYNC_REQUEST : Atsp.h
  • PATTRIBUTES : tsfedit.h
  • PAUTH_SEQ : Security.cpp
  • PAWI : ftrans.c , fwasync.c
  • PBALLDATA : Bounce.h
  • PBEZBUFFER : Poly.h
  • PBINDING_ENTRY : networkentry.h
  • PBLOCK : list.cpp
  • PBLRPLATECONFIG : blrplate.h
  • PBLRPLATEHDR : blrplate.h
  • PBOUNCEDATA : Bounce.h
  • PCBINDER : binder.h
  • PCClassPro : Sample.h
  • PCCOMMAND : command.h
  • PCDATASOURCE : datasrc.h
  • PCDBSESSION : dbsess.h
  • PCEnumFormatEtc : enumformatetc.h
  • PCFILEIO : fileio.h
  • PCFileViewer : FVText.h
  • PCFrame : Framer.h
  • PCFVClassFactory : FileView.h
  • PCHILDWINDOWDATA : MDIChild.h
  • PCHourglass : Framer.h
  • PCHUNKHDR : SMFI.h
  • PCIB : MainWnd.h
  • PCImpIAdviseSink : Site.h
  • PCImpIOleClientSite : Site.h
  • PCImpIOleDocumentSite : Site.h
  • PCImpIOleInPlaceSite : Site.h
  • PCInstPro : Sample.h
  • PCLIPBOOKSERVER_RESOURCE : ClipBook Server.cpp
  • PCMD : dbh.cpp
  • PCMD_ARGS : DbgCmd.c
  • PCMethodPro : MethProv.h
  • PCOLORPICKSTATE : fakemenu.c
  • PCOLUMNDATA : hashtbl.h
  • PCOMPARE_FUNCTION : hashtable.h
  • PCOMPARE_ROUTINE : AsyncIO.h
  • PCOMPARTMENTMONITORPROC : monitor.h
  • PCONFIGURATION_ENTRY : configentry.h
  • PCONST_DWORD_REP : stdafx.h
  • PCONST_GUID_REP : stdafx.h
  • PCONST_WORD_REP : stdafx.h
  • PCOPY_CHUNK : UnBufCp1.c , UnBufCp2.c
  • pCount : Tst4Wts.c
  • PCProvFactory : Sample.h , MethProv.h , Sample.h
  • PCREDENTIAL : SampSSP.H
  • PCROWSET : rowset.h
  • PCRTTHREADPROC : AppUtil.h
  • PCSite : Site.h
  • PCStatusHelper : CStatHlp.h
  • PCStringTable : CStrTabl.h
  • PCUTILPROP : utilprop.h
  • PDBG_THREAD_INFO : Utils.c
  • PDEB_DLL_LIST_INFO : DebDebug.h
  • PDEB_DLL_NODE_INFO : DebDebug.h
  • PDEB_PROCESS_LIST_INFO : DebDebug.h
  • PDEB_PROCESS_NODE_INFO : DebDebug.h
  • PDEB_STARTUP_INFO : DebDebug.h
  • PDEB_THREAD_LIST_INFO : DebDebug.h
  • PDEB_THREAD_NODE_INFO : DebDebug.h
  • PDEVICE_INFO : NewFsp.h
  • PDIBDATA : MfEdit.h
  • PDIRECTORY_ENUMERATE_ROUTINE : AsyncIO.h
  • PDISPLAY_FUNCTION : hashtable.h
  • PDRAWDATA : Draw.h
  • PDRVLINE : Atsp.h
  • PDRVLINECONFIG : Atsp.h
  • PDSA_SEC_PAGE_INFO : PropSheetHost.h
  • PDYNAMIC_LOCKS_STORE : sync.h
  • PDYNAMIC_READWRITE_LOCK : sync.h
  • PEDITARGS : sdkdiff.cpp
  • PENSTYLELOOKUP : Printer.h
  • PENTRY : secClnt.Cpp , secSvr.Cpp
  • PENUMERATE_DIRECTORY_STACK : AsyncIO.h
  • PENUMERATE_DIRECTORY_STATE : AsyncIO.h
  • PENUMSYMDATA : dbh.cpp
  • PENWIDTHLOOKUP : Printer.h
  • PER_IO_CONTEXT : IocpServer.h
  • PER_SOCKET_CONTEXT : IocpServer.h
  • PERF : ComPerf.Cpp
  • PEVENT_ENTRY : configentry.h
  • PEX_BUF : common.h
  • PEXEDLLICONINFO : Icons.C
  • PFILEHDR : SMFI.h
  • PFILEINFO : MfEdit.h
  • PFILESHARESAMPLE_PROPS : File Share Sample.cpp
  • PFILESHARESAMPLE_RESOURCE : File Share Sample.cpp
  • PFLAGMAPPING : Gss-Misc.h
  • PFN_FIRST_HIT_INIT : IsapiExtension.h
  • PFN_REQUESTCB : Range.h
  • PFnAdjustTokenPrivileges : utils.cpp
  • pfnArrayCallback : AdsiDump.cpp
  • PFnCertCompareCertificate : vertrust.cpp
  • PFnCertDuplicateCertificateContext : vertrust.cpp
  • PFnCertFreeCertificateContext : vertrust.cpp
  • PFnCheckTokenMembership : utils.cpp
  • PFNCMD : GLOBALS.h , Globals.h , Global.h
  • PFNDESTROYED : FileView.h
  • PFnLookupPrivilegeValue : utils.cpp
  • PFNMSG : GLOBALS.h , Globals.h , Global.h , Msg.Cpp , Global.h
  • PFnMsiApplyPatch : setup.cpp
  • PFnMsiCloseHandle : setup.cpp
  • PFnMsiDatabaseOpenView : setup.cpp
  • PFnMsiInstallProduct : setup.cpp
  • PFnMsiOpenDatabase : setup.cpp
  • PFnMsiQueryProductState : setup.cpp
  • PFnMsiRecordGetString : setup.cpp
  • PFnMsiReinstallProduct : setup.cpp
  • PFnMsiSetInternalUI : setup.cpp
  • PFnMsiSIPDllRegisterServer : upgrdmsi.cpp
  • PFnMsiViewExecute : setup.cpp
  • PFnMsiViewFetch : setup.cpp
  • PFnOpenProcessToken : utils.cpp
  • PFnWinVerifyTrust : vertrust.cpp
  • pfnWSAEventSelectSpec : rusocket.h
  • PFnWTHelperGetProvCertFromChain : vertrust.cpp
  • PFnWTHelperGetProvSignerFromChain : vertrust.cpp
  • PFnWTHelperProvDataFromStateData : vertrust.cpp
  • PFONTLIST : Dialogs.c
  • PFONTSTRUCT : Dialogs.c
  • PFREE_FUNCTION : hashtable.h
  • PFUNC_INFO : Atsp.h
  • PFUNDSRM : AuthzSvr.c
  • PGLOBAL : DebMain.h
  • PHASH_FUNCTION : hashtable.h
  • PHASH_TABLE : hashtable.h
  • PHTTP_REQUEST_PARAM : Range.h
  • PHTTP_REQUEST_RANGE : Range.h
  • PHTTP_REQUESTCB_PARAM : Range.h
  • PHTTPCFG_TYPE : precomp.h
  • PHYSICAL_HANDLE : nullmdm.h
  • PickleControlBlock : Picklpc.c , Pickltc.c
  • PICMP_HDR : iphdr.h
  • PICONDIR : Icons.h
  • PICONDIRENTRY : Icons.h
  • PICONIMAGE : Icons.h
  • PICONRESOURCE : Icons.h
  • PIDLDATA : PidlMgr.h
  • PIGMP_GROUP_RECORD_V3 : iphdr.h
  • PIGMP_HDR : iphdr.h
  • PIGMP_HDR_QUERY_V3 : iphdr.h
  • PIGMP_HDR_REPORT_V3 : iphdr.h
  • PILIST : status.cpp
  • PIMPCONVERTTYPE : row.h
  • PIMPIACCESSOR : rowset.h
  • PIMPIBINDRESOURCE : binder.h , dbsess.h
  • PIMPICOLUMNSINFO : command.h , row.h , rowset.h
  • PIMPICOMMANDPROPERTIES : command.h
  • PIMPICOMMANDTEXT : command.h
  • PIMPICONVERTTYPE : command.h , rowset.h
  • PIMPICREATEROW : binder.h
  • PIMPIDBBINDERPROPERTIES : binder.h
  • PIMPIDBCREATECOMMAND : dbsess.h
  • PIMPIDBCREATESESSION : datasrc.h
  • PIMPIDBINFO : datasrc.h
  • PIMPIDBINITIALIZE : datasrc.h
  • PIMPIDBProperties : datasrc.h
  • PIMPIFILEVIEWER : FVText.h
  • PIMPIGETDATASOURCE : dbsess.h
  • PIMPIGETROW : rowset.h
  • PIMPIGETSESSION : row.h
  • PIMPIOPENROWSET : dbsess.h
  • PIMPIPERSIST : datasrc.h
  • PIMPIPERSISTFILE : FVText.h
  • PIMPIROW : row.h
  • PIMPIROWCHANGE : row.h
  • PIMPIROWSET : rowset.h
  • PIMPIROWSETCHANGE : rowset.h
  • PIMPIROWSETIDENTITY : rowset.h
  • PIMPIROWSETINFO : rowset.h
  • PIMPISESSIONPROPERTIES : dbsess.h
  • PINITDATA : Dt.h
  • PINTERFACE_ENTRY : networkentry.h
  • PIO_OPERATION : IocpServer.h
  • PIOWI : areadcli.c
  • PIPADDRESS : defs.h
  • PIPSAMPLE_GLOBAL_CONFIG : ipsamplerm.h
  • PIPSAMPLE_GLOBAL_STATS : ipsamplerm.h
  • PIPSAMPLE_IF_BINDING : ipsamplerm.h
  • PIPSAMPLE_IF_CONFIG : ipsamplerm.h
  • PIPSAMPLE_IF_STATS : ipsamplerm.h
  • PIPSAMPLE_IP_ADDRESS : ipsamplerm.h
  • PIPSAMPLE_MIB_GET_INPUT_DATA : ipsamplerm.h
  • PIPSAMPLE_MIB_GET_OUTPUT_DATA : ipsamplerm.h
  • PIPSAMPLE_MIB_SET_INPUT_DATA : ipsamplerm.h
  • PIPSAMPLE_STATUS_CODE : configentry.h
  • PIPV4_HDR : iphdr.h
  • PIPV4_OPTION_HDR : iphdr.h
  • PIPV6_FRAGMENT_HDR : iphdr.h
  • PIPV6_HDR : iphdr.h
  • PITEM_DESC : tracedmp.h
  • PJOB_INFO : NewFsp.h
  • PKEYFRAME : SMF.c
  • PLAYINFO : MfEdit.h
  • PLIST : list.h , LinkList.h
  • PLISTPROP : keys.cpp
  • PLOCAL_HEAP_INFO : PerfUtil.h
  • PLOCKED_LIST : sync.h
  • PLOGON : Security.Cpp
  • PLSTSLOT : hashtbl.h
  • PLUGXPRT_CALL_TYPE : iplgxprt.idl
  • PLUGXPRT_FRAMING : iplgxprt.idl
  • PLUGXPRT_PARAMETERS : iplgxprt.idl
  • PLUGXPRT_PSTN_CALL_CONTROL : iplgxprt.idl
  • PMAZEDATA : Maze.h
  • PMEMICONDIR : Icons.h
  • PMEMICONDIRENTRY : Icons.h
  • PMEMORY_ALLOC_BLOCK : LeakyBin.h
  • PMESSAGE : SampSSP.H
  • PMOF_INFO : tracedmp.h
  • PMSV1_0_INTERACTIVE_LOGON : Npaux.h
  • PMSV1_0_LOGON_SUBMIT_TYPE : Npaux.h
  • PMULTI_SZ : multisz.h
  • PMYXFORM : Bounce.h
  • PNETWORK_ENTRY : networkentry.h
  • PNODE : Collect.cpp , LinkList.h
  • POBJECT : Main.h
  • POLYDATA : Poly.h
  • POPTIONS : AppBar.h
  • POPUPMENUMAP : CStatHlp.h
  • PORT_HDR : iphdr.h
  • POS : cexlist.h
  • POSDATA : keys.cpp
  • POSITION : llistimpl.h , list.h , llistimpl.h
  • PositionEnum : adoint.h
  • POSTKEY : keys.cpp
  • PPACKET : packet.h
  • PPER_IO_CONTEXT : IocpServer.h
  • PPER_SOCKET_CONTEXT : IocpServer.h
  • PPOLYDATA : Poly.h
  • PPOPUPMENUMAP : CStatHlp.h
  • PPORT_HDR : iphdr.h
  • PPOSDATA : keys.cpp
  • PPOSTKEY : keys.cpp
  • PPROFILE : DebMain.h
  • PPROPSHEETCFG : PropSheetHost.h
  • PPRTDATA : MfEdit.h
  • ppServerInfo : Tst4Wts.c
  • ppvObject : Priv.h
  • PPVOID : Sample.h , MethProv.h , Sample.h , FileView.h , AppUtil.h , Sample.h
  • PRASHOST_DATA : RasHost.h
  • PREAD_WRITE_LOCK : sync.h
  • PRECTI : Paint.h
  • PREF : Global.h
  • PREPAREFORSYNCCOMPLETEDMSG : Handler.h
  • PREPAREFORSYNCMSG : Handler.h
  • PREROLL : SEQ.h
  • PRESOURCEPOSINFO : Icons.C
  • PRINTERDATA : queue.h
  • PROFILE : DebMain.h
  • PROGRESSMSG : Handler.h
  • Properties : adoint.h
  • PropertiesVtbl : adoint.h
  • Property : adoint.h
  • PropertyAttributesEnum : adoint.h
  • PropertyVtbl : adoint.h
  • PROPIDLIST : suminfo.h
  • PROPSETLIST : suminfo.h
  • PROPSHEETCFG : PropSheetHost.h
  • PROPSTRUCT : utilprop.h
  • PROPVALUE : suminfo.h
  • PROTOCOL : Bcast.c
  • PROVIDER : provider.h
  • PROWBUFF : hashtbl.h
  • PRTDATA : MfEdit.h
  • PRUREGVALUE : rureg.h
  • PSAMPLE_CUSTOM_DIAL_DLG : customdial.cpp
  • PSAMPLE_CUSTOM_ENTRY_DATA : customdial.cpp
  • PSAMPLE_HELPER_DATA : nshsamp.h
  • PSAMPLEDROPEXT : DropExt.C
  • PSEARCH_REQUEST : AsyncIO.h
  • PSEARCH_REQUEST_STATE : AsyncIO.h
  • PSEC_CONTEXT : SampSSP.H
  • PSEQ : SEQ.h
  • PSIGGEN_COUNTER : DataGen.h
  • PSIGNATURE : SampSSP.H
  • PSLOT : hashtbl.h
  • PSMF : SMFI.h
  • PSMFFILEINFO : SMF.h
  • PSMFOPENFILESTRUCT : SMF.h
  • PSNMP_MGR_SESSION : WSnmpUtil.h
  • PSOCK_INFO : common.h
  • PSPINCUBEINFO : SpinCube.h
  • PSTATEL : status.cpp
  • PSTATMESSAGEMAP : CStatHlp.h
  • PTCP_HDR : iphdr.h
  • PTEMPOMAPENTRY : SMFI.h
  • PTEST_INFO : PrPerf.c
  • PTHREADARGS : sdkdiff.cpp
  • PTICKS : SMF.h
  • PTPHYS_CONNECT_INFO : nullmdm.h
  • PTRACK : SMFI.h
  • PTrackObject : WxForm.h , Track.h
  • PTREEITEM : tree.h
  • PTS : Fx.c
  • PUDP_HDR : iphdr.h
  • PUNICODE_STRING : Npaux.h
  • PUSER : cMemb.h
  • PUSER_EVENT : TraceDp.c
  • PUSER_INFO : cache.c
  • PVIEWLINE : view.cpp
  • PVIRTUAL_BUFFER : AsyncIO.h
  • PVOID : LinkList.h , GinaHook.h , GinaStub.h , OleStd.h
  • PVOID_FUNCTION : hashtable.h
  • PVOLUME_GET_GPT_ATTRIBUTES_INFORMATION : DLEdit.Cpp
  • PWAVE_DATA : Perfgen.c
  • PWORK_QUEUE : AsyncIO.h
  • PWORK_QUEUE_ITEM : AsyncIO.h
  • PWORK_THREAD_DATA : RasHost.h
  • PWORKER_ROUTINE : AsyncIO.h
  • PWSTR : GinaStub.h , GinaHook.h
  • PWTSENUMERATESERVERS : Tst4Wts.c
  • PWTSFREEMEMORY : Tst4Wts.c
  • PXFORMDATA : XForm.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- q -

  • QOS_OPTIONS : QosEvent.h
  • QTSTRUCT : quiktest.h
  • Query : QueryDlg.h
  • QUEUEDATA : queue.h
  • QueueHashNode : Resources.h , resources.h
  • QueueNode : resources.h , Resources.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- r -

  • RASHOST_DATA : RasHost.h
  • RASSECURITYDIALOGRECEIVEPROC : RasHost.h
  • RASSECURITYDIALOGSENDPROC : RasHost.h
  • READ_WRITE_LOCK : sync.h
  • Recordset : adoint.h
  • RecordStatusEnum : adoint.h
  • RECOVERY_STATE : RmWorker.Idl
  • RECOVERYRC : RmWorker.Idl
  • RECV_INFO : Receiver.Cpp
  • RECVARGS : provider.h
  • RECVFROMARGS : provider.h
  • REGSTRUCT : ADEvent.cpp
  • Req : FileRepClientProc.cpp , filerepclientproc.cpp
  • ReqState : FileRepClientProc.cpp , filerepclientproc.cpp
  • Reserved : Tst4Wts.c
  • RGPT : Mypal.h
  • riid : Priv.h
  • RMSTATUS : RmWorker.Idl
  • ROWBUFF : hashtbl.h
  • RqsConfigString : rqsconfig.h
  • RqsEngineCbInfo : rqsengine.cpp
  • RSUMINFO : suminfo.Cpp
  • RU_SOCKET : rusocket.cpp
  • RU_SOCKET_CREATE_DATA : rusocket.h
  • RURASREGROOT : rureg.cpp
  • RUREGVALUE : rureg.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- s -

  • SAMPLE_CUSTOM_DIAL_DLG : customdial.cpp
  • SAMPLE_CUSTOM_ENTRY_DATA : customdial.cpp
  • SAMPLE_HELPER_DATA : nshsamp.h
  • SAMPLEITEMSETTINGS : Settings.h
  • SchemaEnum : adoint.h
  • SCHEMAINFO : cdialog.h
  • SCROLLDIR : idt.h
  • SDWORD : sampprov.h
  • SEARCH_REQUEST : AsyncIO.h
  • SEARCH_REQUEST_STATE : AsyncIO.h
  • SearchDirectionEnum : adoint.h
  • SEC_CONTEXT : SampSSP.H
  • SEC_FUNC : HttpAuth.c
  • SECTION : section.h , suminfo.h
  • SEND_INFO : Sender.Cpp
  • SENDARGS : provider.h
  • SENDTOARGS : provider.h
  • SEQ : SEQ.h
  • SERVERINFO : autotest.h
  • SFFS : wn_dos.h
  • ShipStatus : QCNotify.Idl
  • SHOWERRORCOMPLETEDMSG : Handler.h
  • SHOWERRORMSG : Handler.h
  • SHOWPROPERTIESCOMPLETEDMSG : Handler.h
  • SHOWPROPERTIESMSG : Handler.h
  • Shutdown : ShutdownDlg.h
  • SIGGEN_COUNTER : DataGen.h
  • SIGGEN_DATA_DEFINITION : DataGen.h
  • SIGNATURE : SampSSP.H
  • SLONG : sampprov.h
  • SLOT : hashtbl.h
  • SmartEnumFilesPointer : bits_ie.cpp
  • SmartEnumJobsPointer : bits_ie.cpp
  • SmartFilePointer : bits_ie.cpp
  • SmartIUnknownPointer : bits_ie.cpp
  • SmartJob2Pointer : bits_ie.cpp
  • SmartJobErrorPointer : bits_ie.cpp
  • SmartJobPointer : bits_ie.cpp
  • SmartManagerPointer : bits_ie.cpp
  • SmartPersistFilePointer : bits_ie.cpp
  • SmartShellLinkPointer : bits_ie.cpp
  • SMF : SMFI.h
  • SMFFILEINFO : SMF.h
  • SMFOPENFILESTRUCT : SMF.h
  • SMFRESULT : SMF.h
  • SNMP_MGR_SESSION : WSnmpUtil.h
  • SOCK_INFO : common.h , provider.h
  • Socklist : Overlap.c
  • SP_OPTIONS : QosEvent.h
  • SPEVENT : SMFI.h
  • SReq : FileRepServerProc.cpp
  • SReqState : FileRepServerProc.cpp
  • STANDARDSECINMEM : suminfo.h
  • STATEL : status.cpp
  • Static_Info_Database : AdminDll.c
  • Static_Statistic : AdminDll.c
  • STATMESSAGEMAP : CStatHlp.h
  • Status : Status.c
  • STATUSBARLOOKUP : Printer.h
  • STDZ : suminfo.h
  • STREAM_FIND_DATA : FindStream.h
  • stringW : AdsiDump.cpp
  • STRSIZE : dialogs.c
  • STRSUBFUNC : view.cpp
  • SUBSCRIBERMAP : StdAfx.h
  • SUMMARYINFO : suminfo.h
  • SUPPORTCONCURINFO : quiktest.h
  • SUPPORTOPTINFO : quiktest.h
  • SWORD : sampprov.h
  • SYNCHINFO : common.cpp
  • SYNCHRONIZECOMPLETEDMSG : Handler.h
  • SYNCHRONIZEMSG : Handler.h
  • SZ : StdAfx.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- t -

  • TCP_HDR : iphdr.h
  • TEMPOMAPENTRY : SMFI.h
  • TEST_INFO : PrPerf.c
  • TEXTBUTTON : ToolBar.h
  • THREADINFO : IocpClient.Cpp
  • THREADPARAM : threads.c
  • THUMB : suminfo.h
  • THUMBNAIL : suminfo.h
  • TICKS : SMF.h
  • TIME : suminfo.h
  • TimeMap : Methodsub.h
  • TimeStack : Methodsub.h
  • TOOLDISPLAYDATA : BttnCur.h
  • Tools : Tools.c
  • TPHYS_CONNECT_INFO : nullmdm.h
  • TPhysicalError : nullmdm.h
  • TRACK : SMFI.h
  • TrackObject : Track.h , WxForm.h
  • TRANSMITFILEARGS : provider.h
  • TRANSMITPACKETSARGS : provider.h
  • TREE : tree.h
  • TREEITEM : tree.h
  • TREEKEY : tree.h
  • TYPEMAP : common.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- u -

  • UDP_HDR : iphdr.h
  • UDWORD : sampprov.h
  • ULONG : sampprov.h
  • UNICODE_STRING : Npaux.h
  • UNITSTABLE : celib.cpp , CeLib.Cpp , celib.cpp , CeLib.Cpp
  • USER : cMemb.h
  • USER_EVENT : TraceDp.c
  • USER_INFO : cache.c
  • USHORT : sampprov.h
  • UWORD : sampprov.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- v -

  • varvect : dynamic.h
  • VEC_CLERKS : CrmMonCompObj.h
  • Version : Tst4Wts.c
  • VERSION : Globals.h
  • VIEW : compitem.h , complist.h , view.h
  • VIEWLINE : view.cpp
  • VIEWLIST : Viewlist.h
  • VIRTUAL_BUFFER : AsyncIO.h
  • VOID : GinaStub.h , GinaHook.h
  • VOLUME_GET_GPT_ATTRIBUTES_INFORMATION : DLEdit.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- w -

  • WAVE_DATA : Perfgen.c
  • WIDEDBIDMAP : error.h
  • WIDEGUIDMAP : error.h
  • WIDENAMEMAP : error.h
  • WINAPI_MY_PIPE_PULL : common.h
  • WINAPI_MY_PIPE_PUSH : common.h
  • WMS_CONTEXT_PLUGIN_CONTEXT_TYPE : ContextDll.idl
  • WORK_QUEUE : AsyncIO.h
  • WORK_QUEUE_ITEM : AsyncIO.h
  • WORK_THREAD_DATA : RasHost.h
  • WorkerThreadArgs : Handler.h
  • WSAOVERLAPPEDPLUS : provider.h
  • WSARECVMSGARGS : provider.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- x -

  • XactAttributeEnum : adoint.h
  • XFORMDATA : XForm.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- _ -

  • __BERR : sdkdiff.cpp , sdkdiff.h
  • __MIDL_itf_iapplet_0000_v0_0_c_ifspec : iapplet.h
  • __MIDL_itf_iapplet_0000_v0_0_s_ifspec : iapplet.h
  • __MIDL_itf_iapplet_0212_v0_0_c_ifspec : iapplet.h
  • __MIDL_itf_iapplet_0212_v0_0_s_ifspec : iapplet.h
  • __MIDL_itf_m_bobj_0000_v0_0_c_ifspec : adoint.h
  • __MIDL_itf_m_bobj_0000_v0_0_s_ifspec : adoint.h
  • __MIDL_ProcFormatString : EdGlyphs_p.c , EdHost_p.c , ADsFirstExt_p.c , Render_p.c , ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c
  • __MIDL_TypeFormatString : ADsFirstExt_p.c , ADsError_p.c , BrochureMachine_p.c , EDAnnotator_p.c , EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c , Render_p.c
  • __pad0__ : suminfo.Cpp
  • _ADsError_BaseIIDList : ADsError_p.c
  • _ADsError_InterfaceNamesList : ADsError_p.c
  • _ADsError_ProxyVtblList : ADsError_p.c
  • _ADsError_StubVtblList : ADsError_p.c
  • _ADsFirstExt_BaseIIDList : ADsFirstExt_p.c
  • _ADsFirstExt_InterfaceNamesList : ADsFirstExt_p.c
  • _ADsFirstExt_ProxyVtblList : ADsFirstExt_p.c
  • _ADsFirstExt_StubVtblList : ADsFirstExt_p.c
  • _BrochureMachine_BaseIIDList : BrochureMachine_p.c
  • _BrochureMachine_InterfaceNamesList : BrochureMachine_p.c
  • _BrochureMachine_ProxyVtblList : BrochureMachine_p.c
  • _BrochureMachine_StubVtblList : BrochureMachine_p.c
  • _EDAnnotator_BaseIIDList : EDAnnotator_p.c
  • _EDAnnotator_InterfaceNamesList : EDAnnotator_p.c
  • _EDAnnotator_ProxyVtblList : EDAnnotator_p.c
  • _EDAnnotator_StubVtblList : EDAnnotator_p.c
  • _EdCommands_BaseIIDList : EdCommands_p.c
  • _EdCommands_InterfaceNamesList : EdCommands_p.c
  • _EdCommands_ProxyVtblList : EdCommands_p.c
  • _EdCommands_StubVtblList : EdCommands_p.c
  • _EdGlyphs_BaseIIDList : EdGlyphs_p.c
  • _EdGlyphs_InterfaceNamesList : EdGlyphs_p.c
  • _EdGlyphs_ProxyVtblList : EdGlyphs_p.c
  • _EdGlyphs_StubVtblList : EdGlyphs_p.c
  • _EdHost_BaseIIDList : EdHost_p.c
  • _EdHost_InterfaceNamesList : EdHost_p.c
  • _EdHost_ProxyVtblList : EdHost_p.c
  • _EdHost_StubVtblList : EdHost_p.c
  • _epPchNil : string.Cpp , string.h
  • _ExtendableNodes : registry.Cpp
  • _IADsErrorStubVtbl : ADsError_p.c
  • _IAnnotatorStubVtbl : EDAnnotator_p.c
  • _IBehaviorStubVtbl : Render_p.c
  • _IBrowserHostStubVtbl : EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c
  • _IEventSinkStubVtbl : Render_p.c
  • _IFactoryStubVtbl : Render_p.c
  • _IGridStubVtbl : EdHost_p.c
  • _IHelloWorldStubVtbl : ADsFirstExt_p.c
  • _init_InitOle_ : Main.Cpp
  • _IPTLauncherStubVtbl : BrochureMachine_p.c
  • _ISnapStubVtbl : EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c
  • _Module : StdAfx.h , ADsFirstExt.cpp , userwizard.cpp , stdafx.h , ADsFirstExt.cpp , stdafx.h , StdAfx.h , SCPWizard.cpp , StdAfx.h , SCPProppage.cpp , StdAfx.h , SCPCMenu.cpp , StdAfx.h , SDKSamplePlaylistPlugin.cpp , StdAfx.h , stdafx.h , ContextSamplePropPage.cpp , ContextDll.cpp , stdafx.h , sdksamplestorageplugin.cpp , SampMsp.Cpp , proxyplugin.cpp , stdafx.h , dbauth.cpp , StdAfx.h , Authenticate.cpp , stdafx.h , msdfmap.cpp , MyDevice.cpp , stdafx.h , data.Cpp , Pch.Cpp , account.Cpp , StdAfx.h , RDOKB.Cpp , BankVC.cpp , OLEDBKB.Cpp , StdAfx.h , ADOKB.Cpp , Account.cpp , StdAfx.h , VCSecuritySample.Cpp , StdAfx.h , ClipBook ServerEx.cpp , Disp1.Cpp , StdAfx.h , QCShip2.Cpp , StdAfx.h , QCOrder.Cpp , StdAfx.h , QCNotify.Cpp , StdAfx.h , QCShip.Cpp , StdAfx.h , QCOrder.Cpp , StdAfx.h , QCNotify.Cpp , StdAfx.h , Account.Cpp , StdAfx.h , LogWriter.Cpp , stdafx.h , EDAnnotator.cpp , OPBank.Cpp , dll.cpp , stdafx.h , StdAfx.h , stdafx.h , StdAfx.h , stdafx.h , newseventclass.Cpp , stdafx.h , cascadeec.Cpp , StdAfx.h , CrmMonComp.Cpp , StdAfx.h , CertEnc.Cpp , StdAfx.h , CrmFiles.Cpp , StdAfx.h , atlcontrol.Cpp , SyncComp.Cpp , certpsam.cpp , StdAfx.h , STAObject.Cpp , StdAfx.h , FreeObject.Cpp , StdAfx.h , ComSyncObject.Cpp , TxEnlister.Cpp , DeviceDll.cpp , StdAfx.h , BYOTTransaction.Cpp , StdAfx.h , Server.Cpp , StdAfx.h , PingResp.Cpp , stdafx.h , userproppage.cpp , fullsvr.Cpp , stdafx.h , callbackclient.Cpp , StdAfx.h , ComSpyCtl.Cpp , StdAfx.h , ComSpy.Cpp , EdHost.cpp , StdAfx.h , theprovider.cpp , StdAfx.h , DeviceDll.h , TServer.Cpp , Stdafx.h , StdAfx.h , PoolTest.Cpp , StdAfx.h , MyDevice.cpp , Dll.cpp , StdAfx.h , pluggable.cpp , stdafx.h , Render.cpp , persistatl.Cpp , ClRes.h , ClRes.cpp , StdAfx.h , CrmFilesTest.Cpp , Dll.cpp , CrmDebug.Cpp , StdAfx.h , ChildWnds.cpp , StdAfx.h , File Share SampleEx.cpp , StdAfx.h , CatlSmpl.Cpp , MyStorageResource.cpp , StdAfx.h , stdafx.h , EdCommands.cpp , StdAfx.h , dll.cpp , ComSpyAudit.Cpp , GraphObj.Cpp , StdAfx.h , Exports.Cpp , EdGlyphs.cpp , MyDevice.cpp , stdafx.h , genericucp.cpp , Catlpwr.Cpp , StdAfx.h , ADsError.cpp , CeapCfg.h , StdAfx.h , Pch.Cpp , pch.cpp , Pch.Cpp , StdAfx.h , ChildWnds.cpp , MultiReco.cpp , StdAfx.h , EdCommands.cpp , StdAfx.h , certxsam.cpp , StdAfx.h , BrochureMachine.cpp , AdvReco.cpp , pch.cpp , CertPSam.Cpp , CertXSam.Cpp
  • _NodeExtensions : registry.Cpp
  • _Render_BaseIIDList : Render_p.c
  • _Render_InterfaceNamesList : Render_p.c
  • _Render_ProxyVtblList : Render_p.c
  • _Render_StubVtblList : Render_p.c
  • _rgAddrType : Dlg.Cpp
  • _rgCallType : Dlg.Cpp
  • _rgSysInfo : cMgr.Cpp
  • _rgtbb : sBar.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- j -

  • j : fullsvr.Idl , suminfo.Cpp
  • jFont : Paint.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- k -

  • k : suminfo.Cpp
  • kpszAppTitle : Cap.Cpp , MainDlg.Cpp , CapMFC.Cpp , Error.Cpp
  • kpszRegRoot : MainDlg.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- l -

  • l : suminfo.Cpp
  • lAmount : Account.Idl
  • lcidLOCALE_INVARIANT : setup.cpp , msistuff.cpp
  • LENGTHSIZE : spy.cpp
  • lf : Font.c , Data.c , IMEApps.h , FontView.c
  • lfWM_CF_LF : Font.c
  • LIBID_ADODB : adoint.h
  • LIBID_ADSERRORLib : ADsError.h , ADsError_i.c
  • LIBID_ADSFIRSTEXTLib : ADsFirstExt_i.c , ADsFirstExt.h , ADsFirstExt_i.c , ADsFirstExt.h
  • LIBID_ATLCONTROLLib : atlcontrol.h
  • LIBID_MYDEVICELib : MyDevice.h , MyDevice_i.c , MyDevice.h , MyDevice_i.c
  • LIBID_NmApplet : iapplet.c , iapplet.h
  • LIBID_THEPROVIDERLib : theprovider.h
  • lindex : ias.h
  • line_numbers : sdkdiff.cpp , sdkdiff.h
  • LINENUMBERSIZE : spy.cpp
  • LOG_RM_ABORT_REQUEST : SimpleLog.Idl
  • LOG_RM_CHECKPOINT : SimpleLog.Idl
  • LOG_RM_COMMIT_REQUEST : SimpleLog.Idl
  • LOG_RM_ENDOFLOG : SimpleLog.Idl
  • LOG_RM_PRIVATE : SimpleLog.Idl
  • LOG_RM_XACT_BEGIN : SimpleLog.Idl
  • LOG_RM_XACT_COMMIT : SimpleLog.Idl
  • LOG_RM_XACT_END : SimpleLog.Idl
  • LOG_RM_XACT_PREPARE : SimpleLog.Idl
  • LogFile : FaxSiren.Cpp , Admapit.c
  • logfile : GssServer.c
  • LogFileCount : tracedmp.cpp
  • LogFileHandle : Dt.h , Dt_Dll.Cpp
  • LoggerHandle : TraceDp.c
  • LogInValid : Admapit.c
  • Logons : Security.Cpp
  • loop : PrPerf.c
  • LOOP_FOREVER : Sockdupc.c
  • looptot : PrPerf.c
  • lp : suminfo.h
  • lpAbortDlg : tprint.cpp
  • lpAbortProc : tprint.cpp
  • lpAdviseSink : OleStd.h
  • LPBOOL : Utils.h
  • lpBuffer : Client32.c , Server32.c
  • lpCandList : Data.c , IMEApps.h
  • lpcfFmt : OleStd.h
  • lpClassFactory : SimpSvr.Cpp
  • lpclsid : OleStd.h
  • lpCSimpleApp : SimpCntr.Cpp , SimpDnd.Cpp
  • lpCSimpSvrApp : SimpSvr.Cpp
  • lpCurrentTime : Prof.cpp , prof.cpp
  • lpData : ClipText.c
  • lpdwIDTable : ImeMenu.c
  • LPDWORD : OleStd.h , enablerouter.c
  • lpdwRegister : OleStd.h
  • lpDX : OleStd.h
  • lpfnCallback : msgfiltr.h
  • lpfnInputEdit : EDITCTLS.c
  • lpfnKeyHook : WinCap.c
  • lpfnOldHook : WinCap.c
  • lpfnOleUIHook : msgfiltr.h
  • lpFr : Find.c
  • lpFrequency : prof.cpp , Prof.cpp , prof.cpp
  • lpHatchRect : OleStd.h
  • lplpmk : OleStd.h
  • lplpszType : OleStd.h
  • lpMalloc : OleStd.h
  • lpMedium : OleStd.h
  • lpmedium : OleStd.h
  • lpmfp : suminfo.Cpp
  • lpmkFull : OleStd.h
  • lpObj : OleStd.h
  • LPOLESTR : OleStd.h
  • LPOVERLAPPED : enablerouter.c
  • lpPriorityList : OleStd.h
  • lpProcEdit : Main.Cpp , ui.cpp , Init.Cpp
  • lpptOffset : OleStd.h
  • lprcClipRect : OleStd.h
  • lprcHatchRect : OleStd.h
  • lprcIPObjRect : OleStd.h
  • lprcLogical : OleStd.h
  • lprcPhysical : OleStd.h
  • lprcViewportOld : OleStd.h
  • lprcWindowOld : OleStd.h
  • LPRECT : OleStd.h
  • lpRect : OleStd.h
  • lps : suminfo.Cpp
  • lpSI : quiktest.c
  • LPSIZEL : OleStd.h
  • lpSizelHim : OleStd.h
  • lpSSIM : suminfo.Cpp
  • lpStartTime : prof.cpp , Prof.cpp , prof.cpp
  • lpStg : OleStd.h
  • LPSTR : OleStd.h
  • lpSumInfo : suminfo.Cpp
  • lpsz : suminfo.h
  • lpszAgent : AsyncDemo.cpp
  • lpszAuxUserType : OleStd.h
  • lpszContainerApp : OleStd.h
  • lpszContainerObj : OleStd.h
  • lpszCustFilterString : Open.h
  • lpszDst : OleStd.h
  • lpszFilterString : Open.h
  • lpszFullUserTypeName : OleStd.h
  • lpszIface : OleStd.h
  • lpszMsg : OleStd.h
  • lpszName : OleStd.h , suminfo.h
  • lpszPrefix : OleStd.h
  • lpszServerName : Admapit.c
  • lpszSrcOfCopy : OleStd.h
  • lpszStgName : OleStd.h
  • lpszString : OleStd.h
  • lpszUserType : OleStd.h
  • lpTargetDevice : OleStd.h
  • lpTestFunc : custom.c
  • LPTSTR : Utils.h
  • lpuUnique : OleStd.h
  • lpVtbl : adoint.h , ADsFirstExt.h , atlcontrol.h , MyDevice.h , ADsError.h , MyDevice.h , iapplet.h
  • lSecondAccount : Account.Idl
  • lTranType : Account.Idl
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- m -

  • m : suminfo.Cpp
  • m_dwLastScrollDir : idt.h
  • m_dwNextScrollTime : idt.h
  • m_dwSrcAspect : idt.h
  • m_dwStrong : iec.h
  • m_dwTimeEnterScrollArea : idt.h
  • m_fCanDropCopy : idt.h
  • m_fCanDropLink : idt.h
  • m_fDragFeedbackDrawn : idt.h
  • m_fOpen : ioo.h
  • m_fSameAsLoad : ips.h
  • m_hModule : RecoDll.cpp
  • m_lpApp : icf.h
  • m_nCount : ioipao.h , ioipo.h , ioo.h , ips.h , ido.h , iec.h
  • m_pApp : ioipf.h
  • m_pDoc : ids.h , idt.h
  • m_pSite : ias.h , iocs.h , ioips.h , ias.h , iocs.h
  • m_ptLast : idt.h
  • m_rcDragRect : idt.h
  • MainUpCallTable : provider.h , spi.cpp
  • ManagerSid : AuthzSvr.c
  • ManagerSidBuf : AuthzSvr.c
  • MappedFileIO : AsyncIO.h
  • MatchedFileCount : AsyncIO.h
  • MatchedLineCount : AsyncIO.h
  • MAX_ACCOUNT_LENGTH : sa.Cpp
  • MAX_COMMAND_LENGTH : sa.Cpp
  • MAX_DIALOGS : msiloc.cpp
  • MAX_PASSWORD_LENGTH : sa.Cpp
  • MAX_PROPSPEC_STRING_LENGTH : HtmlElem.Hxx
  • MAX_SPECIAL_CHAR_LENGTH : SerStrm.Hxx
  • MAX_STRINGS : msiloc.cpp
  • MAX_STYLES : Global.h
  • MAX_TAG_LENGTH : CharHash.Hxx
  • MAX_TEXT : Global.h
  • MAX_TIME_LENGTH : sa.Cpp
  • MAXCHARS : DspFormt.Cpp
  • maxEntries : HtmlProp.Cxx
  • MaxEvents : TraceDp.c
  • MAXGLYPHS : DspFormt.Cpp
  • MAXITEM : DspFormt.Cpp
  • MAXRUN : DspFormt.Cpp
  • MaxSpendingEmployee : AuthzSvr.c
  • MaxSpendingManager : AuthzSvr.c
  • MaxSpendingVP : AuthzSvr.c
  • MAXTERMINALS : Incoming.Cpp , Outgoing.Cpp
  • MaxThroughPut : PrPerf.c
  • MaxUserReqs : service.h , Service.cpp , Service.h , service.cpp
  • mbsMachineName : MqTestOA.Cpp , MSMQTest.c
  • mclass : MainFrm.Cpp
  • MESSAGE_LEVEL : Perfmsg.h , PerfUtil.c , Perfmsg.h , PerfUtil.c
  • methoddata : ComPerf.Cpp
  • Mib : TestMIB.C , TestMIB.h
  • MIB_num_variables : TestMIB.C , TestMIB.h
  • MIB_OidPrefix : TestMIB.C , TestMIB.h
  • MIB_toaster : TestMIB.C
  • MIB_toasterControl : TestMIB.C
  • MIB_toasterControlStor : TestMIB.C
  • MIB_toasterDoneness : TestMIB.C
  • MIB_toasterDonenessStor : TestMIB.C
  • MIB_toasterManStor : TestMIB.C
  • MIB_toasterManufacturer : TestMIB.C
  • MIB_toasterModelNumber : TestMIB.C
  • MIB_toasterModelStor : TestMIB.C
  • MIB_toasterToastType : TestMIB.C
  • MIB_toasterToastTypeStor : TestMIB.C
  • MID_SZ : InstCodc.Cpp
  • MinimumThreads : Server.c
  • MinThroughPut : PrPerf.c
  • mn : suminfo.h
  • mo : suminfo.h
  • mono_colours : sdkdiff.cpp
  • month : utils.h
  • MS_INTRA_L2_USER_1_THUMBPRINT : isapiCertPolicy.cpp
  • MS_INTRA_L2_USER_2_THUMBPRINT : isapiCertPolicy.cpp
  • MS_INTRA_L2_USER_3_THUMBPRINT : isapiCertPolicy.cpp
  • msdiAbout : ABOUT.c , About.c
  • msdiConnect : Connect.c
  • msdiListen : Listen.c
  • msdiMain : Globals.h , IpxChat.c , TapiComm.c , GLOBALS.h
  • msg : list.cpp , CpyImage.Idl
  • MULTICAST : SendMDlg.Cpp
  • MyDefs : Sample.h , ClassProv.Cpp , InstProv.Cpp
  • MyhInstance : FaxSiren.Cpp
  • MyReindeerProvSet : FrameworkProv.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- n -

  • n : suminfo.Cpp
  • NALLOCATIONS : Test.Cxx
  • nChars : suminfo.h
  • nDbgMsgLogSize : DbgMsg.cpp , dbgmsg.cpp
  • nDllRefCount : Cleanup.Cpp , Cleanup.h , ShortName.Cpp , ShortName.h
  • Never : Stubs.c
  • NextId : Stubs.c
  • nFaces : Paint.h
  • nFindMsg : CDTest.h
  • nFmtEtc : OleStd.h
  • nHdcType : Font.c
  • nHelpMessage : CDTest.h
  • nIDTable : ImeMenu.c
  • nIndent : OleStd.h
  • nLangID : Dllinit.c , Errors.c
  • nLineItemsPerOrder : Driver.Cpp
  • nMaxChars : OleStd.h
  • nMinMax : sdkdiff.cpp
  • nNumBLRPLATEProps : blrplate.c
  • nNumTabStops : MainWnd.c
  • NON_BLOCKING_ACCEPT : common.h
  • nOpenColorDlgCount : Colors.c
  • nOpenDialogCount : Open.c , Print.c
  • nOpenFontDialogCount : Font.c
  • nOpenShareVMsg : CDTest.h
  • nOrdersPerDriver : Driver.Cpp
  • nPage : suminfo.h
  • npage : tprint.cpp
  • nPartsWidthTbl : Status.c
  • nProfLogSize : Prof.cpp , prof.cpp
  • nReturn : Title.c
  • nSizeOfVtbl : OleStd.h
  • nSleepMilliseconds : Driver.Cpp
  • nSortKeys : main.cxx
  • nSpin : PlgBlt.c
  • nStatusHeight : Data.c , IMEApps.h
  • nTabStops : MainWnd.c
  • nThreadsAtClientCompletionPort : FileRepClientProc.cpp , Service.cpp
  • nThreadsAtServerCompletionPort : FileRepServerProc.cpp , Service.cpp
  • nToolBarHeight : Data.c
  • NULL_STRING : PerfUtil.h , PerfUtil.c
  • NUM_AUTHORIZED_EVENTS : dbauthplugin.cpp
  • NUM_CONCURRENT_CALLS : scaledemo.Cpp
  • NUM_HANDLED_EVENTS : ContextPlugin.cpp
  • NumberOfWorkerThreads : AsyncIO.h
  • NumPriGroups : service.h , Service.h , Service.cpp , service.cpp
  • nWords : suminfo.h
  • nXBorder : Mypal.c
  • nXStart : OleStd.h
  • nXTitle : Mypal.c
  • nYStart : OleStd.h
  • nYTitle : Mypal.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- o -

  • Object_StubDesc : ADsFirstExt_p.c , BrochureMachine_p.c , EdGlyphs_p.c , EdHost_p.c , EDAnnotator_p.c , Render_p.c , ADsError_p.c , EdCommands_p.c
  • ObjectCount : Server.Cxx
  • ObjMap : Privobji.Cpp , Security.Cpp
  • oBytes : suminfo.Cpp
  • ofn : Open.h
  • ofnThread1 : Open.c
  • ofnThread2 : Open.c
  • ohDeers : FrameworkProv.Cpp
  • OID_Prefix : TestMIB.C
  • OpenAppMemPerformanceData : Perfmem.c
  • OpenSigGenPerformanceData : Perfgen.c
  • OptionList : quiktest.c
  • OrgX : Demo.c , Cursor.c
  • OrgY : Demo.c , Cursor.c
  • OUT_BUFFER_SIZE : SessionKey.cpp , RSAKey.cpp , RSACert.cpp
  • outline_include : sdkdiff.cpp , sdkdiff.h
  • OutputStyle : Dt_Dll.Cpp , Dt.h
  • OutstandingIOOperations : AsyncIO.h
  • Overlapped : enablerouter.c
  • OverlappedPool : overlap.cpp
  • OverlappedUnenableRouter : enablerouter.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- z -

  • ZERO_WIDTH_SPACE : lrsample.HXX
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- a -

  • a : suminfo.Cpp
  • achAuth : Get_Sock.c
  • addr : Globals.h
  • ADDRESSLENGTH : Outgoing.Cpp
  • addrlen : Globals.h
  • adsErr : helper.cpp
  • ADsError_ProxyFileInfo : ADsError_p.c
  • ADsFirstExt_ProxyFileInfo : ADsFirstExt_p.c
  • adsiIfs : ADQIDlg.cpp , ADs.cpp , helper.cpp
  • aHtmlFiltClasses : Register.Cxx
  • aHtmlPropClasses : HtmlProp.Cxx
  • aiKeyExch : WebClient.c
  • Algorithm2 : sdkdiff.cpp
  • AliasAdminsSid : TakeOwn.c
  • ALLOCATION_MULTIPLIER : FCopy.Cpp
  • ALLOCSIGN : spy.cpp
  • AppMemDataDefinition : DataMem.c , Perfmem.c
  • APPNAME : StatList.c , StatList.h
  • appSource : main.cpp
  • AppTitle : sdkdiff.cpp
  • arDelay : MonitorServer.Cpp
  • arg1 : FTPJr.cpp
  • arg2 : FTPJr.cpp
  • arg3 : FTPJr.cpp
  • arIDs : ADSIhelpers.cpp
  • arrFmtEtc : OleStd.h
  • ascii : Display.c
  • asmpClasses : SmpFilt.Cxx
  • aSpincubeStyleFlags : SpinCube.c
  • aStemForms : lrsample.CXX
  • aStems : lrsample.CXX
  • ASYNC_CANCEL_CHECK : AsyncRPCp.c
  • ASYNC_SELECT_ACCEPT : common.h
  • ASyncIO : AsyncIO.h
  • aSyntaxMap : UserProps.cpp
  • Attached : blrplate.c
  • aTypeEntries : HtmlProp.Cxx
  • AvgThroughPut : PrPerf.c
  • aWTSEnumerateServers : Tst4Wts.c
  • aWTSFreeMemory : Tst4Wts.c
  • AX_MAX_VOLUME : msptrmar.cpp
  • AX_MIN_VOLUME : msptrmar.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- b -

  • b : suminfo.Cpp
  • bAbort : complist.cpp , sdkdiff.cpp , Print.c , scandir.cpp
  • bActiveSession : FTPJr.cpp
  • bCaptureOn : Mypal.c
  • bCompAttr : Data.c , IMEApps.h
  • bCompReadAttr : Data.c , IMEApps.h
  • bConnect : Mcastws1.c
  • bDBCS : sdkdiff.cpp , sdkdiff.h
  • bDebug : Service.c , Service.C
  • bDoFindDlg : Find.h
  • bDontJoin : Mcastws1.c , Mcastws2.c
  • bDoOpenDlg : Open.h
  • bEditACLs : SidClean.c
  • bFailIfExists : RmWorker.Idl
  • bInitOK : Perfgen.c
  • bJapan : sdkdiff.cpp , sdkdiff.h
  • bJustCount : SidClean.c
  • bLogFontParam : Font.c
  • bLoopBack : Mcastws1.c , Mcastws2.c
  • BLRPLATEEntryPoints : blrplate.c
  • BLRPLATEFlags : blrplate.c
  • BLRPLATEFlagsSET : blrplate.c
  • BLRPLATEOpCodes : blrplate.c
  • BLRPLATEOpCodesSET : blrplate.c
  • BLRPLATEPropertyTable : blrplate.c
  • bNoFileIO : Service.cpp , Service.h
  • BOOL : OleStd.h , rqsengine.h
  • bOpCode : Utils.c
  • bPassWordSet : security.cpp
  • bRecordRoute : Ping.cpp
  • bRecurse : SidClean.c
  • bReuseAddr : Mcastws1.c
  • BrochureMachine_ProxyFileInfo : BrochureMachine_p.c
  • BrowserConfigs : SimpleBrowser.cpp
  • BrowserSessions : SimpleBrowser.cpp
  • bsADsPathContainer : main.cpp
  • bScreen : Font.c
  • bSender : Mcastws1.c , Mcastws2.c
  • bServerListening : filerepservice.cpp , Service.cpp , Service.h , filerepservice.cpp
  • bsFILE : main.cpp
  • bsLDAP : main.cpp
  • bsNT5GroupName : main.cpp
  • bsPASS : main.cpp
  • bsSamAcctName : main.cpp
  • bsSAMNAME : main.cpp
  • bStartup : WinCap.c
  • bstrtEMPTY : RendSam.Cpp
  • bsUNAME : main.cpp
  • bsUSER : main.cpp
  • bTakeOwnership : SidClean.c
  • bTrace : sdkdiff.cpp
  • bTrack : Demo.c , Cursor.c
  • buf : Admapit.c , quiktest.c
  • Buffer : Dt_Dll.Cpp , Dt.h
  • BUFFER_GROWTH_FACTOR : PropList.cpp
  • BUFFER_SIZE : SignHash.cpp
  • bUserMode : tracedmp.cpp
  • bUserNameSet : security.cpp
  • bViewFull : WinCap.c
  • byteCount : suminfo.h
  • byteOffset : suminfo.Cpp
  • bZero : ComPerf.Cpp , OleApt.Cpp , OleImp.Cpp
  • bZoomed : FontView.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- c -

  • c_clsidCaseTextService : globals.cpp , globals.h
  • c_clsidMarkTextService : globals.h , globals.cpp
  • c_guidCaseProfile : globals.cpp , globals.h
  • c_guidCaseProperty : globals.h , globals.cpp
  • c_guidCustomProperty : globals.cpp , globals.h
  • c_guidLangBarItemButton : globals.cpp , globals.h , globals.cpp , globals.h
  • c_guidMarkContextCompartment : globals.h , globals.cpp
  • c_guidMarkDisplayAttribute : globals.cpp , globals.h
  • c_guidMarkGlobalCompartment : globals.cpp , globals.h
  • c_guidMarkProfile : globals.cpp , globals.h
  • c_rgCategories : register.cpp
  • c_rgclrPredef : fakemenu.c
  • c_rgMenuItems : langbar.cpp
  • c_SampleDropExt_CTMVtbl : DropExt.C
  • c_SampleDropExt_SXIVtbl : DropExt.C
  • c_szDataFile : SampView.Cpp , Utility.h
  • c_szSection : SampView.Cpp , Utility.h
  • c_szWorkerWndClass : property.cpp
  • c_vtblAppUIClassFactory : DefClsF.C
  • c_wchMagic : utils.cpp
  • CacheListHead : cache.c
  • caHalf : halftone.c
  • CallbackNumber : Admapit.c
  • callObjFullArray : scaledemo.Cpp
  • callObjSampleArray : scaledemo.Cpp
  • CAPICOM_SMART_CARD_LOGON_OID_W : isapiCertPolicy.cpp
  • CARET_SECTION_FORMATTED : Global.h
  • CARET_SECTION_LOGICAL : Global.h
  • CARET_SECTION_PLAINTEXT : Global.h
  • CaretWidth : FullIME.h , Global.C , Main.C
  • cbBytes : SimpleLog.Idl
  • cbDefault : sclient.cpp
  • cbIoBuffer : WebServer.c
  • CBitArray : bitarray.h
  • cbtsval : quiktest.c
  • cbValue : quiktest.c
  • cbValueMax : quiktest.c
  • cbWritten : suminfo.Cpp
  • cBytes : suminfo.Cpp
  • cc : Colors.c
  • cCacheItems : cache.c
  • cch : OleStd.h
  • cchString : OleStd.h
  • ccThread1 : Colors.c
  • ccThread2 : Colors.c
  • cdmsgFileOK : ComDlg32.C
  • cdmsgHelp : ComDlg32.C
  • cdmsgShareViolation : ComDlg32.C
  • cdrSpeakers : dlgsrc.cpp , stdafx.h
  • cdwNumReps : RefClint.h
  • cEntries : OleStd.h
  • cErr : main.cxx
  • cErrLogInValid : Admapit.c
  • CExtBuffer : extbuff.h
  • cf : Font.c
  • cfEmbeddedObject : Common.h , ole2ui.c
  • cfEmbedSource : Common.h , ole2ui.c
  • cfFileName : Common.h , ole2ui.c
  • cfFormat : OleStd.h
  • cfLinkSource : Common.h , ole2ui.c
  • cfLinkSrcDescriptor : Common.h , ole2ui.c
  • cfObjectDescriptor : Common.h , ole2ui.c
  • cfOwnerLink : Common.h , ole2ui.c
  • cfThread1 : Font.c
  • cfThread2 : Font.c
  • cgrFormats : dlgdest.cpp
  • CHAR_CONVERSION : main.cpp , registry.cpp
  • CHILD : Sockdups.c
  • chMinMsiVer : msistuff.cpp
  • chOperation : msistuff.cpp
  • chProperties : msistuff.cpp
  • ClientActiveReqBounds : Service.cpp , Service.h , service.cpp , service.h
  • ClientActiveReqHashCounters : Service.cpp , Service.h , service.cpp , service.h
  • ClientActiveReqHashQueues : service.cpp , service.h
  • ClientCompletionPort : FileRepClientProc.cpp , Service.cpp
  • clientCount : Server32.c
  • ClientReqBounds : Service.cpp , Service.h , service.cpp , service.h
  • ClientReqQueues : Service.cpp , Service.h , service.cpp , service.h
  • clients : Server32.c
  • clip : suminfo.h
  • clipFormatNo : suminfo.h
  • ClntName : Client32.c
  • clNumInstances : RefClint.h
  • cLogFile : Admapit.c
  • CloseAppMemPerformanceData : Perfmem.c
  • CloseSigGenPerformanceData : Perfgen.c
  • CLSID_ADsError : ADsError.h , ADsError_i.c
  • CLSID_AsyncTest : DCOMServer.h
  • CLSID_CallAs : Client.c , Server.Cxx
  • CLSID_CIM_REINDEER : MainDll.Cpp
  • CLSID_CleanupSample : Cleanup.Cpp
  • CLSID_ComSpyPropPage : ComSpyproppage.h
  • CLSID_ContextSamplePropPage : ContextSamplePropPageImpl.h
  • CLSID_CSmpFilter : SmpFilt.Hxx
  • CLSID_Dimmer : MyDevice.h , MyDevice_i.c , MyDevice.h , MyDevice_i.c
  • CLSID_EapCfg : Exports.Cpp , CeapCfg.h
  • CLSID_HelloWorld : ADsFirstExt.h , ADsFirstExt_i.c , ADsFirstExt.h , ADsFirstExt_i.c
  • CLSID_HtmlClass : HtmlIFlt.Cxx
  • CLSID_HtmlIFilter : HtmlProp.Cxx , HtmlIFlt.Cxx , HtmlIFlt.Hxx
  • CLSID_HtmlInformation : HtmlGuid.Cxx , HtmlGuid.Hxx
  • CLSID_HtmlPropClass : HtmlProp.Cxx
  • CLSID_HtmlPropIFilter : HtmlProp.Cxx
  • CLSID_KEY : RecoDll.cpp
  • CLSID_MetaProperty : HtmlProp.Cxx
  • CLSID_MMCControl : atlcontrol.h
  • CLSID_MSOmniProv : theprovider.h
  • CLSID_NmApplet : iapplet.c , iapplet.h
  • CLSID_OHello : cHello.Cxx , Client.Cxx , Server.Cxx
  • CLSID_ospsampc : myclassfactory.cpp
  • CLSID_ProppageSCP : SCPProppage.h
  • CLSID_ProppageUser : userproppage.h
  • CLSID_SampleStemmer : lrsample.CXX
  • CLSID_SampleWordBreaker : lrsample.CXX
  • CLSID_SCPContextMenu : SCPCMenu.h
  • CLSID_SCPWizard : SCPWizard.h
  • CLSID_ShortNameColumnProvider : ShortName.Cpp
  • CLSID_Storage : HtmlGuid.Cxx , HtmlGuid.Hxx
  • CLSID_STRING_SIZE : registry.cpp
  • CLSID_SummaryInformation : HtmlGuid.Cxx , HtmlGuid.Hxx
  • CLSID_SyncMgrHandler : Cfact.Cpp , DllMain.Cpp
  • CLSID_TF_ThreadMgr : TPCInfo.cpp
  • CLSID_WizExtUser : userwizard.h
  • cMaxCallsExecute : filerepservice.cpp , Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • cMaxCallsListen : filerepservice.cpp , filerepserver.cpp , filerepservice.cpp , Service.cpp , filerepservice.cpp
  • cMaxStemForms : lrsample.CXX
  • cmdiAbout : ABOUT.c , About.c
  • cmdiConnect : Connect.c
  • cmdiListen : Listen.c
  • cmdiMain : TapiComm.c , GLOBALS.h , IpxChat.c , Globals.h
  • cMinimumThreads : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • cntStatusField : Status.c
  • cntToolCtrls : Tools.c
  • cNumResSetCols : quiktest.h
  • CollectAppMemPerformanceData : Perfmem.c
  • CollectSigGenPerformanceData : Perfgen.c
  • COMMON_PAGE_SIZE : PMMStrm.Hxx
  • CompForm : Main.C
  • CompWindowMode : Main.C
  • ConcurList : quiktest.c
  • ConDisFile : AdminDll.c
  • ConnectDisconnectInValid : AdminDll.c
  • CONNECTION : Account.cpp
  • Connection_Handle : AdminDll.c
  • CONTEXT_SAMPLE_ARRAY_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_BSTR_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_COMMAND_REQUEST_CONTEXT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_COMMAND_RESPONSE_CONTEXT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_CY_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_DATE_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_DECIMAL_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_DISPATCH_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_I4_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_NEW_EVENT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_PRESENTATION_CONTEXT_HEADER : ContextPlugin.cpp
  • CONTEXT_SAMPLE_UI8_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_UNKNOWN_TYPE_STRING : ContextPlugin.cpp
  • CONTEXT_SAMPLE_USER_CONTEXT_HEADER : ContextPlugin.cpp
  • ContextList : Stubs.c
  • ControlGuid : TraceDp.c
  • copy : Is2Foot.Inc
  • CopyChunk : UnBufCp2.c , UnBufCp1.c
  • CORP_HIGH_ASSUR_OID_W : isapiCertPolicy.cpp
  • COSTLY_STRING : PerfUtil.h , PerfUtil.c , PerfUtil.h
  • Count : enablerouter.c
  • COUNT_OF_HTML_ELEMENTS : Bag.Hxx
  • CredentialList : Stubs.c
  • CritSec : list.cpp
  • csCacheLock : cache.c
  • cSize : OleStd.h
  • csQueueLock : ThreadPool.h
  • csRoute : FaxSiren.Cpp
  • CSSdkdiff : sdkdiff.cpp
  • cStandardProperties : msistuff.cpp
  • cStemForms : lrsample.CXX
  • cTypeEntries : HtmlProp.Cxx
  • curr_size : Overlap.c
  • current_view : findgoto.cpp , sdkdiff.cpp
  • CUtilString_padsize : util.h
  • cwcMaxName : HtmlProp.Hxx
  • cwcsObjectPath : RefClint.h
  • cWidth : OleStd.h
  • cxFrame : Status.c
  • cxMetrics : Global.C , FullIME.h , Main.C
  • cxOverTypeCaret : Global.C , Main.C , FullIME.h
  • cxStatusBorder : Status.c
  • cxToolBorder : Tools.c
  • cyFrame : Status.c
  • cyMetrics : Main.C , FullIME.h , Global.C
  • cyStatusBorder : Status.c
  • cyToolBorder : Tools.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- d -

  • DataString : PrPerf.c
  • DBCSFillChar : FullIME.h , Main.C , Global.C
  • DbgMsgCriticalSection : dbgmsg.h , DbgMsg.cpp , DbgMsg.h , dbgmsg.cpp
  • DBGUID_MSSQLXML : error.cpp
  • DBGUID_XPATH : error.cpp
  • DEFAULT_ASYNC_DELAY : AsyncRPC.Idl
  • DEFAULT_ENDPOINT : AsyncRPC.Idl
  • default_g711 : QosEvent.Cpp , QosEvent.h
  • DEFAULT_ITERATIONS : Sockdupc.c
  • DEFAULT_MAX_CALLS : AsyncRPCs.c
  • DEFAULT_MIN_CALLS : AsyncRPCs.c
  • DEFAULT_NONASYNC_DELAY : AsyncRPCp.c
  • default_notraffic : QosEvent.Cpp , QosEvent.h
  • default_options : QosEvent.Cpp
  • DEFAULT_PORT : Sockdupc.c , Sockdups.c
  • DEFAULT_PROTOCOL_SEQUENCE : AsyncRPC.Idl
  • default_qostest : Qoslist.Cpp
  • DEFAULT_WAIT_FLAG : AsyncRPCs.c
  • DescBuf : quiktest.c
  • DescTypes : quiktest.c
  • DestFile : UnBufCp1.c , UnBufCp2.c
  • dialog_autocopy : complist.cpp
  • dialog_fastscan : complist.cpp
  • dialog_leftname : complist.cpp
  • dialog_recursive : complist.cpp
  • dialog_rightname : complist.cpp
  • dialog_servername : complist.cpp
  • DirectoryPath : AsyncIO.h
  • display_file : Gss-Misc.h , GssMisc.c
  • DisplayMode : sdkdiff.cpp
  • dlg_caption : utils.cpp
  • dlg_default : utils.cpp
  • dlg_differ : complist.cpp
  • dlg_file : complist.cpp
  • dlg_identical : complist.cpp
  • dlg_IgnoreAttributes : complist.cpp
  • dlg_IgnoreMarks : complist.cpp
  • dlg_left : complist.cpp
  • dlg_options : complist.cpp
  • dlg_prompt : utils.cpp
  • dlg_result : utils.cpp
  • dlg_right : complist.cpp
  • dlg_root : complist.cpp
  • dlg_size : utils.cpp
  • dlg_sums : complist.cpp
  • DllCritSect : Init.c , SampSSP.H
  • DummyLib : SyncComp.Idl , PoolTest.Idl
  • DumpFile : tracedmp.cpp
  • dwACEsDeleted : SidClean.c
  • dwAspect : OleStd.h
  • dwAuthFlags : main.cxx
  • dwBytesWritten : Admapit.c
  • dwColor : Colors.c
  • dwColorThreadID1 : Colors.c
  • dwColorThreadID2 : Colors.c
  • dwColorThreadParm1 : Colors.c
  • dwColorThreadParm2 : Colors.c
  • dwCompAttrLen : Data.c , IMEApps.h
  • dwCompCls : Data.c , IMEApps.h
  • dwCompClsLen : Data.c , IMEApps.h
  • dwCompReadAttrLen : Data.c , IMEApps.h
  • dwCompReadCls : Data.c , IMEApps.h
  • dwCompReadClsLen : Data.c , IMEApps.h
  • dwCompReadStrLen : Data.c , IMEApps.h
  • dwCompStrLen : Data.c , IMEApps.h
  • dwCurrentEntry : ThreadPool.c
  • dwCurrPref : main.cxx
  • dwCustColors : Colors.c
  • dwDrawAspect : OleStd.h
  • dwErr : Service.c , Service.C
  • dwFilesChecked : SidClean.c
  • dwFilesOwned : SidClean.c
  • dwFlags : Open.h , OleStd.h
  • dwFontFlag : Font.c
  • dwFontThreadID1 : Font.c
  • dwFontThreadID2 : Font.c
  • dwFontThreadParm1 : Font.c
  • dwFontThreadParm2 : Font.c
  • dwgrfMode : OleStd.h
  • dwHandle : Server.Cxx
  • dwID : LogWriter.Idl
  • dwInComingCallStatus : msgfiltr.h
  • dwIndex : Mypal.c
  • dwLastEntry : ThreadPool.c
  • dwLogUsers : Perfmsg.h , PerfUtil.c , Perfmsg.h , PerfUtil.c
  • dwMaxRows : main.cxx
  • dwMaxViewSize : FCopy.Cpp
  • dwNumberAttributes : main.cxx
  • dwNumColors : Mypal.c
  • dwOpenCount : Perfgen.c
  • dwPageSize : main.cxx
  • dwPal : Mypal.c
  • dwPause : EdGlyphs.cpp , EdHost.cpp , fullsvr.Cpp , EdCommands.cpp
  • dwPrintThreadID1 : Print.c
  • dwPrintThreadID2 : Print.c
  • dwPrintThreadParm1 : Print.c
  • dwPrintThreadParm2 : Print.c
  • dwProtocol : WebServer.c , WebClient.c
  • dwRegister : secSvr.Cpp , OleStd.h
  • dwResult : Admapit.c
  • dwResultCls : Data.c , IMEApps.h
  • dwResultClsLen : IMEApps.h , Data.c
  • dwResultReadCls : Data.c , IMEApps.h
  • dwResultReadClsLen : Data.c , IMEApps.h
  • dwResultReadStrLen : Data.c , IMEApps.h
  • dwResultStrLen : IMEApps.h , Data.c
  • dwSearchScope : main.cxx
  • dwSize : main.cpp
  • dwStatus : OleStd.h
  • dwSubEntry : main.cpp
  • dwThreadCnt : ComSpyAudit.Idl
  • dwThreadId : enablerouter.c
  • dwThreadID1 : Open.c
  • dwThreadID2 : Open.c
  • dwThreadParm1 : Open.c
  • dwThreadParm2 : Open.c
  • dwTimeOut : EdCommands.cpp , EdGlyphs.cpp , fullsvr.Cpp , EdHost.cpp , main.cxx , EdCommands.cpp
  • dwTimeZero : TestDll.C
  • dwType : classfac.cpp , FTPJr.cpp
  • DXP_USER : ui.cpp , Global.h
  • dy : suminfo.h
  • dyCombo : Tools.c
  • dyField : Status.c
  • DYP_EDIT : Global.h , ui.cpp
  • DYP_MSG : Global.h
  • dyStatus : Status.c
  • dyTools : Tools.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- e -

  • E_PROPTYPEMISMATCH : StdAfx.h
  • ECBqueue : ThreadPool.c
  • EDAnnotator_ProxyFileInfo : EDAnnotator_p.c
  • EdCommands_ProxyFileInfo : EdCommands_p.c
  • EdGlyphs_ProxyFileInfo : EdGlyphs_p.c
  • EdHost_ProxyFileInfo : EdHost_p.c
  • editor_cmdline : sdkdiff.cpp
  • EmployeeSid : AuthzSvr.c
  • EmployeeSidBuf : AuthzSvr.c
  • EnableFlags : TraceDp.c
  • EnableLevel : TraceDp.c
  • English_Sample_LangRes : lrsample.CXX
  • eOp : SimpleLog.Idl
  • epChNil : string.h , string.Cpp
  • ErrLogFile : Admapit.c , AdminDll.c
  • ErrLogFileIP : AdminDll.c
  • ErrLogInValid : Admapit.c
  • ErrLogIPInValid : AdminDll.c
  • Error : enablerouter.c
  • ErrorLogInValid : AdminDll.c
  • ERRORSTART : HuError.h
  • EventCount : TraceDp.c
  • EventEnum : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • EventFlags : WaitSystemDlg.Cpp
  • EventInfo : selectEventsDlg.Cpp
  • EventListHead : tracewmi.cpp , tracedmp.cpp
  • EvmFile : tracedmp.cpp
  • ExNames : common.h
  • expand_include : sdkdiff.cpp , sdkdiff.h
  • expand_mode : sdkdiff.cpp , sdkdiff.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- f -

  • FAILURE : FCopy.Cpp
  • fASynchronous : main.cxx
  • fAttrsOnly : main.cxx
  • fAutoExpand : sdkdiff.cpp
  • FaxRouteAddFile : FaxSiren.Cpp
  • FaxRouteDeleteFile : FaxSiren.Cpp
  • FaxRouteEnumFiles : FaxSiren.Cpp
  • FaxRouteGetFile : FaxSiren.Cpp
  • FaxRouteModifyRoutingData : FaxSiren.Cpp
  • fBindParameter : quiktest.c
  • fBusy : sdkdiff.cpp
  • fCacheInitialized : cache.c
  • fClassRegistered : Server.Cxx
  • fClientActiveReqCountersCreated : Service.cpp , filerepservice.cpp
  • fClientActiveReqHashCountersCreated : Service.cpp , filerepservice.cpp
  • fClientActiveReqHashQueuesCreated : filerepservice.cpp
  • fClientAuth : WebServer.c
  • fClientReqCountersCreated : Service.cpp , filerepservice.cpp
  • fClientReqQueuesCreated : Service.cpp , filerepservice.cpp
  • fCloseApp : threads.c
  • fCreate : OleStd.h
  • fDebug : exit.cpp , Exit.Cpp , policy.cpp , policy.h , Policy.Cpp
  • fDeleteOnRelease : OleStd.h
  • fDerefAliases : main.cxx
  • fDiagFieldSupported : quiktest.c
  • fDiagRecSupported : quiktest.c
  • fDraw : OleStd.h
  • fdwProperty : Main.C , Data.c , IMEApps.h
  • fEnable : msgfiltr.h
  • fEndProgram : rnrcs.cpp
  • fEnhEncrypted : DirEncrypt.Cpp
  • fFinished : DebDebug.c
  • FILE_MAPPING_BASE_NAME : Sockdups.c
  • FILENAMESIZE : spy.cpp
  • FileShareSampleResourcePrivateProperties : File Share Sample.cpp
  • FileTime : PrPerf.c
  • fInsertMode : FullIME.h , Global.C , Main.C
  • First_Call : Admapit.c , AdminDll.c
  • FirstCall : Admapit.c
  • fIsLink : OleStd.h
  • flags : Cursor.c
  • fLastReleaseCloses : iec.h
  • fMachineStore : WebServer.c
  • fmtid : writeread.cpp
  • FMTID_FullPath : columnprovider.Cpp
  • FMTID_ShortFilename : columnprovider.Cpp
  • fnWscUpdateProvider : instlsp.cpp
  • FOOTERSIZE : spy.cpp
  • FOREIGN_STRING : PerfUtil.h , PerfUtil.c , PerfUtil.h , PerfUtil.c
  • Forever : Stubs.c
  • fpCharSetProc : FontView.c
  • fpGlyphProc : FontView.c
  • fQueueEmpty : ThreadPool.c
  • fr : Find.c
  • fRDM : PrPerf.c
  • FreePool : overlap.cpp
  • FREESIGN : spy.cpp
  • fServerActiveReqCountersCreated : Service.cpp
  • fServerActiveReqHashCountersCreated : Service.cpp
  • fServerReqCountersCreated : filerepservice.cpp , Service.cpp
  • fServerReqQueuesCreated : Service.cpp
  • fShowCand : IMEApps.h , Data.c
  • fSizeLimit : main.cxx
  • fStarted : Bcast.c
  • fSummaryOnly : tracedmp.cpp
  • fTimeLimit : main.cxx
  • FULL_PATH_VALUE : RecoDll.cpp
  • fuOptions : OleStd.h
  • fUseProxy : WebClient.c
  • fVerbose : WebClient.c , WebServer.c
  • fVerify : PrPerf.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- g -

  • g_AcceptContext : common.h , main.cpp
  • g_aCounterProps : BasicHiPerf.Cpp
  • g_aCounters : RefClint.Cpp
  • g_aCSAddr : rnrcs.cpp
  • g_adwSampleMenuHelpIDs : TapiCode.c
  • g_aEntries : HtmlProp.Cxx
  • g_aSock : rnrcs.cpp
  • g_aSockAddr : rnrcs.cpp
  • g_aut : CeLib.Cpp , celib.cpp , CeLib.Cpp , celib.cpp , CeLib.Cpp
  • g_bAbort : tprint.cpp
  • g_bActive : dxsurf1.cpp , dxsurf2.cpp
  • g_bAssertOnErrors : bankdlg.Cpp , bankthrds.Cpp
  • g_bBrighten : dxsurf2.cpp
  • g_bCallStateReceived : TapiCode.c
  • g_bConnected : TapiCode.c
  • g_bEndServer : IocpServer.Cpp , IocpServerex.Cpp
  • g_bExitRequested : tapisend.cpp
  • g_bFontCharSet : sdkdiff.cpp
  • g_bInitializing : TapiCode.c
  • g_bInProc : MethCli.Cpp , security.cpp
  • g_bnds : dxsurf2.cpp
  • g_bndsMod : main.cpp
  • g_bndsWnd : main.cpp
  • g_bReplyRecieved : TapiCode.c
  • g_bRestart : IocpServer.Cpp , IocpServerex.Cpp
  • g_bRetry : bankdlg.Cpp , bankthrds.Cpp
  • g_bShuttingDown : TapiCode.c
  • g_bStop : bankdlg.Cpp , bankthrds.Cpp
  • g_bStopOnODBCErrors : bankdlg.Cpp , bankthrds.Cpp
  • g_bStoppingCall : TapiCode.c
  • g_bstrCRITERIA : Adminwrap.Cpp
  • g_bstrECID : Adminwrap.Cpp
  • g_bstrIID : Adminwrap.Cpp
  • g_bstrMETHOD : Adminwrap.Cpp
  • g_bstrNAME : Adminwrap.Cpp
  • g_bstrPUBID : Adminwrap.Cpp
  • g_bstrSUBINT : Adminwrap.Cpp
  • g_bstrTRANSPUBPROP : Adminwrap.Cpp
  • g_bstrTRANSSUB : Adminwrap.Cpp
  • g_bstrVALUE : Adminwrap.Cpp
  • g_bTapiInUse : TapiCode.c
  • g_bUnattended : bankdlg.Cpp , OPBank.Cpp
  • g_bVerbose : IocpServer.Cpp , IocpServerex.Cpp
  • g_bWin95 : Property.c
  • g_Callback : bits_ie.cpp
  • g_CallBackCritSec : AsyncDemo.cpp
  • g_cAttachedProcesses : myclassfactory.cpp
  • g_cBindURLMaps : error.h
  • g_cCDFlagsMaps : error.h
  • g_cchQueueFullHeaders : PoolWrap.cpp
  • g_cchQueueFullResponse : PoolWrap.cpp
  • g_cColFlagsMaps : error.h
  • g_cConsTypeMaps : error.h
  • g_cDBTypes : error.h
  • g_cDeferrabilityMaps : error.h
  • g_cDialectMaps : error.h
  • g_ce : configmgr.c , configmgr.h
  • g_cEntries : HtmlProp.Cxx
  • g_cFactoryDataEntries : cfactory.cpp , main.cpp , SERVER.CPP
  • g_cfBaseNodePtr : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfDataObjPtr : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfDisplayName : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfEmbeddedObject : dxferObj.Cpp
  • g_cfFileContents : DataObj.Cpp , DragImg.Cpp
  • g_cfFileGroupDescriptor : DataObj.Cpp , DragImg.Cpp
  • g_cfMS_Cookies : globals.cpp , globals.h
  • g_cfMS_IsMsObj : globals.cpp , globals.h
  • g_cfMS_Objects : globals.h , globals.cpp
  • g_cfMS_Snapins : globals.cpp , globals.h
  • g_cfNetResource : DropExt.C
  • g_cfNodeAttrPtr : globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfNodePropPtr : globals.cpp , globals.h
  • g_cfNodeType : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfNodeTypeFlg : globals.cpp , globals.h
  • g_cfObjectDescriptor : dxferObj.Cpp , idt.Cpp
  • g_cfSnapinClsid : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cfszNodeType : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_cInstances : HtmlProp.Cxx , lrsample.CXX , lrsample.HXX
  • g_cInterfaceMaps : error.h
  • g_cIsoLevels : error.h
  • g_ClassFactory : SServer.Cpp , sserver.cpp
  • g_cLCID : error.h
  • g_ClientContext : TestAccept.cpp
  • g_ClipBookServerFunctionTable : ClipBook Server.cpp
  • g_cLock : myclassfactory.cpp , MainDll.Cpp , Sample.h , MainDll.Cpp , Sample.h , MainDll.Cpp , MethProv.h , MainDll.Cpp , Sample.h , FileView.Cpp
  • g_cLocks : Dog.Cpp
  • g_CloseEvent : cfactory.cpp , DCOMServer.cpp , main.cpp
  • g_clsid : cfactory.cpp , DCOMServer.h , main.cpp , registry.cpp
  • g_cMatchTypeMaps : error.h
  • g_cObj : myclassfactory.cpp , MainDll.Cpp , Sample.h , MainDll.Cpp , Sample.h , MainDll.Cpp , MethProv.h , MainDll.Cpp , Sample.h , FileView.Cpp
  • g_cObjectCount : ComPerf.Cpp
  • g_cObjects : cDog.h , Dog.Cpp , Dogcf.h
  • g_cObjectTypeMaps : error.h
  • g_Col0Name : blrplate.cpp
  • g_Col1Name : blrplate.cpp
  • g_CompletionKey : NewFsp.h
  • g_CompletionPort : NewFsp.h
  • g_ConsoleData : SServer.Cpp
  • g_Contact_Properties : Service.cpp
  • g_Count : SServer.Cpp
  • g_cPromptOptions : error.h
  • g_cPropSetMaps : error.h
  • g_cRefDll : globals.cpp , globals.h , globals.cpp , globals.h
  • g_cRefThisDll : PropShet.Cpp , ShellExt.Cpp , Cfact.Cpp , DllMain.Cpp , Handler.Cpp , DropExt.C
  • g_cResources : msistuff.cpp
  • g_cResultFlagMaps : error.h
  • g_CriticalSection : IocpServer.Cpp , IocpServerex.Cpp
  • g_cRowColMaps : error.h
  • g_cs : SServer.Cpp , BYOTtransObj.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_csOpenFiles : openf.c
  • g_cSourceType : error.h
  • g_csSync : FreeObject.Cpp , FreeTest.Cpp
  • g_csWorkItems : ftrans.c , fwasync.c
  • g_cUpDelRuleMaps : error.h
  • g_CurrentCallCritSection : common.h , tapirecv.cpp
  • g_CurrentData : nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp
  • g_CV : globals.cpp , globals.h
  • g_cVariantTypes : error.h
  • g_cXACTTC : error.h
  • g_cxWidth : AppBar.c
  • g_cyHeight : AppBar.c
  • g_destaddr : QosEvent.Cpp , QosEvent.h
  • g_DisplayAttributeInfo : dap.cpp
  • g_DllRefCount : clsfact.Cpp , DoServer.Cpp , OLEDoc.Cpp , ADEvent.cpp , BandObjs.Cpp , Globals.h , SampView.Cpp , Utility.h , IcnOvrly.Cpp
  • g_dmDiagnosticMode : utils.cpp
  • g_dtSlideHide : Util.c
  • g_dtSlideShow : Util.c
  • g_dwAPIVersion : TapiCode.c
  • g_dwBreakID : error.cpp , error.h
  • g_dwCacheSeconds : CacheIsapi.cpp
  • g_dwCallState : TapiCode.c
  • g_dwCodeAddress : BPSamp.h , Utils.c
  • g_dwCreateFileFlags : openf.c
  • g_dwCreateFileShareMode : openf.c
  • g_dwCurrentThreadID : BPSamp.h , DbgCmd.c
  • g_dwDeviceID : TapiCode.c
  • g_dwEapTraceId : Eap.h , Exports.Cpp
  • g_dwEntries : PhoneEntry.c
  • g_dwErrorPost : error.cpp , error.h
  • g_dwFlags : main.cpp , prsample.h
  • g_dwIoControlCode : rcvall.c
  • g_dwLockCount : ole2ui.c
  • g_dwMessages : CallNot.cpp
  • g_dwNumDevs : TapiCode.c
  • g_dwNumNs : rnrcs.cpp
  • g_dwObjectCount : OleStd.h , dballoc.Cpp , ole2ui.c
  • g_dwProtocol : rcvall.c
  • g_dwReadThreadID : CommCode.c
  • g_dwRegister : DoServer.Cpp , cHello.Cxx
  • g_dwRegisterClass : server.cxx
  • g_dwRequestedID : TapiCode.c
  • g_dwSizeDeviceConfig : TapiCode.c
  • g_dwThread : Range.c
  • g_dwThreadCount : IocpServer.Cpp , WorkerThread.c
  • g_dwTLS : cfactory.cpp , main.cpp
  • g_dwWriteThreadID : CommCode.c
  • g_EnableLogging : PoolWrap.cpp
  • g_EnhKeyUsage : CreateCert.c
  • g_EventName : blrplate.cpp
  • g_ExpertName : blrplate.cpp
  • g_Extension : CacheIsapi.cpp , CustomAuth.cpp , CustomAuth.h
  • g_f3XDriver : quiktest.c
  • g_fActiveConference : CConf.Cpp , CConf.h , conf.cpp
  • g_FactoryDataArray : cfactory.cpp , main.cpp , SERVER.CPP
  • g_fAppRegistered : AppBar.c , AppBar.h
  • g_fAtCodeBreakpoint : BPSamp.h , DbgCmd.c
  • g_fClassRegistered : cHello.Cxx
  • g_fDragging : fulldrag.c
  • g_fFilterInitialized : CustomAuth.cpp , CustomAuth.h
  • g_fFlag : PhoneEntry.c
  • g_fFontBold : sdkdiff.cpp
  • g_FileShareSampleFunctionTable : File Share Sample.cpp
  • g_fInDbgCmd : BPSamp.h , DbgCmd.c
  • g_fNtds : rnrcs.cpp
  • g_fOpacity : dxsurf2.cpp
  • g_fPaintDeferred : fulldrag.c
  • g_fpLogFile : sampclnt.cpp , sampclnt.h
  • g_fQuiet : Global.h , Main.Cpp
  • g_fSap : rnrcs.cpp
  • g_fTimerActive : Obscure.c
  • g_ftInitTime : IsapiTime.cpp
  • g_fUseBuiltInLogoff : CustomAuth.cpp , CustomAuth.h
  • g_fUseBuiltInLogon : CustomAuth.cpp , CustomAuth.h
  • g_fUseClientIpForEncryption : CustomAuth.cpp , CustomAuth.h
  • g_fUseList : DragImg.Cpp
  • g_fUseSSLForSubmission : CustomAuth.cpp , CustomAuth.h
  • g_fValidEntry : PhoneEntry.c
  • g_fWndRegistered : Handler.Cpp
  • g_guid : cMgr.Cpp , cMgr.h
  • g_guidApp : CConf.Cpp , Global.h , CConf.Cpp , Global.h , CConf.Cpp
  • g_guidNM2Chat : CConf.Cpp , Global.h
  • g_guidNMUIChat : cMgr.Cpp , cMgr.h
  • g_hAccel : bankdlg.Cpp , OPBank.Cpp
  • g_hAccelTable : ui.cpp
  • g_hbrColor : fakemenu.c
  • g_hCall : TapiCode.c
  • g_hCleanupEvent : IocpServerex.Cpp
  • g_hCloseEvent : CommCode.c
  • g_hCommFile : CommCode.c
  • g_hCompletionPort : PoolWrap.cpp
  • g_hDialog : TapiCode.c
  • g_hDlg : bankdlg.Cpp , bankthrds.Cpp , CallNot.cpp , FileTerm.cpp , nlsapi.c
  • g_hDlgParentWindow : TapiCode.c
  • g_hDllInst : Marshal2.Cpp
  • g_HeapHandle : Macros.h , NewFsp.c
  • g_hEnv : MqTrans.Cpp
  • g_hEvent : server.cxx
  • g_hEventDone : SServer.Cpp
  • g_hExitEvent : dhcpnotify.cpp , common.h , tapirecv.cpp
  • g_hExpertKey : config.cpp
  • g_hFont : sdkdiff.cpp
  • g_hForceRefreshEvent : threads.c
  • g_hGeneralHeap : heap.Cpp
  • g_hHtmlDll : HtmlProp.Cxx
  • g_hID : BasicHiPerf.Cpp
  • g_himlLarge : SampView.Cpp , Utility.h
  • g_himlSmall : SampView.Cpp , Utility.h
  • g_hinst : globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , sendto.c , fakemenu.c , App32.C , App32.h
  • g_hInst : DoServer.Cpp , DoServer.h , Dog.Cpp , dialogs.c , printjob.c , quelist.c , ADEvent.cpp , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , dxsurf2.cpp , Cap.Cpp , MainDlg.Cpp , ComDlg32.C , Property.c , Rebar.c , VListVw.c , global.h , BandObjs.Cpp , Globals.h , DragImg.Cpp , enumdesk.cpp , enumdesk.h , FileView.Cpp , SampView.Cpp , Utility.h , IcnOvrly.Cpp , globals.cpp , globals.h , globals.cpp , globals.h
  • g_hinst : SetDisp.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , basesnap.Cpp , globals.h , BaseSnap.Cpp , Globals.h , basesnap.Cpp , globals.h , basesnap.Cpp
  • g_hInstance : SServer.Cpp , myclassfactory.cpp , GetImage.cpp , StdAfx.h , NewFsp.h , blrplate.cpp , blrplate.h , customdial.cpp , customdialreg.cpp , PhoneEntry.c , Eap.h , Exports.Cpp , Main.Cpp , Privobji.Cpp , exit.cpp , Exit.Cpp , Policy.Cpp , Server.Cpp , ClRes.cpp , ClRes.h , Globals.h , Main.c
  • g_hInstExe : precomp.h , ui.cpp
  • g_hIOCP : IocpServer.Cpp , IocpServerex.Cpp
  • g_hLine : TapiCode.c
  • g_hLineApp : TapiCode.c
  • g_hLogFile : NewFsp.h , PoolWrap.cpp
  • g_hMenu : ui.cpp
  • g_hmenuSendTo : sendto.c
  • g_hmodThisDll : Cfact.Cpp , DllMain.Cpp , Enum.Cpp , Handler.Cpp , Settings.Cpp , IconHdlr.Cpp , PropShet.Cpp , ShellExt.Cpp
  • g_hModule : cfactory.cpp , main.cpp , nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp , CertEnc.Cpp , lrsample.CXX
  • g_hProcDebuggee : BPSamp.h , Main.c
  • g_hReadThread : CommCode.c
  • g_hRes : global.h
  • g_hSafeToExitEvent : main.cpp , main.h
  • g_hSecurity : WebClient.c , WebServer.c
  • g_hTerminateEvent : threads.c
  • g_hwndDlg : bits_ie.cpp
  • g_hwndEdit : ui.cpp
  • g_hwndList : nlsapi.c
  • g_hwndMain : precomp.h , ui.cpp , Property.c , DragImg.Cpp , DropTgt.Cpp , enumdesk.cpp
  • g_hWndMainWindow : TapiCode.c
  • g_hwndMsg : ui.cpp
  • g_hwndPropSheet : Property.c
  • g_hWndResults : bankdlg.Cpp , bankthrds.Cpp
  • g_hWndStop : bankdlg.Cpp , bankthrds.Cpp
  • g_hWndSubmit : bankdlg.Cpp , bankthrds.Cpp
  • g_hwndUser : ui.cpp
  • g_hwo : childview.cpp , dlgdest.h , wave.h
  • g_hWriteThread : CommCode.c
  • g_iAddressFamily : rcvall.c
  • g_iCounter : nlsapi.c
  • g_iCurLocale : nlsapi.c
  • g_iFamilyMap : rcvall.c
  • g_iFrameIndex : main.cpp
  • g_iMinHeight : Global.h
  • g_iMinWidth : Global.h
  • g_InitResultCode : PoolWrap.cpp
  • g_InitSuccess : PoolWrap.cpp
  • g_Interface : nshsamp.h
  • g_InvokeInfo : session.cpp , session.h
  • g_iOutputLevel : bthcxn.cpp
  • g_iSettingsHeight : Global.h
  • g_iSettingsWidth : Global.h
  • g_iTemp : PhoneEntry.c
  • g_ItemsInQueue : PoolWrap.cpp
  • g_iWidthBuf : Global.h
  • g_JobId : bits_ie.cpp
  • g_JobManager : main.cpp , main.h
  • g_Justification : blrplate.cpp
  • g_lAsyncReply : TapiCode.c
  • g_lDone : Hello2.Cpp , Notify.Cpp , Hello3.Cpp , Notify.Cpp
  • g_LineAppHandle : NewFsp.h
  • g_lInstances : SmpFilt.Hxx
  • g_listSources : childview.cpp , dlgsrc.h
  • g_lLocks : Factory.Cpp , Server.Cpp
  • g_lObjects : BasicHiPerf.Cpp , Factory.Cpp , Server.Cpp
  • g_LockCount : Server.Cxx
  • g_LogFileLock : PoolWrap.cpp
  • g_LogonTimeoutSeconds : CustomAuth.cpp , CustomAuth.h
  • g_LogonType : CustomAuth.cpp , CustomAuth.h
  • g_lpDeviceConfig : TapiCode.c
  • g_lpRasEntry : PhoneEntry.c
  • g_lRequests : CacheIsapi.cpp
  • g_lWorkItems : ftrans.c , fwasync.c
  • g_MyGuid : rnrcs.cpp
  • g_nAddressTypeConstants : tapisend.cpp
  • g_nColumn : SampView.Cpp , Utility.h
  • g_nConnID : nullmdm.cpp
  • g_nFontHeight : sdkdiff.cpp
  • g_nMaxNumOfCSAddr : rnrcs.cpp
  • g_nMaxNumOfSocks : rnrcs.cpp
  • g_nNumberOfAddressTypes : tapisend.cpp
  • g_nNumOfUsedSocks : rnrcs.cpp
  • g_Nodes : basesnap.Cpp , registry.Cpp , basesnap.Cpp , registry.Cpp
  • g_nOSWinNT : Main.Cxx , osv.Hxx
  • g_NotificationReceiver : main.cpp , main.h
  • g_NotifyPrimarySTAEvent : Cancel.Cpp
  • g_nPollIntervalms : threads.c
  • g_nRows : bankdlg.Cpp , bankthrds.Cpp
  • g_nTAPINotificationCookie : tapirecv.cpp
  • g_nThreadsRunning : bankdlg.Cpp
  • g_NumThreads : PoolWrap.cpp
  • g_ObjectCount : Server.Cxx
  • g_ObjectGuid : nshsamp.h
  • g_OfflineData : nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp
  • g_OnlineData : nshsamp.cpp , sampinterface.cpp , sample.cpp , subcontext.cpp
  • g_pApplet : applet.cpp , applet.h
  • g_pCall : CallNot.cpp , FileTerm.cpp
  • g_pCAppLite : cdialoglite.cpp
  • g_pChannelAppShare : cShare.Cpp , cShare.h , cshare.cpp , cshare.h
  • g_pChannelData : cData.Cpp , cData.h , cData.Cpp , cData.h
  • g_pChannelFt : CConf.Cpp , CConf.h , cft.cpp , Init.Cpp
  • g_pChildView : childview.cpp , childview.h
  • g_pcm2 : enumdesk.cpp , enumdesk.h
  • g_pConference : CConf.Cpp , CConf.h , conf.cpp , CConf.Cpp , CConf.h , CConf.Cpp , CConf.h
  • g_pConferenceNotify : CConf.Cpp , conf.cpp , conf.h , CConf.Cpp
  • g_pCtxtList : IocpServer.Cpp , IocpServerex.Cpp
  • g_pCtxtListenSocket : IocpServerex.Cpp
  • g_pCurrCatalog : VCExplore.Cpp
  • g_pCurrCollection : VCExplore.Cpp
  • g_pCurrentCall : common.h , tapirecv.cpp
  • g_pDeviceInfo : NewFsp.h
  • g_pDialog : main.cpp , main.h
  • g_pdlgDest : childview.cpp , dlgdest.h
  • g_pDll : ComObj.Cpp , DllSkel.Cpp
  • g_pDoc : APIDoc.Cpp , APIDoc.h
  • g_pDXImageSurf : dxsurf1.cpp
  • g_pDXOutSurf : dxsurf2.cpp
  • g_pDXSurf1 : dxsurf2.cpp
  • g_pDXSurf2 : dxsurf2.cpp
  • g_pDXSurfOnSurfMod : dxsurf2.cpp
  • g_PerfFreq : bankdlg.Cpp , bankthrds.Cpp
  • g_pfnInvalidateCacheUrl : CacheIsapi.cpp
  • g_pfnLogEvent : ClRes.cpp , ClRes.h , ClRes.cpp , ClRes.h
  • g_pfnSetResourceStatus : ClRes.cpp , ClRes.h , ClRes.cpp , ClRes.h
  • g_pFt : CConf.Cpp , CConf.h , cft.cpp
  • g_pGIT : StdAfx.h , SyncComp.Cpp
  • g_pHandles : bankdlg.Cpp
  • g_pidlCurFQ : list.cpp
  • g_pIInkCollector : BasicRecognition.cpp
  • g_pIInkDisp : BasicRecognition.cpp
  • g_pIInkRecoContext : BasicRecognition.cpp
  • g_pIMalloc : sampclnt.cpp , sampclnt.h
  • g_pITaskScheduler : sa.Cpp
  • g_pJob : bits_ie.cpp
  • g_pListApp : chWnd.Cpp
  • g_pListCall : CCall.Cpp , CCall.h
  • g_pListCallNotify : CCall.Cpp , CCall.h
  • g_pListChannel : CChan.Cpp , CChan.h
  • g_pListChannelNotify : CChan.Cpp , CChan.h
  • g_pListConference : CConf.Cpp , CConf.h
  • g_pListConferenceNotify : CConf.Cpp , CConf.h
  • g_pListUser : cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h , cMemb.Cpp , cMemb.h
  • g_pLookupTable : main.cpp
  • g_pLUTBuilder : main.cpp
  • g_pMainDlg : Cap.Cpp , MainDlg.Cpp
  • g_pMalloc : sendto.c , enumdesk.cpp , enumdesk.h
  • g_pManager : bits_ie.cpp
  • g_pMember : CConf.Cpp , CConf.h
  • g_pMemberLocal : cMemb.Cpp , cMemb.h
  • g_pMgr : CConf.Cpp , CConf.h , conf.cpp , CConf.Cpp , CConf.h , CConf.Cpp , CConf.h , cMgr.Cpp , cMgr.h
  • g_pMgrNotify : CConf.Cpp , conf.cpp , CConf.Cpp , cMgr.Cpp
  • g_pMsgLog : AptClien.Cpp , AptServe.Cpp , Server.h , ComObj.Cpp , ComObjI.h , ComUser.Cpp , DllClien.Cpp , DllServe.Cpp , Server.h , LicClien.Cpp , LicServe.Cpp , Server.h , LocClien.Cpp , LocServe.Cpp , Server.h , RemClien.Cpp
  • g_pNameSpace : SamplCli.Cpp
  • g_pNotifyAppShare : cShare.Cpp , cShare.h , cshare.cpp , cshare.h
  • g_pNotifyData : cData.Cpp , cData.h , cData.Cpp , cData.h
  • g_pNotifyFileTransfer : cft.cpp , Init.Cpp
  • g_pNotifyFt : CConf.Cpp , CConf.h
  • g_pOpenFiles : openf.c
  • g_Port : IocpServer.Cpp , IocpServerex.Cpp
  • g_ppBLRPLATEConfig : config.cpp
  • g_pPlayFileTerm : CallNot.cpp , FileTerm.cpp
  • g_pPrimaryDXSurf : dxsurf1.cpp
  • g_pQuery : QueryParser.cpp
  • g_pRecordFileTerm : CallNot.cpp , FileTerm.cpp
  • g_Process_Properties : Service.cpp
  • g_progID : cfactory.cpp , DCOMServer.h , main.cpp , registry.cpp
  • g_ProxyProtocols : proxypluginimpl.cpp
  • g_pServer : Server.h , AptServe.Cpp , Server.h , ConServe.Cpp , DcdServe.Cpp , Server.h , DllServe.Cpp , FreServe.Cpp , Server.h , LicServe.Cpp , LocServe.Cpp , Server.h , PerDraw.Cpp , Server.h , PerServe.Cpp , Server.h , PerText.Cpp , Server.h , StoServe.Cpp
  • g_pSession : session.h , session.cpp
  • g_pSettings : DllMain.Cpp , Handler.Cpp , Settings.Cpp
  • g_psfCurFolder : list.cpp
  • g_psfDesktop : sendto.c
  • g_pSSPI : WebClient.c , WebServer.c
  • g_pSuite : bankdlg.Cpp
  • g_pSurf1 : main.cpp
  • g_pSurf2 : main.cpp
  • g_pSurfFact : dxsurf2.cpp , dxsurf1.cpp , main.cpp
  • g_pSurfMod : dxsurf2.cpp , main.cpp
  • g_pSurfModSurf : main.cpp
  • g_pszConnection : adoisapi.cpp
  • g_pTapi : tapirecv.cpp , FileTerm.cpp , common.h , tapisend.cpp
  • g_pthdParam : CAsyncTest.cpp
  • g_pThreadMgr : globals.h , tsfapp.cpp
  • g_pThreads : PoolWrap.cpp
  • g_pTransFact : main.cpp
  • g_pViewList : ShlFldr.Cpp , SampView.Cpp , ShlView.Cpp
  • g_pWinlogon : GinaStub.c
  • g_qinfo : MQPort.Cpp
  • g_QS : rnrcs.cpp
  • g_QueueFullHeaders : PoolWrap.cpp
  • g_QueueFullPages : PoolWrap.cpp , PoolWrap.h
  • g_QueueFullResponse : PoolWrap.cpp
  • g_QueueSize : PoolWrap.cpp
  • g_RandomCommands : nshsamp.cpp
  • g_RasDevInfo : PhoneEntry.c
  • g_rcAppBar : AppBar.c , AppBar.h
  • g_RefreshOnTimer : bits_ie.cpp
  • g_RegTable : server.cxx
  • g_ResetObjects : nshsamp.cpp
  • g_rgBindURLMaps : error.h
  • g_rgCDFlagsMaps : error.h
  • g_rgColFlagsMaps : error.h
  • g_rgConsTypeMaps : error.h
  • g_rgDBTypes : error.h
  • g_rgDeferrabilityMaps : error.h
  • g_rgDialectMaps : error.h
  • g_rgInterfaceMaps : error.h
  • g_rgIsoLevels : error.h
  • g_rgLCID : error.h
  • g_rgMatchTypeMaps : error.h
  • g_rgObjectTypeMaps : error.h
  • g_rgPromptOptions : error.h
  • g_rgPropSetMaps : error.h
  • g_rgResultFlagMaps : error.h
  • g_rgRowColMaps : error.h
  • g_rgSourceType : error.h
  • g_rgUpDelRuleMaps : error.h
  • g_rgVariableList : DumpRequestInfo.cpp
  • g_rgVariantTypes : error.h
  • g_rgXACTTC : error.h
  • g_RootGuid : nshsamp.h
  • g_saDestinationAddress : rcvall.c
  • g_saLocalInterface : rcvall.c
  • g_Sample_Commands : nshsamp.cpp
  • g_SampleInterface : nshsamp.h
  • g_SampleInterface_Commands : nshsamp.cpp
  • g_saSourceAddress : rcvall.c
  • g_schSCMHandle : ClRes.cpp , ClRes.h
  • g_sDlgItems : App32.C , SetDisp.c
  • g_sdListen : IocpServer.Cpp , IocpServerex.Cpp
  • g_ServerInfo : RemClien.Cpp , DComDraw.Cpp
  • g_ShowError : nshsamp.cpp
  • g_siObjAccesses : Privobji.Cpp
  • g_siObjInheritTypes : Privobji.Cpp
  • g_sNonDialable : TapiCode.c
  • g_spDataConvert : common.cpp , common.h
  • g_StartTime : Extension.cpp
  • g_StatusString : blrplate.cpp , blrplate.h
  • g_strCacheUrl : CacheIsapi.cpp
  • g_strIniFile : CustomAuth.h , CustomAuth.cpp , ReMapUrl.cpp
  • g_strLogoffUrl : CustomAuth.cpp , CustomAuth.h
  • g_strLogonSuccessUrl : CustomAuth.cpp , CustomAuth.h
  • g_strLogonUrl : CustomAuth.cpp , CustomAuth.h
  • g_strRedirectResponse : Redir401.cpp
  • g_style : Global.h
  • g_SubContext : nshsamp.h
  • g_SymTagNames : dbh.cpp
  • g_szAddressTypes : tapisend.cpp
  • g_szAppClassName : Main.Cpp
  • g_szAppName : printjob.c
  • g_szCaption : main.cpp
  • g_szClassName : Property.c , VListVw.c , DragImg.Cpp , enumdesk.cpp
  • g_szDialableAddress : TapiCode.c
  • g_szDisplayableAddress : TapiCode.c
  • g_szEmpty : CreateCert.c
  • g_szEntryName : PhoneEntry.c
  • g_szErrorResponse : DumpRequestInfo.cpp
  • g_szExtTitle : SampView.Cpp , Utility.h
  • g_szFile : Global.h , Main.Cpp
  • g_szFileName : bits_ie.cpp , sendto.c
  • g_szFontFaceName : sdkdiff.cpp
  • g_szHttpError403_16 : ErrorTxt.h
  • g_szHttpError500 : ErrorTxt.h
  • g_szHttpHeader : isapiCertPolicy.cpp
  • g_szLogFile : OPBank.Cpp , bankdlg.Cpp
  • g_szMachineName : DComDraw.Cpp , RemClien.Cpp
  • g_szMainTitle : ADEvent.cpp
  • g_szMessage : client.cxx
  • g_szModuleName : IsapiDebug.h , IsapiTools.h , IsapiModule.cpp
  • g_szMyStore : CreateCert.c
  • g_szNameSpaceRoot : CEnumStorageResource.h
  • g_szNotes : main.cpp
  • g_szNULLMStartString : nullmdm.cpp
  • g_szPageTitle : PerClien.Cpp
  • g_szPhysicalDriveFormat : CEnumStorageResource.h
  • g_szRemoteAddr : bthcxn.cpp
  • g_szRemoteName : bthcxn.cpp
  • g_szSigAlg : CreateCert.c
  • g_szStoragePath : SampView.Cpp , Utility.h
  • g_szTitle : printjob.c , DragImg.Cpp
  • g_szTSFAppTitle : tsfwnd.cpp
  • g_szTSFEditClassName : tsfedit.cpp
  • g_szTSFMainClassName : tsfwnd.cpp
  • g_tabwidth : sdkdiff.cpp , sdkdiff.h
  • g_tcsTemp : global.h
  • g_Thread : mspthrd.cpp
  • g_ThreadHandles : IocpServerex.Cpp , IocpServer.Cpp
  • g_ThreadTerminate : Main.cpp
  • g_Tools : ShlView.Cpp , Tools.h
  • g_TopLevelCommands : nshsamp.cpp
  • g_TopLevelSubInterfaceCommands : nshsamp.cpp
  • g_TotalRequests : PoolWrap.cpp , PoolWrap.h
  • g_uiCodePage : msiloc.cpp
  • g_ulAdvise : FileTerm.cpp
  • g_ulFilterMask : rcvall.c
  • g_ulMaxCxnCycles : bthcxn.cpp
  • g_uObjectCount : globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_uObjects : globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , BaseSnap.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , basesnap.h , globals.h , Globals.h , globals.h
  • g_UpdateTimerSet : bits_ie.cpp
  • g_uPosition : enumdesk.cpp
  • g_uServerLocks : globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h , globals.cpp , globals.h
  • g_UseThreadPool : PoolWrap.cpp
  • g_uSrvLock : basesnap.h , BaseSnap.h , basesnap.h
  • g_VerbMap : ContMenu.Cpp
  • g_wcBuf : Global.h
  • g_wCurLang : global.h
  • g_wLangId : msiloc.cpp
  • g_WorkerThread : Processing.cpp , common.h
  • g_wSide : Rebar.c
  • g_wszDataSourceKeyword : binder.cpp , sampprov.h
  • g_wszFileKeyword : binder.cpp , sampprov.h
  • g_wszMachineName : MqTrans.Cpp , DComDraw.Cpp , RemClien.Cpp
  • g_wszResourceTypeNames : StdAfx.h , StdAfx.cpp
  • g_wszRowKeyword : sampprov.h , binder.cpp
  • gaAttributes : Enumprt.h
  • gaBrushStyles : Printer.h
  • gaCaps : Getcaps.h
  • gaClipCaps : Getcaps.h
  • gaColor : Enumprt.h
  • gaCurveCaps : Getcaps.h
  • gAddContextEvent : sockinfo.cpp , spi.cpp , asyncselect.cpp
  • gAddressFamily : rawudp.c , Ping.cpp
  • gaDefaultSource : Enumprt.h
  • gaDriverInfo : Enumprt.h
  • gaDrvInfo : Getpdriv.h
  • gaDuplex : Enumprt.h
  • gaEnumPrt : Enumprt.h
  • gaFields : Enumprt.h
  • gaGraphicLookup : Printer.h
  • gahwndSpin : SpinTest.h
  • gaLineCaps : Getcaps.h
  • gaMMLookup : Printer.h
  • ganPosX : TIMEWND.c
  • gaOrientation : Enumprt.h
  • gaPaperSize : Enumprt.h
  • gaPenStyles : Printer.h
  • gaPenWidths : Printer.h
  • gaPolygonCaps : Getcaps.h
  • gaPrintQuality : Enumprt.h
  • gaPriorities : Enumprt.h
  • gaRasterCaps : Getcaps.h
  • garMsgStrings : MousInfo.c
  • gaStatus : Enumprt.h
  • gatbButton : MainWND.c
  • gaTechnologyCaps : Getcaps.h
  • gaTextCaps : Getcaps.h
  • gb3D : MfEdit.h
  • gbAbort : Printer.h
  • gBase : dbh.cpp
  • gBaseInfo : sockinfo.cpp , spi.cpp
  • gbAutoPlay : MainWND.c
  • gbCaptRect : WinCap.c , Dialogs.c
  • gbDB : MfEdit.h
  • gbDebug : MfEdit.h
  • gbExport3X : MfEdit.h
  • gbFit2Wnd : MfEdit.h
  • gbHitTest : MfEdit.h
  • gbImport3X : MfEdit.h
  • gBindAddr : Mcastws1.c
  • gbLButtonDown : WinCap.c
  • gbNowCapturing : WinCap.c , Dialogs.c
  • gbPDOutln : MfEdit.h
  • gbPerverseCompare : sdkdiff.cpp
  • gbRCSet : MfEdit.h
  • gbRecording : MfEdit.h
  • gbRepaint : TIMEWND.c
  • gbSave : WinCap.c
  • gbSFOutln : MfEdit.h
  • gbstrVideo : Callnot.Cpp
  • gbTT : MfEdit.h
  • gBufferSize : Mcastws2.c , Mcastws1.c
  • gbUseDIB : MfEdit.h
  • gbUseMfPFD : MfEdit.h
  • gc_igtMultiStrokeGestures : AdvReco.cpp
  • gc_igtSingleStrokeGestures : AdvReco.cpp
  • gc_lMaxInputScopeMenuItemLength : AdvReco.cpp
  • gc_nRecommendedForMixedMode : AdvReco.cpp
  • gc_pwsInputScopes : AdvReco.cpp
  • gc_szAppName : AdvReco.cpp , MultiReco.cpp , BasicRecognition.cpp
  • gc_uiCtrlId : TPCInfo.cpp
  • gc_wszAppName : TPCInfo.cpp
  • gc_wszProgId : TPCInfo.cpp
  • gc_wszSpeechKey : TPCInfo.cpp
  • gCallAsClassFactory : Server.Cxx
  • gCmd : dbh.cpp
  • gCount : Mcastws2.c , Mcastws1.c
  • gCriticalSection : sockinfo.cpp , asyncselect.cpp , spi.cpp
  • gCrText : MfEdit.h
  • gCurrentLineInfo : Dialer.c
  • gcUsers : cMemb.Cpp
  • gDataSize : Ping.cpp
  • gDebugCritSec : spi.cpp
  • gDefaultBase : dbh.cpp
  • gDefaultBaseForVirtualMods : dbh.cpp
  • gDestAddress : rawudp.c
  • gDestination : Ping.cpp
  • gDestPort : rawudp.c
  • gDib : MfEdit.h
  • gDropCallRequestID : Dialer.c
  • gdwBrushColor : Printer.h
  • gdwCurCtrl : MfEdit.h
  • gdwCurTool : MfEdit.h
  • gdwEndSel : Dialer.c
  • gdwEnumFlags : Enumprt.h
  • gdwGraphicsOptions : Printer.h , Paint.h
  • gdwLineDeviceIDBase : Atsp.h
  • gdwPenColor : Printer.h
  • gdwPermanentProviderID : Atsp.h
  • gdwPLID : Dialer.c
  • gdwStartSel : Dialer.c
  • gdwTextColor : Printer.h
  • gdwThreadCount : overlap.cpp
  • gdxWndMin : Global.h , Main.Cpp
  • gdyWndMin : Global.h , Main.Cpp
  • gEvent_handle : RasDialAsync.c
  • gExecCmd : dbh.cpp
  • gfAutoAnswer : Callnot.Cpp , Incoming.Cpp
  • gfCallRequest : Dialer.c
  • gfCurrentLineAvail : Dialer.c
  • gfMakeCallReplyPending : Dialer.c
  • gfNeedToReinit : Dialer.c
  • gfRegistered : Dialer.c
  • ghAccelApp : MciPlay.c
  • ghAccelTable : Global.h , Main.Cpp , Global.h
  • ghBitmap : WinCap.c
  • ghbmLogo : WinCap.c
  • ghBmp : MfEdit.h
  • ghBmpDn : MfEdit.h
  • ghBmpMask : MfEdit.h
  • ghBmpUp : MfEdit.h
  • ghbrAppBkgd : MfEdit.h
  • ghbrCur : MfEdit.h
  • ghbrRed : MfEdit.h
  • ghCall : Dialer.c
  • ghChildFileMappingEvent : Sockdups.c
  • ghCurFont : MfEdit.h
  • ghdc : Printer.h
  • ghDCMem : MfEdit.h
  • ghDCMetaf : MfEdit.h
  • ghDlg : Callnot.Cpp , Incoming.Cpp , Outgoing.Cpp
  • ghdlgStatus : Global.h
  • ghDLLInst : Hook.c , Print.c , Dllinit.c
  • gHeight : odbcsql.c
  • ghEventEnd : SysInfo.h
  • ghFont : TIMEWND.c
  • ghFontBtn : Dialer.c
  • ghFontBtnStar : Dialer.c
  • ghFontBtnText : Dialer.c
  • ghfontEntry : Global.h , Main.Cpp , Global.h
  • ghfontMsg : Main.Cpp
  • ghHT : MfEdit.h
  • ghInst : MidiPlyr.h , Dialer.c , Dlgopen.c , Printer.h , Incoming.Cpp , Global.h , Dialogs.c , Global.h , ole2ui.c , Atsp.h , MidiPlyr.c , Common.h , Main.Cpp , Global.h , Main.Cpp , Outgoing.Cpp , Global.h , SpinTest.h , MousInfo.c , ui.cpp , DynDlg.c , Main.Cpp , Paint.h , WinCap.c
  • ghInstance : InstCodc.Cpp
  • ghInstApp : MciPlay.c
  • ghIocp : overlap.cpp , spi.cpp
  • ghLibHandle : RasHost.Cpp
  • ghLineApp : Dialer.c
  • ghMenu : Global.h , Main.Cpp
  • ghMetaf : MfEdit.h
  • ghmf : MfEdit.h
  • ghMMFileMap : Sockdups.c
  • ghMod : SpinCube.c
  • ghModule : MainDll.Cpp , MfEdit.h , MainDll.Cpp
  • ghPal : MfEdit.h , WinCap.c
  • ghParentFileMappingEvent : Sockdups.c
  • ghpnCur : MfEdit.h
  • ghpnWide : MfEdit.h
  • ghTextWnd : MfEdit.h
  • ghToolBmpDn : MfEdit.h
  • ghToolBmpUp : MfEdit.h
  • ghVerifyDlg : SetDisp.h
  • ghWakeupSemaphore : overlap.cpp
  • ghWnd : halftone.c
  • ghwndAbort : Printer.h
  • ghwndApp : Global.h , MciPlay.c , Main.Cpp
  • ghWndCapture : WinCap.c
  • ghwndChat : Main.Cpp , Global.h
  • ghwndClient : MfEdit.h
  • ghwndCtrlPanel : MfEdit.h
  • ghwndDevCaps : Getcaps.h
  • ghWndDialing : Dialer.c
  • ghwndDrawSurf : MfEdit.h
  • ghwndEdit : Global.h , Main.Cpp
  • ghwndEntry : Main.Cpp
  • ghwndEnumPrt : Enumprt.h
  • ghwndLView : Global.h , Main.Cpp
  • ghWndMain : Dialogs.c
  • ghwndMain : Printer.h , Global.h , Enumprt.h , Paint.h , Getcaps.h , Main.Cpp , Global.h , MfEdit.h , Main.Cpp
  • ghWndMain : Dllinit.c
  • ghwndMain : Global.h , Main.Cpp
  • ghWndMain : WinCap.c
  • ghwndMain : Getpdriv.h , Main.Cpp
  • ghWndMain : Hook.c , Dialer.c
  • ghwndMdi : MciPlay.c
  • ghwndMsg : Main.Cpp , Global.h , Main.Cpp , Global.h
  • ghwndNext : MfEdit.h
  • ghwndProgress : CConf.Cpp
  • ghwndSbar : Global.h , Main.Cpp
  • ghwndSend : Main.Cpp , Global.h
  • ghWndStatus : MainWND.c
  • ghwndTbar : Global.h , Main.Cpp
  • ghWndTime : MainWND.c
  • ghWndToolbar : MainWND.c
  • ghwndTools : MfEdit.h
  • ghwndUList : Main.Cpp , Global.h
  • ghwndUser : Main.Cpp , Global.h , Main.Cpp
  • giBrushStyle : Printer.h
  • giColumn : Paint.h
  • giCurrentAddress : Dialer.c
  • giCurrentLine : Dialer.c
  • giDeltaX : Paint.h
  • giDeltaY : Paint.h
  • gImageName : dbh.cpp
  • giMapMode : Printer.h , Paint.h
  • gImeUIData : Global.C , FullIME.h
  • gInterface : Mcastws1.c , Mcastws2.c
  • giNumSpincubesAllProcesses : SpinCube.c
  • giNumSpincubesThisProcess : SpinCube.c
  • giPenStyle : Printer.h
  • giPenWidth : Printer.h
  • gLayerCount : sockinfo.cpp , spi.cpp
  • glcyMenu : Paint.h , Printer.h
  • glcyStatus : MfEdit.h
  • glf : MfEdit.h
  • gLine : dbh.cpp
  • gListCritSec : PrPerf.c
  • glNumInst : Sample.h , InstProv.Cpp , ClassProv.Cpp
  • Global : DebMain.h , DebMain.c
  • global_asc_flags : GssServer.c
  • GLOBAL_STRING : PerfUtil.c , PerfUtil.h , PerfUtil.c
  • gLoopBack : Mcastws1.c , Mcastws2.c
  • gM : Paint.h
  • gMakeCallRequestID : Dialer.c
  • gMessage : rawudp.c
  • gModName : dbh.cpp
  • gMtuSize : rawudp.c
  • gMulticast : Mcastws2.c , Mcastws1.c
  • gnAddr : Dialer.c
  • gnAvailDevices : Dialer.c
  • gnCurrentMode : SetDisp.h
  • gnModes : SetDisp.h
  • gnPosY : TIMEWND.c
  • gnSB_TFPaneSize : MainWND.c
  • gnTimeFormat : MidiPlyr.h , MidiPlyr.c
  • gnTimerOn : TIMEWND.c
  • gNumTimes : PrPerf.c
  • gObj : dbh.cpp
  • gOptions : dbh.cpp
  • gOverlappedCS : spi.cpp , overlap.cpp
  • gpAddress : Outgoing.Cpp
  • gpCall : Outgoing.Cpp , Callnot.Cpp , Incoming.Cpp
  • gpccs : SpinCube.c
  • gpCurrentMode : SetDisp.h
  • gpDevModes : SetDisp.h
  • gpfnCompletionProc : Atsp.h
  • gpfnGetEnhMetaFilePixelFormat : MfEdit.h
  • gpfnReceiveProc : RasHost.h , RasHost.Cpp
  • gpfnSendProc : RasHost.h , RasHost.Cpp
  • gpnAudCapOrderedIndex : InstCodc.Cpp
  • gPort : Mcastws2.c , Mcastws1.c
  • gPref : Main.Cpp , Global.h , Main.Cpp , Global.h
  • gProtocol : Ping.cpp , Mcastws2.c , Mcastws1.c , rawudp.c
  • gProtocolName : PrPerf.c
  • gpsAudCapInfoList : InstCodc.Cpp
  • gpSeq : MidiPlyr.h , MidiPlyr.c
  • gpTapi : Incoming.Cpp , Outgoing.Cpp
  • gpWFmt : InstCodc.Cpp
  • grbChanMsgLen : SMFREAD.c
  • grcTWnd : MidiPlyr.c , MidiPlyr.h
  • gReadRaw : rawudp.c
  • grfMode : OleStd.h
  • grgszTimeFormats : MidiPlyr.h , MidiPlyr.c
  • grHwndCtrlBtn : MfEdit.h
  • grHwndToolBtn : MfEdit.h
  • gsAccept : Sockdups.c
  • gsConnect : Sockdupc.c
  • GSCRP_BEGIN_FORM : scripts.h
  • GSCRP_DELETE_BUTTON : scripts.h
  • GSCRP_END_FORM : scripts.h
  • GSCRP_LINK_HOMEPAGE : scripts.h
  • GSCRP_RENAME_BUTTON : scripts.h
  • gSendCount : rawudp.c
  • gSender : rawudp.c
  • gSendSize : rawudp.c
  • gServerName : PrPerf.c
  • gServerType : PrPerf.c
  • gServerZone : PrPerf.c
  • gsListen : Sockdups.c
  • gSocketList : PrPerf.c
  • gSocketMonitor : Dt_Dll.Cpp
  • gSocketType : rawudp.c , Mcastws1.c , Mcastws2.c
  • gSrcAddress : rawudp.c
  • gSrcFileName : dbh.cpp
  • gSrcPort : rawudp.c
  • gSymbolSearchPath : dbh.cpp
  • gszAddr : Init.Cpp
  • gszAddrType : Init.Cpp
  • gszAppClassName : Main.Cpp , Init.Cpp , Main.Cpp
  • gszAppLongName : MidiPlyr.h , MidiPlyr.c
  • gszAppName : Main.Cpp , Init.Cpp , Main.Cpp , Global.h
  • gszAppTitle : Main.Cpp , MainWND.c
  • gszAppTitleMask : MidiPlyr.h , MidiPlyr.c
  • gszAtspKey : Atsp.h
  • gszBuffer : MciPlay.c
  • gszChat : Init.Cpp
  • gszConferenceName : Outgoing.Cpp , Init.Cpp
  • gszCurrentName : Dialer.c
  • gszCurrentNumber : Dialer.c
  • gszDefExtension : MainWND.c
  • gszDefLineConfigParams : Atsp.h
  • gszDevice : Print.c
  • gszDeviceName : Getcaps.h , Printer.h , Getpdriv.h
  • gszDriverName : Getcaps.h , Printer.h , Getpdriv.h
  • gszEmailName : Outgoing.Cpp
  • gszEnumName : Enumprt.h
  • gszFileName : Init.Cpp
  • gszFilter : MainWND.c
  • gszFormatHMS : TIMEWND.c
  • gszFormatTicks : TIMEWND.c
  • gszHRError : InstCodc.Cpp
  • gszIniAutoCall : Init.Cpp
  • gszIniAutoChat : Init.Cpp
  • gszIniAutoHost : Init.Cpp
  • gszIniAutoMonitor : Init.Cpp
  • gszIniCallType : Init.Cpp
  • gszIniInit : Init.Cpp
  • gszIniMsgNotify : Init.Cpp
  • gszIniMsgObjects : Init.Cpp
  • gszIniMsgState : Init.Cpp
  • gszIniMsgTrace : Init.Cpp
  • gszIniName : Init.Cpp , Global.h
  • gszIPAddress : Outgoing.Cpp
  • gszMachineName : Outgoing.Cpp
  • gszMainWnd : Init.Cpp
  • gszMsg : Init.Cpp
  • gszMsgFont : Init.Cpp
  • gszMWndClass : MidiPlyr.c , MidiPlyr.h
  • gszNULL : Dialer.c
  • gszNumLines : Atsp.h
  • gszOpenName : MainWND.c
  • gszOpenTitle : MainWND.c
  • gszOutput : Print.c
  • gszPhoneNumber : Outgoing.Cpp
  • gszPort : Printer.h , Getpdriv.h , Getcaps.h
  • gszSbar : Init.Cpp
  • gszSDNumber : Dialer.c
  • gszTapi30 : Outgoing.Cpp , Incoming.Cpp
  • gszTbar : Init.Cpp
  • gszTWndClass : MidiPlyr.c , MidiPlyr.h
  • gszUntitled : MidiPlyr.h , MidiPlyr.c
  • gszWindowText : WinCap.c
  • gtab_msgcode : table.cpp
  • gtCodec : InstCodc.Cpp
  • gTID : dbh.cpp
  • gTtl : Mcastws2.c , Mcastws1.c , Ping.cpp
  • guDevice : MainWND.c
  • guidDrawType : drawdlg.cpp , DrawDlg.Cpp
  • guidStorage : SmpFilt.Hxx
  • GUIDSTRING : MainDll.Cpp
  • guiFileOKMsg : WinCap.c , Dlgopen.c
  • gulAdvise : Incoming.Cpp
  • gulcInstances : HtmlIFlt.Cxx
  • guwRowCount : quiktest.c
  • gVars : WSnmpUtil.Cpp , WSnmpUtil.h
  • gWInfo : InstCodc.Cpp
  • gWorkerThread : overlap.cpp
  • gXformedVertices : Paint.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- h -

  • hAbortWnd : tprint.cpp
  • haccel : sdkdiff.cpp
  • hAccTable : ClipText.c
  • HANDLE : rqsengine.h
  • Handle : enablerouter.c
  • HANDLED_MSG : common.h , winmain.h
  • hAppMemSharedMemory : DllInit.c
  • hBigMenu : Menu.c
  • hBLRPLATE : blrplate.c
  • hbmCheckOff : Menu.c
  • hbmCheckOn : Menu.c
  • hbmMask : PlgBlt.c
  • hbmSrc : PlgBlt.c
  • hbrBackground : status.cpp
  • hbrBtnFace : Status.c , Tools.c
  • hbrLeft : bar.cpp
  • hbrRight : bar.cpp
  • hbrSame : bar.cpp
  • hbrSideBar : bar.cpp
  • hBrushButton : Find.c , Open.c , Print.c
  • hBrushDlg : Find.c , Open.c , Print.c
  • hBrushEdit : Find.c , Open.c , Print.c
  • hbrWindow : Tools.c
  • hButton : AsyncDemo.cpp
  • hChildMenu : MfEdit.h
  • hChildMenuWindow : MfEdit.h
  • hColorThread1 : Colors.c
  • hColorThread2 : Colors.c
  • hConnect : FTPJr.cpp
  • hCurKL : FullIME.h , Global.C
  • hData : ClipText.c
  • hdbc : quiktest.h
  • hDbgMsgLog : DbgMsg.cpp , dbgmsg.cpp
  • hdc : OleStd.h , Font.c
  • hdcDest : PlgBlt.c
  • hDCGlobal : Mypal.c
  • hdcGlobal : Paint.h
  • hdcMask : PlgBlt.c
  • hdcSrc : PlgBlt.c
  • hdesc : quiktest.h
  • HDESK : GinaHook.h , GinaStub.h
  • hDevMode : Print.c
  • hDevNames : Print.c
  • hDialog : Open.c
  • hDialogColors : Colors.c
  • hDialogFind : Find.c
  • hDialogFont : Font.c
  • hDialogPrint : Print.c
  • hDlg : Monkey.c
  • hDlgAbort : Print.c
  • hDllInstance : spi.cpp , clsid.Cpp , RegisterServer.Cpp , ShortName.Cpp , ShortName.h , UnRegisterServer.Cpp , Cleanup.Cpp , Cleanup.h , RegisterServer.Cpp , UnRegisterServer.Cpp , asyncselect.cpp
  • HEADERSIZE : CMallSpy.Cxx , spy.cpp
  • Headline : news.Idl
  • HEADSIGN : spy.cpp
  • HEADSIZE : spy.cpp
  • hEditMenu : FontView.c
  • henv : quiktest.h
  • hEvent : RasHost.h
  • hEventLog : Perfmsg.h , PerfUtil.c , Perfmsg.h , PerfUtil.c
  • hevtDone : sserver.cpp
  • hFileMenu : FontView.c
  • hfntFixed : FullIME.h , Global.C , Main.C
  • hfntOld : FullIME.h , Global.C , Main.C
  • hFont : status.cpp , OleStd.h , Data.c , IMEApps.h
  • hFontCopyright : ABOUT.c , About.c
  • hfontDlg : Connect.c , Listen.c
  • hfontStatus : Status.c
  • hFontThread1 : Font.c
  • hFontThread2 : Font.c
  • hfontTools : Tools.c
  • HGLOBAL : OleStd.h
  • hHeap : file.cpp , sdkdiff.h , FaxSiren.Cpp , DebDebug.c , Monkey.c
  • hHelpMenu : FontView.c
  • hHook : Find.h
  • hHourGlass : Cursor.c
  • hIcon : halftone.c
  • hide_markedfiles : sdkdiff.cpp , sdkdiff.h
  • hInst : ViewDIB.c , halftone.c , PlgBlt.c , WxForm.h , GLOBALS.h , INIT.c , Globals.h , Init.c , EventSink.cpp , Client32.c , Server32.c , Monkey.c , StatList.c , LeakyBin.c , ClipText.c , CDTest.h , Cursor.c , Data.c , IMEApps.h , Data.C , MultiUI.h , Menu.c , IconPRO.C , Icons.C , MDIChild.C , Demo.c , Generic.C , sdkdiff.cpp , sdkdiff.h , OleStd.h , Tools.c , TextFx.c
  • Hinstance : enablerouter.c
  • hInWnd : Globals.h
  • hKey : OleStd.h
  • HKEY : OleStd.h
  • hKillSvr : ComPerf.Cpp
  • hLibInst : gutils.cpp , table.cpp , tprint.cpp , utils.cpp
  • hLoadedInst : autotest.h , dllstub.c
  • hLspHeap : overlap.cpp , sockinfo.cpp , spi.cpp
  • hMDIClientWnd : MDIChild.C , IconPRO.C
  • hMenu : sdkdiff.cpp , FontView.c , MfEdit.h
  • hMenuWindow : MfEdit.h
  • hMetricsMenu : FontView.c
  • hModelessDlg : WinCap.c
  • hModule : instlsp.cpp
  • hMonitorThread : fullsvr.Cpp
  • hMyCertStore : WebClient.c , WebServer.c
  • hNormCurs : table.cpp , tpriv.h
  • hOpen : AsyncDemo.cpp , FTPJr.cpp
  • hOpenSaveThread1 : Open.c
  • hOpenSaveThread2 : Open.c
  • hOutWnd : Globals.h
  • hPal : Mypal.c
  • hpenBlack : status.cpp
  • hpenDotted : table.cpp , tpriv.h
  • hpenHilight : status.cpp
  • hpenLeft : bar.cpp
  • hpenLowlight : status.cpp
  • hpenNeutral : status.cpp
  • hpenRight : bar.cpp
  • hpenSame : bar.cpp
  • hPolicy : mapname.c
  • hPrintThread1 : Print.c
  • hPrintThread2 : Print.c
  • hProcessHeap : common.cpp
  • hProfLog : prof.cpp , Prof.cpp
  • hProfMutex : prof.cpp , prof.h , prof.cpp , prof.h
  • hr : suminfo.h
  • hrasconn : main.cpp
  • hReceiveEvent : FaxSiren.Cpp
  • hRectangleDlg : WinCap.c
  • hRes : Open.c
  • hResColors : Colors.c
  • hResFind : Find.c
  • hResFont : Font.c
  • hResPrint : Print.c
  • hSaveCursor : Cursor.c
  • hSelectDlg : WinCap.c
  • hServerStopEvent : Simple.c
  • hSession : AsyncDemo.cpp
  • hSimulateTrap : TestDll.C
  • hSlot : Bcast.c
  • hStatus : secSvr.Cpp
  • hstmt : quiktest.h
  • hSysMenuAdv : FontView.c
  • hSysMenuMain : FontView.c
  • hText : ClipText.c
  • hThread : enablerouter.c
  • HTML_FILTER_CHUNK_SIZE : InpStrm.Hxx
  • HtmlFiltFilter : Register.Cxx
  • HtmlFiltHandler : Register.Cxx
  • HtmlPropFilter : HtmlProp.Cxx
  • HtmlPropHandler : HtmlProp.Cxx
  • hVertCurs : table.cpp , tpriv.h
  • hViewMenu : FontView.c
  • hWnd : Server32.c
  • hwnd : ClipText.c
  • hwndBar : sdkdiff.cpp
  • hWndCandList : Data.c , IMEApps.h
  • hwndClient : sdkdiff.h , FontView.c , sdkdiff.cpp
  • hWndClient : Client32.c
  • hWndCompStr : Data.c , IMEApps.h
  • hwndCreateParam : FontView.c
  • hwndCreateValue : FontView.c
  • hWndDef1 : MultiUI.h , Data.C
  • hWndDef2 : Data.C , MultiUI.h
  • hWndDialog : Cancel.Cpp
  • hWndDisplayCtl : EDITCTLS.c
  • hwndDlg : PlgBlt.c
  • hwndFind : Find.c
  • hwndHelp : WxForm.h
  • hWndIMC1 : Data.C , MultiUI.h
  • hWndIMC2 : Data.C , MultiUI.h
  • hWndIMCUI1 : Data.C , MultiUI.h
  • hWndIMCUI2 : MultiUI.h , Data.C
  • hWndInputCtl : EDITCTLS.c
  • hwndLabel1 : FontView.c
  • hwndMain : Tools.c
  • hWndMain : Data.c , MDIChild.C
  • hwndMain : WxForm.h
  • hWndMain : MultiUI.h , IconPRO.C , IMEApps.h
  • hwndMain : PlgBlt.c , FontView.c
  • hWndMain : Data.C , halftone.c , Icons.C
  • hwndMainColor : Colors.c
  • hwndMainDialog : Find.c , Open.c
  • hwndMainFont : Font.c
  • hwndMainPrint : Print.c
  • hWndMDIClient : GdiDemo.c
  • hwndMenuField : FontView.c
  • hwndMouse : WxForm.h
  • hWndParent : EDITCTLS.c , msgfiltr.h
  • hwndRCD : sdkdiff.cpp , sdkdiff.h
  • hWndStatus : IMEApps.h
  • hwndStatus : sdkdiff.cpp
  • hWndStatus : Data.c
  • hwndStatus : Status.c
  • hWndStatusbar : STATBAR.c , STATBAR.h
  • hwndTimeField : FontView.c
  • hWndToolbar : ToolBar.h
  • hWndToolBar : Data.c , IMEApps.h
  • hWndToolbar : ToolBar.c , ToolBar.h
  • hWndToolBarOwner : ToolBar.c
  • hwndToolButton : Tools.c
  • hwndToolCombo : Tools.c
  • hwndTools : Tools.c
  • hwndToolText : Tools.c
  • hwndTransform : WxForm.h
  • hwndZoom : FontView.c
  • hWorkSem : ThreadPool.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- i -

  • i : Utils.Cpp , suminfo.Cpp , enablerouter.c
  • i_should_sleep : Globals.h , Init.c
  • IADsError_ServerInfo : ADsError_p.c
  • IAnnotator_ServerInfo : EDAnnotator_p.c
  • ibcData : msiloc.cpp
  • ibcName : msiloc.cpp
  • IBrowserHost_ServerInfo : EdCommands_p.c , EdGlyphs_p.c , EdHost_p.c
  • iccAttrib : msiloc.cpp
  • iccHt : msiloc.cpp
  • iccName : msiloc.cpp
  • iccProperty : msiloc.cpp
  • iccText : msiloc.cpp
  • iccType : msiloc.cpp
  • iccWd : msiloc.cpp
  • iccX : msiloc.cpp
  • iccY : msiloc.cpp
  • ICEnrollProgID : RequestCert.Cpp
  • iciHeight : msiloc.cpp
  • iciText : msiloc.cpp
  • iciWidth : msiloc.cpp
  • iciX : msiloc.cpp
  • iciY : msiloc.cpp
  • iCREATE_NEW_DB : msiloc.cpp
  • idcAttrib : msiloc.cpp
  • idcHt : msiloc.cpp
  • idcName : msiloc.cpp
  • idcTitle : msiloc.cpp
  • idcWd : msiloc.cpp
  • idcX : msiloc.cpp
  • idcY : msiloc.cpp
  • iDIALOGS : msiloc.cpp
  • idiHCentering : msiloc.cpp
  • idiHeight : msiloc.cpp
  • idiTitle : msiloc.cpp
  • idiVCentering : msiloc.cpp
  • idiWidth : msiloc.cpp
  • idl : CrmDebug.Idl , CrmFilesTest.Idl , CrmMonComp.Idl , icrmFiles.Idl , cascadeec.Idl , news.Idl , newseventclass.Idl , persistatl.Idl , Account.Idl , OPBank.Idl , LogWriter.Idl , QCNotify.Idl , QCOrder.Idl , QCShip.Idl , QCNotify.Idl , QCOrder.Idl , QCShip2.Idl , Disp1.Idl , VCSecuritySample.Idl , TServer.Idl , ADOKB.Idl , OLEDBKB.Idl , ComSpy.Idl , RDOKB.Idl , account.Idl , ComSpyAudit.Idl , data.Idl , GraphObj.Idl , ComSpyCtl.Idl , SampMsp.Idl , CertXSam.Idl , CpyImage.Idl , CertPSam.Idl , IMSConf2.Idl , MtsAudit.Idl , IMSConf2.Idl , MtsSpyCtl.Idl , MtsUserEventObj.Idl , RmWorker.Idl , TxFileDisp.Idl , CopyFileRm.Idl , SimpleLog.Idl , fullsvr.Idl , myProp.Idl , PingResp.Idl , Server.Idl , pipesample.Idl , BYOTTransaction.Idl , TxEnlister.Idl , ComSyncObject.Idl , FreeObject.Idl , STAObject.Idl
  • idPopup : STATBAR.c
  • IDSIZE : spy.cpp
  • iEXPORT_MSI : msiloc.cpp
  • iFace : Paint.h
  • igc : loadprotocol.c
  • iGlobalXOffset : Mypal.c
  • iGlobalYOffset : Mypal.c
  • ignore_blanks : sdkdiff.cpp , sdkdiff.h
  • IgnoreCase : AsyncIO.h
  • IGrid_ServerInfo : EdHost_p.c
  • iGroupType : main.cpp
  • IHelloWorld_ServerInfo : ADsFirstExt_p.c
  • IID__ADO : adoint.h
  • IID__ADOCollection : adoint.h
  • IID__ADODynaCollection : adoint.h
  • IID__Command : adoint.h
  • IID__Connection : adoint.h
  • IID__Parameter : adoint.h
  • IID__Recordset : adoint.h
  • IID_ADOConnectionConstruction : adoint.h
  • IID_ADORecordsetConstruction : adoint.h
  • IID_DataSourceListener : common.h
  • IID_Error : adoint.h
  • IID_Errors : adoint.h
  • IID_Field : adoint.h
  • IID_Fields : adoint.h
  • IID_IADsError : ADsError_i.c , ADsError.h
  • IID_IAggregate : cbase.h
  • IID_IApplet : iapplet.c , iapplet.h
  • IID_IAppletNotify : iapplet.c , iapplet.h
  • IID_IAppletSession : iapplet.c , iapplet.h
  • IID_IAppletSessionNotify : iapplet.h , iapplet.c
  • IID_IDownloadBindStatusCallback : setupui.cpp
  • IID_IEAPProviderConfig : Exports.Cpp
  • IID_IHelloWorld : ADsFirstExt.h , ADsFirstExt_i.c , ADsFirstExt.h , ADsFirstExt_i.c
  • IID_IMMCControl : atlcontrol.h
  • IID_IUnknown : setupui.cpp
  • IID_IUPnPService_DimmingService_SCPD : MyDevice.h , MyDevice_i.c , MyDevice.h , MyDevice_i.c
  • IID_OLEDBSimpleProvider : common.h
  • IID_OLEDBSimpleProviderListener : common.h
  • IID_Parameters : adoint.h
  • IID_Properties : adoint.h
  • IID_Property : adoint.h
  • iIMPORT_RES : msiloc.cpp
  • iMaxResStrLen : msiloc.cpp
  • iMinMsiAllowedVer : msistuff.cpp
  • IN_BUFFER_SIZE : RSAKey.cpp , SessionKey.cpp , RSACert.cpp
  • in_out_pipe_state : Pipec.c
  • IniFile : FaxSiren.Cpp
  • int : OleStd.h
  • interfacedata : ComPerf.Cpp
  • INVALID_INDEX : cdialoglite.h
  • IoBuffer : WebServer.c
  • IoCompletedEvent : AsyncIO.h
  • IoPort : UnBufCp1.c
  • IPFile : AdminDll.c
  • IPFileInValid : AdminDll.c
  • iPortNumber : WebServer.c , WebClient.c
  • iProxyPort : WebClient.c
  • IPTLauncher_ServerInfo : BrochureMachine_p.c
  • iRasterCaps : Mypal.c
  • irbcHt : msiloc.cpp
  • irbcOrder : msiloc.cpp
  • irbcText : msiloc.cpp
  • irbcWd : msiloc.cpp
  • irbcX : msiloc.cpp
  • irbcY : msiloc.cpp
  • irbiHeight : msiloc.cpp
  • irbiText : msiloc.cpp
  • irbiWidth : msiloc.cpp
  • iscCallback : AsyncDemo.cpp
  • iSKIP_BINARY : msiloc.cpp
  • ISnap_ServerInfo : EdGlyphs_p.c , EdHost_p.c , EdCommands_p.c
  • iSTRINGS : msiloc.cpp
  • iTestNames : quiktest.c
  • iYMiddle : Mypal.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- p -

  • pAdminSID : Service.cpp , Service.h , service.cpp
  • pAdsTypeToStringList : UserProps.cpp
  • pages : tprint.cpp
  • PageSize : UnBufCp1.c , UnBufCp2.c
  • palSVGA : stdpal.h
  • pAnonSID : Service.cpp , Service.h , service.cpp
  • pAppData : AppMema.h , DllInit.c
  • paramdata : ComPerf.Cpp
  • PARENT : Sockdups.c
  • parFontsGlobal : Paint.h
  • parwszUserMandatoryProps : UserProps.cpp
  • parwszUserOptionalProps : UserProps.cpp
  • pAutoApt : ComPerf.Cpp
  • pAutoAptRmt : ComPerf.Cpp
  • pAutoFree : ComPerf.Cpp
  • pAutoFreeRmt : ComPerf.Cpp
  • pBindingVector : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • pbstrResult : Account.Idl
  • pByte : SimpleLog.Idl
  • pcClientBuffer : Pipec.c
  • pchDesc : langbar.cpp
  • pClientActiveReqCounters : Service.cpp , Service.h , service.cpp , service.h
  • pClientReqCounters : Service.cpp , Service.h , service.cpp , service.h
  • pCOMApt : ComPerf.Cpp
  • pCOMAptRmt : ComPerf.Cpp
  • pCOMFree : ComPerf.Cpp
  • pCOMFreeRmt : ComPerf.Cpp
  • pCSet : APP.Cxx
  • pCurrent : list.cpp
  • pd : Print.c
  • pDataHeader : AppMema.h , DllInit.c
  • pdThread1 : Print.c
  • pdThread2 : Print.c
  • PDWORD : GinaHook.h , GinaStub.h
  • PendingEnd : overlap.cpp
  • PendingStart : overlap.cpp
  • PERCENT : AsyncRPCp.c
  • PerformanceFrequency : ComSpy.Cpp , Methodsub.Cpp
  • petcSrc : OleStd.h
  • pfd : Font.c
  • pfEmbedFlag : Utils.Cpp
  • pFetcRight : OleStd.h
  • pfnHandler : langbar.cpp
  • pfWlxActivateUserShell : GinaStub.c
  • pfWlxDisplayLockedNotice : GinaStub.c
  • pfWlxDisplaySASNotice : GinaStub.c
  • pfWlxDisplayStatusMessage : GinaStub.c
  • pfWlxGetStatusMessage : GinaStub.c
  • pfWlxInitialize : GinaStub.c
  • pfWlxIsLockOk : GinaStub.c
  • pfWlxIsLogoffOk : GinaStub.c
  • pfWlxLoggedOnSAS : GinaStub.c
  • pfWlxLoggedOutSAS : GinaStub.c
  • pfWlxLogoff : GinaStub.c
  • pfWlxNegotiate : GinaStub.c
  • pfWlxNetworkProviderLoad : GinaStub.c
  • pfWlxRemoveStatusMessage : GinaStub.c
  • pfWlxScreenSaverNotify : GinaStub.c
  • pfWlxShutdown : GinaStub.c
  • pfWlxStartApplication : GinaStub.c
  • pfWlxWkstaLockedSAS : GinaStub.c
  • pguid : register.cpp
  • pguidCategory : register.cpp
  • PHANDLE : GinaHook.h , GinaStub.h
  • phRasServer : Admapit.c
  • phwnd : ComSpyCtl.Idl , MtsSpyCtl.Idl
  • picture_mode : sdkdiff.cpp
  • pid : suminfo.h
  • PID_HEADING_1 : HtmlGuid.Hxx
  • PID_HEADING_2 : HtmlGuid.Hxx
  • PID_HEADING_3 : HtmlGuid.Hxx
  • PID_HEADING_4 : HtmlGuid.Hxx
  • PID_HEADING_5 : HtmlGuid.Hxx
  • PID_HEADING_6 : HtmlGuid.Hxx
  • PID_HREF : HtmlGuid.Hxx
  • PID_TITLE : HtmlGuid.Hxx
  • pJAustin : Disp1.Idl
  • plReceiptNo : Account.Idl
  • PLUID : GinaHook.h , GinaStub.h
  • pMainView : MainFrm.h , MqApiTst.Cpp
  • pName : FrameworkProv.h
  • PointerSize : tracedmp.cpp
  • pointl : OleStd.h
  • ppRasUser0 : Admapit.c
  • pProcessList : DebDebug.c
  • pQueryAllInterfacesOut : ADSIhelpers.cpp
  • pr2six : HttpAuth.c
  • pRedNose : FrameworkProv.h
  • prefNameLookup : main.cxx
  • pRemAddr : Globals.h
  • PrevX : Demo.c , Cursor.c
  • PrevY : Demo.c , Cursor.c
  • PrGlobal : APP.Cxx , View.Cxx
  • PRIV_ERROR_DRIVE_LETTER_IN_USE : DLEdit.Cpp
  • PRIV_ERROR_PARTITION_HIDDEN : DLEdit.Cpp
  • PRIV_ERROR_PARTITION_NOT_RECOGNIZED : DLEdit.Cpp
  • PRIVATE_USE_MAPPING_FOR_GT : CharHash.Hxx
  • PRIVATE_USE_MAPPING_FOR_LT : CharHash.Hxx
  • processFlagLateBound : processFlags.h
  • processFlagQueuedComponents : processFlags.h
  • processFlagWriteDB : processFlags.h
  • PROF_LOG : prof.cpp , Prof.cpp
  • ProfCriticalSection : Prof.h , prof.cpp , prof.h , Prof.cpp
  • Profile : DebMain.h , DebMain.c
  • PROP_BUFFER_SLOP : PropTag.Hxx
  • propidPK : DirEncrypt.Cpp
  • PropListHeader : DpDetail.Cpp
  • PROPSET_DSO : utilprop.h
  • PROPSET_DSOINIT : utilprop.h
  • PROPSET_INIT : utilprop.h
  • PROPSET_ROWSET : utilprop.h
  • PROPSET_SESSION : utilprop.h
  • ProtocolArray : Server.c
  • ProtocolBuffer : Server.c
  • ProviderGuid : lspguid.cpp , install.h
  • ProviderPath : install.h , lspguid.cpp
  • pSearchPref : main.cxx
  • pServerActiveReqCounters : Service.cpp , Service.h
  • pServerReqCounters : Service.cpp , Service.h , service.cpp , service.h
  • PSID : GinaHook.h , GinaStub.h
  • psidProcessOwnerSID : SidClean.c
  • pSockAddr : Globals.h
  • pSortKey : main.cxx
  • pStgmed : ias.h
  • pSystemSID : Service.cpp , service.cpp , Service.h
  • psz_dwMsg : TapiInfo.c
  • pszAttrList : main.cxx
  • pszAttrNames : main.cxx
  • pszCmdLine : Utils.Cpp
  • pszDesc1 : ComPerf.Cpp
  • pszDescription : MainFrm.Cpp
  • pszFileName : Utils.Cpp , WebClient.c
  • pszfLINEADDRESSSTATE : TapiInfo.c
  • pszfLINEBUSYMODE : TapiInfo.c
  • pszfLINECALLINFOSTATE : TapiInfo.c
  • pszfLINECALLPRIVILEGE : TapiInfo.c
  • pszfLINECALLSTATE : TapiInfo.c
  • pszfLINEDEVSTATE : TapiInfo.c
  • pszfLINEDIALTONEMODE : TapiInfo.c
  • pszfLINEDIGITMODE : TapiInfo.c
  • pszfLINEDISCONNECTED : TapiInfo.c
  • pszfLINEGATHERTERM : TapiInfo.c
  • pszfLINEGENERATETERM : TapiInfo.c
  • pszfLINEMEDIAMODE : TapiInfo.c
  • pszfLINEREQUESTMODE : TapiInfo.c
  • pszfLINESPECIALINFO : TapiInfo.c
  • pszGuidApp : ComSpyAudit.Idl
  • pszLineErrorNameArray : TapiInfo.c
  • pszOrderDSN : DataSourceNames.h
  • pszPassword : DataSourceNames.h , main.cxx , DataSourceNames.h
  • pszProxyServer : WebClient.c
  • pszSearchBase : main.cxx
  • pszSearchFilter : main.cxx
  • pszSecurity : AsyncRPCs.c
  • pszServerName : WebClient.c
  • pszShipDSN : DataSourceNames.h
  • pszThreadID : ComSpyAudit.Idl
  • pszUserFile : db.c
  • pszUserId : DataSourceNames.h
  • pszUserName : main.cxx , WebClient.c , WebServer.c
  • pszW2KThreadID : ComSpyAudit.Idl
  • pszWorkingDirectoryName : sdkdiff.cpp
  • ptCursor : Cursor.c
  • ptd : OleStd.h
  • ptdRight : OleStd.h
  • pThreadPool : InvokObjThreads.cpp
  • ptImeUIPos : Data.c , IMEApps.h
  • ptoDest : PlgBlt.c
  • ptoMask : PlgBlt.c
  • ptoRect : WxForm.h
  • ptoSrc : PlgBlt.c
  • pUnkOuter : helpdll.Cpp
  • PURE : dballoc.h
  • pVal : data.Idl , GraphObj.Idl
  • pvarEvent : MtsAudit.Idl
  • pvarRet : data.Idl
  • pvGameID : TServer.Idl
  • pvName : TServer.Idl
  • pvNonPersistent : RPCssmp.c
  • pvOrder : TServer.Idl
  • pvPersistent : RPCssmp.c
  • pvX : TServer.Idl
  • pvY : TServer.Idl
  • pWbemServices : tracewmi.cpp
  • pwcHTMLFilter : HtmlProp.Cxx
  • pwcHTMLPropertyFile : HtmlProp.Cxx
  • pwcMetaProperty : HtmlProp.Cxx
  • pWeight : FrameworkProv.h
  • PWLX_MPR_NOTIFY_INFO : GinaHook.h , GinaStub.h
  • pwszDllType : mapname.c , dllmain.c
  • pwszUsage : main.cpp
  • pWTSEnumerateServers : Tst4Wts.c
  • pWTSFreeMemory : Tst4Wts.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- q -

  • QueryItems : QueryDlg.Cpp
  • Quit : Admapit.c
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- r -

  • RasSrv : Admapit.c
  • RasUser0 : Admapit.c
  • rClientRect : Mypal.c
  • ReadPort : UnBufCp2.c
  • RECO_CAPABILITIES : RecoDll.cpp
  • RECO_LANGUAGES : RecoDll.cpp
  • RECO_MANAGER_KEY : RecoDll.cpp
  • RECO_SHORT_NAME : RecoDll.cpp
  • RECO_SUBKEY : RecoDll.cpp
  • RECO_VENDOR_NAME : RecoDll.cpp
  • RECOCLSID_SUBKEY : RecoDll.cpp
  • RECOGNIZER_SUBKEY : RecoDll.cpp
  • RECOGNIZER_SUBPATH : RecoDll.cpp
  • RECOPROC_SUBKEY : RecoDll.cpp
  • Rect : Cursor.c , Demo.c
  • recvbuf : Ping.cpp
  • recvbuflen : Ping.cpp
  • refcnt : OleStd.h
  • REG_VALUE_ADMIN_EXTENSIONS : RegExt.cpp
  • RegistrationHandle : TraceDp.c
  • RegUsersPri : Service.cpp , Service.h , service.cpp , service.h
  • RemAddr : Globals.h
  • Render_ProxyFileInfo : Render_p.c
  • repeat : Cursor.c
  • resBitmap : msiloc.cpp
  • resButtonClass : msiloc.cpp
  • resCheckBox : msiloc.cpp
  • resComboBoxClass : msiloc.cpp
  • resControl : msiloc.cpp
  • resDialog : msiloc.cpp
  • resEditClass : msiloc.cpp
  • reserved : iec.h
  • resGroupBox : msiloc.cpp
  • resIcon : msiloc.cpp
  • resJPEG : msiloc.cpp
  • resListBoxClass : msiloc.cpp
  • resListViewClass : msiloc.cpp
  • resProgBar32Class : msiloc.cpp
  • resPushButton : msiloc.cpp
  • resRadioButton : msiloc.cpp
  • resRichEditClass : msiloc.cpp
  • resSelTreeClass : msiloc.cpp
  • resStaticClass : msiloc.cpp
  • resStringTable : msiloc.cpp
  • Result : data.Idl
  • RetainShape : Demo.c
  • return : suminfo.Cpp
  • returnval : ADOKB.Idl , OLEDBKB.Idl , RDOKB.Idl
  • rgAuthnEntries : secClnt.Cpp
  • rgAuthnLevelEntries : secClnt.Cpp , secSvr.Cpp
  • rgAuthzEntries : secClnt.Cpp
  • rgb : quiktest.h
  • rgb_barcurrent : sdkdiff.cpp , sdkdiff.h
  • rgb_barleft : sdkdiff.h , sdkdiff.cpp
  • rgb_barright : sdkdiff.cpp , sdkdiff.h
  • RGB_BLUE : common.h
  • RGB_BROWN : common.h
  • RGB_DARK_BLUE : common.h
  • RGB_DARK_GREEN : common.h
  • RGB_DARK_RED : common.h
  • rgb_defaultback : sdkdiff.cpp
  • rgb_defaultfore : sdkdiff.cpp
  • rgb_defaultforews : sdkdiff.cpp
  • rgb_fileleftback : sdkdiff.cpp
  • rgb_fileleftfore : sdkdiff.cpp
  • rgb_filerightback : sdkdiff.cpp
  • rgb_filerightfore : sdkdiff.cpp
  • RGB_GREEN : common.h
  • rgb_leftback : sdkdiff.cpp , sdkdiff.h
  • rgb_leftfore : sdkdiff.cpp , sdkdiff.h
  • rgb_mleftback : sdkdiff.cpp , sdkdiff.h
  • rgb_mleftfore : sdkdiff.cpp , sdkdiff.h
  • rgb_mrightback : sdkdiff.cpp , sdkdiff.h
  • rgb_mrightfore : sdkdiff.cpp , sdkdiff.h
  • RGB_NONE : common.h
  • rgb_outlinehi : sdkdiff.cpp , sdkdiff.h
  • RGB_RED : common.h
  • rgb_rightback : sdkdiff.cpp , sdkdiff.h
  • rgb_rightfore : sdkdiff.cpp , sdkdiff.h
  • rgb_similar : sdkdiff.cpp
  • rgb_similarleft : sdkdiff.cpp
  • rgb_similarright : sdkdiff.cpp
  • rgchResSwitch : msistuff.cpp
  • rgcmd : IpxChat.c , TapiComm.c
  • rgcmdAbout : About.c , ABOUT.c
  • rgcmdConnect : Connect.c
  • rgcmdListen : Listen.c
  • rgDBTypes : common.cpp
  • rgDescInfo : quiktest.c
  • rgDiagInfo : quiktest.c
  • rgErrorMap : error.cpp
  • rgImpLevelEntries : secClnt.Cpp , secSvr.Cpp
  • rgInterfaceMap : error.cpp
  • rgMetaName : MfEdit.h
  • rgmsd : TapiComm.c , IpxChat.c
  • rgmsdAbout : About.c , ABOUT.c
  • rgmsdConnect : Connect.c
  • rgmsdListen : Listen.c
  • rgnBitDepth : dlgdest.cpp
  • rgnSampleRate : dlgdest.cpp
  • rgRegInfo : myclassfactory.cpp
  • rgServerEntries : secClnt.Cpp
  • rgszCommandOptions : msistuff.cpp
  • rgszResName : msistuff.cpp
  • riid : OleStd.h
  • riid1 : helpdll.Cpp
  • riid2 : helpdll.Cpp
  • RowsProcessed : quiktest.c
  • RpcHeap : service.cpp , Service.h , service.h , service.cpp , Service.cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- s -

  • s : bar.cpp , sdkdiff.cpp , suminfo.Cpp
  • s_cInstances : secSvr.Cpp
  • s_ClassFactory : secSvr.Cpp
  • s_crCurrent : secClnt.Cpp
  • s_csDone : secSvr.Cpp
  • s_fDone : secSvr.Cpp
  • s_fServer : secSvr.Cpp
  • s_fService : secSvr.Cpp
  • s_hbrCurrent : secClnt.Cpp
  • s_hevtDone : secSvr.Cpp
  • s_hwndDlg : secSvr.Cpp
  • s_rgprop : utilprop.cpp
  • s_rgsteServices : secSvr.Cpp
  • s_Service : secSvr.Cpp
  • sa_ipx : rnrcs.cpp
  • sc : OleStd.h , suminfo.Cpp , suminfo.h
  • SchannelCred : WebClient.c
  • sci : columnprovider.Cpp
  • sCreateTable : ComSpysqlAudit.Cpp
  • sDescription : CpyImage.Idl
  • sDestination : RmWorker.Idl , TxFileDisp.Idl
  • sdw : quiktest.h
  • SearchedFileCount : AsyncIO.h
  • SearchFunction : AsyncIO.h
  • SearchString : AsyncIO.h
  • SearchStringLength : AsyncIO.h
  • SecTableW : Stubs.c
  • security : suminfo.h
  • SeenDialogNames : complist.cpp
  • selection : sdkdiff.cpp , view.cpp
  • selection_nrows : sdkdiff.cpp , view.cpp
  • selector : suminfo.Cpp
  • SEPARATORHEIGHT : TextWnd.Cpp
  • ServerActiveReqBounds : Service.cpp , Service.h
  • ServerActiveReqHashCounters : Service.cpp , Service.h
  • ServerCompletionPort : FileRepServerProc.cpp , Service.cpp
  • ServerProtocolArray : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • ServerReqBounds : Service.cpp , Service.h , service.cpp , service.h
  • ServerReqQueues : Service.cpp , Service.h
  • SeWorldSid : TakeOwn.c
  • Shape : Demo.c
  • show_whitespace : sdkdiff.cpp , sdkdiff.h
  • showHelp : WxForm.h
  • showMouse : WxForm.h
  • showTransform : WxForm.h
  • ShrName : Client32.c
  • ShutdownItems : ShutdownDlg.Cpp
  • SigGenDataDefinition : DataGen.c , Perfgen.c
  • SignOnly : GssClient.c
  • six2pr : HttpAuth.c
  • sizel : OleStd.h
  • sMainColor : CpyImage.Idl
  • smpFilter : SmpFilt.Cxx
  • smpHandler : SmpFilt.Cxx
  • sMyData : ComDlg32.C
  • sock : Bcast.c , Globals.h
  • SourceFile : UnBufCp1.c , UnBufCp2.c
  • SPECIAL_CHAR_HASH_TABLE_SIZE : CharHash.Hxx
  • sqlBinary : msiloc.cpp
  • sqlControl : msiloc.cpp
  • sqlControlImport : msiloc.cpp
  • sqlControlInstallerName : msiloc.cpp
  • sqlCreateCtrlMark : msiloc.cpp
  • sqlCreateDlgMap : msiloc.cpp
  • sqlCreateStrMap : msiloc.cpp
  • sqlCtrlMark : msiloc.cpp
  • sqlDialog : msiloc.cpp
  • sqlDialogImport : msiloc.cpp
  • sqlDialogInstallerName : msiloc.cpp
  • sqlDialogSpecific : msiloc.cpp
  • sqlDlgMap : msiloc.cpp
  • sqlFindResId : msiloc.cpp
  • sqlFindStrResId : msiloc.cpp
  • sqlInsertCtrl : msiloc.cpp
  • sqlInsertStr : msiloc.cpp
  • sqlProductCode : setup.h
  • sqlRadioButton : msiloc.cpp
  • sqlRadioButtonImport : msiloc.cpp
  • sqlSelMaxRcId : msiloc.cpp
  • sqlSelMaxStrRcId : msiloc.cpp
  • sqlStrCol : msiloc.cpp
  • sqlStringImport : msiloc.cpp
  • sqlStringInstallerName : msiloc.cpp
  • sqlStrMark : msiloc.cpp
  • sqlStrTemp : msiloc.cpp
  • SrvSock : Globals.h
  • ss_in : rnrcs.cpp
  • sshStatusHandle : Service.cpp , Service.h , filerepservice.cpp , Service.C , Service.c
  • sSource : TxFileDisp.Idl
  • ssStatus : Service.cpp , Service.h , filerepservice.cpp , Service.C , Service.c
  • sTables : ComSpysqlAudit.Cpp
  • Static_Check_Stats : AdminDll.c
  • Static_Connection_Info : AdminDll.c
  • Status : secSvr.Cpp , Admapit.c
  • status : Service.cpp , filerepservice.cpp , filerepserver.cpp , filerepservice.cpp
  • status_charheight : status.cpp
  • status_charwidth : status.cpp
  • status_height : sdkdiff.cpp
  • StatusArray : quiktest.c
  • STATUSBAR : cmainwindow.cpp
  • statusField : Status.c
  • sTheme : CpyImage.Idl
  • sToFile : CpyImage.Idl
  • str : Cursor.c
  • STR_JOBNAME_DEFAULT : cdialog.cpp
  • STR_SAMPLETEXT_DEFAULT : cdialog.cpp
  • STR_VIRTUALDIR_NOTIFICATIONS : cdialog.cpp
  • STR_VIRTUALDIR_PLAIN : cdialog.cpp
  • StringClass : MainFrm.Cpp
  • strOverLimit : msiloc.cpp
  • strRegKey : classfac.cpp
  • strTitle : drawdlg.cpp
  • strValue : classfac.cpp
  • strValueName : classfac.cpp
  • SUBLANG_ENGLISH_SAMPLE : lrsample.HXX
  • SubVersion : sdkdiff.cpp
  • SUCCESS : FCopy.Cpp
  • sum : fullsvr.Idl
  • SummaryFile : tracedmp.cpp
  • SupportedGeometry : Mfmt.c
  • SupportedGeometryCount : Mfmt.c
  • sw : quiktest.h
  • swBindOffset : quiktest.c
  • Symbol : news.Idl
  • SyncIO : AsyncIO.h
  • SystemEndTime : PrPerf.c
  • SystemEventInfo : selectEventsDlg.Cpp
  • SystemStartTime : PrPerf.c
  • szAdminInstallProperty : setup.h
  • szAppidValueName : Common.h
  • szAppName : Generic.C , msgfiltr.h , FontView.c , TextFx.c , ViewDIB.c , Dialogs.c , WinCap.c , halftone.c , GLOBALS.h , INIT.c , Globals.h , Init.c , Main.Cpp , StatList.c , LeakyBin.c , MousInfo.h , IconPRO.C
  • szAppTitle : FontView.c
  • szBuf : Utils.Cpp , Admapit.c
  • szBuff : BPSampTest.c
  • szCandClass : FullIME.h , Global.C
  • szCertReq : RequestCert.Cpp
  • szChildClassName : IconPRO.C
  • szClassName : MousInfo.h
  • szCLSIDDescription : DllMain.Cpp
  • szClsidKeyName : Common.h
  • szCmd : DbgCmd.c
  • szCmdLine : Utils.Cpp , FTPJr.cpp
  • szCodepageExport : msiloc.cpp
  • szCodepageFile : msiloc.cpp
  • szColNames : ComSpyproppage.Cpp
  • szCommaTab : msiloc.cpp
  • szCommCtrlHdrFile : msiloc.cpp
  • szCommdlgHelp : ComDlg32.C
  • szCompReadStr : Data.c , IMEApps.h
  • szCompStr : Data.c , IMEApps.h
  • szConnectNetwork : Globals.h , Init.c
  • szConnectNode : Globals.h , Init.c
  • szConnectSocket : Globals.h , Init.c
  • szCRLF : msiloc.cpp
  • szCurlyBeg : msiloc.cpp
  • szCurlyEnd : msiloc.cpp
  • szCustFilterString : Open.h
  • szCustFiltInits : Open.h
  • szDebugEnvVar : setup.h
  • szDefaultInstallUpdCommandLine : setup.h
  • szDefaultMinPatchCommandLine : setup.h
  • szDefaultOperation : setup.h
  • szDefExt : Open.h
  • szDelayReboot : setup.h
  • szDelayRebootQuiet : setup.h
  • szDescription : secSvr.Cpp
  • szDeviceName : main.cpp
  • szDeviceOffset : Print.c
  • szDeviceType : main.cpp
  • szDlgTitle : Open.h
  • szDriverOffset : Print.c
  • szDtRegKey : Dt_Dll.Cpp
  • szEntryName : main.cpp
  • szErr : Service.C , Service.c
  • szExePathName : DebMain.c
  • szExpr : dballoc.h
  • szFaceName : Font.c
  • szFile : dballoc.h
  • szFileName : Open.h
  • szFileTitle : Open.h
  • szFilterInits : Open.h
  • szFilterString : Open.h
  • szFindWhat : Find.c
  • szFontStyle : Font.c
  • szFontTemplate : Font.c
  • szForceCodepage : msiloc.cpp
  • szHelpFileName : IconPRO.C
  • szHelpPathName : DebMain.c
  • szIgmpMode : parser.c
  • szIgmpType : parser.c
  • szImeAlpha : Status.c
  • szImeClose : Status.c
  • szImeCode : Status.c
  • szImeEUDC : Status.c
  • szImeFull : Status.c
  • szImeHalf : Status.c
  • szImeHanja : Status.c
  • szImeKatakana : Status.c
  • szImeNative : Status.c
  • szImeNoConv : Status.c
  • szImeNull : Status.c
  • szImeOpen : Status.c
  • szImeRoman : Status.c
  • szImeSoftKbd : Status.c
  • szImeSymbol : Status.c
  • szIniPathName : DebMain.c
  • szInitialClientAreaText : ClipText.c
  • szInitialDir : Open.h
  • szInsertStmt : quiktest.c
  • szInstall : msistuff.cpp
  • szInstallOperation : setup.h
  • szInstallUpd : msistuff.cpp
  • szInstallUpdOperation : setup.h
  • szLanguage : Settings.Cpp
  • szLastMessageBody : SendMDlg.h , MainFrm.Cpp
  • szLastMessageLabel : SendMDlg.h , MainFrm.Cpp
  • szLineFeed : msiloc.cpp
  • szListenSocket : Globals.h , Init.c
  • szLongFilter : CDTest.h
  • szMajPatch : msistuff.cpp
  • szMajPatchOperation : setup.h
  • szMinPatch : msistuff.cpp
  • szMinPatchOperation : setup.h
  • szmsgFILEOK : ComDlg32.C
  • szmsgSHAREVIOLATION : ComDlg32.C
  • szMsiBillboard : msiloc.cpp
  • szMsiBitmap : msiloc.cpp
  • szMsiCheckBox : msiloc.cpp
  • szMsiComboBox : msiloc.cpp
  • szMsiDirCombo : msiloc.cpp
  • szMsiDirList : msiloc.cpp
  • szMsiEdit : msiloc.cpp
  • szMsiGroupBox : msiloc.cpp
  • szMsiIcon : msiloc.cpp
  • szMsiLine : msiloc.cpp
  • szMsiList : msiloc.cpp
  • szMsiListBox : msiloc.cpp
  • szMsiMaskedEdit : msiloc.cpp
  • szMsiPathEdit : msiloc.cpp
  • szMsiProgressBar : msiloc.cpp
  • szMsiPushbutton : msiloc.cpp
  • szMsiRadioButton : msiloc.cpp
  • szMsiRadioButtonGroup : msiloc.cpp
  • szMsiScrollableText : msiloc.cpp
  • szMsiSelTree : msiloc.cpp
  • szMsiText : msiloc.cpp
  • szMsiVolSelCombo : msiloc.cpp
  • szMsiVolumeCostList : msiloc.cpp
  • szOutputOffset : Print.c
  • szPaintResult : IMEApps.h , Data.c
  • szPaintResultRead : IMEApps.h , Data.c
  • szParamName : quiktest.c
  • szPath : DebMain.c , Title.c
  • szPathSep : setup.h
  • szPhonebook : main.cpp
  • szPointerFilter : CDTest.h
  • szPrintDlg : Print.c
  • szPrintTempName : Print.c
  • szProgLog : adoisapi.cpp
  • szProto : parser.c
  • szProxy : FTPJr.cpp
  • szQuotes : msiloc.cpp
  • szRcvBuf : Globals.h
  • szReplaceWith : Find.c
  • szResultReadStr : Data.c , IMEApps.h
  • szResultStr : Data.c , IMEApps.h
  • szSdkDiff : findgoto.cpp , sdkdiff.cpp , sdkdiff.h
  • szServer : FTPJr.cpp
  • szServiceName : secSvr.Cpp
  • szSetupTempName : Print.c
  • szShortFilter : CDTest.h
  • szSndBuf : Globals.h
  • szSQL : CreateTable.cpp
  • szSteCandTitle : Global.C , FullIME.h
  • szSteCandUIClass : Global.C , FullIME.h
  • szSteClass : FullIME.h , Main.C , Global.C
  • szSteCompTitle : Global.C , FullIME.h
  • szSteTitle : Main.C , FullIME.h , Global.C
  • szTab : msiloc.cpp
  • szTemp : CDTest.h
  • szTemplate : Find.c
  • szTemplateNameC : Colors.c
  • szTempName : Open.h
  • szText : RendSam.Cpp
  • szTitle : TextFx.c , ViewDIB.c , INIT.c , GLOBALS.h , EventSink.cpp , IconPRO.C , Globals.h , StatList.c , Init.c , Title.c , halftone.c , LeakyBin.c , Generic.C
  • szTitlebuf : Mypal.c
  • szTokenSeps : msiloc.cpp
  • szUniChar : Settings.Cpp
  • szUrlPathSep : setup.h
  • szUserAccountServer : Admapit.c
  • szWindowClass : EventSink.cpp
  • szWndwHdrFile : msiloc.cpp
  • szwTempBuffer : RequestCert.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- t -

  • table_msgcode : sdkdiff.cpp
  • TAG_BUFFER_SIZE : HtmlScan.Hxx
  • TAILSIGN : spy.cpp
  • TAILSIZE : spy.cpp
  • tbButton : ToolBar.c
  • TEMP_BUFFER_SIZE : HtmlElem.Hxx
  • TempIpAddress : AdminDll.c
  • TestCases : custom.c
  • TEXT_FILTER_CHUNK_SIZE : SmpFilt.Hxx
  • textbuf : FullIME.h , Global.C , Main.C
  • theApp : VCExplore.Cpp , Imp_Draw.Cpp , MqApiTst.Cpp , Client.Cpp , mqfdraw.cpp , RTCIncoming.cpp , Client.h , RTCOutgoing.cpp , genericucp.cpp , advcgen.cpp , isapiCertPolicy.cpp , AdvClient.cpp , cwinapp.cpp , CmdLineConsumer.Cpp , PermEvents.Cpp , API.Cpp , File Share SampleEx.cpp , ClipBook ServerEx.cpp , multichan.cpp , WbemClient.Cpp , CapMFC.Cpp , SCPCMenu.cpp , XMLTree.cpp , SCPProppage.cpp , SCPWizard.cpp , userproppage.cpp , userwizard.cpp , ADsFirstExt.cpp , ADQI.cpp , PrintSdi.Cpp , DisDraw.Cpp
  • theFilter : isapiCertPolicy.cpp
  • theLocalServer : DialIn.c
  • ThisDLLHandle : DllInit.c
  • Throughput : PrPerf.c
  • Time : Client.C
  • TlsIndex : AsyncIO.h
  • tmStatusFont : Status.c
  • tmToolFont : Tools.c
  • tokCaption : msiloc.cpp
  • toolCtrl : Tools.c
  • TPG_SUBPATH : RecoDll.cpp
  • TraceGuidReg : TraceDp.c
  • TraceOnFlag : TraceDp.c
  • TrackDifferent : sdkdiff.h , sdkdiff.cpp
  • TrackLeftOnly : sdkdiff.h , sdkdiff.cpp
  • TrackReadonly : sdkdiff.h , sdkdiff.cpp
  • TrackRightOnly : sdkdiff.cpp , sdkdiff.h
  • TrackSame : sdkdiff.cpp , sdkdiff.h
  • TransactionGuid : TraceDp.c
  • transferClip : suminfo.h
  • TRANSLATED_CHAR_BUFFER_LENGTH : InpStrm.Hxx
  • tServerThread : filerepclientproc.cpp
  • tsval : quiktest.c
  • TYPID_HtmlPropIFilter : HtmlProp.Cxx
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- u -

  • uDriverODBCVer : quiktest.c
  • udw : quiktest.h
  • uiDesc : custom.c
  • uiName : custom.c
  • UINT : OleStd.h
  • uLine : dballoc.h
  • ulInfoBufferSize : PerfUtil.c
  • ulSize : OleStd.h
  • uMode : Title.c , CDTest.c , Colors.c , Find.c , Print.c , Font.c , Open.c
  • uMsgBrowse : ole2ui.c
  • uMsgChangeIcon : ole2ui.c
  • uMsgCloseBusyDlg : ole2ui.c
  • uMsgEndDialog : ole2ui.c
  • uMsgFileOKString : ole2ui.c
  • uMsgHelp : ole2ui.c
  • UNHANDLED_MSG : common.h , winmain.h
  • URL : news.Idl
  • UserMarshalRoutines : ADsError_p.c
  • uw : quiktest.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- v -

  • vclassfactory : OleImp.Cpp , OleApt.Cpp
  • VCName : SessionDlg.Cpp
  • vCtype : APP.Cxx
  • vEndCount : Grid.Cxx
  • ver : UnBufCp1.c , UnBufCp2.c
  • Verbose : AsyncIO.h
  • verbose : GssServer.c
  • Version : sdkdiff.cpp
  • version : Globals.h , Main.c
  • vfRemote : ComPerf.Cpp
  • vfServer : OleApt.Cpp , ComPerf.Cpp , OleImp.Cpp
  • vhEventCliDone : ComPerf.Cpp
  • vhEventCliStart : ComPerf.Cpp
  • vhEventServer : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • vhrThreadStatus : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • vhwndMain : OleImp.Cpp , OleApt.Cpp
  • viNextThread : ComPerf.Cpp , OleApt.Cpp
  • vpCSet : Grid.Cxx
  • VPSid : AuthzSvr.c
  • VPSidBuf : AuthzSvr.c
  • vpstmMarshalling : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • vpunkService : OleApt.Cpp
  • vrgcObjects : OleImp.Cpp , OleApt.Cpp
  • vrghEvent : ComPerf.Cpp , OleApt.Cpp , OleImp.Cpp
  • vrghThread : ComPerf.Cpp , OleImp.Cpp , OleApt.Cpp
  • vrgperfloc : ComPerf.Cpp
  • vrgperfrmt : ComPerf.Cpp
  • vrgpSid : OleImp.Cpp
  • vrgpszAptUser : OleImp.Cpp
  • vrgtid : OleImp.Cpp , OleApt.Cpp , ComPerf.Cpp
  • vSegCount : Grid.Cxx
  • vStartCount : Grid.Cxx
  • vtcfNo : suminfo.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- w -

  • wAuxUserType : OleStd.h
  • wBufSize : Title.c
  • wFullUserName : security.cpp
  • wLibDataSeg : gutils.cpp
  • wNameSpace : security.cpp
  • wPassWord : security.cpp
  • wPath : security.cpp
  • WritePort : UnBufCp2.c
  • wServerName : security.cpp
  • wsz_ASK_DROP_TABLE_ : common.cpp , common.h
  • wsz_BOGUS_WHERE : common.cpp , common.h
  • wsz_CANCEL : common.cpp , common.h
  • wsz_CANCEL_OP : common.cpp , common.h
  • wsz_COMMA : common.cpp , common.h
  • wsz_CONNECT_STRING_ : common.cpp , common.h
  • wsz_COPIED_RECORDS : common.cpp , common.h
  • wsz_COPY_FAILURE : common.cpp , common.h
  • wsz_COPY_SUCCESS : common.cpp , common.h
  • wsz_COPYING : common.cpp , common.h
  • wsz_CREATE_INDEX_ : common.cpp , common.h
  • wsz_CREATE_TABLE : common.cpp , common.h
  • wsz_DROP_TABLE_ : common.cpp , common.h
  • wsz_ERROR : common.cpp , common.h , common.cpp , common.h
  • wsz_ERRORINFO : common.cpp , common.h , common.cpp , common.h
  • wsz_EXCEPTION : common.cpp , common.h
  • wsz_FROM : common.cpp , common.h
  • wsz_FROMQUALTABLE_ : common.cpp , common.h
  • wsz_FROMTABLEHELP_ : common.cpp , common.h
  • wsz_INDEX_DESC : common.cpp , common.h
  • wsz_INDEX_FAILED_ : common.cpp , common.h
  • wsz_INFO : common.cpp , common.h , common.cpp , common.h
  • wsz_INSERT_INTO : common.cpp , common.h
  • wsz_INVALID_VALUE_ : common.cpp , common.h , common.cpp
  • wsz_LPAREN : common.cpp , common.h
  • wsz_NO_TYPE_FOUND_ : common.cpp , common.h
  • wsz_NO_TYPE_MATCH_ : common.cpp , common.h
  • wsz_NOT_CONNECTED : common.cpp , common.h
  • wsz_OLEDB : common.cpp , common.h
  • wsz_PARAM : common.cpp , common.h
  • wsz_PERIOD : common.h , common.cpp
  • wsz_PRIMARY_KEY : common.cpp , common.h
  • wsz_PROVIDER_INFO_ : common.h , common.cpp
  • wsz_READONLY_DATASOURCE_ : common.cpp , common.h
  • wsz_RPAREN : common.cpp , common.h
  • wsz_SAME_TABLE_NAME : common.cpp , common.h
  • wsz_SELECT : common.cpp , common.h
  • wsz_SHOW_SQL_ : common.cpp , common.h
  • wsz_SPACE : common.h , common.cpp
  • wsz_SUCCESS : common.cpp , common.h , common.cpp , common.h
  • wsz_TOTABLEHELP_ : common.cpp , common.h
  • wsz_TYPEMAPPING_FAILURE : common.cpp , common.h
  • wsz_TYPES_STRING_ : common.h , common.cpp
  • wsz_UNIQUE_INDEX : common.h , common.cpp
  • wsz_VALUES_CLAUSE : common.h , common.cpp
  • wsz_WARNING : common.cpp , common.h , common.cpp , common.h
  • wszCLSIDDescription : DllMain.Cpp
  • wszMachineName : DirEncrypt.Cpp
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- x -

  • X : Demo.c , Cursor.c
  • x : SCPProppage.cpp , SCPWizard.cpp , SCPCMenu.cpp , userproppage.cpp , userwizard.cpp
  • X86INT3 : Utils.c
  • xCurrent : Tools.c
  • XP_LEFT : ui.cpp , Global.h
  • xPos : FullIME.h , Main.C , Global.C
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- y -

  • Y : Demo.c , Cursor.c
  • YP_TOP : ui.cpp , Global.h
  • yPos : Global.C , Main.C , FullIME.h
  • yr : suminfo.h
Generated on Wed Nov 13 2024 16:58:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Main Page

WinXP-Examples Documentation

End-User License Agreement

Introduction

This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and SIEMA ("Licensor") for the use of SIEMA-REFERENCE ("Software"). This EULA governs your use of the Software provided by the Licensor. By installing or using the Software, you agree to be bound by the terms of this EULA.

License Grant

Licensor grants you a revocable, non-exclusive, non-transferable, limited license to download, install, and use the Software solely for your personal or commercial purposes strictly in accordance with the terms of this Agreement.

Restrictions on Use

You agree not to, and you will not permit others to:

  • Modify, or create derivative works of the Software;
  • Distribute, transfer, sublicense, lease, lend, or rent the Software to any third party;
  • Reverse engineer, decompile or disassemble the Software, except to the extent expressly permitted by applicable law;
  • Remove, alter, or obscure any proprietary notices on the Software;
  • Use the Software in any manner that could damage, disable, overburden, or impair the Software;
  • Use the Software to create or distribute any malicious software or for any unlawful purpose.

Related Agreements

By agreeing to this EULA, you also agree to comply with the terms of Terms and Conditions, Privacy Policy, and any other agreements incorporated herein by reference.

Jurisdiction

This EULA and any disputes arising out of or in connection with it will be governed by and construed in accordance with the laws of Switzerland, without regard to its conflict of laws principles. Any legal actions or proceedings arising out of this EULA shall be brought exclusively in the courts of Switzerland.Intellectual Property & Copyright Infringement

The Software and all rights, title, and interest in and to the Software, including all intellectual property rights therein, are and will remain the exclusive property of the Licensor. You agree to notify the Licensor promptly if you become aware of any infringement of the Licensor’s intellectual property rights in the Software.Termination of Licensing

Licensor may terminate this EULA at any time if you fail to comply with any term(s) of this Agreement. Upon termination, you must cease all use of the Software and destroy all copies, full or partial, of the Software.

Warranty Disclaimer

THE SOFTWARE IS PROVIDED "AS IS". LICENSOR MAKES NO WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. YOU BEAR THE ENTIRE RISK AS TO SELECTING THE SOFTWARE FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE.

Limitations of Liability

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY, OR ANY LOSS OF DATA, USE, GOODWILL, OR OTHER INTANGIBLE LOSSES, RESULTING FROM:

  1. YOUR USE OR INABILITY TO USE THE SOFTWARE;
  2. ANY UNAUTHORIZED ACCESS TO OR USE OF OUR SERVERS AND/OR ANY PERSONAL INFORMATION STORED THEREIN;
  3. ANY INTERRUPTION OR CESSATION OF TRANSMISSION TO OR FROM THE SOFTWARE;
  4. ANY ERRORS OR OMISSIONS IN ANY CONTENT OR FOR ANY LOSS OR DAMAGE INCURRED AS A RESULT OF YOUR USE OF ANY CONTENT POSTED, EMAILED, TRANSMITTED, OR OTHERWISE MADE AVAILABLE THROUGH THE SOFTWARE;
  5. THE DEFAMATORY, OFFENSIVE, OR ILLEGAL CONDUCT OF ANY THIRD PARTY.

Business Contact Information

If you have any questions about this EULA, please contact us at:

Siema
siema.switzerland@gmail.com

By installing or using the Software, you acknowledge that you have read this Agreement, understand it, and agree to be bound by its terms and conditions.

Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • ApplicationMode : InkClipboard , InkHitTest , InkErase
  • DIMMINGSERVICE_SCPD_DISPIDS : SDKDimmerServiceLib , MYDEVICELib
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • DISPID_DIMLEVEL : SDKDimmerServiceLib , MYDEVICELib
  • DISPID_GETCONFIGDETAILS : MYDEVICELib , SDKDimmerServiceLib
  • DISPID_GETDIMLEVEL : SDKDimmerServiceLib , MYDEVICELib
  • DISPID_GETPOWERVALUE : MYDEVICELib , SDKDimmerServiceLib
  • DISPID_POWER : SDKDimmerServiceLib , MYDEVICELib
  • DISPID_POWEROFF : SDKDimmerServiceLib , MYDEVICELib
  • DISPID_POWERON : SDKDimmerServiceLib , MYDEVICELib
  • DISPID_SETDIMLEVEL : SDKDimmerServiceLib , MYDEVICELib
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • c
  • d
  • f
  • g
  • i
  • r
  • s
  • w

- c -

  • CertEnumSystemStoreCallback() : storesh

- d -

  • DefaultProgressCallback() : WiaWrap

- f -

  • FillBitmapFileHeader() : BitmapUtil
  • FixBitmapHeight() : BitmapUtil

- g -

  • GetBitmapDimensions() : BitmapUtil
  • GetBitmapHeaderSize() : BitmapUtil
  • GetBitmapLineWidthInBytes() : BitmapUtil
  • GetBitmapOffsetBits() : BitmapUtil
  • GetBitmapSize() : BitmapUtil

- i -

  • importlib() : COMSPYAUDITLib , MyStorageResourceLib , CLUADMEXLib , MGDRESOURCELib , BANKVCLib , RENDERLib , EDHOSTLib , EDGLYPHSLib , EDCOMMANDSLib , EDANNOTATORLib , BROCHUREMACHINELib , ATLCONTROLLib , CERTPOLICYSAMPLELib , CERTEXITSAMPLELib , MYDEVICELib , CallbackIUnknownLib , SDKDimmerServiceLib , PLGTRMSMPLib , ADSERRORLib , ADSFIRSTEXTLib , SDKSAMPLEPLAYLISTPLUGINLib , CONTEXTSAMPLEPROPPAGELib , CONTEXTPLUGINLib , SDKSAMPLESTORAGEPLUGINLib , PROXYPLUGINLib , DBAUTHPLUGINLib , AUTHENTICATEPLUGINLib , MSDFMAPLib , MSDFHDL , THEPROVIDERLib , ACCOUNT , Async_Lib , COMSPYCTLLib , COMSPYAUDITLib

- r -

  • ReadPropertyGuid() : WiaWrap
  • ReadPropertyLong() : WiaWrap

- s -

  • STDMETHODIMP_() : WiaWrap

- w -

  • WiaGetImage() : WiaWrap
  • WiaGetNumDevices() : WiaWrap
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • DIMMINGSERVICE_SCPD_DISPIDS : SDKDimmerServiceLib , MYDEVICELib
  • PFNPROGRESSCALLBACK : WiaWrap
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • Simple

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120     MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122     // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal) {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProcessDlg Member List

This is the complete list of members for CProcessDlg, including all inherited members.
count | CProcessDlg | [private]
CProcessDlg(CWnd *pParent=NULL) | CProcessDlg |
DoDataExchange(CDataExchange *pDX) | CProcessDlg | [protected, virtual]
IDD enum value | CProcessDlg |
m_processList | CProcessDlg |
m_serverName | CProcessDlg |
OnCancel() | CProcessDlg | [protected, virtual]
OnInitDialog() | CProcessDlg | [protected, virtual]
OnRefresh() | CProcessDlg | [protected]
OnTerminateProcess() | CProcessDlg | [protected]
pProcessInfo | CProcessDlg |
Refresh() | CProcessDlg | [protected]
serverHandle | CProcessDlg | [private]
serverName | CProcessDlg | [private]
Generated on Wed Nov 13 2024 16:57:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/getrec.h Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

getrec.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GetRec.h
00003   Summary:   Header for Object Pooled Get Receipt component
00004   Classes:   CGetReceipt
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #if !defined(AFX_GETRECEIPT_H__A81260B3_DDC8_11D0_B5A0_00C04FB957D8__INCLUDED_)
00023 #define AFX_GETRECEIPT_H__A81260B3_DDC8_11D0_B5A0_00C04FB957D8__INCLUDED_
00024
00025
00026 #include "resource.h"       // main symbols
00027
00028 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00029 Class:  CGetReceipt
00030 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00031
00032 class CGetReceipt :
00033   public CComDualImpl<IGetReceipt, &IID_IGetReceipt, &LIBID_ACCOUNT>,
00034   public ISupportErrorInfo,
00035   public CComObjectRoot,
00036   public CComCoClass<CGetReceipt,&CLSID_CGetReceipt>
00037 {
00038 public:
00039   CGetReceipt() {}
00040 BEGIN_COM_MAP(CGetReceipt)
00041   COM_INTERFACE_ENTRY(IDispatch)
00042   COM_INTERFACE_ENTRY(IGetReceipt)
00043   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00044 END_COM_MAP()
00045
00046 DECLARE_REGISTRY_RESOURCEID(IDR_GetReceipt)
00047
00048 // ISupportsErrorInfo
00049   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00050
00051 // IGetReceipt
00052 public:
00053   STDMETHOD (GetNextReceipt) (OUT long* plReceiptNo);
00054 };
00055
00056 #endif // !defined(AFX_GETRECEIPT_H__A81260B3_DDC8_11D0_B5A0_00C04FB957D8__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/about.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

about.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Implementation of ISnapinAbout
00014 //
00015
00016
00017 #include "Globals.h"
00018 #include "About.h"
00019 #include "Resource.h"
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 //  Construction/Destruction
00023
00024 //---------------------------------------------------------------------------
00025 CSnapinAbout::CSnapinAbout()
00026 {
00027   m_cRef = 0;
00028   InterlockedIncrement((long*)&g_uObjectCount);
00029
00030   m_hSmallImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00031   m_hLargeImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_32), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00032
00033   // This image is displayed when the static node is selected
00034   m_hOpenImage  = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00035
00036   m_hAppIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_APP_ICON));
00037 }
00038
00039 CSnapinAbout::~CSnapinAbout()
00040 {
00041   SAFE_FREE_BITMAP( m_hSmallImage );
00042   SAFE_FREE_BITMAP( m_hLargeImage );
00043   SAFE_FREE_BITMAP( m_hOpenImage  );
00044   SAFE_FREE_ICON( m_hAppIcon );
00045
00046   InterlockedDecrement((long*)&g_uObjectCount);
00047 }
00048
00049 /////////////////////////////////////////////////////////////////////////////
00050 // IUnknown implementation
00051
00052 //---------------------------------------------------------------------------
00053 STDMETHODIMP CSnapinAbout::QueryInterface
00054 (
00055   REFIID   riid,       //[in] Identifier of the requested interface
00056   LPVOID   *ppv        //[out] Address of requested interface
00057 )
00058 {
00059   if( !ppv )
00060     return E_FAIL;
00061
00062   *ppv = NULL;
00063
00064   if( IsEqualIID(riid, IID_IUnknown) )
00065     *ppv = static_cast<ISnapinAbout*>(this);
00066   else if( IsEqualIID(riid, IID_ISnapinAbout) )
00067     *ppv = static_cast<ISnapinAbout*>(this);
00068
00069   if( *ppv )
00070   {
00071     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00072     return S_OK;
00073   }
00074
00075   return E_NOINTERFACE;
00076 }
00077
00078 //---------------------------------------------------------------------------
00079 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00080 {
00081   return InterlockedIncrement((long*)&m_cRef);
00082 }
00083
00084 //---------------------------------------------------------------------------
00085 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00086 {
00087   if( 0 == InterlockedDecrement((long*)&m_cRef) )
00088   {
00089     // we need to decrement our object count in the DLL
00090     delete this;
00091     return 0;
00092   }
00093   return m_cRef;
00094 }
00095
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // Interface ISnapinAbout
00099
00100 //---------------------------------------------------------------------------
00101 STDMETHODIMP CSnapinAbout::GetSnapinDescription
00102 (
00103   LPOLESTR* pszDescription   //[out] Pointer to the description text
00104 )
00105 {
00106   SIZE_T nLen = wcslen( gwszABOUT_DESCRIPTION ) + 1;
00107   *pszDescription = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00108   if( NULL == *pszDescription )
00109     return E_OUTOFMEMORY;
00110
00111   wcscpy( *pszDescription, gwszABOUT_DESCRIPTION );
00112   return S_OK;
00113 }
00114
00115 //---------------------------------------------------------------------------
00116 STDMETHODIMP CSnapinAbout::GetProvider
00117 (
00118   LPOLESTR* pszProvider      //[out] Pointer to provider text
00119 )
00120 {
00121   SIZE_T nLen = wcslen( gwszABOUT_PROVIDER ) + 1;
00122   *pszProvider = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00123   if( NULL == *pszProvider )
00124     return E_OUTOFMEMORY;
00125
00126   wcscpy( *pszProvider, gwszABOUT_PROVIDER );
00127   return S_OK;
00128 }
00129
00130 //---------------------------------------------------------------------------
00131 STDMETHODIMP CSnapinAbout::GetSnapinVersion
00132 (
00133   LPOLESTR*  pszVersion      //[out] Pointer to version text
00134 )
00135 {
00136   SIZE_T nLen = wcslen( gwszABOUT_VERSION ) + 1;
00137   *pszVersion = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00138   if( NULL == *pszVersion )
00139     return E_OUTOFMEMORY;
00140
00141   wcscpy( *pszVersion, gwszABOUT_VERSION );
00142   return S_OK;
00143 }
00144
00145 //---------------------------------------------------------------------------
00146 STDMETHODIMP CSnapinAbout::GetSnapinImage
00147 (
00148   HICON *hAppIcon            //[out] Pointer to the Snap-in's main icon
00149 )
00150 {
00151   *hAppIcon = m_hAppIcon;
00152   HRESULT hResult = S_FALSE;
00153   (NULL == *hAppIcon ) ? hResult = E_FAIL : hResult = S_OK;
00154
00155   return hResult;
00156 }
00157
00158 //---------------------------------------------------------------------------
00159 STDMETHODIMP CSnapinAbout::GetStaticFolderImage
00160 (
00161   HBITMAP*   hSmallImage,      //[out] Pointer to small image
00162   HBITMAP*   hOpenImage,       //[out] Pointer to open folder image
00163   HBITMAP*   hLargeImage,      //[out] Pointer to large image
00164   COLORREF*  cMask             //[out] Pointer to image color mask
00165 )
00166 {
00167   *hSmallImage = m_hSmallImage;
00168   *hLargeImage = m_hLargeImage;
00169   *hOpenImage  = m_hOpenImage;
00170   *cMask       = RGB(0, 255, 0);
00171
00172   if( NULL == *hSmallImage || NULL == *hLargeImage || NULL == *hOpenImage )
00173     return E_FAIL;
00174
00175   return S_OK;
00176 }
00177
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/StructuredStorage/Propsets/propdump.cpp Source File

  • Com
  • StructuredStorage
  • Propsets

propdump.cpp

Go to the documentation of this file.
00001
00002 //+============================================================================
00003 //
00004 //  Sample:     PropDump.cpp
00005 //
00006 //  To Build:   cl /GX enumall.cpp
00007 //
00008 //  This sample is a program which dumps all the properties in all property
00009 //  sets of a storage file.
00010 //
00011 //+============================================================================
00012
00013
00014 #define UNICODE
00015 #define _UNICODE
00016
00017 #include <stdio.h>
00018 #include <windows.h>
00019
00020 #pragma comment( lib, "ole32.lib" )
00021
00022 //+----------------------------------------------------------------------------
00023 //
00024 //  ConvertVarTypeToString
00025 //
00026 //  Generate a string for a given PROPVARIANT variable type (VT).
00027 //  For the given vt, write the string to pwszType, which is a buffer of
00028 //  size cchType characters.
00029 //
00030 //+----------------------------------------------------------------------------
00031
00032 void
00033 ConvertVarTypeToString( VARTYPE vt, WCHAR *pwszType, ULONG cchType )
00034 {
00035     const WCHAR *pwszModifier;
00036
00037     // Make sure the output string will be terminated
00038     // (wcsncpy doesn't guarantee termination)
00039
00040     pwszType[ cchType-1 ] = L'\0';
00041     --cchType;
00042
00043     // Stringize the basic type
00044
00045     switch( vt & VT_TYPEMASK )
00046     {
00047     case VT_EMPTY:
00048         wcsncpy( pwszType, L"VT_EMPTY", cchType );
00049         break;
00050     case VT_NULL:
00051         wcsncpy( pwszType, L"VT_NULL", cchType );
00052         break;
00053     case VT_I2:
00054         wcsncpy( pwszType, L"VT_I2", cchType );
00055         break;
00056     case VT_I4:
00057         wcsncpy( pwszType, L"VT_I4", cchType );
00058         break;
00059     case VT_I8:
00060         wcsncpy( pwszType, L"VT_I8", cchType );
00061         break;
00062     case VT_UI2:
00063         wcsncpy( pwszType, L"VT_UI2", cchType );
00064         break;
00065     case VT_UI4:
00066         wcsncpy( pwszType, L"VT_UI4", cchType );
00067         break;
00068     case VT_UI8:
00069         wcsncpy( pwszType, L"VT_UI8", cchType );
00070         break;
00071     case VT_R4:
00072         wcsncpy( pwszType, L"VT_R4", cchType );
00073         break;
00074     case VT_R8:
00075         wcsncpy( pwszType, L"VT_R8", cchType );
00076         break;
00077     case VT_CY:
00078         wcsncpy( pwszType, L"VT_CY", cchType );
00079         break;
00080     case VT_DATE:
00081         wcsncpy( pwszType, L"VT_DATE", cchType );
00082         break;
00083     case VT_BSTR:
00084         wcsncpy( pwszType, L"VT_BSTR", cchType );
00085         break;
00086     case VT_ERROR:
00087         wcsncpy( pwszType, L"VT_ERROR", cchType );
00088         break;
00089     case VT_BOOL:
00090         wcsncpy( pwszType, L"VT_BOOL", cchType );
00091         break;
00092     case VT_VARIANT:
00093         wcsncpy( pwszType, L"VT_VARIANT", cchType );
00094         break;
00095     case VT_DECIMAL:
00096         wcsncpy( pwszType, L"VT_DECIMAL", cchType );
00097         break;
00098     case VT_I1:
00099         wcsncpy( pwszType, L"VT_I1", cchType );
00100         break;
00101     case VT_UI1:
00102         wcsncpy( pwszType, L"VT_UI1", cchType );
00103         break;
00104     case VT_INT:
00105         wcsncpy( pwszType, L"VT_INT", cchType );
00106         break;
00107     case VT_UINT:
00108         wcsncpy( pwszType, L"VT_UINT", cchType );
00109         break;
00110     case VT_VOID:
00111         wcsncpy( pwszType, L"VT_VOID", cchType );
00112         break;
00113     case VT_SAFEARRAY:
00114         wcsncpy( pwszType, L"VT_SAFEARRAY", cchType );
00115         break;
00116     case VT_USERDEFINED:
00117         wcsncpy( pwszType, L"VT_USERDEFINED", cchType );
00118         break;
00119     case VT_LPSTR:
00120         wcsncpy( pwszType, L"VT_LPSTR", cchType );
00121         break;
00122     case VT_LPWSTR:
00123         wcsncpy( pwszType, L"VT_LPWSTR", cchType );
00124         break;
00125     case VT_RECORD:
00126         wcsncpy( pwszType, L"VT_RECORD", cchType );
00127         break;
00128     case VT_FILETIME:
00129         wcsncpy( pwszType, L"VT_FILETIME", cchType );
00130         break;
00131     case VT_BLOB:
00132         wcsncpy( pwszType, L"VT_BLOB", cchType );
00133         break;
00134     case VT_STREAM:
00135         wcsncpy( pwszType, L"VT_STREAM", cchType );
00136         break;
00137     case VT_STORAGE:
00138         wcsncpy( pwszType, L"VT_STORAGE", cchType );
00139         break;
00140     case VT_STREAMED_OBJECT:
00141         wcsncpy( pwszType, L"VT_STREAMED_OBJECT", cchType );
00142         break;
00143     case VT_STORED_OBJECT:
00144         wcsncpy( pwszType, L"VT_BLOB_OBJECT", cchType );
00145         break;
00146     case VT_CF:
00147         wcsncpy( pwszType, L"VT_CF", cchType );
00148         break;
00149     case VT_CLSID:
00150         wcsncpy( pwszType, L"VT_CLSID", cchType );
00151         break;
00152     default:
00153         _snwprintf( pwszType, cchType, L"Unknown (%d)", vt & VT_TYPEMASK );
00154         break;
00155     }
00156
00157     // Adjust cchType for the characters we just added
00158
00159     cchType -= wcslen(pwszType);
00160
00161     // Add the type modifiers if present
00162
00163     if( vt & VT_VECTOR )
00164     {
00165         pwszModifier = L" | VT_VECTOR";
00166         wcsncat( pwszType, pwszModifier, cchType );
00167         cchType -= wcslen( pwszModifier );
00168     }
00169
00170     if( vt & VT_ARRAY )
00171     {
00172         pwszModifier = L" | VT_ARRAY";
00173         wcsncat( pwszType, pwszModifier, cchType );
00174         cchType -= wcslen( pwszModifier );
00175     }
00176
00177     if( vt & VT_RESERVED )
00178     {
00179         pwszModifier = L" | VT_RESERVED";
00180         wcsncat( pwszType, pwszModifier, cchType );
00181         cchType -= wcslen( pwszModifier );
00182     }
00183
00184 }
00185
00186
00187 //+----------------------------------------------------------------------------
00188 //
00189 //  ConvertValueToString
00190 //
00191 //  Generate a string for the value in a given PROPVARIANT structure.
00192 //  The most common types are supported (that is, those that can be displayed
00193 //  with printf).  For other types, only an ellipses "..." is displayed.
00194 //
00195 //  The property to string-ize is in propvar, the resulting string goes
00196 //  into pwszValue, which is a buffer with room for cchValue characters
00197 //  (including the string terminator).
00198 //
00199 //+----------------------------------------------------------------------------
00200
00201 void
00202 ConvertValueToString( const PROPVARIANT &propvar,
00203                       WCHAR *pwszValue,
00204                       ULONG cchValue )
00205 {
00206     // Make sure the output string will be terminated
00207
00208     pwszValue[ cchValue - 1 ] = L'\0';
00209     --cchValue;
00210
00211     // Based on the type, put the value into pwszValue as a string.
00212
00213     switch( propvar.vt )
00214     {
00215     case VT_EMPTY:
00216         wcsncpy( pwszValue, L"", cchValue );
00217         break;
00218     case VT_NULL:
00219         wcsncpy( pwszValue, L"", cchValue );
00220         break;
00221     case VT_I2:
00222         _snwprintf( pwszValue, cchValue, L"%i", propvar.iVal );
00223         break;
00224     case VT_I4:
00225     case VT_INT:
00226         _snwprintf( pwszValue, cchValue, L"%li", propvar.lVal );
00227         break;
00228     case VT_I8:
00229         _snwprintf( pwszValue, cchValue, L"%I64i", propvar.hVal );
00230         break;
00231     case VT_UI2:
00232         _snwprintf ( pwszValue, cchValue, L"%u", propvar.uiVal );
00233         break;
00234     case VT_UI4:
00235     case VT_UINT:
00236         _snwprintf ( pwszValue, cchValue, L"%lu", propvar.ulVal );
00237         break;
00238     case VT_UI8:
00239         _snwprintf ( pwszValue, cchValue, L"%I64u", propvar.uhVal );
00240         break;
00241     case VT_R4:
00242         _snwprintf ( pwszValue, cchValue, L"%f", propvar.fltVal );
00243         break;
00244     case VT_R8:
00245         _snwprintf ( pwszValue, cchValue, L"%lf", propvar.dblVal );
00246         break;
00247     case VT_BSTR:
00248         _snwprintf ( pwszValue, cchValue, L"\"%s\"", propvar.bstrVal );
00249         break;
00250     case VT_ERROR:
00251         _snwprintf ( pwszValue, cchValue, L"0x%08X", propvar.scode );
00252         break;
00253     case VT_BOOL:
00254         _snwprintf ( pwszValue, cchValue, L"%s",
00255                      VARIANT_TRUE == propvar.boolVal ? L"True" : L"False" );
00256         break;
00257     case VT_I1:
00258         _snwprintf ( pwszValue, cchValue, L"%i", propvar.cVal );
00259         break;
00260     case VT_UI1:
00261         _snwprintf ( pwszValue, cchValue, L"%u", propvar.bVal );
00262         break;
00263     case VT_VOID:
00264         wcsncpy( pwszValue, L"", cchValue );
00265         break;
00266     case VT_LPSTR:
00267         if( 0 >_snwprintf ( pwszValue, cchValue, L"\"%hs\"", propvar.pszVal ))
00268             // String is too big for pwszValue
00269             wcsncpy( pwszValue, L"...", cchValue );
00270         break;
00271     case VT_LPWSTR:
00272         if( 0 > _snwprintf ( pwszValue, cchValue, L"\"%s\"", propvar.pwszVal ))
00273             // String is too big for pwszValue
00274             wcsncpy( pwszValue, L"...", cchValue );
00275         break;
00276     case VT_FILETIME:
00277         _snwprintf ( pwszValue, cchValue, L"%08x:%08x",
00278                      propvar.filetime.dwHighDateTime,
00279                      propvar.filetime.dwLowDateTime );
00280         break;
00281     case VT_CLSID:
00282         pwszValue[0] = L'\0';
00283         StringFromGUID2( *propvar.puuid, pwszValue, cchValue );
00284         break;
00285     default:
00286         wcsncpy( pwszValue, L"...", cchValue );
00287         break;
00288     }
00289
00290 }
00291
00292
00293 //+----------------------------------------------------------------------------
00294 //
00295 //  DisplayProperty
00296 //
00297 //  Dump the ID, name, type, and value of a property.
00298 //
00299 //+----------------------------------------------------------------------------
00300
00301 void
00302 DisplayProperty( const PROPVARIANT &propvar, const STATPROPSTG &statpropstg )
00303 {
00304     WCHAR wsz[ MAX_PATH + 1 ];
00305
00306     ConvertVarTypeToString( statpropstg.vt, wsz, sizeof(wsz)/sizeof(wsz[0]) );
00307
00308     wprintf( L"   ----------------------------------------------------\n"
00309              L"   PropID = %-5d VarType = %-23s",
00310              statpropstg.propid, wsz );
00311
00312     if( NULL != statpropstg.lpwstrName )
00313         wprintf( L" Name = %s", statpropstg.lpwstrName );
00314
00315     ConvertValueToString( propvar, wsz, sizeof(wsz)/sizeof(wsz[0]) );
00316
00317     wprintf( L"\n   Value = %s\n", wsz );
00318
00319 }
00320
00321
00322 //+----------------------------------------------------------------------------
00323 //
00324 //  DisplayPropertySet
00325 //
00326 //  Dump all the properties into a given property set.
00327 //
00328 //+----------------------------------------------------------------------------
00329
00330 void
00331 DisplayPropertySet( FMTID fmtid,
00332                     const WCHAR *pwszStorageName,
00333                     IPropertyStorage *pPropStg )
00334 {
00335     IEnumSTATPROPSTG *penum = NULL;
00336     HRESULT hr = S_OK;
00337     STATPROPSTG statpropstg;
00338     PROPVARIANT propvar;
00339     PROPSPEC propspec;
00340     PROPID propid;
00341     WCHAR *pwszFriendlyName = NULL;
00342
00343     // This string will hold a string-ized FMTID.  It needs
00344     // to be 38 characters, plus the terminator
00345     // character.  But just to be safe we'll make
00346     // it a little bigger.
00347     WCHAR wszFMTID[ 64 ] = { L"" };
00348
00349     PropVariantInit( &propvar );
00350     memset( &statpropstg, 0, sizeof(statpropstg) );
00351
00352     try
00353     {
00354         // Display the ID of the property set
00355
00356         StringFromGUID2( fmtid,
00357                          wszFMTID,
00358                          sizeof(wszFMTID)/sizeof(wszFMTID[0]) );
00359         wprintf( L"\n Property Set %s\n", wszFMTID );
00360
00361         // If this is one of common property sets, show which one.
00362
00363         if( FMTID_SummaryInformation == fmtid )
00364             wprintf( L"   (SummaryInformation property set)\n" );
00365         else if( FMTID_DocSummaryInformation == fmtid )
00366             wprintf( L"   (DocumentSummaryInformation property set)\n" );
00367         else if( FMTID_UserDefinedProperties == fmtid )
00368             wprintf( L"   (UserDefined property set)\n" );
00369
00370         // Also display the name of the storage that contains
00371         // this property set
00372
00373         wprintf( L"   in \"%s\":\n", pwszStorageName );
00374
00375         // If this property set has a friendly name, display it now.
00376         // (Property names are stored in the special dictionary
00377         // property - the name of the property set is indicated by naming
00378         // the dictionary property itself.)
00379
00380         propid = PID_DICTIONARY;
00381         pwszFriendlyName = NULL;
00382
00383         hr = pPropStg->ReadPropertyNames( 1, &propid, &pwszFriendlyName );
00384         if( S_OK == hr )
00385         {
00386             wprintf( L"   (Friendly name is \"%s\")\n\n", pwszFriendlyName );
00387             CoTaskMemFree( pwszFriendlyName );
00388             pwszFriendlyName = NULL;
00389         }
00390         else
00391             wprintf( L"\n" );
00392
00393         // Get a property enumerator
00394
00395         hr = pPropStg->Enum( &penum );
00396         if( FAILED(hr) ) throw L"Failed IPropertyStorage::Enum";
00397
00398         // Get the first property in the enumeration
00399
00400         hr = penum->Next( 1, &statpropstg, NULL );
00401
00402         // Loop through and display each property.  The ‘Next'
00403         // call above (and at the bottom of the while loop)
00404         // will return S_OK if it returns another property,
00405         // S_FALSE if there are no more properties,
00406         // and anything else is an error.
00407
00408         while( S_OK == hr )
00409         {
00410
00411             // Read the property out of the property set
00412
00413             PropVariantInit( &propvar );
00414             propspec.ulKind = PRSPEC_PROPID;
00415             propspec.propid = statpropstg.propid;
00416
00417             hr = pPropStg->ReadMultiple( 1, &propspec, &propvar );
00418             if( FAILED(hr) ) throw L"Failed IPropertyStorage::ReadMultiple";
00419
00420             // Display the property value, type, etc.
00421
00422             DisplayProperty( propvar, statpropstg );
00423
00424             // Free buffers that were allocated during the read and
00425             // by the enumerator.
00426
00427             PropVariantClear( &propvar );
00428             CoTaskMemFree( statpropstg.lpwstrName );
00429             statpropstg.lpwstrName = NULL;
00430
00431             // Move to the next property in the enumeration
00432
00433             hr = penum->Next( 1, &statpropstg, NULL );
00434         }
00435         if( FAILED(hr) ) throw L"Failed IEnumSTATPROPSTG::Next";
00436     }
00437     catch( LPCWSTR pwszErrorMessage )
00438     {
00439         wprintf( L"Error in DumpPropertySet: %s (hr = %08x)\n",
00440                  pwszErrorMessage, hr );
00441     }
00442
00443     if( NULL != penum )
00444         penum->Release();
00445
00446     if( NULL != statpropstg.lpwstrName )
00447         CoTaskMemFree( statpropstg.lpwstrName );
00448
00449     PropVariantClear( &propvar );
00450 }
00451
00452
00453 //+----------------------------------------------------------------------------
00454 //
00455 //  DisplayPropertySetsInStorage
00456 //
00457 //  Dump the property sets in the top level of a given storage.
00458 //
00459 //+----------------------------------------------------------------------------
00460
00461 void
00462 DisplayPropertySetsInStorage( const WCHAR *pwszStorageName,
00463                               IPropertySetStorage *pPropSetStg )
00464 {
00465     IEnumSTATPROPSETSTG *penum = NULL;
00466     HRESULT hr = S_OK;
00467     IPropertyStorage *pPropStg = NULL;
00468     STATPROPSETSTG statpropsetstg;
00469
00470     try
00471     {
00472         // Get a property-set enumerator (which only enumerates the property
00473         // sets at this level of the storage, not its children).
00474
00475         hr = pPropSetStg->Enum( &penum );
00476         if( FAILED(hr) ) throw L"failed IPropertySetStorage::Enum";
00477
00478         // Get the first property set in the enumeration.
00479         // (The field we're interested in is
00480         // statpropsetstg.fmtid, so that we can open the
00481         // property set.)
00482
00483         memset( &statpropsetstg, 0, sizeof(statpropsetstg) );
00484         hr = penum->Next( 1, &statpropsetstg, NULL );
00485
00486         // Loop through all the property sets
00487
00488         while( S_OK == hr )
00489         {
00490             // Open the property set
00491
00492             hr = pPropSetStg->Open( statpropsetstg.fmtid,
00493                                     STGM_READ | STGM_SHARE_EXCLUSIVE,
00494                                     &pPropStg );
00495             if( FAILED(hr) ) throw L"failed IPropertySetStorage::Open";
00496
00497             // Display the properties in the property set
00498
00499             DisplayPropertySet( statpropsetstg.fmtid,
00500                                 pwszStorageName,
00501                                 pPropStg );
00502
00503             pPropStg->Release();
00504             pPropStg = NULL;
00505
00506             // Get the FMTID of the next property set in the enumeration.
00507
00508             hr = penum->Next( 1, &statpropsetstg, NULL );
00509
00510         }
00511         if( FAILED(hr) ) throw L"Failed IEnumSTATPROPSETSTG::Next";
00512
00513         // Special-case handling for the UserDefined property set:
00514         // This property set actually lives inside the well-known
00515         // DocumentSummaryInformation property set.  It is the only
00516         // property set which is allowed to live inside another
00517         // (and exists for legacy compatibility).  It does not get
00518         // included in a normal enumeration, so we have to check for
00519         // it explicitely.  We'll handle it by looking for it when
00520         // we reach the end of the enumerator.
00521
00522         hr = pPropSetStg->Open( FMTID_UserDefinedProperties,
00523                                 STGM_READ | STGM_SHARE_EXCLUSIVE,
00524                                 &pPropStg );
00525         if( SUCCEEDED(hr) )
00526         {
00527             DisplayPropertySet( FMTID_UserDefinedProperties,
00528                                 pwszStorageName,
00529                                 pPropStg );
00530             pPropStg = NULL;
00531         }
00532
00533     }
00534     catch( LPCWSTR pwszErrorMessage )
00535     {
00536         wprintf( L"Error in DumpPropertySetsInStorage: %s (hr = %08x)\n",
00537                  pwszErrorMessage, hr );
00538     }
00539
00540     if( NULL != pPropStg )
00541         pPropStg->Release();
00542     if( NULL != penum )
00543         penum->Release();
00544 }
00545
00546
00547 //+----------------------------------------------------------------------------
00548 //
00549 //  DisplayStorageTree
00550 //
00551 //  Dump all the property sets in the given storage and recursively in
00552 //  all its children.
00553 //
00554 //+----------------------------------------------------------------------------
00555
00556 void
00557 DisplayStorageTree( const WCHAR *pwszStorageName, IStorage *pStg )
00558 {
00559     IPropertySetStorage *pPropSetStg = NULL;
00560     IStorage *pStgChild = NULL;
00561     WCHAR *pwszChildStorageName = NULL;
00562     IEnumSTATSTG *penum = NULL;
00563     HRESULT hr = S_OK;
00564     STATSTG statstg;
00565
00566     memset( &statstg, 0, sizeof(statstg) );
00567
00568     try
00569     {
00570         // Dump the property sets at this storage level
00571
00572         hr = pStg->QueryInterface( IID_IPropertySetStorage,
00573                                    reinterpret_cast<void**>(&pPropSetStg) );
00574         if( FAILED(hr) )
00575             throw L"Failed IStorage::QueryInterface(IID_IPropertySetStorage)";
00576
00577         DisplayPropertySetsInStorage( pwszStorageName, pPropSetStg );
00578
00579         // Get an enumerator for this storage.
00580
00581         hr = pStg->EnumElements( NULL, NULL, NULL, &penum );
00582         if( FAILED(hr) ) throw L"failed IStorage::Enum";
00583
00584         // Get the name of the first element (stream/storage)
00585         // in the enumeration.  As usual, ‘Next' will return
00586         // S_OK if it returns an element of the enumerator,
00587         // S_FALSE if there are no more elements, and an
00588         // error otherwise.
00589
00590         hr = penum->Next( 1, &statstg, 0 );
00591
00592         // Loop through all the direct children of this storage.
00593
00594         while( S_OK == hr )
00595         {
00596             // Check if this is a storage that isn't a property set
00597             // (since we already displayed the property sets above).
00598             // You can tell if a stream/storage is a property set
00599             // because the first character of it's name is the
00600             // ‘\005' reserved character.
00601
00602             if( STGTY_STORAGE == statstg.type
00603                 &&
00604                 L'\005' != statstg.pwcsName[0] )
00605             {
00606                 // Yes, this is a normal storage, not a propset.
00607                 // Open the storage.
00608
00609                 ULONG cchChildStorageName;
00610
00611                 hr = pStg->OpenStorage( statstg.pwcsName,
00612                                         NULL,
00613                                         STGM_READ | STGM_SHARE_EXCLUSIVE,
00614                                         NULL, 0,
00615                                         &pStgChild );
00616                 if( FAILED(hr) ) throw L"failed IStorage::OpenStorage";
00617
00618                 // Compose a name of the form "Storage\ChildStorage\..."
00619                 // for display purposes.  First, allocate it.
00620
00621                 cchChildStorageName = wcslen(pwszStorageName)
00622                                         + wcslen(statstg.pwcsName)
00623                                         + 2  // For the two "\" chars
00624                                         + 1; // For the string terminator
00625
00626                 pwszChildStorageName = new WCHAR[ cchChildStorageName ];
00627                 if( NULL == pwszChildStorageName )
00628                 {
00629                     hr = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
00630                     throw L"couldn't allocate memory";
00631                 }
00632
00633                 // Terminate the name
00634
00635                 pwszChildStorageName[ cchChildStorageName-1 ] = L'\0';
00636                 --cchChildStorageName;
00637
00638                 // Build the name.
00639
00640                 wcsncpy( pwszChildStorageName, pwszStorageName,
00641                          cchChildStorageName );
00642                 cchChildStorageName -= wcslen(pwszStorageName);
00643
00644                 wcsncat( pwszChildStorageName, L"\\",
00645                          cchChildStorageName );
00646                 cchChildStorageName -= 2;
00647
00648                 wcsncat( pwszChildStorageName, statstg.pwcsName,
00649                          cchChildStorageName );
00650
00651                 // Dump all the property sets under this child storage.
00652
00653                 DisplayStorageTree( pwszChildStorageName, pStgChild );
00654
00655                 pStgChild->Release();
00656                 pStgChild = NULL;
00657
00658                 delete pwszChildStorageName;
00659                 pwszChildStorageName = NULL;
00660             }
00661
00662             // Move on to the next element in the enumeration of this storage.
00663
00664             CoTaskMemFree( statstg.pwcsName );
00665             statstg.pwcsName = NULL;
00666
00667             hr = penum->Next( 1, &statstg, 0 );
00668         }
00669         if( FAILED(hr) ) throw L"failed IEnumSTATSTG::Next";
00670     }
00671     catch( LPCWSTR pwszErrorMessage )
00672     {
00673         wprintf( L"Error in DumpStorageTree: %s (hr = %08x)\n",
00674                  pwszErrorMessage, hr );
00675     }
00676
00677     // Clean up before returning.
00678
00679     if( NULL != statstg.pwcsName )
00680         CoTaskMemFree( statstg.pwcsName );
00681     if( NULL != pStgChild )
00682         pStgChild->Release();
00683     if( NULL != pStg )
00684         pStg->Release();
00685     if( NULL != penum )
00686         penum->Release();
00687     if( NULL != pwszChildStorageName )
00688         delete pwszChildStorageName;
00689
00690 }
00691
00692
00693 //+----------------------------------------------------------------------------
00694 //
00695 //  wmain
00696 //
00697 //  Dump all the property sets in a file which is a storage.
00698 //
00699 //+----------------------------------------------------------------------------
00700
00701 extern "C" void wmain( int cArgs, WCHAR *rgwszArgs[] )
00702 {
00703     HRESULT hr = S_OK;
00704     IStorage *pStg = NULL;
00705
00706     // Display usage information if necessary.
00707
00708     if( 1 == cArgs
00709         ||
00710         0 == wcscmp( L"-?", rgwszArgs[1] )
00711         ||
00712         0 == wcscmp( L"/?", rgwszArgs[1] ))
00713     {
00714         printf( "\n"
00715                 "Purpose:  Enumerate all properties in all\n"
00716                 "          property sets for a storage file\n"
00717                 "Usage:    PropDump <filename>\n"
00718                 "E.g.:     PropDump word.doc\n"
00719                 "\n" );
00720         exit(0);
00721     }
00722
00723     // Open the root storage.
00724
00725     hr = StgOpenStorageEx( rgwszArgs[1],
00726                            STGM_READ | STGM_SHARE_DENY_WRITE,
00727                            STGFMT_ANY,
00728                            0,
00729                            NULL,
00730                            NULL,
00731                            IID_IStorage,
00732                            reinterpret_cast<void**>(&pStg) );
00733
00734     // Dump all the properties in all the property sets within this
00735     // storage.
00736
00737     if( FAILED(hr) )
00738     {
00739         wprintf( L"Error:  couldn't open storage \"%s\" (hr = %08x)\n",
00740                  rgwszArgs[1], hr );
00741     }
00742     else
00743     {
00744         printf( "\nDisplaying all property sets ...\n" );
00745         DisplayStorageTree( rgwszArgs[1], pStg );
00746         pStg->Release();
00747     }
00748
00749
00750 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IAppletVtbl Member List

This is the complete list of members for IAppletVtbl, including all inherited members.
dwCookie | IAppletVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(IApplet __RPC_FAR *This | IAppletVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Initialize)(IApplet __RPC_FAR *This) | IAppletVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *RegisterAutoJoin)(IApplet __RPC_FAR *This | IAppletVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *UnregisterAutoJoin)(IApplet __RPC_FAR *This) | IAppletVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *CreateSession)(IApplet __RPC_FAR *This | IAppletVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Advise)(IApplet __RPC_FAR *This | IAppletVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *UnAdvise)(IApplet __RPC_FAR *This | IAppletVtbl
nConfID | IAppletVtbl
pdwCookie | IAppletVtbl
pNotify | IAppletVtbl
ppSession | IAppletVtbl
ppvObject | IAppletVtbl
pRequest | IAppletVtbl
riid | IAppletVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(IApplet __RPC_FAR *This) | IAppletVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(IApplet __RPC_FAR *This) | IAppletVtbl
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/Connect.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

Connect.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CONNECT.H
00003
00004   Summary:   Include file declaring COM object classes and constants for
00005              managing the connection points (and their connections)
00006              exposed by the connectable objects in the DCDSERVE server.
00007
00008              For a comprehensive tutorial code tour of this module's
00009              contents and offerings see the tutorial DCDSERVE.HTM
00010              file. For more specific technical details on the internal
00011              workings see the comments dispersed throughout the module's
00012              source code.
00013
00014   Functions: .
00015
00016   Classes:   COEnumConnectionPoints, COConnectionPoint, and
00017              COEnumConnections.
00018
00019   Origin:    6-10-96: atrent - Editor inheritance from the CONSERVE COM
00020              Tutorial Code Sample. Very little change was required.
00021
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037 #if !defined(CONNECT_H)
00038 #define CONNECT_H
00039
00040 #ifdef __cplusplus
00041
00042
00043 // An enumeration giving symbol names for the connection
00044 // points offered by the SharePaper component in this server.
00045 enum
00046 {
00047   CONNPOINT_PAPERSINK = 0
00048 };
00049
00050 enum
00051 {
00052   // The maximum number of connection points offered by the SharePaper
00053   // component in this DCDSERVE server.  The number of items in the
00054   // connection point enumeration above.
00055   MAX_CONNECTION_POINTS = 1,
00056
00057   // A constant for the number of connections to add to the allocation
00058   // of the dynamic connection array.
00059   ALLOC_CONNECTIONS = 8,
00060
00061   // The start value for the connection key (cookie) counter.
00062   COOKIE_START_VALUE = 500
00063 };
00064
00065
00066 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00067   ObjectClass: COEnumConnectionPoints
00068
00069   Summary:     COM object class for enumerating the Connection Points
00070                offered by a connectable object.
00071
00072   Interfaces:  IUnknown
00073                  Standard interface providing COM object features.
00074                IEnumConnectionPoints
00075                  Interface for connection point enumeration.
00076
00077   Aggregation: COEnumConnectionPoints COM Objects are not aggregatable.
00078 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00079 class COEnumConnectionPoints : public IEnumConnectionPoints
00080 {
00081   public:
00082     // Main Object Constructor & Destructor.
00083     COEnumConnectionPoints(IUnknown* pHostObj);
00084     ~COEnumConnectionPoints(void);
00085
00086     // A general method for initializing this newly created object.
00087     // Creates any subordinate arrays, structures, or objects.
00088     HRESULT Init(
00089               ULONG cConnPts,
00090               IConnectionPoint** paConnPts,
00091               ULONG iEnumIndex);
00092
00093     // IUnknown methods. Main object, non-delegating.
00094     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00095     STDMETHODIMP_(ULONG) AddRef(void);
00096     STDMETHODIMP_(ULONG) Release(void);
00097
00098     // IEnumConnectionPoints methods.
00099     STDMETHODIMP         Next(ULONG, IConnectionPoint**, ULONG*);
00100     STDMETHODIMP         Skip(ULONG);
00101     STDMETHODIMP         Reset(void);
00102     STDMETHODIMP         Clone(IEnumConnectionPoints**);
00103
00104   private:
00105     // Private data of COEnumConnectionPoints COM objects.
00106
00107     // Main Object reference count.
00108     ULONG              m_cRefs;
00109
00110     // IUnknown pointer to host COM object being enumerated.
00111     IUnknown*          m_pHostObj;
00112
00113     // Connection Point index variable.
00114     ULONG              m_iEnumIndex;
00115
00116     // Number of Connection Points being enumerated.
00117     ULONG              m_cConnPts;
00118
00119     // Allocated array of Connection Point interface pointers.
00120     IConnectionPoint** m_paConnPts;
00121 };
00122
00123 typedef COEnumConnectionPoints* PCOEnumConnectionPoints;
00124
00125
00126 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00127   ObjectClass: COConnectionPoint
00128
00129   Summary:     Connection Point COM object class. Implements a native
00130                IConnectionPoint interface. The Advise, Unadvise, and
00131                EnumConnections methods use the CThreaded OwnThis mechanism
00132                to provide thread-safe mutually exclusive access to this
00133                connection point object.
00134
00135   Interfaces:  IUnknown
00136                  Standard interface providing COM object features.
00137                IConnectionPoint
00138                  Interface for connection point features.
00139
00140   Aggregation: COConnectionPoint COM Objects are not aggregatable.
00141 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00142 class COConnectionPoint : public IConnectionPoint, public CThreaded
00143 {
00144   public:
00145     // Main Object Constructor & Destructor.
00146     COConnectionPoint(IUnknown* pHostObj);
00147     ~COConnectionPoint(void);
00148
00149     // A general method for initializing this newly created object.
00150     // Creates any subordinate arrays, structures, or objects.
00151     HRESULT Init(REFIID riid);
00152
00153     // IUnknown methods. Main object, non-delegating.
00154     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00155     STDMETHODIMP_(ULONG) AddRef(void);
00156     STDMETHODIMP_(ULONG) Release(void);
00157
00158     // IConnectionPoint methods.
00159     STDMETHODIMP GetConnectionInterface(IID*);
00160     STDMETHODIMP GetConnectionPointContainer(IConnectionPointContainer**);
00161     STDMETHODIMP Advise(IUnknown*, DWORD*);
00162     STDMETHODIMP Unadvise(DWORD);
00163     STDMETHODIMP EnumConnections(IEnumConnections**);
00164
00165   private:
00166     // Private utility methods of COConnectionPoint.
00167     HRESULT GetSlot(UINT* puiFreeSlot);
00168     HRESULT FindSlot(DWORD dwCookie, UINT* puiSlot);
00169
00170     // Private data of COConnectionPoint COM objects.
00171
00172     // Main Object reference count.
00173     ULONG          m_cRefs;
00174
00175     // IUnknown pointer to host COM object offering this connection point.
00176     IUnknown*      m_pHostObj;
00177
00178     // The IID of the sink interface associated with this connection point.
00179     IID            m_iidSink;
00180
00181     // The current connection cookie (key) counter.
00182     DWORD          m_dwNextCookie;
00183
00184     // The current number of live sink connections to this connection point.
00185     UINT           m_cConnections;
00186
00187     // The current maximum index into the dynamic connection array.
00188     UINT           m_uiMaxIndex;
00189
00190     // The dynamic array of sink connections to this connection point.
00191     CONNECTDATA*   m_paConnections;
00192 };
00193
00194 typedef COConnectionPoint* PCOConnectionPoint;
00195
00196
00197 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00198   ObjectClass: COEnumConnections
00199
00200   Summary:     COM object class for enumerating the connections of a
00201                connection point of a connectable object.
00202
00203   Interfaces:  IUnknown
00204                  Standard interface providing COM object features.
00205                IEnumConnections
00206                  Interface for connection enumeration features.
00207
00208   Aggregation: COEnumConnections COM Objects are not aggregatable.
00209 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00210 class COEnumConnections : public IEnumConnections
00211 {
00212   public:
00213     // Main Object Constructor & Destructor.
00214     COEnumConnections(IUnknown* pHostObj);
00215     ~COEnumConnections(void);
00216
00217     // A general method for initializing this newly created object.
00218     // Creates any subordinate arrays, structures, or objects.
00219     HRESULT Init(
00220               ULONG cConnections,
00221               CONNECTDATA* paConnections,
00222               ULONG iEnumIndex);
00223
00224     // IUnknown methods. Main object, non-delegating.
00225     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00226     STDMETHODIMP_(ULONG) AddRef(void);
00227     STDMETHODIMP_(ULONG) Release(void);
00228
00229     // IEnumConnections methods.
00230     STDMETHODIMP         Next(ULONG, CONNECTDATA*, ULONG*);
00231     STDMETHODIMP         Skip(ULONG);
00232     STDMETHODIMP         Reset(void);
00233     STDMETHODIMP         Clone(IEnumConnections**);
00234
00235   private:
00236     // Private data of COEnumConnections COM objects.
00237
00238     // Main Object reference count.
00239     ULONG            m_cRefs;
00240
00241     // IUnknown pointer to host connection point COM object being
00242     // enumerated.
00243     IUnknown*        m_pHostObj;
00244
00245     // Connection index variable.
00246     ULONG            m_iEnumIndex;
00247
00248     // Number of Connections being enumerated.
00249     ULONG            m_cConnections;
00250
00251     // Allocated array of live Connections only.
00252     CONNECTDATA*     m_paConnections;
00253 };
00254
00255 typedef COEnumConnections* PCOEnumConnections;
00256
00257 #endif // __cplusplus
00258
00259
00260 #endif // CONNECT_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcNotify/INotify.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcNotify

INotify.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc24F.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCNotify.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcnotify;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface INotify
00019 /** @com.interface(iid=6DD1E6EF-28C1-11D2-B5B6-00C04FC340EE, thread=AUTO, type=DUAL) */
00020 public interface INotify extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPPUT, name="CustomerId", name2="putCustomerId", addFlagsVtable=4)
00023       @com.parameters([in,type=I4] _jcomparam_0) */
00024   public void setCustomerId(int _jcomparam_0);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=PROPPUT, name="OrderId", name2="putOrderId", addFlagsVtable=4)
00027       @com.parameters([in,type=I4] _jcomparam_0) */
00028   public void setOrderId(int _jcomparam_0);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LineItem", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] lItemId, [in,type=I4] lQuantity, [in,type=I4] ShipStatus) */
00032   public void LineItem(int lItemId, int lQuantity, int ShipStatus);
00033
00034   /** @com.method(vtoffset=7, dispid=4, type=METHOD, name="Process", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] lFlags) */
00036   public void Process(int lFlags);
00037
00038
00039   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x6dd1e6ef, (short)0x28c1, (short)0x11d2, (byte)0xb5, (byte)0xb6, (byte)0x0, (byte)0xc0, (byte)0x4f, (byte)0xc3, (byte)0x40, (byte)0xee);
00040 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/property.h Source File

  • Dataaccess
  • oledb
  • tablecopy

property.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module PROPERTY.H
00008 //
00009 //-----------------------------------------------------------------------------
00010 #ifndef _PROPERTY_H_
00011 #define _PROPERTY_H_
00012
00013
00014 ///////////////////////////////////////////////////////////////
00015 // Includes
00016 //
00017 ///////////////////////////////////////////////////////////////
00018 #include "common.h"
00019
00020
00021 ////////////////////////////////////////////////////////////////////////////
00022 // Properties
00023 //
00024 ////////////////////////////////////////////////////////////////////////////
00025
00026 //Property Info
00027 HRESULT GetPropInfo(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, DBPROPINFO** ppPropInfo);
00028 DBPROPFLAGS GetPropInfoFlags(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet);
00029
00030 //Property Flags
00031 BOOL IsSupportedProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet);
00032 BOOL IsSettableProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet);
00033
00034 //Get Property
00035 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, WCHAR** ppwszValue);
00036 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, DBPROP** ppProperty);
00037 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, WCHAR* pwszValue);
00038 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, ULONG* pcValue);
00039 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, BOOL* pbValue);
00040
00041 //Set Property
00042 HRESULT SetProperty(DBPROPID PropertyID, GUID guidPropertySet, ULONG* pcPropSets, DBPROPSET** prgPropSets, DBTYPE wType, ULONG ulValue, DBPROPOPTIONS dwOptions = DBPROPOPTIONS_REQUIRED, DBID colid = DB_NULLID);
00043 HRESULT SetProperty(DBPROPID PropertyID, GUID guidPropertySet, ULONG* pcPropSets, DBPROPSET** prgPropSets, DBTYPE wType, void* pv, DBPROPOPTIONS dwOptions = DBPROPOPTIONS_REQUIRED, DBID colid = DB_NULLID);
00044
00045 //Free Property
00046 HRESULT FreeProperties(ULONG cPropSets, DBPROPSET* rgPropSets);
00047 HRESULT FreeProperties(ULONG cProperties, DBPROP* rgProperties);
00048
00049 //Variants
00050 HRESULT InitVariants(ULONG cVariants, VARIANT* rgVariants);
00051 HRESULT FreeVariants(ULONG cVariants, VARIANT* rgVariants);
00052
00053 //Restrictions
00054 HRESULT SetRestriction(VARIANT* pRestriction, WCHAR* pwszValue);
00055
00056
00057 #endif  //_PROPERTY_H_
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/usrdef/Usrdef.Idl Source File

  • NetDS
  • RPC
  • Handles
  • usrdef

Usrdef.Idl

Go to the documentation of this file.
00001 [ uuid (85D7D1C0-CA47-1067-B31E-00DD010662DA),
00002   version(1.0),
00003   pointer_default(unique)
00004 ]
00005 interface usrdef
00006 {
00007
00008 typedef struct _DATA_TYPE {
00009     unsigned char * pszUuid;
00010     unsigned char * pszProtocolSequence;
00011     unsigned char * pszNetworkAddress;
00012     unsigned char * pszEndpoint;
00013     unsigned char * pszOptions;
00014 } DATA_TYPE;
00015
00016 typedef [handle] DATA_TYPE *DATA_HANDLE_TYPE;
00017
00018 void UsrdefProc([in]       DATA_HANDLE_TYPE  hBinding,
00019     [in, string] unsigned char     *pszString);
00020
00021 void Shutdown([in] DATA_HANDLE_TYPE  hBinding);
00022
00023 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SCHEMAINFO Member List

This is the complete list of members for _SCHEMAINFO, including all inherited members.
cRestrictions | _SCHEMAINFO
iNode | _SCHEMAINFO
pguidSchema | _SCHEMAINFO
pwszName | _SCHEMAINFO
pwszSchemaName | _SCHEMAINFO
rgResInfo | _SCHEMAINFO
wType | _SCHEMAINFO
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSettings Member List

This is the complete list of members for CSettings, including all inherited members.
Alert(HWND hWnd, LPCTSTR lpText) | CSettings | [private]
CLockHandler() | CLockHandler | [private]
ConfigDlgAddListViewItem(HWND hWndList, SYNCMGRITEM syncMgrItem, int iItem, int iIconIndex) | CSettings | [private]
ConfigDlgDeleteListViewItem(HWND hWndList, int iItem) | CSettings | [private]
ConfigureDlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [friend]
CopyHandlerSyncInfo(REFSYNCMGRITEMID ItemID, LPHANDLERITEMSETTINGS pHandlerSyncItem) | CSettings |
CSettings() | CSettings |
DeleteItemSettings(LPSAMPLEITEMSETTINGS pSampleItemSettings) | CSettings | [private]
EnumSyncMgrItems(ISyncMgrEnumItems **ppenumOffineItems) | CSettings |
FindItemSettings(REFSYNCMGRITEMID ItemID) | CSettings | [private]
GetLockThreadId() | CLockHandler | [inline, private]
ItemConfigDlgGetItemSettings(ITEMCONFIGSETTINGSLPARAM *pItemConfigDlglParam) | CSettings | [private]
ItemConfigDlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [friend]
Lock(DWORD dwThreadId) | CLockHandler | [private]
m_cRefs | CSettings | [private]
m_pHandlerItems | CSettings | [private]
OnConfigDlgAdd(HWND hWnd, CONFIGSETTINGSLPARAM *pConfigSettingslParam) | CSettings | [private]
OnConfigDlgCommand(HWND hWnd, CONFIGSETTINGSLPARAM *pConfigSettingslParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnConfigDlgDestroy(HWND hWnd, CONFIGSETTINGSLPARAM *pConfigSettingslParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnConfigDlgEdit(HWND hWnd, CONFIGSETTINGSLPARAM *pConfigSettingslParam, SYNCMGRITEMID ItemID, int iSelection) | CSettings | [private]
OnConfigDlgInit(HWND hWnd, CONFIGSETTINGSLPARAM *pConfigSettingslParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnConfigDlgNotify(HWND hWnd, CONFIGSETTINGSLPARAM *pConfigSettingslParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnConfigDlgRemove(HWND hWnd, CONFIGSETTINGSLPARAM *pConfigSettingslParam, SYNCMGRITEMID ItemID, int iSelection) | CSettings | [private]
OnItemConfigDlgApply(HWND hWnd, ITEMCONFIGSETTINGSLPARAM *pItemConfigDlglParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnItemConfigDlgCommand(HWND hWnd, ITEMCONFIGSETTINGSLPARAM *pItemConfigDlglParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnItemConfigDlgDestroy(HWND hWnd, ITEMCONFIGSETTINGSLPARAM *pItemConfigDlglParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnItemConfigDlgInit(HWND hWnd, ITEMCONFIGSETTINGSLPARAM *pItemConfigDlglParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
OnItemConfigDlgNotify(HWND hWnd, ITEMCONFIGSETTINGSLPARAM *pItemConfigDlglParam, UINT uMessage, WPARAM wParam, LPARAM lParam) | CSettings | [private]
ReadSettings(BOOL fForce) | CSettings | [private]
ReleaseItemLock(CSyncMgrHandler *pLockHandler, REFSYNCMGRITEMID ItemID) | CSettings |
ReleaseItemLock(CSyncMgrHandler *pLockHandler, REFSYNCMGRITEMID ItemID, FILETIME *pfUpdateTime) | CSettings |
ReleaseItemLockX(CSyncMgrHandler *pLockHandler, REFSYNCMGRITEMID ItemID, BOOL fUpdateft, FILETIME *pfUpdateTime) | CSettings | [private]
RequestItemLock(CSyncMgrHandler *pLockHandler, REFSYNCMGRITEMID ItemID) | CSettings |
ShowItemProperties(HWND hWndParent, BOOL fNew, LPSAMPLEITEMSETTINGS pItemSettings, SYNCMGRITEMID ItemID) | CSettings | [private]
ShowProperties(HWND hWndParent, REFSYNCMGRITEMID ItemID) | CSettings |
STDMETHODIMP_(ULONG) AddRef() | CSettings |
STDMETHODIMP_(ULONG) Release() | CSettings |
UnLock() | CLockHandler | [private]
WriteItemSettings(LPSAMPLEITEMSETTINGS pSampleItemSettings) | CSettings | [private]
~CLockHandler() | CLockHandler | [private]
~CSettings() | CSettings |
Generated on Wed Nov 13 2024 16:57:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/OtherWKO/vc/otherwko.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • OtherWKO
  • vc

otherwko.cpp

Go to the documentation of this file.
00001 // otherwko.cpp : Defines the entry point for the console application.
00002 //
00003 #include <wchar.h>
00004 #include <objbase.h>
00005 #include <activeds.h>
00006
00007 //Make sure you define UNICODE
00008 //Need to define version 5 for Windows 2000
00009 #define _WIN32_WINNT 0x0500
00010 //FOR LDAP API...Required for Beta 3 only.
00011 #include <winldap.h>
00012 //Need to link against the following LIBs:
00013 //wldap32.lib
00014
00015
00016 static GUID MyWKOTestObjectGUID = { /* df447b5e-aa5b-11d2-8d53-00c04f79ab81 */
00017     0xdf447b5e,
00018     0xaa5b,
00019     0x11d2,
00020     {0x8d, 0x53, 0x00, 0xc0, 0x4f, 0x79, 0xab, 0x81}
00021   };
00022
00023
00024
00025 HRESULT GUIDtoBindableString (LPGUID pGUID, LPOLESTR *ppGUIDString);
00026
00027 HRESULT AddValueToOtherWKOProperty(LPOLESTR szContainerDN, //DN for container whose otherWellKnownObjects property to modify
00028                    LPGUID pWKOGUID, //WKO GUID for the well-known object.
00029                    LPOLESTR szWKOObjectDN //DN of the well-known object.
00030                    );
00031
00032
00033
00034
00035 void wmain( int argc, wchar_t *argv[ ])
00036 {
00037
00038 //Handle the command line arguments.
00039 LPOLESTR pszBuffer = new OLECHAR[MAX_PATH*2];
00040   wprintf(L"This program does the following:\n");
00041   wprintf(L"1. Creates a container (MyWKOTestContainer) in the current Window 2000 domain.\n");
00042   wprintf(L"2. Creates a container object (MyWKOTestObject) within the container.\n");
00043   wprintf(L"3. Adds a value for the container object on the otherWellKnownObject property of the container.\n");
00044   wprintf(L"4. Binds to the container object using WKGUID binding string.\n");
00045   wprintf(L"5. Renames the container object using WKGUID binding string.\n");
00046   wprintf(L"6. Binds to the container object using WKGUID binding string.\n");
00047   wprintf(L"7. Optionally, cleans up by removing the container and leaf object.\n\n");
00048
00049
00050 //Intialize COM
00051 CoInitialize(NULL);
00052
00053 HRESULT hr = S_OK;
00054 IADs *pObject = NULL;
00055 IADsContainer *pDomain = NULL;
00056 IDispatch *pDisp = NULL;
00057 IDispatch *pDispNewContainerObject = NULL;
00058 IADsContainer *pNewContainer = NULL;
00059 IADs *pIADsObject = NULL;
00060 IADs *pNewContainerObject = NULL;
00061
00062 LPOLESTR szNewContainerDN = new OLECHAR[MAX_PATH];
00063 LPOLESTR szPath = new OLECHAR[MAX_PATH];
00064 LPOLESTR szRelPath = new OLECHAR[MAX_PATH];
00065
00066 //Names of the container and child object.
00067 LPOLESTR szContainer = L"MyWKOTestContainer";
00068 LPOLESTR szNewContainerObject = L"MyWKOTestObject";
00069
00070 //Get rootDSE and the domain container's DN.
00071 VARIANT var;
00072 hr = ADsOpenObject(L"LDAP://rootDSE",
00073          NULL,
00074          NULL,
00075          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00076          IID_IADs,
00077          (void**)&pObject);
00078 if (FAILED(hr))
00079 {
00080    wprintf(L"Not Found. Could not bind to the domain.\n");
00081    if (pObject)
00082      pObject->Release();
00083    return;
00084 }
00085
00086 hr = pObject->Get(L"defaultNamingContext",&var);
00087 if (SUCCEEDED(hr))
00088 {
00089   //Build the ADsPath to the domain
00090   wcscpy(szPath,L"LDAP://");
00091   wcscat(szPath,var.bstrVal);
00092   VariantClear(&var);
00093   //Bind to the current domain.
00094   hr = ADsOpenObject(szPath,
00095            NULL,
00096            NULL,
00097            ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00098            IID_IADsContainer,
00099            (void**)&pDomain);
00100   if (SUCCEEDED(hr))
00101   {
00102     //Create the container.
00103     wcscpy(szRelPath,L"cn=");
00104     wcscat(szRelPath,szContainer);
00105     hr = pDomain->Create(L"container", //ldapDisplayName of the class of the object to create.
00106                        szRelPath, //relative path in RDN=value format
00107                &pDisp); //return an IDispatch pointer to the new object.
00108     if (SUCCEEDED(hr))
00109     {
00110     //QI for an IADsContainer interface.
00111     hr = pDisp->QueryInterface(IID_IADsContainer, (void **)&pNewContainer);
00112     if (SUCCEEDED(hr))
00113     {
00114       //Create the leaf object in the container.
00115       wcscpy(szRelPath,L"cn=");
00116         wcscat(szRelPath,szNewContainerObject);
00117         hr = pNewContainer->Create(L"leaf", //ldapDisplayName of the class of the object to create.
00118                    szRelPath, //relative path in RDN=value format
00119            &pDispNewContainerObject); //return an IDispatch pointer to the new object.
00120           //QI for an IADs interface.
00121         hr = pNewContainer->QueryInterface(IID_IADs, (void **)&pIADsObject);
00122       if (SUCCEEDED(hr))
00123       {
00124       //Get the DN of the new container object
00125       hr = pIADsObject->Get(L"distinguishedName", &var);
00126       if (SUCCEEDED(hr))
00127       {
00128         wcscpy(szNewContainerDN, var.bstrVal);
00129         VariantClear(&var);
00130         hr = NewContainerObject->QueryInterface(IID_IADs, (void **)&pNewContainerObject);
00131           if (SUCCEEDED(hr))
00132         {
00133           //Get the DN for the leaf object
00134           hr = pNewContainerObject->Get(L"distinguishedName", &var);
00135           if (SUCCEEDED(hr))
00136         {
00137           //FOR BETA 3 only. Need to use LDAP API to set the otherWellKnownObjects property.
00138                   hr = AddValueToOtherWKOProperty(szNewContainerDN, //DN for container whose otherWellKnownObjects property to modify
00139                    &MyWKOTestObjectGUID, //WKO GUID for the well-known object.
00140                    var.bstrVal //DN of the well-known object.
00141                    );
00142         }
00143         }
00144           if (pNewContainerObject)
00145           pNewContainerObject->Release();
00146       }
00147       VariantClear(&var);
00148       }
00149         if (pIADsObject)
00150         pIADsObject->Release();
00151         if (pDispNewContainerObject)
00152           pDispNewContainerObject->Release();
00153     }
00154       if (pNewContainer)
00155         pNewContainer->Release();
00156     }
00157     if (pDisp)
00158       pDisp->Release();
00159   }
00160     if (pDomain)
00161     pDomain->Release();
00162 }
00163 if (pObject)
00164    pObject->Release();
00165
00166 //Uninitalize COM
00167 CoUninitialize();
00168
00169   return;
00170 }
00171
00172 HRESULT AddValueToOtherWKOProperty(LPOLESTR szContainerDN, //DN for container whose otherWellKnownObjects property to modify
00173                    LPGUID pWKOGUID, //WKO GUID for the well-known object.
00174                    LPOLESTR szWKOObjectDN //DN of the well-known object.
00175                    )
00176 {
00177 HRESULT hr = E_FAIL;
00178 LPOLESTR szGUIDString = new OLECHAR[MAX_PATH];
00179 LPOLESTR szDNwithOctetString = new OLECHAR[MAX_PATH*2];
00180 DWORD dwReturn;
00181 //Connection handle
00182 LDAP *hConnect = NULL;
00183 //Specify NULL to bind to a DC in the current computer's domain.
00184 //LDAP_PORT is the default port, 389
00185 hConnect  = ldap_open(NULL,  LDAP_PORT);
00186 //Bind using the preferred authentication method on Windows 2000
00187 //and the logged on user's security context.
00188 dwReturn = ldap_bind_s( hConnect, NULL, NULL, LDAP_AUTH_NEGOTIATE );
00189 if (dwReturn==LDAP_SUCCESS)
00190 {
00191   //Create the WKO value to add.
00192   GUIDtoBindableString (pWKOGUID, &szGUIDString);
00193   DWORD dwGUIDSize = sizeof(OLECHAR)*(wcslen(szGUIDString));
00194   //Build the DNwithoctetstring
00195   swprintf(szDNwithOctetString, L"B:%d:%s:%s", dwGUIDSize, szGUIDString,szWKOObjectDN);
00196   ULONG ulBerSize = sizeof(OLECHAR)*(wcslen(szDNwithOctetString));
00197   //Build the BerVal
00198   PCHAR pByteVal = (PCHAR)szDNwithOctetString;
00199   berval berWKO;
00200   berWKO.bv_len = ulBerSize;
00201   berWKO.bv_val = pByteVal;
00202
00203   //Build the mod structure to add the value.
00204   LDAPMod ldWKO;
00205   //mod_values takes a NULL terminated array of WCHARs.
00206   //We're adding a single value.
00207   OLECHAR *berValues[] = { szDNwithOctetString, NULL };
00208   //Operation
00209   ldWKO.mod_op = LDAP_MOD_ADD|LDAP_MOD_BVALUES;
00210   //Attribute
00211   ldWKO.mod_type = L"otherWellKnownValues";
00212   //Value to set.
00213   ldWKO.mod_values = berValues;
00214   //mods is a NULL terminated array of LDAPMod structures.
00215   //We're adding a single value.
00216   LDAPMod *pMod[] = {&ldWKO,NULL};
00217
00218   //Modify the object specified by szContainerDN.
00219   dwReturn = ldap_modify_s(  hConnect,
00220                            szContainerDN,
00221                pMod);
00222   if (dwReturn==LDAP_SUCCESS)
00223     hr = S_OK;
00224 }
00225 return hr;
00226 }
00227
00228
00229
00230
00231
00232 HRESULT GUIDtoBindableString (LPGUID pGUID, LPOLESTR *ppGUIDString)
00233 {
00234 HRESULT hr = E_FAIL;
00235 if (!pGUID)
00236   return E_INVALIDARG;
00237 //Build bindable GUID string
00238 LPOLESTR szDSGUID = new WCHAR [128];
00239 DWORD dwLen =  sizeof(*pGUID);
00240 LPBYTE lpByte = (LPBYTE) pGUID;
00241 //Copy a blank string to make it a zero length string.
00242 wcscpy( szDSGUID, L"" );
00243 //Loop through to add each byte to the string.
00244 for( DWORD dwItem = 0L; dwItem < dwLen ; dwItem++ )
00245 {
00246   //Append to szDSGUID, double-byte, byte at dwItem index.
00247   swprintf(szDSGUID + wcslen(szDSGUID), L"%02x", lpByte[dwItem]);
00248   if( wcslen( szDSGUID ) > 128 )
00249     break;
00250 }
00251 //Allocate memory for string
00252 *ppGUIDString = (OLECHAR *)CoTaskMemAlloc (sizeof(OLECHAR)*(wcslen(szDSGUID)+1));
00253 if (*ppGUIDString)
00254   wcscpy(*ppGUIDString, szDSGUID);
00255 else
00256   hr=E_FAIL;
00257 //Caller must free ppGUIDString using CoTaskMemFree.
00258 return hr;
00259 }
00260
00261
00262 // This function gets the specified well-known object for the current user's domain.
00263
00264 HRESULT GetWKOObject(LPOLESTR szBindableWKGUID, //IN. Bindable string GUID of well-known object.
00265               IADs **ppObject //OUT. Return a pointer to the specified well-known object.
00266               )
00267 {
00268 HRESULT hr = E_FAIL;
00269 //Get rootDSE and the domain container's DN.
00270 IADs *pObject = NULL;
00271 LPOLESTR szPath = new OLECHAR[MAX_PATH];
00272 VARIANT var;
00273 hr = ADsOpenObject(L"LDAP://rootDSE",
00274          NULL,
00275          NULL,
00276          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00277          IID_IADs,
00278          (void**)&pObject);
00279
00280 //Get current domain DN.
00281 if (SUCCEEDED(hr))
00282 {
00283   hr = pObject->Get(L"defaultNamingContext",&var);
00284   if (SUCCEEDED(hr))
00285   {
00286     //Build the WKGUID binding string.
00287     wcscpy(szPath,L"LDAP://");
00288     wcscat(szPath,L"<WKGUID=");
00289     wcscat(szPath,szBindableWKGUID);
00290     wcscat(szPath,L",");
00291     wcscat(szPath,var.bstrVal);
00292     wcscat(szPath,L">");
00293     //Print the binding string.
00294     //wprintf(L"WKGUID binding string: %s\n",szPath);
00295     VariantClear(&var);
00296     //Bind to the well-known object.
00297     hr = ADsOpenObject(szPath,
00298              NULL,
00299              NULL,
00300              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00301              IID_IADs,
00302              (void**)ppObject);
00303     if (FAILED(hr))
00304     {
00305       if (*ppObject)
00306       {
00307         (*ppObject)->Release();
00308         (*ppObject) = NULL;
00309       }
00310     }
00311   }
00312 }
00313 if (pObject)
00314   pObject->Release();
00315
00316 return hr;
00317 }
00318
00319
00320
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/comp.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

comp.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "Comp.h"
00017 #include "CompData.h"
00018 #include "DataObj.h"
00019 #include "Resource.h"
00020 #include "StaticNode.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CComponent")
00026
00027
00028 //---------------------------------------------------------------------------
00029 //  Our default constuctor provides a pointer to the parent CComponentData
00030 //  class which we cache for use in later samples.
00031 //
00032 CComponent::CComponent
00033 (
00034   CComponentData*  pParent   //[in] Points to parent object
00035 )
00036 {
00037   _ASSERT( NULL != pParent );
00038
00039   m_cRef           = 0;
00040   m_hImageStrip16  = NULL;
00041   m_hImageStrip32  = NULL;
00042   m_ipConsole      = NULL;
00043   m_ipConsoleVerb  = NULL;
00044   m_ipResultData   = NULL;
00045   m_ipHeaderCtrl2  = NULL;
00046   m_ipDisplayHelp  = NULL;
00047   m_pComponentData = pParent;
00048
00049 }
00050
00051 //---------------------------------------------------------------------------
00052 CComponent::~CComponent()
00053 {
00054 }
00055
00056 /////////////////////////////////////////////////////////////////////////////
00057 //  Implementation of IUnknown
00058
00059 //---------------------------------------------------------------------------
00060 //  PROPPAGE:  Support for IExtendPropertySheet2 added
00061 //
00062 STDMETHODIMP CComponent::QueryInterface
00063 (
00064   REFIID   riid,       //[in] Identifier of the requested interface
00065   LPVOID   *ppv        //[out] Address of requested interface
00066 )
00067 {
00068   if( !ppv )
00069     return E_FAIL;
00070
00071   *ppv = NULL;
00072
00073   if( IsEqualIID(riid, IID_IUnknown) )
00074     *ppv = static_cast<IComponent*>(this);
00075   else if( IsEqualIID(riid, IID_IComponent) )
00076     *ppv = static_cast<IComponent*>(this);
00077   else if( IsEqualIID(riid, IID_IComponent2) )
00078     *ppv = static_cast<IComponent2*>(this);
00079   else if( IsEqualIID(riid, IID_IExtendPropertySheet2) )
00080     *ppv = static_cast<IExtendPropertySheet2*>(this);
00081
00082
00083   if( *ppv )
00084   {
00085     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00086     return S_OK;
00087   }
00088
00089   return E_NOINTERFACE;
00090 }
00091
00092 //---------------------------------------------------------------------------
00093 STDMETHODIMP_(ULONG) CComponent::AddRef()
00094 {
00095   return InterlockedIncrement((LONG*)&m_cRef);
00096 }
00097
00098 //---------------------------------------------------------------------------
00099 STDMETHODIMP_(ULONG) CComponent::Release()
00100 {
00101   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00102   {
00103     delete this;
00104     return 0;
00105   }
00106   return m_cRef;
00107 }
00108
00109 /////////////////////////////////////////////////////////////////////////////
00110 // Implementation of IComponent
00111
00112 //---------------------------------------------------------------------------
00113 STDMETHODIMP CComponent::Initialize
00114 (
00115   LPCONSOLE ipConsole    //[in] Points to the console's IUnknown
00116 )
00117 {
00118   HRESULT hResult = S_FALSE;
00119
00120   do
00121   {
00122     hResult = ipConsole->QueryInterface( IID_IConsole3,(VOID**)&m_ipConsole );
00123     BREAK_ON_ERROR( hResult );
00124
00125     hResult = m_ipConsole->QueryConsoleVerb( &m_ipConsoleVerb );
00126     BREAK_ON_ERROR( hResult );
00127
00128     hResult = m_ipConsole->QueryInterface( IID_IResultData,(VOID**)&m_ipResultData );
00129     BREAK_ON_ERROR( hResult );
00130
00131     hResult = m_ipConsole->QueryInterface( IID_IHeaderCtrl2,(VOID**)&m_ipHeaderCtrl2 );
00132     BREAK_ON_ERROR( hResult );
00133
00134     // MMC_HELP:  Cache IDisplay help for RequestInterface()
00135     hResult = m_ipConsole->QueryInterface( IID_IDisplayHelp,(VOID**)&m_ipDisplayHelp );
00136     BREAK_ON_ERROR( hResult );
00137
00138     // Load the bitmaps from the dll for the results pane
00139     m_hImageStrip16 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_16));
00140     if( NULL == m_hImageStrip16 )
00141     {
00142       hResult = S_FALSE;
00143       continue;
00144     }
00145
00146     m_hImageStrip32 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_32));
00147     if( NULL == m_hImageStrip32 )
00148     {
00149       hResult = S_FALSE;
00150       continue;
00151     }
00152
00153   }while( 0 );
00154
00155   TRACE_HRESULT(_T("Initialize"), hResult );
00156   return hResult;
00157 }
00158
00159
00160 //---------------------------------------------------------------------------
00161 STDMETHODIMP CComponent::Notify
00162 (
00163   LPDATAOBJECT     ipDataObject,   //[in] Points to the selected data object
00164   MMC_NOTIFY_TYPE  MmcEvent,       //[in] Identifies action taken by user
00165   LPARAM           nArg,           //[in] Depends on the notification type
00166   LPARAM           nParam          //[in] Depends on the notification type
00167 )
00168 {
00169   HRESULT hResult = S_FALSE;       // Return this for unhandled notifications
00170   TRACE_EVENT( _T("Notify"), MmcEvent );
00171
00172   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00173   if( NULL == pNode )
00174     return E_FAIL;
00175
00176
00177   switch( MmcEvent )
00178   {
00179     case MMCN_ADD_IMAGES:
00180       hResult = OnAddImages( ipDataObject, nArg, nParam );
00181       break;
00182
00183     case MMCN_SELECT:
00184       hResult = pNode->OnSelect( ipDataObject, nArg, nParam, (LONG_PTR)this );
00185       break;
00186
00187     case MMCN_SHOW:
00188       hResult = pNode->OnShow( ipDataObject, nArg, nParam, (LONG_PTR)this );
00189       break;
00190
00191     case MMCN_VIEW_CHANGE:
00192       hResult = pNode->OnViewChange( ipDataObject, nArg, nParam, (LONG_PTR)this );
00193       break;
00194
00195     case MMCN_DELETE:
00196       hResult = pNode->OnDelete( ipDataObject, nArg, nParam, (LONG_PTR)this );
00197       break;
00198
00199     case MMCN_CONTEXTHELP:
00200       hResult = pNode->OnContextHelp( ipDataObject, nArg, nParam, (LONG_PTR)this );
00201       break;
00202
00203     case MMCN_DBLCLICK:
00204       break;
00205
00206     default:
00207       break;
00208   }
00209   return hResult;
00210 }
00211
00212 //---------------------------------------------------------------------------
00213 STDMETHODIMP CComponent::Destroy
00214 (
00215   MMC_COOKIE nCookie   //[in] Not used
00216 )
00217 {
00218   SAFE_RELEASE( m_ipConsole     );
00219   SAFE_RELEASE( m_ipHeaderCtrl2 );
00220   SAFE_RELEASE( m_ipResultData  );
00221   SAFE_RELEASE( m_ipConsoleVerb );
00222
00223   SAFE_FREE_BITMAP( m_hImageStrip16 );
00224   SAFE_FREE_BITMAP( m_hImageStrip32 );
00225
00226   return S_OK;
00227 }
00228
00229 //---------------------------------------------------------------------------
00230 STDMETHODIMP CComponent::QueryDataObject
00231 (
00232   MMC_COOKIE              nCookie,     //[in]  Indentifier of the selected node
00233   DATA_OBJECT_TYPES       nEnumType,   //[in]  Context in which this object was created
00234   LPDATAOBJECT __RPC_FAR* ppDataObject //[out] Points to data object we create
00235 )
00236 {
00237   _ASSERT( NULL != nCookie );
00238   HRESULT hResult = S_FALSE;
00239
00240   CDataObject* pNewObject = new CDataObject();
00241   if( NULL == pNewObject )
00242     hResult = E_OUTOFMEMORY;
00243
00244   pNewObject->SetPrivateData( nCookie, (ULONG)nEnumType );
00245
00246   hResult = pNewObject->QueryInterface( IID_IDataObject, (void**)ppDataObject );
00247
00248   return hResult;
00249 }
00250
00251 //---------------------------------------------------------------------------
00252 //  This method not used in MMC20
00253 //
00254 STDMETHODIMP CComponent::GetResultViewType
00255 (
00256   MMC_COOKIE          nCookie,     //[in]  Indentifier of selected node
00257   LPOLESTR __RPC_FAR* ppViewType,  //[out] Points to view type string
00258   long __RPC_FAR*     pViewOptions //[out] Points to MMC_VIEW_OPTIONS enumeration
00259 )
00260 {
00261   _ASSERT( FALSE );                // This should never be called in 2.0
00262   return E_NOTIMPL;
00263 }
00264
00265
00266 //---------------------------------------------------------------------------
00267 STDMETHODIMP CComponent::GetDisplayInfo
00268 (
00269   RESULTDATAITEM __RPC_FAR* pResultDataItem  //[in-out] Result item struct
00270 )
00271 {
00272   _ASSERT( NULL != pResultDataItem );
00273   _ASSERT( NULL != pResultDataItem->lParam );
00274
00275   HRESULT  hResult = S_FALSE;
00276
00277   LPBASENODE pNode = reinterpret_cast<LPBASENODE>(pResultDataItem->lParam);
00278   hResult = pNode->GetDisplayInfo( pResultDataItem );
00279
00280   //TRACE_HRESULT( _T("GetDisplayInfo"), hResult );
00281   return hResult;
00282 }
00283
00284 //---------------------------------------------------------------------------
00285 STDMETHODIMP CComponent::CompareObjects
00286 (
00287   LPDATAOBJECT ipDataObjectA,    //[in] First data object to compare
00288   LPDATAOBJECT ipDataObjectB     //[in] Second data object to compare
00289 )
00290 {
00291   HRESULT hResult = S_FALSE;
00292
00293   CDataObject* pDO_A = ExtractDataObjPtr( ipDataObjectA );
00294   CDataObject* pDO_B = ExtractDataObjPtr( ipDataObjectB );
00295   if( NULL == pDO_A || NULL == pDO_B )
00296     return hResult;
00297
00298   (pDO_A->GetCookie() == pDO_B->GetCookie()) ? hResult = S_OK : hResult = S_FALSE;
00299
00300   return hResult;
00301 }
00302
00303 //---------------------------------------------------------------------------
00304 HRESULT CComponent::QueryDispatch
00305 (
00306   MMC_COOKIE         nCookie,    //[in]  Item for which IDispatch is requested
00307   DATA_OBJECT_TYPES  eType,      //[in]  Context of item
00308   LPDISPATCH*        pipDispatch //[out] IDispatch pointer
00309 )
00310 {
00311   return E_NOTIMPL;
00312 }
00313
00314 //---------------------------------------------------------------------------
00315 //  NOTE:  Failure to correctly implement this method will result in
00316 //         the error:  "Snap-in failed to initialize"
00317 //
00318 HRESULT CComponent::GetResultViewType2
00319 (
00320   MMC_COOKIE             nCookie,  //[in] Identifier of object
00321   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00322 )
00323 {
00324   HRESULT hResult = S_FALSE;
00325
00326   if( NULL == nCookie )
00327   {
00328     CStaticNode* pNode = m_pComponentData->GetStaticNode();
00329     hResult = pNode->GetResultViewType2( nCookie, pRVTinfo );
00330   }
00331   else
00332   {
00333     CBaseNode* pNode = reinterpret_cast<CBaseNode*>(nCookie);
00334     hResult = pNode->GetResultViewType2( nCookie, pRVTinfo );
00335   }
00336
00337   TRACE_HRESULT(_T("GetResultViewType2"), hResult );
00338   return hResult;
00339 }
00340
00341
00342 //---------------------------------------------------------------------------
00343 HRESULT CComponent::RestoreResultView
00344 (
00345   MMC_COOKIE             nCookie,  //[in] Identifier of object
00346   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00347 )
00348 {
00349   return E_NOTIMPL;
00350 }
00351
00352 /////////////////////////////////////////////////////////////////////////////
00353 //  IExtendPropertySheet2
00354
00355
00356 //---------------------------------------------------------------------------
00357 //  PROPPAGE:  Nodes own their own property pages so we delegate creating
00358 //             the pages.
00359 //
00360 STDMETHODIMP CComponent::CreatePropertyPages
00361 (
00362   LPPROPERTYSHEETCALLBACK lpProvider,  //[in] Pointer to callback interface
00363   LONG_PTR                Handle,      //[in] Handle for routing notification
00364   LPDATAOBJECT            ipDataObject //[in] Pointer to data object
00365 )
00366 {
00367   _ASSERT( NULL != ipDataObject );
00368   HRESULT hResult = S_FALSE;
00369
00370   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00371   if( NULL == pNode )
00372     return E_FAIL;
00373
00374   return pNode->CreatePropertyPages( lpProvider, Handle );
00375
00376 }
00377
00378 //---------------------------------------------------------------------------
00379 //  PROPPAGE:  If the Property Page verb is enabled, the console will call
00380 //             this method to see if the node has a propery page to add.
00381 //
00382 STDMETHODIMP CComponent::QueryPagesFor
00383 (
00384   LPDATAOBJECT ipDataObject  //[in] Pointer to selected data object
00385 )
00386 {
00387   _ASSERT( NULL != ipDataObject );
00388   HRESULT hResult = S_FALSE;
00389
00390   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00391   if( NULL == pNode )
00392     return E_FAIL;
00393
00394   return pNode->QueryForPropertyPage();
00395
00396 }
00397
00398 //---------------------------------------------------------------------------
00399 STDMETHODIMP CComponent::GetWatermarks
00400 (
00401   LPDATAOBJECT        ipDataObject,  //[in]  Pointer to data object
00402   HBITMAP __RPC_FAR*  lphWatermark,  //[out] Pointer to watermark bitmap
00403   HBITMAP __RPC_FAR*  lphHeader,     //[out] Pointer to header bitmap
00404   HPALETTE __RPC_FAR* lphPalette,    //[out] Pointer to palette
00405   BOOL __RPC_FAR*     bStretch       //[out] TRUE to stretch instead of tile
00406 )
00407 {
00408   _ASSERT( NULL != ipDataObject );
00409   HRESULT hResult = S_FALSE;
00410
00411
00412   return hResult;
00413 }
00414
00415 /////////////////////////////////////////////////////////////////////////////
00416 //  Notification handlers
00417
00418
00419 //---------------------------------------------------------------------------
00420 HRESULT CComponent::OnAddImages
00421 (
00422   LPDATAOBJECT   ipDataObject, //[in] Points to the selected data object
00423   LPARAM         nArg,         //[in] Pointer to IImageList
00424   LPARAM         nParam        //[in] HSCOPEITEM of selected/deselected item
00425
00426 )
00427 {
00428   HRESULT hResult = S_FALSE;
00429
00430   if( NULL != nArg )           // May get this when shutting down
00431   {
00432     IImageList* ipImageList = reinterpret_cast<IImageList*>(nArg);
00433     hResult = ipImageList->ImageListSetStrip( (LONG_PTR*)m_hImageStrip16,
00434                                               (LONG_PTR*)m_hImageStrip32,
00435                                               0,
00436                                               RGB(0,255,0)
00437                                             );
00438   }
00439   TRACE_HRESULT(_T("OnAddImages"), hResult );
00440   return hResult;
00441
00442 }
00443
00444 /////////////////////////////////////////////////////////////////////////////
00445 //  Public helper methods
00446
00447 //---------------------------------------------------------------------------
00448 //  Supplies interfaces to node objects.
00449 //
00450 HRESULT CComponent::GetInterface
00451 (
00452   DWORD dwRequestedInterface,  //[in] Request flag
00453   LONG_PTR* ppInterface        //[in-out] Interface pointer to return
00454 )
00455 {
00456   _ASSERT( NULL != ppInterface );
00457   HRESULT hResult = S_OK;
00458
00459   switch( dwRequestedInterface )
00460   {
00461     case REQUEST_ICONSOLE:
00462       _ASSERT( NULL != m_ipConsole );
00463       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsole);
00464       break;
00465
00466     case REQUEST_ICONSOLEVERB:
00467       _ASSERT( NULL != m_ipConsoleVerb );
00468       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsoleVerb);
00469       break;
00470
00471     case REQUEST_IRESULTDATA:
00472       _ASSERT( NULL != m_ipResultData );
00473       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipResultData);
00474       break;
00475
00476     case REQUEST_IHEADERCTRL2:
00477       _ASSERT( NULL != m_ipHeaderCtrl2 );
00478       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipHeaderCtrl2);
00479       break;
00480
00481     case REQUEST_IDISPLAYHELP:
00482       _ASSERT( NULL != m_ipDisplayHelp );
00483       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipDisplayHelp);
00484       break;
00485
00486     default:
00487       hResult = S_FALSE;
00488       *ppInterface = NULL;
00489       break;
00490   }
00491   return hResult;
00492 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/DeskBand.Cpp Source File

  • WinUI
  • Shell
  • BandObjs

DeskBand.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DeskBand.cpp
00013
00014    Description:   Implements CDeskBand
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "DeskBand.h"
00023 #include "Guid.h"
00024
00025 /**************************************************************************
00026
00027    CDeskBand::CDeskBand()
00028
00029 **************************************************************************/
00030
00031 CDeskBand::CDeskBand()
00032 {
00033   m_pSite = NULL;
00034
00035   m_hWnd = NULL;
00036   m_hwndParent = NULL;
00037
00038   m_bFocus = FALSE;
00039
00040   m_dwViewMode = 0;
00041   m_dwBandID = 0;
00042
00043   m_ObjRefCount = 1;
00044   g_DllRefCount++;
00045 }
00046
00047 /**************************************************************************
00048
00049    CDeskBand::~CDeskBand()
00050
00051 **************************************************************************/
00052
00053 CDeskBand::~CDeskBand()
00054 {
00055   //this should have been freed in a call to SetSite(NULL), but just to be safe
00056   if(m_pSite)
00057     {
00058       m_pSite->Release();
00059       m_pSite = NULL;
00060     }
00061
00062   g_DllRefCount--;
00063 }
00064
00065 ///////////////////////////////////////////////////////////////////////////
00066 //
00067 // IUnknown Implementation
00068 //
00069
00070 /**************************************************************************
00071
00072    CDeskBand::QueryInterface
00073
00074 **************************************************************************/
00075
00076 STDMETHODIMP CDeskBand::QueryInterface(REFIID riid, LPVOID *ppReturn)
00077 {
00078   *ppReturn = NULL;
00079
00080   //IUnknown
00081   if(IsEqualIID(riid, IID_IUnknown))
00082     {
00083       *ppReturn = this;
00084     }
00085
00086   //IOleWindow
00087   else if(IsEqualIID(riid, IID_IOleWindow))
00088     {
00089       *ppReturn = (IOleWindow*)this;
00090     }
00091
00092   //IDockingWindow
00093   else if(IsEqualIID(riid, IID_IDockingWindow))
00094     {
00095       *ppReturn = (IDockingWindow*)this;
00096     }
00097
00098   //IInputObject
00099   else if(IsEqualIID(riid, IID_IInputObject))
00100     {
00101       *ppReturn = (IInputObject*)this;
00102     }
00103
00104   //IObjectWithSite
00105   else if(IsEqualIID(riid, IID_IObjectWithSite))
00106     {
00107       *ppReturn = (IObjectWithSite*)this;
00108     }
00109
00110   //IDeskBand
00111   else if(IsEqualIID(riid, IID_IDeskBand))
00112     {
00113       *ppReturn = (IDeskBand*)this;
00114     }
00115
00116   //IPersist
00117   else if(IsEqualIID(riid, IID_IPersist))
00118     {
00119       *ppReturn = (IPersist*)this;
00120     }
00121
00122   //IPersistStream
00123   else if(IsEqualIID(riid, IID_IPersistStream))
00124     {
00125       *ppReturn = (IPersistStream*)this;
00126     }
00127
00128   //IContextMenu
00129   else if(IsEqualIID(riid, IID_IContextMenu))
00130     {
00131       *ppReturn = (IContextMenu*)this;
00132     }
00133
00134   if(*ppReturn)
00135     {
00136       (*(LPUNKNOWN*)ppReturn)->AddRef();
00137       return S_OK;
00138     }
00139
00140   return E_NOINTERFACE;
00141 }
00142
00143 /**************************************************************************
00144
00145    CDeskBand::AddRef
00146
00147 **************************************************************************/
00148
00149 STDMETHODIMP_(DWORD) CDeskBand::AddRef()
00150 {
00151   return ++m_ObjRefCount;
00152 }
00153
00154
00155 /**************************************************************************
00156
00157    CDeskBand::Release
00158
00159 **************************************************************************/
00160
00161 STDMETHODIMP_(DWORD) CDeskBand::Release()
00162 {
00163   if(--m_ObjRefCount == 0)
00164     {
00165       delete this;
00166       return 0;
00167     }
00168
00169   return m_ObjRefCount;
00170 }
00171
00172 ///////////////////////////////////////////////////////////////////////////
00173 //
00174 // IOleWindow Implementation
00175 //
00176
00177 /**************************************************************************
00178
00179    CDeskBand::GetWindow()
00180
00181 **************************************************************************/
00182
00183 STDMETHODIMP CDeskBand::GetWindow(HWND *phWnd)
00184 {
00185   *phWnd = m_hWnd;
00186
00187   return S_OK;
00188 }
00189
00190 /**************************************************************************
00191
00192    CDeskBand::ContextSensitiveHelp()
00193
00194 **************************************************************************/
00195
00196 STDMETHODIMP CDeskBand::ContextSensitiveHelp(BOOL fEnterMode)
00197 {
00198   return E_NOTIMPL;
00199 }
00200
00201 ///////////////////////////////////////////////////////////////////////////
00202 //
00203 // IDockingWindow Implementation
00204 //
00205
00206 /**************************************************************************
00207
00208    CDeskBand::ShowDW()
00209
00210 **************************************************************************/
00211
00212 STDMETHODIMP CDeskBand::ShowDW(BOOL fShow)
00213 {
00214   if(m_hWnd)
00215     {
00216       if(fShow)
00217   {
00218     //show our window
00219     ShowWindow(m_hWnd, SW_SHOW);
00220   }
00221       else
00222   {
00223     //hide our window
00224     ShowWindow(m_hWnd, SW_HIDE);
00225   }
00226     }
00227
00228   return S_OK;
00229 }
00230
00231 /**************************************************************************
00232
00233    CDeskBand::CloseDW()
00234
00235 **************************************************************************/
00236
00237 STDMETHODIMP CDeskBand::CloseDW(DWORD dwReserved)
00238 {
00239   ShowDW(FALSE);
00240
00241   if(IsWindow(m_hWnd))
00242     DestroyWindow(m_hWnd);
00243
00244   m_hWnd = NULL;
00245
00246   return S_OK;
00247 }
00248
00249 /**************************************************************************
00250
00251    CDeskBand::ResizeBorderDW()
00252
00253 **************************************************************************/
00254
00255 STDMETHODIMP CDeskBand::ResizeBorderDW(   LPCRECT prcBorder,
00256                                           IUnknown* punkSite,
00257                                           BOOL fReserved)
00258 {
00259   /*
00260     This method is never called for Band Objects.
00261 */
00262   return E_NOTIMPL;
00263 }
00264
00265 ///////////////////////////////////////////////////////////////////////////
00266 //
00267 // IInputObject Implementation
00268 //
00269
00270 /**************************************************************************
00271
00272    CDeskBand::UIActivateIO()
00273
00274 **************************************************************************/
00275
00276 STDMETHODIMP CDeskBand::UIActivateIO(BOOL fActivate, LPMSG pMsg)
00277 {
00278   if(fActivate)
00279     SetFocus(m_hWnd);
00280
00281   return S_OK;
00282 }
00283
00284 /**************************************************************************
00285
00286    CDeskBand::HasFocusIO()
00287
00288    If this window or one of its decendants has the focus, return S_OK. Return
00289    S_FALSE if we don't have the focus.
00290
00291 **************************************************************************/
00292
00293 STDMETHODIMP CDeskBand::HasFocusIO(void)
00294 {
00295   if(m_bFocus)
00296     return S_OK;
00297
00298   return S_FALSE;
00299 }
00300
00301 /**************************************************************************
00302
00303    CDeskBand::TranslateAcceleratorIO()
00304
00305    If the accelerator is translated, return S_OK or S_FALSE otherwise.
00306
00307 **************************************************************************/
00308
00309 STDMETHODIMP CDeskBand::TranslateAcceleratorIO(LPMSG pMsg)
00310 {
00311   return S_FALSE;
00312 }
00313
00314 ///////////////////////////////////////////////////////////////////////////
00315 //
00316 // IObjectWithSite implementations
00317 //
00318
00319 /**************************************************************************
00320
00321    CDeskBand::SetSite()
00322
00323 **************************************************************************/
00324
00325 STDMETHODIMP CDeskBand::SetSite(IUnknown* punkSite)
00326 {
00327   //If a site is being held, release it.
00328   if(m_pSite)
00329     {
00330       m_pSite->Release();
00331       m_pSite = NULL;
00332     }
00333
00334   //If punkSite is not NULL, a new site is being set.
00335   if(punkSite)
00336     {
00337       //Get the parent window.
00338       IOleWindow  *pOleWindow;
00339
00340       m_hwndParent = NULL;
00341
00342       if(SUCCEEDED(punkSite->QueryInterface(IID_IOleWindow, (LPVOID*)&pOleWindow)))
00343   {
00344     pOleWindow->GetWindow(&m_hwndParent);
00345     pOleWindow->Release();
00346   }
00347
00348       if(!m_hwndParent)
00349   return E_FAIL;
00350
00351       if(!RegisterAndCreateWindow())
00352   return E_FAIL;
00353
00354    //Get and keep the IInputObjectSite pointer.
00355       if(SUCCEEDED(punkSite->QueryInterface(IID_IInputObjectSite, (LPVOID*)&m_pSite)))
00356   {
00357     return S_OK;
00358   }
00359
00360       return E_FAIL;
00361     }
00362
00363   return S_OK;
00364 }
00365
00366 /**************************************************************************
00367
00368    CDeskBand::GetSite()
00369
00370 **************************************************************************/
00371
00372 STDMETHODIMP CDeskBand::GetSite(REFIID riid, LPVOID *ppvReturn)
00373 {
00374   *ppvReturn = NULL;
00375
00376   if(m_pSite)
00377     return m_pSite->QueryInterface(riid, ppvReturn);
00378
00379   return E_FAIL;
00380 }
00381
00382 ///////////////////////////////////////////////////////////////////////////
00383 //
00384 // IDeskBand implementation
00385 //
00386
00387 /**************************************************************************
00388
00389    CDeskBand::GetBandInfo()
00390
00391 **************************************************************************/
00392
00393 STDMETHODIMP CDeskBand::GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi)
00394 {
00395   if(pdbi)
00396     {
00397       m_dwBandID = dwBandID;
00398       m_dwViewMode = dwViewMode;
00399
00400       if(pdbi->dwMask & DBIM_MINSIZE)
00401   {
00402     if(DBIF_VIEWMODE_FLOATING & dwViewMode)
00403       {
00404         pdbi->ptMinSize.x = 200;
00405         pdbi->ptMinSize.y = 400;
00406       }
00407     else
00408       {
00409         pdbi->ptMinSize.x = DB_MIN_SIZE_X;
00410         pdbi->ptMinSize.y = DB_MIN_SIZE_Y;
00411       }
00412   }
00413
00414       if(pdbi->dwMask & DBIM_MAXSIZE)
00415   {
00416     pdbi->ptMaxSize.x = -1;
00417     pdbi->ptMaxSize.y = -1;
00418   }
00419
00420       if(pdbi->dwMask & DBIM_INTEGRAL)
00421   {
00422     pdbi->ptIntegral.x = 1;
00423     pdbi->ptIntegral.y = 1;
00424   }
00425
00426       if(pdbi->dwMask & DBIM_ACTUAL)
00427   {
00428     pdbi->ptActual.x = 100;
00429     pdbi->ptActual.y = 100;
00430   }
00431
00432       if(pdbi->dwMask & DBIM_TITLE)
00433   {
00434     lstrcpyW(pdbi->wszTitle, L"Sample Desk Band");
00435   }
00436
00437       if(pdbi->dwMask & DBIM_MODEFLAGS)
00438   {
00439     pdbi->dwModeFlags = DBIMF_NORMAL;
00440
00441     pdbi->dwModeFlags |= DBIMF_VARIABLEHEIGHT;
00442   }
00443
00444       if(pdbi->dwMask & DBIM_BKCOLOR)
00445   {
00446     //Use the default background color by removing this flag.
00447     pdbi->dwMask &= ~DBIM_BKCOLOR;
00448   }
00449
00450       return S_OK;
00451     }
00452
00453   return E_INVALIDARG;
00454 }
00455
00456 ///////////////////////////////////////////////////////////////////////////
00457 //
00458 // IPersistStream implementations
00459 //
00460 // This is only supported to allow the desk band to be dropped on the
00461 // desktop and to prevent multiple instances of the desk band from showing
00462 // up in the context menu. This desk band doesn't actually persist any data.
00463 //
00464
00465 /**************************************************************************
00466
00467    CDeskBand::GetClassID()
00468
00469 **************************************************************************/
00470
00471 STDMETHODIMP CDeskBand::GetClassID(LPCLSID pClassID)
00472 {
00473   *pClassID = CLSID_SampleDeskBand;
00474
00475   return S_OK;
00476 }
00477
00478 /**************************************************************************
00479
00480    CDeskBand::IsDirty()
00481
00482 **************************************************************************/
00483
00484 STDMETHODIMP CDeskBand::IsDirty(void)
00485 {
00486   return S_FALSE;
00487 }
00488
00489 /**************************************************************************
00490
00491    CDeskBand::Load()
00492
00493 **************************************************************************/
00494
00495 STDMETHODIMP CDeskBand::Load(LPSTREAM pStream)
00496 {
00497   return S_OK;
00498 }
00499
00500 /**************************************************************************
00501
00502    CDeskBand::Save()
00503
00504 **************************************************************************/
00505
00506 STDMETHODIMP CDeskBand::Save(LPSTREAM pStream, BOOL fClearDirty)
00507 {
00508   return S_OK;
00509 }
00510
00511 /**************************************************************************
00512
00513    CDeskBand::GetSizeMax()
00514
00515 **************************************************************************/
00516
00517 STDMETHODIMP CDeskBand::GetSizeMax(ULARGE_INTEGER *pul)
00518 {
00519   return E_NOTIMPL;
00520 }
00521
00522 ///////////////////////////////////////////////////////////////////////////
00523 //
00524 // IContextMenu Implementation
00525 //
00526
00527 /**************************************************************************
00528
00529    CDeskBand::QueryContextMenu()
00530
00531 **************************************************************************/
00532
00533 STDMETHODIMP CDeskBand::QueryContextMenu( HMENU hMenu,
00534                                           UINT indexMenu,
00535                                           UINT idCmdFirst,
00536                                           UINT idCmdLast,
00537                                           UINT uFlags)
00538 {
00539   if(!(CMF_DEFAULTONLY & uFlags))
00540     {
00541       InsertMenu( hMenu,
00542       indexMenu,
00543       MF_STRING | MF_BYPOSITION,
00544       idCmdFirst + IDM_COMMAND,
00545       "&Desk Band Command");
00546
00547       return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(IDM_COMMAND + 1));
00548     }
00549
00550   return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(0));
00551 }
00552
00553 /**************************************************************************
00554
00555    CDeskBand::InvokeCommand()
00556
00557 **************************************************************************/
00558
00559 STDMETHODIMP CDeskBand::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
00560 {
00561   switch (LOWORD(lpcmi->lpVerb))
00562     {
00563     case IDM_COMMAND:
00564       MessageBox(lpcmi->hwnd, TEXT("Desk Band Command selected."), TEXT("Sample Desk Band"), MB_OK | MB_ICONINFORMATION);
00565       break;
00566
00567     default:
00568       return E_INVALIDARG;
00569     }
00570
00571   return NOERROR;
00572 }
00573
00574 /**************************************************************************
00575
00576    CDeskBand::GetCommandString()
00577
00578 **************************************************************************/
00579
00580 STDMETHODIMP CDeskBand::GetCommandString( UINT_PTR idCommand,
00581                                           UINT uFlags,
00582                                           LPUINT lpReserved,
00583                                           LPSTR lpszName,
00584                                           UINT uMaxNameLen)
00585 {
00586   HRESULT  hr = E_INVALIDARG;
00587
00588   switch(uFlags)
00589     {
00590     case GCS_HELPTEXT:
00591       switch(idCommand)
00592   {
00593   case IDM_COMMAND:
00594     lstrcpyn(lpszName, TEXT("Desk Band command help text"), uMaxNameLen);
00595     hr = NOERROR;
00596     break;
00597   }
00598       break;
00599
00600     case GCS_VERB:
00601       switch(idCommand)
00602   {
00603   case IDM_COMMAND:
00604     lstrcpyn(lpszName, TEXT("command"), uMaxNameLen);
00605     hr = NOERROR;
00606     break;
00607   }
00608       break;
00609
00610     case GCS_VALIDATE:
00611       hr = NOERROR;
00612       break;
00613     }
00614
00615   return hr;
00616 }
00617
00618 ///////////////////////////////////////////////////////////////////////////
00619 //
00620 // private method implementations
00621 //
00622
00623 /**************************************************************************
00624
00625    CDeskBand::WndProc()
00626
00627 **************************************************************************/
00628
00629 LRESULT CALLBACK CDeskBand::WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
00630 {
00631   CDeskBand  *pThis = (CDeskBand*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
00632
00633   switch (uMessage)
00634     {
00635     case WM_NCCREATE:
00636       {
00637   LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00638   pThis = (CDeskBand*)(lpcs->lpCreateParams);
00639   SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pThis);
00640
00641   //set the window handle
00642   pThis->m_hWnd = hWnd;
00643       }
00644       break;
00645
00646     case WM_PAINT:
00647       return pThis->OnPaint();
00648
00649     case WM_COMMAND:
00650       return pThis->OnCommand(wParam, lParam);
00651
00652     case WM_SETFOCUS:
00653       return pThis->OnSetFocus();
00654
00655     case WM_KILLFOCUS:
00656       return pThis->OnKillFocus();
00657
00658     case WM_SIZE:
00659       return pThis->OnSize(lParam);
00660     }
00661
00662   return DefWindowProc(hWnd, uMessage, wParam, lParam);
00663 }
00664
00665 /**************************************************************************
00666
00667    CDeskBand::OnPaint()
00668
00669 **************************************************************************/
00670
00671 LRESULT CDeskBand::OnPaint(void)
00672 {
00673   PAINTSTRUCT ps;
00674   RECT        rc;
00675
00676   BeginPaint(m_hWnd, &ps);
00677
00678   GetClientRect(m_hWnd, &rc);
00679   SetTextColor(ps.hdc, RGB(0, 0, 0));
00680   SetBkMode(ps.hdc, TRANSPARENT);
00681   DrawText(ps.hdc, TEXT("Sample Desk Band"), -1, &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
00682
00683   EndPaint(m_hWnd, &ps);
00684
00685   return 0;
00686 }
00687
00688 /**************************************************************************
00689
00690    CDeskBand::OnCommand()
00691
00692 **************************************************************************/
00693
00694 LRESULT CDeskBand::OnCommand(WPARAM wParam, LPARAM lParam)
00695 {
00696   return 0;
00697 }
00698
00699 /**************************************************************************
00700
00701    CDeskBand::OnSize()
00702
00703 **************************************************************************/
00704
00705 LRESULT CDeskBand::OnSize(LPARAM lParam)
00706 {
00707   int   cx, cy;
00708
00709   cx = LOWORD(lParam);
00710   cy = HIWORD(lParam);
00711   return 0;
00712 }
00713
00714 /**************************************************************************
00715
00716    CDeskBand::FocusChange()
00717
00718 **************************************************************************/
00719
00720 void CDeskBand::FocusChange(BOOL bFocus)
00721 {
00722   m_bFocus = bFocus;
00723
00724   //inform the input object site that the focus has changed
00725   if(m_pSite)
00726     {
00727       m_pSite->OnFocusChangeIS((IDockingWindow*)this, bFocus);
00728     }
00729 }
00730
00731 /**************************************************************************
00732
00733    CDeskBand::OnSetFocus()
00734
00735 **************************************************************************/
00736
00737 LRESULT CDeskBand::OnSetFocus(void)
00738 {
00739   FocusChange(TRUE);
00740
00741   return 0;
00742 }
00743
00744 /**************************************************************************
00745
00746    CDeskBand::OnKillFocus()
00747
00748 **************************************************************************/
00749
00750 LRESULT CDeskBand::OnKillFocus(void)
00751 {
00752   FocusChange(FALSE);
00753
00754   return 0;
00755 }
00756
00757 /**************************************************************************
00758
00759    CDeskBand::RegisterAndCreateWindow()
00760
00761 **************************************************************************/
00762
00763 BOOL CDeskBand::RegisterAndCreateWindow(void)
00764 {
00765   //If the window doesn't exist yet, create it now.
00766   if(!m_hWnd)
00767     {
00768       //Can't create a child window without a parent.
00769       if(!m_hwndParent)
00770   {
00771     return FALSE;
00772   }
00773
00774       //If the window class has not been registered, then do so.
00775       WNDCLASS wc;
00776       if(!GetClassInfo(g_hInst, DB_CLASS_NAME, &wc))
00777   {
00778     ZeroMemory(&wc, sizeof(wc));
00779     wc.style          = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
00780     wc.lpfnWndProc    = (WNDPROC)WndProc;
00781     wc.cbClsExtra     = 0;
00782     wc.cbWndExtra     = 0;
00783     wc.hInstance      = g_hInst;
00784     wc.hIcon          = NULL;
00785     wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00786     wc.hbrBackground  = (HBRUSH)CreateSolidBrush(RGB(192, 0, 0));
00787     wc.lpszMenuName   = NULL;
00788     wc.lpszClassName  = DB_CLASS_NAME;
00789
00790     if(!RegisterClass(&wc))
00791       {
00792         //If RegisterClass fails, CreateWindow below will fail.
00793       }
00794   }
00795
00796       RECT  rc;
00797
00798       GetClientRect(m_hwndParent, &rc);
00799
00800       //Create the window. The WndProc will set m_hWnd.
00801       CreateWindowEx(   0,
00802       DB_CLASS_NAME,
00803       NULL,
00804       WS_CHILD | WS_CLIPSIBLINGS | WS_BORDER,
00805       rc.left,
00806       rc.top,
00807       rc.right - rc.left,
00808       rc.bottom - rc.top,
00809       m_hwndParent,
00810       NULL,
00811       g_hInst,
00812       (LPVOID)this);
00813
00814     }
00815
00816   return (NULL != m_hWnd);
00817 }
00818
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPersistFile Member List

This is the complete list of members for CPersistFile, including all inherited members.
CPersistFile(COleDocument *, CPersistStorage *) | CPersistFile |
GetClassID(LPCLSID) | CPersistFile |
GetCurFile(LPOLESTR *) | CPersistFile |
IsDirty(void) | CPersistFile |
Load(LPCOLESTR, DWORD) | CPersistFile |
m_pOleDoc | CPersistFile | [private]
m_pPersistStorage | CPersistFile | [private]
m_pStorage | CPersistFile | [private]
m_pwszFile | CPersistFile | [private]
QueryInterface(REFIID, LPVOID *) | CPersistFile |
Save(LPCOLESTR, BOOL) | CPersistFile |
SaveCompleted(LPCOLESTR) | CPersistFile |
STDMETHODIMP_(ULONG) AddRef() | CPersistFile |
STDMETHODIMP_(ULONG) Release() | CPersistFile |
~CPersistFile() | CPersistFile |
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/StdAfx.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

StdAfx.Cpp

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 // stdafx.cpp : source file that includes just the standard includes
00003 //  CmdLineConsumer.pch will be the pre-compiled header
00004 //  stdafx.obj will contain the pre-compiled type information
00005
00006 #include "stdafx.h"
00007
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/ToolBar.c Source File

  • WinUI
  • Input
  • Ime
  • IMEApps

ToolBar.c

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      TOOLBAR.C                                                     */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation                */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <commctrl.h>
00011 #include "resource.h"
00012 #include "imeapps.h"
00013
00014 // Global Variables for toolbar control.
00015
00016
00017 #define NUMIMAGES       33
00018 #define IMAGEWIDTH      16
00019 #define IMAGEHEIGHT     17
00020 #define BUTTONWIDTH     0
00021 #define BUTTONHEIGHT    0
00022
00023 #define IDTBB_FONT       0
00024 #define IDTBB_OPEN       1
00025 #define IDTBB_CLOSE      2
00026 #define IDTBB_MODE       3
00027 #define IDTBB_SHOWCAND   4
00028 #define IDTBB_NOSHOWCAND 5
00029 #define IDTBB_CONVERT    6
00030 #define IDTBB_CANCEL     7
00031 #define IDTBB_REVERT     8
00032 #define IDTBB_COMPLETE   9
00033 #define IDTBB_NEXTCAND   10
00034 #define IDTBB_PREVCAND   11
00035 #define IDTBB_NEXTCLAUSE 12
00036 #define IDTBB_PREVCLAUSE 13
00037 #define IDTBB_OPENCAND   14
00038 #define IDTBB_CLOSECAND  15
00039 #define IDTBB_ALPHA      16
00040 #define IDTBB_NATIVE     17
00041 #define IDTBB_KATAKANA   18
00042 #define IDTBB_FULL       19
00043 #define IDTBB_HALF       20
00044 #define IDTBB_ROMAN      21
00045 #define IDTBB_NOROMAN    22
00046 #define IDTBB_CHARCODE   23
00047 #define IDTBB_NOCHARCODE 24
00048 #define IDTBB_HANJA      25
00049 #define IDTBB_NOHANJA    26
00050 #define IDTBB_SOFTKBD    27
00051 #define IDTBB_NOSOFTKBD  28
00052 #define IDTBB_EUDC       29
00053 #define IDTBB_NOEUDC     30
00054 #define IDTBB_SYMBOL     31
00055 #define IDTBB_NOSYMBOL   32
00056
00057 TBBUTTON tbButton[] =           // Array defining the toolbar buttons
00058 {
00059     {IDTBB_FONT, IDM_FONT,          TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00060
00061     {0, 0,                          TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0},
00062
00063     {IDTBB_OPEN, IDM_OPENSTATUS,    TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00064
00065     {0, 0,                          TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0},
00066
00067     {IDTBB_NATIVE,   IDM_NATIVEMODE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00068     {IDTBB_FULL,     IDM_FULLHALF,   TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00069     {IDTBB_ROMAN,    IDM_ROMAN,      TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00070     {IDTBB_CHARCODE, IDM_CHARCODE,   TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00071     {IDTBB_HANJA,    IDM_HANJA,      TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00072     {IDTBB_SOFTKBD,  IDM_SOFTKBD,    TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00073     {IDTBB_EUDC,     IDM_EUDC,       TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00074     {IDTBB_SYMBOL,   IDM_SYMBOL,     TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00075
00076     {0, 0,                          TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0},
00077
00078     {IDTBB_CONVERT,  IDM_CONVERT,   TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00079     {IDTBB_CANCEL,   IDM_CANCEL,    TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00080     {IDTBB_REVERT,   IDM_REVERT,    TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00081     {IDTBB_COMPLETE, IDM_COMPLETE,  TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00082
00083     {0, 0,                          TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0},
00084
00085     {IDTBB_NEXTCLAUSE, IDM_NEXTCLAUSE,  TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00086     {IDTBB_PREVCLAUSE, IDM_PREVCLAUSE,  TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00087
00088     {0, 0,                          TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0},
00089
00090     {IDTBB_SHOWCAND, IDM_SHOWCAND,  TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00091     {IDTBB_OPENCAND, IDM_OPENCAND,  TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00092     {IDTBB_CLOSECAND,IDM_CLOSECAND, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00093     {IDTBB_NEXTCAND, IDM_NEXTCAND,  TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00094     {IDTBB_PREVCAND, IDM_PREVCAND,  TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00095
00096
00097 };
00098
00099
00100 BOOL CreateTBar(HWND hWnd)
00101 {
00102     HIMC hIMC = NULL;
00103     BOOL fOpen;
00104
00105     hWndToolBar = CreateToolbarEx(hWnd,
00106                                   WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS,
00107                                   TOOLBAR_ID,
00108                                   NUMIMAGES,
00109                                   hInst,
00110                                   IDB_BMP,
00111                                   tbButton,
00112                                   sizeof(tbButton)/sizeof(TBBUTTON),
00113                                   BUTTONWIDTH,
00114                                   BUTTONHEIGHT,
00115                                   IMAGEWIDTH,
00116                                   IMAGEHEIGHT,
00117                                   sizeof(TBBUTTON));
00118
00119     UpdateShowCandButton();
00120
00121     hIMC = ImmGetContext(hWndCompStr);
00122     fOpen = ImmGetOpenStatus(hIMC);
00123     UpdateShowOpenStatusButton(fOpen);
00124     ImmReleaseContext(hWndCompStr,hIMC);
00125
00126     return (hWndToolBar != 0);
00127 }
00128
00129
00130 LRESULT SetTooltipText(HWND hWnd, LPARAM lParam)
00131 {
00132     LPTOOLTIPTEXT lpToolTipText = NULL;
00133     static char   szBuffer[64];
00134
00135     lpToolTipText = (LPTOOLTIPTEXT)lParam;
00136     if (lpToolTipText->hdr.code == TTN_NEEDTEXT)
00137     {
00138         LoadString(hInst,
00139                    (UINT)lpToolTipText->hdr.idFrom,   // string ID == command ID
00140                    szBuffer,
00141                    (int)sizeof(szBuffer));
00142
00143         lpToolTipText->lpszText = szBuffer;
00144     }
00145     return 0;
00146 }
00147
00148 void UpdateButton(UINT iID, UINT iFlags)
00149 {
00150     int iCurrentFlags;
00151
00152     iCurrentFlags = (int)SendMessage(hWndToolBar,
00153                                      TB_GETSTATE,
00154                                      iID, 0L);
00155
00156     if (iCurrentFlags & TBSTATE_PRESSED)
00157     {
00158         iFlags |= TBSTATE_PRESSED;
00159     }
00160
00161     SendMessage(hWndToolBar,
00162                 TB_SETSTATE,
00163                 iID,
00164                 MAKELPARAM(iFlags, 0));
00165     return;
00166 }
00167
00168 void UpdateShowOpenStatusButton(BOOL fOpen)
00169 {
00170
00171     SendMessage(hWndToolBar,
00172                 TB_CHANGEBITMAP,
00173                 IDM_OPENSTATUS,
00174                 MAKELPARAM((fOpen ? IDTBB_OPEN : IDTBB_CLOSE), 0));
00175     return;
00176 }
00177
00178 void UpdateShowCandButton()
00179 {
00180
00181     SendMessage(hWndToolBar,
00182                 TB_CHANGEBITMAP,
00183                 IDM_SHOWCAND,
00184                 MAKELPARAM((fShowCand ? IDTBB_SHOWCAND : IDTBB_NOSHOWCAND), 0));
00185     return;
00186 }
00187
00188
00189 void UpdateModeButton(DWORD dwConv)
00190 {
00191     int nIDTBB;
00192
00193     switch (dwConv & IME_CMODE_LANGUAGE)
00194     {
00195         case IME_CMODE_ALPHANUMERIC:
00196             nIDTBB = IDTBB_ALPHA;
00197             break;
00198
00199         case IME_CMODE_NATIVE:
00200             nIDTBB = IDTBB_NATIVE;
00201             break;
00202
00203         case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA):
00204             nIDTBB = IDTBB_KATAKANA;
00205             break;
00206
00207         default:
00208             nIDTBB = IDTBB_ALPHA;
00209             break;
00210
00211     }
00212     SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_NATIVEMODE,
00213                 MAKELPARAM(nIDTBB, 0));
00214
00215     if (dwConv & IME_CMODE_FULLSHAPE)
00216     {
00217         nIDTBB = IDTBB_FULL;
00218     }
00219     else
00220     {
00221         nIDTBB = IDTBB_HALF;
00222         SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_FULLHALF,
00223                     MAKELPARAM(nIDTBB, 0));
00224     }
00225
00226
00227     if (dwConv & IME_CMODE_ROMAN)
00228     {
00229         nIDTBB = IDTBB_ROMAN;
00230     }
00231     else
00232     {
00233         nIDTBB = IDTBB_NOROMAN;
00234         SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_ROMAN,
00235                     MAKELPARAM(nIDTBB, 0));
00236     }
00237
00238
00239     if (dwConv & IME_CMODE_CHARCODE)
00240     {
00241         nIDTBB = IDTBB_CHARCODE;
00242     }
00243     else
00244     {
00245         nIDTBB = IDTBB_NOCHARCODE;
00246         SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_CHARCODE,
00247                     MAKELPARAM(nIDTBB, 0));
00248     }
00249
00250
00251     if (dwConv & IME_CMODE_HANJACONVERT)
00252     {
00253         nIDTBB = IDTBB_HANJA;
00254     }
00255     else
00256     {
00257         nIDTBB = IDTBB_NOHANJA;
00258         SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_HANJA,
00259                     MAKELPARAM(nIDTBB, 0));
00260     }
00261
00262
00263     if (dwConv & IME_CMODE_SOFTKBD)
00264     {
00265         nIDTBB = IDTBB_SOFTKBD;
00266     }
00267     else
00268     {
00269         nIDTBB = IDTBB_NOSOFTKBD;
00270         SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_SOFTKBD,
00271                     MAKELPARAM(nIDTBB, 0));
00272     }
00273
00274
00275     if (dwConv & IME_CMODE_EUDC)
00276     {
00277         nIDTBB = IDTBB_EUDC;
00278     }
00279     else
00280     {
00281         nIDTBB = IDTBB_NOEUDC;
00282         SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_EUDC,
00283                     MAKELPARAM(nIDTBB, 0));
00284     }
00285
00286
00287     if (dwConv & IME_CMODE_SYMBOL)
00288     {
00289         nIDTBB = IDTBB_SYMBOL;
00290     }
00291     else
00292     {
00293         nIDTBB = IDTBB_NOSYMBOL;
00294         SendMessage(hWndToolBar, TB_CHANGEBITMAP, IDM_SYMBOL,
00295                     MAKELPARAM(nIDTBB, 0));
00296     }
00297
00298     return;
00299 }
00300
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/delebase.h Source File

  • SysMgmt
  • MMC
  • Proppage

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CDelegationBase {
00030 public:
00031     CDelegationBase();
00032     virtual ~CDelegationBase();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00035     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00036
00037     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00038     virtual const int GetBitmapIndex() = 0;
00039
00040     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00041
00042 public:
00043     // virtual functions go here (for MMCN_*)
00044     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
00045     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
00046     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00047     virtual HRESULT OnRename(LPOLESTR pszNewName) { return S_FALSE; }
00048     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) { return S_FALSE; }
00049
00050     virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider,
00051         LONG_PTR handle) { return S_FALSE; }
00052     virtual HRESULT HasPropertySheets() { return S_FALSE; }
00053     virtual HRESULT GetWatermarks(HBITMAP *lphWatermark,
00054         HBITMAP *lphHeader,
00055         HPALETTE *lphPalette,
00056         BOOL *bStretch) { return S_FALSE; }
00057
00058     virtual HRESULT OnPropertyChange(IConsole *pConsole) { return S_OK; }
00059
00060 public:
00061     static HBITMAP m_pBMapSm;
00062     static HBITMAP m_pBMapLg;
00063
00064 protected:
00065     static void LoadBitmaps() {
00066         m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
00067         m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
00068     }
00069
00070     BOOL bExpanded;
00071
00072 private:
00073     // {2974380B-4C4B-11d2-89D8-000021473128}
00074     static const GUID thisGuid;
00075 };
00076
00077 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTreeViewLite Member List

This is the complete list of members for CTreeViewLite, including all inherited members.
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CSplitterLite(HWND hWndParent=NULL, UINT nID=0) | CSplitterLite |
CTreeViewLite(HWND hWndParent=NULL, UINT nID=0) | CTreeViewLite |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DeleteAllItems() | CTreeViewLite | [inline]
DeleteItem(HTREEITEM hItem) | CTreeViewLite | [inline]
DestroyWindow() | CWndLite | [virtual]
DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient) | CSplitterLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EnsureVisible(HTREEITEM hItem) | CTreeViewLite | [inline]
Expand(HTREEITEM hItem, UINT flag=TVE_EXPAND) | CTreeViewLite | [inline]
GetChildItem(HTREEITEM hItem) | CTreeViewLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetItemParam(HTREEITEM hItem) | CTreeViewLite |
GetNextItem(HTREEITEM hItem, UINT nCode=TVGN_NEXT) | CTreeViewLite | [inline]
GetParentItem(HTREEITEM hItem) | CTreeViewLite | [inline]
GetSelectedItem() | CTreeViewLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
HitTest(REFPOINTS pts, UINT *pFlags=NULL, BOOL fClientCoords=TRUE) | CTreeViewLite |
InsertItem(HTREEITEM hParent, HTREEITEM hInsAfter, WCHAR *wszName, LPARAM lParam=PARAM_NONE, INT iImage=IMAGE_NONE, INT iSelectedImage=IMAGE_NONE, UINT iState=IMAGE_NONE, UINT iStateMask=IMAGE_NONE) | CTreeViewLite |
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hCursorOld | CSplitterLite |
m_hCursorRight | CSplitterLite |
m_hCursorTop | CSplitterLite |
m_hDraggingItem | CTreeViewLite | [protected]
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iBorderCX | CSplitterLite |
m_iBorderCY | CSplitterLite |
m_nID | CWndLite |
m_pCWndBottom | CSplitterLite |
m_pCWndLeft | CSplitterLite |
m_pCWndRight | CSplitterLite |
m_pCWndTop | CSplitterLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnBeginDrag(INT idCtrl, NMTREEVIEW *pNMTreeView) | CTreeViewLite | [virtual]
OnBeginLabelEdit(INT idCtrl, NMTVDISPINFO *ptvdi) | CTreeViewLite | [virtual]
OnBorder(REFPOINTS pts, INT iBorder) | CSplitterLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CTreeViewLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnEndLabelEdit(INT idCtrl, NMTVDISPINFO *ptvdi) | CTreeViewLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CTreeViewLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CTreeViewLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CTreeViewLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSelChanged(INT idCtrl, NMTREEVIEW *pNMTreeView) | CTreeViewLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SelectItem(HTREEITEM hItem) | CTreeViewLite | [inline]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetItemImage(HTREEITEM hItem, INT iImage, INT iSelectedImage) | CTreeViewLite |
SetItemParam(HTREEITEM hItem, LPARAM lParam) | CTreeViewLite |
SetItemState(HTREEITEM hItem, UINT iState, UINT iStateMask) | CTreeViewLite |
SetItemText(HTREEITEM hItem, WCHAR *pwszText) | CTreeViewLite |
SetSplitter(CSplitterLite *pCWndTop, CSplitterLite *pCWndBottom=NULL, CSplitterLite *pCWndLeft=NULL, CSplitterLite *pCWndRight=NULL) | CSplitterLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT *pPoint) | CSplitterLite | [virtual]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CTreeViewLite() | CTreeViewLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/MainFrm.Cpp Source File

  • WinBase
  • WtsApi
  • WtsApi

MainFrm.Cpp

Go to the documentation of this file.
00001 // MainFrm.cpp : implementation of the CMainFrame class
00002 //
00003 //  Copyright 1995-1999, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006
00007 #include "stdafx.h"
00008 #include "API.h"
00009
00010 #include "MainFrm.h"
00011
00012 #ifdef _DEBUG
00013 #define new DEBUG_NEW
00014 #undef THIS_FILE
00015 static char THIS_FILE[] = __FILE__;
00016 #endif
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CMainFrame
00020
00021 IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
00022
00023 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
00024   //{{AFX_MSG_MAP(CMainFrame)
00025   ON_WM_CREATE()
00026   ON_WM_PAINT()
00027   //}}AFX_MSG_MAP
00028 END_MESSAGE_MAP()
00029
00030 static UINT indicators[] =
00031 {
00032   ID_SEPARATOR,           // status line indicator
00033   ID_INDICATOR_CAPS,
00034   ID_INDICATOR_NUM,
00035   ID_INDICATOR_SCRL,
00036 };
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CMainFrame construction/destruction
00040
00041 CMainFrame::CMainFrame()
00042 {
00043 }
00044
00045 CMainFrame::~CMainFrame()
00046 {
00047 }
00048
00049 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
00050 {
00051   if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
00052     return -1;
00053
00054   if (!m_wndStatusBar.Create(this) ||
00055     !m_wndStatusBar.SetIndicators(indicators,
00056       sizeof(indicators)/sizeof(UINT)))
00057   {
00058     TRACE0("Failed to create status bar\n");
00059     return -1;      // fail to create
00060   }
00061   return 0;
00062 }
00063
00064 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
00065 {
00066   // TODO: Modify the Window class or styles here by modifying
00067   //  the CREATESTRUCT cs
00068
00069   return CFrameWnd::PreCreateWindow(cs);
00070 }
00071
00072 /////////////////////////////////////////////////////////////////////////////
00073 // CMainFrame diagnostics
00074
00075 #ifdef _DEBUG
00076 void CMainFrame::AssertValid() const
00077 {
00078   CFrameWnd::AssertValid();
00079 }
00080
00081 void CMainFrame::Dump(CDumpContext& dc) const
00082 {
00083   CFrameWnd::Dump(dc);
00084 }
00085
00086 #endif //_DEBUG
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // CMainFrame message handlers
00090
00091 /*void CMainFrame::OnPaint()
00092 {
00093   //CPaintDC dc(this); // device context for painting
00094   //ShowFonts(&dc);
00095 }*/
00096
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IAS/MapName/multisz.c Source File

  • NetDS
  • IAS
  • MapName

multisz.c

Go to the documentation of this file.
00001 /* Copyright (c) Microsoft Corporation. All rights reserved. */
00002
00003 #include "windows.h"
00004 #include "wchar.h"
00005 #include "multisz.h"
00006 #include "radutil.h"
00007
00008 static wchar_t wszEmptyMultiSz[] = L"\0";
00009
00010 VOID
00011 WINAPI
00012 MultiSzInit(
00013     PMULTI_SZ pMultiSz
00014     )
00015 {
00016    pMultiSz->pwszValue = wszEmptyMultiSz;
00017    pMultiSz->nChar = 1;
00018 }
00019
00020 VOID
00021 WINAPI
00022 MultiSzFree(
00023     PMULTI_SZ pMultiSz
00024     )
00025 {
00026    if (pMultiSz->pwszValue != wszEmptyMultiSz)
00027    {
00028       RadiusFree(pMultiSz->pwszValue);
00029    }
00030
00031    memset(pMultiSz, 0, sizeof(MULTI_SZ));
00032 }
00033
00034 LONG
00035 WINAPI
00036 MultiSzAppend(
00037     PMULTI_SZ pMultiSz,
00038     LPCWSTR pwszString
00039     )
00040 {
00041    DWORD nChar;
00042    MULTI_SZ result;
00043    PWSTR pwszPos;
00044
00045    /* Calculate the number of characters being added. */
00046    nChar = lstrlenW(pwszString) + 1;
00047
00048    /* Allocate a new MULTI_SZ with enough room for the additional string. */
00049    result.nChar = pMultiSz->nChar + nChar;
00050    result.pwszValue = RadiusAlloc(result.nChar * sizeof(WCHAR));
00051    if (result.pwszValue == NULL)
00052    {
00053       return ERROR_NOT_ENOUGH_MEMORY;
00054    }
00055
00056    /* Copy in the current MULTI_SZ. */
00057    memcpy(
00058       result.pwszValue,
00059       pMultiSz->pwszValue,
00060       (pMultiSz->nChar * sizeof(WCHAR))
00061       );
00062
00063    /* Compute the position to add the new string. */
00064    pwszPos = result.pwszValue + pMultiSz->nChar - 1;
00065
00066    /* Append the string and the extra null-terminator. */
00067    memcpy(
00068       pwszPos,
00069       pwszString,
00070       (nChar * sizeof(WCHAR))
00071       );
00072    pwszPos[nChar] = L'\0';
00073
00074    /* Clean-up the old MULTI_SZ and swap in the new one. */
00075    MultiSzFree(pMultiSz);
00076    *pMultiSz = result;
00077
00078    return NO_ERROR;
00079 }
00080
00081 VOID
00082 WINAPI
00083 MultiSzErase(
00084     PMULTI_SZ pMultiSz,
00085     LPWSTR pwszString
00086     )
00087 {
00088    DWORD nChar;
00089    PWSTR pwszNext, pwszFirst, pwszLast;
00090
00091    /* Compute the number of characters being erased. */
00092    nChar = lstrlenW(pwszString) + 1;
00093
00094    /* Slide everything left to erase the string. */
00095    pwszFirst = pwszString + nChar;
00096    pwszLast = pMultiSz->pwszValue + pMultiSz->nChar;
00097    for (pwszNext = pwszFirst; pwszNext < pwszLast; ++pwszNext)
00098    {
00099       *pwszString++ = *pwszNext;
00100    }
00101
00102    /* Update the length of the MULTI_SZ. */
00103    pMultiSz->nChar -= nChar;
00104 }
00105
00106 LPWSTR
00107 WINAPI
00108 MultiSzFind(
00109     PMULTI_SZ pMultiSz,
00110     LPCWSTR pwszString
00111     )
00112 {
00113    LPWSTR pwszNext;
00114
00115    for (pwszNext = pMultiSz->pwszValue;
00116         *pwszNext != L'\0';
00117         pwszNext += (lstrlenW(pwszNext) + 1))
00118    {
00119       if (lstrcmpiW(pwszNext, pwszString) == 0)
00120       {
00121          return pwszNext;
00122       }
00123    }
00124
00125    return NULL;
00126 }
00127
00128 LONG
00129 WINAPI
00130 MultiSzQuery(
00131     PMULTI_SZ pMultiSz,
00132     HKEY hKey,
00133     LPCWSTR pwszValueName
00134     )
00135 {
00136    LONG lResult;
00137    DWORD dwType, cbData;
00138    LPBYTE lpData;
00139
00140    /* Initialize the MULTI_SZ. */
00141    MultiSzInit(pMultiSz);
00142
00143    /* Compute the size of the value. */
00144    cbData = 0;
00145    lResult = RegQueryValueExW(
00146                 hKey,
00147                 pwszValueName,
00148                 NULL,
00149                 &dwType,
00150                 NULL,
00151                 &cbData
00152                 );
00153    if (lResult != NO_ERROR)
00154    {
00155       return lResult;
00156    }
00157    if (dwType != REG_MULTI_SZ)
00158    {
00159       return ERROR_INVALID_DATA;
00160    }
00161
00162    /* Allocate a buffer to hold the MULTI_SZ. */
00163    lpData = RadiusAlloc(cbData);
00164
00165    /* Get the value. */
00166    lResult = RegQueryValueExW(
00167                 hKey,
00168                 pwszValueName,
00169                 NULL,
00170                 &dwType,
00171                 lpData,
00172                 &cbData
00173                 );
00174    if (lResult != NO_ERROR)
00175    {
00176       RadiusFree(lpData);
00177       return lResult;
00178    }
00179    if (dwType != REG_MULTI_SZ)
00180    {
00181       RadiusFree(lpData);
00182       return ERROR_INVALID_DATA;
00183    }
00184
00185    /* Store the result. */
00186    pMultiSz->pwszValue = (LPWSTR)lpData;
00187    pMultiSz->nChar = cbData / sizeof(WCHAR);
00188
00189    return NO_ERROR;
00190 }
00191
00192 /* Write a MULTI_SZ to the registry. */
00193 LONG
00194 WINAPI
00195 MultiSzSet(
00196     PMULTI_SZ pMultiSz,
00197     HKEY hKey,
00198     LPCWSTR pwszValueName
00199     )
00200 {
00201    return RegSetValueExW(
00202              hKey,
00203              pwszValueName,
00204              0,
00205              REG_MULTI_SZ,
00206              (const BYTE *)pMultiSz->pwszValue,
00207              pMultiSz->nChar * sizeof(WCHAR)
00208              );
00209 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPower Member List

This is the complete list of members for CPower, including all inherited members.
CPower() | CPower |
DECLARE_REGISTRY(CPower, _T("IISSample.C++ATLPower.1"), _T("IISSample.C++ATLPower"), IDS_POWER_DESC, THREADFLAGS_BOTH) STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) | CPower |
FinalCountruct() | CPower | [inline]
FinalRelease() | CPower | [inline]
get_myPowerProperty(BSTR *pbstrOutValue) | CPower |
get_myProperty(BSTR *pbstrOutValue) | CPower |
m_bstrMyProperty | CPower | [private]
m_pUnkMarshaler | CPower | [private]
myMethod(BSTR bstrIn, BSTR *pbstrOut) | CPower |
myPowerMethod() | CPower |
put_myProperty(BSTR bstrInValue) | CPower |
Generated on Wed Nov 13 2024 16:57:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletCapability2 Member List

This is the complete list of members for tagAppletCapability2, including all inherited members.
CapID | tagAppletCapability2
pCapData | tagAppletCapability2
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/devicenode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

devicenode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CDeviceNode class.
00014 //
00015
00016
00017 #include "DeviceNode.h"
00018 #include "FolderNode.h"
00019 #include "AddFolderDlg.h"
00020 #include "CompData.h"
00021 #include "Comp.h"
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CDeviceNode")
00026
00027
00028
00029 // Initialize our static GUID just once
00030 GUID CDeviceNode::m_thisGUID = CLSID_DeviceNode;
00031
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // Construction/Destruction
00035
00036 //---------------------------------------------------------------------------
00037 CDeviceNode::CDeviceNode()
00038 {
00039   m_SDI.mask        = DEFAULT_SDI_MASK;
00040   m_SDI.displayname = MMC_CALLBACK;
00041   m_SDI.cChildren   = 1;              // Determines if the '+' is displayed
00042   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00043
00044   m_dwAttributes    = 0;
00045   m_wzStatus        = NULL;
00046   m_hParentNode     = NULL;
00047   m_pCompData       = NULL;
00048   m_hMessageWnd     = NULL;
00049   m_hAddFolderDlg   = NULL;
00050 }
00051
00052 //---------------------------------------------------------------------------
00053 CDeviceNode::~CDeviceNode()
00054 {
00055   if( NULL != m_hMessageWnd )
00056     DestroyWindow( m_hMessageWnd );
00057 }
00058
00059
00060 //---------------------------------------------------------------------------
00061 //  This class does not make calls back to it's parent object so
00062 //  NodeProps->pParentObject is not used.
00063 //
00064 HRESULT CDeviceNode::Initialize( NODE_PROPERTIES* pNodeProps )
00065 {
00066   _ASSERT( NULL != pNodeProps );
00067   HRESULT  hResult = S_OK;
00068
00069   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00070   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00071   wcscpy( pszTmp, pNodeProps->szNodeName );
00072   if( NULL != m_pwszNodeName )
00073     CoTaskMemFree( m_pwszNodeName );
00074
00075   m_pwszNodeName = pszTmp;
00076   m_pCompData    = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00077
00078   RefreshNodeList();                   // Add child nodes
00079                                        // and set images
00080
00081   if( pNodeProps->dwAttributes & ATTRIBUTE_BACKUP_DEVICE )
00082   {
00083     m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00084     m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00085     m_dwAttributes   |= ATTRIBUTE_BACKUP_DEVICE;
00086   }
00087   else
00088   {
00089     m_SDI.nImage      = IMG_DRIVE_DEFAULT;
00090     m_SDI.nOpenImage  = IMG_DRIVE_DEFAULT;
00091     m_dwAttributes   |= ~ATTRIBUTE_BACKUP_DEVICE;
00092   }
00093
00094   m_wzStatus      = L"Online";    // Node successfully initialized
00095   m_bOnlineStatus = STATUS_ONLINE;
00096
00097   // We create a hidden window to allow us to communicate with modeless
00098   // dialogs and other things which run in a seperate thread.
00099
00100   WNDCLASS wc;
00101   ZeroMemory (&wc, sizeof(WNDCLASS));
00102   wc.cbWndExtra    = sizeof(this);
00103   wc.lpfnWndProc   = DeviceNodeWndProc;
00104   wc.hInstance     = g_hInst;
00105   wc.lpszClassName = _T("DeviceNodeMessageWindow");
00106
00107   RegisterClass( &wc );
00108   m_hMessageWnd = CreateWindow( _T("DeviceNodeMessageWindow"), NULL,
00109                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00110
00111   if( NULL == m_hMessageWnd )
00112     hResult = S_FALSE;
00113
00114   return hResult;
00115 }
00116
00117
00118 //---------------------------------------------------------------------------
00119 //  This is our hidden window which is just used for handling messages.  We
00120 //  go to all this trouble so that we don't ever pass interface pointers or
00121 //  other objects across threads.
00122 //
00123 LRESULT CALLBACK CDeviceNode::DeviceNodeWndProc
00124 (
00125   HWND   hWnd,     //[in] Handle to window
00126   UINT   uMsg,     //[in] Message identifier
00127   WPARAM wParam,   //[in] First message parameter
00128   LPARAM lParam    //[in] Second message parameter
00129 )
00130 {
00131   switch( uMsg )
00132   {
00133     // Since we registered the WndClass in Initialize, our WndProc will be
00134     // called with WM_CREATE right away.  Store our 'hWnd' pointer in the
00135     // CREATESTRUCT so we can retreive it later to get back to the specific
00136     // instance of CComponentData
00137     //
00138     case WM_CREATE:
00139     {
00140       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00141       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00142       break;
00143     }
00144
00145     // This is our custom message which could have been sent from a worker
00146     // thread, or in this case a modeless dialog.  We retrieve our 'this'
00147     // pointer from the WndClass and cast it to a CComponentData pointer.
00148     // WPARAM is cast to a NODE_PROPERTIES struct which can be used to
00149     // call AddDeviceNode()
00150     //
00151     case WM_ADDNEW_NODE:
00152     {
00153       CDeviceNode* pThisNode = (CDeviceNode*)GetWindowLongPtr( hWnd, 0 );
00154       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00155       pThisNode->AddFolderNode( pProps );
00156       break;
00157     }
00158
00159     // This message is sent by the AddDeviceDlg to let us know it's
00160     // being terminated.  Set our member handle to NULL so the item
00161     // will be show on the context menu
00162     //
00163     case WM_DIALOG_CLOSED:
00164     {
00165       CDeviceNode* pThisNode = (CDeviceNode*)GetWindowLongPtr( hWnd, 0 );
00166       pThisNode->m_hAddFolderDlg = NULL;
00167       break;
00168     }
00169     default:
00170       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00171   }
00172   return 0;
00173 }
00174
00175
00176 /////////////////////////////////////////////////////////////////////////////
00177 // Implementation of virtual methods
00178
00179
00180 //---------------------------------------------------------------------------
00181 HRESULT CDeviceNode::GetResultViewType2
00182 (
00183   MMC_COOKIE             nCookie,  //[in] Identifier of object
00184   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00185 )
00186 {
00187   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+sizeof(WCHAR) );
00188   if( NULL == pszDescStr )
00189     return E_OUTOFMEMORY;
00190
00191   wcscpy( pszDescStr, L"DefaultListView" );
00192   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00193
00194   return S_OK;
00195 }
00196
00197 //---------------------------------------------------------------------------
00198 HRESULT CDeviceNode::GetDisplayInfo
00199 (
00200   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00201 )
00202 {
00203   _ASSERT( NULL != pSDI );
00204   pSDI->displayname = m_pwszNodeName;
00205
00206   return S_OK;
00207 }
00208
00209 //---------------------------------------------------------------------------
00210 HRESULT CDeviceNode::GetDisplayInfo
00211 (
00212   RESULTDATAITEM* pRDI
00213 )
00214 {
00215   _ASSERT( NULL != pRDI );
00216
00217   HRESULT hResult = S_OK;
00218
00219   if( pRDI->mask & RDI_STR )         // Console is requesting strings...
00220   {                                  // for each column
00221     switch( pRDI->nCol )
00222     {
00223       case 0:
00224         pRDI->str = m_pwszNodeName;
00225         break;
00226
00227       case 1:                        // Attributes not supported yet
00228         pRDI->str = m_wzStatus;
00229         break;
00230
00231       default:
00232         hResult = S_FALSE;
00233         TRACE_VAL(_T("GetDisplayInfo"), _T("Column"), pRDI->nCol );
00234         break;
00235     }
00236   }
00237   if( pRDI->mask & RDI_IMAGE )       // Looking for an image?
00238   {
00239     pRDI->nImage = m_SDI.nImage;
00240   }
00241
00242   //TRACE_HRESULT(_T("GetDisplayInfo"), hResult );
00243   return hResult;
00244
00245 }
00246
00247 /////////////////////////////////////////////////////////////////////////////
00248 // Implementation of notification handlers
00249
00250
00251 //---------------------------------------------------------------------------
00252 HRESULT CDeviceNode::OnSelect
00253 (
00254   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00255   LPARAM        nArg,          //[in] Bools for context & selection state
00256   LPARAM        nParam,        //[in] Not used
00257   LONG_PTR      pComponent     //[in] Points calling CComponent
00258 )
00259 {
00260   HRESULT hResult = S_FALSE;
00261
00262   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00263
00264   IConsoleVerb* ipConsoleVerb = NULL;
00265   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00266   if( S_OK == hResult )
00267   {
00268     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_RENAME, ENABLED, TRUE );
00269   }
00270
00271   //TRACE_HRESULT(_T("OnSelect"), hResult );
00272   return hResult;
00273 }
00274
00275
00276 //---------------------------------------------------------------------------
00277 HRESULT CDeviceNode::OnShow
00278 (
00279   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00280   LPARAM        nArg,          //[in] TRUE if node was selcted
00281   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00282   LONG_PTR      pComponent     //[in] Points to calling IComponent
00283 )
00284 {
00285   HRESULT  hResult = S_FALSE;
00286
00287   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00288
00289   LPHEADERCTRL2  ipHeaderCtrl = NULL;
00290   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL, (LONG_PTR*)&ipHeaderCtrl );
00291   if( S_OK != hResult )
00292    return hResult;
00293
00294   LPRESULTDATA  ipResultData = NULL;
00295   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00296   if( S_OK != hResult )
00297    return hResult;
00298
00299   if( TRUE == nArg )  // Selecting a scope node
00300   {
00301     do
00302     {
00303       hResult = ipHeaderCtrl->InsertColumn( 0, L"Folder Name", 0, 150 );
00304       BREAK_ON_ERROR( hResult );
00305
00306       hResult = ipHeaderCtrl->InsertColumn( 1, L"Attributes", 0, 150 );
00307       BREAK_ON_ERROR( hResult );
00308
00309       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00310       BREAK_ON_ERROR( hResult );
00311
00312     }while(0);
00313   }
00314   else // not handling deselect notifications
00315   {
00316   }
00317
00318   //TRACE_HRESULT(_T("OnShow"), hResult );
00319   return hResult;
00320 }
00321
00322 //---------------------------------------------------------------------------
00323 HRESULT CDeviceNode::OnExpand
00324 (
00325   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00326   LPARAM         nArg,         //[in] TRUE if node was selcted
00327   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00328   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00329 )
00330 {
00331   HRESULT hResult = S_FALSE;
00332
00333   if( NULL == m_pCompData )
00334     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00335
00336   // Request an IConsoleNameSpace2 pointer from CComponentData
00337   LPCONSOLENAMESPACE2 ipCNS = NULL;
00338   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00339   if( S_OK != hResult )
00340     return hResult;
00341
00342   m_hParentNode = (HSCOPEITEM)nParam;  // Cache HSCOPEITEM of Parent
00343
00344   hResult = DeleteChildItems( ipCNS );
00345   hResult = InsertChildItems( ipCNS );
00346
00347   TRACE_HRESULT( _T("OnExpand"), hResult );
00348   return hResult;
00349 }
00350
00351
00352 //---------------------------------------------------------------------------
00353 HRESULT CDeviceNode::OnRemoveChildren
00354 (
00355   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00356   LPARAM         nArg,         //[in] TRUE if node was selcted
00357   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00358   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00359 )
00360 {
00361   HRESULT hResult = S_OK;
00362
00363   POSITION   Pos   = m_NodeList.GetHeadPosition();
00364   LPBASENODE pNode = NULL;
00365   while( Pos )                         // Delete everything...
00366   {
00367     pNode = m_NodeList.GetNext( Pos );
00368     pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00369     delete pNode;
00370   }
00371
00372   m_NodeList.RemoveAll();            // Cleans up the list
00373
00374   //TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00375   return hResult;
00376
00377 }
00378
00379 //---------------------------------------------------------------------------
00380 //  This message must return S_OK to allow the rename.  Anything else will
00381 //  disallow the rename
00382 //
00383 HRESULT CDeviceNode::OnRename
00384 (
00385   LPDATAOBJECT ipDataObject,   //[in] Points to Data Object
00386   LPARAM       nArg,           //[in] Not used
00387   LPARAM       nParam,         //[in] Pointer to the new name
00388   LONG_PTR     pComponent      //[in] Points to calling IComponent
00389 )
00390 {
00391   _ASSERT( NULL != ipDataObject );
00392   HRESULT hResult = S_OK;
00393
00394   LPWSTR pszTmpName = NULL;
00395   LPWSTR pszNewName = (LPWSTR)nParam;  // New name
00396   LONG   nLen = wcslen( pszNewName ) + 1;
00397
00398   pszTmpName = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00399   if( NULL == pszTmpName )
00400   {
00401     hResult = S_FALSE;                 // Can't change the name
00402   }
00403   else
00404   {
00405     wcscpy( pszTmpName, pszNewName );
00406     CoTaskMemFree( m_pwszNodeName );   // Free existing name...
00407     m_pwszNodeName = pszTmpName;       // Assign new name to pointer
00408   }
00409
00410   return hResult;
00411 }
00412
00413 /////////////////////////////////////////////////////////////////////////////
00414 //  Private Helpers
00415
00416 //---------------------------------------------------------------------------
00417 HRESULT CDeviceNode::DeleteChildItems
00418 (
00419   LPCONSOLENAMESPACE2 ipCNS
00420 )
00421 {
00422   _ASSERT( NULL != ipCNS );
00423
00424   POSITION    Pos     = m_NodeList.GetHeadPosition();
00425   HSCOPEITEM  hItem   = NULL;
00426   LPBASENODE  pNode   = NULL;
00427   HRESULT     hResult = S_FALSE;
00428
00429   while( Pos )                         // Delete everything...
00430   {
00431     pNode = m_NodeList.GetNext( Pos );
00432     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00433     if( 0 != hItem )
00434       hResult = ipCNS->DeleteItem( hItem, TRUE );
00435   }
00436
00437   return hResult;
00438 }
00439
00440
00441 //---------------------------------------------------------------------------
00442 HRESULT CDeviceNode::InsertChildItems
00443 (
00444   LPCONSOLENAMESPACE2 ipCNS
00445 )
00446 {
00447   _ASSERT( NULL != ipCNS );
00448   _ASSERT( NULL != m_hParentNode );
00449
00450   HRESULT    hResult = S_FALSE;
00451   POSITION   Pos     = m_NodeList.GetHeadPosition();
00452   LPBASENODE pNode   = NULL;
00453
00454   while( Pos )
00455   {
00456     pNode   = m_NodeList.GetNext( Pos );
00457     pNode->m_SDI.relativeID = m_hParentNode;
00458     hResult = ipCNS->InsertItem( &pNode->m_SDI );
00459   }
00460
00461   return hResult;
00462 }
00463
00464
00465 //---------------------------------------------------------------------------
00466 //  Only add one child node in this sample
00467 //
00468 HRESULT CDeviceNode::RefreshNodeList()
00469 {
00470   NODE_PROPERTIES NodeProps;
00471   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00472   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00473
00474   WCHAR  szNames[1][32];
00475   wcscpy( szNames[0], L"Root Folder" );
00476
00477   RemoveNodes();             // Clean the node list
00478
00479   LPBASENODE pNode = NULL;
00480   for( DWORD i = 0; i < 1; i++ )
00481   {
00482     wcscpy( NodeProps.szNodeName, szNames[i] );
00483     pNode = new CFolderNode;
00484     pNode->Initialize( &NodeProps );
00485     m_NodeList.AddTail( pNode );
00486   }
00487
00488   return S_OK;
00489 }
00490
00491 //---------------------------------------------------------------------------
00492 //  We do this instead of just calling RemoveAll() because our list contains
00493 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00494 //  the derived class object.
00495 //
00496 VOID CDeviceNode::RemoveNodes()
00497 {
00498   LPBASENODE pNode = NULL;
00499   POSITION   Pos   = m_NodeList.GetHeadPosition();
00500   while( Pos )
00501   {
00502     pNode = m_NodeList.GetNext( Pos );
00503     delete pNode;
00504   }
00505   m_NodeList.RemoveAll();              // Clean the list
00506 }
00507
00508 //---------------------------------------------------------------------------
00509 //  This is called by our main message handler to create a new Folder Node.
00510 //  NOTE:  This does not display the new item directly.  The call to
00511 //         InsertItem cause the console to call GetDisplayInfo.
00512 //
00513 HRESULT CDeviceNode::AddFolderNode
00514 (
00515   NODE_PROPERTIES* pProperties   //[in] Contains use input properties
00516 )
00517 {
00518   _ASSERT( NULL != pProperties );
00519
00520   CFolderNode* pNode   = NULL;
00521   HRESULT      hResult = S_FALSE;
00522
00523   // In this case we always have the same parent
00524   pProperties->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00525   pProperties->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00526
00527   pNode = new CFolderNode;             // Create and initialize the new
00528   pNode->Initialize( pProperties );    // node, then add to our linked
00529   m_NodeList.AddTail( pNode );         // list, then insert the node
00530
00531   pNode->m_SDI.relativeID = m_hParentNode;
00532
00533   LPCONSOLENAMESPACE2 ipCNS = NULL;
00534   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00535   if( S_OK != hResult )
00536     return hResult;
00537
00538   hResult = ipCNS->InsertItem( &pNode->m_SDI );
00539
00540   return hResult;
00541 }
00542
00543 /////////////////////////////////////////////////////////////////////////////
00544 //  Public helpers
00545
00546 //---------------------------------------------------------------------------
00547 VOID CDeviceNode::ToggleStatus()
00548 {
00549   // First we have to set the image indexes according to the Online Status
00550   // and the device type
00551   //
00552   if( STATUS_ONLINE == m_bOnlineStatus )
00553   {
00554     m_bOnlineStatus = STATUS_OFFLINE;
00555     m_wzStatus      = L"Offline";
00556     if( m_dwAttributes & ATTRIBUTE_BACKUP_DEVICE )
00557     {
00558       m_SDI.nImage      = IMG_DEVICE_OFFLINE;
00559       m_SDI.nOpenImage  = IMG_DEVICE_OFFLINE;
00560     }
00561     else
00562     {
00563       m_SDI.nImage      = IMG_DRIVE_OFFLINE;
00564       m_SDI.nOpenImage  = IMG_DRIVE_OFFLINE;
00565     }
00566   }
00567   else
00568   {
00569     m_bOnlineStatus = STATUS_ONLINE;
00570     m_wzStatus      = L"Online";
00571     if( m_dwAttributes & ATTRIBUTE_BACKUP_DEVICE )
00572     {
00573       m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00574       m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00575     }
00576     else
00577     {
00578       m_SDI.nImage      = IMG_DRIVE_DEFAULT;
00579       m_SDI.nOpenImage  = IMG_DRIVE_DEFAULT;
00580     }
00581   }
00582   // This is a scope node, so GetDisplayInfo will only ask for images for
00583   // this node when it is in the Result Pane.  To change the image for the
00584   // the Scope Pane we need to call IConsoleNameSpace2::SetItem().  This
00585   // call forces the scope node to be redrawn.
00586   //
00587   SCOPEDATAITEM  sdi;
00588   ZeroMemory( &sdi, sizeof(SCOPEDATAITEM) );
00589   sdi.mask        = SDI_IMAGE | SDI_OPENIMAGE ;
00590   sdi.ID          = m_SDI.ID;
00591   sdi.nImage      = m_SDI.nImage;
00592   sdi.nOpenImage  = m_SDI.nOpenImage;
00593
00594   // Request an IConsoleNameSpace2 pointer from CComponentData
00595   HRESULT  hResult = S_FALSE;
00596   LPCONSOLENAMESPACE2 ipCNS = NULL;
00597   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00598   if( S_OK == hResult )
00599     hResult = ipCNS->SetItem( &sdi );
00600
00601 }
00602
00603
00604 /////////////////////////////////////////////////////////////////////////////
00605 //  Support for Context Menus
00606
00607 //---------------------------------------------------------------------------
00608 //  Devices can only add a folder
00609 //
00610 HRESULT CDeviceNode::AddMenuItems
00611 (
00612   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00613   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00614 )
00615 {
00616   _ASSERT( NULL != ipCallback );
00617   HRESULT hResult = S_FALSE;
00618
00619   static CONTEXTMENUITEM ctxMenu[2];
00620     ctxMenu[0].lCommandID        = IDM_NEW_FOLDER;
00621     ctxMenu[0].lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00622     ctxMenu[0].fFlags            = 0;
00623     ctxMenu[0].fSpecialFlags     = 0;
00624     ctxMenu[0].strName           = L"New Folder...";
00625     ctxMenu[0].strStatusBarText  = L"Add a new folder";
00626
00627     ctxMenu[1].lCommandID        = IDM_TOGGLE_STATUS;
00628     ctxMenu[1].lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_TASK;
00629     ctxMenu[1].fFlags            = 0;
00630     ctxMenu[1].fSpecialFlags     = 0;
00631     ctxMenu[1].strName           = L"Toggle Online Status";
00632     ctxMenu[1].strStatusBarText  = L"Toggles the device status";
00633
00634   if( NULL == m_hAddFolderDlg )    // If the AddFolder dialog is running
00635     ctxMenu[0].fFlags = 0;         // gray the menu selection
00636   else
00637     ctxMenu[0].fFlags = MF_GRAYED;
00638
00639
00640   // Add the Add new folder command
00641   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00642   {
00643     hResult = ipCallback->AddItem( &ctxMenu[0] );
00644   }
00645
00646   // Add the Toggle item to the Task menu if allowed...
00647   if( CCM_INSERTIONALLOWED_TOP & *pInsertionAllowed )
00648   {
00649     hResult = ipCallback->AddItem( &ctxMenu[1] );
00650   }
00651
00652   return hResult;
00653 }
00654
00655 //---------------------------------------------------------------------------
00656 HRESULT CDeviceNode::Command
00657 (
00658   long lCommandID          //[in] Indentifier for menu ID
00659 )
00660 {
00661   HRESULT hResult = S_OK;
00662
00663   switch( lCommandID )
00664   {
00665     case IDM_TOGGLE_STATUS:
00666     {
00667       ToggleStatus();
00668       break;
00669     }
00670     case IDM_NEW_FOLDER:
00671     {
00672       CAddFolderDlg* pDlg = new CAddFolderDlg( IDD_ADDFOLDER_DLG, m_hMessageWnd );
00673       m_hAddFolderDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00674       break;
00675     }
00676     default:
00677       hResult = S_FALSE;
00678       break;
00679
00680   }
00681   return hResult;
00682 }
00683
00684 /////////////////////////////////////////////////////////////////////////////
00685 //  Toolbar implementation
00686
00687 //---------------------------------------------------------------------------
00688 HRESULT CDeviceNode::ControlbarNotify
00689 (
00690   LPARAM   nArg,         //[in] Selection status
00691   LPARAM   lParam,       //[in] Not used
00692   LONG_PTR pComp         //[in] Points to CComponent
00693 )
00694 {
00695   HRESULT hResult = S_FALSE;
00696   BOOL bScope  = (BOOL)LOWORD(nArg);
00697   BOOL bSelect = (BOOL)HIWORD(nArg);
00698
00699   CComponent* pComponent = reinterpret_cast<CComponent*>(pComp);
00700
00701   IControlbar* ipControlbar = NULL;
00702   hResult = pComponent->GetInterface( REQUEST_ICONTROLBAR, (LONG_PTR*)&ipControlbar );
00703   if( S_OK != hResult )
00704     return hResult;
00705
00706   IToolbar* ipToolbar = NULL;
00707   hResult = pComponent->GetInterface( REQUEST_IDEVICETOOLBAR, (LONG_PTR*)&ipToolbar );
00708   if( S_OK != hResult )
00709     return hResult;
00710
00711   if( TRUE == bSelect )
00712   {
00713     hResult = ipControlbar->Attach(TOOLBAR, (LPUNKNOWN)ipToolbar);
00714     hResult = ipToolbar->SetButtonState( IDM_NEW_FOLDER, ENABLED, TRUE );
00715     hResult = ipToolbar->SetButtonState( IDM_TOGGLE_STATUS, ENABLED, TRUE );
00716   }
00717   else
00718   {
00719     hResult = ipControlbar->Detach( (LPUNKNOWN)ipToolbar );
00720   }
00721
00722   return hResult;
00723 }
00724
00725
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/onregister.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

onregister.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  OnAddUser.cpp
00006 //
00007 // Description:
00008 //  This file implements the OnAddUser() routine which
00009 //    demonstrates how to add WMI user accounts, user
00010 //    groups and NTLM authenticator instances.
00011 //
00012 // History:
00013 //
00014 // **************************************************************************
00015
00016 #include "stdafx.h"
00017 #include "AdvClientDlg.h"
00018 #include <objbase.h>
00019
00020 // **************************************************************************
00021 //
00022 //  CAdvClientDlg::OnRegPerm()
00023 //
00024 // Description:
00025 //    Handles the GUI aspects of the Register Perm button
00026 //    and calls the right worker routine.
00027 //
00028 // Parameters:
00029 //    none.
00030 //
00031 // Returns:
00032 //    nothing
00033 //
00034 // Globals accessed:
00035 //    None.
00036 //
00037 // Globals modified:
00038 //    None.
00039 //
00040 //===========================================================================
00041
00042 void CAdvClientDlg::OnRegPerm()
00043 {
00044   // if registered.
00045   if(m_regPerm)
00046   {
00047     if(OnPermRegister())
00048     {
00049       m_regPerm = FALSE;
00050       m_perm.SetWindowText(_T("Unregister &Perm"));
00051     }
00052   }
00053   else
00054   {
00055     m_regPerm = TRUE;
00056     OnPermUnregister();
00057     m_perm.SetWindowText(_T("Register &Perm"));
00058   }
00059
00060 }
00061
00062 // **************************************************************************
00063 //
00064 //  CAdvClientDlg::OnRegTemp()
00065 //
00066 // Description:
00067 //    Handles the GUI aspects of the Register Temp button
00068 //    and calls the right worker routine.
00069 //
00070 // Parameters:
00071 //    none.
00072 //
00073 // Returns:
00074 //    nothing
00075 //
00076 // Globals accessed:
00077 //    None.
00078 //
00079 // Globals modified:
00080 //    None.
00081 //
00082 //===========================================================================
00083 void CAdvClientDlg::OnRegTemp()
00084 {
00085   if(m_regTemp)
00086   {
00087     if(OnTempRegister())
00088     {
00089       m_regTemp = FALSE;
00090       m_temp.SetWindowText(_T("Unregister &Temp"));
00091     }
00092   }
00093   else
00094   {
00095     m_regTemp = TRUE;
00096     OnTempUnregister();
00097     m_temp.SetWindowText(_T("Register &Temp"));
00098   }
00099
00100 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_BALLDATA Member List

This is the complete list of members for _BALLDATA, including all inherited members.
bNewPosition | _BALLDATA
crColor | _BALLDATA
hWnd | _BALLDATA
nHeight | _BALLDATA
nWidth | _BALLDATA
xDirection | _BALLDATA
xForm | _BALLDATA
xPosition | _BALLDATA
yDirection | _BALLDATA
yPosition | _BALLDATA
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPPageBindingInfo Member List

This is the complete list of members for CSCPPageBindingInfo, including all inherited members.
Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal) | CPropertyPage |
Apply() | CPropertyPage |
CPropertyPage(REFCLSID clsid, INT iDialogID) | CPropertyPage |
CSCPPageBindingInfo(CSCPWiz *pWizExt) | CSCPPageBindingInfo |
Deactivate() | CPropertyPage |
DEFINE_ADDREF_RELEASE | CPropertyPage |
DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [static]
GetClassID(CLSID __RPC_FAR *pClassID) | CPropertyPage | [inline]
GetPageInfo(PROPPAGEINFO __RPC_FAR *pPageInfo) | CPropertyPage | [inline, virtual]
GetSummaryInfo(CString &szSummary) | CSCPPageBindingInfo |
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [virtual]
Help(LPCOLESTR pszHelpDir) | CPropertyPage | [inline]
IDD enum value | CSCPPageBindingInfo |
InitNew(void) | CPropertyPage | [inline]
IsPageDirty() | CPropertyPage |
Load(IPropertyBag __RPC_FAR *pPropBag, IErrorLog __RPC_FAR *pErrorLog) | CPropertyPage | [inline]
m_clsid | CPropertyPage | [protected]
m_cRef | CPropertyPage | [protected]
m_hWnd | CPropertyPage | [protected]
m_iDialogID | CPropertyPage | [protected]
m_pAttributeEditor | CSCPPageBindingInfo | [private]
m_pIPropertyPageSite | CPropertyPage | [protected]
m_pWizExt | CSCPPageBindingInfo | [private]
m_szValueList | CSCPPageBindingInfo | [private]
Move(LPCRECT pRect) | CPropertyPage |
OnButtonClick() | CSCPPageBindingInfo |
OnInitDialog() | CSCPPageBindingInfo | [virtual]
OnKillActive() | CSCPPageBindingInfo | [virtual]
OnSetActive() | CSCPPageBindingInfo | [virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | CPropertyPage |
Save(IPropertyBag __RPC_FAR *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) | CPropertyPage | [inline]
SetObjects(ULONG cObjects, IUnknown __RPC_FAR *__RPC_FAR *ppUnk) | CPropertyPage | [inline]
SetPageSite(IPropertyPageSite *pPageSite) | CPropertyPage |
SetWizardButtons() | CSCPPageBindingInfo |
Show(UINT nCmdShow) | CPropertyPage |
TranslateAccelerator(MSG *pMsg) | CPropertyPage |
~CPropertyPage() | CPropertyPage | [virtual]
~CSCPPageBindingInfo() | CSCPPageBindingInfo | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFiles/StdAfx.h Source File

  • Com
  • Services
  • Crm
  • CrmFiles

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__43A7D82A_B492_11D1_82F1_00A0C91EEDE9__INCLUDED_)
00006 #define AFX_STDAFX_H__43A7D82A_B492_11D1_82F1_00A0C91EEDE9__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012 #define STRICT
00013
00014
00015 #if !defined(_WIN32_WINNT)
00016 #define _WIN32_WINNT 0x0500
00017 #endif // !defined(_WIN32_WINNT)
00018
00019 #define _ATL_APARTMENT_THREADED
00020
00021
00022 #include <atlbase.h>
00023 //You may derive a class from CComModule and use it if you want to override
00024 //something, but do not change the name of _Module
00025 extern CComModule _Module;
00026 #include <atlcom.h>
00027
00028 //{{AFX_INSERT_LOCATION}}
00029 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00030
00031 #endif // !defined(AFX_STDAFX_H__43A7D82A_B492_11D1_82F1_00A0C91EEDE9__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

igmp_hdr Member List

This is the complete list of members for igmp_hdr, including all inherited members.
checksum | igmp_hdr
group_addr | igmp_hdr
max_resp_time | igmp_hdr
version_type | igmp_hdr
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSAFEARRAY Member List

This is the complete list of members for CSAFEARRAY, including all inherited members.
Access(void **pData) | CSAFEARRAY | [inline]
Access(void **pData) | CSAFEARRAY | [inline]
CSAFEARRAY(VARTYPE v, int nSize) | CSAFEARRAY | [inline]
CSAFEARRAY(SAFEARRAY *pSrc) | CSAFEARRAY | [inline]
CSAFEARRAY(VARTYPE v, int nSize) | CSAFEARRAY | [inline]
CSAFEARRAY(SAFEARRAY *pSrc) | CSAFEARRAY | [inline]
Get(long nLocation, LPVOID pData) | CSAFEARRAY | [inline]
Get(long nLocation, LPVOID pData) | CSAFEARRAY | [inline]
GetNumElements() | CSAFEARRAY | [inline]
GetNumElements() | CSAFEARRAY | [inline]
operator SAFEARRAY *() | CSAFEARRAY | [inline]
operator SAFEARRAY *() | CSAFEARRAY | [inline]
p | CSAFEARRAY | [private]
Put(long nLocation, LPVOID pData) | CSAFEARRAY | [inline]
Put(long nLocation, LPVOID pData) | CSAFEARRAY | [inline]
Unaccess() | CSAFEARRAY | [inline]
Unaccess() | CSAFEARRAY | [inline]
Unbind() | CSAFEARRAY | [inline]
Unbind() | CSAFEARRAY | [inline]
~CSAFEARRAY() | CSAFEARRAY | [inline]
~CSAFEARRAY() | CSAFEARRAY | [inline]
Generated on Wed Nov 13 2024 16:57:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/adscontainer.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

adscontainer.h

Go to the documentation of this file.
00001 // ADsContainer.h: interface for the CADsContainer class.
00002 //
00003 //////////////////////////////////////////////////////////////////////
00004
00005 #if !defined(AFX_ADSCONTAINER_H__81709783_0672_11D2_B218_0000F87A6B50__INCLUDED_)
00006 #define AFX_ADSCONTAINER_H__81709783_0672_11D2_B218_0000F87A6B50__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012
00013
00014 #endif // !defined(AFX_ADSCONTAINER_H__81709783_0672_11D2_B218_0000F87A6B50__INCLUDED_)
00015 /////////////////////////////////////////////////////////////////////////////
00016 // CDlgIADsContainer dialog
00017
00018 class CDlgIADsContainer : public CDialog
00019 {
00020 // Construction
00021 public:
00022   CDlgIADsContainer(LPUNKNOWN pUnk, CWnd* pParent = NULL);   // standard constructor
00023   ~CDlgIADsContainer();
00024
00025 // Dialog Data
00026   //{{AFX_DATA(CDlgIADsContainer)
00027   enum { IDD = IDD_IADSCONTAINER };
00028   CListBox  m_cChildList;
00029   CString m_sFilter;
00030   //}}AFX_DATA
00031
00032
00033 // Overrides
00034   // ClassWizard generated virtual function overrides
00035   //{{AFX_VIRTUAL(CDlgIADsContainer)
00036   protected:
00037   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00038   //}}AFX_VIRTUAL
00039
00040 // Implementation
00041 protected:
00042   HRESULT EnumerateChildren();
00043   IADsContainer *m_pCont;
00044   CStringList    m_sClassList;
00045
00046   // Generated message map functions
00047   //{{AFX_MSG(CDlgIADsContainer)
00048   virtual BOOL OnInitDialog();
00049   afx_msg void OnView();
00050   afx_msg void OnDblClkChildrenList();
00051   afx_msg void OnDelete();
00052   virtual void OnOK();
00053   afx_msg void OnRename();
00054   afx_msg void OnSet();
00055   afx_msg void OnMove();
00056   //}}AFX_MSG
00057   DECLARE_MESSAGE_MAP()
00058 private:
00059   BOOL GetClassAndName( CString &sClass, CString &sName );
00060 };
00061 /////////////////////////////////////////////////////////////////////////////
00062 // CRenameDlg dialog
00063
00064 class CRenameDlg : public CDialog
00065 {
00066 // Construction
00067 public:
00068   CRenameDlg(CString sOldName, CWnd* pParent = NULL);   // standard constructor
00069   CString GetName() { return m_sNewName; }
00070
00071 // Dialog Data
00072   //{{AFX_DATA(CRenameDlg)
00073   enum { IDD = IDD_RENAME };
00074   CString m_sName;
00075   //}}AFX_DATA
00076
00077
00078 // Overrides
00079   // ClassWizard generated virtual function overrides
00080   //{{AFX_VIRTUAL(CRenameDlg)
00081   protected:
00082   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00083   //}}AFX_VIRTUAL
00084
00085 // Implementation
00086 protected:
00087   CString m_sNewName;
00088   CString m_sOldName;
00089   // Generated message map functions
00090   //{{AFX_MSG(CRenameDlg)
00091   virtual void OnOK();
00092   virtual BOOL OnInitDialog();
00093   //}}AFX_MSG
00094   DECLARE_MESSAGE_MAP()
00095 };
00096 /////////////////////////////////////////////////////////////////////////////
00097 // CMoveDlg dialog
00098
00099 class CMoveDlg : public CDialog
00100 {
00101 // Construction
00102 public:
00103   CMoveDlg(CWnd* pParent = NULL);   // standard constructor
00104   CString GetObjectPath() { return m_sADsPath; }
00105
00106 // Dialog Data
00107   //{{AFX_DATA(CMoveDlg)
00108   enum { IDD = IDD_MOVE };
00109   CString m_sADsPath;
00110   //}}AFX_DATA
00111
00112
00113 // Overrides
00114   // ClassWizard generated virtual function overrides
00115   //{{AFX_VIRTUAL(CMoveDlg)
00116   protected:
00117   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00118   //}}AFX_VIRTUAL
00119
00120 // Implementation
00121 protected:
00122   // Generated message map functions
00123   //{{AFX_MSG(CMoveDlg)
00124   virtual void OnOK();
00125   afx_msg void OnChangeADspath();
00126   //}}AFX_MSG
00127   DECLARE_MESSAGE_MAP()
00128 };
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/MyDevice_i.c Source File

  • NetDS
  • upnp
  • StepByStep
  • Step3

MyDevice_i.c

Go to the documentation of this file.
00001 /* this file contains the actual definitions of */
00002 /* the IIDs and CLSIDs */
00003
00004 /* link this file in with the server and any clients */
00005
00006
00007 /* File created by MIDL compiler version 5.01.0164 */
00008 /* at Fri Apr 12 22:33:43 2002
00009  */
00010 /* Compiler settings for C:\UPnPSample\SDKDimmer\DimmerDevice\StepByStep\Step3\MyDevice.idl:
00011     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00012     error checks: allocation ref bounds_check enum stub_data
00013 */
00014 //@@MIDL_FILE_HEADING(  )
00015 #ifdef __cplusplus
00016 extern "C"{
00017 #endif
00018
00019
00020 #ifndef __IID_DEFINED__
00021 #define __IID_DEFINED__
00022
00023 typedef struct _IID
00024 {
00025     unsigned long x;
00026     unsigned short s1;
00027     unsigned short s2;
00028     unsigned char  c[8];
00029 } IID;
00030
00031 #endif // __IID_DEFINED__
00032
00033 #ifndef CLSID_DEFINED
00034 #define CLSID_DEFINED
00035 typedef IID CLSID;
00036 #endif // CLSID_DEFINED
00037
00038 const IID LIBID_MYDEVICELib = {0x51AC2F4C,0x3F4F,0x48B3,{0xA0,0x18,0x91,0x0E,0x81,0x67,0x7E,0xEF}};
00039
00040
00041 const IID IID_IUPnPService_DimmingService_SCPD = {0xa315fcbd,0x7f4b,0x4081,{0xa1,0x72,0x2f,0x53,0x4c,0x43,0x89,0x57}};
00042
00043
00044 const CLSID CLSID_Dimmer = {0xd31b8f49,0x367e,0x41b7,{0x8f,0xc4,0x50,0xe2,0x3d,0x36,0x62,0x5d}};
00045
00046
00047 #ifdef __cplusplus
00048 }
00049 #endif
00050
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagPREPAREFORSYNCCOMPLETEDMSG Member List

This is the complete list of members for _tagPREPAREFORSYNCCOMPLETEDMSG, including all inherited members.
hr _tagPREPAREFORSYNCCOMPLETEDMSG
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLocateDialog Member List

This is the complete list of members for CLocateDialog, including all inherited members.
CLocateDialog(CWnd *pParent=NULL) | CLocateDialog |
DoDataExchange(CDataExchange *pDX) | CLocateDialog | [protected, virtual]
GetLabel(TCHAR szLabelBuffer[BUFFERSIZE]) | CLocateDialog | [inline]
IDD enum value | CLocateDialog |
m_szLabel | CLocateDialog |
Generated on Wed Nov 13 2024 16:56:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Accept/common.cpp Source File

  • NetDS
  • WinSock
  • Accept

common.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: Common.cpp
00009 //
00010 // Description:
00011 //             This file contains the functions that are common to
00012 // all types of accept. This includes creating and destroying the listening
00013 // sockets on the requested interfaces and actual processing of the accepted
00014 // socket. These are common because non-blocking accept and AsyncSelect accept
00015 // only differ in the way they are notified to the app, not in the way
00016 // the accepted socket is processed.
00017
00018 #pragma warning (disable: 4267)
00019
00020 #include "common.h"
00021
00022
00023 /*
00024     Prints the given socket address in a printable string format.
00025 */
00026 void PrintAddressString(LPSOCKADDR pSockAddr, DWORD dwSockAddrLen)
00027 {
00028     // INET6_ADDRSTRLEN is the maximum size of a valid IPv6 address
00029     // including port,colons,NULL,etc.
00030     char buf[INET6_ADDRSTRLEN];
00031     DWORD dwBufSize = 0;
00032
00033     memset(buf,0,sizeof(buf));
00034     dwBufSize = sizeof(buf);
00035
00036     // This function converts the pSockAddr to a printable format into buf.
00037     if (WSAAddressToString(pSockAddr,
00038                            dwSockAddrLen,
00039                            NULL,
00040                            buf,
00041                            &dwBufSize) == SOCKET_ERROR)
00042     {
00043         printf("ERROR: WSAAddressToString failed %d \n", WSAGetLastError());
00044         goto CLEANUP;
00045     }
00046
00047     printf("%s\n", buf);
00048
00049 CLEANUP:
00050     return;
00051 }
00052
00053
00054
00055 /*
00056     This function creates a list of sockets for each of the interfaces
00057     on which the server is supposed to listen. For each socket, it binds
00058     it to the requested port and sets up for listening on the socket.
00059 */
00060 void CreateListeningSockets()
00061 {
00062     struct addrinfo hints;
00063     struct addrinfo *res;
00064     struct addrinfo *pAddr;
00065     SOCKET newSock;
00066     PSOCK_INFO pNewSockInfo;
00067     int i;
00068     unsigned long nonBlocking = 1;
00069
00070     printf("Entering CreateListeningSockets()\n");
00071
00072     printf("Creating the list of sockets to listen for ...\n");
00073
00074     // prepare the hints for the type of socket we are interested in.
00075     memset(&hints, 0, sizeof(hints));
00076     hints.ai_family = g_AcceptContext.addressFamily;
00077     hints.ai_protocol = IPPROTO_TCP;
00078     hints.ai_socktype = SOCK_STREAM;
00079     hints.ai_flags = AI_PASSIVE; // since we're going to bind on this socket.
00080
00081     // getaddrinfo is the protocol independent version of GetHostByName.
00082     // the res contains the result.
00083     if (getaddrinfo(g_AcceptContext.szInterface,
00084                 g_AcceptContext.szPort,
00085                 &hints,
00086                 &res) != NO_ERROR)
00087     {
00088         printf("getaddrinfo failed. Error = %d\n", WSAGetLastError());
00089         goto CLEANUP;
00090     }
00091
00092     if (res == NULL)
00093     {
00094         printf("getaddrinfo returned res = NULL\n");
00095         goto CLEANUP;
00096     }
00097
00098     printf("getaddrinfo successful.Enumerating the returned addresses ...\n\n");
00099
00100     // for each returned interface, create a listening socket.
00101     for (pAddr = res, i = 1; pAddr != NULL; pAddr = pAddr->ai_next, i++)
00102     {
00103         printf("Processing Address %d returned by getaddrinfo : ", i);
00104         PrintAddressString(pAddr->ai_addr, pAddr->ai_addrlen);
00105
00106         // create a suitable socket for this interface.
00107         newSock = WSASocket(pAddr->ai_family,
00108                             pAddr->ai_socktype,
00109                             pAddr->ai_protocol,
00110                             NULL,
00111                             NULL,
00112                             0);
00113         if (newSock == INVALID_SOCKET)
00114         {
00115             printf("WSASocket failed. Error = %d\n", WSAGetLastError());
00116             printf("Ignoring this address and continuing with the next. \n\n");
00117
00118             // anyway, let's continue with other addresses.
00119             continue;
00120         }
00121
00122         printf("Created socket with handle = %d\n", newSock);
00123
00124         // bind the socket.
00125         if (bind(newSock, pAddr->ai_addr, pAddr->ai_addrlen) != NO_ERROR)
00126         {
00127             printf("bind failed. Error = %d\n", WSAGetLastError());
00128             closesocket(newSock);
00129             continue;
00130         }
00131
00132         printf("Socket bound successfully\n");
00133
00134         // listen for upto MAX_CLIENTS number of clients.
00135         if (listen(newSock, MAX_CLIENTS) != NO_ERROR)
00136         {
00137             printf("listen failed. Error = %d\n", WSAGetLastError());
00138             closesocket(newSock);
00139             continue;
00140         }
00141
00142         printf("Listen successful\n");
00143
00144         // for non-blocking select, we need to explicitly make the socket
00145         // non-blocking by this call, whereas for WSAAsyncSelect this is
00146         // not required as WSAAsyncSelect itself makes the socket non-blocking.
00147         if (g_AcceptContext.typeOfAccept == NON_BLOCKING_ACCEPT)
00148         {
00149             if (ioctlsocket(newSock, FIONBIO, &nonBlocking) == SOCKET_ERROR)
00150             {
00151                 printf("Can't put socket into non-blocking mode. Error = %d\n",
00152                         WSAGetLastError());
00153             }
00154         }
00155
00156         // allocate a socket info and store this socket.
00157         pNewSockInfo = AllocAndInitSockInfo();
00158         if (pNewSockInfo == NULL)
00159         {
00160             printf("AllocAndInitSockInfo failed.\n");
00161             closesocket(newSock);
00162             continue;
00163         }
00164
00165         pNewSockInfo->sock = newSock;
00166         pNewSockInfo->isSocketListening = TRUE;
00167
00168         // all went well. add this to the list of listening sockets.
00169         AddSockInfoToList(&g_AcceptContext.pSockList, pNewSockInfo);
00170         printf("Added socket to list of listening sockets\n\n");
00171     }
00172
00173
00174 CLEANUP:
00175
00176     // if getaddrinfo was successful, it would have allocated memory for the
00177     // res pointer which needs to be freed.
00178     if (res)
00179     {
00180         freeaddrinfo(res);
00181         printf("Freed the memory allocated for res by getaddrinfo\n");
00182     }
00183
00184     printf("Exiting CreateListeningSockets()\n");
00185     return;
00186 }
00187
00188
00189
00190 /*
00191     This function frees all the resources inside the socket list.
00192 */
00193 void DestroyListeningSockets()
00194 {
00195     PSOCK_INFO pSockInfo,
00196                pNextSockInfo;
00197
00198     printf("Entering DestroyListeningSockets()\n");
00199
00200     // iterate through all the listening sockets and free one by one.
00201     pSockInfo = g_AcceptContext.pSockList;
00202     while (pSockInfo != NULL)
00203     {
00204         // if the socket hasn't been closed already, close it.
00205         if (pSockInfo->sock != INVALID_SOCKET)
00206         {
00207             closesocket(pSockInfo->sock);
00208             printf("Closed socket with handle %d\n", pSockInfo->sock);
00209         }
00210
00211         // free this socket and go to the next.
00212         pNextSockInfo = pSockInfo->next;
00213         FreeSockInfo(pSockInfo);
00214         pSockInfo = pNextSockInfo;
00215     }
00216
00217     printf("Exiting DestroyListeningSockets()\n");
00218     return ;
00219 }
00220
00221
00222 /*
00223     This function does a accept on the socket in which an accept event has
00224     been signalled. It also adds the accepted socket to the global list of
00225     sockets.
00226 */
00227 PSOCK_INFO ProcessAcceptEvent(PSOCK_INFO pSockInfo)
00228 {
00229     SOCKADDR_STORAGE clientAddress;
00230     int clientAddressLen = sizeof(clientAddress);
00231     SOCKET newSock;
00232     PSOCK_INFO pNewSockInfo = NULL;
00233     unsigned long nonBlocking = 1;
00234
00235     printf("Entering ProcessAcceptEvent() on socket %d\n", pSockInfo->sock);
00236
00237     // accept the new connection.
00238     newSock = WSAAccept(pSockInfo->sock,
00239                   (LPSOCKADDR)&clientAddress,
00240                   &clientAddressLen,
00241                   NULL,
00242                   NULL);
00243     if (newSock == INVALID_SOCKET)
00244     {
00245         printf("ERROR: WSAAccept failed. Error = %d\n", WSAGetLastError());
00246         goto CLEANUP;
00247     }
00248
00249     printf("Accepted connection from client:");
00250     PrintAddressString((LPSOCKADDR) &clientAddress, clientAddressLen);
00251
00252     // set the connected socket to non-blocking mode.
00253     if (ioctlsocket(pSockInfo->sock, FIONBIO, &nonBlocking) == SOCKET_ERROR)
00254     {
00255         printf("Can't put socket into non-blocking mode. Error = %d\n",
00256                 WSAGetLastError());
00257     }
00258
00259     // add this socket to the global sockets list.
00260     pNewSockInfo = AllocAndInitSockInfo();
00261     if (pNewSockInfo == NULL)
00262     {
00263         printf("AllocAndInitSockInfo failed.\n");
00264         closesocket(newSock);
00265         goto CLEANUP;
00266     }
00267
00268     pNewSockInfo->sock = newSock;
00269     pNewSockInfo->isSocketListening = FALSE;
00270     AddSockInfoToList(&g_AcceptContext.pSockList, pNewSockInfo);
00271     printf("Added accepted socket %d to list of sockets\n", newSock);
00272
00273 CLEANUP:
00274     printf("Exiting ProcessAcceptEvent()\n");
00275     return pNewSockInfo;
00276 }
00277
00278
00279 /*
00280       This functions reads incoming data on the given socket in which a
00281       read event has been signalled. It read new data only if the previously
00282       received data has been fully sent.
00283 */
00284 BOOL ProcessReadEvent(PSOCK_INFO pSockInfo)
00285 {
00286     BOOL bSocketError = FALSE;
00287     int nBytesRecd;
00288     int err;
00289
00290     printf("Entering ProcessReadEvent() on socket %d\n", pSockInfo->sock);
00291
00292     // check if the previously received data has been fully sent or not.
00293     if (pSockInfo->recdData.isNewData)
00294     {
00295         printf("Previously recd data not yet fully sent.\n");
00296         // here, since we are using only a fixed buffer size for outstanding
00297         // sends, we're not reading the data and hence there might be a
00298         // deadlock if the remote side only sends but doesn't receive at all.
00299         // also, if the remote side has closed without reading all the
00300         // data in the pipe, we may not know about it as we might get the
00301         // FD_CLOSE event only after all the FD_READ events have been
00302         // processed. so, to avoid these, the app should implement a timeout
00303         // on each socket so that malicious clients don't make the server
00304         // run out of resources and do a denial-of-service attack.
00305
00306         // on the other hand, if we dynamically allocated memory for each
00307         // recv and queued it, we may not hit this deadlock, but still such
00308         // malicious clients can send too many data and not read at all and
00309         // thus perform a denial-of-service attack by making server run out
00310         // of memory. so, there has to be a upper limit for per-socket
00311         // memory usage or timeout to avoid such attacks.
00312         Sleep(2000);
00313         goto CLEANUP;
00314     }
00315
00316     // previous data fully sent, now, recv the new data.
00317     memset(&pSockInfo->recdData,0,sizeof(pSockInfo->recdData));
00318
00319     nBytesRecd = recv(pSockInfo->sock,
00320                       pSockInfo->recdData.buf,
00321                       RECV_DATA_SIZE - 1,
00322                       0);
00323     if (nBytesRecd < 0)
00324     {
00325         err = WSAGetLastError();
00326         if (err == WSAEWOULDBLOCK)
00327         {
00328             printf("recv got WSAEWOULDBLOCK. Will retry recv later ...\n");
00329             bSocketError = FALSE; // not a real error.
00330         }
00331         else
00332         {
00333             printf("ERROR: recv failed. error = %d\n", err);
00334             bSocketError = TRUE;
00335         }
00336         goto CLEANUP;
00337     }
00338     if (nBytesRecd == 0)
00339     {
00340         printf("recv returned 0. Remote side has closed gracefully. Good.\n");
00341         bSocketError = TRUE;
00342         goto CLEANUP;
00343     }
00344
00345     // update the stats.
00346     pSockInfo->recdData.dataSize = nBytesRecd;
00347     pSockInfo->nTotalRecd += nBytesRecd;
00348     pSockInfo->recdData.isNewData = TRUE;
00349
00350     printf("Received data = %s, length = %d\n", pSockInfo->recdData.buf,
00351                                                 nBytesRecd);
00352
00353 CLEANUP:
00354
00355     printf("Exiting ProcessReadEvent()\n");
00356     return bSocketError;
00357
00358 }
00359
00360 /*
00361     This functions sends data on the socket in which a write event has been
00362     signalled. If sends only if the socket has some newly received data to
00363     send. In case if the entire data in the recdData buffer could not be
00364     sent, this function remembers the offset at which to resume the next
00365     send. It signals that the data has been "fully" sent only after sending
00366     all of the data in the buffer.
00367 */
00368 BOOL SendData(PSOCK_INFO pSockInfo)
00369 {
00370     BOOL bSocketError = FALSE;
00371     int nBytesSent;
00372     int err;
00373
00374     printf("Entering SendData() on socket %d\n", pSockInfo->sock);
00375
00376     // check if there's any data received in the buffer after the last one
00377     // we sent out.
00378     if (!pSockInfo->recdData.isNewData || pSockInfo->recdData.dataSize <= 0)
00379     {
00380         printf("No data pending to be sent.\n");
00381         goto CLEANUP;
00382     }
00383
00384     // if the data buffer contains new data, begin sending from the start
00385     // otherwise, begin sending from the point we left in the last call.
00386     nBytesSent = send(pSockInfo->sock,
00387                       pSockInfo->recdData.buf + pSockInfo->recdData.sendOffset,
00388                       pSockInfo->recdData.dataSize,
00389                       0);
00390     if (nBytesSent == SOCKET_ERROR)
00391     {
00392         err = WSAGetLastError();
00393         if (err == WSAEWOULDBLOCK)
00394         {
00395             printf("send got WSAEWOULDBLOCK. Will retry send later ...\n");
00396             bSocketError = FALSE; // not a real error.
00397         }
00398         else
00399         {
00400             printf("ERROR: send failed. error = %d\n", err);
00401             bSocketError = TRUE;
00402         }
00403         goto CLEANUP;
00404     }
00405
00406     // update the stats.
00407     pSockInfo->recdData.sendOffset += nBytesSent;
00408     pSockInfo->recdData.dataSize -= nBytesSent;
00409
00410     // consider data as "fully" sent only when the entire buf has been sent.
00411     if (pSockInfo->recdData.dataSize == 0)
00412         pSockInfo->recdData.isNewData = FALSE;
00413     pSockInfo->nTotalSent += nBytesSent;
00414     printf("Sent %d bytes. Remaining = %d bytes.\n", nBytesSent,
00415                                         pSockInfo->recdData.dataSize);
00416
00417 CLEANUP:
00418
00419     printf("Exiting SendData()\n");
00420     return bSocketError;
00421 }
00422
00423
00424
Generated on Wed Nov 13 2024 16:52:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

treeitem Member List

This is the complete list of members for treeitem, including all inherited members.
data | treeitem
key | treeitem
left | treeitem
length | treeitem
right | treeitem
root | treeitem
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/Qoslist/Qoslist.Cpp Source File

  • NetDS
  • GQos
  • Qoslist

Qoslist.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // This applications prints out a list (-l) of the names of predefined Qos
00009 // templates using WSAGetQosByName.  The program also allows a new QoS
00010 // template to be added to the system (-a), either service provider specific
00011 // or global to all providers (-g).  Finally, the program allows the added
00012 // QoS template to be removed.
00013 //
00014 // To ensure that system-defined templates do not get inadvertantly removed,
00015 // only the "special" QoS template that is added by this program can be
00016 // removed.
00017 //
00018 // Usage:
00019 //      List all QoS templates
00020 //          qoslist
00021 //          qoslist -l
00022 //      Add a global QoS template
00023 //          qoslist -a -g
00024 //      Delete a global QoS template
00025 //          qoslist -d -g
00026 //
00027 // Build:
00028 //      Use the headers and libs from the NT5 Beta 2 Platform SDK or later.
00029 //      Link with ws2_32.lib and qosname.lib
00030 //
00031
00032
00033 #define WINVER 0x0500
00034 #include <winsock2.h>
00035 #include <ws2tcpip.h>
00036 #include <ws2spi.h>
00037 #include <qos.h>
00038 #include <qossp.h>
00039 #include <qosname.h>
00040 #include <stdio.h>
00041
00042
00043
00044 #define QOSTEST "qostest"
00045
00046
00047
00048 typedef enum
00049     {
00050     CMD_OPTION_ADD,
00051     CMD_OPTION_DEL,
00052     CMD_OPTION_LIST
00053     } TEMPLATE_CMD;
00054
00055 typedef struct _OPTIONS
00056     {
00057     TEMPLATE_CMD    template_cmd;
00058     BOOL            bGlobalTemplate;
00059     } OPTIONS;
00060
00061
00062 FLOWSPEC default_qostest =
00063     {
00064     65000,
00065     6500,
00066     135000,
00067     QOS_NOT_SPECIFIED,
00068     QOS_NOT_SPECIFIED,
00069     SERVICETYPE_GUARANTEED,
00070     350,
00071     350
00072     };
00073
00074
00075
00076 static BOOL FindServiceProvider(WSAPROTOCOL_INFO *pProtocolInfo);
00077 static BOOL AddQos(SOCKET sd, BOOL bGlobalTemplate, WSAPROTOCOL_INFO *pProtocolInfo);
00078 static BOOL DeleteQos(SOCKET sd, BOOL bGlobalTemplate, WSAPROTOCOL_INFO *pProtocolInfo);
00079 static BOOL ListQos(SOCKET sd);
00080
00081 static BOOL ValidOptions(char *argv[], int argc, OPTIONS *pOptions);
00082 static void Usage(CHAR *szProgramname);
00083
00084
00085
00086 int main(int argc, char *argv[])
00087     {
00088     OPTIONS options;
00089     WSADATA WSAData;
00090     WSAPROTOCOL_INFO protocol_info;
00091     SOCKET sd;
00092     int status;
00093
00094     if (!ValidOptions(argv, argc, &options))
00095         exit(1);
00096
00097     status = WSAStartup(MAKEWORD(2,2), &WSAData);
00098     if (status != NO_ERROR)
00099         {
00100         printf("WSAStartup %d", status);
00101         exit(1);
00102         }
00103
00104     if (!FindServiceProvider(&protocol_info))
00105         {
00106         printf("Suitable GQOS Service Provider not found\n");
00107         exit(1);
00108         }
00109
00110     sd = WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
00111             &protocol_info, 0, WSA_FLAG_OVERLAPPED);
00112     if (INVALID_SOCKET != sd)
00113         {
00114         switch (options.template_cmd)
00115             {
00116             case CMD_OPTION_ADD:
00117                 AddQos(sd, options.bGlobalTemplate, &protocol_info);
00118                 break;
00119
00120             case CMD_OPTION_DEL:
00121                 DeleteQos(sd, options.bGlobalTemplate, &protocol_info);
00122                 break;
00123
00124             case CMD_OPTION_LIST:
00125                 ListQos(sd);
00126                 break;
00127             }
00128         closesocket(sd);
00129         }   else printf("WSASocket Failed with error %d\n", WSAGetLastError());
00130     WSACleanup();
00131     return(0);
00132     }
00133
00134
00135 // Abstract:
00136 //      Look for a QoS-enabled TCP service provider.  NOTE:  actual
00137 //      service provider names are different on NT and Win9x when
00138 //      searching for a service provider, you should not use the service
00139 //      provider name, but instead use the various flags in the protocol
00140 //      structure.
00141 //
00142 static BOOL FindServiceProvider(
00143     WSAPROTOCOL_INFO    *pProtocolInfo
00144     )
00145     {
00146     int nRet;
00147     WSAPROTOCOL_INFO *lpProtocolBuf = NULL;
00148     DWORD dwBufLen = 0;
00149     DWORD dwErr;
00150     BOOL bProtocolFound = FALSE;
00151
00152
00153     // force WSAEnumProtocols to indicate needed size for buffer
00154     if (SOCKET_ERROR != WSAEnumProtocols(NULL, lpProtocolBuf, &dwBufLen))
00155         {
00156         printf("WSAEnumProtocols: shouldn't be here since initial buffer not large enough\n");
00157         return(FALSE);
00158         }
00159     else if (WSAENOBUFS != (dwErr = WSAGetLastError()))
00160         {
00161         // we failed for some reason not relating to buffer size
00162         printf("WSAEnumProtocols: %d\n", dwErr);
00163         return(FALSE);
00164         }
00165
00166     // we know the buffer size
00167     if (NULL == (lpProtocolBuf = (WSAPROTOCOL_INFO *)malloc(dwBufLen)))
00168         {
00169         printf("malloc failed in FindServiceProvider\n");
00170         return(FALSE);
00171         }
00172
00173     if (SOCKET_ERROR == (nRet = WSAEnumProtocols(NULL, lpProtocolBuf, &dwBufLen)))
00174         {
00175         printf("WSAEnumProtocols: 2nd time %d\n", WSAGetLastError());
00176         free(lpProtocolBuf);
00177         return(FALSE);
00178         }
00179
00180
00181     // loop thru protocols, looking for the  matching service provider
00182     for (int i=0; i<nRet; i++)
00183         {
00184         if (AF_INET == lpProtocolBuf[i].iAddressFamily &&
00185             IPPROTO_TCP == lpProtocolBuf[i].iProtocol)
00186             {
00187             if (XP1_QOS_SUPPORTED == (XP1_QOS_SUPPORTED & lpProtocolBuf[i].dwServiceFlags1))
00188                 {
00189                 *pProtocolInfo = lpProtocolBuf[i];
00190                 bProtocolFound = TRUE;
00191                 break;
00192                 }
00193             }
00194         }
00195
00196     free(lpProtocolBuf);
00197
00198     if (bProtocolFound)
00199         printf("Using service provider <%s>\n\n", pProtocolInfo->szProtocol);
00200
00201     return(bProtocolFound);
00202     }
00203
00204
00205 // Abstract:
00206 //      Add either a service provider QoS template or global QoS template.
00207 //
00208 static BOOL AddQos(
00209     SOCKET              sd,
00210     BOOL                bGlobalTemplate,
00211     WSAPROTOCOL_INFO    *pProtocolInfo
00212     )
00213     {
00214     QOS     qos;
00215     WSABUF  wsabuf;
00216     CHAR    szQosname[256];
00217
00218
00219     ZeroMemory((char *)&qos, sizeof(qos));
00220     qos.SendingFlowspec = default_qostest;
00221
00222     strcpy(szQosname, QOSTEST);
00223     if (bGlobalTemplate)
00224         strcat(szQosname, "_g");
00225
00226     ZeroMemory((char *)&wsabuf, sizeof(wsabuf));
00227     wsabuf.len = (int) strlen(szQosname) + 1;
00228     wsabuf.buf = (char *)malloc(wsabuf.len);
00229     if (wsabuf.buf == NULL)
00230       {
00231        printf("malloc failed in AddQos\n");
00232        return (FALSE);
00233       }
00234     strcpy(wsabuf.buf, szQosname);
00235     if (!WSCInstallQOSTemplate((bGlobalTemplate ? NULL : &pProtocolInfo->ProviderId), &wsabuf, &qos))
00236       {
00237        printf("WSCInstallQOSTemplate: %d\n", WSAGetLastError());
00238        free(wsabuf.buf);
00239        return (FALSE);
00240       }
00241     printf("Added QOS template <%s>\n", szQosname);
00242     free(wsabuf.buf);
00243
00244     return(TRUE);
00245     }
00246
00247
00248 // Abstract:
00249 //      Delete either a service provider QoS template or global QoS
00250 //      template.
00251 //
00252 static BOOL DeleteQos(
00253     SOCKET              sd,
00254     BOOL                bGlobalTemplate,
00255     WSAPROTOCOL_INFO    *pProtocolInfo
00256     )
00257     {
00258     WSABUF  wsabuf;
00259     CHAR    szQosname[256];
00260
00261
00262     strcpy(szQosname, QOSTEST);
00263     if (bGlobalTemplate)
00264         strcat(szQosname, "_g");
00265
00266     ZeroMemory((char *)&wsabuf, sizeof(wsabuf));
00267     wsabuf.len = (int) strlen(szQosname) + 1;
00268     wsabuf.buf = (char *)malloc(wsabuf.len);
00269     if (wsabuf.buf == NULL)
00270       {
00271        printf("malloc fail in DeleteQos\n");
00272        return(FALSE);
00273       }
00274     strcpy(wsabuf.buf, szQosname);
00275     if (!(WSCRemoveQOSTemplate((bGlobalTemplate ? NULL : &pProtocolInfo->ProviderId), &wsabuf)))
00276       {
00277         printf("WSCRemoveQOSTemplate: %d\n", WSAGetLastError());
00278         free(wsabuf.buf);
00279         return(FALSE);
00280       }
00281
00282     printf("Removed QOS template <%s>\n", szQosname);
00283     free(wsabuf.buf);
00284     return(TRUE);
00285     }
00286
00287
00288 // Abstract:
00289 //      Obtain a list of QoS templates and confirm that the QOS structure //      for it can be retreived.
00290 //
00291 static BOOL ListQos(
00292     SOCKET sd
00293     )
00294     {
00295     WSABUF qoslist;
00296     WSABUF qosname;
00297     QOS qos;
00298
00299
00300     ZeroMemory(&qoslist, sizeof(qoslist));
00301     ZeroMemory(&qosname, sizeof(qosname));
00302     ZeroMemory(&qos, sizeof(qos));  //needed
00303
00304     // get list of predefined Qos names
00305     qoslist.len = 2048;   // pick large buffer to hold list of QOS names
00306     qoslist.buf = (char *)malloc(qoslist.len);
00307     if (qoslist.buf == NULL)
00308       {
00309         printf("malloc failed in ListQos\n");
00310         return FALSE;
00311       }
00312
00313     qoslist.buf[0] = '\0';
00314     if (!WSAGetQOSByName(sd, &qoslist, &qos))
00315       {
00316        printf("WSAGetQOSByName[1]: err: %d len: %d\n", WSAGetLastError(), qoslist.len);
00317        free(qoslist.buf);
00318        return (FALSE);
00319       }
00320
00321     char *p = qoslist.buf;
00322     while (strlen(p))
00323         {
00324         qosname.len = (int) (strlen(p)+1);  // advance to next QOS name
00325         if (NULL == (qosname.buf = (char *)malloc(qosname.len)))
00326             {
00327             printf("malloc failed in ListQos\n");
00328             free(qoslist.buf);
00329             return (FALSE);
00330             }
00331
00332         strcpy(qosname.buf, p);
00333         // confirm you can retrieve the associated Qos structure
00334         if (!WSAGetQOSByName(sd, &qosname, &qos))
00335             printf("WSAGetQosByName[2] failed: %d - qosname = <%s>\n",
00336                 WSAGetLastError(), qosname.buf);
00337         else
00338                 printf("QOS name = <%s>\n", p);
00339         free(qosname.buf);
00340
00341         p += strlen(p) + 1;  // advance to next name
00342         }
00343
00344     free(qoslist.buf);
00345
00346     return(TRUE);
00347     }
00348
00349
00350 // Abstract:
00351 //      Verify options passed in and set options structure accordingly.
00352 //
00353 static BOOL ValidOptions(
00354     char        *argv[],
00355     int         argc,
00356     OPTIONS     *pOptions
00357     )
00358     {
00359     BOOL bValidOptions = TRUE;
00360
00361
00362     pOptions->template_cmd    = CMD_OPTION_LIST;
00363     pOptions->bGlobalTemplate = FALSE;
00364
00365     for (int i=1; i<argc; i++)
00366         {
00367         if ((argv[i][0] == '-') || (argv[i][0] == '/') )
00368             {
00369             switch(tolower(argv[i][1]))
00370                 {
00371                 case 'a' :
00372                     pOptions->template_cmd = CMD_OPTION_ADD;
00373                     break;
00374
00375                 case 'r' :
00376                 case 'd' :
00377                     pOptions->template_cmd = CMD_OPTION_DEL;
00378                     break;
00379
00380                 case 'l' :
00381                     pOptions->template_cmd = CMD_OPTION_LIST;
00382                     break;
00383
00384                 case 'g' :
00385                     pOptions->bGlobalTemplate = TRUE;
00386                     break;
00387
00388                 case '?' :
00389                     Usage(argv[0]);
00390                     return(FALSE);
00391                     break;
00392
00393                 default:
00394                     printf("  unknown options flag %s\n", argv[i]);
00395                     Usage(argv[0]);
00396                     return(FALSE);
00397                     break;
00398                 }
00399             }
00400         else
00401             {
00402             printf("  unknown option %s\n", argv[i]);
00403             Usage(argv[0]);
00404             return(FALSE);
00405             }
00406         }
00407
00408     return(TRUE);
00409     }
00410
00411
00412 // Abstract:
00413 //      Print out usage table for the program
00414 //
00415 static void Usage(
00416     CHAR    *szProgramname
00417     )
00418     {
00419     printf("usage:\n%s [-a | -d | -l]\n", szProgramname);
00420     printf("%s -?\n", szProgramname);
00421     printf("  -?\t\tDisplay this help\n");
00422     printf("  -a\t\tInstall a predefined QOS template called qostest\n");
00423     printf("  -d|r\t\tRemove the special qostest QOS template\n");
00424     printf("  -g\t\tInstall/remove a global template versus a provider-specific\n");
00425     printf("  -l\t\tList out all installed QOS templates and their contents\n");
00426     return;
00427     }
00428
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/globals.h Source File

  • SysMgmt
  • MMC
  • Toolbar

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025         #define IDM_BUTTON1    0x100
00026         #define IDM_BUTTON2    0x101
00027
00028         extern HINSTANCE g_hinst;
00029         extern ULONG g_uObjects;
00030
00031         #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032         #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034         // uncomment the following #define to enable message cracking
00035         // #define MMC_CRACK_MESSAGES
00036         void MMCN_Crack(BOOL bComponentData,
00037                                         IDataObject *pDataObject,
00038                                         IComponentData *pCompData,
00039                                         IComponent *pComp,
00040                                         MMC_NOTIFY_TYPE event,
00041                                         LPARAM arg,
00042                                         LPARAM param);
00043 #endif
00044
00045 //=--------------------------------------------------------------------------=
00046 // allocates a temporary buffer that will disappear when it goes out of scope
00047 // NOTE: be careful of that -- make sure you use the string in the same or
00048 // nested scope in which you created this buffer. people should not use this
00049 // class directly.  use the macro(s) below.
00050 //
00051 class TempBuffer {
00052   public:
00053     TempBuffer(ULONG cBytes) {
00054         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00055         m_fHeapAlloc = (cBytes > 120);
00056     }
00057     ~TempBuffer() {
00058         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00059     }
00060     void *GetBuffer() {
00061         return m_pBuf;
00062     }
00063
00064   private:
00065     void *m_pBuf;
00066     // we'll use this temp buffer for small cases.
00067     //
00068     char  m_szTmpBuf[120];
00069     unsigned m_fHeapAlloc:1;
00070 };
00071
00072 //=--------------------------------------------------------------------------=
00073 // string helpers.
00074 //
00075 // given a _TCHAR, copy it into a wide buffer.
00076 // be careful about scoping when using this macro!
00077 //
00078 // how to use the below two macros:
00079 //
00080 //  ...
00081 //  LPTSTR pszT;
00082 //  pszT = MyGetTStringRoutine();
00083 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00084 //  MyUseWideStringRoutine(pwsz);
00085 //  ...
00086 #ifdef UNICODE
00087 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00088     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00089     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00090     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00091     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00092 #else // ANSI
00093 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00094     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00095     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00096     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00097     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00098     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00099 #endif
00100
00101 #ifdef UNICODE
00102 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00103     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00104     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00105     lstrcpyW((LPWSTR)ptrname, tstr)
00106 #else // ANSI
00107 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00108     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00109     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00110     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00111     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00112 #endif
00113
00114 //
00115 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00116 // have to be declared, and no clean up must be done.
00117 //
00118 // * 2 for DBCS handling in below length computation
00119 //
00120 #ifdef UNICODE
00121 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00122     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00123     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00124     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00125     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00126 #else // ANSI
00127 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00128     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00129     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00130     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00131     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00132 #endif
00133
00134 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_smffileinfo Member List

This is the complete list of members for tag_smffileinfo, including all inherited members.
dwFormat | tag_smffileinfo
dwTimeDivision | tag_smffileinfo
dwTracks | tag_smffileinfo
tkLength | tag_smffileinfo
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/rncp.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

rncp.h

Go to the documentation of this file.
00001 // Start of the RNCP.h
00002
00003 #ifndef _RNCP_104C2CC1_6D0F_11d3_AC96_00C04F8DB3D5_H_
00004 #define _RNCP_104C2CC1_6D0F_11d3_AC96_00C04F8DB3D5_H_
00005
00006 template <class T>
00007 class CProxyIRowsetNotify : public IConnectionPointImpl<T, &IID_IRowsetNotify, CComDynamicUnkArray>
00008 {
00009 public:
00010   HRESULT Fire_OnFieldChange(IRowset * pRowset, HROW hRow, ULONG cColumns, ULONG * rgColumns, ULONG eReason, ULONG ePhase, LONG fCantDeny)
00011   {
00012     HRESULT ret = S_OK;
00013     T* pT = static_cast<T*>(this);
00014     int nConnectionIndex;
00015     int nConnections = m_vec.GetSize();
00016
00017     for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00018     {
00019       pT->Lock();
00020       CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00021       pT->Unlock();
00022       IRowsetNotify* pIRowsetNotify = reinterpret_cast<IRowsetNotify*>(sp.p);
00023       if (pIRowsetNotify != NULL)
00024         ret = pIRowsetNotify->OnFieldChange(pRowset, hRow, cColumns, rgColumns, eReason, ePhase, fCantDeny);
00025     } return ret;
00026
00027   }
00028   HRESULT Fire_RemoteOnFieldChange(IRowset * pRowset, HROW hRow, ULONG cColumns, ULONG * rgColumns, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo * * ppErrorInfoRem)
00029   {
00030     HRESULT ret = S_OK;
00031     T* pT = static_cast<T*>(this);
00032     int nConnectionIndex;
00033     int nConnections = m_vec.GetSize();
00034
00035     for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00036     {
00037       pT->Lock();
00038       CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00039       pT->Unlock();
00040       IRowsetNotify* pIRowsetNotify = reinterpret_cast<IRowsetNotify*>(sp.p);
00041       if (pIRowsetNotify != NULL)
00042         ret = pIRowsetNotify->RemoteOnFieldChange(pRowset, hRow, cColumns, rgColumns, eReason, ePhase, fCantDeny, ppErrorInfoRem);
00043     } return ret;
00044
00045   }
00046   HRESULT Fire_OnRowChange(IRowset * pRowset, ULONG cRows, const HROW* rghRows, ULONG eReason, ULONG ePhase, LONG fCantDeny)
00047   {
00048     HRESULT ret = S_OK;
00049     T* pT = static_cast<T*>(this);
00050     int nConnectionIndex;
00051     int nConnections = m_vec.GetSize();
00052
00053     for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00054     {
00055       pT->Lock();
00056       CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00057       pT->Unlock();
00058       IRowsetNotify* pIRowsetNotify = reinterpret_cast<IRowsetNotify*>(sp.p);
00059       if (pIRowsetNotify != NULL)
00060         ret = pIRowsetNotify->OnRowChange(pRowset, cRows, rghRows, eReason, ePhase, fCantDeny);
00061     } return ret;
00062
00063   }
00064   HRESULT Fire_RemoteOnRowChange(IRowset * pRowset, ULONG cRows, const HROW* rghRows, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo * * ppErrorInfoRem)
00065   {
00066     HRESULT ret = S_OK;
00067     T* pT = static_cast<T*>(this);
00068     int nConnectionIndex;
00069     int nConnections = m_vec.GetSize();
00070
00071     for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00072     {
00073       pT->Lock();
00074       CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00075       pT->Unlock();
00076       IRowsetNotify* pIRowsetNotify = reinterpret_cast<IRowsetNotify*>(sp.p);
00077       if (pIRowsetNotify != NULL)
00078         ret = pIRowsetNotify->RemoteOnRowChange(pRowset, cRows, rghRows, eReason, ePhase, fCantDeny, ppErrorInfoRem);
00079     } return ret;
00080
00081   }
00082   HRESULT Fire_OnRowsetChange(IRowset * pRowset, ULONG eReason, ULONG ePhase, LONG fCantDeny)
00083   {
00084     HRESULT ret = S_OK;
00085     T* pT = static_cast<T*>(this);
00086     int nConnectionIndex;
00087     int nConnections = m_vec.GetSize();
00088
00089     for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00090     {
00091       pT->Lock();
00092       CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00093       pT->Unlock();
00094       IRowsetNotify* pIRowsetNotify = reinterpret_cast<IRowsetNotify*>(sp.p);
00095       if (pIRowsetNotify != NULL)
00096         ret = pIRowsetNotify->OnRowsetChange(pRowset, eReason, ePhase, fCantDeny);
00097     } return ret;
00098
00099   }
00100   HRESULT Fire_RemoteOnRowsetChange(IRowset * pRowset, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo * * ppErrorInfoRem)
00101   {
00102     HRESULT ret = S_OK;
00103     T* pT = static_cast<T*>(this);
00104     int nConnectionIndex;
00105     int nConnections = m_vec.GetSize();
00106
00107     for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
00108     {
00109       pT->Lock();
00110       CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
00111       pT->Unlock();
00112       IRowsetNotify* pIRowsetNotify = reinterpret_cast<IRowsetNotify*>(sp.p);
00113       if (pIRowsetNotify != NULL)
00114         ret = pIRowsetNotify->RemoteOnRowsetChange(pRowset, eReason, ePhase, fCantDeny, ppErrorInfoRem);
00115     } return ret;
00116
00117   }
00118 };
00119 #endif
00120
00121 // Start of the RNCP.h
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/backgrnd.h Source File

  • SysMgmt
  • MMC
  • CutCopy

backgrnd.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BACKGROUND_H
00021 #define _BACKGROUND_H
00022
00023 #include "DeleBase.h"
00024
00025 class CBackground : public CDelegationBase {
00026 public:
00027     CBackground(int id) : m_itemId(NULL), m_id(id) { }
00028     virtual ~CBackground() {}
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_BACKGROUND; }
00033
00034 private:
00035     enum { IDM_NEW_BACKGROUND = 6 };
00036
00037     static const GUID thisGuid;
00038     int m_id;
00039     HSCOPEITEM m_itemId;
00040 };
00041
00042 class CBackgroundFolder : public CDelegationBase {
00043 public:
00044     CBackgroundFolder();
00045     virtual ~CBackgroundFolder();
00046
00047     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Background Objects"); }
00048     virtual const GUID & getNodeType() { return thisGuid; }
00049     virtual const int GetBitmapIndex() { return INDEX_BACKGROUND; }
00050
00051 public:
00052     // virtual functions go here (for MMCN_*)
00053     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00054     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00055     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00056     virtual HRESULT OnRefresh();
00057
00058 private:
00059     enum { MAX_CHILDREN = 30 };
00060
00061     CBackground *m_children[MAX_CHILDREN];
00062
00063     HWND m_backgroundHwnd;
00064
00065     static const GUID thisGuid;
00066
00067     static LRESULT CALLBACK WindowProc(
00068           HWND hwnd,      // handle to window
00069           UINT uMsg,      // message identifier
00070           WPARAM wParam,  // first message parameter
00071           LPARAM lParam   // second message parameter
00072         );
00073
00074     static DWORD WINAPI ThreadProc(
00075       LPVOID lpParameter   // thread data
00076     );
00077
00078     DWORD m_threadId;
00079     HANDLE m_thread;
00080     bool m_running;
00081
00082     IConsoleNameSpace *m_pConsoleNameSpace;
00083     HSCOPEITEM m_scopeitem;
00084     void AddItem(int id);
00085
00086     CRITICAL_SECTION m_critSect;
00087
00088     void StopThread();
00089     void StartThread();
00090
00091     bool m_bSelected;
00092     bool m_bViewUpdated;
00093 };
00094
00095
00096 #endif // _BACKGROUND_H
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_tempomapentry Member List

This is the complete list of members for tag_tempomapentry, including all inherited members.
dwTempo | tag_tempomapentry
msBase | tag_tempomapentry
tkTempo | tag_tempomapentry
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/IconPRO.C Source File

  • WinUI
  • Resource
  • Iconpro

IconPRO.C

Go to the documentation of this file.
00001 /****************************************************************************\
00002 *
00003 *     FILE:     ICONPRO.C
00004 *
00005 *     PURPOSE:  IconPro Project main C file
00006 *
00007 *     COMMENTS: This file contains the main window and instance handing
00008 *               for this project.
00009 *
00010 *     FUNCTIONS:
00011 *      EXPORTS:
00012 *               GetSaveIconFileName     - Get the name of the file to write
00013 *               GetOpenIconFileName     - Get the name of a file to open
00014 *      LOCALS:
00015 *               WinMain                 - Program entry point
00016 *               InitApplication         - Register classes
00017 *               InitInstance            - Create windows
00018 *               WndProc                 - Main Window's 'Window Procedure'
00019 *               OnCommand               - Handle command messages (menu items)
00020 *               AboutDlgProc            - About Dialog Box's 'Window Procedure'
00021 *               CreateNewMDIChildWindow - Creates a new child MDI window
00022 *               UpdateMenuState         - Grays/enables appropriate menu items
00023 *               QueryCloseAllChildren   - Close all children if possible
00024 *
00025 *     Copyright 1995 - 2000 Microsoft Corp.
00026 *
00027 *
00028 * History:
00029 *                July '95 - Created
00030 *
00031 \****************************************************************************/
00032 #include <Windows.H>
00033 #include <commdlg.h>
00034 #include "Resource.h"
00035 #include "Icons.H"
00036 #include "IconPro.h"
00037 #include "MDIChild.h"
00038
00039 /****************************************************************************/
00040 /* Local Function Prototypes */
00041 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpszCmdLine, int nCmdShow);
00042 BOOL InitApplication( HANDLE hInstance );
00043 BOOL InitInstance( HANDLE hInstance, int nCmdShow );
00044 LRESULT CALLBACK WndProc( HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam );
00045 LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam );
00046 BOOL CALLBACK AboutDlgProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
00047 HWND CreateNewMDIChildWindow( PTSTR szTitle, PVOID lpData );
00048 BOOL UpdateMenuState( HWND hWnd, HMENU hMenu );
00049 BOOL QueryCloseAllChildren( void );
00050 /****************************************************************************/
00051
00052
00053 /****************************************************************************/
00054 /* Global Variables */
00055 HINSTANCE hInst;
00056 HWND        hWndMain, hMDIClientWnd;
00057 TCHAR       szAppName[] = TEXT("IconPro");
00058 TCHAR       szTitle[] = TEXT("IconPro Icon Handler");
00059 TCHAR       szChildClassName[] = TEXT("IconChildClass");
00060 TCHAR       szHelpFileName[] = TEXT("IconPro.HLP");
00061 /****************************************************************************/
00062
00063
00064 /****************************************************************************
00065 *
00066 *     FUNCTION: WinMain
00067 *
00068 *     PURPOSE:  Main entry point for this app
00069 *
00070 *     PARAMS:   HANDLE hInstance     - This instance
00071 *               HANDLE hPrevInstance - Previous instance
00072 *               PSTR  lpszCmdLine   - Command Line
00073 *               int    nCmdShow      - Desired window status
00074 *
00075 *     RETURNS:  int - return code
00076 *
00077 * History:
00078 *                July '95 - Created
00079 *
00080 \****************************************************************************/
00081 int WINAPI WinMain (
00082     HINSTANCE hInstance,
00083     HINSTANCE hPrevInstance,
00084     PSTR lpszCmdLine,
00085     int nCmdShow)
00086 {
00087     MSG msg;
00088     BOOL bRet = FALSE;
00089
00090     // standard init stuff
00091     if( ! hPrevInstance )
00092     {
00093         if( ! InitApplication( hInstance ) )
00094         {
00095             return FALSE;
00096         }
00097     }
00098     if( ! InitInstance( hInstance, nCmdShow ) )
00099     {
00100         return FALSE;
00101     }
00102
00103     // Standard message loop
00104     while ((bRet = GetMessage(&msg, (HWND) NULL, 0, 0)) != 0)
00105     {
00106         if (bRet == -1)
00107         {
00108             goto exit_func;
00109         }
00110         else
00111         {
00112             if( !TranslateMDISysAccel(hMDIClientWnd, &msg) )
00113             {
00114                 TranslateMessage(&msg);
00115                 DispatchMessage(&msg);
00116             }
00117         }
00118     }
00119
00120 exit_func:
00121     return (int)msg.wParam;
00122 }
00123 /* End WinMain() ************************************************************/
00124
00125
00126
00127 /****************************************************************************
00128 *
00129 *     FUNCTION: InitApplication
00130 *
00131 *     PURPOSE:  Register classes
00132 *
00133 *     PARAMS:   HANDLE hInstance     - This instance
00134 *
00135 *     RETURNS:  BOOL - TRUE for success, FALSE for failure
00136 *
00137 * History:
00138 *                July '95 - Created
00139 *
00140 \****************************************************************************/
00141 BOOL InitApplication (
00142     HANDLE hInstance )
00143 {
00144     WNDCLASS    wc = {0};
00145     BOOL        bResult;
00146
00147     wc.lpfnWndProc   = (WNDPROC)WndProc;
00148     wc.hInstance     = hInstance;
00149     wc.hIcon         = LoadIcon( hInstance, MAKEINTRESOURCE(ICONPRO_ICON) );
00150     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00151     wc.lpszMenuName  = MAKEINTRESOURCE(ICONPRO_MENU);
00152     wc.lpszClassName = szAppName;
00153
00154     bResult = RegisterClass( &wc );
00155
00156     wc.lpfnWndProc   = (WNDPROC)IconChildWndProc;
00157     wc.cbClsExtra    = 0;
00158     wc.cbWndExtra    = 0;
00159     wc.hInstance     = hInstance;
00160     wc.hIcon         = LoadIcon( hInstance, MAKEINTRESOURCE(ICONPRO_ICON) );
00161     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00162     wc.hbrBackground = CreateSolidBrush(COLOR_3DFACE);
00163     wc.lpszMenuName  = NULL;
00164     wc.lpszClassName = szChildClassName;
00165
00166     return( bResult && RegisterClass( &wc ) );
00167 }
00168 /* End InitApplication() ***************************************************/
00169
00170
00171
00172 /****************************************************************************
00173 *
00174 *     FUNCTION: InitInstance
00175 *
00176 *     PURPOSE:  Create and show the main window
00177 *
00178 *     PARAMS:   HANDLE hInstance  - This instance
00179 *               int    nCmdShow   - desired show state
00180 *
00181 *     RETURNS:  BOOL - TRUE for success, FALSE for failure
00182 *
00183 * History:
00184 *                July '95 - Created
00185 *
00186 \****************************************************************************/
00187 BOOL InitInstance (
00188     HANDLE hInstance,
00189     int nCmdShow )
00190 {
00191     BOOL bSuccess = TRUE;
00192
00193     hInst = hInstance;
00194     hWndMain = CreateWindow(
00195         szAppName,
00196         szTitle,
00197         WS_OVERLAPPEDWINDOW,
00198         CW_USEDEFAULT, 0,
00199         CW_USEDEFAULT, 0,
00200         NULL, NULL, hInstance, NULL );
00201
00202     if( hWndMain == NULL )
00203     {
00204         bSuccess = FALSE;
00205         goto exit_func;
00206     }
00207
00208     ShowWindow( hWndMain, nCmdShow );
00209     bSuccess = UpdateWindow( hWndMain );
00210
00211 exit_func:
00212     return bSuccess;
00213 }
00214 /* End InitInstance() *****************************************************/
00215
00216
00217
00218 /****************************************************************************
00219 *
00220 *     FUNCTION: WndProc
00221 *
00222 *     PURPOSE:  Window Procedure for the main window.
00223 *
00224 *     PARAMS:   HWND   hWnd    - This window
00225 *               UINT   Message - Which message?
00226 *               WPARAM wParam  - message parameter
00227 *               LPARAM lParam  - message parameter
00228 *
00229 *     RETURNS:  LRESULT - depends on message
00230 *
00231 * History:
00232 *                July '95 - Created
00233 *
00234 \****************************************************************************/
00235 LRESULT CALLBACK WndProc (
00236     HWND hWnd,
00237     UINT Message,
00238     WPARAM wParam,
00239     LPARAM lParam )
00240 {
00241     INT ret = -1;
00242
00243     switch( Message )
00244     {
00245         // Menu is coming up, initialize it
00246         case WM_INITMENU:
00247             UpdateMenuState( hWnd, (HMENU)wParam );
00248             ret = 1;
00249             break;
00250
00251         // Window is being created, create the MDI client also
00252         case WM_CREATE:
00253             {
00254                 CLIENTCREATESTRUCT ccs = {0};
00255
00256                 // Retrieve the handle of the Window menu and assign the
00257                 // first child window identifier.
00258                 ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd), 2 );
00259                 ccs.idFirstChild = IDM_WINDOWCHILD;
00260
00261                 // Create the MDI client window
00262                 hMDIClientWnd = CreateWindow( TEXT("MDICLIENT"), (PCTSTR) NULL,
00263                                               WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
00264                                               0, 0, 0, 0, hWnd, (HMENU) 0xCAC, hInst, (PSTR) &ccs );
00265
00266                 ShowWindow(hMDIClientWnd, SW_SHOW);
00267             }
00268             break;
00269
00270         // Command Messages (menu items, etc)
00271         case WM_COMMAND:
00272             OnCommand( hWnd, wParam, lParam );
00273             ret = -1;
00274             break;
00275
00276         case WM_CLOSE:
00277             {
00278                 // Will the children allow it? (Give 'em a chance to cancel)
00279                 if( QueryCloseAllChildren() )
00280                 {
00281                     WinHelp( hWnd, szHelpFileName, HELP_QUIT, 0 );
00282                     DestroyWindow( hWnd );
00283                     PostQuitMessage( 0 );
00284                     ret = -1;
00285                 }
00286                 else
00287                 {
00288                     ret = 0;
00289                 }
00290             }
00291             break;
00292
00293         // Pass it on to the default window procedure
00294         default:
00295             break;
00296     }
00297
00298     if (ret == -1)
00299     {
00300         return DefFrameProc( hWnd, hMDIClientWnd, Message, wParam, lParam );
00301     }
00302     else
00303     {
00304         return ret;
00305     }
00306 }
00307 /* End WndProc() ***********************************************************/
00308
00309
00310
00311 /****************************************************************************
00312 *
00313 *     FUNCTION: OnCommand
00314 *
00315 *     PURPOSE:  Handles command messages for main window
00316 *
00317 *     PARAMS:   HWND   hWnd    - This window
00318 *               WPARAM wParam  - message parameter
00319 *               LPARAM lParam  - message parameter
00320 *
00321 *     RETURNS:  LRESULT - depends on message
00322 *
00323 * History:
00324 *                July '95 - Created
00325 *
00326 \****************************************************************************/
00327 LRESULT OnCommand (
00328     HWND hWnd,
00329     WPARAM wParam,
00330     LPARAM lParam )
00331 {
00332     // Which command is it?
00333     switch( LOWORD( wParam ) )
00334     {
00335         // File->New menu option - spawn a new child
00336         case ID_FILE_NEW:
00337             {
00338                 HWND    hWndNew;
00339
00340                 hWndNew = CreateNewMDIChildWindow( TEXT("Untitled"), NULL );
00341                 SendMessage( hMDIClientWnd, WM_MDIACTIVATE, (WPARAM)hWndNew, 0 );
00342             }
00343             break;
00344
00345         // File->Open menu option - open an ICO file
00346         case ID_FILE_OPEN:
00347             {
00348                 HWND            hWndNew               = NULL;
00349                 ICONRESOURCE*   pIR                   = NULL;
00350                 TCHAR         szFileName[MAX_PATH]  = {0};
00351                 TCHAR         szFileTitle[MAX_PATH] = {0};
00352
00353                 // Get the name of the file to open
00354                 if( GetOpenIconFileName( szFileName, IDS_FILTERSTRING, TEXT("Open Icon File") ) )
00355                 {
00356                     // Read in the icon data
00357                     if( (pIR = ReadIconFromICOFile( szFileName )) == NULL )
00358                     {
00359                         break;
00360                     }
00361
00362                     // Get the name of the file for the window title
00363                     if( GetFileTitle( szFileName, szFileTitle, MAX_PATH ) )
00364                     {
00365                         break;
00366                     }
00367
00368                     // Make a new child to handle this icon
00369                     hWndNew = CreateNewMDIChildWindow( szFileTitle, pIR );
00370                     SendMessage( hMDIClientWnd, WM_MDIACTIVATE, (WPARAM)hWndNew, 0 );
00371                 }
00372             }
00373             break;
00374
00375         // File->Extract menu option - extract icon data from a DLL or EXE
00376         case ID_FILE_EXTRACT:
00377             {
00378                 HWND            hWndNew              = NULL;
00379                 ICONRESOURCE*   pIR                  = NULL;
00380                 TCHAR           szFileName[MAX_PATH] = {0};
00381
00382                 // Get the name of the file from which to extract the icon
00383                 if( GetOpenIconFileName( szFileName, IDS_EXEFILTERSTRING, TEXT("Extract Icon from File") ) )
00384                 {
00385                     // Extract the icon data
00386                     if( (pIR = ReadIconFromEXEFile( szFileName )) == NULL )
00387                     {
00388                         break;
00389                     }
00390                     // Make a new child to handle this icon
00391                     hWndNew = CreateNewMDIChildWindow( (TEXT("Untitled")), pIR );
00392                     SendMessage( hMDIClientWnd, WM_MDIACTIVATE, (WPARAM)hWndNew, 0 );
00393                 }
00394             }
00395             break;
00396
00397         // File->Save and File->SaveAs menu options - save current ICO file to disk
00398         case ID_FILE_SAVEAS: /* fall-through */
00399         case ID_FILE_SAVE:
00400             {
00401                 HWND    hWndActive;
00402
00403                 // Get the active MDI child window
00404                 if( (hWndActive = (HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0 )) != NULL )
00405                 {
00406                     // Tell it to write its icon to disk
00407                     SendMessage( hWndActive, WM_COMMAND, wParam, 0 );
00408                 }
00409                 else
00410                     MessageBox( hWnd, TEXT("Error Getting Active Window"), TEXT("Error"), MB_OK );
00411             }
00412             break;
00413
00414         // File->Close menu option - close the current MDI child window
00415         case ID_FILE_CLOSE:
00416             {
00417                 HWND    hWndActive;
00418
00419                 // Get the active MDI child window and tell it to close itself
00420                 if( (hWndActive = (HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0)) != NULL )
00421                     SendMessage( hWndActive, WM_CLOSE, 0, lParam );
00422             }
00423             break;
00424
00425         // File->Exit menu option - shut 'er down
00426         case ID_F_EXIT:
00427             // Just send a WM_CLOSE - code there will handle it
00428             PostMessage( hWnd, WM_CLOSE, (WPARAM)0, (LPARAM)0 );
00429             break;
00430
00431         // Edit->Import BMP and Edit->Stretch-Import BMP - convert BMP file to icon
00432         // Edit->Copy, Edit->Paste, Edit->StretchPaste, Edit->AddFormat, Edit->RemoveFormat
00433         // menu options. Just pass 'em on to the currently active MDI child window
00434         case ID_EDIT_EXPORTBMP:         /* fall-through */
00435         case ID_EDIT_IMPORTBMP:         /* fall-through */
00436         case ID_EDIT_STRETCHIMPORTBMP:  /* fall-through */
00437         case ID_EDIT_COPY:              /* fall-through */
00438         case ID_EDIT_PASTE:             /* fall-through */
00439         case ID_EDIT_STRETCHPASTE:      /* fall-through */
00440         case ID_EDIT_ADDFORMAT:         /* fall-through */
00441         case ID_EDIT_REMOVEFORMAT:
00442             {
00443                 HWND    hWndActive;
00444
00445                 // Get active MDI child
00446                 if( (hWndActive = (HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0 )) != NULL )
00447                 {
00448                     // Pass the message along
00449                     SendMessage( hWndActive, WM_COMMAND, wParam, 0 );
00450                 }
00451             }
00452             break; // End ID_EDIT_XXXX
00453
00454         // Window->ArrangeIcons menu option
00455         case ID_WINDOW_ARRANGEICONS:
00456             // Ask the MDIClient to do it
00457             SendMessage( hMDIClientWnd, WM_MDIICONARRANGE, 0, 0);
00458             break;
00459
00460         // Window->Cascade menu option
00461         case ID_WINDOW_CASCADE:
00462             // Ask the MDIClient to do it
00463             SendMessage( hMDIClientWnd, WM_MDICASCADE, 0, 0);
00464             break;
00465
00466         // Window->Tile menu option
00467         case ID_WINDOW_TILE:
00468             // Ask the MDIClient to do it
00469             SendMessage( hMDIClientWnd, WM_MDITILE, (WPARAM)MDITILE_HORIZONTAL, 0);
00470             break;
00471
00472         // Window->TileVertical menu option
00473         case ID_WINDOW_TILEVERTICAL:
00474             // Ask the MDIClient to do it
00475             SendMessage( hMDIClientWnd, WM_MDITILE, (WPARAM)MDITILE_VERTICAL, 0);
00476             break;
00477
00478         // Help->About menu option
00479         case ID_HELP_ABOUT:
00480             // Launch the About Dialog
00481             DialogBox( hInst, MAKEINTRESOURCE(ICONPRO_ABOUT_DLG), hWnd, (DLGPROC)AboutDlgProc );
00482             break;
00483
00484         case ID_HELP_CONTENTS:
00485             WinHelp( hWnd, szHelpFileName, HELP_CONTENTS, 0 );
00486             break;
00487     }
00488     return 0l;
00489 }
00490 /* End OnCommand() *********************************************************/
00491
00492
00493
00494 /****************************************************************************
00495 *
00496 *     FUNCTION: AboutDlgProc
00497 *
00498 *     PURPOSE:  Handles messages for About Dialog
00499 *
00500 *     PARAMS:   HWND   hWnd    - This window
00501 *               UINT   Msg     - Which message?
00502 *               WPARAM wParam  - message parameter
00503 *               LPARAM lParam  - message parameter
00504 *
00505 *     RETURNS:  BOOL - depends on message
00506 *
00507 * History:
00508 *                July '95 - Created
00509 *
00510 \****************************************************************************/
00511 BOOL CALLBACK AboutDlgProc (
00512     HWND hWnd,
00513     UINT Msg,
00514     WPARAM wParam,
00515     LPARAM lParam )
00516 {
00517     switch( Msg )
00518     {
00519         case WM_INITDIALOG:
00520             break;
00521
00522         case WM_CLOSE:
00523             PostMessage( hWnd, WM_COMMAND, IDCANCEL, 0l );
00524             break;
00525
00526         case WM_COMMAND:
00527             switch( LOWORD(wParam) )
00528             {
00529                 case IDOK:
00530                     EndDialog( hWnd, TRUE );
00531                     break;
00532
00533                 case IDCANCEL:
00534                     EndDialog( hWnd, FALSE );
00535                     break;
00536
00537             }
00538             break;
00539
00540         default:
00541             return FALSE;
00542             break;
00543     }
00544     return TRUE;
00545 }
00546 /* End AboutDlgProc() ******************************************************/
00547
00548
00549
00550 /****************************************************************************
00551 *
00552 *     FUNCTION: CreateNewMDIChildWindow
00553 *
00554 *     PURPOSE:  Creates and shows a new MDI child window
00555 *
00556 *     PARAMS:   PSTR  szTitle - The title for the new window
00557 *               PVOID lpData  - Data to attach to the window (icon info)
00558 *
00559 *     RETURNS:  HWND - Handle to the new MDI child window
00560 *
00561 * History:
00562 *                July '95 - Created
00563 *
00564 \****************************************************************************/
00565 HWND CreateNewMDIChildWindow (
00566     PTSTR szTitle,
00567     PVOID lpData )
00568 {
00569     HWND    hReturnWnd = NULL;
00570
00571     // Create the MDI child window
00572     hReturnWnd = CreateMDIWindow(
00573                     szChildClassName, szTitle, 0,
00574                     CW_USEDEFAULT, CW_USEDEFAULT, WINDOW_WIDTH, WINDOW_HEIGHT,
00575                     hMDIClientWnd, hInst, (LPARAM)lpData );
00576     // Show it
00577     ShowWindow( hReturnWnd, SW_SHOW );
00578     return hReturnWnd;
00579 }
00580 /* End CreateNewMDIChildWindow() ********************************************/
00581
00582
00583
00584 /****************************************************************************
00585 *
00586 *     FUNCTION: GetOpenIconFileName
00587 *
00588 *     PURPOSE:  Prompts user for the filename for opening
00589 *
00590 *     PARAMS:   PSTR   szFileName      - Buffer to receive name of file
00591 *               UINT    FilterStringID - ID of filter string
00592 *               PCTSTR szTitle         - Title for the Dialog
00593 *
00594 *     RETURNS:  BOOL - TRUE for success, FALSE for failure
00595 *
00596 * History:
00597 *                July '95 - Created
00598 *
00599 \****************************************************************************/
00600 BOOL GetOpenIconFileName (
00601     PTSTR szFileName,
00602     UINT FilterStringID,
00603     PCTSTR szTitle )
00604 {
00605     OPENFILENAME    ofn = {0};
00606     UINT            i, cbString;
00607     TCHAR         chReplace;
00608     TCHAR         szFilter[256];
00609
00610     // Get the filter string
00611     if ((cbString = LoadString( hInst, FilterStringID, szFilter, sizeof(szFilter))) == 0 )
00612     {
00613         return FALSE;
00614     }
00615
00616     // Replace the wildcard with NULL
00617     chReplace = szFilter[cbString - 1]; /* retrieve wildcard */
00618     for (i = 0; szFilter[i] != TEXT('\0'); i++)
00619     {
00620         if (szFilter[i] == chReplace)
00621         {
00622             szFilter[i] = TEXT('\0');
00623         }
00624     }
00625
00626     // Fill out the OPENFILENAME struct
00627     ZeroMemory( &ofn, sizeof( OPENFILENAME ) );
00628     ofn.lStructSize = sizeof( OPENFILENAME );
00629     ofn.hwndOwner = hWndMain;
00630     ofn.hInstance = hInst;
00631     lstrcpyn( szFileName, TEXT(""), sizeof(szFileName)/sizeof(szFileName[0]) - 1 );
00632     ofn.lpstrFile = szFileName;
00633     ofn.nMaxFile = MAX_PATH;
00634     ofn.Flags = OFN_FILEMUSTEXIST;
00635     ofn.lpstrFilter = szFilter;
00636     ofn.lpstrTitle = szTitle;
00637
00638     // Use the common dialog
00639     return GetOpenFileName( &ofn );
00640 }
00641 /* End GetOpenIconFileName() ***********************************************/
00642
00643
00644
00645 /****************************************************************************
00646 *
00647 *     FUNCTION: GetSaveIconFileName
00648 *
00649 *     PURPOSE:  Prompts user for the filename for saving
00650 *
00651 *     PARAMS:   PSTR   szFileName      - Buffer to receive name of file
00652 *               UINT    FilterStringID - ID of filter string
00653 *               PCTSTR  szTitle        - Title for the Dialog
00654 *
00655 *     RETURNS:  BOOL - TRUE for success, FALSE for failure
00656 *
00657 * History:
00658 *                July '95 - Created
00659 *
00660 \****************************************************************************/
00661 BOOL GetSaveIconFileName (
00662     PTSTR szFileName,
00663     UINT FilterStringID,
00664     PCTSTR szTitle )
00665 {
00666     OPENFILENAME    ofn = {0};
00667     UINT            i, cbString;
00668     TCHAR         chReplace;
00669     TCHAR         szFilter[256];
00670
00671     // Get the filter string
00672     if ((cbString = LoadString( hInst, FilterStringID, szFilter, sizeof(szFilter))) == 0 )
00673     {
00674         return FALSE;
00675     }
00676
00677     // Replace the wildcard with NULL
00678     chReplace = szFilter[cbString - 1]; /* retrieve wildcard */
00679     for (i = 0; szFilter[i] != TEXT('\0'); i++)
00680     {
00681         if (szFilter[i] == chReplace)
00682         {
00683             szFilter[i] = TEXT('\0');
00684         }
00685     }
00686
00687     // Fill out the OPENFILENAME struct
00688     ZeroMemory( &ofn, sizeof( OPENFILENAME ) );
00689     ofn.lStructSize = sizeof( OPENFILENAME );
00690     ofn.hwndOwner = hWndMain;
00691     ofn.hInstance = hInst;
00692     lstrcpyn( szFileName, TEXT(""), sizeof(szFileName)/sizeof(szFileName[0]) - 1 );
00693     ofn.lpstrFile = szFileName;
00694     ofn.nMaxFile = MAX_PATH;
00695     ofn.Flags = OFN_OVERWRITEPROMPT;
00696     ofn.lpstrFilter = szFilter;
00697     ofn.lpstrDefExt = TEXT("ICO");
00698     ofn.lpstrTitle = szTitle;
00699
00700     // Use the common dialog
00701     return GetSaveFileName( &ofn );
00702 }
00703 /* End GetSaveIconFileName() ***********************************************/
00704
00705
00706
00707 /****************************************************************************
00708 *
00709 *     FUNCTION: UpdateMenuState
00710 *
00711 *     PURPOSE:  Updates states of menu items (called on menu activation)
00712 *
00713 *     PARAMS:   HWND  hWnd  - Handle to the window
00714 *               HMENU hMenu - Handle to the menu
00715 *
00716 *     RETURNS:  BOOL - TRUE for success, FALSE for failure
00717 *
00718 * History:
00719 *                July '95 - Created
00720 *
00721 \****************************************************************************/
00722 BOOL UpdateMenuState (
00723     HWND hWnd,
00724     HMENU hMenu )
00725 {
00726     UINT    nEnableFlag, nNumFormats;
00727     HWND    hWndActive = NULL;
00728
00729     // Get a handle to the active MDI child window
00730     hWndActive=(HWND)SendMessage( hMDIClientWnd, WM_MDIGETACTIVE, 0, 0 );
00731     // Find out how many icon image formats it holds
00732     nNumFormats = (UINT)SendMessage( hWndActive, WM_COMMAND, ID_GETNUMFORMATS, 0 );
00733     // Do we actually have an active window?
00734     if( hWndActive == NULL )
00735     {
00736         // No active MDI child...
00737         EnableMenuItem( hMenu, ID_FILE_NEW, MF_BYCOMMAND | MF_ENABLED );
00738         EnableMenuItem( hMenu, ID_FILE_OPEN, MF_BYCOMMAND | MF_ENABLED );
00739         EnableMenuItem( hMenu, ID_FILE_EXTRACT, MF_BYCOMMAND | MF_ENABLED );
00740         EnableMenuItem( hMenu, ID_FILE_CLOSE, MF_BYCOMMAND | MF_GRAYED );
00741         EnableMenuItem( hMenu, ID_FILE_SAVE, MF_BYCOMMAND | MF_GRAYED );
00742         EnableMenuItem( hMenu, ID_FILE_SAVEAS, MF_BYCOMMAND | MF_GRAYED );
00743         EnableMenuItem( hMenu, ID_F_EXIT, MF_BYCOMMAND | MF_ENABLED );
00744         EnableMenuItem( hMenu, ID_EDIT_COPY, MF_BYCOMMAND| MF_GRAYED );
00745         EnableMenuItem( hMenu, ID_EDIT_PASTE, MF_BYCOMMAND | MF_GRAYED );
00746         EnableMenuItem( hMenu, ID_EDIT_STRETCHPASTE, MF_BYCOMMAND | MF_GRAYED );
00747         EnableMenuItem( hMenu, ID_EDIT_ADDFORMAT, MF_BYCOMMAND | MF_GRAYED );
00748         EnableMenuItem( hMenu, ID_EDIT_IMPORTBMP, MF_BYCOMMAND | MF_GRAYED );
00749         EnableMenuItem( hMenu, ID_EDIT_STRETCHIMPORTBMP, MF_BYCOMMAND | MF_GRAYED );
00750         EnableMenuItem( hMenu, ID_EDIT_EXPORTBMP, MF_BYCOMMAND | MF_GRAYED );
00751         EnableMenuItem( hMenu, ID_EDIT_REMOVEFORMAT, MF_BYCOMMAND | MF_GRAYED );
00752         EnableMenuItem( hMenu, ID_WINDOW_ARRANGEICONS, MF_BYCOMMAND | MF_GRAYED );
00753         EnableMenuItem( hMenu, ID_WINDOW_CASCADE, MF_BYCOMMAND | MF_GRAYED );
00754         EnableMenuItem( hMenu, ID_WINDOW_TILE, MF_BYCOMMAND | MF_GRAYED );
00755         EnableMenuItem( hMenu, ID_WINDOW_TILEVERTICAL, MF_BYCOMMAND | MF_GRAYED );
00756     }
00757     else
00758     {
00759         // We have an active MDI child...
00760         EnableMenuItem( hMenu, ID_FILE_NEW, MF_BYCOMMAND | MF_ENABLED );
00761         EnableMenuItem( hMenu, ID_FILE_OPEN, MF_BYCOMMAND | MF_ENABLED );
00762         EnableMenuItem( hMenu, ID_FILE_EXTRACT, MF_BYCOMMAND | MF_ENABLED );
00763         EnableMenuItem( hMenu, ID_FILE_CLOSE, MF_BYCOMMAND | MF_ENABLED );
00764         nEnableFlag = (BOOL)SendMessage( hWndActive, WM_COMMAND, ID_HASFILECHANGED, 0 ) ? MF_ENABLED : MF_GRAYED;
00765         EnableMenuItem( hMenu, ID_FILE_SAVE, MF_BYCOMMAND | nEnableFlag );
00766         EnableMenuItem( hMenu, ID_FILE_SAVEAS, MF_BYCOMMAND | MF_ENABLED );
00767         EnableMenuItem( hMenu, ID_F_EXIT, MF_BYCOMMAND | MF_ENABLED );
00768         EnableMenuItem( hMenu, ID_EDIT_COPY, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
00769         if( IsClipboardFormatAvailable( CF_DIB ) )
00770         {
00771             EnableMenuItem( hMenu, ID_EDIT_PASTE, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
00772             EnableMenuItem( hMenu, ID_EDIT_STRETCHPASTE, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
00773         }
00774         else
00775         {
00776             EnableMenuItem( hMenu, ID_EDIT_PASTE, MF_BYCOMMAND | MF_GRAYED );
00777             EnableMenuItem( hMenu, ID_EDIT_STRETCHPASTE, MF_BYCOMMAND | MF_GRAYED );
00778         }
00779         EnableMenuItem( hMenu, ID_EDIT_IMPORTBMP, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
00780         EnableMenuItem( hMenu, ID_EDIT_STRETCHIMPORTBMP, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
00781         EnableMenuItem( hMenu, ID_EDIT_EXPORTBMP, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
00782         EnableMenuItem( hMenu, ID_EDIT_ADDFORMAT, MF_BYCOMMAND | MF_ENABLED );
00783         EnableMenuItem( hMenu, ID_EDIT_REMOVEFORMAT, MF_BYCOMMAND | (nNumFormats>0)?MF_ENABLED:MF_GRAYED );
00784         EnableMenuItem( hMenu, ID_WINDOW_ARRANGEICONS, MF_BYCOMMAND | MF_ENABLED );
00785         EnableMenuItem( hMenu, ID_WINDOW_CASCADE, MF_BYCOMMAND | MF_ENABLED );
00786         EnableMenuItem( hMenu, ID_WINDOW_TILE, MF_BYCOMMAND | MF_ENABLED );
00787         EnableMenuItem( hMenu, ID_WINDOW_TILEVERTICAL, MF_BYCOMMAND | MF_ENABLED );
00788     }
00789     return TRUE;
00790 }
00791 /* End UpdateMenuState() ***************************************************/
00792
00793
00794
00795 /****************************************************************************
00796 *
00797 *  FUNCTION   : QueryCloseAllChildren()
00798 *
00799 *  PURPOSE    : Asks the child windows if it is ok to close up app. Nothing
00800 *               is destroyed at this point. The z-order is not changed.
00801 *
00802 *  PARAMS:     : none
00803 *
00804 *
00805 *  RETURNS    : TRUE - If all children agree to the query.
00806 *               FALSE- If any one of them disagrees.
00807 *
00808 \***************************************************************************/
00809 BOOL QueryCloseAllChildren (
00810     VOID )
00811 {
00812     register HWND hwndT;
00813
00814     for( hwndT = GetWindow(hMDIClientWnd, GW_CHILD); hwndT; hwndT = GetWindow (hwndT, GW_HWNDNEXT) )
00815     {
00816         if( GetWindow( hwndT, GW_OWNER ) )
00817         {
00818             continue;
00819         }
00820
00821         if( SendMessage( hwndT, WM_CLOSE, 0, 0L ) )
00822         {
00823             return FALSE;
00824         }
00825     }
00826     return TRUE;
00827 }
00828 /* End QueryCloseAllChildren() **********************************************/
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHtmlIFilterCF Member List

This is the complete list of members for CHtmlIFilterCF, including all inherited members.
_uRefs | CHtmlIFilterCF | [protected]
AddRef() | CHtmlIFilterCF | [virtual]
CHtmlIFilterCF() | CHtmlIFilterCF |
CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject) | CHtmlIFilterCF | [virtual]
DllGetClassObject(REFCLSID cid, REFIID iid, void **ppvObj) | CHtmlIFilterCF | [friend]
LockServer(BOOL fLock) | CHtmlIFilterCF | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CHtmlIFilterCF | [virtual]
Release() | CHtmlIFilterCF | [virtual]
~CHtmlIFilterCF() | CHtmlIFilterCF | [protected, virtual]
Generated on Wed Nov 13 2024 16:56:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerServe/Server.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerServe

Server.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.CPP
00003
00004   Summary:   Implementation file for the CServer server control C++
00005              object.  This object encapsulates the server's internal
00006              control of global server object and lock counts. The
00007              CThreaded OwnThis mechanism is used to ensure mutually
00008              exclusive access to this CServer object by multiple
00009              contending threads.
00010
00011              For a comprehensive tutorial code tour of this module's
00012              contents and offerings see the tutorial PERSERVE.HTM
00013              file. For more specific technical details on the internal
00014              workings see the comments dispersed throughout the module's
00015              source code.
00016
00017   Classes:   CServer.
00018
00019   Functions: .
00020
00021   Origin:    2-4-97: atrent - Editor-inheritance from SERVER.CPP in
00022                the STOSERVE Tutorial Code Sample.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will be calling the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this DLL using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include SERVER.H for the class declarations for the C++ CServer
00046     server control object.
00047 ---------------------------------------------------------------------------*/
00048 #include <windows.h>
00049 #include <ole2.h>
00050 #include <apputil.h>
00051 #include "server.h"
00052
00053
00054 /*---------------------------------------------------------------------------
00055   Implementation the internal CServer C++ object.  Used to encapsulate
00056   some server data and the methods for Lock and Object count incrementing
00057   and decrementing.
00058 ---------------------------------------------------------------------------*/
00059
00060 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00061   Method:   CServer::CServer
00062
00063   Summary:  CServer Constructor.
00064
00065   Args:     void
00066
00067   Modifies: m_cObjects, m_cLocks.
00068
00069   Returns:  void
00070 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00071 CServer::CServer(void)
00072 {
00073   // Zero the Object and Lock counts for this attached process.
00074   m_cObjects = 0;
00075   m_cLocks = 0;
00076
00077   return;
00078 }
00079
00080
00081 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00082   Method:   CServer::~CServer
00083
00084   Summary:  CServer Destructor.
00085
00086   Args:     void
00087
00088   Returns:  void
00089 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00090 CServer::~CServer(void)
00091 {
00092   return;
00093 }
00094
00095
00096 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00097   Method:   CServer::Lock
00098
00099   Summary:  Increment the Server's Lock count.
00100
00101   Args:     void
00102
00103   Modifies: m_cLocks.
00104
00105   Returns:  void
00106 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00107 void CServer::Lock(void)
00108 {
00109   InterlockedIncrement((PLONG) &m_cLocks);
00110
00111   return;
00112 }
00113
00114
00115 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00116   Method:   CServer::Unlock
00117
00118   Summary:  Decrement the Server's Lock count.
00119
00120   Args:     void
00121
00122   Modifies: m_cLocks.
00123
00124   Returns:  void
00125 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00126 void CServer::Unlock(void)
00127 {
00128   InterlockedDecrement((PLONG) &m_cLocks);
00129
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   CServer::ObjectsUp
00136
00137   Summary:  Increment the Server's living Object count.
00138
00139   Args:     void
00140
00141   Modifies: m_cObjects.
00142
00143   Returns:  void
00144 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00145 void CServer::ObjectsUp(void)
00146 {
00147   InterlockedIncrement((PLONG) &m_cObjects);
00148
00149   return;
00150 }
00151
00152
00153 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00154   Method:   CServer::ObjectsDown
00155
00156   Summary:  Decrement the Server's living object count.
00157
00158   Args:     void
00159
00160   Modifies: m_cObjects.
00161
00162   Returns:  void
00163 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00164 void CServer::ObjectsDown(void)
00165 {
00166   InterlockedDecrement((PLONG) &m_cObjects);
00167
00168   return;
00169 }
00170
00171
00172 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00173   Method:   CServer::CanUnloadNow
00174
00175   Summary:  Check if we can unload the server (ie, if there are no longer
00176             any living COM objects and no locks.
00177
00178   Args:     void
00179
00180   Modifies: .
00181
00182   Returns:  HRESULT
00183               S_OK if this server can be unloaded.
00184               S_FALSE if this server can not be unloaded.
00185 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00186 HRESULT CServer::CanUnloadNow(void)
00187 {
00188   HRESULT hr = S_FALSE;
00189   LONG cObjects, cLocks;
00190
00191   if (OwnThis())
00192   {
00193     cObjects = m_cObjects;
00194     cLocks = m_cLocks;
00195
00196     hr = (0L==cObjects && 0L==cLocks) ? S_OK : S_FALSE;
00197
00198     UnOwnThis();
00199   }
00200
00201   return hr;
00202 }
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/global.h Source File

  • WinUI
  • GlobalDev
  • globaldev

global.h

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////////////////////
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 // Purpose:
00011 //      This application demonstrates the different aspects of software globalization:
00012 //
00013 //      - A single executable with world-wide functionality (fully Unicode enabled
00014 //      for Windows 2000 and Windows XP).
00015 //
00016 //      - Locale independency by using Windows NLS APIs to display data (dates,
00017 //      numbers, time, etc.) within a user's desired format.
00018 //
00019 //      - Multilingual editing using standard edit controls.
00020 //
00021 //      - Multilingual input locales within edit control fields.
00022 //
00023 //      - Font selection and their affect on displayed data.
00024 //
00025 //      - Multilingual user interface and satellite DLLs
00026 //
00027 // Written by Houman Pournasseh
00028 //
00029 ///////////////////////////////////////////////////////////////////////////////////////////
00030
00031 ///////////////////////////////////////////////////////////////////////////////////////////
00032 //
00033 //   Module:        GLOBAL.H
00034 //
00035 //   Description:    General include file used by all modules.
00036 //
00037 ///////////////////////////////////////////////////////////////////////////////////////////
00038 #include <windows.h>
00039 #include <commdlg.h>
00040 #include <winuser.h>
00041 #include <windowsx.h>
00042 #include <dos.h>
00043 #include <tchar.h>
00044 #include <io.h>
00045 #include <conio.h>
00046 #include <stdio.h>
00047 #include <stdlib.h>
00048 #include <math.h>
00049 #include <cpl.h>
00050 #include <time.h>
00051 #include <commctrl.h>
00052 #include <direct.h>
00053 #include <objbase.h>
00054 #include <shlobj.h>
00055 #include <TCHAR.h>
00056
00057 #include "resource.h"
00058 #include "res.h"
00059
00060 // global defines...
00061 #define WS_EX_LAYOUTRTL                         0x00400000L // Right to left mirroring
00062 #define WS_EX_NOINHERITLAYOUT                   0x00100000L // Disable inheritence of mirroring by children
00063
00064 #define STR_LEN     50
00065 #define MAX_STR     256
00066 #define STR_CPLEN   5
00067 #define NBR_PS_PAGE 3
00068
00069 #define COLUMN_LANGID        0
00070 #define COLUMN_LANGUAGE      1
00071 #define COLUMN_NATIVELANG    2
00072 #define COLUMN_NATIVECOUNTRY 3
00073 #define COLUMN_ACP           4
00074 #define COLUMN_OEMCP         5
00075
00076 #define DEFAULT_FONT    TEXT("MS Shell Dlg")
00077
00078
00079 // structure definitions...
00080 typedef struct _LOCINFO                   // structure for locale related information displayed in our list view
00081 {
00082     TCHAR    tcLcid[STR_LEN];             // LCID
00083     TCHAR    tcLLang[STR_LEN];            // localized language name
00084     TCHAR    tcNLang[STR_LEN];            // native language name
00085     TCHAR    tcNCountry[STR_LEN];         // native country name
00086     TCHAR    tcAcp[STR_CPLEN];            // ANSI code page
00087     TCHAR    tcOem[STR_CPLEN];            // OEM code page
00088 } LOCINFO,*LPLOCINFO;
00089
00090
00091 HINSTANCE    g_hInst;                // Handle to this instance
00092 TCHAR        g_tcsTemp[MAX_STR];
00093 HANDLE       g_hRes;                 // Handle to our resource dll
00094 int          g_wCurLang;
00095
00096 // Function declarations...
00097 INT_PTR CALLBACK FontDlgProc(HWND, UINT, WPARAM, LPARAM);
00098 INT_PTR CALLBACK NLSDlgProc(HWND, UINT, WPARAM, LPARAM);
00099 INT_PTR CALLBACK TextDlgProc(HWND, UINT, WPARAM, LPARAM);
00100 INT_PTR CALLBACK USPDlgProc(HWND, UINT, WPARAM, LPARAM);
00101 INT_PTR CALLBACK MirroringDlgProc(HWND, UINT, WPARAM, LPARAM);
00102 INT_PTR CALLBACK GeneralDlgProc(HWND, UINT, WPARAM, LPARAM);
00103
00104 // Just a handy macro for deleting a font in a control when the
00105 // dialog is about to shut down or change fonts.
00106 #define DeleteFontObject(_hDlg, _hFont, _CntlID) \
00107 do \
00108 { \
00109     _hFont = (HFONT) SendDlgItemMessage(_hDlg, _CntlID, WM_GETFONT, \
00110         (WPARAM) 0,  (LPARAM) 0) ; \
00111     if (_hFont) DeleteObject (_hFont) ; \
00112 }while (0);
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/resource.h Source File

  • Multimedia
  • wia
  • GetImage

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by GetImage.rc
00004 //
00005 #define WINDOW_MENU_POSITION            1
00006 #define IDS_APP_NAME                    1
00007 #define IDS_MAIN_WINDOW_TITLE           2
00008 #define IDS_BITMAP_WINDOW_TITLE         3
00009 #define IDS_WAIT                        4
00010 #define IDS_STATUS_TRANSFER_FROM_DEVICE 5
00011 #define IDS_STATUS_PROCESSING_DATA      6
00012 #define IDS_STATUS_TRANSFER_TO_CLIENT   7
00013 #define IDS_ERROR_GET_IMAGE_DLG         8
00014 #define IDR_MENU                        101
00015 #define IDD_PROGRESS                    102
00016 #define IDC_PROGRESS_BAR                1000
00017 #define IDC_MESSAGE                     1001
00018 #define ID_FILE_FROM_SCANNER_OR_CAMERA  40001
00019 #define ID_FILE_EXIT                    40002
00020 #define ID_WINDOW_CASCADE               40003
00021 #define ID_WINDOW_TILE_HORIZONTALLY     40004
00022 #define ID_WINDOW_TILE_VERTICALLY       40005
00023 #define ID_WINDOW_ARRANGE_ICONS         40006
00024 #define ID_HELP_ABOUT                   40007
00025 #define FIRST_MDI_CHILD                 40008
00026
00027 // Next default values for new objects
00028 //
00029 #ifdef APSTUDIO_INVOKED
00030 #ifndef APSTUDIO_READONLY_SYMBOLS
00031 #define _APS_NEXT_RESOURCE_VALUE        103
00032 #define _APS_NEXT_COMMAND_VALUE         40009
00033 #define _APS_NEXT_CONTROL_VALUE         1002
00034 #define _APS_NEXT_SYMED_VALUE           101
00035 #endif
00036 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/oleutl.c Source File

  • Com
  • Fundamentals
  • OleStd

oleutl.c

Go to the documentation of this file.
00001 /*
00002  * OLEUTL.C
00003  *
00004  * Miscellaneous utility functions for OLE 2.0 Applications:
00005  *
00006  *  Function                      Purpose
00007  *  -------------------------------------------------------------------
00008  *  SetDCToDrawInHimetricRect     Sets up an HIMETRIC mapping mode in a DC.
00009  *  ResetOrigDC                   Performs the opposite of
00010  *                                SetDCToDrawInHimetricRect
00011  *  XformWidthInPixelsToHimetric  Converts an int width into HiMetric units
00012  *  XformWidthInHimetricToPixels  Converts an int width from HiMetric units
00013  *  XformHeightInPixelsToHimetric Converts an int height into HiMetric units
00014  *  XformHeightInHimetricToPixels Converts an int height from HiMetric units
00015  *  XformRectInPixelsToHimetric   Converts a rect into HiMetric units
00016  *  XformRectInHimetricToPixels   Converts a rect from HiMetric units
00017  *  XformSizeInPixelsToHimetric   Converts a SIZEL into HiMetric units
00018  *  XformSizeInHimetricToPixels   Converts a SIZEL from HiMetric units
00019  *  AreRectsEqual                 Compares to Rect's
00020  *
00021  *  ParseCmdLine                  Determines if -Embedding exists
00022  *  OpenOrCreateRootStorage       Creates a root docfile for OLE storage
00023  *  CommitStorage                 Commits all changes in a docfile
00024  *  CreateChildStorage            Creates child storage in another storage
00025  *  OpenChildStorage              Opens child storage in another storage
00026  *
00027  *
00028  * Copyright (c)1992 - 2000 Microsoft Corporation, All Right Reserved
00029  */
00030
00031
00032 #define STRICT  1
00033 #include "olestd.h"
00034 #include <stdlib.h>
00035 #include <ctype.h>
00036
00037 //Internal function to this module
00038 static LPSTR GetWord(LPSTR lpszSrc, LPSTR lpszDst);
00039
00040
00041 /*
00042  * SetDCToAnisotropic
00043  *
00044  * Purpose:
00045  *  Setup the correspondence between the rect in device unit (Viewport) and
00046  *  the rect in logical unit (Window) so that the proper scaling of
00047  *  coordinate systems will be calculated. set up both the Viewport and
00048  *  the window as follows:
00049  *
00050  *      1) ------------------ ( 2
00051  *      |                     |
00052  *      |                     |
00053  *      |                     |
00054  *      |                     |
00055  *      |                     |
00056  *      3) ------------------ ( 4
00057  *
00058  *      Origin   = P3
00059  *      X extent = P2x - P3x
00060  *      Y extent = P2y - P3y
00061  *
00062  * Parameters:
00063  *  hDC             HDC to affect
00064  *  lprcPhysical    LPRECT containing the physical (device) extents of DC
00065  *  lprcLogical     LPRECT containing the logical extents
00066  *  lprcWindowOld   LPRECT in which to preserve the window for ResetOrigDC
00067  *  lprcViewportOld LPRECT in which to preserver the viewport for ResetOrigDC
00068  *
00069  * Return Value:
00070  *  int             The original mapping mode of the DC.
00071  */
00072
00073 STDAPI_(int) SetDCToAnisotropic(
00074                 HDC hDC,
00075                 LPRECT lprcPhysical, LPRECT lprcLogical,
00076                 LPRECT lprcWindowOld, LPRECT lprcViewportOld)
00077 {
00078         int     nMapModeOld=SetMapMode(hDC, MM_ANISOTROPIC);
00079
00080         SetWindowOrgEx(hDC, lprcLogical->left, lprcLogical->bottom, (LPPOINT)&lprcWindowOld->left);
00081         SetWindowExtEx(hDC, (lprcLogical->right-lprcLogical->left), (lprcLogical->top-lprcLogical->bottom), (LPSIZE)&lprcWindowOld->right);
00082         SetViewportOrgEx(hDC, lprcPhysical->left, lprcPhysical->bottom, (LPPOINT)&lprcViewportOld->left);
00083         SetViewportExtEx(hDC, (lprcPhysical->right-lprcPhysical->left), (lprcPhysical->top-lprcPhysical->bottom), (LPSIZE)&lprcViewportOld->right);
00084
00085         return nMapModeOld;
00086 }
00087
00088
00089 /*
00090  * SetDCToDrawInHimetricRect
00091  *
00092  * Purpose:
00093  *  Setup the correspondence between the rect in pixels (Viewport) and
00094  *  the rect in HIMETRIC (Window) so that the proper scaling of
00095  *  coordinate systems will be calculated. set up both the Viewport and
00096  *  the window as follows:
00097  *
00098  *      1) ------------------ ( 2
00099  *      |                     |
00100  *      |                     |
00101  *      |                     |
00102  *      |                     |
00103  *      |                     |
00104  *      3) ------------------ ( 4
00105  *
00106  *      Origin   = P3
00107  *      X extent = P2x - P3x
00108  *      Y extent = P2y - P3y
00109  *
00110  * Parameters:
00111  *  hDC             HDC to affect
00112  *  lprcPix         LPRECT containing the pixel extents of DC
00113  *  lprcHiMetric    LPRECT to receive the himetric extents
00114  *  lprcWindowOld   LPRECT in which to preserve the window for ResetOrigDC
00115  *  lprcViewportOld LPRECT in which to preserver the viewport for ResetOrigDC
00116  *
00117  * Return Value:
00118  *  int             The original mapping mode of the DC.
00119  */
00120 STDAPI_(int) SetDCToDrawInHimetricRect(
00121         HDC hDC,
00122         LPRECT lprcPix, LPRECT lprcHiMetric,
00123         LPRECT lprcWindowOld, LPRECT lprcViewportOld)
00124         {
00125         int     nMapModeOld=SetMapMode(hDC, MM_ANISOTROPIC);
00126         BOOL    fSystemDC  =FALSE;
00127
00128         if (NULL==hDC)
00129                 {
00130                 hDC=GetDC(NULL);
00131                 fSystemDC=TRUE;
00132                 }
00133
00134         XformRectInPixelsToHimetric(hDC, lprcPix, lprcHiMetric);
00135
00136         SetWindowOrgEx(hDC, lprcHiMetric->left, lprcHiMetric->bottom, (LPPOINT)&lprcWindowOld->left);
00137         SetWindowExtEx(hDC, (lprcHiMetric->right-lprcHiMetric->left), (lprcHiMetric->top-lprcHiMetric->bottom), (LPSIZE)&lprcWindowOld->right);
00138         SetViewportOrgEx(hDC, lprcPix->left, lprcPix->bottom, (LPPOINT)&lprcViewportOld->left);
00139         SetViewportExtEx(hDC, (lprcPix->right-lprcPix->left), (lprcPix->top-lprcPix->bottom), (LPSIZE)&lprcViewportOld->right);
00140
00141         if (fSystemDC)
00142                 ReleaseDC(NULL, hDC);
00143
00144         return nMapModeOld;
00145         }
00146
00147
00148
00149 /*
00150  * ResetOrigDC
00151  *
00152  * Purpose:
00153  *  Restores a DC set to draw in himetric from SetDCToDrawInHimetricRect.
00154  *
00155  * Parameters:
00156  *  hDC             HDC to restore
00157  *  nMapModeOld     int original mapping mode of hDC
00158  *  lprcWindowOld   LPRECT filled in SetDCToDrawInHimetricRect
00159  *  lprcViewportOld LPRECT filled in SetDCToDrawInHimetricRect
00160  *
00161  * Return Value:
00162  *  int             Same as nMapModeOld.
00163  */
00164
00165 STDAPI_(int) ResetOrigDC(
00166         HDC hDC, int nMapModeOld,
00167         LPRECT lprcWindowOld, LPRECT lprcViewportOld)
00168         {
00169         POINT     pOld;
00170
00171         SetMapMode(hDC, nMapModeOld);
00172
00173         SetWindowOrgEx(hDC,   lprcWindowOld->left,    lprcWindowOld->top,      (LPPOINT)&pOld);
00174         SetWindowExtEx(hDC,   lprcWindowOld->right,   lprcWindowOld->bottom,   (LPSIZE)&pOld);
00175         SetViewportOrgEx(hDC, lprcViewportOld->left,  lprcViewportOld->top,    (LPPOINT)&pOld);
00176         SetViewportExtEx(hDC, lprcViewportOld->right, lprcViewportOld->bottom, (LPSIZE)&pOld);
00177
00178         return nMapModeOld;
00179         }
00180
00181
00182
00183 /*
00184  * XformWidthInPixelsToHimetric
00185  * XformWidthInHimetricToPixels
00186  * XformHeightInPixelsToHimetric
00187  * XformHeightInHimetricToPixels
00188  *
00189  * Functions to convert an int between a device coordinate system and
00190  * logical HiMetric units.
00191  *
00192  * Parameters:
00193  *  hDC             HDC providing reference to the pixel mapping.  If
00194  *                  NULL, a screen DC is used.
00195  *
00196  *  Size Functions:
00197  *  lpSizeSrc       LPSIZEL providing the structure to convert.  This
00198  *                  contains pixels in XformSizeInPixelsToHimetric and
00199  *                  logical HiMetric units in the complement function.
00200  *  lpSizeDst       LPSIZEL providing the structure to receive converted
00201  *                  units.  This contains pixels in
00202  *                  XformSizeInPixelsToHimetric and logical HiMetric
00203  *                  units in the complement function.
00204  *
00205  *  Width Functions:
00206  *  iWidth          int containing the value to convert.
00207  *
00208  * Return Value:
00209  *  Size Functions:     None
00210  *  Width Functions:    Converted value of the input parameters.
00211  *
00212  * NOTE:
00213  *  When displaying on the screen, Window apps display everything enlarged
00214  *  from its actual size so that it is easier to read. For example, if an
00215  *  app wants to display a 1in. horizontal line, that when printed is
00216  *  actually a 1in. line on the printed page, then it will display the line
00217  *  on the screen physically larger than 1in. This is described as a line
00218  *  that is "logically" 1in. along the display width. Windows maintains as
00219  *  part of the device-specific information about a given display device:
00220  *      LOGPIXELSX -- no. of pixels per logical in along the display width
00221  *      LOGPIXELSY -- no. of pixels per logical in along the display height
00222  *
00223  *  The following formula converts a distance in pixels into its equivalent
00224  *  logical HIMETRIC units:
00225  *
00226  *      DistInHiMetric = (HIMETRIC_PER_INCH * DistInPix)
00227  *                       -------------------------------
00228  *                           PIXELS_PER_LOGICAL_IN
00229  *
00230  */
00231 STDAPI_(int) XformWidthInPixelsToHimetric(HDC hDC, int iWidthInPix)
00232         {
00233         int     iXppli;     //Pixels per logical inch along width
00234         int     iWidthInHiMetric;
00235         BOOL    fSystemDC=FALSE;
00236
00237         if (NULL==hDC)
00238                 {
00239                 hDC=GetDC(NULL);
00240                 fSystemDC=TRUE;
00241                 }
00242
00243         iXppli = GetDeviceCaps (hDC, LOGPIXELSX);
00244
00245         //We got pixel units, convert them to logical HIMETRIC along the display
00246         iWidthInHiMetric = MAP_PIX_TO_LOGHIM(iWidthInPix, iXppli);
00247
00248         if (fSystemDC)
00249                 ReleaseDC(NULL, hDC);
00250
00251         return iWidthInHiMetric;
00252         }
00253
00254
00255 STDAPI_(int) XformWidthInHimetricToPixels(HDC hDC, int iWidthInHiMetric)
00256         {
00257         int     iXppli;     //Pixels per logical inch along width
00258         int     iWidthInPix;
00259         BOOL    fSystemDC=FALSE;
00260
00261         if (NULL==hDC)
00262                 {
00263                 hDC=GetDC(NULL);
00264                 fSystemDC=TRUE;
00265                 }
00266
00267         iXppli = GetDeviceCaps (hDC, LOGPIXELSX);
00268
00269         //We got logical HIMETRIC along the display, convert them to pixel units
00270         iWidthInPix = MAP_LOGHIM_TO_PIX(iWidthInHiMetric, iXppli);
00271
00272         if (fSystemDC)
00273                 ReleaseDC(NULL, hDC);
00274
00275         return iWidthInPix;
00276         }
00277
00278
00279 STDAPI_(int) XformHeightInPixelsToHimetric(HDC hDC, int iHeightInPix)
00280         {
00281         int     iYppli;     //Pixels per logical inch along height
00282         int     iHeightInHiMetric;
00283         BOOL    fSystemDC=FALSE;
00284
00285         if (NULL==hDC)
00286                 {
00287                 hDC=GetDC(NULL);
00288                 fSystemDC=TRUE;
00289                 }
00290
00291         iYppli = GetDeviceCaps (hDC, LOGPIXELSY);
00292
00293         //* We got pixel units, convert them to logical HIMETRIC along the display
00294         iHeightInHiMetric = MAP_PIX_TO_LOGHIM(iHeightInPix, iYppli);
00295
00296         if (fSystemDC)
00297                 ReleaseDC(NULL, hDC);
00298
00299         return iHeightInHiMetric;
00300         }
00301
00302
00303 STDAPI_(int) XformHeightInHimetricToPixels(HDC hDC, int iHeightInHiMetric)
00304         {
00305         int     iYppli;     //Pixels per logical inch along height
00306         int     iHeightInPix;
00307         BOOL    fSystemDC=FALSE;
00308
00309         if (NULL==hDC)
00310                 {
00311                 hDC=GetDC(NULL);
00312                 fSystemDC=TRUE;
00313                 }
00314
00315         iYppli = GetDeviceCaps (hDC, LOGPIXELSY);
00316
00317         //* We got logical HIMETRIC along the display, convert them to pixel units
00318         iHeightInPix = MAP_LOGHIM_TO_PIX(iHeightInHiMetric, iYppli);
00319
00320         if (fSystemDC)
00321                 ReleaseDC(NULL, hDC);
00322
00323         return iHeightInPix;
00324         }
00325
00326
00327
00328 /*
00329  * XformRectInPixelsToHimetric
00330  * XformRectInHimetricToPixels
00331  *
00332  * Purpose:
00333  *  Convert a rectangle between pixels of a given hDC and HIMETRIC units
00334  *  as manipulated in OLE.  If the hDC is NULL, then a screen DC is used
00335  *  and assumes the MM_TEXT mapping mode.
00336  *
00337  * Parameters:
00338  *  hDC             HDC providing reference to the pixel mapping.  If
00339  *                  NULL, a screen DC is used.
00340  *  lprcSrc         LPRECT providing the rectangle to convert.  This
00341  *                  contains pixels in XformRectInPixelsToHimetric and
00342  *                  logical HiMetric units in the complement function.
00343  *  lprcDst         LPRECT providing the rectangle to receive converted units.
00344  *                  This contains pixels in XformRectInPixelsToHimetric and
00345  *                  logical HiMetric units in the complement function.
00346  *
00347  * Return Value:
00348  *  None
00349  *
00350  * NOTE:
00351  *  When displaying on the screen, Window apps display everything enlarged
00352  *  from its actual size so that it is easier to read. For example, if an
00353  *  app wants to display a 1in. horizontal line, that when printed is
00354  *  actually a 1in. line on the printed page, then it will display the line
00355  *  on the screen physically larger than 1in. This is described as a line
00356  *  that is "logically" 1in. along the display width. Windows maintains as
00357  *  part of the device-specific information about a given display device:
00358  *      LOGPIXELSX -- no. of pixels per logical in along the display width
00359  *      LOGPIXELSY -- no. of pixels per logical in along the display height
00360  *
00361  *  The following formula converts a distance in pixels into its equivalent
00362  *  logical HIMETRIC units:
00363  *
00364  *      DistInHiMetric = (HIMETRIC_PER_INCH * DistInPix)
00365  *                      -------------------------------
00366  *                            PIXELS_PER_LOGICAL_IN
00367  *
00368  * Rect in Pixels (MM_TEXT):
00369  *
00370  *              0---------- X
00371  *              |
00372  *              |       1) ------------------ ( 2   P1 = (rc.left, rc.top)
00373  *              |       |                     |     P2 = (rc.right, rc.top)
00374  *              |       |                     |     P3 = (rc.left, rc.bottom)
00375  *              |       |                     |     P4 = (rc.right, rc.bottom)
00376  *                      |                     |
00377  *              Y       |                     |
00378  *                      3) ------------------ ( 4
00379  *
00380  *              NOTE:   Origin   = (P1x, P1y)
00381  *                      X extent = P4x - P1x
00382  *                      Y extent = P4y - P1y
00383  *
00384  *
00385  * Rect in Himetric (MM_HIMETRIC):
00386  *
00387  *
00388  *                      1) ------------------ ( 2   P1 = (rc.left, rc.top)
00389  *              Y       |                     |     P2 = (rc.right, rc.top)
00390  *                      |                     |     P3 = (rc.left, rc.bottom)
00391  *              |       |                     |     P4 = (rc.right, rc.bottom)
00392  *              |       |                     |
00393  *              |       |                     |
00394  *              |       3) ------------------ ( 4
00395  *              |
00396  *              0---------- X
00397  *
00398  *              NOTE:   Origin   = (P3x, P3y)
00399  *                      X extent = P2x - P3x
00400  *                      Y extent = P2y - P3y
00401  *
00402  *
00403  */
00404
00405 STDAPI_(void) XformRectInPixelsToHimetric(
00406         HDC hDC, LPRECT lprcPix, LPRECT lprcHiMetric)
00407         {
00408         int     iXppli;     //Pixels per logical inch along width
00409         int     iYppli;     //Pixels per logical inch along height
00410         int     iXextInPix=(lprcPix->right-lprcPix->left);
00411         int     iYextInPix=(lprcPix->bottom-lprcPix->top);
00412         BOOL    fSystemDC=FALSE;
00413
00414         if (NULL==hDC ||
00415             GetDeviceCaps(hDC, TECHNOLOGY) == DT_METAFILE ||
00416             GetDeviceCaps(hDC, LOGPIXELSX) == 0)
00417                 {
00418                 hDC=GetDC(NULL);
00419                 fSystemDC=TRUE;
00420                 }
00421
00422         iXppli = GetDeviceCaps (hDC, LOGPIXELSX);
00423         iYppli = GetDeviceCaps (hDC, LOGPIXELSY);
00424
00425         //We got pixel units, convert them to logical HIMETRIC along the display
00426         lprcHiMetric->right = MAP_PIX_TO_LOGHIM(iXextInPix, iXppli);
00427         lprcHiMetric->top   = MAP_PIX_TO_LOGHIM(iYextInPix, iYppli);
00428
00429         lprcHiMetric->left    = 0;
00430         lprcHiMetric->bottom  = 0;
00431
00432         if (fSystemDC)
00433                 ReleaseDC(NULL, hDC);
00434
00435         return;
00436         }
00437
00438
00439
00440 STDAPI_(void) XformRectInHimetricToPixels(
00441         HDC hDC, LPRECT lprcHiMetric, LPRECT lprcPix)
00442         {
00443         int     iXppli;     //Pixels per logical inch along width
00444         int     iYppli;     //Pixels per logical inch along height
00445         int     iXextInHiMetric=(lprcHiMetric->right-lprcHiMetric->left);
00446         int     iYextInHiMetric=(lprcHiMetric->bottom-lprcHiMetric->top);
00447         BOOL    fSystemDC=FALSE;
00448
00449         if (NULL==hDC ||
00450             GetDeviceCaps(hDC, TECHNOLOGY) == DT_METAFILE ||
00451             GetDeviceCaps(hDC, LOGPIXELSX) == 0)
00452                 {
00453                 hDC=GetDC(NULL);
00454                 fSystemDC=TRUE;
00455                 }
00456
00457         iXppli = GetDeviceCaps (hDC, LOGPIXELSX);
00458         iYppli = GetDeviceCaps (hDC, LOGPIXELSY);
00459
00460         //We got pixel units, convert them to logical HIMETRIC along the display
00461         lprcPix->right = MAP_LOGHIM_TO_PIX(iXextInHiMetric, iXppli);
00462         lprcPix->top   = MAP_LOGHIM_TO_PIX(iYextInHiMetric, iYppli);
00463
00464         lprcPix->left  = 0;
00465         lprcPix->bottom= 0;
00466
00467         if (fSystemDC)
00468                 ReleaseDC(NULL, hDC);
00469
00470         return;
00471         }
00472
00473
00474
00475
00476 /*
00477  * XformSizeInPixelsToHimetric
00478  * XformSizeInHimetricToPixels
00479  *
00480  * Functions to convert a SIZEL structure (Size functions) or
00481  * an int (Width functions) between a device coordinate system and
00482  * logical HiMetric units.
00483  *
00484  * Parameters:
00485  *  hDC             HDC providing reference to the pixel mapping.  If
00486  *                  NULL, a screen DC is used.
00487  *
00488  *  Size Functions:
00489  *  lpSizeSrc       LPSIZEL providing the structure to convert.  This
00490  *                  contains pixels in XformSizeInPixelsToHimetric and
00491  *                  logical HiMetric units in the complement function.
00492  *  lpSizeDst       LPSIZEL providing the structure to receive converted
00493  *                  units.  This contains pixels in
00494  *                  XformSizeInPixelsToHimetric and logical HiMetric
00495  *                  units in the complement function.
00496  *
00497  *  Width Functions:
00498  *  iWidth          int containing the value to convert.
00499  *
00500  * Return Value:
00501  *  Size Functions:     None
00502  *  Width Functions:    Converted value of the input parameters.
00503  *
00504  * NOTE:
00505  *  When displaying on the screen, Window apps display everything enlarged
00506  *  from its actual size so that it is easier to read. For example, if an
00507  *  app wants to display a 1in. horizontal line, that when printed is
00508  *  actually a 1in. line on the printed page, then it will display the line
00509  *  on the screen physically larger than 1in. This is described as a line
00510  *  that is "logically" 1in. along the display width. Windows maintains as
00511  *  part of the device-specific information about a given display device:
00512  *      LOGPIXELSX -- no. of pixels per logical in along the display width
00513  *      LOGPIXELSY -- no. of pixels per logical in along the display height
00514  *
00515  *  The following formula converts a distance in pixels into its equivalent
00516  *  logical HIMETRIC units:
00517  *
00518  *      DistInHiMetric = (HIMETRIC_PER_INCH * DistInPix)
00519  *                       -------------------------------
00520  *                           PIXELS_PER_LOGICAL_IN
00521  *
00522  */
00523
00524 STDAPI_(void) XformSizeInPixelsToHimetric(
00525         HDC hDC, LPSIZEL lpSizeInPix, LPSIZEL lpSizeInHiMetric)
00526         {
00527         int     iXppli;     //Pixels per logical inch along width
00528         int     iYppli;     //Pixels per logical inch along height
00529         BOOL    fSystemDC=FALSE;
00530
00531         if (NULL==hDC ||
00532             GetDeviceCaps(hDC, TECHNOLOGY) == DT_METAFILE ||
00533             GetDeviceCaps(hDC, LOGPIXELSX) == 0)
00534                 {
00535                 hDC=GetDC(NULL);
00536                 fSystemDC=TRUE;
00537                 }
00538
00539         iXppli = GetDeviceCaps (hDC, LOGPIXELSX);
00540         iYppli = GetDeviceCaps (hDC, LOGPIXELSY);
00541
00542         //We got pixel units, convert them to logical HIMETRIC along the display
00543         lpSizeInHiMetric->cx = (long)MAP_PIX_TO_LOGHIM((int)lpSizeInPix->cx, iXppli);
00544         lpSizeInHiMetric->cy = (long)MAP_PIX_TO_LOGHIM((int)lpSizeInPix->cy, iYppli);
00545
00546         if (fSystemDC)
00547                 ReleaseDC(NULL, hDC);
00548
00549         return;
00550         }
00551
00552
00553 STDAPI_(void) XformSizeInHimetricToPixels(
00554         HDC hDC, LPSIZEL lpSizeInHiMetric, LPSIZEL lpSizeInPix)
00555         {
00556         int     iXppli;     //Pixels per logical inch along width
00557         int     iYppli;     //Pixels per logical inch along height
00558         BOOL    fSystemDC=FALSE;
00559
00560         if (NULL==hDC ||
00561             GetDeviceCaps(hDC, TECHNOLOGY) == DT_METAFILE ||
00562             GetDeviceCaps(hDC, LOGPIXELSX) == 0)
00563                 {
00564                 hDC=GetDC(NULL);
00565                 fSystemDC=TRUE;
00566                 }
00567
00568         iXppli = GetDeviceCaps (hDC, LOGPIXELSX);
00569         iYppli = GetDeviceCaps (hDC, LOGPIXELSY);
00570
00571         //We got logical HIMETRIC along the display, convert them to pixel units
00572         lpSizeInPix->cx = (long)MAP_LOGHIM_TO_PIX((int)lpSizeInHiMetric->cx, iXppli);
00573         lpSizeInPix->cy = (long)MAP_LOGHIM_TO_PIX((int)lpSizeInHiMetric->cy, iYppli);
00574
00575         if (fSystemDC)
00576                 ReleaseDC(NULL, hDC);
00577
00578         return;
00579         }
00580
00581
00582 #if defined( OBSOLETE )
00583 // This function has been converted to a macro
00584
00585 /* AreRectsEqual
00586 ** -------------
00587 */
00588 STDAPI_(BOOL) AreRectsEqual(LPRECT lprc1, LPRECT lprc2)
00589 {
00590         if ((lprc1->top == lprc2->top) &&
00591                 (lprc1->left == lprc2->left) &&
00592                 (lprc1->right == lprc2->right) &&
00593                 (lprc1->bottom == lprc2->bottom))
00594                 return TRUE;
00595
00596         return FALSE;
00597 }
00598 #endif  // OBSOLETE
00599
00600
00601 /*
00602  * ParseCmdLine
00603  *
00604  * Parses the Windows command line which was passed to WinMain.
00605  * This function determines if the -Embedding switch has been given.
00606  *
00607  */
00608
00609 STDAPI_(void) ParseCmdLine(
00610         LPSTR lpszLine,
00611         BOOL FAR* lpfEmbedFlag,
00612         LPSTR szFileName)
00613 {
00614         int i=0;
00615         char szBuf[256];
00616
00617         if(lpfEmbedFlag)
00618                 *lpfEmbedFlag = FALSE;
00619         szFileName[0]='\0';             // NULL string
00620
00621         // skip blanks
00622         while(isspace(*lpszLine)) lpszLine++;
00623
00624         if(!*lpszLine)   // No filename or options, so start a fresh document.
00625                 return;
00626
00627         // Check for "-Embedding" or "/Embedding" and set fEmbedding.
00628         if(lpfEmbedFlag && (*lpszLine == '-' || *lpszLine == '/')) {
00629                 lpszLine++;
00630                 lpszLine = GetWord(lpszLine, szBuf);
00631                 *lpfEmbedFlag = !lstrcmp(szBuf, EMBEDDINGFLAG);
00632         }
00633
00634         // skip blanks
00635         while(isspace(*lpszLine)) lpszLine++;
00636
00637         // set szFileName to argument
00638         while(lpszLine[i]) {
00639                 szFileName[i]=lpszLine[i];
00640                 i++;
00641         }
00642         szFileName[i]='\0';
00643 }
00644
00645
00646 /* GetWord
00647  * -------
00648  *
00649  * LPSTR lpszSrc - Pointer to a source string
00650  * LPSTR lpszDst - Pointer to destination buffer
00651  *
00652  * Will copy one space-terminated or null-terminated word from the source
00653  * string to the destination buffer.
00654  * returns: pointer to next character following the word.
00655  */
00656 static LPSTR GetWord(LPSTR lpszSrc, LPSTR lpszDst)
00657 {
00658         while (*lpszSrc && !isspace(*lpszSrc))
00659                 *lpszDst++ = *lpszSrc++;
00660
00661         *lpszDst = '\0';
00662         return lpszSrc;
00663 }
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRTCOutgoingApp Member List

This is the complete list of members for CRTCOutgoingApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CRTCOutgoingApp() | CRTCOutgoingApp |
CWinApp() | CWinApp |
ExitInstance() | CWinApp | [virtual]
InitInstance() | CRTCOutgoingApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:57:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/dbsess.h Source File

  • Dataaccess
  • oledb
  • sampprov

dbsess.h

Go to the documentation of this file.
00001
00002 //--------------------------------------------------------------------
00003 // Microsoft OLE DB Sample Provider
00004 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00005 //
00006 // @doc
00007 //
00008 // @module DBSESS.H | CDBSession base object and contained interface
00009 // definitions
00010 //
00011 //
00012 #ifndef _DBSESS_H_
00013 #define _DBSESS_H_
00014
00015 #include "baseobj.h"
00016
00017
00018 // Forward declarations ------------------------------------------------------
00019
00020 class   CImpIGetDataSource;
00021 class   CImpIOpenRowset;
00022 class CImpISessionProperties;
00023 class CImpIDBCreateCommand;
00024 class CImpIBindResource;
00025
00026 typedef CImpIGetDataSource*   PIMPIGETDATASOURCE;
00027 typedef CImpIOpenRowset*    PIMPIOPENROWSET;
00028 typedef CImpISessionProperties* PIMPISESSIONPROPERTIES;
00029 typedef CImpIDBCreateCommand* PIMPIDBCREATECOMMAND;
00030 typedef CImpIBindResource*    PIMPIBINDRESOURCE;
00031
00032 // Classes -------------------------------------------------------------------
00033
00034 //----------------------------------------------------------------------------
00035 // @class CDBSession | Containing class for all interfaces on the DBSession
00036 // Object
00037 //
00038 class CDBSession : public CBaseObj        //@base public | CBaseObj
00039 {
00040     // contained interfaces are friends
00041     friend class CImpIGetDataSource;
00042     friend class CImpIOpenRowset;
00043     friend class CImpIDataSource;
00044     friend class CImpISessionProperties;
00045   friend class CImpICreateCommand;
00046   friend class CImpIBindResource;
00047
00048   protected: //@access protected
00049     //@cmember Reference count
00050     DBREFCOUNT          m_cRef;
00051
00052     //@member Utility object to manage properties
00053         PCUTILPROP                  m_pUtilProp;
00054
00055         //@member contained IOpenRowset
00056         PIMPIOPENROWSET             m_pIOpenRowset;
00057
00058     //@member contained IGetDataSource
00059     PIMPIGETDATASOURCE      m_pIGetDataSource;
00060
00061     //@member contained ISessionProperties
00062     PIMPISESSIONPROPERTIES    m_pISessionProperties;
00063
00064     //@member contained IDBCreateCommand
00065     PIMPIDBCREATECOMMAND    m_pIDBCreateCommand;
00066
00067     //@member contained IBindResource
00068     PIMPIBINDRESOURCE     m_pIBindResource;
00069
00070   public: //@access public
00071     //@cmember Constructor
00072      CDBSession(LPUNKNOWN);
00073     //@cmember Destructor
00074     ~CDBSession(void);
00075
00076     //@mcember parent data source object
00077     PCDATASOURCE        m_pCDataSource;
00078
00079     //@cmember Intitialization Routine
00080     BOOL FInit( CDataSource *pCDataSource );
00081
00082     //  Object's base IUnknown
00083     //@cmember Request an Interface
00084     STDMETHODIMP        QueryInterface(REFIID, LPVOID *);
00085     //@cmember Increments the Reference count
00086     STDMETHODIMP_(DBREFCOUNT) AddRef(void);
00087     //@cmember Decrements the Reference count
00088     STDMETHODIMP_(DBREFCOUNT) Release(void);
00089 };
00090
00091 typedef CDBSession *PCDBSESSION;
00092
00093
00094 //----------------------------------------------------------------------------------------
00095 // @class CImpIGetDataSource   | contained IGetDataSource class
00096
00097
00098 class CImpIGetDataSource : public IGetDataSource      //@base public | IGetDataSource
00099 {
00100   private:        //@access private
00101     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDBSession)
00102
00103   public:         //@access public
00104     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDBSession, CImpIGetDataSource);
00105     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00106
00107
00108         // IGetDataSource method
00109         //@cmember GetDataSource
00110     STDMETHODIMP  GetDataSource( REFIID, IUnknown** );
00111 };
00112
00113 //----------------------------------------------------------------------------------------
00114 // @class CImpIOpenRowset   | contained IOpenRowset class
00115
00116
00117 class CImpIOpenRowset : public IOpenRowset      //@base public | IOpenRowset
00118 {
00119   private:        //@access private
00120     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDBSession)
00121
00122   public:         //@access public
00123     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDBSession, CImpIOpenRowset);
00124     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00125
00126
00127         // IOpenRowset method
00128         //@cmember OpenRowset
00129     STDMETHODIMP  OpenRowset( IUnknown*, DBID*, DBID*, REFIID, ULONG, DBPROPSET[], IUnknown** );
00130 };
00131
00132
00133 //----------------------------------------------------------------------------
00134 // @class CImpISessionProperties | Contained ISessionProperties class
00135 //
00136 class CImpISessionProperties : public ISessionProperties    //@base public | ISessionProperties
00137 {
00138   private:        //@access private
00139     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDBSession)
00140
00141   public:         //@access public
00142     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDBSession, CImpISessionProperties);
00143     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00144
00145     //  IDBProperties member functions
00146
00147         //@cmember GetProperties method
00148         STDMETHODIMP GetProperties
00149               (
00150             ULONG       cPropertySets,
00151                 const DBPROPIDSET rgPropertySets[],
00152                 ULONG*              pcProperties,
00153             DBPROPSET**     prgProperties
00154               );
00155
00156
00157         //@cmember SetProperties method
00158         STDMETHODIMP  SetProperties
00159           (
00160             ULONG       cPropertySets,
00161             DBPROPSET     rgPropertySets[]
00162           );
00163 };
00164
00165
00166
00167 //----------------------------------------------------------------------------
00168 // @class CImpIDBCreateCommand | Contained IDBCreateCommand class
00169
00170 class CImpIDBCreateCommand : public IDBCreateCommand  //@base public | IDBCreateCommand
00171 {
00172   private:    //@access private data
00173     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDBSession);
00174
00175   public:     //@access public
00176     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDBSession, CImpIDBCreateCommand);
00177     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00178
00179     //  IDBCreateCommand member functions
00180
00181     //@cmember CreateCommand Method
00182       STDMETHODIMP  CreateCommand(IUnknown*, REFIID, IUnknown **);
00183 };
00184
00185 #endif
00186
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

qcship::IShipDefault Member List

This is the complete list of members for qcship::IShipDefault, including all inherited members.
iid | qcship::IShipDefault | [static]
LineItem(int lItemId, int lQuantity) | qcship::IShipDefault |
Process(int lFlags) | qcship::IShipDefault |
setCustomerId(int _jcomparam_0) | qcship::IShipDefault |
setOrderId(int _jcomparam_0) | qcship::IShipDefault |
Generated on Wed Nov 13 2024 16:58:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHiPerfProvider Member List

This is the complete list of members for CHiPerfProvider, including all inherited members.
CHiPerfProvider() | CHiPerfProvider |
CreateRefreshableEnum(IWbemServices *pNamespace, LPCWSTR wszClass, IWbemRefresher *pRefresher, long lFlags, IWbemContext *pContext, IWbemHiPerfEnum *pHiPerfEnum, long *plId) | CHiPerfProvider |
CreateRefreshableObject(IWbemServices __RPC_FAR *pNamespace, IWbemObjectAccess __RPC_FAR *pTemplate, IWbemRefresher __RPC_FAR *pRefresher, long lFlags, IWbemContext __RPC_FAR *pContext, IWbemObjectAccess __RPC_FAR *__RPC_FAR *ppRefreshable, long __RPC_FAR *plId) | CHiPerfProvider |
CreateRefresher(IWbemServices __RPC_FAR *pNamespace, long lFlags, IWbemRefresher __RPC_FAR *__RPC_FAR *ppRefresher) | CHiPerfProvider |
GetObjects(IWbemServices *pNamespace, long lNumObjects, IWbemObjectAccess **apObj, long lFlags, IWbemContext *pContext) | CHiPerfProvider |
Initialize(LPWSTR wszUser, long lFlags, LPWSTR wszNamespace, LPWSTR wszLocale, IWbemServices __RPC_FAR *pNamespace, IWbemContext __RPC_FAR *pCtx, IWbemProviderInitSink __RPC_FAR *pInitSink) | CHiPerfProvider |
m_lRef | CHiPerfProvider | [private]
m_pSampleDS | CHiPerfProvider | [private, static]
m_pTemplate | CHiPerfProvider | [private]
QueryInstances(IWbemServices __RPC_FAR *pNamespace, WCHAR __RPC_FAR *wszClass, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pSink) | CHiPerfProvider |
QueryInterface(REFIID riid, void **ppv) | CHiPerfProvider |
STDMETHODIMP_(ULONG) AddRef() | CHiPerfProvider |
STDMETHODIMP_(ULONG) Release() | CHiPerfProvider |
StopRefreshing(IWbemRefresher __RPC_FAR *pRefresher, long lId, long lFlags) | CHiPerfProvider |
~CHiPerfProvider() | CHiPerfProvider |
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/PersistSubs/Persistatl/NewsEvent.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • PersistSubs
  • Persistatl

NewsEvent.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc2.tmp" /nologo /d "D:\ComPlusSamples\Source\LCE\PersistSubs" "D:\ComPlusSamples\Source\LCE\PersistSubs\PersistATL.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package persistatl;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.register(clsid=6B834DA0-A5D3-11D2-AD4D-0080C7BFF6DB, typelib=04A47040-A5D3-11D2-AD4D-0080C7BFF6DB, version="1.0", description="NewsEvent Class")*/
00019 public class NewsEvent implements IUnknown,com.ms.com.NoAutoScripting,persistatl.INewsEventDefault
00020 {
00021   public void NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL)
00022   {
00023     com.ms.win32.User32.MessageBox (0,Headline,Symbol,0);
00024
00025   }
00026
00027   public void ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow)
00028   {
00029   }
00030
00031   public void LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate)
00032   {
00033   }
00034
00035 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/space.Cpp Source File

  • SysMgmt
  • MMC
  • Toolbar

space.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "Space.h"
00021 #include "Comp.h"
00022 #define STRSAFE_NO_DEPRECATE
00023 #include <strsafe.h>
00024
00025 const GUID CSpaceVehicle::thisGuid = { 0x29743810, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00026 const GUID CRocket::thisGuid = { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00027
00028 //==============================================================
00029 //
00030 // CSpaceVehicle implementation
00031 //
00032 //
00033 CSpaceVehicle::CSpaceVehicle(CComponentData *pComponentData)
00034 {
00035     m_pComponentData = pComponentData;
00036
00037     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00038         children[n] = new CRocket(pComponentData);
00039         children[n]->Initialize(_T("Vehicle"), 500000, 265, 75000);
00040     }
00041 }
00042
00043 CSpaceVehicle::~CSpaceVehicle()
00044 {
00045     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00046         if (children[n]) {
00047             delete children[n];
00048         }
00049 }
00050
00051 HRESULT CSpaceVehicle::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00052 {
00053     HRESULT      hr = S_OK;
00054
00055     IHeaderCtrl *pHeaderCtrl = NULL;
00056     IResultData *pResultData = NULL;
00057
00058     if (bShow) {
00059         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00060         _ASSERT( SUCCEEDED(hr) );
00061
00062         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00063         _ASSERT( SUCCEEDED(hr) );
00064
00065         // Set the column headers in the results pane
00066         hr = pHeaderCtrl->InsertColumn( 0, L"Rocket Class", 0, MMCLV_AUTO );
00067         _ASSERT( S_OK == hr );
00068         hr = pHeaderCtrl->InsertColumn( 1, L"Rocket Weight", 0, MMCLV_AUTO );
00069         _ASSERT( S_OK == hr );
00070         hr = pHeaderCtrl->InsertColumn( 2, L"Rocket Height", 0, MMCLV_AUTO );
00071         _ASSERT( S_OK == hr );
00072         hr = pHeaderCtrl->InsertColumn( 3, L"Rocket Payload", 0, MMCLV_AUTO );
00073         _ASSERT( S_OK == hr );
00074         hr = pHeaderCtrl->InsertColumn( 4, L"Status", 0, MMCLV_AUTO );
00075         _ASSERT( S_OK == hr );
00076
00077         // insert items here
00078         RESULTDATAITEM rdi;
00079
00080         hr = pResultData->DeleteAllRsltItems();
00081         _ASSERT( SUCCEEDED(hr) );
00082
00083         if (!bExpanded) {
00084             // create the child nodes, then expand them
00085             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00086                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00087                 rdi.mask       = RDI_STR       |   // Displayname is valid
00088                     RDI_IMAGE     |
00089                     RDI_PARAM;        // nImage is valid
00090
00091                 rdi.nImage      = children[n]->GetBitmapIndex();
00092                 rdi.str         = MMC_CALLBACK;
00093                 rdi.nCol        = 0;
00094                 rdi.lParam      = (LPARAM)children[n];
00095
00096                 hr = pResultData->InsertItem( &rdi );
00097
00098                 _ASSERT( SUCCEEDED(hr) );
00099             }
00100         }
00101
00102         pHeaderCtrl->Release();
00103         pResultData->Release();
00104     }
00105
00106     return hr;
00107 }
00108
00109 //==============================================================
00110 //
00111 // CRocket implementation
00112 //
00113 //
00114 CRocket::CRocket(CComponentData *pComponentData)
00115 : szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED)
00116 {
00117     m_pComponentData = pComponentData;
00118 }
00119
00120 CRocket::~CRocket()
00121 {
00122     if (szName)
00123         delete [] szName;
00124 }
00125
00126 void CRocket::Initialize(_TCHAR *szName, LONG lWeight, LONG lHeight, LONG lPayload)
00127 {
00128     if (szName) {
00129         this->szName = new _TCHAR[_tcslen(szName) + 1];
00130         _tcscpy(this->szName, szName);
00131     }
00132
00133     this->lWeight = lWeight;
00134     this->lHeight = lHeight;
00135     this->lPayload = lPayload;
00136 }
00137
00138 const _TCHAR *CRocket::GetDisplayName(int nCol)
00139 {
00140     const size_t cchBuffer = 128;
00141     static _TCHAR buf[cchBuffer];
00142
00143     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00144     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00145
00146     switch (nCol) {
00147     case 0:
00148         StringCchCopy(buf, cchBuffer, szName ? szName : _T(""));
00149         break;
00150
00151     case 1:
00152         StringCchPrintf(buf, cchBuffer, _T("%ld metric tons"), lWeight);
00153         break;
00154
00155     case 2:
00156         StringCchPrintf(buf, cchBuffer, _T("%ld meters"), lHeight);
00157         break;
00158
00159     case 3:
00160         StringCchPrintf(buf, cchBuffer, _T("%ld kilos"), lPayload);
00161         break;
00162
00163     case 4:
00164         StringCchPrintf(buf, cchBuffer, _T("%s"),
00165             iStatus == RUNNING ? _T("running") :
00166         iStatus == PAUSED ? _T("paused") :
00167         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00168         break;
00169
00170     }
00171
00172     return buf;
00173 }
00174
00175 HRESULT CRocket::OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect)
00176 {
00177     if (bSelect) {
00178         switch (iStatus)
00179         {
00180         case RUNNING:
00181             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, TRUE);
00182             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, FALSE);
00183             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00184             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00185             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00186             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00187             break;
00188
00189         case PAUSED:
00190             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00191             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00192             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, TRUE);
00193             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, FALSE);
00194             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00195             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00196             break;
00197
00198         case STOPPED:
00199             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00200             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00201             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00202             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00203             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, TRUE);
00204             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, FALSE);
00205             break;
00206         }
00207     }
00208
00209     return S_OK;
00210 }
00211
00212 HRESULT CRocket::OnButtonClicked(CComponent *pComponent)
00213 {
00214     switch (iStatus)
00215     {
00216     case RUNNING:
00217         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, TRUE);
00218         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, FALSE);
00219         pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00220         pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00221         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00222         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00223         break;
00224
00225     case PAUSED:
00226         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00227         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00228         pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, TRUE);
00229         pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, FALSE);
00230         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00231         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00232         break;
00233
00234     case STOPPED:
00235         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00236         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00237         pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00238         pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00239         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, TRUE);
00240         pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, FALSE);
00241         break;
00242     }
00243
00244     return S_OK;
00245 }
00246
00247 HRESULT CRocket::OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect)
00248 {
00249     HRESULT hr = S_OK;
00250
00251     if (bSelect) {
00252         // Always make sure the menuButton is attached
00253         hr = pControlbar->Attach(TOOLBAR, pToolbar);
00254         hr = OnSelect(pComponent, bScope, bSelect);
00255     } else {
00256         // Always make sure the toolbar is detached
00257         hr = pControlbar->Detach(pToolbar);
00258     }
00259
00260     return hr;
00261 }
00262
00263 HRESULT CRocket::OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb)
00264 {
00265     const size_t cchBuffer = 128;
00266     _TCHAR szVehicle[cchBuffer];
00267
00268     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00269     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00270
00271     switch (verb)
00272     {
00273     case ID_BUTTONSTART:
00274             iStatus = RUNNING;
00275         break;
00276
00277     case ID_BUTTONPAUSE:
00278         iStatus = PAUSED;
00279         break;
00280
00281     case ID_BUTTONSTOP:
00282         iStatus = STOPPED;
00283         break;
00284     }
00285
00286     StringCchPrintf(szVehicle, cchBuffer, _T("Vehicle %s has been %s"), szName,
00287         (long)verb == ID_BUTTONSTART ? _T("started") :
00288     (long)verb == ID_BUTTONPAUSE ? _T("paused") :
00289     (long)verb == ID_BUTTONSTOP ? _T("stopped") : _T("!!!unknown command!!!"));
00290
00291     int ret = 0;
00292     MAKE_WIDEPTR_FROMTSTR_ALLOC(wszVehicle, szVehicle);
00293     pConsole->MessageBox(wszVehicle,
00294         L"Vehicle command", MB_OK | MB_ICONINFORMATION, &ret);
00295
00296     OnButtonClicked(pComponent);
00297     return S_OK;
00298 }
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Intermediate/Catlpwr.Idl Source File

  • Web
  • iis
  • Components
  • Cpp
  • Intermediate

Catlpwr.Idl

Go to the documentation of this file.
00001 // CATLPwr.idl : IDL source for CATLPwr.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (CATLPwr.tlb) and marshalling code.
00006
00007     [
00008         object,
00009         uuid(61CECB3A-68D3-11D0-8AE3-00C0F00AE35A),
00010         dual,
00011         helpstring("IPower Interface"),
00012         pointer_default(unique),
00013         oleautomation
00014     ]
00015     interface IPower : IDispatch
00016     {
00017         import "oaidl.idl";
00018
00019         [id(1), propget, helpstring("Get MyProperty's value")]
00020         HRESULT myProperty([out,retval] BSTR* pbstrOutValue);
00021
00022         [id(1), propput, helpstring("Set MyProperty's value")]
00023         HRESULT myProperty([in] BSTR bstrInValue);
00024
00025         [id(2), helpstring("Convert argument to uppercase")]
00026         HRESULT myMethod([in] BSTR bstrIn, [out, retval] BSTR* pbstrOut);
00027
00028         [id(3), propget, helpstring("Return the script's name")]
00029         HRESULT myPowerProperty([out,retval] BSTR* pbstrOutValue);
00030
00031         [id(4), helpstring("Write message according to browser")]
00032         HRESULT myPowerMethod();
00033     };
00034
00035
00036
00037 [
00038     uuid(61CECB38-68D3-11D0-8AE3-00C0F00AE35A),
00039     version(1.0),
00040     helpstring("IISSample CATLPwr Object Library")
00041 ]
00042 library CATLPwr
00043 {
00044     importlib("stdole32.tlb");
00045
00046     [
00047         uuid(61CECB3E-68D3-11D0-8AE3-00C0F00AE35A),
00048         helpstring("Power Class")
00049     ]
00050     coclass CPower
00051     {
00052         [default] interface IPower;
00053     };
00054
00055 };
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/appDll/AppMema.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • appDll

AppMema.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1995 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     appmema.c
00012
00013 Abstract:
00014
00015     application memory performance counter interface functions
00016
00017     This file contains the memory allocation function "wrappers"
00018     to allow monitoring of the memory usage by a performance monitoring
00019     application (e.g. PERFMON).
00020
00021 --*/
00022 #include <windows.h>
00023 #include "appmema.h"
00024 #include "..\pub\appmem.h"
00025
00026 HGLOBAL
00027 GlobalAllocP(
00028     UINT    fuFlags,
00029     DWORD   cbBytes
00030 )
00031 {
00032    HGLOBAL hReturn;
00033    DWORD   dwSize;
00034
00035    hReturn = GlobalAlloc(fuFlags, cbBytes);
00036    if (hReturn != NULL)
00037    {
00038       // only collect statistics on successful calls
00039       if (pAppData != NULL)
00040       {
00041          // only update data if data block is valid
00042          // update call count
00043          pAppData->dwAllocCalls ++;
00044          dwSize = (DWORD) GlobalSize(hReturn);
00045          pAppData->dwApplicationBytes += dwSize;
00046       }
00047    }
00048    return hReturn;
00049 }
00050
00051 HGLOBAL
00052 GlobalFreeP(
00053    HGLOBAL hglbMem
00054 )
00055 {
00056    HGLOBAL hReturn;
00057    DWORD   dwSize;
00058
00059    // get size of block before freeing it
00060    dwSize = (DWORD) GlobalSize(hglbMem);
00061    if (dwSize > 0)
00062    {
00063       // size was obtained OK so free the block
00064       hReturn = GlobalFree(hglbMem);
00065       if (hReturn == NULL)
00066       {
00067          // memory was freed
00068          if (pAppData != NULL)
00069          {
00070             // update call count
00071             pAppData->dwFreeCalls ++;
00072             pAppData->dwApplicationBytes -= dwSize;
00073          }
00074       }
00075       else
00076       {
00077          // memory was not freed so don't change data
00078       }
00079    }
00080    else
00081    {
00082       // unable to read memory size
00083    }
00084    return hReturn;
00085 }
00086
00087 HGLOBAL
00088 GlobalReAllocP(
00089     HGLOBAL hglbMem,
00090     DWORD   cbBytes,
00091     UINT    fuFlags
00092 )
00093 {
00094    HGLOBAL hReturn;
00095    DWORD   dwBeforeSize = 0;
00096    DWORD   dwAfterSize  = 0;
00097
00098    // get size of block before re-alloc-ing it
00099    dwBeforeSize = (DWORD) GlobalSize(hglbMem);
00100    if (dwBeforeSize > 0)
00101    {
00102       // size was obtained OK so realloc the block
00103       hReturn = GlobalReAlloc(hglbMem, cbBytes, fuFlags);
00104       if (hReturn != NULL)
00105       {
00106          // memory was re alloc'd so get the new size
00107          dwAfterSize = (DWORD) GlobalSize(hReturn);
00108       }
00109       else
00110       {
00111          // memory was not re-alloced so set after size to 0
00112       }
00113       if (pAppData != NULL)
00114       {
00115          // update call count
00116          pAppData->dwReAllocCalls ++;
00117          pAppData->dwApplicationBytes -= dwBeforeSize;
00118          pAppData->dwApplicationBytes += dwAfterSize;
00119       }
00120    }
00121    else
00122    {
00123       // unable to read memory size nothing has changed
00124       // return original pointer
00125       hReturn = hglbMem;
00126    }
00127    return hReturn;
00128 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCallbackWrapper Member List

This is the complete list of members for CCallbackWrapper, including all inherited members.
CCallbackWrapper(HWND hwndCallback) | CCallbackWrapper |
DeleteLogError(REFSYNCMGRERRORID ErrorID, DWORD dwReserved) | CCallbackWrapper |
EnableModeless(BOOL fEnable) | CCallbackWrapper |
EstablishConnection(WCHAR const *lpwszConnection, DWORD dwReserved) | CCallbackWrapper |
LogError(DWORD dwErrorLevel, const WCHAR *lpcErrorText, LPSYNCMGRLOGERRORINFO lpSyncLogError) | CCallbackWrapper |
m_cRef | CCallbackWrapper | [private]
m_hwndCallback | CCallbackWrapper | [private]
PrepareForSyncCompleted(HRESULT hr) | CCallbackWrapper |
Progress(REFSYNCMGRITEMID ItemID, LPSYNCMGRPROGRESSITEM lpSyncProgressItem) | CCallbackWrapper |
QueryInterface(REFIID, LPVOID FAR *) | CCallbackWrapper |
ShowErrorCompleted(HRESULT hr, ULONG cbNumItems, SYNCMGRITEMID *pItemIDs) | CCallbackWrapper |
ShowPropertiesCompleted(HRESULT hr) | CCallbackWrapper |
STDMETHODIMP_(ULONG) AddRef() | CCallbackWrapper |
STDMETHODIMP_(ULONG) Release() | CCallbackWrapper |
SynchronizeCompleted(HRESULT hr) | CCallbackWrapper |
~CCallbackWrapper() | CCallbackWrapper |
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/RegExt.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

RegExt.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      RegExt.cpp
00007 //
00008 //  Description:
00009 //      Implementation of routines for extension registration.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 #include "stdafx.h"
00021 #include <ole2.h>
00022 #include <StrSafe.h>
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00030 const LPCWSTR REG_VALUE_ADMIN_EXTENSIONS = L"AdminExtensions";
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // Static Function Prototypes
00034 /////////////////////////////////////////////////////////////////////////////
00035
00036 static DWORD
00037 RegisterAnyCluAdminExtension(
00038       HCLUSTER      hClusterIn
00039     , LPCWSTR       pwszKeyNameIn
00040     , const CLSID * pClsidIn
00041     );
00042
00043 static DWORD
00044 RegisterAnyCluAdminExtension(
00045       HKEY          hKeyIn
00046     , const CLSID * pClsidIn
00047     );
00048
00049 static DWORD
00050 UnregisterAnyCluAdminExtension(
00051       HCLUSTER      hClusterIn
00052     , LPCWSTR       pwszKeyNameIn
00053     , const CLSID * pClsidIn
00054     );
00055
00056 static DWORD
00057 UnregisterAnyCluAdminExtension(
00058       HKEY          hKeyIn
00059     , const CLSID * pClsidIn
00060     );
00061
00062 static DWORD
00063 ReadValue(
00064       HKEY      hKeyIn
00065     , LPCWSTR   pwszValueNameIn
00066     , LPWSTR *  ppwszValueOut
00067     , size_t *  pcchValueOut
00068     );
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 //++
00072 //
00073 //  RegisterCluAdminClusterExtension
00074 //
00075 //  Routine Description:
00076 //      Register with the cluster database a Cluster Administrator Extension
00077 //      DLL that extends the cluster object.
00078 //
00079 //  Arguments:
00080 //      hClusterIn      Handle to the cluster to modify.
00081 //      pClsidIn        Extension's CLSID.
00082 //
00083 //  Return Value:
00084 //      ERROR_SUCCESS   Extension registered successfully.
00085 //      Win32 error code if another failure occurred.
00086 //
00087 //--
00088 /////////////////////////////////////////////////////////////////////////////
00089 DWORD
00090 RegisterCluAdminClusterExtension(
00091       HCLUSTER      hClusterIn
00092     , const CLSID * pClsidIn
00093     )
00094 {
00095     DWORD   sc = ERROR_SUCCESS;
00096     HKEY    hKey = NULL;
00097
00098     //
00099     //  Get the cluster registry key.
00100     //
00101
00102     hKey = GetClusterKey( hClusterIn, KEY_ALL_ACCESS );
00103     if ( hKey == NULL )
00104     {
00105         sc = GetLastError();
00106     } // if: error getting cluster key
00107     else
00108     {
00109         //
00110         //  Register the extension.
00111         //
00112
00113         sc = RegisterAnyCluAdminExtension( hKey, pClsidIn );
00114
00115         ClusterRegCloseKey( hKey );
00116     }  // else:  GetClusterKey succeeded
00117
00118     return sc;
00119
00120 }  //*** RegisterCluAdminClusterExtension
00121
00122 /////////////////////////////////////////////////////////////////////////////
00123 //++
00124 //
00125 //  RegisterCluAdminAllNodesExtension
00126 //
00127 //  Routine Description:
00128 //      Register with the cluster database a Cluster Administrator Extension
00129 //      DLL that extends all nodes.
00130 //
00131 //  Arguments:
00132 //      hClusterIn      Handle to the cluster to modify.
00133 //      pClsidIn        Extension's CLSID.
00134 //
00135 //  Return Value:
00136 //      ERROR_SUCCESS   Extension registered successfully.
00137 //      Win32 error code if another failure occurred.
00138 //
00139 //--
00140 /////////////////////////////////////////////////////////////////////////////
00141 DWORD
00142 RegisterCluAdminAllNodesExtension(
00143       HCLUSTER      hClusterIn
00144     , const CLSID * pClsidIn
00145     )
00146 {
00147     DWORD sc = ERROR_SUCCESS;
00148
00149     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Nodes", pClsidIn );
00150
00151     return sc;
00152
00153 }  //*** RegisterCluAdminAllNodesExtension
00154
00155 /////////////////////////////////////////////////////////////////////////////
00156 //++
00157 //
00158 //  RegisterCluAdminAllGroupsExtension
00159 //
00160 //  Routine Description:
00161 //      Register with the cluster database a Cluster Administrator Extension
00162 //      DLL that extends all groups.
00163 //
00164 //  Arguments:
00165 //      hClusterIn      Handle to the cluster to modify.
00166 //      pClsidIn        Extension's CLSID.
00167 //
00168 //  Return Value:
00169 //      ERROR_SUCCESS   Extension registered successfully.
00170 //      Win32 error code if another failure occurred.
00171 //
00172 //--
00173 /////////////////////////////////////////////////////////////////////////////
00174 DWORD
00175 RegisterCluAdminAllGroupsExtension(
00176       HCLUSTER      hClusterIn
00177     , const CLSID * pClsidIn
00178     )
00179 {
00180     DWORD sc = ERROR_SUCCESS;
00181
00182     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Groups", pClsidIn );
00183
00184     return sc;
00185
00186 }  //*** RegisterCluAdminAllGroupsExtension
00187
00188 /////////////////////////////////////////////////////////////////////////////
00189 //++
00190 //
00191 //  RegisterCluAdminAllResourcesExtension
00192 //
00193 //  Routine Description:
00194 //      Register with the cluster database a Cluster Administrator Extension
00195 //      DLL that extends all resources.
00196 //
00197 //  Arguments:
00198 //      hClusterIn      Handle to the cluster to modify.
00199 //      pClsidIn        Extension's CLSID.
00200 //
00201 //  Return Value:
00202 //      ERROR_SUCCESS   Extension registered successfully.
00203 //      Win32 error code if another failure occurred.
00204 //
00205 //--
00206 /////////////////////////////////////////////////////////////////////////////
00207 DWORD
00208 RegisterCluAdminAllResourcesExtension(
00209       HCLUSTER       hClusterIn
00210     , const CLSID * pClsidIn
00211     )
00212 {
00213     DWORD   sc = ERROR_SUCCESS;
00214
00215     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Resources", pClsidIn );
00216
00217     return sc;
00218
00219 }  //*** RegisterCluAdminAllResourcesExtension
00220
00221 /////////////////////////////////////////////////////////////////////////////
00222 //++
00223 //
00224 //  RegisterCluAdminAllResourceTypesExtension
00225 //
00226 //  Routine Description:
00227 //      Register with the cluster database a Cluster Administrator Extension
00228 //      DLL that extends all resource types.
00229 //
00230 //  Arguments:
00231 //      hClusterIn      Handle to the cluster to modify.
00232 //      pClsidIn        Extension's CLSID.
00233 //
00234 //  Return Value:
00235 //      ERROR_SUCCESS   Extension registered successfully.
00236 //      Win32 error code if another failure occurred.
00237 //
00238 //--
00239 /////////////////////////////////////////////////////////////////////////////
00240 DWORD
00241 RegisterCluAdminAllResourceTypesExtension(
00242       HCLUSTER      hClusterIn
00243     , const CLSID * pClsidIn
00244     )
00245 {
00246     DWORD   sc = ERROR_SUCCESS;
00247
00248     sc = RegisterAnyCluAdminExtension( hClusterIn, L"ResourceTypes", pClsidIn );
00249
00250     return sc;
00251
00252 }  //*** RegisterCluAdminAllResourceTypesExtension
00253
00254 /////////////////////////////////////////////////////////////////////////////
00255 //++
00256 //
00257 //  RegisterCluAdminAllNetworksExtension
00258 //
00259 //  Routine Description:
00260 //      Register with the cluster database a Cluster Administrator Extension
00261 //      DLL that extends all networks.
00262 //
00263 //  Arguments:
00264 //      hClusterIn      Handle to the cluster to modify.
00265 //      pClsidIn        Extension's CLSID.
00266 //
00267 //  Return Value:
00268 //      ERROR_SUCCESS   Extension registered successfully.
00269 //      Win32 error code if another failure occurred.
00270 //
00271 //--
00272 /////////////////////////////////////////////////////////////////////////////
00273 DWORD
00274 RegisterCluAdminAllNetworksExtension(
00275       HCLUSTER      hClusterIn
00276     , const CLSID * pClsidIn
00277     )
00278 {
00279     DWORD   sc = ERROR_SUCCESS;
00280
00281     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Networks", pClsidIn );
00282
00283     return sc;
00284
00285 }  //*** RegisterCluAdminAllNetworksExtension
00286
00287 /////////////////////////////////////////////////////////////////////////////
00288 //++
00289 //
00290 //  RegisterCluAdminAllNetInterfacesExtension
00291 //
00292 //  Routine Description:
00293 //      Register with the cluster database a Cluster Administrator Extension
00294 //      DLL that extends all network interfaces.
00295 //
00296 //  Arguments:
00297 //      hClusterIn      Handle to the cluster to modify.
00298 //      pClsidIn        Extension's CLSID.
00299 //
00300 //  Return Value:
00301 //      ERROR_SUCCESS   Extension registered successfully.
00302 //      Win32 error code if another failure occurred.
00303 //
00304 //--
00305 /////////////////////////////////////////////////////////////////////////////
00306 DWORD
00307 RegisterCluAdminAllNetInterfacesExtension(
00308       HCLUSTER      hClusterIn
00309     , const CLSID * pClsidIn
00310     )
00311 {
00312     DWORD   sc = ERROR_SUCCESS;
00313
00314     sc = RegisterAnyCluAdminExtension( hClusterIn, L"NetworkInterfaces", pClsidIn );
00315
00316     return sc;
00317
00318 }  //*** RegisterCluAdminAllNetInterfacesExtension
00319
00320 /////////////////////////////////////////////////////////////////////////////
00321 //++
00322 //
00323 //  RegisterCluAdminResourceTypeExtension
00324 //
00325 //  Routine Description:
00326 //      Register with the cluster database a Cluster Administrator Extension
00327 //      DLL that extends resources of a specific type, or the resource type
00328 //      itself.
00329 //
00330 //  Arguments:
00331 //      hClusterIn        Handle to the cluster to modify.
00332 //      pwszResourceType  Resource type name.
00333 //      pClsidIn          Extension's CLSID.
00334 //
00335 //  Return Value:
00336 //      ERROR_SUCCESS
00337 //                          Extension registered successfully.
00338 //
00339 //      ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND
00340 //                          The resource type has not been registered with
00341 //                          the cluster.
00342 //
00343 //      Other Win32 error code if a failure occurred.
00344 //
00345 //--
00346 /////////////////////////////////////////////////////////////////////////////
00347 DWORD
00348 RegisterCluAdminResourceTypeExtension(
00349       HCLUSTER      hClusterIn
00350     , LPCWSTR       pwszResourceTypeIn
00351     , const CLSID * pClsidIn
00352     )
00353 {
00354     DWORD   sc = ERROR_SUCCESS;
00355     HKEY    hKey = NULL;
00356
00357     //
00358     // Get the resource type registry key.
00359     //
00360
00361     hKey = GetClusterResourceTypeKey( hClusterIn, pwszResourceTypeIn, KEY_ALL_ACCESS );
00362     if ( hKey == NULL )
00363     {
00364         sc = GetLastError();
00365         if ( sc == ERROR_FILE_NOT_FOUND )
00366         {
00367             //
00368             //  If we failed to open the key with 'file not found' that means that
00369             //  the key doesn't exist.  We'll return a 'res type not found' error,
00370             //  which is more accurate.
00371             //
00372
00373             sc = ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND;
00374         } // if:
00375     } // if: error getting resource type key
00376     else
00377     {
00378         //
00379         //  Register the extension.
00380         //
00381
00382         sc = RegisterAnyCluAdminExtension( hKey, pClsidIn );
00383
00384         ClusterRegCloseKey( hKey );
00385     }  // else:  GetClusterResourceTypeKey succeeded
00386
00387     return sc;
00388
00389 }  //*** RegisterCluAdminResourceTypeExtension
00390
00391 /////////////////////////////////////////////////////////////////////////////
00392 //++
00393 //
00394 //  UnregisterCluAdminClusterExtension
00395 //
00396 //  Routine Description:
00397 //      Unregister with the cluster database a Cluster Administrator Extension
00398 //      DLL that extends the cluster object.
00399 //
00400 //  Arguments:
00401 //      hClusterIn      Handle to the cluster to modify.
00402 //      pClsidIn        Extension's CLSID.
00403 //
00404 //  Return Value:
00405 //      ERROR_SUCCESS   Extension registered successfully.
00406 //      Win32 error code if another failure occurred.
00407 //
00408 //--
00409 /////////////////////////////////////////////////////////////////////////////
00410 DWORD
00411 UnregisterCluAdminClusterExtension(
00412       HCLUSTER      hClusterIn
00413     , const CLSID * pClsidIn
00414     )
00415 {
00416     DWORD   sc = ERROR_SUCCESS;
00417     HKEY    hKey = NULL;
00418
00419     //
00420     //  Get the cluster registry key.
00421     //
00422
00423     hKey = GetClusterKey(hClusterIn, KEY_ALL_ACCESS);
00424     if ( hKey == NULL )
00425     {
00426         sc = GetLastError();
00427     } // if: error getting cluster key
00428     else
00429     {
00430         //
00431         //  Unregister the extension.
00432         //
00433
00434         sc = UnregisterAnyCluAdminExtension( hKey, pClsidIn );
00435
00436         ClusterRegCloseKey( hKey );
00437     }  // else:  GetClusterKey succeeded
00438
00439     return sc;
00440
00441 }  //*** UnregisterCluAdminClusterExtension
00442
00443 /////////////////////////////////////////////////////////////////////////////
00444 //++
00445 //
00446 //  UnregisterCluAdminAllNodesExtension
00447 //
00448 //  Routine Description:
00449 //      Unregister with the cluster database a Cluster Administrator Extension
00450 //      DLL that extends all nodes.
00451 //
00452 //  Arguments:
00453 //      hClusterIn      Handle to the cluster to modify.
00454 //      pClsidIn        Extension's CLSID.
00455 //
00456 //  Return Value:
00457 //      ERROR_SUCCESS   Extension registered successfully.
00458 //      Win32 error code if another failure occurred.
00459 //
00460 //--
00461 /////////////////////////////////////////////////////////////////////////////
00462 DWORD
00463 UnregisterCluAdminAllNodesExtension(
00464       HCLUSTER      hClusterIn
00465     , const CLSID * pClsidIn
00466     )
00467 {
00468     DWORD   sc = ERROR_SUCCESS;
00469
00470     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Nodes", pClsidIn );
00471
00472     return sc;
00473
00474 }  //*** UnregisterCluAdminAllNodesExtension
00475
00476 /////////////////////////////////////////////////////////////////////////////
00477 //++
00478 //
00479 //  UnregisterCluAdminAllGroupsExtension
00480 //
00481 //  Routine Description:
00482 //      Unregister with the cluster database a Cluster Administrator Extension
00483 //      DLL that extends all groups.
00484 //
00485 //  Arguments:
00486 //      hClusterIn      Handle to the cluster to modify.
00487 //      pClsidIn        Extension's CLSID.
00488 //
00489 //  Return Value:
00490 //      ERROR_SUCCESS   Extension registered successfully.
00491 //      Win32 error code if another failure occurred.
00492 //
00493 //--
00494 /////////////////////////////////////////////////////////////////////////////
00495 DWORD
00496 UnregisterCluAdminAllGroupsExtension(
00497       HCLUSTER      hClusterIn
00498     , const CLSID * pClsidIn
00499     )
00500 {
00501     DWORD   sc = ERROR_SUCCESS;
00502
00503     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Groups", pClsidIn );
00504
00505     return sc;
00506
00507 }  //*** UnregisterCluAdminAllGroupsExtension
00508
00509 /////////////////////////////////////////////////////////////////////////////
00510 //++
00511 //
00512 //  UnregisterCluAdminAllResourcesExtension
00513 //
00514 //  Routine Description:
00515 //      Unregister with the cluster database a Cluster Administrator Extension
00516 //      DLL that extends all resources.
00517 //
00518 //  Arguments:
00519 //      hClusterIn      Handle to the cluster to modify.
00520 //      pClsidIn        Extension's CLSID.
00521 //
00522 //  Return Value:
00523 //      ERROR_SUCCESS   Extension registered successfully.
00524 //      Win32 error code if another failure occurred.
00525 //
00526 //--
00527 /////////////////////////////////////////////////////////////////////////////
00528 DWORD
00529 UnregisterCluAdminAllResourcesExtension(
00530       HCLUSTER      hClusterIn
00531     , const CLSID * pClsidIn
00532     )
00533 {
00534     DWORD   sc = ERROR_SUCCESS;
00535
00536     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Resources", pClsidIn );
00537
00538     return sc;
00539
00540 }  //*** UnregisterCluAdminAllResourcesExtension
00541
00542 /////////////////////////////////////////////////////////////////////////////
00543 //++
00544 //
00545 //  UnregisterCluAdminAllResourceTypesExtension
00546 //
00547 //  Routine Description:
00548 //      Unregister with the cluster database a Cluster Administrator Extension
00549 //      DLL that extends all resource types.
00550 //
00551 //  Arguments:
00552 //      hClusterIn      Handle to the cluster to modify.
00553 //      pClsidIn        Extension's CLSID.
00554 //
00555 //  Return Value:
00556 //      ERROR_SUCCESS   Extension registered successfully.
00557 //      Win32 error code if another failure occurred.
00558 //
00559 //--
00560 /////////////////////////////////////////////////////////////////////////////
00561 DWORD
00562 UnregisterCluAdminAllResourceTypesExtension(
00563       HCLUSTER      hClusterIn
00564     , const CLSID * pClsidIn
00565     )
00566 {
00567     DWORD   sc = ERROR_SUCCESS;
00568
00569     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"ResourceTypes", pClsidIn );
00570
00571     return sc;
00572
00573 }  //*** UnregisterCluAdminAllResourceTypesExtension
00574
00575 /////////////////////////////////////////////////////////////////////////////
00576 //++
00577 //
00578 //  UnregisterCluAdminAllNetworksExtension
00579 //
00580 //  Routine Description:
00581 //      Unregister with the cluster database a Cluster Administrator Extension
00582 //      DLL that extends all networks.
00583 //
00584 //  Arguments:
00585 //      hClusterIn      Handle to the cluster to modify.
00586 //      pClsidIn        Extension's CLSID.
00587 //
00588 //  Return Value:
00589 //      ERROR_SUCCESS   Extension registered successfully.
00590 //      Win32 error code if another failure occurred.
00591 //
00592 //--
00593 /////////////////////////////////////////////////////////////////////////////
00594 DWORD
00595 UnregisterCluAdminAllNetworksExtension(
00596       HCLUSTER      hClusterIn
00597     , const CLSID * pClsidIn
00598     )
00599 {
00600     DWORD   sc = ERROR_SUCCESS;
00601
00602     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Networks", pClsidIn );
00603
00604     return sc;
00605
00606 }  //*** UnregisterCluAdminAllNetworksExtension
00607
00608 /////////////////////////////////////////////////////////////////////////////
00609 //++
00610 //
00611 //  UnregisterCluAdminAllNetInterfacesExtension
00612 //
00613 //  Routine Description:
00614 //      Unregister with the cluster database a Cluster Administrator Extension
00615 //      DLL that extends all network interfaces.
00616 //
00617 //  Arguments:
00618 //      hClusterIn      Handle to the cluster to modify.
00619 //      pClsidIn        Extension's CLSID.
00620 //
00621 //  Return Value:
00622 //      ERROR_SUCCESS   Extension registered successfully.
00623 //      Win32 error code if another failure occurred.
00624 //
00625 //--
00626 /////////////////////////////////////////////////////////////////////////////
00627 DWORD
00628 UnregisterCluAdminAllNetInterfacesExtension(
00629       HCLUSTER      hClusterIn
00630     , const CLSID * pClsidIn
00631     )
00632 {
00633     DWORD   sc = ERROR_SUCCESS;
00634
00635     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"NetworkInterfaces", pClsidIn );
00636
00637     return sc;
00638
00639 }  //*** UnregisterCluAdminAllNetInterfacesExtension
00640
00641 /////////////////////////////////////////////////////////////////////////////
00642 //++
00643 //
00644 //  UnregisterCluAdminResourceTypeExtension
00645 //
00646 //  Routine Description:
00647 //      Unregister with the cluster database a Cluster Administrator Extension
00648 //      DLL that extends resources of a specific type, or the resource type
00649 //      itself.
00650 //
00651 //  Arguments:
00652 //      hClusterIn          Handle to the cluster to modify.
00653 //      pwszResourceTypeIn  Resource type name.
00654 //      pClsidIn            Extension's CLSID.
00655 //
00656 //  Return Value:
00657 //      ERROR_SUCCESS   Extension registered successfully.
00658 //      Win32 error code if another failure occurred.
00659 //
00660 //--
00661 /////////////////////////////////////////////////////////////////////////////
00662 DWORD
00663 UnregisterCluAdminResourceTypeExtension(
00664       HCLUSTER      hClusterIn
00665     , LPCWSTR       pwszResourceTypeIn
00666     , const CLSID * pClsidIn
00667     )
00668 {
00669     DWORD   sc = ERROR_SUCCESS;
00670     HKEY    hKey = NULL;
00671
00672     //
00673     //  Get the resource type registry key.
00674     //
00675
00676     hKey = GetClusterResourceTypeKey( hClusterIn, pwszResourceTypeIn, KEY_ALL_ACCESS );
00677     if ( hKey == NULL )
00678     {
00679         sc = GetLastError();
00680         if ( sc == ERROR_FILE_NOT_FOUND )
00681         {
00682             //
00683             //  If we failed to open the key with 'file not found' that means that
00684             //  the key doesn't exist.  We'll return a 'res type not found' error,
00685             //  which is more accurate.
00686             //
00687
00688             sc = ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND;
00689         } // if:
00690     } // if: error getting resource type key
00691     else
00692     {
00693         //
00694         //  Unregister the extension.
00695         //
00696
00697         sc = UnregisterAnyCluAdminExtension( hKey, pClsidIn );
00698
00699         ClusterRegCloseKey( hKey );
00700     }  // else:  GetClusterResourceTypeKey succeeded
00701
00702     return sc;
00703
00704 }  //*** UnregisterCluAdminResourceTypeExtension
00705
00706 /////////////////////////////////////////////////////////////////////////////
00707 //++
00708 //
00709 //  RegisterAnyCluAdminExtension
00710 //
00711 //  Routine Description:
00712 //      Register any Cluster Administrator Extension DLL with the cluster
00713 //      database.
00714 //
00715 //  Arguments:
00716 //      hClusterIn      Handle to the cluster to modify.
00717 //      pwszKeyNameIn   Key name.
00718 //      pClsidIn        Extension's CLSID.
00719 //
00720 //  Return Value:
00721 //      ERROR_SUCCESS   Extension registered successfully.
00722 //      Win32 error code if another failure occurred.
00723 //
00724 //--
00725 /////////////////////////////////////////////////////////////////////////////
00726 static DWORD
00727 RegisterAnyCluAdminExtension(
00728       HCLUSTER      hClusterIn
00729     , LPCWSTR       pwszKeyNameIn
00730     , const CLSID * pClsidIn
00731     )
00732 {
00733     DWORD   sc = ERROR_SUCCESS;
00734     HKEY    hkeyCluster = NULL;
00735     HKEY    hKey = NULL;
00736
00737     //
00738     //  Get the cluster key.
00739     //
00740
00741     hkeyCluster = GetClusterKey( hClusterIn, KEY_ALL_ACCESS );
00742     if ( hkeyCluster == NULL )
00743     {
00744         sc = GetLastError();
00745     } // if: error getting cluster key
00746     else
00747     {
00748         //
00749         //  Get the specified key.
00750         //
00751
00752         sc = ClusterRegOpenKey( hkeyCluster, pwszKeyNameIn, KEY_ALL_ACCESS, &hKey );
00753         if ( sc == ERROR_SUCCESS )
00754         {
00755             //
00756             //  Register the extension.
00757             //
00758
00759             sc = RegisterAnyCluAdminExtension( hKey, pClsidIn );
00760
00761             ClusterRegCloseKey( hKey );
00762         }  // if: ClusterRegOpenKey succeeded
00763
00764         ClusterRegCloseKey( hkeyCluster );
00765     }  // if:  cluster key retrieved successfully
00766
00767     return sc;
00768
00769 }  //*** RegisterAnyCluAdminExtension
00770
00771 /////////////////////////////////////////////////////////////////////////////
00772 //++
00773 //
00774 //  RegisterAnyCluAdminExtension
00775 //
00776 //  Routine Description:
00777 //      Register any Cluster Administrator Extension DLL with the cluster
00778 //      database.
00779 //
00780 //  Arguments:
00781 //      hKeyIn          Cluster database key.
00782 //      pClsidIn        Extension's CLSID.
00783 //
00784 //  Return Value:
00785 //      ERROR_SUCCESS   Extension registered successfully.
00786 //      Win32 error code if another failure occurred.
00787 //
00788 //--
00789 /////////////////////////////////////////////////////////////////////////////
00790 static DWORD
00791 RegisterAnyCluAdminExtension(
00792       HKEY          hKeyIn
00793     , const CLSID * pClsidIn
00794     )
00795 {
00796     HRESULT     hr = S_OK;
00797     LPOLESTR    pwszClsid = NULL;
00798     size_t      cchClsidLen = 0;
00799     size_t      cchSize = 0;
00800     size_t      cchNewSize = 0;
00801     LPWSTR      pwszValue = NULL;
00802     LPWSTR      pwszNewValue = NULL;
00803     BOOL        bAlreadyRegistered = TRUE;
00804     DWORD       sc = ERROR_SUCCESS;
00805
00806     //
00807     //  Convert the CLSID to a string.
00808     //
00809
00810     hr = StringFromCLSID( *pClsidIn, &pwszClsid );
00811     if ( FAILED( hr ) )
00812     {
00813         sc = HRESULT_CODE( hr );
00814         goto Cleanup;
00815     } // if:
00816
00817     //
00818     //  Get the length of the CLSID string.
00819     //
00820
00821     cchClsidLen = lstrlenW( pwszClsid );
00822
00823     //
00824     //  Read the current value.
00825     //
00826
00827     sc = ReadValue( hKeyIn, REG_VALUE_ADMIN_EXTENSIONS, &pwszValue, &cchSize );
00828     if ( (sc == ERROR_FILE_NOT_FOUND) || ( (sc == ERROR_SUCCESS) && (cchSize == 0) ) )
00829     {
00830         //
00831         //  If the value was not found or it was and the length was zero then
00832         //  the extension has not been registered.
00833         //
00834
00835         bAlreadyRegistered = FALSE;
00836     } // if:
00837     else if ( sc == ERROR_SUCCESS )
00838     {
00839         //
00840         //  Check to see if the extension has been registered yet.
00841         //
00842
00843         if ( pwszValue == NULL )
00844         {
00845         } // if: empty value found
00846         else
00847         {
00848             LPCWSTR pwszValueBuf = pwszValue;
00849             size_t  cchValueBuf = cchSize;
00850             size_t  cch = 0;
00851
00852             while ( *pwszValueBuf != L'\0' )
00853             {
00854                 if ( NIStringCompareW( pwszClsid, pwszValueBuf, cchClsidLen ) == 0)
00855                 {
00856                     break;
00857                 } //if: CLSID for this extension already in list
00858
00859                 cch = lstrlenW( pwszValueBuf ) + 1;
00860                 pwszValueBuf += cch;
00861                 cchValueBuf -= cch;
00862             }  // while:  more strings in the extension list
00863
00864             bAlreadyRegistered = ( *pwszValueBuf != L'\0' );
00865         }  // else:  extension value exists
00866     } // else if:
00867     else
00868     {
00869         goto Cleanup;
00870     } // else:
00871
00872     //
00873     //  Register the extension.
00874     //
00875
00876     if ( bAlreadyRegistered == FALSE )
00877     {
00878         //
00879         //  Allocate a new buffer.
00880         //
00881
00882         cchNewSize = cchSize + lstrlenW( pwszClsid ) + 1;
00883         if ( cchSize == 0 ) // Add size of final NULL if first entry.
00884         {
00885             cchNewSize++;
00886         } // if: no previous value
00887
00888         pwszNewValue = new WCHAR[ cchNewSize ];
00889         if ( pwszNewValue == NULL )
00890         {
00891             sc = ERROR_NOT_ENOUGH_MEMORY;
00892             goto Cleanup;
00893         } // if: error allocating memory
00894         else
00895         {
00896             LPCWSTR pwszValueBuf    = pwszValue;
00897             LPWSTR  pwszNewValueBuf = pwszNewValue;
00898             size_t  cchNewValueBuf  = cchNewSize;
00899             size_t  cch = 0;
00900             DWORD   dwType = 0;
00901
00902             //
00903             //  Copy the existing extensions to the new buffer.
00904             //
00905
00906             if ( pwszValue != NULL )
00907             {
00908                 while ( *pwszValueBuf != L'\0' )
00909                 {
00910                     hr = StringCchCopyW( pwszNewValueBuf, cchNewValueBuf, pwszValueBuf );
00911                     if ( FAILED( hr ) )
00912                     {
00913                         sc = HRESULT_CODE( hr );
00914                         goto Cleanup;
00915                     } // if:
00916
00917                     cch = lstrlenW( pwszValueBuf ) + 1;
00918                     pwszValueBuf += cch;
00919                     pwszNewValueBuf += cch;
00920                     cchNewValueBuf -= cch;
00921                 }  // while:  more strings in the extension list
00922             }  // if:  previous value buffer existed
00923
00924             //
00925             //  Add the new CLSID to the list.
00926             //
00927
00928             hr = StringCchCopyW( pwszNewValueBuf, cchNewValueBuf, pwszClsid );
00929             if ( FAILED( hr ) )
00930             {
00931                 sc = HRESULT_CODE( hr );
00932                 goto Cleanup;
00933             } // if:
00934
00935             //
00936             //  Add the double NULL termination.
00937             //
00938
00939             pwszNewValueBuf += lstrlenW( pwszClsid ) + 1;
00940             *pwszNewValueBuf = L'\0';
00941
00942             //
00943             //  Write the value to the cluster database.
00944             //
00945
00946             dwType = REG_MULTI_SZ;
00947             sc = ClusterRegSetValue(
00948                               hKeyIn
00949                             , REG_VALUE_ADMIN_EXTENSIONS
00950                             , dwType
00951                             , (LPBYTE) pwszNewValue
00952                             , static_cast< DWORD >( cchNewSize * sizeof( *pwszNewValue ) )
00953                             );
00954             if ( sc != ERROR_SUCCESS )
00955             {
00956                 goto Cleanup;
00957             }
00958         }  // else:  new buffer allocated successfully
00959     }  // if:  extension not registered yet
00960
00961 Cleanup:
00962
00963     delete [] pwszNewValue;
00964     delete [] pwszValue;
00965
00966     CoTaskMemFree( pwszClsid );
00967
00968     return sc;
00969
00970 }  //*** RegisterAnyCluAdminExtension
00971
00972 /////////////////////////////////////////////////////////////////////////////
00973 //++
00974 //
00975 //  UnregisterAnyCluAdminExtension
00976 //
00977 //  Routine Description:
00978 //      Unregister any Cluster Administrator Extension DLL with the cluster
00979 //      database.
00980 //
00981 //  Arguments:
00982 //      hClusterIn      Handle to the cluster to modify.
00983 //      pwszKeyNameIn   Key name.
00984 //      pClsidIn        Extension's CLSID.
00985 //
00986 //  Return Value:
00987 //      ERROR_SUCCESS   Extension registered successfully.
00988 //      Win32 error code if another failure occurred.
00989 //
00990 //--
00991 /////////////////////////////////////////////////////////////////////////////
00992 static DWORD
00993 UnregisterAnyCluAdminExtension(
00994       HCLUSTER      hClusterIn
00995     , LPCWSTR       pwszKeyNameIn
00996     , const CLSID * pClsidIn
00997     )
00998 {
00999     DWORD   sc = ERROR_SUCCESS;
01000     HKEY    hKeyCluster = NULL;
01001     HKEY    hKey = NULL;
01002
01003     //
01004     //  Get the cluster key.
01005     //
01006
01007     hKeyCluster = GetClusterKey( hClusterIn, KEY_ALL_ACCESS );
01008     if ( hKeyCluster == NULL )
01009     {
01010         sc = GetLastError();
01011     } // if: error getting cluster key
01012     else
01013     {
01014         // Get the specified key.
01015         sc = ClusterRegOpenKey( hKeyCluster, pwszKeyNameIn, KEY_ALL_ACCESS, &hKey );
01016         if (sc == ERROR_SUCCESS)
01017         {
01018             // Unregister the extension.
01019             sc = UnregisterAnyCluAdminExtension( hKey, pClsidIn );
01020
01021             ClusterRegCloseKey( hKey );
01022         }  // else:  GetClusterResourceTypeKey succeeded
01023
01024         ClusterRegCloseKey( hKeyCluster );
01025     }  // if: cluster key retrieved successfully
01026
01027     return sc;
01028
01029 }  //*** UnregisterAnyCluAdminExtension
01030
01031 /////////////////////////////////////////////////////////////////////////////
01032 //++
01033 //
01034 //  UnregisterAnyCluAdminExtension
01035 //
01036 //  Routine Description:
01037 //      Unregister any Cluster Administrator Extension DLL with the cluster
01038 //      database.
01039 //
01040 //  Arguments:
01041 //      hKeyIn          Cluster database key.
01042 //      pClsidIn        Extension's CLSID.
01043 //
01044 //  Return Value:
01045 //      ERROR_SUCCESS   Extension registered successfully.
01046 //      Win32 error code if another failure occurred.
01047 //
01048 //--
01049 /////////////////////////////////////////////////////////////////////////////
01050 static DWORD
01051 UnregisterAnyCluAdminExtension(
01052       HKEY          hKeyIn
01053     , const CLSID * pClsidIn
01054     )
01055 {
01056     HRESULT     hr = S_OK;
01057     LPOLESTR    pwszClsid = NULL;
01058     size_t      cchClsidLen = 0;
01059     size_t      cchSize = 0;
01060     size_t      cchNewSize = 0;
01061     LPWSTR      pwszValue = NULL;
01062     LPWSTR      pwszNewValue = NULL;
01063     BOOL        bAlreadyUnregistered = FALSE;
01064     DWORD       sc = ERROR_SUCCESS;
01065
01066     //
01067     //  Convert the CLSID to a string.
01068     //
01069
01070     hr = StringFromCLSID( *pClsidIn, &pwszClsid );
01071     if ( FAILED( hr ) )
01072     {
01073         sc = HRESULT_CODE( hr );
01074         goto Cleanup;
01075     } // if:
01076
01077     //
01078     //  Get the length of the CLSID string.
01079     //
01080
01081     cchClsidLen = lstrlenW( pwszClsid );
01082
01083     //
01084     //  Read the current value.
01085     //
01086
01087     sc = ReadValue( hKeyIn, REG_VALUE_ADMIN_EXTENSIONS, &pwszValue, &cchSize );
01088     if ( (sc == ERROR_FILE_NOT_FOUND) || ( (sc == ERROR_SUCCESS) && (cchSize == 0) ) )
01089     {
01090         //
01091         //  If the value was not found or it was and the length was zero then
01092         //  the extension has been unregistered.
01093         //
01094
01095         bAlreadyUnregistered = TRUE;
01096     } // if:
01097     else if ( sc == ERROR_SUCCESS )
01098     {
01099         LPCWSTR pwszValueBuf = pwszValue;
01100         size_t  cch = 0;
01101         size_t  cchValueBuf = cchSize;
01102
01103         while ( *pwszValueBuf != L'\0' )
01104         {
01105             if ( NIStringCompareW( pwszClsid, pwszValueBuf, cchClsidLen ) == 0 )
01106             {
01107                 break;
01108             } // if: CLSID for this extension found in the list
01109
01110             cch = lstrlenW( pwszValueBuf ) + 1;
01111             pwszValueBuf += cch;
01112             cchValueBuf -= cch;
01113         }  // while:  more strings in the extension list
01114
01115         bAlreadyUnregistered = (*pwszValueBuf == L'\0');
01116     } // else if:
01117     else
01118     {
01119         goto Cleanup;
01120     } // else:
01121
01122     //
01123     //  Unregister the extension.
01124     //
01125
01126     if ( bAlreadyUnregistered == FALSE )
01127     {
01128         //
01129         //  Allocate a new buffer.
01130         //
01131
01132         cchNewSize = cchSize - lstrlenW(pwszClsid) - 1;
01133         if (cchNewSize == 1) // only the final null left
01134         {
01135             cchNewSize = 0;
01136         } // if:
01137
01138         pwszNewValue = new WCHAR[ cchNewSize ];
01139         if ( pwszNewValue == NULL )
01140         {
01141             sc = ERROR_OUTOFMEMORY;
01142             goto Cleanup;
01143         } // if: error allocating memory
01144         else
01145         {
01146             LPCWSTR pwszValueBuf = pwszValue;
01147             LPWSTR  pwszNewValueBuf = pwszNewValue;
01148             size_t  cchValueBuf = cchSize;
01149             size_t  cchNewValueBuf = cchNewSize;
01150             size_t  cch = 0;
01151             DWORD   dwType = 0;
01152
01153             //
01154             //  Copy the existing extensions to the new buffer.
01155             //
01156
01157             if ( ( cchNewSize > 0 ) && ( pwszValue != NULL ) )
01158             {
01159                 while ( *pwszValueBuf != L'\0' )
01160                 {
01161                     if ( NIStringCompareW( pwszClsid, pwszValueBuf, cchClsidLen ) != 0 )
01162                     {
01163                         hr = StringCchCopyNW( pwszNewValueBuf, cchNewValueBuf, pwszValueBuf, cchValueBuf );
01164                         if ( FAILED( hr ) )
01165                         {
01166                             sc = HRESULT_CODE( hr );
01167                             goto Cleanup;
01168                         } // if:
01169
01170                         cch = lstrlenW( pwszNewValueBuf ) + 1;
01171                         pwszNewValueBuf += cch;
01172                         cchNewValueBuf -= cch;
01173                     }  // if:  not CLSID being removed
01174
01175                     cch = lstrlenW( pwszValueBuf ) + 1;
01176                     pwszValueBuf += cch;
01177                     cchValueBuf -= cch;
01178                 }  // while:  more strings in the extension list
01179
01180                 *pwszNewValueBuf = L'\0';
01181             }  // if:  previous value buffer existed
01182
01183             //
01184             //  Write the value to the cluster database.
01185             //
01186
01187             dwType = REG_MULTI_SZ;
01188             sc = ClusterRegSetValue(
01189                               hKeyIn
01190                             , REG_VALUE_ADMIN_EXTENSIONS
01191                             , dwType
01192                             , (LPBYTE) pwszNewValue
01193                             , static_cast< DWORD >( cchNewSize * sizeof( *pwszNewValue ) )
01194                             );
01195             if ( sc != ERROR_SUCCESS )
01196             {
01197                 goto Cleanup;
01198             } // if:
01199         }  // else:  new buffer allocated successfully
01200     }  // if:  extension not unregistered yet
01201
01202 Cleanup:
01203
01204     delete [] pwszNewValue;
01205     delete [] pwszValue;
01206
01207     CoTaskMemFree( pwszClsid );
01208
01209     return sc;
01210
01211 }  //*** UnregisterAnyCluAdminExtension
01212
01213 /////////////////////////////////////////////////////////////////////////////
01214 //++
01215 //
01216 //  ReadValue
01217 //
01218 //  Routine Description:
01219 //      Reads a value from the cluster database.
01220 //
01221 //  Arguments:
01222 //      hKeyIn          Handle for the key to read from.
01223 //      pwszValueNameIn Name of value to read.
01224 //      ppwszValueOut   Address of pointer in which to return data.
01225 //                      The string is allocated using new [] and must
01226 //                      be deallocated by the calling delete [].
01227 //      pcchValueOut    Size in characters of the allocated value buffer.
01228 //
01229 //  Return Value:
01230 //      Any return values from ClusterRegQueryValue or errors from new.
01231 //
01232 //--
01233 /////////////////////////////////////////////////////////////////////////////
01234 static DWORD
01235 ReadValue(
01236       HKEY      hKeyIn
01237     , LPCWSTR   pwszValueNameIn
01238     , LPWSTR *  ppwszValueOut
01239     , size_t *  pcchValueOut
01240     )
01241 {
01242     DWORD   sc = ERROR_SUCCESS;
01243     DWORD   cbSize = 0;
01244     DWORD   cchSize = 0;
01245     DWORD   dwType = 0;
01246     LPWSTR  pwszValue = NULL;
01247
01248     //
01249     //  Initialize the out parameters...
01250     //
01251
01252     *ppwszValueOut = NULL;
01253     *pcchValueOut = 0;
01254
01255     //
01256     //  Get the length of the value.
01257     //
01258
01259     sc = ClusterRegQueryValue( hKeyIn, pwszValueNameIn, &dwType, NULL, &cbSize );
01260     if (   ( sc != ERROR_SUCCESS )
01261         && ( sc != ERROR_MORE_DATA ) )
01262     {
01263         goto Cleanup;
01264     }  // if:  error occurred
01265
01266     ASSERT( (cbSize % sizeof( WCHAR ) ) == 0 ); // must be even
01267     cchSize = cbSize / sizeof( WCHAR );
01268
01269     if ( cbSize > 0 )
01270     {
01271         //
01272         //  Allocate a value string.
01273         //
01274
01275         pwszValue = new WCHAR[ cchSize ];
01276         if ( pwszValue == NULL )
01277         {
01278             sc =  ERROR_NOT_ENOUGH_MEMORY;
01279             goto Cleanup;
01280         }  // if:  error allocating memory
01281
01282         //
01283         //  Read the the value.
01284         //
01285
01286         sc = ClusterRegQueryValue( hKeyIn, pwszValueNameIn, &dwType, (LPBYTE) pwszValue, &cbSize );
01287         if ( sc != ERROR_SUCCESS )
01288         {
01289             goto Cleanup;
01290         } // if:
01291
01292          ASSERT( cchSize * sizeof( WCHAR ) == cbSize );
01293
01294         *ppwszValueOut = pwszValue;
01295         pwszValue = NULL;                                   // give away ownership...
01296         *pcchValueOut = static_cast< size_t >( cchSize );
01297     }  // if:  value is not empty
01298
01299 Cleanup:
01300
01301     delete [] pwszValue;
01302
01303     return sc;
01304
01305 }  //*** ReadValue
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLangBarItemButton Member List

This is the complete list of members for CLangBarItemButton, including all inherited members.
_cRef | CLangBarItemButton | [private]
_pCase | CLangBarItemButton | [private]
_pLangBarItemSink | CLangBarItemButton | [private]
_pMark | CLangBarItemButton | [private]
_tfLangBarItemInfo | CLangBarItemButton | [private]
AdviseSink(REFIID riid, IUnknown *punk, DWORD *pdwCookie) | CLangBarItemButton |
AdviseSink(REFIID riid, IUnknown *punk, DWORD *pdwCookie) | CLangBarItemButton |
CLangBarItemButton(CCaseTextService *pCase) | CLangBarItemButton |
CLangBarItemButton(CMarkTextService *pMark) | CLangBarItemButton |
GetIcon(HICON *phIcon) | CLangBarItemButton |
GetIcon(HICON *phIcon) | CLangBarItemButton |
GetInfo(TF_LANGBARITEMINFO *pInfo) | CLangBarItemButton |
GetInfo(TF_LANGBARITEMINFO *pInfo) | CLangBarItemButton |
GetStatus(DWORD *pdwStatus) | CLangBarItemButton |
GetStatus(DWORD *pdwStatus) | CLangBarItemButton |
GetText(BSTR *pbstrText) | CLangBarItemButton |
GetText(BSTR *pbstrText) | CLangBarItemButton |
GetTooltipString(BSTR *pbstrToolTip) | CLangBarItemButton |
GetTooltipString(BSTR *pbstrToolTip) | CLangBarItemButton |
InitMenu(ITfMenu *pMenu) | CLangBarItemButton |
InitMenu(ITfMenu *pMenu) | CLangBarItemButton |
OnClick(TfLBIClick click, POINT pt, const RECT *prcArea) | CLangBarItemButton |
OnClick(TfLBIClick click, POINT pt, const RECT *prcArea) | CLangBarItemButton |
OnMenuSelect(UINT wID) | CLangBarItemButton |
OnMenuSelect(UINT wID) | CLangBarItemButton |
QueryInterface(REFIID riid, void **ppvObj) | CLangBarItemButton |
QueryInterface(REFIID riid, void **ppvObj) | CLangBarItemButton |
Show(BOOL fShow) | CLangBarItemButton |
Show(BOOL fShow) | CLangBarItemButton |
STDMETHODIMP_(ULONG) AddRef(void) | CLangBarItemButton |
STDMETHODIMP_(ULONG) Release(void) | CLangBarItemButton |
STDMETHODIMP_(ULONG) AddRef(void) | CLangBarItemButton |
STDMETHODIMP_(ULONG) Release(void) | CLangBarItemButton |
UnadviseSink(DWORD dwCookie) | CLangBarItemButton |
UnadviseSink(DWORD dwCookie) | CLangBarItemButton |
~CLangBarItemButton() | CLangBarItemButton |
~CLangBarItemButton() | CLangBarItemButton |
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/devicenode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

devicenode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CDeviceNode class.  This node is a child of
00014 //                CStaticNode.  It represents a Virtual Storage device
00015 //
00016 //
00017
00018
00019 #ifndef _CLASS_CDEVICENODE_
00020 #define _CLASS_CDEVICENODE_
00021
00022 #include "Globals.h"
00023 #include "FolderNode.h"      // Folders are children of this node
00024 #include "LListImpl.h"
00025
00026
00027 class CComponentData;        // References
00028
00029 //---------------------------------------------------------------------------
00030 class CDeviceNode : public CBaseNode
00031 {
00032   public:
00033     CDeviceNode();
00034     virtual ~CDeviceNode();
00035
00036     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00037     VOID    ToggleStatus();
00038
00039   // Virtual methods
00040   public:
00041     ULONG   GetNodeType() { return NODETYPE_DEVICE; }
00042     GUID&   GetNodeGUID() { return thisGUID; }
00043     HRESULT GetProperty( BSTR bstrPropertyName, PBSTR pbstrProperty ) { return E_NOTIMPL; }
00044
00045     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00046     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00047     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00048
00049   ///////////////////////////////////////////////////////////////////////////
00050   // Required Notification handlers
00051   //
00052   public:
00053     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00054     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00055     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00056     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00057     HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00058             { return E_NOTIMPL; }
00059
00060     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00061             { return E_NOTIMPL; }
00062
00063     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00064             { return E_NOTIMPL; }
00065
00066   ///////////////////////////////////////////////////////////////////////////
00067   //  Context Menu methods
00068   //
00069   public:
00070     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00071     HRESULT Command( long lCommandID );
00072
00073   ///////////////////////////////////////////////////////////////////////////
00074   // Private helpers
00075   private:
00076     HRESULT  DeleteChildItems( LPCONSOLENAMESPACE2 ipCNS );
00077     HRESULT  InsertChildItems( LPCONSOLENAMESPACE2 ipCNS );
00078     HRESULT  RefreshNodeList();
00079     VOID     RemoveChildNodes();
00080
00081   private:
00082     static GUID  thisGUID;
00083     DWORD        m_dwAttributes;
00084     HSCOPEITEM   m_hParentNode;
00085     LPWSTR       m_wzStatus;
00086     BOOL         m_bOnlineStatus;
00087
00088     CLListImpl<CBaseNode*,CBaseNode*>  m_NodeList;
00089     CComponentData*                    m_pCompData;
00090
00091 };
00092
00093 #endif //_CLASS_CDEVICENODE_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NODE_PROPERTIES Member List

This is the complete list of members for NODE_PROPERTIES, including all inherited members.
dwAttributes | NODE_PROPERTIES
nBlockSize | NODE_PROPERTIES
nChildCount | NODE_PROPERTIES
pChildProps | NODE_PROPERTIES
pComponentData | NODE_PROPERTIES
pParentObject | NODE_PROPERTIES
szNodeName | NODE_PROPERTIES
Generated on Wed Nov 13 2024 16:57:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminServiceStatusOptions.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminServiceStatusOptions.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminServiceStatusOptions
00019
00020 public interface COMAdminServiceStatusOptions
00021 {
00022   public static final int COMAdminServiceStopped = 0;
00023   public static final int COMAdminServiceStartPending = 1;
00024   public static final int COMAdminServiceStopPending = 2;
00025   public static final int COMAdminServiceRunning = 3;
00026   public static final int COMAdminServiceContinuePending = 4;
00027   public static final int COMAdminServicePausePending = 5;
00028   public static final int COMAdminServicePaused = 6;
00029   public static final int COMAdminServiceUnknownState = 7;
00030 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/comp.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

comp.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #ifndef _CLASS_CCOMPONENT_
00016 #define _CLASS_CCOMPONENT_
00017
00018 #include "Globals.h"
00019
00020
00021 class CComponentData;                  // References
00022
00023
00024 //---------------------------------------------------------------------------
00025 class CComponent : public IComponent2,
00026                           IExtendControlbar  // TOOLBAR: Support for Toolbar
00027 {
00028   // Construction/Destruction
00029   public:
00030     CComponent( CComponentData* pParent );
00031     ~CComponent();
00032
00033
00034     /////////////////////////////////////////////////////////////////////////
00035     // Interface IUnknown
00036     //
00037     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00038     STDMETHODIMP_(ULONG) AddRef();
00039     STDMETHODIMP_(ULONG) Release();
00040
00041     /////////////////////////////////////////////////////////////////////////
00042     // Interface IComponent2
00043     //
00044     HRESULT STDMETHODCALLTYPE Initialize
00045             ( /*[in]*/ LPCONSOLE ipConsole );
00046
00047     HRESULT STDMETHODCALLTYPE Notify
00048             ( /*[in]*/ LPDATAOBJECT ipDataObject,
00049               /*[in]*/ MMC_NOTIFY_TYPE MmcEvent,
00050               /*[in]*/ LONG nArg,
00051               /*[in]*/ LONG nParam
00052             );
00053
00054     HRESULT STDMETHODCALLTYPE Destroy
00055             ( /*[in]*/ MMC_COOKIE nCookie );
00056
00057     HRESULT STDMETHODCALLTYPE QueryDataObject
00058             ( /*[in]*/  MMC_COOKIE nCookie,
00059               /*[in]*/  DATA_OBJECT_TYPES nEnumType,
00060               /*[out]*/ LPDATAOBJECT __RPC_FAR* ppDataObject
00061             );
00062
00063     HRESULT STDMETHODCALLTYPE GetResultViewType
00064             ( /*[in]*/  MMC_COOKIE nCookie,
00065               /*[out]*/ LPOLESTR __RPC_FAR* ppViewType,
00066               /*[out]*/ long __RPC_FAR* pViewOptions
00067             );
00068
00069     HRESULT STDMETHODCALLTYPE GetDisplayInfo
00070             ( /*[out][in]*/ RESULTDATAITEM __RPC_FAR* pResultDataItem );
00071
00072     HRESULT STDMETHODCALLTYPE CompareObjects
00073             ( /*[in]*/ LPDATAOBJECT lpDataObjectA,
00074               /*[in]*/ LPDATAOBJECT lpDataObjectB
00075             );
00076
00077     HRESULT STDMETHODCALLTYPE QueryDispatch
00078             ( /*[in] */  MMC_COOKIE  nCookie,
00079               /*[in] */  DATA_OBJECT_TYPES eType,
00080               /*[out]*/  LPDISPATCH* pipDispatch
00081             );
00082
00083     HRESULT STDMETHODCALLTYPE GetResultViewType2
00084             ( /*[in] */    MMC_COOKIE nCookie,
00085               /*[in,out]*/ PRESULT_VIEW_TYPE_INFO pRVTinfo
00086             );
00087
00088     HRESULT STDMETHODCALLTYPE RestoreResultView
00089             ( /*[in] */    MMC_COOKIE nCookie,
00090               /*[in,out]*/ PRESULT_VIEW_TYPE_INFO pResultViewType
00091             );
00092
00093
00094     /////////////////////////////////////////////////////////////////////////
00095     // Interface IExtendControlBar
00096     //
00097     HRESULT STDMETHODCALLTYPE SetControlbar
00098             ( /*[in]*/ LPCONTROLBAR ipControlbar
00099             );
00100
00101     HRESULT STDMETHODCALLTYPE ControlbarNotify
00102             ( /*[in]*/ MMC_NOTIFY_TYPE MmcEvent,
00103               /*[in]*/ LPARAM          nArg,
00104               /*[in]*/ LPARAM          lParam
00105             );
00106
00107
00108   // Private data
00109   private:
00110     ULONG            m_cRef;
00111     LPCONSOLE3       m_ipConsole;
00112     LPCONSOLEVERB    m_ipConsoleVerb;
00113     LPRESULTDATA     m_ipResultData;
00114     LPHEADERCTRL2    m_ipHeaderCtrl;
00115     CComponentData*  m_pComponentData;
00116     INT_PTR          m_pScopeCookie;
00117
00118     IControlbar*     m_ipControlbar;
00119     IToolbar*        m_ipStaticToolbar;
00120     IToolbar*        m_ipDeviceToolbar;
00121     IToolbar*        m_ipVFileToolbar;
00122
00123   ///////////////////////////////////////////////////////////////////////////
00124   //  Handlers for notifications which are not delegated
00125   private:
00126     HRESULT  OnAddImages( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam );
00127
00128   ///////////////////////////////////////////////////////////////////////////
00129   //  Public helpers
00130   public:
00131     HRESULT  GetInterface( DWORD dwRequestedInterface,  LONG_PTR* ppInterface );
00132     INT_PTR  GetScopeCookie() { return m_pScopeCookie; }
00133
00134     HRESULT  QueryMultiSelDataObject( MMC_COOKIE nCookie, DATA_OBJECT_TYPES nEnumType, CDataObject** ppDataObject );
00135
00136 };
00137
00138 #endif //_CLASS_CCOMPONENT_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/Cmd.Cpp Source File

  • Web
  • NetMeeting
  • NMChat

Cmd.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       CMD.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 //****************************************************************************
00019 //
00020 // VOID CmdOptions(void)
00021 //
00022 //****************************************************************************
00023
00024 VOID CmdOptions(void)
00025 {
00026 }
00027
00028
00029 //****************************************************************************
00030 //
00031 // VOID CmdClear(void)
00032 //
00033 // Clear the message window
00034 //
00035 //****************************************************************************
00036
00037 VOID CmdClear(void)
00038 {
00039   ClearText();
00040 }
00041
00042
00043 //****************************************************************************
00044 //
00045 // VOID CmdExit(void)
00046 //
00047 // Shutdown the application.
00048 //
00049 //****************************************************************************
00050
00051 VOID CmdExit(void)
00052 {
00053   DestroyWindow(ghwndMain);
00054 }
00055
00056
00057 //****************************************************************************
00058 //
00059 // VOID CmdHelp(void)
00060 //
00061 // Bring up help for the application
00062 //
00063 //****************************************************************************
00064
00065 VOID CmdHelp(void)
00066 {
00067 }
00068
00069
00070 //****************************************************************************
00071 //
00072 // VOID CmdFont(void)
00073 //
00074 // Change the font for the message window
00075 //
00076 //****************************************************************************
00077
00078 VOID CmdFont(void)
00079 {
00080 #ifdef NOTUSED
00081   CHOOSEFONT cf;
00082   LOGFONT    lf;
00083   HFONT      hfont;
00084
00085   ZeroMemory(&lf, sizeof(LOGFONT));
00086   ZeroMemory(&hfont, sizeof(HFONT));
00087
00088   lf = gPref.lf;
00089
00090   ClearStruct(&cf);           // Zero's memory
00091   cf.lStructSize = sizeof(CHOOSEFONT);
00092   cf.hwndOwner = ghwndMain;
00093   cf.lpLogFont = &lf;
00094   cf.iPointSize = 10;
00095   cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_INITTOLOGFONTSTRUCT;
00096
00097   if (ChooseFont(&cf) != TRUE)
00098   {
00099     return;
00100   }
00101
00102   hfont= CreateFontIndirect(cf.lpLogFont);
00103   if (hfont == hfontNil)
00104   {
00105     return;
00106   }
00107
00108   MaybeDeleteObject((HGDIOBJ *) &ghfontEntry);
00109   ghfontEntry = hfont;
00110   SendMessage(ghwndMsg, WM_SETFONT,
00111     (WPARAM) ghfontEntry, MAKELPARAM(TRUE, 0));
00112
00113   gPref.lf = lf;
00114 #endif
00115 }
00116
00117
00118 //****************************************************************************
00119 //
00120 // VOID CmdAbout(void)
00121 //
00122 // Display the about box
00123 //
00124 //****************************************************************************
00125
00126 VOID CmdAbout(void)
00127 {
00128   TCHAR szVersion[MAX_PATH + 1];
00129   ZeroMemory(szVersion, (MAX_PATH + 1) * sizeof(TCHAR));
00130
00131   LoadString(ghInst, IDS_VERSION, szVersion, CCHMAX(szVersion));
00132
00133   ShellAbout(ghwndMain, szVersion, NULL, LoadIcon(ghInst, MAKEINTRESOURCE(ICO_MAIN)));
00134 }
00135
00136
00137 //****************************************************************************
00138 //
00139 // Main window command table definition.
00140 //
00141 //****************************************************************************
00142
00143 static CMD _rgcmdMain[] =
00144 {
00145   {IDM_EXIT,                CmdExit},
00146
00147   {IDM_VIEW_CLEAR,          CmdClear},
00148   {IDM_VIEW_FONT,           CmdFont},
00149   {IDM_OPTIONS,             CmdOptions},
00150
00151   {IDM_HELP,                CmdHelp},
00152   {IDM_ABOUT,               CmdAbout},
00153
00154   {0, NULL}  // MUST be last entry in the table
00155 };
00156
00157
00158 //****************************************************************************
00159 //
00160 // LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
00161 //
00162 // Handle a WM_COMMAND message
00163 //
00164 //****************************************************************************
00165
00166 LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
00167 {
00168   UINT wCmd = (UINT) GET_WM_COMMAND_ID(wparam, lparam);
00169
00170   for (LPCMD lpcmd = _rgcmdMain; 0 != lpcmd->wCmd; lpcmd++)
00171   {
00172     if (wCmd == lpcmd->wCmd)
00173     {
00174       lpcmd->pfncmd();
00175       break;
00176     }
00177   }
00178
00179   return 0L;
00180 }
00181
00182
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Enumfe.Cpp Source File

  • WinUI
  • Shell
  • DragImg

Enumfe.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          EnumFE.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include <windows.h>
00023 #include <shlobj.h>
00024 #include "EnumFE.h"
00025
00026 /**************************************************************************
00027
00028    CEnumFormatEtc::CEnumFormatEtc()
00029
00030 **************************************************************************/
00031
00032 CEnumFormatEtc::CEnumFormatEtc(LPFORMATETC pFE, int nItems)
00033 {
00034 m_cRefCount = 1;
00035
00036 m_iCur = 0;
00037
00038 m_pStrFE = new FORMATETC[nItems];
00039
00040 if (m_pStrFE)
00041     {
00042     CopyMemory((LPBYTE)m_pStrFE, (LPBYTE)pFE, sizeof(FORMATETC) * nItems);
00043     m_cItems = nItems;
00044     }
00045 else
00046     {
00047     m_cItems = 0;
00048     }
00049 }
00050
00051 /**************************************************************************
00052
00053    CEnumFormatEtc::~CEnumFormatEtc()
00054
00055 **************************************************************************/
00056
00057 CEnumFormatEtc::~CEnumFormatEtc()
00058 {
00059 if(m_pStrFE)
00060    delete [] m_pStrFE;
00061 }
00062
00063 ///////////////////////////////////////////////////////////////////////////
00064 //
00065 // IUnknown Implementation
00066 //
00067
00068 /**************************************************************************
00069
00070    CEnumFormatEtc::QueryInterface()
00071
00072 **************************************************************************/
00073
00074 STDMETHODIMP CEnumFormatEtc::QueryInterface(REFIID riid, LPVOID *ppvOut)
00075 {
00076 *ppvOut = NULL;
00077
00078 //IUnknown
00079 if(IsEqualIID(riid, IID_IUnknown))
00080    {
00081    *ppvOut = this;
00082    }
00083
00084 //IEnumFORMATETC
00085 else if(IsEqualIID(riid, IID_IEnumFORMATETC))
00086    {
00087    *ppvOut = (IEnumFORMATETC*)this;
00088    }
00089
00090 if(*ppvOut)
00091    {
00092    (*(LPUNKNOWN*)ppvOut)->AddRef();
00093    return S_OK;
00094    }
00095
00096 return E_NOINTERFACE;
00097 }
00098
00099 /**************************************************************************
00100
00101    CEnumFormatEtc::AddRef()
00102
00103 **************************************************************************/
00104
00105 STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef(void)
00106 {
00107 return ++m_cRefCount;
00108 }
00109
00110 /**************************************************************************
00111
00112    CEnumFormatEtc::Release()
00113
00114 **************************************************************************/
00115
00116 STDMETHODIMP_(ULONG) CEnumFormatEtc::Release(void)
00117 {
00118 if(--m_cRefCount == 0)
00119    {
00120    delete this;
00121    return 0;
00122    }
00123
00124 return m_cRefCount;
00125 }
00126
00127 ///////////////////////////////////////////////////////////////////////////
00128 //
00129 // IEnumFORMATETC Implementation
00130 //
00131
00132 /**************************************************************************
00133
00134    CEnumFormatEtc::Next()
00135
00136 **************************************************************************/
00137
00138 STDMETHODIMP CEnumFormatEtc::Next(ULONG celt, LPFORMATETC pFE, ULONG *puFetched)
00139 {
00140 ULONG cReturn = 0L;
00141
00142 if(celt <= 0 || pFE == NULL || m_iCur >= m_cItems)
00143    return S_FALSE;
00144
00145 if(puFetched == NULL && celt != 1)
00146    return S_FALSE;
00147
00148 if(puFetched != NULL)
00149    *puFetched = 0;
00150
00151 while(m_iCur < m_cItems && celt > 0)
00152    {
00153    *pFE++ = m_pStrFE[m_iCur++];
00154    cReturn++;
00155    celt--;
00156    }
00157
00158 if(NULL != puFetched)
00159    *puFetched = (cReturn - celt);
00160
00161 return S_OK;
00162 }
00163
00164 /**************************************************************************
00165
00166    CEnumFormatEtc::Skip()
00167
00168 **************************************************************************/
00169
00170 STDMETHODIMP CEnumFormatEtc::Skip(ULONG celt)
00171 {
00172 if((m_iCur + celt) >= m_cItems)
00173    return S_FALSE;
00174
00175 m_iCur += celt;
00176
00177 return S_OK;
00178 }
00179
00180 /**************************************************************************
00181
00182    CEnumFormatEtc::Reset()
00183
00184 **************************************************************************/
00185
00186 STDMETHODIMP CEnumFormatEtc::Reset(void)
00187 {
00188 m_iCur = 0;
00189
00190 return S_OK;
00191 }
00192
00193 /**************************************************************************
00194
00195    CEnumFormatEtc::Clone()
00196
00197 **************************************************************************/
00198
00199 STDMETHODIMP CEnumFormatEtc::Clone(IEnumFORMATETC **ppCloneEnumFormatEtc)
00200 {
00201 CEnumFormatEtc *newEnum;
00202
00203 if(NULL == ppCloneEnumFormatEtc)
00204    return S_FALSE;
00205
00206 newEnum = new CEnumFormatEtc(m_pStrFE, m_cItems);
00207
00208 if(newEnum ==NULL)
00209    return E_OUTOFMEMORY;
00210
00211 newEnum->AddRef();
00212 newEnum->m_iCur = m_iCur;
00213
00214 *ppCloneEnumFormatEtc = newEnum;
00215
00216 return S_OK;
00217 }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/CallBackClient/stdafx.Cpp Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • CallBackClient

stdafx.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: StdAfx.cpp
00004 ----------------------------------------------------------------------------
00005
00006 This file is part of the Microsoft COM+ Samples.
00007
00008 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00009
00010 This source code is intended only as a supplement to Microsoft
00011 Development Tools and/or on-line documentation. See these other
00012 materials for detailed information regarding Microsoft code samples.
00013
00014 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 PARTICULAR PURPOSE.
00018
00019 ==========================================================================+*/
00020 // stdafx.cpp : source file that includes just the standard includes
00021 //  CallBackClient.pch will be the pre-compiled header
00022 //  stdafx.obj will contain the pre-compiled type information
00023
00024 #include "stdafx.h"
00025
00026 // TODO: reference any additional headers you need in STDAFX.H
00027 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptClien/UTCRUCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptClien

UTCRUCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCruiseCar COM
00005              object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and
00009              IUtility interfaces.  This is done through Containment reuse
00010              of a COCruiseCar COM object (specifically providing its ICar
00011              and ICruise interface features).  COUtilityCruiseCar adds its
00012              own native implementation of the IUtility interface.  The
00013              contained CruiseCar object is implemented in an outside
00014              APTSERVE.EXE local server.
00015
00016              This multiple interface COM Object Class is achieved via
00017              the technique of nested classes: the implementation of the
00018              IUtility interface is nested inside of the COUtilityCruiseCar
00019              COM object class.
00020
00021              For a comprehensive tutorial code tour of this module's
00022              contents and offerings see the tutorial APTCLIEN.HTM file.
00023              For more specific technical details on the internal workings
00024              see the comments dispersed throughout the module's source
00025              code.
00026
00027   Classes:   COUtilityCruiseCar.
00028
00029   Functions: .
00030
00031   Origin:    3-20-96: atrent - Editor inheritance from LOCCLIEN source.
00032
00033 ----------------------------------------------------------------------------
00034   This file is part of the Microsoft COM Tutorial Code Samples.
00035
00036   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00037
00038   This source code is intended only as a supplement to Microsoft
00039   Development Tools and/or on-line documentation.  See these other
00040   materials for detailed information regarding Microsoft code samples.
00041
00042   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00043   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00044   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00045   PARTICULAR PURPOSE.
00046 ==========================================================================+*/
00047
00048 #if !defined(UTCRUCAR_H)
00049 #define UTCRUCAR_H
00050
00051 #ifdef __cplusplus
00052
00053 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00054   ObjectClass: COUtilityCruiseCar
00055
00056   Summary:     COM Object Class for COUtilityCruiseCar COM Objects.
00057                COM objects of this class augment COCruiseCar COM objects
00058                with the IUtility interface features of Offroad and Winch.
00059                COCruiseCar is reused to offer this COUtilityCruiseCar COM
00060                Object the ICar interface features of Shift, Clutch, Speed,
00061                Steer and the ICruise interface features of Engage and
00062                Adjust.  This COUtilityCruiseCar COM object class is
00063                constructed by containment reuse of the COCruiseCar COM
00064                object class.  The mulitple interfaces on this COM object
00065                class are constructed via the nested class interfaces
00066                technique.
00067
00068   Interfaces:  IUnknown
00069                  Standard interface providing COM object features.
00070                ICar
00071                  Basic car features.
00072                ICruise
00073                  Cruise control system features.
00074                IUtility
00075                  Sport-utility Car operation features.  Implemented in
00076                  this COM object.
00077
00078   Aggregation: Yes, COUtilityCruiseCar COM objects are aggregatable by
00079                passing a non-NULL pUnkOuter IUnknown pointer into
00080                the constructor.
00081 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00082 class COUtilityCruiseCar : public IUnknown
00083 {
00084   public:
00085     // Main Object Constructor & Destructor.
00086     COUtilityCruiseCar(IUnknown* pUnkOuter);
00087     ~COUtilityCruiseCar(void);
00088
00089     // A general method for initializing a newly created UtilityCruiseCar.
00090     HRESULT Init(void);
00091
00092     // IUnknown members. Main object, non-delegating.
00093     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00094     STDMETHODIMP_(ULONG) AddRef(void);
00095     STDMETHODIMP_(ULONG) Release(void);
00096
00097     // We get this ICar interface pointer via containment reuse of the
00098     // ICar interface in an instantiated COCruiseCar.
00099     ICar*                m_pICar;
00100
00101     // We get this ICruise interface pointer via containment reuse of the
00102     // ICruise interface in an instantiated COCruisecar.
00103     ICruise*             m_pICruise;
00104
00105   private:
00106     // We declare nested class interface implementations here.
00107
00108     // We implement the ICar interface in this COUtilityCruiseCar COM
00109     // object class.  This is a delegating interface for the one
00110     // in the contained COCruiseCar COM object.
00111     class CImpICar : public ICar
00112     {
00113       public:
00114         // Interface Implementation Constructor & Destructor.
00115         CImpICar(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00116         ~CImpICar(void);
00117
00118         // IUnknown methods.
00119         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00120         STDMETHODIMP_(ULONG) AddRef(void);
00121         STDMETHODIMP_(ULONG) Release(void);
00122
00123         // ICar methods.
00124         STDMETHODIMP         Shift(short nGear);
00125         STDMETHODIMP         Clutch(short nEngaged);
00126         STDMETHODIMP         Speed(short nMph);
00127         STDMETHODIMP         Steer(short nAngle);
00128
00129       private:
00130         // Data private to this COUtilityCar interface implementation of ICar.
00131         ULONG                m_cRefI;     // Interface Ref Count (debugging).
00132         COUtilityCruiseCar*  m_pBackObj;  // Parent Object back pointer.
00133         IUnknown*            m_pUnkOuter; // Outer unknown for Delegation.
00134     };
00135
00136     // We implement the ICruise interface in this COUtilityCruiseCar COM
00137     // object class.  This ICruise implementation is a delegating
00138     // interface for the one provided in the contained COCruiseCar COM
00139     // object.
00140     class CImpICruise : public ICruise
00141     {
00142       public:
00143         // Interface Implementation Constructor & Destructor.
00144         CImpICruise(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00145         ~CImpICruise(void);
00146
00147         // IUnknown methods.
00148         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00149         STDMETHODIMP_(ULONG) AddRef(void);
00150         STDMETHODIMP_(ULONG) Release(void);
00151
00152         // ICruise methods.
00153         STDMETHODIMP Engage(BOOL bOnOff);
00154         STDMETHODIMP Adjust(BOOL bUpDown);
00155
00156       private:
00157         // Data private to this interface implementation of ICruise.
00158         ULONG                m_cRefI;     // Interface Ref Count (debugging).
00159         COUtilityCruiseCar*  m_pBackObj;  // Parent Object back pointer.
00160         IUnknown*            m_pUnkOuter; // Outer unknown for Delegation.
00161     };
00162
00163     // We implement the IUtility interface in this COUtilityCruiseCar COM
00164     // object class.  This is the native interface that we are using as an
00165     // augmentation to the existing COCruiseCar COM object class.
00166     class CImpIUtility : public IUtility
00167     {
00168       public:
00169         // Interface Implementation Constructor & Destructor.
00170         CImpIUtility(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00171         ~CImpIUtility(void);
00172
00173         // IUnknown members.
00174         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00175         STDMETHODIMP_(ULONG) AddRef(void);
00176         STDMETHODIMP_(ULONG) Release(void);
00177
00178         // IUtility members.
00179         STDMETHODIMP Offroad(short nGear);
00180         STDMETHODIMP Winch(short nRpm);
00181
00182       private:
00183         // Data private to this interface implementation of IUtility.
00184         ULONG                m_cRefI;     // Interface Ref Count (debugging).
00185         COUtilityCruiseCar*  m_pBackObj;  // Parent Object back pointer.
00186         IUnknown*            m_pUnkOuter; // Outer unknown for Delegation.
00187     };
00188
00189     // Make the otherwise private and nested IUtility, ICruise, and ICar
00190     // interface implementations friend instantiations of this class.
00191     friend CImpICar;
00192     friend CImpICruise;
00193     friend CImpIUtility;
00194
00195     // Private data of COUtilityCruiseCar COM objects.
00196
00197     // Nested ICar implementation instantiation.
00198     CImpICar        m_ImpICar;
00199
00200     // Nested ICruise implementation instantiation.
00201     CImpICruise     m_ImpICruise;
00202
00203     // Nested IUtility implementation instantiation.  This IUtility
00204     // interface is implemented inside this COUtilityCruiseCar object
00205     // as a native interface.
00206     CImpIUtility    m_ImpIUtility;
00207
00208     // Main Object reference count.
00209     ULONG           m_cRefs;
00210
00211     // Outer unknown (aggregation & delegation). Used when this
00212     // COUtilityCruiseCar object is being aggregated.
00213     IUnknown*       m_pUnkOuter;
00214 };
00215
00216 typedef COUtilityCruiseCar* PCOUtilityCruiseCar;
00217
00218 // Here is a prototpye for the UtilityCruiseCar Creation function.
00219 HRESULT CreateUtilityCruiseCar(
00220           IUnknown* pUnkOuter,
00221           REFIID riid,
00222           PPVOID ppv);
00223
00224 #endif // __cplusplus
00225
00226
00227 #endif // UTCRUCAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmMonitor/CrmMonCompObj.Cpp Source File

  • Com
  • Services
  • Crm
  • CrmMonitor

CrmMonCompObj.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: CrmMonCompObj.cpp
00004
00005
00006
00007 Summary:
00008
00009   This is a sample of how to use the monitoring interfaces for the Compensating Resource Manager (CRM).
00010
00011   The following interfaces are used -
00012
00013     ICrmMonitor
00014     ICrmMonitorLogRecords
00015     ICrmMonitorClerks
00016
00017     ICrmFormatLogRecords
00018
00019   This sample shows how CRM clerks in a specified transaction can be found and queried.
00020
00021   This component should be installed in the application to be monitored. It does not require a transaction.
00022
00023   This file is part of the Microsoft COM Technology Samples.
00024
00025 Classes:
00026   CCrmMonComp
00027
00028 ----------------------------------------------------------------------------
00029
00030 This file is part of the Microsoft COM+ Samples.
00031
00032
00033
00034 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00035
00036
00037
00038 This source code is intended only as a supplement to Microsoft
00039
00040 Development Tools and/or on-line documentation. See these other
00041
00042 materials for detailed information regarding Microsoft code samples.
00043
00044
00045
00046 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00047
00048 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00049
00050 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00051
00052 PARTICULAR PURPOSE.
00053
00054 ==========================================================================+*/
00055 // CrmMonCompObj.cpp : Implementation of CCrmMonComp
00056
00057 #include "stdafx.h"
00058 #include "CrmMonComp.h"
00059 #include "CrmMonCompObj.h"
00060
00061 /////////////////////////////////////////////////////////////////////////////
00062 // CCrmMonComp
00063
00064 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00065
00066 Method: CCrmMonComp::FinalConstruct()
00067
00068 Summary: Final Construct
00069
00070 Returns: HRESULT
00071
00072 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00073
00074
00075 HRESULT CCrmMonComp::FinalConstruct()
00076 {
00077   HRESULT hr = S_OK;
00078
00079   hr = CoCreateInstance(
00080       __uuidof(CRMRecoveryClerk),
00081       NULL,
00082       CLSCTX_INPROC_SERVER,
00083       __uuidof(ICrmMonitor),
00084       (void **)&m_pICrmMonitor);
00085
00086   _ASSERTE(S_OK == hr);
00087   _ASSERTE(m_pICrmMonitor);
00088
00089   return CoCreateFreeThreadedMarshaler(
00090     GetControllingUnknown(), &m_pUnkMarshaler.p);
00091
00092 } // CCrmMonComp::FinalConstruct
00093
00094
00095 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00096
00097 Method: CCrmMonComp::FinalRelease()
00098
00099 Summary: Final Release
00100
00101 Returns: HRESULT
00102
00103 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00104
00105
00106 void CCrmMonComp::FinalRelease()
00107 {
00108   if (m_pICrmMonitorClerks)
00109   {
00110     m_pICrmMonitorClerks->Release();
00111
00112     m_pICrmMonitorClerks = NULL;
00113   }
00114
00115   // clean up clerks array
00116
00117   for (int i = 0; i < m_vecClerks.size(); i++)
00118   {
00119     CLERK_ENTRY * pce = m_vecClerks[i];
00120
00121     _ASSERTE(pce);
00122
00123     pce->m_pICrmMonitorLogRecords->Release();
00124
00125     delete pce;
00126   }
00127
00128   _ASSERTE(m_pICrmMonitor);
00129
00130   m_pICrmMonitor->Release();
00131
00132   m_pUnkMarshaler.Release();
00133
00134 } // CCrmMonComp::FinalRelease
00135
00136
00137 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00138
00139 Method: CCrmMonComp::put_TransactionUOW(VARIANT newVal)
00140
00141 Summary: Put the Transaction Property
00142
00143 Returns: HRESULT
00144
00145 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00146
00147
00148 STDMETHODIMP CCrmMonComp::put_TransactionUOW(VARIANT newVal)
00149 {
00150   HRESULT hr = VariantCopy(&m_vTxUOWRequired, &newVal);
00151
00152   _ASSERTE(S_OK == hr);
00153
00154   return S_OK;
00155
00156 } // CCrmMonComp::put_TransactionUOW
00157
00158
00159 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00160
00161 Method: CCrmMonComp::get_FindClerks(long * plNumberOfClerks)
00162
00163 Summary: Get the number of clerks
00164
00165 Returns: HRESULT
00166
00167 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00168
00169
00170 STDMETHODIMP CCrmMonComp::get_FindClerks(long * plNumberOfClerks)
00171 {
00172   _ASSERTE(plNumberOfClerks);
00173
00174   long lNumberOfClerks = 0;
00175
00176   *plNumberOfClerks = lNumberOfClerks;
00177
00178   HRESULT hr = S_OK;
00179
00180   _ASSERTE(m_pICrmMonitor);
00181
00182   if (m_pICrmMonitorClerks)
00183   {
00184     m_pICrmMonitorClerks->Release();
00185
00186     m_pICrmMonitorClerks = NULL;
00187   }
00188
00189     hr = m_pICrmMonitor->GetClerks(&m_pICrmMonitorClerks);
00190
00191     _ASSERTE(S_OK == hr);
00192     _ASSERTE(m_pICrmMonitorClerks);
00193
00194   // how many clerks?
00195
00196   long lClerkCount = 0;
00197
00198   hr = m_pICrmMonitorClerks->get_Count(&lClerkCount);
00199
00200     _ASSERTE(S_OK == hr);
00201
00202   ATLTRACE(_T("lClerkCount = %d\r\n"), lClerkCount);
00203
00204   if (0 == lClerkCount)
00205   {
00206     return S_OK;
00207   }
00208
00209   // find and hold the clerk(s) we are looking for
00210
00211   for (long lIndex = 0; lIndex < lClerkCount; lIndex++)
00212   {
00213     _variant_t vIndex = lIndex;
00214
00215     _variant_t vTxUOWClerk;
00216
00217     hr = m_pICrmMonitorClerks->TransactionUOW(vIndex, &vTxUOWClerk);
00218
00219     _ASSERTE(S_OK == hr);
00220
00221     if (vTxUOWClerk != m_vTxUOWRequired) continue; // not found
00222
00223     // found it
00224
00225     ATLTRACE(_T("found clerk # %d\r\n"), lIndex);
00226
00227     // get the clerk CLSID
00228
00229     _variant_t vClerkClsid;
00230
00231     hr = m_pICrmMonitorClerks->Item(vIndex, &vClerkClsid);
00232
00233     _ASSERTE(S_OK == hr);
00234
00235     // get the clerk from the recovery clerk
00236
00237     _variant_t vClerk;
00238
00239     hr = m_pICrmMonitor->HoldClerk(vClerkClsid, &vClerk);
00240
00241     // clerk may have gone
00242
00243     if (E_FAIL == hr)
00244     {
00245       ATLTRACE(_T("clerk # %d has gone\r\n"), lIndex);
00246
00247       continue;
00248     }
00249
00250     _ASSERTE(S_OK == hr);
00251
00252     lNumberOfClerks++;
00253
00254     _variant_t vActivityId;
00255
00256     if (1 == lNumberOfClerks)
00257     {
00258       // first time, get the activity id
00259
00260       hr = m_pICrmMonitorClerks->ActivityId(vIndex, &vActivityId);
00261
00262       _ASSERTE(S_OK == hr);
00263
00264       m_vActivityId = vActivityId;
00265     }
00266
00267     // activity id should be same for all clerks
00268
00269     _ASSERTE(m_vActivityId == vActivityId);
00270
00271     IUnknown * punkClerk = (IUnknown *)vClerk;
00272
00273     _ASSERTE(punkClerk);
00274
00275     ICrmMonitorLogRecords * pICrmMonitorLogRecords = NULL;
00276
00277     hr = punkClerk->QueryInterface(
00278                 __uuidof(ICrmMonitorLogRecords),
00279                 (void **)&pICrmMonitorLogRecords);
00280
00281     _ASSERTE(S_OK == hr);
00282     _ASSERTE(pICrmMonitorLogRecords);
00283
00284     punkClerk->Release();
00285
00286     // put this clerk on the list
00287
00288     CLERK_ENTRY * pce = new CLERK_ENTRY;
00289
00290     _ASSERTE(pce);
00291
00292     pce->m_vIndex = vIndex;
00293
00294     pce->m_pICrmMonitorLogRecords = pICrmMonitorLogRecords;
00295
00296     m_vecClerks.push_back(pce);
00297   }
00298
00299   *plNumberOfClerks = lNumberOfClerks;
00300
00301   _ASSERTE(m_vecClerks.size() == lNumberOfClerks);
00302
00303   return S_OK;
00304
00305 } // CCrmMonComp::FindClerks
00306
00307
00308 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00309
00310 Method: CCrmMonComp::get_FindClerks(long * plNumberOfClerks)
00311
00312 Summary: Set the clerk to the given number
00313
00314 Returns: HRESULT
00315
00316 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00317
00318
00319 STDMETHODIMP CCrmMonComp::SetClerk(long lClerkNumber)
00320 {
00321   long lNumClerks = (long) m_vecClerks.size();
00322
00323   if ((lClerkNumber < 0) || (lClerkNumber >= lNumClerks))
00324   {
00325     ATLTRACE(_T("ERROR: no such clerk, %d, %d\r\n"), lClerkNumber, lNumClerks);
00326
00327     return E_FAIL;
00328   }
00329
00330   m_lClerkNumber = lClerkNumber;
00331
00332   return S_OK;
00333
00334 } // CCrmMonComp::SetClerk
00335
00336
00337 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00338
00339 Method: CCrmMonComp::get_TransactionState(VARIANT * pVal)
00340
00341 Summary: Get the state of the current transaction.
00342
00343 Returns: HRESULT
00344
00345 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00346
00347
00348
00349 STDMETHODIMP CCrmMonComp::get_TransactionState(VARIANT * pVal)
00350 {
00351   _ASSERTE(pVal);
00352
00353   long lNumClerks = (long) m_vecClerks.size();
00354
00355   if (0 == lNumClerks)
00356   {
00357     ATLTRACE(_T("ERROR: no clerks\r\n"));
00358
00359     return E_FAIL;
00360   }
00361
00362   HRESULT hr = S_OK;
00363
00364   // get the transaction state from the 1st clerk only - should be same for all clerks
00365
00366   CLERK_ENTRY * pce = m_vecClerks.front();
00367
00368   _ASSERTE(pce);
00369
00370   ICrmMonitorLogRecords * pICrmMonitorLogRecords = pce->m_pICrmMonitorLogRecords;
00371
00372   _ASSERTE(pICrmMonitorLogRecords);
00373
00374   CrmTransactionState txs;
00375
00376   hr = pICrmMonitorLogRecords->get_TransactionState(&txs);
00377
00378   _ASSERTE(S_OK == hr);
00379
00380   ATLTRACE(_T("txs = %d\r\n"), txs);
00381
00382   _variant_t vTxState = L"Unknown";
00383
00384   switch (txs)
00385   {
00386     case TxState_Active: vTxState = _variant_t("Active"); break;
00387
00388     case TxState_Committed: vTxState = _variant_t("Committed"); break;
00389
00390     case TxState_Aborted: vTxState = _variant_t("Aborted"); break;
00391
00392     case TxState_Indoubt: vTxState = _variant_t("Indoubt"); break;
00393
00394     default:
00395
00396       _ASSERTE(!"ERROR: unknown transaction state");
00397
00398       return E_FAIL;
00399
00400       break;
00401   };
00402
00403   hr = VariantCopy(pVal, &vTxState);
00404
00405   _ASSERTE(S_OK == hr);
00406
00407   return S_OK;
00408
00409 } // CCrmMonComp::get_TransactionState
00410
00411
00412
00413 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00414
00415 Method: CCrmMonComp::get_ActivityId(VARIANT * pVal)
00416
00417 Summary: Get the current Activity ID
00418
00419 Returns: HRESULT
00420
00421 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00422
00423
00424
00425 STDMETHODIMP CCrmMonComp::get_ActivityId(VARIANT * pVal)
00426 {
00427   _ASSERTE(pVal);
00428
00429   long lNumClerks = (long) m_vecClerks.size();
00430
00431   if (0 == lNumClerks)
00432   {
00433     ATLTRACE(_T("ERROR: no clerks\r\n"));
00434
00435     return E_FAIL;
00436   }
00437
00438   HRESULT hr = VariantCopy(pVal, &m_vActivityId);
00439
00440   _ASSERTE(S_OK == hr);
00441
00442   return S_OK;
00443
00444 } // CCrmMonComp::get_ActivityId
00445
00446
00447 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00448
00449 Method: CCrmMonComp::get_ProgId(VARIANT * pVal)
00450
00451 Summary: Get the current Prog ID
00452
00453 Returns: HRESULT
00454
00455 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00456
00457
00458
00459 STDMETHODIMP CCrmMonComp::get_ProgId(VARIANT * pVal)
00460 {
00461   _ASSERTE(pVal);
00462
00463   long lNumClerks = (long) m_vecClerks.size();
00464
00465   if (0 == lNumClerks)
00466   {
00467     ATLTRACE(_T("ERROR: no clerks\r\n"));
00468
00469     return E_FAIL;
00470   }
00471
00472   HRESULT hr = S_OK;
00473
00474   CLERK_ENTRY * pce = m_vecClerks[m_lClerkNumber];
00475
00476   _ASSERTE(pce);
00477
00478   _variant_t vProgId = L"Unknown ProgId";
00479
00480   hr = m_pICrmMonitorClerks->ProgIdCompensator(pce->m_vIndex, &vProgId);
00481
00482   _ASSERTE(S_OK == hr);
00483
00484   hr = VariantCopy(pVal, &vProgId);
00485
00486   _ASSERTE(S_OK == hr);
00487
00488   return S_OK;
00489
00490 } // CCrmMonComp::get_ProgId
00491
00492
00493 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00494
00495 Method: CCrmMonComp::get_Description(VARIANT * pVal)
00496
00497 Summary: Calls ICRMMonitorClerks::Description.
00498
00499 Returns: HRESULT
00500
00501 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00502
00503
00504 STDMETHODIMP CCrmMonComp::get_Description(VARIANT * pVal)
00505 {
00506   _ASSERTE(pVal);
00507
00508   long lNumClerks = (long) m_vecClerks.size();
00509
00510   if (0 == lNumClerks)
00511   {
00512     ATLTRACE(_T("ERROR: no clerks\r\n"));
00513
00514     return E_FAIL;
00515   }
00516
00517   HRESULT hr = S_OK;
00518
00519   CLERK_ENTRY * pce = m_vecClerks[m_lClerkNumber];
00520
00521   _ASSERTE(pce);
00522
00523   _variant_t vDescription = L"Unknown Description";
00524
00525   hr = m_pICrmMonitorClerks->Description(pce->m_vIndex, &vDescription);
00526
00527   _ASSERTE(S_OK == hr);
00528
00529   hr = VariantCopy(pVal, &vDescription);
00530
00531   _ASSERTE(S_OK == hr);
00532
00533   return S_OK;
00534
00535 } // CCrmMonComp::get_Description
00536
00537
00538 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00539
00540 Method: CCrmMonComp::get_NumberOfLogRecords(VARIANT * pVal)
00541
00542 Summary: Gets number of log records
00543
00544 Returns: HRESULT
00545
00546 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00547
00548
00549 STDMETHODIMP CCrmMonComp::get_NumberOfLogRecords(long * pVal)
00550 {
00551   _ASSERTE(pVal);
00552
00553   long lNumClerks = (long) m_vecClerks.size();
00554
00555   if (0 == lNumClerks)
00556   {
00557     ATLTRACE(_T("ERROR: no clerks\r\n"));
00558
00559     return E_FAIL;
00560   }
00561
00562   HRESULT hr = S_OK;
00563
00564   CLERK_ENTRY * pce = m_vecClerks[m_lClerkNumber];
00565
00566   _ASSERTE(pce);
00567
00568   ICrmMonitorLogRecords * pICrmMonitorLogRecords = pce->m_pICrmMonitorLogRecords;
00569
00570   _ASSERTE(pICrmMonitorLogRecords);
00571
00572   hr = pICrmMonitorLogRecords->get_Count(pVal);
00573
00574   _ASSERTE(S_OK == hr);
00575
00576   return S_OK;
00577
00578 } // CCrmMonComp::get_NumberOfLogRecords
00579
00580
00581 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00582
00583 Method: CCrmMonComp::AbortTransaction()
00584
00585 Summary: Aborts the transaction
00586
00587 Returns: HRESULT
00588
00589 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00590
00591
00592
00593 STDMETHODIMP CCrmMonComp::AbortTransaction()
00594 {
00595   long lNumClerks = (long) m_vecClerks.size();
00596
00597   if (0 == lNumClerks)
00598   {
00599     ATLTRACE(_T("ERROR: no clerks\r\n"));
00600
00601     return E_FAIL;
00602   }
00603
00604   HRESULT hr = S_OK;
00605
00606   // transaction will be same for all clerks - get 1st clerk
00607
00608   CLERK_ENTRY * pce = m_vecClerks.front();
00609
00610   _ASSERTE(pce);
00611
00612   ICrmMonitorLogRecords * pICrmMonitorLogRecords = pce->m_pICrmMonitorLogRecords;
00613
00614   _ASSERTE(pICrmMonitorLogRecords);
00615
00616   ICrmLogControl * pICrmLogControl = NULL;
00617
00618   hr = pICrmMonitorLogRecords->QueryInterface(
00619                     __uuidof(ICrmLogControl),
00620                     (void **)&pICrmLogControl);
00621
00622   _ASSERTE(S_OK == hr);
00623   _ASSERTE(pICrmLogControl);
00624
00625   hr = pICrmLogControl->ForceTransactionToAbort();
00626
00627   if (hr != S_OK)
00628   {
00629     ATLTRACE(_T("ForceTransactionToAbort, hr = %08lX\r\n"), hr);
00630   }
00631
00632   pICrmLogControl->Release();
00633
00634   return S_OK;
00635
00636 } // CCrmMonComp::AbortTransaction
00637
00638
00639 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00640
00641 Method: CCrmMonComp::SetRecord(long lRecordNumber)
00642
00643 Summary: Set the record number
00644
00645 Returns: HRESULT
00646
00647 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00648
00649
00650 STDMETHODIMP CCrmMonComp::SetRecord(long lRecordNumber)
00651 {
00652   m_lRecordNumber = lRecordNumber;
00653
00654   return S_OK;
00655
00656 } // CCrmMonComp::SetRecord
00657
00658
00659 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00660
00661 Method: CCrmMonComp::CreateCompensator(void)
00662
00663 Summary: Creates a CRM compensator
00664
00665 Returns: HRESULT
00666
00667 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00668
00669
00670 HRESULT CCrmMonComp::CreateCompensator(void)
00671 {
00672   HRESULT hr = S_OK;
00673
00674   // find the Prog Id
00675
00676   _variant_t vProgId;
00677
00678   hr = get_ProgId(&vProgId);
00679
00680   if (hr != S_OK) return hr;
00681
00682   // convert the Prog Id to a CLSID
00683
00684   _bstr_t bstrProgId = vProgId;
00685
00686   CLSID clsidCompensator;
00687
00688   hr = CLSIDFromProgID((LPCOLESTR)bstrProgId, &clsidCompensator);
00689
00690   if (S_OK != hr)
00691   {
00692     // attempt to convert stringized CLSID
00693
00694     hr = CLSIDFromString((LPOLESTR)bstrProgId, &clsidCompensator);
00695   }
00696
00697   if (hr != S_OK) return hr;
00698
00699   // create the compensator - it should be there
00700
00701   IUnknown * punkCompensator = NULL;
00702
00703   hr = CoCreateInstance(
00704       clsidCompensator,
00705       NULL,
00706       CLSCTX_ALL,
00707       __uuidof(IUnknown),
00708       (void **)&punkCompensator);
00709
00710   _ASSERTE(S_OK == hr);
00711   _ASSERTE(punkCompensator);
00712
00713   // does the compensator support ICrmFormatLogRecords?
00714
00715   hr = punkCompensator->QueryInterface(
00716         __uuidof(ICrmFormatLogRecords),
00717         (void **)&m_pICrmFormatLogRecords);
00718
00719   punkCompensator->Release();
00720
00721   if (E_NOINTERFACE == hr)
00722   {
00723     m_pICrmFormatLogRecords = NULL;
00724
00725     return S_OK;
00726   }
00727
00728   _ASSERTE(S_OK == hr);
00729   _ASSERTE(m_pICrmFormatLogRecords);
00730
00731   return S_OK;
00732
00733 } // CCrmMonComp::CreateCompensator
00734
00735
00736 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00737
00738 Method: CCrmMonComp::get_ColumnHeaders(VARIANT * pVal)
00739
00740 Summary: Gets the header format info if available.
00741
00742 Returns: HRESULT
00743
00744 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00745
00746
00747 STDMETHODIMP CCrmMonComp::get_ColumnHeaders(VARIANT * pVal)
00748 {
00749   _ASSERTE(pVal);
00750
00751   HRESULT hr = S_OK;
00752
00753   hr = CreateCompensator();
00754
00755   if (hr != S_OK) return hr;
00756
00757   // assume compensator cannot provide format info
00758
00759   _variant_t vHeaders = L"<no column headers available>";
00760
00761   if (m_pICrmFormatLogRecords)
00762   {
00763     // compensator can provide format info
00764
00765     hr = m_pICrmFormatLogRecords->GetColumnHeaders(&vHeaders);
00766
00767     _ASSERTE(S_OK == hr);
00768
00769     m_pICrmFormatLogRecords->Release();
00770
00771     m_pICrmFormatLogRecords = NULL;
00772   }
00773
00774   hr = VariantCopy(pVal, &vHeaders);
00775
00776   _ASSERTE(S_OK == hr);
00777
00778   return S_OK;
00779
00780 } // CCrmMonComp::get_ColumnHeaders
00781
00782
00783 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00784
00785 Method: CCrmMonComp::get_FormattedRecord(VARIANT * pVal)
00786
00787 Summary: Gets a formatted record
00788
00789 Returns: HRESULT
00790
00791 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00792
00793
00794 STDMETHODIMP CCrmMonComp::get_FormattedRecord(VARIANT * pVal)
00795 {
00796   _ASSERTE(pVal);
00797
00798   HRESULT hr = S_OK;
00799
00800   hr = CreateCompensator();
00801
00802   if (hr != S_OK) return hr;
00803
00804   // assume compensator cannot provide record format info
00805
00806   _variant_t vRecords = L"<no record details available>";
00807
00808   if (!m_pICrmFormatLogRecords)
00809   {
00810     // compensator cannot provide record format info
00811
00812     hr = VariantCopy(pVal, &vRecords);
00813
00814     _ASSERTE(S_OK == hr);
00815
00816     return S_OK;
00817   }
00818
00819   // get the required record
00820
00821   CLERK_ENTRY * pce = m_vecClerks[m_lClerkNumber];
00822
00823   _ASSERTE(pce);
00824   _ASSERTE(pce->m_pICrmMonitorLogRecords);
00825
00826   // is the record requested available?
00827
00828   long lCount = 0;
00829
00830   hr = get_NumberOfLogRecords(&lCount);
00831
00832   if (hr != S_OK) return hr;
00833
00834   if (m_lRecordNumber >= lCount)
00835   {
00836     ATLTRACE(_T("ERROR: no such log record\r\n"));
00837
00838     return E_FAIL;
00839   }
00840
00841   // do we have structured or unstructured records?
00842
00843   VARIANT_BOOL vbStructuredRecs = VARIANT_FALSE;
00844
00845   hr = pce->m_pICrmMonitorLogRecords->get_StructuredRecords(&vbStructuredRecs);
00846
00847   _ASSERTE(S_OK == hr);
00848
00849   BOOL fStructured = (VARIANT_TRUE == vbStructuredRecs);
00850
00851   if (fStructured)
00852   {
00853     // get the record
00854
00855     _variant_t vIndexNumber = (_variant_t)m_lRecordNumber;
00856
00857     _variant_t vLogRecord;
00858
00859     hr = pce->m_pICrmMonitorLogRecords->GetLogRecordVariants(
00860                         vIndexNumber,
00861                         &vLogRecord);
00862     _ASSERTE(S_OK == hr);
00863
00864     // format the record
00865
00866     hr = m_pICrmFormatLogRecords->GetColumnVariants(vLogRecord, &vRecords);
00867
00868     _ASSERTE(S_OK == hr);
00869   }
00870
00871   else
00872   {
00873     // is unstructured record here
00874
00875     // get the record
00876
00877     CrmLogRecordRead CrmLogRec;
00878
00879     hr = pce->m_pICrmMonitorLogRecords->GetLogRecord(
00880                         (DWORD)m_lRecordNumber,
00881                         &CrmLogRec);
00882     _ASSERTE(S_OK == hr);
00883
00884     // format the record
00885
00886     hr = m_pICrmFormatLogRecords->GetColumn(CrmLogRec, &vRecords);
00887
00888     _ASSERTE(S_OK == hr);
00889   }
00890
00891   m_pICrmFormatLogRecords->Release();
00892
00893   m_pICrmFormatLogRecords = NULL;
00894
00895   hr = VariantCopy(pVal, &vRecords);
00896
00897   _ASSERTE(S_OK == hr);
00898
00899   return S_OK;
00900
00901 } // CCrmMonComp::get_FormattedRecord
00902
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/string.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

string.Cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "heap.h"
00003
00004 IMPLEMENT_FIXED_ALLOC(CString, 100);
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // static class data, special inlines
00008
00009 const WCHAR epChNil = L'\0';
00010 static int _epInitData[] = { -1, 0, 0, 0 };
00011 static CStringData* _epDataNil = (CStringData*)&_epInitData;
00012 LPCWSTR _epPchNil = (LPCWSTR)(((BYTE*)&_epInitData)+sizeof(CStringData));
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 // Construction/Destruction
00016
00017 CString::CString(const CString& stringSrc)
00018 {
00019   if (stringSrc.GetData()->nRefs >= 0)
00020   {
00021     m_pchData = stringSrc.m_pchData;
00022     InterlockedIncrement(&GetData()->nRefs);
00023   }
00024   else
00025   {
00026     Init();
00027     *this = stringSrc.m_pchData;
00028   }
00029 }
00030
00031 CString::CString(WCHAR ch, int nLength)
00032 {
00033   Init();
00034   if (nLength >= 1)
00035   {
00036     AllocBuffer(nLength);
00037     for (int i = 0; i < nLength; i++)
00038       m_pchData[i] = ch;
00039   }
00040 }
00041
00042 CString::CString(LPCWSTR lpch, int nLength)
00043 {
00044   Init();
00045   if (nLength != 0)
00046   {
00047     AllocBuffer(nLength);
00048     memcpy(m_pchData, lpch, nLength*sizeof(WCHAR));
00049   }
00050 }
00051
00052 //////////////////////////////////////////////////////////////////////////////
00053 // Assignment operators
00054
00055 const CString& CString::operator=(WCHAR ch)
00056 {
00057   AssignCopy(1, &ch);
00058   return *this;
00059 }
00060
00061 #pragma warning(disable: 4074)
00062 #pragma init_seg(compiler)
00063
00064 #define ROUND(x,y) (((x)+(y-1))&~(y-1))
00065 #define ROUND4(x) ROUND(x, 4)
00066 static CFixedAlloc _epAlloc6(ROUND4(7*sizeof(WCHAR)+sizeof(CStringData)));
00067 static CFixedAlloc _epAlloc7(ROUND4(8*sizeof(WCHAR)+sizeof(CStringData)));
00068 static CFixedAlloc _epAlloc8(ROUND4(9*sizeof(WCHAR)+sizeof(CStringData)));
00069 static CFixedAlloc _epAlloc9(ROUND4(10*sizeof(WCHAR)+sizeof(CStringData)));
00070 static CFixedAlloc _epAlloc10(ROUND4(11*sizeof(WCHAR)+sizeof(CStringData)));
00071 static CFixedAlloc _epAlloc11(ROUND4(12*sizeof(WCHAR)+sizeof(CStringData)));
00072 static CFixedAlloc _epAlloc12(ROUND4(13*sizeof(WCHAR)+sizeof(CStringData)));
00073 static CFixedAlloc _epAlloc16(ROUND4(17*sizeof(WCHAR)+sizeof(CStringData)));
00074 static CFixedAlloc _epAlloc20(ROUND4(21*sizeof(WCHAR)+sizeof(CStringData)));
00075 static CFixedAlloc _epAlloc24(ROUND4(25*sizeof(WCHAR)+sizeof(CStringData)));
00076 static CFixedAlloc _epAlloc32(ROUND4(33*sizeof(WCHAR)+sizeof(CStringData)));
00077 static CFixedAlloc _epAlloc64(ROUND4(65*sizeof(WCHAR)+sizeof(CStringData)));
00078 static CFixedAlloc _epAlloc128(ROUND4(129*sizeof(WCHAR)+sizeof(CStringData)));
00079 static CFixedAlloc _epAlloc256(ROUND4(257*sizeof(WCHAR)+sizeof(CStringData)));
00080 static CFixedAlloc _epAlloc512(ROUND4(513*sizeof(WCHAR)+sizeof(CStringData)));
00081
00082 void CString::AllocBuffer(int nLen)
00083 // always allocate one extra character for '\0' termination
00084 // assumes [optimistically] that data length will equal allocation length
00085 {
00086   if (nLen == 0)
00087     Init();
00088   else
00089   {
00090     CStringData* pData;
00091     if (nLen <= 6)
00092     {
00093       pData = (CStringData*)_epAlloc6.Alloc();
00094       pData->nAllocLength = 6;
00095     }
00096     else if (nLen <= 7)
00097     {
00098       pData = (CStringData*)_epAlloc7.Alloc();
00099       pData->nAllocLength = 7;
00100     }
00101     else if (nLen <= 8)
00102     {
00103       pData = (CStringData*)_epAlloc8.Alloc();
00104       pData->nAllocLength = 8;
00105     }
00106     else if (nLen <= 9)
00107     {
00108       pData = (CStringData*)_epAlloc9.Alloc();
00109       pData->nAllocLength = 9;
00110     }
00111     else if (nLen <= 10)
00112     {
00113       pData = (CStringData*)_epAlloc10.Alloc();
00114       pData->nAllocLength = 10;
00115     }
00116     else if (nLen <= 11)
00117     {
00118       pData = (CStringData*)_epAlloc11.Alloc();
00119       pData->nAllocLength = 11;
00120     }
00121     else if (nLen <= 12)
00122     {
00123       pData = (CStringData*)_epAlloc12.Alloc();
00124       pData->nAllocLength = 12;
00125     }
00126     else if (nLen <= 16)
00127     {
00128       pData = (CStringData*)_epAlloc16.Alloc();
00129       pData->nAllocLength = 16;
00130     }
00131     else if (nLen <= 20)
00132     {
00133       pData = (CStringData*)_epAlloc20.Alloc();
00134       pData->nAllocLength = 20;
00135     }
00136     else if (nLen <= 24)
00137     {
00138       pData = (CStringData*)_epAlloc24.Alloc();
00139       pData->nAllocLength = 24;
00140     }
00141     else if (nLen <= 32)
00142     {
00143       pData = (CStringData*)_epAlloc32.Alloc();
00144       pData->nAllocLength = 32;
00145     }
00146     else if (nLen <= 64)
00147     {
00148       pData = (CStringData*)_epAlloc64.Alloc();
00149       pData->nAllocLength = 64;
00150     }
00151     else if (nLen <= 128)
00152     {
00153       pData = (CStringData*)_epAlloc128.Alloc();
00154       pData->nAllocLength = 128;
00155     }
00156     else if (nLen <= 256)
00157     {
00158       pData = (CStringData*)_epAlloc256.Alloc();
00159       pData->nAllocLength = 256;
00160     }
00161     else if (nLen <= 512)
00162     {
00163       pData = (CStringData*)_epAlloc512.Alloc();
00164       pData->nAllocLength = 512;
00165     }
00166     else
00167     {
00168       pData = (CStringData*)
00169         new BYTE[sizeof(CStringData) + (nLen+1)*sizeof(WCHAR)];
00170       pData->nAllocLength = nLen;
00171     }
00172     pData->nRefs = 1;
00173     pData->data()[nLen] = L'\0';
00174     pData->nDataLength = nLen;
00175     m_pchData = pData->data();
00176   }
00177 }
00178
00179 void CString::FreeData(CStringData* pData)
00180 {
00181   switch (pData->nAllocLength)
00182   {
00183     case 6:
00184     {
00185       _epAlloc6.Free(pData);
00186       break;
00187     }
00188     case 7:
00189     {
00190       _epAlloc7.Free(pData);
00191       break;
00192     }
00193     case 8:
00194     {
00195       _epAlloc8.Free(pData);
00196       break;
00197     }
00198     case 9:
00199     {
00200       _epAlloc9.Free(pData);
00201       break;
00202     }
00203     case 10:
00204     {
00205       _epAlloc10.Free(pData);
00206       break;
00207     }
00208     case 11:
00209     {
00210       _epAlloc11.Free(pData);
00211       break;
00212     }
00213     case 12:
00214     {
00215       _epAlloc12.Free(pData);
00216       break;
00217     }
00218     case 16:
00219     {
00220       _epAlloc16.Free(pData);
00221       break;
00222     }
00223     case 20:
00224     {
00225       _epAlloc20.Free(pData);
00226       break;
00227     }
00228     case 24:
00229     {
00230       _epAlloc24.Free(pData);
00231       break;
00232     }
00233     case 32:
00234     {
00235       _epAlloc32.Free(pData);
00236       break;
00237     }
00238     case 64:
00239     {
00240       _epAlloc64.Free(pData);
00241       break;
00242     }
00243     case 128:
00244     {
00245       _epAlloc128.Free(pData);
00246       break;
00247     }
00248     case 256:
00249     {
00250       _epAlloc256.Free(pData);
00251       break;
00252     }
00253     case 512:
00254     {
00255       _epAlloc512.Free(pData);
00256       break;
00257     }
00258     default:
00259     {
00260       delete[] (BYTE*)pData;
00261       break;
00262     }
00263   }
00264 }
00265
00266 void CString::Release()
00267 {
00268   if (GetData() != _epDataNil)
00269   {
00270     if (InterlockedDecrement(&GetData()->nRefs) <= 0)
00271       FreeData(GetData());
00272     Init();
00273   }
00274 }
00275
00276 void CString::Release(CStringData* pData)
00277 {
00278   if (pData != _epDataNil)
00279   {
00280     if (InterlockedDecrement(&pData->nRefs) <= 0)
00281       FreeData(pData);
00282   }
00283 }
00284
00285 void CString::Empty()
00286 {
00287   if (GetData()->nDataLength == 0)
00288     return;
00289   if (GetData()->nRefs >= 0)
00290     Release();
00291   else
00292     *this = &epChNil;
00293 }
00294
00295 void CString::CopyBeforeWrite()
00296 {
00297   if (GetData()->nRefs > 1)
00298   {
00299     CStringData* pData = GetData();
00300     Release();
00301     AllocBuffer(pData->nDataLength);
00302     memcpy(m_pchData, pData->data(), (pData->nDataLength+1)*sizeof(WCHAR));
00303   }
00304 }
00305
00306 inline CString::~CString()
00307 //  free any attached data
00308 {
00309   if (GetData() != _epDataNil)
00310   {
00311     if (InterlockedDecrement(&GetData()->nRefs) <= 0)
00312       FreeData(GetData());
00313   }
00314 }
00315
00316 //////////////////////////////////////////////////////////////////////////////
00317 // Helpers for the rest of the implementation
00318
00319 void CString::AllocCopy(CString& dest, int nCopyLen, int nCopyIndex,
00320    int nExtraLen) const
00321 {
00322   // will clone the data attached to this string
00323   // allocating 'nExtraLen' characters
00324   // Places results in uninitialized string 'dest'
00325   // Will copy the part or all of original data to start of new string
00326
00327   int nNewLen = nCopyLen + nExtraLen;
00328   if (nNewLen == 0)
00329   {
00330     dest.Init();
00331   }
00332   else
00333   {
00334     dest.AllocBuffer(nNewLen);
00335     memcpy(dest.m_pchData, m_pchData+nCopyIndex, nCopyLen*sizeof(WCHAR));
00336   }
00337 }
00338
00339 //////////////////////////////////////////////////////////////////////////////
00340 // More sophisticated construction
00341
00342 CString::CString(LPCWSTR lpsz)
00343 {
00344   Init();
00345   int nLen = SafeStrlen(lpsz);
00346   if (nLen != 0)
00347   {
00348     AllocBuffer(nLen);
00349     memcpy(m_pchData, lpsz, nLen*sizeof(WCHAR));
00350   }
00351 }
00352
00353 //////////////////////////////////////////////////////////////////////////////
00354 // Assignment operators
00355 const CString& CString::operator=(const CString& stringSrc)
00356 {
00357   if (m_pchData != stringSrc.m_pchData)
00358   {
00359     if ((GetData()->nRefs < 0 && GetData() != _epDataNil) ||
00360       stringSrc.GetData()->nRefs < 0)
00361     {
00362       // actual copy necessary since one of the strings is locked
00363       AssignCopy(stringSrc.GetData()->nDataLength, stringSrc.m_pchData);
00364     }
00365     else
00366     {
00367       // can just copy references around
00368       Release();
00369       m_pchData = stringSrc.m_pchData;
00370       InterlockedIncrement(&GetData()->nRefs);
00371     }
00372   }
00373   return *this;
00374 }
00375
00376 //////////////////////////////////////////////////////////////////////////////
00377 // concatenation
00378
00379 // NOTE: "operator+" is done as friend functions for simplicity
00380 //      There are three variants:
00381 //          CString + CString
00382 // and for ? = WCHAR, LPCWSTR
00383 //          CString + ?
00384 //          ? + CString
00385
00386 void CString::ConcatCopy(int nSrc1Len, LPCWSTR lpszSrc1Data,
00387   int nSrc2Len, LPCWSTR lpszSrc2Data)
00388 {
00389   // -- master concatenation routine
00390   // Concatenate two sources
00391   // -- assume that 'this' is a new CString object
00392
00393   int nNewLen = nSrc1Len + nSrc2Len;
00394   if (nNewLen != 0)
00395   {
00396     AllocBuffer(nNewLen);
00397     memcpy(m_pchData, lpszSrc1Data, nSrc1Len*sizeof(WCHAR));
00398     memcpy(m_pchData+nSrc1Len, lpszSrc2Data, nSrc2Len*sizeof(WCHAR));
00399   }
00400 }
00401
00402 CString operator+(const CString& string1, const CString& string2)
00403 {
00404   CString s;
00405   s.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData,
00406     string2.GetData()->nDataLength, string2.m_pchData);
00407   return s;
00408 }
00409
00410 CString operator+(const CString& string, LPCWSTR lpsz)
00411 {
00412   CString s;
00413   s.ConcatCopy(string.GetData()->nDataLength, string.m_pchData,
00414     CString::SafeStrlen(lpsz), lpsz);
00415   return s;
00416 }
00417
00418 CString operator+(LPCWSTR lpsz, const CString& string)
00419 {
00420   CString s;
00421   s.ConcatCopy(CString::SafeStrlen(lpsz), lpsz, string.GetData()->nDataLength,
00422     string.m_pchData);
00423   return s;
00424 }
00425
00426 CString operator+(const CString& string1, WCHAR ch)
00427 {
00428   CString s;
00429   s.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData, 1, &ch);
00430   return s;
00431 }
00432
00433 CString operator+(WCHAR ch, const CString& string)
00434 {
00435   CString s;
00436   s.ConcatCopy(1, &ch, string.GetData()->nDataLength, string.m_pchData);
00437   return s;
00438 }
00439
00440 //////////////////////////////////////////////////////////////////////////////
00441 // concatenate in place
00442
00443 void CString::ConcatInPlace(int nSrcLen, LPCWSTR lpszSrcData)
00444 {
00445   //  -- the main routine for += operators
00446
00447   // concatenating an empty string is a no-op!
00448   if (nSrcLen == 0)
00449     return;
00450
00451   // if the buffer is too small, or we have a width mis-match, just
00452   //   allocate a new buffer (slow but sure)
00453   if (GetData()->nRefs > 1 || GetData()->nDataLength + nSrcLen > GetData()->nAllocLength)
00454   {
00455     // we have to grow the buffer, use the ConcatCopy routine
00456     CStringData* pOldData = GetData();
00457     ConcatCopy(GetData()->nDataLength, m_pchData, nSrcLen, lpszSrcData);
00458     CString::Release(pOldData);
00459   }
00460   else
00461   {
00462     // fast concatenation when buffer big enough
00463     memcpy(m_pchData+GetData()->nDataLength, lpszSrcData, nSrcLen*sizeof(WCHAR));
00464     GetData()->nDataLength += nSrcLen;
00465     m_pchData[GetData()->nDataLength] = L'\0';
00466   }
00467 }
00468
00469 const CString& CString::operator+=(LPCWSTR lpsz)
00470 {
00471   ConcatInPlace(SafeStrlen(lpsz), lpsz);
00472   return *this;
00473 }
00474
00475 const CString& CString::operator+=(WCHAR ch)
00476 {
00477   ConcatInPlace(1, &ch);
00478   return *this;
00479 }
00480
00481 const CString& CString::operator+=(const CString& string)
00482 {
00483   ConcatInPlace(string.GetData()->nDataLength, string.m_pchData);
00484   return *this;
00485 }
00486
00487 ///////////////////////////////////////////////////////////////////////////////
00488 // Advanced direct buffer access
00489
00490 LPWSTR CString::GetBuffer(int nMinBufLength)
00491 {
00492   if (GetData()->nRefs > 1 || nMinBufLength > GetData()->nAllocLength)
00493   {
00494     // we have to grow the buffer
00495     CStringData* pOldData = GetData();
00496     int nOldLen = GetData()->nDataLength;   // AllocBuffer will tromp it
00497     if (nMinBufLength < nOldLen)
00498       nMinBufLength = nOldLen;
00499     AllocBuffer(nMinBufLength);
00500     memcpy(m_pchData, pOldData->data(), (nOldLen+1)*sizeof(WCHAR));
00501     GetData()->nDataLength = nOldLen;
00502     CString::Release(pOldData);
00503   }
00504   // return a pointer to the character storage for this string
00505   return m_pchData;
00506 }
00507
00508 void CString::ReleaseBuffer(int nNewLength)
00509 {
00510   CopyBeforeWrite();  // just in case GetBuffer was not called
00511
00512   if (nNewLength == -1)
00513     nNewLength = wcslen(m_pchData); // zero terminated
00514
00515   GetData()->nDataLength = nNewLength;
00516   m_pchData[nNewLength] = L'\0';
00517 }
00518
00519 LPWSTR CString::GetBufferSetLength(int nNewLength)
00520 {
00521   GetBuffer(nNewLength);
00522   GetData()->nDataLength = nNewLength;
00523   m_pchData[nNewLength] = L'\0';
00524   return m_pchData;
00525 }
00526
00527 void CString::FreeExtra()
00528 {
00529   if (GetData()->nDataLength != GetData()->nAllocLength)
00530   {
00531     CStringData* pOldData = GetData();
00532     AllocBuffer(GetData()->nDataLength);
00533     memcpy(m_pchData, pOldData->data(), pOldData->nDataLength*sizeof(WCHAR));
00534     CString::Release(pOldData);
00535   }
00536 }
00537
00538 LPWSTR CString::LockBuffer()
00539 {
00540   LPWSTR lpsz = GetBuffer(0);
00541   GetData()->nRefs = -1;
00542   return lpsz;
00543 }
00544
00545 void CString::UnlockBuffer()
00546 {
00547   if (GetData() != _epDataNil)
00548     GetData()->nRefs = 1;
00549 }
00550 ///////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpPostSample/WinHttpPostSample.cpp Source File

  • Web
  • winhttp
  • WinHttpPostSample

WinHttpPostSample.cpp

Go to the documentation of this file.
00001 // WinHttpPostSample.cpp : Defines the entry point for the console application.
00002 //
00003 // Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005
00006 #include <tchar.h>
00007 #include <windows.h>
00008 #include <stdio.h>
00009 #include "winhttp.h"
00010
00011 #ifndef UNICODE
00012 #error This sample was written as a Unicode only application."
00013 #endif
00014
00015 BOOL WinHttpSamplePost( LPCWSTR szServerUrl, LPCWSTR szFile, LPCWSTR szProxyUrl);
00016
00017 class CQuickStringWrap
00018 {
00019     LPWSTR _szAlloc;
00020
00021 public:
00022     CQuickStringWrap()
00023     {
00024         _szAlloc = NULL;
00025     }
00026
00027     ~CQuickStringWrap()
00028     {
00029         if (_szAlloc != NULL)
00030             delete [] _szAlloc;
00031     }
00032
00033     operator LPCWSTR() const { return _szAlloc;}
00034
00035     BOOL Set(LPCWSTR szIn, DWORD dwLen)
00036     {
00037         LPWSTR szNew;
00038
00039         szNew = new WCHAR[dwLen+1];
00040
00041         if (szNew == NULL)
00042         {
00043             SetLastError( ERROR_OUTOFMEMORY);
00044             return FALSE;
00045         }
00046
00047         memcpy(szNew, szIn, dwLen*sizeof(WCHAR));
00048         szNew[dwLen] = L'\0';
00049
00050         if (_szAlloc != NULL)
00051             delete [] _szAlloc;
00052
00053         _szAlloc = szNew;
00054
00055         return TRUE;
00056     }
00057 };
00058
00059
00060 int _tmain(int argc, _TCHAR* argv[])
00061 {
00062     LPWSTR szServerUrl = argv[1];
00063     LPWSTR szFilename = argv[2];
00064     LPWSTR szProxyUrl = NULL;  // optional argv[3];
00065     URL_COMPONENTS urlComponents;
00066     BOOL fShowHelp = FALSE;
00067     DWORD dwTemp;
00068
00069     //
00070     //  Make sure we got three or four params
00071     //(the first is the executeable name, rest are user params)
00072     //
00073
00074     if (argc != 4)
00075     {
00076         if (argc == 3)
00077         {
00078             szProxyUrl = NULL;
00079         }
00080         else
00081         {
00082             fShowHelp = TRUE;
00083             goto done;
00084         }
00085     }
00086     else
00087     {
00088         szProxyUrl = argv[3];
00089     }
00090
00091     //
00092     //  Do some validation on the input URLs..
00093     //
00094
00095     memset(&urlComponents,0,sizeof(urlComponents));
00096     urlComponents.dwStructSize = sizeof(urlComponents);
00097     urlComponents.dwUserNameLength = 1;
00098     urlComponents.dwPasswordLength = 1;
00099     urlComponents.dwHostNameLength = 1;
00100     urlComponents.dwUrlPathLength = 1;
00101
00102     if( !WinHttpCrackUrl(szServerUrl, 0, 0, &urlComponents))
00103     {
00104         printf("\nThere was a problem with the Server URL %S.\n", szServerUrl);
00105         fShowHelp = TRUE;
00106         goto done;
00107     }
00108
00109     memset(&urlComponents,0,sizeof(urlComponents));
00110     urlComponents.dwStructSize = sizeof(urlComponents);
00111     urlComponents.dwUserNameLength = 1;
00112     urlComponents.dwPasswordLength = 1;
00113     urlComponents.dwHostNameLength = 1;
00114     urlComponents.dwUrlPathLength = 1;
00115
00116     if (szProxyUrl != NULL
00117         && (!WinHttpCrackUrl(szProxyUrl, 0, 0, &urlComponents)
00118             || urlComponents.dwUrlPathLength > 1
00119             || urlComponents.nScheme != INTERNET_SCHEME_HTTP))
00120     {
00121         printf("\nThere was a problem with the Proxy URL %S."
00122                "  It should be a http:// url, and should have"
00123                " an empty path.\n", szProxyUrl);
00124         fShowHelp = TRUE;
00125         goto done;
00126     }
00127
00128     //
00129     //  Make sure a file was passed in...
00130     //
00131
00132     if ((DWORD)-1 == GetFileAttributes(szFilename))
00133     {
00134         printf("\nThe specified file, \"%S\", was not found.\n", szFilename);
00135         fShowHelp = TRUE;
00136         goto done;
00137     }
00138
00139     if (!WinHttpSamplePost(szServerUrl, szFilename, szProxyUrl))
00140         goto done;
00141
00142     SetLastError(NO_ERROR);
00143
00144 done:
00145     dwTemp = GetLastError();
00146     if (dwTemp != NO_ERROR)
00147     {
00148         printf( "\nWinHttpPostSample failed with error code %i.", dwTemp);
00149     }
00150
00151     if (fShowHelp)
00152     {
00153         printf(
00154             "\n\n  Proper usage of this example is \"Post <url1> <filename> [url2]\",\n"
00155             "Where <url1> is the target HTTP URL and <filename> is the name of a file\n"
00156             "which will be POST'd to <url1>.  [url2] is optional and indicates the proxy\n"
00157             "to use.\n"
00158             "  Urls are of the form http://[username]:[password]@<server>[:port]/<path>.");
00159     }
00160
00161     printf("\n\n");
00162
00163     return 0;
00164 }
00165
00166
00167 BOOL GetFileHandleAndSize(LPWSTR szFilename, OUT HANDLE* pHandle, OUT DWORD* pdwSize)
00168 {
00169     BOOL returnValue = FALSE;
00170     HANDLE hFile = INVALID_HANDLE_VALUE;
00171     LARGE_INTEGER liSize;
00172     liSize.LowPart = 0;
00173     liSize.HighPart = 0;
00174
00175     hFile = CreateFile(szFilename, GENERIC_READ, FILE_SHARE_READ, NULL,
00176                        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
00177
00178     if (hFile == INVALID_HANDLE_VALUE)
00179         goto done;
00180
00181     if (!GetFileSizeEx(hFile, &liSize))
00182         goto done;
00183
00184     if (liSize.HighPart != 0
00185         || liSize.LowPart > 0x7FFFFFFF)
00186     {
00187         //  Lets not try to send anything larger than 2 gigs
00188         SetLastError(ERROR_OPEN_FAILED);
00189     }
00190
00191     returnValue = TRUE;
00192 done:
00193
00194     if (returnValue)
00195     {
00196         *pHandle = hFile;
00197         *pdwSize = liSize.LowPart;
00198         return TRUE;
00199     }
00200     else
00201     {
00202         if (hFile != INVALID_HANDLE_VALUE)
00203             CloseHandle(hFile);
00204
00205         return FALSE;
00206     }
00207 }
00208
00209
00210 DWORD ChooseAuthScheme( HINTERNET hRequest, DWORD dwSupportedSchemes)
00211 {
00212     //  It is the servers responsibility to only accept authentication schemes
00213     //which provide the level of security needed to protect the server's
00214     //resource.
00215     //  However the client has some obligation when picking an authentication
00216     //scheme to ensure it provides the level of security needed to protect
00217     //the client's username and password from being revealed.  The Basic authentication
00218     //scheme is risky because it sends the username and password across the
00219     //wire in a format anyone can read.  This is not an issue for SSL connections though.
00220
00221     if (dwSupportedSchemes & WINHTTP_AUTH_SCHEME_NEGOTIATE)
00222         return WINHTTP_AUTH_SCHEME_NEGOTIATE;
00223     else if (dwSupportedSchemes & WINHTTP_AUTH_SCHEME_NTLM)
00224         return WINHTTP_AUTH_SCHEME_NTLM;
00225     else if (dwSupportedSchemes & WINHTTP_AUTH_SCHEME_PASSPORT)
00226         return WINHTTP_AUTH_SCHEME_PASSPORT;
00227     else if (dwSupportedSchemes & WINHTTP_AUTH_SCHEME_DIGEST)
00228         return WINHTTP_AUTH_SCHEME_DIGEST;
00229     else if (dwSupportedSchemes & WINHTTP_AUTH_SCHEME_BASIC)
00230     {
00231         DWORD dwValue;
00232         DWORD dwSize = sizeof(dwValue);
00233         if (WinHttpQueryOption(hRequest, WINHTTP_OPTION_SECURITY_FLAGS, &dwValue,&dwSize)
00234             && (dwValue & SECURITY_FLAG_SECURE))
00235         {
00236             return WINHTTP_AUTH_SCHEME_BASIC;
00237         }
00238         else
00239             return 0;
00240     }
00241     else
00242         return 0;
00243 }
00244
00245
00246 BOOL WinHttpSamplePost( LPCWSTR szServerUrl, LPCWSTR szFile, LPCWSTR szProxyUrl)
00247 {
00248     BOOL returnValue = FALSE;
00249     DWORD dwTemp;
00250
00251     URL_COMPONENTS urlServerComponents;
00252     URL_COMPONENTS urlProxyComponents;
00253     CQuickStringWrap strTargetServer;
00254     CQuickStringWrap strTargetPath;
00255     CQuickStringWrap strTargetUsername;
00256     CQuickStringWrap strTargetPassword;
00257     CQuickStringWrap strProxyServer;
00258     CQuickStringWrap strProxyUsername;
00259     CQuickStringWrap strProxyPassword;
00260
00261     HANDLE hFile = INVALID_HANDLE_VALUE;
00262     DWORD dwFileSize;
00263
00264     HINTERNET hSession = NULL, hConnect = NULL, hRequest = NULL;
00265     DWORD dwProxyAuthScheme = 0;
00266     DWORD dwStatusCode = 0;
00267
00268     if (!GetFileHandleAndSize((LPWSTR)szFile, &hFile, &dwFileSize))
00269         goto done;
00270
00271     //
00272     //  Its a long but straightforward chunk of code below that
00273     //splits szServerUrl and szProxyUrl into the various
00274     //strTarget*,strProxy* components.  They need to be put
00275     //into the separate str* variables so that they are individually
00276     //NULL-terminated.
00277     //
00278
00279     //  From the server URL, we need a host, path, username and password.
00280     memset (&urlServerComponents, 0, sizeof(urlServerComponents));
00281     urlServerComponents.dwStructSize = sizeof(urlServerComponents);
00282     urlServerComponents.dwHostNameLength = 1;
00283     urlServerComponents.dwUrlPathLength = 1;
00284     urlServerComponents.dwUserNameLength = 1;
00285     urlServerComponents.dwPasswordLength = 1;
00286
00287     if (!WinHttpCrackUrl(szServerUrl, 0, 0, &urlServerComponents))
00288         goto done;
00289
00290     //
00291     //  An earlier version of WinHttp v5.1 has a bug where it misreports
00292     //the length of the username or password if they are not present.
00293     //
00294
00295     if (urlServerComponents.lpszUserName == NULL)
00296         urlServerComponents.dwUserNameLength = 0;
00297
00298     if (urlServerComponents.lpszPassword == NULL)
00299         urlServerComponents.dwPasswordLength = 0;
00300
00301     if (!strTargetServer.Set(urlServerComponents.lpszHostName, urlServerComponents.dwHostNameLength)
00302         || !strTargetPath.Set(urlServerComponents.lpszUrlPath, urlServerComponents.dwUrlPathLength))
00303     {
00304         goto done;
00305     }
00306
00307     //  for the username and password, if they are empty, leave the string pointers as NULL.
00308     //  This allows for the current process's default credentials to be used.
00309     if (urlServerComponents.dwUserNameLength != 0
00310         && !strTargetUsername.Set(urlServerComponents.lpszUserName,
00311                                   urlServerComponents.dwUserNameLength))
00312     {
00313         goto done;
00314     }
00315
00316     if (urlServerComponents.dwPasswordLength != 0
00317         && !strTargetPassword.Set(urlServerComponents.lpszPassword,
00318                                   urlServerComponents.dwPasswordLength))
00319     {
00320         goto done;
00321     }
00322
00323     if (szProxyUrl != NULL)
00324     {
00325         //  From the proxy URL, we need a host, username and password.
00326         memset (&urlProxyComponents, 0, sizeof(urlProxyComponents));
00327         urlProxyComponents.dwStructSize = sizeof(urlProxyComponents);
00328         urlProxyComponents.dwHostNameLength = 1;
00329         urlProxyComponents.dwUserNameLength = 1;
00330         urlProxyComponents.dwPasswordLength = 1;
00331
00332         if (!WinHttpCrackUrl(szProxyUrl, 0, 0, &urlProxyComponents))
00333             goto done;
00334
00335         //
00336         //  An earlier version of WinHttp v5.1 has a bug where it misreports
00337         //the length of the username or password if they are not present.
00338         //
00339
00340         if (urlProxyComponents.lpszUserName == NULL)
00341             urlProxyComponents.dwUserNameLength = 0;
00342
00343         if (urlProxyComponents.lpszPassword == NULL)
00344             urlProxyComponents.dwPasswordLength = 0;
00345
00346         //  We do something tricky here, taking from the host beginning
00347         //to the beginning of the path as the strProxyServer.  What this
00348         //does, is if you have urls like "http://proxy","http://proxy/",
00349         //"http://proxy:8080" is copy them as "proxy","proxy","proxy:8080"
00350         //respectively.  This makes the port available for WinHttpOpen.
00351         if (urlProxyComponents.lpszUrlPath == NULL)
00352         {
00353             urlProxyComponents.lpszUrlPath = wcschr(urlProxyComponents.lpszHostName, L'/');
00354             if(urlProxyComponents.lpszUrlPath == NULL)
00355             {
00356                 urlProxyComponents.lpszUrlPath = urlProxyComponents.lpszHostName
00357                                          + wcslen(urlProxyComponents.lpszHostName);
00358             }
00359         }
00360         if (!strProxyServer.Set(urlProxyComponents.lpszHostName,
00361             (DWORD)(urlProxyComponents.lpszUrlPath - urlProxyComponents.lpszHostName)))
00362         {
00363             goto done;
00364         }
00365
00366         //  for the username and password, if they are empty, leave the string pointers as NULL.
00367         //  This allows for the current process's default credentials to be used.
00368         if (urlProxyComponents.dwUserNameLength != 0
00369             && !strProxyUsername.Set(urlProxyComponents.lpszUserName,
00370                                      urlProxyComponents.dwUserNameLength))
00371         {
00372             goto done;
00373         }
00374
00375         if (urlProxyComponents.dwPasswordLength != 0
00376             && !strProxyPassword.Set(urlProxyComponents.lpszPassword,
00377                                      urlProxyComponents.dwPasswordLength))
00378         {
00379             goto done;
00380         }
00381     }
00382
00383
00384     //
00385     //  whew, now we can go on and start the request.
00386     //
00387
00388     //
00389     //  Open a WinHttp session using the specified proxy
00390     //
00391     if (szProxyUrl != NULL)
00392     {
00393         hSession = WinHttpOpen(L"WinHttpPostSample",WINHTTP_ACCESS_TYPE_NAMED_PROXY,
00394                                strProxyServer, L"<local>", 0);
00395     }
00396     else
00397     {
00398         hSession = WinHttpOpen(L"WinHttpPostSample",WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
00399                                NULL,NULL,0);
00400     }
00401
00402     if (hSession == NULL)
00403        goto done;
00404
00405     //
00406     //  Open a connection to the target server
00407     //
00408     hConnect = WinHttpConnect( hSession, strTargetServer, urlServerComponents.nPort, 0);
00409
00410     if (hConnect == NULL)
00411         goto done;
00412
00413     //
00414     //  Open the request
00415     //
00416     hRequest = WinHttpOpenRequest(hConnect, L"POST", strTargetPath, NULL, NULL, NULL,
00417                 urlServerComponents.nScheme == INTERNET_SCHEME_HTTPS ? WINHTTP_FLAG_SECURE : 0);
00418
00419     if (hRequest == NULL)
00420         goto done;
00421
00422     //
00423     //  Send the request.
00424     //
00425     //  This is done in a loop so that authentication challenges can be handled.
00426     //
00427     BOOL bDone;
00428     DWORD dwLastStatusCode = 0;
00429     bDone = FALSE;
00430     while (!bDone)
00431     {
00432         //  If a proxy auth challenge was responded to, reset those credentials
00433         //before each SendRequest.  This is done because after responding to a 401
00434         //or perhaps a redirect the proxy may require re-authentication.  You
00435         //could get into a 407,401,407,401,etc loop otherwise.
00436         if (dwProxyAuthScheme != 0)
00437         {
00438             if( !WinHttpSetCredentials( hRequest, WINHTTP_AUTH_TARGET_PROXY,
00439                                         dwProxyAuthScheme, strProxyUsername,
00440                                         strProxyPassword, NULL))
00441             {
00442                 goto done;
00443             }
00444         }
00445         // Send a request.
00446
00447         if (!WinHttpSendRequest( hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0,
00448                                  NULL, 0, dwFileSize, 0))
00449         {
00450             goto done;
00451         }
00452
00453         //
00454         //  Now we send the contents of the file.  We may have to redo this
00455         //after an auth challenge, and so we will reset the file position
00456         //to the beginning on each loop.
00457         //
00458         if(INVALID_SET_FILE_POINTER == SetFilePointer(hFile,0,NULL,FILE_BEGIN))
00459             goto done;
00460
00461         //  Load the file 4k at a time and write it.  fwFileLeft will track
00462         //how much more needs to be written.
00463         DWORD dwFileLeft;
00464         dwFileLeft = dwFileSize;
00465         while(dwFileLeft > 0)
00466         {
00467             DWORD dwBytesRead;
00468             BYTE buffer[4096];
00469
00470             if (!ReadFile(hFile, buffer, sizeof(buffer), &dwBytesRead, NULL))
00471                 goto done;
00472
00473             if (dwBytesRead == 0)
00474             {
00475                 dwFileLeft = 0;
00476                 continue;
00477             }
00478             else if (dwBytesRead > dwFileLeft)
00479             {
00480                 // unexpectedly read more from the file than we expected to find.. bail out
00481                 goto done;
00482             }
00483             else
00484                 dwFileLeft -= dwBytesRead;
00485
00486             if (!WinHttpWriteData(hRequest, buffer, dwBytesRead, &dwBytesRead))
00487                 goto done;
00488         }
00489
00490         // End the request.
00491         if (!WinHttpReceiveResponse( hRequest, NULL))
00492         {
00493             //  There is a special error we can get here indicating we need to try again
00494             if (GetLastError() == ERROR_WINHTTP_RESEND_REQUEST)
00495                 continue;
00496             else
00497                 goto done;
00498         }
00499
00500         // Check the status code.
00501         dwTemp = sizeof(dwStatusCode);
00502         if (!WinHttpQueryHeaders( hRequest,
00503                         WINHTTP_QUERY_STATUS_CODE| WINHTTP_QUERY_FLAG_NUMBER,
00504                         NULL, &dwStatusCode, &dwTemp, NULL))
00505         {
00506             goto done;
00507         }
00508
00509         DWORD dwSupportedSchemes, dwFirstScheme, dwTarget, dwSelectedScheme;
00510         switch (dwStatusCode)
00511         {
00512         case 200:
00513             // The resource was successfully retrieved.
00514             // You could use WinHttpReadData to read the contents of the server's response.
00515             printf("\nThe POST was successfully completed.");
00516             bDone = TRUE;
00517             break;
00518         case 401:
00519             // The server requires authentication.
00520             printf("\nThe server requires authentication.  Sending credentials...");
00521
00522             // Obtain the supported and preferred schemes.
00523             if( !WinHttpQueryAuthSchemes(hRequest, &dwSupportedSchemes, &dwFirstScheme, &dwTarget))
00524                 goto done;
00525
00526             // Set the credentials before resending the request.
00527             dwSelectedScheme = ChooseAuthScheme(hRequest, dwSupportedSchemes);
00528
00529             if (dwSelectedScheme == 0)
00530             {
00531                 bDone = TRUE;
00532             }
00533             else
00534             {
00535                 if (!WinHttpSetCredentials( hRequest, dwTarget, dwSelectedScheme,
00536                                             strTargetUsername, strTargetPassword, NULL))
00537                 {
00538                     goto done;
00539                 }
00540             }
00541
00542             // If the same credentials are requested twice, abort the
00543             // request.  For simplicity, this sample does not check for
00544             // a repeated sequence of status codes.
00545             if (dwLastStatusCode==401)
00546             {
00547                 printf("\nServer Authentication failed.");
00548                 bDone = TRUE;
00549             }
00550
00551             break;
00552         case 407:
00553             // The proxy requires authentication.
00554             printf("\nThe proxy requires authentication.  Sending credentials...");
00555
00556             // Obtain the supported and preferred schemes.
00557             if (!WinHttpQueryAuthSchemes( hRequest, &dwSupportedSchemes, &dwFirstScheme, &dwTarget))
00558                 goto done;
00559
00560             // Set the credentials before resending the request.
00561             dwProxyAuthScheme = ChooseAuthScheme(hRequest, dwSupportedSchemes);
00562
00563             // If the same credentials are requested twice, abort the
00564             // request.  For simplicity, this sample does not check for
00565             // a repeated sequence of status codes.
00566             if (dwLastStatusCode==407)
00567             {
00568                 printf("\nProxy Authentication failed.");
00569                 bDone = TRUE;
00570             }
00571             break;
00572         default:
00573             // The status code does not indicate success.
00574             printf("\nStatus code %d returned.\n", dwStatusCode);
00575             bDone = TRUE;
00576         }
00577
00578         // Keep track of the last status code.
00579         dwLastStatusCode = dwStatusCode;
00580     }
00581
00582     returnValue = TRUE;
00583
00584 done:
00585     dwTemp = GetLastError();
00586
00587     if (hRequest != NULL)
00588         WinHttpCloseHandle(hRequest);
00589
00590     if (hConnect != NULL)
00591         WinHttpCloseHandle(hConnect);
00592
00593     if (hSession != NULL)
00594         WinHttpCloseHandle(hSession);
00595
00596     if (hFile != INVALID_HANDLE_VALUE)
00597         CloseHandle(INVALID_HANDLE_VALUE);
00598
00599     SetLastError(dwTemp);
00600
00601     return returnValue;
00602 }
00603
00604
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CWbemClientApp Member List

This is the complete list of members for CWbemClientApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CWbemClientApp() | CWbemClientApp |
CWinApp() | CWinApp |
ExitInstance() | CWinApp | [virtual]
InitInstance() | CWbemClientApp | [virtual]
InitSecurity() | CWbemClientApp |
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:57:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/EdGlyphs.idl Source File

  • Web
  • Browser
  • EditGlyphs

EdGlyphs.idl

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // EdGlyphs.idl : IDL source for EdGlyphs.dll
00006 //
00007
00008 // This file will be processed by the MIDL tool to
00009 // produce the type library (EdGlyphs.tlb) and marshalling code.
00010 #define DISPID_GETHWND   500
00011
00012 import "oaidl.idl";
00013 import "ocidl.idl";
00014
00015   [
00016     object,
00017     uuid(5FD6158A-71F6-4F20-B8A9-6EAF5D032D15),
00018     dual,
00019     helpstring("IBrowserHost Interface"),
00020     pointer_default(unique)
00021   ]
00022   interface IBrowserHost : IDispatch
00023   {
00024     HRESULT Run();
00025     HRESULT Stop();
00026     [id(DISPID_GETHWND), helpstring("method GetHWND")] HRESULT GetHwnd(long* phwnd);
00027   };
00028   [
00029     object,
00030     uuid(CCBFDE40-FE5D-4A3C-880B-47839715E3AC),
00031     dual,
00032     helpstring("ISnap Interface"),
00033     pointer_default(unique)
00034   ]
00035   interface ISnap : IDispatch
00036   {
00037     HRESULT GetSnapOn(LONG* lIsOn);
00038     HRESULT SetSnapOn(LONG lIsOn);
00039   };
00040
00041 [
00042   uuid(77562D86-6956-4863-AA6D-2646344624EE),
00043   version(1.0),
00044   helpstring("EdGlyphs 1.0 Type Library")
00045 ]
00046 library EDGLYPHSLib
00047 {
00048   importlib("stdole32.tlb");
00049   importlib("stdole2.tlb");
00050
00051   [
00052     uuid(2A2B21D5-F43B-4EA0-9DFA-1EFE9F9E211A),
00053     helpstring("BrowserHost Class")
00054   ]
00055   coclass BrowserHost
00056   {
00057     [default] interface IBrowserHost;
00058   };
00059 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Server/BYOTTxEnlister/Resource.h Source File

  • Com
  • Services
  • BYOT
  • Server
  • BYOTTxEnlister

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by TxEnlister.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_ENLISTTRANSACTION           101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/extbuff.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

extbuff.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module EXTBUFF.CPP | This class provides an array-based access to
00008 // a big block of memory. You pass in the fixed size of each element
00009 // to the constructor. Get (read)  an element with GetItemOfExtBuffer.
00010 // Set (write) an element with InsertIntoExtBuffer.
00011 // You must also pass in the system page size (found with GetSystemInfo).
00012 // 'hItem' is the index into the array, beginning with 1.
00013 // The array always contains m_cItem elements.
00014 //
00015 // GetItemOfExtBuffer returns element hItem, where hItem=1 is the first element.
00016 // (Copies block to caller's memory.)
00017 //
00018 // InsertIntoExtBuffer always appends elements to the tail of the array,
00019 // and returns the index of the newly appended element.
00020 // (So adding first element will return 1.)
00021 //
00022 //
00023 #include "headers.h"
00024 #include "extbuff.h"
00025
00026
00027 //--------------------------------------------------------------------
00028 // @mfunc Constructor for this class
00029 //
00030 // @rdesc NONE
00031 //
00032 CExtBuffer::CExtBuffer
00033     (
00034     void
00035     )
00036 {
00037     m_cItem   = 0;
00038     m_cbAlloc = 0;
00039     m_rgItem  = NULL;
00040 }
00041
00042
00043 //--------------------------------------------------------------------
00044 // @mfunc Destructor for this class
00045 //
00046 // @rdesc NONE
00047 //
00048 CExtBuffer:: ~CExtBuffer
00049     (
00050     void
00051     )
00052 {
00053     if (m_cbAlloc)
00054         VirtualFree((VOID *) m_rgItem, m_cbAlloc, MEM_DECOMMIT );
00055
00056     if (m_rgItem)
00057         VirtualFree((VOID *) m_rgItem, 0, MEM_RELEASE );
00058 }
00059
00060
00061 //--------------------------------------------------------------------
00062 // @mfunc Allocate and Initialize Buffer
00063 //
00064 // @rdesc HRESULT indicating routines status
00065 //      @flag  S_OK | Initialization succeeded
00066 //      @flag  E_OUTOFMEMORY | Not enough memory to allocate buffer
00067 //
00068 STDMETHODIMP CExtBuffer::FInit
00069     (
00070     ULONG cItemMax,     //@parm IN | Maximum number of items ever
00071     ULONG cbItem,       //@parm IN | Size of each item, in bytes
00072     ULONG cbPage        //@parm IN | Size of system page size (from SysInfo)
00073     )
00074 {
00075     BYTE  *pb;
00076
00077     m_cbReserved = ((cbItem *cItemMax) / cbPage + 1) *cbPage;
00078     m_rgItem = (BYTE *) VirtualAlloc( NULL, m_cbReserved, MEM_RESERVE, PAGE_READWRITE );
00079
00080     if (m_rgItem == NULL)
00081         return ResultFromScode( E_OUTOFMEMORY );
00082
00083     m_cbItem  = cbItem;
00084     m_dbAlloc = (cbItem / cbPage + 1) *cbPage;
00085     pb = (BYTE *) VirtualAlloc( m_rgItem, m_dbAlloc, MEM_COMMIT, PAGE_READWRITE );
00086     if (pb == NULL)
00087         {
00088         VirtualFree((VOID *) m_rgItem, 0, MEM_RELEASE );
00089         m_rgItem = NULL;
00090         return ResultFromScode( E_OUTOFMEMORY );
00091         }
00092
00093     m_cbAlloc = m_dbAlloc;
00094     return ResultFromScode( S_OK );
00095 }
00096
00097
00098 //--------------------------------------------------------------------
00099 // @mfunc Retrieves a pointer to the value at given index
00100 //
00101 // @rdesc If index is within the range of 1 to m_cItems then a valid
00102 // pointer is returned, else NULL is returned.
00103 //
00104 void* CExtBuffer::operator[]
00105     (
00106     DBCOUNTITEM hItem          //@parm IN | Index of element in buffer
00107     )
00108 {
00109     // Return ptr to element [n], where n = 1...m_cItem.
00110     // Returns NULL if 'n' is out of range.
00111     //
00112     // You must use InsertIntoExtBuffer to add new elements.
00113     // Thereafter you can use this operator to retrieve the address of the item.
00114     // (You can't delete an element, but you can overwrite its space.)
00115
00116     if (1 <= hItem && hItem <= m_cItem)
00117         return m_rgItem + (hItem - 1) *m_cbItem;
00118     else
00119         return NULL;
00120 }
00121
00122
00123 //--------------------------------------------------------------------
00124 // @mfunc Add Data to the fixed buffers and return the index it was
00125 // added at.
00126 //
00127 // @rdesc HRESULT indicating routines status
00128 //      @flag  S_OK | Data copied successfully
00129 //      @flag  E_OUTOFMEMORY | Not enough memory to allocate buffer
00130 //
00131 STDMETHODIMP CExtBuffer::InsertIntoExtBuffer
00132     (
00133     VOID* pvItem,       //@parm IN | Pointer to buffer to copy
00134     HACCESSOR &hItem    //@parm OUT | Index of where data was placed
00135     )
00136 {
00137     ULONG cbOffset;
00138
00139     cbOffset = m_cItem*m_cbItem;
00140     if ((cbOffset + m_cbItem) > m_cbAlloc)
00141         {
00142         BYTE *pb;
00143
00144         if ((m_cbAlloc + m_dbAlloc) > m_cbReserved)
00145             pb = NULL;
00146         else
00147             pb = (BYTE *) VirtualAlloc( m_rgItem + m_cbAlloc,
00148                                         m_dbAlloc,
00149                                         MEM_COMMIT,
00150                                         PAGE_READWRITE );
00151         if (pb == NULL)
00152             {
00153             return ResultFromScode( E_OUTOFMEMORY );
00154             }
00155         m_cbAlloc += m_dbAlloc;
00156         }
00157
00158     memcpy((m_rgItem + cbOffset), (BYTE *) pvItem, m_cbItem );
00159     m_cItem++;
00160     hItem = m_cItem;
00161
00162     return ResultFromScode( S_OK );
00163 }
00164
00165
00166
00167 //--------------------------------------------------------------------
00168 // @mfunc Obtain a pointer to the data at a given index into the buffer
00169 //
00170 // @rdesc HRESULT indicating routines status
00171 //      @flag  S_OK | pvItem contains a pointer to the data requested
00172 //      @flag  E_INVALIDARG | Invalid Index passed in
00173 //
00174 STDMETHODIMP CExtBuffer::GetItemOfExtBuffer
00175     (
00176     HACCESSOR hItem,        //@parm IN | Index of item to get
00177     VOID*     pvItem        //@parm OUT | Pointer to block at index
00178     )
00179 {
00180     if ((hItem > m_cItem) || (hItem == 0) ) {
00181         *((PACCESSOR *)pvItem) = NULL;
00182     return ResultFromScode( DB_E_BADACCESSORHANDLE );
00183   }
00184
00185     memcpy((BYTE *) pvItem, (m_rgItem + (hItem - 1) *m_cbItem), m_cbItem );
00186     return ResultFromScode( S_OK );
00187 }
00188
00189
00190 //--------------------------------------------------------------------
00191 // @mfunc Get the extents of the currently allocated buffers
00192 //
00193 // @rdesc HRESULT indicating routines status
00194 //      @flag  S_OK | Extents were obtained successfuly
00195 //
00196 STDMETHODIMP CExtBuffer::GetFirstLastItemH
00197     (
00198     HACCESSOR &hItemFirst,      //@parm OUT | First item allocated
00199     HACCESSOR &hItemLast        //@parm OUT | Last item allocated
00200     )
00201 {
00202     hItemFirst = 1;
00203     hItemLast  = m_cItem;
00204     return ResultFromScode( S_OK );
00205 }
00206
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/addvfiledlg.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

addvfiledlg.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  AddVFileDlg.cpp:  Implementation of the CAddVFileDlg class.
00015 //
00016
00017
00018
00019 #include "AddVFileDlg.h"
00020 #include "Globals.h"
00021 #include "Resource.h"        // Control IDs
00022 #include "BaseNode.h"        // NODE_PROPERTIES struct
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //  Construction-Destruction
00026
00027 //---------------------------------------------------------------------------
00028 //
00029 CAddVFileDlg::CAddVFileDlg( ULONG nTemplate, HWND pParentWnd )
00030              : CBaseDialog( nTemplate )
00031 {
00032   _ASSERT( NULL != pParentWnd );
00033   m_hParentWnd = pParentWnd;
00034
00035 }
00036
00037 CAddVFileDlg::~CAddVFileDlg()
00038 {
00039 }
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 //  Message handlers
00043
00044
00045 //---------------------------------------------------------------------------
00046 LRESULT CAddVFileDlg::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
00047 {
00048   LRESULT lResult = 0;
00049
00050   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00051   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00052   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_LOCKED_ATTR   );
00053   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00054   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00055
00056   lResult = SendMessage( hArchiveCtrl,  BM_SETCHECK, BST_UNCHECKED, 0 );
00057   lResult = SendMessage( hHiddenCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00058   lResult = SendMessage( hLockedCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00059   lResult = SendMessage( hReadOnlyCtrl, BM_SETCHECK, BST_UNCHECKED, 0 );
00060
00061   lResult = SetWindowText( hDevNameCtrl, _T("") );
00062   SetFocus( hDevNameCtrl );
00063
00064   return 0;
00065 }
00066
00067 //---------------------------------------------------------------------------
00068 LRESULT CAddVFileDlg::OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam )
00069 {
00070   LRESULT          lResult = 0;
00071   NODE_PROPERTIES  NodeProps;
00072
00073   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00074
00075   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00076   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00077   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_LOCKED_ATTR   );
00078   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00079   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00080
00081   if( BST_CHECKED == SendMessage( hArchiveCtrl, BM_GETCHECK, 0, 0 ) )
00082     NodeProps.dwAttributes |= ATTRIBUTE_DATA_ARCHIVE;
00083
00084   if( BST_CHECKED == SendMessage( hHiddenCtrl, BM_GETCHECK, 0, 0 ) )
00085     NodeProps.dwAttributes |= ATTRIBUTE_DATA_HIDDEN;
00086
00087   if( BST_CHECKED == SendMessage( hLockedCtrl, BM_GETCHECK, 0, 0 ) )
00088     NodeProps.dwAttributes |= ATTRIBUTE_DATA_LOCKED;
00089
00090   if( BST_CHECKED == SendMessage( hReadOnlyCtrl, BM_GETCHECK, 0, 0 ) )
00091     NodeProps.dwAttributes |= ATTRIBUTE_DATA_READONLY;
00092
00093
00094   // Convert to wide characters here for all platforms.  This is the node name
00095   TCHAR szBuff[ MAX_NAME_LEN ] = {0};
00096   GetWindowText( hDevNameCtrl, szBuff, MAX_NAME_LEN );
00097   CopyT2W( NodeProps.szNodeName, szBuff, MAX_NAME_LEN);
00098   // Probably a good idea to check for NULL name strings here
00099
00100   // This message passes the user supplied info to the Static Node
00101   SendMessage( m_hParentWnd, WM_ADD_VIRTUALFILE, (WPARAM)&NodeProps, 0 );
00102
00103   // Now tell the static node we are deleting ourselves so the
00104   // context menu option can be enabled
00105   SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00106
00107   // Call the base class to shut down the dialog
00108   CBaseDialog::OnOK( hDlg, wParam, lParam );
00109   return 0;
00110 }
00111
00112 /////////////////////////////////////////////////////////////////////////////
00113 //  Virtual function implementations
00114
00115 //---------------------------------------------------------------------------
00116 BOOL CAddVFileDlg::ProcessMessage
00117 (
00118   HWND     hDlg,           //[in] Handle to dialog box
00119   UINT     uMsg,           //[in] Message
00120   WPARAM   wParam,         //[in] First message parameter
00121   LPARAM   lParam          //[in] Second message parameter
00122 )
00123 {
00124   LRESULT lResult = 0;
00125
00126   switch( uMsg )
00127   {
00128     case WM_INITDIALOG:
00129       lResult = OnInitDialog( hDlg, wParam, lParam );
00130       break;
00131
00132     case WM_DESTROY:
00133       lResult = OnDestroy( hDlg, wParam, lParam );
00134       break;
00135
00136     case WM_NCDESTROY:
00137       lResult = OnNcDestroy( hDlg, wParam, lParam );
00138       break;
00139
00140     case WM_CLOSE:
00141       // Not overriding WM_CLOSE and IDCANCEL so we must send
00142       // WM_DEVICENODE_CLOSED before calling the base class or else
00143       // the context menu will stay grayed
00144       SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00145       lResult = OnClose( hDlg, wParam, lParam );
00146       break;
00147
00148     case WM_COMMAND:
00149       switch( wParam )
00150       {
00151         case IDOK:
00152           lResult = OnOK( hDlg, wParam, lParam );
00153           break;
00154
00155         case IDCANCEL:
00156           SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00157           lResult = OnCancel( hDlg, wParam, lParam );
00158           break;
00159
00160         default:
00161           break;
00162       }
00163     default:
00164       break;
00165   }
00166   return (BOOL)lResult;
00167 }
00168
00169
00170
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampclnt/sampclnt.h Source File

  • Dataaccess
  • oledb
  • sampclnt

sampclnt.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Consumer
00003 // (C) Copyright 1991 - 2000 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // File name: SAMPCLNT.H
00006 //
00007 //      Declaration file for a simple OLE DB consumer.
00008 //
00009 //      See OLE DB SDK Guide for information on building and running
00010 //    this sample, as well as notes concerning the implementation of
00011 //    a simple OLE DB consumer.
00012 //
00013
00014
00015 #define WIN32_LEAN_AND_MEAN   // avoid the world
00016 #define INC_OLE2        // tell windows.h to always include ole2.h
00017
00018 #include <windows.h>      //
00019 #include <ole2ver.h>      // OLE2.0 build version
00020 #include <cguid.h>        // GUID_NULL
00021 #include <stdio.h>        // vsnprintf, etc.
00022 #include <stddef.h>       // offsetof
00023 #include <stdarg.h>       // va_arg
00024 #include <time.h>       // time
00025 #include <assert.h>       // assert
00026 #include <conio.h>        // _getch()
00027
00028 //  OLE DB headers
00029 #include <oledb.h>
00030 #include <oledberr.h>
00031
00032
00033 //-----------------------------------
00034 //  constants
00035 //------------------------------------
00036
00037 // Alignment for placement of each column within memory.
00038 // Rule of thumb is "natural" boundary, i.e. 4-byte member should be
00039 // aligned on address that is multiple of 4.
00040 // Worst case is double or __int64 (8 bytes).
00041 #define COLUMN_ALIGNVAL 8
00042
00043 #define MAX_GUID_STRING     42  // size of a GUID, in characters
00044 #define MAX_NAME_STRING     60  // size of DBCOLOD name or propid string
00045 #define MAX_BINDINGS       100  // size of binding array
00046 #define NUMROWS_CHUNK       20  // number of rows to grab at a time
00047 #define DEFAULT_CBMAXLENGTH 40  // cbMaxLength for binding
00048
00049
00050 // for pretty printing
00051 #define PRETTYPRINT_MAXTOTALWIDTH 200     // max entire width of printed row
00052 #define PRETTYPRINT_MINCOLWIDTH     6        // min width of printed column
00053
00054
00055
00056 //-----------------------------------
00057 //  macros
00058 //------------------------------------
00059
00060
00061 // Rounding amount is always a power of two.
00062 #define ROUND_UP(   Size, Amount ) (((DWORD)(Size) +  ((Amount) - 1)) & ~((Amount) - 1))
00063
00064 #ifndef  NUMELEM
00065 # define NUMELEM(p) (sizeof(p)/sizeof(*p))
00066 #endif
00067
00068 // usage: DUMPLINE();
00069 #define DUMP_ERROR_LINENUMBER() DumpErrorMsg("Error at file: %s  line: %u  \n", __FILE__, __LINE__)
00070
00071
00072
00073 //-----------------------------------
00074 //  type and structure definitions
00075 //------------------------------------
00076
00077 // How to lay out each column in memory.
00078 // Issue? we depend on the dwLength field being first in memory (see assert)
00079 // is there another way to handle this?
00080 struct COLUMNDATA
00081   {
00082   DWORD   dwLength; // length of data (not space allocated)
00083   DWORD   dwStatus; // status of column
00084   BYTE    bData[1]; // data here and beyond
00085   };
00086
00087
00088 // Lists of value/string pairs.
00089 typedef struct {
00090   DWORD dwFlag;
00091   char *szText;
00092 } Note;
00093
00094 #define NOTE(s) { (DWORD) s, #s }
00095
00096
00097
00098
00099 //-----------------------------------
00100 //  global variables and functions that are private to the file
00101 //------------------------------------
00102
00103
00104 DEFINE_GUID(CLSID_SampProv, 0xE8CCCB79L,0x7C36,0x101B,0xAC,0x3A,0x00,0xAA,0x00,0x44,0x77,0x3D);
00105 DEFINE_GUID(DBINIT_OPT_SAMPPROV_PATH, 0xe9fbaf50, 0xd402, 0x11ce, 0xbe, 0xdc, 0x0, 0xaa, 0x0, 0xa1, 0x4d, 0x7d);
00106
00107 extern IMalloc* g_pIMalloc;
00108 extern FILE*    g_fpLogFile;
00109
00110
00111
00112
00113
00114
00115 // function prototypes, sampclnt.cpp
00116
00117 void main();
00118
00119 HRESULT DoTests();
00120
00121
00122 HRESULT GetSampprovDataSource
00123   (
00124   IDBInitialize** ppIDBInitialize_out
00125   );
00126
00127
00128 HRESULT GetDBSessionFromDataSource
00129     (
00130     IDBInitialize*      pIDBInitialize,
00131     IOpenRowset**       ppIOpenRowset_out
00132     );
00133
00134
00135 HRESULT GetRowsetFromDBSession
00136     (
00137     IOpenRowset*   pIOpenRowset,
00138     LPWSTR         pwszTableName,
00139     IRowset**      ppIRowset_out
00140     );
00141
00142
00143 HRESULT GetDataFromRowset
00144   (
00145   IRowset*  pIRowset
00146   );
00147
00148
00149 HRESULT GetColumnsInfo
00150   (
00151   IRowset*    pIRowset,
00152   ULONG*      pcCol_out,
00153   DBCOLUMNINFO**  ppColumnInfo_out,
00154   WCHAR**     ppStringsBuffer_out
00155   );
00156
00157
00158 HRESULT SetupBindings
00159   (
00160   ULONG       cCol,
00161   DBCOLUMNINFO* pColumnInfo,
00162   DBBINDING*    rgBind_out,
00163   ULONG*      cBind_out,
00164     ULONG*          pcMaxRowSize_out
00165   );
00166
00167
00168 HRESULT CreateAccessor
00169   (
00170   IRowset*  pIRowset,
00171   DBBINDING*  rgBind,
00172   ULONG   cBind,
00173   HACCESSOR*  phAccessor_out
00174   );
00175
00176
00177 HRESULT GetData
00178   (
00179   IRowset*  pIRowset,
00180   ULONG     cMaxRowSize,
00181     HACCESSOR hAccessor,
00182     DBBINDING*      rgBind,     // needed for pretty printing
00183     ULONG       cBind,        // for pretty printing
00184     DBCOLUMNINFO* pColumnInfo,  // for pretty printing
00185     ULONG     cCol      // for pretty printing
00186   );
00187
00188
00189 HRESULT CleanupRowset
00190   (
00191   IRowset*  pIRowset,
00192   HACCESSOR   hAccessor
00193   );
00194
00195
00196
00197 // function prototypes, dump.cpp
00198
00199 void DumpErrorMsg
00200   (
00201     const char* format,
00202     ...
00203   );
00204
00205
00206 void DumpStatusMsg
00207   (
00208     const char* format,
00209     ...
00210   );
00211
00212
00213 HRESULT DumpErrorHResult
00214   (
00215   HRESULT      hr_return,
00216   const char  *format,
00217   ...
00218   );
00219
00220
00221 void DumpColumnsInfo
00222   (
00223     DBCOLUMNINFO* pColInfo,
00224     ULONG       cCol
00225     );
00226
00227
00228
00229 void WriteColumnInfo
00230   (
00231   FILE*     fp,
00232   DBCOLUMNINFO* p
00233   );
00234
00235
00236 char* GetNoteString
00237     (
00238   Note * rgNote,
00239   int    cNote,
00240   DWORD  dwValue
00241   );
00242
00243
00244
00245 char* GetNoteStringBitvals
00246   (
00247   Note*   rgNote,
00248   int     cNote,
00249   DWORD   dwValue
00250   );
00251
00252
00253 ULONG CalcPrettyPrintMaxColWidth
00254     (
00255     DBBINDING*  rgBind,
00256     ULONG       cBind
00257     );
00258
00259
00260 void DumpColumnHeadings
00261   (
00262   DBBINDING*    rgBind,
00263   ULONG     cBind,
00264   DBCOLUMNINFO*   pColInfo,
00265   ULONG     cCol,
00266     ULONG     cMaxColWidth
00267   );
00268
00269
00270 WCHAR* LookupColumnName
00271   (
00272   DBCOLUMNINFO* rgColInfo,
00273   ULONG       cCol,
00274   ULONG       iCol
00275   );
00276
00277 void DumpRow
00278   (
00279     DBBINDING*  rgBind,
00280     ULONG   cBind,
00281     ULONG   cMaxColWidth,
00282     BYTE*     pData
00283     );
00284
00285
00286 void PrintColumn
00287   (
00288   COLUMNDATA    *pColumn,
00289   DBBINDING     *rgBind,
00290   ULONG          iBind,
00291   ULONG          cMaxColWidth
00292   );
00293
00294
00295 void tfprintf
00296   (
00297   FILE*   fp,
00298   const char* format,
00299   ...
00300   );
00301
00302
00303 void tvfprintf
00304   (
00305   FILE*   fp,
00306   const char* format,
00307   va_list   argptr
00308   );
00309
00310
00311
00312
00313
00314
00315
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/createuser/vc/CreateUserHelpers.h Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • createuser
  • vc

CreateUserHelpers.h

Go to the documentation of this file.
00001
00002
00003
00004
00005
00006 #ifndef __CREATEUSERHELPERS_H
00007 #define __CREATEUSERHELPERS_H
00008
00009
00010 void PrintIADSObject(IADs * pIADs);
00011 void CheckADHRESULT(HRESULT passedhr,LPOLESTR pwReason);
00012 WCHAR * CrackADError(HRESULT hResult);
00013
00014
00015
00016 #endif
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletChannelRequest Member List

This is the complete list of members for tagAppletChannelRequest, including all inherited members.
aUsers | tagAppletChannelRequest
cUsers | tagAppletChannelRequest
eCommand | tagAppletChannelRequest
nChannelID | tagAppletChannelRequest
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/DataSource/sdksamplestorageplugin.idl Source File

  • Multimedia
  • WindowsMediaServices9
  • DataSource

sdksamplestorageplugin.idl

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            SDKSampleStoragePlugin.idl
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 // This file will be processed by the MIDL tool to
00013 // produce the type library (SDKSampleStoragePlugin.tlb) and marshalling code.
00014
00015 cpp_quote("//*****************************************************************************")
00016 cpp_quote("//")
00017 cpp_quote("//  Microsoft Windows Media")
00018 cpp_quote("//  Copyright (C) Microsoft Corporation. All rights reserved.")
00019 cpp_quote("//")
00020 cpp_quote("//  Automatically generated by Midl from SDKSampleStoragePlugin.idl")
00021 cpp_quote("//")
00022 cpp_quote("//  DO NOT EDIT THIS FILE.")
00023 cpp_quote("//")
00024 cpp_quote("//*****************************************************************************")
00025
00026 import "oaidl.idl";
00027
00028
00029 cpp_quote( "EXTERN_GUID( LIBID_SDKSAMPLESTORAGEPLUGINLib, 0x46b14880, 0x4ddc, 0x4957, 0xa4, 0xa4, 0xf9, 0x0, 0xd9, 0xf2, 0x3, 0x3f ); ")
00030 cpp_quote( "EXTERN_GUID( CLSID_SDKSampleStorageSystem,    0x28dfd023, 0xdc35, 0x4786, 0xb1, 0xa1, 0xf, 0xc6, 0xcb, 0x6a, 0x38, 0x46 ); ")
00031
00032 [
00033   uuid(46B14880-4DDC-4957-A4A4-F900D9F2033F),
00034   version(9.0),
00035   helpstring("SDKSampleStoragePlugin 9.0 Type Library")
00036 ]
00037 library SDKSAMPLESTORAGEPLUGINLib
00038 {
00039   importlib("stdole32.tlb");
00040   importlib("stdole2.tlb");
00041 };
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSids Member List

This is the complete list of members for CSids, including all inherited members.
CleanUp(BOOL fFreeSid=TRUE) | CSids |
CopyAndAddSid(PSID pSid, CSids **ppSids) | CSids |
CopyAndRemoveItem(DWORD dwIndex, CSids **ppSids) | CSids |
CSids() | CSids | [inline]
GetAuthorizedUsers(IWMSNamedValues *pNamedValues) | CSids |
GetUsers(BSTR *pbstrUserNames) | CSids |
m_cItems | CSids |
m_pSidList | CSids |
MatchSid(PSID pSid, DWORD *pdwIndex) | CSids |
SetAuthorizedUsers(IWMSNamedValues *pNamedValues) | CSids |
~CSids() | CSids | [inline]
Generated on Wed Nov 13 2024 16:57:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/Line.h Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

Line.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 // Line.h : Declaration of the CLine
00013
00014 #ifndef __LINE_H_
00015 #define __LINE_H_
00016
00017 #include "resource.h"       // main symbols
00018 #define _ATL_DEBUG_QI
00019 #define _ATL_DEBUG_REFCOUNT
00020 #include <atlcom.h>
00021 #include <atlctl.h>
00022 #include <olectl.h>
00023 #include "IPersistStm.h"
00024
00025
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CLine
00029 //
00030 // This class implements a persistable line object.
00031 //
00032
00033
00034 class /* ATL_NO_VTABLE */ CLine :
00035   public CComObjectRootEx<CComMultiThreadModel>,
00036   public CComCoClass<CLine, &CLSID_Line>,
00037   public IMyPersistStreamImpl<CLine>,
00038   public ISupportErrorInfo,
00039   public IDispatchImpl<ILine, &IID_ILine, &LIBID_GRAPHOBJLib>
00040 {
00041 private:
00042   typedef struct {
00043     long x1, y1;
00044     long x2, y2;
00045   } LINEDATA;
00046
00047   LINEDATA m_Line;
00048
00049 public:
00050   CLine()
00051   {
00052   }
00053
00054 DECLARE_REGISTRY_RESOURCEID(IDR_LINE)
00055 DECLARE_NOT_AGGREGATABLE(CLine)
00056
00057 BEGIN_COM_MAP(CLine)
00058   COM_INTERFACE_ENTRY(ILine)
00059   COM_INTERFACE_ENTRY(IDispatch)
00060   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00061   COM_INTERFACE_ENTRY_IMPL_IID(IID_IPersistStream, IMyPersistStream)
00062   // COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
00063 END_COM_MAP()
00064
00065 // IMyPersistStream
00066   BOOL  m_bRequiresSave;
00067   STDMETHOD(IMyPersistStreamImpl_Load)(LPSTREAM pStm);
00068   STDMETHOD(IMyPersistStreamImpl_Save)(LPSTREAM pStm, BOOL fClearDirty);
00069   STDMETHOD(IMyPersistStreamImpl_GetSizeMax)(ULARGE_INTEGER FAR* pcbSize);
00070
00071   // ISupportsErrorInfo
00072   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00073
00074 // ILine
00075 public:
00076   STDMETHOD(get_y2)(/*[out, retval]*/ long *pVal);
00077   STDMETHOD(put_y2)(/*[in]*/ long newVal);
00078   STDMETHOD(get_x2)(/*[out, retval]*/ long *pVal);
00079   STDMETHOD(put_x2)(/*[in]*/ long newVal);
00080   STDMETHOD(get_y1)(/*[out, retval]*/ long *pVal);
00081   STDMETHOD(put_y1)(/*[in]*/ long newVal);
00082   STDMETHOD(get_x1)(/*[out, retval]*/ long *pVal);
00083   STDMETHOD(put_x1)(/*[in]*/ long newVal);
00084 };
00085
00086 #endif //__LINE_H_
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsCmd/util.cxx Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsCmd

util.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:  util.cxx
00008 //
00009 //  Contents:  Ansi to Unicode conversions and misc helper functions
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include "main.hxx"
00014
00015 //
00016 // Local functions
00017 //
00018
00019
00020 int
00021 AnsiToUnicodeString(
00022     LPSTR pAnsi,
00023     LPWSTR pUnicode,
00024     DWORD StringLength
00025     )
00026 {
00027     int iReturn;
00028
00029     if( StringLength == 0 )
00030         StringLength = strlen( pAnsi );
00031
00032     iReturn = MultiByteToWideChar(CP_ACP,
00033                                   MB_PRECOMPOSED,
00034                                   pAnsi,
00035                                   StringLength + 1,
00036                                   pUnicode,
00037                                   StringLength + 1 );
00038
00039     //
00040     // Ensure NULL termination.
00041     //
00042     pUnicode[StringLength] = 0;
00043
00044     return iReturn;
00045 }
00046
00047 #if 0 //This function is commented out, as it's not being used.
00048 int
00049 UnicodeToAnsiString(
00050     LPWSTR pUnicode,
00051     LPSTR pAnsi,
00052     DWORD StringLength
00053     )
00054 {
00055     LPSTR pTempBuf = NULL;
00056     INT   rc = 0;
00057
00058     if( StringLength == 0 ) {
00059
00060         //
00061         // StringLength is just the
00062         // number of characters in the string
00063         //
00064         StringLength = wcslen( pUnicode );
00065     }
00066
00067     //
00068     // WideCharToMultiByte doesn't NULL terminate if we're copying
00069     // just part of the string, so terminate here.
00070     //
00071
00072     pUnicode[StringLength] = 0;
00073
00074     //
00075     // Include one for the NULL
00076     //
00077     StringLength++;
00078
00079     //
00080     // Unfortunately, WideCharToMultiByte doesn't do conversion in place,
00081     // so allocate a temporary buffer, which we can then copy:
00082     //
00083
00084     if( pAnsi == (LPSTR)pUnicode )
00085     {
00086         pTempBuf = (LPSTR)LocalAlloc( LPTR, StringLength );
00087         pAnsi = pTempBuf;
00088     }
00089
00090     if( pAnsi )
00091     {
00092         rc = WideCharToMultiByte( CP_ACP,
00093                                   0,
00094                                   pUnicode,
00095                                   StringLength,
00096                                   pAnsi,
00097                                   StringLength,
00098                                   NULL,
00099                                   NULL );
00100     }
00101
00102     /* If pTempBuf is non-null, we must copy the resulting string
00103      * so that it looks as if we did it in place:
00104      */
00105     if( pTempBuf && ( rc > 0 ) )
00106     {
00107         pAnsi = (LPSTR)pUnicode;
00108         int len = strlen(pTempBuf);
00109         strncpy(pAnsi, pTempBuf);
00110         LocalFree( pTempBuf );
00111     }
00112
00113     return rc;
00114 }
00115 #endif
00116
00117 LPWSTR
00118 AllocateUnicodeString(
00119     LPSTR  pAnsiString
00120     )
00121 {
00122     LPWSTR  pUnicodeString = NULL;
00123
00124     if (!pAnsiString)
00125         return NULL;
00126
00127     pUnicodeString = (LPWSTR)LocalAlloc(
00128                         LPTR,
00129                         strlen(pAnsiString)*sizeof(WCHAR) + sizeof(WCHAR)
00130                         );
00131
00132     if (pUnicodeString) {
00133
00134         AnsiToUnicodeString(
00135             pAnsiString,
00136             pUnicodeString,
00137             0
00138             );
00139     }
00140
00141     return pUnicodeString;
00142 }
00143
00144
00145 void
00146 FreeUnicodeString(
00147     LPWSTR  pUnicodeString
00148     )
00149 {
00150
00151     LocalFree(pUnicodeString);
00152
00153     return;
00154 }
00155
00156
00157 //
00158 // Misc helper functions for displaying data.
00159 //
00160
00161
00162 HRESULT
00163 PrintVariant(
00164     VARIANT varPropData
00165     )
00166 {
00167     HRESULT hr;
00168     BSTR bstrValue = NULL;
00169
00170     switch (varPropData.vt) {
00171     case VT_I4:
00172         printf("%d", varPropData.lVal);
00173         break;
00174     case VT_BSTR:
00175         wprintf(L"%s", varPropData.bstrVal);
00176         break;
00177
00178     case VT_BOOL:
00179         printf("%d", V_BOOL(&varPropData));
00180         break;
00181
00182     case (VT_ARRAY | VT_VARIANT):
00183         PrintVariantArray(varPropData);
00184         break;
00185
00186     case VT_DATE:
00187         hr = VarBstrFromDate(
00188                  varPropData.date,
00189                  LOCALE_SYSTEM_DEFAULT,
00190                  LOCALE_NOUSEROVERRIDE,
00191                  &bstrValue
00192                  );
00193         if ((S_OK == hr) && (NULL != bstrValue)) {
00194             wprintf(L"%s", bstrValue);
00195             SysFreeString(bstrValue);
00196         }
00197         else
00198             wprintf(L"Error: 0x%x \t Failed while executing VarBstrFromDate\n");
00199         break;
00200
00201     default:
00202         printf("Data type is %d\n", varPropData.vt);
00203         break;
00204
00205     }
00206     printf("\n");
00207     return(S_OK);
00208 }
00209
00210
00211 HRESULT
00212 PrintVariantArray(
00213     VARIANT var
00214     )
00215 {
00216     LONG dwSLBound = 0;
00217     LONG dwSUBound = 0;
00218     VARIANT v;
00219     LONG i;
00220     HRESULT hr = S_OK;
00221
00222     if(!((V_VT(&var) &  VT_VARIANT) &&  V_ISARRAY(&var))) {
00223         return(E_FAIL);
00224     }
00225
00226     //
00227     // Check that there is only one dimension in this array
00228     //
00229
00230     if ((V_ARRAY(&var))->cDims != 1) {
00231         hr = E_FAIL;
00232         BAIL_ON_FAILURE(hr, L"Variant Array dimension is not equal to 1");
00233     }
00234     //
00235     // Check that there is atleast one element in this array
00236     //
00237
00238     if ((V_ARRAY(&var))->rgsabound[0].cElements == 0){
00239         hr = E_FAIL;
00240         BAIL_ON_FAILURE(hr, L"Variant Array has zero elements");
00241     }
00242
00243     //
00244     // We know that this is a valid single dimension array
00245     //
00246
00247     hr = SafeArrayGetLBound(V_ARRAY(&var),
00248                             1,
00249                             (long FAR *)&dwSLBound
00250                             );
00251     BAIL_ON_FAILURE(hr, L"Failed while executing SafeArrayGetLBound");
00252
00253     hr = SafeArrayGetUBound(V_ARRAY(&var),
00254                             1,
00255                             (long FAR *)&dwSUBound
00256                             );
00257     BAIL_ON_FAILURE(hr, L"Failed while executing SafeArrayGetUBound");
00258
00259     VariantInit(&v);
00260     for (i = dwSLBound; i <= dwSUBound; i++) {
00261         hr = SafeArrayGetElement(V_ARRAY(&var),
00262                                 (long FAR *)&i,
00263                                 &v
00264                                 );
00265         if (FAILED(hr)) {
00266             wprintf(L"Error: 0x%x \t Failed while executing SafeArrayGetElement", hr);
00267             continue;
00268         }
00269         if (i < dwSUBound) {
00270             wprintf(L"%s, ", v.bstrVal);
00271         } else {
00272             wprintf(L"%s", v.bstrVal);
00273         }
00274         VariantClear(&v);
00275     }
00276     return(S_OK);
00277
00278 error:
00279     return(hr);
00280 }
00281
00282
00283 HRESULT
00284 PrintProperty(
00285     BSTR bstrPropName,
00286     HRESULT hRetVal,
00287     VARIANT varPropData
00288     )
00289 {
00290     HRESULT hr = S_OK;
00291
00292     switch (hRetVal) {
00293
00294     case 0:
00295         wprintf(L"%-32s: ", bstrPropName);
00296         PrintVariant(varPropData);
00297         break;
00298
00299     case E_ADS_CANT_CONVERT_DATATYPE:
00300         wprintf(L"%-32s: ", bstrPropName);
00301         printf("<Data could not be converted for display>\n");
00302         break;
00303
00304     default:
00305         wprintf(L"%-32s: ", bstrPropName);
00306         printf("<Data not available>\n");
00307         break;
00308
00309     }
00310     return(hr);
00311 }
00312
00313 void
00314 PrintUsage(
00315     void
00316     )
00317 {
00318     printf("usage: adscmd [list|dump] <ADsPath>\n") ;
00319 }
00320
00321 
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WiaWrap::CEventCallback Member List

This is the complete list of members for WiaWrap::CEventCallback, including all inherited members.
CEventCallback() | WiaWrap::CEventCallback |
GetNumDevices() const | WiaWrap::CEventCallback |
ImageEventCallback(LPCGUID pEventGuid, BSTR bstrEventDescription, BSTR bstrDeviceID, BSTR bstrDeviceDescription, DWORD dwDeviceType, BSTR bstrFullItemName, ULONG *pulEventType, ULONG ulReserved) | WiaWrap::CEventCallback |
m_cRef | WiaWrap::CEventCallback | [private]
m_nNumDevices | WiaWrap::CEventCallback | [private]
m_pConnectEventObject | WiaWrap::CEventCallback | [private]
m_pDisconnectEventObject | WiaWrap::CEventCallback | [private]
QueryInterface(REFIID iid, LPVOID *ppvObj) | WiaWrap::CEventCallback |
Register() | WiaWrap::CEventCallback |
STDMETHOD_(ULONG, AddRef)() | WiaWrap::CEventCallback |
STDMETHOD_(ULONG, Release)() | WiaWrap::CEventCallback |
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/AppUtilDlg.h Source File

  • Com
  • Administration
  • Explore.VC

AppUtilDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019
00020
00021 #if !defined(AFX_APPUTILDLG_H__0B7BB736_B53B_11D2_86A8_000000000000__INCLUDED_)
00022 #define AFX_APPUTILDLG_H__0B7BB736_B53B_11D2_86A8_000000000000__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027
00028
00029 #define UTILITY_TYPE_UNDEFINED    -1
00030 #define UTILITY_TYPE_START_APP    0
00031 #define UTILITY_TYPE_STOP_APP   1
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // CAppUtilDlg dialog
00036
00037 class CAppUtilDlg : public CDialog
00038 {
00039 // Construction
00040 public:
00041   void set_UtilityType(int UtilityType);
00042   void set_Catalog(ICOMAdminCatalog* pCatalog);
00043   CAppUtilDlg(CWnd* pParent = NULL);   // standard constructor
00044
00045 // Dialog Data
00046   //{{AFX_DATA(CAppUtilDlg)
00047   enum { IDD = IDD_APP_UTILITY };
00048   CEdit m_edtApp;
00049   //}}AFX_DATA
00050
00051
00052 // Overrides
00053   // ClassWizard generated virtual function overrides
00054   //{{AFX_VIRTUAL(CAppUtilDlg)
00055   protected:
00056   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00057   //}}AFX_VIRTUAL
00058
00059 // Implementation
00060 protected:
00061   HICON m_hIcon;
00062
00063   // Generated message map functions
00064   //{{AFX_MSG(CAppUtilDlg)
00065   afx_msg void OnClose();
00066   virtual BOOL OnInitDialog();
00067   virtual void OnOK();
00068   afx_msg void OnAppSearch();
00069   //}}AFX_MSG
00070   DECLARE_MESSAGE_MAP()
00071 private:
00072   void ReleaseCatalog();
00073   int     m_nUtilityType;
00074   ICOMAdminCatalog* m_pCatalog;
00075 };
00076
00077 //{{AFX_INSERT_LOCATION}}
00078 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00079
00080 #endif // !defined(AFX_APPUTILDLG_H__0B7BB736_B53B_11D2_86A8_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/inc/IsapiRequest.h Source File

  • Web
  • iis
  • ISAPI_6.0
  • inc

IsapiRequest.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: IsapiRequest.h
00006
00007 Abstract:
00008
00009     A class to do common ISAPI extension
00010     processing tasks
00011
00012 Author:
00013
00014     ISAPI developer (Microsoft employee), October 2002
00015
00016 --*/
00017
00018 #ifndef _isapirequest_h
00019 #define _isapirequest_h
00020
00021 #include <IsapiTools.h>
00022 #include <httpext.h>
00023
00024 #define DEFAULT_STATUS                  "200 OK"
00025 #define DEFAULT_HEADERS                 "\r\n"
00026 #define INLINE_READ_SIZE                2048
00027 #define DEFAULT_RESPONSE_BUFFER_SIZE    32 * 1024
00028
00029 //
00030 // Values for use with AsyncTransmitBufferedResponse
00031 // cache expiration times.
00032 //
00033
00034 #define NO_EXPIRATION                   0xffffffff
00035 #define IMMEDIATE_EXPIRATION            0
00036
00037 class ISAPI_REQUEST
00038 {
00039 public:
00040
00041     ISAPI_REQUEST(
00042         EXTENSION_CONTROL_BLOCK *   pEcb
00043         );
00044
00045     virtual
00046     ~ISAPI_REQUEST(
00047         VOID
00048         );
00049
00050     BOOL
00051     SyncSendStatusAndHeaders(
00052         CHAR *  szStatus = NULL,
00053         CHAR *  szHeaders = NULL
00054         );
00055
00056     BOOL
00057     SyncWriteClientArgs(
00058         CHAR *  szFormat,
00059         va_list args
00060         );
00061
00062     BOOL
00063     SyncWriteClientString(
00064         CHAR *  szFormat,
00065         ...
00066         );
00067
00068     BOOL
00069     SyncWriteCompleteResponse(
00070         CHAR *  szStatus,
00071         CHAR *  szHeaders,
00072         CHAR *  szFormat,
00073         ...
00074         );
00075
00076     BOOL
00077     GetServerVariable(
00078         CHAR *          szVariable,
00079         ISAPI_STRING *  pIsapiString
00080         );
00081
00082     BOOL
00083     GetServerVariable(
00084         CHAR *  szVariable,
00085         ISAPI_STRINGW * pIsapiStringW
00086         );
00087
00088     BOOL
00089     ReadAllEntity(
00090         ISAPI_BUFFER *  pBuffer
00091         );
00092
00093     BOOL
00094     SetBufferedResponseStatus(
00095         CHAR *  szStatus
00096         );
00097
00098     BOOL
00099     AddHeaderToBufferedResponse(
00100         CHAR *  szName,
00101         CHAR *  szValue
00102         );
00103
00104     BOOL
00105     PrintfToResponseBuffer(
00106         CHAR *  szFormat,
00107         ...
00108         );
00109
00110     BOOL
00111     AddDataToResponseBuffer(
00112         VOID *  pData,
00113         DWORD   cbData
00114         );
00115
00116     BOOL
00117     AsyncTransmitBufferedResponse(
00118         PFN_HSE_IO_COMPLETION   pfnCompletion,
00119         DWORD                   dwExpireSeconds = NO_EXPIRATION
00120         );
00121
00122     DWORD
00123     QueryMaxSyncWriteSize(
00124         VOID
00125         );
00126
00127     VOID
00128     SetMaxSyncWriteSize(
00129         DWORD   dwMaxSyncWriteSize
00130         );
00131
00132     DWORD
00133     QueryMaxResponseBufferSize(
00134         VOID
00135         );
00136
00137     VOID
00138     SetMaxResponseBufferSize(
00139         DWORD   dwMaxResponseBufferSize
00140         );
00141
00142     EXTENSION_CONTROL_BLOCK *
00143     QueryEcb(
00144         VOID
00145         );
00146
00147     DWORD
00148     QueryIISMajorVersion(
00149         VOID
00150         );
00151
00152     DWORD
00153     QueryIISMinorVersion(
00154         VOID
00155         );
00156
00157     BOOL
00158     QueryIsClientConnected(
00159         VOID
00160         );
00161
00162     BOOL
00163     UnimpersonateClient(
00164         VOID
00165         );
00166
00167     BOOL
00168     ImpersonateClient(
00169         VOID
00170         );
00171
00172 private:
00173
00174     EXTENSION_CONTROL_BLOCK *   _pEcb;
00175     ISAPI_STRING                _StatusBuffer;
00176     ISAPI_STRING                _HeaderBuffer;
00177     ISAPI_BUFFER                _ResponseBuffer;
00178     DWORD                       _dwMaxSyncWriteSize;
00179     DWORD                       _dwIISMajorVersion;
00180     DWORD                       _dwIISMinorVersion;
00181     static DWORD                _dwOsMajorVersion;
00182     BOOL                        _fClientIsConnected;
00183     BOOL                        _fNeedDoneWithSession;
00184     HANDLE                      _hImpersonationToken;
00185
00186     BOOL
00187     AsyncSendResponseIIS4(
00188         PFN_HSE_IO_COMPLETION   pfnCompletion
00189         );
00190
00191     BOOL
00192     AsyncSendResponseIIS5(
00193         PFN_HSE_IO_COMPLETION   pfnCompletion
00194         );
00195
00196     BOOL
00197     AsyncSendResponseIIS6(
00198         PFN_HSE_IO_COMPLETION   pfcCompletion,
00199         BOOL                    fCacheResponse
00200         );
00201
00202     DWORD
00203     QueryOsMajorVersion(
00204         VOID
00205         );
00206 };
00207
00208 DWORD
00209 SyncSendGenericServerError(
00210     EXTENSION_CONTROL_BLOCK *   pecb
00211     );
00212
00213 #endif  // _isapirequest_h
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/filerep.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

filerep.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     File Replication Client Utility
00006
00007     FILE: FileRep.cpp
00008
00009     USAGE:
00010         FileRep [server name] [remote file] [local file] <options...>
00011
00012     OPTIONS:
00013         -n network_address
00014         -p protocol_sequence
00015         -e endpoint
00016         -d print messages
00017
00018     PURPOSE: Client utility for the file replication application
00019
00020     FUNCTIONS: main() - binds to replication server and requests
00021         file replication.
00022
00023     COMMENTS:
00024
00025 */
00026
00027 #include <stdio.h>
00028 #include <stdlib.h>
00029 #include <process.h>
00030 #include <tchar.h>
00031 #include <rpc.h>
00032 #include <Ntdsapi.h>
00033
00034 #include "common.h"
00035
00036 #include "Service.h"
00037
00038 // header file generated by MIDL compiler
00039 #include "FileRepClient.h"
00040
00041 /*
00042     FUNCTION: PrintUsage()
00043
00044     PURPOSE: Prints help information.
00045
00046     PARAMETERS:
00047         ProgName - name of the executable
00048
00049     RETURN VALUE:
00050         none
00051
00052     COMMENTS:
00053 */
00054 void PrintUsage(TCHAR *ProgName) {
00055     _tprintf(TEXT("%s - File Replication Client Utility\n\n"), ProgName);
00056     _tprintf(TEXT("Usage: %s [server name] [remote file] [local file] <options...> \n\n"), ProgName);
00057     _tprintf(TEXT("Options:\n"));
00058     _tprintf(TEXT(" -p protocol_sequence\n"));
00059     _tprintf(TEXT(" -n network_address\n"));
00060     _tprintf(TEXT(" -e endpoint\n"));
00061     _tprintf(TEXT(" -d print messages\n"));
00062 }
00063
00064 /*
00065     FUNCTION: main()
00066
00067     PURPOSE: Main funciton for the utility.  It binds to the local server
00068         and requests file replication.
00069
00070     PARAMETERS:
00071         dwArgc - number of command line arguments
00072         lpszArgv - array of command line arguments
00073
00074     RETURN VALUE:
00075         none
00076
00077     COMMENTS:
00078
00079 */
00080 INT _cdecl main(int argc, char **argv) {
00081
00082     INT i;
00083     RPC_STATUS rpcstatus;
00084
00085     // Controlls printing out of messages.
00086     BOOL bDebug = FALSE;
00087
00088     // Explicit binding handle to the client system service.
00089     handle_t hFileRepClient = NULL;
00090
00091     // These are the default values for extablishing connections.
00092     // Default connection is to a local server over local rpc.
00093     LPTSTR pszProtocolSequence = TEXT("ncalrpc");
00094     LPTSTR pszNetworkAddress = NULL;
00095
00096     // An empty endpoint string is used, since we are going to
00097     // connect to the endpoint dynamically generated by the
00098     // RPC run-time library.  Server calls RpcServerUseProtseq to
00099     // obtain a binding hadnle and a dynamic endpoint.
00100     LPTSTR pszEndpoint = TEXT("");
00101
00102     LPTSTR pszUuid = NULL;
00103     LPTSTR pszOptions = NULL;
00104     LPTSTR pszStringBinding = NULL;
00105
00106     LPTSTR ServerName = NULL;
00107     LPTSTR RemoteFileName = NULL;
00108     LPTSTR LocalFileName = NULL;
00109
00110     INT nNumArgs;
00111
00112     // Quality of service structure to ensure authentication.
00113     RPC_SECURITY_QOS SecurityQOS;
00114
00115     // Used in generating the principal name for the local system service.
00116     TCHAR Name[128];
00117     DWORD cbName = sizeof(Name);
00118     TCHAR DomainName[128];
00119     DWORD cbDomainName = sizeof(DomainName);
00120     SID_NAME_USE Use;
00121     SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
00122     BYTE sidBuffer[100];
00123     PSID pSID = (PSID)&sidBuffer;
00124
00125     // Get a common handle on the command line arguments for both
00126     // UNICODE and ASCII
00127 #ifdef _UNICODE
00128     LPWSTR *szArgList = CommandLineToArgvW(GetCommandLine(), &nNumArgs);
00129     if (NULL == szArgList) {
00130         _tprintf(TEXT("FileRep main: CommandLineToArgW failed"));
00131         exit(EXIT_FAILURE);
00132     }
00133 #else
00134     char **szArgList = argv;
00135     nNumArgs = argc;
00136 #endif
00137
00138     // Check that the correct number of arguments is given.
00139     if(nNumArgs<4){
00140         PrintUsage(szArgList[0]);
00141         exit(EXIT_FAILURE);
00142     }
00143
00144     // Extract the required arguments.
00145     ServerName = szArgList[1];
00146     RemoteFileName = szArgList[2];
00147     LocalFileName = szArgList[3];
00148
00149     // Allow the user to override settings with command line switches.
00150     for (i = 4; i < nNumArgs; i++) {
00151         // Well-formed argument switches start with '/' or '-' and are
00152         // two characters long.
00153         if (((*szArgList[i] == TEXT('-')) || (*szArgList[i] == TEXT('/'))) && _tcsclen(szArgList[i]) == 2) {
00154
00155             switch (_totlower(*(szArgList[i]+1))) {
00156
00157                 case TEXT('p'):
00158
00159                     // Override protocol sequence.
00160
00161                     // Check that the next argument exists and is not a
00162                     // switch.
00163                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00164                         pszProtocolSequence = szArgList[++i];
00165                     }
00166                     // Otherwise we have an empty protocol sequence.
00167                     else {
00168                         // We do not allow an empty protocol sequence.
00169                         _tprintf(TEXT("Protocol sequence can't be \"\".\n"));
00170                         exit(EXIT_FAILURE);
00171                     }
00172
00173                     break;
00174
00175                 case TEXT('n'):
00176
00177                     // Override the network address.
00178                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00179                         pszNetworkAddress = szArgList[++i];
00180                     }
00181                     else {
00182                         pszNetworkAddress = TEXT("");
00183                     }
00184
00185                     break;
00186
00187                 case TEXT('e'):
00188
00189                     // Override the endpoint.
00190                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00191                         pszEndpoint = szArgList[++i];
00192                     }
00193                     else {
00194                         pszEndpoint = TEXT("");
00195                     }
00196
00197                     break;
00198
00199                 case TEXT('d'):
00200                     // Turn on debugging.
00201                     bDebug = TRUE;
00202                     break;
00203
00204                 case TEXT('h'):
00205                 case TEXT('?'):
00206                 default:
00207                     PrintUsage(szArgList[0]);
00208                     exit(EXIT_SUCCESS);
00209             }
00210         }
00211         else {
00212             PrintUsage(szArgList[0]);
00213             exit(EXIT_FAILURE);
00214         }
00215     }
00216
00217     // Concatenate the elements of
00218     // the string binding into the proper sequence.
00219     rpcstatus = RpcStringBindingCompose(pszUuid,
00220                                         pszProtocolSequence,
00221                                         pszNetworkAddress,
00222                                         pszEndpoint,
00223                                         pszOptions,
00224                                         &pszStringBinding);
00225     if(bDebug){
00226         _tprintf(TEXT("RpcStringBindingCompose returned 0x%x\n"), rpcstatus);
00227         _tprintf(TEXT("pszStringBinding = %s\n"), pszStringBinding);
00228     }
00229     RPC_EEINFO_EXIT_IF_FAIL(rpcstatus, TEXT("RpcStringBindingCompose"));
00230
00231     // Set the binding handle that will be used to bind to the server.
00232     rpcstatus = RpcBindingFromStringBinding(pszStringBinding, &hFileRepClient);
00233     if(bDebug) _tprintf(TEXT("RpcBindingFromStringBinding returned 0x%x\n"), rpcstatus);
00234     RPC_EEINFO_EXIT_IF_FAIL(rpcstatus, TEXT("RpcBindingFromStringBinding"));
00235
00236     // Free the binding string.
00237     rpcstatus = RpcStringFree(&pszStringBinding);
00238     ASSERTE(rpcstatus == RPC_S_OK);
00239
00240     // Specify quality of service parameters.
00241     SecurityQOS.Version = RPC_C_SECURITY_QOS_VERSION;
00242     SecurityQOS.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH;
00243     // Dynamic identity tracking is more efficient for a single LRPC call.
00244     SecurityQOS.IdentityTracking = RPC_C_QOS_IDENTITY_DYNAMIC;
00245     // The client system service needs to impersonate the security context
00246     // of the client utility on the remote systems where it may replicate
00247     // files from.
00248     // We need to impersonate with level delegate, since the server system
00249     // service will need to impersonate the user further.
00250     SecurityQOS.ImpersonationType = RPC_C_IMP_LEVEL_DELEGATE;
00251
00252     // Generate the principal name for the local system service.
00253     // We can't just use the a string constant, because then
00254     // we rely on a particular English-language representation of the
00255     // principal.
00256
00257     if (AllocateAndInitializeSid(&SIDAuth, 1,
00258                                  SECURITY_NETWORK_SERVICE_RID,
00259                                  0, 0, 0, 0, 0, 0, 0,
00260                                  &pSID) == 0) {
00261         printf("AllocateAndInitializeSid failed\n");
00262         exit(EXIT_FAILURE);
00263     }
00264
00265     if (LookupAccountSid(NULL, // name of local or remote computer
00266                          pSID, // security identifier
00267                          Name, // account name buffer
00268                          &cbName, // size of account name buffer
00269                          DomainName, // domain name
00270                          &cbDomainName, // size of domain name buffer
00271                          &Use) == 0) { // SID type
00272         printf("LookupAccountSid failed\n");
00273         exit(EXIT_FAILURE);
00274     }
00275
00276     if(bDebug) _tprintf(TEXT("Server \"magic name\" is %s\n"), Name);
00277
00278     // Set authentication and authorisation information for
00279     // the binding handle.
00280     // By speciying NULL for the 5th parameter we use the security login
00281     // context for the current address space.
00282     // The security level is "PRIVACY" since it is the only level
00283     // provided by LRPC.
00284     // We are assured of talking to a local service running with
00285     // system privileges.
00286     rpcstatus = RpcBindingSetAuthInfoEx(hFileRepClient, Name, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_WINNT, NULL, NULL, &SecurityQOS);
00287     RPC_EEINFO_EXIT_IF_FAIL(rpcstatus, TEXT("RpcBindingSetAuthInfo"));
00288
00289     // Make the RPC to request file replication.
00290     RpcTryExcept {
00291         if(bDebug) _tprintf(TEXT("Calling the remote procedure RequestFile(hFileRepClient, %s, %s, %s)\n"), ServerName, RemoteFileName, LocalFileName);
00292
00293         RequestFile(hFileRepClient, ServerName, RemoteFileName, LocalFileName);
00294
00295         if(bDebug) _tprintf(TEXT("RequestFile() finished\n"));
00296     }
00297     // Return "non-fatal" errors.  Catching fatal errors
00298     // makes it harder to debug.
00299     RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00300                   (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00301                   (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00302                   (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00303                   (RpcExceptionCode() != STATUS_BREAKPOINT))
00304                   ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00305
00306       PrintProcFailureEEInfo(TEXT("RequestFile"), RpcExceptionCode());
00307         exit(EXIT_FAILURE);
00308     }
00309     RpcEndExcept;
00310
00311     // Free the binding.
00312     rpcstatus = RpcBindingFree((VOID **)&hFileRepClient);
00313     ASSERTE(rpcstatus == RPC_S_OK);
00314
00315     if(bDebug) _tprintf(TEXT("Success!\n"));
00316
00317     return(EXIT_SUCCESS);
00318
00319 } // end main()
00320
00321 /*
00322     MIDL allocate() and free()
00323 */
00324
00325 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
00326     return(AutoHeapAlloc(len));
00327 }
00328
00329 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
00330     if(ptr != NULL) {
00331         AutoHeapFree(ptr);
00332     }
00333 }
00334
00335 // end FileRep.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPlane Member List

This is the complete list of members for CPlane, including all inherited members.
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
bExpanded | CDelegationBase | [protected]
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CPlane(_TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload) | CPlane |
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
GetBitmapIndex() | CPlane | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetDisplayName(int nCol=0) | CPlane | [virtual]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CDelegationBase | [inline, virtual]
getNodeType() | CPlane | [inline, virtual]
GetParentScopeItem() | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CDelegationBase | [inline, virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CDelegationBase | [inline, virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CDelegationBase | [inline, virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
IDM_PAUSE_SKY enum value | CPlane | [private]
IDM_START_SKY enum value | CPlane | [private]
IDM_STOP_SKY enum value | CPlane | [private]
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
iStatus | CPlane | [private]
lHeight | CPlane | [private]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
lPayload | CPlane | [private]
lWeight | CPlane | [private]
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pComponentData | CDelegationBase |
nId | CPlane | [private]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CPlane | [virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CDelegationBase | [inline, virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CPlane | [virtual]
CDelegationBase::OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
PAUSED enum value | CPlane | [private]
RUNNING enum value | CPlane | [private]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CDelegationBase | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
STOPPED enum value | CPlane | [private]
szName | CPlane | [private]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CDelegationBase | [inline, virtual]
thisGuid | CPlane | [private, static]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CPlane() | CPlane | [virtual]
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CVCExploreApp Member List

This is the complete list of members for CVCExploreApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CVCExploreApp() | CVCExploreApp |
CWinApp() | CWinApp |
ExitInstance() | CWinApp | [virtual]
InitInstance() | CVCExploreApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:57:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/credentials/VC/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • credentials
  • VC

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  Credentials.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006 #include "activeds.h"
00007 #include "stdio.h"
00008
00009 // TODO: reference any additional headers you need in STDAFX.H
00010 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/packet.h Source File

  • NetDS
  • RRas
  • ip

packet.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\packet.h
00008
00009 Abstract:
00010
00011     The file contains the header for packet.c
00012
00013 --*/
00014
00015 #ifndef _PACKET_H_
00016 #define _PACKET_H_
00017
00018 //
00019 // struct: PACKET
00020 //
00021 // stores a packet's fields and the buffer
00022 //
00023
00024 typedef struct _PACKET
00025 {
00026     IPADDRESS   ipSource;
00027     WSABUF      wsaBuffer;
00028     BYTE        rgbyBuffer[MAX_PACKET_LENGTH];
00029
00030     OVERLAPPED  oOverlapped;
00031 } PACKET, *PPACKET;
00032
00033 DWORD
00034 PacketCreate (
00035     OUT PPACKET                 *ppPacket);
00036
00037 DWORD
00038 PacketDestroy (
00039     IN  PPACKET                 pPacket);
00040
00041 #ifdef DEBUG
00042 DWORD
00043 PacketDisplay (
00044     IN  PPACKET                 pPacket);
00045 #else
00046 #define PacketDisplay(pPacket)
00047 #endif // DEBUG
00048
00049 #endif // _PACKET_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/DCO_DimmerService/DimmerDevice.idl Source File

  • NetDS
  • upnp
  • DCO_DimmerService

DimmerDevice.idl

Go to the documentation of this file.
00001 //
00002 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 // PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00008 //
00009 //
00010 // DimmerDevice.idl : Control-specific component and library description
00011
00012
00013 import "ocidl.idl";
00014
00015 //################################
00016 //component and type library descriptions
00017 //################################
00018 [
00019    uuid(3c5082c4-0c06-4127-beb3-05e294faf2e7),
00020    version(1.0),
00021    helpstring("UPNP SDK Sample Dimmer Service Type Library")
00022 ]
00023 library SDKDimmerServiceLib
00024 {
00025    importlib("stdole32.tlb");
00026    typedef [v1_enum] enum DIMMINGSERVICE_SCPD_DISPIDS
00027    {
00028       DISPID_POWER = 1,
00029       DISPID_DIMLEVEL,
00030       DISPID_POWERON,
00031       DISPID_POWEROFF,
00032       DISPID_GETPOWERVALUE,
00033       DISPID_SETDIMLEVEL,
00034       DISPID_GETDIMLEVEL,
00035       DISPID_GETCONFIGDETAILS
00036    } DIMMINGSERVICE_SCPD_DISPIDS;
00037
00038    [
00039       uuid(c121c884-7805-403a-afee-e0721cda48d2),
00040       object,
00041       dual,
00042       pointer_default(unique)
00043    ]
00044    interface IUPnPService_DimmingService_SCPD : IDispatch
00045    {
00046       [propget, id(DISPID_POWER), helpstring("Property Power")]
00047       HRESULT Power([out, retval] VARIANT_BOOL *pPower);
00048
00049       [propget, id(DISPID_DIMLEVEL), helpstring("Property dimLevel")]
00050       HRESULT dimLevel(
00051          [out, retval] long *pdimLevel);
00052
00053       [ id(DISPID_POWERON), helpstring("Method PowerOn")]
00054       HRESULT PowerOn();
00055
00056       [ id(DISPID_POWEROFF), helpstring("Method PowerOff")]
00057       HRESULT PowerOff();
00058
00059       [ id(DISPID_GETPOWERVALUE), helpstring("Method GetPowerValue")]
00060       HRESULT GetPowerValue(
00061          [in, out] VARIANT_BOOL *ppowerVall);
00062
00063       [ id(DISPID_SETDIMLEVEL), helpstring("Method SetDimLevel")]
00064       HRESULT SetDimLevel(
00065          [in] long dLevel);
00066
00067       [ id(DISPID_GETDIMLEVEL), helpstring("Method GetDimLevel")]
00068       HRESULT GetDimLevel(
00069          [in, out] long *pdLevel);
00070
00071       [ id(DISPID_GETCONFIGDETAILS), helpstring("Method GetConfigDetails")]
00072       HRESULT GetConfigDetails(
00073          [in, out] VARIANT_BOOL *ppowerVal,
00074          [in, out] long *pdLevel);
00075    };
00076
00077    //component
00078    [
00079       uuid(d31b8f49-367e-41b7-8fc4-50e23d36625d),
00080       helpstring("UPNP Sample Dimmer Device")
00081    ]
00082    coclass UPNPSampleDimmerDevice
00083    {
00084       interface  IUnknown;
00085    };
00086 };
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/BrochureMachine/BrochureMachine.cpp Source File

  • Web
  • Browser
  • BrochureMachine

BrochureMachine.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // BrochureMachine.cpp : Implementation of DLL Exports.
00006
00007
00008 // Note: Proxy/Stub Information
00009 //      To build a separate proxy/stub DLL,
00010 //      run nmake -f BrochureMachineps.mk in the project directory.
00011
00012 #include "stdafx.h"
00013 #include "resource.h"
00014 #include <initguid.h>
00015 #include "BrochureMachine.h"
00016
00017 #include "BrochureMachine_i.c"
00018 #include "PTLauncher.h"
00019
00020
00021 CComModule _Module;
00022
00023 BEGIN_OBJECT_MAP(ObjectMap)
00024 OBJECT_ENTRY(CLSID_PTLauncher, CPTLauncher)
00025 END_OBJECT_MAP()
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // DLL Entry Point
00029
00030 extern "C"
00031 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00032 {
00033     if (dwReason == DLL_PROCESS_ATTACH)
00034     {
00035         _Module.Init(ObjectMap, hInstance, &LIBID_BROCHUREMACHINELib);
00036         DisableThreadLibraryCalls(hInstance);
00037     }
00038     else if (dwReason == DLL_PROCESS_DETACH)
00039         _Module.Term();
00040     return TRUE;    // ok
00041 }
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 // Used to determine whether the DLL can be unloaded by OLE
00045
00046 STDAPI DllCanUnloadNow(void)
00047 {
00048     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00049 }
00050
00051 /////////////////////////////////////////////////////////////////////////////
00052 // Returns a class factory to create an object of the requested type
00053
00054 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00055 {
00056     return _Module.GetClassObject(rclsid, riid, ppv);
00057 }
00058
00059 /////////////////////////////////////////////////////////////////////////////
00060 // DllRegisterServer - Adds entries to the system registry
00061
00062 STDAPI DllRegisterServer(void)
00063 {
00064     // registers object, typelib and all interfaces in typelib
00065     return _Module.RegisterServer(TRUE);
00066 }
00067
00068 /////////////////////////////////////////////////////////////////////////////
00069 // DllUnregisterServer - Removes entries from the system registry
00070
00071 STDAPI DllUnregisterServer(void)
00072 {
00073     return _Module.UnregisterServer(TRUE);
00074 }
00075
00076
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pipes/Common.h Source File

  • NetDS
  • RPC
  • Pipes

Common.h

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00002 /*                  Copyright Microsoft Corp. 1992 - 2000                 */
00003 /*                      Remote Machine pipe sample                      */
00004 /*                                                                      */
00005 /*  FILE    :   common.h                                                */
00006 /*                                                                      */
00007 /*  PURPOSE :   Definitions used in the program                         */
00008 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00009 #ifndef __COMMON_PIPE_SAMPLE__      // If this file has be included before
00010 #define __COMMON_PIPE_SAMPLE__      // Don't include it again
00011
00012 #include <shellapi.h>               // CommandLineToArgvw is defined here
00013 #include <tchar.h>                  // Included to support UNICODE/ANSI
00014 #include <stdio.h>
00015 #include <stdlib.h>
00016
00017 // Common type definition and defines used in the program
00018 // Return values from the program to the OS
00019 #define EXECUTION_FAILED    -1
00020 #define EXECUTION_OK        0
00021
00022 // Exception handler macro
00023 #define DO_EXCEPTION        1       // Execute the exception block
00024
00025 #define SCRAMBLE    1               // Action to take - Encode the file
00026 #define UNSCRAMBLE  2               // Action to take - Decode the file
00027
00028 #define PROTOCOL_SEQUENCE   TEXT("ncacn_np")
00029 #define END_POINT           TEXT("\\pipe\\pipe_sample")
00030
00031 // This struct is used by the client to keep track of the state
00032 typedef struct  {
00033     FILE        *hOld;          // Handle to the old file
00034     FILE        *hNew;          // Handle to the new file
00035     _TUCHAR     *pszOldName;       // Name of the old file
00036     _TUCHAR     *pszNewName;       // Name of the new file
00037 } pipe_state;
00038
00039 // Macro for printing out error message and exit the program if an
00040 // error occured
00041 #define EXIT_IF_FAIL(x, string){   \
00042     ((x) != RPC_S_OK)?_tprintf(TEXT("%s returned with error: %d\n"), \
00043     TEXT(string), (x)),exit(x):0;}
00044
00045 #endif  //  __COMMON_PIPE_SAMPLE__
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Sockdup/Sockdupc.c Source File

  • NetDS
  • WinSock
  • Sockdup

Sockdupc.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1993 - 2000   Microsoft Corporation.
00007 // All Rights Reserved.
00008 //
00009 // Written By:    Mike Liu
00010 //
00011
00012 #ifdef _IA64_
00013   #pragma warning(disable:4127 4706 4267)
00014 #endif
00015
00016 #ifndef WIN32_LEAN_AND_MEAN
00017 #define WIN32_LEAN_AND_MEAN
00018 #endif
00019
00020 #include <winsock2.h>
00021 #include <ws2tcpip.h>
00022 #include <wspiapi.h>
00023 #include <stdlib.h>
00024 #include <stdio.h>
00025 #include <string.h>
00026
00027 char *DEFAULT_PORT                = "8765";
00028 const int DEFAULT_ITERATIONS      = 10;
00029 const int LOOP_FOREVER            = -1;
00030 SOCKET gsConnect = INVALID_SOCKET;
00031
00032 BOOL ConsoleCtrlHandler(DWORD dwEvent);
00033 BOOL DoGracefulShutdown(SOCKET sock);
00034
00035 void Usage(char *szProgramName)
00036 {
00037    fprintf(stderr, "Usage: %s [-n Server] [-e Endpoint] [-l Iterations]\n\n", szProgramName);
00038    fprintf(stderr, "   Server:     server name or IP address (default localhost)\n");
00039    fprintf(stderr, "   Endpoint:   port to connect to (default %s)\n", DEFAULT_PORT);
00040    fprintf(stderr, "   Iterations: number of messages to send (default %d)\n", DEFAULT_ITERATIONS);
00041 }
00042
00043 int __cdecl main(int argc, char **argv)
00044 {
00045    char szBuf[MAX_PATH+1];
00046    char *pszServerName = "localhost";
00047    char *pszPort = DEFAULT_PORT;
00048    int i, nStatus, nLoopCount;
00049    int nIterations = DEFAULT_ITERATIONS;
00050    struct addrinfo hints;
00051    struct addrinfo *res = NULL;
00052    WSADATA wsaData;
00053    WSABUF wsaBuf;
00054    DWORD dwSent = 0;
00055    DWORD dwFlags = 0;
00056
00057    if (argc > 1)
00058    {
00059       for(i = 1; i < argc; i++)
00060       {
00061          if ((argv[i][0] == '-') || (argv[i][0] == '/'))
00062          {
00063             switch(tolower(argv[i][1]))
00064             {
00065                case 'n':
00066                   if (i + 1 < argc)
00067                       pszServerName = argv[++i];
00068                   break;
00069
00070                case 'e':
00071                   if (i + 1 < argc)
00072                        pszPort = argv[++i];
00073                   break;
00074
00075                case 'l':
00076                   if (i + 1 < argc && argv[i+1])
00077                   {
00078                      if (argv[i+1][0] != '-')  // "-l 6"
00079                      {
00080                         nIterations = atoi(argv[i+1]);
00081                         i++;
00082                      }
00083                      else if (isdigit(argv[i+1][1])) // "-l -6"
00084                      {
00085                         nIterations = 0;
00086                         i++;
00087                      }
00088                      else // "-l -e 2000"
00089                         nIterations = LOOP_FOREVER;
00090                   }
00091                   else // "-e 2000 -l"
00092                      nIterations = LOOP_FOREVER;
00093
00094                   break;
00095
00096                default:
00097                   Usage(argv[0]);
00098                   exit(-1);
00099             }
00100          }
00101          else
00102          {
00103             Usage(argv[0]);
00104             exit(-1);
00105          }
00106       }
00107    }
00108
00109    if (nIterations == 0)
00110         exit(-1);
00111
00112    // Install the CTRL+BREAK and CTRL+C Handler
00113    if (SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleCtrlHandler,
00114                              TRUE)
00115                             == FALSE)
00116       fprintf(stderr, "SetConsoleCtrlHandler failed: %d", GetLastError());
00117
00118    if ((nStatus = WSAStartup(0x202,&wsaData)) != 0)
00119    {
00120       fprintf(stderr, "\nWinsock 2 DLL initialization failed: %d\n", nStatus);
00121       exit(-1);
00122    }
00123
00124     memset(&hints, 0, sizeof(hints));
00125     hints.ai_family   = AF_UNSPEC;
00126     hints.ai_socktype = SOCK_STREAM;
00127     hints.ai_protocol = IPPROTO_TCP;
00128
00129     //  getaddrinfo: declared in winsock2.h import library is ws2_32.lib
00130     if (getaddrinfo(pszServerName, pszPort, &hints, &res) != 0)
00131     {
00132         fprintf(stderr, "getaddrinfo failed for gListenSocket: %d\n", WSAGetLastError());
00133         goto CLEANUP;
00134     }
00135
00136     if (res == NULL)
00137     {
00138         fprintf(stderr, "No matching addresses found. "
00139                         "getaddrinfo returned res = NULL\n");
00140         goto CLEANUP;
00141     }
00142
00143     gsConnect = WSASocket(
00144                 res->ai_family,
00145                 res->ai_socktype,
00146                 res->ai_protocol,
00147                 NULL,
00148                 0,
00149                 0);
00150
00151    if (gsConnect == INVALID_SOCKET)
00152    {
00153       fprintf(stderr, "\nWSASocket() failed: %d\n", WSAGetLastError());
00154       goto CLEANUP;
00155    }
00156
00157    printf("Connecting to: %s ...\n", pszServerName);
00158
00159    if (connect(gsConnect, (struct sockaddr*)res->ai_addr, res->ai_addrlen)
00160                == SOCKET_ERROR)
00161    {
00162       fprintf(stderr, "\nconnect() failed: %d\n", WSAGetLastError());
00163       goto CLEANUP;
00164    }
00165
00166    nLoopCount = 0;
00167
00168    while (TRUE)
00169    {
00170       szBuf[0] = '\0';
00171       wsprintf(szBuf, "Test message %d\n", nLoopCount++);
00172       wsaBuf.len = lstrlen(szBuf);
00173       wsaBuf.buf = (char *)szBuf;
00174
00175       printf("Sending --> %s", szBuf);
00176
00177       nStatus = WSASend(gsConnect,
00178                         &wsaBuf,
00179                         1,
00180                         &dwSent,
00181                         dwFlags,
00182                         (LPWSAOVERLAPPED) NULL,
00183                         0);
00184
00185       if (nStatus == SOCKET_ERROR)
00186       {
00187          fprintf(stderr, "WSASend() failed: %d\n", WSAGetLastError());
00188          break;
00189       }
00190       else if (dwSent == 0)
00191       {
00192          printf("Server closed connection\n");
00193          break;
00194       }
00195
00196       if (((nIterations != LOOP_FOREVER)) && (nLoopCount >= nIterations))
00197          break;
00198    }
00199
00200 CLEANUP:
00201
00202    if (gsConnect != INVALID_SOCKET)
00203    {
00204        DoGracefulShutdown(gsConnect);
00205        gsConnect = INVALID_SOCKET;
00206    }
00207
00208    if (res != NULL)
00209    {
00210         // return the addrinfo structure allocated for us by getaddrinfo.
00211         freeaddrinfo(res);
00212         res = NULL;
00213    }
00214
00215    WSACleanup();
00216    return 0;
00217 }
00218
00219
00220 // Handle CTRL+BREAK or CTRL+C events
00221 BOOL ConsoleCtrlHandler(DWORD dwEvent)
00222 {
00223    // Do a best effort cleanup
00224    if (gsConnect != INVALID_SOCKET)
00225    {
00226        closesocket(gsConnect);
00227        gsConnect = INVALID_SOCKET;
00228    }
00229    WSACleanup();
00230    printf("Client terminated. Bye!\n");
00231
00232    return FALSE;
00233 }
00234
00235
00236 // Do a graceful shutdown of a the given socket sock.
00237 // as per the documentation of the shutdown API.
00238 BOOL DoGracefulShutdown(SOCKET sock)
00239 {
00240     BOOL bRetVal = FALSE;
00241     WSAEVENT hEvent = WSA_INVALID_EVENT;
00242     long lNetworkEvents = 0;
00243     int status = 0;
00244
00245     hEvent = WSACreateEvent();
00246     if (hEvent == WSA_INVALID_EVENT)
00247     {
00248         fprintf(stderr, "DoGracefulShutdown: WSACreateEvent failed: %d\n",
00249                 WSAGetLastError());
00250         goto CLEANUP;
00251     }
00252
00253     lNetworkEvents = FD_CLOSE;
00254     if (WSAEventSelect(sock, hEvent, lNetworkEvents) != 0)
00255     {
00256         fprintf(stderr, "DoGracefulShutdown: WSAEventSelect failed: %d\n",
00257                 WSAGetLastError());
00258         goto CLEANUP;
00259     }
00260
00261     if (shutdown(sock, SD_SEND) != 0)
00262     {
00263         fprintf(stderr, "DoGracefulShutdown: shutdown failed: %d\n",
00264                 WSAGetLastError());
00265         goto CLEANUP;
00266     }
00267
00268     if (WaitForSingleObject(hEvent, INFINITE) != WAIT_OBJECT_0)
00269     {
00270         fprintf(stderr, "DoGracefulShutdown: WaitForSingleObject failed: %d\n",
00271                 WSAGetLastError());
00272         goto CLEANUP;
00273     }
00274
00275     do
00276     {
00277         char buf[128];
00278
00279         status = recv(sock, buf, sizeof(buf), 0);
00280     } while (!(status == 0 || status == SOCKET_ERROR));
00281
00282     if (closesocket(sock) != 0)
00283     {
00284         fprintf(stderr, "DoGracefulShutdown: closesocket failed: %d\n",
00285                 WSAGetLastError());
00286         goto CLEANUP;
00287     }
00288
00289     printf("Socket %d has been closed gracefully\n", sock);
00290     sock = INVALID_SOCKET;
00291     bRetVal = TRUE;
00292
00293 CLEANUP:
00294
00295     if (hEvent != WSA_INVALID_EVENT)
00296     {
00297         WSACloseEvent(hEvent);
00298         hEvent = WSA_INVALID_EVENT;
00299     }
00300
00301     if (sock != INVALID_SOCKET)
00302     {
00303         fprintf(stderr, "DoGracefulShutdown: Can't close socket gracefully. "
00304                         "So, closing it anyway ... \n");
00305         closesocket(sock);
00306         sock = INVALID_SOCKET;
00307     }
00308
00309     return bRetVal;
00310 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIDBCreateSession Member List

This is the complete list of members for CImpIDBCreateSession, including all inherited members.
CreateSession(IUnknown *, REFIID, IUnknown **) | CImpIDBCreateSession
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIDBCreateSession) | CImpIDBCreateSession
Generated on Wed Nov 13 2024 16:56:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/registry.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091         _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124         _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,         // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154         MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletRecord Member List

This is the complete list of members for tagAppletRecord, including all inherited members.
apCapabilities | tagAppletRecord
cCapabilities | tagAppletRecord
eStartupChannelType | tagAppletRecord
fConductingCapable | tagAppletRecord
fEnrolledActively | tagAppletRecord
nAppletUserID | tagAppletRecord
nEntityID | tagAppletRecord
nNodeID | tagAppletRecord
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_INTERFACE_ENTRY Member List

This is the complete list of members for _INTERFACE_ENTRY, including all inherited members.
dwFlags | _INTERFACE_ENTRY
dwIfIndex | _INTERFACE_ENTRY
hPeriodicTimer | _INTERFACE_ENTRY
hReceiveEvent | _INTERFACE_ENTRY
hReceiveWait | _INTERFACE_ENTRY
iisStats | _INTERFACE_ENTRY
ipAddress | _INTERFACE_ENTRY
leIndexSortedListLink | _INTERFACE_ENTRY
leInterfaceTableLink | _INTERFACE_ENTRY
pbeBindingTable | _INTERFACE_ENTRY
pwszIfName | _INTERFACE_ENTRY
sRawSocket | _INTERFACE_ENTRY
ulMetric | _INTERFACE_ENTRY
ulNumBindings | _INTERFACE_ENTRY
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCOrder/Resource.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCOrder

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by QCOrder.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_ORDER                       101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/people.Cpp Source File

  • SysMgmt
  • MMC
  • Nodes

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "People.h"
00021
00022 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00025 const GUID CSkateboardFolder::thisGuid = { 0xef163733, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00026 const GUID CIceSkateFolder::thisGuid = { 0xf6c660b0, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00027
00028 const GUID CBicycle::thisGuid = { 0xef163734, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00029 const GUID CSkateboard::thisGuid = { 0xef163735, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00030 const GUID CIceSkate::thisGuid = { 0xf6c660b1, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00031
00032
00033 //==============================================================
00034 //
00035 // CPeoplePoweredVehicle implementation
00036 //
00037 //
00038 CPeoplePoweredVehicle::CPeoplePoweredVehicle()
00039 {
00040     children[0] = new CBicycleFolder;
00041     children[1] = new CSkateboardFolder;
00042     children[2] = new CIceSkateFolder;
00043 }
00044
00045 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00046 {
00047     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00048         delete children[n];
00049 }
00050
00051 HRESULT CPeoplePoweredVehicle::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00052 {
00053     SCOPEDATAITEM sdi;
00054
00055     if (!bExpanded) {
00056         // create the child nodes, then expand them
00057         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00058             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00059             sdi.mask = SDI_STR       |   // Displayname is valid
00060                 SDI_PARAM     |   // lParam is valid
00061                 SDI_IMAGE     |   // nImage is valid
00062                 SDI_OPENIMAGE |   // nOpenImage is valid
00063                 SDI_PARENT    |   // relativeID is valid
00064                 SDI_CHILDREN;     // cChildren is valid
00065
00066             sdi.relativeID  = (HSCOPEITEM)parent;
00067             sdi.nImage      = children[n]->GetBitmapIndex();
00068             sdi.nOpenImage  = INDEX_OPENFOLDER;
00069             sdi.displayname = MMC_CALLBACK;
00070             sdi.lParam      = (LPARAM)children[n];       // The cookie
00071             sdi.cChildren   = 0;
00072
00073             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00074
00075             _ASSERT( SUCCEEDED(hr) );
00076         }
00077     }
00078
00079     return S_OK;
00080 }
00081
00082 CBicycleFolder::CBicycleFolder()
00083 {
00084     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00085         children[n] = new CBicycle(n + 1);
00086     }
00087 }
00088
00089 CBicycleFolder::~CBicycleFolder()
00090 {
00091     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00092         if (children[n]) {
00093             delete children[n];
00094         }
00095 }
00096
00097 HRESULT CBicycleFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00098 {
00099     HRESULT      hr = S_OK;
00100
00101     IHeaderCtrl *pHeaderCtrl = NULL;
00102     IResultData *pResultData = NULL;
00103
00104     if (bShow) {
00105         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00106         _ASSERT( SUCCEEDED(hr) );
00107
00108         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00109         _ASSERT( SUCCEEDED(hr) );
00110
00111         // Set the column headers in the results pane
00112         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00113         _ASSERT( S_OK == hr );
00114
00115         // insert items here
00116         RESULTDATAITEM rdi;
00117
00118         hr = pResultData->DeleteAllRsltItems();
00119         _ASSERT( SUCCEEDED(hr) );
00120
00121         if (!bExpanded) {
00122             // create the child nodes, then expand them
00123             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00124                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00125                 rdi.mask       = RDI_STR       |   // Displayname is valid
00126                     RDI_IMAGE     |
00127                     RDI_PARAM;        // nImage is valid
00128
00129                 rdi.nImage      = children[n]->GetBitmapIndex();
00130                 rdi.str         = MMC_CALLBACK;
00131                 rdi.nCol        = 0;
00132                 rdi.lParam      = (LPARAM)children[n];
00133
00134                 hr = pResultData->InsertItem( &rdi );
00135
00136                 _ASSERT( SUCCEEDED(hr) );
00137             }
00138         }
00139
00140         pHeaderCtrl->Release();
00141         pResultData->Release();
00142     }
00143
00144     return hr;
00145 }
00146
00147 CIceSkateFolder::CIceSkateFolder()
00148 {
00149     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00150         children[n] = new CIceSkate(n + 1);
00151     }
00152 }
00153
00154 CIceSkateFolder::~CIceSkateFolder()
00155 {
00156     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00157         if (children[n]) {
00158             delete children[n];
00159         }
00160 }
00161
00162 HRESULT CIceSkateFolder::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00163 {
00164     *ppViewType = NULL;
00165     *pViewOptions = MMC_VIEW_OPTIONS_OWNERDATALIST;
00166
00167     return S_OK;
00168 }
00169
00170 void CIceSkateFolder::GetChildColumnInfo(RESULTDATAITEM *rdi)
00171 {
00172     if (rdi->mask & RDI_STR) {
00173     LPCTSTR pszT = children[rdi->nIndex]->GetDisplayName(rdi->nCol);
00174     MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00175     rdi->str = pszW;
00176   }
00177
00178     if (rdi->mask & RDI_IMAGE)
00179         rdi->nImage = children[rdi->nIndex]->GetBitmapIndex();
00180 }
00181
00182 // CDelegationBase::AddImages sets up the collection of images to be displayed
00183 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00184 HRESULT CIceSkateFolder::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00185 {
00186     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00187         (long *)m_pBMapLg, // pointer to a handle
00188         0, // index of the first image in the strip
00189         RGB(0, 128, 128)  // color of the icon mask
00190         );
00191 }
00192
00193 HRESULT CIceSkateFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00194 {
00195     HRESULT      hr = S_OK;
00196
00197     IHeaderCtrl *pHeaderCtrl = NULL;
00198     IResultData *pResultData = NULL;
00199
00200     if (bShow) {
00201         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00202         _ASSERT( SUCCEEDED(hr) );
00203
00204         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00205         _ASSERT( SUCCEEDED(hr) );
00206
00207         // Set the column headers in the results pane
00208         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00209         _ASSERT( S_OK == hr );
00210
00211         hr = pResultData->DeleteAllRsltItems();
00212         _ASSERT( SUCCEEDED(hr) );
00213
00214         if (!bExpanded) {
00215             // create the child nodes, then expand them
00216             hr = pResultData->SetItemCount( NUMBER_OF_CHILDREN, 0 );
00217             _ASSERT( SUCCEEDED(hr) );
00218         }
00219
00220         pHeaderCtrl->Release();
00221         pResultData->Release();
00222     }
00223
00224     return hr;
00225 }
00226
00227 CSkateboardFolder::CSkateboardFolder()
00228 {
00229     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00230         children[n] = new CSkateboard(n + 1);
00231     }
00232 }
00233
00234 CSkateboardFolder::~CSkateboardFolder()
00235 {
00236     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00237         if (children[n]) {
00238             delete children[n];
00239         }
00240 }
00241
00242 HRESULT CSkateboardFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00243 {
00244     HRESULT      hr = S_OK;
00245
00246     IHeaderCtrl *pHeaderCtrl = NULL;
00247     IResultData *pResultData = NULL;
00248
00249     if (bShow) {
00250         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00251         _ASSERT( SUCCEEDED(hr) );
00252
00253         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00254         _ASSERT( SUCCEEDED(hr) );
00255
00256         // Set the column headers in the results pane
00257         hr = pHeaderCtrl->InsertColumn( 0, L"Name                      ", 0, MMCLV_AUTO );
00258         _ASSERT( S_OK == hr );
00259
00260         // insert items here
00261         RESULTDATAITEM rdi;
00262
00263         hr = pResultData->DeleteAllRsltItems();
00264         _ASSERT( SUCCEEDED(hr) );
00265
00266         if (!bExpanded) {
00267             // create the child nodes, then expand them
00268             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00269                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00270                 rdi.mask       = RDI_STR       |   // Displayname is valid
00271                     RDI_IMAGE     |
00272                     RDI_PARAM;        // nImage is valid
00273
00274                 rdi.nImage      = children[n]->GetBitmapIndex();
00275                 rdi.str         = MMC_CALLBACK;
00276                 rdi.nCol        = 0;
00277                 rdi.lParam      = (LPARAM)children[n];
00278
00279                 hr = pResultData->InsertItem( &rdi );
00280
00281                 _ASSERT( SUCCEEDED(hr) );
00282             }
00283         }
00284
00285         pHeaderCtrl->Release();
00286         pResultData->Release();
00287     }
00288
00289     return hr;
00290 }
00291
00292 const _TCHAR *CBicycle::GetDisplayName(int nCol)
00293 {
00294     _TCHAR buf[128];
00295
00296     wsprintf(buf, _T("Bicycle #%d"), id);
00297
00298     _TCHAR *pszCol =
00299         static_cast<_TCHAR *>(CoTaskMemAlloc((_tcslen(buf) + 1) * sizeof(WCHAR)));
00300     _tcscpy(pszCol, buf);
00301
00302     return pszCol;
00303 }
00304
00305 const _TCHAR *CSkateboard::GetDisplayName(int nCol)
00306 {
00307     _TCHAR buf[128];
00308
00309     wsprintf(buf, _T("Skateboard #%d"), id);
00310
00311     _TCHAR *pszCol =
00312         static_cast<_TCHAR *>(CoTaskMemAlloc((_tcslen(buf) + 1) * sizeof(WCHAR)));
00313     _tcscpy(pszCol, buf);
00314
00315     return pszCol;
00316 }
00317
00318 const _TCHAR *CIceSkate::GetDisplayName(int nCol)
00319 {
00320     _TCHAR buf[128];
00321
00322     wsprintf(buf, _T("Ice Skate #%d"), id);
00323
00324     _TCHAR *pszCol =
00325         static_cast<_TCHAR *>(CoTaskMemAlloc((_tcslen(buf) + 1) * sizeof(WCHAR)));
00326     _tcscpy(pszCol, buf);
00327
00328     return pszCol;
00329 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/precomp.h Source File

  • Web
  • NetMeeting
  • NMChat2

precomp.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       PRECOMP.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1999-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef _PRECOMP_H
00016 #define _PRECOMP_H
00017
00018 // System Include files
00019 #include <windows.h>
00020 #include <windowsx.h>
00021 #include <commctrl.h>
00022 #include <tchar.h>
00023 #include <ocidl.h>
00024 #include <stdio.h>
00025
00026 #include "imsconf2.h"
00027 #include "iapplet.h"
00028
00029
00030 #define ARRAY_ELEMENTS(rg)      (sizeof(rg) / sizeof(rg[0]))
00031 #define CCHMAX(sz)              (sizeof(sz) / sizeof(TCHAR))
00032
00033 #define MAX_MEMBERS         8
00034
00035 #ifdef DEBUG
00036 __inline void MyDebugBreak(void) { ::DebugBreak(); }
00037 #define ASSERT(f)       if (! (f)) { MyDebugBreak(); }
00038 #else
00039 #define ASSERT(f)
00040 #endif
00041
00042 class CApplet;
00043 class CAppletSession;
00044 class CMember;
00045
00046 void UiDisplayMsg(LPTSTR pszMsg, LPTSTR pszMemberName = NULL);
00047 void UiDisplaySysMsg(LPTSTR pszMsg, LPTSTR pszMemberName = NULL);
00048 void UiAddMember(CMember *pMember);
00049 void UiRemoveMember(CMember *pMember);
00050 extern HWND g_hwndMain;
00051 extern HINSTANCE g_hInstExe;
00052
00053 #include "conf.h"
00054 #include "session.h"
00055 #include "applet.h"
00056
00057 #include "resource.h"
00058
00059 #endif /* _PRECOMP_H */
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyMemberSetChangeListener/MyMemberSetChangeListener.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyMemberSetChangeListener

MyMemberSetChangeListener.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      MyMemberSetChangeListener.cpp
00005 //
00006 //  Description:
00007 //      Implementation of CMyMemberSetChangeListener class.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 #include "stdafx.h"
00012 #include "MyMemberSetChangeListener.h"
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 //++
00016 //
00017 //  CMyMemberSetChangeListener::CMyMemberSetChangeListener
00018 //
00019 //  Description:
00020 //      Constructor of the CMyMemberSetChangeListener class.
00021 //
00022 //  Arguments:
00023 //      None.
00024 //
00025 //  Return Value:
00026 //      None.
00027 //
00028 //--
00029 //////////////////////////////////////////////////////////////////////////////
00030 CMyMemberSetChangeListener::CMyMemberSetChangeListener( void )
00031     : m_lcid( LOCALE_NEUTRAL )
00032     , m_piccCallback( NULL )
00033 {
00034 } //*** CMyMemberSetChangeListener::CMyMemberSetChangeListener
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 //++
00038 //
00039 //  CMyMemberSetChangeListener::~CMyMemberSetChangeListener
00040 //
00041 //  Description:
00042 //      Destructor of the CMyMemberSetChangeListener class.
00043 //
00044 //  Arguments:
00045 //      None.
00046 //
00047 //  Return Value:
00048 //      None.
00049 //
00050 //--
00051 //////////////////////////////////////////////////////////////////////////////
00052 CMyMemberSetChangeListener::~CMyMemberSetChangeListener( void )
00053 {
00054     // Release the callback interface
00055     if ( m_piccCallback != NULL )
00056     {
00057         m_piccCallback->Release();
00058     } // if: the callback interface pointer is not NULL
00059
00060 } //*** CMyMemberSetChangeListener::~CMyMemberSetChangeListener
00061
00062
00063 //***************************************************************************
00064 //
00065 //  IClusCfgMemberSetChangeListener interface
00066 //
00067 //***************************************************************************
00068
00069 //////////////////////////////////////////////////////////////////////////////
00070 //++
00071 //
00072 //  [IClusCfgMemberSetChangeListener]
00073 //  CMyMemberSetChangeListener::Notify
00074 //
00075 //  Description:
00076 //      This function gets called just after a node is added/removed to/from the cluster.
00077 //
00078 //  Arguments:
00079 //      punkIn
00080 //          Pointer to a COM object that implements
00081 //          IClusCfgResourceTypeCreate.
00082 //
00083 //  Return Value:
00084 //      S_OK
00085 //          Operation completed successfully.
00086 //
00087 //      Other HRESULTs
00088 //          An error occurred.
00089 //
00090 //--
00091 //////////////////////////////////////////////////////////////////////////////
00092 STDMETHODIMP
00093 CMyMemberSetChangeListener::Notify( IUnknown * punkIn )
00094 {
00095      //
00096     // TODO: Modify this code to perform your tasks.
00097     //
00098
00099     HRESULT                 hr = S_OK;
00100     WCHAR                   szMessage[] = L"MyMemberSetChangeListener Message: There has been a member set change in this cluster.";
00101
00102     UNREFERENCED_PARAMETER( punkIn );
00103
00104     if ( m_piccCallback != NULL )
00105     {
00106         //
00107         // Log a message to client and server log file informing that there has
00108         // been a member set change in this cluster.
00109         //
00110         hr = m_piccCallback->SendStatusReport(
00111                   NULL      // pcszNodeNameIn - Filled in by cluster config server.
00112                 , TASKID_Major_Configure_Resources
00113                 , TASKID_Minor_MyMemberSetChange_Info
00114                 , 0         // ulMinIn
00115                 , 1         // ulMaxIn
00116                 , 1         // ulCurrentIn
00117                 , hr
00118                 , szMessage
00119                 , NULL      // pftTimeIn - Filled in by cluster config server.
00120                 , NULL      // bstrReferenceIn
00121                 );
00122
00123         if ( FAILED( hr ) )
00124         {
00125             goto Cleanup;
00126         } // if:
00127     } //if: the callback interface pointer is not NULL
00128
00129 Cleanup:
00130
00131     return hr;
00132
00133 } //*** CMyMemberSetChangeListener::Notify
00134
00135
00136 //***************************************************************************
00137 //
00138 //  IClusCfgInitialize interface
00139 //
00140 //***************************************************************************
00141
00142 //////////////////////////////////////////////////////////////////////////////
00143 //++
00144 //
00145 //  CMyMemberSetChangeListener::Initialize
00146 //
00147 //  Description:
00148 //      Initialize this component.
00149 //
00150 //  Arguments:
00151 //      punkCallbackIn
00152 //          Pointer to the IUnknown interface of a component that implements
00153 //          the IClusCfgCallback interface.
00154 //
00155 //      lcidIn
00156 //          Locale id for this component.
00157 //
00158 //  Return Value:
00159 //      S_OK
00160 //          If the call succeeded.
00161 //
00162 //      E_POINTER
00163 //          The punkCallbackIn param is NULL.
00164 //
00165 //      Other HRESULTs
00166 //          An error occurred.
00167 //
00168 //--
00169 //////////////////////////////////////////////////////////////////////////////
00170 STDMETHODIMP
00171 CMyMemberSetChangeListener::Initialize(
00172       IUnknown *   punkCallbackIn
00173     , LCID         lcidIn
00174     )
00175 {
00176     HRESULT hr = S_OK;
00177
00178     m_lcid = lcidIn;
00179
00180     if ( m_piccCallback != NULL )
00181     {
00182         //
00183         // Release the callback interface
00184         //
00185         m_piccCallback->Release();
00186         m_piccCallback = NULL;
00187     } // if: the callback interface pointer is not NULL
00188
00189     if ( punkCallbackIn != NULL )
00190     {
00191         //
00192         // Query for the IClusCfgCallback interface.
00193         //
00194         hr = punkCallbackIn->QueryInterface( __uuidof( IClusCfgCallback ), reinterpret_cast< void ** > ( &m_piccCallback ) );
00195     } // if: the callback punk is not NULL.
00196     else
00197     {
00198         hr = E_POINTER;
00199     } // else: the callback punk is NULL.
00200
00201     return hr;
00202
00203 } //*** CMyMemberSetChangeListener::Initialize
00204
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAnnotator Member List

This is the complete list of members for CAnnotator, including all inherited members.
AddComment() | CAnnotator |
AttachAnnotator(IHTMLDocument2 *pDoc) | CAnnotator |
CAnnotator() | CAnnotator | [inline]
CloseCommentEditBox() | CAnnotator | [private]
DetachAnnotator() | CAnnotator |
m_hOldCursor | CAnnotator | [private]
m_spCommentEditBox | CAnnotator | [private]
m_spDesigner | CAnnotator | [private]
m_spDoc | CAnnotator | [private]
m_spSrcElem | CAnnotator | [private]
OnDraw(ATL_DRAWINFO &di) | CAnnotator | [inline, private]
OpenCommentEditBox(IHTMLElement *pSrcElem) | CAnnotator | [private]
PostEditorEventNotify(DISPID inEvtDispId, IHTMLEventObj *pIEventObj) | CAnnotator |
PostHandleEvent(DISPID inEvtDispId, IHTMLEventObj *pIEventObj) | CAnnotator |
PreHandleEvent(DISPID inEvtDispId, IHTMLEventObj *pIEventObj) | CAnnotator |
ShowCommentGlyphs(BOOL bShow) | CAnnotator |
TranslateAccelerator(DISPID inEvtDispId, IHTMLEventObj *pIEventObj) | CAnnotator |
Generated on Wed Nov 13 2024 16:55:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Resource.h Source File

  • WinUI
  • Shell
  • SampView

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by SampView.rc
00004 //
00005 #define IDS_COLUMN1                     1
00006 #define IDS_COLUMN2                     2
00007 #define IDS_TB_COMMAND                  3
00008 #define IDS_MI_COMMAND                  4
00009 #define IDS_EXT_TITLE                   5
00010 #define IDS_MI_FILEITEM                 6
00011 #define IDS_FOLDER                      7
00012 #define IDS_VIEW                        8
00013 #define IDS_VIEW_LARGE                  9
00014 #define IDS_VIEW_SMALL                  10
00015 #define IDS_VIEW_LIST                   11
00016 #define IDS_VIEW_DETAILS                12
00017 #define IDS_NEW                         13
00018 #define IDS_NEW_FOLDER                  14
00019 #define IDS_NEW_ITEM                    15
00020 #define IDS_PASTE                       16
00021 #define IDS_EXPLORE                     17
00022 #define IDS_OPEN                        18
00023 #define IDS_RENAME                      19
00024 #define IDS_CUT                         20
00025 #define IDS_COPY                        21
00026 #define IDS_DELETE                      22
00027 #define IDS_MODIFY_DATA                 23
00028 #define IDS_ITEM                        24
00029 #define IDS_FOLDER_DATA                 25
00030 #define IDI_MAINICON                    100
00031 #define IDR_ACCELS                      101
00032 #define IDD_ITEMDATADLG                 102
00033 #define IDC_DATA                        1001
00034
00035 // Next default values for new objects
00036 //
00037 #ifdef APSTUDIO_INVOKED
00038 #ifndef APSTUDIO_READONLY_SYMBOLS
00039 #define _APS_NEXT_RESOURCE_VALUE        103
00040 #define _APS_NEXT_COMMAND_VALUE         2001
00041 #define _APS_NEXT_CONTROL_VALUE         1002
00042 #define _APS_NEXT_SYMED_VALUE           101
00043 #endif
00044 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/CAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

CAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CAR.CPP
00003
00004   Summary:   Implementation file for the COCar COM Object Class (for
00005              aggregatable Car COM Objects).
00006
00007              COCar offers a main IUnknown interface and the ICar
00008              interface (Car-related features).  This multiple interface
00009              COM Object Class is achieved via the technique of nested
00010              classes.  The implementation of the ICar interface is
00011              nested inside of the COCar Class.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial DLLSERVE.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the module's source code.
00017
00018   Classes:   COCar.
00019
00020   Functions: none.
00021
00022   Origin:    9-11-95: atrent - Editor-inheritance from CAR.CPP in
00023                the COMOBJ Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040
00041 /*---------------------------------------------------------------------------
00042   We include WINDOWS.H for all Win32 applications.
00043   We include OLE2.H because we will be calling the COM/OLE Libraries.
00044   We include APPUTIL.H because we will be building this application using
00045     the convenient Virtual Window and Dialog classes and other
00046     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00047   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00048     class, GUID, and CLSID specifications.
00049   We include SERVER.H because it has internal class declarations and
00050     resource ID definitions specific for this DLL.
00051   We include CAR.H because it has the class COCar declarations.
00052 ---------------------------------------------------------------------------*/
00053 #include <windows.h>
00054 #include <ole2.h>
00055 #include <apputil.h>
00056 #include <icars.h>
00057 #include <carguids.h>
00058 #include "server.h"
00059 #include "car.h"
00060
00061
00062 /*---------------------------------------------------------------------------
00063   COCar's implementation of its main COM object class including
00064   Constructor, Destructor, QueryInterface, AddRef, and Release.
00065 ---------------------------------------------------------------------------*/
00066
00067 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00068   Method:   COCar::COCar
00069
00070   Summary:  COCar Constructor. Note the member initializer:
00071             "m_ImpICar(this, pUnkOuter)" which is used to pass the 'this'
00072             and pUnkOuter pointers of this constructor function to the
00073             constructor in the instantiation of the implementation of
00074             the CImpICar interface (which is nested inside this present
00075             COCar Object Class).
00076
00077   Args:     IUnknown* pUnkOuter,
00078               Pointer to the the outer Unknown.  NULL means this COM Object
00079               is not being Aggregated.  Non NULL means it is being created
00080               on behalf of an outside COM object that is reusing it via
00081               aggregation.
00082             CServer* pServer)
00083               Pointer to the server's control object.
00084
00085   Modifies: m_cRefs, m_pUnkOuter, m_pServer.
00086
00087   Returns:  void
00088 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00089 COCar::COCar(
00090   IUnknown* pUnkOuter,
00091   CServer* pServer) :
00092   m_ImpICar(this, pUnkOuter)
00093 {
00094   // Zero the COM object's reference count.
00095   m_cRefs = 0;
00096
00097   // No AddRef necessary if non-NULL, as we're nested.
00098   m_pUnkOuter = pUnkOuter;
00099
00100   // Assign the pointer to the server control object.
00101   m_pServer = pServer;
00102
00103   LOGF1("S: COCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00104
00105   return;
00106 }
00107
00108
00109 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00110   Method:   COCar::~COCar
00111
00112   Summary:  COCar Destructor.
00113
00114   Args:     void
00115
00116   Returns:  void
00117 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00118 COCar::~COCar(void)
00119 {
00120   LOG("S: COCar::Destructor.");
00121
00122   return;
00123 }
00124
00125
00126 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00127   Method:   COCar::QueryInterface
00128
00129   Summary:  QueryInterface of the COCar non-delegating
00130             IUnknown implementation.
00131
00132   Args:     REFIID riid,
00133               [in] GUID of the Interface being requested.
00134             PPVOID ppv)
00135               [out] Address of the caller's pointer variable that will
00136               receive the requested interface pointer.
00137
00138   Returns:  HRESULT
00139 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00140 STDMETHODIMP COCar::QueryInterface(
00141                REFIID riid,
00142                PPVOID ppv)
00143 {
00144   HRESULT hr = E_NOINTERFACE;
00145   *ppv = NULL;
00146
00147   if (IID_IUnknown == riid)
00148   {
00149     *ppv = this;
00150     LOG("S: COCar::QueryInterface. 'this' pIUnknown returned.");
00151   }
00152   else if (IID_ICar == riid)
00153   {
00154     *ppv = &m_ImpICar;
00155     LOG("S: COCar::QueryInterface. pICar returned.");
00156   }
00157
00158   if (NULL != *ppv)
00159   {
00160     // We've handed out a pointer to the interface so obey the COM rules
00161     //   and AddRef the reference count.
00162     ((LPUNKNOWN)*ppv)->AddRef();
00163     hr = NOERROR;
00164   }
00165
00166   return (hr);
00167 }
00168
00169
00170 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00171   Method:   COCar::AddRef
00172
00173   Summary:  AddRef of the COCar non-delegating IUnknown implementation.
00174
00175   Args:     void
00176
00177   Modifies: m_cRefs.
00178
00179   Returns:  ULONG
00180               New value of m_cRefs (COM object's reference count).
00181 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00182 STDMETHODIMP_(ULONG) COCar::AddRef(void)
00183 {
00184   m_cRefs++;
00185
00186   LOGF1("S: COCar::AddRef. New cRefs=%i.", m_cRefs);
00187
00188   return m_cRefs;
00189 }
00190
00191
00192 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00193   Method:   COCar::Release
00194
00195   Summary:  Release of the COCar non-delegating IUnknown implementation.
00196
00197   Args:     void
00198
00199   Modifies: m_cRefs.
00200
00201   Returns:  ULONG
00202               New value of m_cRefs (COM object's reference count).
00203 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00204 STDMETHODIMP_(ULONG) COCar::Release(void)
00205 {
00206   m_cRefs--;
00207
00208   LOGF1("S: COCar::Release. New cRefs=%i.", m_cRefs);
00209
00210   if (0 == m_cRefs)
00211   {
00212     // We've reached a zero reference count for this COM object.
00213     // So we tell the server housing to decrement its global object
00214     // count so that the server will be unloaded if appropriate.
00215     if (NULL != m_pServer)
00216       m_pServer->ObjectsDown();
00217
00218     // We artificially bump the main ref count to prevent reentrancy
00219     // via the main object destructor.  Not really needed in this
00220     // COCar but a good practice because we are aggregatable and
00221     // may at some point in the future add something entertaining like
00222     // some Releases to the COCar destructor.
00223     m_cRefs++;
00224     delete this;
00225   }
00226
00227   return m_cRefs;
00228 }
00229
00230
00231 /*---------------------------------------------------------------------------
00232   COCar's nested implementation of the ICar interface including
00233   Constructor, Destructor, QueryInterface, AddRef, Release,
00234   Shift, Clutch, Speed, and Steer.
00235 ---------------------------------------------------------------------------*/
00236
00237 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00238   Method:   COCar::CImpICar::CImpICar
00239
00240   Summary:  Constructor for the CImpICar interface instantiation.
00241
00242   Args:     COCar* pBackObj,
00243               Back pointer to the parent outer object.
00244             IUnknown* pUnkOuter
00245               Pointer to the outer Unknown.  For delegation.
00246
00247   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00248
00249   Returns:  void
00250 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00251 COCar::CImpICar::CImpICar(
00252   COCar* pBackObj,
00253   IUnknown* pUnkOuter)
00254 {
00255   // Init the Interface Ref Count (used for debugging only).
00256   m_cRefI = 0;
00257
00258   // Init the Back Object Pointer to point to the parent object.
00259   m_pBackObj = pBackObj;
00260
00261   // Init the CImpICar interface's delegating Unknown pointer.  We use
00262   // the Back Object pointer for IUnknown delegation here if we are not
00263   // being aggregated.  If we are being aggregated we use the supplied
00264   // pUnkOuter for IUnknown delegation.  In either case the pointer
00265   // assignment requires no AddRef because the CImpICar lifetime is
00266   // quaranteed by the lifetime of the parent object in which
00267   // CImpICar is nested.
00268   if (NULL == pUnkOuter)
00269   {
00270     m_pUnkOuter = pBackObj;
00271     LOG("S: COCar::CImpICar Constructor. Non-Aggregating.");
00272   }
00273   else
00274   {
00275     m_pUnkOuter = pUnkOuter;
00276     LOG("S: COCar::CImpICar Constructor. Aggregating.");
00277   }
00278
00279   return;
00280 }
00281
00282
00283 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00284   Method:   COCar::CImpICar::~CImpICar
00285
00286   Summary:  Destructor for the CImpICar interface instantiation.
00287
00288   Args:     void
00289
00290   Returns:  void
00291 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00292 COCar::CImpICar::~CImpICar(void)
00293 {
00294   LOG("S: COCar::CImpICar Destructor.");
00295
00296   return;
00297 }
00298
00299
00300 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00301   Method:   COCar::CImpICar::QueryInterface
00302
00303   Summary:  The QueryInterface IUnknown member of this ICar interface
00304             implementation that delegates to m_pUnkOuter, whatever it is.
00305
00306   Args:     REFIID riid,
00307               [in] GUID of the Interface being requested.
00308             PPVOID ppv)
00309               [out] Address of the caller's pointer variable that will
00310               receive the requested interface pointer.
00311
00312   Returns:  HRESULT
00313               Returned by the delegated outer QueryInterface call.
00314 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00315 STDMETHODIMP COCar::CImpICar::QueryInterface(
00316                REFIID riid,
00317                PPVOID ppv)
00318 {
00319   LOG("S: COCar::CImpICar::QueryInterface. Delegating.");
00320
00321   // Delegate this call to the outer object's QueryInterface.
00322   return m_pUnkOuter->QueryInterface(riid, ppv);
00323 }
00324
00325
00326 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00327   Method:   COCar::CImpICar::AddRef
00328
00329   Summary:  The AddRef IUnknown member of this ICar interface
00330             implementation that delegates to m_pUnkOuter, whatever it is.
00331
00332   Args:     void
00333
00334   Modifies: m_cRefI.
00335
00336   Returns:  ULONG
00337               Returned by the delegated outer AddRef call.
00338 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00339 STDMETHODIMP_(ULONG) COCar::CImpICar::AddRef(void)
00340 {
00341   // Increment the Interface Reference Count.
00342   ++m_cRefI;
00343
00344   LOGF1("S: COCar::CImpICar::Addref. Delegating. New cI=%i.", m_cRefI);
00345
00346   // Delegate this call to the outer object's AddRef.
00347   return m_pUnkOuter->AddRef();
00348 }
00349
00350
00351 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00352   Method:   COCar::CImpICar::Release
00353
00354   Summary:  The Release IUnknown member of this ICar interface
00355             implementation that delegates to m_pUnkOuter, whatever it is.
00356
00357   Args:     void
00358
00359   Returns:  ULONG
00360               Returned by the delegated outer Release call.
00361 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00362 STDMETHODIMP_(ULONG) COCar::CImpICar::Release(void)
00363 {
00364   // Decrement the Interface Reference Count.
00365   --m_cRefI;
00366
00367   LOGF1("S: COCar::CImpICar::Release. Delegating. New cI=%i.", m_cRefI);
00368
00369   // Delegate this call to the outer object's Release.
00370   return m_pUnkOuter->Release();
00371 }
00372
00373
00374 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00375   Method:   COCar::CImpICar::Shift
00376
00377   Summary:  The Shift member method of this ICar interface implementation.
00378             A simple empty method on a COCar COM object for tutorial
00379             purposes.  Presumably if this Car object were modeling
00380             a real Car then the Shift method would shift to the specified
00381             gear.
00382
00383   Args:     short nGear
00384               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00385
00386   Returns:  HRESULT
00387               NOERROR
00388 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00389 STDMETHODIMP COCar::CImpICar::Shift(
00390                short nGear)
00391 {
00392   LOGF1("S: COCar::CImpICar::Shift. Called. nGear=%i.",nGear);
00393
00394   return NOERROR;
00395 }
00396
00397
00398 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00399   Method:   COCar::CImpICar::Clutch
00400
00401   Summary:  The Clutch member method of this ICar interface implementation.
00402             A simple empty method on a COCar COM object for tutorial
00403             purposes.  Presumably if this Car object were modeling
00404             a real Car then the Clutch method would engage the clutch the
00405             specified amount.
00406
00407   Args:     short nEngaged)
00408               Percent clutch is engaged (0 to 100%).
00409
00410   Returns:  HRESULT
00411               NOERROR
00412 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00413 STDMETHODIMP COCar::CImpICar::Clutch(
00414                short nEngaged)
00415 {
00416   LOGF1("S: COCar::CImpICar::Clutch. Called. nEngaged=%i.",nEngaged);
00417
00418   return NOERROR;
00419 }
00420
00421
00422 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00423   Method:   COCar::CImpICar::Speed
00424
00425   Summary:  The Speed member method of this ICar interface implementation.
00426             A simple empty method on a COCar COM object for tutorial
00427             purposes.  Presumably if this Car object were modeling
00428             a real Car then this method would accelerate/brake to bring
00429             the car to the specified speed.
00430
00431   Args:     short nMph
00432               New speed in miles per hour.
00433
00434   Returns:  HRESULT
00435               NOERROR
00436 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00437 STDMETHODIMP COCar::CImpICar::Speed(
00438                short nMph)
00439 {
00440   LOGF1("S: COCar::CImpICar::Speed. Called. nMph=%i.",nMph);
00441
00442   return NOERROR;
00443 }
00444
00445
00446 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00447   Method:   COCar::CImpICar::Steer
00448
00449   Summary:  The Steer member method of this ICar interface implementation.
00450             A simple empty method on a COCar COM object for tutorial
00451             purposes.  Presumably if this Car object were modeling
00452             a real Car then the Steer method would set the steering
00453             angle of the Car.
00454
00455   Args:     short nAngle)
00456               0 degrees straight ahead, -45 Full left, +45 Full right.
00457
00458   Returns:  HRESULT
00459               NOERROR
00460 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00461 STDMETHODIMP COCar::CImpICar::Steer(
00462                short nAngle)
00463 {
00464   LOGF1("S: COCar::CImpICar::Steer. Called. nAngle=%i.",nAngle);
00465
00466   return NOERROR;
00467 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/llistimpl.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

llistimpl.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //  This is a part of the MMC SDK.
00003 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  MMC SDK Reference and related
00008 //  electronic documentation provided with the library.
00009 //  See these sources for detailed information regarding the
00010 //  MMC Library product.
00011 //
00012 //  LListImple.h:  Definition and implementation of CLListImpl.  This is a
00013 //                 generic linked list class which emulates CList from MFC.
00014 //
00015
00016
00017 #ifndef __CLASS_CLLISTIMPL__
00018 #define __CLASS_CLLISTIMPL__
00019
00020 #if _MSC_VER > 1000
00021 #pragma once
00022 #endif // _MSC_VER > 1000
00023
00024 #include <CrtDbg.h>
00025 #include <Windows.h>
00026 #include <new.h>
00027
00028
00029 // Abstract iteration position
00030 struct  __POSITION { };
00031 typedef __POSITION*  POSITION;
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 //  CPlex stuff for allocating nodes
00035 //
00036
00037 //---------------------------------------------------------------------------
00038 struct CPlex     // warning variable length structure
00039 {
00040   CPlex* pNext;
00041 //#if (_AFX_PACKING >= 8)
00042   DWORD dwReserved[1];    // align on 8 byte boundary
00043 //#endif
00044
00045   // BYTE data[maxNum*elementSize];
00046
00047   void* data() { return this+1; }
00048
00049   static CPlex* PASCAL Create(CPlex*& head, UINT nMax, UINT cbElement);
00050       // like 'calloc' but no zero fill
00051       // may throw memory exceptions
00052
00053   void FreeDataChain();       // free this one and links
00054 };
00055
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 //  Helpers
00059 //
00060
00061 BOOL IsValidAddress( const void*  lp, UINT nBytes, BOOL bReadWrite = TRUE );
00062
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // CLListImpl<TYPE, ARG_TYPE>
00066
00067 template<class TYPE, class ARG_TYPE>
00068 class CLListImpl
00069 {
00070   public:
00071     CLListImpl( int nBlockSize = 10 );
00072     ~CLListImpl();
00073
00074   protected:
00075     struct CNode
00076     {
00077       CNode* pNext;
00078       CNode* pPrev;
00079       TYPE   data;
00080     };
00081
00082   public:
00083                                          // Attributes (head and tail)
00084    int       GetCount() const;
00085    BOOL      IsEmpty() const;
00086
00087    TYPE&     GetHead();                  // Peek at head and tail
00088    TYPE      GetHead() const;
00089    TYPE&     GetTail();
00090    TYPE      GetTail() const;
00091                                          // Operations
00092    TYPE      RemoveHead();
00093    TYPE      RemoveTail();
00094                                          // Add before head or after tail
00095    POSITION  AddHead( ARG_TYPE NewElement );
00096    POSITION  AddTail( ARG_TYPE NewElement );
00097
00098    void      AddHead(CLListImpl* pNewList);  // Add another list
00099    void      AddTail(CLListImpl* pNewList);
00100
00101    void      RemoveAll();                // Remove all elements
00102
00103    POSITION  GetHeadPosition() const;
00104    POSITION  GetTailPosition() const;
00105    TYPE&     GetNext(POSITION& rPosition);       // return *Position++
00106    TYPE      GetNext(POSITION& rPosition) const; // return *Position++
00107    TYPE&     GetPrev(POSITION& rPosition);       // return *Position--
00108    TYPE      GetPrev(POSITION& rPosition) const; // return *Position--
00109
00110    // Getting/modifying an element at a given position
00111    TYPE&     GetAt(POSITION Position);
00112    TYPE      GetAt(POSITION Position) const;
00113    void      SetAt(POSITION Pos, ARG_TYPE NewElement);
00114    void      RemoveAt(POSITION Position);
00115
00116    // inserting before or after a given position
00117    POSITION InsertBefore(POSITION position, ARG_TYPE newElement);
00118    POSITION InsertAfter(POSITION position, ARG_TYPE newElement);
00119
00120    // Helper functions (note: O(n) speed)
00121
00122    // Defaults to starting at the HEAD, return NULL if not found
00123    POSITION Find(ARG_TYPE SearchValue, POSITION StartAfter = NULL) const;
00124
00125    // Get the 'nIndex'th element (may return NULL)
00126    POSITION FindIndex(int nIndex) const;
00127
00128   // Implementation
00129   protected:
00130     CNode*   m_pNodeHead;
00131     CNode*   m_pNodeTail;
00132     int      m_nCount;
00133     CNode*   m_pNodeFree;
00134     struct   CPlex* m_pBlocks;
00135     int m_nBlockSize;
00136
00137     CNode*   NewNode(CNode*, CNode*);
00138     void     FreeNode(CNode*);
00139
00140 #ifdef _DEBUG
00141
00142   void AssertValid() const;
00143
00144 #endif //_DEBUG
00145
00146 }; //end class CLListImpl
00147
00148 /////////////////////////////////////////////////////////////////////////////
00149 // CLListImpl<TYPE, ARG_TYPE> inline functions
00150
00151 template<class TYPE, class ARG_TYPE>
00152 inline int CLListImpl<TYPE, ARG_TYPE>::GetCount() const
00153   { return m_nCount; }
00154
00155 template<class TYPE, class ARG_TYPE>
00156 inline BOOL CLListImpl<TYPE, ARG_TYPE>::IsEmpty() const
00157   { return m_nCount == 0; }
00158
00159 template<class TYPE, class ARG_TYPE>
00160 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetHead()
00161   {
00162     _ASSERT( NULL != m_pNodeHead );
00163     return m_pNodeHead->data;
00164   }
00165
00166 template<class TYPE, class ARG_TYPE>
00167 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetHead() const
00168   {
00169     _ASSERT( NULL != m_pNodeHead );
00170     return m_pNodeHead->data;
00171   }
00172
00173 template<class TYPE, class ARG_TYPE>
00174 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetTail()
00175   {
00176     _ASSERT( NULL != m_pNodeTail );
00177     return m_pNodeTail->data;
00178   }
00179
00180 template<class TYPE, class ARG_TYPE>
00181 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetTail() const
00182   {
00183     _ASSERT( NULL != m_pNodeTail );
00184     return m_pNodeTail->data;
00185   }
00186
00187 template<class TYPE, class ARG_TYPE>
00188 inline POSITION CLListImpl<TYPE, ARG_TYPE>::GetHeadPosition() const
00189   { return (POSITION)m_pNodeHead; }
00190
00191 template<class TYPE, class ARG_TYPE>
00192 inline POSITION CLListImpl<TYPE, ARG_TYPE>::GetTailPosition() const
00193   { return (POSITION)m_pNodeTail; }
00194
00195 template<class TYPE, class ARG_TYPE>
00196 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetNext(POSITION& rPosition) // return *Position++
00197   {
00198     CNode* pNode = (CNode*) rPosition;
00199     _ASSERT(IsValidAddress(pNode, sizeof(CNode)));
00200     rPosition = (POSITION) pNode->pNext;
00201     return pNode->data;
00202   }
00203
00204 template<class TYPE, class ARG_TYPE>
00205 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetNext(POSITION& rPosition) const // return *Position++
00206   {
00207     CNode* pNode = (CNode*) rPosition;
00208     _ASSERT(IsValidAddress(pNode, sizeof(CNode)));
00209     rPosition = (POSITION) pNode->pNext;
00210     return pNode->data;
00211   }
00212
00213 template<class TYPE, class ARG_TYPE>
00214 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetPrev(POSITION& rPosition) // return *Position--
00215   {
00216     CNode* pNode = (CNode*) rPosition;
00217     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00218     rPosition = (POSITION) pNode->pPrev;
00219     return pNode->data;
00220   }
00221
00222 template<class TYPE, class ARG_TYPE>
00223 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetPrev(POSITION& rPosition) const // return *Position--
00224   {
00225     CNode* pNode = (CNode*) rPosition;
00226     ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00227     rPosition = (POSITION) pNode->pPrev;
00228     return pNode->data;
00229   }
00230
00231 template<class TYPE, class ARG_TYPE>
00232 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetAt(POSITION Position)
00233   {
00234     CNode* pNode = (CNode*)Position;
00235     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00236     return pNode->data;
00237   }
00238
00239 template<class TYPE, class ARG_TYPE>
00240 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetAt(POSITION Position) const
00241   {
00242     CNode* pNode = (CNode*) Position;
00243     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00244     return pNode->data;
00245   }
00246
00247 template<class TYPE, class ARG_TYPE>
00248 inline void CLListImpl<TYPE, ARG_TYPE>::SetAt(POSITION Pos, ARG_TYPE NewElement)
00249   {
00250     CNode* pNode = (CNode*)Pos;
00251     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00252     pNode->data = newElement;
00253   }
00254
00255
00256 template<class TYPE, class ARG_TYPE>
00257 CLListImpl<TYPE, ARG_TYPE>::CLListImpl( int nBlockSize )
00258 {
00259   _ASSERT( nBlockSize > 0 );
00260
00261   m_nCount     = 0;
00262   m_pNodeHead  = m_pNodeTail = m_pNodeFree = NULL;
00263   m_pBlocks    = NULL;
00264   m_nBlockSize = nBlockSize;
00265 }
00266
00267 template<class TYPE, class ARG_TYPE>
00268 void CLListImpl<TYPE, ARG_TYPE>::RemoveAll()
00269 {
00270   // destroy elements
00271   CNode* pNode;
00272   for( pNode = m_pNodeHead; pNode != NULL; pNode = pNode->pNext )
00273     (pNode->data).~TYPE();
00274
00275   m_nCount = 0;
00276   m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL;
00277   m_pBlocks->FreeDataChain();
00278   m_pBlocks = NULL;
00279 }
00280
00281 template<class TYPE, class ARG_TYPE>
00282 CLListImpl<TYPE, ARG_TYPE>::~CLListImpl()
00283 {
00284   RemoveAll();
00285   _ASSERT(m_nCount == 0);
00286 }
00287
00288
00289 /////////////////////////////////////////////////////////////////////////////
00290 // Node helpers
00291 //
00292 //  Implementation note: CNode's are stored in CPlex blocks and
00293 //  chained together. Free blocks are maintained in a singly linked list
00294 //  using the 'pNext' member of CNode with 'm_pNodeFree' as the head.
00295 //  Used blocks are maintained in a doubly linked list using both 'pNext'
00296 //  and 'pPrev' as links and 'm_pNodeHead' and 'm_pNodeTail'
00297 //  as the head/tail.
00298 //
00299 //  We never free a CPlex block unless the List is destroyed or RemoveAll()
00300 //  is used - so the total number of CPlex blocks may grow large depending
00301 //  on the maximum past size of the list.
00302 //
00303
00304
00305 template<class TYPE, class ARG_TYPE>
00306 CLListImpl<TYPE, ARG_TYPE>::CNode*
00307 CLListImpl<TYPE, ARG_TYPE>::NewNode(CLListImpl::CNode* pPrev, CLListImpl::CNode* pNext)
00308 {
00309   if( NULL == m_pNodeFree )
00310   {
00311     // add another block
00312     CPlex* pNewBlock = CPlex::Create( m_pBlocks, m_nBlockSize, sizeof(CNode) );
00313
00314     // chain them into free list
00315     CNode* pNode = (CNode*) pNewBlock->data();
00316     // free in reverse order to make it easier to debug
00317     pNode += m_nBlockSize - 1;
00318     for( int i = m_nBlockSize-1; i >= 0; i--, pNode-- )
00319     {
00320       pNode->pNext = m_pNodeFree;
00321       m_pNodeFree = pNode;
00322     }
00323   }
00324   _ASSERT( NULL != m_pNodeFree );  // we must have something
00325
00326   CLListImpl::CNode* pNode = m_pNodeFree;
00327   m_pNodeFree = m_pNodeFree->pNext;
00328   pNode->pPrev = pPrev;
00329   pNode->pNext = pNext;
00330   m_nCount++;
00331   _ASSERT(m_nCount > 0);  // make sure we don't overflow
00332
00333   new (&pNode->data) TYPE; // Placement new
00334
00335   return pNode;
00336 }
00337
00338
00339 template<class TYPE, class ARG_TYPE>
00340 void CLListImpl<TYPE, ARG_TYPE>::FreeNode(CLListImpl::CNode* pNode)
00341 {
00342   (pNode->data).~TYPE();
00343   pNode->pNext = m_pNodeFree;
00344   m_pNodeFree = pNode;
00345   m_nCount--;
00346   _ASSERT(m_nCount >= 0);  // make sure we don't underflow
00347
00348   // if no more elements, cleanup completely
00349   if( 0 == m_nCount )
00350     RemoveAll();
00351 }
00352
00353 template<class TYPE, class ARG_TYPE>
00354 POSITION CLListImpl<TYPE, ARG_TYPE>::AddHead( ARG_TYPE NewElement )
00355 {
00356   _ASSERT( NULL != NewElement );
00357
00358   CNode* pNewNode = NewNode( NULL, m_pNodeHead );
00359   pNewNode->data = NewElement;
00360   if( NULL != m_pNodeHead )
00361     m_pNodeHead->pPrev = pNewNode;
00362   else
00363     m_pNodeTail = pNewNode;
00364
00365   m_pNodeHead = pNewNode;
00366   return (POSITION)pNewNode;
00367 }
00368
00369
00370 template<class TYPE, class ARG_TYPE>
00371 POSITION CLListImpl<TYPE, ARG_TYPE>::AddTail(ARG_TYPE NewElement)
00372 {
00373   _ASSERT( NULL != NewElement );
00374
00375   CNode* pNewNode = NewNode( m_pNodeTail, NULL );
00376   pNewNode->data = NewElement;
00377   if( NULL != m_pNodeTail )
00378     m_pNodeTail->pNext = pNewNode;
00379   else
00380     m_pNodeHead = pNewNode;
00381
00382   m_pNodeTail = pNewNode;
00383   return (POSITION)pNewNode;
00384 }
00385
00386
00387 template<class TYPE, class ARG_TYPE>
00388 void CLListImpl<TYPE, ARG_TYPE>::AddHead( CLListImpl* pNewList )
00389 {
00390   _ASSERT( NULL != pNewList );
00391
00392   // Add a list of same elements to head (maintain order)
00393   POSITION Pos = pNewList->GetTailPosition();
00394   while( NULL != Pos )
00395     AddHead(pNewList->GetPrev( Pos ));
00396 }
00397
00398
00399 template<class TYPE, class ARG_TYPE>
00400 void CLListImpl<TYPE, ARG_TYPE>::AddTail(CLListImpl* pNewList)
00401 {
00402   _ASSERT( NULL != pNewList );
00403
00404   // Add a list of same elements
00405   POSITION Pos = pNewList->GetHeadPosition();
00406   while( NULL != Pos )
00407     AddTail(pNewList->GetNext( Pos ));
00408 }
00409
00410
00411 template<class TYPE, class ARG_TYPE>
00412 TYPE CLListImpl<TYPE, ARG_TYPE>::RemoveHead()
00413 {
00414   _ASSERT( NULL != m_pNodeHead );  // don't call on empty list !!!
00415   _ASSERT( IsValidAddress( m_pNodeHead, sizeof(CNode)) );
00416
00417   CNode* pOldNode = m_pNodeHead;
00418   TYPE returnValue = pOldNode->data;
00419
00420   m_pNodeHead = pOldNode->pNext;
00421   if( NULL != m_pNodeHead )
00422     m_pNodeHead->pPrev = NULL;
00423   else
00424     m_pNodeTail = NULL;
00425
00426   FreeNode(pOldNode);
00427   return returnValue;
00428 }
00429
00430
00431 template<class TYPE, class ARG_TYPE>
00432 TYPE CLListImpl<TYPE, ARG_TYPE>::RemoveTail()
00433 {
00434   _ASSERT( NULL != m_pNodeTail );  // don't call on empty list !!!
00435   _ASSERT( IsValidAddress( m_pNodeTail, sizeof(CNode)) );
00436
00437   CNode* pOldNode = m_pNodeTail;
00438   TYPE returnValue = pOldNode->data;
00439
00440   m_pNodeTail = pOldNode->pPrev;
00441   if( NULL != m_pNodeTail )
00442     m_pNodeTail->pNext = NULL;
00443   else
00444     m_pNodeHead = NULL;
00445
00446   FreeNode(pOldNode);
00447   return returnValue;
00448 }
00449
00450
00451 template<class TYPE, class ARG_TYPE>
00452 POSITION CLListImpl<TYPE, ARG_TYPE>::InsertBefore(POSITION Position, ARG_TYPE NewElement)
00453 {
00454   _ASSERT( NULL != NewElement );
00455
00456   if( NULL == Position )
00457     return AddHead( NewElement ); // insert before nothing -> head of the list
00458
00459   // Insert it before position
00460   CNode* pOldNode = (CNode*)Position;
00461   CNode* pNewNode = NewNode( pOldNode->pPrev, pOldNode );
00462   pNewNode->data  = NewElement;
00463
00464   if( NULL != pOldNode->pPrev )
00465   {
00466     _ASSERT( IsValidAddress( pOldNode->pPrev, sizeof(CNode)) );
00467     pOldNode->pPrev->pNext = pNewNode;
00468   }
00469   else
00470   {
00471     _ASSERT( pOldNode == m_pNodeHead );
00472     m_pNodeHead = pNewNode;
00473   }
00474   pOldNode->pPrev = pNewNode;
00475   return (POSITION)pNewNode;
00476 }
00477
00478
00479 template<class TYPE, class ARG_TYPE>
00480 POSITION CLListImpl<TYPE, ARG_TYPE>::InsertAfter(POSITION Position, ARG_TYPE NewElement)
00481 {
00482   ASSERT( NULL != NewElement );
00483
00484   if( NULL == Position )
00485     return AddTail( NewElement ); // insert after nothing -> tail of the list
00486
00487   // Insert it before position
00488   CNode* pOldNode = (CNode*)Position;
00489   _ASSERT( IsValidAddress( pOldNode, sizeof(CNode) ) );
00490   CNode* pNewNode = NewNode( pOldNode, pOldNode->pNext );
00491   pNewNode->data = NewElement;
00492
00493   if( NULL != pOldNode->pNext )
00494   {
00495     _ASSERT( IsValidAddress( pOldNode->pNext, sizeof(CNode)) );
00496     pOldNode->pNext->pPrev = pNewNode;
00497   }
00498   else
00499   {
00500     _ASSERT( pOldNode == m_pNodeTail );
00501     m_pNodeTail = pNewNode;
00502   }
00503   pOldNode->pNext = pNewNode;
00504   return (POSITION)pNewNode;
00505 }
00506
00507
00508 template<class TYPE, class ARG_TYPE>
00509 void CLListImpl<TYPE, ARG_TYPE>::RemoveAt( POSITION Position )
00510 {
00511   _ASSERT( NULL != Position );
00512
00513   CNode* pOldNode = (CNode*)Position;
00514   _ASSERT( IsValidAddress( pOldNode, sizeof(CNode)) );
00515
00516   // Remove pOldNode from list
00517   if( pOldNode == m_pNodeHead )
00518   {
00519     m_pNodeHead = pOldNode->pNext;
00520   }
00521   else
00522   {
00523     _ASSERT( IsValidAddress( pOldNode->pPrev, sizeof(CNode)) );
00524     pOldNode->pPrev->pNext = pOldNode->pNext;
00525   }
00526   if( pOldNode == m_pNodeTail )
00527   {
00528     m_pNodeTail = pOldNode->pPrev;
00529   }
00530   else
00531   {
00532     _ASSERT( IsValidAddress( pOldNode->pNext, sizeof(CNode)) );
00533     pOldNode->pNext->pPrev = pOldNode->pPrev;
00534   }
00535   FreeNode( pOldNode );
00536 }
00537
00538
00539 template<class TYPE, class ARG_TYPE>
00540 POSITION CLListImpl<TYPE, ARG_TYPE>::FindIndex(int nIndex) const
00541 {
00542   if( nIndex >= m_nCount || nIndex < 0 )
00543     return NULL;  // went too far
00544
00545   CNode* pNode = m_pNodeHead;
00546   while (nIndex--)
00547   {
00548     _ASSERT( IsValidAddress( pNode, sizeof(CNode)) );
00549     pNode = pNode->pNext;
00550   }
00551   return (POSITION)pNode;
00552 }
00553
00554
00555 template<class TYPE, class ARG_TYPE>
00556 POSITION CLListImpl<TYPE, ARG_TYPE>::Find(ARG_TYPE SearchValue, POSITION StartAfter) const
00557 {
00558   _ASSERT( NULL != SearchValue );
00559
00560   CNode* pNode = (CNode*)StartAfter;
00561   if( NULL == pNode )
00562   {
00563     pNode = m_pNodeHead;  // start at head
00564   }
00565   else
00566   {
00567     _ASSERT( IsValidAddress( pNode, sizeof(CNode)) );
00568     pNode = pNode->pNext;  // start after the one specified
00569   }
00570
00571   for (; pNode != NULL; pNode = pNode->pNext)
00572     if (CompareElements<TYPE>(&pNode->data, &searchValue))
00573       return (POSITION)pNode;
00574
00575   return NULL;
00576 }
00577
00578 #ifdef _DEBUG
00579
00580 template<class TYPE, class ARG_TYPE>
00581 void CLListImpl<TYPE, ARG_TYPE>::AssertValid() const
00582 {
00583   if( 0 == m_nCount )
00584   {
00585     // empty list
00586     _ASSERT( NULL == m_pNodeHead );
00587     _ASSERT( NULL == m_pNodeTail );
00588   }
00589   else
00590   {
00591     // non-empty list
00592     _ASSERT( IsValidAddress(m_pNodeHead, sizeof(CNode)) );
00593     _ASSERT( IsValidAddress(m_pNodeTail, sizeof(CNode)) );
00594   }
00595 }
00596 #endif //_DEBUG
00597
00598 #endif //__CLASS_CLLISTIMPL__
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/land.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

land.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Land.h"
00021
00022 const GUID CLandBasedVehicle::thisGuid = { 0x2974380e, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CLandBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/InsertionSort.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

InsertionSort.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      InsertionSort.h
00005 //
00006 //  Description:
00007 //      This file contains templates to perform an insertion sort on an array.
00008 //
00009 //  Implementation Files:
00010 //      None.
00011 //
00012 //////////////////////////////////////////////////////////////////////////////
00013
00014 #pragma once
00015
00016
00017 //////////////////////////////////////////////////////////////////////////////
00018 //++
00019 //
00020 //  InsertionSort< Item, PredecessorFunction > template
00021 //
00022 //  Description:
00023 //      InsertionSort(Start, Size, Precedes)
00024 //      reorders the array of Size elements beginning at Start so that
00025 //      for all p and q in [Start, Start + Size),
00026 //      Precedes(*p, *q) implies p < q.
00027 //
00028 //      The notation [begin, end) refers to a half-open interval, so that
00029 //          for ( Item* pItem = begin; pItem < end; ++pItem )
00030 //      iterates through all elements in the array, and
00031 //          end - begin
00032 //      gives the number of elements in the array.
00033 //
00034 //  Template Arguments:
00035 //      Item - the type of the elements in the array.
00036 //          requirements for Item:
00037 //              - copy constructor
00038 //              - assignment operator
00039 //
00040 //      PredecessorFunction
00041 //          The function that determines whether one element should precede
00042 //          another in the sort order
00043 //
00044 //          requirements for PredecessorFunction:
00045 //              - bool operator()( const Item &, const Item & ) const;
00046 //              or, PredecessorFunction can be a pointer to a function
00047 //              taking two Items and returning a bool.
00048 //
00049 //  Function Arguments:
00050 //      pArrayStartIn
00051 //          A pointer to the first element of the array.
00052 //
00053 //      cArraySizeIn
00054 //          The number of elements in the array.
00055 //
00056 //      rPrecedesIn
00057 //          An instance of the predecessor function class, or a pointer to
00058 //          a function with the appropriate signature.
00059 //
00060 //  Return Values:
00061 //      None.
00062 //
00063 //  Remarks:
00064 //      None.
00065 //
00066 //--
00067 //////////////////////////////////////////////////////////////////////////////
00068 template < class Item, class PredecessorFunction >
00069 void
00070 InsertionSort(
00071     Item * pArrayStartIn
00072     , size_t cArraySizeIn
00073     , const PredecessorFunction & rPrecedesIn )
00074 {
00075     ASSERT( pArrayStartIn != NULL );
00076
00077     Item * pCurrentItem;
00078     Item * pSortedLocation;
00079     Item * pNextToCopy;
00080     Item * pArrayEnd = pArrayStartIn + cArraySizeIn;
00081
00082     //
00083     // Insertion sort algorithm; for a good description, see "Introduction to Algorithms"
00084     // by Cormen, Leiserson, and Rivest.
00085     //
00086
00087     //
00088     //  Loop invariant: all items to the left of pCurrentItem are in sorted order.
00089     //  Arrays of size zero or one are considered to be already sorted, so start
00090     //  pCurrentItem at second element in the array (if more than one element exists).
00091     //
00092     for ( pCurrentItem = pArrayStartIn + 1; pCurrentItem < pArrayEnd; ++pCurrentItem )
00093     {
00094         //
00095         //  Find where the current item needs to go to make the loop invariant true for pCurrentItem + 1.
00096         //  This could be a binary search, but collections of large enough size that it matters
00097         //  should use a quick sort instead.
00098         //
00099         pSortedLocation = pCurrentItem;
00100         while ( ( pSortedLocation > pArrayStartIn )
00101             &&     rPrecedesIn( *pCurrentItem, *( pSortedLocation - 1 ) )
00102             )
00103         {
00104             --pSortedLocation;
00105         }
00106
00107         // Does the current item need to move?
00108         if ( pSortedLocation != pCurrentItem )
00109         {
00110             // Store the current item.
00111             Item tempItem( *pCurrentItem ); // declared inline to avoid requiring default constructor for Item
00112
00113             // Move all items in [pSortedLocation, pCurrentItem) to the right by one.
00114             for ( pNextToCopy = pCurrentItem ; pNextToCopy > pSortedLocation; --pNextToCopy )
00115             {
00116                 *pNextToCopy = *( pNextToCopy - 1 );
00117             }
00118
00119             // Copy the current item into its proper location
00120             *pSortedLocation = tempItem;
00121
00122         } // if item not in sorted location
00123
00124     } // for each item in array
00125
00126 } //*** InsertionSort
00127
00128
00129 //////////////////////////////////////////////////////////////////////////////
00130 //++
00131 //
00132 //  LessThan<Item> and InsertionSort<Item> templates
00133 //
00134 //  Description:
00135 //      These templates overload InsertionSort<Item, PredecessorFunction>
00136 //      to make PredecessorFunction use the less-than operator by default when
00137 //      the user provides no explicit predecessor function.
00138 //
00139 //      Passing an instance of a function object allows the compiler to inline
00140 //      the comparison operation, which is impossible with a function pointer.
00141 //
00142 //  Template parameters:
00143 //
00144 //      Item - the type of the elements in the array.
00145 //          requirements for Item:
00146 //              - bool operator < ( const Item & ) const
00147 //                  alternatively, Item can be a built-in type, like int
00148 //              - those from InsertionSort<Item, PredecessorFunction>
00149 //
00150 //--
00151 //////////////////////////////////////////////////////////////////////////////
00152 template < class Item >
00153 struct LessThan
00154 {
00155     bool operator()( const Item & rLeftIn, const Item & rRightIn ) const
00156     {
00157         return ( rLeftIn < rRightIn );
00158     }
00159 };
00160
00161 template < class Item >
00162 inline void
00163 InsertionSort( Item * pBeginIn, size_t cArraySizeIn )
00164 {
00165     InsertionSort( pBeginIn, cArraySizeIn, LessThan< Item >() );
00166 }
00167
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/PersistATL/stdafx.Cpp Source File

  • Com
  • Services
  • Events
  • EventNews
  • PersistATL

stdafx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PropSpec.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

PropSpec.Cxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright (c) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       propspec.cxx
00007 //
00008 //  Contents:   C++ wrappers for FULLPROPSPEC
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #include <pch.cxx>
00013 #pragma hdrstop
00014
00015 #include <propspec.hxx>
00016
00017 //+-------------------------------------------------------------------------
00018 //
00019 //  Member:     CFullPropSpec::CFullPropSpec, public
00020 //
00021 //  Synopsis:   Default constructor
00022 //
00023 //  Effects:    Defines property with null guid and propid 0
00024 //
00025 //--------------------------------------------------------------------------
00026
00027 CFullPropSpec::CFullPropSpec()
00028 {
00029     memset( &_guidPropSet, 0, sizeof( _guidPropSet ) );
00030     _psProperty.ulKind = PRSPEC_PROPID;
00031     _psProperty.propid = 0;
00032 }
00033
00034 //+-------------------------------------------------------------------------
00035 //
00036 //  Member:     CFullPropSpec::CFullPropSpec, public
00037 //
00038 //  Synopsis:   Construct propid based propspec
00039 //
00040 //  Arguments:  [guidPropSet]  -- Property set
00041 //              [pidProperty] -- Property
00042 //
00043 //--------------------------------------------------------------------------
00044
00045 CFullPropSpec::CFullPropSpec( GUID const & guidPropSet, PROPID pidProperty )
00046         : _guidPropSet( guidPropSet )
00047 {
00048     _psProperty.ulKind = PRSPEC_PROPID;
00049     _psProperty.propid = pidProperty;
00050 }
00051
00052 //+-------------------------------------------------------------------------
00053 //
00054 //  Member:     CFullPropSpec::CFullPropSpec, public
00055 //
00056 //  Synopsis:   Construct name based propspec
00057 //
00058 //  Arguments:  [guidPropSet] -- Property set
00059 //              [wcsProperty] -- Property
00060 //
00061 //--------------------------------------------------------------------------
00062
00063 CFullPropSpec::CFullPropSpec( GUID const & guidPropSet,
00064                               WCHAR const * wcsProperty )
00065         : _guidPropSet( guidPropSet )
00066 {
00067     _psProperty.ulKind = PRSPEC_PROPID;
00068     SetProperty( wcsProperty );
00069 }
00070
00071 //+-------------------------------------------------------------------------
00072 //
00073 //  Member:     CFullPropSpec::CFullPropSpec, public
00074 //
00075 //  Synopsis:   Copy constructor
00076 //
00077 //  Arguments:  [src] -- Source property spec
00078 //
00079 //--------------------------------------------------------------------------
00080
00081 CFullPropSpec::CFullPropSpec( CFullPropSpec const & src )
00082         : _guidPropSet( src._guidPropSet )
00083 {
00084     _psProperty.ulKind = src._psProperty.ulKind;
00085
00086     if ( _psProperty.ulKind == PRSPEC_LPWSTR )
00087     {
00088         if ( src._psProperty.lpwstr )
00089         {
00090             _psProperty.ulKind = PRSPEC_PROPID;
00091             SetProperty( src._psProperty.lpwstr );
00092         }
00093         else
00094             _psProperty.lpwstr = 0;
00095
00096     }
00097     else
00098     {
00099         _psProperty.propid = src._psProperty.propid;
00100     }
00101 }
00102
00103 inline void * operator new( size_t size, void * p )
00104 {
00105     return( p );
00106 }
00107
00108 //+-------------------------------------------------------------------------
00109 //
00110 //  Member:     CFullPropSpec::operator=, public
00111 //
00112 //  Synopsis:   Assignment operator
00113 //
00114 //  Arguments:  [Property] -- Source property
00115 //
00116 //--------------------------------------------------------------------------
00117
00118 CFullPropSpec & CFullPropSpec::operator=( CFullPropSpec const & Property )
00119 {
00120     //
00121     // Clean up.
00122     //
00123
00124     CFullPropSpec::~CFullPropSpec();
00125
00126 #pragma warning( disable : 4291 )           // unmatched operator new
00127     new (this) CFullPropSpec( Property );
00128 #pragma warning( default : 4291 )
00129
00130     return *this;
00131 }
00132
00133
00134 CFullPropSpec::~CFullPropSpec()
00135 {
00136     if ( _psProperty.ulKind == PRSPEC_LPWSTR &&
00137          _psProperty.lpwstr )
00138     {
00139         CoTaskMemFree( _psProperty.lpwstr );
00140     }
00141 }
00142
00143
00144 void CFullPropSpec::SetProperty( PROPID pidProperty )
00145 {
00146     if ( _psProperty.ulKind == PRSPEC_LPWSTR &&
00147          0 != _psProperty.lpwstr )
00148     {
00149         CoTaskMemFree( _psProperty.lpwstr );
00150     }
00151
00152     _psProperty.ulKind = PRSPEC_PROPID;
00153     _psProperty.propid = pidProperty;
00154 }
00155
00156 BOOL CFullPropSpec::SetProperty( WCHAR const * wcsProperty )
00157 {
00158     if ( _psProperty.ulKind == PRSPEC_LPWSTR &&
00159          0 != _psProperty.lpwstr )
00160     {
00161         CoTaskMemFree( _psProperty.lpwstr );
00162     }
00163
00164     _psProperty.ulKind = PRSPEC_LPWSTR;
00165
00166     int len = (int) ( (wcslen( wcsProperty ) + 1) * sizeof( WCHAR ) );
00167
00168     _psProperty.lpwstr = (WCHAR *)CoTaskMemAlloc( len );
00169
00170     if ( 0 != _psProperty.lpwstr )
00171     {
00172         memcpy( _psProperty.lpwstr,
00173                 wcsProperty,
00174                 len );
00175         return( TRUE );
00176     }
00177     else
00178     {
00179         _psProperty.lpwstr = 0;
00180         return( FALSE );
00181     }
00182 }
00183
00184 int CFullPropSpec::operator==( CFullPropSpec const & prop ) const
00185 {
00186     if ( memcmp( &prop._guidPropSet,
00187                  &_guidPropSet,
00188                  sizeof( _guidPropSet ) ) != 0 ||
00189          prop._psProperty.ulKind != _psProperty.ulKind )
00190     {
00191         return( 0 );
00192     }
00193
00194     switch( _psProperty.ulKind )
00195     {
00196     case PRSPEC_LPWSTR:
00197         return( _wcsicmp( GetPropertyName(), prop.GetPropertyName() ) == 0 );
00198         break;
00199
00200     case PRSPEC_PROPID:
00201         return( GetPropertyPropid() == prop.GetPropertyPropid() );
00202         break;
00203
00204     default:
00205         return( 0 );
00206         break;
00207     }
00208 }
00209
00210 int CFullPropSpec::operator!=( CFullPropSpec const & prop ) const
00211 {
00212     if (*this == prop)
00213         return( 0 );
00214     else
00215         return( 1 );
00216 }
00217
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Sample::Win32 Member List

This is the complete list of members for Sample::Win32, including all inherited members.
CertFindChainInStore(uint hCertStore, uint dwCertEncodingType, uint dwFindFlags, uint dwFindType, ref CERT_CHAIN_FIND_BY_ISSUER_PARA pvFindData, uint pPrevChainContext) | Sample::Win32
CertOpenSystemStore(uint hProv, String szSubsystemProtocol) | Sample::Win32
Generated on Wed Nov 13 2024 16:58:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/Resource.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

Resource.h

Go to the documentation of this file.
00001 #define IDR_CMgdResType                                 2001
00002 #define IDS_RESTYPE_DISPLAYNAME                         2002
00003 #define IDS_CLUSCFG_INFO_CONFIGURING_RESTYPE            2010
00004 #define IDS_CLUSCFG_INFO_CONFIGURED_RESTYPE             2011
00005 #define IDS_CLUSCFG_ERROR_CONFIGURING_RESTYPE_FAILED    2012
00006 #define IDS_CLUSCFG_ERROR_GETCOMPUTERNAME_FAILED        2013
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/quiktest/quiktest.h Source File

  • Dataaccess
  • odbc
  • quiktest

quiktest.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //|   Title:   quiktest.h
00003 //|
00004 //|   (c) Copyright 1991, 1992, 1993, 1994, 1995
00005 //|       by Microsoft Corp.
00006 //|
00007 //******************************************************************************
00008 #ifndef quiktest_defs
00009 #define quiktest_defs
00010
00011
00012 /*-----------------------------------------------------------------------------------*/
00013 /*  constants defines                                            */
00014 /*-----------------------------------------------------------------------------------*/
00015 #define MAX_QUERY_SIZE            2048
00016 #define MAX_BIND_ELEMENTS         100
00017 #define MAX_BIND_ARRAY_ELEMENT      MAX_QUERY_SIZE / MAX_BIND_ELEMENTS
00018 #define MAX_STRING_SIZE           700     // Increased from 255 due to overwrite
00019 #define MAX_PARAM_SIZE            129
00020 #define MAX_DATA_SIZE           45
00021 #define MAX_COLUMN_LIST_SIZE        200
00022 #define MAX_COLUMN_NAME_SIZE        100
00023 #define MAX_INSERT_VALUES_SIZE      200
00024 #define MAX_TYPES_SUPPORTED       25
00025 #define MAX_TYPE_NAME           129
00026 #define MAX_FIELD               40
00027 #define MAX_PREFIX              129
00028 #define MAX_SUFFIX              129
00029 #define MAX_TABLE_NAME            60
00030 #define MAX_NUM_BUFFER            60
00031 #define MAX_ERROR_SIZE            200
00032 #define MAX_ROW_ITEM_LIMIT          4
00033
00034 #define PREFIX_SIZE             3
00035 #define IGNORED               999
00036 #define TEST_CONNECT_OPTION       15
00037 #define TEST_STMT_OPTION          300
00038 #define SCALEDIFF               4
00039 #define ABORT                 -1
00040 #define TYPE_PORTION              4
00041 #define MAXUDWORD               ((UDWORD)(-1))
00042 #define MINSDWORD               (-(SDWORD)((MAXUDWORD / 2) + 1))
00043 #define MAXSDWORD               ((SDWORD)(MAXUDWORD / 2))
00044
00045 #define SMALLBUFF               100
00046 #define MEDBUFF               200
00047 #define LARGEBUFF               300
00048 #define XLARGEBUFF              1024
00049 #define STATE_SIZE              6
00050 #define COMBINED_SIZE           MAX_ERROR_SIZE + 30
00051
00052 // Descriptor type defines
00053 #define DESC_NONE         0   // No descriptor type
00054 #define DESC_APD          1   // APD only
00055 #define DESC_IPD          2   // IPD only
00056 #define DESC_ARD          4   // ARD only
00057 #define DESC_IRD          8   // IRD only
00058 #define DESC_PD         DESC_APD|DESC_IPD   //  Parameter descriptors
00059 #define DESC_RD         DESC_ARD|DESC_IRD   // Row descriptors
00060 #define DESC_ID         DESC_IPD|DESC_IRD   // Implementation descriptors
00061 #define DESC_AD         DESC_APD|DESC_ARD   // Application descriptors
00062 #define DESC_MOST         DESC_AD|DESC_IPD  // This is the most common settable combination
00063 #define DESC_ALL          DESC_APD|DESC_IPD|DESC_ARD|DESC_IRD // All descriptor types
00064
00065 #define STATUS_ARRAY_SIZE   5   // Array size to use for row and param arrays
00066 #define BIND_SIZE         12    // Bind type size value
00067
00068 /* NUM_THREAD is the number of threads that will be created for multi-thread test */
00069 #define NUM_THREAD              5
00070 #define NUM_QUIKREBIND_ROWSETS      6
00071
00072 /* BIND_PARM_OFFSET specifies the parameter base for DAE bindings. Either 0 */
00073 /* or 1 based.  */
00074 #define BIND_PARM_OFFSET          0
00075
00076 // COLNAME_START specifies the beginning number used in colnames, i.e. c00bit
00077 // vs. c01bit.
00078 #define COLNAME_START           1
00079
00080 /*constants for Descriptor tests */
00081 #define MAX_DESC_BUF              200
00082 #define DESC_UPDATE_MODE_READ       0
00083 #define DESC_UPDATE_MODE_WRITE      1
00084 #define REC_COUNT_UNK           -1    // Unkown record count
00085 // #define DESC_LOCATE_FAIL         -1
00086
00087 /* constants for TestBindParam */
00088 #define INSERT_FAIL               -1
00089
00090 #define UNTOUCHED 0xCA
00091
00092 /*------------------------------------------------------------------------------------*/
00093 /*  macros                                                                             */
00094 /*------------------------------------------------------------------------------------*/
00095
00096 #define RC_SUCCESSFUL(rc) ((rc) == SQL_SUCCESS || \
00097     (rc) == SQL_SUCCESS_WITH_INFO)
00098
00099 #define RC_NOTSUCCESSFUL(rc) (!(RC_SUCCESSFUL(rc)))
00100
00101 #define RETCHECK(exp, rec, buf) ReturnCheck(exp, rec, buf, TEXT(__FILE__), __LINE__,FALSE)
00102
00103 #define ERRSHANDLE(type, handle, exp, rec, buf) ErrsHandle(type, handle, exp, rec, buf, TEXT(__FILE__), __LINE__,FALSE)
00104
00105 #define DIAGRETCHECK(exp, rec, buf) ReturnCheck(exp, rec, buf, TEXT(__FILE__), __LINE__,TRUE)
00106
00107 #define DISPLAYERROR(func, string) qtDisplayError(func, string, TEXT(__FILE__), __LINE__)
00108
00109 /*--------------------------------------------------------------------------------------*/
00110 /*  Structure definitions                                           */
00111 /*--------------------------------------------------------------------------------------*/
00112
00113 /* Number of Cols in result set of a query: */
00114 UWORD cNumResSetCols;
00115
00116 /* used to store information from GetTypeInfo for table creation */
00117 typedef struct FieldInfo {
00118     int iField;
00119     TCHAR szType[MAX_TYPE_NAME];
00120     TCHAR szFieldName[MAX_FIELD];
00121     SWORD  wSQLType;
00122     TCHAR szParams[MAX_PARAM_SIZE];
00123     TCHAR szLength[MAX_FIELD];
00124     TCHAR szPrefix[MAX_PREFIX];
00125     TCHAR szSuffix[MAX_SUFFIX];
00126     SDWORD precision;
00127     SWORD scale;
00128     SWORD nullable;
00129     UDWORD length;
00130     int   fAutoUpdate;
00131     SWORD fSearchable;
00132     SDWORD fUnsigned;
00133     SWORD autoinc;
00134     } FIELDINFO;
00135
00136
00137
00138 /* large buffers allocated as a global used for queries and other*/
00139 /* returned information                                          */
00140 typedef struct  tagQtStruct {
00141   TCHAR   buf[MAX_STRING_SIZE];
00142   TCHAR   sz[MAX_QUERY_SIZE];
00143   TCHAR   szParamQuery[MAX_QUERY_SIZE];
00144   TCHAR   szParam[MAX_PARAM_SIZE];
00145   TCHAR   szDataItem[MAX_DATA_SIZE];
00146   TCHAR   szTableName[MAX_TABLE_NAME];
00147   TCHAR   szColNames[MAX_COLUMN_LIST_SIZE];
00148   TCHAR   szColName[MAX_COLUMN_NAME_SIZE];
00149   TCHAR   szValues[MAX_INSERT_VALUES_SIZE];
00150 }       QTSTRUCT;
00151
00152 /* the storage used for data retreived using bind/fetch sequence  */
00153 /* and data for BindParameter                                     */
00154 /* only cb and one of the types will be used for each entry       */
00155 typedef struct tagDataStruct {
00156   SDWORD cb;
00157   TCHAR data[MAX_STRING_SIZE];
00158   SDWORD sdword;
00159   UDWORD udword;
00160   SWORD sword;
00161   UWORD uword;
00162   TCHAR sChar;
00163   SQLTCHAR uChar;
00164   SDOUBLE sdouble;
00165   SFLOAT sfloat;
00166   TIME_STRUCT time;
00167   DATE_STRUCT date;
00168   TIMESTAMP_STRUCT timestamp;
00169 } DSTRUCT;
00170
00171 /* These declarations used to reside locally, but the structures didn't get initialized correctly */
00172 typedef struct SupportOptList {
00173   UDWORD Support;
00174   SDWORD Option;
00175   } SUPPORTOPTINFO;
00176
00177 typedef struct SupportConcurList {
00178   UDWORD Support;
00179   UWORD Option;
00180   } SUPPORTCONCURINFO;
00181
00182
00183
00184 /* Each thread will contain the following information */
00185 typedef struct {
00186   HENV    henv;
00187   HDBC    hdbc;
00188   TCHAR   szTableName[MAX_TABLE_NAME];
00189   FIELDINFO rgFieldInfo;
00190
00191 } THREAD_STRUCT;
00192
00193
00194 static union
00195 {
00196   BYTE rgb[max(max(max(sizeof (HENV),sizeof (HDBC)),
00197           max(sizeof (HSTMT), sizeof (SQLHDESC))),sizeof (UDWORD))];
00198   SWORD sw;
00199   UWORD uw;
00200   SDWORD sdw;
00201   UDWORD udw;
00202   HENV henv;
00203   HDBC hdbc;
00204   HSTMT hstmt;
00205   SQLHDESC hdesc;
00206 } Untouched = {UNTOUCHED, UNTOUCHED, UNTOUCHED, UNTOUCHED};
00207
00208
00209
00210 int  PASCAL ReturnCheck(RETCODE retExpected, RETCODE retReceived, LPTSTR szFunction,
00211                 LPTSTR szFile, int iLine,BOOL fDiag);
00212 void PASCAL qtDisplayError(LPTSTR szFunction, LPTSTR buf, LPTSTR szFile, int iLine);
00213 LPTSTR PASCAL qtMakeData(int row, int col,FIELDINFO * rgField, LPTSTR buf);
00214
00215 BOOL PASCAL CmpODBCtoCHAR(DSTRUCT * rgTestValue, TCHAR * szTrueValue,
00216   SWORD fSqlType, SWORD iResSetCol);
00217
00218 void* PASCAL CvtCHARtoODBC(void * odbcValue, TCHAR * buf, SWORD fSqlType)
00219 {
00220   if(!buf)
00221     return NULL;
00222
00223   switch (fSqlType) {
00224     case SQL_DATE:
00225     case SQL_TYPE_DATE:
00226     {
00227       TCHAR szDATEDELIM[] = TEXT("d{}'- ");
00228       TCHAR szTempBuff[30];
00229       LPTSTR   tmpstr=szTempBuff;
00230       _tcscpy((LPTSTR) szTempBuff, buf);
00231
00232       ((DATE_STRUCT *)odbcValue)->year = _ttoi(_tcstok(tmpstr, szDATEDELIM));
00233       ((DATE_STRUCT *)odbcValue)->month = _ttoi(_tcstok(NULL, szDATEDELIM));
00234       ((DATE_STRUCT *)odbcValue)->day = _ttoi(_tcstok(NULL, szDATEDELIM));
00235       break;
00236     }
00237
00238
00239     case SQL_TIME:
00240     case SQL_TYPE_TIME:
00241     {
00242       TCHAR szTIMEDELIM[] = TEXT("t{}': ");
00243       TCHAR szTempBuff[30];
00244       LPTSTR   tmpstr=szTempBuff;
00245       _tcscpy((LPTSTR) szTempBuff, buf);
00246
00247       ((TIME_STRUCT *)odbcValue)->hour = _ttoi(_tcstok(tmpstr, szTIMEDELIM));
00248       ((TIME_STRUCT *)odbcValue)->minute = _ttoi(_tcstok(NULL, szTIMEDELIM));
00249       ((TIME_STRUCT *)odbcValue)->second = _ttoi(_tcstok(NULL, szTIMEDELIM));
00250
00251       break;
00252     }
00253
00254     case SQL_TIMESTAMP:
00255     case SQL_TYPE_TIMESTAMP:
00256     {
00257       TCHAR szDATETIMEDELIM[] = TEXT("ts'{}-:. ");
00258       TCHAR szTempBuff[30];
00259       LPTSTR   tmpstr=szTempBuff;
00260       LPTSTR  endstr, frstr;
00261       _tcscpy((LPTSTR) szTempBuff, buf);
00262
00263       /* First the date */
00264       ((TIMESTAMP_STRUCT *)odbcValue)->year = _ttoi(_tcstok(tmpstr, szDATETIMEDELIM));
00265       ((TIMESTAMP_STRUCT *)odbcValue)->month = _ttoi(_tcstok(NULL, szDATETIMEDELIM));
00266       ((TIMESTAMP_STRUCT *)odbcValue)->day = _ttoi(_tcstok(NULL, szDATETIMEDELIM));
00267       /* Then the complete time */
00268       ((TIMESTAMP_STRUCT *)odbcValue)->hour = _ttoi(_tcstok(NULL, szDATETIMEDELIM));
00269       ((TIMESTAMP_STRUCT *)odbcValue)->minute = _ttoi(_tcstok(NULL, szDATETIMEDELIM));
00270       ((TIMESTAMP_STRUCT *)odbcValue)->second = _ttoi(_tcstok(NULL, szDATETIMEDELIM));
00271       if(frstr = _tcstok(NULL, szDATETIMEDELIM))
00272         ((TIMESTAMP_STRUCT *)odbcValue)->fraction = (_tcstoul(frstr, &endstr, 10) * 1000000);
00273       else
00274         ((TIMESTAMP_STRUCT *)odbcValue)->fraction = 0;
00275
00276       break;
00277     }
00278
00279   }
00280   return odbcValue;
00281 }
00282
00283
00284 /* Compares the value stored at location (row,col) in the array of
00285  * DSTRUCT's with the value created by qtMakeData             */
00286 BOOL PASCAL CmpODBCtoCHAR(DSTRUCT * rgTestValue, TCHAR * szTrueValue,
00287   SWORD fSqlType, SWORD iCol)
00288 {
00289   BOOL fTestPass=TRUE;
00290   SWORD test1,test2;
00291   TCHAR *pStop=NULL;
00292
00293   switch (fSqlType) {
00294     case SQL_BIGINT:
00295     case SQL_INTEGER:
00296       if(_ttoi(szTrueValue) == (int)rgTestValue[iCol].sdword)
00297         return TRUE;
00298       return FALSE;
00299
00300     case SQL_DECIMAL:
00301     case SQL_NUMERIC:
00302         return  (_tcstod(szTrueValue,&pStop) ==
00303           _tcstod(rgTestValue[iCol].data,&pStop));
00304     case SQL_TINYINT:
00305     case SQL_SMALLINT:
00306       if(_ttoi(szTrueValue) == (int)rgTestValue[iCol].sword)
00307         return TRUE;
00308       return FALSE;
00309
00310     case SQL_FLOAT:
00311     case SQL_DOUBLE:
00312         return  (_tcstod(szTrueValue,&pStop) == rgTestValue[iCol].sdouble);
00313
00314     case SQL_REAL:
00315         /* Need to account for round-off errors in _tcstod conversions: */
00316         test1 = (SWORD)(1000*_tcstod(szTrueValue,&pStop));
00317         test1 = (SWORD)((test1>0) ? (test1+5)/10 : (test1-5)/10);
00318         test2 = (SWORD)(1000*rgTestValue[iCol].sfloat);
00319         test2 = (SWORD)((test2>0) ? (test2+5)/10 : (test2-5)/10);
00320         return  (test1 == test2);
00321
00322     case SQL_TIMESTAMP:
00323     case SQL_TYPE_TIMESTAMP:
00324     {
00325       TIMESTAMP_STRUCT tss;
00326       CvtCHARtoODBC(&tss, szTrueValue, SQL_TYPE_TIMESTAMP);
00327
00328       fTestPass= ((rgTestValue[iCol].timestamp.month == tss.month)
00329         && (rgTestValue[iCol].timestamp.day == tss.day)
00330         && (rgTestValue[iCol].timestamp.year == tss.year)
00331         && (rgTestValue[iCol].timestamp.hour == tss.hour)
00332         && (rgTestValue[iCol].timestamp.minute == tss.minute)
00333         && (rgTestValue[iCol].timestamp.fraction ==
00334           tss.fraction));
00335       /* Seconds value is zero for small timestamp, so to keep it from always failing... */
00336       if(0 != rgTestValue[iCol].timestamp.second)
00337         fTestPass= (fTestPass && rgTestValue[iCol].timestamp.second == tss.second);
00338       return fTestPass;
00339     }
00340
00341     case SQL_TIME:
00342     case SQL_TYPE_TIME:
00343     {
00344       TIME_STRUCT tss;
00345
00346       CvtCHARtoODBC(&tss, szTrueValue, SQL_TYPE_TIME);
00347       fTestPass=  ((rgTestValue[iCol].time.hour == tss.hour)
00348         && (rgTestValue[iCol].time.minute == tss.minute));
00349       /* Seconds value is zero for small timestamp, so to keep it from always failing... */
00350       if(0 != rgTestValue[iCol].time.second)
00351         fTestPass= (fTestPass && rgTestValue[iCol].time.second == tss.second);
00352       return fTestPass;
00353     }
00354
00355     case SQL_DATE:
00356     case SQL_TYPE_DATE:
00357     {
00358       DATE_STRUCT tss;
00359       CvtCHARtoODBC(&tss, szTrueValue, SQL_TYPE_DATE);
00360
00361       return ((rgTestValue[iCol].date.month == tss.month)
00362         && (rgTestValue[iCol].date.day == tss.day)
00363         && (rgTestValue[iCol].date.year == tss.year));
00364     }
00365
00366     case SQL_BIT:
00367     case SQL_CHAR:
00368     case SQL_VARCHAR:
00369     case SQL_LONGVARCHAR:
00370     case SQL_BINARY:
00371     case SQL_VARBINARY:
00372     case SQL_LONGVARBINARY:
00373     default:
00374       return !(_tcsncmp(szTrueValue, rgTestValue[iCol].data,
00375         _tcslen(szTrueValue)));
00376
00377   }
00378 }
00379
00380
00381 #endif
00382
00383
00384
00385
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/Dialer/Dialer.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • Dialer

Dialer.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright 1996 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     dialer.c
00008
00009 --*/
00010
00011
00012 #include "dialer.h"
00013 #include "string.h"
00014 #include "stdlib.h"
00015 #include "shellapi.h"
00016
00017
00018 #define ISDIGIT(x)      (((x) - '0') >= 0) && (((x) - '0') <= 9)
00019 enum NumberTypes
00020 {
00021   LOCAL_NUMBER = 7,
00022   EXTENDED_LOCAL_NUMBER,
00023   LONG_DISTANCE_NUMBER = 10,
00024   EXTENDED_LONG_DISTANCE_NUMBER
00025 };
00026
00027
00028 // structs
00029 typedef struct tagLINEINFO
00030 {
00031     DWORD nAddr;                    // Number of avail. addresses on the line
00032     BOOL  fVoiceLine;               // Is this a voice line?
00033     DWORD dwAPIVersion;             // API version which the line supports
00034     HLINE hLine;                    // line handle returned by lineOpen
00035     DWORD dwPermanentLineID;        // Permanent line ID retreived from devcaps
00036     char  szLineName[MAXBUFSIZE];   // the line's name
00037
00038 } LINEINFO, *LPLINEINFO;
00039
00040
00041 // Global variables
00042
00043 // window/instance variables
00044 HWND        ghWndMain;
00045 HWND        ghWndDialing = NULL;
00046 HINSTANCE   ghInst = 0;
00047
00048 // file name vars.
00049 static TCHAR gszAppName[64];
00050 static TCHAR gszINIfilename [] = "DIALER.INI";
00051 static TCHAR gszDialerClassName[] = "DialerClass";
00052 TCHAR const gszNULL[] = "";
00053
00054 // window item variables
00055 HFONT       ghFontBtn;               // handle to 1, 2, ..., 0's font
00056 HFONT       ghFontBtnText;           // handle to number button's text font
00057 HFONT       ghFontBtnStar;           // handle to * and # button's font
00058 HLINEAPP    ghLineApp = (HLINEAPP)((ULONG_PTR)NULL);        // Dialer's usage handle (regist. w/TAPI)
00059 HCALL       ghCall = (HCALL)((ULONG_PTR)NULL);           // call handle for Dialer's call
00060
00061 LPSTR       gszCurrentNumber = NULL; // number of destination of current call
00062 LPSTR       gszCurrentName = NULL;   // name of destination of current call
00063
00064 BOOL        gfRegistered;            // was lineRegisterRequestRecipient()
00065                                      // successful?
00066
00067 //BOOL        gfDropping = FALSE;      // is Dialer currently dropping a call?
00068 BOOL        gfNeedToReinit = FALSE;  // does Dialer need to re-initialize?
00069
00070 BOOL        gfCallRequest = FALSE;   // Does a Simple TAPI app want a call?
00071 BOOL        gfCurrentLineAvail = TRUE; // Simple TAPI requests are only carried
00072                                        // out if the current chosen line is avail.
00073 BOOL    gfMakeCallReplyPending = FALSE;
00074
00075 LONG        gMakeCallRequestID = 0;      // request ID returned by async TAPI fns.
00076 LONG        gDropCallRequestID = 0;      // request ID returned by async TAPI fns.
00077
00078 DWORD       gnAvailDevices = 0;      // # of line devices avail. to Dialer
00079 LINEINFO    gCurrentLineInfo;
00080 DWORD       * gnAddr;
00081
00082 // global to remember where the cursor is in the edit control
00083 DWORD       gdwStartSel;
00084 DWORD       gdwEndSel;
00085
00086 DWORD       * gdwPLID;               // current line's permanent line ID
00087 DWORD       giCurrentLine = (DWORD)-1;       // the line selected by the user
00088 DWORD       giCurrentAddress = 0;    // the address selected by the user
00089
00090 // + 1 so we can work 1-based rather than 0-based (for convenience only)
00091 // global varibles to hold the names and address of the
00092 TCHAR       gszSDNumber[ NSPEEDDIALS + 1 ][ TAPIMAXDESTADDRESSSIZE ];
00093
00094
00095 // Function declarations
00096
00097 // button related functions
00098 VOID ButtonFontSetup(VOID);
00099 VOID DrawButton(HDC hdc, RECT rcBtn, BOOL fHighlighted);
00100 VOID DrawButtonText(HDC hdc, RECT rcBtn, BOOL fHighlighted, UINT IDD_Btn);
00101 VOID DisableDialButtons(BOOL fDisable);
00102 VOID FitTextToButton( HWND, INT, LPSTR );
00103
00104 // Callback functions
00105 BOOL CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00106 BOOL CALLBACK DialingProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00107 BOOL CALLBACK AboutProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00108 BOOL CALLBACK ConnectUsingProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00109 BOOL CALLBACK LineInUseProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00110 BOOL CALLBACK SpeedDial1Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00111 BOOL CALLBACK SpeedDial2Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00112 VOID CALLBACK tapiCallback (
00113               DWORD hDevice, DWORD dwMsg,
00114               DWORD dwCallbackInstance,
00115               DWORD dwParam1, DWORD dwParam2,
00116               DWORD dwParam3
00117                 );
00118
00119 // tapi related functions
00120 VOID ManageAssistedTelephony(VOID);
00121 VOID InitiateCall(LPCSTR szNumber, LPCSTR szName);
00122
00123 VOID DialerLineClose(VOID);
00124 VOID DialerCleanup(VOID);
00125 VOID CloseTAPI(VOID);
00126
00127 DWORD GetLineInfo(DWORD iLine, LPLINEINFO lpLineInfo);
00128 VOID GetLineInfoFailed (
00129             DWORD iLine, LPLINEDEVCAPS lpDevCaps,
00130             LPLINEINFO lpLineInfo
00131               );
00132 LPSTR GetAddressName(DWORD iLine, DWORD iAddress);
00133 BOOL MakeCanonicalNumber( LPCSTR szName, LPSTR szCanNumber );
00134
00135 // misc. helper functions
00136 VOID ReadINI(VOID);
00137 int errString(HWND hWnd, UINT errCode, UINT uFlags);
00138 VOID AddToRedialList(LPCSTR szNumber);
00139 BOOL InitializeLineBox(HWND hwndLineBox);
00140 BOOL InitializeAddressBox(HWND hwndLineBox, HWND hwndAddressBox);
00141 BOOL Is911 ( LPLINETRANSLATEOUTPUT lpTransOut );
00142 VOID AmpersandCompensate( LPCSTR lpszSrc, LPSTR lpszDst );
00143 VOID AmpersandDeCompensate( LPCSTR lpszSrc, LPSTR lpszDst );
00144
00145 // Dialer memory management functions
00146 LPVOID DialerAlloc(size_t cbToAlloc);
00147 LPVOID DialerFree(LPVOID lpMem);
00148
00149
00150 // Function definitions
00151
00152
00153 //***************************************************************************
00154 //***************************************************************************
00155 //***************************************************************************
00156 DWORD InitializeTAPI (VOID)
00157 {
00158   INT cvLine;
00159
00160   DWORD iLine;
00161   DWORD dwPreferredPLID, dwID = (DWORD) -1;
00162
00163   MSG msg;
00164
00165   LPLINEINFO lpLineInfo = NULL; // LINEINFO for each available line
00166
00167     DWORD errCode;
00168     DWORD tc = GetTickCount();
00169     DWORD dwReturn = ERR_NONE;
00170
00171   char szBuffer[MAXBUFSIZE];    // to read in dwPreferredPLID as a string first
00172
00173
00174
00175   errCode = lineInitialize (
00176                 &ghLineApp,
00177                 ghInst,
00178                 (LINECALLBACK) tapiCallback,
00179                 gszAppName,
00180                 &gnAvailDevices
00181                );
00182   if ( errCode == LINEERR_REINIT )
00183   {
00184     // take away dialer functionality
00185     EnableWindow( ghWndMain, FALSE );
00186     DisableDialButtons(TRUE);
00187
00188     // keep trying until the user cancels
00189     // or we stop getting LINEERR_REINIT
00190     while ( ( errCode = lineInitialize (
00191                       &ghLineApp,
00192                       ghInst,
00193                       (LINECALLBACK)tapiCallback,
00194                       gszAppName,
00195                       &gnAvailDevices
00196                         ) )
00197          == LINEERR_REINIT )
00198     {
00199       // flush queue & yield
00200       while ( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ) )
00201       {
00202         TranslateMessage( &msg );
00203         DispatchMessage( &msg );
00204       }
00205
00206       // bring up the box if 5 seconds have passed since
00207       if(GetTickCount() > 5000 + tc)
00208       {
00209         if ( errString( ghWndMain, ikszWarningTapiReInit, MB_RETRYCANCEL )
00210            == IDCANCEL )
00211         {
00212           break;
00213         }
00214         // reset the relative counter
00215         tc = GetTickCount();
00216       }
00217     }
00218
00219     // give back dialer functionality
00220     DisableDialButtons( FALSE );
00221     EnableWindow( ghWndMain, TRUE );
00222   }
00223
00224   if ( errCode )
00225     {
00226         dwReturn = errCode;
00227         goto tapiinit_exit;
00228     }
00229
00230   // retrieve preferred line info from INI file
00231   GetPrivateProfileString (
00232                 "Preference",
00233                 "Preferred Line",
00234                 gszNULL,
00235                 szBuffer,
00236                 MAXBUFSIZE,
00237                 gszINIfilename
00238               );
00239
00240   // if szBuffer is not empty.
00241   if ( lstrcmp ( gszNULL, szBuffer ) )
00242   {
00243     dwPreferredPLID = (DWORD) atoi( szBuffer );
00244   }
00245   else
00246   {
00247     dwPreferredPLID = (DWORD) -1;
00248   }
00249
00250   // -1 default - tells us if it ever gets set
00251   giCurrentLine = (DWORD) -1;
00252
00253   // allocate buffer for storing LINEINFO for all of the available lines
00254   // always allocate space for at least one line
00255   if ( gnAvailDevices == 0 )
00256   {
00257     gnAddr = (DWORD *) DialerAlloc( sizeof( DWORD ) );
00258     gdwPLID = (DWORD *) DialerAlloc( sizeof( DWORD ) );
00259     lpLineInfo = (LPLINEINFO) DialerAlloc( sizeof( LINEINFO ) );
00260   }
00261   else
00262   {
00263     gnAddr = (DWORD *) DialerAlloc( sizeof( DWORD ) * (int)gnAvailDevices);
00264     gdwPLID = (DWORD *) DialerAlloc( sizeof( DWORD ) * (int)gnAvailDevices);
00265     lpLineInfo = (LPLINEINFO) DialerAlloc( sizeof( LINEINFO ) * (int)gnAvailDevices );
00266   }
00267
00268   // if no space was set aside...
00269   if ( lpLineInfo == NULL || gdwPLID == NULL || gnAddr == NULL )
00270     {
00271         dwReturn = LINEERR_NOMEM;
00272         goto tapiinit_exit;
00273     }
00274
00275   // fill lpLineInfo[] and open each line
00276   for ( iLine = 0, cvLine = 0; iLine < gnAvailDevices; ++iLine )
00277   {
00278     // skip remaining processing for this if it didn't open
00279     if ( GetLineInfo( iLine, &lpLineInfo[iLine] ) != ERR_NONE )
00280       continue;
00281
00282     gnAddr [ iLine ] = lpLineInfo[iLine].nAddr;
00283     gdwPLID[ iLine ] = lpLineInfo[iLine].dwPermanentLineID;
00284
00285     if ( lpLineInfo[iLine].dwPermanentLineID == dwPreferredPLID )
00286       giCurrentLine = iLine;
00287
00288     // note number of lines with Interactive voice caps.
00289     // used to select a preferred line by default
00290     if ( lpLineInfo [ iLine ].fVoiceLine )
00291     {
00292       cvLine++;
00293       dwID = iLine;
00294     }
00295   }
00296
00297   // if we couldn't find the preferred line,
00298   // try and assign one by default
00299   // else bring up connect using dialog
00300   if (  giCurrentLine == (DWORD)-1 )
00301   {
00302     // check if there is only one line
00303     // that has interactive voice caps,
00304     // make it default line
00305     if ( cvLine == 1 )
00306     {
00307       giCurrentLine = dwID;
00308
00309       // if the preferred address read from the INI file
00310       // was different i.e we are changing setting, inform
00311       // the user
00312       if ( dwPreferredPLID != -1 )
00313       {
00314         errString( ghWndMain, ERR_NEWDEFAULT, MB_ICONEXCLAMATION | MB_OK );
00315       }
00316     }
00317     else
00318     {
00319       gCurrentLineInfo = lpLineInfo[0];
00320       if ( DialogBoxParam (
00321                   ghInst,
00322                   MAKEINTRESOURCE(IDD_CONNECTUSING),
00323                   ghWndMain,
00324                   (DLGPROC)ConnectUsingProc,
00325                   INVALID_LINE
00326                 )
00327          == -1)
00328       {
00329                 dwReturn = (DWORD) -1;
00330       }
00331       else
00332       {
00333                 dwReturn = ERR_NONE;
00334       }
00335
00336             goto tapiinit_exit;
00337     }
00338   }
00339   gCurrentLineInfo = lpLineInfo[ giCurrentLine ];
00340
00341
00342   // select default address
00343   giCurrentAddress = 0;
00344
00345   // get the name of the preferred address from ini file
00346   GetPrivateProfileString (
00347                 "Preference",
00348                 "Preferred Address",
00349                 gszNULL,
00350                 szBuffer,
00351                 MAXBUFSIZE,
00352                 gszINIfilename
00353               );
00354
00355   // if preferred address read from INI file
00356   if ( lstrcmp( gszNULL, szBuffer ) )
00357   {
00358     giCurrentAddress = (DWORD) atoi( szBuffer );
00359
00360     // if the address is invalid, set default
00361     if ( giCurrentAddress >= gCurrentLineInfo.nAddr )
00362       giCurrentAddress = 0;
00363   }
00364
00365
00366 tapiinit_exit:
00367
00368     if (lpLineInfo)
00369     {
00370         DialerFree(lpLineInfo);
00371     }
00372
00373   return dwReturn;;
00374 }
00375
00376 //***************************************************************************
00377 //***************************************************************************
00378 //***************************************************************************
00379 int WINAPI WinMain (
00380           HINSTANCE hInstance,
00381           HINSTANCE hPrevInstance,
00382           LPSTR lpCmdLine,
00383           int nCmdShow
00384            )
00385 {
00386   HACCEL hAccel;
00387   MSG msg;
00388   DWORD errCode;
00389   HANDLE hImHere;
00390
00391
00392   ghInst = GetModuleHandle( NULL );
00393   LoadString( ghInst, ikszAppFriendlyName, gszAppName, sizeof(gszAppName)/sizeof(TCHAR) );
00394
00395   //
00396   // Now, let's see if we've already got an instance of ourself
00397   hImHere = CreateMutex(NULL, TRUE, "DialersIveBeenStartedMutex");
00398
00399   //
00400   // Is there another one of us already here?
00401   if ( ERROR_ALREADY_EXISTS == GetLastError() )
00402   {
00403         HWND        hDialerWnd;
00404
00405         hDialerWnd = FindWindow(gszDialerClassName,
00406                                 NULL);
00407
00408         SetForegroundWindow(hDialerWnd);
00409
00410      CloseHandle( hImHere );
00411      return 0;
00412   }
00413
00414
00415   {
00416     WNDCLASS wc;
00417     wc.style = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW;
00418     wc.lpfnWndProc = DefDlgProc;
00419     wc.cbClsExtra = 0;
00420     wc.cbWndExtra = DLGWINDOWEXTRA;
00421     wc.hInstance = ghInst;
00422     wc.hIcon = LoadIcon(ghInst, MAKEINTRESOURCE(IDI_DIALER) );
00423     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00424     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
00425     wc.lpszMenuName = NULL;
00426     wc.lpszClassName = gszDialerClassName;
00427     RegisterClass(&wc);
00428   }
00429
00430
00431   // create the dialog box and set it with info
00432   // from the .INI file
00433   ghWndMain = CreateDialog (
00434                 ghInst,
00435                 (LPCSTR)MAKEINTRESOURCE(IDD_DIALER),
00436                 (HWND)NULL,
00437                 (DLGPROC)MainWndProc
00438                );
00439
00440   ReadINI();
00441   ButtonFontSetup();
00442
00443   ShowWindow(ghWndMain, SW_SHOW);
00444   UpdateWindow(ghWndMain);
00445
00446   // limit text in Number field to TAPIMAXDESTADDRESSSIZE
00447   SendDlgItemMessage (
00448             ghWndMain,
00449             IDD_DCOMBO,
00450             CB_LIMITTEXT,
00451             (WPARAM)TAPIMAXDESTADDRESSSIZE,
00452             0
00453              );
00454
00455   // 0 (ERR_NONE) error code registers success - otherwise terminate
00456   errCode = InitializeTAPI();
00457   if(errCode)
00458   {
00459     errString(ghWndMain, errCode, MB_APPLMODAL | MB_ICONEXCLAMATION );
00460
00461     DialerCleanup();
00462     return errCode;
00463   }
00464
00465   errCode = lineRegisterRequestRecipient (
00466                       ghLineApp,
00467                       0, // registration instance
00468                       LINEREQUESTMODE_MAKECALL,
00469                       TRUE
00470                        );
00471
00472   if(errCode)
00473   {
00474     gfRegistered = FALSE;
00475     errString(ghWndMain, errCode, MB_ICONEXCLAMATION | MB_OK );
00476   }
00477   else
00478   {
00479     gfRegistered = TRUE;
00480   }
00481
00482
00483   hAccel = LoadAccelerators(ghInst, gszAppName);
00484
00485   while ( GetMessage( &msg, NULL, 0, 0 ) )
00486   {
00487     if ( ghWndMain == NULL || !IsDialogMessage( ghWndMain, &msg ) )
00488     {
00489       if(!TranslateAccelerator(ghWndMain, hAccel, &msg))
00490       {
00491         TranslateMessage(&msg);
00492         DispatchMessage(&msg);
00493       }
00494     }
00495
00496     // If: 1) Dialer is a call manager (if not, ignore requests)
00497     //     2) the currently chosen line is available
00498     //     3) there is a Simple TAPI request
00499     // Then: process the request
00500     if ( gfCurrentLineAvail && gfCallRequest )
00501     {
00502       ManageAssistedTelephony();
00503     }
00504   }
00505
00506
00507
00508   DialerCleanup();
00509
00510   CloseHandle( hImHere );
00511
00512   return (int)(msg.wParam);
00513 }
00514
00515
00516
00517 //***************************************************************************
00518 //***************************************************************************
00519 //***************************************************************************
00520 LPVOID DialerAlloc(size_t cbToAlloc)
00521 {
00522   return LocalAlloc(LPTR, cbToAlloc);
00523 }
00524
00525
00526 LPVOID DialerFree(LPVOID lpMem)
00527 {
00528   return LocalFree( lpMem );
00529 }
00530
00531
00532
00533 //***************************************************************************
00534 //***************************************************************************
00535 //***************************************************************************
00536 VOID ReadINI( VOID )
00537 {
00538     WORD cSDEntry, cLastDialed;
00539     DWORD cComma;
00540
00541     POINT ptLeftTop;
00542
00543     char szName[ TAPIMAXCALLEDPARTYSIZE ];
00544     char szTemp[ TAPIMAXCALLEDPARTYSIZE ];
00545
00546     char szNum[MAXBUFSIZE];
00547     char szFieldName[MAXBUFSIZE];
00548     char szPt[MAXBUFSIZE];
00549
00550
00551     // get speed dial settings from INI file
00552     for(cSDEntry = 1; cSDEntry <= NSPEEDDIALS; ++cSDEntry)
00553     {
00554
00555         wsprintf(szFieldName, "Name%d", cSDEntry);
00556         GetPrivateProfileString (
00557                   "Speed Dial Settings",
00558                   szFieldName,
00559                   gszNULL,
00560                   szName,
00561                   TAPIMAXCALLEDPARTYSIZE - 1,
00562                   gszINIfilename
00563                 );
00564
00565         wsprintf(szFieldName, "Number%d", cSDEntry);
00566         GetPrivateProfileString (
00567                   "Speed Dial Settings",
00568                   szFieldName,
00569                   gszNULL,
00570                   gszSDNumber[cSDEntry],
00571                   TAPIMAXDESTADDRESSSIZE - 1,
00572                   gszINIfilename
00573                 );
00574
00575     if ( !lstrcmp( gszNULL, szName ) )
00576     {
00577       strncpy( szName, gszSDNumber[ cSDEntry ], (sizeof(szName)-1));
00578     }
00579
00580     szName[TAPIMAXCALLEDPARTYSIZE-1] = '\0';
00581
00582     FitTextToButton( ghWndMain, IDD_DSPEEDDIAL1 + cSDEntry - 1, szName );
00583
00584     AmpersandCompensate( szName, szTemp );
00585     SetDlgItemText (
00586             ghWndMain,
00587             IDD_DSPEEDDIAL1 + cSDEntry - 1,
00588             (LPCSTR)szTemp
00589              ); // Label the speed dial button
00590   }
00591
00592
00593   // set up last dialed numbers in combo box (read from INI)
00594   for(cLastDialed = 1; cLastDialed <= NLASTDIALED; ++cLastDialed)
00595   {
00596     wsprintf(szFieldName, "Last dialed %d", cLastDialed);
00597     GetPrivateProfileString (
00598                   "Last dialed numbers",
00599                   szFieldName,
00600                   gszNULL,
00601                   szNum,
00602                   MAXBUFSIZE - 1,
00603                   gszINIfilename
00604                 );
00605     if ( szNum[0] ) // i.e. if szNum isn't simply "" - if we read something
00606             // from the INI - put it in the combo box
00607       SendDlgItemMessage(
00608                 ghWndMain,
00609                 IDD_DCOMBO,
00610                 CB_ADDSTRING,
00611                 0,
00612                 (LPARAM)(LPCSTR)szNum
00613                 );
00614   }
00615
00616   // set defaults
00617   ptLeftTop.x = 100;
00618   ptLeftTop.y = 100;
00619
00620   // set the window position based on the INI data
00621   GetPrivateProfileString (
00622                 "Preference",
00623                 "Main Window Left/Top",
00624                 gszNULL,
00625                 szPt,
00626                 MAXBUFSIZE - 1,
00627                 gszINIfilename
00628               );
00629
00630   if ( szPt[0] )
00631   {
00632     cComma = (int) strcspn(szPt, ",");
00633     szPt[cComma] = 0;
00634     ptLeftTop.x = atoi(szPt);
00635
00636     // a possibly absurd check to see that the string
00637     // wasn't akin to "320," with no second entry
00638     if ( *(szPt + cComma + 1 ) )
00639       ptLeftTop.y = atoi( szPt + cComma + 1 );
00640
00641     // check to see that the box is on the screen - the upper left
00642     // must be on the screen, along with a 50x50 box below and to
00643     // the right of it
00644     if ( ptLeftTop.x < 0
00645       || ptLeftTop.x + 50 >= GetSystemMetrics(SM_CXSCREEN)
00646       || ptLeftTop.y < 0
00647       || ptLeftTop.y + 50 >= GetSystemMetrics(SM_CYSCREEN)
00648        )
00649     {
00650       ptLeftTop.x = 100; // set defaults if the box is off of the screen
00651       ptLeftTop.y = 100; // set defaults if the box is off of the screen
00652     }
00653   }
00654
00655   SetWindowPos (
00656           ghWndMain,
00657           NULL,
00658           ptLeftTop.x,
00659           ptLeftTop.y,
00660           0,
00661           0,
00662           SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOZORDER
00663          );
00664 }
00665
00666
00667
00668 //***************************************************************************
00669 //***************************************************************************
00670 //***************************************************************************
00671 VOID ButtonFontSetup(VOID)
00672     {
00673     HDC hdc;
00674     int IDD;
00675
00676     // define the fonts for the buttons
00677     hdc = GetDC(GetDesktopWindow());
00678
00679     ghFontBtn = CreateFont(
00680         (-10)*GetDeviceCaps(hdc, LOGPIXELSY)/72,
00681         0,
00682         0,
00683         0,
00684         FW_BOLD,
00685         FALSE,
00686         FALSE,
00687         FALSE,
00688         ANSI_CHARSET,
00689         OUT_DEFAULT_PRECIS,
00690         CLIP_DEFAULT_PRECIS,
00691         PROOF_QUALITY,
00692         VARIABLE_PITCH | FF_SWISS,
00693         (LPSTR)"Arial"
00694         );
00695
00696     ghFontBtnText = CreateFont(
00697         (-6)*GetDeviceCaps(hdc, LOGPIXELSY)/72,
00698         0,
00699         0,
00700         0,
00701         FW_NORMAL,
00702         FALSE,
00703         FALSE,
00704         FALSE,
00705         ANSI_CHARSET,
00706         OUT_DEFAULT_PRECIS,
00707         CLIP_DEFAULT_PRECIS,
00708         PROOF_QUALITY,
00709         VARIABLE_PITCH | FF_SWISS,
00710         NULL
00711         );
00712
00713     ghFontBtnStar = CreateFont(
00714         (-18)*GetDeviceCaps(hdc, LOGPIXELSY)/72,
00715         0,
00716         0,
00717         0,
00718         FW_BOLD,
00719         FALSE,
00720         FALSE,
00721         FALSE,
00722         SYMBOL_CHARSET,
00723         OUT_TT_PRECIS,
00724         CLIP_DEFAULT_PRECIS,
00725         PROOF_QUALITY,
00726         VARIABLE_PITCH | FF_DONTCARE,
00727         (LPSTR)"Symbol"
00728         );
00729
00730     ReleaseDC(GetDesktopWindow(), hdc);
00731
00732
00733     // set the fonts for the buttons
00734     if(ghFontBtn)
00735         {
00736         // set fonts on number buttons
00737             for(IDD = IDD_DBUTTON1; IDD <= IDD_DBUTTON0; ++IDD)
00738             // the order is IDD_DBUTTON1, 2, 3, ..., 0 (thus from 1 to 0)
00739             SendMessage(
00740                 GetDlgItem(ghWndMain, IDD),
00741                 WM_SETFONT,
00742                 (WPARAM)ghFontBtn,
00743                 0L
00744                 );
00745
00746         // set fonts on * and # buttons
00747         SendMessage(
00748             GetDlgItem(ghWndMain, IDD_DBUTTONSTAR),
00749             WM_SETFONT,
00750             (WPARAM)ghFontBtnStar,
00751             0L
00752             );
00753         SendMessage(
00754                     GetDlgItem(ghWndMain, IDD_DBUTTONPOUND),
00755             WM_SETFONT,
00756             (WPARAM)ghFontBtnStar,
00757             0L
00758             );
00759         }
00760     }
00761
00762
00763
00764 //***************************************************************************
00765 //***************************************************************************
00766 //***************************************************************************
00767 // Draws a 3D button within rcBtn on hDC
00768 VOID DrawButton(HDC hDC, RECT rcBtn, BOOL fHighlighted)
00769     {
00770     HPEN hPenPrev, hPenShadow, hPenHighlight, hPenBlack;
00771     HBRUSH hBrushPrev, hBrushFace;
00772     int RopPrev;
00773
00774     --rcBtn.right;
00775     --rcBtn.bottom;
00776
00777     // set up pens/brush
00778     hPenShadow = CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DSHADOW));
00779     hPenHighlight = CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHILIGHT));
00780     hPenBlack = GetStockObject(BLACK_PEN);
00781     hBrushFace = GetSysColorBrush(COLOR_3DFACE);
00782
00783     // get current state so we can put it back at the end of DrawButton
00784     hPenPrev = SelectObject(hDC, hPenBlack);
00785     RopPrev = SetROP2(hDC, R2_COPYPEN);
00786     hBrushPrev = SelectObject(hDC, hBrushFace);
00787
00788     PatBlt(
00789         hDC,
00790         rcBtn.left + 1,
00791         rcBtn.top + 1,
00792         rcBtn.right - rcBtn.left - 1,
00793         rcBtn.bottom - rcBtn.top - 1,
00794         PATCOPY
00795         );
00796
00797     if(fHighlighted)
00798         {
00799         SelectObject(hDC, hPenBlack);
00800         MoveToEx(hDC, rcBtn.left, rcBtn.bottom - 1, NULL);
00801         LineTo(hDC, rcBtn.left, rcBtn.top);  //  _
00802         LineTo(hDC, rcBtn.right, rcBtn.top); // |
00803
00804         SelectObject(hDC, hPenHighlight);
00805         MoveToEx(hDC, rcBtn.right, rcBtn.top, NULL);
00806         LineTo(hDC, rcBtn.right, rcBtn.bottom);
00807         LineTo(hDC, rcBtn.left - 1, rcBtn.bottom); // _|
00808
00809         SelectObject(hDC, hPenShadow);
00810         MoveToEx(hDC, rcBtn.left + 1, rcBtn.bottom - 2, NULL);
00811         LineTo(hDC, rcBtn.left + 1, rcBtn.top + 1);
00812         LineTo(hDC, rcBtn.right - 1, rcBtn.top + 1);
00813         }
00814     else
00815         {
00816         SelectObject(hDC, hPenHighlight);
00817         MoveToEx(hDC, rcBtn.left, rcBtn.bottom - 1, NULL);
00818         LineTo(hDC, rcBtn.left, rcBtn.top);  //  _
00819         LineTo(hDC, rcBtn.right, rcBtn.top); // |
00820
00821         SelectObject(hDC, hPenBlack);
00822         MoveToEx(hDC, rcBtn.right, rcBtn.top, NULL);
00823         LineTo(hDC, rcBtn.right, rcBtn.bottom);
00824         LineTo(hDC, rcBtn.left - 1, rcBtn.bottom); // _|
00825
00826         SelectObject(hDC, hPenShadow);
00827         MoveToEx(hDC, rcBtn.left + 1, rcBtn.bottom - 1, NULL);
00828         LineTo(hDC, rcBtn.right - 1, rcBtn.bottom - 1);
00829         LineTo(hDC, rcBtn.right - 1, rcBtn.top);
00830         }
00831
00832     // put everything back how it was
00833     SetROP2(hDC, RopPrev);
00834     SelectObject(hDC, hBrushPrev);
00835     SelectObject(hDC, hPenPrev);
00836
00837     DeleteObject(hPenBlack);
00838     DeleteObject(hPenShadow);
00839     DeleteObject(hPenHighlight);
00840     DeleteObject(hBrushFace);
00841     }
00842
00843
00844
00845 //***************************************************************************
00846 //***************************************************************************
00847 //***************************************************************************
00848 VOID DrawButtonText(HDC hDC, RECT rcBtn, BOOL fHighlighted, UINT IDD_Btn)
00849     {
00850     char szLine1[MAXBUFSIZE]; // text in button up to '\n'
00851     LPSTR pszLine2; // text in button after '\n'
00852     int BkModePrev;
00853     HFONT hFontPrev = NULL;
00854     TEXTMETRIC tm;
00855     RECT rcText = rcBtn;
00856
00857     BkModePrev = SetBkMode(hDC, TRANSPARENT);
00858
00859     GetDlgItemText(ghWndMain, IDD_Btn, szLine1, MAXBUFSIZE);
00860     pszLine2 = strstr(szLine1, "\n");
00861     if(pszLine2)
00862         {
00863         *pszLine2 = 0; // 1 -> "TEST1 \n TEST2" becomes "TEST 1 \0"
00864         ++pszLine2; // now 2 -> " TEST 2"
00865         }
00866
00867     // now szLine1 points to the null terminated first string and
00868     // pszLine2 points to either the null terminated second string or NULL
00869     // if there was no second string
00870
00871     if(szLine1[0])
00872         {
00873         if(ghFontBtnText && pszLine2)
00874             hFontPrev = SelectObject(hDC, ghFontBtnText);
00875
00876         GetTextMetrics(hDC, &tm);
00877         rcText.bottom = (rcBtn.bottom + rcBtn.top)/2 - 2;
00878         rcText.top = rcText.bottom - (tm.tmHeight - 1);
00879
00880         if(pszLine2 == NULL)
00881             OffsetRect(&rcText, 0, (rcText.bottom - rcText.top)/2);
00882
00883         if(fHighlighted)
00884             OffsetRect(&rcText, 1, 1);
00885
00886         DrawText(hDC, szLine1, -1, &rcText, DT_SINGLELINE | DT_CENTER);
00887
00888         if(hFontPrev)
00889             SelectObject(hDC, hFontPrev);
00890         }
00891     if(pszLine2) // recall that pszLine2 == NULL to represent no second string
00892         {
00893         GetTextMetrics(hDC, &tm);
00894         if(IDD_Btn == IDD_DBUTTONSTAR || IDD_Btn == IDD_DBUTTONPOUND)
00895             rcText.top = (rcBtn.bottom + rcBtn.top)/2 - (tm.tmHeight)/2;
00896         else
00897             rcText.top = (rcBtn.bottom + rcBtn.top)/2 - 2;
00898         rcText.bottom = rcText.top + tm.tmHeight;
00899
00900         if(fHighlighted)
00901             OffsetRect(&rcText, 1, 1);
00902
00903         DrawText(hDC, pszLine2, -1, &rcText, DT_SINGLELINE | DT_CENTER);
00904         }
00905
00906     SetBkMode(hDC, BkModePrev);
00907     }
00908
00909
00910
00911 //***************************************************************************
00912 //***************************************************************************
00913 //***************************************************************************
00914 VOID DisableDialButtons(BOOL fDisable)
00915 {
00916   int IDD;
00917
00918   // Disable/enable Dial button
00919   EnableWindow( GetDlgItem( ghWndMain, IDD_DDIAL ),!fDisable) ;
00920
00921   // Disable/enable Speed dial buttons
00922   for ( IDD = IDD_DSPEEDDIAL1; IDD <= IDD_DSPEEDDIAL8; ++IDD )
00923   {
00924     EnableWindow(GetDlgItem(ghWndMain, IDD),!fDisable);
00925   }
00926 }
00927
00928
00929
00930 //***************************************************************************
00931 //***************************************************************************
00932 //***************************************************************************
00933 VOID DialerCleanup(VOID)
00934     {
00935     RECT rc;
00936     WORD cItem; // count of numbers in combo box
00937     DWORD cLastDialed;
00938     char szPt[MAXBUFSIZE];
00939     char szNumber[TAPIMAXDESTADDRESSSIZE];
00940     char szFieldName[MAXBUFSIZE];
00941
00942     CloseTAPI(); // unregister and line close
00943
00944     if(!IsIconic(ghWndMain)) // if the window is not minimized, record position
00945         {
00946         GetWindowRect(ghWndMain, &rc);
00947         wsprintf(szPt, "%ld, %ld", rc.left, rc.top);
00948         WritePrivateProfileString(
00949             "Preference",
00950             "Main Window Left/Top",
00951             szPt,
00952             gszINIfilename
00953             );
00954         }
00955
00956     cItem = (WORD)SendDlgItemMessage(ghWndMain, IDD_DCOMBO, CB_GETCOUNT, 0, 0);
00957
00958     // write out last dialed numbers from combo box (write to INI)
00959     for(cLastDialed = 1; cLastDialed <= NLASTDIALED; ++cLastDialed)
00960         {
00961         if(cLastDialed <= cItem)
00962             SendDlgItemMessage(
00963                 ghWndMain,
00964                 IDD_DCOMBO,
00965                 CB_GETLBTEXT,
00966                 cLastDialed - 1, // it's a zero-based count
00967                 (LPARAM)(LPCSTR)szNumber);
00968
00969         else
00970             szNumber[0] = 0;
00971
00972         wsprintf(szFieldName, "Last dialed %d", cLastDialed);
00973         WritePrivateProfileString(
00974             "Last dialed numbers",
00975             szFieldName,
00976             szNumber,
00977             gszINIfilename
00978             );
00979
00980         }
00981
00982     DestroyWindow(ghWndMain);
00983     ghWndMain = NULL;
00984
00985     DeleteObject(ghFontBtn);
00986     DeleteObject(ghFontBtnText);
00987     DeleteObject(ghFontBtnStar);
00988     }
00989
00990
00991
00992 //***************************************************************************
00993 //***************************************************************************
00994 //***************************************************************************
00995 // unregister and line close
00996 VOID CloseTAPI(VOID)
00997 {
00998
00999   // unregister as call manager
01000   lineRegisterRequestRecipient (
01001                   ghLineApp,
01002                   0, // registration instance
01003                   LINEREQUESTMODE_MAKECALL,
01004                   FALSE
01005                  );
01006
01007   if ( gCurrentLineInfo.hLine )
01008   {
01009     lineClose ( gCurrentLineInfo.hLine );
01010     gfCurrentLineAvail = FALSE;
01011     gCurrentLineInfo.hLine = (HLINE)((ULONG_PTR)NULL);
01012   }
01013
01014   lineShutdown(ghLineApp);
01015 }
01016
01017
01018
01019 //***************************************************************************
01020 //***************************************************************************
01021 //***************************************************************************
01022 BOOL CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01023 {
01024   static HICON hIcon;
01025
01026         switch (msg)
01027         {
01028             case WM_INITDIALOG:
01029                 hIcon = LoadIcon( ghInst, (LPCSTR) MAKEINTRESOURCE( IDI_DIALER ) );
01030                 return TRUE;
01031
01032             case WM_SYSCOMMAND:
01033                 switch( (DWORD) wParam )
01034                 {
01035                     case SC_CLOSE:
01036                         PostQuitMessage(0);
01037                 }
01038                 break;
01039
01040             case WM_INITMENUPOPUP:
01041                 // if edit menu
01042                 if ( LOWORD(lParam) == 1 )
01043                 {
01044                     UINT wEnable;
01045
01046                     if ( GetParent( GetFocus() ) != GetDlgItem( ghWndMain, IDD_DCOMBO ) )
01047                     {
01048                         wEnable = MF_GRAYED;
01049                     }
01050                     else
01051                     {
01052                         LONG lSelect = (LONG)SendDlgItemMessage (
01053                             ghWndMain,
01054                             IDD_DCOMBO,
01055                             CB_GETEDITSEL,
01056                             0,
01057                             0
01058                             );
01059
01060                         if ( HIWORD( lSelect ) != LOWORD( lSelect ) )
01061                             wEnable = MF_ENABLED;
01062                         else
01063                             wEnable = MF_GRAYED;
01064                     }
01065
01066                     EnableMenuItem((HMENU)wParam, IDM_EDIT_CUT, wEnable);
01067                     EnableMenuItem((HMENU)wParam, IDM_EDIT_COPY, wEnable);
01068                     EnableMenuItem((HMENU)wParam, IDM_EDIT_DELETE, wEnable);
01069
01070                     // enable paste option is there is data
01071                     // in the clipboard
01072                     if ( IsClipboardFormatAvailable( CF_TEXT ) )
01073                     {
01074                         if ( GetClipboardData ( CF_TEXT ) )
01075                         {
01076                             wEnable = MF_ENABLED;
01077                         }
01078                         else
01079                         {
01080                             wEnable = MF_GRAYED;
01081                         }
01082                     }
01083                     else
01084                     {
01085                         wEnable = MF_GRAYED;
01086                     }
01087
01088                 }
01089                 break;
01090
01091
01092             case WM_COMMAND:
01093             {
01094                 char szName[TAPIMAXCALLEDPARTYSIZE] = {'\0'};
01095                 char szNumber[TAPIMAXDESTADDRESSSIZE] = {'\0'};
01096
01097                 switch( LOWORD( (DWORD)wParam ) )
01098                 {
01099                     // FILE menu
01100                     case IDM_EXIT:
01101                         PostQuitMessage(0);
01102                         return TRUE;
01103
01104
01105                         // EDIT menu
01106                     case IDM_EDIT_CUT:
01107                         SendDlgItemMessage(ghWndMain, IDD_DCOMBO, WM_CUT, 0, 0);
01108                         return TRUE;
01109
01110                     case IDM_EDIT_COPY:
01111                         SendDlgItemMessage(ghWndMain, IDD_DCOMBO, WM_COPY, 0, 0);
01112                         return TRUE;
01113
01114                     case IDM_EDIT_PASTE:
01115                         SendDlgItemMessage(ghWndMain, IDD_DCOMBO, WM_PASTE, 0, 0);
01116                         return TRUE;
01117
01118                     case IDM_EDIT_DELETE:
01119                         SendDlgItemMessage(ghWndMain, IDD_DCOMBO, WM_CLEAR, 0, 0);
01120                         return TRUE;
01121
01122                     case IDM_EDIT_SPEEDDIAL:
01123                         DialogBoxParam (
01124                                         ghInst,
01125                                         MAKEINTRESOURCE(IDD_SD1),
01126                                         ghWndMain,
01127                                         (DLGPROC)SpeedDial1Proc,
01128                                         0
01129                                        );
01130                         SetFocus(GetDlgItem(ghWndMain, IDD_DDIAL));
01131                         return TRUE;
01132
01133                         // TOOLS menu
01134                     case IDM_CONNECTUSING:
01135                         DialogBoxParam (
01136                                         ghInst,
01137                                         MAKEINTRESOURCE(IDD_CONNECTUSING),
01138                                         ghWndMain,
01139                                         (DLGPROC)ConnectUsingProc,
01140                                         MENU_CHOICE
01141                                        );
01142                         return TRUE;
01143
01144                     case IDM_LOCATION:
01145                     {
01146                         char szCanNumber[ TAPIMAXDESTADDRESSSIZE ] ;
01147
01148                         // fetch the number to be dialed
01149                         if ( GetDlgItemText (
01150                                               ghWndMain,
01151                                               IDD_DCOMBO,
01152                                               szNumber,
01153                                               TAPIMAXDESTADDRESSSIZE
01154                                             )
01155                            )
01156                         {
01157                             // if a number exists, convert it to
01158                             // its canonical form.
01159                             if ( !MakeCanonicalNumber ( szNumber, szCanNumber ) )
01160                             {
01161                                 strncpy( szCanNumber, szNumber,(sizeof(szCanNumber)-1));
01162                 szCanNumber[TAPIMAXDESTADDRESSSIZE-1] = '\0';
01163               }
01164                         }
01165
01166
01167                         lineTranslateDialog (
01168                                              ghLineApp,
01169                                              0,
01170                                              TAPI_CURRENT_VERSION,
01171                                              ghWndMain,
01172                                              szCanNumber
01173                                             );
01174                         return TRUE;
01175
01176                     }
01177                     // HELP menu
01178
01179                     case IDM_ABOUT:
01180                         DialogBoxParam(
01181                                        ghInst,
01182                                        MAKEINTRESOURCE(IDD_ABOUT),
01183                                        ghWndMain,
01184                                        (DLGPROC)AboutProc,
01185                                        0
01186                                       );
01187
01188                         return TRUE;
01189
01190
01191                         // Accelerator processing
01192                     case IDM_ACCEL_NUMTODIAL:
01193                         if(GetActiveWindow() == ghWndMain)
01194                             SetFocus(GetDlgItem(ghWndMain, IDD_DCOMBO));
01195                         return TRUE;
01196
01197
01198                         // Buttons
01199                     case IDD_DDIAL:
01200
01201                     {
01202                         DWORD cSDEntry;
01203                         char szSDNumber[TAPIMAXDESTADDRESSSIZE];
01204                         char szFieldName[MAXBUFSIZE];
01205
01206                         // check if number entered is dialable
01207                         if ( SendMessage (
01208                                           GetDlgItem(ghWndMain, IDD_DCOMBO),
01209                                           WM_GETTEXTLENGTH,
01210                                           0,
01211                                           0
01212                                          ) > 0
01213                            )
01214                         {
01215                             // get the number to be dialed
01216                             GetDlgItemText (
01217                                             ghWndMain,
01218                                             IDD_DCOMBO,
01219                                             (LPSTR)szNumber,
01220                                             TAPIMAXDESTADDRESSSIZE
01221                                            );
01222
01223                             // check if it is a speed dial number.
01224                             // If so choose the name to be displayed.
01225                             for( cSDEntry = 1; cSDEntry <= NSPEEDDIALS; ++cSDEntry)
01226                             {
01227                                 wsprintf(szFieldName, "Number%d", cSDEntry);
01228                                 GetPrivateProfileString (
01229                                     "Speed Dial Settings",
01230                                     szFieldName,
01231                                     gszNULL,
01232                                     szSDNumber,
01233                                     TAPIMAXCALLEDPARTYSIZE - 1,
01234                                     gszINIfilename
01235                                     );
01236
01237                                 // if the number matches, get the name
01238                                 if ( lstrcmp(szSDNumber, szNumber) == 0 )
01239                                 {
01240                                     wsprintf( szFieldName, "Name%d", cSDEntry);
01241                                     GetPrivateProfileString (
01242                                         "Speed Dial Settings",
01243                                         szFieldName,
01244                                         gszNULL,
01245                                         szName,
01246                                         TAPIMAXCALLEDPARTYSIZE - 1,
01247                                         gszINIfilename
01248                                         );
01249                                     break;
01250                                 }
01251                             }
01252
01253                             SetFocus( GetDlgItem( ghWndMain, IDD_DDIAL ) );
01254
01255                             // once the currentline has been set
01256                             // using the connect proc
01257                             // the user must hit dial again
01258                             if ( giCurrentLine == (DWORD)-1 )
01259                             {
01260                                 DialogBoxParam (
01261                                                 ghInst,
01262                                                 MAKEINTRESOURCE(IDD_CONNECTUSING),
01263                                                 ghWndMain,
01264                                                 (DLGPROC)ConnectUsingProc,
01265                                                 INVALID_LINE
01266                                                );
01267                             }
01268                             else
01269                             {
01270                                 AddToRedialList(szNumber);
01271                                 InitiateCall(szNumber, szName);
01272                             }
01273                         }
01274                         return TRUE;
01275                     }
01276
01277
01278                     case IDD_DBUTTON1:
01279                     case IDD_DBUTTON2:
01280                     case IDD_DBUTTON3:
01281                     case IDD_DBUTTON4:
01282                     case IDD_DBUTTON5:
01283                     case IDD_DBUTTON6:
01284                     case IDD_DBUTTON7:
01285                     case IDD_DBUTTON8:
01286                     case IDD_DBUTTON9:
01287                     case IDD_DBUTTON0:
01288                     case IDD_DBUTTONSTAR:
01289                     case IDD_DBUTTONPOUND:
01290                     {
01291                         int     i;
01292                         TCHAR   szBuffer[TAPIMAXDESTADDRESSSIZE+1];
01293
01294                         static const char digits[] = { '1', '2', '3', '4',
01295                         '5', '6', '7', '8',
01296                         '9', '0', '*', '#' };
01297
01298                         i = (int)SendDlgItemMessage(ghWndMain,
01299                                                IDD_DCOMBO,
01300                                                WM_GETTEXT,
01301                                                (WPARAM)TAPIMAXDESTADDRESSSIZE+1,
01302                                                (LPARAM)szBuffer);
01303
01304                         if (i < TAPIMAXDESTADDRESSSIZE)
01305                         {
01306                             MoveMemory(szBuffer+gdwStartSel+1,
01307                                        szBuffer+gdwEndSel,
01308                                        i - ( gdwEndSel ) + 1 );
01309
01310                             szBuffer[gdwStartSel] = digits[LOWORD(wParam) - IDD_DBUTTON1];
01311
01312                             SendDlgItemMessage(ghWndMain,
01313                                                IDD_DCOMBO,
01314                                                WM_SETTEXT,
01315                                                0,
01316                                                (LPARAM)szBuffer);
01317
01318                             gdwStartSel++;
01319                             gdwEndSel = gdwStartSel;
01320                         }
01321
01322                         SetFocus(GetDlgItem(ghWndMain, IDD_DDIAL));
01323                         EnableWindow(GetDlgItem(ghWndMain, IDD_DDIAL), TRUE);
01324
01325                         return TRUE;
01326                     }
01327
01328
01329                     case IDD_DCOMBO:
01330
01331                         if (HIWORD(wParam) == CBN_SELENDOK)
01332                         {
01333                             EnableWindow( GetDlgItem(ghWndMain, IDD_DDIAL), TRUE );
01334                         }
01335
01336                         if ((HIWORD(wParam) == CBN_SELENDOK) ||
01337                             (HIWORD(wParam) == CBN_SELENDCANCEL))
01338                         {
01339
01340                             (DWORD)SendDlgItemMessage(ghWndMain,
01341                                 IDD_DCOMBO,
01342                                 CB_GETEDITSEL,
01343                                 (WPARAM)&gdwStartSel,
01344                                 (LPARAM)&gdwEndSel);
01345                             return FALSE;
01346                         }
01347
01348                         if ( HIWORD( wParam ) == CBN_EDITCHANGE )
01349                         {
01350                             EnableWindow (
01351                                           GetDlgItem( ghWndMain, IDD_DDIAL ),
01352                                           (BOOL) GetWindowTextLength (
01353                                 GetDlgItem (
01354                                             ghWndMain,
01355                                             IDD_DCOMBO
01356                                            )
01357                                 )
01358                                          );
01359                             return TRUE;
01360                         }
01361
01362                         break;
01363
01364                     case IDD_DSPEEDDIAL1:
01365                     case IDD_DSPEEDDIAL2:
01366                     case IDD_DSPEEDDIAL3:
01367                     case IDD_DSPEEDDIAL4:
01368                     case IDD_DSPEEDDIAL5:
01369                     case IDD_DSPEEDDIAL6:
01370                     case IDD_DSPEEDDIAL7:
01371                     case IDD_DSPEEDDIAL8:
01372                     {
01373                         DWORD cSDEntry = LOWORD( (DWORD) wParam)  - IDD_DSPEEDDIAL1 + 1;
01374                         char szFieldName [MAXBUFSIZE];
01375
01376                         // get information for the speed dial button
01377                         // from the INI file
01378                         wsprintf(szFieldName, "Name%d", cSDEntry);
01379                         GetPrivateProfileString (
01380                             "Speed Dial Settings",
01381                             szFieldName,
01382                             gszNULL,
01383                             szName,
01384                             TAPIMAXCALLEDPARTYSIZE - 1,
01385                             gszINIfilename
01386                                                 );
01387
01388                         wsprintf(szFieldName, "%s%d", "Number", cSDEntry);
01389                         GetPrivateProfileString (
01390                             "Speed Dial Settings",
01391                             szFieldName,
01392                             gszNULL,
01393                             gszSDNumber[cSDEntry],
01394                             TAPIMAXDESTADDRESSSIZE - 1,
01395                             gszINIfilename
01396                                                 );
01397
01398                         // entry not set yet
01399                         if( gszSDNumber[cSDEntry][0] == 0 )
01400                         {
01401                             DialogBoxParam (
01402                                             ghInst,
01403                                             MAKEINTRESOURCE(IDD_SD2),
01404                                             ghWndMain,
01405                                             (DLGPROC)SpeedDial2Proc,
01406                                             MAKELPARAM(wParam,0)
01407                                            );
01408                         }
01409
01410                         // no line open
01411                         // once the currentline has been set
01412                         // using the connect proc
01413                         // the user must hit dial again
01414                         else if ( giCurrentLine == (DWORD)-1)
01415                         {
01416                             DialogBoxParam (
01417                                             ghInst,
01418                                             MAKEINTRESOURCE(IDD_CONNECTUSING),
01419                                             ghWndMain,
01420                                             (DLGPROC)ConnectUsingProc,
01421                                             INVALID_LINE
01422                                            );
01423                         }
01424                         // entry is set and valid voice line is open
01425                         else
01426                         {
01427                             // add number to list box combo.
01428                             AddToRedialList( gszSDNumber[cSDEntry] );
01429                             InitiateCall( gszSDNumber[cSDEntry], szName );
01430                         }
01431                         break;
01432                     }
01433                            } // end switch (LOWORD((DWORD)wParam)) { ... }
01434
01435                             break; // end case WM_COMMAND
01436                             }
01437
01438
01439                                             case WM_PAINT:
01440                                             {
01441                                                 PAINTSTRUCT ps;
01442
01443
01444                                                 BeginPaint(ghWndMain, &ps);
01445
01446                                                 if(IsIconic(ghWndMain))
01447                                                     DrawIcon(ps.hdc, 0, 0, hIcon);
01448                                                 else
01449                                                 {
01450                                                     HBRUSH hBrush;
01451
01452                                                     hBrush = GetSysColorBrush( COLOR_3DFACE );
01453                                                     //                FillRect(ps.hdc, &ps.rcPaint, GetStockObject(LTGRAY_BRUSH));
01454                                                     FillRect(ps.hdc, &ps.rcPaint, hBrush);
01455                                                 }
01456
01457                                                 EndPaint(ghWndMain, &ps);
01458
01459                                                 return TRUE;
01460                                             }
01461
01462
01463                                             case WM_DRAWITEM:
01464                                             {
01465                                                 LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
01466                                                 BOOL fHighlighted = (BOOL)(SendDlgItemMessage(
01467                                                     ghWndMain,
01468                                                     lpdis->CtlID,
01469                                                     BM_GETSTATE,
01470                                                     0,
01471                                                     0
01472                                                     ) & 0x0004);
01473
01474                                                 DrawButton(lpdis->hDC, lpdis->rcItem, fHighlighted);
01475                                                 DrawButtonText(
01476                                                     lpdis->hDC,
01477                                                     lpdis->rcItem,
01478                                                     fHighlighted,
01479                                                     lpdis->CtlID
01480                                                     );
01481                                                 return TRUE;
01482                                             }
01483
01484
01485                                             case WM_CTLCOLORLISTBOX:
01486                                             case WM_CTLCOLORBTN:
01487                                             case WM_CTLCOLORSTATIC:
01488                                                 SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));
01489                                                 return (BOOL)((ULONG_PTR)GetSysColorBrush( COLOR_3DFACE ));
01490
01491
01492                                             default:
01493                                                 ;
01494                                                 //            return DefDlgProc( hwnd, msg, wParam, lParam );
01495                                                 //            return DefWindowProc( hwnd, msg, wParam, lParam );
01496
01497
01498                     } // switch (msg) { ... }
01499
01500   return FALSE;
01501   }
01502
01503
01504
01505 //***************************************************************************
01506 //***************************************************************************
01507 //***************************************************************************
01508 VOID AddToRedialList( LPCSTR szNumber )
01509 {
01510   // NLASTDIALED == 10
01511   WORD cNum;
01512   HWND hWndCombo = GetDlgItem(ghWndMain, IDD_DCOMBO);
01513   LRESULT nMatch;
01514
01515   // if valid number
01516   if ( szNumber[0] )
01517   {
01518     // if list box has entries, check if this number
01519     // is already present.  If so delete old entry
01520     cNum = (WORD) SendMessage(hWndCombo, CB_GETCOUNT, 0, 0);
01521     if ( cNum != 0 )
01522     {
01523       nMatch = SendMessage ( hWndCombo, CB_FINDSTRING, 0, (LPARAM)szNumber );
01524       if ( nMatch != CB_ERR )
01525       {
01526         SendMessage(hWndCombo, CB_DELETESTRING, nMatch, 0);
01527       }
01528       else
01529       {
01530         // if the list is full, remove oldest
01531         if ( cNum == NLASTDIALED )
01532         {
01533           SendMessage( hWndCombo, CB_DELETESTRING, NLASTDIALED - 1, 0 );
01534         }
01535       }
01536     }
01537     SendMessage(hWndCombo, CB_INSERTSTRING, 0, (LPARAM)szNumber);
01538     SendMessage(hWndCombo, CB_SETCURSEL, 0, 0L);
01539     EnableWindow ( GetDlgItem( ghWndMain, IDD_DDIAL ), TRUE );
01540   }
01541 }
01542
01543
01544
01545 //***************************************************************************
01546 //***************************************************************************
01547 //***************************************************************************
01548 VOID InitiateCall ( LPCSTR szNumber, LPCSTR szName )
01549 {
01550   HLINE hLine = (HLINE)((ULONG_PTR)NULL);
01551
01552   DWORD errCode;
01553
01554   // struct size info
01555   DWORD dwLTPSize = sizeof ( LINETRANSLATEOUTPUT );
01556   DWORD dwNameLen = lstrlen( szName ) + 1;
01557   DWORD dwLCPSize = sizeof( LINECALLPARAMS );
01558
01559   LPLINETRANSLATEOUTPUT lpTransOut = NULL;
01560   LPLINECALLPARAMS lpLineCallParams = NULL;
01561
01562   char szCanNumber[ TAPIMAXDESTADDRESSSIZE ];
01563
01564   DWORD dwRemainingLength ;
01565
01566   // Open a line
01567   errCode = lineOpen (
01568             ghLineApp,
01569             giCurrentLine,
01570             &hLine,
01571             gCurrentLineInfo.dwAPIVersion,
01572             0,
01573             0,
01574             LINECALLPRIVILEGE_NONE,
01575             0,
01576             NULL
01577              );
01578   if (errCode)
01579   {
01580     errString ( ghWndMain, errCode, MB_ICONEXCLAMATION | MB_OK );
01581     goto error;
01582   }
01583
01584
01585   // call translate address before dialing
01586   do
01587   {
01588     lpTransOut = (LPLINETRANSLATEOUTPUT) DialerAlloc( dwLTPSize );
01589     if ( !lpTransOut )
01590     {
01591       errString( ghWndMain, LINEERR_NOMEM, MB_ICONSTOP | MB_OK );
01592       goto error;
01593     }
01594     lpTransOut-> dwTotalSize = dwLTPSize;
01595
01596
01597     if ( !MakeCanonicalNumber( szNumber, szCanNumber ) )
01598     {
01599       strncpy( szCanNumber, szNumber, TAPIMAXDESTADDRESSSIZE -1 );
01600       szCanNumber[TAPIMAXDESTADDRESSSIZE-1] = '\0';
01601     }
01602
01603
01604     errCode = lineTranslateAddress (
01605                     ghLineApp,
01606                     giCurrentLine,
01607                     gCurrentLineInfo.dwAPIVersion,
01608                     szCanNumber,
01609                     0,
01610                     0,
01611                     lpTransOut
01612                      );
01613     if ( ((LONG)errCode) < 0 )
01614     {
01615       errString( ghWndMain, errCode, MB_ICONEXCLAMATION | MB_OK );
01616       goto error;
01617     }
01618
01619     if ( lpTransOut-> dwNeededSize <= lpTransOut->dwTotalSize  )
01620     {
01621       // ok we are done
01622       break;
01623     }
01624     else
01625     {
01626       dwLTPSize = lpTransOut-> dwNeededSize;
01627       DialerFree ( lpTransOut );
01628       lpTransOut = NULL;
01629     }
01630
01631   } while ( TRUE );
01632
01633
01634   // if number dialed is 911, bring up a warning
01635   if ( Is911( lpTransOut) )
01636   {
01637     INT nRes = errString ( ghWndMain, ERR_911WARN, MB_ICONSTOP | MB_YESNO );
01638     if ( nRes == IDNO )
01639     {
01640       goto error;
01641     }
01642   }
01643
01644
01645   // set call parameters
01646   dwLCPSize += dwNameLen + lpTransOut-> dwDisplayableStringSize;
01647
01648   lpLineCallParams = (LPLINECALLPARAMS) DialerAlloc( dwLCPSize );
01649   if ( !lpLineCallParams )
01650   {
01651     errString( ghWndMain, LINEERR_NOMEM, MB_ICONSTOP | MB_OK );
01652     goto error;
01653   }
01654
01655   lpLineCallParams->dwTotalSize = dwLCPSize;
01656   lpLineCallParams->dwBearerMode = LINEBEARERMODE_VOICE;
01657   lpLineCallParams->dwMediaMode = LINEMEDIAMODE_INTERACTIVEVOICE;
01658   lpLineCallParams->dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
01659   lpLineCallParams->dwAddressMode = LINEADDRESSMODE_ADDRESSID;
01660   lpLineCallParams->dwAddressID = giCurrentAddress;
01661
01662   if ( szName[ 0 ] )
01663   {
01664     lpLineCallParams->dwCalledPartySize = dwNameLen;
01665     lpLineCallParams->dwCalledPartyOffset = sizeof( LINECALLPARAMS );
01666
01667
01668     dwRemainingLength = lpLineCallParams->dwTotalSize - sizeof(LINECALLPARAMS) -1 ;
01669
01670     strncpy (
01671           (LPSTR) lpLineCallParams + sizeof(LINECALLPARAMS),
01672           szName,
01673           dwRemainingLength
01674           );
01675     ((LPSTR)lpLineCallParams)[lpLineCallParams->dwTotalSize-1] = '\0';
01676
01677   }
01678
01679   lpLineCallParams-> dwDisplayableAddressSize = lpTransOut-> dwDisplayableStringSize;
01680   lpLineCallParams-> dwDisplayableAddressOffset = sizeof( LINECALLPARAMS ) + dwNameLen;
01681   dwRemainingLength = lpLineCallParams->dwTotalSize - sizeof(LINECALLPARAMS) -
01682             lstrlen((LPSTR) lpLineCallParams + sizeof(LINECALLPARAMS))-1;
01683   if (dwRemainingLength >0)
01684   {
01685     strncpy (
01686         (LPSTR) lpLineCallParams + sizeof(LINECALLPARAMS) + dwNameLen,
01687         (LPSTR) lpTransOut + lpTransOut-> dwDisplayableStringOffset,
01688         dwRemainingLength);
01689     ((LPSTR)lpLineCallParams)[lpLineCallParams->dwTotalSize-1] = '\0';
01690
01691   }
01692
01693
01694   // save dialing information
01695   // Free old allocs.
01696   if ( gszCurrentName )
01697   {
01698     DialerFree ( gszCurrentName );
01699   }
01700
01701   if ( gszCurrentNumber )
01702   {
01703     DialerFree ( gszCurrentNumber );
01704   }
01705
01706   // save new stuff
01707   gszCurrentName = (LPSTR) DialerAlloc( dwNameLen );
01708   if ( !gszCurrentName )
01709   {
01710     errString( ghWndMain, LINEERR_NOMEM, MB_ICONSTOP | MB_OK );
01711     goto error;
01712   }
01713   strncpy ( gszCurrentName, szName, dwNameLen );
01714   gszCurrentName[dwNameLen-1] = '\0';
01715   gszCurrentNumber = (LPSTR) DialerAlloc( lpTransOut-> dwDisplayableStringSize );
01716   if ( !gszCurrentNumber )
01717   {
01718     errString( ghWndMain, LINEERR_NOMEM, MB_ICONSTOP | MB_OK );
01719     goto error;
01720   }
01721
01722   strncpy (
01723        gszCurrentNumber,
01724        (LPSTR) lpTransOut + lpTransOut-> dwDisplayableStringOffset ,
01725       lpTransOut-> dwDisplayableStringSize-1
01726       );
01727
01728   gszCurrentNumber[lpTransOut-> dwDisplayableStringSize-1] = '\0';
01729   gCurrentLineInfo.hLine = hLine;
01730   ghCall = (HCALL)((ULONG_PTR)NULL);
01731
01732
01733   // finally make the call.
01734   gMakeCallRequestID = 0;
01735
01736   gMakeCallRequestID = lineMakeCall (
01737                     hLine,
01738                     &ghCall,
01739                     (LPSTR) lpTransOut + lpTransOut-> dwDialableStringOffset,
01740                     0,
01741                     lpLineCallParams
01742                     );
01743
01744   // async request ID
01745   // - the call is going out
01746   if ( (LONG) gMakeCallRequestID > 0 )
01747   {
01748     gfCurrentLineAvail = FALSE;
01749     gfMakeCallReplyPending = TRUE;
01750     DialogBoxParam (
01751             ghInst,
01752             MAKEINTRESOURCE(IDD_DIALING),
01753             ghWndMain,
01754             (DLGPROC)DialingProc,
01755             0
01756              );
01757
01758   }
01759
01760   else
01761   {
01762     if ( gMakeCallRequestID == LINEERR_CALLUNAVAIL )
01763     {
01764       DialogBoxParam (
01765               ghInst,
01766               MAKEINTRESOURCE(IDD_CALLFAILED),
01767               ghWndMain,
01768               (DLGPROC)LineInUseProc,
01769               0
01770                );
01771     }
01772
01773     else
01774     {
01775       errString( ghWndMain, gMakeCallRequestID, MB_ICONEXCLAMATION | MB_OK );
01776     }
01777
01778     DialerLineClose();
01779     gfCurrentLineAvail = TRUE;
01780   }
01781
01782 error :
01783   if ( lpLineCallParams )
01784   {
01785     DialerFree( lpLineCallParams );
01786   }
01787
01788   if ( lpTransOut )
01789   {
01790     DialerFree( lpTransOut );
01791   }
01792
01793   // if makecall did not succeed but line
01794   // was opened, close it.
01795   if ( ( gMakeCallRequestID <= 0 ) && ( gCurrentLineInfo.hLine ) )
01796   {
01797     DialerLineClose ();
01798     gfCurrentLineAvail = TRUE;
01799   }
01800
01801   SetFocus( GetDlgItem( ghWndMain, IDD_DCOMBO ) );
01802
01803   return;
01804
01805 }
01806
01807
01808
01809 //***************************************************************************
01810 //***************************************************************************
01811 //***************************************************************************
01812 DWORD GetLineInfo ( DWORD iLine, LPLINEINFO lpLineInfo )
01813 {
01814   DWORD errCode = 0;
01815   DWORD dwNeededSize = 0;
01816   LINEEXTENSIONID ExtensionID;
01817
01818   LPSTR pszLineName = NULL;
01819   LPLINEDEVCAPS lpDevCaps = NULL;
01820
01821
01822   errCode = lineNegotiateAPIVersion (
01823                     ghLineApp,
01824                     iLine,
01825                     TAPI_VERSION_1_0,
01826                     TAPI_CURRENT_VERSION,
01827                     &( lpLineInfo->dwAPIVersion ),
01828                     &ExtensionID
01829                     );
01830   if ( errCode )
01831   {
01832     GetLineInfoFailed( iLine, lpDevCaps, lpLineInfo );
01833     goto error;
01834   }
01835
01836   dwNeededSize = sizeof( LINEDEVCAPS );
01837   do
01838   {
01839     lpDevCaps = ( LPLINEDEVCAPS ) DialerAlloc( dwNeededSize );
01840     if ( !lpDevCaps )
01841     {
01842       GetLineInfoFailed( iLine, lpDevCaps, lpLineInfo );
01843       errCode = LINEERR_NOMEM;
01844       goto error;
01845     }
01846
01847     lpDevCaps->dwTotalSize = dwNeededSize;
01848     errCode = lineGetDevCaps (
01849                   ghLineApp,
01850                   iLine,
01851                   lpLineInfo->dwAPIVersion,
01852                   0,
01853                   lpDevCaps
01854                  );
01855     if ( errCode )
01856     {
01857       GetLineInfoFailed( iLine, lpDevCaps, lpLineInfo );
01858       goto error;
01859     }
01860
01861     if ( lpDevCaps-> dwNeededSize <= lpDevCaps-> dwTotalSize )
01862     {
01863       break;
01864     }
01865
01866     dwNeededSize = lpDevCaps->dwNeededSize;
01867     DialerFree( lpDevCaps );
01868     lpDevCaps = NULL;
01869
01870   } while ( TRUE );
01871
01872
01873   lpLineInfo->nAddr = lpDevCaps->dwNumAddresses;
01874   lpLineInfo->fVoiceLine =
01875     ( (lpDevCaps->dwMediaModes & LINEMEDIAMODE_INTERACTIVEVOICE) != 0 );
01876
01877   pszLineName = (LPSTR) DialerAlloc( MAXBUFSIZE );
01878   if ( !pszLineName )
01879   {
01880     errCode = LINEERR_NOMEM;
01881     goto error;
01882   }
01883   if ( lpDevCaps->dwLineNameSize > 0 )
01884   {
01885     strncpy (
01886          pszLineName,
01887          (LPSTR) lpDevCaps + lpDevCaps->dwLineNameOffset,
01888          MAXBUFSIZE - 1
01889         );
01890
01891     pszLineName[ MAXBUFSIZE - 1 ] = '\0';
01892
01893   }
01894   else
01895   {
01896     wsprintf ( pszLineName, "Line %d", iLine );
01897   }
01898
01899   strncpy( lpLineInfo->szLineName, pszLineName,MAXBUFSIZE - 1 );
01900   lpLineInfo->szLineName[ MAXBUFSIZE - 1 ] = '\0';
01901   lpLineInfo->dwPermanentLineID = lpDevCaps->dwPermanentLineID;
01902
01903
01904 error:
01905   if ( lpDevCaps )
01906     DialerFree( lpDevCaps );
01907
01908   if ( pszLineName )
01909     DialerFree( pszLineName );
01910
01911   return errCode;
01912 }
01913
01914
01915
01916 //***************************************************************************
01917 //***************************************************************************
01918 //***************************************************************************
01919 VOID GetLineInfoFailed ( DWORD iLine, LPLINEDEVCAPS lpDevCaps, LPLINEINFO lpLineInfo )
01920 {
01921   if ( lpDevCaps )
01922     DialerFree(lpDevCaps);
01923
01924   lpLineInfo->nAddr = 0;
01925   lpLineInfo->fVoiceLine = FALSE;
01926   lpLineInfo->dwAPIVersion = 0;
01927   lpLineInfo->hLine = (HLINE)0;
01928   lpLineInfo->dwPermanentLineID = 0;
01929   lpLineInfo->szLineName[0] = 0;
01930 }
01931
01932
01933
01934 //***************************************************************************
01935 //***************************************************************************
01936 //***************************************************************************
01937 LPSTR GetAddressName(DWORD iLine, DWORD iAddress)
01938 {
01939   DWORD errCode = 0;
01940   DWORD dwNeededSize = 0;
01941   LPSTR pszAddressName = NULL;
01942   LPLINEADDRESSCAPS lpAddressCaps = NULL;
01943
01944   // allocate space for lineGetAddressCaps data
01945   dwNeededSize = sizeof( LINEADDRESSCAPS );
01946
01947   do
01948   {
01949     lpAddressCaps = ( LPLINEADDRESSCAPS )DialerAlloc( dwNeededSize );
01950     if ( !lpAddressCaps )
01951     {
01952       goto error;
01953     }
01954
01955     lpAddressCaps->dwTotalSize = dwNeededSize;
01956     errCode = lineGetAddressCaps (
01957                     ghLineApp,
01958                     iLine,
01959                     iAddress,
01960                     gCurrentLineInfo.dwAPIVersion,
01961                     0,
01962                     lpAddressCaps
01963                    );
01964     if ( errCode )
01965     {
01966       errString( ghWndMain, errCode, MB_ICONSTOP | MB_OK );
01967       goto error;
01968     }
01969
01970     if ( lpAddressCaps-> dwNeededSize <= lpAddressCaps-> dwTotalSize )
01971     {
01972       break;
01973     }
01974
01975     dwNeededSize = lpAddressCaps->dwNeededSize;
01976     DialerFree( lpAddressCaps );
01977     lpAddressCaps = NULL;
01978
01979   } while( TRUE );
01980
01981
01982   // get the address name
01983   pszAddressName = DialerAlloc( MAXBUFSIZE );
01984   if ( !pszAddressName )
01985   {
01986     goto error;
01987   }
01988
01989   if ( lpAddressCaps-> dwAddressSize > 0 )
01990   {
01991     // keep string length bounded
01992       strncpy(
01993           pszAddressName,
01994           (LPSTR) lpAddressCaps + lpAddressCaps->dwAddressOffset,
01995           MAXBUFSIZE - 1
01996            );
01997       pszAddressName[ MAXBUFSIZE - 1] = '\0';
01998
01999   }
02000   else
02001   // use default name
02002   {
02003     wsprintf(pszAddressName, "Address %d", iAddress);
02004   }
02005
02006 error:
02007   if ( lpAddressCaps )
02008   {
02009     DialerFree( lpAddressCaps );
02010   }
02011
02012   return pszAddressName;
02013 }
02014
02015
02016
02017 //***************************************************************************
02018 //***************************************************************************
02019 //***************************************************************************
02020 BOOL CALLBACK DialingProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
02021 {
02022
02023   switch(msg)
02024   {
02025     char szTemp[ TAPIMAXCALLEDPARTYSIZE ];
02026
02027     case WM_INITDIALOG:
02028       // set global handle to window
02029       ghWndDialing = hwnd;
02030
02031       AmpersandCompensate( gszCurrentName, szTemp );
02032
02033       SetDlgItemText(hwnd, IDD_DGNUMBERTEXT, gszCurrentNumber);
02034       SetDlgItemText(hwnd, IDD_DGNAMETEXT, szTemp );
02035       break;
02036
02037     case WM_COMMAND:
02038       switch ( LOWORD( (DWORD)wParam ) )
02039       {
02040         // hang up
02041         case IDCANCEL:
02042           //gfDropping = TRUE;
02043
02044           // if lineMakeCall has completed
02045           // only then drop call.
02046           if ( !gfMakeCallReplyPending && ghCall )
02047           {
02048             if ( ( gDropCallRequestID = lineDrop ( ghCall, NULL, 0 ) ) < 0 )
02049             {
02050               errString ( ghWndDialing, gDropCallRequestID, MB_ICONSTOP | MB_OK );
02051             }
02052           }
02053           else
02054           {
02055             DialerLineClose();
02056             gfCurrentLineAvail = TRUE;
02057             gfMakeCallReplyPending = FALSE;
02058           }
02059
02060           ghWndDialing = NULL;
02061           EndDialog(hwnd, FALSE);
02062
02063           return TRUE;
02064
02065
02066         // something else terminated the call
02067         // all we have to do is terminate this dialog box
02068         case IDOK:
02069           ghWndDialing = NULL;
02070           EndDialog(hwnd, TRUE);
02071
02072           return TRUE;
02073       }
02074       break;
02075
02076     default:
02077       ;
02078   }
02079   return FALSE;
02080 }
02081
02082
02083
02084 //***************************************************************************
02085 //***************************************************************************
02086 //***************************************************************************
02087 BOOL CALLBACK AboutProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
02088 {
02089     switch(msg)
02090     {
02091         case WM_INITDIALOG:
02092         {
02093             return TRUE;
02094         }
02095
02096         case WM_CLOSE:
02097             EndDialog(hwnd, TRUE);
02098             return TRUE;
02099
02100         case WM_COMMAND:
02101             if(LOWORD((DWORD)wParam) == IDOK)
02102             {
02103                 EndDialog(hwnd, TRUE);
02104                 return TRUE;
02105             }
02106
02107             break;
02108     }
02109
02110     return FALSE;
02111
02112 }
02113
02114
02115
02116 //***************************************************************************
02117 //***************************************************************************
02118 //***************************************************************************
02119 BOOL CALLBACK ConnectUsingProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
02120 {
02121   switch(msg)
02122   {
02123     case WM_INITDIALOG:
02124     {
02125       BOOL fEnable;
02126       DWORD dwPriority;
02127
02128       //
02129       // Is there any point in even showing this dialog box?
02130       if ( gnAvailDevices == 0 )
02131       {
02132         // Nope.  Let's tell the user what we don't like.
02133         errString ( ghWndMain, ERR_NOLINES, MB_ICONEXCLAMATION | MB_OK );
02134
02135         EndDialog(hwnd, FALSE);
02136         return TRUE;
02137       }
02138
02139       // if not brought up by InitializeTAPI()
02140       if ( lParam != INVALID_LINE )
02141       {
02142         // hide error text
02143         EnableWindow( GetDlgItem( hwnd, IDD_CUERRORTEXT ), FALSE );
02144       }
02145
02146       // get list of lines into the line list box.
02147       fEnable = InitializeLineBox( GetDlgItem(hwnd, IDD_CULISTLINE) );
02148       EnableWindow( GetDlgItem( hwnd, IDD_CULISTLINE ), fEnable);
02149
02150       // get list of addresses into the address list box.
02151       fEnable = fEnable &&
02152             InitializeAddressBox (
02153                         GetDlgItem(hwnd, IDD_CULISTLINE),
02154                         GetDlgItem(hwnd, IDD_CULISTADDRESS)
02155                        );
02156       EnableWindow( GetDlgItem( hwnd, IDD_CULISTADDRESS ), fEnable );
02157       EnableWindow( GetDlgItem( hwnd, IDOK ), fEnable );
02158
02159       EnableWindow( GetDlgItem( hwnd, IDD_CUPROPERTIES ), fEnable );
02160
02161       lineGetAppPriority (
02162                 "DIALER.EXE",
02163                 0, // checking app priority for Assisted Telephony requests
02164                 NULL,
02165                 LINEREQUESTMODE_MAKECALL,
02166                 NULL,
02167                 &dwPriority
02168                  );
02169       CheckDlgButton(hwnd, IDD_CUSIMPLETAPICHKBOX, (dwPriority == 1));
02170
02171       // if dwPriority == 1, we're supporting Assisted Telephony AND
02172       // have the highest priority.
02173       EnableWindow (
02174               GetDlgItem(hwnd, IDD_CUSIMPLETAPICHKBOX),
02175               gfRegistered
02176              );
02177
02178       return FALSE;
02179     }
02180
02181     case WM_COMMAND:
02182     {
02183       switch ( LOWORD( (DWORD)wParam ) )
02184       {
02185         case IDD_CULISTLINE:
02186           if ( HIWORD( wParam ) == CBN_SELENDOK )
02187             // update address box
02188             InitializeAddressBox (
02189                         GetDlgItem(hwnd, IDD_CULISTLINE),
02190                         GetDlgItem(hwnd, IDD_CULISTADDRESS)
02191                        );
02192           break;
02193
02194         case IDD_CUPROPERTIES:
02195         {
02196           HWND hW = GetDlgItem(hwnd, IDD_CULISTLINE);
02197
02198           lineConfigDialog (
02199                     // device ID
02200                     (DWORD) SendMessage (
02201                                 hW,
02202                                 CB_GETITEMDATA,
02203                                 (WORD) SendMessage(hW, CB_GETCURSEL, 0, 0),
02204                                 0
02205                                 ),
02206                     hwnd,
02207                     NULL
02208                    );
02209           break;
02210         }
02211
02212         case IDOK:
02213         {
02214           HWND hwndBox;
02215           char szBuffer[MAXBUFSIZE];
02216           DWORD dwPriority;
02217
02218           // Update line
02219           hwndBox = GetDlgItem( hwnd, IDD_CULISTLINE );
02220           giCurrentLine = (DWORD)SendMessage (
02221                           hwndBox,
02222                           CB_GETITEMDATA,
02223                           SendMessage( hwndBox, CB_GETCURSEL, 0, 0 ),
02224                           0
02225                         );
02226
02227           // base 10
02228           itoa( gdwPLID[giCurrentLine], szBuffer, 10 );
02229           WritePrivateProfileString (
02230                         "Preference",
02231                         "Preferred Line",
02232                         szBuffer,
02233                         gszINIfilename
02234                         );
02235
02236
02237           // Update address
02238           hwndBox = GetDlgItem( hwnd, IDD_CULISTADDRESS );
02239           giCurrentAddress = (DWORD)SendMessage (
02240                           hwndBox,
02241                           CB_GETITEMDATA,
02242                           SendMessage(hwndBox, CB_GETCURSEL, 0, 0),
02243                           0
02244                            );
02245
02246           itoa( giCurrentAddress, szBuffer, 10 );
02247           WritePrivateProfileString (
02248                         "Preference",
02249                         "Preferred Address",
02250                         szBuffer,
02251                         gszINIfilename
02252                         );
02253
02254
02255           // Update application priority
02256           if ( SendDlgItemMessage (
02257                         hwnd,
02258                         IDD_CUSIMPLETAPICHKBOX,
02259                         BM_GETCHECK,
02260                         0,
02261                         0L
02262                       )
02263               == 0)
02264           {
02265             dwPriority = 0;
02266           }
02267           else
02268           {
02269             dwPriority = 1;
02270           }
02271
02272           lineSetAppPriority (
02273                     "DIALER.EXE",
02274                     0,
02275                     NULL,
02276                     LINEREQUESTMODE_MAKECALL,
02277                     NULL,
02278                     dwPriority
02279                      );
02280
02281           EndDialog(hwnd, TRUE);
02282           return TRUE;
02283         }
02284
02285         case IDCANCEL:
02286           EndDialog(hwnd, FALSE);
02287           return TRUE;
02288       }
02289     }
02290
02291     default:
02292         ;
02293
02294   }
02295
02296   return FALSE;
02297 }
02298
02299
02300
02301 //***************************************************************************
02302 //***************************************************************************
02303 //***************************************************************************
02304 BOOL CALLBACK LineInUseProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
02305     {
02306     LPARAM lNewParam = lParam;
02307     PTSTR  ptStr;
02308
02309
02310     switch(msg)
02311         {
02312         case WM_INITDIALOG:
02313             {
02314             switch(lParam)
02315                 {
02316                 case LINEDISCONNECTMODE_REJECT:
02317                     lNewParam = ikszDisconnectedReject;
02318                     break;
02319
02320                 case LINEDISCONNECTMODE_BUSY:
02321                     lNewParam = ikszDisconnectedBusy;
02322                     break;
02323
02324                 case LINEDISCONNECTMODE_NOANSWER:
02325                     lNewParam = ikszDisconnectedNoAnswer;
02326                     break;
02327
02328                 case LINEDISCONNECTMODE_CONGESTION:
02329                     lNewParam = ikszDisconnectedNetwork;
02330                     break;
02331
02332                 case LINEDISCONNECTMODE_INCOMPATIBLE:
02333                     lNewParam = ikszDisconnectedIncompatible;
02334                     break;
02335
02336                 case LINEDISCONNECTMODE_NODIALTONE:
02337                     lNewParam = ikszDisconnectedNoDialTone;
02338                     break;
02339
02340                 default:
02341                     lNewParam = ikszDisconnectedCantDo;
02342                     break;
02343                 }
02344             return TRUE;
02345             }
02346
02347         case WM_COMMAND:
02348             if(LOWORD((DWORD)wParam) == IDOK)
02349                 {
02350                 EndDialog(hwnd, TRUE);
02351                 return TRUE;
02352                 }
02353             break;
02354
02355         default:
02356               ;
02357 //            return DefDlgProc( hwnd, msg, wParam, lParam );
02358
02359         }
02360
02361
02362     if (ptStr = DialerAlloc( MAXBUFSIZE )) {
02363
02364       LoadString( ghInst, (UINT)lNewParam, ptStr, MAXBUFSIZE );
02365
02366       SetDlgItemText(
02367          hwnd,
02368           IDD_CFTEXT,
02369          ptStr
02370           );
02371
02372       DialerFree( ptStr );
02373     }
02374
02375
02376     return FALSE;
02377     }
02378
02379
02380
02381 //***************************************************************************
02382 //***************************************************************************
02383 //***************************************************************************
02384 BOOL CALLBACK SpeedDial1Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
02385 {
02386   static DWORD nCurrentSpeedDial;
02387
02388   // buffer to store speed dial names till they are saved.
02389   static TCHAR szSDName[NSPEEDDIALS + 1][TAPIMAXDESTADDRESSSIZE];
02390
02391   switch(msg)
02392   {
02393     case WM_INITDIALOG:
02394     {
02395       DWORD cSDEntry;
02396       DWORD idFirstEmpty = (DWORD) -1;
02397
02398       char szName[TAPIMAXCALLEDPARTYSIZE];
02399       char szTemp[TAPIMAXCALLEDPARTYSIZE];
02400       char szFieldName[MAXBUFSIZE];
02401
02402       // Retrieve speed dial info from INI file
02403       for(cSDEntry = 1; cSDEntry <= NSPEEDDIALS; ++cSDEntry)
02404       {
02405         wsprintf(szFieldName, "Name%d", cSDEntry);
02406         GetPrivateProfileString (
02407                       "Speed Dial Settings",
02408                       szFieldName,
02409                       gszNULL,
02410                       szSDName[ cSDEntry ],
02411                       TAPIMAXCALLEDPARTYSIZE - 1,
02412                       gszINIfilename
02413                     );
02414
02415         // set the first empty speed dial button
02416         if ( idFirstEmpty == -1 &&
02417            szSDName[ cSDEntry ][0] == '\0' &&
02418            gszSDNumber[ cSDEntry ][ 0 ] == '\0' )
02419           idFirstEmpty = cSDEntry;
02420
02421         wsprintf(szFieldName, "Number%d", cSDEntry);
02422         GetPrivateProfileString (
02423                       "Speed Dial Settings",
02424                       szFieldName,
02425                       gszNULL,
02426                       gszSDNumber[cSDEntry],
02427                       MAXBUFSIZE - 1,
02428                       gszINIfilename
02429                     );
02430
02431         // get a copy of the name for editing
02432         // if name is empty, use the number as the
02433         // name.
02434         if ( lstrcmp( gszNULL, szSDName[ cSDEntry ] ) )
02435         {
02436           strncpy( szName, szSDName[ cSDEntry], TAPIMAXCALLEDPARTYSIZE-1 );
02437         }
02438
02439         else
02440         {
02441           strncpy( szName, gszSDNumber[ cSDEntry ],TAPIMAXCALLEDPARTYSIZE-1 );
02442         }
02443         szName[TAPIMAXCALLEDPARTYSIZE-1] = '\0';
02444
02445         FitTextToButton( hwnd, IDD_SD1SPEEDDIAL1 + cSDEntry - 1, szName );
02446         AmpersandCompensate( szName, szTemp );
02447
02448         SetDlgItemText (
02449                 hwnd,
02450                 IDD_SD1SPEEDDIAL1 + cSDEntry - 1,
02451                 (LPCSTR) szTemp
02452                  );
02453
02454       }
02455
02456       // for the edit speed dial dialog
02457       // limit the lengths of text
02458       SendDlgItemMessage (
02459                 hwnd,
02460                 IDD_SD1EDITNAME,
02461                 EM_LIMITTEXT,
02462                 (WPARAM)(TAPIMAXCALLEDPARTYSIZE - 1),
02463                 0
02464                  );
02465
02466       SendDlgItemMessage (
02467                 hwnd,
02468                 IDD_SD1EDITNUMBER,
02469                 EM_LIMITTEXT,
02470                 (WPARAM)(TAPIMAXDESTADDRESSSIZE - 1),
02471                 0
02472                  );
02473
02474       // select the first empty button
02475       // nothing empty, then edit #1
02476       if ( -1 == idFirstEmpty )
02477       {
02478         nCurrentSpeedDial = 1;
02479         SetDlgItemText(
02480                 hwnd,
02481                 IDD_SD1EDITNAME,
02482                 (LPCSTR) szSDName[ 1 ]
02483                 );
02484
02485         SetDlgItemText(
02486                 hwnd,
02487                 IDD_SD1EDITNUMBER,
02488                 (LPCSTR) gszSDNumber[ 1 ]
02489                 );
02490       }
02491       else
02492       {
02493         nCurrentSpeedDial = idFirstEmpty;
02494       }
02495
02496       SetFocus( GetDlgItem( hwnd, IDD_SD1EDITNAME ) );
02497       return FALSE;
02498     }
02499
02500     case WM_COMMAND:
02501     {
02502       char szName[TAPIMAXCALLEDPARTYSIZE];
02503       char szTemp[ TAPIMAXCALLEDPARTYSIZE ];
02504
02505       switch( LOWORD( (DWORD) wParam ) )
02506       {
02507         case IDOK:
02508         {
02509           DWORD cSDEntry;
02510           char szFieldName[MAXBUFSIZE];
02511
02512           // save new speed dial settings
02513           for ( cSDEntry = 1; cSDEntry <= NSPEEDDIALS; ++cSDEntry )
02514           {
02515             wsprintf(szFieldName, "Name%d", cSDEntry);
02516             WritePrivateProfileString (
02517                           "Speed Dial Settings",
02518                           szFieldName,
02519                           szSDName [cSDEntry],
02520                           gszINIfilename
02521                           );
02522
02523             wsprintf(szFieldName, "Number%d", cSDEntry);
02524             WritePrivateProfileString (
02525                           "Speed Dial Settings",
02526                           szFieldName,
02527                           gszSDNumber[cSDEntry],
02528                           gszINIfilename
02529                           );
02530
02531             // set the text for the corresponding
02532             // main window button
02533             if ( szSDName[ cSDEntry ][ 0 ] == '\0' )
02534             {
02535               strncpy( szName, gszSDNumber[ cSDEntry ],TAPIMAXCALLEDPARTYSIZE-1);
02536             }
02537             else
02538             {
02539               strncpy( szName, szSDName[ cSDEntry ],TAPIMAXCALLEDPARTYSIZE-1);
02540             }
02541             szName[TAPIMAXCALLEDPARTYSIZE-1] = '\0';
02542
02543             FitTextToButton(
02544                     ghWndMain,
02545                     IDD_DSPEEDDIAL1 + cSDEntry - 1,
02546                     szName
02547                      );
02548
02549             AmpersandCompensate( szName, szTemp );
02550             SetDlgItemText (
02551                     ghWndMain,
02552                     IDD_DSPEEDDIAL1 + cSDEntry - 1,
02553                     (LPCSTR) szTemp
02554                      );
02555           }
02556
02557           EndDialog(hwnd, TRUE);
02558           return TRUE;
02559         }
02560
02561         case IDCANCEL:
02562           EndDialog(hwnd, FALSE);
02563           return TRUE;
02564
02565         case IDD_SD1SPEEDDIAL1:
02566         case IDD_SD1SPEEDDIAL2:
02567         case IDD_SD1SPEEDDIAL3:
02568         case IDD_SD1SPEEDDIAL4:
02569         case IDD_SD1SPEEDDIAL5:
02570         case IDD_SD1SPEEDDIAL6:
02571         case IDD_SD1SPEEDDIAL7:
02572         case IDD_SD1SPEEDDIAL8:
02573
02574           nCurrentSpeedDial = LOWORD( (DWORD) wParam ) - IDD_SD1SPEEDDIAL1 + 1;
02575
02576           SetDlgItemText (
02577                   hwnd,
02578                   IDD_SD1EDITNAME,
02579                   szSDName [ nCurrentSpeedDial ]
02580                    );
02581           SetDlgItemText (
02582                   hwnd,
02583                   IDD_SD1EDITNUMBER,
02584                   gszSDNumber[nCurrentSpeedDial]
02585                    );
02586
02587           SetFocus( GetDlgItem( hwnd, IDD_SD1EDITNAME ) );
02588           SendDlgItemMessage(
02589                     hwnd,
02590                     IDD_SD1EDITNAME,
02591                     EM_SETSEL,
02592                     0,
02593                     MAKELPARAM(0, -1)
02594                   );
02595           break;
02596
02597         case IDD_SD1EDITNAME:
02598           if ( HIWORD( wParam ) == EN_CHANGE )
02599           {
02600
02601             GetDlgItemText (
02602                     hwnd,
02603                     IDD_SD1EDITNAME,
02604                     szName,
02605                     TAPIMAXCALLEDPARTYSIZE
02606                      );
02607
02608             // if there is no name, label the button with
02609             // the number
02610             if ( szName[ 0 ] == '\0' )
02611             {
02612               szSDName[ nCurrentSpeedDial ][ 0 ] = '\0';
02613               strncpy( szName, gszSDNumber[ nCurrentSpeedDial ],TAPIMAXCALLEDPARTYSIZE-1 );
02614               szName[TAPIMAXCALLEDPARTYSIZE-1] = '\0';
02615             }
02616             else
02617             {
02618               strncpy( szSDName[ nCurrentSpeedDial ], szName,TAPIMAXDESTADDRESSSIZE-1 );
02619               szSDName[ nCurrentSpeedDial ][TAPIMAXDESTADDRESSSIZE-1] = '\0';
02620             }
02621
02622             FitTextToButton (
02623                       hwnd,
02624                       IDD_SD1SPEEDDIAL1 + nCurrentSpeedDial - 1,
02625                       szName
02626                     );
02627             AmpersandCompensate( szName, szTemp );
02628
02629             SetDlgItemText (
02630                     hwnd,
02631                     IDD_SD1SPEEDDIAL1 + nCurrentSpeedDial - 1,
02632                     szTemp
02633                      );
02634           }
02635           break;
02636
02637         case IDD_SD1EDITNUMBER:
02638           if ( HIWORD( wParam ) == EN_CHANGE )
02639           {
02640             GetDlgItemText (
02641                     hwnd,
02642                     IDD_SD1EDITNUMBER,
02643                     gszSDNumber[nCurrentSpeedDial],
02644                     TAPIMAXDESTADDRESSSIZE
02645                      );
02646
02647             if ( gszSDNumber[ nCurrentSpeedDial ][ 0 ] == '\0' )
02648             {
02649               GetDlgItemText (
02650                       hwnd,
02651                       IDD_SD1EDITNAME,
02652                       szName,
02653                       TAPIMAXDESTADDRESSSIZE
02654                        );
02655
02656               if ( szName[ 0 ] == '\0' )
02657               {
02658                 SetDlgItemText (
02659                         hwnd,
02660                         IDD_SD1SPEEDDIAL1 + nCurrentSpeedDial - 1,
02661                         szName
02662                          );
02663
02664               }
02665             }
02666           }
02667           break;
02668         } // switch(LOWORD((DWORD)wParam))
02669       break;
02670
02671     } // case WM_COMMAND:
02672
02673     default:
02674         ;
02675
02676   } // switch(msg)
02677
02678   return FALSE;
02679 }
02680
02681
02682
02683 //***************************************************************************
02684 //***************************************************************************
02685 //***************************************************************************
02686 BOOL CALLBACK SpeedDial2Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
02687 {
02688   static DWORD nCurrentSpeedDial;
02689
02690   switch(msg)
02691   {
02692     case WM_INITDIALOG:
02693     {
02694       char szFieldName [MAXBUFSIZE];
02695       char szName [TAPIMAXCALLEDPARTYSIZE];
02696
02697       nCurrentSpeedDial = LOWORD( lParam ) - IDD_DSPEEDDIAL1 + 1;
02698
02699       // retrieve speed dial button info
02700       wsprintf(szFieldName, "Name%d", nCurrentSpeedDial);
02701       GetPrivateProfileString (
02702                     "Speed Dial Settings",
02703                     szFieldName,
02704                     gszNULL,
02705                     szName,
02706                     TAPIMAXCALLEDPARTYSIZE - 1,
02707                     gszINIfilename
02708                   );
02709       SetDlgItemText (
02710               hwnd,
02711               IDD_SD2EDITNAME,
02712               szName
02713                );
02714
02715       SetDlgItemText (
02716               hwnd,
02717               IDD_SD2EDITNUMBER,
02718               gszSDNumber[nCurrentSpeedDial]
02719                );
02720
02721       // limit the lengths of the texts
02722       SendDlgItemMessage (
02723                 hwnd,
02724                 IDD_SD2EDITNAME,
02725                 EM_LIMITTEXT,
02726                 (WPARAM)(TAPIMAXCALLEDPARTYSIZE - 1),
02727                 0
02728                  );
02729
02730       SendDlgItemMessage (
02731                 hwnd,
02732                 IDD_SD2EDITNUMBER,
02733                 EM_LIMITTEXT,
02734                 (WPARAM)(TAPIMAXDESTADDRESSSIZE - 1),
02735                 0
02736                  );
02737
02738
02739       SetFocus( GetDlgItem( hwnd, IDD_SD2EDITNAME ) );
02740       SendDlgItemMessage (
02741                 hwnd,
02742                 IDD_SD2EDITNAME,
02743                 EM_SETSEL,
02744                 0,
02745                 MAKELPARAM(0, -1)
02746                  );
02747
02748       return FALSE;
02749     }
02750
02751     case WM_COMMAND:
02752     {
02753       char szName[ TAPIMAXCALLEDPARTYSIZE ];
02754       char szTemp[ TAPIMAXCALLEDPARTYSIZE ];
02755       char szFieldName[MAXBUFSIZE];
02756
02757       switch ( LOWORD( (DWORD) wParam ) )
02758       {
02759         case IDOK:
02760         case IDD_SD2SAVEANDDIAL:
02761         {
02762           GetDlgItemText (
02763                   hwnd,
02764                   IDD_SD2EDITNAME,
02765                   (LPTSTR) szName,
02766                   TAPIMAXCALLEDPARTYSIZE
02767                    );
02768
02769           GetDlgItemText (
02770                   hwnd,
02771                   IDD_SD2EDITNUMBER,
02772                   (LPTSTR) gszSDNumber[nCurrentSpeedDial],
02773                   TAPIMAXCALLEDPARTYSIZE
02774                    );
02775
02776           wsprintf ( szFieldName, "Name%d", nCurrentSpeedDial );
02777
02778           WritePrivateProfileString (
02779                         "Speed Dial Settings",
02780                         szFieldName,
02781                         szName,
02782                         gszINIfilename
02783                         );
02784
02785           wsprintf ( szFieldName, "Number%d", nCurrentSpeedDial );
02786           WritePrivateProfileString (
02787                         "Speed Dial Settings",
02788                         szFieldName,
02789                         gszSDNumber[nCurrentSpeedDial],
02790                         gszINIfilename
02791                         );
02792
02793           // update main window buttons
02794           // is only number has been entered, label button with it.
02795           if ( szName[ 0 ] == '\0' )
02796           {
02797             strncpy( szName, gszSDNumber[ nCurrentSpeedDial ], TAPIMAXCALLEDPARTYSIZE-1);
02798             szName[TAPIMAXCALLEDPARTYSIZE-1] = '\0';
02799           }
02800
02801           FitTextToButton (
02802                     ghWndMain,
02803                     IDD_DSPEEDDIAL1 + nCurrentSpeedDial - 1,
02804                     (LPSTR) szName
02805                   );
02806
02807           AmpersandCompensate( szName, szTemp );
02808
02809           SetDlgItemText (
02810                   ghWndMain,
02811                   IDD_DSPEEDDIAL1 + nCurrentSpeedDial - 1,
02812                   (LPCSTR)szTemp
02813                    );
02814
02815           // if save and dial, then post dial message to main window
02816           if ( LOWORD( (DWORD) wParam ) == IDD_SD2SAVEANDDIAL )
02817           {
02818             PostMessage (
02819                     ghWndMain,
02820                     WM_COMMAND,
02821                     MAKEWPARAM (
02822                           nCurrentSpeedDial + IDD_DSPEEDDIAL1 - 1,
02823                           BN_CLICKED
02824                            ),
02825                     (LPARAM) GetDlgItem (
02826                                 ghWndMain,
02827                                 nCurrentSpeedDial + IDD_DSPEEDDIAL1 - 1
02828                               )
02829                   );
02830           }
02831           EndDialog(hwnd, TRUE);
02832           return TRUE;
02833         }
02834
02835         case IDCANCEL:
02836           EndDialog(hwnd, FALSE);
02837           return TRUE;
02838
02839         case IDD_SD2EDITNAME:
02840         case IDD_SD2EDITNUMBER:
02841           if ( HIWORD( wParam ) == EN_CHANGE)
02842           {
02843             EnableWindow (
02844                     GetDlgItem( hwnd, IDD_SD2SAVEANDDIAL ),
02845                     GetWindowTextLength ( GetDlgItem( hwnd, IDD_SD2EDITNUMBER ) ) > 0
02846                    );
02847           }
02848           break;
02849
02850       } // switch(LOWORD((DWORD)wParam))
02851       break;
02852     }
02853
02854
02855     default:
02856         ;
02857
02858   } // switch(msg)
02859
02860   return FALSE;
02861 }
02862
02863
02864
02865 //***************************************************************************
02866 //***************************************************************************
02867 //***************************************************************************
02868 VOID CALLBACK
02869 tapiCallback (
02870         DWORD   hDevice,
02871         DWORD   dwMsg,
02872         DWORD   dwCBInstance,
02873         DWORD   dwParam1,
02874         DWORD   dwParam2,
02875         DWORD   dwParam3
02876         )
02877 {
02878   switch (dwMsg)
02879   {
02880     INT errCode;
02881
02882     case LINE_ADDRESSSTATE:
02883       break;
02884
02885     case LINE_CALLINFO:
02886       break;
02887
02888     case LINE_CALLSTATE:
02889       if ( (HCALL)hDevice != ghCall )
02890         return;
02891
02892       switch ( dwParam1 ) // new state
02893       {
02894         case LINECALLSTATE_IDLE:
02895
02896           // tell "Dialing" window to terminate
02897           if ( ghWndDialing )
02898           {
02899             SendMessage (
02900                     ghWndDialing,
02901                     WM_COMMAND,
02902                     MAKEWPARAM( IDOK, 0 ),
02903                     0
02904                   );
02905           }
02906
02907           // tapi call cleanup
02908           if ( !gfMakeCallReplyPending && ghCall )
02909           {
02910             if ( ( errCode = lineDeallocateCall( ghCall ) ) < 0 )
02911             {
02912               errString ( ghWndMain, errCode, MB_ICONSTOP | MB_OK );
02913             }
02914             ghCall = (HCALL)((ULONG_PTR)NULL);
02915           }
02916           DialerLineClose();
02917           gfCurrentLineAvail = TRUE;
02918
02919           // update main window
02920           DisableDialButtons( FALSE );
02921           break;
02922
02923         case LINECALLSTATE_BUSY:
02924           tapiCallback (
02925                   hDevice,
02926                   dwMsg,
02927                   dwCBInstance,
02928                   LINECALLSTATE_DISCONNECTED,
02929                   LINEDISCONNECTMODE_BUSY,
02930                   dwParam3
02931                  );
02932           break;
02933
02934         case LINECALLSTATE_SPECIALINFO:
02935           tapiCallback (
02936                   hDevice,
02937                   dwMsg,
02938                   dwCBInstance,
02939                   LINECALLSTATE_DISCONNECTED,
02940                   LINEDISCONNECTMODE_UNREACHABLE,
02941                   dwParam3
02942                  );
02943           break;
02944
02945         case LINECALLSTATE_DISCONNECTED:
02946         {
02947           BOOL fCallOK;
02948           DWORD LineDisconnectMode;
02949
02950
02951           if ( dwParam2 == 0 )
02952             LineDisconnectMode = LINEDISCONNECTMODE_NORMAL;
02953           else
02954             LineDisconnectMode = dwParam2;
02955
02956           fCallOK = ( LineDisconnectMode == LINEDISCONNECTMODE_NORMAL   ||
02957                 LineDisconnectMode == LINEDISCONNECTMODE_UNKNOWN  ||
02958                 LineDisconnectMode == LINEDISCONNECTMODE_PICKUP   ||
02959                 LineDisconnectMode == LINEDISCONNECTMODE_FORWARDED  ||
02960                 LineDisconnectMode == LINEDISCONNECTMODE_UNAVAIL
02961                 );
02962
02963
02964           if ( !gfMakeCallReplyPending && ghCall )
02965           {
02966             //gfDropping = TRUE;
02967             if ( ( gDropCallRequestID = lineDrop ( ghCall, NULL, 0 ) ) < 0 )
02968             {
02969               errString ( ghWndMain, gDropCallRequestID, MB_ICONSTOP | MB_OK );
02970             }
02971           }
02972
02973           if ( !fCallOK )
02974             DialogBoxParam (
02975                     ghInst,
02976                     MAKEINTRESOURCE(IDD_CALLFAILED),
02977                     ghWndMain,
02978                     (DLGPROC)LineInUseProc,
02979                     LineDisconnectMode
02980                      );
02981           break;
02982         }
02983       }
02984       break;
02985
02986
02987     case LINE_CLOSE:
02988       if ( gCurrentLineInfo.hLine == (HLINE)hDevice )
02989       {
02990         errString(ghWndMain, ERR_LINECLOSE, MB_ICONEXCLAMATION | MB_OK );
02991         gCurrentLineInfo.hLine = (HLINE)((ULONG_PTR)NULL);
02992         gfCurrentLineAvail = FALSE;
02993         DisableDialButtons(FALSE);
02994       }
02995       break;
02996
02997     case LINE_CREATE:
02998       // dwParam1 is the new device's ID
02999       if ( dwParam1 >= gnAvailDevices )
03000       {
03001         DWORD* gnAddrTemp;
03002         DWORD iLine;
03003         LINEINFO LineInfo;
03004
03005         // we record new device's address count.
03006
03007                 // we are assuming here that we're just adding a new
03008                 // line and it's sequential and it's the last one
03009
03010                 gnAvailDevices = dwParam1 + 1;
03011
03012         if (!(gnAddrTemp = (DWORD *) DialerAlloc ( sizeof(DWORD) * (int)(gnAvailDevices))))
03013           break;
03014
03015         for ( iLine = 0; iLine < (gnAvailDevices-1); ++iLine )
03016           gnAddrTemp[iLine] = gnAddr[iLine];
03017
03018         DialerFree( gnAddr );
03019
03020         // we have effectively added one more
03021         // space in the gnAddr array
03022         gnAddr = gnAddrTemp;
03023
03024         if ( GetLineInfo( dwParam1, &LineInfo ) != ERR_NONE )
03025           break;
03026
03027         gnAddr[dwParam1] = LineInfo.nAddr;
03028       }
03029       break;
03030
03031     case LINE_DEVSPECIFIC:
03032       break;
03033
03034     case LINE_DEVSPECIFICFEATURE:
03035       break;
03036
03037     case LINE_GATHERDIGITS:
03038       break;
03039
03040     case LINE_GENERATE:
03041       break;
03042
03043     case LINE_LINEDEVSTATE:
03044       if ( dwParam1 & LINEDEVSTATE_REINIT )
03045       {
03046         if(dwParam2 != 0)
03047         {
03048           // this is another msg translated into REINIT
03049           tapiCallback( hDevice, dwParam2, dwCBInstance, dwParam3, 0, 0 );
03050         }
03051         else
03052         {
03053           // Re-initialize TAPI
03054           gfNeedToReinit = TRUE;
03055         }
03056       }
03057
03058       if ( dwParam1 & LINEDEVSTATE_REMOVED )
03059       {
03060         DialerLineClose();
03061         tapiCallback(hDevice, LINE_CLOSE, dwCBInstance, 0, 0, 0); // is this needed?
03062       }
03063       break;
03064
03065     case LINE_MONITORDIGITS:
03066       break;
03067
03068     case LINE_MONITORMEDIA:
03069       break;
03070
03071     case LINE_MONITORTONE:
03072       break;
03073
03074     // async reply from lineMakeCall() or lineDrop()
03075     case LINE_REPLY:
03076
03077       // reply for lineMakeCall
03078       if ( (LONG) dwParam1 == gMakeCallRequestID )
03079       {
03080         // error on make call
03081         if ( dwParam2 != ERR_NONE )
03082         {
03083           // Get rid of the Dialing Dialog box if it's up
03084           if ( ghWndDialing )
03085           {
03086              SendMessage(
03087                   ghWndDialing,
03088                   WM_COMMAND,
03089                   MAKEWPARAM(IDOK,0),
03090                   0
03091                   );
03092           }
03093
03094           if ( dwParam2 == LINEERR_CALLUNAVAIL )
03095           {
03096             DialogBoxParam (
03097                     ghInst,
03098                     MAKEINTRESOURCE(IDD_CALLFAILED),
03099                     ghWndMain,
03100                     (DLGPROC)LineInUseProc,
03101                     0
03102                      );
03103           }
03104           else
03105           {
03106             errString ( ghWndMain, dwParam2, MB_ICONEXCLAMATION | MB_OK );
03107           }
03108
03109           ghCall = (HCALL)((ULONG_PTR)NULL);
03110           DialerLineClose();
03111           gfCurrentLineAvail = TRUE;
03112         }
03113
03114         gfMakeCallReplyPending = FALSE;
03115       }
03116
03117       // reply from lineDrop()
03118       if ( (LONG) dwParam1 == gDropCallRequestID )
03119       {
03120         //gfDropping = FALSE;
03121
03122         // tell "Dialing" window to terminate
03123         if ( ghWndDialing )
03124         {
03125           SendMessage (
03126                   ghWndDialing,
03127                   WM_COMMAND,
03128                   MAKEWPARAM( IDOK,0 ),
03129                   0
03130                 );
03131         }
03132
03133         // tapi call cleanup
03134         if ( dwParam2 == ERR_NONE )
03135         {
03136           if ( !gfMakeCallReplyPending && ghCall )
03137           {
03138             if ( ( errCode = lineDeallocateCall( ghCall ) ) < 0 )
03139             {
03140               errString ( ghWndMain, errCode, MB_ICONSTOP | MB_OK );
03141             }
03142             ghCall = (HCALL)((ULONG_PTR)NULL);
03143           }
03144         }
03145         DialerLineClose ();
03146         gfCurrentLineAvail = TRUE;
03147       }
03148
03149       break;
03150
03151     case LINE_REQUEST:
03152       // Simple TAPI request
03153       if ( dwParam1 == LINEREQUESTMODE_MAKECALL )
03154       {
03155         gfCallRequest = TRUE;
03156       }
03157       break;
03158   }
03159 }
03160
03161
03162
03163 //***************************************************************************
03164 //***************************************************************************
03165 //***************************************************************************
03166 BOOL InitializeLineBox(HWND hwndLineBox)
03167 {
03168
03169   DWORD iLine, iItem, iItemCurrent = (DWORD)-1;
03170   DWORD errCode;
03171
03172   LPLINEINFO lpLineInfo = NULL;
03173
03174   // allocate buffer for storing LINEINFO for all of
03175   // the available lines.  Always allocate space for
03176   // at least one line
03177   if ( gnAvailDevices == 0 )
03178   {
03179     lpLineInfo = (LPLINEINFO) DialerAlloc( sizeof(LINEINFO) );
03180   }
03181   else
03182   {
03183     lpLineInfo = (LPLINEINFO) DialerAlloc ( sizeof(LINEINFO) * (int)gnAvailDevices );
03184   }
03185
03186   // if no space was set aside...
03187   if ( lpLineInfo == NULL )
03188     return LINEERR_NOMEM;
03189
03190   // fill lpLineInfo[] and open each line
03191   for ( iLine = 0; iLine < gnAvailDevices; ++iLine )
03192   {
03193     // skip remaining processing for this line if it didn't open
03194     if ( GetLineInfo( iLine, &lpLineInfo[iLine] ) != ERR_NONE )
03195     {
03196       continue;
03197     }
03198
03199     iItem = (DWORD)SendMessage (
03200                 hwndLineBox,
03201                 CB_ADDSTRING,
03202                 0,
03203                 (LPARAM)(LPCSTR)(lpLineInfo[iLine].szLineName)
03204               );
03205
03206     // error, bail out.
03207     if ( iItem == CB_ERR || iItem == CB_ERRSPACE )
03208     {
03209             if (lpLineInfo)
03210             {
03211                 DialerFree(lpLineInfo);
03212             }
03213
03214       return FALSE;
03215     }
03216
03217     errCode = (DWORD)SendMessage (
03218                 hwndLineBox,
03219                 CB_SETITEMDATA,
03220                 (WPARAM)iItem,
03221                 (LPARAM)iLine
03222                 );
03223
03224     if ( iLine == giCurrentLine )
03225     {
03226       iItemCurrent = iItem;
03227     }
03228     else if ( iItemCurrent != -1 && iItem <= iItemCurrent )
03229     {
03230       // if the item we are putting is before the
03231       // "current" item, we must increment iItemCurrent
03232       // to reflect that something is being placed before
03233       // it, due to sorting
03234       ++iItemCurrent;
03235     }
03236   }
03237
03238   if ( iItemCurrent == (DWORD)-1 )
03239     iItemCurrent = 0;
03240
03241   if ( SendMessage( hwndLineBox, CB_GETCOUNT, 0, 0) != 0 )
03242   {
03243     SendMessage( hwndLineBox, CB_SETCURSEL, (WPARAM)iItemCurrent, 0 );
03244     return TRUE;
03245   }
03246
03247     DialerFree(lpLineInfo);
03248   return FALSE;
03249 }
03250
03251
03252
03253 //***************************************************************************
03254 //***************************************************************************
03255 //***************************************************************************
03256 BOOL InitializeAddressBox( HWND hwndLineBox, HWND hwndAddressBox )
03257 {
03258   DWORD errCode;
03259   DWORD iAddress, iItem, iItemCurrent = (DWORD)-1;
03260   DWORD iLineBoxCurrent;
03261   LPSTR pszAddressName;
03262
03263   if ( SendMessage( hwndLineBox, CB_GETCOUNT, 0, 0 ) == 0 )
03264   {
03265     return FALSE;
03266   }
03267
03268   // select current entry in line box
03269   iLineBoxCurrent = (DWORD)SendMessage (
03270                   hwndLineBox,
03271                   CB_GETITEMDATA,
03272                   SendMessage( hwndLineBox, CB_GETCURSEL, 0, 0 ),
03273                   0
03274                   );
03275   // empty address list box
03276   SendMessage ( hwndAddressBox, CB_RESETCONTENT, 0, 0);
03277
03278   // get all the address for this line
03279   for ( iAddress = 0; iAddress < gnAddr[iLineBoxCurrent]; ++iAddress )
03280   {
03281     pszAddressName = GetAddressName( iLineBoxCurrent, iAddress );
03282
03283     // if this address if fails, try the next one
03284     if ( !pszAddressName )
03285       continue;
03286
03287     iItem = (DWORD)SendMessage (
03288                 hwndAddressBox,
03289                 CB_ADDSTRING,
03290                 0,
03291                 (LPARAM) (LPCSTR) (pszAddressName)
03292               );
03293
03294     // error, bail out
03295     if ( iItem == CB_ERR || iItem == CB_ERRSPACE )
03296       return FALSE;
03297
03298     errCode = (DWORD)SendMessage (
03299                 hwndAddressBox,
03300                 CB_SETITEMDATA,
03301                 (WPARAM) iItem,
03302                 (LPARAM) iAddress
03303                 );
03304
03305     if ( iLineBoxCurrent == giCurrentLine )
03306     {
03307       if(iAddress == giCurrentAddress)
03308       {
03309         iItemCurrent = iItem;
03310       }
03311       else
03312       {
03313         // if the item we are putting is before the
03314         // "current" item, we must increment iItemCur
03315         // to reflect that something is being placed
03316         // before it, due to sorting
03317         if ( iItemCurrent != -1 && iItem <= iItemCurrent )
03318         {
03319           ++iItemCurrent;
03320         }
03321       }
03322     }
03323
03324     DialerFree( pszAddressName );
03325   }
03326
03327   if ( iLineBoxCurrent != giCurrentLine )
03328   {
03329     // if we're not looking at the current line
03330     // then highlight address 0
03331     iItemCurrent = 0;
03332   }
03333
03334   SendMessage (
03335           hwndAddressBox,
03336           CB_SETCURSEL,
03337           iItemCurrent,
03338           0
03339         );
03340   return TRUE;
03341 }
03342
03343
03344
03345 //***************************************************************************
03346 //***************************************************************************
03347 //***************************************************************************
03348 VOID ManageAssistedTelephony(VOID)
03349 {
03350   DWORD errCode;
03351   LPLINEREQMAKECALL lpRequestBuffer;
03352
03353   lpRequestBuffer = (LPLINEREQMAKECALL) DialerAlloc( sizeof( LINEREQMAKECALL ) );
03354   if ( !lpRequestBuffer )
03355   {
03356     goto error;
03357   }
03358
03359     // bring window to front
03360     SetForegroundWindow(ghWndMain);
03361
03362   // get next queued request.
03363   errCode = lineGetRequest (
03364                 ghLineApp,
03365                 LINEREQUESTMODE_MAKECALL,
03366                 lpRequestBuffer
03367
03368                );
03369   if ( errCode )
03370   {
03371     // if no more call requests pending, reset flag.
03372     if ( errCode == LINEERR_NOREQUEST )
03373     {
03374       gfCallRequest = FALSE;
03375     }
03376     else
03377     {
03378       errString ( ghWndMain, errCode, MB_ICONEXCLAMATION | MB_OK );
03379     }
03380     goto error;
03381   }
03382
03383
03384   // if a line has not been selected
03385   if ( giCurrentLine == (DWORD)-1 )
03386   {
03387     if (!DialogBoxParam (
03388             ghInst,
03389             MAKEINTRESOURCE(IDD_CONNECTUSING),
03390             ghWndMain,
03391             (DLGPROC) ConnectUsingProc,
03392             INVALID_LINE
03393             ))
03394         {
03395             // failed to get a line
03396             goto error;
03397         }
03398   }
03399
03400   // make the reuested call.
03401   InitiateCall (
03402           lpRequestBuffer->szDestAddress,
03403           lpRequestBuffer->szCalledParty
03404          );
03405
03406 error :
03407   if ( lpRequestBuffer )
03408   {
03409     DialerFree( lpRequestBuffer );
03410   }
03411   return;
03412 }
03413
03414
03415
03416 //***************************************************************************
03417 //***************************************************************************
03418 //***************************************************************************
03419 VOID DialerLineClose()
03420 {
03421   DWORD errCode;
03422
03423   if ( gCurrentLineInfo.hLine )
03424   {
03425     if ( errCode = lineClose ( gCurrentLineInfo.hLine ) )
03426     {
03427       errString ( ghWndMain, errCode, MB_ICONSTOP | MB_OK );
03428     }
03429     gCurrentLineInfo.hLine = (HLINE)((ULONG_PTR)NULL);
03430   }
03431
03432
03433   // re-initialize TAPI if it needs to be re-initialized
03434   if ( gfNeedToReinit )
03435   {
03436     CloseTAPI();
03437
03438     errCode = InitializeTAPI();
03439     if(errCode)
03440     {
03441       errString(ghWndMain, errCode, MB_APPLMODAL | MB_ICONEXCLAMATION );
03442       DialerCleanup(); // terminate program if we can't init
03443       return;
03444     }
03445
03446     errCode = lineRegisterRequestRecipient (
03447                         ghLineApp,
03448                         0,
03449                         LINEREQUESTMODE_MAKECALL,
03450                         TRUE
03451                          );
03452     if (errCode)
03453     {
03454       errString(ghWndMain, errCode, MB_ICONEXCLAMATION | MB_OK );
03455     }
03456
03457     gfNeedToReinit = FALSE;
03458   }
03459 }
03460
03461
03462
03463 //***************************************************************************
03464 //***************************************************************************
03465 //***************************************************************************
03466 int errString( HWND hWndOwner, UINT errCode, UINT uFlags )
03467 {
03468   PTSTR ptStrTitle;
03469   PTSTR ptStrError;
03470   int   nResult;
03471     BOOL  bDefault = FALSE;
03472
03473   ptStrTitle = DialerAlloc( MAXBUFSIZE );
03474   if ( NULL == ptStrTitle )
03475   {
03476      // Now, _this_ is a problem.
03477      return 0;
03478   }
03479
03480   ptStrError = DialerAlloc( MAXBUFSIZE );
03481   if ( NULL == ptStrError )
03482   {
03483      // Now, _this_ is a problem.
03484      DialerFree( ptStrTitle);
03485      return 0;
03486   }
03487
03488   switch(errCode)
03489   {
03490     case ERR_NOLINES:
03491       errCode = ikszErrNoVoiceLine;
03492       break;
03493
03494     case ERR_NOVOICELINE:
03495       errCode = ikszErrNoVoiceLine;
03496       break;
03497
03498     case ERR_LINECLOSE:
03499       errCode = ikszErrLineClose;
03500       break;
03501
03502     case ERR_911WARN:
03503       errCode = ikszWarningFor911;
03504       break;
03505
03506     case ERR_NEWDEFAULT:
03507       errCode = ikszWarningNewDefault;
03508       break;
03509
03510     case LINEERR_NODRIVER:
03511       errCode = ikszErrLineInitNoDriver;
03512       break;
03513
03514     case LINEERR_NODEVICE:
03515       errCode = ikszErrLineInitNoDevice;
03516       break;
03517
03518     case LINEERR_INIFILECORRUPT:
03519       errCode = ikszErrLineInitBadIniFile ;
03520       break;
03521
03522     case LINEERR_NOMEM:
03523       errCode = ikszErrOOM;
03524       break;
03525
03526     case LINEERR_INCOMPATIBLEAPIVERSION:
03527       errCode = ikszErrLineInitWrongDrivers ;
03528       break;
03529
03530     case LINEERR_OPERATIONFAILED:
03531       errCode = ikszErrTAPI;
03532       break;
03533
03534     case LINEERR_INVALADDRESS:
03535       errCode = ikszErrInvalAddress;
03536       break;
03537
03538     case LINEERR_ADDRESSBLOCKED:
03539       errCode = ikszErrAddrBlocked;
03540       break;
03541
03542     case LINEERR_BILLINGREJECTED:
03543       errCode = ikszErrBillingRejected;
03544       break;
03545
03546     case LINEERR_RESOURCEUNAVAIL:
03547     case LINEERR_ALLOCATED:
03548     case LINEERR_INUSE:
03549       errCode = ikszErrResUnavail;
03550       break;
03551
03552     case LINEERR_NOMULTIPLEINSTANCE:
03553       errCode = ikszErrNoMultipleInstance;
03554       break;
03555
03556     case LINEERR_INVALCALLSTATE:
03557       errCode = ikszErrInvalCallState;
03558       break;
03559
03560         case LINEERR_INVALCOUNTRYCODE:
03561             errCode = ikszErrInvalidCountryCode;
03562             break;
03563
03564     default:
03565             bDefault = TRUE;
03566             break;
03567
03568   }
03569
03570
03571     if (bDefault)
03572     {
03573         // if using default error, get TAPI's
03574         // error message from FormatError()
03575         if (!FormatMessage(FORMAT_MESSAGE_FROM_HMODULE,
03576                            (LPCVOID)GetModuleHandle(TEXT("TAPI32.DLL")),
03577                            (DWORD)TAPIERROR_FORMATMESSAGE(errCode),
03578                            0,
03579                            (LPTSTR)ptStrError,
03580                            MAXBUFSIZE,
03581                            NULL))
03582         {
03583             // if this fails, fall back on default
03584             LoadString( ghInst, ikszErrDefault, ptStrError, MAXBUFSIZE);
03585         }
03586
03587     }
03588     else    // not the default error message
03589     {
03590
03591         if ( 0 == LoadString( ghInst, errCode, ptStrError, MAXBUFSIZE ) )
03592         {
03593 #if DBG
03594             TCHAR buf[200];
03595             wsprintf( buf, "Cannot load string: hinst:0x%p errcode: %ld", ghInst,(DWORD)errCode);
03596             OutputDebugString( buf );
03597             MessageBox( NULL, buf, "Dialer", MB_OK);
03598 #endif
03599
03600             LoadString( ghInst, ikszErrDefault, ptStrError, MAXBUFSIZE );
03601         }
03602     }
03603
03604     LoadString( ghInst, ikszWarningTitle, ptStrTitle, MAXBUFSIZE );
03605
03606   nResult = MessageBox( hWndOwner, ptStrError, ptStrTitle, uFlags );
03607
03608
03609   DialerFree( ptStrTitle );
03610   DialerFree( ptStrError );
03611
03612
03613   return nResult;
03614 }
03615
03616
03617 /*
03618  *  Name :
03619  *    FitTextToButton
03620  *
03621  *  Arguements :
03622  *    hDlg    handle for the dialog in which this button is embedded
03623  *    nButtonID   button id of this button
03624  *    szName    Name to fit on the button. Max size TAPIMAXCALLEDPARTYSIZE
03625  *
03626  *  Return :
03627  *    None
03628  *
03629  *  Comments :
03630  *    Function first checks to see if the button text specified fits in the
03631  *    button.  If it does not it truncates it appropriately and adds trailing
03632  *    ellipses.
03633  */
03634 VOID FitTextToButton ( HWND hDlg, INT nButtonID, LPSTR szName )
03635 {
03636
03637   HDC hDC = 0;
03638   HFONT hFont = 0, hOldFont = 0;
03639   HWND hWnd = 0;
03640
03641   do
03642   {
03643     // calculate number of chars. that can fit on
03644     // the button
03645     int nLen;
03646     RECT rect;
03647     SIZE size;
03648     POINT pt;
03649     char buf [TAPIMAXCALLEDPARTYSIZE + 1];
03650
03651     // get button dimensions
03652     hWnd = GetDlgItem( hDlg, nButtonID );
03653     if ( hWnd == NULL )
03654       break;
03655
03656     if ( !GetClientRect( hWnd, &rect ) )
03657       break;
03658
03659     // get character dimensions
03660     hDC = GetDC( hWnd );
03661     if ( hDC == NULL )
03662       break;
03663
03664     hFont = (HFONT) SendMessage( hWnd, WM_GETFONT, 0, 0 );
03665     if ( hFont == NULL )
03666       hOldFont = SelectObject( hDC, GetStockObject( SYSTEM_FONT ) );
03667     else
03668       hOldFont = SelectObject( hDC, hFont );
03669
03670     // add an extra char at the end to compensate for
03671     // leading space,
03672     strncpy ( buf, szName, TAPIMAXCALLEDPARTYSIZE );
03673     buf[TAPIMAXCALLEDPARTYSIZE] = '\0';
03674     nLen = lstrlen( buf );
03675     buf [ nLen ] = 'X';
03676     buf [ nLen + 1 ] = '\0';
03677
03678     if ( !GetTextExtentPoint32( hDC, buf, nLen + 1, &size ) )
03679       break;
03680
03681     pt.x = size.cx;
03682     if ( !LPtoDP( hDC, &pt, 1 ) )
03683       break;
03684
03685     // check if name fits on button
03686     if (  pt.x > rect.right )
03687     {
03688       // find how much of the name fits
03689       int i = 0;
03690
03691       nLen = lstrlen( szName );
03692       for ( i = 0; i < nLen; i++ )
03693       {
03694         buf[ i ] = szName[ i ];
03695         // an extra char is stuffed to compensate for the
03696         // leading space left by the left alignment
03697         buf [ i + 1 ] = 'X';
03698         buf [ i + 2 ] = '\0';
03699
03700         // break out in cases of error condition
03701         if ( !GetTextExtentPoint32( hDC, buf, i + 2, &size ) )
03702         {
03703           i = nLen;
03704           break;
03705         }
03706
03707         pt.x = size.cx;
03708         if ( !LPtoDP( hDC, &pt, 1 ) )
03709         {
03710           i = nLen;
03711           break;
03712         }
03713
03714         if ( pt.x > rect.right )
03715           break;
03716       }
03717
03718             // error
03719       if ( i >= nLen )
03720         break;
03721
03722       // name is too long. truncate and add ellipses
03723       if (nLen > 3)
03724       {
03725         szName [i - 3] = '\0';
03726         strncat( szName, "...", 3);
03727       }
03728
03729
03730
03731
03732
03733     }
03734
03735
03736   } while( FALSE );
03737
03738   if ( hDC )
03739   {
03740     SelectObject( hDC, hOldFont );
03741     ReleaseDC( hWnd, hDC );
03742   }
03743
03744   return;
03745 }
03746
03747
03748
03749 /*
03750  *  Name :
03751  *    Is911
03752  *
03753  *  Arguements :
03754  *    lpTransOut -    Translated address contained the dialable string
03755  *
03756  *  Returns
03757  *    TRUE -        If number to be dialed (in the US) is prefixed by 911
03758  *    FALSE -       Otherwise
03759  *
03760  * Comments
03761  *
03762  */
03763 BOOL Is911 ( LPLINETRANSLATEOUTPUT lpTransOut )
03764 {
03765
03766   DWORD i = 0, j = 0;
03767   LPSTR lpDialDigits = (LPSTR)lpTransOut + lpTransOut-> dwDialableStringOffset;
03768   char sz3Pref [ 4 ] = "";
03769
03770
03771   // if this is not the US
03772   if ( lpTransOut-> dwCurrentCountry != 1 )
03773     return FALSE;
03774
03775   // skip non digit characters and extract
03776   // the first 3 digits in the dialable number
03777   for ( i = 0, j = 0; i < lpTransOut-> dwDialableStringSize ; i++ )
03778   {
03779     if ( ISDIGIT( lpDialDigits[i] ) )
03780     {
03781       sz3Pref[ j++ ] = lpDialDigits [ i ];
03782       sz3Pref[ j ] = '\0';
03783       if ( j == 3 )
03784         break;
03785     }
03786   }
03787
03788   if ( !lstrcmp( sz3Pref, "911" ) )
03789   {
03790     return TRUE;
03791   }
03792
03793   return FALSE;
03794 }
03795
03796
03797 /*
03798  *  Name :
03799  *    MakeCanonicalNumber
03800  *
03801  *  Arguements :
03802  *    szNumber    Number to convert into canonical form. Max size TAPIMAXDESTADDRESSSIZE
03803  *    szCanNumber   Canonical representation of number specified in szNumber
03804  *
03805  *  Return :
03806  *    TRUE      If the conversion was successful.
03807  *    FALSE     otherwise
03808  *
03809  *  Comments :
03810  *    Function first checks if given number is already in canonical form.
03811  *    If it is, it returns.  If it is not, then it performs the conversion.
03812  */
03813
03814 BOOL MakeCanonicalNumber ( LPCSTR szNumber, LPSTR szCanNumber )
03815 {
03816   char szDigits [ TAPIMAXDESTADDRESSSIZE ];
03817   char szPref [ TAPIMAXDESTADDRESSSIZE ];
03818
03819   BOOL bRes = FALSE;
03820
03821   INT errCode = -1;
03822   INT nLenPref, nLenDigits, cPos, i;
03823
03824   DWORD dwSize = 0;
03825   DWORD dwInd = 0;
03826
03827   LPLINETRANSLATEOUTPUT lpTransOut = NULL;
03828   LPLINETRANSLATECAPS lpTransCaps = NULL;
03829
03830
03831   dwSize = sizeof ( LINETRANSLATEOUTPUT );
03832   do
03833   {
03834     lpTransOut = ( LPLINETRANSLATEOUTPUT ) DialerAlloc ( dwSize );
03835     if ( !lpTransOut )
03836     {
03837       errString( ghWndMain, LINEERR_NOMEM, MB_ICONSTOP | MB_OK );
03838       goto error;
03839     }
03840
03841     lpTransOut-> dwTotalSize = dwSize;
03842     errCode = lineTranslateAddress (
03843                       ghLineApp,
03844                       giCurrentLine,
03845                       gCurrentLineInfo.dwAPIVersion,
03846                       szNumber,
03847                       0,
03848                       0,
03849                       lpTransOut
03850                      );
03851     if ( errCode )
03852     {
03853       goto error;
03854     }
03855
03856     if ( lpTransOut-> dwNeededSize <= lpTransOut-> dwTotalSize )
03857       break;
03858
03859     dwSize = lpTransOut-> dwNeededSize;
03860     DialerFree( lpTransOut );
03861
03862   } while( TRUE );
03863
03864
03865   // check if input number is already in
03866   // canonical form.
03867   if ( lpTransOut-> dwTranslateResults & LINETRANSLATERESULT_CANONICAL )
03868     goto error;
03869
03870   // ensure country is the USA.
03871   if ( lpTransOut-> dwCurrentCountry != 1 )
03872     goto error;
03873
03874
03875   // Extract the digits from given string
03876   // allowed formatting characters that are ignored are
03877   // space, (, ), -, .
03878   // presence of other characters will render the string invalid.
03879
03880   // find the prefix of the address upto the | mark.
03881   // the rest of the string can be ignored
03882   nLenPref = (int) strcspn ( szNumber, "|" );
03883   strncpy( szPref, szNumber, nLenPref );
03884   szPref[ nLenPref ] = '\0';
03885
03886   // if string is not composed entirely of digits
03887   // and allowable formating characters, quit conversion
03888   if ( strspn( szPref, " 0123456789()-." ) != (size_t) nLenPref )
03889     goto error;
03890
03891   // collect digits ignoring formating characters.
03892   szDigits[ 0 ] = '\0';
03893   for ( i = 0, nLenDigits = 0; i < nLenPref; i++ )
03894   {
03895     if ( ISDIGIT( szNumber[ i ] ) )
03896     {
03897       szDigits[ nLenDigits++ ] = szNumber[ i ];
03898     }
03899   }
03900   szDigits[ nLenDigits ] = '\0';
03901
03902   // if "internal" number
03903   if ( nLenDigits < LOCAL_NUMBER )
03904     goto error;
03905
03906   switch ( nLenDigits )
03907   {
03908     // Local number ( 7 digits) preceeded by a 0/1
03909     // Strip leading 0/1 and treat as a local number
03910     case EXTENDED_LOCAL_NUMBER:
03911       if ( szDigits[ 0 ] == '0' || szDigits[ 0 ] == '1' )
03912       {
03913         nLenDigits--;
03914         memmove( szDigits, &(szDigits[1]), nLenDigits );
03915         szDigits[ nLenDigits ] = '\0';
03916
03917         cPos = (int) strcspn( szPref, "01" );
03918         nLenPref--;
03919         memmove( &(szPref[ cPos ]), &(szPref[ cPos + 1 ]), nLenPref - cPos );
03920         szPref[ nLenPref ] = '\0';
03921       }
03922       else
03923       {
03924         goto error;
03925       }
03926
03927     case LOCAL_NUMBER :
03928     {
03929       LPLINELOCATIONENTRY lpLocLst;
03930
03931       // if leading digit is 0 or 1, it is
03932       // illegal in the US
03933       if ( szDigits[ 0 ] == '0' || szDigits[ 0 ] == '1' )
03934       {
03935         goto error;
03936       }
03937
03938       // get area code nformation for local number
03939       dwSize = sizeof( LINETRANSLATECAPS );
03940       do
03941       {
03942         lpTransCaps = (LPLINETRANSLATECAPS) DialerAlloc( dwSize );
03943         if ( !lpTransCaps )
03944         {
03945           errString( ghWndMain, LINEERR_NOMEM, MB_ICONSTOP | MB_OK );
03946           goto error;
03947         }
03948
03949         lpTransCaps-> dwTotalSize = dwSize;
03950         errCode = lineGetTranslateCaps (
03951                         ghLineApp,
03952                         gCurrentLineInfo.dwAPIVersion,
03953                         lpTransCaps
03954                          );
03955         if ( errCode )
03956         {
03957           errString( ghWndMain, errCode, MB_ICONSTOP | MB_OK );
03958           goto error;
03959         }
03960
03961         if ( lpTransCaps-> dwNeededSize <= lpTransCaps-> dwTotalSize )
03962         {
03963           break;
03964         }
03965
03966         dwSize = lpTransCaps-> dwNeededSize;
03967         DialerFree( lpTransCaps );
03968
03969       } while ( TRUE );
03970
03971       // skip entries till you locate information for current location
03972       dwSize = sizeof( LINELOCATIONENTRY );
03973       lpLocLst = (LPLINELOCATIONENTRY) ( (LPSTR) lpTransCaps +
03974                         lpTransCaps-> dwLocationListOffset );
03975
03976       for ( dwInd = 0; dwInd < lpTransCaps-> dwNumLocations ; dwInd++ )
03977       {
03978         if ( lpLocLst[ dwInd ].dwPermanentLocationID == lpTransCaps-> dwCurrentLocationID )
03979           break;
03980       }
03981
03982       // current location no found ?????
03983       // login error
03984       if ( dwInd == lpTransCaps-> dwNumLocations )
03985       {
03986         goto error;
03987       }
03988
03989       // construct canonical form as
03990       szCanNumber[ 0 ]= '\0';
03991       strncat( szCanNumber, "+1 (",(sizeof(szCanNumber)-1));
03992       strncat( szCanNumber, (LPSTR) lpTransCaps + lpLocLst[ dwInd ].dwCityCodeOffset,
03993           sizeof(szCanNumber)- 5);
03994       strncat( szCanNumber, ") ",
03995           ((sizeof(szCanNumber))-(5 + (lpTransCaps-> dwTotalSize) + (lpLocLst[ dwInd ].dwCityCodeSize)  )));
03996       strncat( szCanNumber, szDigits,
03997         ((sizeof(szCanNumber))- (5 + (lpTransCaps-> dwTotalSize) + (lpLocLst[ dwInd ].dwCityCodeSize) + 2 )));
03998
03999
04000       cPos = (int) strcspn( szNumber, "|" );
04001       if ( cPos != lstrlen( szNumber ) )
04002       {
04003         strncat( szCanNumber, &(szNumber[ cPos ]),
04004           ((sizeof(szCanNumber) )- (5 + (lpTransCaps-> dwTotalSize) + (lpLocLst[ dwInd ].dwCityCodeSize) + 2 +
04005           lstrlen(szDigits))));
04006       }
04007
04008       bRes = TRUE;
04009       break;
04010     }
04011
04012     case EXTENDED_LONG_DISTANCE_NUMBER:
04013     {
04014       // Long distance number ( 10 digits) preceeded by a 0/1
04015       // Strip leading 0/1 and treat as a long distance number
04016       if ( szDigits[ 0 ] == '0' || szDigits[ 0 ] == '1' )
04017       {
04018         nLenDigits--;
04019         memmove( szDigits, &(szDigits[1]), nLenDigits );
04020         szDigits[ nLenDigits ] = '\0';
04021
04022         cPos = (int) strcspn( szPref, "01" );
04023         nLenPref--;
04024         memmove( &(szPref[ cPos ]), &(szPref[ cPos + 1 ]), nLenPref - cPos );
04025         szPref[ nLenPref ] = '\0';
04026       }
04027       else
04028       {
04029         goto error;
04030       }
04031
04032     }
04033
04034     case LONG_DISTANCE_NUMBER:
04035     {
04036       // if first or fourth digit is 0/1, illegal number
04037       if ( szDigits[ 0 ] == '0' || szDigits[ 0 ] == '1' ||
04038          szDigits[ 3 ] == '0' || szDigits[ 3 ] == '1' )
04039       {
04040         goto error;
04041       }
04042
04043       szCanNumber[ 0 ] = '\0';
04044       strncat( szCanNumber, "+1 (" , (sizeof(szCanNumber)-1));
04045       strncat( szCanNumber, szDigits, (sizeof(szCanNumber)-5));
04046       strncat( szCanNumber, ") ", (sizeof(szCanNumber)-5-lstrlen(szDigits)));
04047
04048       strncat( szCanNumber, &(szDigits[ 3 ]),
04049         (sizeof(szCanNumber)-5-lstrlen(szDigits)-2));
04050
04051       bRes = TRUE;
04052     }
04053     break;
04054
04055     default :
04056       goto error;
04057   }
04058
04059 error:
04060   if ( lpTransOut )
04061     DialerFree( lpTransOut );
04062
04063   if ( lpTransCaps )
04064     DialerFree( lpTransCaps );
04065
04066   return bRes;
04067 }
04068
04069
04070 /*
04071  *  Name :
04072  *    AmpersandCompensate
04073  *
04074  *  Arguements :
04075  *    lpszSrc   : Src string containing &s
04076  *    lpszDst   : Dest string
04077  *
04078  *  Return :
04079  *
04080  *  Comments :
04081  *    Copies string pointed to by lpszSrc to lpszDst character by
04082  *    character.  If an & is encountered in this process in lpszSrc
04083  *    it is copied as && into lpszDst.
04084  *    Assumes lpszDst and lpszSrc are of size TAPIMAXCALLEDPARTYSIZE
04085  */
04086 VOID AmpersandCompensate ( LPCSTR lpszSrc, LPSTR lpszDst )
04087 {
04088   // check if the name has an & in it.  If so replace
04089   // it with &&.
04090   INT cCnt, cInd;
04091
04092   for ( cCnt = 0, cInd = 0;
04093       cInd < TAPIMAXCALLEDPARTYSIZE;
04094       cInd++, cCnt++ )
04095   {
04096     if ( lpszSrc[ cCnt ] == '&' )
04097     {
04098       lpszDst[ cInd++ ] = '&';
04099     }
04100     lpszDst[ cInd ] = lpszSrc[ cCnt ];
04101
04102     if ( lpszSrc[ cCnt ] == '\0' )
04103       break;
04104   }
04105
04106   // make sure string is null terminated.
04107   lpszDst[ TAPIMAXCALLEDPARTYSIZE - 1 ] = '\0';
04108
04109   return;
04110 }
04111
04112
04113  /*
04114  *  Name :
04115  *    AmpersandDeCompensate
04116  *
04117  *  Arguements :
04118  *    lpszSrc   : Src string containing &s
04119  *    lpszDst   : Dest string
04120  *
04121  *  Return :
04122  *
04123  *  Comments :
04124  *    Copies string pointed to by lpszSrc to lpszDst character by
04125  *    character.  If an && is encountered in this process in lpszSrc
04126  *    it is copied as & into lpszDst.
04127  *    Assumes lpszDst and lpszSrc are of size TAPIMAXCALLEDPARTYSIZE
04128  */
04129  VOID AmpersandDeCompensate ( LPCSTR lpszSrc, LPSTR lpszDst )
04130  {
04131   // check if the name has an & in it.  If so replace
04132   // it with &&.
04133   INT cCnt, cInd;
04134
04135   for ( cCnt = 0, cInd = 0;
04136       cInd < TAPIMAXCALLEDPARTYSIZE;
04137       cInd++, cCnt++ )
04138   {
04139     if  ( ( lpszSrc[ cInd ] == '&' ) &&
04140         ( lpszSrc[ cInd + 1 ] == '&' ) )
04141     {
04142       cInd++;
04143     }
04144     lpszDst[ cCnt ] = lpszSrc[ cInd ] ;
04145
04146     if ( lpszSrc [ cInd ] == '\0' )
04147     {
04148       break;
04149     }
04150   }
04151
04152   lpszDst[ TAPIMAXCALLEDPARTYSIZE - 1 ] = '\0';
04153
04154   return;
04155  }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCertManagePolicyModuleSample Member List

This is the complete list of members for CCertManagePolicyModuleSample, including all inherited members.
CCertManagePolicyModuleSample() | CCertManagePolicyModuleSample | [inline]
CCertManagePolicyModuleSample() | CCertManagePolicyModuleSample | [inline]
Configure(const BSTR strConfig, BSTR strStorageLocation, LONG dwFlags) | CCertManagePolicyModuleSample |
Configure(const BSTR strConfig, BSTR strStorageLocation, LONG dwFlags) | CCertManagePolicyModuleSample |
~CCertManagePolicyModuleSample() | CCertManagePolicyModuleSample | [inline]
~CCertManagePolicyModuleSample() | CCertManagePolicyModuleSample | [inline]
Generated on Wed Nov 13 2024 16:55:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/resource.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

resource.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            resource.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #pragma once
00013 //{{NO_DEPENDENCIES}}
00014 // Microsoft Developer Studio generated include file.
00015 // Used by SDKSamplePlaylistPlugin.rc
00016 //
00017 #define IDS_PROJNAME                    100
00018 #define IDR_SDKSAMPLEPLAYLISTPARSER     101
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        201
00025 #define _APS_NEXT_COMMAND_VALUE         32768
00026 #define _APS_NEXT_CONTROL_VALUE         201
00027 #define _APS_NEXT_SYMED_VALUE           102
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ShutdownDlg.h Source File

  • WinBase
  • WtsApi
  • WtsApi

ShutdownDlg.h

Go to the documentation of this file.
00001 //  Copyright 1995-1999, Citrix Systems Inc.
00002 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00003 #if !defined(AFX_SHUTDOWNDLG_H__75CF0BAF_3508_11D1_8123_00C04FBBB23F__INCLUDED_)
00004 #define AFX_SHUTDOWNDLG_H__75CF0BAF_3508_11D1_8123_00C04FBBB23F__INCLUDED_
00005
00006 #if _MSC_VER >= 1000
00007 #pragma once
00008 #endif // _MSC_VER >= 1000
00009 // ShutdownDlg.h : header file
00010 //
00011
00012 #define MAXSHUTDOWNITEMS 5
00013
00014 /*#define WSD_LOGOFF    0x00000001
00015 #define WSD_SHUTDOWN  0x00000002
00016 #define WSD_REBOOT    0x00000004
00017 #define WSD_POWEROFF  0x00000008
00018 #define WSD_FASTREBOOT  0x00000010  */
00019
00020 typedef struct _Shutdown {
00021   TCHAR ShutdownName[35];
00022   DWORD ShutdownFlag;
00023 } Shutdown;
00024
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // CShutdownDlg dialog
00028
00029 class CShutdownDlg : public CDialog
00030 {
00031 // Construction
00032 public:
00033   CShutdownDlg(CWnd* pParent = NULL);   // standard constructor
00034
00035 // Dialog Data
00036   //{{AFX_DATA(CShutdownDlg)
00037   enum { IDD = IDD_SHUTDOWN };
00038   CEdit m_serverName;
00039   CListBox  m_shutdown;
00040   //}}AFX_DATA
00041
00042
00043 // Overrides
00044   // ClassWizard generated virtual function overrides
00045   //{{AFX_VIRTUAL(CShutdownDlg)
00046   protected:
00047   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00048   //}}AFX_VIRTUAL
00049
00050 // Implementation
00051 protected:
00052
00053   // Generated message map functions
00054   //{{AFX_MSG(CShutdownDlg)
00055   virtual BOOL OnInitDialog();
00056   afx_msg void OnShutdown();
00057   //}}AFX_MSG
00058   DECLARE_MESSAGE_MAP()
00059 private:
00060   HANDLE serverHandle;
00061   TCHAR* serverName;
00062 };
00063
00064 //{{AFX_INSERT_LOCATION}}
00065 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00066
00067 #endif // !defined(AFX_SHUTDOWNDLG_H__75CF0BAF_3508_11D1_8123_00C04FBBB23F__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/EventSink/Resource.h Source File

  • TabletPC
  • EventSink

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Visual C++ generated include file.
00003 // Used by EventSink.rc
00004 //
00005
00006 #define IDS_APP_TITLE     103
00007
00008 #define IDR_MAINFRAME     128
00009 #define IDD_EVENTSINK_DIALOG  102
00010 #define IDD_ABOUTBOX      103
00011 #define IDM_ABOUT       104
00012 #define IDM_EXIT        105
00013 #define IDI_EVENTSINK     107
00014 #define IDI_SMALL       108
00015 #define IDC_EVENTSINK     109
00016 #define IDC_MYICON        2
00017 #define IDC_STATIC        -1
00018 // Next default values for new objects
00019 //
00020 #ifdef APSTUDIO_INVOKED
00021 #ifndef APSTUDIO_READONLY_SYMBOLS
00022
00023 #define _APS_NO_MFC         130
00024 #define _APS_NEXT_RESOURCE_VALUE  129
00025 #define _APS_NEXT_COMMAND_VALUE   32771
00026 #define _APS_NEXT_CONTROL_VALUE   1000
00027 #define _APS_NEXT_SYMED_VALUE   110
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/guids.h Source File

  • SysMgmt
  • MMC
  • WMI

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019
00020 // {40EDBFBE-E4D4-4380-8BFE-AF1D280AB6F4}
00021 DEFINE_GUID(CLSID_CComponentData,
00022 0x40edbfbe, 0xe4d4, 0x4380, 0x8b, 0xfe, 0xaf, 0x1d, 0x28, 0xa, 0xb6, 0xf4);
00023
00024
00025 // {356DDDA6-310D-4329-82FF-922F91AFDC6A}
00026 DEFINE_GUID(CLSID_CSnapinAbout,
00027 0x356ddda6, 0x310d, 0x4329, 0x82, 0xff, 0x92, 0x2f, 0x91, 0xaf, 0xdc, 0x6a);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/dxferObj.h Source File

  • Com
  • Fundamentals
  • SimpDnd

dxferObj.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: dxferobj.h
00003 //
00004 //      Definition of CDataXferObj
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _DATAXFEROBJ_H_)
00010 #define _DATAXFEROBJ_H_
00011
00012 class CSimpleSite;
00013
00014 interface CDataObject;
00015
00016 class CDataXferObj : public IDataObject
00017 {
00018 private:
00019   int m_nCount;                       // reference count
00020   SIZEL m_sizel;
00021   POINTL m_pointl;
00022   LPSTORAGE m_lpObjStorage;
00023   LPOLEOBJECT m_lpOleObject;
00024
00025   // construction/destruction
00026   CDataXferObj();
00027   ~CDataXferObj();
00028
00029 public:
00030   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppvObj);
00031   STDMETHODIMP_(ULONG) AddRef ();
00032   STDMETHODIMP_(ULONG) Release ();
00033
00034   STDMETHODIMP DAdvise  ( FORMATETC FAR* pFormatetc, DWORD advf,
00035   LPADVISESINK pAdvSink, DWORD FAR* pdwConnection)
00036     { return ResultFromScode(OLE_E_ADVISENOTSUPPORTED); }
00037   STDMETHODIMP DUnadvise  ( DWORD dwConnection)
00038     { return ResultFromScode(OLE_E_ADVISENOTSUPPORTED); }
00039   STDMETHODIMP EnumDAdvise  ( LPENUMSTATDATA FAR* ppenumAdvise)
00040     { return ResultFromScode(OLE_E_ADVISENOTSUPPORTED); }
00041   STDMETHODIMP EnumFormatEtc  ( DWORD dwDirection,
00042       LPENUMFORMATETC FAR* ppenumFormatEtc);
00043       STDMETHODIMP GetCanonicalFormatEtc  ( LPFORMATETC pformatetc,
00044       LPFORMATETC pformatetcOut)
00045     { pformatetcOut->ptd = NULL; return ResultFromScode(E_NOTIMPL); }
00046   STDMETHODIMP GetData  (LPFORMATETC pformatetcIn, LPSTGMEDIUM pmedium );
00047   STDMETHODIMP GetDataHere  (LPFORMATETC pformatetc, LPSTGMEDIUM pmedium);
00048   STDMETHODIMP QueryGetData  (LPFORMATETC pformatetc );
00049   STDMETHODIMP SetData  (LPFORMATETC pformatetc, STGMEDIUM FAR * pmedium,
00050       BOOL fRelease)
00051     { return ResultFromScode(E_NOTIMPL); }
00052
00053   static CDataXferObj FAR* Create(CSimpleSite FAR* lpSite,
00054       POINTL FAR* pPointl);
00055
00056 };
00057 #endif  // _DATAXFEROBJ_H_
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/CeLib.Cpp Source File

  • Security
  • CertServices
  • Encode

CeLib.Cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1995 - 2000
00006 //
00007 //  File:       celib.cpp
00008 //
00009 //  Contents:   helper functions
00010 //
00011 //--------------------------------------------------------------------------
00012
00013 #include "pch.cpp"
00014 #pragma hdrstop
00015
00016 #include "celib.h"
00017 #include <assert.h>
00018
00019 //+--------------------------------------------------------------------------
00020 // ceDecodeObject -- call CryptDecodeObject, and allocate memory for output
00021 //
00022 //+--------------------------------------------------------------------------
00023
00024 #pragma warning(push)
00025 #pragma warning(disable: 4100)  // unreferenced formal parameter
00026 BOOL
00027 ceDecodeObject(
00028     IN DWORD dwEncodingType,
00029     IN LPCSTR lpszStructType,
00030     IN BYTE const *pbEncoded,
00031     IN DWORD cbEncoded,
00032     IN BOOL fCoTaskMemAlloc,  // referenced only by assert
00033     OUT VOID **ppvStructInfo,
00034     OUT DWORD *pcbStructInfo)
00035 {
00036     BOOL b;
00037
00038     assert(!fCoTaskMemAlloc);
00039     *ppvStructInfo = NULL;
00040     *pcbStructInfo = 0;
00041     while (TRUE)
00042     {
00043   b = CryptDecodeObject(
00044         dwEncodingType,
00045         lpszStructType,
00046         pbEncoded,
00047         cbEncoded,
00048         0,                  // dwFlags
00049         *ppvStructInfo,
00050         pcbStructInfo);
00051   if (b && 0 == *pcbStructInfo)
00052   {
00053       SetLastError((DWORD) HRESULT_FROM_WIN32(ERROR_INVALID_DATA));
00054       b = FALSE;
00055   }
00056   if (!b)
00057   {
00058       if (NULL != *ppvStructInfo)
00059       {
00060     HRESULT hr = GetLastError();
00061
00062     LocalFree(*ppvStructInfo);
00063     *ppvStructInfo = NULL;
00064     SetLastError(hr);
00065       }
00066       break;
00067   }
00068   if (NULL != *ppvStructInfo)
00069   {
00070       break;
00071   }
00072   *ppvStructInfo = (BYTE *) LocalAlloc(LMEM_FIXED, *pcbStructInfo);
00073   if (NULL == *ppvStructInfo)
00074   {
00075       b = FALSE;
00076       break;
00077   }
00078     }
00079     return(b);
00080 }
00081 #pragma warning(pop)
00082
00083
00084 #pragma warning(push)
00085 #pragma warning(disable: 4100)  // unreferenced formal parameter
00086 BOOL
00087 ceEncodeObject(
00088     IN DWORD dwEncodingType,
00089     IN LPCSTR lpszStructType,
00090     IN VOID const *pvStructInfo,
00091     IN DWORD dwFlags,   // referenced only by assert
00092     IN BOOL fCoTaskMemAlloc,  // referenced only by assert
00093     OUT BYTE **ppbEncoded,
00094     OUT DWORD *pcbEncoded)
00095 {
00096     BOOL b;
00097
00098     assert(0 == dwFlags);
00099     assert(!fCoTaskMemAlloc);
00100     *ppbEncoded = NULL;
00101     *pcbEncoded = 0;
00102     while (TRUE)
00103     {
00104   b = CryptEncodeObject(
00105         dwEncodingType,
00106         lpszStructType,
00107         const_cast<VOID *>(pvStructInfo),
00108         *ppbEncoded,
00109         pcbEncoded);
00110   if (b && 0 == *pcbEncoded)
00111   {
00112       SetLastError((DWORD) HRESULT_FROM_WIN32(ERROR_INVALID_DATA));
00113       b = FALSE;
00114   }
00115   if (!b)
00116   {
00117       if (NULL != *ppbEncoded)
00118       {
00119     HRESULT hr = GetLastError();
00120
00121     LocalFree(*ppbEncoded);
00122     *ppbEncoded = NULL;
00123     SetLastError(hr);
00124       }
00125       break;
00126   }
00127   if (NULL != *ppbEncoded)
00128   {
00129       break;
00130   }
00131   *ppbEncoded = (BYTE *) LocalAlloc(LMEM_FIXED, *pcbEncoded);
00132   if (NULL == *ppbEncoded)
00133   {
00134       b = FALSE;
00135       break;
00136   }
00137     }
00138     return(b);
00139 }
00140 #pragma warning(pop)
00141
00142
00143 // The returned pszObjId is a constant that must not be freed.  CryptFindOIDInfo
00144 // has a static internal database that is valid until crypt32.dll is unloaded.
00145
00146 WCHAR const *
00147 ceGetOIDNameA(
00148     IN char const *pszObjId)
00149 {
00150     CRYPT_OID_INFO const *pInfo = NULL;
00151     WCHAR const *pwszName = L"";
00152
00153     // First try looking up the ObjectId as an Extension or Attribute, because
00154     // we get a better Display Name, especially for Subject RDNs: CN, L, etc.
00155     // If that fails, look it up withoput restricting the group.
00156
00157     pInfo = CryptFindOIDInfo(
00158       CRYPT_OID_INFO_OID_KEY,
00159       (VOID *) pszObjId,
00160       CRYPT_EXT_OR_ATTR_OID_GROUP_ID);
00161
00162     if (NULL == pInfo || NULL == pInfo->pwszName || L'\0' == pInfo->pwszName[0])
00163     {
00164   pInfo = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, (VOID *) pszObjId, 0);
00165     }
00166     if (NULL != pInfo && NULL != pInfo->pwszName && L'\0' != pInfo->pwszName[0])
00167     {
00168   pwszName = pInfo->pwszName;
00169     }
00170     return(pwszName);
00171 }
00172
00173
00174 WCHAR const *
00175 ceGetOIDName(
00176     IN WCHAR const *pwszObjId)
00177 {
00178     char *pszObjId = NULL;
00179     WCHAR const *pwszName = L"";
00180
00181     if (!ceConvertWszToSz(&pszObjId, pwszObjId, -1))
00182     {
00183   _JumpError(E_OUTOFMEMORY, error, "ceConvertWszToSz");
00184     }
00185     pwszName = ceGetOIDNameA(pszObjId);
00186
00187 error:
00188     if (NULL != pszObjId)
00189     {
00190   LocalFree(pszObjId);
00191     }
00192     return(pwszName);
00193 }
00194
00195
00196 WCHAR *
00197 ceDuplicateString(
00198     IN WCHAR const *pwsz)
00199 {
00200     WCHAR *pwszOut;
00201
00202     pwszOut = (WCHAR *) LocalAlloc(
00203         LMEM_FIXED,
00204         (wcslen(pwsz) + 1) * sizeof(pwsz[0]));
00205     if (NULL != pwszOut)
00206     {
00207   wcscpy(pwszOut, pwsz);
00208     }
00209     return(pwszOut);
00210 }
00211
00212
00213 BOOL
00214 ceConvertWszToSz(
00215     OUT CHAR **ppsz,
00216     IN WCHAR const *pwc,
00217     IN LONG cwc)
00218 {
00219     BOOL fOk = FALSE;
00220     LONG cch = 0;
00221
00222     *ppsz = NULL;
00223     while (TRUE)
00224     {
00225   cch = WideCharToMultiByte(
00226       GetACP(),
00227       0,          // dwFlags
00228       pwc,
00229       cwc,        // cchWideChar, -1 => null terminated
00230       *ppsz,
00231       cch,
00232       NULL,
00233       NULL);
00234   if (0 >= cch)
00235   {
00236       DWORD err;
00237
00238       err = GetLastError();
00239       ceERRORPRINTLINE("WideCharToMultiByte", err);
00240       if (NULL != *ppsz)
00241       {
00242     LocalFree(*ppsz);
00243     *ppsz = NULL;
00244       }
00245       break;
00246   }
00247   if (NULL != *ppsz)
00248   {
00249       fOk = TRUE;
00250       break;
00251   }
00252   *ppsz = (CHAR *) LocalAlloc(LMEM_FIXED, cch + 1);
00253   if (NULL == *ppsz)
00254   {
00255       break;
00256   }
00257     }
00258     return(fOk);
00259 }
00260
00261
00262 BOOL
00263 ceConvertWszToBstr(
00264     OUT BSTR *pbstr,
00265     IN WCHAR const *pwc,
00266     IN LONG cb)
00267 {
00268     BOOL fOk = FALSE;
00269     BSTR bstr;
00270
00271     ceFreeBstr(pbstr);
00272     do
00273     {
00274   bstr = NULL;
00275   if (NULL != pwc)
00276   {
00277       if (-1 == cb)
00278       {
00279     cb = wcslen(pwc) * sizeof(WCHAR);
00280       }
00281       bstr = SysAllocStringByteLen((char const *) pwc, cb);
00282       if (NULL == bstr)
00283       {
00284     break;
00285       }
00286   }
00287   *pbstr = bstr;
00288   fOk = TRUE;
00289     } while (FALSE);
00290     return(fOk);
00291 }
00292
00293
00294 BOOL
00295 ceConvertSzToWsz(
00296     OUT WCHAR **ppwsz,
00297     IN char const *pch,
00298     IN LONG cch)
00299 {
00300     BOOL fOk = FALSE;
00301     LONG cwc = 0;
00302
00303     *ppwsz = NULL;
00304     while (TRUE)
00305     {
00306   cwc = MultiByteToWideChar(GetACP(), 0, pch, cch, *ppwsz, cwc);
00307   if (0 >= cwc)
00308   {
00309       DWORD err;
00310
00311       err = GetLastError();
00312       ceERRORPRINTLINE("MultiByteToWideChar", err);
00313       if (NULL != *ppwsz)
00314       {
00315     LocalFree(*ppwsz);
00316     *ppwsz = NULL;
00317       }
00318       break;
00319   }
00320   if (NULL != *ppwsz)
00321   {
00322       fOk = TRUE;
00323       break;
00324   }
00325   *ppwsz = (WCHAR *) LocalAlloc(LMEM_FIXED, (cwc + 1) * sizeof(WCHAR));
00326   if (NULL == *ppwsz)
00327   {
00328       break;
00329   }
00330     }
00331     return(fOk);
00332 }
00333
00334
00335 BOOL
00336 ceConvertSzToBstr(
00337     OUT BSTR *pbstr,
00338     IN CHAR const *pch,
00339     IN LONG cch)
00340 {
00341     BOOL fOk = FALSE;
00342     BSTR bstr = NULL;
00343     LONG cwc = 0;
00344
00345     ceFreeBstr(pbstr);
00346     if (-1 == cch)
00347     {
00348   cch = strlen(pch);
00349     }
00350     while (TRUE)
00351     {
00352   cwc = MultiByteToWideChar(GetACP(), 0, pch, cch, bstr, cwc);
00353   if (0 >= cwc)
00354   {
00355       //hr = ceHLastError();
00356       //printf("MultiByteToWideChar returned %d (%x)\n", hr, hr);
00357       break;
00358   }
00359   if (NULL != bstr)
00360   {
00361       bstr[cwc] = L'\0';
00362       *pbstr = bstr;
00363       fOk = TRUE;
00364       break;
00365   }
00366   bstr = SysAllocStringLen(NULL, cwc);
00367   if (NULL == bstr)
00368   {
00369       break;
00370   }
00371     }
00372     return(fOk);
00373 }
00374
00375
00376 VOID
00377 ceFreeBstr(
00378     IN OUT BSTR *pstr)
00379 {
00380     if (NULL != *pstr)
00381     {
00382   SysFreeString(*pstr);
00383   *pstr = NULL;
00384     }
00385 }
00386
00387
00388 HRESULT
00389 ceHError(
00390     IN HRESULT hr)
00391 {
00392     assert(S_FALSE != hr);
00393
00394     if (S_OK != hr && S_FALSE != hr && !FAILED(hr))
00395     {
00396         hr = HRESULT_FROM_WIN32(hr);
00397   if ((HRESULT) 0 == HRESULT_CODE(hr))
00398   {
00399       // A call failed without properly setting an error condition!
00400       hr = E_UNEXPECTED;
00401   }
00402   assert(FAILED(hr));
00403     }
00404     return(hr);
00405 }
00406
00407
00408 HRESULT
00409 ceHLastError(VOID)
00410 {
00411     return(ceHError(GetLastError()));
00412 }
00413
00414
00415 VOID
00416 ceErrorPrintLine(
00417     IN char const *pszFile,
00418     IN DWORD line,
00419     IN char const *pszMessage,
00420     IN WCHAR const *pwszData,
00421     IN HRESULT hr)
00422 {
00423     CHAR ach[4096];
00424     LONG cch;
00425
00426 //#pragma prefast(disable:53, "PREfast bug 650")
00427     cch = _snprintf(
00428     ach,
00429     sizeof(ach),
00430     "CeLib: Error: %hs(%u): %hs%hs%ws%hs 0x%x (%d)\n",
00431     pszFile,
00432     line,
00433     pszMessage,
00434     NULL == pwszData? "" : szLPAREN,
00435     NULL == pwszData? L"" : pwszData,
00436     NULL == pwszData? "" : szRPAREN,
00437     hr,
00438     hr);
00439 //#pragma prefast(enable:53, "re-enable")
00440     if (0 > cch || sizeof(ach) <= cch)
00441     {
00442   strcpy(&ach[sizeof(ach) - 5], "...\n");
00443     }
00444     OutputDebugStringA(ach);
00445     wprintf(L"%hs", ach);
00446 }
00447
00448
00449 HRESULT
00450 ceDateToFileTime(
00451     IN DATE const *pDate,
00452     OUT FILETIME *pft)
00453 {
00454     SYSTEMTIME st;
00455     HRESULT hr = S_OK;
00456
00457     if (*pDate == 0.0)
00458     {
00459         GetSystemTime(&st);
00460     }
00461     else
00462     {
00463   if (!VariantTimeToSystemTime(*pDate, &st))
00464   {
00465       hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00466       _JumpError(hr, error, "VariantTimeToSystemTime");
00467   }
00468     }
00469
00470     if (!SystemTimeToFileTime(&st, pft))
00471     {
00472         hr = ceHLastError();
00473         _JumpError(hr, error, "SystemTimeToFileTime");
00474     }
00475
00476 error:
00477     return(hr);
00478 }
00479
00480
00481 HRESULT
00482 ceFileTimeToDate(
00483     IN FILETIME const *pft,
00484     OUT DATE *pDate)
00485 {
00486     SYSTEMTIME st;
00487     HRESULT hr = S_OK;
00488
00489     if (!FileTimeToSystemTime(pft, &st))
00490     {
00491         hr = ceHLastError();
00492         _JumpError(hr, error, "FileTimeToSystemTime");
00493     }
00494     if (!SystemTimeToVariantTime(&st, pDate))
00495     {
00496         hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00497         _JumpError(hr, error, "SystemTimeToVariantTime");
00498     }
00499
00500 error:
00501     return(hr);
00502 }
00503
00504
00505 VOID
00506 ceMakeExprDateTime(
00507     IN OUT FILETIME *pft,
00508     IN LONG lDelta,
00509     IN enum ENUM_PERIOD enumPeriod)
00510 {
00511     LLFILETIME llft;
00512     LONGLONG llDelta;
00513     BOOL fSysTimeDelta;
00514
00515     llft.ft = *pft;
00516     llDelta = lDelta;
00517     fSysTimeDelta = FALSE;
00518     switch (enumPeriod)
00519     {
00520   case ENUM_PERIOD_WEEKS:   llDelta *= CVT_WEEKS;    break;
00521   case ENUM_PERIOD_DAYS:    llDelta *= CVT_DAYS;     break;
00522   case ENUM_PERIOD_HOURS:   llDelta *= CVT_HOURS;    break;
00523   case ENUM_PERIOD_MINUTES: llDelta *= CVT_MINUTES;  break;
00524   case ENUM_PERIOD_SECONDS:          break;
00525   default:
00526       fSysTimeDelta = TRUE;
00527       break;
00528     }
00529     if (fSysTimeDelta)
00530     {
00531   SYSTEMTIME SystemTime;
00532
00533   FileTimeToSystemTime(&llft.ft, &SystemTime);
00534   switch (enumPeriod)
00535   {
00536       case ENUM_PERIOD_MONTHS:
00537     if (0 > lDelta)
00538     {
00539         DWORD dwDelta = (DWORD) -lDelta;
00540
00541         SystemTime.wYear -= (WORD) (dwDelta / 12) + 1;
00542         SystemTime.wMonth += 12 - (WORD) (dwDelta % 12);
00543     }
00544     else
00545     {
00546         SystemTime.wMonth = (WORD) lDelta + SystemTime.wMonth;
00547     }
00548     if (12 < SystemTime.wMonth)
00549     {
00550         SystemTime.wYear += (SystemTime.wMonth - 1) / 12;
00551         SystemTime.wMonth = ((SystemTime.wMonth - 1) % 12) + 1;
00552     }
00553     break;
00554
00555       case ENUM_PERIOD_YEARS:
00556     SystemTime.wYear = (WORD) lDelta + SystemTime.wYear;
00557     break;
00558
00559       default:
00560     SystemTime.wYear += 1;
00561     break;
00562   }
00563
00564 DoConvert:
00565         if (!SystemTimeToFileTime(&SystemTime, &llft.ft))
00566         {
00567             if (GetLastError() != ERROR_INVALID_PARAMETER)
00568             {
00569                 assert(!"Unable to do time conversion");
00570                 return;
00571             }
00572
00573             // In some cases we'll convert to an invalid month-end
00574
00575             // only one month changes length from year to year
00576             if (SystemTime.wMonth == 2)
00577             {
00578                 // > 29? try leap year
00579                 if (SystemTime.wDay > 29)
00580                 {
00581                     SystemTime.wDay = 29;
00582                     goto DoConvert;
00583                 }
00584                 // == 29? try non-leap year
00585                 else if (SystemTime.wDay == 29)
00586                 {
00587                     SystemTime.wDay = 28;
00588                     goto DoConvert;
00589                 }
00590             }
00591             // sept (9), apr(4), jun(6), nov(11) all have 30 days
00592             else if ((SystemTime.wMonth == 9) ||
00593                      (SystemTime.wMonth == 4) ||
00594                      (SystemTime.wMonth == 6) ||
00595                      (SystemTime.wMonth == 11))
00596             {
00597                 if (SystemTime.wDay > 30)
00598                 {
00599                     SystemTime.wDay = 30;
00600                     goto DoConvert;
00601                 }
00602             }
00603
00604             // should never get here
00605             assert(!"Month/year processing: inaccessible code");
00606             return;
00607         }
00608     }
00609     else
00610     {
00611   llft.ll += llDelta * CVT_BASE;
00612     }
00613     *pft = llft.ft;
00614 }
00615
00616
00617 HRESULT
00618 ceMakeExprDate(
00619     IN OUT DATE *pDate,
00620     IN LONG lDelta,
00621     IN enum ENUM_PERIOD enumPeriod)
00622 {
00623     HRESULT hr;
00624     FILETIME ft;
00625
00626     hr = ceDateToFileTime(pDate, &ft);
00627     _JumpIfError(hr, error, "ceDateToFileTime");
00628
00629     ceMakeExprDateTime(&ft, lDelta, enumPeriod);
00630
00631     hr = ceFileTimeToDate(&ft, pDate);
00632     _JumpIfError(hr, error, "ceFileTimeToDate");
00633
00634 error:
00635     return(hr);
00636 }
00637
00638
00639 typedef struct _UNITSTABLE
00640 {
00641     WCHAR const     *pwszString;
00642     enum ENUM_PERIOD enumPeriod;
00643 } UNITSTABLE;
00644
00645
00646 UNITSTABLE g_aut[] =
00647 {
00648     { wszPERIODSECONDS, ENUM_PERIOD_SECONDS },
00649     { wszPERIODMINUTES, ENUM_PERIOD_MINUTES },
00650     { wszPERIODHOURS,   ENUM_PERIOD_HOURS },
00651     { wszPERIODDAYS,    ENUM_PERIOD_DAYS },
00652     { wszPERIODWEEKS,   ENUM_PERIOD_WEEKS },
00653     { wszPERIODMONTHS,  ENUM_PERIOD_MONTHS },
00654     { wszPERIODYEARS,   ENUM_PERIOD_YEARS },
00655 };
00656 #define CUNITSTABLEMAX  (sizeof(g_aut)/sizeof(g_aut[0]))
00657
00658
00659 HRESULT
00660 ceTranslatePeriodUnits(
00661     IN WCHAR const *pwszPeriod,
00662     IN LONG lCount,
00663     OUT enum ENUM_PERIOD *penumPeriod,
00664     OUT LONG *plCount)
00665 {
00666     HRESULT hr;
00667     UNITSTABLE const *put;
00668
00669     for (put = g_aut; put < &g_aut[CUNITSTABLEMAX]; put++)
00670     {
00671   if (0 == celstrcmpiL(pwszPeriod, put->pwszString))
00672   {
00673       *penumPeriod = put->enumPeriod;
00674       if (0 > lCount)
00675       {
00676     lCount = MAXLONG;
00677       }
00678       *plCount = lCount;
00679       hr = S_OK;
00680       goto error;
00681   }
00682     }
00683     hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00684
00685 error:
00686     return(hr);
00687 }
00688
00689
00690 //+-------------------------------------------------------------------------
00691 // ceVerifyObjIdA - verify the passed pszObjId is valid as per X.208
00692 //
00693 // Encode and Decode the Object Id and make sure it suvives the round trip.
00694 // The first number must be 0, 1 or 2.
00695 // Enforce all characters are digits and dots.
00696 // Enforce that no dot starts or ends the Object Id, and disallow double dots.
00697 // Enforce there is at least one dot separator.
00698 // If the first number is 0 or 1, the second number must be between 0 & 39.
00699 // If the first number is 2, the second number can be any value.
00700 //--------------------------------------------------------------------------
00701
00702 HRESULT
00703 ceVerifyObjIdA(
00704     IN CHAR const *pszObjId)
00705 {
00706     HRESULT hr;
00707     BYTE *pbEncoded = NULL;
00708     DWORD cbEncoded;
00709     CRYPT_ATTRIBUTE ainfo;
00710     CRYPT_ATTRIBUTE *painfo = NULL;
00711     DWORD cbainfo;
00712     char const *psz;
00713     int i;
00714
00715     ainfo.pszObjId = const_cast<char *>(pszObjId);
00716     ainfo.cValue = 0;
00717     ainfo.rgValue = NULL;
00718
00719     if (!ceEncodeObject(
00720         X509_ASN_ENCODING,
00721         PKCS_ATTRIBUTE,
00722         &ainfo,
00723         0,
00724         FALSE,
00725         &pbEncoded,
00726         &cbEncoded))
00727     {
00728   hr = ceHLastError();
00729   _JumpError(hr, error, "ceEncodeObject");
00730     }
00731
00732     if (!ceDecodeObject(
00733         X509_ASN_ENCODING,
00734         PKCS_ATTRIBUTE,
00735         pbEncoded,
00736         cbEncoded,
00737         FALSE,
00738         (VOID **) &painfo,
00739         &cbainfo))
00740     {
00741   hr = ceHLastError();
00742   _JumpError(hr, error, "ceDecodeObject");
00743     }
00744
00745     hr = E_INVALIDARG;
00746     if (0 != strcmp(ainfo.pszObjId, painfo->pszObjId))
00747     {
00748   _JumpError(hr, error, "bad ObjId: decode mismatch");
00749     }
00750     for (psz = painfo->pszObjId; '\0' != *psz; psz++)
00751     {
00752   // must be a digit or a dot separator
00753
00754   if (!isdigit(*psz))
00755   {
00756       if ('.' != *psz)
00757       {
00758     _JumpError(hr, error, "bad ObjId: bad char");
00759       }
00760
00761       // can't have dot at start, double dots or dot at end
00762
00763       if (psz == painfo->pszObjId || '.' == psz[1] || '\0' == psz[1])
00764       {
00765     _JumpError(hr, error, "bad ObjId: dot location");
00766       }
00767   }
00768     }
00769     psz = strchr(painfo->pszObjId, '.');
00770     if (NULL == psz)
00771     {
00772   _JumpError(hr, error, "bad ObjId: must have at least one dot");
00773     }
00774     i = atoi(painfo->pszObjId);
00775     switch (i)
00776     {
00777   case 0:
00778   case 1:
00779       i = atoi(++psz);
00780       if (0 > i || 39 < i)
00781       {
00782     _JumpError(hr, error, "bad ObjId: 0. or 1. must be followed by 0..39");
00783       }
00784       break;
00785
00786   case 2:
00787       break;
00788
00789   default:
00790       _JumpError(hr, error, "bad ObjId: must start with 0, 1 or 2");
00791     }
00792     hr = S_OK;
00793
00794 error:
00795     if (NULL != pbEncoded)
00796     {
00797       LocalFree(pbEncoded);
00798     }
00799     if (NULL != painfo)
00800     {
00801       LocalFree(painfo);
00802     }
00803     return(hr);
00804 }
00805
00806
00807 HRESULT
00808 ceVerifyObjId(
00809     IN WCHAR const *pwszObjId)
00810 {
00811     HRESULT hr;
00812     CHAR *pszObjId = NULL;
00813
00814     if (!ceConvertWszToSz(&pszObjId, pwszObjId, -1))
00815     {
00816   hr = E_OUTOFMEMORY;
00817   _JumpError(hr, error, "ceConvertWszToSz");
00818     }
00819     hr = ceVerifyObjIdA(pszObjId);
00820     _JumpIfErrorStr(hr, error, "ceVerifyObjIdA", pwszObjId);
00821
00822 error:
00823     if (NULL != pszObjId)
00824     {
00825       LocalFree(pszObjId);
00826     }
00827     return(hr);
00828 }
00829
00830
00831 HRESULT
00832 ceVerifyAltNameString(
00833     IN LONG NameChoice,
00834     IN BSTR strName)
00835 {
00836     HRESULT hr = S_OK;
00837     CERT_ALT_NAME_INFO AltName;
00838     CERT_ALT_NAME_ENTRY Entry;
00839     CERT_OTHER_NAME OtherName;
00840     char *pszObjectId = NULL;
00841     DWORD cbEncoded;
00842
00843     ZeroMemory(&AltName, sizeof(AltName));
00844     AltName.cAltEntry = 1;
00845     AltName.rgAltEntry = &Entry;
00846
00847     ZeroMemory(&Entry, sizeof(Entry));
00848     Entry.dwAltNameChoice = NameChoice;
00849
00850     switch (NameChoice)
00851     {
00852   case CERT_ALT_NAME_RFC822_NAME:
00853       Entry.pwszRfc822Name = strName;
00854       break;
00855
00856   case CERT_ALT_NAME_DNS_NAME:
00857       Entry.pwszDNSName = strName;
00858       break;
00859
00860   case CERT_ALT_NAME_URL:
00861       Entry.pwszURL = strName;
00862       break;
00863
00864   case CERT_ALT_NAME_REGISTERED_ID:
00865       if (!ceConvertWszToSz(&pszObjectId, strName, -1))
00866       {
00867     hr = E_OUTOFMEMORY;
00868     ceERRORPRINTLINE("ceConvertWszToSz", hr);
00869     goto error;
00870       }
00871       Entry.pszRegisteredID = pszObjectId;
00872       break;
00873
00874   case CERT_ALT_NAME_OTHER_NAME:
00875       Entry.pOtherName = &OtherName;
00876       OtherName.pszObjId = szOID_NT_PRINCIPAL_NAME;
00877       OtherName.Value.cbData = SysStringByteLen(strName);
00878       OtherName.Value.pbData = (BYTE *) strName;
00879       break;
00880
00881   case CERT_ALT_NAME_DIRECTORY_NAME:
00882       Entry.DirectoryName.cbData = SysStringByteLen(strName);
00883       Entry.DirectoryName.pbData = (BYTE *) strName;
00884       break;
00885
00886   case CERT_ALT_NAME_IP_ADDRESS:
00887       Entry.IPAddress.cbData = SysStringByteLen(strName);
00888       Entry.IPAddress.pbData = (BYTE *) strName;
00889       break;
00890
00891   //case CERT_ALT_NAME_X400_ADDRESS:
00892   //case CERT_ALT_NAME_EDI_PARTY_NAME:
00893   default:
00894       hr = E_INVALIDARG;
00895       ceERRORPRINTLINE("NameChoice", hr);
00896       goto error;
00897
00898     }
00899
00900     // Encode CERT_ALT_NAME_INFO:
00901
00902     if (!CryptEncodeObject(
00903         X509_ASN_ENCODING,
00904         X509_ALTERNATE_NAME,
00905         &AltName,
00906         NULL,
00907         &cbEncoded))
00908     {
00909   hr = ceHLastError();
00910   ceERRORPRINTLINE("ceEncodeObject", hr);
00911   goto error;
00912     }
00913
00914 error:
00915     if (NULL != pszObjectId)
00916     {
00917   LocalFree(pszObjectId);
00918     }
00919     return(hr);
00920 }
00921
00922
00923 HRESULT
00924 ceDispatchSetErrorInfoSub(
00925     IN HRESULT hrError,
00926     OPTIONAL IN WCHAR const *pwszIDispatchMethod,
00927     OPTIONAL IN WCHAR const *pwszDescription,
00928     OPTIONAL IN WCHAR const *pwszSource,
00929     OPTIONAL IN IID const *piid,
00930     OPTIONAL IN WCHAR const *pwszHelpFile,
00931     IN DWORD dwHelpFileContext)
00932 {
00933     HRESULT hr;
00934     WCHAR const *pwszError = NULL;
00935     ICreateErrorInfo *pCreateErrorInfo = NULL;
00936     IErrorInfo *pErrorInfo = NULL;
00937
00938     if (NULL != pwszIDispatchMethod)
00939     {
00940   pwszError = ceGetErrorMessageText(hrError, TRUE);
00941     }
00942
00943     hr = CreateErrorInfo(&pCreateErrorInfo);
00944     _JumpIfError(hr, error, "CreateErrorInfo");
00945
00946     if (NULL != piid)
00947     {
00948   hr = pCreateErrorInfo->SetGUID(*piid);
00949   _PrintIfError(hr, "SetGUID");
00950     }
00951     if (NULL != pwszSource)
00952     {
00953   hr = pCreateErrorInfo->SetSource(const_cast<WCHAR *>(pwszSource));
00954   _PrintIfError(hr, "SetSource");
00955     }
00956     if (NULL != pwszDescription)
00957     {
00958   hr = pCreateErrorInfo->SetDescription(
00959           const_cast<WCHAR *>(pwszDescription));
00960   _PrintIfError(hr, "SetDescription");
00961     }
00962     if (NULL != pwszHelpFile)
00963     {
00964   hr = pCreateErrorInfo->SetHelpFile(const_cast<WCHAR *>(pwszHelpFile));
00965   _PrintIfError(hr, "SetHelpFile");
00966
00967   hr = pCreateErrorInfo->SetHelpContext(dwHelpFileContext);
00968   _PrintIfError(hr, "SetHelpContext");
00969     }
00970
00971     hr = pCreateErrorInfo->QueryInterface(
00972             IID_IErrorInfo,
00973             (VOID **) &pErrorInfo);
00974     _JumpIfError(hr, error, "QueryInterface");
00975
00976     SetErrorInfo(0, pErrorInfo);
00977     hr = S_OK;
00978
00979 error:
00980     if (NULL != pwszError)
00981     {
00982   LocalFree(const_cast<WCHAR *>(pwszError));
00983     }
00984     if (NULL != pErrorInfo)
00985     {
00986   pErrorInfo->Release();
00987     }
00988     if (NULL != pCreateErrorInfo)
00989     {
00990   pCreateErrorInfo->Release();
00991     }
00992     return(hr);
00993 }
00994
00995
00996 HRESULT
00997 ceDispatchSetErrorInfo(
00998     IN HRESULT hrError,
00999     IN WCHAR const *pwszDescription,
01000     OPTIONAL IN WCHAR const *pwszProgId,
01001     OPTIONAL IN IID const *piid)
01002 {
01003     HRESULT hr;
01004     WCHAR const *pwszError = NULL;
01005     WCHAR *pwszText = NULL;
01006
01007     if (NULL == pwszDescription)
01008     {
01009         hr = E_POINTER;
01010   _JumpError(hr, error, "NULL pointer");
01011     }
01012     assert(FAILED(hrError));
01013     pwszError = ceGetErrorMessageText(hrError, TRUE);
01014     if (NULL == pwszError)
01015     {
01016   _PrintError(E_OUTOFMEMORY, "myGetErrorMessageText");
01017     }
01018     else
01019     {
01020   pwszText = (WCHAR *) LocalAlloc(
01021       LMEM_FIXED,
01022       (wcslen(pwszDescription) + 1 + wcslen(pwszError) + 1) *
01023        sizeof(WCHAR));
01024   if (NULL == pwszText)
01025   {
01026       _PrintError(E_OUTOFMEMORY, "LocalAlloc");
01027   }
01028   else
01029   {
01030       wcscpy(pwszText, pwszDescription);
01031       wcscat(pwszText, L" ");
01032       wcscat(pwszText, pwszError);
01033   }
01034     }
01035     hr = ceDispatchSetErrorInfoSub(
01036       hrError,
01037       NULL,   // pwszIDispatchMethod
01038       NULL != pwszText?
01039           pwszText : const_cast<WCHAR *>(pwszDescription),
01040       pwszProgId,
01041       piid,
01042       NULL,   // pwszHelpFile
01043       0);   // dwHelpFileContext
01044     _PrintIfError(hr, "ceDispatchSetErrorInfoSub");
01045
01046 error:
01047     if (NULL != pwszText)
01048     {
01049   LocalFree(pwszText);
01050     }
01051     if (NULL != pwszError)
01052     {
01053   LocalFree(const_cast<WCHAR *>(pwszError));
01054     }
01055     return(hrError);  // return input error!
01056 }
01057
01058
01059 int
01060 ceWtoI(
01061     IN WCHAR const *string,
01062     OUT BOOL *pfValid)
01063 {
01064     HRESULT hr;
01065     WCHAR szBuf[16];
01066     WCHAR *szTmp = szBuf;
01067     int cTmp = ARRAYSIZE(szBuf);
01068     int i = 0;
01069     WCHAR const *pwsz;
01070     BOOL fSawDigit = FALSE;
01071
01072     if (pfValid == NULL)
01073     {
01074         hr = E_POINTER;
01075         _JumpError(hr, error, "NULLPARAM");
01076     }
01077     *pfValid = FALSE;
01078
01079     assert(NULL != pfValid);
01080     cTmp = FoldString(
01081         MAP_FOLDDIGITS,
01082         string,
01083         -1,
01084         szTmp,
01085         cTmp);
01086     if (cTmp == 0)
01087     {
01088         hr = ceHLastError();
01089         if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) == hr)
01090         {
01091             hr = S_OK;
01092             cTmp = FoldString(
01093                 MAP_FOLDDIGITS,
01094                 string,
01095                 -1,
01096                 NULL,
01097                 0);
01098
01099             szTmp = (WCHAR*)LocalAlloc(LMEM_FIXED, cTmp*sizeof(WCHAR));
01100       if (NULL == szTmp)
01101       {
01102     hr = E_OUTOFMEMORY;
01103     _JumpError(hr, error, "LocalAlloc");
01104       }
01105
01106             cTmp = FoldString(
01107                 MAP_FOLDDIGITS,
01108                 string,
01109                 -1,
01110                 szTmp,
01111                 cTmp);
01112
01113             if (cTmp == 0)
01114                 hr = ceHLastError();
01115         }
01116         _JumpIfError(hr, error, "FoldString");
01117     }
01118     pwsz = szTmp;
01119     while (iswspace(*pwsz))
01120     {
01121   pwsz++;
01122     }
01123     while (iswdigit(*pwsz))
01124     {
01125   fSawDigit = TRUE;
01126   pwsz++;
01127     }
01128     while (iswspace(*pwsz))
01129     {
01130   pwsz++;
01131     }
01132     if (L'\0' == *pwsz)
01133     {
01134   *pfValid = fSawDigit;
01135     }
01136     i = _wtoi(szTmp);
01137
01138 error:
01139     if (szTmp && (szTmp != szBuf))
01140        LocalFree(szTmp);
01141
01142     return i;
01143 }
01144
01145
01146 HRESULT
01147 ceGetMachineDnsName(
01148     OUT WCHAR **ppwszDnsName)
01149 {
01150     HRESULT hr;
01151     WCHAR *pwszDnsName = NULL;
01152     DWORD cwc;
01153     COMPUTER_NAME_FORMAT NameType = ComputerNameDnsFullyQualified;
01154
01155     *ppwszDnsName = NULL;
01156     while (TRUE)
01157     {
01158   cwc = 0;
01159   if (!GetComputerNameEx(NameType, NULL, &cwc))
01160   {
01161       hr = ceHLastError();
01162       if (HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) == hr &&
01163     ComputerNameDnsFullyQualified == NameType)
01164       {
01165     _PrintError(hr, "GetComputerNameEx(DnsFullyQualified) -- switching to NetBIOS");
01166     NameType = ComputerNameNetBIOS;
01167     continue;
01168       }
01169       if (HRESULT_FROM_WIN32(ERROR_MORE_DATA) != hr)
01170       {
01171     _JumpError(hr, error, "GetComputerNameEx");
01172       }
01173       break;
01174   }
01175     }
01176     pwszDnsName = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
01177     if (NULL == pwszDnsName)
01178     {
01179   hr = E_OUTOFMEMORY;
01180   _JumpError(hr, error, "LocalAlloc");
01181     }
01182
01183     if (!GetComputerNameEx(NameType, pwszDnsName, &cwc))
01184     {
01185   hr = ceHLastError();
01186   _JumpError(hr, error, "GetComputerNameEx");
01187     }
01188
01189     *ppwszDnsName = pwszDnsName;
01190     pwszDnsName = NULL;
01191     hr = S_OK;
01192
01193 error:
01194     if (NULL != pwszDnsName)
01195     {
01196   LocalFree(pwszDnsName);
01197     }
01198     return(hr);
01199 }
01200
01201
01202 HRESULT
01203 ceGetComputerNames(
01204     OUT WCHAR **ppwszDnsName,
01205     OUT WCHAR **ppwszOldName)
01206 {
01207     HRESULT hr;
01208     DWORD cwc;
01209     WCHAR *pwszOldName = NULL;
01210
01211     *ppwszOldName = NULL;
01212     *ppwszDnsName = NULL;
01213
01214     cwc = MAX_COMPUTERNAME_LENGTH + 1;
01215     pwszOldName = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
01216     if (NULL == pwszOldName)
01217     {
01218       hr = E_OUTOFMEMORY;
01219       _JumpError(hr, error, "LocalAlloc");
01220     }
01221     if (!GetComputerName(pwszOldName, &cwc))
01222     {
01223         hr = ceHLastError();
01224         _JumpError(hr, error, "GetComputerName");
01225     }
01226
01227     hr = ceGetMachineDnsName(ppwszDnsName);
01228     _JumpIfError(hr, error, "ceGetMachineDnsName");
01229
01230     *ppwszOldName = pwszOldName;
01231     pwszOldName = NULL;
01232
01233 error:
01234     if (NULL != pwszOldName)
01235     {
01236   LocalFree(pwszOldName);
01237     }
01238     return(hr);
01239 }
01240
01241
01242 HRESULT
01243 _IsConfigLocal(
01244     IN WCHAR const *pwszConfig,
01245     IN WCHAR const *pwszDnsName,
01246     IN WCHAR const *pwszOldName,
01247     OPTIONAL OUT WCHAR **ppwszMachine,
01248     OUT BOOL *pfLocal)
01249 {
01250     HRESULT hr;
01251     WCHAR *pwszMachine = NULL;
01252     WCHAR const *pwsz;
01253     DWORD cwc;
01254
01255     *pfLocal = FALSE;
01256     if (NULL != ppwszMachine)
01257     {
01258   *ppwszMachine = NULL;
01259     }
01260
01261     while (L'\\' == *pwszConfig)
01262     {
01263   pwszConfig++;
01264     }
01265     pwsz = wcschr(pwszConfig, L'\\');
01266     if (NULL != pwsz)
01267     {
01268   cwc = SAFE_SUBTRACT_POINTERS(pwsz, pwszConfig);
01269     }
01270     else
01271     {
01272   cwc = wcslen(pwszConfig);
01273     }
01274     pwszMachine = (WCHAR *) LocalAlloc(LMEM_FIXED, (cwc + 1) * sizeof(WCHAR));
01275     if (NULL == pwszMachine)
01276     {
01277   hr = E_OUTOFMEMORY;
01278   _JumpError(hr, error, "LocalAlloc");
01279     }
01280     CopyMemory(pwszMachine, pwszConfig, cwc * sizeof(WCHAR));
01281     pwszMachine[cwc] = L'\0';
01282
01283     if (0 == celstrcmpiL(pwszMachine, pwszDnsName) ||
01284   0 == celstrcmpiL(pwszMachine, pwszOldName))
01285     {
01286   *pfLocal = TRUE;
01287     }
01288     if (NULL != ppwszMachine)
01289     {
01290   *ppwszMachine = pwszMachine;
01291   pwszMachine = NULL;
01292     }
01293     hr = S_OK;
01294
01295 error:
01296     if (NULL != pwszMachine)
01297     {
01298   LocalFree(pwszMachine);
01299     }
01300     return(hr);
01301 }
01302
01303
01304 HRESULT
01305 ceIsConfigLocal(
01306     IN WCHAR const *pwszConfig,
01307     OPTIONAL OUT WCHAR **ppwszMachine,
01308     OUT BOOL *pfLocal)
01309 {
01310     HRESULT hr;
01311     WCHAR *pwszDnsName = NULL;
01312     WCHAR *pwszOldName = NULL;
01313
01314     *pfLocal = FALSE;
01315     if (NULL != ppwszMachine)
01316     {
01317   *ppwszMachine = NULL;
01318     }
01319
01320     hr = ceGetComputerNames(&pwszDnsName, &pwszOldName);
01321     _JumpIfError(hr, error, "ceGetComputerNames");
01322
01323     hr = _IsConfigLocal(
01324         pwszConfig,
01325         pwszDnsName,
01326         pwszOldName,
01327         ppwszMachine,
01328         pfLocal);
01329     _JumpIfError(hr, error, "_IsConfigLocal");
01330
01331 error:
01332     if (NULL != pwszDnsName)
01333     {
01334   LocalFree(pwszDnsName);
01335     }
01336     if (NULL != pwszOldName)
01337     {
01338   LocalFree(pwszOldName);
01339     }
01340     return(hr);
01341 }
01342
01343
01344 HRESULT
01345 ceBuildPathAndExt(
01346     IN WCHAR const *pwszDir,
01347     IN WCHAR const *pwszFile,
01348     OPTIONAL IN WCHAR const *pwszExt,
01349     OUT WCHAR **ppwszPath)
01350 {
01351     HRESULT hr;
01352     WCHAR *pwsz;
01353     DWORD cwc;
01354
01355     *ppwszPath = NULL;
01356     cwc = wcslen(pwszDir) + 1 + wcslen(pwszFile) + 1;
01357     if (NULL != pwszExt)
01358     {
01359   cwc += wcslen(pwszExt);
01360     }
01361
01362     pwsz = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
01363     if (NULL == pwsz)
01364     {
01365   hr = E_OUTOFMEMORY;
01366   _JumpError(hr, error, "LocalAlloc");
01367     }
01368     wcscpy(pwsz, pwszDir);
01369     if (L'\\' != pwsz[wcslen(pwsz) - 1])
01370     {
01371   wcscat(pwsz, L"\\");
01372     }
01373     wcscat(pwsz, pwszFile);
01374     if (NULL != pwszExt)
01375     {
01376   wcscat(pwsz, pwszExt);
01377     }
01378     *ppwszPath = pwsz;
01379     hr = S_OK;
01380
01381 error:
01382     return(hr);
01383 }
01384
01385
01386 // Locale-independent case-ignore string compare
01387
01388 int
01389 celstrcmpiL(
01390     IN WCHAR const *pwsz1,
01391     IN WCHAR const *pwsz2)
01392 {
01393     // CSTR_LESS_THAN(1) - CSTR_EQUAL(2)    == -1 string 1 less than string 2
01394     // CSTR_EQUAL(2) - CSTR_EQUAL(2)        == 0 string 1 equal to string 2
01395     // CSTR_GREATER_THAN(3) - CSTR_EQUAL(2) == 1 string 1 greater than string 2
01396
01397     return(CompareString(
01398     LOCALE_INVARIANT,
01399     NORM_IGNORECASE,
01400     pwsz1,
01401     -1,
01402     pwsz2,
01403     -1) -
01404       CSTR_EQUAL);
01405 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Maze.h Source File

  • Multimedia
  • Gdi
  • GdiDemo

Maze.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012
00013 #ifdef WIN16
00014 #define APIENTRY FAR PASCAL
00015 typedef WORD WPARAM;
00016 //#else
00017 //typedef DWORD WPARAM;
00018 #endif
00019
00020
00021 #define MAZECLASS  "MAZEDEMO"
00022
00023
00024 typedef struct _MAZEDATA
00025 {
00026     int nMaze;
00027 } MAZEDATA;
00028 typedef MAZEDATA      *PMAZEDATA;
00029 typedef MAZEDATA NEAR *NPMAZEDATA;
00030 typedef MAZEDATA FAR  *LPMAZEDATA;
00031
00032
00033 /*
00034 ** MAZE WINDOW ROUTINES (maze.c)
00035 */
00036 HWND  FAR      CreateMazeWindow(HWND,int);
00037 LRESULT  CALLBACK MazeProc(HWND,UINT,WPARAM,LPARAM);
00038 BOOL           MazeCreateProc(HWND);
00039 VOID           MazeDestroyProc(HWND);
00040 BOOL           MazeCommandProc(HWND,WPARAM,LPARAM);
00041 VOID           MazePaintProc(HWND);
00042
00043
00044 VOID DrawMaze(HWND);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/HelloIsapi/HelloIsapi.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • HelloIsapi

HelloIsapi.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: HelloIsapi.cpp
00006
00007 Abstract:
00008
00009     A very simple ISAPI extension that demonstrates sending
00010     a basic response to an HTTP client.
00011
00012 Author:
00013
00014     ISAPI developer (Microsoft employee), October 2002
00015
00016 --*/
00017
00018 #ifndef _WIN32_WINNT
00019 #define _WIN32_WINNT 0x0500
00020 #endif
00021
00022 #include <stdio.h>
00023 #include <windows.h>
00024 #include <httpext.h>
00025
00026 //
00027 // Define a size for any CHAR arrays that we need
00028 //
00029
00030 #define STRING_SIZE 256
00031
00032 BOOL
00033 WINAPI
00034 GetExtensionVersion(
00035     HSE_VERSION_INFO *  pVer
00036     )
00037 /*++
00038
00039 Purpose:
00040
00041     Entry point for ISAPI extension initialization.  Required.
00042
00043     This function will be called exactly once in the lifetime
00044     of the extension, at initialization time.  This function is
00045     a useful point to do complex initialization tasks.  This
00046     function is called outside of the system loader lock, so
00047     it does not have the same restrictions as DllMain.
00048
00049 Arguments:
00050
00051     pVer - points to extension version info structure
00052
00053 Returns:
00054
00055     TRUE on success, FALSE on failure.
00056
00057     Note that in the case of FALSE, IIS will call GetLastError()
00058     and return an error page to the client.  The entity body of
00059     the page may be textual if the FormatMessage API can resolve
00060     it, or it may just be an error number if FormatMessage can't
00061     resolve it.
00062
00063 --*/
00064 {
00065     //
00066     // Tell IIS which version of ISAPI this extension was build from.
00067     //
00068
00069     pVer->dwExtensionVersion = MAKELONG( HSE_VERSION_MINOR,
00070                                          HSE_VERSION_MAJOR);
00071
00072     //
00073     // Report the description string for this extension.  Ensure
00074     // that it does not exceed the maximum length and is NULL
00075     // terminated.
00076     //
00077
00078     strncpy( pVer->lpszExtensionDesc,
00079              "HelloIsapi Sample Extension",
00080              HSE_MAX_EXT_DLL_NAME_LEN );
00081
00082     pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN-1] = '\0';
00083
00084     //
00085     // Return TRUE if we successfully initialized.
00086     //
00087
00088   return TRUE;
00089 }
00090
00091 DWORD
00092 WINAPI
00093 HttpExtensionProc(
00094     EXTENSION_CONTROL_BLOCK *   pecb
00095     )
00096 /*++
00097
00098 Purpose:
00099
00100     Entry point for ISAPI requests.  Required.
00101
00102     This function is called once per request.  The EXTENSION_CONTROL_BLOCK
00103     passed in contains information and function pointers sufficient to
00104     interact with the server during this processing.
00105
00106     Note that, once HttpExtensionProc is called, it is the responsibility
00107     of the extension to send back any data that the client should receive.
00108     IIS will not automatically generate any response, even in the case of
00109     HSE_STATUS_ERROR once the request has progressed to the point where
00110     this function is called.
00111
00112     Also note that you should not make any blocking calls or do long-running
00113     operations within this function.  To allow efficient scaling of your
00114     server, you should consider creating a pool of private threads to handle
00115     the requests.  In that case, the implementation of this function would
00116     be just to add the pecb to a queue and return HSE_STATUS_PENDING.  The
00117     threads in the pool would be responsible for dequeing a pecb and calling
00118     HSE_REQ_DONE_WITH_SESSION when they are finished processing it.
00119
00120 Arguments:
00121
00122     pecb - pointer to the extenstion control block
00123
00124 Returns:
00125
00126     HSE_STATUS_SUCCESS - Indicates successful request.
00127     HSE_STATUS_ERROR   - Indicates failed request.
00128     HSE_STATUS_PENDING - Indicates that processing of the request
00129                          should continue after this function returns.
00130                          It HSE_STATUS_PENDING is used, it is necessary
00131                          that HSE_REQ_DONE_WITH_SESSION is called
00132                          exactly once when processing is completed for
00133                          the request.
00134
00135 --*/
00136 {
00137     //
00138     // Create a simple, canned response
00139     //
00140
00141     CHAR    szResponse[] = "<html>\r\n"
00142                            "<head>\r\n"
00143                            "<title> HelloIsapi Sample Extension </title>\r\n"
00144                            "</head>\r\n"
00145                            "<h1> Hello ISAPI! </h1>\r\n"
00146                            "<hr>\r\n"
00147                            "This is a very simple ISAPI extension.";
00148
00149     //
00150     // Determine the size of the response.  Note that HTTP responses
00151     // are not necessarily NULL terminated, so we'll not include
00152     // the terminator in our size.
00153     //
00154
00155     DWORD   cbResponse = sizeof( szResponse ) - 1;
00156
00157     //
00158     // Create the optional headers that we need.  We'll include the
00159     // content-type, so the client knows to render the response as
00160     // HTML, and we'll also include a content-length.
00161     //
00162     // The inclusion of a content-length when using
00163     // HSE_REQ_SEND_RESPONSE_HEADER will allow IIS to honor keep-alive
00164     // if the client has requested it.  Without a content-length,
00165     // IIS will close the connection at the conculsion of this
00166     // response.
00167     //
00168
00169     CHAR    szHeaders[STRING_SIZE];
00170
00171     _snprintf( szHeaders,
00172                STRING_SIZE,
00173                "Content-Type: text/html\r\n"
00174                "Content-Length: %d\r\n\r\n",
00175                cbResponse );
00176
00177     //
00178     // Ensure that szHeaders buffer is NULL terminated in the case
00179     // where STRING_SIZE might have been insufficient to hold all
00180     // of the data.
00181     //
00182     // Note that this isn't strictly necessary for this particular
00183     // code, since we know that the headers will fit, and we won't
00184     // be calling any more string functions against szHeaders.
00185     // It is, however, a good practice to get into the habit of
00186     // protecting against any buffer overruns that result from some
00187     // later code assuming that this string is properly NULL
00188     // terminated.
00189     //
00190
00191     szHeaders[STRING_SIZE-1] = '\0';
00192
00193     //
00194     // Send back a 200 response, with the headers we've built
00195     //
00196
00197     pecb->ServerSupportFunction( pecb->ConnID,
00198                                  HSE_REQ_SEND_RESPONSE_HEADER,
00199                                  "200 OK",
00200                                  NULL,
00201                                  (DWORD*)szHeaders );
00202
00203     //
00204     // Send back the entity synchronously
00205     //
00206
00207     pecb->WriteClient( pecb->ConnID,
00208                        szResponse,
00209                        &cbResponse,
00210                        HSE_IO_SYNC );
00211
00212     //
00213     // All Done!
00214     //
00215
00216     return HSE_STATUS_SUCCESS;
00217 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCallBack Member List

This is the complete list of members for CCallBack, including all inherited members.
CallBack() | CCallBack |
CCallBack() | CCallBack | [inline]
DECLARE_AGGREGATABLE(CCallBack) | CCallBack |
DECLARE_GET_CONTROLLING_UNKNOWN() | CCallBack |
FinalConstruct() | CCallBack | [inline]
FinalRelease() | CCallBack | [inline]
m_pCallObjUnk | CCallBack |
MyQuery(REFIID riid, LPVOID *ppv) | CCallBack |
Reset() | CCallBack |
Signal() | CCallBack |
StartCall(int i, int j) | CCallBack |
Wait(DWORD flags, DWORD timeout) | CCallBack |
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmDebug/Resource.h Source File

  • Com
  • Services
  • Crm
  • CrmDebug

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by CrmDebug.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_CRMDEBUGCOMPENSATOR         101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Write/vc/Write.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Write
  • vc

Write.cpp

Go to the documentation of this file.
00001 // Write.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "stdio.h"
00006 #include "activeds.h"
00007
00008
00009 int main(int argc, char* argv[])
00010 {
00011   HRESULT hr;
00012   IADs *pADs=NULL;
00013   LPWSTR pszADsPath = L"LDAP://CN=Jane Johnson,OU=testOU,DC=testDom1,DC=testDom2,DC=microsoft,DC=com";
00014
00015   CoInitialize(NULL);
00016
00017   ///////////////////////////////////
00018   // Modifying attributes via IADs
00019   ////////////////////////////////////
00020   hr = ADsGetObject(pszADsPath,
00021                   IID_IADs,
00022                 (void**) &pADs );
00023
00024   if (!SUCCEEDED(hr) )
00025   {
00026     return hr;
00027   }
00028
00029   VARIANT var;
00030
00031
00032   // we omit checking result for brevity..
00033
00034   // First Name
00035   VariantInit(&var);
00036   V_BSTR(&var) = SysAllocString(L"Janet");
00037   V_VT(&var) = VT_BSTR;
00038   hr = pADs->Put( L"givenName", var );
00039
00040   // Last Name
00041   VariantClear(&var);
00042   V_BSTR(&var) = SysAllocString(L"Johns");
00043   V_VT(&var) = VT_BSTR;
00044   hr = pADs->Put( L"sn", var );
00045   VariantClear(&var);
00046
00047
00048   // Other Telephones
00049   LPWSTR pszPhones[] = { L"425 844 1234", L"425 924 4321" };
00050   DWORD dwNumber = sizeof( pszPhones ) /sizeof(LPWSTR);
00051
00052   hr = ADsBuildVarArrayStr( pszPhones, dwNumber, &var );
00053   hr = pADs->Put( L"otherTelephone", var );
00054   VariantClear(&var);
00055
00056   hr = pADs->SetInfo();
00057   pADs->Release();
00058
00059   if (!SUCCEEDED(hr) )
00060   {
00061
00062     return hr;
00063   }
00064
00065
00066
00067   /////////////////////////////////////////////////
00068   // Alternatively, you can use IDirectoryObject
00069   //////////////////////////////////////////////////
00070   IDirectoryObject *pDir=NULL;
00071   hr = ADsGetObject(pszADsPath,
00072                   IID_IDirectoryObject,
00073                 (void**) &pDir );
00074
00075   if ( !SUCCEEDED(hr) )
00076   {
00077     return hr;
00078   }
00079
00080
00081
00082   DWORD  dwReturn;
00083   ADSVALUE  snValue;
00084   ADSVALUE  fNameValue;
00085   ADSVALUE  phoneValue[2];
00086
00087   ADS_ATTR_INFO  attrInfo[] = {
00088     {L"givenName",ADS_ATTR_UPDATE, ADSTYPE_CASE_IGNORE_STRING,&snValue,1},
00089     {L"sn", ADS_ATTR_UPDATE, ADSTYPE_CASE_IGNORE_STRING,&fNameValue,1 },
00090     {L"otherTelephone", ADS_ATTR_UPDATE, ADSTYPE_CASE_IGNORE_STRING, phoneValue,2 }
00091                 };
00092   DWORD dwAttrs = sizeof(attrInfo)/sizeof(ADS_ATTR_INFO);
00093
00094   ///// First Name ///////////
00095   fNameValue.dwType=ADSTYPE_CASE_IGNORE_STRING;
00096   fNameValue.CaseIgnoreString = L"Janet";
00097
00098
00099   ///// Last Name ///////////
00100   snValue.dwType= ADSTYPE_CASE_IGNORE_STRING;
00101   snValue.CaseIgnoreString = L"Johns";
00102
00103   ///// Other Telephone ///////////
00104   phoneValue[0].dwType = ADSTYPE_CASE_IGNORE_STRING;
00105   phoneValue[0].CaseIgnoreString = L"425 844 1234";
00106
00107   phoneValue[1].dwType = ADSTYPE_CASE_IGNORE_STRING;
00108   phoneValue[1].CaseIgnoreString = L"425 924 4321";
00109
00110   hr = pDir->SetObjectAttributes(attrInfo, dwAttrs, &dwReturn);
00111
00112   pDir->Release();
00113
00114   if ( !SUCCEEDED(hr) )
00115   {
00116     return hr;
00117   }
00118
00119
00120
00121   CoUninitialize();
00122   return 0;
00123 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CADQIApp Member List

This is the complete list of members for CADQIApp, including all inherited members.
ADsOpenObject(LPWSTR pszPath, REFIID riid, void **pUnk) | CADQIApp |
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CADQIApp() | CADQIApp |
CAppLite(UINT nAppID) | CAppLite |
CWinApp() | CWinApp |
ExitInstance() | CWinApp | [virtual]
InitInstance() | CADQIApp | [virtual]
m_dwFlag | CADQIApp | [protected]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
m_sUserName | CADQIApp | [protected]
Run() | CAppLite | [virtual]
SetCredentials(LPCTSTR pszUserName, DWORD dwFlag) | CADQIApp |
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:55:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

StdAfx.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       StdAfx.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // stdafx.cpp : source file that includes just the standard includes
00012 //  stdafx.pch will be the pre-compiled header
00013 //  stdafx.obj will contain the pre-compiled type information
00014
00015 #include "stdafx.h"
00016
00017 #include <atlimpl.cpp>
00018
00019 HRESULT WINAPI CMyUIExtModule::UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister)
00020 {
00021   static const WCHAR szIPS32[] = _T("InprocServer32");
00022   static const WCHAR szCLSID[] = _T("CLSID");
00023
00024   HRESULT hRes = S_OK;
00025
00026   LPOLESTR lpOleStrCLSIDValue;
00027   ::StringFromCLSID(clsid, &lpOleStrCLSIDValue);
00028
00029   CRegKey key;
00030   if (bRegister)
00031   {
00032     LONG lRes = key.Open(HKEY_CLASSES_ROOT, szCLSID);
00033     if (lRes == ERROR_SUCCESS)
00034     {
00035       lRes = key.Create(key, lpOleStrCLSIDValue);
00036       if (lRes == ERROR_SUCCESS)
00037       {
00038         WCHAR szModule[_MAX_PATH];
00039         ::GetModuleFileName(m_hInst, szModule, _MAX_PATH);
00040         key.SetKeyValue(szIPS32, szModule);
00041       }
00042     }
00043     if (lRes != ERROR_SUCCESS)
00044       hRes = HRESULT_FROM_WIN32(lRes);
00045   }
00046   else
00047   {
00048     key.Attach(HKEY_CLASSES_ROOT);
00049     if (key.Open(key, szCLSID) == ERROR_SUCCESS)
00050       key.RecurseDeleteKey(lpOleStrCLSIDValue);
00051   }
00052   ::CoTaskMemFree(lpOleStrCLSIDValue);
00053   return hRes;
00054 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authorization/dbauth.idl Source File

  • Multimedia
  • WindowsMediaServices9
  • Authorization

dbauth.idl

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName: DBAuth.idl
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011 // This file will be processed by the MIDL tool to
00012 // produce the type library (DBAuth.tlb) and marshalling code.
00013
00014 cpp_quote("//+-------------------------------------------------------------------------")
00015 cpp_quote("//")
00016 cpp_quote("//  Microsoft Windows Media Technologies")
00017 cpp_quote("//  Copyright (C) Microsoft Corporation. All rights reserved.")
00018 cpp_quote("//")
00019 cpp_quote("//  Automatically generated by Midl from DBAuth.idl")
00020 cpp_quote("//")
00021 cpp_quote("//  DO NOT EDIT THIS FILE.")
00022 cpp_quote("//")
00023 cpp_quote("//--------------------------------------------------------------------------")
00024
00025 import "oaidl.idl";
00026 import "ocidl.idl";
00027
00028
00029 cpp_quote( "EXTERN_GUID( LIBID_DBAUTHPLUGINLib, 0x0BC95C01,0x9658,0x49B5,0xAC,0xA3,0xCB,0xEA,0x79,0xB0,0xDA,0xE6 );" )
00030 cpp_quote( "EXTERN_GUID( CLSID_DBAuthPlugin, 0xBC8F17A9,0xB5EB,0x47F0,0x96,0x12,0x34,0x72,0x5C,0x6C,0xFA,0x32 );" )
00031 cpp_quote( "EXTERN_GUID( CLSID_DBAuthAdmin, 0x13DDFC98,0xC330,0x4E1E,0xA7,0x22,0x62,0x4C,0x7E,0x50,0x79,0x85 );" )
00032 cpp_quote( "EXTERN_GUID( IID_IDBAuthAdmin, 0x5D5B4932,0x8BE0,0x4FDF,0xB7,0x3C,0x49,0x06,0x81,0x3D,0x0F,0xC3 );" )
00033
00034 [
00035   object,
00036   uuid(0DC5B85E-2BE9-42D2-BDF7-104F1FFB48C5),
00037   helpstring("IDBAuthPlugin Interface"),
00038   pointer_default(unique)
00039 ]
00040 interface IDBAuthPlugin : IUnknown
00041 {
00042 };
00043
00044 [
00045   object,
00046   uuid(5D5B4932-8BE0-4FDF-B73C-4906813D0FC3),
00047     dual,
00048     nonextensible,
00049   helpstring("IDBAuthAdmin Interface"),
00050   pointer_default(unique)
00051 ]
00052 interface IDBAuthAdmin : IDispatch
00053 {
00054     [helpstring("Add to allowed list of users")] HRESULT AddUser(BSTR bstrUserName);
00055     [helpstring("Remove from allowed list")] HRESULT RemoveUser(BSTR bstrUserName);
00056     [helpstring("Test to see if user is allowed access")] HRESULT VerifyUser(BSTR bstrUserName, [out, retval] VARIANT_BOOL *bFound);
00057     [helpstring("Get list of allowed users")] HRESULT GetUsers( [out, retval] BSTR *pbstrUserNames);
00058 };
00059
00060 [
00061   uuid(0BC95C01-9658-49B5-ACA3-CBEA79B0DAE6),
00062   version(9.0),
00063   helpstring("DBAuth 9.0 Type Library")
00064 ]
00065 library DBAUTHPLUGINLib
00066 {
00067   importlib("stdole32.tlb");
00068   importlib("stdole2.tlb");
00069
00070     interface IDBAuthAdmin;
00071 };
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HTTP_REQUEST_PARAM Member List

This is the complete list of members for HTTP_REQUEST_PARAM, including all inherited members.
cbStruct | HTTP_REQUEST_PARAM
cRanges | HTTP_REQUEST_PARAM
dwRequestCtx | HTTP_REQUEST_PARAM
pfnRequestCB | HTTP_REQUEST_PARAM
pRanges | HTTP_REQUEST_PARAM
pstUnlessModifiedSince | HTTP_REQUEST_PARAM
pszUrl | HTTP_REQUEST_PARAM
punkOuter | HTTP_REQUEST_PARAM
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/clUtil.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

clUtil.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CLUTIL.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018
00019 //****************************************************************************
00020 //
00021 // CLASS RefCount
00022 //
00023 //****************************************************************************
00024
00025
00026 //****************************************************************************
00027 //
00028 // Constructor/Destructor
00029 //
00030 //****************************************************************************
00031
00032 RefCount::RefCount(void)
00033 {
00034   OBJECT_MSG(TEXT("RefCount: [%08X] Created object"), this);
00035   m_cRef = 1;
00036 }
00037
00038
00039 RefCount::~RefCount(void)
00040 {
00041   OBJECT_MSG(TEXT("RefCount: [%08X] Destroying object with m_cRef=%d"), this, m_cRef);
00042 }
00043
00044
00045 //****************************************************************************
00046 //
00047 // Methods from IUnknown
00048 //
00049 //****************************************************************************
00050
00051 ULONG STDMETHODCALLTYPE RefCount::AddRef(void)
00052 {
00053    ASSERT(m_cRef >= 0);
00054
00055    InterlockedIncrement(&m_cRef);
00056
00057    return (ULONG) m_cRef;
00058 }
00059
00060
00061 ULONG STDMETHODCALLTYPE RefCount::Release(void)
00062 {
00063   if (0 == InterlockedDecrement(&m_cRef))
00064   {
00065     delete this;
00066     return 0;
00067   }
00068
00069   ASSERT(m_cRef > 0);
00070   return (ULONG) m_cRef;
00071 }
00072
00073
00074
00075 //****************************************************************************
00076 //
00077 // CLASS CNotify
00078 //
00079 //****************************************************************************
00080
00081
00082 //****************************************************************************
00083 //
00084 // Constructor/Destructor
00085 //
00086 //****************************************************************************
00087
00088 CNotify::CNotify() :
00089   m_pcnpcnt(NULL),
00090     m_pcnp(NULL),
00091     m_dwCookie(0),
00092     m_pUnk(NULL)
00093 {
00094 }
00095
00096 CNotify::~CNotify()
00097 {
00098   Disconnect(); // Make sure we're disconnected
00099   OBJECT_MSG(TEXT("CNotify: Destroying obj=%08X"), this);
00100 }
00101
00102
00103 //****************************************************************************
00104 //
00105 // HRESULT CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN)
00106 //
00107 //****************************************************************************
00108
00109 HRESULT CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN)
00110 {
00111   if  (NULL == pUnk)
00112     return E_POINTER;
00113
00114   HRESULT hr  = NO_ERROR;
00115
00116   ASSERT(0 == m_dwCookie);
00117   if  (0 != m_dwCookie)
00118   {
00119     WARN_MSG(TEXT("0 != m_dwCookie"));
00120     Disconnect();
00121   }
00122
00123   // Get the connection container
00124   hr = pUnk->QueryInterface(IID_IConnectionPointContainer, (void **)&m_pcnpcnt);
00125
00126   if (SUCCEEDED(hr))
00127   {
00128     if  (NULL == m_pcnpcnt)
00129       return E_FAIL;
00130
00131     // Find an appropriate connection point
00132     hr = m_pcnpcnt->FindConnectionPoint(riid, &m_pcnp);
00133     if (SUCCEEDED(hr))
00134     {
00135       ASSERT(NULL != m_pcnp);
00136       if  (NULL == m_pcnp)
00137       {
00138         m_pcnpcnt -> Release();
00139         m_pcnpcnt =  NULL;
00140         return E_FAIL;
00141       }
00142
00143       // Connect the sink object
00144       hr = m_pcnp->Advise((IUnknown *)pUnkN, &m_dwCookie);
00145     }
00146   }
00147
00148   if (FAILED(hr))
00149   {
00150     if  (NULL != m_pcnp)
00151     {
00152       m_pcnp -> Release();
00153       m_pcnp =  NULL;
00154     }
00155
00156     if  (NULL != m_pcnpcnt)
00157     {
00158       m_pcnpcnt -> Release();
00159       m_pcnpcnt =  NULL;
00160     }
00161
00162     m_dwCookie = 0;
00163   }
00164   else
00165   {
00166       OBJECT_MSG(TEXT("Connected for obj=%08X"), this);
00167       m_pUnk = pUnk;  // keep around for caller
00168     m_pUnk -> AddRef();
00169     }
00170
00171   return hr;
00172 }
00173
00174
00175 //****************************************************************************
00176 //
00177 // HRESULT CNotify::Disconnect (void)
00178 //
00179 //****************************************************************************
00180
00181 HRESULT CNotify::Disconnect (void)
00182 {
00183
00184     OBJECT_MSG(TEXT("Disconnecting for obj=%08X"), this);
00185
00186   // Disconnect the sink object
00187
00188   if  (NULL != m_pcnp)
00189   {
00190     if  (0 != m_dwCookie)
00191     {
00192           m_pcnp->Unadvise(m_dwCookie);
00193         m_dwCookie = 0;
00194     }
00195
00196         m_pcnp->Release();
00197       m_pcnp = NULL;
00198   }
00199
00200   if  (NULL != m_pcnpcnt)
00201   {
00202     m_pcnpcnt->Release();
00203     m_pcnpcnt = NULL;
00204   }
00205
00206   if  (NULL != m_pUnk)
00207   {
00208     m_pUnk -> Release();
00209       m_pUnk = NULL;
00210   }
00211
00212     return S_OK;
00213 }
00214
00215
00216 //****************************************************************************
00217 //
00218 // CLASS COBLIST
00219 //
00220 //****************************************************************************
00221
00222
00223 //****************************************************************************
00224 //
00225 // Destructor
00226 //
00227 //****************************************************************************
00228
00229 COBLIST::~COBLIST()
00230 {
00231     ASSERT(IsEmpty());
00232 }
00233
00234
00235 #ifdef DEBUG
00236 VOID* COBLIST::GetHead()
00237 {
00238   ASSERT(m_pHead);
00239   if  (NULL == m_pHead)
00240     return NULL;
00241
00242   return m_pHead->pItem;
00243 }
00244 #endif
00245
00246 VOID* COBLIST::GetTail()
00247 {
00248   ASSERT(m_pTail);
00249   if  (NULL == m_pTail)
00250     return NULL;
00251
00252   return m_pTail->pItem;
00253 }
00254
00255
00256 //****************************************************************************
00257 //
00258 // VOID* COBLIST::GetNext(POSITION& rPos)
00259 //
00260 //****************************************************************************
00261
00262 VOID* COBLIST::GetNext(POSITION& rPos)
00263 {
00264   ASSERT(rPos);
00265   if  (NULL == rPos)
00266     return NULL;
00267
00268   VOID* pReturn = rPos->pItem;
00269   rPos = rPos->pNext;
00270
00271   return pReturn;
00272 }
00273
00274
00275 //****************************************************************************
00276 //
00277 // VOID* COBLIST::RemoveAt(POSITION Pos)
00278 //
00279 //****************************************************************************
00280
00281 VOID* COBLIST::RemoveAt(POSITION Pos)
00282 {
00283   if  (NULL == Pos)
00284     return NULL;
00285
00286   VOID* pReturn = NULL;
00287
00288   if (m_pHead)
00289   {
00290     if (m_pHead == Pos)
00291     {
00292       // Removing the first element in the list
00293
00294       m_pHead = Pos->pNext;
00295       pReturn = Pos->pItem;
00296       delete Pos;
00297
00298       if (NULL == m_pHead)
00299       {
00300         // Removing the only element!
00301         m_pTail = NULL;
00302       }
00303     }
00304     else
00305     {
00306       POSITION pCur = m_pHead;
00307
00308       while (pCur && pCur->pNext)
00309       {
00310         if (pCur->pNext == Pos)
00311         {
00312           // Removing
00313
00314           pCur->pNext = Pos->pNext;
00315           if (m_pTail == Pos)
00316           {
00317             m_pTail = pCur;
00318           }
00319           pReturn = Pos->pItem;
00320           delete Pos;
00321           break;
00322         }
00323
00324         pCur = pCur->pNext;
00325       }
00326     }
00327   }
00328
00329   return pReturn;
00330 }
00331
00332
00333 //****************************************************************************
00334 //
00335 // POSITION COBLIST::AddTail(VOID* pItem)
00336 //
00337 //****************************************************************************
00338
00339 POSITION COBLIST::AddTail(VOID* pItem)
00340 {
00341   POSITION posRet = NULL;
00342
00343   if (m_pTail)
00344   {
00345     if (m_pTail->pNext = new COBNODE)
00346     {
00347       m_pTail = m_pTail->pNext;
00348       m_pTail->pItem = pItem;
00349       m_pTail->pNext = NULL;
00350     }
00351     else
00352       return NULL;
00353   }
00354   else
00355   {
00356     ASSERT(!m_pHead);
00357     if (m_pHead = new COBNODE)
00358     {
00359       m_pTail = m_pHead;
00360       m_pTail->pItem = pItem;
00361       m_pTail->pNext = NULL;
00362     }
00363   }
00364
00365   return m_pTail;
00366 }
00367
00368
00369 //****************************************************************************
00370 //
00371 // void COBLIST::EmptyList()
00372 //
00373 //****************************************************************************
00374
00375 void COBLIST::EmptyList()
00376 {
00377     while (!IsEmpty())
00378   {
00379         RemoveAt(GetHeadPosition());
00380     }
00381 }
00382
00383 #ifdef DEBUG
00384 VOID* COBLIST::RemoveTail()
00385 {
00386   ASSERT(m_pHead);
00387   ASSERT(m_pTail);
00388   if  ((NULL == m_pHead) || (NULL == m_pTail))
00389     return NULL;
00390
00391   return RemoveAt(m_pTail);
00392 }
00393
00394 VOID* COBLIST::RemoveHead()
00395 {
00396   ASSERT(m_pHead);
00397   ASSERT(m_pTail);
00398
00399   if  ((NULL == m_pHead) || (NULL == m_pTail))
00400     return NULL;
00401
00402   return RemoveAt(m_pHead);
00403 }
00404
00405 void * COBLIST::GetFromPosition(POSITION Pos)
00406 {
00407     void * Result = SafeGetFromPosition(Pos);
00408   ASSERT(Result);
00409   return Result;
00410 }
00411 #endif /* DEBUG */
00412
00413
00414 //****************************************************************************
00415 //
00416 // POSITION COBLIST::GetPosition(void* _pItem)
00417 //
00418 //****************************************************************************
00419
00420 POSITION COBLIST::GetPosition(void* _pItem)
00421 {
00422     POSITION    Position = m_pHead;
00423
00424     while (Position)
00425   {
00426         if (Position->pItem == _pItem)
00427     {
00428             break;
00429         }
00430     GetNext(Position);
00431     }
00432     return Position;
00433 }
00434
00435
00436 //****************************************************************************
00437 //
00438 // POSITION COBLIST::Lookup(void* pComparator)
00439 //
00440 //****************************************************************************
00441
00442 POSITION COBLIST::Lookup(void* pComparator)
00443 {
00444     POSITION    Position = m_pHead;
00445
00446     while (Position)
00447   {
00448         if (Compare(Position->pItem, pComparator))
00449     {
00450             break;
00451         }
00452     GetNext(Position);
00453     }
00454     return Position;
00455 }
00456
00457
00458 //****************************************************************************
00459 //
00460 // void * COBLIST::SafeGetFromPosition(POSITION Pos)
00461 //
00462 //****************************************************************************
00463
00464 void * COBLIST::SafeGetFromPosition(POSITION Pos)
00465 {
00466   // Safe way to validate that an entry is still in the list,
00467   // which ensures bugs that would reference deleted memory,
00468   // reference a NULL pointer instead
00469   // (e.g. an event handler fires late/twice).
00470   // Note that versioning on entries would provide an additional
00471   // safeguard against re-use of a position.
00472   // Walk list to find entry.
00473
00474   POSITION PosWork = m_pHead;
00475
00476   while (PosWork)
00477   {
00478     if (PosWork == Pos)
00479     {
00480       return Pos->pItem;
00481     }
00482     GetNext(PosWork);
00483   }
00484   return NULL;
00485 }
00486
00487 //****************************************************************************
00488 //
00489 // COBLIST Utility routines
00490 //
00491 //****************************************************************************
00492
00493
00494 //****************************************************************************
00495 //
00496 // POSITION AddNode(PVOID pv, COBLIST ** ppList)
00497 //
00498 // Add a node to a list.
00499 // Initializes the ObList, if necessary.
00500 // Returns the position in the list or NULL if there was a problem.
00501 //
00502 //****************************************************************************
00503
00504 POSITION AddNode(PVOID pv, COBLIST ** ppList)
00505 {
00506   ASSERT(NULL != ppList);
00507   if  (NULL == ppList)
00508     return NULL;
00509
00510   if (NULL == *ppList)
00511   {
00512     *ppList = new COBLIST();
00513     if (NULL == *ppList)
00514       return NULL;
00515   }
00516
00517   return (*ppList)->AddTail(pv);
00518 }
00519
00520
00521 //****************************************************************************
00522 //
00523 // PVOID RemoveNode(POSITION * pPos, COBLIST *pList)
00524 //
00525 // Remove a node from a list.
00526 // Sets pPos to NULL
00527 //
00528 //****************************************************************************
00529
00530 PVOID RemoveNode(POSITION * pPos, COBLIST *pList)
00531 {
00532   if ((NULL == pList) || (NULL == pPos))
00533     return NULL;
00534
00535   PVOID pv = pList->RemoveAt(*pPos);
00536   *pPos = NULL;
00537   return pv;
00538 }
00539
00540
00541 //****************************************************************************
00542 //
00543 // CLASS BSTRING
00544 //
00545 //****************************************************************************
00546
00547
00548 //****************************************************************************
00549 //
00550 // Constructor
00551 //
00552 // We don't support construction from an ANSI string in the Unicode build.
00553 //
00554 //****************************************************************************
00555
00556 #if !defined(UNICODE)
00557
00558 BSTRING::BSTRING(LPCSTR lpcString)
00559 {
00560   m_bstr = NULL;
00561
00562   // Compute the length of the required BSTR, including the null
00563   int cWC =  MultiByteToWideChar(CP_ACP, 0, lpcString, -1, NULL, 0);
00564   if (cWC <= 0)
00565     return;
00566
00567   // Allocate the BSTR, including the null
00568   m_bstr = SysAllocStringLen(NULL, cWC); // SysAllocStringLen adds another 1
00569
00570   ASSERT(NULL != m_bstr);
00571   if (NULL == m_bstr)
00572     return;
00573
00574   ZeroMemory(m_bstr, (cWC + 1) * sizeof(OLECHAR));
00575
00576   // Copy the string
00577   MultiByteToWideChar(CP_ACP, 0, lpcString, -1, (LPWSTR) m_bstr, cWC);
00578 }
00579
00580 #endif // !defined(UNICODE)
00581
00582
00583 //****************************************************************************
00584 //
00585 // CLASS BTSTR
00586 //
00587 //****************************************************************************
00588
00589 BTSTR::BTSTR(BSTR bstr)
00590 {
00591   m_psz = PszFromBstr(bstr);
00592 }
00593
00594 BTSTR::~BTSTR()
00595 {
00596   if (NULL != m_psz)
00597     LocalFree(m_psz);
00598 }
00599
00600 LPTSTR PszFromBstr(BSTR bstr)
00601 {
00602   if (NULL == bstr)
00603     return NULL;
00604   int cch =  WideCharToMultiByte(CP_ACP, 0, (LPWSTR)bstr, -1, NULL, 0, NULL, NULL);
00605   if (cch <= 0)
00606     return NULL;
00607
00608   LPTSTR psz = PszAlloc(cch);
00609   if (NULL == psz)
00610     return NULL;
00611
00612   ZeroMemory(psz, (cch + 1) * sizeof(TCHAR));
00613
00614   WideCharToMultiByte(CP_ACP, 0, (LPWSTR)bstr, -1, psz, cch, NULL, NULL);
00615   return psz;
00616 }
00617
00618
00619 DWORD GetRegDWORD(HKEY hkRoot, LPCTSTR szSubKey, LPCTSTR szValName, DWORD dwDefault)
00620 {
00621   DWORD dwRet = dwDefault;
00622
00623   HKEY hKey = 0;
00624   LONG l    = ::RegOpenKeyEx(hkRoot, szSubKey, 0, KEY_QUERY_VALUE, &hKey);
00625
00626   if(ERROR_SUCCESS == l)
00627   {
00628     DWORD dwType = REG_BINARY;
00629     DWORD dwSize = sizeof(DWORD);
00630
00631     if  (ERROR_SUCCESS != ::RegQueryValueEx(hKey, szValName, 0, &dwType, (LPBYTE) &dwRet, &dwSize))
00632     {
00633       dwRet = dwDefault;
00634     }
00635
00636     RegCloseKey(hKey);
00637   }
00638
00639   return dwRet;
00640 }
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/heap.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

heap.Cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "Data.h"
00003 #include "Entity.h"
00004 #include "Resultset.h"
00005
00006 // Since heap work in a multi-threaded and in particular multi-processor
00007 // situation is very sensitive in terms of serialisation.
00008 // The heap work that reflects the use of the C++ new/delete operators has
00009 // been separated into this implementation file.
00010
00011 // Also a fixed allocator system has been implemented to provide a reduced
00012 // heap access mechanism for frequently allocated objects.
00013
00014
00015 HANDLE g_hGeneralHeap = HeapCreate(0, sizeof(CResultset) * 5, 0);
00016
00017 void* __cdecl operator new(size_t nSize)
00018 {
00019   return HeapAlloc(g_hGeneralHeap, 0, nSize);
00020 }
00021
00022 void __cdecl operator delete(void* p)
00023 {
00024   HeapFree(g_hGeneralHeap, 0, p);
00025 }
00026
00027 // This is the MFC fixed allocator implementation.
00028
00029 CFixedAlloc::CFixedAlloc(UINT nAllocSize, UINT nBlockSize)
00030 {
00031   m_nAllocSize = nAllocSize;
00032   m_nBlockSize = nBlockSize;
00033   m_pNodeFree = NULL;
00034   m_pBlocks = NULL;
00035   InitializeCriticalSection(&m_protect);
00036 }
00037
00038 CFixedAlloc::~CFixedAlloc()
00039 {
00040   FreeAll();
00041   DeleteCriticalSection(&m_protect);
00042 }
00043
00044 void CFixedAlloc::FreeAll()
00045 {
00046   EnterCriticalSection(&m_protect);
00047   m_pBlocks->FreeDataChain();
00048   m_pBlocks = NULL;
00049   m_pNodeFree = NULL;
00050   LeaveCriticalSection(&m_protect);
00051 }
00052
00053
00054 ///////////////////////////////////////////////////////////////////////////
00055
00056
00057 CPlex* PASCAL CPlex::Create(CPlex*& pHead, UINT nMax, UINT cbElement)
00058 {
00059   CPlex* p = (CPlex*) new BYTE[sizeof(CPlex) + nMax * cbElement];
00060       // may throw exception
00061   p->pNext = pHead;
00062   pHead = p;  // change head (adds in reverse order for simplicity)
00063   return p;
00064 }
00065
00066 void CPlex::FreeDataChain()     // free this one and links
00067 {
00068   CPlex* p = this;
00069   while (p != NULL)
00070   {
00071     BYTE* bytes = (BYTE*) p;
00072     CPlex* pNext = p->pNext;
00073     delete[] bytes;
00074     p = pNext;
00075   }
00076 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/DumpVars/DumpVars.cpp Source File

  • Web
  • iis
  • extensions
  • DumpVars

DumpVars.cpp

Go to the documentation of this file.
00001 //  Copyright (c) 1997-2002  Microsoft Corporation
00002 //
00003 //  Module Name:
00004 //
00005 //    DumpVars.cpp
00006 //
00007 //  Abstract:
00008 //
00009 //    ISAPI Extension sample to dump server variables
00010
00011 #define WIN32_LEAN_AND_MEAN
00012 #include <windows.h>
00013 #include <httpext.h>
00014
00015 #define VAR_BUFFER_SIZE 1024  // Buffer size for server variables
00016
00017 //  Description:
00018 //
00019 //    Use WriteClient() function to dump the value of each server variable in the table.
00020 //
00021 //  Arguments:
00022 //
00023 //    pECB - pointer to the extenstion control block
00024 //
00025 //  Returns:
00026 //
00027 //    HSE_STATUS_SUCCESS
00028
00029 DWORD WINAPI HttpExtensionProc(IN EXTENSION_CONTROL_BLOCK *pECB)
00030 {
00031   char *aszServerVariables[] = {
00032     "APPL_MD_PATH", "APPL_PHYSICAL_PATH", "AUTH_PASSWORD",
00033     "AUTH_TYPE", "AUTH_USER", "CERT_COOKIE", "CERT_FLAGS",
00034     "CERT_ISSUER", "CERT_KEYSIZE", "CERT_SECRETKEYSIZE",
00035     "CERT_SERIALNUMBER", "CERT_SERVER_ISSUER",
00036     "CERT_SERVER_SUBJECT", "CERT_SUBJECT", "CONTENT_LENGTH",
00037     "CONTENT_TYPE", "HTTP_ACCEPT", "HTTPS", "HTTPS_KEYSIZE",
00038     "HTTPS_SECRETKEYSIZE", "HTTPS_SERVER_ISSUER",
00039     "HTTPS_SERVER_SUBJECT", "INSTANCE_ID", "INSTANCE_META_PATH",
00040     "PATH_INFO", "PATH_TRANSLATED", "QUERY_STRING",
00041     "REMOTE_ADDR", "REMOTE_HOST", "REMOTE_USER",
00042     "REQUEST_METHOD", "SCRIPT_NAME", "SERVER_NAME",
00043     "SERVER_PORT", "SERVER_PORT_SECURE", "SERVER_PROTOCOL",
00044     "SERVER_SOFTWARE", "URL"};
00045
00046   DWORD dwBuffSize;
00047   DWORD dwError;
00048
00049   HSE_SEND_HEADER_EX_INFO HeaderExInfo;
00050
00051   // Send headers to the client
00052
00053   HeaderExInfo.pszStatus = "200 OK";
00054   HeaderExInfo.pszHeader = "Content-type: text/html\r\n\r\n";
00055   HeaderExInfo.cchStatus = strlen(HeaderExInfo.pszStatus);
00056   HeaderExInfo.cchHeader = strlen(HeaderExInfo.pszHeader);
00057   HeaderExInfo.fKeepConn = FALSE;
00058
00059   pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &HeaderExInfo, NULL, NULL);
00060
00061   // Begin sending back HTML to the client
00062
00063   char szHeader[] = "<HTML>\r\n<BODY><h1>Server Variable Dump</h1>\r\n<hr>\r\n";
00064
00065   dwBuffSize = strlen(szHeader);
00066
00067   pECB->WriteClient(pECB->ConnID, szHeader, &dwBuffSize, 0);
00068
00069   DWORD dwNumVars = (sizeof aszServerVariables ) / (sizeof aszServerVariables[0]);
00070
00071   // Get the server variables and send them
00072
00073   for (DWORD x = 0; x < dwNumVars; x++) {
00074
00075     dwBuffSize = VAR_BUFFER_SIZE;
00076
00077     char szValue[VAR_BUFFER_SIZE] = "";
00078
00079     if (!pECB->GetServerVariable(pECB->ConnID, aszServerVariables[x], szValue, &dwBuffSize)) {
00080
00081       // Analyze the problem and report result to user
00082
00083       switch (dwError = GetLastError( )) {
00084
00085         case ERROR_INVALID_PARAMETER :
00086
00087           strcpy(szValue, "ERROR_INVALID_PARAMETER");
00088
00089           break;
00090
00091         case ERROR_INVALID_INDEX :
00092
00093           strcpy(szValue, "ERROR_INVALID_INDEX");
00094
00095           break;
00096
00097         case ERROR_INSUFFICIENT_BUFFER :
00098
00099           wsprintf(szValue, "ERROR_INSUFFICIENT_BUFFER - %d bytes required.", dwBuffSize);
00100
00101           break;
00102
00103         case ERROR_MORE_DATA :
00104
00105           strcpy(szValue, "ERROR_MORE_DATA");
00106
00107           break;
00108
00109         case ERROR_NO_DATA :
00110
00111           strcpy(szValue, "ERROR_NO_DATA");
00112
00113           break;
00114
00115         default :
00116
00117           wsprintf(szValue, "*** Error %d occured retrieving server variable ***", dwError);
00118
00119           break;
00120       }
00121     }
00122
00123     // Dump server variable name and value. Note that the buffer size for this output
00124     // is much more than is needed. In a production environment, a dynamically-allocated
00125     // buffer, properly sized, would make more sense.
00126
00127     char szOutput[VAR_BUFFER_SIZE * 2];
00128
00129     wsprintf(szOutput, "%s: %s<br>\r\n", aszServerVariables[x], szValue);
00130
00131     dwBuffSize = strlen(szOutput);
00132
00133     // Send the line to client
00134
00135     pECB->WriteClient(pECB->ConnID, szOutput, &dwBuffSize, 0);
00136   }
00137
00138   // End HTML page
00139
00140   char szFooter[] = "</BODY>\r\n</HTML>\r\n\r\n";
00141
00142   dwBuffSize = strlen(szFooter);
00143
00144   pECB->WriteClient(pECB->ConnID, szFooter, &dwBuffSize, 0);
00145
00146   return HSE_STATUS_SUCCESS;
00147 }
00148
00149 //  Description:
00150 //
00151 //    This is required ISAPI Extension DLL entry point.
00152 //
00153 //  Arguments:
00154 //
00155 //    pVer - poins to extension version info structure
00156 //
00157 //  Returns:
00158 //
00159 //    always returns TRUE
00160
00161 BOOL WINAPI GetExtensionVersion(OUT HSE_VERSION_INFO *pVer)
00162 {
00163   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00164
00165   lstrcpyn(pVer->lpszExtensionDesc, "DumpVars ISAPI Sample", HSE_MAX_EXT_DLL_NAME_LEN);
00166
00167   return TRUE;
00168 }
00169
00170 //  Description:
00171 //
00172 //    This function is called when the WWW service is shutdown
00173 //
00174 //  Arguments:
00175 //
00176 //    dwFlags - HSE_TERM_ADVISORY_UNLOAD or HSE_TERM_MUST_UNLOAD
00177 //
00178 //  Returns:
00179 //
00180 //    TRUE if extension is ready to be unloaded, FALSE otherwise
00181
00182 BOOL WINAPI TerminateExtension(IN DWORD dwFlags)
00183 {
00184   return TRUE;
00185 }
00186
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/staticmap.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

staticmap.h

Go to the documentation of this file.
00001 // intended for small number strings
00002 class CStaticMap
00003 {
00004 public:
00005   int m_nSize;
00006   mutable CString* m_aKey;
00007
00008 // Construction/destruction
00009   CStaticMap() : m_nSize(0)
00010   {
00011     m_aKey = NULL;
00012   }
00013
00014   void ClearArray()
00015   {
00016     if (m_aKey != NULL)
00017     {
00018       delete [] m_aKey;
00019       m_aKey = NULL;
00020     }
00021   }
00022
00023   ~CStaticMap()
00024   {
00025     RemoveAll();
00026     ClearArray();
00027   }
00028
00029   void Initialize(long Size)
00030   {
00031     ClearArray();
00032
00033     m_aKey = new CString[Size + 1];
00034   }
00035
00036 // Operations
00037   int GetSize() const
00038   {
00039     return m_nSize;
00040   }
00041   BOOL Add(LPCWSTR key, long len, long val)
00042   {
00043     if (val >= m_nSize)
00044     {
00045       m_nSize = val+1;
00046     }
00047     SetAtIndex(val, key, len);
00048     return TRUE;
00049   }
00050   BOOL AddNoLen(LPCWSTR key, long val)
00051   {
00052     if (val >= m_nSize)
00053     {
00054       m_nSize = val+1;
00055     }
00056     SetAtIndexNoLen(val, key);
00057     return TRUE;
00058   }
00059   void RemoveAll()
00060   {
00061     m_nSize = 0;
00062   }
00063   long Lookup(LPCWSTR key) const
00064   {
00065     int nIndex = FindKey(key);
00066     return nIndex;
00067   }
00068   BOOL SetKey(long val, WCHAR* key) const
00069   {
00070     m_aKey[val] = key;
00071     return TRUE;
00072   }
00073
00074 // Implementation
00075
00076   void SetAtIndexNoLen(int nIndex, LPCWSTR key)
00077   {
00078     ATLASSERT(nIndex >= 0 && nIndex < m_nSize);
00079     m_aKey[nIndex] = key;
00080   }
00081
00082   void SetAtIndex(int nIndex, LPCWSTR key, long len)
00083   {
00084     ATLASSERT(nIndex >= 0 && nIndex < m_nSize);
00085
00086     m_aKey[nIndex].AssignCopy(len, key);
00087   }
00088   int FindKey(LPCWSTR key) const
00089   {
00090     for(int i = 0; i < m_nSize; i++)
00091     {
00092       if(m_aKey[i] == key)
00093         return i;
00094     }
00095     return -1;  // not found
00096   }
00097 };
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/tpriv.h Source File

  • Begin
  • sdkdiff

tpriv.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010 #ifndef __TPRIV_H__
00011 #define __TPRIV_H__
00012 /*
00013  * tpriv.h
00014  *
00015  * data structures used internally by table class.
00016  *
00017  * include after table.h
00018  */
00019
00020
00021 #ifndef abs
00022 #define abs(x)  (((x) > 0)? (x) : -(x))
00023 #endif
00024
00025 /*  one of these per visible line */
00026 typedef struct {
00027         CellPos linepos;        /* posn and clipping info for line */
00028
00029         lpCellData pdata;       /* array of CellData structs for all cells */
00030 } LineData, *lpLineData;
00031
00032
00033 /* master info struct pointed to by window extra bytes */
00034
00035 typedef struct {
00036         /* table info */
00037         TableHdr        hdr;            /* main hdr info from owner */
00038         lpColProps      pcolhdr;        /* ptr to array of phdr->ncols hdrs */
00039
00040         /* window info */
00041         int     avewidth;       /* font ave width - for default cell sizing */
00042         int     rowheight;      /* height of one row */
00043         int     rowwidth;       /* total width of one row in pixels */
00044         int     winwidth;       /* width of window */
00045         int     nlines;         /* actual lines currently visible */
00046
00047         lpCellPos pcellpos;     /* array of cell position structs */
00048
00049         /* scroll settings */
00050         long    scrollscale;    /* scaling factor (force 16-bit range) */
00051         long    toprow;         /* 0-based rownr of top moveable line */
00052         int     scroll_dx;      /* horz scroll posn in pixels. */
00053
00054         /* column data */
00055         lpLineData pdata;       /* ptr to array of nlines of LineData */
00056
00057         /* selection/dragging */
00058         UINT    trackmode;      /* current mouse-tracking mode */
00059         int     tracknr;        /* col or row being resized */
00060         int     trackline1;     /* currently drawn track lines */
00061         int     trackline2;
00062         BOOL    selvisible;     /* used during mouse-down: T if sel drawn */
00063         TableSelection select;
00064
00065         // tab expansion
00066         int     tabchars;
00067
00068         // show whitespace chars
00069         BOOL    show_whitespace;
00070
00071 } Table, *lpTable;
00072
00073 /* trackmode constants */
00074 #define TRACK_NONE              0
00075 #define TRACK_COLUMN            1
00076 #define TRACK_CELL              2
00077
00078 /* private flags in CellData struct */
00079 #define CELL_VALID      1
00080
00081 /* window extra bytes are used to hold the owner, heap and Table structs */
00082 #define WW_OWNER        0                               /* HWND of owner */
00083 #define WW_HEAP         (WW_OWNER + sizeof(HWND))       /* gmem heap */
00084 #define WL_TABLE        (WW_HEAP + sizeof(HANDLE))      /* lpTable */
00085 #define WLTOTAL         (WL_TABLE + sizeof(lpTable))    /* total extra bytes */
00086
00087 /* ---------- global data -------------------*/
00088
00089 extern HPEN hpenDotted;         /* in table.c */
00090 extern HANDLE hVertCurs;        /* in table.c */
00091 extern HANDLE hNormCurs;        /* in table.c */
00092
00093 /*------function prototypes ---------------------------------------*/
00094
00095 /* in table.cpp */
00096
00097 void gtab_init(void);    /* called from DLL startup function */
00098 INT_PTR gtab_sendtq(HWND hwnd, UINT cmd, LPARAM lParam);
00099 void gtab_invallines(HWND hwnd, lpTable ptab, int start, int count);
00100 void gtab_setsize(HWND hwnd, lpTable ptab);
00101 void gtab_calcwidths(HWND hwnd, lpTable ptab);
00102 void gtab_deltable(HWND hwnd, lpTable ptab);
00103 BOOL gtab_alloclinedata(HWND hwnd, lpTable ptab);
00104
00105 /* in tpaint.cpp */
00106 void gtab_paint(HWND hwnd);
00107 void gtab_paintline(HWND hwnd, HDC hdc, lpTable ptab, int line, BOOL show_whitespace, BOOL fPrinting);
00108 void gtab_paintunused(HWND hwnd, HDC hdc, lpTable ptab, int y);
00109 void gtab_vsep(HWND hwnd, lpTable ptab, HDC hdc);
00110 void gtab_hsep(HWND hwnd, lpTable ptab, HDC hdc);
00111 void gtab_invertsel(HWND hwnd, lpTable ptab, HDC hdc_in);
00112 void gtab_drawvertline(HWND hwnd, lpTable ptab);
00113
00114 /* in tscroll.cpp */
00115 void gtab_dovscroll(HWND hwnd, lpTable ptab, long change);
00116 void gtab_dohscroll(HWND hwnd, lpTable ptab, long change);
00117 long gtab_linetorow(HWND hwnd, lpTable ptab, int line);
00118 int gtab_rowtoline(HWND hwnd, lpTable ptab, long row);
00119 void gtab_msg_vscroll(HWND hwnd, lpTable ptab, int opcode, int pos);
00120 void gtab_msg_hscroll(HWND hwnd, lpTable ptab, int opcode, int pos);
00121 void gtab_select(HWND hwnd, lpTable ptab, long row, long col, long nrows, long ncells, BOOL bNotify);
00122 void gtab_enter(HWND hwnd, lpTable ptab, long row, long col, long nrows, long ncells);
00123 void gtab_press(HWND hwnd, lpTable ptab, int x, int y);
00124 void gtab_rightclick(HWND hwnd, lpTable ptab, int x, int y);
00125 void gtab_release(HWND hwnd, lpTable ptab, int x, int y);
00126 void gtab_move(HWND hwnd, lpTable ptab, int x, int y);
00127 void gtab_dblclick(HWND hwnd, lpTable ptab, int x, int y);
00128 void gtab_showsel(HWND hwnd, lpTable ptab, BOOL bToBottom);
00129 void gtab_showsel_middle(HWND hwnd, lpTable ptab, long dyRowsFromTop);
00130 int gtab_key(HWND hwnd, lpTable ptab, int vkey);
00131 int gtab_mousewheel(HWND hwnd, lpTable ptab, DWORD fwKeys, int zDelta);
00132
00133 /* in tprint.cpp */
00134 BOOL gtab_print(HWND hwnd, lpTable ptab, lpPrintContext pcontext);
00135 void gtab_boxcell(HWND hwnd, HDC hdc, LPRECT rcp, LPRECT pclip, UINT boxmode);
00136 #endif
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIGetDataSource Member List

This is the complete list of members for CImpIGetDataSource, including all inherited members.
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDBSession, CImpIGetDataSource) | CImpIGetDataSource
GetDataSource(REFIID, IUnknown **) | CImpIGetDataSource
Generated on Wed Nov 13 2024 16:56:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IAppletNotifyVtbl Member List

This is the complete list of members for IAppletNotifyVtbl, including all inherited members.
aDynamicChannels | IAppletNotifyVtbl
cDynamicChannels | IAppletNotifyVtbl
eidMyself | IAppletNotifyVtbl
fPermissionGranted | IAppletNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(IAppletNotify __RPC_FAR *This | IAppletNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *PermitToJoinSessionIndication)(IAppletNotify __RPC_FAR *This | IAppletNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *AutoJoinSessionIndication)(IAppletNotify __RPC_FAR *This | IAppletNotifyVtbl
hrResult | IAppletNotifyVtbl
nConfID | IAppletNotifyVtbl
nidMyself | IAppletNotifyVtbl
ppvObject | IAppletNotifyVtbl
pSession | IAppletNotifyVtbl
riid | IAppletNotifyVtbl
sidMyself | IAppletNotifyVtbl
uidMyself | IAppletNotifyVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(IAppletNotify __RPC_FAR *This) | IAppletNotifyVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(IAppletNotify __RPC_FAR *This) | IAppletNotifyVtbl
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/iocs.Cpp Source File

  • Com
  • Fundamentals
  • SimpDnd

iocs.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: IOCS.CPP
00003 //
00004 //      Implementation file for COleClientSite
00005 //
00006 // Functions:
00007 //
00008 //      See IOCS.H for class definition
00009 //
00010 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "iocs.h"
00015 #include "ias.h"
00016 #include "app.h"
00017 #include "site.h"
00018 #include "doc.h"
00019
00020
00021 //**********************************************************************
00022 //
00023 // COleClientSite::QueryInterface
00024 //
00025 // Purpose:
00026 //
00027 //      Used for interface negotiation at this interface
00028 //
00029 // Parameters:
00030 //
00031 //      REFIID riid         -   A reference to the interface that is
00032 //                              being queried.
00033 //
00034 //      LPVOID FAR* ppvObj  -   An out parameter to return a pointer to
00035 //                              the interface.
00036 //
00037 // Return Value:
00038 //
00039 //      S_OK                -   The interface is supported.
00040 //      E_NOINTERFACE       -   The interface is not supported
00041 //
00042 // Function Calls:
00043 //      Function                    Location
00044 //
00045 //      OutputDebugString           Windows API
00046 //      CSimpleSite::QueryInterface SITE.CPP
00047 //
00048 // Comments:
00049 //
00050 //********************************************************************
00051
00052 STDMETHODIMP COleClientSite::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
00053 {
00054   OutputDebugString("In IOCS::QueryInterface\r\n");
00055
00056   // delegate to the container Site
00057   return m_pSite->QueryInterface(riid, ppvObj);
00058 }
00059
00060 //**********************************************************************
00061 //
00062 // CSimpleApp::AddRef
00063 //
00064 // Purpose:
00065 //
00066 //      Adds to the reference count at the interface level.
00067 //
00068 // Parameters:
00069 //
00070 //      None
00071 //
00072 // Return Value:
00073 //
00074 //      ULONG   -   The new reference count of the interface
00075 //
00076 // Function Calls:
00077 //      Function                    Location
00078 //
00079 //      OutputDebugString           Windows API
00080 //
00081 // Comments:
00082 //
00083 //********************************************************************
00084
00085 STDMETHODIMP_(ULONG) COleClientSite::AddRef()
00086 {
00087   OutputDebugString("In IOCS::AddRef\r\n");
00088
00089   // increment the interface reference count (for debugging only)
00090   ++m_nCount;
00091
00092   // delegate to the container Site
00093   return m_pSite->AddRef();
00094 }
00095
00096
00097 //**********************************************************************
00098 //
00099 // CSimpleApp::Release
00100 //
00101 // Purpose:
00102 //
00103 //      Decrements the reference count at this level
00104 //
00105 // Parameters:
00106 //
00107 //      None
00108 //
00109 // Return Value:
00110 //
00111 //      ULONG   -   The new reference count of the interface.
00112 //
00113 // Function Calls:
00114 //      Function                    Location
00115 //
00116 //      OutputDebugString           Windows API
00117 //
00118 // Comments:
00119 //
00120 //********************************************************************
00121
00122 STDMETHODIMP_(ULONG) COleClientSite::Release()
00123 {
00124   OutputDebugString("In IOCS::Release\r\n");
00125
00126   // decrement the interface reference count (for debugging only)
00127   --m_nCount;
00128
00129   // delegate to the container Site
00130   return m_pSite->Release();
00131 }
00132
00133 //**********************************************************************
00134 //
00135 // COleClientSite::SaveObject
00136 //
00137 // Purpose:
00138 //
00139 //      Called by the object when it wants to be saved to persistant
00140 //      storage
00141 //
00142 // Parameters:
00143 //
00144 //      None
00145 //
00146 // Return Value:
00147 //
00148 //      S_OK
00149 //
00150 // Function Calls:
00151 //      Function                            Location
00152 //
00153 //      OutputDebugString                   Windows API
00154 //      IOleObject::QueryInterface          Object
00155 //      IPersistStorage::SaveCompleted      Object
00156 //      IPersistStorage::Release            Object
00157 //      OleSave                             OLE API
00158 //                           OLE API
00159 //
00160 // Comments:
00161 //
00162 //********************************************************************
00163
00164 STDMETHODIMP COleClientSite::SaveObject()
00165 {
00166   LPPERSISTSTORAGE lpPS;
00167   SCODE sc = E_FAIL;
00168
00169   OutputDebugString("In IOCS::SaveObject\r\n");
00170
00171   // get a pointer to IPersistStorage
00172   HRESULT hErr = m_pSite->m_lpOleObject->QueryInterface(IID_IPersistStorage, (LPVOID FAR *)&lpPS);
00173
00174   // save the object
00175   if (hErr == NOERROR)
00176     {
00177     sc =  OleSave(lpPS, m_pSite->m_lpObjStorage, TRUE) ;
00178     lpPS->SaveCompleted(NULL);
00179     lpPS->Release();
00180     }
00181
00182   return sc;
00183 }
00184
00185 //**********************************************************************
00186 //
00187 // COleClientSite::GetMoniker
00188 //
00189 // Purpose:
00190 //
00191 //      Not Implemented
00192 //
00193 // Parameters:
00194 //
00195 //      Not Implemented
00196 //
00197 // Return Value:
00198 //
00199 // Function Calls:
00200 //      Function                    Location
00201 //
00202 //      OutputDebugString           Windows API
00203 //
00204 // Comments:
00205 //
00206 //      This function is not implemented because we don't support
00207 //      linking.
00208 //
00209 //********************************************************************
00210
00211 STDMETHODIMP COleClientSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER FAR* ppmk)
00212 {
00213   OutputDebugString("In IOCS::GetMoniker\r\n");
00214
00215   // need to null the out pointer
00216   *ppmk = NULL;
00217
00218   return E_NOTIMPL;
00219 }
00220
00221 //**********************************************************************
00222 //
00223 // COleClientSite::GetContainer
00224 //
00225 // Purpose:
00226 //
00227 //      Not Implemented
00228 //
00229 // Parameters:
00230 //
00231 //      Not Implemented
00232 //
00233 // Return Value:
00234 //
00235 //      Not Implemented
00236 //
00237 // Function Calls:
00238 //      Function                    Location
00239 //
00240 //      OutputDebugString           Windows API
00241 //
00242 // Comments:
00243 //
00244 //      Not Implemented
00245 //
00246 //********************************************************************
00247
00248 STDMETHODIMP COleClientSite::GetContainer(LPOLECONTAINER FAR* ppContainer)
00249 {
00250   OutputDebugString("In IOCS::GetContainer\r\n");
00251
00252   // NULL the out pointer
00253   *ppContainer = NULL;
00254
00255   return E_NOTIMPL;
00256 }
00257
00258 //**********************************************************************
00259 //
00260 // COleClientSite::ShowObject
00261 //
00262 // Purpose:
00263 //
00264 //      Not Implemented
00265 //
00266 // Parameters:
00267 //
00268 //      Not Implemented
00269 //
00270 // Return Value:
00271 //
00272 //      Not Implemented
00273 //
00274 // Function Calls:
00275 //      Function                    Location
00276 //
00277 //      OutputDebugString           Windows API
00278 //
00279 // Comments:
00280 //
00281 //      This function is not implemented because we don't support
00282 //      linking.
00283 //
00284 //********************************************************************
00285
00286 STDMETHODIMP COleClientSite::ShowObject()
00287 {
00288   OutputDebugString("In IOCS::ShowObject\r\n");
00289   return NOERROR;
00290 }
00291
00292 //**********************************************************************
00293 //
00294 // COleClientSite::OnShowWindow
00295 //
00296 // Purpose:
00297 //
00298 //      Object calls this method when it is opening/closing non-InPlace
00299 //      Window
00300 //
00301 // Parameters:
00302 //
00303 //      BOOL fShow  - TRUE if Window is opening, FALSE if closing
00304 //
00305 // Return Value:
00306 //
00307 //      S_OK
00308 //
00309 // Function Calls:
00310 //      Function                    Location
00311 //
00312 //      OutputDebugString           Windows API
00313 //      InvalidateRect              Windows API
00314 //                   OLE API
00315 //
00316 // Comments:
00317 //
00318 //********************************************************************
00319
00320 STDMETHODIMP COleClientSite::OnShowWindow(BOOL fShow)
00321 {
00322   OutputDebugString("In IOCS::OnShowWindow\r\n");
00323   m_pSite->m_fObjectOpen = fShow;
00324   InvalidateRect(m_pSite->m_lpDoc->m_hDocWnd, NULL, TRUE);
00325
00326   // if object window is closing, then bring container window to top
00327   if (! fShow) {
00328     BringWindowToTop(m_pSite->m_lpDoc->m_hDocWnd);
00329     SetFocus(m_pSite->m_lpDoc->m_hDocWnd);
00330   }
00331   return S_OK;
00332 }
00333
00334 //**********************************************************************
00335 //
00336 // COleClientSite::RequestNewObjectLayout
00337 //
00338 // Purpose:
00339 //
00340 //      Not Implemented
00341 //
00342 // Parameters:
00343 //
00344 //      Not Implemented
00345 //
00346 // Return Value:
00347 //
00348 //      Not Implemented
00349 //
00350 // Function Calls:
00351 //      Function                    Location
00352 //
00353 //      OutputDebugString           Windows API
00354 //
00355 // Comments:
00356 //
00357 //      Not Implemented
00358 //
00359 //********************************************************************
00360
00361 STDMETHODIMP COleClientSite::RequestNewObjectLayout()
00362 {
00363   OutputDebugString("In IOCS::RequestNewObjectLayout\r\n");
00364   return E_NOTIMPL;
00365 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/BPSamp/BPSampTest.c Source File

  • WinBase
  • Debug
  • BPSamp

BPSampTest.c

Go to the documentation of this file.
00001 #include <windows.h>
00002 #include <stdio.h>
00003
00004
00005 char szBuff[10];
00006
00007
00008
00009 void f3(DWORD dw1, DWORD dw2)
00010 {
00011   lstrcpyn(szBuff, "hi there", 10);
00012 //  for (i=0; i<10; i++)
00013 //    szBuff[i] = 'z';
00014
00015   printf("%p %s\n", szBuff, szBuff);
00016
00017    MessageBox(NULL, "TEST", "TEST", MB_OK);
00018
00019 }
00020
00021 void f2(DWORD dw1, DWORD dw2)
00022 {
00023
00024   f3(2, 3);
00025
00026 }
00027
00028 void f1(DWORD dw1, DWORD dw2)
00029 {
00030
00031   f2(5, 4);
00032
00033 }
00034
00035 void main(void)
00036 {
00037   CONTEXT context;
00038   printf("%p\n", szBuff);
00039   _asm int 3
00040
00041   MessageBox(NULL, "attach debugger", "test", MB_OK);
00042
00043   context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
00044
00045
00046
00047   if (!GetThreadContext(GetCurrentThread(), &context))
00048     printf("GetThreadContext failed: %d\n", GetLastError());
00049   else
00050     printf("Dr0 = %08X, Dr7 = %08X\n", context.Dr0, context.Dr7);
00051
00052   f1(1, 2);
00053
00054
00055 }
00056
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStartupListener/Dll.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStartupListener

Dll.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      Dll.cpp
00005 //
00006 //  Description:
00007 //      Implementation of DLL Exports.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 #include "stdafx.h"
00012 #include "resource.h"
00013 #include <initguid.h>
00014
00015 #include "MyStartupListener.h"
00016
00017 CComModule _Module;
00018
00019 BEGIN_OBJECT_MAP( ObjectMap )
00020 OBJECT_ENTRY( CLSID_MyStartupListener, CMyStartupListener )
00021 END_OBJECT_MAP()
00022
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //++
00026 //
00027 // DllMain
00028 //
00029 // Description:
00030 //      DLL entry point.
00031 //
00032 //--
00033 /////////////////////////////////////////////////////////////////////////////
00034 extern "C"
00035 BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/ )
00036 {
00037     if ( dwReason == DLL_PROCESS_ATTACH )
00038     {
00039         _Module.Init( ObjectMap, hInstance ); // no typelib
00040         DisableThreadLibraryCalls( hInstance );
00041     }
00042     else if ( dwReason == DLL_PROCESS_DETACH )
00043     {
00044         _Module.Term();
00045     }
00046     return TRUE;    // ok
00047
00048 } //*** DllMain
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 //++
00052 //
00053 // DllCanUnloadNow
00054 //
00055 // Description:
00056 //      Used to determine whether the DLL can be unloaded by OLE.
00057 //
00058 //--
00059 /////////////////////////////////////////////////////////////////////////////
00060 STDAPI DllCanUnloadNow( void )
00061 {
00062     return ( _Module.GetLockCount()==0 ) ? S_OK : S_FALSE;
00063
00064 } //*** DllCanUnloadNow
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067 //++
00068 //
00069 // DllGetClassObject
00070 //
00071 // Description:
00072 //      Returns a class factory to create an object of the requested type.
00073 //
00074 //--
00075 /////////////////////////////////////////////////////////////////////////////
00076 STDAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID * ppv )
00077 {
00078     return _Module.GetClassObject( rclsid, riid, ppv );
00079
00080 } //*** DllGetClassObject
00081
00082 /////////////////////////////////////////////////////////////////////////////
00083 //++
00084 //
00085 // DllRegisterServer
00086 //
00087 // Description:
00088 //      Adds entries to the system registry.
00089 //
00090 //--
00091 /////////////////////////////////////////////////////////////////////////////
00092 STDAPI DllRegisterServer( void )
00093 {
00094     // registers object; FALSE => no typelib
00095     return _Module.RegisterServer( FALSE );
00096
00097 } //*** DllRegisterServer
00098
00099 /////////////////////////////////////////////////////////////////////////////
00100 //++
00101 //
00102 // DllUnregisterServer
00103 //
00104 // Description:
00105 //      Removes entries from the system registry.
00106 //
00107 //--
00108 /////////////////////////////////////////////////////////////////////////////
00109 STDAPI DllUnregisterServer( void )
00110 {
00111     return _Module.UnregisterServer( FALSE ); // FALSE => no typelib
00112
00113 } //*** DllUnregisterServer
00114
00115
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Registry/Monkey.h Source File

  • WinBase
  • Registry

Monkey.h

Go to the documentation of this file.
00001
00002 /******************************************************************************
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 This source code is only intended as a supplement to Microsoft Development
00011 Tools and/or WinHelp documentation. See these sources for detailed information
00012 regarding the Microsoft samples programs.
00013 ******************************************************************************/
00014
00015 #define IDE_NAME                    101
00016 #define IDE_TITLEINDEX              102
00017 #define IDE_ACL                     104
00018 #define IDE_LASTWRT                 105
00019 #define IDE_VALUE1                  106
00020 #define IDE_VALUE2                  107
00021 #define IDE_VALUE3                  108
00022 #define IDE_CLASS                   109
00023 #define IDB_NEXT                    111
00024 #define IDB_BACK                    112
00025 #define IDL_LISTBOX                 110
00026 #define IDL_LISTBOX2                103
00027 #define IDE_CVALUES                 113
00028 #define IDB_PRINT                   114
00029 #define IDR_FULL                    115
00030 #define IDE_TEXTOUT                 116
00031 #define IDR_TRIMMED                 117
00032
00033 #define IDS_SELECTMSG               201
00034 #define IDS_NAME                    202
00035 #define IDS_TOPLEVEL                203
00036 #define IDS_CANTOPENKEY             204
00037 #define IDS_OPENKEYERR              205
00038 #define IDS_REGERR                  206
00039 #define IDS_DEBUG                   207
00040 #define IDS_NONAME                  208
00041 #define IDS_REGOPENERR              209
00042 #define IDS_REGQUERYERR             210
00043 #define IDS_REGENUMERR              211
00044 #define IDS_REGNONE                 212
00045 #define IDS_REGSZ                   213
00046 #define IDS_REGEXPSZ                214
00047 #define IDS_REGBIN                  215
00048 #define IDS_MALLOCERR               216
00049 #define IDS_DBGTITLE                217
00050 #define IDS_REGDWORD                218
00051 #define IDS_REGBIGEND               219
00052 #define IDS_REGLINK                 220
00053 #define IDS_REGMULTI                221
00054 #define IDS_REGRESLST               222
00055 #define IDS_REGFULLDESC             223
00056 #define IDS_REGUNDEFINE             224
00057
00058
00059 #define MAX_VALUE_NAME              128
00060 #define MAX_DATA_LEN                1024
00061
00062 #define LINE_LEN                    80
00063
00064 #define BRANCH                      1
00065 #define CHILD                       2
00066 #define OTHER                       3
00067
00068 #define BOOT_INI                    "c:\\boot.ini"
00069 #define REGISTRY_TXT                "registry.txt"
00070
00071 // MAX_PATH is defined as 260 in windef.h
00072
00073 #define WM_GETFIRSTKEY              WM_APP
00074
00075 int  APIENTRY MonkeyDlgProc (HWND, WORD, LONG, LONG);
00076
00077 VOID EnumerateLevel (HWND hDlg, LPTSTR NameLBSelect,
00078                      LPTSTR RegPath, HKEY *hKeyRoot);
00079
00080 VOID QueryKey (HWND, HANDLE);
00081 VOID DisplayKeyData (HWND, LPTSTR, HANDLE);
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/KerbSubAuth/SubAuth.c Source File

  • Security
  • Authentication
  • KerbSubAuth

SubAuth.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1987 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010     subauth.c
00011
00012 Abstract:
00013     Sample Kerberos SubAuthentication Package.
00014
00015 Environment:
00016     User mode only.
00017     Contains NT-specific code.
00018     Requires ANSI C extensions: slash-slash comments, long external names.
00019
00020 --*/
00021
00022 #define _UNICODE
00023 #define UNICODE
00024 #include <windef.h>
00025 #include <windows.h>
00026 #include <lmcons.h>
00027 #include <lmaccess.h>
00028 #include <lmapibuf.h>
00029 #include <subauth.h>
00030 #include <stdio.h>
00031
00032 static BOOL WriteLogFile(LPTSTR String);
00033
00034 NTSTATUS
00035 NTAPI
00036 Msv1_0SubAuthenticationFilter (
00037     IN NETLOGON_LOGON_INFO_CLASS LogonLevel,
00038     IN PVOID LogonInformation,
00039     IN ULONG Flags,
00040     IN PUSER_ALL_INFORMATION UserAll,
00041     OUT PULONG WhichFields,
00042     OUT PULONG UserFlags,
00043     OUT PBOOLEAN Authoritative,
00044     OUT PLARGE_INTEGER LogoffTime,
00045     OUT PLARGE_INTEGER KickoffTime
00046 )
00047 /*++
00048
00049 Routine Description:
00050
00051     The subauthentication routine does client/server specific authentication
00052     of a user. The credentials of the user are passed in addition to all the
00053     information from SAM defining the user. This routine decides whether to
00054     let the user log on.
00055
00056
00057 Arguments:
00058
00059     LogonLevel -- Specifies the level of information given in
00060         LogonInformation.
00061
00062     LogonInformation -- Specifies the description for the user
00063         logging on.  The LogonDomainName field should be ignored.
00064
00065     Flags - Flags describing the circumstances of the logon.
00066
00067         MSV1_0_PASSTHRU -- This is a PassThru authenication.  (i.e., the
00068             user isn't connecting to this machine.)
00069         MSV1_0_GUEST_LOGON -- This is a retry of the logon using the GUEST
00070             user account.
00071
00072     UserAll -- The description of the user as returned from SAM.
00073
00074     WhichFields -- Returns which fields from UserAllInfo are to be written
00075         back to SAM.  The fields will only be written if MSV returns success
00076         to it's caller.  Only the following bits are valid.
00077
00078         USER_ALL_PARAMETERS - Write UserAllInfo->Parameters back to SAM.  If
00079             the size of the buffer is changed, the old buffer must be deleted
00080             using MIDL_user_free() and reallocate the
00081             buffer using MIDL_user_allocate().
00082
00083     UserFlags -- Returns UserFlags to be returned from LsaLogonUser in the
00084         LogonProfile.  The following bits are currently defined:
00085
00086
00087             LOGON_GUEST -- This was a guest logon
00088             LOGON_NOENCRYPTION -- The caller didn't specify encrypted credentials
00089
00090         SubAuthentication packages should restrict themselves to returning
00091         bits in the high order byte of UserFlags.  However, this convention
00092         isn't enforced giving the SubAuthentication package more flexibility.
00093
00094     Authoritative -- Returns whether the status returned is an
00095         authoritative status which should be returned to the original
00096         caller.  If not, this logon request may be tried again on another
00097         domain controller.  This parameter is returned regardless of the
00098         status code.
00099
00100     LogoffTime - Receives the time at which the user should log off the
00101         system.  This time is specified as a GMT relative NT system time.
00102
00103     KickoffTime - Receives the time at which the user should be kicked
00104         off the system. This time is specified as a GMT relative system
00105         time.  Specify, a full scale positive number if the user isn't to
00106         be kicked off.
00107
00108 Return Value:
00109
00110     STATUS_SUCCESS: if there was no error.
00111
00112     STATUS_NO_SUCH_USER: The specified user has no account.
00113     STATUS_WRONG_PASSWORD: The password was invalid.
00114
00115     STATUS_INVALID_INFO_CLASS: LogonLevel is invalid.
00116     STATUS_ACCOUNT_LOCKED_OUT: The account is locked out
00117     STATUS_ACCOUNT_DISABLED: The account is disabled
00118     STATUS_ACCOUNT_EXPIRED: The account has expired.
00119     STATUS_PASSWORD_MUST_CHANGE: Account is marked as Password must change
00120         on next logon.
00121     STATUS_PASSWORD_EXPIRED: The Password is expired.
00122     STATUS_INVALID_LOGON_HOURS - The user is not authorized to log on at
00123         this time.
00124     STATUS_INVALID_WORKSTATION - The user is not authorized to log on to
00125         the specified workstation.
00126
00127 --*/
00128 {
00129     NTSTATUS Status;
00130     SYSTEMTIME CurrentTime;
00131     WCHAR buf[256];
00132     PNETLOGON_LOGON_IDENTITY_INFO Identity =
00133   (PNETLOGON_LOGON_IDENTITY_INFO)LogonInformation;
00134
00135     Status = STATUS_SUCCESS;
00136
00137     *Authoritative = TRUE;
00138     *UserFlags = 0;
00139     *WhichFields = 0;
00140
00141
00142     GetLocalTime( &CurrentTime );
00143
00144     if (!Identity) {
00145   WriteLogFile(TEXT("No identity\r\n"));
00146   return Status;
00147     }
00148
00149
00150     swprintf(buf,
00151        L"%02d/%02d/%d %02d:%02d:%02d: Logon (level=%d) %wZ\\%wZ (%wZ) from %wZ\r\n",
00152        CurrentTime.wMonth, CurrentTime.wDay, CurrentTime.wYear,
00153        CurrentTime.wHour, CurrentTime.wMinute, CurrentTime.wSecond,
00154        LogonLevel,
00155        &Identity->LogonDomainName, &Identity->UserName,
00156        &UserAll->FullName, &Identity->Workstation);
00157     WriteLogFile(buf);
00158
00159 #if 0
00160     swprintf(buf, L"   LogonDomainName - %x (%d,%d)\r\n",
00161        Identity->LogonDomainName.Buffer, (int)Identity->LogonDomainName.Length, (int)Identity->LogonDomainName.MaximumLength);
00162     WriteLogFile(buf);
00163     swprintf(buf, L"   UserName - %x (%d,%d)\r\n",
00164        Identity->UserName.Buffer, (int)Identity->UserName.Length, (int)Identity->UserName.MaximumLength);
00165     WriteLogFile(buf);
00166     swprintf(buf, L"   Workstation - %x (%d,%d)\r\n",
00167        Identity->Workstation.Buffer, (int)Identity->Workstation.Length, (int)Identity->Workstation.MaximumLength);
00168     WriteLogFile(buf);
00169 #endif
00170
00171     switch ( LogonLevel ) {
00172     case NetlogonInteractiveInformation:
00173     case NetlogonServiceInformation:
00174     case NetlogonNetworkInformation:
00175
00176   //
00177   // If you care you can determine what to do here
00178   //
00179         *Authoritative = FALSE;
00180
00181   if (LogoffTime) {
00182       LogoffTime->HighPart = 0x7FFFFFFF;
00183       LogoffTime->LowPart = 0xFFFFFFFF;
00184   }
00185
00186   if (KickoffTime) {
00187       KickoffTime->HighPart = 0x7FFFFFFF;
00188       KickoffTime->LowPart = 0xFFFFFFFF;
00189   }
00190         break;
00191
00192     default:
00193         return STATUS_INVALID_INFO_CLASS;
00194     }
00195
00196     return Status;
00197 }
00198
00199 #define LOGFILE L"C:\\lastlog.txt"
00200
00201 static BOOL
00202 WriteLogFile(
00203     LPWSTR String
00204     )
00205 {
00206     HANDLE hFile;
00207     DWORD dwBytesWritten;
00208
00209     hFile = CreateFile(LOGFILE,
00210            GENERIC_WRITE,
00211            0,
00212            NULL,
00213            OPEN_ALWAYS,
00214            FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN,
00215            NULL);
00216     if (hFile == INVALID_HANDLE_VALUE)
00217   return FALSE;
00218
00219     SetFilePointer(hFile, 0, NULL, FILE_END);
00220
00221     WriteFile(hFile,
00222         String,
00223         (lstrlen(String) * sizeof(WCHAR)),
00224         &dwBytesWritten,
00225         NULL);
00226
00227     CloseHandle(hFile);
00228
00229     return TRUE;
00230 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/KeepAliveWithThreads/ThreadPool.h Source File

  • Web
  • iis
  • extensions
  • KeepAliveWithThreads

ThreadPool.h

Go to the documentation of this file.
00001 /* Copyright (c) 1997-2002  Microsoft Corporation
00002
00003   Module Name:
00004
00005     ThreadPool.h
00006 */
00007
00008 /* Number of threads in pool */
00009
00010 #define POOL_THREADS 2
00011
00012 /* Number of entries in ECBqueue */
00013
00014 #define WORK_QUEUE_ENTRIES 2
00015
00016 /* Global critical section to control access to ECB queue */
00017
00018 CRITICAL_SECTION csQueueLock;
00019
00020 /*
00021   Semaphore to wait on in worker thread; each time an ECB is added to the
00022   ECBqueue by HttpExtensionProc, the semaphore must be released once
00023 */
00024
00025 HANDLE hWorkSem;
00026
00027 /*
00028   These functions will add/retrieve an ECB to/from the linked list.
00029   ENTER csQueueLock BEFORE CALLING AND LEAVE csQueueLock AFTER
00030   RETURNING FROM THESE FUNCTIONS!!!
00031 */
00032
00033 BOOL AddWorkQueueEntry(EXTENSION_CONTROL_BLOCK *);
00034 BOOL GetWorkQueueEntry(EXTENSION_CONTROL_BLOCK **ppECB);
00035
00036 /* This function initializes the thread pool */
00037
00038 BOOL InitThreadPool(void);
00039
00040 /* Function that threads in pool run */
00041
00042 DWORD WINAPI WorkerFunction(LPVOID);
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/ccomspy.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

ccomspy.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __COMSPY_H_
00018 #define __COMSPY_H_
00019
00020 #include "resource.h"       // main symbols
00021
00022 #include "comsvcs.h"
00023
00024 #define IF_AUDIT_DO(x)            \
00025   if (m_pSpy -> Audit())          \
00026     m_pSpy -> GetAuditObj() -> x
00027
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // CComSpy
00031 class ATL_NO_VTABLE CComSpy :
00032   public CComObjectRootEx<CComSingleThreadModel>,
00033   public CComCoClass<CComSpy, &CLSID_ComSpy>,
00034   public CComControl<CComSpy>,
00035   public CStockPropImpl<CComSpy, IComSpy, &IID_IComSpy, &LIBID_COMSPYCTLLib>,
00036   public IProvideClassInfo2Impl<&CLSID_ComSpy, NULL, &LIBID_COMSPYCTLLib>,
00037   public IPersistStreamInitImpl<CComSpy>,
00038   public IPersistStorageImpl<CComSpy>,
00039   public IQuickActivateImpl<CComSpy>,
00040   public IOleControlImpl<CComSpy>,
00041   public IOleObjectImpl<CComSpy>,
00042   public IOleInPlaceActiveObjectImpl<CComSpy>,
00043   public IViewObjectExImpl<CComSpy>,
00044   public IOleInPlaceObjectWindowlessImpl<CComSpy>,
00045   public IDataObjectImpl<CComSpy>,
00046   public ISpecifyPropertyPagesImpl<CComSpy>,
00047   public IPropertyBag
00048 {
00049
00050 private:
00051   HRESULT EnableAudit(BOOL bEnable);
00052   MapStringToAppInfo m_map;
00053   CAppInfo *m_pSysAppInfo;    //system app that manages system events
00054   BOOL m_bLogToFile;
00055   HANDLE m_hFile;
00056   CComBSTR m_sLogFile;
00057   int m_cEvents;
00058   HWND m_hWndList;
00059   BOOL m_bShowGridLines;
00060   BOOL m_bAudit;
00061   HFONT m_hFont;
00062   long m_nWidth[NUMBER_COLUMNS];
00063   BOOL m_bShowOnScreen;
00064   BOOL m_bCSV;
00065   HMENU m_hMenuDebug; //the Debug menu
00066   IComSpyAudit * m_pSqlAudit;
00067
00068 public:
00069
00070   BOOL Audit(){return m_bAudit;}
00071   IComSpyAudit * GetAuditObj(){return m_pSqlAudit;}
00072   CComPtr<IFontDisp> m_pFont;
00073   CContainedWindow m_ctlSysListView32;
00074
00075   CComSpy();
00076   ~CComSpy()
00077   {
00078     m_hWndList = NULL;
00079
00080   }
00081   void FinalRelease()
00082   {
00083     SafeRelease(m_pSqlAudit);
00084   }
00085
00086
00087   BOOL ShouldScroll(int nIndex);
00088   HRESULT ShutdownApplication(LPCOLESTR sApplicationName);
00089   BOOL AddEventToList(LONGLONG perfCount, LPCOLESTR sEvent, LPCOLESTR sApplication);
00090   BOOL AddParamValueToList(LPCOLESTR sParamName, LPCOLESTR sValue);
00091
00092
00093   DECLARE_REGISTRY_RESOURCEID(IDR_COMSPY)
00094
00095   BEGIN_COM_MAP(CComSpy)
00096     COM_INTERFACE_ENTRY(IComSpy)
00097     COM_INTERFACE_ENTRY(IDispatch)
00098     COM_INTERFACE_ENTRY_IMPL(IViewObjectEx)
00099     COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx)
00100     COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx)
00101     COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless)
00102     COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
00103     COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless)
00104     COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
00105     COM_INTERFACE_ENTRY_IMPL(IOleControl)
00106     COM_INTERFACE_ENTRY_IMPL(IOleObject)
00107     COM_INTERFACE_ENTRY_IMPL(IQuickActivate)
00108     COM_INTERFACE_ENTRY_IMPL(IPersistStorage)
00109     COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
00110     COM_INTERFACE_ENTRY_IMPL(ISpecifyPropertyPages)
00111     COM_INTERFACE_ENTRY_IMPL(IDataObject)
00112     COM_INTERFACE_ENTRY(IProvideClassInfo)
00113     COM_INTERFACE_ENTRY(IProvideClassInfo2)
00114     COM_INTERFACE_ENTRY(IPropertyBag)
00115   END_COM_MAP()
00116
00117   BEGIN_PROPERTY_MAP(CComSpy)
00118     PROP_ENTRY_EX( "LogFile", DISPID_LOGFILE, CLSID_ComSpyPropPage, IID_IComSpy)
00119     PROP_ENTRY_EX( "ShowGridLines", DISPID_GRIDLINES, CLSID_ComSpyPropPage, IID_IComSpy)
00120     PROP_ENTRY_EX( "Audit", DISPID_AUDIT, CLSID_ComSpyPropPage, IID_IComSpy)
00121     PROP_ENTRY_EX( "ColWidth", DISPID_COLWIDTH, CLSID_ComSpyPropPage, IID_IComSpy)
00122     PROP_PAGE(CLSID_StockFontPage)
00123   END_PROPERTY_MAP()
00124
00125
00126   BEGIN_MSG_MAP(CComSpy)
00127     MESSAGE_HANDLER(WM_PAINT, OnPaint)
00128     MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
00129     MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
00130     MESSAGE_HANDLER(WM_CREATE, OnCreate)
00131
00132   ALT_MSG_MAP(1)
00133     MESSAGE_HANDLER(WM_RBUTTONDOWN, OnRButtonDown)
00134     COMMAND_ID_HANDLER(ID_LOG, OnLogToFile)
00135     COMMAND_ID_HANDLER(ID_CHOOSE_LOG_FILE_NAME, OnChooseLogFile)
00136     COMMAND_ID_HANDLER(ID_SAVE, OnSave)
00137     COMMAND_ID_HANDLER(ID_CLEAR, OnClear)
00138     COMMAND_ID_HANDLER(ID_OPTIONS_GRID_LINES, OnToggleGridLines)
00139     COMMAND_ID_HANDLER(ID_AUDIT, OnToggleAudit)
00140     COMMAND_ID_HANDLER(ID_SHOW_ON_SCREEN, OnToggleShowOnScreen)
00141     COMMAND_ID_HANDLER(IDM_ABOUT, OnAbout)
00142     MESSAGE_HANDLER(WM_INITMENU, OnInitMenu)
00143     COMMAND_ID_HANDLER(IDM_SELECT_APPLICATIONS, OnSelectApplications)
00144     COMMAND_ID_HANDLER(ID_CHOOSEFONT, OnChooseFont)
00145     MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
00146     COMMAND_RANGE_HANDLER(ID_DEBUG_BEGIN, ID_DEBUG_END, OnDebugApplication)
00147   END_MSG_MAP()
00148
00149   LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00150   LRESULT OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00151   LRESULT OnLogToFile(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00152   LRESULT OnChooseLogFile(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00153   LRESULT OnInitMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00154   LRESULT OnSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00155   LRESULT OnClear(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00156   LRESULT OnToggleGridLines(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00157   LRESULT OnToggleAudit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00158   LRESULT OnAbout(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00159   LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00160   LRESULT OnSelectApplications(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00161   LRESULT OnChooseFont(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00162   LRESULT OnToggleShowOnScreen(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00163   LRESULT OnDebugApplication(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00164
00165
00166
00167
00168   STDMETHOD(Close)(DWORD dwSaveOption);
00169
00170   STDMETHOD(SetObjectRects)(LPCRECT prcPos,LPCRECT prcClip)
00171   {
00172     IOleInPlaceObjectWindowlessImpl<CComSpy>::SetObjectRects(prcPos, prcClip);
00173     int cx, cy;
00174     cx = prcPos->right - prcPos->left;
00175     cy = prcPos->bottom - prcPos->top;
00176     ::SetWindowPos(m_ctlSysListView32.m_hWnd, NULL, 0,
00177       0, cx, cy, SWP_NOZORDER | SWP_NOACTIVATE);
00178
00179
00180     return S_OK;
00181   }
00182
00183 // IViewObjectEx
00184   STDMETHOD(GetViewStatus)(DWORD* pdwStatus)
00185   {
00186     ATLTRACE(_T("IViewObjectExImpl::GetViewStatus\n"));
00187     *pdwStatus = VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE;
00188     return S_OK;
00189   }
00190
00191 // IComSpy
00192 public:
00193   BOOL AddRunningAspsToDebugMenu(HMENU hMenu);
00194   STDMETHOD(ChooseLogFile)(/*[out]*/ BSTR * sLogFileName, /*[out]*/ BOOL * bCanceled);
00195   STDMETHOD(get_ShowOnScreen)(/*[out, retval]*/ BOOL *pVal);
00196   STDMETHOD(put_ShowOnScreen)(/*[in]*/ BOOL newVal);
00197   STDMETHOD(get_Audit)(/*[out, retval]*/ BOOL *pVal);
00198   STDMETHOD(put_Audit)(/*[in]*/ BOOL newVal);
00199   STDMETHOD(ChooseFont)();
00200   STDMETHOD(get_LogToFile)(/*[out, retval]*/ BOOL *pVal);
00201   STDMETHOD(put_LogToFile)(/*[in]*/ BOOL newVal);
00202   STDMETHOD(About)();
00203   STDMETHOD(ClearAllEvents)();
00204   STDMETHOD(SaveToFile)();
00205   STDMETHOD(SelectApplications)();
00206   HFONT CreateHFontFromIFont(IFont * pFont);
00207   STDMETHOD(get_ColWidth)(short nColumn, /*[out, retval]*/ long *pVal);
00208   STDMETHOD(put_ColWidth)(short nColumn, /*[in]*/ long newVal);
00209   STDMETHOD(get_ShowGridLines)(/*[out, retval]*/ BOOL *pVal);
00210   STDMETHOD(put_ShowGridLines)(/*[in]*/ BOOL newVal);
00211   STDMETHOD(get_LogFile)(/*[out, retval]*/ BSTR *pVal);
00212   STDMETHOD(put_LogFile)(/*[in]*/ BSTR newVal);
00213   HRESULT OnDrawAdvanced(ATL_DRAWINFO& di);
00214
00215   HRESULT STDMETHODCALLTYPE putref_Font(IFontDisp* pFont)
00216   {
00217     CComQIPtr<IFont, &IID_IFont> pIFont(pFont);
00218     if (pIFont)
00219     {
00220       if (m_hFont)
00221       {
00222         DeleteObject(m_hFont);
00223         m_hFont = NULL;
00224
00225       }
00226       m_hFont = CreateHFontFromIFont(pIFont);
00227       if (m_hFont)
00228       {
00229         ::SendMessage(m_hWndList, WM_SETFONT, (WPARAM)m_hFont, 0L);
00230       }
00231     }
00232
00233
00234     if (FireOnRequestEdit(DISPID_FONT) == S_FALSE)
00235       return S_FALSE;
00236     m_pFont = pFont;
00237     m_bRequiresSave = TRUE;
00238     FireOnChanged(DISPID_FONT);
00239     FireViewChange();
00240     return S_OK;
00241
00242   }
00243
00244   STDMETHOD(Read)(LPCOLESTR pszPropName,VARIANT* pVar,IErrorLog* pErrorLog )
00245   {
00246     return S_OK;
00247   }
00248
00249   STDMETHOD(Write)(LPCOLESTR pszPropName,VARIANT* pVar)
00250   {
00251     return S_OK;
00252   }
00253
00254   HRESULT IPersistStreamInit_Load(LPSTREAM pStm, ATL_PROPMAP_ENTRY* pMap);
00255   HRESULT IPersistStreamInit_Save(LPSTREAM pStm, BOOL /* fClearDirty */,
00256     ATL_PROPMAP_ENTRY* pMap);
00257
00258
00259 };
00260
00261 #endif //__COMSPY_H_
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COfficeDlg Member List

This is the complete list of members for COfficeDlg, including all inherited members.
COfficeDlg(CWnd *pParent=NULL) | COfficeDlg |
DoDataExchange(CDataExchange *pDX) | COfficeDlg | [protected, virtual]
IDD enum value | COfficeDlg |
m_item | COfficeDlg |
m_SKU | COfficeDlg |
Generated on Wed Nov 13 2024 16:56:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextAdmin.h Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification

ContextAdmin.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       ContextAdmin.h
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011 #pragma once
00012
00013 #include "Resource.h"       // main symbols
00014 #include "ContextPlugin.h"
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // CContextAdmin
00018 class ATL_NO_VTABLE CContextAdmin :
00019     public IDispatchImpl<IWMSContextAdmin, &IID_IWMSContextAdmin, &LIBID_CONTEXTPLUGINLib, 9, 0 >,
00020     public ISupportErrorInfo,
00021     public CComObjectRootEx<CComMultiThreadModel>
00022 {
00023 public:
00024     CContextAdmin()
00025     {
00026         m_pContextPlugin = NULL;
00027     }
00028
00029     STDMETHOD( Initialize )( CContextPlugin *pPlugin );
00030
00031
00032 DECLARE_PROTECT_FINAL_CONSTRUCT()
00033
00034 BEGIN_COM_MAP(CContextAdmin)
00035     COM_INTERFACE_ENTRY(IDispatch)
00036     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00037     COM_INTERFACE_ENTRY(IWMSContextAdmin)
00038 END_COM_MAP()
00039
00040 // ISupportErrorInfo
00041     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00042
00043 // IWMSContextAdmin
00044     STDMETHOD( put_OutputPath )( BSTR bstrOutputPath );
00045     STDMETHOD( get_OutputPath )( BSTR *pbstrOutputPath );
00046     STDMETHOD( put_ContextTypes )( WMS_CONTEXT_PLUGIN_CONTEXT_TYPE wmsContextTypes );
00047     STDMETHOD( get_ContextTypes )( WMS_CONTEXT_PLUGIN_CONTEXT_TYPE *pwmsContextTypes );
00048
00049 private:
00050     CContextPlugin   *m_pContextPlugin;
00051
00052 protected:
00053 };
00054
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/proppageuser.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

proppageuser.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       proppageuser.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #ifndef _PROPPAGEUSER_H
00012 #define _PROPPAGEUSER_H
00013
00014 #include "stdafx.h"
00015 #include "userproppage.h"
00016 #include "ProppageUserUI.h"
00017
00018 class /*ATL_NO_VTABLE*/ CProppageUser :
00019   public CComObjectRootEx<CComSingleThreadModel>,
00020   public IShellExtInit,
00021   public IShellPropSheetExt,
00022   public CComCoClass<CProppageUser, &CLSID_ProppageUser>
00023 {
00024 public:
00025   CProppageUser()
00026   {
00027     TRACE(L"CProppageUser::CProppageUser()\n");
00028   }
00029
00030   ~CProppageUser()
00031   {
00032     TRACE(L"CProppageUser::~CProppageUser()\n");
00033   }
00034
00035
00036 BEGIN_COM_MAP(CProppageUser)
00037   COM_INTERFACE_ENTRY(IShellExtInit)
00038   COM_INTERFACE_ENTRY(IShellPropSheetExt)
00039 END_COM_MAP()
00040
00041 DECLARE_REGISTRY_CLSID();
00042
00043 public:
00044
00045   // IShellExtInit interface
00046   STDMETHOD(Initialize)(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObject, HKEY hKeyID);
00047
00048   // IShellPropSheetExt interface
00049   STDMETHOD(AddPages)(LPFNADDPROPSHEETPAGE pAddPageProc, LPARAM lParam);
00050   STDMETHOD(ReplacePage)(UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam);
00051
00052 private:
00053   CComPtr<IDataObject> m_spDataObj;
00054 };
00055
00056
00057 #endif // _PROPPAGEUSER_H
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSharp_Draw::Form1 Member List

This is the complete list of members for CSharp_Draw::Form1, including all inherited members.
AddLine(Util.line lineToDraw, System.Drawing.Graphics PG) | CSharp_Draw::Form1 | [inline, private]
bDirectMode | CSharp_Draw::Form1 | [private]
bDSEnabled | CSharp_Draw::Form1 | [private]
BlackPen | CSharp_Draw::Form1 |
brushText | CSharp_Draw::Form1 |
btnAttach | CSharp_Draw::Form1 | [private]
btnAttach_Click(object sender, System.EventArgs e) | CSharp_Draw::Form1 | [inline, private]
btnCancel | CSharp_Draw::Form1 | [private]
btnCancel_Click(object sender, System.EventArgs e) | CSharp_Draw::Form1 | [inline, private]
btnConnect | CSharp_Draw::Form1 | [private]
btnConnect_Click(object sender, System.EventArgs e) | CSharp_Draw::Form1 | [inline, private]
Color | CSharp_Draw::Form1 |
components | CSharp_Draw::Form1 | [private]
Dispose() | CSharp_Draw::Form1 | [inline]
DrawChar(string strCharToDraw) | CSharp_Draw::Form1 | [inline, private]
DrawLine(Util.line lineToDraw, System.Drawing.Graphics PG) | CSharp_Draw::Form1 | [inline, private]
fontfamilyText | CSharp_Draw::Form1 |
fontText | CSharp_Draw::Form1 |
Form1() | CSharp_Draw::Form1 | [inline]
groupConnectionMode | CSharp_Draw::Form1 | [private]
groupSendType | CSharp_Draw::Form1 | [private]
guidDraw | CSharp_Draw::Form1 | [private]
HP | CSharp_Draw::Form1 | [private]
iLastX | CSharp_Draw::Form1 | [private]
iLastY | CSharp_Draw::Form1 | [private]
InitializeComponent() | CSharp_Draw::Form1 | [inline, private]
lblDSConnection | CSharp_Draw::Form1 | [private]
lblRemoteComputer | CSharp_Draw::Form1 | [private]
lblRemoteQueue | CSharp_Draw::Form1 | [private]
lines | CSharp_Draw::Form1 | [private]
Main() | CSharp_Draw::Form1 | [inline, private, static]
picture1 | CSharp_Draw::Form1 | [private]
picture1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) | CSharp_Draw::Form1 | [inline, private]
picture1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) | CSharp_Draw::Form1 | [inline, private]
picture1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) | CSharp_Draw::Form1 | [inline, private]
picture1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) | CSharp_Draw::Form1 | [inline, private]
picture1Graphics | CSharp_Draw::Form1 |
qFriend | CSharp_Draw::Form1 | [private]
qMe | CSharp_Draw::Form1 | [private]
qMe_ReceiveCompleted(object sender, System.Messaging.ReceiveCompletedEventArgs e) | CSharp_Draw::Form1 | [inline, private]
radioDSDisabled | CSharp_Draw::Form1 | [private]
radioDSEnabled | CSharp_Draw::Form1 | [private]
radioSendExp | CSharp_Draw::Form1 | [private]
radioSendRec | CSharp_Draw::Form1 | [private]
strName | CSharp_Draw::Form1 |
textChars | CSharp_Draw::Form1 | [private]
textChars_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) | CSharp_Draw::Form1 | [inline, private]
textFriendComputer | CSharp_Draw::Form1 | [private]
textFriendComputer_TextChanged(object sender, System.EventArgs e) | CSharp_Draw::Form1 | [inline, private]
textFriendName | CSharp_Draw::Form1 | [private]
textFriendName_TextChanged(object sender, System.EventArgs e) | CSharp_Draw::Form1 | [inline, private]
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampclnt/sampclnt.cpp Source File

  • Dataaccess
  • oledb
  • sampclnt

sampclnt.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Consumer
00003 // (C) Copyright 1991 - 2000 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // File name: SAMPCLNT.CPP
00006 //
00007 //      Implementation file for a simple OLE DB consumer.
00008 //      Dump\output routines for SAMPCLNT are in DUMP.CPP
00009 //      SAMPCLNT.H is the header file.
00010 //
00011 //      See OLE DB SDK Guide for information on building and running
00012 //    this sample, as well as notes concerning the implementation of
00013 //    a simple OLE DB consumer.
00014 //
00015 // Functions:
00016 //
00017 //      See SAMPCLNT.H for function prototypes
00018 //
00019 //
00020 // SampClnt is structured to match the steps required for simple OLE DB data access:
00021 //
00022 //  DoTests
00023 //    GetSampprovDataSource
00024 //      GetDBSessionFromDataSource
00025 //      GetRowsetFromDBSession
00026 //    GetDataFromRowset
00027 //      GetColumnsInfo
00028 //      SetupBindings
00029 //      CreateAccessor
00030 //      GetData
00031 //      CleanupRowset
00032 //
00033
00034
00035
00036
00037 #define INITGUID
00038 #define DBINITCONSTANTS
00039 #include "sampclnt.h"
00040
00041
00042 IMalloc* g_pIMalloc = NULL;
00043 FILE*    g_fpLogFile = NULL;    // our log file
00044
00045
00046
00047
00048 //**********************************************************************
00049 //
00050 // main
00051 //
00052 // Purpose:
00053 //
00054 //     Entry point for this program.
00055 //
00056 // Parameters:
00057 //
00058 //     none
00059 //
00060 // Return Value:
00061 //
00062 //     none
00063 //
00064 // Comments:
00065 //
00066 //     Main does some initializing, then calls DoTests, then cleans up.
00067 //     All of the interesting action in this program happens in DoTests.
00068 //
00069 //**********************************************************************
00070
00071
00072 void main()
00073 {
00074   DWORD   dwVersion;
00075   HRESULT hr;
00076   time_t  ttime;
00077     BOOL  fOleInitialized = FALSE;
00078   char  ch;
00079
00080     g_fpLogFile = fopen( "sampclnt.out", "at");
00081     if (!g_fpLogFile)
00082       {
00083       DumpErrorMsg( "Warning: cannot open log file sampclnt.out\n" );
00084         }
00085
00086     time(&ttime);
00087
00088     DumpStatusMsg( "\n-------------------------\n\n");
00089     DumpStatusMsg( "running sampclnt.exe\n%s\n\n", ctime(&ttime) );
00090
00091   dwVersion = OleBuildVersion();
00092     if (HIWORD(dwVersion) != rmm)
00093     {
00094     DumpErrorMsg( "Error: OLE version mismatch. Build version %ld, current version %ld\n",
00095       rmm, HIWORD(dwVersion) );
00096         goto error;
00097     }
00098
00099   hr = OleInitialize( NULL );
00100   if (FAILED(hr))
00101       {
00102         DUMP_ERROR_LINENUMBER();
00103         DumpErrorMsg("Error: OleInitialize failed\n");
00104         goto error;
00105     }
00106   fOleInitialized = TRUE;
00107
00108     hr = CoGetMalloc( MEMCTX_TASK, &g_pIMalloc );
00109   if (FAILED(hr))
00110       {
00111         DUMP_ERROR_LINENUMBER();
00112         DumpErrorMsg("Error: CoGetMalloc failed\n");
00113         goto error;
00114         }
00115
00116     hr = DoTests();
00117   if (FAILED(hr))
00118       {
00119         DUMP_ERROR_LINENUMBER();
00120         DumpErrorHResult( hr, "DoTests");
00121         goto error;
00122         }
00123
00124     g_pIMalloc->Release();
00125   OleUninitialize();
00126
00127   if (g_fpLogFile)
00128       fclose(g_fpLogFile);
00129
00130   /* Pause before we quit, in case user ran from an icon, so they can see our messages. */
00131   printf("\n\n>>> Output has gone into 'sampclnt.out'.");
00132   printf("\n>>> You may wish to use a wide-column editor to view this file.\n\n");
00133   printf("<press any key to continue>");
00134   ch = _getch();
00135   return;
00136
00137 error:
00138     if (g_pIMalloc)
00139       g_pIMalloc->Release();
00140   if (fOleInitialized)
00141       OleUninitialize();
00142   if (g_fpLogFile)
00143       fclose(g_fpLogFile);
00144
00145   /* Pause before we quit, in case user ran from an icon, so they can see our messages. */
00146   printf("\n\n>>> Output has gone into 'sampclnt.out'.");
00147   printf("\n>>> You may wish to use a wide-column editor to view this file.\n\n");
00148   printf("<press any key to continue>");
00149   ch = _getch();
00150
00151   return;
00152 }
00153
00154
00155
00156 //**********************************************************************
00157 //
00158 //  DoTests
00159 //
00160 //  Purpose:
00161 //
00162 //     Hooks up to the SAMPPROV OLE DB provider application, asks the provider
00163 //     for all data in the CSV file CUSTOMER.CSV, and logs the resulting data
00164 //     to sampclnt.out
00165 //
00166 //  Parameters:
00167 //
00168 //    none
00169 //
00170 //  Return Value:
00171 //
00172 //    S_OK    - Success
00173 //      E_*     - Failure
00174 //
00175 //
00176 //  Comments:
00177 //
00178 //     At a high level, an OLE DB data consumer obtains data by
00179 //
00180 //     1. Getting hooked up to a data provider's Data Source object,
00181 //        and initializing that object
00182 //     2. Getting a DBSession object from the Data Source object
00183 //     3. Getting the data from the Rowset object.
00184 //
00185 //     DoTests follows these steps by making calls to GetSampprovDataSource,
00186 //     GetDBSessionDataSource, and GetDataFromRowset
00187 //
00188 //**********************************************************************
00189
00190
00191 HRESULT DoTests
00192   (
00193   )
00194 {
00195   IDBInitialize*      pIDBInitialize  = NULL;
00196     IOpenRowset*        pIOpenRowset    = NULL;
00197     IRowset*        pIRowset    = NULL;
00198   LPWSTR          pwszTableName   =   L"customer.csv";
00199   HRESULT         hr;
00200
00201
00202   hr = GetSampprovDataSource( &pIDBInitialize );
00203   if (FAILED(hr))
00204       {
00205         DUMP_ERROR_LINENUMBER();
00206         DumpErrorHResult( hr, "GetSampprovDataSource" );
00207         goto error;
00208         }
00209
00210     hr = GetDBSessionFromDataSource( pIDBInitialize, &pIOpenRowset );
00211     if (FAILED(hr))
00212         {
00213         DUMP_ERROR_LINENUMBER();
00214         DumpErrorHResult( hr, "GetDBSessionFromDataSource" );
00215         goto error;
00216         }
00217
00218     pIDBInitialize->Release();
00219     pIDBInitialize = NULL;
00220
00221     hr = GetRowsetFromDBSession( pIOpenRowset, pwszTableName, &pIRowset );
00222     if (FAILED(hr))
00223         {
00224         DUMP_ERROR_LINENUMBER();
00225         DumpErrorHResult( hr, "GetRowsetFromDBCreateSession" );
00226         goto error;
00227         }
00228
00229     pIOpenRowset->Release();
00230     pIOpenRowset = NULL;
00231
00232   hr = GetDataFromRowset( pIRowset );
00233   if (FAILED(hr))
00234       {
00235         DUMP_ERROR_LINENUMBER();
00236         DumpErrorHResult( hr, "GetDataFromRowset" );
00237         goto error;
00238         }
00239     pIRowset->Release();
00240     pIRowset = NULL;
00241   CoFreeUnusedLibraries();
00242
00243   DumpStatusMsg( "\nDone! ");
00244   printf("\n\nFor more data from this run, see the log file sampclnt.out\n" );
00245   return ResultFromScode( S_OK );
00246
00247 error:
00248   if (pIRowset)
00249     pIRowset->Release();
00250     if (pIOpenRowset)
00251         pIOpenRowset->Release();
00252     if (pIDBInitialize)
00253       pIDBInitialize->Release();
00254
00255   return ResultFromScode( hr );
00256 }
00257
00258
00259
00260
00261
00262 //**********************************************************************
00263 //
00264 // GetSampprovDataSource
00265 //
00266 // Purpose:
00267 //
00268 //     Calls OLE to find and load the SAMPPROV data provider.
00269 //     Returns an IDBInitialize interface pointer on SAMPPROV's
00270 //     Data Source object.
00271 //
00272 // Parameters:
00273 //
00274 //   IDBInitialize** ppIDBInitialize_out  - out pointer through which to return
00275 //                          IDBInitialize pointer on data
00276 //                            provider's Data Source object
00277 //
00278 // Return Value:
00279 //
00280 //  S_OK    - Success
00281 //  E_*       - Failure
00282 //
00283 //
00284 // Comments:
00285 //
00286 //     The call to CoCreateInstance is hard-coded with SAMPPROV's CLSID.
00287 //     The pointer returned through ppIDBInitialize_out has been AddRef'ed,
00288 //     it must be Release'd later by the caller.
00289 //
00290 //**********************************************************************
00291
00292 HRESULT GetSampprovDataSource
00293   (
00294   IDBInitialize** ppIDBInitialize_out
00295   )
00296 {
00297   IDBInitialize*  pIDBInit = NULL;
00298   IDBProperties*  pIDBProperties = NULL;
00299   DBPROPSET   dbPropSet[1];
00300   DBPROP      dbProp[1];
00301
00302   HRESULT hr;
00303
00304
00305   DumpStatusMsg( "Connecting to the SampProv sample data provider...\n" );
00306
00307   assert(ppIDBInitialize_out != NULL);
00308
00309   VariantInit(&(dbProp[0].vValue));
00310
00311   // Create an instance of the SampProv sample data provider
00312   hr = CoCreateInstance( CLSID_SampProv, NULL, CLSCTX_INPROC_SERVER,
00313         IID_IDBInitialize, (void **)&pIDBInit );
00314   if (FAILED(hr))
00315       {
00316         DUMP_ERROR_LINENUMBER();
00317         DumpErrorHResult( hr, "CoCreateInstance" );
00318         goto error;
00319         }
00320
00321   // Initialize this provider with the path to the customer.csv file
00322   dbPropSet[0].rgProperties   = &dbProp[0];
00323   dbPropSet[0].cProperties    = 1;
00324   dbPropSet[0].guidPropertySet  = DBPROPSET_DBINIT;
00325
00326   dbProp[0].dwPropertyID      = DBPROP_INIT_DATASOURCE;
00327   dbProp[0].dwOptions       = DBPROPOPTIONS_REQUIRED;
00328   dbProp[0].colid         = DB_NULLID;
00329   V_VT(&(dbProp[0].vValue))   = VT_BSTR;
00330   V_BSTR(&(dbProp[0].vValue))   = SysAllocString( L"." );
00331     if ( NULL == V_BSTR(&(dbProp[0].vValue)) )
00332         {
00333         DUMP_ERROR_LINENUMBER();
00334         DumpErrorMsg( "SysAllocString failed\n" );
00335         goto error;
00336         }
00337
00338     hr = pIDBInit->QueryInterface( IID_IDBProperties, (void**)&pIDBProperties);
00339     if (FAILED(hr))
00340       {
00341         DUMP_ERROR_LINENUMBER();
00342         DumpErrorHResult( hr, "IDBInitialize::QI for IDBProperties");
00343         goto error;
00344         }
00345
00346   hr = pIDBProperties->SetProperties( 1, &dbPropSet[0]);
00347   if (FAILED(hr))
00348       {
00349         DUMP_ERROR_LINENUMBER();
00350         DumpErrorHResult( hr, "IDBProperties::SetProperties" );
00351         goto error;
00352         }
00353
00354   hr = pIDBInit->Initialize();
00355   if (FAILED(hr))
00356       {
00357         DUMP_ERROR_LINENUMBER();
00358         DumpErrorHResult( hr, "IDBInitialize::Initialize" );
00359         goto error;
00360         }
00361
00362   *ppIDBInitialize_out = pIDBInit;
00363
00364   hr = ResultFromScode( S_OK );
00365
00366 error:
00367     VariantClear( &(dbProp[0].vValue) );
00368
00369   if( pIDBProperties )
00370     pIDBProperties->Release();
00371
00372   if( FAILED(hr) )
00373   {
00374     if (pIDBInit)
00375         pIDBInit->Release();
00376     *ppIDBInitialize_out = NULL;
00377   }
00378
00379   return hr;
00380 }
00381
00382
00383
00384
00385 //  **********************************************************************
00386 //
00387 // GetDBSessionFromDataSource
00388 //
00389 // Purpose:
00390 //      Calls the provider's Data Source object to get an IOpenRowset interface
00391 //      pointer on a DBSession object.
00392 //
00393 // Parameters:
00394 //      pIDBInitialize      - pointer to Data Source object
00395 //      ppIOpenRowset_out   - out pointer through which to return
00396 //                            IOpenRowset pointer on DBSession object
00397 //
00398 // Return Value:
00399 //
00400 //  S_OK    - Success
00401 //  E_*       - Failure
00402 //
00403 //
00404 // Comments:
00405 //
00406 //      The interface pointer returned through ppIOpenRowset_out has been
00407 //      AddRef'ed, the caller must Release it later.
00408 //
00409 //**********************************************************************
00410
00411 HRESULT GetDBSessionFromDataSource
00412     (
00413     IDBInitialize*      pIDBInitialize,      // [in]
00414     IOpenRowset**       ppIOpenRowset_out    // [out]
00415     )
00416 {
00417     IDBCreateSession*   pIDBCreateSession;
00418     IOpenRowset*        pIOpenRowset;
00419     HRESULT             hr;
00420
00421
00422     DumpStatusMsg( "Getting a DBSession object from the data source object...\n" );
00423
00424     assert(pIDBInitialize != NULL);
00425     assert(ppIOpenRowset_out  != NULL );
00426
00427     hr = pIDBInitialize->QueryInterface( IID_IDBCreateSession, (void**)&pIDBCreateSession);
00428     if (FAILED(hr))
00429       {
00430         DUMP_ERROR_LINENUMBER();
00431         DumpErrorHResult( hr, "IDBInitialize::QI for IDBCreateSession");
00432         goto error;
00433         }
00434
00435     hr = pIDBCreateSession->CreateSession( NULL, IID_IOpenRowset, (IUnknown**)&pIOpenRowset );
00436     if (FAILED(hr))
00437       {
00438         DUMP_ERROR_LINENUMBER();
00439         DumpErrorHResult( hr, "IDBCreateSession::CreateSession");
00440         goto error;
00441         }
00442      pIDBCreateSession->Release();
00443      pIDBCreateSession = NULL;
00444
00445      // all went well
00446      *ppIOpenRowset_out = pIOpenRowset;
00447      return ResultFromScode( S_OK );
00448
00449 error:
00450     if (pIDBCreateSession)
00451         pIDBCreateSession->Release();
00452
00453     *ppIOpenRowset_out = NULL;
00454     return ResultFromScode( hr );
00455 }
00456
00457
00458
00459 //**********************************************************************
00460 //
00461 // GetRowsetFromDBSession
00462 //
00463 // Purpose:
00464 //      Calls the provider's DBSession object to get an IRowset interface
00465 //      pointer on a Rowset object.
00466 //
00467 // Parameters:
00468 //      pIOpenRowset        - interface pointer on DBSession object
00469 //      pwszTableName       - name of "table" (in this case text file)
00470 //      ppIRowset_out       - out pointer through which to return
00471 //                            IRowset pointer on Rowset object
00472 //
00473 // Return Value:
00474 //
00475 //  S_OK    - Success
00476 //  E_*       - Failure
00477 //
00478 // Comments:
00479 //
00480 //      The interface pointer returned through ppIRowset_out has been
00481 //      AddRef'ed, the caller must Release it later.
00482 //
00483 ///**********************************************************************
00484
00485 HRESULT GetRowsetFromDBSession
00486     (
00487     IOpenRowset*   pIOpenRowset,    // [in]
00488     LPWSTR         pwszTableName,   // [in]
00489     IRowset**      ppIRowset_out    // [out]
00490     )
00491 {
00492     DBID            dbcolid;
00493     IRowset*        pIRowset = NULL;
00494     HRESULT         hr;
00495
00496     DumpStatusMsg( "Getting a rowset object from the DBSession object...\n" );
00497
00498     assert(pIOpenRowset != NULL);
00499     assert(ppIRowset_out  != NULL );
00500
00501     // tell the provider which table to open
00502     dbcolid.eKind           = DBKIND_NAME;
00503     dbcolid.uName.pwszName  = pwszTableName;
00504
00505     hr = pIOpenRowset->OpenRowset
00506                         (
00507                         NULL,                   // pUnkOuter - we are not aggregating
00508                         &dbcolid,               // pTableID -  the table we want
00509             NULL,         // pIndexID - the index we want
00510                         IID_IRowset,            // riid - interface we want on the rowset object
00511                         0,                      // cProperties - we are niave about props for now
00512                         NULL,                   // prgProperties[]
00513                         (IUnknown**)&pIRowset   // ppRowset
00514                         );
00515     if (FAILED(hr))
00516       {
00517         DUMP_ERROR_LINENUMBER();
00518         DumpErrorHResult( hr, "IOpenRowset::OpenRowset" );
00519         goto error;
00520         }
00521
00522     // all went well
00523     *ppIRowset_out = pIRowset;
00524     return ResultFromScode( S_OK );
00525
00526 error:
00527     if (pIRowset)
00528         pIRowset->Release();
00529     *ppIRowset_out = NULL;
00530
00531     return ResultFromScode( hr );
00532 }
00533
00534
00535 //**********************************************************************
00536 //
00537 // GetDataFromRowset
00538 //
00539 // Purpose:
00540 //
00541 //     Pulls the data from a Rowset object.
00542 //
00543 // Parameters:
00544 //
00545 //  IRowset*  pIRowset    -  interface pointer on data provider's
00546 //                             Rowset object
00547 //
00548 // Return Value:
00549 //
00550 //     S_OK        - Success
00551 //     E_*         - Failure
00552 //
00553 // Comments:
00554 //
00555 //     At a high level, a consumer pulls the data from a Rowset object by:
00556 //
00557 //     1. getting metadata for the Rowset's columns
00558 //     2. using that metadata, along with the consumer's own knowledge of
00559 //        how it wants to recieve the data, to create bindings. Bindings
00560 //        represent how the actual data in the Rowset's columns is
00561 //        actually transferred to the consumer's buffer.
00562 //     3. pass the bindings to the Rowset, and get in return an accessor
00563 //        handle that represents that particulr set of bindings
00564 //     4. get the actual data
00565 //     5. clean up the rowset (at a minumum, release the accessor)
00566 //
00567 //     GetDataFromRowset performs these steps by calling GetColumnsInfo,
00568 //     SetupBindings, CreateAccessor, GetData, and CleanupRowset
00569 //
00570 //**********************************************************************
00571
00572 HRESULT GetDataFromRowset
00573   (
00574   IRowset*  pIRowset
00575   )
00576 {
00577   ULONG       cCol;
00578   ULONG       cbMaxRowSize;   // buffer size for 1 row's data
00579   ULONG       cBind;
00580   DBBINDING   rgBind[MAX_BINDINGS];
00581   HACCESSOR   hAccessor   = NULL;
00582   DBCOLUMNINFO* pColumnInfo   = NULL;
00583   WCHAR*      pStringsBuffer  = NULL;
00584   HRESULT     hr;
00585
00586
00587
00588   DumpStatusMsg( "Reading all the data in the rowset...\n" );
00589
00590   assert(pIRowset != NULL);
00591   assert(g_pIMalloc != NULL);
00592
00593   hr = GetColumnsInfo( pIRowset, &cCol, &pColumnInfo, &pStringsBuffer );
00594   if (FAILED(hr))
00595       {
00596         DUMP_ERROR_LINENUMBER();
00597         DumpErrorHResult( hr,  "GetColumnsInfo");
00598         goto error;
00599         }
00600
00601   hr = SetupBindings( cCol, pColumnInfo, rgBind, &cBind, &cbMaxRowSize );
00602   if (FAILED(hr))
00603       {
00604         DUMP_ERROR_LINENUMBER();
00605         DumpErrorHResult( hr,  "SetupBindings");
00606         goto error;
00607         }
00608
00609   hr = CreateAccessor( pIRowset, rgBind, cBind, &hAccessor );
00610   if (FAILED(hr))
00611       {
00612         DUMP_ERROR_LINENUMBER();
00613         DumpErrorHResult( hr,  "CreateAccessor" );
00614         goto error;
00615         }
00616
00617   hr = GetData( pIRowset, cbMaxRowSize, hAccessor, rgBind, cBind, pColumnInfo, cCol );
00618   if (FAILED(hr))
00619       {
00620         DUMP_ERROR_LINENUMBER();
00621         DumpErrorHResult( hr,  "GetData" );
00622         goto error;
00623         }
00624
00625   g_pIMalloc->Free( pColumnInfo );
00626     pColumnInfo = NULL;
00627   g_pIMalloc->Free( pStringsBuffer );
00628     pStringsBuffer = NULL;
00629
00630   hr = CleanupRowset( pIRowset, hAccessor );
00631   if (FAILED(hr))
00632       {
00633         DUMP_ERROR_LINENUMBER();
00634         DumpErrorHResult( hr,  "CleanupRowset" );
00635         goto error;
00636         }
00637
00638   return ResultFromScode( S_OK );
00639
00640 error:
00641   if (pColumnInfo)
00642     g_pIMalloc->Free( pColumnInfo );
00643   if (pStringsBuffer)
00644     g_pIMalloc->Free( pStringsBuffer );
00645
00646     return ResultFromScode( hr );
00647 }
00648
00649
00650
00651
00652
00653
00654 //**********************************************************************
00655 //
00656 // GetColumnsInfo
00657 //
00658 // Purpose:
00659 //
00660 //     Obtains information (metadata) about the columns in the rowset - the types
00661 //     of the data and so on.
00662 //
00663 //
00664 // Parameters:
00665 //  IRowset*    pIRowset            - interface pointer on data provider's
00666 //                                        Rowset object
00667 //  ULONG*      pcCol_out           - out pointer through which to return
00668 //                                        number of columns in the rowset
00669 //  DBCOLUMNINFO**  ppColumnInfo_out    - out pointer through which to return
00670 //                                        pointer to structure containing
00671 //                                        metadata for the columns in the rowset
00672 //  WCHAR**     ppStringsBuffer_out - out pointer through which to return
00673 //                                        pointer to table of strings. see comments.
00674 //
00675 // Return Value:
00676 //     S_OK        - Success
00677 //     E_*         - Failure
00678 //
00679 //
00680 // Comments:
00681 //
00682 //     ppColumnInfo_out and ppStringsBuffer_out are used to return pointers
00683 //     to two buffers. These buffers are allocated by the data provider
00684 //     (when GetColumnsInfo calls IColumnsInfo::GetColumnInfo). The data
00685 //     provider uses IMalloc to allocate the buffers; therefore, the caller
00686 //     of this routine must at a later point use IMalloc::Free to free
00687 //     both of these buffers. The StringsBuffer contains strings pointed
00688 //     to by pointers in the ColumnInfo buffer, therefore the StringsBuffer
00689 //     should be freed *after* the ColumnInfo pointer.
00690 //
00691 //     GetColumnsInfo calls DumpColumnsInfo to dump the column metadata to
00692 //     the log file.
00693 //
00694 //**********************************************************************
00695
00696 HRESULT GetColumnsInfo
00697   (
00698   IRowset*    pIRowset,
00699   ULONG*      pcCol_out,
00700   DBCOLUMNINFO**  ppColumnInfo_out,
00701   WCHAR**     ppStringsBuffer_out
00702   )
00703 {
00704   IColumnsInfo*   pIColumnsInfo = NULL;
00705     ULONG     cCol;
00706     DBCOLUMNINFO* pColumnInfo;
00707     WCHAR*      pStringsBuffer;
00708   HRESULT     hr;
00709
00710
00711   assert(pIRowset != NULL);
00712     assert(pcCol_out != NULL);
00713     assert(ppColumnInfo_out != NULL);
00714     assert(ppStringsBuffer_out != NULL);
00715
00716   // get column information from the command object via IColumnsInfo
00717   hr = pIRowset->QueryInterface( IID_IColumnsInfo, (void **) &pIColumnsInfo );
00718     if (FAILED(hr))
00719       {
00720         DUMP_ERROR_LINENUMBER();
00721         DumpErrorHResult( hr, "IRowset::QI for IID_IColumnsInfo" );
00722         goto error;
00723         }
00724   hr = pIColumnsInfo->GetColumnInfo(
00725       &cCol,
00726       &pColumnInfo,
00727       &pStringsBuffer );
00728     if (FAILED(hr))
00729       {
00730         DUMP_ERROR_LINENUMBER();
00731         DumpErrorHResult( hr, "pIColumnsInfo->GetColumnInfo" );
00732         goto error;
00733         }
00734   pIColumnsInfo->Release();
00735   pIColumnsInfo = NULL;
00736
00737   DumpColumnsInfo( pColumnInfo, cCol );
00738
00739     // fill out-params
00740     *pcCol_out = cCol;
00741     *ppColumnInfo_out = pColumnInfo;
00742     *ppStringsBuffer_out = pStringsBuffer;
00743
00744   return ResultFromScode( S_OK );
00745
00746 error:
00747   if (pIColumnsInfo)
00748       pIColumnsInfo->Release();
00749
00750   *pcCol_out = 0;
00751     *ppColumnInfo_out = NULL;
00752     *ppStringsBuffer_out = NULL;
00753
00754   return ResultFromScode( hr );
00755 }
00756
00757
00758 //**********************************************************************
00759 //
00760 // SetupBindings
00761 //
00762 // Purpose:
00763 //
00764 //     Creates bindings that map the data in the rowset's columns to
00765 //     slots in the consumer's data buffer.
00766 //
00767 // Parameters:
00768 //
00769 //  ULONG       cCol                - number of columns in rowset to bind
00770 //  DBCOLUMNINFO* pColumnInfo         - pointer to column metadata
00771 //  DBBINDING*    rgBind_out          - out pointer through which to return
00772 //                                        an array of binding structures, one
00773 //                                        structure per column bound
00774 //  ULONG*      pcBind_out          - out pointer through which to return
00775 //                                        the number of columns bound (number
00776 //                                        of valid elements in rgBind_out)
00777 //  ULONG*      pcMaxRowSize_out    - out pointer through which to return
00778 //                                        the buffer size necessary to hold
00779 //                                        the largest row data
00780 //
00781 // Return Value:
00782 //     S_OK         - Success
00783 //     E_*          - Failure
00784 //
00785 //
00786 // Comments:
00787 //
00788 //
00789 //**********************************************************************
00790
00791 HRESULT SetupBindings
00792   (
00793   ULONG       cCol,
00794   DBCOLUMNINFO* pColumnInfo,
00795   DBBINDING*    rgBind_out,
00796   ULONG*      pcBind_out,
00797   ULONG*      pcMaxRowSize_out
00798   )
00799 {
00800   ULONG dwOffset;
00801   ULONG iCol;
00802   ULONG iBind;
00803
00804
00805     assert(pColumnInfo != NULL);
00806     assert(rgBind_out != NULL);
00807     assert(pcBind_out != NULL);
00808     assert(pcMaxRowSize_out != NULL);
00809
00810   memset(rgBind_out, 0, sizeof(DBBINDING)*cCol);
00811   // Create bindings.
00812   // Bind everything as a string just to keep things simple.
00813   dwOffset = 0;
00814   iBind=0;
00815   for (iCol=0; iCol < cCol; iCol++)
00816   {
00817     // Skip columns of type _VECTOR. Probably binary data.
00818     if (pColumnInfo[iCol].wType & DBTYPE_VECTOR)
00819       continue;
00820
00821     rgBind_out[iBind].dwPart  = DBPART_VALUE | DBPART_LENGTH |
00822                     DBPART_STATUS;
00823         rgBind_out[iBind].dwMemOwner= DBMEMOWNER_CLIENTOWNED;
00824         rgBind_out[iBind].eParamIO  = DBPARAMIO_NOTPARAM;
00825     rgBind_out[iBind].iOrdinal  = pColumnInfo[iCol].iOrdinal;
00826     rgBind_out[iBind].wType   = DBTYPE_STR;
00827     rgBind_out[iBind].pTypeInfo = NULL;
00828     rgBind_out[iBind].obValue   = dwOffset + offsetof(COLUMNDATA,bData);
00829     rgBind_out[iBind].obLength  = dwOffset + offsetof(COLUMNDATA,dwLength);
00830     rgBind_out[iBind].obStatus  = dwOffset + offsetof(COLUMNDATA,dwStatus);
00831     rgBind_out[iBind].bPrecision= 0;
00832     rgBind_out[iBind].bScale  = 0;
00833     rgBind_out[iBind].cbMaxLen  = pColumnInfo[iCol].wType == DBTYPE_STR ?
00834                     pColumnInfo[iCol].ulColumnSize + sizeof(char) : DEFAULT_CBMAXLENGTH;
00835     rgBind_out[iBind].pObject = NULL;
00836     rgBind_out[iBind].pBindExt  = NULL;
00837     dwOffset += rgBind_out[iBind].cbMaxLen + offsetof( COLUMNDATA, bData );
00838     dwOffset = ROUND_UP( dwOffset, COLUMN_ALIGNVAL );
00839     iBind++;
00840   }
00841
00842   *pcBind_out     = iBind;
00843   *pcMaxRowSize_out = dwOffset;
00844
00845   return ResultFromScode( S_OK );
00846 }
00847
00848
00849
00850 //**********************************************************************
00851 //
00852 // CreateAccessor
00853 //
00854 // Purpose:
00855 //
00856 //     Passes a set of bindings to the data provider and recieves in return
00857 //     an accessor handle that represents those bindings.
00858 //
00859 // Parameters:
00860 //  IRowset*  pIRowset        - interface pointer on data provider's Rowset
00861 //                                object
00862 //  DBBINDING*  rgBind          - array of binding structures
00863 //  ULONG   cBind           - number of binding structures in rgBind
00864 //  HACCESSOR*  phAccessor_out  - out pointer through which to return an
00865 //                                accessor handle that represents all the bindings
00866 //                                in rgBind
00867 //
00868 // Return Value:
00869 //     S_OK        - Success
00870 //     E_*         - Failure
00871 //
00872 //
00873 // Comments:
00874 //
00875 //
00876 //**********************************************************************
00877
00878 HRESULT CreateAccessor
00879   (
00880   IRowset*  pIRowset,
00881   DBBINDING*  rgBind,
00882   ULONG   cBind,
00883   HACCESSOR*  phAccessor_out
00884   )
00885 {
00886   IAccessor*  pIAccessor = NULL;
00887   HACCESSOR   hAccessor;
00888   HRESULT   hr;
00889
00890
00891   assert(pIRowset != NULL);
00892     assert(rgBind != NULL);
00893     assert(phAccessor_out != NULL);
00894
00895     // Get an accessor for our bindings from the rowset, via IAccessor
00896   hr = pIRowset->QueryInterface( IID_IAccessor, (void**)&pIAccessor );
00897   if (FAILED(hr))
00898       {
00899         DUMP_ERROR_LINENUMBER();
00900         DumpErrorHResult( hr, "pIRowset->QI for IID_IAccessor" );
00901         goto error;
00902         }
00903   hr = pIAccessor->CreateAccessor( DBACCESSOR_ROWDATA, cBind, rgBind, 0,
00904                                    &hAccessor, NULL );
00905   if (FAILED(hr))
00906       {
00907         DUMP_ERROR_LINENUMBER();
00908         DumpErrorHResult( hr, "pIAccessor->CreateAccessor" );
00909         goto error;
00910         }
00911   pIAccessor->Release();
00912   pIAccessor = NULL;
00913
00914   *phAccessor_out = hAccessor;
00915
00916   return ResultFromScode( S_OK );
00917
00918 error:
00919   if (pIAccessor)
00920       pIAccessor->Release();
00921   *phAccessor_out = NULL;
00922
00923   return ResultFromScode( hr );
00924 }
00925
00926
00927 //**********************************************************************
00928 //
00929 // GetData
00930 //
00931 // Purpose:
00932 //
00933 //     Reads the data from a rowset.
00934 //
00935 // Parameters:
00936 //
00937 //     IRowset*  pIRowset           - interface pointer on data provider's
00938 //                                    Rowset object
00939 //     ULONG     cMaxRowSize        - size of buffer needed to hold the data
00940 //                                    for the largest row
00941 //     HACCESSOR hAccessor          - accessor handle representing the set
00942 //                                    of desired bindings
00943 //     DBBINDING*   rgBind      - needed only for pretty printing
00944 //     ULONG      cBind     - for pretty printing
00945 //     DBCOLUMNINFO*  pColumnInfo - for pretty printing
00946 //     ULONG      cCol    - for pretty printing
00947 //
00948 //
00949 // Return Value:
00950 //     S_OK        - Success
00951 //     E_*         - Failure
00952 //
00953 //
00954 //
00955 // Comments:
00956 //
00957 //     GetData reads all the rows in the rowset, sequentially.
00958 //
00959 //     GetData calls CalcPrettyPrintMaxColWidth, DumpColumnHeadings, and
00960 //     DumpRow to dump the row data to a log file.
00961 //
00962 //
00963 //**********************************************************************
00964
00965 HRESULT GetData
00966   (
00967   IRowset*  pIRowset,
00968   ULONG     cMaxRowSize,
00969     HACCESSOR   hAccessor,
00970     DBBINDING*    rgBind,
00971     ULONG     cBind,
00972     DBCOLUMNINFO* pColumnInfo,
00973     ULONG     cCol
00974   )
00975 {
00976   ULONG   cRowsObtained;
00977   ULONG iRow;
00978   BYTE* pRowData = NULL;
00979   HROW  rghRows[NUMROWS_CHUNK];
00980   HROW* pRows = &rghRows[0];
00981   ULONG cMaxColWidth;     // needed for pretty printing
00982   HRESULT hr;
00983
00984
00985   assert(pIRowset != NULL);
00986     assert(rgBind != NULL);
00987     assert(pColumnInfo != NULL);
00988
00989   // create a buffer for row data, big enough to hold the biggest row
00990   pRowData = (BYTE *) malloc( cMaxRowSize );
00991   if (!pRowData)
00992     {
00993         DUMP_ERROR_LINENUMBER();
00994         DumpErrorMsg("GetData: malloc failed\n");
00995         goto error;
00996     }
00997
00998   // pretty print
00999     cMaxColWidth = CalcPrettyPrintMaxColWidth( rgBind, cBind );
01000
01001     // pretty print
01002   DumpColumnHeadings( rgBind, cBind, pColumnInfo, cCol, cMaxColWidth );
01003
01004     // process all the rows, NUMROWS_CHUNK rows at a time
01005   while (1)
01006     {
01007     hr = pIRowset->GetNextRows(
01008       NULL,           // hChapter
01009       0,              // cRowsToSkip
01010       NUMROWS_CHUNK,        // cRowsDesired
01011       &cRowsObtained,             // pcRowsObtained
01012       &pRows );         // filled in w/ row handles
01013     if (FAILED(hr))
01014       {
01015             DUMP_ERROR_LINENUMBER();
01016             DumpErrorHResult( hr, "pIRowset->GetNextRows" );
01017             goto error;
01018       }
01019
01020     if ( cRowsObtained == 0 )     // all done, no more rows left to get
01021       break;
01022
01023     // loop over rows obtained, getting data for each
01024     for ( iRow=0; iRow < cRowsObtained; iRow++ )
01025       {
01026       hr = pIRowset->GetData(
01027         rghRows[iRow],
01028         hAccessor,
01029         pRowData );
01030              if (FAILED(hr))
01031               {
01032                 DUMP_ERROR_LINENUMBER();
01033                 DumpErrorHResult( hr, "pIRowset->GetData" );
01034                 goto error;
01035               }
01036
01037       // pretty print
01038             DumpRow( rgBind, cBind, cMaxColWidth, pRowData );
01039       }
01040     // release row handles
01041     hr = pIRowset->ReleaseRows( cRowsObtained, rghRows, NULL, NULL, NULL );
01042         if (FAILED(hr))
01043               {
01044                 DUMP_ERROR_LINENUMBER();
01045                 DumpErrorHResult( hr, "pIRowset->ReleaseRows" );
01046                 goto error;
01047               }
01048     } // end while
01049
01050   // free row data buffer
01051   free( pRowData );
01052   return ResultFromScode( S_OK );
01053
01054 error:
01055   if (pRowData)
01056     free( pRowData );
01057
01058     return ResultFromScode( hr );
01059 }
01060
01061
01062
01063 //**********************************************************************
01064 //
01065 // CleanupRowset
01066 //
01067 // Purpose:
01068 //
01069 //     Allows the rowset to perform any necessary cleanup.
01070 //
01071 // Parameters:
01072 //
01073 //  IRowset*  pIRowset    - interface pointer on data provider's Rowset
01074 //                            object
01075 //  HACCESSOR   hAccessor   - accessor handle to release
01076 //
01077 // Return Value:
01078 //
01079 //     S_OK        - Success
01080 //     E_*         - Failure
01081 //
01082 //
01083 // Comments:
01084 //
01085 //     In this sample, the only cleanup that the rowset needs to do is
01086 //     release the accessor handle.
01087 //
01088 //**********************************************************************
01089
01090 HRESULT CleanupRowset
01091   (
01092   IRowset*  pIRowset,
01093   HACCESSOR   hAccessor
01094   )
01095 {
01096   IAccessor*  pIAccessor = NULL;
01097   HRESULT   hr;
01098
01099     assert(pIRowset != NULL);
01100
01101   // tell the rowset object it can release the accessor, via IAccessor
01102   hr = pIRowset->QueryInterface( IID_IAccessor, (void**)&pIAccessor );
01103   if (FAILED(hr))
01104     {
01105         DUMP_ERROR_LINENUMBER();
01106     DumpErrorHResult( hr, "pIRowset->QI for IID_IAccessor" );
01107     goto error;
01108     }
01109   hr = pIAccessor->ReleaseAccessor( hAccessor, NULL );
01110   if (FAILED(hr))
01111     {
01112         DUMP_ERROR_LINENUMBER();
01113     DumpErrorHResult( hr, "pIAccessor->ReleaseAccessor" );
01114     goto error;
01115     }
01116   pIAccessor->Release();
01117   pIAccessor = NULL;
01118
01119   return ResultFromScode( S_OK );
01120
01121 error:
01122   if (pIAccessor)
01123       pIAccessor->Release();
01124
01125     return ResultFromScode( hr );
01126 }
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkCollection/C#/AssemblyInfo.cs Source File

  • TabletPC
  • InkCollection
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("Ink Collection Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2003 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Accept/NBAccept.cpp Source File

  • NetDS
  • WinSock
  • Accept

NBAccept.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: NBAccept.cpp
00009 //
00010 // Description:
00011 //             This file contains the functions for implementing the
00012 // non-blocking version of the accept. It uses many of the common functions
00013 // defined in Common.cpp.
00014
00015 #include "common.h"
00016
00017 /*
00018     This function is the entry point for the Non-blocking Accept implementation.
00019     It waits on select for each of the listening/accepted sockets until any
00020     event is signalled. If a listening socket gets signalled, it performs
00021     accept. If an accepted socket gets signalled, it performs read and echoes
00022     back the data.
00023 */
00024 void NonBlockingAcceptMain()
00025 {
00026     // prints a "i am still awake" message every few seconds.
00027     const long HEART_BEAT_INTERVAL = 30;
00028     PSOCK_INFO pSockInfo,
00029                pNextSock;
00030     FD_SET readFDSet;
00031     struct timeval interval;
00032     int nReady;
00033     BOOL bSocketError;
00034     int nSocksInFDSet;
00035
00036     printf("Entering NonBlockingAcceptMain()\n");
00037
00038     // process the available sockets in the global socket list.
00039     while(g_AcceptContext.pSockList)
00040     {
00041         // first, prepare the FD_SET for passing to select.
00042
00043         // initialize the FD_SET
00044         FD_ZERO(&readFDSet);
00045         nSocksInFDSet = 0;
00046
00047         // include each socket in the FD_SET. For listening sockets,
00048         // read means a new connection is available.
00049         for(pSockInfo = g_AcceptContext.pSockList;  pSockInfo != NULL;
00050                                                     pSockInfo = pSockInfo->next)
00051         {
00052             // the FD_SET will take only upto FD_SETSIZE number of sockets.
00053             // so, we signal an error if we exceed the MAX_CLIENTS which is
00054             // less than or equal to FD_SETSIZE. If more clients need to be
00055             // supported, then FD_SETSIZE can be redefined before including
00056             // winsock2.h
00057             if (nSocksInFDSet < MAX_CLIENTS)
00058             {
00059                 FD_SET(pSockInfo->sock, &readFDSet);
00060                 nSocksInFDSet++;
00061             }
00062             else
00063             {
00064                 printf("ERROR: Number of sockets in FD Set exceeds MAX_CLIENTS (%d)\n", MAX_CLIENTS);
00065                 break;
00066             }
00067         }
00068         printf("Num sockets in FD_SET: %d\n", nSocksInFDSet);
00069
00070         // wait on select for HEART_BEAT_INTEVAL seconds to see if any of
00071         // the sockets are signalled.
00072         interval.tv_sec = HEART_BEAT_INTERVAL;
00073         interval.tv_usec = 0;
00074         printf("Waiting in select for data/connections ...\n");
00075
00076         // currently we use only the read set, which signals all the
00077         // three events required:
00078         //      accept for listening sockets,
00079         //      read for connected sockets and
00080         //      close for both type of sockets on error.
00081         nReady = select(0, &readFDSet, NULL, NULL, &interval);
00082         if (nReady == SOCKET_ERROR)
00083         {
00084             printf("ERROR: select failed. Error = %d\n", WSAGetLastError());
00085
00086             // pause so as not to output frequently in case of repeated errors.
00087             Sleep(3000);
00088             continue;
00089         }
00090
00091         // check if some socket was signalled.
00092         if (nReady == 0)
00093         {
00094             printf("No connections/data in the last %d seconds. \n",
00095                                                 HEART_BEAT_INTERVAL);
00096             continue;
00097         }
00098
00099         // find out which socket was signalled and process that socket.
00100         // since nReady indicates how many sockets are in the signalled
00101         // state, we don't need to loop if we have already processed that
00102         // many sockets.
00103         pSockInfo = g_AcceptContext.pSockList;
00104         while (pSockInfo != NULL && nReady > 0)
00105         {
00106             // check if this socket is set.
00107             if (FD_ISSET(pSockInfo->sock, &readFDSet))
00108             {
00109                 nReady--;
00110
00111                 // for listening sockets, signalling on a read set means
00112                 // a new connection is available.
00113                 if (pSockInfo->isSocketListening)
00114                 {
00115                     // accept the connection and add the new socket to the
00116                     // beginning of the list (not the end, so that we won't
00117                     // come across the newly added sockets before they are
00118                     // included in the next select call later).
00119                     ProcessAcceptEvent(pSockInfo);
00120                 }
00121                 else
00122                 {
00123                     // this read event for a connected socket means data
00124                     // is available or socket is closed.
00125
00126                     // read data if available and if we have buffer space.
00127                     bSocketError = ProcessReadEvent(pSockInfo);
00128
00129                     // if we already found that the socket is closed due to
00130                     // some errors, we don't need to send the data
00131                     if (!bSocketError)
00132                     {
00133                         // so far no error, so try echoing the data back.
00134                         bSocketError = SendData(pSockInfo);
00135                     }
00136
00137                     // if there was an error in recv/send, close the
00138                     // socket.
00139                     if (bSocketError)
00140                     {
00141                         // close the socket
00142                         closesocket(pSockInfo->sock);
00143                         printf("Closed socket %d. "
00144                                "Total Bytes Recd = %d, "
00145                                "Total Bytes Sent = %d\n",
00146                                 pSockInfo->sock,
00147                                 pSockInfo->nTotalRecd,
00148                                 pSockInfo->nTotalSent);
00149
00150                         // delete the SockInfo structure and free the memory.
00151                         pNextSock = pSockInfo->next;
00152                         DeleteSockInfoFromList(&g_AcceptContext.pSockList,
00153                                                pSockInfo);
00154                         pSockInfo = pNextSock;
00155                         continue;
00156                     }
00157                 }
00158             }
00159
00160             // move on to the next socket. as mentioned earlier, since
00161             // new sockets are added only in the beginning of the list
00162             // we won't be processing them until they are included in the
00163             // next select call.
00164             pSockInfo = pSockInfo->next;
00165         }
00166
00167     }
00168
00169     printf("Exiting NonBlockingAcceptMain()\n");
00170     return;
00171 }
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/onperm.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

onperm.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  OnPerm.cpp
00006 //
00007 // Description:
00008 //  This file implements the register/unregister of permenant
00009 //    event consumers. The actual consumer is the WBEMPermEvents
00010 //    project.
00011 //
00012 // History:
00013 //
00014 // **************************************************************************
00015 #include "stdafx.h"
00016 #include "AdvClientDlg.h"
00017 #include <tchar.h>
00018
00019 // my specific class GUID.
00020 // {1E069401-087E-11d1-AD85-00AA00B8E05A}
00021 static const GUID CLSID_AdvClientConsumer =
00022 { 0x1e069401, 0x87e, 0x11d1, { 0xad, 0x85, 0x0, 0xaa, 0x0, 0xb8, 0xe0, 0x5a } };
00023
00024 // ========================================================
00025 BOOL CAdvClientDlg::PermRegistered()
00026 {
00027   HRESULT hRes;
00028   BOOL retval = FALSE;
00029   IWbemClassObject *pConsumerInst = NULL;
00030   BSTR instName = SysAllocString(L"__EventFilter.Name=\"Sample Perm Query\"");
00031   if (!instName)
00032   {
00033     TRACE(_T("SysAllocString failed: not enough memory\n"));
00034     return FALSE;
00035   }
00036
00037   // switch to the root\cimv2\office namespace.
00038   if(EnsureOfficeNamespace())
00039   {
00040     // if the EventFilter is there...
00041     if((hRes = m_pOfficeService->GetObject(instName,
00042                         0L, NULL,
00043                         &pConsumerInst,
00044                         NULL)) == S_OK)
00045     {
00046       pConsumerInst->Release();
00047       pConsumerInst = NULL;
00048
00049       // assume the perm sink is registered.
00050       retval = TRUE;
00051     }
00052   }
00053
00054   SysFreeString(instName);
00055   return retval;
00056 }
00057
00058 // ========================================================
00059 BOOL CAdvClientDlg::OnPermRegister()
00060 {
00061   BOOL retval = FALSE;
00062   IWbemClassObject *pConsumer = NULL;
00063   IWbemClassObject *pFilter = NULL;
00064
00065   m_eventList.ResetContent();
00066
00067   // switch to the root\cimv2\office namespace.
00068   if(EnsureOfficeNamespace())
00069   {
00070     if(GetConsumer(&pConsumer))
00071     {
00072       if(AddFilter(&pFilter))
00073       {
00074         if(AddBinding(pConsumer, pFilter))
00075         {
00076           retval = TRUE;
00077           m_eventList.AddString(_T("Permanent is ready"));
00078         }
00079         else
00080         {
00081           m_eventList.AddString(_T("Failed To Register"));
00082         } //endif AddBinding()
00083       }
00084       else
00085       {
00086       } //endif AddFilter()
00087     }
00088     else
00089     {
00090     } //endif AddConsumer()
00091   }
00092   return retval;
00093 }
00094 // ========================================================
00095 void CAdvClientDlg::OnPermUnregister()
00096 {
00097   HRESULT hRes;
00098   BSTR instName;
00099
00100   if(EnsureOfficeNamespace())
00101   {
00102     // delete the filter instance.
00103     instName = SysAllocString(L"__EventFilter.Name=\"Sample Perm Query\"");
00104     if (!instName)
00105     {
00106       TRACE(_T("SysAllocString failed: not enough memory\n"));
00107       return;
00108     }
00109     if((hRes = m_pOfficeService->DeleteInstance(instName,
00110                           0L, NULL,
00111                           NULL)) != S_OK)
00112     {
00113       TRACE(_T("Cant delete filter, %s\n"), ErrorString(hRes));
00114     }
00115     SysFreeString(instName);
00116
00117     // delete the association instance.
00118     // NOTE: Remember the triple backslashes on the inner quotes.
00119     instName = SysAllocString(L"__FilterToConsumerBinding.Consumer=\"SampleViewerConsumer.Name=\\\"Sample says:\\\"\",Filter=\"__EventFilter.Name=\\\"Sample Perm Query\\\"\"");
00120     if (!instName)
00121     {
00122       TRACE(_T("SysAllocString failed: not enough memory\n"));
00123       return;
00124     }
00125     if((hRes = m_pOfficeService->DeleteInstance(instName,
00126                           0L, NULL,
00127                           NULL)) != S_OK)
00128     {
00129       TRACE(_T("Cant delete association, %s\n"), ErrorString(hRes));
00130     }
00131
00132     SysFreeString(instName);
00133   }
00134   m_eventList.ResetContent();
00135   m_eventList.AddString(_T("Permanent is removed"));
00136 }
00137
00138 //------------------------------------------------------------
00139 BOOL CAdvClientDlg::GetConsumer(IWbemClassObject **ppConsumer)
00140 {
00141   BOOL retval = FALSE;
00142   HRESULT hRes;
00143   BSTR curInst;
00144   CString str(L"SampleViewerConsumer.Name=\"Sample says:\"");
00145 //  CString ConsumerCLSID(L"{1E069401-087E-11d1-AD85-00AA00B8E05A}");
00146
00147   curInst = str.AllocSysString();
00148   if (! curInst)
00149   {
00150     TRACE(_T("AllocSysString failed"));
00151
00152     return FALSE;
00153   }
00154
00155   //---------------------
00156   if((hRes = m_pOfficeService->GetObject(curInst, 0L, NULL,
00157                       ppConsumer, NULL)) == S_OK)
00158   {
00159     retval = TRUE;
00160   }
00161   else
00162   {
00163     TRACE(_T("Second GetObject() pConsumerInst failed: %s\n"), ErrorString(hRes));
00164   } //endif GetObject()
00165
00166   SysFreeString(curInst);
00167
00168   return retval;
00169 }
00170 // ========================================================
00171 BOOL CAdvClientDlg::AddFilter(IWbemClassObject **ppFilter)
00172 {
00173   BOOL retval = FALSE;
00174
00175   HRESULT hRes;
00176   VARIANT v;
00177   VariantInit(&v);
00178
00179   CString FilterName(_T("Sample Perm Query"));
00180   CString FilterClass(L"__EventFilter");
00181   CString FilterClassKey(L"Name");
00182   CString QueryProp(L"Query");
00183   CString LangProp(L"QueryLanguage");
00184   CString theQuery(L"select * from __InstanceCreationEvent where TargetInstance isa \"SAMPLE_OfficeEquipment\"");
00185   BSTR Prop = NULL;
00186   BSTR curInst = NULL;
00187   BSTR FilterClassName = NULL;
00188
00189   IWbemClassObject *pFilterClass = NULL;
00190   IWbemClassObject *pFilterInst = NULL;
00191
00192
00193   FilterClassName = FilterClass.AllocSysString();
00194   if (!FilterClassName)
00195     goto OutOfMemory;
00196
00197
00198   //---------------------
00199   // if class exists...
00200   if((hRes = m_pOfficeService->GetObject(FilterClassName,
00201                   0L, NULL,
00202                   &pFilterClass,
00203                   NULL)) == S_OK)
00204   {
00205     //---------------------
00206     // spawn a new instance
00207     if((hRes = pFilterClass->SpawnInstance(0, &pFilterInst)) == S_OK)
00208     {
00209       TRACE(_T("SpawnInstance() worked\n"));
00210
00211       // set the key property.
00212       V_VT(&v) = VT_BSTR;
00213       V_BSTR(&v) = FilterName.AllocSysString();
00214       if (!V_BSTR(&v))
00215         goto OutOfMemory;
00216
00217       Prop = FilterClassKey.AllocSysString();
00218       if (!Prop)
00219         goto OutOfMemory;
00220
00221       pFilterInst->Put(Prop, 0, &v, 0);
00222       VariantClear(&v);
00223       SysFreeString(Prop);
00224
00225       V_VT(&v) = VT_BSTR;
00226       V_BSTR(&v) = theQuery.AllocSysString();
00227       if (!V_BSTR(&v))
00228         goto OutOfMemory;
00229       Prop = QueryProp.AllocSysString();
00230       if (!Prop)
00231         goto OutOfMemory;
00232       pFilterInst->Put(Prop, 0, &v, 0);
00233       VariantClear(&v);
00234       SysFreeString(Prop);
00235
00236       V_VT(&v) = VT_BSTR;
00237       V_BSTR(&v) = SysAllocString(L"WQL");
00238       if (!V_BSTR(&v))
00239         goto OutOfMemory;
00240       Prop = LangProp.AllocSysString();
00241       if (!Prop)
00242         goto OutOfMemory;
00243       pFilterInst->Put(Prop, 0, &v, 0);
00244       VariantClear(&v);
00245       SysFreeString(Prop);
00246
00247       //---------------------
00248       // putInstance
00249       hRes = m_pOfficeService->PutInstance(pFilterInst, 0, NULL, NULL);
00250
00251       pFilterInst->Release();
00252       pFilterInst = NULL;
00253
00254       CString str = FilterClass + _T(".") + FilterClassKey;
00255       str += _T("=\"");
00256       str += FilterName;
00257       str += _T("\"");
00258
00259       curInst = str.AllocSysString();
00260       if (!curInst)
00261         goto OutOfMemory;
00262
00263       TRACE(_T("flushing instance for %s\n"), str);
00264
00265       //---------------------
00266       if((hRes = m_pOfficeService->GetObject(curInst, 0L, NULL,
00267                       ppFilter, NULL)) == S_OK)
00268       {
00269         retval = TRUE;
00270       }
00271       else
00272       {
00273         TRACE(_T("Second GetObject() pFilterInst failed: %s\n"), ErrorString(hRes));
00274       } //endif GetObject()
00275
00276       SysFreeString(curInst);
00277     }
00278     else
00279     {
00280       TRACE(_T("SpawnInstance() failed: %s\n"), ErrorString(hRes));
00281
00282     } //endif SpawnInstance()
00283
00284     pFilterClass->Release();  // Don't need the class any more
00285     pFilterClass = NULL;
00286
00287   } // endif class doesnt exist.
00288
00289   SysFreeString(FilterClassName);
00290   return retval;
00291
00292 OutOfMemory:
00293   SysFreeString (FilterClassName);
00294   SysFreeString (Prop);
00295   SysFreeString (curInst);
00296
00297   if (pFilterClass)
00298     pFilterClass->Release();
00299   if (pFilterInst)
00300     pFilterInst->Release();
00301
00302   VariantClear(& v);
00303
00304   TRACE(_T("SysAllocString failed: not enough memory\n"));
00305
00306   return FALSE;
00307
00308 }
00309 // ========================================================
00310 BOOL CAdvClientDlg::AddBinding(IWbemClassObject *pConsumer,
00311                 IWbemClassObject *pFilter)
00312 {
00313   BOOL retval = FALSE;
00314   HRESULT hRes;
00315   VARIANT v;
00316   VariantInit(&v);
00317
00318   IWbemClassObject *pAClass = NULL;
00319   IWbemClassObject *pAInst = NULL;
00320
00321   BSTR AssocClassName = SysAllocString(L"__FilterToConsumerBinding");
00322   if (!AssocClassName)
00323   {
00324     TRACE(_T("SysAllocString failed: not enough memory\n"));
00325     return FALSE;
00326   }
00327
00328   BSTR ConsumerProp = SysAllocString(L"Consumer");
00329   if (!ConsumerProp)
00330   {
00331     SysFreeString(AssocClassName);
00332     TRACE(_T("SysAllocString failed: not enough memory\n"));
00333     return FALSE;
00334   }
00335
00336   BSTR FilterProp = SysAllocString(L"Filter");
00337   if (!FilterProp)
00338   {
00339     SysFreeString(AssocClassName);
00340     SysFreeString(ConsumerProp);
00341     TRACE(_T("SysAllocString failed: not enough memory\n"));
00342     return FALSE;
00343   }
00344
00345   BSTR PathProp = SysAllocString(L"__RELPATH");
00346   if (!PathProp)
00347   {
00348     SysFreeString(AssocClassName);
00349     SysFreeString(ConsumerProp);
00350     SysFreeString(FilterProp);
00351     TRACE(_T("SysAllocString failed: not enough memory\n"));
00352     return FALSE;
00353   }
00354
00355   // if association class exists...
00356   if((hRes = m_pOfficeService->GetObject(AssocClassName,
00357                     0L, NULL,
00358                     &pAClass,
00359                     NULL)) == S_OK)
00360   {
00361     //------------------------------
00362     // spawn a new instance.
00363     if((hRes = pAClass->SpawnInstance(0, &pAInst)) == S_OK)
00364     {
00365       TRACE(_T("Assoc SpawnInstance() worked\n"));
00366
00367
00368       //-----------------------------------
00369       // set consumer instance name
00370       if ((hRes = pConsumer->Get(PathProp, 0L,
00371                   &v, NULL, NULL)) == S_OK)
00372       {
00373         hRes = pAInst->Put(ConsumerProp, 0, &v, 0);
00374         TRACE(_T("Got Consumer ref: %s\n"), ErrorString(hRes));
00375         VariantClear(&v);
00376       }
00377       else
00378       {
00379         TRACE(_T("Get() consumer ref failed: %s\n"), ErrorString(hRes));
00380       } //endif Get()
00381
00382       //-----------------------------------
00383       // set Filter ref
00384       if ((hRes = pFilter->Get(PathProp, 0L,
00385                   &v, NULL, NULL)) == S_OK)
00386       {
00387         hRes = pAInst->Put(FilterProp, 0, &v, 0);
00388         TRACE(_T("Got filter ref: %s\n"), ErrorString(hRes));
00389         VariantClear(&v);
00390       }
00391       else
00392       {
00393         TRACE(_T("Get() filter ref failed: %s\n"), ErrorString(hRes));
00394       } //endif Get()
00395
00396       SysFreeString(PathProp);
00397
00398       //-----------------------------------
00399       // putInstance
00400       if((hRes = m_pOfficeService->PutInstance(pAInst, WBEM_FLAG_CREATE_OR_UPDATE, NULL, NULL)) == S_OK)
00401       {
00402         retval = TRUE;
00403       }
00404       else
00405       {
00406         TRACE(_T("PutInstance() __FilterToConsumerBinding failed: %s\n"), ErrorString(hRes));
00407       }
00408
00409       pAInst->Release();
00410       pAInst = NULL;
00411     }
00412     else
00413     {
00414       TRACE(_T("SpawnInstance() failed: %s\n"), ErrorString(hRes));
00415
00416     } //endif SpawnInstance()
00417   }
00418   else
00419   {
00420     TRACE(_T("GetObject() class failed: %s\n"), ErrorString(hRes));
00421
00422   } // endif GetObject() class.
00423
00424
00425   if(pAClass)
00426   {
00427     pAClass->Release();
00428     pAClass = NULL;
00429   }
00430
00431   SysFreeString(AssocClassName);
00432   SysFreeString(ConsumerProp);
00433   SysFreeString(FilterProp);
00434
00435   return retval;
00436 }
00437
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/comp.Cpp Source File

  • SysMgmt
  • MMC
  • About

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 CComponent::CComponent(CComponentData *parent)
00029 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL)
00030 {
00031     OBJECT_CREATED
00032 }
00033
00034 CComponent::~CComponent()
00035 {
00036     OBJECT_DESTROYED
00037 }
00038
00039 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00040 {
00041     if (!ppv)
00042         return E_FAIL;
00043
00044     *ppv = NULL;
00045
00046     if (IsEqualIID(riid, IID_IUnknown))
00047         *ppv = static_cast<IComponent *>(this);
00048     else if (IsEqualIID(riid, IID_IComponent))
00049         *ppv = static_cast<IComponent *>(this);
00050
00051     if (*ppv)
00052     {
00053         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00054         return S_OK;
00055     }
00056
00057     return E_NOINTERFACE;
00058 }
00059
00060 STDMETHODIMP_(ULONG) CComponent::AddRef()
00061 {
00062     return InterlockedIncrement((LONG *)&m_cref);
00063 }
00064
00065 STDMETHODIMP_(ULONG) CComponent::Release()
00066 {
00067     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00068     {
00069         delete this;
00070         return 0;
00071     }
00072     return m_cref;
00073
00074 }
00075
00076 ///////////////////////////////
00077 // Interface IComponent
00078 ///////////////////////////////
00079 STDMETHODIMP CComponent::Initialize(
00080                                     /* [in] */ LPCONSOLE lpConsole)
00081 {
00082     HRESULT hr = S_OK;
00083
00084     // Save away all the interfaces we'll need.
00085     // Fail if we can't QI the required interfaces.
00086
00087     m_ipConsole = lpConsole;
00088     m_ipConsole->AddRef();
00089
00090     return hr;
00091 }
00092
00093 STDMETHODIMP CComponent::Notify(
00094                                 /* [in] */ LPDATAOBJECT lpDataObject,
00095                                 /* [in] */ MMC_NOTIFY_TYPE event,
00096                                 /* [in] */ LPARAM arg,
00097                                 /* [in] */ LPARAM param)
00098 {
00099   MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00100
00101     return S_FALSE;
00102 }
00103
00104 STDMETHODIMP CComponent::Destroy(
00105                                  /* [in] */ MMC_COOKIE cookie)
00106 {
00107     if (m_ipConsole) {
00108         m_ipConsole->Release();
00109         m_ipConsole = NULL;
00110     }
00111
00112     return S_OK;
00113 }
00114
00115
00116 STDMETHODIMP CComponent::QueryDataObject(
00117                                          /* [in] */ MMC_COOKIE cookie,
00118                                          /* [in] */ DATA_OBJECT_TYPES type,
00119                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00120 {
00121     CDataObject *pObj = NULL;
00122
00123     if (cookie == 0)
00124         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00125     else
00126         pObj = new CDataObject(cookie, type);
00127
00128     if (!pObj)
00129         return E_OUTOFMEMORY;
00130
00131     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00132
00133     return S_OK;
00134 }
00135
00136 STDMETHODIMP CComponent::GetResultViewType(
00137                                            /* [in] */ MMC_COOKIE cookie,
00138                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00139                                            /* [out] */ long __RPC_FAR *pViewOptions)
00140 {
00141     CDelegationBase *base = (CDelegationBase *)cookie;
00142
00143     //
00144     // Ask for default listview.
00145     //
00146     if (base == NULL)
00147     {
00148         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00149         *ppViewType = NULL;
00150     }
00151     else
00152         return base->GetResultViewType(ppViewType, pViewOptions);
00153
00154     return S_OK;
00155 }
00156
00157 STDMETHODIMP CComponent::GetDisplayInfo(
00158                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00159 {
00160     HRESULT hr = S_OK;
00161     CDelegationBase *base = NULL;
00162
00163     // if they are asking for the RDI_STR we have one of those to give
00164
00165     if (pResultDataItem->lParam) {
00166         base = (CDelegationBase *)pResultDataItem->lParam;
00167         if (pResultDataItem->mask & RDI_STR) {
00168       LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00169       MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00170             pResultDataItem->str = pszW;
00171         }
00172
00173         if (pResultDataItem->mask & RDI_IMAGE) {
00174             pResultDataItem->nImage = base->GetBitmapIndex();
00175         }
00176     }
00177
00178     return hr;
00179 }
00180
00181
00182 STDMETHODIMP CComponent::CompareObjects(
00183                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00184                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00185 {
00186     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00187     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00188
00189     // compare the object pointers
00190     if (baseA->GetCookie() == baseB->GetCookie())
00191         return S_OK;
00192
00193     return S_FALSE;
00194 }
00195
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::StreamTypeEnum Member List

This is the complete list of members for msado15::StreamTypeEnum, including all inherited members.
adTypeBinary | msado15::StreamTypeEnum | [static]
adTypeText | msado15::StreamTypeEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/globals.h Source File

  • SysMgmt
  • MMC
  • Menubtn

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025   #define IDM_BUTTON1    0x100
00026   #define IDM_BUTTON2    0x101
00027
00028   extern HINSTANCE g_hinst;
00029   extern ULONG g_uObjects;
00030
00031   #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032   #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034   // uncomment the following #define to enable message cracking
00035   // #define MMC_CRACK_MESSAGES
00036   void MMCN_Crack(BOOL bComponentData,
00037           IDataObject *pDataObject,
00038           IComponentData *pCompData,
00039           IComponent *pComp,
00040           MMC_NOTIFY_TYPE event,
00041           LPARAM arg,
00042           LPARAM param);
00043 #endif
00044
00045 //=--------------------------------------------------------------------------=
00046 // allocates a temporary buffer that will disappear when it goes out of scope
00047 // NOTE: be careful of that -- make sure you use the string in the same or
00048 // nested scope in which you created this buffer. people should not use this
00049 // class directly.  use the macro(s) below.
00050 //
00051 class TempBuffer {
00052   public:
00053     TempBuffer(ULONG cBytes) {
00054         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00055         m_fHeapAlloc = (cBytes > 120);
00056     }
00057     ~TempBuffer() {
00058         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00059     }
00060     void *GetBuffer() {
00061         return m_pBuf;
00062     }
00063
00064   private:
00065     void *m_pBuf;
00066     // we'll use this temp buffer for small cases.
00067     //
00068     char  m_szTmpBuf[120];
00069     unsigned m_fHeapAlloc:1;
00070 };
00071
00072 //=--------------------------------------------------------------------------=
00073 // string helpers.
00074 //
00075 // given a _TCHAR, copy it into a wide buffer.
00076 // be careful about scoping when using this macro!
00077 //
00078 // how to use the below two macros:
00079 //
00080 //  ...
00081 //  LPTSTR pszT;
00082 //  pszT = MyGetTStringRoutine();
00083 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00084 //  MyUseWideStringRoutine(pwsz);
00085 //  ...
00086 #ifdef UNICODE
00087 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00088     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00089     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00090     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00091     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00092 #else // ANSI
00093 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00094     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00095     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00096     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00097     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00098     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00099 #endif
00100
00101 #ifdef UNICODE
00102 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00103     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00104     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00105     lstrcpyW((LPWSTR)ptrname, tstr)
00106 #else // ANSI
00107 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00108     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00109     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00110     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00111     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00112 #endif
00113
00114 //
00115 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00116 // have to be declared, and no clean up must be done.
00117 //
00118 // * 2 for DBCS handling in below length computation
00119 //
00120 #ifdef UNICODE
00121 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00122     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00123     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00124     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00125     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00126 #else // ANSI
00127 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00128     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00129     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00130     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00131     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00132 #endif
00133
00134 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/CStorageResType.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

CStorageResType.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      CStorageResType.cpp
00005 //
00006 //  Description:
00007 //      Implementation for the ClusCfg Managed Resource Type class - this
00008 //      demonstrates how to implement the IClusCfgResourceTypeInfo interface.
00009 //
00010 //  Header File:
00011 //      CStorageResType.h
00012 //
00013 //////////////////////////////////////////////////////////////////////////////
00014
00015 //////////////////////////////////////////////////////////////////////////////
00016 // Include Files
00017 //////////////////////////////////////////////////////////////////////////////
00018
00019 #include "stdafx.h"
00020 #include "CStorageResType.h"
00021
00022
00023 //////////////////////////////////////////////////////////////////////////////
00024 // Define's
00025 //////////////////////////////////////////////////////////////////////////////
00026
00027 //
00028 // Some defaults for resource type creation.
00029 //
00030
00031 #define CLUSTER_RESTYPE_DEFAULT_LOOKS_ALIVE     (  5 * 1000 )
00032 #define CLUSTER_RESTYPE_DEFAULT_IS_ALIVE        ( 60 * 1000 )
00033
00034
00035 //////////////////////////////////////////////////////////////////////////////
00036 // CStorageResType -- IClusCfgResourceTypeInfo interface.
00037 //////////////////////////////////////////////////////////////////////////////
00038
00039
00040 //////////////////////////////////////////////////////////////////////////////
00041 //++
00042 //
00043 //  CStorageResType::CommitChanges
00044 //
00045 //  Description:
00046 //      Components implement the CommitChanges interface to create or delete
00047 //      resource types according to the state of the local computer.
00048 //
00049 //  Arguments:
00050 //      punkClusterInfoIn
00051 //          Interface for querying for other interfaces to get information
00052 //          about the cluster (IClusCfgClusterInfo).
00053 //
00054 //      punkResTypeServicesIn
00055 //          Interface for querying for the IClusCfgResourceTypeCreate
00056 //          interface on.
00057 //
00058 //  Return Value:
00059 //      S_OK
00060 //          Success.
00061 //
00062 //      E_POINTER
00063 //          Expected pointer argument specified as NULL.
00064 //
00065 //      E_UNEXPECTED
00066 //          Unexpected commit mode.
00067 //
00068 //      Other HRESULTs
00069 //          Failure.
00070 //
00071 //  Remarks:
00072 //      None.
00073 //
00074 //--
00075 //////////////////////////////////////////////////////////////////////////////
00076 STDMETHODIMP
00077 CStorageResType::CommitChanges(
00078       IUnknown *    punkClusterInfoIn
00079     , IUnknown *    punkResTypeServicesIn
00080     )
00081 {
00082     assert( punkClusterInfoIn != NULL );
00083     assert( punkResTypeServicesIn != NULL );
00084
00085     HRESULT                         hr = S_OK;
00086     IClusCfgClusterInfo *           pccci = NULL;
00087     IClusCfgResourceTypeCreate *    pccrtc = NULL;
00088     ECommitMode                     ecm = cmUNKNOWN;
00089
00090     hr = HrSendStatusReport(
00091           TASKID_Major_Configure_Resource_Types
00092         , TASKID_Minor_StorageResourceType_CommitChanges
00093         , 0
00094         , 6
00095         , 0
00096         , hr
00097         , IDS_CONFIGURING_RESTYPE
00098         , 0
00099         , GetDisplayName()
00100         );
00101     if ( FAILED( hr ) )
00102     {
00103         goto Cleanup;
00104     } // if:
00105
00106     //
00107     // Validate arguments
00108     //
00109
00110     if ( ( punkClusterInfoIn == NULL ) || ( punkResTypeServicesIn == NULL ) )
00111     {
00112         hr = E_POINTER;
00113         goto Cleanup;
00114     } // if: one of the arguments is NULL
00115
00116     hr = HrSendStatusReport(
00117           TASKID_Major_Configure_Resource_Types
00118         , TASKID_Minor_StorageResourceType_CommitChanges
00119         , 0
00120         , 6
00121         , 1
00122         , hr
00123         , IDS_CONFIGURING_RESTYPE
00124         , 0
00125         , GetDisplayName()
00126         );
00127     if ( FAILED( hr ) )
00128     {
00129         goto Cleanup;
00130     } // if:
00131
00132     //
00133     // Find out what event caused this call.
00134     //
00135
00136     hr = punkClusterInfoIn->TypeSafeQI( IClusCfgClusterInfo, &pccci );
00137     if ( FAILED( hr ) )
00138     {
00139         goto Cleanup;
00140     } // if:
00141
00142     hr = HrSendStatusReport(
00143           TASKID_Major_Configure_Resource_Types
00144         , TASKID_Minor_StorageResourceType_CommitChanges
00145         , 0
00146         , 6
00147         , 2
00148         , hr
00149         , IDS_CONFIGURING_RESTYPE
00150         , 0
00151         , GetDisplayName()
00152         );
00153     if ( FAILED( hr ) )
00154     {
00155         goto Cleanup;
00156     } // if:
00157
00158     hr = pccci->GetCommitMode( &ecm );
00159     if ( FAILED( hr ) )
00160     {
00161         goto Cleanup;
00162     } // if: we could not determine the commit mode
00163
00164     hr = HrSendStatusReport(
00165           TASKID_Major_Configure_Resource_Types
00166         , TASKID_Minor_StorageResourceType_CommitChanges
00167         , 0
00168         , 6
00169         , 3
00170         , hr
00171         , IDS_CONFIGURING_RESTYPE
00172         , 0
00173         , GetDisplayName()
00174         );
00175     if ( FAILED( hr ) )
00176     {
00177         goto Cleanup;
00178     } // if:
00179
00180     hr = S_OK;
00181
00182     //
00183     //  Check if we are creating a cluster or adding nodes to an existing cluster.
00184     //
00185
00186     if ( ( ecm == cmCREATE_CLUSTER ) || ( ecm == cmADD_NODE_TO_CLUSTER ) )
00187     {
00188         //
00189         //  We are either creating a cluster on this node or adding it to a
00190         //  cluster.  We need to register our resource type and the associated
00191         //  Cluadmin extension dll.
00192         //
00193
00194         //
00195         // First, register our resource type.
00196         //
00197
00198         hr = punkResTypeServicesIn->TypeSafeQI( IClusCfgResourceTypeCreate, &pccrtc );
00199         if ( FAILED( hr ) )
00200         {
00201             goto Cleanup;
00202         } // if:
00203
00204         hr = pccrtc->Create(
00205                           GetResTypeName()
00206                         , GetDisplayName()
00207                         , GetDllName()
00208                         , CLUSTER_RESTYPE_DEFAULT_LOOKS_ALIVE
00209                         , CLUSTER_RESTYPE_DEFAULT_IS_ALIVE
00210                         );
00211
00212         if ( FAILED( hr ) )
00213         {
00214             goto Cleanup;
00215         } // if:
00216
00217         hr = HrSendStatusReport(
00218               TASKID_Major_Configure_Resource_Types
00219             , TASKID_Minor_StorageResourceType_CommitChanges
00220             , 0
00221             , 6
00222             , 4
00223             , hr
00224             , IDS_CONFIGURED_RESTYPE
00225             , 0
00226             , GetResTypeName()
00227             , GetDisplayName()
00228             , GetDllName()
00229             );
00230         if ( FAILED( hr ) )
00231         {
00232             goto Cleanup;
00233         } // if:
00234
00235 /*
00236         //
00237         // TODO:    If your resource type has a Cluadmin extension dll register it
00238         //          with the cluster here.
00239
00240         hr = pccrtc->RegisterAdminExtensions(
00241                           GetDisplayName()
00242                         , 1
00243                         , &CLSID_CoMyResDllEx
00244                         );
00245
00246         if ( FAILED( hr ) )
00247         {
00248             goto Cleanup;
00249         } // if:
00250
00251         hr = HrSendStatusReport(
00252               TASKID_Major_Configure_Resource_Types
00253             , TASKID_Minor_StorageResourceType_CommitChanges
00254             , 0
00255             , 6
00256             , 5
00257             , hr
00258             , IDS_CONFIGURED_EXTENSION
00259             , 0
00260             , GetDisplayName()
00261             );
00262         if ( FAILED( hr ) )
00263         {
00264             goto Cleanup;
00265         } // if:
00266 */
00267
00268     } // if: we are either forming or joining ( but not both )
00269     else
00270     {
00271         //
00272         // Check for invalid commit modes.
00273         //
00274
00275         if ( ( ecm == cmUNKNOWN ) || ( ecm >= cmMAX ) )
00276         {
00277             hr = E_UNEXPECTED;
00278             goto Cleanup;
00279         } // if: invalid commit mode
00280
00281         assert( ecm == cmCLEANUP_NODE_AFTER_EVICT );
00282
00283         //
00284         // If we are here, then this node has been evicted.
00285         //
00286
00287         //
00288         // TODO: Add code to cleanup your resource type after the
00289         // local node has been evicted from the cluster.
00290         //
00291         // If your resource has a different configuration when it's part of
00292         // cluster then this is where you return it to stand-alone server mode.
00293         //
00294
00295         hr = S_OK;
00296
00297     } // else: we are not forming nor joining
00298
00299     //
00300     // Success.
00301     //
00302
00303     HrSendStatusReport(
00304           TASKID_Major_Configure_Resource_Types
00305         , TASKID_Minor_StorageResourceType_CommitChanges
00306         , 0
00307         , 6
00308         , 6
00309         , hr
00310         , IDS_CONFIGURING_RESTYPE
00311         , 0
00312         , GetDisplayName()
00313         );
00314
00315 Cleanup:
00316
00317     if ( pccci != NULL )
00318     {
00319         pccci->Release();
00320         pccci = NULL;
00321     } // if:
00322
00323     if ( pccrtc != NULL )
00324     {
00325         pccrtc->Release();
00326         pccrtc = NULL;
00327     } // if:
00328
00329     if ( FAILED( hr ) )
00330     {
00331         HrSendStatusReport(
00332               TASKID_Major_Configure_Resource_Types
00333             , TASKID_Minor_StorageResourceType_CommitChanges
00334             , 0
00335             , 6
00336             , 6
00337             , hr
00338             , IDS_CONFIGURING_RESTYPE_FAILED
00339             , 0
00340             , GetDisplayName()
00341             );
00342     } // if: FAILED
00343
00344     return hr;
00345
00346 } //*** CStorageResType::CommitChanges
00347
00348
00349 //////////////////////////////////////////////////////////////////////////////
00350 //++
00351 //
00352 //  CStorageResType::GetTypeGUID
00353 //
00354 //  Description:
00355 //      Retrieves the globally unique identifier of this resource type.
00356 //
00357 //  Arguments:
00358 //      pguidGUIDOut
00359 //          Upon success will point to the resource type's (static) GUID.
00360 //
00361 //  Return Value:
00362 //      S_OK
00363 //          Success.
00364 //
00365 //      E_POINTER
00366 //          Expected pointer argument specified as NULL.
00367 //
00368 //      Other HRESULTs
00369 //          Failure.
00370 //
00371 //  Remarks:
00372 //      None.
00373 //
00374 //--
00375 //////////////////////////////////////////////////////////////////////////////
00376 STDMETHODIMP
00377 CStorageResType::GetTypeGUID(
00378     GUID * pguidGUIDOut
00379     )
00380 {
00381     assert( pguidGUIDOut != NULL );
00382
00383     HRESULT hr = S_OK;
00384
00385     if ( pguidGUIDOut == NULL )
00386     {
00387         hr = E_POINTER;
00388     } // if: the output pointer is NULL
00389     else
00390     {
00391         *pguidGUIDOut = RESTYPE_StorageResource;
00392     } // else: the output pointer is valid
00393
00394     return hr;
00395
00396 } //*** CStorageResType::GetTypeGUID
00397
00398
00399 //////////////////////////////////////////////////////////////////////////////
00400 //++
00401 //
00402 //  CStorageResType::GetTypeName
00403 //
00404 //  Description:
00405 //      Retrieves the resource type name of this resource type.
00406 //
00407 //  Arguments:
00408 //      pbstrTypeNameOut
00409 //          Upon success will point to an allocated BSTR containing the type name.
00410 //
00411 //  Return Value:
00412 //      S_OK
00413 //          Success.
00414 //
00415 //      E_POINTER
00416 //          Expected pointer argument specified as NULL.
00417 //
00418 //      E_OUTOFMEMORY
00419 //          Out of memory.
00420 //
00421 //      Other HRESULTs
00422 //          Failure.
00423 //
00424 //  Remarks:
00425 //      If S_OK is returned the caller needs to call SysFreeString on pbstrTypeNameOut.
00426 //
00427 //--
00428 //////////////////////////////////////////////////////////////////////////////
00429 STDMETHODIMP
00430 CStorageResType::GetTypeName(
00431     BSTR* pbstrTypeNameOut
00432     )
00433 {
00434     assert( pbstrTypeNameOut != NULL );
00435
00436     HRESULT hr = S_OK;
00437
00438     if ( pbstrTypeNameOut == NULL )
00439     {
00440         hr = E_POINTER;
00441         goto Cleanup;
00442     } // if: the output pointer is NULL
00443
00444     *pbstrTypeNameOut = SysAllocString( GetResTypeName() );
00445     if ( *pbstrTypeNameOut == NULL )
00446     {
00447         hr = E_OUTOFMEMORY;
00448         goto Cleanup;
00449     } // if: memory for the resource type name could not be allocated
00450
00451 Cleanup:
00452
00453     return hr;
00454
00455 } //*** CStorageResType::GetTypeName
00456
00457
00458 /////////////////////////////////////////////////////////////////////////////
00459 // CStorageResType -- IClusCfgStartupListener interface.
00460 /////////////////////////////////////////////////////////////////////////////
00461
00462
00463 //////////////////////////////////////////////////////////////////////////////
00464 //++
00465 //
00466 //  CStorageResType::Notify
00467 //
00468 //  Description:
00469 //      This method is called to inform a component that the cluster service
00470 //      has started on this computer.
00471 //
00472 //      This component is registered for the cluster service startup notification
00473 //      as a part of the cluster service upgrade (clusocm.inf). This method creates
00474 //      the required resource type and associates the cluadmin extension dll then
00475 //      deregisters itself from this notification.
00476 //
00477 //  Arguments:
00478 //      IUnknown * punkIn
00479 //          The component that implements this Punk may also provide services
00480 //          that are useful to the implementor of this method. For example,
00481 //          this component usually implements the IClusCfgResourceTypeCreate
00482 //          interface.
00483 //
00484 //  Return Values:
00485 //      S_OK
00486 //          Success.
00487 //
00488 //      Other HRESULTs
00489 //          Failure.
00490 //
00491 //--
00492 //////////////////////////////////////////////////////////////////////////////
00493 HRESULT
00494 CStorageResType::Notify(
00495     IUnknown * punkIn
00496     )
00497 {
00498     HRESULT                         hr = S_OK;
00499     IClusCfgResourceTypeCreate *    piccrtc = NULL;
00500     //const GUID *                    guidAdminEx = &CLSID_CoMyResDllEx
00501     ICatRegister *                  pcrCatReg = NULL;
00502     CATID                           rgCatId[ 1 ];
00503
00504     hr = HrSendStatusReport(
00505                   TASKID_Major_Client_And_Server_Log
00506                 , IID_NULL
00507                 , 1
00508                 , 1
00509                 , 1
00510                 , hr
00511                 , L"Startup Notify called for resource type '%1!ws!'."
00512                 , (LPCWSTR) NULL
00513                 , GetResTypeName()
00514                 );
00515     if ( FAILED( hr ) )
00516     {
00517         goto Cleanup;
00518     } // if:
00519
00520     hr = punkIn->TypeSafeQI( IClusCfgResourceTypeCreate, &piccrtc );
00521     if ( FAILED( hr ) )
00522     {
00523         goto Cleanup;
00524     } // if:
00525
00526     //
00527     // Create the resource type.
00528     //
00529
00530     hr = piccrtc->Create(
00531                       GetResTypeName()
00532                     , GetDisplayName()
00533                     , GetDllName()
00534                     , 5 *  1000
00535                     , 60 * 1000
00536                     );
00537     if ( FAILED( hr ) )
00538     {
00539         goto Cleanup;
00540     } // if:
00541
00542     hr = HrSendStatusReport(
00543                   TASKID_Major_Client_And_Server_Log
00544                 , IID_NULL
00545                 , 1
00546                 , 1
00547                 , 1
00548                 , hr
00549                 , L"Successfully created resource type '%1!ws!'."
00550                 , (LPCWSTR) NULL
00551                 , GetResTypeName()
00552                 );
00553     if ( FAILED( hr ) )
00554     {
00555         goto Cleanup;
00556     } // if:
00557
00558 /*
00559     //
00560     // TODO:    If your resource type has a Cluadmin extension dll register it
00561     //          with the cluster here.
00562
00563     //
00564     // Register the cluadmin extensions.
00565     //
00566
00567     hr = piccrtc->RegisterAdminExtensions(
00568                       GetResTypeName()
00569                     , 1
00570                     , guidAdminEx
00571                     );
00572     if ( FAILED( hr ) )
00573     {
00574         goto Cleanup;
00575     } // if:
00576
00577     hr = HrSendStatusReport(
00578                   TASKID_Major_Client_And_Server_Log
00579                 , IID_NULL
00580                 , 1
00581                 , 1
00582                 , 1
00583                 , hr
00584                 , L"Successfully registered Cluster Administrator extensions for resource type '%1!ws!'."
00585                 , (LPCWSTR) NULL
00586                 , GetResTypeName()
00587                 );
00588     if ( FAILED( hr ) )
00589     {
00590         goto Cleanup;
00591     } // if:
00592 */
00593
00594     //
00595     // Unregister from StartupListener notifications.
00596     //
00597
00598     hr = CoCreateInstance(
00599               CLSID_StdComponentCategoriesMgr
00600             , NULL
00601             , CLSCTX_INPROC_SERVER
00602             , __uuidof( pcrCatReg )
00603             , reinterpret_cast< void ** >( &pcrCatReg )
00604             );
00605
00606     if ( FAILED( hr ) )
00607     {
00608         goto Cleanup;
00609     } // if: CoCreate failed
00610
00611     rgCatId[ 0 ] = CATID_ClusCfgStartupListeners;
00612
00613     hr = pcrCatReg->UnRegisterClassImplCategories( CLSID_CStorageResType, RTL_NUMBER_OF( rgCatId ), rgCatId );
00614     if ( FAILED( hr ) )
00615     {
00616         goto Cleanup;
00617     } // if: deregister failed
00618
00619     pcrCatReg->Release();
00620     pcrCatReg = NULL;
00621
00622     hr = HrSendStatusReport(
00623                   TASKID_Major_Client_And_Server_Log
00624                 , IID_NULL
00625                 , 1
00626                 , 1
00627                 , 1
00628                 , hr
00629                 , L"Successfully unregistered the '%1!ws!' resource type from StartupListener notifications."
00630                 , (LPCWSTR) NULL
00631                 , GetResTypeName()
00632                 );
00633     if ( FAILED( hr ) )
00634     {
00635         goto Cleanup;
00636     } // if:
00637
00638 Cleanup:
00639
00640     if ( piccrtc != NULL )
00641     {
00642         piccrtc->Release();
00643     } // if:
00644
00645     if ( pcrCatReg != NULL )
00646     {
00647         pcrCatReg->Release();
00648     } // if:
00649
00650     return hr;
00651
00652 } //*** CStorageResType::Notify
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/IPerFile.Cpp Source File

  • WinUI
  • Shell
  • FileView

IPerFile.Cpp

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  PROGRAM: IPERFILE.CPP
00009 //
00010 //  PURPOSE:   IPersistFile interface implementation for a FileViewer.
00011 // This interface is written to not generally require modifications
00012 // for a custom FileViewer but is written to interact with the
00013 // definition for CFileViewer in FVTEXT.H.
00014 //
00015 //  PLATFORMS:  Windows 95
00016 //
00017 //  SPECIAL INSTRUCTIONS: N/A
00018 //
00019
00020 #include "fileview.h"
00021
00022 //
00023 //   FUNCTION:CImpIPersistFile::CImpIPersistFile
00024 //
00025 //   PURPOSE:  Constructor
00026 //
00027 //   PARAMETERS:
00028 //  pObj            PCFileViewer of the object we're in.
00029 //  pUnkOuter       LPUNKNOWN to which we delegate.
00030 //
00031 CImpIPersistFile::CImpIPersistFile(PCFileViewer pObj
00032     , LPUNKNOWN pUnkOuter)
00033     {
00034     m_pObj=pObj;
00035     m_pUnkOuter=pUnkOuter;
00036     return;
00037     }
00038 //
00039 //   FUNCTION:   CImpIPersistFile::~CImpIPersistFile
00040 //
00041 //   PURPOSE:   Destructor
00042 //
00043 CImpIPersistFile::~CImpIPersistFile(void)
00044     {
00045     return;
00046     }
00047 //
00048 //   FUNCTIONS: CImpIPersistFile::QueryInterface
00049 //                CImpIPersistFile::AddRef
00050 //                CImpIPersistFile::Release
00051 //
00052 //   PURPOSE:
00053 //      IUnknown members for CImpIPersistFile object that only delegate.
00054 //
00055 STDMETHODIMP CImpIPersistFile::QueryInterface(REFIID riid
00056     , PPVOID ppv)
00057     {
00058     return m_pUnkOuter->QueryInterface(riid, ppv);
00059     }
00060
00061 STDMETHODIMP_(ULONG) CImpIPersistFile::AddRef(void)
00062     {
00063     return m_pUnkOuter->AddRef();
00064     }
00065
00066 STDMETHODIMP_(ULONG) CImpIPersistFile::Release(void)
00067     {
00068     return m_pUnkOuter->Release();
00069     }
00070 //
00071 //   FUNCTION:   CImpIPersistFile::GetClassID
00072 //
00073 //   PURPOSE:   Returns the Class ID of this object.
00074 //
00075 //   PARAMETERS:
00076 //     pClsID          LPCLSID in which to store our class ID.
00077 //
00078 //   RETURN VALUE:
00079 //     HRESULT         NOERROR always.
00080 //
00081 STDMETHODIMP CImpIPersistFile::GetClassID(LPCLSID pClsID)
00082     {
00083     *pClsID=m_pObj->m_clsID;
00084     return NOERROR;
00085     }
00086 //
00087 //   FUNCTION:  CImpIPersistFile::IsDirty
00088 //
00089 //   PURPOSE:  Always returns ResultFromScode(S_FALSE) for a FileViewer which
00090 //   never makes any changes to the file.
00091 //
00092 //   RETURN VALUE:
00093 //     HRESULT         S_FALSE always
00094 //
00095 STDMETHODIMP CImpIPersistFile::IsDirty(void)
00096     {
00097     return ResultFromScode(S_FALSE);
00098     }
00099 //
00100 //   FUNCTION:  CImpIPersistFile::Load
00101 //
00102 //   PURPOSE:  Receives the filename of the path to show in this FileViewer.
00103 //  The object need do nothing more than store this path for later
00104 //  use in IFileViewer::Show.
00105 //
00106 //   PARAMETERS:
00107 //     pszFile         LPCOLESTR of the filename to load.
00108 //     grfMode         DWORD flags to use when opening the file.
00109 //
00110 //   RETURN VALUE:
00111 //    HRESULT         NOERROR or a general error value.
00112 //
00113 STDMETHODIMP CImpIPersistFile::Load(LPCOLESTR pszFile, DWORD grfMode)
00114     {
00115     char        szFile[MAX_PATH];
00116     LPSTR       psz;
00117
00118      // No modifications are necessary to this code:  it simply
00119      // copies the parameters into the CFileViewer::m_pszPath and
00120      // m_grfMode members for use in IFileViewer::ShowInitialize
00121      // and IFileViewer::Show later on.
00122
00123     //We should never be called twice
00124     if (NULL!=m_pObj->m_pszPath)
00125     {
00126         // Review:: Make sure everything else is handled correctly
00127         m_pObj->m_fLoadCalled = FALSE;  // handle error case
00128         m_pObj->MemFree(m_pObj->m_pszPath);
00129         m_pObj->m_pszPath = NULL;
00130
00131     }
00132
00133     if (NULL==pszFile)
00134         {
00135         ODS("IPersistFile::Load called with NULL pointer");
00136         return ResultFromScode(E_INVALIDARG);
00137         }
00138
00139     //Convert Unicode filename to ANSI
00140     wcstombs(szFile, pszFile, sizeof(szFile));
00141
00142     int cch = lstrlen(szFile)+1;
00143   psz=(LPSTR)m_pObj->MemAlloc(cch);
00144
00145     if (NULL==psz)
00146         {
00147         ODS("IPersistFile::Load failed to allocate duplicate pathname");
00148         return ResultFromScode(E_OUTOFMEMORY);
00149         }
00150
00151     //Copy the ANSI filename and the mode to use in opening it.
00152     lstrcpyn(psz, szFile, cch);
00153     m_pObj->m_pszPath=psz;
00154     m_pObj->m_grfMode=grfMode;
00155
00156     //Remember that this function has been called.
00157     m_pObj->m_fLoadCalled=TRUE;
00158     return NOERROR;
00159     }
00160 //
00161 //   FUNCTION:  CImpIPersistFile::Save
00162 //
00163 //   PURPOSE:  Not implemented in a FileViewer: since FileViewer objects never
00164 //  make changes to a file there is nothing to save.  Parameters
00165 //  are irrelevant.
00166 //
00167 //   RETURN VALUE:
00168 //    HRESULT         Always contains E_NOTIMPL.
00169 //
00170 STDMETHODIMP CImpIPersistFile::Save(LPCOLESTR pszFile, BOOL fRemember)
00171     {
00172     ODS("IPersistFile::Save called...unexpected");
00173     return ResultFromScode(E_NOTIMPL);
00174     }
00175 //
00176 //   FUNCTION:   CImpIPersistFile::SaveCompleted
00177 //
00178 //   PURPOSE:  Not implemented in a FileViewer.  Parameters are irrelevant.
00179 //
00180 //   RETURN VALUE:
00181 //     HRESULT         Always contains E_NOTIMPL.
00182 //
00183 STDMETHODIMP CImpIPersistFile::SaveCompleted(LPCOLESTR pszFile)
00184     {
00185     ODS("IPersistFile::SaveCompleted called...unexpected");
00186     return ResultFromScode(E_NOTIMPL);
00187     }
00188 //
00189 //   FUNCTION: CImpIPersistFile::GetCurFile
00190 //
00191 //   PURPOSE:   Not implemented in a FileViewer.  Normally this function
00192 //  would return a copy of the pathname from IPersistFile::Load
00193 //  in a piece of memory allocated with the shared allocator
00194 //  and stored in *ppszFile.  However, this function will not
00195 //  be called in a FileViewer and can be left unimplemented.
00196 //
00197 //   PARAMETERS:
00198 //    ppszFile        LPOLESTR * into which we store a pointer to
00199 //                  the filename that should be allocated with the shared IMalloc.
00200 //
00201 //   RETURN VALUE:
00202 //  HRESULT         NOERROR or a general error value.
00203 //
00204 STDMETHODIMP CImpIPersistFile::GetCurFile(LPOLESTR *ppszFile)
00205     {
00206     LPOLESTR    psz;
00207     ULONG       cb;
00208
00209      // No modifications are necessary to this code:  it simply
00210      // copies the CFileViewer::m_pszPath string into a piece
00211      // of memory and stores the pointer at *ppszFile.
00212     //Load must be called, of course.
00213     if (m_pObj->m_fLoadCalled)
00214         {
00215         ODS("IPersistFile::GetCurFile called without IPersistFile::Load");
00216         return ResultFromScode(E_UNEXPECTED);
00217         }
00218
00219     if (NULL==ppszFile)
00220         {
00221         ODS("IPersistFile::GetCurFile called with NULL pointer");
00222         return ResultFromScode(E_INVALIDARG);
00223         }
00224
00225     cb=(lstrlen(m_pObj->m_pszPath)+1)*sizeof(OLECHAR);
00226     psz=(LPOLESTR)m_pObj->MemAlloc(cb);
00227
00228     if (NULL==psz)
00229         {
00230         ODS("IPersistFile::GetCurFile failed to allocate duplicate pathname");
00231         return ResultFromScode(E_OUTOFMEMORY);
00232         }
00233
00234     //Copy the ANSI filename to the new memory, converting to Unicode
00235     mbstowcs(psz, m_pObj->m_pszPath, cb);
00236
00237     //Save the pointer which is not caller's responsibility
00238     *ppszFile=psz;
00239     return NOERROR;
00240     }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/tmgrsink.cpp Source File

  • WinUI
  • TSFmark

tmgrsink.cpp

Go to the documentation of this file.
00001 //
00002 // tmgrsink.cpp
00003 //
00004 // ITfThreadMgrEventSink implementation.
00005 //
00006
00007 #include "globals.h"
00008 #include "mark.h"
00009
00010 //+---------------------------------------------------------------------------
00011 //
00012 // OnInitDocumentMgr
00013 //
00014 // Sink called by the framework just before the first context is pushed onto
00015 // a document.
00016 //----------------------------------------------------------------------------
00017
00018 STDAPI CMarkTextService::OnInitDocumentMgr(ITfDocumentMgr *pDocMgr)
00019 {
00020     return S_OK;
00021 }
00022
00023 //+---------------------------------------------------------------------------
00024 //
00025 // OnUninitDocumentMgr
00026 //
00027 // Sink called by the framework just after the last context is popped off a
00028 // document.
00029 //----------------------------------------------------------------------------
00030
00031 STDAPI CMarkTextService::OnUninitDocumentMgr(ITfDocumentMgr *pDocMgr)
00032 {
00033     return S_OK;
00034 }
00035
00036 //+---------------------------------------------------------------------------
00037 //
00038 // OnSetFocus
00039 //
00040 // Sink called by the framework when focus changes from one document to
00041 // another.  Either document may be NULL, meaning previously there was no
00042 // focus document, or now no document holds the input focus.
00043 //----------------------------------------------------------------------------
00044
00045 STDAPI CMarkTextService::OnSetFocus(ITfDocumentMgr *pDocMgrFocus, ITfDocumentMgr *pDocMgrPrevFocus)
00046 {
00047     // we'll track edit changes in the focus document, the only place we start compositions
00048     _InitTextEditSink(pDocMgrFocus);
00049     return S_OK;
00050 }
00051
00052 //+---------------------------------------------------------------------------
00053 //
00054 // OnPushContext
00055 //
00056 // Sink called by the framework when a context is pushed.
00057 //----------------------------------------------------------------------------
00058
00059 STDAPI CMarkTextService::OnPushContext(ITfContext *pContext)
00060 {
00061     // ignore new contexts that appear while were uninitializing
00062     if (!_fCleaningUp)
00063     {
00064         _InitCleanupContextSink(pContext);
00065         _InitContextCompartment(pContext);
00066     }
00067
00068     return S_OK;
00069 }
00070
00071 //+---------------------------------------------------------------------------
00072 //
00073 // OnPopContext
00074 //
00075 // Sink called by the framework when a context is popped.
00076 //----------------------------------------------------------------------------
00077
00078 STDAPI CMarkTextService::OnPopContext(ITfContext *pContext)
00079 {
00080     _UninitCleanupContextSink(pContext);
00081     _UninitCompartment(pContext);
00082
00083     return S_OK;
00084 }
00085
00086 //+---------------------------------------------------------------------------
00087 //
00088 // _InitThreadMgrSink
00089 //
00090 // Advise our sink.
00091 //----------------------------------------------------------------------------
00092
00093 BOOL CMarkTextService::_InitThreadMgrSink()
00094 {
00095     return AdviseSink(_pThreadMgr, (ITfThreadMgrEventSink *)this,
00096                       IID_ITfThreadMgrEventSink, &_dwThreadMgrEventSinkCookie);
00097 }
00098
00099 //+---------------------------------------------------------------------------
00100 //
00101 // _UninitThreadMgrSink
00102 //
00103 // Unadvise our sink.
00104 //----------------------------------------------------------------------------
00105
00106 void CMarkTextService::_UninitThreadMgrSink()
00107 {
00108     UnadviseSink(_pThreadMgr, &_dwThreadMgrEventSinkCookie);
00109 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SNMP_MGR_SESSION Member List

This is the complete list of members for _SNMP_MGR_SESSION, including all inherited members.
hAgentEntity | _SNMP_MGR_SESSION
hManagerEntity | _SNMP_MGR_SESSION
hPdu | _SNMP_MGR_SESSION
hSnmpSession | _SNMP_MGR_SESSION
hVbl | _SNMP_MGR_SESSION
hViewContext | _SNMP_MGR_SESSION
hWnd | _SNMP_MGR_SESSION
nError | _SNMP_MGR_SESSION
nErrorIndex | _SNMP_MGR_SESSION
nErrorStatus | _SNMP_MGR_SESSION
nPduType | _SNMP_MGR_SESSION
nRequestId | _SNMP_MGR_SESSION
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/flipdoc.cpp Source File

  • WinUI
  • TSFcase

flipdoc.cpp

Go to the documentation of this file.
00001 //
00002 // flipdoc.cpp
00003 //
00004 // "Flip Doc" menu item handler.
00005 //
00006
00007 #include "globals.h"
00008 #include "case.h"
00009 #include "editsess.h"
00010
00011 class CFlipDocEditSession : public CEditSessionBase
00012 {
00013 public:
00014     CFlipDocEditSession(ITfContext *pContext) : CEditSessionBase(pContext) {}
00015
00016     // ITfEditSession
00017     STDMETHODIMP DoEditSession(TfEditCookie ec);
00018 };
00019
00020 //+---------------------------------------------------------------------------
00021 //
00022 // _Menu_FlipDoc
00023 //
00024 // Toggle the case of the entire document.
00025 //----------------------------------------------------------------------------
00026
00027 void CCaseTextService::_Menu_FlipDoc(CCaseTextService *_this)
00028 {
00029     ITfDocumentMgr *pFocusDoc;
00030     ITfContext *pContext;
00031     CFlipDocEditSession *pFlipEditSession;
00032     HRESULT hr;
00033
00034     // get the focus document
00035     if (_this->_pThreadMgr->GetFocus(&pFocusDoc) != S_OK)
00036         return;
00037
00038     // we want the topmost context, since the main doc context could be
00039     // superceded by a modal tip context
00040     if (pFocusDoc->GetTop(&pContext) != S_OK)
00041     {
00042         pContext = NULL;
00043         goto Exit;
00044     }
00045
00046     if (pFlipEditSession = new CFlipDocEditSession(pContext))
00047     {
00048         // we need a document write lock to insert text
00049         // the CHelloEditSession will do all the work when the
00050         // CFlipDocEditSession::DoEditSession method is called by the context
00051         pContext->RequestEditSession(_this->_tfClientId, pFlipEditSession, TF_ES_READWRITE | TF_ES_ASYNCDONTCARE, &hr);
00052
00053         pFlipEditSession->Release();
00054     }
00055
00056 Exit:
00057     SafeRelease(pContext);
00058     pFocusDoc->Release();
00059 }
00060
00061 //+---------------------------------------------------------------------------
00062 //
00063 // DoEditSession
00064 //
00065 //----------------------------------------------------------------------------
00066
00067 STDAPI CFlipDocEditSession::DoEditSession(TfEditCookie ec)
00068 {
00069     ITfRange *pRangeStart;
00070
00071     // get the head of the doc
00072     if (_pContext->GetStart(ec, &pRangeStart) != S_OK)
00073         return E_FAIL;
00074
00075     // do the work
00076     ToggleCase(ec, pRangeStart, TRUE);
00077
00078     pRangeStart->Release();
00079
00080     return S_OK;
00081 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SEND_INFO Member List

This is the complete list of members for _SEND_INFO, including all inherited members.
bSendComplete | _SEND_INFO
bSendEnabled | _SEND_INFO
hEvents | _SEND_INFO
nTotalSends | _SEND_INFO
ovr | _SEND_INFO
sd | _SEND_INFO
sndbuf | _SEND_INFO
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Delete/vc/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Delete
  • vc

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  Delete.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/GridFont/Grid.Hxx Source File

  • Multimedia
  • Gdi
  • Fonts
  • GridFont

Grid.Hxx

Go to the documentation of this file.
00001 #ifndef __GRID_HXX_
00002 #define __GRID_HXX_
00003
00004 #include "canvas.hxx"
00005 #include "cset.hxx"
00006
00007 #include "font.hxx"
00008
00009 //========== CGridIt ===========================================
00010 class CGridIt
00011 {
00012 public:
00013         CGridIt(UINT cCol, UINT cRow, SIZE size, POINT pt) :
00014                 _pt(pt), _size(size), _cCol(cCol), _cRow(cRow),
00015                 _iRow(0), _iCol(0), _cx(pt.x), _cy(pt.y)
00016         {}
00017
00018         BOOL Done() { return _iCol == _cCol; };
00019
00020         UINT Row()  { return _iRow; };
00021         UINT Col()  { return _iCol; };
00022
00023         COORD Cx() { return _cx; }
00024         COORD Cy() { return _cy; }
00025
00026         void operator++()
00027         {
00028             if( !Done())
00029             {
00030                 _iRow++;
00031                 _cy+=_size.cy;
00032                 if( _iRow == _cRow )
00033                 {
00034                     _iRow = 0;
00035                     _cy = _pt.y;
00036                     _iCol++;
00037                     _cx += _size.cx;
00038                 }
00039             }
00040         }
00041 protected:
00042         POINT   _pt;
00043         SIZE    _size;
00044         UINT    _cRow;
00045         UINT    _iRow;
00046         UINT    _cCol;
00047         UINT    _iCol;
00048         COORD _cx, _cy;
00049 };
00050
00051 //========== CGrid =============================================
00052
00053 class CGrid
00054 {
00055 public:
00056         virtual void Paint(CCanvas& canvas, RECT rc, POINT pt)=0;
00057 protected:
00058         SIZE    _size;
00059         UINT    _cCol;
00060         UINT    _cRow;
00061 };
00062
00063 //========== CLineGrid =========================================
00064
00065 class CLineGrid : public CGrid
00066 {
00067 public:
00068         CLineGrid(UINT cCol, UINT cRow, SIZE size);
00069         void SetStyle(int iStyle = PS_DOT );
00070         void SetWeight(int nWeight = 1 );
00071         void Paint(CCanvas& canvas, RECT rc, POINT pt);
00072 protected:
00073         int     _iStyle;
00074         int     _nWeight;
00075 };
00076
00077 //========== CTextGrid =========================================
00078
00079 class CTextGrid : public CGrid
00080 {
00081 public:
00082         CTextGrid() { _pCharUsed = NULL;};
00083         ~CTextGrid() { if (_pCharUsed != NULL) _pCharUsed = (USHORT*)LocalFree(LocalHandle(_pCharUsed));};
00084         void SetFont(HFONT hfont);
00085         void SetTextOrg()
00086         {
00087             _ptOrg.x = _size.cx/2;
00088             _ptOrg.y=7*_size.cy/11;
00089         };
00090
00091         void SetTextOrg(COORD x, COORD y)
00092         {
00093             _ptOrg.x=x;
00094             _ptOrg.y=y;
00095         };
00096
00097         virtual void Paint(CCanvas& canvas, RECT rc, POINT pt);
00098         virtual void DrawElement(CCanvas& canvas, COORD x, COORD y, UINT i, UINT j)=0;
00099         UINT Hittest(POINT pt, POINT ptTest);
00100     void SetCharTable();
00101 protected:
00102         POINT   _ptOrg;
00103         HFONT   _font;
00104         UINT    _iEltOffset;
00105     USHORT * _pCharUsed;
00106 };
00107
00108 //========== CCharGrid =============================================
00109
00110 class CCharGrid : public CTextGrid
00111 {
00112 public:
00113         CCharGrid(UINT cCol, UINT cRow, SIZE size, UINT iEltOffset=0);
00114         virtual void DrawElement(CCanvas& canvas, COORD x, COORD y, UINT i, UINT j);
00115 //protected:
00116 };
00117
00118
00119 //========== CCodeGrid =============================================
00120
00121 #define HEXADECIMAL 0
00122 #define DECIMAL     1
00123 #define MASKROOT    1
00124
00125 class CCodeGrid : public CTextGrid
00126 {
00127 public:
00128         CCodeGrid(UINT cCol, UINT cRow, SIZE size, UINT iEltOffset=0);
00129         void SetFormat(UINT fuFormat=HEXADECIMAL, UINT cDigits=1);
00130         void DrawElement(CCanvas& canvas, COORD x, COORD y, UINT i, UINT j);
00131 protected:
00132         UINT    _cDigits;
00133         TCHAR   _szFormat[5];
00134 };
00135
00136 //========== CBlockFormat =============================================
00137 // formatting elements common to all blocks
00138
00139
00140 class CBlockFormat
00141 {
00142 public:
00143         SIZE    _size;          // size of grid cell
00144         CFont   _fontChar;
00145         CFont   _fontCode;
00146     UINT  _fuFormat;
00147 protected:
00148         CBlockFormat();
00149 };
00150
00151 //========== CFrameFormat =============================================
00152 // formatting elements common to all frames
00153 class CFrameFormat : public CBlockFormat
00154 {
00155 public:
00156         CFont   _fontHeader;
00157         CFont   _fontLabel;
00158 protected:
00159         CFrameFormat();
00160 };
00161
00162 //========== CPageFormat =============================================
00163 //
00164 #define PAGEELEMS 2
00165 #define PAGEPRINT 4
00166
00167 class CPageFormat : public CFrameFormat
00168 {
00169 public:
00170         CPageFormat(UINT fuFormat);
00171         void SetFormat(UINT fuFormat=HEXADECIMAL);
00172
00173         CFont   _fontPageNum;
00174         UINT    _fuFormat;
00175         POINT   _ptPE[3];
00176         POINT   _pt;            // "origin" of page proper
00177 };
00178
00179 //========== CCharBlock =============================================
00180 class CCharBlock
00181 {
00182 public:
00183         CCharBlock(UINT cCol, UINT cRow, UINT iBlockOffset, const CBlockFormat &bf);
00184
00185         void Paint(CCanvas& canvas, RECT rc, POINT pt);
00186         UINT Hittest(POINT pt, POINT ptTest);
00187         void SetFormat(UINT fuFormat=HEXADECIMAL);
00188         void SetFont(HFONT font);
00189 protected:
00190         CLineGrid       _Line;
00191         CCharGrid       _Char;
00192         CCodeGrid       _Code;
00193 };
00194
00195
00196 //========== CBlockFrame =============================================
00197
00198 class CBlockFrame : public CCharBlock
00199 {
00200 public:
00201         CBlockFrame(UINT cCol, UINT cRow, POINT pt, UINT iBlockOffset,
00202                                     TCHAR *szHeader, const CFrameFormat &ff);
00203         ~CBlockFrame();
00204         void Paint(CCanvas& canvas, RECT rc, POINT pt);
00205
00206 protected:
00207         void Draw(CCanvas& canvas, POINT pt);
00208         TCHAR *         _szHeader;
00209         SIZE            _size;
00210         UINT            _cCol;
00211         UINT            _cRow;
00212         HFONT           _fontHeader;
00213         CCodeGrid       _Cols;
00214
00215         // optional
00216         CCodeGrid *     _pRows;
00217 };
00218 //========== CPage ===================================================
00219
00220 class CPage
00221 {
00222 public:
00223         CPage(HINSTANCE hInst, CPageFormat& pf, UINT nPage=0);
00224         ~CPage();
00225
00226         void Paint(CCanvas& canvas, RECT rc);
00227         void SetFormat(UINT fuFormat=HEXADECIMAL);
00228         void SetFont( HFONT hfont);
00229         UINT Hittest( POINT pt);
00230
00231 protected:
00232         UINT InitPage(UINT nPage);
00233         HINSTANCE       _hInst;
00234         CPageFormat&    _pf;
00235
00236         UINT            _cBlock;        // 0..4
00237         CBlockFrame*    _apBlock[4];    // at most 4 blocks/page
00238         POINT           _aptBlock[4];
00239
00240         CCodeGrid       _PageHeadR;     // Right header
00241         CCodeGrid       _PageHeadL;     // Left  header
00242         CCodeGrid       _PageNums;      // Page number
00243 };
00244
00245 //========== CFontRange ===================================================
00246
00247 class CFontRange
00248 {
00249 friend class CTextGrid;
00250 public:
00251         void SetFontRange(HWND hwnd, HFONT hfont);
00252         ~CFontRange();
00253         BOOL IsPageUsed(UINT nPage) { return _fPageUsed[nPage]; };
00254
00255 private:
00256         void SwapShort (PUSHORT p);
00257         void SwapULong (PULONG p);
00258         BOOL CountUCSegments(HDC hdc);
00259
00260         UINT _fPageUsed[256];
00261 };
00262
00263 //========== CModel ==================================================
00264 #define USEDONLY    0
00265 #define ALLPAGES    1
00266
00267 class CModel
00268 {
00269 public:
00270         CModel(HINSTANCE hInst, HWND hwnd, UINT fuFormat=HEXADECIMAL, UINT fUsedPageOnly=USEDONLY);
00271         ~CModel();
00272
00273         // iteration
00274         void NextPage();
00275         void PrevPage();
00276         void NextSection();
00277         void PrevSection();
00278         BOOL CanNextPage()      { return _iPage + 1 < _macPage; };
00279         BOOL CanPrevPage()      { return _iPage;                };
00280         BOOL CanNextSection()   { return _iPage +16 < _macPage; };
00281         BOOL CanPrevSection()   { return _iPage + 1 >= 16;      };
00282         UINT GetPage()          { return _iPage;                };
00283         void SetPage(UINT nPage);
00284         UINT GetMaxPage()       { return _macPage; };
00285         UINT GetMaxSection()    { return _macPage / 16; };
00286
00287         // Layout
00288         void Paint(CCanvas& canvas, RECT rc){_pPage->Paint(canvas, rc);};
00289         UINT Hittest( POINT pt);
00290         void GetLineSize( SIZE * psize) { psize->cx = 4*INCH2/5;
00291                                           psize->cy = INCH2;
00292                                         }
00293
00294         // Formatting
00295         BOOL ChooseFont(HWND hwnd);
00296         HFONT GetFont();
00297         BOOL CreateFont(LOGFONT &lf);
00298         void GetFormat(UINT &fuFormat);
00299         void SetFormat(UINT fuFormat=HEXADECIMAL);
00300         void GetPageMode(UINT &fPageMode);
00301         void SetPageMode(UINT fPageMode=USEDONLY);
00302     void SetCSet(CSet * pCset);
00303     BOOL IsModelPageUsed(UINT nPage) {return _fr.IsPageUsed(nPage);}
00304
00305 protected:
00306         UINT            _iPage;
00307         UINT            _macPage;
00308         CPageFormat     _pf;
00309         CPage *         _pPage;
00310         HINSTANCE       _hInst;
00311         UINT            _fPageMode;
00312         CFontRange      _fr;
00313 };
00314
00315
00316
00317 #endif
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTestDlg Member List

This is the complete list of members for CTestDlg, including all inherited members.
CTestDlg() | CTestDlg |
dwPID | CTestDlg | [private]
IDD enum value | CTestDlg |
m_nNumberWrites | CTestDlg | [private]
m_pLF | CTestDlg | [private]
OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CTestDlg | [inline]
OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CTestDlg |
OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CTestDlg |
~CTestDlg() | CTestDlg |
Generated on Wed Nov 13 2024 16:57:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Colors.c Source File

  • WinUI
  • CommDlg
  • CDTest

Colors.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 /************************************************************************
00007
00008   File: colors.c
00009
00010   Purpose:
00011
00012     This file contains all the code necessary for the colors dialog.
00013
00014
00015   Functions:
00016
00017     DoColorsDialog()          -- Starts off the creation of the main colors dlg
00018
00019     ColorsProc()              -- Callback function for the colors dialog
00020
00021     InitColorStruct()         -- Initializes default CHOOSECOLOR strucure
00022
00023     FillColorDlg()            -- Fills the colors dialog with the current
00024                                  CHOOSECOLOR structure values.
00025
00026     GetColorDlg()             -- Retrieves users edits and puts them in
00027                                  the appropriate CHOOSECOLOR structure.
00028
00029     ColorsHookProc()          -- Callback hook function if the ChooseColor()
00030                                  function is called with CC_ENABLEHOOK
00031
00032     GetColorsResHandle()      -- Loads a custom template from the EXE
00033                                  and returns a handle to it
00034
00035     DoChooseColorStuff()      -- Calls the ChooseColor() function.
00036
00037     ColorThreadProc1()        -- Starting address for the first thread
00038
00039     ColorThreadProc2()        -- Starting address for the second thread
00040
00041     MultiThreadColorDlg()     -- Creates two threads in this process
00042                                  which each create ChooseColor() dialogs.
00043
00044     EnableColorButtons()      -- Enables or disables buttons in the colors
00045                                  dialog.  Necessary for the multithreading.
00046
00047
00048 ************************************************************************/
00049
00050
00051 #include <windows.h>
00052 #include <commdlg.h>
00053 #include <stdlib.h>
00054 #include <winnls.h>
00055 #include "cdtest.h"
00056 #include "colors.h"
00057
00058
00059 /* Function prototypes */
00060 void InitColorStruct(HWND hwnd, LPCHOOSECOLOR) ;
00061 void FillColorDlg(HWND hwnd, LPCHOOSECOLOR) ;
00062 void GetColorDlg(HWND hwnd, LPCHOOSECOLOR) ;
00063 void DoChooseColorStuff(HWND, LPCHOOSECOLOR) ;
00064 UINT_PTR CALLBACK ColorsHookProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ;
00065
00066
00067 /* Variables and external declarations */
00068
00069 CHOOSECOLOR cc ;
00070 DWORD dwCustColors[16] ;
00071 DWORD dwColor ;
00072 HRSRC hResColors;
00073 HGLOBAL hDialogColors;
00074 HANDLE GetColorsResHandle(void) ;
00075 TCHAR szTemplateNameC[50] ;
00076 extern UINT_PTR uMode ;
00077 extern LONG_PTR MyAtol(LPTSTR, BOOL, LPBOOL) ;
00078
00079
00080 /* Multithreading stuff */
00081
00082 DWORD dwColorThreadID1 ;
00083 DWORD dwColorThreadID2 ;
00084 DWORD dwColorThreadParm1 ;
00085 DWORD dwColorThreadParm2 ;
00086 DWORD ColorThreadProc1(LPDWORD) ;
00087 DWORD ColorThreadProc2(LPDWORD) ;
00088 void MultiThreadColorDlg(void) ;
00089 void EnableColorButtons(HWND, BOOL) ;
00090 HANDLE hColorThread1 ;
00091 HANDLE hColorThread2 ;
00092 HWND hwndMainColor ;
00093 int nOpenColorDlgCount ;
00094 CHOOSECOLOR ccThread1 ;
00095 CHOOSECOLOR ccThread2 ;
00096
00097
00098
00099
00100 /************************************************************************
00101
00102   Function: DoColorsDialog(HWND)
00103
00104   Purpose: To create the ChooseColor() common dialog creation dialog.
00105
00106   Returns: Nothing.
00107
00108   Comments:
00109
00110 ************************************************************************/
00111
00112 void DoColorsDialog(HWND hwnd)
00113 {
00114
00115
00116   DialogBox(hInst, MAKEINTRESOURCE(ID_COLORSDIALOG),
00117             hwnd, ColorsProc) ;
00118
00119 }
00120
00121
00122
00123
00124
00125
00126
00127 /************************************************************************
00128
00129   Function: ColorsProc(HWND, UINT, WPARAM, LPARAM)
00130
00131   Purpose: The callback function for the main colors dialog.
00132
00133   Returns: TRUE or FALSE depending on the situation.
00134
00135   Comments:
00136
00137 ************************************************************************/
00138
00139
00140 INT_PTR APIENTRY ColorsProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00141 {
00142   BOOL bRet = FALSE ;
00143
00144   switch (msg)
00145   {
00146
00147     case WM_INITDIALOG:
00148
00149        InitColorStruct(hwnd, &cc) ;  //initialize the CHOOSECOLOR structure
00150        FillColorDlg(hwnd, &cc) ;  //and fill the colors dialog.
00151
00152        nOpenColorDlgCount = 0 ;
00153
00154        hwndMainColor = hwnd ;
00155
00156        *(&ccThread1) = *(&ccThread2) = *(&cc) ;
00157
00158        SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEC)) ;
00159
00160        break ;
00161
00162
00163      case UMSG_DECREMENTDLGCOUNT:  //user defined message indicating
00164                                    //the closure of a multithreaded dialog
00165
00166        /* Keep the main colors dialog buttons disabled until the last
00167           multithreaded dialog function has returned. */
00168
00169        nOpenColorDlgCount-- ;
00170
00171        if (nOpenColorDlgCount == 0)
00172          EnableColorButtons(hwnd, TRUE) ;
00173
00174        break ;
00175
00176
00177      case WM_COMMAND:
00178
00179         switch (LOWORD(wParam))
00180         {
00181           case IDOK:
00182
00183             GetColorDlg(hwnd, &cc) ;            //get user's choices
00184
00185             DoChooseColorStuff(hwnd, &cc) ;     //do the dialog
00186
00187             break ;
00188
00189
00190           case ID_RESETC:
00191
00192             SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
00193               (WPARAM) 0, (LPARAM) 0) ;
00194
00195             InitColorStruct(hwnd, &cc) ;
00196             FillColorDlg(hwnd, &cc) ;
00197
00198             SendDlgItemMessage(hwnd, ID_NULLSTRUCTCOLOR, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
00199             SendDlgItemMessage(hwnd, ID_PRELOADEDCOLORS, BM_SETCHECK, (WPARAM)0, (LPARAM)0) ;
00200
00201             SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEC)) ;
00202
00203             break ;
00204
00205
00206           case IDCANCEL:
00207             EndDialog(hwnd, FALSE) ;
00208             break ;
00209
00210
00211           case ID_ADD1C:
00212             GetDlgItemText(hwnd, ID_CUSTCOLORSC, szTemp, 100) ;
00213
00214             if (*szTemp)
00215               SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_ADDSTRING,
00216                                  (WPARAM) 0, (LPARAM) (LPTSTR) szTemp) ;
00217             break ;
00218
00219           case ID_CLEAR1C:
00220             SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
00221                                (WPARAM) 0, (LPARAM) 0) ;
00222             break ;
00223
00224           case ID_MULTITHREADCOLORS:
00225
00226             /* Start the dialog count off at 2, disable the main dialog's
00227                buttons, and multithread */
00228
00229             nOpenColorDlgCount = 2 ;
00230
00231             EnableColorButtons(hwnd, FALSE) ;
00232
00233             MultiThreadColorDlg() ;
00234
00235             break ;
00236
00237
00238           default: break ;
00239         }
00240
00241     default:
00242
00243
00244       /* If the help button is pressed in the ChooseColor()
00245          dialog, it will send a message Registered with RegisterWindowMessage()
00246          to the parent window.  The message nHelpMessage was registered
00247          at application startup */
00248
00249       if (msg == nHelpMessage)
00250         MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
00251                    TEXT("Colors Help Button"), MB_OK | MB_APPLMODAL) ;
00252
00253       break ;
00254   }
00255
00256   return FALSE ;
00257 }
00258
00259
00260
00261
00262
00263
00264
00265 /************************************************************************
00266
00267   Function: InitColorStruct(HWND, LPCHOOSECOLOR)
00268
00269   Purpose: Fills the default CHOOSECOLOR structure with some default
00270            values.
00271
00272   Returns: Nothing.
00273
00274   Comments:
00275
00276 ************************************************************************/
00277
00278
00279 void InitColorStruct(HWND hwnd, LPCHOOSECOLOR pcc)
00280 {
00281   int i ;
00282
00283   pcc->lStructSize  = sizeof(CHOOSECOLOR) ;
00284   pcc->hwndOwner    = hwnd ;
00285   pcc->hInstance    = (HANDLE) hInst ;
00286
00287   dwColor = RGB(0, 0, 0) ;
00288   pcc->rgbResult    = dwColor ;
00289
00290   for (i=0; i<16; i++)
00291     dwCustColors[i] = (RGB(255-i*10, i, i*10)) ;
00292
00293   pcc->lpCustColors = (LPDWORD) dwCustColors ;
00294
00295   pcc->Flags     = CC_FULLOPEN | CC_SHOWHELP | CC_RGBINIT ;
00296
00297   pcc->lCustData = 0 ;
00298
00299   pcc->lpfnHook = ColorsHookProc ;
00300
00301   lstrcpyn(szTemplateNameC, TEXT("clrtemp"), ARRAYSIZE(szTemplateNameC)) ;         //name of custom template
00302
00303   pcc->lpTemplateName = (LPTSTR) szTemplateNameC ;
00304
00305   return ;
00306 }
00307
00308
00309
00310
00311
00312
00313
00314
00315 /************************************************************************
00316
00317   Function: FillColorDlg(HWND, LPCHOOSECOLOR)
00318
00319   Purpose: Fills the colors dialog with the current contents of the
00320            CHOOSECOLOR structure passed in as the second parameter.
00321
00322   Returns: Nothing.
00323
00324   Comments:
00325
00326 ************************************************************************/
00327
00328 void FillColorDlg(HWND hwnd, LPCHOOSECOLOR pcc)
00329 {
00330   int i ;
00331
00332   wsprintf(szTemp, szLongFilter, pcc->lStructSize) ;
00333   SetDlgItemText(hwnd, ID_STRUCTSIZEC, szTemp) ;
00334
00335   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcc->hwndOwner) ;
00336   SetDlgItemText(hwnd, ID_HWNDOWNERC, szTemp) ;
00337
00338   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcc->hInstance) ;
00339   SetDlgItemText(hwnd, ID_HINSTANCEC, szTemp) ;
00340
00341   wsprintf(szTemp, szLongFilter, pcc->rgbResult) ;
00342   SetDlgItemText(hwnd, ID_RGBRESULTC, szTemp) ;
00343
00344   SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_RESETCONTENT,
00345                      (WPARAM) 0, (LPARAM) 0) ;
00346
00347   for (i=0; i<16; i++)
00348   {
00349     wsprintf(szTemp, szLongFilter, dwCustColors[i]) ;
00350     SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_ADDSTRING,
00351                        (WPARAM) 0, (LPARAM) (LPTSTR) szTemp) ;
00352   }
00353
00354   SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_SETCURSEL,
00355                      (WPARAM) 0 , (LPARAM) 0) ;
00356
00357   wsprintf(szTemp, szLongFilter, pcc->Flags) ;
00358   SetDlgItemText(hwnd, ID_FLAGSC, szTemp) ;
00359
00360   wsprintf(szTemp, szLongFilter, pcc->lCustData) ;
00361   SetDlgItemText(hwnd, ID_CUSTDATAC, szTemp) ;
00362
00363   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcc->lpfnHook) ;
00364   SetDlgItemText(hwnd, ID_HOOKC, szTemp) ;
00365
00366   SetDlgItemText(hwnd, ID_TEMPLATEC, (LPTSTR) pcc->lpTemplateName) ;
00367 }
00368
00369
00370
00371
00372
00373
00374
00375 /************************************************************************
00376
00377   Function: GetColorDlg(HWND, LPCHOOSECOLOR)
00378
00379   Purpose: Retrieves the users entries in the colors dialog edit boxes
00380            and puts them in the appropriate CHOOSECOLOR structure
00381            members.
00382
00383   Returns: Nothing.
00384
00385   Comments:
00386
00387 ************************************************************************/
00388
00389
00390 void GetColorDlg(HWND hwnd, LPCHOOSECOLOR pcc)
00391 {
00392   int i ;
00393   BOOL b ;
00394   TCHAR szNum[30] ;
00395
00396   #define WSIZECC 30
00397
00398   GetDlgItemText(hwnd, ID_STRUCTSIZEC, szNum, WSIZECC) ;
00399   pcc->lStructSize = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00400
00401   GetDlgItemText(hwnd, ID_HWNDOWNERC, szNum, WSIZECC) ;
00402   pcc->hwndOwner = (HWND) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00403
00404   GetDlgItemText(hwnd, ID_HINSTANCEC, szNum, WSIZECC) ;
00405   pcc->hInstance = (HANDLE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00406
00407   GetDlgItemText(hwnd, ID_RGBRESULTC, szNum, WSIZECC) ;
00408   pcc->rgbResult = (COLORREF) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00409
00410   for (i=0; i<16; i++)
00411   {
00412     if (SendDlgItemMessage(hwnd, ID_CUSTCOLORSC, CB_GETLBTEXT,
00413                           (WPARAM) i, (LPARAM) (LPTSTR) szNum) != CB_ERR)
00414
00415       dwCustColors[i] = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00416
00417     else
00418       dwCustColors[i] = (DWORD) 0 ;
00419
00420     *(pcc->lpCustColors + i) = dwCustColors[i] ;
00421   }
00422
00423   GetDlgItemText(hwnd, ID_FLAGSC, szNum, WSIZECC) ;
00424   pcc->Flags = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00425
00426   GetDlgItemText(hwnd, ID_CUSTDATAC, szNum, WSIZECC) ;
00427   pcc->lCustData = MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00428
00429   GetDlgItemText(hwnd, ID_HOOKC, szNum, WSIZECC) ;
00430   pcc->lpfnHook = (LPCCHOOKPROC) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00431
00432   GetDlgItemText(hwnd, ID_TEMPLATEC, (LPTSTR) pcc->lpTemplateName, 50) ;
00433
00434   return ;
00435 }
00436
00437
00438
00439
00440
00441
00442
00443 /************************************************************************
00444
00445   Function: ColorsHookProc(HWND, UINT, WPARAM, LPARAM) ;
00446
00447   Purpose:  This function will be called before the normal ChooseColor()
00448             logic is envoked.
00449
00450   Returns: FALSE to instruct ChooseColor() to proceed with it's normal
00451            processing of the message.  TRUE to discard normal processing.
00452
00453   Comments:
00454
00455     To enable the hook, type the value for "CC_ENABLEHOOK" in the
00456     "Flags" edit box.
00457
00458 ************************************************************************/
00459
00460 UINT_PTR CALLBACK ColorsHookProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00461 {
00462   LPCHOOSECOLOR pCc ;
00463   TCHAR szMsg[50] ;
00464
00465   switch(msg)
00466   {
00467     case WM_INITDIALOG:
00468
00469       /* During initialization of the ChooseColor() dialog, if there is a
00470          hook proc the ChooseColor() function will send a pointer to the
00471          current CHOOSECOLOR structure in the wParam parameter */
00472
00473       pCc = (LPCHOOSECOLOR) lParam ;
00474
00475       if (pCc->lCustData != 0L)
00476       {
00477         wsprintf(szMsg, TEXT("CHOOSECOLOR->lCustData is: %ld"), pCc->lCustData) ;
00478         MessageBox(hwnd, szMsg, TEXT("lCustData Sent!"), MB_OK | MB_APPLMODAL) ;
00479       }
00480
00481       SetWindowText(hwnd, TEXT("Color Hook Proc Dialog")) ;
00482
00483       break ;
00484
00485     default:
00486       break ;
00487   }
00488
00489   return 0 ;   //send msg to the common dialog code
00490 }
00491
00492
00493
00494
00495
00496
00497
00498 /************************************************************************
00499
00500   Function: GetColorsResHandle(void)
00501
00502   Purpose: Creates a handle to the custom template and returns it to the
00503            caller.
00504
00505   Returns: HANDLE to a preloaded custom template
00506
00507   Comments:
00508
00509     To use this preloaded template, mark the "Preloaded Template" checkbox
00510     and enter CC_ENABLETEMPLATEHANDLE in the "Flags" edit box.
00511
00512 ************************************************************************/
00513
00514 HANDLE GetColorsResHandle(void)
00515 {
00516
00517   hResColors = FindResource(hInst, TEXT("clrtemp"), RT_DIALOG) ;
00518
00519   hDialogColors = LoadResource(hInst, hResColors) ;
00520
00521
00522   return hDialogColors ;
00523 }
00524
00525
00526
00527
00528
00529
00530
00531 /************************************************************************
00532
00533   Function:DoChooseColorStuff(HWND, LPCHOOSECOLOR)
00534
00535   Purpose: Does the actual calling of the ChooseColor() function.
00536
00537
00538   Returns: Nothing.
00539
00540   Comments:
00541
00542 ************************************************************************/
00543
00544 void DoChooseColorStuff(HWND hwnd, LPCHOOSECOLOR pcc)
00545 {
00546   BOOL bRet ;
00547
00548   /* If the "Preloaded template button is checked, load a handle for
00549      the custom template and put it in the hInstance member of the
00550      CHOOSECOLOR structure */
00551
00552   if (IsDlgButtonChecked(hwnd, ID_PRELOADEDCOLORS) == 1)
00553     pcc->hInstance = GetColorsResHandle() ;
00554
00555
00556    /* If the "NULL Structure" box is checked, call ChooseColor() will
00557       a NULL pointer.  Otherwise call with the current CHOOSECOLOR pointer */
00558
00559   if (IsDlgButtonChecked(hwnd, ID_NULLSTRUCTCOLOR) == 1)
00560     bRet = ChooseColor((LPCHOOSECOLOR) NULL) ;
00561   else
00562     bRet = ChooseColor(pcc) ;
00563
00564   if (pcc->hInstance)
00565   {
00566     FreeResource(hDialogColors) ;
00567     hDialogColors = (HANDLE) 0 ;
00568     hResColors = (HANDLE) 0 ;
00569   }
00570
00571
00572   /* Fill the results into the main colors dialog */
00573
00574   FillColorDlg(hwnd, pcc) ;
00575
00576   wsprintf(szTemp, szShortFilter, bRet) ;
00577   SetDlgItemText(hwnd, ID_RETURNC, szTemp) ;
00578
00579   wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
00580   SetDlgItemText(hwnd, ID_ERRORC, szTemp) ;
00581
00582 }
00583
00584
00585
00586
00587
00588
00589 /************************************************************************
00590
00591   Function:ColorThreadProc1(LPDWORD)
00592
00593   Purpose: Starting address for first thread
00594
00595
00596   Returns: Any DWORD value.
00597
00598   Comments:
00599
00600 ************************************************************************/
00601
00602
00603 DWORD ColorThreadProc1(LPDWORD pdw)
00604 {
00605   GetColorDlg(hwndMainColor, &ccThread1) ;
00606   DoChooseColorStuff(hwndMainColor, &ccThread1) ;
00607
00608   PostMessage(hwndMainColor, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;
00609
00610   return 0L ;
00611 }
00612
00613
00614
00615
00616
00617
00618
00619 /************************************************************************
00620
00621   Function:ColorThreadProc2(LPDWORD)
00622
00623   Purpose: Starting address for second thread
00624
00625
00626   Returns: Any DWORD value.
00627
00628   Comments:
00629
00630 ************************************************************************/
00631
00632 DWORD ColorThreadProc2(LPDWORD pdw)
00633 {
00634   GetColorDlg(hwndMainColor, &ccThread2) ;
00635   DoChooseColorStuff(hwndMainColor, &ccThread2) ;
00636
00637   PostMessage(hwndMainColor, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;
00638
00639   return 0L ;
00640 }
00641
00642
00643
00644
00645
00646
00647
00648 /************************************************************************
00649
00650   Function:MultiThreadColorDlg(void)
00651
00652   Purpose: Creates two threads which will each create a new ChooseColor()
00653            dialog.
00654
00655
00656   Returns: Nothing.
00657
00658   Comments:
00659
00660     Do not pass any parameters to this function that may be used by the
00661     ChooseColor dialog routines because this function will return before
00662     the new threads are finished.
00663
00664 ************************************************************************/
00665
00666
00667 void MultiThreadColorDlg(void)
00668 {
00669
00670   dwColorThreadParm1 = dwColorThreadParm2 = 0L ;
00671
00672   if (!(hColorThread1 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
00673                                      (LPTHREAD_START_ROUTINE) ColorThreadProc1,
00674                                      &dwColorThreadParm1, CREATE_SUSPENDED, &dwColorThreadID1)))
00675
00676   {
00677     MessageBox(GetForegroundWindow(), TEXT("Error creating thread 1"), NULL,
00678                MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;
00679
00680     nOpenColorDlgCount = 0 ;
00681
00682     EnableColorButtons(hwndMainColor, TRUE) ;
00683
00684     return ;
00685   }
00686
00687
00688   if (!(hColorThread2 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
00689                                      (LPTHREAD_START_ROUTINE) ColorThreadProc2,
00690                                      &dwColorThreadParm2, CREATE_SUSPENDED, &dwColorThreadID2)))
00691   {
00692     MessageBox(GetForegroundWindow(), TEXT("Error creating thread 2"), NULL,
00693                MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;
00694
00695     nOpenColorDlgCount = 0 ;
00696
00697     EnableColorButtons(hwndMainColor, TRUE) ;
00698
00699     return ;
00700   }
00701
00702   ResumeThread(hColorThread1) ;
00703
00704   ResumeThread(hColorThread2) ;
00705
00706   return ;
00707 }
00708
00709
00710
00711
00712
00713 /************************************************************************
00714
00715   Function:EnableColorButtons(HWND, BOOL)
00716
00717   Purpose: Enables or disables the buttons on the main colors dialog.
00718            Necessary when multithreading.
00719
00720   Returns: Nothing.
00721
00722   Comments:
00723
00724 ************************************************************************/
00725
00726
00727 void EnableColorButtons(HWND hwnd, BOOL bEnable)
00728 {
00729   EnableWindow(GetDlgItem(hwnd, IDOK), bEnable) ;
00730   EnableWindow(GetDlgItem(hwnd, IDCANCEL), bEnable) ;
00731   EnableWindow(GetDlgItem(hwnd, ID_RESETC), bEnable) ;
00732   EnableWindow(GetDlgItem(hwnd, ID_MULTITHREADCOLORS), bEnable) ;
00733 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/about.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163   MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164   *lpDest = wszStr;
00165
00166     return S_OK;
00167 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CallbackIUnknownLib::DeviceFinderCallBackInterface Member List

This is the complete list of members for CallbackIUnknownLib::DeviceFinderCallBackInterface, including all inherited members.
CallbackFunction([in] VARIANT device,[in] VARIANT UDN,[in] VARIANT callbackType) CallbackIUnknownLib::DeviceFinderCallBackInterface
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/people.h Source File

  • SysMgmt
  • MMC
  • Extens

people.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _PEOPLE_H
00021 #define _PEOPLE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CBicycle : public CDelegationBase {
00026 public:
00027     CBicycle(int i) : id(i) { }
00028     virtual ~CBicycle() {}
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00033
00034 private:
00035     // {2974380D-4C4B-11d2-89D8-000021473128}
00036     static const GUID thisGuid;
00037
00038     int id;
00039 };
00040
00041 class CBicycleFolder : public CDelegationBase {
00042 public:
00043     CBicycleFolder();
00044     virtual ~CBicycleFolder();
00045
00046     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Bicycles"); }
00047     virtual const GUID & getNodeType() { return thisGuid; }
00048     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00049
00050 public:
00051     // virtual functions go here (for MMCN_*)
00052     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00053
00054 private:
00055     // {2974380D-4C4B-11d2-89D8-000021473128}
00056     static const GUID thisGuid;
00057
00058     enum { NUMBER_OF_CHILDREN = 20 };
00059     CDelegationBase *children[NUMBER_OF_CHILDREN];
00060 };
00061
00062 class CSkateboard : public CDelegationBase {
00063 public:
00064     CSkateboard(int i) : id(i) { }
00065     virtual ~CSkateboard() {}
00066
00067     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00068     virtual const GUID & getNodeType() { return thisGuid; }
00069     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00070
00071 private:
00072     // {2974380D-4C4B-11d2-89D8-000021473128}
00073     static const GUID thisGuid;
00074
00075     int id;
00076 };
00077
00078 class CSkateboardFolder : public CDelegationBase {
00079 public:
00080     CSkateboardFolder();
00081     virtual ~CSkateboardFolder();
00082
00083     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Skateboards"); }
00084     virtual const GUID & getNodeType() { return thisGuid; }
00085     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00086
00087 public:
00088     // virtual functions go here (for MMCN_*)
00089     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00090
00091 private:
00092     // {2974380D-4C4B-11d2-89D8-000021473128}
00093     static const GUID thisGuid;
00094
00095     enum { NUMBER_OF_CHILDREN = 20 };
00096     CDelegationBase *children[NUMBER_OF_CHILDREN];
00097 };
00098
00099 class CIceSkate : public CDelegationBase {
00100 public:
00101     CIceSkate(int i) : id(i) { }
00102     virtual ~CIceSkate() {}
00103
00104     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00105     virtual const GUID & getNodeType() { return thisGuid; }
00106     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00107
00108 private:
00109     // {2974380D-4C4B-11d2-89D8-000021473128}
00110     static const GUID thisGuid;
00111
00112     int id;
00113 };
00114
00115 class CIceSkateFolder : public CDelegationBase {
00116 public:
00117     CIceSkateFolder();
00118     virtual ~CIceSkateFolder();
00119
00120     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Ice Skates"); }
00121     virtual const GUID & getNodeType() { return thisGuid; }
00122     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00123
00124 public:
00125     // virtual functions go here (for MMCN_*)
00126     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00127
00128 private:
00129     // {2974380D-4C4B-11d2-89D8-000021473128}
00130     static const GUID thisGuid;
00131
00132     enum { NUMBER_OF_CHILDREN = 20 };
00133     CDelegationBase *children[NUMBER_OF_CHILDREN];
00134 };
00135
00136 class CPeoplePoweredVehicle : public CDelegationBase {
00137 public:
00138     CPeoplePoweredVehicle();
00139     virtual ~CPeoplePoweredVehicle();
00140
00141     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("People-powered Vehicles"); }
00142     virtual const GUID & getNodeType() { return thisGuid; }
00143     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00144
00145     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00146
00147 private:
00148     enum { IDM_NEW_PEOPLE = 1 };
00149
00150     // {2974380D-4C4B-11d2-89D8-000021473128}
00151     static const GUID thisGuid;
00152
00153     enum { NUMBER_OF_CHILDREN = 3 };
00154     CDelegationBase *children[3];
00155 };
00156
00157 #endif // _PEOPLE_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/SampSSP/Stubs.c Source File

  • Security
  • Authentication
  • SampSSP

Stubs.c

Go to the documentation of this file.
00001 /*+-----------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1992 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 File:        stubs.c
00010
00011 Contents:    user-mode stubs for security API
00012
00013
00014 ------------------------------------------------------------------------*/
00015 #include "sampssp.h"
00016
00017
00018 SecurityFunctionTableW SecTableW = {SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION,
00019                                     EnumerateSecurityPackagesW,
00020                                     NULL,
00021                                     AcquireCredentialsHandleW,
00022                                     FreeCredentialsHandle,
00023                                     NULL, // LogonUser
00024                                     InitializeSecurityContextW,
00025                                     AcceptSecurityContext,
00026                                     CompleteAuthToken,
00027                                     DeleteSecurityContext,
00028                                     ApplyControlToken,
00029                                     QueryContextAttributesW,
00030                                     ImpersonateSecurityContext,
00031                                     RevertSecurityContext,
00032                                     MakeSignature,
00033                                     VerifySignature,
00034                                     FreeContextBuffer,
00035                                     QuerySecurityPackageInfoW
00036                                    };
00037
00038
00039 PSEC_CONTEXT ContextList;
00040 PCREDENTIAL CredentialList;
00041 ULONG NextId;
00042 TimeStamp Forever = {0x7fffffff,0xfffffff};
00043 TimeStamp Never = {0,0};
00044
00045 //+-------------------------------------------------------------------------
00046 //
00047 //  Function:   LocateContext
00048 //
00049 //  Synopsis:
00050 //
00051 //  Effects:
00052 //
00053 //  Arguments:
00054 //
00055 //  Requires:
00056 //
00057 //  Returns:
00058 //
00059 //  Notes:
00060 //
00061 //
00062 //--------------------------------------------------------------------------
00063
00064
00065 PSEC_CONTEXT
00066 LocateContext(ULONG ContextId)
00067 {
00068     PSEC_CONTEXT TestContext;
00069     EnterCriticalSection(&DllCritSect);
00070
00071     TestContext = ContextList;
00072     while (TestContext != NULL)
00073     {
00074         if (TestContext->ContextId == ContextId)
00075         {
00076             break;
00077         }
00078         TestContext = TestContext->Next;
00079     }
00080     LeaveCriticalSection(&DllCritSect);
00081     return(TestContext);
00082
00083 }
00084
00085 //+-------------------------------------------------------------------------
00086 //
00087 //  Function:   DeleteContext
00088 //
00089 //  Synopsis:
00090 //
00091 //  Effects:
00092 //
00093 //  Arguments:
00094 //
00095 //  Requires:
00096 //
00097 //  Returns:
00098 //
00099 //  Notes:
00100 //
00101 //
00102 //--------------------------------------------------------------------------
00103
00104
00105 BOOLEAN
00106 DeleteContext(ULONG ContextId)
00107 {
00108     PSEC_CONTEXT TestContext, LastContext;
00109
00110     EnterCriticalSection(&DllCritSect);
00111     TestContext = ContextList;
00112     LastContext = NULL;
00113
00114     while (TestContext != NULL)
00115     {
00116         if (TestContext->ContextId == ContextId)
00117         {
00118             break;
00119         }
00120         LastContext = TestContext;
00121         TestContext = TestContext->Next;
00122     }
00123     if (TestContext != NULL)
00124     {
00125         if (LastContext != NULL)
00126         {
00127             LastContext->Next = TestContext->Next;
00128         }
00129         else
00130         {
00131             assert(ContextList == TestContext);
00132             ContextList = TestContext->Next;
00133         }
00134         LocalFree(TestContext);
00135     }
00136     LeaveCriticalSection(&DllCritSect);
00137     return( TestContext == NULL ? FALSE : TRUE );
00138 }
00139
00140 //+-------------------------------------------------------------------------
00141 //
00142 //  Function:   AddContext
00143 //
00144 //  Synopsis:
00145 //
00146 //  Effects:
00147 //
00148 //  Arguments:
00149 //
00150 //  Requires:
00151 //
00152 //  Returns:
00153 //
00154 //  Notes:
00155 //
00156 //
00157 //--------------------------------------------------------------------------
00158
00159
00160 VOID
00161 AddContext(PSEC_CONTEXT Context)
00162 {
00163     EnterCriticalSection(&DllCritSect);
00164     Context->Next = ContextList;
00165     ContextList = Context;
00166     LeaveCriticalSection(&DllCritSect);
00167 }
00168
00169
00170 //+-------------------------------------------------------------------------
00171 //
00172 //  Function:   InitSecurityInterfaceW
00173 //
00174 //  Synopsis:
00175 //
00176 //  Effects:
00177 //
00178 //  Arguments:
00179 //
00180 //  Requires:
00181 //
00182 //  Returns:
00183 //
00184 //  Notes:
00185 //
00186 //
00187 //--------------------------------------------------------------------------
00188
00189
00190
00191 PCREDENTIAL
00192 LocateCredential(ULONG CredentialId)
00193 {
00194     PCREDENTIAL TestCredential;
00195     EnterCriticalSection(&DllCritSect);
00196
00197     TestCredential = CredentialList;
00198     while (TestCredential != NULL)
00199     {
00200         if (TestCredential->CredentialId == CredentialId)
00201         {
00202             break;
00203         }
00204         TestCredential = TestCredential->Next;
00205     }
00206     LeaveCriticalSection(&DllCritSect);
00207     return(TestCredential);
00208
00209 }
00210
00211 BOOLEAN
00212 DeleteCredential(ULONG CredentialId)
00213 {
00214     PCREDENTIAL TestCredential, LastCredential;
00215
00216     EnterCriticalSection(&DllCritSect);
00217     TestCredential = CredentialList;
00218     LastCredential = NULL;
00219
00220     while (TestCredential != NULL)
00221     {
00222         if (TestCredential->CredentialId == CredentialId)
00223         {
00224             break;
00225         }
00226         LastCredential = TestCredential;
00227         TestCredential = TestCredential->Next;
00228     }
00229     if (TestCredential != NULL)
00230     {
00231         if (LastCredential != NULL)
00232         {
00233             LastCredential->Next = TestCredential->Next;
00234         }
00235         else
00236         {
00237             assert(CredentialList == TestCredential);
00238             CredentialList = TestCredential->Next;
00239         }
00240         LocalFree(TestCredential);
00241     }
00242     LeaveCriticalSection(&DllCritSect);
00243     return( TestCredential == NULL ? FALSE : TRUE );
00244 }
00245
00246 VOID
00247 AddCredential(PCREDENTIAL Credential)
00248 {
00249     EnterCriticalSection(&DllCritSect);
00250     Credential->Next = CredentialList;
00251     CredentialList = Credential;
00252     LeaveCriticalSection(&DllCritSect);
00253 }
00254
00255 ULONG
00256 GetNewId()
00257 {
00258     ULONG NewId;
00259
00260     EnterCriticalSection(&DllCritSect);
00261     NewId = NextId;
00262     NextId ++;
00263     LeaveCriticalSection(&DllCritSect);
00264     return(NewId);
00265
00266 }
00267
00268 PSecBuffer
00269 LocateBuffer(PSecBufferDesc Buffer, ULONG MinimumSize)
00270 {
00271     ULONG Index;
00272     if (Buffer == NULL)
00273     {
00274         return(NULL);
00275     }
00276
00277     for (Index = 0; Index < Buffer->cBuffers  ; Index++)
00278     {
00279         if (((Buffer->pBuffers[Index].BufferType) & ~SECBUFFER_ATTRMASK)
00280             == SECBUFFER_TOKEN)
00281         {
00282
00283             //
00284             // Do size checking
00285             //
00286
00287             if (Buffer->pBuffers[Index].cbBuffer < MinimumSize)
00288             {
00289                 return(NULL);
00290             }
00291             return(&Buffer->pBuffers[Index]);
00292         }
00293     }
00294     return(NULL);
00295 }
00296
00297
00298
00299 PSecBuffer
00300 LocateSecBuffer(PSecBufferDesc Buffer)
00301 {
00302     return(LocateBuffer(Buffer, sizeof(MESSAGE)));
00303 }
00304
00305
00306 PSecBuffer
00307 LocateSigBuffer(PSecBufferDesc Buffer)
00308 {
00309     return(LocateBuffer(Buffer, sizeof(SIGNATURE)));
00310 }
00311
00312
00313 //+-------------------------------------------------------------------------
00314 //
00315 //  Function:   InitSecurityInterfaceW
00316 //
00317 //  Synopsis:
00318 //
00319 //  Effects:
00320 //
00321 //  Arguments:
00322 //
00323 //  Requires:
00324 //
00325 //  Returns:
00326 //
00327 //  Notes:
00328 //
00329 //
00330 //--------------------------------------------------------------------------
00331 PSecurityFunctionTableW SEC_ENTRY
00332 InitSecurityInterfaceW(VOID)
00333 {
00334     InitializeCriticalSection( &DllCritSect );
00335     return(&SecTableW);
00336 }
00337
00338
00339 //+-------------------------------------------------------------------------
00340 //
00341 //  Function:   AcquireCredentialsHandleW
00342 //
00343 //  Synopsis:
00344 //
00345 //  Effects:
00346 //
00347 //  Arguments:
00348 //
00349 //  Requires:
00350 //
00351 //  Returns:
00352 //
00353 //  Notes:
00354 //
00355 //
00356 //--------------------------------------------------------------------------
00357
00358
00359
00360 SECURITY_STATUS SEC_ENTRY
00361 AcquireCredentialsHandleW(
00362     LPWSTR                      pszPrincipal,       // Name of principal
00363     LPWSTR                      pszPackageName,     // Name of package
00364     unsigned long               fCredentialUse,     // Flags indicating use
00365     void SEC_FAR *              pvLogonId,          // Pointer to logon ID
00366     void SEC_FAR *              pAuthData,          // Package specific data
00367     SEC_GET_KEY_FN              pGetKeyFn,          // Pointer to GetKey() func
00368     void SEC_FAR *              pvGetKeyArgument,   // Value to pass to GetKey()
00369     PCredHandle                 phCredential,       // (out) Cred Handle
00370     PTimeStamp                  ptsExpiry           // (out) Lifetime (optional)
00371     )
00372 {
00373     PCREDENTIAL NewCredential = NULL;
00374
00375     if ((fCredentialUse & (SECPKG_CRED_BOTH)) == 0)
00376     {
00377         return(SEC_E_UNKNOWN_CREDENTIALS);
00378     }
00379     NewCredential = (PCREDENTIAL) LocalAlloc(0,sizeof(CREDENTIAL));
00380     if (NewCredential == NULL)
00381     {
00382         return(SEC_E_INSUFFICIENT_MEMORY);
00383     }
00384     NewCredential->CredentialId = GetNewId();
00385     NewCredential->Use = fCredentialUse;
00386     NewCredential->AuthData = (ULONG *)pAuthData;
00387     phCredential->dwUpper = NewCredential->CredentialId;
00388     *ptsExpiry = Forever;
00389     AddCredential(NewCredential);
00390     return(SEC_E_OK);
00391
00392 }
00393
00394
00395
00396 //+-------------------------------------------------------------------------
00397 //
00398 //  Function:   FreeCredentialsHandle
00399 //
00400 //  Synopsis:
00401 //
00402 //  Effects:
00403 //
00404 //  Arguments:
00405 //
00406 //  Requires:
00407 //
00408 //  Returns:
00409 //
00410 //  Notes:
00411 //
00412 //
00413 //--------------------------------------------------------------------------
00414
00415
00416 SECURITY_STATUS SEC_ENTRY
00417 FreeCredentialsHandle(
00418     PCredHandle                 phCredential        // Handle to free
00419     )
00420 {
00421     if (DeleteCredential(phCredential->dwUpper))
00422     {
00423         return(SEC_E_OK);
00424     }
00425     else
00426     {
00427         return(SEC_E_UNKNOWN_CREDENTIALS);
00428     }
00429 }
00430
00431
00432 //+-------------------------------------------------------------------------
00433 //
00434 //  Function:   InitializeSecurityContextW
00435 //
00436 //  Synopsis:
00437 //
00438 //  Effects:
00439 //
00440 //  Arguments:
00441 //
00442 //  Requires:
00443 //
00444 //  Returns:
00445 //
00446 //  Notes:
00447 //
00448 //
00449 //--------------------------------------------------------------------------
00450
00451
00452 SECURITY_STATUS SEC_ENTRY
00453 InitializeSecurityContextW(
00454     PCredHandle                 phCredential,       // Cred to base context
00455     PCtxtHandle                 phContext,          // Existing context (OPT)
00456     LPWSTR                      pszTargetName,      // Name of target
00457     unsigned long               fContextReq,        // Context Requirements
00458     unsigned long               Reserved1,          // Reserved, MBZ
00459     unsigned long               TargetDataRep,      // Data rep of target
00460     PSecBufferDesc              pInput,             // Input Buffers
00461     unsigned long               Reserved2,          // Reserved, MBZ
00462     PCtxtHandle                 phNewContext,       // (out) New Context handle
00463     PSecBufferDesc              pOutput,            // (inout) Output Buffers
00464     unsigned long SEC_FAR *     pfContextAttr,      // (out) Context attrs
00465     PTimeStamp                  ptsExpiry           // (out) Life span (OPT)
00466     )
00467 {
00468     PCREDENTIAL Credential = NULL;
00469     PSEC_CONTEXT Context = NULL;
00470     PMESSAGE Message = NULL;
00471     PSecBuffer OutputBuffer;
00472     PSecBuffer InputBuffer;
00473     MESSAGE SampleMessage;
00474
00475
00476     if (fContextReq & ISC_REQ_ALLOCATE_MEMORY)
00477     {
00478         return(SEC_E_INSUFFICIENT_MEMORY);
00479     }
00480
00481     OutputBuffer = LocateSecBuffer(pOutput);
00482     if (OutputBuffer == NULL)
00483     {
00484         return(SEC_E_INVALID_TOKEN);
00485     }
00486
00487     if (phContext == NULL)
00488     {
00489
00490         Credential = LocateCredential(phCredential->dwUpper);
00491         if (Credential == NULL)
00492         {
00493             return(SEC_E_UNKNOWN_CREDENTIALS);
00494         }
00495
00496         if ((Credential->Use & SECPKG_CRED_OUTBOUND) == 0)
00497         {
00498             return(SEC_E_UNKNOWN_CREDENTIALS);
00499         }
00500
00501     }
00502
00503     //
00504     // If the context is NULL, create a new one.
00505     //
00506
00507     if (phContext == NULL)
00508     {
00509         Context = (PSEC_CONTEXT) LocalAlloc(0,sizeof(SEC_CONTEXT));
00510         if (Context == NULL)
00511         {
00512             return(SEC_E_INSUFFICIENT_MEMORY);
00513         }
00514         Context->ContextId = GetNewId();
00515         phNewContext->dwUpper = Context->ContextId;
00516         Context->CredentialId = phCredential->dwUpper;
00517         Context->State = FirstInit;
00518         Context->Nonce = 0;
00519         Context->ContextFlags = fContextReq;
00520         *pfContextAttr = fContextReq;
00521         *ptsExpiry = Forever;
00522
00523         //
00524         // Build an output token.
00525         //
00526
00527         Message = (PMESSAGE) OutputBuffer->pvBuffer;
00528         Message->MessageType = Negotiate;
00529         memset(Message->Buffer,'x',MESSAGE_SIZE);
00530         OutputBuffer->cbBuffer = sizeof(MESSAGE);
00531
00532         AddContext(Context);
00533
00534         return(SEC_I_CONTINUE_NEEDED);
00535
00536     } else {
00537         //
00538         // This is the second call. Lookup the old context.
00539         //
00540
00541         Context = LocateContext(phContext->dwUpper);
00542         if (Context == NULL)
00543         {
00544             return(SEC_E_INVALID_HANDLE);
00545         }
00546
00547         if ((Context->State != FirstInit) &&
00548             (Context->State != SecondInit))
00549         {
00550             return(SEC_E_INVALID_HANDLE);
00551         }
00552
00553
00554         //
00555         // Build the new output message
00556         //
00557
00558         if (Context->State == FirstInit)
00559         {
00560
00561             //
00562             // Check that the input message is what we expected.
00563             //
00564
00565             InputBuffer = LocateSecBuffer(pInput);
00566             if (InputBuffer == NULL)
00567             {
00568                 return(SEC_E_INVALID_TOKEN);
00569             }
00570             Message = (PMESSAGE) InputBuffer->pvBuffer;
00571
00572             SampleMessage.MessageType = Challenge;
00573             memset(SampleMessage.Buffer, 'y', MESSAGE_SIZE);
00574
00575             if (memcmp(&SampleMessage,Message,MESSAGE_SIZE) != 0)
00576             {
00577                 return(SEC_E_INVALID_TOKEN);
00578             }
00579
00580             Message = (PMESSAGE) OutputBuffer->pvBuffer;
00581             Message->MessageType = ChallengeResponse;
00582             memset(Message->Buffer,'z',MESSAGE_SIZE);
00583         }
00584         else
00585         {
00586             Message = (PMESSAGE) OutputBuffer->pvBuffer;
00587             Message->MessageType = ReAuthenticate;
00588             memset(Message->Buffer,'q',MESSAGE_SIZE);
00589         }
00590
00591         OutputBuffer->cbBuffer = sizeof(MESSAGE);
00592         Context->State = SecondInit;
00593         return(SEC_E_OK);
00594     }
00595 }
00596
00597
00598
00599 //+------------------------------------------- ------------------------------
00600 //
00601 //  Function:   AcceptSecurityContext
00602 //
00603 //  Synopsis:   Allows a remotely initiated security context between the
00604 //              application and a remote peer to be established.  To complete
00605 //              the establishment of context one or more reply tokens may be
00606 //              required from remote peer.
00607 //              This function is the server counterpart to the
00608 //              InitializeSecurityContext API.  The ContextAttributes is a bit
00609 //              mask representing various context level functions such as
00610 //              delegation, mutual authentication, confidentiality, replay
00611 //              detection and sequence detection.  This API is used by the
00612 //              server side.  When a request comes in, the server uses the
00613 //              ContextReqFlags parameter to specify what it requires of the
00614 //              session.  In this fashion, a server can specify that clients
00615 //              must be capable of using a confidential or integrity checked
00616 //              session, and fail clients that can't meet that demand.
00617 //              Alternatively, a server can require nothing, and whatever the
00618 //              client can provide or requires is returned in the
00619 //              pfContextAttributes parameter.  For a package that supports 3
00620 //              leg mutual authentication, the calling sequence would be:
00621 //              Client provides a token, server calls Accept the first time,
00622 //              generating a reply token.  The client uses this in a second
00623 //              call to InitializeSecurityContext, and generates a final token.
00624 //              This token is then used in the final call to Accept to complete
00625 //              the session.  Another example would be the LAN Manager/NT
00626 //              authentication style.  The client connects to negotiate a
00627 //              protocol.  The server calls Accept to set up a context and
00628 //              generate a challenge to the client.  The client calls
00629 //              InitializeSecurityContext and creates a response.  The server
00630 //              then calls Accept the final time to allow the package to verify
00631 //              the response is appropriate for the challenge.
00632 //
00633 //  Effects:
00634 //
00635 //
00636 //  Arguments:  [phCredential] - Handle to the credentials to be used to
00637 //              create the context.
00638 //
00639 //              [phContext] - Handle to the partially formed context, if
00640 //              this is a second call (see above) or NULL if this is the first call.
00641 //
00642 //              [pInput] - Pointer to the input token.  In the first call
00643 //              this token can either be NULL or may contain
00644 //              security package specific information.
00645 //
00646 //              [fContextReq] - Requirements of the context, package specific. See
00647 //              the ASC_REQ_xxx defines in SSPI.H.
00648 //
00649 //              [TargetDataRep] - Long indicating the data representation (byte
00650 //              ordering, etc) on the target.  The constant
00651 //              SECURITY_NATIVE_DREP may be supplied by the
00652 //              transport indicating that the native format
00653 //              is in use.
00654 //
00655 //              [phNewContext] - New context handle.  If this is a second
00656 //              call, this can be same as OldContextHandle.
00657 //
00658 //              [pOutput] - Buffer to receive the output token.
00659 //
00660 //              [pfContextAttr] - Attributes of the context established. See
00661 //              the ASC_RET_xxx defines in SSPI.H
00662 //
00663 //              [ptsExpiry] - Expiration time of the context.
00664 //
00665 //  Requires:
00666 //
00667 //  Returns:    STATUS_SUCCESS - Message handled
00668 //              SEC_I_CALLBACK_NEEDED - Caller should call again later
00669 //              SEC_E_NO_SPM - Security Support Provider is not running
00670 //              SEC_E_INVALID_TOKEN - Token improperly formatted
00671 //              SEC_E_INVALID_HANDLE - Credential/Context Handle is invalid
00672 //              SEC_E_BUFFER_TOO_SMALL- Buffer for output token isn't big enough
00673 //              SEC_E_LOGON_DENIED - User is no allowed to logon to this server
00674 //              SEC_E_INSUFFICIENT_MEMORY - Not enough memory
00675 //
00676 //  Notes:
00677 //
00678 //
00679 //--------------------------------------------------------------------------
00680
00681
00682 SECURITY_STATUS SEC_ENTRY
00683 AcceptSecurityContext(
00684     PCredHandle                 phCredential,       // Cred to base context
00685     PCtxtHandle                 phContext,          // Existing context (OPT)
00686     PSecBufferDesc              pInput,             // Input buffer
00687     unsigned long               fContextReq,        // Context Requirements
00688     unsigned long               TargetDataRep,      // Target Data Rep
00689     PCtxtHandle                 phNewContext,       // (out) New context handle
00690     PSecBufferDesc              pOutput,            // (inout) Output buffers
00691     unsigned long SEC_FAR *     pfContextAttr,      // (out) Context attributes
00692     PTimeStamp                  ptsExpiry           // (out) Life span (OPT)
00693     )
00694 {
00695     PCREDENTIAL Credential = NULL;
00696     PSEC_CONTEXT Context = NULL;
00697     PMESSAGE Message = NULL;
00698     PSecBuffer OutputBuffer;
00699     PSecBuffer InputBuffer;
00700     MESSAGE SampleMessage;
00701
00702
00703     if (fContextReq & ISC_REQ_ALLOCATE_MEMORY)
00704     {
00705         return(SEC_E_INSUFFICIENT_MEMORY);
00706     }
00707
00708     InputBuffer = LocateSecBuffer(pInput);
00709     if (InputBuffer == NULL)
00710     {
00711         return(SEC_E_INVALID_TOKEN);
00712     }
00713
00714     if (phContext == NULL)
00715     {
00716
00717         Credential = LocateCredential(phCredential->dwUpper);
00718         if (Credential == NULL)
00719         {
00720             return(SEC_E_UNKNOWN_CREDENTIALS);
00721         }
00722
00723         if ((Credential->Use & SECPKG_CRED_INBOUND) == 0)
00724         {
00725             return(SEC_E_UNKNOWN_CREDENTIALS);
00726         }
00727
00728     }
00729
00730     //
00731     // If the context is NULL, create a new one.
00732     //
00733
00734     if (phContext == NULL)
00735     {
00736         //
00737         // Make sure the output buffer exists.
00738         //
00739
00740         OutputBuffer = LocateSecBuffer(pOutput);
00741         if (OutputBuffer == NULL)
00742         {
00743             return(SEC_E_INVALID_TOKEN);
00744         }
00745
00746
00747
00748         //
00749         // Check that the input message is what we expected.
00750         //
00751
00752         Message = (PMESSAGE) InputBuffer->pvBuffer;
00753         SampleMessage.MessageType = Negotiate;
00754         memset(SampleMessage.Buffer, 'x', MESSAGE_SIZE);
00755
00756         if (memcmp(&SampleMessage,Message,MESSAGE_SIZE) != 0)
00757         {
00758             return(SEC_E_INVALID_TOKEN);
00759         }
00760
00761         //
00762         // Build a new context.
00763         //
00764
00765         Context = (PSEC_CONTEXT) LocalAlloc(0,sizeof(SEC_CONTEXT));
00766         if (Context == NULL)
00767         {
00768             return(SEC_E_INSUFFICIENT_MEMORY);
00769         }
00770         Context->ContextId = GetNewId();
00771         phNewContext->dwUpper = Context->ContextId;
00772         Context->CredentialId = phCredential->dwUpper;
00773         Context->State = FirstAccept;
00774         Context->Nonce = 0;
00775         Context->ContextFlags = fContextReq;
00776         *pfContextAttr = fContextReq;
00777         *ptsExpiry = Forever;
00778
00779         //
00780         // Build an output token.
00781         //
00782
00783         Message = (PMESSAGE) OutputBuffer->pvBuffer;
00784         Message->MessageType = Challenge;
00785         memset(Message->Buffer,'y',MESSAGE_SIZE);
00786         OutputBuffer->cbBuffer = sizeof(MESSAGE);
00787
00788         AddContext(Context);
00789
00790         return(SEC_I_CONTINUE_NEEDED);
00791
00792     } else {
00793         //
00794         // This is the second call. Lookup the old context.
00795         //
00796
00797         Context = LocateContext(phContext->dwUpper);
00798         if (Context == NULL)
00799         {
00800             return(SEC_E_INVALID_HANDLE);
00801         }
00802         if ((Context->State != FirstAccept) &&
00803             (Context->State != SecondAccept))
00804         {
00805             return(SEC_E_INVALID_HANDLE);
00806         }
00807
00808         Message = (PMESSAGE) InputBuffer->pvBuffer;
00809
00810         //
00811         // Check that the input message is what we expected.
00812         //
00813
00814         if (Context->State == FirstAccept)
00815         {
00816             SampleMessage.MessageType = ChallengeResponse;
00817             memset(SampleMessage.Buffer, 'z', MESSAGE_SIZE);
00818         }
00819         else
00820         {
00821             SampleMessage.MessageType = ReAuthenticate;
00822             memset(SampleMessage.Buffer, 'q', MESSAGE_SIZE);
00823         }
00824
00825         if (memcmp(&SampleMessage,Message,MESSAGE_SIZE) != 0)
00826         {
00827             return(SEC_E_INVALID_TOKEN);
00828         }
00829
00830         Context->State = SecondAccept;
00831         return(SEC_E_OK);
00832     }
00833 }
00834
00835
00836
00837
00838
00839
00840 //+-------------------------------------------------------------------------
00841 //
00842 //  Function:   DeleteSecurityContext
00843 //
00844 //  Synopsis:
00845 //
00846 //  Effects:
00847 //
00848 //  Arguments:
00849 //
00850 //  Requires:
00851 //
00852 //  Returns:
00853 //
00854 //  Notes:
00855 //
00856 //
00857 //--------------------------------------------------------------------------
00858
00859
00860 SECURITY_STATUS SEC_ENTRY
00861 DeleteSecurityContext(
00862     PCtxtHandle                 phContext           // Context to delete
00863     )
00864 {
00865     if (DeleteContext(phContext->dwUpper))
00866     {
00867         return(SEC_E_OK);
00868     }
00869     else
00870     {
00871         return(SEC_E_INVALID_HANDLE);
00872     }
00873 }
00874
00875
00876
00877 //+-------------------------------------------------------------------------
00878 //
00879 //  Function:   ApplyControlToken
00880 //
00881 //  Synopsis:
00882 //
00883 //  Effects:
00884 //
00885 //  Arguments:
00886 //
00887 //  Requires:
00888 //
00889 //  Returns:
00890 //
00891 //  Notes:
00892 //
00893 //
00894 //--------------------------------------------------------------------------
00895
00896
00897 SECURITY_STATUS SEC_ENTRY
00898 ApplyControlToken(
00899     PCtxtHandle                 phContext,          // Context to modify
00900     PSecBufferDesc              pInput              // Input token to apply
00901     )
00902 {
00903     return(SEC_E_UNSUPPORTED_FUNCTION);
00904
00905 }
00906
00907
00908
00909
00910 //+-------------------------------------------------------------------------
00911 //
00912 //  Function:   EnumerateSecurityPackagesW
00913 //
00914 //  Synopsis:
00915 //
00916 //  Effects:
00917 //
00918 //  Arguments:
00919 //
00920 //  Requires:
00921 //
00922 //  Returns:
00923 //
00924 //  Notes:
00925 //
00926 //
00927 //--------------------------------------------------------------------------
00928
00929
00930
00931 SECURITY_STATUS SEC_ENTRY
00932 EnumerateSecurityPackagesW(
00933     unsigned long SEC_FAR *     pcPackages,         // Receives num. packages
00934     PSecPkgInfoW SEC_FAR *      ppPackageInfo       // Receives array of info
00935     )
00936 {
00937     SECURITY_STATUS SecStatus;
00938
00939     SecStatus = QuerySecurityPackageInfoW(
00940                     PACKAGE_NAME,
00941                     ppPackageInfo
00942                     );
00943     if (SecStatus == SEC_E_OK)
00944     {
00945         *pcPackages = 1;
00946
00947     }
00948
00949     return(SecStatus);
00950
00951 }
00952
00953
00954
00955 //+-------------------------------------------------------------------------
00956 //
00957 //  Function:   QuerySecurityPackageInfoW
00958 //
00959 //  Synopsis:
00960 //
00961 //  Effects:
00962 //
00963 //  Arguments:
00964 //
00965 //  Requires:
00966 //
00967 //  Returns:
00968 //
00969 //  Notes:
00970 //
00971 //
00972 //--------------------------------------------------------------------------
00973
00974
00975 SECURITY_STATUS SEC_ENTRY
00976 QuerySecurityPackageInfoW(
00977     LPWSTR                      pszPackageName,     // Name of package
00978     PSecPkgInfoW SEC_FAR *      ppPackageInfo        // Receives package info
00979     )
00980 {
00981     PSecPkgInfoW PackageInfo;
00982     ULONG PackageInfoSize;
00983     PUCHAR Where;
00984
00985     if (_wcsicmp(pszPackageName, PACKAGE_NAME))
00986     {
00987         return(SEC_E_SECPKG_NOT_FOUND);
00988     }
00989
00990     PackageInfoSize = sizeof(SecPkgInfoW) +
00991                         (wcslen(PACKAGE_NAME) + 1 +
00992                          wcslen(PACKAGE_COMMENT) + 1) * sizeof(WCHAR);
00993
00994     PackageInfo = (PSecPkgInfoW) LocalAlloc(0,PackageInfoSize);
00995     if (PackageInfo == NULL)
00996     {
00997         return(SEC_E_INSUFFICIENT_MEMORY);
00998     }
00999     PackageInfo->fCapabilities = PACKAGE_CAPABILITIES;
01000     PackageInfo->wVersion = PACKAGE_VERSION;
01001     PackageInfo->wRPCID = PACKAGE_RPCID;
01002     PackageInfo->cbMaxToken = PACKAGE_MAXTOKEN;
01003
01004     Where = (PUCHAR) (PackageInfo + 1);
01005     PackageInfo->Name = (LPWSTR) Where;
01006     Where += (wcslen(PACKAGE_NAME) + 1) * sizeof(WCHAR);
01007     wcscpy(PackageInfo->Name, PACKAGE_NAME);
01008
01009     PackageInfo->Comment = (LPWSTR) Where;
01010     Where += (wcslen(PACKAGE_COMMENT) + 1) * sizeof(WCHAR);
01011     wcscpy(PackageInfo->Comment, PACKAGE_COMMENT);
01012
01013     assert(Where - (PBYTE) PackageInfo == (LONG) PackageInfoSize);
01014
01015     *ppPackageInfo = PackageInfo;
01016     return(SEC_E_OK);
01017 }
01018
01019
01020
01021
01022
01023
01024 //+-------------------------------------------------------------------------
01025 //
01026 //  Function:   FreeContextBuffer
01027 //
01028 //  Synopsis:
01029 //
01030 //  Effects:
01031 //
01032 //  Arguments:
01033 //
01034 //  Requires:
01035 //
01036 //  Returns:
01037 //
01038 //  Notes:
01039 //
01040 //
01041 //--------------------------------------------------------------------------
01042
01043 SECURITY_STATUS SEC_ENTRY
01044 FreeContextBuffer(
01045     void SEC_FAR *      pvContextBuffer
01046     )
01047 {
01048     LocalFree(pvContextBuffer);
01049     return(SEC_E_OK);
01050 }
01051
01052
01053
01054 //+-------------------------------------------------------------------------
01055 //
01056 //  Function:   CompleteAuthToken
01057 //
01058 //  Synopsis:
01059 //
01060 //  Effects:
01061 //
01062 //  Arguments:
01063 //
01064 //  Requires:
01065 //
01066 //  Returns:
01067 //
01068 //  Notes:
01069 //
01070 //
01071 //--------------------------------------------------------------------------
01072
01073
01074
01075 SECURITY_STATUS SEC_ENTRY
01076 CompleteAuthToken(
01077     PCtxtHandle                 phContext,          // Context to complete
01078     PSecBufferDesc              pToken              // Token to complete
01079     )
01080 {
01081
01082     return(SEC_E_OK);
01083
01084 }
01085
01086
01087
01088 //+-------------------------------------------------------------------------
01089 //
01090 //  Function:   ImpersonateSecurityContext
01091 //
01092 //  Synopsis:
01093 //
01094 //  Effects:
01095 //
01096 //  Arguments:
01097 //
01098 //  Requires:
01099 //
01100 //  Returns:
01101 //
01102 //  Notes:
01103 //
01104 //
01105 //--------------------------------------------------------------------------
01106
01107
01108 SECURITY_STATUS SEC_ENTRY
01109 ImpersonateSecurityContext(
01110     PCtxtHandle                 phContext           // Context to impersonate
01111     )
01112 {
01113     return(SEC_E_OK);
01114 }
01115
01116
01117
01118 //+-------------------------------------------------------------------------
01119 //
01120 //  Function:   RevertSecurityContext
01121 //
01122 //  Synopsis:
01123 //
01124 //  Effects:
01125 //
01126 //  Arguments:
01127 //
01128 //  Requires:
01129 //
01130 //  Returns:
01131 //
01132 //  Notes:
01133 //
01134 //
01135 //--------------------------------------------------------------------------
01136
01137
01138 SECURITY_STATUS SEC_ENTRY
01139 RevertSecurityContext(
01140     PCtxtHandle                 phContext           // Context from which to re
01141     )
01142 {
01143     return(SEC_E_OK);
01144 }
01145
01146
01147 //+-------------------------------------------------------------------------
01148 //
01149 //  Function:   QueryContextAttributes
01150 //
01151 //  Synopsis:
01152 //
01153 //  Effects:
01154 //
01155 //  Arguments:
01156 //
01157 //  Requires:
01158 //
01159 //  Returns:
01160 //
01161 //  Notes:
01162 //
01163 //
01164 //--------------------------------------------------------------------------
01165
01166
01167
01168 SECURITY_STATUS SEC_ENTRY
01169 QueryContextAttributesW(
01170     PCtxtHandle                 phContext,          // Context to query
01171     unsigned long               ulAttribute,        // Attribute to query
01172     void SEC_FAR *              pBuffer             // Buffer for attributes
01173     )
01174 {
01175     PSEC_CONTEXT Context;
01176     PSecPkgContext_Sizes ContextSizes;
01177     PSecPkgContext_NamesW ContextNames;
01178     PSecPkgContext_Lifespan ContextLifespan;
01179     PSecPkgContext_DceInfo  ContextDceInfo;
01180
01181     Context = LocateContext(phContext->dwUpper);
01182
01183     if (Context == NULL)
01184     {
01185         return(SEC_E_INVALID_HANDLE);
01186     }
01187
01188     switch(ulAttribute) {
01189     case SECPKG_ATTR_SIZES:
01190         ContextSizes = (PSecPkgContext_Sizes) pBuffer;
01191         ContextSizes->cbMaxSignature = PACKAGE_SIGNATURE_SIZE;
01192         if ((Context->ContextFlags & ISC_REQ_CONFIDENTIALITY) != 0)
01193         {
01194             ContextSizes->cbSecurityTrailer = PACKAGE_SIGNATURE_SIZE;
01195             ContextSizes->cbBlockSize = 1;
01196         }
01197         else
01198         {
01199             ContextSizes->cbSecurityTrailer = 0;
01200             ContextSizes->cbBlockSize = 0;
01201         }
01202         ContextSizes->cbMaxToken = PACKAGE_MAXTOKEN;
01203         break;
01204     case SECPKG_ATTR_NAMES:
01205         ContextNames = (PSecPkgContext_Names) pBuffer;
01206         ContextNames->sUserName = (LPWSTR) LocalAlloc(0,sizeof(L"dummy user"));
01207         if (ContextNames->sUserName == NULL)
01208         {
01209             return(SEC_E_INSUFFICIENT_MEMORY);
01210         }
01211         wcscpy(ContextNames->sUserName, L"dummy user");
01212         break;
01213     case SECPKG_ATTR_LIFESPAN:
01214         ContextLifespan = (PSecPkgContext_Lifespan) pBuffer;
01215         ContextLifespan->tsStart = Never;
01216         ContextLifespan->tsExpiry = Forever;
01217         break;
01218     case SECPKG_ATTR_DCE_INFO:
01219         ContextDceInfo = (PSecPkgContext_DceInfo) pBuffer;
01220         ContextDceInfo->AuthzSvc = 0;
01221         ContextDceInfo->pPac = (PVOID) LocalAlloc(0,sizeof(L"dummy user"));
01222         if (ContextDceInfo->pPac == NULL)
01223         {
01224             return(SEC_E_INSUFFICIENT_MEMORY);
01225         }
01226         wcscpy((LPWSTR) ContextDceInfo->pPac, L"dummy user");
01227
01228         break;
01229     default:
01230         return(SEC_E_INVALID_TOKEN);
01231     }
01232
01233     return(SEC_E_OK);
01234 }
01235
01236 #if 0
01237
01238 //+-------------------------------------------------------------------------
01239 //
01240 //  Function:   QueryCredentialsAttributes
01241 //
01242 //  Synopsis:
01243 //
01244 //  Effects:
01245 //
01246 //  Arguments:
01247 //
01248 //  Requires:
01249 //
01250 //  Returns:
01251 //
01252 //  Notes:
01253 //
01254 //
01255 //--------------------------------------------------------------------------
01256
01257
01258
01259 SECURITY_STATUS SEC_ENTRY
01260 QueryCredentialsAttributesW(
01261     PCredHandle                 phCredentials,      // Credentials to query
01262     unsigned long               ulAttribute,        // Attribute to query
01263     void SEC_FAR *              pBuffer             // Buffer for attributes
01264     )
01265 {
01266     return( pspPackages[phCredentials->dwLower].pftTableW->QueryCredentialsAttributesW(
01267                                         phCredentials,
01268                                         ulAttribute,
01269                                         pBuffer ) );
01270 }
01271
01272 #endif
01273
01274 //+-------------------------------------------------------------------------
01275 //
01276 //  Function:   MakeSignature
01277 //
01278 //  Synopsis:
01279 //
01280 //  Effects:
01281 //
01282 //  Arguments:  [phContext]     -- context to use
01283 //              [fQOP]          -- quality of protection to use
01284 //              [pMessage]      -- message
01285 //              [MessageSeqNo]  -- sequence number of message
01286 //
01287 //  Requires:
01288 //
01289 //  Returns:
01290 //
01291 //  Notes:
01292 //
01293 //--------------------------------------------------------------------------
01294 SECURITY_STATUS SEC_ENTRY
01295 MakeSignature(  PCtxtHandle         phContext,
01296                 ULONG               fQOP,
01297                 PSecBufferDesc      pMessage,
01298                 ULONG               MessageSeqNo)
01299 {
01300     PSEC_CONTEXT Context;
01301     PSecBuffer SignatureBuffer;
01302     PSIGNATURE Signature;
01303
01304     Context = LocateContext(phContext->dwUpper);
01305     if (Context == NULL)
01306     {
01307         return(SEC_E_INVALID_HANDLE);
01308     }
01309
01310     SignatureBuffer = LocateSigBuffer(pMessage);
01311     if (SignatureBuffer == NULL)
01312     {
01313         return(SEC_E_INVALID_TOKEN);
01314     }
01315     Signature = (PSIGNATURE) SignatureBuffer->pvBuffer;
01316     Signature->MessageId = Context->Nonce++;
01317     Signature->Tag = PACKAGE_SIGNATURE_TAG;
01318     SignatureBuffer->cbBuffer = sizeof(SIGNATURE);
01319     return(SEC_E_OK);
01320 }
01321
01322
01323
01324 //+-------------------------------------------------------------------------
01325 //
01326 //  Function:   VerifySignature
01327 //
01328 //  Synopsis:
01329 //
01330 //  Effects:
01331 //
01332 //  Arguments:  [phContext]     -- Context performing the unseal
01333 //              [pMessage]      -- Message to verify
01334 //              [MessageSeqNo]  -- Sequence number of this message
01335 //              [pfQOPUsed]     -- quality of protection used
01336 //
01337 //  Requires:
01338 //
01339 //  Returns:
01340 //
01341 //  Notes:
01342 //
01343 //--------------------------------------------------------------------------
01344 SECURITY_STATUS SEC_ENTRY
01345 VerifySignature(PCtxtHandle     phContext,
01346                 PSecBufferDesc  pMessage,
01347                 ULONG           MessageSeqNo,
01348                 ULONG *         pfQOP)
01349 {
01350     PSEC_CONTEXT Context;
01351     PSecBuffer SignatureBuffer;
01352     PSIGNATURE Signature;
01353
01354     Context = LocateContext(phContext->dwUpper);
01355     if (Context == NULL)
01356     {
01357         return(SEC_E_INVALID_HANDLE);
01358     }
01359
01360     SignatureBuffer = LocateSigBuffer(pMessage);
01361     if (SignatureBuffer == NULL)
01362     {
01363         return(SEC_E_INVALID_TOKEN);
01364     }
01365     Signature = (PSIGNATURE) SignatureBuffer->pvBuffer;
01366
01367     if (Signature->Tag != PACKAGE_SIGNATURE_TAG)
01368     {
01369         return(SEC_E_MESSAGE_ALTERED);
01370     }
01371
01372     if (Signature->MessageId != Context->Nonce++)
01373     {
01374         Context->State = Idle;
01375         return(SEC_E_OUT_OF_SEQUENCE);
01376     }
01377
01378     return(SEC_E_OK);
01379 }
01380
01381
01382
01383
01384
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/Main.Cpp Source File

  • Web
  • NetMeeting
  • NMChat

Main.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       MAIN.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 //****************************************************************************
00019 //
00020 // Global Variables
00021 //
00022 //****************************************************************************
00023
00024 HINSTANCE ghInst       = NULL;          // Current Instance
00025 HACCEL    ghAccelTable = NULL;          // Menu accelerators
00026 HMENU     ghMenu       = NULL;          // Main Menu
00027 HWND      ghwndMain    = NULL;          // Main Window
00028 HWND      ghwndMsg     = hwndNil;       // Message window
00029 HWND      ghwndEdit    = hwndNil;       // Edit Control
00030 HWND      ghwndUser    = hwndNil;       // User List
00031 HFONT     ghfontMsg    = hfontNil;      // Font for messages
00032
00033
00034 TCHAR gszAppTitle[]     = TEXT("NetMeeting Chat Test Application");
00035
00036 // string constants (no change for international)
00037 TCHAR gszAppClassName[] = TEXT("NMCHAT");
00038 TCHAR gszAppName[]      = TEXT("NmChat");
00039
00040 // List column information
00041
00042 typedef struct _tagCol {
00043   UINT  dwWidth;
00044   LPTSTR lpsz;
00045 } COL;
00046 typedef COL * LPCOL;
00047
00048
00049 // See ILV_*
00050 static COL _rgColMsg[] = {
00051   {DXP_USER,  TEXT("Name")},
00052   {80,  TEXT("Time")},
00053   {400, TEXT("Message")},
00054 };
00055
00056
00057 //****************************************************************************
00058 //
00059 // BOOL FCreateMsgWindow(void)
00060 //
00061 // Create the main message listview
00062 //
00063 //****************************************************************************
00064
00065 BOOL FCreateMsgWindow(void)
00066 {
00067   ghwndMsg = CreateWindow(TEXT("SysListView32"), NULL,
00068     WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LVS_REPORT,
00069     0, 0, 0, 0,
00070     ghwndMain, (HMENU) IDW_USER, ghInst, NULL);
00071   if (ghwndMsg == NULL)
00072   {
00073     return FALSE;
00074   }
00075
00076   // Initialize column data
00077   {
00078     int   iCol    = 0;
00079     LPCOL lpCol   = _rgColMsg;
00080     LV_COLUMN lvc;
00081
00082     ClearStruct(&lvc);            // Zero's memory
00083     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00084     lvc.fmt = LVCFMT_LEFT;
00085     for (iCol = 0; iCol < ARRAY_ELEMENTS(_rgColMsg); iCol++)
00086     {
00087       lvc.iSubItem = iCol;
00088       lvc.cx = lpCol->dwWidth;
00089       lvc.pszText = lpCol->lpsz;
00090       if (ListView_InsertColumn(ghwndMsg, iCol, &lvc) == -1)
00091       {
00092         return FALSE;
00093       }
00094       lpCol++;
00095     }
00096   }
00097
00098   return TRUE;
00099 }
00100
00101
00102 //****************************************************************************
00103 //
00104 // BOOL FCreateUserList(void)
00105 //
00106 // Create a listbox for the users
00107 //
00108 //****************************************************************************
00109
00110 BOOL FCreateUserList(void)
00111 {
00112   ghwndUser = CreateWindow(TEXT("SysListView32"), NULL,
00113     WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LVS_REPORT | LVS_SHOWSELALWAYS,
00114     0, 0, DXP_USER, 0,
00115     ghwndMain, (HMENU) IDW_MSG, ghInst, NULL);
00116
00117   if (NULL == ghwndUser)
00118   {
00119     return FALSE;
00120   }
00121
00122   // Initialize column data
00123   {
00124     LV_COLUMN lvc;
00125
00126     ClearStruct(&lvc);            // Zero's memory
00127     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00128     lvc.fmt = LVCFMT_LEFT;
00129     lvc.iSubItem = 0;
00130     lvc.cx = DXP_USER;
00131     lvc.pszText = TEXT("Send To");
00132     if (ListView_InsertColumn(ghwndUser, 0, &lvc) == -1)
00133     {
00134       return FALSE;
00135     }
00136   }
00137
00138   return TRUE;
00139 }
00140
00141
00142 WNDPROC lpProcEdit = NULL;
00143 LRESULT FAR PASCAL SubClsEdit(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00144
00145
00146 //****************************************************************************
00147 //
00148 // LRESULT FAR PASCAL SubClsEdit(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00149 //
00150 //****************************************************************************
00151
00152 LRESULT FAR PASCAL SubClsEdit(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00153 {
00154   if ((uMsg == WM_CHAR) && (VK_RETURN == wParam))
00155   {
00156     SendText();
00157     return 0L;
00158   }
00159
00160   return CallWindowProc(lpProcEdit, hwnd, uMsg, wParam, lParam);
00161 }
00162
00163
00164 //****************************************************************************
00165 //
00166 // BOOL FCreateEditWindow(void)
00167 //
00168 //****************************************************************************
00169
00170 BOOL FCreateEditWindow(void)
00171 {
00172   ghwndEdit = CreateWindow(TEXT("EDIT"), NULL,
00173     WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL,
00174     0, 0, 0, DYP_EDIT,
00175     ghwndMain, (HMENU) IDW_EDIT, ghInst, NULL);
00176   if (ghwndEdit == NULL)
00177   {
00178     return FALSE;
00179   }
00180
00181   // set the font for the window
00182
00183   lpProcEdit = (WNDPROC) GetWindowLong(ghwndEdit, GWL_WNDPROC);
00184   SetWindowLong(ghwndEdit, GWL_WNDPROC, (LONG)(WNDPROC) SubClsEdit);
00185
00186   return TRUE;
00187 }
00188
00189
00190 //****************************************************************************
00191 //
00192 // BOOL FInitMain(void)
00193 //
00194 // Initialize the window data and register the window class
00195 //
00196 //****************************************************************************
00197
00198 BOOL FInitMain(void)
00199 {
00200   WNDCLASS  wc;
00201   TCHAR szTitle[MAX_PATH + 1];
00202
00203   ZeroMemory(&wc, sizeof(WNDCLASS));
00204   ZeroMemory(szTitle, (MAX_PATH + 1) * sizeof(TCHAR));
00205
00206   ASSERT(NULL != ghInst);
00207
00208   ghAccelTable = LoadAccelerators(ghInst, MAKEINTRESOURCE(ID_APPACCEL));
00209
00210   LoadString(ghInst, IDS_APP_TITLE, szTitle, CCHMAX(szTitle));
00211
00212   wc.style         = CS_HREDRAW | CS_VREDRAW;
00213   wc.lpfnWndProc   = (WNDPROC)WndProc;
00214   wc.cbClsExtra    = 0;
00215   wc.cbWndExtra    = 0;
00216   wc.hInstance     = ghInst;
00217   wc.hIcon         = LoadIcon(ghInst, MAKEINTRESOURCE(ICO_MAIN));
00218   wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00219   wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
00220   wc.lpszMenuName  = MAKEINTRESOURCE(IDM_APP);
00221   wc.lpszClassName = gszAppClassName;
00222
00223   // Register the window class and return FALSE if unsuccesful.
00224   if (!RegisterClass(&wc))
00225   {
00226     return FALSE;
00227   }
00228
00229   // Create a main window for this application instance.
00230   ghwndMain = CreateWindow(gszAppClassName, szTitle, WS_OVERLAPPEDWINDOW,
00231     0, 0, 400, 300,
00232     NULL, NULL, ghInst, NULL);
00233   if (ghwndMain == NULL)
00234   {
00235     return FALSE;
00236   }
00237
00238   ghMenu = GetMenu(ghwndMain);
00239   return (NULL != ghMenu);
00240 }
00241
00242
00243 //****************************************************************************
00244 //
00245 // BOOL FInitApp(LPSTR lpszCmd, int nCmdShow)
00246 //
00247 // Initialize the application after checking command line, etc.
00248 //
00249 //****************************************************************************
00250
00251 BOOL FInitApp(LPSTR lpszCmd, int nCmdShow)
00252 {
00253   InitCommonControls();
00254
00255   if (FAILED(CoInitialize(NULL)))
00256   {
00257     return FALSE;
00258   }
00259
00260   if (!FInitMain())
00261   {
00262     return FALSE;
00263   }
00264
00265   if (!FCreateMsgWindow())
00266   {
00267     return FALSE;
00268   }
00269
00270   if (!FCreateUserList())
00271   {
00272     return FALSE;
00273   }
00274
00275   if (!FCreateEditWindow())
00276   {
00277     return FALSE;
00278   }
00279
00280   ASSERT(NULL != ghwndMain);
00281
00282 // DO I NEED A CHECK HERE for if(NULL == ghwndMain)?
00283
00284   ShowWindow(ghwndMain, nCmdShow);
00285   UpdateWindow(ghwndMain);
00286
00287   SetFocus(ghwndEdit);
00288
00289   return S_OK == InitConfMgr();
00290 }
00291
00292
00293 //****************************************************************************
00294 //
00295 // VOID TerminateApp(void)
00296 //
00297 //****************************************************************************
00298
00299 VOID TerminateApp(void)
00300 {
00301   // Release all objects to which this app has a reference
00302   FreeDataChannel();
00303   FreeAllUsers();
00304   FreeConference();
00305   FreeConfMgr();
00306
00307     // Uninitialize OLE
00308     CoUninitialize();
00309 }
00310
00311
00312 //****************************************************************************
00313 //
00314 // int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPSTR  lpszCmd, int nCmdShow)
00315 //
00316 // Main Windows entrypoint
00317 //
00318 //****************************************************************************
00319
00320 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPSTR  lpszCmd, int nCmdShow)
00321 {
00322   ghInst = hInstance;
00323
00324   if (FInitApp(lpszCmd, nCmdShow))
00325   {
00326     MSG  msg;
00327     while (GetMessage(&msg, NULL, 0, 0))
00328     {
00329       if (!TranslateAccelerator(msg.hwnd, ghAccelTable, &msg))
00330       {
00331         TranslateMessage(&msg);
00332         DispatchMessage(&msg);
00333       }
00334     }
00335   }
00336
00337   TerminateApp();
00338
00339   return 0;
00340 }
00341
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/TextElem.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

TextElem.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright 1992 - 2000 Microsoft Corporation.
00004 //
00005 //  File:       textelem.cxx
00006 //
00007 //  Contents:   Parsing algorithm for vanilla text in Html
00008 //
00009 //  Classes:    CTextElement
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <textelem.hxx>
00017 #include <htmlguid.hxx>
00018 #include <ntquery.h>
00019
00020 //+-------------------------------------------------------------------------
00021 //
00022 //  Method:     CTextElement::CTextElement
00023 //
00024 //  Synopsis:   Constructor
00025 //
00026 //  Arguments:  [htmlIFilter]    -- Html IFilter
00027 //              [serialStream]   -- Input stream
00028 //
00029 //--------------------------------------------------------------------------
00030
00031 CTextElement::CTextElement( CHtmlIFilter& htmlIFilter,
00032                             CSerialStream& serialStream )
00033     : CHtmlElement(htmlIFilter, serialStream),
00034       _fNoMoreText(TRUE),
00035       _eTokTypeNext(GenericToken),
00036       _idChunk(0),
00037       _cTextChars(0)
00038 {
00039 }
00040
00041
00042
00043 //+-------------------------------------------------------------------------
00044 //
00045 //  Method:     CTextElement::GetChunk
00046 //
00047 //  Synopsis:   Gets the next chunk and returns chunk information in pStat
00048 //
00049 //  Arguments:  [pStat] -- chunk information returned here
00050 //
00051 //--------------------------------------------------------------------------
00052
00053 SCODE CTextElement::GetChunk( STAT_CHUNK * pStat )
00054 {
00055     if ( _serialStream.Eof() )
00056         return FILTER_E_END_OF_CHUNKS;
00057
00058     if ( _fNoMoreText )
00059     {
00060         //
00061         // This is the GetChunk call after we've returned FILTER_E_NO_MORE_TEXT
00062         // for the previous chunk
00063         //
00064         CHtmlElement *pHtmlElemNext = _htmlIFilter.QueryHtmlElement( _eTokTypeNext );
00065         Win4Assert( pHtmlElemNext );
00066         pHtmlElemNext->InitStatChunk( pStat );
00067         _htmlIFilter.ChangeState( pHtmlElemNext );
00068     }
00069     else
00070     {
00071         //
00072         // GetChunk was called even though we had not returned
00073         // FILTER_E_NO_MORE_TEXT.
00074         //
00075         SCODE sc = SkipRemainingTextAndGotoNextChunk( pStat );
00076
00077         return sc;
00078     }
00079
00080     return S_OK;
00081 }
00082
00083
00084
00085 //+-------------------------------------------------------------------------
00086 //
00087 //  Method:     CTextElement::GetText
00088 //
00089 //  Synopsis:   Retrieves text from current chunk
00090 //
00091 //  Arguments:  [pcwcOutput] -- count of UniCode characters in buffer
00092 //              [awcBuffer]  -- buffer for text
00093 //
00094 //--------------------------------------------------------------------------
00095
00096 SCODE CTextElement::GetText( ULONG *pcwcOutput, WCHAR *awcBuffer )
00097 {
00098     if ( _fNoMoreText || _serialStream.Eof() )
00099     {
00100         *pcwcOutput = 0;
00101         return FILTER_E_NO_MORE_TEXT;
00102     }
00103
00104     ULONG cCharsRead = 0;  // count of chars read from input
00105     while ( cCharsRead < *pcwcOutput )
00106     {
00107         CToken token;
00108         ULONG cCharsScanned;
00109         ULONG cCharsNeeded = *pcwcOutput - cCharsRead;
00110
00111         _scanner.GetBlockOfChars( cCharsNeeded,
00112                                   awcBuffer + cCharsRead,
00113                                   cCharsScanned,
00114                                   token );
00115
00116         cCharsRead += cCharsScanned;
00117         if ( cCharsScanned == cCharsNeeded )
00118         {
00119             //
00120             // We've read the #chars requested by the user
00121             //
00122             break;
00123         }
00124
00125         HtmlTokenType eTokType = token.GetTokenType();
00126         if ( eTokType == EofToken || _htmlIFilter.IsStopToken( token ) )
00127         {
00128             //
00129             // End of file, or we've hit an interesting token
00130             //
00131             _fNoMoreText = TRUE;
00132             _eTokTypeNext = eTokType;         // Need the token type to set up the next chunk
00133
00134             break;
00135         }
00136         else if ( eTokType == BreakToken )
00137         {
00138             //
00139             // Insert a newline char
00140             //
00141             Win4Assert( cCharsRead < *pcwcOutput );
00142             awcBuffer[cCharsRead++] = L'\n';
00143             _scanner.EatTag();
00144         }
00145         else
00146         {
00147             //
00148             // Skip over uninteresting tag and continue processing
00149             //
00150             _scanner.EatTag();
00151         }
00152     }
00153
00154     *pcwcOutput = cCharsRead;
00155
00156     _cTextChars += cCharsRead;
00157
00158     if ( _fNoMoreText )
00159         return FILTER_S_LAST_TEXT;
00160     else
00161         return S_OK;
00162 }
00163
00164
00165
00166
00167
00168 //+-------------------------------------------------------------------------
00169 //
00170 //  Method:     CTextElement::InitStatChunk
00171 //
00172 //  Synopsis:   Initializes the STAT_CHUNK
00173 //
00174 //  Arguments:  [pStat] -- STAT_CHUNK to initialize
00175 //
00176 //--------------------------------------------------------------------------
00177
00178 void CTextElement::InitStatChunk( STAT_CHUNK *pStat )
00179 {
00180     //
00181     // There is more text to be returned
00182     //
00183     _fNoMoreText = FALSE;
00184
00185     pStat->idChunk = _htmlIFilter.GetNextChunkId();
00186     pStat->flags = CHUNK_TEXT;
00187     pStat->locale = _htmlIFilter.GetLocale();
00188     pStat->attribute.guidPropSet = CLSID_Storage;
00189     pStat->attribute.psProperty.ulKind = PRSPEC_PROPID;
00190     pStat->attribute.psProperty.propid = PID_STG_CONTENTS;
00191     pStat->breakType = CHUNK_EOS;
00192     pStat->idChunkSource = pStat->idChunk;
00193     pStat->cwcStartSource = 0;
00194     pStat->cwcLenSource = 0;
00195
00196     _idChunk = pStat->idChunk;
00197     _cTextChars = 0;
00198 }
00199
00200
00201
00202 //+-------------------------------------------------------------------------
00203 //
00204 //  Method:     CTextElement::InitFilterRegion
00205 //
00206 //  Synopsis:   Initializes the filter region corresponding to this chunk
00207 //
00208 //  Arguments:  [idChunkSource]  -- Id of source chunk
00209 //              [cwcStartSource] -- Offset of source text in chunk
00210 //              [cwcLenSource]   -- Length of source text in chunk
00211 //
00212 //--------------------------------------------------------------------------
00213
00214 void CTextElement::InitFilterRegion( ULONG& idChunkSource,
00215                                      ULONG& cwcStartSource,
00216                                      ULONG& cwcLenSource )
00217 {
00218     idChunkSource = _idChunk;
00219     cwcStartSource = 0;
00220     cwcLenSource = _cTextChars;
00221 }
00222
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CShellView Member List

This is the complete list of members for CShellView, including all inherited members.
AddItem(LPCITEMIDLIST) | CShellView | [private]
AddPropertySheetPages(DWORD, LPFNADDPROPSHEETPAGE, LPARAM) | CShellView |
CContextMenu class | CShellView | [friend]
ContextSensitiveHelp(BOOL) | CShellView |
CreateList(VOID) | CShellView | [private]
CreateViewWindow(LPSHELLVIEW, LPCFOLDERSETTINGS, LPSHELLBROWSER, LPRECT, HWND *) | CShellView |
CShellFolder class | CShellView | [friend]
CShellView(CShellFolder *, LPCITEMIDLIST) | CShellView |
DeleteItem(LPCITEMIDLIST) | CShellView | [private]
DestroyViewWindow(VOID) | CShellView |
DoContextMenu(WORD, WORD, BOOL, DWORD) | CShellView | [private]
EditItem(LPCITEMIDLIST) | CShellView | [private]
EnableModeless(BOOL) | CShellView |
FillList(VOID) | CShellView | [private]
FindItemPidl(LPCITEMIDLIST) | CShellView | [private]
GetCurrentInfo(LPFOLDERSETTINGS) | CShellView |
GetFQPidl() | CShellView | [private]
GetItemObject(UINT, REFIID, LPVOID *) | CShellView |
GetPidl() | CShellView | [private]
GetShellSettings(VOID) | CShellView | [private]
GetWindow(HWND *) | CShellView |
InitList(VOID) | CShellView | [private]
m_fInEdit | CShellView | [private]
m_FolderSettings | CShellView | [private]
m_hAccels | CShellView | [private]
m_hMenu | CShellView | [private]
m_hWnd | CShellView | [private]
m_hwndList | CShellView | [private]
m_hwndParent | CShellView | [private]
m_ObjRefCount | CShellView | [private]
m_pidl | CShellView | [private]
m_pMalloc | CShellView | [private]
m_pPidlMgr | CShellView | [private]
m_psfParent | CShellView | [private]
m_pShellBrowser | CShellView | [private]
m_uState | CShellView | [private]
MarkItemsAsCut(LPCITEMIDLIST *, UINT) | CShellView | [private]
MergeEditMenu(HMENU, BOOL) | CShellView | [private]
MergeFileMenu(HMENU, BOOL) | CShellView | [private]
MergeToolbar(VOID) | CShellView | [private]
MergeViewMenu(HMENU) | CShellView | [private]
OnActivate(UINT) | CShellView | [private]
OnCommand(DWORD, DWORD, HWND) | CShellView | [private]
OnCreate(VOID) | CShellView | [private]
OnDeactivate(VOID) | CShellView | [private]
OnDestroy(VOID) | CShellView | [private]
OnKillFocus(VOID) | CShellView | [private]
OnNotify(UINT, LPNMHDR) | CShellView | [private]
OnSetFocus(VOID) | CShellView | [private]
OnSettingChange(LPCTSTR) | CShellView | [private]
OnSize(WORD, WORD) | CShellView | [private]
OnViewDetails(VOID) | CShellView | [private]
OnViewLarge(VOID) | CShellView | [private]
OnViewList(VOID) | CShellView | [private]
OnViewSmall(VOID) | CShellView | [private]
QueryInterface(REFIID, LPVOID *) | CShellView |
Refresh(VOID) | CShellView |
RenameItem(LPCITEMIDLIST, LPCITEMIDLIST) | CShellView | [private]
SaveViewState(VOID) | CShellView |
SelectItem(LPCITEMIDLIST, UINT) | CShellView |
STDMETHOD_(DWORD, AddRef)() | CShellView |
STDMETHOD_(DWORD, Release)() | CShellView |
TranslateAccelerator(LPMSG) | CShellView |
UIActivate(UINT) | CShellView |
UpdateData(LPCITEMIDLIST) | CShellView | [private]
UpdateMenu(HMENU hMenu) | CShellView | [private]
UpdateToolbar(VOID) | CShellView | [private]
WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam) | CShellView | [private, static]
~CShellView() | CShellView |
Generated on Wed Nov 13 2024 16:57:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSpaceStation Member List

This is the complete list of members for CSpaceStation, including all inherited members.
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
bExpanded | CDelegationBase | [protected]
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
children | CSpaceStation | [private]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CSpaceStation() | CSpaceStation |
CSpaceStation() | CSpaceStation |
DecrementCountChildSpaceStations() | CSpaceStation | [inline]
Expand(IConsoleNameSpace *pConsoleNameSpace) | CSpaceStation | [private]
CDelegationBase::Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
GetBitmapIndex() | CSpaceStation | [inline, virtual]
GetBitmapIndex() | CSpaceStation | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCountChildSpaceStations() | CSpaceStation | [inline]
GetDisplayName(int nCol=0) | CSpaceStation | [inline, virtual]
GetDisplayName(int nCol=0) | CSpaceStation | [inline, virtual]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CDelegationBase | [inline, virtual]
getNodeType() | CSpaceStation | [inline, virtual]
getNodeType() | CSpaceStation | [inline, virtual]
GetParentScopeItem() | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CSpaceStation | [virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CSpaceStation | [virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CDelegationBase | [inline, virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CDelegationBase | [inline, virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CDelegationBase | [inline, virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
m_cChildSpaceStations | CSpaceStation | [private]
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pComponentData | CSpaceStation | [private]
MAX_CHILDREN enum value | CSpaceStation | [private]
NUMBER_OF_CHILDREN enum value | CSpaceStation | [private]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CSpaceStation | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CDelegationBase | [inline, virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CSpaceStation | [virtual]
OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(CDelegationBase *pPasted) | CSpaceStation | [virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CSpaceStation | [virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CSpaceStation | [virtual]
CDelegationBase::OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
CDelegationBase::OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CSpaceStation | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CSpaceStation | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CSpaceStation | [virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CSpaceStation | [virtual]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CDelegationBase | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CDelegationBase | [inline, virtual]
thisGuid | CSpaceStation | [private, static]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CSpaceStation() | CSpaceStation | [virtual]
~CSpaceStation() | CSpaceStation | [virtual]
Generated on Wed Nov 13 2024 16:57:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

UPNPDimmerService Member List

This is the complete list of members for UPNPDimmerService, including all inherited members.
Advise(IUPnPEventSink *punkSubscriber) | UPNPDimmerService |
csSync | UPNPDimmerService | [private]
dimnessLevel | UPNPDimmerService | [private]
esEventingManager | UPNPDimmerService | [private]
get_dimLevel(LONG *dLevel) | UPNPDimmerService |
get_Power(VARIANT_BOOL *pval) | UPNPDimmerService |
GetConfigDetails(VARIANT_BOOL *powerVal, LONG *dLevel) | UPNPDimmerService |
GetDimLevel(LONG *dLevel) | UPNPDimmerService |
GetPowerValue(VARIANT_BOOL *powerVal) | UPNPDimmerService |
power | UPNPDimmerService | [private]
PowerOff() | UPNPDimmerService |
PowerOn() | UPNPDimmerService |
SetDimLevel(LONG dLevel) | UPNPDimmerService |
Unadvise(IUPnPEventSink *punkSubscriber) | UPNPDimmerService |
UPNPDimmerService() | UPNPDimmerService |
~UPNPDimmerService() | UPNPDimmerService |
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppagex/globals.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppagex

globals.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _MMC_GLOBALS_H
00015 #define _MMC_GLOBALS_H
00016
00017 #include <TChar.h>
00018 #include <Mmc.h>
00019 #include <CrtDbg.h>
00020 #include "Guids.h"
00021
00022 class CDataObject;
00023
00024
00025 //---------------------------------------------------------------------------
00026 extern HINSTANCE g_hInst;              // Global instance handle
00027 extern ULONG     g_uObjectCount;       // Instance count for this object
00028 extern ULONG     g_uServerLocks;       // Server lock count for this object
00029
00030 //---------------------------------------------------------------------------
00031 // XPROPPAGE: Stuff we need to support clipformats from the Property Page
00032 //            sample which we are extending
00033
00034 #define T_CCF_ATTRIB_PTR     _T("CCF_ATTRIB_PTR")
00035
00036 extern UINT g_cfNodeAttrPtr;           // Points to NODE_ATTRIBS struct
00037
00038 #define MAX_OBJECT_PATH      255
00039
00040 typedef struct _tag_NODE_ATTRIB_       // Clipformat points to this data
00041 {
00042   WCHAR  szObjectPath[MAX_OBJECT_PATH];
00043
00044 } NODE_ATTRIBS;
00045
00046 #define ATTRIBUTE_DATA_COMPRESSED      64
00047 #define ATTRIBUTE_DATA_ENCRYPTED       128
00048
00049
00050 //---------------------------------------------------------------------------
00051 //  Global function prototypes
00052
00053 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide );
00054
00055 //---------------------------------------------------------------------------
00056 //  Global Strings
00057
00058
00059 static TCHAR*  gtszSNAPIN_NAME       = _T("Sample G1 (MMC 2.0) - Property PageX");
00060
00061 //XPROPPAGE:  GUID string for nodes which we extend.
00062 static TCHAR*  gtszVFILE_GUID        = _T("{F0091C49-C869-4941-A81C-C719AD8174CC}");
00063 static TCHAR*  gtszPROPPAGEX_GUID    = _T("{489F991A-9A75-4553-885B-6EE881C50A26}");
00064
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067 // Helper classes and macros
00068
00069 #define BYTE_SIZE(string)          ((_tcslen(string)+1) * sizeof(TCHAR))
00070
00071 #define BREAK_ON_ERROR( hResult )  if( S_OK != hResult ) continue
00072
00073 // Useful only for debugging.  Never use modal dialogs in release builds!!
00074 #define MsgBox(wszMsg, wszTitle) ::MessageBox(NULL, wszMsg, wszTitle, MB_OK)
00075
00076
00077 //---------------------------------------------------------------------------
00078 template<class TYPE>
00079 inline void SAFE_RELEASE( TYPE*& pObj )
00080 {
00081   if( NULL != pObj )
00082   {
00083     pObj->Release();
00084     pObj = NULL;
00085   }
00086   else
00087   {
00088     OutputDebugString(_T("Attempted to release NULL Com pointer.\n"));
00089   }
00090 }
00091
00092 //---------------------------------------------------------------------------
00093 template<class TYPE>
00094 inline void SAFE_FREE_BITMAP( TYPE*& pObj )
00095 {
00096   if( NULL != pObj )
00097   {
00098     BOOL bStatus = DeleteObject( pObj );
00099     pObj = NULL;
00100   }
00101   else
00102   {
00103     OutputDebugString(_T("Attempted to delete NULL Bitmap handle.\n"));
00104   }
00105 }
00106
00107 //---------------------------------------------------------------------------
00108 template<class TYPE>
00109 inline void SAFE_FREE_ICON( TYPE*& pObj )
00110 {
00111   if( NULL != pObj )
00112   {
00113     BOOL bStatus = DestroyIcon( pObj );
00114     pObj = NULL;
00115   }
00116   else
00117   {
00118     OutputDebugString(_T("Attempted to delete NULL Icon handle.\n"));
00119   }
00120 }
00121
00122 //---------------------------------------------------------------------------
00123 //  W2T converts a wide character string to unicode if _UNICODE is not
00124 //  defined.  If it is defined then the sting is copied to another buffer.
00125 //
00126 #ifndef _UNICODE
00127 #define W2T( szAnsiPtr, szWide )   Unicode2Ansi( szAnsiPtr, szWide )
00128 #else
00129 #define W2T( szAnsiPtr, szWide )                                 \
00130         *szAnsiPtr = (WCHAR*)CoTaskMemAlloc(BYTE_SIZE(szWide) ); \
00131         CopyMemory( *szAnsiPtr, szWide, BYTE_SIZE(szWide) )
00132
00133 #endif //_UNICODE
00134
00135
00136 #endif //_MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/UtilLib/UtilLib.h Source File

  • SysMgmt
  • WMI
  • VC
  • UtilLib

UtilLib.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  utillib.h
00006 //
00007 // Description:
00008 //    Set of sample routines
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #define MAXITOA  19
00015 #define FWPRINTF myFWPrintf
00016 #define CLASSPROP L"__CLASS"
00017 #define SERVERPROP L"__SERVER"
00018 #define PATHPROP L"__PATH"
00019 #define NAMESPACEPROP L"__NAMESPACE"
00020 #define SYSTEMCLASS L"__SystemClass"
00021 #define RELPATHPROP L"__RELPATH"
00022 #define NAMEPROP L"Name"
00023 #define CIMTYPEQUAL L"CIMTYPE"
00024 #define KEYQUAL L"key"
00025 #define SYSTEMPREFIX L"__"
00026 #define CVTFAILED L"WideCharToMultiByte failed\n"
00027 #define RELEASE(a) if (a) { (a)->Release(); (a)=NULL;}
00028 #define BLOCKSIZE (32 * sizeof(WCHAR))
00029 #define CVTBUFSIZE (309+40) /* # of digits in max. dp value + slop  (this size stolen from cvt.h in c runtime library) */
00030 #define PAGESIZE 4096
00031 #define ERROR_MODE_PRINTFIELDS 0
00032 #define ERROR_MODE_PRINTMOF 1
00033 #define UNREFERENCED(x)
00034
00035 #define STRSAFE_NO_DEPRECATE
00036
00037 #include <comdef.h>
00038 #include <strsafe.h>
00039
00040 _COM_SMARTPTR_TYPEDEF(IEnumWbemClassObject, __uuidof(IEnumWbemClassObject));
00041 _COM_SMARTPTR_TYPEDEF(IWbemLocator, __uuidof(IWbemLocator));
00042 _COM_SMARTPTR_TYPEDEF(IWbemCallResult, __uuidof(IWbemCallResult));
00043 _COM_SMARTPTR_TYPEDEF(IWbemClassObject, __uuidof(IWbemClassObject));
00044 _COM_SMARTPTR_TYPEDEF(IWbemContext, __uuidof(IWbemContext));
00045 _COM_SMARTPTR_TYPEDEF(IWbemObjectAccess, __uuidof(IWbemObjectAccess));
00046 _COM_SMARTPTR_TYPEDEF(IWbemObjectSink, __uuidof(IWbemObjectSink));
00047 _COM_SMARTPTR_TYPEDEF(IWbemQualifierSet, __uuidof(IWbemQualifierSet));
00048 _COM_SMARTPTR_TYPEDEF(IWbemServices, __uuidof(IWbemServices));
00049 _COM_SMARTPTR_TYPEDEF(IWbemStatusCodeText, __uuidof(IWbemStatusCodeText));
00050
00051 char *cvt(WCHAR *x, char **y);
00052 double difftime(struct _timeb finish, struct _timeb start);
00053 int myFWPrintf(FILE *f, WCHAR *fmt, ...);
00054 const WCHAR *TypeToString(VARIANT *p);
00055 const WCHAR *TypeToString(VARTYPE v);
00056 const WCHAR *TypeToString(CIMTYPE v);
00057 WCHAR *ValueToString(CIMTYPE dwType, VARIANT *pValue, WCHAR **pbuf, WCHAR *fnHandler(VARIANT *pv) = NULL);
00058 BSTR WbemErrorString(SCODE sc);
00059 void PrintErrorAndExit(char *pszFailureReason, SCODE sc, DWORD dwMode);
00060 void PrintErrorAndAsk(char *pszFailureReason, SCODE sc, DWORD dwMode);
00061 void PrintError(char *pszFailureReason, SCODE sc, DWORD dwMode);
00062
00063 class MyString {
00064 private:
00065    WCHAR *pwszString;
00066
00067 public:
00068    MyString::MyString()
00069    {
00070      pwszString = (WCHAR *)calloc(1, sizeof(WCHAR));
00071    }
00072    MyString::~MyString()
00073    {
00074      free(pwszString);
00075    }
00076    WCHAR *GetString() {return pwszString;}
00077    void Empty() {free(pwszString);pwszString = (WCHAR *)calloc(1, sizeof(WCHAR));}
00078    WCHAR *GetCloneString()
00079    {
00080       WCHAR *buf = NULL;
00081     if (pwszString)
00082     {
00083       int ibufSize = (wcslen(pwszString) + 1) * sizeof(WCHAR);
00084       buf = (WCHAR *)malloc(ibufSize);
00085       if (buf)
00086       StringCbCopyW(buf, ibufSize, pwszString);
00087     }
00088       return buf;
00089    }
00090    const MyString& operator+=(const WCHAR *arg1)
00091       {
00092          size_t iHave;
00093          size_t iNeed;
00094          if (arg1)
00095          {
00096              iHave = wcslen(pwszString);
00097              iNeed = wcslen(arg1);
00098              pwszString = (WCHAR *)realloc(pwszString, (iHave + iNeed + 1) * sizeof(WCHAR));
00099        if (pwszString)
00100        {
00101         StringCbCatW(&pwszString[iHave],
00102               ((iHave + iNeed + 1) * sizeof(WCHAR)) - iHave,
00103               arg1);
00104        }
00105          }
00106          return *this;
00107       }
00108
00109 };
00110
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

newseventclass::NewsEvent Member List

This is the complete list of members for newseventclass::NewsEvent, including all inherited members.
iid | newseventclass::INewsEventDefault | [static]
LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate) | newseventclass::NewsEvent | [inline]
NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL) | newseventclass::NewsEvent | [inline]
ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow) | newseventclass::NewsEvent | [inline]
Generated on Wed Nov 13 2024 16:58:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/UserEvents/VCAcct/Account.idl Source File

  • Com
  • Services
  • Events
  • UserEvents
  • VCAcct

Account.idl

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: Account.idl
00003 //
00004 // Description: IDL source for Account.dll
00005 // This file will be processed by the MIDL tool to
00006 // produce the type library (Account.tlb) and marshalling code
00007 //
00008 // This file is part of the Microsoft COM+ Samples
00009 //
00010 // Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved
00011 //
00012 // This source code is intended only as a supplement to Microsoft
00013 // Development Tools and/or on-line documentation.  See these other
00014 // materials for detailed information reagrding Microsoft code samples.
00015 //
00016 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 // PARTICULAR PURPOSE.
00020 //
00021 //==============================================================================
00022
00023
00024 #include <mtxattr.h>
00025
00026   [
00027     object,
00028     uuid(04CF0B72-1989-11D0-B917-0080C7394688),
00029     dual,
00030     helpstring("IAccount Interface"),
00031     pointer_default(unique)
00032
00033   ]
00034   interface IAccount : IDispatch
00035   {
00036     import "oaidl.idl";
00037     import "ocidl.idl";
00038     HRESULT Post(
00039       [in] long lAccount,
00040       [in] long lAmount,
00041       [out,retval] BSTR* pbstrResult);
00042   };
00043
00044 [
00045   uuid(04CF0B70-1989-11D0-B917-0080C7394688),
00046   version(1.0),
00047   helpstring("Sample Bank Account (VC version)")
00048 ]
00049 library ACCOUNT
00050 {
00051   importlib("stdole2.tlb");
00052
00053   [
00054     uuid(04CF0B76-1989-11D0-B917-0080C7394688),
00055     helpstring("Account Class"),
00056     TRANSACTION_REQUIRED
00057   ]
00058   coclass CAccount
00059   {
00060     [default] interface IAccount;
00061   };
00062 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/NewsEventClass/newsevent.h Source File

  • Com
  • Services
  • Events
  • EventNews
  • NewsEventClass

newsevent.h

Go to the documentation of this file.
00001 // NewsEvent.h : Declaration of the CNewsEvent
00002
00003 #ifndef __NEWSEVENT_H_
00004 #define __NEWSEVENT_H_
00005
00006 #include "resource.h"       // main symbols
00007
00008 /////////////////////////////////////////////////////////////////////////////
00009 // CNewsEvent
00010 class ATL_NO_VTABLE CNewsEvent :
00011   public CComObjectRootEx<CComMultiThreadModel>,
00012   public CComCoClass<CNewsEvent, &CLSID_NewsEvent>
00013 {
00014 public:
00015   CNewsEvent()
00016   {
00017   }
00018
00019 DECLARE_REGISTRY_RESOURCEID(IDR_NEWSEVENT)
00020
00021 DECLARE_PROTECT_FINAL_CONSTRUCT()
00022
00023 BEGIN_COM_MAP(CNewsEvent)
00024 END_COM_MAP()
00025
00026 // INewsEvent
00027 public:
00028 };
00029
00030 #endif //__NEWSEVENT_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/mainfrm.cpp Source File

  • Multimedia
  • Audio
  • multichan

mainfrm.cpp

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 // MainFrm.cpp : implementation of the CMainFrame class
00006 //
00007
00008 #include "stdafx.h"
00009 #include "multichan.h"
00010
00011 #include "MainFrm.h"
00012
00013 #ifdef _DEBUG
00014 #define new DEBUG_NEW
00015 #undef THIS_FILE
00016 static char THIS_FILE[] = __FILE__;
00017 #endif
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CMainFrame
00021
00022 IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
00023
00024 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
00025   //{{AFX_MSG_MAP(CMainFrame)
00026   ON_WM_CREATE()
00027   ON_WM_SETFOCUS()
00028   ON_COMMAND(IDM_MIXER_PLAY, OnMixerPlay)
00029   ON_UPDATE_COMMAND_UI(IDM_MIXER_PLAY, OnUpdateMixerPlay)
00030   //}}AFX_MSG_MAP
00031 END_MESSAGE_MAP()
00032
00033 static UINT indicators[] =
00034 {
00035   ID_SEPARATOR,           // status line indicator
00036   ID_INDICATOR_CAPS,
00037   ID_INDICATOR_NUM,
00038   ID_INDICATOR_SCRL,
00039 };
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // CMainFrame construction/destruction
00043
00044 CMainFrame::CMainFrame()
00045 {
00046   // TODO: add member initialization code here
00047
00048 }
00049
00050 CMainFrame::~CMainFrame()
00051 {
00052 }
00053
00054 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
00055 {
00056   if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
00057     return -1;
00058   // create a view to occupy the client area of the frame
00059   if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
00060     CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
00061   {
00062     TRACE0("Failed to create view window\n");
00063     return -1;
00064   }
00065
00066   if (!m_wndToolBar.Create(this) ||
00067     !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
00068   {
00069     TRACE0("Failed to create toolbar\n");
00070     return -1;      // fail to create
00071   }
00072
00073   if (!m_wndStatusBar.Create(this) ||
00074     !m_wndStatusBar.SetIndicators(indicators,
00075       sizeof(indicators)/sizeof(UINT)))
00076   {
00077     TRACE0("Failed to create status bar\n");
00078     return -1;      // fail to create
00079   }
00080
00081   // TODO: Remove this if you don't want tool tips
00082   m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
00083     CBRS_TOOLTIPS | CBRS_FLYBY);
00084
00085   return 0;
00086 }
00087
00088 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
00089 {
00090   if( !CFrameWnd::PreCreateWindow(cs) )
00091     return FALSE;
00092   // TODO: Modify the Window class or styles here by modifying
00093   //  the CREATESTRUCT cs
00094
00095   cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
00096   cs.lpszClass = AfxRegisterWndClass(0);
00097   return TRUE;
00098 }
00099
00100 /////////////////////////////////////////////////////////////////////////////
00101 // CMainFrame diagnostics
00102
00103 #ifdef _DEBUG
00104 void CMainFrame::AssertValid() const
00105 {
00106   CFrameWnd::AssertValid();
00107 }
00108
00109 void CMainFrame::Dump(CDumpContext& dc) const
00110 {
00111   CFrameWnd::Dump(dc);
00112 }
00113
00114 #endif //_DEBUG
00115
00116 /////////////////////////////////////////////////////////////////////////////
00117 // CMainFrame message handlers
00118 void CMainFrame::OnSetFocus(CWnd* pOldWnd)
00119 {
00120   // forward focus to the view window
00121   m_wndView.SetFocus();
00122 }
00123
00124 BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
00125 {
00126   // let the view have first crack at the command
00127   if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
00128     return TRUE;
00129
00130   // otherwise, do default handling
00131   return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
00132 }
00133
00134
00135 void CMainFrame::OnMixerPlay()
00136 {
00137   // TODO: Add your command handler code here
00138
00139 }
00140
00141 void CMainFrame::OnUpdateMixerPlay(CCmdUI* pCmdUI)
00142 {
00143   // TODO: Add your command update UI handler code here
00144
00145 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Resource_Dispenser/Disp1.Idl Source File

  • Com
  • Services
  • Resource_Dispenser

Disp1.Idl

Go to the documentation of this file.
00001 // Disp1.idl : IDL source for Disp1.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (Disp1.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010   [
00011
00012     uuid(804E6431-B232-11D1-B32F-00AA006887C3),
00013
00014     helpstring("ILDisp Interface"),
00015     pointer_default(unique)
00016   ]
00017   interface ILDisp : IUnknown
00018   {
00019     [helpstring("method Alloc")] HRESULT Alloc([in,out] long * pJAustin);
00020     [helpstring("method DeAlloc")] HRESULT DeAlloc([in]long JAustin);
00021   };
00022 [
00023   uuid(804E6424-B232-11D1-B32F-00AA006887C3),
00024   version(1.0),
00025   helpstring("Disp1 1.0 Type Library")
00026 ]
00027 library DISP1Lib
00028 {
00029   importlib("stdole32.tlb");
00030   importlib("stdole2.tlb");
00031
00032   [
00033     uuid(804E6432-B232-11D1-B32F-00AA006887C3),
00034     helpstring("LDisp Class")
00035   ]
00036   coclass LDisp
00037   {
00038     [default] interface ILDisp;
00039   };
00040 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       resource.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by userproppage.rc
00014 //
00015 #define IDD_USER_PAGE_EXT               107
00016 #define IDC_EDIT_PICTURE_PATH           1000
00017 #define IDC_PICTURE_DISPLAY             1001
00018 #define IDC_BUTTON_CHANGE_PICTURE       1002
00019 #define IDC_EDIT_EMPLOYEE_ID            1003
00020 #define IDC_BUTTON_CLEAR_PICTURE        1004
00021
00022 // Next default values for new objects
00023 //
00024 #ifdef APSTUDIO_INVOKED
00025 #ifndef APSTUDIO_READONLY_SYMBOLS
00026 #define _APS_NEXT_RESOURCE_VALUE        101
00027 #define _APS_NEXT_COMMAND_VALUE         40001
00028 #define _APS_NEXT_CONTROL_VALUE         1005
00029 #define _APS_NEXT_SYMED_VALUE           101
00030 #endif
00031 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCOutgoing/Resource.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCOutgoing

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by RTCOutgoing.rc
00004 //
00005 #define IDM_ABOUTBOX                    0x0010
00006 #define IDD_ABOUTBOX                    100
00007 #define IDS_ABOUTBOX                    101
00008 #define IDD_RTCOUTGOING_DIALOG          102
00009 #define IDR_MAINFRAME                   128
00010 #define IDC_DURI                        1008
00011 #define IDC_LURI                        1009
00012 #define IDC_PCPCRADIO                   1010
00013 #define IDC_PCPHRADIO                   1011
00014 #define IDC_PHPHRADIO                   1012
00015 #define IDC_CONNECT                     1013
00016 #define IDC_DISCONNECT                  1014
00017 #define IDC_EXIT                        1015
00018 #define IDC_APPSHARING                  1016
00019 #define IDC_TUNE                        1017
00020 #define IDC_PARTYLIST                   1020
00021 #define IDC_PARTYSTATIC                 1021
00022 #define IDC_ADDPARTY                    1022
00023 #define IDC_REMOVEPARTY                 1023
00024 #define IDC_DURISTATIC                  1024
00025 #define IDC_LURISTATIC                  1025
00026 #define IDC_VSENDSTATIC                 1026
00027 #define IDC_VSENDS                      1026
00028 #define IDC_VRECVSTATIC                 1027
00029 #define IDC_VRECVS                      1027
00030 #define IDC_STATUS                      1031
00031
00032 // Next default values for new objects
00033 //
00034 #ifdef APSTUDIO_INVOKED
00035 #ifndef APSTUDIO_READONLY_SYMBOLS
00036 #define _APS_NEXT_RESOURCE_VALUE        131
00037 #define _APS_NEXT_COMMAND_VALUE         32771
00038 #define _APS_NEXT_CONTROL_VALUE         1032
00039 #define _APS_NEXT_SYMED_VALUE           101
00040 #endif
00041 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStartupListener/StdAfx.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStartupListener

StdAfx.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      StdAfx.cpp
00005 //
00006 //  Description:
00007 //      Includes the standard includes.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 //
00012 //  stdafx.cpp : source file that includes just the standard includes
00013 //  stdafx.pch will be the pre-compiled header
00014 //  stdafx.obj will contain the pre-compiled type information
00015 //
00016
00017 #include "stdafx.h"
00018
00019 #ifdef _ATL_STATIC_REGISTRY
00020 #include <statreg.h>
00021 #endif
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/entity_except.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

entity_except.Cpp

Go to the documentation of this file.
00001 // Static.cpp : Implementation of CEntity
00002 #include "stdafx.h"
00003 #include "Data.h"
00004 #include "Entity.h"
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // CEntity functions that need exceptions turned on
00008
00009 STDMETHODIMP CEntity::put_Recordset(_Recordset *newVal)
00010 {
00011   HRESULT hr = S_OK;
00012   try
00013   {
00014     _RecordsetPtr spRecordset = newVal;
00015     FieldsPtr spFields = spRecordset->Fields;
00016     long nRSCount = spFields->Count;
00017     long iCol;
00018
00019     if (spRecordset->GetadoEOF() != VARIANT_TRUE)
00020     {
00021       hr = Initialize(nRSCount);
00022       if (SUCCEEDED(hr))
00023       {
00024         for (iCol = 0; iCol < nRSCount && SUCCEEDED(hr); iCol++)
00025         {
00026           hr = Insert(iCol + 1, spFields->Item[iCol]->Name, &spFields->Item[iCol]->Value);
00027         }
00028       }
00029     }
00030   }
00031   catch (_com_error e)
00032   {
00033     hr = e.Error();
00034   }
00035   return hr;
00036 }
00037
00038
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/CtxMenu.Cpp Source File

  • WinUI
  • Shell
  • ShellExt

CtxMenu.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   ctxmenu.cpp
00009 //
00010 //  PURPOSE:   Implements the IContextMenu member functions necessary to support
00011 //             the context menu portioins of this shell extension.  Context menu
00012 //             shell extensions are called when the user right clicks on a file
00013 //             (of the type registered for the shell extension--see SHELLEXT.REG
00014 //             for details on the registry entries.  In this sample, the relevant
00015 //             files are of type .GAK) in the Explorer, or selects the File menu
00016 //             item.
00017 //
00018
00019 #include "priv.h"
00020 #include "shellext.h"
00021
00022 #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
00023
00024 //
00025 //  FUNCTION: CShellExt::QueryContextMenu(HMENU, UINT, UINT, UINT, UINT)
00026 //
00027 //  PURPOSE: Called by the shell just before the context menu is displayed.
00028 //           This is where you add your specific menu items.
00029 //
00030 //  PARAMETERS:
00031 //    hMenu      - Handle to the context menu
00032 //    indexMenu  - Index of where to begin inserting menu items
00033 //    idCmdFirst - Lowest value for new menu ID's
00034 //    idCmtLast  - Highest value for new menu ID's
00035 //    uFlags     - Specifies the context of the menu event
00036 //
00037 //  RETURN VALUE:
00038 //
00039 //
00040 //  COMMENTS:
00041 //
00042
00043 STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
00044                                          UINT indexMenu,
00045                                          UINT idCmdFirst,
00046                                          UINT idCmdLast,
00047                                          UINT uFlags)
00048 {
00049     ODS("CShellExt::QueryContextMenu()\r\n");
00050
00051     UINT idCmd = idCmdFirst;
00052     char szMenuText[64];
00053     char szMenuText2[64];
00054     char szMenuText3[64];
00055     char szMenuText4[64];
00056     BOOL bAppendItems=TRUE;
00057
00058     if ((uFlags & 0x000F) == CMF_NORMAL)  //Check == here, since CMF_NORMAL=0
00059     {
00060         ODS("CMF_NORMAL...\r\n");
00061         lstrcpyn(szMenuText, "&New .GAK menu 1, Normal File", ARRAYSIZE(szMenuText));
00062         lstrcpyn(szMenuText2, "&New .GAK menu 2, Normal File", ARRAYSIZE(szMenuText2));
00063         lstrcpyn(szMenuText3, "&New .GAK menu 3, Normal File", ARRAYSIZE(szMenuText3));
00064         lstrcpyn(szMenuText4, "&New .GAK menu 4, Normal File", ARRAYSIZE(szMenuText4));
00065     }
00066     else
00067         if (uFlags & CMF_VERBSONLY)
00068         {
00069             ODS("CMF_VERBSONLY...\r\n");
00070             lstrcpyn(szMenuText, "&New .GAK menu 1, Shortcut File", ARRAYSIZE(szMenuText));
00071             lstrcpyn(szMenuText2, "N&ew .GAK menu 2, Shortcut File", ARRAYSIZE(szMenuText2));
00072             lstrcpyn(szMenuText3, "&New .GAK menu 3, Shortcut File", ARRAYSIZE(szMenuText3));
00073             lstrcpyn(szMenuText4, "&New .GAK menu 4, Shortcut File", ARRAYSIZE(szMenuText4));
00074         }
00075     else
00076         if (uFlags & CMF_EXPLORE)
00077         {
00078             ODS("CMF_EXPLORE...\r\n");
00079             lstrcpyn(szMenuText, "&New .GAK menu 1, Normal File right click in Explorer", ARRAYSIZE(szMenuText));
00080             lstrcpyn(szMenuText2, "N&ew .GAK menu 2, Normal File right click in Explorer", ARRAYSIZE(szMenuText2));
00081             lstrcpyn(szMenuText3, "&New .GAK menu 3, Normal File right click in Explorer", ARRAYSIZE(szMenuText3));
00082             lstrcpyn(szMenuText4, "&New .GAK menu 4, Normal File right click in Explorer", ARRAYSIZE(szMenuText4));
00083         }
00084     else
00085         if (uFlags & CMF_DEFAULTONLY)
00086         {
00087             ODS("CMF_DEFAULTONLY...\r\n");
00088             bAppendItems = FALSE;
00089         }
00090     else
00091         {
00092             char szTemp[32];
00093
00094             wsprintf(szTemp, "uFlags==>%d\r\n", uFlags);
00095             ODS("CMF_default...\r\n");
00096             ODS(szTemp);
00097             bAppendItems = FALSE;
00098         }
00099
00100     if (bAppendItems)
00101     {
00102         InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
00103
00104         InsertMenu(hMenu,
00105                    indexMenu++,
00106                    MF_STRING|MF_BYPOSITION,
00107                    idCmd++,
00108                    szMenuText);
00109
00110         InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
00111
00112         InsertMenu(hMenu,
00113                    indexMenu++,
00114                    MF_STRING|MF_BYPOSITION,
00115                    idCmd++,
00116                    szMenuText2);
00117
00118         InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
00119
00120         InsertMenu(hMenu,
00121                    indexMenu++,
00122                    MF_STRING|MF_BYPOSITION,
00123                    idCmd++,
00124                    szMenuText3);
00125
00126         InsertMenu(hMenu,
00127                    indexMenu++,
00128                    MF_STRING|MF_BYPOSITION,
00129                    idCmd++,
00130                    szMenuText4);
00131
00132         return ResultFromShort(idCmd-idCmdFirst); //Must return number of menu
00133                                                   //items we added.
00134    }
00135
00136    return NOERROR;
00137 }
00138
00139 //
00140 //  FUNCTION: CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO)
00141 //
00142 //  PURPOSE: Called by the shell after the user has selected on of the
00143 //           menu items that was added in QueryContextMenu().
00144 //
00145 //  PARAMETERS:
00146 //    lpcmi - Pointer to an CMINVOKECOMMANDINFO structure
00147 //
00148 //  RETURN VALUE:
00149 //
00150 //
00151 //  COMMENTS:
00152 //
00153
00154 STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
00155 {
00156     ODS("CShellExt::InvokeCommand()\r\n");
00157
00158     HRESULT hr = E_INVALIDARG;
00159
00160     //If HIWORD(lpcmi->lpVerb) then we have been called programmatically
00161     //and lpVerb is a command that should be invoked.  Otherwise, the shell
00162     //has called us, and LOWORD(lpcmi->lpVerb) is the menu ID the user has
00163     //selected.  Actually, it's (menu ID - idCmdFirst) from QueryContextMenu().
00164     if (!HIWORD(lpcmi->lpVerb))
00165     {
00166         UINT idCmd = LOWORD(lpcmi->lpVerb);
00167
00168         switch (idCmd)
00169         {
00170             case 0:
00171                 hr = DoGAKMenu1(lpcmi->hwnd,
00172                                 lpcmi->lpDirectory,
00173                                 lpcmi->lpVerb,
00174                                 lpcmi->lpParameters,
00175                                 lpcmi->nShow);
00176                 break;
00177
00178             case 1:
00179                 hr = DoGAKMenu2(lpcmi->hwnd,
00180                                 lpcmi->lpDirectory,
00181                                 lpcmi->lpVerb,
00182                                 lpcmi->lpParameters,
00183                                 lpcmi->nShow);
00184                 break;
00185
00186             case 2:
00187                 hr = DoGAKMenu3(lpcmi->hwnd,
00188                                 lpcmi->lpDirectory,
00189                                 lpcmi->lpVerb,
00190                                 lpcmi->lpParameters,
00191                                 lpcmi->nShow);
00192                 break;
00193
00194             case 3:
00195                 hr = DoGAKMenu4(lpcmi->hwnd,
00196                                 lpcmi->lpDirectory,
00197                                 lpcmi->lpVerb,
00198                                 lpcmi->lpParameters,
00199                                 lpcmi->nShow);
00200                 break;
00201         }
00202     }
00203     return hr;
00204 }
00205
00206
00207 //
00208 //  FUNCTION: CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO)
00209 //
00210 //  PURPOSE: Called by the shell after the user has selected on of the
00211 //           menu items that was added in QueryContextMenu().
00212 //
00213 //  PARAMETERS:
00214 //    lpcmi - Pointer to an CMINVOKECOMMANDINFO structure
00215 //
00216 //  RETURN VALUE:
00217 //
00218 //
00219 //  COMMENTS:
00220 //
00221
00222 STDMETHODIMP CShellExt::GetCommandString(UINT_PTR idCmd,
00223                                          UINT uFlags,
00224                                          UINT FAR *reserved,
00225                                          LPSTR pszName,
00226                                          UINT cchMax)
00227 {
00228     ODS("CShellExt::GetCommandString()\r\n");
00229
00230     switch (idCmd)
00231     {
00232         case 0:
00233             lstrcpyn(pszName, "New menu item number 1", cchMax);
00234             break;
00235
00236         case 1:
00237             lstrcpyn(pszName, "New menu item number 2", cchMax);
00238             break;
00239
00240         case 2:
00241             lstrcpyn(pszName, "New menu item number 3", cchMax);
00242             break;
00243
00244         case 3:
00245             lstrcpyn(pszName, "New menu item number 4", cchMax);
00246             break;
00247     }
00248
00249     return NOERROR;
00250 }
00251
00252 STDMETHODIMP CShellExt::DoGAKMenu1(HWND hParent,
00253                                    LPCSTR pszWorkingDir,
00254                                    LPCSTR pszCmd,
00255                                    LPCSTR pszParam,
00256                                    int iShowCmd)
00257 {
00258     ODS("CShellExt::DoGAKMenu1()\r\n");
00259
00260     MessageBox(hParent, "Menu item 1!", "Shell Extension Sample", MB_OK);
00261
00262     return NOERROR;
00263 }
00264
00265 STDMETHODIMP CShellExt::DoGAKMenu2(HWND hParent,
00266                                    LPCSTR pszWorkingDir,
00267                                    LPCSTR pszCmd,
00268                                    LPCSTR pszParam,
00269                                    int iShowCmd)
00270 {
00271     ODS("CShellExt::DoGAKMenu2()\r\n");
00272
00273     MessageBox(hParent, "Menu item 2!", "Shell Extension Sample", MB_OK);
00274
00275     return NOERROR;
00276 }
00277
00278 STDMETHODIMP CShellExt::DoGAKMenu3(HWND hParent,
00279                                    LPCSTR pszWorkingDir,
00280                                    LPCSTR pszCmd,
00281                                    LPCSTR pszParam,
00282                                    int iShowCmd)
00283 {
00284     ODS("CShellExt::DoGAKMenu3()\r\n");
00285
00286     MessageBox(hParent, "Menu item 3!", "Shell Extension Sample", MB_OK);
00287
00288     return NOERROR;
00289 }
00290
00291 STDMETHODIMP CShellExt::DoGAKMenu4(HWND hParent,
00292                                    LPCSTR pszWorkingDir,
00293                                    LPCSTR pszCmd,
00294                                    LPCSTR pszParam,
00295                                    int iShowCmd)
00296 {
00297     ODS("CShellExt::DoGAKMenu4()\r\n");
00298
00299     MessageBox(hParent, "Menu item 4!", "Shell Extension Sample", MB_OK);
00300
00301     return NOERROR;
00302 }
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ConnectModeEnum Member List

This is the complete list of members for msado15::ConnectModeEnum, including all inherited members.
adModeRead | msado15::ConnectModeEnum | [static]
adModeReadWrite | msado15::ConnectModeEnum | [static]
adModeRecursive | msado15::ConnectModeEnum | [static]
adModeShareDenyNone | msado15::ConnectModeEnum | [static]
adModeShareDenyRead | msado15::ConnectModeEnum | [static]
adModeShareDenyWrite | msado15::ConnectModeEnum | [static]
adModeShareExclusive | msado15::ConnectModeEnum | [static]
adModeUnknown | msado15::ConnectModeEnum | [static]
adModeWrite | msado15::ConnectModeEnum | [static]
adoModeRead | msado15::ConnectModeEnum | [static]
adoModeReadWrite | msado15::ConnectModeEnum | [static]
adoModeRecursive | msado15::ConnectModeEnum | [static]
adoModeShareDenyRead | msado15::ConnectModeEnum | [static]
adoModeShareDenyWrite | msado15::ConnectModeEnum | [static]
adoModeShareExclusive | msado15::ConnectModeEnum | [static]
adoModeShareNone | msado15::ConnectModeEnum | [static]
adoModeUnknown | msado15::ConnectModeEnum | [static]
adoModeWrite | msado15::ConnectModeEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllSkel/DllSkel.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllSkel

DllSkel.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DLLSKEL.CPP
00003
00004   Summary:   Implementation file for the general DLL skeleton
00005              that can be used as a point of departure for more complex
00006              COM Win32 DLLs.  It is used as a skeletal base for
00007              the COM Tutorial series of code samples.
00008
00009              DLLSKEL.CPP contains the DllMain entry function for the DLL.
00010              As a simple skeleton, this DLL contains only two
00011              representative exported function calls: DllHelloBox and
00012              DllAboutBox.
00013
00014              For a comprehensive tutorial code tour of DLLSKEL's
00015              contents and offerings see the tutorial DLLSKEL.HTM file.
00016              For more specific technical details on the internal workings
00017              see the comments dispersed throughout the DLLSKEL source code.
00018
00019   Classes:   none.
00020
00021   Functions: DllMain, DllHelloBox, DllAboutBox
00022
00023   Origin:    12-9-96: atrent - Created and revised via editor-inheritance
00024                of DLLSKEL.C in the Win32 SDK FRMWORK code samples.
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 /*---------------------------------------------------------------------------
00042   We include WINDOWS.H for all Win32 applications.
00043   We include OLE2.H because we will be calling the COM/OLE Libraries
00044     in future exploitation of this DLL skeleton.
00045   We include APPUTIL.H because we will be building this DLL using
00046     the convenient Virtual Window and Dialog classes and other
00047     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00048   We include DLLSKELI.H because it has internal class declarations and
00049     resource ID definitions specific for this DLL.
00050   We include DLLSKEL.H because it has the necessary STDENTRY function
00051     prototypes.  The _DLLEXPORT_ #define is used to tell DLLSKEL.H to
00052     define the appropriate functions as exported from this DLL.
00053     Otherwise, DLLSKEL.H is included by users of this DLL who do not
00054     define _DLLEXPORT_ so that the appropriate functions are then
00055     declared as imports rather than defined as exports.
00056 ---------------------------------------------------------------------------*/
00057 #include <windows.h>
00058 #include <ole2.h>
00059 #include <apputil.h>
00060 #include "dllskeli.h"
00061 #define _DLLEXPORT_
00062 #include "dllskel.h"
00063
00064
00065 // Global variable definitions. Some Initialized in DllMain() below.
00066
00067 // We define a static global variable to point to file-mapped shared memory.
00068 // This memory is shared by all loaded instances of this DLL.
00069 static void* g_pvShared = NULL;
00070 // Handle to file mapping object.
00071 static HANDLE g_hMapObj = NULL;
00072
00073 // We encapsulate some of the global instance data for clarity.  Here is a
00074 // pointer to the DllData object.
00075 CDllData* g_pDll;
00076
00077
00078 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00079   Function: UnicodeOk
00080
00081   Summary:  Checks if the platform will handle unicode versions of
00082             Win32 string API calls.
00083
00084   Args:     void
00085
00086   Returns:  BOOL
00087               TRUE if unicode support; FALSE if not.
00088 ------------------------------------------------------------------------F-F*/
00089 BOOL UnicodeOk(void)
00090 {
00091   BOOL bOk = TRUE;
00092   TCHAR szUserName[MAX_STRING_LENGTH];
00093   DWORD dwSize = MAX_STRING_LENGTH;
00094
00095   if (!GetUserName(szUserName, &dwSize))
00096     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00097
00098   return bOk;
00099 }
00100
00101
00102 #if defined(UNICODE)
00103 #define DLLSKELSHARED_STR L"DLLSkelShared"
00104 #else
00105 #define DLLSKELSHARED_STR "DLLSkelShared"
00106 #endif
00107
00108
00109 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00110   Function: DllMain
00111
00112   Summary:  Like WinMain is for an EXE application, this DllMain function
00113             is the main entry point for this DLL.  It is called when the
00114             DLL is loaded by a process, and when new threads are created
00115             by a process that has already loaded this DLL.  DllMain is also
00116             called when threads of a process that has loaded the DLL exit
00117             cleanly and when the process itself unloads the DLL.
00118
00119             If you want to use C runtime libraries, keep this function
00120             named "DllMain" and you won't have to do anything special to
00121             initialize the runtime libraries.
00122
00123             When fdwReason == DLL_PROCESS_ATTACH, the return value is used
00124             to determine if the DLL should remain loaded, or should be
00125             immediately unloaded depending upon whether the DLL could be
00126             initialized properly.  For all other values of fdwReason,
00127             the return value is ignored.
00128
00129   Args:     HINSTANCE hDllInst,
00130               Instance handle of the DLL.
00131             DWORD fdwReason,
00132               Process attach/detach or thread attach/detach.
00133               Reason for calling.
00134             LPVOID lpvReserved)
00135               Reserved and not used.
00136
00137   Returns:  BOOL,
00138               Return value is used only when fdwReason == DLL_PROCESS_ATTACH.
00139               TRUE  -  Used to signify that the DLL should remain loaded.
00140               FALSE -  Used to signify that the DLL should be
00141                 immediately unloaded.
00142 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00143 BOOL WINAPI DllMain(
00144               HINSTANCE hDllInst,
00145               DWORD fdwReason,
00146               LPVOID lpvReserved)
00147 {
00148   BOOL bResult = TRUE;
00149
00150   // Dispatch this call based on the reason it was called.
00151   switch (fdwReason)
00152   {
00153     case DLL_PROCESS_ATTACH:
00154       // The DLL is being loaded for the first time by a given process.
00155       // Perform per-process initialization here.  If the initialization
00156       // is successful, return TRUE; if unsuccessful, return FALSE.
00157       bResult = FALSE;
00158       if (UnicodeOk())
00159       {
00160         // Instantiate a DLL global data encapsulator class.
00161         g_pDll = new CDllData;
00162         if (NULL != g_pDll)
00163         {
00164           // Remember the DLL Instance handle.
00165           g_pDll->hDllInst = hDllInst;
00166           // Create a MsgBox object.
00167           g_pDll->pMsgBox = new CMsgBox;
00168           if (NULL != g_pDll->pMsgBox)
00169           {
00170             BOOL fFirst;
00171             int iSharedSize = sizeof(CDllShared);
00172
00173             // Create a named file mapping object.
00174             g_hMapObj = CreateFileMapping(
00175                           (HANDLE) 0xFFFFFFFF,     // Use paging file
00176                           NULL,                    // No security attributes
00177                           PAGE_READWRITE,          // Read/Write access
00178                           0,                       // Mem Size: high 32 bits
00179                           iSharedSize,             // Mem Size: low 32 bits
00180                           DLLSKELSHARED_STR);      // Name of map object
00181             if (NULL != g_hMapObj)
00182             {
00183               // Determine if this is the first create of the file mapping.
00184               fFirst = (ERROR_ALREADY_EXISTS != GetLastError());
00185
00186               // Now get a pointer to the file-mapped shared memory.
00187               g_pvShared = MapViewOfFile(
00188                              g_hMapObj,        // File Map obj to view
00189                              FILE_MAP_WRITE,   // Read/Write access
00190                              0,                // high: map from beginning
00191                              0,                // low:
00192                              0);               // default: map entire file
00193               if (NULL != g_pvShared)
00194               {
00195                 CDllShared* pShared = (CDllShared*) g_pvShared;
00196
00197                 if (fFirst)
00198                 {
00199                   // If this is the first attaching process, init the
00200                   // shared memory.
00201                   memset(g_pvShared, 0, iSharedSize);
00202                   pShared->iUserCount = 1;
00203                 }
00204                 else
00205                 {
00206                   // Increment the cummulative global count of all
00207                   // attached processes (ie, the count of DLL users).
00208                   InterlockedIncrement((LONG*) &pShared->iUserCount);
00209                 }
00210                 // Save a local instance copy of this user instance
00211                 // count. Each user process has its own g_pDll instance
00212                 // data and can thus remember it's user instance count.
00213                 g_pDll->iUserCount = pShared->iUserCount;
00214                 bResult = TRUE;
00215               }
00216             }
00217           }
00218         }
00219       }
00220       break;
00221
00222     case DLL_PROCESS_DETACH:
00223       // The DLL is being unloaded by a given process.  Do any
00224       // per-process clean up here, such as undoing what was done in
00225       // DLL_PROCESS_ATTACH.  The return value is ignored.
00226       // Unmap any shared memory from the process's address space.
00227       UnmapViewOfFile(g_pvShared);
00228       // Close the process's handle to the file-mapping object.
00229       CloseHandle(g_hMapObj);
00230       if (NULL != g_pDll)
00231       {
00232         // Delete the message box and global DLL instance data.
00233         DELETE_POINTER(g_pDll->pMsgBox);
00234         DELETE_POINTER(g_pDll);
00235       }
00236       break;
00237
00238     case DLL_THREAD_ATTACH:
00239       // A thread is being created in a process that has already loaded
00240       // this DLL.  Perform any per-thread initialization here.  The
00241       // return value is ignored.
00242       break;
00243
00244     case DLL_THREAD_DETACH:
00245       // A thread is exiting cleanly in a process that has already
00246       // loaded this DLL.  Perform any per-thread clean up here.  The
00247       // return value is ignored.
00248       break;
00249
00250     default:
00251       break;
00252   }
00253
00254   return (bResult);
00255 }
00256
00257
00258 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00259   Function: DllHelloBox
00260
00261   Summary:  One of the exported service functions of this DLL.  In this
00262             simple code sample, DllHelloBox uses a special
00263             InterlockedIncrement Win32 function call to provide mutually
00264             exclusive access to incrementing a global count of the number
00265             of times this function was called.  A message box is shown to
00266             display the instance handle of this DLL and the number of
00267             times this DllHelloBox has been called.  See DLLSKEL.HTM for
00268             more details.
00269
00270   Args:     HWND hWnd)
00271               Handle of the window that is to be parent of message box.
00272
00273   Returns:  BOOL,
00274               Always returns TRUE.
00275 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00276 STDENTRY_(BOOL) DllHelloBox(
00277                   HWND hWnd)
00278 {
00279   int iHelloCount;
00280   CDllShared* pShared = (CDllShared*) g_pvShared;
00281
00282   // Increment the cummulative global count of all Hellos.
00283   InterlockedIncrement((LONG*) &pShared->iHelloCount);
00284   iHelloCount = pShared->iHelloCount;
00285
00286   // Now show the user a -Notice- message box and load the display strings
00287   // out of this DLL's resources.  Use the format string to show the
00288   // user instance count of this loaded DLL and the shared hello count.
00289   g_pDll->pMsgBox->Init(g_pDll->hDllInst, hWnd);
00290   g_pDll->pMsgBox->NoteFmtID(
00291             IDS_HELLOCOUNTFMT,
00292             g_pDll->iUserCount,
00293             iHelloCount);
00294
00295   return TRUE;
00296 }
00297
00298
00299 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00300   Function: DllAboutBox
00301
00302   Summary:  One of the exported service functions of this DLL.  In this
00303             simple code sample, DllAboutBox showcases use of the
00304             CAboutBox class (from the APPUTIL utility library).  It also
00305             illustrates how to implement this dialog using resources
00306             stored in this DLL itself.  See DLLSKEL.HTM for details on
00307             how this DLLSKEL.DLL is exploited by the DLLUSER.EXE
00308             application.
00309
00310   Args:     HWND hWnd)
00311               Handle of window that is to be parent of the dialog window.
00312
00313   Returns:  BOOL,
00314               Always returns TRUE.
00315 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00316 STDENTRY_(BOOL) DllAboutBox(
00317                   HWND hWnd)
00318 {
00319   // Define one of those nifty APPUTIL CAboutBox modal dialog objects.
00320   CAboutBox dlgAboutBox;
00321
00322   // Show the standard About Box dialog for this DLL by telling the dialog
00323   // C++ object to show itself by invoking its ShowDialog method.
00324   // Pass it this DLL instance and the parent window handle.  Use a dialog
00325   // resource ID for the dialog stored in this DLL module's resources.
00326   dlgAboutBox.ShowDialog(
00327     g_pDll->hDllInst,
00328     MAKEINTRESOURCE(IDD_ABOUTBOX),
00329     hWnd);
00330
00331   return TRUE;
00332 }
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_Printer Member List

This is the complete list of members for _Printer, including all inherited members.
cJobs | _Printer
dwStatus | _Printer
hPrinter | _Printer
pszPrinterName | _Printer
pszServerName | _Printer
pszShareName | _Printer
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/dataobj.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

dataobj.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "DataObj.h"
00016 //#include "Guids.h"     //BUGLIST
00017 #include "StaticNode.h"
00018
00019                              // Tracing stuff
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("CDataObject")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Construction/Destruction
00027
00028
00029 CDataObject::CDataObject()
00030 {
00031   m_cRef     = 0;
00032   m_uCookie  = 0;
00033   m_uContext = 0;
00034
00035 }
00036
00037 CDataObject::~CDataObject()
00038 {
00039 }
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // IUnknown implementation
00043
00044 //---------------------------------------------------------------------------
00045 STDMETHODIMP CDataObject::QueryInterface
00046 (
00047   REFIID   riid,
00048   LPVOID*  ppv
00049 )
00050 {
00051   if( !ppv )
00052     return E_FAIL;
00053
00054   HRESULT hResult = E_NOINTERFACE;
00055   *ppv = NULL;
00056
00057   if( IsEqualIID(riid, IID_IUnknown) )
00058     *ppv = static_cast<IDataObject*>(this);
00059   else if( IsEqualIID(riid, IID_IDataObject) )
00060     *ppv = static_cast<IDataObject*>(this);
00061
00062   if( *ppv )
00063   {
00064     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00065     hResult = S_OK;
00066   }
00067
00068   return hResult;
00069 }
00070
00071 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00072 {
00073     return InterlockedIncrement((LONG*)&m_cRef);
00074 }
00075
00076 STDMETHODIMP_(ULONG) CDataObject::Release()
00077 {
00078     if (InterlockedDecrement((LONG*)&m_cRef) == 0)
00079     {
00080         delete this;
00081         return 0;
00082     }
00083     return m_cRef;
00084
00085 }
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 // IDataObject implementation
00089 //
00090
00091 //---------------------------------------------------------------------------
00092 //  MMC will call GetDataHere() for it's required clipboard formats
00093 //
00094 HRESULT CDataObject::GetDataHere
00095 (
00096   FORMATETC *pFormatEtc,     //[in]  Pointer to the FORMATETC structure
00097   STGMEDIUM *pMedium         //[out] Pointer to the STGMEDIUM structure
00098 )
00099 {
00100   const CLIPFORMAT cf = pFormatEtc->cfFormat;
00101   IStream* ipStream = NULL;
00102
00103   HRESULT hResult = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &ipStream );
00104   if( S_OK != hResult )
00105     return hResult;                        // Minimal error checking
00106
00107   hResult = DV_E_FORMATETC;                // Unknown format
00108
00109   if( cf == g_cfDisplayName )
00110   {
00111     hResult = RetrieveDisplayString( ipStream );
00112   }
00113   else if( cf == g_cfSnapinClsid )
00114   {
00115     hResult = RetrieveSnapInClassID( ipStream );
00116   }
00117   else if( cf == g_cfNodeType )
00118   {
00119     hResult = RetrieveNodeTypeGuid( ipStream );
00120   }
00121   else if( cf == g_cfszNodeType )
00122   {
00123     hResult = RetrieveGuidString( ipStream );
00124   }
00125   else if( cf == g_cfBaseNodePtr )
00126   {
00127     hResult = RetrieveBaseNodePtr( ipStream );
00128   }
00129   else if( cf == g_cfDataObjPtr )
00130   {
00131     hResult = RetrieveDataObjPtr( ipStream );
00132   }
00133
00134   ipStream->Release();
00135
00136   return hResult;
00137 }
00138
00139 //---------------------------------------------------------------------------
00140 VOID CDataObject::SetPrivateData
00141 (
00142   ULONG  uCookie,      //[in] Pointer to node this object represents
00143   ULONG  uContext      //[in] Context of the node
00144 )
00145 {
00146   m_uCookie  = uCookie;
00147   m_uContext = uContext;
00148 }
00149
00150 /////////////////////////////////////////////////////////////////////////////
00151 //  Handlers for MMC's required clipboard formats
00152
00153
00154 //---------------------------------------------------------------------------
00155 // CCF_DISPLAY_NAME is one of the required clipformats.
00156 // MMC askes for this string to display the name of the SnapIn's StaticNode
00157 // in the ScopePane
00158 //
00159 HRESULT CDataObject::RetrieveDisplayString
00160 (
00161   IStream* ipStream        //[in][out] Stream to return our data in.
00162 )
00163 {
00164   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00165   LPWSTR pNodeName = pNode->GetNodeName();
00166
00167   ULONG ulSizeofName = (wcslen(pNodeName) + 1) * sizeof(WCHAR);
00168   return ipStream->Write(pNodeName, ulSizeofName, NULL);
00169
00170 }
00171
00172 //---------------------------------------------------------------------------
00173 //  CCF_SNAPIN_CLASSID is one of the required clipformats.
00174 //  MMC will ask for this data.  This ClassID which we return represents
00175 //  the COM object which is the entry point for our SnapIn
00176 //
00177 HRESULT CDataObject::RetrieveSnapInClassID
00178 (
00179   IStream* ipStream        //[in][out] Stream to return our data in.
00180 )
00181 {
00182   return ipStream->Write( &CLSID_CComponentData, sizeof(GUID), NULL );
00183 }
00184
00185
00186 //---------------------------------------------------------------------------
00187 //  CCF_NODETYPE is one of the required clipformats.
00188 //  MMC needs the NodeType GUID to determine what extensions to activate
00189 //  for a node.  It looks under the MMC/NodeTypes registry key for the GUID
00190 //  and enumerates the extensions found beneath it.  MMC uses this GUID
00191 //  strictly as a uniquie identifier.  It does not expect it to correspond
00192 //  to the ClaseID of a com object.
00193 //
00194 HRESULT CDataObject::RetrieveNodeTypeGuid
00195 (
00196   IStream* ipStream        //[in][out] Stream to return our data in.
00197 )
00198 {
00199   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00200   GUID* pGuid = (GUID*)&pNode->GetNodeGUID();
00201
00202   return ipStream->Write( (void*)pGuid, sizeof(GUID), NULL );
00203 }
00204
00205
00206 //---------------------------------------------------------------------------
00207 //  CCF_SZNODETYPE is a required clipboard format.
00208 //  We return the node's GUID as a wide string.
00209 //
00210 HRESULT CDataObject::RetrieveGuidString
00211 (
00212   IStream* ipStream        //[in][out] Stream to return our data in.
00213 )
00214 {
00215   LPOLESTR pszGUID;
00216   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00217
00218   HRESULT  hResult = StringFromCLSID( pNode->GetNodeGUID(), &pszGUID );
00219   if( S_OK == hResult )
00220   {
00221     hResult = ipStream->Write( pszGUID, (wcslen(pszGUID) + 1) * sizeof(WCHAR), NULL );
00222     CoTaskMemFree( pszGUID );
00223   }
00224
00225   return hResult;
00226 }
00227
00228 //---------------------------------------------------------------------------
00229 HRESULT CDataObject::RetrieveBaseNodePtr
00230 (
00231   IStream* ipStream        //[in][out] Stream to return our data in.
00232 )
00233 {
00234   LPBASENODE pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00235   return ipStream->Write( &pNode, sizeof(LPBASENODE), NULL );
00236 }
00237
00238 //---------------------------------------------------------------------------
00239 HRESULT CDataObject::RetrieveDataObjPtr
00240 (
00241   IStream* ipStream        //[in][out] Stream to return our data in.
00242 )
00243 {
00244   CDataObject* pThis = this;
00245   return ipStream->Write( &pThis, sizeof(CDataObject*), NULL );
00246 }
00247
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/CopyRecordOptionsEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

CopyRecordOptionsEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: CopyRecordOptionsEnum
00019
00020 public class CopyRecordOptionsEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adCopyOverWrite = 1;
00023   public static final short adCopyAllowEmulation = 4;
00024   public static final short adCopyNonRecursive = 2;
00025 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Fields20.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Fields20.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface Fields20
00019 /** @com.interface(iid=0000054D-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface Fields20 extends msado15.Fields15
00021 {
00022   /** @com.method(vtoffset=4, dispid=1610743808, type=PROPGET, name="Count", name2="getCount", addFlagsVtable=4)
00023       @com.parameters([type=I4] return) */
00024   public int getCount();
00025
00026   /** @com.method(vtoffset=5, dispid=4294967292, type=METHOD, name="_NewEnum", addFlagsVtable=4)
00027       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00028   public IUnknown _NewEnum();
00029
00030   /** @com.method(vtoffset=6, dispid=1610743810, type=METHOD, name="Refresh", addFlagsVtable=4)
00031       @com.parameters() */
00032   public void Refresh();
00033
00034   /** @com.method(vtoffset=7, dispid=0, type=PROPGET, name="Item", name2="getItem", addFlagsVtable=4)
00035       @com.parameters([in,type=VARIANT] Index, [iid=0000054C-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00036   public msado15.Field getItem(Variant Index);
00037
00038   /** @com.method(vtoffset=8, dispid=1610874880, type=METHOD, name="_Append", addFlagsVtable=4)
00039       @com.parameters([in,type=STRING] Name, [in,type=I4] Type, [in,type=I4] DefinedSize, [in,type=I4] Attrib) */
00040   public void _Append(String Name, int Type, int DefinedSize, int Attrib);
00041
00042   /** @com.method(vtoffset=9, dispid=1610874881, type=METHOD, name="Delete", addFlagsVtable=4)
00043       @com.parameters([in,type=VARIANT] Index) */
00044   public void Delete(Variant Index);
00045
00046
00047   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x54d, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00048 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDog Member List

This is the complete list of members for CDog, including all inherited members.
Bark() | CDog |
CDog() | CDog | [inline]
m_cRef | CDog | [private]
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CDog |
Scratch() | CDog |
STDMETHOD_(ULONG, AddRef)(void) | CDog |
STDMETHOD_(ULONG, Release)(void) | CDog |
~CDog() | CDog | [inline]
Generated on Wed Nov 13 2024 16:56:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/people.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "People.h"
00021
00022 #include <initguid.h>
00023 // for vb component
00024 //#include "vb\mmcsample.h"
00025
00026 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00027 const GUID CPerson::thisGuid = { 0xd41ef043, 0x8bc5, 0x11d2, { 0x8a, 0xb, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00028
00029 //==============================================================
00030 //
00031 // CPeoplePoweredVehicle implementation
00032 //
00033 //
00034 CPeoplePoweredVehicle::CPeoplePoweredVehicle(CComponentData *pComponentData)
00035 {
00036     m_pComponentData = pComponentData;
00037
00038     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00039         children[n] = new CPerson(n, pComponentData);
00040         children[n]->Initialize(_T("Fred"), 6, 2, 115, n % 2 == 0 ? TRUE : FALSE);
00041     }
00042 }
00043
00044 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00045 {
00046     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00047         if (children[n]) {
00048             delete children[n];
00049         }
00050 }
00051
00052 HRESULT CPeoplePoweredVehicle::Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00053 {
00054     SCOPEDATAITEM sdi;
00055
00056     if (!bExpanded) {
00057         // create the child nodes, then expand them
00058         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00059             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00060             sdi.mask = SDI_STR       |   // Displayname is valid
00061                 SDI_PARAM     |   // lParam is valid
00062                 SDI_IMAGE     |   // nImage is valid
00063                 SDI_OPENIMAGE |   // nOpenImage is valid
00064                 SDI_PARENT    |
00065                 SDI_CHILDREN;
00066
00067             sdi.relativeID  = (HSCOPEITEM)parent;
00068             sdi.nImage      = children[n]->GetBitmapIndex();
00069             sdi.nOpenImage  = children[n]->GetBitmapIndex();
00070             sdi.displayname = MMC_CALLBACK;
00071             sdi.lParam      = (LPARAM)children[n];       // The cookie
00072             sdi.cChildren   = 0;
00073
00074             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00075
00076             _ASSERT( SUCCEEDED(hr) );
00077         }
00078     }
00079
00080     return S_OK;
00081 }
00082
00083 //==============================================================
00084 //
00085 // CPeopleVehicle::CPerson implementation
00086 //
00087 //
00088 CPerson::CPerson(int id, CComponentData *pComponentData)
00089 : m_id(id)
00090 {
00091     m_pComponentData = pComponentData;
00092
00093     m_pUnknown = NULL;
00094     szName     = NULL;
00095     lSpeed     = 0;
00096     lHeight    = 0;
00097     lWeight    = 0;
00098     fAnimating = FALSE;
00099 }
00100
00101 CPerson::~CPerson()
00102 {
00103     if (szName)
00104         delete [] szName;
00105
00106     if (m_pUnknown)
00107         m_pUnknown->Release();
00108 }
00109
00110 void CPerson::Initialize(_TCHAR *szName, LONG lSpeed, LONG lHeight, LONG lWeight, BOOL fAnimating)
00111 {
00112     if (szName) {
00113         this->szName = new _TCHAR[_tcslen(szName) + 20];
00114         _tcscpy(this->szName, szName);
00115         _tcscat(this->szName, _T(" "));
00116
00117         if (m_id % 2)
00118             _tcscat(this->szName, _T("(new control)"));
00119         else
00120             _tcscat(this->szName, _T("(share control)"));
00121     }
00122
00123     this->lSpeed = lSpeed;
00124     this->lHeight = lHeight;
00125     this->lWeight = lWeight;
00126     this->fAnimating = fAnimating;
00127
00128     return;
00129 }
00130
00131 const _TCHAR *CPerson::GetDisplayName(int nCol)
00132 {
00133     static _TCHAR buf[128];
00134
00135     switch (nCol) {
00136     case 0:
00137         _tcscpy(buf, szName ? szName : _T(""));
00138         break;
00139
00140     case 1:
00141         _stprintf(buf, _T("%ld m/s"), lSpeed);
00142         break;
00143
00144     case 2:
00145         _stprintf(buf, _T("%ld meters"), lHeight);
00146         break;
00147
00148     case 3:
00149         _stprintf(buf, _T("%ld kilos"), lWeight);
00150         break;
00151     }
00152     return buf;
00153 }
00154
00155 HRESULT CPerson::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00156 {
00157     // for vb component
00158     // LPOLESTR lpOleStr;
00159     // HRESULT hr = StringFromCLSID(CLSID_VBComponent, &lpOleStr);
00160     // *ppViewType = lpOleStr;
00161
00162     // for atl component
00163     LPOLESTR lpOleStr = L"{9A12FB62-C754-11D2-952C-00C04FB92EC2}";
00164     *ppViewType = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(lpOleStr) + 1) * sizeof(WCHAR)));
00165     wcscpy(*ppViewType, lpOleStr);
00166
00167     if (m_id % 2) {
00168         // create new control
00169         *pViewOptions = MMC_VIEW_OPTIONS_CREATENEW;
00170     } else {
00171         // share control
00172         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00173     }
00174
00175     return S_OK;
00176 }
00177
00178 HRESULT CPerson::ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile)
00179 {
00180     HRESULT hr = S_OK;
00181
00182     IUnknown *pUnk = NULL;
00183     if (SUCCEEDED(hr = pConsole->QueryResultView(&pUnk))) {
00184         IDispatch *pDispatch = NULL;
00185
00186         if (SUCCEEDED(hr = pUnk->QueryInterface(IID_IDispatch, (void **)&pDispatch))) {
00187             DISPID dispID;
00188             DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
00189             EXCEPINFO exInfo;
00190             OLECHAR *pszName = L"DoHelp";
00191             UINT uErr;
00192
00193             hr = pDispatch->GetIDsOfNames(IID_NULL, &pszName, 1, LOCALE_SYSTEM_DEFAULT, &dispID);
00194
00195             if (SUCCEEDED(hr)) {
00196                 hr = pDispatch->Invoke(
00197                     dispID,
00198                     IID_NULL,
00199                     LOCALE_USER_DEFAULT,
00200                     DISPATCH_METHOD,
00201                     &dispparamsNoArgs, NULL, &exInfo, &uErr);
00202             }
00203
00204             pDispatch->Release();
00205         }
00206
00207         pUnk->Release();
00208     }
00209
00210     _ASSERT(SUCCEEDED(hr));
00211
00212     return hr;
00213 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/ICatalogObject.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

ICatalogObject.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface ICatalogObject
00019 /** @com.interface(iid=6EB22871-8A19-11D0-81B6-00A0C9231C29, thread=AUTO, type=DUAL) */
00020 public interface ICatalogObject extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPGET, name="Value", addFlagsVtable=4)
00023       @com.parameters([in,type=STRING] bstrPropName, [type=VARIANT] return) */
00024   public Variant getValue(String bstrPropName);
00025
00026   /** @com.method(vtoffset=5, dispid=1, type=PROPPUT, name="Value", addFlagsVtable=4)
00027       @com.parameters([in,type=STRING] bstrPropName, [in,type=VARIANT] retval) */
00028   public void setValue(String bstrPropName, Variant retval);
00029
00030   /** @com.method(vtoffset=6, dispid=2, type=PROPGET, name="Key", addFlagsVtable=4)
00031       @com.parameters([type=VARIANT] return) */
00032   public Variant getKey();
00033
00034   /** @com.method(vtoffset=7, dispid=3, type=PROPGET, name="Name", addFlagsVtable=4)
00035       @com.parameters([type=VARIANT] return) */
00036   public Variant getName();
00037
00038   /** @com.method(vtoffset=8, dispid=4, type=METHOD, name="IsPropertyReadOnly", addFlagsVtable=4)
00039       @com.parameters([in,type=STRING] bstrPropName, [type=BOOLEAN] return) */
00040   public boolean IsPropertyReadOnly(String bstrPropName);
00041
00042   /** @com.method(vtoffset=9, dispid=5, type=PROPGET, name="Valid", addFlagsVtable=4)
00043       @com.parameters([type=BOOLEAN] return) */
00044   public boolean getValid();
00045
00046   /** @com.method(vtoffset=10, dispid=6, type=METHOD, name="IsPropertyWriteOnly", addFlagsVtable=4)
00047       @com.parameters([in,type=STRING] bstrPropName, [type=BOOLEAN] return) */
00048   public boolean IsPropertyWriteOnly(String bstrPropName);
00049
00050
00051   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x6eb22871, (short)0x8a19, (short)0x11d0, (byte)0x81, (byte)0xb6, (byte)0x0, (byte)0xa0, (byte)0xc9, (byte)0x23, (byte)0x1c, (byte)0x29);
00052 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/Handlers.Cpp Source File

  • NetDS
  • WinSock
  • Dt_Dll

Handlers.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c) 1995 Intel Corp
00004
00005   Module Name:
00006
00007     handlers.cpp
00008
00009   Abstract:
00010
00011     Contains handler functions for each possible API or SPI hook.
00012
00013 --*/
00014
00015 #include "nowarn.h"  /* turn off benign warnings */
00016 #ifndef _WINSOCKAPI_
00017 #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
00018 #endif
00019
00020 #include <windows.h>
00021 #include "nowarn.h"  /* some warnings may have been turned back on */
00022 #include <winsock2.h>
00023 #include <ws2spi.h>
00024
00025 #include <stdio.h>
00026 #include <stdlib.h>
00027
00028 #include "handlers.h"
00029 #include "dt_dll.h"
00030 #include "dt.h"
00031
00032 // turn off unreferenced local variable warning
00033 #pragma warning(disable: 4100 4189)
00034
00035
00036
00037 //
00038 // Function Definitions
00039 //
00040
00041
00042 BOOL
00043 DTHandlerInit(
00044     OUT LPLPFNDTHANDLER HandlerFuncTable,
00045     int                    NumEntries)
00046 /*++
00047
00048   Function Description:
00049
00050       Fills in the given HandlerFuncTable with pointers to all the
00051       appropriate handler functions, based on notification code.
00052
00053   Arguments:
00054
00055       HandlerFuncTable -- an uninitialized array of pointers of type
00056       LPFNDTHANDLER, which point to handler functions (see handlers.h)
00057
00058       NumEntries -- the number of entries in the array.  Currently
00059       only used to zero out the array.
00060
00061   Return Value:
00062
00063       Always returns TRUE.
00064
00065 --*/
00066 {
00067     memset((char *)HandlerFuncTable, 0, NumEntries * sizeof(LPFNDTHANDLER));
00068
00069     HandlerFuncTable[DTCODE_accept] = DTHandler_accept;
00070     HandlerFuncTable[DTCODE_bind] = DTHandler_bind;
00071     HandlerFuncTable[DTCODE_closesocket] = DTHandler_closesocket;
00072     HandlerFuncTable[DTCODE_connect] = DTHandler_connect;
00073     HandlerFuncTable[DTCODE_getpeername] = DTHandler_getpeername;
00074     HandlerFuncTable[DTCODE_getsockname] = DTHandler_getsockname;
00075     HandlerFuncTable[DTCODE_getsockopt] = DTHandler_getsockopt;
00076     HandlerFuncTable[DTCODE_htonl] = DTHandler_htonl;
00077     HandlerFuncTable[DTCODE_htons] = DTHandler_htons;
00078     HandlerFuncTable[DTCODE_ioctlsocket] = DTHandler_ioctlsocket;
00079     HandlerFuncTable[DTCODE_listen] = DTHandler_listen;
00080     HandlerFuncTable[DTCODE_ntohl] = DTHandler_ntohl;
00081     HandlerFuncTable[DTCODE_ntohs] = DTHandler_ntohs;
00082     HandlerFuncTable[DTCODE_recv] = DTHandler_recv;
00083     HandlerFuncTable[DTCODE_recvfrom] = DTHandler_recvfrom;
00084     HandlerFuncTable[DTCODE_select] = DTHandler_select;
00085     HandlerFuncTable[DTCODE_send] = DTHandler_send;
00086     HandlerFuncTable[DTCODE_sendto] = DTHandler_sendto;
00087     HandlerFuncTable[DTCODE_setsockopt] = DTHandler_setsockopt;
00088     HandlerFuncTable[DTCODE_shutdown] = DTHandler_shutdown;
00089     HandlerFuncTable[DTCODE_socket] = DTHandler_socket;
00090     HandlerFuncTable[DTCODE_WSAAccept] = DTHandler_WSAAccept;
00091     HandlerFuncTable[DTCODE_WSAAsyncSelect] = DTHandler_WSAAsyncSelect;
00092     HandlerFuncTable[DTCODE_WSACancelBlockingCall] =
00093       DTHandler_WSACancelBlockingCall;
00094     HandlerFuncTable[DTCODE_WSACleanup] = DTHandler_WSACleanup;
00095     HandlerFuncTable[DTCODE_WSACloseEvent] = DTHandler_WSACloseEvent;
00096     HandlerFuncTable[DTCODE_WSAConnect] = DTHandler_WSAConnect;
00097     HandlerFuncTable[DTCODE_WSACreateEvent] = DTHandler_WSACreateEvent;
00098     HandlerFuncTable[DTCODE_WSADuplicateSocketA] =
00099       DTHandler_WSADuplicateSocketA;
00100     HandlerFuncTable[DTCODE_WSADuplicateSocketW] =
00101       DTHandler_WSADuplicateSocketW;
00102     HandlerFuncTable[DTCODE_WSAEnumNetworkEvents] =
00103       DTHandler_WSAEnumNetworkEvents;
00104     HandlerFuncTable[DTCODE_WSAEnumProtocolsA] = DTHandler_WSAEnumProtocolsA;
00105     HandlerFuncTable[DTCODE_WSAEnumProtocolsW] = DTHandler_WSAEnumProtocolsW;
00106     HandlerFuncTable[DTCODE_WSAEventSelect] = DTHandler_WSAEventSelect;
00107     HandlerFuncTable[DTCODE_WSAGetLastError] = DTHandler_WSAGetLastError;
00108     HandlerFuncTable[DTCODE_WSAGetOverlappedResult] =
00109       DTHandler_WSAGetOverlappedResult;
00110     HandlerFuncTable[DTCODE_WSAGetQOSByName] = DTHandler_WSAGetQOSByName;
00111     HandlerFuncTable[DTCODE_WSAHtonl] = DTHandler_WSAHtonl;
00112     HandlerFuncTable[DTCODE_WSAHtons] = DTHandler_WSAHtons;
00113     HandlerFuncTable[DTCODE_WSAIoctl] = DTHandler_WSAIoctl;
00114     HandlerFuncTable[DTCODE_WSAIsBlocking] = DTHandler_WSAIsBlocking;
00115     HandlerFuncTable[DTCODE_WSAJoinLeaf] = DTHandler_WSAJoinLeaf;
00116     HandlerFuncTable[DTCODE_WSANtohl] = DTHandler_WSANtohl;
00117     HandlerFuncTable[DTCODE_WSANtohs] = DTHandler_WSANtohs;
00118     HandlerFuncTable[DTCODE_WSARecv] = DTHandler_WSARecv;
00119     HandlerFuncTable[DTCODE_WSARecvDisconnect] =
00120       DTHandler_WSARecvDisconnect;
00121     HandlerFuncTable[DTCODE_WSARecvFrom] = DTHandler_WSARecvFrom;
00122     HandlerFuncTable[DTCODE_WSAResetEvent] = DTHandler_WSAResetEvent;
00123     HandlerFuncTable[DTCODE_WSASend] = DTHandler_WSASend;
00124     HandlerFuncTable[DTCODE_WSASendDisconnect] =
00125       DTHandler_WSASendDisconnect;
00126     HandlerFuncTable[DTCODE_WSASendTo] = DTHandler_WSASendTo;
00127     HandlerFuncTable[DTCODE_WSASetBlockingHook] =
00128       DTHandler_WSASetBlockingHook;
00129     HandlerFuncTable[DTCODE_WSASetEvent] = DTHandler_WSASetEvent;
00130     HandlerFuncTable[DTCODE_WSASetLastError] = DTHandler_WSASetLastError;
00131     HandlerFuncTable[DTCODE_WSASocketA] = DTHandler_WSASocketA;
00132     HandlerFuncTable[DTCODE_WSASocketW] = DTHandler_WSASocketW;
00133     HandlerFuncTable[DTCODE_WSAStartup] = DTHandler_WSAStartup;
00134     HandlerFuncTable[DTCODE_WSAUnhookBlockingHook] =
00135       DTHandler_WSAUnhookBlockingHook;
00136     HandlerFuncTable[DTCODE_WSAWaitForMultipleEvents] =
00137       DTHandler_WSAWaitForMultipleEvents;
00138     HandlerFuncTable[DTCODE_gethostbyaddr] = DTHandler_gethostbyaddr;
00139     HandlerFuncTable[DTCODE_gethostbyname] = DTHandler_gethostbyname;
00140     HandlerFuncTable[DTCODE_gethostname] = DTHandler_gethostname;
00141     HandlerFuncTable[DTCODE_getprotobyname] = DTHandler_getprotobyname;
00142     HandlerFuncTable[DTCODE_getprotobynumber] = DTHandler_getprotobynumber;
00143     HandlerFuncTable[DTCODE_getservbyname] = DTHandler_getservbyname;
00144     HandlerFuncTable[DTCODE_getservbyport] = DTHandler_getservbyport;
00145     HandlerFuncTable[DTCODE_inet_addr] = DTHandler_inet_addr;
00146     HandlerFuncTable[DTCODE_inet_ntoa] = DTHandler_inet_ntoa;
00147     HandlerFuncTable[DTCODE_WSAAsyncGetHostByAddr] =
00148       DTHandler_WSAAsyncGetHostByAddr;
00149     HandlerFuncTable[DTCODE_WSAAsyncGetHostByName] =
00150       DTHandler_WSAAsyncGetHostByName;
00151     HandlerFuncTable[DTCODE_WSAAsyncGetProtoByName] =
00152       DTHandler_WSAAsyncGetProtoByName;
00153     HandlerFuncTable[DTCODE_WSAAsyncGetProtoByNumber] =
00154       DTHandler_WSAAsyncGetProtoByNumber;
00155     HandlerFuncTable[DTCODE_WSAAsyncGetServByName] =
00156       DTHandler_WSAAsyncGetServByName;
00157     HandlerFuncTable[DTCODE_WSAAsyncGetServByPort] =
00158       DTHandler_WSAAsyncGetServByPort;
00159     HandlerFuncTable[DTCODE_WSACancelAsyncRequest] =
00160       DTHandler_WSACancelAsyncRequest;
00161     HandlerFuncTable[DTCODE_WSPAccept] = DTHandler_WSPAccept;
00162     HandlerFuncTable[DTCODE_WSPAsyncSelect] = DTHandler_WSPAsyncSelect;
00163     HandlerFuncTable[DTCODE_WSPBind] = DTHandler_WSPBind;
00164     HandlerFuncTable[DTCODE_WSPCancelBlockingCall] =
00165       DTHandler_WSPCancelBlockingCall;
00166     HandlerFuncTable[DTCODE_WSPCleanup] = DTHandler_WSPCleanup;
00167     HandlerFuncTable[DTCODE_WSPCloseSocket] = DTHandler_WSPCloseSocket;
00168     HandlerFuncTable[DTCODE_WSPConnect] = DTHandler_WSPConnect;
00169     HandlerFuncTable[DTCODE_WSPDuplicateSocket] =
00170       DTHandler_WSPDuplicateSocket;
00171     HandlerFuncTable[DTCODE_WSPEnumNetworkEvents] =
00172       DTHandler_WSPEnumNetworkEvents;
00173     HandlerFuncTable[DTCODE_WSPEventSelect] = DTHandler_WSPEventSelect;
00174     HandlerFuncTable[DTCODE_WSPGetOverlappedResult] =
00175       DTHandler_WSPGetOverlappedResult;
00176     HandlerFuncTable[DTCODE_WSPGetPeerName] = DTHandler_WSPGetPeerName;
00177     HandlerFuncTable[DTCODE_WSPGetSockName] = DTHandler_WSPGetSockName;
00178     HandlerFuncTable[DTCODE_WSPGetSockOpt] = DTHandler_WSPGetSockOpt;
00179     HandlerFuncTable[DTCODE_WSPGetQOSByName] = DTHandler_WSPGetQOSByName;
00180     HandlerFuncTable[DTCODE_WSPIoctl] = DTHandler_WSPIoctl;
00181     HandlerFuncTable[DTCODE_WSPJoinLeaf] = DTHandler_WSPJoinLeaf;
00182     HandlerFuncTable[DTCODE_WSPListen] = DTHandler_WSPListen;
00183     HandlerFuncTable[DTCODE_WSPRecv] = DTHandler_WSPRecv;
00184     HandlerFuncTable[DTCODE_WSPRecvDisconnect] =
00185       DTHandler_WSPRecvDisconnect;
00186     HandlerFuncTable[DTCODE_WSPRecvFrom] = DTHandler_WSPRecvFrom;
00187     HandlerFuncTable[DTCODE_WSPSelect] = DTHandler_WSPSelect;
00188     HandlerFuncTable[DTCODE_WSPSend] = DTHandler_WSPSend;
00189     HandlerFuncTable[DTCODE_WSPSendDisconnect] =
00190       DTHandler_WSPSendDisconnect;
00191     HandlerFuncTable[DTCODE_WSPSendTo] = DTHandler_WSPSendTo;
00192     HandlerFuncTable[DTCODE_WSPSetSockOpt] = DTHandler_WSPSetSockOpt;
00193     HandlerFuncTable[DTCODE_WSPShutdown] = DTHandler_WSPShutdown;
00194     HandlerFuncTable[DTCODE_WSPSocket] = DTHandler_WSPSocket;
00195     HandlerFuncTable[DTCODE_WSPStartup] = DTHandler_WSPStartup;
00196     HandlerFuncTable[DTCODE_WPUCloseEvent] = DTHandler_WPUCloseEvent;
00197     HandlerFuncTable[DTCODE_WPUCloseSocketHandle] =
00198       DTHandler_WPUCloseSocketHandle;
00199     HandlerFuncTable[DTCODE_WPUCreateEvent] = DTHandler_WPUCreateEvent;
00200     HandlerFuncTable[DTCODE_WPUCreateSocketHandle] =
00201       DTHandler_WPUCreateSocketHandle;
00202     HandlerFuncTable[DTCODE_WSCDeinstallProvider] =
00203       DTHandler_WSCDeinstallProvider;
00204     HandlerFuncTable[DTCODE_WSCInstallProvider] =
00205       DTHandler_WSCInstallProvider;
00206     HandlerFuncTable[DTCODE_WPUModifyIFSHandle] =
00207       DTHandler_WPUModifyIFSHandle;
00208     HandlerFuncTable[DTCODE_WPUQueryBlockingCallback] =
00209       DTHandler_WPUQueryBlockingCallback;
00210     HandlerFuncTable[DTCODE_WPUQuerySocketHandleContext] =
00211       DTHandler_WPUQuerySocketHandleContext;
00212     HandlerFuncTable[DTCODE_WPUQueueApc] = DTHandler_WPUQueueApc;
00213     HandlerFuncTable[DTCODE_WPUResetEvent] = DTHandler_WPUResetEvent;
00214     HandlerFuncTable[DTCODE_WPUSetEvent] = DTHandler_WPUSetEvent;
00215     HandlerFuncTable[DTCODE_WSCEnumProtocols] = DTHandler_WSCEnumProtocols;
00216     HandlerFuncTable[DTCODE_WPUGetProviderPath] = DTHandler_WPUGetProviderPath;
00217     HandlerFuncTable[DTCODE_WPUPostMessage] = DTHandler_WPUPostMessage;
00218     HandlerFuncTable[DTCODE_WPUFDIsSet] = DTHandler_WPUFDIsSet;
00219     HandlerFuncTable[DTCODE___WSAFDIsSet] = DTHandler___WSAFDIsSet;
00220     HandlerFuncTable[DTCODE_WSAAddressToStringA] =
00221         DTHandler_WSAAddressToStringA;
00222     HandlerFuncTable[DTCODE_WSAAddressToStringW] =
00223         DTHandler_WSAAddressToStringW;
00224     HandlerFuncTable[DTCODE_WSAStringToAddressA] =
00225         DTHandler_WSAStringToAddressA;
00226     HandlerFuncTable[DTCODE_WSAStringToAddressW] =
00227         DTHandler_WSAStringToAddressW;
00228     HandlerFuncTable[DTCODE_WSALookupServiceBeginA] =
00229         DTHandler_WSALookupServiceBeginA;
00230     HandlerFuncTable[DTCODE_WSALookupServiceBeginW] =
00231         DTHandler_WSALookupServiceBeginW;
00232     HandlerFuncTable[DTCODE_WSALookupServiceNextA] =
00233         DTHandler_WSALookupServiceNextA;
00234     HandlerFuncTable[DTCODE_WSALookupServiceNextW] =
00235         DTHandler_WSALookupServiceNextW;
00236     HandlerFuncTable[DTCODE_WSALookupServiceEnd] =
00237         DTHandler_WSALookupServiceEnd;
00238     HandlerFuncTable[DTCODE_WSAInstallServiceClassA] =
00239         DTHandler_WSAInstallServiceClassA;
00240     HandlerFuncTable[DTCODE_WSAInstallServiceClassW] =
00241         DTHandler_WSAInstallServiceClassW;
00242     HandlerFuncTable[DTCODE_WSASetServiceA] =
00243         DTHandler_WSASetServiceA;
00244     HandlerFuncTable[DTCODE_WSASetServiceW] =
00245         DTHandler_WSASetServiceW;
00246     HandlerFuncTable[DTCODE_WSARemoveServiceClass] =
00247         DTHandler_WSARemoveServiceClass;
00248     HandlerFuncTable[DTCODE_WSAGetServiceClassInfoA] =
00249         DTHandler_WSAGetServiceClassInfoA;
00250     HandlerFuncTable[DTCODE_WSAGetServiceClassInfoW] =
00251         DTHandler_WSAGetServiceClassInfoW;
00252     HandlerFuncTable[DTCODE_WSAEnumNameSpaceProvidersA] =
00253         DTHandler_WSAEnumNameSpaceProvidersA;
00254     HandlerFuncTable[DTCODE_WSAEnumNameSpaceProvidersW] =
00255         DTHandler_WSAEnumNameSpaceProvidersW;
00256     HandlerFuncTable[DTCODE_WSAGetServiceClassNameByClassIdA] =
00257         DTHandler_WSAGetServiceClassNameByClassIdA;
00258     HandlerFuncTable[DTCODE_WSAGetServiceClassNameByClassIdW] =
00259         DTHandler_WSAGetServiceClassNameByClassIdW;
00260     HandlerFuncTable[DTCODE_NSPLookupServiceBegin] =
00261         DTHandler_NSPLookupServiceBegin;
00262     HandlerFuncTable[DTCODE_NSPLookupServiceNext] =
00263         DTHandler_NSPLookupServiceNext;
00264     HandlerFuncTable[DTCODE_NSPLookupServiceEnd] =
00265         DTHandler_NSPLookupServiceEnd;
00266     HandlerFuncTable[DTCODE_NSPInstallServiceClass] =
00267         DTHandler_NSPInstallServiceClass;
00268     HandlerFuncTable[DTCODE_NSPSetService] =
00269         DTHandler_NSPSetService;
00270     HandlerFuncTable[DTCODE_NSPRemoveServiceClass] =
00271         DTHandler_NSPRemoveServiceClass;
00272     HandlerFuncTable[DTCODE_NSPGetServiceClassInfo] =
00273         DTHandler_NSPGetServiceClassInfo;
00274
00275     return(TRUE);
00276 }
00277
00278 /*++
00279
00280   Note:
00281
00282       This comment applies to all DTHandler_xxxx functions.
00283
00284   Function Description:
00285
00286       For the present, each handler function simply adds "xxxx
00287       called." to the end of the string passed in, and calls
00288       DTTextOut to output the whole string to the Debug Window.  This
00289       allows handler functions to be disabled easily, or to output
00290       more information (like the arguments) via multiple calls to
00291       DTTextOut, etc.  See the Debug/Trace documentation for more
00292       information.
00293
00294   Arguments:
00295
00296       vl -- Variable used to strip arguments off the stack of
00297       WSA[Pre|Post]ApiNotify, the calling function.
00298
00299       ReturnValue -- A void pointer to the return value for the
00300       original API/SPI function.  Use a local variable to cast it to
00301       the appropriate type.
00302
00303       LibraryName -- For API functions, this should just be
00304       "WinSock2", but for SPI functions it is the name of the service
00305       provider.  This is to distinguish among the multiple service
00306       providers that WinSock2 may be calling.
00307
00308       Buffer -- A string containg some info about the thread and
00309       function call # of this call.
00310
00311       Index -- How many characters are in the above.
00312
00313       BufLen -- How big is the buffer.
00314
00315       PreOrPost -- TRUE if called by a WSAPreApiNotify, FALSE if
00316       called by WSAPostApiNotify.
00317
00318   Return Value:
00319
00320       If the PreOrPost argument is FALSE, then the return value is
00321       ignored.  If it's TRUE, then the return value indicates to
00322       WSAPreApiNotify whether or not we want to short-circuit the API
00323       or SPI function.  TRUE means short-circuit it, FALSE mean don't.
00324
00325 --*/
00326
00327
00328 BOOL CALLBACK
00329 DTHandler_accept(
00330     IN     va_list vl,
00331     IN OUT LPVOID  ReturnValue,
00332     IN     LPSTR   LibraryName,
00333     OUT    char    *Buffer,
00334     IN     int     Index,
00335     IN     int     BufLen,
00336     IN     BOOL    PreOrPost)
00337 {
00338     SOCKET *RetVal = (SOCKET *)ReturnValue;
00339     SOCKET *s = va_arg(vl, SOCKET *);
00340     struct sockaddr FAR **addr = va_arg(vl, struct sockaddr FAR **);
00341     int FAR **addrlen = va_arg(vl, int FAR **);
00342
00343     _snprintf(Buffer + Index, BufLen - Index - 1,
00344             "accept() %s.\r\n",
00345              PreOrPost ? "called" : "returned");
00346     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00347     return(FALSE);
00348 }
00349
00350
00351 BOOL CALLBACK
00352 DTHandler_bind(
00353     IN     va_list vl,
00354     IN OUT LPVOID  ReturnValue,
00355     IN     LPSTR   LibraryName,
00356     OUT    char    *Buffer,
00357     IN     int     Index,
00358     IN     int     BufLen,
00359     IN     BOOL    PreOrPost)
00360 {
00361     int *RetVal = (int *)ReturnValue;
00362     SOCKET *s = va_arg(vl, SOCKET *);
00363     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
00364     int *namelen = va_arg(vl, int *);
00365
00366     _snprintf(Buffer + Index, BufLen - Index - 1,
00367             "bind() %s.\r\n",
00368              PreOrPost ? "called" : "returned");
00369     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00370     return(FALSE);
00371 }
00372
00373
00374 BOOL CALLBACK
00375 DTHandler_closesocket(
00376     IN     va_list vl,
00377     IN OUT LPVOID  ReturnValue,
00378     IN     LPSTR   LibraryName,
00379     OUT    char    *Buffer,
00380     IN     int     Index,
00381     IN     int     BufLen,
00382     IN     BOOL    PreOrPost)
00383 {
00384     int *RetVal = (int *)ReturnValue;
00385     SOCKET *s = va_arg(vl, SOCKET *);
00386
00387     _snprintf(Buffer + Index, BufLen - Index - 1,
00388             "closesocket() %s.\r\n",
00389              PreOrPost ? "called" : "returned");
00390     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00391     return(FALSE);
00392 }
00393
00394
00395 BOOL CALLBACK
00396 DTHandler_connect(
00397     IN     va_list vl,
00398     IN OUT LPVOID  ReturnValue,
00399     IN     LPSTR   LibraryName,
00400     OUT    char    *Buffer,
00401     IN     int     Index,
00402     IN     int     BufLen,
00403     IN     BOOL    PreOrPost)
00404 {
00405     int *RetVal = (int *)ReturnValue;
00406     SOCKET *s = va_arg(vl, SOCKET *);
00407     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
00408     int *namelen = va_arg(vl, int *);
00409
00410     _snprintf(Buffer + Index, BufLen - Index - 1,
00411             "connect() %s.\r\n",
00412              PreOrPost ? "called" : "returned");
00413     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00414     return(FALSE);
00415 }
00416
00417
00418 BOOL CALLBACK
00419 DTHandler_getpeername(
00420     IN     va_list vl,
00421     IN OUT LPVOID  ReturnValue,
00422     IN     LPSTR   LibraryName,
00423     OUT    char    *Buffer,
00424     IN     int     Index,
00425     IN     int     BufLen,
00426     IN     BOOL    PreOrPost)
00427 {
00428     int *RetVal = (int *)ReturnValue;
00429     SOCKET *s = va_arg(vl, SOCKET *);
00430     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
00431     int FAR **namelen = va_arg(vl, int FAR **);
00432
00433     _snprintf(Buffer + Index, BufLen - Index - 1,
00434             "getpeername() %s.\r\n",
00435              PreOrPost ? "called" : "returned");
00436     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00437     return(FALSE);
00438 }
00439
00440
00441 BOOL CALLBACK
00442 DTHandler_getsockname(
00443     IN     va_list vl,
00444     IN OUT LPVOID  ReturnValue,
00445     IN     LPSTR   LibraryName,
00446     OUT    char    *Buffer,
00447     IN     int     Index,
00448     IN     int     BufLen,
00449     IN     BOOL    PreOrPost)
00450 {
00451     int *RetVal = (int *)ReturnValue;
00452     SOCKET *s = va_arg(vl, SOCKET *);
00453     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
00454     int FAR **namelen = va_arg(vl, int FAR **);
00455
00456     _snprintf(Buffer + Index, BufLen - Index - 1,
00457             "getsockname() %s.\r\n",
00458              PreOrPost ? "called" : "returned");
00459     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00460     return(FALSE);
00461 }
00462
00463
00464 BOOL CALLBACK
00465 DTHandler_getsockopt(
00466     IN     va_list vl,
00467     IN OUT LPVOID  ReturnValue,
00468     IN     LPSTR   LibraryName,
00469     OUT    char    *Buffer,
00470     IN     int     Index,
00471     IN     int     BufLen,
00472     IN     BOOL    PreOrPost)
00473 {
00474     int *RetVal = (int *)ReturnValue;
00475     SOCKET *s = va_arg(vl, SOCKET *);
00476     int *level = va_arg(vl, int *);
00477     int *optname = va_arg(vl, int *);
00478     char FAR **optval = va_arg(vl, char FAR **);
00479     int FAR **optlen = va_arg(vl, int FAR **);
00480
00481     _snprintf(Buffer + Index, BufLen - Index - 1,
00482             "getsockopt() %s.\r\n",
00483              PreOrPost ? "called" : "returned");
00484     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00485     return(FALSE);
00486 }
00487
00488
00489 BOOL CALLBACK
00490 DTHandler_htonl(
00491     IN     va_list vl,
00492     IN OUT LPVOID  ReturnValue,
00493     IN     LPSTR   LibraryName,
00494     OUT    char    *Buffer,
00495     IN     int     Index,
00496     IN     int     BufLen,
00497     IN     BOOL    PreOrPost)
00498 {
00499     u_long *RetVal = (u_long *)ReturnValue;
00500     u_long *hostlong = va_arg(vl, u_long *);
00501
00502     _snprintf(Buffer + Index, BufLen - Index - 1,
00503             "htonl() %s.\r\n",
00504              PreOrPost ? "called" : "returned");
00505     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00506     return(FALSE);
00507 }
00508
00509
00510 BOOL CALLBACK
00511 DTHandler_htons(
00512     IN     va_list vl,
00513     IN OUT LPVOID  ReturnValue,
00514     IN     LPSTR   LibraryName,
00515     OUT    char    *Buffer,
00516     IN     int     Index,
00517     IN     int     BufLen,
00518     IN     BOOL    PreOrPost)
00519 {
00520     u_short *RetVal = (u_short *)ReturnValue;
00521     u_short *hostshort = va_arg(vl, u_short *);
00522
00523     _snprintf(Buffer + Index, BufLen - Index - 1,
00524             "htons() %s.\r\n",
00525              PreOrPost ? "called" : "returned");
00526     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00527     return(FALSE);
00528 }
00529
00530
00531 BOOL CALLBACK
00532 DTHandler_ioctlsocket(
00533     IN     va_list vl,
00534     IN OUT LPVOID  ReturnValue,
00535     IN     LPSTR   LibraryName,
00536     OUT    char    *Buffer,
00537     IN     int     Index,
00538     IN     int     BufLen,
00539     IN     BOOL    PreOrPost)
00540 {
00541     int *RetVal = (int *)ReturnValue;
00542     SOCKET *s = va_arg(vl, SOCKET *);
00543     long *cmd = va_arg(vl, long *);
00544     u_long FAR **argp = va_arg(vl, u_long FAR **);
00545
00546     _snprintf(Buffer + Index, BufLen - Index - 1,
00547             "ioctlsocket() %s.\r\n",
00548              PreOrPost ? "called" : "returned");
00549     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00550     return(FALSE);
00551 }
00552
00553
00554 BOOL CALLBACK
00555 DTHandler_listen(
00556     IN     va_list vl,
00557     IN OUT LPVOID  ReturnValue,
00558     IN     LPSTR   LibraryName,
00559     OUT    char    *Buffer,
00560     IN     int     Index,
00561     IN     int     BufLen,
00562     IN     BOOL    PreOrPost)
00563 {
00564     int *RetVal = (int *)ReturnValue;
00565     SOCKET *s = va_arg(vl, SOCKET *);
00566     int *backlog = va_arg(vl, int *);
00567
00568     _snprintf(Buffer + Index, BufLen - Index - 1,
00569             "listen() %s.\r\n",
00570              PreOrPost ? "called" : "returned");
00571     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00572     return(FALSE);
00573 }
00574
00575
00576 BOOL CALLBACK
00577 DTHandler_ntohl(
00578     IN     va_list vl,
00579     IN OUT LPVOID  ReturnValue,
00580     IN     LPSTR   LibraryName,
00581     OUT    char    *Buffer,
00582     IN     int     Index,
00583     IN     int     BufLen,
00584     IN     BOOL    PreOrPost)
00585 {
00586     u_long *RetVal = (u_long *)ReturnValue;
00587     u_long *netlong = va_arg(vl, u_long *);
00588
00589     _snprintf(Buffer + Index, BufLen - Index - 1,
00590             "ntohl() %s.\r\n",
00591              PreOrPost ? "called" : "returned");
00592     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00593     return(FALSE);
00594 }
00595
00596
00597 BOOL CALLBACK
00598 DTHandler_ntohs(
00599     IN     va_list vl,
00600     IN OUT LPVOID  ReturnValue,
00601     IN     LPSTR   LibraryName,
00602     OUT    char    *Buffer,
00603     IN     int     Index,
00604     IN     int     BufLen,
00605     IN     BOOL    PreOrPost)
00606 {
00607     u_short *RetVal = (u_short *)ReturnValue;
00608     u_short *netshort = va_arg(vl, u_short *);
00609
00610     _snprintf(Buffer + Index, BufLen - Index - 1,
00611             "ntohs() %s.\r\n",
00612              PreOrPost ? "called" : "returned");
00613     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00614     return(FALSE);
00615 }
00616
00617
00618 BOOL CALLBACK
00619 DTHandler_recv(
00620     IN     va_list vl,
00621     IN OUT LPVOID  ReturnValue,
00622     IN     LPSTR   LibraryName,
00623     OUT    char    *Buffer,
00624     IN     int     Index,
00625     IN     int     BufLen,
00626     IN     BOOL    PreOrPost)
00627 {
00628     int *RetVal = (int *)ReturnValue;
00629     SOCKET *s = va_arg(vl, SOCKET *);
00630     char FAR **buf = va_arg(vl, char FAR **);
00631     int *len = va_arg(vl, int *);
00632     int *flags = va_arg(vl, int *);
00633
00634     _snprintf(Buffer + Index, BufLen - Index - 1,
00635             "recv() %s.\r\n",
00636              PreOrPost ? "called" : "returned");
00637     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00638     return(FALSE);
00639 }
00640
00641
00642 BOOL CALLBACK
00643 DTHandler_recvfrom(
00644     IN     va_list vl,
00645     IN OUT LPVOID  ReturnValue,
00646     IN     LPSTR   LibraryName,
00647     OUT    char    *Buffer,
00648     IN     int     Index,
00649     IN     int     BufLen,
00650     IN     BOOL    PreOrPost)
00651 {
00652     int *RetVal = (int *)ReturnValue;
00653     SOCKET *s = va_arg(vl, SOCKET *);
00654     char FAR **buf = va_arg(vl, char FAR **);
00655     int *len = va_arg(vl, int *);
00656     int *flags = va_arg(vl, int *);
00657     struct sockaddr FAR **from = va_arg(vl, struct sockaddr FAR **);
00658     int FAR **fromlen = va_arg(vl, int FAR **);
00659
00660     _snprintf(Buffer + Index, BufLen - Index - 1,
00661             "recvfrom() %s.\r\n",
00662              PreOrPost ? "called" : "returned");
00663     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00664     return(FALSE);
00665 }
00666
00667
00668 BOOL CALLBACK
00669 DTHandler_select(
00670     IN     va_list vl,
00671     IN OUT LPVOID  ReturnValue,
00672     IN     LPSTR   LibraryName,
00673     OUT    char    *Buffer,
00674     IN     int     Index,
00675     IN     int     BufLen,
00676     IN     BOOL    PreOrPost)
00677 {
00678     int *RetVal = (int *)ReturnValue;
00679     int *nfds = va_arg(vl, int *);
00680     fd_set FAR **readfds = va_arg(vl, fd_set FAR **);
00681     fd_set FAR **writefds = va_arg(vl, fd_set FAR **);
00682     fd_set FAR **exceptfds = va_arg(vl, fd_set FAR **);
00683     struct timeval FAR **timeout = va_arg(vl, struct timeval FAR **);
00684
00685     _snprintf(Buffer + Index, BufLen - Index - 1,
00686             "select() %s.\r\n",
00687              PreOrPost ? "called" : "returned");
00688     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00689     return(FALSE);
00690 }
00691
00692
00693 BOOL CALLBACK
00694 DTHandler_send(
00695     IN     va_list vl,
00696     IN OUT LPVOID  ReturnValue,
00697     IN     LPSTR   LibraryName,
00698     OUT    char    *Buffer,
00699     IN     int     Index,
00700     IN     int     BufLen,
00701     IN     BOOL    PreOrPost)
00702 {
00703     int *RetVal = (int *)ReturnValue;
00704     SOCKET *s = va_arg(vl, SOCKET *);
00705     char FAR **buf = va_arg(vl, char FAR **);
00706     int *len = va_arg(vl, int *);
00707     int *flags = va_arg(vl, int *);
00708
00709     _snprintf(Buffer + Index, BufLen - Index - 1,
00710             "send() %s.\r\n",
00711              PreOrPost ? "called" : "returned");
00712     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00713     return(FALSE);
00714 }
00715
00716
00717 BOOL CALLBACK
00718 DTHandler_sendto(
00719     IN     va_list vl,
00720     IN OUT LPVOID  ReturnValue,
00721     IN     LPSTR   LibraryName,
00722     OUT    char    *Buffer,
00723     IN     int     Index,
00724     IN     int     BufLen,
00725     IN     BOOL    PreOrPost)
00726 {
00727     int *RetVal = (int *)ReturnValue;
00728     SOCKET *s = va_arg(vl, SOCKET *);
00729     char FAR **buf = va_arg(vl, char FAR **);
00730     int *len = va_arg(vl, int *);
00731     int *flags = va_arg(vl, int *);
00732     struct sockaddr FAR **to = va_arg(vl, struct sockaddr FAR **);
00733     int *tolen = va_arg(vl, int *);
00734
00735     _snprintf(Buffer + Index, BufLen - Index - 1,
00736             "sendto() %s.\r\n",
00737              PreOrPost ? "called" : "returned");
00738     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00739     return(FALSE);
00740 }
00741
00742
00743 BOOL CALLBACK
00744 DTHandler_setsockopt(
00745     IN     va_list vl,
00746     IN OUT LPVOID  ReturnValue,
00747     IN     LPSTR   LibraryName,
00748     OUT    char    *Buffer,
00749     IN     int     Index,
00750     IN     int     BufLen,
00751     IN     BOOL    PreOrPost)
00752 {
00753     int *RetVal = (int *)ReturnValue;
00754     SOCKET *s = va_arg(vl, SOCKET *);
00755     int *level = va_arg(vl, int *);
00756     int *optname = va_arg(vl, int *);
00757     char FAR **optval = va_arg(vl, char FAR **);
00758     int *optlen = va_arg(vl, int *);
00759
00760     _snprintf(Buffer + Index, BufLen - Index - 1,
00761             "setsockopt() %s.\r\n",
00762              PreOrPost ? "called" : "returned");
00763     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00764     return(FALSE);
00765 }
00766
00767
00768 BOOL CALLBACK
00769 DTHandler_shutdown(
00770     IN     va_list vl,
00771     IN OUT LPVOID  ReturnValue,
00772     IN     LPSTR   LibraryName,
00773     OUT    char    *Buffer,
00774     IN     int     Index,
00775     IN     int     BufLen,
00776     IN     BOOL    PreOrPost)
00777 {
00778     int *RetVal = (int *)ReturnValue;
00779     SOCKET *s = va_arg(vl, SOCKET *);
00780     int *how = va_arg(vl, int *);
00781
00782     _snprintf(Buffer + Index, BufLen - Index - 1,
00783             "shutdown() %s.\r\n",
00784              PreOrPost ? "called" : "returned");
00785     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00786     return(FALSE);
00787 }
00788
00789
00790 BOOL CALLBACK
00791 DTHandler_socket(
00792     IN     va_list vl,
00793     IN OUT LPVOID  ReturnValue,
00794     IN     LPSTR   LibraryName,
00795     OUT    char    *Buffer,
00796     IN     int     Index,
00797     IN     int     BufLen,
00798     IN     BOOL    PreOrPost)
00799 {
00800     SOCKET *RetVal = (SOCKET *)ReturnValue;
00801     int *af = va_arg(vl, int *);
00802     int *type = va_arg(vl, int *);
00803     int *protocol = va_arg(vl, int *);
00804
00805     _snprintf(Buffer + Index, BufLen - Index - 1,
00806             "socket() %s.\r\n",
00807              PreOrPost ? "called" : "returned");
00808     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00809     return(FALSE);
00810 }
00811
00812
00813 BOOL CALLBACK
00814 DTHandler_WSAAccept(
00815     IN     va_list vl,
00816     IN OUT LPVOID  ReturnValue,
00817     IN     LPSTR   LibraryName,
00818     OUT    char    *Buffer,
00819     IN     int     Index,
00820     IN     int     BufLen,
00821     IN     BOOL    PreOrPost)
00822 {
00823     SOCKET *RetVal = (SOCKET *)ReturnValue;
00824     SOCKET *s = va_arg(vl, SOCKET *);
00825     struct sockaddr FAR **addr = va_arg(vl, struct sockaddr FAR **);
00826     LPINT *addrlen = va_arg(vl, LPINT *);
00827     LPCONDITIONPROC *lpfnCondition = va_arg(vl, LPCONDITIONPROC *);
00828     DWORD *dwCallbackData = va_arg(vl, DWORD *);
00829
00830     _snprintf(Buffer + Index, BufLen - Index - 1,
00831             "WSAAccept() %s.\r\n",
00832              PreOrPost ? "called" : "returned");
00833     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00834     return(FALSE);
00835 }
00836
00837
00838 BOOL CALLBACK
00839 DTHandler_WSAAsyncSelect(
00840     IN     va_list vl,
00841     IN OUT LPVOID  ReturnValue,
00842     IN     LPSTR   LibraryName,
00843     OUT    char    *Buffer,
00844     IN     int     Index,
00845     IN     int     BufLen,
00846     IN     BOOL    PreOrPost)
00847 {
00848     int *RetVal = (int *)ReturnValue;
00849     SOCKET *s = va_arg(vl, SOCKET *);
00850     HWND *hWnd = va_arg(vl, HWND *);
00851     u_int *wMsg = va_arg(vl, u_int *);
00852     long *lEvent = va_arg(vl, long *);
00853
00854     _snprintf(Buffer + Index, BufLen - Index - 1,
00855             "WSAAsyncSelect() %s.\r\n",
00856              PreOrPost ? "called" : "returned");
00857     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00858     return(FALSE);
00859 }
00860
00861
00862 BOOL CALLBACK
00863 DTHandler_WSACancelBlockingCall(
00864     IN     va_list vl,
00865     IN OUT LPVOID  ReturnValue,
00866     IN     LPSTR   LibraryName,
00867     OUT    char    *Buffer,
00868     IN     int     Index,
00869     IN     int     BufLen,
00870     IN     BOOL    PreOrPost)
00871 {
00872     int *RetVal = (int *)ReturnValue;
00873
00874     _snprintf(Buffer + Index, BufLen - Index - 1,
00875             "WSACancelBlockingCall() %s.\r\n",
00876              PreOrPost ? "called" : "returned");
00877     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00878     return(FALSE);
00879 }
00880
00881
00882 BOOL CALLBACK
00883 DTHandler_WSACleanup(
00884     IN     va_list vl,
00885     IN OUT LPVOID  ReturnValue,
00886     IN     LPSTR   LibraryName,
00887     OUT    char    *Buffer,
00888     IN     int     Index,
00889     IN     int     BufLen,
00890     IN     BOOL    PreOrPost)
00891 {
00892     int *RetVal = (int *)ReturnValue;
00893
00894     _snprintf(Buffer + Index, BufLen - Index - 1,
00895             "WSACleanup() %s.\r\n",
00896              PreOrPost ? "called" : "returned");
00897     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00898     return(FALSE);
00899 }
00900
00901
00902 BOOL CALLBACK
00903 DTHandler_WSACloseEvent(
00904     IN     va_list vl,
00905     IN OUT LPVOID  ReturnValue,
00906     IN     LPSTR   LibraryName,
00907     OUT    char    *Buffer,
00908     IN     int     Index,
00909     IN     int     BufLen,
00910     IN     BOOL    PreOrPost)
00911 {
00912     BOOL *RetVal = (BOOL *)ReturnValue;
00913     WSAEVENT *hEvent = va_arg(vl, WSAEVENT *);
00914
00915     _snprintf(Buffer + Index, BufLen - Index - 1,
00916             "WSACloseEvent() %s.\r\n",
00917              PreOrPost ? "called" : "returned");
00918     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00919     return(FALSE);
00920 }
00921
00922
00923 BOOL CALLBACK
00924 DTHandler_WSAConnect(
00925     IN     va_list vl,
00926     IN OUT LPVOID  ReturnValue,
00927     IN     LPSTR   LibraryName,
00928     OUT    char    *Buffer,
00929     IN     int     Index,
00930     IN     int     BufLen,
00931     IN     BOOL    PreOrPost)
00932 {
00933     int *RetVal = (int *)ReturnValue;
00934     SOCKET *s = va_arg(vl, SOCKET *);
00935     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
00936     int *namelen = va_arg(vl, int *);
00937     LPWSABUF *lpCallerData = va_arg(vl, LPWSABUF *);
00938     LPWSABUF *lpCalleeData = va_arg(vl, LPWSABUF *);
00939     LPQOS *lpSQOS = va_arg(vl, LPQOS *);
00940     LPQOS *lpGQOS = va_arg(vl, LPQOS *);
00941
00942     _snprintf(Buffer + Index, BufLen - Index - 1,
00943             "WSAConnect() %s.\r\n",
00944              PreOrPost ? "called" : "returned");
00945     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00946     return(FALSE);
00947 }
00948
00949
00950 BOOL CALLBACK
00951 DTHandler_WSACreateEvent(
00952     IN     va_list vl,
00953     IN OUT LPVOID  ReturnValue,
00954     IN     LPSTR   LibraryName,
00955     OUT    char    *Buffer,
00956     IN     int     Index,
00957     IN     int     BufLen,
00958     IN     BOOL    PreOrPost)
00959 {
00960     WSAEVENT *RetVal = (WSAEVENT *)ReturnValue;
00961
00962     _snprintf(Buffer + Index, BufLen - Index - 1,
00963             "WSACreateEvent() %s.\r\n",
00964              PreOrPost ? "called" : "returned");
00965     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00966     return(FALSE);
00967 }
00968
00969
00970 BOOL CALLBACK
00971 DTHandler_WSADuplicateSocketA(
00972     IN     va_list vl,
00973     IN OUT LPVOID  ReturnValue,
00974     IN     LPSTR   LibraryName,
00975     OUT    char    *Buffer,
00976     IN     int     Index,
00977     IN     int     BufLen,
00978     IN     BOOL    PreOrPost)
00979 {
00980     int *RetVal = (int *)ReturnValue;
00981     SOCKET *s = va_arg(vl, SOCKET *);
00982     DWORD *dwProcessId = va_arg(vl, DWORD *);
00983     LPWSAPROTOCOL_INFOA *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOA *);
00984
00985     _snprintf(Buffer + Index, BufLen - Index - 1,
00986             "WSADuplicateSocketA() %s.\r\n",
00987              PreOrPost ? "called" : "returned");
00988     DTTextOut(LogFileHandle, Buffer, OutputStyle);
00989     return(FALSE);
00990 }
00991
00992
00993 BOOL CALLBACK
00994 DTHandler_WSADuplicateSocketW(
00995     IN     va_list vl,
00996     IN OUT LPVOID  ReturnValue,
00997     IN     LPSTR   LibraryName,
00998     OUT    char    *Buffer,
00999     IN     int     Index,
01000     IN     int     BufLen,
01001     IN     BOOL    PreOrPost)
01002 {
01003     int *RetVal = (int *)ReturnValue;
01004     SOCKET *s = va_arg(vl, SOCKET *);
01005     DWORD *dwProcessId = va_arg(vl, DWORD *);
01006     LPWSAPROTOCOL_INFOW *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOW *);
01007
01008     _snprintf(Buffer + Index, BufLen - Index - 1,
01009             "WSADuplicateSocketW() %s.\r\n",
01010              PreOrPost ? "called" : "returned");
01011     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01012     return(FALSE);
01013 }
01014
01015
01016 BOOL CALLBACK
01017 DTHandler_WSAEnumNetworkEvents(
01018     IN     va_list vl,
01019     IN OUT LPVOID  ReturnValue,
01020     IN     LPSTR   LibraryName,
01021     OUT    char    *Buffer,
01022     IN     int     Index,
01023     IN     int     BufLen,
01024     IN     BOOL    PreOrPost)
01025 {
01026     int *RetVal = (int *)ReturnValue;
01027     SOCKET *s = va_arg(vl, SOCKET *);
01028     WSAEVENT *hEventObject = va_arg(vl, WSAEVENT *);
01029     LPWSANETWORKEVENTS *lpNetworkEvents = va_arg(vl, LPWSANETWORKEVENTS *);
01030
01031     _snprintf(Buffer + Index, BufLen - Index - 1,
01032             "WSAEnumNetworkEvents() %s.\r\n",
01033              PreOrPost ? "called" : "returned");
01034     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01035     return(FALSE);
01036 }
01037
01038
01039 BOOL CALLBACK
01040 DTHandler_WSAEnumProtocolsA(
01041     IN     va_list vl,
01042     IN OUT LPVOID  ReturnValue,
01043     IN     LPSTR   LibraryName,
01044     OUT    char    *Buffer,
01045     IN     int     Index,
01046     IN     int     BufLen,
01047     IN     BOOL    PreOrPost)
01048 {
01049     int *RetVal = (int *)ReturnValue;
01050     LPINT *lpiProtocols = va_arg(vl, LPINT *);
01051     LPWSAPROTOCOL_INFOA *lpProtocolBuffer = va_arg(vl, LPWSAPROTOCOL_INFOA *);
01052     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD *);
01053
01054     _snprintf(Buffer + Index, BufLen - Index - 1,
01055             "WSAEnumProtocolsA() %s.\r\n",
01056              PreOrPost ? "called" : "returned");
01057     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01058     return(FALSE);
01059 }
01060
01061
01062 BOOL CALLBACK
01063 DTHandler_WSAEnumProtocolsW(
01064     IN     va_list vl,
01065     IN OUT LPVOID  ReturnValue,
01066     IN     LPSTR   LibraryName,
01067     OUT    char    *Buffer,
01068     IN     int     Index,
01069     IN     int     BufLen,
01070     IN     BOOL    PreOrPost)
01071 {
01072     int *RetVal = (int *)ReturnValue;
01073     LPINT *lpiProtocols = va_arg(vl, LPINT *);
01074     LPWSAPROTOCOL_INFOW *lpProtocolBuffer = va_arg(vl, LPWSAPROTOCOL_INFOW *);
01075     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD *);
01076
01077     _snprintf(Buffer + Index, BufLen - Index - 1,
01078             "WSAEnumProtocolsW() %s.\r\n",
01079              PreOrPost ? "called" : "returned");
01080     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01081     return(FALSE);
01082 }
01083
01084
01085 BOOL CALLBACK
01086 DTHandler_WSAEventSelect(
01087     IN     va_list vl,
01088     IN OUT LPVOID  ReturnValue,
01089     IN     LPSTR   LibraryName,
01090     OUT    char    *Buffer,
01091     IN     int     Index,
01092     IN     int     BufLen,
01093     IN     BOOL    PreOrPost)
01094 {
01095     int *RetVal = (int *)ReturnValue;
01096     SOCKET *s = va_arg(vl, SOCKET *);
01097     WSAEVENT *hEventObject = va_arg(vl, WSAEVENT *);
01098     long *lNetworkEvents = va_arg(vl, long *);
01099
01100     _snprintf(Buffer + Index, BufLen - Index - 1,
01101             "WSAEventSelect() %s.\r\n",
01102          PreOrPost ? "called" : "returned");
01103     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01104     return(FALSE);
01105 }
01106
01107
01108 BOOL CALLBACK
01109 DTHandler_WSAGetLastError(
01110     IN     va_list vl,
01111     IN OUT LPVOID  ReturnValue,
01112     IN     LPSTR   LibraryName,
01113     OUT    char    *Buffer,
01114     IN     int     Index,
01115     IN     int     BufLen,
01116     IN     BOOL    PreOrPost)
01117 {
01118     int *RetVal = (int *)ReturnValue;
01119
01120     _snprintf(Buffer + Index, BufLen - Index - 1,
01121             "WSAGetLastError() %s.\r\n",
01122          PreOrPost ? "called" : "returned");
01123     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01124     return(FALSE);
01125 }
01126
01127
01128 BOOL CALLBACK
01129 DTHandler_WSAGetOverlappedResult(
01130     IN     va_list vl,
01131     IN OUT LPVOID  ReturnValue,
01132     IN     LPSTR   LibraryName,
01133     OUT    char    *Buffer,
01134     IN     int     Index,
01135     IN     int     BufLen,
01136     IN     BOOL    PreOrPost)
01137 {
01138     BOOL *RetVal = (BOOL *)ReturnValue;
01139     SOCKET *s = va_arg(vl, SOCKET *);
01140     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
01141     LPDWORD *lpcbTransfer = va_arg(vl, LPDWORD *);
01142     BOOL *fWait = va_arg(vl, BOOL *);
01143     LPDWORD *lpdwFlags = va_arg(vl, LPDWORD *);
01144
01145     _snprintf(Buffer + Index, BufLen - Index - 1,
01146             "WSAGetOverlappedResult() %s.\r\n",
01147              PreOrPost ? "called" : "returned");
01148     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01149     return(FALSE);
01150 }
01151
01152
01153 BOOL CALLBACK
01154 DTHandler_WSAGetQOSByName(
01155     IN     va_list vl,
01156     IN OUT LPVOID  ReturnValue,
01157     IN     LPSTR   LibraryName,
01158     OUT    char    *Buffer,
01159     IN     int     Index,
01160     IN     int     BufLen,
01161     IN     BOOL    PreOrPost)
01162 {
01163     BOOL *RetVal = (BOOL *)ReturnValue;
01164     SOCKET *s = va_arg(vl, SOCKET *);
01165     LPWSABUF *lpQOSName = va_arg(vl, LPWSABUF *);
01166     LPQOS *lpQOS = va_arg(vl, LPQOS *);
01167
01168     _snprintf(Buffer + Index, BufLen - Index - 1,
01169             "WSAGetQOSByName() %s.\r\n",
01170              PreOrPost ? "called" : "returned");
01171     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01172     return(FALSE);
01173 }
01174
01175
01176 BOOL CALLBACK
01177 DTHandler_WSAHtonl(
01178     IN     va_list vl,
01179     IN OUT LPVOID  ReturnValue,
01180     IN     LPSTR   LibraryName,
01181     OUT    char    *Buffer,
01182     IN     int     Index,
01183     IN     int     BufLen,
01184     IN     BOOL    PreOrPost)
01185 {
01186     int *RetVal = (int *)ReturnValue;
01187     SOCKET *s = va_arg(vl, SOCKET *);
01188     u_long *hostlong = va_arg(vl, u_long *);
01189     u_long FAR **lpnetlong = va_arg(vl, u_long FAR **);
01190
01191     _snprintf(Buffer + Index, BufLen - Index - 1,
01192             "WSAHtonl() %s.\r\n",
01193              PreOrPost ? "called" : "returned");
01194     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01195     return(FALSE);
01196 }
01197
01198
01199 BOOL CALLBACK
01200 DTHandler_WSAHtons(
01201     IN     va_list vl,
01202     IN OUT LPVOID  ReturnValue,
01203     IN     LPSTR   LibraryName,
01204     OUT    char    *Buffer,
01205     IN     int     Index,
01206     IN     int     BufLen,
01207     IN     BOOL    PreOrPost)
01208 {
01209     int *RetVal = (int *)ReturnValue;
01210     SOCKET *s = va_arg(vl, SOCKET *);
01211     u_short *hostshort = va_arg(vl, u_short *);
01212     u_short FAR **lpnetshort = va_arg(vl, u_short FAR **);
01213
01214     _snprintf(Buffer + Index, BufLen - Index - 1,
01215             "WSAHtons() %s.\r\n",
01216              PreOrPost ? "called" : "returned");
01217     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01218     return(FALSE);
01219 }
01220
01221
01222 BOOL CALLBACK
01223 DTHandler_WSAIoctl(
01224     IN     va_list vl,
01225     IN OUT LPVOID  ReturnValue,
01226     IN     LPSTR   LibraryName,
01227     OUT    char    *Buffer,
01228     IN     int     Index,
01229     IN     int     BufLen,
01230     IN     BOOL    PreOrPost)
01231 {
01232     int *RetVal = (int *)ReturnValue;
01233     SOCKET *s = va_arg(vl, SOCKET *);
01234     DWORD *dwIoControlCode = va_arg(vl, DWORD *);
01235     LPVOID *lpvInBuffer = va_arg(vl, LPVOID *);
01236     DWORD *cbInBuffer = va_arg(vl, DWORD *);
01237     LPVOID *lpvOutBuffer = va_arg(vl, LPVOID *);
01238     DWORD *cbOutBuffer = va_arg(vl, DWORD *);
01239     LPDWORD *lpcbBytesReturned = va_arg(vl, LPDWORD *);
01240     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
01241     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
01242       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01243
01244     _snprintf(Buffer + Index, BufLen - Index - 1,
01245             "WSAIoctl() %s.\r\n",
01246              PreOrPost ? "called" : "returned");
01247     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01248     return(FALSE);
01249 }
01250
01251
01252 BOOL CALLBACK
01253 DTHandler_WSAIsBlocking(
01254     IN     va_list vl,
01255     IN OUT LPVOID  ReturnValue,
01256     IN     LPSTR   LibraryName,
01257     OUT    char    *Buffer,
01258     IN     int     Index,
01259     IN     int     BufLen,
01260     IN     BOOL    PreOrPost)
01261 {
01262     BOOL *RetVal = (BOOL *)ReturnValue;
01263
01264     _snprintf(Buffer + Index, BufLen - Index - 1,
01265             "WSAIsBlocking() %s.\r\n",
01266              PreOrPost ? "called" : "returned");
01267     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01268     return(FALSE);
01269 }
01270
01271
01272 BOOL CALLBACK
01273 DTHandler_WSAJoinLeaf(
01274     IN     va_list vl,
01275     IN OUT LPVOID  ReturnValue,
01276     IN     LPSTR   LibraryName,
01277     OUT    char    *Buffer,
01278     IN     int     Index,
01279     IN     int     BufLen,
01280     IN     BOOL    PreOrPost)
01281 {
01282     SOCKET *RetVal = (SOCKET *)ReturnValue;
01283     SOCKET *s = va_arg(vl, SOCKET *);
01284     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
01285     int *namelen = va_arg(vl, int *);
01286     LPWSABUF *lpCallerData = va_arg(vl, LPWSABUF *);
01287     LPWSABUF *lpCalleeData = va_arg(vl, LPWSABUF *);
01288     LPQOS *lpSQOS = va_arg(vl, LPQOS *);
01289     LPQOS *lpGQOS = va_arg(vl, LPQOS *);
01290     DWORD *dwFlags = va_arg(vl, DWORD *);
01291
01292     _snprintf(Buffer + Index, BufLen - Index - 1,
01293             "WSAJoinLeaf() %s.\r\n",
01294              PreOrPost ? "called" : "returned");
01295     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01296     return(FALSE);
01297 }
01298
01299
01300 BOOL CALLBACK
01301 DTHandler_WSANtohl(
01302     IN     va_list vl,
01303     IN OUT LPVOID  ReturnValue,
01304     IN     LPSTR   LibraryName,
01305     OUT    char    *Buffer,
01306     IN     int     Index,
01307     IN     int     BufLen,
01308     IN     BOOL    PreOrPost)
01309 {
01310     int *RetVal = (int *)ReturnValue;
01311     SOCKET *s = va_arg(vl, SOCKET *);
01312     u_long *netlong = va_arg(vl, u_long *);
01313     u_long FAR **lphostlong = va_arg(vl, u_long FAR **);
01314
01315     _snprintf(Buffer + Index, BufLen - Index - 1,
01316             "WSANtohl() %s.\r\n",
01317              PreOrPost ? "called" : "returned");
01318     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01319     return(FALSE);
01320 }
01321
01322
01323 BOOL CALLBACK
01324 DTHandler_WSANtohs(
01325     IN     va_list vl,
01326     IN OUT LPVOID  ReturnValue,
01327     IN     LPSTR   LibraryName,
01328     OUT    char    *Buffer,
01329     IN     int     Index,
01330     IN     int     BufLen,
01331     IN     BOOL    PreOrPost)
01332 {
01333     int *RetVal = (int *)ReturnValue;
01334     SOCKET *s = va_arg(vl, SOCKET *);
01335     u_short *netshort = va_arg(vl, u_short *);
01336     u_short FAR **lphostshort = va_arg(vl, u_short FAR **);
01337
01338     _snprintf(Buffer + Index, BufLen - Index - 1,
01339             "WSANtohs() %s.\r\n",
01340              PreOrPost ? "called" : "returned");
01341     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01342     return(FALSE);
01343 }
01344
01345
01346 BOOL CALLBACK
01347 DTHandler_WSARecv(
01348     IN     va_list vl,
01349     IN OUT LPVOID  ReturnValue,
01350     IN     LPSTR   LibraryName,
01351     OUT    char    *Buffer,
01352     IN     int     Index,
01353     IN     int     BufLen,
01354     IN     BOOL    PreOrPost)
01355 {
01356     int *RetVal = (int *)ReturnValue;
01357     SOCKET *s = va_arg(vl, SOCKET *);
01358     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
01359     DWORD *dwBufferCount = va_arg(vl, DWORD *);
01360     LPDWORD *lpNumberOfBytesRecvd = va_arg(vl, LPDWORD *);
01361     LPDWORD *lpFlags = va_arg(vl, LPDWORD *);
01362     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
01363     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
01364       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01365
01366     _snprintf(Buffer + Index, BufLen - Index - 1,
01367             "WSARecv() %s.\r\n",
01368              PreOrPost ? "called" : "returned");
01369     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01370     return(FALSE);
01371 }
01372
01373
01374 BOOL CALLBACK
01375 DTHandler_WSARecvDisconnect(
01376     IN     va_list vl,
01377     IN OUT LPVOID  ReturnValue,
01378     IN     LPSTR   LibraryName,
01379     OUT    char    *Buffer,
01380     IN     int     Index,
01381     IN     int     BufLen,
01382     IN     BOOL    PreOrPost)
01383 {
01384     int *RetVal = (int *)ReturnValue;
01385     SOCKET *s = va_arg(vl, SOCKET *);
01386     LPWSABUF *lpInboundDisconnectData = va_arg(vl, LPWSABUF *);
01387
01388     _snprintf(Buffer + Index, BufLen - Index - 1,
01389             "WSARecvDisconnect() %s.\r\n",
01390              PreOrPost ? "called" : "returned");
01391     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01392     return(FALSE);
01393 }
01394
01395
01396 BOOL CALLBACK
01397 DTHandler_WSARecvFrom(
01398     IN     va_list vl,
01399     IN OUT LPVOID  ReturnValue,
01400     IN     LPSTR   LibraryName,
01401     OUT    char    *Buffer,
01402     IN     int     Index,
01403     IN     int     BufLen,
01404     IN     BOOL    PreOrPost)
01405 {
01406     int *RetVal = (int *)ReturnValue;
01407     SOCKET *s = va_arg(vl, SOCKET *);
01408     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
01409     DWORD *dwBufferCount = va_arg(vl, DWORD *);
01410     LPDWORD *lpNumberOfBytesRecvd = va_arg(vl, LPDWORD *);
01411     LPDWORD *lpFlags = va_arg(vl, LPDWORD *);
01412     struct sockaddr FAR **lpFrom = va_arg(vl, struct sockaddr FAR **);
01413     LPINT *lpFromlen = va_arg(vl, LPINT *);
01414     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
01415     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
01416       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01417
01418     _snprintf(Buffer + Index, BufLen - Index - 1,
01419             "WSARecvFrom() %s.\r\n",
01420              PreOrPost ? "called" : "returned");
01421     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01422     return(FALSE);
01423 }
01424
01425
01426 BOOL CALLBACK
01427 DTHandler_WSAResetEvent(
01428     IN     va_list vl,
01429     IN OUT LPVOID  ReturnValue,
01430     IN     LPSTR   LibraryName,
01431     OUT    char    *Buffer,
01432     IN     int     Index,
01433     IN     int     BufLen,
01434     IN     BOOL    PreOrPost)
01435 {
01436     BOOL *RetVal = (BOOL *)ReturnValue;
01437     WSAEVENT *hEvent = va_arg(vl, WSAEVENT *);
01438
01439     _snprintf(Buffer + Index, BufLen - Index - 1,
01440             "WSAResetEvent() %s.\r\n",
01441              PreOrPost ? "called" : "returned");
01442     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01443     return(FALSE);
01444 }
01445
01446
01447 BOOL CALLBACK
01448 DTHandler_WSASend(
01449     IN     va_list vl,
01450     IN OUT LPVOID  ReturnValue,
01451     IN     LPSTR   LibraryName,
01452     OUT    char    *Buffer,
01453     IN     int     Index,
01454     IN     int     BufLen,
01455     IN     BOOL    PreOrPost)
01456 {
01457     int *RetVal = (int *)ReturnValue;
01458     SOCKET *s = va_arg(vl, SOCKET *);
01459     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
01460     DWORD *dwBufferCount = va_arg(vl, DWORD *);
01461     LPDWORD *lpNumberOfBytesSent = va_arg(vl, LPDWORD *);
01462     DWORD *dwFlags = va_arg(vl, DWORD *);
01463     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
01464     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
01465       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01466
01467     _snprintf(Buffer + Index, BufLen - Index - 1,
01468             "WSASend() %s.\r\n",
01469              PreOrPost ? "called" : "returned");
01470     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01471     return(FALSE);
01472 }
01473
01474
01475 BOOL CALLBACK
01476 DTHandler_WSASendDisconnect(
01477     IN     va_list vl,
01478     IN OUT LPVOID  ReturnValue,
01479     IN     LPSTR   LibraryName,
01480     OUT    char    *Buffer,
01481     IN     int     Index,
01482     IN     int     BufLen,
01483     IN     BOOL    PreOrPost)
01484 {
01485     int *RetVal = (int *)ReturnValue;
01486     SOCKET *s = va_arg(vl, SOCKET *);
01487     LPWSABUF *lpOutboundDisconnectData = va_arg(vl, LPWSABUF *);
01488
01489     _snprintf(Buffer + Index, BufLen - Index - 1,
01490             "WSASendDisconnect() %s.\r\n",
01491              PreOrPost ? "called" : "returned");
01492     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01493     return(FALSE);
01494 }
01495
01496
01497 BOOL CALLBACK
01498 DTHandler_WSASendTo(
01499     IN     va_list vl,
01500     IN OUT LPVOID  ReturnValue,
01501     IN     LPSTR   LibraryName,
01502     OUT    char    *Buffer,
01503     IN     int     Index,
01504     IN     int     BufLen,
01505     IN     BOOL    PreOrPost)
01506 {
01507     int *RetVal = (int *)ReturnValue;
01508     SOCKET *s = va_arg(vl, SOCKET *);
01509     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
01510     DWORD *dwBufferCount = va_arg(vl, DWORD *);
01511     LPDWORD *lpNumberOfBytesSent = va_arg(vl, LPDWORD *);
01512     DWORD *dwFlags = va_arg(vl, DWORD *);
01513     struct sockaddr FAR **lpTo = va_arg(vl, struct sockaddr FAR **);
01514     int *iTolen = va_arg(vl, int *);
01515     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
01516     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
01517       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01518
01519     _snprintf(Buffer + Index, BufLen - Index - 1,
01520             "WSASendTo() %s.\r\n",
01521              PreOrPost ? "called" : "returned");
01522     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01523     return(FALSE);
01524 }
01525
01526
01527 BOOL CALLBACK
01528 DTHandler_WSASetBlockingHook(
01529     IN     va_list vl,
01530     IN OUT LPVOID  ReturnValue,
01531     IN     LPSTR   LibraryName,
01532     OUT    char    *Buffer,
01533     IN     int     Index,
01534     IN     int     BufLen,
01535     IN     BOOL    PreOrPost)
01536 {
01537     FARPROC *RetVal = (FARPROC *)ReturnValue;
01538     FARPROC *lpBlockFunc = va_arg(vl, FARPROC *);
01539
01540     _snprintf(Buffer + Index, BufLen - Index - 1,
01541             "WSASetBlockingHook() %s.\r\n",
01542              PreOrPost ? "called" : "returned");
01543     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01544     return(FALSE);
01545 }
01546
01547
01548 BOOL CALLBACK
01549 DTHandler_WSASetEvent(
01550     IN     va_list vl,
01551     IN OUT LPVOID  ReturnValue,
01552     IN     LPSTR   LibraryName,
01553     OUT    char    *Buffer,
01554     IN     int     Index,
01555     IN     int     BufLen,
01556     IN     BOOL    PreOrPost)
01557 {
01558     BOOL *RetVal = (BOOL *)ReturnValue;
01559     WSAEVENT *hEvent = va_arg(vl, WSAEVENT *);
01560
01561     _snprintf(Buffer + Index, BufLen - Index - 1,
01562             "WSASetEvent() %s.\r\n",
01563              PreOrPost ? "called" : "returned");
01564     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01565     return(FALSE);
01566 }
01567
01568
01569 BOOL CALLBACK
01570 DTHandler_WSASetLastError(
01571     IN     va_list vl,
01572     IN OUT LPVOID  ReturnValue,
01573     IN     LPSTR   LibraryName,
01574     OUT    char    *Buffer,
01575     IN     int     Index,
01576     IN     int     BufLen,
01577     IN     BOOL    PreOrPost)
01578 {
01579     // WSASetLastError returns void, so ReturnValue should be NULL
01580     int *iError = va_arg(vl, int *);
01581
01582     _snprintf(Buffer + Index, BufLen - Index - 1,
01583             "WSASetLastError() %s.\r\n",
01584              PreOrPost ? "called" : "returned");
01585     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01586     return(FALSE);
01587 }
01588
01589
01590 BOOL CALLBACK
01591 DTHandler_WSASocketA(
01592     IN     va_list vl,
01593     IN OUT LPVOID  ReturnValue,
01594     IN     LPSTR   LibraryName,
01595     OUT    char    *Buffer,
01596     IN     int     Index,
01597     IN     int     BufLen,
01598     IN     BOOL    PreOrPost)
01599 {
01600     SOCKET *RetVal = (SOCKET *)ReturnValue;
01601     int *af = va_arg(vl, int *);
01602     int *type = va_arg(vl, int *);
01603     int *protocol = va_arg(vl, int *);
01604     LPWSAPROTOCOL_INFOA *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOA *);
01605     GROUP *g = va_arg(vl, GROUP *);
01606     DWORD *dwFlags = va_arg(vl, DWORD *);
01607
01608     _snprintf(Buffer + Index, BufLen - Index - 1,
01609             "WSASocketA() %s.\r\n",
01610              PreOrPost ? "called" : "returned");
01611     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01612     return(FALSE);
01613 }
01614
01615
01616 BOOL CALLBACK
01617 DTHandler_WSASocketW(
01618     IN     va_list vl,
01619     IN OUT LPVOID  ReturnValue,
01620     IN     LPSTR   LibraryName,
01621     OUT    char    *Buffer,
01622     IN     int     Index,
01623     IN     int     BufLen,
01624     IN     BOOL    PreOrPost)
01625 {
01626     SOCKET *RetVal = (SOCKET *)ReturnValue;
01627     int *af = va_arg(vl, int *);
01628     int *type = va_arg(vl, int *);
01629     int *protocol = va_arg(vl, int *);
01630     LPWSAPROTOCOL_INFOW *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOW *);
01631     GROUP *g = va_arg(vl, GROUP *);
01632     DWORD *dwFlags = va_arg(vl, DWORD *);
01633
01634     _snprintf(Buffer + Index, BufLen - Index - 1,
01635             "WSASocketW() %s.\r\n",
01636              PreOrPost ? "called" : "returned");
01637     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01638     return(FALSE);
01639 }
01640
01641
01642 BOOL CALLBACK
01643 DTHandler_WSAStartup(
01644     IN     va_list vl,
01645     IN OUT LPVOID  ReturnValue,
01646     IN     LPSTR   LibraryName,
01647     OUT    char    *Buffer,
01648     IN     int     Index,
01649     IN     int     BufLen,
01650     IN     BOOL    PreOrPost)
01651 {
01652     int *RetVal = (int *)ReturnValue;
01653     WORD *wVersionRequested = va_arg(vl, WORD *);
01654     LPWSADATA *lpWSAData = va_arg(vl, LPWSADATA *);
01655
01656     _snprintf(Buffer + Index, BufLen - Index - 1,
01657             "WSAStartup() %s.\r\n",
01658              PreOrPost ? "called" : "returned");
01659     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01660     return(FALSE);
01661 }
01662
01663
01664 BOOL CALLBACK
01665 DTHandler_WSAUnhookBlockingHook(
01666     IN     va_list vl,
01667     IN OUT LPVOID  ReturnValue,
01668     IN     LPSTR   LibraryName,
01669     OUT    char    *Buffer,
01670     IN     int     Index,
01671     IN     int     BufLen,
01672     IN     BOOL    PreOrPost)
01673 {
01674     int *RetVal = (int *)ReturnValue;
01675
01676     _snprintf(Buffer + Index, BufLen - Index - 1,
01677             "WSAUnhookBlockingHook() %s.\r\n",
01678              PreOrPost ? "called" : "returned");
01679     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01680     return(FALSE);
01681 }
01682
01683
01684 BOOL CALLBACK
01685 DTHandler_WSAWaitForMultipleEvents(
01686     IN     va_list vl,
01687     IN OUT LPVOID  ReturnValue,
01688     IN     LPSTR   LibraryName,
01689     OUT    char    *Buffer,
01690     IN     int     Index,
01691     IN     int     BufLen,
01692     IN     BOOL    PreOrPost)
01693 {
01694     DWORD *RetVal = (DWORD *)ReturnValue;
01695     DWORD *cEvents = va_arg(vl, DWORD *);
01696     WSAEVENT FAR **lphEvents = va_arg(vl, WSAEVENT FAR **);
01697     BOOL *fWaitAll = va_arg(vl, BOOL *);
01698     DWORD *dwTimeout = va_arg(vl, DWORD *);
01699     BOOL *fAlertable = va_arg(vl, BOOL *);
01700
01701     _snprintf(Buffer + Index, BufLen - Index - 1,
01702             "WSAWaitForMultipleEvents() %s.\r\n",
01703              PreOrPost ? "called" : "returned");
01704     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01705     return(FALSE);
01706 }
01707
01708
01709 BOOL CALLBACK
01710 DTHandler_gethostbyaddr(
01711     IN     va_list vl,
01712     IN OUT LPVOID  ReturnValue,
01713     IN     LPSTR   LibraryName,
01714     OUT    char    *Buffer,
01715     IN     int     Index,
01716     IN     int     BufLen,
01717     IN     BOOL    PreOrPost)
01718 {
01719     struct hostent FAR **RetVal = (struct hostent FAR **)ReturnValue;
01720     char FAR **addr = va_arg(vl, char FAR **);
01721     int *len = va_arg(vl, int *);
01722     int *type = va_arg(vl, int *);
01723
01724     _snprintf(Buffer + Index, BufLen - Index - 1,
01725             "gethostbyaddr() %s.\r\n",
01726              PreOrPost ? "called" : "returned");
01727     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01728     return(FALSE);
01729 }
01730
01731
01732 BOOL CALLBACK
01733 DTHandler_gethostbyname(
01734     IN     va_list vl,
01735     IN OUT LPVOID  ReturnValue,
01736     IN     LPSTR   LibraryName,
01737     OUT    char    *Buffer,
01738     IN     int     Index,
01739     IN     int     BufLen,
01740     IN     BOOL    PreOrPost)
01741 {
01742     struct hostent FAR **RetVal = (struct hostent FAR **)ReturnValue;
01743     char FAR **name = va_arg(vl, char FAR **);
01744
01745     _snprintf(Buffer + Index, BufLen - Index - 1,
01746             "gethostbyname() %s.\r\n",
01747              PreOrPost ? "called" : "returned");
01748     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01749     return(FALSE);
01750 }
01751
01752
01753 BOOL CALLBACK
01754 DTHandler_gethostname(
01755     IN     va_list vl,
01756     IN OUT LPVOID  ReturnValue,
01757     IN     LPSTR   LibraryName,
01758     OUT    char    *Buffer,
01759     IN     int     Index,
01760     IN     int     BufLen,
01761     IN     BOOL    PreOrPost)
01762 {
01763     int *RetVal = (int *)ReturnValue;
01764     char FAR **name = va_arg(vl, char FAR **);
01765     int *namelen = va_arg(vl, int *);
01766
01767     _snprintf(Buffer + Index, BufLen - Index - 1,
01768             "gethostname() %s.\r\n",
01769              PreOrPost ? "called" : "returned");
01770     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01771     return(FALSE);
01772 }
01773
01774
01775 BOOL CALLBACK
01776 DTHandler_getprotobyname(
01777     IN     va_list vl,
01778     IN OUT LPVOID  ReturnValue,
01779     IN     LPSTR   LibraryName,
01780     OUT    char    *Buffer,
01781     IN     int     Index,
01782     IN     int     BufLen,
01783     IN     BOOL    PreOrPost)
01784 {
01785     struct protoent FAR **RetVal = (struct protoent FAR **)ReturnValue;
01786     char FAR **name = va_arg(vl, char FAR **);
01787
01788     _snprintf(Buffer + Index, BufLen - Index - 1,
01789             "getprotobyname() %s.\r\n",
01790              PreOrPost ? "called" : "returned");
01791     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01792     return(FALSE);
01793 }
01794
01795
01796 BOOL CALLBACK
01797 DTHandler_getprotobynumber(
01798     IN     va_list vl,
01799     IN OUT LPVOID  ReturnValue,
01800     IN     LPSTR   LibraryName,
01801     OUT    char    *Buffer,
01802     IN     int     Index,
01803     IN     int     BufLen,
01804     IN     BOOL    PreOrPost)
01805 {
01806     struct protoent FAR **RetVal = (struct protoent FAR **)ReturnValue;
01807     int *number = va_arg(vl, int *);
01808
01809     _snprintf(Buffer + Index, BufLen - Index - 1,
01810             "getprotobynumber() %s.\r\n",
01811              PreOrPost ? "called" : "returned");
01812     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01813     return(FALSE);
01814 }
01815
01816
01817 BOOL CALLBACK
01818 DTHandler_getservbyname(
01819     IN     va_list vl,
01820     IN OUT LPVOID  ReturnValue,
01821     IN     LPSTR   LibraryName,
01822     OUT    char    *Buffer,
01823     IN     int     Index,
01824     IN     int     BufLen,
01825     IN     BOOL    PreOrPost)
01826 {
01827     struct servent FAR **RetVal = (struct servent FAR **)ReturnValue;
01828     char FAR **name = va_arg(vl, char FAR **);
01829     char FAR **proto = va_arg(vl, char FAR **);
01830
01831     _snprintf(Buffer + Index, BufLen - Index - 1,
01832             "getservbyname() %s.\r\n",
01833              PreOrPost ? "called" : "returned");
01834     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01835     return(FALSE);
01836 }
01837
01838
01839 BOOL CALLBACK
01840 DTHandler_getservbyport(
01841     IN     va_list vl,
01842     IN OUT LPVOID  ReturnValue,
01843     IN     LPSTR   LibraryName,
01844     OUT    char    *Buffer,
01845     IN     int     Index,
01846     IN     int     BufLen,
01847     IN     BOOL    PreOrPost)
01848 {
01849     struct servent FAR **RetVal = (struct servent FAR **)ReturnValue;
01850     int *port = va_arg(vl, int *);
01851     char FAR **proto = va_arg(vl, char FAR **);
01852
01853     _snprintf(Buffer + Index, BufLen - Index - 1,
01854             "getservbyport() %s.\r\n",
01855              PreOrPost ? "called" : "returned");
01856     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01857     return(FALSE);
01858 }
01859
01860
01861 BOOL CALLBACK
01862 DTHandler_inet_addr(
01863     IN     va_list vl,
01864     IN OUT LPVOID  ReturnValue,
01865     IN     LPSTR   LibraryName,
01866     OUT    char    *Buffer,
01867     IN     int     Index,
01868     IN     int     BufLen,
01869     IN     BOOL    PreOrPost)
01870 {
01871     unsigned long *RetVal = (unsigned long *)ReturnValue;
01872     char FAR **cp = va_arg(vl, char FAR **);
01873
01874     _snprintf(Buffer + Index, BufLen - Index - 1,
01875             "inet_addr() %s.\r\n",
01876              PreOrPost ? "called" : "returned");
01877     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01878     return(FALSE);
01879 }
01880
01881
01882 BOOL CALLBACK
01883 DTHandler_inet_ntoa(
01884     IN     va_list vl,
01885     IN OUT LPVOID  ReturnValue,
01886     IN     LPSTR   LibraryName,
01887     OUT    char    *Buffer,
01888     IN     int     Index,
01889     IN     int     BufLen,
01890     IN     BOOL    PreOrPost)
01891 {
01892     char FAR **RetVal = (char FAR **)ReturnValue;
01893     struct in_addr *in = va_arg(vl, struct in_addr *);
01894
01895     _snprintf(Buffer + Index, BufLen - Index - 1,
01896             "inet_ntoa() %s.\r\n",
01897              PreOrPost ? "called" : "returned");
01898     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01899     return(FALSE);
01900 }
01901
01902
01903 BOOL CALLBACK
01904 DTHandler_WSAAsyncGetHostByAddr(
01905     IN     va_list vl,
01906     IN OUT LPVOID  ReturnValue,
01907     IN     LPSTR   LibraryName,
01908     OUT    char    *Buffer,
01909     IN     int     Index,
01910     IN     int     BufLen,
01911     IN     BOOL    PreOrPost)
01912 {
01913     HANDLE *RetVal = (HANDLE *)ReturnValue;
01914     HWND *hWnd = va_arg(vl, HWND *);
01915     u_int *wMsg = va_arg(vl, u_int *);
01916     char FAR **addr = va_arg(vl, char FAR **);
01917     int *len = va_arg(vl, int *);
01918     int *type = va_arg(vl, int *);
01919     char FAR **buf = va_arg(vl, char FAR **);
01920     int *buflen = va_arg(vl, int *);
01921
01922     _snprintf(Buffer + Index, BufLen - Index - 1,
01923             "WSAAsyncGetHostByAddr() %s.\r\n",
01924              PreOrPost ? "called" : "returned");
01925     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01926     return(FALSE);
01927 }
01928
01929
01930 BOOL CALLBACK
01931 DTHandler_WSAAsyncGetHostByName(
01932     IN     va_list vl,
01933     IN OUT LPVOID  ReturnValue,
01934     IN     LPSTR   LibraryName,
01935     OUT    char    *Buffer,
01936     IN     int     Index,
01937     IN     int     BufLen,
01938     IN     BOOL    PreOrPost)
01939 {
01940     HANDLE *RetVal = (HANDLE *)ReturnValue;
01941     HWND *hWnd = va_arg(vl, HWND *);
01942     u_int *wMsg = va_arg(vl, u_int *);
01943     char FAR **name = va_arg(vl, char FAR **);
01944     char FAR **buf = va_arg(vl, char FAR **);
01945     int *buflen = va_arg(vl, int *);
01946
01947     _snprintf(Buffer + Index, BufLen - Index - 1,
01948             "WSAAsyncGetHostByName() %s.\r\n",
01949              PreOrPost ? "called" : "returned");
01950     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01951     return(FALSE);
01952 }
01953
01954
01955 BOOL CALLBACK
01956 DTHandler_WSAAsyncGetProtoByName(
01957     IN     va_list vl,
01958     IN OUT LPVOID  ReturnValue,
01959     IN     LPSTR   LibraryName,
01960     OUT    char    *Buffer,
01961     IN     int     Index,
01962     IN     int     BufLen,
01963     IN     BOOL    PreOrPost)
01964 {
01965     HANDLE *RetVal = (HANDLE *)ReturnValue;
01966     HWND *hWnd = va_arg(vl, HWND *);
01967     u_int *wMsg = va_arg(vl, u_int *);
01968     char FAR **name = va_arg(vl, char FAR **);
01969     char FAR **buf = va_arg(vl, char FAR **);
01970     int *buflen = va_arg(vl, int *);
01971
01972     _snprintf(Buffer + Index, BufLen - Index - 1,
01973             "WSAAsyncGetProtoByName() %s.\r\n",
01974              PreOrPost ? "called" : "returned");
01975     DTTextOut(LogFileHandle, Buffer, OutputStyle);
01976     return(FALSE);
01977 }
01978
01979
01980 BOOL CALLBACK
01981 DTHandler_WSAAsyncGetProtoByNumber(
01982     IN     va_list vl,
01983     IN OUT LPVOID  ReturnValue,
01984     IN     LPSTR   LibraryName,
01985     OUT    char    *Buffer,
01986     IN     int     Index,
01987     IN     int     BufLen,
01988     IN     BOOL    PreOrPost)
01989 {
01990     HANDLE *RetVal = (HANDLE *)ReturnValue;
01991     HWND *hWnd = va_arg(vl, HWND *);
01992     u_int *wMsg = va_arg(vl, u_int *);
01993     int *number = va_arg(vl, int *);
01994     char FAR **buf = va_arg(vl, char FAR **);
01995     int *buflen = va_arg(vl, int *);
01996
01997     _snprintf(Buffer + Index, BufLen - Index - 1,
01998             "WSAAsyncGetProtoByNumber() %s.\r\n",
01999              PreOrPost ? "called" : "returned");
02000     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02001     return(FALSE);
02002 }
02003
02004
02005 BOOL CALLBACK
02006 DTHandler_WSAAsyncGetServByName(
02007     IN     va_list vl,
02008     IN OUT LPVOID  ReturnValue,
02009     IN     LPSTR   LibraryName,
02010     OUT    char    *Buffer,
02011     IN     int     Index,
02012     IN     int     BufLen,
02013     IN     BOOL    PreOrPost)
02014 {
02015     HANDLE *RetVal = (HANDLE *)ReturnValue;
02016     HWND *hWnd = va_arg(vl, HWND *);
02017     u_int *wMsg = va_arg(vl, u_int *);
02018     char FAR **name = va_arg(vl, char FAR **);
02019     char FAR **proto = va_arg(vl, char FAR **);
02020     char FAR **buf = va_arg(vl, char FAR **);
02021     int *buflen = va_arg(vl, int *);
02022
02023     _snprintf(Buffer + Index, BufLen - Index - 1,
02024             "WSAAsyncGetServByName() %s.\r\n",
02025              PreOrPost ? "called" : "returned");
02026     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02027     return(FALSE);
02028 }
02029
02030
02031 BOOL CALLBACK
02032 DTHandler_WSAAsyncGetServByPort(
02033     IN     va_list vl,
02034     IN OUT LPVOID  ReturnValue,
02035     IN     LPSTR   LibraryName,
02036     OUT    char    *Buffer,
02037     IN     int     Index,
02038     IN     int     BufLen,
02039     IN     BOOL    PreOrPost)
02040 {
02041     HANDLE *RetVal = (HANDLE *)ReturnValue;
02042     HWND *hWnd = va_arg(vl, HWND *);
02043     u_int *wMsg = va_arg(vl, u_int *);
02044     int *port = va_arg(vl, int *);
02045     char FAR **proto = va_arg(vl, char FAR **);
02046     char FAR **buf = va_arg(vl, char FAR **);
02047     int *buflen = va_arg(vl, int *);
02048
02049     _snprintf(Buffer + Index, BufLen - Index - 1,
02050             "WSAAsyncGetServByPort() %s.\r\n",
02051              PreOrPost ? "called" : "returned");
02052     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02053     return(FALSE);
02054 }
02055
02056
02057 BOOL CALLBACK
02058 DTHandler_WSACancelAsyncRequest(
02059     IN     va_list vl,
02060     IN OUT LPVOID  ReturnValue,
02061     IN     LPSTR   LibraryName,
02062     OUT    char    *Buffer,
02063     IN     int     Index,
02064     IN     int     BufLen,
02065     IN     BOOL    PreOrPost)
02066 {
02067     int *RetVal = (int *)ReturnValue;
02068     HANDLE *hAsyncTaskHandle = va_arg(vl, HANDLE *);
02069
02070     _snprintf(Buffer + Index, BufLen - Index - 1,
02071             "WSACancelAsyncRequest() %s.\r\n",
02072              PreOrPost ? "called" : "returned");
02073     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02074     return(FALSE);
02075 }
02076
02077
02078 BOOL CALLBACK
02079 DTHandler_WSPAccept(
02080     IN     va_list vl,
02081     IN OUT LPVOID  ReturnValue,
02082     IN     LPSTR   LibraryName,
02083     OUT    char    *Buffer,
02084     IN     int     Index,
02085     IN     int     BufLen,
02086     IN     BOOL    PreOrPost)
02087 {
02088     SOCKET *RetVal = (SOCKET *)ReturnValue;
02089     SOCKET *s = va_arg(vl, SOCKET *);
02090     struct sockaddr FAR **addr = va_arg(vl, struct sockaddr FAR **);
02091     INT FAR **addrlen = va_arg(vl, INT FAR **);
02092     LPCONDITIONPROC *lpfnCondition = va_arg(vl, LPCONDITIONPROC *);
02093     DWORD *dwCallbackData = va_arg(vl, DWORD *);
02094     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02095
02096     _snprintf(Buffer + Index, BufLen - Index - 1,
02097             "WSPAccept() %s.\r\n",
02098              PreOrPost ? "called" : "returned");
02099     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02100     return(FALSE);
02101 }
02102
02103
02104 BOOL CALLBACK
02105 DTHandler_WSPAsyncSelect(
02106     IN     va_list vl,
02107     IN OUT LPVOID  ReturnValue,
02108     IN     LPSTR   LibraryName,
02109     OUT    char    *Buffer,
02110     IN     int     Index,
02111     IN     int     BufLen,
02112     IN     BOOL    PreOrPost)
02113 {
02114     INT *RetVal = (INT *)ReturnValue;
02115     SOCKET *s = va_arg(vl, SOCKET *);
02116     HWND *hWnd = va_arg(vl, HWND *);
02117     unsigned int *wMsg = va_arg(vl, unsigned int *);
02118     long *lEvent = va_arg(vl, long *);
02119     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02120
02121     _snprintf(Buffer + Index, BufLen - Index - 1,
02122             "WSPAsyncSelect() %s.\r\n",
02123              PreOrPost ? "called" : "returned");
02124     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02125     return(FALSE);
02126 }
02127
02128
02129 BOOL CALLBACK
02130 DTHandler_WSPBind(
02131     IN     va_list vl,
02132     IN OUT LPVOID  ReturnValue,
02133     IN     LPSTR   LibraryName,
02134     OUT    char    *Buffer,
02135     IN     int     Index,
02136     IN     int     BufLen,
02137     IN     BOOL    PreOrPost)
02138 {
02139     INT *RetVal = (INT *)ReturnValue;
02140     SOCKET *s = va_arg(vl, SOCKET *);
02141     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
02142     INT *namelen = va_arg(vl, INT *);
02143     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02144
02145     _snprintf(Buffer + Index, BufLen - Index - 1,
02146             "WSPBind() %s.\r\n",
02147              PreOrPost ? "called" : "returned");
02148     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02149     return(FALSE);
02150 }
02151
02152
02153 BOOL CALLBACK
02154 DTHandler_WSPCancelBlockingCall(
02155     IN     va_list vl,
02156     IN OUT LPVOID  ReturnValue,
02157     IN     LPSTR   LibraryName,
02158     OUT    char    *Buffer,
02159     IN     int     Index,
02160     IN     int     BufLen,
02161     IN     BOOL    PreOrPost)
02162 {
02163     INT *RetVal = (INT *)ReturnValue;
02164     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02165
02166     _snprintf(Buffer + Index, BufLen - Index - 1,
02167             "WSPCancelBlockingCall() %s.\r\n",
02168              PreOrPost ? "called" : "returned");
02169     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02170     return(FALSE);
02171 }
02172
02173
02174 BOOL CALLBACK
02175 DTHandler_WSPCleanup(
02176     IN     va_list vl,
02177     IN OUT LPVOID  ReturnValue,
02178     IN     LPSTR   LibraryName,
02179     OUT    char    *Buffer,
02180     IN     int     Index,
02181     IN     int     BufLen,
02182     IN     BOOL    PreOrPost)
02183 {
02184     INT *RetVal = (INT *)ReturnValue;
02185     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02186
02187     _snprintf(Buffer + Index, BufLen - Index - 1,
02188             "WSPCleanup() %s.\r\n",
02189              PreOrPost ? "called" : "returned");
02190     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02191     return(FALSE);
02192 }
02193
02194
02195 BOOL CALLBACK
02196 DTHandler_WSPCloseSocket(
02197     IN     va_list vl,
02198     IN OUT LPVOID  ReturnValue,
02199     IN     LPSTR   LibraryName,
02200     OUT    char    *Buffer,
02201     IN     int     Index,
02202     IN     int     BufLen,
02203     IN     BOOL    PreOrPost)
02204 {
02205     INT *RetVal = (INT *)ReturnValue;
02206     SOCKET *s = va_arg(vl, SOCKET *);
02207     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02208
02209     _snprintf(Buffer + Index, BufLen - Index - 1,
02210             "WSPCloseSocket() %s.\r\n",
02211              PreOrPost ? "called" : "returned");
02212     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02213     return(FALSE);
02214 }
02215
02216
02217 BOOL CALLBACK
02218 DTHandler_WSPConnect(
02219     IN     va_list vl,
02220     IN OUT LPVOID  ReturnValue,
02221     IN     LPSTR   LibraryName,
02222     OUT    char    *Buffer,
02223     IN     int     Index,
02224     IN     int     BufLen,
02225     IN     BOOL    PreOrPost)
02226 {
02227     INT *RetVal = (INT *)ReturnValue;
02228     SOCKET *s = va_arg(vl, SOCKET *);
02229     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
02230     INT *namelen = va_arg(vl, INT *);
02231     LPWSABUF *lpCallerData = va_arg(vl, LPWSABUF *);
02232     LPWSABUF *lpCalleeData = va_arg(vl, LPWSABUF *);
02233     LPQOS *lpSQOS = va_arg(vl, LPQOS *);
02234     LPQOS *lpGQOS = va_arg(vl, LPQOS *);
02235     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02236
02237     _snprintf(Buffer + Index, BufLen - Index - 1,
02238             "WSPConnect() %s.\r\n",
02239              PreOrPost ? "called" : "returned");
02240     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02241     return(FALSE);
02242 }
02243
02244
02245 BOOL CALLBACK
02246 DTHandler_WSPDuplicateSocket(
02247     IN     va_list vl,
02248     IN OUT LPVOID  ReturnValue,
02249     IN     LPSTR   LibraryName,
02250     OUT    char    *Buffer,
02251     IN     int     Index,
02252     IN     int     BufLen,
02253     IN     BOOL    PreOrPost)
02254 {
02255     INT *RetVal = (INT *)ReturnValue;
02256     SOCKET *s = va_arg(vl, SOCKET *);
02257     DWORD *dwProcessID = va_arg(vl, DWORD *);
02258     LPWSAPROTOCOL_INFO *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFO *);
02259     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02260
02261     _snprintf(Buffer + Index, BufLen - Index - 1,
02262             "WSPDuplicateSocket() %s.\r\n",
02263              PreOrPost ? "called" : "returned");
02264     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02265     return(FALSE);
02266 }
02267
02268
02269 BOOL CALLBACK
02270 DTHandler_WSPEnumNetworkEvents(
02271     IN     va_list vl,
02272     IN OUT LPVOID  ReturnValue,
02273     IN     LPSTR   LibraryName,
02274     OUT    char    *Buffer,
02275     IN     int     Index,
02276     IN     int     BufLen,
02277     IN     BOOL    PreOrPost)
02278 {
02279     INT *RetVal = (INT *)ReturnValue;
02280     SOCKET *s = va_arg(vl, SOCKET *);
02281     WSAEVENT *hEventObject = va_arg(vl, WSAEVENT *);
02282     LPWSANETWORKEVENTS *lpNetworkEvents = va_arg(vl, LPWSANETWORKEVENTS *);
02283     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02284
02285     _snprintf(Buffer + Index, BufLen - Index - 1,
02286             "WSPEnumNetworkEvents() %s.\r\n",
02287              PreOrPost ? "called" : "returned");
02288     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02289     return(FALSE);
02290 }
02291
02292
02293 BOOL CALLBACK
02294 DTHandler_WSPEventSelect(
02295     IN     va_list vl,
02296     IN OUT LPVOID  ReturnValue,
02297     IN     LPSTR   LibraryName,
02298     OUT    char    *Buffer,
02299     IN     int     Index,
02300     IN     int     BufLen,
02301     IN     BOOL    PreOrPost)
02302 {
02303     INT *RetVal = (INT *)ReturnValue;
02304     SOCKET *s = va_arg(vl, SOCKET *);
02305     WSAEVENT *hEventObject = va_arg(vl, WSAEVENT *);
02306     long *lNetworkEvents = va_arg(vl, long *);
02307     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02308
02309     _snprintf(Buffer + Index, BufLen - Index - 1,
02310             "WSPEventSelect() %s.\r\n",
02311              PreOrPost ? "called" : "returned");
02312     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02313     return(FALSE);
02314 }
02315
02316
02317 BOOL CALLBACK
02318 DTHandler_WSPGetOverlappedResult(
02319     IN     va_list vl,
02320     IN OUT LPVOID  ReturnValue,
02321     IN     LPSTR   LibraryName,
02322     OUT    char    *Buffer,
02323     IN     int     Index,
02324     IN     int     BufLen,
02325     IN     BOOL    PreOrPost)
02326 {
02327     INT *RetVal = (INT *)ReturnValue;
02328     SOCKET *s = va_arg(vl, SOCKET *);
02329     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
02330     LPDWORD *lpcbTransfer = va_arg(vl, LPDWORD *);
02331     BOOL *fWait = va_arg(vl, BOOL *);
02332     LPDWORD *lpdwFlags = va_arg(vl, LPDWORD *);
02333     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02334
02335     _snprintf(Buffer + Index, BufLen - Index - 1,
02336             "WSPGetOverlappedResult() %s.\r\n",
02337              PreOrPost ? "called" : "returned");
02338     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02339     return(FALSE);
02340 }
02341
02342
02343 BOOL CALLBACK
02344 DTHandler_WSPGetPeerName(
02345     IN     va_list vl,
02346     IN OUT LPVOID  ReturnValue,
02347     IN     LPSTR   LibraryName,
02348     OUT    char    *Buffer,
02349     IN     int     Index,
02350     IN     int     BufLen,
02351     IN     BOOL    PreOrPost)
02352 {
02353     INT *RetVal = (INT *)ReturnValue;
02354     SOCKET *s = va_arg(vl, SOCKET *);
02355     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
02356     INT FAR **namelen = va_arg(vl, INT FAR **);
02357     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02358
02359     _snprintf(Buffer + Index, BufLen - Index - 1,
02360             "WSPGetPeerName() %s.\r\n",
02361              PreOrPost ? "called" : "returned");
02362     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02363     return(FALSE);
02364 }
02365
02366
02367
02368 BOOL CALLBACK
02369 DTHandler_WSPGetSockName(
02370     IN     va_list vl,
02371     IN OUT LPVOID  ReturnValue,
02372     IN     LPSTR   LibraryName,
02373     OUT    char    *Buffer,
02374     IN     int     Index,
02375     IN     int     BufLen,
02376     IN     BOOL    PreOrPost)
02377 {
02378     INT *RetVal = (INT *)ReturnValue;
02379     SOCKET *s = va_arg(vl, SOCKET *);
02380     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
02381     INT FAR **namelen = va_arg(vl, INT FAR **);
02382     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02383
02384     _snprintf(Buffer + Index, BufLen - Index - 1,
02385             "WSPGetSockName() %s.\r\n",
02386              PreOrPost ? "called" : "returned");
02387     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02388     return(FALSE);
02389 }
02390
02391
02392 BOOL CALLBACK
02393 DTHandler_WSPGetSockOpt(
02394     IN     va_list vl,
02395     IN OUT LPVOID  ReturnValue,
02396     IN     LPSTR   LibraryName,
02397     OUT    char    *Buffer,
02398     IN     int     Index,
02399     IN     int     BufLen,
02400     IN     BOOL    PreOrPost)
02401 {
02402     INT *RetVal = (INT *)ReturnValue;
02403     SOCKET *s = va_arg(vl, SOCKET *);
02404     INT *level = va_arg(vl, INT *);
02405     INT *optname = va_arg(vl, INT *);
02406     char FAR **optval = va_arg(vl, char FAR **);
02407     INT FAR **optlen = va_arg(vl, INT FAR **);
02408     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02409
02410     _snprintf(Buffer + Index, BufLen - Index - 1,
02411             "WSPGetSockOpt() %s.\r\n",
02412              PreOrPost ? "called" : "returned");
02413     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02414     return(FALSE);
02415 }
02416
02417
02418 BOOL CALLBACK
02419 DTHandler_WSPGetQOSByName(
02420     IN     va_list vl,
02421     IN OUT LPVOID  ReturnValue,
02422     IN     LPSTR   LibraryName,
02423     OUT    char    *Buffer,
02424     IN     int     Index,
02425     IN     int     BufLen,
02426     IN     BOOL    PreOrPost)
02427 {
02428     INT *RetVal = (INT *)ReturnValue;
02429     SOCKET *s = va_arg(vl, SOCKET *);
02430     LPWSABUF *lpQOSName = va_arg(vl, LPWSABUF *);
02431     LPQOS *lpQOS = va_arg(vl, LPQOS *);
02432     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02433
02434     _snprintf(Buffer + Index, BufLen - Index - 1,
02435             "WSPGetQOSByName() %s.\r\n",
02436              PreOrPost ? "called" : "returned");
02437     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02438     return(FALSE);
02439 }
02440
02441
02442 BOOL CALLBACK
02443 DTHandler_WSPIoctl(
02444     IN     va_list vl,
02445     IN OUT LPVOID  ReturnValue,
02446     IN     LPSTR   LibraryName,
02447     OUT    char    *Buffer,
02448     IN     int     Index,
02449     IN     int     BufLen,
02450     IN     BOOL    PreOrPost)
02451 {
02452     INT *RetVal = (INT *)ReturnValue;
02453     SOCKET *s = va_arg(vl, SOCKET *);
02454     DWORD *dwIoControlCode = va_arg(vl, DWORD *);
02455     LPVOID *lpvInBuffer = va_arg(vl, LPVOID *);
02456     DWORD *cbInBuffer = va_arg(vl, DWORD *);
02457     LPVOID *lpvOutBuffer = va_arg(vl, LPVOID *);
02458     DWORD *cbOutBuffer = va_arg(vl, DWORD *);
02459     LPDWORD *lpcbBytesReturned = va_arg(vl, LPDWORD *);
02460     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
02461     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
02462       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02463     LPWSATHREADID *lpThreadId = va_arg(vl, LPWSATHREADID *);
02464     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02465
02466     _snprintf(Buffer + Index, BufLen - Index - 1,
02467             "WSPIoctl() %s.\r\n",
02468              PreOrPost ? "called" : "returned");
02469     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02470     return(FALSE);
02471 }
02472
02473
02474 BOOL CALLBACK
02475 DTHandler_WSPJoinLeaf(
02476     IN     va_list vl,
02477     IN OUT LPVOID  ReturnValue,
02478     IN     LPSTR   LibraryName,
02479     OUT    char    *Buffer,
02480     IN     int     Index,
02481     IN     int     BufLen,
02482     IN     BOOL    PreOrPost)
02483 {
02484     INT *RetVal = (INT *)ReturnValue;
02485     SOCKET *s = va_arg(vl, SOCKET *);
02486     struct sockaddr FAR **name = va_arg(vl, struct sockaddr FAR **);
02487     INT *namelen = va_arg(vl, INT *);
02488     LPWSABUF *lpCallerData = va_arg(vl, LPWSABUF *);
02489     LPWSABUF *lpCalleeData = va_arg(vl, LPWSABUF *);
02490     LPQOS *lpSQOS = va_arg(vl, LPQOS *);
02491     LPQOS *lpGQOS = va_arg(vl, LPQOS *);
02492     DWORD *dwFlags = va_arg(vl, DWORD *);
02493     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02494
02495     _snprintf(Buffer + Index, BufLen - Index - 1,
02496             "WSPJoinLeaf() %s.\r\n",
02497              PreOrPost ? "called" : "returned");
02498     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02499     return(FALSE);
02500 }
02501
02502
02503 BOOL CALLBACK
02504 DTHandler_WSPListen(
02505     IN     va_list vl,
02506     IN OUT LPVOID  ReturnValue,
02507     IN     LPSTR   LibraryName,
02508     OUT    char    *Buffer,
02509     IN     int     Index,
02510     IN     int     BufLen,
02511     IN     BOOL    PreOrPost)
02512 {
02513     INT *RetVal = (INT *)ReturnValue;
02514     SOCKET *s = va_arg(vl, SOCKET *);
02515     INT *backlog = va_arg(vl, INT *);
02516     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02517
02518     _snprintf(Buffer + Index, BufLen - Index - 1,
02519             "WSPListen() %s.\r\n",
02520              PreOrPost ? "called" : "returned");
02521     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02522     return(FALSE);
02523 }
02524
02525
02526 BOOL CALLBACK
02527 DTHandler_WSPRecv(
02528     IN     va_list vl,
02529     IN OUT LPVOID  ReturnValue,
02530     IN     LPSTR   LibraryName,
02531     OUT    char    *Buffer,
02532     IN     int     Index,
02533     IN     int     BufLen,
02534     IN     BOOL    PreOrPost)
02535 {
02536     INT *RetVal = (INT *)ReturnValue;
02537     SOCKET *s = va_arg(vl, SOCKET *);
02538     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
02539     DWORD *dwBufferCount = va_arg(vl, DWORD *);
02540     LPDWORD *lpNumberOfBytesRecvd = va_arg(vl, LPDWORD *);
02541     LPDWORD *lpFlags = va_arg(vl, LPDWORD *);
02542     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
02543     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
02544       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02545     LPWSATHREADID *lpThreadId = va_arg(vl, LPWSATHREADID *);
02546     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02547
02548     _snprintf(Buffer + Index, BufLen - Index - 1,
02549             "WSPRecv() %s.\r\n",
02550              PreOrPost ? "called" : "returned");
02551     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02552     return(FALSE);
02553 }
02554
02555
02556 BOOL CALLBACK
02557 DTHandler_WSPRecvDisconnect(
02558     IN     va_list vl,
02559     IN OUT LPVOID  ReturnValue,
02560     IN     LPSTR   LibraryName,
02561     OUT    char    *Buffer,
02562     IN     int     Index,
02563     IN     int     BufLen,
02564     IN     BOOL    PreOrPost)
02565 {
02566     INT *RetVal = (INT *)ReturnValue;
02567     SOCKET *s = va_arg(vl, SOCKET *);
02568     LPWSABUF *lpInboundDisconnectData = va_arg(vl, LPWSABUF *);
02569     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02570
02571     _snprintf(Buffer + Index, BufLen - Index - 1,
02572             "WSPRecvDisconnect() %s.\r\n",
02573              PreOrPost ? "called" : "returned");
02574     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02575     return(FALSE);
02576 }
02577
02578
02579 BOOL CALLBACK
02580 DTHandler_WSPRecvFrom(
02581     IN     va_list vl,
02582     IN OUT LPVOID  ReturnValue,
02583     IN     LPSTR   LibraryName,
02584     OUT    char    *Buffer,
02585     IN     int     Index,
02586     IN     int     BufLen,
02587     IN     BOOL    PreOrPost)
02588 {
02589     INT *RetVal = (INT *)ReturnValue;
02590     SOCKET *s = va_arg(vl, SOCKET *);
02591     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
02592     DWORD *dwBufferCount = va_arg(vl, DWORD *);
02593     LPDWORD *lpNumberOfBytesRecvd = va_arg(vl, LPDWORD *);
02594     LPDWORD *lpFlags = va_arg(vl, LPDWORD *);
02595     struct sockaddr FAR **lpFrom = va_arg(vl, struct sockaddr FAR **);
02596     LPINT *lpFromlen = va_arg(vl, LPINT *);
02597     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
02598     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
02599       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02600     LPWSATHREADID *lpThreadId = va_arg(vl, LPWSATHREADID *);
02601     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02602
02603     _snprintf(Buffer + Index, BufLen - Index - 1,
02604             "WSPRecvFrom() %s.\r\n",
02605              PreOrPost ? "called" : "returned");
02606     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02607     return(FALSE);
02608 }
02609
02610
02611 BOOL CALLBACK
02612 DTHandler_WSPSelect(
02613     IN     va_list vl,
02614     IN OUT LPVOID  ReturnValue,
02615     IN     LPSTR   LibraryName,
02616     OUT    char    *Buffer,
02617     IN     int     Index,
02618     IN     int     BufLen,
02619     IN     BOOL    PreOrPost)
02620 {
02621     INT *RetVal = (INT *)ReturnValue;
02622     INT *nfds = va_arg(vl, INT *);
02623     fd_set FAR **readfds = va_arg(vl, fd_set FAR **);
02624     fd_set FAR **writefds = va_arg(vl, fd_set FAR **);
02625     fd_set FAR **exceptfds = va_arg(vl, fd_set FAR **);
02626     struct timeval FAR **timeout = va_arg(vl, struct timeval FAR **);
02627     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02628
02629     _snprintf(Buffer + Index, BufLen - Index - 1,
02630             "WSPSelect() %s.\r\n",
02631              PreOrPost ? "called" : "returned");
02632     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02633     return(FALSE);
02634 }
02635
02636
02637 BOOL CALLBACK
02638 DTHandler_WSPSend(
02639     IN     va_list vl,
02640     IN OUT LPVOID  ReturnValue,
02641     IN     LPSTR   LibraryName,
02642     OUT    char    *Buffer,
02643     IN     int     Index,
02644     IN     int     BufLen,
02645     IN     BOOL    PreOrPost)
02646 {
02647     INT *RetVal = (INT *)ReturnValue;
02648     SOCKET *s = va_arg(vl, SOCKET *);
02649     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
02650     DWORD *dwBufferCount = va_arg(vl, DWORD *);
02651     LPDWORD *lpNumberOfBytesSent = va_arg(vl, LPDWORD *);
02652     DWORD *dwFlags = va_arg(vl, DWORD *);
02653     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
02654     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
02655       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02656     LPWSATHREADID *lpThreadId = va_arg(vl, LPWSATHREADID *);
02657     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02658
02659     _snprintf(Buffer + Index, BufLen - Index - 1,
02660             "WSPSend() %s.\r\n",
02661              PreOrPost ? "called" : "returned");
02662     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02663     return(FALSE);
02664 }
02665
02666
02667 BOOL CALLBACK
02668 DTHandler_WSPSendDisconnect(
02669     IN     va_list vl,
02670     IN OUT LPVOID  ReturnValue,
02671     IN     LPSTR   LibraryName,
02672     OUT    char    *Buffer,
02673     IN     int     Index,
02674     IN     int     BufLen,
02675     IN     BOOL    PreOrPost)
02676 {
02677     INT *RetVal = (INT *)ReturnValue;
02678     SOCKET *s = va_arg(vl, SOCKET *);
02679     LPWSABUF *lpOutboundDisconnectData = va_arg(vl, LPWSABUF *);
02680     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02681
02682     _snprintf(Buffer + Index, BufLen - Index - 1,
02683             "WSPSendDisconnect() %s.\r\n",
02684              PreOrPost ? "called" : "returned");
02685     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02686     return(FALSE);
02687 }
02688
02689
02690 BOOL CALLBACK
02691 DTHandler_WSPSendTo(
02692     IN     va_list vl,
02693     IN OUT LPVOID  ReturnValue,
02694     IN     LPSTR   LibraryName,
02695     OUT    char    *Buffer,
02696     IN     int     Index,
02697     IN     int     BufLen,
02698     IN     BOOL    PreOrPost)
02699 {
02700     INT *RetVal = (INT *)ReturnValue;
02701     SOCKET *s = va_arg(vl, SOCKET *);
02702     LPWSABUF *lpBuffers = va_arg(vl, LPWSABUF *);
02703     DWORD *dbBufferCount = va_arg(vl, DWORD *);
02704     LPDWORD *lpNumberOfBytesSent = va_arg(vl, LPDWORD *);
02705     DWORD *dwFlags = va_arg(vl, DWORD *);
02706     struct sockaddr FAR **lpTo = va_arg(vl, struct sockaddr FAR **);
02707     INT *iTolen = va_arg(vl, INT *);
02708     LPWSAOVERLAPPED *lpOverlapped = va_arg(vl, LPWSAOVERLAPPED *);
02709     LPWSAOVERLAPPED_COMPLETION_ROUTINE *lpCompletionRoutine =
02710       va_arg(vl, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02711     LPWSATHREADID *lpThreadId = va_arg(vl, LPWSATHREADID *);
02712     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02713
02714     _snprintf(Buffer + Index, BufLen - Index - 1,
02715             "WSPSendTo() %s.\r\n",
02716              PreOrPost ? "called" : "returned");
02717     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02718     return(FALSE);
02719 }
02720
02721
02722 BOOL CALLBACK
02723 DTHandler_WSPSetSockOpt(
02724     IN     va_list vl,
02725     IN OUT LPVOID  ReturnValue,
02726     IN     LPSTR   LibraryName,
02727     OUT    char    *Buffer,
02728     IN     int     Index,
02729     IN     int     BufLen,
02730     IN     BOOL    PreOrPost)
02731 {
02732     INT *RetVal = (INT *)ReturnValue;
02733     SOCKET *s = va_arg(vl, SOCKET *);
02734     INT *level = va_arg(vl, INT *);
02735     INT *optname = va_arg(vl, INT *);
02736     char FAR **optval = va_arg(vl, char FAR **);
02737     INT *optlen = va_arg(vl, INT *);
02738     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02739
02740     _snprintf(Buffer + Index, BufLen - Index - 1,
02741             "WSPSetSockOpt() %s.\r\n",
02742              PreOrPost ? "called" : "returned");
02743     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02744     return(FALSE);
02745 }
02746
02747
02748 BOOL CALLBACK
02749 DTHandler_WSPShutdown(
02750     IN     va_list vl,
02751     IN OUT LPVOID  ReturnValue,
02752     IN     LPSTR   LibraryName,
02753     OUT    char    *Buffer,
02754     IN     int     Index,
02755     IN     int     BufLen,
02756     IN     BOOL    PreOrPost)
02757 {
02758     INT *RetVal = (INT *)ReturnValue;
02759     SOCKET *s = va_arg(vl, SOCKET *);
02760     INT *how = va_arg(vl, INT *);
02761     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02762
02763     _snprintf(Buffer + Index, BufLen - Index - 1,
02764             "WSPShutdown() %s.\r\n",
02765              PreOrPost ? "called" : "returned");
02766     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02767     return(FALSE);
02768 }
02769
02770
02771 BOOL CALLBACK
02772 DTHandler_WSPSocket(
02773     IN     va_list vl,
02774     IN OUT LPVOID  ReturnValue,
02775     IN     LPSTR   LibraryName,
02776     OUT    char    *Buffer,
02777     IN     int     Index,
02778     IN     int     BufLen,
02779     IN     BOOL    PreOrPost)
02780 {
02781     INT *RetVal = (INT *)ReturnValue;
02782     int *af = va_arg(vl, int *);
02783     int *type = va_arg(vl, int *);
02784     int *protocol = va_arg(vl, int *);
02785     LPWSAPROTOCOL_INFO *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFO *);
02786     GROUP *g = va_arg(vl, GROUP *);
02787     DWORD *dwFlags = va_arg(vl, DWORD *);
02788     INT FAR **lpErrno = va_arg(vl, INT FAR **);
02789
02790     _snprintf(Buffer + Index, BufLen - Index - 1,
02791             "WSPSocket() %s.\r\n",
02792              PreOrPost ? "called" : "returned");
02793     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02794     return(FALSE);
02795 }
02796
02797
02798 BOOL CALLBACK
02799 DTHandler_WSPStartup(
02800     IN     va_list vl,
02801     IN OUT LPVOID  ReturnValue,
02802     IN     LPSTR   LibraryName,
02803     OUT    char    *Buffer,
02804     IN     int     Index,
02805     IN     int     BufLen,
02806     IN     BOOL    PreOrPost)
02807 {
02808     int *RetVal = (int *)ReturnValue;
02809     WORD *wVersionRequested = va_arg(vl, WORD *);
02810     LPWSPDATA *lpWSPData = va_arg(vl, LPWSPDATA *);
02811     LPWSAPROTOCOL_INFOA *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOA *);
02812     WSPUPCALLTABLE *UpcallTable = va_arg(vl, WSPUPCALLTABLE *);
02813     LPWSPPROC_TABLE *lpProcTable = va_arg(vl, LPWSPPROC_TABLE *);
02814
02815     _snprintf(Buffer + Index, BufLen - Index - 1,
02816             "WSPStartup() %s.\r\n",
02817              PreOrPost ? "called" : "returned");
02818     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02819     return(FALSE);
02820 }
02821
02822
02823 BOOL CALLBACK
02824 DTHandler_WPUCloseEvent(
02825     IN     va_list vl,
02826     IN OUT LPVOID  ReturnValue,
02827     IN     LPSTR   LibraryName,
02828     OUT    char    *Buffer,
02829     IN     int     Index,
02830     IN     int     BufLen,
02831     IN     BOOL    PreOrPost)
02832 {
02833     BOOL *RetVal = (BOOL *)ReturnValue;
02834     WSAEVENT *hEvent = va_arg(vl, WSAEVENT *);
02835     LPINT *lpErrno = va_arg(vl, LPINT *);
02836
02837     _snprintf(Buffer + Index, BufLen - Index - 1,
02838             "WPUCloseEvent() %s.\r\n",
02839              PreOrPost ? "called" : "returned");
02840     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02841     return(FALSE);
02842 }
02843
02844
02845 BOOL CALLBACK
02846 DTHandler_WPUCloseSocketHandle(
02847     IN     va_list vl,
02848     IN OUT LPVOID  ReturnValue,
02849     IN     LPSTR   LibraryName,
02850     OUT    char    *Buffer,
02851     IN     int     Index,
02852     IN     int     BufLen,
02853     IN     BOOL    PreOrPost)
02854 {
02855     int *RetVal = (int *)ReturnValue;
02856     SOCKET *s = va_arg(vl, SOCKET *);
02857     LPINT *lpErrno = va_arg(vl, LPINT *);
02858
02859     _snprintf(Buffer + Index, BufLen - Index - 1,
02860             "WPUCloseSocketHandle() %s.\r\n",
02861              PreOrPost ? "called" : "returned");
02862     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02863     return(FALSE);
02864 }
02865
02866
02867 BOOL CALLBACK
02868 DTHandler_WPUCreateEvent(
02869     IN     va_list vl,
02870     IN OUT LPVOID  ReturnValue,
02871     IN     LPSTR   LibraryName,
02872     OUT    char    *Buffer,
02873     IN     int     Index,
02874     IN     int     BufLen,
02875     IN     BOOL    PreOrPost)
02876 {
02877     WSAEVENT *RetVal = (WSAEVENT *)ReturnValue;
02878     LPINT *lpErrno = va_arg(vl, LPINT *);
02879
02880     _snprintf(Buffer + Index, BufLen - Index - 1,
02881             "WPUCreateEvent() %s.\r\n",
02882              PreOrPost ? "called" : "returned");
02883     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02884     return(FALSE);
02885 }
02886
02887
02888 BOOL CALLBACK
02889 DTHandler_WPUCreateSocketHandle(
02890     IN     va_list vl,
02891     IN OUT LPVOID  ReturnValue,
02892     IN     LPSTR   LibraryName,
02893     OUT    char    *Buffer,
02894     IN     int     Index,
02895     IN     int     BufLen,
02896     IN     BOOL    PreOrPost)
02897 {
02898     SOCKET *RetVal = (SOCKET *)ReturnValue;
02899     DWORD *dwCatalogEntryId = va_arg(vl, DWORD *);
02900     DWORD *dwContext = va_arg(vl, DWORD *);
02901     LPINT *lpErrno = va_arg(vl, LPINT *);
02902
02903     _snprintf(Buffer + Index, BufLen - Index - 1,
02904             "WPUCreateSocketHandle() %s.\r\n",
02905              PreOrPost ? "called" : "returned");
02906     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02907     return(FALSE);
02908 }
02909
02910
02911 BOOL CALLBACK
02912 DTHandler_WSCDeinstallProvider(
02913     IN     va_list vl,
02914     IN OUT LPVOID  ReturnValue,
02915     IN     LPSTR   LibraryName,
02916     OUT    char    *Buffer,
02917     IN     int     Index,
02918     IN     int     BufLen,
02919     IN     BOOL    PreOrPost)
02920 {
02921     int *RetVal = (int *)ReturnValue;
02922     DWORD *dwProviderId = va_arg(vl, DWORD *);
02923     LPINT *lpErrno = va_arg(vl, LPINT *);
02924
02925     _snprintf(Buffer + Index, BufLen - Index - 1,
02926             "WSCDeinstallProvider() %s.\r\n",
02927              PreOrPost ? "called" : "returned");
02928     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02929     return(FALSE);
02930 }
02931
02932
02933 BOOL CALLBACK
02934 DTHandler_WSCInstallProvider(
02935     IN     va_list vl,
02936     IN OUT LPVOID  ReturnValue,
02937     IN     LPSTR   LibraryName,
02938     OUT    char    *Buffer,
02939     IN     int     Index,
02940     IN     int     BufLen,
02941     IN     BOOL    PreOrPost)
02942 {
02943     int *RetVal = (int *)ReturnValue;
02944     char FAR **lpszProviderName = va_arg(vl, char FAR **);
02945     char FAR **lpszProviderDllPath = va_arg(vl, char FAR **);
02946     LPWSAPROTOCOL_INFO *lpProtocolInfoList = va_arg(vl, LPWSAPROTOCOL_INFO *);
02947     DWORD *dwNumberOfEntries = va_arg(vl, DWORD *);
02948     LPDWORD *lpdwProviderId = va_arg(vl, LPDWORD *);
02949     LPINT *lpErrno = va_arg(vl, LPINT *);
02950
02951     _snprintf(Buffer + Index, BufLen - Index - 1,
02952             "WSCInstallProvider() %s.\r\n",
02953          PreOrPost ? "called" : "returned");
02954     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02955     return(FALSE);
02956 }
02957
02958
02959 BOOL CALLBACK
02960 DTHandler_WPUModifyIFSHandle(
02961     IN     va_list vl,
02962     IN OUT LPVOID  ReturnValue,
02963     IN     LPSTR   LibraryName,
02964     OUT    char    *Buffer,
02965     IN     int     Index,
02966     IN     int     BufLen,
02967     IN     BOOL    PreOrPost)
02968 {
02969     SOCKET *RetVal = (SOCKET *)ReturnValue;
02970     DWORD *dwCatalogEntryId = va_arg(vl, DWORD *);
02971     SOCKET *ProposedHandle = va_arg(vl, SOCKET *);
02972     LPINT *lpErrno = va_arg(vl, LPINT *);
02973
02974     _snprintf(Buffer + Index, BufLen - Index - 1,
02975             "WPUModifyIFSHandle() %s.\r\n",
02976              PreOrPost ? "called" : "returned");
02977     DTTextOut( LogFileHandle, Buffer, OutputStyle);
02978     return(FALSE);
02979 }
02980
02981
02982 BOOL CALLBACK
02983 DTHandler_WPUQueryBlockingCallback(
02984     IN     va_list vl,
02985     IN OUT LPVOID  ReturnValue,
02986     IN     LPSTR   LibraryName,
02987     OUT    char    *Buffer,
02988     IN     int     Index,
02989     IN     int     BufLen,
02990     IN     BOOL    PreOrPost)
02991 {
02992     int *RetVal = (int *)ReturnValue;
02993     DWORD *dwCatalogEntryId = va_arg(vl, DWORD *);
02994     LPBLOCKINGCALLBACK FAR **lplpfnCallback =
02995       va_arg(vl, LPBLOCKINGCALLBACK FAR **);
02996     LPDWORD *lpdwContext = va_arg(vl, LPDWORD *);
02997     LPINT *lpErrno = va_arg(vl, LPINT *);
02998
02999     _snprintf(Buffer + Index, BufLen - Index - 1,
03000             "WPUQueryBlockingCallback() %s.\r\n",
03001              PreOrPost ? "called" : "returned");
03002     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03003     return(FALSE);
03004 }
03005
03006
03007 BOOL CALLBACK
03008 DTHandler_WPUQuerySocketHandleContext(
03009     IN     va_list vl,
03010     IN OUT LPVOID  ReturnValue,
03011     IN     LPSTR   LibraryName,
03012     OUT    char    *Buffer,
03013     IN     int     Index,
03014     IN     int     BufLen,
03015     IN     BOOL    PreOrPost)
03016 {
03017     int *RetVal = (int *)ReturnValue;
03018     SOCKET *s = va_arg(vl, SOCKET *);
03019     LPDWORD *lpContext = va_arg(vl, LPDWORD *);
03020     LPINT *lpErrno = va_arg(vl, LPINT *);
03021
03022     _snprintf(Buffer + Index, BufLen - Index - 1,
03023             "WPUQuerySocketHandleContext() %s.\r\n",
03024              PreOrPost ? "called" : "returned");
03025     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03026     return(FALSE);
03027 }
03028
03029
03030 BOOL CALLBACK
03031 DTHandler_WPUQueueApc(
03032     IN     va_list vl,
03033     IN OUT LPVOID  ReturnValue,
03034     IN     LPSTR   LibraryName,
03035     OUT    char    *Buffer,
03036     IN     int     Index,
03037     IN     int     BufLen,
03038     IN     BOOL    PreOrPost)
03039 {
03040     int *RetVal = (int *)ReturnValue;
03041     LPWSATHREADID *lpThreadId = va_arg(vl, LPWSATHREADID *);
03042     LPWSAUSERAPC *lpfnUserApc = va_arg(vl, LPWSAUSERAPC *);
03043     DWORD *dwContext = va_arg(vl, DWORD *);
03044     LPINT *lpErrno = va_arg(vl, LPINT *);
03045
03046     _snprintf(Buffer + Index, BufLen - Index - 1,
03047             "WPUQueueApc() %s.\r\n",
03048              PreOrPost ? "called" : "returned");
03049     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03050     return(FALSE);
03051 }
03052
03053
03054 BOOL CALLBACK
03055 DTHandler_WPUResetEvent(
03056     IN     va_list vl,
03057     IN OUT LPVOID  ReturnValue,
03058     IN     LPSTR   LibraryName,
03059     OUT    char    *Buffer,
03060     IN     int     Index,
03061     IN     int     BufLen,
03062     IN     BOOL    PreOrPost)
03063 {
03064     BOOL *RetVal = (BOOL *)ReturnValue;
03065     WSAEVENT *hEvent = va_arg(vl, WSAEVENT *);
03066     LPINT *lpErrno = va_arg(vl, LPINT *);
03067
03068     _snprintf(Buffer + Index, BufLen - Index - 1,
03069             "WPUResetEvent() %s.\r\n",
03070              PreOrPost ? "called" : "returned");
03071     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03072     return(FALSE);
03073 }
03074
03075
03076 BOOL CALLBACK
03077 DTHandler_WPUSetEvent(
03078     IN     va_list vl,
03079     IN OUT LPVOID  ReturnValue,
03080     IN     LPSTR   LibraryName,
03081     OUT    char    *Buffer,
03082     IN     int     Index,
03083     IN     int     BufLen,
03084     IN     BOOL    PreOrPost)
03085 {
03086     BOOL *RetVal = (BOOL *)ReturnValue;
03087     WSAEVENT *hEvent = va_arg(vl, WSAEVENT *);
03088     LPINT *lpErrno = va_arg(vl, LPINT *);
03089
03090     _snprintf(Buffer + Index, BufLen - Index - 1,
03091             "WPUSetEvent() %s.\r\n",
03092              PreOrPost ? "called" : "returned");
03093     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03094     return(FALSE);
03095 }
03096
03097
03098
03099 BOOL CALLBACK
03100 DTHandler_WPUFDIsSet(
03101     IN     va_list vl,
03102     IN OUT LPVOID  ReturnValue,
03103     IN     LPSTR   LibraryName,
03104     OUT    char    *Buffer,
03105     IN     int     Index,
03106     IN     int     BufLen,
03107     IN     BOOL    PreOrPost)
03108 {
03109     int *RetVal = (int *)ReturnValue;
03110     SOCKET *s = va_arg(vl, SOCKET *);
03111     fd_set FAR **set = va_arg(vl, fd_set FAR **);
03112
03113     _snprintf(Buffer + Index, BufLen - Index - 1,
03114             "WPUFDIsSet() %s.\r\n",
03115              PreOrPost ? "called" : "returned");
03116     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03117     return(FALSE);
03118 }
03119
03120
03121 BOOL CALLBACK
03122 DTHandler_WPUGetProviderPath(
03123     IN     va_list vl,
03124     IN OUT LPVOID  ReturnValue,
03125     IN     LPSTR   LibraryName,
03126     OUT    char    *Buffer,
03127     IN     int     Index,
03128     IN     int     BufLen,
03129     IN     BOOL    PreOrPost)
03130 {
03131     int *RetVal = (int *)ReturnValue;
03132     DWORD *dwProviderId = va_arg(vl, DWORD *);
03133     char FAR **lpszProviderDllPath = va_arg(vl, char FAR **);
03134     LPINT *lpProviderDllPathLen = va_arg(vl, LPINT *);
03135     LPINT *lpErrno = va_arg(vl, LPINT *);
03136
03137     _snprintf(Buffer + Index, BufLen - Index - 1,
03138             "WPUGetProviderPath() %s.\r\n",
03139              PreOrPost ? "called" : "returned");
03140     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03141     return(FALSE);
03142 }
03143
03144
03145 BOOL CALLBACK
03146 DTHandler_WPUPostMessage(
03147     IN     va_list vl,
03148     IN OUT LPVOID  ReturnValue,
03149     IN     LPSTR   LibraryName,
03150     OUT    char    *Buffer,
03151     IN     int     Index,
03152     IN     int     BufLen,
03153     IN     BOOL    PreOrPost)
03154 {
03155     BOOL *RetVal = (BOOL *)ReturnValue;
03156     HWND *hWnd = va_arg(vl, HWND *);
03157     UINT *Msg = va_arg(vl, UINT *);
03158     WPARAM *wParam = va_arg(vl, WPARAM *);
03159     LPARAM *lParam = va_arg(vl, LPARAM *);
03160
03161     _snprintf(Buffer + Index, BufLen - Index - 1,
03162             "WPUPostMessage() %s.\r\n",
03163              PreOrPost ? "called" : "returned");
03164     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03165     return(FALSE);
03166 }
03167
03168
03169 BOOL CALLBACK
03170 DTHandler_WSCEnumProtocols(
03171     IN     va_list vl,
03172     IN OUT LPVOID  ReturnValue,
03173     IN     LPSTR   LibraryName,
03174     OUT    char    *Buffer,
03175     IN     int     Index,
03176     IN     int     BufLen,
03177     IN     BOOL    PreOrPost)
03178 {
03179     int *RetVal = (int *)ReturnValue;
03180     LPINT *lpiProtocols = va_arg(vl, LPINT *);
03181     LPWSAPROTOCOL_INFO *lpProtocolBuffer = va_arg(vl, LPWSAPROTOCOL_INFO *);
03182     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD *);
03183     LPINT *lpErrno = va_arg(vl, LPINT *);
03184
03185     _snprintf(Buffer + Index, BufLen - Index - 1,
03186             "WSCEnumProtocols() %s.\r\n",
03187              PreOrPost ? "called" : "returned");
03188     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03189     return(FALSE);
03190 }
03191
03192
03193 BOOL CALLBACK
03194 DTHandler___WSAFDIsSet(
03195     IN     va_list vl,
03196     IN OUT LPVOID  ReturnValue,
03197     IN     LPSTR   LibraryName,
03198     OUT    char    *Buffer,
03199     IN     int     Index,
03200     IN     int     BufLen,
03201     IN     BOOL    PreOrPost)
03202 {
03203     int *RetVal = (int *)ReturnValue;
03204     SOCKET *s = va_arg(vl, SOCKET *);
03205     fd_set FAR **set = va_arg(vl, fd_set FAR **);
03206
03207     _snprintf(Buffer + Index, BufLen - Index - 1,
03208             "__WSAFDIsSet() %s.\r\n",
03209              PreOrPost ? "called" : "returned");
03210     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03211     return(FALSE);
03212 }
03213
03214
03215 BOOL CALLBACK
03216 DTHandler_WSAAddressToStringA(
03217     IN     va_list vl,
03218     IN OUT LPVOID  ReturnValue,
03219     IN     LPSTR   LibraryName,
03220     OUT    char    *Buffer,
03221     IN     int     Index,
03222     IN     int     BufLen,
03223     IN     BOOL    PreOrPost)
03224 {
03225     int *RetVal = (int *)ReturnValue;
03226     LPSOCKADDR *lpsaAddress = va_arg(vl, LPSOCKADDR *);
03227     DWORD *dwAddressLength= va_arg(vl, DWORD *);
03228     LPWSAPROTOCOL_INFOA *lpProtocolInfo= va_arg(vl, LPWSAPROTOCOL_INFOA *);
03229     LPSTR *lpszAddressString= va_arg(vl, LPSTR *);
03230     LPDWORD *lpdwAddressStringLength= va_arg(vl, LPDWORD *);
03231
03232     _snprintf(Buffer + Index, BufLen - Index - 1,
03233             "WSAAddressToStringA() %s.\r\n",
03234              PreOrPost ? "called" : "returned");
03235     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03236     return(FALSE);
03237 }
03238
03239
03240
03241 BOOL CALLBACK
03242 DTHandler_WSAAddressToStringW(
03243     IN     va_list vl,
03244     IN OUT LPVOID  ReturnValue,
03245     IN     LPSTR   LibraryName,
03246     OUT    char    *Buffer,
03247     IN     int     Index,
03248     IN     int     BufLen,
03249     IN     BOOL    PreOrPost)
03250 {
03251     int *RetVal = (int *)ReturnValue;
03252     LPSOCKADDR *lpsaAddress = va_arg(vl, LPSOCKADDR *);
03253     DWORD *dwAddressLength= va_arg(vl, DWORD *);
03254     LPWSAPROTOCOL_INFOW *lpProtocolInfo= va_arg(vl, LPWSAPROTOCOL_INFOW *);
03255     LPWSTR *lpszAddressString= va_arg(vl, LPWSTR *);
03256     LPDWORD *lpdwAddressStringLength= va_arg(vl, LPDWORD *);
03257
03258     _snprintf(Buffer + Index, BufLen - Index - 1,
03259             "WSAAddressToStringW() %s.\r\n",
03260              PreOrPost ? "called" : "returned");
03261     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03262     return(FALSE);
03263 }
03264
03265
03266
03267 BOOL CALLBACK
03268 DTHandler_WSAStringToAddressA(
03269     IN     va_list vl,
03270     IN OUT LPVOID  ReturnValue,
03271     IN     LPSTR   LibraryName,
03272     OUT    char    *Buffer,
03273     IN     int     Index,
03274     IN     int     BufLen,
03275     IN     BOOL    PreOrPost)
03276 {
03277     int *RetVal = (int *)ReturnValue;
03278     LPSTR *AddressString = va_arg(vl, LPSTR*);
03279     INT *AddressFamily = va_arg(vl, INT *);
03280     LPWSAPROTOCOL_INFOA *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOA*);
03281     LPSOCKADDR *lpAddress = va_arg(vl, LPSOCKADDR*);
03282     LPINT *lpAddressLength = va_arg(vl, LPINT*);
03283
03284     _snprintf(Buffer + Index, BufLen - Index - 1,
03285             "WSAStringToAddressA() %s.\r\n",
03286              PreOrPost ? "called" : "returned");
03287     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03288     return(FALSE);
03289 }
03290
03291
03292 BOOL CALLBACK
03293 DTHandler_WSAStringToAddressW(
03294     IN     va_list vl,
03295     IN OUT LPVOID  ReturnValue,
03296     IN     LPSTR   LibraryName,
03297     OUT    char    *Buffer,
03298     IN     int     Index,
03299     IN     int     BufLen,
03300     IN     BOOL    PreOrPost)
03301 {
03302     int *RetVal = (int *)ReturnValue;
03303     LPWSTR *AddressString = va_arg(vl, LPWSTR*);
03304     INT *AddressFamily = va_arg(vl, INT *);
03305     LPWSAPROTOCOL_INFOW *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOW*);
03306     LPSOCKADDR *lpAddress = va_arg(vl, LPSOCKADDR*);
03307     LPINT *lpAddressLength = va_arg(vl, LPINT*);
03308
03309     _snprintf(Buffer + Index, BufLen - Index - 1,
03310             "WSAStringToAddressW() %s.\r\n",
03311              PreOrPost ? "called" : "returned");
03312     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03313     return(FALSE);
03314 }
03315
03316
03317
03318 BOOL CALLBACK
03319 DTHandler_WSALookupServiceBeginA(
03320     IN     va_list vl,
03321     IN OUT LPVOID  ReturnValue,
03322     IN     LPSTR   LibraryName,
03323     OUT    char    *Buffer,
03324     IN     int     Index,
03325     IN     int     BufLen,
03326     IN     BOOL    PreOrPost)
03327 {
03328     int *RetVal = (int *)ReturnValue;
03329     LPWSAQUERYSETA *lpqsRestrictions = va_arg(vl, LPWSAQUERYSETA*);
03330     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03331     LPHANDLE *lphLookup  = va_arg(vl, LPHANDLE*);
03332
03333     _snprintf(Buffer + Index, BufLen - Index - 1,
03334             "WSALookupServiceBeginA() %s.\r\n",
03335              PreOrPost ? "called" : "returned");
03336     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03337     return(FALSE);
03338 }
03339
03340
03341 BOOL CALLBACK
03342 DTHandler_WSALookupServiceBeginW(
03343     IN     va_list vl,
03344     IN OUT LPVOID  ReturnValue,
03345     IN     LPSTR   LibraryName,
03346     OUT    char    *Buffer,
03347     IN     int     Index,
03348     IN     int     BufLen,
03349     IN     BOOL    PreOrPost)
03350 {
03351     int *RetVal = (int *)ReturnValue;
03352     LPWSAQUERYSETW *lpqsRestrictions = va_arg(vl, LPWSAQUERYSETW*);
03353     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03354     LPHANDLE *lphLookup  = va_arg(vl, LPHANDLE*);
03355
03356     _snprintf(Buffer + Index, BufLen - Index - 1,
03357             "WSALookupServiceBeginW() %s.\r\n",
03358              PreOrPost ? "called" : "returned");
03359     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03360     return(FALSE);
03361 }
03362
03363
03364
03365 BOOL CALLBACK
03366 DTHandler_WSALookupServiceNextA(
03367     IN     va_list vl,
03368     IN OUT LPVOID  ReturnValue,
03369     IN     LPSTR   LibraryName,
03370     OUT    char    *Buffer,
03371     IN     int     Index,
03372     IN     int     BufLen,
03373     IN     BOOL    PreOrPost)
03374 {
03375     int *RetVal = (int *)ReturnValue;
03376     HANDLE *hLookup = va_arg(vl, HANDLE*);
03377     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03378     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03379     LPWSAQUERYSETA *lpqsResults = va_arg(vl, LPWSAQUERYSETA*);
03380
03381     _snprintf(Buffer + Index, BufLen - Index - 1,
03382             "WSALookupServiceNextA() %s.\r\n",
03383              PreOrPost ? "called" : "returned");
03384     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03385     return(FALSE);
03386 }
03387
03388
03389 BOOL CALLBACK
03390 DTHandler_WSALookupServiceNextW(
03391     IN     va_list vl,
03392     IN OUT LPVOID  ReturnValue,
03393     IN     LPSTR   LibraryName,
03394     OUT    char    *Buffer,
03395     IN     int     Index,
03396     IN     int     BufLen,
03397     IN     BOOL    PreOrPost)
03398 {
03399     int *RetVal = (int *)ReturnValue;
03400     HANDLE *hLookup = va_arg(vl, HANDLE*);
03401     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03402     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03403     LPWSAQUERYSETW *lpqsResults = va_arg(vl, LPWSAQUERYSETW*);
03404
03405     _snprintf(Buffer + Index, BufLen - Index - 1,
03406             "WSALookupServiceNextW() %s.\r\n",
03407              PreOrPost ? "called" : "returned");
03408     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03409     return(FALSE);
03410 }
03411
03412
03413
03414
03415 BOOL CALLBACK
03416 DTHandler_WSALookupServiceEnd(
03417     IN     va_list vl,
03418     IN OUT LPVOID  ReturnValue,
03419     IN     LPSTR   LibraryName,
03420     OUT    char    *Buffer,
03421     IN     int     Index,
03422     IN     int     BufLen,
03423     IN     BOOL    PreOrPost)
03424 {
03425     int *RetVal = (int *)ReturnValue;
03426     HANDLE *hLookup = va_arg(vl, HANDLE*);
03427
03428     _snprintf(Buffer + Index, BufLen - Index - 1,
03429             "WSALookupServiceEnd() %s.\r\n",
03430              PreOrPost ? "called" : "returned");
03431     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03432     return(FALSE);
03433 }
03434
03435
03436
03437
03438 BOOL CALLBACK
03439 DTHandler_WSAGetAddressByNameA(
03440     IN     va_list vl,
03441     IN OUT LPVOID  ReturnValue,
03442     IN     LPSTR   LibraryName,
03443     OUT    char    *Buffer,
03444     IN     int     Index,
03445     IN     int     BufLen,
03446     IN     BOOL    PreOrPost)
03447 {
03448     int *RetVal = (int *)ReturnValue;
03449     LPSTR *lpszServiceInstanceName = va_arg(vl, LPSTR*);
03450     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03451     DWORD *dwNameSpace = va_arg(vl, DWORD*);
03452     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03453     LPWSAQUERYSETA *lpqsResults = va_arg(vl, LPWSAQUERYSETA*);
03454     DWORD *dwResolution = va_arg(vl, DWORD*);
03455     LPSTR *lpszAliasBuffer = va_arg(vl, LPSTR*);
03456     LPDWORD *lpdwAliasBufferLength  = va_arg(vl, LPDWORD*);
03457
03458     _snprintf(Buffer + Index, BufLen - Index - 1,
03459             "WSAGetAddressByNameA() %s.\r\n",
03460              PreOrPost ? "called" : "returned");
03461     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03462     return(FALSE);
03463 }
03464
03465
03466 BOOL CALLBACK
03467 DTHandler_WSAGetAddressByNameW(
03468     IN     va_list vl,
03469     IN OUT LPVOID  ReturnValue,
03470     IN     LPSTR   LibraryName,
03471     OUT    char    *Buffer,
03472     IN     int     Index,
03473     IN     int     BufLen,
03474     IN     BOOL    PreOrPost)
03475 {
03476     int *RetVal = (int *)ReturnValue;
03477     LPWSTR *lpszServiceInstanceName = va_arg(vl, LPWSTR*);
03478     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03479     DWORD *dwNameSpace = va_arg(vl, DWORD*);
03480     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03481     LPWSAQUERYSETW *lpqsResults = va_arg(vl, LPWSAQUERYSETW*);
03482     DWORD *dwResolution = va_arg(vl, DWORD*);
03483     LPWSTR *lpszAliasBuffer = va_arg(vl, LPWSTR*);
03484     LPDWORD *lpdwAliasBufferLength  = va_arg(vl, LPDWORD*);
03485
03486     _snprintf(Buffer + Index, BufLen - Index - 1,
03487             "WSAGetAddressByNameW() %s.\r\n",
03488              PreOrPost ? "called" : "returned");
03489     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03490     return(FALSE);
03491 }
03492
03493
03494
03495
03496 BOOL CALLBACK
03497 DTHandler_WSAInstallServiceClassA(
03498     IN     va_list vl,
03499     IN OUT LPVOID  ReturnValue,
03500     IN     LPSTR   LibraryName,
03501     OUT    char    *Buffer,
03502     IN     int     Index,
03503     IN     int     BufLen,
03504     IN     BOOL    PreOrPost)
03505 {
03506     int *RetVal = (int *)ReturnValue;
03507     LPWSASERVICECLASSINFOA *lpServiceClassInfo =
03508         va_arg(vl, LPWSASERVICECLASSINFOA*);
03509
03510     _snprintf(Buffer + Index, BufLen - Index - 1,
03511             "WSAInstallServiceClassA() %s.\r\n",
03512              PreOrPost ? "called" : "returned");
03513     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03514     return(FALSE);
03515 }
03516
03517
03518 BOOL CALLBACK
03519 DTHandler_WSAInstallServiceClassW(
03520     IN     va_list vl,
03521     IN OUT LPVOID  ReturnValue,
03522     IN     LPSTR   LibraryName,
03523     OUT    char    *Buffer,
03524     IN     int     Index,
03525     IN     int     BufLen,
03526     IN     BOOL    PreOrPost)
03527 {
03528     int *RetVal = (int *)ReturnValue;
03529     LPWSASERVICECLASSINFOW *lpServiceClassInfo =
03530         va_arg(vl, LPWSASERVICECLASSINFOW*);
03531
03532     _snprintf(Buffer + Index, BufLen - Index - 1,
03533             "WSAInstallServiceClassW() %s.\r\n",
03534              PreOrPost ? "called" : "returned");
03535     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03536     return(FALSE);
03537 }
03538
03539
03540
03541 BOOL CALLBACK
03542 DTHandler_WSASetServiceA(
03543     IN     va_list vl,
03544     IN OUT LPVOID  ReturnValue,
03545     IN     LPSTR   LibraryName,
03546     OUT    char    *Buffer,
03547     IN     int     Index,
03548     IN     int     BufLen,
03549     IN     BOOL    PreOrPost)
03550 {
03551     int *RetVal = (int *)ReturnValue;
03552     LPWSAQUERYSETA *lpqsRegInfo = va_arg(vl, LPWSAQUERYSETA*);
03553     WSAESETSERVICEOP *essOperation = va_arg(vl, WSAESETSERVICEOP*);
03554     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03555
03556     _snprintf(Buffer + Index, BufLen - Index - 1,
03557             "WSASetServiceA() %s.\r\n",
03558              PreOrPost ? "called" : "returned");
03559     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03560     return(FALSE);
03561 }
03562
03563
03564
03565 BOOL CALLBACK
03566 DTHandler_WSASetServiceW(
03567     IN     va_list vl,
03568     IN OUT LPVOID  ReturnValue,
03569     IN     LPSTR   LibraryName,
03570     OUT    char    *Buffer,
03571     IN     int     Index,
03572     IN     int     BufLen,
03573     IN     BOOL    PreOrPost)
03574 {
03575     int *RetVal = (int *)ReturnValue;
03576     LPWSAQUERYSETW *lpqsRegInfo = va_arg(vl, LPWSAQUERYSETW*);
03577     WSAESETSERVICEOP *essOperation = va_arg(vl, WSAESETSERVICEOP*);
03578     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03579
03580     _snprintf(Buffer + Index, BufLen - Index - 1,
03581             "WSASetServiceW() %s.\r\n",
03582              PreOrPost ? "called" : "returned");
03583     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03584     return(FALSE);
03585 }
03586
03587
03588
03589 BOOL CALLBACK
03590 DTHandler_WSARemoveServiceClass(
03591     IN     va_list vl,
03592     IN OUT LPVOID  ReturnValue,
03593     IN     LPSTR   LibraryName,
03594     OUT    char    *Buffer,
03595     IN     int     Index,
03596     IN     int     BufLen,
03597     IN     BOOL    PreOrPost)
03598 {
03599     int *RetVal = (int *)ReturnValue;
03600     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03601
03602     _snprintf(Buffer + Index, BufLen - Index - 1,
03603             "WSARemoveServiceClass() %s.\r\n",
03604              PreOrPost ? "called" : "returned");
03605     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03606     return(FALSE);
03607 }
03608
03609
03610
03611
03612 BOOL CALLBACK
03613 DTHandler_WSAGetServiceClassInfoA(
03614     IN     va_list vl,
03615     IN OUT LPVOID  ReturnValue,
03616     IN     LPSTR   LibraryName,
03617     OUT    char    *Buffer,
03618     IN     int     Index,
03619     IN     int     BufLen,
03620     IN     BOOL    PreOrPost)
03621 {
03622     int *RetVal = (int *)ReturnValue;
03623     LPGUID *lpProviderId = va_arg(vl, LPGUID*);
03624     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03625     LPDWORD *lpdwBufSize = va_arg(vl, LPDWORD*);
03626     LPWSASERVICECLASSINFOA *lpServiceClassInfo =
03627         va_arg(vl, LPWSASERVICECLASSINFOA*);
03628
03629     _snprintf(Buffer + Index, BufLen - Index - 1,
03630             "WSAGetServiceClassInfoA() %s.\r\n",
03631              PreOrPost ? "called" : "returned");
03632     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03633     return(FALSE);
03634 }
03635
03636
03637
03638 BOOL CALLBACK
03639 DTHandler_WSAGetServiceClassInfoW(
03640     IN     va_list vl,
03641     IN OUT LPVOID  ReturnValue,
03642     IN     LPSTR   LibraryName,
03643     OUT    char    *Buffer,
03644     IN     int     Index,
03645     IN     int     BufLen,
03646     IN     BOOL    PreOrPost)
03647 {
03648     int *RetVal = (int *)ReturnValue;
03649     LPGUID *lpProviderId = va_arg(vl, LPGUID*);
03650     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03651     LPDWORD *lpdwBufSize = va_arg(vl, LPDWORD*);
03652     LPWSASERVICECLASSINFOW *lpServiceClassInfo =
03653         va_arg(vl, LPWSASERVICECLASSINFOW*);
03654
03655     _snprintf(Buffer + Index, BufLen - Index - 1,
03656             "WSAGetServiceClassInfoW() %s.\r\n",
03657              PreOrPost ? "called" : "returned");
03658     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03659     return(FALSE);
03660 }
03661
03662
03663
03664
03665 BOOL CALLBACK
03666 DTHandler_WSAEnumNameSpaceProvidersA(
03667     IN     va_list vl,
03668     IN OUT LPVOID  ReturnValue,
03669     IN     LPSTR   LibraryName,
03670     OUT    char    *Buffer,
03671     IN     int     Index,
03672     IN     int     BufLen,
03673     IN     BOOL    PreOrPost)
03674 {
03675     int *RetVal = (int *)ReturnValue;
03676     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03677     LPWSANAMESPACE_INFOA *Lpnspbuffer = va_arg(vl,  LPWSANAMESPACE_INFOA*);
03678
03679     _snprintf(Buffer + Index, BufLen - Index - 1,
03680             "WSAEnumNameSpaceProvidersA() %s.\r\n",
03681              PreOrPost ? "called" : "returned");
03682     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03683     return(FALSE);
03684 }
03685
03686
03687 BOOL CALLBACK
03688 DTHandler_WSAEnumNameSpaceProvidersW(
03689     IN     va_list vl,
03690     IN OUT LPVOID  ReturnValue,
03691     IN     LPSTR   LibraryName,
03692     OUT    char    *Buffer,
03693     IN     int     Index,
03694     IN     int     BufLen,
03695     IN     BOOL    PreOrPost)
03696 {
03697     int *RetVal = (int *)ReturnValue;
03698     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03699     LPWSANAMESPACE_INFOW *Lpnspbuffer = va_arg(vl,  LPWSANAMESPACE_INFOW*);
03700
03701     _snprintf(Buffer + Index, BufLen - Index - 1,
03702             "WSAEnumNameSpaceProvidersW() %s.\r\n",
03703              PreOrPost ? "called" : "returned");
03704     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03705     return(FALSE);
03706 }
03707
03708
03709
03710
03711 BOOL CALLBACK
03712 DTHandler_WSAGetServiceClassNameByClassIdA(
03713     IN     va_list vl,
03714     IN OUT LPVOID  ReturnValue,
03715     IN     LPSTR   LibraryName,
03716     OUT    char    *Buffer,
03717     IN     int     Index,
03718     IN     int     BufLen,
03719     IN     BOOL    PreOrPost)
03720 {
03721     int *RetVal = (int *)ReturnValue;
03722     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03723     LPSTR *lpszServiceClassName = va_arg(vl, LPSTR*);
03724     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03725
03726     _snprintf(Buffer + Index, BufLen - Index - 1,
03727             "WSAGetServiceClassNameByClassIdA() %s.\r\n",
03728              PreOrPost ? "called" : "returned");
03729     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03730     return(FALSE);
03731 }
03732
03733
03734 BOOL CALLBACK
03735 DTHandler_WSAGetServiceClassNameByClassIdW(
03736     IN     va_list vl,
03737     IN OUT LPVOID  ReturnValue,
03738     IN     LPSTR   LibraryName,
03739     OUT    char    *Buffer,
03740     IN     int     Index,
03741     IN     int     BufLen,
03742     IN     BOOL    PreOrPost)
03743 {
03744     int *RetVal = (int *)ReturnValue;
03745     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03746     LPWSTR *lpszServiceClassName = va_arg(vl, LPWSTR*);
03747     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03748
03749     _snprintf(Buffer + Index, BufLen - Index - 1,
03750             "WSAGetServiceClassNameByClassIdW() %s.\r\n",
03751              PreOrPost ? "called" : "returned");
03752     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03753     return(FALSE);
03754 }
03755
03756 BOOL CALLBACK
03757 DTHandler_NSPAddressToString(
03758     IN     va_list vl,
03759     IN OUT LPVOID  ReturnValue,
03760     IN     LPSTR   LibraryName,
03761     OUT    char    *Buffer,
03762     IN     int     Index,
03763     IN     int     BufLen,
03764     IN     BOOL    PreOrPost)
03765 {
03766     int *RetVal = (int *)ReturnValue;
03767     LPSOCKADDR *lpsaAddress = va_arg(vl, LPSOCKADDR *);
03768     DWORD *dwAddressLength= va_arg(vl, DWORD *);
03769     LPWSAPROTOCOL_INFOW *lpProtocolInfo= va_arg(vl, LPWSAPROTOCOL_INFOW *);
03770     LPWSTR *lpszAddressString= va_arg(vl, LPWSTR *);
03771     LPDWORD *lpdwAddressStringLength= va_arg(vl, LPDWORD *);
03772
03773     _snprintf(Buffer + Index, BufLen - Index - 1,
03774             "NSPAddressToString() %s.\r\n",
03775              PreOrPost ? "called" : "returned");
03776     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03777     return(FALSE);
03778 }
03779
03780
03781
03782 BOOL CALLBACK
03783 DTHandler_NSPStringToAddress(
03784     IN     va_list vl,
03785     IN OUT LPVOID  ReturnValue,
03786     IN     LPSTR   LibraryName,
03787     OUT    char    *Buffer,
03788     IN     int     Index,
03789     IN     int     BufLen,
03790     IN     BOOL    PreOrPost)
03791 {
03792     int *RetVal = (int *)ReturnValue;
03793     LPWSTR *AddressString = va_arg(vl, LPWSTR*);
03794     INT *AddressFamily = va_arg(vl, INT *);
03795     LPWSAPROTOCOL_INFOW *lpProtocolInfo = va_arg(vl, LPWSAPROTOCOL_INFOW*);
03796     LPSOCKADDR *lpAddress = va_arg(vl, LPSOCKADDR*);
03797     LPINT *lpAddressLength = va_arg(vl, LPINT*);
03798
03799     _snprintf(Buffer + Index, BufLen - Index - 1,
03800             "NSPStringToAddress() %s.\r\n",
03801              PreOrPost ? "called" : "returned");
03802     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03803     return(FALSE);
03804 }
03805
03806
03807
03808 BOOL CALLBACK
03809 DTHandler_NSPLookupServiceBegin(
03810     IN     va_list vl,
03811     IN OUT LPVOID  ReturnValue,
03812     IN     LPSTR   LibraryName,
03813     OUT    char    *Buffer,
03814     IN     int     Index,
03815     IN     int     BufLen,
03816     IN     BOOL    PreOrPost)
03817 {
03818     int *RetVal = (int *)ReturnValue;
03819     LPWSAQUERYSETW *lpqsRestrictions = va_arg(vl, LPWSAQUERYSETW*);
03820     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03821     LPHANDLE *lphLookup  = va_arg(vl, LPHANDLE*);
03822
03823     _snprintf(Buffer + Index, BufLen - Index - 1,
03824             "NSPLookupServiceBegin() %s.\r\n",
03825              PreOrPost ? "called" : "returned");
03826     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03827     return(FALSE);
03828 }
03829
03830
03831
03832 BOOL CALLBACK
03833 DTHandler_NSPLookupServiceNext(
03834     IN     va_list vl,
03835     IN OUT LPVOID  ReturnValue,
03836     IN     LPSTR   LibraryName,
03837     OUT    char    *Buffer,
03838     IN     int     Index,
03839     IN     int     BufLen,
03840     IN     BOOL    PreOrPost)
03841 {
03842     int *RetVal = (int *)ReturnValue;
03843     HANDLE *hLookup = va_arg(vl, HANDLE*);
03844     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03845     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03846     LPWSAQUERYSETW *lpqsResults = va_arg(vl, LPWSAQUERYSETW*);
03847
03848     _snprintf(Buffer + Index, BufLen - Index - 1,
03849             "NSPLookupServiceNext() %s.\r\n",
03850              PreOrPost ? "called" : "returned");
03851     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03852     return(FALSE);
03853 }
03854
03855
03856
03857
03858 BOOL CALLBACK
03859 DTHandler_NSPLookupServiceEnd(
03860     IN     va_list vl,
03861     IN OUT LPVOID  ReturnValue,
03862     IN     LPSTR   LibraryName,
03863     OUT    char    *Buffer,
03864     IN     int     Index,
03865     IN     int     BufLen,
03866     IN     BOOL    PreOrPost)
03867 {
03868     int *RetVal = (int *)ReturnValue;
03869     HANDLE *hLookup = va_arg(vl, HANDLE*);
03870
03871     _snprintf(Buffer + Index, BufLen - Index - 1,
03872             "NSPLookupServiceEnd() %s.\r\n",
03873              PreOrPost ? "called" : "returned");
03874     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03875     return(FALSE);
03876 }
03877
03878
03879
03880 BOOL CALLBACK
03881 DTHandler_NSPGetAddressByName(
03882     IN     va_list vl,
03883     IN OUT LPVOID  ReturnValue,
03884     IN     LPSTR   LibraryName,
03885     OUT    char    *Buffer,
03886     IN     int     Index,
03887     IN     int     BufLen,
03888     IN     BOOL    PreOrPost)
03889 {
03890     int *RetVal = (int *)ReturnValue;
03891     LPWSTR *lpszServiceInstanceName = va_arg(vl, LPWSTR*);
03892     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03893     DWORD *dwNameSpace = va_arg(vl, DWORD*);
03894     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
03895     LPWSAQUERYSETW *lpqsResults = va_arg(vl, LPWSAQUERYSETW*);
03896     DWORD *dwResolution = va_arg(vl, DWORD*);
03897     LPWSTR *lpszAliasBuffer = va_arg(vl, LPWSTR*);
03898     LPDWORD *lpdwAliasBufferLength  = va_arg(vl, LPDWORD*);
03899
03900     _snprintf(Buffer + Index, BufLen - Index - 1,
03901             "NSPGetAddressByName() %s.\r\n",
03902              PreOrPost ? "called" : "returned");
03903     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03904     return(FALSE);
03905 }
03906
03907
03908
03909 BOOL CALLBACK
03910 DTHandler_NSPInstallServiceClass(
03911     IN     va_list vl,
03912     IN OUT LPVOID  ReturnValue,
03913     IN     LPSTR   LibraryName,
03914     OUT    char    *Buffer,
03915     IN     int     Index,
03916     IN     int     BufLen,
03917     IN     BOOL    PreOrPost)
03918 {
03919     int *RetVal = (int *)ReturnValue;
03920     LPWSASERVICECLASSINFOW *lpServiceClassInfo =
03921         va_arg(vl, LPWSASERVICECLASSINFOW*);
03922
03923     _snprintf(Buffer + Index, BufLen - Index - 1,
03924             "NSPInstallServiceClass() %s.\r\n",
03925              PreOrPost ? "called" : "returned");
03926     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03927     return(FALSE);
03928 }
03929
03930
03931
03932 BOOL CALLBACK
03933 DTHandler_NSPSetService(
03934     IN     va_list vl,
03935     IN OUT LPVOID  ReturnValue,
03936     IN     LPSTR   LibraryName,
03937     OUT    char    *Buffer,
03938     IN     int     Index,
03939     IN     int     BufLen,
03940     IN     BOOL    PreOrPost)
03941 {
03942     int *RetVal = (int *)ReturnValue;
03943     LPWSAQUERYSETW *lpqsRegInfo = va_arg(vl, LPWSAQUERYSETW*);
03944     WSAESETSERVICEOP *essOperation = va_arg(vl, WSAESETSERVICEOP*);
03945     DWORD *dwControlFlags = va_arg(vl, DWORD*);
03946
03947     _snprintf(Buffer + Index, BufLen - Index - 1,
03948             "NSPSetService() %s.\r\n",
03949              PreOrPost ? "called" : "returned");
03950     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03951     return(FALSE);
03952 }
03953
03954
03955
03956 BOOL CALLBACK
03957 DTHandler_NSPRemoveServiceClass(
03958     IN     va_list vl,
03959     IN OUT LPVOID  ReturnValue,
03960     IN     LPSTR   LibraryName,
03961     OUT    char    *Buffer,
03962     IN     int     Index,
03963     IN     int     BufLen,
03964     IN     BOOL    PreOrPost)
03965 {
03966     int *RetVal = (int *)ReturnValue;
03967     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03968
03969     _snprintf(Buffer + Index, BufLen - Index - 1,
03970             "NSPRemoveServiceClass() %s.\r\n",
03971              PreOrPost ? "called" : "returned");
03972     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03973     return(FALSE);
03974 }
03975
03976
03977
03978 BOOL CALLBACK
03979 DTHandler_NSPGetServiceClassInfo(
03980     IN     va_list vl,
03981     IN OUT LPVOID  ReturnValue,
03982     IN     LPSTR   LibraryName,
03983     OUT    char    *Buffer,
03984     IN     int     Index,
03985     IN     int     BufLen,
03986     IN     BOOL    PreOrPost)
03987 {
03988     int *RetVal = (int *)ReturnValue;
03989     LPGUID *lpProviderId = va_arg(vl, LPGUID*);
03990     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
03991     LPDWORD *lpdwBufSize = va_arg(vl, LPDWORD*);
03992     LPWSASERVICECLASSINFOW *lpServiceClassInfo =
03993         va_arg(vl, LPWSASERVICECLASSINFOW*);
03994
03995     _snprintf(Buffer + Index, BufLen - Index - 1,
03996             "NSPGetServiceClassInfo() %s.\r\n",
03997              PreOrPost ? "called" : "returned");
03998     DTTextOut( LogFileHandle, Buffer, OutputStyle);
03999     return(FALSE);
04000 }
04001
04002
04003 BOOL CALLBACK
04004 DTHandler_NSPGetServiceClassNameByClassId(
04005     IN     va_list vl,
04006     IN OUT LPVOID  ReturnValue,
04007     IN     LPSTR   LibraryName,
04008     OUT    char    *Buffer,
04009     IN     int     Index,
04010     IN     int     BufLen,
04011     IN     BOOL    PreOrPost)
04012 {
04013     int *RetVal = (int *)ReturnValue;
04014     LPGUID *lpServiceClassId = va_arg(vl, LPGUID*);
04015     LPWSTR *lpszServiceClassName = va_arg(vl, LPWSTR*);
04016     LPDWORD *lpdwBufferLength = va_arg(vl, LPDWORD*);
04017
04018     _snprintf(Buffer + Index, BufLen - Index - 1,
04019             "NSPGetServiceClassNameByClassId() %s.\r\n",
04020              PreOrPost ? "called" : "returned");
04021     DTTextOut( LogFileHandle, Buffer, OutputStyle);
04022     return(FALSE);
04023 }
04024
04025
04026
04027
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/evtstoresub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

evtstoresub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __EVTSTORESUB_H__
00018 #define __EVTSTORESUB_H__
00019
00020 #include "resource.h"       // main symbols
00021 // #include <eventcpts.h> // Event System events are different from COM+ Services general events
00022 #include <eventsys.h>   // Definitions for the COM+ Event system
00023
00024 CComBSTR GuidToBstr(REFGUID guid);
00025
00026 class CComSpy;
00027
00028 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00029 Class:   CEvtStoreSub
00030 Summary: Subscriber for the event published by the event system
00031 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00032 class ATL_NO_VTABLE CEvtStoreSub :
00033   public CSysLCESub,
00034   public IEventObjectChange
00035 {
00036 public:
00037   CEvtStoreSub(CComSpy * pSpy)
00038   {
00039     m_pSpy = pSpy;
00040   }
00041
00042   CEvtStoreSub()
00043   {
00044     m_pSpy = NULL;
00045   }
00046
00047 DECLARE_NOT_AGGREGATABLE(CEvtStoreSub)
00048 DECLARE_GET_CONTROLLING_UNKNOWN()
00049
00050 BEGIN_COM_MAP(CEvtStoreSub)
00051   COM_INTERFACE_ENTRY(IEventObjectChange)
00052   COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00053 END_COM_MAP()
00054
00055 // CSysLCESub - virtual methods defined
00056 STDMETHODIMP GetEventType(EventEnum * e){*e = EventStore;return S_OK;}
00057 STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_EventObjectChange;return S_OK;}
00058 STDMETHODIMP GetInterface(IID* iid){*iid = IID_IEventObjectChange;return S_OK;}
00059
00060 // IEventObjectChange Methods
00061 STDMETHOD(ChangedSubscription)
00062    (/* [in] */ EOC_ChangeType changeType,
00063   /* [in] */ BSTR bstrSubscriptionID);
00064
00065 STDMETHOD(ChangedEventClass)
00066    (/* [in] */ EOC_ChangeType changeType,
00067   /* [in] */ BSTR bstrEventClassID);
00068
00069 STDMETHOD(ChangedPublisher)
00070    (/* [in] */ EOC_ChangeType changeType,
00071   /* [in] */ BSTR bstrPublisherID);
00072
00073 // CEvtStoreSub Methods
00074 STDMETHOD (AddSubscriptionInfo)
00075    (/* [in] */ CComSpy* pSpy,
00076   /* [in] */ BSTR bstrSubscriptionID);
00077
00078 STDMETHOD (AddEventClassInfo)
00079    (/* [in] */ CComSpy* pSpy,
00080   /* [in] */ BSTR bstrEventClassID);
00081
00082 STDMETHOD (AddPublisherInfo)
00083    (/* [in] */ CComSpy* pSpy,
00084   /* [in] */ BSTR bstrPublisherID);
00085 };
00086
00087 #endif //__EVTSTORESUB_H__
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/EmptyVolumeCache.Cpp Source File

  • WinUI
  • Shell
  • DiskCleanupHandler

EmptyVolumeCache.Cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  EmptyVolumeCache.cpp
00011 //
00012 //      Implementation of the CEmptyVolumeCache class.
00013 //
00014 //////////////////////////////////////////////////////////////////////
00015
00016 #include "Cleanup.h"
00017 #include "EmptyVolumeCache.h"
00018 #include "Resource.h"
00019
00020 //////////////////////////////////////////////////////////////////////
00021 // Construction/Destruction
00022 //////////////////////////////////////////////////////////////////////
00023
00024 CEmptyVolumeCache::CEmptyVolumeCache()
00025 {
00026     m_nRefCount = 0;
00027     nDllRefCount++;
00028 }
00029
00030 CEmptyVolumeCache::~CEmptyVolumeCache()
00031 {
00032     nDllRefCount--;
00033 }
00034
00035 /////////////////////////////////////////////////////////////////////
00036 //  IUnknown Methods
00037 /////////////////////////////////////////////////////////////////////
00038 STDMETHODIMP CEmptyVolumeCache::QueryInterface(REFIID riid, LPVOID *ppvObject)
00039 {
00040     HRESULT hr = E_NOINTERFACE;
00041
00042     *ppvObject = NULL;
00043     if (IsEqualIID (riid, IID_IUnknown) ||
00044         IsEqualIID (riid, IID_IEmptyVolumeCache) ||
00045         IsEqualIID (riid, IID_IEmptyVolumeCache2))
00046     {
00047         *ppvObject = (LPVOID)(LPUNKNOWN) this;
00048     }
00049
00050     if (*ppvObject != NULL)
00051     {
00052         ((LPUNKNOWN)*ppvObject)->AddRef ();
00053         hr = S_OK;
00054     }
00055     return hr;
00056 }
00057
00058 STDMETHODIMP_(ULONG) CEmptyVolumeCache::AddRef()
00059 {
00060     m_nRefCount++;
00061     return m_nRefCount;
00062 }
00063
00064 STDMETHODIMP_(ULONG) CEmptyVolumeCache::Release()
00065 {
00066     if (--m_nRefCount == 0)
00067     {
00068         delete this;
00069         return 0;
00070     }
00071     return m_nRefCount;
00072 }
00073
00074
00075 /////////////////////////////////////////////////////////////////////
00076 //  IEmptyVolumeCache Methods
00077 //
00078 //  STDMETHODIMP Deactivate (DWORD dwFlags)
00079 //  STDMETHODIMP GetSpaceUsed (DWORDLONG *pdwSpaceUsed,
00080 //                             IEmptyVolumeCacheCallback *picb)
00081 //  STDMETHODIMP Initialize (HKEY hKey, LPCWSTR pcwszVolume,
00082 //                           LPWSTR *ppwszDisplayName,
00083 //                           LPWSTR *ppwszDescription,
00084 //                           DWORD *pdwFlags)
00085 //  STDMETHODIMP Purge (DWORDLONG *pdwSpaceToFree,
00086 //                      IEmptyVolumeCacheCallback *picb)
00087 //  STDMETHODIMP ShowProperties (HWND hWnd)
00088 //
00089 /////////////////////////////////////////////////////////////////////
00090
00091 STDMETHODIMP CEmptyVolumeCache::Deactivate (LPDWORD pdwFlags)
00092 {
00093     //
00094     //  The disk cleanup manager is shutting down. Set any
00095     //  appropriate flags and return
00096     //
00097     *pdwFlags = 0;
00098     return S_OK;
00099 }
00100
00101
00102 STDMETHODIMP CEmptyVolumeCache::GetSpaceUsed (DWORDLONG *pdwSpaceUsed,
00103                                               IEmptyVolumeCacheCallBack *picb)
00104 {
00105     //
00106     //  Determine the amount of disk space our cleanup handler can
00107     //  free.
00108     //
00109     //  In this sample, we will make up a bogus size by determining
00110     //  the total size of the files in the Windows directory.
00111     //
00112     //  bUpdateProgress is used to determine if GetSpaceUsed should
00113     //  call IEmptyVolumeCacheCallback::ScanProgress. If picb is
00114     //  NULL, ScanProgress is not called.
00115     //
00116     BOOL bUpdateProgress = (picb != NULL);
00117     WIN32_FIND_DATA wfd;
00118     HANDLE hFind = NULL;
00119     HRESULT hResult = S_FALSE;
00120     TCHAR szWindowsDir[MAX_PATH];
00121     *pdwSpaceUsed = 0;
00122
00123     GetWindowsDirectory (szWindowsDir, MAX_PATH);
00124     PathAppend (szWindowsDir, TEXT("*.*"));
00125
00126     if ((hFind = FindFirstFile (szWindowsDir, &wfd)) == INVALID_HANDLE_VALUE)
00127         goto done;
00128
00129     do
00130     {
00131         hResult = S_OK;
00132         if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
00133         {
00134             *pdwSpaceUsed += MAKEDWORDLONG(wfd.nFileSizeHigh, wfd.nFileSizeLow);
00135             if (bUpdateProgress)
00136                 hResult = picb->ScanProgress (*pdwSpaceUsed, 0, NULL);
00137         }
00138     } while (FindNextFile (hFind, &wfd) && hResult == S_OK);
00139
00140     if (hResult == S_OK)
00141         if (bUpdateProgress)
00142             picb->ScanProgress (*pdwSpaceUsed, EVCCBF_LASTNOTIFICATION, NULL);
00143     FindClose (hFind);
00144
00145 done:
00146     return hResult;
00147 }
00148
00149
00150 STDMETHODIMP CEmptyVolumeCache::Initialize (HKEY hKey, LPCWSTR pcwszVolume,
00151                                             LPWSTR *ppwszDisplayName,
00152                                             LPWSTR *ppwszDescription,
00153                                             DWORD *pdwFlags)
00154 {
00155     //
00156     //  The disk cleanup handler is being initialized. Allocate
00157     //  memory for the Display Name and Description strings using
00158     //  the task's memory allocator. These strings will be freed by
00159     //  the disk cleanup manager. Also, set any appropriate flags
00160     //  for the disk cleanup handler.
00161     //
00162     //  If the EVCF_SETTINGSMODE flag is set, Initialize/InitializeEx
00163     //  is responsible for deleting files.
00164     //
00165     HRESULT hResult = NOERROR;
00166
00167     //
00168     //  We may need to delete the files here if EVCF_SETTINGSMODE is set.
00169     //
00170     if (*pdwFlags & EVCF_SETTINGSMODE)
00171     {
00172         DWORDLONG dwSpaceUsed = 0;
00173
00174         GetSpaceUsed (&dwSpaceUsed, NULL);
00175         Purge (dwSpaceUsed, NULL);
00176     }
00177
00178     //
00179     //  Load the Display Name text
00180     //
00181     *ppwszDisplayName = (LPWSTR) CoTaskMemAlloc (MAX_DISPLAY_LEN * sizeof (WCHAR));
00182     if (*ppwszDisplayName)
00183     {
00184 #ifdef UNICODE
00185         LoadString (hDllInstance, IDS_DISPLAY, *ppwszDisplayName, MAX_DISPLAY_LEN);
00186 #else
00187         CHAR szDisplayName[MAX_DISPLAY_LEN];
00188         LoadString (hDllInstance, IDS_DISPLAY, szDisplayName, MAX_DISPLAY_LEN);
00189         MultiByteToWideChar (CP_ACP, 0, szDisplayName, -1, *ppwszDisplayName, MAX_DISPLAY_LEN);
00190 #endif
00191     }
00192
00193
00194     //
00195     //  Load the Description text
00196     //
00197     *ppwszDescription = (LPWSTR) CoTaskMemAlloc (MAX_DESCRIPTION_LEN * sizeof (WCHAR));
00198     if (*ppwszDescription)
00199     {
00200 #ifdef UNICODE
00201         LoadString (hDllInstance, IDS_DESCRIPTION, *ppwszDescription, MAX_DESCRIPTION_LEN);
00202 #else
00203         CHAR szDisplayName[MAX_DESCRIPTION_LEN];
00204         LoadString (hDllInstance, IDS_DESCRIPTION, szDisplayName, MAX_DESCRIPTION_LEN);
00205         MultiByteToWideChar (CP_ACP, 0, szDisplayName, -1, *ppwszDescription, MAX_DESCRIPTION_LEN);
00206 #endif
00207     }
00208
00209     *pdwFlags = EVCF_HASSETTINGS | EVCF_ENABLEBYDEFAULT;
00210
00211     return hResult;
00212 }
00213
00214
00215 STDMETHODIMP CEmptyVolumeCache::Purge (DWORDLONG dwSpaceToFree,
00216                                        IEmptyVolumeCacheCallBack *picb)
00217 {
00218     //
00219     //  Delete unneeded files.
00220     //
00221     //  In this sample, we do not delete any files. However, we
00222     //  report that we actually did something by calling
00223     //  IEmptyVolumeCacheCallback::PurgeProgress.
00224     //
00225     //  bUpdateProgress is used to determine if GetSpaceUsed should
00226     //  call IEmptyVolumeCacheCallback::PurgeProgress. If picb is
00227     //  NULL, PurgeProgress is not called.
00228     //
00229     BOOL bUpdateProgress = (picb != NULL);
00230
00231     if (bUpdateProgress)
00232         picb->PurgeProgress (dwSpaceToFree, 0, EVCCBF_LASTNOTIFICATION, NULL);
00233     return S_OK;
00234 }
00235
00236
00237 STDMETHODIMP CEmptyVolumeCache::ShowProperties (HWND hWnd)
00238 {
00239     //
00240     //  Display the Properties dialog for this disk cleanup handler.
00241     //  If the cleanup handler does not support a Properties dialog
00242     //  do not specify EVCF_HASSETTINGS in Initialize/InitializeEx.
00243     //
00244     //  In this sample we just create a message box to tell the user
00245     //  that there are no properties to set.
00246     MessageBox (hWnd,
00247                 TEXT("There are no actual properties to display here."),
00248                 TEXT("Properties"),
00249                 MB_OK | MB_ICONINFORMATION);
00250     return S_OK;
00251 }
00252
00253
00254
00255 /////////////////////////////////////////////////////////////////////
00256 //  IEmptyVolumeCache2 Methods
00257 //
00258 //  STDMETHODIMP InitializeEx (HKEY hKey, LPCWSTR pcwszVolume,
00259 //                             LPCWSTR pcwszKeyName,
00260 //                             LPWSTR *ppwszDisplayName,
00261 //                             LPWSTR *ppwszDescription,
00262 //                             LPWSTR *ppwszBtnText,
00263 //                             DWORD *pdwFlags)
00264 //
00265 /////////////////////////////////////////////////////////////////////
00266
00267 STDMETHODIMP CEmptyVolumeCache::InitializeEx (HKEY hKey, LPCWSTR pcwszVolume,
00268                                               LPCWSTR pcwszKeyName,
00269                                               LPWSTR *ppwszDisplayName,
00270                                               LPWSTR *ppwszDescription,
00271                                               LPWSTR *ppwszBtnText,
00272                                               DWORD *pdwFlags)
00273 {
00274     HRESULT hResult = Initialize (hKey, pcwszVolume, ppwszDisplayName, ppwszDescription, pdwFlags);
00275
00276     //
00277     //  Load the button text
00278     //
00279     *ppwszBtnText = (LPWSTR) CoTaskMemAlloc (MAX_DESCRIPTION_LEN * sizeof (WCHAR));
00280     if (*ppwszBtnText)
00281     {
00282 #ifdef UNICODE
00283         LoadString (hDllInstance, IDS_BUTTONTEXT, *ppwszBtnText, MAX_BUTTONTEXT_LEN);
00284 #else
00285         CHAR szDisplayName[MAX_BUTTONTEXT_LEN];
00286         LoadString (hDllInstance, IDS_BUTTONTEXT, szDisplayName, MAX_BUTTONTEXT_LEN);
00287         MultiByteToWideChar (CP_ACP, 0, szDisplayName, -1, *ppwszBtnText, MAX_BUTTONTEXT_LEN);
00288 #endif
00289     }
00290
00291     return hResult;
00292 }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocClien/UTCRUCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocClien

UTCRUCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COUtilityCruiseCar
00005              COM object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and
00009              IUtility interfaces.  This is done through Containment reuse
00010              of COCruiseCar's ICar and ICruise interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial LOCCLIEN.HTM
00014              file.  For more specific technical details on the internal
00015              workings see the comments dispersed throughout the
00016              module's source code.
00017
00018   Classes:   COUtilityCruiseCar.
00019
00020   Functions: CreateUtilityCruiseCar.
00021
00022   Origin:    11-20-95: atrent - Editor inheritance from DLLCLIEN source.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will be calling the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include LOCCLIEN.H because it has class and resource definitions
00048     specific to this LOCCLIEN application.
00049   We include UTCRUCAR.H because it has the COUtilityCruiseCar declarations.
00050 ---------------------------------------------------------------------------*/
00051 #include <windows.h>
00052 #include <ole2.h>
00053 #include <apputil.h>
00054 #include <micars.h>
00055 #include <carguids.h>
00056 #include "locclien.h"
00057 #include "utcrucar.h"
00058
00059
00060 /*---------------------------------------------------------------------------
00061   COUtilityCruiseCar's implementation of its main COM object class including
00062   Constructor, Destructor, QueryInterface, AddRef, and Release.
00063 ---------------------------------------------------------------------------*/
00064
00065 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00066   Method:   COUtilityCruiseCar::COUtilityCruiseCar
00067
00068   Summary:  COUtilityCruiseCar Constructor. Note the member initializer:
00069             "m_ImpIUtility(this, pUnkOuter)" which is used to pass the 'this'
00070             and pUnkOuter pointers of this constructor function to the
00071             constructor in the instantiation of the implementation of
00072             the CImpIUtility interface (which is nested inside this present
00073             COUtilityCruiseCar Object Class).
00074
00075   Args:     IUnknown* pUnkOuter)
00076               Pointer to the the outer Unknown.  NULL means this COM Object
00077               is not being Aggregated.  Non NULL means it is being created
00078               on behalf of an outside COM object that is reusing it via
00079               aggregation.
00080
00081   Modifies: m_cRefs, m_pUnkOuter, m_pUnkCruiseCar.
00082
00083   Returns:  void
00084 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00085 COUtilityCruiseCar::COUtilityCruiseCar(
00086   IUnknown* pUnkOuter) :
00087   m_ImpICar(this, pUnkOuter),
00088   m_ImpICruise(this, pUnkOuter),
00089   m_ImpIUtility(this, pUnkOuter)
00090 {
00091   // Zero the COM object's reference count.
00092   m_cRefs = 0;
00093
00094   // No AddRef necessary if non-NULL, as this COM object's lifetime
00095   // is totally coupled with the controlling Outer object's lifetime.
00096   m_pUnkOuter = pUnkOuter;
00097
00098   // Zero the pointer to the contained COCruiseCar object's ICar interface.
00099   m_pICar = NULL;
00100
00101   // Zero the pointer to the contained COCruiseCar object's ICruise
00102   // interface.
00103   m_pICruise = NULL;
00104
00105   LOGF1("C: COUtilityCruiseCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00106
00107   return;
00108 }
00109
00110
00111 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00112   Method:   COUtilityCruiseCar::~COUtilityCruiseCar
00113
00114   Summary:  COUtilityCruiseCar Destructor.
00115
00116   Args:     void
00117
00118   Modifies: .
00119
00120   Returns:  void
00121 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00122 COUtilityCruiseCar::~COUtilityCruiseCar(void)
00123 {
00124   LOG("C: COUtilityCruiseCar::Destructor.");
00125
00126   // Release the contained CruiseCar interfaces.
00127   m_pICruise->Release();
00128   m_pICar->Release();
00129
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   COUtilityCruiseCar::Init
00136
00137   Summary:  COUtilityCruiseCar Initialization method.
00138
00139   Args:     void
00140
00141   Modifies: m_pICar, m_pICruise, m_cRefs.
00142
00143   Returns:  HRESULT
00144               Standard result code. NOERROR for success.
00145 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00146 HRESULT COUtilityCruiseCar::Init(void)
00147 {
00148   HRESULT hr;
00149   IClassFactory* pICFCruiseCar;
00150
00151   // Set up the right pIUnknown for delegation.  If we are being
00152   // aggregated then we pass the pUnkOuter in turn to any COM objects
00153   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00154   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00155
00156   LOGF1("C: COUtilityCruiseCar::Init. pUnkOuter=0x%X",pUnkOuter);
00157
00158   // Get a class factory for LocCruiseCar and issue IClassFactory's
00159   // CreateInstance method to manufacture a COCruiseCar COM object.
00160   LOG("C: COUtilityCruiseCar::Init. Obtain CruiseCar Class Factory.");
00161   hr = CoGetClassObject(
00162          CLSID_LocCruiseCar,
00163          CLSCTX_LOCAL_SERVER,
00164          NULL,
00165          IID_IClassFactory,
00166          (PPVOID)&pICFCruiseCar);
00167   if (SUCCEEDED(hr))
00168   {
00169     LOG("C: COUtilityCruiseCar::Init. CruiseCar Class Factory obtained.");
00170     LOG("C: COUtilityCruiseCar::Init. Calling CFCruiseCar::CreateInstance.");
00171     // A NULL pUnkOuter is passed indicating that we are creating a
00172     // COCruiseCar component via the Containment reuse method.  We can
00173     // currently pass nothing other than this NULL pUnkOuter because
00174     // aggregation is not supported across process or machine boundaries.
00175     // Since we are not requesting a COCruiseCar create for aggregation we
00176     // can directly request for the ICruise interface on the new object.
00177     hr = pICFCruiseCar->CreateInstance(
00178                           NULL,
00179                           IID_ICruise,
00180                           (PPVOID)&m_pICruise);
00181     LOG("C: COUtilityCruiseCar::Init. Releasing CruiseCar Class Factory.");
00182     pICFCruiseCar->Release();
00183     if (SUCCEEDED(hr))
00184     {
00185       // Now that we have a valid interface pointer (m_pICruise) on the
00186       // new object we can obtain and cache a pointer to that contained
00187       // object's ICar interface as well.  We must QI using the obtained
00188       // ICruise pointer on the object to ensure that the marshaling proxy
00189       // is involved in the QueryInterface call to provide the pointer to
00190       // the ICar interface proxy.
00191       hr = m_pICruise->QueryInterface(IID_ICar, (PPVOID)&m_pICar);
00192     }
00193   }
00194
00195   if (SUCCEEDED(hr))
00196   {
00197     LOG("C: COUtilityCruiseCar::Init (CruiseCar Containment) Succeeded.");
00198   }
00199   else
00200   {
00201     LOGF1("C: COUtilityCruiseCar::Init (CruiseCar Containment) Failed. hr=0x%X",hr);
00202   }
00203
00204   return (hr);
00205 }
00206
00207
00208 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00209   Method:   COUtilityCruiseCar::QueryInterface
00210
00211   Summary:  QueryInterface of the COUtilityCruiseCar non-delegating
00212             IUnknown implementation.
00213
00214   Args:     REFIID riid,
00215               [in] GUID of the Interface being requested.
00216             PPVOID ppv)
00217               [out] Address of the caller's pointer variable that will
00218               receive the requested interface pointer.
00219
00220   Modifies: .
00221
00222   Returns:  HRESULT
00223 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00224 STDMETHODIMP COUtilityCruiseCar::QueryInterface(
00225                REFIID riid,
00226                PPVOID ppv)
00227 {
00228   HRESULT hr = E_NOINTERFACE;
00229   *ppv = NULL;
00230
00231   if (IID_IUnknown == riid)
00232   {
00233     *ppv = this;
00234     LOG("C: COUtilityCruiseCar::QueryInterface. 'this' pIUnknown returned.");
00235   }
00236   else if (IID_ICar == riid)
00237   {
00238     *ppv = &m_ImpICar;
00239     LOG("C: COUtilityCruiseCar::QueryInterface. pICar returned");
00240   }
00241   else if (IID_ICruise == riid)
00242   {
00243     *ppv = &m_ImpICruise;
00244     LOG("C: COUtilityCruiseCar::QueryInterface. pICruise returned");
00245   }
00246   else if (IID_IUtility == riid)
00247   {
00248     // This IUtility interface is implemented in this COUtilityCruiseCar
00249     // object as a native interface of COUtilityCruiseCar.
00250     *ppv = &m_ImpIUtility;
00251     LOG("C: COUtilityCruiseCar::QueryInterface. pIUtility returned.");
00252   }
00253
00254   if (NULL != *ppv)
00255   {
00256     // We've handed out a pointer to an interface so obey the COM rules
00257     // and AddRef its reference count.
00258     ((LPUNKNOWN)*ppv)->AddRef();
00259     hr = NOERROR;
00260   }
00261
00262   return (hr);
00263 }
00264
00265
00266 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00267   Method:   COUtilityCruiseCar::AddRef
00268
00269   Summary:  AddRef of the COUtilityCruiseCar non-delegating
00270             IUnknown implementation.
00271
00272   Args:     void
00273
00274   Modifies: m_cRefs.
00275
00276   Returns:  ULONG
00277               New value of m_cRefs (COM object's reference count).
00278 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00279 STDMETHODIMP_(ULONG) COUtilityCruiseCar::AddRef(void)
00280 {
00281   m_cRefs++;
00282
00283   LOGF1("C: COUtilityCruiseCar::AddRef. New cRefs=%i.", m_cRefs);
00284
00285   return m_cRefs;
00286 }
00287
00288
00289 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00290   Method:   COUtilityCruiseCar::Release
00291
00292   Summary:  Release of the COUtilityCruiseCar non-delegating IUnknown
00293             implementation.
00294
00295   Args:     void
00296
00297   Modifies: m_cRefs.
00298
00299   Returns:  ULONG
00300               New value of m_cRefs (COM object's reference count).
00301 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00302 STDMETHODIMP_(ULONG) COUtilityCruiseCar::Release(void)
00303 {
00304   ULONG ulCount = --m_cRefs;
00305
00306   LOGF1("C: COUtilityCruiseCar::Release. New cRefs=%i.", m_cRefs);
00307
00308   if (0 == m_cRefs)
00309   {
00310     // We artificially bump the main ref count.  This fulfills one of
00311     // the rules of aggregated objects and ensures that an indirect
00312     // recursive call to this release won't occur because of other
00313     // delegating releases that might happen in our own destructor.
00314     m_cRefs++;
00315     delete this;
00316   }
00317
00318   return ulCount;
00319 }
00320
00321
00322 /*---------------------------------------------------------------------------
00323   COUtilityCruiseCar's nested implementation of the ICar interface
00324   including Constructor, Destructor, QueryInterface, AddRef, Release,
00325   Shift, Clutch, Speed, and Steer.
00326 ---------------------------------------------------------------------------*/
00327
00328 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00329   Method:   COUtilityCruiseCar::CImpICar::CImpICar
00330
00331   Summary:  Constructor for the CImpICar interface instantiation.
00332
00333   Args:     COUtilityCruiseCar* pBackObj,
00334               Back pointer to the parent outer object.
00335             IUnknown* pUnkOuter,
00336               Pointer to the outer Unknown.  For delegation.
00337
00338   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00339
00340   Returns:  void
00341 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00342 COUtilityCruiseCar::CImpICar::CImpICar(
00343   COUtilityCruiseCar* pBackObj,
00344   IUnknown* pUnkOuter)
00345 {
00346   // Init the Interface Ref Count (used for debugging only).
00347   m_cRefI = 0;
00348
00349   // Init the Back Object Pointer to point to the outer object.
00350   m_pBackObj = pBackObj;
00351
00352   // Init the CImpICar interface's delegating Unknown pointer.  We use
00353   // the Back Object pointer for IUnknown delegation here if we are not
00354   // being aggregated.  If we are being aggregated we use the supplied
00355   // pUnkOuter for IUnknown delegation.  In either case the pointer
00356   // assignment requires no AddRef because the CImpICar lifetime is
00357   // quaranteed by the lifetime of the parent object in which
00358   // CImpICar is nested.
00359   if (NULL == pUnkOuter)
00360   {
00361     m_pUnkOuter = pBackObj;
00362     LOG("C: COUtilityCruiseCar::CImpICar Constructor. Non-Aggregating");
00363   }
00364   else
00365   {
00366     m_pUnkOuter = pUnkOuter;
00367     LOG("C: COUtilityCruiseCar::CImpICar Constructor. Aggregating");
00368   }
00369
00370   return;
00371 }
00372
00373
00374 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00375   Method:   COUtilityCruiseCar::CImpICar::~CImpICar
00376
00377   Summary:  Destructor for the CImpICar interface instantiation.
00378
00379   Args:     void
00380
00381   Modifies: .
00382
00383   Returns:  void
00384 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00385 COUtilityCruiseCar::CImpICar::~CImpICar(void)
00386 {
00387   LOG("C: COUtilityCruiseCar::CImpICar Destructor.");
00388
00389   return;
00390 }
00391
00392
00393 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00394   Method:   COUtilityCruiseCar::CImpICar::QueryInterface
00395
00396   Summary:  The QueryInterface IUnknown member of this ICar interface
00397             implementation that delegates to m_pUnkOuter, whatever it is.
00398
00399   Args:     REFIID riid,
00400               [in] GUID of the Interface being requested.
00401             PPVOID ppv)
00402               [out] Address of the caller's pointer variable that will
00403               receive the requested interface pointer.
00404
00405   Modifies: .
00406
00407   Returns:  HRESULT
00408               Returned by the delegated outer QueryInterface call.
00409 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00410 STDMETHODIMP COUtilityCruiseCar::CImpICar::QueryInterface(
00411                REFIID riid,
00412                PPVOID ppv)
00413 {
00414   LOG("C: COUtilityCruiseCar::CImpICar::QueryInterface. Delegating.");
00415
00416   // Delegate this call to the outer object's QueryInterface.
00417   return m_pUnkOuter->QueryInterface(riid, ppv);
00418 }
00419
00420
00421 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00422   Method:   COUtilityCruiseCar::CImpICar::AddRef
00423
00424   Summary:  The AddRef IUnknown member of this ICar interface
00425             implementation that delegates to m_pUnkOuter, whatever it is.
00426
00427   Args:     void
00428
00429   Modifies: m_cRefI.
00430
00431   Returns:  ULONG
00432               Returned by the delegated outer AddRef call.
00433 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00434 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICar::AddRef(void)
00435 {
00436   // Increment the Interface Reference Count.
00437   ++m_cRefI;
00438
00439   LOGF1("C: COUtilityCruiseCar::CImpICar::Addref. Delegating. New cI=%i.", m_cRefI);
00440
00441   // Delegate this call to the outer object's AddRef.
00442   return m_pUnkOuter->AddRef();
00443 }
00444
00445
00446 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00447   Method:   COUtilityCruiseCar::CImpICar::Release
00448
00449   Summary:  The Release IUnknown member of this ICar interface
00450             implementation that delegates to m_pUnkOuter, whatever it is.
00451
00452   Args:     void
00453
00454   Modifies: .
00455
00456   Returns:  ULONG
00457               Returned by the delegated outer Release call.
00458 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00459 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICar::Release(void)
00460 {
00461   // Decrement the Interface Reference Count.
00462   --m_cRefI;
00463
00464   LOGF1("C: COUtilityCruiseCar::CImpICar::Release. Delegating. New cI=%i.", m_cRefI);
00465
00466   // Delegate this call to the outer object's Release.
00467   return m_pUnkOuter->Release();
00468 }
00469
00470
00471 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00472   Method:   COUtilityCruiseCar::CImpICar::Shift
00473
00474   Summary:  The Shift member method of this ICar interface implementation.
00475             A simple empty method on a COUtilityCruiseCar COM object for
00476             tutorial purposes.  Presumably if this Car object were
00477             modeling a real Car then the Shift method would shift to the
00478             specified gear.
00479
00480   Args:     short nGear
00481               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00482
00483   Modifies: .
00484
00485   Returns:  HRESULT
00486               Delegated HRESULT.
00487 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00488 STDMETHODIMP COUtilityCruiseCar::CImpICar::Shift(
00489                short nGear)
00490 {
00491   LOGF1("C: COUtilityCruiseCar::CImpICar::Shift. Delegating. nGear=%i.",nGear);
00492
00493   // Delegate this call to the contained COCruiseCar's ICar::Shift.
00494   return m_pBackObj->m_pICar->Shift(nGear);
00495 }
00496
00497
00498 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00499   Method:   COUtilityCruiseCar::CImpICar::Clutch
00500
00501   Summary:  The Clutch member method of this ICar interface
00502             implementation. A simple empty method on a COUtilityCruiseCar
00503             COM object for tutorial purposes.  Presumably if this Car
00504             object were modeling a real Car then the Clutch method would
00505             engage the clutch the specified amount.
00506
00507   Args:     short nEngaged)
00508               Percent clutch is engaged (0 to 100%).
00509
00510   Modifies: .
00511
00512   Returns:  HRESULT
00513               Delegated HRESULT.
00514 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00515 STDMETHODIMP COUtilityCruiseCar::CImpICar::Clutch(
00516                short nEngaged)
00517 {
00518   LOGF1("C: COUtilityCruiseCar::CImpICar::Clutch. Delegating. nEngaged=%i.", nEngaged);
00519
00520   // Delegate this call to the contained COCruiseCar's ICar::Clutch.
00521   return m_pBackObj->m_pICar->Clutch(nEngaged);
00522 }
00523
00524
00525 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00526   Method:   COUtilityCruiseCar::CImpICar::Speed
00527
00528   Summary:  The Propel member method of this ICar interface
00529             implementation. A simple empty method on a COUtilityCruiseCar
00530             COM object for tutorial purposes.  Presumably if this Car
00531             object were modeling a real Car then this method would
00532             accelerate/brake to bring the car to the specified speed.
00533
00534   Args:     short nMph
00535               New speed in miles per hour.
00536
00537   Modifies: .
00538
00539   Returns:  HRESULT
00540               Delegated HRESULT.
00541 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00542 STDMETHODIMP COUtilityCruiseCar::CImpICar::Speed(
00543                short nMph)
00544 {
00545   LOGF1("C: COUtilityCruiseCar::CImpICar::Speed. Delegating. nMph=%i.",nMph);
00546
00547   // Delegate this call to the contained COCruiseCar's ICar::Speed.
00548   return m_pBackObj->m_pICar->Speed(nMph);
00549 }
00550
00551
00552 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00553   Method:   COUtilityCruiseCar::CImpICar::Steer
00554
00555   Summary:  The Steer member method of this ICar interface implementation.
00556             A simple empty method on a COUtilityCruiseCar COM object for
00557             tutorial purposes.  Presumably if this Car object were
00558             modeling a real Car then the Steer method would set the
00559             steering angle of the Car.
00560
00561   Args:     short nAngle)
00562               0 degrees straight ahead, -45 Full left, +45 Full right.
00563
00564   Modifies: .
00565
00566   Returns:  HRESULT
00567               Delegated HRESULT.
00568 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00569 STDMETHODIMP COUtilityCruiseCar::CImpICar::Steer(
00570                short nAngle)
00571 {
00572   LOGF1("C: COUtilityCruiseCar::CImpICar::Steer. Delegating. nAngle=%i.",nAngle);
00573
00574   // Delegate this call to the contained COCruiseCar's ICar::Steer.
00575   return m_pBackObj->m_pICar->Steer(nAngle);
00576 }
00577
00578
00579 /*---------------------------------------------------------------------------
00580   COUtilityCruiseCar's nested implementation of the ICruise interface
00581   including Constructor, Destructor, QueryInterface, AddRef, Release,
00582   Engage, and Adjust.
00583 ---------------------------------------------------------------------------*/
00584
00585 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00586   Method:   COUtilityCruiseCar::CImpICruise::CImpICruise
00587
00588   Summary:  Constructor for the CImpICruise interface instantiation.
00589
00590   Args:     COUtilityCruiseCar* pBackObj,
00591               Back pointer to the parent outer object.
00592             IUnknown* pUnkOuter,
00593               Pointer to the outer Unknown.  For delegation.
00594
00595   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00596
00597   Returns:  void
00598 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00599 COUtilityCruiseCar::CImpICruise::CImpICruise(
00600   COUtilityCruiseCar* pBackObj,
00601   IUnknown* pUnkOuter)
00602 {
00603   // Init the Interface Ref Count (used for debugging only).
00604   m_cRefI = 0;
00605
00606   // Init the Back Object Pointer to point to the outer object.
00607   m_pBackObj = pBackObj;
00608
00609   // Init the CImpICruise interface's delegating Unknown pointer.  We use
00610   // the Back Object pointer for IUnknown delegation here if we are not
00611   // being aggregated.  If we are being aggregated we use the supplied
00612   // pUnkOuter for IUnknown delegation.  In either case the pointer
00613   // assignment requires no AddRef because the CImpICruise lifetime is
00614   // quaranteed by the lifetime of the parent object in which
00615   // CImpICruise is nested.
00616   if (NULL == pUnkOuter)
00617   {
00618     m_pUnkOuter = pBackObj;
00619     LOG("C: COUtilityCruiseCar::CImpICruise Constructor. Non-Aggregating");
00620   }
00621   else
00622   {
00623     m_pUnkOuter = pUnkOuter;
00624     LOG("C: COUtilityCruiseCar::CImpICruise Constructor. Aggregating");
00625   }
00626
00627   return;
00628 }
00629
00630
00631 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00632   Method:   COUtilityCruiseCar::CImpICruise::~CImpICruise
00633
00634   Summary:  Destructor for the CImpICruise interface instantiation.
00635
00636   Args:     void
00637
00638   Modifies: .
00639
00640   Returns:  void
00641 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00642 COUtilityCruiseCar::CImpICruise::~CImpICruise(void)
00643 {
00644   LOG("C: COUtilityCruiseCar::CImpICruise Destructor.");
00645
00646   return;
00647 }
00648
00649
00650 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00651   Method:   COUtilityCruiseCar::CImpICruise::QueryInterface
00652
00653   Summary:  The QueryInterface IUnknown member of this ICruise interface
00654             implementation that delegates to m_pUnkOuter, whatever it is.
00655
00656   Args:     REFIID riid,
00657               [in] GUID of the Interface being requested.
00658             PPVOID ppv)
00659               [out] Address of the caller's pointer variable that will
00660               receive the requested interface pointer.
00661
00662   Modifies: .
00663
00664   Returns:  HRESULT
00665               Returned by the delegated outer QueryInterface call.
00666 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00667 STDMETHODIMP COUtilityCruiseCar::CImpICruise::QueryInterface(
00668                REFIID riid,
00669                PPVOID ppv)
00670 {
00671   LOG("C: COUtilityCruiseCar::CImpICruise::QueryInterface. Delegating.");
00672
00673   // Delegate this call to the outer object's QueryInterface.
00674   return m_pUnkOuter->QueryInterface(riid, ppv);
00675 }
00676
00677
00678 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00679   Method:   COUtilityCruiseCar::CImpICruise::AddRef
00680
00681   Summary:  The AddRef IUnknown member of this ICruise interface
00682             implementation that delegates to m_pUnkOuter, whatever it is.
00683
00684   Args:     void
00685
00686   Modifies: m_cRefI.
00687
00688   Returns:  ULONG
00689               Returned by the delegated outer AddRef call.
00690 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00691 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICruise::AddRef(void)
00692 {
00693   // Increment the Interface Reference Count.
00694   ++m_cRefI;
00695
00696   LOGF1("C: COUtilityCruiseCar::CImpICruise::Addref. Delegating. New cI=%i.", m_cRefI);
00697
00698   // Delegate this call to the outer object's AddRef.
00699   return m_pUnkOuter->AddRef();
00700 }
00701
00702
00703 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00704   Method:   COUtilityCruiseCar::CImpICruise::Release
00705
00706   Summary:  The Release IUnknown member of this ICruise interface
00707             implementation that delegates to m_pUnkOuter, whatever it is.
00708
00709   Args:     void
00710
00711   Modifies: .
00712
00713   Returns:  ULONG
00714               Returned by the delegated outer Release call.
00715 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00716 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICruise::Release(void)
00717 {
00718   // Decrement the Interface Reference Count.
00719   --m_cRefI;
00720
00721   LOGF1("C: COUtilityCruiseCar::CImpICruise::Release. Delegating. New cI=%i.", m_cRefI);
00722
00723   // Delegate this call to the outer object's Release.
00724   return m_pUnkOuter->Release();
00725 }
00726
00727
00728 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00729   Method:   COUtilityCruiseCar::CImpICruise::Engage
00730
00731   Summary:  The Engage member method of this ICruise interface
00732             implementation.  A simple empty method on a COUtilityCruiseCar
00733             COM object for tutorial purposes.  Presumably if this Car
00734             object were modeling a real Car then the Engage method would
00735             turn the Cruise control system on or off.
00736
00737   Args:     BOOL bOnOff)
00738               TRUE for On; FALSE for Off.
00739
00740   Modifies: .
00741
00742   Returns:  HRESULT
00743               Delegated HRESULT.
00744 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00745 STDMETHODIMP COUtilityCruiseCar::CImpICruise::Engage(
00746                BOOL bOnOff)
00747 {
00748   LOGF1("C: COUtilityCruiseCar::CImpICruise::Engage. Delegating. bOnOff=%i.",bOnOff);
00749
00750   // Delegate this call to the contained COCruiseCar's ICruise::Engage.
00751   m_pBackObj->m_pICruise->Engage(bOnOff);
00752
00753   return NOERROR;
00754 }
00755
00756
00757 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00758   Method:   COUtilityCruiseCar::CImpICruise::Adjust
00759
00760   Summary:  The Adjust member method of this ICruise interface
00761             implementation.  A simple empty method on a COUtilityCruiseCar
00762             COM object for tutorial purposes.  Presumably if this Car
00763             object were modeling a real Car then the Adjust method would
00764             allow notching the cruise set speed up or down by increments
00765             of 3 mph.
00766
00767   Args:     BOOL bUpDown)
00768               TRUE for Up; FALSE for Down.
00769
00770   Modifies: .
00771
00772   Returns:  HRESULT
00773               Delegated HRESULT.
00774 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00775 STDMETHODIMP COUtilityCruiseCar::CImpICruise::Adjust(
00776                BOOL bUpDown)
00777 {
00778   LOGF1("C: COUtilityCruiseCar::CImpICruise::Adjust. Delegating. bUpDown=%i.",bUpDown);
00779
00780   // Delegate this call to the contained COCruiseCar's ICruise::Adjust.
00781   m_pBackObj->m_pICruise->Adjust(bUpDown);
00782
00783   return NOERROR;
00784 }
00785
00786
00787 /*---------------------------------------------------------------------------
00788   COUtilityCruiseCar's nested implementation of the IUtility interface
00789   including methods: Constructor, Destructor, QueryInterface, AddRef,
00790   Release, Offroad, and Winch.
00791 ---------------------------------------------------------------------------*/
00792
00793 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00794   Method:   COUtilityCruiseCar::CImpIUtility::CImpIUtility
00795
00796   Summary:  Constructor for the CImpIUtility interface instantiation.
00797
00798   Args:     COUtilityCruiseCar* pBackObj,
00799               Back pointer to the parent outer object.
00800             IUnknown* pUnkOuter)
00801               Pointer to the outer Unknown.  For delegation.
00802
00803   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00804
00805   Returns:  void
00806 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00807 COUtilityCruiseCar::CImpIUtility::CImpIUtility(
00808   COUtilityCruiseCar* pBackObj,
00809   IUnknown* pUnkOuter)
00810 {
00811   // Init the Interface Ref Count (used for debugging only).
00812   m_cRefI = 0;
00813
00814   // Init the Back Object Pointer to point to the outer object.
00815   m_pBackObj = pBackObj;
00816
00817   // Init the CImpIUtility interface's delegating IUnknown pointer.  We use
00818   // the Back Object pointer for IUnknown delegation here if we are not
00819   // being aggregated.  If we are being aggregated we use the supplied
00820   // pUnkOuter for IUnknown delegation.  In either case the pointer
00821   // assignment requires no AddRef because the CImpIUtility lifetime is
00822   // quaranteed by the lifetime of the parent object in which
00823   // CImpIUtility is nested.
00824   if (NULL == pUnkOuter)
00825   {
00826     m_pUnkOuter = pBackObj;
00827     LOG("C: COUtilityCruiseCar::CImpIUtility Constructor. Non-Aggregating.");
00828   }
00829   else
00830   {
00831     m_pUnkOuter = pUnkOuter;
00832     LOG("C: COUtilityCruiseCar::CImpIUtility Constructor. Aggregating.");
00833   }
00834
00835   return;
00836 }
00837
00838
00839 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00840   Method:   COUtilityCruiseCar::CImpIUtility::~CImpIUtility
00841
00842   Summary:  Destructor for the CImpIUtility interface instantiation.
00843
00844   Args:     void
00845
00846   Modifies: .
00847
00848   Returns:  void
00849 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00850 COUtilityCruiseCar::CImpIUtility::~CImpIUtility(void)
00851 {
00852   LOG("C: COUtilityCruiseCar::CImpIUtility Destructor.");
00853
00854   return;
00855 }
00856
00857
00858 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00859   Method:   COUtilityCruiseCar::CImpIUtility::QueryInterface
00860
00861   Summary:  The QueryInterface IUnknown member of this IUtility interface
00862             implementation that delegates to m_pUnkOuter, whatever it is.
00863
00864   Args:     REFIID riid,
00865               [in] GUID of the Interface being requested.
00866             PPVOID ppv)
00867               [out] Address of the caller's pointer variable that will
00868               receive the requested interface pointer.
00869
00870   Modifies: .
00871
00872   Returns:  HRESULT
00873               Returned by the delegated outer QueryInterface call.
00874 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00875 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::QueryInterface(
00876                REFIID riid,
00877                PPVOID ppv)
00878 {
00879   LOG("C: COUtilityCruiseCar::CImpIUtility::QueryInterface. Delegating.");
00880
00881   // Delegate this call to the outer object's QueryInterface.
00882   return m_pUnkOuter->QueryInterface(riid, ppv);
00883 }
00884
00885
00886 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00887   Method:   COUtilityCruiseCar::CImpIUtility::AddRef
00888
00889   Summary:  The AddRef IUnknown member of this IUtility interface
00890             implementation that delegates to m_pUnkOuter, whatever it is.
00891
00892   Args:     void
00893
00894   Modifies: m_cRefI.
00895
00896   Returns:  ULONG
00897               Returned by the delegated outer AddRef call.
00898 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00899 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::AddRef(void)
00900 {
00901   // Increment the Interface Reference Count.
00902   ++m_cRefI;
00903
00904   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Addref. Delegating. New cI=%i.", m_cRefI);
00905
00906   // Delegate this call to the outer object's AddRef.
00907   return m_pUnkOuter->AddRef();
00908 }
00909
00910
00911 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00912   Method:   COUtilityCruiseCar::CImpIUtility::Release
00913
00914   Summary:  The Release IUnknown member of this IUtility interface
00915             implementation that delegates to m_pUnkOuter, whatever it is.
00916
00917   Args:     void
00918
00919   Modifies: .
00920
00921   Returns:  ULONG
00922               Returned by the delegated outer Release call.
00923 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00924 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::Release(void)
00925 {
00926   // Decrement the Interface Reference Count.
00927   --m_cRefI;
00928
00929   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Release. Delegating. New cI=%i.", m_cRefI);
00930
00931   // Delegate this call to the outer object's Release.
00932   return m_pUnkOuter->Release();
00933 }
00934
00935
00936 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00937   Method:   COUtilityCruiseCar::CImpIUtility::Offroad
00938
00939   Summary:  The Offroad member method of this IUtility interface
00940             implementation.  A simple empty method on a COUtilityCruiseCar
00941             COM object for tutorial purposes.  Presumably if this
00942             UtilityCruise Car object were modeling a real Car then the
00943             Offroad method would function the 4-wheel drive transfer case
00944             and shift it to the specified 4-wheel drive mode.
00945
00946   Args:     short nGear
00947               0 = 2H or regular 2-wheel drive;
00948               1 = 4H or 4-wheel drive high speed;
00949               2 = neutral; and
00950               3 = 4L or 4-wheel drive low speed).
00951
00952   Modifies: .
00953
00954   Returns:  HRESULT
00955               NOERROR
00956 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00957 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Offroad(
00958                short nGear)
00959 {
00960   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Offroad. Called. nGear=%i.",nGear);
00961
00962   // We don't delegate because this IUtility implementation is native to
00963   // the composite COUtilityCruiseCar object.
00964
00965   return NOERROR;
00966 }
00967
00968
00969 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00970   Method:   COUtilityCruiseCar::CImpIUtility::Winch
00971
00972   Summary:  The Winch member method of this IUtility interface
00973             implementation.  A simple empty method on a COUtilityCruiseCar
00974             COM object for tutorial purposes.  Presumably if this
00975             UtilityCruiseCar object were modeling a real Car then the
00976             Winch method would turn on/off the front-mounted Winch to the
00977             specified RPMs.
00978
00979   Args:     short nRpm
00980               0 = off; 1 - 50 RPM.
00981
00982   Modifies: .
00983
00984   Returns:  HRESULT
00985               NOERROR
00986 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00987 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Winch(
00988                short nRpm)
00989 {
00990   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Winch. Called. nRpm=%i.",nRpm);
00991
00992   // We don't delegate because this IUtility implementation is native to
00993   // the composite COUtilityCruiseCar object.
00994
00995   return NOERROR;
00996 }
00997
00998
00999 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01000   Function: CreateUtilityCruiseCar
01001
01002   Summary:  Creates an instance of the COUtilityCruiseCar COM object class
01003             returning a requested interface pointer. COUtilityCruiseCar
01004             uses the Containment reuse technique to incorporate
01005             COCruiseCar features (ie, ICar and ICruise implementations)
01006             into its Interface offerings of IUnknown and IUtility. With
01007             this containment, the ICar and ICruise interfaces are
01008             implemented in COUtilityCruiseCar as delegating interfaces
01009             that delegate to their matching interface implementations in
01010             an instance of the contained COCruiseCar.  COCruiseCar is
01011             provided by the outside LOCSERVE.EXE server.
01012
01013   Args:     IUnknown* pUnkOuter,
01014               Pointer the outer Unknown interface.  Non NULL implies
01015               that the new COM object is being created via an
01016               aggregation with an Outer object.  NULL implies that the
01017               object is not being created via aggregation.
01018             REFIID riid,
01019               The GUID of the interface requested on the new COM Object.
01020             PPVOID ppv)
01021               Address of the caller's pointer variable that will
01022               receive the requested interface pointer.
01023
01024   Returns:  HRESULT
01025               NOERROR if successful, CLASS_E_NOAGREGATION if IUnknown is
01026               not requested with non-NULL pUnkOuter, or other errors as
01027               appropriate.
01028 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01029 HRESULT CreateUtilityCruiseCar(
01030           IUnknown* pUnkOuter,
01031           REFIID riid,
01032           PPVOID ppv)
01033 {
01034   HRESULT hr;
01035   COUtilityCruiseCar* pCob;
01036
01037   LOGF1("C: CreateUtilityCruiseCar. pUnkOuter=0x%X.",pUnkOuter);
01038
01039   // If the creation call is requesting aggregation (pUnkOuter != NULL),
01040   // the COM rules state the IUnknown interface MUST also be concomitantly
01041   // requested.  If it is not so requested ( riid != IID_IUnknown) then
01042   // an error must be returned indicating that no aggregate creation of
01043   // the COUtilityCruiseCar COM Object can be performed using anything
01044   // other than a controlling IUnknown interface.
01045   if (NULL != pUnkOuter && riid != IID_IUnknown)
01046     hr = CLASS_E_NOAGGREGATION;
01047   else
01048   {
01049     // Instantiate a COUtilityCruiseCar COM Object.
01050     pCob = new COUtilityCruiseCar(pUnkOuter);
01051     if (NULL != pCob)
01052     {
01053       // If we have succeeded in instantiating the COUtilityCruiseCar object
01054       // we initialize it (with any subordinate COM objects) to offer it's
01055       // interfaces.
01056       hr = pCob->Init();
01057       if (SUCCEEDED(hr))
01058       {
01059         // We QueryInterface this new COM Object not only to deposit the
01060         // main interface pointer to the caller's pointer variable, but to
01061         // also automatically bump the Reference Count on the new COM
01062         // Object after handing out this *ppv reference to it.
01063         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
01064       }
01065       else
01066         DELETE_POINTER(pCob);
01067     }
01068     else
01069       hr = E_OUTOFMEMORY;
01070   }
01071
01072   if (SUCCEEDED(hr))
01073   {
01074     LOGF1("C: CreateUtilityCruiseCar Succeeded. *ppv=0x%X.",*ppv);
01075   }
01076   else
01077   {
01078     LOGF1("C: CreateUtilityCruiseCar Failed. hr=0x%X.",hr);
01079   }
01080
01081   return hr;
01082 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/basedialog.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

basedialog.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  BaseDialog.h:  Interface for the CBaseDialog class.  This is the base
00014 //                 class for modeless dialogs.
00015 //
00016
00017
00018 #ifndef _CLASS_BASEDIALOG_
00019 #define _CLASS_BASEDIALOG_
00020
00021 #include <Windows.h>
00022
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CBaseDialog
00031 {
00032   private:
00033     HWND     m_hWnd;         // Handle from CreateDialogParam
00034     ULONG    m_nTemplate;    // Dialog template ID
00035     DLGPROC  m_DlgProc;      // Points to Dialog Proc
00036     DWORD    m_dwFlags;      // Create flags
00037
00038   public:
00039     CBaseDialog( ULONG nTemplate = 0 );
00040     virtual ~CBaseDialog();
00041
00042     virtual HWND Create( HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags = 0 );
00043
00044   protected:
00045     static BOOL CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00046
00047     virtual LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00048     virtual LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00049     virtual LRESULT OnCancel( HWND hDlg, WPARAM wParam, LPARAM lParam );
00050     virtual LRESULT OnNcDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00051     virtual LRESULT OnDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00052     virtual LRESULT OnClose( HWND hDlg, WPARAM wParam, LPARAM lParam );
00053
00054   public:
00055     virtual BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0;
00056
00057 };
00058
00059
00060 #endif //_CLASS_BASEDIALOG_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/InputTag.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

InputTag.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       inputtag.hxx
00006 //
00007 //  Contents:   Parsing algorithm for input tags
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __INPUTTAG_HXX__ )
00012 #define __INPUTTAG_HXX__
00013
00014 #include <htmlelem.hxx>
00015
00016
00017 //+-------------------------------------------------------------------------
00018 //
00019 //  Class:      CInputTag
00020 //
00021 //  Purpose:    Parsing algorithm for input tag in Html
00022 //
00023 //--------------------------------------------------------------------------
00024
00025 class CInputTag : public CHtmlElement
00026 {
00027
00028 public:
00029     CInputTag( CHtmlIFilter& htmlIFilter, CSerialStream& serialStream );
00030
00031     virtual SCODE    GetChunk( STAT_CHUNK *pStat );
00032     virtual SCODE    GetText( ULONG *pcwcOutput, WCHAR *awcBuffer );
00033
00034     virtual void     InitStatChunk( STAT_CHUNK *pStat );
00035
00036 private:
00037     WCHAR *          _pwcValueBuf;            // Buffer for value field
00038     unsigned         _cValueChars;            // # chars in value buffer
00039     unsigned         _cValueCharsFiltered;    // # chars in value buffer already filtered
00040 };
00041
00042
00043 #endif // __INPUTTAG_HXX__
00044
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ADOConnectionConstruction.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ADOConnectionConstruction.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ADOConnectionConstruction
00019 /** @com.interface(iid=00000551-0000-0010-8000-00AA006D2EA4, thread=AUTO) */
00020 public interface ADOConnectionConstruction extends msado15.ADOConnectionConstruction15
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00024   public IUnknown getDSO();
00025
00026   /** @com.method(vtoffset=1, addFlagsVtable=4)
00027       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00028   public IUnknown getSession();
00029
00030   /** @com.method(vtoffset=2, addFlagsVtable=4)
00031       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] pDSO, [in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] pSession) */
00032   public void WrapDSOandSession(IUnknown pDSO, IUnknown pSession);
00033
00034
00035   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x551, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00036 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/csharp/PluginAdmin.cs Source File

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • csharp

PluginAdmin.cs

Go to the documentation of this file.
00001 ﻿//------------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // PluginAdmin
00007 //
00008 //  Inherits auto-generated cacheproxysampleplugin.cs (class PersistedConfiguration)
00009 //  Exposes admin interface
00010 //  Implements loading from file and persisting to file
00011 // *******************NOTE*****************************
00012 //THIS COMPONENT IS IMPLEMENTED FOR DEMONSTRATION PURPOSES ONLY.
00013 // CURRENT PLUGIN IMPLEMENTATION DOESN'T USE ANY OF ITS CONFIGURATION SETTINGS
00014 // THOUGH IT SHOWS HOW EASILY THE PLUGIN ADMIN CAN BE USED
00015 //------------------------------------------------------------------------------
00016
00017
00018
00019 using System.Xml.Serialization;
00020 using System;
00021 using System.IO;
00022 using System.Xml;
00023 using Microsoft.WindowsMediaServices.Interop;
00024 using System.Runtime.InteropServices;
00025 using System.Diagnostics;
00026
00027 [Guid("b70d2b4d-3ff5-4ac0-8d23-0fb974618b05")]
00028 public interface IWMSCacheAdmin
00029 {
00030     int DiskQuota { get; set; }
00031     string CacheDirectoryPath { get; set; }
00032     bool ProxyOnDemandCacheMiss { get; set; }
00033     string PreferredProtocol { get; set; }
00034     bool CacheOnDemandCacheMiss { get; set; }
00035     int ArchiveQuotaPerStream { get; set; }
00036     string ProxyRedirectURL { get; set; }
00037     string BackendServer { get; set; }
00038 }
00039
00040 /// <remarks/>
00041 [ComVisible( true ) ]
00042 [ClassInterface( ClassInterfaceType.AutoDual ) ]
00043 [IDispatchImpl( System.Runtime.InteropServices.IDispatchImplType.CompatibleImpl)]
00044 public class CachePluginAdmin : IWMSCacheAdmin
00045 {
00046     private PersistedConfiguration SerializedValues;
00047     private string strPathToConfigDoc = "";
00048     private WMSNamedValues g_NamedValues = null;
00049     public delegate void ModifySettingsEventHandler( string strName, object objValue );
00050     private ModifySettingsEventHandler RegisteredChangeHandler = null;
00051
00052     public CachePluginAdmin()
00053     {
00054         SerializedValues = new PersistedConfiguration();
00055         SerializedValues.diskQuota = -1;
00056         SerializedValues.archiveQuotaPerStream = -1;
00057         SerializedValues.reverseProxyRedirectURL = "";
00058         SerializedValues.backendServer = "";
00059         SerializedValues.enableCaching = false;
00060         SerializedValues.enableProxy = false;
00061         SerializedValues.proxyOnDemandCacheMiss = false;
00062         SerializedValues.cacheOnDemandCacheMiss = false;
00063         SerializedValues.handleUpstreamCacheRequests = false;
00064         SerializedValues.protocol = protocolEnum.clientprotocol;
00065         RegisteredChangeHandler = null;
00066     }
00067
00068     public WMSNamedValues NamedValues
00069     {
00070         set
00071         {
00072             if( null == g_NamedValues )
00073             {
00074                 Console.WriteLine( "Named values now set" );
00075                 g_NamedValues = value;
00076             }
00077         }
00078     }
00079
00080     public void LoadSettingsFromServerNamespace()
00081     {
00082         if( null == g_NamedValues )
00083         {
00084             return;
00085         }
00086         if( null == SerializedValues )
00087         {
00088             SerializedValues = new PersistedConfiguration();
00089             FetchNameValFromServerNamespace( "ArchiveQuotaPerStream", SerializedValues.archiveQuotaPerStream );
00090             FetchNameValFromServerNamespace( "BackendServer", SerializedValues.backendServer );
00091             FetchNameValFromServerNamespace( "CacheDirectoryPath", SerializedValues.cacheDirectoryPath );
00092             FetchNameValFromServerNamespace( "CacheOnDemandCacheMiss", SerializedValues.cacheOnDemandCacheMiss );
00093             FetchNameValFromServerNamespace( "DiskQuota", SerializedValues.diskQuota );
00094             FetchNameValFromServerNamespace( "EnableCaching", SerializedValues.enableCaching );
00095             FetchNameValFromServerNamespace( "EnableProxy", SerializedValues.enableProxy );
00096             FetchNameValFromServerNamespace( "HandleUpstreamCacheRequests", SerializedValues.handleUpstreamCacheRequests );
00097             FetchNameValFromServerNamespace( "PreferredProtocol", SerializedValues.protocol );
00098             FetchNameValFromServerNamespace( "ProxyOnDemandCacheMiss", SerializedValues.proxyOnDemandCacheMiss );
00099             FetchNameValFromServerNamespace( "ReverseProxyRedirectURL", SerializedValues.reverseProxyRedirectURL );
00100         }
00101     }
00102
00103     public bool LoadSettingsFromXmlFile( string strPath )
00104     {
00105         FileStream fs = null;
00106         bool bSucceeded = false;
00107         try
00108         {
00109             // A FileStream is needed to read the XML document.
00110             fs = new FileStream( strPath, FileMode.Open);
00111         }
00112         catch( Exception e )
00113         {
00114             Console.WriteLine( "Exception: {0}\n{1}", e.Message, e.StackTrace );
00115             return( false );
00116         }
00117
00118         XmlTextReader reader = new XmlTextReader(fs);
00119
00120         // Create an instance of the XmlSerializer specifying type and namespace.
00121         XmlSerializer serializer = new XmlSerializer( typeof( PersistedConfiguration ) );
00122
00123         PersistedConfiguration tmpSettings = null;
00124
00125         try
00126         {
00127             tmpSettings = (PersistedConfiguration) serializer.Deserialize( reader );
00128         }
00129         catch( Exception e )
00130         {
00131             Console.WriteLine( "Exception: {0}\n{1}", e.Message, e.StackTrace );
00132         }
00133         if( null != tmpSettings )
00134         {
00135             SerializedValues = null;
00136             SerializedValues = tmpSettings;
00137             tmpSettings = null;
00138             bSucceeded = true;
00139         }
00140
00141         serializer = null;
00142         reader.Close();
00143         reader = null;
00144         strPathToConfigDoc = strPath;
00145         return( bSucceeded );
00146     }
00147
00148     public void PersistChangesToXmlFile( string strPath )
00149     {
00150         XmlTextWriter writer = new XmlTextWriter( strPath, System.Text.Encoding.UTF8 );
00151
00152         // Create an instance of the XmlSerializer specifying type and namespace.
00153         XmlSerializer serializer = new XmlSerializer( typeof( PersistedConfiguration ) );
00154
00155         serializer.Serialize( writer, ( object ) SerializedValues );
00156         strPathToConfigDoc = strPath;
00157
00158         writer.Flush();
00159         writer.Close();
00160         writer = null;
00161         serializer = null;
00162     }
00163
00164     public void PersistChangesToXmlFile()
00165     {
00166         if( 0 < strPathToConfigDoc.Length )
00167         {
00168             PersistChangesToXmlFile( strPathToConfigDoc );
00169         }
00170     }
00171
00172     public void RegisterChangeHandler( ModifySettingsEventHandler theHandler )
00173     {
00174         RegisteredChangeHandler = theHandler;
00175     }
00176
00177     public object FetchNameValFromServerNamespace( string strKey, object objValue )
00178     {
00179         if( null == g_NamedValues )
00180         {
00181             return( null );
00182         }
00183         foreach( IWMSNamedValue NamedVal in g_NamedValues )
00184         {
00185             if( NamedVal.Name == strKey )
00186             {
00187                 return( NamedVal.Value );
00188             }
00189         }
00190         return( null );
00191     }
00192
00193     public void PersistNameValToServerNamespace( string strKey, object objValue )
00194     {
00195         if( null == g_NamedValues )
00196         {
00197             return;
00198         }
00199         bool bPersisted = false;
00200         foreach( IWMSNamedValue NamedVal in g_NamedValues )
00201         {
00202             if( NamedVal.Name == strKey )
00203             {
00204                 // Console.WriteLine( "Persisting {0} to the server namespace: {1}", strKey, objValue );
00205                 NamedVal.Value = objValue;
00206                 bPersisted = false;
00207                 break;
00208             }
00209         }
00210         if( ! bPersisted )
00211         {
00212             g_NamedValues.Add( strKey, objValue );
00213         }
00214     }
00215
00216     public void RegisterChange( string strName, object objValue )
00217     {
00218         // invoke callback
00219         if( null != RegisteredChangeHandler )
00220         {
00221             // persist the changes back to disk
00222             PersistChangesToXmlFile();
00223             RegisteredChangeHandler( strName, objValue );
00224         }
00225     }
00226
00227     //--------------------------------------------------
00228     //
00229     //  IWMSCacheAdmin interface
00230     //
00231     //--------------------------------------------------
00232     int IWMSCacheAdmin.DiskQuota
00233     {
00234         // [DispIdAttribute( 1 )]
00235         get { return( SerializedValues.diskQuota ); }
00236         // [DispIdAttribute( 1 )]
00237         set
00238         {
00239             if( value != SerializedValues.diskQuota )
00240             {
00241                 SerializedValues.diskQuota = value;
00242                 RegisterChange( "DiskQuota", value );
00243             }
00244         }
00245     }
00246
00247     string IWMSCacheAdmin.CacheDirectoryPath
00248     {
00249         // [DispIdAttribute( 2 )]
00250         get { return( SerializedValues.cacheDirectoryPath ); }
00251         // [DispIdAttribute( 2 )]
00252         set
00253         {
00254             if( value != SerializedValues.cacheDirectoryPath )
00255             {
00256                 SerializedValues.cacheDirectoryPath = value;
00257                 RegisterChange( "CacheDirectoryPath", value );
00258             }
00259         }
00260     }
00261
00262     bool IWMSCacheAdmin.ProxyOnDemandCacheMiss
00263     {
00264         // [DispIdAttribute( 3 )]
00265         get { return( SerializedValues.proxyOnDemandCacheMiss ); }
00266         // [DispIdAttribute( 3 )]
00267         set
00268         {
00269             if( value != SerializedValues.proxyOnDemandCacheMiss )
00270             {
00271                 SerializedValues.proxyOnDemandCacheMiss = value;
00272                 RegisterChange( "ProxyOnDemandCacheMiss", value );
00273             }
00274         }
00275     }
00276
00277     string IWMSCacheAdmin.PreferredProtocol
00278     {
00279         // [DispIdAttribute( 4 )]
00280         get
00281         {
00282             string strRetVal = "";
00283             switch( SerializedValues.protocol )
00284             {
00285                 case protocolEnum.clientprotocol:
00286                     strRetVal = "clientprotocol";
00287                     break;
00288                 case protocolEnum.HTTP:
00289                     strRetVal = "HTTP";
00290                     break;
00291                 case protocolEnum.RTSPT:
00292                     strRetVal = "RTSPT";
00293                     break;
00294                 case protocolEnum.RTSPU:
00295                     strRetVal = "RTSPU";
00296                     break;
00297             }
00298             return( strRetVal );
00299         }
00300         // [DispIdAttribute( 4 )]
00301         set
00302         {
00303             protocolEnum enumProtocol;
00304             switch( value )
00305             {
00306                 case "clientprotocol":
00307                     enumProtocol = protocolEnum.clientprotocol;
00308                     break;
00309                 case "HTTP":
00310                     enumProtocol = protocolEnum.HTTP;
00311                     break;
00312                 case "RTSPT":
00313                     enumProtocol = protocolEnum.RTSPT;
00314                     break;
00315                 case "RTSPU":
00316                     enumProtocol = protocolEnum.RTSPU;
00317                     break;
00318                 default:
00319                     enumProtocol = protocolEnum.clientprotocol;
00320                     break;
00321             }
00322             if( enumProtocol != SerializedValues.protocol )
00323             {
00324                 RegisterChange( "PreferredProtocol", value );
00325             }
00326         }
00327     }
00328
00329     bool IWMSCacheAdmin.CacheOnDemandCacheMiss
00330     {
00331         // [DispIdAttribute( 5 )]
00332         get { return( SerializedValues.cacheOnDemandCacheMiss ); }
00333         // [DispIdAttribute( 5 )]
00334         set
00335         {
00336             if( value != SerializedValues.cacheOnDemandCacheMiss )
00337             {
00338                 SerializedValues.cacheOnDemandCacheMiss = value;
00339                 RegisterChange( "CacheOnDemandCacheMiss", value );
00340             }
00341         }
00342     }
00343
00344     int IWMSCacheAdmin.ArchiveQuotaPerStream
00345     {
00346         // [DispIdAttribute( 6 )]
00347         get { return( SerializedValues.archiveQuotaPerStream ); }
00348         // [DispIdAttribute( 6 )]
00349         set
00350         {
00351             if( value != SerializedValues.archiveQuotaPerStream )
00352             {
00353                 SerializedValues.archiveQuotaPerStream = value;
00354                 RegisterChange( "ArchiveQuotaPerStream", value );
00355             }
00356         }
00357     }
00358
00359     string IWMSCacheAdmin.ProxyRedirectURL
00360     {
00361         // [DispIdAttribute( 7 )]
00362         get { return( SerializedValues.reverseProxyRedirectURL ); }
00363         // [DispIdAttribute( 7 )]
00364         set
00365         {
00366             if( value != SerializedValues.reverseProxyRedirectURL )
00367             {
00368                 SerializedValues.reverseProxyRedirectURL = value;
00369                 RegisterChange( "ProxyRedirectURL", value );
00370             }
00371         }
00372     }
00373
00374     string IWMSCacheAdmin.BackendServer
00375     {
00376         // [DispIdAttribute( 8 )]
00377         get { return( SerializedValues.backendServer ); }
00378         // [DispIdAttribute( 8 )]
00379         set
00380         {
00381             if( value != SerializedValues.backendServer )
00382             {
00383                 SerializedValues.backendServer = value;
00384                 RegisterChange( "BackendServer", value );
00385             }
00386         }
00387     }
00388
00389     //--------------------------------------------------
00390     //
00391     //  IDispatch interface
00392     //
00393     //--------------------------------------------------
00394     public int DiskQuota
00395     {
00396         [DispIdAttribute( 1 )]
00397         get { return( SerializedValues.diskQuota ); }
00398         [DispIdAttribute( 1 )]
00399         set
00400         {
00401             if( value != SerializedValues.diskQuota )
00402             {
00403                 SerializedValues.diskQuota = value;
00404                 RegisterChange( "DiskQuota", value );
00405             }
00406         }
00407     }
00408
00409     public string CacheDirectoryPath
00410     {
00411         [DispIdAttribute( 2 )]
00412         get { return( SerializedValues.cacheDirectoryPath ); }
00413         [DispIdAttribute( 2 )]
00414         set
00415         {
00416             if( value != SerializedValues.cacheDirectoryPath )
00417             {
00418                 SerializedValues.cacheDirectoryPath = value;
00419                 RegisterChange( "CacheDirectoryPath", value );
00420             }
00421         }
00422     }
00423
00424     public bool ProxyOnDemandCacheMiss
00425     {
00426         [DispIdAttribute( 3 )]
00427         get { return( SerializedValues.proxyOnDemandCacheMiss ); }
00428         [DispIdAttribute( 3 )]
00429         set
00430         {
00431             if( value != SerializedValues.proxyOnDemandCacheMiss )
00432             {
00433                 SerializedValues.proxyOnDemandCacheMiss = value;
00434                 RegisterChange( "ProxyOnDemandCacheMiss", value );
00435             }
00436         }
00437     }
00438
00439     public string PreferredProtocol
00440     {
00441         [DispIdAttribute( 4 )]
00442         get
00443         {
00444             string strRetVal;
00445             switch( SerializedValues.protocol )
00446             {
00447                 case protocolEnum.HTTP:
00448                     strRetVal = "HTTP";
00449                     break;
00450                 case protocolEnum.RTSPT:
00451                     strRetVal = "RTSPT";
00452                     break;
00453                 case protocolEnum.RTSPU:
00454                     strRetVal = "RTSPU";
00455                     break;
00456                 case protocolEnum.clientprotocol:
00457                     strRetVal = "clientprotocol";
00458                     break;
00459                 default:
00460                     strRetVal = "clientprotocol";
00461                     break;
00462             }
00463             return( strRetVal );
00464         }
00465         [DispIdAttribute( 4 )]
00466         set
00467         {
00468             protocolEnum enumProtocol;
00469             switch( value )
00470             {
00471                 case "HTTP":
00472                     enumProtocol = protocolEnum.HTTP;
00473                     break;
00474                 case "RTSPT":
00475                     enumProtocol = protocolEnum.RTSPT;
00476                     break;
00477                 case "RTSP":
00478                     enumProtocol = protocolEnum.RTSPU;
00479                     break;
00480                 case "RTSPU":
00481                     enumProtocol = protocolEnum.RTSPU;
00482                     break;
00483                 case "clientprotocol":
00484                     enumProtocol = protocolEnum.clientprotocol;
00485                     break;
00486                 default:
00487                     Console.WriteLine( "*** BAD VALUE DETECTED: {0}", value );
00488                     enumProtocol = protocolEnum.clientprotocol;
00489                     break;
00490             }
00491             if( enumProtocol != SerializedValues.protocol )
00492             {
00493                 SerializedValues.protocol = enumProtocol;
00494                 RegisterChange( "PreferredProtocol", value );
00495             }
00496         }
00497     }
00498
00499     public bool CacheOnDemandCacheMiss
00500     {
00501         [DispIdAttribute( 5 )]
00502         get { return( SerializedValues.cacheOnDemandCacheMiss ); }
00503         [DispIdAttribute( 5 )]
00504         set
00505         {
00506             if( value != SerializedValues.cacheOnDemandCacheMiss )
00507             {
00508                 SerializedValues.cacheOnDemandCacheMiss = value;
00509                 RegisterChange( "CacheOnDemandCacheMiss", value );
00510             }
00511         }
00512     }
00513
00514     public int ArchiveQuotaPerStream
00515     {
00516         [DispIdAttribute( 6 )]
00517         get { return( SerializedValues.archiveQuotaPerStream ); }
00518         [DispIdAttribute( 6 )]
00519         set
00520         {
00521             if( value != SerializedValues.archiveQuotaPerStream )
00522             {
00523                 SerializedValues.archiveQuotaPerStream = value;
00524                 RegisterChange( "ArchiveQuotaPerStream", value );
00525             }
00526         }
00527     }
00528
00529     public string ProxyRedirectURL
00530     {
00531         [DispIdAttribute( 7 )]
00532         get { return( SerializedValues.reverseProxyRedirectURL ); }
00533         [DispIdAttribute( 7 )]
00534         set
00535         {
00536             if( value != SerializedValues.reverseProxyRedirectURL )
00537             {
00538                 SerializedValues.reverseProxyRedirectURL = value;
00539                 RegisterChange( "ProxyRedirectURL", value );
00540             }
00541         }
00542     }
00543
00544     public string BackendServer
00545     {
00546         [DispIdAttribute( 8 )]
00547         get { return( SerializedValues.backendServer ); }
00548         [DispIdAttribute( 8 )]
00549         set
00550         {
00551             if( value != SerializedValues.backendServer )
00552             {
00553                 SerializedValues.backendServer = value;
00554                 RegisterChange( "BackendServer", value );
00555             }
00556         }
00557     }
00558 }
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/ATMEvent/ATMEvent.Cpp Source File

  • NetDS
  • WinSock
  • ATMEvent

ATMEvent.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      atmevent.cpp
00010 //
00011 // Abstract:
00012 //      This application demonstrates a very simple-minded Winsock application
00013 //      that uses the native ATM Winsock 2 service provider.  The specific
00014 //      ATM protocol addressing demonstrated by this application is AAL5.  This
00015 //      application makes no attempt to do anything useful per se, but concentrates
00016 //      how setting up a connection using AAL5 and sending some data.  Additionally,
00017 //      this application demonstrates several Winsock2-specific APIs and techniques
00018 //      that are useful whether or not your main interest is ATM or not.
00019 //
00020 //      Commandline parameters determine whether this application functions as
00021 //      either a sender (-n), a receiver (-i), or simply allows ATM interfaces to
00022 //      be enumerated.  When specifying the ATM interface to bind to (on the receiver)
00023 //      or the remote ATM interface to connect to on the sender the interface
00024 //      is a 40 character NSAP address, with the last 2 hex digits (0 - 255 decimal)
00025 //      representing the port.  The commandline switch (-a) can be used to enumerate
00026 //      all ATM interface on the local machine - note the last 2 digits will be 00.
00027 //
00028 //      Use the -? commandline switch to determine available options.
00029 //
00030 //      This application simply sends a buffer of data when acting as the sender,
00031 //      to an instance of itself acting as a receiver.  Any number of senders (up
00032 //      to MAXCLIENTS) can be started to interact with one instance of a receiver.
00033 //      The size of the data buffer (-b), its contents (-d), and the number of
00034 //      times to send (-l) this buffer are controllable via commandline switches.
00035 //      A repeat value of 0 implies continuous sending.  A delay
00036 //      commandline switch (-s:#), measured in milliseconds can be specified for the
00037 //      sender to insure the total transfer spans a measured unit of time.  Additionally,
00038 //      the commandline switch (-s2:#) is available to delay closing the connection,
00039 //      measured in milliseconds, to allow the receiver time to pick up the data.  This
00040 //      is important because neither AAL5 nor this application has any handshake
00041 //      mechanism to determine when the receiver has received all the data - AAL5
00042 //      does not support a graceful connection closure.
00043 //
00044 // Entry Points:
00045 //      main - this is where it all starts
00046 //
00047 // Usage:
00048 //      Enumerate ATM interfaces
00049 //          atmevent -a
00050 //      Act as a sender and send buffer 10 times
00051 //      and wait 2 seconds before closing the connection
00052 //          atmevent -n:receiver_atm_interface -l:10 -c:2000
00053 //      Act as a receiver
00054 //          atmevent -i:local_atm_interface
00055 //
00056 // Build:
00057 //      Use the headers and libs from the May99 Platform SDK or later.
00058 //      Link with ws2_32.lib
00059 //
00060 // Author:
00061 //      Barry R. Butterklee
00062 //
00063
00064 #define ATMEVENT_MAIN
00065 #include "atmevent.h"
00066
00067
00068 static BOOL ValidOptions(int argc, char **argv, OPTIONS *pOptions);
00069 static VOID PrintOptions(OPTIONS *pOptions);
00070 static VOID Usage(CHAR *szProgramname, OPTIONS *pOptions);
00071 static BOOL FindATMServiceProvider(WSAPROTOCOL_INFO *pProtocolInfo);
00072
00073
00074
00075 int __cdecl main(int argc, char **argv)
00076 {
00077     int n = 0;
00078     OPTIONS options;
00079     WSADATA WSAData;
00080
00081     if (!ValidOptions(argc, argv, &options))
00082         return 1;
00083
00084     if (0 != (n = WSAStartup(MAKEWORD(2,2), &WSAData)))
00085     {
00086         printf("WSAStartup failed w/%d\n", n);
00087         return 1;
00088     }
00089
00090     if (!FindATMServiceProvider(&options.protocolInfo))
00091     {
00092         printf("No matching service provider found\n");
00093     } else
00094     {
00095         PrintOptions(&options);
00096         if (CMD_RECEIVER == options.cmd)
00097             Receiver(&options);
00098         else if (CMD_SENDER == options.cmd)
00099             Sender(&options);
00100         else // enumerate ATM interfaces
00101             Enumerator(&options);
00102     }
00103
00104     if (options.buf) Free(options.buf);
00105     WSACleanup();
00106     return 0;
00107 }
00108
00109
00110
00111
00112
00113
00114 // Abstract:
00115 //      Verify options passed in and set options structure accordingly.
00116 //
00117 BOOL ValidOptions(int argc, char **argv, OPTIONS *pOptions)
00118 {
00119     BOOL        bValidOptions = TRUE;
00120     OSVERSIONINFO   verInfo = {0};
00121     OPTIONS     default_options;
00122
00123
00124     pOptions->buf            = NULL;
00125     pOptions->cmd            = CMD_RECEIVER;
00126     pOptions->dwSleep        = 0;
00127     pOptions->dwSleepClose   = 1000;
00128     pOptions->dwTotalClients = 0;
00129     pOptions->fillchar       = 'c';
00130     pOptions->nBufSize       = 4096;
00131     pOptions->nRepeat        = 1;
00132     pOptions->szLocalInterface[0]  = '\0';
00133     pOptions->szRemoteInterface[0] = '\0';
00134     ZeroMemory((LPVOID)&pOptions->protocolInfo, sizeof(pOptions->protocolInfo));
00135     default_options = *pOptions;
00136
00137     for (int i=1; i<argc; i++)
00138     {
00139         if ((argv[i][0] == '-') || (argv[i][0] == '/') )
00140         {
00141             switch (tolower(argv[i][1]))
00142             {
00143             case 'a' :
00144                 pOptions->cmd = CMD_ENUMERATOR;
00145                 break;
00146
00147             case 'b' :
00148                 if (strlen(argv[i]) > 3)
00149                     pOptions->nBufSize = 1024*atoi(&argv[i][3]);
00150                 break;
00151
00152             case 'c' :
00153                 if (strlen(argv[i]) > 3)
00154                     pOptions->dwSleepClose = atoi(&argv[i][3]);
00155                 break;
00156
00157             case 'd' :
00158                 if (strlen(argv[i]) > 3)
00159                     pOptions->fillchar = argv[i][3];
00160                 break;
00161
00162             case 'i' :
00163                 pOptions->cmd = CMD_RECEIVER;
00164                 if (strlen(argv[i]) > 3)
00165                     strncpy(pOptions->szLocalInterface, &argv[i][3],
00166                             sizeof(pOptions->szLocalInterface));
00167                 break;
00168
00169             case 'l' :
00170                 if (strlen(argv[i]) > 3)
00171                     pOptions->nRepeat = atoi(&argv[i][3]);
00172                 break;
00173
00174             case 'n' :
00175                 pOptions->cmd = CMD_SENDER;
00176                 if (strlen(argv[i]) > 3)
00177                     strncpy(pOptions->szRemoteInterface, &argv[i][3],
00178                             sizeof(pOptions->szRemoteInterface));
00179                 break;
00180
00181             case 's' :
00182                 if (strlen(argv[i]) > 3)
00183                     pOptions->dwSleep = atoi(&argv[i][3]);
00184                 break;
00185
00186             case '?' :
00187                 Usage(argv[0], &default_options);
00188                 return FALSE;
00189                 break;
00190
00191             default:
00192                 printf("  unknown options flag %s\n", argv[i]);
00193                 Usage(argv[0], &default_options);
00194                 return FALSE;
00195                 break;
00196             }
00197         } else
00198         {
00199             printf("  unknown option %s\n", argv[i]);
00200             Usage(argv[0], &default_options);
00201             return FALSE;
00202         }
00203     }
00204
00205
00206     if (CMD_RECEIVER == pOptions->cmd)
00207         pOptions->fillchar = 0;
00208
00209     if (!(pOptions->buf = (char *)Malloc(pOptions->nBufSize)))
00210         return FALSE;
00211     else
00212     {
00213         FillMemory(pOptions->buf, pOptions->nBufSize, pOptions->fillchar);
00214         return TRUE;
00215     }
00216 }
00217
00218
00219
00220
00221 // Abstract:
00222 //      Just print the options to be used for this run.
00223 //
00224 static VOID PrintOptions(OPTIONS *pOptions)
00225 {
00226     printf("Options\n");
00227     if (CMD_ENUMERATOR == pOptions->cmd)
00228         printf("  Enumerate ATM interfaces\n");
00229     else if (CMD_RECEIVER == pOptions->cmd)
00230         printf("  Act as Receiver and bind to local interface <%s>\n",
00231                pOptions->szLocalInterface);
00232     else
00233     {
00234         printf("  Act as sender and send to remote interface <%s>\n", pOptions->szRemoteInterface);
00235         printf("  Sleep %d milliseconds between sends\n", pOptions->dwSleep);
00236         printf("  Fill buffer with <%c>\n", pOptions->fillchar);
00237         if (pOptions->nRepeat)
00238             printf("  Repeat sending the buffer %d times\n", pOptions->nRepeat);
00239         else
00240             printf("  Repeat sending the buffer continually\n");
00241     }
00242     printf("  Bufsize %d (bytes)\n", pOptions->nBufSize);
00243     printf("\n");
00244     return;
00245 }
00246
00247
00248
00249
00250 // Abstract:
00251 //      Print out usage table for the program
00252 //
00253 VOID Usage(CHAR *szProgramname, OPTIONS *pOptions)
00254 {
00255     printf("usage:\n  %s -?\n\n", szProgramname);
00256     printf("  %s [-a | -i:interface | -n:interface] [-b:#] [-d:c] [-l:#] [-s:#]\n\n",
00257            szProgramname);
00258     printf("  -?\t\tDisplay this help\n");
00259     printf("\n");
00260     printf("  -a\t\tPrint out all ATM interfaces on this machine\n");
00261     printf("  -i:interface\tAct as receiver and bind to interface\n");
00262     printf("  -n:interface\tAct as sender and connect to remote interface\n");
00263     printf("\n");
00264     printf("  -b:bufsize\tSize of send/recv buffer; in 1K increments (Def:%d)\n",
00265            pOptions->nBufSize);
00266     printf("  -c:#\t\tSleep # milliseconds before closing socket (def: 2000)\n");
00267     printf("  -d:c\t\tCharacter used to fill buffer (Def:%c)\n",
00268            pOptions->fillchar);
00269     printf("  -l:loop\tLoop count for sending buffer (Def:continuous)\n");
00270     printf("  -s:#\t\tSleep # milliseconds between sends (def: 0)\n");
00271     printf("\n");
00272     return;
00273 }
00274
00275
00276
00277 // Abstract:
00278 //      Look for an ATM service provider.
00279 //
00280 //      Notice that actual service provider names are different on NT and Win9x
00281 //      when searching for a service provider, you should not use the service provider
00282 //      name, but instead use the various flags in the protocol structure.
00283 //
00284 BOOL FindATMServiceProvider(
00285                            WSAPROTOCOL_INFO    *pProtocolInfo
00286                            )
00287 {
00288     int nRet = 0;
00289     WSAPROTOCOL_INFO *lpProtocolBuf = NULL;
00290     DWORD dwBufLen = 0;
00291     DWORD dwErr = 0;
00292     BOOL bProtocolFound = FALSE;
00293
00294
00295     // first have WSAEnumProtocols tell us how big a buffer is needed
00296     nRet = WSAEnumProtocols(NULL, lpProtocolBuf, &dwBufLen);
00297     if (SOCKET_ERROR != nRet)
00298     {
00299         printf("WSAEnumProtocols: should not have suceeded\n");
00300     } else if (WSAENOBUFS != (dwErr = WSAGetLastError()))
00301     {
00302         // WSAEnumProtocols failed for some reason not relating to buffer size
00303         printf("WSAEnumProtocols(1): %d\n", WSAGetLastError());
00304     } else
00305     {
00306         // WSAEnumProtocols failed for the "expected" reason, allocate a buffer
00307         // of the needed size
00308         lpProtocolBuf = (WSAPROTOCOL_INFO *)Malloc(dwBufLen);
00309         if (lpProtocolBuf)
00310         {
00311             // now we can call WSAEnumProtocols again with the expectation it will
00312             // succeed because we have allocated a big enough buffer.
00313             nRet = WSAEnumProtocols(NULL, lpProtocolBuf, &dwBufLen);
00314             if (SOCKET_ERROR == nRet)
00315             {
00316                 printf("WSAEnumProtocols(3): %d\n", WSAGetLastError());
00317             } else
00318             {
00319                 // loop thru protocols, looking for a matching service provider
00320                 for (int i=0; i<nRet; i++)
00321                 {
00322                     printf("  sp <%s>\n", lpProtocolBuf[i].szProtocol);
00323                     if (AF_ATM        == lpProtocolBuf[i].iAddressFamily &&
00324                         ATMPROTO_AAL5 == lpProtocolBuf[i].iProtocol &&
00325                         SOCK_RAW      == lpProtocolBuf[i].iSocketType)
00326                     {
00327                         *pProtocolInfo = lpProtocolBuf[i];
00328                         bProtocolFound = TRUE;
00329                         break;
00330                     }
00331                 }
00332             }
00333             if (lpProtocolBuf) Free(lpProtocolBuf);
00334         }
00335     }
00336
00337     if (bProtocolFound)
00338         printf("  Using service provider <%s>\n\n", pProtocolInfo->szProtocol);
00339
00340     return bProtocolFound;
00341 }
00342
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows.Net/policy.h Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows.Net

policy.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 1999
00006 //
00007 //  File:       policy.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "certpsam.h"
00012 #include "resource.h"
00013
00014 #ifndef wszATTREMAIL1
00015 # define wszATTREMAIL1      TEXT("E")
00016 # define wszATTREMAIL2      TEXT("EMail")
00017 #endif
00018
00019 #ifndef wszCERTTYPE_SUBORDINATE_CA
00020 # define wszCERTTYPE_SUBORDINATE_CA L"SubCA"
00021 #endif
00022
00023 #ifndef wszCERTTYPE_CROSS_CA
00024 # define wszCERTTYPE_CROSS_CA   L"CrossCA"
00025 #endif
00026
00027 extern BOOL fDebug;
00028
00029 HRESULT
00030 ReqInitialize(
00031     IN ICertServerPolicy *pServer);
00032
00033 VOID
00034 ReqCleanup(VOID);
00035
00036
00037 class CRequestInstance;
00038
00039 #ifndef __BSTRC__DEFINED__
00040 #define __BSTRC__DEFINED__
00041 typedef OLECHAR const *BSTRC;
00042 #endif
00043
00044 HRESULT
00045 polGetServerCallbackInterface(
00046     OUT ICertServerPolicy **ppServer,
00047     IN LONG Context);
00048
00049 HRESULT
00050 polGetRequestStringProperty(
00051     IN ICertServerPolicy *pServer,
00052     IN WCHAR const *pwszPropertyName,
00053     OUT BSTR *pstrOut);
00054
00055 HRESULT
00056 polGetCertificateStringProperty(
00057     IN ICertServerPolicy *pServer,
00058     IN WCHAR const *pwszPropertyName,
00059     OUT BSTR *pstrOut);
00060
00061 HRESULT
00062 polGetRequestLongProperty(
00063     IN ICertServerPolicy *pServer,
00064     IN WCHAR const *pwszPropertyName,
00065     OUT LONG *plOut);
00066
00067 HRESULT
00068 polGetCertificateLongProperty(
00069     IN ICertServerPolicy *pServer,
00070     IN WCHAR const *pwszPropertyName,
00071     OUT LONG *plOut);
00072
00073 HRESULT
00074 polGetRequestAttribute(
00075     IN ICertServerPolicy *pServer,
00076     IN WCHAR const *pwszAttributeName,
00077     OUT BSTR *pstrOut);
00078
00079 HRESULT
00080 polGetCertificateExtension(
00081     IN ICertServerPolicy *pServer,
00082     IN WCHAR const *pwszExtensionName,
00083     IN DWORD dwPropType,
00084     IN OUT VARIANT *pvarOut);
00085
00086 HRESULT
00087 polSetCertificateExtension(
00088     IN ICertServerPolicy *pServer,
00089     IN WCHAR const *pwszExtensionName,
00090     IN DWORD dwPropType,
00091     IN DWORD dwExtFlags,
00092     IN VARIANT const *pvarIn);
00093
00094 DWORD
00095 polFindObjIdInList(
00096     IN WCHAR const *pwsz,
00097     IN DWORD count,
00098     IN WCHAR const * const *ppwsz);
00099
00100 //
00101 // Class CCertPolicySample
00102 //
00103 // Actual policy module for a CA Policy
00104 //
00105 //
00106
00107 class CCertPolicySample:
00108     public CComDualImpl<ICertPolicy2, &IID_ICertPolicy2, &LIBID_CERTPOLICYSAMPLELib>,
00109     public ISupportErrorInfo,
00110     public CComObjectRoot,
00111     public CComCoClass<CCertPolicySample, &CLSID_CCertPolicySample>
00112 {
00113 public:
00114     CCertPolicySample()
00115     {
00116   m_strDescription = NULL;
00117
00118         // RevocationExtension variables:
00119
00120   m_dwRevocationFlags = 0;
00121   m_wszASPRevocationURL = NULL;
00122
00123         m_dwDispositionFlags = 0;
00124         m_dwEditFlags = 0;
00125
00126   m_cEnableRequestExtensions = 0;
00127   m_apwszEnableRequestExtensions = NULL;
00128
00129   m_cEnableEnrolleeRequestExtensions = 0;
00130   m_apwszEnableEnrolleeRequestExtensions = NULL;
00131
00132   m_cDisableExtensions = 0;
00133   m_apwszDisableExtensions = NULL;
00134
00135   // CA Name
00136         m_strRegStorageLoc = NULL;
00137
00138   m_strCAName = NULL;
00139         m_strCASanitizedName = NULL;
00140         m_strCASanitizedDSName = NULL;
00141         m_strMachineDNSName = NULL;
00142
00143         // CA and cert type info
00144
00145         m_CAType = ENUM_UNKNOWN_CA;
00146
00147         m_pCert = NULL;
00148         m_iCRL = 0;
00149
00150     }
00151     ~CCertPolicySample();
00152
00153 BEGIN_COM_MAP(CCertPolicySample)
00154     COM_INTERFACE_ENTRY(IDispatch)
00155     COM_INTERFACE_ENTRY(ICertPolicy)
00156     COM_INTERFACE_ENTRY(ICertPolicy2)
00157     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00158 END_COM_MAP()
00159
00160 DECLARE_NOT_AGGREGATABLE(CCertPolicySample)
00161 // Remove the comment from the line above if you don't want your object to
00162 // support aggregation.  The default is to support it
00163
00164 DECLARE_REGISTRY(
00165     CCertPolicySample,
00166     wszCLASS_CERTPOLICYSAMPLE TEXT(".1"),
00167     wszCLASS_CERTPOLICYSAMPLE,
00168     IDS_CERTPOLICY_DESC,
00169     THREADFLAGS_BOTH)
00170
00171 // ISupportsErrorInfo
00172     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00173
00174 // ICertPolicy
00175 public:
00176     STDMETHOD(Initialize)(
00177     /* [in] */ BSTR const strConfig);
00178
00179     STDMETHOD(VerifyRequest)(
00180     /* [in] */ BSTR const strConfig,
00181     /* [in] */ LONG Context,
00182     /* [in] */ LONG bNewRequest,
00183     /* [in] */ LONG Flags,
00184     /* [out, retval] */ LONG __RPC_FAR *pDisposition);
00185
00186     STDMETHOD(GetDescription)(
00187     /* [out, retval] */ BSTR __RPC_FAR *pstrDescription);
00188
00189     STDMETHOD(ShutDown)();
00190
00191 // ICertPolicy2
00192 public:
00193     STDMETHOD(GetManageModule)(
00194     /* [out, retval] */ ICertManageModule **ppManageModule);
00195
00196 public:
00197     HRESULT AddBasicConstraintsCommon(
00198     IN ICertServerPolicy *pServer,
00199     IN CERT_EXTENSION const *pExtension,
00200     IN BOOL fCA,
00201     IN BOOL fEnableExtension);
00202
00203     BSTRC GetPolicyDescription() { return(m_strDescription); }
00204
00205
00206     HRESULT AddV1TemplateNameExtension(
00207     IN ICertServerPolicy *pServer,
00208     OPTIONAL IN WCHAR const *pwszTemplateName);
00209
00210 private:
00211     CERT_CONTEXT const *_GetIssuer(
00212     IN ICertServerPolicy *pServer);
00213
00214     HRESULT _EnumerateExtensions(
00215     IN ICertServerPolicy *pServer,
00216     IN LONG bNewRequest,
00217     IN BOOL fFirstPass,
00218     IN BOOL fEnableEnrolleeExtensions,
00219     IN DWORD cCriticalExtensions,
00220     IN WCHAR const * const *apwszCriticalExtensions);
00221
00222 #if DBG_CERTSRV
00223     VOID _DumpStringArray(
00224     IN char const *pszType,
00225     IN DWORD count,
00226     IN LPWSTR const *apwsz);
00227 #else
00228     #define _DumpStringArray(pszType, count, apwsz)
00229 #endif
00230
00231     VOID _FreeStringArray(
00232     IN OUT DWORD *pcString,
00233     IN OUT LPWSTR **papwsz);
00234
00235     VOID _Cleanup();
00236
00237
00238     HRESULT _SetSystemStringProp(
00239     IN ICertServerPolicy *pServer,
00240     IN WCHAR const *pwszName,
00241     OPTIONAL IN WCHAR const *pwszValue);
00242
00243     HRESULT _AddStringArray(
00244     IN WCHAR const *pwszzValue,
00245     IN BOOL fURL,
00246     IN OUT DWORD *pcStrings,
00247     IN OUT LPWSTR **papwszRegValues);
00248
00249     HRESULT _ReadRegistryString(
00250     IN HKEY hkey,
00251     IN BOOL fURL,
00252     IN WCHAR const *pwszRegName,
00253     IN WCHAR const *pwszSuffix,
00254     OUT LPWSTR *pwszRegValue);
00255
00256     HRESULT _ReadRegistryStringArray(
00257     IN HKEY hkey,
00258     IN BOOL fURL,
00259     IN DWORD dwFlags,
00260     IN DWORD cRegNames,
00261     IN DWORD *aFlags,
00262     IN WCHAR const * const *apwszRegNames,
00263     IN OUT DWORD *pcStrings,
00264     IN OUT LPWSTR **papwszRegValues);
00265
00266     VOID _InitRevocationExtension(
00267     IN HKEY hkey);
00268
00269     VOID _InitRequestExtensionList(
00270     IN HKEY hkey);
00271
00272     VOID _InitDisableExtensionList(
00273     IN HKEY hkey);
00274
00275     HRESULT _AddRevocationExtension(
00276     IN ICertServerPolicy *pServer);
00277
00278     HRESULT _AddOldCertTypeExtension(
00279     IN ICertServerPolicy *pServer,
00280     IN BOOL fCA);
00281
00282     HRESULT _AddAuthorityKeyId(
00283     IN ICertServerPolicy *pServer);
00284
00285     HRESULT _AddDefaultKeyUsageExtension(
00286     IN ICertServerPolicy *pServer,
00287     IN BOOL fCA);
00288
00289     HRESULT _AddEnhancedKeyUsageExtension(
00290     IN ICertServerPolicy *pServer);
00291
00292     HRESULT _AddDefaultBasicConstraintsExtension(
00293     IN ICertServerPolicy *pServer,
00294     IN BOOL fCA);
00295
00296     HRESULT _SetValidityPeriod(
00297     IN ICertServerPolicy *pServer);
00298
00299
00300 private:
00301     // RevocationExtension variables:
00302
00303     CERT_CONTEXT const *m_pCert;
00304
00305     BSTR m_strDescription;
00306
00307     DWORD m_dwRevocationFlags;
00308     LPWSTR m_wszASPRevocationURL;
00309
00310     DWORD m_dwDispositionFlags;
00311     DWORD m_dwEditFlags;
00312     DWORD m_CAPathLength;
00313
00314     DWORD m_cEnableRequestExtensions;
00315     LPWSTR *m_apwszEnableRequestExtensions;
00316
00317     DWORD m_cEnableEnrolleeRequestExtensions;
00318     LPWSTR *m_apwszEnableEnrolleeRequestExtensions;
00319
00320     DWORD m_cDisableExtensions;
00321     LPWSTR *m_apwszDisableExtensions;
00322
00323     // CertTypeExtension variables:
00324
00325     BSTR m_strRegStorageLoc;
00326     BSTR m_strCAName;
00327
00328     BSTR m_strCASanitizedName;
00329     BSTR m_strCASanitizedDSName;
00330
00331     BSTR m_strMachineDNSName;
00332
00333     // CA and cert type info
00334
00335     ENUM_CATYPES m_CAType;
00336
00337     DWORD m_iCert;
00338     DWORD m_iCRL;
00339
00340 };
00341
00342 //
00343 // Class CRequestInstance
00344 //
00345 // Instance data for a certificate that is being created.
00346 //
00347
00348 class CRequestInstance
00349 {
00350
00351 public:
00352     CRequestInstance()
00353     {
00354         m_strTemplateName = NULL;
00355   m_strTemplateObjId = NULL;
00356   m_pPolicy = NULL;
00357
00358     }
00359
00360     ~CRequestInstance();
00361
00362     HRESULT Initialize(
00363     IN CCertPolicySample *pPolicy,
00364     IN ICertServerPolicy *pServer,
00365     OUT BOOL *pfEnableEnrolleeExtensions);
00366
00367     HRESULT SetTemplateName(
00368     IN ICertServerPolicy *pServer,
00369     IN OPTIONAL WCHAR const *pwszTemplateName,
00370     IN OPTIONAL WCHAR const *pwszTemplateObjId);
00371
00372     BSTRC GetTemplateName() { return(m_strTemplateName); }
00373     BSTRC GetTemplateObjId() { return(m_strTemplateObjId); }
00374
00375
00376     BOOL IsCARequest() { return(m_fCA); }
00377
00378     CCertPolicySample *GetPolicy() { return(m_pPolicy); }
00379
00380 private:
00381
00382     HRESULT _SetFlagsProperty(
00383     IN ICertServerPolicy *pServer,
00384     IN WCHAR const *pwszPropName,
00385     IN DWORD dwFlags);
00386
00387     BOOL _TemplateNamesMatch(
00388     IN WCHAR const *pwszTemplateName1,
00389     IN WCHAR const *pwszTemplateName2,
00390     OUT BOOL *pfTemplateMissing);
00391
00392     VOID _Cleanup();
00393 private:
00394     CCertPolicySample *m_pPolicy;
00395     BSTR                   m_strTemplateName; // certificate type requested
00396     BSTR                   m_strTemplateObjId;  // certificate type requested
00397     DWORD                  m_dwTemplateMajorVersion;
00398     DWORD                  m_dwTemplateMinorVersion;
00399     BOOL                   m_fCA;
00400 };
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EXEDLLICONINFO Member List

This is the complete list of members for EXEDLLICONINFO, including all inherited members.
hInstance | EXEDLLICONINFO
pID | EXEDLLICONINFO
szFileName | EXEDLLICONINFO
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

qcorder::IOrderDefault Member List

This is the complete list of members for qcorder::IOrderDefault, including all inherited members.
iid | qcorder::IOrderDefault | [static]
LineItem(int lItemId, int lQuantity) | qcorder::IOrderDefault |
Process(int lFlags) | qcorder::IOrderDefault |
setCustomerId(int _jcomparam_0) | qcorder::IOrderDefault |
setOrderId(int _jcomparam_0) | qcorder::IOrderDefault |
Generated on Wed Nov 13 2024 16:58:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/ADOVCGEN/advcgen.cpp Source File

  • Dataaccess
  • ADO
  • ADOVCGEN

advcgen.cpp

Go to the documentation of this file.
00001 // ADVCGEN.cpp : Defines the class behaviors for the application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "ADVCGEN.h"
00006 #include "ADVCGENDlg.h"
00007
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CADVCGENApp
00016
00017 BEGIN_MESSAGE_MAP(CADVCGENApp, CWinApp)
00018   //{{AFX_MSG_MAP(CADVCGENApp)
00019     // NOTE - the ClassWizard will add and remove mapping macros here.
00020     //    DO NOT EDIT what you see in these blocks of generated code!
00021   //}}AFX_MSG
00022   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00023 END_MESSAGE_MAP()
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // CADVCGENApp construction
00027
00028 CADVCGENApp::CADVCGENApp()
00029 {
00030   // TODO: add construction code here,
00031   // Place all significant initialization in InitInstance
00032 }
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // The one and only CADVCGENApp object
00036
00037 CADVCGENApp theApp;
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // CADVCGENApp initialization
00041
00042 BOOL CADVCGENApp::InitInstance()
00043 {
00044   AfxEnableControlContainer();
00045
00046   // Standard initialization
00047   // If you are not using these features and wish to reduce the size
00048   //  of your final executable, you should remove from the following
00049   //  the specific initialization routines you do not need.
00050
00051 #ifdef _AFXDLL
00052   Enable3dControls();     // Call this when using MFC in a shared DLL
00053 #else
00054   Enable3dControlsStatic(); // Call this when linking to MFC statically
00055 #endif
00056
00057   CADVCGENDlg dlg;
00058   m_pMainWnd = &dlg;
00059   int nResponse = dlg.DoModal();
00060   if (nResponse == IDOK)
00061   {
00062     // TODO: Place code here to handle when the dialog is
00063     //  dismissed with OK
00064   }
00065   else if (nResponse == IDCANCEL)
00066   {
00067     // TODO: Place code here to handle when the dialog is
00068     //  dismissed with Cancel
00069   }
00070
00071   // Since the dialog has been closed, return FALSE so that we exit the
00072   //  application, rather than start the application's message pump.
00073   return FALSE;
00074 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/sky.Cpp Source File

  • SysMgmt
  • MMC
  • Nameext

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include <stdio.h>
00021 #include "sky.h"
00022
00023
00024 const GUID CSkyVehicle::thisGuid = { 0xbd518283, 0x6a2e, 0x11d3, {0x91, 0x54, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} };
00025 const GUID CPlane::thisGuid = { 0x2af5ebcf, 0x6adc, 0x11d3, {0x91, 0x55, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} };
00026
00027
00028 //==============================================================
00029 //
00030 // CSkyVehicle implementation
00031 //
00032 //
00033
00034 CSkyVehicle::CSkyVehicle(int i) : id(i)
00035 {
00036     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00037         children[n] = new CPlane(_T("Extension Space Vehicle"), n+1, 500000, 265, 75000);
00038     }
00039 }
00040
00041 const _TCHAR *CSkyVehicle::GetDisplayName(int nCol)
00042 {
00043     static _TCHAR buf[128];
00044
00045     _stprintf(buf, _T("Extension Planes"));
00046
00047     return buf;
00048 }
00049
00050 HRESULT CSkyVehicle::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed)
00051 {
00052     HRESULT hr = S_OK;
00053     CONTEXTMENUITEM menuItemsNew[] =
00054     {
00055         {
00056             L"Menu item from extension", L"The NameExt sample adds this item",
00057                 IDM_NEW_SKY, CCM_INSERTIONPOINTID_PRIMARY_NEW  , 0, CCM_SPECIAL_DEFAULT_ITEM
00058         },
00059         { NULL, NULL, 0, 0, 0 }
00060     };
00061
00062     // Loop through and add each of the menu items
00063     if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_NEW)
00064     {
00065         for (LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++)
00066         {
00067             hr = pContextMenuCallback->AddItem(m);
00068
00069             if (FAILED(hr))
00070                 break;
00071         }
00072     }
00073
00074     return hr;
00075 }
00076
00077 HRESULT CSkyVehicle::OnMenuCommand(IConsole *pConsole, long lCommandID)
00078 {
00079     switch (lCommandID)
00080     {
00081     case IDM_NEW_SKY:
00082         pConsole->MessageBox(L"Menu item from namespace extension selected", L"Menu Command", MB_YESNO|MB_ICONQUESTION, NULL);
00083         break;
00084     }
00085
00086     return S_OK;
00087 }
00088
00089 HRESULT CSkyVehicle::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00090 {
00091     HRESULT      hr = S_OK;
00092
00093     IHeaderCtrl *pHeaderCtrl = NULL;
00094     IResultData *pResultData = NULL;
00095
00096     if (bShow) {
00097         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00098         _ASSERT( SUCCEEDED(hr) );
00099
00100         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00101         _ASSERT( SUCCEEDED(hr) );
00102
00103         // Set the column headers in the results pane
00104         hr = pHeaderCtrl->InsertColumn( 0, L"Plane Class", 0, MMCLV_AUTO );
00105         _ASSERT( S_OK == hr );
00106         hr = pHeaderCtrl->InsertColumn( 1, L"Plane Weight", 0, MMCLV_AUTO );
00107         _ASSERT( S_OK == hr );
00108         hr = pHeaderCtrl->InsertColumn( 2, L"Plane Height", 0, MMCLV_AUTO );
00109         _ASSERT( S_OK == hr );
00110         hr = pHeaderCtrl->InsertColumn( 3, L"Plane Payload", 0, MMCLV_AUTO );
00111         _ASSERT( S_OK == hr );
00112         hr = pHeaderCtrl->InsertColumn( 4, L"Plane", 0, MMCLV_AUTO );
00113         _ASSERT( S_OK == hr );
00114
00115         // insert items here
00116         RESULTDATAITEM rdi;
00117
00118         hr = pResultData->DeleteAllRsltItems();
00119         _ASSERT( SUCCEEDED(hr) );
00120
00121         if (!bExpanded) {
00122             // create the child nodes, then expand them
00123             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00124                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00125                 rdi.mask       = RDI_STR       |   // Displayname is valid
00126                     RDI_IMAGE     |
00127                     RDI_PARAM;        // nImage is valid
00128
00129                 rdi.nImage      = children[n]->GetBitmapIndex();
00130                 rdi.str         = MMC_CALLBACK;
00131                 rdi.nCol        = 0;
00132                 rdi.lParam      = (LPARAM)children[n];
00133
00134                 hr = pResultData->InsertItem( &rdi );
00135
00136                 _ASSERT( SUCCEEDED(hr) );
00137             }
00138         }
00139
00140         pHeaderCtrl->Release();
00141         pResultData->Release();
00142     }
00143
00144     return hr;
00145 }
00146
00147
00148
00149 //==============================================================
00150 //
00151 // CPlane implementation
00152 //
00153 //
00154
00155 CPlane::CPlane(_TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload)
00156 : szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED)
00157 {
00158     if (szName) {
00159         this->szName = new _TCHAR[(_tcslen(szName) + 1) * sizeof(_TCHAR)];
00160         _tcscpy(this->szName, szName);
00161     }
00162
00163     this->nId = id;
00164     this->lWeight = lWeight;
00165     this->lHeight = lHeight;
00166     this->lPayload = lPayload;
00167 }
00168
00169 CPlane::~CPlane()
00170 {
00171     if (szName)
00172         delete [] szName;
00173 }
00174
00175 const _TCHAR *CPlane::GetDisplayName(int nCol)
00176 {
00177     static _TCHAR buf[128];
00178
00179     switch (nCol) {
00180     case 0:
00181         _stprintf(buf, _T("%s (#%d)"), szName ? szName : _T(""), nId);
00182         break;
00183
00184     case 1:
00185         _stprintf(buf, _T("%ld metric tons"), lWeight);
00186         break;
00187
00188     case 2:
00189         _stprintf(buf, _T("%ld meters"), lHeight);
00190         break;
00191
00192     case 3:
00193         _stprintf(buf, _T("%ld kilos"), lPayload);
00194         break;
00195
00196     case 4:
00197         _stprintf(buf, _T("%s"),
00198             iStatus == RUNNING ? _T("running") :
00199         iStatus == PAUSED ? _T("paused") :
00200         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00201         break;
00202
00203     }
00204
00205     return buf;
00206 }
00207
00208 HRESULT CPlane::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed)
00209 {
00210     HRESULT hr = S_OK;
00211     CONTEXTMENUITEM menuItemsTask[] =
00212     {
00213         {
00214             L"Start vehicle", L"Start the extension plane",
00215                 IDM_START_SKY, CCM_INSERTIONPOINTID_PRIMARY_TASK  , 0, CCM_SPECIAL_DEFAULT_ITEM
00216         },
00217         {
00218             L"Pause vehicle", L"Pause the extension plane",
00219                 IDM_PAUSE_SKY, CCM_INSERTIONPOINTID_PRIMARY_TASK, 0, 0
00220         },
00221         {
00222             L"Stop vehicle", L"Stop the extension plane",
00223                 IDM_STOP_SKY, CCM_INSERTIONPOINTID_PRIMARY_TASK, 0, 0
00224         },
00225         { NULL, NULL, 0, 0, 0 }
00226     };
00227
00228     // Loop through and add each of the menu items
00229     if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_TASK)
00230     {
00231         for (LPCONTEXTMENUITEM m = menuItemsTask; m->strName; m++)
00232         {
00233             hr = pContextMenuCallback->AddItem(m);
00234
00235             if (FAILED(hr))
00236                 break;
00237         }
00238     }
00239
00240     return hr;
00241 }
00242
00243 HRESULT CPlane::OnMenuCommand(IConsole *pConsole, long lCommandID)
00244 {
00245     _TCHAR szVehicle[128];
00246
00247     switch (lCommandID) {
00248     case IDM_START_SKY:
00249         iStatus = RUNNING;
00250         break;
00251
00252     case IDM_PAUSE_SKY:
00253         iStatus = PAUSED;
00254         break;
00255
00256     case IDM_STOP_SKY:
00257         iStatus = STOPPED;
00258         break;
00259     }
00260
00261     _stprintf(szVehicle, _T("%s has been %s"), GetDisplayName(0),
00262         (long)iStatus == RUNNING ? _T("started") :
00263     (long)iStatus == PAUSED ? _T("paused") :
00264     (long)iStatus == STOPPED ? _T("stopped") : _T("!!!unknown command!!!"));
00265
00266     MAKE_WIDEPTR_FROMTSTR(ptrname, szVehicle);
00267     int ret = 0;
00268     pConsole->MessageBox(ptrname,
00269         L"Vehicle command", MB_OK | MB_ICONINFORMATION, &ret);
00270
00271     return S_OK;
00272 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCNotify/StdAfx.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCNotify

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__6DD1E6E0_28C1_11D2_B5B6_00C04FC340EE__INCLUDED_)
00006 #define AFX_STDAFX_H__6DD1E6E0_28C1_11D2_B5B6_00C04FC340EE__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012 #define STRICT
00013
00014
00015 #define _WIN32_WINNT 0x0500
00016 #define _ATL_APARTMENT_THREADED
00017
00018
00019 #include <atlbase.h>
00020 //You may derive a class from CComModule and use it if you want to override
00021 //something, but do not change the name of _Module
00022 extern CComModule _Module;
00023 #include <atlcom.h>
00024
00025 //{{AFX_INSERT_LOCATION}}
00026 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00027
00028 #include <crtdbg.h>
00029 #include <comsvcs.h>
00030 #include <stdlib.h>
00031 #include <vector>
00032 #include <comdef.h>
00033
00034 #endif // !defined(AFX_STDAFX_H__6DD1E6E0_28C1_11D2_B5B6_00C04FC340EE__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::RecordTypeEnum Member List

This is the complete list of members for msado15::RecordTypeEnum, including all inherited members.
adCollectionRecord | msado15::RecordTypeEnum | [static]
adSimpleRecord | msado15::RecordTypeEnum | [static]
adStructDoc | msado15::RecordTypeEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030         static TCHAR error[64];
00031
00032         switch (verb) {
00033     case MMC_VERB_NONE:
00034                 return _T("NONE");
00035     case MMC_VERB_OPEN:
00036                 return _T("OPEN");
00037     case MMC_VERB_COPY:
00038                 return _T("COPY");
00039     case MMC_VERB_PASTE:
00040                 return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042                 return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044                 return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046                 return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048                 return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050                 return _T("PRINT");
00051     case MMC_VERB_CUT:
00052                 return _T("CUT");
00053         default:
00054                 wsprintf(error, _T("Unknown verb id %d"), verb);
00055                 return error;
00056         }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061                                 IComponentData *pCompData,
00062                                 IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064                                 LPARAM arg,
00065                                 LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069         TCHAR message[cchMessage] = {0};
00070
00071         if (bComponentData == TRUE)
00072                 OutputDebugString(_T("IComponentData::Notify( "));
00073         else
00074                 OutputDebugString(_T("IComponent::Notify( "));
00075
00076         wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077         OutputDebugString(message);
00078
00079     switch (event)      {
00080                 case MMCN_ACTIVATE:
00081                         wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082                         break;
00083
00084                 case MMCN_ADD_IMAGES:
00085                         wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086                         break;
00087
00088                 case MMCN_BTN_CLICK:
00089                         wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090                         break;
00091
00092                 case MMCN_COLUMN_CLICK:
00093                         wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,       param);
00094                         break;
00095
00096                 case MMCN_COLUMNS_CHANGED:
00097                         wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098                         break;
00099
00100                 case MMCN_CONTEXTHELP:
00101                         wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102                         break;
00103
00104                 case MMCN_CONTEXTMENU:
00105                         wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106                         break;
00107
00108                 case MMCN_CUTORMOVE:
00109                         wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110                         break;
00111
00112                 case MMCN_DBLCLICK:
00113                         wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114                         break;
00115
00116                 case MMCN_DELETE:
00117                         wsprintf(message, _T("MMCN_DELETE\n"));
00118                         break;
00119
00120                 case MMCN_DESELECT_ALL:
00121                         wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122                         break;
00123
00124                 case MMCN_EXPAND:
00125                         wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126                         break;
00127
00128                 case MMCN_EXPANDSYNC:
00129                         wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130                         break;
00131
00132                 case MMCN_FILTERBTN_CLICK:
00133                         wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134                         break;
00135
00136                 case MMCN_FILTER_CHANGE:
00137                         wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138                         break;
00139
00140                 case MMCN_HELP:
00141                         wsprintf(message, _T("MMCN_HELP\n"));
00142                         break;
00143
00144                 case MMCN_INITOCX:
00145                         wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146                         break;
00147
00148                 case MMCN_LISTPAD:
00149                         wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150                         break;
00151
00152                 case MMCN_MENU_BTNCLICK:
00153                         wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154                         break;
00155
00156                 case MMCN_MINIMIZED:
00157                         wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158                         break;
00159
00160                 case MMCN_PASTE:
00161                         wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162                         break;
00163
00164                 case MMCN_PRELOAD:
00165                         wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166                         break;
00167
00168                 case MMCN_PRINT:
00169                         wsprintf(message, _T("MMCN_PRINT\n"));
00170                         break;
00171
00172                 case MMCN_PROPERTY_CHANGE:
00173                         wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174                         break;
00175
00176                 case MMCN_QUERY_PASTE:
00177                         wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178                         break;
00179
00180                 case MMCN_REFRESH:
00181                         wsprintf(message, _T("MMCN_REFRESH\n"));
00182                         break;
00183
00184                 case MMCN_REMOVE_CHILDREN:
00185                         wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186                         break;
00187
00188                 case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192                         StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193                         break;
00194
00195                 case MMCN_RESTORE_VIEW:
00196                         wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197                         break;
00198
00199                 case MMCN_SELECT:
00200                         wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201                         break;
00202
00203                 case MMCN_SHOW:
00204                         wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205                         break;
00206
00207                 case MMCN_SNAPINHELP:
00208                         wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209                         break;
00210
00211                 case MMCN_VIEW_CHANGE:
00212                         wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213                         break;
00214         }
00215
00216         if (message[0] != 0)
00217                 OutputDebugString(message);
00218         else
00219                 OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222         return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/IMSConf2.Idl Source File

  • Web
  • NetMeeting
  • NMShare

IMSConf2.Idl

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright 1995 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 //  Contents:   Conferencing Services Object interfaces
00006 //
00007 //----------------------------------------------------------------------------
00008
00009 cpp_quote("//+-------------------------------------------------------------------------")
00010 cpp_quote("//")
00011 cpp_quote("//  Microsoft Windows")
00012 cpp_quote("//  Copyright 1995-1999 Microsoft Corporation. All Rights Reserved.")
00013 cpp_quote("//")
00014 cpp_quote("//  File: imsconf2.h")
00015 cpp_quote("//")
00016 cpp_quote("//--------------------------------------------------------------------------")
00017
00018 //////////////////////////////////////////////////////////////////////////////////
00019 // GUID usage:
00020 //
00021 // {068B0700-718C-11d0-8B1A-00A0C91BC90E} - {068B08FF-718C-11d0-8B1A-00A0C91BC90E}
00022 //
00023
00024 import "objidl.idl";
00025 import "oleidl.idl";
00026 import "oaidl.idl";
00027
00028 interface INmManager;
00029 interface INmManagerNotify;
00030 interface INmSysInfo;
00031 interface INmMember;
00032 interface INmCall;
00033 interface INmCallNotify;
00034 interface INmConference;
00035 interface INmConferenceNotify;
00036 interface INmChannel;
00037 interface INmChannelNotify;
00038 interface INmChannelData;
00039 interface INmChannelDataNotify;
00040 interface INmChannelFt;
00041 interface INmChannelFtNotify;
00042 interface INmChannelVideo;
00043 interface INmChannelVideoNotify;
00044 interface INmChannelAudio;
00045 interface INmChannelAudioNotify;
00046 interface INmChannelAppShare;
00047 interface INmChannelAppShareNotify;
00048 interface INmFt;
00049 interface INmSharableApp;
00050 interface IEnumNmConference;
00051 interface IEnumNmMember;
00052 interface IEnumNmChannel;
00053 interface IEnumNmCall;
00054 interface IEnumNmSharableApp;
00055
00056
00057 cpp_quote("")
00058 cpp_quote("////////////////////////////////////////////////////////////////////////////")
00059 cpp_quote("//")
00060 cpp_quote("// Constants")
00061 cpp_quote("")
00062
00063
00064 cpp_quote("// NetMeeting Channel Types")
00065 cpp_quote("#define NMCH_NONE                     0x00000000")
00066 cpp_quote("#define NMCH_DATA                     0x00000001")
00067 cpp_quote("#define NMCH_AUDIO                    0x00000002")
00068 cpp_quote("#define NMCH_VIDEO                    0x00000004")
00069 cpp_quote("#define NMCH_SHARE                    0x00000010")
00070 cpp_quote("#define NMCH_FT                       0x00000020")
00071 cpp_quote("#define NMCH_ALL                      0x0000FFFF")
00072 cpp_quote("#define NMCH_SECURE                   0x00010000")
00073
00074 cpp_quote("")
00075 cpp_quote("// Initialization options")
00076 cpp_quote("#define NM_INIT_NORMAL                0x00000000")
00077 cpp_quote("#define NM_INIT_CONTROL               0x00000001")
00078 cpp_quote("#define NM_INIT_NO_LAUNCH             0x00000002")
00079 cpp_quote("#define NM_INIT_BACKGROUND            0x00000005")
00080
00081 cpp_quote("")
00082 cpp_quote("// INmChannelDataNotify.DataReceived dwFlags")
00083 cpp_quote("#define NM_DF_BROADCAST               0x00000010") // data was broadcast to everyone
00084 cpp_quote("#define NM_DF_PRIVATE                 0x00000020") // data was private
00085 cpp_quote("#define NM_DF_SEGMENT_END             0x00000040") // end of data block
00086 cpp_quote("#define NM_DF_SEGMENT_BEGIN           0x00000080") // start of data block
00087
00088 cpp_quote("")
00089 cpp_quote("// Audio")
00090 cpp_quote("#define NM_MAX_AUDIO_LEVEL            0x0000FFFF")
00091
00092 cpp_quote("")
00093 cpp_quote("// Video")
00094 cpp_quote("#define NM_VIDEO_NO_AUTOSIZE          0x00000000")
00095 cpp_quote("#define NM_VIDEO_SMALL                0x00000001")
00096 cpp_quote("#define NM_VIDEO_MEDIUM               0x00000002")
00097 cpp_quote("#define NM_VIDEO_LARGE                0x00000004")
00098 cpp_quote("#define NM_VIDEO_MIN_QUALITY          0x00000000")
00099 cpp_quote("#define NM_VIDEO_MAX_QUALITY          0x0000001F")
00100 cpp_quote("#define NM_VIDEO_SOURCE_DIALOG        0x00000001")
00101 cpp_quote("#define NM_VIDEO_FORMAT_DIALOG        0x00000002")
00102
00103 cpp_quote("")
00104 cpp_quote("// Version Numbers")
00105 cpp_quote("#define NM_VER_UNKNOWN                0x00000000")
00106 cpp_quote("#define NM_VER_1                      0x00000001")
00107 cpp_quote("#define NM_VER_2                      0x00000002")
00108 cpp_quote("#define NM_VER_NetMeeting2_11         0x00000003")
00109 cpp_quote("#define NM_VER_NetMeeting3            0x00000004")
00110 cpp_quote("#define NM_VER_FUTURE                 0x0000000F")
00111 cpp_quote("")
00112
00113
00114 cpp_quote("")
00115 cpp_quote("// User Categories")
00116 cpp_quote("#define NM_CATEGORY_PERSONAL          0x00000001")
00117 cpp_quote("#define NM_CATEGORY_BUSINESS          0x00000002")
00118 cpp_quote("#define NM_CATEGORY_ADULT             0x00000004")
00119 cpp_quote("")
00120
00121 cpp_quote("")
00122 cpp_quote("////////////////////////////////////////////////////////////////////////////")
00123 cpp_quote("//  Error Codes")
00124 cpp_quote("")
00125 cpp_quote("#define NM_E(e) (0x81000000UL | (ULONG) (e))")
00126 cpp_quote("")
00127 cpp_quote("enum {")
00128
00129 cpp_quote("")
00130 cpp_quote("// NetMeeting specific error codes")
00131 cpp_quote("//")
00132 cpp_quote("  NM_S_NEXT_CONFERENCE          = ((ULONG) 0x0201),") // INmSysInfo.SetProperty
00133 cpp_quote("  NM_S_ON_RESTART               = ((ULONG) 0x0202),") // INmSysInfo.SetProperty
00134 cpp_quote("")
00135
00136 cpp_quote("")
00137 cpp_quote("// Call specific error codes")
00138 cpp_quote("//")
00139 cpp_quote("  NM_CALLERR_NOT_INITIALIZED    = NM_E(0x0100),") // Local system not initialized
00140 cpp_quote("  NM_CALLERR_MEDIA              = NM_E(0x0101),") // Invalid channel/media types
00141 cpp_quote("  NM_CALLERR_NAME_RESOLUTION    = NM_E(0x0102),") // Name resolution failed
00142 cpp_quote("  NM_CALLERR_PASSWORD           = NM_E(0x0103),") // Invalid conference password
00143 cpp_quote("  NM_CALLERR_CONFERENCE_NAME    = NM_E(0x0104),") // Problem with the conference name
00144 cpp_quote("  NM_CALLERR_IN_CONFERENCE      = NM_E(0x0105),") // Remote system is in a conference
00145 cpp_quote("  NM_CALLERR_NOT_FOUND          = NM_E(0x0106),") // User/Address not found
00146 cpp_quote("  NM_CALLERR_MCU                = NM_E(0x0107),") // Can't invite MCU into existing conference
00147 cpp_quote("  NM_CALLERR_REJECTED           = NM_E(0x0108),") // Remote system rejected the request
00148 cpp_quote("  NM_CALLERR_AUDIO              = NM_E(0x0109),") // Audio connection failed
00149 cpp_quote("  NM_CALLERR_AUDIO_LOCAL        = NM_E(0x010A),") // Local audio device already in use
00150 cpp_quote("  NM_CALLERR_AUDIO_REMOTE       = NM_E(0x010B),") // Remote audio device in use
00151 cpp_quote("  NM_CALLERR_ALREADY_CALLING    = NM_E(0x01FD),") // Already calling this person
00152 cpp_quote("  NM_CALLERR_LOOPBACK           = NM_E(0x01FE),") // Called Local Machine
00153 cpp_quote("  NM_CALLERR_UNKNOWN            = NM_E(0x01FF),") // Unknown call error
00154 cpp_quote("")
00155 cpp_quote("// other error codes")
00156 cpp_quote("//")
00157 cpp_quote("  NM_E_NOT_INITIALIZED          = NM_E(0x0200),") // INmManager not Initialized
00158 cpp_quote("  NM_E_CHANNEL_ALREADY_EXISTS   = NM_E(0x0201),") // Data channel already exists
00159 cpp_quote("  NM_E_NO_T120_CONFERENCE       = NM_E(0x0202),") // Not in a T.120 data conference
00160 cpp_quote("  NM_E_NOT_ACTIVE               = NM_E(0x0203),") // NetMeeting is not running
00161 cpp_quote("  NM_E_FILE_TOO_BIG             = NM_E(0x0204),") // The file we attempted to send is too big
00162 cpp_quote("  NM_E_USER_CANCELED_SETUP    = NM_E(0x0205),") // User canceled NetMeeting setup wizard
00163 cpp_quote("  NM_E_ALREADY_RUNNING      = NM_E(0x0206),") // This means that NetMeeting is already running
00164 cpp_quote("  NM_E_SHARING_NOT_AVAILABLE    = NM_E(0x0207),") // This means that Shring is not available
00165 cpp_quote("};")
00166 cpp_quote("")
00167
00168 typedef enum tagNmConferenceState{
00169     NM_CONFERENCE_IDLE                           = 0,
00170     NM_CONFERENCE_WAITING                        = 1,
00171     NM_CONFERENCE_INITIALIZING                   = 2,
00172     NM_CONFERENCE_ACTIVE                         = 3,
00173 } NM_CONFERENCE_STATE;
00174
00175 typedef enum tagNmCallType{
00176     NM_CALL_DEFAULT                              = 0,
00177     NM_CALL_T120                                 = 1,
00178     NM_CALL_H323                                 = 2,
00179 } NM_CALL_TYPE;
00180
00181 typedef enum tagNmAddrType{
00182     NM_ADDR_UNKNOWN                              = 0,
00183     NM_ADDR_IP                                   = 1,
00184     NM_ADDR_MACHINENAME                          = 2,
00185     NM_ADDR_PSTN                                 = 3,
00186     NM_ADDR_ULS                                  = 4,
00187     NM_ADDR_H323_GATEWAY                         = 5,
00188     NM_ADDR_CALLTO                               = 6,
00189     NM_ADDR_T120_TRANSPORT                       = 7,
00190 } NM_ADDR_TYPE;
00191
00192 typedef enum tagNmCallState{
00193     NM_CALL_INVALID                              = 0,
00194     NM_CALL_INIT                                 = 1,
00195     NM_CALL_RING                                 = 2,
00196     NM_CALL_SEARCH                               = 3,
00197     NM_CALL_WAIT                                 = 4,
00198     NM_CALL_ACCEPTED                             = 5,
00199     NM_CALL_REJECTED                             = 6,
00200     NM_CALL_CANCELED                             = 7,
00201 } NM_CALL_STATE;
00202
00203 typedef enum tagNmMemberNotify{
00204     NM_MEMBER_ADDED                              = 0,
00205     NM_MEMBER_REMOVED                            = 1,
00206     NM_MEMBER_UPDATED                            = 2,
00207 } NM_MEMBER_NOTIFY;
00208
00209 typedef enum tagNmChannelNotify{
00210     NM_CHANNEL_ADDED                             = 0,
00211     NM_CHANNEL_REMOVED                           = 1,
00212     NM_CHANNEL_UPDATED                           = 2,
00213 } NM_CHANNEL_NOTIFY;
00214
00215 typedef enum tagNmFtState{
00216     NM_FT_INVALID                                = 0,
00217     NM_FT_SENDING                                = 1,
00218     NM_FT_RECEIVING                              = 2,
00219     NM_FT_COMPLETE                               = 3,
00220 } NM_FT_STATE;
00221
00222 typedef enum tagNmAudioState{
00223     NM_AUDIO_IDLE                                = 0,
00224     NM_AUDIO_LOCAL_PAUSED                        = 1,
00225     NM_AUDIO_TRANSFERRING                        = 3,
00226 } NM_AUDIO_STATE;
00227
00228 typedef enum tagNmAudProp{
00229     NM_AUDPROP_LEVEL                             = 1,
00230     NM_AUDPROP_PAUSE                             = 2,
00231 } NM_AUDPROP;
00232
00233 typedef enum tagNmVideoState{
00234     NM_VIDEO_IDLE                                = 0,
00235     NM_VIDEO_LOCAL_PAUSED                        = 1,
00236     NM_VIDEO_PREVIEWING                          = 2,
00237     NM_VIDEO_TRANSFERRING                        = 3,
00238     NM_VIDEO_BOTH_PAUSED                         = 5,
00239     NM_VIDEO_REMOTE_PAUSED                       = 7,
00240 } NM_VIDEO_STATE;
00241
00242 typedef enum tagNmVidProp{
00243     NM_VIDPROP_PAUSE                             = 1,
00244     NM_VIDPROP_WINDOW_AUTO_SIZE                  = 2,
00245     NM_VIDPROP_WINDOW_SIZE                       = 3,
00246     NM_VIDPROP_WINDOW_POSITION                   = 4,
00247     NM_VIDPROP_WINDOW_TOP_MOST                   = 5,
00248     NM_VIDPROP_WINDOW_VISIBLE                    = 6,
00249     NM_VIDPROP_IMAGE_PREFERRED_SIZE              = 7,
00250     NM_VIDPROP_IMAGE_QUALITY                     = 8,
00251     NM_VIDPROP_CAMERA_DIALOG                     = 9,
00252 } NM_VIDPROP;
00253
00254 typedef enum tagNmShareState{
00255     NM_SHARE_UNKNOWN                             = 0,
00256     NM_SHARE_WORKING_ALONE                       = 1,
00257     NM_SHARE_COLLABORATING                       = 2,
00258     NM_SHARE_IN_CONTROL                          = 3,
00259 } NM_SHARE_STATE;
00260
00261 typedef enum tagNmShAppState{
00262     NM_SHAPP_NOT_SHARED                          = 0,
00263     NM_SHAPP_SHARED                              = 1,
00264 } NM_SHAPP_STATE;
00265
00266 typedef enum tagNmSysProp{
00267     NM_SYSPROP_EMAIL_NAME                        = 1,
00268     NM_SYSPROP_SERVER_NAME                       = 2,
00269     NM_SYSPROP_RESOLVE_NAME                      = 3,
00270     NM_SYSPROP_FIRST_NAME                        = 4,
00271     NM_SYSPROP_LAST_NAME                         = 5,
00272     NM_SYSPROP_USER_NAME                         = 6,
00273     NM_SYSPROP_USER_CITY                         = 7,
00274     NM_SYSPROP_USER_COUNTRY                      = 8,
00275     NM_SYSPROP_USER_COMMENTS                     = 9,
00276     NM_SYSPROP_USER_CATEGORY                     = 10,
00277     NM_SYSPROP_USER_PHONENUM                     = 11,
00278     NM_SYSPROP_USER_LOCATION                     = 12,
00279     NM_SYSPROP_H323_GATEWAY                      = 20,
00280     NM_SYSPROP_H323_GATEWAY_ENABLE               = 21,
00281     NM_SYSPROP_INSTALL_DIRECTORY                 = 50,
00282     NM_SYSPROP_APP_NAME                          = 51,
00283     NM_SYSPROP_LOGGED_ON                         = 69,
00284     NM_SYSPROP_IS_RUNNING                        = 100,
00285     NM_SYSPROP_IN_CONFERENCE                     = 101,
00286   NM_SYSPROP_BUILD_VER             = 200,
00287   NM_SYSPROP_DISABLE_H323            = 201,
00288   NM_SYSPROP_DISABLE_INITIAL_ILS_LOGON     = 202
00289 } NM_SYSPROP;
00290
00291 typedef enum tagConfn{
00292
00293 // File Transfer
00294     CONFN_FT_UI                                  = 0x000211,
00295     CONFN_FT_OFFERED                             = 0x000212,
00296     CONFN_FT_STARTED                             = 0x000213,
00297     CONFN_FT_PROGRESS                            = 0x000214,
00298     CONFN_FT_COMPLETE                            = 0x000215,
00299     CONFN_FT_CANCELED                            = 0x000216,
00300 // Sharing
00301     CONFN_CLICK_CONTROL                          = 0x000220,
00302     CONFN_CLICK_OBSCURE                          = 0x000221,
00303     CONFN_CLICK_REMOTE_NOT_COLLABORATING         = 0x000222,
00304     CONFN_CLICK_LOCAL_NOT_COLLABORATING          = 0x000223,
00305
00306 // Call control
00307     CONFN_CALL_INCOMPATIBLE                      = 0x000400,
00308     CONFN_CALL_OLDER                             = 0x000401,
00309     CONFN_CALL_NEWER                             = 0x000402,
00310     CONFN_CALL_IGNORED                           = 0x000403,
00311     CONFN_CALL_FAILED                            = 0x000404,
00312     CONFN_CALL_IN_CONFERENCE                     = 0x000405,
00313
00314 // Manager notifications
00315     CONFN_NM_STARTED                             = 0x000600,
00316     CONFN_NM_STOPPED                             = 0x000601,
00317
00318 } CONFN;
00319
00320
00321
00322 // INmObject constants
00323 typedef enum NM_APPID {
00324   NM_APPID_CHAT       = 1,
00325   NM_APPID_WHITEBOARD     = 2,
00326   NM_APPID_T126_WHITEBOARD  = 3,
00327   NM_APPID_FILE_TRANSFER    = 4,
00328   NM_APPID_APPSHARING     = 5
00329
00330 } NM_APPID;
00331
00332 typedef enum NM_VUI {
00333   NM_VUI_CHECK = 0,
00334   NM_VUI_SHOW = 1
00335 } NM_VUI;
00336
00337 //--------------------------------------------------------------------------
00338 // INmManager Interface
00339 [
00340     object,
00341     uuid(068B0701-718C-11d0-8B1A-00A0C91BC90E),
00342     pointer_default(unique)
00343 ]
00344 interface INmManager : IUnknown
00345 {
00346     typedef [unique] INmManager *LPNMMANAGER;
00347
00348   [local]
00349     HRESULT Initialize(
00350         [in, out] ULONG * puOptions, // Can be NULL
00351         [in, out] ULONG * puchCaps); // Can be NULL
00352
00353   [call_as(Initialize)]
00354   HRESULT RemoteInitialize(
00355     [in, out] ULONG * puOptions,
00356         [in, out] ULONG * puchCaps);
00357
00358     HRESULT GetSysInfo(
00359         [out] INmSysInfo **ppSysInfo);
00360
00361     HRESULT EnumConference(
00362         [out] IEnumNmConference **ppEnum);
00363
00364   [local]
00365     HRESULT CreateConference(
00366         [out] INmConference **ppConference,
00367         [in] BSTR bstrName,
00368         [in] BSTR bstrPassword,
00369         [in] ULONG uchCaps);
00370
00371   [call_as(CreateConference)]
00372     HRESULT RemoteCreateConference(
00373         [out] INmConference **ppConference,
00374         [in] BSTR bstrName,
00375         [in] BSTR bstrPassword,
00376         [in] ULONG uchCaps);
00377
00378
00379     HRESULT EnumCall(
00380         [out] IEnumNmCall **ppEnum);
00381
00382   [local]
00383     HRESULT CreateCall(
00384         [out] INmCall **ppCall,   // Can be NULL
00385         [in] NM_CALL_TYPE callType,
00386         [in] NM_ADDR_TYPE addrType,
00387         [in] BSTR bstrAddr,
00388         [in] INmConference * pConference);
00389
00390   [call_as(CreateCall)]
00391     HRESULT RemoteCreateCall(
00392         [out] INmCall **ppCall,
00393         [in] NM_CALL_TYPE callType,
00394         [in] NM_ADDR_TYPE addrType,
00395         [in] BSTR bstrAddr,
00396         [in] INmConference * pConference);
00397
00398   [local]
00399     HRESULT CallConference(
00400         [out] INmCall **ppCall,
00401         [in] NM_CALL_TYPE callType,
00402         [in] NM_ADDR_TYPE addrType,
00403         [in] BSTR bstrAddr,
00404         [in] BSTR bstrName,
00405         [in] BSTR bstrPassword);
00406
00407   [call_as(CallConference)]
00408     HRESULT RemoteCallConference(
00409         [out] INmCall **ppCall,
00410         [in] NM_CALL_TYPE callType,
00411         [in] NM_ADDR_TYPE addrType,
00412         [in] BSTR bstrAddr,
00413         [in] BSTR bstrName,
00414         [in] BSTR bstrPassword);
00415
00416 }
00417
00418 //--------------------------------------------------------------------------
00419 // INmManagerNotify Interface
00420 [
00421     object,
00422     uuid(068B0702-718C-11d0-8B1A-00A0C91BC90E),
00423     pointer_default(unique)
00424 ]
00425 interface INmManagerNotify : IUnknown
00426 {
00427     typedef [unique] INmManagerNotify *LPNMMANAGERNOTIFY;
00428
00429     HRESULT NmUI(
00430         [in] CONFN uNotify);
00431
00432     HRESULT ConferenceCreated(
00433         [in] INmConference *pConference);
00434
00435     HRESULT CallCreated(
00436         [in] INmCall *pCall);
00437 }
00438
00439
00440 //--------------------------------------------------------------------------
00441 // INmSysInfo Interface
00442 [
00443   local,
00444     object,
00445     uuid(068B0703-718C-11d0-8B1A-00A0C91BC90E),
00446     pointer_default(unique)
00447 ]
00448 interface INmSysInfo : IUnknown
00449 {
00450     typedef [unique] INmSysInfo *LPNMSYSINFO;
00451
00452     HRESULT IsInstalled(
00453         void);
00454
00455     HRESULT GetProperty(
00456         [in] NM_SYSPROP uProp,
00457         [out] BSTR *pbstrName);
00458
00459     HRESULT SetProperty(
00460         [in] NM_SYSPROP uProp,
00461         [in] BSTR bstrName);
00462
00463     HRESULT GetUserData(
00464         [in] REFGUID rguid,
00465         [out] BYTE **ppb,
00466         [out] ULONG *pcb);
00467
00468     HRESULT SetUserData(
00469         [in] REFGUID rguid,
00470         [in] BYTE *pb,
00471         [in] ULONG cb);
00472
00473     HRESULT GetNmApp(
00474         [in] REFGUID rguid,
00475         [out] BSTR *pbstrApplication,
00476         [out] BSTR *pbstrCommandLine,
00477         [out] BSTR *pbstrDirectory);
00478
00479     HRESULT SetNmApp(
00480         [in] REFGUID rguid,
00481         [in] BSTR bstrApplication,
00482         [in] BSTR bstrCommandLine,
00483         [in] BSTR bstrDirectory);
00484
00485     HRESULT GetNmchCaps(
00486         [out] ULONG *pchCaps);
00487
00488     HRESULT GetLaunchInfo(
00489         [out] INmConference **ppConference, // Can be NULL
00490         [out] INmMember **ppMember);    // Can be NULL
00491
00492 }
00493
00494
00495 //--------------------------------------------------------------------------
00496 // INmCall Interface
00497 [
00498     object,
00499     uuid(068B0704-718C-11d0-8B1A-00A0C91BC90E),
00500     pointer_default(unique)
00501 ]
00502 interface INmCall : IUnknown
00503 {
00504     typedef [unique] INmCall *LPNMCALL;
00505
00506     HRESULT IsIncoming(
00507         void);
00508
00509     HRESULT GetState(
00510         [out] NM_CALL_STATE *pState);
00511
00512     HRESULT GetName(
00513         [out] BSTR *pbstrName);
00514
00515     HRESULT GetAddr(
00516         [out] BSTR *pbstrAddr,
00517         [out] NM_ADDR_TYPE *puType);
00518
00519     HRESULT GetUserData(
00520         [in] REFGUID rguid,
00521         [out, size_is(,*pcb)] BYTE **ppb,
00522         [out] ULONG *pcb);
00523
00524     HRESULT GetConference(
00525         [out] INmConference **ppConference);
00526
00527     HRESULT Accept(
00528         void);
00529
00530     HRESULT Reject(
00531         void);
00532
00533     HRESULT Cancel(
00534         void);
00535 }
00536
00537 //--------------------------------------------------------------------------
00538 // INmCallNotify Interface
00539 [
00540     object,
00541     uuid(068B0705-718C-11d0-8B1A-00A0C91BC90E),
00542     pointer_default(unique)
00543 ]
00544 interface INmCallNotify : IUnknown
00545 {
00546     HRESULT NmUI(
00547         [in] CONFN uNotify);
00548
00549     HRESULT StateChanged(
00550         [in] NM_CALL_STATE uState);
00551
00552     HRESULT Failed(
00553         [in] ULONG uError);
00554
00555     HRESULT Accepted(
00556         [in] INmConference *pConference);
00557 }
00558
00559 //--------------------------------------------------------------------------
00560 // INmConference Interface
00561 [
00562     object,
00563     uuid(068B0710-718C-11d0-8B1A-00A0C91BC90E),
00564     pointer_default(unique)
00565 ]
00566 interface INmConference : IUnknown
00567 {
00568     typedef [unique] INmConference *LPNMCONFERENCE;
00569
00570     HRESULT GetName(
00571         [out] BSTR *pbstrName);
00572
00573     HRESULT GetID(
00574         [out] ULONG *puID);
00575
00576     HRESULT GetState(
00577         [out] NM_CONFERENCE_STATE *pState);
00578
00579     HRESULT GetNmchCaps(
00580         [out] ULONG *puchCaps);
00581
00582     HRESULT GetTopProvider(
00583         [out] INmMember **ppMember);
00584
00585     HRESULT EnumMember(
00586         [out] IEnumNmMember **ppEnum);
00587
00588     HRESULT GetMemberCount(
00589         [out] ULONG * puCount);
00590
00591     HRESULT EnumChannel(
00592         [out] IEnumNmChannel **ppEnum);
00593
00594     HRESULT GetChannelCount(
00595         [out] ULONG * puCount);
00596
00597   [local]
00598     HRESULT CreateDataChannel(
00599         [out] INmChannelData **ppChannel, // Can be NULL
00600         [in] REFGUID rguid);
00601
00602   [call_as(CreateDataChannel)]
00603     HRESULT RemoteCreateDataChannel(
00604         [out] INmChannelData **ppChannel,
00605         [in] REFGUID rguid);
00606
00607
00608     HRESULT IsHosting(
00609         void);
00610
00611     HRESULT Host(
00612         void);
00613
00614     HRESULT Leave(
00615         void);
00616
00617     HRESULT LaunchRemote(
00618         [in] REFGUID rguid,
00619         [in] INmMember *pMember);
00620 }
00621
00622 //--------------------------------------------------------------------------
00623 // INmConferenceNotify Interface
00624 [
00625     object,
00626     uuid(068B0711-718C-11d0-8B1A-00A0C91BC90E),
00627     pointer_default(unique)
00628 ]
00629 interface INmConferenceNotify : IUnknown
00630 {
00631     HRESULT NmUI(
00632         [in] CONFN uNotify);
00633
00634     HRESULT StateChanged(
00635         [in] NM_CONFERENCE_STATE uState);
00636
00637     HRESULT MemberChanged(
00638         [in] NM_MEMBER_NOTIFY uNotify,
00639         [in] INmMember *pMember);
00640
00641     HRESULT ChannelChanged(
00642         [in] NM_CHANNEL_NOTIFY uNotify,
00643         [in] INmChannel *pChannel);
00644 }
00645
00646 //--------------------------------------------------------------------------
00647 // INmMember Interface
00648 [
00649     object,
00650     uuid(068B0712-718C-11d0-8B1A-00A0C91BC90E),
00651     pointer_default(unique)
00652 ]
00653 interface INmMember : IUnknown
00654 {
00655     HRESULT GetName(
00656         [out] BSTR *pbstrName);
00657
00658     HRESULT GetID(
00659         [out] ULONG *puID);
00660
00661     HRESULT GetNmVersion(
00662         [out] ULONG *puVersion);
00663
00664     HRESULT GetAddr(
00665         [out] BSTR *pbstrAddr,
00666         [out] NM_ADDR_TYPE *puType);
00667
00668     HRESULT GetUserData(
00669         [in] REFGUID rguid,
00670         [out, size_is(,*pcb)] BYTE **ppb,
00671         [out] ULONG *pcb);
00672
00673     HRESULT GetConference(
00674         [out] INmConference **ppConference);
00675
00676     HRESULT GetNmchCaps(
00677         [out] ULONG *puchCaps);
00678
00679     HRESULT GetShareState(
00680         [out] NM_SHARE_STATE *puState);
00681
00682     HRESULT IsSelf(
00683         void);
00684
00685     HRESULT IsMCU(
00686         void);
00687
00688     HRESULT Eject(
00689         void);
00690 }
00691
00692
00693 //--------------------------------------------------------------------------
00694 // INmChannel Interface
00695 [
00696     object,
00697     uuid(068B0720-718C-11d0-8B1A-00A0C91BC90E),
00698     pointer_default(unique)
00699 ]
00700 interface INmChannel : IUnknown
00701 {
00702     HRESULT IsSameAs(
00703         [in] INmChannel *pChannel);
00704
00705     HRESULT IsActive(
00706         void);
00707
00708     HRESULT SetActive(
00709         [in] BOOL fActive);
00710
00711     HRESULT GetConference(
00712         [out] INmConference **ppConference);
00713
00714     HRESULT GetInterface(
00715         [out] IID *piid);
00716
00717     HRESULT GetNmch(
00718         [out] ULONG *puCh);
00719
00720     HRESULT EnumMember(
00721         [out] IEnumNmMember **ppEnum);
00722
00723     HRESULT GetMemberCount(
00724         [out] ULONG * puCount);
00725 }
00726
00727
00728 //--------------------------------------------------------------------------
00729 // INmChannelNotify Interface
00730 [
00731     object,
00732     uuid(068B0721-718C-11d0-8B1A-00A0C91BC90E),
00733     pointer_default(unique)
00734 ]
00735 interface INmChannelNotify : IUnknown
00736 {
00737     HRESULT NmUI(
00738         [in] CONFN uNotify);
00739
00740     HRESULT MemberChanged(
00741         [in] NM_MEMBER_NOTIFY uNotify,
00742         [in] INmMember *pMember);
00743 }
00744
00745
00746 //--------------------------------------------------------------------------
00747 // INmChannelData Interface
00748 [
00749     object,
00750     uuid(068B0722-718C-11d0-8B1A-00A0C91BC90E),
00751     pointer_default(unique)
00752 ]
00753 interface INmChannelData : INmChannel
00754 {
00755     HRESULT GetGuid(
00756         [out] GUID *pguid);
00757
00758     HRESULT SendData(
00759         [in] INmMember *pMember,
00760         [in] ULONG uSize,
00761         [in, size_is(uSize)] byte *pvBuffer,
00762         [in] ULONG uOptions);
00763 }
00764
00765
00766 //--------------------------------------------------------------------------
00767 // INmChannelDataNotify Interface
00768 [
00769     object,
00770     uuid(068B0723-718C-11d0-8B1A-00A0C91BC90E),
00771     pointer_default(unique)
00772 ]
00773 interface INmChannelDataNotify : INmChannelNotify
00774 {
00775     HRESULT DataSent(
00776         [in] INmMember *pMember,
00777         [in] ULONG uSize,
00778         [in, size_is(uSize)] byte *pvBuffer);
00779
00780     HRESULT DataReceived(
00781         [in] INmMember *pMember,
00782         [in] ULONG uSize,
00783         [in, size_is(uSize)] byte *pvBuffer,
00784         [in] ULONG dwFlags);
00785 }
00786
00787
00788 //--------------------------------------------------------------------------
00789 // INmChannelAudio Interface
00790 [
00791     object,
00792     uuid(068B0724-718C-11d0-8B1A-00A0C91BC90E),
00793     pointer_default(unique)
00794 ]
00795 interface INmChannelAudio : INmChannel
00796 {
00797     HRESULT IsIncoming(
00798         void);
00799
00800     HRESULT GetState(
00801         [out] NM_AUDIO_STATE *puState);
00802
00803     HRESULT GetProperty(
00804         [in] NM_AUDPROP uID,
00805         [out] ULONG *puValue);
00806
00807     HRESULT SetProperty(
00808         [in] NM_AUDPROP uID,
00809         [in] ULONG uValue);
00810 }
00811
00812 //--------------------------------------------------------------------------
00813 // INmChannelAudioNotify Interface
00814 [
00815     object,
00816     uuid(068B0725-718C-11d0-8B1A-00A0C91BC90E),
00817     pointer_default(unique)
00818 ]
00819 interface INmChannelAudioNotify : INmChannelNotify
00820 {
00821     HRESULT StateChanged(
00822         [in] NM_AUDIO_STATE uState);
00823
00824     HRESULT PropertyChanged(
00825         [in] DWORD dwReserved);
00826 }
00827
00828
00829 //--------------------------------------------------------------------------
00830 // INmChannelVideo Interface
00831 [
00832     object,
00833     uuid(068B0726-718C-11d0-8B1A-00A0C91BC90E),
00834     pointer_default(unique)
00835 ]
00836 interface INmChannelVideo : INmChannel
00837 {
00838     HRESULT IsIncoming(
00839         void);
00840
00841     HRESULT GetState(
00842         [out] NM_VIDEO_STATE *puState);
00843
00844     HRESULT GetProperty(
00845         [in] NM_VIDPROP uID,
00846         [out] ULONG *puValue);
00847
00848     HRESULT SetProperty(
00849         [in] NM_VIDPROP uID,
00850         [in] ULONG uValue);
00851 }
00852
00853
00854 //--------------------------------------------------------------------------
00855 // INmChannelVideoNotify Interface
00856 [
00857     object,
00858     uuid(068B0727-718C-11d0-8B1A-00A0C91BC90E),
00859     pointer_default(unique)
00860 ]
00861 interface INmChannelVideoNotify : INmChannelNotify
00862 {
00863     HRESULT StateChanged(
00864         [in] NM_VIDEO_STATE uState);
00865
00866     HRESULT PropertyChanged(
00867         [in] DWORD dwReserved);
00868 }
00869
00870
00871
00872
00873 //--------------------------------------------------------------------------
00874 // INmChannelFt Interface
00875 [
00876     object,
00877     uuid(068B0728-718C-11d0-8B1A-00A0C91BC90E),
00878     pointer_default(unique)
00879 ]
00880 interface INmChannelFt : INmChannel
00881 {
00882   [local]
00883     HRESULT SendFile(
00884         [out] INmFt **ppFt,     // Can be NULL
00885         [in] INmMember *pMember,
00886         [in] BSTR bstrFile,
00887         [in] ULONG uOptions);
00888
00889   [call_as(SendFile)]
00890     HRESULT RemoteSendFile(
00891         [out] INmFt **ppFt,
00892         [in] INmMember *pMember,
00893         [in] BSTR bstrFile,
00894         [in] ULONG uOptions);
00895
00896
00897   [local]
00898     HRESULT SetReceiveFileDir(
00899         [in] BSTR bstrDir);
00900
00901   [call_as(SetReceiveFileDir)]
00902     HRESULT RemoteSetReceiveFileDir(
00903         [in] BSTR bstrDir);
00904
00905     HRESULT GetReceiveFileDir(
00906         [out] BSTR *pbstrDir);
00907 }
00908
00909
00910 //--------------------------------------------------------------------------
00911 // INmChannelFtNotify Interface
00912 [
00913     object,
00914     uuid(068B0729-718C-11d0-8B1A-00A0C91BC90E),
00915     pointer_default(unique)
00916 ]
00917 interface INmChannelFtNotify : INmChannelNotify
00918 {
00919     HRESULT FtUpdate(
00920         [in] CONFN uNotify,
00921         [in] INmFt *pFt);
00922 }
00923
00924
00925 //--------------------------------------------------------------------------
00926 // INmFt Interface
00927 [
00928     object,
00929     uuid(068B0732-718C-11d0-8B1A-00A0C91BC90E),
00930     pointer_default(unique)
00931 ]
00932 interface INmFt : IUnknown
00933 {
00934     HRESULT IsIncoming(
00935         void);
00936
00937     HRESULT GetState(
00938         [out] NM_FT_STATE *puState);
00939
00940     HRESULT GetName(
00941         [out] BSTR *pbstrName);
00942
00943     HRESULT GetSize(
00944         [out] ULONG *puBytes);
00945
00946     HRESULT GetBytesTransferred(
00947         [out] ULONG *puBytes);
00948
00949     HRESULT GetMember(
00950         [out] INmMember **ppMember);
00951
00952     HRESULT Cancel(
00953         void);
00954 }
00955
00956
00957 //--------------------------------------------------------------------------
00958 // INmChannelAppShare Interface
00959 [
00960     object,
00961     uuid(068B072A-718C-11d0-8B1A-00A0C91BC90E),
00962     pointer_default(unique)
00963 ]
00964 interface INmChannelAppShare : INmChannel
00965 {
00966     HRESULT GetState(
00967         [out] NM_SHARE_STATE *puState);
00968
00969     HRESULT SetState(
00970         [in] NM_SHARE_STATE uState);
00971
00972     HRESULT EnumSharableApp(
00973         [out] IEnumNmSharableApp **ppEnum);
00974 }
00975
00976 //--------------------------------------------------------------------------
00977 // INmChannelAppShareNotify Interface
00978 [
00979     object,
00980     uuid(068B072B-718C-11d0-8B1A-00A0C91BC90E),
00981     pointer_default(unique)
00982 ]
00983 interface INmChannelAppShareNotify : INmChannelNotify
00984 {
00985     HRESULT StateChanged(
00986         [in] NM_SHAPP_STATE uState,
00987         [in] INmSharableApp *pApp);
00988 }
00989
00990
00991 //--------------------------------------------------------------------------
00992 // INmSharableApp Interface
00993 [
00994     object,
00995     uuid(068B0734-718C-11d0-8B1A-00A0C91BC90E),
00996     pointer_default(unique)
00997 ]
00998 interface INmSharableApp : IUnknown
00999 {
01000     HRESULT GetName(
01001         [out] BSTR *pbstrName);
01002
01003     HRESULT GetHwnd(
01004         [out] HWND * phwnd);
01005
01006      HRESULT GetState(
01007         [out] NM_SHAPP_STATE *puState);
01008
01009      HRESULT SetState(
01010         [in] NM_SHAPP_STATE uState);
01011 }
01012
01013
01014
01015 cpp_quote("")
01016 cpp_quote("////////////////////////////////////////////////////////////////////////////")
01017 cpp_quote("//  Enumerator Definitions")
01018
01019
01020 //--------------------------------------------------------------------------
01021 // IEnumNmConference Interface
01022 [
01023     object,
01024     uuid(068B0741-718C-11d0-8B1A-00A0C91BC90E),
01025     pointer_default(unique)
01026 ]
01027 interface IEnumNmConference : IUnknown
01028 {
01029   [local]
01030     HRESULT Next(
01031         [in] ULONG cConference,
01032         [out] INmConference **rgpConference,
01033         [out] ULONG *pcFetched);
01034
01035   [call_as(Next)]
01036     HRESULT RemoteNext(
01037         [in] ULONG cConference,
01038         [out, size_is(cConference), length_is(*pcFetched) ] INmConference **rgpConference,
01039         [out] ULONG *pcFetched,
01040     [out] ULONG *pcItems,
01041     [in] BOOL bGetNumberRemaining);
01042
01043     HRESULT Skip(
01044         [in] ULONG cConference);
01045
01046     HRESULT Reset();
01047
01048     HRESULT Clone(
01049         [out] IEnumNmConference **ppEnum);
01050 }
01051
01052
01053 //--------------------------------------------------------------------------
01054 // IEnumNmMember Interface
01055 [
01056     object,
01057     uuid(068B0742-718C-11d0-8B1A-00A0C91BC90E),
01058     pointer_default(unique)
01059 ]
01060 interface IEnumNmMember : IUnknown
01061 {
01062   [local]
01063     HRESULT Next(
01064         [in] ULONG cMember,
01065         [out] INmMember **rgpMember,
01066         [out] ULONG *pcFetched);
01067
01068   [call_as(Next)]
01069     HRESULT RemoteNext(
01070         [in] ULONG cMember,
01071         [out, size_is(cMember), length_is(*pcFetched) ] INmMember **rgpMember,
01072         [out] ULONG *pcFetched,
01073     [out] ULONG *pcItems,
01074     [in] BOOL bGetNumberRemaining);
01075
01076     HRESULT Skip(
01077         [in] ULONG cMember);
01078
01079     HRESULT Reset();
01080
01081     HRESULT Clone(
01082         [out] IEnumNmMember **ppEnum);
01083 }
01084
01085
01086 //--------------------------------------------------------------------------
01087 // IEnumNmChannel Interface
01088 [
01089     object,
01090     uuid(068B0743-718C-11d0-8B1A-00A0C91BC90E),
01091     pointer_default(unique)
01092 ]
01093 interface IEnumNmChannel : IUnknown
01094 {
01095   [local]
01096     HRESULT Next(
01097         [in] ULONG cChannel,
01098         [out, size_is(cChannel), length_is(*pcFetched)] INmChannel **rgpChannel,
01099         [out] ULONG *pcFetched);
01100
01101   [call_as(Next)]
01102     HRESULT RemoteNext(
01103         [in] ULONG cChannel,
01104         [out, size_is(cChannel), length_is(*pcFetched)] INmChannel **rgpChannel,
01105         [out] ULONG *pcFetched,
01106     [out] ULONG *pcItems,
01107     [in] BOOL bGetNumberRemaining);
01108
01109     HRESULT Skip(
01110         [in] ULONG cChannel);
01111
01112     HRESULT Reset();
01113
01114     HRESULT Clone(
01115         [out] IEnumNmChannel **ppEnum);
01116 }
01117
01118
01119 //--------------------------------------------------------------------------
01120 // IEnumNmCall Interface
01121 [
01122     object,
01123     uuid(068B0744-718C-11d0-8B1A-00A0C91BC90E),
01124     pointer_default(unique)
01125 ]
01126 interface IEnumNmCall : IUnknown
01127 {
01128   [local]
01129   HRESULT Next(
01130         [in] ULONG cCall,
01131         [out] INmCall **rgpCall,
01132         [out] ULONG *pcFetched);
01133
01134   [call_as(Next)]
01135     HRESULT RemoteNext(
01136         [in] ULONG cCall,
01137         [out, size_is(cCall), length_is(*pcFetched)] INmCall **rgpCall,
01138         [out] ULONG *pcFetched,
01139     [out] ULONG *pcItems,
01140     [in] BOOL bGetNumberRemaining);
01141
01142     HRESULT Skip(
01143         [in] ULONG cCall);
01144
01145     HRESULT Reset();
01146
01147     HRESULT Clone(
01148         [out] IEnumNmCall **ppEnum);
01149 }
01150
01151
01152 //--------------------------------------------------------------------------
01153 // IEnumNmSharableApp Interface
01154 [
01155     object,
01156     uuid(068B0745-718C-11d0-8B1A-00A0C91BC90E),
01157     pointer_default(unique)
01158 ]
01159 interface IEnumNmSharableApp : IUnknown
01160 {
01161   [local]
01162     HRESULT Next(
01163         [in] ULONG cApp,
01164         [out] INmSharableApp **rgpApp,
01165         [out] ULONG *pcFetched);
01166
01167   [call_as(Next)]
01168     HRESULT RemoteNext(
01169         [in] ULONG cApp,
01170         [out, size_is(cApp), length_is(*pcFetched)] INmSharableApp **rgpApp,
01171         [out] ULONG *pcFetched,
01172     [out] ULONG *pcItems,
01173     [in] BOOL bGetNumberRemaining);
01174
01175     HRESULT Skip(
01176         [in] ULONG cApp);
01177
01178     HRESULT Reset();
01179
01180     HRESULT Clone(
01181         [out] IEnumNmSharableApp **ppEnum);
01182 }
01183
01184 [
01185   object,
01186   uuid(068B0780-718C-11d0-8B1A-00A0C91BC90E), // IID_INmObject
01187   pointer_default(unique)
01188 ]
01189 interface INmObject : IUnknown
01190 {
01191   HRESULT CallDialog([in] long hwnd, [in] int options);
01192
01193   HRESULT ShowLocal([in] NM_APPID appId);
01194
01195   [local]
01196   HRESULT VerifyUserInfo([in] long hwnd, [in] NM_VUI options);
01197
01198   [call_as(VerifyUserInfo)]
01199   HRESULT RemoteVerifyUserInfo([in] long hwnd, [in] NM_VUI options);
01200
01201 };
01202
01203 [
01204     uuid(068B07FF-718C-11d0-8B1A-00A0C91BC90E),
01205     version(1.0),
01206     helpstring("NmManager 2.0 Type Library")
01207 ]
01208 library NmManager
01209 {
01210
01211     [
01212         uuid(068B0700-718C-11d0-8B1A-00A0C91BC90E),
01213         helpstring("NetMeeting Manager")
01214     ]
01215     coclass NmManager
01216     {
01217         [default] interface INmManager;
01218     };
01219 };
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Sample::Messages Member List

This is the complete list of members for Sample::Messages, including all inherited members.
ChooseCertKeyAlgorithm | Sample::Messages | [private, static]
ChooseCertMessage | Sample::Messages | [private, static]
ChooseCertNoPrivateKey | Sample::Messages | [private, static]
ChooseCertUnableToConstructKey | Sample::Messages | [private, static]
CopyrightMessage | Sample::Messages | [private, static]
DemoTitle | Sample::Messages | [private, static]
ExceptionTitle | Sample::Messages | [private, static]
FailureMessage | Sample::Messages | [private, static]
SuccessMessage | Sample::Messages | [private, static]
Generated on Wed Nov 13 2024 16:58:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/virtualfile.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

virtualfile.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Defines a virtual file class derived from CBaseNode.  This
00014 //             class will represent our result items
00015 //
00016
00017
00018 #ifndef _CLASS_VIRTUALFILE_
00019 #define _CLASS_VIRTUALFILE_
00020
00021 #include "Globals.h"
00022 #include "BaseNode.h"
00023
00024
00025 class CFolderNode;           // References
00026 class CComponentData;
00027
00028 //---------------------------------------------------------------------------
00029 class CVirtualFile : public CBaseNode
00030 {
00031   public:
00032     CVirtualFile();
00033     virtual ~CVirtualFile();
00034
00035     HRESULT Initialize( LPNODEPROPS pNodeProps );
00036
00037   ///////////////////////////////////////////////////////////////////////////
00038   // Virtual methods
00039   public:
00040     HRESULT GetProperties( LPNODEPROPS* ppNodeProps );
00041     ULONG   GetNodeType() { return NODETYPE_VFILE; }
00042     GUID&   GetNodeGUID() { return thisGUID; }
00043
00044     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo )
00045             { return E_NOTIMPL; }
00046
00047     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI )
00048             { return E_NOTIMPL; }
00049
00050     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00051
00052   ///////////////////////////////////////////////////////////////////////////
00053   //  Notification handlers
00054   public:
00055     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00056     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00057     HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00058
00059     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData )
00060             { return E_NOTIMPL; }
00061
00062     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData )
00063             { return E_NOTIMPL; }
00064
00065     // DRAGDROP:  Support for additional notifications
00066     HRESULT OnQueryPaste( LPDATAOBJECT ipTargetDO, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00067     HRESULT OnPaste( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00068     HRESULT OnCutOrMove( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00069
00070
00071   ///////////////////////////////////////////////////////////////////////////
00072   //  Context Menu methods
00073   public:
00074     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00075     HRESULT Command( long lCommandID );
00076
00077   ///////////////////////////////////////////////////////////////////////////
00078   // Helpers
00079   public:
00080     DWORD   GetAttributes() { return m_dwAttributes; }
00081     BOOL    IsAttributeSet( DWORD dwAttribute );
00082     VOID    SetAttribute( DWORD dwAttribute );
00083     VOID    RemoveAttribute( DWORD dwAttribute );
00084     LPWSTR  GetAttributeString();
00085
00086
00087   private:
00088     static GUID      thisGUID;
00089     DWORD            m_dwAttributes;
00090     WCHAR            m_pAttributeStr[16];
00091     CFolderNode*     m_pParentFolder;
00092     CComponentData*  m_pCompData;
00093 };
00094
00095 #endif //_CLASS_VIRTUALFILE_
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/editsink.cpp Source File

  • WinUI
  • TSFcase

editsink.cpp

Go to the documentation of this file.
00001 //
00002 // editsink.cpp
00003 //
00004 // ITfTextEditSink implementation.
00005 //
00006
00007 #include "globals.h"
00008 #include "case.h"
00009 #include "snoop.h"
00010
00011 //+---------------------------------------------------------------------------
00012 //
00013 // OnEndEdit
00014 //
00015 // Called by the system whenever anyone releases a write-access document lock.
00016 //----------------------------------------------------------------------------
00017
00018 STDAPI CCaseTextService::OnEndEdit(ITfContext *pContext, TfEditCookie ecReadOnly, ITfEditRecord *pEditRecord)
00019 {
00020     BOOL fSelectionChanged;
00021     IEnumTfRanges *pEnumTextChanges;
00022     ITfRange *pRange;
00023
00024     // we'll use the endedit notification to update the snoop window
00025
00026     // did the selection change?
00027     if (pEditRecord->GetSelectionStatus(&fSelectionChanged) == S_OK &&
00028         fSelectionChanged)
00029     {
00030         _pSnoopWnd->_UpdateText(ecReadOnly, pContext, NULL);
00031         return S_OK;
00032     }
00033
00034     // text modification?
00035     if (pEditRecord->GetTextAndPropertyUpdates(TF_GTP_INCL_TEXT, NULL, 0, &pEnumTextChanges) == S_OK)
00036     {
00037         if (pEnumTextChanges->Next(1, &pRange, NULL) == S_OK)
00038         {
00039             // arbitrary update the snoop window with the first change
00040             // there may be more than one in the enumerator, but we don't care here
00041             _pSnoopWnd->_UpdateText(ecReadOnly, pContext, pRange);
00042             pRange->Release();
00043         }
00044
00045         pEnumTextChanges->Release();
00046     }
00047
00048     // if we get here, only property values changed
00049
00050     return S_OK;
00051 }
00052
00053 //+---------------------------------------------------------------------------
00054 //
00055 // _InitTextEditSink
00056 //
00057 // Init a text edit sink on the topmost context of the document.
00058 // Always release any previous sink.
00059 //----------------------------------------------------------------------------
00060
00061 BOOL CCaseTextService::_InitTextEditSink(ITfDocumentMgr *pDocMgr)
00062 {
00063     ITfSource *pSource;
00064     BOOL fRet;
00065
00066     // clear out any previous sink first
00067
00068     if (_dwTextEditSinkCookie != TF_INVALID_COOKIE)
00069     {
00070         if (_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
00071         {
00072             pSource->UnadviseSink(_dwTextEditSinkCookie);
00073             pSource->Release();
00074         }
00075
00076         _pTextEditSinkContext->Release();
00077         _pTextEditSinkContext = NULL;
00078         _dwTextEditSinkCookie = TF_INVALID_COOKIE;
00079     }
00080
00081     if (pDocMgr == NULL)
00082         return TRUE; // caller just wanted to clear the previous sink
00083
00084     // setup a new sink advised to the topmost context of the document
00085
00086     if (pDocMgr->GetTop(&_pTextEditSinkContext) != S_OK)
00087         return FALSE;
00088
00089     if (_pTextEditSinkContext == NULL)
00090         return TRUE; // empty document, no sink possible
00091
00092     fRet = FALSE;
00093
00094     if (_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
00095     {
00096         if (pSource->AdviseSink(IID_ITfTextEditSink, (ITfTextEditSink *)this, &_dwTextEditSinkCookie) == S_OK)
00097         {
00098             fRet = TRUE;
00099         }
00100         else
00101         {
00102             _dwTextEditSinkCookie = TF_INVALID_COOKIE;
00103         }
00104         pSource->Release();
00105     }
00106
00107     if (fRet == FALSE)
00108     {
00109         _pTextEditSinkContext->Release();
00110         _pTextEditSinkContext = NULL;
00111     }
00112
00113     return fRet;
00114 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

item_tag Member List

This is the complete list of members for item_tag, including all inherited members.
bAnchor | item_tag
bOK | item_tag
Data | item_tag
iLen | item_tag
pBlock | item_tag
pitNext | item_tag
pitPrev | item_tag
Generated on Wed Nov 13 2024 16:57:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/ProgressDlg.h Source File

  • Multimedia
  • wia
  • GetImage

ProgressDlg.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #ifndef __PROGRESSDLG__
00008 #define __PROGRESSDLG__
00009
00010 namespace WiaWrap
00011 {
00012
00013 //////////////////////////////////////////////////////////////////////////
00014 //
00015 // CProgressDlg
00016 //
00017
00018 /*++
00019
00020     CProgressDlg implements a simple progress dialog with a status message,
00021     progress bar and a cancel button. The dialog is created in a separate
00022     thread so that it remains responsive to the user while the main thread
00023     is busy with a long operation. It is descended from IUnknown for
00024     reference counting.
00025
00026 Methods
00027
00028     CProgressDlg
00029         Creates a new thread that will display the progress dialog
00030
00031     ~CProgressDlg
00032         Closes the progress dialog
00033
00034     Cancelled
00035         Returns TRUE if the user has pressed the cancel button.
00036
00037     SetTitle
00038         Sets the title of the progress dialog.
00039
00040     SetMessage
00041         Sets the status message.
00042
00043     SetPercent
00044         Sets the progress bar position.
00045
00046     ThreadProc
00047         Creates the dialog box
00048
00049     DialogProc
00050         Processes window messages.
00051
00052 --*/
00053
00054 class CProgressDlg : public IUnknown
00055 {
00056 public:
00057     CProgressDlg(HWND hWndParent);
00058     ~CProgressDlg();
00059
00060     // IUnknown interface
00061
00062     STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppvObj);
00063     STDMETHOD_(ULONG, AddRef)();
00064     STDMETHOD_(ULONG, Release)();
00065
00066     // CProgressDlg methods
00067
00068     BOOL Cancelled() const;
00069
00070     VOID SetTitle(PCTSTR pszTitle);
00071     VOID SetMessage(PCTSTR pszMessage);
00072     VOID SetPercent(UINT nPercent);
00073
00074 private:
00075     static DWORD WINAPI ThreadProc(PVOID pParameter);
00076     static INT_PTR CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
00077
00078 private:
00079     LONG    m_cRef;
00080   HWND    m_hDlg;
00081   HWND    m_hWndParent;
00082     LONG    m_bCancelled;
00083     HANDLE  m_hInitDlg;
00084 };
00085
00086 }; // namespace WiaWrap
00087
00088 #endif //__PROGRESSDLG__
00089
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Simple/CatlSmpl.Cpp Source File

  • Web
  • iis
  • Components
  • Cpp
  • Simple

CatlSmpl.Cpp

Go to the documentation of this file.
00001 // CATLSmpl.cpp : Implementation of DLL Exports.
00002
00003 #include "stdafx.h"
00004 #include "resource.h"
00005 #include "initguid.h"
00006 #include "CATLSmpl.h"
00007 #include "Simple.h"
00008
00009 #define IID_DEFINED
00010 #include "CATLSmpl_i.c"
00011
00012 CComModule _Module;
00013
00014 BEGIN_OBJECT_MAP(ObjectMap)
00015   OBJECT_ENTRY(CLSID_CSimple, CSimple)
00016 END_OBJECT_MAP()
00017
00018 // DLL Entry Point
00019
00020 extern "C"
00021 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00022 {
00023   if (dwReason == DLL_PROCESS_ATTACH)
00024   {
00025     _Module.Init(ObjectMap, hInstance);
00026     DisableThreadLibraryCalls(hInstance);
00027   }
00028   else if (dwReason == DLL_PROCESS_DETACH)
00029     _Module.Term();
00030   return TRUE;    // ok
00031 }
00032
00033 // Used to determine whether the DLL can be unloaded by OLE
00034
00035 STDAPI DllCanUnloadNow(void)
00036 {
00037   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00038 }
00039
00040 // Returns a class factory to create an object of the requested type
00041
00042 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00043 {
00044   return _Module.GetClassObject(rclsid, riid, ppv);
00045 }
00046
00047 // DllRegisterServer - Adds entries to the system registry
00048
00049 STDAPI DllRegisterServer(void)
00050 {
00051   // registers object, typelib and all interfaces in typelib
00052   return _Module.RegisterServer(TRUE);
00053 }
00054
00055 // DllUnregisterServer - Removes entries from the system registry
00056
00057 STDAPI DllUnregisterServer(void)
00058 {
00059   _Module.UnregisterServer();
00060   return S_OK;
00061 }
00062
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/nmsession.h Source File

  • Web
  • NetMeeting
  • PlugTransport

nmsession.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     PLUGTRANSPORT.EXE
00003 //  File:       NMSESSION.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016
00017 #ifndef _NM_SESSION_H_
00018 #define _NM_SESSION_H_
00019
00020 #define WM_CONNECTING WM_USER + 1
00021 #define WM_CONNECTED  WM_USER + 2
00022 #define WM_DISCONNECTED WM_USER + 3
00023
00024 #define PLUGABLE_PORT_NUMBER    522  // ULS server port number
00025 #define WM_PLUGABLE_SOCKET      (WM_APP + 0x601)
00026
00027 #define NAMEMAXLENGTH           64
00028 #define CONNIDMAXLENGTH         64
00029
00030 class Conf;
00031 class CPluggableTransport;
00032
00033 //****************************************************************************
00034 //
00035 // CLASS CCallNotify
00036 //
00037 //****************************************************************************
00038
00039 class CCallNotify :
00040   public INmCallNotify,
00041   public RefCount,
00042   public CNotify
00043 {
00044 private:
00045   Conf *m_pConf; // Back pointer to Conf object
00046   CCallNotify(); // prevent default construction
00047 public:
00048   CCallNotify(Conf *);
00049   virtual ~CCallNotify();
00050
00051   // from IUnknown
00052   ULONG STDMETHODCALLTYPE AddRef(void);
00053   ULONG STDMETHODCALLTYPE Release(void);
00054   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObject);
00055
00056   // Sink connection methods
00057   HRESULT Connect(IUnknown *pUnkOuter);
00058   HRESULT Disconnect(void);
00059
00060   // Main sink notification methods
00061   HRESULT STDMETHODCALLTYPE StateChanged( NM_CALL_STATE uState);
00062   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00063   HRESULT STDMETHODCALLTYPE Failed(ULONG uError);
00064   HRESULT STDMETHODCALLTYPE Accepted(INmConference *pConference);
00065 };
00066
00067
00068 //****************************************************************************
00069 //
00070 // CLASS CConfNotify
00071 //
00072 //****************************************************************************
00073
00074 class CConfNotify :
00075   public INmConferenceNotify,
00076   public RefCount,
00077   public CNotify
00078 {
00079 private:
00080   CConfNotify();  // Prevents default construction.
00081   Conf *m_pConf;  // Back pointer to Conf object
00082 public:
00083   CConfNotify(Conf *);
00084   virtual ~CConfNotify();
00085
00086   ULONG STDMETHODCALLTYPE AddRef(void);
00087   ULONG STDMETHODCALLTYPE Release(void);
00088   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObject);
00089
00090   HRESULT Connect(IUnknown *pUnkOuter);
00091   HRESULT Disconnect(void);
00092
00093   HRESULT STDMETHODCALLTYPE StateChanged(NM_CONFERENCE_STATE uState);
00094   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00095   HRESULT STDMETHODCALLTYPE MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember);
00096   HRESULT STDMETHODCALLTYPE ChannelChanged(NM_CHANNEL_NOTIFY uNotify,INmChannel *pChannel);
00097
00098 };
00099
00100 //****************************************************************************
00101 //
00102 // CLASS CMgrNotify
00103 //
00104 //****************************************************************************
00105
00106 class CMgrNotify :
00107   public INmManagerNotify,
00108   public RefCount,
00109   public CNotify
00110 {
00111 private:
00112   CMgrNotify(); // Prevent default construction
00113   Conf *m_pConf;  // Back pointer to Conf object
00114
00115 public:
00116   CMgrNotify(Conf *);
00117   virtual ~CMgrNotify();
00118
00119   ULONG STDMETHODCALLTYPE AddRef(void);
00120   ULONG STDMETHODCALLTYPE Release(void);
00121   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObject);
00122
00123   HRESULT Connect(IUnknown *pUnkOuter);
00124   HRESULT Disconnect(void);
00125
00126   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00127   HRESULT STDMETHODCALLTYPE ConferenceCreated(INmConference *pConference);
00128   HRESULT STDMETHODCALLTYPE CallCreated(INmCall *pCall);
00129 };
00130
00131 //****************************************************************************
00132 //
00133 // CLASS Conf
00134 //
00135 //****************************************************************************
00136
00137 class Conf
00138 {
00139 private:
00140   CMgrNotify*   m_pMgrNotify;
00141   CCallNotify*  m_pCallNotify;
00142   CConfNotify*  m_pConfNotify;
00143   INmConference*  m_pINmConf;
00144   INmManager*   m_pINmMgr;
00145   INmCall*    m_pINmCall;
00146   HWND      m_hWnd;
00147     BOOL      m_bInCall;
00148
00149 public:
00150   Conf(HWND);
00151   virtual ~Conf();
00152
00153   HRESULT Initialize(void);
00154   HRESULT Uninitialize(void);
00155     HRESULT Call(CPluggableTransport *pPlugTrans);
00156   HRESULT CallCreated(INmCall *pCall);
00157   HRESULT ConferenceCreated(INmConference *);
00158   HRESULT CallRejected();
00159   HRESULT CallAccepted();
00160   HRESULT HangUp();
00161   HRESULT RemoteHungup();
00162   HRESULT RejectCall();
00163   HRESULT AcceptCall();
00164     BOOL    InCall();
00165     INmManager * GetNmManager();
00166 };
00167
00168
00169 #endif // _NM_SESSION_H_
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CColumnProvider Member List

This is the complete list of members for CColumnProvider, including all inherited members.
CColumnProvider() | CColumnProvider |
GetColumnInfo(DWORD dwIndex, LPSHCOLUMNINFO psci) | CColumnProvider |
GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvartData) | CColumnProvider |
Initialize(LPCSHCOLUMNINIT psci) | CColumnProvider |
m_nRefCount | CColumnProvider | [private]
QueryInterface(REFIID riid, LPVOID *ppvObject) | CColumnProvider |
STDMETHODIMP_(ULONG) AddRef() | CColumnProvider |
STDMETHODIMP_(ULONG) Release() | CColumnProvider |
~CColumnProvider() | CColumnProvider | [virtual]
Generated on Wed Nov 13 2024 16:55:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/networkmgr.c Source File

  • NetDS
  • RRas
  • ip

networkmgr.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\networkmanager.c
00008
00009 Abstract:
00010
00011     The file contains network configuration related functions,
00012     implementing the network manager.
00013
00014     NOTE: The network manager should never take the configuration entry
00015           lock (g_ce.rwlLock).
00016     . the protocol manager never modifies any g_ce field protected by it
00017     . the network manager never modifies any g_ce field protected by it
00018     . the configuration manager never cleans up any g_ce field as long as
00019       there are active threads
00020
00021 --*/
00022
00023 #include "pchsample.h"
00024 #pragma hdrstop
00025
00026
00027 BOOL
00028 ValidateInterfaceConfig (
00029     IN  PIPSAMPLE_IF_CONFIG piic)
00030 /*++
00031
00032 Routine Description
00033     Checks to see if the interface configuration is OK. It is good practice
00034     to do this because a corrupt registry can change configuration causing
00035     all sorts of debugging headaches if it is not found early
00036
00037 Locks
00038     None
00039
00040 Arguments
00041     piic                pointer to ip sample interface's configuration
00042
00043 Return Value
00044     TRUE                if the configuration is good
00045     FALSE               o/w
00046
00047 --*/
00048 {
00049     DWORD dwErr = NO_ERROR;
00050
00051     do                          // breakout loop
00052     {
00053         if (piic is NULL)
00054         {
00055             dwErr = ERROR_INVALID_PARAMETER;
00056             TRACE0(NETWORK, "Error null interface config");
00057
00058             break;
00059         }
00060
00061         //
00062         // check range of each field
00063         //
00064
00065         // ensure that the metric is within bounds
00066
00067         if (piic->ulMetric > IPSAMPLE_METRIC_INFINITE)
00068         {
00069             dwErr = ERROR_INVALID_PARAMETER;
00070             TRACE0(NETWORK, "Error metric out of range");
00071
00072             break;
00073         }
00074
00075         // ensure that protocol flags are fine, for now they'll always be
00076
00077
00078         // add more here...
00079
00080     } while (FALSE);
00081
00082     if (!(dwErr is NO_ERROR))
00083     {
00084         TRACE0(NETWORK, "Error corrupt interface config");
00085         LOGERR0(CORRUPT_INTERFACE_CONFIG, dwErr);
00086
00087         return FALSE;
00088     }
00089
00090     return TRUE;
00091 }
00092
00093
00094 ////////////////////////////////////////
00095 // CALLBACKFUNCTIONS
00096 ////////////////////////////////////////
00097
00098 VOID
00099 WINAPI
00100 NM_CallbackNetworkEvent (
00101     IN  PVOID                   pvContext,
00102     IN  BOOLEAN                 bTimerOrWaitFired)
00103 /*++
00104
00105 Routine Description
00106     Processes a network event on the specified interface.
00107     NOTE: The interface might have been deleted.
00108
00109 Locks
00110     Acquires shared      (g_ce.pneNetworkEntry)->rwlLock
00111     Releases             (g_ce.pneNetworkEntry)->rwlLock
00112
00113 Arguments
00114     pvContext           dwIfIndex
00115
00116 Return Value
00117    None
00118
00119 --*/
00120 {
00121     DWORD               dwErr               = NO_ERROR;
00122     DWORD               dwIfIndex           = 0;
00123     PINTERFACE_ENTRY    pieInterfaceEntry   = NULL;
00124     PACKET              Packet;
00125
00126     dwIfIndex = (DWORD) pvContext;
00127
00128     TRACE1(ENTER, "Entering NM_CallbackNetworkEvent: %u", dwIfIndex);
00129
00130     if (!ENTER_SAMPLE_API()) { return; } // cannot return anything
00131
00132
00133     ACQUIRE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00134
00135     do                          // breakout loop
00136     {
00137         // fail if the interface does not exist
00138         dwErr = IE_Get(dwIfIndex, &pieInterfaceEntry);
00139         if (dwErr != NO_ERROR)
00140             break;
00141
00142         // fail if interface is inactive
00143         if (!INTERFACE_IS_ACTIVE(pieInterfaceEntry))
00144         {
00145             TRACE1(NETWORK, "Error interface %u is inactive", dwIfIndex);
00146             break;
00147         }
00148
00149         RTASSERT(pieInterfaceEntry->sRawSocket != INVALID_SOCKET);
00150
00151         if (SocketReceiveEvent(pieInterfaceEntry->sRawSocket))
00152         {
00153             if (SocketReceive(pieInterfaceEntry->sRawSocket,
00154                               &Packet) is NO_ERROR)
00155                 PacketDisplay(&Packet);
00156         }
00157         else
00158         {
00159             TRACE1(NETWORK, "Error interface %u false alarm", dwIfIndex);
00160             break;
00161         }
00162
00163     } while (FALSE);
00164
00165     // reregister ReceiveWait if the interface exists
00166     if (pieInterfaceEntry)
00167     {
00168         if (!RegisterWaitForSingleObject(&pieInterfaceEntry->hReceiveWait,
00169                                          pieInterfaceEntry->hReceiveEvent,
00170                                          NM_CallbackNetworkEvent,
00171                                          (PVOID) pieInterfaceEntry->dwIfIndex,
00172                                          INFINITE,
00173                                          WT_EXECUTEONLYONCE))
00174         {
00175             dwErr = GetLastError();
00176             TRACE2(NETWORK, "Error %u registering wait for %u, continuing",
00177                    dwErr, pieInterfaceEntry->dwIfIndex);
00178             LOGERR0(REGISTER_WAIT_FAILED, dwErr);
00179         }
00180     }
00181
00182     RELEASE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00183
00184
00185     LEAVE_SAMPLE_API();
00186
00187     TRACE0(LEAVE, "Leaving  NM_CallbackNetworkEvent");
00188 }
00189
00190
00191
00192 VOID
00193 WINAPI
00194 NM_CallbackPeriodicTimer (
00195     IN  PVOID                   pvContext,
00196     IN  BOOLEAN                 bTimerOrWaitFired)
00197 /*++
00198
00199 Routine Description
00200     Processes a periodic timeout event on the specified interface.
00201     NOTE: The interface might have been deleted.
00202
00203 Locks
00204     Acquires shared      (g_ce.pneNetworkEntry)->rwlLock
00205     Releases             (g_ce.pneNetworkEntry)->rwlLock
00206
00207 Arguments
00208     pvContext           dwIfIndex
00209
00210 Return Value
00211    None
00212
00213 --*/
00214 {
00215     DWORD               dwErr               = NO_ERROR;
00216     DWORD               dwIfIndex           = 0;
00217     PINTERFACE_ENTRY    pieInterfaceEntry   = NULL;
00218     PPACKET             pPacket;
00219
00220     dwIfIndex = (DWORD) pvContext;
00221
00222     TRACE1(ENTER, "Entering NM_CallbackPeriodicTimer: %u", dwIfIndex);
00223
00224     if (!ENTER_SAMPLE_API()) { return; } // cannot return anything
00225
00226
00227     ACQUIRE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00228
00229     do                          // breakout loop
00230     {
00231         // fail if the interface does not exist
00232         dwErr = IE_Get(dwIfIndex, &pieInterfaceEntry);
00233         if (dwErr != NO_ERROR)
00234             break;
00235
00236         // fail if interface is inactive
00237         if (!INTERFACE_IS_ACTIVE(pieInterfaceEntry))
00238             break;
00239
00240         RTASSERT(pieInterfaceEntry->sRawSocket != INVALID_SOCKET);
00241
00242         // fail if packet cannot be created
00243         if (PacketCreate(&pPacket) != NO_ERROR)
00244             break;
00245
00246
00247         PacketDisplay(pPacket);
00248         dwErr = SocketSend(pieInterfaceEntry->sRawSocket,
00249                            SAMPLE_PROTOCOL_MULTICAST_GROUP,
00250                            pPacket);
00251         if (dwErr != NO_ERROR)
00252         {
00253             PacketDestroy(pPacket);
00254             break;
00255         }
00256
00257
00258         // update interface statistics
00259         InterlockedIncrement(&(pieInterfaceEntry->iisStats.ulNumPackets));
00260     } while (FALSE);
00261
00262     // restart timer if the interface exists and is active
00263     if ((pieInterfaceEntry) and INTERFACE_IS_ACTIVE(pieInterfaceEntry))
00264     {
00265         RESTART_TIMER(pieInterfaceEntry->hPeriodicTimer,
00266                       PERIODIC_INTERVAL,
00267                       &dwErr);
00268     }
00269
00270
00271     RELEASE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00272
00273
00274     LEAVE_SAMPLE_API();
00275
00276     TRACE0(LEAVE, "Leaving  NM_CallbackPeriodicTimer");
00277 }
00278
00279
00280
00281 ////////////////////////////////////////
00282 // APIFUNCTIONS
00283 ////////////////////////////////////////
00284
00285
00286 DWORD
00287 NM_AddInterface (
00288     IN  LPWSTR                  pwszInterfaceName,
00289     IN  DWORD                 dwInterfaceIndex,
00290     IN  WORD                    wAccessType,
00291     IN  PVOID                 pvInterfaceInfo)
00292 /*++
00293
00294 Routine Description
00295     Add an interface with the given configuration to IPSAMPLE.  Interface
00296     is created UNBOUND and DISABLED.
00297
00298 Locks
00299     Acquires exclusively (g_ce.pneNetworkEntry)->rwlLock
00300     Releases             (g_ce.pneNetworkEntry)->rwlLock
00301
00302 Arguments
00303     pwszInterfaceName   the name of the interface, used for logging.
00304     dwInterfaceIndex    the positive integer used to refer to this interface.
00305     wAccessType         access type... MULTIACCESS or POINTTOPOINT
00306     pvInterfaceInfo     our config for this interface
00307
00308 Return Value
00309     NO_ERROR            if successfully initiailzed
00310     Failure code        o/w
00311
00312 --*/
00313 {
00314     DWORD               dwErr   = NO_ERROR;
00315     PIPSAMPLE_IF_CONFIG piic    = NULL;
00316     PINTERFACE_ENTRY    pieEntry = NULL;
00317
00318
00319     if (!ENTER_SAMPLE_API()) { return ERROR_CAN_NOT_COMPLETE; }
00320
00321     ACQUIRE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00322
00323     do                          // breakout loop
00324     {
00325         piic = (PIPSAMPLE_IF_CONFIG) pvInterfaceInfo;
00326
00327
00328         // validate the configuration parameters
00329         if (!ValidateInterfaceConfig(piic))
00330         {
00331             dwErr = ERROR_INVALID_PARAMETER;
00332             break;
00333         }
00334
00335
00336         // fail if the interface exists
00337         if (IE_IsPresent(dwInterfaceIndex))
00338         {
00339             dwErr = ERROR_INVALID_PARAMETER;
00340             TRACE2(NETWORK, "Error interface %S (%u) already exists",
00341                    pwszInterfaceName, dwInterfaceIndex);
00342             LOGERR0(INTERFACE_PRESENT, dwErr);
00343
00344             break;
00345         }
00346
00347
00348         // create an interface entry
00349         dwErr = IE_Create(pwszInterfaceName,
00350                           dwInterfaceIndex,
00351                           wAccessType,
00352                           &pieEntry);
00353         if (dwErr != NO_ERROR)
00354             break;
00355
00356
00357         // initialize interface configuration fields
00358         pieEntry->ulMetric          = piic->ulMetric;
00359
00360
00361         // insert the interface in all access structures
00362         dwErr = IE_Insert(pieEntry);
00363         RTASSERT(dwErr is NO_ERROR); // no reason to fail!
00364
00365
00366         // update global statistics
00367         InterlockedIncrement(&(g_ce.igsStats.ulNumInterfaces));
00368     } while (FALSE);
00369
00370     RELEASE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00371
00372     LEAVE_SAMPLE_API();
00373
00374     return dwErr;
00375 }
00376
00377
00378
00379 DWORD
00380 NM_DeleteInterface (
00381     IN  DWORD                 dwInterfaceIndex)
00382 /*++
00383
00384 Routine Description
00385     Remove an interface with the given index, deactivating it if required.
00386
00387 Locks
00388     Acquires exclusively (g_ce.pneNetworkEntry)->rwlLock
00389     Releases             (g_ce.pneNetworkEntry)->rwlLock
00390
00391 Arguments
00392     dwInterfaceIndex    the positive integer used to identify the interface.
00393
00394 Return Value
00395     NO_ERROR            if successfully initiailzed
00396     Failure code        o/w
00397
00398 --*/
00399 {
00400     DWORD               dwErr               = NO_ERROR;
00401     PINTERFACE_ENTRY    pieInterfaceEntry   = NULL;
00402
00403
00404     if (!ENTER_SAMPLE_API()) { return ERROR_CAN_NOT_COMPLETE; }
00405
00406     do                          // breakout loop
00407     {
00408         // remove from all tables, lists...
00409         ACQUIRE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00410
00411         dwErr = IE_Delete(dwInterfaceIndex, &pieInterfaceEntry);
00412
00413         RELEASE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00414
00415
00416         // fail if the interface does not exist
00417         if (dwErr != NO_ERROR)
00418         {
00419             TRACE1(NETWORK, "Error interface %u does not exist",
00420                    dwInterfaceIndex);
00421             break;
00422         }
00423
00424
00425         // destroy the interface entry, deregisters ReceiveWait
00426         // hence best not to hold any locks to prevent deadlocks.
00427         IE_Destroy(pieInterfaceEntry);
00428
00429
00430         // update global statistics
00431         InterlockedDecrement(&(g_ce.igsStats.ulNumInterfaces));
00432     } while (FALSE);
00433
00434     LEAVE_SAMPLE_API();
00435
00436     return dwErr;
00437 }
00438
00439
00440
00441 DWORD
00442 NM_InterfaceStatus (
00443     IN DWORD                    dwInterfaceIndex,
00444     IN BOOL                     bInterfaceActive,
00445     IN DWORD                    dwStatusType,
00446     IN PVOID                    pvStatusInfo)
00447 /*++
00448
00449 Routine Description
00450
00451 Locks
00452     Acquires exclusively (g_ce.pneNetworkEntry)->rwlLock
00453     Releases             (g_ce.pneNetworkEntry)->rwlLock
00454
00455 Arguments
00456     dwInterfaceIndex    The index of the interface in question
00457     bInterfaceActive    Whether the interface can send and receive data
00458     dwStatusType        RIS_INTERFACE_[ADDRESS_CHANGED|ENABLED|DISABLED]
00459     pvStatusInfo        Pointer to IP_ADAPTER_BINDING_INFO containing info
00460                             about the addresses on the interface
00461
00462 Return Value
00463     NO_ERROR            if successfully initiailzed
00464     Failure code        o/w
00465
00466 --*/
00467 {
00468     DWORD                       dwErr               = NO_ERROR;
00469     PINTERFACE_ENTRY            pieInterfaceEntry   = NULL;
00470     PIP_ADAPTER_BINDING_INFO    pBinding            = NULL;
00471     BOOL                        bBindingChanged     = FALSE;
00472
00473
00474     if (!ENTER_SAMPLE_API()) { return ERROR_CAN_NOT_COMPLETE; }
00475
00476
00477     ACQUIRE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00478
00479     do                          // breakout loop
00480     {
00481         // fail if the interface does not exist
00482         dwErr = IE_Get(dwInterfaceIndex, &pieInterfaceEntry);
00483         if (dwErr != NO_ERROR)
00484             break;
00485
00486
00487         // the only status we care about is a change in interface binding
00488         if (dwStatusType is RIS_INTERFACE_ADDRESS_CHANGE)
00489         {
00490             // destroy existing binding
00491             if (INTERFACE_IS_BOUND(pieInterfaceEntry))
00492             {
00493                 bBindingChanged = TRUE;
00494                 dwErr = IE_UnBindInterface(pieInterfaceEntry);
00495                 RTASSERT(dwErr is NO_ERROR);
00496             }
00497
00498             // create new binding
00499             pBinding = (PIP_ADAPTER_BINDING_INFO) pvStatusInfo;
00500             if(pBinding->AddressCount)
00501             {
00502                 bBindingChanged = TRUE;
00503                 dwErr = IE_BindInterface(pieInterfaceEntry, pBinding);
00504                 if (dwErr != NO_ERROR)
00505                     break;
00506             }
00507         }
00508
00509
00510         // interface needs to be deactivated even when the binding changes!
00511         // this restriction is due to the fact that the socket is bound to
00512         // the interface address and not the interface index...
00513         if (INTERFACE_IS_ACTIVE(pieInterfaceEntry) and
00514             (bBindingChanged or !bInterfaceActive))
00515         {
00516             dwErr = IE_DeactivateInterface(pieInterfaceEntry);
00517             if (dwErr != NO_ERROR)
00518                 break;
00519         }
00520
00521         // activate interface only when a binding exists!
00522         // i.e. we do not support unnumbered interfaces for now...
00523         if (INTERFACE_IS_INACTIVE(pieInterfaceEntry) and
00524             INTERFACE_IS_BOUND(pieInterfaceEntry) and
00525             bInterfaceActive)
00526         {
00527             dwErr = IE_ActivateInterface(pieInterfaceEntry);
00528             if (dwErr != NO_ERROR)
00529                 break;
00530         }
00531     } while (FALSE);
00532
00533     RELEASE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00534
00535
00536     LEAVE_SAMPLE_API();
00537
00538     return dwErr;
00539 }
00540
00541
00542
00543 DWORD
00544 NM_GetInterfaceInfo (
00545     IN      DWORD               dwInterfaceIndex,
00546     IN      PVOID               pvInterfaceInfo,
00547     IN  OUT PULONG              pulBufferSize,
00548     OUT     PULONG              pulStructureVersion,
00549     OUT     PULONG              pulStructureSize,
00550     OUT     PULONG              pulStructureCount)
00551 /*++
00552
00553 Routine Description
00554     See if there's space enough to return ip sample interface config. If
00555     yes, we return it, otherwise return the size needed.
00556
00557 Locks
00558     Acquires shared     (g_ce.pneNetworkEntry)->rwlLock
00559     Releases            (g_ce.pneNetworkEntry)->rwlLock
00560
00561 Arguments
00562     dwInterfaceIndex    the interface whose configuration is needed
00563     pvInterfaceInfo     pointer to allocated buffer to store our config
00564     pulBufferSize       IN  size of buffer received
00565                         OUT size of our interface config
00566
00567 Return Value
00568     NO_ERROR            if success
00569     Failure code        o/w
00570
00571 --*/
00572 {
00573     DWORD               dwErr               = NO_ERROR;
00574     PIPSAMPLE_IF_CONFIG piic;
00575     ULONG               ulSize              = sizeof(IPSAMPLE_IF_CONFIG);
00576     PINTERFACE_ENTRY    pieInterfaceEntry   = NULL;
00577
00578     if (!ENTER_SAMPLE_API()) { return ERROR_CAN_NOT_COMPLETE; }
00579
00580
00581     ACQUIRE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00582
00583     do                          // breakout loop
00584     {
00585         // fail if the interface does not exist
00586         dwErr = IE_Get(dwInterfaceIndex, &pieInterfaceEntry);
00587         if (dwErr != NO_ERROR)
00588             break;
00589
00590         // fail if the size was too small or there was no storage
00591         if((*pulBufferSize < ulSize) or (pvInterfaceInfo is NULL))
00592         {
00593             TRACE1(NETWORK, "NM_GetInterfaceInfo: *ulBufferSize %u",
00594                    *pulBufferSize);
00595
00596             *pulBufferSize = ulSize;
00597             dwErr = ERROR_INSUFFICIENT_BUFFER;
00598             break;
00599         }
00600
00601
00602         // set the OUT parameters
00603         *pulBufferSize = ulSize;
00604         if (pulStructureVersion)    *pulStructureVersion    = 1;
00605         if (pulStructureSize)       *pulStructureSize       = ulSize;
00606         if (pulStructureCount)      *pulStructureCount      = 1;
00607
00608
00609         // copy out the interface configuration
00610         piic = (PIPSAMPLE_IF_CONFIG) pvInterfaceInfo;
00611         piic->ulMetric = pieInterfaceEntry->ulMetric;
00612     } while (FALSE);
00613
00614     RELEASE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00615
00616
00617     LEAVE_SAMPLE_API();
00618
00619     return dwErr;
00620 }
00621
00622
00623
00624 DWORD
00625 NM_SetInterfaceInfo (
00626     IN      DWORD           dwInterfaceIndex,
00627     IN      PVOID           pvInterfaceInfo)
00628 /*++
00629
00630 Routine Description
00631     Set ip sample interface's configuration.
00632
00633 Locks
00634     Acquires exclusively (g_ce.pneNetworkEntry)->rwlLock
00635     Releases             (g_ce.pneNetworkEntry)->rwlLock
00636
00637 Arguments
00638     dwInterfaceIndex    the interface whose configuration is to be set
00639     pvInterfaceInfo     buffer with new interface config
00640
00641 Return Value
00642     NO_ERROR            if success
00643     Failure code        o/w
00644
00645 --*/
00646 {
00647     DWORD               dwErr               = NO_ERROR;
00648     PIPSAMPLE_IF_CONFIG piic;
00649     PINTERFACE_ENTRY    pieInterfaceEntry   = NULL;
00650
00651     if (!ENTER_SAMPLE_API()) { return ERROR_CAN_NOT_COMPLETE; }
00652
00653
00654     ACQUIRE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00655
00656     do                          // breakout loop
00657     {
00658         // fail if the interface does not exist
00659         dwErr = IE_Get(dwInterfaceIndex, &pieInterfaceEntry);
00660         if (dwErr != NO_ERROR)
00661             break;
00662
00663         // fail if the configuration is invalid
00664         piic = (PIPSAMPLE_IF_CONFIG) pvInterfaceInfo;
00665         if(!ValidateInterfaceConfig(piic))
00666         {
00667             dwErr = ERROR_INVALID_PARAMETER;
00668             break;
00669         }
00670
00671
00672         // update our configuration
00673         pieInterfaceEntry->ulMetric         = piic->ulMetric;
00674
00675         // might need additional processing depending on the state change
00676         // caused by the updated interface configuration and the protocol
00677         // behavior.  for instance, sockets may need to be created/shutdown
00678
00679     } while (FALSE);
00680
00681     RELEASE_WRITE_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00682
00683
00684     LEAVE_SAMPLE_API();
00685
00686     return dwErr;
00687 }
00688
00689
00690
00691 DWORD
00692 NM_DoUpdateRoutes (
00693     IN      DWORD               dwInterfaceIndex
00694     )
00695 /*++
00696
00697 Routine Description
00698     Updates routes over a demand dial interface.
00699
00700 Locks
00701     Acquires exclusively (g_ce.pneNetworkEntry)->rwlLock
00702     Releases             (g_ce.pneNetworkEntry)->rwlLock
00703
00704 Arguments
00705     dwInterfaceIndex    the relevant interface index
00706
00707 Return Value
00708     NO_ERROR            if success
00709     Failure code        o/w
00710
00711 --*/
00712 {
00713     DWORD               dwErr               = NO_ERROR;
00714     PINTERFACE_ENTRY    pieInterfaceEntry   = NULL;
00715     MESSAGE             mMessage;
00716
00717     if (!ENTER_SAMPLE_API()) { return ERROR_CAN_NOT_COMPLETE; }
00718
00719
00720     ACQUIRE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00721
00722     do                          // breakout loop
00723     {
00724         // fail if the interface does not exist
00725         dwErr = IE_Get(dwInterfaceIndex, &pieInterfaceEntry);
00726         if (dwErr != NO_ERROR)
00727             break;
00728
00729         // ensure interface is active
00730         if (INTERFACE_IS_INACTIVE(pieInterfaceEntry))
00731         {
00732             dwErr = ERROR_CAN_NOT_COMPLETE;
00733             TRACE1(NETWORK, "Error, interface %u inactive", dwInterfaceIndex);
00734             break;
00735         }
00736
00737         // here we do protocol specific processing,
00738         // for sample nothing :)
00739
00740     } while (FALSE);
00741
00742     RELEASE_READ_LOCK(&((g_ce.pneNetworkEntry)->rwlLock));
00743
00744     mMessage.UpdateCompleteMessage.InterfaceIndex   = dwInterfaceIndex;
00745     mMessage.UpdateCompleteMessage.UpdateType       = RF_DEMAND_UPDATE_ROUTES;
00746     mMessage.UpdateCompleteMessage.UpdateStatus     = dwErr;
00747     if (EnqueueEvent(UPDATE_COMPLETE, mMessage) is NO_ERROR)
00748         SetEvent(g_ce.hMgrNotificationEvent);
00749
00750     LEAVE_SAMPLE_API();
00751
00752     return dwErr;
00753 }
00754
00755
00756
00757 DWORD
00758 NM_ProcessRouteChange (
00759     VOID)
00760 /*++
00761
00762 Routine Description
00763    Handle messages from RTM about route changes.
00764
00765 Locks
00766    None
00767
00768 Arguments
00769    None
00770
00771 Return Value
00772    NO_ERROR                 success
00773    Error Code               o/w
00774
00775 --*/
00776 {
00777     DWORD           dwErr           = NO_ERROR;
00778     RTM_DEST_INFO   rdiDestination;             // 1 view registered for change
00779     BOOL            bDone           = FALSE;
00780     UINT            uiNumDests;
00781
00782     if (!ENTER_SAMPLE_API()) { return ERROR_CAN_NOT_COMPLETE; }
00783
00784     // loop dequeueing messages until RTM says there are no more left
00785     while (!bDone)
00786     {
00787         // retrieve route changes
00788         uiNumDests = 1;
00789         dwErr = RTM_GetChangedDests(
00790             g_ce.hRtmHandle,                    // my RTMv2 handle
00791             g_ce.hRtmNotificationHandle,        // my notification handle
00792             &uiNumDests,                        // IN   # dest info's required
00793                                                 // OUT  # dest info's supplied
00794             &rdiDestination);                   // OUT  buffer for dest info's
00795
00796         switch (dwErr)
00797         {
00798             case ERROR_NO_MORE_ITEMS:
00799                 bDone = TRUE;
00800                 dwErr = NO_ERROR;
00801                 if (uiNumDests < 1)
00802                     break;
00803                 // else continue below to process the last destination
00804
00805             case NO_ERROR:
00806                 RTASSERT(uiNumDests is 1);
00807                 RTM_DisplayDestInfo(&rdiDestination);
00808
00809                 // release the destination info
00810                 if (RTM_ReleaseChangedDests(
00811                     g_ce.hRtmHandle,            // my RTMv2 handle
00812                     g_ce.hRtmNotificationHandle,// my notif handle
00813                     uiNumDests,                 // 1
00814                     &rdiDestination             // released dest info
00815                     ) != NO_ERROR)
00816                     TRACE0(NETWORK, "Error releasing changed dests");
00817
00818                 break;
00819
00820             default:
00821                 bDone = TRUE;
00822                 TRACE1(NETWORK, "Error %u RtmGetChangedDests", dwErr);
00823                 break;
00824         }
00825     } // while
00826
00827     LEAVE_SAMPLE_API();
00828
00829     return dwErr;
00830 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DWSTR Member List

This is the complete list of members for DWSTR, including all inherited members.
dw | DWSTR
psz | DWSTR
Generated on Wed Nov 13 2024 16:57:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/guids.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // {CE0F5BF0-ABFB-11d2-993A-0080C76878BF}
00020 DEFINE_GUID(CLSID_CContextMenuExtension,
00021             0xce0f5bf0, 0xabfb, 0x11d2, 0x99, 0x3a, 0x0, 0x80, 0xc7, 0x68, 0x78, 0xbf);
00022
00023 // {CE0F5BF2-ABFB-11d2-993A-0080C76878BF}
00024 DEFINE_GUID(CLSID_CSnapinAbout,
00025             0xce0f5bf2, 0xabfb, 0x11d2, 0x99, 0x3a, 0x0, 0x80, 0xc7, 0x68, 0x78, 0xbf);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Recordset21 Member List

This is the complete list of members for msado15::Recordset21, including all inherited members.
_xClone() | msado15::Recordset21 |
_xResync(int AffectRecords) | msado15::Recordset21 |
_xSave(String FileName, int PersistFormat) | msado15::Recordset21 |
AddNew(Variant FieldList, Variant Values) | msado15::Recordset21 |
Cancel() | msado15::Recordset21 |
CancelBatch(int AffectRecords) | msado15::Recordset21 |
CancelUpdate() | msado15::Recordset21 |
Clone(int LockType) | msado15::Recordset21 |
Close() | msado15::Recordset21 |
CompareBookmarks(Variant Bookmark1, Variant Bookmark2) | msado15::Recordset21 |
Delete(int AffectRecords) | msado15::Recordset21 |
Find(String Criteria, int SkipRecords, int SearchDirection, Variant Start) | msado15::Recordset21 |
getAbsolutePage() | msado15::Recordset21 |
getAbsolutePosition() | msado15::Recordset21 |
getActiveCommand() | msado15::Recordset21 |
getActiveConnection() | msado15::Recordset21 |
getBOF() | msado15::Recordset21 |
getBookmark() | msado15::Recordset21 |
getCacheSize() | msado15::Recordset21 |
getCollect(Variant Index) | msado15::Recordset21 |
getCursorLocation() | msado15::Recordset21 |
getCursorType() | msado15::Recordset21 |
getDataMember() | msado15::Recordset21 |
getDataSource() | msado15::Recordset21 |
getEditMode() | msado15::Recordset21 |
getEOF() | msado15::Recordset21 |
getFields() | msado15::Recordset21 |
getFilter() | msado15::Recordset21 |
getIndex() | msado15::Recordset21 |
getLockType() | msado15::Recordset21 |
getMarshalOptions() | msado15::Recordset21 |
getMaxRecords() | msado15::Recordset21 |
getPageCount() | msado15::Recordset21 |
getPageSize() | msado15::Recordset21 |
getProperties() | msado15::Recordset21 |
getRecordCount() | msado15::Recordset21 |
GetRows(int Rows, Variant Start, Variant Fields) | msado15::Recordset21 |
getSort() | msado15::Recordset21 |
getSource() | msado15::Recordset21 |
getState() | msado15::Recordset21 |
getStatus() | msado15::Recordset21 |
getStayInSync() | msado15::Recordset21 |
GetString(int StringFormat, int NumRows, String ColumnDelimeter, String RowDelimeter, String NullExpr) | msado15::Recordset21 |
iid | msado15::Recordset21 | [static]
Move(int NumRecords, Variant Start) | msado15::Recordset21 |
MoveFirst() | msado15::Recordset21 |
MoveLast() | msado15::Recordset21 |
MoveNext() | msado15::Recordset21 |
MovePrevious() | msado15::Recordset21 |
NextRecordset(Variant RecordsAffected) | msado15::Recordset21 |
Open(Variant Source, Variant ActiveConnection, int CursorType, int LockType, int Options) | msado15::Recordset21 |
Requery(int Options) | msado15::Recordset21 |
Resync(int AffectRecords, int ResyncValues) | msado15::Recordset21 |
Seek(Variant KeyValues, int SeekOption) | msado15::Recordset21 |
setAbsolutePage(int pl) | msado15::Recordset21 |
setAbsolutePosition(int pl) | msado15::Recordset21 |
setActiveConnection(Object pvar) | msado15::Recordset21 |
setActiveConnection(Variant pvar) | msado15::Recordset21 |
setBookmark(Variant pvBookmark) | msado15::Recordset21 |
setCacheSize(int pl) | msado15::Recordset21 |
setCollect(Variant Index, Variant pvar) | msado15::Recordset21 |
setCursorLocation(int plCursorLoc) | msado15::Recordset21 |
setCursorType(int plCursorType) | msado15::Recordset21 |
setDataMember(String pbstrDataMember) | msado15::Recordset21 |
setDataSource(IUnknown ppunkDataSource) | msado15::Recordset21 |
setFilter(Variant Criteria) | msado15::Recordset21 |
setIndex(String pbstrIndex) | msado15::Recordset21 |
setLockType(int plLockType) | msado15::Recordset21 |
setMarshalOptions(int peMarshal) | msado15::Recordset21 |
setMaxRecords(int plMaxRecords) | msado15::Recordset21 |
setPageSize(int pl) | msado15::Recordset21 |
setSort(String Criteria) | msado15::Recordset21 |
setSource(Object pvSource) | msado15::Recordset21 |
setSource(String pvSource) | msado15::Recordset21 |
setStayInSync(boolean pbStayInSync) | msado15::Recordset21 |
Supports(int CursorOptions) | msado15::Recordset21 |
Update(Variant Fields, Variant Values) | msado15::Recordset21 |
UpdateBatch(int AffectRecords) | msado15::Recordset21 |
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/comp.h Source File

  • SysMgmt
  • MMC
  • Proppage

comp.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMP_H_
00020 #define _SAMPCOMP_H_
00021
00022 #include <mmc.h>
00023
00024 class CComponent : public IComponent,
00025 IExtendPropertySheet2
00026 {
00027 private:
00028     ULONG       m_cref;
00029
00030     IConsole*   m_ipConsole;
00031
00032     class CComponentData *m_pComponentData;
00033
00034     public:
00035         CComponent(CComponentData *parent);
00036         ~CComponent();
00037
00038         ///////////////////////////////
00039         // Interface IUnknown
00040         ///////////////////////////////
00041         STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042         STDMETHODIMP_(ULONG) AddRef();
00043         STDMETHODIMP_(ULONG) Release();
00044
00045         ///////////////////////////////
00046         // Interface IComponent
00047         ///////////////////////////////
00048         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00049             /* [in] */ LPCONSOLE lpConsole);
00050
00051             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00052             /* [in] */ LPDATAOBJECT lpDataObject,
00053             /* [in] */ MMC_NOTIFY_TYPE event,
00054             /* [in] */ LPARAM arg,
00055             /* [in] */ LPARAM param);
00056
00057             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
00058             /* [in] */ MMC_COOKIE cookie);
00059
00060             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00061             /* [in] */ MMC_COOKIE cookie,
00062             /* [in] */ DATA_OBJECT_TYPES type,
00063             /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00064
00065             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
00066             /* [in] */ MMC_COOKIE cookie,
00067             /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00068             /* [out] */ long __RPC_FAR *pViewOptions);
00069
00070             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00071             /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
00072
00073             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00074             /* [in] */ LPDATAOBJECT lpDataObjectA,
00075             /* [in] */ LPDATAOBJECT lpDataObjectB);
00076
00077             //////////////////////////////////
00078             // Interface IExtendPropertySheet2
00079             //////////////////////////////////
00080             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreatePropertyPages(
00081             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00082             /* [in] */ LONG_PTR handle,
00083             /* [in] */ LPDATAOBJECT lpIDataObject);
00084
00085             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryPagesFor(
00086             /* [in] */ LPDATAOBJECT lpDataObject);
00087
00088             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetWatermarks(
00089             /* [in] */ LPDATAOBJECT lpIDataObject,
00090             /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00091             /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00092             /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00093             /* [out] */ BOOL __RPC_FAR *bStretch);
00094 };
00095
00096 #endif _SAMPCOMP_H_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_REGSTRUCT Member List

This is the complete list of members for _REGSTRUCT, including all inherited members.
hRootKey | _REGSTRUCT
lpszData | _REGSTRUCT
lpszSubKey | _REGSTRUCT
lpszValueName | _REGSTRUCT
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IRowsetScrollImpl< T, RowsetInterface > Member List

This is the complete list of members for IRowsetScrollImpl< T, RowsetInterface >, including all inherited members.
Compare(HCHAPTER hReserved, ULONG cbBookmark1, const BYTE *pBookmark1, ULONG cbBookmark2, const BYTE *pBookmark2, DBCOMPARE *pComparison) | IRowsetScrollImpl< T, RowsetInterface > | [inline]
GetApproximatePosition(HCHAPTER hReserved, ULONG cbBookmark, const BYTE __RPC_FAR *pBookmark, ULONG __RPC_FAR *pulPosition, ULONG __RPC_FAR *pcRows) | IRowsetScrollImpl< T, RowsetInterface > | [inline]
GetRowsAt(HWATCHREGION hReserved1, HCHAPTER hReserved2, ULONG cbBookmark, const BYTE *pBookmark, LONG lRowsOffset, LONG cRows, ULONG *pcRowsObtained, HROW **prghRows) | IRowsetScrollImpl< T, RowsetInterface > | [inline]
GetRowsAtRatio(HWATCHREGION hReserved1, HCHAPTER hReserved2, ULONG ulNumerator, ULONG ulDenominator, LONG cRows, ULONG __RPC_FAR *pcRowsObtained, HROW __RPC_FAR *__RPC_FAR *prghRows) | IRowsetScrollImpl< T, RowsetInterface > | [inline]
GetRowsByBookmark(HCHAPTER hReserved, ULONG cRows, const ULONG rgcbBookmarks[], const BYTE *rgpBookmarks[], HROW rghRows[], DBROWSTATUS rgRowStatus[]) | IRowsetScrollImpl< T, RowsetInterface > | [inline]
Hash(HCHAPTER hReserved, ULONG cBookmarks, const ULONG rgcbBookmarks[], const BYTE *rgpBookmarks[], DWORD rgHashedValues[], DBROWSTATUS rgBookmarkStatus[]) | IRowsetScrollImpl< T, RowsetInterface > | [inline]
HashBmk(ULONG cbBmk, const BYTE *pbBmk, ULONG *pdwHashedValue, ULONG ulTableSize=0xffffffff) | IRowsetScrollImpl< T, RowsetInterface > | [inline, protected]
ValidateBookmark(ULONG cbBookmark, const BYTE *pBookmark) | IRowsetScrollImpl< T, RowsetInterface > | [inline, protected]
Generated on Wed Nov 13 2024 16:57:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/GINA/GinaStub/GinaStub.h Source File

  • Security
  • GINA
  • GinaStub

GinaStub.h

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Module:   Ginastub.h
00010
00011  Abstract: See ReadMe.txt for more detail information about this sample.
00012
00013  Revision: August 2, 1999.
00014
00015 ------------------------------------------------------------------------------*/
00016
00017 //
00018 // Function prototypes for the GINA interface.
00019 //
00020
00021 typedef BOOL (WINAPI * PFWLXNEGOTIATE)  (DWORD, DWORD *);
00022 typedef BOOL (WINAPI * PFWLXINITIALIZE) (LPWSTR, HANDLE, PVOID, PVOID, PVOID *);
00023 typedef VOID (WINAPI * PFWLXDISPLAYSASNOTICE) (PVOID);
00024 typedef int  (WINAPI * PFWLXLOGGEDOUTSAS) (PVOID, DWORD, PLUID, PSID, PDWORD,
00025                                            PHANDLE, PWLX_MPR_NOTIFY_INFO,
00026                                            PVOID *);
00027 typedef BOOL (WINAPI * PFWLXACTIVATEUSERSHELL) (PVOID, PWSTR, PWSTR, PVOID);
00028 typedef int  (WINAPI * PFWLXLOGGEDONSAS) (PVOID, DWORD, PVOID);
00029 typedef VOID (WINAPI * PFWLXDISPLAYLOCKEDNOTICE) (PVOID);
00030 typedef int  (WINAPI * PFWLXWKSTALOCKEDSAS) (PVOID, DWORD);
00031 typedef BOOL (WINAPI * PFWLXISLOCKOK) (PVOID);
00032 typedef BOOL (WINAPI * PFWLXISLOGOFFOK) (PVOID);
00033 typedef VOID (WINAPI * PFWLXLOGOFF) (PVOID);
00034 typedef VOID (WINAPI * PFWLXSHUTDOWN) (PVOID, DWORD);
00035
00036 //
00037 // New for version 1.1
00038 //
00039
00040 typedef BOOL (WINAPI * PFWLXSCREENSAVERNOTIFY) (PVOID, BOOL *);
00041 typedef BOOL (WINAPI * PFWLXSTARTAPPLICATION) (PVOID, PWSTR, PVOID, PWSTR);
00042
00043 //
00044 // New for version 1.3
00045 //
00046
00047 typedef BOOL (WINAPI * PFWLXNETWORKPROVIDERLOAD) (PVOID, PWLX_MPR_NOTIFY_INFO);
00048 typedef BOOL (WINAPI * PFWLXDISPLAYSTATUSMESSAGE) (PVOID, HDESK, DWORD, PWSTR, PWSTR);
00049 typedef BOOL (WINAPI * PFWLXGETSTATUSMESSAGE) (PVOID, DWORD *, PWSTR, DWORD);
00050 typedef BOOL (WINAPI * PFWLXREMOVESTATUSMESSAGE) (PVOID);
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAPIDoc Member List

This is the complete list of members for CAPIDoc, including all inherited members.
CAPIDoc() | CAPIDoc | [protected]
count | CAPIDoc |
domainName | CAPIDoc |
GetServerName() | CAPIDoc | [inline]
GetSessionID() | CAPIDoc | [inline]
m_ServerName | CAPIDoc | [private]
OnProcess() | CAPIDoc | [protected]
OnRunTest() | CAPIDoc | [protected]
OnSendMessage() | CAPIDoc | [protected]
OnSession() | CAPIDoc | [protected]
OnShutdownSystem() | CAPIDoc | [protected]
OnUserconfig() | CAPIDoc | [protected]
OnWaitEvent() | CAPIDoc | [protected]
pServerInfo | CAPIDoc |
ReadTrustedDomains() | CAPIDoc |
Serialize(CArchive &ar) | CAPIDoc | [virtual]
serverName | CAPIDoc |
sessionID | CAPIDoc |
SetServerName(TCHAR *temp) | CAPIDoc | [inline]
SetSessionID(DWORD p) | CAPIDoc | [inline]
~CAPIDoc() | CAPIDoc | [virtual]
Generated on Wed Nov 13 2024 16:55:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/propldr.cpp Source File

  • WinUI
  • tsfapp

propldr.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation. All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          PropLdr.cpp
00013
00014    Description:   CTSFPersistentPropertyLoader implementation.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019   #include statements
00020 **************************************************************************/
00021
00022 #include "PropLdr.h"
00023
00024 /**************************************************************************
00025
00026   CTSFPersistentPropertyLoader::CTSFPersistentPropertyLoader()
00027
00028 **************************************************************************/
00029
00030 CTSFPersistentPropertyLoader::CTSFPersistentPropertyLoader(TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr, IStream *pStream)
00031 {
00032     m_ObjRefCount = 1;
00033     m_hdr = *pHdr;
00034     m_pb = (BYTE *)GlobalAlloc(GPTR, pHdr->cb);
00035     if(m_pb)
00036     {
00037         pStream->Read(m_pb, pHdr->cb, NULL);
00038     }
00039 }
00040
00041 /**************************************************************************
00042
00043   CTSFPersistentPropertyLoader::~CTSFPersistentPropertyLoader()
00044
00045 **************************************************************************/
00046
00047 CTSFPersistentPropertyLoader::~CTSFPersistentPropertyLoader()
00048 {
00049     if(m_pb)
00050     {
00051         GlobalFree(m_pb);
00052     }
00053 }
00054
00055 ///////////////////////////////////////////////////////////////////////////
00056 //
00057 // IUnknown Implementation
00058 //
00059
00060 /**************************************************************************
00061
00062   CTSFPersistentPropertyLoader::QueryInterface()
00063
00064 **************************************************************************/
00065
00066 STDAPI CTSFPersistentPropertyLoader::QueryInterface(REFIID riid, void **ppvObj)
00067 {
00068     if(ppvObj == NULL)
00069     {
00070         return E_POINTER;
00071     }
00072
00073     *ppvObj = NULL;
00074
00075     if (IsEqualIID(riid, IID_IUnknown) ||
00076         IsEqualIID(riid, IID_ITfPersistentPropertyLoaderACP))
00077     {
00078         *ppvObj = (ITfPersistentPropertyLoaderACP*)this;
00079     }
00080
00081     if (*ppvObj == NULL)
00082     {
00083         return E_NOINTERFACE;
00084     }
00085
00086     AddRef();
00087     return S_OK;
00088 }
00089
00090 /**************************************************************************
00091
00092   CTSFPersistentPropertyLoader::AddRef()
00093
00094 **************************************************************************/
00095
00096 STDAPI_(ULONG) CTSFPersistentPropertyLoader::AddRef()
00097 {
00098     m_ObjRefCount++;
00099     return m_ObjRefCount;
00100 }
00101
00102 /**************************************************************************
00103
00104   CTSFPersistentPropertyLoader::Release()
00105
00106 **************************************************************************/
00107
00108 STDAPI_(ULONG) CTSFPersistentPropertyLoader::Release()
00109 {
00110     if(--m_ObjRefCount == 0)
00111     {
00112         delete this;
00113         return 0;
00114     }
00115
00116     return m_ObjRefCount;
00117 }
00118
00119
00120 ///////////////////////////////////////////////////////////////////////////
00121 //
00122 // ITfPersistentPropertyLoaderACP Implementation
00123 //
00124 // we count on the given TF_PERSISTENT_PROPERTY_HEADER_ACP structure for the place
00125 // to be loaded.
00126
00127 /**************************************************************************
00128
00129   CTSFPersistentPropertyLoader::LoadProperty()
00130
00131 **************************************************************************/
00132
00133 STDMETHODIMP CTSFPersistentPropertyLoader::LoadProperty(const TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr, IStream **ppStream)
00134 {
00135     HRESULT hr;
00136     IStream *pStream;
00137
00138     *ppStream = NULL;
00139
00140     if (m_pb == NULL)
00141         return E_FAIL; // failed initial mem alloc
00142
00143     //create a stream to return
00144     hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
00145     if(SUCCEEDED(hr))
00146     {
00147         //write the property data into the stream
00148         hr = pStream->Write(m_pb, m_hdr.cb, NULL);
00149         if(SUCCEEDED(hr))
00150         {
00151             LARGE_INTEGER   li;
00152
00153             li.QuadPart = 0;
00154             hr = pStream->Seek(li, STREAM_SEEK_SET, NULL);
00155             if(SUCCEEDED(hr))
00156             {
00157                 *ppStream = pStream;
00158             }
00159         }
00160     }
00161
00162     return hr;
00163 }
00164
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EXTENSION_NODE Member List

This is the complete list of members for EXTENSION_NODE, including all inherited members.
GUID | EXTENSION_NODE
szDescription | EXTENSION_NODE
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/VListVw/VListVw.h Source File

  • WinUI
  • Controls
  • Common
  • VListVw

VListVw.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 #include "resource.h"
00011
00012 #ifndef WIN32
00013
00014 #define GET_WM_COMMAND_ID(wp, lp)               (wp)
00015 #define GET_WM_COMMAND_HWND(wp, lp)             (HWND)(LOWORD(lp))
00016 #define GET_WM_COMMAND_CMD(wp, lp)              HIWORD(lp)
00017
00018 #endif
00019
00020 int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
00021 BOOL InitApplication(HINSTANCE);
00022 BOOL InitInstance(HINSTANCE, int);
00023 LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
00024 INT_PTR CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM);
00025 HWND CreateListView(HINSTANCE, HWND);
00026 void ResizeListView(HWND, HWND);
00027 BOOL InitListView(HWND);
00028
00029 #define ID_LISTVIEW  2000
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagPLUGXPRT_PARAMETERS Member List

This is the complete list of members for tagPLUGXPRT_PARAMETERS, including all inherited members.
cbPhysicalLayerReceiveBufferSize | tagPLUGXPRT_PARAMETERS
cbPhysicalLayerSendBufferSize | tagPLUGXPRT_PARAMETERS
cbReadFileBufferSize | tagPLUGXPRT_PARAMETERS
cbStructSize | tagPLUGXPRT_PARAMETERS
cMaximumT200TimeoutsInQ922 | tagPLUGXPRT_PARAMETERS
dwFlags | tagPLUGXPRT_PARAMETERS
eCallControl | tagPLUGXPRT_PARAMETERS
nT203TimeoutInQ922 | tagPLUGXPRT_PARAMETERS
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Handler.h Source File

  • NetDS
  • SyncMgr
  • SyncDir

Handler.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #ifndef _HANDER_IMPL_
00013 #define _HANDER_IMPL_
00014
00015 // itemList used  keeping track of items to sync.
00016 typedef struct  _tagHANDLERITEM_SYNCSTATUS
00017 {
00018     GENERICITEM  genericItem;
00019     SYNCMGRITEMID ItemID;
00020     BOOL fCancelled; // set if cancel comes in after called to PrePrepareForSync.
00021     BOOL fSynchronizing; // set when actually performing a sync.
00022     BOOL fSynchronizeComplete; // set when actually performing a sync.
00023     BOOL fUnresolvedConflicts; // conflict occured during sync and were not resolved
00024     DWORD dwSyncMgrResultStatus; // result of sync on item.
00025 }  HANDLERITEM_SYNCSTATUS;
00026 typedef HANDLERITEM_SYNCSTATUS *LPHANDLERITEM_SYNCSTATUS;
00027
00028
00029 // file object used to keep track of items.
00030 typedef struct  _tagFILEOBJECT
00031 {
00032     GENERICITEM  genericItem;
00033     TCHAR fName[MAX_PATH];
00034     BOOL fDirectory;
00035     BOOL fLastUpdateValid;
00036     FILETIME ftLastUpdate;
00037     LPGENERICITEMLIST pChildList;
00038 }  FILEOBJECT;
00039 typedef FILEOBJECT *LPFILEOBJECT;
00040
00041 typedef GENERICITEMLIST FILEOBJECTLIST;
00042 typedef LPGENERICITEMLIST LPFILEOBJECTLIST;
00043
00044 class CSyncMgrHandler :  public  ISyncMgrSynchronize, public CLockHandler
00045 {
00046 private:
00047     DWORD   m_dwSyncFlags;
00048     DWORD m_cRef;
00049     LPSYNCMGRSYNCHRONIZECALLBACK m_pSyncMgrSynchronizeCallback;
00050         LPGENERICITEMLIST m_pItemsToSyncList;
00051         HANDLE m_phThread;  // handle to worker thread
00052         HWND m_hwndWorker;        // hwnd of WorkerThread hwnd.
00053         HWND m_hwndHandler;     // hwnd of window on same thread as handler.
00054         BOOL m_fSynchronizing; // flag set when actually synchronizing data.
00055         BOOL m_fPrepareForSync; // flag set when actually synchronizing data.
00056         BOOL m_fStopped; // indicates if a StopSetItemStatus has come in.
00057
00058 public:
00059         CSyncMgrHandler();
00060     ~CSyncMgrHandler();
00061
00062         /* IUnknown */
00063
00064         STDMETHODIMP        QueryInterface(REFIID, LPVOID FAR *);
00065     STDMETHODIMP_(ULONG)    AddRef();
00066     STDMETHODIMP_(ULONG)    Release();
00067
00068         /* ISyncMgrSynchronize methods */
00069     STDMETHODIMP    Initialize(DWORD dwReserved,DWORD dwSyncFlags,
00070                     DWORD cbCookie,const BYTE *lpCooke);
00071     STDMETHODIMP    GetHandlerInfo(LPSYNCMGRHANDLERINFO *ppSyncMgrHandlerInfo);
00072
00073     STDMETHODIMP    EnumSyncMgrItems(ISyncMgrEnumItems **ppenumOffineItems);
00074     STDMETHODIMP    GetItemObject(REFSYNCMGRITEMID ItemID,REFIID riid,void** ppv);
00075     STDMETHODIMP    ShowProperties(HWND hWndParent,REFSYNCMGRITEMID ItemID);
00076     STDMETHODIMP    SetProgressCallback(ISyncMgrSynchronizeCallback *lpCallBack);
00077     STDMETHODIMP    PrepareForSync(ULONG cbNumItems,SYNCMGRITEMID* pItemIDs,HWND hWndParent,
00078                     DWORD dwReserved);
00079     STDMETHODIMP    Synchronize(HWND hWndParent);
00080     STDMETHODIMP    SetItemStatus(REFSYNCMGRITEMID ItemID,DWORD dwSyncMgrStatus);
00081     STDMETHODIMP    ShowError(HWND hWndParent,REFSYNCMGRERRORID ErrorID);
00082
00083         // methods called on worker thread.
00084     void ShowPropertiesCall(HWND hWndParent,REFSYNCMGRITEMID ItemID);
00085     void PrepareForSyncCall(ULONG cbNumItems,SYNCMGRITEMID* pItemIDs,HWND hWndParent,
00086                     DWORD dwReserved);
00087     void SynchronizeCall(HWND hWndParent);
00088     void ShowErrorCall(HWND hWndParent,REFSYNCMGRERRORID ErrorID);
00089
00090 private:
00091         STDMETHODIMP CreateWorkerThread();
00092         LPSYNCMGRSYNCHRONIZECALLBACK GetProgressCallback();
00093         void Progress(ISyncMgrSynchronizeCallback *lpCallBack,REFSYNCMGRITEMID pItemID,
00094                                 UINT mask,TCHAR *pStatusText,DWORD dwStatusType,
00095                                 int iProgValue,int iMaxValue);
00096         void ProgressSetItemStatusType(ISyncMgrSynchronizeCallback *lpCallBack,
00097                                     REFSYNCMGRITEMID pItemID,DWORD dwSyncMgrStatus);
00098         void ProgressSetItemStatusText(ISyncMgrSynchronizeCallback *lpCallBack,
00099                                     REFSYNCMGRITEMID pItemID,TCHAR *pStatusText);
00100         void ProgressSetItemProgValue(ISyncMgrSynchronizeCallback *lpCallBack,
00101                                     REFSYNCMGRITEMID pItemID,int iProgValue);
00102         void ProgressSetItemProgMaxValue(ISyncMgrSynchronizeCallback *lpCallBack,
00103                                     REFSYNCMGRITEMID pItemID,int iProgMaxValue);
00104
00105         void LogError(ISyncMgrSynchronizeCallback *lpCallBack,REFSYNCMGRITEMID pItemID,
00106                       DWORD dwErrorLevel,TCHAR *lpErrorText,DWORD mask,DWORD dwSyncMgrErrorFlags,
00107                       SYNCMGRERRORID ErrorID);
00108         void LogError(ISyncMgrSynchronizeCallback *lpCallBack,REFSYNCMGRITEMID pItemID,
00109                       DWORD dwErrorLevel,TCHAR *lpErrorText);
00110         void LogError(ISyncMgrSynchronizeCallback *lpCallBack,
00111                       DWORD dwErrorLevel,TCHAR *lpErrorText);
00112
00113         // helper methods specific to this handler.
00114         LPFILEOBJECTLIST CreateDirFileListFromPath(TCHAR *pDirName,BOOL fRecursive);
00115         LPFILEOBJECTLIST GetFilesForDir(TCHAR *pDirName,BOOL fRecursive);
00116         void ReleaseFileObjectList(LPFILEOBJECTLIST pfObjList,BOOL fRecursive);
00117         ULONG CountNumberOfFilesInList(LPFILEOBJECTLIST pfObjList,BOOL fRecursive);
00118         LPFILEOBJECT FindFileItemWithName(LPFILEOBJECTLIST pDir,TCHAR *pfName);
00119         BOOL CopyFileFullPath(TCHAR *pszFile1,TCHAR *pszFile2);
00120         void CopyFiles( LPHANDLERITEM_SYNCSTATUS pHandlerItemID,
00121                                 LPHANDLERITEMSETTINGS pHandlerSyncItem,
00122                                 LPSYNCMGRSYNCHRONIZECALLBACK pCallback,
00123                                 DWORD *pdwCurProgValue,TCHAR *pszDir1,LPFILEOBJECTLIST pDir1,
00124                                 TCHAR *pszDir2);
00125         void ReconcileDir(HWND hWndParent,LPHANDLERITEM_SYNCSTATUS pHandlerItemID,
00126                                 LPHANDLERITEMSETTINGS pHandlerSyncItem,
00127                                 LPSYNCMGRSYNCHRONIZECALLBACK pCallback,
00128                                 DWORD *pdwCurProgValue,
00129                                 TCHAR *pszDir1,LPFILEOBJECTLIST pDir1,
00130                                 TCHAR *pszDir2,LPFILEOBJECTLIST pDir2);
00131         void SyncDirs(HWND hWndParent,LPHANDLERITEM_SYNCSTATUS pHandlerItemID,
00132                                 LPHANDLERITEMSETTINGS pHandlerSyncItem);
00133
00134 friend LRESULT CALLBACK  HandlerThreadWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
00135 };
00136
00137
00138 // wrapper object for Callback so can send any callback messges back to
00139 // the main thread we were created on to conform to COM standards
00140 class CCallbackWrapper: public ISyncMgrSynchronizeCallback
00141 {
00142 public:
00143     CCallbackWrapper(HWND hwndCallback);
00144     ~CCallbackWrapper();
00145
00146     //IUnknown methods
00147     STDMETHODIMP            QueryInterface(REFIID, LPVOID FAR *);
00148     STDMETHODIMP_(ULONG)    AddRef();
00149     STDMETHODIMP_(ULONG)    Release();
00150
00151     // Callback methods.
00152     STDMETHODIMP Progress(REFSYNCMGRITEMID ItemID,LPSYNCMGRPROGRESSITEM lpSyncProgressItem);
00153     STDMETHODIMP PrepareForSyncCompleted(HRESULT hr);
00154     STDMETHODIMP SynchronizeCompleted(HRESULT hr);
00155     STDMETHODIMP ShowPropertiesCompleted(HRESULT hr);
00156     STDMETHODIMP ShowErrorCompleted(HRESULT hr,ULONG cbNumItems,SYNCMGRITEMID *pItemIDs);
00157
00158     STDMETHODIMP EnableModeless(BOOL fEnable);
00159     STDMETHODIMP LogError(DWORD dwErrorLevel,const WCHAR *lpcErrorText,LPSYNCMGRLOGERRORINFO lpSyncLogError);
00160     STDMETHODIMP DeleteLogError(REFSYNCMGRERRORID ErrorID,DWORD dwReserved);
00161     STDMETHODIMP EstablishConnection( WCHAR const * lpwszConnection, DWORD dwReserved);
00162 private:
00163
00164     ULONG m_cRef;
00165     HWND  m_hwndCallback;
00166 };
00167
00168
00169
00170
00171 // CSyncMgrHandler creates a worker thread in ::Initialize to use for async syncmgrCalls.
00172 // the following are delclarations for the worker thread.
00173
00174 // structure passed in CreateThread.
00175 typedef struct _tagWorkerThreadArgs
00176 {
00177 /* [in ]  */ HANDLE hEvent; // Event to wait on for new thread to be created.
00178 /* [in ]  */ CSyncMgrHandler *pThis; // point to class worker thread for
00179 /* [out]  */  HWND hwnd;  // on return code of NOERROR contains workerThread hwnd.
00180 /* [out]  */  HRESULT hr; // return code of thread.
00181 }  WorkerThreadArgs;
00182
00183 DWORD WINAPI WorkerThread( LPVOID lpArg );
00184
00185 // structures and Wnd messages for posting to Worker Threads hwnd.
00186 typedef struct _tagPREPAREFORSYNCMSG
00187 {
00188 ULONG cbNumItems;
00189 HWND hWndParent;
00190 DWORD dwReserved;
00191 SYNCMGRITEMID* pItemIDs;
00192 } PREPAREFORSYNCMSG;
00193
00194 typedef struct _tagSYNCHRONIZEMSG
00195 {
00196 HWND hWndParent;
00197 } SYNCHRONIZEMSG;
00198
00199 typedef struct _tagSHOWPROPERTIESMSG
00200 {
00201 HWND hWndParent;
00202 SYNCMGRITEMID ItemID;
00203 } SHOWPROPERTIESMSG;
00204
00205 typedef struct _tagSHOWERRORMSG
00206 {
00207 HWND hWndParent;
00208 SYNCMGRERRORID ErrorID;
00209 } SHOWERRORMSG;
00210
00211 typedef struct _tagPROGRESSMSG
00212 {
00213 SYNCMGRITEMID ItemID;
00214 LPSYNCMGRPROGRESSITEM lpSyncProgressItem;
00215 } PROGRESSMSG;
00216
00217 typedef struct _tagPREPAREFORSYNCCOMPLETEDMSG
00218 {
00219 HRESULT hr;
00220 } PREPAREFORSYNCCOMPLETEDMSG;
00221
00222 typedef struct _tagSYNCHRONIZECOMPLETEDMSG
00223 {
00224 HRESULT hr;
00225 } SYNCHRONIZECOMPLETEDMSG;
00226
00227 typedef struct _tagSHOWPROPERTIESCOMPLETEDMSG
00228 {
00229 HRESULT hr;
00230 } SHOWPROPERTIESCOMPLETEDMSG;
00231
00232 typedef struct _tagSHOWERRORCOMPLETEDMSG
00233 {
00234 HRESULT hr;
00235 ULONG cbNumItems;
00236 SYNCMGRITEMID *pItemIDs;
00237 } SHOWERRORCOMPLETEDMSG;
00238
00239 typedef struct _tagENABLEMODELESSMSG
00240 {
00241 BOOL fEnable;
00242 } ENABLEMODELESSMSG;
00243
00244 typedef struct _tagLOGERRORMSG
00245 {
00246 DWORD dwErrorLevel;
00247 const WCHAR *lpcErrorText;
00248 LPSYNCMGRLOGERRORINFO lpSyncLogError;
00249 } LOGERRORMSG;
00250
00251
00252 typedef struct _tagDELETELOGERRORMSG
00253 {
00254 SYNCMGRERRORID ErrorID;
00255 DWORD dwReserved;
00256 } DELETELOGERRORMSG;
00257
00258 typedef struct _tagESTABLISHCONNECTIONMSG
00259 {
00260 WCHAR const * lpwszConnection;
00261 DWORD dwReserved;
00262 } ESTABLISHCONNECTIONMSG;
00263
00264 typedef struct _tagMETHODARGS
00265 {
00266     DWORD dwWorkerMsg;
00267     BOOL fAsync; // indicates this is an async call.
00268     HRESULT hr; // only valid for synchronouse calls
00269     union
00270     {
00271         PREPAREFORSYNCMSG PrepareForSyncMsg;
00272         SYNCHRONIZEMSG SynchronizeMsg;
00273         SHOWPROPERTIESMSG ShowPropertiesMsg;
00274         SHOWERRORMSG ShowErrorMsg;
00275
00276         PROGRESSMSG ProgressMsg;
00277         PREPAREFORSYNCCOMPLETEDMSG PrepareForSyncCompletedMsg;
00278         SYNCHRONIZECOMPLETEDMSG SynchronizeCompletedMsg;
00279         SHOWPROPERTIESCOMPLETEDMSG ShowPropertiesCompletedMsg;
00280         SHOWERRORCOMPLETEDMSG ShowErrorCompletedMsg;
00281         ENABLEMODELESSMSG EnableModelessMsg;
00282         LOGERRORMSG LogErrorMsg;
00283         DELETELOGERRORMSG DeleteLogErrorMsg;
00284         ESTABLISHCONNECTIONMSG EstablishConnectionMsg;
00285     };
00286 } METHODARGS; // list of possible member for calling ThreadWndProc
00287
00288 // definitions for handler messages
00289 #define WM_WORKERMSG_SHOWPROPERTIES (WM_USER+1)
00290 #define WM_WORKERMSG_PREPFORSYNC (WM_USER+2)
00291 #define WM_WORKERMSG_SYNCHRONIZE  (WM_USER+3)
00292 #define WM_WORKERMSG_SHOWERROR (WM_USER+4)
00293 #define WM_WORKERMSG_RELEASE  (WM_USER+5)
00294
00295 // worker messages for Callback wrapper
00296 #define WM_WORKERMSG_PROGRESS                   (WM_USER+20)
00297 #define WM_WORKERMSG_PREPAREFORSYNCCOMPLETED     (WM_USER+21)
00298 #define WM_WORKERMSG_SYNCHRONIZECOMPLETED       (WM_USER+22)
00299 #define WM_WORKERMSG_SHOWPROPERTIESCOMPLETED    (WM_USER+23)
00300 #define WM_WORKERMSG_SHOWERRORCOMPLETED         (WM_USER+24)
00301 #define WM_WORKERMSG_ENABLEMODELESS             (WM_USER+25)
00302 #define WM_WORKERMSG_LOGERROR                   (WM_USER+26)
00303 #define WM_WORKERMSG_DELETELOGERROR             (WM_USER+27)
00304 #define WM_WORKERMSG_ESTABLISHCONNECTION        (WM_USER+28)
00305
00306 #define DWL_THREADWNDPROCCLASS 0 // window long offset to MsgService Hwnd this ptr.
00307
00308 #define SZ_SAMPLESYNCMGRHANDLERWNDCLASS TEXT("Sample SyncMgr HandlerThread hwnd")
00309 #define SZ_SAMPLESYNCMGRWORKERWNDCLASS TEXT("Sample SyncMgr WorkThread hwnd")
00310
00311 LRESULT CALLBACK  HandlerThreadWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
00312 LRESULT CALLBACK  WorkerThreadWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
00313 BOOL RegisterHandlerWndClasses(void);
00314
00315 #endif // #define _HANDER_IMPL_
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/StrOut/Common.h Source File

  • NetDS
  • RPC
  • StrOut

Common.h

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00002 /*                  Copyright Microsoft Corp. 1992 - 2000                 */
00003 /*                      Remote Machine strout sample                    */
00004 /*                                                                      */
00005 /*  FILE    :   common.h                                                */
00006 /*                                                                      */
00007 /*  PURPOSE :   Definitions used in the program                         */
00008 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00009 #ifndef __COMMON_STROUT__   // If this file has be included before
00010 #define __COMMON_STROUT__   // Don't include it again
00011
00012 #include <windows.h>        // The CommandLineToArgvW is defined here
00013 #include <stdio.h>
00014 #include <stdlib.h>
00015 #include <tchar.h>          // Included to support UNICODE/ANSI
00016
00017 // Return values from the program to the OS
00018 #define EXECUTION_FAILED    -1
00019 #define EXECUTION_OK        0
00020
00021 // Exception handler macro
00022 #define DO_EXCEPTION        1       // Execute the exception block
00023
00024 // Macro for printing out error message and exit the program if an
00025 // error occured
00026 #define EXIT_IF_FAIL(x, string){  \
00027     ((x) != RPC_S_OK)?_tprintf(TEXT("%s returned with error: %d\n"), \
00028     TEXT(string), (x)),exit(x):0;}
00029
00030 // Common type definition and defines used in the program
00031 #define PROTOCOL_SEQUENCE   TEXT("ncacn_np")
00032 #define END_POINT           TEXT("\\pipe\\strout_sample")
00033 #define IGNORE_CHAR         TEXT('=')
00034 #define NULL_CHAR           TEXT('\0')
00035
00036 #endif  // ifndef __COMMON_STROUT__
00037
00038
00039
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComObj/CRUCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • ComObj

CRUCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CRUCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COCruiseCar COM
00005              object class.
00006
00007              CRUCAR showcases the construction of the COCruiseCar COM object
00008              class with the IUnknown, ICar, and ICruise interfaces.  This
00009              is done through Aggregation reuse of COCar's ICar
00010              interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial COMOBJ.HTM
00014              file.  For more specific technical details on the internal
00015              workings see the comments dispersed throughout the
00016              module's source code.
00017
00018   Classes:   COCruiseCar
00019
00020   Functions: none.
00021
00022   Origin:    10-3-97: atrent - Created. [Revised]
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will make calls to the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include COMOBJI.H because it has internal class declarations and
00048     resource ID definitions specific for this DLL.
00049   We include COMOBJ.H because it has the interface declarations.
00050   We include CAR.H because it has the class COCar declarations.
00051   We include CRUCAR.H because it has the class COCruiseCar declarations.
00052 ---------------------------------------------------------------------------*/
00053 #include <windows.h>
00054 #include <ole2.h>
00055 #include <apputil.h>
00056 #include <icars.h>
00057 #include <carguids.h>
00058 #include "comobji.h"
00059 #define _LOCALCALLS_
00060 #include "comobj.h"
00061 #include "car.h"
00062 #include "crucar.h"
00063
00064
00065 /*---------------------------------------------------------------------------
00066   COCruiseCar's implementation of its main COM object class including
00067   Constructor, Destructor, QueryInterface, AddRef, and Release.
00068 ---------------------------------------------------------------------------*/
00069
00070 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00071   Method:   COCruiseCar::COCruiseCar
00072
00073   Summary:  COCruiseCar Constructor. Note the member initializer:
00074             "m_ImpICruise(this, pUnkOuter)" which is used to pass the
00075             'this' and pUnkOuter pointers of this constructor function
00076             to the constructor in the instantiation of the implementation
00077             of the CImpICar interface (which is nested inside this present
00078             COCruiseCar Object Class).
00079
00080   Args:     IUnknown* pUnkOuter)
00081               Pointer to the the outer Unknown.  NULL means this COM Object
00082               is not being Aggregated.  Non NULL means it is being created
00083               on behalf of an outside COM object that is reusing it via
00084               aggregation.
00085
00086   Modifies: m_cRefs, m_pUnkOuter.
00087
00088   Returns:  void
00089 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00090 COCruiseCar::COCruiseCar(
00091   IUnknown* pUnkOuter) :
00092   m_ImpICruise(this, pUnkOuter)
00093 {
00094   // Zero the COM object's reference count.
00095   m_cRefs = 0;
00096
00097   // No AddRef necessary if non-NULL, as this present COM object's lifetime
00098   // is totally coupled with the controlling Outer object's lifetime.
00099   m_pUnkOuter = pUnkOuter;
00100
00101   // Zero the pointer to the aggregated COCar object's IUnknown
00102   // interface (for delegation of IUnknown calls to it).
00103   m_pUnkCar = NULL;
00104
00105   LOGF1("D: COCruiseCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00106
00107   return;
00108 }
00109
00110
00111 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00112   Method:   COCruiseCar::~COCruiseCar
00113
00114   Summary:  COCruiseCar Destructor.
00115
00116   Args:     void
00117
00118   Returns:  void
00119 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00120 COCruiseCar::~COCruiseCar(void)
00121 {
00122   LOG("D: COCruiseCar::Destructor.");
00123
00124   RELEASE_INTERFACE(m_pUnkCar);
00125
00126   return;
00127 }
00128
00129
00130 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00131   Method:   COCruiseCar::Init
00132
00133   Summary:  COCruiseCar Initialization method.
00134
00135   Args:     void
00136
00137   Modifies: m_pUnkCar, m_pICar, m_cRefs.
00138
00139   Returns:  HRESULT
00140               Standard result code. NOERROR for success.
00141 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00142 HRESULT COCruiseCar::Init(void)
00143 {
00144   HRESULT hr;
00145   // Set up the right pIUnknown for delegation.  If we are being
00146   // aggregated then we pass the pUnkOuter in turn to any COM objects
00147   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00148   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00149
00150   LOG("D: COCruiseCar::Init.");
00151
00152   // We create an instance of the COCar object and do this via the
00153   // Aggregation reuse technique.  Note we pass pUnkOuter as the
00154   // Aggregation pointer.  It is the 'this' pointer to this present
00155   // CruiseCar object if we are not being aggregated; otherwise it is
00156   // the pointer to the outermost object's controlling IUnknown.  Following
00157   // the rules of Aggregation we ask CreateCar for an IID_IUnknown
00158   // interface.  We cache this pointer to the IUnknown of the new COCar
00159   // COM object for later use in delegating IUnknown calls.
00160   hr = CreateCar(pUnkOuter, IID_IUnknown, (PPVOID)&m_pUnkCar);
00161
00162   return (hr);
00163 }
00164
00165
00166 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00167   Method:   COCruiseCar::QueryInterface
00168
00169   Summary:  QueryInterface of the COCruiseCar non-delegating
00170             IUnknown implementation.
00171
00172   Args:     REFIID riid,
00173               [in] GUID of the Interface being requested.
00174             PPVOID ppv)
00175               [out] Address of the caller's pointer variable that will
00176               receive the requested interface pointer.
00177
00178   Returns:  HRESULT
00179 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00180 STDMETHODIMP COCruiseCar::QueryInterface(
00181                REFIID riid,
00182                PPVOID ppv)
00183 {
00184   HRESULT hr = E_NOINTERFACE;
00185   *ppv = NULL;
00186
00187   if (IID_IUnknown == riid)
00188   {
00189     *ppv = this;
00190     LOG("D: COCruiseCar::QueryInterface. 'this' pIUnknown returned.");
00191   }
00192   else if (IID_ICruise == riid)
00193   {
00194     // This ICruise interface is implemented in this COCruiseCar object and
00195     // might be called a native interface of COCruiseCar.
00196     *ppv = &m_ImpICruise;
00197     LOG("D: COCruiseCar::QueryInterface. pICruise returned.");
00198   }
00199
00200   if (NULL != *ppv)
00201   {
00202     // We've handed out a pointer to an interface so obey the COM rules
00203     //   and AddRef its reference count.
00204     ((LPUNKNOWN)*ppv)->AddRef();
00205     hr = NOERROR;
00206   }
00207   else if (IID_ICar == riid)
00208   {
00209     LOG("D: COCruiseCar::QueryInterface. ICar delegating.");
00210     // We didn't implement the ICar interface in this COCruiseCar object.
00211     // The aggregated inner COCar object is contributing the ICar
00212     // interface to this present composite or aggregating CruiseCar object.
00213     // So, to satisfy a QI request for the ICar interface, we delegate
00214     // the QueryInterface to the inner object's controlling IUnknown.
00215     hr = m_pUnkCar->QueryInterface(riid, ppv);
00216   }
00217
00218   return (hr);
00219 }
00220
00221
00222 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00223   Method:   COCruiseCar::AddRef
00224
00225   Summary:  AddRef of the COCruiseCar non-delegating IUnknown implementation.
00226
00227   Args:     void
00228
00229   Modifies: m_cRefs.
00230
00231   Returns:  ULONG
00232               New value of m_cRefs (COM object's reference count).
00233 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00234 STDMETHODIMP_(ULONG) COCruiseCar::AddRef(void)
00235 {
00236   m_cRefs++;
00237
00238   LOGF1("D: COCruiseCar::AddRef. New cRefs=%i.", m_cRefs);
00239
00240   return m_cRefs;
00241 }
00242
00243
00244 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00245   Method:   COCruiseCar::Release
00246
00247   Summary:  Release of the COCruiseCar non-delegating IUnknown implementation.
00248
00249   Args:     void
00250
00251   Modifies: m_cRefs.
00252
00253   Returns:  ULONG
00254               New value of m_cRefs (COM object's reference count).
00255 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00256 STDMETHODIMP_(ULONG) COCruiseCar::Release(void)
00257 {
00258   ULONG ulCount = --m_cRefs;
00259
00260   LOGF1("D: COCruiseCar::Release. New cRefs=%i.", m_cRefs);
00261
00262   if (0 == m_cRefs)
00263   {
00264     // We artificially bump the main ref count.  This fulfills one of
00265     // the rules of aggregated objects and ensures that an indirect
00266     // recursive call to this release won't occur because of other
00267     // delegating releases that might happen in our own destructor.
00268     m_cRefs++;
00269     delete this;
00270   }
00271
00272   return ulCount;
00273 }
00274
00275
00276 /*---------------------------------------------------------------------------
00277   COCruiseCar's nested implementation of the ICruise interface including
00278   Constructor, Destructor, QueryInterface, AddRef, Release,
00279   Engage, and Adjust.
00280 ---------------------------------------------------------------------------*/
00281
00282 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00283   Method:   COCruiseCar::CImpICruise::CImpICruise
00284
00285   Summary:  Constructor for the CImpICruise interface instantiation.
00286
00287   Args:     COCruiseCar* pBackObj,
00288               Back pointer to the parent outer object.
00289             IUnknown* pUnkOuter)
00290               Pointer to the outer Unknown.  For delegation.
00291
00292   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00293
00294   Returns:  void
00295 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00296 COCruiseCar::CImpICruise::CImpICruise(
00297   COCruiseCar* pBackObj,
00298   IUnknown* pUnkOuter)
00299 {
00300   // Init the Interface Ref Count (used for debugging only).
00301   m_cRefI = 0;
00302
00303   // Init the Back Object Pointer to point to the outer object.
00304   m_pBackObj = pBackObj;
00305
00306   // Init the CImpICruise interface's delegating Unknown pointer.  We use
00307   // the Back Object pointer for IUnknown delegation here if we are not
00308   // being aggregated.  If we are being aggregated we use the supplied
00309   // pUnkOuter for IUnknown delegation.  In either case the pointer
00310   // assignment requires no AddRef because the CImpICruise lifetime is
00311   // quaranteed by the lifetime of the parent object in which
00312   // CImpICruise is nested.
00313   if (NULL == pUnkOuter)
00314   {
00315     m_pUnkOuter = pBackObj;
00316     LOG("D: COCruiseCar::CImpICruise Constructor. Non-Aggregating.");
00317   }
00318   else
00319   {
00320     m_pUnkOuter = pUnkOuter;
00321     LOG("D: COCruiseCar::CImpICruise Constructor. Aggregating.");
00322   }
00323
00324   return;
00325 }
00326
00327
00328 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00329   Method:   COCruiseCar::CImpICruise::~CImpICruise
00330
00331   Summary:  Destructor for the CImpICruise interface instantiation.
00332
00333   Args:     void
00334
00335   Returns:  void
00336 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00337 COCruiseCar::CImpICruise::~CImpICruise(void)
00338 {
00339   LOG("D: COCruiseCar::CImpICruise Destructor.");
00340
00341   return;
00342 }
00343
00344
00345 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00346   Method:   COCruiseCar::CImpICruise::QueryInterface
00347
00348   Summary:  The QueryInterface IUnknown member of this ICruise interface
00349             implementation that delegates to m_pUnkOuter, whatever it is.
00350
00351   Args:     REFIID riid,
00352               [in] GUID of the Interface being requested.
00353             PPVOID ppv)
00354               [out] Address of the caller's pointer variable that will
00355               receive the requested interface pointer.
00356
00357   Returns:  HRESULT
00358               Returned by the delegated outer QueryInterface call.
00359 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00360 STDMETHODIMP COCruiseCar::CImpICruise::QueryInterface(
00361                REFIID riid,
00362                PPVOID ppv)
00363 {
00364   LOG("D: COCruiseCar::CImpICruise::QueryInterface. Delegating.");
00365
00366   // Delegate this call to the outer object's QueryInterface.
00367   return m_pUnkOuter->QueryInterface(riid, ppv);
00368 }
00369
00370
00371 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00372   Method:   COCruiseCar::CImpICruise::AddRef
00373
00374   Summary:  The AddRef IUnknown member of this ICruise interface
00375             implementation that delegates to m_pUnkOuter, whatever it is.
00376
00377   Args:     void
00378
00379   Modifies: m_cRefI.
00380
00381   Returns:  ULONG
00382               Returned by the delegated outer AddRef call.
00383 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00384 STDMETHODIMP_(ULONG) COCruiseCar::CImpICruise::AddRef(void)
00385 {
00386   // Increment the Interface Reference Count.
00387   ++m_cRefI;
00388
00389   LOGF1("D: COCruiseCar::CImpICruise::Addref. Delegating. New cI=%i.", m_cRefI);
00390
00391   // Delegate this call to the outer object's AddRef.
00392   return m_pUnkOuter->AddRef();
00393 }
00394
00395
00396 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00397   Method:   COCruiseCar::CImpICruise::Release
00398
00399   Summary:  The Release IUnknown member of this ICruise interface
00400             implementation that delegates to m_pUnkOuter, whatever it is.
00401
00402   Args:     void
00403
00404   Returns:  ULONG
00405               Returned by the delegated outer Release call.
00406 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00407 STDMETHODIMP_(ULONG) COCruiseCar::CImpICruise::Release(void)
00408 {
00409   // Decrement the Interface Reference Count.
00410   --m_cRefI;
00411
00412   LOGF1("D: COCruiseCar::CImpICruise::Release. Delegating. New cI=%i.", m_cRefI);
00413
00414   // Delegate this call to the outer object's Release.
00415   return m_pUnkOuter->Release();
00416 }
00417
00418
00419 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00420   Method:   COCruiseCar::CImpICruise::Engage
00421
00422   Summary:  The Engage member method of this ICruise interface
00423             implementation.  A simple empty method on a COCruiseCar COM
00424             object for tutorial purposes.  Presumably if this Car object
00425             were modeling a real Car then the Engage method would turn
00426             the Cruise control system on or off.
00427
00428   Args:     BOOL bOnOff)
00429               TRUE for On; FALSE for Off.
00430
00431   Returns:  HRESULT
00432               NOERROR
00433 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00434 STDMETHODIMP COCruiseCar::CImpICruise::Engage(
00435                BOOL bOnOff)
00436 {
00437   LOGF1("D: COCruiseCar::CImpICruise::Engage. Called. bOnOff=%i.",bOnOff);
00438
00439   return NOERROR;
00440 }
00441
00442
00443 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00444   Method:   COCruiseCar::CImpICruise::Adjust
00445
00446   Summary:  The Adjust member method of this ICruise interface
00447             implementation.  A simple empty method on a COCruiseCar COM
00448             object for tutorial purposes.  Presumably if this Car object
00449             were modeling a real Car then the Adjust method would allow
00450             notching the cruise set speed up or down by increments of 3 mph.
00451
00452   Args:     BOOL bUpDown)
00453               TRUE for Up; FALSE for Down.
00454
00455   Returns:  HRESULT
00456               NOERROR
00457 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00458 STDMETHODIMP COCruiseCar::CImpICruise::Adjust(
00459                BOOL bUpDown)
00460 {
00461   LOGF1("D: COCruiseCar::CImpICruise::Adjust. Called. bUpDown=%i.",bUpDown);
00462
00463   return NOERROR;
00464 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SIGGEN_COUNTER Member List

This is the complete list of members for _SIGGEN_COUNTER, including all inherited members.
CounterBlock | _SIGGEN_COUNTER
dwConstantValue | _SIGGEN_COUNTER
dwReserved | _SIGGEN_COUNTER
dwSineWaveValue | _SIGGEN_COUNTER
dwSquareWaveValue | _SIGGEN_COUNTER
dwTriangleWaveValue | _SIGGEN_COUNTER
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/NewsEventClass/newsevent.Cpp Source File

  • Com
  • Services
  • Events
  • EventNews
  • NewsEventClass

newsevent.Cpp

Go to the documentation of this file.
00001 // NewsEvent.cpp : Implementation of CNewsEvent
00002 #include "stdafx.h"
00003 #include "NewsEventClass.h"
00004 #include "NewsEvent.h"
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // CNewsEvent
00008
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSimple Member List

This is the complete list of members for CSimple, including all inherited members.
CSimple() | CSimple |
DECLARE_REGISTRY(CSimple, _T("IISSample.C++ATLSimple.1"), _T("IISSample.C++ATLSimple"), IDS_SIMPLE_DESC, THREADFLAGS_BOTH) STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) | CSimple |
FinalCountruct() | CSimple | [inline]
FinalRelease() | CSimple | [inline]
get_myProperty(BSTR *pbstrOutValue) | CSimple |
m_bstrMyProperty | CSimple | [private]
m_pUnkMarshaler | CSimple | [private]
myMethod(BSTR bstrIn, BSTR *pbstrOut) | CSimple |
put_myProperty(BSTR bstrInValue) | CSimple |
Generated on Wed Nov 13 2024 16:57:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/Resource.h Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

Resource.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //{{NO_DEPENDENCIES}}
00013 // Microsoft Developer Studio generated include file.
00014 // Used by GraphObj.rc
00015 //
00016 #define IDS_PROJNAME                    100
00017 #define IDR_POINT                       101
00018 #define IDR_LINE                        102
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        201
00025 #define _APS_NEXT_COMMAND_VALUE         32768
00026 #define _APS_NEXT_CONTROL_VALUE         201
00027 #define _APS_NEXT_SYMED_VALUE           103
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Rename/vc/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Rename
  • vc

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__CC7384B0_AF3F_11D2_9A73_0080C7A2DC6B__INCLUDED_)
00007 #define AFX_STDAFX_H__CC7384B0_AF3F_11D2_9A73_0080C7A2DC6B__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00013
00014 // TODO: reference additional headers your program requires here
00015
00016 //{{AFX_INSERT_LOCATION}}
00017 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00018
00019 #endif // !defined(AFX_STDAFX_H__CC7384B0_AF3F_11D2_9A73_0080C7A2DC6B__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/TextSINK.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

TextSINK.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      TEXTSINK.H
00003
00004   Summary:   Include file for the COTextPageSink COM object class.
00005
00006              COTextPageSink offers a main IUnknown standard interface and
00007              the custom ITextPageSink interface (outgoing connection
00008              events from COTextPage objects). This multiple interface COM
00009              Object Class is achieved via the technique of nested classes.
00010              The implementation of the ITextPageSink interface is nested
00011              inside of the COTextPageSink Class.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial PERCLIEN.HTM
00015              file. For more specific technical details on the internal
00016              workings see the comments dispersed throughout the module's
00017              source code.
00018
00019   Functions: .
00020
00021   Classes:   COTextPageSink.
00022
00023   Origin:    5-25-96: atrent - Editor-inheritance from SINK.H in the
00024              STOCLIEN Tutorial Code Sample.
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 #if !defined(TEXTSINK_H)
00042 #define TEXTSINK_H
00043
00044 #ifdef __cplusplus
00045
00046
00047 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00048   ObjectClass: COTextPageSink
00049
00050   Summary:     The main Sink COM object class for COTextPageSink COM
00051                objects. COM objects of this class offer the ITextPageSink
00052                sink interface supporting various TextPage events. The
00053                mulitple interfaces on this COM object are constructed via
00054                the nested interface classes technique.
00055
00056   Interfaces:  IUnknown
00057                  Standard interface providing COM object features.
00058                ITextPageSink
00059                  Sink interface for TextPage events.
00060
00061   Aggregation: Yes, COTextPageSink COM Objects are aggregatable by passing
00062                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00063 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00064 class COTextPageSink : public IUnknown
00065 {
00066   public:
00067     // Main Object Constructor & Destructor.
00068     COTextPageSink(IUnknown* pUnkOuter, CGuiText* pGuiText);
00069     ~COTextPageSink(void);
00070
00071     // IUnknown methods. Main object, non-delegating.
00072     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00073     STDMETHODIMP_(ULONG) AddRef(void);
00074     STDMETHODIMP_(ULONG) Release(void);
00075
00076   private:
00077     // We declare nested class interface implementations here.
00078
00079     class CImpITextPageSink : public ITextPageSink
00080     {
00081       public:
00082         // Interface Implementation Constructor & Destructor.
00083         CImpITextPageSink(COTextPageSink* pCO, IUnknown* pUnkOuter);
00084         ~CImpITextPageSink(void);
00085
00086         // IUnknown methods.
00087         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00088         STDMETHODIMP_(ULONG) AddRef(void);
00089         STDMETHODIMP_(ULONG) Release(void);
00090
00091         // ITextPageSink methods.
00092         STDMETHODIMP         Loaded(void);
00093         STDMETHODIMP         Saved(void);
00094         STDMETHODIMP         Put(void);
00095         STDMETHODIMP         Cleared(void);
00096
00097       private:
00098         // Data private to this interface implementation of ITextPage.
00099         COTextPageSink*  m_pCO;          // Parent Object back pointer.
00100         IUnknown*        m_pUnkOuter;    // Outer unknown for Delegation.
00101     };
00102
00103     // Make the otherwise private and nested ITextPageSink interface
00104     // implementation a friend to COM object instantiations of this
00105     // COTextPageSink COM object class.
00106     friend CImpITextPageSink;
00107
00108     // Private data of COTextPageSink COM objects.
00109
00110     // Nested ITextPageSink implementation instantiation.  This
00111     // ITextPageSink interface is instantiated inside this COTextPageSink
00112     // object as a native interface.
00113     CImpITextPageSink    m_ImpITextPageSink;
00114
00115     // Main Object reference count.
00116     ULONG                m_cRefs;
00117
00118     // Outer unknown (aggregation delegation). Used when this COM object
00119     // is being aggregated.
00120     IUnknown*            m_pUnkOuter;
00121
00122     // Pointer to the main object that can service the Sink events.
00123     CGuiText*            m_pGuiText;
00124 };
00125
00126 #endif // __cplusplus
00127
00128
00129 #endif // TEXTSINK_H
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Command.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Command.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=00000507-0000-0010-8000-00AA006D2EA4,DynamicCasts)
00019     @com.interface(iid=0000054E-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public class Command implements IUnknown,com.ms.com.NoAutoScripting,msado15._Command
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public native msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1610809344, type=PROPGET, name="ActiveConnection", name2="getActiveConnection", addFlagsVtable=4)
00027       @com.parameters([iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00028   public native msado15._Connection getActiveConnection();
00029
00030   /** @com.method(vtoffset=6, dispid=1610809344, type=PROPPUTREF, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00031       @com.parameters([in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] ppvObject) */
00032   public native void setActiveConnection(msado15._Connection ppvObject);
00033
00034   /** @com.method(vtoffset=7, dispid=1610809344, type=PROPPUT, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00035       @com.parameters([in,type=VARIANT] ppvObject) */
00036   public native void setActiveConnection(Variant ppvObject);
00037
00038   /** @com.method(vtoffset=8, dispid=1610809347, type=PROPGET, name="CommandText", name2="getCommandText", addFlagsVtable=4)
00039       @com.parameters([type=STRING] return) */
00040   public native String getCommandText();
00041
00042   /** @com.method(vtoffset=9, dispid=1610809347, type=PROPPUT, name="CommandText", name2="putCommandText", addFlagsVtable=4)
00043       @com.parameters([in,type=STRING] pbstr) */
00044   public native void setCommandText(String pbstr);
00045
00046   /** @com.method(vtoffset=10, dispid=1610809349, type=PROPGET, name="CommandTimeout", name2="getCommandTimeout", addFlagsVtable=4)
00047       @com.parameters([type=I4] return) */
00048   public native int getCommandTimeout();
00049
00050   /** @com.method(vtoffset=11, dispid=1610809349, type=PROPPUT, name="CommandTimeout", name2="putCommandTimeout", addFlagsVtable=4)
00051       @com.parameters([in,type=I4] pl) */
00052   public native void setCommandTimeout(int pl);
00053
00054   /** @com.method(vtoffset=12, dispid=1610809351, type=PROPGET, name="Prepared", name2="getPrepared", addFlagsVtable=4)
00055       @com.parameters([type=BOOLEAN] return) */
00056   public native boolean getPrepared();
00057
00058   /** @com.method(vtoffset=13, dispid=1610809351, type=PROPPUT, name="Prepared", name2="putPrepared", addFlagsVtable=4)
00059       @com.parameters([in,type=BOOLEAN] pfPrepared) */
00060   public native void setPrepared(boolean pfPrepared);
00061
00062   /** @com.method(vtoffset=14, dispid=1610809353, type=METHOD, name="Execute", addFlagsVtable=4)
00063       @com.parameters([out,elementType=VARIANT,type=PTR] RecordsAffected, [in,elementType=VARIANT,type=PTR] Parameters, [in,type=I4] Options, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00064   public native msado15._Recordset Execute(Variant RecordsAffected, Variant Parameters, int Options);
00065
00066   /** @com.method(vtoffset=15, dispid=1610809354, type=METHOD, name="CreateParameter", addFlagsVtable=4)
00067       @com.parameters([in,type=STRING] Name, [in,type=I4] Type, [in,type=I4] Direction, [in,type=I4] Size, [in,type=VARIANT] Value, [iid=0000050C-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00068   public native msado15._Parameter CreateParameter(String Name, int Type, int Direction, int Size, Variant Value);
00069
00070   /** @com.method(vtoffset=16, dispid=0, type=PROPGET, name="Parameters", name2="getParameters", addFlagsVtable=4)
00071       @com.parameters([iid=0000050D-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00072   public native msado15.Parameters getParameters();
00073
00074   /** @com.method(vtoffset=17, dispid=1610809356, type=PROPPUT, name="CommandType", name2="putCommandType", addFlagsVtable=4)
00075       @com.parameters([in,type=I4] plCmdType) */
00076   public native void setCommandType(int plCmdType);
00077
00078   /** @com.method(vtoffset=18, dispid=1610809356, type=PROPGET, name="CommandType", name2="getCommandType", addFlagsVtable=4)
00079       @com.parameters([type=I4] return) */
00080   public native int getCommandType();
00081
00082   /** @com.method(vtoffset=19, dispid=1610809358, type=PROPGET, name="Name", name2="getName", addFlagsVtable=4)
00083       @com.parameters([type=STRING] return) */
00084   public native String getName();
00085
00086   /** @com.method(vtoffset=20, dispid=1610809358, type=PROPPUT, name="Name", name2="putName", addFlagsVtable=4)
00087       @com.parameters([in,type=STRING] pbstrName) */
00088   public native void setName(String pbstrName);
00089
00090   /** @com.method(vtoffset=21, dispid=1610874880, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00091       @com.parameters([type=I4] return) */
00092   public native int getState();
00093
00094   /** @com.method(vtoffset=22, dispid=1610874881, type=METHOD, name="Cancel", addFlagsVtable=4)
00095       @com.parameters() */
00096   public native void Cancel();
00097
00098
00099   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x54e, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00100
00101   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0x507, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00102 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/appletalk/PrPerf.c Source File

  • NetDS
  • WinSock
  • appletalk

PrPerf.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright 1994 - 2000 Microsoft Corporation
00004
00005 Module Name: prperf.c
00006
00007
00008 Abstract: This Sample Windows Socket Application demonstrates use of
00009           the AppleTalk PAP Protocol. Both a server and a client
00010           application are included in this source file. The client
00011           app reads a file and sends the contents to the server.
00012
00013
00014 --*/
00015
00016 #include <winsock.h>
00017 #include <windows.h>
00018
00019 #include <stdlib.h>
00020 #include <string.h>
00021 #include <stdio.h>
00022 #include <ctype.h>
00023 #include <time.h>
00024
00025 //
00026 // the following header contains appletalk specific definitions.
00027 // should be included for AppleTalk Windows Socket Applications
00028 //
00029 #include <atalkwsh.h>
00030 #include "prsamp.h"
00031
00032 #define SOCKET_COUNT                    32
00033
00034 #define DEF_SERVER_NAME                 "Windows Adsp"
00035 #define DEF_SERVER_TYPE                 "Windows Sockets"
00036 #define DEF_SERVER_ZONE                 "*"
00037 #define BLOCKSIZE                       4096
00038
00039 #define DEF_QUEUE_LEN                   5
00040 #define PROTOCOL_LEN                    10
00041
00042 CHAR        gServerName[MAX_ENTITY]         = DEF_SERVER_NAME;
00043 CHAR        gServerType[MAX_ENTITY]         = DEF_SERVER_TYPE;
00044 CHAR        gServerZone[MAX_ENTITY]         = DEF_SERVER_ZONE;
00045 CHAR        gProtocolName[PROTOCOL_LEN]     = "ADSP";
00046 size_t      gNumTimes                       = 5;
00047
00048 SYSTEMTIME    SystemStartTime;
00049 SYSTEMTIME    SystemEndTime;
00050 FILETIME      FileTime;
00051
00052 BOOL fVerify = FALSE;
00053 BOOL fRDM    = FALSE;
00054
00055 int loop = 1, looptot;
00056 double Throughput, AvgThroughPut, MinThroughPut, MaxThroughPut;
00057
00058 CHAR DataString[] = {"0123456789abcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+"};
00059
00060 typedef struct Sock_Info {
00061     int     socket_type;
00062     int     protocol;
00063
00064     SOCKET  socket;
00065     HANDLE  thread;
00066
00067     struct Sock_Info *next, *prev;
00068
00069 } *PTEST_INFO, TEST_INFO;
00070
00071 PTEST_INFO       gSocketList=NULL;  // List of client sockets
00072 CRITICAL_SECTION gListCritSec;
00073
00074 /******************************************************************************
00075
00076  Function - InsertSockInfo()
00077
00078  Comments - Inserts a socket context structure at the head of a linked list.
00079             The server maintains a list of all connected clients.
00080
00081 ******************************************************************************/
00082 void InsertSockInfo(TEST_INFO **head, TEST_INFO *info)
00083 {
00084     info->next = info->prev = NULL;
00085
00086     if (*head == NULL)
00087     {
00088         *head = info;
00089     }
00090     else
00091     {
00092         (*head)->prev = info;
00093         info->next    = *head;
00094         *head         = info;
00095     }
00096 }
00097
00098 /******************************************************************************
00099
00100  Function - RemoveSockInfo()
00101
00102  Comments - Removes the given socket context structure from the list. The
00103             server maintains a list of all connected clients.
00104
00105 ******************************************************************************/
00106 void RemoveSockInfo(TEST_INFO **head, TEST_INFO *info)
00107 {
00108     if (info->next)
00109         info->next->prev = info->prev;
00110     if (info->prev)
00111         info->prev->next = info->next;
00112
00113     if (info == *head)
00114     {
00115         *head = info->next;
00116     }
00117 }
00118
00119 /******************************************************************************
00120
00121  Function - main()
00122
00123  Comments - Parses the command line and starts either the client or server
00124             code.
00125
00126 ******************************************************************************/
00127 int __cdecl main (int argc, char **argv)
00128 {
00129     WSADATA WsaData;
00130     BOOL    fClient = FALSE;
00131     BOOL    fServer = FALSE;
00132     int     i, r;
00133
00134     for(i = 1; i < argc; i++)
00135     {
00136         if ( (strlen(argv[i]) == 2) && ( (argv[i][0] == '/') || (argv[i][0] == '-') ) )
00137         {
00138             switch(tolower(argv[i][1]))
00139             {
00140                 case 'n':
00141                     if (i+1 >= argc)
00142                         usage();
00143                     strncpy(gServerName, argv[++i], MAX_ENTITY-1);
00144                     break;
00145                 case 't':
00146                     if (i+1 >= argc)
00147                         usage();
00148                     strncpy(gServerType, argv[++i], MAX_ENTITY-1);
00149                     break;
00150                 case 'z':
00151                     if (i+1 >= argc)
00152                         usage();
00153                     strncpy(gServerZone, argv[++i], MAX_ENTITY-1);
00154                     break;
00155                 case 's':
00156                     if (fClient == TRUE)
00157                         usage();
00158                     fServer = TRUE;
00159                     break;
00160                 case 'c':
00161                     if (fServer == TRUE)
00162                         usage();
00163                     fClient = TRUE;
00164                     break;
00165                 case 'p':
00166                     if (i+1 >= argc)
00167                         usage();
00168                     strncpy(gProtocolName, argv[++i], PROTOCOL_LEN-1);
00169                     break;
00170                 case 'b':
00171                     if (i+1 >= argc)
00172                         usage();
00173                     gNumTimes = atoi(argv[++i]);
00174                     break;
00175                 case 'l':
00176                     if (i+1 >= argc)
00177                         usage();
00178                     loop = atoi(argv[++i]);
00179                     break;
00180                 case 'v':
00181                     fVerify = TRUE;
00182                     break;
00183                 case 'y':
00184                     fRDM = TRUE;
00185                     break;
00186                 case '?':
00187                 default:
00188                     usage();
00189
00190             }
00191         }
00192         else
00193         {
00194             usage();
00195         }
00196
00197     }
00198
00199
00200     printf("Server Name %s\n", gServerName);
00201     printf("Server Type %s\n", gServerType);
00202     printf("Server Zone %s\n", gServerZone);
00203
00204     printf("%s throughput measurement\n", gProtocolName);
00205
00206     if(_strnicmp(gProtocolName, "ADSP", 4) && _strnicmp(gProtocolName, "PAP", 3))
00207     {
00208         printf("\nInvalid Protocol Specified\n\n");
00209         usage();
00210     }
00211
00212     if(!(fClient || fServer))
00213         usage();
00214
00215     // Load winsock
00216     r = WSAStartup(0x0101, &WsaData);
00217     if (r != 0)
00218     {
00219         printf("Startup failed: %d\n", r);
00220         WSACleanup();
00221         return(0);
00222     }
00223
00224     if(fClient)
00225     {
00226         BOOL DClnt;
00227
00228         looptot       = 0;
00229         MaxThroughPut = 0;
00230         AvgThroughPut = 0;
00231
00232         while (looptot < loop)
00233         {
00234             DClnt = DoClient();
00235             if(DClnt)
00236             {
00237                 if ((looptot == 0) || (MinThroughPut > Throughput))
00238                     MinThroughPut = Throughput;
00239
00240                 if (MaxThroughPut < Throughput)
00241                     MaxThroughPut = Throughput;
00242
00243                 AvgThroughPut = ((AvgThroughPut * looptot) + Throughput)
00244                     / (looptot+1);
00245                 printf("Loop %2d/%d Throughput Cur/Min/Max/Ave :", ++looptot, loop);
00246                 printf(" %6.2f/%6.2f/%6.2f/%6.2f\n\n\n", Throughput,
00247                         MinThroughPut,
00248                         MaxThroughPut,
00249                         AvgThroughPut);
00250                 Throughput = 0.0;
00251             }
00252             else
00253             {
00254                 break;
00255             }
00256         }
00257     }
00258     else if (fServer)
00259     {
00260         DoServer();
00261     }
00262
00263     WSACleanup();
00264
00265     return(0);
00266 }
00267
00268 /******************************************************************************
00269
00270  Function - DoServer()
00271
00272  Calling Function - main();
00273
00274  Comments - This section of code calls the Server side of the application.
00275
00276 ******************************************************************************/
00277 BOOL DoServer()
00278 {
00279     BOOL   fRet = FALSE;
00280
00281     //
00282     // register the name specified on the command line  or use the
00283     // defaults.
00284     //
00285
00286     fRet = OpenSocketRegisterAndListen();
00287
00288     return(fRet);
00289
00290 }
00291
00292
00293 /******************************************************************************
00294
00295  Function - OpenSocketRegisterAndListen()
00296
00297  Calling Function - DoServer();
00298
00299  Comments - This section of code controls the Server side of the application.
00300
00301 ******************************************************************************/
00302
00303 BOOL OpenSocketRegisterAndListen()
00304 {
00305
00306     int                  r = 0;         // return from socket calls
00307     BOOL                 fRet = TRUE;
00308     SOCKET               sock, newsock; // SOCKET descriptor
00309     SOCKADDR_AT          atalkaddr;     // See atalkwsh.h
00310     WSH_REGISTER_NAME    nbpname;       // structure for registering NBP name
00311                                         // see atalkwsh.h
00312     fd_set               readfds;       // fd_set strutture for select call
00313     int                  addrlen;
00314     PTEST_INFO           test;
00315     int                  sockettype = SOCK_STREAM;
00316     int                  protocoltype = ATPROTO_ADSP;
00317     unsigned long        ThreadId;
00318     struct timeval       tval;
00319     TEST_INFO           *sockptr,
00320                         *socktmp;
00321
00322
00323     //
00324     // open a appletalk socket. The protocol family should be AF_APPLETALK,
00325     // the socket type can be SOCK_STREAM or SOCK_RDM, and the ProtocolType
00326     // for PAP socket must be ATPROTO_PAP. Note that opening a socket does
00327     // not yet create an endpoint on the AppleTalk Protocol. A bind must
00328     // happen before this socket can be used with AppleTalk;
00329     //
00330
00331     do
00332     {
00333         if (!_strnicmp(gProtocolName, "PAP", 3))
00334         {
00335             sockettype = SOCK_RDM;
00336             protocoltype = ATPROTO_PAP;
00337         }
00338         else if (fRDM)
00339         {
00340             sockettype = SOCK_RDM;
00341         }
00342
00343
00344         sock = socket(AF_APPLETALK, sockettype, protocoltype);
00345
00346         if (sock == INVALID_SOCKET)
00347         {
00348             printf("Open Socket: Error = %ld\n", WSAGetLastError());
00349             r = SOCKET_ERROR;
00350             break;
00351         }
00352
00353         atalkaddr.sat_socket = 0;
00354         atalkaddr.sat_family = AF_APPLETALK;
00355
00356         r = bind(sock, (struct sockaddr *)&atalkaddr, sizeof(SOCKADDR_AT));
00357         if(r == SOCKET_ERROR)
00358         {
00359             printf("Bind:Error = %d\n", WSAGetLastError());
00360             break;
00361         }
00362
00363         //
00364         // end point has now been created on the AppleTalk Protocol
00365         // now register the name that the client will look up.
00366         //
00367
00368         strncpy(nbpname.ObjectName, gServerName, MAX_ENTITY-1);
00369         nbpname.ObjectNameLen = (char) strlen(nbpname.ObjectName);
00370
00371         strncpy(nbpname.TypeName, gServerType, MAX_ENTITY-1);
00372         nbpname.TypeNameLen = (char) strlen(nbpname.TypeName);
00373
00374         strncpy(nbpname.ZoneName, "*", MAX_ENTITY-1);
00375         nbpname.ZoneNameLen = (char) strlen(nbpname.ZoneName);
00376
00377         printf("Registering %s:%s@%s\n",
00378                 nbpname.ObjectName,
00379                 nbpname.TypeName,
00380                 nbpname.ZoneName);
00381
00382
00383         r = setsockopt(
00384                 sock,                          // socket descriptor
00385                 SOL_APPLETALK,                 // socket level - always SOL_APPLETALK
00386                 SO_REGISTER_NAME,              // socket option
00387                 (char *)&nbpname,              // nbp name structure
00388                 sizeof(WSH_NBP_NAME));         // size of nbp name structure
00389
00390         if (r == SOCKET_ERROR)
00391         {
00392             printf("Register Name: Error = %d\n", WSAGetLastError());
00393             break;
00394         }
00395
00396         printf("Socket bound and registered\n");
00397
00398     } while(FALSE);
00399
00400     if(r == SOCKET_ERROR)
00401     {
00402         closesocket(sock);
00403         return(FALSE);
00404     }
00405
00406     //
00407     // Post a listen on this socket. The default queue length is 5
00408     //
00409
00410     r =  listen(sock, DEF_QUEUE_LEN);
00411     if (r == SOCKET_ERROR)
00412     {
00413         printf("Listen:Error = %d\n", WSAGetLastError());
00414         closesocket(sock);
00415         return FALSE;
00416     }
00417
00418     __try {
00419         InitializeCriticalSection(&gListCritSec);
00420     }
00421     __except(EXCEPTION_EXECUTE_HANDLER) {
00422         fprintf(stderr, "Unable to initialize critical section!\n");
00423         closesocket(sock);
00424         return FALSE;
00425     }
00426
00427     //
00428     // listen is successful. select the socket for reading
00429     //
00430
00431     do
00432     {
00433         FD_ZERO(&readfds);            // clear set
00434         FD_SET(sock, &readfds);       // add sock to set
00435
00436         tval.tv_sec  = 1;
00437         tval.tv_usec = 0;
00438
00439         //
00440         // this is a blocking select. Select will complete when
00441         // a client connects.
00442         //
00443
00444         r = select(0, &readfds, NULL, NULL, &tval);
00445
00446         if (r == SOCKET_ERROR)
00447         {
00448             printf("Select: Error = %d\n", WSAGetLastError());
00449             fRet = FALSE;
00450             break;
00451         }
00452
00453         if (r == 0)
00454         {
00455
00456             // Timeout, check for exiting threads
00457             sockptr     = gSocketList;
00458             while (sockptr)
00459             {
00460                 r = WaitForSingleObject(sockptr->thread, 0);
00461                 if ((r != WAIT_FAILED) && (r != WAIT_TIMEOUT))
00462                 {
00463                     printf("Freeing client connection ...\n");
00464
00465                     EnterCriticalSection(&gListCritSec);
00466                     if (sockptr->socket == INVALID_SOCKET)
00467                     {
00468                         closesocket(sockptr->socket);
00469                         sockptr->socket = INVALID_SOCKET;
00470                     }
00471                     socktmp = sockptr->next;
00472
00473                     CloseHandle(sockptr->thread);
00474                     RemoveSockInfo(&gSocketList, sockptr);
00475                     HeapFree(GetProcessHeap(), 0, sockptr);
00476
00477                     LeaveCriticalSection(&gListCritSec);
00478
00479                     sockptr = socktmp;
00480                 }
00481                 else if (r == WAIT_TIMEOUT)
00482                 {
00483                     sockptr = sockptr->next;
00484                 }
00485                 else if (r == WAIT_FAILED)
00486                 {
00487                     fRet = FALSE;
00488                     break;
00489                 }
00490             }
00491             if (fRet == FALSE)
00492                 break;
00493
00494             continue;
00495         }
00496
00497         //
00498         // Accept an incoming request.
00499         //
00500
00501         addrlen = sizeof(SOCKADDR_AT);
00502         newsock = accept(sock, (struct sockaddr *)&atalkaddr, &addrlen);
00503
00504         if (newsock == INVALID_SOCKET)
00505         {
00506             printf("Accept: Socket Error = %d\n", WSAGetLastError());
00507
00508             fRet = FALSE;
00509             break;
00510         }
00511
00512         printf("Accepted connection from %x:%x:%x\n",
00513                 atalkaddr.sat_net,
00514                 atalkaddr.sat_node,
00515                 atalkaddr.sat_socket);
00516
00517         test = (PTEST_INFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TEST_INFO));
00518         if (test == NULL)
00519         {
00520             fprintf(stderr, "HeapAlloc failed: %d\n", GetLastError());
00521             closesocket(newsock);
00522             fRet = FALSE;
00523             break;
00524         }
00525
00526         test->socket_type = sockettype;
00527         test->protocol    = protocoltype;
00528         test->socket      = newsock;
00529
00530         InsertSockInfo(&gSocketList, test);
00531
00532         test->thread = CreateThread(
00533                  NULL,
00534                  0,
00535                  (LPTHREAD_START_ROUTINE)PerfThread,
00536                  (PTEST_INFO) test,
00537                  0,
00538                  &ThreadId);
00539         if (test->thread == NULL)
00540         {
00541             fprintf(stderr,"CreateThread NULL 0 PerfThread(%d, 0, %d, 0, %p)",
00542                     test->socket_type, test->protocol, &ThreadId);
00543             fRet = FALSE;
00544             break;
00545         }
00546
00547         if (fRet == FALSE)
00548         {
00549             break;
00550         }
00551
00552     } while (TRUE);
00553
00554     closesocket(sock);
00555
00556     //
00557     // send all done - force client threads to close if outstanding
00558     //
00559     sockptr = gSocketList;
00560     while (sockptr)
00561     {
00562         // Close the socket
00563         EnterCriticalSection(&gListCritSec);
00564         if (sockptr->socket != INVALID_SOCKET)
00565         {
00566             closesocket(sockptr->socket);
00567             sockptr->socket = INVALID_SOCKET;
00568         }
00569         LeaveCriticalSection(&gListCritSec);
00570
00571         // Once socket is closed, client thread should exit thread on an error
00572         r = WaitForSingleObject(sockptr->thread, 10000);
00573         if (r == WAIT_FAILED)
00574         {
00575             fprintf(stderr, "WaitForSingleObject failed: %d\n", GetLastError());
00576         }
00577         else if (r == WAIT_TIMEOUT)
00578         {
00579             fprintf(stderr, "Thread not closing in a timely fashion!\n");
00580         }
00581
00582         // Close the thread handle and free the structure
00583         socktmp = sockptr->next;
00584
00585         CloseHandle(sockptr->thread);
00586         RemoveSockInfo(&gSocketList, sockptr);
00587         HeapFree(GetProcessHeap(), 0, sockptr);
00588
00589         sockptr = socktmp;
00590     }
00591
00592     DeleteCriticalSection(&gListCritSec);
00593
00594     return(TRUE);
00595 }
00596
00597
00598 /******************************************************************************
00599
00600  Function - PerfThread()
00601
00602  Calling Function - OpenSocketRegisterAndListen();
00603
00604  Comments - This section of code controls the Server side Recieve and Verification
00605             for the application.
00606
00607 ******************************************************************************/
00608
00609 unsigned long PerfThread( PTEST_INFO lpvTest )
00610 {
00611     int     r;                          // return from socket calls
00612     int     recvflags = 0;              // see WSARecvEx call
00613     CHAR    recvbuf[BLOCKSIZE];         // recv buffer
00614     u_long  blockmode = 1;              // see ioctlsocket call
00615     BOOL    fRet = TRUE;
00616     int     NumBytesRecvd = 0;
00617
00618     //
00619     // make socket non blocking. As far as possible, use non
00620     // blocking sockets to improve performance of app.
00621     //
00622     //
00623
00624     r = ioctlsocket(lpvTest->socket, FIONBIO, &blockmode);
00625
00626     if( r == SOCKET_ERROR)
00627     {
00628         printf("ioctlsocket: error = %d\n", WSAGetLastError());
00629         fRet = FALSE;
00630         ExitThread(FALSE);
00631     }
00632
00633     do
00634     {
00635         //
00636         // Prime a Read here. This will enable the receive to complete
00637         // This is PAP specific. For other AppleTalk protocols -
00638         // ADSP and DDP a recv can be posted directly
00639         //
00640
00641         if(!_strnicmp(gProtocolName, "PAP", 3))
00642         {
00643
00644             r = setsockopt(lpvTest->socket,
00645                     SOL_APPLETALK,
00646                     SO_PAP_PRIME_READ,
00647                     recvbuf,
00648                     sizeof(recvbuf));
00649
00650             if (r == SOCKET_ERROR)
00651             {
00652                 printf("primeread: error = %d\n", WSAGetLastError());
00653                 fRet = FALSE;
00654                 break;
00655             }
00656         }
00657
00658         fRet = CheckForRecv(lpvTest->socket);
00659
00660         if (fRet == FALSE)
00661             break;
00662
00663         recvflags = 0;
00664         r = WSARecvEx(lpvTest->socket,recvbuf,sizeof(recvbuf), &recvflags);
00665
00666         if( r == SOCKET_ERROR)
00667         {
00668
00669             if (WSAGetLastError() == WSAEWOULDBLOCK)
00670             {
00671                 continue;
00672             }
00673             else
00674             {
00675                 if(WSAGetLastError() == WSAENOTCONN || WSAGetLastError() == WSAEFAULT)
00676                     break;
00677                 printf("recv: error = %d\n", WSAGetLastError());
00678                 fRet = FALSE;
00679                 break;
00680             }
00681
00682         }
00683         if (r == 0)
00684              break;
00685
00686         if ((lpvTest->socket_type == SOCK_RDM) && (r < sizeof(recvbuf)))
00687         {
00688             printf("Did not receive entire message (%d bytes)\n", r);
00689             fRet = FALSE;
00690             break;
00691         }
00692
00693         printf("Recvd %d bytes\n", r);
00694
00695         if (fVerify)
00696         {
00697             int rr, sendoffset, sendleft;
00698
00699             sendoffset = 0;
00700             sendleft   = r;
00701
00702             do
00703             {
00704                 fRet = CheckForSend(lpvTest->socket);
00705
00706                 if (fRet == FALSE)
00707                 {
00708                     printf("send select error\n");
00709                     break;
00710                 }
00711
00712                 rr = send(lpvTest->socket, &recvbuf[sendoffset], sendleft, 0);
00713
00714                 if ( rr == SOCKET_ERROR )
00715                 {
00716                     if(WSAGetLastError() == WSAEWOULDBLOCK)
00717                     {
00718                         printf("Send: error = WSAEWOULDBLOCK\n");
00719                         continue;
00720                     }
00721                     else
00722                     {
00723                         printf("send: error = %d\n", WSAGetLastError());
00724                         break;
00725                     }
00726
00727                 }
00728
00729                 printf("Bytes Sent %d\n", rr);
00730
00731                 sendoffset += rr;
00732                 sendleft   -= rr;
00733
00734             } while(sendleft > 0);
00735
00736         }  // endif Verify
00737
00738
00739         NumBytesRecvd += r;
00740
00741     } while(TRUE);
00742
00743     printf("Total Number of Bytes Received = %d \n",NumBytesRecvd);
00744
00745     EnterCriticalSection(&gListCritSec);
00746
00747     closesocket(lpvTest->socket);
00748     lpvTest->socket = INVALID_SOCKET;
00749
00750     LeaveCriticalSection(&gListCritSec);
00751
00752     ExitThread(TRUE);
00753 }
00754
00755 /******************************************************************************
00756
00757  Function - DoClient()
00758
00759  Calling Function - main();
00760
00761  Comments - This section of code controls the Client side of the application.
00762
00763 ******************************************************************************/
00764
00765 BOOL DoClient()
00766 {
00767     int                  r = 0;             // return code
00768     BOOL                 fRet = FALSE;      //
00769     CHAR                 LookupBuffer[512]; // LookUp results return buffer
00770     PCHAR                ptupleBuffer;
00771     PWSH_LOOKUP_NAME     pLookup;
00772     PWSH_NBP_TUPLE       pTempTuple;
00773     SOCKADDR_AT          ataddress;
00774     int                  WrittenSize;
00775     SOCKET               clntsock;
00776     u_long               blockmode = 1;          // for ioctlsocket
00777     int                  BytesTransferred = 0;
00778     char *               memhandle;
00779     DWORD                hourdiff;          //, minutediff, seconddiff;
00780     double               StartSecond, EndSecond, ElapsedSeconds;
00781     int                  sendleft, sendoffset, recvleft, recvoffset;
00782     int                  sockettype = SOCK_STREAM;
00783     int                  prototype = ATPROTO_ADSP;
00784     size_t               i,copycount;
00785
00786     if (!_strnicmp(gProtocolName, "PAP", 3))
00787     {
00788         sockettype = SOCK_RDM;
00789         prototype = ATPROTO_PAP;
00790     }
00791     else if (fRDM)
00792     {
00793         sockettype = SOCK_RDM;
00794     }
00795
00796     do
00797     {
00798         //
00799         // See socket call in OpenSocketRegisterAndListen for desc
00800         //
00801         clntsock = socket(AF_APPLETALK, sockettype, prototype);
00802
00803         if(clntsock == INVALID_SOCKET)
00804         {
00805             printf("Open Socket: Error = %ld\n", WSAGetLastError());
00806             r = SOCKET_ERROR;
00807             break;
00808         }
00809
00810         ataddress.sat_socket = 0;
00811         ataddress.sat_family = AF_APPLETALK;
00812
00813         r = bind(clntsock, (struct sockaddr *)&ataddress, sizeof(SOCKADDR_AT));
00814
00815         if (r == SOCKET_ERROR)
00816         {
00817             printf("Bind:Error = %d\n", WSAGetLastError());
00818             break;
00819         }
00820
00821         //
00822         // end point has now been created on the AppleTalk Protocol.
00823         // lookup the server name.
00824         //
00825
00826         pLookup = (PWSH_LOOKUP_NAME)LookupBuffer;
00827
00828         strncpy(pLookup->LookupTuple.NbpName.ObjectName, gServerName, MAX_ENTITY-1);
00829         pLookup->LookupTuple.NbpName.ObjectNameLen = (char) strlen(gServerName);
00830
00831         strncpy(pLookup->LookupTuple.NbpName.TypeName,  gServerType, MAX_ENTITY-1);
00832         pLookup->LookupTuple.NbpName.TypeNameLen = (char) strlen(gServerType);
00833
00834         strncpy(pLookup->LookupTuple.NbpName.ZoneName, gServerZone, MAX_ENTITY-1);
00835         pLookup->LookupTuple.NbpName.ZoneNameLen = (char) strlen(gServerZone);
00836
00837         printf("Looking up %s:%s@%s\n",
00838                 pLookup->LookupTuple.NbpName.ObjectName,
00839                 pLookup->LookupTuple.NbpName.TypeName,
00840                 pLookup->LookupTuple.NbpName.ZoneName);
00841
00842         WrittenSize = sizeof(LookupBuffer);
00843
00844         r = getsockopt(clntsock, SOL_APPLETALK, SO_LOOKUP_NAME,
00845                 (char*)LookupBuffer,
00846                 &WrittenSize);
00847
00848         if(r == SOCKET_ERROR)
00849         {
00850             printf("getsockopt:error = %d\n", WSAGetLastError());
00851             break;
00852
00853         }
00854
00855         if (pLookup->NoTuples <= 0)
00856         {
00857             printf("LookupName failed - no tuples found\n");
00858             r=-1;
00859             break;
00860         }
00861
00862         ptupleBuffer = (char *)pLookup+sizeof(WSH_LOOKUP_NAME);
00863         pTempTuple = (PWSH_NBP_TUPLE)ptupleBuffer;
00864
00865         ataddress.sat_family = AF_APPLETALK;
00866         ataddress.sat_net = pTempTuple[0].Address.Network;
00867         ataddress.sat_node = pTempTuple[0].Address.Node;
00868         ataddress.sat_socket = pTempTuple[0].Address.Socket;
00869
00870         printf("server address = %lx.%lx.%lx.\n", ataddress.sat_net,
00871                 ataddress.sat_node,
00872                 ataddress.sat_socket);
00873
00874         //
00875         // lookup succeeded. Use the address in ataddress to connect to the
00876         // server
00877         //
00878
00879         r =  connect(clntsock, (struct sockaddr *)&ataddress, sizeof(SOCKADDR_AT));
00880
00881         if (r == SOCKET_ERROR)
00882         {
00883             printf("connect: error = %d\n", WSAGetLastError());
00884             break;
00885         }
00886
00887 #ifdef DEBUG
00888         //       printf("Connect Succeeded\n");
00889 #endif
00890
00891
00892     }while(FALSE);
00893
00894     if (r == SOCKET_ERROR)
00895     {
00896         if (clntsock != INVALID_SOCKET)
00897         {
00898             closesocket(clntsock);
00899             clntsock = INVALID_SOCKET;
00900         }
00901         return(FALSE);
00902     }
00903
00904     //
00905     //  Set Socket to non blocking mode
00906     //
00907
00908     r = ioctlsocket(clntsock, FIONBIO, &blockmode);
00909
00910 #ifdef DEBUG
00911     //       printf("ioctlsocket Succeeded\n");
00912 #endif
00913
00914     if( r == SOCKET_ERROR)
00915     {
00916         printf("ioctlsocket: error = %d\n", WSAGetLastError());
00917         return FALSE;
00918     }
00919
00920     //
00921     // Fill Up Send Buffer with Data
00922     //
00923     memhandle = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BLOCKSIZE);
00924     if (memhandle == NULL)
00925     {
00926         printf("LocalAlloc Failed %d\n", GetLastError());
00927         closesocket(clntsock);
00928         return(FALSE);
00929     }
00930
00931     //
00932     // fill the buffer with Data
00933     //
00934     i = 0;
00935     while (i < BLOCKSIZE)
00936     {
00937         if (i+strlen(DataString) <= BLOCKSIZE)
00938             copycount = strlen(DataString);
00939         else
00940             copycount = BLOCKSIZE - i;
00941         memcpy(&memhandle[i], DataString, copycount);
00942         i += copycount;
00943     }
00944     memhandle[BLOCKSIZE-1] = '\0';
00945
00946     fRet = CheckForSend(clntsock);
00947
00948     if(fRet == FALSE)
00949     {
00950         closesocket(clntsock);
00951         HeapFree(GetProcessHeap(), 0, memhandle);
00952         return FALSE;
00953     }
00954
00955     GetLocalTime(&SystemStartTime);
00956
00957 #ifdef DEBUG
00958     printf("Data Size = %d\n", lstrlen(memhandle)+1);
00959     //   printf("Base Data sent: %s\n",DataStartPtr);
00960     printf("Start Time:%d:%2d:%2d:%2d\t", SystemStartTime.wHour,
00961             SystemStartTime.wMinute,
00962             SystemStartTime.wSecond,
00963             SystemStartTime.wMilliseconds);
00964 #endif
00965
00966     for( i= 0; i < gNumTimes; i++)
00967     {
00968         //
00969         // Can I send - CheckForSend calls select to find if we can send
00970         // without blocking
00971         //
00972
00973         sendleft   = BLOCKSIZE;
00974         sendoffset = 0;
00975
00976         do
00977         {
00978             fRet = CheckForSend(clntsock);
00979
00980             if(fRet == FALSE)
00981             {
00982                 printf("send select error\n");
00983                 break;
00984             }
00985
00986             r = send(clntsock, &memhandle[sendoffset], sendleft, 0);
00987
00988             if ( r == SOCKET_ERROR )
00989             {
00990
00991                 if( WSAGetLastError() == WSAEWOULDBLOCK )
00992                 {
00993                     printf("send: wouldblock\n");
00994                     continue;
00995                 }
00996                 else
00997                 {
00998                     printf("send: error = %d\n", WSAGetLastError());
00999                     fRet = FALSE;
01000                     break;
01001                 }
01002
01003             }
01004
01005             sendleft   -= r;
01006             sendoffset += r;
01007
01008         } while(sendleft > 0);
01009
01010         if (fRet == FALSE)
01011             break;
01012
01013         printf("Sent %d bytes\n", sendoffset);
01014
01015         if ((fVerify) && (sendleft == 0))
01016         {
01017             CHAR buffer[BLOCKSIZE];
01018             int recvflag = 0;
01019             int rr, pos = 0;
01020
01021             //
01022             // Prime a Read here. This will enable the receive to complete
01023             // This is PAP specific. For other AppleTalk protocols -
01024             // ADSP and DDP a recv can be posted directly
01025             //
01026
01027             if(!_strnicmp(gProtocolName, "PAP", 3))
01028             {
01029                 rr = setsockopt(clntsock,
01030                         SOL_APPLETALK,
01031                         SO_PAP_PRIME_READ,
01032                         buffer,
01033                         sizeof(buffer));
01034
01035                 if (rr == SOCKET_ERROR)
01036                 {
01037                     printf("primeread: error = %d\n", WSAGetLastError());
01038                     fRet = FALSE;
01039                     break;
01040                 }
01041             }
01042
01043             recvleft   = sendoffset;
01044             recvoffset = 0;
01045             do
01046             {
01047
01048                 fRet = CheckForRecv(clntsock);
01049
01050                 if(fRet == FALSE)
01051                     break;
01052
01053                 recvflag = 0;
01054                 rr = WSARecvEx(clntsock, &buffer[recvoffset], recvleft, &recvflag);
01055
01056                 if( rr == SOCKET_ERROR)
01057                 {
01058                     if (WSAGetLastError() == WSAEWOULDBLOCK)
01059                         continue;
01060                     else
01061                     {
01062                         printf("recv: error = %d\n", WSAGetLastError());
01063                         fRet = FALSE;
01064                         break;
01065                     }
01066                 }
01067
01068                 recvoffset += rr;
01069                 recvleft   -= rr;
01070
01071                 printf("Recv'd %d bytes\n", rr);
01072
01073                 if ( (recvflag == 0) || (sockettype == SOCK_RDM) ||
01074                         (recvleft == 0)  )
01075                     break;
01076
01077             } while(recvleft > 0);
01078
01079
01080             if ((memcmp(memhandle, buffer, BLOCKSIZE) != 0) && (fRet != FALSE))
01081             {
01082                 printf("Strings do not compare\n");
01083 #ifdef DEBUG
01084                 //                       printf("Data sent: \n%s\n",memhandle);
01085                 //                       printf("Data recv'd: \n%s\n",buffer);
01086 #endif
01087
01088             }
01089
01090
01091         } // IF (fVerify)
01092
01093         BytesTransferred += sendoffset;
01094
01095
01096     } // FOR
01097
01098     GetLocalTime(&SystemEndTime);
01099
01100 #ifdef DEBUG
01101     printf("End Time:%d:%2d:%2d:%2d\t", SystemEndTime.wHour,
01102             SystemEndTime.wMinute,
01103             SystemEndTime.wSecond,
01104             SystemEndTime.wMilliseconds);
01105 #endif
01106
01107     //
01108     // calculate the difference
01109     //
01110
01111     hourdiff = SystemEndTime.wHour - SystemStartTime.wHour;
01112
01113     StartSecond = (SystemStartTime.wHour * 3600) +
01114         (SystemStartTime.wMinute * 60) +
01115         SystemStartTime.wSecond +
01116         (SystemStartTime.wMilliseconds * 0.001);
01117
01118     EndSecond = 0;
01119
01120     if(SystemEndTime.wMonth != SystemStartTime.wMonth)
01121     {
01122         EndSecond = (SystemEndTime.wDay * 24) * 3600;
01123         switch (SystemStartTime.wMonth)
01124         {
01125             case 1:
01126             case 3:
01127             case 5:
01128             case 7:
01129             case 8:
01130             case 10:
01131             case 12:
01132                 EndSecond = ((31 - SystemStartTime.wDay) * 24) + EndSecond;
01133                 break;
01134             case 4:
01135             case 6:
01136             case 9:
01137             case 11:
01138                 EndSecond = ((30 - SystemStartTime.wDay) * 24) + EndSecond;
01139                 break;
01140             case 2:
01141                 if((SystemStartTime.wYear % 400 == 0) ||
01142                         ((SystemStartTime.wYear % 4 == 0) &&
01143                          (SystemStartTime.wYear % 100 != 0)))
01144                     EndSecond = ((29 - SystemStartTime.wDay) *
01145                             24) + EndSecond;
01146                 else
01147                     EndSecond = ((28 - SystemStartTime.wDay) *
01148                             24) + EndSecond;
01149                 break;
01150         }
01151     }
01152     else
01153         if(SystemEndTime.wDay > SystemStartTime.wDay)
01154         {
01155             EndSecond = ((SystemEndTime.wDay - SystemStartTime.wDay) * 24) * 3600;
01156         }
01157
01158     EndSecond = EndSecond + (SystemEndTime.wHour * 3600) +
01159         (SystemEndTime.wMinute * 60) + SystemEndTime.wSecond +
01160         (SystemEndTime.wMilliseconds * 0.001);
01161
01162     ElapsedSeconds = EndSecond-StartSecond;
01163
01164 #ifdef DEBUG
01165     printf("Elapsed Time (secs) = %6.3f\n", ElapsedSeconds);
01166     printf("Bytes Transferred = %ld\n", BytesTransferred);
01167     printf("Send All Done\n");
01168 #endif
01169
01170
01171     if(ElapsedSeconds !=0)
01172     {
01173         Throughput = (BytesTransferred)/(ElapsedSeconds) ;
01174
01175 #ifdef DEBUG
01176         printf("Throughput (bytes/sec) = %6.2f\n", Throughput);
01177 #endif
01178
01179     }
01180
01181     printf("\n");
01182
01183     closesocket(clntsock);
01184
01185     HeapFree(GetProcessHeap(), 0, memhandle);
01186
01187     return(TRUE);
01188
01189 }
01190
01191 /******************************************************************************
01192
01193  Function - CheckForSend()
01194
01195  Comments - Calls select with the given socket handle to determine if it is
01196             writeable.
01197
01198 ******************************************************************************/
01199 BOOL CheckForSend(SOCKET s)
01200 {
01201
01202    fd_set writefds;
01203    int r;
01204
01205
01206 #ifdef DEBUG
01207    printf("\t\tChecking for Send..\n");
01208 #endif
01209
01210    FD_ZERO(&writefds);
01211    FD_SET(s, &writefds);
01212
01213    //
01214    // indefinite wait select
01215    //
01216    r = select(0, NULL, &writefds, NULL, NULL);
01217
01218    if (r != 1)
01219    {
01220        printf("select:error = %d\n", WSAGetLastError());
01221        return(FALSE);
01222    }
01223    return(TRUE);
01224 }
01225
01226 /******************************************************************************
01227
01228  Function - CheckForRecv()
01229
01230  Comments - Calls select with the given socket handle to determine if the socket
01231             is readable.
01232
01233 ******************************************************************************/
01234 BOOL CheckForRecv(SOCKET s)
01235 {
01236
01237    fd_set readfds;
01238    int r;
01239
01240    FD_ZERO(&readfds);
01241    FD_SET(s, &readfds);
01242
01243 #ifdef DEBUG
01244    printf("\t\tChecking for Recv..\n");
01245 #endif
01246
01247    r = select(0, &readfds, NULL, NULL, NULL);
01248
01249    if (r != 1)
01250    {
01251        printf("select:error = %d\n", WSAGetLastError());
01252        return(FALSE);
01253    }
01254    return(TRUE);
01255 }
01256
01257 void usage()
01258 {
01259
01260    printf("prperf -s/c <options>\n");
01261    printf("\t-s/c\t Server/Client\n");
01262    printf("\t-n\t Server Name\n");
01263    printf("\t-t\t Server Type \n");
01264    printf("\t-z\t Server Zone \n");
01265    printf("\t-p\t Protocol Name (ADSP/PAP)\n");
01266    printf("\t-b\t Number of times to send a 4k buffer (Default = 5) \n");
01267    printf("\t-l\t Number of times to re-start prperf (Default = 1) (Client only)\n");
01268    printf("\t-v\t Verify Integrity of data transmission. \n");
01269    printf("\t-y\t Change ADSP to use SOCK_RDM instead of SOCK_STREAM. \n");
01270    printf("\n");
01271    exit(1);
01272
01273 }
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/GSS/Gss-Misc.h Source File

  • Security
  • SSPI
  • GSS

Gss-Misc.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1994 by OpenVision Technologies, Inc.
00003  *
00004  * Permission to use, copy, modify, distribute, and sell this software
00005  * and its documentation for any purpose is hereby granted without fee,
00006  * provided that the above copyright notice appears in all copies and
00007  * that both that copyright notice and this permission notice appear in
00008  * supporting documentation, and that the name of OpenVision not be used
00009  * in advertising or publicity pertaining to distribution of the software
00010  * without specific, written prior permission. OpenVision makes no
00011  * representations about the suitability of this software for any
00012  * purpose.  It is provided "as is" without express or implied warranty.
00013  *
00014  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
00015  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
00016  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
00017  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
00018  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
00019  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00020  * PERFORMANCE OF THIS SOFTWARE.
00021  */
00022
00023 #ifndef _GSSMISC_H_
00024    #define _GSSMISC_H_
00025
00026    #ifdef UNICODE
00027       #undef UNICODE
00028    #endif
00029    #include <windows.h>
00030    #include <rpc.h>
00031    #include <stdio.h>
00032    #include <stdlib.h>
00033    #include <io.h>
00034    #include <fcntl.h>
00035    #include <winsock2.h>
00036    #define SECURITY_WIN32
00037    #include <security.h>
00038    #include <ntsecapi.h>
00039    #include "gssapi.h"
00040
00041    #define PROTOTYPE(_x_) _x_
00042 extern FILE *display_file;
00043
00044 int send_token
00045 PROTOTYPE( (int s, PSecBuffer tok) );
00046 int recv_token
00047 PROTOTYPE( (int s, PSecBuffer tok) );
00048 void display_status
00049 PROTOTYPE( (char *msg, ULONG maj_stat, ULONG min_stat) );
00050 void display_ctx_flags
00051 PROTOTYPE( (ULONG flags) );
00052 void print_token
00053 PROTOTYPE( (PSecBuffer tok) );
00054
00055 #endif
00056
00057 typedef struct
00058 {
00059
00060    PCHAR     name;
00061    OM_uint32 value;
00062    PCHAR     realname;
00063
00064 } FLAGMAPPING, *PFLAGMAPPING;
00065
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/people.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "People.h"
00021
00022 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00025 const GUID CSkateboardFolder::thisGuid = { 0xef163733, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00026 const GUID CIceSkateFolder::thisGuid = { 0xf6c660b0, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00027
00028 const GUID CBicycle::thisGuid = { 0xef163734, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00029 const GUID CSkateboard::thisGuid = { 0xef163735, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00030 const GUID CIceSkate::thisGuid = { 0xf6c660b1, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00031
00032
00033 //==============================================================
00034 //
00035 // CPeoplePoweredVehicle implementation
00036 //
00037 //
00038 CPeoplePoweredVehicle::CPeoplePoweredVehicle()
00039 {
00040     children[0] = new CBicycleFolder;
00041     children[1] = new CSkateboardFolder;
00042     children[2] = new CIceSkateFolder;
00043 }
00044
00045 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00046 {
00047     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00048         delete children[n];
00049 }
00050
00051 HRESULT CPeoplePoweredVehicle::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00052 {
00053     SCOPEDATAITEM sdi;
00054
00055     if (!bExpanded) {
00056         // create the child nodes, then expand them
00057         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00058             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00059             sdi.mask = SDI_STR       |   // Displayname is valid
00060                 SDI_PARAM     |   // lParam is valid
00061                 SDI_IMAGE     |   // nImage is valid
00062                 SDI_OPENIMAGE |   // nOpenImage is valid
00063                 SDI_PARENT    |   // relativeID is valid
00064                 SDI_CHILDREN;     // cChildren is valid
00065
00066             sdi.relativeID  = (HSCOPEITEM)parent;
00067             sdi.nImage      = children[n]->GetBitmapIndex();
00068             sdi.nOpenImage  = INDEX_OPENFOLDER;
00069             sdi.displayname = MMC_CALLBACK;
00070             sdi.lParam      = (LPARAM)children[n];       // The cookie
00071             sdi.cChildren   = 0;
00072
00073             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00074
00075             _ASSERT( SUCCEEDED(hr) );
00076
00077                     children[n]->SetHandle((HANDLE)sdi.ID);
00078         }
00079     }
00080
00081     return S_OK;
00082 }
00083
00084 CBicycleFolder::CBicycleFolder()
00085 {
00086     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00087         children[n] = new CBicycle(n + 1);
00088     }
00089 }
00090
00091 CBicycleFolder::~CBicycleFolder()
00092 {
00093     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00094         if (children[n]) {
00095             delete children[n];
00096         }
00097 }
00098
00099 HRESULT CBicycleFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00100 {
00101     HRESULT      hr = S_OK;
00102
00103     IHeaderCtrl *pHeaderCtrl = NULL;
00104     IResultData *pResultData = NULL;
00105
00106     if (bShow) {
00107         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00108         _ASSERT( SUCCEEDED(hr) );
00109
00110         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00111         _ASSERT( SUCCEEDED(hr) );
00112
00113         // Set the column headers in the results pane
00114         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00115         _ASSERT( S_OK == hr );
00116
00117         // insert items here
00118         RESULTDATAITEM rdi;
00119
00120         hr = pResultData->DeleteAllRsltItems();
00121         _ASSERT( SUCCEEDED(hr) );
00122
00123         if (!bExpanded) {
00124             // create the child nodes, then expand them
00125             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00126                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00127                 rdi.mask       = RDI_STR       |   // Displayname is valid
00128                     RDI_IMAGE     |
00129                     RDI_PARAM;        // nImage is valid
00130
00131                 rdi.nImage      = children[n]->GetBitmapIndex();
00132                 rdi.str         = MMC_CALLBACK;
00133                 rdi.nCol        = 0;
00134                 rdi.lParam      = (LPARAM)children[n];
00135
00136                 hr = pResultData->InsertItem( &rdi );
00137
00138                 _ASSERT( SUCCEEDED(hr) );
00139
00140                             children[n]->SetHandle((HANDLE)rdi.itemID);
00141             }
00142         }
00143
00144         pHeaderCtrl->Release();
00145         pResultData->Release();
00146     }
00147
00148     return hr;
00149 }
00150
00151 CIceSkateFolder::CIceSkateFolder()
00152 {
00153     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00154         children[n] = new CIceSkate(n + 1);
00155     }
00156 }
00157
00158 CIceSkateFolder::~CIceSkateFolder()
00159 {
00160     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00161         if (children[n]) {
00162             delete children[n];
00163         }
00164 }
00165
00166 HRESULT CIceSkateFolder::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00167 {
00168     *ppViewType = NULL;
00169     *pViewOptions = MMC_VIEW_OPTIONS_OWNERDATALIST;
00170
00171     return S_OK;
00172 }
00173
00174 void CIceSkateFolder::GetChildColumnInfo(RESULTDATAITEM *rdi)
00175 {
00176     if (rdi->mask & RDI_STR)
00177     {
00178         LPCTSTR pszT = children[rdi->nIndex]->GetDisplayName(rdi->nCol);
00179         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00180         rdi->str = pszW;
00181     }
00182
00183     if (rdi->mask & RDI_IMAGE)
00184         rdi->nImage = children[rdi->nIndex]->GetBitmapIndex();
00185 }
00186
00187 // CDelegationBase::AddImages sets up the collection of images to be displayed
00188 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00189 HRESULT CIceSkateFolder::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00190 {
00191     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00192         (long *)m_pBMapLg, // pointer to a handle
00193         0, // index of the first image in the strip
00194         RGB(0, 128, 128)  // color of the icon mask
00195         );
00196 }
00197
00198 HRESULT CIceSkateFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00199 {
00200     HRESULT      hr = S_OK;
00201
00202     IHeaderCtrl *pHeaderCtrl = NULL;
00203     IResultData *pResultData = NULL;
00204
00205     if (bShow) {
00206         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00207         _ASSERT( SUCCEEDED(hr) );
00208
00209         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00210         _ASSERT( SUCCEEDED(hr) );
00211
00212         // Set the column headers in the results pane
00213         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00214         _ASSERT( S_OK == hr );
00215
00216         hr = pResultData->DeleteAllRsltItems();
00217         _ASSERT( SUCCEEDED(hr) );
00218
00219         if (!bExpanded) {
00220             // create the child nodes, then expand them
00221             hr = pResultData->SetItemCount( NUMBER_OF_CHILDREN, 0 );
00222             _ASSERT( SUCCEEDED(hr) );
00223         }
00224
00225         pHeaderCtrl->Release();
00226         pResultData->Release();
00227     }
00228
00229     return hr;
00230 }
00231
00232 CSkateboardFolder::CSkateboardFolder()
00233 {
00234     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00235         children[n] = new CSkateboard(n + 1);
00236     }
00237 }
00238
00239 CSkateboardFolder::~CSkateboardFolder()
00240 {
00241     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00242         if (children[n]) {
00243             delete children[n];
00244         }
00245 }
00246
00247 HRESULT CSkateboardFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00248 {
00249     HRESULT      hr = S_OK;
00250
00251     IHeaderCtrl *pHeaderCtrl = NULL;
00252     IResultData *pResultData = NULL;
00253
00254     if (bShow) {
00255         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00256         _ASSERT( SUCCEEDED(hr) );
00257
00258         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00259         _ASSERT( SUCCEEDED(hr) );
00260
00261         // Set the column headers in the results pane
00262         hr = pHeaderCtrl->InsertColumn( 0, L"Name                      ", 0, MMCLV_AUTO );
00263         _ASSERT( S_OK == hr );
00264
00265         // insert items here
00266         RESULTDATAITEM rdi;
00267
00268         hr = pResultData->DeleteAllRsltItems();
00269         _ASSERT( SUCCEEDED(hr) );
00270
00271         if (!bExpanded) {
00272             // create the child nodes, then expand them
00273             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00274                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00275                 rdi.mask       = RDI_STR       |   // Displayname is valid
00276                     RDI_IMAGE     |
00277                     RDI_PARAM;        // nImage is valid
00278
00279                 rdi.nImage      = children[n]->GetBitmapIndex();
00280                 rdi.str         = MMC_CALLBACK;
00281                 rdi.nCol        = 0;
00282                 rdi.lParam      = (LPARAM)children[n];
00283
00284                 hr = pResultData->InsertItem( &rdi );
00285
00286                 _ASSERT( SUCCEEDED(hr) );
00287
00288                             children[n]->SetHandle((HANDLE)rdi.itemID);
00289             }
00290         }
00291
00292         pHeaderCtrl->Release();
00293         pResultData->Release();
00294     }
00295
00296     return hr;
00297 }
00298
00299 const _TCHAR *CBicycle::GetDisplayName(int nCol)
00300 {
00301     static _TCHAR buf[128];
00302
00303     _stprintf(buf, _T("Bicycle #%d"), id);
00304
00305     return buf;
00306 }
00307
00308 const _TCHAR *CSkateboard::GetDisplayName(int nCol)
00309 {
00310     static _TCHAR buf[128];
00311
00312     _stprintf(buf, _T("Skateboard #%d"), id);
00313
00314     return buf;
00315 }
00316
00317 const _TCHAR *CIceSkate::GetDisplayName(int nCol)
00318 {
00319     static _TCHAR buf[128];
00320
00321     _stprintf(buf, _T("Ice Skate #%d"), id);
00322
00323     return buf;
00324 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSnapinAbout Member List

This is the complete list of members for CSnapinAbout, including all inherited members.
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer) | CSnapinAbout | [private]
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
CSnapinAbout() | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *pszProvider) | CSnapinAbout |
GetProvider(LPOLESTR *pszProvider) | CSnapinAbout |
GetProvider(LPOLESTR *pszProvider) | CSnapinAbout |
GetProvider(LPOLESTR *pszProvider) | CSnapinAbout |
GetProvider(LPOLESTR *pszProvider) | CSnapinAbout |
GetProvider(LPOLESTR *pszProvider) | CSnapinAbout |
GetProvider(LPOLESTR *pszProvider) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetProvider(LPOLESTR *lpName) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *pszDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *pszDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *pszDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *pszDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *pszDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *pszDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *pszDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinDescription(LPOLESTR *lpDescription) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinImage(HICON *hAppIcon) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *pszVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *pszVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *pszVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *pszVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *pszVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *pszVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *pszVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetSnapinVersion(LPOLESTR *lpVersion) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hOpenImage, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hOpenImage, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hOpenImage, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hOpenImage, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hOpenImage, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hOpenImage, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hOpenImage, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
GetStaticFolderImage(HBITMAP *hSmallImage, HBITMAP *hSmallImageOpen, HBITMAP *hLargeImage, COLORREF *cMask) | CSnapinAbout |
m_cref | CSnapinAbout | [private]
m_cRef | CSnapinAbout | [private]
m_hAppIcon | CSnapinAbout | [private]
m_hLargeImage | CSnapinAbout | [private]
m_hOpenImage | CSnapinAbout | [private]
m_hSmallImage | CSnapinAbout | [private]
m_hSmallImageOpen | CSnapinAbout | [private]
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
QueryInterface(REFIID riid, LPVOID *ppv) | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
STDMETHODIMP_(ULONG) AddRef() | CSnapinAbout |
STDMETHODIMP_(ULONG) Release() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
~CSnapinAbout() | CSnapinAbout |
Generated on Wed Nov 13 2024 16:57:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/QosEvent/ChkQos.Cpp Source File

  • NetDS
  • GQos
  • QosEvent

ChkQos.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      chkqos.cpp
00010 //
00011 // Abstract:
00012 //      This file contains the functionality needed to determine whether or
00013 //      not data transfers can start on a QOS socket prior to receipt of
00014 //      an RSVP RESV message.
00015 //
00016 // Entry Points:
00017 //      ChkQosSend - This function fills in a QOS structure
00018 //
00019 // Author:
00020 //      Barry R. Butterklee
00021
00022 #include "qosevent.h"
00023
00024 // Abstract:
00025 //      Determine when to start sending data.  If not using QOS then start
00026 //      we should start sending data right away.  If we are requesting QOS then
00027 //      we should first see if traffic control is sufficent to handle the data
00028 //      transmission until we get a RESV.
00029 //
00030 //      Also note that the socket must be a QOS socket before we can use this
00031 //      ioctl, otherwise we would get WSAEINVAL.
00032 //
00033 //      Also note that on Win98, where this ioctl is not supported, WSAIoctl
00034 //      also returns WSAENINVAL.
00035 //
00036 BOOL ChkQosSend(
00037     SOCKET  sd
00038     )
00039 {
00040     int     nRet;
00041     DWORD   dwBytes;
00042     DWORD   inbuf = ALLOWED_TO_SEND_DATA;
00043     DWORD   outbuf;
00044     OSVERSIONINFO   verInfo = {0};
00045
00046     // first check for windows 98, and silently fail if it is.
00047     verInfo.dwOSVersionInfoSize = sizeof(verInfo);
00048   GetVersionEx(&verInfo);
00049   if (VER_PLATFORM_WIN32_NT != verInfo.dwPlatformId)
00050       return(TRUE);
00051
00052     nRet = WSAIoctl(sd, SIO_CHK_QOS,
00053                         (LPVOID)&inbuf, sizeof(inbuf),
00054                         (LPVOID)&outbuf, sizeof(outbuf),
00055                         &dwBytes, NULL, NULL);
00056
00057     if (SOCKET_ERROR == nRet)
00058     {
00059         printf("WSAIoctl:SIO_CHK_QOS %d\n", WSAGetLastError());
00060         return(FALSE);
00061     }
00062
00063     return((BOOL)outbuf);
00064 }
00065
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/RegExt.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

RegExt.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      RegExt.h
00007 //
00008 //  Implementation File:
00009 //      RegExt.cpp
00010 //
00011 //  Description:
00012 //      Definitions of routines for extension registration.
00013 //
00014 //  Author:
00015 //      <name> (<e-mail name>) Mmmm DD, 2003
00016 //
00017 //  Revision History:
00018 //
00019 //  Notes:
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #pragma once
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Global Function Declarations
00027 /////////////////////////////////////////////////////////////////////////////
00028
00029 //
00030 //  Registration routines.
00031 //
00032
00033 DWORD
00034 RegisterCluAdminClusterExtension(
00035       HCLUSTER      hClusterIn
00036     , const CLSID * pClsidIn
00037     );
00038
00039 DWORD
00040 RegisterCluAdminAllNodesExtension(
00041       HCLUSTER      hClusterIn
00042     , const CLSID * pClsidIn
00043     );
00044
00045 DWORD
00046 RegisterCluAdminAllGroupsExtension(
00047       HCLUSTER      hClusterIn
00048     , const CLSID * pClsidIn
00049     );
00050
00051 DWORD
00052 RegisterCluAdminAllResourcesExtension(
00053       HCLUSTER      hClusterIn
00054     , const CLSID * pClsidIn
00055     );
00056
00057 DWORD
00058 RegisterCluAdminAllResourceTypesExtension(
00059       HCLUSTER      hClusterIn
00060     , const CLSID * pClsidIn
00061     );
00062
00063 DWORD
00064 RegisterCluAdminAllNetworksExtension(
00065       HCLUSTER      hClusterIn
00066     , const CLSID * pClsidIn
00067     );
00068
00069 DWORD
00070 RegisterCluAdminAllNetInterfacesExtension(
00071       HCLUSTER      hClusterIn
00072     , const CLSID * pClsidIn
00073     );
00074
00075 DWORD
00076 RegisterCluAdminResourceTypeExtension(
00077       HCLUSTER      hClusterIn
00078     , LPCWSTR       pwszResourceTypeIn
00079     , const CLSID * pClsidIn
00080     );
00081
00082 //
00083 //  Unregistration routines.
00084 //
00085
00086 DWORD
00087 UnregisterCluAdminClusterExtension(
00088       HCLUSTER      hClusterIn
00089     , const CLSID * pClsidIn
00090     );
00091
00092 DWORD
00093 UnregisterCluAdminAllNodesExtension(
00094       HCLUSTER      hClusterIn
00095     , const CLSID * pClsidIn
00096     );
00097
00098 DWORD
00099 UnregisterCluAdminAllGroupsExtension(
00100       HCLUSTER      hClusterIn
00101     , const CLSID * pClsidIn
00102     );
00103
00104 DWORD
00105 UnregisterCluAdminAllResourcesExtension(
00106       HCLUSTER      hClusterIn
00107     , const CLSID * pClsidIn
00108     );
00109
00110 DWORD
00111 UnregisterCluAdminAllResourceTypesExtension(
00112       HCLUSTER      hClusterIn
00113     , const CLSID * pClsidIn
00114     );
00115
00116 DWORD
00117 UnregisterCluAdminAllNetworksExtension(
00118       HCLUSTER      hClusterIn
00119     , const CLSID * pClsidIn
00120     );
00121
00122 DWORD
00123 UnregisterCluAdminAllNetInterfacesExtension(
00124       HCLUSTER      hClusterIn
00125     , const CLSID * pClsidIn
00126     );
00127
00128 DWORD
00129 UnregisterCluAdminResourceTypeExtension(
00130        HCLUSTER      hClusterIn
00131      , LPCWSTR       pwszResourceTypeIn
00132      , const CLSID * pClsid
00133     );
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/OleImp/Util.h Source File

  • Com
  • Fundamentals
  • DCom
  • OleImp

Util.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 BOOL UtilAllocMem (PVOID *ppv, DWORD cb);
00019 void UtilFreeMem (PVOID pv);
00020 BOOL GetUserSidFromToken (HANDLE hToken, PSID *ppSid);
00021 BOOL GetGroupSidFromToken (HANDLE hToken, PSID *ppSid);
00022 BOOL CreateAppSecurityDescriptor(PSECURITY_DESCRIPTOR *ppsd);
00023 BOOL FreeAppSecurityDescriptor (PSECURITY_DESCRIPTOR psd);
00024 void ErrorMessage(HWND hwnd, LPCTSTR szFunction, HRESULT hr);
00025
00026 // EOF =======================================================================
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/UserEvents/VCAcct/CAccount.cpp Source File

  • Com
  • Services
  • Events
  • UserEvents
  • VCAcct

CAccount.cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 //
00003 // This file is part of the Microsoft COM+ Samples
00004 //
00005 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation.  See these other
00009 // materials for detailed information reagrding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 //==============================================================================
00017
00018 #include "stdafx.h"
00019 #include "Account.h"
00020 #include "CAccount.h"
00021 #include <stdio.h>
00022 #include <comsvcs.h>
00023 #include <adoid.h>
00024 #include <adoint.h>
00025 #include <comdef.h>
00026 #include <string>
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 //
00030
00031 STDMETHODIMP CAccount::InterfaceSupportsErrorInfo(REFIID riid)
00032 {
00033   static const IID* arr[] =
00034   {
00035     &IID_IAccount,
00036   };
00037
00038   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00039   {
00040     if (  *arr[i] == riid )
00041       return S_OK;
00042   }
00043   return S_FALSE;
00044 }
00045
00046 //F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++
00047 //
00048 // Function: Post
00049 //
00050 // Modifies the specified account by the specified amount
00051 //
00052 // Args:  lAcocunt: Account to particptae in bank transaction
00053 //      lAmount:  Amount of transaction
00054 //      pbstrResult: Return String contains new balance. NULL of error occurs
00055 //
00056 // Returns:  S_OK or E_FAIL
00057 //
00058 //F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-
00059 STDMETHODIMP CAccount::Post (IN long lAccount, IN long lAmount, OUT BSTR* pbstrResult)
00060 {
00061   if( pbstrResult == 0 )
00062   {
00063     return E_POINTER;
00064   }
00065
00066   HRESULT hr = S_OK;
00067
00068   *pbstrResult = NULL;
00069
00070   long lErrFlag = 0;
00071   TCHAR* pErrMsg = NULL;
00072
00073   // See if we have sufficient funds
00074   // We're ignoring the rollover case here.
00075   if( ( d_acctBalance + lAmount ) < 0 )
00076   {
00077     // Error checking code removed for brevity
00078     ICreateErrorInfo * pCreateErrorInfo = NULL;
00079     CreateErrorInfo( &pCreateErrorInfo );
00080     pCreateErrorInfo->SetDescription( OLESTR( "Insufficient funds to perform transaction" ) );
00081     pCreateErrorInfo->SetGUID( __uuidof( IAccount ) );
00082
00083     IErrorInfo* pErrorInfo = 0;
00084     pCreateErrorInfo->QueryInterface( IID_IErrorInfo, reinterpret_cast< void** >( &pErrorInfo ) );
00085
00086     SetErrorInfo(NULL, static_cast< IErrorInfo* >( pErrorInfo) );
00087     return E_FAIL;
00088   }
00089
00090   // Perform the transaction
00091   d_acctBalance += lAmount;
00092
00093   // Generate a transaction description
00094   // Let the compiler choose the correct string template
00095   // based on UNICODE settings.  ( don't use std::string or std::wstring )
00096   std::basic_string< TCHAR > description;
00097
00098   if( lAmount < 0 )
00099   {
00100     TCHAR txtBuffer[ 1024 ];
00101     wsprintf( txtBuffer
00102           , TEXT( "Debit from account %d, balance is $%d" )
00103           , lAccount
00104         , d_acctBalance );
00105
00106     description = txtBuffer;
00107   }
00108   else
00109   {
00110     TCHAR txtBuffer[ 1024 ];
00111     wsprintf( txtBuffer
00112           , TEXT( "Credit from account %d, balance is $%d" )
00113           , lAccount
00114         , d_acctBalance );
00115
00116     description = txtBuffer;
00117   }
00118
00119   description += " (VC++)";
00120   // Set up our out param and then we're done ( with the required stuff )
00121   *pbstrResult = SysAllocString( _bstr_t( description.c_str( ) ) );
00122
00123
00124   // Because everything went well, we want to notify interested clients
00125   // that a sucessful post occured.
00126   // We don't particularly care whether the event went out in this sample,
00127   // so we'll go as far as we can.  On error, we'll silently fail and
00128   // return success to the client ( because the POST was a success )
00129
00130   HRESULT eventHR;
00131
00132   IMTSLocator* mtsLocator = 0;
00133   eventHR = CoCreateInstance( CLSID_CoMTSLocator
00134                           , NULL
00135                 , CLSCTX_ALL
00136                 , __uuidof( IMTSLocator )
00137                 , reinterpret_cast< void** >( &mtsLocator ) );
00138
00139   if( SUCCEEDED( eventHR ) )
00140   {
00141     // In order to dispatch a User Event, we need to locate the object that
00142     // will do this for us.  The MTSLocator object does this.
00143     IUnknown* eventDispatcher = 0;
00144     eventHR = mtsLocator->GetEventDispatcher( &eventDispatcher );
00145
00146     if( SUCCEEDED( eventHR ) )
00147     {
00148       // We need to get the correct interface....
00149       IMtsEvents* mtsEvents = 0;
00150       eventHR = eventDispatcher->QueryInterface( __uuidof( IMtsEvents )
00151                                              , reinterpret_cast< void** >( &mtsEvents ) );
00152
00153       if( SUCCEEDED( eventHR ) )
00154       {
00155         // And now that we have it, we can publish on the UserEvents event.
00156         // it simply takes a variant, which makes it very flexable.  We'll
00157         // stuff a string in there.
00158         VARIANT param;
00159         param.vt = VT_BSTR;
00160         param.bstrVal = _bstr_t( description.c_str( ) );
00161         mtsEvents->PostEvent( &param );
00162
00163         mtsEvents->Release( );
00164         mtsEvents = 0;
00165       }
00166       eventDispatcher->Release( );
00167       eventDispatcher = 0;
00168     }
00169
00170     mtsLocator->Release( );
00171     eventDispatcher = 0;
00172   }
00173
00174   return S_OK;
00175 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ObjectStateEnum Member List

This is the complete list of members for msado15::ObjectStateEnum, including all inherited members.
adStateClosed | msado15::ObjectStateEnum | [static]
adStateConnecting | msado15::ObjectStateEnum | [static]
adStateExecuting | msado15::ObjectStateEnum | [static]
adStateFetching | msado15::ObjectStateEnum | [static]
adStateOpen | msado15::ObjectStateEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/mvmoney.h Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

mvmoney.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      mvmoney.h
00003   Summary:   Header for Move Money component
00004   Classes:   CMoveMoney
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "resource.h"       // main symbols
00023
00024
00025 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00026 Class:  CMoveMoney
00027 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00028
00029 class CMoveMoney :
00030   public CComDualImpl<IMoveMoney, &IID_IMoveMoney, &LIBID_ACCOUNT>,
00031   public CComDualImpl<IMoveMoneyOptions, &IID_IMoveMoney, &LIBID_ACCOUNT>,
00032   public ISupportErrorInfo,
00033   public CComObjectRoot,
00034   public CComCoClass<CMoveMoney,&CLSID_CMoveMoney>
00035 {
00036
00037 private:
00038
00039     DWORD m_clsctxAccount;
00040     BOOL m_bUseComPlus;
00041
00042 public:
00043   CMoveMoney()
00044   {
00045     m_clsctxAccount = CLSCTX_ALL;
00046     m_bUseComPlus = FALSE;
00047
00048   }
00049 BEGIN_COM_MAP(CMoveMoney)
00050   COM_INTERFACE_ENTRY2(IDispatch, IMoveMoney)
00051   COM_INTERFACE_ENTRY(IMoveMoney)
00052   COM_INTERFACE_ENTRY(IMoveMoneyOptions)
00053   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00054 END_COM_MAP()
00055
00056 DECLARE_GET_CONTROLLING_UNKNOWN()
00057 DECLARE_PROTECT_FINAL_CONSTRUCT( )
00058 HRESULT FinalConstruct()
00059 {
00060   return S_OK;
00061 }
00062
00063 DECLARE_REGISTRY_RESOURCEID(IDR_MoveMoney)
00064
00065 // ISupportsErrorInfo
00066   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00067
00068 // IMoveMoney
00069 public:
00070   STDMETHOD(Perform)(
00071     IN long lPrimeAccount,
00072     IN long lSecondAccount,
00073     IN long lAmount,
00074     IN long lTranType,
00075     OUT BSTR* pbstrResult);
00076
00077   STDMETHODIMP SetAccountClsctx(long clsctx)
00078   {
00079     m_clsctxAccount = clsctx;
00080     return S_OK;
00081   }
00082
00083   STDMETHODIMP UseComPlus()
00084   {
00085     m_bUseComPlus = TRUE;
00086     return S_OK;
00087   }
00088 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/persist.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

persist.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module PERSIST.CPP | IPersist interface implementation
00008 //
00009
00010 // Includes ------------------------------------------------------------------
00011
00012 #include "headers.h"
00013
00014
00015 // Code ----------------------------------------------------------------------
00016
00017 // CImpIPersist::GetClassID --------------------------------------------------
00018 //
00019 // @mfunc Get the CLSID of the DSO.
00020 //
00021 // @rdesc HRESULT
00022 //      @flag S_OK                  | The method succeeded.
00023 //      @flag E_FAIL                | Provider-specific error.
00024 //
00025 STDMETHODIMP CImpIPersist::GetClassID
00026 (
00027   CLSID *pClassID
00028 )
00029 {
00030     //
00031     // Check in-params and NULL out-params in case of error
00032     //
00033   if( !pClassID )
00034     return (E_FAIL);
00035
00036   memcpy(pClassID, &CLSID_SampProv, sizeof(CLSID));
00037   return (S_OK);
00038 }
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057
00058     // first things first, make sure that when MMC
00059     // asks if we do property sheets, that we actually
00060     // say "yes"
00061     else if (IsEqualIID(riid, IID_IExtendPropertySheet) ||
00062         IsEqualIID(riid, IID_IExtendPropertySheet2))
00063         *ppv = static_cast<IExtendPropertySheet2 *>(this);
00064
00065     if (*ppv)
00066     {
00067         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00068         return S_OK;
00069     }
00070
00071     return E_NOINTERFACE;
00072 }
00073
00074 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00075 {
00076     return InterlockedIncrement((LONG *)&m_cref);
00077 }
00078
00079 STDMETHODIMP_(ULONG) CComponentData::Release()
00080 {
00081     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00082     {
00083         // we need to decrement our object count in the DLL
00084         delete this;
00085         return 0;
00086     }
00087
00088     return m_cref;
00089 }
00090
00091 ///////////////////////////////
00092 // Interface IComponentData
00093 ///////////////////////////////
00094 HRESULT CComponentData::Initialize(
00095                                    /* [in] */ LPUNKNOWN pUnknown)
00096 {
00097     HRESULT      hr;
00098
00099     //
00100     // Get pointer to name space interface
00101     //
00102     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00103     _ASSERT( S_OK == hr );
00104
00105     //
00106     // Get pointer to console interface
00107     //
00108     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00109     _ASSERT( S_OK == hr );
00110
00111     IImageList *pImageList;
00112     m_ipConsole->QueryScopeImageList(&pImageList);
00113     _ASSERT( S_OK == hr );
00114
00115     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00116         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00117         0, // index of the first image in the strip
00118         RGB(0, 128, 128)  // color of the icon mask
00119         );
00120
00121     pImageList->Release();
00122
00123     return S_OK;
00124 }
00125
00126 HRESULT CComponentData::CreateComponent(
00127                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00128 {
00129     *ppComponent = NULL;
00130
00131     CComponent *pComponent = new CComponent(this);
00132
00133     if (NULL == pComponent)
00134         return E_OUTOFMEMORY;
00135
00136     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00137 }
00138
00139 HRESULT CComponentData::Notify(
00140                                /* [in] */ LPDATAOBJECT lpDataObject,
00141                                /* [in] */ MMC_NOTIFY_TYPE event,
00142                                /* [in] */ LPARAM arg,
00143                                /* [in] */ LPARAM param)
00144 {
00145     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00146
00147     HRESULT hr = S_FALSE;
00148
00149   //Get our data object. If it is NULL, we return with S_FALSE.
00150   //See implementation of GetOurDataObject() to see how to
00151   //handle special data objects.
00152   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00153   if (NULL == pDataObject)
00154     return S_FALSE;
00155
00156   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00157
00158     switch (event)
00159     {
00160     case MMCN_EXPAND:
00161         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00162         break;
00163     }
00164
00165     return hr;
00166 }
00167
00168 HRESULT CComponentData::Destroy( void)
00169 {
00170     // Free interfaces
00171     if (m_ipConsoleNameSpace) {
00172         m_ipConsoleNameSpace->Release();
00173         m_ipConsoleNameSpace = NULL;
00174     }
00175
00176     if (m_ipConsole) {
00177         m_ipConsole->Release();
00178         m_ipConsole = NULL;
00179     }
00180
00181     return S_OK;
00182 }
00183
00184 HRESULT CComponentData::QueryDataObject(
00185                                         /* [in] */ MMC_COOKIE cookie,
00186                                         /* [in] */ DATA_OBJECT_TYPES type,
00187                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00188 {
00189     CDataObject *pObj = NULL;
00190
00191     if (cookie == 0)
00192         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00193     else
00194         pObj = new CDataObject(cookie, type);
00195
00196     if (!pObj)
00197         return E_OUTOFMEMORY;
00198
00199     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00200
00201     return S_OK;
00202 }
00203
00204 HRESULT CComponentData::GetDisplayInfo(
00205                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00206 {
00207     HRESULT hr = S_FALSE;
00208
00209     // if they are asking for the SDI_STR we have one of those to give
00210     if (pScopeDataItem->lParam) {
00211         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00212         if (pScopeDataItem->mask & SDI_STR) {
00213                         LPCTSTR pszT = base->GetDisplayName();
00214                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00215             pScopeDataItem->displayname = pszW;
00216         }
00217
00218         if (pScopeDataItem->mask & SDI_IMAGE) {
00219             pScopeDataItem->nImage = base->GetBitmapIndex();
00220         }
00221     }
00222
00223     return hr;
00224 }
00225
00226 HRESULT CComponentData::CompareObjects(
00227                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00228                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00229 {
00230     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00231     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00232
00233     // compare the object pointers
00234     if (baseA->GetCookie() == baseB->GetCookie())
00235         return S_OK;
00236
00237     return S_FALSE;
00238 }
00239
00240 ///////////////////////////////////
00241 // Interface IExtendPropertySheet2
00242 ///////////////////////////////////
00243 HRESULT CComponentData::CreatePropertyPages(
00244                                             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00245                                             /* [in] */ LONG_PTR handle,
00246                                             /* [in] */ LPDATAOBJECT lpIDataObject)
00247 {
00248     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00249
00250     return base->CreatePropertyPages(lpProvider, handle);
00251 }
00252
00253 HRESULT CComponentData::QueryPagesFor(
00254                                       /* [in] */ LPDATAOBJECT lpDataObject)
00255 {
00256     CDelegationBase *base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00257
00258     return base->HasPropertySheets();
00259 }
00260
00261 HRESULT CComponentData::GetWatermarks(
00262                                       /* [in] */ LPDATAOBJECT lpIDataObject,
00263                                       /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00264                                       /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00265                                       /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00266                                       /* [out] */ BOOL __RPC_FAR *bStretch)
00267 {
00268     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00269
00270     return base->GetWatermarks(lphWatermark, lphHeader, lphPalette, bStretch);
00271 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CObjPool2Sub Member List

This is the complete list of members for CObjPool2Sub, including all inherited members.
CObjPool2Sub(CComSpy *pSpy) | CObjPool2Sub | [inline]
CObjPool2Sub() | CObjPool2Sub | [inline]
CSysLCESub() | CSysLCESub | [inline]
GetEventClass(LPGUID guid) | CObjPool2Sub | [inline, virtual]
GetEventType(EventEnum *e) | CObjPool2Sub | [inline, virtual]
GetInterface(IID *iid) | CObjPool2Sub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
OnObjPoolCreateDecision(COMSVCSEVENTINFO *pInfo, DWORD dwThreadsWaiting, DWORD dwAvail, DWORD dwCreated, DWORD dwMin, DWORD dwMax) | CObjPool2Sub | [inline]
OnObjPoolCreateObject(COMSVCSEVENTINFO *pInfo, REFGUID guidClass, DWORD dwObjsCreated, ULONG64 ObjectID) | CObjPool2Sub | [inline]
OnObjPoolCreatePool(COMSVCSEVENTINFO *pInfo, REFGUID guidClass, DWORD dwMin, DWORD dwMax, DWORD dwTimeout) | CObjPool2Sub | [inline]
OnObjPoolDestroyObject(COMSVCSEVENTINFO *pInfo, REFGUID guidClass, DWORD dwObjsCreated, ULONG64 ObjectID) | CObjPool2Sub | [inline]
OnObjPoolTimeout(COMSVCSEVENTINFO *pInfo, REFGUID guidActivity, REFGUID guidClass, DWORD dwTimeout) | CObjPool2Sub | [inline]
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:56:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/registry.h Source File

  • SysMgmt
  • MMC
  • Taskpads

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout,   // Class Id for About Class
00040                        const BOOL fSupportExtensions = FALSE);
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/util.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

util.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       util.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #ifndef _UTIL_H
00012 #define _UTIL_H
00013
00014 #define BYTE_OFFSET(base, offset) (((LPBYTE)base)+offset)
00015
00016 HRESULT SetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, LPCWSTR lpszVal, BOOL bPostCommit=FALSE);
00017 HRESULT GetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, CString& szVal);
00018
00019
00020
00021 HRESULT SetByteArrayAsOctetString(IADs* pIADs, LPCWSTR lpszAttr, BYTE* pByteArray, DWORD dwSize);
00022
00023 BOOL LoadFileAsByteArray(PWSTR pszPath, LPBYTE* ppByteArray, DWORD* pdwSize);
00024
00025
00026 ///////////////////////////////////////////////////////////////
00027 // CThumbNailPhotoHolder
00028
00029 class CThumbNailPhotoHolder
00030 {
00031 public:
00032   CThumbNailPhotoHolder()
00033   {
00034     m_hWndFileNameEdit = NULL;
00035     m_hWndPictureControl = NULL;
00036
00037     m_pPictureArray = NULL;
00038     m_dwPictureSize = 0x0;
00039   }
00040   ~CThumbNailPhotoHolder()
00041   {
00042     _Clear();
00043   }
00044
00045   // public interface
00046   void Initialize(HWND hWndFileNameEdit, HWND hWndPictureControl)
00047   {
00048     ASSERT(::IsWindow(hWndFileNameEdit));
00049     ASSERT(::IsWindow(hWndPictureControl));
00050
00051     m_hWndFileNameEdit = hWndFileNameEdit;
00052     m_hWndPictureControl = hWndPictureControl;
00053   }
00054
00055   HRESULT Read(IADs* pIADs);
00056   HRESULT Write(IADs* pIADs);
00057
00058   HRESULT Read(IDirectoryObject* pDirObj);
00059   HRESULT Write(IDirectoryObject* pDirObj);
00060
00061   BOOL Change(HWND hWndOwner);
00062   BOOL Clear();
00063
00064
00065 private:
00066
00067   // helper functions
00068   void _Clear()
00069   {
00070     if (m_pPictureArray != NULL)
00071     {
00072       ASSERT(m_dwPictureSize != NULL);
00073       delete m_pPictureArray;
00074       m_pPictureArray = NULL;
00075       m_dwPictureSize = 0x0;
00076     }
00077   }
00078   void _SetPictureControl(HBITMAP hBitmap)
00079   {
00080     ::SendMessage(m_hWndPictureControl, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)(HANDLE)hBitmap);
00081     if (hBitmap != NULL)
00082       return;
00083     ::ShowWindow(m_hWndPictureControl, FALSE);
00084     ::ShowWindow(m_hWndPictureControl, TRUE);
00085   }
00086
00087   BOOL _DisplayPicture(LPCWSTR lpszPath);
00088
00089   void _WriteHelper(HRESULT hr);
00090
00091   // member variables
00092   HWND m_hWndFileNameEdit;
00093   HWND m_hWndPictureControl;
00094
00095   BYTE*                     m_pPictureArray;
00096   DWORD                     m_dwPictureSize;
00097 };
00098
00099
00100
00101
00102
00103 #endif // _UTIL_H
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/LogFont.h Source File

  • WinUI
  • CommDlg
  • CDTest

LogFont.h

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 #define ID_LFHEIGHT                 115
00007 #define ID_LFWIDTH                  116
00008 #define ID_LFESCAPEMENT             117
00009 #define ID_LFORIENTATION            118
00010 #define ID_LFWEIGHT                 119
00011 #define ID_LFITALIC                 120
00012 #define ID_LFUNDERLINE              121
00013 #define ID_LFSTRIKEOUT              122
00014 #define ID_LFCHARSET                123
00015 #define ID_LFOUTP                   124
00016 #define ID_LFCLIPP                  125
00017 #define ID_LFQUALITY                126
00018 #define ID_LFPITCHANDFAM            127
00019 #define ID_LFFACENAME               128
00020
00021 #define ID_LOGFONTDIALOG            608
00022 #define ID_RESETLF                  129
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/DimmerService.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step2

DimmerService.h

Go to the documentation of this file.
00001 // DimmerService.h : Declaration of the CDimmerService
00002
00003 #ifndef __DIMMERSERVICE_H_
00004 #define __DIMMERSERVICE_H_
00005
00006 #include "resource.h"       // main symbols
00007 #import "C:\UPnPSample\SDKDimmer\DimmerDevice\StepByStep\Step2\Debug\upnphost.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
00008
00009 /////////////////////////////////////////////////////////////////////////////
00010 // CDimmerService
00011 class ATL_NO_VTABLE CDimmerService :
00012   public CComObjectRootEx<CComMultiThreadModel>,
00013   public CComCoClass<CDimmerService, &CLSID_DimmerService>,
00014   public IDispatchImpl<IDimmerService, &IID_IDimmerService, &LIBID_MYDEVICELib>,
00015   public IUPnPEventSource
00016 {
00017 public:
00018   CDimmerService()
00019   {
00020   }
00021
00022 DECLARE_REGISTRY_RESOURCEID(IDR_DIMMERSERVICE)
00023
00024 DECLARE_PROTECT_FINAL_CONSTRUCT()
00025
00026 BEGIN_COM_MAP(CDimmerService)
00027   COM_INTERFACE_ENTRY(IDimmerService)
00028   COM_INTERFACE_ENTRY(IDispatch)
00029   COM_INTERFACE_ENTRY(IUPnPEventSource)
00030 END_COM_MAP()
00031
00032 // IDimmerService
00033 public:
00034 // IUPnPEventSource
00035   STDMETHOD(Advise)(IUPnPEventSink * pesSubscriber)
00036   {
00037     return E_NOTIMPL;
00038   }
00039   STDMETHOD(Unadvise)(IUPnPEventSink * pesSubscriber)
00040   {
00041     return E_NOTIMPL;
00042   }
00043 };
00044
00045 #endif //__DIMMERSERVICE_H_
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_DRVLINECONFIG Member List

This is the complete list of members for _DRVLINECONFIG, including all inherited members.
szCommands | _DRVLINECONFIG
szPort | _DRVLINECONFIG
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFullServ Member List

This is the complete list of members for CFullServ, including all inherited members.
CFullServ() | CFullServ | [inline]
CreateCall(REFIID riid1, IUnknown *pUnk, REFIID riid2, IUnknown **ppObj) | CFullServ |
Sum(int i, int j, int *sum) | CFullServ |
Work(int i, int j, int *sum) | CFullServ |
Generated on Wed Nov 13 2024 16:56:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CS3Dialog Member List

This is the complete list of members for CS3Dialog, including all inherited members.
CDialogBase(HWND hWnd, HINSTANCE hInst) | CDialogBase |
Connect(CDataSource *pCDataSource=NULL) | CS3Dialog | [virtual]
CS3Dialog(HWND hWnd, HINSTANCE hInst, CTableCopy *pTableCopy) | CS3Dialog |
Destroy() | CDialogBase | [virtual]
Display() | CS3Dialog | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CS3Dialog | [static]
EnableTable() | CS3Dialog | [virtual]
InitControls() | CS3Dialog | [virtual]
m_hInst | CDialogBase |
m_hWnd | CDialogBase |
m_pCTableCopy | CS3Dialog |
RefreshControls() | CS3Dialog | [virtual]
~CDialogBase() | CDialogBase | [virtual]
~CS3Dialog() | CS3Dialog | [virtual]
Generated on Wed Nov 13 2024 16:57:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/EdGlyphs.cpp Source File

  • Web
  • Browser
  • EditGlyphs

EdGlyphs.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2000 Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // EdGlyphs.cpp : Implementation of WinMain
00006
00007 // Note: Proxy/Stub Information
00008 // To build a separate proxy/stub DLL,
00009 // run nmake -f EdGlyphsps.mk in the project directory.
00010
00011 #include "stdafx.h"
00012 #include "resource.h"
00013 #include <initguid.h>
00014 #include "EdGlyphs.h"
00015
00016 #include "EdGlyphs_i.c"
00017 #include "BrowserHost.h"
00018
00019 const DWORD dwTimeOut = 5000; // time for EXE to be idle before shutting down
00020 const DWORD dwPause = 1000; // time to wait for threads to finish up
00021
00022 // Passed to CreateThread to monitor the shutdown event
00023 static DWORD WINAPI MonitorProc(void* pv)
00024 {
00025   CExeModule* p = (CExeModule*)pv;
00026   p->MonitorShutdown();
00027   return 0;
00028 }
00029
00030 LONG CExeModule::Unlock()
00031 {
00032   LONG l = CComModule::Unlock();
00033   if (l == 0)
00034   {
00035     bActivity = true;
00036     SetEvent(hEventShutdown); // tell monitor that we transitioned to zero
00037   }
00038   return l;
00039 }
00040
00041 //Monitors the shutdown event
00042 void CExeModule::MonitorShutdown()
00043 {
00044   while (1)
00045   {
00046     WaitForSingleObject(hEventShutdown, INFINITE);
00047     DWORD dwWait=0;
00048     do
00049     {
00050       bActivity = false;
00051       dwWait = WaitForSingleObject(hEventShutdown, dwTimeOut);
00052     } while (dwWait == WAIT_OBJECT_0);
00053
00054     // timed out
00055     if (!bActivity && m_nLockCnt == 0) // if no activity let's really bail
00056     {
00057 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
00058       CoSuspendClassObjects();
00059       if (!bActivity && m_nLockCnt == 0)
00060 #endif
00061         break;
00062     }
00063   }
00064
00065   CloseHandle(hEventShutdown);
00066   PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
00067 }
00068
00069 bool CExeModule::StartMonitor()
00070 {
00071   // CODE REVIEW: Add following security comment.
00072   /* The following use of CreateEvent is simplified for illustrative
00073   purposes. This simplified use in production code can expose a
00074   security risk in some situations. The first parameter might require
00075   specific security attributes. */
00076   hEventShutdown = CreateEvent(NULL, false, false, NULL);
00077   if (hEventShutdown == NULL)
00078     return false;
00079   DWORD dwThreadID;
00080   HANDLE h = CreateThread(NULL, 0, MonitorProc, this, 0, &dwThreadID);
00081   return (h != NULL);
00082 }
00083
00084 CExeModule _Module;
00085
00086 BEGIN_OBJECT_MAP(ObjectMap)
00087   OBJECT_ENTRY(CLSID_BrowserHost, CBrowserHost)
00088 END_OBJECT_MAP()
00089
00090
00091 LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)
00092 {
00093   while (p1 != NULL && *p1 != NULL)
00094   {
00095     LPCTSTR p = p2;
00096     while (p != NULL && *p != NULL)
00097     {
00098       if (*p1 == *p)
00099         return CharNext(p1);
00100
00101       p = CharNext(p);
00102     }
00103
00104     p1 = CharNext(p1);
00105   }
00106   return NULL;
00107 }
00108
00109 /////////////////////////////////////////////////////////////////////////////
00110 //
00111 extern "C" int WINAPI _tWinMain(HINSTANCE hInstance,
00112                 HINSTANCE /*hPrevInstance*/,
00113                 LPTSTR lpCmdLine,
00114                 int /*nShowCmd*/)
00115 {
00116   lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
00117
00118 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
00119   HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00120 #else
00121   HRESULT hRes = CoInitialize(NULL);
00122 #endif
00123
00124   _ASSERTE(SUCCEEDED(hRes));
00125   _Module.Init(ObjectMap, hInstance, &LIBID_EDGLYPHSLib);
00126   _Module.dwThreadID = GetCurrentThreadId();
00127   TCHAR szTokens[] = _T("-/");
00128
00129   HRESULT hr = E_FAIL;
00130   BOOL bRun = TRUE;
00131   LPCTSTR lpszToken = FindOneOf(lpCmdLine, szTokens);
00132   while (lpszToken != NULL)
00133   {
00134     if (lstrcmpi(lpszToken, _T("UnregServer"))==0)
00135     {
00136       _Module.UpdateRegistryFromResource(IDR_EdGlyphs, FALSE);
00137       hr = _Module.UnregisterServer(TRUE);
00138       bRun = FALSE;
00139       //if (SUCCEEDED(hr)) MessageBox(NULL, _T("Unregistration Successful"), NULL, NULL);
00140       break;
00141     }
00142
00143     if (lstrcmpi(lpszToken, _T("RegServer"))==0)
00144     {
00145       _Module.UpdateRegistryFromResource(IDR_EdGlyphs, TRUE);
00146       hr = _Module.RegisterServer(TRUE);
00147       bRun = FALSE;
00148       //if (SUCCEEDED(hr)) MessageBox(NULL, _T("Registration Successful"), NULL, NULL);
00149       break;
00150     }
00151
00152     lpszToken = FindOneOf(lpszToken, szTokens);
00153   }
00154
00155   if (bRun)
00156   {
00157     _Module.StartMonitor();
00158
00159 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
00160     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
00161                       REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
00162     _ASSERTE(SUCCEEDED(hRes));
00163     hRes = CoResumeClassObjects();
00164 #else
00165     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
00166                       REGCLS_MULTIPLEUSE);
00167 #endif
00168
00169     _ASSERTE(SUCCEEDED(hRes));
00170
00171     // Create the Browser Window
00172     CComPtr<IBrowserHost> pApp;
00173     CoCreateInstance(CLSID_BrowserHost,
00174              NULL,
00175              CLSCTX_INPROC_SERVER,
00176              IID_IBrowserHost,
00177              (void**)&pApp);
00178     if (pApp)
00179     {
00180       pApp->Run();
00181
00182       long hwnd;
00183       HWND hwndApp;
00184       pApp->GetHwnd(&hwnd);
00185       hwndApp = (HWND)hwnd;
00186
00187       MSG msg;
00188       while (GetMessage(&msg, 0, 0, 0))
00189       {
00190         // Avoid the beep when in the combo box
00191         if (msg.wParam != VK_RETURN && msg.wParam != VK_TAB)
00192           TranslateMessage(&msg);
00193
00194         // If we get a keydown message, we must send the message
00195         // to the container window so that the message can be routed to
00196         // the correct window.  This is necessary so that the container
00197         // window can call TranslateAccelerator on the in-place active
00198         // object and so that VK_RETURN and VK_TAB messages received from
00199         // the combobox in the toolbar will be processed correctly.
00200         if (msg.message == WM_KEYDOWN)
00201           SendMessage(hwndApp, msg.message, msg.wParam, msg.lParam);
00202
00203         DispatchMessage(&msg);
00204       }
00205
00206       _Module.RevokeClassObjects();
00207       Sleep(dwPause); //wait for any threads to finish
00208     }
00209   }
00210
00211   _Module.Term();
00212   CoUninitialize();
00213   return hr;
00214 }
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMD_ARGS Member List

This is the complete list of members for CMD_ARGS, including all inherited members.
dwAddress | CMD_ARGS
dwBPType | CMD_ARGS
Generated on Wed Nov 13 2024 16:56:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/LSP/instlsp.cpp Source File

  • NetDS
  • WinSock
  • LSP

instlsp.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: instlsp.cpp
00009 //
00010 // Description:
00011 //
00012 //    This sample illustrates how to develop a layered service provider.
00013 //    This LSP is simply a pass through sample which counts the bytes transfered
00014 //    on each socket.
00015 //
00016 //    This file contains an installation program to insert the layered sample
00017 //    into the Winsock catalog of providers.
00018 //
00019 //
00020 // Compile:
00021 //
00022 //    Compile with the Makefile:
00023 //      nmake /f Makefile
00024 //
00025 // Execute:
00026 //
00027 //    This project produces a executable file instlsp.exe. The installation app
00028 //    allows you to install the LSP over any provider. Note however that if you
00029 //    choose to install over a single provider, you should install over all
00030 //    providers of that address family (e.g. if you install over UDP, install
00031 //    over TCP and RAW providers as well). The arguments are:
00032 //
00033 //       -a             Install over all providers
00034 //       -c Catalog     Indicates which catalog to operate on (for Win64)
00035 //       -f             Remove all layered providers (last ditch recovery)
00036 //       -i             Install the LSP
00037 //       -l             Print the layered entries only
00038 //       -m             Displays a logical, ordered map of the LSPs installed
00039 //       -n "String"    Name of the layered provider (catalog name, not dll name)
00040 //       -o  CatID      Layer over the given provider (indicated by the catalog id)
00041 //       -p             Print the Winsock catalog (and catalog ids)
00042 //       -r  CatID      Remove the LSP
00043 //
00044 //    For example, first print out the catalog:
00045 //       instlsp.exe -p
00046 //        1001 - MSAFD ATM AAL5
00047 //        1002 - MSAFD Tcpip [TCP/IP]
00048 //        1003 - MSAFD Tcpip [UDP/IP]
00049 //        1004 - MSAFD Tcpip [RAW/IP]
00050 //        1005 - RSVP UDP Service Provider
00051 //        1006 - RSVP TCP Service Provider
00052 //        1019 - MSAFD AppleTalk [ADSP]
00053 //        1020 - MSAFD AppleTalk [ADSP] [Pseudo Stream]
00054 //        1021 - MSAFD AppleTalk [PAP]
00055 //        1022 - MSAFD AppleTalk [RTMP]
00056 //        1023 - MSAFD AppleTalk [ZIP]
00057 //
00058 //    To install over AppleTalk
00059 //       instlsp.exe -i -o 1019 -o 1020 -o 1021 -o 1022 -o 1023 -n "Foobar LSP"
00060 //
00061 //    Print the new catalog out:
00062 //       instlsp.exe -p
00063 //        1041 - Foobar LSP over [MSAFD AppleTalk [ADSP]]
00064 //        1042 - Foobar LSP over [MSAFD AppleTalk [PAP]]
00065 //        1043 - Foobar LSP over [MSAFD AppleTalk [RTMP]]
00066 //        1044 - Foobar LSP over [MSAFD AppleTalk [ZIP]]
00067 //        1001 - MSAFD ATM AAL5
00068 //        1002 - MSAFD Tcpip [TCP/IP]
00069 //        1003 - MSAFD Tcpip [UDP/IP]
00070 //        1004 - MSAFD Tcpip [RAW/IP]
00071 //        1005 - RSVP UDP Service Provider
00072 //        1006 - RSVP TCP Service Provider
00073 //        1019 - MSAFD AppleTalk [ADSP]
00074 //        1020 - MSAFD AppleTalk [ADSP] [Pseudo Stream]
00075 //        1021 - MSAFD AppleTalk [PAP]
00076 //        1022 - MSAFD AppleTalk [RTMP]
00077 //        1023 - MSAFD AppleTalk [ZIP]
00078 //        1040 - Foobar LSP
00079 //
00080 //    To remove the LSP, supply the catalog ID of the hidden entry to remove:
00081 //       instlsp.exe -r 1040
00082 //
00083 //    In case all else fails (removes all LSPs installed):
00084 //       instlsp.exe -f
00085 //
00086 #include <winsock2.h>
00087 #include <ws2spi.h>
00088 #include <objbase.h>
00089
00090 #include <rpc.h>
00091 #include <rpcdce.h>
00092
00093 #include <sporder.h>
00094 #include <winnt.h>
00095 #include <windows.h>
00096
00097 #include "install.h"
00098
00099 #include <stdio.h>
00100 #include <stdlib.h>
00101
00102 #define DEFAULT_PATH_LEN        128
00103 #define MAX_PROVIDERS           256
00104
00105 #define DEFAULT_LSP_NAME        "Test LSP"
00106
00107 #define MAX(a,b)                ( (a) > (b) ? (a) : (b) )
00108 #define MIN(a,b)                ( (a) < (b) ? (a) : (b) )
00109
00110 // This structure is used to create the logical ordered LSP mappings
00111 typedef struct _LSP_ENTRY
00112 {
00113     WCHAR               wszLspDll[MAX_PATH];    // LSPs DLL name (and possible path)
00114     WSAPROTOCOL_INFOW   DummyEntry;             // Provider entry for dummy LSP entry
00115
00116     WSAPROTOCOL_INFOW  *LayeredEntries;         // All layered providers beloging to LSP
00117     int                 Count;                  // Number of layered providers
00118
00119     GUID               *LayeredGuids;           // List of GUIDs the LAYERED providers
00120                                                 //  are installed under (doesn't include
00121                                                 //  the GUID the dummy entry is installed
00122                                                 //  under)
00123     int                 LayeredGuidCount;       // Number of GUIDs in the array
00124
00125     int                 MaxChainLength;         // Used for sorting: the longest protocol
00126                                                 //  chain of all the layered providers
00127     int                 LspOrder;               // Used for sorting: the lowest position
00128                                                 //  within a layered entries protocol
00129                                                 //  chain that a base provider sits
00130 } LSP_ENTRY;
00131
00132 //
00133 // Global variable: Function pointer to WSCUpdateProvider if on Windows XP or greater.
00134 //                  Uninstalling an LSP when other LSPs are layered over it is really
00135 //                  difficult; however on Windows XP and greater the WSCUpdateProvider
00136 //                  function makes this dirt simple. On older platforms its a real
00137 //                  pain.
00138 LPWSCUPDATEPROVIDER  fnWscUpdateProvider=NULL;
00139 HMODULE              hModule=NULL;
00140
00141 //
00142 // Function prototypes
00143 //
00144
00145 // Display usage information
00146 void
00147 usage(
00148     char *progname
00149     );
00150
00151 // Enumerate the catalog and print it
00152 void
00153 PrintProviders(
00154     WINSOCK_CATALOG Catalog,
00155     BOOL bLayeredOnly,
00156     BOOL bVerbose
00157     );
00158
00159 // Install the array of providers with the given GUID and LSP path
00160 int
00161 InstallProvider(
00162     WINSOCK_CATALOG Catalog,
00163     GUID *Guid,
00164     WCHAR *lpwszLspPath,
00165     WSAPROTOCOL_INFOW *pProvider,
00166     INT iProviderCount
00167     );
00168
00169 // Remove all providers associated with the given GUID
00170 int
00171 DeinstallProvider(
00172     WINSOCK_CATALOG Catalog,
00173     GUID *Guid
00174     );
00175
00176 // Reorder the Winsock catalog with 'dwLayeredId' providers appearing first
00177 int
00178 ReorderCatalog(
00179     WINSOCK_CATALOG Catalog,
00180     DWORD dwLayeredId
00181     );
00182
00183 // Determines whether the given ID occurs in the protocol chain
00184 BOOL
00185 IsIdInChain(
00186     WSAPROTOCOL_INFOW *pinfo,
00187     DWORD Id
00188     );
00189
00190 // Searches the catalog for all providers referencing ProviderId and removes them
00191 int
00192 RemoveProvider(
00193     WINSOCK_CATALOG Catalog,
00194     DWORD ProviderId
00195     );
00196
00197 // Remove all LSP entries
00198 int
00199 RemoveAllLayeredEntries(
00200     WINSOCK_CATALOG Catalog
00201     );
00202
00203 // Create the provider structure for the dummy (hidden) LSP entry
00204 WSAPROTOCOL_INFOW *
00205 CreateDummyEntry(
00206     WINSOCK_CATALOG Catalog,
00207     INT CatalogId,
00208     WCHAR *lpwszLspName
00209     );
00210
00211 // Create the provider structures for the layered protocol LSP entries
00212 WSAPROTOCOL_INFOW *
00213 CreateLayeredEntries(
00214     WINSOCK_CATALOG Catalog,
00215     WCHAR *lpwszLspName,
00216     GUID *Guid,
00217     DWORD *pdwIdArray,
00218     INT iIdArrayCount,
00219     DWORD *LayeredId
00220     );
00221
00222 // Reorders both catalogs so providers referencing dwLayerId are first
00223 DWORD *
00224 ReorderACatalog(
00225     WINSOCK_CATALOG Catalog,
00226     DWORD   dwLayerId,
00227     INT   *dwEntryCount
00228     );
00229
00230 // Returns a logical, ordered mapping of the LSPs installed
00231 LSP_ENTRY *
00232 BuildLspMap(
00233     WSAPROTOCOL_INFOW *pProviders,
00234     int  iProviderCount,
00235     int *pLspCount
00236     );
00237
00238 // Counts how many providers of the given type are present
00239 int
00240 GetProviderCount(
00241     WSAPROTOCOL_INFOW *pProviders,
00242     int iProviderCount,
00243     int ProviderType
00244     );
00245
00246 // Prints the LSP map to the console
00247 void
00248 PrintLspMap(
00249     LSP_ENTRY *pLspMap,
00250     int iLspCount
00251     );
00252
00253 // Frees all memory allocated in an LSP map
00254 void
00255 FreeLspMap(
00256     LSP_ENTRY *pLspMap,
00257     int iLspCount
00258     );
00259
00260 // Removes all references to catalog IDs beloging to a removed LSP from the LSP map
00261 void
00262 PruneLspMap(
00263     LSP_ENTRY *pLspMap,
00264     int iLspCount,
00265     DWORD *pdwRemovedProviders,
00266     int iRemoveCount
00267     );
00268
00269 // Replaces all references to an catalog ID with the new ID in the LSP map
00270 void
00271 UpdateLspMap(
00272     LSP_ENTRY *pLspMap,
00273     int iLspCount,
00274     DWORD dwOldValue,
00275     DWORD dwNewValue,
00276     DWORD *pdwCatalogOrder,
00277     int iProviderCount
00278     );
00279
00280 // Returns an array of all provider structures installed under the given GUID
00281 WSAPROTOCOL_INFOW *
00282 GetLayeredEntriesByGuid(
00283     WSAPROTOCOL_INFOW *pEntries,
00284     int iEntryCount,
00285     GUID *MatchGuid,
00286     int *iLayeredCount
00287     );
00288
00289 // Maps newly reinstalled providers back to the old provider structure
00290 void
00291 MapNewEntriesToOld(
00292     LSP_ENTRY *pEntry,
00293     WSAPROTOCOL_INFOW *pProvider,
00294     int iProviderCount
00295     );
00296
00297 // Compares whether two provider structures are equal (except for name and catalog ID)
00298 BOOL
00299 IsEqualProtocolEntries(
00300     WSAPROTOCOL_INFOW *pInfo1,
00301     WSAPROTOCOL_INFOW *pInfo2
00302     );
00303
00304 //
00305 // Function: main
00306 //
00307 // Description:
00308 //    Parse the command line arguments and call either the install or remove
00309 //    routine.
00310 //
00311 int _cdecl main(int argc, char *argv[])
00312 {
00313     WSADATA             wsd;
00314     LPWSAPROTOCOL_INFOW pProtocolInfo   = NULL,
00315                         pDummyEntry     = NULL,
00316                         pLayeredEntries = NULL;
00317     WINSOCK_CATALOG     eCatalog        = LspCatalog32Only;
00318     INT                 iTotalProtocols = 0;
00319     DWORD               pdwCatalogIdArray[MAX_PROVIDERS],
00320                         dwCatalogIdArrayCount = 0,       // How many to install over
00321                         dwRemoveCatalogId;
00322     BOOL                bInstall                   = TRUE,
00323                         bInstallOverAll            = FALSE,
00324                         bRemoveAllLayeredEntries   = FALSE,
00325                         bPrintProviders            = FALSE,
00326                         bDisplayOnlyLayeredEntries = FALSE,
00327                         bVerbose                   = FALSE,
00328                         bMapLsp                    = FALSE;
00329     WCHAR               wszLspName[WSAPROTOCOL_LEN];
00330     char               *lpszLspName=NULL;
00331     int                 rc, i;
00332     LSP_ENTRY          *pLspMap=NULL;
00333     int                 iLspCount=0;
00334
00335     // Load Winsock
00336     if (WSAStartup(MAKEWORD(2,2), &wsd) != 0)
00337     {
00338         fprintf(stderr, "Unable to load Winsock: %d\n", GetLastError());
00339         return -1;
00340     }
00341
00342     // Parse the command line
00343     for(i=1; i < argc ;i++)
00344     {
00345         if ( (strlen(argv[i]) != 2) && (argv[i][0] != '-') && (argv[i][0] != '/') )
00346         {
00347             usage(argv[0]);
00348         }
00349         switch (tolower(argv[i][1]))
00350         {
00351             case 'a':               // Install LSP over all currently installed providers
00352                 bInstallOverAll = TRUE;
00353                 break;
00354             case 'c':               // For 64-bit: which catalog to operate on?
00355                 if (i+1 >= argc)
00356                     usage(argv[0]);
00357                 switch (tolower(argv[i+1][0]))
00358                 {
00359                     case 'b':       // Both Winsock catalogs
00360                         eCatalog = LspCatalogBoth;
00361                         break;
00362                     case '6':       // 64-bit Winsock catalog only
00363                         eCatalog = LspCatalog64Only;
00364                         break;
00365                     case '3':       // 32-bit Winsock catalog only
00366                         eCatalog = LspCatalog32Only;
00367                         break;
00368                     default:
00369                         usage(argv[0]);
00370                         break;
00371                 }
00372                 i++;
00373                 break;
00374             case 'f':               // Uninstall all layered providers
00375                 bRemoveAllLayeredEntries = TRUE;
00376                 bInstall = FALSE;
00377                 break;
00378             case 'i':               // install
00379                 bInstall = TRUE;
00380                 break;
00381             case 'l':               // print the layered providers only
00382                 bPrintProviders = TRUE;
00383                 bDisplayOnlyLayeredEntries = TRUE;
00384                 break;
00385             case 'm':               // Map and print the LSP structure
00386                 bMapLsp = TRUE;
00387                 bInstall = FALSE;
00388                 break;
00389             case 'n':               // name of the LSP to install (not the DLL name)
00390                 if (i+1 >= argc)
00391                     usage(argv[0]);
00392                 lpszLspName = argv[++i];
00393                 break;
00394             case 'o':               // catalog id (to install over)
00395                 if (i+1 >= argc)
00396                     usage(argv[0]);
00397                 if (dwCatalogIdArrayCount < MAX_PROVIDERS)
00398                     pdwCatalogIdArray[dwCatalogIdArrayCount++] = atoi(argv[++i]);
00399                 else
00400                     printf("Maximum providers exceeded! Ignoring provider %d\n",
00401                         atoi(argv[++i]));
00402                 break;
00403             case 'p':               // print the catalog
00404                 bPrintProviders = TRUE;
00405                 bDisplayOnlyLayeredEntries = FALSE;
00406                 break;
00407             case 'r':               // remove
00408                 bInstall = FALSE;
00409                 if (i+1 >= argc)
00410                     usage(argv[0]);
00411                 dwRemoveCatalogId = atol(argv[++i]);
00412                 break;
00413             case 'v':               // verbose mode (when printing with -p option)
00414                 bVerbose = TRUE;
00415                 break;
00416             default:
00417                 usage(argv[0]);
00418                 break;
00419         }
00420     }
00421
00422 #ifndef _WIN64
00423     if (eCatalog == LspCatalog64Only)
00424     {
00425         fprintf(stderr, "\n\nUnable to manipulate 64-bit Winsock catalog from 32-bit process!\n\n");
00426         return -1;
00427     }
00428 #endif
00429
00430     if (bPrintProviders)
00431     {
00432         // Print the 32-bit catalog
00433         if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog32Only))
00434         {
00435             printf("\n\nWinsock 32-bit Catalog:\n");
00436             printf("=======================\n");
00437             PrintProviders(LspCatalog32Only, bDisplayOnlyLayeredEntries, bVerbose);
00438         }
00439         // Print the 64-bit catalog
00440         if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog64Only))
00441         {
00442             printf("\n\nWinsock 64-bit Catalog:\n");
00443             printf("=======================\n");
00444             PrintProviders(LspCatalog64Only, bDisplayOnlyLayeredEntries, bVerbose);
00445         }
00446     }
00447     else if (bInstall)
00448     {
00449         GUID    ProviderChainGuid;
00450         DWORD   dwLayeredId;
00451
00452         //
00453         // Install the LSP over the given entries. If selected to install over all
00454         // entries, then enumerate the catalog to obtain all the available providers.
00455         //
00456
00457         if (lpszLspName == NULL)
00458         {
00459             lpszLspName = DEFAULT_LSP_NAME;
00460         }
00461
00462         // Convert the LSP name to UNICODE since the Winsock catalog is all UNICODE
00463         rc = MultiByteToWideChar(
00464                 CP_ACP,
00465                 0,
00466                 lpszLspName,
00467                 strlen(lpszLspName)+1,
00468                 wszLspName,
00469                 WSAPROTOCOL_LEN
00470                 );
00471         if (rc == 0)
00472         {
00473             fprintf(stderr, "MultiByteToWideChar failed to convert '%s'; Error = %d\n",
00474                 lpszLspName, GetLastError());
00475             goto cleanup;
00476         }
00477
00478         if (bInstallOverAll)
00479         {
00480             // Make sure user didn't specify '-a' and '-o' flags
00481             if (dwCatalogIdArrayCount != 0)
00482             {
00483                 fprintf(stderr, "\n\nError! Cannot specify both '-a' and '-o' flags!\n\n");
00484                 goto cleanup;
00485             }
00486
00487             // Enumerate the appropriate catalog we will be working on
00488             pProtocolInfo = EnumerateProviders(eCatalog, &iTotalProtocols);
00489             if (pProtocolInfo == NULL)
00490             {
00491                 fprintf(stderr, "EnumerateProviders: Unable to enumerate Winsock catalog\n");
00492                 goto cleanup;
00493             }
00494
00495             // Get the catalog IDs for all existing providers
00496             for(i=0; i < iTotalProtocols ;i++)
00497             {
00498                 if (pProtocolInfo[i].ProtocolChain.ChainLen != LAYERED_PROTOCOL)
00499                 {
00500                     if (dwCatalogIdArrayCount < MAX_PROVIDERS)
00501                         pdwCatalogIdArray[dwCatalogIdArrayCount++] = pProtocolInfo[i].dwCatalogEntryId;
00502                     else
00503                         printf("Maximum providers exceeded! Ignoring provider %d\n",
00504                                 pProtocolInfo[i].dwCatalogEntryId);
00505                 }
00506             }
00507
00508             FreeProviders(pProtocolInfo);
00509             pProtocolInfo = NULL;
00510         }
00511
00512         // Make sure we have at least one provider to install over
00513         if (dwCatalogIdArrayCount == 0)
00514         {
00515             fprintf(stderr, "\n\nError! Must specify at least one provider to layer over!\n\n");
00516             goto cleanup;
00517         }
00518
00519         printf("LSP name is '%S'\n", wszLspName);
00520
00521         // Create the 'dummy' protocol entry
00522         pDummyEntry = CreateDummyEntry(eCatalog, pdwCatalogIdArray[0], wszLspName);
00523         if (pDummyEntry == NULL)
00524         {
00525             fprintf(stderr, "CreateDummyEntry failed!\n");
00526             goto cleanup;
00527         }
00528
00529         // 'ProviderGuid' is the GUID for the dummy entry defined in lspguid.cpp
00530
00531         //
00532         // NOTE: If you want to create multiple LSPs to install over each other
00533         //       you have to modify 2 files: lspguid.cpp and lsp.def. In lspguid.cpp
00534         //       you need to change to GUID to something unique and change the LSP
00535         //       name (e.g. lsp2.dll) and rebuild. The lsp.def file only needs the
00536         //       DLL name updated. Also note that the new instlsp.exe
00537         //       generated will only install lsp2.dll so keep it seperate from the
00538         //       original lsp.dll and instlsp.exe normally generated.
00539         //
00540
00541         // Install the 'dummy' protocol entry for the LSP
00542         rc = InstallProvider(eCatalog, &ProviderGuid, ProviderPath, pDummyEntry, 1);
00543         if (rc != NO_ERROR)
00544         {
00545             fprintf(stderr, "Unable to install the dummy LSP entry!\n");
00546             goto cleanup;
00547         }
00548
00549         // Don't need this struture any more
00550         HeapFree(GetProcessHeap(), 0, pDummyEntry);
00551         pDummyEntry = NULL;
00552
00553         // Create the layered chain entries
00554         pLayeredEntries = CreateLayeredEntries(eCatalog, wszLspName, &ProviderGuid, pdwCatalogIdArray, dwCatalogIdArrayCount, &dwLayeredId);
00555         if (pLayeredEntries == NULL)
00556         {
00557             fprintf(stderr, "Unable to create layered provider entries!\n");
00558             goto cleanup;
00559         }
00560
00561         // Create a GUID for the protocol chain entries
00562         if (UuidCreate(&ProviderChainGuid) != RPC_S_OK)
00563         {
00564             fprintf(stderr, "UuidCreate failed: %d\n", GetLastError());
00565             goto cleanup;
00566         }
00567
00568         // Install the layered chain providers
00569         rc = InstallProvider(eCatalog, &ProviderChainGuid, ProviderPath, pLayeredEntries, dwCatalogIdArrayCount);
00570         if (rc != NO_ERROR)
00571         {
00572             fprintf(stderr, "Unable to install layered chain entries!\n");
00573             goto cleanup;
00574         }
00575
00576         // Reorder the winsock catalog so the layered chain entries appear first
00577         rc = ReorderCatalog(eCatalog, dwLayeredId);
00578         if (rc != NO_ERROR)
00579         {
00580             fprintf(stderr, "Unable to reorder Winsock catalog!\n");
00581             goto cleanup;
00582         }
00583
00584         HeapFree(GetProcessHeap(), 0, pLayeredEntries);
00585         pLayeredEntries = NULL;
00586     }
00587     else if (bMapLsp)
00588     {
00589         // Display the 32-bit LSP catalog map
00590         if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog32Only))
00591         {
00592             printf("\n32-bit Winsock LSP Map:\n\n");
00593
00594             pProtocolInfo = EnumerateProviders(LspCatalog32Only, &iTotalProtocols);
00595             if (pProtocolInfo == NULL)
00596             {
00597                 fprintf(stderr, "EnumerateProviders: Unable to enumerate Winsock catalog\n");
00598                 goto cleanup;
00599             }
00600
00601             pLspMap = BuildLspMap(pProtocolInfo, iTotalProtocols, &iLspCount);
00602             if (pLspMap != NULL)
00603             {
00604                 PrintLspMap(pLspMap, iLspCount);
00605
00606                 FreeLspMap(pLspMap, iLspCount);
00607                 pLspMap = NULL;
00608             }
00609             else
00610             {
00611                 printf("\nNo LSPs installed\n\n");
00612             }
00613             FreeProviders(pProtocolInfo);
00614             pProtocolInfo = NULL;
00615         }
00616         // Display the 64-bit LSP catalog map
00617         if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog64Only))
00618         {
00619             printf("\n64-bit Winsock LSP Map:\n\n");
00620
00621             pProtocolInfo = EnumerateProviders(LspCatalog64Only, &iTotalProtocols);
00622             if (pProtocolInfo == NULL)
00623             {
00624                 fprintf(stderr, "main: EnumerateProviders: Unable to enumerate Winsock catalog\n");
00625                 goto cleanup;
00626             }
00627
00628             pLspMap = BuildLspMap(pProtocolInfo, iTotalProtocols, &iLspCount);
00629             if (pLspMap != NULL)
00630             {
00631                 PrintLspMap(pLspMap, iLspCount);
00632
00633                 FreeLspMap(pLspMap, iLspCount);
00634                 pLspMap = NULL;
00635             }
00636             else
00637             {
00638                 printf("\nNo LSPs installed\n\n");
00639             }
00640             FreeProviders(pProtocolInfo);
00641             pProtocolInfo = NULL;
00642         }
00643     }
00644     else
00645     {
00646         if (bRemoveAllLayeredEntries == TRUE)
00647         {
00648             if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog32Only))
00649                 RemoveAllLayeredEntries(LspCatalog32Only);
00650
00651             if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog64Only))
00652                 RemoveAllLayeredEntries(LspCatalog64Only);
00653         }
00654         else
00655         {
00656             //
00657             // See if we're on a platform that supports WSCUpdateProvider. If so then
00658             // uninstalling an LSP is easy; otherwise, it is very painful if you're
00659             // removing an LSP that has other LSPs on top if it.
00660             //
00661             hModule = LoadLibraryA("ws2_32.dll");
00662             if (hModule == NULL)
00663             {
00664                 fprintf(stderr, "main: Unable to load ws2_32.dll: %d\n", GetLastError());
00665                 goto cleanup;
00666             }
00667             else
00668             {
00669                 fnWscUpdateProvider = (LPWSCUPDATEPROVIDER)GetProcAddress(hModule, "WSCUpdateProvider");
00670
00671                 if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog32Only))
00672                     RemoveProvider(LspCatalog32Only, dwRemoveCatalogId);
00673
00674                 if ((eCatalog == LspCatalogBoth) || (eCatalog == LspCatalog64Only))
00675                     RemoveProvider(LspCatalog64Only, dwRemoveCatalogId);
00676
00677                 FreeLibrary(hModule);
00678                 hModule = NULL;
00679             }
00680
00681         }
00682     }
00683
00684 cleanup:
00685
00686     //
00687     // Free any dynamic allocations and/or handles
00688     //
00689
00690     if (pLayeredEntries)
00691         HeapFree(GetProcessHeap(), 0, pLayeredEntries);
00692
00693     if (pDummyEntry)
00694         HeapFree(GetProcessHeap(), 0, pDummyEntry);
00695
00696     if (pProtocolInfo)
00697         FreeProviders(pProtocolInfo);
00698
00699     if (hModule != NULL)
00700         FreeLibrary(hModule);
00701
00702     if (pLspMap)
00703         FreeLspMap(pLspMap, iLspCount);
00704
00705     WSACleanup();
00706     return 0;
00707 }
00708
00709 //
00710 // Function: usage
00711 //
00712 // Description:
00713 //    Prints usage information.
00714 //
00715 void usage(char *progname)
00716 {
00717     printf("usage: %s -i -r [CatId] -o [CatId] -p\n", progname);
00718     printf(
00719            "       -a           Install over all providers (base or layered)\n"
00720            "                       Cannot be combined with '-o' option\n"
00721            "       -c Catalog   Indicates which catalog to operate on\n"
00722            "          b            Both 64-bit and 32-bit Winsock catalogs\n"
00723            "          6            64-bit Winsock catalog only\n"
00724            "          3            32-bit Winsock catalog only\n"
00725            "       -i           Install LSP\n"
00726            "       -f           Remove all layered entries\n"
00727            "       -l           Print layered providers only\n"
00728            "       -m           Display a map of the LSPs and the order they are\n"
00729            "                       installed in\n"
00730            "       -n Str       Name of LSP\n"
00731            "       -o CatId     Install over specified LSP\n"
00732            "                       This option may be specified multiple times\n"
00733            "                       Cannot be combined with '-a' option\n"
00734            "       -p           Print all layers and their catalog IDs\n"
00735            "       -r CatId     Remove LSP\n"
00736            "       -v           Print verbose catalog information (used with -p)\n"
00737            );
00738     ExitProcess(-1);
00739 }
00740
00741 //
00742 // Function: PrintProviders
00743 //
00744 // Description:
00745 //    This function prints out each entry in the Winsock catalog and its
00746 //    catalog ID if the parameter, bLayeredOnly, is FALSE. If TRUE then
00747 //    print only those layered catalog entries.
00748 //
00749 void PrintProviders(WINSOCK_CATALOG Catalog, BOOL bLayeredOnly, BOOL bVerbose)
00750 {
00751     WSAPROTOCOL_INFOW  *pProtocolInfo=NULL;
00752     INT                 iProtocolCount=0,
00753                         i;
00754
00755   pProtocolInfo = EnumerateProviders(Catalog, &iProtocolCount);
00756     if (pProtocolInfo == NULL)
00757     {
00758         return;
00759     }
00760     for(i=0; i < iProtocolCount ;i++)
00761     {
00762         if (!bLayeredOnly)
00763         {
00764             if (bVerbose)
00765                 PrintProtocolInfo(&pProtocolInfo[i]);
00766             else
00767                 printf("%04d - %S\n", pProtocolInfo[i].dwCatalogEntryId,
00768                       pProtocolInfo[i].szProtocol);
00769         }
00770         else if (pProtocolInfo[i].ProtocolChain.ChainLen == LAYERED_PROTOCOL)
00771         {
00772             if (bVerbose)
00773                 PrintProtocolInfo(&pProtocolInfo[i]);
00774             else
00775                 printf("%04d - %S\n", pProtocolInfo[i].dwCatalogEntryId,
00776                       pProtocolInfo[i].szProtocol);
00777         }
00778     }
00779     FreeProviders(pProtocolInfo);
00780
00781     return;
00782 }
00783
00784 //
00785 // Function: CreateDummyEntry
00786 //
00787 // Description:
00788 //    This creates a single WSAPROTOCOL_INFOW structure which describes the
00789 //    hidden "dummy" entry for an LSP. This is required since the layered
00790 //    chain entries must reference the catalog ID of the LSP and a catalog ID
00791 //    cannot be obtained until an entry is installed.
00792 //
00793 WSAPROTOCOL_INFOW *
00794 CreateDummyEntry(
00795     WINSOCK_CATALOG Catalog,
00796     INT CatalogId,
00797     WCHAR *lpwszLspName
00798     )
00799 {
00800     WSAPROTOCOL_INFOW *pProtocolInfo=NULL,
00801                       *pDummyEntry=NULL;
00802     INT                iProtocolCount=0;
00803     int                i;
00804
00805     // Enumerate the catalog
00806     pProtocolInfo = EnumerateProviders(Catalog, &iProtocolCount);
00807     if (pProtocolInfo == NULL)
00808     {
00809         fprintf(stderr, "CreateDummyEntry: EnumerateProviders failed!\n");
00810         return NULL;
00811     }
00812
00813     // Find one of the providers we are layering over
00814     for(i=0; i < iProtocolCount ;i++)
00815     {
00816         if (pProtocolInfo[i].dwCatalogEntryId == CatalogId)
00817         {
00818             // Allocate space and copy the provider structure
00819             pDummyEntry = (WSAPROTOCOL_INFOW *)HeapAlloc(GetProcessHeap(), 0, sizeof(WSAPROTOCOL_INFOW));
00820             if (pDummyEntry == NULL)
00821             {
00822                 return NULL;
00823             }
00824
00825             // Copy the entry as a basis for the dummy entry
00826             memcpy(pDummyEntry, &pProtocolInfo[i], sizeof(WSAPROTOCOL_INFOW));
00827
00828             break;
00829         }
00830     }
00831
00832     // Verify we found a provider
00833     if (pDummyEntry == NULL)
00834     {
00835         fprintf(stderr, "\n\nError! Unable to find provider with ID of %d\n\n",
00836                 CatalogId);
00837         return NULL;
00838     }
00839
00840     // Remove the flag indicating IFS support (as our LSP does not provide IFS handles)
00841     pDummyEntry->dwServiceFlags1 &= (~XP1_IFS_HANDLES);
00842     // Set the flags indicating this is a hidden ("dummy") entry
00843     pDummyEntry->dwProviderFlags |= PFL_HIDDEN;
00844     pDummyEntry->ProtocolChain.ChainLen = LAYERED_PROTOCOL;
00845
00846     // Copy the LSP name
00847     wcsncpy(pDummyEntry->szProtocol, lpwszLspName, WSAPROTOCOL_LEN);
00848
00849     FreeProviders(pProtocolInfo);
00850
00851     return pDummyEntry;
00852 }
00853
00854 //
00855 // Function: CreateLayeredEntries
00856 //
00857 // Description:
00858 //    This finds all the providers the LSP is layering over and builds
00859 //    the layered chain entries which make up the LSP. This routine
00860 //    returns the catalog ID of the LSP's dummy entry (because it is
00861 //    needed to reorder the catlog after the chain entries are installed).
00862 //
00863 WSAPROTOCOL_INFOW *
00864 CreateLayeredEntries(
00865     WINSOCK_CATALOG Catalog,        // Which catalog are we operating on
00866     WCHAR *lpwszLspName,            // Name of the LSP
00867     GUID *Guid,                     // GUID that the LSP's dummy entry was installed under
00868     DWORD *pdwIdArray,              // Array of catalog IDs we're layering over
00869     INT iIdArrayCount,              // Number of entries in array
00870     DWORD *LayeredId                // [OUT] Returns the catalog ID of dummy entry
00871     )
00872 {
00873     WSAPROTOCOL_INFOW   *pProvider=NULL,
00874                         *pLayeredEntries=NULL;
00875     DWORD                LayeredCatalogId=0;
00876     INT                  iProviderCount=0,
00877                          idx,
00878                          i, j, k;
00879
00880     if (LayeredId == NULL)
00881         return NULL;
00882
00883     // Enumerate the catalog
00884     pProvider = EnumerateProviders(Catalog, &iProviderCount);
00885     if (pProvider == NULL)
00886     {
00887         return NULL;
00888     }
00889
00890     // Find the dummy entry so we can extract its catalog ID
00891     for(i=0; i < iProviderCount ;i++)
00892     {
00893         if (memcmp(&pProvider[i].ProviderId, Guid, sizeof(GUID)) == 0)
00894         {
00895             LayeredCatalogId = pProvider[i].dwCatalogEntryId;
00896             break;
00897         }
00898     }
00899
00900     // Make sure we found the dummy provider
00901     if (LayeredCatalogId == 0)
00902     {
00903         fprintf(stderr, "CreateLayeredEntries: Unable to find dummy provider in catalog!\n");
00904         FreeProviders(pProvider);
00905         return NULL;
00906     }
00907
00908     // Allocate space for our layered entries
00909     pLayeredEntries = (WSAPROTOCOL_INFOW *)HeapAlloc(GetProcessHeap(), 0, sizeof(WSAPROTOCOL_INFOW) * iIdArrayCount);
00910     if (pLayeredEntries == NULL)
00911     {
00912         fprintf(stderr, "CreateLayeredEntries: HeapAlloc failed: %d\n", GetLastError());
00913         FreeProviders(pProvider);
00914         return NULL;
00915     }
00916
00917     // Go through the catalog and build the layered entries
00918     idx = 0;
00919     for(i=0; i < iProviderCount ;i++)
00920     {
00921         for(j=0; j < iIdArrayCount ;j++)
00922         {
00923             if (pProvider[i].dwCatalogEntryId == pdwIdArray[j])
00924             {
00925                 memcpy(&pLayeredEntries[idx], &pProvider[i], sizeof(WSAPROTOCOL_INFOW));
00926
00927                 // Put our LSP name in the protocol field
00928                 _snwprintf(pLayeredEntries[idx].szProtocol, WSAPROTOCOL_LEN,
00929                         L"%s over [%s]",
00930                         lpwszLspName,
00931                         pProvider[i].szProtocol
00932                         );
00933
00934                 // Move all the protocol chain entries down by 1 position
00935                 for(k = pProvider[i].ProtocolChain.ChainLen; k > 0 ;k--)
00936                 {
00937                     pLayeredEntries[idx].ProtocolChain.ChainEntries[k] = pProvider[i].ProtocolChain.ChainEntries[k-1];
00938                 }
00939
00940                 // The second entry is always the ID of the current pProvider[i]
00941                 //     In case of multiple LSPs then if we didn't do this the [1] index
00942                 //     would contain the ID of that LSP's dummy entry and not the entry
00943                 //     itself.
00944                 pLayeredEntries[idx].ProtocolChain.ChainEntries[1] = pProvider[i].dwCatalogEntryId;
00945
00946                 // Insert our LSP in the chain and increment the count
00947                 pLayeredEntries[idx].ProtocolChain.ChainEntries[0] = LayeredCatalogId;
00948                 pLayeredEntries[idx].ProtocolChain.ChainLen++;
00949
00950                 // Again, this LSP doesn't provide true IFS handles so remove the flag
00951                 pLayeredEntries[idx].dwServiceFlags1 &= (~XP1_IFS_HANDLES);
00952
00953                 idx++;
00954             }
00955         }
00956     }
00957
00958     FreeProviders(pProvider);
00959
00960     // Return the ID of the LSP's dummy entry
00961     *LayeredId = LayeredCatalogId;
00962
00963     return pLayeredEntries;
00964 }
00965
00966 //
00967 // Function: InstallProvider
00968 //
00969 // Description:
00970 //    This is a wrapper for the WSCInstallProvider function. Depending on
00971 //    which catalog is specified, this routine calls the correct install
00972 //    routine.
00973 //
00974 int
00975 InstallProvider(
00976     WINSOCK_CATALOG Catalog,            // Which catalog are we operating on
00977     GUID *Guid,                         // GUID under which provider will be installed
00978     WCHAR *lpwszLspPath,                // Path to LSP's DLL
00979     WSAPROTOCOL_INFOW *pProvider,       // Array of provider structures to install
00980     INT iProviderCount                  // Number of providers in array
00981     )
00982 {
00983     WSAPROTOCOL_INFOW *pEnumProviders=NULL;
00984     INT                iEnumProviderCount,
00985                        ErrorCode,
00986                        rc, i;
00987
00988 #ifdef _WIN64
00989     if (Catalog == LspCatalog32Only)
00990     {
00991         // Can't install only in 32-bit catalog from 64-bit
00992         fprintf(stderr, "\n\nError! It is not possible to install only in 32-bit catalog from 64-bit process!\n\n");
00993         return SOCKET_ERROR;
00994     }
00995     else if (Catalog == LspCatalog64Only)
00996     {
00997         // Just need to call WSCInstallProvider
00998         rc = WSCInstallProvider(Guid, lpwszLspPath, pProvider, iProviderCount, &ErrorCode);
00999     }
01000     else
01001     {
01002         // To install in both we must call WSCInstallProviderPath64_32
01003         rc = WSCInstallProvider64_32(Guid, lpwszLspPath, pProvider, iProviderCount, &ErrorCode);
01004     }
01005 #else
01006     if (Catalog == LspCatalog32Only)
01007     {
01008         // From a 32-bit process we can only install into 32-bit catalog
01009         rc = WSCInstallProvider(Guid, lpwszLspPath, pProvider, iProviderCount, &ErrorCode);
01010     }
01011     else
01012     {
01013         // From a 32-bit process, we can't touch the 64-bit catalog at all
01014         fprintf(stderr, "\n\nError! It is not possible to install into the 64-bit catalog from a 32-bit process!\n\n");
01015         return SOCKET_ERROR;
01016     }
01017 #endif
01018     if (rc == SOCKET_ERROR)
01019     {
01020         fprintf(stderr, "InstallProvider: WSCInstallProvider* failed: %d\n", ErrorCode);
01021     }
01022
01023     // Go back and enumerate what we just installed
01024     pEnumProviders = EnumerateProviders(Catalog, &iEnumProviderCount);
01025     if (pEnumProviders != NULL)
01026     {
01027         for(i=0; i < iEnumProviderCount ;i++)
01028         {
01029             if (memcmp(&pEnumProviders[i].ProviderId, Guid, sizeof(GUID)) == 0)
01030             {
01031                 printf("Installed: [%4d] %S\n", pEnumProviders[i].dwCatalogEntryId,
01032                     pEnumProviders[i].szProtocol);
01033             }
01034         }
01035         FreeProviders(pEnumProviders);
01036     }
01037
01038     return rc;
01039 }
01040
01041 //
01042 // Function: DeinstallProvider
01043 //
01044 // Description:
01045 //    This is a wrapper for the WSCDeinstallProvider* functions. Depending on
01046 //    which Winsock catalog is specified, this routine calls the right uninstall
01047 //    function.
01048 //
01049 int
01050 DeinstallProvider(
01051     WINSOCK_CATALOG Catalog,            // Which Winsock catalog to operate on
01052     GUID *Guid                          // GUID of provider to remove
01053     )
01054 {
01055     INT     ErrorCode,
01056             rc;
01057
01058 #ifdef _WIN64
01059     if (Catalog == LspCatalogBoth)
01060     {
01061         // Remove from 64-bit catalog
01062         rc = WSCDeinstallProvider(Guid, &ErrorCode);
01063         if (rc == SOCKET_ERROR)
01064         {
01065             if (ErrorCode != WSAEFAULT)
01066                 fprintf(stderr, "DeinstallProvider: WSCDeinstallProvider failed: %d\n", ErrorCode);
01067         }
01068
01069         // Remove from the 32-bit catalog
01070         rc = WSCDeinstallProvider32(Guid, &ErrorCode);
01071         if (rc == SOCKET_ERROR)
01072         {
01073             if (ErrorCode != WSAEFAULT)
01074                 fprintf(stderr, "DeinstallProvider: WSCDeinstallProvider32 failed: %d\n", ErrorCode);
01075         }
01076     }
01077     else if (Catalog == LspCatalog64Only)
01078     {
01079         // Remove from 64-bit catalog
01080         rc = WSCDeinstallProvider(Guid, &ErrorCode);
01081         if (rc == SOCKET_ERROR)
01082         {
01083             if (ErrorCode != WSAEFAULT)
01084                 fprintf(stderr, "DeinstallProvider: WSCDeinstallProvider failed: %d\n", ErrorCode);
01085         }
01086     }
01087     else
01088     {
01089         // Remove from the 32-bit catalog
01090         rc = WSCDeinstallProvider32(Guid, &ErrorCode);
01091         if (rc == SOCKET_ERROR)
01092         {
01093             if (ErrorCode != WSAEFAULT)
01094                 fprintf(stderr, "DeinstallProvider: WSCDeinstallProvider32 failed: %d\n", ErrorCode);
01095         }
01096     }
01097 #else
01098     if (Catalog == LspCatalog32Only)
01099     {
01100         // Remove from the 32-bit catalog
01101         rc = WSCDeinstallProvider(Guid, &ErrorCode);
01102         if (rc == SOCKET_ERROR)
01103         {
01104             if (ErrorCode != WSAEFAULT)
01105                 fprintf(stderr, "DeinstallProvider: WSCDeinstallProvider failed: %d\n", ErrorCode);
01106         }
01107     }
01108     else
01109     {
01110         fprintf(stderr, "Unable to remove providers in 64-bit catalog from 32-bit process!\n");
01111         return SOCKET_ERROR;
01112     }
01113 #endif
01114
01115     return NO_ERROR;
01116 }
01117
01118 //
01119 // Function: ReorderACatalog
01120 //
01121 // Description:
01122 //    This routine enumerates a single catalog (32 or 64 bit) and reorders
01123 //    the catalog according to the supplied catalog ID. That is, any provider
01124 //    with that ID at the head of it's protocol chain is moved to the beginning
01125 //    of the catalog.
01126 //
01127 DWORD *
01128 ReorderACatalog(
01129     WINSOCK_CATALOG Catalog,
01130     DWORD   dwLayerId,
01131     INT   *dwEntryCount
01132     )
01133 {
01134     WSAPROTOCOL_INFOW   *pProvider=NULL;
01135     DWORD               *pdwProtocolOrder=NULL;
01136     INT                  iProviderCount,
01137                          idx,
01138                          i;
01139
01140     // Validate parameters
01141     if ((dwEntryCount == NULL) || (Catalog == LspCatalogBoth))
01142         return NULL;
01143
01144     // Enumerate the catalog
01145     pProvider = EnumerateProviders(Catalog, &iProviderCount);
01146     if (pProvider == NULL)
01147     {
01148         fprintf(stderr, "ReorderACatalog: Unable to enumerate Winsock catalog!\n");
01149         goto cleanup;
01150     }
01151
01152     // Allocate space for the array of catalog IDs (the catalog order)
01153     pdwProtocolOrder = (DWORD *)HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD) * iProviderCount);
01154     if (pdwProtocolOrder == NULL)
01155     {
01156         fprintf(stderr, "ReorderACatalog: HeapAlloc failed: %d\n", GetLastError());
01157         goto cleanup;
01158     }
01159
01160     idx = 0;
01161
01162     // First put all the layered entries at the head of the catalog
01163     for(i=0; i < iProviderCount ;i++)
01164     {
01165         if (IsIdInChain(&pProvider[i], dwLayerId) == TRUE)
01166         {
01167             pdwProtocolOrder[idx++] = pProvider[i].dwCatalogEntryId;
01168         }
01169     }
01170
01171     // Put the remaining entries after the layered chain entries
01172     for(i=0; i < iProviderCount ;i++)
01173     {
01174         if (IsIdInChain(&pProvider[i], dwLayerId) == FALSE)
01175         {
01176             pdwProtocolOrder[idx++] = pProvider[i].dwCatalogEntryId;
01177         }
01178     }
01179
01180 cleanup:
01181
01182     if (pProvider)
01183         FreeProviders(pProvider);
01184
01185     // Update the count
01186     *dwEntryCount = iProviderCount;
01187
01188
01189     return pdwProtocolOrder;
01190 }
01191
01192 //
01193 // Function: ReorderCatalog
01194 //
01195 // Description:
01196 //    This routine reorders the Winsock catalog such that those entries
01197 //    which reference the given catalog ID (dwLayerId) as the first entry
01198 //    in the chain array occur at the head of the catalog. This routine
01199 //    also operates on the specified Winsock catalog.
01200 //
01201 int ReorderCatalog(WINSOCK_CATALOG Catalog, DWORD dwLayeredId)
01202 {
01203     DWORD     *pdwProtocolOrder;
01204     INT        iProviderCount,
01205                rc;
01206
01207     rc = NO_ERROR;
01208 #ifdef _WIN64
01209     if ((Catalog == LspCatalog32Only) || (Catalog == LspCatalogBoth))
01210     {
01211         printf("Reordering 32-bit Winsock catalog...\n");
01212         pdwProtocolOrder = ReorderACatalog(LspCatalog32Only, dwLayeredId, &iProviderCount);
01213         if (pdwProtocolOrder == NULL)
01214         {
01215             fprintf(stderr, "ReorderCatalog: ReorderACatalog failed!\n");
01216         }
01217         else
01218         {
01219             rc = WSCWriteProviderOrder32(pdwProtocolOrder, iProviderCount);
01220             if (rc == SOCKET_ERROR)
01221             {
01222                 fprintf(stderr, "ReorderCatalog: WSCWriteProviderOrder32 failed: %d\n", rc);
01223             }
01224
01225             HeapFree(GetProcessHeap(), 0, pdwProtocolOrder);
01226             pdwProtocolOrder = NULL;
01227         }
01228     }
01229     if ((Catalog == LspCatalog64Only) || (Catalog == LspCatalogBoth))
01230     {
01231         printf("Reordering 64-bit Winsock catalog...\n");
01232         pdwProtocolOrder = ReorderACatalog(LspCatalog64Only, dwLayeredId, &iProviderCount);
01233         if (pdwProtocolOrder == NULL)
01234         {
01235             fprintf(stderr, "ReorderCatalog: ReorderACatalog failed!\n");
01236         }
01237         else
01238         {
01239             rc = WSCWriteProviderOrder(pdwProtocolOrder, iProviderCount);
01240             if (rc == SOCKET_ERROR)
01241             {
01242                 fprintf(stderr, "ReorderCatalog: WSCWriteProviderOrder failed: %d\n", rc);
01243             }
01244
01245             HeapFree(GetProcessHeap(), 0, pdwProtocolOrder);
01246             pdwProtocolOrder = NULL;
01247         }
01248     }
01249 #else
01250     if ((Catalog == LspCatalog32Only) || (Catalog == LspCatalogBoth))
01251     {
01252         printf("Reordering 32-bit Winsock catalog...\n");
01253         pdwProtocolOrder = ReorderACatalog(LspCatalog32Only, dwLayeredId, &iProviderCount);
01254         if (pdwProtocolOrder == NULL)
01255         {
01256             fprintf(stderr, "ReorderCatalog: ReorderACatalog failed!\n");
01257         }
01258         else
01259         {
01260             rc = WSCWriteProviderOrder(pdwProtocolOrder, iProviderCount);
01261             if (rc == SOCKET_ERROR)
01262             {
01263                 fprintf(stderr, "ReorderCatalog: WSCWriteProviderOrder failed: %d\n", rc);
01264             }
01265
01266             HeapFree(GetProcessHeap(), 0, pdwProtocolOrder);
01267             pdwProtocolOrder = NULL;
01268         }
01269     }
01270 #endif
01271
01272     return rc;
01273 }
01274
01275 //
01276 // Function: RemoveIdFromChain
01277 //
01278 // Description:
01279 //    This function removes the given CatalogId from the protocol chain
01280 //    for pinfo.
01281 //
01282 int RemoveIdFromChain(WSAPROTOCOL_INFOW *pinfo, DWORD CatalogId)
01283 {
01284     int     i, j;
01285
01286     for(i=0; i < pinfo->ProtocolChain.ChainLen ;i++)
01287     {
01288         if (pinfo->ProtocolChain.ChainEntries[i] == CatalogId)
01289         {
01290             for(j=i; j < pinfo->ProtocolChain.ChainLen-1 ; j++)
01291             {
01292                 pinfo->ProtocolChain.ChainEntries[j] = pinfo->ProtocolChain.ChainEntries[j+1];
01293             }
01294             pinfo->ProtocolChain.ChainLen--;
01295             return 0;
01296         }
01297     }
01298     return 1;
01299 }
01300
01301 //
01302 // Function: IsIdinChain
01303 //
01304 // Description:
01305 //    This function determines whether the given catalog id is referenced
01306 //    in the protocol chain of pinfo.
01307 //
01308 BOOL IsIdInChain(WSAPROTOCOL_INFOW *pinfo, DWORD Id)
01309 {
01310     for(int i=0; i < pinfo->ProtocolChain.ChainLen ;i++)
01311     {
01312         if (pinfo->ProtocolChain.ChainEntries[i] == Id)
01313             return TRUE;
01314     }
01315     return FALSE;
01316 }
01317
01318 //
01319 // Function: RemoveProvider
01320 //
01321 // Description:
01322 //    This function removes a layered provider. Things can get tricky if
01323 //    we're removing a layered provider which has been layered over by
01324 //    another provider.
01325 //
01326 int RemoveProvider(WINSOCK_CATALOG Catalog, DWORD dwProviderId)
01327 {
01328     WSAPROTOCOL_INFOW   *pProvider=NULL,
01329                         *pLayeredEntries=NULL;
01330     LSP_ENTRY           *pLspMap=NULL;
01331     DWORD               *pdwRemovedProviders=NULL,
01332                         *pdwCatalogOrder=NULL;
01333     INT                  iOriginalProviderCount=0,
01334                          iProviderCount=0,
01335                          iRemoveCount=0,
01336                          iLayerCount=0,
01337                          iLspCount=0,
01338                          ErrorCode,
01339                          Status,
01340                          rc,
01341                          i, j;
01342     WCHAR                wszProviderPath[DEFAULT_PATH_LEN];
01343     INT                  iProviderPathLen=DEFAULT_PATH_LEN-1;
01344
01345     Status = NO_ERROR;
01346
01347     // Enumerate the catalog
01348     pProvider = EnumerateProviders(Catalog, &iProviderCount);
01349     if (pProvider == NULL)
01350     {
01351         fprintf(stderr, "RemoveProvider: Unable to enumerate catalog!\n");
01352         Status = SOCKET_ERROR;
01353         goto cleanup;
01354     }
01355
01356     // Make sure this is a layered provider ID
01357     for(i=0; i < iProviderCount ;i++)
01358     {
01359         if ((pProvider[i].dwCatalogEntryId == dwProviderId) &&
01360             (pProvider[i].ProtocolChain.ChainLen == BASE_PROTOCOL))
01361         {
01362             fprintf(stderr, "\n\nError! Attempting to remove base provider: %S\n\n",
01363                 pProvider[i].szProtocol);
01364             Status = SOCKET_ERROR;
01365             goto cleanup;
01366         }
01367     }
01368
01369     // First count how many entries directly belong to this provider
01370     iRemoveCount = 0;
01371     for(i=0; i < iProviderCount ;i++)
01372     {
01373         if (((pProvider[i].ProtocolChain.ChainLen > 0) &&
01374              (pProvider[i].ProtocolChain.ChainEntries[0] == dwProviderId) ) ||
01375              (pProvider[i].dwCatalogEntryId == dwProviderId))
01376         {
01377             iRemoveCount++;
01378         }
01379     }
01380
01381     // Save off the catalog entry IDs of the removed providers
01382     pdwRemovedProviders = (DWORD *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iRemoveCount * sizeof(DWORD));
01383     if (pdwRemovedProviders == NULL)
01384     {
01385         fprintf(stderr, "\n\nError! HeapAlloc failed: %d\n", GetLastError());
01386         Status = SOCKET_ERROR;
01387         goto cleanup;
01388     }
01389
01390     iRemoveCount = 0;
01391
01392     // Uninstall the LSP dummy and chain entries
01393     for(i=0; i < iProviderCount ;i++)
01394     {
01395         if (((pProvider[i].ProtocolChain.ChainLen > 0) &&
01396              (pProvider[i].ProtocolChain.ChainEntries[0] == dwProviderId) ) ||
01397             (pProvider[i].dwCatalogEntryId == dwProviderId))
01398         {
01399             // Save removed catalog entry ID
01400             pdwRemovedProviders[iRemoveCount++] = pProvider[i].dwCatalogEntryId;
01401
01402             // Display message and actually remove the provider
01403             printf("Removing: [%4d] %S\n", pProvider[i].dwCatalogEntryId,
01404                 pProvider[i].szProtocol);
01405             DeinstallProvider(Catalog, &pProvider[i].ProviderId);
01406         }
01407     }
01408
01409     // Enumerate the catalog again -- we may need to do more cleanup
01410     FreeProviders(pProvider);
01411
01412     pProvider = EnumerateProviders(Catalog, &iProviderCount);
01413     if (pProvider == NULL)
01414     {
01415         fprintf(stderr, "RemoveProvider: Unable to enumerate Winsock catalog!\n");
01416         Status = SOCKET_ERROR;
01417         goto cleanup;
01418     }
01419
01420     // If we're on Windows XP then life is easy
01421     if (fnWscUpdateProvider != NULL)
01422     {
01423         for(i=0; i < iProviderCount ;i++)
01424         {
01425             for(j=0; j < iRemoveCount ;j++)
01426             {
01427                 if (IsIdInChain(&pProvider[i], pdwRemovedProviders[j]) == TRUE)
01428                 {
01429                     // Remove the defunct LSP provider id
01430                     RemoveIdFromChain(&pProvider[i], pdwRemovedProviders[j]);
01431
01432                     // Get the path to this provider
01433                     rc = WSCGetProviderPath(
01434                             &pProvider[i].ProviderId,
01435                             wszProviderPath,
01436                             &iProviderPathLen,
01437                             &ErrorCode
01438                             );
01439                     if (rc == SOCKET_ERROR)
01440                     {
01441                         fprintf(stderr, "RemoveProvider: WSCGetProviderPath failed: %d\n",
01442                                 ErrorCode);
01443                         continue;
01444                     }
01445
01446                     // Update it's provider entry
01447                     rc = fnWscUpdateProvider(
01448                             &pProvider[i].ProviderId,
01449                             wszProviderPath,
01450                             &pProvider[i],
01451                             1,
01452                             &ErrorCode
01453                             );
01454                     if (rc == SOCKET_ERROR)
01455                     {
01456                         fprintf(stderr, "RemoveProvider: WSCUpdateProvider failed: %d\n",
01457                                 ErrorCode);
01458                     }
01459                     break;
01460                 }
01461             }
01462         }
01463
01464     }
01465     else
01466     {
01467         BOOL bDependent;
01468
01469         // First check to see if any other LSPs were layered over ours
01470         bDependent = FALSE;
01471         for(i=0; (i < iProviderCount) && (!bDependent) ;i++)
01472         {
01473             for(j=0; j < iRemoveCount ;j++)
01474             {
01475                 if ( IsIdInChain(&pProvider[i], pdwRemovedProviders[j]) )
01476                 {
01477                     bDependent = TRUE;
01478                     break;
01479                 }
01480             }
01481         }
01482
01483         if (bDependent == TRUE)
01484         {
01485             // Yuck - need to fix up all the dependent providers layered
01486             // above our LSP. This is a lot more complicated without the
01487             // WSCUpdateProvider function. The problem is that to change
01488             // the protocol chains of the providers layered over the
01489             // removed LSP, you have to uninstall it, modify the chain,
01490             // and reinstall it. This itself isn't too bad but if there
01491             // are other LSPs layered over the one just re-installed, it
01492             // needs to be fixed now (since by re-isntalling the LSP, it
01493             // gets assigned a different provider ID).
01494
01495             // In this case we're taking the "easy" way out. We will uninstall
01496             // ALL LSPs and reinstall them regardless of whether or not
01497             // they are dependent. Otherwise, the logic for determing which
01498             // other LSPs are affected by changes gets complicated and would
01499             // be prone to (more) errors.
01500
01501             // First save off the catalog order
01502
01503             // NOTE: iProviderCount is assumed to be an invariant throughout this
01504             //       process. If someone else is installing LSPs while we're doing
01505             //       this we'd be in trouble anyway.
01506
01507             iOriginalProviderCount = iProviderCount;
01508
01509             pdwCatalogOrder = (DWORD *)HeapAlloc(
01510                     GetProcessHeap(),
01511                     HEAP_ZERO_MEMORY,
01512                     sizeof(DWORD) * iOriginalProviderCount
01513                     );
01514             if (pdwCatalogOrder == NULL)
01515             {
01516                 fprintf(stderr, "RemoveProvider: HeapAlloc failed: %d\n", GetLastError());
01517                 goto cleanup;
01518             }
01519
01520             for(i=0; i < iProviderCount ;i++)
01521             {
01522                 pdwCatalogOrder[i] = pProvider[i].dwCatalogEntryId;
01523             }
01524
01525             // Obtain the mapping of the LSP install order
01526             pLspMap = BuildLspMap(pProvider, iProviderCount, &iLspCount);
01527             if (pLspMap == NULL)
01528             {
01529                 fprintf(stderr, "RemoveProvider: BuildLspMap returned NULL!\n");
01530                 goto cleanup;
01531             }
01532
01533             // Remove all instances of the removed LSP from the LSP map chains
01534             PruneLspMap(pLspMap, iLspCount, pdwRemovedProviders, iRemoveCount);
01535
01536             // First uninstall all the LSPs
01537             for(i=0; i < iLspCount ;i++)
01538             {
01539                 // Uninstall the dummy entry
01540                 DeinstallProvider(Catalog, &pLspMap[i].DummyEntry.ProviderId);
01541
01542                 // Uninstall all the associated layered entries
01543                 for(j=0; j < pLspMap[i].LayeredGuidCount ;j++)
01544                 {
01545                     DeinstallProvider(Catalog, &pLspMap[i].LayeredGuids[j]);
01546                 }
01547             }
01548
01549             // No go back and re-install them
01550             for(i=0; i < iLspCount ;i++)
01551             {
01552                 rc = InstallProvider(
01553                         Catalog,
01554                        &pLspMap[i].DummyEntry.ProviderId,
01555                         pLspMap[i].wszLspDll,
01556                        &pLspMap[i].DummyEntry,
01557                         1
01558                         );
01559                 if (rc != NO_ERROR)
01560                 {
01561                     fprintf(stderr, "RemoveProvider: Unable to install dummy provider for %ws; error %d\n",
01562                         pLspMap[i].DummyEntry.szProtocol,
01563                         rc
01564                         );
01565                     goto cleanup;
01566                 }
01567
01568                 // Enumerate the catalog
01569                 FreeProviders(pProvider);
01570
01571                 pProvider = EnumerateProviders(Catalog, &iProviderCount);
01572                 if (pProvider == NULL)
01573                 {
01574                     fprintf(stderr, "RemoveProvider: Unable to enumerate Winsock catalog!\n");
01575                     Status = SOCKET_ERROR;
01576                     goto cleanup;
01577                 }
01578
01579                 // Find the new ID for the dummy entry
01580                 for(j=0; j < iProviderCount ;j++)
01581                 {
01582                     if ( memcmp( &pProvider[j].ProviderId, &pLspMap[i].DummyEntry.ProviderId, sizeof(GUID) ) == 0 )
01583                     {
01584                         // Save the new ID
01585                         pLspMap[i].DummyEntry.dwProviderReserved = pProvider[j].dwCatalogEntryId;
01586                         break;
01587                     }
01588                 }
01589
01590                 // Go update all occurences of the old ID with the new ID
01591                 UpdateLspMap(
01592                     pLspMap,
01593                     iLspCount,
01594                     pLspMap[i].DummyEntry.dwCatalogEntryId,
01595                     pLspMap[i].DummyEntry.dwProviderReserved,
01596                     pdwCatalogOrder,
01597                     iOriginalProviderCount
01598                     );
01599
01600                 // Install the layered entries associated with this LSP
01601                 for(j=0; j < pLspMap[i].LayeredGuidCount ;j++)
01602                 {
01603                     pLayeredEntries = GetLayeredEntriesByGuid(
01604                             pLspMap[i].LayeredEntries,
01605                             pLspMap[i].Count,
01606                            &pLspMap[i].LayeredGuids[j],
01607                            &iLayerCount
01608                             );
01609                     if (pLayeredEntries == NULL)
01610                     {
01611                         fprintf(stderr, "GetLayeredEntriesByGuid: Failed!\n");
01612                         continue;
01613                     }
01614
01615                     // Reinstalled the layered entries
01616                     rc = InstallProvider(
01617                             Catalog,
01618                            &pLspMap[i].LayeredGuids[j],
01619                             pLspMap[i].wszLspDll,
01620                             pLayeredEntries,
01621                             iLayerCount
01622                             );
01623                     if (rc != NO_ERROR)
01624                     {
01625                         fprintf(stderr, "RemoveProvider: Unable to install layered provider(s) for %ws; error %d\n",
01626                             pLspMap[i].DummyEntry.szProtocol,
01627                             rc
01628                             );
01629                         goto cleanup;
01630                     }
01631
01632                     HeapFree(GetProcessHeap(), 0, pLayeredEntries);
01633                     pLayeredEntries = NULL;
01634                 }
01635
01636                 // Enumerate the catalog
01637                 FreeProviders(pProvider);
01638
01639                 pProvider = EnumerateProviders(Catalog, &iProviderCount);
01640                 if (pProvider == NULL)
01641                 {
01642                     fprintf(stderr, "RemoveProvider: Unable to enumerate Winsock catalog!\n");
01643                     Status = SOCKET_ERROR;
01644                     goto cleanup;
01645                 }
01646
01647                 // Now go through and find the updated catalog entry IDs
01648                 MapNewEntriesToOld(&pLspMap[i], pProvider, iProviderCount);
01649
01650                 // Now update the LSP map to reference these new IDs instead of the old
01651                 for(j=0; j < pLspMap[i].Count ;j++)
01652                 {
01653                     UpdateLspMap(
01654                         pLspMap,
01655                         iLspCount,
01656                         pLspMap[i].LayeredEntries[j].dwCatalogEntryId,
01657                         pLspMap[i].LayeredEntries[j].dwProviderReserved,
01658                         pdwCatalogOrder,
01659                         iOriginalProviderCount
01660                         );
01661                 }
01662             }
01663
01664             // Now all the LSPs are back in place -- we need to reorder the catalog
01665             // back to the way it was
01666             #ifdef _WIN64
01667             if (Catalog == LspCatalog32Only)
01668             {
01669                 rc = WSCWriteProviderOrder32(pdwCatalogOrder, iProviderCount);
01670             }
01671             else
01672             {
01673                 rc = WSCWriteProviderOrder(pdwCatalogOrder, iProviderCount);
01674             }
01675             #else
01676                 rc = WSCWriteProviderOrder(pdwCatalogOrder, iProviderCount);
01677             #endif
01678             if (rc == SOCKET_ERROR)
01679             {
01680                 fprintf(stderr, "RemoveProvider: WSCWriteProviderOrder failed: %d\n", WSAGetLastError());
01681             }
01682
01683             printf("Catalog Order: ");
01684             for(i=0; i < iProviderCount ;i++)
01685             {
01686                 printf("%d ", pdwCatalogOrder[i]);
01687             }
01688             printf("\n");
01689
01690             // Free the catalog order info
01691             HeapFree(GetProcessHeap(), 0, pdwCatalogOrder);
01692             pdwCatalogOrder = NULL;
01693         }
01694     }
01695
01696 cleanup:
01697
01698     //
01699     // Cleanup allocations
01700     //
01701
01702     if (pLayeredEntries)
01703         HeapFree(GetProcessHeap(), 0, pLayeredEntries);
01704
01705     if (pProvider)
01706         FreeProviders(pProvider);
01707
01708     if (pdwRemovedProviders)
01709         HeapFree(GetProcessHeap(), 0, pdwRemovedProviders);
01710
01711     if (pLspMap)
01712         FreeLspMap(pLspMap, iLspCount);
01713
01714     if (pdwCatalogOrder)
01715         HeapFree(GetProcessHeap(), 0, pdwCatalogOrder);
01716
01717     return Status;
01718 }
01719
01720 //
01721 // Function: RemoveAllLayeredEntries
01722 //
01723 // Description:
01724 //    In the event that the layered entries become totally hosed up. This
01725 //    function will remove any non base provider.
01726 //
01727 int RemoveAllLayeredEntries(WINSOCK_CATALOG Catalog)
01728 {
01729     WSAPROTOCOL_INFOW   *pProviders=NULL,
01730                         *pAssociated=NULL;
01731     WCHAR                szGuidString[MAX_PATH];
01732     LSP_ENTRY           *pLspMap=NULL;
01733     INT                  iProviderCount,
01734                          iAssociatedCount,
01735                          iLspCount,
01736                          Status,
01737                          rc,
01738                          i, j, k;
01739
01740     Status = NO_ERROR;
01741
01742     // First enumerate the catalog
01743     pProviders = EnumerateProviders(Catalog, &iProviderCount);
01744     if (pProviders == NULL)
01745     {
01746         fprintf(stderr, "RemoveAllLayeredEntries: Unable to enumerate catalog!\n");
01747         Status = SOCKET_ERROR;
01748         goto cleanup;
01749     }
01750
01751     // Build a mapping of the LSPs installed on the system
01752     pLspMap = BuildLspMap(pProviders, iProviderCount, &iLspCount);
01753     if (pLspMap == NULL)
01754     {
01755         printf("\nNo LSPs to remove!\n");
01756     }
01757     else
01758     {
01759         printf("\n%d LSPs installed:\n", iLspCount);
01760         for(i=0; i < iLspCount ;i++)
01761         {
01762             printf("   %d: %ws with %d layered entries\n",
01763                 pLspMap[i].DummyEntry.dwCatalogEntryId, pLspMap[i].DummyEntry.szProtocol,
01764                 pLspMap[i].Count);
01765         }
01766
01767         printf("\nRemoving LSPs...\n\n");
01768
01769         for(i=0; i < iLspCount ;i++)
01770         {
01771             // First remove the dummy entry
01772             printf("Removing dummy entry for: %ws\n", pLspMap[i].DummyEntry.szProtocol);
01773             rc = DeinstallProvider(Catalog, &pLspMap[i].DummyEntry.ProviderId);
01774
01775             printf("Removing the associated layered entries with GUIDs:\n");
01776             for(j=0; j < pLspMap[i].LayeredGuidCount ;j++)
01777             {
01778                 StringFromGUID2(pLspMap[i].LayeredGuids[j], szGuidString, MAX_PATH-1);
01779                 printf("\tGUID: %ws\n", szGuidString);
01780
01781                 // Get a list of all providers under this GUID so we can print it out
01782                 pAssociated = GetLayeredEntriesByGuid(
01783                         pLspMap[i].LayeredEntries,
01784                         pLspMap[i].Count,
01785                        &pLspMap[i].LayeredGuids[j],
01786                        &iAssociatedCount
01787                         );
01788                 if (pAssociated == NULL)
01789                 {
01790                     fprintf(stderr, "RemoveAllLayeredProviders: GetLayeredEntriesByGuid failed!\n");
01791                     goto cleanup;
01792                 }
01793
01794                 for(k=0; k < iAssociatedCount ;k++)
01795                 {
01796                     printf("\t  %d: %ws\n", pAssociated[k].dwCatalogEntryId,
01797                             pAssociated[k].szProtocol);
01798                 }
01799
01800                 HeapFree(GetProcessHeap(), 0, pAssociated);
01801                 pAssociated = NULL;
01802
01803                 rc = DeinstallProvider(Catalog, &pLspMap[i].LayeredGuids[j]);
01804                 if (rc == SOCKET_ERROR)
01805                 {
01806                     fprintf(stderr, "RemoveAllLayeredProviders: DeinstallProvider failed!\n");
01807                 }
01808                 else
01809                 {
01810                     printf("\tUninstalled providers for %ws\n", szGuidString);
01811                 }
01812             }
01813         }
01814
01815         FreeLspMap(pLspMap, iLspCount);
01816         pLspMap = NULL;
01817     }
01818
01819 cleanup:
01820
01821     if (pProviders)
01822         FreeProviders(pProviders);
01823
01824     if (pLspMap)
01825         FreeLspMap(pLspMap, iLspCount);
01826
01827     if (pAssociated)
01828         HeapFree(GetProcessHeap(), 0, pAssociated);
01829
01830     return Status;
01831 }
01832
01833 //
01834 // Function: BuildLspMap
01835 //
01836 // Description:
01837 //    This routine builds a map of all LSPs installed according to what order
01838 //    they are in the catalog. That is, the information returned will be ordered
01839 //    in the way the LSPs need to be installed. For example if LSP1 is installed
01840 //    over the base TCP and UDP providers and LSP2 is installed over LSP1, then
01841 //    this routine will return two LSP_ENTRY structures with LSP1 first followed
01842 //    by LSP2. The algorithm for determining the order is to first sort by where
01843 //    a base provider ID occurs in an LSP chain with lower numbered ones first.
01844 //    For example, LSP1 layered directly over TCP will have a base ID (TCP) in
01845 //    chain position 1 while LSP (layered over LSP1) will have the base ID in
01846 //    chain index 2. This is the ChainOrder field (and it is the minimum value
01847 //    for all layered providers). After this first sort, it is possible to have
01848 //    several LSPs with the same ChainOrder value. Within these groupings the
01849 //    entries are sorted by the maximum LSP chain length. Each LSP has a number
01850 //    of layered providers each with its own chain (and the chains could be
01851 //    different lengths). The MaxChainLength value is the longest chain length
01852 //    of all providers belonging to a given LSP. Each grouping of LspOrder is then
01853 //    sorted by MaxChainLengthin ascending order.
01854 //
01855 LSP_ENTRY *
01856 BuildLspMap(
01857     WSAPROTOCOL_INFOW *pProviders,
01858     int  iProviderCount,
01859     int *pLspCount
01860     )
01861 {
01862     LSP_ENTRY *pLsps=NULL,
01863                lsptmp;
01864     DWORD     *pBaseList=NULL;
01865     BOOL       bFound;
01866     int        iLspCount=0,
01867                iBaseCount=0,
01868                iProviderPathLen,
01869                ErrorCode,
01870                LspOrder,
01871                start,
01872                end,
01873                idx,
01874                rc,
01875                i, j, k;
01876
01877     iLspCount = GetProviderCount(pProviders, iProviderCount, LAYERED_PROTOCOL);
01878
01879     if ( iLspCount == 0 )
01880     {
01881         // No LSPs installed, nothing to do
01882         goto cleanup;
01883     }
01884
01885     // Allocate space for our structure which represents the LSPs installed
01886     pLsps = (LSP_ENTRY *) HeapAlloc(
01887             GetProcessHeap(),
01888             HEAP_ZERO_MEMORY,
01889             sizeof(LSP_ENTRY) * iLspCount
01890             );
01891     if (pLsps == NULL)
01892     {
01893         fprintf(stderr, "BuildLspMap: HeapAlloc failed: %d\n", GetLastError());
01894         goto cleanup;
01895     }
01896
01897     idx = 0;
01898     for(i=0; i < iProviderCount ;i++)
01899     {
01900         if ( pProviders[i].ProtocolChain.ChainLen == LAYERED_PROTOCOL )
01901         {
01902             // Copy the dummy entry
01903             memcpy( &pLsps[idx].DummyEntry, &pProviders[i], sizeof(WSAPROTOCOL_INFOW) );
01904
01905             // Get the DLL path
01906             iProviderPathLen = MAX_PATH-1;
01907             rc = WSCGetProviderPath(
01908                     &pLsps[idx].DummyEntry.ProviderId,
01909                      pLsps[idx].wszLspDll,
01910                     &iProviderPathLen,
01911                     &ErrorCode
01912                     );
01913             if (rc == SOCKET_ERROR)
01914             {
01915                 fprintf(stderr, "BuildLspMap: WSCGetProviderPath failed: %d\n", ErrorCode);
01916                 goto cleanup;
01917             }
01918
01919             //
01920             // Now go find all the layered entries associated with the dummy provider
01921             //
01922
01923             // First get the count
01924             for(j=0; j < iProviderCount ;j++)
01925             {
01926                 if ( IsIdInChain( &pProviders[j], pLsps[idx].DummyEntry.dwCatalogEntryId ) )
01927                 {
01928                     pLsps[idx].Count++;
01929                 }
01930             }
01931
01932             // Allocate space
01933             pLsps[idx].LayeredEntries = (WSAPROTOCOL_INFOW *)HeapAlloc(
01934                     GetProcessHeap(),
01935                     HEAP_ZERO_MEMORY,
01936                     sizeof(WSAPROTOCOL_INFOW) * pLsps[idx].Count
01937                     );
01938             if (pLsps[idx].LayeredEntries == NULL)
01939             {
01940                 fprintf(stderr, "BuildLspMap: HeapAlloc failed: %d\n", GetLastError());
01941                 goto cleanup;
01942             }
01943
01944             // Now go find the entries
01945             pLsps[idx].Count = 0;
01946             for(j=0; j < iProviderCount ;j++)
01947             {
01948                 if ( IsIdInChain( &pProviders[j], pLsps[idx].DummyEntry.dwCatalogEntryId ) )
01949                 {
01950                     memcpy( &pLsps[idx].LayeredEntries[pLsps[idx].Count],
01951                             &pProviders[j],
01952                             sizeof(WSAPROTOCOL_INFOW)
01953                             );
01954
01955                     pLsps[idx].MaxChainLength = MAX(
01956                             pLsps[idx].MaxChainLength,
01957                             pLsps[idx].LayeredEntries[pLsps[idx].Count].ProtocolChain.ChainLen
01958                             );
01959
01960                     // Keep track of how many GUIDs are used to install the layered entries
01961                     if (pLsps[idx].Count == 0)
01962                     {
01963                         pLsps[idx].LayeredGuids = (GUID *)HeapAlloc(
01964                                 GetProcessHeap(),
01965                                 HEAP_ZERO_MEMORY,
01966                                 sizeof(GUID)
01967                                 );
01968                         if (pLsps[idx].LayeredGuids == NULL)
01969                         {
01970                             fprintf(stderr, "BuildLspMap: HeapAlloc failed: %d\n", GetLastError());
01971                             goto cleanup;
01972                         }
01973
01974                         memcpy( &pLsps[idx].LayeredGuids[0], &pProviders[j].ProviderId, sizeof(GUID) );
01975                         pLsps[idx].LayeredGuidCount++;
01976                     }
01977                     else
01978                     {
01979                         // See if we've already seen this guid
01980                         bFound = FALSE;
01981                         for(k=0; k < pLsps[idx].LayeredGuidCount ;k++)
01982                         {
01983                             if ( memcmp( &pLsps[idx].LayeredGuids[k],
01984                                          &pProviders[j].ProviderId,
01985                                          sizeof(GUID) ) == 0 )
01986                              {
01987                                 bFound = TRUE;
01988                                 break;
01989                              }
01990                         }
01991                         if (bFound == FALSE)
01992                         {
01993                             GUID    *tmpguid=NULL;
01994
01995                             // New GUID -- we need to add it to the array
01996                             tmpguid = (GUID *)HeapAlloc(
01997                                     GetProcessHeap(),
01998                                     HEAP_ZERO_MEMORY,
01999                                     sizeof(GUID) * (pLsps[idx].LayeredGuidCount + 1)
02000                                     );
02001                             if (tmpguid == NULL)
02002                             {
02003                                 fprintf(stderr, "BuildLspMap: HeapAlloc failed: %d\n", GetLastError());
02004                                 goto cleanup;
02005                             }
02006
02007                             memcpy( tmpguid, pLsps[idx].LayeredGuids, sizeof(GUID) * pLsps[idx].LayeredGuidCount );
02008                             memcpy( &tmpguid[pLsps[idx].LayeredGuidCount], &pProviders[j].ProviderId, sizeof(GUID) );
02009
02010                             HeapFree(GetProcessHeap(), 0, pLsps[idx].LayeredGuids);
02011
02012                             pLsps[idx].LayeredGuids = tmpguid;
02013                             pLsps[idx].LayeredGuidCount++;
02014                         }
02015                     }
02016
02017                     pLsps[idx].Count++;
02018
02019                 }
02020             }
02021
02022             pLsps[idx].LspOrder = MAX_PROTOCOL_CHAIN;
02023
02024             idx++;
02025         }
02026     }
02027
02028     //
02029     // We now have an array of "LSPs" -- now order them
02030     //
02031
02032     // First get a list of base provider IDs
02033     iBaseCount = GetProviderCount(pProviders, iProviderCount, BASE_PROTOCOL);
02034     if (iBaseCount == 0)
02035     {
02036         fprintf(stderr, "BuildLspMap: GetProviderCount(BASE_PROTOCOL) returned zero!\n");
02037         goto cleanup;
02038     }
02039
02040     // Allocate space for the array of base provider ID's
02041     pBaseList = (DWORD *) HeapAlloc(
02042             GetProcessHeap(),
02043             HEAP_ZERO_MEMORY,
02044             sizeof(DWORD) * iBaseCount
02045             );
02046     if (pBaseList == NULL)
02047     {
02048         fprintf(stderr, "BuildLspMap: HeapAlloc failed: %d\n", GetLastError());
02049         goto cleanup;
02050     }
02051
02052     // Copy the base provider ID's to our array
02053     idx = 0;
02054     for(i=0; i < iProviderCount ;i++)
02055     {
02056         if ( pProviders[i].ProtocolChain.ChainLen == BASE_PROTOCOL )
02057         {
02058             pBaseList[idx++] = pProviders[i].dwCatalogEntryId;
02059         }
02060     }
02061
02062     for(LspOrder = 1; LspOrder < MAX_PROTOCOL_CHAIN ;LspOrder++)
02063     {
02064         for(i=0; i < iLspCount ;i++)
02065         {
02066             for(j=0; j < pLsps[i].Count ;j++)
02067             {
02068                 for(k=0; k < iBaseCount ;k++)
02069                 {
02070                     if ( pLsps[i].LayeredEntries[j].ProtocolChain.ChainEntries[LspOrder] ==
02071                          pBaseList[k] )
02072                     {
02073                         pLsps[i].LspOrder = MIN( pLsps[i].LspOrder, LspOrder );
02074                         break;
02075                     }
02076                 }
02077             }
02078         }
02079     }
02080
02081     // Sort the entries according to the LspOrder field
02082     for(i=0; i < iLspCount ;i++)
02083     {
02084         for(j=i; j < iLspCount ;j++)
02085         {
02086             if ( pLsps[i].LspOrder > pLsps[j].LspOrder )
02087             {
02088                 // Exchange positions
02089                 memcpy( &lsptmp,   &pLsps[i], sizeof(LSP_ENTRY) );
02090                 memcpy( &pLsps[i], &pLsps[j], sizeof(LSP_ENTRY) );
02091                 memcpy( &pLsps[j], &lsptmp,   sizeof(LSP_ENTRY) );
02092             }
02093         }
02094     }
02095
02096     // Now need to sort by MaxChainLength withing the LspOrder groupings
02097
02098     for(LspOrder=1; LspOrder < MAX_PROTOCOL_CHAIN ;LspOrder++)
02099     {
02100         // Find the start and end positions within the array for the given
02101         // LspOrder value
02102         start = -1;
02103         end   = -1;
02104         for(i=0; i < iLspCount ;i++)
02105         {
02106             if ( pLsps[i].LspOrder == LspOrder)
02107             {
02108                 start = i;
02109                 break;
02110             }
02111         }
02112         if (start != -1)
02113         {
02114             for(j=start; j < iLspCount ;j++)
02115             {
02116                 if ( pLsps[j].LspOrder != LspOrder)
02117                 {
02118                     end = j-1;
02119                     break;
02120                 }
02121             }
02122         }
02123
02124         if ( (start != -1) && (end != -1) )
02125         {
02126             for(i=start; i < end ;i++)
02127             {
02128                 for(j=i; j < end ;j++)
02129                 {
02130                     if ( pLsps[i].MaxChainLength > pLsps[j].MaxChainLength )
02131                     {
02132                         memcpy( &lsptmp,   &pLsps[i], sizeof(LSP_ENTRY) );
02133                         memcpy( &pLsps[i], &pLsps[j], sizeof(LSP_ENTRY) );
02134                         memcpy( &pLsps[j], &lsptmp,   sizeof(LSP_ENTRY) );
02135                     }
02136                 }
02137             }
02138         }
02139     }
02140
02141
02142 cleanup:
02143
02144     if (pLspCount)
02145         *pLspCount = iLspCount;
02146
02147     if (pBaseList)
02148         HeapFree(GetProcessHeap(), 0, pBaseList);
02149
02150     return pLsps;
02151 }
02152
02153 //
02154 // Function: GetProviderCount
02155 //
02156 // Description:
02157 //    Returns the number of providers installed matching the given Provider Type.
02158 //    The possible provider types are BASE_PROTOCOL or LAYERED_PROTOCOL. That is,
02159 //    this function either returns the count of base providers or the number of
02160 //    dummy LSP providers installed.
02161 //
02162 int
02163 GetProviderCount(
02164     WSAPROTOCOL_INFOW *pProviders,
02165     int iProviderCount,
02166     int ProviderType
02167     )
02168 {
02169     int Count, i;
02170
02171     Count = 0;
02172     for(i=0; i < iProviderCount ;i++)
02173     {
02174         if ( pProviders[i].ProtocolChain.ChainLen == ProviderType )
02175             Count++;
02176     }
02177     return Count;
02178 }
02179
02180 //
02181 // Function: PrintLspMap
02182 //
02183 // Description:
02184 //    Print the array of LSP_ENTRY structures to the console. The LSP_ENTRY
02185 //    array is ordered in the same order the LSPs were installed.
02186 //
02187 void
02188 PrintLspMap(
02189     LSP_ENTRY *pLspMap,
02190     int iLspCount
02191     )
02192 {
02193     WCHAR   szGuidString[MAX_PATH];
02194     int     i, j, k;
02195
02196     if (pLspMap == NULL)
02197     {
02198         printf("\tNo LSPs currently installed\n\n");
02199     }
02200     else
02201     {
02202         for(i=0; i < iLspCount ;i++)
02203         {
02204             // Display the LSP name and its DLL (and path)
02205             printf("%3d LSP: %ws   DLL '%ws'\n", i, pLspMap[i].DummyEntry.szProtocol,
02206                 pLspMap[i].wszLspDll);
02207
02208             // Display the GUIDs under which the layered entries of this LSP are installed
02209             printf("\t LSP Installed under %d GUIDs\n", pLspMap[i].LayeredGuidCount);
02210             for(k=0; k < pLspMap[i].LayeredGuidCount ;k++)
02211             {
02212                 StringFromGUID2(pLspMap[i].LayeredGuids[k], szGuidString, MAX_PATH-1);
02213                 printf("\t\t%ws\n", szGuidString);
02214             }
02215
02216             // Display the layered entries and the protocol chains
02217             for(j=0; j < pLspMap[i].Count ;j++)
02218             {
02219                 printf("\t Layer %ws Chain %d [ ", pLspMap[i].LayeredEntries[j].szProtocol,
02220                     pLspMap[i].LayeredEntries[j].ProtocolChain.ChainLen);
02221
02222                 for(k=0; k < pLspMap[i].LayeredEntries[j].ProtocolChain.ChainLen ;k++)
02223                 {
02224                     printf("%d ", pLspMap[i].LayeredEntries[j].ProtocolChain.ChainEntries[k]);
02225                 }
02226                 printf("]\n");
02227             }
02228         }
02229     }
02230 }
02231
02232 //
02233 // Function: FreeLspMap
02234 //
02235 // Description:
02236 //    Frees all memory associated with an LSP_ENTRY array.
02237 void
02238 FreeLspMap(
02239     LSP_ENTRY *pLspMap,
02240     int iLspCount
02241     )
02242 {
02243     int     i;
02244
02245     for(i=0; i < iLspCount ;i++)
02246     {
02247         // Free the layered providers first
02248         if ( pLspMap[i].LayeredEntries != NULL )
02249             HeapFree(GetProcessHeap(), 0, pLspMap[i].LayeredEntries);
02250         if ( pLspMap[i].LayeredGuids != NULL )
02251             HeapFree(GetProcessHeap(), 0, pLspMap[i].LayeredGuids);
02252     }
02253     HeapFree(GetProcessHeap(), 0, pLspMap);
02254 }
02255
02256 //
02257 // Function: PruneLspMap
02258 //
02259 // Description:
02260 //    In the event WSCUpdateProvider is not available, the uninstaller must
02261 //    remove and reinstall all dependent LSPs. After the LSP is removed, this
02262 //    routine goes through the LSP map and removes any reference to provider
02263 //    IDs belonging to the removed LSP (both base and layered provider IDs).
02264 //    The pdwRemovedProviders is an array of provider IDs that belong to the
02265 //    removed LSP.
02266 //
02267 void
02268 PruneLspMap(
02269     LSP_ENTRY *pLspMap,
02270     int iLspCount,
02271     DWORD *pdwRemovedProviders,
02272     int iRemoveCount
02273     )
02274 {
02275     int i, j, k;
02276
02277     // Go through all LSPs
02278     for(i=0; i < iLspCount ;i++)
02279     {
02280         // Go through all providers belonging to this LSP
02281         for(j=0; j < pLspMap[i].Count ;j++)
02282         {
02283             // Search for a removed provider
02284             for(k=0; k < iRemoveCount ;k++)
02285             {
02286                 RemoveIdFromChain(&pLspMap[i].LayeredEntries[j], pdwRemovedProviders[k]);
02287             }
02288         }
02289     }
02290 }
02291
02292 //
02293 // Function: UpdateLspMap
02294 //
02295 // Description:
02296 //   This routine updates catalog entry IDs in the LSP map. In the event
02297 //   WSCUpdateProvider is not available, the uninstaller must remove all
02298 //   dependent LSPs and reinstall them. This requires updating any references
02299 //   to these reinstalled LSPs to their new values (as reinstalling a provider
02300 //   changes the catalog ID). After a provider is LSP, the uninstaller matches
02301 //   the older provider to the new to obtain the new provider ID (via
02302 //   MapNewEntriesToOld). This routine takes and old provider ID and updates all
02303 //   references within the LSP map to the new provider's ID.
02304 //
02305 void
02306 UpdateLspMap(
02307     LSP_ENTRY *pLspMap,
02308     int iLspCount,
02309     DWORD dwOldValue,
02310     DWORD dwNewValue,
02311     DWORD *pdwCatalogOrder,
02312     int iProviderCount
02313     )
02314 {
02315     int i, j, k;
02316
02317     // Update the LSP_ENTRY mappings with the new value
02318     for(i=0; i < iLspCount ;i++)
02319     {
02320         // Go through all providers beloging to this LSP
02321         for(j=0; j < pLspMap[i].Count ;j++)
02322         {
02323             // Go through the protocol chain and update references if they match
02324             for(k=0; k < pLspMap[i].LayeredEntries[j].ProtocolChain.ChainLen ;k++)
02325             {
02326                 if (pLspMap[i].LayeredEntries[j].ProtocolChain.ChainEntries[k] == dwOldValue)
02327                 {
02328                     pLspMap[i].LayeredEntries[j].ProtocolChain.ChainEntries[k] = dwNewValue;
02329                 }
02330             }
02331         }
02332     }
02333
02334     // Update the provider order mapping
02335     for(i=0; i < iProviderCount ;i++)
02336     {
02337         if (pdwCatalogOrder[i] == dwOldValue)
02338             pdwCatalogOrder[i] =  dwNewValue;
02339     }
02340 }
02341
02342 //
02343 // Function: GetLayeredEntriesByGuid
02344 //
02345 // Description:
02346 //    This routine is used by the uninstaller when WSCUpdateProvider is not
02347 //    available. If after an LSP is removed, there are other LSPs which depend
02348 //    on that LSP, the uninstaller must remove and reinstall all LSPs and fix up
02349 //    the catalog ID references within the protocol chain. This routine is used
02350 //    when reinstalling LSP providers. Because the layered entries belonging to
02351 //    an LSP may be installed either under unique (individual) GUIDs or whole
02352 //    groups of providers may be installed under the same GUID. This routine
02353 //    Takes an array of WSAPROTOCOL_INFOW entries belonging to one LSP and
02354 //    returns an array of provider structures which match the given GUID.
02355 //
02356 WSAPROTOCOL_INFOW *
02357 GetLayeredEntriesByGuid(
02358     WSAPROTOCOL_INFOW *pEntries,
02359     int iEntryCount,
02360     GUID *MatchGuid,
02361     int *iLayeredCount
02362     )
02363 {
02364     WSAPROTOCOL_INFOW *MatchedEntries=NULL;
02365     int                count,
02366                        i;
02367
02368     // First count how many entries belong to this GUID
02369     count = 0;
02370     for(i=0; i < iEntryCount ;i++)
02371     {
02372         if ( memcmp( MatchGuid, &pEntries[i].ProviderId, sizeof(GUID)) == 0 )
02373         {
02374             count++;
02375         }
02376     }
02377
02378     // Allocate space for the number of matching provider entries
02379     MatchedEntries = (WSAPROTOCOL_INFOW *)HeapAlloc(
02380             GetProcessHeap(),
02381             HEAP_ZERO_MEMORY,
02382             sizeof(WSAPROTOCOL_INFOW) * count
02383             );
02384     if (MatchedEntries == NULL)
02385     {
02386         fprintf(stderr, "GetLayeredEntriesByGuid: HeapAlloc failed: %d\n", GetLastError());
02387         return NULL;
02388     }
02389
02390     // Go back and copy the matching providers into our array
02391     count = 0;
02392     for(i=0; i < iEntryCount ;i++)
02393     {
02394         if ( memcmp( MatchGuid, &pEntries[i].ProviderId, sizeof(GUID)) == 0 )
02395         {
02396             memcpy( &MatchedEntries[count++], &pEntries[i], sizeof(WSAPROTOCOL_INFOW) );
02397         }
02398     }
02399
02400     // Update the return count
02401     if (iLayeredCount)
02402         *iLayeredCount = count;
02403
02404     return MatchedEntries;
02405 }
02406
02407 //
02408 // Function: MapNewEntriesToOld
02409 //
02410 // Description:
02411 //    This routine is used by the uninstaller if WSCUpdateProvider is not available.
02412 //    In this case, after one LSP is removed there may be others that referenced
02413 //    that LSP. The uninstaller removes those entries and reinstalls them (and
02414 //    removes the reference the the removed LSP). Once a dependent provider is
02415 //    reinstalled we need to see if even other LSP references the reinstalled
02416 //    provider and if so we need to update all references (catalog IDs) to that
02417 //    LSP. This routine takes the Winsock catalog after a dependent LSP has
02418 //    been resinstalled (pProvider and iProviderCount) and matches the newly
02419 //    installed providers back to the LSP map we started with. This is so we
02420 //    can get the older catalog ID along with the new catalog ID of each LSP
02421 //    entry.
02422 //
02423 void
02424 MapNewEntriesToOld(
02425     LSP_ENTRY *pEntry,
02426     WSAPROTOCOL_INFOW *pProvider,
02427     int iProviderCount
02428     )
02429 {
02430     int     i, j;
02431
02432     for(i=0; i < pEntry->Count ;i++)
02433     {
02434         for(j=0; j < iProviderCount ;j++)
02435         {
02436             if ( IsEqualProtocolEntries( &pEntry->LayeredEntries[i], &pProvider[j] ) )
02437             {
02438                 pEntry->LayeredEntries[i].dwProviderReserved = pProvider[j].dwCatalogEntryId;
02439                 break;
02440             }
02441         }
02442     }
02443 }
02444
02445 //
02446 // Function: IsEqualProtocolEntries
02447 //
02448 // Description:
02449 //    This routine compares two WSAPROTOCOL_INFOW structures to determine
02450 //    whether they are equal. This is done when a provider is uninstalled
02451 //    and then reinstalled. After reinstallation we need to match the old
02452 //    provider to the new (after reenumerating the catalog) so we can find
02453 //    its new catalog ID. The fields used for determining a match are all
02454 //    fields except the catalog ID (dwCatalogEntryId) and the protocol
02455 //    string (szProtocol).
02456 //
02457 BOOL
02458 IsEqualProtocolEntries(
02459     WSAPROTOCOL_INFOW *pInfo1,
02460     WSAPROTOCOL_INFOW *pInfo2
02461     )
02462 {
02463     if ( (memcmp(&pInfo1->ProviderId, &pInfo2->ProviderId, sizeof(GUID)) == 0) &&
02464          (pInfo1->dwServiceFlags1 == pInfo2->dwServiceFlags1) &&
02465          (pInfo1->dwServiceFlags2 == pInfo2->dwServiceFlags2) &&
02466          (pInfo1->dwServiceFlags3 == pInfo2->dwServiceFlags3) &&
02467          (pInfo1->dwServiceFlags4 == pInfo2->dwServiceFlags4) &&
02468          (pInfo1->ProtocolChain.ChainLen == pInfo2->ProtocolChain.ChainLen) &&
02469          (pInfo1->iVersion == pInfo2->iVersion) &&
02470          (pInfo1->iAddressFamily == pInfo2->iAddressFamily) &&
02471          (pInfo1->iMaxSockAddr == pInfo2->iMaxSockAddr) &&
02472          (pInfo1->iMinSockAddr == pInfo2->iMinSockAddr) &&
02473          (pInfo1->iSocketType == pInfo2->iSocketType) &&
02474          (pInfo1->iProtocol == pInfo2->iProtocol) &&
02475          (pInfo1->iProtocolMaxOffset == pInfo2->iProtocolMaxOffset) &&
02476          (pInfo1->iNetworkByteOrder == pInfo2->iNetworkByteOrder) &&
02477          (pInfo1->iSecurityScheme == pInfo2->iSecurityScheme) &&
02478          (pInfo1->dwMessageSize == pInfo2->dwMessageSize)
02479        )
02480     {
02481         return TRUE;
02482     }
02483     else
02484     {
02485         return FALSE;
02486     }
02487 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows.Net/pch.cpp Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows.Net

pch.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        pch.cpp
00007 //
00008 // Contents:    Cert Server precompiled header
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include <windows.h>
00013
00014 #include <atlbase.h>
00015
00016 //You may derive a class from CComModule and use it if you want to override
00017 //something, but do not change the name of _Module
00018 extern CComModule _Module;
00019
00020 #include <atlcom.h>
00021 #include <certsrv.h>
00022
00023 #define wszCLASS_CERTPOLICYSAMPLEPREFIX TEXT("CertAuthority_Sample")
00024
00025 #define wszCLASS_CERTPOLICYSAMPLE wszCLASS_CERTPOLICYSAMPLEPREFIX  wszCERTPOLICYMODULE_POSTFIX
00026
00027 #define wszCLASS_CERTMANAGEPOLICYMODULESAMPLE wszCLASS_CERTPOLICYSAMPLEPREFIX wszCERTMANAGEPOLICY_POSTFIX
00028
00029 #define wsz_SAMPLE_NAME           L"Sample/Test Policy Module"
00030 #define wsz_SAMPLE_DESCRIPTION    L"Sample Policy Module"
00031 #define wsz_SAMPLE_COPYRIGHT      L"(c)2000 Microsoft"
00032 #define wsz_SAMPLE_FILEVER        L"v 1.0"
00033 #define wsz_SAMPLE_PRODUCTVER     L"v 5.00"
00034
00035 #pragma hdrstop
00036
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllUser/DllUser.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllUser

DllUser.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DLLUSER.H
00003
00004   Summary:   Include file for the DLLUSER skeleton code sample application.
00005              In addition to class definitions, this DLLUSER.H file contains
00006              definitions of the application's menu, string, and other
00007              resource IDs.
00008
00009              Based largely on the EXESKEL.EXE source code, this include
00010              file adds resource IDs for a new Test menu for exercising
00011              the exported function calls provided by DLLSKEL.DLL.
00012
00013              For a comprehensive tutorial code tour of DLLUSER's
00014              contents and offerings see the tutorial DLLUSER.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the DLLUSER source code.
00017
00018   Classes:   CMainWindow
00019
00020   Functions: WinMain
00021
00022   Origin:    8-3-95: atrent - Editor-inheritance from the EXESKEL source.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 #if !defined(DLLUSER_H)
00040 #define DLLUSER_H
00041
00042 #if defined(__cplusplus)
00043
00044 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00045   Class:    CMainWindow
00046
00047   Summary:  Class to encapsulate the application's main window, menu, and
00048             message dispatching behavior.
00049
00050   Methods:  CMainWindow
00051               Constructor.
00052             InitInstance
00053               Creates a new instance of the main window.
00054 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00055 class CMainWindow: public CVirWindow
00056 {
00057 public:
00058   CMainWindow();
00059   ~CMainWindow();
00060   BOOL InitInstance(HINSTANCE, int);
00061
00062   TCHAR m_szFileName[MAX_PATH];
00063   CMsgBox* m_pMsgBox;
00064
00065 protected:
00066   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00067
00068 private:
00069   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00070
00071   WORD m_wWidth;
00072   WORD m_wHeight;
00073   TCHAR m_szHelpFile[MAX_PATH];
00074   TCHAR m_szFileTitle[MAX_PATH];
00075   TEXTMETRIC m_tm;
00076   OPENFILENAME m_ofnFile;
00077 };
00078
00079 #endif // __cplusplus
00080
00081
00082 // Window Class String Macros.
00083 #define MAIN_WINDOW_TITLE_STR       "DLLUSER: Tutorial Code Sample"
00084 #define MAIN_WINDOW_CLASS_NAME_STR  "DLLUSERWindow"
00085 #define MAIN_WINDOW_CLASS_MENU_STR  "DLLUSERMenu"
00086
00087 // File Name String Macros.
00088 #define DLL_TUTFILE_STR             "dllskel.htm"
00089
00090 // OpenFile-related String Macros.
00091 #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
00092 #define OFN_DEFAULTTITLE_STR "Open File"
00093
00094 // File Menu Command Identifiers.
00095 #define IDM_FILE_EXIT               1000
00096
00097 // Test Menu Command Identifiers.
00098 #define IDM_TEST_DLLHELLO           1800
00099 #define IDM_TEST_DLLABOUT           1801
00100
00101 // Help Menu Command Identifiers.
00102 #define IDM_HELP_CONTENTS           1900
00103 #define IDM_HELP_TUTORIAL           1901
00104 #define IDM_HELP_TUTDLL             1902
00105 #define IDM_HELP_READSOURCE         1903
00106 #define IDM_HELP_ABOUT              1904
00107
00108 // Error-related String Identifiers.
00109 #define IDS_COMINITFAILED           2000
00110 #define IDS_APPINITFAILED           2001
00111 #define IDS_OUTOFMEMORY             2002
00112 #define IDS_UNICODEFAIL             2003
00113
00114 #define IDS_ASSERT_FAIL             2200
00115
00116 // Notice-related String Identifiers.
00117 #define IDS_NOTIMPLEMENTED          2301
00118
00119 #endif
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DebugGlobals Member List

This is the complete list of members for DebugGlobals, including all inherited members.
hrLastError | DebugGlobals
iLine | DebugGlobals
psFile | DebugGlobals
sLastError | DebugGlobals
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/utilprop.h Source File

  • Dataaccess
  • oledb
  • sampprov

utilprop.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module UTILPROP.H | CUtilProp object definitions
00008 //
00009 //
00010 #ifndef _UTILPROP_H_
00011 #define _UTILPROP_H_
00012
00013
00014 //-----------  structs and #defines -------------------------------------------
00015
00016 // @struct PROPSTRUCT  | simple table used to store property information. Used in
00017 // our read-only implementation of IDBProperties::GetPropertyInfo and IRowsetInfo::GetProperties
00018 typedef struct _tagPROPSTRUCT
00019     {
00020     DBPROPID  dwPropertyID;
00021   DBPROPFLAGS dwFlags;
00022     VARTYPE     vtType;
00023     BOOL        boolVal;
00024 #ifdef _WIN64
00025     LONGLONG    longVal;
00026 #else
00027     SLONG       longVal;
00028 #endif
00029     PWSTR       pwstrVal;
00030     PWSTR   pwstrDescBuffer;
00031     } PROPSTRUCT;
00032
00033
00034 // Number of supported properties per property set
00035 #define NUMBER_OF_SUPPORTED_PROPERTY_SETS 4
00036
00037 // Sart of Each PropertySet in the Static Structure
00038 #define START_OF_SUPPORTED_ROWSET_PROPERTIES        0
00039
00040 #define START_OF_SUPPORTED_SESSION_PROPERTIES       NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES
00041
00042 #define START_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES    (NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES +    \
00043                                NUMBER_OF_SUPPORTED_SESSION_PROPERTIES)
00044
00045 #define START_OF_SUPPORTED_DBINIT_PROPERTIES        (NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES +    \
00046                                NUMBER_OF_SUPPORTED_SESSION_PROPERTIES +   \
00047                                NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES)
00048
00049 // Number of properties in each set
00050 #define NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES        3
00051 #define NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES    8
00052 #define NUMBER_OF_SUPPORTED_SESSION_PROPERTIES         1
00053 #define NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES       15
00054 #define NUMBER_OF_SUPPORTED_PROPERTIES            (NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES +     \
00055                                NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES + \
00056                                NUMBER_OF_SUPPORTED_SESSION_PROPERTIES +    \
00057                                NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES)
00058
00059 // description size
00060 #define CCH_GETPROPERTYINFO_DESCRIP_BUFFER_SIZE 25
00061
00062 // flags for Get and Set Properties
00063 const DWORD   PROPSET_DSO   = 0x0001;
00064 const DWORD   PROPSET_INIT  = 0x0002;
00065 const DWORD   PROPSET_DSOINIT = PROPSET_DSO | PROPSET_INIT;
00066 const DWORD   PROPSET_SESSION = 0x0004;
00067 const DWORD   PROPSET_ROWSET  = 0x0008;
00068
00069 // Classes -------------------------------------------------------------------
00070
00071 //----------------------------------------------------------------------------
00072 // @class CUtilProp | Containing class for all interfaces on the UtilProp
00073 // Object
00074 //
00075 class CUtilProp
00076 {
00077   protected: //@access protected
00078     PROPSTRUCT  m_rgproperties[NUMBER_OF_SUPPORTED_PROPERTIES];
00079     WCHAR   m_wszFilePath[MAX_PATH];
00080
00081     //@cmember Gets index of entry for a given property in global property table
00082         BOOL GetPropIndex
00083           (
00084             DBPROPID  dwPropertyID,
00085         ULONG*    pulIndex
00086           );
00087
00088         //@cmember Loads fields of DBPROPINFO struct. Helper for GetPropertyInfo
00089         void LoadDBPROPINFO
00090             (
00091         PROPSTRUCT*   pPropStruct,
00092         DBPROPINFO*   pPropInfo
00093             );
00094
00095         //@cmember Loads fields of DBPROP struct. Helper for GetProperties
00096         HRESULT LoadDBPROP
00097             (
00098         PROPSTRUCT* pPropStruct,
00099         DBPROP*   pPropSupport
00100             );
00101
00102         //@cmember Checks to see if the value is valid. Helper for SetProperties
00103     HRESULT IsValidValue
00104       (
00105       DBPROP*   pDBProp
00106       );
00107
00108   public: //@access public
00109     //@cmember Constructor
00110      CUtilProp(void);
00111     //@cmember Destructor
00112     ~CUtilProp(void);
00113
00114     static HRESULT CUtilProp::GetPropertiesArgChk
00115       (
00116       DWORD         dwBitMask,
00117       const ULONG       cPropertySets,
00118       const DBPROPIDSET   rgPropertySets[],
00119       ULONG*          pcProperties,
00120       DBPROPSET**       prgProperties
00121       );
00122
00123     STDMETHODIMP GetProperties
00124         (
00125         DWORD       dwBitMask,
00126           ULONG       cPropertySets,
00127           const DBPROPIDSET rgPropertySets[],
00128           ULONG*              pcProperties,
00129           DBPROPSET**     prgProperties
00130         );
00131
00132     STDMETHODIMP GetPropertyInfo
00133         (
00134         BOOL        fDSOInitialized,
00135           ULONG       cPropertySets,
00136           const DBPROPIDSET rgPropertySets[],
00137         ULONG*        pcPropertyInfoSets,
00138         DBPROPINFOSET**   prgPropertyInfoSets,
00139         WCHAR**       ppDescBuffer
00140         );
00141
00142     static HRESULT  SetPropertiesArgChk
00143       ( const ULONG     cProperties,
00144         const DBPROPSET   rgProperties[]
00145       );
00146
00147     STDMETHODIMP SetProperties
00148       (
00149         DWORD       dwBitMask,
00150         ULONG       cProperties,
00151         DBPROPSET     rgProperties[]
00152       );
00153
00154 };
00155
00156 typedef CUtilProp *PCUTILPROP;
00157
00158 #endif
00159
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Create/vc/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Create
  • vc

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__92AAB1B0_AF37_11D2_9A73_0080C7A2DC6B__INCLUDED_)
00007 #define AFX_STDAFX_H__92AAB1B0_AF37_11D2_9A73_0080C7A2DC6B__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00013
00014 // TODO: reference additional headers your program requires here
00015
00016 //{{AFX_INSERT_LOCATION}}
00017 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00018
00019 #endif // !defined(AFX_STDAFX_H__92AAB1B0_AF37_11D2_9A73_0080C7A2DC6B__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/EventCallback.h Source File

  • Multimedia
  • wia
  • GetImage

EventCallback.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #ifndef __EVENTCALLBACK__
00008 #define __EVENTCALLBACK__
00009
00010 namespace WiaWrap
00011 {
00012
00013 //////////////////////////////////////////////////////////////////////////
00014 //
00015 // CEventCallback
00016 //
00017
00018 /*++
00019
00020     CEventCallback implements a WIA event callback object that maintains
00021     the count of WIA devices on the system. Upon initialization, the object
00022     gets the current number of WIA devices on the system and registers itself
00023     for the connect and disconnect events, so when new devices are added or
00024     removed from the system, the object maintains the current device count.
00025
00026 Methods
00027
00028     CEventCallback
00029         Initializes the object
00030
00031     ImageEventCallback
00032         This method is called when a connect or disconnect event occurs.
00033         In either case, this method queries the current device count.
00034
00035     Register
00036         Sets the initial device count and register for the connect and
00037         disconnect events.
00038
00039     GetNumDevices
00040         Returns the number of WIA devices on the system.
00041
00042 --*/
00043
00044 class CEventCallback : public IWiaEventCallback
00045 {
00046 public:
00047     CEventCallback();
00048
00049     // IUnknown interface
00050
00051     STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppvObj);
00052     STDMETHOD_(ULONG, AddRef)();
00053     STDMETHOD_(ULONG, Release)();
00054
00055     // IWiaEventCallback interface
00056
00057     STDMETHOD(ImageEventCallback)(
00058         LPCGUID pEventGuid,
00059         BSTR    bstrEventDescription,
00060         BSTR    bstrDeviceID,
00061         BSTR    bstrDeviceDescription,
00062         DWORD   dwDeviceType,
00063         BSTR    bstrFullItemName,
00064         ULONG  *pulEventType,
00065         ULONG   ulReserved
00066     );
00067
00068     // CEventCallback methods
00069
00070     HRESULT Register();
00071
00072     ULONG GetNumDevices() const;
00073
00074 private:
00075     LONG               m_cRef;
00076     ULONG              m_nNumDevices;
00077     CComPtr<IUnknown>  m_pConnectEventObject;
00078     CComPtr<IUnknown>  m_pDisconnectEventObject;
00079 };
00080
00081 }; // namespace WiaWrap
00082
00083 #endif //__EVENTCALLBACK__
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/MultiReco/resource.h Source File

  • TabletPC
  • MultiReco

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by MultiReco.rc
00004 //
00005 #define IDR_APPICON                     50
00006 #define IDR_MENU                        101
00007 #define ID_RECOGNIZER_FIRST             40000
00008 #define ID_RECOGNIZER_LAST              40099
00009 #define ID_FILE_NEW                     40100
00010 #define ID_FILE_OPEN                    40101
00011 #define ID_FILE_SAVE                    40102
00012 #define ID_FILE_SAVEAS                  40103
00013 #define ID_FILE_EXIT                    40104
00014 #define ID_CLEAR                        40105
00015
00016 // Next default values for new objects
00017 //
00018 #ifdef APSTUDIO_INVOKED
00019 #ifndef APSTUDIO_READONLY_SYMBOLS
00020 #define _APS_NEXT_RESOURCE_VALUE        104
00021 #define _APS_NEXT_COMMAND_VALUE         40106
00022 #define _APS_NEXT_CONTROL_VALUE         1000
00023 #define _APS_NEXT_SYMED_VALUE           101
00024 #endif
00025 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

UnionInt64 Member List

This is the complete list of members for UnionInt64, including all inherited members.
i | UnionInt64
l | UnionInt64
n | UnionInt64
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/staticnode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

staticnode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CStaticNode class.  This is the Snap-in's
00014 //                top level node
00015 //
00016
00017
00018 #ifndef _CLASS_CSTATICNODE_
00019 #define _CLASS_CSTATICNODE_
00020
00021 #include "Globals.h"
00022 #include "BaseNode.h"
00023
00024
00025 class CComponentData;        // References
00026
00027 //---------------------------------------------------------------------------
00028 class CStaticNode : public CBaseNode
00029 {
00030   public:
00031     CStaticNode();
00032     virtual ~CStaticNode();
00033
00034     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00035
00036
00037   // Virtual methods
00038   public:
00039     ULONG   GetNodeType() { return NODETYPE_STATIC; }
00040     GUID*   GetNodeGUID() { return &thisGUID; }
00041
00042     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00043     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00044     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00045
00046   ///////////////////////////////////////////////////////////////////////////
00047   // Notification handlers
00048   public:
00049     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00050             { return E_NOTIMPL; }
00051
00052     HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00053             { return E_NOTIMPL; }
00054
00055   private:
00056     static GUID      thisGUID;
00057     CComponentData*  m_pCompData;
00058
00059 };
00060
00061 #endif //_CLASS_CSTATICNODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

perf Member List

This is the complete list of members for perf, including all inherited members.
sec | perf
szTest | perf
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/ViewDIB/OpenDIB.c Source File

  • Multimedia
  • Gdi
  • ViewDIB

OpenDIB.c

Go to the documentation of this file.
00001 /*******************************************************************************
00002  *                                                                             *
00003  *  MODULE      : OpenDIB.C                                                   *
00004  *                                                                             *
00005  *  DESCRIPTION : Routines for managing file open/save dialog                  *
00006  *                                                                             *
00007  *                                                                             *
00008  ******************************************************************************/
00009
00010 #include <windows.h>
00011 #include <stdio.h>
00012 #include <commdlg.h>
00013 #define IDC_IMAGE     1061
00014 #define IDC_FILEINFO  1062
00015 #define IDC_LOCATION  1119
00016
00017 LRESULT CALLBACK PreviewWindowHookProc(HWND, UINT, WPARAM, LPARAM);
00018
00019 // ****** Code for managing on-the-fly dialog template creation ******
00020
00021 int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn, int size)
00022 {
00023   int cchAnsi = lstrlen(lpAnsiIn);
00024
00025   return MultiByteToWideChar(GetACP(), MB_PRECOMPOSED, lpAnsiIn, cchAnsi, lpWCStr, size/sizeof(WCHAR)) + 1;
00026 }
00027
00028 LPWORD lpwAlign ( LPWORD lpIn)
00029 {
00030   ULONG_PTR ul;
00031
00032   ul = (ULONG_PTR) lpIn;
00033   ul +=3;
00034   ul >>=2;
00035   ul <<=2;
00036   return (LPWORD) ul;
00037 }
00038
00039 LPWORD AddItemToTemplate(LPWORD lpw,
00040                          int lpwSize,
00041              DWORD dwStyle,
00042              DWORD dwExtStyle,
00043              WORD x, WORD y, WORD cx, WORD cy,
00044              WORD wID,
00045              WORD wClassID,
00046              LPSTR lpszTitle)
00047 {
00048   int nchar;
00049
00050   // Start on a DWORD boundary
00051   lpw = lpwAlign(lpw);
00052
00053   *lpw++ = LOWORD(dwStyle);
00054   *lpw++ = HIWORD(dwStyle);
00055   *lpw++ = LOWORD(dwExtStyle);
00056   *lpw++ = HIWORD(dwExtStyle);
00057   *lpw++ = x;        // x
00058   *lpw++ = y;        // y
00059   *lpw++ = cx;       // cx
00060   *lpw++ = cy;       // cy
00061   *lpw++ = wID;      // ID
00062
00063   /* fill in class i.d. (static in this case) */
00064   *lpw++ = (WORD)0xffff;   // standard class prefix
00065   *lpw++ = (WORD)wClassID;
00066
00067   /* copy the text of the first item */
00068   nchar = nCopyAnsiToWideChar (lpw, TEXT(lpszTitle), lpwSize - sizeof(WORD)*11);
00069   lpw += nchar;
00070   *lpw++ = 0;  // advance pointer over nExtraStuff WORD
00071
00072   return lpw;
00073 }
00074
00075 LPDLGTEMPLATE CreateDialogTemplate()
00076 {
00077   LPWORD  p, pdlgtemplate;
00078   int   nchar;
00079   DWORD lStyle;
00080
00081   /* allocate some memory to play with  */
00082   int wSize = 1000;
00083   int cSize = 0;
00084   pdlgtemplate = p = (PWORD) GlobalAlloc (GPTR, wSize);
00085   if ( !p )
00086       return (LPDLGTEMPLATE)NULL;
00087
00088   /* start to fill in the dlgtemplate information.  addressing by WORDs */
00089   lStyle = DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS;
00090   *p++ = LOWORD (lStyle);
00091   *p++ = HIWORD (lStyle);
00092   *p++ = 0;          // LOWORD (lExtendedStyle)
00093   *p++ = 0;          // HIWORD (lExtendedStyle)
00094   *p++ = 3;          // Number of items being added
00095   *p++ = 0;          // x
00096   *p++ = 0;          // y
00097   *p++ = 86;         // cx
00098   *p++ = 122;        // cy
00099   *p++ = 0;          // Menu
00100   *p++ = 0;          // Class
00101
00102   /* copy the title of the dialog */
00103   nchar = nCopyAnsiToWideChar (p, TEXT(""), wSize - (int)(p - pdlgtemplate)*sizeof(WORD));
00104   p += nchar;
00105
00106   cSize = wSize - (int)(p - pdlgtemplate)*sizeof(WORD);
00107   // Add the template positioning control
00108   p = AddItemToTemplate(p, cSize, WS_CHILD, 0, 0,1,3,122, IDC_LOCATION, 0x82, "");
00109
00110   cSize = wSize - (int)(p - pdlgtemplate)*sizeof(WORD);
00111   // Add the image display area
00112   p = AddItemToTemplate(p, cSize, WS_VISIBLE | WS_CHILD, WS_EX_STATICEDGE, 4,3,80,82, IDC_IMAGE, 0x82, "");
00113
00114   cSize = wSize - (int)(p - pdlgtemplate)*sizeof(WORD);
00115   // Add filename display area
00116   p = AddItemToTemplate(p, cSize, WS_VISIBLE | WS_CHILD | WS_BORDER | ES_CENTER | ES_READONLY, WS_EX_STATICEDGE, 4,86,80,12, IDC_FILEINFO, 0x81, "");
00117
00118   return (LPDLGTEMPLATE)pdlgtemplate;
00119 }
00120
00121
00122 /**********************************************************************\
00123
00124   BOOL GetDIBFilename(LPSTR szFilename, LPSTR szDefault, BOOL  bSave)
00125
00126   szFilename: Returns the file that the user picks.  This must be at
00127               least MAX_PATH bytes long
00128
00129   szDefault:  Default directory.  If this is NULL then the current
00130               directory is used.
00131
00132   bSave:      Do we plan on opening or saving the file?
00133
00134 \**********************************************************************/
00135 BOOL GetDIBFilename(LPSTR lpstrFilename, LPSTR lpstrDefault, BOOL  bSave)
00136 {
00137   LPSTR lpstrFilters = "Bitmaps (*.bmp,*.dib,*.rle)\0*.BMP;*.DIB;*.RLE\0\0";
00138   OPENFILENAME ofn;
00139   BOOL bReturnValue = FALSE;
00140   char szDirName[MAX_PATH];
00141     // Establish the default directory
00142   if (!lpstrDefault) {
00143     GetCurrentDirectory(MAX_PATH, szDirName);
00144   } else {
00145         if ((GetFileAttributes(lpstrDefault) & FILE_ATTRIBUTE_DIRECTORY) && (GetFileAttributes(lpstrDefault) !=  0xFFFFFFFF) && lstrlen(lpstrDefault))  {
00146       lstrcpyn(szDirName, lpstrDefault, sizeof(szDirName)-1);
00147            szDirName[sizeof(szDirName)-1] = '\0';
00148        }
00149         else
00150       GetCurrentDirectory(MAX_PATH, szDirName);
00151   }
00152
00153     // Zero initialize the members of the OPENFILENAME structure
00154   ZeroMemory(&ofn, sizeof(OPENFILENAME));
00155
00156     ofn.lStructSize  = sizeof(OPENFILENAME);
00157     ofn.hwndOwner    = GetActiveWindow();
00158     ofn.nFilterIndex = 1;
00159   ofn.lpstrFilter  = lpstrFilters;
00160     ofn.lpstrFile    = lpstrFilename;
00161     ofn.nMaxFile     = MAX_PATH;
00162     ofn.lpstrInitialDir = szDirName;
00163
00164   // If we are retreiving a filename to save...
00165   if (bSave) {
00166         ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
00167         ofn.lpstrTitle = "Save Bitmap";
00168
00169     // Display the Save dialog box.
00170     bReturnValue = GetSaveFileName(&ofn);
00171   } else  {
00172         ofn.lpstrTitle = "Open Bitmap";
00173     ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_EXPLORER;
00174     ofn.lpfnHook = (LPOFNHOOKPROC)PreviewWindowHookProc;
00175     ofn.hInstance = (HINSTANCE)CreateDialogTemplate();
00176
00177     // Display the Open dialog box.
00178     bReturnValue = GetOpenFileName(&ofn);
00179
00180     // Free the dialog template we created
00181     GlobalFree(ofn.hInstance);
00182
00183    }
00184
00185     return bReturnValue;
00186 }
00187
00188
00189 // ****** Code for displaying DIB in preview window ******
00190
00191 BOOL DisplayBitmapInWindow(HWND hWnd, HBITMAP hbm)
00192 {
00193     DIBSECTION ds;
00194   HDC     hDC, hdcMem;
00195   RECT  rc;
00196     BOOL    bResult;
00197
00198     GetClientRect(hWnd, &rc);
00199
00200   hDC = GetDC(hWnd);
00201
00202   if (!hbm) {
00203         PatBlt(hDC, 0, 0, rc.right, rc.bottom, BLACKNESS);
00204     ReleaseDC(hWnd, hDC);
00205     return FALSE;
00206   }
00207
00208   if (!GetObject(hbm, sizeof(ds), &ds))
00209     return FALSE;
00210
00211   SetStretchBltMode(hDC, HALFTONE);
00212
00213   hdcMem = CreateCompatibleDC(NULL);
00214   SelectObject(hdcMem, hbm);
00215
00216     bResult = StretchBlt(hDC,
00217                      0, 0, rc.right, rc.bottom,
00218                          hdcMem,
00219              0, 0, ds.dsBmih.biWidth, ds.dsBmih.biHeight,
00220              SRCCOPY);
00221
00222   ReleaseDC(hWnd, hDC);
00223   DeleteDC(hdcMem);
00224
00225     return bResult;
00226 }
00227
00228 BOOL DisplayFileToDialog(LPSTR szFile, HWND hWnd, HBITMAP *hbm)
00229 {
00230   char szBuffer[256];
00231
00232   if (*hbm)
00233     DeleteObject(*hbm);
00234
00235   *hbm = (HBITMAP)LoadImage(NULL,
00236       szFile,
00237       IMAGE_BITMAP,
00238       0, 0,
00239       LR_CREATEDIBSECTION | LR_LOADFROMFILE);
00240
00241   if (*hbm) {
00242     BITMAP bm;
00243     GetObject(*hbm, sizeof(bm), &bm);
00244
00245     _snprintf(szBuffer, sizeof(szBuffer)-1, "%lux%lux%lubpp", bm.bmWidth, bm.bmHeight, bm.bmBitsPixel * bm.bmPlanes);
00246         szBuffer[sizeof(szBuffer)-1] = '\0';
00247
00248     SetDlgItemText(hWnd, IDC_FILEINFO, szBuffer);
00249   }
00250
00251   // If *hbm is bogus, DisplayDIBInWindow will display BLACKNESS
00252   return DisplayBitmapInWindow(GetDlgItem(hWnd,IDC_IMAGE), *hbm);
00253 }
00254
00255 BOOL NEAR PASCAL HandleNotify(HWND hDlg, LPOFNOTIFY pofn, LPSTR szFile, HBITMAP *hbm)
00256 {
00257   switch (pofn->hdr.code) {
00258     case CDN_SELCHANGE:  // The selection has changed.
00259
00260   // Get the path of the selected file.
00261   if (CommDlg_OpenSave_GetFilePath(GetParent(hDlg), szFile, MAX_PATH)) {
00262     DisplayFileToDialog(szFile, hDlg, hbm);
00263   }
00264
00265     break;
00266   }
00267
00268   return(TRUE);
00269 }
00270
00271
00272 LRESULT CALLBACK PreviewWindowHookProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
00273 {
00274   static char szFile[MAX_PATH];
00275   static HBITMAP hbm;
00276
00277     switch (msg) {
00278   case WM_INITDIALOG:
00279     // Initialize values
00280     szFile[0] = 0;
00281     hbm = NULL;
00282     SetDlgItemText(hDlg, IDC_FILEINFO, "");
00283     {
00284       HFONT hf = (HFONT)SendMessage(GetParent(hDlg), WM_GETFONT, 0, 0);
00285
00286       SendMessage(GetDlgItem(hDlg, IDC_FILEINFO), WM_SETFONT, (WPARAM)hf, lParam);
00287     }
00288     break;
00289
00290   case WM_DESTROY:
00291     if (hbm)
00292       DeleteObject(hbm);
00293     break;
00294
00295   case WM_CTLCOLORSTATIC:
00296     if (GetDlgItem(hDlg, IDC_IMAGE) == (HWND) lParam) {
00297
00298       DisplayBitmapInWindow(GetDlgItem(hDlg, IDC_IMAGE), hbm);
00299
00300       return (LRESULT)GetStockObject(NULL_BRUSH);
00301     }
00302     break;
00303
00304   case WM_NOTIFY:
00305     {
00306       int idCtrl = (int) wParam;
00307       LPOFNOTIFY lpof = (LPOFNOTIFY)lParam;
00308
00309       HandleNotify(hDlg, lpof, szFile, &hbm);
00310     }
00311     break;
00312
00313   }
00314
00315   return 0;
00316 }
00317
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFactory Member List

This is the complete list of members for CFactory, including all inherited members.
AddRef() | CFactory | [private, virtual]
CFactory() | CFactory | [inline, private]
CFactory(const CFactoryData *pFactoryData) | CFactory |
CFactory() | CFactory |
CFactory(const CLSID &ClsId) | CFactory |
CFactory() | CFactory | [inline]
CreateInstance(IUnknown *pUnknownOuter, const IID &iid, void **ppv) | CFactory | [private, virtual]
CreateInstance(IUnknown *pUnkwnOuter, REFIID riid, void **ppv) | CFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CFactory |
CUnknown::Quit() | CFactory | [friend]
FindBehavior(BSTR bstrBehavior, BSTR bstrBehaviorUrl, IElementBehaviorSite *pSite, IElementBehavior **ppBehavior) | CFactory |
IsLocked() | CFactory | [inline, static]
lockCount() | CFactory | [inline, static]
LockServer(BOOL bLock) | CFactory | [private, virtual]
LockServer(BOOL bLock) | CFactory |
LockServer(BOOL) | CFactory |
m_ClsId | CFactory | [private]
m_cRef | CFactory | [private]
m_cRef | CFactory | [private]
m_pFactoryData | CFactory | [protected]
QueryInterface(const IID &iid, void **ppv) | CFactory | [private, virtual]
QueryInterface(REFIID riid, void **ppv) | CFactory |
QueryInterface(REFIID, LPVOID *) | CFactory |
RegisterAll() | CFactory | [static]
Release() | CFactory | [private, virtual]
s_cServerLocks | CFactory | [private, static]
SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) | CFactory | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CFactory |
STDMETHODIMP_(ULONG) Release(void) | CFactory |
STDMETHODIMP_(ULONG) AddRef(void) | CFactory |
STDMETHODIMP_(ULONG) Release(void) | CFactory |
UnregisterAll() | CFactory | [static]
~CFactory() | CFactory |
~CFactory() | CFactory |
~CFactory() | CFactory |
Generated on Wed Nov 13 2024 16:56:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/view.h Source File

  • Begin
  • sdkdiff

view.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #ifndef __VIEW_H__
00012 #define __VIEW_H__
00013
00014 /*
00015  *
00016  * VIEW
00017  *
00018  * provide a map between lines in the displayed table, and items in the
00019  * COMPLIST associated with this view.
00020  *
00021  * a view owns a complist: given the request for the text of a particular
00022  * line number in the displayed table, it will map it to either the
00023  * name/result of a CompItem in the COMPLIST (one of the files compared),
00024  * or to a line in the compare output (a line in one of the sections in
00025  * the composite section list for the selected CompItem).
00026  *
00027  * the view thus maintains a mode: OUTLINE mode is when one row is one COMPITEM,
00028  * and EXPAND mode is when one row is a line in the selected COMPITEM. Within
00029  * either of these modes, global option flags can select whether to show all
00030  * rows or only certain rows (eg only COMPITEMs that have a state other than
00031  * STATE_SAME, or only lines that are in the LEFT file).
00032  *
00033  * The view is given the handle to the table window. It will send messages
00034  * to the table window as appropriate when the view changes for any reason.
00035  *
00036  * The view owns the COMPLIST. When the view is deleted, the complist will
00037  * also be deleted.
00038  *
00039  * The table class is using this view. So to get rid of a view, call
00040  * view_close. This will notify the table window. Only call view_delete
00041  * when you have received the TQ_CLOSE notification indicating that the
00042  * table class has finished with this view.
00043  */
00044
00045
00046
00047
00048 /* view.h includes the term COMPLIST: complist.h uses the term VIEW.
00049  * Alas MIPS doesn't allow duplicate definitions, even harmless ones,
00050  * so we need to play games.  Whoever declares it first does
00051  * the real declares and the second one gets no-ops.
00052  */
00053 #ifndef INC_VIEW_COMPLIST
00054 #define INC_VIEW_COMPLIST
00055 typedef struct compitem FAR* COMPITEM;          /* handle to a compitem */
00056 typedef struct view FAR * VIEW;                 /* handle to a VIEW     */
00057 typedef struct complist FAR * COMPLIST;         /* handle to a complist */
00058 #endif // INC_VIEW_COMPLIST
00059
00060 /* create a new view. It is told the handle for the associated
00061  * table window. We don't know yet the COMPLIST.
00062  */
00063 VIEW view_new(HWND hwndTable);
00064
00065 /* tell the view the handle of its COMPLIST. This is an error if this
00066  * function has already been called for this view. This will init the
00067  * view to OUTLINE mode. We return FALSE if an error occured.
00068  */
00069 BOOL view_setcomplist(VIEW view, COMPLIST cl);
00070
00071 /* get the handle of the COMPLIST for this view */
00072 COMPLIST view_getcomplist(VIEW view);
00073
00074 /*
00075  * close a view. This causes the table window to be told to close
00076  * this view. When the table window has finished with the view, it will
00077  * send a TQ_CLOSE notification to its owner window. On receipt of
00078  * that, call view_delete
00079  */
00080 void view_close(VIEW view);
00081
00082 /* delete a view and all data associated with it, including the COMPLIST.
00083  *
00084  * DON'T call this function except on receiving a TQ_CLOSE notification
00085  * from the table window. In other cases, call view_close to notify the
00086  * table window.
00087  */
00088 void view_delete(VIEW view);
00089
00090 /*
00091  * each line has three columns - a line number, a tag and the main text.
00092  * this function returns the text for the given row in the
00093  * given view. The pointer is to a text string in the
00094  * view or in the complist somewhere - it should not be changed, and
00095  * may be overwritten by the next call to gettext.
00096  */
00097
00098 LPSTR view_gettext(VIEW view, long row, int col);
00099 LPWSTR view_gettextW(VIEW view, long row, int col);
00100
00101 /*
00102  * return the line number that this line had in the original left or
00103  * right list. returns 0 if we are not in expanded mode, or if the
00104  * line was not in the original list. returns -(linenr) if the
00105  * line is MOVED and this is the other copy
00106  */
00107 int view_getlinenr_left(VIEW view, long row);
00108 int view_getlinenr_right(VIEW view, long row);
00109
00110
00111 /* find the max width of the given column, in characters */
00112 int view_getwidth(VIEW view, int col);
00113
00114
00115 /* return the number of visible rows in this view */
00116 long view_getrowcount(VIEW view);
00117
00118
00119 /* get the state for this row. This is one of the STATE_* properties
00120  * defined in state.h, and is mapped to colour settings by the caller.
00121  */
00122 int view_getstate(VIEW view, long row);
00123
00124
00125 /* switch to expanded view of the given row. FALSE if row not
00126  * expandable or no such row. Switch the mapping so that each row
00127  * maps to one line in the composite section list for the given
00128  * compitem (the one selected by row in outline mode), and notify
00129  * the table window to redraw.
00130  * It is legal (and a no-op) to have rows==-1
00131  */
00132 BOOL view_expand(VIEW view, long row);
00133
00134 /* return to outline mode. switch the mapping back so that each
00135  * row maps to one CompItem, and notify the table window so that it
00136  * is redrawn
00137  */
00138 void view_outline(VIEW);
00139
00140 /* return a handle to the current CompItem. if the view is currently in
00141  * expand mode, this will return the handle for the CompItem that is
00142  * being expanded (regardless of the row parameter). If the mapping is
00143  * currently outline mode, the handle for the CompItem representing row
00144  * will be returned, or NULL if that is not valid
00145  */
00146 COMPITEM view_getitem(VIEW view, long row);
00147
00148 /*
00149  * return TRUE if the current mapping is expanded mode
00150  */
00151 BOOL view_isexpanded(VIEW view);
00152
00153 /* return a text string describing the current compitem. Only valid
00154  * if in expand mode. This will be normally the file name
00155  */
00156 LPSTR view_getcurrenttag(VIEW view);
00157
00158
00159 /* a CompItem has been added to the list. This will cause the
00160  * table to be notified of the change.
00161  *
00162  * This causes a Poll() to take place, and returns TRUE if an abort
00163  * has been requested. The caller should arrange to abort the current
00164  * scan operation.
00165  */
00166 BOOL view_newitem(VIEW view);
00167
00168
00169 /*
00170  * change view mode. the options affecting view selection have changed -
00171  * change the mapping if necessary, and redraw if it affects this mode
00172  *
00173  * retain current line if possible
00174  */
00175 void view_changeviewoptions(VIEW view);
00176
00177 /* the compare options have changed - discard all compares and redo
00178  * as necessary.
00179  * retain current line if possible
00180  */
00181 void view_changediffoptions(VIEW view);
00182
00183
00184 /* find the next highlighted line in the given direction: forward if
00185  * bForward. returns the row number.
00186  */
00187 long view_findchange(VIEW view, long startrow, BOOL bForward);
00188
00189 /* return the STATE_ value for the indicated row in the view.
00190  */
00191 int view_getrowstate(VIEW view, long row);
00192
00193 /*
00194  * return the marked state for a given row. Only compitems can be marked,
00195  * so it will be FALSE unless it is a compitem on which view_setmark or
00196  * compitem_setmark have previously set the mark state to TRUE.
00197  */
00198 BOOL view_getmarkstate(VIEW view, long row);
00199
00200 /*
00201  * set the mark state for a given row. This is only possible for compitem rows.
00202  * The mark set can be retrieved by view_getmarkstate or compitem_getmark.
00203  *
00204  * We return FALSE if the state could not be set - eg because the
00205  * row to set is not a compitem row.
00206  */
00207 BOOL view_setmarkstate(VIEW view, long row, BOOL bMark);
00208
00209 /*
00210  * the WIN32 multithread version can try view_expand and view_outline
00211  * (or view_newitem) at the same time. This is not correctly protected by
00212  * the critical section, since there are major restrictions about holding
00213  * critsecs when sending messages from the worker thread.
00214  *
00215  * To avoid contention, we call this function to notify that we are
00216  * starting expanding. view_newitem and ToOutline will return without
00217  * doing anything if this function has been called and view_expand has not
00218  * completed.
00219  */
00220 void view_expandstart(VIEW);
00221
00222 // are we in the middle of expansion ?
00223 BOOL view_expanding(VIEW);
00224
00225 HWND view_gethwnd(VIEW view);
00226
00227 void view_gototableline(VIEW view, LONG iLine);
00228
00229 BOOL view_findstring(VIEW view, LONG iCol, LPCSTR pszFind, BOOL fSearchDown, BOOL fMatchCase, BOOL fWholeWord);
00230
00231 #endif
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ASyncWrite/openf.h Source File

  • Web
  • iis
  • extensions
  • io
  • ASyncWrite

openf.h

Go to the documentation of this file.
00001 /* Copyright(c) 1995-2002 Microsoft Corporation
00002
00003   Module Name:
00004
00005     openf.h
00006
00007   Abstract:
00008
00009     This module defines functions for opening and closing files
00010     and provides transparent caching for file handles
00011 */
00012
00013 # ifndef _OPENF_HXX_
00014 # define _OPENF_HXX_
00015
00016 # include <windows.h>
00017 # include <httpext.h>
00018
00019 #define InitializeListHead(ListHead) (\
00020     (ListHead)->Flink = (ListHead)->Blink = (ListHead))
00021
00022 #define IsListEmpty(ListHead) \
00023     ((ListHead)->Flink == (ListHead))
00024
00025 #define RemoveHeadList(ListHead) \
00026     (ListHead)->Flink;\
00027     {RemoveEntryList((ListHead)->Flink)}
00028
00029 #define RemoveTailList(ListHead) \
00030     (ListHead)->Blink;\
00031     {RemoveEntryList((ListHead)->Blink)}
00032
00033 #define RemoveEntryList(Entry) {\
00034     PLIST_ENTRY _EX_Blink;\
00035     PLIST_ENTRY _EX_Flink;\
00036     _EX_Flink = (Entry)->Flink;\
00037     _EX_Blink = (Entry)->Blink;\
00038     _EX_Blink->Flink = _EX_Flink;\
00039     _EX_Flink->Blink = _EX_Blink;\
00040                             }
00041
00042 #define InsertTailList(ListHead,Entry) {\
00043     PLIST_ENTRY _EX_Blink;\
00044     PLIST_ENTRY _EX_ListHead;\
00045     _EX_ListHead = (ListHead);\
00046     _EX_Blink = _EX_ListHead->Blink;\
00047     (Entry)->Flink = _EX_ListHead;\
00048     (Entry)->Blink = _EX_Blink;\
00049     _EX_Blink->Flink = (Entry);\
00050     _EX_ListHead->Blink = (Entry);\
00051                                     }
00052 #define InsertHeadList(ListHead,Entry) {\
00053     PLIST_ENTRY _EX_Flink;\
00054     PLIST_ENTRY _EX_ListHead;\
00055     _EX_ListHead = (ListHead);\
00056     _EX_Flink = _EX_ListHead->Flink;\
00057     (Entry)->Flink = _EX_Flink;\
00058     (Entry)->Blink = _EX_ListHead;\
00059     _EX_Flink->Blink = (Entry);\
00060     _EX_ListHead->Flink = (Entry);\
00061                                     }
00062 /* Initialization and cleanup functions */
00063
00064 DWORD CleanupFileHandleCache(VOID);
00065 HANDLE FcOpenFile(IN EXTENSION_CONTROL_BLOCK *pecb, IN LPCSTR pszFile);
00066 DWORD FcCloseFile(IN HANDLE hFile);
00067 BOOL FcReadFromFile(IN HANDLE hFile, OUT CHAR *pchBuffer, IN  DWORD dwBufferSize, OUT LPDWORD pcbRead, IN OUT LPOVERLAPPED pov);
00068 VOID InitFileHandleCache(VOID);
00069
00070 # endif
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::CommandTypeEnum Member List

This is the complete list of members for msado15::CommandTypeEnum, including all inherited members.
adCmdFile | msado15::CommandTypeEnum | [static]
adCmdStoredProc | msado15::CommandTypeEnum | [static]
adCmdTable | msado15::CommandTypeEnum | [static]
adCmdTableDirect | msado15::CommandTypeEnum | [static]
adCmdText | msado15::CommandTypeEnum | [static]
adCmdUnknown | msado15::CommandTypeEnum | [static]
adCmdUnspecified | msado15::CommandTypeEnum | [static]
adCmdURLBind | msado15::CommandTypeEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/GUIDRAW.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

GUIDRAW.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GUIDRAW.H
00003
00004   Summary:   Include file for the CGuiDraw C++ class. A GuiDraw is a C++
00005              object that displays and stores mouse movements as free-form
00006              line drawing or "scribbling" in the client area of a separate
00007              window. GuiDraw is anchored to the Windows GUI (Graphical
00008              User Interface) environment. This GuiDraw object relies on a
00009              virtual Drawing Paper object that is instantiated as a COM
00010              object (a CODrawPage) in a separate In-process server,
00011              PERDRAW, to store the "ink" data that is drawn.
00012
00013              For a comprehensive tutorial code tour of GUIDRAW's contents
00014              and offerings see the tutorial PERCLIEN.HTM file. For
00015              more specific technical details on the internal workings see
00016              the comments dispersed throughout the GUIDRAW source code.
00017
00018   Classes:   CGuiDraw.
00019
00020   Origin:    5-24-97: atrent - Editor inheritance from GUIPAPER.H in the
00021              STOCLIEN source.
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037
00038 #if !defined(GUIDRAW_H)
00039 #define GUIDRAW_H
00040
00041
00042 #if defined(__cplusplus)
00043
00044 // Some compile-time constants for ink thickness in pixels.
00045 enum
00046 {
00047   INK_THIN = 2,
00048   INK_MEDIUM = 10,
00049   INK_THICK = 20
00050 };
00051
00052
00053 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00054   Class:    CGuiDraw
00055
00056   Summary:  Class to encapsulate the displayable Graphical User Interface
00057             (GUI) for functioning drawing objects in separate windows.
00058             Such a window has its own menu and window procedure. CGuiDraw
00059             is derived from APPUTIL's CVirWindow and thus inherits all the
00060             features and benefits of CVirWindow.
00061
00062   Methods:  CGuiDraw
00063               Constructor.
00064             ~CGuiDraw
00065               Destructor.
00066             BOOL OpenWin(
00067                    IStorage* pIStorage_Page,
00068                    WCHAR* pwszPageTitle,
00069                    WCHAR* pwszDataName);
00070               Open the drawing window of this CGuiDraw object.
00071             HRESULT TopWin(void);
00072               Make this the topmost window on the screen.
00073             HRESULT ResizeWin(WORD wWidth, WORD wHeight);
00074               Resize the display window.
00075             HRESULT ClearWin(void);
00076               Clear display window but retain ink data.
00077             HRESULT PaintWin(void);
00078               Clear window and Repaint the window with ink data.
00079             HRESULT InkSaving(BOOL bInkSaving);
00080               Turn Ink data saving in on and off.
00081             HRESULT InkWidth(SHORT nInkWidth);
00082               Set current ink line width for drawing.
00083             HRESULT InkColor(COLORREF crInkColor);
00084               Set current ink color for drawing.
00085             HRESULT InkStart(SHORT nX, SHORT nY);
00086               Start ink drawing sequence.
00087             HRESULT InkDraw(SHORT nX, SHORT nY);
00088               Draw ink sequence data.
00089             HRESULT InkStop(SHORT nX, SHORT nY);
00090               Stop ink drawing sequence.
00091             HRESULT Renumber(INT iPage);
00092               Re-assign the current dynamic page number for this page.
00093             HRESULT ReleasePage(void);
00094               Release all substorages for this draw page.
00095             HRESULT RestorePage(IStorage* pIStorage_Page);
00096               Reopen all substorages for the draw page.
00097             HRESULT Close(void);
00098               Close this draw page window and it's open substorages.
00099             HRESULT Save(void);
00100               Save existing Ink Data to the page's substorage.
00101             INT AskSave(void);
00102               Check if new ink data, ask user, save if user says to.
00103             HRESULT Delete(void);
00104               Delete the entire substorage for this draw page. Close Window.
00105             HRESULT Clear(void);
00106               Clear content of this draw page; clear window.
00107             COLORREF PickColor(void);
00108               Common dialog. Ask user to choose new pen color.
00109 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00110 class CGuiDraw : public CVirWindow
00111 {
00112   public:
00113     // Constructor and Destructor override those in CVirWindow.
00114     CGuiDraw(HINSTANCE hInst, HWND hWndApp, INT iPage);
00115     ~CGuiDraw(void);
00116
00117     // The public CGuiDraw methods that extend CVirWindow.
00118     HRESULT  OpenWin(
00119                IStorage* pIStorage_Page,
00120                WCHAR* pwszPageTitle,
00121                WCHAR* pwszDataName);
00122     HRESULT  TopWin(void);
00123     HRESULT  ResizeWin(WORD wWidth, WORD wHeight);
00124     HRESULT  ClearWin(void);
00125     HRESULT  PaintWin(void);
00126     HRESULT  InkSaving(BOOL bInkSaving);
00127     HRESULT  InkWidth(SHORT nInkWidth);
00128     HRESULT  InkColor(COLORREF crInkColor);
00129     HRESULT  InkStart(SHORT nX, SHORT nY);
00130     HRESULT  InkDraw(SHORT nX, SHORT nY);
00131     HRESULT  InkStop(SHORT nX, SHORT nY);
00132     HRESULT  Renumber(INT iPage);
00133     HRESULT  ReleasePage(void);
00134     HRESULT  RestorePage(IStorage* pIStorage_Page);
00135     HRESULT  Close(void);
00136     HRESULT  Save(void);
00137     INT      AskSave(void);
00138     HRESULT  Delete(void);
00139     HRESULT  Clear(void);
00140     COLORREF PickColor(void);
00141
00142   protected:
00143     LRESULT  WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00144
00145   private:
00146     // Private methods.
00147     HRESULT  Load(void);
00148     LRESULT  DoCommand(WPARAM wParam, LPARAM lParam);
00149     IConnectionPoint* GetConnectionPoint(REFIID riid);
00150     HRESULT  ConnectSink(void);
00151     HRESULT  DisconnectSink(void);
00152
00153     // Private data members.
00154     HWND       m_hWndApp;        // Handle of the parent app window.
00155     RECT       m_WinRect;        // GuiDraw Window position rectangle.
00156     HDC        m_hDC;            // GuiDraw window drawing device context.
00157     HPEN       m_hPen;           // Handle to the drawing pen.
00158     SHORT      m_nInkWidth;      // Current ink pen drawing width.
00159     COLORREF   m_crInkColor;     // Current ink pen drawing color.
00160     BOOL       m_bInkSaving;     // TRUE=>inking is to be saved.
00161     BOOL       m_bInking;        // TRUE=>inking sequence in progress.
00162     BOOL       m_bPainting;      // TRUE=>painting in progress.
00163     POINT      m_OldPos;         // Old Position.
00164     IStorage*  m_pIStorage_Root; // IStorage on the client's root storage.
00165     IStorage*  m_pIStorage_Page; // IStorage on the page's drawing storage.
00166     IDrawPage* m_pIDrawPage;     // IDrawPage on the CODrawPage COM object.
00167     CLSID      m_CidDrawPage;    // The Class ID for CODrawPage objects.
00168     WCHAR      m_wszDataName[PAGE_NAME_SIZE]; // Page DataName.
00169     INT        m_iPage;          // Page Number of this text page.
00170     WORD       m_wWidth;         // Window width.
00171     WORD       m_wHeight;        // Window height.
00172     TEXTMETRIC m_tm;             // Text metric for display of text using DC.
00173     CHOOSECOLOR m_ChooseColor;   // Choose color dialog structure.
00174     COLORREF   m_acrCustColors[16]; // Custom color array for Choose Color.
00175     IUnknown*  m_pCODrawPageSink; // Interface to DrawPageSink COM object.
00176     DWORD      m_dwDrawPageSink;  // DrawPageSink connection key.
00177 };
00178
00179
00180 #endif // __cplusplus
00181
00182 #endif // GUIDRAW.H
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/extbuff.h Source File

  • Dataaccess
  • oledb
  • sampprov

extbuff.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module EXTBUFF.H | Class Definitions for CExtBuffer Class
00008 //
00009 //
00010 #ifndef _EXTBUFF_H_
00011 #define _EXTBUFF_H_
00012
00013 // Forward Declaration
00014 class FAR CExtBuffer;
00015 typedef CExtBuffer FAR *LPEXTBUFFER;
00016
00017
00018 //--------------------------------------------------------------------
00019 // @class Allocates and manages fixed sized block memory routines
00020 //
00021 // @hungarian ext or pext
00022 //
00023 class FAR CExtBuffer
00024 {
00025   private: //@access private
00026     //@cmember Item size, in bytes
00027     ULONG    m_cbItem;
00028     //@cmember Current count of items
00029     ULONG    m_cItem;
00030     //@cmember Reserved byte count
00031     ULONG    m_cbReserved;
00032     //@cmember Allocated byte count
00033     ULONG    m_cbAlloc;
00034     //@cmember increment value
00035     ULONG    m_dbAlloc;
00036     //@cmember Ptr to beginning of buffer
00037     BYTE     *m_rgItem;
00038
00039
00040   private:
00041     // Not implemented; private so dcl prevents generation.
00042     CExtBuffer( const CExtBuffer & p);
00043     CExtBuffer& operator=(const CExtBuffer & p);
00044
00045   public: //@access public
00046     //@cmember Construcutor
00047     CExtBuffer ( void );
00048     //@cmember Destructor
00049     ~CExtBuffer ( void );
00050     //@cmember Calculated data pointer from index value
00051     void * operator[] (DBCOUNTITEM nIndex);
00052     //@cmember Initialize the fixed size buffer
00053     STDMETHODIMP  FInit (ULONG cItemMax, ULONG cbItem, ULONG cbPage);
00054     //@cmember Add new items to the buffer
00055     STDMETHODIMP  InsertIntoExtBuffer (VOID* pvItem, HACCESSOR &hItem);
00056     //cmember Retrieve items from buffer
00057     STDMETHODIMP    GetItemOfExtBuffer (HACCESSOR hItem, VOID* pvItem);
00058     //@cmember Get usage extent indexes
00059     STDMETHODIMP    GetFirstLastItemH (HACCESSOR &hItemFirst, HACCESSOR &hItemLast);
00060 };
00061
00062 #endif
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/COMPlusWizard/VJ/op.java Source File

  • Com
  • Tools
  • COMPlusWizard
  • VJ

op.java

Go to the documentation of this file.
00001 /**
00002  * This class is designed to be packaged with a COM DLL output format.
00003  * The class has no standard entry points, other than the constructor.
00004  * Public methods will be exposed as methods on the default COM interface.
00005  * @com.register ( clsid=%GUID1%, typelib=%GUID2% )
00006  */
00007 public class COMPlus
00008 {
00009   // TODO: Add additional methods and code here
00010
00011   // Sample method which uses the COM+ Server Context.
00012   // See the Microsoft COM+ documentation for more information
00013   // about use the Context class and creating COM+ components.
00014   public void Method1()
00015   {
00016     boolean bSuccess = false;
00017     try {
00018       // TODO: Add your method code here.  If successful, set bSuccess
00019         // to true
00020       bSuccess = true;
00021       return;
00022     }
00023
00024     // Most methods in COM+ objects should call setComplete if successful,
00025     // or setAbort if not. This causes this object to be deactivated and
00026     // lose state after the return of this function.  See the COM+
00027     // documentation for more information.
00028     finally {
00029       if (bSuccess)
00030         Context.setComplete();
00031       else
00032         Context.setAbort();
00033     }
00034   }
00035
00036   //Component that supports object pooling must support IObjectControl
00037   public void Activate()
00038   {
00039   }
00040
00041   public void Deactivate()
00042   {
00043   }
00044
00045   public boolean CanBePooled()
00046   {
00047     return true;
00048   }
00049
00050   //TODO: Add code to construct object using construction string.
00051   // IObjectConstruct
00052   //public void Construct(Object pObj);
00053   //{
00054   //}
00055
00056   /**
00057    * NOTE: To add auto-registration code, refer to the documentation
00058    * on the following method
00059    *   public static void onCOMRegister(boolean unRegister) {}
00060    */
00061 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/theprovider.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

theprovider.h

Go to the documentation of this file.
00001
00002
00003 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00004
00005
00006  /* File created by MIDL compiler version 6.00.0363 */
00007 /* at Wed Feb 25 07:13:11 2004
00008  */
00009 /* Compiler settings for F:\Depot\SQLVault\mdac28sdk\Samples\oledb\omniprov\source\SDK\obj\i386\TheProvider.idl:
00010     Oicf, W1, Zp8, env=Win32 (32b run)
00011     protocol : dce , ms_ext, c_ext, robust
00012     error checks: allocation ref bounds_check enum stub_data
00013     VC __declspec() decoration level:
00014          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00015          DECLSPEC_UUID(), MIDL_INTERFACE()
00016 */
00017 //@@MIDL_FILE_HEADING(  )
00018
00019 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00020
00021
00022 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00023 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00024 #define __REQUIRED_RPCNDR_H_VERSION__ 475
00025 #endif
00026
00027 #include "rpc.h"
00028 #include "rpcndr.h"
00029
00030 #ifndef __RPCNDR_H_VERSION__
00031 #error this stub requires an updated version of <rpcndr.h>
00032 #endif // __RPCNDR_H_VERSION__
00033
00034
00035 #ifndef __TheProvider_h__
00036 #define __TheProvider_h__
00037
00038 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
00039 #pragma once
00040 #endif
00041
00042 /* Forward Declarations */
00043
00044 #ifndef __MSOmniProv_FWD_DEFINED__
00045 #define __MSOmniProv_FWD_DEFINED__
00046
00047 #ifdef __cplusplus
00048 typedef class MSOmniProv MSOmniProv;
00049 #else
00050 typedef struct MSOmniProv MSOmniProv;
00051 #endif /* __cplusplus */
00052
00053 #endif  /* __MSOmniProv_FWD_DEFINED__ */
00054
00055
00056 /* header files for imported files */
00057 #include "oaidl.h"
00058 #include "ocidl.h"
00059
00060 #ifdef __cplusplus
00061 extern "C"{
00062 #endif
00063
00064 void * __RPC_USER MIDL_user_allocate(size_t);
00065 void __RPC_USER MIDL_user_free( void * );
00066
00067
00068 #ifndef __THEPROVIDERLib_LIBRARY_DEFINED__
00069 #define __THEPROVIDERLib_LIBRARY_DEFINED__
00070
00071 /* library THEPROVIDERLib */
00072 /* [helpstring][version][uuid] */
00073
00074
00075 EXTERN_C const IID LIBID_THEPROVIDERLib;
00076
00077 EXTERN_C const CLSID CLSID_MSOmniProv;
00078
00079 #ifdef __cplusplus
00080
00081 class DECLSPEC_UUID("B14C8EB2-3632-11D3-AC81-00C04F8DB3D5")
00082 MSOmniProv;
00083 #endif
00084 #endif /* __THEPROVIDERLib_LIBRARY_DEFINED__ */
00085
00086 /* Additional Prototypes for ALL interfaces */
00087
00088 /* end of Additional Prototypes */
00089
00090 #ifdef __cplusplus
00091 }
00092 #endif
00093
00094 #endif
00095
00096
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/inc/IsapiTime.h Source File

  • Web
  • iis
  • ISAPI_6.0
  • inc

IsapiTime.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: IsapiTime.h
00006
00007 Abstract:
00008
00009     Some helper functions to work with time
00010
00011 Author:
00012
00013     ISAPI developer (Microsoft employee), October 2002
00014
00015 --*/
00016
00017 #ifndef _isapi_time_h
00018 #define _isapi_time_h
00019
00020 #include <IsapiTools.h>
00021
00022 BOOL
00023 InitializeIsapiTime(
00024     VOID
00025     );
00026
00027 DWORD
00028 GetCurrentTimeInSeconds(
00029     VOID
00030     );
00031
00032 DWORD64
00033 GetCurrentTimeInMilliseconds(
00034     VOID
00035     );
00036
00037 BOOL
00038 GetCurrentTimeAsFileTime(
00039     FILETIME *  pft
00040     );
00041
00042 BOOL
00043 GetFileTimeFromString(
00044     FILETIME *  pft,
00045     CHAR *      szTimeString
00046     );
00047
00048 BOOL
00049 GetFileTimeAsString(
00050     FILETIME *      pft,
00051     ISAPI_STRING *  pString
00052     );
00053
00054 BOOL
00055 GetCurrentTimeAsString(
00056     ISAPI_STRING *  pString
00057     );
00058
00059 DWORD
00060 DiffFileTimeInSeconds(
00061     FILETIME *  pft1,
00062     FILETIME *  pft2
00063     );
00064
00065 DWORD64
00066 DiffFileTimeInMilliseconds(
00067     FILETIME *  pft1,
00068     FILETIME *  pft2
00069     );
00070
00071 #endif  // _isapi_time_h
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCTypeSet Member List

This is the complete list of members for CCTypeSet, including all inherited members.
_fC1Mask | CCTypeSet | [protected]
_fC2Test | CCTypeSet | [protected]
_fC3Mask | CCTypeSet | [protected]
_iPage | CCTypeSet | [protected]
_pCharInSet | CCTypeSet | [protected]
_pPageInSet | CCTypeSet | [protected]
CCTypeSet(WORD fC1Mask, WORD fC2Test, WORD fC3Mask) | CCTypeSet |
GetPageData(WORD iPage) | CCTypeSet | [protected]
In(WORD iChar) | CCTypeSet | [virtual]
Generated on Wed Nov 13 2024 16:55:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Start.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

Start.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright 1992 - 2000 Microsoft Corporation.
00004 //
00005 //  File:       start.cxx
00006 //
00007 //  Contents:   Parsing algorithm at the beginning of an Html file
00008 //
00009 //  Classes:    CStartOfFileElement
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <start.hxx>
00017
00018 //+-------------------------------------------------------------------------
00019 //
00020 //  Method:     CStartOfFileElement::CStartOfFileElement
00021 //
00022 //  Synopsis:   Constructor
00023 //
00024 //  Arguments:  [htmlIFilter]    -- Html IFilter
00025 //              [serialStream]   -- Input stream
00026 //
00027 //--------------------------------------------------------------------------
00028
00029 CStartOfFileElement::CStartOfFileElement( CHtmlIFilter& htmlIFilter,
00030                                           CSerialStream& serialStream )
00031     : CHtmlElement(htmlIFilter, serialStream)
00032 {
00033 }
00034
00035
00036
00037 //+-------------------------------------------------------------------------
00038 //
00039 //  Method:     CStartOfFileElement::GetChunk
00040 //
00041 //  Synopsis:   Gets the next chunk and returns chunk information in pStat
00042 //
00043 //  Arguments:  [pStat] -- chunk information returned here
00044 //
00045 //--------------------------------------------------------------------------
00046
00047 SCODE CStartOfFileElement::GetChunk( STAT_CHUNK * pStat )
00048 {
00049     //
00050     // This is the first GetChunk call ever, hence setup the correct
00051     // Html Element
00052     //
00053     SCODE sc = SwitchToNextHtmlElement( pStat );
00054
00055     return sc;
00056 }
00057
00058
00059
00060 //+-------------------------------------------------------------------------
00061 //
00062 //  Method:     CStartOfFileElement::GetText
00063 //
00064 //  Synopsis:   Retrieves text from current chunk
00065 //
00066 //  Arguments:  [pcwcOutput] -- count of UniCode characters in buffer
00067 //              [awcBuffer]  -- buffer for text
00068 //
00069 //--------------------------------------------------------------------------
00070
00071 SCODE CStartOfFileElement::GetText( ULONG *pcwcOutput, WCHAR *awcBuffer )
00072 {
00073     //
00074     // CStartOfFile is used to set up the first chunk correctly, and the first
00075     // chunk cannot be of type CStartOfFile
00076     //
00077     Win4Assert( !"CStartOfFileElement::GetText() call unexpected" );
00078
00079     return E_FAIL;
00080 }
00081
00082
00083
00084 //+-------------------------------------------------------------------------
00085 //
00086 //  Method:     CStartOfFileElement::InitStatChunk
00087 //
00088 //  Synopsis:   Initializes the STAT_CHUNK
00089 //
00090 //  Arguments:  [pStat] -- STAT_CHUNK to initialize
00091 //
00092 //--------------------------------------------------------------------------
00093
00094 void CStartOfFileElement::InitStatChunk( STAT_CHUNK *pStat )
00095 {
00096     Win4Assert( !"CStartOfFileElement::InitStatChunk() call unexpected" );
00097 }
00098
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/about.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

about.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPABOUT_H_
00020 #define _SAMPABOUT_H_
00021
00022 #include <tchar.h>
00023 #include <mmc.h>
00024
00025 class CSnapinAbout : public ISnapinAbout
00026 {
00027 private:
00028     ULONG       m_cref;
00029     HBITMAP       m_hSmallImage;
00030     HBITMAP       m_hLargeImage;
00031     HBITMAP       m_hSmallImageOpen;
00032     HICON       m_hAppIcon;
00033
00034 public:
00035     CSnapinAbout();
00036     ~CSnapinAbout();
00037
00038     ///////////////////////////////
00039     // Interface IUnknown
00040     ///////////////////////////////
00041     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042     STDMETHODIMP_(ULONG) AddRef();
00043     STDMETHODIMP_(ULONG) Release();
00044
00045     ///////////////////////////////
00046     // Interface ISnapinAbout
00047     ///////////////////////////////
00048     STDMETHODIMP GetSnapinDescription(
00049         /* [out] */ LPOLESTR *lpDescription);
00050
00051         STDMETHODIMP GetProvider(
00052         /* [out] */ LPOLESTR *lpName);
00053
00054         STDMETHODIMP GetSnapinVersion(
00055         /* [out] */ LPOLESTR *lpVersion);
00056
00057         STDMETHODIMP GetSnapinImage(
00058         /* [out] */ HICON *hAppIcon);
00059
00060         STDMETHODIMP GetStaticFolderImage(
00061         /* [out] */ HBITMAP *hSmallImage,
00062         /* [out] */ HBITMAP *hSmallImageOpen,
00063         /* [out] */ HBITMAP *hLargeImage,
00064         /* [out] */ COLORREF *cMask);
00065
00066         ///////////////////////////////
00067         // Private Interface
00068         ///////////////////////////////
00069 private:
00070     HRESULT CSnapinAbout::AllocOleStr(
00071         LPOLESTR *lpDest,
00072         _TCHAR *szBuffer);
00073 };
00074
00075 #endif _SAMPABOUT_H_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCOrder/Resource.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCOrder

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by QCOrder.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_ORDER                       101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/Enumprt.h Source File

  • Multimedia
  • Gdi
  • Printer

Enumprt.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /******************************************************************************\
00013 *
00014 *                                  ENUMPRT.H
00015 *
00016 \******************************************************************************/
00017
00018 /******************************************************************************\
00019 *                             SYMBOLIC CONSTANTS
00020 \******************************************************************************/
00021
00022 #define MAX_ATTRIBUTES     4   // # of elements in gaAttributes
00023 #define MAX_PRIORITIES     4   // # of elements in gaPriorities
00024 #define MAX_STATUS         3   // # of elements in gaStatus
00025 #define MAX_FIELDS         15  // # of elements in gaFields
00026 #define MAX_ORIENTATION    2   // # of elements in gaOrientation
00027 #define MAX_PAPERSIZE      41  // # of elements in gaPaperSize
00028 #define MAX_DEFAULTSOURCE  16  // # of elements in gaDefaultSource
00029 #define MAX_PRINTQUALITY   4   // # of elements in gaPrintQuality
00030 #define MAX_COLOR          2   // # of elements in gaColor
00031 #define MAX_DUPLEX         3   // # of elements in gaDuplex
00032
00033 #define ERR_MOD_NAME       IDS_ERR_ENUMPRT
00034
00035 #define BLANKS             "\t\t\t"
00036
00037 /******************************************************************************\
00038 *                                  TYPEDEFS
00039 \******************************************************************************/
00040
00041 typedef struct tagENUMPRTLOOKUP
00042 {
00043   DWORD   dwValue;
00044   LPCSTR  szValue;
00045
00046 } ENUMPRTLOOKUP;
00047
00048
00049
00050 /******************************************************************************\
00051 *                              GLOBAL VARIABLES
00052 \******************************************************************************/
00053
00054 HWND  ghwndEnumPrt;
00055 DWORD gdwEnumFlags;
00056 char  gszEnumName[BUFSIZE];
00057
00058 LPSTR gaEnumPrt[] =
00059
00060       { "PRINTER_INFO_1"  ,
00061         "  pDescription:      \t%s",
00062         "  pName:             \t%s",
00063         "  pComment:          \t%s",
00064         "PRINTER_INFO_2"  ,
00065         "  pServerName:       \t%s",  // 5
00066         "  pPrinterName:      \t%s",
00067         "  pShareName:        \t%s",
00068         "  pPortName:         \t%s",
00069         "  pDriverName:       \t%s",
00070         "  pComment:          \t%s",  // 10
00071         "  pLocation:         \t%s",
00072         "  pDevMode           \t%s",
00073         "     dmDeviceName:     \t%s",
00074         "     dmSpecVersion:    \t%d",
00075         "     dmDriverVersion:  \t%d",  // 15
00076         "     dmSize:           \t%d",
00077         "     dmDriverExtra:    \t%d",
00078         "     dmFields:         \t",
00079         "     dmOrientation:    \t",
00080         "     dmPaperSize:      \t",  // 20
00081         "     dmPaperLength:    \t%d",
00082         "     dmPaperWidth:     \t%d",
00083         "     dmScale:          \t%d",
00084         "     dmCopies:         \t%d",
00085         "     dmDefaultSource:  \t",  // 25
00086         "     dmPrintQuality:   \t%s",
00087         "     dmColor:          \t",
00088         "     dmDuplex:         \t",
00089         "     dmYResolution:    \t%d",
00090         "     dmTTOption:       \t%d",  // 30
00091         "     dmCollate:        \t&d",
00092         "     dmFormName:       \t%s",
00093         "  pSepFile:          \t%s",
00094         "  pPrintProcessor:   \t%s",
00095         "  pDatatype:         \t%s",  // 35
00096         "  pParameters:       \t%s",
00097         "  Attributes:        \t",
00098         "  Priority:          \t%s",
00099         "  Priority:          \t%ld",
00100         "  DefaultPriority:   \t%ld",  // 40
00101         "  StartTime:         \t%ld",
00102         "  UntilTime:         \t%ld",
00103         "  Status:            \t",
00104         "  cJobs:             \t%ld",
00105         "  AveragePPM:        \t%ld"    };
00106
00107 ENUMPRTLOOKUP gaAttributes[] =
00108
00109     { { PRINTER_ATTRIBUTE_QUEUED       , "PRINTER_ATTRIBUTE_QUEUED  " },
00110       { PRINTER_ATTRIBUTE_DIRECT       , "PRINTER_ATTRIBUTE_DIRECT  " },
00111       { PRINTER_ATTRIBUTE_DEFAULT      , "PRINTER_ATTRIBUTE_DEFAULT " },
00112       { PRINTER_ATTRIBUTE_SHARED       , "PRINTER_ATTRIBUTE_SHARED  " } };
00113
00114 ENUMPRTLOOKUP gaPriorities[] =
00115
00116     { { NO_PRIORITY                    , "NO_PRIORITY  " },
00117       { MAX_PRIORITY                   , "MAX_PRIORITY " },
00118       { MIN_PRIORITY                   , "MIN_PRIORITY " },
00119       { DEF_PRIORITY                   , "DEF_PRIORITY " } };
00120
00121 ENUMPRTLOOKUP gaStatus[] =
00122
00123     { { PRINTER_STATUS_PAUSED          , "PRINTER_STATUS_PAUSED "          },
00124       { PRINTER_STATUS_ERROR           , "PRINTER_STATUS_ERROR  "          },
00125       { PRINTER_STATUS_PENDING_DELETION, "PRINTER_STATUS_PENDING_DELETION "},
00126       { 0                              , ""                                }};
00127
00128 ENUMPRTLOOKUP gaFields[] =
00129
00130     { { DM_ORIENTATION  , "DM_ORIENTATION  " },
00131       { DM_PAPERSIZE    , "DM_PAPERSIZE    " },
00132       { DM_PAPERLENGTH  , "DM_PAPERLENGTH  " },
00133       { DM_PAPERWIDTH   , "DM_PAPERWIDTH   " },
00134       { DM_SCALE        , "DM_SCALE        " },
00135       { DM_COPIES       , "DM_COPIES       " },
00136       { DM_DEFAULTSOURCE, "DM_DEFAULTSOURCE" },
00137       { DM_PRINTQUALITY , "DM_PRINTQUALITY " },
00138       { DM_COLOR        , "DM_COLOR        " },
00139       { DM_DUPLEX       , "DM_DUPLEX       " },
00140       { DM_YRESOLUTION  , "DM_YRESOLUTION  " },
00141       { DM_TTOPTION     , "DM_TTOPTION     " },
00142       { DM_COLLATE      , "DM_COLLATE      " },
00143       { DM_FORMNAME     , "DM_FORMNAME     " },
00144       { 0               , "0               " } };
00145
00146 ENUMPRTLOOKUP gaOrientation[] =
00147
00148     { { DMORIENT_PORTRAIT , "DMORIENT_PORTRAIT " },
00149       { DMORIENT_LANDSCAPE, "DMORIENT_LANDSCAPE" } };
00150
00151 ENUMPRTLOOKUP gaPaperSize[] =
00152
00153     { { DMPAPER_FIRST             , "DMPAPER_FIRST             " },
00154       { DMPAPER_LETTER            , "DMPAPER_LETTER            " },
00155       { DMPAPER_LETTERSMALL       , "DMPAPER_LETTERSMALL       " },
00156       { DMPAPER_TABLOID           , "DMPAPER_TABLOID           " },
00157       { DMPAPER_LEDGER            , "DMPAPER_LEDGER            " },
00158       { DMPAPER_LEGAL             , "DMPAPER_LEGAL             " },
00159       { DMPAPER_STATEMENT         , "DMPAPER_STATEMENT         " },
00160       { DMPAPER_EXECUTIVE         , "DMPAPER_EXECUTIVE         " },
00161       { DMPAPER_A3                , "DMPAPER_A3                " },
00162       { DMPAPER_A4                , "DMPAPER_A4                " },
00163       { DMPAPER_A4SMALL           , "DMPAPER_A4SMALL           " },
00164       { DMPAPER_A5                , "DMPAPER_A5                " },
00165       { DMPAPER_B4                , "DMPAPER_B4                " },
00166       { DMPAPER_B5                , "DMPAPER_B5                " },
00167       { DMPAPER_FOLIO             , "DMPAPER_FOLIO             " },
00168       { DMPAPER_QUARTO            , "DMPAPER_QUARTO            " },
00169       { DMPAPER_10X14             , "DMPAPER_10X14             " },
00170       { DMPAPER_11X17             , "DMPAPER_11X17             " },
00171       { DMPAPER_NOTE              , "DMPAPER_NOTE              " },
00172       { DMPAPER_ENV_9             , "DMPAPER_ENV_9             " },
00173       { DMPAPER_ENV_10            , "DMPAPER_ENV_10            " },
00174       { DMPAPER_ENV_11            , "DMPAPER_ENV_11            " },
00175       { DMPAPER_ENV_12            , "DMPAPER_ENV_12            " },
00176       { DMPAPER_ENV_14            , "DMPAPER_ENV_14            " },
00177       { DMPAPER_CSHEET            , "DMPAPER_CSHEET            " },
00178       { DMPAPER_DSHEET            , "DMPAPER_DSHEET            " },
00179       { DMPAPER_ESHEET            , "DMPAPER_ESHEET            " },
00180       { DMPAPER_ENV_DL            , "DMPAPER_ENV_DL            " },
00181       { DMPAPER_ENV_C5            , "DMPAPER_ENV_C5            " },
00182       { DMPAPER_ENV_C3            , "DMPAPER_ENV_C3            " },
00183       { DMPAPER_ENV_C4            , "DMPAPER_ENV_C4            " },
00184       { DMPAPER_ENV_C6            , "DMPAPER_ENV_C6            " },
00185       { DMPAPER_ENV_C65           , "DMPAPER_ENV_C65           " },
00186       { DMPAPER_ENV_B4            , "DMPAPER_ENV_B4            " },
00187       { DMPAPER_ENV_B5            , "DMPAPER_ENV_B5            " },
00188       { DMPAPER_ENV_B6            , "DMPAPER_ENV_B6            " },
00189       { DMPAPER_ENV_ITALY         , "DMPAPER_ENV_ITALY         " },
00190       { DMPAPER_ENV_MONARCH       , "DMPAPER_ENV_MONARCH       " },
00191       { DMPAPER_ENV_PERSONAL      , "DMPAPER_ENV_PERSONAL      " },
00192       { DMPAPER_FANFOLD_STD_GERMAN, "DMPAPER_FANFOLD_STD_GERMAN" },
00193       { DMPAPER_FANFOLD_LGL_GERMAN, "DMPAPER_FANFOLD_LGL_GERMAN" } };
00194
00195 ENUMPRTLOOKUP gaDefaultSource[] =
00196
00197     { { DMBIN_FIRST        , "DMBIN_FIRST        " },
00198       { DMBIN_UPPER        , "DMBIN_UPPER        " },
00199       { DMBIN_ONLYONE      , "DMBIN_ONLYONE      " },
00200       { DMBIN_LOWER        , "DMBIN_LOWER        " },
00201       { DMBIN_MIDDLE       , "DMBIN_MIDDLE       " },
00202       { DMBIN_MANUAL       , "DMBIN_MANUAL       " },
00203       { DMBIN_ENVELOPE     , "DMBIN_ENVELOPE     " },
00204       { DMBIN_ENVMANUAL    , "DMBIN_ENVMANUAL    " },
00205       { DMBIN_AUTO         , "DMBIN_AUTO         " },
00206       { DMBIN_TRACTOR      , "DMBIN_TRACTOR      " },
00207       { DMBIN_SMALLFMT     , "DMBIN_SMALLFMT     " },
00208       { DMBIN_LARGEFMT     , "DMBIN_LARGEFMT     " },
00209       { DMBIN_LARGECAPACITY, "DMBIN_LARGECAPACITY" },
00210       { DMBIN_CASSETTE     , "DMBIN_CASSETTE     " },
00211       { DMBIN_LAST         , "DMBIN_LAST         " },
00212       { DMBIN_USER         , "DMBIN_USER         " } };
00213
00214 ENUMPRTLOOKUP gaPrintQuality[] =
00215
00216     { { (DWORD)DMRES_DRAFT , "DMRES_DRAFT " },
00217       { (DWORD)DMRES_LOW   , "DMRES_LOW   " },
00218       { (DWORD)DMRES_MEDIUM, "DMRES_MEDIUM" },
00219       { (DWORD)DMRES_HIGH  , "DMRES_HIGH  " } };
00220
00221 ENUMPRTLOOKUP gaColor[] =
00222
00223     { { DMCOLOR_MONOCHROME, "DMCOLOR_MONOCHROME" },
00224       { DMCOLOR_COLOR     , "DMCOLOR_COLOR     " } };
00225
00226 ENUMPRTLOOKUP gaDuplex[] =
00227
00228     { { DMDUP_SIMPLEX   , "DMDUP_SIMPLEX   " },
00229       { DMDUP_VERTICAL  , "DMDUP_VERTICAL  " },
00230       { DMDUP_HORIZONTAL, "DMDUP_HORIZONTAL" } };
00231
00232 char *gaDriverInfo[] =
00233
00234     {   "DRIVER_INFO_1",
00235         "  pName\t\t%s",
00236
00237         "DRIVER_INFO_2",
00238         "  cVersion\t%ld",
00239         "  pName\t\t%s",
00240         "  pEnvironment\t%s",
00241         "  pDriverPath\t%s",
00242         "  pDataFile\t%s",
00243         "  pConfigFile\t%s" };
00244
00245
00246
00247 /******************************************************************************\
00248 *                              EXTERNAL VARIABLES
00249 \******************************************************************************/
00250
00251 extern HWND ghwndMain;
00252
00253
00254
00255 /******************************************************************************\
00256 *                                  MACROS
00257 \******************************************************************************/
00258
00259 #define outstr(fmt,arg)  { wsprintf (buf,fmt,arg?arg:"(null)");           \
00260                            SendDlgItemMessage (hwnd, DID_LISTBOX,         \
00261                                                LB_INSERTSTRING, (UINT)-1, \
00262                                                (LONG_PTR) buf); }
00263
00264 #define outstr2(buf)     SendDlgItemMessage (hwnd, DID_LISTBOX,         \
00265                                              LB_INSERTSTRING, (UINT)-1, \
00266                                              (LONG_PTR) buf);
00267
00268 #define outstr3()        SendDlgItemMessage (hwnd, DID_LISTBOX,         \
00269                                              LB_INSERTSTRING,           \
00270                                              (UINT)-1, (LONG_PTR) buf);
00271
00272 #define outnum(fmt,arg)  { wsprintf(buf,fmt,arg);                         \
00273                            SendDlgItemMessage (hwnd, DID_LISTBOX,         \
00274                                                LB_INSERTSTRING, (UINT)-1, \
00275                                                (LONG_PTR) buf); }
00276
00277
00278
00279 /******************************************************************************\
00280 *                            FUNCTION PROTOTYPES
00281 \******************************************************************************/
00282
00283 LRESULT CALLBACK EnumPrintersOptionsDlgProc (HWND, UINT, WPARAM, LPARAM);
00284
00285 BOOL DisplayEnumPrintersInfo   (HWND);
00286 void SetEnumPrintersDlgFields  (HWND, DWORD, LPPRINTER_INFO_1,
00287                                 LPPRINTER_INFO_2);
00288 void ComplexEnumPrintersLine   (HWND, char *, ENUMPRTLOOKUP *, int, DWORD);
00289 BOOL DisplayPrinterDriversInfo (HWND);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/app.h Source File

  • Com
  • Fundamentals
  • SimpSvr

app.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: app.h
00003 //
00004 //      Definition of CSimpSvrApp
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _APP_H_)
00010 #define _APP_H_
00011 #include <stablize.h>
00012
00013 class CSimpSvrDoc;
00014 interface CClassFactory;
00015
00016 class CSimpSvrApp : public IUnknown, public CSafeRefCount
00017 {
00018 private:
00019
00020         HWND m_hAppWnd;             // main window handle
00021         HINSTANCE m_hInst;          // application instance
00022         BOOL m_fStartByOle;         // TRUE if app started by OLE
00023         DWORD m_dwRegisterClass;    // returned by RegisterClassFactory
00024
00025         HMENU m_hMainMenu;
00026         HMENU m_hColorMenu;
00027         HMENU m_hHelpMenu;
00028
00029
00030         LPOLEOBJECT m_OleObject;    // pointer to "dummy" object
00031
00032
00033         CSimpSvrDoc FAR * m_lpDoc;   // pointer to document object
00034         BOOL m_fInitialized;         // OLE initialization flag
00035         BOOL m_fOleStdInit;          // OleStd initialization flag
00036
00037         RECT nullRect;               // used in inplace negotiation
00038
00039 public:
00040         // IUnknown Interfaces
00041         STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
00042         STDMETHODIMP_(ULONG) AddRef();
00043         STDMETHODIMP_(ULONG) Release();
00044
00045         // Initialization methods
00046
00047         CSimpSvrApp();           // Constructor
00048         ~CSimpSvrApp();          // Destructor
00049
00050
00051   BOOL fInitApplication (HINSTANCE  hInstance);
00052   BOOL fInitInstance (HINSTANCE  hInstance, int nCmdShow, CClassFactory FAR * lpClassFactory);
00053
00054         // Message handling methods
00055
00056         long lCommandHandler (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00057         long lSizeHandler (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00058         long lCreateDoc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00059         void PaintApp(HDC hDC);
00060
00061         //  Utility functions
00062         void ParseCmdLine(LPSTR lpCmdLine);
00063         void SetStatusText();
00064         BOOL IsInPlaceActive();
00065         void ShowAppWnd(int nCmdShow=SW_SHOWNORMAL);
00066         void HideAppWnd();
00067
00068
00069         // member variable access
00070         inline HWND GethAppWnd() { return m_hAppWnd; };
00071         inline HINSTANCE GethInst() { return m_hInst; };
00072         inline BOOL IsStartedByOle() { return m_fStartByOle; };
00073         inline BOOL IsInitialized() { return m_fInitialized; };
00074         inline DWORD GetRegisterClass() { return m_dwRegisterClass; };
00075         inline CSimpSvrDoc FAR * GetDoc() { return m_lpDoc; };
00076         inline void ClearDoc() { m_lpDoc = NULL; };
00077         inline LPOLEOBJECT GetOleObject() { return m_OleObject; };
00078                 inline HMENU GetMainMenu() { return m_hMainMenu; };
00079         inline HMENU GetColorMenu() { return m_hColorMenu; };
00080         inline HMENU GetHelpMenu() { return m_hHelpMenu; } ;
00081
00082
00083         friend interface CClassFactory;  // make the contained class a friend
00084 };
00085
00086 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/LSP/provider.cpp Source File

  • NetDS
  • WinSock
  • LSP

provider.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: provider.cpp
00009 //
00010 // Description:
00011 //
00012 //    This sample illustrates how to develop a layered service provider.
00013 //    This sample is a pass through sample which only counts the bytes
00014 //    transfered on the socket.
00015 //
00016 //    This file contains support functions that are common to the lsp and
00017 //    the instlsp sample for enumerating the Winsock catalog of service
00018 //    providers.
00019 //
00020 //    Note all allocations made in this routine use the process heap and
00021 //    not the LSP heap since these routines are also used by the LSP
00022 //    installer (which doesn't create its own heap).
00023 //
00024
00025 #include <ws2spi.h>
00026 #include <sporder.h>
00027 #include "install.h"
00028
00029 #include <stdio.h>
00030 #include <stdlib.h>
00031
00032 //
00033 // Function: GetProviders
00034 //
00035 // Description:
00036 //    This enumerates the Winsock catalog via the global variable ProtocolInfo.
00037 //
00038 LPWSAPROTOCOL_INFOW EnumerateProviders(WINSOCK_CATALOG Catalog, LPINT TotalProtocols)
00039 {
00040   LPWSAPROTOCOL_INFOW ProtocolInfo = NULL;
00041   DWORD               ProtocolInfoSize = 0;
00042   INT                 ErrorCode,
00043                         rc;
00044
00045     if (TotalProtocols == NULL)
00046         return NULL;
00047
00048   *TotalProtocols = 0;
00049
00050 #ifdef _WIN64
00051   // Find out how many entries we need to enumerate
00052     if (Catalog == LspCatalog64Only)
00053     {
00054         // Find the size of the buffer
00055         rc = WSCEnumProtocols(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00056         if (rc == SOCKET_ERROR)
00057         {
00058             if (ErrorCode != WSAENOBUFS)
00059                 return NULL;
00060         }
00061
00062         // Allocate the buffer
00063         ProtocolInfo = (LPWSAPROTOCOL_INFOW) HeapAlloc(GetProcessHeap(), 0, ProtocolInfoSize);
00064         if (ProtocolInfo == NULL)
00065         {
00066             return NULL;
00067         }
00068
00069         // Enumerate the catalog for real
00070         rc = WSCEnumProtocols(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00071         if (rc == SOCKET_ERROR)
00072         {
00073             HeapFree(GetProcessHeap(), 0, ProtocolInfo);
00074             return NULL;
00075         }
00076
00077         // Update the count
00078         *TotalProtocols = rc;
00079     }
00080     else if (Catalog == LspCatalog32Only)
00081     {
00082         HMODULE            hModule;
00083         LPWSCENUMPROTOCOLS fnWscEnumProtocols32=NULL;
00084
00085         // Load ws2_32.dll
00086         hModule = LoadLibrary(TEXT("ws2_32.dll"));
00087         if (hModule == NULL)
00088             return NULL;
00089
00090         // Find the 32-bit catalog enumerator
00091         fnWscEnumProtocols32 = (LPWSCENUMPROTOCOLS)GetProcAddress(hModule, "WSCEnumProtocols32");
00092         if (fnWscEnumProtocols32 == NULL)
00093             return NULL;
00094
00095         // Find the required buffer size
00096         rc = fnWscEnumProtocols32(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00097         if (rc == SOCKET_ERROR)
00098         {
00099             if (ErrorCode != WSAENOBUFS)
00100                 return NULL;
00101         }
00102
00103         // Allocate the buffer
00104         ProtocolInfo = (LPWSAPROTOCOL_INFOW)HeapAlloc(GetProcessHeap(), 0, ProtocolInfoSize);
00105         if (ProtocolInfo == NULL)
00106         {
00107             return NULL;
00108         }
00109
00110         // Enumrate the catalog for real this time
00111         rc = fnWscEnumProtocols32(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00112         if (rc == SOCKET_ERROR)
00113         {
00114             HeapFree(GetProcessHeap(), 0, ProtocolInfo);
00115             return NULL;
00116         }
00117
00118         // Update the count
00119         *TotalProtocols = rc;
00120
00121         FreeLibrary(hModule);
00122     }
00123 #else
00124     if (Catalog == LspCatalog32Only)
00125     {
00126         // Find the size of the buffer
00127         rc = WSCEnumProtocols(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00128         if (rc == SOCKET_ERROR)
00129         {
00130             if (ErrorCode != WSAENOBUFS)
00131                 return NULL;
00132         }
00133
00134         // Allocate the buffer
00135         ProtocolInfo = (LPWSAPROTOCOL_INFOW) HeapAlloc(GetProcessHeap(), 0, ProtocolInfoSize);
00136         if (ProtocolInfo == NULL)
00137         {
00138             return NULL;
00139         }
00140
00141         // Enumerate the catalog for real
00142         rc = WSCEnumProtocols(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00143         if (rc == SOCKET_ERROR)
00144         {
00145             HeapFree(GetProcessHeap(), 0, ProtocolInfo);
00146             return NULL;
00147         }
00148
00149         // Update the count
00150         *TotalProtocols = rc;
00151     }
00152     else if (Catalog == LspCatalog64Only)
00153     {
00154         fprintf(stderr, "Unable to enumerate 64-bit Winsock catalog from 32-bit process!\n");
00155     }
00156 #endif
00157     else
00158     {
00159         // Find the size of the buffer
00160         rc = WSCEnumProtocols(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00161         if (rc == SOCKET_ERROR)
00162         {
00163             if (ErrorCode != WSAENOBUFS)
00164                 return NULL;
00165         }
00166
00167         // Allocate the buffer
00168         ProtocolInfo = (LPWSAPROTOCOL_INFOW) HeapAlloc(GetProcessHeap(), 0, ProtocolInfoSize);
00169         if (ProtocolInfo == NULL)
00170         {
00171             return NULL;
00172         }
00173
00174         // Enumerate the catalog for real
00175         rc = WSCEnumProtocols(NULL, ProtocolInfo, &ProtocolInfoSize, &ErrorCode);
00176         if (rc == SOCKET_ERROR)
00177         {
00178             HeapFree(GetProcessHeap(), 0, ProtocolInfo);
00179             return NULL;
00180         }
00181
00182         // Update the count
00183         *TotalProtocols = rc;
00184     }
00185
00186   return ProtocolInfo;
00187 }
00188
00189 //
00190 // Function: FreeProviders
00191 //
00192 // Description:
00193 //    This function frees the global catalog.
00194 //
00195 void FreeProviders(LPWSAPROTOCOL_INFOW ProtocolInfo)
00196 {
00197   HeapFree(GetProcessHeap(), 0, ProtocolInfo);
00198 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Replace.c Source File

  • WinUI
  • CommDlg
  • CDTest

Replace.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 /************************************************************************
00007
00008   File: replace.c
00009
00010   Purpose:
00011
00012     This file contains only one function that set the bDoFindDlg global
00013     variable to FALSE and then creates a dialog box with the same Callback
00014     function as the DoFindDialog() function does.
00015
00016     Since FindText() and ReplaceText() both use the FINDREPLACE
00017     structure to create their dialogs, one dialog proc and dialog box
00018     can handle both.
00019
00020   Functions:
00021
00022     - DoReplaceDialog()    -- Creates CDTEST's Find/Replace dialog.
00023
00024 ************************************************************************/
00025
00026 #include <windows.h>
00027 #include <commdlg.h>
00028 #include "cdtest.h"
00029 #include "replace.h"
00030 #include "find.h"
00031
00032
00033
00034 /************************************************************************
00035
00036   Function: DoReplaceDialog(HWND)
00037
00038   Purpose: To create CDTEST's find/replace dialog box.
00039
00040
00041   Returns: Nothing.
00042
00043   Comments:
00044
00045     FindText() and ReplaceText() are similiar enough so that
00046     the same dialog can be used to edit their creation structure elements,
00047     so a global variable "bDoFindDlg" keeps track of which one to create
00048     when the user clicks the OK or Multithread buttons...
00049
00050 ************************************************************************/
00051
00052 void DoReplaceDialog(HWND hwnd)
00053 {
00054
00055   bDoFindDlg = FALSE ;
00056
00057
00058   /* in order for the keyboard to work, a hook has to be installed before
00059      the dialog is created.  See find.c for more detail on this. */
00060
00061   hHook = SetWindowsHookEx(WH_MSGFILTER, lpfnFilterProc, hInst, GetCurrentThreadId()) ;
00062
00063   if (!hHook) return ;
00064
00065   DialogBox(hInst, MAKEINTRESOURCE(ID_FINDDIALOG), hwnd, FindProc) ;
00066
00067   UnhookWindowsHookEx(hHook) ;
00068
00069 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/dataobj.h Source File

  • SysMgmt
  • MMC
  • CMenu

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097
00098 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/vcAcct/CUpdateReceipt.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • vcAcct

CUpdateReceipt.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc19.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\mssdk\samples\com\Services\Transaction\SampleBank\vcacct\release\vcacct.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package vcacct;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=A81260B8-DDC8-11D0-B5A0-00C04FB957D8,DynamicCasts)
00019     @com.interface(iid=A81260B7-DDC8-11D0-B5A0-00C04FB957D8, thread=AUTO, type=DUAL) */
00020 public class CUpdateReceipt implements IUnknown,com.ms.com.NoAutoScripting,vcacct.IUpdateReceipt
00021 {
00022   /** @com.method(vtoffset=4, dispid=1610743808, type=METHOD, name="Update", addFlagsVtable=4)
00023       @com.parameters([type=I4] return) */
00024   public native int Update();
00025
00026
00027   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xa81260b7, (short)0xddc8, (short)0x11d0, (byte)0xb5, (byte)0xa0, (byte)0x0, (byte)0xc0, (byte)0x4f, (byte)0xb9, (byte)0x57, (byte)0xd8);
00028
00029   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0xa81260b8, (short)0xddc8, (short)0x11d0, (byte)0xb5, (byte)0xa0, (byte)0x0, (byte)0xc0, (byte)0x4f, (byte)0xb9, (byte)0x57, (byte)0xd8);
00030 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/people.Cpp Source File

  • SysMgmt
  • MMC
  • Extens

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include <stdio.h>
00021 #include "People.h"
00022
00023 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00024
00025 const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00026 const GUID CSkateboardFolder::thisGuid = { 0xef163733, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00027 const GUID CIceSkateFolder::thisGuid = { 0xf6c660b0, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00028
00029 const GUID CBicycle::thisGuid = { 0xef163734, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00030 const GUID CSkateboard::thisGuid = { 0xef163735, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00031 const GUID CIceSkate::thisGuid = { 0xf6c660b1, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00032
00033
00034 //==============================================================
00035 //
00036 // CPeoplePoweredVehicle implementation
00037 //
00038 //
00039 CPeoplePoweredVehicle::CPeoplePoweredVehicle()
00040 {
00041     children[0] = new CBicycleFolder;
00042     children[1] = new CSkateboardFolder;
00043     children[2] = new CIceSkateFolder;
00044 }
00045
00046 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00047 {
00048     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00049         delete children[n];
00050 }
00051
00052 HRESULT CPeoplePoweredVehicle::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00053 {
00054     SCOPEDATAITEM sdi;
00055
00056     if (!bExpanded) {
00057         // create the child nodes, then expand them
00058         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00059             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00060             sdi.mask = SDI_STR       |   // Displayname is valid
00061                 SDI_PARAM     |   // lParam is valid
00062                 SDI_IMAGE     |   // nImage is valid
00063                 SDI_OPENIMAGE |   // nOpenImage is valid
00064                 SDI_PARENT    |   // relativeID is valid
00065                 SDI_CHILDREN;     // cChildren is valid
00066
00067             sdi.relativeID  = (HSCOPEITEM)parent;
00068             sdi.nImage      = children[n]->GetBitmapIndex();
00069             sdi.nOpenImage  = INDEX_OPENFOLDER;
00070             sdi.displayname = MMC_CALLBACK;
00071             sdi.lParam      = (LPARAM)children[n];       // The cookie
00072             sdi.cChildren   = 0;
00073
00074             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00075
00076             _ASSERT( SUCCEEDED(hr) );
00077         }
00078     }
00079
00080     return S_OK;
00081 }
00082
00083 CBicycleFolder::CBicycleFolder()
00084 {
00085     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00086         children[n] = new CBicycle(n + 1);
00087     }
00088 }
00089
00090 CBicycleFolder::~CBicycleFolder()
00091 {
00092     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00093         if (children[n]) {
00094             delete children[n];
00095         }
00096 }
00097
00098 HRESULT CBicycleFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00099 {
00100     HRESULT      hr = S_OK;
00101
00102     IHeaderCtrl *pHeaderCtrl = NULL;
00103     IResultData *pResultData = NULL;
00104
00105     if (bShow) {
00106         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00107         _ASSERT( SUCCEEDED(hr) );
00108
00109         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00110         _ASSERT( SUCCEEDED(hr) );
00111
00112         // Set the column headers in the results pane
00113         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00114         _ASSERT( S_OK == hr );
00115
00116         // insert items here
00117         RESULTDATAITEM rdi;
00118
00119         hr = pResultData->DeleteAllRsltItems();
00120         _ASSERT( SUCCEEDED(hr) );
00121
00122         if (!bExpanded) {
00123             // create the child nodes, then expand them
00124             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00125                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00126                 rdi.mask       = RDI_STR       |   // Displayname is valid
00127                     RDI_IMAGE     |
00128                     RDI_PARAM;        // nImage is valid
00129
00130                 rdi.nImage      = children[n]->GetBitmapIndex();
00131                 rdi.str         = MMC_CALLBACK;
00132                 rdi.nCol        = 0;
00133                 rdi.lParam      = (LPARAM)children[n];
00134
00135                 hr = pResultData->InsertItem( &rdi );
00136
00137                 _ASSERT( SUCCEEDED(hr) );
00138             }
00139         }
00140
00141         pHeaderCtrl->Release();
00142         pResultData->Release();
00143     }
00144
00145     return hr;
00146 }
00147
00148 CIceSkateFolder::CIceSkateFolder()
00149 {
00150     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00151         children[n] = new CIceSkate(n + 1);
00152     }
00153 }
00154
00155 CIceSkateFolder::~CIceSkateFolder()
00156 {
00157     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00158         if (children[n]) {
00159             delete children[n];
00160         }
00161 }
00162
00163 HRESULT CIceSkateFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00164 {
00165     HRESULT      hr = S_OK;
00166
00167     IHeaderCtrl *pHeaderCtrl = NULL;
00168     IResultData *pResultData = NULL;
00169
00170     if (bShow) {
00171         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00172         _ASSERT( SUCCEEDED(hr) );
00173
00174         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00175         _ASSERT( SUCCEEDED(hr) );
00176
00177         // Set the column headers in the results pane
00178         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00179         _ASSERT( S_OK == hr );
00180
00181         // insert items here
00182         RESULTDATAITEM rdi;
00183
00184         hr = pResultData->DeleteAllRsltItems();
00185         _ASSERT( SUCCEEDED(hr) );
00186
00187         if (!bExpanded) {
00188             // create the child nodes, then expand them
00189             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00190                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00191                 rdi.mask       = RDI_STR       |   // Displayname is valid
00192                     RDI_IMAGE     |
00193                     RDI_PARAM;        // nImage is valid
00194
00195                 rdi.nImage      = children[n]->GetBitmapIndex();
00196                 rdi.str         = MMC_CALLBACK;
00197                 rdi.nCol        = 0;
00198                 rdi.lParam      = (LPARAM)children[n];
00199
00200                 hr = pResultData->InsertItem( &rdi );
00201
00202                 _ASSERT( SUCCEEDED(hr) );
00203             }
00204         }
00205
00206         pHeaderCtrl->Release();
00207         pResultData->Release();
00208     }
00209
00210     return hr;
00211 }
00212
00213 CSkateboardFolder::CSkateboardFolder()
00214 {
00215     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00216         children[n] = new CSkateboard(n + 1);
00217     }
00218 }
00219
00220 CSkateboardFolder::~CSkateboardFolder()
00221 {
00222     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00223         if (children[n]) {
00224             delete children[n];
00225         }
00226 }
00227
00228 HRESULT CSkateboardFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00229 {
00230     HRESULT      hr = S_OK;
00231
00232     IHeaderCtrl *pHeaderCtrl = NULL;
00233     IResultData *pResultData = NULL;
00234
00235     if (bShow) {
00236         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00237         _ASSERT( SUCCEEDED(hr) );
00238
00239         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00240         _ASSERT( SUCCEEDED(hr) );
00241
00242         // Set the column headers in the results pane
00243         hr = pHeaderCtrl->InsertColumn( 0, L"Name                      ", 0, MMCLV_AUTO );
00244         _ASSERT( S_OK == hr );
00245
00246         // insert items here
00247         RESULTDATAITEM rdi;
00248
00249         hr = pResultData->DeleteAllRsltItems();
00250         _ASSERT( SUCCEEDED(hr) );
00251
00252         if (!bExpanded) {
00253             // create the child nodes, then expand them
00254             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00255                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00256                 rdi.mask       = RDI_STR       |   // Displayname is valid
00257                     RDI_IMAGE     |
00258                     RDI_PARAM;        // nImage is valid
00259
00260                 rdi.nImage      = children[n]->GetBitmapIndex();
00261                 rdi.str         = MMC_CALLBACK;
00262                 rdi.nCol        = 0;
00263                 rdi.lParam      = (LPARAM)children[n];
00264
00265                 hr = pResultData->InsertItem( &rdi );
00266
00267                 _ASSERT( SUCCEEDED(hr) );
00268             }
00269         }
00270
00271         pHeaderCtrl->Release();
00272         pResultData->Release();
00273     }
00274
00275     return hr;
00276 }
00277
00278 const _TCHAR *CBicycle::GetDisplayName(int nCol)
00279 {
00280     static _TCHAR buf[128];
00281
00282     _stprintf(buf, _T("Bicycle #%d"), id);
00283
00284     return buf;
00285 }
00286
00287 const _TCHAR *CSkateboard::GetDisplayName(int nCol)
00288 {
00289     static _TCHAR buf[128];
00290
00291     _stprintf(buf, _T("Skateboard #%d"), id);
00292
00293     return buf;
00294 }
00295
00296 const _TCHAR *CIceSkate::GetDisplayName(int nCol)
00297 {
00298     static _TCHAR buf[128];
00299
00300     _stprintf(buf, _T("Ice Skate #%d"), id);
00301
00302     return buf;
00303 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/registry.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

registry.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include <ObjBase.h>
00016 #include "Registry.h"
00017 #include "Globals.h"
00018
00019
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("Registry")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Internal helper functions prototypes
00027
00028
00029 // Set the given key and its value.
00030 HRESULT SetKeyAndValue( const TCHAR* pszPath, const TCHAR* szSubkey, const TCHAR* szValue);
00031
00032 // Set the given key and its value in the MMC Snapin location
00033 HRESULT SetSnapInKeyAndValue( const TCHAR* szKey, const TCHAR* szSubkey, const TCHAR* szName, const TCHAR* szValue );
00034
00035 // Set the given valuename under the key to value
00036 HRESULT SetValue( const TCHAR* szKey, const TCHAR* szValueName, const TCHAR* szValue);
00037
00038 // Delete szKeyChild and all of its descendents.
00039 HRESULT RecursiveDeleteKey( HKEY hKeyParent, const TCHAR* szKeyChild );
00040
00041 // Set key for nodes which we want to extend us
00042 HRESULT SetExtensionKey( TCHAR* szNode2Extend, TCHAR* szExtensionNode, TCHAR* szExtensionType, TCHAR* szDescription );
00043 HRESULT SetNodeTypesKey( const TCHAR* szNodeGuid );
00044
00045
00046 /////////////////////////////////////////////////////////////////////////////
00047 // Public function implementation
00048
00049
00050 //---------------------------------------------------------------------------
00051 //  Register the component in the registry.  This is the minimalist way
00052 //  to register a component, you may want to add keys for ProgID.
00053 //
00054 HRESULT RegisterServer
00055 (
00056   HMODULE        hModule,          //[in] DLL module handle
00057   const CLSID&   clsid,            //[in] Class ID
00058   const TCHAR*   szFriendlyName    //[in] Name string
00059 )
00060 {
00061   // Get server location.
00062   TCHAR    szModule[512] ;
00063   TCHAR*   pszCLSID = NULL;
00064   LPOLESTR wszCLSID = NULL ;
00065   HRESULT  hResult  = S_FALSE;
00066
00067   DWORD dwResult = ::GetModuleFileName( hModule,
00068                                         szModule,
00069                                         sizeof(szModule)/sizeof(TCHAR)
00070                                       );
00071   if( 0 == dwResult ) return HRESULT_FROM_WIN32( dwResult );
00072
00073   do                         // Fail unless we complete everything
00074   {
00075     // Get CLSID string in wide char
00076     hResult = StringFromCLSID( clsid, &wszCLSID ) ;
00077     if( S_OK != hResult )
00078     {
00079       CoTaskMemFree( wszCLSID );
00080       BREAK_ON_ERROR( hResult );
00081     }
00082
00083     W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00084     CoTaskMemFree( wszCLSID );           // Through with wide version
00085
00086     TCHAR szKey[64];                     // Build the CLSID key string CLSID\\{...}
00087     _tcscpy( szKey, _T("CLSID\\") );
00088     _tcscat( szKey, pszCLSID );
00089
00090     // Add the CLSID to the registry.
00091     hResult = SetKeyAndValue( szKey, NULL, szFriendlyName );
00092     BREAK_ON_ERROR( hResult );
00093
00094     // Add the server filename subkey under the CLSID key.
00095     hResult = SetKeyAndValue( szKey, _T("InprocServer32"), szModule );
00096     BREAK_ON_ERROR( hResult );
00097
00098     // Set the threading model
00099     _tcscat( szKey, _T("\\InprocServer32") );
00100     hResult = SetValue( szKey, _T("ThreadingModel"), _T("Apartment") );
00101     BREAK_ON_ERROR( hResult );
00102
00103   }while( 0 );
00104
00105   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00106
00107   return hResult;
00108 }
00109
00110
00111 //---------------------------------------------------------------------------
00112 // Remove the component from the registry.
00113 //
00114 LONG UnregisterServer
00115 (
00116   const CLSID& clsid         //[in] Class ID of component to remove
00117 )
00118 {
00119   HRESULT hResult = S_OK;
00120
00121   // Allocate the CLSID string
00122   LPOLESTR wszCLSID = NULL ;
00123   hResult = StringFromCLSID( clsid, &wszCLSID );
00124   if( S_OK != hResult )
00125   {
00126     CoTaskMemFree( wszCLSID );
00127     return hResult;
00128   }
00129
00130   // Build the key CLSID\\{...}
00131   TCHAR szKey[64];
00132   _tcscpy( szKey, _T("CLSID\\") );
00133
00134   TCHAR* pszCLSID = NULL;
00135   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00136   CoTaskMemFree( wszCLSID );           // Through with wide version
00137
00138   _tcscat( szKey, pszCLSID );
00139   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00140
00141   // Delete the CLSID Key - CLSID\{...}
00142   LONG lResult = RecursiveDeleteKey( HKEY_CLASSES_ROOT, szKey );
00143   if( ERROR_SUCCESS != lResult )
00144     hResult = HRESULT_FROM_WIN32( lResult );
00145
00146   return hResult;
00147 }
00148
00149 //---------------------------------------------------------------------------
00150 // Register the snap-in in the registry.
00151 //
00152 HRESULT RegisterSnapin
00153 (
00154   const  CLSID&  clsid,              //[in] Class ID
00155   const  TCHAR*  szNameString,       //[in] NameString
00156   const  CLSID&  clsidAbout,         //[in] Class Id for About Class
00157   const  BOOL    bSupportExtensions  //[in] TRUE if we support extensions
00158 )
00159 {
00160   HRESULT hResult = S_FALSE;
00161   TCHAR*  pszSnapCLSID = NULL;         // Needed for TCHAR version of the ClassID
00162
00163   // If any part of this process fails, jump out of the loop and return
00164   // the error code
00165   do
00166   {
00167     // Allocate the CLSID string
00168     LPOLESTR wszSnapCLSID  = NULL ;
00169     hResult = StringFromCLSID( clsid, &wszSnapCLSID ) ;
00170     if( S_OK != hResult )
00171     {
00172        CoTaskMemFree( wszSnapCLSID );
00173        continue;
00174     }
00175
00176     W2T( &pszSnapCLSID, wszSnapCLSID );  // W2T is defined in Globals.h
00177     CoTaskMemFree( wszSnapCLSID );       // Through with wide version
00178
00179     // Add the Snap-in's CLSID to the registry
00180     hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("NameString"), szNameString );
00181     BREAK_ON_ERROR( hResult );
00182
00183     hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("StandAlone"), NULL, NULL );
00184     BREAK_ON_ERROR( hResult );
00185
00186     // Add registry information for ISnapinAbout if we support it
00187     LPOLESTR wszAboutCLSID = NULL;
00188     TCHAR*   pszAboutCLSID = NULL;
00189     if( IID_NULL != clsidAbout )
00190     {
00191       hResult = StringFromCLSID( clsidAbout, &wszAboutCLSID );
00192       if( S_OK != hResult )
00193       {
00194         CoTaskMemFree( wszAboutCLSID ); // Free this memory before exiting
00195         continue;
00196       }
00197
00198       W2T( &pszAboutCLSID, wszAboutCLSID );
00199       hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("About"), pszAboutCLSID );
00200       CoTaskMemFree( wszAboutCLSID );
00201       CoTaskMemFree( pszAboutCLSID );
00202       BREAK_ON_ERROR( hResult );
00203     }
00204
00205     if( TRUE == bSupportExtensions )     // Build the NodeTypesKey
00206     {
00207       hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("NodeTypes"), NULL, NULL );
00208       BREAK_ON_ERROR( hResult );
00209       TCHAR szKey[64];
00210       _tcscpy( szKey, pszSnapCLSID );
00211       _tcscat(szKey, _T("\\NodeTypes"));
00212       hResult = SetSnapInKeyAndValue( szKey, pszSnapCLSID, NULL, NULL );
00213       BREAK_ON_ERROR( hResult );
00214
00215       // First set the values for the node which will be extended.
00216       hResult = SetSnapInKeyAndValue( szKey, gtszCLSID_DEVICENODE, NULL, NULL );
00217       BREAK_ON_ERROR( hResult );
00218
00219       // Add the GUID for the node which will be extended under MMC/NodeTypes
00220       hResult = SetNodeTypesKey( gtszCLSID_DEVICENODE );
00221       BREAK_ON_ERROR( hResult );
00222     }
00223   }while( 0 );
00224
00225   CoTaskMemFree( pszSnapCLSID);
00226   return hResult;
00227 }
00228
00229
00230 //---------------------------------------------------------------------------
00231 // Unregister the snap-in in the registry.
00232 //
00233 HRESULT UnregisterSnapin
00234 (
00235   const CLSID& clsid         //[in] Class ID of object to unregister
00236 )
00237 {
00238   HRESULT hResult = S_OK;
00239
00240   TCHAR    szKeyBuf[1024];
00241   LPOLESTR wszCLSID = NULL;
00242   TCHAR*   pszCLSID = NULL;        // Needed for TCHAR version of the ClassID
00243
00244   // Get CLSID as a wide string
00245   hResult = StringFromCLSID( clsid, &wszCLSID );
00246   if( S_OK != hResult )
00247   {
00248     CoTaskMemFree( wszCLSID );
00249     return hResult;
00250   }
00251
00252   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00253   CoTaskMemFree( wszCLSID );           // Through with wide version
00254
00255   // Load the buffer with the Snap-In Location
00256   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00257
00258   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00259   _tcscat( szKeyBuf, pszCLSID );
00260
00261   // Delete the CLSID Key - CLSID\{...}
00262   LONG lResult = RecursiveDeleteKey( HKEY_LOCAL_MACHINE, szKeyBuf );
00263   if( ERROR_SUCCESS != lResult )
00264     hResult = HRESULT_FROM_WIN32( lResult );
00265
00266   CoTaskMemFree( pszCLSID );
00267   return hResult;
00268 }
00269
00270 //---------------------------------------------------------------------------
00271 // Delete a key and all of its descendents.
00272 //
00273 HRESULT RecursiveDeleteKey
00274 (
00275   HKEY          hKeyParent,    //[in] Parent of key to delete
00276   const TCHAR*  lpszKeyChild   //[in] Key to delete
00277 )
00278 {
00279   // Open the child.
00280   HKEY hKeyChild = NULL;
00281   LONG lResult   = ERROR_SUCCESS;
00282
00283   do                     // We go to all this trouble to prevent any
00284   {                      // possibility of exiting while leaving a key open
00285
00286     lResult = RegOpenKeyEx( hKeyParent,
00287                             lpszKeyChild,
00288                             0,
00289                             KEY_ALL_ACCESS,
00290                             &hKeyChild
00291                           );
00292     if( ERROR_SUCCESS != lResult )
00293       continue;
00294
00295     // Enumerate all of the decendents of this child.
00296     FILETIME time;
00297     _TCHAR szBuffer[256];
00298     DWORD dwSize = 256;
00299     while( S_OK == RegEnumKeyEx(hKeyChild,0,szBuffer,&dwSize,NULL,NULL,NULL,&time) )
00300     {
00301       // Delete the decendents of this child.
00302       lResult = RecursiveDeleteKey( hKeyChild, szBuffer );
00303       if( ERROR_SUCCESS != lResult )
00304       {
00305         continue;
00306       }
00307       dwSize = 256;
00308     }
00309   }while( 0 );
00310
00311   RegCloseKey( hKeyChild );            // Always try to close the child
00312                                        // then delete this child.
00313   return RegDeleteKey( hKeyParent, lpszKeyChild );
00314 }
00315
00316 //---------------------------------------------------------------------------
00317 // Create a Registry Key and set its value.
00318 //   - This helper function was borrowed and modifed from
00319 //     Kraig Brockschmidt's book Inside OLE.
00320 //
00321 HRESULT SetKeyAndValue
00322 (
00323   const TCHAR*  szKey,       //[in] Parent key
00324   const TCHAR*  szSubkey,    //[in] Child key
00325   const TCHAR*  szValue      //[in] Value to set
00326 )
00327 {
00328   HKEY hKey = NULL;
00329   HRESULT hResult = S_FALSE;
00330   TCHAR szKeyBuf[1024];
00331
00332   // Copy keyname into buffer.
00333   _tcscpy( szKeyBuf, szKey );
00334
00335   // Add subkey name to buffer.
00336   if( NULL != szSubkey )
00337   {
00338     _tcscat( szKeyBuf, _T("\\") );
00339     _tcscat( szKeyBuf, szSubkey );
00340   }
00341
00342   do                     // We go to all this trouble to prevent any
00343   {                      // possibility of exiting while leaving a key open
00344
00345     // Create and open key and subkey.
00346     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT,
00347                                    szKeyBuf,
00348                                    0,
00349                                    NULL,
00350                                    REG_OPTION_NON_VOLATILE,
00351                                    KEY_ALL_ACCESS,
00352                                    NULL,
00353                                    &hKey,
00354                                    NULL
00355                                  );
00356     if( ERROR_SUCCESS != lResult )
00357     {
00358       hResult = HRESULT_FROM_WIN32( lResult );
00359       continue;
00360     }
00361
00362     if( NULL != szValue )    // Now set the value
00363     {
00364       hResult = RegSetValueEx( hKey,
00365                                NULL,
00366                                0,
00367                                REG_SZ,
00368                                (BYTE*)szValue,
00369                                BYTE_SIZE( szValue )    // BYTE_SIZE is in Globals.h
00370                              );
00371       BREAK_ON_ERROR( hResult );
00372     }
00373   }while( 0 );
00374
00375   RegCloseKey( hKey );       // Always try to close the key
00376   return hResult;
00377 }
00378
00379
00380 //---------------------------------------------------------------------------
00381 // Open a key value and set it
00382 //
00383 HRESULT SetValue
00384 (
00385   const TCHAR*  szKey,         //[in] Parent key
00386   const TCHAR*  szValueName,   //[in] Name of value
00387   const TCHAR*  szValue        //[in] Value in string format
00388 )
00389 {
00390   HKEY    hKey = NULL;
00391   HRESULT hResult = S_FALSE;
00392   TCHAR szKeyBuf[1024];
00393
00394   // Copy keyname into buffer.
00395   _tcscpy( szKeyBuf, szKey );
00396
00397   do                     // We go to all this trouble to prevent any
00398   {                      // possibility of exiting while leaving a key open
00399
00400     // Create and open key and subkey.
00401     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT ,
00402                                    szKeyBuf,
00403                                    0,
00404                                    NULL,
00405                                    REG_OPTION_NON_VOLATILE,
00406                                    KEY_ALL_ACCESS,
00407                                    NULL,
00408                                    &hKey,
00409                                    NULL
00410                                  );
00411     if( ERROR_SUCCESS != lResult )
00412     {
00413       hResult = HRESULT_FROM_WIN32( lResult );
00414       continue;
00415     }
00416
00417     if( NULL != szValue )    // Now set the value
00418     {
00419       hResult = RegSetValueEx( hKey,
00420                                szValueName,
00421                                0,
00422                                REG_SZ,
00423                                (BYTE*)szValue,
00424                                BYTE_SIZE( szValue )
00425                              );
00426       BREAK_ON_ERROR( hResult );
00427     }
00428   }while( 0 );
00429
00430   RegCloseKey( hKey );       //Always attempt to close the key
00431   return hResult;
00432 }
00433
00434
00435 //---------------------------------------------------------------------------
00436 // Create a key and set its value.
00437 //   - This helper function was borrowed and modifed from
00438 //     Kraig Brockschmidt's book Inside OLE.
00439 //
00440 HRESULT SetSnapInKeyAndValue
00441 (
00442   const TCHAR*  szKey,       //[in] Parent key
00443   const TCHAR*  szSubkey,    //[in] Child key
00444   const TCHAR*  szName,      //[in] Value name
00445   const TCHAR*  szValue      //[in] Value in string format
00446 )
00447 {
00448   HKEY    hKey = NULL;
00449   HRESULT hResult = S_FALSE;
00450   TCHAR   szKeyBuf[1024];
00451
00452   // Load the buffer with the Snap-In Location
00453   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00454
00455   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00456   _tcscat( szKeyBuf, szKey );
00457
00458   if( NULL != szSubkey )               // Add subkey name to buffer.
00459   {
00460     _tcscat( szKeyBuf, _T("\\") );
00461     _tcscat( szKeyBuf, szSubkey );
00462   }
00463
00464   do                     // We go to all this trouble to prevent any
00465   {                      // possibility of exiting while leaving a key open
00466
00467     // Create and open key and subkey.
00468     long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00469                                    szKeyBuf,
00470                                    0,
00471                                    NULL,
00472                                    REG_OPTION_NON_VOLATILE,
00473                                    KEY_ALL_ACCESS,
00474                                    NULL,
00475                                    &hKey,
00476                                    NULL
00477                                  );
00478     if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00479       continue;
00480
00481     // Set the Value.
00482     if( szValue != NULL )
00483     {
00484       hResult = RegSetValueEx( hKey,
00485                                szName,
00486                                0,
00487                                REG_SZ,
00488                                (BYTE*)szValue,
00489                                BYTE_SIZE(szValue)
00490                              );
00491       BREAK_ON_ERROR( hResult );
00492     }
00493     else
00494     {                        // Got this far so everything is OK.
00495       hResult = S_OK;
00496     }
00497   }while( 0 );
00498
00499   RegCloseKey( hKey );       //Always attempt to close the key
00500   return hResult;
00501 }
00502
00503 //---------------------------------------------------------------------------
00504 //  Adds the keys under the MMC/NodeTypes key to register the
00505 //  GUID passed in as an extension.
00506 //
00507 HRESULT SetExtensionKey
00508 (
00509   TCHAR*  szNode2Extend,     //[in] GUID of node we are extending
00510   TCHAR*  szExtensionNode,   //[in] GUID of extension node
00511   TCHAR*  szExtensionType,   //[in] Type of extension
00512   TCHAR*  szDescription      //[in] Description string
00513 )
00514 {
00515   HKEY    hNodeKey = NULL;
00516   HRESULT hResult  = S_FALSE;
00517   TCHAR   szKeyBuf[1024];
00518
00519   // Load the buffer with the NodeTypes Location
00520   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes") );
00521
00522   _tcscat( szKeyBuf, _T("\\") );       // Copy NodeType GUID into buffer.
00523   _tcscat( szKeyBuf, szNode2Extend );
00524
00525                                        // Copy Subkeys into buffer
00526   _tcscat( szKeyBuf, _T("\\Extensions\\") );
00527   _tcscat( szKeyBuf, szExtensionType );
00528
00529   long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00530                                  szKeyBuf,
00531                                  0,
00532                                  NULL,
00533                                  REG_OPTION_NON_VOLATILE,
00534                                  KEY_ALL_ACCESS,
00535                                  NULL,
00536                                  &hNodeKey,
00537                                  NULL
00538                                );
00539
00540   if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00541   {
00542     RegCloseKey( hNodeKey );
00543     return S_FALSE;
00544   }
00545
00546   hResult = RegSetValueEx( hNodeKey,
00547                            szExtensionNode,
00548                            0,
00549                            REG_SZ,
00550                            (BYTE*)szDescription,
00551                            BYTE_SIZE(szDescription)
00552                          );
00553
00554   return hResult;
00555 }
00556
00557 //---------------------------------------------------------------------------
00558 //  New method which adds a key for a nodetype guid.  Need to
00559 //  do this for every nodetype which can be extended.
00560 //
00561 HRESULT SetNodeTypesKey
00562 (
00563   const TCHAR*  szNodeGuid       //[in] Parent key
00564 )
00565 {
00566   HKEY    hKey = NULL;
00567   TCHAR   szKeyBuf[1024];
00568
00569   // Load the buffer with the Snap-In Location
00570   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes") );
00571   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00572   _tcscat( szKeyBuf, szNodeGuid );
00573
00574   // Create and open key.
00575   long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00576                                  szKeyBuf,
00577                                  0,
00578                                  NULL,
00579                                  REG_OPTION_NON_VOLATILE,
00580                                  KEY_ALL_ACCESS,
00581                                  NULL,
00582                                  &hKey,
00583                                  NULL
00584                                );
00585
00586   RegCloseKey( hKey );       //Always close the key
00587   return (ERROR_SUCCESS == lResult) ? S_OK : S_FALSE;
00588
00589 }
00590
00591
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/StdAfx.Cpp Source File

  • Com
  • Administration
  • Explore.VC

StdAfx.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 // stdafx.cpp : source file that includes just the standard includes
00020 //  VCExplore.pch will be the pre-compiled header
00021 //  stdafx.obj will contain the pre-compiled type information
00022
00023 #include "stdafx.h"
00024
00025
00026
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/ComSpyproppage.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

ComSpyproppage.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __COMSPYPROPPAGE_H_
00018 #define __COMSPYPROPPAGE_H_
00019
00020 #include "resource.h"       // main symbols
00021
00022 EXTERN_C const CLSID CLSID_ComSpyPropPage;
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // CComSpyPropPage
00027 class ATL_NO_VTABLE CComSpyPropPage :
00028   public CComObjectRootEx<CComSingleThreadModel>,
00029   public CComCoClass<CComSpyPropPage, &CLSID_ComSpyPropPage>,
00030   public IPropertyPageImpl<CComSpyPropPage>,
00031   public CDialogImpl<CComSpyPropPage>
00032 {
00033
00034
00035 public:
00036   CComPtr<IComSpy> m_pSpy;
00037
00038   CComSpyPropPage()
00039   {
00040     m_dwTitleID = IDS_TITLEComSpyPropPage;
00041     m_dwHelpFileID = IDS_HELPFILEComSpyPropPage;
00042     m_dwDocStringID = IDS_DOCSTRINGComSpyPropPage;
00043     m_bDirty = FALSE;
00044   }
00045
00046   enum {IDD = IDD_COMSPYPROPPAGE};
00047
00048 DECLARE_REGISTRY_RESOURCEID(IDR_COMSPYPROPPAGE)
00049
00050 BEGIN_COM_MAP(CComSpyPropPage)
00051   COM_INTERFACE_ENTRY_IMPL(IPropertyPage)
00052 END_COM_MAP()
00053
00054 BEGIN_MSG_MAP(CComSpyPropPage)
00055   CHAIN_MSG_MAP(IPropertyPageImpl<CComSpyPropPage>)
00056   MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
00057   COMMAND_ID_HANDLER(IDC_COLUMN_NAMES, OnSelectColumn)
00058   COMMAND_HANDLER(IDC_WIDTH, EN_CHANGE, OnWidthChange)
00059   COMMAND_HANDLER(IDC_WIDTH, EN_CHANGE, OnLogFileChange)
00060   COMMAND_HANDLER(IDC_SHOW_GRID_LINES, BN_CLICKED, OnCheckBoxClick)
00061   COMMAND_HANDLER(IDC_LOG_TO_FILE, BN_CLICKED, OnCheckBoxClick)
00062   COMMAND_HANDLER(IDC_SHOW_ON_SCREEN, BN_CLICKED, OnCheckBoxClick)
00063 END_MSG_MAP()
00064
00065 LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00066 LRESULT OnSelectColumn(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00067
00068 LRESULT OnWidthChange(WORD wNotify, WORD wID, HWND hWnd, BOOL& bHandled)
00069 {
00070   SetDirty(TRUE);
00071   int nSel = SendDlgItemMessage(IDC_COLUMN_NAMES, CB_GETCURSEL, 0, 0L);
00072   BOOL bSuccess;
00073   UINT nVal = GetDlgItemInt(IDC_WIDTH, &bSuccess, FALSE);
00074   SendDlgItemMessage(IDC_COLUMN_NAMES, CB_SETITEMDATA, nSel, nVal); // indicating that its width changed
00075   return 0;
00076
00077 }
00078 LRESULT OnLogFileChange(WORD wNotify, WORD wID, HWND hWnd, BOOL& bHandled)
00079 {
00080   SetDirty(TRUE);
00081   return 0;
00082
00083 }
00084
00085 LRESULT OnCheckBoxClick(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00086 {
00087   SetDirty(TRUE);
00088   return 0;
00089
00090 }
00091   STDMETHOD(Apply)(void);
00092
00093 };
00094
00095 #endif //__COMSPYPROPPAGE_H_
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/common.cpp Source File

  • Dataaccess
  • oledb
  • tablecopy

common.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1995-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module COMMON.CPP
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////////////////
00012 // Include
00013 //
00014 /////////////////////////////////////////////////////////////////////////////
00015 #include "winmain.h"
00016 #include "common.h"
00017 #include "tablecopy.h"
00018 #include "table.h"
00019
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 //  Defines
00023 //
00024 /////////////////////////////////////////////////////////////////////////////
00025
00026 //Displays values like VALUE as   VALUE , L"VALUE"
00027 #define VALUE_WCHAR(value) value, L#value
00028
00029 typedef struct _TYPEMAP
00030 {
00031   DBTYPE    wType;        // The sql type value
00032   WCHAR*    pwszTypeName;   // Name for display
00033 } TYPEMAP;
00034
00035 TYPEMAP rgDBTypes[] =
00036 {
00037   VALUE_WCHAR(NULL),
00038   VALUE_WCHAR(DBTYPE_I1),
00039   VALUE_WCHAR(DBTYPE_I2),
00040   VALUE_WCHAR(DBTYPE_I4),
00041   VALUE_WCHAR(DBTYPE_I8),
00042   VALUE_WCHAR(DBTYPE_UI1),
00043   VALUE_WCHAR(DBTYPE_UI2),
00044   VALUE_WCHAR(DBTYPE_UI4),
00045   VALUE_WCHAR(DBTYPE_UI8),
00046   VALUE_WCHAR(DBTYPE_R4),
00047   VALUE_WCHAR(DBTYPE_R8),
00048   VALUE_WCHAR(DBTYPE_CY),
00049   VALUE_WCHAR(DBTYPE_DECIMAL),
00050   VALUE_WCHAR(DBTYPE_NUMERIC),
00051   VALUE_WCHAR(DBTYPE_BOOL),
00052   VALUE_WCHAR(DBTYPE_ERROR),
00053   VALUE_WCHAR(DBTYPE_UDT),
00054   VALUE_WCHAR(DBTYPE_VARIANT),
00055   VALUE_WCHAR(DBTYPE_IDISPATCH),
00056   VALUE_WCHAR(DBTYPE_IUNKNOWN),
00057   VALUE_WCHAR(DBTYPE_GUID),
00058   VALUE_WCHAR(DBTYPE_DATE),
00059   VALUE_WCHAR(DBTYPE_DBDATE),
00060   VALUE_WCHAR(DBTYPE_DBTIME),
00061   VALUE_WCHAR(DBTYPE_DBTIMESTAMP),
00062   VALUE_WCHAR(DBTYPE_BSTR),
00063   VALUE_WCHAR(DBTYPE_STR),
00064   VALUE_WCHAR(DBTYPE_WSTR),
00065   VALUE_WCHAR(DBTYPE_BYTES),
00066 };
00067
00068
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 // HRESULT ConvertToMBCS
00072 //
00073 /////////////////////////////////////////////////////////////////////////////
00074 HRESULT ConvertToMBCS(WCHAR* pwsz, CHAR* psz, ULONG cStrLen)
00075 {
00076   ASSERT(pwsz && psz);
00077
00078   //Convert the string to MBCS
00079   INT iResult = WideCharToMultiByte(CP_ACP, 0, pwsz, -1, psz, cStrLen, NULL, NULL);
00080   return iResult ? S_OK : E_FAIL;
00081 }
00082
00083 /////////////////////////////////////////////////////////////////////////////
00084 // HRESULT ConvertToWCHAR
00085 //
00086 /////////////////////////////////////////////////////////////////////////////
00087 HRESULT ConvertToWCHAR(CHAR* psz, WCHAR* pwsz, ULONG cStrLen)
00088 {
00089   ASSERT(psz && pwsz);
00090
00091   //Convert the string to MBCS
00092   INT iResult = MultiByteToWideChar(CP_ACP, 0, psz, -1, pwsz, cStrLen);
00093   return iResult ? S_OK : E_FAIL;
00094 }
00095
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // WCHAR* wcsDuplicate
00099 //
00100 /////////////////////////////////////////////////////////////////////////////
00101 WCHAR* wcsDuplicate(WCHAR* pwsz)
00102 {
00103   ASSERT(pwsz);
00104
00105   //no-op case
00106   if(!pwsz)
00107     return NULL;
00108
00109   ULONG cLen  = wcslen(pwsz);
00110
00111   //Allocate space for the string
00112   WCHAR* pwszBuffer = NULL;
00113   SAFE_ALLOC(pwszBuffer, WCHAR, cLen+1);
00114
00115   //Now copy the string
00116   wcscpy(pwszBuffer, pwsz);
00117
00118 CLEANUP:
00119   return pwszBuffer;
00120 }
00121
00122
00123 /////////////////////////////////////////////////////////////////////////////
00124 // ULONG GetCreateParams
00125 //
00126 /////////////////////////////////////////////////////////////////////////////
00127 ULONG GetCreateParams(WCHAR* pwszCreateParam)
00128 {
00129   ASSERT(pwszCreateParam);
00130
00131   ULONG ulType = 0;
00132
00133   if(wcsstr(pwszCreateParam, L"precision") || wcsstr(pwszCreateParam, L"PRECISION"))
00134     ulType |= CP_PRECISION;
00135   if(wcsstr(pwszCreateParam, L"scale") || wcsstr(pwszCreateParam, L"SCALE"))
00136     ulType |= CP_SCALE;
00137   if(wcsstr(pwszCreateParam, L"length") || wcsstr(pwszCreateParam, L"LENGTH"))
00138     ulType |= CP_LENGTH;
00139   if(wcsstr(pwszCreateParam, L"max length") || wcsstr(pwszCreateParam, L"MAX LENGTH"))
00140     ulType |= CP_MAXLENGTH;
00141
00142   return ulType;
00143 }
00144
00145
00146 /////////////////////////////////////////////////////////////////////////////
00147 // BOOL IsVariableType
00148 //
00149 /////////////////////////////////////////////////////////////////////////////
00150 BOOL IsVariableType(DBTYPE wType)
00151 {
00152   //According to OLEDB Spec Appendix A (Variable-Length Data Types)
00153   switch(wType)
00154   {
00155     case DBTYPE_STR:
00156     case DBTYPE_WSTR:
00157     case DBTYPE_BYTES:
00158       return TRUE;
00159   }
00160   return FALSE;
00161 }
00162
00163
00164 /////////////////////////////////////////////////////////////////////////////
00165 // BOOL IsFixedType
00166 //
00167 /////////////////////////////////////////////////////////////////////////////
00168 BOOL IsFixedType(DBTYPE wType)
00169 {
00170   return !IsVariableType(wType);
00171 }
00172
00173 /////////////////////////////////////////////////////////////////////////////
00174 // BOOL IsNumericType
00175 //
00176 /////////////////////////////////////////////////////////////////////////////
00177 BOOL IsNumericType(DBTYPE wType)
00178 {
00179   //According to OLEDB Spec Appendix A (Numeric Data Types)
00180   switch(wType)
00181   {
00182     case DBTYPE_I1:
00183     case DBTYPE_I2:
00184     case DBTYPE_I4:
00185     case DBTYPE_I8:
00186     case DBTYPE_UI1:
00187     case DBTYPE_UI2:
00188     case DBTYPE_UI4:
00189     case DBTYPE_UI8:
00190     case DBTYPE_R4:
00191     case DBTYPE_R8:
00192     case DBTYPE_CY:
00193     case DBTYPE_DECIMAL:
00194     case DBTYPE_NUMERIC:
00195       return TRUE;
00196   }
00197   return FALSE;
00198 }
00199
00200 /////////////////////////////////////////////////////////////////////////////
00201 // WCHAR* GetDBTypeName
00202 //
00203 /////////////////////////////////////////////////////////////////////////////
00204 WCHAR* GetDBTypeName(DBTYPE wType)
00205 {
00206   // Do a table look-up on the type
00207   for(ULONG i=0; i<NUMELE(rgDBTypes); i++)
00208   {
00209     if(wType == rgDBTypes[i].wType)
00210       return rgDBTypes[i].pwszTypeName;
00211   }
00212
00213   return rgDBTypes[0].pwszTypeName;
00214 }
00215
00216
00217 /////////////////////////////////////////////////////////////////////////////
00218 // BOOL GetPromotedType
00219 //
00220 /////////////////////////////////////////////////////////////////////////////
00221 BOOL GetPromotedType(DBTYPE* pwType)
00222 {
00223   ASSERT(pwType);
00224
00225   //For fixed types we first consider promoting signed types
00226   //to unsigned types first, before promoting up to the
00227   //next actual type.  Like DBTYPE_I1 -> DBTYPE_UI1,
00228   //instead of going directly to DBTYPE_I2.
00229
00230   switch(*pwType)
00231   {
00232
00233     // Integer family
00234     case DBTYPE_BOOL:
00235       *pwType = DBTYPE_I1;
00236       break;
00237
00238     case DBTYPE_I1:
00239       *pwType = DBTYPE_UI1;
00240       break;
00241
00242     case DBTYPE_UI1:
00243       *pwType = DBTYPE_I2;
00244       break;
00245
00246     case DBTYPE_I2:
00247       *pwType = DBTYPE_UI2;
00248       break;
00249
00250     case DBTYPE_UI2:
00251       *pwType = DBTYPE_I4;
00252       break;
00253
00254     case DBTYPE_I4:
00255       *pwType = DBTYPE_UI4;
00256       break;
00257
00258     case DBTYPE_UI4:
00259     case DBTYPE_CY:
00260       *pwType = DBTYPE_I8;
00261       break;
00262
00263     case DBTYPE_I8:
00264       *pwType = DBTYPE_UI8;
00265       break;
00266
00267     case DBTYPE_UI8:
00268       *pwType = DBTYPE_NUMERIC;
00269       break;
00270
00271
00272     // Floating-point type family.  FLOAT and DOUBLE actually
00273     // have the same precision, so do a mutual promotion (that
00274     // is, allow FLOAT to become DOUBLE and DOUBLE to become
00275     // FLOAT) before going to CHAR.
00276     //
00277     case DBTYPE_R4:
00278       *pwType = DBTYPE_R8;
00279       break;
00280
00281     // Fixed-point exact numerics. Ordering of the two types
00282     // is unimportant--for our purposes they have exactly the
00283     // same semantics.
00284     //
00285     case DBTYPE_NUMERIC:
00286       *pwType = DBTYPE_DECIMAL;
00287       break;
00288
00289     case DBTYPE_DECIMAL:
00290       *pwType = DBTYPE_R8;
00291       break;
00292
00293     // Binary types
00294     case DBTYPE_BYTES:
00295       *pwType = DBTYPE_STR;
00296       break;
00297
00298     // Date/Time family
00299     case DBTYPE_DATE:
00300     case DBTYPE_DBTIME:
00301     case DBTYPE_DBDATE:
00302       *pwType = DBTYPE_DBTIMESTAMP;
00303       break;
00304
00305     case DBTYPE_R8:
00306     case DBTYPE_DBTIMESTAMP:
00307       *pwType = DBTYPE_BYTES;
00308       break;
00309
00310     // Allow WSTR to STR.
00311     case DBTYPE_WSTR:
00312       *pwType = DBTYPE_STR;
00313       break;
00314
00315     case DBTYPE_VARIANT:
00316       *pwType = DBTYPE_STR;
00317       break;
00318
00319     default:
00320       return FALSE;
00321   }
00322
00323   return TRUE;
00324 }
00325
00326
00327
00328 ///////////////////////////////////////////////////////////////
00329 // BOOL FreeBindingData
00330 //
00331 ///////////////////////////////////////////////////////////////
00332 BOOL FreeBindingData(ULONG cBindings, DBBINDING* rgBindings, void* pData)
00333 {
00334   ASSERT(pData);
00335
00336   //Need to walk the array and free any other alloc memory
00337   for(ULONG i=0; i<cBindings; i++)
00338   {
00339     //Free any "out-of-line" memory
00340     //VARIANT
00341     if(rgBindings[i].wType == DBTYPE_VARIANT)
00342     {
00343       VARIANT* pVariant = (VARIANT*)&BINDING_VALUE(rgBindings[i], pData);
00344       FreeVariants(1, pVariant);
00345     }
00346
00347     //Free any pObjects
00348     SAFE_FREE(rgBindings[i].pObject);
00349   }
00350
00351   return TRUE;
00352 }
00353
00354
00355 ///////////////////////////////////////////////////////////////
00356 // BOOL FreeBindings
00357 //
00358 ///////////////////////////////////////////////////////////////
00359 BOOL FreeBindings(ULONG cBindings, DBBINDING* rgBindings)
00360 {
00361   //Need to walk the array and free any other alloc memory
00362   for(ULONG i=0; i<cBindings; i++)
00363   {
00364     //Free any pObjects
00365     SAFE_FREE(rgBindings[i].pObject);
00366   }
00367
00368   //Now we can free the outer struct
00369   SAFE_FREE(rgBindings);
00370   return TRUE;
00371 }
00372
00373
00374
00375 ///////////////////////////////////////////////////////////////
00376 // Static Strings Messages
00377 //
00378 ///////////////////////////////////////////////////////////////
00379
00380 extern WCHAR wsz_OLEDB[]        = L"Microsoft OLE DB TableCopy";
00381 extern WCHAR wsz_SUCCESS[]        = L"Microsoft OLE DB TableCopy - Success";
00382 extern WCHAR wsz_WARNING[]        = L"Microsoft OLE DB TableCopy - Warning";
00383 extern WCHAR wsz_INFO[]         = L"Microsoft OLE DB TableCopy - Info";
00384 extern WCHAR wsz_ERROR[]        = L"Microsoft OLE DB TableCopy - Error";
00385 extern WCHAR wsz_CANCEL[]       = L"Microsoft OLE DB TableCopy - Cancel";
00386 extern WCHAR wsz_ERRORINFO[]      = L"Microsoft OLE DB TableCopy - IErrorInfo";
00387
00388 //Copying Status
00389 extern WCHAR wsz_COPYING[]        = L"Copying records";
00390 extern WCHAR wsz_COPIED_RECORDS[]   = L"%lu records copied";
00391 extern WCHAR wsz_COPY_SUCCESS[]     = L"Copy succeeded, %lu records copied!";
00392 extern WCHAR wsz_COPY_FAILURE[]     = L"Copy failed!";
00393 extern WCHAR wsz_CANCEL_OP[]      = L"Do you want to cancel?";
00394 extern WCHAR wsz_TYPEMAPPING_FAILURE[]  = L"Mapping of Data Types Failed!";
00395
00396 //Tables
00397 extern WCHAR wsz_CREATE_TABLE[]     = L"CREATE TABLE ";
00398 extern WCHAR wsz_DROP_TABLE_[]      = L"DROP TABLE %s ";
00399 extern WCHAR wsz_ASK_DROP_TABLE_[]    = L"%s %s already exists.  Would you like to drop it?";
00400 extern WCHAR wsz_SAME_TABLE_NAME[]    = L"Target %s name must be different on the same DataSource";
00401 extern WCHAR wsz_FROMTABLEHELP_[]   = L"Select Desired %s and Columns to Copy";
00402 extern WCHAR wsz_FROMQUALTABLE_[]   = L"%s, %d Column(s)";
00403 extern WCHAR wsz_TOTABLEHELP_[]     = L"Select Target %s Name";
00404
00405 //Indexes
00406 extern WCHAR wsz_CREATE_INDEX_[]    = L"CREATE%sINDEX ";
00407 extern WCHAR wsz_UNIQUE_INDEX[]     = L" UNIQUE ";
00408 extern WCHAR wsz_INDEX_DESC[]       = L" DESC ";
00409 extern WCHAR wsz_INDEX_FAILED_[]    = L"INDEX %s failed to be created.  Would you like to Continue?";
00410
00411 //Columns
00412 extern WCHAR wsz_NO_TYPE_MATCH_[]   = L"Target Data type not found for %s type";
00413 extern WCHAR wsz_NO_TYPE_FOUND_[]   = L"Source Data type not found for %s type";
00414
00415 extern WCHAR wsz_CONNECT_STRING_[]    = L"%s    %s    %s %s    %s %s";
00416 extern WCHAR wsz_TYPES_STRING_[]    = L"%s    %s    %s=%s";
00417 extern WCHAR wsz_NOT_CONNECTED[]    = L"Not Connected: Press Connect to establish a connection";
00418
00419 extern WCHAR wsz_PROVIDER_INFO_[]   = L"%s";
00420
00421 extern WCHAR wsz_INVALID_VALUE_[]   = L"Invalid Value '%s' specified.  Please specify a value >= %lu and <= %lu.";
00422 extern WCHAR wsz_READONLY_DATASOURCE_[] = L"Datasource %s is marked as read only, it may not be updateable.";
00423
00424 //Query
00425 extern WCHAR wsz_SHOW_SQL_[]      = L"DSN = %s\n\nSQL = %s";
00426 extern WCHAR wsz_SELECT[]       = L" SELECT ";
00427 extern WCHAR wsz_FROM[]         = L" FROM ";
00428 extern WCHAR wsz_BOGUS_WHERE[]      = L" WHERE 0 = 1";
00429 extern WCHAR wsz_INSERT_INTO[]      = L"INSERT INTO ";
00430 extern WCHAR wsz_VALUES_CLAUSE[]    = L" ) VALUES ( ";
00431 extern WCHAR wsz_PARAM[]        = L"?";
00432 extern WCHAR wsz_PRIMARY_KEY[]      = L" PRIMARY KEY";
00433
00434 //General String Values
00435 extern WCHAR wsz_COMMA[]        = L", ";
00436 extern WCHAR wsz_LPAREN[]       = L" ( ";
00437 extern WCHAR wsz_RPAREN[]       = L" ) ";
00438 extern WCHAR wsz_SPACE[]        = L" ";
00439 extern WCHAR wsz_PERIOD[]       = L".";
Generated on Wed Nov 13 2024 16:52:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/mwclass.Cxx Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

mwclass.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       mwclass.cxx
00007 //
00008 //  Contents:   implementation for the main window class
00009 //
00010 //  Classes:    CMainWindow
00011 //
00012 //  Functions:  Exists
00013 //
00014 //  History:    6-08-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #include "dfv.h"
00019 #include "mwclass.h"
00020 #include "about.h"
00021 #include "bitmaps.h"
00022 #include "strmvwr.h"
00023 #include <assert.h>
00024
00025 #define BITMAPWIDTH 16
00026 #define BITMAPHEIGHT 16
00027 #define INDENT BITMAPWIDTH
00028 #define ROOTSTGSTR OLESTR(" \\ - ")
00029
00030 //+---------------------------------------------------------------------------
00031 //
00032 //  Member:     CMainWindow::CMainWindow
00033 //
00034 //  Synopsis:   constructor
00035 //
00036 //  History:    6-27-94   stevebl   Created
00037 //
00038 //----------------------------------------------------------------------------
00039
00040 CMainWindow::CMainWindow()
00041 {
00042     _hlb = NULL;
00043     _hbmpStorage = _hbmpStream = NULL;
00044 }
00045
00046 //+---------------------------------------------------------------------------
00047 //
00048 //  Member:     CMainWindow::~CMainWindow
00049 //
00050 //  Synopsis:   destructor
00051 //
00052 //  History:    6-27-94   stevebl   Created
00053 //
00054 //  Notes:      Destruction of the main window indicates that the app should
00055 //              quit.
00056 //
00057 //----------------------------------------------------------------------------
00058
00059 CMainWindow::~CMainWindow()
00060 {
00061     DeleteObject(_hbmpStorage);
00062     DeleteObject(_hbmpStream);
00063     PostQuitMessage(0);
00064 }
00065
00066 //+---------------------------------------------------------------------------
00067 //
00068 //  Member:     CMainWindow::InitInstance
00069 //
00070 //  Synopsis:   Instantiates an instance of the docfile viewer window.
00071 //
00072 //  Arguments:  [hInstance] - instance of the app
00073 //              [nCmdShow]  - command to pass to ShowWindow
00074 //
00075 //  Returns:    TRUE on success
00076 //              FALSE on failure
00077 //
00078 //  History:    6-27-94   stevebl   Created
00079 //
00080 //  Notes:      This method must be called only once, immediately after
00081 //              class construction.
00082 //
00083 //----------------------------------------------------------------------------
00084
00085 BOOL CMainWindow::InitInstance(HINSTANCE hInstance, int nCmdShow)
00086 {
00087     // Note, the Create method sets the _hwnd member for me so I don't
00088     // need to set it myself.
00089     if (!Create(
00090         TEXT(MAIN_WINDOW_CLASS_NAME),
00091         TEXT(VER_INTERNALNAME_STR),
00092         WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
00093             | WS_MAXIMIZEBOX | WS_THICKFRAME,
00094         CW_USEDEFAULT,
00095         CW_USEDEFAULT,
00096         CW_USEDEFAULT,
00097         CW_USEDEFAULT,
00098         NULL,
00099         NULL,
00100         hInstance))
00101     {
00102         return(FALSE);
00103     }
00104
00105     ShowWindow(_hwnd, nCmdShow);
00106     UpdateWindow(_hwnd);
00107
00108     // build a path to where the help file should be
00109     // (it should be in the same directory as the .EXE)
00110     // first get the exe's path
00111     DWORD cch = GetModuleFileName(hInstance, _szHelpFile, MAX_PATH);
00112     // then back up past the name of the application
00113     while (cch > 0 &&
00114         _szHelpFile[cch - 1] != TEXT('\\') &&
00115         _szHelpFile[cch - 1] != TEXT('/') &&
00116         _szHelpFile[cch - 1] != TEXT(':'))
00117     {
00118         cch--;
00119     }
00120     // finally copy the help file's name at the end of the path
00121     lstrcpy(&_szHelpFile[cch], TEXT(HELPFILE_STR));
00122     return(TRUE);
00123 }
00124
00125 //+---------------------------------------------------------------------------
00126 //
00127 //  Member:     CMainWindow::WindowProc
00128 //
00129 //  Synopsis:   main window procedure
00130 //
00131 //  Arguments:  [uMsg]   - Windows message
00132 //              [wParam] - first message parameter
00133 //              [lParam] - second message parameter
00134 //
00135 //  History:    6-27-94   stevebl   Created
00136 //
00137 //  Notes:      See CHlprWindow for a description of how this method gets
00138 //              called by the global WinProc.
00139 //
00140 //----------------------------------------------------------------------------
00141
00142 LRESULT CMainWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
00143 {
00144     switch (uMsg)
00145     {
00146     case WM_CREATE:
00147         {
00148             RECT rc;
00149             GetClientRect(_hwnd, &rc);
00150             // record the width before we create the list box
00151             _wWidth = (WORD) rc.right;
00152
00153             HDC hdc = GetDC(_hwnd);
00154             GetTextMetrics(hdc, &_tm);
00155             ReleaseDC(_hwnd, hdc);
00156
00157             // create the child listbox
00158             _hlb = CreateWindow(
00159                 TEXT("listbox"),
00160                 TEXT(""),
00161                 LBS_OWNERDRAWFIXED |
00162                     WS_CHILD |
00163                     WS_VISIBLE |
00164                     WS_VSCROLL |
00165                     LBS_NOTIFY |
00166                     LBS_NOINTEGRALHEIGHT |
00167                     LBS_WANTKEYBOARDINPUT,
00168                 0,
00169                 0,
00170                 rc.right,
00171                 rc.bottom,
00172                 _hwnd,
00173                 (HMENU) IDC_LISTBOX,
00174                 _hInstance,
00175                 NULL);
00176             if (NULL == _hlb)
00177             {
00178                 // abort window creation
00179                 return(-1);
00180             }
00181             SetFocus(_hlb);
00182
00183             if (!LoadBitmaps())
00184             {
00185                 MessageBoxFromStringIds(
00186                     _hwnd,
00187                     _hInstance,
00188                     IDS_LOADBITMAPSFAILED,
00189                     IDS_ERROR,
00190                     MB_OK | MB_ICONEXCLAMATION);
00191                 return(-1);
00192             }
00193             _crTextHigh = GetSysColor(COLOR_HIGHLIGHTTEXT);
00194             _crTextNorm = GetSysColor(COLOR_WINDOWTEXT);
00195             _crBkHigh = GetSysColor(COLOR_HIGHLIGHT);
00196             _crBkNorm = GetSysColor(COLOR_WINDOW);
00197
00198             // Fill in the File's OPENFILENAME structure
00199             _szFileName[0] = 0;
00200             _szFileTitle[0] = 0;
00201             _ofnFile.lStructSize = sizeof(OPENFILENAME);
00202             _ofnFile.hwndOwner = _hwnd;
00203             _ofnFile.lpstrFilter = TEXT("All Files (*.*)\0*.*\0Doc Files (*.DFL;*.OL?)\0*.DFL;*.OL;\0");
00204             _ofnFile.lpstrCustomFilter = NULL;
00205             _ofnFile.nMaxCustFilter = 0;
00206             _ofnFile.nFilterIndex = 1;
00207             _ofnFile.lpstrFile = _szFileName;
00208             _ofnFile.nMaxFile = MAX_PATH;
00209             _ofnFile.lpstrInitialDir = NULL;
00210             _ofnFile.lpstrFileTitle = _szFileTitle;
00211             _ofnFile.nMaxFileTitle = MAX_PATH;
00212             _ofnFile.lpstrTitle = TEXT("Open DocFile");
00213             _ofnFile.lpstrDefExt = NULL;
00214             _ofnFile.Flags = OFN_HIDEREADONLY;
00215         }
00216         break;
00217     case WM_SETFOCUS:
00218         {
00219             if (_hlb)
00220             {
00221                 SetFocus(_hlb);
00222             }
00223         break;
00224         }
00225     case WM_MEASUREITEM:
00226         {
00227             LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam;
00228             if (BITMAPHEIGHT < _tm.tmHeight + _tm.tmExternalLeading)
00229             {
00230                 lpmis->itemHeight = _tm.tmHeight + _tm.tmExternalLeading;
00231             }
00232             else
00233             {
00234                 lpmis->itemHeight = BITMAPHEIGHT;
00235             }
00236             lpmis->itemWidth = _wWidth;
00237             return(TRUE);
00238         }
00239     case WM_DELETEITEM:
00240         if (IDC_LISTBOX == wParam)
00241         {
00242             DeleteElement((LISTBOXELEMENT *)((LPDELETEITEMSTRUCT)lParam)->itemData);
00243         }
00244         break;
00245     case WM_DRAWITEM:
00246         {
00247             LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT) lParam;
00248             if (-1 == lpdis->itemID)
00249             {
00250                 // no items in the listbox
00251                 break;
00252             }
00253             // draw the item
00254             switch (lpdis->itemAction)
00255             {
00256             case ODA_SELECT:
00257             case ODA_DRAWENTIRE:
00258                 {
00259                     // draw the listbox item
00260
00261                     LISTBOXELEMENT * plbe = (LISTBOXELEMENT *) lpdis->itemData;
00262                     assert(plbe);
00263
00264                     // compute the starting point
00265                     int x = lpdis->rcItem.left + plbe->uIndent * INDENT;
00266                     int y = lpdis->rcItem.top;
00267
00268                     // paint the bitmap
00269                     HDC hMemDC = CreateCompatibleDC(lpdis->hDC);
00270                     HBITMAP hbmp;
00271                     switch (plbe->uType)
00272                     {
00273                     case LBE_STORAGE:
00274                         hbmp = _hbmpStorage;
00275                         break;
00276                     case LBE_STREAM:
00277                         hbmp = _hbmpStream;
00278                         break;
00279                     default:
00280                         assert(!"Unsupported type");
00281                         hbmp = _hbmpStream;
00282                         break;
00283                     }
00284                     HBITMAP hbmpOld = (HBITMAP) SelectObject(hMemDC, hbmp);
00285                     int nBitmap = ((lpdis->itemState & ODS_SELECTED) ? 0 : 2) +
00286                         plbe->fOpen;
00287                     BitBlt(
00288                         lpdis->hDC,
00289                         x,
00290                         y,
00291                         BITMAPWIDTH,
00292                         _cyBitmap,
00293                         hMemDC,
00294                         nBitmap * BITMAPWIDTH, 0, SRCCOPY);
00295                     SelectObject(hMemDC, hbmpOld);
00296                     DeleteDC(hMemDC);
00297                     x += BITMAPWIDTH;
00298
00299                     // paint the text
00300                     SIZE sizeText;
00301                     RECT rcItem = lpdis->rcItem;
00302                     rcItem.left = x;
00303
00304                     // Note that pwcsName is an OLEStr and
00305                     // is therefore always wide under WIN32.
00306                     GetTextExtentPoint32W(
00307                         lpdis->hDC,
00308                         plbe->pwcsName,
00309                         (int)wcslen(plbe->pwcsName),
00310                         &sizeText);
00311                     rcItem.right = x + sizeText.cx;
00312                     COLORREF crOldText = SetTextColor(
00313                         lpdis->hDC,
00314                         (lpdis->itemState & ODS_SELECTED) ? _crTextHigh : _crTextNorm);
00315                     COLORREF crOldBack = SetBkColor(
00316                         lpdis->hDC,
00317                         (lpdis->itemState & ODS_SELECTED) ? _crBkHigh : _crBkNorm);
00318                     ExtTextOutW(
00319                         lpdis->hDC,
00320                         x,
00321                         y,
00322                         ETO_OPAQUE | ETO_CLIPPED,
00323                         &rcItem,
00324                         plbe->pwcsName,
00325                         (int)wcslen(plbe->pwcsName),
00326                         NULL);
00327                     SetTextColor(lpdis->hDC, crOldText);
00328                     SetBkColor(lpdis->hDC, crOldBack);
00329                 }
00330                 break;
00331             case ODA_FOCUS:
00332                 break;
00333             }
00334             return(TRUE);
00335         }
00336     case WM_VKEYTOITEM:
00337         if ((HWND)lParam == _hlb)
00338         {
00339             if (LOWORD(wParam) == VK_RETURN)
00340             {
00341                 if(SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00342                 {
00343                     Toggle(SendMessage(_hlb, LB_GETCURSEL, 0, 0));
00344                     InvalidateRect(_hlb, NULL, FALSE);
00345                 }
00346                 return(-2);
00347             }
00348             return(-1);
00349         }
00350         break;
00351     case WM_SIZE:
00352         {
00353             _wWidth = LOWORD(lParam);
00354             WORD wHeight = HIWORD(lParam);
00355             if (_hlb)
00356             {
00357                 SetWindowPos(_hlb, NULL, 0, 0, _wWidth, wHeight, SWP_NOMOVE | SWP_NOZORDER);
00358             }
00359             break;
00360         }
00361     case WM_COMMAND:
00362         if ((LOWORD(wParam) == IDC_LISTBOX) && ((HWND) lParam == _hlb))
00363         {
00364             switch (HIWORD(wParam))
00365             {
00366                 case LBN_DBLCLK:
00367                     {
00368                         if(SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00369                         {
00370                             Toggle(SendMessage(_hlb, LB_GETCURSEL, 0, 0));
00371                             InvalidateRect(_hlb, NULL, FALSE);
00372                         }
00373                     }
00374                     break;
00375                 default:
00376                     break;
00377             }
00378         }
00379         return DoMenu(wParam, lParam);
00380     case WM_QUIT:
00381     case WM_CLOSE:
00382     default:
00383         return(DefWindowProc(_hwnd, uMsg, wParam, lParam));
00384     }
00385     return(FALSE);
00386 }
00387
00388 //+---------------------------------------------------------------------------
00389 //
00390 //  Member:     CMainWindow::DoMenu
00391 //
00392 //  Synopsis:   implements the main menu commands
00393 //
00394 //  Arguments:  [wParam] - first window parameter
00395 //              [lParam] - second window parameter
00396 //
00397 //  History:    6-23-94   stevebl   Created
00398 //
00399 //----------------------------------------------------------------------------
00400
00401 LRESULT CMainWindow::DoMenu(WPARAM wParam, LPARAM lParam)
00402 {
00403     switch (LOWORD(wParam))
00404     {
00405     case IDM_OPEN:
00406         if (!GetOpenFileName((LPOPENFILENAME)&_ofnFile))
00407         {
00408             return(FALSE);
00409         }
00410         OpenFile();
00411         break;
00412     case IDM_CLOSE:
00413         SendMessage(_hlb, LB_RESETCONTENT, 0, 0);
00414         break;
00415     case IDM_EXPAND:
00416         if(SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00417         {
00418             Expand(SendMessage(_hlb, LB_GETCURSEL, 0, 0));
00419             InvalidateRect(_hlb, NULL, FALSE);
00420         }
00421         break;
00422     case IDM_EXPANDBRANCH:
00423         if(SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00424         {
00425             ExpandAll(SendMessage(_hlb, LB_GETCURSEL, 0, 0));
00426             InvalidateRect(_hlb, NULL, FALSE);
00427         }
00428         break;
00429     case IDM_EXPANDALL:
00430         if(SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00431         {
00432             ExpandAll(0);
00433             InvalidateRect(_hlb, NULL, FALSE);
00434         }
00435         break;
00436     case IDM_COLLAPSE:
00437         if(SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00438         {
00439             Collapse(SendMessage(_hlb, LB_GETCURSEL, 0, 0));
00440             InvalidateRect(_hlb, NULL, FALSE);
00441         }
00442         break;
00443     case IDM_COLLAPSEALL:
00444         if(SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00445         {
00446             Collapse(0);
00447             SendMessage(_hlb, LB_SETCURSEL, 0, 0);
00448             InvalidateRect(_hlb, NULL, FALSE);
00449         }
00450         break;
00451     case IDM_TOGGLE:
00452         if (SendMessage(_hlb, LB_GETCOUNT, 0, 0))
00453         {
00454             Toggle(SendMessage(_hlb, LB_GETCURSEL, 0, 0));
00455             InvalidateRect(_hlb, NULL, FALSE);
00456         }
00457     case IDM_EXIT:
00458         SendMessage(_hwnd, WM_CLOSE, 0, 0);
00459         break;
00460     case IDM_HELP:
00461         if (!Exists(_szHelpFile))
00462         {
00463             MessageBoxFromStringIds(
00464                 _hwnd,
00465                 _hInstance,
00466                 IDS_NOHELPFILE,
00467                 IDS_ERROR,
00468                 MB_OK | MB_ICONEXCLAMATION);
00469         }
00470         else
00471         {
00472             WinHelp(_hwnd, _szHelpFile, HELP_CONTEXT, 3);
00473         }
00474         break;
00475     case IDM_ABOUT:
00476         {
00477             CAbout dlgAbout;
00478             dlgAbout.ShowDialog(_hInstance, MAKEINTRESOURCE(IDM_ABOUT), _hwnd);
00479         }
00480         break;
00481     default:
00482         return(DefWindowProc(_hwnd, WM_COMMAND, wParam, lParam));
00483     }
00484     return(FALSE);
00485 }
00486
00487 //+---------------------------------------------------------------------------
00488 //
00489 //  Member:     CMainWindow::Expand
00490 //
00491 //  Synopsis:   Expands a level of the tree.
00492 //
00493 //  Arguments:  [lIndex] - index of the item that needs to be expanded
00494 //
00495 //  History:    6-23-94   stevebl   Created
00496 //
00497 //----------------------------------------------------------------------------
00498
00499 void CMainWindow::Expand(LONG_PTR lIndex)
00500 {
00501     LISTBOXELEMENT * pElement = (LISTBOXELEMENT *) SendMessage(_hlb, LB_GETITEMDATA, lIndex, 0);
00502     if (pElement->fOpen)
00503     {
00504         // this element has already been expanded
00505         return;
00506     }
00507     SendMessage(_hlb, WM_SETREDRAW, FALSE, 0);
00508     switch (pElement->uType)
00509     {
00510     case LBE_STORAGE:
00511         {
00512             // create entries for all of its children
00513             IStorage * pstg = (IStorage *) pElement->pInterface;
00514             IEnumSTATSTG * penumStatStg;
00515             STATSTG statstg;
00516             HRESULT hr = pstg->EnumElements(0, NULL, 0, &penumStatStg);
00517             if (SUCCEEDED(hr))
00518             {
00519                 pElement->fOpen = TRUE;
00520                 pElement->nChildren = 0;
00521                 while (hr != S_FALSE)
00522                 {
00523                     hr = penumStatStg->Next(1, &statstg, NULL);
00524                     if (FAILED(hr))
00525                     {
00526                         MessageBoxFromStringIdsAndArgs(
00527                             _hwnd,
00528                             _hInstance,
00529                             IDS_ENUMSTATSTGFAILED,
00530                             IDS_ERROR,
00531                             MB_OK | MB_ICONEXCLAMATION,
00532                             hr);
00533                     }
00534                     else if (S_OK == hr)
00535                     {
00536                         // retrieved another member from the list
00537                         LISTBOXELEMENT * plbe;
00538                         switch (statstg.type)
00539                         {
00540                         case STGTY_STORAGE:
00541                             {
00542                                 IStorage * pstg2;
00543                                 hr = pstg->OpenStorage(
00544                                     statstg.pwcsName,
00545                                     NULL,
00546                                     STGM_READ | STGM_SHARE_EXCLUSIVE,
00547                                     NULL,
00548                                     0,
00549                                     &pstg2);
00550                                 if (SUCCEEDED(hr))
00551                                 {
00552                                     plbe = CreateStorageElement(pstg2);
00553                                 }
00554                                 else
00555                                 {
00556                                     MessageBoxFromStringIdsAndArgs(
00557                                         _hwnd,
00558                                         _hInstance,
00559                                         IDS_OPENSTORAGEFAILED,
00560                                         IDS_ERROR,
00561                                         MB_OK | MB_ICONEXCLAMATION,
00562                                         hr);
00563                                     plbe = NULL;
00564                                 }
00565                             }
00566                             break;
00567                         case STGTY_STREAM:
00568                             {
00569                                 IStream * pstm;
00570                                 hr = pstg->OpenStream(
00571                                     statstg.pwcsName,
00572                                     0,
00573                                     STGM_READ | STGM_SHARE_EXCLUSIVE,
00574                                     0,
00575                                     &pstm);
00576                                 if (SUCCEEDED(hr))
00577                                 {
00578                                     plbe = CreateStreamElement(pstm);
00579                                 }
00580                                 else
00581                                 {
00582                                     MessageBoxFromStringIdsAndArgs(
00583                                         _hwnd,
00584                                         _hInstance,
00585                                         IDS_OPENSTREAMFAILED,
00586                                         IDS_ERROR,
00587                                         MB_OK | MB_ICONEXCLAMATION,
00588                                         hr);
00589                                     plbe = NULL;
00590                                 }
00591                             }
00592                             break;
00593                         }
00594                         if (plbe)
00595                         {
00596                             plbe->pwcsName = statstg.pwcsName;
00597                             plbe->uIndent = pElement->uIndent + 1;
00598                             pElement->nChildren++;
00599                             if (SendMessage(_hlb, LB_INSERTSTRING, lIndex + pElement->nChildren, (LPARAM) plbe) == LB_ERRSPACE)
00600                             {
00601                                 MessageBoxFromStringIds(
00602                                     _hwnd,
00603                                     _hInstance,
00604                                     IDS_INSERTSTRINGFAILED,
00605                                     IDS_ERROR,
00606                                     MB_OK | MB_ICONEXCLAMATION);
00607                                 DeleteElement(plbe);
00608                                 pElement->nChildren--;
00609                             }
00610                         }
00611                     }
00612                 }
00613                 penumStatStg->Release();
00614             }
00615             else
00616             {
00617                 MessageBoxFromStringIdsAndArgs(
00618                     _hwnd,
00619                     _hInstance,
00620                     IDS_ENUMELEMENTSFAILED,
00621                     IDS_ERROR,
00622                     MB_OK | MB_ICONEXCLAMATION,
00623                     hr);
00624             }
00625         }
00626         break;
00627     case LBE_STREAM:
00628         // streams are only expanded if they are the currently selected list item
00629         if (SendMessage(_hlb, LB_GETCURSEL, 0, 0) == lIndex)
00630         {
00631             // open stream
00632             CStreamView * psv = new CStreamView(_hlb, pElement);
00633             if (psv)
00634             {
00635                 pElement->fOpen = psv->InitInstance(_hInstance, SW_SHOWNORMAL);
00636                 if (pElement->fOpen)
00637                 {
00638                     pElement->hwndView = psv->GetHwnd();
00639                     SetFocus(pElement->hwndView);
00640                 }
00641             }
00642         }
00643         break;
00644     }
00645     SendMessage(_hlb, WM_SETREDRAW, TRUE, 0);
00646 }
00647
00648 //+---------------------------------------------------------------------------
00649 //
00650 //  Member:     CMainWindow::Collapse
00651 //
00652 //  Synopsis:   collapses a level of the tree
00653 //
00654 //  Arguments:  [lIndex] - index of the item to be collapsed
00655 //
00656 //  History:    6-23-94   stevebl   Created
00657 //
00658 //----------------------------------------------------------------------------
00659
00660 void CMainWindow::Collapse(LONG_PTR lIndex)
00661 {
00662     LISTBOXELEMENT * pElement = (LISTBOXELEMENT *) SendMessage(_hlb, LB_GETITEMDATA, lIndex, 0);
00663     if (pElement->fOpen)
00664     {
00665         switch (pElement->uType)
00666         {
00667         case LBE_STORAGE:
00668             while (pElement->nChildren--)
00669             {
00670                 Collapse(lIndex + 1);
00671                 SendMessage(_hlb, LB_DELETESTRING, lIndex + 1, 0);
00672             }
00673             break;
00674         case LBE_STREAM:
00675             if (pElement->fOpen)
00676             {
00677                 DestroyWindow(pElement->hwndView);
00678             }
00679             break;
00680         }
00681         pElement->fOpen = FALSE;
00682     }
00683 }
00684
00685 //+---------------------------------------------------------------------------
00686 //
00687 //  Member:     CMainWindow::ExpandAll
00688 //
00689 //  Synopsis:   expands the current item and all its children
00690 //
00691 //  Arguments:  [lIndex] - index of the item to be expanded
00692 //
00693 //  History:    6-23-94   stevebl   Created
00694 //
00695 //----------------------------------------------------------------------------
00696
00697 void CMainWindow::ExpandAll(LONG_PTR lIndex)
00698 {
00699     LISTBOXELEMENT * pElement = (LISTBOXELEMENT *) SendMessage(_hlb, LB_GETITEMDATA, lIndex, 0);
00700     Expand(lIndex);
00701     if (pElement->uType == LBE_STORAGE)
00702     {
00703         unsigned nChildren = pElement->nChildren;
00704         while (nChildren--)
00705         {
00706             ExpandAll(lIndex + 1 + nChildren);
00707         }
00708     }
00709 }
00710
00711 //+---------------------------------------------------------------------------
00712 //
00713 //  Member:     CMainWindow::Toggle
00714 //
00715 //  Synopsis:   toggles a node - expanding or collapsing as appropriate
00716 //
00717 //  Arguments:  [lIndex] - index of the node
00718 //
00719 //  History:    6-25-94   stevebl   Created
00720 //
00721 //----------------------------------------------------------------------------
00722
00723 void CMainWindow::Toggle(LONG_PTR lIndex)
00724 {
00725     LISTBOXELEMENT * pElement = (LISTBOXELEMENT *) SendMessage(_hlb, LB_GETITEMDATA, lIndex, 0);
00726     if (pElement->fOpen)
00727     {
00728         Collapse(lIndex);
00729     }
00730     else
00731     {
00732         Expand(lIndex);
00733     }
00734 }
00735
00736 //+---------------------------------------------------------------------------
00737 //
00738 //  Member:     CMainWindow::CreateStreamElement
00739 //
00740 //  Synopsis:   turns an IStream pointer into a listbox element
00741 //
00742 //  Arguments:  [pstm] - IStream pointer
00743 //
00744 //  Returns:    pointer to the newly created element
00745 //              (NULL on failure)
00746 //
00747 //  History:    6-23-94   stevebl   Created
00748 //
00749 //----------------------------------------------------------------------------
00750
00751 LISTBOXELEMENT * CMainWindow::CreateStreamElement(IStream * pstm)
00752 {
00753     LISTBOXELEMENT * plbe = new LISTBOXELEMENT;
00754     if (plbe)
00755     {
00756         plbe->uType = LBE_STREAM;
00757         plbe->fOpen = FALSE;
00758         plbe->pInterface = (void *) pstm;
00759         plbe->uIndent = 0;
00760         plbe->hwndView = NULL;
00761     }
00762     else
00763     {
00764         MessageBoxFromStringIds(
00765             _hwnd,
00766             _hInstance,
00767             IDS_OUTOFMEMORY,
00768             IDS_ERROR,
00769             MB_OK | MB_ICONEXCLAMATION);
00770     }
00771     return(plbe);
00772 }
00773
00774 //+---------------------------------------------------------------------------
00775 //
00776 //  Member:     CMainWindow::CreateStorageElement
00777 //
00778 //  Synopsis:   turns an IStorage pointer into a listbox element
00779 //
00780 //  Arguments:  [pstg] - IStorage pointer
00781 //
00782 //  Returns:    pointer to the newly created element
00783 //              (NULL on failure)
00784 //
00785 //  History:    6-23-94   stevebl   Created
00786 //
00787 //----------------------------------------------------------------------------
00788
00789 LISTBOXELEMENT * CMainWindow::CreateStorageElement(IStorage * pstg)
00790 {
00791     LISTBOXELEMENT * plbe = new LISTBOXELEMENT;
00792     if (plbe)
00793     {
00794         plbe->uType = LBE_STORAGE;
00795         plbe->fOpen = FALSE;
00796         plbe->pInterface = (void *) pstg;
00797         plbe->uIndent = 0;
00798         plbe->nChildren = 0;
00799     }
00800     else
00801     {
00802         MessageBoxFromStringIds(
00803             _hwnd,
00804             _hInstance,
00805             IDS_OUTOFMEMORY,
00806             IDS_ERROR,
00807             MB_OK | MB_ICONEXCLAMATION);
00808     }
00809     return(plbe);
00810 }
00811
00812 //+---------------------------------------------------------------------------
00813 //
00814 //  Member:     CMainWindow::DeleteElement
00815 //
00816 //  Synopsis:   deletes a listbox element and it's associated data
00817 //
00818 //  Arguments:  [plbe] - pointer to the element
00819 //
00820 //  History:    6-23-94   stevebl   Created
00821 //
00822 //  Notes:      This doesn't remove it from the list, it just frees up
00823 //              the LISTBOXELEMENT pointer and it's data.
00824 //
00825 //----------------------------------------------------------------------------
00826
00827 void CMainWindow::DeleteElement(LISTBOXELEMENT * plbe)
00828 {
00829
00830     switch (plbe->uType)
00831     {
00832     case LBE_STORAGE:
00833         ((IStorage *) plbe->pInterface)->Release();
00834         break;
00835     case LBE_STREAM:
00836         if (plbe->fOpen)
00837         {
00838             DestroyWindow(plbe->hwndView);
00839         }
00840         ((IStream *) plbe->pInterface)->Release();
00841         break;
00842     }
00843     LPMALLOC pMalloc;
00844     CoGetMalloc(MEMCTX_TASK, &pMalloc);
00845     pMalloc->Free(plbe->pwcsName);
00846     pMalloc->Release();
00847     delete(plbe);
00848 }
00849
00850 //+---------------------------------------------------------------------------
00851 //
00852 //  Member:     CMainWindow::LoadBitmaps
00853 //
00854 //  Synopsis:   loads the Storage and Stream bitmap arrays
00855 //
00856 //  Returns:    TRUE on success
00857 //              FALSE on failure
00858 //
00859 //  Modifies:   _hbmpStorage and _hbmpStream
00860 //
00861 //  History:    6-24-94   stevebl   Created from code used in original DFView
00862 //
00863 //----------------------------------------------------------------------------
00864
00865 BOOL CMainWindow::LoadBitmaps(void)
00866 {
00867     //
00868     // Get some metrics/info
00869     //
00870     UINT cxBitmap = BITMAPWIDTH;
00871     _cyBitmap = BITMAPHEIGHT;
00872     if (_cyBitmap < (UINT) _tm.tmHeight + _tm.tmExternalLeading)
00873     {
00874         _cyBitmap = _tm.tmHeight + _tm.tmExternalLeading;
00875     }
00876     UINT crHigh   = (COLORREF) GetSysColor(COLOR_HIGHLIGHT);
00877     UINT crNorm   = (COLORREF) GetSysColor(COLOR_WINDOW);
00878
00879     HDC hdc = CreateCompatibleDC(NULL);
00880     if (!hdc)
00881     {
00882         goto ERRLOADBITMAP;
00883     }
00884     _hbmpStorage = CreateBitmap(
00885         4 * cxBitmap,
00886         _cyBitmap,
00887         GetDeviceCaps(hdc, PLANES),
00888         GetDeviceCaps(hdc, BITSPIXEL),
00889         NULL);
00890     _hbmpStream = CreateBitmap(
00891         4 * cxBitmap,
00892         _cyBitmap,
00893         GetDeviceCaps(hdc, PLANES),
00894         GetDeviceCaps (hdc, BITSPIXEL),
00895         NULL);
00896    DeleteDC(hdc);
00897    if (!_hbmpStorage || !_hbmpStream)
00898    {
00899         goto ERRLOADBITMAP;
00900    }
00901
00902     //
00903     //  Load our bitmaps, and munge them to create
00904     //  our 4-bitmap "arrays".  Anything RED in the loaded
00905     //  bitmap will be considered clear.
00906     //
00907     if (!LoadAndStretch(
00908         _hInstance,
00909         _hbmpStorage,
00910         MAKEINTRESOURCE(BMP_STORAGE),
00911         cxBitmap,
00912         _cyBitmap,
00913         crHigh,
00914         crNorm))
00915     {
00916         goto ERRLOADBITMAP;
00917     }
00918     if (!LoadAndStretch(
00919         _hInstance,
00920         _hbmpStream,
00921         MAKEINTRESOURCE(BMP_STREAM),
00922         cxBitmap,
00923         _cyBitmap,
00924         crHigh,
00925         crNorm))
00926     {
00927         goto ERRLOADBITMAP;
00928     }
00929     return TRUE;
00930
00931 ERRLOADBITMAP:
00932     //
00933     // Bitmap loading error.
00934     //
00935     DeleteObject(_hbmpStorage);
00936     DeleteObject(_hbmpStream);
00937     _hbmpStorage = NULL;
00938     _hbmpStream = NULL;
00939
00940     return FALSE;
00941 }
00942
00943 //+---------------------------------------------------------------------------
00944 //
00945 //  Member:     CMainWindow::OpenFile
00946 //
00947 //  Synopsis:   attempts to open whatever docfile is named by _szFileName;
00948 //
00949 //  History:    6-24-94   stevebl   Created
00950 //
00951 //----------------------------------------------------------------------------
00952
00953 void CMainWindow::OpenFile(void)
00954 {
00955     SendMessage(_hlb, LB_RESETCONTENT, 0, 0);
00956     IStorage * pstg;
00957 #ifndef UNICODE
00958     // convert file name to a wide string
00959     OLECHAR wszFileName[MAX_PATH];
00960     mbstowcs(wszFileName, _szFileName, MAX_PATH);
00961 #endif
00962     // get IStorage
00963     HRESULT hr = StgOpenStorage(
00964 #ifdef UNICODE
00965         _szFileName,
00966 #else
00967         wszFileName,
00968 #endif
00969         NULL,
00970         STGM_TRANSACTED | STGM_READ | STGM_SHARE_DENY_WRITE,
00971         NULL,
00972         0,
00973         &pstg);
00974     if (FAILED(hr))
00975     {
00976         MessageBoxFromStringIdsAndArgs(
00977             _hwnd,
00978             _hInstance,
00979             IDS_STGOPENSTORAGEFAILED,
00980             IDS_ERROR,
00981             MB_OK | MB_ICONEXCLAMATION,
00982 #ifdef UNICODE
00983             _szFileName
00984 #else
00985             wszFileName
00986 #endif
00987             );
00988         return;
00989     }
00990     // Storage was opened successfully.
00991     LISTBOXELEMENT * plbe = CreateStorageElement(pstg);
00992     if (plbe)
00993     {
00994         IMalloc * pMalloc;
00995         CoGetMalloc(MEMCTX_TASK, &pMalloc);
00996         plbe->pwcsName = (LPOLESTR) pMalloc->Alloc(sizeof(OLECHAR) *  (lstrlen(_szFileName) + wcslen(ROOTSTGSTR) + 1));
00997         pMalloc->Release();
00998         if (plbe->pwcsName)
00999         {
01000             wcscpy(plbe->pwcsName, ROOTSTGSTR);
01001 #ifdef UNICODE
01002             wcscpy(&plbe->pwcsName[wcslen(ROOTSTGSTR)], _szFileName);
01003 #else
01004             mbstowcs(&plbe->pwcsName[wcslen(ROOTSTGSTR)], _szFileName, strlen(_szFileName) + 1);
01005 #endif
01006         }
01007         if (SendMessage(_hlb, LB_INSERTSTRING, 0, (LPARAM) plbe) == LB_ERRSPACE)
01008         {
01009             MessageBoxFromStringIds(
01010                 _hwnd,
01011                 _hInstance,
01012                 IDS_INSERTSTRINGFAILED,
01013                 IDS_ERROR,
01014                 MB_OK | MB_ICONEXCLAMATION);
01015             DeleteElement(plbe);
01016         }
01017         else
01018         {
01019             SendMessage(_hlb, LB_SETCURSEL, 0, 0);
01020         }
01021     }
01022 }
01023
01024 //+---------------------------------------------------------------------------
01025 //
01026 //  Function:   Exists
01027 //
01028 //  Synopsis:   simple function to test for the existance of a file
01029 //
01030 //  History:    6-16-93   stevebl   Created
01031 //
01032 //----------------------------------------------------------------------------
01033
01034 int Exists(TCHAR *sz)
01035 {
01036     HANDLE h;
01037     h = CreateFile(sz,
01038         GENERIC_READ,
01039         FILE_SHARE_READ | FILE_SHARE_WRITE,
01040         NULL,
01041         OPEN_EXISTING,
01042         0,
01043         0);
01044     if (h != INVALID_HANDLE_VALUE)
01045     {
01046         CloseHandle(h);
01047         return(1);
01048     }
01049     return (0);
01050 }
01051
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CComWSTR Member List

This is the complete list of members for CComWSTR, including all inherited members.
Append(LPCOLESTR pSrc) | CComWSTR | [inline]
Append(LPCOLESTR pSrc, int nLen) | CComWSTR | [inline]
Attach(WCHAR *src) | CComWSTR | [inline]
CComWSTR(LPCOLESTR pSrc) | CComWSTR | [inline, private]
CComWSTR(const CComWSTR &src) | CComWSTR | [inline, private]
CComWSTR() | CComWSTR | [inline]
Copy() const | CComWSTR | [inline]
CopyFrom(LPCOLESTR pSrc) | CComWSTR | [inline]
Detach() | CComWSTR | [inline]
Empty() | CComWSTR | [inline]
Length() const | CComWSTR | [inline]
m_str | CComWSTR | [protected]
operator WCHAR *() const | CComWSTR | [inline]
operator!() const | CComWSTR | [inline]
operator&() | CComWSTR | [inline]
operator+=(LPCOLESTR pSrc) | CComWSTR | [inline]
~CComWSTR() | CComWSTR | [inline, virtual]
Generated on Wed Nov 13 2024 16:55:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Guid.h Source File

  • WinUI
  • Shell
  • SampView

Guid.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Guid.h
00013
00014    Description:   Private GUID definition.
00015
00016 **************************************************************************/
00017
00018 // {E2CB71D0-D2DC-11d1-B022-00600893AD51}
00019 DEFINE_GUID(   CLSID_SampleNameSpace,
00020                0xe2cb71d0,
00021                0xd2dc,
00022                0x11d1,
00023                0xb0,
00024                0x22,
00025                0x0,
00026                0x60,
00027                0x8,
00028                0x93,
00029                0xad,
00030                0x51);
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/PropProv/MainDll.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • PropProv

MainDll.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  MAINDLL.CPP
00006
00007 //
00008
00009 //  Module: WMI Sample Property Provider
00010
00011 //
00012
00013 //  Purpose: Contains DLL entry points.  Also has code that controls
00014
00015 //           when the DLL can be unloaded by tracking the number of
00016
00017 //           objects and locks as well as routines that support
00018
00019 //           self registration.
00020
00021 //
00022
00023 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00024 //
00025 //***************************************************************************
00026
00027 #include <objbase.h>
00028 #include <initguid.h>
00029 #include "sample.h"
00030 #include <strsafe.h>
00031
00032 HMODULE ghModule;
00033
00034 // TODO, GuidGen should be used to generate a unique number for any
00035 // providers that are going to be used for anything more extensive
00036 // than just testing.
00037
00038 DEFINE_GUID(CLSID_PropProvider,0xCEDEB622L,0x8C78,0x11CF,0xA5,0xB6,0x00,0xAA,0x00,0x68,0x0C,0x3F);
00039
00040 //Count number of objects and number of locks.
00041
00042 long       g_cObj=0;
00043 long       g_cLock=0;
00044
00045 //***************************************************************************
00046 //
00047 // LibMain32
00048 //
00049 // Purpose: Entry point for DLL.
00050 //
00051 // Return: TRUE if OK.
00052 //
00053 //***************************************************************************
00054
00055
00056 BOOL WINAPI LibMain32(HINSTANCE hInstance, ULONG ulReason
00057     , LPVOID pvReserved)
00058 {
00059
00060     if (DLL_PROCESS_ATTACH==ulReason)
00061         ghModule = hInstance;
00062     return TRUE;
00063 }
00064
00065 //***************************************************************************
00066 //
00067 //  DllGetClassObject
00068 //
00069 //  Purpose: Called by Ole when some client wants a class factory.  Return
00070 //           one only if it is the sort of class this DLL supports.
00071 //
00072 //***************************************************************************
00073
00074
00075 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, PPVOID ppv)
00076 {
00077     HRESULT hr;
00078     CProvFactory *pObj;
00079
00080     if (CLSID_PropProvider!=rclsid)
00081         return E_FAIL;
00082
00083     pObj=new CProvFactory();
00084
00085     if (NULL==pObj)
00086         return E_OUTOFMEMORY;
00087
00088
00089     hr=pObj->QueryInterface(riid, ppv);
00090
00091     if (FAILED(hr))
00092         delete pObj;
00093
00094     return hr;
00095 }
00096
00097 //***************************************************************************
00098 //
00099 // DllCanUnloadNow
00100 //
00101 // Purpose: Called periodically by Ole in order to determine if the
00102 //          DLL can be freed.
00103 //
00104 // Return:  S_OK if there are no objects in use and the class factory
00105 //          isn't locked.
00106 //
00107 //***************************************************************************
00108
00109 STDAPI DllCanUnloadNow(void)
00110 {
00111     SCODE   sc;
00112
00113     //It is OK to unload if there are no objects or locks on the
00114     // class factory.
00115
00116     sc=( g_cObj < 1 && g_cLock < 1) ? S_OK : S_FALSE;
00117     return sc;
00118 }
00119
00120 //***************************************************************************
00121 //
00122 // DllRegisterServer
00123 //
00124 // Purpose: Called when it is time to setup the registry settings.  This could
00125 //          be done by a setup program, or by using a system utility such
00126 //          as REGSVR32.EXE.
00127 //
00128 // Return:  NOERROR if registration successful, error otherwise.
00129 //***************************************************************************
00130
00131 STDAPI DllRegisterServer(void)
00132 {
00133     char       szID[128];
00134     WCHAR      wcID[128];
00135     char       szCLSID[128];
00136     TCHAR       szModule[MAX_PATH+ 1];
00137     char * pName = "WMI Sample Prop Provider";
00138     char * pModel = "Both";
00139     HKEY hKey1, hKey2;
00140
00141    // Create the path.
00142
00143   memset(wcID, NULL, sizeof(wcID));
00144   memset(szID, NULL, sizeof(szID));
00145
00146     StringFromGUID2(CLSID_PropProvider, wcID, sizeof(wcID)/sizeof(WCHAR) - 1);
00147     wcstombs(szID, wcID,  sizeof(szID));
00148   StringCbCopy(szCLSID, sizeof(szCLSID), "Software\\classes\\CLSID\\");
00149   StringCbCat(szCLSID, sizeof(szCLSID), (LPCTSTR)szID);
00150
00151
00152     // Create entries under CLSID
00153
00154   LONG lRet = RegCreateKeyEx( HKEY_LOCAL_MACHINE, szCLSID, 0, NULL,
00155                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00156                     &hKey1, NULL );
00157   if (lRet != ERROR_SUCCESS)
00158   {
00159     return E_FAIL;
00160   }
00161
00162     lRet = RegSetValueEx(hKey1, NULL, 0, REG_SZ, (BYTE *)pName, strlen(pName)+1);
00163   if (lRet != ERROR_SUCCESS)
00164   {
00165     RegCloseKey(hKey1);
00166     return E_FAIL;
00167   }
00168
00169   lRet = RegCreateKeyEx( hKey1, "InprocServer32", 0, NULL,
00170                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00171                     &hKey2, NULL );
00172   if (lRet != ERROR_SUCCESS)
00173   {
00174     RegCloseKey(hKey1);
00175     return E_FAIL;
00176   }
00177
00178   memset(&szModule, NULL, sizeof(szModule));
00179     GetModuleFileName(ghModule, szModule,  sizeof(szModule)/sizeof(TCHAR) - 1);
00180     lRet = RegSetValueEx(hKey2, NULL, 0, REG_SZ, (BYTE *)szModule,
00181                                         strlen(szModule)+1);
00182   if (lRet != ERROR_SUCCESS)
00183   {
00184       RegCloseKey(hKey2);
00185     RegCloseKey(hKey1);
00186     return E_FAIL;
00187   }
00188     lRet = RegSetValueEx(hKey2, "ThreadingModel", 0, REG_SZ,
00189                                         (BYTE *)pModel, strlen(pModel)+1);
00190   if (lRet != ERROR_SUCCESS)
00191   {
00192       RegCloseKey(hKey2);
00193     RegCloseKey(hKey1);
00194     return E_FAIL;
00195   }
00196     RegCloseKey(hKey1);
00197     RegCloseKey(hKey2);
00198
00199     return NOERROR;
00200
00201 }
00202
00203
00204 //***************************************************************************
00205 //
00206 // DllUnregisterServer
00207 //
00208 // Purpose: Called when it is time to remove the registry entries.
00209 //
00210 // Return:  NOERROR if registration successful, error otherwise.
00211 //***************************************************************************
00212
00213 STDAPI DllUnregisterServer(void)
00214 {
00215   char       szID[128];
00216     WCHAR      wcID[128];
00217     char  szCLSID[128];
00218     HKEY hKey;
00219
00220     // Create the path using the CLSID
00221   memset(wcID, NULL, sizeof(wcID));
00222   memset(szID, NULL, sizeof(szID));
00223     StringFromGUID2(CLSID_PropProvider, wcID, sizeof(wcID)/sizeof(WCHAR));
00224
00225     wcstombs(szID, wcID, sizeof(szID));
00226
00227   StringCbCopy(szCLSID, sizeof(szCLSID), "Software\\classes\\CLSID\\");
00228   StringCbCat(szCLSID, sizeof(szCLSID), (LPCTSTR)szID);
00229
00230      // First delete the InProcServer subkey.
00231
00232     DWORD dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szCLSID, 0, KEY_WRITE, &hKey);
00233     if(dwRet == NO_ERROR)
00234     {
00235         RegDeleteKey(hKey, "InProcServer32");
00236         RegCloseKey(hKey);
00237     }
00238
00239     dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\CLASSES\\CLSID\\"), 0, KEY_WRITE, &hKey);
00240     if(dwRet == NO_ERROR)
00241     {
00242         RegDeleteKey(hKey,szID);
00243         RegCloseKey(hKey);
00244     }
00245
00246     return NOERROR;
00247 }
00248
00249
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/odbcsql/odbcsql.c Source File

  • Dataaccess
  • odbc
  • odbcsql

odbcsql.c

Go to the documentation of this file.
00001 /*******************************************************************************
00002 /* ODBCSQL: a sample program that implements an ODBC command line intrepreter.
00003 /*
00004 /* USAGE: ODBCSQL DSN=<dsn name>   or
00005 /*      ODBCSQL FILEDSN=<file dsn> or
00006 /*      ODBCSQL DRIVER={driver name}
00007 /*
00008 /*
00009 /* Copyright(c) 1991 - 1999 by Microsoft Corporation.   This is an MDAC sample program and
00010 /* is not suitable for use in production environments.
00011 /*
00012 /******************************************************************************/
00013 /* Modules:
00014 /*    Main        Main driver loop, executes queries.
00015 /*    DisplayResults    Display the results of the query if any
00016 /*    AllocateBindings  Bind column data
00017 /*    DisplayTitles   Print column titles
00018 /*    SetConsole      Set console display mode
00019 /*    HandleError     Show ODBC error messages
00020 /******************************************************************************/
00021 /* Change Log:
00022 /*
00023 /*  8/22/1997 Created
00024 /******************************************************************************/
00025
00026
00027 #include <windows.h>
00028 #include <sql.h>
00029 #include <sqlext.h>
00030 #include <stdio.h>
00031 #include <tchar.h>
00032 #include <stdlib.h>
00033
00034 /*******************************************/
00035 /* Cheesy macro to call ODBC functions and */
00036 /* report an error on failure.         */
00037 /* Takes handle, handle type, and stmt     */
00038 /*******************************************/
00039
00040 #define TRYODBC(h,ht,x) {RETCODE  iRet=x;\
00041                 if (iRet != SQL_SUCCESS) \
00042                 { \
00043                   HandleError(h,ht,iRet); \
00044                 } \
00045                 if (iRet == SQL_ERROR) \
00046                 { \
00047                   fprintf(stderr,"Error in " #x "\n"); \
00048                   goto Exit;  \
00049                 }  \
00050               }
00051 /******************************************/
00052 /* Structure to store information about   */
00053 /* a column.
00054 /******************************************/
00055
00056 typedef struct STR_BINDING {
00057   SQLSMALLINT siDisplaySize;      /* size to display  */
00058   TCHAR   *szBuffer;        /* display buffer   */
00059   SQLINTEGER  indPtr;         /* size or null     */
00060   BOOL    fChar;          /* character col?   */
00061   struct STR_BINDING  *sNext; /* linked list    */
00062 } BINDING;
00063
00064
00065
00066 /******************************************/
00067 /* Forward references                     */
00068 /******************************************/
00069
00070 void HandleError(SQLHANDLE  hHandle,
00071         SQLSMALLINT hType,
00072           RETCODE RetCode);
00073
00074 void DisplayResults(HSTMT   lpStmt,
00075          SQLSMALLINT  cCols);
00076
00077 void AllocateBindings(HSTMT lpStmt,
00078             SQLSMALLINT cCols,
00079             BINDING   **lppBinding,
00080             SQLSMALLINT *lpDisplay);
00081
00082
00083 void DisplayTitles(HSTMT    lpStmt,
00084             DWORD   siDisplaySize,
00085             BINDING *pBinding);
00086
00087 void SetConsole(  DWORD         siDisplaySize,
00088           BOOL      fInvert);
00089
00090 /*****************************************/
00091 /* Some constants                        */
00092 /*****************************************/
00093
00094
00095 #define DISPLAY_MAX 50      // Arbitrary limit on column width to display
00096 #define DISPLAY_FORMAT_EXTRA 3  // Per column extra display bytes (| <data> )
00097 #define DISPLAY_FORMAT    "%c %*.*s "
00098 #define DISPLAY_FORMAT_C  "%c %-*.*s "
00099 #define NULL_SIZE     6 // <NULL>
00100 #define SQL_QUERY_SIZE    1000 // Max. Num characters for SQL Query passed in.
00101
00102 #ifdef UNICODE
00103 #define PIPE        TEXT('|')
00104 #else
00105 #define PIPE        179 // |
00106 #endif
00107
00108 SHORT gHeight = 80;   // Users screen height
00109
00110 /***********************************************************************
00111 /* Program to implement ODBC SQL command-line interpreter.
00112 /*
00113 /* Copyright (C) 1991 - 1999 by Microsoft Corporation
00114 /*
00115 /* This is a sample program, Microsoft assumes no liabilities for any
00116 /* use of this program.
00117 /***********************************************************************
00118 */
00119
00120
00121 int _tmain(int argc, TCHAR **argv)
00122 {
00123   HENV  lpEnv = NULL;
00124   HDBC  lpDbc = NULL;
00125   HSTMT lpStmt = NULL;
00126   TCHAR *pszConnStr;
00127   TCHAR szInput[SQL_QUERY_SIZE];
00128
00129   // Allocate an environment
00130
00131   if (SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&lpEnv) == SQL_ERROR)
00132   {
00133     fprintf(stderr,"Unable to allocate an environment handle\n");
00134     exit(-1);
00135   }
00136
00137   // Register this as an application that expects 2.x behavior,
00138   // you must register something if you use AllocHandle
00139
00140   TRYODBC(lpEnv,
00141       SQL_HANDLE_ENV,
00142       SQLSetEnvAttr(lpEnv,
00143               SQL_ATTR_ODBC_VERSION,
00144               (SQLPOINTER)SQL_OV_ODBC2,
00145               0));
00146
00147   // Allocate a connection
00148
00149   TRYODBC(lpEnv,
00150       SQL_HANDLE_ENV,
00151       SQLAllocHandle(SQL_HANDLE_DBC,lpEnv,&lpDbc));
00152
00153
00154
00155   if (argc > 1)
00156   {
00157     pszConnStr = *++argv;
00158   } else
00159   {
00160     pszConnStr = NULL;
00161   }
00162
00163   // Connect to the driver.  Use the connection string if supplied
00164   // on the input, otherwise let the driver manager prompt for input.
00165
00166   TRYODBC(lpDbc,
00167       SQL_HANDLE_DBC,
00168       SQLDriverConnect(lpDbc,
00169                GetDesktopWindow(),
00170                pszConnStr,
00171                SQL_NTS,
00172                NULL,
00173                0,
00174                NULL,
00175                SQL_DRIVER_COMPLETE));
00176
00177   fprintf(stderr,"Connected!\n");
00178
00179   TRYODBC(lpDbc,
00180       SQL_HANDLE_DBC,
00181       SQLAllocHandle(SQL_HANDLE_STMT,lpDbc,&lpStmt));
00182
00183
00184   printf("Enter SQL commands, type (control)Z to exit\nSQL COMMAND>");
00185
00186   // Loop to get input and execute queries
00187
00188   while(_fgetts(szInput, SQL_QUERY_SIZE-1, stdin))
00189   {
00190     RETCODE   RetCode;
00191     SQLSMALLINT sNumResults;
00192
00193     // Execute the query
00194
00195     if (!(*szInput))
00196     {
00197       printf("SQL COMMAND>");
00198       continue;
00199     }
00200     RetCode = SQLExecDirect(lpStmt,szInput,SQL_NTS);
00201
00202     switch(RetCode)
00203     {
00204       case  SQL_SUCCESS_WITH_INFO:
00205       {
00206         HandleError(lpStmt,SQL_HANDLE_STMT,RetCode);
00207         // fall through
00208       }
00209       case  SQL_SUCCESS:
00210       {
00211         // If this is a row-returning query, display
00212         // results
00213         TRYODBC(lpStmt,
00214             SQL_HANDLE_STMT,
00215             SQLNumResultCols(lpStmt,&sNumResults));
00216
00217         if (sNumResults > 0)
00218         {
00219           DisplayResults(lpStmt,sNumResults);
00220         } else
00221         {
00222           SQLINTEGER    siRowCount;
00223
00224           TRYODBC(lpStmt,
00225               SQL_HANDLE_STMT,
00226               SQLRowCount(lpStmt,&siRowCount));
00227
00228           if (siRowCount >= 0)
00229           {
00230             _tprintf(TEXT("%d %s affected\n"),
00231                 siRowCount,
00232                 siRowCount == 1 ? TEXT("row") : TEXT("rows"));
00233           }
00234         }
00235         break;
00236       }
00237
00238       case  SQL_ERROR:
00239       {
00240         HandleError(lpStmt,SQL_HANDLE_STMT,RetCode);
00241         break;
00242       }
00243
00244       default:
00245           fprintf(stderr,"Unexpected return code %d!\n",RetCode);
00246
00247     }
00248     TRYODBC(lpStmt,
00249         SQL_HANDLE_STMT,
00250         SQLFreeStmt(lpStmt,SQL_CLOSE));
00251
00252     printf("SQL COMMAND>");
00253   }
00254
00255 Exit:
00256
00257   // Free ODBC handles and exit
00258
00259   if (lpDbc)
00260   {
00261     SQLDisconnect(lpDbc);
00262     SQLFreeConnect(lpDbc);
00263   }
00264   if (lpEnv)
00265     SQLFreeEnv(lpEnv);
00266
00267   printf("\nDisconnected.");
00268
00269   return 0;
00270
00271 }
00272
00273 /************************************************************************
00274 /* DisplayResults: display results of a select query
00275 /*
00276 /* Parameters:
00277 /*    lpStmt    ODBC statement handle
00278 /*    cCols   Count of columns
00279 /************************************************************************/
00280
00281 void DisplayResults(HSTMT   lpStmt,
00282             SQLSMALLINT cCols)
00283 {
00284   BINDING     *pFirstBinding, *pThisBinding;
00285   SQLSMALLINT   siDisplaySize;
00286   RETCODE     RetCode;
00287   int       iCount = 0;
00288
00289   // Allocate memory for each column
00290
00291   AllocateBindings(lpStmt,cCols,&pFirstBinding, &siDisplaySize);
00292
00293   // Set the display mode and write the titles
00294
00295   DisplayTitles(lpStmt,siDisplaySize, pFirstBinding);
00296
00297
00298   // Fetch and display the data
00299
00300   do {
00301     // Fetch a row
00302
00303     if (iCount++ >= gHeight - 2)
00304     {
00305       char  szInput[100];
00306       printf("              ");
00307       SetConsole(siDisplaySize+2,TRUE);
00308       printf("   Press ENTER to continue, Q to quit");
00309       printf("%d",gHeight);
00310       SetConsole(siDisplaySize+2,FALSE);
00311       gets(szInput);
00312       if ((*szInput == 'Q') || (*szInput == 'q'))
00313         goto Exit;
00314
00315       iCount = 1;
00316       DisplayTitles(lpStmt,siDisplaySize, pFirstBinding);
00317     }
00318
00319     TRYODBC(lpStmt,SQL_HANDLE_STMT, RetCode = SQLFetch(lpStmt));
00320
00321     if (RetCode == SQL_NO_DATA_FOUND)
00322       break;
00323
00324
00325     // Display the data.   Ignore truncations
00326
00327     for (pThisBinding = pFirstBinding;
00328        pThisBinding;
00329        pThisBinding = pThisBinding->sNext)
00330     {
00331       if (pThisBinding->indPtr != SQL_NULL_DATA)
00332       {
00333         _tprintf(pThisBinding->fChar ? TEXT(DISPLAY_FORMAT_C):
00334                          TEXT(DISPLAY_FORMAT),
00335             PIPE,
00336             pThisBinding->siDisplaySize,
00337             pThisBinding->siDisplaySize,
00338             pThisBinding->szBuffer);
00339       } else
00340       {
00341         _tprintf(TEXT(DISPLAY_FORMAT_C),
00342             PIPE,
00343             pThisBinding->siDisplaySize,
00344             pThisBinding->siDisplaySize,
00345             "<NULL>");
00346       }
00347     }
00348     _tprintf(TEXT(" %c\n"),PIPE);
00349
00350
00351   } while ( 1);
00352
00353   SetConsole(siDisplaySize+2,TRUE);
00354   printf("%*.*s",siDisplaySize+2,siDisplaySize+2," ");
00355   SetConsole(siDisplaySize+2,FALSE);
00356   printf("\n");
00357
00358 Exit:
00359   // Clean up the allocated buffers
00360
00361   while (pFirstBinding)
00362   {
00363     pThisBinding=pFirstBinding->sNext;
00364     free(pFirstBinding->szBuffer);
00365     free(pFirstBinding);
00366     pFirstBinding=pThisBinding;
00367   }
00368
00369 }
00370
00371 /************************************************************************
00372 /* AllocateBindings:  Get column information and allocate bindings
00373 /* for each column.
00374 /*
00375 /* Parameters:
00376 /*    lpStmt    Statement handle
00377 /*    cCols   Number of columns in the result set
00378 /*    *lppBinding Binding pointer (returned)
00379 /*    lpDisplay Display size of one line
00380 /************************************************************************/
00381
00382 void AllocateBindings(HSTMT     lpStmt,
00383             SQLSMALLINT cCols,
00384             BINDING   **lppBinding,
00385             SQLSMALLINT *lpDisplay)
00386 {
00387   SQLSMALLINT   iCol;
00388   BINDING     *lpThisBinding, *lpLastBinding;
00389   SQLSMALLINT   cchDisplay, cchColumnNameLength, ssType;
00390
00391   *lpDisplay = 0;
00392
00393   for (iCol = 1; iCol <= cCols; iCol++)
00394   {
00395     lpThisBinding = (BINDING *)(malloc(sizeof(BINDING)));
00396     if (!(lpThisBinding))
00397     {
00398       fprintf(stderr,"Out of memory!\n");
00399       exit(-100);
00400     }
00401
00402     if (iCol == 1)
00403     {
00404       *lppBinding = lpThisBinding;
00405     }
00406     else
00407     {
00408       lpLastBinding->sNext = lpThisBinding;
00409     }
00410     lpLastBinding=lpThisBinding;
00411
00412
00413     // Figure out the display length of the column (we will
00414     // bind to char since we are only displaying data, in general
00415     // you should bind to the appropriate C type if you are going
00416     // to manipulate data since it is much faster...)
00417
00418     TRYODBC(lpStmt,
00419         SQL_HANDLE_STMT,
00420         SQLColAttribute(lpStmt,
00421                  iCol,
00422                  SQL_DESC_DISPLAY_SIZE,
00423                  NULL,
00424                  0,
00425                  NULL,
00426                  &cchDisplay));
00427
00428
00429     // Figure out if this is a character or numeric column; this is
00430     // used to determine if we want to display the data left- or right-
00431     // aligned.
00432
00433     // !! Note a bug in the 3.x documentation.  We claim that
00434     // SQL_DESC_TYPE is a 1.x feature.   That is not true, SQL_DESC_TYPE
00435     // is a 3.x feature.   SQL_DESC_CONCISE_TYPE maps to the 1.x
00436     // SQL_COLUMN_TYPE.   This is what you must use if you want to work
00437     // against a 2.x driver.  Sorry for the inconvenience...
00438
00439     TRYODBC(lpStmt,
00440         SQL_HANDLE_STMT,
00441         SQLColAttribute(lpStmt,
00442                 iCol,
00443                 SQL_DESC_CONCISE_TYPE,
00444                 NULL,
00445                 0,
00446                 NULL,
00447                 &ssType));
00448
00449
00450     lpThisBinding->fChar = (ssType == SQL_CHAR ||
00451                 ssType == SQL_VARCHAR ||
00452                 ssType == SQL_LONGVARCHAR);
00453
00454     lpThisBinding->sNext = NULL;
00455
00456     // Arbitrary limit on display size
00457     if (cchDisplay > DISPLAY_MAX)
00458       cchDisplay = DISPLAY_MAX;
00459
00460     // Allocate a buffer big enough to hold the text representation
00461     // of the data.  Add one character for the null terminator
00462
00463     lpThisBinding->szBuffer = (TCHAR *)malloc((cchDisplay+1) * sizeof(TCHAR));
00464
00465     if (!(lpThisBinding->szBuffer))
00466     {
00467       fprintf(stderr,"Out of memory!\n");
00468       exit(-100);
00469     }
00470
00471     // Map this buffer to the driver's buffer.   At Fetch time,
00472     // the driver will fill in this data.  Note that the size is
00473     // count of bytes (for Unicode).  All ODBC functions that take
00474     // SQLPOINTER use count of bytes; all functions that take only
00475     // strings use count of characters.
00476
00477
00478     TRYODBC(lpStmt,
00479         SQL_HANDLE_STMT,
00480         SQLBindCol(lpStmt,
00481                iCol,
00482                SQL_C_TCHAR,
00483                (SQLPOINTER) lpThisBinding->szBuffer,
00484                (cchDisplay + 1) * sizeof(TCHAR),
00485                &lpThisBinding->indPtr));
00486
00487
00488     // Now set the display size that we will use to display
00489     // the data.   Figure out the length of the column name
00490
00491     TRYODBC(lpStmt,
00492         SQL_HANDLE_STMT,
00493         SQLColAttribute(lpStmt,
00494                 iCol,
00495                 SQL_DESC_NAME,
00496                 NULL,
00497                 0,
00498                 &cchColumnNameLength,
00499                 NULL));
00500
00501     lpThisBinding->siDisplaySize = max(cchDisplay, cchColumnNameLength);
00502     if (lpThisBinding->siDisplaySize < NULL_SIZE)
00503       lpThisBinding->siDisplaySize = NULL_SIZE;
00504
00505     *lpDisplay += lpThisBinding->siDisplaySize + DISPLAY_FORMAT_EXTRA;
00506
00507   }
00508
00509   Exit:
00510     // Not really a good error exit handler, we should free
00511     // up any memory that we allocated.   But this is a sample...
00512
00513     return;
00514 }
00515
00516
00517 /************************************************************************
00518 /* DisplayTitles: print the titles of all the columns and set the
00519 /*            shell window's width
00520 /*
00521 /* Parameters:
00522 /*    lpStmt        Statement handle
00523 /*    siDisplaySize Total display size
00524 /*    pBinding    list of binding information
00525 /************************************************************************/
00526
00527 void  DisplayTitles(HSTMT   lpStmt,
00528             DWORD   siDisplaySize,
00529             BINDING *pBinding)
00530 {
00531   TCHAR     szTitle[DISPLAY_MAX];
00532   SQLSMALLINT   iCol = 1;
00533
00534   SetConsole(siDisplaySize+2,TRUE);
00535
00536
00537   for (;pBinding;pBinding=pBinding->sNext)
00538   {
00539     TRYODBC(lpStmt,
00540         SQL_HANDLE_STMT,
00541         SQLColAttribute(lpStmt,
00542                 iCol++,
00543                 SQL_DESC_NAME,
00544                 szTitle,
00545                 sizeof(szTitle),  // Note count of bytes!
00546                 NULL,
00547                 NULL));
00548
00549     _tprintf(TEXT(DISPLAY_FORMAT_C), PIPE,
00550          pBinding->siDisplaySize,
00551          pBinding->siDisplaySize,
00552          szTitle);
00553
00554   }
00555
00556 Exit:
00557
00558   _tprintf(TEXT(" %c"),PIPE);
00559   SetConsole(siDisplaySize+2,FALSE);
00560   _tprintf(TEXT("\n"));
00561
00562 }
00563
00564
00565 /************************************************************************
00566 /* SetConsole: sets console display size and video mode
00567 /*
00568 /*  Parameters
00569 /*    siDisplaySize Console display size
00570 /*    fInvert     Invert video?
00571 /************************************************************************/
00572
00573 void  SetConsole( DWORD         siDisplaySize,
00574           BOOL      fInvert)
00575 {
00576   HANDLE              hConsole;
00577   CONSOLE_SCREEN_BUFFER_INFO    csbInfo;
00578
00579
00580     // A little bit of fun here -- reset the console screen
00581     // buffer size if necessary
00582
00583
00584     hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
00585
00586     if (hConsole != INVALID_HANDLE_VALUE)
00587     {
00588     if (GetConsoleScreenBufferInfo(hConsole, &csbInfo))
00589     {
00590       if (csbInfo.dwSize.X <  (SHORT) siDisplaySize)
00591       {
00592         csbInfo.dwSize.X =  (SHORT) siDisplaySize;
00593                 SetConsoleScreenBufferSize(hConsole,csbInfo.dwSize);
00594       }
00595
00596       gHeight = csbInfo.dwSize.Y;
00597     }
00598
00599     if (fInvert)
00600       SetConsoleTextAttribute(hConsole, (WORD)(csbInfo.wAttributes |
00601                         BACKGROUND_BLUE));
00602     else
00603       SetConsoleTextAttribute(hConsole,(WORD)(csbInfo.wAttributes & ~(
00604                         BACKGROUND_BLUE)));
00605   }
00606 }
00607
00608
00609 /************************************************************************
00610 /* HandleError: display error information
00611 /*
00612 /* Parameters:
00613 /*    hHandle   ODBC handle
00614 /*    hType   Type of handle (HANDLE_STMT,HANDLE_ENV,HANDLE_DBC
00615 /*    RetCode   Return code of failing command
00616 /************************************************************************/
00617
00618 void HandleError(SQLHANDLE  hHandle,
00619         SQLSMALLINT hType,
00620           RETCODE RetCode)
00621 {
00622   SQLSMALLINT iRec = 0;
00623   SQLINTEGER  iError;
00624   TCHAR   szMessage[1000];
00625   TCHAR   szState[SQL_SQLSTATE_SIZE];
00626
00627
00628   if (RetCode == SQL_INVALID_HANDLE)
00629   {
00630     fprintf(stderr,"Invalid handle!\n");
00631     return;
00632   }
00633
00634
00635   while (SQLGetDiagRec(hType,
00636              hHandle,
00637              ++iRec,
00638              szState,
00639              &iError,
00640              szMessage,
00641              (SQLSMALLINT)(sizeof(szMessage) / sizeof(TCHAR)),
00642              (SQLSMALLINT *)NULL) == SQL_SUCCESS)
00643   {
00644
00645     // Hide data truncated..
00646     if (_tcsncmp(szState,TEXT("01004"),5))
00647       _ftprintf(stderr,TEXT("[%5.5s] %s (%d)\n"),szState,szMessage,iError);
00648   }
00649
00650 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/utils.c Source File

  • NetDS
  • RRas
  • ip

utils.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\utils.c
00008
00009 Abstract:
00010
00011     The file contains miscellaneous utilities.
00012
00013 --*/
00014
00015
00016 #include "pchsample.h"
00017 #pragma hdrstop
00018
00019 DWORD
00020 QueueSampleWorker(
00021     IN  WORKERFUNCTION  pfnFunction,
00022     IN  PVOID           pvContext
00023     )
00024 /*++
00025
00026 Routine Description
00027     This function is called to queue a worker function in a safe fashion;
00028     if cleanup is in progress or if SAMPLE has stopped, this function
00029     discards the work-item.
00030
00031 Locks
00032     Acquires exclusively g_ce.rwlLock
00033     Releases             g_ce.rwlLock
00034
00035 Arguments
00036     pfnFunction         function to be called
00037     pvContext           opaque ptr used in callback
00038
00039 Return Value
00040     NO_ERROR            if success
00041     Failure code        o/w
00042
00043 --*/
00044 {
00045     DWORD   dwErr       = NO_ERROR;
00046     BOOL    bSuccess    = FALSE;
00047
00048     ACQUIRE_WRITE_LOCK(&(g_ce.rwlLock));
00049
00050     do                          // breakout loop
00051     {
00052         // cannot queue a work function when SAMPLE has quit or is quitting
00053         if (g_ce.iscStatus != IPSAMPLE_STATUS_RUNNING)
00054         {
00055             dwErr = ERROR_CAN_NOT_COMPLETE;
00056             break;
00057         }
00058
00059         bSuccess = QueueUserWorkItem((LPTHREAD_START_ROUTINE)pfnFunction,
00060                                      pvContext,
00061                                      0); // no flags
00062         if (bSuccess)
00063             g_ce.ulActivityCount++;
00064         else
00065             dwErr = GetLastError();
00066     } while (FALSE);
00067
00068     RELEASE_WRITE_LOCK(&(g_ce.rwlLock));
00069
00070     return dwErr;
00071 }
00072
00073
00074
00075 BOOL
00076 EnterSampleAPI(
00077     )
00078 /*++
00079
00080 Routine Description
00081     This function is called when entering a SAMPLE api, as well as when
00082     entering the input thread and timer thread.  It checks to see if SAMPLE
00083     has stopped, and if so it quits; otherwise it increments the count of
00084     active threads.
00085
00086 Locks
00087     Acquires exclusively g_ce.rwlLock
00088     Releases             g_ce.rwlLock
00089
00090 Arguments
00091     None
00092
00093 Return Value
00094     TRUE                if entered successfully
00095     FALSE               o/w
00096
00097 --*/
00098 {
00099     BOOL    bEntered    = FALSE;
00100
00101     ACQUIRE_WRITE_LOCK(&(g_ce.rwlLock));
00102
00103     if (g_ce.iscStatus is IPSAMPLE_STATUS_RUNNING)
00104     {
00105         // SAMPLE is running, so continue
00106         g_ce.ulActivityCount++;
00107         bEntered = TRUE;
00108     }
00109
00110     RELEASE_WRITE_LOCK(&(g_ce.rwlLock));
00111
00112     return bEntered;
00113 }
00114
00115
00116
00117 BOOL
00118 EnterSampleWorker(
00119     )
00120 /*++
00121
00122 Routine Description
00123     This function is called when entering a SAMPLE worker-function.  Since
00124     there is a lapse between the time a worker-function is queued and the
00125     time the function is actually invoked by a worker thread, this function
00126     must check to see if SAMPLE has stopped or is stopping; if this is the
00127     case, then it decrements the activity count, releases the activity
00128     semaphore, and quits.
00129
00130 Locks
00131     Acquires exclusively g_ce.rwlLock
00132     Releases             g_ce.rwlLock
00133
00134 Arguments
00135     None
00136
00137 Return Value
00138     TRUE                if entered successfully
00139     FALSE               o/w
00140
00141 --*/
00142 {
00143     BOOL    bEntered    = FALSE;
00144
00145     ACQUIRE_WRITE_LOCK(&(g_ce.rwlLock));
00146
00147     do                          // breakout loop
00148     {
00149         // SAMPLE is running, so the function may continue
00150         if (g_ce.iscStatus is IPSAMPLE_STATUS_RUNNING)
00151         {
00152             bEntered = TRUE;
00153             break;
00154         }
00155
00156         // SAMPLE is not running, but it was, so the function must stop
00157         if (g_ce.iscStatus is IPSAMPLE_STATUS_STOPPING)
00158         {
00159             g_ce.ulActivityCount--;
00160             ReleaseSemaphore(g_ce.hActivitySemaphore, 1, NULL);
00161             break;
00162         }
00163
00164         // SAMPLE probably never started. quit
00165     } while (FALSE);
00166
00167     RELEASE_WRITE_LOCK(&(g_ce.rwlLock));
00168
00169     return bEntered;
00170 }
00171
00172
00173
00174 VOID
00175 LeaveSampleWorker(
00176     )
00177 /*++
00178
00179 Routine Description
00180     This function is called when leaving a SAMPLE api or worker function.
00181     It decrements the activity count, and if it detects that SAMPLE has
00182     stopped or is stopping, it releases the activity semaphore.
00183
00184 Locks
00185     Acquires exclusively g_ce.rwlLock
00186     Releases             g_ce.rwlLock
00187
00188 Arguments
00189     None
00190
00191 Return Value
00192     TRUE                if entered successfully
00193     FALSE               o/w
00194
00195 --*/
00196 {
00197     ACQUIRE_WRITE_LOCK(&(g_ce.rwlLock));
00198
00199     g_ce.ulActivityCount--;
00200
00201     if (g_ce.iscStatus is IPSAMPLE_STATUS_STOPPING)
00202         ReleaseSemaphore(g_ce.hActivitySemaphore, 1, NULL);
00203
00204     RELEASE_WRITE_LOCK(&(g_ce.rwlLock));
00205 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpCntr/SimpCntr.Cpp Source File

  • Com
  • Fundamentals
  • SimpCntr

SimpCntr.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: Simple.cpp
00003 //
00004 //      Main source file for the Simple OLE 2.0 object container
00005 //
00006 // Functions:
00007 //
00008 //      WinMain         - Program entry point
00009 //      MainWndProc     - Processes messages for the frame window
00010 //      About           - Processes messages for the about dialog
00011 //      DocWndProc      - Processes messages for the doc window
00012 //
00013 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00014 //**********************************************************************
00015
00016 #include "pre.h"
00017 #include "iocs.h"
00018 #include "ias.h"
00019 #include "ioipf.h"
00020 #include "ioips.h"
00021 #include "app.h"
00022 #include "site.h"
00023 #include "doc.h"
00024
00025 CSimpleApp FAR * lpCSimpleApp;
00026
00027 //**********************************************************************
00028 //
00029 // WinMain
00030 //
00031 // Purpose:
00032 //
00033 //      Program entry point
00034 //
00035 // Parameters:
00036 //
00037 //      HANDLE hInstance        - Instance handle for this instance
00038 //
00039 //      HANDLE hPrevInstance    - Instance handle for the last instance
00040 //
00041 //      LPSTR lpCmdLine         - Pointer to the command line
00042 //
00043 //      int nCmdShow            - Window State
00044 //
00045 // Return Value:
00046 //
00047 //      msg.wParam
00048 //
00049 // Function Calls:
00050 //      Function                        Location
00051 //
00052 //      CSimpleApp::CSimpleApp          APP.CPP
00053 //      CSimpleApp::fInitApplication    APP.CPP
00054 //      CSimpleApp::fInitInstance       APP.CPP
00055 //      CSimpleApp::HandleAccelerators  APP.CPP
00056 //      CSimpleApp::~CSimpleApp         APP.CPP
00057 //      GetMessage                      Windows API
00058 //      TranslateMessage                Windows API
00059 //      DispatchMessage                 Windows API
00060 //
00061 // Comments:
00062 //
00063 //********************************************************************
00064
00065 int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
00066
00067 {
00068         MSG msg;
00069
00070         // needed for LRPC to work properly...
00071         SetMessageQueue(96);
00072
00073         lpCSimpleApp = new CSimpleApp;
00074
00075         // we will add one ref count on our App. later when we want to destroy
00076         // the App object we will release this  ref count. when the App's ref
00077         // count goes to 0, it will be deleted.
00078         lpCSimpleApp->AddRef();
00079
00080         // app initialization
00081         if (!hPrevInstance)
00082                 if (!lpCSimpleApp->fInitApplication(hInstance))
00083                         return (FALSE);
00084
00085         // instance initialization
00086         if (!lpCSimpleApp->fInitInstance(hInstance, nCmdShow))
00087                 return (FALSE);
00088
00089         // message loop
00090         while (GetMessage(&msg, NULL, NULL, NULL))
00091                 if (!lpCSimpleApp->HandleAccelerators(&msg))
00092                         {
00093                         TranslateMessage(&msg);    /* Translates virtual key codes */
00094                         DispatchMessage(&msg);     /* Dispatches message to window */
00095                         }
00096
00097         // Release the ref count added on the App above. this will make
00098         // the App's ref count go to 0, and the App object will be deleted.
00099         lpCSimpleApp->Release();
00100
00101         return (msg.wParam);          /* Returns the value from PostQuitMessage */
00102 }
00103
00104
00105 //**********************************************************************
00106 //
00107 // MainWndProc
00108 //
00109 // Purpose:
00110 //
00111 //      Processes messages for the frame window
00112 //
00113 // Parameters:
00114 //
00115 //      HWND hWnd       - Window handle for frame window
00116 //
00117 //      UINT message    - Message value
00118 //
00119 //      WPARAM wParam   - Message info
00120 //
00121 //      LPARAM lParam   - Message info
00122 //
00123 // Return Value:
00124 //
00125 //      long
00126 //
00127 // Function Calls:
00128 //      Function                        Location
00129 //
00130 //      CSimpleApp::lCommandHandler     APP.CPP
00131 //      CSimpleApp::DestroyDocs         APP.CPP
00132 //      CSimpleApp::lCreateDoc          APP.CPP
00133 //      CSimpleApp::lSizeHandler        APP.CPP
00134 //      CSimpleDoc::lAddVerbs           DOC.CPP
00135 //      PostQuitMessage                 Windows API
00136 //      DefWindowProc                   Windows API
00137 //
00138 // Comments:
00139 //
00140 //********************************************************************
00141
00142 //@@WTK WIN32, UNICODE
00143 //long FAR PASCAL _export MainWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00144 long FAR PASCAL EXPORT MainWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00145
00146 {
00147
00148         switch (message)
00149                 {
00150                 case WM_COMMAND:           // message: command from application menu
00151                         return lpCSimpleApp->lCommandHandler(hWnd, message, wParam, lParam);
00152                         break;
00153
00154                 case WM_CREATE:
00155                         return lpCSimpleApp->lCreateDoc(hWnd, message, wParam, lParam);
00156                         break;
00157
00158                 case WM_DESTROY:                  // message: window being destroyed
00159                         lpCSimpleApp->DestroyDocs();  // need to destroy the doc...
00160                         PostQuitMessage(0);
00161                         break;
00162
00163                 case WM_INITMENUPOPUP:
00164                         // is this the edit menu?
00165                         // Message packing is the same for WIN16 and 32
00166                         if ( LOWORD(lParam) == 1)
00167                                 return lpCSimpleApp->m_lpDoc->lAddVerbs();
00168
00169                         break;
00170
00171                 // this code is needed for 256 color objects to work properly.
00172                 case WM_QUERYNEWPALETTE:
00173                         if (! lpCSimpleApp->m_fAppActive)
00174                                 return 0L;
00175
00176                         return lpCSimpleApp->QueryNewPalette();
00177
00178
00179                 case WM_PALETTECHANGED:
00180                 {
00181                         HWND hWndPalChg = (HWND) wParam;
00182
00183                         if (hWnd != hWndPalChg)
00184                                 wSelectPalette(hWnd, lpCSimpleApp->m_hStdPal, TRUE/*fBackground*/);
00185
00186                         /* OLE2NOTE: always forward the WM_PALETTECHANGED message (via
00187                         **    SendMessage) to any in-place objects that currently have
00188                         **    their window visible. this gives these objects the chance
00189                         **    to select their palettes. this is
00190                         **    REQUIRED by all in-place containers independent of
00191                         **    whether they use color palettes themselves--their objects
00192                         **    may use color palettes.
00193                         **    (see ContainerDoc_ForwardPaletteChangedMsg for more info)
00194                         */
00195                         if (lpCSimpleApp->m_lpDoc && lpCSimpleApp->m_lpDoc->m_lpSite &&
00196                                 lpCSimpleApp->m_lpDoc->m_lpSite->m_hwndIPObj)
00197                                 SendMessage(lpCSimpleApp->m_lpDoc->m_lpSite->m_hwndIPObj,
00198                                                 WM_PALETTECHANGED, wParam, lParam);
00199
00200                         return 0L;
00201                 }
00202
00203                 case WM_ACTIVATEAPP:
00204                         if ((lpCSimpleApp->m_fAppActive = (BOOL)wParam) == TRUE)
00205                                 lpCSimpleApp->QueryNewPalette();
00206
00207                         if (lpCSimpleApp->m_lpDoc->m_lpActiveObject) {
00208                                 lpCSimpleApp->m_lpDoc->m_lpActiveObject->OnFrameWindowActivate(
00209                                                 (BOOL)wParam);
00210                         }
00211                         break;
00212
00213
00214                 case WM_SIZE:
00215                         return lpCSimpleApp->lSizeHandler(hWnd, message, wParam, lParam);
00216
00217                 default:                          // Passes it on if unproccessed
00218                         return (DefWindowProc(hWnd, message, wParam, lParam));
00219                 }
00220                 return (NULL);
00221 }
00222
00223 //**********************************************************************
00224 //
00225 // About
00226 //
00227 // Purpose:
00228 //
00229 //      Processes dialog box messages
00230 //
00231 // Parameters:
00232 //
00233 //      HWND hWnd       - Window handle for dialog box
00234 //
00235 //      UINT message    - Message value
00236 //
00237 //      WPARAM wParam   - Message info
00238 //
00239 //      LPARAM lParam   - Message info
00240 //
00241 // Return Value:
00242 //
00243 // Function Calls:
00244 //      Function                    Location
00245 //
00246 //      EndDialog                   Windows API
00247 //
00248 // Comments:
00249 //
00250 //********************************************************************
00251
00252 //@@WTK WIN32, UNICODE
00253 //BOOL FAR PASCAL _export About(HWND hDlg,unsigned message,WORD wParam,LONG lParam)
00254 BOOL FAR PASCAL EXPORT About(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
00255
00256 {
00257         switch (message) {
00258         case WM_INITDIALOG:                /* message: initialize dialog box */
00259                 return (TRUE);
00260
00261         case WM_COMMAND:                      /* message: received a command */
00262                 //@@WTK WIN32, UNICODE
00263                 if (LOWORD(wParam) == IDOK                /* "OK" box selected?          */
00264                 || LOWORD(wParam) == IDCANCEL) {      /* System menu close command? */
00265                         EndDialog(hDlg, TRUE);        /* Exits the dialog box        */
00266                         return (TRUE);
00267                 }
00268                 break;
00269         }
00270         return (FALSE);                           /* Didn't process a message    */
00271 }
00272
00273 //**********************************************************************
00274 //
00275 // DocWndProc
00276 //
00277 // Purpose:
00278 //
00279 //      Processes dialog box messages
00280 //
00281 // Parameters:
00282 //
00283 //      HWND hWnd       - Window handle for doc window
00284 //
00285 //      UINT message    - Message value
00286 //
00287 //      WPARAM wParam   - Message info
00288 //
00289 //      LPARAM lParam   - Message info
00290 //
00291 // Return Value:
00292 //
00293 // Function Calls:
00294 //      Function                            Location
00295 //
00296 //      CSimpleApp::PaintApp                APP.CPP
00297 //      BeginPaint                          Windows API
00298 //      EndPaint                            Windows API
00299 //      DefWindowProc                       Windows API
00300 //      IOleObject::QueryInterface          Object
00301 //      IOleInPlaceObject::UIDeactivate     Object
00302 //      IOleObject::DoVerb                  Object
00303 //      IOleInPlaceObject::Release          Object
00304 //
00305 // Comments:
00306 //
00307 //********************************************************************
00308
00309 //@@WTK WIN32, UNICODE
00310 //long FAR PASCAL _export DocWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00311 long FAR PASCAL EXPORT DocWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00312 {
00313         HDC hDC;
00314         PAINTSTRUCT ps;
00315
00316         switch (message) {
00317                 case WM_PAINT:
00318
00319                         hDC = BeginPaint(hWnd, &ps);
00320
00321                         if (lpCSimpleApp)
00322                                 lpCSimpleApp->PaintApp (hDC);
00323
00324                         EndPaint(hWnd, &ps);
00325                         break;
00326
00327
00328                 case WM_LBUTTONDBLCLK:
00329                         {
00330                         POINT pt;
00331
00332                         pt.x = (int)(short)LOWORD (lParam );
00333                         pt.y = (int)(short)HIWORD (lParam );
00334
00335                         if (lpCSimpleApp->m_lpDoc->m_lpSite &&
00336                                 lpCSimpleApp->m_lpDoc->m_lpSite->m_lpOleObject)
00337                                 {
00338                                 RECT rect;
00339
00340                                 lpCSimpleApp->m_lpDoc->m_lpSite->GetObjRect(&rect);
00341
00342                                 if ( PtInRect(&rect, pt) )
00343                                         {
00344                                         // Execute object's default verb
00345                                         lpCSimpleApp->m_lpDoc->m_lpSite->m_lpOleObject->DoVerb(
00346                                                         OLEIVERB_PRIMARY, (LPMSG)&message,
00347                                                         &lpCSimpleApp->m_lpDoc->m_lpSite->m_OleClientSite,
00348                                                         -1, hWnd, &rect);
00349                                         }
00350                                 }
00351                         }
00352                         break;
00353
00354         // no code is added to WM_LBUTTONDOWN for context sensitive help, because
00355         // this app does not do context sensitive help.
00356         case WM_LBUTTONDOWN:
00357
00358                 LPOLEINPLACEOBJECT lpObject;
00359
00360                 if (lpCSimpleApp->m_lpDoc->m_fInPlaceActive)
00361                         {
00362                         lpCSimpleApp->m_lpDoc->m_lpSite->m_lpOleObject->QueryInterface(IID_IOleInPlaceObject, (LPVOID FAR *)&lpObject);
00363                         lpObject->UIDeactivate();
00364
00365                         // this code is needed because we don't support inside out.
00366                         RECT rect;
00367                         lpCSimpleApp->m_lpDoc->m_lpSite->GetObjRect(&rect);
00368                         lpCSimpleApp->m_lpDoc->m_lpSite->m_lpOleObject->DoVerb(OLEIVERB_HIDE, (LPMSG)&message, &lpCSimpleApp->m_lpDoc->m_lpSite->m_OleClientSite, -1, hWnd, &rect);
00369
00370                         lpObject->Release();
00371                         }
00372
00373                 break;
00374
00375                 default:                          /* Passes it on if unproccessed */
00376                         return (DefWindowProc(hWnd, message, wParam, lParam));
00377         }
00378         return (NULL);
00379 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CNetworkData Member List

This is the complete list of members for CNetworkData, including all inherited members.
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CNetworkData | [virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CNetworkData | [virtual]
CObjData(void) | CObjData | [inline]
CObjData(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
GetHNetwork(void) | CNetworkData | [inline]
GetHNetwork(void) | CNetworkData | [inline]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
HrInitialize(IUnknown *piDataIn) | CNetworkData | [protected, virtual]
HrInitialize(IUnknown *piDataIn) | CNetworkData | [protected, virtual]
InvokeCommand(ULONG nCommandIDIn) | CNetworkData | [virtual]
InvokeCommand(ULONG nCommandIDIn) | CNetworkData | [virtual]
m_cot | CObjData | [protected]
m_hNetwork | CNetworkData | [private]
m_rgprtcPSPages | CObjData | [protected]
m_rgprtcWizPages | CObjData | [protected]
m_strName | CObjData | [protected]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
StrName(void) | CObjData | [inline, virtual]
StrName(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/customdial/customdial.cpp Source File

  • NetDS
  • Ras
  • customdial

customdial.cpp

Go to the documentation of this file.
00001 //
00002 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 // PARTICULAR PURPOSE.
00006 //
00007 // Copyright © 2002  Microsoft Corporation.  All Rights Reserved.
00008 //
00009 // Abstract:
00010 //    This code demonstrates how to build a customdial DLL for
00011 //    Windows 2000  and Windows XP RAS. The code shows how to export and provide a
00012 //    rudimentary implementation for each of the exports required
00013 //    by the DLL.
00014 //
00015 //    You must create an appropriate RAS Entry in the phonebook that inlcudes a path to this
00016 //    custom DLL. See the CustomEntry sample on how to create a phonebook entry with a path to
00017 //    your custom DLL.
00018 //
00019 //    The DLL provides debug tracing facilities through the use of
00020 //    OutputDebugString. In this manner one can use programs that intercept
00021 //    this output to view the DLL state while it is running such as DBMon
00022 //    in the Platform SDK, an attached debugger, or other 3rd party
00023 //    programs.
00024 //
00025
00026 //
00027 // Includes
00028 //
00029
00030 #ifdef WINVER
00031 #undef WINVER
00032 #endif
00033
00034
00035 #define WINVER 0x0500   // needed for Windows 2000 RAS extensions
00036
00037
00038
00039 #ifndef UNICODE
00040 #define UNICODE         // this is a Unicode DLL
00041 #endif
00042
00043 #include <windows.h>    // Windows includes
00044 #include <windowsx.h>   // Windows message crackers
00045 #include <ras.h>        // Ras functions
00046 #include <raserror.h>   // Ras error definitions
00047 #include <rasdlg.h>     // Ras dialog functions
00048 #include <stdio.h>      // Standard I/O functions
00049
00050 #include "resource.h"   // resource file for the dialog templates
00051
00052 HANDLE g_hInstance;     // global handle to this DLL
00053
00054 // Macro for counting maximum characters that will fit into a buffer
00055 #define CELEMS(x) ((sizeof(x))/(sizeof(x[0])))
00056
00057
00058 // Strucuters for passing data between dialog procs
00059 typedef struct _CUSTOM_ENTRY_DATA_SAMPLE_
00060 {
00061     RASENTRYDLG tEntryDlg;
00062     LPRASENTRY  ptEntry;
00063     TCHAR       szEntryName[RAS_MaxEntryName + 1];
00064     TCHAR       szPhoneBookPath[MAX_PATH + 1];
00065 } SAMPLE_CUSTOM_ENTRY_DATA, *PSAMPLE_CUSTOM_ENTRY_DATA;
00066
00067
00068 typedef struct _CUSTOM_DIAL_DLG_SAMPLE_
00069 {
00070     RASDIALDLG      tDialDlg;
00071     RASDIALPARAMS   tDialParams;
00072 } SAMPLE_CUSTOM_DIAL_DLG, *PSAMPLE_CUSTOM_DIAL_DLG;
00073
00074
00075 //
00076 // OutputTraceString
00077 //
00078 // multiple argument front-end to OutputDebugString
00079 //
00080 void OutputTraceString(LPTSTR lpszFormatString, ...)
00081 {
00082   const DWORD MAX_DEBUGSTR = 256;      // max string for ouput
00083   va_list arglist;                     // variable argument list
00084   TCHAR szOutputString[MAX_DEBUGSTR];  // the string to print - limited
00085
00086   // create the new string limited to the char count as indicated
00087   va_start(arglist, lpszFormatString);
00088   _vsnwprintf(szOutputString, MAX_DEBUGSTR, lpszFormatString, arglist);
00089   va_end(arglist);
00090
00091   // send it out
00092   OutputDebugString(szOutputString);
00093 }
00094
00095 //
00096 // DllMain
00097 //
00098 // this is the main entry point into the DLL and is called when
00099 // the DLL is loaded
00100 //
00101 extern "C" BOOL APIENTRY DllMain( HINSTANCE hInstance,
00102                        DWORD  ul_reason_for_call,
00103                        LPVOID lpReserved
00104            )
00105 {
00106     // save instance handle for register/unregister functionality
00107     g_hInstance = hInstance;
00108
00109     switch (ul_reason_for_call)
00110     {
00111     case DLL_PROCESS_ATTACH:
00112         DisableThreadLibraryCalls(hInstance);
00113         OutputTraceString(L"CustomDial DLLMain (instance: 0x%08x) called - Process Attach\n", hInstance);
00114         break;
00115     case DLL_THREAD_ATTACH:
00116         OutputTraceString(L"CustomDial DLLMain (instance: 0x%08x) called - Thread Attach\n", hInstance);
00117         break;
00118     case DLL_THREAD_DETACH:
00119         OutputTraceString(L"CustomDial DLLMain (instance: 0x%08x) called - Thread Detach\n", hInstance);
00120         break;
00121     case DLL_PROCESS_DETACH:
00122         OutputTraceString(L"CustomDial DLLMain (instance: 0x%08x) called - Process Detach\n", hInstance);
00123         break;
00124     }
00125
00126     return TRUE;
00127 }
00128
00129 //
00130 // RasCustomDial
00131 //
00132 // This export is the custom dial entry when RasDial has been called by
00133 // an application - the call is forwarded to here and it is up to this
00134 // function then to obtain a connection. This implementation simply
00135 // forwards the request back to RasDial. Note that we must add the
00136 // RDEOPT_CustomDial flag to the RasDialExtensions structure so we don't
00137 // recursively get called.
00138 //
00139 extern "C" DWORD WINAPI RasCustomDial (
00140   HINSTANCE hInstDll,                      // handle to DLL instance
00141   LPRASDIALEXTENSIONS lpRasDialExtensions, // pointer to function extensions data
00142   LPCTSTR lpszPhonebook,                   // pointer to full path and file name of phone-book file
00143   LPRASDIALPARAMS lpRasDialParams,         // pointer to calling parameters data
00144   DWORD dwNotifierType,                    // specifies type of RasDial event handler
00145   LPVOID lpvNotifier,                      // specifies a handler for RasDial events
00146   LPHRASCONN lphRasConn                    // pointer to variable to receive connection handle
00147 )
00148 {
00149     DWORD rc = ERROR_SUCCESS;             // return code from RasDial
00150     RASDIALEXTENSIONS RasDialExtensions;  // used as a copy of the RasDialExtensions structure
00151
00152     OutputTraceString(L"RasCustomDial called in customdial.dll\n");
00153
00154     if (NULL == lpRasDialParams)
00155     {
00156         return ERROR_UNKNOWN;
00157     }
00158
00159     // set up the RasDialExtensions structure appropriately
00160     if (NULL == lpRasDialExtensions)
00161     {
00162         ZeroMemory(&RasDialExtensions, sizeof(RASDIALEXTENSIONS));
00163         RasDialExtensions.dwSize = sizeof(RASDIALEXTENSIONS);
00164     }
00165     else
00166     {
00167         CopyMemory(&RasDialExtensions, lpRasDialExtensions, sizeof(RASDIALEXTENSIONS));
00168     }
00169
00170
00171     RasDialExtensions.dwfOptions |= RDEOPT_CustomDial; // added cause we are calling RasDial
00172
00173     OutputTraceString(L"--- RasCustomDial RasDialParams: E: '%s' UN: '%s' D: '%s'\n",
00174         lpRasDialParams->szEntryName,
00175         lpRasDialParams->szUserName,
00176         lpRasDialParams->szDomain);
00177
00178     // Simply call RasDial with the modified RasDialExtensions structure
00179     // and the original parameters passed in.
00180     // We are passing  lpvNotifier & lphRasConn directly into RasDial. Since we don't use these variable
00181     // locally we skip checking for NULLs.
00182     rc = RasDial(&RasDialExtensions, lpszPhonebook, lpRasDialParams, dwNotifierType, lpvNotifier, lphRasConn);
00183
00184     OutputTraceString(L"--- RasCustomDial returning handle 0x%08x\n", *lphRasConn);
00185     OutputTraceString(L"RasCustomDial exiting customdial.dll with return code: %d\n", rc);
00186
00187     return rc;
00188 }
00189
00190 //
00191 // RasCustomHangUp
00192 //
00193 // This export is the custom dial entry when RasHangUp has been called by
00194 // an application - the call is forwarded to here and it is up to this
00195 // function then to close a connection. This implementation simply
00196 // forwards the request back to RasHangUp.
00197 //
00198 extern "C" DWORD WINAPI RasCustomHangUp (
00199   HRASCONN hRasConn    // handle to a RAS connection
00200 )
00201 {
00202     DWORD rc = SUCCESS;     // return code
00203
00204
00205     OutputTraceString(L"RasCustomHangUp called in customdial.dll\n");
00206     OutputTraceString(L"--- RasCustomHangUp on handle 0x%08x\n", hRasConn);
00207
00208     // simply call RasHangUp on the handle
00209     rc = RasHangUp(hRasConn);
00210
00211     OutputTraceString(L"RasCustomHangUp exiting customdial.dll with return code: %d\n", rc);
00212
00213     return rc;
00214 }
00215
00216 //
00217 // CustomEntryDlgProc
00218 //
00219 // This function is the dialog procedure for the custom entry dialog and handles
00220 // the basic events that happen within that dialog
00221 //
00222 INT_PTR CALLBACK CustomEntryDlgProc(
00223   HWND hwndDlg,  // handle to dialog box
00224   UINT uMsg,     // message
00225   WPARAM wParam, // first message parameter
00226   LPARAM lParam  // second message parameter
00227 )
00228 {
00229     HWND hEditBox = NULL;                           // handle to an edit box
00230     HWND hComboBox = NULL;                          // handle to the combo box
00231     LPRASENTRYDLG lpInfo = NULL;                    // pointer to the RASENTRYDLG structure
00232     static LPRASENTRY lpRasEntry = NULL;            // pointer to the RASENTRY structure
00233     static PSAMPLE_CUSTOM_ENTRY_DATA pData = NULL;  // pointer to the SAMPLE_CUSTOM_ENTRY_DATA structure
00234
00235     switch (uMsg)
00236     {
00237     case WM_INITDIALOG:
00238         {
00239             // set up the dialog and the parameters
00240             pData = (PSAMPLE_CUSTOM_ENTRY_DATA) lParam;
00241             if (!pData)
00242             {
00243                 return FALSE;
00244             }
00245
00246             lpInfo = &(pData->tEntryDlg);
00247             lpRasEntry = pData->ptEntry;
00248
00249             hComboBox = GetDlgItem(hwndDlg, IDC_LIST_MODEMS);
00250
00251             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_ENTRYNAME);
00252             if (hEditBox)
00253             {
00254                 Edit_LimitText(hEditBox, RAS_MaxEntryName); // Count doesn't include NULL
00255                 Edit_SetText(hEditBox, (LPTSTR)pData->szEntryName);
00256             }
00257
00258             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_PHONENO);
00259             if (hEditBox)
00260             {
00261                 Edit_LimitText(hEditBox, CELEMS(lpRasEntry->szLocalPhoneNumber) - 1); // Count doesn't include NULL
00262                 Edit_SetText(hEditBox, lpRasEntry->szLocalPhoneNumber);
00263             }
00264
00265             //
00266             // enumerate to get the device name to use - we'll just do modems
00267             //
00268
00269             // first get the size of the buffer required
00270             LPRASDEVINFO lpRasDevInfo = NULL;   // RASDEVINFO structure pointer
00271             DWORD dwNumEntries = 0;             // number of entries returned
00272             DWORD dwSize = sizeof(RASDEVINFO);  // size of buffer
00273             DWORD rc = 0;                       // return code
00274
00275
00276             // Allocate buffer with space for at least one structure
00277             lpRasDevInfo = (LPRASDEVINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00278             if (NULL == lpRasDevInfo)
00279             {
00280                 return FALSE;
00281             }
00282
00283             lpRasDevInfo->dwSize = sizeof(RASDEVINFO);
00284
00285             rc = RasEnumDevices(lpRasDevInfo, &dwSize, &dwNumEntries);
00286             if (ERROR_BUFFER_TOO_SMALL == rc)
00287             {
00288                 // If the buffer is too small, free the allocated memory and allocate a bigger buffer.
00289                 if (HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasDevInfo))
00290                 {
00291                     lpRasDevInfo = (LPRASDEVINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00292                     if (NULL == lpRasDevInfo)
00293                     {
00294                         OutputTraceString(L"--- Error allocating memory (HeapAlloc) for RASDEVINFO structures for RasEnumDevices(): %d\n", GetLastError());
00295                         return FALSE;
00296                     }
00297
00298                     lpRasDevInfo->dwSize = sizeof(RASDEVINFO);
00299
00300                     rc = RasEnumDevices(lpRasDevInfo, &dwSize, &dwNumEntries);
00301                 }
00302                 else
00303                 {
00304                     // Couldn't free the memory
00305                     return FALSE;
00306                 }
00307             }
00308
00309             // Check whether RasEnumDevices succeeded
00310             if (ERROR_SUCCESS == rc)
00311             {
00312                 lpRasDevInfo = (LPRASDEVINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00313                 if (NULL != lpRasDevInfo)
00314                 {
00315                     lpRasDevInfo->dwSize = sizeof(RASDEVINFO);
00316
00317                     rc = RasEnumDevices(lpRasDevInfo, &dwSize, &dwNumEntries);
00318                     if (ERROR_SUCCESS == rc)
00319                     {
00320                         for (UINT i = 0; i < dwNumEntries; i++, lpRasDevInfo++)
00321                         {
00322                             if (lstrcmpi(lpRasDevInfo->szDeviceType, RASDT_Modem) == 0)
00323                             {
00324                                 if (hComboBox)
00325                                 {
00326                                     // add to the list
00327                                     ComboBox_AddString(hComboBox, lpRasDevInfo->szDeviceName);
00328                                 }
00329                             }
00330                         }
00331                     }
00332
00333                     HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasDevInfo);
00334                     lpRasDevInfo = NULL;
00335                 }
00336                 else
00337                 {
00338                     OutputTraceString(L"--- Error allocating memory (HeapAlloc) for RASDEVINFO structures for RasEnumDevices(): %d\n", GetLastError());
00339                 }
00340             }
00341
00342
00343
00344             if (hComboBox)
00345             {
00346                 // select the item we have in the entry
00347                 ComboBox_SelectString(hComboBox, -1, lpRasEntry->szDeviceName);
00348             }
00349
00350             // move dialog and position according to structure paramters
00351             // NOTE: we don't take into account multiple monitors or extreme
00352             // cases here as this is only a quick sample
00353
00354             DWORD xPos = 0;         // x coordinate position for centering
00355             DWORD yPos = 0;         // y coordinate position for centering
00356
00357             if (lpInfo->dwFlags & RASDDFLAG_PositionDlg)
00358             {
00359                 xPos = lpInfo->xDlg;
00360                 yPos = lpInfo->yDlg;
00361             }
00362             else
00363             {
00364                 RECT rectTop;         // parent rectangle used for centering
00365                 RECT rectDlg;         // dialog rectangle used for centering
00366
00367                 // center window within the owner or desktop
00368                 GetWindowRect(lpInfo->hwndOwner != NULL ? lpInfo->hwndOwner : GetDesktopWindow(), &rectTop);
00369                 GetWindowRect(hwndDlg, &rectDlg);
00370
00371                 xPos = ((rectTop.left + rectTop.right) / 2) - ((rectDlg.right - rectDlg.left) / 2);
00372                 yPos = ((rectTop.top + rectTop.bottom) / 2) - ((rectDlg.bottom - rectDlg.top) / 2);
00373             }
00374
00375             SetWindowPos(hwndDlg, NULL, xPos, yPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
00376
00377             return TRUE;
00378         }
00379     case WM_COMMAND:
00380         switch (LOWORD(wParam))
00381         {
00382         case IDOK:
00383             {
00384             TCHAR szEntryName[RAS_MaxEntryName + 1] = {0};  // Entry name
00385             TCHAR szPhoneBook[MAX_PATH + 1] = {0};          // Phonebook path
00386             TCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1] = {0};
00387
00388             // copy back the phonenumber, entry name, & device name
00389             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_PHONENO);
00390             if (hEditBox)
00391             {
00392                 Edit_GetText(hEditBox, lpRasEntry->szLocalPhoneNumber, CELEMS(lpRasEntry->szLocalPhoneNumber));
00393             }
00394
00395             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_ENTRYNAME);
00396             if (hEditBox)
00397             {
00398                 Edit_GetText(hEditBox, szEntryName, CELEMS(szEntryName));
00399             }
00400
00401             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_PHONENO);
00402             if (hEditBox)
00403             {
00404                 Edit_GetText(hEditBox, szPhoneNumber, CELEMS(szPhoneNumber));
00405             }
00406
00407             hComboBox = GetDlgItem(hwndDlg, IDC_LIST_MODEMS);
00408             if (hComboBox)
00409             {
00410                 ComboBox_GetLBText(hComboBox, ComboBox_GetCurSel(hComboBox), lpRasEntry->szDeviceName);
00411             }
00412
00413             if (!pData) return FALSE;
00414
00415             // Check entry name for validity
00416             lstrcpyn(szPhoneBook,  (LPTSTR)pData->szPhoneBookPath, CELEMS(szPhoneBook));
00417             if (RasValidateEntryName(szPhoneBook, szEntryName) == ERROR_INVALID_NAME)
00418             {
00419                 MessageBox(hwndDlg, L"The Entry Name is Invalid.", L"Entry name error", MB_OK);
00420             }
00421             else
00422             {
00423                 lstrcpyn(pData->szEntryName, szEntryName, CELEMS(pData->szEntryName));
00424                 lstrcpyn(lpRasEntry->szLocalPhoneNumber, szPhoneNumber, CELEMS(lpRasEntry->szLocalPhoneNumber));
00425
00426                 EndDialog(hwndDlg, TRUE);
00427             }
00428
00429             return TRUE;
00430             }
00431         case IDCANCEL:
00432             EndDialog(hwndDlg, FALSE);
00433             return TRUE;
00434         }
00435         break;
00436     }
00437
00438     return FALSE;
00439 }
00440
00441
00442 //
00443 // RasCustomEntryDlg
00444 //
00445 // this export is the custom dial entry when RasEntryDlg has been called by
00446 // an application - the call is forwarded to here and it is up to this
00447 // function then to display, handle and update the phonebook entry that is
00448 // being modified through its own dialog or other means
00449 //
00450 extern "C" BOOL WINAPI  RasCustomEntryDlg (
00451   HINSTANCE hInstDll,       // handle to DLL instance
00452   LPTSTR lpszPhonebook,     // pointer to the full path and
00453                             //  file name of the phone-book file
00454   LPTSTR lpszEntry,         // pointer to the name of the
00455                             //  phone-book entry to edit,
00456                             //  copy, or create
00457   LPRASENTRYDLG lpInfo      // pointer to a structure that
00458                             //  contains additional parameters
00459 )
00460 {
00461     DWORD rc = 0;           // return code
00462     DWORD dwSize = 0;       // size of buffer
00463     //RASENTRY RasEntry;      // Ras Entry structure
00464     PSAMPLE_CUSTOM_ENTRY_DATA pEntryData = NULL;    // pointer to allocated strucutre for passing data
00465     LPRASENTRY pLocalRE = NULL;
00466     LPRASENTRY pMemberRE = NULL;
00467
00468     OutputTraceString(L"RasCustomEntryDlg called in customdial.dll\n");
00469
00470     // Check input parameters
00471     if (!lpszEntry || !lpInfo)
00472     {
00473         return FALSE;
00474     }
00475
00476     // create buffer of data to move back and forth between dialog
00477     dwSize = sizeof(SAMPLE_CUSTOM_ENTRY_DATA);
00478
00479     pEntryData = (PSAMPLE_CUSTOM_ENTRY_DATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00480     if (pEntryData)
00481     {
00482         CopyMemory(&(pEntryData->tEntryDlg), lpInfo, sizeof(RASENTRYDLG));
00483
00484         dwSize = sizeof(RASENTRY);
00485
00486         pLocalRE = (LPRASENTRY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00487         if (NULL == pLocalRE)
00488         {
00489             return FALSE;
00490         }
00491
00492         // get the other parameters for the entry (phone and Device Name)
00493
00494         pLocalRE->dwSize = dwSize;
00495
00496         rc = RasGetEntryProperties(lpszPhonebook, lpszEntry, pLocalRE, &dwSize, NULL, NULL);
00497         if (ERROR_BUFFER_TOO_SMALL == rc)
00498         {
00499             if (HeapFree(GetProcessHeap(), 0, (LPVOID)pLocalRE))
00500             {
00501                 pLocalRE = (LPRASENTRY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00502
00503                 if (NULL == pLocalRE)
00504                 {
00505                     return FALSE;
00506                 }
00507             }
00508             else
00509             {
00510                 return FALSE;
00511             }
00512
00513             // get the other parameters for the entry (phone and Device Name)
00514
00515             pLocalRE->dwSize = dwSize;
00516             rc = RasGetEntryProperties(lpszPhonebook, lpszEntry, pLocalRE, &dwSize, NULL, NULL);
00517         }
00518
00519
00520         pMemberRE = (LPRASENTRY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00521         if (NULL == pMemberRE)
00522         {
00523             HeapFree(GetProcessHeap(), 0, (LPVOID)pMemberRE);
00524             return FALSE;
00525         }
00526
00527         // Set size and save pointer into structure
00528         pMemberRE->dwSize = dwSize;
00529         pEntryData->ptEntry = pMemberRE;
00530         pMemberRE = NULL;
00531
00532         if (ERROR_SUCCESS == rc)
00533         {
00534             CopyMemory(pEntryData->ptEntry, pLocalRE , pEntryData->ptEntry->dwSize);
00535         }
00536         else
00537         {
00538             MessageBox(NULL, L"Copy Memory failed", L"Error", MB_OK);
00539         }
00540
00541         lstrcpyn(pEntryData->szEntryName, lpszEntry, CELEMS(pEntryData->szEntryName));
00542         lstrcpyn(pEntryData->szPhoneBookPath, lpszPhonebook, CELEMS(pEntryData->szPhoneBookPath));
00543
00544         OutputTraceString(L"--- Call Custom Entry Dialog\n");
00545
00546         rc = DialogBoxParam(hInstDll, MAKEINTRESOURCE(IDD_CUSTOMENTRYDLG), lpInfo->hwndOwner, CustomEntryDlgProc, (LPARAM) pEntryData);
00547
00548         OutputTraceString(L"--- Return from Custom Entry Dialog: %d\n", rc);
00549
00550         if (rc > 0)   // dialog succeeded
00551         {
00552             // copy entry name into lpInfo structure for return
00553             lstrcpyn(lpInfo->szEntry, (LPTSTR) pEntryData->szEntryName, CELEMS(lpInfo->szEntry));
00554
00555             // check to see if anything has changed and change the entry
00556             LPRASENTRY lpRasEntry = pEntryData->ptEntry;
00557
00558             if ((lstrcmpi(pLocalRE->szLocalPhoneNumber, lpRasEntry->szLocalPhoneNumber) != 0) ||
00559                 (lstrcmpi(pLocalRE->szDeviceName, lpRasEntry->szDeviceName) != 0) ||
00560                 (lstrcmpi(lpInfo->szEntry, lpszEntry) != 0))
00561             {
00562                 OutputTraceString(L"--- Calling RasSetEntryProperties to make changes\n");
00563                 if (rc = RasSetEntryProperties(lpszPhonebook, lpInfo->szEntry, lpRasEntry, lpRasEntry->dwSize, NULL, 0) != SUCCESS)
00564                 {
00565                     OutputTraceString(L"--- RasSetEntryProperties() failed: %d\n", rc);
00566                     lpInfo->dwError = rc;
00567                     rc = FALSE;
00568                 }
00569                 else
00570                 {
00571                     OutputTraceString(L"--- RasSetEntryProperties() succeeded.\n", rc);
00572                     rc = TRUE;
00573                 }
00574             }
00575             else
00576             {
00577                 rc = TRUE;
00578             }
00579         }
00580         else
00581         {
00582             lpInfo->dwError = GetLastError();
00583             OutputTraceString(L"DialogBox Failed (or cancelled) in RasCustomEntryDlg (GetLastError = %d)\n", lpInfo->dwError);
00584             rc = FALSE;
00585         }
00586
00587         if (pLocalRE)
00588         {
00589             HeapFree(GetProcessHeap(), 0, (LPVOID)pLocalRE);
00590             pLocalRE = NULL;
00591         }
00592
00593         if (pEntryData->ptEntry)
00594         {
00595             HeapFree(GetProcessHeap(), 0, (LPVOID)pEntryData->ptEntry);
00596             pEntryData->ptEntry = NULL;
00597         }
00598
00599         HeapFree(GetProcessHeap(), 0, (LPVOID)pEntryData);
00600         pEntryData = NULL;
00601
00602     }
00603     else
00604     {
00605         OutputTraceString(L"--- Memory allocation failed (HeapAlloc) in RasCustomEntryDlg (GetLastError = %d)\n", GetLastError());
00606     }
00607
00608     OutputTraceString(L"RasCustomEntryDlg exiting customdial.dll with return code: %d\n", rc);
00609
00610     return rc;
00611 }
00612
00613 //
00614 // CustomDialDlgProc
00615 //
00616 // this function is the dialog procedure for the custom dial dialog and handles
00617 // the basic events that happen within that dialog
00618 //
00619 INT_PTR CALLBACK CustomDialDlgProc(
00620   HWND hwndDlg,  // handle to dialog box
00621   UINT uMsg,     // message
00622   WPARAM wParam, // first message parameter
00623   LPARAM lParam  // second message parameter
00624 )
00625 {
00626     LPRASDIALDLG lpInfo = NULL;                     // pointer to RASDIALDLG structure
00627     static LPRASDIALPARAMS lpRasDialParams = NULL;  // pointer to RASDIALPARAMS structure
00628     static PSAMPLE_CUSTOM_DIAL_DLG pDialData = NULL;// pointer to SAMPLE_CUSTOM_DIAL_DLG structure
00629     HWND hEditBox = NULL;                           // handle to an edit box
00630
00631
00632     switch (uMsg)
00633     {
00634     case WM_INITDIALOG:
00635         {
00636             pDialData = (PSAMPLE_CUSTOM_DIAL_DLG)lParam;
00637             if (!pDialData) return FALSE;
00638
00639             lpInfo = &(pDialData->tDialDlg);
00640             lpRasDialParams = &(pDialData->tDialParams);
00641
00642             // set known items
00643             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_USERNAME);
00644             if (hEditBox)
00645             {
00646                 Edit_LimitText(hEditBox, CELEMS(lpRasDialParams->szUserName) - 1); // Count doesn't include NULL
00647                 Edit_SetText(hEditBox, lpRasDialParams->szUserName);
00648             }
00649
00650             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_DOMAIN);
00651             if (hEditBox)
00652             {
00653                 Edit_LimitText(hEditBox, CELEMS(lpRasDialParams->szDomain) - 1); // Count doesn't include NULL
00654                 Edit_SetText(hEditBox, lpRasDialParams->szDomain);
00655             }
00656
00657             // Move dialog and position according to structure
00658             // we don't take into account multiple monitors or extreme
00659             // cases here as this is only a quick sample
00660
00661             DWORD xPos = 0;         // x coordinate position for centering
00662             DWORD yPos = 0;         // y coordinate position for centering
00663
00664             if (lpInfo->dwFlags & RASDDFLAG_PositionDlg)
00665             {
00666                 xPos = lpInfo->xDlg;
00667                 yPos = lpInfo->yDlg;
00668             }
00669             else
00670             {
00671                 RECT rectTop;         // parent rectangle used for centering
00672                 RECT rectDlg;         // dialog rectangle used for centering
00673
00674                 // center window within the owner or desktop
00675                 GetWindowRect(lpInfo->hwndOwner != NULL ? lpInfo->hwndOwner : GetDesktopWindow(), &rectTop);
00676                 GetWindowRect(hwndDlg, &rectDlg);
00677
00678                 xPos = ((rectTop.left + rectTop.right) / 2) - ((rectDlg.right - rectDlg.left) / 2);
00679                 yPos = ((rectTop.top + rectTop.bottom) / 2) - ((rectDlg.bottom - rectDlg.top) / 2);
00680             }
00681
00682             SetWindowPos(hwndDlg, NULL, xPos, yPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
00683
00684             return TRUE;
00685         }
00686     case WM_COMMAND:
00687       switch (LOWORD(wParam))
00688         {
00689         case IDOK:
00690             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_USERNAME);
00691             if (hEditBox)
00692             {
00693                 Edit_GetText(hEditBox, lpRasDialParams->szUserName, CELEMS(lpRasDialParams->szUserName));
00694             }
00695
00696             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_PASSWORD);
00697             if (hEditBox)
00698             {
00699                 Edit_GetText(hEditBox, lpRasDialParams->szPassword, CELEMS(lpRasDialParams->szPassword));
00700             }
00701
00702             hEditBox = GetDlgItem(hwndDlg, IDC_EDIT_DOMAIN);
00703             if (hEditBox)
00704             {
00705                 Edit_GetText(hEditBox, lpRasDialParams->szDomain, CELEMS(lpRasDialParams->szDomain));
00706             }
00707
00708             EndDialog(hwndDlg, TRUE);
00709             return TRUE;
00710
00711         case IDCANCEL:
00712             EndDialog(hwndDlg, FALSE);
00713             return TRUE;
00714         }
00715       break;
00716     }
00717
00718     return FALSE;
00719 }
00720
00721 //
00722 // RasCustomDialDlg
00723 //
00724 // This export is the custom dial entry when RasDialDlg has been called by
00725 // an application - the call is forwarded to here and it is up to this
00726 // function then to display, handle and dial the phonebook entry that is
00727 // specified
00728 //
00729 extern "C" BOOL WINAPI  RasCustomDialDlg (
00730   HINSTANCE hInstDll,      // handle to DLL instance
00731   DWORD dwFlags,           // reserved
00732   LPTSTR lpszPhonebook,    // pointer to the full path and
00733                            //  file name of the phone-book file
00734   LPTSTR lpszEntry,        // pointer to the name of the
00735                            //  phone-book entry to dial
00736   LPTSTR lpszPhoneNumber,  // pointer to replacement phone
00737                            //  number to dial
00738   LPRASDIALDLG lpInfo,     // pointer to a structure that
00739                            //  contains additional parameters
00740   PVOID pvInfo
00741 )
00742 {
00743     DWORD rc = 0;               // return code
00744     HRASCONN hRasConn = NULL;
00745     DWORD dwSize = 0;
00746     PSAMPLE_CUSTOM_DIAL_DLG pDialData = NULL;
00747     RASDIALPARAMS RasDialParams;
00748
00749     OutputTraceString(L"RasCustomDialDlg called in customdial.dll\n");
00750
00751     if (!lpInfo)
00752     {
00753         return FALSE;
00754     }
00755
00756     // set up the RasDialParams structure with information passed in
00757     ZeroMemory(&RasDialParams, sizeof(RASDIALPARAMS));
00758     RasDialParams.dwSize = sizeof(RASDIALPARAMS);
00759     lstrcpyn(RasDialParams.szEntryName, lpszEntry, CELEMS(RasDialParams.szEntryName));
00760
00761     if (lpszPhoneNumber != NULL)
00762     {
00763         lstrcpyn(RasDialParams.szPhoneNumber, lpszPhoneNumber, CELEMS(RasDialParams.szPhoneNumber));
00764     }
00765
00766     // pull information from the Entry for the dialog
00767     if (lpszEntry != NULL)
00768     {
00769         BOOL bPassword;
00770
00771         if (rc = RasGetEntryDialParams(lpszPhonebook, &RasDialParams, &bPassword) != SUCCESS)
00772         {
00773             OutputTraceString(L"--- Error retrieving Entry Dial Parameters: %d\n", rc);
00774         }
00775         else
00776         {
00777             OutputTraceString(L"--- RasGetEntryDialParams: UN: '%s' D: '%s'\n",
00778                               RasDialParams.szUserName,
00779                               RasDialParams.szDomain);
00780         }
00781     }
00782
00783     // display dialog - passing in structure of data that the dialog needs
00784     // so we can get the username, password and domain information
00785
00786     // first build the buffer of data to pass
00787     dwSize = sizeof(SAMPLE_CUSTOM_DIAL_DLG);
00788     pDialData = (PSAMPLE_CUSTOM_DIAL_DLG) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00789     if (pDialData != NULL)
00790     {
00791         CopyMemory(&(pDialData->tDialParams), &RasDialParams, sizeof(pDialData->tDialParams));
00792         CopyMemory(&(pDialData->tDialDlg), lpInfo, sizeof(pDialData->tDialDlg));
00793
00794         rc = DialogBoxParam(hInstDll, MAKEINTRESOURCE(IDD_CUSTOMDIALDLG), lpInfo->hwndOwner, CustomDialDlgProc, (LPARAM) pDialData);
00795         if (rc > 0)   // dialog succeeded
00796         {
00797             // copy the results back of dialog entry back into stack variable
00798             CopyMemory(&RasDialParams, &(pDialData->tDialParams), sizeof(RASDIALPARAMS));
00799
00800             // call the RasCustomDial since we just need it to do the same thing anyway but
00801             // one would probably call their own custom dialer here or forward to RasDial using
00802             // another window for connection status.
00803             rc = RasCustomDial(hInstDll, NULL, lpszPhonebook, &RasDialParams, 0, 0, &hRasConn);
00804
00805             if (rc != 0)
00806             {
00807                 // hang-up on error
00808                 RasCustomHangUp(hRasConn);
00809                 lpInfo->dwError = rc;
00810                 rc = 0;     // return 0 on failure and set error info
00811             }
00812             else
00813             {
00814                 // set the Entry Dial Params since we succeeded the dial
00815                 if (rc = RasSetEntryDialParams(lpszPhonebook, &RasDialParams, TRUE) != SUCCESS)
00816                 {
00817                     OutputTraceString(L"--- Error setting Entry Dial Parameters: %d\n", rc);
00818                 }
00819
00820                 rc = 1;     // return >0 on success for the entire call
00821             }
00822         }
00823         else
00824         {
00825             lpInfo->dwError = GetLastError();
00826             OutputTraceString(L"--- DialogBox Failed (or cancelled) in RasCustomDialDlg (GetLastError = %d)\n", lpInfo->dwError);
00827             rc = 0;
00828         }
00829
00830         // Clear out password from memory
00831         ZeroMemory(&(pDialData->tDialParams.szPassword), sizeof(pDialData->tDialParams.szPassword));
00832
00833         HeapFree(GetProcessHeap(), 0, (LPVOID)pDialData);
00834         pDialData = NULL;
00835     }
00836     else
00837     {
00838         OutputTraceString(L"--- Memory allocation failed (HeapAlloc) in RasCustomDialDlg (GetLastError = %d)\n", GetLastError());
00839         rc = ERROR_OUTOFMEMORY;
00840     }
00841
00842     // Clear out structures in order to clear up the password from memory
00843     ZeroMemory(&RasDialParams, sizeof(RASDIALPARAMS));
00844
00845     OutputTraceString(L"RasCustomDialDlg exiting customdial.dll with return code: %d\n", rc);
00846
00847     return rc;
00848 }
00849
00850 //
00851 // RasCustomDeleteEntryNotify
00852 //
00853 // this export is the custom dial entry when RasDeleteEntry has been called by
00854 // an application - the call is forwarded to here and it is up to this
00855 // function then to handle the phonebook entry that is specified
00856 //
00857 extern "C" DWORD WINAPI RasCustomDeleteEntryNotify(
00858   LPCTSTR lpszPhonebook,
00859   LPCTSTR lpszEntry,
00860   DWORD dwFlags
00861 )
00862 {
00863     DWORD rc = NO_ERROR;     // return code
00864
00865     OutputTraceString(L"RasCustomDeleteEntryNotify called in customdial.dll\n");
00866
00867     // just forward the request on - one could do more custom delete stuff here
00868     rc = RasDeleteEntry(lpszPhonebook, lpszEntry);
00869
00870     OutputTraceString(L"RasCustomDeleteEntryNotify exiting customdial.dll with return code: %d\n");
00871
00872     return rc;
00873 }
00874
00875
00876
00877 // EOF: customdial.cpp
00878
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/comp.Cpp Source File

  • SysMgmt
  • MMC
  • Nodes

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 CComponent::CComponent(CComponentData *parent)
00029 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL), m_pLastNode(NULL)
00030 {
00031     OBJECT_CREATED
00032 }
00033
00034 CComponent::~CComponent()
00035 {
00036     OBJECT_DESTROYED
00037 }
00038
00039 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00040 {
00041     if (!ppv)
00042         return E_FAIL;
00043
00044     *ppv = NULL;
00045
00046     if (IsEqualIID(riid, IID_IUnknown))
00047         *ppv = static_cast<IComponent *>(this);
00048     else if (IsEqualIID(riid, IID_IComponent))
00049         *ppv = static_cast<IComponent *>(this);
00050     else if (IsEqualIID(riid, IID_IResultOwnerData))
00051         *ppv = static_cast<IResultOwnerData *>(this);
00052
00053     if (*ppv)
00054     {
00055         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00056         return S_OK;
00057     }
00058
00059     return E_NOINTERFACE;
00060 }
00061
00062 STDMETHODIMP_(ULONG) CComponent::AddRef()
00063 {
00064     return InterlockedIncrement((LONG *)&m_cref);
00065 }
00066
00067 STDMETHODIMP_(ULONG) CComponent::Release()
00068 {
00069     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00070     {
00071         delete this;
00072         return 0;
00073     }
00074     return m_cref;
00075
00076 }
00077
00078 ///////////////////////////////
00079 // Interface IComponent
00080 ///////////////////////////////
00081 STDMETHODIMP CComponent::Initialize(
00082                                     /* [in] */ LPCONSOLE lpConsole)
00083 {
00084     HRESULT hr = S_OK;
00085
00086     // Save away all the interfaces we'll need.
00087     // Fail if we can't QI the required interfaces.
00088
00089     m_ipConsole = lpConsole;
00090     m_ipConsole->AddRef();
00091
00092     return hr;
00093 }
00094
00095 STDMETHODIMP CComponent::Notify(
00096                                 /* [in] */ LPDATAOBJECT lpDataObject,
00097                                 /* [in] */ MMC_NOTIFY_TYPE event,
00098                                 /* [in] */ LPARAM arg,
00099                                 /* [in] */ LPARAM param)
00100 {
00101     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00102
00103     HRESULT hr = S_FALSE;
00104
00105   //Get our data object. If it is NULL, we return with S_FALSE.
00106   //See implementation of GetOurDataObject() to see how to
00107   //handle special data objects.
00108   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00109   if (NULL == pDataObject)
00110     return S_FALSE;
00111
00112   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00113
00114     switch (event)  {
00115     case MMCN_SHOW:
00116         hr = base->OnShow(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00117         break;
00118
00119     case MMCN_ADD_IMAGES:
00120         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00121         break;
00122
00123     case MMCN_SELECT:
00124         hr = base->OnSelect(m_ipConsole, (BOOL)LOWORD(arg), (BOOL)HIWORD(arg));
00125         break;
00126
00127     case MMCN_RENAME:
00128         hr = base->OnRename((LPOLESTR)param);
00129         break;
00130
00131     case MMCN_REFRESH:
00132         hr = base->OnRefresh();
00133         break;
00134     }
00135
00136     return hr;
00137 }
00138
00139 STDMETHODIMP CComponent::Destroy(
00140                                  /* [in] */ MMC_COOKIE cookie)
00141 {
00142     if (m_ipConsole) {
00143         m_ipConsole->Release();
00144         m_ipConsole = NULL;
00145     }
00146
00147     return S_OK;
00148 }
00149
00150
00151 STDMETHODIMP CComponent::QueryDataObject(
00152                                          /* [in] */ MMC_COOKIE cookie,
00153                                          /* [in] */ DATA_OBJECT_TYPES type,
00154                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00155 {
00156     CDataObject *pObj = NULL;
00157   CDelegationBase *pBase = NULL;
00158
00159   if (IsBadReadPtr((void *)cookie, sizeof(CDelegationBase))) {
00160     if (NULL == m_pLastNode)
00161       return E_FAIL;
00162
00163     pBase = m_pLastNode->GetChildPtr((int)cookie);
00164   } else {
00165     pBase = (cookie == 0) ? m_pComponentData->m_pStaticNode : (CDelegationBase *)cookie;
00166   }
00167
00168   if (pBase == NULL)
00169     return E_FAIL;
00170
00171     pObj = new CDataObject((MMC_COOKIE)pBase, type);
00172
00173     if (!pObj)
00174         return E_OUTOFMEMORY;
00175
00176     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00177
00178     return S_OK;
00179 }
00180
00181 STDMETHODIMP CComponent::GetResultViewType(
00182                                            /* [in] */ MMC_COOKIE cookie,
00183                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00184                                            /* [out] */ long __RPC_FAR *pViewOptions)
00185 {
00186     CDelegationBase *base = m_pLastNode = (CDelegationBase *)cookie;
00187
00188     //
00189     // Ask for default listview.
00190     //
00191     if (base == NULL)
00192     {
00193         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00194         *ppViewType = NULL;
00195     }
00196     else
00197         return base->GetResultViewType(ppViewType, pViewOptions);
00198
00199     return S_OK;
00200 }
00201
00202 STDMETHODIMP CComponent::GetDisplayInfo(
00203                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00204 {
00205     HRESULT hr = S_OK;
00206     CDelegationBase *base = NULL;
00207
00208     // if they are asking for the RDI_STR we have one of those to give
00209
00210     if (pResultDataItem->lParam) {
00211         base = (CDelegationBase *)pResultDataItem->lParam;
00212         if (pResultDataItem->mask & RDI_STR) {
00213       LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00214       MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00215             pResultDataItem->str = pszW;
00216         }
00217
00218         if (pResultDataItem->mask & RDI_IMAGE) {
00219             pResultDataItem->nImage = base->GetBitmapIndex();
00220         }
00221     } else {
00222         m_pLastNode->GetChildColumnInfo(pResultDataItem);
00223     }
00224
00225     return hr;
00226 }
00227
00228
00229 STDMETHODIMP CComponent::CompareObjects(
00230                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00231                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00232 {
00233     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00234     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00235
00236     // compare the object pointers
00237     if (baseA->GetCookie() == baseB->GetCookie())
00238         return S_OK;
00239
00240     return S_FALSE;
00241 }
00242
00243 ///////////////////////////////
00244 // Interface IComponent
00245 ///////////////////////////////
00246 STDMETHODIMP CComponent::FindItem(
00247 /* [in] */ LPRESULTFINDINFO pFindInfo,
00248 /* [out] */ int __RPC_FAR *pnFoundIndex)
00249 {
00250     return E_NOTIMPL;
00251 }
00252
00253 STDMETHODIMP CComponent::CacheHint(
00254 /* [in] */ int nStartIndex,
00255 /* [in] */ int nEndIndex)
00256 {
00257     return E_NOTIMPL;
00258 }
00259
00260 STDMETHODIMP CComponent::SortItems(
00261 /* [in] */ int nColumn,
00262 /* [in] */ DWORD dwSortOptions,
00263 /* [in] */ LPARAM lUserParam)
00264 {
00265     return E_NOTIMPL;
00266 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/PidlMgr.Cpp Source File

  • WinUI
  • Shell
  • SampView

PidlMgr.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          PidlMgr.cpp
00013
00014    Description:   Implements CPidlMgr.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "PidlMgr.h"
00023 #include "ShlFldr.h"
00024 #include "Guid.h"
00025 #include "resource.h"
00026
00027 /**************************************************************************
00028
00029    CPidlMgr::CPidlMgr
00030
00031 **************************************************************************/
00032
00033 CPidlMgr::CPidlMgr()
00034 {
00035 g_DllRefCount++;
00036
00037 //get the shell's IMalloc pointer
00038 //we'll keep this until we get destroyed
00039 if(FAILED(SHGetMalloc(&m_pMalloc)))
00040    {
00041    delete this;
00042    }
00043 }
00044
00045 /**************************************************************************
00046
00047    CPidlMgr::~CPidlMgr
00048
00049 **************************************************************************/
00050
00051 CPidlMgr::~CPidlMgr()
00052 {
00053 if(m_pMalloc)
00054    m_pMalloc->Release();
00055
00056 g_DllRefCount--;
00057 }
00058
00059 /**************************************************************************
00060
00061    CPidlMgr::Create()
00062
00063    Creates a new PIDL
00064
00065 **************************************************************************/
00066
00067 LPITEMIDLIST CPidlMgr::Create(VOID)
00068 {
00069 LPITEMIDLIST   pidlOut;
00070 USHORT         uSize;
00071
00072 pidlOut = NULL;
00073
00074 /*
00075 Calculate the size. This consists of the ITEMIDLIST plus the size of our
00076 private PIDL structure.
00077 */
00078 uSize = sizeof(ITEMIDLIST) + sizeof(PIDLDATA);
00079
00080 /*
00081 Allocate the memory, adding an additional ITEMIDLIST for the NULL terminating
00082 ID List.
00083 */
00084 pidlOut = (LPITEMIDLIST)m_pMalloc->Alloc(uSize + sizeof(ITEMIDLIST));
00085
00086 if(pidlOut)
00087    {
00088    LPITEMIDLIST   pidlTemp = pidlOut;
00089
00090    //set the size of this item
00091    pidlTemp->mkid.cb = uSize;
00092
00093    //set the NULL terminator to 0
00094    pidlTemp = GetNextItem(pidlTemp);
00095    pidlTemp->mkid.cb = 0;
00096    pidlTemp->mkid.abID[0] = 0;
00097    }
00098
00099 return pidlOut;
00100 }
00101
00102 /**************************************************************************
00103
00104    CPidlMgr::Delete()
00105
00106    Deletes a PIDL
00107
00108 **************************************************************************/
00109
00110 VOID CPidlMgr::Delete(LPITEMIDLIST pidl)
00111 {
00112 m_pMalloc->Free(pidl);
00113 }
00114
00115 /**************************************************************************
00116
00117    CPidlMgr::GetNextItem()
00118
00119 **************************************************************************/
00120
00121 LPITEMIDLIST CPidlMgr::GetNextItem(LPCITEMIDLIST pidl)
00122 {
00123 if(pidl)
00124    {
00125    return (LPITEMIDLIST)(LPBYTE)(((LPBYTE)pidl) + pidl->mkid.cb);
00126    }
00127 else
00128    return NULL;
00129 }
00130
00131 /**************************************************************************
00132
00133    CPidlMgr::GetSize()
00134
00135 **************************************************************************/
00136
00137 UINT CPidlMgr::GetSize(LPCITEMIDLIST pidl)
00138 {
00139 UINT cbTotal = 0;
00140 LPITEMIDLIST pidlTemp = (LPITEMIDLIST)pidl;
00141
00142 if(pidlTemp)
00143    {
00144    while(pidlTemp->mkid.cb)
00145       {
00146       cbTotal += pidlTemp->mkid.cb;
00147       pidlTemp = GetNextItem(pidlTemp);
00148       }
00149
00150    //add the size of the NULL terminating ITEMIDLIST
00151    cbTotal += sizeof(ITEMIDLIST);
00152    }
00153
00154 return cbTotal;
00155 }
00156
00157 /**************************************************************************
00158
00159    CPidlMgr::GetLastItem()
00160
00161    Gets the last item in the list
00162
00163 **************************************************************************/
00164
00165 LPITEMIDLIST CPidlMgr::GetLastItem(LPCITEMIDLIST pidl)
00166 {
00167 LPITEMIDLIST   pidlLast = NULL;
00168
00169 //get the PIDL of the last item in the list
00170 while(pidl && pidl->mkid.cb)
00171    {
00172    pidlLast = (LPITEMIDLIST)pidl;
00173    pidl = GetNextItem(pidl);
00174    }
00175
00176 return pidlLast;
00177 }
00178
00179 /**************************************************************************
00180
00181    CPidlMgr::Copy()
00182
00183 **************************************************************************/
00184
00185 LPITEMIDLIST CPidlMgr::Copy(LPCITEMIDLIST pidlSource)
00186 {
00187 LPITEMIDLIST pidlTarget = NULL;
00188 UINT cbSource = 0;
00189
00190 if(NULL == pidlSource)
00191    return NULL;
00192
00193 // Allocate the new pidl
00194 cbSource = GetSize(pidlSource);
00195 pidlTarget = (LPITEMIDLIST)m_pMalloc->Alloc(cbSource);
00196 if(!pidlTarget)
00197    return NULL;
00198
00199 // Copy the source to the target
00200 CopyMemory(pidlTarget, pidlSource, cbSource);
00201
00202 return pidlTarget;
00203 }
00204
00205 /**************************************************************************
00206
00207    CPidlMgr::CopySingleItem()
00208
00209 **************************************************************************/
00210
00211 LPITEMIDLIST CPidlMgr::CopySingleItem(LPCITEMIDLIST pidlSource)
00212 {
00213 LPITEMIDLIST pidlTarget = NULL;
00214 UINT cbSource = 0;
00215
00216 if(NULL == pidlSource)
00217    return NULL;
00218
00219 // Allocate the new pidl
00220 cbSource = pidlSource->mkid.cb;
00221 pidlTarget = (LPITEMIDLIST)m_pMalloc->Alloc(cbSource + sizeof(ITEMIDLIST));
00222 if(!pidlTarget)
00223    return NULL;
00224
00225 // Copy the source to the target
00226 ZeroMemory(pidlTarget, cbSource + sizeof(ITEMIDLIST));
00227 CopyMemory(pidlTarget, pidlSource, cbSource);
00228
00229 return pidlTarget;
00230 }
00231
00232 /**************************************************************************
00233
00234    CPidlMgr::GetDataPointer()
00235
00236 **************************************************************************/
00237
00238 inline LPPIDLDATA CPidlMgr::GetDataPointer(LPCITEMIDLIST pidl)
00239 {
00240 if(!pidl)
00241    return NULL;
00242
00243 return (LPPIDLDATA)(pidl->mkid.abID);
00244 }
00245
00246 /**************************************************************************
00247
00248    CPidlMgr::Concatenate()
00249
00250    Create a new PIDL by combining two existing PIDLs.
00251
00252 **************************************************************************/
00253
00254 LPITEMIDLIST CPidlMgr::Concatenate(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
00255 {
00256 LPITEMIDLIST   pidlNew;
00257 UINT           cb1 = 0,
00258                cb2 = 0;
00259
00260 //are both of these NULL?
00261 if(!pidl1 && !pidl2)
00262    return NULL;
00263
00264 //if pidl1 is NULL, just return a copy of pidl2
00265 if(!pidl1)
00266    {
00267    pidlNew = Copy(pidl2);
00268
00269    return pidlNew;
00270    }
00271
00272 //if pidl2 is NULL, just return a copy of pidl1
00273 if(!pidl2)
00274    {
00275    pidlNew = Copy(pidl1);
00276
00277    return pidlNew;
00278    }
00279
00280 cb1 = GetSize(pidl1) - sizeof(ITEMIDLIST);
00281
00282 cb2 = GetSize(pidl2);
00283
00284 //create the new PIDL
00285 pidlNew = (LPITEMIDLIST)m_pMalloc->Alloc(cb1 + cb2);
00286
00287 if(pidlNew)
00288    {
00289    //copy the first PIDL
00290    CopyMemory(pidlNew, pidl1, cb1);
00291
00292    //copy the second PIDL
00293    CopyMemory(((LPBYTE)pidlNew) + cb1, pidl2, cb2);
00294    }
00295
00296 return pidlNew;
00297 }
00298
00299 /**************************************************************************
00300
00301    CPidlMgr::CreateFolderPidl()
00302
00303    Create a new folder PIDL.
00304
00305 **************************************************************************/
00306
00307 LPITEMIDLIST CPidlMgr::CreateFolderPidl(LPCTSTR pszName)
00308 {
00309 LPITEMIDLIST   pidl = Create();
00310 LPPIDLDATA     pData = GetDataPointer(pidl);
00311
00312 if(pData)
00313    {
00314    pData->fFolder = TRUE;
00315
00316    LocalToWideChar(pData->wszName, pszName, MAX_NAME);
00317
00318    pData->wszData[0] = 0;
00319    }
00320
00321 return pidl;
00322 }
00323
00324 /**************************************************************************
00325
00326    CPidlMgr::CreateItemPidl()
00327
00328    Create a new item PIDL.
00329
00330 **************************************************************************/
00331
00332 LPITEMIDLIST CPidlMgr::CreateItemPidl( LPCTSTR pszName,
00333                                        LPCTSTR pszData)
00334 {
00335 LPITEMIDLIST   pidl = Create();
00336 LPPIDLDATA     pData = GetDataPointer(pidl);
00337
00338 if(pData)
00339    {
00340    pData->fFolder = FALSE;
00341
00342    LocalToWideChar(pData->wszName, pszName, MAX_NAME);
00343
00344    LocalToWideChar(pData->wszData, pszData, MAX_DATA);
00345    }
00346
00347 return pidl;
00348 }
00349
00350 /**************************************************************************
00351
00352    CPidlMgr::GetName()
00353
00354    Gets the name for this item
00355
00356 **************************************************************************/
00357
00358 int CPidlMgr::GetName(LPCITEMIDLIST pidl, LPTSTR pszText, DWORD dwSize)
00359 {
00360 if(!IsBadWritePtr(pszText, dwSize))
00361    {
00362    *pszText = 0;
00363
00364    LPPIDLDATA  pData = GetDataPointer(pidl);
00365
00366    if(pData)
00367       {
00368       WideCharToLocal(pszText, pData->wszName, dwSize);
00369       return lstrlen(pszText);
00370       }
00371    }
00372
00373 return 0;
00374 }
00375
00376 /**************************************************************************
00377
00378    CPidlMgr::GetRelativeName()
00379
00380    Gets the full name for this item
00381
00382 **************************************************************************/
00383
00384 int CPidlMgr::GetRelativeName(LPCITEMIDLIST pidl, LPTSTR pszText, DWORD dwSize)
00385 {
00386 if(!IsBadWritePtr(pszText, dwSize))
00387    {
00388    LPITEMIDLIST   pidlTemp;
00389    *pszText = 0;
00390
00391    //walk the list, getting the name for each item
00392    pidlTemp = (LPITEMIDLIST)pidl;
00393    while(pidlTemp && pidlTemp->mkid.cb)
00394       {
00395       LPTSTR   pszCurrent = pszText + lstrlen(pszText);
00396       dwSize -= GetName(pidlTemp, pszCurrent, dwSize);
00397       pidlTemp = GetNextItem(pidlTemp);
00398
00399       //don't add a backslash to the last item
00400       if(pidlTemp && pidlTemp->mkid.cb)
00401          {
00402          SmartAppendBackslash(pszCurrent, dwSize - (pszCurrent - pszText));
00403          }
00404       }
00405    return lstrlen(pszText);
00406    }
00407
00408 return 0;
00409 }
00410
00411 /**************************************************************************
00412
00413    CPidlMgr::GetData()
00414
00415    Gets the data for this item
00416
00417 **************************************************************************/
00418
00419 int CPidlMgr::GetData(LPCITEMIDLIST pidl, LPTSTR pszText, DWORD dwSize)
00420 {
00421 if(!IsBadWritePtr(pszText, dwSize))
00422    {
00423    *pszText = 0;
00424
00425    LPPIDLDATA  pData = GetDataPointer(pidl);
00426
00427    if(pData)
00428       {
00429       WideCharToLocal(pszText, pData->wszData, dwSize);
00430       return lstrlen(pszText);
00431       }
00432    }
00433
00434 return 0;
00435 }
00436
00437 /**************************************************************************
00438
00439    CPidlMgr::IsFolder()
00440
00441    Determines if the item is a folder
00442
00443 **************************************************************************/
00444
00445 BOOL CPidlMgr::IsFolder(LPCITEMIDLIST pidl)
00446 {
00447 LPPIDLDATA  pData = GetDataPointer(pidl);
00448
00449 if(pData)
00450    {
00451    return pData->fFolder;
00452    }
00453
00454 return FALSE;
00455 }
00456
00457 /**************************************************************************
00458
00459    CPidlMgr::SetData()
00460
00461 **************************************************************************/
00462
00463 int CPidlMgr::SetData(LPCITEMIDLIST pidl, LPCTSTR pszData)
00464 {
00465 LPPIDLDATA  pData = GetDataPointer(pidl);
00466
00467 if(pData)
00468    {
00469    LocalToWideChar(pData->wszData, pszData, MAX_DATA);
00470
00471    return lstrlenW(pData->wszData);
00472    }
00473
00474 return 0;
00475 }
00476
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RESOURCEPOSINFO Member List

This is the complete list of members for RESOURCEPOSINFO, including all inherited members.
dwBytes | RESOURCEPOSINFO
dwOffset | RESOURCEPOSINFO
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/MTXSample/Account.cpp Source File

  • Web
  • iis
  • Components
  • Cpp
  • MTXSample

Account.cpp

Go to the documentation of this file.
00001 // Account.cpp : Implementation of CAccount
00002
00003 #include "stdafx.h"
00004 #include "BankVC.h"
00005 #include "Account.h"
00006 #include "CreateTable.h"
00007
00008 extern CComBSTR CONNECTION;
00009
00010 STDMETHODIMP CAccount::InterfaceSupportsErrorInfo(REFIID riid)
00011 {
00012   static const IID* arr[] = { &IID_IAccount };
00013
00014   for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
00015     if (InlineIsEqualGUID(*arr[i], riid))
00016       return S_OK;
00017
00018   return S_FALSE;
00019 }
00020
00021 STDMETHODIMP CAccount::Post(long lngAccntNum, long lngAmount, BSTR *pVal)
00022 {
00023   // Get the ObjectContext object
00024
00025   _RecordsetPtr pRecordset = NULL;
00026   BOOL bFatal = FALSE;
00027   TCHAR strErr[256];
00028   _ConnectionPtr pConnection;
00029   FieldsPtr pFields;
00030   FieldPtr pField;
00031   CComVariant vntValue;
00032   CComPtr<ICreateTable> pCreateTable;
00033   CComBSTR bstrSQL;
00034
00035   CComPtr<IObjectContext> pObjectContext = NULL;
00036
00037   HRESULT hr = GetObjectContext(&pObjectContext);
00038
00039   if (FAILED(hr))
00040   {
00041     wsprintf(strErr, "GetObjectContext() failed!");
00042
00043     goto ErrorHandler;
00044   }
00045
00046   // Create ADODB.Connection object
00047
00048   hr = pConnection.CreateInstance("ADODB.Connection.1");
00049
00050   if (FAILED(hr))
00051   {
00052     wsprintf(strErr, "Failed to Create ADODB.Connection object!");
00053
00054     goto ErrorHandler;
00055   }
00056
00057   // Open ODBC connection
00058
00059   hr = pConnection->Open(CONNECTION, NULL, NULL, NULL);
00060
00061   if (FAILED(hr))
00062   {
00063     wsprintf(strErr, "Open connection failed!");
00064
00065     goto ErrorHandler;
00066   }
00067
00068   // Execute Update SQL statement
00069
00070   wsprintf(strErr, "Update Account Set Balance = Balance + %d where AccountNo = %d", lngAmount, lngAccntNum);
00071
00072   bstrSQL = CComBSTR(strErr);
00073
00074 TryAgain:
00075
00076   hr = pConnection->Execute(bstrSQL, static_cast<VARIANT *>(&vtMissing), adCmdText, &pRecordset);
00077
00078   if (FAILED(hr))
00079     goto ErrorCreateTable;
00080
00081   wsprintf(strErr, "Select Balance from Account where AccountNo = %d", lngAccntNum);
00082
00083   bstrSQL = CComBSTR(strErr);
00084
00085   // Get current balance
00086
00087   hr = pConnection->Execute(bstrSQL, static_cast<VARIANT *>(&vtMissing), adCmdText, &pRecordset);
00088
00089   if (FAILED(hr))
00090   {
00091     wsprintf(strErr, "Unable to obtain balance for Account %d", lngAccntNum);
00092
00093     goto ErrorHandler;
00094   }
00095
00096   pRecordset->get_Fields(&pFields);
00097
00098   pFields->get_Item(CComVariant(L"Balance"), &pField);
00099
00100   pField->get_Value(&vntValue);
00101
00102   // If the current balance is less than 0, abort transaction otherwise complete transaction
00103
00104   if (vntValue.lVal < 0)
00105   {
00106     wsprintf(strErr, "Not enough fund to withdraw");
00107
00108     goto ErrorHandler;
00109   }
00110
00111   wsprintf(strErr, "%s account %ld, balance is $%ld. (VC++)", ((lngAmount >= 0) ? "Credit to" : "Debit from"), lngAmount, vntValue.lVal);
00112
00113   *pVal = CComBSTR(strErr).Copy();
00114
00115   pObjectContext->SetComplete();
00116
00117   return S_OK;
00118
00119 ErrorCreateTable:
00120
00121   // first pass OK, but not second;
00122
00123   if (bFatal == TRUE)
00124     goto ErrorHandler;
00125
00126   bFatal = TRUE;
00127
00128   // create a CreateTable object
00129
00130   hr = pObjectContext->CreateInstance(CLSID_CreateTable, IID_ICreateTable, (void**)&pCreateTable);
00131
00132   if (FAILED(hr))
00133     goto ErrorHandler;
00134
00135   hr = pCreateTable->CreateAccount();
00136
00137   if (FAILED(hr))
00138     goto ErrorHandler;
00139
00140   goto TryAgain;
00141
00142 ErrorHandler:
00143
00144   Error(strErr,IID_IAccount);
00145
00146   if (pObjectContext)
00147     pObjectContext->SetAbort();
00148
00149   return hr;
00150 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::SchemaEnum Member List

This is the complete list of members for msado15::SchemaEnum, including all inherited members.
adSchemaAsserts | msado15::SchemaEnum | [static]
adSchemaCatalogs | msado15::SchemaEnum | [static]
adSchemaCharacterSets | msado15::SchemaEnum | [static]
adSchemaCheckConstraints | msado15::SchemaEnum | [static]
adSchemaCollations | msado15::SchemaEnum | [static]
adSchemaColumnPrivileges | msado15::SchemaEnum | [static]
adSchemaColumns | msado15::SchemaEnum | [static]
adSchemaColumnsDomainUsage | msado15::SchemaEnum | [static]
adSchemaConstraintColumnUsage | msado15::SchemaEnum | [static]
adSchemaConstraintTableUsage | msado15::SchemaEnum | [static]
adSchemaCubes | msado15::SchemaEnum | [static]
adSchemaDBInfoKeywords | msado15::SchemaEnum | [static]
adSchemaDBInfoLiterals | msado15::SchemaEnum | [static]
adSchemaDimensions | msado15::SchemaEnum | [static]
adSchemaForeignKeys | msado15::SchemaEnum | [static]
adSchemaHierarchies | msado15::SchemaEnum | [static]
adSchemaIndexes | msado15::SchemaEnum | [static]
adSchemaKeyColumnUsage | msado15::SchemaEnum | [static]
adSchemaLevels | msado15::SchemaEnum | [static]
adSchemaMeasures | msado15::SchemaEnum | [static]
adSchemaMembers | msado15::SchemaEnum | [static]
adSchemaPrimaryKeys | msado15::SchemaEnum | [static]
adSchemaProcedureColumns | msado15::SchemaEnum | [static]
adSchemaProcedureParameters | msado15::SchemaEnum | [static]
adSchemaProcedures | msado15::SchemaEnum | [static]
adSchemaProperties | msado15::SchemaEnum | [static]
adSchemaProviderSpecific | msado15::SchemaEnum | [static]
adSchemaProviderTypes | msado15::SchemaEnum | [static]
adSchemaReferentialConstraints | msado15::SchemaEnum | [static]
adSchemaReferentialContraints | msado15::SchemaEnum | [static]
adSchemaSchemata | msado15::SchemaEnum | [static]
adSchemaSQLLanguages | msado15::SchemaEnum | [static]
adSchemaStatistics | msado15::SchemaEnum | [static]
adSchemaTableConstraints | msado15::SchemaEnum | [static]
adSchemaTablePrivileges | msado15::SchemaEnum | [static]
adSchemaTables | msado15::SchemaEnum | [static]
adSchemaTranslations | msado15::SchemaEnum | [static]
adSchemaTrustees | msado15::SchemaEnum | [static]
adSchemaUsagePrivileges | msado15::SchemaEnum | [static]
adSchemaViewColumnUsage | msado15::SchemaEnum | [static]
adSchemaViews | msado15::SchemaEnum | [static]
adSchemaViewTableUsage | msado15::SchemaEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsEvent/newsEventClass/INewsEvent.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsEvent
  • newsEventClass

INewsEvent.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc147.tmp" /nologo /d "D:\ComPlusSamples\Source\LCE\NewsEvent" "D:\ComPlusSamples\Source\LCE\NewsEvent\NewsEventClass.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package newseventclass;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface INewsEvent
00019 /** @com.interface(iid=4BF5E480-A5D3-11D2-AD4D-0080C7BFF6DB, thread=AUTO, type=DUAL) */
00020 public interface INewsEvent extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=METHOD, name="NewsFlash", addFlagsVtable=4)
00023       @com.parameters([in,type=DATE] dtTimeStamp, [in,type=STRING] Symbol, [in,type=STRING] Headline, [in,type=STRING] URL) */
00024   public void NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=METHOD, name="ShortQuote", addFlagsVtable=4)
00027       @com.parameters([in,type=STRING] Symbol, [in,type=R8] BidPrice, [in,type=R8] AskPrice, [in,type=DATE] LastTradeTime, [in,type=R8] LastTradePrice, [in,type=R8] NetChange, [in,type=R8] DailyHigh, [in,type=R8] DailyLow) */
00028   public void ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LongQuote", addFlagsVtable=4)
00031       @com.parameters([in,type=STRING] Symbol, [in,type=R8] BidPrice, [in,type=R8] AskPrice, [in,type=STRING] LastTradeTime, [in,type=R8] LastTradePrice, [in,type=R8] NetChange, [in,type=R8] DailyHigh, [in,type=R8] DailyLow, [in,type=I4] AskSize, [in,type=I4] BidSize, [in,type=R8] OpenPrice, [in,type=R8] ClosePrice, [in,type=STRING] CloseDate) */
00032   public void LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate);
00033
00034
00035   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x4bf5e480, (short)0xa5d3, (short)0x11d2, (byte)0xad, (byte)0x4d, (byte)0x0, (byte)0x80, (byte)0xc7, (byte)0xbf, (byte)0xf6, (byte)0xdb);
00036 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/resource.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step3

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by MyDevice.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_DIMMER                      101
00007 #define IDR_DIMMERSERVICE               102
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NEXT_RESOURCE_VALUE        201
00014 #define _APS_NEXT_COMMAND_VALUE         32768
00015 #define _APS_NEXT_CONTROL_VALUE         201
00016 #define _APS_NEXT_SYMED_VALUE           103
00017 #endif
00018 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/section.cpp Source File

  • Begin
  • sdkdiff

section.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * section.cpp
00013  *
00014  * manage sections of lines, and lists of sections.
00015  *
00016  * a section is a data type that represents a contiguous block of lines
00017  * of the same state (all unmatched, or all matched to a contiguous block of
00018  * lines). A section can link up matching lines within the section.
00019  *
00020  * section list functions can make and match lists of sections from lists of
00021  * lines, and create a composite list by combining sections from two lists
00022  * to create a list that 'best represents' the similarities and differences
00023  * between the two lists of lines.
00024  *
00025  * Assumptions: the lines passed in are on a list (can be traversed with
00026  *   List_Next() etc. Line numbering using the section_get*basenr()
00027  *   functions work only if lines are numbered sequentially in ascending order.
00028  *
00029  */
00030
00031 #include "precomp.h"
00032
00033 #include "tree.h"
00034
00035 #include "state.h"
00036 #include "sdkdiff.h"
00037 #include "wdiffrc.h"
00038
00039 #include "list.h"
00040 #include "line.h"
00041 #include "section.h"
00042
00043 #ifdef trace
00044 extern BOOL bTrace;  /* in sdkdiff.cpp'.  Read only here */
00045 #endif //trace
00046
00047 /*
00048  * a section handle (SECTION) is a pointer to one of these structures
00049  */
00050 struct section {
00051         LINE first;             /* first line in section */
00052         LINE last;              /* last line in section */
00053
00054         BOOL bDiscard;          /* true if not alloc-ed on list */
00055
00056         SECTION link;           /* we match this section */
00057         SECTION correspond;     /* we correspond to this section, but
00058                                  * don't match it
00059                                  */
00060
00061         int state;              /* compare state for section */
00062
00063         int leftbase;           /* nr in original left list of first line*/
00064         int rightbase;          /* nr in original right list of first line*/
00065 };
00066
00067 /* --- function prototypes ------------------------------------------*/
00068
00069 TREE section_makectree(SECTION sec);
00070 BOOL section_expandanchor(SECTION sec1, LINE line1, SECTION sec2, LINE line2);
00071
00072
00073
00074 /*-- external functions ------------------------------------------------- */
00075
00076 /*
00077  * make a new section, given handles to a first and last line.
00078  *
00079  * a section must be at least one line long. The lines passed in must be
00080  * on a list in order.
00081  *
00082  * if the list parameter is non-null, we will allocate the section struct
00083  * on the list. otherwise we will alloc it using HeapAlloc. We remember
00084  * this in the bDiscard flag for section_delete, so that we only
00085  * hand back to HeapFree memory that we got.
00086  */
00087 SECTION
00088 section_new(LINE first, LINE last, LIST list)
00089 {
00090         SECTION sec;
00091
00092         /* alloc the sec and remember where we alloc-ed it */
00093         if (list)
00094         {
00095             sec = (SECTION) List_NewLast(list, sizeof(struct section));
00096             if (!sec)
00097                 return NULL;
00098             sec->bDiscard = TRUE;
00099         }
00100         else
00101         {
00102             sec = (SECTION) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct section));
00103             if (!sec)
00104                 return NULL;
00105             sec->bDiscard = FALSE;
00106         }
00107
00108         sec->first = first;
00109         sec->last = last;
00110         sec->link = NULL;
00111         sec->correspond = NULL;
00112         sec->state = 0;
00113         sec->leftbase = 1;
00114         sec->rightbase = 1;
00115
00116         return(sec);
00117 }
00118
00119 /*
00120  * discard a section. free all associated memory (not the line list).
00121  * free up the section itself if it was not alloc-ed on a list.
00122  */
00123 void
00124 section_delete(SECTION section)
00125 {
00126         if (section->bDiscard) {
00127                 HeapFree(GetProcessHeap(), NULL, section);
00128         }
00129 }
00130
00131
00132
00133
00134 /*
00135  * match up two sections: match all lines that
00136  * are unique and identical between the two sections.
00137  *
00138  * we use a tree of line handles, keyed by the line hash code. We use a
00139  * ctree, which keeps a count for multiple identical keys. This allows
00140  * us to rapidly find lines that are unique within this section.
00141  * We build two of these trees (one for each line list). For each line
00142  * that is unique in both trees, we attempt to link the lines.
00143  *
00144  * we also attempt to link the first and last line of the section.
00145  *
00146  * for each line we successfully link, we spread up and down from
00147  * this anchor point attempting to link lines.
00148  *
00149  * we return true if we linked any lines
00150  *
00151  * This routine may be called more than once on the same list of lines.
00152  * In matching lines we want to find unique, *unmatched* lines: so we only
00153  * insert lines into the ctree if they are currently unlinked.
00154  *
00155  * ReSynch means accept lines which occur AT LEAST once on each side rather than
00156  * EXACTLY once on each side.  In this case we associate the first occurrence
00157  * on one side with the first occurrence onthe other.
00158  *
00159  * We might ideally keep track of which sections match dubiously and use
00160  * this to resolve which sections we treat as matched and which as moved
00161  * when we are forced to make a choice.  Here we are only making links
00162  * between LINES, not sections, so it makes it a bit tricky.
00163  */
00164 BOOL
00165 section_match(SECTION sec1, SECTION sec2, BOOL ReSynch)
00166 {
00167         TREE ctleft, ctright;
00168         LINE line, line2;
00169         BOOL bLinked = FALSE;
00170
00171
00172         if ((sec1 == NULL) || (sec2 == NULL)) {
00173                 return(FALSE);
00174         }
00175
00176         if ((sec1->first == NULL) || (sec2->first == NULL)) {
00177                 return(FALSE);
00178         }
00179         /* ASSERT if first is non-null, so is last */
00180
00181         /* attempt to link the first line of each file, and
00182          * if matched, expand as long as we keep matching
00183          */
00184         bLinked |= section_expandanchor(sec1, sec1->first, sec2, sec2->first);
00185
00186
00187         /* build a tree of lines, indexed by the line hashcode.
00188          * a ctree will hold only the first value of any given key, but
00189          * it will keep track of the number of items inserted on this key.
00190          * thus we can keep count of the number of times this line
00191          * (or at least this hashcode) appears.
00192          */
00193         ctleft = section_makectree(sec1);
00194         ctright = section_makectree(sec2);
00195
00196         /* for each unlinked line in one list (doesn't matter which), find if
00197          * it appears once only in each list. if so, link, and expand
00198          * the link to link lines before and after the matching line
00199          * as long as they continue to match.
00200          *
00201          * If ReSynch is set then accept lines which occur more than once in
00202          * each file (this matches the first copy in each file of lines which
00203          * are the same, but are non unique.  Heuristic: if the lines are short
00204          * (8 chars or fewer) then don't accept them.  It can waste a lot
00205          * of time matching spurious {, } or blank lines.
00206          */
00207         for (line = sec1->first; line != NULL; line = (LINE)List_Next(line)) {
00208
00209                 if (  (line_getlink(line) == NULL)
00210                    && (  ReSynch
00211                       ?  (  (ctree_getcount(ctleft, line_gethashcode(line)) >= 1)
00212                          && (ctree_getcount(ctright, line_gethashcode(line)) >= 1)
00213                          && (line_gettextlen(line) > 8)
00214                          )
00215                       :  (  (ctree_getcount(ctleft, line_gethashcode(line)) == 1)
00216                          && (ctree_getcount(ctright, line_gethashcode(line)) == 1)
00217                          )
00218                       )
00219                    ){
00220
00221                         /* lines match */
00222                         line2 = * ((LINE FAR *)ctree_find(ctright,
00223                                         line_gethashcode(line)));
00224                         bLinked |= section_expandanchor(sec1, line, sec2, line2);
00225                 }
00226
00227                 if (line == sec1->last) {
00228                         break;
00229                 }
00230         }
00231
00232         /* delete the ctrees */
00233         ctree_delete(ctleft);
00234         ctree_delete(ctright);
00235
00236
00237         /* attempt to link the last lines of each file and
00238          * expand upwards
00239          */
00240         bLinked |= section_expandanchor(sec1, sec1->last, sec2, sec2->last);
00241
00242         return(bLinked);
00243 } /* section_match */
00244
00245 /* -- accessor functions --------------*/
00246
00247 /*
00248  * get a handle to the first line in this section
00249  */
00250 LINE
00251 section_getfirstline(SECTION section)
00252 {
00253         if (section == NULL) {
00254                 return(NULL);
00255         }
00256         return(section->first);
00257 }
00258
00259 /*
00260  * return a handle to the last line in a section
00261  */
00262 LINE
00263 section_getlastline(SECTION section)
00264 {
00265         if (section == NULL) {
00266                 return(NULL);
00267         }
00268         return(section->last);
00269 }
00270
00271 /*
00272  * return a handle to the linked section, if any. A linked section
00273  * is a section whose lines all match the lines in this section
00274  */
00275 SECTION
00276 section_getlink(SECTION section)
00277 {
00278         if (section == NULL) {
00279                 return NULL;
00280         }
00281         return(section->link);
00282 }
00283
00284 /*
00285  * return a handle to the corresponding section (a section which
00286  * corresponds in position to this one, but whose lines do not match).
00287  */
00288 SECTION
00289 section_getcorrespond(SECTION section)
00290 {
00291         if (section == NULL) {
00292                 return(NULL);
00293         }
00294         return(section->correspond);
00295 }
00296
00297 /* get the state for this section */
00298 int
00299 section_getstate(SECTION section)
00300 {
00301         if (section == NULL) {
00302                 TRACE_ERROR("SECTION: null section in getstate call", FALSE);
00303                 return(0);
00304         }
00305         return(section->state);
00306 }
00307
00308 /* set the state for this section */
00309 void
00310 section_setstate(SECTION section, int state)
00311 {
00312         section->state = state;
00313 }
00314
00315 /* return the number of lines in the section. Here we assume that
00316  * lines in the section are number sequentially in ascending order, and we
00317  * simply look at the first and last line numbers.
00318  */
00319 int
00320 section_getlinecount(SECTION section)
00321 {
00322         if (section->last==NULL && section->first==NULL)
00323                 return 0;   /* the thing below would return 1! */
00324         if (section->first==NULL || section->last==NULL)
00325                 TRACE_ERROR("SECTION: null first or last (but not both) in getlinecount call", FALSE);
00326
00327         return(line_getlinenr(section->last) -
00328                         line_getlinenr(section->first)) + 1;
00329 }
00330
00331 /*
00332  * -- base line numbers --
00333  *
00334  * these functions only apply to sections in the composite list. When creating
00335  * a composite section, we record the line number of the first line in each
00336  * of the two sections we built it from. Thus we can calculate the
00337  * line number of any line in the section in either file it appeared in,
00338  * by adding the index of the line within the section to the base line
00339  * number.
00340  */
00341 int
00342 section_getleftbasenr(SECTION section)
00343 {
00344         return(section->leftbase);
00345 }
00346
00347 void
00348 section_setleftbasenr(SECTION section, int base)
00349 {
00350         section->leftbase = base;
00351 }
00352
00353 int
00354 section_getrightbasenr(SECTION section)
00355 {
00356         return(section->rightbase);
00357 }
00358
00359 void
00360 section_setrightbasenr(SECTION section, int base)
00361 {
00362         section->rightbase = base;
00363 }
00364
00365
00366 /* --- section list functions -------------------------------------*/
00367
00368 /* Theory of handling blank lines:
00369 |
00370 |  If ignore_blanks is FALSE then a blank is just another character.
00371 |  If it is TRUE then we will normally include unmatched blanks in whatever
00372 |  section is surrounding them.  It would be nice if we could arrange to
00373 |  never have a section that is only unmatched blanks, but (at least at
00374 |  the start of the file) it can happen.  Tough.
00375 |
00376 |  Note that there are two DIFFERENT blank handling techniques:
00377 |  In the first phase of the comparison when we are just trying to match up
00378 |  lines, we skip over blank lines both forwards and backwards from an anchor.
00379 |  When we are making real sections for display we only go forwards.
00380 |  This results in a possible anomaly at the top of the whole file where
00381 |  there could be some blanks which do not match and which can only possibly
00382 |  be described as the start of a section.
00383 |  For this reason, we label the sections with their state as early as possible
00384 |  and go by that rather than by the presence or absence of link fields.
00385 |  (It takes some scanning to find a link.  The first line in the section
00386 |  could be a blank).
00387 */
00388
00389
00390 /* return a LINE which is the last line in an unmatched section
00391    containing (probably starting with) Line.
00392    Note that it does not necessarily make progress.
00393
00394    As noted above, even if blank lines are being ignored, we don't
00395    mind tagging them onto the end of an already unmatching section.
00396    This means we carry on until we find the first real link
00397 */
00398 LINE FindEndOfUnmatched(LINE line)
00399 {
00400         LINE next;
00401
00402         for (; ; )
00403         {       next = (LINE)List_Next(line);
00404                 if (next==NULL) return line;
00405                 if (line_getlink(next)!=NULL) return line;
00406                 line = next;
00407         }
00408 } /* FindEndOfUnmatched */
00409
00410
00411 /* An ignorable line is a blank line with no link and ignore_blanks set
00412
00413    Given that line is initially not NULL and not ignorable:
00414    If line is the last line in the list then return NULL
00415    Else If ignore_blanks is FALSE then return the next line after line
00416    else return next line which has a link or which is non-blank.
00417    If there is no such line then return the last line in the list.
00418
00419    Note that this does always make progress (at the cost of
00420    sometimes returning NULL).
00421 */
00422 LINE NextNonIgnorable(LINE line)
00423 {       LINE next;
00424         if (  line_getlink(line)==NULL
00425            && ! (ignore_blanks && line_isblank(line))
00426            )
00427                 TRACE_ERROR("!!Bad call to NextNonIgnorable!!", FALSE);
00428
00429         next = (LINE)List_Next(line);
00430         if (next==NULL) return NULL;
00431         for (; ; ) {
00432                 line = next;
00433                 if (  line_getlink(line)!=NULL) return line;
00434                 if (! ignore_blanks)            return line;
00435                 if (! line_isblank(line))       return line;
00436                 next = (LINE)List_Next(line);
00437                 if (next==NULL) return line;
00438         }
00439 } /* NextNonIgnorable */
00440
00441
00442 /* Given that line is either linked or an ignorable blank:
00443    Return a LINE which is the last line in a matched section
00444    containing (probably starting with) line.
00445    This could mean returning the line we were given.
00446
00447    If the lines linked to are not consecutive then the section ends.
00448    If blanks are being ignored, then any blank line is deemed
00449    to match (even if it doesn't match).  In this case we need the
00450    links of the lines before and after the blanks to be consecutive
00451    in order to carry on.  There could be blank lines on either or both
00452    ends of the links.
00453 */
00454 LINE FindEndOfMatched(LINE line)
00455 {
00456         LINE next;              /* next non-ignored or linked line */
00457         LINE nextlink;          /* next in other file */
00458
00459         /* The basic algorithm is to set up next and nextlink to point to
00460            candidate lines.  Examine them.  If they are good then step
00461            on to them, else return the line one before.
00462            There are confusion factors associated with the beginning and
00463            end of the file.
00464         */
00465
00466
00467         if (line==NULL) TRACE_ERROR("FindEndOfMatched called with NULL", FALSE);
00468
00469         /* As a section (at least at the start of the file) might start
00470            with an ignored non-linked blank line, first step over any such
00471         */
00472         if( line_getlink(line)==NULL && line_isblank(line) ) {
00473                 next = NextNonIgnorable(line);
00474
00475                 /* There are unfortunately 6 cases to deal with
00476                    * marks where next will be. * against eof means next==NULL
00477                    blank(s) refer to ignorable unlinked blanks.
00478                           A         B        C        D        E        F
00479                    line-> xxxxx     xxxxx    xxxxx    xxxxx    xxxxx    xxxxx
00480                          *unlinked  blanks  *linked   blanks  *eof     *blanks
00481                                    *unlinked         *linked            eof
00482
00483                    next could be:
00484
00485                       null - case E => return line
00486                       unlinked ignorable blank - case F => return that blank line
00487                       unlinked other - cases A,B return prev(that unlinked line)
00488                       linked - cases C,D continue from that linked line
00489                 */
00490                 if (next==NULL) return line;
00491                 if (line_getlink(next)==NULL) {
00492                         if (ignore_blanks && line_isblank(next)) {
00493                                 return next;
00494                         }
00495                         return (LINE)List_Prev(next);
00496                 }
00497
00498                 line = next;
00499         }
00500
00501         /* we have stepped over inital blanks and now do have a link */
00502         if (line_getlink(line)==NULL)
00503                 TRACE_ERROR("!!FindEndOfMatched -- no link!!", FALSE);
00504
00505         for ( ; ; ) {
00506
00507                 next = NextNonIgnorable(line);
00508                 /* Same 6 cases - basically same again */
00509                 if (next==NULL) return line;
00510                 if (line_getlink(next)==NULL) {
00511                         if (ignore_blanks && line_isblank(next)) {
00512                                 return next;
00513                         }
00514                         return (LINE)List_Prev(next);
00515                 }
00516
00517                 nextlink = NextNonIgnorable(line_getlink(line));
00518
00519                 /* WEAK LOOP INVARIANT
00520                    line is linked.
00521                    next is the next non-ignorable line in this list after line.
00522                    nextlink is the next non-ignorable line after link(line)
00523                                         in the other list (could be NULL etc).
00524                 */
00525                 if (line_getlink(next) != nextlink)
00526           return (LINE)List_Prev(next);
00527
00528                 line = next;
00529         }
00530 } /* FindEndOfMatched */
00531
00532
00533 /*
00534  * make a list of sections by traversing a list of lines. consecutive
00535  * linked lines that are linked to consecutive lines are put in a single
00536  * section. blocks of unlinked lines are placed in a section.
00537  * If ignore_blanks is set then we first try to link them as normal.
00538  * but if they won't link then we just skip over them and keep them
00539  * in the same section.
00540  *
00541  * left must be set TRUE iff the list of lines is a left hand section.
00542  * returns a handle to a list of sections
00543  */
00544 LIST
00545 section_makelist(LIST linelist, BOOL left)
00546 {
00547         LINE line1, line2;
00548         LIST sections;
00549         BOOL matched;
00550         SECTION sect;
00551
00552         /* make an empty list of sections */
00553         sections = List_Create();
00554
00555         /* for each line in the list */
00556     for( line1=(LINE)List_First(linelist);  line1!=NULL;  line1 = (LINE)List_Next((LPVOID)line1)) {
00557
00558                 /* is it linked ? */
00559
00560                 if( line_getlink(line1) != NULL
00561                   || ( ignore_blanks && line_isblank(line1))
00562                   ) {
00563                         line2 = FindEndOfMatched(line1);
00564                         matched = TRUE;
00565                 } else {
00566                         line2 = FindEndOfUnmatched(line1);
00567                         matched = FALSE;
00568                 }
00569
00570                 /* create the section and add to list */
00571                 sect = section_new(line1, line2, sections);
00572                 sect->state = (matched ? STATE_SAME
00573                                        : left ? STATE_LEFTONLY
00574                                               : STATE_RIGHTONLY
00575                               );
00576
00577 #ifdef trace
00578                 {       char msg[80];
00579                         StringCchPrintf( msg, 80
00580                                 , "Created section: lines %d..%d of %s %s\r\n"
00581                                 , line_getlinenr(line1)
00582                                 , line_getlinenr(line2)
00583                                 , (left ? "left" : "right")
00584                                 , (matched ? "matching" : "non-matched")
00585                                 );
00586                         if (bTrace) Trace_File(msg);
00587                 }
00588 #endif
00589
00590                 /* advance to end of section (no-op if 1 line section) */
00591                 line1 = line2;
00592         }
00593
00594         return(sections);
00595 } /* section_makelist */
00596
00597
00598
00599 /*
00600  * delete a list of sections
00601  *
00602  * sections have no dangling pointers, so all we do is delete the list
00603  */
00604 void
00605 section_deletelist(LIST sections)
00606 {
00607         List_Destroy(&sections);
00608 }
00609
00610 /* Return the first line in the range first..last
00611    which has a link.  Return last if none of them have a link.
00612    List_Next must lead from first to last eventually.
00613    It is legit for last to be NULL.
00614 */
00615 LINE FindFirstWithLink(LINE first, LINE last)
00616 {
00617         /* The strategy of including blanks on the ENDS of sections rather
00618            than the start of new sections will mean that this function
00619            usually strikes gold immediately.  A file with a leading
00620            blank section is its raison d'etre.
00621         */
00622 #ifdef trace
00623         LINE hold = first;
00624 #endif
00625         while (line_getlink(first)==NULL && first!=last)
00626                 first = (LINE)List_Next(first);
00627
00628         if (line_getlink(first)==NULL) {
00629 #ifdef trace
00630                 char msg[80];
00631                 StringCchPrintf( msg, 80
00632                         , "???FindFirstWithLink found an unlinked section: %d..%d\r\n"
00633                         , line_getlinenr(hold)
00634                         , line_getlinenr(first)
00635                         );
00636                 if (bTrace) Trace_File(msg);
00637 #endif
00638         }
00639         return first;
00640 } /* FindFirstWithLink */
00641
00642
00643 /*
00644  * match up two lists of sections. establish links between sections
00645  * that match, and establish 'correspondence' between sections that
00646  * are in the same place, but don't match.
00647  *
00648  * for each pair of corresponding sections, we also call section_match
00649  * to try and link up more lines.
00650  *
00651  * we return TRUE if we made any more links between lines, or false
00652  * otherwise.
00653  *
00654  */
00655 BOOL
00656 section_matchlists(LIST secsleft, LIST secsright, BOOL bDups)
00657 {
00658         BOOL bLinked = FALSE;
00659         SECTION sec1, sec2;
00660
00661         /* match up linked sections - We know whether a section is
00662            supposed to link from its state, but we don't know what section
00663            it links to.  Also we can have sections which are defined to
00664            be matching but actually contain nothing but ignorable
00665            blank lines
00666         */
00667
00668         /*  for each linked section try to find the section  linked to it. */
00669     for( sec1=(SECTION)List_First(secsleft);  sec1!=NULL;  sec1 = (SECTION)List_Next((LPVOID)sec1)) {
00670                 if (sec1->state==STATE_SAME) {
00671                         LINE FirstWithLink = FindFirstWithLink(sec1->first, sec1->last);
00672 #ifdef trace
00673                         {       char msg[80];
00674                                 StringCchPrintf( msg, 80
00675                                         , "matchlists left matching section %d..%d \r\n"
00676                                         , line_getlinenr(sec1->first)
00677                                         , line_getlinenr(sec1->last)
00678                                         );
00679                                 if (bTrace) Trace_File(msg);
00680                         }
00681 #endif
00682             for( sec2=(SECTION)List_First(secsright);  sec2!=NULL;  sec2 = (SECTION)List_Next((LPVOID)sec2)) {
00683                                 if ( sec2->state==STATE_SAME
00684                                    && line_getlink(FirstWithLink)
00685                                         == FindFirstWithLink(sec2->first, sec2->last)) {
00686                                             break;
00687                                 }
00688                         }
00689                         /* sec2 could be NULL if sec1 is all allowable blanks */
00690                         if (sec2!=NULL) {
00691                                 sec1->link = sec2;
00692                                 sec2->link = sec1;
00693 #ifdef trace
00694                                 {       char msg[80];
00695                                         StringCchPrintf( msg, 80
00696                                                 , "matchlists right matching section is %d..%d \r\n"
00697                                                 , line_getlinenr(sec2->first)
00698                                                 , line_getlinenr(sec2->last)
00699                                                 );
00700                                         if (bTrace) Trace_File(msg);
00701                                 }
00702 #endif
00703                         }
00704                 }
00705         }
00706
00707         /* go through all unmatched sections. Note that we need to complete
00708          * the link-up of matching sections before this, since we need
00709          * all the links in place for this to work.
00710          */
00711
00712     for( sec1=(SECTION)List_First(secsleft);  sec1!=NULL;  sec1 = (SECTION)List_Next((LPVOID)sec1)) {
00713                 SECTION secTemp;
00714
00715                 if (sec1->state == STATE_SAME) {
00716                         /* skip the linked sections */
00717                         continue;
00718                 }
00719
00720                 /* check that the previous and next sections, if
00721                  * they exist, are linked. this should not fail since
00722                  * two consecutive unlinked sections should be made into
00723                  * one section
00724                  */
00725                 secTemp = (SECTION)List_Prev(sec1);
00726                 if (secTemp && secTemp->state!= STATE_SAME) {
00727                         TRACE_ERROR("consecutive unlinked sections", FALSE);
00728                         continue;
00729                 }
00730                 secTemp = (SECTION)List_Next(sec1);
00731                 if (secTemp && secTemp->state!= STATE_SAME) {
00732                         TRACE_ERROR("consecutive unlinked sections.", FALSE);
00733                         continue;
00734                 }
00735
00736                 /* find the section that corresponds to this - that is, the
00737                  * section following the section linked to our previous section.
00738                  * we could be at beginning or end of list.
00739                  */
00740                 if (List_Prev(sec1) != NULL) {
00741                         SECTION secOther;
00742                         secOther = section_getlink((SECTION)List_Prev(sec1));
00743                         if (secOther==NULL)
00744                                 continue;
00745
00746                         sec2 = (SECTION)List_Next(secOther);
00747
00748                         /* check this section is not linked */
00749                         if ((sec2 == NULL) || (section_getlink(sec2) != NULL)) {
00750                                 continue;
00751                         }
00752
00753                         /* check that the section after these are linked
00754                          * to each other (or both are at end of list).
00755                          */
00756                         if (List_Next(sec1) != NULL) {
00757
00758                                 if (section_getlink((SECTION)List_Next(sec1)) !=
00759                                     List_Next(sec2)) {
00760                                         continue;
00761                                 }
00762                         } else {
00763                                 if (List_Next(sec2) != NULL) {
00764                                         continue;
00765                                 }
00766                         }
00767
00768                 } else if (List_Next(sec1) != NULL) {
00769                         SECTION secOther;
00770                         secOther = section_getlink((SECTION)List_Next(sec1));
00771                         if (secOther==NULL)
00772                                 continue;
00773
00774                         sec2 = (SECTION)List_Prev(secOther);
00775
00776                         /* check this section is not linked */
00777                         if ((sec2 == NULL) || (section_getlink(sec2) != NULL)) {
00778                                 continue;
00779                         }
00780
00781                         /* check that the section before these are linked
00782                          * to each other (or both are at start of list).
00783                          */
00784                         if (List_Prev(sec1) != NULL) {
00785
00786                                 if (section_getlink((SECTION)List_Prev(sec1)) !=
00787                                     List_Prev(sec2)) {
00788                                         continue;
00789                                 }
00790                         } else {
00791                                 if (List_Prev(sec2) != NULL) {
00792                                         continue;
00793                                 }
00794                         }
00795                 } else {
00796                         /* there must be at most one section in each
00797                          * file, and they are unmatched. make these correspond.
00798                          * (Though I don't think this would ever do anything except
00799                          * waste time by trying to link that which has already failed)
00800                          *
00801                          */
00802                         sec2 = (SECTION)List_First(secsright);
00803                 }
00804
00805
00806                 /* make the correspondence links
00807                  * we will want these for  zebra striping
00808                  */
00809                 if ((sec1 != NULL) && (sec2 != NULL)) {
00810                         sec1->correspond = sec2;
00811                         sec2->correspond = sec1;
00812                 }
00813
00814                 /* attempt to link up lines */
00815                 if (section_match(sec1, sec2, bDups)) {
00816                         bLinked = TRUE;
00817                 }
00818         }
00819
00820         return(bLinked);
00821 } /* section_matchlists */
00822
00823 /*
00824  * add a section to the composite list. called from makecomposites
00825  * to copy a section, add it to the composite list and set the state,
00826  * leftbase and rightbase.   Note that the state could be STATE_SAME
00827  * with a NULL section on the left.  May NOT call with STATE_SAME and
00828  * a NULL right section!
00829  *
00830  */
00831 void
00832 section_takesection(LIST compo, SECTION left, SECTION right, int state)
00833 {
00834         SECTION newsec;
00835         SECTION sec = NULL;
00836
00837         /* select which section is being output, and change the state
00838          * to indicate it has been output
00839          */
00840         switch(state) {
00841         case STATE_SAME:
00842                 /* both the same. we mark both as output, and
00843                  * take the right one.  It is possible that the
00844                  * left one could be NULL (an ignorable blank section)
00845                  */
00846                 if (left!=NULL) left->state = STATE_MARKED;
00847                 right->state = STATE_MARKED;
00848                 sec = right;
00849                 break;
00850
00851         case STATE_LEFTONLY:
00852         case STATE_MOVEDLEFT:
00853                 sec = left;
00854                 left->state = STATE_MARKED;
00855                 break;
00856
00857         case STATE_RIGHTONLY:
00858         case STATE_MOVEDRIGHT:
00859                 sec = right;
00860                 right->state = STATE_MARKED;
00861                 break;
00862         /* other cases e.g. SIMILARLEFT should not occur! */
00863         }
00864
00865
00866         /* create a new section on the list */
00867         newsec = section_new(sec->first, sec->last, compo);
00868
00869         newsec->state = state;
00870
00871
00872         if (left != NULL) {
00873                 newsec->leftbase = line_getlinenr(left->first);
00874         } else {
00875                 newsec->leftbase = 0;
00876         }
00877
00878         if (right != NULL) {
00879                 newsec->rightbase = line_getlinenr(right->first);
00880         } else {
00881                 newsec->rightbase = 0;
00882         }
00883
00884 } /* section_takesection */
00885
00886 /********************************************************************/
00887 /* Zebra striping                                                   */
00888 /********************************************************************/
00889 #ifdef trace
00890 static DWORD ZebraTicks = 0; /* total tick count spent hunting for zebras */
00891 #endif
00892
00893 typedef BYTE bitmap[32];   /* 256 bits.  address the ith bit as m[i/8] & (1<<i%8) */
00894
00895 /* MakeMap
00896    Turn a string into a bitmap showing its character usage.  ANSI only!
00897    The bit in the map is set if the corresponding character occurs
00898    at least once anywhere in the string.
00899 */
00900 void MakeMap(bitmap bm, LPSTR str)
00901 {   int i;
00902     for (i=0; i<32; ++i)  bm[i] = 0;   /* clear it (yeah, could use memset) */
00903     for (i=0; str[i]!='\0'; ++i)       /* for each char */
00904     {   UINT v = ((UINT)str[i]) & 0x000000ff;   /* 0..256, No negatives! */
00905         bm[v/8] = BYTE(bm[v/8] | (1<<v%8));
00906     }
00907 } /* MakeMap */
00908
00909 /* AndMaps
00910    Set the bit in res whenever the corresponding bit is set
00911    in both a and b
00912 */
00913 void AndMaps(bitmap res, bitmap a, bitmap b)
00914 {   int i;
00915     for (i=0; i<32; ++i)
00916         res[i] = (char)(a[i] & b[i]);
00917 }
00918
00919 /* OrMaps
00920    Set the bit in res whenever the corresponding bit is set
00921    in either a or b
00922 */
00923 void OrMaps(bitmap res, bitmap a, bitmap b)
00924 {   int i;
00925     for (i=0; i<32; ++i)
00926         res[i] = (char)(a[i] | b[i]);
00927 }
00928
00929 /* BitsInMap
00930    return the number of bits set on in bm
00931 */
00932 int BitsInMap(bitmap bm)
00933 {   int i;
00934     int j;
00935     int cb = 0;                  /* bit count */
00936
00937     for (i=0; i<32; ++i)         /* for each byte in bm */
00938     {  for( j=0; j<8; ++j)       /*    for each bit in byte */
00939        {  if (bm[i] & (1<<j))    /*    if the bit is set  */
00940               ++cb;
00941        }
00942     }
00943     return cb;
00944 } /* BitsInMap */
00945
00946 /*------------------------------------------------------------------------------
00947 |  Return TRUE iff left and right match fuzzily.
00948 |  Fuzzy matching is implemented as follows.
00949 |
00950 |  Create a bitmap with one bit for each character in the ANSI set.
00951 |  (This is 32 bytes long).  Clear it, and then OR in bits for each
00952 |  character actually found in string one and then do the same again
00953 |  for string two.
00954 |  AND the two bit maps to get the characters which occur in both lines and
00955 |  OR them to get the total number of different characters in either line.
00956 |  Count the number of bits in each and work off the ratio common/total.
00957 |  If this ratio exceeds a magic number of 3/4 then say they fuzzily match.
00958 |
00959 |  You've probably noticed that this is an application for
00960 |           COUNTING THE BITS IN A BYTE!
00961  -------------------------------------------------------------------------------*/
00962 BOOL LinesMatch(LINE Left, LINE Right)
00963 {   LPSTR LText = line_gettext(Left);
00964     LPSTR RText = line_gettext(Right);
00965     bitmap bmLeft;
00966     bitmap bmRight;
00967     bitmap bmBoth;
00968     bitmap bmEither;
00969     int nBoth;
00970     int nEither;
00971
00972     MakeMap(bmLeft, LText);
00973     MakeMap(bmRight, RText);
00974     AndMaps(bmBoth, bmLeft, bmRight);
00975     OrMaps(bmEither, bmLeft, bmRight);
00976     nBoth = BitsInMap(bmBoth);
00977     nEither = BitsInMap(bmEither);
00978
00979     return  (nBoth*4 >= nEither*3);    /* magic ratio is 3/4 */
00980 } /* LinesMatch */
00981
00982
00983 /*
00984  * add left and right sections to the comnposite list.  These sections
00985  * do not contain any matching lines, but do correspond, so here is
00986  * where we can do a fuzzy comparison and decide whether to zebra
00987  * them or not.
00988  *
00989  * If we retain the current structure of the composite list being a
00990  * list of sections rather than lines, then we might get rather a lot
00991  * of sections.  Do we care?  We need to build a new section here
00992  * for every line that we zebra, unpicking the old sections as we do it.
00993  *
00994  * At the moment it zebra stripes the lines as long as they keep
00995  * (fuzzily) matching.  Once there is a mismatch it takes the rest
00996  * as a block with no attempt to resynch until the next exact match.
00997  * We could be craftier, but I think we are already getting most of the
00998  * value from zebra striping.
00999  */
01000 void TakeTwoSections(LIST compo, SECTION left, SECTION right)
01001 {
01002         /* Algorithm:
01003            While there is something on each side,
01004               if the next lines match
01005               then take one line from each and make them into sections.
01006               else take everything that's left
01007            Finally take everything that's left (occurs if all matched until
01008                                                 one side ran out)
01009         */
01010
01011         SECTION NewL;
01012         SECTION NewR;
01013         LINE LLine = left->first;      /* first line left to process in left */
01014         LINE RLine = right->first;     /*   "    "    "   "   "      " right */
01015
01016 #ifdef trace
01017         DWORD Ticks = GetTickCount();  /* profiling */
01018 #endif
01019
01020         left->state = STATE_MARKED;
01021         right->state = STATE_MARKED;
01022
01023         while(left!=NULL && right !=NULL) {
01024
01025             if (LinesMatch(LLine, RLine)) {
01026                     NewL = section_new(LLine, LLine, compo);
01027                     NewL->state = STATE_SIMILARLEFT;
01028                     NewL->leftbase = line_getlinenr(LLine);
01029                     NewL->rightbase = line_getlinenr(RLine);
01030
01031                     NewR = section_new(RLine, RLine, compo);
01032                     NewR->state = STATE_SIMILARRIGHT;
01033                     NewR->leftbase = line_getlinenr(LLine);
01034                     NewR->rightbase = line_getlinenr(RLine);
01035
01036                     if (LLine == left->last) left = NULL;  /* done */
01037                     else LLine = (LINE)List_Next(LLine);
01038                     if (RLine == right->last) right = (SECTION)NULL;  /* done */
01039                     else RLine = (LINE)List_Next(RLine);
01040             } else {
01041                    /* lost synch - take all the rest with no more zebra stuff */
01042                     NewL = section_new(LLine, left->last, compo);
01043                     NewL->state = STATE_LEFTONLY;
01044                     NewL->leftbase = line_getlinenr(LLine);
01045                     NewL->rightbase = 0;
01046                     left = NULL;  /* done */
01047
01048                     NewR = section_new(RLine, right->last, compo);
01049                     NewR->state = STATE_RIGHTONLY;
01050                     NewR->rightbase = line_getlinenr(RLine);
01051                     NewR->leftbase = 0;
01052                     right = NULL;  /* done */
01053             }
01054         }
01055
01056         if (left!=NULL) {
01057             NewL = section_new(LLine, left->last, compo);
01058             NewL->state = STATE_LEFTONLY;
01059             NewL->leftbase = line_getlinenr(LLine);
01060             NewL->rightbase = 0;
01061         }
01062         if (right!=NULL) {
01063             NewR = section_new(RLine, right->last, compo);
01064             NewR->state = STATE_RIGHTONLY;
01065             NewR->rightbase = line_getlinenr(RLine);
01066             NewR->leftbase = 0;
01067         }
01068
01069 #ifdef trace
01070         Ticks = GetTickCount()-Ticks;
01071         ZebraTicks += Ticks;
01072         {   char Msg[80];
01073             StringCchPrintf(Msg, 80, "Zebra time %d, total zebra time %d\n", Ticks, ZebraTicks);
01074             Trace_File(Msg);
01075         }
01076 #endif
01077
01078 } /* TakeTwoSections */
01079
01080 /*
01081  * make a composite list of sections by traversing a list of sections.
01082  *
01083  * return a handle to a list of sections.
01084  *
01085  * during this, set state, leftbase and rightbase for sections.
01086  *
01087  * This function creates a list that corresponds to the 'best' view
01088  * of the differences between the two lists. We place sections from the
01089  * two lists into one composite list. sections that match each other are only
01090  * inserted once (from the right list). sections that match, but in different
01091  * positions in the two lists are inserted twice, once in each position, with
01092  * status to indicate this. unmatched sections are inserted in the correct
01093  * position.
01094  *
01095  * - take sections from the left list until the section is linked to one not
01096  *   already taken.
01097  * - then take sections from right until we find a section linked to one not
01098  *   already taken.
01099  * - if the two sections waiting are linked to each other, take them both
01100  *   (once- we take the right one and advance past both).
01101  *
01102  * - now we have to decide which to take in place and which to declare
01103  *   'moved'. consider the case where the only change is that the first line
01104  *   has been moved to the end. We should take the first line (as a move),
01105  *   then the bulk of the file (SAME) then the last line (as a move). Hence,
01106  *   in difficult cases, we take the smaller section first, to ensure that
01107  *   the larger section is taken as SAME.
01108  *
01109  *   to indicate which section has been output, we set the state field
01110  *   to STATE_MARKED once we have taken it.   States in left and right
01111  *   lists are of no further interest once we have built the composite.
01112  *
01113  *   Up to this point we have worked off the STATE of a section.  By now
01114  *   all the section links are in place, so we can use them too.
01115  */
01116 LIST
01117 section_makecomposite(LIST secsleft, LIST secsright)
01118 {
01119         SECTION left, right;
01120         LIST compo;
01121
01122         /* make an empty list for the composite */
01123         compo = List_Create();
01124
01125         left = (SECTION)List_First(secsleft);
01126         right = (SECTION)List_First(secsright);
01127
01128         while ( (left != NULL) || (right != NULL)) {
01129
01130                 if (left == NULL) {
01131                         /* no more in left list - take right section */
01132                         /* is it moved or just unmatched ? */
01133                         if (right->link == NULL) {
01134                                 section_takesection(compo, NULL, right, STATE_RIGHTONLY);
01135                                 right = (SECTION)List_Next(right);
01136                         } else {
01137                                 section_takesection(compo, right->link, right, STATE_MOVEDRIGHT);
01138                                 right = (SECTION)List_Next(right);
01139                         }
01140                 } else if (right == NULL) {
01141                         /* right list empty - must be left next */
01142
01143                         /* is it moved or just unmatched ? */
01144                         if (left->link == NULL) {
01145                                 section_takesection(compo, left, NULL, STATE_LEFTONLY);
01146                                 left = (SECTION)List_Next(left);
01147                         } else {
01148                                 section_takesection(compo, left, left->link, STATE_MOVEDLEFT);
01149                                 left = (SECTION)List_Next(left);
01150                         }
01151
01152                 } else if (left->state == STATE_LEFTONLY) {
01153                         /* unlinked section on left */
01154                         if (left->correspond==right) {
01155                             TakeTwoSections( compo, left, left->correspond );
01156                             left = (SECTION)List_Next(left);
01157                             right = (SECTION)List_Next(right);
01158                         } else {
01159                             /* see picture below for when this might occur */
01160                             section_takesection(compo, left, NULL, STATE_LEFTONLY);
01161                             left = (SECTION)List_Next(left);
01162                         }
01163
01164                 } else if (left->link==NULL) {
01165                         /* This is an ignorable blank section on the left.
01166                          * We ignore it. (We will take any such from the right)
01167                          */
01168                         left = (SECTION)List_Next(left);
01169
01170                 } else if (left->link->state==STATE_MARKED) {
01171                         /* left is linked to section that is already taken*/
01172                         section_takesection(compo, left, left->link, STATE_MOVEDLEFT);
01173                         left = (SECTION)List_Next(left);
01174
01175                 } else  if (right->link == NULL) {
01176                         /* take unlinked section on right
01177                          * Either unmatched or ignorable blanks
01178                          */
01179                         section_takesection(compo, NULL, right, right->state);
01180                         right = (SECTION)List_Next(right);
01181
01182                 } else if (right->link->state==STATE_MARKED) {
01183                         /* right is linked to section that's already taken */
01184                         section_takesection(compo, right->link, right, STATE_MOVEDRIGHT);
01185                         right = (SECTION)List_Next(right);
01186
01187                 } else if (left->link == right) {
01188                         /* sections match */
01189                         section_takesection(compo, left, right, STATE_SAME);
01190                         right = (SECTION)List_Next(right);
01191                         left = (SECTION)List_Next(left);
01192                 } else {
01193                         /* both sections linked to forward sections
01194                          * Original idea was to go by section size and
01195                          * take smallest first as a move so that larger one is
01196                          * unchanged.  Counter example is test file blanks2
01197                          *
01198                          *   Files     Good version    Not so good
01199                          *  A     A       A---A          A---A
01200                          *  B-   -A         ->A RR    LL B->
01201                          *  C | | A         ->A RR    LL C
01202                          *  D  -+-B       B---B       LL D
01203                          *  E   | c       C   c       LL E->
01204                          *  A---  d       D   d          A---A
01205                          *  A     E       E---E          A---A
01206                          *  A     A       A->              ->B
01207                          *  A             A->                c
01208                          *                A---A              d
01209                          *                A                ->E
01210                          *                               A---A
01211                          *                               A
01212                          *
01213                          * A better scheme looks at the distances marked
01214                          * above as RR and LL and take as moved the block that results
01215                          * in the shortest such distance.
01216                          * Let LeftDist = linenr(right->link) - linenr(left)
01217                          *       i.e. 5 in the example above  (the LL lines)
01218                          * Let RightDist = linenr(left->link) - linenr(right)
01219                          *       i.e. 3 in the example above  (the RR lines)
01220                          *
01221                          * if LeftDist > RightDist then treat right as moved
01222                          * and take it first.
01223                          */
01224                         if ( line_getlinenr(right->link->first) - line_getlinenr(left->first)
01225                            > line_getlinenr(left->link->first)  - line_getlinenr(right->first)
01226                            )
01227                         {
01228                                 section_takesection(compo, right->link, right, STATE_MOVEDRIGHT);
01229                                 right = (SECTION)List_Next(right);
01230                         } else {
01231                                 section_takesection(compo, left, left->link, STATE_MOVEDLEFT);
01232                                 left = (SECTION)List_Next(left);
01233                         }
01234
01235                 }
01236         }
01237
01238         return(compo);
01239 } /* section_makecomposite */
01240
01241 typedef LINE (APIENTRY * MOVEPROC)(LINE);
01242
01243 /* Update PLINE by making it point to the first non-blank
01244    at-or-after from but not after limit.
01245    If they are all blank then make it point to limit
01246    If from is non-blank then leave it alone.
01247    Return TRUE iff PLINE was updated.
01248    It is legit for limit to be NULL (meaning end of file).
01249 */
01250 BOOL AbsorbAnyBlanks(LINE * from, LINE limit, MOVEPROC Move)
01251 {       BOOL progress = FALSE;
01252
01253         while ( (from!=NULL)
01254               && (line_isblank(*from))
01255               && (*from!=limit)
01256               ) {
01257                 *from = Move(*from);
01258                 progress = TRUE;
01259         }
01260         return progress;
01261 } /* AbsorbAnyBlanks */
01262
01263
01264 /* given an anchor point (two lines that we think should match),
01265  * try to link them, and the lines above and below them for as long
01266  * as the lines can be linked (are the same, are unlinked).
01267  *
01268  * return TRUE if we make any links.
01269  *
01270  */
01271 BOOL
01272 section_expandanchor(SECTION sec1, LINE line1, SECTION sec2, LINE line2)
01273 {
01274         /* when a line is matched we set bChanges.  If we notice some
01275          * blank lines, but do NOT link any new non-blank lines, we
01276          * do NOT set bChanges.  (If we did it would cause a closed
01277          * loop as they would get noticed again next time.  line_link
01278          * only returns TRUE if it is a NEW link).
01279          * At this stage we are only interested in making links, not in
01280          * the size of the section that results (that fun comes later).
01281          * therefore trailing blanks at the end of a section are not
01282          * interesting and we don't look for them.
01283          */
01284         BOOL bChanges = FALSE;
01285         LINE left, right;
01286
01287         /* We handle the section limits by using a sentinel which is one
01288          * past the end of the section.  (If the section ends at the end
01289          * of the list then the sentinel is NULL).
01290          */
01291         LINE leftend, rightend;
01292         leftend = (LINE)List_Next(sec1->last);
01293         rightend = (LINE)List_Next(sec2->last);
01294
01295 #ifdef trace
01296         {       char msg[120];
01297                 StringCchPrintf( msg, 120, "expanding anchor at %d<->%d in sections %d..%d <-> %d..%d\r\n"
01298                         , line_getlinenr(line1)
01299                         , line_getlinenr(line2)
01300                         , line_getlinenr(sec1->first)
01301                         , line_getlinenr(sec1->last)
01302                         , line_getlinenr(sec2->first)
01303                         , line_getlinenr(sec2->last)
01304                         );
01305                 if (bTrace) Trace_File(msg);
01306         }
01307 #endif
01308
01309         /* null lines shall not match */
01310         if ((line1 == NULL) || (line2 == NULL)) {
01311                 return(FALSE);
01312         }
01313
01314         /* check all lines forward until fail to link (because null,
01315          * not matching, or already linked).
01316          * include the passed in anchor point since this has not
01317          * yet been linked.
01318          * If blanks are ignorable then skip over any number of whole
01319          * blank lines.
01320          */
01321         left = line1;
01322         right = line2;
01323         for (; ; ) {
01324                 if (line_link(left, right) ) {
01325
01326                         bChanges = TRUE;
01327                         left = (LINE)List_Next(left);
01328                         right = (LINE)List_Next(right);
01329                         if (left==leftend || right==rightend) break;
01330                 }
01331                 else if (ignore_blanks){
01332                         /* even though no match, maybe an ignorable blank? */
01333
01334                         BOOL moved = FALSE;
01335                         moved |= AbsorbAnyBlanks(&left, leftend, (MOVEPROC)List_Next);
01336                         moved |= AbsorbAnyBlanks(&right, rightend, (MOVEPROC)List_Next);
01337                         if (!moved) break; /* it didn't match and we didn't move on */
01338                         if (left==leftend || right==rightend) break;
01339                 }
01340                 else break;
01341         }
01342
01343 #ifdef trace
01344         {       char msg[120];
01345                 StringCchPrintf( msg, 120, "marched forwards to (the line before) %d<->%d\r\n"
01346                         , (left==NULL ? 9999 : line_getlinenr(left))
01347                         , (right==NULL ? 9999 : line_getlinenr(right))
01348                         );
01349                 if (bTrace) Trace_File(msg);
01350         }
01351 #endif
01352
01353         /* check all matches going backwards from anchor point
01354            but only if it was a real anchor  (could have been
01355            end-of-section/end-of-file and non-matching).
01356         */
01357         if (line_getlink(line1)==NULL) return bChanges;
01358
01359         left = (LINE)List_Prev(line1);
01360         right = (LINE)List_Prev(line2);
01361         if (left==NULL || right==NULL) return bChanges;
01362
01363         leftend = (LINE)List_Prev(sec1->first);
01364         rightend = (LINE)List_Prev(sec2->first);
01365
01366         for (; ; ) {
01367                 if (line_link(left, right)) {
01368
01369                         bChanges = TRUE;
01370                         left = (LINE)List_Prev(left);
01371                         right = (LINE)List_Prev(right);
01372                         if (left == leftend || right == rightend) break;
01373
01374                 }
01375                 else if (ignore_blanks){
01376                         /* even though no match, maybe an ignorable blank? */
01377
01378                         BOOL moved = FALSE;
01379                         moved |= AbsorbAnyBlanks(&left, leftend, (MOVEPROC)List_Prev);
01380                         moved |= AbsorbAnyBlanks(&right, rightend, (MOVEPROC)List_Prev);
01381                         if (!moved) break; /* it didn't match and we didn't move on */
01382                         if (left==leftend || right==rightend) break;
01383
01384                 }
01385                 else break;
01386         }
01387
01388 #ifdef trace
01389         {       char msg[120];
01390                 StringCchPrintf( msg, 120, "marched backwards to (the line after) %d<->%d\r\n"
01391                         , (left==NULL ? 0 : line_getlinenr(left))
01392                         , (right==NULL ? 0 : line_getlinenr(right))
01393                         );
01394                 if (bTrace) Trace_File(msg);
01395         }
01396 #endif
01397
01398         return(bChanges);
01399 }
01400
01401
01402 /*
01403  * build a ctree from the lines in the section given
01404  *
01405  * remember that we are only interested in the lines that are
01406  * not already linked.
01407  *
01408  * the value we store in the tree is the handle of the line. the key
01409  * is the line hash code
01410  */
01411 TREE
01412 section_makectree(SECTION sec)
01413 {
01414         TREE tree;
01415         LINE line;
01416
01417         /* make an empty tree */
01418         tree = ctree_create();
01419
01420         for (line = sec->first; line != NULL; line = (LINE)List_Next(line)) {
01421                 if (line_getlink(line) == NULL) {
01422                         ctree_update(tree, line_gethashcode(line),
01423                                         &line, sizeof(LINE));
01424                 }
01425                 if (line == sec->last) {
01426                         break;
01427                 }
01428         }
01429         return(tree);
01430 }
01431
01432
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/Surrog/cfWrap.Cpp Source File

  • Com
  • Fundamentals
  • CustomSurrogate
  • Surrog

cfWrap.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /////////////////////////////////////////////////////////////////////////////////////////
00019 //
00020 // CFWrap.cpp
00021 //
00022 // CClassFactoryWrapper implementation.  This is a class factory object that we register
00023 // on behalf of the inproc object.  This way, creation of the object comes through this
00024 // object and we can do whatever is appropriate.  It needs to support IUknown,
00025 // IClassFactory and IMarshal.  If the client calls CoGetClassObject() for the inproc
00026 // object's CLSID, then our class factory object will be marshaled remotely to be
00027 // given to the client.  If the client is asking for something other than IClassFactory
00028 // from the class factory object, then we won't be able to support it and therefore will
00029 // have to defer to the real class factory object of the inproc server.  That's why,
00030 // when our class factory object is marshaled via IMarshal::MarshalInterface(), we
00031 // simply CoGetClassObject() for the inproc CLSID and marshal it using CLSID_StdMarhal.
00032 //
00033 /////////////////////////////////////////////////////////////////////////////////////////
00034
00035 #include "common.h"
00036 #include "cfwrap.h"
00037
00038 CClassFactoryWrapper::CClassFactoryWrapper(REFCLSID rclsid) : m_cRef(0)
00039 {
00040   m_clsid = rclsid;
00041 }
00042
00043 CClassFactoryWrapper::~CClassFactoryWrapper() {}
00044
00045 // IUnknown
00046
00047 STDMETHODIMP CClassFactoryWrapper::QueryInterface(REFIID riid, void **ppv)
00048 {
00049   *ppv = 0;
00050   if (riid == IID_IUnknown || riid == IID_IClassFactory)
00051     *ppv = (IClassFactory *) this;
00052   else if (riid == IID_IMarshal)
00053     *ppv = (IMarshal*) this;
00054   else
00055     return E_NOINTERFACE;
00056   ((IUnknown*) *ppv)->AddRef();
00057   return S_OK;
00058 }
00059
00060 STDMETHODIMP_(ULONG) CClassFactoryWrapper::AddRef()
00061 {
00062   return InterlockedIncrement(&m_cRef);
00063 }
00064
00065 STDMETHODIMP_(ULONG) CClassFactoryWrapper::Release()
00066 {
00067   ULONG result = InterlockedDecrement(&m_cRef);
00068   if (!result)
00069     delete this;
00070   return result;
00071 }
00072
00073 // IClassFactory
00074
00075 //
00076 // IClassFactory::CreateInstance() -
00077 //
00078 // Create the inproc object directly and return it's interface pointer.
00079 //
00080 STDMETHODIMP CClassFactoryWrapper::CreateInstance(IUnknown* pUnkOuter, REFIID riid, void **ppv)
00081 {
00082   OutputDebugString("Creating Inproc Object...");
00083   return CoCreateInstance(m_clsid, pUnkOuter, CLSCTX_INPROC_SERVER, riid, ppv);
00084 }
00085
00086 //
00087 // IClassFactory::LockServer()
00088 //
00089 STDMETHODIMP CClassFactoryWrapper::LockServer(BOOL fLock)
00090 {
00091   return S_OK;
00092 }
00093
00094 // IMarshal
00095
00096 //
00097 // IMarshal::GetUnmarshalClass() -
00098 //
00099 // COM is marshaling the class factory wrapper object to the client. It needs the CLSID
00100 // of the object on the client side that will do the unmarshaling.  We return the standard
00101 // marshaler since we use it to marshal in IMarshal::MarshalInterface().
00102 //
00103 STDMETHODIMP CClassFactoryWrapper::GetUnmarshalClass(REFIID riid, void *pv, DWORD dwDstCtx,
00104                            void *pvDstCtx, DWORD flags, CLSID *pCid)
00105 {
00106   OutputDebugString("IMarshal::GetUnmarshalClass() returning CLSID_StdMarshal.");
00107   *pCid = CLSID_StdMarshal;
00108   return S_OK;
00109 }
00110
00111 //
00112 // IMarshal::GetMarshalSizeMax()
00113 //
00114 STDMETHODIMP CClassFactoryWrapper::GetMarshalSizeMax(REFIID riid, void *pv, DWORD dwDstCtx,
00115                            void *pvDstCtx, DWORD flags, DWORD *pSize)
00116 {
00117   return E_UNEXPECTED;
00118 }
00119
00120 //
00121 // IMarshal::MarshalInterface() -
00122 //
00123 // As described in the module prolog, if we're being marshaled out of proc, we defer to
00124 // the actual inproc class factory.  We don't know what interface may be requested and
00125 // therefore give up control of creation.
00126 //
00127 STDMETHODIMP CClassFactoryWrapper::MarshalInterface(IStream *pStm, REFIID riid, void *pv,
00128                           DWORD dwDstCtx, void *pvDstCtx, DWORD flags)
00129 {
00130   // return a marshaled interface pointer to the inproc
00131   // object's class factory object. marshal into the stream pStm
00132
00133   OutputDebugString("IMarshal::MarhsalInterface() called.");
00134   IUnknown *pUnk = 0;
00135   HRESULT hr = CoGetClassObject(m_clsid, CLSCTX_INPROC_SERVER, 0, IID_IUnknown,
00136                   (LPVOID*) &pUnk);
00137
00138   if (SUCCEEDED(hr))
00139   {
00140     // marshal the class factory object pUnk using the standard marshaler
00141     hr = CoMarshalInterface(pStm, riid, pUnk, dwDstCtx, pvDstCtx, flags);
00142     pUnk->Release();
00143   }
00144   return hr;
00145 }
00146
00147 //
00148 // IMarshal::UnmarshalInterface()
00149 //
00150 STDMETHODIMP CClassFactoryWrapper::UnmarshalInterface(IStream *pStm, REFIID riid, void **ppv)
00151 {
00152   return E_UNEXPECTED;
00153 }
00154
00155 //
00156 // IMarshal::ReleaseMarshalData() -
00157 //
00158 //
00159 // Release the stream we used to marshal the inproc object's class factory object.
00160 //
00161 STDMETHODIMP CClassFactoryWrapper::ReleaseMarshalData(IStream* pStm)
00162 {
00163   OutputDebugString("IMarshal::ReleaseMarshalData() called.");
00164   return CoReleaseMarshalData(pStm);
00165 }
00166
00167 //
00168 // IMarshal::DisconnectObject()
00169 //
00170 STDMETHODIMP CClassFactoryWrapper::DisconnectObject(DWORD dwReserved)
00171 {
00172   return S_OK;
00173 }
00174
00175
00176
00177
00178
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step2/HelloWorld.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step2

HelloWorld.cpp

Go to the documentation of this file.
00001 // HelloWorld.cpp : Implementation of CADsFirstExtApp and DLL registration.
00002
00003 #include "stdafx.h"
00004 #include "ADsFirstExt.h"
00005 #include "HelloWorld.h"
00006
00007
00008 /////////////////////////////////////////////////////////////////////////////
00009 // Constructor/Destructor
00010 /////////////////////////////////////////////////////////////////////////////
00011 HelloWorld::HelloWorld()
00012 {
00013   HRESULT hr;
00014   ITypeLib   *pITypeLib;
00015   m_pTypeInfo = NULL;
00016   hr = LoadRegTypeLib( LIBID_ADSFIRSTEXTLib,
00017                               1,
00018                               0,
00019                               PRIMARYLANGID(GetSystemDefaultLCID()),
00020                               &pITypeLib );
00021   if ( SUCCEEDED(hr) )
00022   {
00023
00024     hr   = pITypeLib->GetTypeInfoOfGuid( IID_IHelloWorld, &m_pTypeInfo);
00025   }
00026
00027   pITypeLib->Release();
00028
00029 }
00030
00031 HelloWorld::~HelloWorld()
00032 {
00033   if ( m_pTypeInfo )
00034   {
00035     m_pTypeInfo->Release();
00036   }
00037
00038 }
00039
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // InterfaceSupportsErrorInfo
00043 /////////////////////////////////////////////////////////////////////////////
00044 STDMETHODIMP HelloWorld::InterfaceSupportsErrorInfo(REFIID riid)
00045 {
00046   static const IID* arr[] =
00047   {
00048     &IID_IHelloWorld,
00049   };
00050
00051   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00052   {
00053     if (::InlineIsEqualGUID(*arr[i],riid))
00054       return S_OK;
00055   }
00056   return S_FALSE;
00057 }
00058
00059
00060
00061 ////////////////////////////////////////////////////
00062 // Delegating IDispatch Methods to the aggregator
00063 //////////////////////////////////////////////////////
00064 STDMETHODIMP HelloWorld::GetTypeInfoCount(UINT* pctinfo)
00065 {
00066    IDispatch *pDisp;
00067    HRESULT    hr;
00068    hr = OuterQueryInterface( IID_IDispatch, (void**) &pDisp );
00069    if ( SUCCEEDED(hr) )
00070    {
00071      hr = pDisp->GetTypeInfoCount( pctinfo );
00072      pDisp->Release();
00073    }
00074    return hr;
00075 }
00076
00077
00078 STDMETHODIMP HelloWorld::GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo)
00079 {
00080    IDispatch *pDisp;
00081    HRESULT    hr;
00082    hr = OuterQueryInterface( IID_IDispatch, (void**) &pDisp );
00083    if ( SUCCEEDED(hr) )
00084    {
00085      hr = pDisp->GetTypeInfo( itinfo, lcid, pptinfo );
00086      pDisp->Release();
00087    }
00088
00089    return hr;
00090 }
00091
00092 STDMETHODIMP HelloWorld::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames,
00093     LCID lcid, DISPID* rgdispid)
00094 {
00095    IDispatch *pDisp;
00096    HRESULT    hr;
00097    hr = OuterQueryInterface( IID_IDispatch, (void**) &pDisp );
00098    if ( SUCCEEDED(hr) )
00099    {
00100      hr = pDisp->GetIDsOfNames( riid, rgszNames, cNames, lcid, rgdispid);
00101      pDisp->Release();
00102    }
00103
00104    return hr;
00105
00106 }
00107
00108 STDMETHODIMP HelloWorld::Invoke(DISPID dispidMember, REFIID riid,
00109     LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
00110     EXCEPINFO* pexcepinfo, UINT* puArgErr)
00111 {
00112    IDispatch *pDisp;
00113    HRESULT    hr;
00114    hr = OuterQueryInterface( IID_IDispatch, (void**) &pDisp );
00115    if ( SUCCEEDED(hr) )
00116    {
00117      hr = pDisp->Invoke( dispidMember, riid, lcid, wFlags, pdispparams, pvarResult,
00118                        pexcepinfo, puArgErr);
00119      pDisp->Release();
00120    }
00121
00122    return hr;
00123 }
00124
00125 ///////////////////////////////////////////////////////////////////////////////
00126 // End delegating IDispatch Methods
00127 ///////////////////////////////////////////////////////////////////////////////
00128
00129
00130
00131 STDMETHODIMP HelloWorld::Say()
00132 {
00133   AFX_MANAGE_STATE(AfxGetStaticModuleState())
00134
00135   IADs *pADs;
00136   HRESULT hr;
00137   BSTR    bstr;
00138   TCHAR  szText[128];
00139
00140
00141
00142   hr = OuterQueryInterface(IID_IADs, (void **) &pADs );
00143   if ( !SUCCEEDED(hr) )
00144   {
00145     return hr;
00146   }
00147
00148   hr = pADs->get_Name(&bstr);
00149   if ( !SUCCEEDED(hr) )
00150   {
00151     pADs->Release();
00152     return hr;
00153   }
00154
00155
00156     ////////////////////////////////////////
00157   // Check for buffer overrun.
00158   UINT nMaxLen = sizeof(szText)/sizeof(TCHAR);
00159   UINT nLength = SysStringLen(bstr);
00160   TCHAR  szHelloFmt[] = _T("Hello %S");
00161   UINT fmtLen = sizeof(szHelloFmt)/sizeof(TCHAR);
00162
00163   if ( nMaxLen <= (nLength+fmtLen) )
00164   {
00165     _tcscpy(szText,_T("Your string is too long"));
00166
00167   }
00168   else
00169   {
00170     wsprintf(szText, _T("Hello %S"), bstr );
00171   }
00172
00173
00174   SysFreeString(bstr);
00175
00176
00177   ::MessageBox(NULL, szText, _T("From ADSI Extension"), MB_OK);
00178   pADs->Release();
00179
00180   return S_OK;
00181 }
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/people.Cpp Source File

  • SysMgmt
  • MMC
  • Toolbar

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "People.h"
00021
00022 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00025 const GUID CSkateboardFolder::thisGuid = { 0xef163733, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00026 const GUID CIceSkateFolder::thisGuid = { 0xf6c660b0, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00027
00028 const GUID CBicycle::thisGuid = { 0xef163734, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00029 const GUID CSkateboard::thisGuid = { 0xef163735, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00030 const GUID CIceSkate::thisGuid = { 0xf6c660b1, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00031
00032
00033 //==============================================================
00034 //
00035 // CPeoplePoweredVehicle implementation
00036 //
00037 //
00038 CPeoplePoweredVehicle::CPeoplePoweredVehicle(CComponentData *pComponentData)
00039 {
00040     m_pComponentData = pComponentData;
00041
00042     children[0] = new CBicycleFolder;
00043     children[1] = new CSkateboardFolder;
00044     children[2] = new CIceSkateFolder;
00045 }
00046
00047 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00048 {
00049     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00050         delete children[n];
00051 }
00052
00053 HRESULT CPeoplePoweredVehicle::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00054 {
00055     SCOPEDATAITEM sdi;
00056
00057     if (!bExpanded) {
00058         // create the child nodes, then expand them
00059         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00060             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00061             sdi.mask = SDI_STR       |   // Displayname is valid
00062                 SDI_PARAM     |   // lParam is valid
00063                 SDI_IMAGE     |   // nImage is valid
00064                 SDI_OPENIMAGE |   // nOpenImage is valid
00065                 SDI_PARENT    |   // relativeID is valid
00066                 SDI_CHILDREN;     // cChildren is valid
00067
00068             sdi.relativeID  = (HSCOPEITEM)parent;
00069             sdi.nImage      = children[n]->GetBitmapIndex();
00070             sdi.nOpenImage  = INDEX_OPENFOLDER;
00071             sdi.displayname = MMC_CALLBACK;
00072             sdi.lParam      = (LPARAM)children[n];       // The cookie
00073             sdi.cChildren   = 0;
00074
00075             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00076
00077             _ASSERT( SUCCEEDED(hr) );
00078         }
00079     }
00080
00081     return S_OK;
00082 }
00083
00084 CBicycleFolder::CBicycleFolder()
00085 {
00086     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00087         children[n] = new CBicycle(n + 1);
00088     }
00089 }
00090
00091 CBicycleFolder::~CBicycleFolder()
00092 {
00093     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00094         if (children[n]) {
00095             delete children[n];
00096         }
00097 }
00098
00099 HRESULT CBicycleFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00100 {
00101     HRESULT      hr = S_OK;
00102
00103     IHeaderCtrl *pHeaderCtrl = NULL;
00104     IResultData *pResultData = NULL;
00105
00106     if (bShow) {
00107         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00108         _ASSERT( SUCCEEDED(hr) );
00109
00110         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00111         _ASSERT( SUCCEEDED(hr) );
00112
00113         // Set the column headers in the results pane
00114         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00115         _ASSERT( S_OK == hr );
00116
00117         // insert items here
00118         RESULTDATAITEM rdi;
00119
00120         hr = pResultData->DeleteAllRsltItems();
00121         _ASSERT( SUCCEEDED(hr) );
00122
00123         if (!bExpanded) {
00124             // create the child nodes, then expand them
00125             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00126                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00127                 rdi.mask       = RDI_STR       |   // Displayname is valid
00128                     RDI_IMAGE     |
00129                     RDI_PARAM;        // nImage is valid
00130
00131                 rdi.nImage      = children[n]->GetBitmapIndex();
00132                 rdi.str         = MMC_CALLBACK;
00133                 rdi.nCol        = 0;
00134                 rdi.lParam      = (LPARAM)children[n];
00135
00136                 hr = pResultData->InsertItem( &rdi );
00137
00138                 _ASSERT( SUCCEEDED(hr) );
00139             }
00140         }
00141
00142         pHeaderCtrl->Release();
00143         pResultData->Release();
00144     }
00145
00146     return hr;
00147 }
00148
00149 CIceSkateFolder::CIceSkateFolder()
00150 {
00151     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00152         children[n] = new CIceSkate(n + 1);
00153     }
00154 }
00155
00156 CIceSkateFolder::~CIceSkateFolder()
00157 {
00158     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00159         if (children[n]) {
00160             delete children[n];
00161         }
00162 }
00163
00164 HRESULT CIceSkateFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00165 {
00166     HRESULT      hr = S_OK;
00167
00168     IHeaderCtrl *pHeaderCtrl = NULL;
00169     IResultData *pResultData = NULL;
00170
00171     if (bShow) {
00172         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00173         _ASSERT( SUCCEEDED(hr) );
00174
00175         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00176         _ASSERT( SUCCEEDED(hr) );
00177
00178         // Set the column headers in the results pane
00179         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00180         _ASSERT( S_OK == hr );
00181
00182         // insert items here
00183         RESULTDATAITEM rdi;
00184
00185         hr = pResultData->DeleteAllRsltItems();
00186         _ASSERT( SUCCEEDED(hr) );
00187
00188         if (!bExpanded) {
00189             // create the child nodes, then expand them
00190             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00191                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00192                 rdi.mask       = RDI_STR       |   // Displayname is valid
00193                     RDI_IMAGE     |
00194                     RDI_PARAM;        // nImage is valid
00195
00196                 rdi.nImage      = children[n]->GetBitmapIndex();
00197                 rdi.str         = MMC_CALLBACK;
00198                 rdi.nCol        = 0;
00199                 rdi.lParam      = (LPARAM)children[n];
00200
00201                 hr = pResultData->InsertItem( &rdi );
00202
00203                 _ASSERT( SUCCEEDED(hr) );
00204             }
00205         }
00206
00207         pHeaderCtrl->Release();
00208         pResultData->Release();
00209     }
00210
00211     return hr;
00212 }
00213
00214 CSkateboardFolder::CSkateboardFolder()
00215 {
00216     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00217         children[n] = new CSkateboard(n + 1);
00218     }
00219 }
00220
00221 CSkateboardFolder::~CSkateboardFolder()
00222 {
00223     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00224         if (children[n]) {
00225             delete children[n];
00226         }
00227 }
00228
00229 HRESULT CSkateboardFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00230 {
00231     HRESULT      hr = S_OK;
00232
00233     IHeaderCtrl *pHeaderCtrl = NULL;
00234     IResultData *pResultData = NULL;
00235
00236     if (bShow) {
00237         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00238         _ASSERT( SUCCEEDED(hr) );
00239
00240         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00241         _ASSERT( SUCCEEDED(hr) );
00242
00243         // Set the column headers in the results pane
00244         hr = pHeaderCtrl->InsertColumn( 0, L"Name                      ", 0, MMCLV_AUTO );
00245         _ASSERT( S_OK == hr );
00246
00247         // insert items here
00248         RESULTDATAITEM rdi;
00249
00250         hr = pResultData->DeleteAllRsltItems();
00251         _ASSERT( SUCCEEDED(hr) );
00252
00253         if (!bExpanded) {
00254             // create the child nodes, then expand them
00255             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00256                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00257                 rdi.mask       = RDI_STR       |   // Displayname is valid
00258                     RDI_IMAGE     |
00259                     RDI_PARAM;        // nImage is valid
00260
00261                 rdi.nImage      = children[n]->GetBitmapIndex();
00262                 rdi.str         = MMC_CALLBACK;
00263                 rdi.nCol        = 0;
00264                 rdi.lParam      = (LPARAM)children[n];
00265
00266                 hr = pResultData->InsertItem( &rdi );
00267
00268                 _ASSERT( SUCCEEDED(hr) );
00269             }
00270         }
00271
00272         pHeaderCtrl->Release();
00273         pResultData->Release();
00274     }
00275
00276     return hr;
00277 }
00278
00279 const _TCHAR *CBicycle::GetDisplayName(int nCol)
00280 {
00281     static _TCHAR buf[128];
00282
00283     _stprintf(buf, _T("Bicycle #%d"), id);
00284
00285     return buf;
00286 }
00287
00288 const _TCHAR *CSkateboard::GetDisplayName(int nCol)
00289 {
00290     static _TCHAR buf[128];
00291
00292     _stprintf(buf, _T("Skateboard #%d"), id);
00293
00294     return buf;
00295 }
00296
00297 const _TCHAR *CIceSkate::GetDisplayName(int nCol)
00298 {
00299     static _TCHAR buf[128];
00300
00301     _stprintf(buf, _T("Ice Skate #%d"), id);
00302
00303     return buf;
00304 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MSMQTest/MSMQTest.c Source File

  • NetDS
  • MessageQueuing
  • MSMQTest

MSMQTest.c

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012
00013 //
00014 // Includes
00015 //
00016 #include <stdio.h>
00017 #include <windows.h>
00018
00019
00020 //
00021 // Unique include file for MSMQ applications
00022 //
00023 #include <mq.h>
00024
00025
00026 //
00027 // Various defines
00028 //
00029 #define MAX_VAR       20
00030 #define MAX_FORMAT   300
00031 #define MAX_BUFFER   500
00032
00033 #define DIRECT         1
00034 #define STANDARD       0
00035
00036 #define DS_ENABLED     1
00037 #define DS_DISABLED    0
00038
00039
00040 //
00041 // GUID created with the tool "GUIDGEN"
00042 //
00043 static CLSID guidMQTestType =
00044 { 0xc30e0960, 0xa2c0, 0x11cf, { 0x97, 0x85, 0x0, 0x60, 0x8c, 0xb3, 0xe8, 0xc } };
00045
00046
00047 //
00048 // Prototypes
00049 //
00050 void Error(char *s, HRESULT hr);
00051 void Syntax();
00052
00053
00054 char mbsMachineName[MAX_COMPUTERNAME_LENGTH + 1];
00055
00056
00057 //-----------------------------------------------------
00058 //
00059 // Check whether the local computer is enabled to access
00060 // the directory service (DS-enabled).
00061 //
00062 //-----------------------------------------------------
00063 int DetectDsConnection(void)
00064 {
00065
00066     MQPRIVATEPROPS PrivateProps;
00067     QMPROPID       aPropId[MAX_VAR];
00068     MQPROPVARIANT  aPropVar[MAX_VAR];
00069     HRESULT        aStatus[MAX_VAR];
00070
00071     DWORD          cProp;
00072
00073     HRESULT        hr;
00074
00075
00076     //
00077     // Specify the PROPID_PC_DS_ENABLED property, which
00078   // indicates whether the local computer can access the DS.
00079     //
00080     cProp = 0;
00081
00082     aPropId[cProp] = PROPID_PC_DS_ENABLED;
00083     aPropVar[cProp].vt = VT_NULL;
00084     ++cProp;
00085
00086     // Create a PRIVATEPROPS structure.
00087     PrivateProps.cProp = cProp;
00088   PrivateProps.aPropID = aPropId;
00089   PrivateProps.aPropVar = aPropVar;
00090     PrivateProps.aStatus = aStatus;
00091     //
00092     // Retrieve the information.
00093     //
00094   hr = MQGetPrivateComputerInformation(
00095              NULL,
00096            &PrivateProps);
00097   if(FAILED(hr))
00098   {
00099         Error("A DS connection cannot be detected", hr);
00100     }
00101
00102
00103     if(PrivateProps.aPropVar[0].boolVal == 0)
00104         return DS_DISABLED;
00105
00106
00107     return DS_ENABLED;
00108 }
00109
00110
00111 //-----------------------------------------------------
00112 //
00113 //  Allow a DS-enabled client to connect with a
00114 //  DS-disabled one.
00115 //
00116 //-----------------------------------------------------
00117 int SetConnectionMode(void)
00118 {
00119
00120     char cDirectMode;
00121     int iRes;
00122
00123     //
00124     // If the local computer is in a domain and not in workgroup mode,
00125     // we have two cases:
00126     //   1. Other side is a computer operating in domain mode.
00127     //   2. Other side is a computer operating in workgroup mode.
00128     //
00129
00130     if(DetectDsConnection() == DS_ENABLED)
00131     {
00132             printf("Do you want to connect to a DS-disabled client (y or n) ? ");
00133       iRes = scanf("%c", &cDirectMode);
00134       if (iRes == 0 || iRes == EOF)
00135       {
00136         printf("\nInvalid input.\n");
00137         exit(1);
00138       }
00139
00140       //
00141       // Flushing stdin to get rid of the new line entered earlier.
00142       //
00143       fflush(stdin);
00144
00145             switch(tolower(cDirectMode))
00146             {
00147                 case 'y':
00148                     return DIRECT;
00149
00150                 case 'n':
00151                     return STANDARD;
00152
00153                 default:
00154                     printf("Bye.\n");
00155                     exit(1);
00156             }
00157
00158     }
00159
00160
00161     return DIRECT;     // Local computer is DS-disabled
00162 }
00163
00164
00165 //--------------------------------------------------------
00166 //
00167 // Receiver Mode
00168 // -------------
00169 // The receiver side does the following:
00170 //    1. Creates a queue on the local computer
00171 //       of type "guidMQTestType".
00172 //       The queue is either public or private, depending
00173 //       on the connection we want to establish.
00174 //    2. Opens the queue.
00175 //    3. In a loop,
00176 //          receives messages
00177 //          and prints the message body and message label.
00178 //    4. Cleans up handles.
00179 //    5. Deletes the queue from the directory service.
00180 //
00181 //--------------------------------------------------------
00182 void Receiver(int dDirectMode)
00183 {
00184
00185     MQQUEUEPROPS  qprops;
00186     MQMSGPROPS    msgprops;
00187     MQPROPVARIANT aPropVar[MAX_VAR];
00188     QUEUEPROPID   aqPropId[MAX_VAR];
00189     MSGPROPID     amPropId[MAX_VAR];
00190     DWORD         cProps;
00191
00192     WCHAR         wcsFormat[MAX_FORMAT];
00193
00194     UCHAR         Buffer[MAX_BUFFER];
00195     WCHAR         wcsMsgLabel[MQ_MAX_MSG_LABEL_LEN];
00196     WCHAR         wcsPathName[MAX_FORMAT];
00197
00198
00199     DWORD         dwNumChars;
00200     QUEUEHANDLE   qh;
00201
00202     HRESULT       hr;
00203   int       nPos;
00204
00205     printf("\nReceiver Mode on Machine: %s\n\n", mbsMachineName);
00206
00207
00208     //
00209     // Set properties to create a queue on the local computer.
00210     //
00211     cProps = 0;
00212
00213     // Set the path name.
00214     if(dDirectMode == DIRECT)  // Private queue path name
00215     {
00216     nPos = _snwprintf(wcsPathName, MAX_FORMAT - 1, L"%S\\private$\\MSMQTest", mbsMachineName);
00217     if(nPos < 0)
00218     {
00219       printf("The path name is too long for the buffer. Exiting...\n");
00220       exit(1);
00221     }
00222     wcsPathName[nPos] = L'\0';
00223
00224     }
00225     else                       // Public queue path name
00226     {
00227     nPos = _snwprintf(wcsPathName, MAX_FORMAT - 1, L"%S\\MSMQTest", mbsMachineName);
00228     if(nPos < 0)
00229     {
00230       printf("The path name is too long for the buffer. Exiting...\n");
00231       exit(1);
00232     }
00233     wcsPathName[nPos] = L'\0';
00234
00235     }
00236
00237     aqPropId[cProps]         = PROPID_Q_PATHNAME;
00238     aPropVar[cProps].vt      = VT_LPWSTR;
00239     aPropVar[cProps].pwszVal = wcsPathName;
00240     cProps++;
00241
00242     // Specify the service type GUID of the queue.
00243     // (This property will be used to locate all the queues of this type.)
00244     aqPropId[cProps]         = PROPID_Q_TYPE;
00245     aPropVar[cProps].vt      = VT_CLSID;
00246     aPropVar[cProps].puuid   = &guidMQTestType;
00247     cProps++;
00248
00249     // Add a descriptive label to the queue.
00250     // (A label is useful for administration through the MSMQ admin tools.)
00251     aqPropId[cProps]         = PROPID_Q_LABEL;
00252     aPropVar[cProps].vt      = VT_LPWSTR;
00253     aPropVar[cProps].pwszVal = L"Sample application of MSMQ SDK";
00254     cProps++;
00255
00256     // Create a QUEUEPROPS structure.
00257     qprops.cProp    = cProps;
00258     qprops.aPropID  = aqPropId;
00259     qprops.aPropVar = aPropVar;
00260     qprops.aStatus  = 0;
00261
00262
00263     //
00264     // Create the queue.
00265     //
00266     dwNumChars = MAX_FORMAT;
00267     hr = MQCreateQueue(
00268             NULL,           // IN:     Default security
00269             &qprops,        // IN/OUT: Queue properties
00270             wcsFormat,      // OUT:    Format name
00271             &dwNumChars);   // IN/OUT: Size of the format name
00272
00273     if (FAILED(hr))
00274     {
00275         //
00276         // API failed, but not because the queue exists.
00277         //
00278         if (hr != MQ_ERROR_QUEUE_EXISTS)
00279             Error("MQCreateQueue failed", hr);
00280
00281         //
00282         // The queue exist, so get its format name.
00283         //
00284         printf("The queue already exists. Open it anyway.\n");
00285
00286         if(dDirectMode == DIRECT)
00287         // It's a private queue, so we know its direct format name.
00288         {
00289       int n = _snwprintf(wcsFormat, MAX_FORMAT - 1, L"DIRECT=OS:%s", wcsPathName);
00290       if(n < 0)
00291       {
00292         printf("The format name is too long for the buffer. Exiting...\n");
00293         exit(1);
00294       }
00295       wcsFormat[n] = L'\0';
00296
00297         }
00298         else
00299         // It's a public queue, so we must get its format name from the DS.
00300         {
00301             dwNumChars = MAX_FORMAT;
00302             hr = MQPathNameToFormatName(
00303                        wcsPathName,     // IN:     Queue path name
00304                        wcsFormat,       // OUT:    Format name
00305                        &dwNumChars);    // IN/OUT: Size of the format name
00306
00307             if (FAILED(hr))
00308                 Error("The format name cannot be retrieved", hr);
00309         }
00310     }
00311
00312
00313     //
00314     // Open the queue with receive access.
00315     //
00316     hr = MQOpenQueue(
00317              wcsFormat,          // IN:  Queue format name
00318              MQ_RECEIVE_ACCESS,  // IN:  Want to receive from queue
00319              0,                  // IN:  Allow sharing
00320              &qh);               // OUT: Handle of open queue
00321
00322     //
00323     // Things are a little bit tricky. MQCreateQueue succeeded, but in the
00324     // case of a public queue, this does not mean that MQOpenQueue
00325     // will succeed, because replication delays are possible. The queue is
00326     // registered in the DS, but it might take a replication interval
00327     // until the replica reaches the server that I am connected to.
00328     // To overcome this, open the queue in a loop.
00329     //
00330     // In this specific case, this can happen only if this program
00331     // is run on an MSMQ 1.0 backup server controller (BSC) or on
00332     // a client connected to a BSC.
00333     // To be totally on the safe side, we should have put some code
00334     // to exit the loop after a few retries, but this is just a sample.
00335     //
00336     while (hr == MQ_ERROR_QUEUE_NOT_FOUND)
00337     {
00338        printf(".");
00339
00340        // Wait a bit.
00341        Sleep(500);
00342
00343        // Retry.
00344        hr = MQOpenQueue(wcsFormat, MQ_RECEIVE_ACCESS, 0, &qh);
00345     }
00346
00347     if (FAILED(hr))
00348          Error("The queue cannot be opened", hr);
00349
00350
00351     //
00352     // Main receiver loop
00353     //
00354     if(dDirectMode == DIRECT)
00355     {
00356         printf("\n* Working in workgroup (direct) mode.\n");
00357     }
00358     printf("\n* Waiting for messages...\n");
00359
00360     for(;;)
00361     {
00362         //
00363         // Set the message properties for reading messages.
00364         //
00365         cProps = 0;
00366
00367         // Ask for the body of the message.
00368         amPropId[cProps]            = PROPID_M_BODY;
00369         aPropVar[cProps].vt         = VT_UI1 | VT_VECTOR;
00370         aPropVar[cProps].caub.cElems = sizeof(Buffer);
00371         aPropVar[cProps].caub.pElems = Buffer;
00372         cProps++;
00373
00374         // Ask for the label of the message.
00375         amPropId[cProps]         = PROPID_M_LABEL;
00376         aPropVar[cProps].vt      = VT_LPWSTR;
00377         aPropVar[cProps].pwszVal = wcsMsgLabel;
00378         cProps++;
00379
00380         // Ask for the length of the label of the message.
00381         amPropId[cProps]         = PROPID_M_LABEL_LEN;
00382         aPropVar[cProps].vt      = VT_UI4;
00383         aPropVar[cProps].ulVal   = MQ_MAX_MSG_LABEL_LEN;
00384         cProps++;
00385
00386         // Create a MSGPROPS structure.
00387         msgprops.cProp    = cProps;
00388         msgprops.aPropID  = amPropId;
00389         msgprops.aPropVar = aPropVar;
00390         msgprops.aStatus  = 0;
00391
00392
00393         //
00394         // Receive the message.
00395         //
00396         hr = MQReceiveMessage(
00397                qh,                // IN:     Queue handle
00398                INFINITE,          // IN:     Time-out
00399                MQ_ACTION_RECEIVE, // IN:     Read operation
00400                &msgprops,         // IN/OUT: Message properties to retrieve
00401                NULL,              // IN/OUT: No OVERLAPPED structure
00402                NULL,              // IN:     No callback
00403                NULL,              // IN:     No cursor
00404                NULL);             // IN:     Not part of a transaction
00405
00406         if (FAILED(hr))
00407             Error("MQReceiveMessage failed", hr);
00408
00409         //
00410         // Display the received message.
00411         //
00412         printf("%S : %s\n", wcsMsgLabel, Buffer);
00413
00414         //
00415         // Check for a request to end the application.
00416         //
00417         if (stricmp(Buffer, "quit") == 0)
00418             break;
00419
00420     } /* while (1) */
00421
00422     //
00423     // Cleanup: Close the handle to the queue.
00424     //
00425     MQCloseQueue(qh);
00426
00427
00428     //
00429     // In the concluding stage, we delete the queue from the directory
00430     // service. (We don't need to do this. In case of a public queue,
00431     // leaving it in the DS enables sender applications to send messages
00432     // even if the receiver is not available.)
00433     //
00434     hr = MQDeleteQueue(wcsFormat);
00435     if (FAILED(hr))
00436         Error("The queue cannot be deleted", hr);
00437 }
00438
00439
00440 //-----------------------------------------------------
00441 //
00442 // Sender Mode
00443 // -----------
00444 // The sender side does the following:
00445 //
00446 //    In domain (standard) mode:
00447 //    1. Locates all queues of type "guidMQTestType."
00448 //    2. Opens handles to all the queues.
00449 //    3. In a loop,
00450 //          sends messages to all those queues.
00451 //    4. Cleans up handles.
00452 //
00453 //    If we work in workgroup (direct) mode:
00454 //    1. Opens a handle to a private queue labeled
00455 //       "MSMQTest" on the computer specified.
00456 //    2. Sends messages to that queue.
00457 //    3. Cleans up handles.
00458 //-----------------------------------------------------
00459
00460
00461 //-----------------------------------------------------
00462 //
00463 // Sender in domain (standard) mode
00464 //
00465 //-----------------------------------------------------
00466 void StandardSender(void)
00467 {
00468     DWORD         cProps;
00469
00470     MQMSGPROPS    msgprops;
00471     MQPROPVARIANT aPropVar[MAX_VAR];
00472     QUEUEPROPID   aqPropId[MAX_VAR];
00473     MSGPROPID     amPropId[MAX_VAR];
00474
00475     MQPROPERTYRESTRICTION aPropRestriction[MAX_VAR];
00476     MQRESTRICTION Restriction;
00477
00478     MQCOLUMNSET      Column;
00479     HANDLE        hEnum;
00480
00481     WCHAR         wcsFormat[MAX_FORMAT];
00482
00483     UCHAR         Buffer[MAX_BUFFER];
00484     WCHAR         wcsMsgLabel[MQ_MAX_MSG_LABEL_LEN];
00485
00486     DWORD         i;
00487
00488     DWORD         cQueue;
00489     DWORD         dwNumChars;
00490     QUEUEHANDLE   aqh[MAX_VAR];
00491
00492     HRESULT       hr;
00493   int       nPos;
00494
00495
00496     printf("\nSender mode on the computer %s\n\n", mbsMachineName);
00497
00498
00499     //
00500     // Prepare parameters for locating queues.
00501     //
00502
00503     //
00504     // 1. Restriction: Queues with PROPID_Q_TYPE = MSMQTest service type GUIID
00505     //
00506     cProps = 0;
00507     aPropRestriction[cProps].rel         = PREQ;
00508     aPropRestriction[cProps].prop        = PROPID_Q_TYPE;
00509     aPropRestriction[cProps].prval.vt    = VT_CLSID;
00510     aPropRestriction[cProps].prval.puuid = &guidMQTestType;
00511     cProps++;
00512
00513     Restriction.cRes      = cProps;
00514     Restriction.paPropRes = aPropRestriction;
00515
00516
00517     //
00518     // 2. Columnset (the queue properties to retrieve) = queue GUID
00519     //
00520     cProps = 0;
00521     aqPropId[cProps] = PROPID_Q_INSTANCE;
00522     cProps++;
00523
00524     Column.cCol = cProps;
00525     Column.aCol = aqPropId;
00526
00527
00528     //
00529     // Issue the query to locate the queues.
00530     //
00531     hr = MQLocateBegin(
00532              NULL,          // IN:  Context must be NULL
00533              &Restriction,  // IN:  Restriction
00534              &Column,       // IN:  Properties to return
00535              NULL,          // IN:  No need to sort
00536              &hEnum);       // OUT: Enumeration handle
00537
00538     if (FAILED(hr))
00539         Error("MQLocateBegin failed", hr);
00540
00541     //
00542     // Get the results (up to MAX_VAR).
00543     // (For more results, call MQLocateNext in a loop.)
00544     //
00545     cQueue = MAX_VAR;
00546     hr = MQLocateNext(
00547              hEnum,         // IN:     Enumeration handle
00548              &cQueue,       // IN/OUT: Number of properties
00549              aPropVar);     // OUT:    Properties of the queue located
00550
00551     if (FAILED(hr))
00552         Error("MQLocateNext failed", hr);
00553
00554     //
00555     // End the query and release the resouces associated with it.
00556     //
00557     hr = MQLocateEnd(hEnum);
00558
00559     if (cQueue == 0)
00560     {
00561         //
00562         // No queue could be found, so exit.
00563         //
00564         printf("No queue was registered.");
00565         exit(0);
00566     }
00567
00568
00569     printf("\tQueue(s) found: %d\n", cQueue);
00570
00571
00572     //
00573     // Open a handle for each of the queues found.
00574     //
00575     for (i = 0; i < cQueue; i++)
00576     {
00577         // Convert the queue GUID to a format name.
00578         dwNumChars = MAX_FORMAT;
00579         hr = MQInstanceToFormatName(
00580                   aPropVar[i].puuid,    // IN:     Queue GUID
00581                   wcsFormat,            // OUT:    Format name
00582                   &dwNumChars);         // IN/OUT: Size of format name
00583
00584         if (FAILED(hr))
00585             Error("MQInstanceToFormatName failed", hr);
00586
00587         //
00588         // Open the queue with send access.
00589         //
00590         hr = MQOpenQueue(
00591                  wcsFormat,           // IN:  Queue format name
00592                  MQ_SEND_ACCESS,      // IN:  Want to send to queue
00593                  0,                   // IN:  Must be 0 for send access
00594                  &aqh[i]);            // OUT: Handle of open queue
00595
00596         if (FAILED(hr))
00597             Error("MQOpenQueue failed", hr);
00598
00599         //
00600         // Free the memory that was allocated for the queue GUID during the query.
00601         //
00602         MQFreeMemory(aPropVar[i].puuid);
00603     }
00604
00605
00606     printf("\nEnter \"quit\" to exit.\n");
00607
00608
00609     //
00610     // Construct the message label.
00611     //
00612   nPos = _snwprintf(wcsMsgLabel, MQ_MAX_MSG_LABEL_LEN - 1, L"Message from %S", mbsMachineName);
00613   if(nPos < 0)
00614   {
00615     printf("The label is too long for the buffer. Exiting...\n");
00616     exit(1);
00617   }
00618   wcsMsgLabel[nPos] = L'\0';
00619
00620     //
00621     // Main sender loop
00622     //
00623     for(;;)
00624     {
00625         //
00626         // Get a string from the console.
00627         //
00628         printf("Enter a string: ");
00629     if (fgets(Buffer, MAX_BUFFER - 1, stdin) == NULL)
00630             break;
00631
00632     Buffer[MAX_BUFFER-1] = '\0';
00633     //
00634     // Deleting the new-line character.
00635     //
00636     if(Buffer[strlen(Buffer) - 1] == '\n')
00637     {
00638       Buffer[strlen(Buffer)-1] = '\0';
00639     }
00640
00641
00642         //
00643         // Prepare the message properties for sending messages.
00644         //
00645         cProps = 0;
00646
00647         // Set the message body.
00648         amPropId[cProps]            = PROPID_M_BODY;
00649         aPropVar[cProps].vt         = VT_UI1 | VT_VECTOR;
00650         aPropVar[cProps].caub.cElems = sizeof(Buffer);
00651         aPropVar[cProps].caub.pElems = Buffer;
00652         cProps++;
00653
00654         // Set the message label.
00655         amPropId[cProps]            = PROPID_M_LABEL;
00656         aPropVar[cProps].vt         = VT_LPWSTR;
00657         aPropVar[cProps].pwszVal    = wcsMsgLabel;
00658         cProps++;
00659
00660         // Create a MSGPROPS structure.
00661         msgprops.cProp    = cProps;
00662         msgprops.aPropID  = amPropId;
00663         msgprops.aPropVar = aPropVar;
00664         msgprops.aStatus  = 0;
00665
00666
00667         //
00668         // Send the message to all the queues.
00669         //
00670         for (i = 0; i < cQueue; i++)
00671         {
00672             hr = MQSendMessage(
00673                     aqh[i],     // IN: Queue handle
00674                     &msgprops,  // IN: Message properties to send
00675                     NULL);      // IN: Not part of a transaction
00676
00677             if (FAILED(hr))
00678                 Error("MQSendMessage failed", hr);
00679         }
00680
00681         //
00682         // Check for a request to end the application.
00683         //
00684         if (stricmp(Buffer, "quit") == 0)
00685             break;
00686
00687     } /* for */
00688
00689
00690     //
00691     // Close all the queue handles.
00692     //
00693     for (i = 0; i < cQueue; i++)
00694         MQCloseQueue(aqh[i]);
00695
00696 }
00697
00698
00699
00700 //-----------------------------------------------------
00701 //
00702 // Sender in workgroup (direct) mode
00703 //
00704 //-----------------------------------------------------
00705 void DirectSender(void)
00706 {
00707
00708     MQMSGPROPS    msgprops;
00709     MQPROPVARIANT aPropVar[MAX_VAR];
00710     MSGPROPID     amPropId[MAX_VAR];
00711     DWORD         cProps;
00712
00713     WCHAR         wcsFormat[MAX_FORMAT];
00714     WCHAR         wcsReceiverComputer[MAX_COMPUTERNAME_LENGTH + 1];
00715
00716     UCHAR         Buffer[MAX_BUFFER];
00717     WCHAR         wcsMsgLabel[MQ_MAX_MSG_LABEL_LEN];
00718
00719     QUEUEHANDLE   qhSend;
00720
00721     HRESULT       hr;
00722   int       nPos;
00723
00724     //
00725     // Get the receiver computer name.
00726     //
00727     printf("Enter receiver computer name: ");
00728   if (fgetws(wcsReceiverComputer, MAX_COMPUTERNAME_LENGTH, stdin) == NULL)
00729   {
00730         printf("An invalid parameter was entered. Exiting...\n");
00731         exit(1);
00732   }
00733   wcsReceiverComputer[MAX_COMPUTERNAME_LENGTH] = L'\0';
00734   //
00735   // Deleting the new-line character.
00736   //
00737   if(wcsReceiverComputer[wcslen(wcsReceiverComputer) - 1] == L'\n')
00738   {
00739     wcsReceiverComputer[wcslen(wcsReceiverComputer) - 1] = L'\0';
00740   }
00741
00742     if(wcsReceiverComputer[0] == 0)
00743     {
00744         printf("An invalid parameter was entered. Exiting...\n");
00745         exit(1);
00746     }
00747
00748     //
00749     // Open the queue with send access.
00750     //
00751   nPos = _snwprintf(wcsFormat, MAX_FORMAT - 1, L"DIRECT=OS:%s\\private$\\MSMQTest", wcsReceiverComputer);
00752   if(nPos < 0)
00753   {
00754     printf("The format name is too long for the buffer. Exiting...\n");
00755     exit(1);
00756   }
00757   wcsFormat[nPos] = L'\0';
00758
00759     hr = MQOpenQueue(
00760              wcsFormat,           // IN:  Queue format name
00761              MQ_SEND_ACCESS,      // IN:  Want to send to queue
00762              0,                   // IN:  Must be 0 for send access
00763              &qhSend);            // OUT: Handle of open queue
00764
00765     if (FAILED(hr))
00766         Error("MQOpenQueue failed", hr);
00767
00768
00769     printf("\nEnter \"quit\" to exit\n");
00770
00771
00772     //
00773     // Construct the message label.
00774     //
00775   nPos = _snwprintf(wcsMsgLabel, MQ_MAX_MSG_LABEL_LEN - 1, L"Message from %S", mbsMachineName);
00776   if(nPos < 0)
00777   {
00778     printf("The label is too long for the buffer. Exiting...\n");
00779     exit(1);
00780   }
00781   wcsMsgLabel[nPos] = L'\0';
00782
00783
00784     fflush(stdin);
00785
00786     //
00787     // Main sender loop
00788     //
00789     for(;;)
00790     {
00791         //
00792         // Get a string from the console.
00793         //
00794         printf("Enter a string: ");
00795         if (fgets(Buffer, MAX_BUFFER - 1, stdin) == NULL)
00796             break;
00797
00798     Buffer[MAX_BUFFER-1] = '\0';
00799     //
00800     // Delete the new-line character.
00801     //
00802     if(Buffer[strlen(Buffer) - 1] == '\n')
00803     {
00804       Buffer[strlen(Buffer) - 1] = '\0';
00805     }
00806
00807         //
00808         // Set the message properties for sending messages.
00809         //
00810         cProps = 0;
00811
00812         // Set the body of the message.
00813         amPropId[cProps]            = PROPID_M_BODY;
00814         aPropVar[cProps].vt         = VT_UI1 | VT_VECTOR;
00815         aPropVar[cProps].caub.cElems = sizeof(Buffer);
00816         aPropVar[cProps].caub.pElems = Buffer;
00817         cProps++;
00818
00819         // Set the label of the message.
00820         amPropId[cProps]            = PROPID_M_LABEL;
00821         aPropVar[cProps].vt         = VT_LPWSTR;
00822         aPropVar[cProps].pwszVal    = wcsMsgLabel;
00823         cProps++;
00824
00825         // Create a MSGPROPS structure.
00826         msgprops.cProp    = cProps;
00827         msgprops.aPropID  = amPropId;
00828         msgprops.aPropVar = aPropVar;
00829         msgprops.aStatus  = 0;
00830
00831
00832         //
00833         // Send the message.
00834         //
00835         hr = MQSendMessage(
00836                 qhSend,     // IN: Queue handle
00837                 &msgprops,  // IN: Message properties to send
00838                 NULL);      // IN: Not part of a transaction
00839
00840         if (FAILED(hr))
00841             Error("MQSendMessage failed", hr);
00842
00843         //
00844         // Check for a request to end the application.
00845         //
00846         if (stricmp(Buffer, "quit") == 0)
00847             break;
00848
00849     } /* for */
00850
00851
00852     //
00853     // Close the queue handle.
00854     //
00855     MQCloseQueue(qhSend);
00856 }
00857
00858
00859
00860 //------------------------------------------------------
00861 //
00862 // Sender function
00863 //
00864 //------------------------------------------------------
00865 void Sender(int dDirectMode)
00866 {
00867
00868     if(dDirectMode == DIRECT)
00869         DirectSender();
00870
00871     else
00872         StandardSender();
00873 }
00874
00875
00876 //-----------------------------------------------------
00877 //
00878 //  MAIN
00879 //
00880 //-----------------------------------------------------
00881 int
00882 main(int argc, char *argv[])
00883 {
00884     DWORD dwNumChars;
00885     int dDirectMode;
00886
00887
00888     if (argc != 2)
00889     {
00890         Syntax();
00891     }
00892
00893     //
00894     // Retrieve the computer name.
00895     //
00896     dwNumChars = MAX_COMPUTERNAME_LENGTH;
00897     if(!GetComputerName(mbsMachineName, &dwNumChars))
00898   {
00899     printf("Failed to get computer name. Exiting...\n");
00900     exit(1);
00901   }
00902
00903     //
00904     // Detect a DS connection and determine the working mode.
00905     //
00906
00907     dDirectMode = SetConnectionMode();
00908
00909     if(strcmp(argv[1], "-s") == 0)
00910         Sender(dDirectMode);
00911
00912     else if (strcmp(argv[1], "-r") == 0)
00913         Receiver(dDirectMode);
00914
00915     else
00916         Syntax();
00917
00918
00919     printf("\nOK\n");
00920
00921     return(0);
00922 }
00923
00924
00925 void Error(char *s, HRESULT hr)
00926 {
00927     printf("%s (0x%X). Exiting...\n", s, hr);
00928     exit(1);
00929 }
00930
00931
00932 void Syntax()
00933 {
00934     printf("\n");
00935     printf("Syntax: msmqtest -s | -r\n");
00936     printf("\t-s: Sender\n");
00937     printf("\t-r: Receiver\n");
00938     exit(1);
00939 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Debug.Cpp Source File

  • NetDS
  • SyncMgr
  • SyncDir

Debug.Cpp

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #include "precomp.h"
00013
00014
00015 //+---------------------------------------------------------------------------
00016 //
00017 //  Function:   FnAssert, public
00018 //
00019 //  Synopsis:   Displays the Assert dialog
00020 //
00021 //  Arguments:  [lpstrExptr] - Expression
00022 //      [lpstrMsg] - Msg, if any, to append to the Expression
00023 //      [lpstrFilename] - File Assert Occured in
00024 //      [iLine] - Line Number of Assert
00025 //
00026 //  Returns:    Appropriate status code
00027 //
00028 //  Modifies:
00029 //
00030 //
00031 //----------------------------------------------------------------------------
00032
00033 #if DBG == 1
00034
00035 STDAPI FnAssert( LPSTR lpstrExpr, LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine )
00036 {
00037 int iResult;
00038 char lpTemp[] = "";
00039 char lpBuffer[512];
00040 char lpLocBuffer[256];
00041
00042
00043     if (NULL == lpstrMsg)
00044         lpstrMsg = lpTemp;
00045
00046     wsprintfA(lpBuffer, "Assertion \"%s\" failed! %s", lpstrExpr, lpstrMsg);
00047     wsprintfA(lpLocBuffer, "File %s, line %d; (A=exit; R=break; I=continue)",
00048              lpstrFileName, iLine);
00049     iResult = MessageBoxA(NULL, lpLocBuffer, lpBuffer,
00050                          MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL);
00051
00052     if (iResult == IDRETRY)
00053     {
00054         DebugBreak();
00055     }
00056     else if (iResult == IDABORT)
00057     {
00058         FatalAppExitA(0, "Assertion failure");
00059     }
00060     return NOERROR;
00061 }
00062
00063 #endif
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropSheetHost Member List

This is the complete list of members for CPropSheetHost, including all inherited members.
_AddPagesCallback(HPROPSHEETPAGE hPage, LPARAM lParam) | CPropSheetHost | [private, static]
_AddPagesForObject(IADs *padsObject) | CPropSheetHost | [private]
_CreateHiddenWindow() | CPropSheetHost | [private]
_CreatePropertySheet() | CPropSheetHost | [private]
_CreateSecondaryPropertySheet(DSA_SEC_PAGE_INFO *pDSASecPageInfo) | CPropSheetHost | [private]
_ExtractSecPageInfo(WPARAM wParam, PDSA_SEC_PAGE_INFO *ppSecPageInfo) | CPropSheetHost | [private]
_GetDSDispSpecOption(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CPropSheetHost | [private]
_GetDSObjectNames(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CPropSheetHost | [private]
_GetDSPropSheetConfig(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CPropSheetHost | [private]
_HiddenWindowProc(HWND, UINT, WPARAM, LPARAM) | CPropSheetHost | [private, static]
CPropSheetHost(HINSTANCE hInstance, HWND hwndParent=NULL) | CPropSheetHost |
DAdvise(FORMATETC *, DWORD, IAdviseSink *, LPDWORD) | CPropSheetHost |
DUnadvise(DWORD dwConnection) | CPropSheetHost |
EnumDAdvise(IEnumSTATDATA **ppEnumAdvise) | CPropSheetHost |
EnumFormatEtc(DWORD, IEnumFORMATETC **) | CPropSheetHost |
GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC) | CPropSheetHost |
GetData(FORMATETC *, STGMEDIUM *) | CPropSheetHost |
GetDataHere(FORMATETC *, STGMEDIUM *) | CPropSheetHost |
m_cfDSDispSpecOptions | CPropSheetHost | [private]
m_cfDSObjectNames | CPropSheetHost | [private]
m_cfDSPropSheetConfig | CPropSheetHost | [private]
m_hInst | CPropSheetHost | [private]
m_hwndHidden | CPropSheetHost | [private]
m_hwndParent | CPropSheetHost | [private]
m_ObjRefCount | CPropSheetHost | [private]
m_pwszPrefix | CPropSheetHost | [private]
m_rgPageHandles | CPropSheetHost | [private]
m_spADObject | CPropSheetHost | [private]
m_szHiddenWindowClass | CPropSheetHost | [private]
QueryGetData(FORMATETC *) | CPropSheetHost |
QueryInterface(REFIID, LPVOID FAR *) | CPropSheetHost |
Run() | CPropSheetHost |
SetData(LPFORMATETC, LPSTGMEDIUM, BOOL) | CPropSheetHost |
SetObject(LPCWSTR pwszADsPath) | CPropSheetHost |
SetObject(IADs *pads) | CPropSheetHost |
STDMETHODIMP_(DWORD) AddRef() | CPropSheetHost |
STDMETHODIMP_(DWORD) Release() | CPropSheetHost |
~CPropSheetHost() | CPropSheetHost |
Generated on Wed Nov 13 2024 16:57:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ENUMSYMDATA Member List

This is the complete list of members for ENUMSYMDATA, including all inherited members.
base | ENUMSYMDATA
mask | ENUMSYMDATA
Generated on Wed Nov 13 2024 16:57:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Hello3J Member List

This is the complete list of members for Hello3J, including all inherited members.
destroy() | Hello3J | [inline]
FALSE | Hello3J | [private]
getAppletInfo() | Hello3J | [inline]
Hello3J() | Hello3J | [inline]
HideCharacters() | Hello3J | [inline]
init() | Hello3J | [inline]
LoadCharacter(String filename, int[] characterID, IAgentCharacterEx[] character) | Hello3J | [inline, private]
m_AgentEx | Hello3J | [private]
m_Genie | Hello3J | [private]
m_GenieFilename | Hello3J | [private]
m_GenieID | Hello3J | [private]
m_Merlin | Hello3J | [private]
m_MerlinFilename | Hello3J | [private]
m_MerlinID | Hello3J | [private]
m_OldPath | Hello3J | [private]
m_RequestID | Hello3J | [private]
m_Sink | Hello3J | [private]
m_SinkID | Hello3J | [private]
m_WaitID | Hello3J | [private]
paint(Graphics g) | Hello3J | [inline]
start() | Hello3J | [inline]
stop() | Hello3J | [inline]
TRUE | Hello3J | [private]
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/ClUuid/ClUuids.c Source File

  • NetDS
  • RPC
  • ClUuid

ClUuids.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                       Cluuid Example
00005
00006     FILE:       cluuids.c
00007
00008     USAGE:      cluuids  -p protocol_sequence
00009                          -e endpoint
00010                          -m max calls
00011                          -n min calls
00012                          -f flag for RpcServerListen
00013                          -1 client object uuid
00014                          -2 manager epv uuid
00015
00016     PURPOSE:    Server side of RPC distributed application hello
00017
00018     FUNCTIONS:  main() - registers server as RPC server
00019
00020     COMMENTS:   Print "hello, world" on the server.
00021                 When you supply a type UUID, the client must
00022                 supply the same UUID.
00023
00024 ****************************************************************************/
00025
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <ctype.h>
00030 #include "cluuid.h"    // header file generated by MIDL compiler
00031
00032 // the second implementation of the remote procedure
00033 extern void HelloProc2(unsigned char * pszString);
00034
00035 #define PURPOSE \
00036 "This Microsoft RPC Version 2.0 sample program demonstrates how\n\
00037 to supply multiple implementations of the remote procedure\n\
00038 specified in the interface. It also demonstrates how the client\n\
00039 selects among the implementations by providing a client object uuid.\n\n"
00040
00041 #define NULL_UUID_STRING "00000000-0000-0000-0000-000000000000"
00042
00043 void Usage(char * pszProgramName)
00044 {
00045     fprintf(stderr, "%s", PURPOSE);
00046     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00047     fprintf(stderr, " -p protocol_sequence\n");
00048     fprintf(stderr, " -e endpoint\n");
00049     fprintf(stderr, " -m maxcalls\n");
00050     fprintf(stderr, " -n mincalls\n");
00051     fprintf(stderr, " -f flag_wait_op\n");
00052     fprintf(stderr, " -1 client uuid\n");
00053     fprintf(stderr, " -2 manager uuid\n");
00054     exit(1);
00055 }
00056
00057 /* main:  register the interface, start listening for clients */
00058 void __cdecl main(int argc, char * argv[])
00059 {
00060     RPC_STATUS status;
00061     UUID MgrTypeUuid, ClientUuid;
00062     unsigned char * pszProtocolSequence = "ncacn_np";
00063     unsigned char * pszSecurity         = NULL;
00064     unsigned char * pszClientUuid       = NULL_UUID_STRING;
00065     unsigned char * pszMgrTypeUuid      = "11111111-1111-1111-1111-111111111111";
00066     unsigned char * pszEndpoint         = "\\pipe\\cluuid";
00067     unsigned int    cMinCalls           = 1;
00068     unsigned int    cMaxCalls           = 20;
00069     unsigned int    fDontWait           = FALSE;
00070     int i;
00071
00072     cluuid_SERVER_EPV epv2;    // the mgr_epv for the 2nd implementation
00073
00074     /* allow the user to override settings with command line switches */
00075     for (i = 1; i < argc; i++) {
00076         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00077             switch (tolower(*(argv[i]+1))) {
00078             case 'p':  // protocol sequence
00079                 pszProtocolSequence = argv[++i];
00080                 break;
00081             case 'e':
00082                 pszEndpoint = argv[++i];
00083                 break;
00084             case 'm':
00085                 cMaxCalls = (unsigned int) atoi(argv[++i]);
00086                 break;
00087             case 'n':
00088                 cMinCalls = (unsigned int) atoi(argv[++i]);
00089                 break;
00090             case 'f':
00091                 fDontWait = (unsigned int) atoi(argv[++i]);
00092                 break;
00093             case '1':
00094                 pszMgrTypeUuid = argv[++i];
00095                 break;
00096             case '2':
00097                 pszClientUuid = argv[++i];
00098                 break;
00099             case 'h':
00100             case '?':
00101             default:
00102                 Usage(argv[0]);
00103             }
00104         }
00105         else
00106             Usage(argv[0]);
00107     }
00108
00109     status = RpcServerUseProtseqEp(pszProtocolSequence,
00110                                    cMaxCalls,
00111                                    pszEndpoint,
00112                                    pszSecurity);  // Security descriptor
00113     printf("RpcServerUseProtseqEp returned 0x%x\n", status);
00114     if (status) {
00115         exit(status);
00116     }
00117
00118     status = UuidFromString(pszClientUuid, &ClientUuid);
00119     printf("UuidFromString returned 0x%x = %d\n", status, status);
00120     if (status) {
00121         exit(status);
00122     }
00123
00124     status = UuidFromString(pszMgrTypeUuid, &MgrTypeUuid);
00125     printf("UuidFromString returned 0x%x = %d\n", status, status);
00126     if (status) {
00127         exit(status);
00128     }
00129     if (strcmp (pszMgrTypeUuid, NULL_UUID_STRING) == 0) {
00130         printf("Register object using non-null uuid %s\n", pszMgrTypeUuid);
00131         exit(1);
00132     }
00133
00134     if (strcmp (pszClientUuid, NULL_UUID_STRING) == 0) {
00135         printf("Register object using non-null uuid %s\n", pszMgrTypeUuid);
00136         ClientUuid = MgrTypeUuid;
00137     }
00138
00139     RpcObjectSetType(&ClientUuid, &MgrTypeUuid);  // associate type UUID with nil UUID
00140     printf("RpcObjectSetType returned 0x%x\n", status);
00141     if (status) {
00142         exit(status);
00143     }
00144
00145     status = RpcServerRegisterIf(cluuid_ServerIfHandle, // interface to register
00146                                  NULL,   // MgrTypeUuid
00147                                  NULL);  // MgrEpv; null means use default
00148     printf("RpcServerRegisterIf returned 0x%x\n", status);
00149     if (status) {
00150         exit(status);
00151     }
00152
00153     /* register the second manager epv and associate it with the
00154        specified uuid.  the second uuid must be non-null so that
00155        it will not conflict with the NULL uuid already registered
00156        for this interface
00157     */
00158     epv2.HelloProc = HelloProc2;
00159     epv2.Shutdown = Shutdown;
00160     status = RpcServerRegisterIf(cluuid_ServerIfHandle, // interface to register
00161                                  &MgrTypeUuid,  // MgrTypeUuid
00162                                  &epv2);        // 2nd manager epv
00163     printf("RpcServerRegisterIf returned 0x%x\n", status);
00164     if (status) {
00165         exit(status);
00166     }
00167
00168     printf("Calling RpcServerListen\n");
00169     status = RpcServerListen(cMinCalls,
00170                              cMaxCalls,
00171                              fDontWait);
00172     printf("RpcServerListen returned: 0x%x\n", status);
00173     if (status) {
00174         exit(status);
00175     }
00176
00177     if (fDontWait) {
00178         printf("Calling RpcMgmtWaitServerListen\n");
00179         status = RpcMgmtWaitServerListen();  //  wait operation
00180         printf("RpcMgmtWaitServerListen returned: 0x%x\n", status);
00181         if (status) {
00182             exit(status);
00183         }
00184     }
00185
00186 } // end main()
00187
00188
00189 /*********************************************************************/
00190 /*                 MIDL allocate and free                            */
00191 /*********************************************************************/
00192
00193 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00194 {
00195     return(malloc(len));
00196 }
00197
00198 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00199 {
00200     free(ptr);
00201 }
00202
00203
00204 /* end file cluuids.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/EvHandle.h Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

EvHandle.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // MQEventHandler.h : header file
00013 //
00014
00015
00016 class CMSMQEventHandler : public CCmdTarget
00017 {
00018 public:
00019
00020   CMSMQEventHandler();
00021   ~CMSMQEventHandler();
00022
00023
00024   virtual void Arrived( /*[in]*/ IDispatch* pdispQueue,
00025               /*[in]*/ long lCursor);
00026   virtual void ArrivedError(  /*[in]*/ IDispatch* pdispQueue,
00027                 /*[in]*/ long lErrorCode,
00028                 /*[in]*/ long lCursor);
00029
00030   HRESULT AdviseSource(IDispatch* pDispatch);
00031
00032   LPUNKNOWN GetInterfaceHook(const void* piid);
00033
00034   DECLARE_DISPATCH_MAP()
00035
00036 private:
00037   DWORD       m_dwMyCookie;
00038   LPCONNECTIONPOINT m_pMyCP;
00039
00040 };
00041
00042
00043
00044
00045
00046
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MyClassFactory Member List

This is the complete list of members for MyClassFactory, including all inherited members.
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | MyClassFactory |
GetProviderCLSID() | MyClassFactory |
LockServer(BOOL) | MyClassFactory |
m_cRef | MyClassFactory | [protected]
m_guidProv | MyClassFactory | [protected]
MyClassFactory(void) | MyClassFactory |
QueryInterface(REFIID riid, void **ppv) | MyClassFactory | [virtual]
STDMETHODIMP_(ULONG) AddRef() | MyClassFactory | [inline, virtual]
STDMETHODIMP_(ULONG) Release() | MyClassFactory | [inline, virtual]
~MyClassFactory(void) | MyClassFactory | [virtual]
Generated on Wed Nov 13 2024 16:57:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ConnectionEvents Member List

This is the complete list of members for msado15::ConnectionEvents, including all inherited members.
BeginTransComplete(int TransactionLevel, msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEvents |
CommitTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEvents |
ConnectComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEvents |
Disconnect(int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEvents |
ExecuteComplete(int RecordsAffected, msado15.Error pError, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection) | msado15::ConnectionEvents |
iid | msado15::ConnectionEvents | [static]
InfoMessage(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEvents |
RollbackTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEvents |
WillConnect(String[] ConnectionString, String[] UserID, String[] Password, int[] Options, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEvents |
WillExecute(String[] Source, int[] CursorType, int[] LockType, int[] Options, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection) | msado15::ConnectionEvents |
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::MarshalOptionsEnum Member List

This is the complete list of members for msado15::MarshalOptionsEnum, including all inherited members.
adMarshalAll | msado15::MarshalOptionsEnum | [static]
adMarshalModifiedOnly | msado15::MarshalOptionsEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/syslcesub.Cpp Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

syslcesub.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "stdafx.h"
00018 #include "ComSpyCtl.h"
00019 #include "SysLCESub.h"
00020
00021 #include "adminwrap.h"
00022 #include <stdio.h>
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // CSysLCESub
00027
00028 STDMETHODIMP CSysLCESub::Install(BSTR* pPropertyName, VARIANT PropertyValue)
00029 {
00030   EventEnum eEvent;
00031   GetEventType( &eEvent );
00032   CComBSTR bstrSubscriptionName (EventName( eEvent ));
00033   CComBSTR bstrSubscriptionID;
00034   IID iid;
00035   CComBSTR bstrInterfaceID;
00036   GUID EventClass;
00037   CComBSTR bstrEventClassID;
00038   HRESULT hr = S_OK;
00039   LPOLESTR strGUID;
00040
00041   hr = StringFromIID(m_SubscriptionGuid, &strGUID);
00042   if (FAILED(hr))
00043   {
00044     ATLTRACE(L"Failed to Create String from IID");
00045     return hr;
00046   }
00047
00048   bstrSubscriptionID = strGUID;
00049   CoTaskMemFree(strGUID);
00050
00051   GetEventClass( &EventClass );
00052   hr = StringFromIID(EventClass, &strGUID);
00053   if (FAILED(hr))
00054   {
00055     ATLTRACE(L"Failed to Create String from IID");
00056     return hr;
00057   }
00058
00059   bstrEventClassID = strGUID;
00060   CoTaskMemFree(strGUID);
00061
00062   GetInterface( &iid );
00063   hr = StringFromIID(iid, &strGUID);
00064   if (FAILED(hr))
00065   {
00066     ATLTRACE(L"Failed to Create String from IID");
00067     return hr;
00068   }
00069
00070   bstrInterfaceID = strGUID;
00071   CoTaskMemFree(strGUID);
00072
00073   ICOMAdminCatalog* pICat;
00074   if (SUCCEEDED(hr = CoCreateInstance(__uuidof(COMAdminCatalog),
00075                 NULL,
00076               CLSCTX_SERVER,
00077               __uuidof(ICOMAdminCatalog),
00078               (LPVOID*)&pICat)))
00079   {
00080     AddTransientSubscription(pICat,
00081                 bstrSubscriptionName,
00082                 bstrEventClassID,
00083                 NULL,
00084                 bstrInterfaceID,
00085                 GetUnknown(),
00086                 NULL,
00087                 NULL,
00088                 pPropertyName ? *pPropertyName : NULL,
00089                 pPropertyName ? PropertyValue.bstrVal : NULL);
00090
00091
00092     pICat->Release();
00093   }
00094   return hr;
00095
00096 }
00097
00098 STDMETHODIMP CSysLCESub::Uninstall()
00099 {
00100   HRESULT hr;
00101   EventEnum eEvent;
00102   GetEventType( &eEvent );
00103   CComBSTR bstrSubscriptionName (EventName( eEvent ));
00104   ICOMAdminCatalog* pICat;
00105   if (SUCCEEDED(hr = CoCreateInstance(__uuidof(COMAdminCatalog),
00106                 NULL,
00107               CLSCTX_SERVER,
00108               __uuidof(ICOMAdminCatalog),
00109               (LPVOID*)&pICat)))
00110   {
00111     RemoveTransientSubscription(pICat,
00112                 bstrSubscriptionName);
00113     pICat->Release();
00114   }
00115   return hr;
00116 }
00117
00118 OLECHAR* CSysLCESub::EventName
00119 //-----------------------------------------------------------------
00120 // Function Description:
00121 //
00122 //  Translates from the EventEnum type to a text string
00123 //
00124 // Return Value:
00125 //
00126 //  Arguments:
00127    (EventEnum e)
00128 //
00129 //-----------------------------------------------------------------
00130 {
00131   switch (e)
00132   {
00133     case Application:
00134     {
00135       return OLESTR("Application");
00136       break;
00137     }
00138     case Thread:
00139     {
00140       return OLESTR("Thread");
00141       break;
00142     }
00143     case Instance:
00144     {
00145       return OLESTR("Instance");
00146       break;
00147     }
00148     case Transaction:
00149     {
00150       return OLESTR("Transaction");
00151       break;
00152     }
00153     case Method:
00154     {
00155       return OLESTR("Method");
00156       break;
00157     }
00158     case Object:
00159     {
00160       return OLESTR("Object");
00161       break;
00162     }
00163     case Resource:
00164     {
00165       return OLESTR("Resource");
00166       break;
00167     }
00168     case User:
00169     {
00170       return OLESTR("User");
00171       break;
00172     }
00173     case Security:
00174     {
00175       return OLESTR("Security");
00176       break;
00177     }
00178     case ObjectConstruction:
00179     {
00180       return OLESTR("Construction");
00181       break;
00182     }
00183     case ObjectPool:
00184     {
00185       return OLESTR("Pool");
00186       break;
00187     }
00188     case ObjectPool2:
00189     {
00190       return OLESTR("Pool2");
00191       break;
00192     }
00193     case Activity:
00194     {
00195       return OLESTR("Activity");
00196       break;
00197     }
00198     case Identity:
00199     {
00200       return OLESTR("Identity");
00201       break;
00202     }
00203     case QC:
00204     {
00205       return OLESTR("Queued Components");
00206       break;
00207     }
00208     case Exception:
00209     {
00210       return OLESTR("Exception");
00211       break;
00212     }
00213     case CRM:
00214     {
00215       return OLESTR("CRM");
00216       break;
00217     }
00218     case EventStore:
00219     {
00220       return OLESTR("EventStore");
00221       break;
00222     }
00223     case LoadBalancing:
00224     {
00225       return OLESTR("LoadBalancing");
00226       break;
00227     }
00228     default:
00229       ATLTRACE(L"Object type not implemented in SysLCESub\n");
00230       _ASSERTE(0);
00231       break;
00232   }
00233   return NULL;
00234 }
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/PlgBlt/Track.h Source File

  • Multimedia
  • Gdi
  • WinNT
  • PlgBlt

Track.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1992 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /* track.h - header file for doTrackObject support */
00013
00014
00015 /* special messages for doTrackobject(). */
00016 #define TROB_NEW         WM_USER+1
00017 #define TROB_DELETE      WM_USER+2
00018 #define TROB_PAINT       WM_USER+3
00019 #define TROB_HITTEST     WM_USER+5
00020
00021
00022 /* Different "Track modes." */
00023 #define TMNONE    0x0000
00024 #define TMMOVE    0x0001
00025 #define TMSIZEX   0x0002
00026 #define TMSIZEY   0x0004
00027 #define TMSIZEXY  0x0006
00028 #define TMSHEARX  0x0010
00029 #define TMSHEARY  0x0020
00030 #define TMROTATE  0x0008
00031 #define TMALL     0x00ff
00032
00033
00034
00035 /* structure for the track object.  */
00036 typedef struct tagTrackObject{
00037     RECT   rect;
00038     XFORM  xfmChange;   /* World coordinate transform      */
00039     XFORM  xfmDown;     /* transform when the mouse down happens. */
00040     HDC    hdc;
00041     int    Mode;        /* TMROTATE, TMSIZEXY, TMMOVE, ... */
00042     int    allowedModes;
00043     RECT   rectClip;
00044     struct tagTrackObject* Next;
00045 } TrackObject, *PTrackObject;
00046
00047
00048 /* function prototypes. */
00049 PTrackObject doTrackObject(PTrackObject, int, HWND, LONG_PTR);
00050 VOID MouseMove(PTrackObject, int, HWND, LONG_PTR);
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_WIDEGUIDMAP Member List

This is the complete list of members for _WIDEGUIDMAP, including all inherited members.
pGuid | _WIDEGUIDMAP
pwszName | _WIDEGUIDMAP
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/filerepserver.idl Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

filerepserver.idl

Go to the documentation of this file.
00001 [
00002     uuid(fe7f2eda-5da1-4041-928c-d2534d3fa128),
00003     pointer_default(ref),
00004     version(1.0)
00005 ]
00006
00007 interface FileRepServer {
00008
00009 // Declare the string data type. This should work for UNICODE.
00010 #ifdef _UNICODE
00011     typedef wchar_t * STR;
00012 #else
00013     typedef unsigned char * STR;
00014 #endif
00015
00016     // The size of the buffer returned with the RemoteOpen call.
00017     // It allows us to send back some data with the server reply for free:
00018     // since the TCP MTU size is at least 1500 bytes, we can make
00019     // use of the remaining bytes.
00020     const unsigned short OPEN_BUFSIZE = 1024 * 1;
00021
00022     // The size of the buffer returned with RemoteRead.  It is larger
00023     // due to being optimized for data transfer.
00024     const unsigned short READ_BUFSIZE = 10000;
00025
00026     // Used to define fixed-size buffer to receive data on the client.
00027     // The buffer size is basically the larger of the above values +1.
00028     cpp_quote("#define MAX_BUFSIZE (READ_BUFSIZE+1)")
00029
00030     typedef [context_handle] void * PCONTEXT_HANDLE_TYPE;
00031
00032    /*
00033       Opens a file specified by pszFile, reads up to OPEN_BUFSIZE bytes
00034       from it, and returns the number of bytes read as well as
00035       the data read in achBuf[].  If the whole file has been read,
00036       it is closed and the returned context handle is NULL.  Thus,
00037       the file may be transfered with a single call to
00038       RemoteOpen().  If the returned context handle is not NULL, subsequent
00039       calls to RemoteRead with the context handle will return additional
00040       file data.
00041     */
00042     void RemoteOpen([in] handle_t hFileRepServer,
00043                     [out] PCONTEXT_HANDLE_TYPE *pphContext,
00044                     [in, ref, string] STR pszFile,
00045                     [out, ref, size_is(OPEN_BUFSIZE+1), length_is(*cbRead)] byte *Buf,
00046                     [in, out, ref] unsigned long *cbRead);
00047
00048     /*
00049     Reads up to READ_BUFSIZE bytes from a previously opened file
00050       corresponding to the context handle phContext and returns
00051       the number of bytes read.  If the whole file has been read,
00052       it is closed and the returned context handle is NULL.  This cuts
00053       down on the number fo calls necessary for file transfer.  The [in]
00054       context handle must be a non-NULL context handle returned by RemoteOpen.
00055       The [out] context handle can be NULL is the read has completed and the
00056       file has been closed.
00057     */
00058     void RemoteRead([in] handle_t hFileRepServer,
00059                     [in, out] PCONTEXT_HANDLE_TYPE *pphContext,
00060                     [out, ref, size_is(READ_BUFSIZE+1), length_is(*cbRead)] byte *Buf,
00061                     [in, out, ref] unsigned long *cbRead);
00062
00063 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHMMSampleApp Member List

This is the complete list of members for CHMMSampleApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CHMMSampleApp() | CHMMSampleApp |
CWinApp() | CWinApp |
ExitInstance() | CHMMSampleApp | [virtual]
InitInstance() | CHMMSampleApp | [virtual]
InitSecurity(void) | CHMMSampleApp |
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/ids.h Source File

  • Com
  • Fundamentals
  • SimpDnd

ids.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: ids.h
00003 //
00004 //      Definition of CDropSource
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008 #if !defined( _IDS_H_ )
00009 #define _IDS_H_
00010
00011 #include <assert.h>
00012
00013 class CSimpleDoc;
00014
00015 interface CDropSource : public IDropSource
00016 {
00017   int m_nCount;
00018   CSimpleDoc FAR * m_pDoc;
00019
00020   CDropSource(CSimpleDoc FAR * pDoc) {
00021     OutputDebugString("In IDS's constructor\r\n");
00022     m_pDoc = pDoc;
00023     m_nCount = 0;
00024     };
00025
00026   ~CDropSource() {
00027     OutputDebugString("In IDS's destructor\r\n");
00028     } ;
00029
00030   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppv);
00031   STDMETHODIMP_(ULONG) AddRef ();
00032   STDMETHODIMP_(ULONG) Release ();
00033
00034      // *** IDropSource methods ***
00035   STDMETHODIMP QueryContinueDrag (BOOL fEscapePressed, DWORD grfKeyState);
00036   STDMETHODIMP GiveFeedback (DWORD dwEffect);
00037
00038 private:
00039
00040 };
00041
00042
00043 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/WMIHelpers.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

WMIHelpers.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      WmiHelpers.cpp
00005 //
00006 //  Description:
00007 //      This file contains the implementation of WMI help functions.
00008 //
00009 //  Header File:
00010 //      WmiHelpers.h
00011 //
00012 //////////////////////////////////////////////////////////////////////////////
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 // Include Files
00016 //////////////////////////////////////////////////////////////////////////////
00017
00018 #include "stdafx.h"
00019 #include "WMIHelpers.h"
00020
00021
00022 //////////////////////////////////////////////////////////////////////////////
00023 //++
00024 //
00025 //  HrGetWMIProperty
00026 //
00027 //  Description:
00028 //      Get a named property from a WMI object.
00029 //
00030 //  Arguments:
00031 //      pWMIObjectIn
00032 //          WMI object to retrieve the property from.
00033 //
00034 //      pcszPropertyNameIn
00035 //          Name of the property to retrieve.
00036 //
00037 //      ulPropertyTypeIn
00038 //          Expected property type.
00039 //
00040 //      pVariantOut
00041 //          VARIANT to receive the property.
00042 //
00043 //  Return Value:
00044 //      S_OK
00045 //          Success.
00046 //
00047 //      E_PROPTYPEMISMATCH
00048 //          Property type didn't match what caller specified.
00049 //
00050 //      Other
00051 //          An error occurred.
00052 //
00053 //  Remarks:
00054 //      None.
00055 //
00056 //--
00057 //////////////////////////////////////////////////////////////////////////////
00058 HRESULT
00059 HrGetWMIProperty(
00060       IWbemClassObject *    pWMIObjectIn
00061     , LPCWSTR               pcszPropertyNameIn
00062     , ULONG                 ulPropertyTypeIn
00063     , VARIANT *             pVariantOut
00064     )
00065 {
00066     assert( pWMIObjectIn != NULL );
00067     assert( pcszPropertyNameIn != NULL );
00068     assert( pVariantOut != NULL );
00069
00070     HRESULT hr;
00071     BSTR    bstrProp = NULL;
00072
00073     VariantClear( pVariantOut );
00074
00075     bstrProp = SysAllocString( pcszPropertyNameIn );
00076     if ( bstrProp == NULL )
00077     {
00078         hr = E_OUTOFMEMORY;
00079         goto Cleanup;
00080     } // if:
00081
00082     hr = pWMIObjectIn->Get( bstrProp, 0L, pVariantOut, NULL, NULL );
00083     if ( FAILED( hr ) )
00084     {
00085         //
00086         //  The SendStatusReport mechanism does not work in these helper
00087         //  functions.  It is an exercise left up to the reader as to how
00088         //  best to log errors from this function...
00089         //
00090         //  It is expected that most implementers of a ClusCfg managed
00091         //  resource will not use this function as it is here for
00092         //  demonstration purposes only...
00093         //
00094
00095         //LOG_STATUS_REPORT_STRING( L"[MyStorageResource] Could not get the value for WMI property '%1!ws!'.", bstrProp, hr );
00096         goto Cleanup;
00097     } // if:
00098
00099     //
00100     //  For reasons only known to WMI, boolean properties are of type VT_NULL instead of
00101     //  VT_BOOL when they are not set or false...
00102     //
00103
00104     //
00105     //  Added the special case check for signature.  We know that signature will be NULL
00106     //  when the spindle is under ClusDisk control...
00107     //
00108
00109     if (    ( ulPropertyTypeIn != VT_BOOL )
00110         &&  ( NIStringCompareW( bstrProp, SysStringLen( bstrProp ), L"Signature", RTL_NUMBER_OF( L"Signature" ) ) != 0 ) )
00111     {
00112         if ( pVariantOut->vt != ulPropertyTypeIn )
00113         {
00114             //LOG_STATUS_REPORT_STRING3( L"[MyStorageResource] Variant type for WMI Property '%1!ws!' was supposed to be '%2!d!', but was '%3!d!' instead.", pcszPropertyNameIn, ulPropertyTypeIn, pVariantOut->vt, hr );
00115             hr = E_PROPTYPEMISMATCH;
00116         } // if:
00117     } // if:
00118
00119 Cleanup:
00120
00121     SysFreeString( bstrProp );
00122
00123     return hr;
00124
00125 } //*** HrGetWMIProperty
00126
00127
00128 //////////////////////////////////////////////////////////////////////////////
00129 //++
00130 //
00131 //  HrSetWbemServices
00132 //
00133 //  Description:
00134 //      Set the WBemServices object into the passed in punk.
00135 //
00136 //  Arguments:
00137 //      punkIn
00138 //          Interface pointer of the object to call SetWbemServices on.
00139 //
00140 //      pIWbemServicesIn
00141 //          Interface pointer to pass in the SetWbemServices call.
00142 //
00143 //  Return Value:
00144 //      S_OK
00145 //          Success
00146 //
00147 //      Other
00148 //          An error occurred.
00149 //
00150 //  Remarks:
00151 //      If the punkIn object doesn't support the IWMIServices interface
00152 //      S_OK is returned.
00153 //
00154 //--
00155 //////////////////////////////////////////////////////////////////////////////
00156 HRESULT
00157 HrSetWbemServices(
00158       IUnknown *        punkIn
00159     , IWbemServices *   pIWbemServicesIn
00160     )
00161 {
00162     assert( punkIn != NULL );
00163
00164     HRESULT         hr;
00165     IWMIServices *  piws = NULL;
00166
00167     if ( punkIn == NULL )
00168     {
00169         hr = E_POINTER;
00170         goto Cleanup;
00171     } // if:
00172
00173     hr = punkIn->TypeSafeQI( IWMIServices, &piws );
00174     if ( SUCCEEDED( hr ) )
00175     {
00176         hr = piws->SetWbemServices( pIWbemServicesIn );
00177         piws->Release();
00178     } // if:
00179     else if ( hr == E_NOINTERFACE )
00180     {
00181         hr = S_OK;
00182     } // else if:
00183
00184 Cleanup:
00185
00186     return hr;
00187
00188 } //*** HrSetWbemServices
00189
00190
00191 //////////////////////////////////////////////////////////////////////////////
00192 //++
00193 //
00194 //  HrSetBlanket
00195 //
00196 //  Description:
00197 //      Adjusts the security blanket on a IWbemServices pointer.
00198 //
00199 //  Arguments:
00200 //      pIWbemServicesIn
00201 //          Object on which to set teh security blanket.
00202 //
00203 //  Return Value:
00204 //      S_OK
00205 //          Success.
00206 //
00207 //      S_FALSE
00208 //          pIWbemServices was NULL.
00209 //
00210 //      Other
00211 //          An error occurred.
00212 //
00213 //  Remarks:
00214 //      None.
00215 //
00216 //--
00217 //////////////////////////////////////////////////////////////////////////////
00218 HRESULT
00219 HrSetBlanket(
00220     IWbemServices * pIWbemServicesIn
00221     )
00222 {
00223     assert( pIWbemServicesIn != NULL );
00224
00225     HRESULT hr = S_FALSE;
00226
00227     if ( pIWbemServicesIn )
00228     {
00229         IClientSecurity *   pCliSec;
00230
00231         hr = pIWbemServicesIn->TypeSafeQI( IClientSecurity, &pCliSec );
00232         if ( SUCCEEDED( hr ) )
00233         {
00234             hr = pCliSec->SetBlanket(
00235                             pIWbemServicesIn,
00236                             RPC_C_AUTHN_WINNT,
00237                             RPC_C_AUTHZ_NONE,
00238                             NULL,
00239                             RPC_C_AUTHN_LEVEL_CONNECT,
00240                             RPC_C_IMP_LEVEL_IMPERSONATE,
00241                             NULL,
00242                             EOAC_NONE
00243                             );
00244
00245             pCliSec->Release();
00246         } // if:
00247     } // if:
00248
00249     return hr;
00250
00251 } //*** HrSetBlanket
00252
00253
00254 //////////////////////////////////////////////////////////////////////////////
00255 //++
00256 //
00257 //  HrInitializeWbemConnection
00258 //
00259 //  Description:
00260 //      Initialize a connection to the WbemLocator and returns a pointer
00261 //      to a WBEM services object.
00262 //
00263 //  Arguments:
00264 //      pIWbemServicesOut
00265 //          Upon success will contain the interface pointer to the services object.
00266 //
00267 //  Return Value:
00268 //      S_OK
00269 //          Success
00270 //
00271 //      Other
00272 //          An error occurred.
00273 //
00274 //--
00275 //////////////////////////////////////////////////////////////////////////////
00276 HRESULT
00277 HrInitializeWbemConnection(
00278     IWbemServices ** pIWbemServicesOut
00279     )
00280 {
00281     assert( pIWbemServicesOut != NULL );
00282
00283     HRESULT         hr = S_OK;
00284     IWbemLocator *  pIWbemLocator = NULL;
00285     BSTR            bstrNameSpace = NULL;
00286
00287     hr = CoCreateInstance( CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &pIWbemLocator );
00288     if ( FAILED( hr ) )
00289     {
00290         goto Cleanup;
00291     } // if:
00292
00293     bstrNameSpace = SysAllocString( L"\\\\.\\root\\cimv2" );
00294     if ( bstrNameSpace == NULL )
00295     {
00296         hr = E_OUTOFMEMORY;
00297         goto Cleanup;
00298     } // if:
00299
00300     hr = pIWbemLocator->ConnectServer(
00301                             bstrNameSpace,
00302                             NULL,                   // using current account for simplicity
00303                             NULL,                   // using current password for simplicity
00304                             NULL,                   // locale
00305                             0L,                     // securityFlags, reserved must be 0
00306                             NULL,                   // authority (domain for NTLM)
00307                             NULL,                   // context
00308                             pIWbemServicesOut
00309                             );
00310     if ( FAILED( hr ) )
00311     {
00312         goto Cleanup;
00313     } // if:
00314
00315     hr = HrSetBlanket( *pIWbemServicesOut );
00316     if ( FAILED( hr ) )
00317     {
00318         goto Cleanup;
00319     } // if:
00320
00321 Cleanup:
00322
00323     SysFreeString( bstrNameSpace );
00324
00325     if ( pIWbemLocator != NULL )
00326     {
00327         pIWbemLocator->Release();
00328     } // if:
00329
00330     return hr;
00331
00332 } //*** HrInitializeWbemConnection
00333
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_FILESHARESAMPLE_RESOURCE Member List

This is the complete list of members for _FILESHARESAMPLE_RESOURCE, including all inherited members.
cwWorkerThread | _FILESHARESAMPLE_RESOURCE
fIsAliveFailed | _FILESHARESAMPLE_RESOURCE
hCluster | _FILESHARESAMPLE_RESOURCE
hkeyParameters | _FILESHARESAMPLE_RESOURCE
hResource | _FILESHARESAMPLE_RESOURCE
hResourceHandle | _FILESHARESAMPLE_RESOURCE
props | _FILESHARESAMPLE_RESOURCE
propsActive | _FILESHARESAMPLE_RESOURCE
pwszComputerName | _FILESHARESAMPLE_RESOURCE
pwszExpandedPath | _FILESHARESAMPLE_RESOURCE
pwszResourceName | _FILESHARESAMPLE_RESOURCE
pwszUNCSharedPath | _FILESHARESAMPLE_RESOURCE
resid | _FILESHARESAMPLE_RESOURCE
state | _FILESHARESAMPLE_RESOURCE
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BTSTR Member List

This is the complete list of members for BTSTR, including all inherited members.
BTSTR(BSTR bstr) | BTSTR |
BTSTR(BSTR bstr) | BTSTR |
BTSTR(BSTR bstr) | BTSTR |
BTSTR(BSTR bstr) | BTSTR |
m_psz | BTSTR | [private]
operator LPTSTR() | BTSTR | [inline]
operator LPTSTR() | BTSTR | [inline]
operator LPTSTR() | BTSTR | [inline]
operator LPTSTR() | BTSTR | [inline]
~BTSTR() | BTSTR |
~BTSTR() | BTSTR |
~BTSTR() | BTSTR |
~BTSTR() | BTSTR |
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CGenericEnum Member List

This is the complete list of members for CGenericEnum, including all inherited members.
CGenericEnum(LPGENERICITEMLIST pGenericItemList, DWORD cOffset) | CGenericEnum |
Clone(CGenericEnum **ppenum) | CGenericEnum |
DeleteThisObject()=0 | CGenericEnum | [pure virtual]
m_cOffset | CGenericEnum |
m_cRef | CGenericEnum |
m_pGenericItemList | CGenericEnum |
m_pNextItem | CGenericEnum |
Next(ULONG celt, LPGENERICITEM rgelt, ULONG *pceltFetched) | CGenericEnum |
QueryInterface(REFIID, LPVOID FAR *) | CGenericEnum |
Reset() | CGenericEnum |
Skip(ULONG celt) | CGenericEnum |
STDMETHODIMP_(ULONG) AddRef() | CGenericEnum |
STDMETHODIMP_(ULONG) Release() | CGenericEnum |
~CGenericEnum() | CGenericEnum |
Generated on Wed Nov 13 2024 16:56:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/precomp.h Source File

  • Begin
  • sdkdiff

precomp.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #include <windows.h>
00012 #include <commdlg.h>
00013 #include <string.h>
00014 #include <strsafe.h>
00015 #include <stdio.h>
00016 #include <memory.h>
00017 #include <sys/types.h>
00018 #include <sys/stat.h>
00019
00020
00021 #include <stdlib.h>
00022 #include <dos.h>
00023 #include <direct.h>
00024 #include "gutils.h"
00025 #include "errorout.h"
00026
00027
00028 #include "gutils.h"
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreServe/FreServe.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • FreServe

FreServe.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FRESERVE.H
00003
00004   Summary:   Include file for the FRESERVE.DLL dynamic link library.
00005              Intended primarily for external users of this DLL who exploit
00006              it via static linkage to the DllRegisterServer and
00007              DllUnregisterServer exported service calls.
00008
00009              For a comprehensive tutorial code tour of FRESERVE's contents
00010              and offerings see the tutorial FRESERVE.HTM file. For more
00011              specific technical details on the internal workings see the
00012              comments dispersed throughout the FRESERVE source code.
00013
00014   Classes:   none.
00015
00016   Functions: DllRegisterServer, DllUnregisterServer.
00017
00018   Origin:    12-10-96: atrent - Editor-inheritance from DLLSERVE.H in
00019                the DLLSERVE Tutorial Code Sample. [Revised]
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(FRESERVE_H)
00037 #define FRESERVE_H
00038
00039 #if !defined(RC_INCLUDE)
00040
00041 #if !defined(_DLLEXPORT_)
00042
00043 // If _DLLEXPORT_ is NOT defined then the default is to import.
00044 #if defined(__cplusplus)
00045 #define DLLENTRY extern "C" __declspec(dllimport)
00046 #else
00047 #define DLLENTRY extern __declspec(dllimport)
00048 #endif
00049 #define STDENTRY DLLENTRY HRESULT WINAPI
00050 #define STDENTRY_(type) DLLENTRY type WINAPI
00051
00052 // Here is the list of server APIs offered by the DLL (using the
00053 // appropriate entry API declaration macros just #defined above).
00054
00055 STDENTRY DllRegisterServer(void);
00056
00057 STDENTRY DllUnregisterServer(void);
00058
00059 #else  // _DLLEXPORT_
00060
00061 // Else if _DLLEXPORT_ is indeed defined then we've been told to export.
00062 #if defined(__cplusplus)
00063 #define DLLENTRY extern "C" __declspec(dllimport)
00064 #else
00065 #define DLLENTRY extern __declspec(dllimport)
00066 #endif
00067 #define STDENTRY DLLENTRY HRESULT WINAPI
00068 #define STDENTRY_(type) DLLENTRY type WINAPI
00069
00070 #endif // _DLLEXPORT_
00071
00072 #endif // RC_INCLUDE
00073
00074 #endif // FRESERVE_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_AIO_WORK_ITEM Member List

This is the complete list of members for _AIO_WORK_ITEM, including all inherited members.
hFile | _AIO_WORK_ITEM
hseTf | _AIO_WORK_ITEM
listEntry | _AIO_WORK_ITEM
nRead | _AIO_WORK_ITEM
ov | _AIO_WORK_ITEM
pchBuffer | _AIO_WORK_ITEM
pecb | _AIO_WORK_ITEM
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/proppageuser.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

proppageuser.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       proppageuser.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "ProppageUser.h"
00013 #include "util.h"
00014 #include "adsprop.h"
00015 #include "dsclient.h"   //CFSTR_DSOBJECTNAMES
00016
00017 // IShellExtInit interface
00018 STDMETHODIMP CProppageUser::Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObject, HKEY hKeyID)
00019 {
00020   TRACE(L"CProppageUser::Initialize()\n");
00021   if (pDataObject != NULL)
00022   {
00023     // Store the IDataObject in a smart pointer.
00024     m_spDataObj = pDataObject;
00025   }
00026   else
00027   {
00028     return E_INVALIDARG;
00029   }
00030   return S_OK;
00031 }
00032
00033
00034
00035 // IShellPropSheetExt interface
00036 STDMETHODIMP CProppageUser::AddPages(LPFNADDPROPSHEETPAGE pAddPageProc, LPARAM lParam)
00037 {
00038   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00039   TRACE(L"CProppageUser::AddPages()\n");
00040
00041   // Unpack the data pointer and create the property page.
00042   // Register clipboard format
00043   CLIPFORMAT cfDsObjectNames = (CLIPFORMAT)RegisterClipboardFormat(CFSTR_DSOBJECTNAMES);
00044   ASSERT(cfDsObjectNames != 0);
00045
00046   FORMATETC fmte = { cfDsObjectNames, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00047   STGMEDIUM objMedium;
00048
00049   HRESULT hr = m_spDataObj->GetData(&fmte, &objMedium);
00050   if (FAILED(hr))
00051   {
00052     AfxMessageBox(_T("Failed to retrieve data from medium."));
00053     return hr;
00054   }
00055
00056   LPDSOBJECTNAMES pDsObjectNames;
00057   pDsObjectNames = (LPDSOBJECTNAMES)objMedium.hGlobal;
00058   if (pDsObjectNames->cItems < 1)
00059   {
00060     return ERROR_INVALID_DATA;
00061   }
00062
00063   PWSTR pszObjADsPath = (PWSTR)BYTE_OFFSET(pDsObjectNames, pDsObjectNames->aObjects[0].offsetName);
00064   PWSTR pszClass = (PWSTR)BYTE_OFFSET(pDsObjectNames, pDsObjectNames->aObjects[0].offsetClass);
00065   TRACE(_T("Object path: %s, class: %s\n"), pszObjADsPath, pszClass);
00066
00067   // Create/contact the notification object.
00068   HWND hNotifyObj;
00069
00070   hr = ADsPropCreateNotifyObj(m_spDataObj, pszObjADsPath, &hNotifyObj);
00071
00072   if (FAILED(hr))
00073   {
00074     return hr;
00075   }
00076
00077   CProppageUserUI* pProppageUI = new CProppageUserUI(hNotifyObj);
00078
00079   pProppageUI->Init(pszObjADsPath, pszClass);
00080
00081   ((PROPSHEETPAGE*)&pProppageUI->m_psp)->lParam = (LPARAM)pProppageUI;
00082   if (!(*pAddPageProc)(CreatePropertySheetPage((PROPSHEETPAGE*)&pProppageUI->m_psp), (LPARAM)lParam))
00083   {
00084     delete pProppageUI;
00085     return E_FAIL;
00086   }
00087   return S_OK;
00088 }
00089
00090 STDMETHODIMP CProppageUser::ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
00091 {
00092   //
00093   // This method is not used.
00094   //
00095   return E_NOTIMPL;
00096 }
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/globals.h Source File

  • SysMgmt
  • MMC
  • Simple

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025   #define IDM_BUTTON1    0x100
00026   #define IDM_BUTTON2    0x101
00027
00028   extern HINSTANCE g_hinst;
00029   extern ULONG g_uObjects;
00030
00031   #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032   #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034   // uncomment the following #define to enable message cracking
00035   // #define MMC_CRACK_MESSAGES
00036   void MMCN_Crack(BOOL bComponentData,
00037           IDataObject *pDataObject,
00038           IComponentData *pCompData,
00039           IComponent *pComp,
00040           MMC_NOTIFY_TYPE event,
00041           LPARAM arg,
00042           LPARAM param);
00043 #endif
00044
00045 //=--------------------------------------------------------------------------=
00046 // allocates a temporary buffer that will disappear when it goes out of scope
00047 // NOTE: be careful of that -- make sure you use the string in the same or
00048 // nested scope in which you created this buffer. people should not use this
00049 // class directly.  use the macro(s) below.
00050 //
00051 class TempBuffer {
00052   public:
00053     TempBuffer(ULONG cBytes) {
00054         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00055         m_fHeapAlloc = (cBytes > 120);
00056     }
00057     ~TempBuffer() {
00058         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00059     }
00060     void *GetBuffer() {
00061         return m_pBuf;
00062     }
00063
00064   private:
00065     void *m_pBuf;
00066     // we'll use this temp buffer for small cases.
00067     //
00068     char  m_szTmpBuf[120];
00069     unsigned m_fHeapAlloc:1;
00070 };
00071
00072 //=--------------------------------------------------------------------------=
00073 // string helpers.
00074 //
00075 // given a _TCHAR, copy it into a wide buffer.
00076 // be careful about scoping when using this macro!
00077 //
00078 // how to use the below two macros:
00079 //
00080 //  ...
00081 //  LPTSTR pszT;
00082 //  pszT = MyGetTStringRoutine();
00083 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00084 //  MyUseWideStringRoutine(pwsz);
00085 //  ...
00086 #ifdef UNICODE
00087 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00088     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00089     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00090     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00091     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00092 #else // ANSI
00093 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00094     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00095     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00096     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00097     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00098     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00099 #endif
00100
00101 #ifdef UNICODE
00102 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00103     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00104     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00105     lstrcpyW((LPWSTR)ptrname, tstr)
00106 #else // ANSI
00107 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00108     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00109     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00110     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00111     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00112 #endif
00113
00114 //
00115 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00116 // have to be declared, and no clean up must be done.
00117 //
00118 // * 2 for DBCS handling in below length computation
00119 //
00120 #ifdef UNICODE
00121 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00122     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00123     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00124     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00125     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00126 #else // ANSI
00127 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00128     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00129     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00130     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00131     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00132 #endif
00133
00134 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RqsConfig Member List

This is the complete list of members for RqsConfig, including all inherited members.
Clear() | RqsConfig |
ClearStrings(IN RqsConfigString *pStrings, IN UINT uiCount) | RqsConfig | [private]
Find(IN CHAR *pszString) const | RqsConfig |
GetConfigPath() | RqsConfig | [static]
GetDebugTrace() const | RqsConfig |
GetLibrary() const | RqsConfig |
GetPort() const | RqsConfig |
GetTraceEnabled() const | RqsConfig |
GetTracePath() | RqsConfig | [static]
Load() | RqsConfig |
LoadConfig() | RqsConfig |
LoadTrace() | RqsConfig |
m_fDebuggerTrace | RqsConfig | [private]
m_fTraceEnabled | RqsConfig | [private]
m_pStrings | RqsConfig | [private]
m_pszLibrary | RqsConfig | [private]
m_uiCount | RqsConfig | [private]
m_uiPort | RqsConfig | [private]
RqsConfig() | RqsConfig |
TraceSelf(const RqsEngine &Engine) | RqsConfig |
~RqsConfig() | RqsConfig |
Generated on Wed Nov 13 2024 16:57:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: UDDI/publish/AssemblyInfo.cs Source File

  • UDDI
  • publish

AssemblyInfo.cs

Go to the documentation of this file.
00001 /*=====================================================================
00002   This file is part of the Microsoft UDDI SDK Code Samples.
00003
00004   Copyright (C) Microsoft Corporation.  All rights reserved.
00005
00006 This source code is intended only as a supplement to Microsoft
00007 Development Tools and/or on-line documentation.  See these other
00008 materials for detailed information regarding Microsoft code samples.
00009
00010 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00011 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00012 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00013 PARTICULAR PURPOSE.
00014 =====================================================================*/
00015
00016 using System.Reflection;
00017 using System.Runtime.CompilerServices;
00018
00019 //
00020 // General Information about an assembly is controlled through the following
00021 // set of attributes. Change these attribute values to modify the information
00022 // associated with an assembly.
00023 //
00024 [assembly: AssemblyTitle("")]
00025 [assembly: AssemblyDescription("")]
00026 [assembly: AssemblyConfiguration("")]
00027 [assembly: AssemblyCompany("")]
00028 [assembly: AssemblyProduct("")]
00029 [assembly: AssemblyCopyright("")]
00030 [assembly: AssemblyTrademark("")]
00031 [assembly: AssemblyCulture("")]
00032
00033 //
00034 // Version information for an assembly consists of the following four values:
00035 //
00036 //      Major Version
00037 //      Minor Version
00038 //      Build Number
00039 //      Revision
00040 //
00041 // You can specify all the values or you can default the Revision and Build Numbers
00042 // by using the '*' as shown below:
00043
00044 [assembly: AssemblyVersion("1.0.*")]
00045
00046 //
00047 // In order to sign your assembly you must specify a key to use. Refer to the
00048 // Microsoft .NET Framework documentation for more information on assembly signing.
00049 //
00050 // Use the attributes below to control which key is used for signing.
00051 //
00052 // Notes:
00053 //   (*) If no key is specified, the assembly is not signed.
00054 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00055 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00056 //       a key.
00057 //   (*) If the KeyFile and the KeyName values are both specified, the
00058 //       following processing occurs:
00059 //       (1) If the KeyName can be found in the CSP, that key is used.
00060 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00061 //           in the KeyFile is installed into the CSP and used.
00062 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00063 //       When specifying the KeyFile, the location of the KeyFile should be
00064 //       relative to the project output directory which is
00065 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00066 //       located in the project directory, you would specify the AssemblyKeyFile
00067 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00068 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00069 //       documentation for more information on this.
00070 //
00071 [assembly: AssemblyDelaySign(false)]
00072 [assembly: AssemblyKeyFile("")]
00073 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcav.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcav.cpp

Go to the documentation of this file.
00001 // rtcav.cpp
00002 //
00003
00004 #include "stdafx.h"
00005
00006 CRTCAVSession * CRTCAVSession::m_Singleton = NULL;
00007 HWND CRTCAVSession::m_hRecvVideoParent = NULL;
00008 HWND CRTCAVSession::m_hPrevVideoParent = NULL;
00009
00010 /////////////////////////////////////////////
00011 //
00012 // CRTCAVSession::CRTCAVSession
00013 //
00014
00015 CRTCAVSession::CRTCAVSession() : CRTCSession()
00016 {
00017     m_Singleton = this;
00018
00019     m_fShowRecv = FALSE;
00020     m_fShowPrev = FALSE;
00021     m_lRecvWidth = 0;
00022     m_lRecvHeight = 0;
00023     m_lPrevWidth = 0;
00024     m_lPrevHeight = 0;
00025
00026     m_hMicText = NULL;
00027     m_hSpkText = NULL;
00028     m_hMicLevel = NULL;
00029     m_hSpkLevel = NULL;
00030     m_hMicVol = NULL;
00031     m_hSpkVol = NULL;
00032     m_hMicMute = NULL;
00033     m_hSpkMute = NULL;
00034 }
00035
00036 /////////////////////////////////////////////
00037 //
00038 // CRTCAVSession::~CRTCAVSession
00039 //
00040
00041 CRTCAVSession::~CRTCAVSession()
00042 {
00043     m_Singleton = NULL;
00044 }
00045
00046 /////////////////////////////////////////////
00047 //
00048 // CRTCAVSession::RegisterClass
00049 //
00050
00051 HRESULT CRTCAVSession::RegisterClass()
00052 {
00053     // Register the window class
00054     WNDCLASS wc;
00055     ATOM atom;
00056
00057     ZeroMemory(&wc, sizeof(WNDCLASS));
00058
00059     wc.style         = CS_HREDRAW | CS_VREDRAW;
00060     wc.lpfnWndProc   = (WNDPROC)CRTCAVSession::WindowProc;
00061     wc.hInstance     = GetModuleHandle(NULL);
00062     wc.hIcon         = NULL;
00063     wc.hCursor       =
00064         LoadCursor(NULL, IDC_ARROW);
00065     wc.hbrBackground =
00066         GetSysColorBrush(COLOR_3DFACE);
00067     wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU_AV);
00068     wc.lpszClassName = AV_CLASS;
00069
00070     atom = ::RegisterClass( &wc );
00071
00072     if ( !atom )
00073     {
00074         // RegisterClass failed
00075         return E_FAIL;
00076     }
00077
00078     return S_OK;
00079 }
00080
00081 /////////////////////////////////////////////
00082 //
00083 // CRTCAVSession::WindowProc
00084 //
00085
00086 LRESULT CALLBACK CRTCAVSession::WindowProc(
00087   HWND hWnd,      // handle to window
00088   UINT uMsg,      // message identifier
00089   WPARAM wParam,  // first message parameter
00090   LPARAM lParam   // second message parameter
00091 )
00092 {
00093     CRTCAVSession * me = NULL;
00094     LRESULT  lr = 0;
00095
00096     if ( uMsg == WM_CREATE )
00097     {
00098         // Create an instance of the class
00099         me = new CRTCAVSession;
00100         me->m_hWnd = hWnd;
00101
00102         // Store the class instance pointer in the
00103         // window's user data for later retrieval
00104         SetWindowLong(hWnd, GWL_USERDATA, (LONG)me);
00105
00106         lr = me->OnCreate(uMsg, wParam, lParam);
00107     }
00108     else
00109     {
00110         // Retrieve the class instance pointer from the
00111         // window's user data
00112         me = (CRTCAVSession *)GetWindowLong(hWnd, GWL_USERDATA);
00113
00114         switch( uMsg )
00115         {
00116         case WM_DESTROY:
00117             lr = me->OnDestroy(uMsg, wParam, lParam);
00118
00119             // Delete the object instance
00120             delete me;
00121
00122             break;
00123
00124         case WM_CLOSE:
00125             lr = me->OnClose(uMsg, wParam, lParam);
00126             break;
00127
00128         case WM_SIZE:
00129             lr = me->OnSize(uMsg, wParam, lParam);
00130             break;
00131
00132         case WM_COMMAND:
00133             lr = me->OnCommand(uMsg, wParam, lParam);
00134             break;
00135
00136         case WM_HSCROLL:
00137             lr = me->OnHScroll(uMsg, wParam, lParam);
00138             break;
00139
00140         default:
00141             lr = DefWindowProc( hWnd, uMsg, wParam, lParam );
00142         }
00143     }
00144
00145     return lr;
00146 }
00147
00148 /////////////////////////////////////////////
00149 //
00150 // CRTCAVSession::DoMute
00151 //
00152
00153 HRESULT CRTCAVSession::DoMute(RTC_AUDIO_DEVICE enDevice)
00154 {
00155     IRTCClient * pClient = NULL;
00156     BOOL fMute = FALSE;
00157     HWND hWnd = NULL;
00158     HRESULT hr;
00159
00160     hr = m_pSession->get_Client(&pClient);
00161
00162     if (FAILED(hr))
00163     {
00164         // get_Client failed
00165         return hr;
00166     }
00167
00168     if (enDevice == RTCAD_SPEAKER)
00169     {
00170         hWnd = m_hSpkMute;
00171     }
00172     else
00173     {
00174         hWnd = m_hMicMute;
00175     }
00176
00177     // Get current check state
00178     fMute = (SendMessage(hWnd, BM_GETCHECK, 0, 0) == BST_CHECKED);
00179
00180     // Toggle the check state
00181     fMute = !fMute;
00182
00183     // Set the current check state
00184     SendMessage(hWnd, BM_SETCHECK, (WPARAM)(fMute ? BST_CHECKED : BST_UNCHECKED), 0);
00185
00186     // Set the mute
00187     hr = pClient->put_AudioMuted(enDevice, fMute ? VARIANT_TRUE : VARIANT_FALSE);
00188
00189     if (FAILED(hr))
00190     {
00191         // put_AudioMute failed
00192         SAFE_RELEASE(pClient);
00193         return hr;
00194     }
00195
00196     SAFE_RELEASE(pClient);
00197
00198     return S_OK;
00199 }
00200
00201 /////////////////////////////////////////////
00202 //
00203 // CRTCAVSession::DoVolume
00204 //
00205
00206 HRESULT CRTCAVSession::DoVolume(RTC_AUDIO_DEVICE enDevice, long lVolume)
00207 {
00208     IRTCClient * pClient = NULL;
00209     HRESULT hr;
00210
00211     hr = m_pSession->get_Client(&pClient);
00212
00213     if (FAILED(hr))
00214     {
00215         // get_Client failed
00216         return hr;
00217     }
00218
00219     // Set the volume
00220     hr = pClient->put_Volume(enDevice, lVolume);
00221
00222     if (FAILED(hr))
00223     {
00224         // put_Volume failed
00225         SAFE_RELEASE(pClient);
00226         return hr;
00227     }
00228
00229     SAFE_RELEASE(pClient);
00230
00231     return S_OK;
00232 }
00233
00234 /////////////////////////////////////////////
00235 //
00236 // CRTCAVSession::ShowAudio
00237 //
00238
00239 HRESULT CRTCAVSession::ShowAudio()
00240 {
00241     IRTCClient * pClient = NULL;
00242     VARIANT_BOOL fMute = FALSE;
00243     long lVolume = 0;
00244     long lMediaCaps = 0;
00245     HRESULT hr;
00246
00247     hr = m_pSession->get_Client(&pClient);
00248
00249     if (FAILED(hr))
00250     {
00251         // get_Client failed
00252         return hr;
00253     }
00254
00255     // Get the media capabilities
00256     hr = pClient->get_MediaCapabilities(&lMediaCaps);
00257
00258     if (FAILED(hr))
00259     {
00260         // get_MediaCapabilities failed
00261         SAFE_RELEASE(pClient);
00262         return hr;
00263     }
00264
00265     if (lMediaCaps & RTCMT_AUDIO_RECEIVE)
00266     {
00267         // Enable the speaker windows
00268         EnableWindow(m_hSpkText, TRUE);
00269         EnableWindow(m_hSpkLevel, TRUE);
00270         EnableWindow(m_hSpkVol, TRUE);
00271         EnableWindow(m_hSpkMute, TRUE);
00272
00273         // Show the speaker mute state
00274         hr = pClient->get_AudioMuted(RTCAD_SPEAKER, &fMute);
00275
00276         if (FAILED(hr))
00277         {
00278             // get_AudioMuted failed
00279             SAFE_RELEASE(pClient);
00280             return hr;
00281         }
00282
00283         SendMessage(m_hSpkMute, BM_SETCHECK, fMute ? BST_CHECKED : BST_UNCHECKED, 0);
00284
00285         // Show the speaker volume
00286         hr = pClient->get_Volume(RTCAD_SPEAKER, &lVolume);
00287
00288         if (FAILED(hr))
00289         {
00290             // get_Volume failed
00291             SAFE_RELEASE(pClient);
00292             return hr;
00293         }
00294
00295         SendMessage(m_hSpkVol, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)lVolume);
00296     }
00297     else
00298     {
00299         // Disable the speaker windows
00300         EnableWindow(m_hSpkText, FALSE);
00301         EnableWindow(m_hSpkLevel, FALSE);
00302         EnableWindow(m_hSpkVol, FALSE);
00303         EnableWindow(m_hSpkMute, FALSE);
00304     }
00305
00306     if (lMediaCaps & RTCMT_AUDIO_SEND)
00307     {
00308         // Enable the microphone windows
00309         EnableWindow(m_hMicText, TRUE);
00310         EnableWindow(m_hMicLevel, TRUE);
00311         EnableWindow(m_hMicVol, TRUE);
00312         EnableWindow(m_hMicMute, TRUE);
00313
00314         // Show the microphone mute state
00315         hr = pClient->get_AudioMuted(RTCAD_MICROPHONE, &fMute);
00316
00317         if (FAILED(hr))
00318         {
00319             // get_AudioMuted failed
00320             SAFE_RELEASE(pClient);
00321             return hr;
00322         }
00323
00324         SendMessage(m_hMicMute, BM_SETCHECK, fMute ? BST_CHECKED : BST_UNCHECKED, 0);
00325
00326         // Show the microphone volume
00327         hr = pClient->get_Volume(RTCAD_MICROPHONE, &lVolume);
00328
00329         if (FAILED(hr))
00330         {
00331             // get_Volume failed
00332             SAFE_RELEASE(pClient);
00333             return hr;
00334         }
00335
00336         SendMessage(m_hMicVol, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)lVolume);
00337     }
00338     else
00339     {
00340         // Disable the microphone windows
00341         EnableWindow(m_hMicText, FALSE);
00342         EnableWindow(m_hMicLevel, FALSE);
00343         EnableWindow(m_hMicVol, FALSE);
00344         EnableWindow(m_hMicMute, FALSE);
00345     }
00346
00347     SAFE_RELEASE(pClient);
00348
00349     return S_OK;
00350 }
00351
00352 /////////////////////////////////////////////
00353 //
00354 // CRTCAVSession::ShowVideo
00355 //
00356
00357 HRESULT CRTCAVSession::ShowVideo(RTC_VIDEO_DEVICE enDevice, BOOL fShow)
00358 {
00359     IVideoWindow * pVid = NULL;
00360     IRTCClient * pClient = NULL;
00361     long lMediaCaps = 0;
00362     HWND hWnd = NULL;
00363     HRESULT hr;
00364
00365     hr = m_pSession->get_Client(&pClient);
00366
00367     if (FAILED(hr))
00368     {
00369         // get_Client failed
00370         return hr;
00371     }
00372
00373     // Get the media capabilities
00374     hr = pClient->get_MediaCapabilities(&lMediaCaps);
00375
00376     if (FAILED(hr))
00377     {
00378         // get_MediaCapabilities failed
00379         SAFE_RELEASE(pClient);
00380         return hr;
00381     }
00382
00383     hr = pClient->get_IVideoWindow(
00384         enDevice, &pVid);
00385
00386     SAFE_RELEASE(pClient);
00387
00388     if (FAILED(hr))
00389     {
00390         // get_IVideoWindow failed
00391         return hr;
00392     }
00393
00394     if (enDevice == RTCVD_PREVIEW)
00395     {
00396         // Determine whether to show the preview video
00397         fShow = fShow && (lMediaCaps & RTCMT_VIDEO_SEND);
00398         m_fShowPrev = fShow;
00399         hWnd = m_hPrevVideoParent;
00400
00401         // Show or hide the preview video preview parent window
00402         ShowWindow(m_hPrevVideoParent, fShow ? SW_SHOW : SW_HIDE);
00403
00404         // Set window region for receive video parent window
00405         HRGN hRegion;
00406
00407         if (fShow)
00408         {
00409             // Set the receive video region to make room for the preview
00410             // video picture-in-picture
00411             POINT rgPoints[6] =
00412                     { 0, 0,
00413                       0, m_lRecvHeight,
00414                       m_lRecvWidth - m_lPrevWidth, m_lRecvHeight,
00415                       m_lRecvWidth - m_lPrevWidth, m_lRecvHeight - m_lPrevHeight,
00416                       m_lRecvWidth, m_lRecvHeight - m_lPrevHeight,
00417                       m_lRecvWidth, 0
00418                     };
00419
00420             hRegion = CreatePolygonRgn(rgPoints, 6, ALTERNATE);
00421         }
00422         else
00423         {
00424             // Set the receive video region to be rectangular
00425             hRegion = CreateRectRgn(0, 0, m_lRecvWidth, m_lRecvHeight);
00426         }
00427
00428         SetWindowRgn(m_hRecvVideoParent, hRegion, TRUE);
00429     }
00430     else
00431     {
00432         // Determine whether to show the receive video
00433         fShow = fShow && (lMediaCaps & RTCMT_VIDEO_RECEIVE);
00434         m_fShowRecv = fShow;
00435         hWnd = m_hRecvVideoParent;
00436
00437         // Always show the video receive parent window
00438         ShowWindow(m_hRecvVideoParent, SW_SHOW);
00439     }
00440
00441     if ( fShow == TRUE )
00442     {
00443         // Set the video window style
00444         pVid->put_WindowStyle( WS_CHILD |
00445                                WS_CLIPCHILDREN |
00446                                WS_CLIPSIBLINGS );
00447
00448         // Set the parent window for the video window
00449         pVid->put_Owner( (OAHWND)hWnd );
00450
00451         RECT rc;
00452         GetClientRect(hWnd, &rc );
00453
00454         // Position the video window
00455         pVid->SetWindowPosition(
00456             rc.left,
00457             rc.top,
00458             rc.right,
00459             rc.bottom
00460             );
00461
00462         // Make the video window visible
00463         pVid->put_Visible(-1);
00464     }
00465
00466     SAFE_RELEASE(pVid);
00467
00468     return S_OK;
00469 }
00470
00471 /////////////////////////////////////////////
00472 //
00473 // CRTCAVSession::OnCreate
00474 //
00475
00476 LRESULT CRTCAVSession::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam)
00477 {
00478     // Call the base class
00479     CRTCSession::OnCreate(uMsg, wParam, lParam);
00480
00481     if (m_hRecvVideoParent == NULL)
00482     {
00483         // Create the receive video parent window
00484         m_hRecvVideoParent = CreateWindowExW(
00485             WS_EX_CLIENTEDGE,
00486             L"STATIC",
00487             NULL,
00488             WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
00489             0, 0,
00490             0, 0,
00491             m_hWnd,
00492             NULL,
00493             GetModuleHandle(NULL),
00494             NULL);
00495
00496         if ( !m_hRecvVideoParent )
00497         {
00498             // CreateWindowExW failed
00499             return -1;
00500         }
00501     }
00502     else
00503     {
00504         // Take ownership of the receive video parent window
00505         if (!SetParent(m_hRecvVideoParent, m_hWnd))
00506         {
00507             // SetParent failed
00508             return -1;
00509         }
00510     }
00511
00512     if (m_hPrevVideoParent == NULL)
00513     {
00514         // Create the preview video parent window
00515         m_hPrevVideoParent = CreateWindowExW(
00516             WS_EX_CLIENTEDGE,
00517             L"STATIC",
00518             NULL,
00519             WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
00520             0, 0,
00521             0, 0,
00522             m_hWnd,
00523             NULL,
00524             GetModuleHandle(NULL),
00525             NULL);
00526
00527         if ( !m_hPrevVideoParent )
00528         {
00529             // CreateWindowExW failed
00530             return -1;
00531         }
00532     }
00533     else
00534     {
00535         // Take ownership of the preview video parent window
00536         if (!SetParent(m_hPrevVideoParent, m_hWnd))
00537         {
00538             // SetParent failed
00539             return -1;
00540         }
00541     }
00542
00543     // Create the microphone text window
00544     m_hMicText = CreateWindowExW(
00545         0,
00546         L"STATIC",
00547         L"Microphone",
00548         WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
00549         0, 0,
00550         0, 0,
00551         m_hWnd,
00552         NULL,
00553         GetModuleHandle(NULL),
00554         NULL);
00555
00556     if ( !m_hMicText )
00557     {
00558         // CreateWindowExW failed
00559         return -1;
00560     }
00561
00562     // Create the speaker text window
00563     m_hSpkText = CreateWindowExW(
00564         0,
00565         L"STATIC",
00566         L"Speaker",
00567         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
00568         0, 0,
00569         0, 0,
00570         m_hWnd,
00571         NULL,
00572         GetModuleHandle(NULL),
00573         NULL);
00574
00575     if ( !m_hSpkText )
00576     {
00577         // CreateWindowExW failed
00578         return -1;
00579     }
00580
00581     // Create the microphone level window
00582     m_hMicLevel = CreateWindowExW(
00583         WS_EX_CLIENTEDGE,
00584         PROGRESS_CLASS,
00585         NULL,
00586         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
00587         0, 0,
00588         0, 0,
00589         m_hWnd,
00590         NULL,
00591         GetModuleHandle(NULL),
00592         NULL);
00593
00594     if ( !m_hMicLevel )
00595     {
00596         // CreateWindowExW failed
00597         return -1;
00598     }
00599
00600     // Create the speaker level window
00601     m_hSpkLevel = CreateWindowExW(
00602         WS_EX_CLIENTEDGE,
00603         PROGRESS_CLASS,
00604         NULL,
00605         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
00606         0, 0,
00607         0, 0,
00608         m_hWnd,
00609         NULL,
00610         GetModuleHandle(NULL),
00611         NULL);
00612
00613     if ( !m_hSpkLevel )
00614     {
00615         // CreateWindowExW failed
00616         return -1;
00617     }
00618
00619     // Create the microphone volume window
00620     m_hMicVol = CreateWindowExW(
00621         0,
00622         TRACKBAR_CLASS,
00623         NULL,
00624         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
00625         0, 0,
00626         0, 0,
00627         m_hWnd,
00628         (HMENU)IDC_MIC_VOL,
00629         GetModuleHandle(NULL),
00630         NULL);
00631
00632     if ( !m_hMicVol )
00633     {
00634         // CreateWindowExW failed
00635         return -1;
00636     }
00637
00638     SendMessage(m_hMicVol, TBM_SETRANGEMAX, (WPARAM)FALSE, (LPARAM)0xFFFF);
00639
00640     // Create the speaker volume window
00641     m_hSpkVol = CreateWindowExW(
00642         0,
00643         TRACKBAR_CLASS,
00644         NULL,
00645         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
00646         0, 0,
00647         0, 0,
00648         m_hWnd,
00649         (HMENU)IDC_SPK_VOL,
00650         GetModuleHandle(NULL),
00651         NULL);
00652
00653     if ( !m_hSpkVol )
00654     {
00655         // CreateWindowExW failed
00656         return -1;
00657     }
00658
00659     SendMessage(m_hSpkVol, TBM_SETRANGEMAX, (WPARAM)FALSE, (LPARAM)0xFFFF);
00660
00661     // Create the microphone mute window
00662     m_hMicMute = CreateWindowExW(
00663         0,
00664         L"BUTTON",
00665         L"Mute",
00666         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_CHECKBOX,
00667         0, 0,
00668         0, 0,
00669         m_hWnd,
00670         (HMENU)IDC_MIC_MUTE,
00671         GetModuleHandle(NULL),
00672         NULL);
00673
00674     if ( !m_hMicMute )
00675     {
00676         // CreateWindowExW failed
00677         return -1;
00678     }
00679
00680     // Create the speaker mute window
00681     m_hSpkMute = CreateWindowExW(
00682         0,
00683         L"BUTTON",
00684         L"Mute",
00685         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_CHECKBOX,
00686         0, 0,
00687         0, 0,
00688         m_hWnd,
00689         (HMENU)IDC_SPK_MUTE,
00690         GetModuleHandle(NULL),
00691         NULL);
00692
00693     if ( !m_hSpkMute )
00694     {
00695         // CreateWindowExW failed
00696         return -1;
00697     }
00698
00699     return 0;
00700 }
00701
00702 /////////////////////////////////////////////
00703 //
00704 // CRTCAVSession::OnDestroy
00705 //
00706
00707 LRESULT CRTCAVSession::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam)
00708 {
00709     // Orphan the receive video parent window
00710     ShowWindow(m_hRecvVideoParent, SW_HIDE);
00711     SetParent(m_hRecvVideoParent, NULL);
00712
00713     // Orphan the preview video parent window
00714     ShowWindow(m_hPrevVideoParent, SW_HIDE);
00715     SetParent(m_hPrevVideoParent, NULL);
00716
00717     // Call the base class
00718     CRTCSession::OnDestroy(uMsg, wParam, lParam);
00719
00720     return 0;
00721 }
00722
00723 /////////////////////////////////////////////
00724 //
00725 // CRTCAVSession::OnSize
00726 //
00727
00728 LRESULT CRTCAVSession::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam)
00729 {
00730     // Call the base class
00731     CRTCSession::OnSize(uMsg, wParam, lParam);
00732
00733     RECT rcWnd, rcStatusBar;
00734     const int SIZE_EDGE = 5;
00735     const int TEXT_HEIGHT = 16;
00736     const int LEVEL_HEIGHT = 10;
00737     const int VOL_HEIGHT = 20;
00738
00739     GetClientRect(m_hWnd, &rcWnd);
00740     GetClientRect(m_hStatusBar, &rcStatusBar);
00741
00742     // Calculate video window size
00743     float fAspectRatio = (float)QCIF_CY_SIZE/(float)QCIF_CX_SIZE;
00744     m_lRecvWidth = rcWnd.right - rcWnd.left - 2*SIZE_EDGE;
00745     m_lRecvHeight = fAspectRatio * m_lRecvWidth;
00746     m_lPrevWidth = QQCIF_CX_SIZE;
00747     m_lPrevHeight = QQCIF_CY_SIZE;
00748
00749     // Resize the receive video parent window
00750     RECT rcRecvVid;
00751
00752     rcRecvVid.left = rcWnd.left + SIZE_EDGE;
00753     rcRecvVid.right = rcWnd.left + m_lRecvWidth + SIZE_EDGE;
00754     rcRecvVid.top = rcWnd.top + SIZE_EDGE;
00755     rcRecvVid.bottom = rcWnd.top + m_lRecvHeight + SIZE_EDGE;
00756
00757     MoveWindow(
00758         m_hRecvVideoParent,
00759         rcRecvVid.left,
00760         rcRecvVid.top,
00761         m_lRecvWidth,
00762         m_lRecvHeight,
00763         TRUE);
00764
00765     // Resize the preview video parent window
00766     RECT rcPrevVid;
00767
00768     rcPrevVid.left = rcRecvVid.right - m_lPrevWidth;
00769     rcPrevVid.right = rcRecvVid.right;
00770     rcPrevVid.top = rcRecvVid.bottom - m_lPrevHeight;
00771     rcPrevVid.bottom = rcRecvVid.bottom;
00772
00773     MoveWindow(
00774         m_hPrevVideoParent,
00775         rcPrevVid.left,
00776         rcPrevVid.top,
00777         m_lPrevWidth,
00778         m_lPrevHeight,
00779         TRUE);
00780
00781     // Update video windows
00782     ShowVideo(RTCVD_RECEIVE, m_fShowRecv);
00783     ShowVideo(RTCVD_PREVIEW, m_fShowPrev);
00784
00785     // Resize the speaker text window
00786     RECT rcSpkText;
00787
00788     rcSpkText.left = rcRecvVid.left;
00789     rcSpkText.right = rcRecvVid.left + m_lRecvWidth/2 - SIZE_EDGE;
00790     rcSpkText.top = rcRecvVid.bottom + SIZE_EDGE;
00791     rcSpkText.bottom = rcSpkText.top + TEXT_HEIGHT;
00792
00793     MoveWindow(
00794         m_hSpkText,
00795         rcSpkText.left,
00796         rcSpkText.top,
00797         (rcSpkText.right - rcSpkText.left),
00798         (rcSpkText.bottom - rcSpkText.top),
00799         TRUE);
00800
00801     // Resize the microphone text window
00802     RECT rcMicText;
00803
00804     rcMicText.left = rcRecvVid.right - m_lRecvWidth/2 + SIZE_EDGE;
00805     rcMicText.right = rcRecvVid.right;
00806     rcMicText.top = rcRecvVid.bottom + SIZE_EDGE;
00807     rcMicText.bottom = rcMicText.top + TEXT_HEIGHT;
00808
00809     MoveWindow(
00810         m_hMicText,
00811         rcMicText.left,
00812         rcMicText.top,
00813         (rcMicText.right - rcMicText.left),
00814         (rcMicText.bottom - rcMicText.top),
00815         TRUE);
00816
00817     // Resize the speaker level window
00818     RECT rcSpkLevel;
00819
00820     rcSpkLevel.left = rcSpkText.left;
00821     rcSpkLevel.right = rcSpkText.right;
00822     rcSpkLevel.top = rcSpkText.bottom + SIZE_EDGE;
00823     rcSpkLevel.bottom = rcSpkLevel.top + LEVEL_HEIGHT;
00824
00825     MoveWindow(
00826         m_hSpkLevel,
00827         rcSpkLevel.left,
00828         rcSpkLevel.top,
00829         (rcSpkLevel.right - rcSpkLevel.left),
00830         (rcSpkLevel.bottom - rcSpkLevel.top),
00831         TRUE);
00832
00833     // Resize the microphone level window
00834     RECT rcMicLevel;
00835
00836     rcMicLevel.left = rcMicText.left;
00837     rcMicLevel.right = rcMicText.right;
00838     rcMicLevel.top = rcMicText.bottom + SIZE_EDGE;
00839     rcMicLevel.bottom = rcMicLevel.top + LEVEL_HEIGHT;
00840
00841     MoveWindow(
00842         m_hMicLevel,
00843         rcMicLevel.left,
00844         rcMicLevel.top,
00845         (rcMicLevel.right - rcMicLevel.left),
00846         (rcMicLevel.bottom - rcMicLevel.top),
00847         TRUE);
00848
00849
00850     // Resize the speaker volume window
00851     RECT rcSpkVol;
00852
00853     rcSpkVol.left = rcSpkLevel.left;
00854     rcSpkVol.right = rcSpkLevel.right;
00855     rcSpkVol.top = rcSpkLevel.bottom + SIZE_EDGE;
00856     rcSpkVol.bottom = rcSpkVol.top + VOL_HEIGHT;
00857
00858     MoveWindow(
00859         m_hSpkVol,
00860         rcSpkVol.left,
00861         rcSpkVol.top,
00862         (rcSpkVol.right - rcSpkVol.left),
00863         (rcSpkVol.bottom - rcSpkVol.top),
00864         TRUE);
00865
00866     // Resize the microphone volume window
00867     RECT rcMicVol;
00868
00869     rcMicVol.left = rcMicLevel.left;
00870     rcMicVol.right = rcMicLevel.right;
00871     rcMicVol.top = rcMicLevel.bottom + SIZE_EDGE;
00872     rcMicVol.bottom = rcMicVol.top + VOL_HEIGHT;
00873
00874     MoveWindow(
00875         m_hMicVol,
00876         rcMicVol.left,
00877         rcMicVol.top,
00878         (rcMicVol.right - rcMicVol.left),
00879         (rcMicVol.bottom - rcMicVol.top),
00880         TRUE);
00881
00882     // Resize the speaker mute window
00883     RECT rcSpkMute;
00884
00885     rcSpkMute.left = rcSpkVol.left;
00886     rcSpkMute.right = rcSpkVol.right;
00887     rcSpkMute.top = rcSpkVol.bottom + SIZE_EDGE;
00888     rcSpkMute.bottom = rcSpkMute.top + TEXT_HEIGHT;
00889
00890     MoveWindow(
00891         m_hSpkMute,
00892         rcSpkMute.left,
00893         rcSpkMute.top,
00894         (rcSpkMute.right - rcSpkMute.left),
00895         (rcSpkMute.bottom - rcSpkMute.top),
00896         TRUE);
00897
00898     // Resize the microphone mute window
00899     RECT rcMicMute;
00900
00901     rcMicMute.left = rcMicVol.left;
00902     rcMicMute.right = rcMicVol.right;
00903     rcMicMute.top = rcMicVol.bottom + SIZE_EDGE;
00904     rcMicMute.bottom = rcMicMute.top + TEXT_HEIGHT;
00905
00906     MoveWindow(
00907         m_hMicMute,
00908         rcMicMute.left,
00909         rcMicMute.top,
00910         (rcMicMute.right - rcMicMute.left),
00911         (rcMicMute.bottom - rcMicMute.top),
00912         TRUE);
00913
00914     // Update the audio windows
00915     ShowAudio();
00916
00917     return 0;
00918 }
00919
00920 /////////////////////////////////////////////
00921 //
00922 // CRTCAVSession::OnCommand
00923 //
00924
00925 LRESULT CRTCAVSession::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam)
00926 {
00927     switch(LOWORD(wParam))
00928     {
00929     case ID_FILE_EXIT:
00930         PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00931         break;
00932
00933     case IDC_MIC_MUTE:
00934         DoMute(RTCAD_MICROPHONE);
00935         break;
00936
00937     case IDC_SPK_MUTE:
00938         DoMute(RTCAD_SPEAKER);
00939         break;
00940     }
00941
00942     return 0;
00943 }
00944
00945 /////////////////////////////////////////////
00946 //
00947 // CRTCAVSession::OnHScroll
00948 //
00949
00950 LRESULT CRTCAVSession::OnHScroll(UINT uMsg, WPARAM wParam, LPARAM lParam)
00951 {
00952     if ((LOWORD(wParam) == SB_THUMBPOSITION) ||
00953         (LOWORD(wParam) == SB_THUMBTRACK))
00954     {
00955         if ((HWND)lParam == m_hSpkVol)
00956         {
00957             // Speaker volume adjusted
00958             DoVolume(RTCAD_SPEAKER, HIWORD(wParam));
00959         }
00960         else if ((HWND)lParam == m_hMicVol)
00961         {
00962             // Microphone volume adjusted
00963             DoVolume(RTCAD_MICROPHONE, HIWORD(wParam));
00964         }
00965     }
00966
00967     return 0;
00968 }
00969
00970 /////////////////////////////////////////////
00971 //
00972 // CRTCAVSession::DeliverMedia
00973 //
00974
00975 HRESULT CRTCAVSession::DeliverMedia(long lMediaType, RTC_MEDIA_EVENT_TYPE enType, RTC_MEDIA_EVENT_REASON enReason)
00976 {
00977     RTC_VIDEO_DEVICE enVideo;
00978     BOOL fShow;
00979     HRESULT hr;
00980
00981     // Which media type changed?
00982     switch (lMediaType)
00983     {
00984     case RTCMT_VIDEO_SEND:
00985         enVideo = RTCVD_PREVIEW;
00986         break;
00987
00988     case RTCMT_VIDEO_RECEIVE:
00989         enVideo = RTCVD_RECEIVE;
00990         break;
00991
00992     default:
00993         return S_OK;
00994     }
00995
00996     // Did the media start or stop?
00997     switch (enType)
00998     {
00999     case RTCMET_STARTED:
01000         fShow = TRUE;
01001         break;
01002
01003     case RTCMET_STOPPED:
01004     case RTCMET_FAILED:
01005         fShow = FALSE;
01006         break;
01007
01008     default:
01009         return S_OK;
01010     }
01011
01012     // Show or hide the video as appropriate
01013     hr = ShowVideo(enVideo, fShow);
01014
01015     if (FAILED(hr))
01016     {
01017         // ShowVideo failed
01018         return hr;
01019     }
01020
01021     return S_OK;
01022 }
01023
01024 /////////////////////////////////////////////
01025 //
01026 // CRTCAVSession::DeliverIntensity
01027 //
01028
01029 HRESULT CRTCAVSession::DeliverIntensity(RTC_AUDIO_DEVICE enDevice, long lLevel)
01030 {
01031     switch(enDevice)
01032     {
01033     case RTCAD_SPEAKER:
01034         // Set the position of the speaker progress bar
01035         SendMessage(m_hSpkLevel, PBM_SETPOS, (WPARAM)lLevel, 0);
01036         break;
01037
01038     case RTCAD_MICROPHONE:
01039         // Set the position of the microphone progress bar
01040         SendMessage(m_hMicLevel, PBM_SETPOS, (WPARAM)lLevel, 0);
01041         break;
01042     }
01043
01044     return S_OK;
01045 }
01046
01047 /////////////////////////////////////////////
01048 //
01049 // CRTCAVSession::DeliverClient
01050 //
01051
01052 HRESULT CRTCAVSession::DeliverClient(RTC_CLIENT_EVENT_TYPE enEventType)
01053 {
01054     switch(enEventType)
01055     {
01056     case RTCCET_VOLUME_CHANGE:
01057         // On volume change refresh the audio controls
01058         // so volume controls can be updated
01059         ShowAudio();
01060         break;
01061
01062     case RTCCET_DEVICE_CHANGE:
01063         // On device change refresh the audio and video
01064         // controls as available devices may have changed
01065         ShowAudio();
01066         ShowVideo(RTCVD_PREVIEW, m_fShowPrev);
01067         ShowVideo(RTCVD_RECEIVE, m_fShowRecv);
01068         break;
01069     }
01070
01071     return S_OK;
01072 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/inc/IsapiString.h Source File

  • Web
  • iis
  • ISAPI_6.0
  • inc

IsapiString.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: IsapiString.h
00006
00007 Abstract:
00008
00009     A simple string class build on
00010     the ISAPI_BUFFER class
00011
00012 Author:
00013
00014     ISAPI developer (Microsoft employee), October 2002
00015
00016 --*/
00017
00018 #ifndef _isapistring_h
00019 #define _isapistring_h
00020
00021 #include <IsapiTools.h>
00022
00023 class ISAPI_STRING
00024 {
00025 public:
00026
00027     ISAPI_STRING(
00028         DWORD   dwMaxAlloc = 0
00029         );
00030
00031     virtual
00032     ~ISAPI_STRING();
00033
00034     BOOL
00035     Copy(
00036         CHAR *  szString,
00037         DWORD   cchString = 0
00038         );
00039
00040     BOOL
00041     CopyW(
00042         WCHAR * szStringW,
00043         DWORD   cchStringW = 0
00044         );
00045
00046     BOOL
00047     Append(
00048         CHAR *  szString,
00049         DWORD   cchString = 0
00050         );
00051
00052     BOOL
00053     AppendW(
00054         WCHAR * szStringW,
00055         DWORD   cchStringW = 0
00056         );
00057
00058     BOOL
00059     Printf(
00060         CHAR *  szString,
00061         ...
00062         );
00063
00064     BOOL
00065     Vsprintf(
00066         CHAR *  szFormat,
00067         va_list args
00068         );
00069
00070     VOID
00071     CalcLen(
00072         VOID
00073         );
00074
00075     DWORD
00076     QueryCB(
00077         VOID
00078         );
00079
00080     DWORD
00081     QueryCCH(
00082         VOID
00083         );
00084
00085     BOOL
00086     SetLen(
00087         DWORD   cchNewLength
00088         );
00089
00090     DWORD
00091     QueryBufferSize(
00092         VOID
00093         );
00094
00095     BOOL
00096     ResizeBuffer(
00097         DWORD   cbSize
00098         );
00099
00100     DWORD
00101     QueryMaxAlloc(
00102         VOID
00103         );
00104
00105     VOID
00106     SetMaxAlloc(
00107         DWORD   dwMaxAlloc
00108         );
00109
00110     CHAR *
00111     FindStr(
00112         CHAR *  szSubString,
00113         BOOL    fCaseInsensitive = FALSE,
00114         DWORD   dwStartingOffset = 0
00115         );
00116
00117     BOOL
00118     Base64Encode(
00119         VOID *  pBuffer,
00120         DWORD   cbBuffer
00121         );
00122
00123     BOOL
00124     Escape(
00125         BOOL    fAllowDoubleEscaping = FALSE
00126         );
00127
00128     VOID
00129     Unescape(
00130         VOID
00131         );
00132
00133     CHAR *
00134     QueryStr(
00135         VOID
00136         );
00137
00138     VOID
00139     ZeroBuffer(
00140         VOID
00141         );
00142
00143 private:
00144
00145     ISAPI_BUFFER    _Buffer;
00146
00147     BOOL
00148     CopyToOffset(
00149         CHAR *  szString,
00150         DWORD   cchString,
00151         DWORD   dwOffset
00152         );
00153
00154     BOOL
00155     CopyWToOffset(
00156         WCHAR * szStringW,
00157         DWORD   cchStringW,
00158         DWORD   dwOffset
00159         );
00160 };
00161
00162 #endif  // _isapistring_h
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCertExitSample Member List

This is the complete list of members for CCertExitSample, including all inherited members.
_ExpandEnvironmentVariables(IN WCHAR const *pwszIn, OUT WCHAR *pwszOut, IN DWORD cwcOut) | CCertExitSample | [private]
_ExpandEnvironmentVariables(IN WCHAR const *pwszIn, OUT WCHAR *pwszOut, IN DWORD cwcOut) | CCertExitSample | [private]
_NotifyCRLIssued(IN LONG Context) | CCertExitSample | [private]
_NotifyCRLIssued(IN LONG Context) | CCertExitSample | [private]
_NotifyNewCert(IN LONG Context) | CCertExitSample | [private]
_NotifyNewCert(IN LONG Context) | CCertExitSample | [private]
_WriteCertToFile(IN ICertServerExit *pServer, IN BYTE const *pbCert, IN DWORD cbCert) | CCertExitSample | [private]
_WriteCertToFile(IN ICertServerExit *pServer, IN BYTE const *pbCert, IN DWORD cbCert) | CCertExitSample | [private]
CCertExitSample() | CCertExitSample | [inline]
CCertExitSample() | CCertExitSample | [inline]
DECLARE_REGISTRY(CCertExitSample, wszCLASS_CERTEXITSAMPLE TEXT(".1"), wszCLASS_CERTEXITSAMPLE, IDS_CERTEXIT_DESC, THREADFLAGS_BOTH) STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) | CCertExitSample |
DECLARE_REGISTRY(CCertExitSample, wszCLASS_CERTEXITSAMPLE TEXT(".1"), wszCLASS_CERTEXITSAMPLE, IDS_CERTEXIT_DESC, THREADFLAGS_BOTH) STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) | CCertExitSample |
GetDescription(BSTR *pstrDescription) | CCertExitSample |
GetDescription(BSTR *pstrDescription) | CCertExitSample |
GetManageModule(ICertManageModule **ppManageModule) | CCertExitSample |
Initialize(BSTR const strConfig, LONG __RPC_FAR *pEventMask) | CCertExitSample |
Initialize(BSTR const strConfig, LONG __RPC_FAR *pEventMask) | CCertExitSample |
m_bstrDescription | CCertExitSample | [private]
m_cCACert | CCertExitSample | [private]
m_cCRLPublishRetryCount | CCertExitSample | [private]
m_dwExitPublishFlags | CCertExitSample | [private]
m_hExitKey | CCertExitSample | [private]
m_pwszRegStorageLoc | CCertExitSample | [private]
m_strCAName | CCertExitSample | [private]
m_strDescription | CCertExitSample | [private]
m_wszRegStorageLoc | CCertExitSample | [private]
Notify(LONG ExitEvent, LONG Context) | CCertExitSample |
Notify(LONG ExitEvent, LONG Context) | CCertExitSample |
~CCertExitSample() | CCertExitSample |
~CCertExitSample() | CCertExitSample |
Generated on Wed Nov 13 2024 16:55:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/repas/Repass.c Source File

  • NetDS
  • RPC
  • Data
  • repas

Repass.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                         repas Example
00005
00006     FILE:       repass.c
00007
00008     USAGE:      repass -p protocol_sequence
00009                        -e endpoint
00010                        -m max calls
00011                        -n min calls
00012                        -f flag for RpcServerListen
00013
00014     PURPOSE:    Server side of RPC distributed application repas
00015
00016     FUNCTIONS:  main() - registers server as RPC server
00017
00018     COMMENTS:   This sample program generates a client and server can share
00019                 an interface, but one side can use a different representation
00020                 than the other.
00021
00022                 The client side in this example does all operations using
00023                 character strings, and the server side does all operations
00024                 using UNICODE strings.  Two procedures are provided, one
00025                 defined with ASCII strings, one with UNICODE strings.
00026                 The wire format reflects these definitions, yet the client
00027                 and server see pure ASCII and pure UNICODE respectively.
00028
00029                 The [represent_as] attribute (used in the client and server
00030                 side acf files) requires the four user-supplied functions
00031                 whose names start with the name of the transmitted type
00032                 (in the client side's case: WCHAR_STRING)
00033
00034                 The [in, out] attributes applied to remote procedure
00035                 parameters require the two user-supplied functions
00036                 midl_user_allocate and midl_user_free.
00037
00038                 The other functions are utilities that are used to
00039                 build or display the data structures.
00040
00041 ****************************************************************************/
00042
00043 #include <stdlib.h>
00044 #include <stdio.h>
00045 #include <ctype.h>
00046 #include "repass.h"     // header file generated by MIDL compiler
00047
00048 #define PURPOSE \
00049 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00050 the use of the [transmit_as] attribute. For more information\n\
00051 about the attributes and the RPC API functions, see the\n\
00052 RPC programming guide and reference.\n\n"
00053
00054 void Usage(char * pszProgramName)
00055 {
00056     fprintf(stderr, "%s", PURPOSE);
00057     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00058     fprintf(stderr, " -p protocol_sequence\n");
00059     fprintf(stderr, " -e endpoint\n");
00060     fprintf(stderr, " -m maxcalls\n");
00061     fprintf(stderr, " -n mincalls\n");
00062     fprintf(stderr, " -f flag_wait_op\n");
00063     exit(1);
00064 }
00065
00066 /* main:  register the interface, start listening for clients */
00067 void __cdecl main(int argc, char * argv[])
00068 {
00069     RPC_STATUS status;
00070     unsigned char * pszProtocolSequence = "ncacn_np";
00071     unsigned char * pszSecurity         = NULL;
00072     unsigned char * pszEndpoint         = "\\pipe\\repas";
00073     unsigned int    cMinCalls           = 1;
00074     unsigned int    cMaxCalls           = 20;
00075     unsigned int    fDontWait           = FALSE;
00076     int i;
00077
00078     /* allow the user to override settings with command line switches */
00079     for (i = 1; i < argc; i++) {
00080         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00081             switch (tolower(*(argv[i]+1))) {
00082             case 'p':  // protocol sequence
00083                 pszProtocolSequence = argv[++i];
00084                 break;
00085             case 'e':
00086                 pszEndpoint = argv[++i];
00087                 break;
00088             case 'm':
00089                 cMaxCalls = (unsigned int) atoi(argv[++i]);
00090                 break;
00091             case 'n':
00092                 cMinCalls = (unsigned int) atoi(argv[++i]);
00093                 break;
00094             case 'f':
00095                 fDontWait = (unsigned int) atoi(argv[++i]);
00096                 break;
00097             case 'h':
00098             case '?':
00099             default:
00100                 Usage(argv[0]);
00101             }
00102         }
00103         else
00104             Usage(argv[0]);
00105     }
00106
00107     status = RpcServerUseProtseqEp(pszProtocolSequence,
00108                                    cMaxCalls,
00109                                    pszEndpoint,
00110                                    pszSecurity);  // Security descriptor
00111     printf("RpcServerUseProtseqEp returned 0x%x\n", status);
00112     if (status) {
00113         exit(status);
00114     }
00115
00116     status = RpcServerRegisterIf(repas_ServerIfHandle,  // interface to register
00117                                  NULL,   // MgrTypeUuid
00118                                  NULL);  // MgrEpv; null means use default
00119     printf("RpcServerRegisterIf returned 0x%x\n", status);
00120     if (status) {
00121         exit(status);
00122     }
00123
00124     printf("Calling RpcServerListen\n");
00125     status = RpcServerListen(cMinCalls,
00126                              cMaxCalls,
00127                              fDontWait);
00128     printf("RpcServerListen returned: 0x%x\n", status);
00129     if (status) {
00130         exit(status);
00131     }
00132
00133     if (fDontWait) {
00134         printf("Calling RpcMgmtWaitServerListen\n");
00135         status = RpcMgmtWaitServerListen();  //  wait operation
00136         printf("RpcMgmtWaitServerListen returned: 0x%x\n", status);
00137         if (status) {
00138             exit(status);
00139         }
00140     }
00141
00142 }  // end main()
00143
00144 /* end file repass.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPage Member List

This is the complete list of members for CPage, including all inherited members.
_apBlock | CPage | [protected]
_aptBlock | CPage | [protected]
_cBlock | CPage | [protected]
_hInst | CPage | [protected]
_PageHeadL | CPage | [protected]
_PageHeadR | CPage | [protected]
_PageNums | CPage | [protected]
_pf | CPage | [protected]
CPage(HINSTANCE hInst, CPageFormat &pf, UINT nPage=0) | CPage |
Hittest(POINT pt) | CPage |
InitPage(UINT nPage) | CPage | [protected]
Paint(CCanvas &canvas, RECT rc) | CPage |
SetFont(HFONT hfont) | CPage |
SetFormat(UINT fuFormat=HEXADECIMAL) | CPage |
~CPage() | CPage |
Generated on Wed Nov 13 2024 16:57:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/RecvMDlg.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

RecvMDlg.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // RecvMDlg.cpp : implementation file
00013 //
00014
00015
00016
00017 #include "stdafx.h"
00018 #include "MQApitst.h"
00019 #include "RecvMDlg.h"
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CReceiveMessageDialog dialog
00029
00030
00031 CReceiveMessageDialog::CReceiveMessageDialog(CArray <ARRAYQ*, ARRAYQ*>* pStrArray, CWnd* pParent /*=NULL*/)
00032    : CDialog(CReceiveMessageDialog::IDD, pParent)
00033 {
00034    m_pStrArray = pStrArray;
00035
00036    //{{AFX_DATA_INIT(CReceiveMessageDialog)
00037    m_szPathName = _T("");
00038    m_iTimeout = 20000;
00039   m_dwBodySize = BUFFERSIZE;
00040   //}}AFX_DATA_INIT
00041 }
00042
00043
00044 void CReceiveMessageDialog::DoDataExchange(CDataExchange* pDX)
00045 {
00046    CDialog::DoDataExchange(pDX);
00047    //{{AFX_DATA_MAP(CReceiveMessageDialog)
00048    DDX_Control(pDX, IDC_COMBO, m_PathNameCB);
00049    DDX_CBString(pDX, IDC_COMBO, m_szPathName);
00050   DDV_MaxChars(pDX, m_szPathName, 4000);
00051    DDX_Text(pDX, IDC_TIMEOUT, m_iTimeout);
00052   DDX_Text(pDX, IDC_EDT_BODY_SIZE, m_dwBodySize);
00053   DDV_MinMaxDWord(pDX, m_dwBodySize, 1, 100000000);
00054   //}}AFX_DATA_MAP
00055 }
00056
00057
00058 BEGIN_MESSAGE_MAP(CReceiveMessageDialog, CDialog)
00059    //{{AFX_MSG_MAP(CReceiveMessageDialog)
00060    //}}AFX_MSG_MAP
00061 END_MESSAGE_MAP()
00062
00063 /////////////////////////////////////////////////////////////////////////////
00064 // CReceiveMessageDialog message handlers
00065
00066 BOOL CReceiveMessageDialog::OnInitDialog()
00067 {
00068    CDialog::OnInitDialog();
00069
00070    // TODO: Add extra initialization here
00071
00072    int i;
00073
00074    for  (i=0 ; i<m_pStrArray->GetSize() ; i++)
00075    {
00076       if (((*m_pStrArray)[i]->dwAccess & MQ_RECEIVE_ACCESS) != FALSE)
00077       {
00078      if ((*m_pStrArray)[i]->bFormatNameOnly)
00079      {
00080       VERIFY (m_PathNameCB.AddString((*m_pStrArray)[i]->szFormatName) != CB_ERR);
00081      }
00082      else
00083      {
00084       VERIFY (m_PathNameCB.AddString((*m_pStrArray)[i]->szPathName) != CB_ERR);
00085      }
00086       }
00087    }
00088
00089     if (m_PathNameCB.GetCount() > 0) m_PathNameCB.SetCurSel(0);
00090
00091     return TRUE;  // return TRUE unless you set the focus to a control
00092                  // EXCEPTION: OCX Property Pages should return FALSE
00093 }
00094
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/CRUCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

CRUCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CRUCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COCruiseCar COM
00005              object class.
00006
00007              CRUCAR showcases the construction of the COCruiseCar COM
00008              object class with the IUnknown, ICar, and ICruise interfaces.
00009              This is done through Aggregation reuse of COCar's ICar
00010              interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial DLLSERVE.HTM file.
00014              For more specific technical details on the internal workings
00015              see the comments dispersed throughout the module's source code.
00016
00017   Classes:   COCruiseCar.
00018
00019   Functions: none.
00020
00021   Origin:    9-11-95: atrent - Editor-inheritance from CRUCAR.CPP in
00022                the COMOBJ Tutorial Code Sample.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will be calling the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include SERVER.H because it has the necessary internal class and
00048     resource definitions for this DLL.
00049   We include CAR.H because it has the class COCar declarations.
00050   We include CRUCAR.H because it has the class COCruiseCar declarations.
00051 ---------------------------------------------------------------------------*/
00052 #include <windows.h>
00053 #include <ole2.h>
00054 #include <apputil.h>
00055 #include <icars.h>
00056 #include <carguids.h>
00057 #include "server.h"
00058 #include "car.h"
00059 #include "crucar.h"
00060
00061
00062 /*---------------------------------------------------------------------------
00063   COCruiseCar's implementation of its main COM object class including
00064   Constructor, Destructor, QueryInterface, AddRef, and Release.
00065 ---------------------------------------------------------------------------*/
00066
00067 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00068   Method:   COCruiseCar::COCruiseCar
00069
00070   Summary:  COCruiseCar Constructor. Note the member initializer:
00071             "m_ImpICruise(this, pUnkOuter)" which is used to pass the
00072             'this' and pUnkOuter pointers of this constructor function
00073             to the constructor in the instantiation of the implementation
00074             of the CImpICruise interface (which is nested inside this
00075             present COCruiseCar Object Class).
00076
00077   Args:     IUnknown* pUnkOuter,
00078               Pointer to the the outer Unknown.  NULL means this COM Object
00079               is not being Aggregated.  Non NULL means it is being created
00080               on behalf of an outside COM object that is reusing it via
00081               aggregation.
00082             CServer* pServer)
00083               Pointer to the server's control object.
00084
00085   Modifies: m_cRefs, m_pUnkOuter.
00086
00087   Returns:  void
00088 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00089 COCruiseCar::COCruiseCar(
00090   IUnknown* pUnkOuter,
00091   CServer* pServer) :
00092   m_ImpICruise(this, pUnkOuter)
00093 {
00094   // Zero the COM object's reference count.
00095   m_cRefs = 0;
00096
00097   // No AddRef necessary if non-NULL, as this present COM object's lifetime
00098   // is totally coupled with the controlling Outer object's lifetime.
00099   m_pUnkOuter = pUnkOuter;
00100
00101   // Zero the pointer to the aggregated COCar object's IUnknown
00102   // interface (for delegation of IUnknown calls to it).
00103   m_pUnkCar = NULL;
00104
00105   // Assign the pointer to the server's control object.
00106   m_pServer = pServer;
00107
00108   LOGF1("S: COCruiseCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00109
00110   return;
00111 }
00112
00113
00114 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00115   Method:   COCruiseCar::~COCruiseCar
00116
00117   Summary:  COCruiseCar Destructor.
00118
00119   Args:     void
00120
00121   Returns:  void
00122 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00123 COCruiseCar::~COCruiseCar(void)
00124 {
00125   LOG("S: COCruiseCar::Destructor.");
00126
00127   RELEASE_INTERFACE(m_pUnkCar);
00128
00129   return;
00130 }
00131
00132
00133 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00134   Method:   COCruiseCar::Init
00135
00136   Summary:  COCruiseCar Initialization method.
00137
00138   Args:     void
00139
00140   Modifies: m_pUnkCar, m_pICar, m_cRefs.
00141
00142   Returns:  HRESULT
00143               Standard result code. NOERROR for success.
00144 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00145 HRESULT COCruiseCar::Init(void)
00146 {
00147   HRESULT hr;
00148
00149   LOG("S: COCruiseCar::Init.");
00150
00151   // Set up the right pIUnknown for delegation.  If we are being
00152   // aggregated then we pass the pUnkOuter in turn to any COM objects
00153   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00154   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00155
00156   // We create an instance of the COCar object and do this via the
00157   // Aggregation reuse technique.  Note we pass pUnkOuter as the
00158   // Aggregation pointer.  It is the 'this' pointer to this present
00159   // CruiseCar object if we are not being aggregated; otherwise it is
00160   // the pointer to the outermost object's controlling IUnknown.  Following
00161   // the rules of Aggregation we must ask for an IID_IUnknown interface.
00162   // We cache the requested  pointer to the IUnknown of the new COCar COM
00163   // object for later use in delegating IUnknown calls.
00164   hr = CoCreateInstance(
00165          CLSID_DllCar,
00166          pUnkOuter,
00167          CLSCTX_INPROC_SERVER,
00168          IID_IUnknown,
00169          (PPVOID)&m_pUnkCar);
00170
00171   if (SUCCEEDED(hr))
00172   {
00173     LOG("S: COCruiseCar::Init (New Aggregation of COCar) Succeeded.");
00174   }
00175   else
00176   {
00177     LOG("S: COCruiseCar::Init (New Aggregation of COCar) Failed.");
00178   }
00179
00180   return (hr);
00181 }
00182
00183
00184 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00185   Method:   COCruiseCar::QueryInterface
00186
00187   Summary:  QueryInterface of the COCruiseCar non-delegating
00188             IUnknown implementation.
00189
00190   Args:     REFIID riid,
00191               [in] GUID of the Interface being requested.
00192             PPVOID ppv)
00193               [out] Address of the caller's pointer variable that will
00194               receive the requested interface pointer.
00195
00196   Returns:  HRESULT
00197 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00198 STDMETHODIMP COCruiseCar::QueryInterface(
00199                REFIID riid,
00200                PPVOID ppv)
00201 {
00202   HRESULT hr = E_NOINTERFACE;
00203   *ppv = NULL;
00204
00205   if (IID_IUnknown == riid)
00206   {
00207     *ppv = this;
00208     LOG("S: COCruiseCar::QueryInterface. 'this' pIUnknown returned.");
00209   }
00210   else if (IID_ICruise == riid)
00211   {
00212     // This ICruise interface is implemented in this COCruiseCar object as
00213     // a native interface of COCruiseCar.
00214     *ppv = &m_ImpICruise;
00215     LOG("S: COCruiseCar::QueryInterface. pICruise returned.");
00216   }
00217
00218   if (NULL != *ppv)
00219   {
00220     // We've handed out a pointer to an interface so obey the COM rules
00221     //   and AddRef its reference count.
00222     ((LPUNKNOWN)*ppv)->AddRef();
00223     hr = NOERROR;
00224   }
00225   else if (IID_ICar == riid)
00226   {
00227     LOG("S: COCruiseCar::QueryInterface. ICar delegating.");
00228     // We didn't implement the ICar interface in this COCruiseCar object.
00229     // The aggregated inner COCar object is contributing the ICar
00230     // interface to this present composite or aggregating CruiseCar object.
00231     // So, to satisfy a QI request for the ICar interface, we delegate
00232     // the QueryInterface to the inner object's principal IUnknown.
00233     hr = m_pUnkCar->QueryInterface(riid, ppv);
00234   }
00235
00236   return (hr);
00237 }
00238
00239
00240 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00241   Method:   COCruiseCar::AddRef
00242
00243   Summary:  AddRef of the COCruiseCar non-delegating IUnknown implementation.
00244
00245   Args:     void
00246
00247   Modifies: m_cRefs.
00248
00249   Returns:  ULONG
00250               New value of m_cRefs (COM object's reference count).
00251 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00252 STDMETHODIMP_(ULONG) COCruiseCar::AddRef(void)
00253 {
00254   m_cRefs++;
00255
00256   LOGF1("S: COCruiseCar::AddRef. New cRefs=%i.", m_cRefs);
00257
00258   return m_cRefs;
00259 }
00260
00261
00262 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00263   Method:   COCruiseCar::Release
00264
00265   Summary:  Release of the COCruiseCar non-delegating IUnknown implementation.
00266
00267   Args:     void
00268
00269   Modifies: m_cRefs.
00270
00271   Returns:  ULONG
00272               New value of m_cRefs (COM object's reference count).
00273 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00274 STDMETHODIMP_(ULONG) COCruiseCar::Release(void)
00275 {
00276   ULONG ulCount = --m_cRefs;
00277
00278   LOGF1("S: COCruiseCar::Release. New cRefs=%i.", m_cRefs);
00279
00280   if (0 == m_cRefs)
00281   {
00282     // We've reached a zero reference count for this COM object.
00283     // So we tell the server housing to decrement its global object
00284     // count so that the server will be unloaded if appropriate.
00285     if (NULL != m_pServer)
00286       m_pServer->ObjectsDown();
00287
00288     // We artificially bump the main ref count.  This fulfills one of
00289     // the rules of aggregated objects and ensures that an indirect
00290     // recursive call to this release won't occur because of other
00291     // delegating releases that might happen in our own destructor.
00292     m_cRefs++;
00293     delete this;
00294   }
00295
00296   return ulCount;
00297 }
00298
00299
00300 /*---------------------------------------------------------------------------
00301   COCruiseCar's nested implementation of the ICruise interface including
00302   Constructor, Destructor, QueryInterface, AddRef, Release,
00303   Engage, and Adjust.
00304 ---------------------------------------------------------------------------*/
00305
00306 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00307   Method:   COCruiseCar::CImpICruise::CImpICruise
00308
00309   Summary:  Constructor for the CImpICruise interface instantiation.
00310
00311   Args:     COCruiseCar* pBackObj,
00312               Back pointer to the parent outer object.
00313             IUnknown* pUnkOuter)
00314               Pointer to the outer Unknown.  For delegation.
00315
00316   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00317
00318   Returns:  void
00319 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00320 COCruiseCar::CImpICruise::CImpICruise(
00321   COCruiseCar* pBackObj,
00322   IUnknown* pUnkOuter)
00323 {
00324   // Init the Interface Ref Count (used for debugging only).
00325   m_cRefI = 0;
00326
00327   // Init the Back Object Pointer to point to the outer object.
00328   m_pBackObj = pBackObj;
00329
00330   // Init the CImpICruise interface's delegating Unknown pointer.  We use
00331   // the Back Object pointer for IUnknown delegation here if we are not
00332   // being aggregated.  If we are being aggregated we use the supplied
00333   // pUnkOuter for IUnknown delegation.  In either case the pointer
00334   // assignment requires no AddRef because the CImpICruise lifetime is
00335   // quaranteed by the lifetime of the parent object in which
00336   // CImpICruise is nested.
00337   if (NULL == pUnkOuter)
00338   {
00339     m_pUnkOuter = pBackObj;
00340     LOG("S: COCruiseCar::CImpICruise Constructor. Non-Aggregating.");
00341   }
00342   else
00343   {
00344     m_pUnkOuter = pUnkOuter;
00345     LOG("S: COCruiseCar::CImpICruise Constructor. Aggregating.");
00346   }
00347
00348   return;
00349 }
00350
00351
00352 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00353   Method:   COCruiseCar::CImpICruise::~CImpICruise
00354
00355   Summary:  Destructor for the CImpICruise interface instantiation.
00356
00357   Args:     void
00358
00359   Returns:  void
00360 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00361 COCruiseCar::CImpICruise::~CImpICruise(void)
00362 {
00363   LOG("S: COCruiseCar::CImpICruise Destructor.");
00364
00365   return;
00366 }
00367
00368
00369 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00370   Method:   COCruiseCar::CImpICruise::QueryInterface
00371
00372   Summary:  The QueryInterface IUnknown member of this ICruise interface
00373             implementation that delegates to m_pUnkOuter, whatever it is.
00374
00375   Args:     REFIID riid,
00376               [in] GUID of the Interface being requested.
00377             PPVOID ppv)
00378               [out] Address of the caller's pointer variable that will
00379               receive the requested interface pointer.
00380
00381   Returns:  HRESULT
00382               Returned by the delegated outer QueryInterface call.
00383 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00384 STDMETHODIMP COCruiseCar::CImpICruise::QueryInterface(
00385                REFIID riid,
00386                PPVOID ppv)
00387 {
00388   LOG("S: COCruiseCar::CImpICruise::QueryInterface. Delegating.");
00389
00390   // Delegate this call to the outer object's QueryInterface.
00391   return m_pUnkOuter->QueryInterface(riid, ppv);
00392 }
00393
00394
00395 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00396   Method:   COCruiseCar::CImpICruise::AddRef
00397
00398   Summary:  The AddRef IUnknown member of this ICruise interface
00399             implementation that delegates to m_pUnkOuter, whatever it is.
00400
00401   Args:     void
00402
00403   Modifies: m_cRefI.
00404
00405   Returns:  ULONG
00406               Returned by the delegated outer AddRef call.
00407 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00408 STDMETHODIMP_(ULONG) COCruiseCar::CImpICruise::AddRef(void)
00409 {
00410   // Increment the Interface Reference Count.
00411   ++m_cRefI;
00412
00413   LOGF1("S: COCruiseCar::CImpICruise::Addref. Delegating. New cI=%i.", m_cRefI);
00414
00415   // Delegate this call to the outer object's AddRef.
00416   return m_pUnkOuter->AddRef();
00417 }
00418
00419
00420 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00421   Method:   COCruiseCar::CImpICruise::Release
00422
00423   Summary:  The Release IUnknown member of this ICruise interface
00424             implementation that delegates to m_pUnkOuter, whatever it is.
00425
00426   Args:     void
00427
00428   Returns:  ULONG
00429               Returned by the delegated outer Release call.
00430 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00431 STDMETHODIMP_(ULONG) COCruiseCar::CImpICruise::Release(void)
00432 {
00433   // Decrement the Interface Reference Count.
00434   --m_cRefI;
00435
00436   LOGF1("S: COCruiseCar::CImpICruise::Release. Delegating. New cI=%i.",m_cRefI);
00437
00438   // Delegate this call to the outer object's Release.
00439   return m_pUnkOuter->Release();
00440 }
00441
00442
00443 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00444   Method:   COCruiseCar::CImpICruise::Engage
00445
00446   Summary:  The Engage member method of this ICruise interface
00447             implementation.  A simple empty method on a COCruiseCar COM
00448             object for tutorial purposes.  Presumably if this Car object
00449             were modeling a real Car then the Engage method would turn
00450             the Cruise control system on or off.
00451
00452   Args:     BOOL bOnOff)
00453               TRUE for On; FALSE for Off.
00454
00455   Returns:  HRESULT
00456               NOERROR
00457 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00458 STDMETHODIMP COCruiseCar::CImpICruise::Engage(
00459                BOOL bOnOff)
00460 {
00461   LOGF1("S: COCruiseCar::CImpICruise::Engage. Called. bOnOff=%i.",bOnOff);
00462
00463   return NOERROR;
00464 }
00465
00466
00467 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00468   Method:   COCruiseCar::CImpICruise::Adjust
00469
00470   Summary:  The Adjust member method of this ICruise interface
00471             implementation.  A simple empty method on a COCruiseCar COM
00472             object for tutorial purposes.  Presumably if this Car object
00473             were modeling a real Car then the Adjust method would allow
00474             notching the cruise set speed up or down by increments of 3 mph.
00475
00476   Args:     BOOL bUpDown)
00477               TRUE for Up; FALSE for Down.
00478
00479   Returns:  HRESULT
00480               NOERROR
00481 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00482 STDMETHODIMP COCruiseCar::CImpICruise::Adjust(
00483                BOOL bUpDown)
00484 {
00485   LOGF1("S: COCruiseCar::CImpICruise::Adjust. Called. bUpDown=%i.",bUpDown);
00486
00487   return NOERROR;
00488 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ErrorValueEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ErrorValueEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: ErrorValueEnum
00019
00020 public class ErrorValueEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adErrInvalidArgument = 3001;
00023   public static final short adErrOpeningFile = 3002;
00024   public static final short adErrReadFile = 3003;
00025   public static final short adErrWriteFile = 3004;
00026   public static final short adErrNoCurrentRecord = 3021;
00027   public static final short adErrIllegalOperation = 3219;
00028   public static final short adErrInTransaction = 3246;
00029   public static final short adErrFeatureNotAvailable = 3251;
00030   public static final short adErrItemNotFound = 3265;
00031   public static final short adErrObjectInCollection = 3367;
00032   public static final short adErrObjectNotSet = 3420;
00033   public static final short adErrDataConversion = 3421;
00034   public static final short adErrObjectClosed = 3704;
00035   public static final short adErrObjectOpen = 3705;
00036   public static final short adErrProviderNotFound = 3706;
00037   public static final short adErrBoundToCommand = 3707;
00038   public static final short adErrInvalidParamInfo = 3708;
00039   public static final short adErrInvalidConnection = 3709;
00040   public static final short adErrNotReentrant = 3710;
00041   public static final short adErrStillExecuting = 3711;
00042   public static final short adErrOperationCancelled = 3712;
00043   public static final short adErrStillConnecting = 3713;
00044   public static final short adErrNotExecuting = 3715;
00045   public static final short adErrUnsafeOperation = 3716;
00046 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ADCPROP_UPDATECRITERIA_ENUM.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ADCPROP_UPDATECRITERIA_ENUM.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: ADCPROP_UPDATECRITERIA_ENUM
00019
00020 public class ADCPROP_UPDATECRITERIA_ENUM extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adCriteriaKey = 0;
00023   public static final short adCriteriaAllCols = 1;
00024   public static final short adCriteriaUpdCols = 2;
00025   public static final short adCriteriaTimeStamp = 3;
00026 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/filerepserver.idl Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

filerepserver.idl

Go to the documentation of this file.
00001 [
00002     uuid(fe7f2eda-5da1-4041-928c-d2534d3fa128),
00003     pointer_default(ref),
00004     version(1.0)
00005 ]
00006
00007 interface FileRepServer {
00008
00009 // Declare the string data type. This should work for UNICODE.
00010 #ifdef _UNICODE
00011     typedef wchar_t * STR;
00012 #else
00013     typedef unsigned char * STR;
00014 #endif
00015
00016     // The size of the buffer returned with the RemoteOpen call.
00017     // It allows us to send back some data with the server reply for free:
00018     // since the TCP MTU size is at least 1500 bytes, we can make
00019     // use of the remaining bytes.
00020     const unsigned short OPEN_BUFSIZE = 1024 * 1;
00021
00022     // The size of the buffer returned with RemoteRead.  It is larger
00023     // due to being optimized for data transfer.
00024     const unsigned short READ_BUFSIZE = 10000;
00025
00026     // Used to define fixed-size buffer to receive data on the client.
00027     // The buffer size is basically the larger of the above values +1.
00028     cpp_quote("#define MAX_BUFSIZE (READ_BUFSIZE+1)")
00029
00030     typedef [context_handle] void * PCONTEXT_HANDLE_TYPE;
00031
00032    /*
00033       Opens a file specified by pszFile, reads up to OPEN_BUFSIZE bytes
00034       from it, and returns the number of bytes read as well as
00035       the data read in achBuf[].  If the whole file has been read,
00036       it is closed and the returned context handle is NULL.  Thus,
00037       the file may be transfered with a single call to
00038       RemoteOpen().  If the returned context handle is not NULL, subsequent
00039       calls to RemoteRead with the context handle will return additional
00040       file data.
00041     */
00042     void RemoteOpen([in] handle_t hFileRepServer,
00043         [out] PCONTEXT_HANDLE_TYPE *pphContext,
00044         [in, ref, string] STR pszFile,
00045         [out, ref, size_is(OPEN_BUFSIZE+1), length_is(*cbRead)] byte *Buf,
00046         [in, out, ref] unsigned long *cbRead);
00047
00048     /*
00049       Reads up to READ_BUFSIZE bytes from a previously opened file
00050       corresponding to the context handle phContext and returns
00051       the number of bytes read.  If the whole file has been read,
00052       it is closed and the returned context handle is NULL.  This cuts
00053       down on the number fo calls necessary for file transfer.  The [in]
00054       context handle must be a non-NULL context handle returned by RemoteOpen.
00055       The [out] context handle can be NULL is the read has completed and the
00056       file has been closed.
00057     */
00058     void RemoteRead([in] handle_t hFileRepServer,
00059         [in, out] PCONTEXT_HANDLE_TYPE *pphContext,
00060         [out, ref, size_is(READ_BUFSIZE+1), length_is(*cbRead)] byte *Buf,
00061         [in, out, ref] unsigned long *cbRead);
00062
00063 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/textapi.c Source File

  • WinUI
  • GlobalDev
  • globaldev

textapi.c

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////////////////////
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 // Purpose:
00011 //    This application demonstrates the different aspects of software globalization:
00012 //
00013 //        - A single executable with world-wide functionality (fully Unicode enabled
00014 //        for Windows 2000 and Windows XP).
00015 //
00016 //        - Locale independency by using Windows NLS APIs to display data (dates,
00017 //        numbers, time, etc.) within a user's desired format.
00018 //
00019 //        - Multilingual editing using standard edit controls.
00020 //
00021 //        - Multilingual input locales within edit control fields.
00022 //
00023 //        - Font selection and their affect on displayed data.
00024 //
00025 //        - Multilingual user interface and satellite DLLs.
00026 //
00027 // Written by Houman Pournasseh
00028 //
00029 ///////////////////////////////////////////////////////////////////////////////////////////
00030
00031 ///////////////////////////////////////////////////////////////////////////////////////////
00032 //
00033 //   Module:        TEXTAPI.C
00034 //
00035 //   Description:    Handles the window proc for the "Text API" tab of the property sheet.
00036 //
00037 //   Functions:
00038 //        TextDlgProc()     - Window procedure message handler.
00039 //        InitializeFont()  - Fills in font structures with initial values.
00040 //
00041 ///////////////////////////////////////////////////////////////////////////////////////////
00042
00043
00044 #include "global.h"
00045
00046 // internal function declaration
00047 void InitializeFont(HWND, LPTSTR, LONG, LPCHOOSEFONT, LPLOGFONT);
00048
00049 ///////////////////////////////////////////////////////////////////////////////////////////
00050 //    Function:        TextDlgProc
00051 //
00052 //    Description:    Message-processing function for text tab
00053 //
00054 //    Comments:
00055 //
00056 ///////////////////////////////////////////////////////////////////////////////////////////
00057 INT_PTR CALLBACK TextDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00058 {
00059     LONG        lAlign = 0;
00060     HFONT       hEditFont = NULL;
00061     HWND        hWndEdit = NULL;
00062     static      CHOOSEFONT cf;
00063     static      LOGFONT lf;
00064     INT_PTR     iProcessedMsg   = 1;
00065
00066
00067     switch(uMsg)
00068     {
00069         case WM_INITDIALOG:
00070             {
00071                 // Fill out a font structure that will be used in a call for CreateFont.
00072                 InitializeFont(hDlg, DEFAULT_FONT, 24, &cf, &lf);
00073
00074                 hEditFont = CreateFontIndirect(&lf) ;
00075                 if(NULL == hEditFont)
00076                 {
00077                     iProcessedMsg = 0;
00078                     break;
00079                 }
00080                 // Set font of edit control
00081                 SendDlgItemMessage(hDlg, IDC_EDITWIN, WM_SETFONT, (WPARAM) hEditFont,  MAKELPARAM(TRUE, 0)) ;
00082             }
00083             break;
00084
00085         case WM_COMMAND:
00086             switch(LOWORD(wParam))
00087             {
00088                 // Erase our text control by setting the content to NULL.
00089                 case IDB_CLEAR:
00090                     {
00091                         hWndEdit = GetDlgItem (hDlg, IDC_EDITWIN);
00092                         if(NULL == hWndEdit)
00093                         {
00094                             iProcessedMsg = 0;
00095                             break;
00096                         }
00097                         SetWindowText(hWndEdit, TEXT(""));
00098                     }
00099                     break;
00100
00101                 // Provide a font selection mechanism through the system's font selection
00102                 // common dialog.
00103                 case IDB_FONT:
00104                     {
00105                         DeleteFontObject(hDlg, hEditFont, IDC_EDITWIN);
00106
00107                         if(FALSE == ChooseFont(&cf))
00108                         {
00109                             iProcessedMsg = 0;
00110                             break;
00111                         }
00112
00113                         hEditFont = CreateFontIndirect(&lf);
00114                         if(NULL == hEditFont)
00115                         {
00116                             iProcessedMsg = 0;
00117                             break;
00118                         }
00119                         SendDlgItemMessage (hDlg, IDC_EDITWIN, WM_SETFONT, (WPARAM) hEditFont,  MAKELPARAM(TRUE, 0));
00120                     }
00121                     break;
00122
00123                 // Toggles the reading order of the text.
00124                 case IDB_READING:
00125                     {
00126                         hWndEdit = GetDlgItem(hDlg, IDC_EDITWIN);
00127                         if(NULL == hWndEdit)
00128                         {
00129                             iProcessedMsg = 0;
00130                             break;
00131                         }
00132                         lAlign   = GetWindowLong(hWndEdit, GWL_EXSTYLE) ^ WS_EX_RTLREADING;
00133                         SetWindowLong(hWndEdit, GWL_EXSTYLE, lAlign);
00134                         InvalidateRect(hWndEdit ,NULL, TRUE);
00135                     }
00136                     break;
00137
00138                 // Toggles the text alignment.
00139                 case IDB_ALIGN:
00140                     {
00141                         hWndEdit = GetDlgItem(hDlg, IDC_EDITWIN);
00142                         if(NULL == hWndEdit)
00143                         {
00144                             iProcessedMsg = 0;
00145                             break;
00146                         }
00147                         lAlign   = GetWindowLong(hWndEdit, GWL_EXSTYLE) ^ WS_EX_RIGHT;
00148                         SetWindowLong(hWndEdit, GWL_EXSTYLE, lAlign);
00149                         InvalidateRect(hWndEdit ,NULL, TRUE);
00150                     }
00151                     break;
00152
00153                 case IDCANCEL: /* fall-through*/
00154                 case IDOK:
00155                     {
00156                         DeleteFontObject(hDlg, hEditFont, IDC_EDITWIN);
00157                     }
00158                     break;
00159             }
00160          break;
00161
00162         default:
00163             iProcessedMsg = 0;
00164             break;
00165     }
00166     return iProcessedMsg;
00167 }
00168
00169 ///////////////////////////////////////////////////////////////////////////////////////////
00170 //    Function:        InitializeFont
00171 //
00172 //    Description:    Fills in font structures (CHOOSEFONT and a LOGFONT) with initial values.
00173 //
00174 //    Comments:
00175 //
00176 ///////////////////////////////////////////////////////////////////////////////////////////
00177 void InitializeFont(HWND hWnd, LPTSTR szFaceName, LONG lHeight, LPCHOOSEFONT lpCf, LPLOGFONT lpLf)
00178 {
00179     lpCf->lStructSize   = sizeof(CHOOSEFONT) ;
00180     lpCf->hwndOwner     = hWnd ;
00181     lpCf->hDC           = NULL ;
00182     lpCf->lpLogFont     = lpLf ;
00183     lpCf->iPointSize    = 10;
00184     lpCf->Flags         = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_NOSIZESEL ;
00185     lpCf->rgbColors     = RGB(0,0,0);
00186     lpCf->lCustData     = 0;
00187     lpCf->lpfnHook      = NULL;
00188     lpCf->lpTemplateName= NULL;
00189     lpCf->hInstance     = g_hInst;
00190     lpCf->lpszStyle     = NULL;
00191     lpCf->nFontType     = SIMULATED_FONTTYPE;
00192     lpCf->nSizeMin      = 0;
00193     lpCf->nSizeMax      = 0;
00194
00195     lpLf->lfHeight      = lHeight ;
00196     lpLf->lfWidth       = 0 ;
00197     lpLf->lfEscapement  = 0 ;
00198     lpLf->lfOrientation = 0 ;
00199     lpLf->lfWeight      = FW_DONTCARE ;
00200     lpLf->lfItalic      = FALSE ;
00201     lpLf->lfUnderline   = FALSE ;
00202     lpLf->lfStrikeOut   = FALSE ;
00203     lpLf->lfCharSet     = DEFAULT_CHARSET ;
00204     lpLf->lfOutPrecision= OUT_DEFAULT_PRECIS ;
00205     lpLf->lfClipPrecision = CLIP_DEFAULT_PRECIS ;
00206     lpLf->lfQuality     = DEFAULT_QUALITY ;
00207     lpLf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE ;
00208     _tcsncpy(lpLf->lfFaceName, szFaceName,min(_tcslen(lpLf->lfFaceName),_tcslen(szFaceName)));
00209 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/PlgBlt/BitMap.c Source File

  • Multimedia
  • Gdi
  • WinNT
  • PlgBlt

BitMap.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1992 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /**************************************************************************\
00013 *  bitmap.c -- support for reading in and drawing bitmaps.
00014 \**************************************************************************/
00015
00016 #include <windows.h>
00017 #include <commdlg.h>
00018 #include "plgblt.h"
00019
00020 /**************************************************************************\
00021 *
00022 *  function:  DrawBitmap()
00023 *
00024 *  input parameters:  HDC, HBITMAP
00025 *
00026 *  Draw the bitmap into the hdc.  Source rectangle computed to include the
00027 *   whole bitmap.  Destination location is 0,0.
00028 *
00029 *  global variables: none.
00030 *
00031 \**************************************************************************/
00032 VOID DrawBitmap (HDC hdc, HBITMAP hbm)
00033 {
00034     BOOL f;
00035     HDC hdcBits;
00036     BITMAP bm;
00037
00038     hdcBits = CreateCompatibleDC(hdc);
00039     GetObject (hbm, sizeof(BITMAP), &bm);
00040     SelectObject(hdcBits,hbm);
00041     f = BitBlt(hdc,0,0,bm.bmWidth, bm.bmHeight,hdcBits,0,0,SRCCOPY);
00042     DeleteDC(hdcBits);
00043 }
00044
00045
00046
00047 /**************************************************************************\
00048 *
00049 *  function:  GetBitmap()
00050 *
00051 *  input parameters:
00052 *   hdc - hdc to make the bitmap compatible with.
00053 *   hInst - instance handle
00054 *
00055 *  Put up a common dialog box to open a new *.BMP file.
00056 *   Once this is complete, open the file, read in the information,
00057 *   and create a compatible bitmap.
00058 *
00059 *  returns:  handle to the bitmap iff successful.  NULL otherwise.
00060 *
00061 \**************************************************************************/
00062 HBITMAP GetBitmap (HDC hdc, HANDLE hInst, BOOL monochrome)
00063 {
00064     HBITMAP hbm;
00065     PBITMAPFILEHEADER pbmfh;
00066     PBITMAPINFOHEADER pbmih;
00067     PBYTE             pBits;
00068     int fh;
00069     int bfOffBits;
00070     int nbytes;
00071     OPENFILENAME  of;
00072     char buffer [MAX_PATH];
00073
00074   if (!hdc) return NULL; /* check for valid hdc */
00075
00076     buffer[0] = 0;
00077
00078     /* set up the OPENFILE structure,
00079      *  then use the appropriate common dialog
00080      */
00081     of.lStructSize       = sizeof (OPENFILENAME);
00082     of.hwndOwner         = NULL;
00083     of.hInstance         = hInst;
00084     of.lpstrCustomFilter = NULL;
00085     of.nMaxCustFilter    = 0;
00086     of.nFilterIndex      = 0;
00087     of.lpstrFile         = buffer;
00088     of.nMaxFile          = MAX_PATH;
00089     of.lpstrFileTitle    = NULL;
00090     of.nMaxFileTitle     = 0;
00091     of.lpstrInitialDir   = "c:\\nt\\windows";
00092     of.lpstrTitle        = NULL;
00093     of.Flags             = OFN_HIDEREADONLY;
00094     of.nFileOffset       = 0;
00095     of.nFileExtension    = 0;
00096     of.lpstrDefExt       = NULL;
00097     of.lCustData         = 0;
00098     of.lpfnHook          = NULL;
00099     of.lpTemplateName    = NULL;
00100
00101     if (PRIMARYLANGID(GetUserDefaultLangID ()) == LANG_JAPANESE)
00102       of.lpstrFilter       = "ËÞ¯ÄÏ¯Ìß(*.bmp)\000 *.BMP\000\000";
00103     else
00104       of.lpstrFilter       = "Bitmaps\000 *.BMP\000\000";
00105
00106     if (!GetOpenFileName (&of)) return NULL;
00107
00108     /* Try to open the file.  If successful, then allocate space for it,
00109      *  and read in all of the bytes.
00110      */
00111     fh = _lopen (buffer, OF_READ);
00112     if (fh == -1) return NULL;
00113     nbytes = GetFileSize (LongToHandle(fh), NULL);
00114
00115     /* The contents of the file are read in here in three parts.  First
00116      *  the bitmap file header is read, then the bitmap header along with
00117      *  the color table, then finally the actual bit data.  I.e. from
00118      *  a total of nbytes...
00119      *    1.  sizeof (BITMAPFILEHEADER)
00120      *    2.  bfOffBits- sizeof (BITMAPFILEHEADER)
00121      *    3.  (nbytes - bfOffBits)
00122      */
00123
00124     /* read in the bitmap file header.  save the offset to bits. */
00125     if (!(pbmfh = (PBITMAPFILEHEADER)LocalAlloc (LPTR, sizeof (BITMAPFILEHEADER))))
00126         return NULL;
00127     _lread (fh, (LPSTR)pbmfh, sizeof (BITMAPFILEHEADER));
00128     bfOffBits=pbmfh->bfOffBits;
00129
00130     /* read in the bitmap info header and the color table right after it.
00131      * both BITMAPINFOHEADER and BITMAPINFO needed for CreateDIBitmap()
00132      */
00133     if (!(pbmih = (PBITMAPINFOHEADER)LocalAlloc (LPTR, bfOffBits- sizeof (BITMAPFILEHEADER))))
00134         return NULL;
00135     _lread (fh, (LPSTR)pbmih, bfOffBits- sizeof (BITMAPFILEHEADER));
00136
00137     /* finally read in the bit data. */
00138     if (!(pBits = (PBYTE)LocalAlloc (LPTR, (nbytes - bfOffBits)))) return NULL;
00139     _lread (fh, (LPSTR)pBits, (nbytes - bfOffBits));
00140
00141
00142     /* in the case of desiring a monochrome bitmap (input parameter),
00143      *  verify that is what we got.  If it is, then use CreateBitmap,
00144      *  else use a device independent bitmap.
00145      */
00146     if (monochrome) {
00147       if (pbmih->biBitCount != 1) {
00148         MessageBox (NULL,
00149           GetStringRes (IDS_MONOCHROME),
00150           NULL, MB_APPLMODAL | MB_ICONSTOP | MB_OK);
00151         hbm = NULL;
00152       } else {
00153   BITMAP bmpInf;
00154   memset( &bmpInf, 0, sizeof(bmpInf) );
00155   bmpInf.bmWidth = pbmih->biWidth;
00156   bmpInf.bmHeight = pbmih->biHeight;
00157   bmpInf.bmWidthBytes = ((pbmih->biWidth+31)&(~31))/8;
00158   bmpInf.bmPlanes = pbmih->biPlanes;
00159   bmpInf.bmBitsPixel = pbmih->biBitCount;
00160   bmpInf.bmBits = pBits;
00161
00162         hbm = CreateBitmapIndirect ( &bmpInf );
00163       }
00164     } else  /* bitmap is NOT monochrome, use DIB. */
00165       hbm = CreateDIBitmap (hdc, pbmih, CBM_INIT,
00166                           pBits, (PBITMAPINFO) pbmih, DIB_RGB_COLORS);
00167
00168
00169     /* hbm is set... free up memory, and return */
00170     LocalFree (LocalHandle ((LPSTR)pBits));
00171     LocalFree (LocalHandle ((LPSTR)pbmih));
00172     LocalFree (LocalHandle ((LPSTR)pbmfh));
00173     _lclose (fh);
00174
00175     return hbm;
00176 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/about.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

about.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Implementation of ISnapinAbout
00014 //
00015
00016
00017 #include "Globals.h"
00018 #include "About.h"
00019 #include "Resource.h"
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 //  Construction/Destruction
00023
00024 //---------------------------------------------------------------------------
00025 CSnapinAbout::CSnapinAbout()
00026 {
00027   m_cRef = 0;
00028   InterlockedIncrement((long*)&g_uObjectCount);
00029
00030   m_hSmallImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00031   m_hLargeImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_32), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00032
00033   // This image is displayed when the static node is selected
00034   m_hOpenImage  = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00035
00036   m_hAppIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_APP_ICON));
00037 }
00038
00039 CSnapinAbout::~CSnapinAbout()
00040 {
00041   SAFE_FREE_BITMAP( m_hSmallImage );
00042   SAFE_FREE_BITMAP( m_hLargeImage );
00043   SAFE_FREE_BITMAP( m_hOpenImage  );
00044   SAFE_FREE_ICON( m_hAppIcon );
00045
00046   InterlockedDecrement((long*)&g_uObjectCount);
00047 }
00048
00049 /////////////////////////////////////////////////////////////////////////////
00050 // IUnknown implementation
00051
00052 //---------------------------------------------------------------------------
00053 STDMETHODIMP CSnapinAbout::QueryInterface
00054 (
00055   REFIID   riid,       //[in] Identifier of the requested interface
00056   LPVOID   *ppv        //[out] Address of requested interface
00057 )
00058 {
00059   if( !ppv )
00060     return E_FAIL;
00061
00062   *ppv = NULL;
00063
00064   if( IsEqualIID(riid, IID_IUnknown) )
00065     *ppv = static_cast<ISnapinAbout*>(this);
00066   else if( IsEqualIID(riid, IID_ISnapinAbout) )
00067     *ppv = static_cast<ISnapinAbout*>(this);
00068
00069   if( *ppv )
00070   {
00071     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00072     return S_OK;
00073   }
00074
00075   return E_NOINTERFACE;
00076 }
00077
00078 //---------------------------------------------------------------------------
00079 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00080 {
00081   return InterlockedIncrement((long*)&m_cRef);
00082 }
00083
00084 //---------------------------------------------------------------------------
00085 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00086 {
00087   if( 0 == InterlockedDecrement((long*)&m_cRef) )
00088   {
00089     // we need to decrement our object count in the DLL
00090     delete this;
00091     return 0;
00092   }
00093   return m_cRef;
00094 }
00095
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // Interface ISnapinAbout
00099
00100 //---------------------------------------------------------------------------
00101 STDMETHODIMP CSnapinAbout::GetSnapinDescription
00102 (
00103   LPOLESTR* pszDescription   //[out] Pointer to the description text
00104 )
00105 {
00106   LONG nLen = wcslen( gwszABOUT_DESCRIPTION ) + 1;
00107   *pszDescription = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00108   if( NULL == *pszDescription )
00109     return E_OUTOFMEMORY;
00110
00111   wcscpy( *pszDescription, gwszABOUT_DESCRIPTION );
00112   return S_OK;
00113 }
00114
00115 //---------------------------------------------------------------------------
00116 STDMETHODIMP CSnapinAbout::GetProvider
00117 (
00118   LPOLESTR* pszProvider      //[out] Pointer to provider text
00119 )
00120 {
00121   LONG nLen = wcslen( gwszABOUT_PROVIDER ) + 1;
00122   *pszProvider = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00123   if( NULL == *pszProvider )
00124     return E_OUTOFMEMORY;
00125
00126   wcscpy( *pszProvider, gwszABOUT_PROVIDER );
00127   return S_OK;
00128 }
00129
00130 //---------------------------------------------------------------------------
00131 STDMETHODIMP CSnapinAbout::GetSnapinVersion
00132 (
00133   LPOLESTR*  pszVersion      //[out] Pointer to version text
00134 )
00135 {
00136   LONG nLen = wcslen( gwszABOUT_VERSION ) + 1;
00137   *pszVersion = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00138   if( NULL == *pszVersion )
00139     return E_OUTOFMEMORY;
00140
00141   wcscpy( *pszVersion, gwszABOUT_VERSION );
00142   return S_OK;
00143 }
00144
00145 //---------------------------------------------------------------------------
00146 STDMETHODIMP CSnapinAbout::GetSnapinImage
00147 (
00148   HICON *hAppIcon            //[out] Pointer to the Snap-in's main icon
00149 )
00150 {
00151   *hAppIcon = m_hAppIcon;
00152   HRESULT hResult = S_FALSE;
00153   (NULL == *hAppIcon ) ? hResult = E_FAIL : hResult = S_OK;
00154
00155   return hResult;
00156 }
00157
00158 //---------------------------------------------------------------------------
00159 STDMETHODIMP CSnapinAbout::GetStaticFolderImage
00160 (
00161   HBITMAP*   hSmallImage,      //[out] Pointer to small image
00162   HBITMAP*   hOpenImage,       //[out] Pointer to open folder image
00163   HBITMAP*   hLargeImage,      //[out] Pointer to large image
00164   COLORREF*  cMask             //[out] Pointer to image color mask
00165 )
00166 {
00167   *hSmallImage = m_hSmallImage;
00168   *hLargeImage = m_hLargeImage;
00169   *hOpenImage  = m_hOpenImage;
00170   *cMask       = RGB(0, 255, 0);
00171
00172   if( NULL == *hSmallImage || NULL == *hLargeImage || NULL == *hOpenImage )
00173     return E_FAIL;
00174
00175   return S_OK;
00176 }
00177
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampclnt/sampver.h Source File

  • Dataaccess
  • oledb
  • sampclnt

sampver.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Consumer
00003 // (C) Copyright 1991 - 2000 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module OLEDBVER.H | version include file
00008 //
00009 // @rev 1 | 05-09-95 | Peterbu | Created
00010 // @rev 2 | 08-15-95 | Briants | changed from kageravr.h
00011 //
00012
00013 // Constants -----------------------------------------------------------------
00014
00015 #define VER_FILEVERSION 2,50,4809.0
00016 #define VER_FILEVERSION_STR "2.50.4809.0\0"
00017 #define VER_PRODUCTVERSION 2,50,4809.0
00018 #define VER_PRODUCTVERSION_STR "2.50.4809.0\0"
00019
00020 #define VER_FILEFLAGSMASK   (VS_FF_DEBUG | VS_FF_PRERELEASE)
00021 #ifdef DEBUG
00022 #define VER_FILEFLAGS     (VS_FF_DEBUG)
00023 #else
00024 #define VER_FILEFLAGS     (0)
00025 #endif
00026
00027 #define VER_FILEOS        VOS_NT_WINDOWS32
00028
00029 #define VER_COMPANYNAME_STR   "Microsoft Corporation\0"
00030 #define VER_PRODUCTNAME_STR   "Microsoft OLE DB\0"
00031 #define VER_LEGALCOPYRIGHT_STR  "Copyright \251 Microsoft Corporation 1991-2000\0"
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_MESSAGE Member List

This is the complete list of members for _MESSAGE, including all inherited members.
Buffer | _MESSAGE
MessageType | _MESSAGE
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ParameterAttributesEnum Member List

This is the complete list of members for msado15::ParameterAttributesEnum, including all inherited members.
adParamLong | msado15::ParameterAttributesEnum | [static]
adParamNullable | msado15::ParameterAttributesEnum | [static]
adParamSigned | msado15::ParameterAttributesEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Range/Range.c Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Range

Range.c

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include <windows.h>
00018 #include <urlmon.h>
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include "range.h"
00022
00023 DWORD g_dwThread;
00024
00025 //==============================================================================
00026 void DumpBytes (PBYTE pBuf, DWORD cbBuf)
00027 {
00028     DWORD i;
00029     for (i=0; i<cbBuf; i++)
00030     {
00031         switch(pBuf[i])
00032         {
00033             case 10:  printf("[LF]"); break;
00034             case 13:  printf("[CR]"); break;
00035             default:  printf("%c", pBuf[i]); break;
00036         }
00037     }
00038 }
00039
00040 //==============================================================================
00041 void PrintResultCode (HRESULT hr)
00042 {
00043 #define CASEMSG(hr) case hr: printf(#hr); break;
00044
00045   printf ("Done with result ");
00046   switch (hr)
00047   {
00048     CASEMSG(S_OK)
00049     CASEMSG(S_FALSE)
00050     CASEMSG(E_FAIL)
00051
00052         CASEMSG(INET_E_INVALID_URL)
00053     CASEMSG(INET_E_NO_SESSION)
00054     CASEMSG(INET_E_CANNOT_CONNECT)
00055     CASEMSG(INET_E_RESOURCE_NOT_FOUND)
00056     CASEMSG(INET_E_OBJECT_NOT_FOUND)
00057     CASEMSG(INET_E_DATA_NOT_AVAILABLE)
00058     CASEMSG(INET_E_DOWNLOAD_FAILURE)
00059     CASEMSG(INET_E_AUTHENTICATION_REQUIRED)
00060     CASEMSG(INET_E_NO_VALID_MEDIA)
00061     CASEMSG(INET_E_CONNECTION_TIMEOUT)
00062     CASEMSG(INET_E_INVALID_REQUEST)
00063     CASEMSG(INET_E_UNKNOWN_PROTOCOL)
00064     CASEMSG(INET_E_SECURITY_PROBLEM)
00065     CASEMSG(INET_E_CANNOT_LOAD_DATA)
00066     CASEMSG(INET_E_CANNOT_INSTANTIATE_OBJECT)
00067
00068     default:
00069         printf ("0x%x", hr);
00070   }
00071   printf ("\n");
00072 }
00073
00074 //==============================================================================
00075 BOOL RequestCallback (PHTTP_REQUESTCB_PARAM pCBParam)
00076 {
00077     printf ("RequestCallback[%d] ", pCBParam->dwRequestCtx);
00078
00079     switch (pCBParam->CallbackType)
00080     {
00081         case REQUESTCB_STARTED:
00082             printf ("Started\n");
00083             printf ("  Status: %d\n", pCBParam->dwResponseCode);
00084             printf ("  Content-Length: %d\n", pCBParam->dwContentLength);
00085             if (pCBParam->fdwRequestFlags & HTTP_REQUEST_ACCEPT_RANGES)
00086                 printf ("  Accept-Ranges: bytes\n");
00087             if (pCBParam->fdwRequestFlags & HTTP_REQUEST_FROM_CACHE)
00088                 printf ("  From Cache\n");
00089             return TRUE;
00090
00091         case REQUESTCB_DATA:
00092
00093         // Dump some bytes so we can verify them.
00094         printf ("offset=%5d got %4d bytes:",
00095             pCBParam->dwDataOffset, pCBParam->cbDataLength);
00096         DumpBytes ((PBYTE) pCBParam->lpDataBuffer, min(pCBParam->cbDataLength, 15));
00097         printf ("\n");
00098         return TRUE;
00099
00100         case REQUESTCB_DONE:
00101             PrintResultCode (pCBParam->hrRequest);
00102             // Let the console app thread exit the message loop.
00103             PostThreadMessage (g_dwThread, WM_QUIT, 0, 0);
00104             return TRUE;
00105   }
00106   return FALSE;
00107 }
00108
00109 //==============================================================================
00110 int __cdecl main (int argc, char *argv[])
00111 {
00112     MSG msg;
00113     HTTP_REQUEST_PARAM Param;
00114
00115     SYSTEMTIME st;
00116     PSTR pszUrl;
00117     HTTP_REQUEST_RANGE ranges[10];
00118     DWORD cRanges;
00119
00120     // Check usage.
00121     if (argc<2 || argc%2 || argc>(2*(sizeof(ranges))/sizeof(ranges[0])))
00122     {
00123         fprintf (stderr, "Usage:   range <http-url> [<offset1> <size1>]  [<offset2> <size2>]  [<offset3> <size3>]  ...\n");
00124         fprintf (stderr, "Example: range http://www.microsoft.com 2 5 10 52 20 4\n");
00125         exit (1);
00126     }
00127
00128     // Get URL and ranges from command line.
00129     pszUrl = argv[1];
00130     cRanges = 0;
00131     while (argc -= 2)
00132     {
00133     if (argc <= 0)
00134       break;
00135
00136       ranges[cRanges].dwOffset = atoi(argv[2 * cRanges + 2]);
00137       ranges[cRanges].dwSize   = atoi(argv[2 * cRanges + 3]);
00138         cRanges++;
00139     }
00140
00141     // Pass current time as unless-modified-since time.
00142     GetSystemTime (&st);
00143
00144     // Save the thread ID so the we can post ourselves
00145     // WM_QUIT from the callback without creating a window.
00146     g_dwThread = GetCurrentThreadId();
00147
00148     // Read range depends on URL monikers which depend on COM.
00149     if (FAILED(CoInitialize(NULL)))
00150         exit (1);
00151
00152     // Initiate the read range request.
00153     ZeroMemory (&Param, sizeof(Param));
00154     Param.cbStruct     = sizeof(Param);
00155     Param.pszUrl       = pszUrl;
00156     Param.pfnRequestCB = RequestCallback;
00157     Param.dwRequestCtx = 15;
00158     Param.pRanges      = &ranges[0];
00159     Param.cRanges      = cRanges;
00160     Param.pstUnlessModifiedSince = &st;
00161
00162     if (HttpReadRequest (&Param))
00163     {
00164         // Must enter a message loop for the binding to progress.
00165         while (GetMessage (&msg, NULL, 0, 0))
00166         {
00167             TranslateMessage (&msg);
00168             DispatchMessage (&msg);
00169         }
00170     }
00171
00172     CoUninitialize();
00173     return 1;
00174 }
00175
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/tutorial.dll/Tutorial.cpp Source File

  • SysMgmt
  • Msi
  • tutorial.dll

Tutorial.cpp

Go to the documentation of this file.
00001 #if 0  // makefile definitions
00002 DESCRIPTION = LaunchTutorial custom action sample
00003 MODULENAME = tutorial
00004 FILEVERSION = Msi
00005 LINKLIBS = shell32.lib
00006 ENTRY = LaunchTutorial
00007 !include "..\TOOLS\MsiTool.mak"
00008 !if 0  #nmake skips the rest of this file
00009 #endif // end of makefile definitions
00010
00011 // Required headers
00012 #define WINDOWS_LEAN_AND_MEAN  // faster compile
00013 #include <windows.h>
00014 #ifndef RC_INVOKED    // start of source code
00015
00016 #include <tchar.h>   // define UNICODE=1 on nmake command line to build UNICODE
00017 #include <shellapi.h>
00018 #include "msiquery.h"
00019 #include "strsafe.h"
00020
00021 //+-------------------------------------------------------------------------
00022 //
00023 //  Microsoft Windows
00024 //
00025 //  Copyright (C) Microsoft Corporation, All rights reserved.
00026 //
00027 //  File:       tutorial.cpp
00028 //
00029 //  Purpose: DLL custom action sample code to demonstrate how to launch an
00030 //           installed file at the end of setup
00031 //
00032 //--------------------------------------------------------------------------
00033
00034 //-----------------------------------------------------------------------------------------
00035 //
00036 // BUILD Instructions
00037 //
00038 // notes:
00039 //  - SDK represents the full path to the install location of the
00040 //     Windows Installer SDK
00041 //
00042 // Using NMake:
00043 //    %vcbin%\nmake -f tutorial.cpp include="%include;SDK\Include" lib="%lib%;SDK\Lib"
00044 //
00045 // Using MsDev:
00046 //    1. Create a new Win32 DLL project
00047 //      2. Add tutorial.cpp to the project
00048 //      3. Add SDK\Include and SDK\Lib directories on the Tools\Options Directories tab
00049 //      4. Add msi.lib to the library list in the Project Settings dialog
00050 //          (in addition to the standard libs included by MsDev)
00051 //
00052 //------------------------------------------------------------------------------------------
00053
00054
00055 //////////////////////////////////////////////////////////////////////////////
00056 // LaunchTutorial
00057 //
00058 // Launches a installed file at the end of setup
00059 //
00060 UINT __stdcall LaunchTutorial(MSIHANDLE hInstall)
00061 {
00062   BOOL fSuccess = FALSE;
00063
00064   // szTutorialFileKey is the primary key of the file in the
00065   // File table that identifies the file we wish to launch
00066   const TCHAR szTutorialFileKey[] = TEXT("[#Tutorial]");
00067
00068   PMSIHANDLE hRecTutorial = MsiCreateRecord(1);
00069
00070   if ( !hRecTutorial
00071     || ERROR_SUCCESS != MsiRecordSetString(hRecTutorial, 0, szTutorialFileKey))
00072     return ERROR_INSTALL_FAILURE;
00073
00074   // determine buffer size
00075   DWORD cchPath = 0;
00076   if (ERROR_MORE_DATA == MsiFormatRecord(hInstall, hRecTutorial, TEXT(""), &cchPath))
00077   {
00078     // add 1 to cchPath since return count from MsiFormatRecord does not include terminating null
00079     TCHAR* szPath = new TCHAR[++cchPath];
00080     if (szPath)
00081     {
00082       if (ERROR_SUCCESS == MsiFormatRecord(hInstall, hRecTutorial, szPath, &cchPath))
00083       {
00084         // ensure quoted path to ShellExecute
00085         DWORD cchQuotedPath = lstrlen(szPath) + 1 + 2; // szPath + null terminator + enclosing quotes
00086         TCHAR* szQuotedPath = new TCHAR[cchQuotedPath];
00087         if (szQuotedPath
00088           && SUCCEEDED(StringCchCopy(szQuotedPath, cchQuotedPath, TEXT("\"")))
00089           && SUCCEEDED(StringCchCat(szQuotedPath, cchQuotedPath, szPath))
00090           && SUCCEEDED(StringCchCat(szQuotedPath, cchQuotedPath, TEXT("\""))))
00091         {
00092           // set up ShellExecute structure
00093           // file is the full path to the installed file
00094           SHELLEXECUTEINFO sei;
00095           ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
00096           sei.fMask = SEE_MASK_FLAG_NO_UI; // don't show error UI, we'll just silently fail
00097           sei.hwnd = 0;
00098           sei.lpVerb = NULL; // use default verb, typically open
00099           sei.lpFile = szQuotedPath;
00100           sei.lpParameters = NULL;
00101           sei.lpDirectory = NULL;
00102           sei.nShow = SW_SHOWNORMAL;
00103           sei.cbSize = sizeof(sei);
00104
00105           // spawn the browser to display HTML tutorial
00106           fSuccess = ShellExecuteEx(&sei);
00107
00108           delete [] szQuotedPath;
00109         }
00110       }
00111       delete [] szPath;
00112     }
00113   }
00114
00115   return (fSuccess) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
00116 }
00117
00118 #else // RC_INVOKED, end of source code, start of resources
00119 // resource definition go here
00120
00121 #endif // RC_INVOKED
00122 #if 0
00123 !endif // makefile terminator
00124 #endif
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDeleteObjectDlg Member List

This is the complete list of members for CDeleteObjectDlg, including all inherited members.
CDeleteObjectDlg(CWnd *pParent=NULL) | CDeleteObjectDlg |
DoDataExchange(CDataExchange *pDX) | CDeleteObjectDlg | [protected, virtual]
GetObjectName() | CDeleteObjectDlg | [inline]
IDD enum value | CDeleteObjectDlg |
m_sDelete | CDeleteObjectDlg |
m_sRDN | CDeleteObjectDlg | [protected]
OnChangeDelete() | CDeleteObjectDlg | [protected]
OnOK() | CDeleteObjectDlg | [protected, virtual]
Generated on Wed Nov 13 2024 16:56:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/_Stream.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

_Stream.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface _Stream
00019 /** @com.interface(iid=00000565-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface _Stream extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPGET, name="Size", name2="getSize", addFlagsVtable=4)
00023       @com.parameters([type=I4] return) */
00024   public int getSize();
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=PROPGET, name="EOS", name2="getEOS", addFlagsVtable=4)
00027       @com.parameters([type=BOOLEAN] return) */
00028   public boolean getEOS();
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=PROPGET, name="Position", name2="getPosition", addFlagsVtable=4)
00031       @com.parameters([type=I4] return) */
00032   public int getPosition();
00033
00034   /** @com.method(vtoffset=7, dispid=3, type=PROPPUT, name="Position", name2="putPosition", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] pPos) */
00036   public void setPosition(int pPos);
00037
00038   /** @com.method(vtoffset=8, dispid=4, type=PROPGET, name="Type", name2="getType", addFlagsVtable=4)
00039       @com.parameters([type=I4] return) */
00040   public int getType();
00041
00042   /** @com.method(vtoffset=9, dispid=4, type=PROPPUT, name="Type", name2="putType", addFlagsVtable=4)
00043       @com.parameters([in,type=I4] ptype) */
00044   public void setType(int ptype);
00045
00046   /** @com.method(vtoffset=10, dispid=5, type=PROPGET, name="LineSeparator", name2="getLineSeparator", addFlagsVtable=4)
00047       @com.parameters([type=I4] return) */
00048   public int getLineSeparator();
00049
00050   /** @com.method(vtoffset=11, dispid=5, type=PROPPUT, name="LineSeparator", name2="putLineSeparator", addFlagsVtable=4)
00051       @com.parameters([in,type=I4] pLS) */
00052   public void setLineSeparator(int pLS);
00053
00054   /** @com.method(vtoffset=12, dispid=6, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00055       @com.parameters([type=I4] return) */
00056   public int getState();
00057
00058   /** @com.method(vtoffset=13, dispid=7, type=PROPGET, name="Mode", name2="getMode", addFlagsVtable=4)
00059       @com.parameters([type=I4] return) */
00060   public int getMode();
00061
00062   /** @com.method(vtoffset=14, dispid=7, type=PROPPUT, name="Mode", name2="putMode", addFlagsVtable=4)
00063       @com.parameters([in,type=I4] pMode) */
00064   public void setMode(int pMode);
00065
00066   /** @com.method(vtoffset=15, dispid=8, type=PROPGET, name="Charset", name2="getCharset", addFlagsVtable=4)
00067       @com.parameters([type=STRING] return) */
00068   public String getCharset();
00069
00070   /** @com.method(vtoffset=16, dispid=8, type=PROPPUT, name="Charset", name2="putCharset", addFlagsVtable=4)
00071       @com.parameters([in,type=STRING] pbstrCharset) */
00072   public void setCharset(String pbstrCharset);
00073
00074   /** @com.method(vtoffset=17, dispid=9, type=METHOD, name="Read", addFlagsVtable=4)
00075       @com.parameters([in,type=I4] NumBytes, [type=VARIANT] return) */
00076   public Variant Read(int NumBytes);
00077
00078   /** @com.method(vtoffset=18, dispid=10, type=METHOD, name="Open", addFlagsVtable=4)
00079       @com.parameters([in,type=VARIANT] Source, [in,type=I4] Mode, [in,type=I4] Options, [in,type=STRING] UserName, [in,type=STRING] Password) */
00080   public void Open(Variant Source, int Mode, int Options, String UserName, String Password);
00081
00082   /** @com.method(vtoffset=19, dispid=11, type=METHOD, name="Close", addFlagsVtable=4)
00083       @com.parameters() */
00084   public void Close();
00085
00086   /** @com.method(vtoffset=20, dispid=12, type=METHOD, name="SkipLine", addFlagsVtable=4)
00087       @com.parameters() */
00088   public void SkipLine();
00089
00090   /** @com.method(vtoffset=21, dispid=13, type=METHOD, name="Write", addFlagsVtable=4)
00091       @com.parameters([in,type=VARIANT] Buffer) */
00092   public void Write(Variant Buffer);
00093
00094   /** @com.method(vtoffset=22, dispid=14, type=METHOD, name="SetEOS", addFlagsVtable=4)
00095       @com.parameters() */
00096   public void SetEOS();
00097
00098   /** @com.method(vtoffset=23, dispid=15, type=METHOD, name="CopyTo", addFlagsVtable=4)
00099       @com.parameters([in,iid=00000565-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] DestStream, [in,type=I4] CharNumber) */
00100   public void CopyTo(msado15._Stream DestStream, int CharNumber);
00101
00102   /** @com.method(vtoffset=24, dispid=16, type=METHOD, name="Flush", addFlagsVtable=4)
00103       @com.parameters() */
00104   public void Flush();
00105
00106   /** @com.method(vtoffset=25, dispid=17, type=METHOD, name="SaveToFile", addFlagsVtable=4)
00107       @com.parameters([in,type=STRING] FileName, [in,type=I4] Options) */
00108   public void SaveToFile(String FileName, int Options);
00109
00110   /** @com.method(vtoffset=26, dispid=18, type=METHOD, name="LoadFromFile", addFlagsVtable=4)
00111       @com.parameters([in,type=STRING] FileName) */
00112   public void LoadFromFile(String FileName);
00113
00114   /** @com.method(vtoffset=27, dispid=19, type=METHOD, name="ReadText", addFlagsVtable=4)
00115       @com.parameters([in,type=I4] NumChars, [type=STRING] return) */
00116   public String ReadText(int NumChars);
00117
00118   /** @com.method(vtoffset=28, dispid=20, type=METHOD, name="WriteText", addFlagsVtable=4)
00119       @com.parameters([in,type=STRING] Data, [in,type=I4] Options) */
00120   public void WriteText(String Data, int Options);
00121
00122   /** @com.method(vtoffset=29, dispid=21, type=METHOD, name="Cancel", addFlagsVtable=4)
00123       @com.parameters() */
00124   public void Cancel();
00125
00126
00127   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x565, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00128 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/Global.h Source File

  • Web
  • NetMeeting
  • NMShare

Global.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       GLOBAL.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef GLOBAL_H
00016 #define GLOBAL_H
00017
00018
00019 //-------------------------------------------------------
00020 // Useful constants
00021
00022 #define chNull   ('\0')
00023 #define lpNil    (NULL)
00024
00025 #define hwndNil      ((HWND) NULL)
00026 #define hfontNil     ((HFONT) NULL)
00027 #define hgdiNil      ((HGDIOBJ) NULL)
00028
00029
00030 //-------------------------------------------------------
00031 // Useful macros
00032
00033 //#define ClearBytes(lpv, cb)   ZeroMemory((LPVOID) (lpv), (cb))
00034 #define ClearStruct(lpv)    ZeroMemory((LPVOID) (lpv), sizeof(*(lpv)))
00035 #define InitStruct(lpv)        {ClearStruct(lpv); (* (LPDWORD) lpv) = sizeof(*(lpv));}
00036 //#define CopyStruct(pDest, pSrc)  CopyMemory(pDest, pSrc, sizeof(*(pDest)))
00037
00038 #define SetEmptySz(sz)      ( *(sz) = _T('\0') )
00039 #define FEmptySz(sz)            (((sz) == NULL) || (*(sz) == _T('\0')))
00040
00041 #define ARRAY_ELEMENTS(rg)      (sizeof(rg) / sizeof(rg[0]))
00042 #define CCHMAX(sz)              (sizeof(sz) / sizeof(TCHAR))
00043
00044
00045
00046
00047 #ifdef DEBUG
00048 VOID FAR PASCAL AssertProc(LPTSTR lpszMsg, LPTSTR lpszAssert, LPTSTR lpszFile, UINT line);
00049
00050 #define DEBASSERT(exp,szMsg)  \
00051   if (!(exp))                                                      \
00052   {                                                                \
00053     static char _szAssert[] = #exp ;   \
00054     static char _szMsg[]    = szMsg;   \
00055     AssertProc(_szMsg,_szAssert,__FILE__,__LINE__); \
00056   }
00057
00058 #define ASSERT(f)       DEBASSERT(f, "(" #f ")")
00059 #define AssertSz(f,sz)  DEBASSERT(f, sz)
00060 #define NotReached()    DEBASSERT(FALSE, "NotReached declaration was reached!")
00061 #else
00062 #define ASSERT(f)
00063 #define AssertSz(f, sz)
00064 #define NotReached()
00065 #endif
00066
00067
00068
00069 //-------------------------------------------------------------------------
00070 // Functions for handling main window messages.  The message-dispatching
00071 // mechanism expects all message-handling functions to have the following
00072 // prototype:
00073 //
00074 // Function pointer prototype for message handling functions.
00075 //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
00076
00077 typedef LRESULT (*PFNMSG)(HWND, UINT, WPARAM, LPARAM);
00078
00079 // This structure maps messages to message handling functions.
00080 typedef struct _MSD
00081 {
00082   UINT   uMsg;
00083   PFNMSG pfnmsg;
00084 } MSD;                 // MeSsage Dispatch structure
00085 typedef MSD * LPMSD;
00086
00087
00088 //-------------------------------------------------------------------------
00089 // Functions for handling main window commands--ie. functions for
00090 // processing WM_COMMAND messages based on the wParam value.
00091 // The message-dispatching mechanism expects all command-handling
00092 // functions to have the following prototype:
00093
00094 typedef VOID (*PFNCMD)(VOID);
00095
00096 // This structure maps command IDs to command handling functions.
00097 typedef struct _CMD
00098 {
00099   UINT     wCmd;
00100   PFNCMD pfncmd;
00101 } CMD;                 // CoMmand Dispatch structure
00102 typedef CMD * LPCMD;
00103
00104
00105 typedef struct _PREF
00106 {
00107   BOOL fSbar;       // Display status bar
00108   BOOL fMsgWindow;  // Display message window
00109   BOOL fUserList;   // Display user list
00110   WINDOWPLACEMENT wpMain;
00111   LOGFONT lf;
00112 } PREF;
00113
00114
00115
00116 //-------------------------------------------------------------------------
00117 // Special resource constants
00118 #define IDW_MSG   100
00119 #define IDW_USER  101
00120 #define IDW_APP  102
00121
00122 // See _rgColMember
00123 #define ILV_ADDR      0
00124 #define ILV_HWND      1
00125 #define ILV_STATUS    2
00126 #define ILV_NAME      3
00127
00128 const int DYP_MSG    = 30;  // Fixed Height of Message window
00129 const int DXP_USER   = 80;  // Fixed Width of User List
00130 const int YP_TOP     = 1;
00131 const int XP_LEFT    = 0;
00132
00133
00134 //-------------------------------------------------------------------------
00135 // Global Function Prototypes.
00136
00137
00138 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00139
00140
00141 // from util.cpp
00142 LPVOID LpvAlloc(int cb);
00143 LPTSTR PszAlloc(int cch);
00144 VOID FreePlpv(LPVOID plpv);
00145 VOID MaybeDeleteObject(HGDIOBJ * phgdi);
00146 VOID SizeMsgWindow(int dx, int dy);
00147 VOID RecalcMsgWindow(void);
00148 VOID SetMenuCheck(UINT idm, BOOL fCheck);
00149 VOID ShowHwnd(HWND hwnd, BOOL fShow, int idm);
00150
00151 VOID ClearText(void);
00152 VOID DisplayMsg(LPTSTR pszMsg);
00153
00154 LRESULT MsgNotifyAppList(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00155
00156
00157 //-------------------------------------------------------------------------
00158 // Global Variables
00159
00160 extern HINSTANCE ghInst;          // The current instance handle
00161 extern HACCEL    ghAccelTable;    // Menu accelerators
00162 extern HWND      ghwndMain;       // Main Window
00163 extern HWND      ghwndSbar;       // Status Bar
00164 extern HMENU     ghMenu;          // Main Menu
00165 extern HWND      ghwndMsg;        // Message Window
00166 extern HWND      ghwndUser;       // User List
00167 extern HWND      ghwndApp;        // Application List
00168 extern HFONT     ghfontEntry;     // Font for message Window
00169
00170 extern PREF      gPref;           // Preferences
00171
00172 #endif /* GLOBAL_H */
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/Factory.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

Factory.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00006 //
00007 //  File:  factory.cpp
00008 //
00009 //  Description :
00010 //      Class factory implementation for the command-line event
00011 //      consumer provider
00012 //
00013 //  History:
00014 //
00015 //***************************************************************************
00016
00017 #include "stdafx.h"
00018 #include "factory.h"
00019 #include "Provider.h"
00020
00021 CProviderFactory::CProviderFactory(CListBox *pOutputList)
00022 {
00023   m_cRef = 0L;
00024   m_pOutputList = pOutputList;
00025 }
00026
00027 CProviderFactory::~CProviderFactory()
00028 {
00029 }
00030
00031 //IUnknown methods
00032 STDMETHODIMP CProviderFactory::QueryInterface(REFIID riid, LPVOID FAR *ppv)
00033 {
00034     *ppv=NULL;
00035
00036     if (riid == IID_IUnknown || riid == IID_IClassFactory)
00037         *ppv=this;
00038
00039     if (*ppv != NULL)
00040     {
00041         ((LPUNKNOWN)*ppv)->AddRef();
00042         return NOERROR;
00043     }
00044
00045     return E_NOINTERFACE;
00046 }
00047
00048
00049 STDMETHODIMP_(ULONG) CProviderFactory::AddRef(void)
00050 {
00051     return InterlockedIncrement(&m_cRef);
00052 }
00053
00054
00055 STDMETHODIMP_(ULONG) CProviderFactory::Release(void)
00056 {
00057     int lNewRef = InterlockedDecrement(&m_cRef);
00058     if(lNewRef == 0)
00059     {
00060         delete this;
00061     }
00062
00063     return lNewRef;
00064 }
00065
00066 //+---------------------------------------------------------------------------
00067 //
00068 //  Function:   CProviderFactory::CreateInstance
00069 //
00070 //  Synopsis:
00071 //
00072 //  Arguments:  [pUnkOuter]
00073 //              [iid]
00074 //              [ppv]
00075 //
00076 //  Returns:    HRESULT
00077 //
00078 //  Modifies:
00079 //
00080 //----------------------------------------------------------------------------
00081 STDMETHODIMP
00082 CProviderFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
00083 {
00084   HRESULT hr;
00085     CProvider *pProvider = NULL;
00086
00087     if (pUnkOuter)
00088         return E_FAIL;
00089
00090   // create the provider.
00091     pProvider = new CProvider(m_pOutputList);
00092
00093     if (pProvider == NULL)
00094   {
00095     return E_FAIL;
00096   }
00097
00098   // get the interface asked for.
00099     if (pProvider)
00100     {
00101         hr = pProvider->QueryInterface(riid, ppv);
00102     }
00103     else
00104     {
00105         *ppv = NULL;
00106         return E_OUTOFMEMORY;
00107     }
00108
00109     return NOERROR;
00110 }
00111
00112 //+---------------------------------------------------------------------------
00113 //
00114 //  Function:   CProviderFactory::LockServer
00115 //
00116 //  Synopsis:
00117 //
00118 //  Arguments:  [fLock]
00119 //
00120 //  Returns:    HRESULT
00121 //
00122 //  Modifies:
00123 //
00124 //----------------------------------------------------------------------------
00125 STDMETHODIMP CProviderFactory::LockServer(BOOL fLock)
00126 {
00127     if (fLock)
00128         m_cRef++;
00129     else
00130         m_cRef--;
00131
00132     return NOERROR;
00133 }
00134
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsError/ADsError_p.c Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsError

ADsError_p.c

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the proxy stub code */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Tue Apr 13 15:05:07 1999
00006  */
00007 /* Compiler settings for C:\projects\RTK\ADsError\ADsError.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013 #define USE_STUBLESS_PROXY
00014
00015
00016 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00017 #ifndef __REDQ_RPCPROXY_H_VERSION__
00018 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00019 #endif
00020
00021
00022 #include "rpcproxy.h"
00023 #ifndef __RPCPROXY_H_VERSION__
00024 #error this stub requires an updated version of <rpcproxy.h>
00025 #endif // __RPCPROXY_H_VERSION__
00026
00027
00028 #include "ADsError.h"
00029
00030 #define TYPE_FORMAT_STRING_SIZE   41
00031 #define PROC_FORMAT_STRING_SIZE   35
00032
00033 typedef struct _MIDL_TYPE_FORMAT_STRING
00034     {
00035     short          Pad;
00036     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00037     } MIDL_TYPE_FORMAT_STRING;
00038
00039 typedef struct _MIDL_PROC_FORMAT_STRING
00040     {
00041     short          Pad;
00042     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00043     } MIDL_PROC_FORMAT_STRING;
00044
00045
00046 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00047 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00048
00049
00050 /* Object interface: IUnknown, ver. 0.0,
00051    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00052
00053
00054 /* Object interface: IDispatch, ver. 0.0,
00055    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IADsError, ver. 0.0,
00059    GUID={0x417D01DF,0xF1C6,0x11D2,{0xBC,0x88,0x00,0xC0,0x4F,0xD4,0x30,0xAF}} */
00060
00061
00062 extern const MIDL_STUB_DESC Object_StubDesc;
00063
00064
00065 extern const MIDL_SERVER_INFO IADsError_ServerInfo;
00066
00067 #pragma code_seg(".orpc")
00068 extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1];
00069
00070 static const MIDL_STUB_DESC Object_StubDesc =
00071     {
00072     0,
00073     NdrOleAllocate,
00074     NdrOleFree,
00075     0,
00076     0,
00077     0,
00078     0,
00079     0,
00080     __MIDL_TypeFormatString.Format,
00081     1, /* -error bounds_check flag */
00082     0x20000, /* Ndr library version */
00083     0,
00084     0x50100a4, /* MIDL Version 5.1.164 */
00085     0,
00086     UserMarshalRoutines,
00087     0,  /* notify & notify_flag routine table */
00088     1,  /* Flags */
00089     0,  /* Reserved3 */
00090     0,  /* Reserved4 */
00091     0   /* Reserved5 */
00092     };
00093
00094 static const unsigned short IADsError_FormatStringOffsetTable[] =
00095     {
00096     (unsigned short) -1,
00097     (unsigned short) -1,
00098     (unsigned short) -1,
00099     (unsigned short) -1,
00100     0
00101     };
00102
00103 static const MIDL_SERVER_INFO IADsError_ServerInfo =
00104     {
00105     &Object_StubDesc,
00106     0,
00107     __MIDL_ProcFormatString.Format,
00108     &IADsError_FormatStringOffsetTable[-3],
00109     0,
00110     0,
00111     0,
00112     0
00113     };
00114
00115 static const MIDL_STUBLESS_PROXY_INFO IADsError_ProxyInfo =
00116     {
00117     &Object_StubDesc,
00118     __MIDL_ProcFormatString.Format,
00119     &IADsError_FormatStringOffsetTable[-3],
00120     0,
00121     0,
00122     0
00123     };
00124
00125 CINTERFACE_PROXY_VTABLE(8) _IADsErrorProxyVtbl =
00126 {
00127     &IADsError_ProxyInfo,
00128     &IID_IADsError,
00129     IUnknown_QueryInterface_Proxy,
00130     IUnknown_AddRef_Proxy,
00131     IUnknown_Release_Proxy ,
00132     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00133     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00134     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00135     0 /* IDispatch_Invoke_Proxy */ ,
00136     (void *)-1 /* IADsError::GetErrorMessage */
00137 };
00138
00139
00140 static const PRPC_STUB_FUNCTION IADsError_table[] =
00141 {
00142     STUB_FORWARDING_FUNCTION,
00143     STUB_FORWARDING_FUNCTION,
00144     STUB_FORWARDING_FUNCTION,
00145     STUB_FORWARDING_FUNCTION,
00146     NdrStubCall2
00147 };
00148
00149 CInterfaceStubVtbl _IADsErrorStubVtbl =
00150 {
00151     &IID_IADsError,
00152     &IADsError_ServerInfo,
00153     8,
00154     &IADsError_table[-3],
00155     CStdStubBuffer_DELEGATING_METHODS
00156 };
00157
00158 #pragma data_seg(".rdata")
00159
00160 static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1] =
00161         {
00162
00163             {
00164             BSTR_UserSize
00165             ,BSTR_UserMarshal
00166             ,BSTR_UserUnmarshal
00167             ,BSTR_UserFree
00168             }
00169
00170         };
00171
00172
00173 #if !defined(__RPC_WIN32__)
00174 #error  Invalid build platform for this stub.
00175 #endif
00176
00177 #if !(TARGET_IS_NT40_OR_LATER)
00178 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00179 #error   -Oif or -Oicf, [wire_marshal] or [user_marshal] attribute, more than 32 methods in the interface.
00180 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00181 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00182 #endif
00183
00184
00185 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00186     {
00187         0,
00188         {
00189
00190   /* Procedure GetErrorMessage */
00191
00192       0x33,   /* FC_AUTO_HANDLE */
00193       0x6c,   /* Old Flags:  object, Oi2 */
00194 /*  2 */  NdrFcLong( 0x0 ), /* 0 */
00195 /*  6 */  NdrFcShort( 0x7 ),  /* 7 */
00196 #ifndef _ALPHA_
00197 /*  8 */  NdrFcShort( 0x10 ), /* x86, MIPS, PPC Stack size/offset = 16 */
00198 #else
00199       NdrFcShort( 0x20 ), /* Alpha Stack size/offset = 32 */
00200 #endif
00201 /* 10 */  NdrFcShort( 0x8 ),  /* 8 */
00202 /* 12 */  NdrFcShort( 0x8 ),  /* 8 */
00203 /* 14 */  0x5,    /* Oi2 Flags:  srv must size, has return, */
00204       0x3,    /* 3 */
00205
00206   /* Parameter hResult */
00207
00208 /* 16 */  NdrFcShort( 0x48 ), /* Flags:  in, base type, */
00209 #ifndef _ALPHA_
00210 /* 18 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00211 #else
00212       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00213 #endif
00214 /* 20 */  0x8,    /* FC_LONG */
00215       0x0,    /* 0 */
00216
00217   /* Parameter pbMsg */
00218
00219 /* 22 */  NdrFcShort( 0x2113 ), /* Flags:  must size, must free, out, simple ref, srv alloc size=8 */
00220 #ifndef _ALPHA_
00221 /* 24 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00222 #else
00223       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00224 #endif
00225 /* 26 */  NdrFcShort( 0x1e ), /* Type Offset=30 */
00226
00227   /* Return value */
00228
00229 /* 28 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00230 #ifndef _ALPHA_
00231 /* 30 */  NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00232 #else
00233       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00234 #endif
00235 /* 32 */  0x8,    /* FC_LONG */
00236       0x0,    /* 0 */
00237
00238       0x0
00239         }
00240     };
00241
00242 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00243     {
00244         0,
00245         {
00246       NdrFcShort( 0x0 ),  /* 0 */
00247 /*  2 */
00248       0x11, 0x4,  /* FC_RP [alloced_on_stack] */
00249 /*  4 */  NdrFcShort( 0x1a ), /* Offset= 26 (30) */
00250 /*  6 */
00251       0x13, 0x0,  /* FC_OP */
00252 /*  8 */  NdrFcShort( 0xc ),  /* Offset= 12 (20) */
00253 /* 10 */
00254       0x1b,   /* FC_CARRAY */
00255       0x1,    /* 1 */
00256 /* 12 */  NdrFcShort( 0x2 ),  /* 2 */
00257 /* 14 */  0x9,    /* Corr desc: FC_ULONG */
00258       0x0,    /*  */
00259 /* 16 */  NdrFcShort( 0xfffc ), /* -4 */
00260 /* 18 */  0x6,    /* FC_SHORT */
00261       0x5b,   /* FC_END */
00262 /* 20 */
00263       0x17,   /* FC_CSTRUCT */
00264       0x3,    /* 3 */
00265 /* 22 */  NdrFcShort( 0x8 ),  /* 8 */
00266 /* 24 */  NdrFcShort( 0xfffffff2 ), /* Offset= -14 (10) */
00267 /* 26 */  0x8,    /* FC_LONG */
00268       0x8,    /* FC_LONG */
00269 /* 28 */  0x5c,   /* FC_PAD */
00270       0x5b,   /* FC_END */
00271 /* 30 */  0xb4,   /* FC_USER_MARSHAL */
00272       0x83,   /* 131 */
00273 /* 32 */  NdrFcShort( 0x0 ),  /* 0 */
00274 /* 34 */  NdrFcShort( 0x4 ),  /* 4 */
00275 /* 36 */  NdrFcShort( 0x0 ),  /* 0 */
00276 /* 38 */  NdrFcShort( 0xffffffe0 ), /* Offset= -32 (6) */
00277
00278       0x0
00279         }
00280     };
00281
00282 const CInterfaceProxyVtbl * _ADsError_ProxyVtblList[] =
00283 {
00284     ( CInterfaceProxyVtbl *) &_IADsErrorProxyVtbl,
00285     0
00286 };
00287
00288 const CInterfaceStubVtbl * _ADsError_StubVtblList[] =
00289 {
00290     ( CInterfaceStubVtbl *) &_IADsErrorStubVtbl,
00291     0
00292 };
00293
00294 PCInterfaceName const _ADsError_InterfaceNamesList[] =
00295 {
00296     "IADsError",
00297     0
00298 };
00299
00300 const IID *  _ADsError_BaseIIDList[] =
00301 {
00302     &IID_IDispatch,
00303     0
00304 };
00305
00306
00307 #define _ADsError_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _ADsError, pIID, n)
00308
00309 int __stdcall _ADsError_IID_Lookup( const IID * pIID, int * pIndex )
00310 {
00311
00312     if(!_ADsError_CHECK_IID(0))
00313         {
00314         *pIndex = 0;
00315         return 1;
00316         }
00317
00318     return 0;
00319 }
00320
00321 const ExtendedProxyFileInfo ADsError_ProxyFileInfo =
00322 {
00323     (PCInterfaceProxyVtblList *) & _ADsError_ProxyVtblList,
00324     (PCInterfaceStubVtblList *) & _ADsError_StubVtblList,
00325     (const PCInterfaceName * ) & _ADsError_InterfaceNamesList,
00326     (const IID ** ) & _ADsError_BaseIIDList,
00327     & _ADsError_IID_Lookup,
00328     1,
00329     2,
00330     0, /* table of [async_uuid] interfaces */
00331     0, /* Filler1 */
00332     0, /* Filler2 */
00333     0  /* Filler3 */
00334 };
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/BrowserHost.h Source File

  • Web
  • Browser
  • EditFeatures

BrowserHost.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // BrowserHost.h : Declaration of the CBrowserHost
00006
00007 #ifndef __BROWSERHOST_H_
00008 #define __BROWSERHOST_H_
00009
00010 #include "resource.h"    // main symbols
00011 #include <commctrl.h>
00012 #include <atlwin.h>
00013 #include <exdisp.h>
00014 #include <mshtml.h>
00015 //#include <mshtmhst.h>
00016 //#include <mshtmdid.h>
00017 //#include <mshtmcid.h>
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CBrowserHost
00021 class ATL_NO_VTABLE CBrowserHost :
00022   public CComObjectRootEx<CComSingleThreadModel>,
00023   public CComCoClass<CBrowserHost, &CLSID_BrowserHost>,
00024   public IDispatchImpl<IBrowserHost, &IID_IBrowserHost, &LIBID_EDCOMMANDSLib>,
00025   public CWindowImpl<CBrowserHost>,
00026   public IOleClientSite,
00027   public IOleInPlaceSite
00028 {
00029 public:
00030   CBrowserHost();
00031
00032 DECLARE_REGISTRY_RESOURCEID(IDR_BROWSERHOST)
00033
00034 DECLARE_PROTECT_FINAL_CONSTRUCT()
00035
00036 BEGIN_COM_MAP(CBrowserHost)
00037   COM_INTERFACE_ENTRY(IBrowserHost)
00038   COM_INTERFACE_ENTRY(IDispatch)
00039   COM_INTERFACE_ENTRY(IOleClientSite)
00040   COM_INTERFACE_ENTRY(IOleWindow)
00041   COM_INTERFACE_ENTRY(IOleInPlaceSite)
00042   COM_INTERFACE_ENTRY2(DWebBrowserEvents2, IDispatch)
00043 END_COM_MAP()
00044
00045 BEGIN_MSG_MAP(CAtlBrCon)
00046   MESSAGE_HANDLER(WM_CREATE,    OnCreate)
00047   MESSAGE_HANDLER(WM_NCDESTROY, OnNCDestroy)
00048   MESSAGE_HANDLER(WM_SIZE,      OnSize)
00049   MESSAGE_HANDLER(WM_KEYDOWN,   OnKeydown)
00050
00051   // Button Commands
00052   COMMAND_ID_HANDLER(ID_BUTTON1, OnButton1)
00053   COMMAND_ID_HANDLER(ID_BUTTON2, OnButton2)
00054   COMMAND_ID_HANDLER(ID_BUTTON3, OnButton3)
00055   COMMAND_ID_HANDLER(ID_BUTTON4, OnButton4)
00056   COMMAND_ID_HANDLER(ID_BUTTON5, OnButton5)
00057   COMMAND_ID_HANDLER(ID_BUTTON6, OnButton6)
00058   COMMAND_ID_HANDLER(ID_BUTTON7, OnButton7)
00059   COMMAND_ID_HANDLER(ID_BUTTON8, OnButton8)
00060   COMMAND_ID_HANDLER(ID_BUTTON9, OnButton9)
00061   COMMAND_ID_HANDLER(ID_BUTTON10, OnButton10)
00062
00063   ALT_MSG_MAP(1) // For subclassed window - m_wndUrlCombo
00064 END_MSG_MAP()
00065
00066 // IBrowserHost
00067 public:
00068   STDMETHOD(GetHwnd)(long* phwnd);
00069   STDMETHOD(Run)();
00070
00071 protected:
00072   BOOL  m_bEnableCtxMenus;
00073   DWORD m_dwDLControl;
00074   DWORD m_dwCookie;
00075   DWORD m_dwDocHostUIFlags;
00076   DWORD m_dwDocHostUIDblClk;
00077   BOOL  m_bInPlaceActive;
00078   BOOL  m_bAtlBrowserHelp;
00079   BOOL  m_bButton2Down;
00080   BOOL  m_bButton3Down;
00081   BOOL  m_bButton4Down;
00082   BOOL  m_bButton5Down;
00083   BOOL  m_bButton6Down;
00084   BOOL  m_bButton7Down;
00085   BOOL  m_bButton8Down;
00086   BOOL  m_bButton9Down;
00087   BOOL  m_bButton10Down;
00088   LONG  m_lCSSlevel;
00089   CContainedWindow m_wndUrlCombo;
00090   CWindow m_wndStatusBar;
00091   CWindow m_wndToolBar;
00092
00093
00094   CComQIPtr<IWebBrowser2, &IID_IWebBrowser2> m_spWebBrowser;
00095   CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> m_spDoc;
00096   CComQIPtr<IOleInPlaceObject, &IID_IOleInPlaceObject> m_spInPlaceObject;
00097   CComQIPtr<IOleCommandTarget, &IID_IOleCommandTarget> m_spOleCmdTarg;
00098
00099   LRESULT OnCreate(UINT, WPARAM, LPARAM, BOOL&);
00100   LRESULT OnSize(UINT, WPARAM, LPARAM, BOOL&);
00101   LRESULT OnNCDestroy(UINT, WPARAM, LPARAM, BOOL&);
00102   LRESULT OnKeydown(UINT, WPARAM wParam, LPARAM lParam, BOOL&);
00103
00104   LRESULT OnButton1(WORD, WORD, HWND, BOOL&);
00105   LRESULT OnButton2(WORD, WORD, HWND, BOOL&);
00106   LRESULT OnButton3(WORD, WORD, HWND, BOOL&);
00107   LRESULT OnButton4(WORD, WORD, HWND, BOOL&);
00108   LRESULT OnButton5(WORD, WORD, HWND, BOOL&);
00109   LRESULT OnButton6(WORD, WORD, HWND, BOOL&);
00110   LRESULT OnButton7(WORD, WORD, HWND, BOOL&);
00111   LRESULT OnButton8(WORD, WORD, HWND, BOOL&);
00112   LRESULT OnButton9(WORD, WORD, HWND, BOOL&);
00113   LRESULT OnButton10(WORD, WORD, HWND, BOOL&);
00114
00115   STDMETHOD(Stop)();
00116
00117 private:
00118   void CreateToolbar();
00119 public:
00120
00121 // IDispatch Methods
00122 private:
00123   STDMETHOD(Invoke)(DISPID dispidMember,
00124             REFIID riid,
00125             LCID lcid,
00126             WORD wFlags,
00127             DISPPARAMS* pdispparams,
00128             VARIANT * pvarResult,
00129             EXCEPINFO* pexcepinfo,
00130             UINT* puArgErr);
00131
00132 // IOleWindow
00133 private:
00134   STDMETHOD(GetWindow)(HWND *phwnd)
00135   {
00136      *phwnd = m_hWnd;
00137     return S_OK;
00138   }
00139
00140    STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) {return E_NOTIMPL;}
00141
00142 // IOleInPlaceSite
00143 private:
00144   STDMETHOD(CanInPlaceActivate)() {return S_OK;}
00145
00146   STDMETHOD(OnInPlaceActivate)()
00147   {
00148       m_bInPlaceActive = TRUE;
00149       return S_OK;
00150   }
00151
00152   STDMETHOD(GetWindowContext)(IOleInPlaceFrame** ppFrame,
00153                 IOleInPlaceUIWindow** ppDoc,
00154                 LPRECT lprcPosRect,
00155                 LPRECT lprcClipRect,
00156                 LPOLEINPLACEFRAMEINFO lpFrameInfo)
00157   {
00158     GetClientRect(lprcPosRect);
00159     GetClientRect(lprcClipRect);
00160     return S_OK;
00161   }
00162
00163   STDMETHOD(OnInPlaceDeactivate)()
00164   {
00165     m_bInPlaceActive = FALSE;
00166     return S_OK;
00167   }
00168
00169   STDMETHOD(OnUIActivate)() {return E_NOTIMPL;}
00170   STDMETHOD(Scroll)(SIZE scrollExtant) {return E_NOTIMPL;}
00171   STDMETHOD(OnUIDeactivate)(BOOL fUndoable) {return E_NOTIMPL;}
00172   STDMETHOD(DiscardUndoState)() {return E_NOTIMPL;}
00173   STDMETHOD(DeactivateAndUndo)( void) {return E_NOTIMPL;}
00174   STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect) {return E_NOTIMPL;}
00175
00176 // IOleClientSite Methods
00177 private:
00178   STDMETHOD(SaveObject)(void) {return E_NOTIMPL;}
00179   STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) {return E_NOTIMPL;}
00180   STDMETHOD(GetContainer)(IOleContainer **ppContainer) {return E_NOTIMPL;}
00181   STDMETHOD(ShowObject)(void) {return E_NOTIMPL;}
00182   STDMETHOD(OnShowWindow)(BOOL fShow) {return E_NOTIMPL;}
00183   STDMETHOD(RequestNewObjectLayout)(void) {return E_NOTIMPL;}
00184 };
00185
00186 #endif //__BROWSERHOST_H_
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WRITER_PARAMS Member List

This is the complete list of members for WRITER_PARAMS, including all inherited members.
hPipe | WRITER_PARAMS
iDataSize | WRITER_PARAMS
szData | WRITER_PARAMS
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/GenericUCP/CPP/deviceprop.h Source File

  • NetDS
  • upnp
  • GenericUCP
  • CPP

deviceprop.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation
00004
00005
00006 --*/
00007 #if !defined(AFX_DEVICEPROP_H__D5EABECF_0B96_488F_AF56_F439B3720C3A__INCLUDED_)
00008 #define AFX_DEVICEPROP_H__D5EABECF_0B96_488F_AF56_F439B3720C3A__INCLUDED_
00009
00010 #if _MSC_VER > 1000
00011 #pragma once
00012 #endif // _MSC_VER > 1000
00013 // DeviceProp.h : header file
00014 //
00015 #include "util.h"
00016 #include "genericucpdlg.h"
00017 /////////////////////////////////////////////////////////////////////////////
00018 // DeviceProp dialog
00019
00020 class CDeviceProp : public CDialog
00021 {
00022 // Construction
00023 public:
00024   CDeviceProp(CWnd* pParent = NULL);   // standard constructor
00025   CDeviceProp(IUPnPDevice *pDevice, CWnd* pParent = NULL);   // standard constructor
00026   ~CDeviceProp();
00027   // Dialog Data
00028   //{{AFX_DATA(CDeviceProp)
00029   enum { IDD = IDD_DEVPROP_DIALOG };
00030   CButton m_OkButton;
00031   CEdit m_UPC;
00032   CEdit m_UDN;
00033   CEdit m_SerialNumber;
00034   CEdit m_PresentationUrl;
00035   CEdit m_ModelUrl;
00036   CEdit m_ModelNumber;
00037   CEdit m_ModelName;
00038   CEdit m_ModelDescription;
00039   CEdit m_ManufacturerUrl;
00040   CEdit m_Manufacturer;
00041   CEdit m_FriendlyName;
00042   CEdit m_DeviceType;
00043   //}}AFX_DATA
00044
00045
00046 // Overrides
00047   // ClassWizard generated virtual function overrides
00048   //{{AFX_VIRTUAL(CDeviceProp)
00049   protected:
00050   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00051   //}}AFX_VIRTUAL
00052
00053 // Implementation
00054 protected:
00055
00056   // Generated message map functions
00057   //{{AFX_MSG(CDeviceProp)
00058   virtual BOOL OnInitDialog();
00059   afx_msg void OnOk();
00060   //}}AFX_MSG
00061   DECLARE_MESSAGE_MAP()
00062 private:
00063   void PrintTextToEditBox(CEdit *pEditBox, BSTR bstrPrintText, HRESULT hrCheck);
00064   IUPnPDevice* pCurrentDevice;
00065 };
00066
00067 //{{AFX_INSERT_LOCATION}}
00068 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00069
00070 #endif // !defined(AFX_DEVICEPROP_H__D5EABECF_0B96_488F_AF56_F439B3720C3A__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/repas/Repascu.c Source File

  • NetDS
  • RPC
  • Data
  • repas

Repascu.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                         repas Example
00005
00006     FILE:       repascu.c
00007
00008     PURPOSE:    Utility functions used by client side of the RPC
00009                 distributed application.
00010                 This sample demonstrates the represent_as attribute.
00011
00012     RELATED:    repass.c - server main
00013                 repasp.c - remote procedures
00014                 repasc.c - client main
00015
00016     FUNCTIONS:  WCHAR_STRING_to_local    - convert WCHAR_STRING to CHAR_STRING
00017                 WCHAR_STRING_from_local  - convert WCHAR_STRING from CHAR_STRING
00018                 WCHAR_STRING_free_inst   - free WCHAR_STRING memory
00019                 WCHAR_STRING_free_local  - free CHAR_STRING memory
00020                 midl_user_allocate - user-supplied memory allocator
00021                 midl_user_free - user-supplied routine to free memory
00022
00023
00024     COMMENTS:   This sample program generates a client and server can share
00025                 an interface, but one side can use a different representation
00026                 than the other.
00027
00028                 The client side in this example does all operations using
00029                 character strings, and the server side does all operations
00030                 using UNICODE strings.  Two procedures are provided, one
00031                 defined with ASCII strings, one with UNICODE strings.
00032                 The wire format reflects these definitions, yet the client
00033                 and server see pure ASCII and pure UNICODE respectively.
00034
00035                 The [represent_as] attribute (used in the client and server
00036                 side acf files) requires the four user-supplied functions
00037                 whose names start with the name of the transmitted type
00038                 (in the client side's case: WCHAR_STRING)
00039
00040                 The [in, out] attributes applied to remote procedure
00041                 parameters require the two user-supplied functions
00042                 midl_user_allocate and midl_user_free.
00043
00044                 The other functions are utilities that are used to
00045                 build or display the data structures.
00046
00047 ****************************************************************************/
00048
00049 #include <stdlib.h>
00050 #include <stdio.h>
00051 #include "repasc.h"    // header file generated by MIDL compiler for client
00052
00053
00054
00055
00056 /*
00057  Description:   Allocates memory for the transmitted type and converts from
00058                 local type to the transmitted type
00059
00060  Arguments:
00061     pLocal:     pointer to local type
00062     ppWire:     pointer to the transmitted type pointer. This function should
00063                 allocate memory for the transmitted data type.
00064
00065  Return Value:  None.
00066 */
00067 void __RPC_USER
00068 WCHAR_STRING_from_local(
00069     CHAR_STRING __RPC_FAR * pLocal,
00070     WCHAR_STRING __RPC_FAR * __RPC_FAR * ppWire )
00071 {
00072     WCHAR_STRING    *   pWireString;
00073
00074     pWireString = midl_user_allocate( sizeof( WCHAR_STRING ) );
00075
00076     *ppWire = pWireString;
00077
00078     mbstowcs( *pWireString, *pLocal, STRING_SIZE );
00079 }
00080
00081
00082 /*
00083  Description:   Converts from transmitted type to local type.
00084                 Memory for the local type has already been allocated by
00085                 the stubs.
00086
00087  Arguments:
00088     pWire :     pointer to transmitted type
00089     pLocal:     pointer to local type
00090
00091  Return Value:  None.
00092 */
00093 void __RPC_USER
00094 WCHAR_STRING_to_local(
00095     WCHAR_STRING __RPC_FAR * pWire,
00096     CHAR_STRING __RPC_FAR * pLocal )
00097 {
00098     wcstombs( *pLocal, *pWire, STRING_SIZE );
00099 }
00100
00101
00102 /*
00103  Description:   Frees the memory allocated for the transmitted type.This
00104                 includes the embedded pointers (if any).
00105
00106  Arguments:
00107     pWire:      pointer to the transmitted type
00108
00109  Return Value:  None
00110  */
00111 void __RPC_USER
00112 WCHAR_STRING_free_inst(
00113     WCHAR_STRING __RPC_FAR * pWire)
00114 {
00115     midl_user_free( pWire );
00116 }
00117
00118 /*
00119  Descripton:    Frees embedded pointers in the local type(if any).
00120                 Do not free the type itself
00121
00122  Arguments:
00123     pLocal:     pointer to the local type
00124
00125  Return Value:  None
00126  */
00127 void __RPC_USER
00128 WCHAR_STRING_free_local(
00129     CHAR_STRING __RPC_FAR * pLocal)
00130 {
00131     /* As there are no embedded pointers in the
00132      * local type. So nothing to free
00133      */
00134
00135      return;
00136 }
00137
00138 /***************************************************************************/
00139
00140 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00141 {
00142     return(malloc(len));
00143 }
00144
00145 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00146 {
00147     free(ptr);
00148 }
00149
00150
00151 /***************************************************************************/
00152
00153 /* end file repascu.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/oipaObj.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

oipaObj.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          OIPAObj.cpp
00021
00022   Description:   COleInPlaceActiveObject implementation.
00023
00024 **************************************************************************/
00025
00026 /**************************************************************************
00027 #include statements
00028 **************************************************************************/
00029
00030 #include "OIPAObj.h"
00031
00032 /**************************************************************************
00033
00034   COleInPlaceActiveObject::COleInPlaceActiveObject()
00035
00036 **************************************************************************/
00037
00038 COleInPlaceActiveObject::COleInPlaceActiveObject(COleDocument *pOleDoc)
00039 {
00040   OutputDebugString(TEXT("COleInPlaceActiveObject's constructor\n"));
00041
00042   m_pOleDoc = pOleDoc;
00043
00044   m_fEnableModeless = FALSE;
00045 }
00046
00047 /**************************************************************************
00048
00049   COleInPlaceActiveObject::~COleInPlaceActiveObject()
00050
00051 **************************************************************************/
00052
00053 COleInPlaceActiveObject::~COleInPlaceActiveObject()
00054 {
00055   OutputDebugString(TEXT("COleInPlaceActiveObject's destructor\n"));
00056 }
00057
00058 /**************************************************************************
00059
00060   COleInPlaceActiveObject::QueryInterface()
00061
00062 **************************************************************************/
00063
00064 STDMETHODIMP COleInPlaceActiveObject::QueryInterface(REFIID riid, LPVOID *ppReturn)
00065 {
00066   OutputDebugString(TEXT("COleInPlaceActiveObject::QueryInterface\n"));
00067
00068   return m_pOleDoc->QueryInterface(riid, ppReturn);
00069 }
00070
00071 /**************************************************************************
00072
00073   COleInPlaceActiveObject::AddRef()
00074
00075 **************************************************************************/
00076
00077 STDMETHODIMP_(ULONG) COleInPlaceActiveObject::AddRef()
00078 {
00079   OutputDebugString(TEXT("COleInPlaceActiveObject::AddRef\n"));
00080
00081   return m_pOleDoc->AddRef();
00082 }
00083
00084 /**************************************************************************
00085
00086   COleInPlaceActiveObject::Release()
00087
00088 **************************************************************************/
00089
00090 STDMETHODIMP_(ULONG) COleInPlaceActiveObject::Release()
00091 {
00092   OutputDebugString(TEXT("COleInPlaceActiveObject::Release\n"));
00093
00094   return m_pOleDoc->Release();
00095 }
00096
00097 /**************************************************************************
00098
00099   COleInPlaceActiveObject::OnDocWindowActivate()
00100
00101 **************************************************************************/
00102
00103 STDMETHODIMP COleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate)
00104 {
00105   OutputDebugString(TEXT("COleInPlaceActiveObject::OnDocWindowActivate\n"));
00106
00107   //If we are getting activated, merge our menus.
00108   if(fActivate)
00109   {
00110     if(m_pOleDoc->m_pOleDocView)
00111     {
00112       m_pOleDoc->m_pOleDocView->MergeMenus();
00113     }
00114   }
00115
00116   return S_OK;
00117 }
00118
00119 /**************************************************************************
00120
00121   COleInPlaceActiveObject::OnFrameWindowActivate()
00122
00123 **************************************************************************/
00124
00125 STDMETHODIMP COleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate)
00126 {
00127   UNREFERENCED_PARAMETER(fActivate);
00128   OutputDebugString(TEXT("COleInPlaceActiveObject::OnFrameWindowActivate\n"));
00129
00130   return S_OK;
00131 }
00132
00133 /**************************************************************************
00134
00135   COleInPlaceActiveObject::GetWindow()
00136
00137 **************************************************************************/
00138
00139 STDMETHODIMP COleInPlaceActiveObject::GetWindow(HWND *phwnd)
00140 {
00141   OutputDebugString(TEXT("COleInPlaceActiveObject::GetWindow\n"));
00142
00143   return m_pOleDoc->GetWindow(phwnd);
00144 }
00145
00146 /**************************************************************************
00147
00148   COleInPlaceActiveObject::ContextSensitiveHelp()
00149
00150 **************************************************************************/
00151
00152 STDMETHODIMP COleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode)
00153 {
00154   UNREFERENCED_PARAMETER(fEnterMode);
00155   OutputDebugString(TEXT("COleInPlaceActiveObject::ContextSensitiveHelp\n"));
00156
00157   return E_NOTIMPL;
00158 }
00159
00160 /**************************************************************************
00161
00162   COleInPlaceActiveObject::TranslateAccelerator()
00163
00164 **************************************************************************/
00165
00166 STDMETHODIMP COleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg)
00167 {
00168   UNREFERENCED_PARAMETER(lpmsg);
00169   OutputDebugString(TEXT("COleInPlaceActiveObject::TranslateAccelerator\n"));
00170
00171   // no accelerator table, return FALSE
00172   return S_FALSE;
00173 }
00174
00175 /**************************************************************************
00176
00177   COleInPlaceActiveObject::ResizeBorder()
00178
00179 **************************************************************************/
00180
00181 STDMETHODIMP COleInPlaceActiveObject::ResizeBorder(   LPCRECT lprectBorder,
00182                            LPOLEINPLACEUIWINDOW lpUIWindow,
00183                            BOOL fFrameWindow)
00184 {
00185   UNREFERENCED_PARAMETER(lprectBorder);
00186   UNREFERENCED_PARAMETER(lpUIWindow);
00187   UNREFERENCED_PARAMETER(fFrameWindow);
00188   OutputDebugString(TEXT("COleInPlaceActiveObject::ResizeBorder\n"));
00189
00190   return S_OK;
00191 }
00192
00193 /**************************************************************************
00194
00195   COleInPlaceActiveObject::EnableModeless()
00196
00197 **************************************************************************/
00198
00199 STDMETHODIMP COleInPlaceActiveObject::EnableModeless(BOOL fEnable)
00200 {
00201   OutputDebugString(TEXT("COleInPlaceActiveObject::EnableModeless\n"));
00202
00203   m_fEnableModeless = fEnable;
00204
00205   return S_OK;
00206 }
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpCntr/site.Cpp Source File

  • Com
  • Fundamentals
  • SimpCntr

site.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: SITE.CPP
00003 //
00004 //      Implementation file for CSimpleSite
00005 //
00006 // Functions:
00007 //
00008 //      See SITE.H for class definition
00009 //
00010 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "iocs.h"
00015 #include "ias.h"
00016 #include "ioipf.h"
00017 #include "ioips.h"
00018 #include "app.h"
00019 #include "site.h"
00020 #include "doc.h"
00021
00022 #define HIMETRIC_PER_INCH 2540
00023 #define MAP_LOGHIM_TO_PIX(x,ppli) MulDiv((ppli), (x), HIMETRIC_PER_INCH)
00024
00025 int XformWidthInHimetricToPixels(HDC hDC, int iWidthInHiMetric)
00026 {
00027     int     iXppli;     //Pixels per logical inch along width
00028     int     iWidthInPix;
00029     BOOL    fSystemDC=FALSE;
00030
00031     if (NULL==hDC)
00032     {
00033         hDC=GetDC(NULL);
00034         fSystemDC=TRUE;
00035     }
00036
00037     iXppli = GetDeviceCaps (hDC, LOGPIXELSX);
00038
00039     //We got logical HIMETRIC along the display, convert them to pixel units
00040     iWidthInPix = MAP_LOGHIM_TO_PIX(iWidthInHiMetric, iXppli);
00041
00042     if (fSystemDC)
00043         ReleaseDC(NULL, hDC);
00044
00045     return iWidthInPix;
00046 }
00047
00048 int XformHeightInHimetricToPixels(HDC hDC, int iHeightInHiMetric)
00049 {
00050     int     iYppli;     //Pixels per logical inch along height
00051     int     iHeightInPix;
00052     BOOL    fSystemDC=FALSE;
00053
00054     if (NULL==hDC)
00055     {
00056         hDC=GetDC(NULL);
00057         fSystemDC=TRUE;
00058     }
00059
00060     iYppli = GetDeviceCaps (hDC, LOGPIXELSY);
00061
00062     //* We got logical HIMETRIC along the display, convert them to pixel units
00063     iHeightInPix = MAP_LOGHIM_TO_PIX(iHeightInHiMetric, iYppli);
00064
00065     if (fSystemDC)
00066         ReleaseDC(NULL, hDC);
00067
00068     return iHeightInPix;
00069 }
00070
00071
00072 //**********************************************************************
00073 //
00074 // OleFree
00075 //
00076 // Purpose:
00077 //
00078 //      free memory using the currently active IMalloc* allocator
00079 //
00080 // Parameters:
00081 //
00082 //      LPVOID pmem - pointer to memory allocated using IMalloc
00083 //
00084 // Return Value:
00085 //
00086 //      None
00087 //
00088 // Comments:
00089 //
00090 //********************************************************************
00091
00092 void OleFree(LPVOID pmem)
00093 {
00094     LPMALLOC pmalloc;
00095
00096     if (pmem == NULL)
00097         return;
00098
00099     if (FAILED(CoGetMalloc(MEMCTX_TASK, &pmalloc)))
00100         return;
00101
00102     pmalloc->Free(pmem);
00103     pmalloc->Release();
00104 }
00105
00106 //**********************************************************************
00107 //
00108 // CSimpleSite::Create
00109 //
00110 // Purpose:
00111 //
00112 //      Creation routine for CSimpleSite
00113 //
00114 // Parameters:
00115 //
00116 //      CSimpleDoc FAR *lpDoc   - Pointer to CSimpleDoc
00117 //
00118 // Return Value:
00119 //
00120 //      None
00121 //
00122 // Function Calls:
00123 //      Function                    Location
00124 //
00125 //      IStorage::CreateStorage     OLE API
00126 //      assert                      C Runtime
00127 //
00128 // Comments:
00129 //
00130 //********************************************************************
00131
00132 CSimpleSite FAR * CSimpleSite::Create(CSimpleDoc FAR *lpDoc)
00133 {
00134         CSimpleSite FAR * lpTemp = new CSimpleSite(lpDoc);
00135
00136         if (!lpTemp)
00137                 return NULL;
00138
00139         // create a sub-storage for the object
00140   //@@WTK WIN32, UNICODE
00141         //HRESULT hErr = lpDoc->m_lpStorage->CreateStorage( "Object",
00142         HRESULT hErr = lpDoc->m_lpStorage->CreateStorage( OLESTR("Object"),
00143                                 STGM_READWRITE | STGM_TRANSACTED | STGM_SHARE_EXCLUSIVE,
00144                                 0,
00145                                 0,
00146                                 &lpTemp->m_lpObjStorage);
00147
00148         assert(hErr == NOERROR);
00149
00150         if (hErr != NOERROR)
00151                 {
00152                 delete lpTemp;
00153                 return NULL;
00154                 }
00155
00156         // we will add one ref count on our Site. later when we want to destroy
00157         // the Site object we will release this  ref count. when the Site's ref
00158         // count goes to 0, it will be deleted.
00159         lpTemp->AddRef();
00160
00161         return lpTemp;
00162 }
00163
00164 //**********************************************************************
00165 //
00166 // CSimpleSite::CSimpleSite
00167 //
00168 // Purpose:
00169 //
00170 //      Constructor for CSimpleSite
00171 //
00172 // Parameters:
00173 //
00174 //      CSimpleDoc FAR *lpDoc   - Pointer to CSimpleDoc
00175 //
00176 // Return Value:
00177 //
00178 //      None
00179 //
00180 // Function Calls:
00181 //      Function                    Location
00182 //
00183 // Comments:
00184 //
00185 //********************************************************************
00186 #pragma warning(disable : 4355)  // turn off this warning.  This warning
00187                                                                 // tells us that we are passing this in
00188                                                                 // an initializer, before "this" is through
00189                                                                 // initializing.  This is ok, because
00190                                                                 // we just store the ptr in the other
00191                                                                 // constructors
00192
00193 CSimpleSite::CSimpleSite (CSimpleDoc FAR *lpDoc) : m_OleClientSite(this),
00194                                                                                                  m_AdviseSink(this),
00195                                                                                                  m_OleInPlaceSite(this)
00196 #pragma warning (default : 4355)  // Turn the warning back on
00197 {
00198         // remember the pointer to the doc
00199         m_lpDoc = lpDoc;
00200
00201         // clear the reference count
00202
00203         m_dwDrawAspect = DVASPECT_CONTENT;
00204         m_lpOleObject = NULL;
00205         m_lpInPlaceObject = NULL;
00206         m_hwndIPObj = NULL;
00207         m_fInPlaceActive = FALSE;
00208         m_fObjectOpen = FALSE;
00209
00210 }
00211
00212 //**********************************************************************
00213 //
00214 // CSimpleSite::~CSimpleSite
00215 //
00216 // Purpose:
00217 //
00218 //      Destructor for CSimpleSite
00219 //
00220 // Parameters:
00221 //
00222 //      None
00223 //
00224 // Return Value:
00225 //
00226 //      None
00227 //
00228 // Function Calls:
00229 //      Function                                Location
00230 //
00231 //      OutputDebugString                       Windows API
00232 //      IOleObject::Release                     Object
00233 //      IStorage::Release                       OLE API
00234 //
00235 // Comments:
00236 //
00237 //********************************************************************
00238
00239 CSimpleSite::~CSimpleSite ()
00240 {
00241         OutputDebugString ("In CSimpleSite's Destructor \r\n");
00242
00243         if (m_lpOleObject)
00244            m_lpOleObject->Release();
00245
00246         if (m_lpObjStorage)
00247            m_lpObjStorage->Release();
00248 }
00249
00250
00251 //**********************************************************************
00252 //
00253 // CSimpleSite::CloseOleObject
00254 //
00255 // Purpose:
00256 //
00257 //      Call IOleObject::Close on the object of the CSimpleSite
00258 //
00259 // Parameters:
00260 //
00261 //      None
00262 //
00263 // Return Value:
00264 //
00265 //      None
00266 //
00267 // Function Calls:
00268 //      Function                                Location
00269 //
00270 //      OutputDebugString                       Windows API
00271 //      IOleObject::QueryInterface              Object
00272 //      IOleObject::Close                       Object
00273 //      IOleInPlaceObject::UIDeactivate         Object
00274 //      IOleInPlaceObject::InPlaceDeactivate    Object
00275 //      IOleInPlaceObject::Release              Object
00276 //
00277 // Comments:
00278 //
00279 //********************************************************************
00280
00281 void CSimpleSite::CloseOleObject (void)
00282 {
00283         CStabilize stabilize(this);
00284         LPOLEINPLACEOBJECT lpObject;
00285         LPVIEWOBJECT lpViewObject = NULL;
00286
00287         OutputDebugString ("In CSimpleSite::CloseOleObject \r\n");
00288
00289         if (m_lpOleObject)
00290            {
00291            if (m_fInPlaceActive)
00292                    {
00293                    m_lpOleObject->QueryInterface(IID_IOleInPlaceObject, (LPVOID FAR *)&lpObject);
00294                    lpObject->UIDeactivate();
00295                    // don't need to worry about inside-out because the object
00296                    // is going away.
00297                    lpObject->InPlaceDeactivate();
00298                    lpObject->Release();
00299                    }
00300
00301            m_lpOleObject->Close(OLECLOSE_NOSAVE);
00302            }
00303 }
00304
00305
00306 //**********************************************************************
00307 //
00308 // CSimpleSite::UnloadOleObject
00309 //
00310 // Purpose:
00311 //
00312 //      Close and release all pointers to the object of the CSimpleSite
00313 //
00314 // Parameters:
00315 //
00316 //      None
00317 //
00318 // Return Value:
00319 //
00320 //      None
00321 //
00322 // Function Calls:
00323 //      Function                                Location
00324 //
00325 //      OutputDebugString                       Windows API
00326 //      CSimpleSite::CloseOleObject             SITE.CPP
00327 //      IOleObject::QueryInterface              Object
00328 //      IViewObject::SetAdvise                  Object
00329 //      IViewObject::Release                    Object
00330 //      IStorage::Release                       OLE API
00331 //
00332 // Comments:
00333 //
00334 //********************************************************************
00335
00336 void CSimpleSite::UnloadOleObject (void)
00337 {
00338         CStabilize stabilize(this);
00339         OutputDebugString ("In CSimpleSite::UnloadOleObject \r\n");
00340
00341         if (m_lpOleObject)
00342            {
00343            LPVIEWOBJECT lpViewObject;
00344            CloseOleObject();    // ensure object is closed; NOP if already closed
00345
00346            m_lpOleObject->QueryInterface(IID_IViewObject, (LPVOID FAR *)&lpViewObject);
00347
00348            if (lpViewObject)
00349                    {
00350                    // Remove the view advise
00351                    lpViewObject->SetAdvise(m_dwDrawAspect, 0, NULL);
00352                    lpViewObject->Release();
00353                    }
00354
00355            m_lpOleObject->Release();
00356            m_lpOleObject = NULL;
00357            }
00358 }
00359
00360
00361 //**********************************************************************
00362 //
00363 // CSimpleSite::QueryInterface
00364 //
00365 // Purpose:
00366 //
00367 //      Used for interface negotiation of the container Site.
00368 //
00369 // Parameters:
00370 //
00371 //      REFIID riid         -   A reference to the interface that is
00372 //                              being queried.
00373 //
00374 //      LPVOID FAR* ppvObj  -   An out parameter to return a pointer to
00375 //                              the interface.
00376 //
00377 // Return Value:
00378 //
00379 //      S_OK    -   The interface is supported.
00380 //      S_FALSE -   The interface is not supported
00381 //
00382 // Function Calls:
00383 //      Function                    Location
00384 //
00385 //      OutputDebugString           Windows API
00386 //      IsEqualIID                  OLE API
00387 //                   OLE API
00388 //      CSimpleSite::AddRef          OBJ.CPP
00389 //      COleClientSite::AddRef      IOCS.CPP
00390 //      CAdviseSink::AddRef         IAS.CPP
00391 //
00392 // Comments:
00393 //
00394 //
00395 //********************************************************************
00396
00397 STDMETHODIMP CSimpleSite::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
00398 {
00399         CStabilize stabilize(this);
00400         OutputDebugString("In CSimpleSite::QueryInterface\r\n");
00401
00402         *ppvObj = NULL;     // must set out pointer parameters to NULL
00403
00404         if ( riid == IID_IUnknown)
00405                 {
00406                 AddRef();
00407                 *ppvObj = this;
00408                 return S_OK;
00409                 }
00410
00411         if ( riid == IID_IOleClientSite)
00412                 {
00413                 m_OleClientSite.AddRef();
00414                 *ppvObj = &m_OleClientSite;
00415                 return S_OK;
00416                 }
00417
00418         if ( riid == IID_IAdviseSink)
00419                 {
00420                 m_AdviseSink.AddRef();
00421                 *ppvObj = &m_AdviseSink;
00422                 return S_OK;
00423                 }
00424
00425         if ( riid == IID_IOleInPlaceSite)
00426                 {
00427                 m_OleInPlaceSite.AddRef();
00428                 *ppvObj = &m_OleInPlaceSite;
00429                 return S_OK;
00430                 }
00431
00432         // Not a supported interface
00433         return E_NOINTERFACE;
00434 }
00435
00436 //**********************************************************************
00437 //
00438 // CSimpleSite::AddRef
00439 //
00440 // Purpose:
00441 //
00442 //      Increments the reference count of the container Site.
00443 //
00444 // Parameters:
00445 //
00446 //      None
00447 //
00448 // Return Value:
00449 //
00450 //      ULONG   -   The new reference count of the site.
00451 //
00452 // Function Calls:
00453 //      Function                    Location
00454 //
00455 //      OutputDebugString           Windows API
00456 //
00457 // Comments:
00458 //
00459 //********************************************************************
00460
00461 STDMETHODIMP_(ULONG) CSimpleSite::AddRef()
00462 {
00463         OutputDebugString("In CSimpleSite::AddRef\r\n");
00464
00465         return SafeAddRef();
00466 }
00467
00468 //**********************************************************************
00469 //
00470 // CSimpleSite::Release
00471 //
00472 // Purpose:
00473 //
00474 //      Decrements the reference count of the container Site
00475 //
00476 // Parameters:
00477 //
00478 //      None
00479 //
00480 // Return Value:
00481 //
00482 //      ULONG   -   The new reference count of the Site.
00483 //
00484 // Function Calls:
00485 //      Function                    Location
00486 //
00487 //      OutputDebugString           Windows API
00488 //
00489 // Comments:
00490 //
00491 //********************************************************************
00492
00493 STDMETHODIMP_(ULONG) CSimpleSite::Release()
00494 {
00495         OutputDebugString("In CSimpleSite::Release\r\n");
00496
00497         return(SafeRelease());
00498 }
00499
00500 //**********************************************************************
00501 //
00502 // CSimpleSite::InitObject
00503 //
00504 // Purpose:
00505 //
00506 //      Used to initialize a newly create object (can't be done in the
00507 //      constructor).
00508 //
00509 // Parameters:
00510 //
00511 //      BOOL fCreateNew -   TRUE if insert NEW object
00512 //                          FALSE if create object FROM FILE
00513 //
00514 // Return Value:
00515 //
00516 //      None
00517 //
00518 // Function Calls:
00519 //      Function                        Location
00520 //
00521 //      IOleObject::SetHostNames        Object
00522 //      IOleObject::QueryInterface      Object
00523 //      IViewObject2::GetExtent         Object
00524 //      IOleObject::DoVerb              Object
00525 //      IViewObject::SetAdvise          Object
00526 //      IViewObject::Release            Object
00527 //      GetClientRect                   Windows API
00528 //      OleSetContainedObject           OLE API
00529 //
00530 // Comments:
00531 //
00532 //********************************************************************
00533
00534 void CSimpleSite::InitObject(BOOL fCreateNew)
00535 {
00536         CStabilize stabilize(this);
00537         LPVIEWOBJECT2 lpViewObject2;
00538         RECT rect;
00539
00540         // Set a View Advise
00541         m_lpOleObject->QueryInterface(IID_IViewObject2,(LPVOID FAR *)&lpViewObject2);
00542         lpViewObject2->SetAdvise(m_dwDrawAspect, ADVF_PRIMEFIRST, &m_AdviseSink);
00543
00544         // get the initial size of the object
00545         lpViewObject2->GetExtent(m_dwDrawAspect, -1 /*lindex*/, NULL /*ptd*/, &m_sizel);
00546         GetObjRect(&rect);  // get the rectangle of the object in pixels
00547         lpViewObject2->Release();
00548
00549         // give the object the name of the container app/document
00550   //@@WTK WIN32, UNICODE
00551         //m_lpOleObject->SetHostNames("Simple Application", "Simple OLE 2.0 In-Place Container");
00552         m_lpOleObject->SetHostNames(OLESTR("Simple Application"),
00553                         OLESTR("Simple OLE 2.0 In-Place Container"));
00554
00555         // inform object handler/DLL object that it is used in the embedding container's context
00556         OleSetContainedObject(m_lpOleObject, TRUE);
00557
00558         if (fCreateNew) {
00559            // force new object to save to guarantee valid object in our storage.
00560            // OLE 1.0 objects may close w/o saving. this is NOT necessary if the
00561            // object is created FROM FILE; its data in storage is already valid.
00562            m_OleClientSite.SaveObject();
00563
00564            // we only want to DoVerb(SHOW) if this is an InsertNew object.
00565            // we should NOT DoVerb(SHOW) if the object is created FromFile.
00566            m_lpOleObject->DoVerb(
00567                            OLEIVERB_SHOW,
00568                            NULL,
00569                            &m_OleClientSite,
00570                            -1,
00571                            m_lpDoc->m_hDocWnd,
00572                            &rect);
00573         }
00574 }
00575
00576 //**********************************************************************
00577 //
00578 // CSimpleSite::PaintObj
00579 //
00580 // Purpose:
00581 //
00582 //      Paints the object
00583 //
00584 // Parameters:
00585 //
00586 //      HDC hDC     - Device context of the document window
00587 //
00588 // Return Value:
00589 //
00590 // Function Calls:
00591 //      Function                        Location
00592 //
00593 //      IOleObject::QueryInterface      Object
00594 //      IViewObject::GetColorSet        Object
00595 //      IViewObject::Release            Object
00596 //      SetMapMode                      Windows API
00597 //      LPtoDP                          Windows API
00598 //      CreateHatchBrush                Windows API
00599 //      SelectObject                    Windows API
00600 //      DeleteObject                    Windows API
00601 //      CreatePalette                   Windows API
00602 //      SelectPalette                   Windows API
00603 //      RealizePalette                  Windows API
00604 //      OleDraw                         OLE API
00605 //
00606 // Comments:
00607 //
00608 //********************************************************************
00609
00610 void CSimpleSite::PaintObj(HDC hDC)
00611 {
00612 RECT rect;
00613         CStabilize stabilize(this);
00614
00615         // need to check to make sure there is a valid object
00616         // available.  This is needed if there is a paint msg
00617         // between the time that CSimpleSite is instantiated
00618         // and OleUIInsertObject returns.
00619         if (!m_lpOleObject)
00620                 return;
00621
00622         // convert it to pixels
00623         GetObjRect(&rect);
00624
00625         LPLOGPALETTE pColorSet = NULL;
00626         LPVIEWOBJECT lpView = NULL;
00627
00628         // get a pointer to IViewObject
00629         m_lpOleObject->QueryInterface(IID_IViewObject,(LPVOID FAR *) &lpView);
00630
00631         // if the QI succeeds, get the LOGPALETTE for the object
00632         if (lpView)
00633                 lpView->GetColorSet(m_dwDrawAspect, -1, NULL, NULL, NULL, &pColorSet);
00634
00635         HPALETTE hPal=NULL;
00636         HPALETTE hOldPal=NULL;
00637
00638         // if a LOGPALETTE was returned (not guarateed), create the palette and
00639         // realize it.  NOTE: A smarter application would want to get the LOGPALETTE
00640         // for each of its visible objects, and try to create a palette that
00641         // satisfies all of the visible objects.  ALSO: OleFree() is used to
00642         // free the returned LOGPALETTE.
00643         if ((pColorSet))
00644                 {
00645                 //@@WTK WIN32, UNICODE
00646                 //hPal = CreatePalette((const LPLOGPALETTE) pColorSet);
00647                 hPal = CreatePalette( pColorSet);
00648                 hOldPal = SelectPalette(hDC, hPal, FALSE);
00649                 RealizePalette(hDC);
00650                 OleFree(pColorSet);
00651                 }
00652
00653         // draw the object
00654         OleDraw(m_lpOleObject, m_dwDrawAspect, hDC, &rect);
00655
00656         // if the object is open, draw a hatch rect.
00657         if (m_fObjectOpen)
00658                 {
00659                 HBRUSH hBrush = CreateHatchBrush ( HS_BDIAGONAL, RGB(0,0,0) );
00660                 HBRUSH hOldBrush = (HBRUSH) SelectObject (hDC, hBrush);
00661                 SetROP2(hDC, R2_MASKPEN);
00662                 Rectangle (hDC, rect.left, rect.top, rect.right, rect.bottom);
00663                 SelectObject(hDC, hOldBrush);
00664                 DeleteObject(hBrush);
00665                 }
00666
00667         // if we created a palette, restore the old one, and destroy
00668         // the object.
00669         if (hPal)
00670                 {
00671                 SelectPalette(hDC,hOldPal,FALSE);
00672                 DeleteObject(hPal);
00673                 }
00674
00675         // if a view pointer was successfully returned, it needs to be released.
00676         if (lpView)
00677                 lpView->Release();
00678 }
00679
00680 //**********************************************************************
00681 //
00682 // CSimpleSite::GetObjRect
00683 //
00684 // Purpose:
00685 //
00686 //      Retrieves the rect of the object in pixels
00687 //
00688 // Parameters:
00689 //
00690 //      LPRECT lpRect - Rect structure filled with object's rect in pixels
00691 //
00692 // Return Value:
00693 //
00694 // Function Calls:
00695 //      Function                        Location
00696 //
00697 //      XformWidthInHimetricToPixels    OUTLUI Function
00698 //      XformHeightInHimetricToPixels   OUTLUI Function
00699 //
00700 // Comments:
00701 //
00702 //********************************************************************
00703
00704 void CSimpleSite::GetObjRect(LPRECT lpRect)
00705 {
00706         // convert it to pixels
00707         lpRect->left = lpRect->top = 0;
00708         lpRect->right = XformWidthInHimetricToPixels(NULL,(int)m_sizel.cx);
00709         lpRect->bottom = XformHeightInHimetricToPixels(NULL,(int)m_sizel.cy);
00710 }
00711
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpAsyncSample/SimpleBrowser.cpp Source File

  • Web
  • winhttp
  • WinHttpAsyncSample

SimpleBrowser.cpp

Go to the documentation of this file.
00001 //  WinHttpAsyncSample
00002 //  Copyright (c) Microsoft Corporation. All rights reserved.
00003
00004 #include <windows.h>
00005 #include <winhttp.h>
00006 #include "defs.h"
00007 #include "browser.h"
00008
00009 #include <stdio.h>
00010
00011 // Modify the config below to control the number of browser sessions this sample would "browse"
00012 // in parallel. For each session, a block below, you can configure what "home page" it will
00013 // begin with, how to retrieve proxy infomation (e.g. auto detect or use pre-configured settings), as
00014 // well as a ";" delimited "embedded links" that the browser would download after the main page
00015 // is fetched.
00016
00017 BROWSER_CONFIG BrowserConfigs[] =
00018 {
00019     {
00020         L"https://www.microsoft.com",   // home page
00021         TRUE,                           // use auto-proxy
00022         TRUE,                           // enable proxy fail-over
00023         30,                             // time limit (in seconds)
00024         2,                              // reties 2 times if a request should fail
00025
00026         L"http://www.microsoft.com/servers/;"
00027         L"http://www.microsoft.com/windows/;"
00028         L"http://www.microsoft.com/security/",  // ";" delimited embedded links
00029     }
00030
00031     ,
00032
00033     {
00034         L"http://www.yahoo.com",        // home page
00035         FALSE,                          // use default proxy (configured thru. proxycfg.exe)
00036         TRUE,                           // enable proxy fail-over
00037         20,
00038         3,                              // reties 3 times if a request should fail
00039
00040         L"http://shopping.yahoo.com/;"
00041         L"http://finance.yahoo.com/;"
00042         L"http://news.yahoo.com/",      // ";" delimited embedded links
00043     }
00044
00045     ,
00046
00047     {
00048         L"http://www.cnn.com",          // home page
00049         FALSE,                          // use default proxy (configured thru. proxycfg.exe)
00050         FALSE,                          // disable proxy fail-over
00051         10,
00052         0,                              // don't retry if a request should fail
00053
00054         L"http://www.cnn.com/WORLD/;"
00055         L"http://www.cnn.com/WEATHER/;"
00056         L"http://www.cnn.com/TRAVEL/",  // ";" delimited embedded links
00057     }
00058 };
00059
00060 SIMPLE_BROWSER* BrowserSessions[sizeof(BrowserConfigs) / sizeof (BROWSER_CONFIG)];
00061
00062 // we register a "Ctrl-C" handler to show how on-going downloads can be
00063 // aborted gracefully
00064
00065 BOOL WINAPI ConsoleEventHandler(
00066     DWORD dwCtrlType   //  control signal type
00067 )
00068 {
00069     fprintf(stdout, "Ctrl-C detected...\n");
00070
00071     UINT nNumBrowserSessions = sizeof(BrowserConfigs) / sizeof (BROWSER_CONFIG);
00072
00073     for (UINT i = 0; i < nNumBrowserSessions; ++i)
00074     {
00075         if (BrowserSessions[i])
00076         {
00077             BrowserSessions[i]->Close();
00078             delete BrowserSessions[i];
00079             BrowserSessions[i] = NULL;
00080         }
00081     }
00082
00083     ::ExitProcess(0);
00084
00085     return TRUE;
00086 }
00087
00088 int __cdecl main()
00089 {
00090     // first mask off Ctrl-C so that we can initialize w/o worrying being interrupted
00091     ::SetConsoleCtrlHandler(NULL, TRUE);
00092
00093     UINT nNumBrowserSessions = sizeof(BrowserConfigs) / sizeof (BROWSER_CONFIG);
00094
00095     for (UINT i = 0; i < nNumBrowserSessions; ++i)
00096     {
00097         SIMPLE_BROWSER* pBrowser = new SIMPLE_BROWSER(i);
00098         if (pBrowser)
00099         {
00100             if (pBrowser->Open(&BrowserConfigs[i]) == TRUE)
00101             {
00102                 BrowserSessions[i] = pBrowser;
00103             }
00104             else
00105             {
00106                 delete pBrowser;
00107             }
00108         }
00109     }
00110
00111     // now that things are started let's unmask Ctrl-C and register a custom Ctrl handler
00112     // to faciliate gracefully shutdown
00113     ::SetConsoleCtrlHandler(NULL, FALSE);
00114     ::SetConsoleCtrlHandler(ConsoleEventHandler, TRUE);
00115
00116     ::Sleep(INFINITE);
00117
00118     return 0;
00119 }
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Include/Stablize.h Source File

  • Com
  • Fundamentals
  • Include

Stablize.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       stablize.h
00007 //
00008 //  Contents:   Stabilization Classes used to stabilize objects during
00009 //              re-entrant calls.
00010 //
00011 //  Classes:    CSafeRefCount
00012 //              CStabilize
00013 //
00014 //  History:    8-26-94   stevebl   Modified from code written by AlexGo
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #ifndef __STABLIZE__
00019 #define __STABLIZE__
00020
00021 //+-------------------------------------------------------------------------
00022 //
00023 //  Class:      CSafeRefCount
00024 //
00025 //  Purpose:    A concrete class for objects to inherit from.
00026 //              CSafeRefCount will keep track of reference counts,
00027 //              nesting counts, and zombie states, allowing objects
00028 //              to easily manage the liveness of their memory images.
00029 //
00030 //  Interface:
00031 //
00032 //  History:    dd-mmm-yy Author    Comment
00033 //              01-Aug-94 alexgo    author
00034 //
00035 //  Notes:      inherits CPrivAlloc
00036 //
00037 //--------------------------------------------------------------------------
00038
00039 class CSafeRefCount
00040 {
00041 public:
00042         ULONG   SafeAddRef();
00043         ULONG   SafeRelease();
00044         ULONG   IncrementNestCount();
00045         ULONG   DecrementNestCount();
00046                 CSafeRefCount();
00047         virtual ~CSafeRefCount();
00048
00049 private:
00050
00051         ULONG   m_cRefs;
00052         ULONG   m_cNest;
00053         BOOL    m_fInDelete;
00054 };
00055
00056 //+-------------------------------------------------------------------------
00057 //
00058 //  Class:      CStabilize
00059 //
00060 //  Purpose:    An instance of this class should be allocated on the
00061 //              stack of every object method that makes an outgoing call.
00062 //              The contstructor takes a pointer to the object's base
00063 //              CSafeRefCount class.
00064 //
00065 //  Interface:
00066 //
00067 //  History:    dd-mmm-yy Author    Comment
00068 //              01-Aug-94 alexgo    author
00069 //
00070 //  Notes:      The constructor will increment the nest count of the
00071 //              object while the destructor will decrement it.
00072 //
00073 //--------------------------------------------------------------------------
00074
00075 class CStabilize
00076 {
00077 public:
00078         inline CStabilize( CSafeRefCount *pObjSafeRefCount );
00079         inline ~CStabilize();
00080
00081 private:
00082         CSafeRefCount * m_pObjSafeRefCount;
00083 };
00084
00085 inline CStabilize::CStabilize( CSafeRefCount *pObjSafeRefCount )
00086 {
00087         pObjSafeRefCount->IncrementNestCount();
00088         m_pObjSafeRefCount = pObjSafeRefCount;
00089 }
00090
00091 inline CStabilize::~CStabilize()
00092 {
00093         m_pObjSafeRefCount->DecrementNestCount();
00094 }
00095
00096 #endif  // __STABLIZE__
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MEMICONDIR Member List

This is the complete list of members for MEMICONDIR, including all inherited members.
idCount | MEMICONDIR
idEntries | MEMICONDIR
idReserved | MEMICONDIR
idType | MEMICONDIR
Generated on Wed Nov 13 2024 16:57:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share Sample/StringUtils.h Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share Sample

StringUtils.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      StringUtils.h
00007 //
00008 //  Description:
00009 //      Declaration of string manipulation routines.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020 #pragma once
00021
00022 #include "ClRes.h"
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // Custom string compare function declarations. Used to replace lstrcmp*
00026 /////////////////////////////////////////////////////////////////////////////
00027
00028 //
00029 // Full string compares.
00030 //
00031
00032 int
00033 IBSTRCompareW(
00034       BSTR  bstrString1In
00035     , BSTR  bstrString2In
00036     );
00037
00038 int
00039 BSTRCompareW(
00040       BSTR  bstrString1In
00041     , BSTR  bstrString2In
00042     );
00043
00044 int
00045 IStringCompareW(
00046       LPCWSTR pcwszString1In
00047     , LPCWSTR pcwszString2In
00048     );
00049
00050 int
00051 StringCompareW(
00052       LPCWSTR pcwszString1In
00053     , LPCWSTR pcwszString2In
00054     );
00055
00056 int
00057 IStringCompareW(
00058       LPCWSTR   pcwszString1In
00059     , size_t    cch1In
00060     , LPCWSTR   pcwszString2In
00061     , size_t    cch2In
00062     );
00063
00064 int
00065 StringCompareW(
00066       LPCWSTR   pcwszString1In
00067     , size_t    cch1In
00068     , LPCWSTR   pcwszString2In
00069     , size_t    cch2In
00070     );
00071
00072 //
00073 // Partial string compares.  They use whichever one's length is shortest
00074 // if both are specified or the NBSTR routines are used.
00075 //
00076
00077 int
00078 NIBSTRCompareW(
00079       BSTR  bstrString1In
00080     , BSTR  bstrString2In
00081     );
00082
00083 int
00084 NBSTRCompareW(
00085       BSTR  bstrString1In
00086     , BSTR  bstrString2In
00087     );
00088
00089 int
00090 NIStringCompareW(
00091       LPCWSTR   pcwszString1In
00092     , LPCWSTR   pcwszString2In
00093     , size_t    cchIn
00094     );
00095
00096 int
00097 NStringCompareW(
00098       LPCWSTR   pcwszString1In
00099     , LPCWSTR   pcwszString2In
00100     , size_t    cchIn
00101     );
00102
00103 int
00104 NIStringCompareW(
00105       LPCWSTR   pcwszString1In
00106     , size_t    cch1In
00107     , LPCWSTR   pcwszString2In
00108     , size_t    cch2In
00109     );
00110
00111 int
00112 NStringCompareW(
00113       LPCWSTR   pcwszString1In
00114     , size_t    cch1In
00115     , LPCWSTR   pcwszString2In
00116     , size_t    cch2In
00117     );
00118
00119
00120 //////////////////////////////////////////////////////////////////////////////
00121 // Load string routines
00122 //////////////////////////////////////////////////////////////////////////////
00123
00124 HRESULT
00125 HrLoadStringIntoBSTR(
00126       HINSTANCE hInstanceIn
00127     , LANGID    langidIn
00128     , UINT      idsIn
00129     , BSTR *    pbstrInout
00130     );
00131
00132 inline
00133 HRESULT
00134 HrLoadStringIntoBSTR(
00135       UINT      idsIn
00136     , BSTR *    pbstrInout
00137     )
00138 {
00139     return HrLoadStringIntoBSTR(
00140                           NULL
00141                         , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00142                         , idsIn
00143                         , pbstrInout
00144                         );
00145 } //*** HrLoadStringIntoBSTR
00146
00147 inline
00148 HRESULT
00149 HrLoadStringIntoBSTR(
00150       HINSTANCE hInstanceIn
00151     , UINT      idsIn
00152     , BSTR *    pbstrInout
00153     )
00154
00155 {
00156     return HrLoadStringIntoBSTR(
00157                           hInstanceIn
00158                         , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00159                         , idsIn
00160                         , pbstrInout
00161                         );
00162
00163 } //*** HrLoadStringIntoBSTR
00164
00165 //////////////////////////////////////////////////////////////////////////////
00166 // Format string ID routines
00167 //////////////////////////////////////////////////////////////////////////////
00168
00169 HRESULT
00170 HrFormatStringIntoBSTR(
00171       HINSTANCE hInstanceIn
00172     , LANGID    langidIn
00173     , UINT      idsIn
00174     , BSTR *    pbstrInout
00175     , ...
00176     );
00177
00178 HRESULT
00179 HrFormatStringWithVAListIntoBSTR(
00180       HINSTANCE hInstanceIn
00181     , LANGID    langidIn
00182     , UINT      idsIn
00183     , BSTR *    pbstrInout
00184     , va_list   valistIn
00185     );
00186
00187 inline
00188 HRESULT
00189 HrFormatStringIntoBSTR(
00190       HINSTANCE hInstanceIn
00191     , UINT      idsIn
00192     , BSTR *    pbstrInout
00193     , ...
00194     )
00195 {
00196     HRESULT hr;
00197     va_list valist;
00198
00199     va_start( valist, pbstrInout );
00200
00201     hr = HrFormatStringWithVAListIntoBSTR(
00202                   hInstanceIn
00203                 , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00204                 , idsIn
00205                 , pbstrInout
00206                 , valist
00207                 );
00208
00209     va_end( valist );
00210
00211     return hr;
00212
00213 } //*** HrFormatStringIntoBSTR
00214
00215 inline
00216 HRESULT
00217 HrFormatStringIntoBSTR(
00218       UINT      idsIn
00219     , BSTR *    pbstrInout
00220     , ...
00221     )
00222 {
00223     HRESULT hr;
00224     va_list valist;
00225
00226     va_start( valist, pbstrInout );
00227
00228     hr = HrFormatStringWithVAListIntoBSTR(
00229                   NULL
00230                 , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00231                 , idsIn
00232                 , pbstrInout
00233                 , valist
00234                 );
00235
00236     va_end( valist );
00237
00238     return hr;
00239
00240 } //*** HrFormatStringIntoBSTR
00241
00242 inline
00243 HRESULT
00244 HrFormatStringWithVAListIntoBSTR(
00245       HINSTANCE hInstanceIn
00246     , UINT      idsIn
00247     , BSTR *    pbstrInout
00248     , va_list   valistIn
00249     )
00250 {
00251     return HrFormatStringWithVAListIntoBSTR(
00252                   hInstanceIn
00253                 , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00254                 , idsIn
00255                 , pbstrInout
00256                 , valistIn
00257                 );
00258
00259 } //*** HrFormatStringWithVAListIntoBSTR
00260
00261 //////////////////////////////////////////////////////////////////////////////
00262 // Format string routines
00263 //////////////////////////////////////////////////////////////////////////////
00264
00265 HRESULT
00266 HrFormatStringIntoBSTR(
00267       LPCWSTR   pcwszFmtIn
00268     , BSTR *    pbstrInout
00269     , ...
00270     );
00271
00272 HRESULT
00273 HrFormatStringWithVAListIntoBSTR(
00274       LPCWSTR   pcwszFmtIn
00275     , BSTR *    pbstrInout
00276     , va_list   valistIn
00277     );
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/Encrypt/Decrypt.c Source File

  • Security
  • CryptoApi
  • Encrypt

Decrypt.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 \******************************************************************************/
00010
00011 #include <windows.h>
00012 #include <stdio.h>
00013 #include <stdlib.h>
00014 #include <wincrypt.h>
00015
00016
00017 #ifdef USE_BLOCK_CIPHER
00018     // defines for RC2 block cipher
00019     #define ENCRYPT_ALGORITHM   CALG_RC2
00020     #define ENCRYPT_BLOCK_SIZE  8
00021 #else
00022     // defines for RC4 stream cipher
00023     #define ENCRYPT_ALGORITHM   CALG_RC4
00024     #define ENCRYPT_BLOCK_SIZE  1
00025 #endif
00026
00027 #define KEYLENGTH 0x00800000
00028
00029 static BOOL CAPIDecryptFile(PCHAR szSource, PCHAR szDestination, PCHAR szPassword);
00030
00031 /*****************************************************************************/
00032 void _cdecl main(int argc, char *argv[])
00033 {
00034     PCHAR szSource      = NULL;
00035     PCHAR szDestination = NULL;
00036     PCHAR szPassword    = NULL;
00037
00038     // Validate argument count.
00039     if(argc != 3 && argc != 4) {
00040         printf("USAGE: decrypt <source file> <dest file> [ <password> ]\n");
00041         exit(1);
00042     }
00043
00044     // Parse arguments.
00045     szSource       = argv[1];
00046     szDestination  = argv[2];
00047     if(argc == 4) {
00048         szPassword = argv[3];
00049     }
00050
00051     if(!CAPIDecryptFile(szSource, szDestination, szPassword)) {
00052         printf("Error encrypting file!\n");
00053         exit(1);
00054     }
00055
00056     exit(0);
00057 }
00058
00059 /*****************************************************************************/
00060 static BOOL CAPIDecryptFile(PCHAR szSource, PCHAR szDestination, PCHAR szPassword)
00061 {
00062     FILE *hSource      = NULL;
00063     FILE *hDestination = NULL;
00064     INT eof = 0;
00065
00066     HCRYPTPROV hProv   = 0;
00067     HCRYPTKEY hKey     = 0;
00068     HCRYPTHASH hHash   = 0;
00069
00070     PBYTE pbKeyBlob = NULL;
00071     DWORD dwKeyBlobLen;
00072
00073     PBYTE pbBuffer = NULL;
00074     DWORD dwBlockLen;
00075     DWORD dwBufferLen;
00076     DWORD dwCount;
00077
00078     BOOL status = FALSE;
00079
00080     // Open source file.
00081     if((hSource = fopen(szSource,"rb")) == NULL) {
00082         printf("Error opening Ciphertext file!\n");
00083         goto done;
00084     }
00085
00086     // Open destination file.
00087     if((hDestination = fopen(szDestination,"wb")) == NULL) {
00088         printf("Error opening Plaintext file!\n");
00089         goto done;
00090     }
00091
00092     // Get handle to the default provider.
00093     if(!CryptAcquireContext(&hProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0)) {
00094         printf("Error %x during CryptAcquireContext!\n", GetLastError());
00095         goto done;
00096     }
00097
00098     if(szPassword == NULL) {
00099         // Decrypt the file with the saved session key.
00100
00101         // Read key blob length from source file and allocate memory.
00102         fread(&dwKeyBlobLen, sizeof(DWORD), 1, hSource);
00103         if(ferror(hSource) || feof(hSource)) {
00104             printf("Error reading file header!\n");
00105             goto done;
00106         }
00107         if((pbKeyBlob = malloc(dwKeyBlobLen)) == NULL) {
00108             printf("Out of memory or improperly formatted source file!\n");
00109             goto done;
00110         }
00111
00112         // Read key blob from source file.
00113         fread(pbKeyBlob, 1, dwKeyBlobLen, hSource);
00114         if(ferror(hSource) || feof(hSource)) {
00115             printf("Error reading file header!\n");
00116             goto done;
00117         }
00118
00119         // Import key blob into CSP.
00120         if(!CryptImportKey(hProv, pbKeyBlob, dwKeyBlobLen, 0, 0, &hKey)) {
00121             printf("Error %x during CryptImportKey!\n", GetLastError());
00122             goto done;
00123         }
00124     } else {
00125         // Decrypt the file with a session key derived from a password.
00126
00127         // Create a hash object.
00128         if(!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash)) {
00129             printf("Error %x during CryptCreateHash!\n", GetLastError());
00130             goto done;
00131         }
00132
00133         // Hash in the password data.
00134         if(!CryptHashData(hHash, szPassword, (DWORD)strlen(szPassword), 0)) {
00135             printf("Error %x during CryptHashData!\n", GetLastError());
00136             goto done;
00137         }
00138
00139         // Derive a session key from the hash object.
00140         if(!CryptDeriveKey(hProv, ENCRYPT_ALGORITHM, hHash, KEYLENGTH, &hKey)) {
00141             printf("Error %x during CryptDeriveKey!\n", GetLastError());
00142             goto done;
00143         }
00144
00145         // Destroy the hash object.
00146         CryptDestroyHash(hHash);
00147         hHash = 0;
00148     }
00149
00150     // Determine number of bytes to decrypt at a time. This must be a multiple
00151     // of ENCRYPT_BLOCK_SIZE.
00152     dwBlockLen = 1000 - 1000 % ENCRYPT_BLOCK_SIZE;
00153     dwBufferLen = dwBlockLen;
00154
00155     // Allocate memory.
00156     if((pbBuffer = malloc(dwBufferLen)) == NULL) {
00157         printf("Out of memory!\n");
00158         goto done;
00159     }
00160
00161     // Decrypt source file and write to destination file.
00162     do {
00163         // Read up to 'dwBlockLen' bytes from source file.
00164         dwCount = (DWORD)fread(pbBuffer, 1, dwBlockLen, hSource);
00165         if(ferror(hSource)) {
00166             printf("Error reading Ciphertext!\n");
00167             goto done;
00168         }
00169         eof = feof(hSource);
00170
00171         // Decrypt data
00172         if(!CryptDecrypt(hKey, 0, eof, 0, pbBuffer, &dwCount)) {
00173             printf("Error %x during CryptDecrypt!\n", GetLastError());
00174             goto done;
00175         }
00176
00177         // Write data to destination file.
00178         fwrite(pbBuffer, 1, dwCount, hDestination);
00179         if(ferror(hDestination)) {
00180             printf("Error writing Plaintext!\n");
00181             goto done;
00182         }
00183     } while(!feof(hSource));
00184
00185     status = TRUE;
00186
00187     printf("OK\n");
00188
00189     done:
00190
00191     // Close files.
00192     if(hSource) fclose(hSource);
00193     if(hDestination) fclose(hDestination);
00194
00195     // Free memory.
00196     if(pbKeyBlob) free(pbKeyBlob);
00197     if(pbBuffer) free(pbBuffer);
00198
00199     // Destroy session key.
00200     if(hKey) CryptDestroyKey(hKey);
00201
00202     // Destroy hash object.
00203     if(hHash) CryptDestroyHash(hHash);
00204
00205     // Release provider handle.
00206     if(hProv) CryptReleaseContext(hProv, 0);
00207
00208     return(status);
00209 }
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/security.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

security.h

Go to the documentation of this file.
00001 #if !defined(AFX_SECURITY_H__99695D7A_1D58_11D2_B21E_0000F87A6B50__INCLUDED_)
00002 #define AFX_SECURITY_H__99695D7A_1D58_11D2_B21E_0000F87A6B50__INCLUDED_
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007 // security.h : header file
00008 //
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CDlgIADsSecurityDescriptor dialog
00012
00013
00014 class CDlgIADsSecurityDescriptor : public CDialog
00015 {
00016 // Construction
00017 public:
00018   CDlgIADsSecurityDescriptor(LPUNKNOWN, CWnd* pParent = NULL);   // standard constructor
00019   ~CDlgIADsSecurityDescriptor();
00020
00021 // Dialog Data
00022   //{{AFX_DATA(CDlgIADsSecurityDescriptor)
00023   enum { IDD = IDD_SECURITY };
00024   CListBox  m_cACEList;
00025   //}}AFX_DATA
00026
00027
00028 // Overrides
00029   // ClassWizard generated virtual function overrides
00030   //{{AFX_VIRTUAL(CDlgIADsSecurityDescriptor)
00031   protected:
00032   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00033   //}}AFX_VIRTUAL
00034
00035 // Implementation
00036 protected:
00037   void PopulateACL( IADsAccessControlList *pACL );
00038   void ResetAcePtr();
00039   void DisplayACE( IADsAccessControlEntry *pACE );
00040   void ResetAceMaskControls();
00041   void DisplayAceObjectType( UINT nID, CString &sObjectType );
00042
00043   IADsSecurityDescriptor  *m_pSecurityDesc;
00044   CPtrList         m_acePtrList;
00045   CADsSearch         m_search;
00046
00047   // Generated message map functions
00048   //{{AFX_MSG(CDlgIADsSecurityDescriptor)
00049   virtual BOOL OnInitDialog();
00050   afx_msg void OnSelChangeAceList();
00051   //}}AFX_MSG
00052   DECLARE_MESSAGE_MAP()
00053 };
00054
00055 //{{AFX_INSERT_LOCATION}}
00056 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00057
00058 #endif // !defined(AFX_SECURITY_H__99695D7A_1D58_11D2_B21E_0000F87A6B50__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/OPBank/stdafx.Cpp Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • OPBank

stdafx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/StdAfx.cpp Source File

  • Web
  • Browser
  • EditFeatures

StdAfx.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // stdafx.cpp : source file that includes just the standard includes
00006 //  stdafx.pch will be the pre-compiled header
00007 //  stdafx.obj will contain the pre-compiled type information
00008
00009 #include "stdafx.h"
00010
00011 #ifdef _ATL_STATIC_REGISTRY
00012 #include <statreg.h>
00013 #include <statreg.cpp>
00014 #endif
00015
00016 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022 #include "Space.h"
00023
00024 //
00025 // This is the minimum set of clipboard formats we must implement.
00026 // MMC uses these to get necessary information from our snapin about
00027 // our nodes.
00028 //
00029
00030 // we need to do this to get around MMC.IDL - it explicitly defines
00031 // the clipboard formats as WCHAR types...
00032 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00033 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00034 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00035 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00036 #define _T_CCF_OBJECT_TYPES_IN_MULTI_SELECT  _T("CCF_OBJECT_TYPES_IN_MULTI_SELECT")
00037
00038 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00039
00040     // These are the clipboard formats that we must supply at a minimum.
00041     // mmc.h actually defined these. We can make up our own to use for
00042     // other reasons. We don't need any others at this time.
00043 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00044 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00045 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00046 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00047 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00048
00049 //We must also supply a data object for CCF_OBJECT_TYPES_IN_MULTI_SELECT
00050 UINT CDataObject::s_cfMultiSelect = RegisterClipboardFormat(_T_CCF_OBJECT_TYPES_IN_MULTI_SELECT);
00051
00052
00053 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00054 : m_lCookie(cookie), m_context(context), m_cref(0)
00055 {
00056   //Do the following if the data object is a multiselection data object
00057
00058   if ( MMC_MULTI_SELECT_COOKIE == m_lCookie ) {
00059
00060     pCookies = new MMC_COOKIE[MAX_COOKIES];
00061
00062     for (int n = 0; n < MAX_COOKIES; n++) {
00063         pCookies[n] = NULL;
00064     }
00065   }
00066 }
00067
00068 CDataObject::~CDataObject()
00069 {
00070   //Do the following if the data object is a multiselection data object
00071
00072   if ( MMC_MULTI_SELECT_COOKIE == m_lCookie )
00073     delete [] pCookies;
00074 }
00075
00076 ///////////////////////
00077 // IUnknown implementation
00078 ///////////////////////
00079
00080 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00081 {
00082     if (!ppv)
00083         return E_FAIL;
00084
00085     *ppv = NULL;
00086
00087     if (IsEqualIID(riid, IID_IUnknown))
00088         *ppv = static_cast<IDataObject *>(this);
00089     else if (IsEqualIID(riid, IID_IDataObject))
00090         *ppv = static_cast<IDataObject *>(this);
00091
00092     if (*ppv)
00093     {
00094         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00095         return S_OK;
00096     }
00097
00098     return E_NOINTERFACE;
00099 }
00100
00101 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00102 {
00103     return InterlockedIncrement((LONG *)&m_cref);
00104 }
00105
00106 STDMETHODIMP_(ULONG) CDataObject::Release()
00107 {
00108     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00109     {
00110         delete this;
00111         return 0;
00112     }
00113     return m_cref;
00114
00115 }
00116
00117 /////////////////////////////////////////////////////////////////////////////
00118 // IDataObject implementation
00119 //
00120 HRESULT CDataObject::GetDataHere(
00121                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00122                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00123                                  )
00124 {
00125     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00126     IStream *pStream = NULL;
00127
00128     CDelegationBase *base = GetBaseNodeObject();
00129
00130     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00131     if ( FAILED(hr) )
00132         return hr;                       // Minimal error checking
00133
00134     hr = DV_E_FORMATETC;                 // Unknown format
00135
00136     if (cf == s_cfDisplayName) {
00137         const _TCHAR *pszName = base->GetDisplayName();
00138
00139                 MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00140
00141                 // get length of original string and convert it accordingly
00142         ULONG ulSizeofName = lstrlen(pszName);
00143         ulSizeofName++;                      // Count null character
00144         ulSizeofName *= sizeof(WCHAR);
00145
00146         hr = pStream->Write(wszName, ulSizeofName, NULL);
00147     } else if (cf == s_cfNodeType) {
00148         const GUID *pGUID = (const GUID *)&base->getNodeType();
00149
00150         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00151     } else if (cf == s_cfSZNodeType) {
00152         LPOLESTR szGuid;
00153         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00154
00155         if (SUCCEEDED(hr)) {
00156             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00157             CoTaskMemFree(szGuid);
00158         }
00159     } else if (cf == s_cfSnapinClsid) {
00160         const GUID *pGUID = NULL;
00161         pGUID = &CLSID_CComponentData;
00162
00163         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00164     } else if (cf == s_cfInternal) {
00165         // we are being asked to get our this pointer from the IDataObject interface
00166         // only our own snap-in objects will know how to do this.
00167         CDataObject *pThis = this;
00168         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00169     }
00170
00171     pStream->Release();
00172
00173     return hr;
00174 }
00175
00176 HRESULT CDataObject::GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00177
00178 {
00179
00180   HRESULT hr = S_FALSE;
00181
00182     const   CLIPFORMAT cf = lpFormatetcIn->cfFormat;
00183
00184     CDelegationBase *base = GetBaseNodeObject();
00185
00186     if (cf == s_cfMultiSelect) {
00187     // MMC requires support for this format to load any extensions
00188   // that extend the selected result items
00189
00190     BYTE byData[256] = {0};
00191     SMMCObjectTypes* pData = reinterpret_cast<SMMCObjectTypes*>(byData);
00192
00193     //We need the node type GUID of the selected items.
00194     //from CRocket::thisGuid
00195     GUID guid = { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00196
00197     //Enter data required for the SMMCObjectTypes structure
00198         //count specifies the number of unique node types in the multiselection
00199         //Here, all CRocket items are of the same node type, so count == 1.
00200     pData->count = 1;
00201     pData->guid[0] = guid;
00202
00203     // Calculate the size of SMMCObjectTypes.
00204     int cb = sizeof(GUID)*(pData->count) + sizeof (SMMCObjectTypes);
00205
00206     //Fill out parameters
00207
00208     lpMedium->tymed = TYMED_HGLOBAL;
00209     lpMedium->hGlobal = ::GlobalAlloc(GMEM_SHARE|GMEM_MOVEABLE, cb);
00210     if (lpMedium->hGlobal == NULL)
00211       return STG_E_MEDIUMFULL;
00212
00213     BYTE* pb = reinterpret_cast<BYTE*>(::GlobalLock(lpMedium->hGlobal));
00214     CopyMemory(pb, pData, cb);
00215     ::GlobalUnlock(lpMedium->hGlobal);
00216
00217     hr = S_OK;
00218
00219   }
00220
00221   return hr;
00222 }
00223
00224 /////////////////////////////////////////////////////////////////////////////
00225 // Global helper functions to help work with dataobjects and
00226 // clipboard formats
00227
00228
00229 //---------------------------------------------------------------------------
00230 //  Returns the current object based on the s_cfInternal clipboard format
00231 //
00232 CDataObject* GetOurDataObject (
00233                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00234                                )
00235 {
00236     HRESULT       hr      = S_OK;
00237     CDataObject *pSDO     = NULL;
00238
00239   // check to see if the data object is a special data object.
00240   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00241   {
00242     //Code for handling a special data object goes here.
00243
00244     //Note that the MMC SDK samples do not handle
00245     //special data objects, so we exit if we get one.
00246     return NULL;
00247   }
00248
00249     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00250     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00251
00252     // Allocate memory for the stream
00253     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00254
00255     if (!stgmedium.hGlobal)     {
00256         hr = E_OUTOFMEMORY;
00257     }
00258
00259     if SUCCEEDED(hr)
00260         // Attempt to get data from the object
00261         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00262
00263     // stgmedium now has the data we need
00264     if (SUCCEEDED(hr))  {
00265         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00266     }
00267
00268     // if we have memory free it
00269     if (stgmedium.hGlobal)
00270         GlobalFree(stgmedium.hGlobal);
00271
00272     return pSDO;
00273
00274 } // end GetOurDataObject()
00275
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/MyDevice.idl Source File

  • NetDS
  • upnp
  • StepByStep
  • Step2

MyDevice.idl

Go to the documentation of this file.
00001 // MyDevice.idl : IDL source for MyDevice.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (MyDevice.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009   [
00010     object,
00011     uuid(B620B328-B1ED-4205-8593-08C762C96562),
00012     dual,
00013     helpstring("IDimmer Interface"),
00014     pointer_default(unique)
00015   ]
00016   interface IDimmer : IDispatch
00017   {
00018   };
00019   [
00020     object,
00021     uuid(AEF464AB-75A6-4205-B143-72A43675863F),
00022     dual,
00023     helpstring("IDimmerService Interface"),
00024     pointer_default(unique)
00025   ]
00026   interface IDimmerService : IDispatch
00027   {
00028   };
00029
00030 [
00031   uuid(51AC2F4C-3F4F-48B3-A018-910E81677EEF),
00032   version(1.0),
00033   helpstring("MyDevice 1.0 Type Library")
00034 ]
00035 library MYDEVICELib
00036 {
00037   importlib("stdole32.tlb");
00038   importlib("stdole2.tlb");
00039
00040 typedef [v1_enum] enum DIMMINGSERVICE_SCPD_DISPIDS
00041 {
00042    DISPID_POWER = 1,
00043    DISPID_DIMLEVEL,
00044    DISPID_POWERON,
00045    DISPID_POWEROFF,
00046    DISPID_GETPOWERVALUE,
00047    DISPID_SETDIMLEVEL,
00048    DISPID_GETDIMLEVEL,
00049    DISPID_GETCONFIGDETAILS
00050
00051 } DIMMINGSERVICE_SCPD_DISPIDS;
00052
00053 [
00054    uuid(a315fcbd-7f4b-4081-a172-2f534c438957),
00055    oleautomation,
00056    pointer_default(unique)
00057 ]
00058 interface IUPnPService_DimmingService_SCPD : IDispatch {
00059   [propget, id(DISPID_POWER), helpstring("Property Power")]
00060   HRESULT Power(
00061     [out, retval] VARIANT_BOOL *pPower);
00062
00063   [propget, id(DISPID_DIMLEVEL), helpstring("Property dimLevel")]
00064   HRESULT dimLevel(
00065     [out, retval] long *pdimLevel);
00066
00067
00068   [ id(DISPID_POWERON), helpstring("Method PowerOn")]
00069   HRESULT PowerOn();
00070
00071   [ id(DISPID_POWEROFF), helpstring("Method PowerOff")]
00072   HRESULT PowerOff();
00073
00074   [ id(DISPID_GETPOWERVALUE), helpstring("Method GetPowerValue")]
00075   HRESULT GetPowerValue(
00076     [in, out] VARIANT_BOOL *ppowerVall);
00077
00078   [ id(DISPID_SETDIMLEVEL), helpstring("Method SetDimLevel")]
00079   HRESULT SetDimLevel(
00080     [in] long dLevel);
00081
00082   [ id(DISPID_GETDIMLEVEL), helpstring("Method GetDimLevel")]
00083   HRESULT GetDimLevel(
00084     [in, out] long *pdLevel);
00085
00086   [ id(DISPID_GETCONFIGDETAILS), helpstring("Method GetConfigDetails")]
00087   HRESULT GetConfigDetails(
00088     [in, out] VARIANT_BOOL *ppowerVal,
00089     [in, out] long *pdLevel);
00090 };
00091
00092   [
00093     uuid(433B7962-88CD-48F3-B726-2187A48C7128),
00094     helpstring("Dimmer Class")
00095   ]
00096   coclass Dimmer
00097   {
00098     [default] interface IDimmer;
00099   };
00100   [
00101     uuid(67B046DD-6000-4122-9092-0706F1C7C4D8),
00102     helpstring("DimmerService Class")
00103   ]
00104   coclass DimmerService
00105   {
00106     [default] interface IDimmerService;
00107   };
00108 };
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/dialogs.c Source File

  • Multimedia
  • Gdi
  • PrintJob

dialogs.c

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 *  PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   Dialogs.c
00010 *
00011 *   PURPOSE:    Implements Dialog functions and exported callbacks
00012 *
00013 *   FUNCTIONS:
00014 *       GetPrinterPath () - Asks user to type in the name of a printer.
00015 *       GetPrinterDlgProc () - Dialog Procedure for the GetPrinterPath Dialog.
00016 *       About () - Dialog Procedure for the About Dialog.
00017 *
00018 ******************************************************************************/
00019
00020
00021 #define STRICT
00022 #include <windows.h>    /* required for all Windows applications */
00023 #include "resource.h"   /* Windows resource IDs */
00024 #include "PrintJob.h"   /* For the application's window management functions */
00025 #include "Dialogs.h"    /* Prototypes specific to this module */
00026
00027
00028 /*
00029  * Application globals
00030  */
00031 extern HINSTANCE g_hInst;          /* current instance of application*/
00032
00033
00034 /*
00035  * Convenience structure to pass a pre-allocated string buffer to/from a dialog
00036  * This gives the dialog procedure the size of the allocated buffer so it can
00037  * ensure it does not write off the end of the buffer.
00038  */
00039 typedef struct _stringstruct
00040 {
00041     char *pszStr;       /* pointer to the buffer */
00042     short cSize;        /* size of the buffer */
00043 } STRSIZE;
00044
00045
00046 /******************************************************************************
00047
00048   FUNCTION: GetPrinterDlgProc(HWND, UINT, WPARAM, LPARAM)
00049
00050   PURPOSE:
00051     Message processing for the "Select Printer" dialog box.
00052
00053   MESSSAGES:
00054     WM_INITDIALOG - initialize dialog box storing a pointer to a STRSIZE
00055                     structure passed via LPARAM.
00056     WM_COMMAND    - processes the following commands:
00057         IDOK
00058         IDCANCEL
00059
00060   RETURNS:
00061     TRUE if message processed.
00062     FALSE if message not processed.
00063
00064
00065 ******************************************************************************/
00066 LRESULT CALLBACK GetPrinterDlgProc(
00067                 HWND hDlg,           /* window handle of the dialog box */
00068                 UINT message,        /* type of message */
00069                 WPARAM uParam,       /* message-specific information */
00070                 LPARAM lParam)       /* "       "          " */
00071 {
00072 static  STRSIZE *pDlgParam;  /* keep the dialog's parameters around */
00073
00074     switch (message)
00075     {
00076         case WM_INITDIALOG:  /* message: initialize dialog box*/
00077             CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
00078
00079             pDlgParam = (STRSIZE *)lParam;
00080             SetDlgItemText(hDlg, IDC_EDITSELECTPRINTER, pDlgParam->pszStr);
00081
00082             return (TRUE);
00083
00084         case WM_COMMAND:
00085             switch (LOWORD(uParam))
00086             {
00087                 case IDOK:              /* "OK" button selected? */
00088                     GetDlgItemText(hDlg, IDC_EDITSELECTPRINTER, pDlgParam->pszStr, pDlgParam->cSize);
00089                     EndDialog(hDlg, TRUE);
00090                     return TRUE;
00091
00092                 case IDCANCEL:          /* Exit the dialog */
00093                     EndDialog(hDlg, FALSE);
00094                     return (TRUE);
00095             }
00096             break;
00097     }
00098     return (FALSE); /* Didn't process the message */
00099
00100 } /* end of function GetPrinterDialogProc */
00101
00102
00103 /******************************************************************************
00104
00105   FUNCTION: GetPrinterPath
00106
00107   PURPOSE:
00108     GetPrinterPath Displays a dialog box which asks a user for the name of a
00109     printer. Any string typed by the user is valid.
00110
00111   PARAMETERS:
00112     hWnd        - Handle of the window to own this dialog. Typically the main
00113                   application window.
00114
00115     pszPrinter  - pointer to a character buffer in which to store the name of
00116                   the printer.
00117     cStrSize    - the size of the buffer pointed to by pszPrinter.
00118
00119   RETURNS:
00120     TRUE if the user clicks the OK button.
00121     FALSE if the user cancels the Dialog.
00122
00123
00124 ******************************************************************************/
00125 BOOL GetPrinterPath(
00126                 HWND hWnd,          /* window handle to main window */
00127                 char *pszPrinter,   /* string in which to store user's printer */
00128                 short cchStrSize)     /* size of string */
00129 {
00130     STRSIZE dlgParameters = {0};
00131   dlgParameters.pszStr = pszPrinter;
00132   dlgParameters.cSize = cchStrSize;
00133
00134     return  (BOOL)  DialogBoxParam(g_hInst,              /* current instance of app */
00135           MAKEINTRESOURCE(IDD_SELECTPRINTER), /* dialog template */
00136           hWnd,                               /* parent of the dialog */
00137           (DLGPROC)GetPrinterDlgProc,         /* dialog procedure */
00138           (LPARAM)&dlgParameters);            /* the string for the printer's name */
00139
00140 } /* end of function GetPrinterPath */
00141
00142
00143 /****************************************************************************
00144
00145     FUNCTION: About(HWND, UINT, WPARAM, LPARAM)
00146
00147     PURPOSE:  Processes messages for "About" dialog box
00148
00149     MESSAGES:
00150
00151         WM_INITDIALOG - initialize dialog box
00152         WM_COMMAND    - Input received
00153
00154     COMMENTS:
00155
00156         Display version information from the version section of the
00157         application resource.
00158
00159         Wait for user to click on "Ok" button, then close the dialog box.
00160
00161 ****************************************************************************/
00162
00163 LRESULT CALLBACK About(
00164                 HWND hDlg,           // window handle of the dialog box
00165                 UINT message,        // type of message
00166                 WPARAM uParam,       // message-specific information
00167                 LPARAM lParam)
00168 {
00169     static  HFONT hfontDlg;
00170     LPSTR   lpVersion;
00171     DWORD   dwVerInfoSize;
00172     DWORD   dwVerHnd;
00173     UINT    uVersionLen;
00174     int     iRootLen;
00175     BOOL    bRetCode;
00176     int     i;
00177     char    szFullPath[256];
00178     char    szResult[256];
00179     char    szGetName[256];
00180
00181     switch (message) {
00182         case WM_INITDIALOG:  // message: initialize dialog box
00183             // Center the dialog over the application window
00184             CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
00185
00186             // Get version information from the application
00187             GetModuleFileName (g_hInst, szFullPath, sizeof(szFullPath));
00188             dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
00189             if (dwVerInfoSize) {
00190                     // If we were able to get the information, process it:
00191                     LPSTR   lpstrVffInfo;
00192                     HANDLE  hMem;
00193                     hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
00194                     lpstrVffInfo  = GlobalLock(hMem);
00195                     GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
00196                     lstrcpyn(szGetName, "\\StringFileInfo\\040904e4\\", 256);
00197                     iRootLen = lstrlen(szGetName);
00198
00199                     // Walk through the dialog items that we want to replace:
00200                     for (i = IDC_FILEDESCRIPTION; i <= IDC_LEGALTRADEMARKS; i++) {
00201                             GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
00202                             szGetName[iRootLen] = (char)0;
00203                             strncat (szGetName, szResult, 256 - strlen(szGetName));
00204                             uVersionLen   = 0;
00205                             lpVersion     = NULL;
00206                             bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
00207                                     (LPSTR)szGetName,
00208                                     (LPVOID)&lpVersion,
00209                                      &uVersionLen);
00210
00211                             if ( bRetCode && uVersionLen && lpVersion) {
00212                                     // Replace dialog item text with version info
00213                                     lstrcpyn(szResult, lpVersion, 256);
00214                                     SetDlgItemText(hDlg, i, szResult);
00215                             }
00216                     }
00217
00218                     GlobalUnlock(hMem);
00219                     GlobalFree(hMem);
00220             } // if (dwVerInfoSize)
00221             // Create a font to use
00222             hfontDlg = CreateFont(12, 0, 0, 0, 0, 0, 0, 0,
00223                     0, 0, 0, 0,
00224                     VARIABLE_PITCH | FF_SWISS, "");
00225
00226             // Walk through the dialog items and change font
00227             for (i = IDC_FILEDESCRIPTION; i <= IDC_LEGALTRADEMARKS; i++)
00228                 SendMessage (GetDlgItem (hDlg, i), WM_SETFONT, (WPARAM)hfontDlg, TRUE);
00229
00230             return (TRUE);
00231
00232         case WM_COMMAND:                      // message: received a command
00233             if (LOWORD(uParam) == IDOK        // "OK" box selected?
00234             || LOWORD(uParam) == IDCANCEL) {  // System menu close command?
00235                     EndDialog(hDlg, TRUE);        // Exit the dialog
00236                     DeleteObject (hfontDlg);
00237                     return (TRUE);
00238             }
00239             break;
00240     }
00241     return (FALSE); // Didn't process the message
00242
00243     lParam; // This will prevent 'unused formal parameter' warnings
00244
00245 } /* end of function About */
00246
00247
00248 /* end of source file Dialogs.c */
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/Hello2/Hello2J.java Source File

  • Web
  • MSAgent
  • Java
  • Hello2

Hello2J.java

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright (C) 1997-1998 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011 //
00012 // This sample demonstrates the use of Microsoft Agent from a Java Applet
00013 // and the use of a notification sink to receive callbacks from the Agent
00014 // server. It also demonstrates adding a command.
00015 //
00016 //==========================================================================
00017
00018 // Standard java imports
00019
00020 import java.applet.*;
00021 import java.awt.*;
00022
00023 // COM and Microsoft Agent imports
00024
00025 import com.ms.com.Variant;
00026 import agentsvr.AgentServer;
00027 import agentsvr.IAgentEx;
00028 import agentsvr.IAgentCharacter;
00029 import agentsvr.IAgentCharacterEx;
00030 import agentsvr.IAgentCommands;
00031
00032 // The HelloAgentJava class (Single threaded)
00033
00034 public class Hello2J extends Applet
00035 {
00036   // Private members necessary for Agent instantiation
00037
00038   private IAgentEx      m_AgentEx = null;
00039   private IAgentCharacterEx m_Character[] = {null};
00040   private int         m_CharacterID[] = {-1};
00041   private IAgentCommands    m_Commands = null;
00042   private int         m_CommandID[] = {-1};
00043   private int         m_RequestID[] = {0};
00044   private final String    m_CharacterPathOld = "\\program files\\microsoft agent\\characters\\merlin.acs";
00045
00046   private boolean       m_bUsingDefaultCharacter;
00047
00048   // Declare an Agent Notify Sink so that we can get
00049   // notification callbacks from the Agent server.
00050
00051   private Notify        m_Sink = null;
00052   private int         m_SinkID[] = {-1};
00053
00054   private final int     FALSE = 0;
00055   private final int     TRUE = 1;
00056
00057
00058   public Hello2J()
00059   {
00060     // Constructor left intentionally blank
00061   }
00062
00063   public String getAppletInfo()
00064   {
00065     return "Name: HelloJ\r\n" +
00066            "Author: anonymous\r\n" +
00067            "Created with Microsoft Visual J++ Version 1.1";
00068   }
00069
00070   public void init()
00071   {
00072       resize(0, 0);
00073   }
00074
00075   public void destroy()
00076   {
00077   }
00078
00079   public void paint(Graphics g)
00080   {
00081   }
00082
00083   public void start()
00084   {
00085     // Start the Microsoft Agent Server
00086
00087     m_AgentEx = (IAgentEx) new AgentServer();
00088
00089     // Create a notify sink object
00090
00091     m_Sink = new Notify();
00092
00093     try
00094     {
00095       // And register it with Microsoft Agent so that we
00096       // can receive notifications.
00097
00098       m_AgentEx.Register(m_Sink, m_SinkID);
00099
00100     }
00101     catch(com.ms.com.ComException eSink)
00102     {
00103       stop();
00104       return;
00105     }
00106
00107     // Load a character
00108
00109     try
00110     {
00111       // First try to load a default character
00112
00113       m_AgentEx.Load(new Variant(), m_CharacterID, m_RequestID);
00114
00115       m_bUsingDefaultCharacter = true;
00116
00117     }
00118     catch(com.ms.com.ComException e)
00119     {
00120       // No default character. Try to load Merlin from the directory
00121       // most commonly used in version 1.5 applications.
00122
00123       Variant characterPath = new Variant();
00124       characterPath.putString(m_CharacterPathOld);
00125
00126       try {
00127
00128         m_AgentEx.Load(characterPath, m_CharacterID, m_RequestID);
00129
00130         m_bUsingDefaultCharacter = false;
00131
00132       }
00133       catch(com.ms.com.ComException e2)
00134       {
00135         // Hmmm.  We couldn't load the character so what else
00136         // can we do?
00137
00138         stop();
00139         return;
00140       }
00141     }
00142
00143     try {
00144
00145       // Get the IAgentCharacter interface.
00146       // NOTE NOTE NOTE!!! If you are using Visual J++ or
00147       // other Java environments that can correctly handle
00148       // derived COM types (e.g. IAgentCharacterEx) then you
00149       // can retrieve the character interface with a single
00150       // call to GetCharacterEx.
00151       //
00152       //    m_AgentEx.GetCharacterEx(m_CharacterID[0], m_Character);
00153       //
00154       // Some environments (e.g. Visual J++ 1.1) do not correctly
00155       // handle derived COM types. So retrieving the IAgentCharacterEx
00156       // interface is a 2 step process. First get the IAgentCharacter
00157       // interface.
00158
00159       IAgentCharacter char15[] = {null};
00160       m_AgentEx.GetCharacter(m_CharacterID[0], char15);
00161
00162       // Then get the IAgentCharacterEx interface and release
00163       // the IAgentCharacter interface.
00164
00165       m_Character[0] = (IAgentCharacterEx)char15[0];
00166       char15 = null;
00167
00168       // Set the character's language
00169
00170       m_Character[0].SetLanguageID(0x0409);
00171
00172       // If we successfully loaded the default character,
00173       // add a command so that the user can switch characters.
00174
00175       if (m_bUsingDefaultCharacter)
00176       {
00177         m_Commands = (IAgentCommands)m_Character[0];
00178         m_Commands.Add("&Choose Character...", "", TRUE, TRUE, m_CommandID);
00179         m_Commands = null;
00180       }
00181
00182       // Give our notify sink access to the necessary data
00183
00184       m_Sink.Initialize(m_AgentEx, m_Character[0], m_CommandID[0]);
00185
00186       // Show the character
00187
00188       m_Character[0].Show(FALSE, m_RequestID);
00189
00190       // And speak hello
00191
00192       m_Character[0].Speak("Hello World!", null, m_RequestID);
00193
00194     }
00195     catch(com.ms.com.ComException e)
00196     {
00197       stop();
00198     }
00199   }
00200
00201   public void stop()
00202   {
00203     if (m_CharacterID[0] > 0)
00204     {
00205       m_Character[0] = null;
00206       m_AgentEx.Unload(m_CharacterID[0]);
00207       m_CharacterID[0] = -1;
00208     }
00209
00210     // Unregister the notify sink, we're done with the
00211     // Agent server.
00212
00213     if (m_SinkID[0] > 0)
00214     {
00215       m_AgentEx.Unregister(m_SinkID[0]);
00216       m_SinkID[0] = -1;
00217     }
00218
00219     m_Sink = null;
00220     m_AgentEx = null;
00221   }
00222 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/dynamic.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

dynamic.Cpp

Go to the documentation of this file.
00001 // Dynamic.cpp : Implementation of CDynamic
00002 #include "stdafx.h"
00003 #include "Data.h"
00004 #include "Dynamic.h"
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // CDynamic
00008
00009 void CDynamic::Clear()
00010 {
00011   m_nReserve = 50;
00012   m_nGrow = 50;
00013   m_bRequiresSave = false;
00014
00015   m_VarVect.clear();
00016   m_IndexMap.clear();
00017   m_MapIndex.clear();
00018
00019   m_VarVect.reserve(m_nReserve);
00020 }
00021
00022 STDMETHODIMP CDynamic::InterfaceSupportsErrorInfo(REFIID riid)
00023 {
00024   static const IID* arr[] =
00025   {
00026     &IID_IEntity
00027   };
00028   for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
00029   {
00030     if (::InlineIsEqualGUID(*arr[i],riid))
00031       return S_OK;
00032   }
00033   return S_FALSE;
00034 }
00035
00036 STDMETHODIMP CDynamic::Count(long * pVal)
00037 {
00038   // STL is not thread-safe
00039   // so use a Critical Section to project
00040   // it's delecate structures
00041   Lock();
00042
00043   if (pVal == NULL)
00044     return E_POINTER;
00045   *pVal = m_VarVect.size();
00046
00047   // Anyone else can play, now!
00048   Unlock();
00049   return S_OK;
00050 }
00051
00052 STDMETHODIMP CDynamic::Item(VARIANT* pIndex, VARIANT * pVal)
00053 {
00054   if (pVal == NULL)
00055     return E_POINTER;
00056
00057   long nIndex = 0;
00058
00059   pVal->vt = VT_EMPTY;
00060   pVal->punkVal = NULL;
00061
00062   // How are we being addressed - by key or by index?
00063   if (pIndex->vt == VT_BSTR)
00064   {
00065     _bstr_t bstrKey(pIndex->bstrVal);
00066     nIndex = m_IndexMap[bstrKey];
00067   }
00068   else // by index
00069   {
00070     _variant_t varIndex(pIndex);
00071     nIndex = (long)varIndex;
00072   }
00073
00074   // use 1-based index, VB like
00075   if (((long)nIndex < 1) || ((long)nIndex > (m_VarVect.size())))
00076     return E_INVALIDARG;
00077   VariantCopy(pVal, &m_VarVect[(long)nIndex-1]);
00078   return S_OK;
00079 }
00080
00081 STDMETHODIMP CDynamic::_NewEnum(IUnknown** pVal)
00082 {
00083   // STL Vectors are held in contiguous memory - so
00084   // we can use CComEnum to get the items out - cool!
00085   if (pVal == NULL)
00086     return E_POINTER;
00087   *pVal = NULL;
00088   typedef CComObject<CComEnum<IEnumVARIANT, &IID_IEnumVARIANT, VARIANT, _Copy<VARIANT> > > enumvar;
00089   enumvar* pEnumVar = new enumvar;
00090   _ASSERTE(pEnumVar);
00091   HRESULT hRes = pEnumVar->Init(m_VarVect.begin(), m_VarVect.end(), NULL, AtlFlagCopy);
00092   if (SUCCEEDED(hRes))
00093     hRes = pEnumVar->QueryInterface(IID_IEnumVARIANT, (void**)pVal);
00094   if (FAILED(hRes))
00095     delete pEnumVar;
00096   return hRes;
00097 }
00098
00099 STDMETHODIMP CDynamic::Add(VARIANT *pItem, VARIANT *pKey, VARIANT *pBefore, VARIANT *pAfter)
00100 {
00101   // create a CFastVariant and add it to the collection
00102   HRESULT hr = E_FAIL;
00103   long nDistance, nCount, nRemap;
00104   _bstr_t bstrKey;
00105
00106   // STL is not thread-safe
00107   // so use a Critical Section to project
00108   // it's delecate structures
00109   Lock();
00110
00111   if (pBefore->vt != VT_ERROR && pAfter->vt != VT_ERROR)
00112   {
00113     hr = DISP_E_BADPARAMCOUNT;
00114   }
00115   else
00116   {
00117     long nAdvance;
00118     _bstr_t bstrKeyIn;
00119     varvect::iterator it = m_VarVect.begin();
00120     int nCap = m_VarVect.capacity();
00121     if (nCap > m_nReserve)
00122     {
00123       m_nReserve += m_nGrow;
00124       m_VarVect.reserve(m_nReserve);
00125     }
00126
00127     // Where in the vector should the new item go?
00128     if (pBefore->vt == VT_BSTR)
00129     {
00130       bstrKeyIn = pBefore->bstrVal;
00131       nAdvance = m_IndexMap[bstrKeyIn] - 1;
00132       std::advance(it, nAdvance);
00133     }
00134     else if (pAfter->vt == VT_BSTR)
00135     {
00136       bstrKeyIn = pAfter->bstrVal;
00137       nAdvance = m_IndexMap[bstrKeyIn];
00138       std::advance(it, nAdvance);
00139     }
00140     else
00141     {
00142       it = m_VarVect.end();
00143     }
00144
00145     it = m_VarVect.insert(it, *pItem);
00146     nDistance = std::distance( m_VarVect.begin(), it) + 1;
00147
00148     // If we don't have a key, just fabricate one from
00149     // the location in the vector.
00150     if (pKey->vt == VT_BSTR)
00151     {
00152       bstrKeyIn = pKey->bstrVal;
00153     }
00154     else
00155     {
00156       WCHAR wszKey[64];
00157       swprintf(wszKey, L"%lu", nDistance);
00158       bstrKeyIn = wszKey;
00159     }
00160
00161     // Since we are adding a new entry to the vector,
00162     // we need to adjust all the affected items in the
00163     // lookup maps to compensate for the newly increase
00164     // index into the Vector.
00165     for (nCount = m_VarVect.size() - 1; nCount >= nDistance; nCount--)
00166     {
00167       bstrKey = m_MapIndex[nCount];
00168       nRemap = m_IndexMap[bstrKey] + 1;
00169
00170       m_IndexMap[bstrKey] = nRemap;
00171       m_MapIndex.erase(nCount);
00172       m_MapIndex[nRemap] = bstrKey;
00173     }
00174
00175     // Add the new entry into the Index Maps - there will be a newly
00176     // opened space in the logical sequence by the above code.
00177     m_IndexMap.insert(bstr2long::value_type(bstrKeyIn.copy(), nDistance));
00178     m_MapIndex.insert(long2bstr::value_type(nDistance, bstrKeyIn.copy()));
00179     m_bRequiresSave = true;
00180   }
00181   // Anyone else can play, now!
00182   Unlock();
00183   return S_OK;
00184 }
00185
00186 STDMETHODIMP CDynamic::Remove(VARIANT *pItem)
00187 {
00188   // STL is not thread-safe
00189   // so use a Critical Section to project
00190   // it's delecate structures
00191   Lock();
00192
00193   // create a CFastVariant and add it to the collection
00194   long nIndex, nCount, nRemap;
00195   _bstr_t bstrKey;
00196   varvect::iterator it = m_VarVect.begin();
00197
00198   if (pItem->vt == VT_BSTR)
00199   {
00200     _bstr_t bstrKey(pItem->bstrVal);
00201     nIndex = m_IndexMap[bstrKey];
00202   }
00203   else
00204   {
00205     _variant_t varIndex(pItem);
00206     nIndex = (long)varIndex;
00207   }
00208
00209   // Remove the item from the vector,
00210   // and delete it's index map entries
00211   std::advance(it, nIndex - 1);
00212   m_VarVect.erase(it);
00213   bstrKey = m_MapIndex[nIndex];
00214   m_MapIndex.erase(nIndex);
00215   m_IndexMap.erase(bstrKey);
00216
00217   // Since we are removing an entry from the vector,
00218   // we need to adjust all the affected items in the
00219   // lookup maps to compensate for the newly decreased
00220   // index into the Vector.
00221   for (nCount = nIndex + 1; nCount <= m_VarVect.size(); nCount++)
00222   {
00223     bstrKey = m_MapIndex[nCount];
00224     nRemap = m_IndexMap[bstrKey];
00225
00226     m_IndexMap[bstrKey] = nRemap - 1;
00227     m_MapIndex.erase(nCount);
00228     m_MapIndex[nRemap-1] = bstrKey;
00229   }
00230   m_bRequiresSave = true;
00231
00232   Unlock();
00233   return S_OK;
00234 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/handler.cpp Source File

  • Dataaccess
  • rds
  • handler
  • vc

handler.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File:    Handler.cpp
00004 //
00005 // Copyright: Copyright (c) 1991-1999 Microsoft Corporation
00006 //
00007 // Contents:  Implementation of CHandler.
00008 //
00009 // Comments:
00010 //
00011 //-----------------------------------------------------------------------------
00012
00013 #include "stdafx.h"
00014 #include <assert.h>
00015 #include "adoint.h"
00016 #include "adoid.h"
00017 #include "Handler.h"
00018 #include "util.h"
00019
00020
00021 // Directly open an ADO connection instance
00022 static HRESULT DoADOConnect( BSTR bstrConnection, _Connection **ppADOConnection )
00023 {
00024   assert(bstrConnection != NULL);
00025   assert(ppADOConnection != NULL);
00026   HRESULT hr;
00027
00028   // Create an ADO Connection instance.
00029   hr = CoCreateInstance(CLSID_CADOConnection, NULL, CLSCTX_ALL,
00030     __uuidof(_Connection), (LPVOID *)ppADOConnection);
00031   if (FAILED(hr))
00032     return hr;
00033   assert(*ppADOConnection != NULL);
00034
00035   // Set the cursor location.
00036   hr = (*ppADOConnection)->put_CursorLocation(adUseClientBatch);
00037   if (FAILED(hr))
00038     return hr;
00039
00040   // Open the connection.
00041   return (*ppADOConnection)->Open(bstrConnection, NULL, NULL, -1L);
00042 }
00043
00044
00045 // Create and open an ADO Recordset directly from ADO.
00046 static HRESULT GetADORecordset(_Connection *pConn, BSTR bstrQuery, _Recordset **pprs )
00047 {
00048   assert(pConn != NULL);
00049   assert(bstrQuery != NULL);
00050   assert(pprs != NULL);
00051   VARIANT vConnection, vQuery;
00052   HRESULT hr;
00053
00054
00055   // create an ADO recordset
00056   hr = CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL,
00057     __uuidof(_Recordset), (LPVOID *)pprs);
00058   if (FAILED(hr))
00059     return hr;
00060   assert(*pprs != NULL);
00061
00062   // Set the cursor location.
00063   hr = (*pprs)->put_CursorLocation(adUseClientBatch);
00064   if (FAILED(hr))
00065     return hr;
00066
00067   // Setup the variant parameter for Query string
00068   VariantInit(&vQuery);
00069   vQuery.vt = VT_BSTR;
00070   vQuery.bstrVal = bstrQuery;
00071
00072   // Setup the variant parameter for connection
00073   VariantInit(&vConnection);
00074   vConnection.vt = VT_UNKNOWN;
00075   vConnection.punkVal = pConn;
00076
00077   // Open the query
00078   return (*pprs)->Open(
00079     vQuery,
00080     vConnection,
00081     adOpenUnspecified,
00082     adLockBatchOptimistic,
00083     adCmdUnspecified);
00084 }
00085
00086
00087 // Reconnect a Recordset to a Connection directly via ADO.
00088 static HRESULT ADOReconnect(
00089   _Recordset *pADORecordset,
00090   _Connection *pConn)
00091 {
00092   assert(pADORecordset != NULL);
00093   assert(pConn != NULL);
00094
00095   // Set the new active connection for the recordset
00096   return pADORecordset->putref_ActiveConnection(pConn);
00097 }
00098
00099
00100 CHandler::CHandler()
00101 {
00102 }
00103
00104
00105 STDMETHODIMP CHandler::GetRecordset(
00106             /* [in] */ BSTR conn,
00107             /* [in] */ BSTR args,
00108             /* [in] */ BSTR query,
00109             /* [out, retval] */ _Recordset **ppRS)
00110 {
00111   HRESULT hr;
00112   BSTR query2 = SysAllocString(query ? query : L"");
00113
00114   try
00115   {
00116     CUtilComPtr<IErrorInfo> pErrorInfo;
00117
00118     {
00119       CUtilComPtr<_Connection> pConn;
00120
00121       *ppRS = NULL;
00122       hr = OpenConnection(conn, args, 2, &query2, &pConn);
00123       if (SUCCEEDED(hr))
00124         hr = GetADORecordset(pConn, query2, ppRS);
00125
00126       if (FAILED(hr))
00127       {
00128         //Get ADO's error info from OLE, then give it back
00129         if (GetErrorInfo(0, &pErrorInfo) == S_OK)
00130           SetErrorInfo(0, pErrorInfo);
00131         if (*ppRS)
00132         {
00133           (*ppRS)->Release();
00134           *ppRS = NULL;
00135         }
00136       }
00137     }
00138     if (FAILED(hr))
00139     {
00140       //ADO cleared out the error info when the Connect object died. Reset it here.
00141       SetErrorInfo(0, pErrorInfo);
00142     }
00143   }
00144   catch(HRESULT hrCaught)
00145   {
00146     hr = hrCaught;
00147   }
00148   catch(...)
00149   {
00150     hr = E_FAIL;
00151   }
00152   SysFreeString(query2);
00153   return hr;
00154 }
00155
00156
00157 STDMETHODIMP CHandler::Reconnect(
00158             /* [in] */ BSTR conn,
00159             /* [in] */ BSTR args,
00160             /* [in] */ _Recordset *pRS)
00161 {
00162   HRESULT hr;
00163
00164   try
00165   {
00166     CUtilComPtr<IErrorInfo> pErrorInfo;
00167
00168     {
00169       CUtilComPtr<_Connection> pConn;
00170
00171       hr = OpenConnection(conn, args, 1, NULL, &pConn);
00172       if (SUCCEEDED(hr))
00173         hr = ADOReconnect(pRS, pConn);
00174
00175       if (FAILED(hr))
00176       {
00177         //Get ADO's error info from OLE, then give it back
00178         if (GetErrorInfo(0, &pErrorInfo) == S_OK)
00179           SetErrorInfo(0, pErrorInfo);
00180       }
00181     }
00182     if (FAILED(hr))
00183     {
00184       //ADO cleared out the error info when the Connect object died. Reset it here.
00185       SetErrorInfo(0, pErrorInfo);
00186     }
00187   }
00188   catch(HRESULT hrCaught)
00189   {
00190     hr = hrCaught;
00191   }
00192   catch(...)
00193   {
00194     hr = E_FAIL;
00195   }
00196   return hr;
00197 }
00198
00199
00200 //
00201 // This function is new for MDAC 2.1
00202 // The 2.1 Data Factory will only call this function for 2.1 clients using "MS Remote".
00203 // The 2.1 Data Factory will still use the other 2 functions for 2.0 clients and for 2.1
00204 //    clients using "DFMode=20".
00205 //
00206 STDMETHODIMP CHandler::OpenConnection(
00207       /* [in] */ BSTR conn,
00208       /* [in] */ BSTR args,
00209       /* [in] */ long lFlags,  // 1=WriteAccess, 2=ModifyQuery
00210       /* [in, out] */ BSTR * pQuery,
00211       /* [out, retval] */ _Connection **ppConnection)
00212 {
00213   HRESULT hr;
00214
00215   try
00216   {
00217     CUtil util;
00218     CUtilComPtr<_Connection> pConn;
00219
00220     *ppConnection = NULL;
00221     util.SetIniFile(args);
00222     util.SetConn(conn);
00223     if (!util.HasReadAccess())
00224       util.RaiseError(HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED));
00225     if (lFlags & 1)  // For ReadWrite
00226     {
00227       if (!util.HasWriteAccess())
00228         util.RaiseError(HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED));
00229     }
00230
00231     if ((lFlags & 2) && pQuery)
00232     {
00233       // For GetRecordset(), etc.
00234       if (*pQuery)
00235       {
00236         util.SetSql(*pQuery);
00237         SysFreeString(*pQuery);
00238       }
00239       else
00240         util.SetSql(L"");
00241       *pQuery = SysAllocString(util.GetSql());
00242     }
00243
00244     WCHAR *pwsz = util.GetConn();
00245     CUtilBSTR bstrConn(pwsz);
00246     hr = DoADOConnect(bstrConn, &pConn);
00247     if (SUCCEEDED(hr))
00248       *ppConnection = pConn.Detach();
00249   }
00250   catch(HRESULT hrCaught)
00251   {
00252     hr = hrCaught;
00253   }
00254   catch(...)
00255   {
00256     hr = E_FAIL;
00257   }
00258   return hr;
00259 }
00260
00261
00262 STDMETHODIMP CHandler::InterfaceSupportsErrorInfo(REFIID riid)
00263 {
00264   if (IsEqualGUID(riid, IID_IDataFactoryHandler))
00265     return S_OK;
00266   return S_FALSE;
00267 }
00268
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Intermediate/Power.h Source File

  • Web
  • iis
  • Components
  • Cpp
  • Intermediate

Power.h

Go to the documentation of this file.
00001 // Power.h : Declaration of the CPower
00002
00003
00004 #include "resource.h"       // main symbols
00005
00006 #include <asptlb.h>         // ASP Definitions
00007
00008 // 'asptlb.h' is installed with Active Server Pages.  Either copy it
00009 // to your Include directory or add the appropriate directory to your
00010 // Include Path.
00011
00012 /////////////////////////////////////////////////////////////////////////////
00013 // CATLPwr
00014
00015 class CPower :
00016     public CComDualImpl<IPower, &IID_IPower, &LIBID_CATLPwr>,
00017     public ISupportErrorInfo,
00018     public CComObjectRoot,
00019     public CComCoClass<CPower,&CLSID_CPower>
00020 {
00021 public:
00022     CPower();
00023 BEGIN_COM_MAP(CPower)
00024     COM_INTERFACE_ENTRY(IDispatch)
00025     COM_INTERFACE_ENTRY(IPower)
00026     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00027   COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
00028 END_COM_MAP()
00029 //DECLARE_NOT_AGGREGATABLE(CPower)
00030 // Remove the comment from the line above if you don't want your object to
00031 // support aggregation.  The default is to support it
00032
00033 DECLARE_REGISTRY(CPower, _T("IISSample.C++ATLPower.1"), _T("IISSample.C++ATLPower"), IDS_POWER_DESC, THREADFLAGS_BOTH)
00034 // ISupportsErrorInfo
00035     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00036
00037 // IPower
00038 public:
00039   // for free-threaded marshalling
00040 DECLARE_GET_CONTROLLING_UNKNOWN()
00041   HRESULT FinalCountruct()
00042   {
00043     return CoCreateFreeThreadedMarshaler(
00044       GetControllingUnknown(), &m_pUnkMarshaler.p );
00045   }
00046   void FinalRelease()
00047   {
00048     m_pUnkMarshaler.Release();
00049   }
00050
00051     STDMETHOD(get_myProperty)(BSTR* pbstrOutValue);
00052     STDMETHOD(put_myProperty)(BSTR bstrInValue);
00053     STDMETHOD(myMethod)(BSTR bstrIn, BSTR* pbstrOut);
00054
00055     // ASP-specific Property and Method
00056     STDMETHOD(get_myPowerProperty)(BSTR* pbstrOutValue);
00057     STDMETHOD(myPowerMethod)();
00058
00059 private:
00060   CComPtr<IUnknown>     m_pUnkMarshaler;
00061     CComBSTR                    m_bstrMyProperty;     // myProperty
00062 };
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/Main.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

Main.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       MAIN.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 //****************************************************************************
00019 //
00020 // Global Variables
00021 //
00022 //****************************************************************************
00023
00024 HINSTANCE ghInst       = NULL;          // Current Instance
00025 HACCEL    ghAccelTable = NULL;          // Menu accelerators
00026 HMENU     ghMenu       = NULL;          // Main Menu
00027 HWND      ghwndMain    = NULL;          // Main Window
00028
00029 HWND      ghwndSbar    = NULL;      // Status bar window
00030 HWND      ghwndTbar    = NULL;      // Toolbar window
00031 HWND      ghwndMsg     = NULL;      // Message window
00032 HWND      ghwndChat    = NULL;      // Chat Edit Control
00033 HWND      ghwndSend    = NULL;      // Send Button
00034 HWND      ghwndUList   = NULL;      // User List
00035 HWND      ghwndLView   = NULL;      // Main List View
00036 HWND      ghwndEntry   = NULL;      // szEntry Edit control
00037 HFONT     ghfontEntry  = NULL;      // Font for edit control
00038
00039 PREF      gPref;                        // User preferences
00040 int       gdxWndMin    = 325;           // maximum size of window
00041 int       gdyWndMin    = 250;           // maximum size of window
00042
00043
00044
00045
00046
00047 VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
00048 {
00049   DoEnumApps();
00050 }
00051
00052 //****************************************************************************
00053 //
00054 // Main Windows entrypoint
00055 //
00056 //****************************************************************************
00057
00058 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPSTR  lpszCmd, int nCmdShow)
00059 {
00060   ghInst = hInstance;
00061
00062   if (FInitApp(lpszCmd, nCmdShow))
00063   {
00064
00065     MSG  msg = {0,0,0,0,0,0};
00066     while (GetMessage(&msg, NULL, 0, 0))
00067     {
00068       if (!TranslateAccelerator(msg.hwnd, ghAccelTable, &msg))
00069       {
00070         TranslateMessage(&msg);
00071         DispatchMessage(&msg);
00072       }
00073     }
00074   }
00075
00076     // Uninitialize OLE
00077     CoUninitialize();
00078
00079   return 0;
00080 }
00081
00082
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/perfile.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

perfile.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          PerFile.h
00021
00022   Description:   CPersistFile definitions.
00023
00024 **************************************************************************/
00025
00026 #ifndef PERSISTFILE_H
00027 #define PERSISTFILE_H
00028
00029 /**************************************************************************
00030 #include statements
00031 **************************************************************************/
00032
00033 #include "DOServer.h"
00034
00035 /**************************************************************************
00036
00037   CPersistFile class definition
00038
00039 **************************************************************************/
00040
00041 class COleDocument;
00042 class CPersistStorage;
00043
00044 class CPersistFile : IPersistFile
00045 {
00046 private:
00047   LPSTORAGE         m_pStorage;
00048   COleDocument      *m_pOleDoc;
00049   CPersistStorage   *m_pPersistStorage;
00050   LPOLESTR          m_pwszFile;
00051
00052 public:
00053   CPersistFile::CPersistFile(COleDocument *, CPersistStorage *);
00054   CPersistFile::~CPersistFile();
00055
00056   STDMETHODIMP QueryInterface(REFIID, LPVOID*);
00057   STDMETHODIMP_(ULONG)AddRef();
00058   STDMETHODIMP_(ULONG)Release();
00059
00060   STDMETHODIMP GetClassID(LPCLSID);
00061   STDMETHODIMP Save(LPCOLESTR, BOOL);
00062   STDMETHODIMP SaveCompleted(LPCOLESTR);
00063   STDMETHODIMP Load(LPCOLESTR, DWORD);
00064   STDMETHODIMP IsDirty(void);
00065   STDMETHODIMP GetCurFile(LPOLESTR*);
00066
00067 };
00068
00069 #endif   //PERSISTFILE_H
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Range/callback.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Range

callback.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include <urlmon.h>
00018 #include <wininet.h>
00019 #include "callback.hpp"
00020
00021 #define BOUNDARY_MAXSIZE 500
00022 #define RECV_BUF_SIZE   8192
00023
00024 static char szCRLF[] = "\r\n";
00025 static char szLF[]   = "\n";
00026
00027 // ---------------------------------------------------------------------------
00028 // CUrlmonCallback::CUrlmonCallback
00029 // ---------------------------------------------------------------------------
00030 CUrlmonCallback::CUrlmonCallback (PHTTP_REQUEST_PARAM pParam)
00031 {
00032     m_pBinding = NULL;
00033     m_pstm = NULL;
00034     m_cRef = 0;
00035
00036     m_pParam = pParam;
00037
00038     if (m_pParam->punkOuter)
00039         ((IUnknown *) m_pParam->punkOuter)->AddRef();
00040
00041     m_CBParam.cbStruct = sizeof(m_CBParam);
00042     m_CBParam.dwRequestCtx = m_pParam->dwRequestCtx;
00043
00044     m_dwOffset = 0;
00045     m_dwResponseCode = 0;
00046     m_pszRangeDelimiter = NULL;
00047 }
00048
00049 // ---------------------------------------------------------------------------
00050 // CUrlmonCallback::~CUrlmonCallback
00051 // ---------------------------------------------------------------------------
00052 CUrlmonCallback::~CUrlmonCallback()
00053 {
00054     if (m_pParam->punkOuter)
00055         ((IUnknown *) m_pParam->punkOuter)->Release();
00056     if (m_pstm)
00057         m_pstm->Release();
00058     if (m_pszRangeDelimiter)
00059         LocalFree ((HLOCAL) m_pszRangeDelimiter);
00060 }
00061
00062 // ---------------------------------------------------------------------------
00063 // CUrlmonCallback::QueryInterface
00064 // ---------------------------------------------------------------------------
00065 STDMETHODIMP CUrlmonCallback::QueryInterface(REFIID riid, void** ppv)
00066 {
00067     if(IsEqualGUID(riid,IID_IUnknown))
00068         *ppv = (IUnknown *) (IBindStatusCallback *) this;
00069     else if (IsEqualGUID(riid,IID_IBindStatusCallback))
00070         *ppv = (IBindStatusCallback *) this;
00071     else if (IsEqualGUID(riid, IID_IHttpNegotiate))
00072         *ppv = (IHttpNegotiate *) this;
00073     else
00074         *ppv = NULL;
00075
00076     if (!*ppv)
00077         return E_NOINTERFACE;
00078
00079     // Increment our reference count before we hand out our interface
00080     ((LPUNKNOWN)*ppv)->AddRef();
00081     return S_OK;
00082
00083 }
00084
00085
00086 // ---------------------------------------------------------------------------
00087 // CUrlmonCallback::AddRef
00088 // ---------------------------------------------------------------------------
00089 STDMETHODIMP_(ULONG) CUrlmonCallback::AddRef(void)
00090 {
00091     if (m_pParam->punkOuter)
00092         ((IUnknown *) m_pParam->punkOuter)->AddRef();
00093     return m_cRef++;
00094 }
00095
00096
00097 // ---------------------------------------------------------------------------
00098 // CUrlmonCallback::Release
00099 // ---------------------------------------------------------------------------
00100 STDMETHODIMP_(ULONG) CUrlmonCallback::Release(void)
00101 {
00102     if (m_pParam->punkOuter)
00103         ((IUnknown *) m_pParam->punkOuter)->Release();
00104
00105     if (--m_cRef == 0)
00106     {
00107         delete this;
00108         return 0;
00109     }
00110     return m_cRef;
00111 }
00112
00113 // ---------------------------------------------------------------------------
00114 // CUrlmonCallback::BeginningTransaction
00115 // ---------------------------------------------------------------------------
00116 STDMETHODIMP
00117 CUrlmonCallback::BeginningTransaction (LPCWSTR szURL,
00118     LPCWSTR szHeaders, DWORD dwReserved, LPWSTR *ppszAdditionalHeaders)
00119 {
00120   UNREFERENCED_PARAMETER(szURL);
00121   UNREFERENCED_PARAMETER(szHeaders);
00122   UNREFERENCED_PARAMETER(ppszAdditionalHeaders);
00123   UNREFERENCED_PARAMETER(dwReserved);
00124     static char szRangeHeader[] = "Range: bytes=";
00125     static char szUnlessHeader[] = "Unless-Modified-Since: ";
00126
00127     HRESULT hr = S_OK;
00128     PSTR pszHeader = NULL;
00129
00130     // Don't add any headers if not a range request.
00131     DWORD cRanges = m_pParam->cRanges;
00132     if (!cRanges)
00133     {
00134         *ppszAdditionalHeaders = NULL;
00135         goto done;
00136     }
00137
00138     PHTTP_REQUEST_RANGE pRanges;
00139     pRanges = m_pParam->pRanges;
00140
00141     // Allocate ANSI buffer.
00142     DWORD cbHeader;
00143     cbHeader = sizeof(szRangeHeader) + 20 * cRanges + 2;
00144     if (m_pParam->pstUnlessModifiedSince)
00145        cbHeader += sizeof(szUnlessHeader) + INTERNET_RFC1123_BUFSIZE + 2;
00146     pszHeader = (PSTR) LocalAlloc (LMEM_FIXED, cbHeader);
00147     if (!pszHeader)
00148     {
00149         hr = E_OUTOFMEMORY;
00150         goto done;
00151     }
00152
00153     // Format the read range request header.
00154     UINT cchHeader;
00155     cchHeader = wsprintf (pszHeader, "%s", szRangeHeader);
00156
00157     // Add the ranges.
00158     while (cRanges--)
00159     {
00160         if (pRanges->dwSize)
00161         {
00162             // Format range, end value is inclusive.
00163             cchHeader += wsprintf (pszHeader + cchHeader, "%d-%d",
00164                 pRanges->dwOffset, pRanges->dwOffset + pRanges->dwSize - 1);
00165         }
00166         else
00167         {
00168             // Format range to end of file.
00169             cchHeader += wsprintf (pszHeader + cchHeader, "%d-",
00170                 pRanges->dwOffset);
00171         }
00172
00173         pRanges++;
00174         if (cRanges)
00175            cchHeader += wsprintf (pszHeader + cchHeader, ", ");
00176         else
00177            cchHeader += wsprintf (pszHeader + cchHeader, szCRLF);
00178     }
00179
00180     if (m_pParam->pstUnlessModifiedSince)
00181     {
00182         // Add unless-modified-since qualifier.
00183         cchHeader += wsprintf (pszHeader + cchHeader, szUnlessHeader);
00184         if (!InternetTimeFromSystemTime
00185         (
00186             m_pParam->pstUnlessModifiedSince,
00187             INTERNET_RFC1123_FORMAT,
00188             pszHeader + cchHeader,
00189             INTERNET_RFC1123_BUFSIZE
00190         ))
00191         {
00192             hr = E_FAIL;
00193             goto done;
00194         }
00195
00196         cchHeader += lstrlen (pszHeader + cchHeader);
00197         cchHeader += wsprintf (pszHeader + cchHeader, szCRLF);
00198     }
00199
00200     cchHeader++; // for NULL termination
00201
00202     // Allocate Unicode buffer.
00203     *ppszAdditionalHeaders = (WCHAR *) CoTaskMemAlloc (sizeof(WCHAR) * cchHeader);
00204     if (*ppszAdditionalHeaders)
00205     {
00206         MultiByteToWideChar (CP_ACP, 0, pszHeader, -1, *ppszAdditionalHeaders,
00207             cchHeader);
00208     }
00209
00210     hr = *ppszAdditionalHeaders? S_OK : E_OUTOFMEMORY;
00211
00212 done:
00213     if (pszHeader)
00214         LocalFree (pszHeader);
00215     return hr;
00216 }
00217
00218 // ---------------------------------------------------------------------------
00219 // CUrlmonCallback::OnResponse
00220 // ---------------------------------------------------------------------------
00221 STDMETHODIMP CUrlmonCallback::OnResponse
00222 (
00223     DWORD   dwResponseCode,
00224     LPCWSTR szResponseHeaders,
00225     LPCWSTR szRequestHeaders,
00226     LPWSTR  *pszAdditionalRequestHeaders
00227 )
00228 {
00229   UNREFERENCED_PARAMETER(pszAdditionalRequestHeaders);
00230   UNREFERENCED_PARAMETER(szResponseHeaders);
00231   UNREFERENCED_PARAMETER(szRequestHeaders);
00232     // Get the HttpQueryInfo wrapper object.
00233     IWinInetHttpInfo *pHttpInfo = NULL;
00234     HRESULT hr = m_pBinding->QueryInterface
00235         (IID_IWinInetHttpInfo, (void **) &pHttpInfo);
00236     if (FAILED(hr))
00237         goto done;
00238
00239     // Save the response code.
00240     m_dwResponseCode = dwResponseCode;
00241     m_CBParam.dwResponseCode = dwResponseCode;
00242
00243     DWORD cbBuf;
00244
00245     // Check for partial response.
00246     if (dwResponseCode == 206)
00247     {
00248        // Server responded with byte ranges, ergo must support them.
00249        m_CBParam.fdwRequestFlags = HTTP_REQUEST_ACCEPT_RANGES;
00250
00251        // Look for multi-part delimiter embedded in content type.
00252        const static char szMultiPart[] = "multipart/x-byteranges; boundary";
00253        const static DWORD cbMultiPart = sizeof(szMultiPart);
00254
00255        // Get length of buffer to hold content type.
00256        DWORD cbContentType = 0;
00257        pHttpInfo->QueryInfo
00258           (HTTP_QUERY_CONTENT_TYPE, NULL, &cbContentType, NULL, 0);
00259
00260        if (cbContentType > cbMultiPart + 1)
00261        {
00262             // Content type is big enough to embed a delimiter.
00263             m_pszRangeDelimiter = (PSTR) LocalAlloc (LMEM_FIXED, cbContentType);
00264             if (!m_pszRangeDelimiter)
00265             {
00266                 hr = E_OUTOFMEMORY;
00267                 goto done;
00268             }
00269
00270             if (S_OK != pHttpInfo->QueryInfo (HTTP_QUERY_CONTENT_TYPE,
00271                  m_pszRangeDelimiter, &cbContentType, NULL, 0))
00272             {
00273                 hr = E_FAIL;
00274                 goto done;
00275             }
00276
00277             // Split the string at the '='
00278             m_pszRangeDelimiter[cbMultiPart - 1] = 0;
00279             if (lstrcmpi (m_pszRangeDelimiter, szMultiPart))
00280             {
00281                 // Response must not be multi-part.
00282                 LocalFree ((HLOCAL) m_pszRangeDelimiter);
00283                 m_pszRangeDelimiter = NULL;
00284             }
00285             else
00286             {
00287                 m_cchRangeDelimiter =
00288                     lstrlen (m_pszRangeDelimiter + cbMultiPart);
00289
00290                 // Shift the delimiter to offset 2 of string.
00291                 MoveMemory
00292                 (
00293                   m_pszRangeDelimiter + 2, // +2 for prefix
00294                   m_pszRangeDelimiter + cbMultiPart,
00295                   m_cchRangeDelimiter + 1  // +1 for null
00296                 );
00297
00298                 // Prefix delimiter with "--"
00299                 m_pszRangeDelimiter[0] = '-';
00300                 m_pszRangeDelimiter[1] = '-';
00301                 m_cchRangeDelimiter += 2;
00302
00303                 // Initialize range boundaries.
00304                 m_dwRangeBeg = 0;
00305                 m_dwRangeEnd = 0;
00306             }
00307
00308         } // end if (cbContentType > cbMultiPart + 1)
00309
00310         // Adjust the offset if we have a single range
00311         if (!m_pszRangeDelimiter)
00312             m_dwOffset = m_pParam->pRanges[0].dwOffset;
00313     }
00314
00315     else // if (dwResponseCode != 206)
00316     {
00317         // Check if ranges are supported.
00318         static char szBytes[] = "bytes";
00319         char szBuf[sizeof(szBytes)];
00320         cbBuf = sizeof(szBytes);
00321         hr = pHttpInfo->QueryInfo
00322             (HTTP_QUERY_ACCEPT_RANGES, szBuf, &cbBuf, NULL, 0);
00323         if (SUCCEEDED(hr) && !lstrcmpi (szBytes, szBuf))
00324             m_CBParam.fdwRequestFlags = HTTP_REQUEST_ACCEPT_RANGES;
00325         else
00326             m_CBParam.fdwRequestFlags = 0;
00327     }
00328
00329     // Get last modified time.
00330     SYSTEMTIME stLastModified;
00331     cbBuf = sizeof(stLastModified);
00332     hr = pHttpInfo->QueryInfo
00333     (
00334         HTTP_QUERY_FLAG_SYSTEMTIME | HTTP_QUERY_LAST_MODIFIED,
00335         &stLastModified, &cbBuf, NULL, 0
00336     );
00337     if (hr != S_OK)
00338     {
00339         memset (&stLastModified, 0, sizeof(stLastModified));
00340         hr = S_OK;
00341     }
00342     m_CBParam.pstLastModified = &stLastModified;
00343
00344     // Get content length.
00345     m_CBParam.dwContentLength = 0;
00346     if (dwResponseCode != 206)
00347     {
00348         cbBuf = sizeof(m_CBParam.dwContentLength);
00349         hr = pHttpInfo->QueryInfo
00350         (
00351             HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_CONTENT_LENGTH,
00352             &m_CBParam.dwContentLength, &cbBuf, NULL, 0
00353         );
00354         if (hr != S_OK)
00355         {
00356             m_CBParam.dwContentLength = 0;
00357             hr = S_OK;
00358         }
00359     }
00360
00361
00362     // Inform the client the request is started.
00363     m_CBParam.CallbackType = REQUESTCB_STARTED;
00364     if (!(*(m_pParam->pfnRequestCB)) (&m_CBParam))
00365          m_pBinding->Abort();
00366     hr = S_OK;
00367
00368 done:
00369
00370     if (pHttpInfo)
00371         pHttpInfo->Release();
00372
00373     return hr;
00374 }
00375
00376 // ---------------------------------------------------------------------------
00377 // CUrlmonCallback::OnStartBinding
00378 // ---------------------------------------------------------------------------
00379 STDMETHODIMP CUrlmonCallback::OnStartBinding
00380     (DWORD grfBSCOption, IBinding* pBinding)
00381 {
00382   UNREFERENCED_PARAMETER(grfBSCOption);
00383     if (pBinding != NULL)
00384     {
00385          m_pBinding = pBinding;
00386          m_pBinding->AddRef();
00387     }
00388
00389     // Initialize receive buffer.
00390     if (!BufAlloc(RECV_BUF_SIZE))
00391         return E_OUTOFMEMORY;
00392
00393     return S_OK;
00394 }
00395
00396 // ---------------------------------------------------------------------------
00397 // CUrlmonCallback::GetPriority
00398 // ---------------------------------------------------------------------------
00399 STDMETHODIMP CUrlmonCallback::GetPriority(LONG* pnPriority)
00400 {
00401   UNREFERENCED_PARAMETER(pnPriority);
00402     return E_NOTIMPL;
00403 }
00404
00405 // ---------------------------------------------------------------------------
00406 // CUrlmonCallback::OnLowResource
00407 // ---------------------------------------------------------------------------
00408 STDMETHODIMP CUrlmonCallback::OnLowResource(DWORD dwReserved)
00409 {
00410   UNREFERENCED_PARAMETER(dwReserved);
00411     return E_NOTIMPL;
00412 }
00413
00414 // ---------------------------------------------------------------------------
00415 // CUrlmonCallback::OnProgress
00416 // ---------------------------------------------------------------------------
00417 STDMETHODIMP CUrlmonCallback::OnProgress
00418     (ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
00419 {
00420   UNREFERENCED_PARAMETER(ulProgress);
00421   UNREFERENCED_PARAMETER(ulProgressMax);
00422   UNREFERENCED_PARAMETER(ulStatusCode);
00423   UNREFERENCED_PARAMETER(szStatusText);
00424     return S_OK;
00425 }
00426
00427 // ---------------------------------------------------------------------------
00428 // CUrlmonCallback::OnStopBinding
00429 // ---------------------------------------------------------------------------
00430 STDMETHODIMP CUrlmonCallback::OnStopBinding
00431     (HRESULT hrStatus, LPCWSTR pszError)
00432 {
00433   UNREFERENCED_PARAMETER(pszError);
00434     // Release the binding, which will eventually release the callback object.
00435     m_pBinding->Release();
00436     m_pBinding = NULL;
00437
00438     // Notify the client that we are done.
00439     m_CBParam.CallbackType = REQUESTCB_DONE;
00440     m_CBParam.hrRequest = hrStatus;
00441     (*(m_pParam->pfnRequestCB)) (&m_CBParam);
00442
00443     return S_OK;
00444 }
00445
00446 // ---------------------------------------------------------------------------
00447 // CUrlmonCallback::GetBindInfo
00448 // ---------------------------------------------------------------------------
00449 STDMETHODIMP CUrlmonCallback::GetBindInfo
00450     (DWORD* pgrfBINDF, BINDINFO* pbindInfo)
00451 {
00452     *pgrfBINDF = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
00453     *pgrfBINDF |= BINDF_GETNEWESTVERSION;
00454     pbindInfo->cbSize = sizeof(BINDINFO);
00455     pbindInfo->szExtraInfo = NULL;
00456     ZeroMemory (&pbindInfo->stgmedData, sizeof(STGMEDIUM));
00457     pbindInfo->grfBindInfoF = 0;
00458     pbindInfo->dwBindVerb = BINDVERB_GET;
00459     pbindInfo->szCustomVerb = NULL;
00460     return S_OK;
00461 }
00462
00463 // ---------------------------------------------------------------------------
00464 // CUrlmonCallback::OnDataAvailable
00465 // ---------------------------------------------------------------------------
00466 STDMETHODIMP CUrlmonCallback::OnDataAvailable
00467     (DWORD grfBSCF, DWORD dwSize, FORMATETC* pfmtetc, STGMEDIUM* pstgmed)
00468 {
00469   UNREFERENCED_PARAMETER(dwSize);
00470   UNREFERENCED_PARAMETER(pfmtetc);
00471     if (!m_pstm && pstgmed->tymed == TYMED_ISTREAM)
00472     {
00473         m_pstm = pstgmed->pstm;
00474         m_pstm->AddRef();
00475         m_CBParam.CallbackType = REQUESTCB_DATA;
00476     }
00477
00478     // Check for multi-part response.
00479     if (m_pszRangeDelimiter)
00480        return ParseMultiPartBuffer (grfBSCF & BSCF_LASTDATANOTIFICATION);
00481
00482     HRESULT hrRead;
00483     DWORD cbActual;
00484
00485     do // until hrRead != S_OK
00486     {
00487         // Read some more data.
00488         hrRead = m_pstm->Read (BufBeg(), BufSize(), &cbActual);
00489
00490         // Notify the client we got some data.
00491         if (cbActual)
00492         {
00493             m_CBParam.dwDataOffset = m_dwOffset;
00494             m_CBParam.lpDataBuffer = BufBeg();
00495             m_CBParam.cbDataLength = cbActual;
00496             if (!(*(m_pParam->pfnRequestCB)) (&m_CBParam))
00497             {
00498                  // Client wants to stop.
00499                  m_pBinding->Abort();
00500                  return S_OK;
00501             }
00502         }
00503
00504         m_dwOffset += cbActual;
00505
00506     } while (hrRead == S_OK);
00507
00508     return (hrRead == S_FALSE || hrRead == E_PENDING)? S_OK : hrRead;
00509 }
00510
00511 // ---------------------------------------------------------------------------
00512 // CUrlmonCallback::OnObjectAvailable
00513 // ---------------------------------------------------------------------------
00514 STDMETHODIMP CUrlmonCallback::OnObjectAvailable(REFIID riid, IUnknown* punk)
00515 {
00516   UNREFERENCED_PARAMETER(riid);
00517   UNREFERENCED_PARAMETER(punk);
00518     return E_NOTIMPL;
00519 }
00520
00521 // ---------------------------------------------------------------------------
00522 // CUrlmonCallback::ParseMultiPartHeader
00523 // ---------------------------------------------------------------------------
00524 BOOL CUrlmonCallback::ParseMultiPartHeader (void)
00525 {
00526     // multi-part boundary string literals.
00527     static char szContentType[]  = "Content-Type: ";
00528     static char szContentRange[] = "Content-Range: bytes ";
00529
00530 // Some macros for prettiness...
00531 #define GrokStr(str) if (!BufScanStr (str, sizeof(str)-1)) return FALSE;
00532 #define GrokInt(pint, delim) if (!BufScanInt (pint,delim)) return FALSE;
00533
00534   // Check for presence of boundary.
00535     if (m_dwRangeBeg > 0) // must not be first range
00536       GrokStr (szLF);   // will also detect a CR-LF
00537   if (!BufScanStr (m_pszRangeDelimiter, m_cchRangeDelimiter))
00538       return FALSE;
00539
00540   // Check for end boundary.
00541   if
00542   (    m_pbDataBeg + 2 <= m_pbDataEnd
00543     && m_pbDataBeg[0] == '-'
00544     && m_pbDataBeg[1] == '-'
00545   )
00546   {
00547       m_dwRangeBeg = 0;
00548       m_dwRangeEnd = 0;
00549       return TRUE;
00550     }
00551
00552   // Scan content type and data range.
00553   GrokStr (szLF);
00554   GrokStr (szContentType);
00555   GrokStr (szLF);
00556   GrokStr (szContentRange);
00557     GrokInt (&m_dwRangeBeg, '-');
00558     GrokInt (&m_dwRangeEnd, '/');
00559     GrokStr (szLF);
00560     GrokStr (szLF);
00561
00562     // Range end is inclusive; make it exclusive.
00563     m_dwRangeEnd++;
00564     return TRUE;
00565
00566 #undef GrokStr
00567 #undef GrokInt
00568 }
00569
00570 // ---------------------------------------------------------------------------
00571 // CUrlmonCallback::ParseMultiPartBuffer
00572 // ---------------------------------------------------------------------------
00573 HRESULT CUrlmonCallback::ParseMultiPartBuffer (BOOL fLastCall)
00574 {
00575   UNREFERENCED_PARAMETER(fLastCall);
00576     HRESULT hrRead;
00577     DWORD cbActual;
00578
00579     do // until hrRead != S_OK
00580     {
00581         // Read data and append to buffer.
00582         hrRead = m_pstm->Read(m_pbDataEnd, BufSpace(), &cbActual);
00583         m_pbDataEnd += cbActual;
00584
00585         // Dispatch to current state handler.
00586         if (m_dwRangeBeg != m_dwRangeEnd)
00587             goto process_data;
00588         else
00589             goto parse_header;
00590
00591 parse_header:
00592
00593         // If download not at EOF, don't try to parse multi-part
00594         // boundary if any chance it would be split across buffers.
00595         if (hrRead != S_FALSE && m_pbDataBeg > m_pbDataEnd - BOUNDARY_MAXSIZE)
00596         {
00597             BufShift();
00598             continue;
00599         }
00600
00601         // Attempt to parse the multi-part boundary.
00602         if (!ParseMultiPartHeader())
00603             break;
00604
00605         // Check if we got termination boundary.
00606         if (m_dwRangeBeg == m_dwRangeEnd)
00607             break;
00608
00609         goto process_data;
00610
00611 process_data:
00612
00613         // Calculate amount of data to report.
00614         DWORD cbData   = (DWORD)(m_pbDataEnd  - m_pbDataBeg);
00615         DWORD cbRange  = m_dwRangeEnd - m_dwRangeBeg;
00616         DWORD cbLength = min (cbData, cbRange);
00617
00618         if (cbLength)
00619         {
00620             // Call back the client with more data.
00621             m_CBParam.dwDataOffset = m_dwRangeBeg;
00622             m_CBParam.lpDataBuffer = m_pbDataBeg;
00623             m_CBParam.cbDataLength = cbLength;
00624             if (!(*(m_pParam->pfnRequestCB)) (&m_CBParam))
00625             {
00626                  // Client wants to stop.
00627                  m_pBinding->Abort();
00628                  break;
00629             }
00630             m_dwRangeBeg += cbLength;
00631         }
00632
00633         // Adjust the buffer depending on next state.
00634         if (m_dwRangeBeg == m_dwRangeEnd) // (cbLength == cbRange)
00635         {
00636             // Consume the data and look for next header.
00637             m_pbDataBeg += cbLength;
00638             goto parse_header;
00639         }
00640         else
00641         {
00642             // Reset buffer and get some more data.
00643             BufReset();
00644             continue;
00645         }
00646
00647     } while (hrRead == S_OK);
00648
00649     return (hrRead == S_FALSE || hrRead == E_PENDING)? S_OK : hrRead;
00650 }
00651
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/PropCert/PropCert.Cpp Source File

  • Security
  • SmartCard
  • PropCert

PropCert.Cpp

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Module:      PropCert.cpp
00010
00011  Abstract:    Main program of PropCert sample for Smart Card SDK sample. See
00012               ReadMe.txt for more detailed information about this sample.
00013
00014  Environment: Win32 console, C++ w/SEH, UNICODE ready.
00015
00016 ------------------------------------------------------------------------------*/
00017
00018 #define _WIN32_WINNT 0x0400
00019
00020 ///////////////
00021 //
00022 // INCLUDE
00023 //
00024
00025 #include <tchar.h>
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <windows.h>
00029 #include <winscard.h>
00030 #include <wincrypt.h>
00031
00032
00033 ///////////////
00034 //
00035 // Macros
00036 //
00037
00038 #define MALLOC(size)  ((LPBYTE) LocalAlloc(LPTR, size))
00039 #define FREE(buffer)  (LocalFree((LPBYTE) buffer))
00040
00041
00042 ///////////////
00043 //
00044 // Prototypes
00045 //
00046
00047 LONG SCardPropCert (IN SCARDCONTEXT hContext,
00048                     IN LPCTSTR mszReaderNames,
00049                     IN LPCTSTR szStoreName);
00050
00051 LONG CryptPropCert (IN HCRYPTPROV hCryptProv,
00052                     IN LPCTSTR szCSPName,
00053                     IN LPCTSTR szStoreName);
00054
00055 LONG GetCert (IN HCRYPTPROV hCryptProv,
00056               IN DWORD dwKeySpec,
00057               OUT LPBYTE * lplpbCert,
00058               OUT DWORD * lpdwCertLength);
00059
00060 LONG AddCert (IN HCRYPTPROV hCryptProv,
00061               IN LPBYTE lpbCert,
00062               IN DWORD dwCertLength,
00063               IN DWORD dwKeySpec,
00064               IN LPCWSTR szCertFriendlyName,
00065               IN LPCWSTR zContainerName,
00066               IN LPCWSTR szCSPName,
00067               IN LPCWSTR szStoreName);
00068
00069 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00070
00071  Function : _tmain
00072
00073  Synopsis : Entry point of PropCert.
00074
00075  Parameter: Standard ANSI C command line parameters.
00076
00077  Return   : SCARD_S_SUCCESS or error code.
00078
00079  Remarks  :
00080
00081 ------------------------------------------------------------------------------*/
00082
00083 int __cdecl _tmain (int argc, _TCHAR  * argv[])
00084 {
00085    LONG lResult;
00086    DWORD dwNumReaders = 0;
00087    SCARDCONTEXT hContext = NULL;
00088    LPTSTR mszReaderNames = NULL;
00089
00090    __try
00091    {
00092       //
00093       // Establish context with the resource manager.
00094       //
00095       lResult = SCardEstablishContext(SCARD_SCOPE_USER,
00096                                       NULL,
00097                                       NULL,
00098                                       &hContext);
00099       if (lResult != SCARD_S_SUCCESS)
00100       {
00101          __leave;
00102       }
00103
00104       //
00105       // Get the list of reader(s) associated with the specified group(s).
00106       // Note: The buffer is automatically allocated and must be freed
00107       //       by SCardFreeMemory().
00108       //
00109       DWORD dwAutoAllocate = SCARD_AUTOALLOCATE;
00110
00111       lResult = SCardListReaders(hContext,
00112                                  SCARD_DEFAULT_READERS,
00113                                  (LPTSTR) &mszReaderNames,
00114                                  &dwAutoAllocate);
00115       if (lResult != SCARD_S_SUCCESS)
00116       {
00117          __leave;
00118       }
00119
00120       //
00121       // Propagate all digital certificate(s) found in all reader(s) to the
00122       // local "My" store.
00123       //
00124       lResult = SCardPropCert(hContext, mszReaderNames, _T("My"));
00125    }
00126
00127    __finally
00128    {
00129       LONG lReturn;
00130
00131       //
00132       // Don't forget to free resources, if allocated.
00133       //
00134       if (mszReaderNames != NULL)
00135       {
00136          lReturn = SCardFreeMemory(hContext, (LPVOID) mszReaderNames);
00137
00138          //
00139          // If successful so far, then capture the return code
00140          // from SCFree(); otherwise, don't bother.
00141          //
00142          if (lResult == SCARD_S_SUCCESS)
00143          {
00144             lResult = lReturn;
00145          }
00146       }
00147
00148       if (hContext != NULL)
00149       {
00150          lReturn = SCardReleaseContext(hContext);
00151
00152          //
00153          // If successful so far, then capture the SCardReleaseContext()
00154          // return code; otherwise, don't bother.
00155          //
00156          if (lResult == SCARD_S_SUCCESS)
00157          {
00158             lResult = lReturn;
00159          }
00160       }
00161    }
00162
00163    //
00164    // Inform user if an error had occurred.
00165    //
00166    if (lResult != SCARD_S_SUCCESS)
00167    {
00168       _tprintf(_T("\nError [0x%x]: Program terminated abnormally.\n"), lResult);
00169    }
00170
00171    return lResult;
00172 }
00173
00174
00175 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00176
00177  Function : SCardPropCert
00178
00179  Synopsis : Propagate the digital certificate from any smart card found in the
00180             specified reader(s) to the specified local store.
00181
00182  Parameter: - IN SCARDCONTEXT hContext
00183
00184               Resource manager context returned by SCardEstablishContext(), or
00185               NULL if the query is not directed towards a specific context.
00186
00187             - IN LPCTSTR mszReaderNames
00188
00189               Pointer to multi-string structure of reader names for which the
00190               digital certificate in the smart card, if found,  will be
00191               propagated to the specified local store.
00192
00193             - IN szStoreName
00194
00195               Ponter to the local store name (ie "My") where the certificate
00196               will be stored.
00197
00198  Return   : SCARD_S_SUCCESS or error code
00199
00200  Remarks  :
00201
00202 ------------------------------------------------------------------------------*/
00203
00204 LONG SCardPropCert (IN SCARDCONTEXT hContext,
00205                     IN LPCTSTR mszReaderNames,
00206                     IN LPCTSTR szStoreName)
00207 {
00208    LONG lResult;
00209    LPSCARD_READERSTATE lpReaderStates = NULL;
00210
00211    //
00212    // Make sure pointer parameters are not NULL.
00213    //
00214    if (mszReaderNames == NULL || szStoreName == NULL)
00215    {
00216       return SCARD_E_INVALID_PARAMETER;
00217    }
00218
00219    __try
00220    {
00221       DWORD dwNumReaders;
00222       LPCTSTR szReaderName;
00223
00224       //
00225       // Count number of readers.
00226       //
00227       for (dwNumReaders = 0, szReaderName = mszReaderNames;
00228            *szReaderName != _T('\0');
00229            dwNumReaders++)
00230       {
00231          szReaderName += lstrlen(szReaderName) + 1;
00232       }
00233
00234       //
00235       // Allocate memory for SCARD_READERSTATE array.
00236       //
00237       lpReaderStates = (LPSCARD_READERSTATE)
00238                        MALLOC(dwNumReaders * sizeof(SCARD_READERSTATE));
00239       if (lpReaderStates == NULL)
00240       {
00241          lResult = SCARD_E_NO_MEMORY;
00242          __leave;
00243       }
00244
00245       //
00246       // Prepare state array.
00247       //
00248       ZeroMemory((LPVOID) lpReaderStates,
00249                  dwNumReaders * sizeof(SCARD_READERSTATE));
00250
00251       DWORD i;
00252       for (i = 0, szReaderName = mszReaderNames;
00253            i < dwNumReaders;
00254            i++)
00255       {
00256          lpReaderStates[i].szReader = (LPCTSTR) szReaderName;
00257          lpReaderStates[i].dwCurrentState = SCARD_STATE_UNAWARE;
00258
00259          szReaderName += lstrlen(szReaderName) + 1;
00260       }
00261
00262       //
00263       // Initialize card status.
00264       //
00265       lResult = SCardGetStatusChange(hContext,
00266                                      INFINITE,
00267                                      lpReaderStates,
00268                                      dwNumReaders);
00269       if (lResult != SCARD_S_SUCCESS)
00270       {
00271          __leave;
00272       }
00273
00274       //
00275       // For each card found, find the proper CSP and propagate the
00276       // certificate(s) to the specified local store.
00277       //
00278       for (i = 0; i < dwNumReaders && lResult == SCARD_S_SUCCESS; i++)
00279       {
00280          DWORD dwAutoAllocate;
00281          LPTSTR szCardName = NULL;
00282          LPTSTR szCSPName = NULL;
00283          LPTSTR szContainerName = NULL;
00284          HCRYPTPROV hCryptProv = NULL;
00285
00286          __try
00287          {
00288             //
00289             // Card in this reader?
00290             //
00291             if (!(lpReaderStates[i].dwEventState & SCARD_STATE_PRESENT))
00292             {
00293                //
00294                // No card in this reader.
00295                //
00296                continue;
00297             }
00298
00299             //
00300             // Get card name.
00301             //
00302             dwAutoAllocate = SCARD_AUTOALLOCATE;
00303             lResult = SCardListCards(hContext,
00304                                      lpReaderStates[i].rgbAtr,
00305                                      NULL,
00306                                      0,
00307                                      (LPTSTR) &szCardName,
00308                                      &dwAutoAllocate);
00309             if (lResult != SCARD_S_SUCCESS)
00310             {
00311                __leave;
00312             }
00313
00314             //
00315             // Get card's CSP name.
00316             //
00317
00318             //
00319             // Note: SCardGetCardTypeProviderName is not available
00320             //       in Smart Card Base Component v1.0. Please see
00321             //       ReadMe.txt for more information.
00322             //
00323             dwAutoAllocate = SCARD_AUTOALLOCATE;
00324             lResult = SCardGetCardTypeProviderName(hContext,
00325                                                    szCardName,
00326                                                    SCARD_PROVIDER_CSP,
00327                                                    (LPTSTR) &szCSPName,
00328                                                    &dwAutoAllocate);
00329             if (lResult != SCARD_S_SUCCESS)
00330             {
00331                __leave;
00332             }
00333
00334             //
00335             // Prepare fully qualified container name.
00336             //
00337             szContainerName = (LPTSTR) MALLOC((sizeof(_T("\\\\.\\")) +
00338                               lstrlen(lpReaderStates[i].szReader) +
00339                               sizeof(_T("\\\0"))) * sizeof(TCHAR));
00340
00341             if (szContainerName == NULL)
00342             {
00343                lResult = SCARD_E_NO_MEMORY;
00344                __leave;
00345             }
00346
00347             wsprintf(szContainerName, _T("\\\\.\\%s\\"),
00348                      lpReaderStates[i].szReader);
00349
00350             //
00351             // Obtain the crypto context.
00352                         //
00353                         // CRYPT_SILENT forces the CSP to raise no UI. The fully qualified
00354                         // container name indicates which reader to connect to, so the
00355                         // user should not be prompted to insert or select a card.
00356             //
00357             if (!CryptAcquireContext(&hCryptProv,
00358                                      szContainerName,
00359                                      szCSPName,
00360                                      PROV_RSA_FULL,
00361                                      CRYPT_SILENT))
00362             {
00363                lResult = GetLastError();
00364                __leave;
00365             }
00366
00367             //
00368             // Propagate the cert.
00369             //
00370             lResult = CryptPropCert(hCryptProv,
00371                                     szCSPName,
00372                                     szStoreName);
00373          }
00374
00375          __finally
00376          {
00377             LONG lReturn;
00378
00379             //
00380             // Don't forget to free resources, if allocated.
00381             //
00382             if (hCryptProv != NULL)
00383             {
00384                if (!CryptReleaseContext(hCryptProv, 0))
00385                {
00386                   if (lResult == SCARD_S_SUCCESS)
00387                   {
00388                      lResult = GetLastError();
00389                   }
00390                }
00391             }
00392
00393             if (szContainerName != NULL)
00394             {
00395                FREE((LPVOID) szContainerName);
00396             }
00397
00398             if (szCSPName != NULL)
00399             {
00400                lReturn = SCardFreeMemory(hContext, (LPVOID) szCSPName);
00401                if (lResult == SCARD_S_SUCCESS)
00402                {
00403                   lResult = lReturn;
00404                }
00405             }
00406
00407             if (szCardName != NULL)
00408             {
00409                lReturn = SCardFreeMemory(hContext, (LPVOID) szCardName);
00410                if (lResult == SCARD_S_SUCCESS)
00411                {
00412                   lResult = lReturn;
00413                }
00414             }
00415          }
00416       }
00417    }
00418
00419    __finally
00420    {
00421       //
00422       // Don't forget to free resources, if allocated.
00423       //
00424       if (lpReaderStates != NULL)
00425       {
00426          FREE((LPVOID) lpReaderStates);
00427       }
00428    }
00429
00430    return lResult;
00431 }
00432
00433
00434 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00435
00436  Function : CryptPropCert
00437
00438  Synopsis : Propagate the digital certificate associated with the specified
00439             crypto context to the specified local store.
00440
00441  Parameter: - IN HCRYPTPROV hCryptProv
00442
00443               Crypto context returned by CryptAcquireContext().
00444
00445             - IN LPCTSTR szCSPName
00446
00447               Pointer to Crypto Service Provider name string.
00448
00449             - IN szStoreName
00450
00451               Ponter to the local store name (ie "My") where the certificate
00452               will be stored.
00453
00454  Return   : SCARD_S_SUCCESS or error code
00455
00456  Remarks  :
00457
00458 ------------------------------------------------------------------------------*/
00459
00460 LONG CryptPropCert (IN HCRYPTPROV hCryptProv,
00461                     IN LPCTSTR szCSPName,
00462                     IN LPCTSTR szStoreName)
00463 {
00464    LONG lResult;
00465    LPCTSTR szContainerName = NULL;
00466
00467    //
00468    // Make sure pointer parameters are not NULL.
00469    //
00470    if (szCSPName == NULL || szStoreName == NULL)
00471    {
00472       return SCARD_E_INVALID_PARAMETER;
00473    }
00474
00475    __try
00476    {
00477       //
00478       // Query length of key container name.
00479       //
00480       DWORD cbContainerName = 0;
00481
00482       if (!CryptGetProvParam(hCryptProv,
00483                              PP_CONTAINER,
00484                              NULL,  // NULL to query container name length
00485                              &cbContainerName,
00486                              0))
00487       {
00488          lResult = GetLastError();
00489          __leave;
00490       }
00491
00492       //
00493       // Allocate memory for key container name.
00494       //
00495       szContainerName = (LPCTSTR) MALLOC(cbContainerName);
00496
00497       //
00498       // Now get the key container name.
00499       //
00500       if (!CryptGetProvParam(hCryptProv,
00501                              PP_CONTAINER,
00502                              (PBYTE) szContainerName,
00503                              &cbContainerName,
00504                              0))
00505       {
00506          lResult = GetLastError();
00507          __leave;
00508       }
00509
00510       //
00511       // For each key pair found in the smart card, store the corresponding
00512       // digital certificate to the specified local store.
00513       //
00514       const DWORD rgdwKeys[] = {AT_KEYEXCHANGE, AT_SIGNATURE};
00515       const DWORD cdwKeys = sizeof(rgdwKeys) / sizeof(rgdwKeys[0]);
00516
00517       for (DWORD i = 0; i < cdwKeys; i++)
00518       {
00519          DWORD dwCertLength = 0;
00520          LPBYTE lpbCert = NULL;
00521
00522          LPWSTR wszCertFriendlyName = NULL;
00523          LPWSTR wszContainerName = NULL;
00524          LPWSTR wszCSPName = NULL;
00525          LPWSTR wszStoreName = NULL;
00526
00527          __try
00528          {
00529             //
00530             // Get the certificate data.
00531             //
00532             lResult = GetCert(hCryptProv,
00533                               rgdwKeys[i],
00534                               &lpbCert,
00535                               &dwCertLength);
00536             if (lResult != SCARD_S_SUCCESS)
00537             {
00538                if (lResult == NTE_NO_KEY)
00539                {
00540                   //
00541                   // We are OK if there is no key of such type.
00542                   // It means there is nothing to do.
00543                   //
00544                   lResult = SCARD_S_SUCCESS;
00545                }
00546
00547                __leave;
00548             }
00549
00550             //
00551             // Allocate memory for UNICODE strings.
00552             //
00553             TCHAR szCertFriendlyName[] = "";
00554             DWORD cchCertFriendlyName = (lstrlen(szCertFriendlyName) + 1)
00555                                         * sizeof(WCHAR);
00556             DWORD cchContainerName = (lstrlen(szContainerName) + 1)
00557                                      * sizeof(WCHAR);
00558             DWORD cchCSPName = (lstrlen(szCSPName) + 1) * sizeof(WCHAR);
00559             DWORD cchStoreName = (lstrlen(szStoreName) + 1) * sizeof(WCHAR);
00560
00561             wszCertFriendlyName = (LPWSTR) MALLOC(cchCertFriendlyName);
00562             wszContainerName = (LPWSTR) MALLOC(cchContainerName);
00563             wszCSPName = (LPWSTR) MALLOC(cchCSPName);
00564             wszStoreName = (LPWSTR) MALLOC(cchStoreName);
00565
00566             if (wszCertFriendlyName == NULL ||
00567                 wszContainerName == NULL ||
00568                 wszCSPName == NULL ||
00569                 wszStoreName == NULL)
00570             {
00571                lResult = SCARD_E_NO_MEMORY;
00572                __leave;
00573             }
00574
00575             //
00576             // Setup UNICODE strings.
00577             //
00578 #ifdef _UNICODE
00579             lstrcpy(wszCertFriendlyName, szCertFriendlyName);
00580             lstrcpy(wszContainerName, szContainerName);
00581             lstrcpy(wszCSPName, szCSPName);
00582             lstrcpy(wszStoreName, szStoreName);
00583 #else
00584             mbstowcs(wszCertFriendlyName, szCertFriendlyName,
00585                      cchCertFriendlyName);
00586             mbstowcs(wszContainerName, szContainerName, cchContainerName);
00587             mbstowcs(wszCSPName, szCSPName, cchCSPName);
00588             mbstowcs(wszStoreName, szStoreName, cchStoreName);
00589 #endif
00590             //
00591             // Add the certificate to the specified local store.
00592             //
00593             lResult = AddCert(hCryptProv,
00594                               lpbCert,
00595                               dwCertLength,
00596                               rgdwKeys[i],
00597                               wszCertFriendlyName,
00598                               wszContainerName,
00599                               wszCSPName,
00600                               wszStoreName);
00601             if (lResult != SCARD_S_SUCCESS)
00602             {
00603                __leave;
00604             }
00605             else
00606             {
00607         _tprintf(
00608           _T("\nPropagated cert from %s to \"%s\" certificate store.\n"),
00609           szCSPName,
00610           szStoreName);
00611       }
00612          }
00613
00614          __finally
00615          {
00616             //
00617             // Don't forget to free resources, if allocated.
00618             //
00619             if (lpbCert != NULL)
00620             {
00621                FREE(lpbCert);
00622             }
00623
00624             if (wszCertFriendlyName != NULL)
00625             {
00626                FREE(wszCertFriendlyName);
00627             }
00628
00629             if (wszContainerName != NULL)
00630             {
00631                FREE(wszContainerName);
00632             }
00633
00634             if (wszCSPName != NULL)
00635             {
00636                FREE(wszCSPName);
00637             }
00638
00639             if (wszStoreName != NULL)
00640             {
00641                FREE(wszStoreName);
00642             }
00643
00644             if (lResult != SCARD_S_SUCCESS)
00645             {
00646                __leave;
00647             }
00648          }
00649       }
00650    }
00651
00652    __finally
00653    {
00654       //
00655       // Don't forget to free resources, if allocated.
00656       //
00657       if (szContainerName != NULL)
00658       {
00659          FREE(szContainerName);
00660       }
00661    }
00662
00663    return lResult;
00664 }
00665
00666
00667 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00668
00669  Function : GetCert
00670
00671  Synopsis : Get the cert from the specified CSP for the specified key type.
00672
00673  Parameter: - IN HCRYPTPROV hCryptProv
00674
00675               Crypto context returned by CryptAcquireContext().
00676
00677             - IN DWORD dwKeySpec
00678
00679               AT_KEYEXCHANGZE or AT_SIGNATURE.
00680
00681             - OUT LPBYTE * lplpbCert
00682
00683               Ponter to pointer to cert data. Upon success, the buffer is
00684               automatically allocated and must be later freed by LocalFree().
00685
00686             - OUT DWORD * lpdwCertLength
00687
00688               Pointer to cert data length. Upon success, receive the length
00689               of the cert data.
00690
00691  Return   : SCARD_S_SUCCESS or error code
00692
00693  Remarks  :
00694
00695 ------------------------------------------------------------------------------*/
00696
00697 LONG GetCert (IN HCRYPTPROV hCryptProv,
00698               IN DWORD dwKeySpec,
00699               OUT LPBYTE * lplpbCert,
00700               OUT DWORD * lpdwCertLength)
00701 {
00702    LONG lResult = SCARD_S_SUCCESS;
00703    HCRYPTKEY hCryptKey = NULL;
00704    LPBYTE lpbCert = NULL;
00705    DWORD dwCertLength = 0;
00706
00707    //
00708    // Make sure pointer parameters are not NULL.
00709    //
00710    if (lplpbCert == NULL || lpdwCertLength == NULL)
00711    {
00712       return SCARD_E_INVALID_PARAMETER;
00713    }
00714
00715    __try
00716    {
00717       //
00718       // Get key handle.
00719       //
00720       if (!CryptGetUserKey(hCryptProv, dwKeySpec, &hCryptKey))
00721       {
00722          lResult = GetLastError();
00723          __leave;
00724       }
00725
00726       //
00727       // Query certificate data length.
00728       //
00729       if (!CryptGetKeyParam(hCryptKey,
00730                             KP_CERTIFICATE,
00731                             NULL,  // NULL to query certificate data length
00732                             &dwCertLength,
00733                             0))
00734       {
00735          //
00736          // We expect ERROR_MORE_DATA. If that's not the case, then
00737          // something is not right.
00738          //
00739          lResult = GetLastError();
00740          if (lResult == ERROR_MORE_DATA)
00741          {
00742             lResult = SCARD_S_SUCCESS;
00743          }
00744          else
00745          {
00746             __leave;
00747          }
00748       }
00749
00750       //
00751       // Allocate memory for certificate data.
00752       //
00753       lpbCert = (LPBYTE) MALLOC(dwCertLength);
00754       if (lpbCert == NULL)
00755       {
00756          lResult = SCARD_E_NO_MEMORY;
00757          __leave;
00758       }
00759
00760       //
00761       // Now read the certificate data.
00762       //
00763       if (!CryptGetKeyParam(hCryptKey,
00764                             KP_CERTIFICATE,
00765                             lpbCert,
00766                             &dwCertLength,
00767                             0))
00768       {
00769          lResult = GetLastError();
00770          __leave;
00771       }
00772    }
00773
00774    __finally
00775    {
00776       //
00777       // Don't forget to free resources, if allocated.
00778       //
00779       if (lResult == SCARD_S_SUCCESS)
00780       {
00781          *lplpbCert = lpbCert;
00782          *lpdwCertLength = dwCertLength;
00783       }
00784       else if (lpbCert != NULL)
00785       {
00786          FREE(lpbCert);
00787       }
00788
00789       if (hCryptKey != NULL)
00790       {
00791          if (!CryptDestroyKey(hCryptKey))
00792          {
00793             if (lResult == SCARD_S_SUCCESS)
00794             {
00795                lResult = GetLastError();
00796             }
00797          }
00798       }
00799    }
00800
00801    return lResult;
00802 }
00803
00804
00805 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00806
00807  Function : AddCert
00808
00809  Synopsis : Add the specified certificate to the specified local store.
00810
00811  Parameter: - IN HCRYPTPROV hCryptProv
00812
00813               Crypto context returned by CryptAcquireContext().
00814
00815             - IN LPBYTE * lpbCert
00816
00817               Pointer to cert data to be added.
00818
00819             - IN DWORD dwCertLength
00820
00821               Length of cert data.
00822
00823             - IN DWORD dwKeySpec
00824
00825               AT_KEYEXCHANGZE or AT_SIGNATURE.
00826
00827  Return   : SCARD_S_SUCCESS or error code
00828
00829  Remarks  :
00830
00831 ------------------------------------------------------------------------------*/
00832
00833 LONG AddCert (IN HCRYPTPROV hCryptProv,
00834               IN LPBYTE lpbCert,
00835               IN DWORD dwCertLength,
00836               IN DWORD dwKeySpec,
00837               IN LPCWSTR wszCertFriendlyName,
00838               IN LPCWSTR wszContainerName,
00839               IN LPCWSTR wszCSPName,
00840               IN LPCWSTR wszStoreName)
00841 {
00842    LONG lResult = SCARD_S_SUCCESS;
00843    HCERTSTORE hCertStore = NULL;
00844    PCCERT_CONTEXT pCertContext = NULL;
00845
00846    //
00847    // Make sure pointer parameters are not NULL.
00848    //
00849    if (lpbCert == NULL ||
00850        wszContainerName == NULL ||
00851        wszCSPName == NULL ||
00852        wszStoreName == NULL)
00853    {
00854       return SCARD_E_INVALID_PARAMETER;
00855    }
00856
00857    __try
00858    {
00859       //
00860       // Open the user's specified store for writing.
00861       //
00862       hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_W,
00863                                  0,
00864                                  hCryptProv,
00865                                  CERT_STORE_NO_CRYPT_RELEASE_FLAG |
00866                                  CERT_SYSTEM_STORE_CURRENT_USER,
00867                                  wszStoreName);
00868       if (NULL == hCertStore)
00869       {
00870          lResult = GetLastError();
00871          __leave;
00872       }
00873
00874       //
00875       // Build certificate context for this certificate.
00876       //
00877       pCertContext = CertCreateCertificateContext(X509_ASN_ENCODING,
00878                                                   lpbCert,
00879                                                   dwCertLength);
00880       if (pCertContext == NULL)
00881       {
00882          lResult = GetLastError();
00883          __leave;
00884       }
00885
00886       //
00887       // Add the friendly name, if provided.
00888       //
00889       if (wszCertFriendlyName != NULL)
00890       {
00891          CRYPT_DATA_BLOB DataBlob;
00892
00893          ZeroMemory((PVOID)&DataBlob, sizeof(CRYPT_DATA_BLOB));
00894
00895          DataBlob.cbData = (wcslen(wszCertFriendlyName) + 1) * sizeof(WCHAR);
00896          DataBlob.pbData = (LPBYTE) wszCertFriendlyName;
00897
00898          if (!CertSetCertificateContextProperty(pCertContext,
00899                                                 CERT_FRIENDLY_NAME_PROP_ID,
00900                                                 0,
00901                                                 (const void *) &DataBlob))
00902          {
00903             lResult = GetLastError();
00904             __leave;
00905          }
00906       }
00907
00908       //
00909       // Add the CSP & key container info. This is used by CAPI to load the
00910       // CSP and find the keyset when the user indicates this certificate.
00911       //
00912       CRYPT_KEY_PROV_INFO KeyProvInfo;
00913
00914       ZeroMemory((PVOID)&KeyProvInfo, sizeof(CRYPT_KEY_PROV_INFO));
00915
00916       KeyProvInfo.pwszContainerName = (LPWSTR) wszContainerName;
00917       KeyProvInfo.pwszProvName      = (LPWSTR) wszCSPName;
00918       KeyProvInfo.dwProvType        = PROV_RSA_FULL;
00919       KeyProvInfo.dwFlags           = 0;
00920       KeyProvInfo.dwKeySpec         = dwKeySpec;
00921
00922       if (!CertSetCertificateContextProperty(pCertContext,
00923                                              CERT_KEY_PROV_INFO_PROP_ID,
00924                                              0,
00925                                              (const void *) &KeyProvInfo))
00926       {
00927          lResult = GetLastError();
00928          __leave;
00929       }
00930
00931       //
00932       // Put the cert in the store!
00933       //
00934       if (!CertAddCertificateContextToStore(hCertStore,
00935                                             pCertContext,
00936                                             CERT_STORE_ADD_REPLACE_EXISTING,
00937                                             // or CERT_STORE_ADD_NEW
00938                                             NULL))
00939       {
00940          lResult = GetLastError();
00941          __leave;
00942       }
00943    }
00944
00945    __finally
00946    {
00947       //
00948       // Don't forget to free resources, if allocated.
00949       //
00950       if (pCertContext != NULL)
00951       {
00952          CertFreeCertificateContext(pCertContext);
00953       }
00954
00955       if (hCertStore != NULL)
00956       {
00957          CertCloseStore(hCertStore, CERT_CLOSE_STORE_FORCE_FLAG);
00958       }
00959    }
00960
00961    return lResult;
00962 }
00963
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcUser.Cpp Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcUser.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 - 2000 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 // Machine generated IDispatch wrapper class(es) created with ClassWizard
00045
00046 #include "stdafx.h"
00047 #include "ACUser.h"
00048
00049 #ifdef _DEBUG
00050 #define new DEBUG_NEW
00051 #undef THIS_FILE
00052 static char THIS_FILE[] = __FILE__;
00053 #endif
00054
00055
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // CAgentCtlUserInput properties
00059
00060 /////////////////////////////////////////////////////////////////////////////
00061 // CAgentCtlUserInput operations
00062
00063 short CAgentCtlUserInput::GetCount()
00064 {
00065   short result;
00066   InvokeHelper(0x60020000, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00067   return result;
00068 }
00069
00070 CString CAgentCtlUserInput::GetName()
00071 {
00072   CString result;
00073   InvokeHelper(0x60020001, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00074   return result;
00075 }
00076
00077 CString CAgentCtlUserInput::GetCharacterID()
00078 {
00079   CString result;
00080   InvokeHelper(0x60020002, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00081   return result;
00082 }
00083
00084 long CAgentCtlUserInput::GetConfidence()
00085 {
00086   long result;
00087   InvokeHelper(0x60020003, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00088   return result;
00089 }
00090
00091 CString CAgentCtlUserInput::GetVoice()
00092 {
00093   CString result;
00094   InvokeHelper(0x60020004, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00095   return result;
00096 }
00097
00098 CString CAgentCtlUserInput::GetAlt1Name()
00099 {
00100   CString result;
00101   InvokeHelper(0x60020005, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00102   return result;
00103 }
00104
00105 long CAgentCtlUserInput::GetAlt1Confidence()
00106 {
00107   long result;
00108   InvokeHelper(0x60020006, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00109   return result;
00110 }
00111
00112 CString CAgentCtlUserInput::GetAlt1Voice()
00113 {
00114   CString result;
00115   InvokeHelper(0x60020007, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00116   return result;
00117 }
00118
00119 CString CAgentCtlUserInput::GetAlt2Name()
00120 {
00121   CString result;
00122   InvokeHelper(0x60020008, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00123   return result;
00124 }
00125
00126 long CAgentCtlUserInput::GetAlt2Confidence()
00127 {
00128   long result;
00129   InvokeHelper(0x60020009, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00130   return result;
00131 }
00132
00133 CString CAgentCtlUserInput::GetAlt2Voice()
00134 {
00135   CString result;
00136   InvokeHelper(0x6002000a, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00137   return result;
00138 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_BUFFER Member List

This is the complete list of members for _BUFFER, including all inherited members.
cLen | _BUFFER
pBuf | _BUFFER
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpwizard/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpwizard

resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       resource.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by SCPWizard.rc
00014 //
00015 #define IDD_SCP_GENERAL_PAGE            102
00016 #define IDD_SCP_PAGE_GENERAL            102
00017 #define IDD_SCP_PAGE_KEYWORDS           106
00018 #define IDD_SCP_KEYWORDS_PAGE           107
00019 #define IDD_SCP_PAGE_BINDING_INFO       107
00020 #define IDC_DNS_NAME_EDIT               1001
00021 #define IDC_BINDING_INFO_EDIT           1002
00022 #define IDC_DESCRIPTION_EDIT            1003
00023 #define IDC_SERVICE_CLASS_EDIT          1004
00024 #define IDC_VENDOR_NAME_EDIT            1005
00025 #define IDC_STATIC_ICON                 1005
00026 #define IDC_VENDOR_GUID_EDIT            1006
00027 #define IDC_EDIT_CONTAINER              1006
00028 #define IDC_PRODUCT_NAME_EDIT           1007
00029 #define IDC_PRODUCT_GUID_EDIT           1008
00030 #define IDC_PRODUCT_VERSION_EDIT        1009
00031 #define IDC_VERSION_GUIO_EDIT           1010
00032 #define IDC_KEYWORD_EDIT                1011
00033 #define IDC_KEYWORD_LIST                1012
00034 #define IDC_ADD_BUTTON                  1013
00035 #define IDC_EDIT_BUTTON                 1015
00036 #define IDC_DELETE_BUTTON               1016
00037 #define IDC_NAME_EDIT                   1017
00038 #define IDC_DNS_NAME_TYPE_EDIT          1018
00039
00040 // Next default values for new objects
00041 //
00042 #ifdef APSTUDIO_INVOKED
00043 #ifndef APSTUDIO_READONLY_SYMBOLS
00044 #define _APS_NEXT_RESOURCE_VALUE        104
00045 #define _APS_NEXT_COMMAND_VALUE         40001
00046 #define _APS_NEXT_CONTROL_VALUE         1019
00047 #define _APS_NEXT_SYMED_VALUE           101
00048 #endif
00049 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/about.Cxx Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

about.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       about.cxx
00007 //
00008 //  Contents:   implementation for a simple about dialog box
00009 //
00010 //  Classes:    CAbout
00011 //
00012 //  Functions:
00013 //
00014 //  History:    6-08-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include "about.h"
00020
00021
00022 //+---------------------------------------------------------------------------
00023 //
00024 //  Member:     CAbout::DialogProc
00025 //
00026 //  Synopsis:   dialog proc for the About dialog box
00027 //
00028 //  Arguments:  [uMsg]   - message
00029 //              [wParam] - first message parameter
00030 //              [lParam] - second message parameter
00031 //
00032 //  History:    4-12-94   stevebl   Created for MFract
00033 //              6-08-94   stevebl   Stolen from MFract
00034 //
00035 //----------------------------------------------------------------------------
00036
00037 BOOL CAbout::DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00038 {
00039     switch (uMsg)
00040     {
00041     case WM_INITDIALOG:
00042         return(TRUE);
00043     case WM_COMMAND:
00044         if (LOWORD(wParam) == IDOK
00045             || LOWORD(wParam) == IDCANCEL)
00046         {
00047             EndDialog(hwndDlg, TRUE);
00048             return(TRUE);
00049         }
00050     }
00051     return(FALSE);
00052 }
00053
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/rqs.h Source File

  • NetDS
  • RRas
  • rqs
  • server

rqs.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       Rqs.h
00004 //
00005 //      Synopsis:   Main include for ras quarantine removal utility (server)
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011 #pragma once
00012
00013 #include <winsock2.h>
00014 #include <stdio.h>
00015 #include <stdlib.h>
00016
00017 #include <rasutil.h>
00018 #include <mprapi.h>
00019 #include <rtutils.h>
00020 #include <iprtrmib.h>
00021 #include <iphlpapi.h>
00022 #include <mprerror.h>
00023
00024 #include "rqsmsg.h"
00025 #include "RqsClient.h"
00026 #include "clntlst.h"
00027 #include "RqsConfig.h"
00028 #include "RqsEngine.h"
00029
00030 #define IP1(x) ((x>>24) & 0xff)
00031 #define IP2(x) ((x>>16) & 0xff)
00032 #define IP3(x) ((x>>8) & 0xff)
00033 #define IP4(x) (x & 0xff)
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/QueryDlg.h Source File

  • WinBase
  • WtsApi
  • WtsApi

QueryDlg.h

Go to the documentation of this file.
00001 //  Copyright 1995-1999, Citrix Systems Inc.
00002 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00003 #if !defined(AFX_QUERYDLG_H__4CE42081_334F_11D1_8311_00C04FBEFCDA__INCLUDED_)
00004 #define AFX_QUERYDLG_H__4CE42081_334F_11D1_8311_00C04FBEFCDA__INCLUDED_
00005
00006 #if _MSC_VER >= 1000
00007 #pragma once
00008 #endif // _MSC_VER >= 1000
00009 // QueryDlg.h : header file
00010 //
00011
00012 #include <wtsapi32.h>
00013
00014 #define MAXQUERYITEMS 20
00015
00016 typedef struct _Query {
00017   TCHAR QueryName[25];
00018   WTS_INFO_CLASS InfoClass;
00019 } Query;
00020
00021
00022 /////////////////////////////////////////////////////////////////////////////
00023 // CQueryDlg dialog
00024
00025 class CQueryDlg : public CDialog
00026 {
00027 // Construction
00028 public:
00029   DWORD BytesReturned;
00030   LPTSTR pSessionInfo;
00031   CQueryDlg(CWnd* pParent = NULL);   // standard constructor
00032
00033 // Dialog Data
00034   //{{AFX_DATA(CQueryDlg)
00035   enum { IDD = IDD_QUERY_SESSION };
00036   CEdit m_displayInfo;
00037   CEdit m_serverName;
00038   CListBox m_querySession;
00039   CString m_sessionInfo;
00040   //}}AFX_DATA
00041
00042
00043 // Overrides
00044   // ClassWizard generated virtual function overrides
00045   //{{AFX_VIRTUAL(CQueryDlg)
00046   protected:
00047   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00048   //}}AFX_VIRTUAL
00049
00050 // Implementation
00051 protected:
00052
00053   // Generated message map functions
00054   //{{AFX_MSG(CQueryDlg)
00055   virtual BOOL OnInitDialog();
00056   afx_msg void OnQuery();
00057   virtual void OnCancel();
00058   afx_msg void OnDblclkQuerySession();
00059   //}}AFX_MSG
00060   DECLARE_MESSAGE_MAP()
00061 private:
00062   LPSTR serverName;
00063   HANDLE serverHandle;
00064 };
00065
00066 //{{AFX_INSERT_LOCATION}}
00067 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00068
00069 #endif // !defined(AFX_QUERYDLG_H__4CE42081_334F_11D1_8311_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/RealTimeStylusPlugin/C#/PacketFilterPlugin.cs Source File

  • TabletPC
  • RealTimeStylusPlugin
  • C#

PacketFilterPlugin.cs

Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 //
00003 //  This is part of the Microsoft Tablet PC Platform SDK
00004 //  Copyright (C) 2004 Microsoft Corporation
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00009 //  documentation provided with the Software Development Kit.
00010 //  See these sources for more detailed information.
00011 //
00012 //  File: PacketFilterPlugin.cs
00013 //  Real time stylus plugin that demonstrates packet modification.
00014 //
00015 //  This class implements the real time stylus plugin
00016 //  interface to receive pen input notifications.  It then
00017 //  handles the StylusDown and Packets notifications and
00018 //  constrains all packet data within a user-specified rectangle.
00019 //
00020 //  The features used are: IRealTimeStylusPlugin
00021 //
00022 //--------------------------------------------------------------------------
00023
00024 using System;
00025 using System.Diagnostics;
00026 using System.Drawing;
00027
00028 // The Microsoft Tablet PC namespaces
00029 using Microsoft.Ink;
00030 using Microsoft.StylusInput;
00031 using Microsoft.StylusInput.PluginData;
00032
00033 namespace RealTimeStylusPlugins
00034 {
00035     /// <summary>
00036     /// A real time stylus plugin that demonstrates
00037     /// packet modification.
00038     /// </summary>
00039     public class PacketFilterPlugin:IStylusSyncPlugin
00040     {
00041
00042         // Declare the rectangular area where packets will be restricted
00043         // (in ink space coordinates)
00044         private Rectangle rectangle = Rectangle.Empty;
00045
00046         /// <summary>
00047         /// Constructor for this plugin
00048         /// </summary>
00049         /// <param name="g">
00050         /// The rectangle where packets will be restricted (in ink space coordinates).
00051         /// </param>
00052         public PacketFilterPlugin(Rectangle r)
00053         {
00054             rectangle = r;
00055         }
00056
00057         /// <summary>
00058         /// Helper method that constrains packet data within
00059         /// a specified input rectangle.
00060         /// </summary>
00061         /// <param name="data">The data to modify.</param>
00062         private void ModifyPacketData(StylusDataBase data)
00063         {
00064             // For each packet in the packet data, check whether
00065             // its x,y values fall outside of the specified rectangle.
00066             // If so, replace them with the nearest point that still
00067             // falls within the rectangle.
00068             for (int i = 0; i < data.Count ; i += data.PacketPropertyCount)
00069             {
00070                 // packet data always has x followed by y followed by the rest
00071                 int x = data[i];
00072                 int y = data[i+1];
00073
00074                 // Constrain points to the input rectangle
00075                 x = Math.Max(x, rectangle.Left);
00076                 x = Math.Min(x, rectangle.Right);
00077                 y = Math.Max(y, rectangle.Top);
00078                 y = Math.Min(y, rectangle.Bottom);
00079
00080                 // If necessary, modify the x,y packet data
00081                 if (x != data[i])
00082                 {
00083                     data[i] = x;
00084                 }
00085                 if (y != data[i+1])
00086                 {
00087                     data[i+1] = y;
00088                 }
00089             }
00090         }
00091
00092         /// <summary>
00093         /// Occurs when the stylus touches the digitizer surface.
00094         /// Use this notificaton to constrain the packet data within
00095         /// a specified rectangle.
00096         /// </summary>
00097         /// <param name="sender">The real time stylus associated with the notification</param>
00098         /// <param name="data">The notification data</param>
00099         public void StylusDown(RealTimeStylus sender,  StylusDownData data)
00100         {
00101             ModifyPacketData(data);
00102         }
00103
00104         /// <summary>
00105         /// Occurs when the stylus moves on the digitizer surface.
00106         /// Use this notification to constrain the packet data within a
00107         /// specified rectangle.
00108         /// </summary>
00109         /// <param name="sender">The real time stylus associated with the notification</param>
00110         /// <param name="data">The notification data</param>
00111         public void Packets(RealTimeStylus sender,  PacketsData data)
00112         {
00113             ModifyPacketData(data);
00114         }
00115
00116         /// <summary>
00117         /// Occurs when the stylus leaves the digitizer surface.
00118         /// Use this notification to constrain the packet data within
00119         /// a specified rectangle.
00120         /// </summary>
00121          /// <param name="sender">The real time stylus associated with the notification</param>
00122         /// <param name="data">The notification data</param>
00123         public void StylusUp(RealTimeStylus sender,  StylusUpData data)
00124         {
00125             ModifyPacketData(data);
00126         }
00127
00128         /// <summary>
00129         /// Called when the current plugin or the ones previous in the list
00130         /// threw an exception.
00131         /// </summary>
00132         /// <param name="sender">The real time stylus associated with the notification</param>
00133         /// <param name="data">The notification data</param>
00134   public void Error(RealTimeStylus sender, ErrorData data)
00135         {
00136             Debug.Assert(false, null, "An error occurred.  DataId=" + data.DataId + ", " + "Exception=" + data.InnerException);
00137         }
00138
00139         /// <summary>
00140         /// Defines the types of notifications the plugin is interested in.
00141         /// </summary>
00142         public DataInterestMask DataInterest
00143         {
00144             get
00145             {
00146                 return DataInterestMask.StylusDown |
00147                        DataInterestMask.Packets |
00148                        DataInterestMask.StylusUp |
00149                        DataInterestMask.Error;
00150             }
00151         }
00152
00153         // The remaining interface methods are not used in this sample application.
00154         public void RealTimeStylusDisabled(RealTimeStylus sender, RealTimeStylusDisabledData data) {}
00155         public void RealTimeStylusEnabled(RealTimeStylus sender, RealTimeStylusEnabledData data){}
00156         public void StylusOutOfRange(RealTimeStylus sender, StylusOutOfRangeData data) {}
00157         public void StylusInRange(RealTimeStylus sender, StylusInRangeData data) {}
00158         public void StylusButtonDown(RealTimeStylus sender, StylusButtonDownData data) {}
00159         public void StylusButtonUp(RealTimeStylus sender, StylusButtonUpData data) {}
00160         public void CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data){}
00161         public void SystemGesture(RealTimeStylus sender, SystemGestureData data){}
00162         public void InAirPackets(RealTimeStylus sender, InAirPacketsData data){}
00163         public void TabletAdded(RealTimeStylus sender, TabletAddedData data){}
00164         public void TabletRemoved(RealTimeStylus sender, TabletRemovedData data) {}
00165     }
00166 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cobjtree.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cobjtree.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module COBJECTTREE.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _COBJECTTREE_H_
00012 #define _COBJECTTREE_H_
00013
00014
00015 //////////////////////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020
00021 /////////////////////////////////////////////////////////////////////
00022 // CObjTree
00023 //
00024 /////////////////////////////////////////////////////////////////////
00025 class CObjTree : public CTreeViewLite
00026 {
00027 public:
00028   //constructors
00029   CObjTree(CMainWindow* pCMainWindow);
00030   virtual ~CObjTree();
00031
00032   //messages
00033   virtual BOOL  OnRButtonDown(WPARAM fwKeys, REFPOINTS pts);
00034   virtual BOOL  OnContextMenu(HWND hWnd, REFPOINTS pts);
00035   virtual BOOL  OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData);
00036   virtual BOOL  OnDblclk(WPARAM fwKeys, REFPOINTS pts);
00037
00038   virtual BOOL  OnCommand(UINT iID, HWND hWndCtrl);
00039   virtual BOOL  OnUpdateCommand(HMENU hMenu, UINT nID, DWORD* pdwFlags);
00040
00041   //Helpers
00042   virtual BOOL  AddObject(CBase* pCSource, CBase* pCBase);
00043   virtual BOOL  SelectObject(CBase* pCBase);
00044   virtual CBase*  GetSelectedObject();
00045
00046   virtual BOOL  RemoveObject(CBase* pCBase);
00047   virtual BOOL  RemoveNode(HTREEITEM hTreeItem);
00048   virtual BOOL  GarbageCollectNode(HTREEITEM hTreeItem);
00049
00050   //Data
00051   CMainWindow*  m_pCMainWindow;
00052 };
00053
00054
00055
00056 /////////////////////////////////////////////////////////////////////
00057 // CMDIObjects
00058 //
00059 /////////////////////////////////////////////////////////////////////
00060 class CMDIObjects : public CMDIChildLite
00061 {
00062 public:
00063   //constructors
00064   CMDIObjects(CMainWindow* pCMainWindow);
00065   virtual ~CMDIObjects();
00066
00067   virtual BOOL  PreCreateWindow(CREATESTRUCTW& cs);
00068   virtual BOOL  OnCreate(LPCREATESTRUCT lpCreateStruct);
00069   virtual BOOL  AutoPosition(BOOL fDefaultPosition = TRUE);
00070
00071   virtual BOOL  OnDestroy();
00072   virtual BOOL  OnClose();
00073   virtual BOOL  OnInitialUpdate();
00074   virtual BOOL  OnMDIActivate(BOOL bActivate, HWND hWndActivate, HWND hWndDeactivate);
00075
00076   //members
00077   virtual BOOL  UpdateControls();
00078
00079   //Messages
00080   virtual BOOL  OnSize(WPARAM nType, REFPOINTS pts);
00081   virtual BOOL  OnSetFocus(HWND hWndPrevFocus);
00082
00083   //Overloads
00084   virtual BOOL  OnCommand(UINT iID, HWND hWndCtrl);
00085   virtual BOOL  OnNotify(INT idCtrl, NMHDR* pNMHDR);
00086   virtual BOOL  OnUpdateCommand(HMENU hMenu, UINT nID, DWORD* pdwFlags);
00087
00088   //Data
00089   CMainWindow*  m_pCMainWindow;
00090   CObjTree*   m_pCObjTree;
00091 };
00092
00093
00094 #endif //_OBJECTTREE_H_
Generated on Wed Nov 13 2024 16:52:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030         static TCHAR error[64];
00031
00032         switch (verb) {
00033     case MMC_VERB_NONE:
00034                 return _T("NONE");
00035     case MMC_VERB_OPEN:
00036                 return _T("OPEN");
00037     case MMC_VERB_COPY:
00038                 return _T("COPY");
00039     case MMC_VERB_PASTE:
00040                 return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042                 return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044                 return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046                 return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048                 return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050                 return _T("PRINT");
00051     case MMC_VERB_CUT:
00052                 return _T("CUT");
00053         default:
00054                 wsprintf(error, _T("Unknown verb id %d"), verb);
00055                 return error;
00056         }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061                                 IComponentData *pCompData,
00062                                 IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064                                 LPARAM arg,
00065                                 LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069         TCHAR message[cchMessage] = {0};
00070
00071         if (bComponentData == TRUE)
00072                 OutputDebugString(_T("IComponentData::Notify( "));
00073         else
00074                 OutputDebugString(_T("IComponent::Notify( "));
00075
00076         wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077         OutputDebugString(message);
00078
00079     switch (event)      {
00080                 case MMCN_ACTIVATE:
00081                         wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082                         break;
00083
00084                 case MMCN_ADD_IMAGES:
00085                         wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086                         break;
00087
00088                 case MMCN_BTN_CLICK:
00089                         wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090                         break;
00091
00092                 case MMCN_COLUMN_CLICK:
00093                         wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,       param);
00094                         break;
00095
00096                 case MMCN_COLUMNS_CHANGED:
00097                         wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098                         break;
00099
00100                 case MMCN_CONTEXTHELP:
00101                         wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102                         break;
00103
00104                 case MMCN_CONTEXTMENU:
00105                         wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106                         break;
00107
00108                 case MMCN_CUTORMOVE:
00109                         wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110                         break;
00111
00112                 case MMCN_DBLCLICK:
00113                         wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114                         break;
00115
00116                 case MMCN_DELETE:
00117                         wsprintf(message, _T("MMCN_DELETE\n"));
00118                         break;
00119
00120                 case MMCN_DESELECT_ALL:
00121                         wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122                         break;
00123
00124                 case MMCN_EXPAND:
00125                         wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126                         break;
00127
00128                 case MMCN_EXPANDSYNC:
00129                         wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130                         break;
00131
00132                 case MMCN_FILTERBTN_CLICK:
00133                         wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134                         break;
00135
00136                 case MMCN_FILTER_CHANGE:
00137                         wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138                         break;
00139
00140                 case MMCN_HELP:
00141                         wsprintf(message, _T("MMCN_HELP\n"));
00142                         break;
00143
00144                 case MMCN_INITOCX:
00145                         wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146                         break;
00147
00148                 case MMCN_LISTPAD:
00149                         wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150                         break;
00151
00152                 case MMCN_MENU_BTNCLICK:
00153                         wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154                         break;
00155
00156                 case MMCN_MINIMIZED:
00157                         wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158                         break;
00159
00160                 case MMCN_PASTE:
00161                         wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162                         break;
00163
00164                 case MMCN_PRELOAD:
00165                         wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166                         break;
00167
00168                 case MMCN_PRINT:
00169                         wsprintf(message, _T("MMCN_PRINT\n"));
00170                         break;
00171
00172                 case MMCN_PROPERTY_CHANGE:
00173                         wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174                         break;
00175
00176                 case MMCN_QUERY_PASTE:
00177                         wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178                         break;
00179
00180                 case MMCN_REFRESH:
00181                         wsprintf(message, _T("MMCN_REFRESH\n"));
00182                         break;
00183
00184                 case MMCN_REMOVE_CHILDREN:
00185                         wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186                         break;
00187
00188                 case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192                         StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193                         break;
00194
00195                 case MMCN_RESTORE_VIEW:
00196                         wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197                         break;
00198
00199                 case MMCN_SELECT:
00200                         wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201                         break;
00202
00203                 case MMCN_SHOW:
00204                         wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205                         break;
00206
00207                 case MMCN_SNAPINHELP:
00208                         wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209                         break;
00210
00211                 case MMCN_VIEW_CHANGE:
00212                         wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213                         break;
00214         }
00215
00216         if (message[0] != 0)
00217                 OutputDebugString(message);
00218         else
00219                 OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222         return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/Consumer.h Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

Consumer.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  Consumer.h
00006 //
00007 // Description:
00008 //      Command-line event consumer class definition
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include <wbemcli.h>
00015 #include <wbemprov.h>
00016
00017 class CConsumer : public IWbemUnboundObjectSink
00018 {
00019 public:
00020   CConsumer(CListBox  *pOutputList);
00021   ~CConsumer();
00022
00023     // IUnknown members
00024     STDMETHODIMP         QueryInterface(REFIID, LPVOID *);
00025     STDMETHODIMP_(ULONG) AddRef(void);
00026     STDMETHODIMP_(ULONG) Release(void);
00027
00028   // This routine ultimately receives the event.
00029     STDMETHOD(IndicateToConsumer)(IWbemClassObject *pLogicalConsumer,
00030                   long lNumObjects,
00031                   IWbemClassObject **ppObjects);
00032
00033 private:
00034
00035   DWORD m_cRef;
00036   LPCTSTR ErrorString(HRESULT hRes);
00037   CListBox  *m_pOutputList;
00038 };
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/comp.Cpp Source File

  • SysMgmt
  • MMC
  • CMenu

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 CComponent::CComponent(CComponentData *parent)
00029 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL), m_ipDisplayHelp(NULL)
00030 {
00031     OBJECT_CREATED
00032 }
00033
00034 CComponent::~CComponent()
00035 {
00036     OBJECT_DESTROYED
00037 }
00038
00039 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00040 {
00041     if (!ppv)
00042         return E_FAIL;
00043
00044     *ppv = NULL;
00045
00046     if (IsEqualIID(riid, IID_IUnknown))
00047         *ppv = static_cast<IComponent *>(this);
00048     else if (IsEqualIID(riid, IID_IComponent))
00049         *ppv = static_cast<IComponent *>(this);
00050     else if (IsEqualIID(riid, IID_IExtendContextMenu))
00051         *ppv = static_cast<IExtendContextMenu *>(this);
00052
00053     if (*ppv)
00054     {
00055         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00056         return S_OK;
00057     }
00058
00059     return E_NOINTERFACE;
00060 }
00061
00062 STDMETHODIMP_(ULONG) CComponent::AddRef()
00063 {
00064     return InterlockedIncrement((LONG *)&m_cref);
00065 }
00066
00067 STDMETHODIMP_(ULONG) CComponent::Release()
00068 {
00069     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00070     {
00071         delete this;
00072         return 0;
00073     }
00074     return m_cref;
00075
00076 }
00077
00078 ///////////////////////////////
00079 // Interface IComponent
00080 ///////////////////////////////
00081 STDMETHODIMP CComponent::Initialize(
00082                                     /* [in] */ LPCONSOLE lpConsole)
00083 {
00084     HRESULT hr = S_OK;
00085
00086     // Save away all the interfaces we'll need.
00087     // Fail if we can't QI the required interfaces.
00088
00089     m_ipConsole = lpConsole;
00090     m_ipConsole->AddRef();
00091
00092     hr = m_ipConsole->QueryInterface(IID_IDisplayHelp, (void **)&m_ipDisplayHelp);
00093
00094     return hr;
00095 }
00096
00097 STDMETHODIMP CComponent::Notify(
00098                                 /* [in] */ LPDATAOBJECT lpDataObject,
00099                                 /* [in] */ MMC_NOTIFY_TYPE event,
00100                                 /* [in] */ LPARAM arg,
00101                                 /* [in] */ LPARAM param)
00102 {
00103     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00104
00105     HRESULT hr = S_FALSE;
00106
00107   //Get our data object. If it is NULL, we return with S_FALSE.
00108   //See implementation of GetOurDataObject() to see how to
00109   //handle special data objects.
00110   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00111   if (NULL == pDataObject)
00112     return S_FALSE;
00113
00114   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00115
00116     switch (event)      {
00117     case MMCN_ADD_IMAGES:
00118         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00119         break;
00120
00121     case MMCN_SHOW:
00122         hr = base->OnShow(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00123         break;
00124
00125     case MMCN_CONTEXTHELP:
00126         hr = base->OnShowContextHelp(m_ipDisplayHelp, m_pComponentData->m_HelpFile);
00127         break;
00128     }
00129
00130     return hr;
00131 }
00132
00133 STDMETHODIMP CComponent::Destroy(
00134                                  /* [in] */ MMC_COOKIE cookie)
00135 {
00136     if (m_ipConsole) {
00137         m_ipConsole->Release();
00138         m_ipConsole = NULL;
00139     }
00140
00141     if (m_ipDisplayHelp) {
00142         m_ipDisplayHelp->Release();
00143         m_ipDisplayHelp = NULL;
00144     }
00145
00146     return S_OK;
00147 }
00148
00149
00150 STDMETHODIMP CComponent::QueryDataObject(
00151                                          /* [in] */ MMC_COOKIE cookie,
00152                                          /* [in] */ DATA_OBJECT_TYPES type,
00153                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00154 {
00155     CDataObject *pObj = NULL;
00156
00157     if (cookie == 0)
00158         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00159     else
00160         pObj = new CDataObject(cookie, type);
00161
00162     if (!pObj)
00163         return E_OUTOFMEMORY;
00164
00165     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00166
00167     return S_OK;
00168 }
00169
00170 STDMETHODIMP CComponent::GetResultViewType(
00171                                            /* [in] */ MMC_COOKIE cookie,
00172                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00173                                            /* [out] */ long __RPC_FAR *pViewOptions)
00174 {
00175     CDelegationBase *base = (CDelegationBase *)cookie;
00176
00177     //
00178     // Ask for default listview.
00179     //
00180     if (base == NULL)
00181     {
00182         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00183         *ppViewType = NULL;
00184     }
00185     else
00186         return base->GetResultViewType(ppViewType, pViewOptions);
00187
00188     return S_OK;
00189 }
00190
00191 STDMETHODIMP CComponent::GetDisplayInfo(
00192                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00193 {
00194     HRESULT hr = S_OK;
00195     CDelegationBase *base = NULL;
00196
00197     // if they are asking for the RDI_STR we have one of those to give
00198
00199     if (pResultDataItem->lParam) {
00200         base = (CDelegationBase *)pResultDataItem->lParam;
00201         if (pResultDataItem->mask & RDI_STR) {
00202             LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00203             MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00204             pResultDataItem->str = pszW;
00205         }
00206
00207         if (pResultDataItem->mask & RDI_IMAGE) {
00208             pResultDataItem->nImage = base->GetBitmapIndex();
00209         }
00210     }
00211
00212     return hr;
00213 }
00214
00215
00216 STDMETHODIMP CComponent::CompareObjects(
00217                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00218                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00219 {
00220     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00221     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00222
00223     // compare the object pointers
00224     if (baseA->GetCookie() == baseB->GetCookie())
00225         return S_OK;
00226
00227     return S_FALSE;
00228 }
00229
00230 ///////////////////////////////
00231 // Interface IExtendContextMenu
00232 ///////////////////////////////
00233 HRESULT CComponent::AddMenuItems(
00234                                  /* [in] */ LPDATAOBJECT piDataObject,
00235                                  /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
00236                                  /* [out][in] */ long __RPC_FAR *pInsertionAllowed)
00237 {
00238     CDelegationBase *base = GetOurDataObject(piDataObject)->GetBaseNodeObject();
00239
00240     return base->OnAddMenuItems(piCallback, pInsertionAllowed);
00241 }
00242
00243 HRESULT CComponent::Command(
00244                             /* [in] */ long lCommandID,
00245                             /* [in] */ LPDATAOBJECT piDataObject)
00246 {
00247     CDelegationBase *base = GetOurDataObject(piDataObject)->GetBaseNodeObject();
00248
00249     return base->OnMenuCommand(m_ipConsole, lCommandID);
00250 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_JOB_INFO Member List

This is the complete list of members for _JOB_INFO, including all inherited members.
Branding | _JOB_INFO
CallerId | _JOB_INFO
CallerName | _JOB_INFO
CallerNumber | _JOB_INFO
CallHandle | _JOB_INFO
CompletionKey | _JOB_INFO
CompletionPortHandle | _JOB_INFO
CSI | _JOB_INFO
FileName | _JOB_INFO
JobType | _JOB_INFO
LineHandle | _JOB_INFO
PageCount | _JOB_INFO
pDeviceInfo | _JOB_INFO
ReceiverName | _JOB_INFO
ReceiverNumber | _JOB_INFO
RetryCount | _JOB_INFO
RoutingInfo | _JOB_INFO
Status | _JOB_INFO
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/UtilitiesDlg.Cpp Source File

  • Com
  • Administration
  • Explore.VC

UtilitiesDlg.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 #include "stdafx.h"
00020 #include "VCExplore.h"
00021 #include "UtilitiesDlg.h"
00022
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00030
00031 #define UTILITY_TYPE_UNDEFINED    -1
00032 #define UTILITY_TYPE_ROUTER     0
00033 #define UTILITY_TYPE_JNEC     1
00034
00035 #define UTILITY_OPTION_UNDEFINED  -1
00036 #define UTILITY_OPTION_START    0
00037 #define UTILITY_OPTION_STOP     1
00038 #define UTILITY_OPTION_REFRESH    2
00039
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // CUtilitiesDlg dialog
00043
00044
00045 CUtilitiesDlg::CUtilitiesDlg(CWnd* pParent /*=NULL*/)
00046   : CDialog(CUtilitiesDlg::IDD, pParent)
00047 {
00048   //{{AFX_DATA_INIT(CUtilitiesDlg)
00049     // NOTE: the ClassWizard will add member initialization here
00050   //}}AFX_DATA_INIT
00051
00052   // Set the dialogs icon
00053   m_hIcon = AfxGetApp()->LoadIcon(IDI_UTILITIES);
00054
00055   // Initialize the members
00056   m_pCatalog = NULL;
00057   m_nUtilityType = UTILITY_TYPE_UNDEFINED;
00058   m_nUtilityOption = UTILITY_OPTION_UNDEFINED;
00059 }
00060
00061
00062 void CUtilitiesDlg::DoDataExchange(CDataExchange* pDX)
00063 {
00064   CDialog::DoDataExchange(pDX);
00065   //{{AFX_DATA_MAP(CUtilitiesDlg)
00066     // NOTE: the ClassWizard will add DDX and DDV calls here
00067   //}}AFX_DATA_MAP
00068 }
00069
00070
00071 BEGIN_MESSAGE_MAP(CUtilitiesDlg, CDialog)
00072   //{{AFX_MSG_MAP(CUtilitiesDlg)
00073   ON_WM_CLOSE()
00074   ON_BN_CLICKED(IDC_RADIO_JNEC, OnJNEC)
00075   ON_BN_CLICKED(IDC_RADIO_REFRESH, OnRefresh)
00076   ON_BN_CLICKED(IDC_RADIO_ROUTER, OnRouter)
00077   ON_BN_CLICKED(IDC_RADIO_START, OnStart)
00078   ON_BN_CLICKED(IDC_RADIO_STOP, OnStop)
00079   //}}AFX_MSG_MAP
00080 END_MESSAGE_MAP()
00081
00082 /////////////////////////////////////////////////////////////////////////////
00083 // CUtilitiesDlg message handlers
00084
00085 void CUtilitiesDlg::set_Catalog(ICOMAdminCatalog *pCatalog)
00086 {
00087   // Only can have one Catalog object reference... release all prior references before assignment
00088   ReleaseCatalog();
00089
00090   // Assign the new Catalog reference
00091   m_pCatalog = pCatalog;
00092 }
00093
00094 void CUtilitiesDlg::OnClose()
00095 {
00096   // Release the reference to the Catalog object if needed
00097   ReleaseCatalog();
00098
00099   CDialog::OnClose();
00100 }
00101
00102 BOOL CUtilitiesDlg::OnInitDialog()
00103 {
00104   CDialog::OnInitDialog();
00105
00106   // Setup the dialogs icon resource
00107   SetIcon(m_hIcon, true);   // 32x32 Icon
00108   SetIcon(m_hIcon, false);  // 16x16 Icon
00109
00110   // Check the default radio buttons, set default UI state, and set appropriate member variables
00111   //  used to manage UI state
00112   CheckRadioButton(IDC_RADIO_ROUTER, IDC_RADIO_JNEC, IDC_RADIO_ROUTER);
00113
00114   // Set the import type and description to match the current selection
00115   OnRouter();
00116
00117   // Enable the "Refresh" option
00118   CWnd* pWnd = GetDlgItem(IDC_RADIO_REFRESH);
00119   if (NULL != pWnd)
00120     pWnd->EnableWindow(true);
00121
00122   CheckRadioButton(IDC_RADIO_START, IDC_RADIO_REFRESH, IDC_RADIO_START);
00123   m_nUtilityOption = UTILITY_OPTION_START;
00124
00125   return TRUE;  // return TRUE unless you set the focus to a control
00126                 // EXCEPTION: OCX Property Pages should return FALSE
00127 }
00128
00129 void CUtilitiesDlg::OnJNEC()
00130 {
00131
00132 }
00133
00134 void CUtilitiesDlg::OnRefresh()
00135 {
00136   m_nUtilityOption = UTILITY_OPTION_REFRESH;
00137 }
00138
00139 void CUtilitiesDlg::OnRouter()
00140 {
00141   // Set the utility type
00142   m_nUtilityType = UTILITY_TYPE_ROUTER;
00143
00144   // Enable the "Refresh" option
00145   CWnd* pWnd = GetDlgItem(IDC_RADIO_REFRESH);
00146   if (NULL != pWnd)
00147     pWnd->EnableWindow(true);
00148
00149   // Set default option
00150   CheckRadioButton(IDC_RADIO_START, IDC_RADIO_REFRESH, IDC_RADIO_START);
00151 }
00152
00153 void CUtilitiesDlg::OnStart()
00154 {
00155   m_nUtilityOption = UTILITY_OPTION_START;
00156 }
00157
00158 void CUtilitiesDlg::OnStop()
00159 {
00160   m_nUtilityOption = UTILITY_OPTION_STOP;
00161 }
00162
00163 void CUtilitiesDlg::OnOK()
00164 {
00165   // Continue only if we have a valid Catalog pointer
00166   if (NULL != m_pCatalog)
00167   {
00168     // Perform actions depending upon specified utility type (i.e., router )
00169     switch (m_nUtilityType)
00170     {
00171     case UTILITY_TYPE_ROUTER:
00172       switch (m_nUtilityOption)
00173       {
00174       case UTILITY_OPTION_START:
00175         m_pCatalog->StartRouter();
00176         break;
00177       case UTILITY_OPTION_STOP:
00178         m_pCatalog->StopRouter();
00179         break;
00180       case UTILITY_OPTION_REFRESH:
00181         m_pCatalog->RefreshRouter();
00182         break;
00183       default:
00184         MessageBox("Invalid utility option.\n\nNo processing will be performed.\n\nPress OK to continue.",
00185               "Error",
00186               (MB_OK | MB_ICONERROR));
00187         break;
00188       }
00189       break;
00190     case UTILITY_TYPE_JNEC:
00191       break;
00192
00193     default:
00194       MessageBox("Invalid utility type.\n\nNo processing will be performed.\n\nPress OK to continue.",
00195             "Error",
00196             (MB_OK | MB_ICONERROR));
00197     }
00198   }
00199   else
00200     MessageBox("Invalid Catalog reference.\n\nNo processing will be performed.\n\nPress OK to continue.",
00201           "Error",
00202           (MB_OK | MB_ICONERROR));
00203
00204   // Release the reference to the Catalog object
00205   ReleaseCatalog();
00206
00207   CDialog::OnOK();
00208 }
00209
00210 void CUtilitiesDlg::ReleaseCatalog()
00211 {
00212   // Release the reference to the Catalog object if needed
00213   if (NULL != m_pCatalog)
00214     m_pCatalog->Release();
00215 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Framer/Framer.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Framer

Framer.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /*
00019  * FRAMER.H
00020  * Document Objects Framer
00021  * Definitions of classes, constants, etc.
00022  * Includes in-line implementation of CHourGlass, CWindow
00023  *
00024  */
00025
00026
00027 #ifndef _FRAMER_H_
00028 #define _FRAMER_H_
00029
00030 #define INC_OLE2
00031 #include <docobj.h>
00032
00033
00034 #include <tchar.h>
00035 #ifdef UNICODE
00036 #include <wchar.h>
00037 #endif
00038
00039 extern "C"
00040     {
00041     #include <commdlg.h>
00042     }
00043
00044
00045 #include "resource.h"
00046
00047
00048 //DeleteInterfaceImp calls 'delete' and NULLs the pointer
00049 #define DeleteInterfaceImp(p)\
00050             {\
00051             if (NULL!=p)\
00052                 {\
00053                 delete p;\
00054                 p=NULL;\
00055                 }\
00056             }
00057
00058
00059 //ReleaseInterface calls 'Release' and NULLs the pointer
00060 #define ReleaseInterface(p)\
00061             {\
00062             IUnknown *pt=(IUnknown *)p;\
00063             p=NULL;\
00064             if (NULL!=pt)\
00065                 pt->Release();\
00066             }
00067
00068
00069
00070 class CHourglass;
00071 class CFrame;
00072 class CSite;
00073
00074
00075 /**
00076  ** CFrame encapsulates a main application window
00077  **/
00078
00079 //FRAMEWIN.CPP:  Standard window procedure and AboutProc
00080 LRESULT APIENTRY FrameWndProc(HWND, UINT, WPARAM, LPARAM);
00081 LRESULT APIENTRY ClientWndProc(HWND, UINT, WPARAM, LPARAM);
00082 BOOL    APIENTRY AboutProc(HWND, UINT, WPARAM, LPARAM);
00083
00084 #define CBFRAMEWNDEXTRA     sizeof(LONG)
00085 #define FRAMEWL_STRUCTURE   0
00086
00087 #define CBCLIENTWNDEXTRA    sizeof(LONG)
00088 #define CLIENTWL_STRUCTURE  0
00089
00090 #define SZCLASSFRAME        TEXT("Frame")
00091 #define SZCLASSCLIENT       TEXT("Client")
00092
00093
00094 //FRAME.CPP:  Frame object that creates a main window
00095
00096 class CFrame : public IOleInPlaceFrame, public IOleCommandTarget
00097     {
00098     //Let our window procedure look in our private variables.
00099     friend LRESULT APIENTRY FrameWndProc(HWND, UINT, WPARAM, LPARAM);
00100   friend LRESULT APIENTRY ClientWndProc(HWND, UINT, WPARAM, LPARAM);
00101
00102     protected:
00103         HINSTANCE       m_hInst;            //Task instance
00104         HWND            m_hWnd;             //Window handle of the window
00105         ULONG           m_cRef;
00106
00107         HINSTANCE       m_hInstPrev;        //WinMain parameters
00108         LPTSTR          m_pszCmdLine;
00109         int             m_nCmdShow;
00110
00111         HMENU          *m_phMenu;           //Popup menu handles
00112         HACCEL          m_hAccel;           //Accelerators
00113         HWND            m_hWndClient;       //Client area window
00114
00115         BOOL            m_fInitialized;     //OleInitialize called?
00116         IStorage       *m_pIStorage;        //Temp file for all needs
00117         DWORD           m_dwIDCounter;      //For site IDs
00118
00119         //For menu merging
00120         HMENU           m_hMenuOrg;         //Original menu
00121         HMENU           m_hMenuTop;     //Currently shown menu
00122     HMENU     m_hMenuHelp;    //Special Help menu
00123     BOOL      m_fUsingOurHelp;  //Help menu in use?
00124         BOOL      m_fInObjectHelp;  //Object's menu found?
00125         BOOL            m_fOurMenuShowing;  //Our menu up?
00126
00127         //Other object needs
00128         BOOL            m_fHaveObject;      //For menu enabling
00129     HWND      m_hWndObj;      //UI Active object
00130
00131         class CSite    *m_pSite;            //Site holding object
00132         BORDERWIDTHS    m_bwIP;             //In-place tool allocations
00133         BOOL            m_fInContextHelp;   //In context help mode?
00134
00135         IOleInPlaceActiveObject *m_pIOleIPActiveObject;
00136
00137     protected:
00138         BOOL    RegisterAllClasses(void);
00139         LRESULT OnCommand(HWND, WPARAM, LPARAM);
00140         BOOL    OpenDialog(LPTSTR, UINT);
00141         BOOL    CreateObject(LPTSTR);
00142     void  ResizeClientWindow(UINT, UINT, UINT, UINT);
00143
00144     public:
00145         CFrame(HINSTANCE, HINSTANCE, LPSTR, int);
00146         ~CFrame(void);
00147
00148         inline HINSTANCE Instance(void)
00149           { return m_hInst; }
00150
00151         inline HWND      Window(void)
00152           { return m_hWnd; }
00153
00154         inline HACCEL    Accelerators(void)
00155           { return m_hAccel; }
00156
00157         BOOL    Init(UINT, int, int, int, int);
00158         WPARAM  MessageLoop(void);
00159     void    Close();
00160
00161         //Shared IUnknown implementation
00162         STDMETHODIMP         QueryInterface(REFIID, void **);
00163         STDMETHODIMP_(ULONG) AddRef(void);
00164         STDMETHODIMP_(ULONG) Release(void);
00165
00166     //IOleInPlaceFrame implementation
00167         STDMETHODIMP         GetWindow(HWND *);
00168         STDMETHODIMP         ContextSensitiveHelp(BOOL);
00169         STDMETHODIMP         GetBorder(LPRECT);
00170         STDMETHODIMP         RequestBorderSpace(LPCBORDERWIDTHS);
00171         STDMETHODIMP         SetBorderSpace(LPCBORDERWIDTHS);
00172         STDMETHODIMP         SetActiveObject(LPOLEINPLACEACTIVEOBJECT
00173                                  , LPCOLESTR);
00174         STDMETHODIMP         InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS);
00175         STDMETHODIMP         SetMenu(HMENU, HOLEMENU, HWND);
00176         STDMETHODIMP         RemoveMenus(HMENU);
00177         STDMETHODIMP         SetStatusText(LPCOLESTR);
00178         STDMETHODIMP         EnableModeless(BOOL);
00179         STDMETHODIMP         TranslateAccelerator(LPMSG, WORD);
00180
00181     //IOleCommandTarget
00182         STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds
00183             , OLECMD prgCmds[], OLECMDTEXT *pCmdText);
00184
00185         STDMETHODIMP Exec(const GUID *pguidCmdGroup, DWORD nCmdID
00186             , DWORD nCmdexecopt, VARIANTARG *pvaIn, VARIANTARG *pvaOut);
00187     };
00188
00189
00190 typedef CFrame *PCFrame;
00191
00192
00193
00194 /**
00195  ** CHourglass:  Manages the hourglass and mouse capture
00196  **/
00197
00198 class CHourglass
00199     {
00200     protected:
00201         HWND            m_hWndCapture;      //Window with capture
00202         HCURSOR         m_hCur;             //Cursor held.
00203
00204     public:
00205         CHourglass(void)
00206             {
00207             m_hCur=SetCursor(LoadCursor(NULL, IDC_WAIT));
00208             m_hWndCapture=NULL;
00209             return;
00210             }
00211
00212         CHourglass(HWND hWnd)
00213             {
00214             m_hCur=SetCursor(LoadCursor(NULL, IDC_WAIT));
00215
00216             if (NULL!=hWnd)
00217                 {
00218                 m_hWndCapture=hWnd;
00219                 SetCapture(hWnd);
00220                 }
00221
00222             return;
00223             }
00224
00225         ~CHourglass(void)
00226             {
00227             if (NULL!=m_hWndCapture)
00228                 ReleaseCapture();
00229
00230             SetCursor(m_hCur);
00231             return;
00232             }
00233     };
00234
00235 typedef CHourglass *PCHourglass;
00236
00237
00238 #include "site.h"
00239
00240 #endif //_FRAMER_H_
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/GenericUCP/CPP/util.cpp Source File

  • NetDS
  • upnp
  • GenericUCP
  • CPP

util.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation
00004
00005
00006 --*/
00007 #include "stdafx.h"
00008 #include "Resource.h"
00009 #include "util.h"
00010 #include <upnp.h> // For the error codes
00011
00012 //+---------------------------------------------------------------------------
00013 //
00014 //  Function: ReleaseObj
00015 //
00016 //  Purpose:    Releases the COM interface pointer
00017 //
00018 //  Arguments:
00019 //        pInterface  [in]  Interface pointer to be released
00020 //
00021 //  Returns:    None
00022 //
00023 //  Notes:
00024 //
00025 //
00026
00027
00028 void ReleaseObj(IUnknown* pInterface){
00029   if(pInterface){
00030     pInterface->Release();
00031   }
00032 }
00033
00034
00035 //+---------------------------------------------------------------------------
00036 //
00037 //  Function: PrintErrorText
00038 //
00039 //  Purpose:    Prints the appropriate error text
00040 //
00041 //  Arguments:
00042 //        hr  [in]  HRESULT to check
00043 //
00044 //  Returns:    None
00045 //
00046 //  Notes:
00047 //        The upnp error codes are from upnp.h
00048 //
00049
00050 void PrintErrorText(HRESULT hr){
00051
00052   // First check whether it is a UPnP error
00053         DWORD dwRet = 0;
00054   TCHAR tszErrorString[1024];
00055   switch(hr){
00056     // All the upnp error codes are from upnp.h
00057     case UPNP_E_ROOT_ELEMENT_EXPECTED:
00058       SafeStrCopy(
00059                             tszErrorString,
00060                             "Root Element Expected",
00061                             1024
00062                             );
00063       break;
00064     case UPNP_E_DEVICE_ELEMENT_EXPECTED:
00065       SafeStrCopy(
00066                             tszErrorString,
00067                             "Device Element Expected",
00068                             1024
00069                             );
00070       break;
00071     case UPNP_E_SERVICE_ELEMENT_EXPECTED:
00072       SafeStrCopy(
00073                             tszErrorString,
00074                             "Service Element Expected",
00075                             1024
00076                             );
00077       break;
00078     case UPNP_E_SERVICE_NODE_INCOMPLETE:
00079       SafeStrCopy(
00080                             tszErrorString,
00081                             "Service Node Incomplete",
00082                             1024
00083                             );
00084       break;
00085     case UPNP_E_DEVICE_NODE_INCOMPLETE:
00086       SafeStrCopy(
00087                             tszErrorString,
00088                             "Device Node Incomplete",
00089                             1024
00090                             );
00091       break;
00092     case UPNP_E_ICON_ELEMENT_EXPECTED:
00093       SafeStrCopy(
00094                             tszErrorString,
00095                             "Icon Element Expected",
00096                             1024
00097                             );
00098       break;
00099     case UPNP_E_ICON_NODE_INCOMPLETE:
00100       SafeStrCopy(
00101                             tszErrorString,
00102                             "Icon Node Incomplete",
00103                             1024
00104                             );
00105       break;
00106     case UPNP_E_INVALID_ACTION:
00107       SafeStrCopy(
00108                            tszErrorString,
00109                            "Invalid Action",
00110                            1024
00111                            );
00112       break;
00113     case UPNP_E_INVALID_ARGUMENTS:
00114       SafeStrCopy(
00115                            tszErrorString,
00116                            "Invalid Arguments",
00117                            1024
00118                            );
00119       break;
00120     case UPNP_E_OUT_OF_SYNC:
00121       SafeStrCopy(
00122                             tszErrorString,
00123                             "Out of Sync",
00124                             1024
00125                             );
00126       break;
00127     case UPNP_E_ACTION_REQUEST_FAILED:
00128       SafeStrCopy(
00129                             tszErrorString,
00130                             "Action Request Failed",
00131                             1024
00132                             );
00133       break;
00134     case UPNP_E_TRANSPORT_ERROR:
00135       SafeStrCopy(
00136                             tszErrorString,
00137                             "Transport Error",
00138                             1024
00139                             );
00140       break;
00141     case UPNP_E_VARIABLE_VALUE_UNKNOWN:
00142       SafeStrCopy(
00143                             tszErrorString,
00144                             "Variable Value Unknown",
00145                             1024
00146                             );
00147       break;
00148     case UPNP_E_INVALID_VARIABLE:
00149       SafeStrCopy(
00150                             tszErrorString,
00151                             "Invalid Variable",
00152                             1024
00153                             );
00154       break;
00155     case UPNP_E_DEVICE_ERROR:
00156       SafeStrCopy(
00157                             tszErrorString,
00158                             "Device Error",
00159                            1024
00160                             );
00161       break;
00162     case UPNP_E_PROTOCOL_ERROR:
00163       SafeStrCopy(
00164                             tszErrorString,
00165                             "Protocol Error",
00166                             1024
00167                             );
00168       break;
00169     case UPNP_E_ERROR_PROCESSING_RESPONSE:
00170       SafeStrCopy(
00171                             tszErrorString,
00172                             "Error Processing Response",
00173                             1024
00174                             );
00175       break;
00176     case UPNP_E_DEVICE_TIMEOUT:
00177       SafeStrCopy(
00178                             tszErrorString,
00179                             "Device Timeout",
00180                             1024
00181                             );
00182       break;
00183     case UPNP_E_INVALID_DOCUMENT:
00184       SafeStrCopy(
00185                             tszErrorString,
00186                             "Invalid Document",
00187                             1024
00188                             );
00189       break;
00190     case UPNP_E_EVENT_SUBSCRIPTION_FAILED:
00191       SafeStrCopy(
00192                             tszErrorString,
00193                             "Event Subscription Failed",
00194                             1024
00195                             );
00196       break;
00197     default:
00198                    if ((hr>=UPNP_E_ACTION_SPECIFIC_BASE) &&
00199                        (hr <= UPNP_E_ACTION_SPECIFIC_MAX))
00200                    {
00201       SafeStrCopy(
00202                             tszErrorString,
00203                             "Action Specific Error",
00204                             1024
00205                             );
00206       break;
00207        }
00208        LPVOID lpMsgBuf = NULL;
00209        dwRet = FormatMessage(
00210                             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00211                             FORMAT_MESSAGE_FROM_SYSTEM |
00212                             FORMAT_MESSAGE_IGNORE_INSERTS,
00213                             NULL,
00214                             GetLastError(),
00215                             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00216                             (LPTSTR) &lpMsgBuf,
00217                             0,
00218                             NULL
00219                             );
00220
00221                         if ( dwRet != 0 )
00222                         {
00223                             // Display the string.
00224                             MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK );
00225
00226                             // Free the buffer.
00227                             LocalFree( lpMsgBuf );
00228                         }
00229
00230       return;
00231   }
00232   MessageBox( NULL, (LPCTSTR)tszErrorString, "Error", MB_OK );
00233 }
00234
00235
00236
00237 //+---------------------------------------------------------------------------
00238 //
00239 //  Function: HrCreateSafeArray
00240 //
00241 //  Purpose:    Creates a SafeArray
00242 //
00243 //  Arguments:
00244 //        vt    [in]  VariantType
00245 //        nArgs [in]  Number of Arguments
00246 //        ppsa  [out] Created safearray
00247 //
00248 //  Returns:    S_OK or E_OUTOFMEMORY
00249 //
00250 //  Notes:
00251 //
00252 //
00253 HRESULT HrCreateSafeArray(VARTYPE vt, int nArgs, SAFEARRAY **ppsa)
00254 {
00255     SAFEARRAYBOUND    aDim[1];
00256     int               nEmpty = 0;
00257
00258   if(0 == nArgs){
00259         aDim[0].lLbound = 0;
00260         aDim[0].cElements = 0;
00261     }
00262     else{
00263         aDim[0].lLbound = 1;
00264         aDim[0].cElements = nArgs;
00265     }
00266
00267     *ppsa = SafeArrayCreate(vt, 1, aDim);
00268     if(NULL == *ppsa){
00269         return E_OUTOFMEMORY;
00270     }
00271
00272     return S_OK;
00273 }
00274
00275 //+---------------------------------------------------------------------------
00276 //
00277 //  Function: HrCreateArgVariants
00278 //
00279 //  Purpose:    Creates argument variants
00280 //
00281 //  Arguments:
00282 //        dwArgs  [in]  Number of arguments
00283 //        pppVars [out] Variant array
00284 //
00285 //  Returns:    S_OK or E_OUTOFMEMORY
00286 //
00287 //  Notes:
00288 //
00289 //
00290
00291
00292 HRESULT HrCreateArgVariants(DWORD dwArgs, VARIANT*** pppVars)
00293 {
00294     HRESULT             hr = S_OK;
00295     DWORD               i = 0;
00296
00297   if(0 == dwArgs){
00298         *pppVars = NULL;
00299         return hr;
00300     }
00301     *pppVars = new VARIANT* [dwArgs];
00302     if(NULL == *pppVars){
00303     return E_OUTOFMEMORY;
00304     }
00305   ZeroMemory(*pppVars, dwArgs*sizeof(VARIANT *));
00306
00307   for(i = 0; i < dwArgs; i++){
00308         (*pppVars)[i] = new VARIANT;
00309         if(NULL == (*pppVars)[i])
00310         {
00311             hr = E_OUTOFMEMORY;
00312             goto error;
00313         }
00314         VariantInit((*pppVars)[i]);
00315     }
00316
00317     goto exit;
00318
00319 error:
00320     for(i = 0; i < dwArgs; i++)
00321     {
00322         if( NULL != (*pppVars)[i] )
00323         {
00324             delete ((*pppVars)[i]);
00325             (*pppVars)[i] = NULL;
00326         }
00327     }
00328     delete [] *pppVars;
00329     *pppVars = NULL;
00330
00331 exit:
00332     return hr;
00333
00334 }
00335
00336
00337
00338 //+---------------------------------------------------------------------------
00339 //
00340 //  Function: HrDestroyArgVariants
00341 //
00342 //  Purpose:    Destroys argument variants
00343 //
00344 //  Arguments:
00345 //        dwArgs  [in]  Number of arguments
00346 //        pppVars [in,out]  Variant array
00347 //
00348 //  Returns:    S_OK
00349 //
00350 //  Notes:
00351 //
00352 //
00353
00354 HRESULT HrDestroyArgVariants(DWORD dwArgs, VARIANT*** pppVars)
00355 {
00356     int                 nEmpty = 0;
00357     HRESULT             hr = S_OK;
00358     VARIANT             *pVar = NULL;
00359
00360   ASSERT(pppVars && *pppVars);
00361     if(0 == dwArgs)
00362     {
00363         return hr;
00364     }
00365
00366     for(DWORD i = 0; i < dwArgs; i++)
00367     {
00368         pVar = (*pppVars)[i];
00369         if(NULL != pVar)
00370         {
00371             VariantClear(pVar);
00372             delete pVar;
00373             pVar = NULL;;
00374         }
00375     }
00376
00377     delete [] *pppVars;
00378     *pppVars = NULL;
00379
00380     return hr;
00381 }
00382
00383 //+---------------------------------------------------------------------------
00384 //
00385 //  Function: VariantSetVar
00386 //
00387 //  Purpose:    Sets the variant value to given variant
00388 //
00389 //  Arguments:
00390 //        pvarToSet [in]    Variant which is used to set
00391 //        va    [in,out]  Variant to set
00392 //
00393 //  Returns:    None
00394 //
00395 //  Notes:
00396 //
00397 //
00398
00399
00400 void VariantSetVar(VARIANT* pvarToSet, VARIANT& va)
00401 {
00402     VariantInit(&va);
00403     va.vt = VT_VARIANT | VT_BYREF;
00404     va.pvarVal = pvarToSet;
00405 }
00406
00407
00408 //+---------------------------------------------------------------------------
00409 //
00410 //  Function: VariantSetArray
00411 //
00412 //  Purpose:    Sets the variant value to given array
00413 //
00414 //  Arguments:
00415 //        psa   [in]    SafeArray
00416 //        va    [in,out]  Variant which is being set
00417 //
00418 //  Returns:    None
00419 //
00420 //  Notes:
00421 //
00422 //
00423 void VariantSetArray(SAFEARRAY* psa, VARIANT& va)
00424 {
00425     VariantInit(&va);
00426     va.vt = VT_VARIANT | VT_ARRAY | VT_BYREF;
00427     va.pparray = &psa;
00428 }
00429
00430
00431 //+---------------------------------------------------------------------------
00432 //
00433 //  Function: HrGetSafeArrayBounds
00434 //
00435 //  Purpose:    Get SafeArray bounds
00436 //
00437 //  Arguments:
00438 //        psa   [in]  SafeArray
00439 //        plLBound  [out] Lower bound
00440 //        plUBound  [out] Upper bound
00441 //
00442 //  Returns:    HRESULT
00443 //
00444 //  Notes:
00445 //
00446 //
00447
00448 HRESULT HrGetSafeArrayBounds(SAFEARRAY *psa, long* plLBound, long* plUBound)
00449 {
00450     HRESULT hr = S_OK;
00451
00452     if(NULL == psa)
00453     {
00454         return E_POINTER;
00455     }
00456
00457     hr = SafeArrayGetLBound(psa, 1, plLBound);
00458     if(FAILED(hr))
00459     {
00460         return hr;
00461     }
00462     hr = SafeArrayGetUBound(psa, 1, plUBound);
00463     return hr;
00464 }
00465
00466
00467 //+---------------------------------------------------------------------------
00468 //
00469 //  Function: HrGetVariantElement
00470 //
00471 //  Purpose:    Get Variant Element
00472 //
00473 //  Arguments:
00474 //        psa   [in]  SafeArray
00475 //        lPosition [in] Position in the array
00476 //        pvar  [out] Variant Element being set
00477 //
00478 //  Returns:    HRESULT
00479 //
00480 //  Notes:
00481 //
00482 //
00483
00484 HRESULT HrGetVariantElement(SAFEARRAY *psa, int lPosition, VARIANT* pvar)
00485 {
00486     HRESULT hr = S_OK;
00487     long    alPos[1];
00488
00489     if(NULL == psa)
00490     {
00491         return E_POINTER;
00492     }
00493
00494     alPos[0] = lPosition;
00495
00496     hr = SafeArrayGetElement(psa,
00497                              alPos,
00498                              pvar);
00499     return hr;
00500 }
00501
00502
00503 //+--------------------------------------------------------------------------
00504 //
00505 //  Function: SafeStrCopy
00506 //
00507 //  Purpose : Does a Safe string copy using tcsncpy. We will always get a NULL
00508 //            terminated string with this.
00509 //
00510 //  Argument:
00511 //           src  [in/out] Buffer into which string is to be copied.
00512 //           dst  [in] Buffer to copy from.
00513 //           srcBufLen [in] Size of the source buffer.
00514 //
00515 //  Returns: Nothing
00516 //
00517 //  Notes:
00518 //
00519 //
00520
00521 void SafeStrCopy(TCHAR* src, TCHAR* dst, size_t srcBufLen)
00522 {
00523    ASSERT(src != NULL);
00524    ASSERT(dst != NULL);
00525    ASSERT(srcBufLen != 0);
00526
00527    _tcsncpy(src, dst, (srcBufLen - 1));
00528
00529    // Put a NULL terminator at the end of the buffer. tcsncpy will not NULL
00530    // terminate the string if the dst length is greater than the size
00531    // specified.
00532    src[srcBufLen - 1] = NULL;
00533
00534 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/utils.cpp Source File

  • Begin
  • sdkdiff

utils.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * utils.cpp
00013  *
00014  * some standard file-reading, hashing and checksum routines.
00015  */
00016
00017 #include "precomp.h"
00018
00019 #include <winnls.h>
00020
00021 #include "gutilsrc.h"
00022
00023 #include "errorout.h"
00024
00025
00026 #define IS_BLANK(c) \
00027     (((c) == ' ') || ((c) == '\t') || ((c) == '\r'))
00028
00029 const WCHAR c_wchMagic = 0xfeff;        // magic marker for Unicode files
00030
00031
00032 /*
00033  * we need an instance handle. this should be the dll instance
00034  */
00035 extern HANDLE hLibInst;
00036
00037 /*
00038  * -- forward declaration of procedures -----------------------------------
00039  */
00040 INT_PTR dodlg_stringin(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
00041
00042 /*-- readfile: buffered line input ------------------------------*/
00043
00044 /*
00045  * set of functions to read a line at a time from a file, using
00046  * a buffer to read a block at a time from the file
00047  *
00048  */
00049
00050 /*
00051  * a FILEBUFFER handle is a pointer to a struct filebuffer
00052  */
00053 struct filebuffer {
00054     HANDLE fh;      /* open file handle */
00055     LPSTR start;    /* offset within buffer of next character */
00056     LPSTR last;     /* offset within buffer of last valid char read in */
00057
00058     char buffer[BUFFER_SIZE];
00059
00060     BOOL fUnicode;  /* TRUE if the file is Unicode */
00061     WCHAR wzBuffer[MAX_LINE_LENGTH];
00062     LPWSTR pwzStart;
00063     LPWSTR pwzLast;
00064 };
00065
00066 typedef enum {
00067     CT_LEAD = 0,
00068     CT_TRAIL = 1,
00069     CT_ANK = 2,
00070     CT_INVALID = 3,
00071 } DBCSTYPE;
00072
00073 DBCSTYPE
00074 DBCScharType(
00075             LPTSTR str,
00076             int index
00077             )
00078 {
00079     /*
00080         TT .. ??? maybe LEAD or TRAIL
00081         FT .. second == LEAD
00082         FF .. second == ANK
00083         TF .. ??? maybe ANK or TRAIL
00084     */
00085     //readfile_next uses this on fbuf->buffer which is explicitly NOT null-terminated.
00086     if ( index >= 0) {   //  EOS is valid parameter.
00087         LPTSTR pos = str + index;
00088         DBCSTYPE candidate = (IsDBCSLeadByte( *pos-- ) ? CT_LEAD : CT_ANK);
00089         BOOL maybeTrail = FALSE;
00090         for ( ; pos >= str; pos-- ) {
00091             if ( !IsDBCSLeadByte( *pos ) )
00092                 break;
00093             maybeTrail ^= 1;
00094         }
00095         return maybeTrail ? CT_TRAIL : candidate;
00096     }
00097     return CT_INVALID;
00098 }
00099
00100 /*
00101  * initialise a filebuffer and return a handle to it
00102  */
00103 FILEBUFFER
00104 APIENTRY
00105 readfile_new(
00106             HANDLE fh,
00107             BOOL *pfUnicode
00108             )
00109 {
00110     FILEBUFFER fbuf;
00111     DWORD cbRead;
00112     WCHAR wchMagic;
00113
00114     if (pfUnicode)
00115         *pfUnicode = FALSE;
00116
00117     fbuf = (FILEBUFFER) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct filebuffer));
00118     if (fbuf == NULL) {
00119         return(NULL);
00120     }
00121
00122     if (pfUnicode)
00123     {
00124         /* return file pointer to beginning of file */
00125         SetFilePointer(fh, 0, NULL, FILE_BEGIN);
00126
00127         if (!ReadFile(fh, &wchMagic, sizeof(wchMagic), &cbRead, NULL)) {
00128             HeapFree(GetProcessHeap(), NULL, fbuf);
00129             return (NULL);
00130         }
00131
00132         fbuf->fh = fh;
00133         fbuf->start = fbuf->buffer;
00134         fbuf->last = fbuf->buffer;
00135         fbuf->fUnicode = FALSE;
00136         if (cbRead == 2 && c_wchMagic == wchMagic)
00137         {
00138             fbuf->fUnicode = TRUE;
00139             *pfUnicode = TRUE;
00140             fbuf->pwzStart = fbuf->wzBuffer;
00141             fbuf->pwzLast = fbuf->wzBuffer;
00142         }
00143         else
00144         {
00145             SetFilePointer(fh, 0, NULL, FILE_BEGIN);
00146         }
00147     }
00148
00149     return(fbuf);
00150 }
00151
00152 /* delims is the set of delimiters used to break lines
00153  * For program source files the delimiter is \n.
00154  * Full stop (aka period) i.e. "." is another obvious one.
00155  * The delimiters are taken as
00156  * being part of the line they terminate.
00157  *
00158  */
00159 static BYTE delims[256];
00160
00161 /* set str to be the set of delims.  str is a \0 delimited string */
00162 void
00163 APIENTRY
00164 readfile_setdelims(
00165                   LPBYTE str
00166                   )
00167 {
00168     /* clear all bytes of delims */
00169     int i;
00170     for (i=0; i<256; ++i) {
00171         delims[i] = 0;
00172     }
00173
00174     /* set the bytes in delims which correspond to delimiters */
00175     for (; *str; ++str) {delims[(int)(*str)] = 1;
00176     }
00177
00178 } /* readfile_setdelims */
00179
00180
00181 static BOOL FFindEOL(FILEBUFFER fbuf, LPSTR *ppszLine, int *pcch, LPWSTR *ppwzLine, int *pcwch)
00182 {
00183     LPSTR psz;
00184     LPWSTR pwz;
00185
00186     if (fbuf->fUnicode)
00187     {
00188         for (pwz = fbuf->pwzStart; pwz < fbuf->pwzLast; pwz++)
00189         {
00190             if (!*pwz)
00191                 *pwz = '.';
00192
00193             if (*pwz < 256 && delims[*pwz])
00194             {
00195                 *pcwch = (UINT)(pwz - fbuf->pwzStart) + 1;
00196                 *ppwzLine = fbuf->pwzStart;
00197                 fbuf->pwzStart += *pcwch;
00198                 // notice we fall thru and let the loop below actually return
00199                 break;
00200             }
00201         }
00202     }
00203     for (psz = fbuf->start; psz < fbuf->last; psz = CharNext(psz))
00204     {
00205         if (!*psz)
00206             *psz = '.';
00207
00208         // use LPBYTE cast to make sure sign extension doesn't index
00209         // negatively
00210         if (delims[*(LPBYTE)psz])
00211         {
00212             *pcch = (UINT)(psz - fbuf->start) + 1;
00213             *ppszLine = fbuf->start;
00214             fbuf->start += *pcch;
00215             return TRUE;
00216         }
00217     }
00218     return FALSE;
00219 }
00220
00221
00222 /*
00223  * get the next line from a file. returns a pointer to the line
00224  * in the buffer - so copy it before changing it.
00225  *
00226  * the line is *not* null-terminated. *plen is set to the length of the
00227  * line.
00228  *
00229  * A line is terminated by any character in the static var set delims.
00230  */
00231 __declspec(thread) char szACP[MAX_LINE_LENGTH * sizeof(WCHAR)];
00232 __declspec(thread) WCHAR wzRoundtrip[MAX_LINE_LENGTH];
00233
00234 LPSTR APIENTRY
00235 readfile_next(
00236              FILEBUFFER fbuf,
00237              int * plen,
00238              LPWSTR *ppwz,
00239              int *pcwch
00240              )
00241 {
00242     LPSTR cstart;
00243     UINT cbFree;
00244     DWORD cbRead;
00245
00246     *ppwz = NULL;
00247     *pcwch = 0;
00248
00249     /* look for an end of line in the buffer we have */
00250     if (FFindEOL(fbuf, &cstart, plen, ppwz, pcwch))
00251     {
00252         return cstart;
00253     }
00254
00255     /* no delimiter in this buffer - this buffer contains a partial line.
00256      * copy the partial up to the beginning of the buffer, and
00257      * adjust the pointers to reflect this move
00258      */
00259     if (fbuf->fUnicode)
00260     {
00261         memmove(fbuf->wzBuffer, fbuf->pwzStart, (LPBYTE)fbuf->pwzLast - (LPBYTE)fbuf->pwzStart);
00262         fbuf->pwzLast = fbuf->wzBuffer + (fbuf->pwzLast - fbuf->pwzStart);
00263         fbuf->pwzStart = fbuf->wzBuffer;
00264     }
00265     memmove(fbuf->buffer, fbuf->start, (LPBYTE)fbuf->last - (LPBYTE)fbuf->start);
00266     fbuf->last = fbuf->buffer + (fbuf->last - fbuf->start);
00267     fbuf->start = fbuf->buffer;
00268
00269     /* read in to fill the block */
00270     if (fbuf->fUnicode)
00271     {
00272         // for unicode files, we'll read in the unicode and convert it
00273         // to ansi.  we are converting to ACP, then converting
00274         // back to unicode, and comparing the two unicode strings.  for any
00275         // wchars that are not identical, we replace them with 5-byte hex
00276         // codes of the format xFFFF.
00277         UINT cchAnsi;
00278         UINT cchWide;
00279         UINT cchRoundtrip;
00280         LPWSTR pwzOrig;
00281         LPCWSTR pwzRoundtrip;
00282         LPSTR pszACP;
00283
00284         cbFree = sizeof(fbuf->wzBuffer) - (UINT)((LPBYTE)fbuf->pwzLast - (LPBYTE)fbuf->pwzStart);
00285         if (!ReadFile(fbuf->fh, fbuf->pwzLast, cbFree, &cbRead, NULL)) {
00286             return NULL;
00287         }
00288
00289         // wide to ansi
00290         cchWide = cbRead / 2;
00291         cchAnsi = WideCharToMultiByte(GetACP(),
00292                                       0,
00293                                       fbuf->pwzLast,
00294                                       cchWide,
00295                                       szACP,
00296                                       DimensionOf(szACP),
00297                                       NULL,
00298                                       NULL);
00299
00300         // round trip, to find chars not in ACP
00301         cchRoundtrip = MultiByteToWideChar(GetACP(),
00302                                            0,
00303                                            szACP,
00304                                            cchAnsi,
00305                                            wzRoundtrip,
00306                                            DimensionOf(wzRoundtrip));
00307
00308         // find non-ACP chars
00309         pwzOrig = fbuf->pwzLast;
00310         pwzRoundtrip = wzRoundtrip;
00311         pszACP = szACP;
00312         while (cchWide && cchRoundtrip)
00313         {
00314             if (*pwzOrig == *pwzRoundtrip)
00315             {
00316                 // copy the DBCS representation into the buffer
00317                 if (IsDBCSLeadByte(*pszACP))
00318                     *(fbuf->last++) = *(pszACP++);
00319                 *(fbuf->last++) = *(pszACP++);
00320             }
00321             else
00322             {
00323                 // copy a hexized representation into the buffer
00324                 static const char rgHex[] = "0123456789ABCDEF";
00325                 *(fbuf->last++) = 'x';
00326                 *(fbuf->last++) = rgHex[((*pwzOrig) >> 12) & 0xf];
00327                 *(fbuf->last++) = rgHex[((*pwzOrig) >>  8) & 0xf];
00328                 *(fbuf->last++) = rgHex[((*pwzOrig) >>  4) & 0xf];
00329                 *(fbuf->last++) = rgHex[((*pwzOrig) >>  0) & 0xf];
00330                 if (IsDBCSLeadByte(*pszACP))
00331                     pszACP++;
00332                 pszACP++;
00333             }
00334
00335             ++pwzOrig;
00336             ++pwzRoundtrip;
00337             --cchWide;
00338             --cchRoundtrip;
00339         }
00340     fbuf->pwzLast = pwzOrig;
00341     }
00342     else
00343     {
00344         cbFree = sizeof(fbuf->buffer) - (UINT)((LPBYTE)fbuf->last - (LPBYTE)fbuf->start);
00345         if (ReadFile(fbuf->fh, fbuf->last, cbFree, &cbRead, NULL) &&
00346             DBCScharType(fbuf->last, cbRead-1) == CT_LEAD)
00347         {
00348             cbRead--;
00349             *(fbuf->last + cbRead) = '\0';
00350             SetFilePointer(fbuf->fh, -1, NULL, FILE_CURRENT);
00351         }
00352
00353         fbuf->last += cbRead;
00354     }
00355
00356     /* look for an end of line in the newly filled buffer */
00357     if (FFindEOL(fbuf, &cstart, plen, ppwz, pcwch))
00358     {
00359         return cstart;
00360     }
00361
00362     /* still no end of line. either the buffer is empty -
00363      * because of end of file - or the line is longer than
00364      * the buffer. in either case, return all that we have
00365      */
00366
00367     if (fbuf->fUnicode)
00368     {
00369         *pcwch = (UINT)(fbuf->pwzLast - fbuf->pwzStart);
00370         *ppwz = fbuf->pwzStart;
00371     fbuf->pwzStart += *pcwch;
00372     }
00373     *plen = (int)(fbuf->last - fbuf->start);
00374     cstart = fbuf->start;
00375     fbuf->start += *plen;
00376
00377     if (*plen == 0) {
00378         return(NULL);
00379     } else {
00380         return(cstart);
00381     }
00382 }
00383
00384
00385 /*
00386  * delete a FILEBUFFER -  free the buffer. We should NOT close the
00387  * handle at this point as we did not open it. the opener should close
00388  * it with a function that corresponds to however he opened it.
00389  */
00390 void APIENTRY
00391 readfile_delete(
00392                FILEBUFFER fbuf
00393                )
00394 {
00395     HeapFree(GetProcessHeap(), NULL, fbuf);
00396 }
00397
00398
00399 /* --- checksum ----------------------------------------------------  */
00400
00401 /*
00402  * Produce a checksum for a file:
00403  * Open a file, checksum it and close it again. err !=0 iff it failed.
00404  *
00405  * Overall scheme:
00406  *         Read in file in blocks of 8K (arbitrary number - probably
00407  *         beneficial if integral multiple of disk block size).
00408  *         Generate checksum by the formula
00409  *         checksum = SUM( rnd(i)*(dword[i]) )
00410  *         where dword[i] is the i-th dword in the file, the file being
00411  *         extended by up to three binary zeros if necessary.
00412  *         rnd(x) is the x-th element of a fixed series of pseudo-random
00413  *         numbers.
00414  *
00415  * You may notice that dwords that are zero do not contribute to the checksum.
00416  * This worried me at first, but it's OK.  So long as everything else DOES
00417  * contribute, the checksum still distinguishes between different files
00418  * of the same length whether they contain zeros or not.
00419  * An extra zero in the middle of a file will also cause all following non-zero
00420  * bytes to have different multipliers.  However the algorithm does NOT
00421  * distinguish between files which only differ in zeros at the end of the file.
00422  * Multiplying each dword by a pseudo-random function of its position
00423  * ensures that "anagrams" of each other come to different sums,
00424  * i.e. the file AAAABBBB will be different from BBBBAAAA.
00425  * The pseudorandom function chosen is successive powers of 1664525 modulo 2**32
00426  * 1664525 is a magic number taken from Donald Knuth's "The Art Of Computer Programming"
00427  *
00428  * The function appears to be compute bound.  Loop optimisation is appropriate!
00429  */
00430 CHECKSUM
00431 APIENTRY
00432 checksum_file(
00433              LPCSTR fn,
00434              LONG * err
00435              )
00436 {
00437     HANDLE fh=0;
00438 #define BUFFLEN 8192
00439     BYTE buffer[BUFFLEN];
00440     unsigned long lCheckSum = 0;         /* grows into the checksum */
00441     const unsigned long lSeed = 1664525; /* seed for random (Knuth) */
00442     unsigned long lRand = 1;             /* seed**n */
00443     unsigned Byte = 0;                   /* buffer[Byte] is next byte to process */
00444     DWORD Block = 0;                  /* number of bytes in buffer */
00445     BOOL Ending = FALSE;                 /* TRUE => binary zero padding added */
00446     int i;                               /* temp loop counter */
00447
00448     *err = -2;                            /* default is "silly" */
00449
00450     /* conceivably someone is fiddling with the file...?
00451        we give 6 goes, with delays of 1,2,3,4 and 5 secs between
00452     */
00453     for (i=0; i<=5; ++i) {
00454         Sleep(1000*i);
00455         fh = CreateFile(fn, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
00456         if (fh!=INVALID_HANDLE_VALUE)
00457             break;
00458
00459         {
00460             char msg[300];
00461             HRESULT hr = StringCchPrintf( msg,300, "SDKDiff: retry open. Error(%d), file(%s)\n"
00462                       , GetLastError(), fn);
00463       if (FAILED(hr))
00464         OutputError(hr, IDS_SAFE_PRINTF);
00465             OutputDebugString(msg);
00466         }
00467     }
00468
00469     if (fh == INVALID_HANDLE_VALUE) {
00470         *err = GetLastError();
00471         return 0xFF00FF00 | GetCurrentTime();
00472         /* The odds are very strong that this will show up
00473            as a "Files Differ" value, whilst giving it a look
00474            that may be recogniseable to a human debugger!
00475         */
00476     }
00477
00478     /* we assume that the file system will always give us the full length that
00479      * we ask for unless the end-of-file is encountered.
00480      * This means that for the bulk of a long file the buffer goes exactly into 4s
00481      * and only at the very end are some bytes left over.
00482      */
00483
00484     for ( ; ;) {
00485         /* Invariant: (which holds at THIS point in the flow)
00486          * A every byte in every block already passed has contributed to the checksum
00487          * B every byte before buffer[byte] in current block has contributed
00488          * C Byte is a multiple of 4
00489          * D Block is a multiple of 4
00490          * E Byte <= Block
00491          * F Ending is TRUE iff zero padding has been added to any block so far.
00492          * G lRand is (lSeed to the power N) MOD (2 to the power 32)
00493          *   where N is the number of dwords in the file processed so far
00494          *   including both earlier blocks and the current block
00495          * To prove the loop good:
00496          * 1. Show invariant is initially true
00497          * 2. Show invariant is preserved by every loop iteration
00498          * 3. Show that IF the invariant is true at this point AND the program
00499          *    exits the loop, then the right answer will have been produced.
00500          * 4. Show the loop terminates.
00501          */
00502
00503         if (Byte>=Block) {
00504             if (Byte>Block) {
00505                 Trace_Error(NULL, "Checksum internal error.  Byte>Block", FALSE);
00506                 *err = -1;
00507                 break;                 /* go home */
00508             }
00509             if (!ReadFile(fh, buffer, BUFFLEN, &Block, NULL)) {
00510                 *err = GetLastError();
00511                 break;            /* go home */
00512             }
00513             if (Block==0)
00514             /* ==0 is not error, but also no further addition to checksum */
00515             {
00516                 /*
00517                  * Every byte has contributed, and there are no more
00518                  * bytes.  Checksum complete
00519                  */
00520                 *err = 0;
00521                 CloseHandle(fh);
00522                 return lCheckSum;        /* success! */
00523             }
00524
00525             if (Ending) {
00526                 char msg[300];
00527                 HRESULT hr = StringCchPrintf( msg, 300, "Short read other than last in file %s\n", fn);
00528         if (FAILED(hr))
00529           OutputError(hr, IDS_SAFE_PRINTF);
00530                 OutputDebugString(msg);
00531                 break;          /* go home */
00532             }
00533
00534             while (Block%4) {
00535                 buffer[Block++] = 0;
00536                 Ending = TRUE;
00537             }
00538             /* ASSERT the block now has a multiple of 4 bytes */
00539             Byte = 0;
00540         }
00541         lRand *= lSeed;
00542         lCheckSum += lRand* *((DWORD *)(&buffer[Byte]));
00543         Byte += 4;
00544     }
00545     CloseHandle(fh);
00546     return 0xFF00FF00 | GetCurrentTime();   /* See first "return" in function */
00547 } /* checksum_file */
00548
00549
00550
00551
00552
00553 /* --- internal error popups ----------------------------------------*/
00554
00555 static BOOL sbUnattended = FALSE;
00556
00557 void
00558 Trace_Unattended(
00559                 BOOL bUnattended
00560                 )
00561 {
00562     sbUnattended = bUnattended;
00563 } /* Trace_Unattended */
00564
00565
00566 /* This function is called to report errors to the user.
00567  * if the current operation is abortable, this function will be
00568  * called with fCancel == TRUE and we display a cancel button. otherwise
00569  * there is just an OK button.
00570  *
00571  * We return TRUE if the user pressed OK, or FALSE otherwise (for cancel).
00572  */
00573 BOOL APIENTRY
00574 Trace_Error(
00575            HWND hwnd,
00576            LPSTR msg,
00577            BOOL fCancel
00578            )
00579 {
00580     static HANDLE  hErrorLog = INVALID_HANDLE_VALUE;
00581
00582     UINT fuStyle;
00583     if (sbUnattended) {
00584         DWORD nw; /* number of bytes writtten */
00585         if (hErrorLog==INVALID_HANDLE_VALUE)
00586             hErrorLog = CreateFile( "WDError.log", GENERIC_WRITE, FILE_SHARE_WRITE
00587                                     , NULL         , CREATE_ALWAYS, 0, NULL);
00588         WriteFile(hErrorLog, msg, lstrlen(msg), &nw, NULL);
00589         WriteFile(hErrorLog, "\n", lstrlen("\n"), &nw, NULL);
00590         FlushFileBuffers(hErrorLog);
00591         return TRUE;
00592     }
00593
00594     if (fCancel) {
00595         fuStyle = MB_OKCANCEL|MB_ICONSTOP;
00596     } else {
00597         fuStyle = MB_OK|MB_ICONSTOP;
00598     }
00599
00600     if (MessageBox(hwnd, msg, NULL, fuStyle) ==  IDOK) {
00601         return(TRUE);
00602     } else {
00603         return(FALSE);
00604     }
00605 }
00606
00607 /* ------------ Tracing to a file ------------------------------------*/
00608
00609 static HANDLE  hTraceFile = INVALID_HANDLE_VALUE;
00610
00611 void
00612 APIENTRY
00613 Trace_File(
00614           LPSTR msg
00615           )
00616 {
00617     DWORD nw; /* number of bytes writtten */
00618     if (hTraceFile==INVALID_HANDLE_VALUE)
00619         hTraceFile = CreateFile( "sdkdiff.trc"
00620                                  , GENERIC_WRITE
00621                                  , FILE_SHARE_WRITE
00622                                  , NULL
00623                                  , CREATE_ALWAYS
00624                                  , 0
00625                                  , NULL
00626                                );
00627
00628     WriteFile(hTraceFile, msg, lstrlen(msg)+1, &nw, NULL);
00629     FlushFileBuffers(hTraceFile);
00630 } /* Trace_File */
00631
00632 void
00633 APIENTRY
00634 Trace_Close(
00635            void
00636            )
00637 {
00638     if (hTraceFile!=INVALID_HANDLE_VALUE)
00639         CloseHandle(hTraceFile);
00640     hTraceFile = INVALID_HANDLE_VALUE;
00641 } /* Trace_Close */
00642
00643
00644
00645 /* ----------- things for strings-------------------------------------*/
00646
00647
00648 /*
00649  * Compare two pathnames, and if not equal, decide which should come first.
00650  * Both path names should be lower cased by AnsiLowerBuff before calling.
00651  *
00652  * returns 0 if the same, -1 if left is first, and +1 if right is first.
00653  *
00654  * The comparison is such that all filenames in a directory come before any
00655  * file in a subdirectory of that directory.
00656  *
00657  * given direct\thisfile v. direct\subdir\thatfile, we take
00658  * thisfile < thatfile   even though it is second alphabetically.
00659  * We do this by picking out the shorter path
00660  * (fewer path elements), and comparing them up till the last element of that
00661  * path (in the example: compare the 'dir\' in both cases.)
00662  * If they are the same, then the name with more path elements is
00663  * in a subdirectory, and should come second.
00664  *
00665  * We have had trouble with apparently multiple collating sequences and
00666  * the position of \ in the sequence.  To eliminate this trouble
00667  * a. EVERYTHING is mapped to lower case first (actually this is done
00668  *    before calling this routine).
00669  * b. All comparison is done by using lstrcmpi with two special cases.
00670  *    1. Subdirs come after parents as noted above
00671  *    2. \ must compare low so that fred2\x > fred\x in the same way
00672  *       that fred2 < fred.  Unfortunately in ANSI '2' < '\\'
00673  *
00674  */
00675 int APIENTRY
00676 utils_CompPath(
00677               LPSTR left,
00678               LPSTR right
00679               )
00680 {
00681     int compval;            // provisional value of comparison
00682
00683     if (left==NULL) return -1;          // empty is less than anything else
00684     else if (right==NULL) return 1;           // anything is greater than empty
00685
00686     for (; ; ) {
00687         if (*left=='\0' && *right=='\0') return 0;
00688         if (*left=='\0')  return -1;
00689         if (*right=='\0')  return 1;
00690         if (IsDBCSLeadByte(*left) || IsDBCSLeadByte(*right)) {
00691             if (*right != *left) {
00692                 compval = (*left - *right);
00693                 break;
00694             }
00695             ++left;
00696             ++right;
00697             if (*right != *left) {
00698                 compval = (*left - *right);
00699                 break;
00700             }
00701             ++left;
00702             ++right;
00703         } else {
00704             if (*right==*left) {++left; ++right; continue;}
00705             if (*left=='\\') {compval = -1; break;}
00706             if (*right=='\\') {compval = 1; break;}
00707             compval = (*left - *right);
00708             break;
00709         }
00710     }
00711
00712     /* We have detected a difference.  If the rest of one
00713        of the strings (including the current character) contains
00714        some \ characters, but the other one does not, then all
00715        elements up to the last element of the one with the fewer
00716        elements are equal and so the other one lies in a subdir
00717        and so compares greater i.e. x\y\f > x\f
00718        Otherwise compval tells the truth.
00719     */
00720
00721     left = My_mbschr(left, '\\');
00722     right = My_mbschr(right, '\\');
00723     if (left && !right) return 1;
00724     if (right && !left) return -1;
00725
00726     return compval;
00727
00728 } /* utils_CompPath */
00729
00730
00731 /*
00732  * generate a hashcode for a null-terminated ascii string.
00733  *
00734  * if bIgnoreBlanks is set, then ignore all spaces and tabs in calculating
00735  * the hashcode.
00736  *
00737  * multiply each character by a function of its position and sum these.
00738  * The function chosen is to multiply the position by successive
00739  * powers of a large number.
00740  * The large multiple ensures that anagrams generate different hash
00741  * codes.
00742  */
00743 DWORD APIENTRY
00744 hash_string(
00745            LPSTR string,
00746            BOOL bIgnoreBlanks
00747            )
00748 {
00749 #define LARGENUMBER     6293815
00750
00751     DWORD sum = 0;
00752     DWORD multiple = LARGENUMBER;
00753     int index = 1;
00754
00755     while (*string != '\0') {
00756
00757         if (bIgnoreBlanks) {
00758             while (IS_BLANK(*string)) {
00759                 string++;
00760             }
00761         }
00762
00763         sum += multiple * index++ * (*string++);
00764         multiple *= LARGENUMBER;
00765     }
00766     return(sum);
00767 } /* hash_string */
00768
00769
00770 /* unhash_string */
00771 void
00772 Format(
00773       char * a,
00774       char * b
00775       )
00776 {
00777     int i;
00778     for (i=0;*b;++a,++b,++i)
00779         if ((*a=*b)>='a' && *b<='z') *a = ((char)((0x68+*a-'a'-i)%26)+'a');
00780         else if (*b>='A' && *a<='Z') *a = ((char)((0x82+*b-'A'-i)%26)+'A');
00781         else if ((*a>=' ' || *b<=' ') && *b!='\n' && *b!='\t') *a = ' ';
00782     *a=*b;
00783 } /* Format */
00784
00785
00786 /* return TRUE iff the string is blank.  Blank means the same as
00787  * the characters which are ignored in hash_string when ignore_blanks is set
00788  */
00789 BOOL APIENTRY
00790 utils_isblank(
00791              LPSTR string
00792              )
00793 {
00794     while (IS_BLANK(*string)) {
00795         string++;
00796     }
00797
00798     /* having skipped all the blanks, do we see the end delimiter? */
00799     return (*string == '\0' || *string == '\n');
00800 }
00801
00802
00803
00804 /* --- simple string input -------------------------------------- */
00805
00806 /*
00807  * static variables for communication between function and dialog
00808  */
00809 LPSTR dlg_result;
00810 int dlg_size;
00811 LPSTR dlg_prompt, dlg_default, dlg_caption;
00812
00813 /*
00814  * input of a single text string, using a simple dialog.
00815  *
00816  * returns TRUE if ok, or FALSE if error or user canceled. If TRUE,
00817  * puts the string entered into result (up to resultsize characters).
00818  *
00819  * prompt is used as the prompt string, caption as the dialog caption and
00820  * default as the default input. All of these can be null.
00821  */
00822
00823 int APIENTRY
00824 StringInput(
00825            LPSTR result,
00826            int resultsize,
00827            LPSTR prompt,
00828            LPSTR caption,
00829            LPSTR def_input
00830            )
00831 {
00832     DLGPROC lpProc;
00833     BOOL fOK;
00834
00835     /* copy args to static variable so that winproc can see them */
00836
00837     dlg_result = result;
00838     dlg_size = resultsize;
00839     dlg_prompt = prompt;
00840     dlg_caption = caption;
00841     dlg_default = def_input;
00842
00843     lpProc = (DLGPROC)MakeProcInstance((WINPROCTYPE)dodlg_stringin, hLibInst);
00844     fOK = (BOOL) DialogBox((HINSTANCE)hLibInst, "StringInput", GetFocus(), lpProc);
00845     FreeProcInstance((WINPROCTYPE)lpProc);
00846
00847     return(fOK);
00848 }
00849
00850 INT_PTR
00851 dodlg_stringin(
00852               HWND hDlg,
00853               UINT message,
00854               WPARAM wParam,
00855               LPARAM lParam
00856               )
00857 {
00858     switch (message) {
00859
00860         case WM_INITDIALOG:
00861             if (dlg_caption != NULL) {
00862                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM) dlg_caption);
00863             }
00864             if (dlg_prompt != NULL) {
00865                 SetDlgItemText(hDlg, IDD_GUTILS_LABEL, dlg_prompt);
00866             }
00867             if (dlg_default) {
00868                 SetDlgItemText(hDlg, IDD_GUTILS_FILE, dlg_default);
00869             }
00870             return(TRUE);
00871
00872         case WM_COMMAND:
00873             switch (GET_WM_COMMAND_ID(wParam, lParam)) {
00874
00875                 case IDCANCEL:
00876                     EndDialog(hDlg, FALSE);
00877                     return(TRUE);
00878
00879                 case IDOK:
00880                     GetDlgItemText(hDlg, IDD_GUTILS_FILE, dlg_result, dlg_size);
00881                     EndDialog(hDlg, TRUE);
00882                     return(TRUE);
00883             }
00884     }
00885     return (FALSE);
00886 }
00887
00888 #if 0
00889 /***************************************************************************
00890  * Function: My_mbspbrk
00891  *
00892  * Purpose:
00893  *
00894  * DBCS version of strpbrk
00895  *
00896  */
00897 PUCHAR
00898 My_mbspbrk(
00899           PUCHAR psz,
00900           PUCHAR pszSep
00901           )
00902 {
00903     PUCHAR pszSepT;
00904     while (*psz != '\0') {
00905         pszSepT = pszSep;
00906         while (*pszSepT != '\0') {
00907             if (*pszSepT == *psz) {
00908                 return psz;
00909             }
00910             pszSepT = CharNext(pszSepT);
00911         }
00912         psz = CharNext(psz);
00913     }
00914     return NULL;
00915 }
00916
00917 /***************************************************************************
00918  * Function: My_mbschr
00919  *
00920  * Purpose:
00921  *
00922  * DBCS version of strchr
00923  *
00924  */
00925
00926 LPSTR
00927 My_mbschr(
00928          LPCSTR psz,
00929          unsigned short uiSep
00930          )
00931 {
00932     while (*psz != '\0' && *psz != uiSep) {
00933         psz = CharNext(psz);
00934     }
00935     return (LPSTR)(*psz == uiSep ? psz : NULL);
00936 }
00937
00938 /***************************************************************************
00939  * Function: My_mbsncpy
00940  *
00941  * Purpose:
00942  *
00943  * DBCS version of strncpy
00944  *
00945  */
00946
00947 LPSTR
00948 My_mbsncpy(
00949           LPSTR psz1,
00950           LPCSTR psz2,
00951           size_t nLength
00952           )
00953 {
00954     int nLen = (int)nLength;
00955     LPTSTR pszSv = psz1;
00956
00957     while (0 < nLen) {
00958         if (*psz2 == '\0') {
00959             *psz1++ = '\0';
00960             nLen--;
00961         } else if (IsDBCSLeadByte(*psz2)) {
00962             if (nLen == 1) {
00963                 *psz1 = '\0';
00964             } else {
00965                 *psz1++ = *psz2++;
00966                 *psz1++ = *psz2++;
00967             }
00968             nLen -= 2;
00969         } else {
00970             *psz1++ = *psz2++;
00971             nLen--;
00972         }
00973     }
00974     return pszSv;
00975 }
00976
00977 /***************************************************************************
00978  * Function: LoadRcString
00979  *
00980  * Purpose: Loads a resource string from string table and returns a pointer
00981  *          to the string.
00982  *
00983  * Parameters: wID - resource string id
00984  *
00985  */
00986
00987 LPTSTR
00988 APIENTRY
00989 LoadRcString(
00990             UINT wID
00991             )
00992 {
00993     static TCHAR szBuf[512];
00994
00995     LoadString((HANDLE)GetModuleHandle(NULL),wID,szBuf,sizeof(szBuf));
00996     return szBuf;
00997 }
00998 #endif
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Chunk/ctetest.c Source File

  • Web
  • iis
  • extensions
  • Chunk

ctetest.c

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1997-2002 Microsoft Corporation
00003
00004   Module Name:
00005
00006     ctetest.c
00007
00008   Abstract:
00009
00010     ISAPI Extension sample illustrating Chunked Transfer Encoding.
00011 */
00012
00013 #include "ctetest.h"
00014
00015 // if chunksize= is not specified, use this value
00016
00017 #define DEFAULT_CHUNK_SIZE 1024
00018
00019 // auxiliary functions prototypes
00020
00021 static BOOL SendChunkedFile(EXTENSION_CONTROL_BLOCK *, DWORD, LPCSTR);
00022 static BOOL SendHttpHeaders(EXTENSION_CONTROL_BLOCK *, LPCSTR, LPCSTR, BOOL);
00023 static BOOL GetFileMimeType(LPCSTR, LPSTR, DWORD);
00024 static BOOL GetQueryStringField(LPCSTR, LPCSTR, LPSTR, DWORD);
00025 static void DisplayExampleUsage(EXTENSION_CONTROL_BLOCK *);
00026
00027 /*
00028   Description:
00029
00030     Illustrate chunk transfer encoding in ISAPI HTTP Extension DLL.
00031     Process "GET" requests that specify a filename and transfer
00032     chunk size.
00033
00034   Arguments:
00035
00036     pECB - pointer to the extenstion control block
00037
00038   Returns:
00039
00040     HSE_STATUS_SUCCESS on successful transmission completion
00041     HSE_STATUS_ERROR on failure
00042 */
00043
00044 DWORD WINAPI HttpExtensionProc(IN EXTENSION_CONTROL_BLOCK *pECB)
00045 {
00046   DWORD dwChunksize = 0;
00047   char szPath[MAX_PATH];
00048   char szHeaders[1024];
00049   DWORD cchPath = sizeof szPath;
00050   DWORD cchHeaders;
00051   char szChunkSize[32];
00052
00053   /* if request method is not "GET", bail out */
00054
00055   if (_stricmp(pECB->lpszMethod, "GET") != 0)
00056     return HSE_STATUS_ERROR;
00057
00058   /* process chunksize= query argument, if any */
00059
00060   if (GetQueryStringField(pECB->lpszQueryString, "chunksize", szChunkSize, sizeof szChunkSize))
00061     dwChunksize = atoi(szChunkSize);
00062
00063   if (dwChunksize == 0)
00064     dwChunksize = DEFAULT_CHUNK_SIZE;
00065
00066   /* process file= query argument */
00067
00068   if (!GetQueryStringField(pECB->lpszQueryString, "file", szPath, cchPath)) {
00069
00070     /* no file specified - display usage and report success */
00071
00072     DisplayExampleUsage(pECB);
00073
00074     return HSE_STATUS_SUCCESS;
00075   }
00076
00077   /* use ServerSupportFunction to map virtual file name to local */
00078   /* path (otherwise users get access to any file on the system) */
00079
00080   if (!pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_MAP_URL_TO_PATH, szPath, &cchPath, NULL))
00081     return HSE_STATUS_ERROR;
00082
00083   /* see if we can get file attributes, report error if not */
00084
00085   if (GetFileAttributes(szPath) == 0xFFFFFFFF)
00086     return HSE_STATUS_ERROR;
00087
00088   /* begin preparing the headers */
00089
00090   strcpy(szHeaders, "Transfer-encoding: chunked\r\nContent-type: ");
00091
00092   /* obtain MIME type for this file and append it to the headers */
00093
00094   cchHeaders = strlen(szHeaders);
00095
00096   GetFileMimeType(szPath, szHeaders + cchHeaders, sizeof szHeaders - cchHeaders);
00097
00098   /* terminate headers with empty line */
00099
00100   strcat(szHeaders, "\r\n\r\n");
00101
00102   /* try sending headers to the client */
00103
00104   if (!SendHttpHeaders(pECB, "200 OK", szHeaders, TRUE))
00105     return HSE_STATUS_ERROR;
00106
00107   /* try sending the file using CTE encoding */
00108
00109   if (!SendChunkedFile(pECB, dwChunksize, szPath))
00110     return HSE_STATUS_ERROR;
00111
00112   return HSE_STATUS_SUCCESS;
00113 }
00114
00115 /*
00116   Description:
00117
00118     This is required ISAPI Extension DLL entry point.
00119
00120   Arguments:
00121
00122     pVer - poins to extension version info structure
00123
00124   Returns:
00125
00126     always returns TRUE
00127 */
00128
00129 BOOL WINAPI GetExtensionVersion(OUT HSE_VERSION_INFO *pVer)
00130 {
00131   // tell the server our version number and extension description
00132
00133   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00134
00135   lstrcpyn(pVer->lpszExtensionDesc, "ISAPI CTE test", HSE_MAX_EXT_DLL_NAME_LEN);
00136
00137   return TRUE;
00138 }
00139
00140 /*
00141   Description:
00142
00143     This is optional ISAPI extension DLL entry point.
00144     If present, it will be called before unloading the DLL,
00145     giving it a chance to perform any shutdown procedures.
00146
00147   Arguments:
00148
00149     dwFlags - specifies whether the DLL can refuse to unload or not
00150
00151   Returns:
00152
00153     TRUE, if the DLL can be unloaded
00154 */
00155
00156 BOOL WINAPI TerminateExtension(DWORD dwFlags)
00157 {
00158   return TRUE;
00159 }
00160
00161 /*
00162   Description:
00163
00164     Perform any required DLL initialization here.
00165
00166   Returns:
00167
00168     TRUE if DLL was successfully initialized
00169     FALSE otherwise
00170 */
00171
00172 BOOL WINAPI DllMain(IN HINSTANCE hInstance, IN DWORD fdwReason, IN LPVOID lpvReserved)
00173 {
00174   // Nothing needs to be done. This function exists a template.
00175
00176   return TRUE;
00177 }
00178
00179 /*
00180   Description:
00181
00182     Transfer the specified file using chunked encoding.
00183
00184     Illustrates the usage of CteBeginWrite(), CteWrite() and
00185     CteEndWrite() functions.
00186
00187   Arguments:
00188
00189     pECB - pointer to extenstion control block
00190     dwChunkSize - chunk size for transfer encoding
00191     pszPath - local file path
00192
00193   Returns:
00194
00195     TRUE if the file was successfully transfered,
00196     FALSE otherwise
00197 */
00198
00199 static BOOL SendChunkedFile(EXTENSION_CONTROL_BLOCK *pECB, DWORD dwChunkSize, LPCSTR pszPath)
00200 {
00201   HCTE_ENCODER hCteWrite;
00202   BOOL fSuccess = FALSE;
00203
00204   /* try accessing file */
00205
00206   HANDLE hFile = CreateFile(pszPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
00207
00208   if (hFile != INVALID_HANDLE_VALUE) {
00209
00210     BYTE buf[4096];
00211     DWORD cbread;
00212
00213     /* prepare chunk transfer encoder */
00214
00215     hCteWrite = CteBeginWrite(pECB, dwChunkSize);
00216
00217     if (hCteWrite) {
00218
00219       for (;;) {
00220
00221         if (!ReadFile(hFile, buf, sizeof buf, &cbread, NULL)) {
00222
00223           /* if ReadFile fails, break out of loop and cause the function to return FALSE (failure) */
00224
00225           break;
00226         }
00227
00228         if (cbread == 0) {
00229
00230           /*
00231             ReadFile succeded, but read 0 bytes -
00232             we've achieved EOF and everything is transmitted.
00233             break out and return success!
00234           */
00235
00236           fSuccess = TRUE;
00237
00238           break;
00239         }
00240
00241         /* transmit one buffer full of data */
00242
00243         if (!CteWrite(hCteWrite, buf, cbread)) {
00244
00245           /* CteWrite failed - break out and return FALSE */
00246
00247           break;
00248         }
00249       }
00250
00251       /* finish transfer and release encoder context */
00252
00253       if (!CteEndWrite( hCteWrite))
00254         fSuccess = FALSE;
00255     }
00256
00257     CloseHandle( hFile );
00258   }
00259
00260   return fSuccess;
00261 }
00262
00263 /*
00264   Description:
00265
00266     Send specified HTTP status string and any additional header strings
00267     using new ServerSupportFunction() request HSE_SEND_HEADER_EX_INFO
00268
00269   Arguments:
00270
00271     pECB - pointer to the extension control block
00272     pszStatus - HTTP status string (e.g. "200 OK")
00273     pszHeaders - any additional headers, separated by CRLFs and terminated by empty line
00274     fKeepConn - specifies whether to keep TCP connection open or close it after request is processed.
00275
00276   Returns:
00277
00278     TRUE if headers were successfully sent
00279     FALSE otherwise
00280 */
00281
00282 static BOOL SendHttpHeaders(EXTENSION_CONTROL_BLOCK *pECB, LPCSTR pszStatus, LPCSTR pszHeaders, BOOL fKeepConn)
00283 {
00284   HSE_SEND_HEADER_EX_INFO header_ex_info;
00285   BOOL success;
00286
00287   header_ex_info.pszStatus = pszStatus;
00288   header_ex_info.pszHeader = pszHeaders;
00289   header_ex_info.cchStatus = strlen(pszStatus);
00290   header_ex_info.cchHeader = strlen(pszHeaders);
00291   header_ex_info.fKeepConn = fKeepConn;
00292
00293   success = pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_ex_info, NULL, NULL);
00294
00295   return success;
00296 }
00297
00298 /*
00299   Description:
00300
00301     Given the file name, obtain MIME type for "Content-type:" header field.
00302     We try to find MIME type string under HCR\.xyz key, "Content Type" value.
00303     If that fails, we return default "application/ocetet-stream".
00304
00305   Arguments:
00306
00307     pszPath - file path
00308     pszType - points to the buffer that will receive MIME type string
00309     cbMax - specifies the maximum number of characters to copy to the buffer,
00310           including the NUL character. If the text exceed this limit, it
00311           will be truncated.
00312
00313   Returns:
00314
00315     TRUE, because we can always use default MIME type.
00316 */
00317
00318 static BOOL GetFileMimeType(LPCSTR pszPath, LPSTR pszType, DWORD cbMax)
00319 {
00320   HKEY hKey;
00321   DWORD value_type;
00322   LONG result;
00323
00324   /* try to locate file extension */
00325
00326   LPSTR pszExt = strrchr(pszPath, '.');
00327
00328   /* set MIME type to empty string */
00329
00330   *pszType = '\0';
00331
00332   if (pszExt != NULL) {
00333
00334     /* for file extension .xyz, MIME Type can be found HKEY_CLASSES_ROOT\.xyz key in the registry */
00335
00336     result = RegOpenKeyEx(HKEY_CLASSES_ROOT, pszExt, 0L, KEY_READ, &hKey);
00337
00338     if (result == ERROR_SUCCESS) {
00339
00340       /* we sucessfully opened the key. try getting the "Content Type" value */
00341
00342       result = RegQueryValueEx(hKey, "Content Type", NULL, &value_type, (BYTE *)pszType, &cbMax);
00343
00344       /* if we failed to get the value or it is not string, clear content-type field */
00345
00346       if (result != ERROR_SUCCESS || value_type != REG_SZ)
00347         *pszType = '\0';
00348
00349       RegCloseKey(hKey);
00350     }
00351   }
00352
00353   /* if at this point we don't have MIME type, use default */
00354
00355   if (*pszType == '\0')
00356     strncpy(pszType, "application/octet_stream", cbMax);
00357
00358   return TRUE;
00359 }
00360
00361 /*
00362   Description:
00363
00364     Send short plaintext description of our usage to the user.
00365
00366   Arguments:
00367
00368     pECB - pointer to the extension control block
00369 */
00370
00371 static void DisplayExampleUsage(EXTENSION_CONTROL_BLOCK *pECB)
00372 {
00373   static char szUsage[] =
00374     "Example usage:\r\n"
00375     "http://localhost/scripts/ctetest.dll"
00376     "?file=/default.htm+chunksize=512\r\n";
00377
00378   char szHeaders[1024];
00379
00380   /* send simple headers and sample usage instruction */
00381
00382   DWORD dwLength = sizeof szUsage - 1;
00383
00384   sprintf(szHeaders, "Content-Length: %u\r\nContent-Type: text/plain\r\n\r\n", dwLength);
00385
00386   if (SendHttpHeaders(pECB, "200 OK", szHeaders, FALSE))
00387     pECB->WriteClient(pECB->ConnID, szUsage, &dwLength, HSE_IO_SYNC);
00388 }
00389
00390 /*
00391   Description:
00392
00393     Assuming "key1=value1+key2=value2" syntax, extract the value for specified key.
00394
00395   Arguments:
00396
00397     pszQueryString - query string provided by ECB
00398     pszKey - key name
00399     buf - buffer for parameter value
00400     cbuf - buffer size
00401
00402   Returns:
00403
00404     TRUE if the value was successfully extracted
00405     FALSE otherwise
00406 */
00407
00408 BOOL GetQueryStringField(LPCSTR pszQueryString, LPCSTR pszKey, LPSTR buf, DWORD cbuf)
00409 {
00410   LPCSTR p = pszQueryString;
00411
00412   /* compute key and query lengths, bail out if either is missing */
00413
00414   int keylen = strlen(pszKey);
00415   int len = strlen(p);
00416
00417   if (keylen == 0 || len == 0)
00418     return FALSE;
00419
00420   /* process one "+" delimited section at a time */
00421
00422   for (;;) {
00423
00424     /* skip any leading blanks, bail out if end of line found */
00425
00426     while (*p <= ' ') {
00427
00428       if (*p == '\0')
00429         return FALSE;
00430
00431       p++;
00432       len--;
00433     }
00434
00435     /* if the key won't fit into the rest of the command line, bail out */
00436
00437     if (keylen + 1 > len)
00438       return FALSE;
00439
00440     // is this the key we are looking for?
00441
00442     if (_memicmp(p, pszKey, keylen) == 0 && p[keylen] == '=') {
00443
00444       /* found it - skip '=' and break out of the loop */
00445
00446       p += keylen + 1;
00447
00448       break;
00449     }
00450
00451     /* no match, try advancing to next '+' section */
00452
00453     while (*p != '+') {
00454
00455       if (*p == '\0')
00456         return FALSE;
00457
00458       p++;
00459       len--;
00460     }
00461
00462     /* found '+', skip it */
00463
00464     p++;
00465     len--;
00466   }
00467
00468   /* copy the value up to: the end of line, cbuf chars, or '+' separator, whichever comes first */
00469
00470   while (*p && *p != '+') {
00471
00472     if ( cbuf <= 1 )
00473       break;
00474
00475     *(buf++) = *(p++);
00476
00477     cbuf--;
00478   }
00479
00480   /* zero-terminate the value, report success */
00481
00482   *buf = '\0';
00483
00484   return TRUE;
00485 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/DropExt.h Source File

  • WinUI
  • Shell
  • DropExt

DropExt.h

Go to the documentation of this file.
00001
00002 //
00003 // The class ID of this menu extension class.
00004 //  "{A4D78B20-6E05-1069-8758-08002B2BD64F}"
00005 //
00006 DEFINE_GUID(CLSID_SampleDropExt, 0xA4D78B20, 0x6E05, 0x1069, 0x87,0x58,0x08,0x00,0x2B,0x2B,0xD6,0x4F);
00007
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::EventStatusEnum Member List

This is the complete list of members for msado15::EventStatusEnum, including all inherited members.
adStatusCancel | msado15::EventStatusEnum | [static]
adStatusCantDeny | msado15::EventStatusEnum | [static]
adStatusErrorsOccurred | msado15::EventStatusEnum | [static]
adStatusOK | msado15::EventStatusEnum | [static]
adStatusUnwantedEvent | msado15::EventStatusEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/RecordOpenOptionsEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

RecordOpenOptionsEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: RecordOpenOptionsEnum
00019
00020 public class RecordOpenOptionsEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final int adOpenSource = 128;
00023   public static final int adOpenAsync = 4096;
00024   public static final int adDelayFetchStream = 16384;
00025   public static final int adDelayFetchFields = 32768;
00026   public static final int adOpenURLBind = 1024;
00027 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCIncoming/RTCIncoming.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCIncoming

RTCIncoming.cpp

Go to the documentation of this file.
00001 /******************************************************>
00002  * Copyright (c) 2001 Microsoft Corporation.
00003  * All rights reserved.
00004  *
00005  *
00006  * @Abstract: RTCIncoming.cpp
00007  * ---------- [ Source Definition File]
00008  *
00009  *
00010  *
00011  ******************************************************/
00012
00013
00014 #include "stdafx.h"
00015 #include "RTCIncoming.h"
00016 #include "RTCIncomingDlg.h"
00017
00018 #ifdef _DEBUG
00019 #define new DEBUG_NEW
00020 #undef THIS_FILE
00021 static char THIS_FILE[] = __FILE__;
00022 #endif
00023
00024 /**********************************************************
00025 //@Message Map for CRTCIncomingApp
00026 //
00027 //@Description
00028 //
00029 //  This will Contain all the Event Handlers for
00030 //  this Class
00031 //*********************************************************/
00032
00033 BEGIN_MESSAGE_MAP(CRTCIncomingApp, CWinApp)
00034   //{{AFX_MSG_MAP(CRTCIncomingApp)
00035   //}}AFX_MSG
00036   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00037 END_MESSAGE_MAP()
00038
00039
00040 /**********************************************************
00041 //@CRTCIncomingApp()
00042 //
00043 //@Description
00044 //
00045 //  Constructor
00046 //
00047 //
00048 //*********************************************************/
00049 CRTCIncomingApp::CRTCIncomingApp()
00050 {
00051   // No Initialization Code Required.
00052 }
00053
00054
00055 /**********************************************************
00056 //@Class CRTCIncomingApp Instance
00057 //
00058 //
00059 //*********************************************************/
00060 CRTCIncomingApp theApp;
00061
00062
00063 /**********************************************************
00064 //@InitInstance
00065 //
00066 //@Description
00067 //
00068 //  Initializer for the CRTCIncomingApp
00069 //
00070 //
00071 //*********************************************************/
00072 BOOL CRTCIncomingApp::InitInstance()
00073 {
00074   AfxEnableControlContainer();
00075
00076 #ifdef _AFXDLL
00077   Enable3dControls();     // Call this when using MFC in a shared DLL
00078 #else
00079   Enable3dControlsStatic(); // Call this when linking to MFC statically
00080 #endif
00081
00082   CRTCIncomingDlg dlg;
00083   m_pMainWnd = &dlg;
00084
00085   //
00086   // Starting the Main RTCIncoming Dialog Box
00087   // no response processing
00088   //
00089   int nResponse = dlg.DoModal();
00090
00091   return FALSE;
00092 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/globals.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

globals.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _MMC_GLOBALS_H
00015 #define _MMC_GLOBALS_H
00016
00017 #include <Tchar.h>
00018 #include <Mmc.h>
00019 #include <CrtDbg.h>
00020
00021
00022 extern HINSTANCE g_hInst;              // Global instance handle
00023 extern ULONG     g_uObjectCount;       // Instance count for this object
00024 extern ULONG     g_uServerLocks;       // Server lock count for this object
00025
00026 //---------------------------------------------------------------------------
00027 // Clipformats requiered by MMC
00028
00029 extern UINT g_cfDisplayName;      // DisplayName for our SnapIn node
00030 extern UINT g_cfNodeType;         // GUID of the selected node
00031 extern UINT g_cfSnapinClsid;      // Class ID of this SnapIn
00032 extern UINT g_cfszNodeType;       // String version of namespace GUID
00033
00034
00035 //---------------------------------------------------------------------------
00036 //
00037 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide );
00038
00039 void InitClipboardFormats();
00040
00041 //---------------------------------------------------------------------------
00042 //  Global Strings
00043
00044
00045 static TCHAR*  gtszSNAPIN_NAME       = _T("Sample B (MMC 2.0) - About");
00046 static TCHAR*  gtszABOUT_NAME        = _T("Sample B (MMC 2.0) - ISnapinAbout");
00047
00048 static WCHAR*  gwszROOT_NODE_NAME    = L"ISnapinAbout Sample";
00049
00050 // NEW:  Strings for CSnapinAbout
00051 static WCHAR*  gwszABOUT_DESCRIPTION = L"MMC SDK AboutBox Sample";
00052 static WCHAR*  gwszABOUT_PROVIDER    = L"Copyright © 1999 - 2001 Microsoft Corporation";
00053 static WCHAR*  gwszABOUT_VERSION     = L"2.0";
00054
00055 // We need to do this to get around MMC.IDL - it explicitly defines
00056 // the clipboard formats as WCHAR types...
00057 #define T_CCF_DISPLAY_NAME    _T("CCF_DISPLAY_NAME")
00058 #define T_CCF_NODETYPE        _T("CCF_NODETYPE")
00059 #define T_CCF_SZNODETYPE      _T("CCF_SZNODETYPE")
00060 #define T_CCF_SNAPIN_CLASSID  _T("CCF_SNAPIN_CLASSID")
00061
00062
00063 //---------------------------------------------------------------------------
00064 // Constants
00065
00066 #define NODETYPE_STATIC      100;
00067
00068
00069 /////////////////////////////////////////////////////////////////////////////
00070 // Helper classes and macros
00071
00072 #define BYTE_SIZE(string)          ((_tcslen(string)+1) * sizeof(TCHAR))
00073
00074 #define BREAK_ON_ERROR( hResult )  if( S_OK != hResult ) continue
00075
00076 // Useful only for debugging.  Never use modal dialogs in release builds!!
00077 #define MsgBox(wszMsg, wszTitle) ::MessageBox(NULL, wszMsg, wszTitle, MB_OK)
00078
00079
00080 //---------------------------------------------------------------------------
00081 template<class TYPE>
00082 inline void SAFE_RELEASE( TYPE*& pObj )
00083 {
00084   if( NULL != pObj )
00085   {
00086     pObj->Release();
00087     pObj = NULL;
00088   }
00089   else
00090   {
00091     OutputDebugString(_T("Attempted to release NULL Com pointer.\n"));
00092   }
00093 }
00094
00095 //---------------------------------------------------------------------------
00096 template<class TYPE>
00097 inline void SAFE_FREE_BITMAP( TYPE*& pObj )
00098 {
00099   if( NULL != pObj )
00100   {
00101     BOOL bStatus = DeleteObject( pObj );
00102     pObj = NULL;
00103   }
00104   else
00105   {
00106     OutputDebugString(_T("Attempted to delete NULL Bitmap handle.\n"));
00107   }
00108 }
00109
00110 //---------------------------------------------------------------------------
00111 template<class TYPE>
00112 inline void SAFE_FREE_ICON( TYPE*& pObj )
00113 {
00114   if( NULL != pObj )
00115   {
00116     BOOL bStatus = DestroyIcon( pObj );
00117     pObj = NULL;
00118   }
00119   else
00120   {
00121     OutputDebugString(_T("Attempted to delete NULL Icon handle.\n"));
00122   }
00123 }
00124
00125
00126
00127 //---------------------------------------------------------------------------
00128 //  W2T converts a ansi character string to unicode if _UNICODE is not
00129 //  defined.  If it is defined then the sting is copied to another buffer.
00130 //
00131 #ifndef _UNICODE
00132 #define W2T( pszAnsi, szWide )   Unicode2Ansi( pszAnsi, szWide )
00133 #else
00134 #define W2T( szAnsiPtr, szWide )                                 \
00135         *szAnsiPtr = (WCHAR*)CoTaskMemAlloc(BYTE_SIZE(szWide) ); \
00136         CopyMemory( *szAnsiPtr, szWide, BYTE_SIZE(szWide) )
00137 #endif
00138
00139
00140 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/CeLib.Cpp Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

CeLib.Cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1995 - 2000
00006 //
00007 //  File:       celib.cpp
00008 //
00009 //  Contents:   helper functions
00010 //
00011 //--------------------------------------------------------------------------
00012
00013 #include "pch.cpp"
00014 #pragma hdrstop
00015
00016 #include <stdio.h>
00017 #include <assert.h>
00018 #include "celibw2k.h"
00019
00020 #ifndef wszDURATIONUNITSDAYS
00021 # define wszDURATIONUNITSDAYS   wszPERIODDAYS
00022 # define wszDURATIONUNITSHOURS    wszPERIODHOURS
00023 # define wszDURATIONUNITSMINUTES  wszPERIODMINUTES
00024 # define wszDURATIONUNITSMONTHS   wszPERIODMONTHS
00025 # define wszDURATIONUNITSSECONDS  wszPERIODSECONDS
00026 # define wszDURATIONUNITSWEEKS    wszPERIODWEEKS
00027 # define wszDURATIONUNITSYEARS    wszPERIODYEARS
00028 #endif
00029
00030 //+--------------------------------------------------------------------------
00031 // ceDecodeObject -- call CryptDecodeObject, and allocate memory for output
00032 //
00033 //+--------------------------------------------------------------------------
00034
00035 BOOL
00036 ceDecodeObject(
00037     IN DWORD dwEncodingType,
00038     IN LPCSTR lpszStructType,
00039     IN BYTE const *pbEncoded,
00040     IN DWORD cbEncoded,
00041     IN BOOL fCoTaskMemAlloc,
00042     OUT VOID **ppvStructInfo,
00043     OUT DWORD *pcbStructInfo)
00044 {
00045     BOOL b;
00046
00047     assert(!fCoTaskMemAlloc);
00048     *ppvStructInfo = NULL;
00049     *pcbStructInfo = 0;
00050     while (TRUE)
00051     {
00052   b = CryptDecodeObject(
00053         dwEncodingType,
00054         lpszStructType,
00055         pbEncoded,
00056         cbEncoded,
00057         0,                  // dwFlags
00058         *ppvStructInfo,
00059         pcbStructInfo);
00060   if (b && 0 == *pcbStructInfo)
00061   {
00062       SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_DATA));
00063       b = FALSE;
00064   }
00065   if (!b)
00066   {
00067       if (NULL != *ppvStructInfo)
00068       {
00069     HRESULT hr = GetLastError();
00070
00071     LocalFree(*ppvStructInfo);
00072     *ppvStructInfo = NULL;
00073     SetLastError(hr);
00074       }
00075       break;
00076   }
00077   if (NULL != *ppvStructInfo)
00078   {
00079       break;
00080   }
00081   *ppvStructInfo = (BYTE *) LocalAlloc(LMEM_FIXED, *pcbStructInfo);
00082   if (NULL == *ppvStructInfo)
00083   {
00084       b = FALSE;
00085       break;
00086   }
00087     }
00088     return(b);
00089 }
00090
00091
00092 BOOL
00093 ceEncodeObject(
00094     IN DWORD dwEncodingType,
00095     IN LPCSTR lpszStructType,
00096     IN VOID const *pvStructInfo,
00097     IN DWORD dwFlags,
00098     IN BOOL fCoTaskMemAlloc,
00099     OUT BYTE **ppbEncoded,
00100     OUT DWORD *pcbEncoded)
00101 {
00102     BOOL b;
00103
00104     assert(0 == dwFlags);
00105     assert(!fCoTaskMemAlloc);
00106     *ppbEncoded = NULL;
00107     *pcbEncoded = 0;
00108     while (TRUE)
00109     {
00110   b = CryptEncodeObject(
00111         dwEncodingType,
00112         lpszStructType,
00113         const_cast<VOID *>(pvStructInfo),
00114         *ppbEncoded,
00115         pcbEncoded);
00116   if (b && 0 == *pcbEncoded)
00117   {
00118       SetLastError(HRESULT_FROM_WIN32(ERROR_INVALID_DATA));
00119       b = FALSE;
00120   }
00121   if (!b)
00122   {
00123       if (NULL != *ppbEncoded)
00124       {
00125     HRESULT hr = GetLastError();
00126
00127     LocalFree(*ppbEncoded);
00128     *ppbEncoded = NULL;
00129     SetLastError(hr);
00130       }
00131       break;
00132   }
00133   if (NULL != *ppbEncoded)
00134   {
00135       break;
00136   }
00137   *ppbEncoded = (BYTE *) LocalAlloc(LMEM_FIXED, *pcbEncoded);
00138   if (NULL == *ppbEncoded)
00139   {
00140       b = FALSE;
00141       break;
00142   }
00143     }
00144     return(b);
00145 }
00146
00147
00148 // The returned pszObjId is a constant that must not be freed.  CryptFindOIDInfo
00149 // has a static internal database that is valid until crypt32.dll is unloaded.
00150
00151 WCHAR const *
00152 ceGetOIDNameA(
00153     IN char const *pszObjId)
00154 {
00155     CRYPT_OID_INFO const *pInfo = NULL;
00156     WCHAR const *pwszName = L"";
00157
00158     // First try looking up the ObjectId as an Extension or Attribute, because
00159     // we get a better Display Name, especially for Subject RDNs: CN, L, etc.
00160     // If that fails, look it up withoput restricting the group.
00161
00162     pInfo = CryptFindOIDInfo(
00163       CRYPT_OID_INFO_OID_KEY,
00164       (VOID *) pszObjId,
00165       CRYPT_EXT_OR_ATTR_OID_GROUP_ID);
00166
00167     if (NULL == pInfo || NULL == pInfo->pwszName || L'\0' == pInfo->pwszName[0])
00168     {
00169   pInfo = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, (VOID *) pszObjId, 0);
00170     }
00171     if (NULL != pInfo && NULL != pInfo->pwszName && L'\0' != pInfo->pwszName[0])
00172     {
00173   pwszName = pInfo->pwszName;
00174     }
00175     return(pwszName);
00176 }
00177
00178
00179 WCHAR const *
00180 ceGetOIDName(
00181     IN WCHAR const *pwszObjId)
00182 {
00183     char *pszObjId = NULL;
00184     WCHAR const *pwszName = L"";
00185
00186     if (!ceConvertWszToSz(&pszObjId, pwszObjId, -1))
00187     {
00188   _JumpError(E_OUTOFMEMORY, error, "ceConvertWszToSz");
00189     }
00190     pwszName = ceGetOIDNameA(pszObjId);
00191
00192 error:
00193     if (NULL != pszObjId)
00194     {
00195   LocalFree(pszObjId);
00196     }
00197     return(pwszName);
00198 }
00199
00200
00201 WCHAR *
00202 ceDuplicateString(
00203     IN WCHAR const *pwsz)
00204 {
00205     WCHAR *pwszOut;
00206
00207     pwszOut = (WCHAR *) LocalAlloc(
00208         LMEM_FIXED,
00209         (wcslen(pwsz) + 1) * sizeof(pwsz[0]));
00210     if (NULL != pwszOut)
00211     {
00212   wcscpy(pwszOut, pwsz);
00213     }
00214     return(pwszOut);
00215 }
00216
00217
00218 BOOL
00219 ceConvertWszToSz(
00220     OUT CHAR **ppsz,
00221     IN WCHAR const *pwc,
00222     IN LONG cwc)
00223 {
00224     BOOL fOk = FALSE;
00225     LONG cch = 0;
00226
00227     *ppsz = NULL;
00228     while (TRUE)
00229     {
00230   cch = WideCharToMultiByte(
00231       GetACP(),
00232       0,          // dwFlags
00233       pwc,
00234       cwc,        // cchWideChar, -1 => null terminated
00235       *ppsz,
00236       cch,
00237       NULL,
00238       NULL);
00239   if (0 >= cch)
00240   {
00241       DWORD err;
00242
00243       err = GetLastError();
00244       ceERRORPRINTLINE("WideCharToMultiByte", err);
00245       if (NULL != *ppsz)
00246       {
00247     LocalFree(*ppsz);
00248     *ppsz = NULL;
00249       }
00250       break;
00251   }
00252   if (NULL != *ppsz)
00253   {
00254       fOk = TRUE;
00255       break;
00256   }
00257   *ppsz = (CHAR *) LocalAlloc(LMEM_FIXED, cch + 1);
00258   if (NULL == *ppsz)
00259   {
00260       break;
00261   }
00262     }
00263     return(fOk);
00264 }
00265
00266
00267 BOOL
00268 ceConvertWszToBstr(
00269     OUT BSTR *pbstr,
00270     IN WCHAR const *pwc,
00271     IN LONG cb)
00272 {
00273     BOOL fOk = FALSE;
00274     BSTR bstr;
00275
00276     ceFreeBstr(pbstr);
00277     do
00278     {
00279   bstr = NULL;
00280   if (NULL != pwc)
00281   {
00282       if (-1 == cb)
00283       {
00284     cb = (LONG)(wcslen(pwc) * sizeof(WCHAR));
00285       }
00286       bstr = SysAllocStringByteLen((char const *) pwc, cb);
00287       if (NULL == bstr)
00288       {
00289     break;
00290       }
00291   }
00292   *pbstr = bstr;
00293   fOk = TRUE;
00294     } while (FALSE);
00295     return(fOk);
00296 }
00297
00298
00299 BOOL
00300 ceConvertSzToWsz(
00301     OUT WCHAR **ppwsz,
00302     IN char const *pch,
00303     IN LONG cch)
00304 {
00305     BOOL fOk = FALSE;
00306     LONG cwc = 0;
00307
00308     *ppwsz = NULL;
00309     while (TRUE)
00310     {
00311   cwc = MultiByteToWideChar(GetACP(), 0, pch, cch, *ppwsz, cwc);
00312   if (0 >= cwc)
00313   {
00314       DWORD err;
00315
00316       err = GetLastError();
00317       ceERRORPRINTLINE("MultiByteToWideChar", err);
00318       if (NULL != *ppwsz)
00319       {
00320     LocalFree(*ppwsz);
00321     *ppwsz = NULL;
00322       }
00323       break;
00324   }
00325   if (NULL != *ppwsz)
00326   {
00327       fOk = TRUE;
00328       break;
00329   }
00330   *ppwsz = (WCHAR *) LocalAlloc(LMEM_FIXED, (cwc + 1) * sizeof(WCHAR));
00331   if (NULL == *ppwsz)
00332   {
00333       break;
00334   }
00335     }
00336     return(fOk);
00337 }
00338
00339
00340 BOOL
00341 ceConvertSzToBstr(
00342     OUT BSTR *pbstr,
00343     IN CHAR const *pch,
00344     IN LONG cch)
00345 {
00346     BOOL fOk = FALSE;
00347     BSTR bstr = NULL;
00348     LONG cwc = 0;
00349
00350     ceFreeBstr(pbstr);
00351     if (-1 == cch)
00352     {
00353   cch = (LONG)strlen(pch);
00354     }
00355     while (TRUE)
00356     {
00357   cwc = MultiByteToWideChar(GetACP(), 0, pch, cch, bstr, cwc);
00358   if (0 >= cwc)
00359   {
00360       //hr = ceHLastError();
00361       //printf("MultiByteToWideChar returned %d (%x)\n", hr, hr);
00362       break;
00363   }
00364   if (NULL != bstr)
00365   {
00366       bstr[cwc] = L'\0';
00367       *pbstr = bstr;
00368       fOk = TRUE;
00369       break;
00370   }
00371   bstr = SysAllocStringLen(NULL, cwc);
00372   if (NULL == bstr)
00373   {
00374       break;
00375   }
00376     }
00377     return(fOk);
00378 }
00379
00380
00381 VOID
00382 ceFreeBstr(
00383     IN OUT BSTR *pstr)
00384 {
00385     if (NULL != *pstr)
00386     {
00387   SysFreeString(*pstr);
00388   *pstr = NULL;
00389     }
00390 }
00391
00392
00393 HRESULT
00394 ceHError(
00395     IN HRESULT hr)
00396 {
00397     assert(S_FALSE != hr);
00398
00399     if (S_OK != hr && S_FALSE != hr && !FAILED(hr))
00400     {
00401         hr = HRESULT_FROM_WIN32(hr);
00402   if (0 == HRESULT_CODE(hr))
00403   {
00404       // A call failed without properly setting an error condition!
00405       hr = E_UNEXPECTED;
00406   }
00407   assert(FAILED(hr));
00408     }
00409     return(hr);
00410 }
00411
00412
00413 HRESULT
00414 ceHLastError(VOID)
00415 {
00416     return(ceHError(GetLastError()));
00417 }
00418
00419
00420 VOID
00421 ceErrorPrintLine(
00422     IN char const *pszFile,
00423     IN DWORD line,
00424     IN char const *pszMessage,
00425     IN HRESULT hr)
00426 {
00427     wprintf(
00428   L"CertEnc.Dll: Error: %hs(%u): %hs 0x%x (%d)\n",
00429   pszFile,
00430   line,
00431   pszMessage,
00432   hr,
00433   hr);
00434 }
00435
00436
00437 HRESULT
00438 ceDateToFileTime(
00439     IN DATE const *pDate,
00440     OUT FILETIME *pft)
00441 {
00442     SYSTEMTIME st;
00443     HRESULT hr = S_OK;
00444
00445     if (*pDate == 0.0)
00446     {
00447         GetSystemTime(&st);
00448     }
00449     else
00450     {
00451   if (!VariantTimeToSystemTime(*pDate, &st))
00452   {
00453       hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00454       _JumpError(hr, error, "VariantTimeToSystemTime");
00455   }
00456     }
00457
00458     if (!SystemTimeToFileTime(&st, pft))
00459     {
00460         hr = ceHLastError();
00461         _JumpError(hr, error, "SystemTimeToFileTime");
00462     }
00463
00464 error:
00465     return(hr);
00466 }
00467
00468
00469 HRESULT
00470 ceFileTimeToDate(
00471     IN FILETIME const *pft,
00472     OUT DATE *pDate)
00473 {
00474     SYSTEMTIME st;
00475     HRESULT hr = S_OK;
00476
00477     if (!FileTimeToSystemTime(pft, &st))
00478     {
00479         hr = ceHLastError();
00480         _JumpError(hr, error, "FileTimeToSystemTime");
00481     }
00482     if (!SystemTimeToVariantTime(&st, pDate))
00483     {
00484         hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00485         _JumpError(hr, error, "SystemTimeToVariantTime");
00486     }
00487
00488 error:
00489     return(hr);
00490 }
00491
00492
00493 VOID
00494 ceMakeExprDateTime(
00495     IN OUT FILETIME *pft,
00496     IN LONG lDelta,
00497     IN enum ENUM_PERIOD enumPeriod)
00498 {
00499     LONGLONG llDelta;
00500     BOOL fSysTimeDelta;
00501
00502     llDelta = lDelta;
00503     fSysTimeDelta = FALSE;
00504     switch (enumPeriod)
00505     {
00506   case ENUM_PERIOD_WEEKS:   llDelta *= CVT_WEEKS;    break;
00507   case ENUM_PERIOD_DAYS:    llDelta *= CVT_DAYS;     break;
00508   case ENUM_PERIOD_HOURS:   llDelta *= CVT_HOURS;    break;
00509   case ENUM_PERIOD_MINUTES: llDelta *= CVT_MINUTES;  break;
00510   case ENUM_PERIOD_SECONDS:         break;
00511   default:
00512       fSysTimeDelta = TRUE;
00513       break;
00514     }
00515     if (fSysTimeDelta)
00516     {
00517       SYSTEMTIME SystemTime;
00518
00519       FileTimeToSystemTime(pft, &SystemTime);
00520       switch (enumPeriod)
00521       {
00522           case ENUM_PERIOD_MONTHS:
00523         if (0 > lDelta)
00524         {
00525             DWORD dwDelta = (DWORD) -lDelta;
00526
00527             SystemTime.wYear -= (WORD) (dwDelta / 12) + 1;
00528             SystemTime.wMonth += 12 - (WORD) (dwDelta % 12);
00529         }
00530         else
00531         {
00532             SystemTime.wMonth += (WORD) lDelta;
00533         }
00534         if (12 < SystemTime.wMonth)
00535         {
00536             SystemTime.wYear += (SystemTime.wMonth - 1) / 12;
00537             SystemTime.wMonth = ((SystemTime.wMonth - 1) % 12) + 1;
00538         }
00539         break;
00540
00541           case ENUM_PERIOD_YEARS:
00542         SystemTime.wYear += (WORD) lDelta;
00543         break;
00544
00545           default:
00546         SystemTime.wYear += 1;
00547         break;
00548       }
00549
00550 DoConvert:
00551         if (!SystemTimeToFileTime(&SystemTime, pft))
00552         {
00553             if (GetLastError() != ERROR_INVALID_PARAMETER)
00554             {
00555                 assert(!"Unable to do time conversion");
00556                 return;
00557             }
00558
00559             // In some cases we'll convert to an invalid month-end
00560
00561             // only one month changes length from year to year
00562             if (SystemTime.wMonth == 2)
00563             {
00564                 // > 29? try leap year
00565                 if (SystemTime.wDay > 29)
00566                 {
00567                     SystemTime.wDay = 29;
00568                     goto DoConvert;
00569                 }
00570                 // == 29? try non-leap year
00571                 else if (SystemTime.wDay == 29)
00572                 {
00573                     SystemTime.wDay = 28;
00574                     goto DoConvert;
00575                 }
00576             }
00577             // sept (9), apr(4), jun(6), nov(11) all have 30 days
00578             else if ((SystemTime.wMonth == 9) ||
00579                      (SystemTime.wMonth == 4) ||
00580                      (SystemTime.wMonth == 6) ||
00581                      (SystemTime.wMonth == 11))
00582             {
00583                 if (SystemTime.wDay > 30)
00584                 {
00585                     SystemTime.wDay = 30;
00586                     goto DoConvert;
00587                 }
00588             }
00589
00590             // should never get here
00591             assert(!"Month/year processing: inaccessible code");
00592             return;
00593         }
00594     }
00595     else
00596     {
00597       *(LONGLONG *) pft += llDelta * CVT_BASE;
00598     }
00599 }
00600
00601
00602 HRESULT
00603 ceMakeExprDate(
00604     IN OUT DATE *pDate,
00605     IN LONG lDelta,
00606     IN enum ENUM_PERIOD enumPeriod)
00607 {
00608     HRESULT hr;
00609     FILETIME ft;
00610
00611     hr = ceDateToFileTime(pDate, &ft);
00612     _JumpIfError(hr, error, "ceDateToFileTime");
00613
00614     ceMakeExprDateTime(&ft, lDelta, enumPeriod);
00615
00616     hr = ceFileTimeToDate(&ft, pDate);
00617     _JumpIfError(hr, error, "ceFileTimeToDate");
00618
00619 error:
00620     return(hr);
00621 }
00622
00623
00624 typedef struct _UNITSTABLE
00625 {
00626     WCHAR const     *pwszString;
00627     enum ENUM_PERIOD enumPeriod;
00628 } UNITSTABLE;
00629
00630
00631 UNITSTABLE g_aut[] =
00632 {
00633     { wszDURATIONUNITSSECONDS, ENUM_PERIOD_SECONDS },
00634     { wszDURATIONUNITSMINUTES, ENUM_PERIOD_MINUTES },
00635     { wszDURATIONUNITSHOURS,   ENUM_PERIOD_HOURS },
00636     { wszDURATIONUNITSDAYS,    ENUM_PERIOD_DAYS },
00637     { wszDURATIONUNITSWEEKS,   ENUM_PERIOD_WEEKS },
00638     { wszDURATIONUNITSMONTHS,  ENUM_PERIOD_MONTHS },
00639     { wszDURATIONUNITSYEARS,   ENUM_PERIOD_YEARS },
00640 };
00641 #define CUNITSTABLEMAX  (sizeof(g_aut)/sizeof(g_aut[0]))
00642
00643
00644 HRESULT
00645 ceTranslatePeriodUnits(
00646     IN WCHAR const *pwszPeriod,
00647     IN LONG lCount,
00648     OUT enum ENUM_PERIOD *penumPeriod,
00649     OUT LONG *plCount)
00650 {
00651     HRESULT hr;
00652     UNITSTABLE const *put;
00653
00654     for (put = g_aut; put < &g_aut[CUNITSTABLEMAX]; put++)
00655     {
00656   if (0 == lstrcmpi(pwszPeriod, put->pwszString))
00657   {
00658       *penumPeriod = put->enumPeriod;
00659       if (0 > lCount)
00660       {
00661     lCount = MAXLONG;
00662       }
00663       *plCount = lCount;
00664       hr = S_OK;
00665       goto error;
00666   }
00667     }
00668     hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00669
00670 error:
00671     return(hr);
00672 }
00673
00674
00675 HRESULT
00676 ceVerifyObjId(
00677     IN WCHAR const *pwszObjId)
00678 {
00679     HRESULT hr;
00680     CHAR *pszObjId = NULL;
00681     DWORD cbEncoded;
00682     CRYPT_ATTRIBUTE ainfo;
00683
00684     if (!ceConvertWszToSz(&pszObjId, pwszObjId, -1))
00685     {
00686   hr = E_OUTOFMEMORY;
00687         ceERRORPRINTLINE("ceConvertWszToSz", hr);
00688         goto error;
00689     }
00690
00691     ainfo.pszObjId = pszObjId;
00692     ainfo.cValue = 0;
00693     if (!CryptEncodeObject(
00694          X509_ASN_ENCODING,
00695          PKCS_ATTRIBUTE,
00696          &ainfo,
00697          NULL,
00698          &cbEncoded))
00699     {
00700         hr = E_INVALIDARG;
00701         ceERRORPRINTLINE("invalid Obj Id", hr);
00702         goto error;
00703     }
00704     hr = S_OK;
00705
00706 error:
00707     if (NULL != pszObjId)
00708     {
00709       LocalFree(pszObjId);
00710     }
00711     return(hr);
00712 }
00713
00714
00715 HRESULT
00716 ceVerifyAltNameString(
00717     IN LONG NameChoice,
00718     IN WCHAR const *pwszName)
00719 {
00720     HRESULT hr = S_OK;
00721     CERT_ALT_NAME_INFO AltName;
00722     CERT_ALT_NAME_ENTRY Entry;
00723     char *pszObjectId = NULL;
00724     DWORD cbEncoded;
00725
00726     ZeroMemory(&AltName, sizeof(AltName));
00727     AltName.cAltEntry = 1;
00728     AltName.rgAltEntry = &Entry;
00729
00730     ZeroMemory(&Entry, sizeof(Entry));
00731     Entry.dwAltNameChoice = NameChoice;
00732
00733     switch (NameChoice)
00734     {
00735   case CERT_ALT_NAME_RFC822_NAME:
00736       Entry.pwszRfc822Name = const_cast<WCHAR *>(pwszName);
00737       break;
00738
00739   case CERT_ALT_NAME_DNS_NAME:
00740       Entry.pwszDNSName = const_cast<WCHAR *>(pwszName);
00741       break;
00742
00743   case CERT_ALT_NAME_URL:
00744       Entry.pwszURL = const_cast<WCHAR *>(pwszName);
00745       break;
00746
00747   case CERT_ALT_NAME_REGISTERED_ID:
00748       if (!ceConvertWszToSz(&pszObjectId, pwszName, -1))
00749       {
00750     hr = E_OUTOFMEMORY;
00751     ceERRORPRINTLINE("ceConvertWszToSz", hr);
00752     goto error;
00753       }
00754       Entry.pszRegisteredID = pszObjectId;
00755       break;
00756
00757   //case CERT_ALT_NAME_DIRECTORY_NAME:
00758   //case CERT_ALT_NAME_OTHER_NAME:
00759   //case CERT_ALT_NAME_X400_ADDRESS:
00760   //case CERT_ALT_NAME_EDI_PARTY_NAME:
00761   //case CERT_ALT_NAME_IP_ADDRESS:
00762   default:
00763       hr = E_INVALIDARG;
00764       ceERRORPRINTLINE("NameChoice", hr);
00765       goto error;
00766
00767     }
00768
00769     // Encode CERT_ALT_NAME_INFO:
00770
00771     if (!CryptEncodeObject(
00772         X509_ASN_ENCODING,
00773         X509_ALTERNATE_NAME,
00774         &AltName,
00775         NULL,
00776         &cbEncoded))
00777     {
00778   hr = ceHLastError();
00779   ceERRORPRINTLINE("ceEncodeObject", hr);
00780   goto error;
00781     }
00782
00783 error:
00784     if (NULL != pszObjectId)
00785     {
00786   LocalFree(pszObjectId);
00787     }
00788     return(hr);
00789 }
00790
00791
00792 HRESULT
00793 ceDispatchSetErrorInfo(
00794     IN HRESULT hrError,
00795     IN WCHAR const *pwszDescription,
00796     OPTIONAL IN WCHAR const *pwszProgId,
00797     OPTIONAL IN IID const *piid)
00798 {
00799     HRESULT hr;
00800     ICreateErrorInfo *pCreateErrorInfo = NULL;
00801     IErrorInfo *pErrorInfo = NULL;
00802     WCHAR *pwszError = NULL;
00803     WCHAR *pwszText = NULL;
00804
00805     if (NULL == pwszDescription)
00806     {
00807         hr = E_POINTER;
00808         ceERRORPRINTLINE("NULL pointer", hr);
00809         goto error;
00810     }
00811
00812     assert(FAILED(hrError));
00813     pwszError = ceGetErrorMessageText(hrError, TRUE);
00814     if (NULL == pwszError)
00815     {
00816   ceERRORPRINTLINE("ceGetErrorMessageText", E_OUTOFMEMORY);
00817     }
00818     else
00819     {
00820   pwszText = (WCHAR *) LocalAlloc(
00821       LMEM_FIXED,
00822       (wcslen(pwszDescription) + 1 + wcslen(pwszError) + 1) *
00823        sizeof(WCHAR));
00824   if (NULL == pwszText)
00825   {
00826       ceERRORPRINTLINE("LocalAlloc", E_OUTOFMEMORY);
00827   }
00828   else
00829   {
00830       wcscpy(pwszText, pwszDescription);
00831       wcscat(pwszText, L" ");
00832       wcscpy(pwszText, pwszError);
00833   }
00834     }
00835
00836     hr = CreateErrorInfo(&pCreateErrorInfo);
00837     if (S_OK != hr)
00838     {
00839         ceERRORPRINTLINE("CreateErrorInfo", hr);
00840         goto error;
00841     }
00842
00843     if (NULL != piid)
00844     {
00845   hr = pCreateErrorInfo->SetGUID(*piid);
00846   if (S_OK != hr)
00847   {
00848       ceERRORPRINTLINE("SetGUID", hr);
00849   }
00850     }
00851
00852     hr = pCreateErrorInfo->SetDescription(
00853         NULL != pwszText?
00854       pwszText : const_cast<WCHAR *>(pwszDescription));
00855     if (S_OK != hr)
00856     {
00857   ceERRORPRINTLINE("SetDescription", hr);
00858     }
00859
00860     // Set ProgId:
00861
00862     if (NULL != pwszProgId)
00863     {
00864   hr = pCreateErrorInfo->SetSource(const_cast<WCHAR *>(pwszProgId));
00865   if (S_OK != hr)
00866   {
00867       ceERRORPRINTLINE("SetSource", hr);
00868   }
00869     }
00870
00871     hr = pCreateErrorInfo->QueryInterface(
00872             IID_IErrorInfo,
00873             (VOID **) &pErrorInfo);
00874     if (S_OK != hr)
00875     {
00876         ceERRORPRINTLINE("QueryInterface", hr);
00877         goto error;
00878     }
00879
00880     SetErrorInfo(0, pErrorInfo);
00881
00882 error:
00883     if (NULL != pErrorInfo)
00884     {
00885   pErrorInfo->Release();
00886     }
00887     if (NULL != pCreateErrorInfo)
00888     {
00889   pCreateErrorInfo->Release();
00890     }
00891     if (NULL != pwszText)
00892     {
00893   LocalFree(pwszText);
00894     }
00895     if (NULL != pwszError)
00896     {
00897   LocalFree(pwszError);
00898     }
00899     return(hrError);  // return input error!
00900 }
00901
00902
00903 int
00904 ceWtoI(
00905     IN WCHAR const *string,
00906     OUT BOOL *pfValid)
00907 {
00908     HRESULT hr;
00909     WCHAR szBuf[16];
00910     WCHAR *szTmp = szBuf;
00911     int cTmp = ARRAYSIZE(szBuf);
00912     int i = 0;
00913     WCHAR const *pwsz;
00914     BOOL fSawDigit = FALSE;
00915
00916     assert(NULL != pfValid);
00917     cTmp = FoldString(
00918         MAP_FOLDDIGITS,
00919         string,
00920         -1,
00921         szTmp,
00922         cTmp);
00923     if (cTmp == 0)
00924     {
00925         hr = ceHLastError();
00926         if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) == hr)
00927         {
00928             hr = S_OK;
00929             cTmp = FoldString(
00930                 MAP_FOLDDIGITS,
00931                 string,
00932                 -1,
00933                 NULL,
00934                 0);
00935
00936             szTmp = (WCHAR*)LocalAlloc(LMEM_FIXED, cTmp*sizeof(WCHAR));
00937       if (NULL == szTmp)
00938       {
00939     hr = E_OUTOFMEMORY;
00940     _JumpError(hr, error, "LocalAlloc");
00941       }
00942
00943             cTmp = FoldString(
00944                 MAP_FOLDDIGITS,
00945                 string,
00946                 -1,
00947                 szTmp,
00948                 cTmp);
00949
00950             if (cTmp == 0)
00951                 hr = ceHLastError();
00952         }
00953         _JumpIfError(hr, error, "FoldString");
00954     }
00955     pwsz = szTmp;
00956     while (iswspace(*pwsz))
00957     {
00958   pwsz++;
00959     }
00960     while (iswdigit(*pwsz))
00961     {
00962   fSawDigit = TRUE;
00963   pwsz++;
00964     }
00965     while (iswspace(*pwsz))
00966     {
00967   pwsz++;
00968     }
00969     if (L'\0' == *pwsz)
00970     {
00971   *pfValid = fSawDigit;
00972     }
00973     i = _wtoi(szTmp);
00974
00975 error:
00976     if (szTmp && (szTmp != szBuf))
00977        LocalFree(szTmp);
00978
00979     return i;
00980 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/EdCommands_p.c Source File

  • Web
  • Browser
  • EditFeatures

EdCommands_p.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /* this ALWAYS GENERATED file contains the proxy stub code */
00006
00007
00008 /* File created by MIDL compiler version 5.01.0164 */
00009 /* at Thu Feb 24 17:37:31 2000
00010  */
00011 /* Compiler settings for C:\workshop\samples\browser\EditFeatures\EdCommands.idl:
00012     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00013     error checks: allocation ref bounds_check enum stub_data
00014 */
00015 //@@MIDL_FILE_HEADING(  )
00016
00017 #define USE_STUBLESS_PROXY
00018
00019
00020 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00021 #ifndef __REDQ_RPCPROXY_H_VERSION__
00022 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00023 #endif
00024
00025
00026 #include "rpcproxy.h"
00027 #ifndef __RPCPROXY_H_VERSION__
00028 #error this stub requires an updated version of <rpcproxy.h>
00029 #endif // __RPCPROXY_H_VERSION__
00030
00031
00032 #include "EdCommands.h"
00033
00034 #define TYPE_FORMAT_STRING_SIZE   7
00035 #define PROC_FORMAT_STRING_SIZE   129
00036
00037 typedef struct _MIDL_TYPE_FORMAT_STRING
00038     {
00039     short          Pad;
00040     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00041     } MIDL_TYPE_FORMAT_STRING;
00042
00043 typedef struct _MIDL_PROC_FORMAT_STRING
00044     {
00045     short          Pad;
00046     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00047     } MIDL_PROC_FORMAT_STRING;
00048
00049
00050 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00051 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00052
00053
00054 /* Object interface: IUnknown, ver. 0.0,
00055    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IDispatch, ver. 0.0,
00059    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00060
00061
00062 /* Object interface: IBrowserHost, ver. 0.0,
00063    GUID={0x5FD6158A,0x71F6,0x4F20,{0xB8,0xA9,0x6E,0xAF,0x5D,0x03,0x2D,0x15}} */
00064
00065
00066 extern const MIDL_STUB_DESC Object_StubDesc;
00067
00068
00069 extern const MIDL_SERVER_INFO IBrowserHost_ServerInfo;
00070
00071 #pragma code_seg(".orpc")
00072 static const unsigned short IBrowserHost_FormatStringOffsetTable[] =
00073     {
00074     (unsigned short) -1,
00075     (unsigned short) -1,
00076     (unsigned short) -1,
00077     (unsigned short) -1,
00078     0,
00079     22,
00080     44
00081     };
00082
00083 static const MIDL_SERVER_INFO IBrowserHost_ServerInfo =
00084     {
00085     &Object_StubDesc,
00086     0,
00087     __MIDL_ProcFormatString.Format,
00088     &IBrowserHost_FormatStringOffsetTable[-3],
00089     0,
00090     0,
00091     0,
00092     0
00093     };
00094
00095 static const MIDL_STUBLESS_PROXY_INFO IBrowserHost_ProxyInfo =
00096     {
00097     &Object_StubDesc,
00098     __MIDL_ProcFormatString.Format,
00099     &IBrowserHost_FormatStringOffsetTable[-3],
00100     0,
00101     0,
00102     0
00103     };
00104
00105 CINTERFACE_PROXY_VTABLE(10) _IBrowserHostProxyVtbl =
00106 {
00107     &IBrowserHost_ProxyInfo,
00108     &IID_IBrowserHost,
00109     IUnknown_QueryInterface_Proxy,
00110     IUnknown_AddRef_Proxy,
00111     IUnknown_Release_Proxy ,
00112     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00113     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00114     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00115     0 /* IDispatch_Invoke_Proxy */ ,
00116     (void *)-1 /* IBrowserHost::Run */ ,
00117     (void *)-1 /* IBrowserHost::Stop */ ,
00118     (void *)-1 /* IBrowserHost::GetHwnd */
00119 };
00120
00121
00122 static const PRPC_STUB_FUNCTION IBrowserHost_table[] =
00123 {
00124     STUB_FORWARDING_FUNCTION,
00125     STUB_FORWARDING_FUNCTION,
00126     STUB_FORWARDING_FUNCTION,
00127     STUB_FORWARDING_FUNCTION,
00128     NdrStubCall2,
00129     NdrStubCall2,
00130     NdrStubCall2
00131 };
00132
00133 CInterfaceStubVtbl _IBrowserHostStubVtbl =
00134 {
00135     &IID_IBrowserHost,
00136     &IBrowserHost_ServerInfo,
00137     10,
00138     &IBrowserHost_table[-3],
00139     CStdStubBuffer_DELEGATING_METHODS
00140 };
00141
00142
00143 /* Object interface: ISnap, ver. 0.0,
00144    GUID={0xCCBFDE40,0xFE5D,0x4A3C,{0x88,0x0B,0x47,0x83,0x97,0x15,0xE3,0xAC}} */
00145
00146
00147 extern const MIDL_STUB_DESC Object_StubDesc;
00148
00149
00150 extern const MIDL_SERVER_INFO ISnap_ServerInfo;
00151
00152 #pragma code_seg(".orpc")
00153
00154 static const MIDL_STUB_DESC Object_StubDesc =
00155     {
00156     0,
00157     NdrOleAllocate,
00158     NdrOleFree,
00159     0,
00160     0,
00161     0,
00162     0,
00163     0,
00164     __MIDL_TypeFormatString.Format,
00165     1, /* -error bounds_check flag */
00166     0x20000, /* Ndr library version */
00167     0,
00168     0x50100a4, /* MIDL Version 5.1.164 */
00169     0,
00170     0,
00171     0,  /* notify & notify_flag routine table */
00172     1,  /* Flags */
00173     0,  /* Reserved3 */
00174     0,  /* Reserved4 */
00175     0   /* Reserved5 */
00176     };
00177
00178 static const unsigned short ISnap_FormatStringOffsetTable[] =
00179     {
00180     (unsigned short) -1,
00181     (unsigned short) -1,
00182     (unsigned short) -1,
00183     (unsigned short) -1,
00184     72,
00185     100
00186     };
00187
00188 static const MIDL_SERVER_INFO ISnap_ServerInfo =
00189     {
00190     &Object_StubDesc,
00191     0,
00192     __MIDL_ProcFormatString.Format,
00193     &ISnap_FormatStringOffsetTable[-3],
00194     0,
00195     0,
00196     0,
00197     0
00198     };
00199
00200 static const MIDL_STUBLESS_PROXY_INFO ISnap_ProxyInfo =
00201     {
00202     &Object_StubDesc,
00203     __MIDL_ProcFormatString.Format,
00204     &ISnap_FormatStringOffsetTable[-3],
00205     0,
00206     0,
00207     0
00208     };
00209
00210 CINTERFACE_PROXY_VTABLE(9) _ISnapProxyVtbl =
00211 {
00212     &ISnap_ProxyInfo,
00213     &IID_ISnap,
00214     IUnknown_QueryInterface_Proxy,
00215     IUnknown_AddRef_Proxy,
00216     IUnknown_Release_Proxy ,
00217     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00218     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00219     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00220     0 /* IDispatch_Invoke_Proxy */ ,
00221     (void *)-1 /* ISnap::GetSnapOn */ ,
00222     (void *)-1 /* ISnap::SetSnapOn */
00223 };
00224
00225
00226 static const PRPC_STUB_FUNCTION ISnap_table[] =
00227 {
00228     STUB_FORWARDING_FUNCTION,
00229     STUB_FORWARDING_FUNCTION,
00230     STUB_FORWARDING_FUNCTION,
00231     STUB_FORWARDING_FUNCTION,
00232     NdrStubCall2,
00233     NdrStubCall2
00234 };
00235
00236 CInterfaceStubVtbl _ISnapStubVtbl =
00237 {
00238     &IID_ISnap,
00239     &ISnap_ServerInfo,
00240     9,
00241     &ISnap_table[-3],
00242     CStdStubBuffer_DELEGATING_METHODS
00243 };
00244
00245 #pragma data_seg(".rdata")
00246
00247 #if !defined(__RPC_WIN32__)
00248 #error  Invalid build platform for this stub.
00249 #endif
00250
00251 #if !(TARGET_IS_NT40_OR_LATER)
00252 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00253 #error   -Oif or -Oicf, more than 32 methods in the interface.
00254 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00255 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00256 #endif
00257
00258
00259 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00260     {
00261         0,
00262         {
00263
00264   /* Procedure Run */
00265
00266       0x33,   /* FC_AUTO_HANDLE */
00267       0x6c,   /* Old Flags:  object, Oi2 */
00268 /*  2 */  NdrFcLong( 0x0 ), /* 0 */
00269 /*  6 */  NdrFcShort( 0x7 ),  /* 7 */
00270 #ifndef _ALPHA_
00271 /*  8 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00272 #else
00273       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00274 #endif
00275 /* 10 */  NdrFcShort( 0x0 ),  /* 0 */
00276 /* 12 */  NdrFcShort( 0x8 ),  /* 8 */
00277 /* 14 */  0x4,    /* Oi2 Flags:  has return, */
00278       0x1,    /* 1 */
00279
00280   /* Return value */
00281
00282 /* 16 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00283 #ifndef _ALPHA_
00284 /* 18 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00285 #else
00286       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00287 #endif
00288 /* 20 */  0x8,    /* FC_LONG */
00289       0x0,    /* 0 */
00290
00291   /* Procedure Stop */
00292
00293 /* 22 */  0x33,   /* FC_AUTO_HANDLE */
00294       0x6c,   /* Old Flags:  object, Oi2 */
00295 /* 24 */  NdrFcLong( 0x0 ), /* 0 */
00296 /* 28 */  NdrFcShort( 0x8 ),  /* 8 */
00297 #ifndef _ALPHA_
00298 /* 30 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00299 #else
00300       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00301 #endif
00302 /* 32 */  NdrFcShort( 0x0 ),  /* 0 */
00303 /* 34 */  NdrFcShort( 0x8 ),  /* 8 */
00304 /* 36 */  0x4,    /* Oi2 Flags:  has return, */
00305       0x1,    /* 1 */
00306
00307   /* Return value */
00308
00309 /* 38 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00310 #ifndef _ALPHA_
00311 /* 40 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00312 #else
00313       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00314 #endif
00315 /* 42 */  0x8,    /* FC_LONG */
00316       0x0,    /* 0 */
00317
00318   /* Procedure GetHwnd */
00319
00320 /* 44 */  0x33,   /* FC_AUTO_HANDLE */
00321       0x6c,   /* Old Flags:  object, Oi2 */
00322 /* 46 */  NdrFcLong( 0x0 ), /* 0 */
00323 /* 50 */  NdrFcShort( 0x9 ),  /* 9 */
00324 #ifndef _ALPHA_
00325 /* 52 */  NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00326 #else
00327       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00328 #endif
00329 /* 54 */  NdrFcShort( 0x8 ),  /* 8 */
00330 /* 56 */  NdrFcShort( 0x8 ),  /* 8 */
00331 /* 58 */  0x4,    /* Oi2 Flags:  has return, */
00332       0x2,    /* 2 */
00333
00334   /* Parameter phwnd */
00335
00336 /* 60 */  NdrFcShort( 0x148 ),  /* Flags:  in, base type, simple ref, */
00337 #ifndef _ALPHA_
00338 /* 62 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00339 #else
00340       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00341 #endif
00342 /* 64 */  0x8,    /* FC_LONG */
00343       0x0,    /* 0 */
00344
00345   /* Return value */
00346
00347 /* 66 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00348 #ifndef _ALPHA_
00349 /* 68 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00350 #else
00351       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00352 #endif
00353 /* 70 */  0x8,    /* FC_LONG */
00354       0x0,    /* 0 */
00355
00356   /* Procedure GetSnapOn */
00357
00358 /* 72 */  0x33,   /* FC_AUTO_HANDLE */
00359       0x6c,   /* Old Flags:  object, Oi2 */
00360 /* 74 */  NdrFcLong( 0x0 ), /* 0 */
00361 /* 78 */  NdrFcShort( 0x7 ),  /* 7 */
00362 #ifndef _ALPHA_
00363 /* 80 */  NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00364 #else
00365       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00366 #endif
00367 /* 82 */  NdrFcShort( 0x8 ),  /* 8 */
00368 /* 84 */  NdrFcShort( 0x8 ),  /* 8 */
00369 /* 86 */  0x4,    /* Oi2 Flags:  has return, */
00370       0x2,    /* 2 */
00371
00372   /* Parameter lIsOn */
00373
00374 /* 88 */  NdrFcShort( 0x148 ),  /* Flags:  in, base type, simple ref, */
00375 #ifndef _ALPHA_
00376 /* 90 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00377 #else
00378       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00379 #endif
00380 /* 92 */  0x8,    /* FC_LONG */
00381       0x0,    /* 0 */
00382
00383   /* Return value */
00384
00385 /* 94 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00386 #ifndef _ALPHA_
00387 /* 96 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00388 #else
00389       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00390 #endif
00391 /* 98 */  0x8,    /* FC_LONG */
00392       0x0,    /* 0 */
00393
00394   /* Procedure SetSnapOn */
00395
00396 /* 100 */ 0x33,   /* FC_AUTO_HANDLE */
00397       0x6c,   /* Old Flags:  object, Oi2 */
00398 /* 102 */ NdrFcLong( 0x0 ), /* 0 */
00399 /* 106 */ NdrFcShort( 0x8 ),  /* 8 */
00400 #ifndef _ALPHA_
00401 /* 108 */ NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00402 #else
00403       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00404 #endif
00405 /* 110 */ NdrFcShort( 0x8 ),  /* 8 */
00406 /* 112 */ NdrFcShort( 0x8 ),  /* 8 */
00407 /* 114 */ 0x4,    /* Oi2 Flags:  has return, */
00408       0x2,    /* 2 */
00409
00410   /* Parameter lIsOn */
00411
00412 /* 116 */ NdrFcShort( 0x48 ), /* Flags:  in, base type, */
00413 #ifndef _ALPHA_
00414 /* 118 */ NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00415 #else
00416       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00417 #endif
00418 /* 120 */ 0x8,    /* FC_LONG */
00419       0x0,    /* 0 */
00420
00421   /* Return value */
00422
00423 /* 122 */ NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00424 #ifndef _ALPHA_
00425 /* 124 */ NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00426 #else
00427       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00428 #endif
00429 /* 126 */ 0x8,    /* FC_LONG */
00430       0x0,    /* 0 */
00431
00432       0x0
00433         }
00434     };
00435
00436 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00437     {
00438         0,
00439         {
00440       NdrFcShort( 0x0 ),  /* 0 */
00441 /*  2 */
00442       0x11, 0x8,  /* FC_RP [simple_pointer] */
00443 /*  4 */  0x8,    /* FC_LONG */
00444       0x5c,   /* FC_PAD */
00445
00446       0x0
00447         }
00448     };
00449
00450 const CInterfaceProxyVtbl * _EdCommands_ProxyVtblList[] =
00451 {
00452     ( CInterfaceProxyVtbl *) &_ISnapProxyVtbl,
00453     ( CInterfaceProxyVtbl *) &_IBrowserHostProxyVtbl,
00454     0
00455 };
00456
00457 const CInterfaceStubVtbl * _EdCommands_StubVtblList[] =
00458 {
00459     ( CInterfaceStubVtbl *) &_ISnapStubVtbl,
00460     ( CInterfaceStubVtbl *) &_IBrowserHostStubVtbl,
00461     0
00462 };
00463
00464 PCInterfaceName const _EdCommands_InterfaceNamesList[] =
00465 {
00466     "ISnap",
00467     "IBrowserHost",
00468     0
00469 };
00470
00471 const IID *  _EdCommands_BaseIIDList[] =
00472 {
00473     &IID_IDispatch,
00474     &IID_IDispatch,
00475     0
00476 };
00477
00478
00479 #define _EdCommands_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _EdCommands, pIID, n)
00480
00481 int __stdcall _EdCommands_IID_Lookup( const IID * pIID, int * pIndex )
00482 {
00483     IID_BS_LOOKUP_SETUP
00484
00485     IID_BS_LOOKUP_INITIAL_TEST( _EdCommands, 2, 1 )
00486     IID_BS_LOOKUP_RETURN_RESULT( _EdCommands, 2, *pIndex )
00487
00488 }
00489
00490 const ExtendedProxyFileInfo EdCommands_ProxyFileInfo =
00491 {
00492     (PCInterfaceProxyVtblList *) & _EdCommands_ProxyVtblList,
00493     (PCInterfaceStubVtblList *) & _EdCommands_StubVtblList,
00494     (const PCInterfaceName * ) & _EdCommands_InterfaceNamesList,
00495     (const IID ** ) & _EdCommands_BaseIIDList,
00496     & _EdCommands_IID_Lookup,
00497     2,
00498     2,
00499     0, /* table of [async_uuid] interfaces */
00500     0, /* Filler1 */
00501     0, /* Filler2 */
00502     0  /* Filler3 */
00503 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/ccommand.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

ccommand.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CCOMMAND.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 /////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 /////////////////////////////////////////////////////////////////
00019 // CCommand::CCommand
00020 //
00021 /////////////////////////////////////////////////////////////////
00022 CCommand::CCommand(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00023   : CDataAccess(eCCommand, pCMainWindow, pCMDIChild)
00024 {
00025   //OLE DB Interfaces
00026   m_pICommand         = NULL;   //Command interface
00027   m_pICommandProperties   = NULL;   //Command interface
00028   m_pICommandText       = NULL;   //Command interface
00029   m_pICommandStream     = NULL;   //Command interface
00030   m_pICommandPrepare      = NULL;   //Command interface
00031   m_pICommandPersist      = NULL;   //Command interface
00032   m_pICommandWithParameters = NULL;   //Command interface
00033
00034   //Data
00035   m_guidDialect       = DBGUID_DEFAULT;
00036 }
00037
00038 /////////////////////////////////////////////////////////////////
00039 // CCommand::~CCommand
00040 //
00041 /////////////////////////////////////////////////////////////////
00042 CCommand::~CCommand()
00043 {
00044   ReleaseObject(0);
00045 }
00046
00047
00048 /////////////////////////////////////////////////////////////////
00049 // IUnknown** CCommand::GetInterfaceAddress
00050 //
00051 /////////////////////////////////////////////////////////////////
00052 IUnknown** CCommand::GetInterfaceAddress(REFIID riid)
00053 {
00054   HANDLE_GETINTERFACE(ICommand);
00055   HANDLE_GETINTERFACE(ICommandProperties);
00056   HANDLE_GETINTERFACE(ICommandText);
00057   HANDLE_GETINTERFACE(ICommandStream);
00058   HANDLE_GETINTERFACE(ICommandPrepare);
00059   HANDLE_GETINTERFACE(ICommandPersist);
00060   HANDLE_GETINTERFACE(ICommandWithParameters);
00061
00062   //Otherwise delegate
00063   return CDataAccess::GetInterfaceAddress(riid);
00064 }
00065
00066
00067 /////////////////////////////////////////////////////////////////
00068 // HRESULT CCommand::AutoRelease
00069 //
00070 /////////////////////////////////////////////////////////////////
00071 HRESULT CCommand::AutoRelease()
00072 {
00073   ReleaseAccessor(&m_Parameters.GetParams().hAccessor);
00074   m_Parameters.RemoveAll();
00075
00076   //Command
00077   RELEASE_INTERFACE(IAccessor);
00078   RELEASE_INTERFACE(IColumnsInfo);
00079   RELEASE_INTERFACE(ICommand);
00080   RELEASE_INTERFACE(ICommandProperties);
00081   RELEASE_INTERFACE(ICommandText);
00082   RELEASE_INTERFACE(ICommandStream);
00083   RELEASE_INTERFACE(IConvertType);
00084   RELEASE_INTERFACE(ICommandPrepare);
00085   RELEASE_INTERFACE(ICommandPersist);
00086   RELEASE_INTERFACE(ICommandWithParameters);
00087
00088   //Delegate
00089   return CDataAccess::AutoRelease();
00090 }
00091
00092
00093 /////////////////////////////////////////////////////////////////
00094 // HRESULT CCommand::AutoQI
00095 //
00096 /////////////////////////////////////////////////////////////////
00097 HRESULT CCommand::AutoQI(DWORD dwCreateOpts)
00098 {
00099   //Delegate First so we have base interfaces
00100   CDataAccess::AutoQI(dwCreateOpts);
00101
00102   //[MANDATORY]
00103   if(dwCreateOpts & CREATE_QI_MANDATORY)
00104   {
00105     OBTAIN_INTERFACE(ICommand);
00106     OBTAIN_INTERFACE(ICommandText);
00107   }
00108
00109   //[OPTIONAL]
00110   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00111   {
00112     //[OPTIONAL]
00113     OBTAIN_INTERFACE(ICommandStream);
00114     OBTAIN_INTERFACE(ICommandProperties);
00115     OBTAIN_INTERFACE(ICommandPrepare);
00116     OBTAIN_INTERFACE(ICommandPersist);
00117     OBTAIN_INTERFACE(ICommandWithParameters);
00118   }
00119
00120   return S_OK;
00121 }
00122
00123
00124 /////////////////////////////////////////////////////////////////
00125 // HRESULT CCommand::SetProperties
00126 //
00127 /////////////////////////////////////////////////////////////////
00128 HRESULT CCommand::SetProperties(ULONG cPropSets, DBPROPSET* rgPropSets)
00129 {
00130   HRESULT hr = E_FAIL;
00131
00132   //Initally setup up some rowset properties that are very useful functionality
00133   //These are mainly to have the most common operations on the rowset and to
00134   //be able to obtain blob columns...
00135
00136   if(m_pICommandProperties)
00137   {
00138     //ICommandProperties::SetProperties
00139     XTEST_(hr = m_pICommandProperties->SetProperties(cPropSets, rgPropSets),S_OK);
00140     TRACE_METHOD(hr, L"ICommandProperties::SetProperties(%d, 0x%p)", cPropSets, rgPropSets);
00141
00142     //Display property errors
00143     TESTC(hr = DisplayPropErrors(hr, cPropSets, rgPropSets));
00144   }
00145
00146 CLEANUP:
00147   return hr;
00148 }
00149
00150
00151 /////////////////////////////////////////////////////////////////
00152 // HRESULT CCommand::GetCurrentCommand
00153 //
00154 /////////////////////////////////////////////////////////////////
00155 HRESULT CCommand::GetCurrentCommand(DBID** ppCommandID)
00156 {
00157   HRESULT hr = E_FAIL;
00158
00159   if(m_pICommandPersist)
00160   {
00161     WCHAR wszCommandID[MAX_NAME_LEN] = {0};
00162
00163     //ICommandPersist::GetCurrentCommand
00164     hr = m_pICommandPersist->GetCurrentCommand(ppCommandID);
00165
00166     //Format the resultant DBID into something the user can look at...
00167     DBIDToString(ppCommandID ? *ppCommandID : NULL, wszCommandID, MAX_NAME_LEN);
00168     TESTC(TRACE_METHOD(hr, L"ICommandPersist::GetCurrentCommand({\"%s\"})", wszCommandID));
00169   }
00170
00171 CLEANUP:
00172   return hr;
00173 }
00174
00175
00176 /////////////////////////////////////////////////////////////////
00177 // HRESULT CCommand::CreateParamAccessor
00178 //
00179 /////////////////////////////////////////////////////////////////
00180 HRESULT CCommand::CreateParamAccessor(DB_UPARAMS cParams, DBPARAMINFO* rgParamInfo, DB_UPARAMS cParamSets)
00181 {
00182   HRESULT   hr = S_OK;
00183   DBCOUNTITEM cBindings = 0;
00184   DBBINDING*  rgBindings = NULL;
00185   HACCESSOR hAccessor = NULL;
00186   DBLENGTH  cbRowSize = 0;
00187
00188   //Release Previous Accessor
00189   ReleaseAccessor(&m_Parameters.GetParams().hAccessor);
00190   m_Parameters.RemoveAll();
00191
00192   //Setup the Bindings
00193   TESTC(hr = SetupBindings(cParams, rgParamInfo, &cBindings, &rgBindings, &cbRowSize));
00194
00195   //Create the Accessor
00196   TESTC(hr = CreateAccessor(DBACCESSOR_PARAMETERDATA, cBindings, rgBindings, cbRowSize, &hAccessor));
00197
00198   //Attach our object...
00199   TESTC(hr = m_Parameters.Attach(cParamSets, hAccessor, cbRowSize));
00200   m_Parameters.GetBindings().Attach(cBindings, rgBindings);
00201
00202 CLEANUP:
00203   return hr;
00204 }
00205
00206
00207 /////////////////////////////////////////////////////////////////
00208 // HRESULT CCommand::SetupBindings
00209 //
00210 /////////////////////////////////////////////////////////////////
00211 HRESULT CCommand::SetupBindings(DB_UPARAMS cParams, DBPARAMINFO* rgParamInfo, DBCOUNTITEM* pcBindings, DBBINDING** prgBindings, DBLENGTH* pcRowSize)
00212 {
00213   ASSERT(pcBindings);
00214   ASSERT(prgBindings);
00215
00216   HRESULT hr = S_OK;
00217
00218   DBLENGTH dwOffset = 0;
00219   DBCOUNTITEM i,cBindings = 0;
00220   DBBINDING* rgBindings = NULL;
00221
00222   //Only capable of the Following Converions (for Display)
00223   DWORD dwMaxLength   = GetOptions()->m_dwMaxLength;
00224   DWORD dwAccessorOpts  = GetOptions()->m_dwAccessorOpts;
00225
00226   //Alloc the space to hold the Bindings and Accessors
00227   SAFE_ALLOC(rgBindings, DBBINDING, cParams);
00228
00229   cBindings = 0;
00230   for(i=0; i<cParams; i++)
00231   {
00232     ASSERT(rgParamInfo);
00233
00234     //SetUp the Bindings
00235     rgBindings[cBindings].iOrdinal  = rgParamInfo[i].iOrdinal;
00236     rgBindings[cBindings].obStatus  = dwOffset;
00237     dwOffset += ROUNDUP(sizeof(DBSTATUS));
00238     rgBindings[cBindings].obLength  = dwOffset;
00239     dwOffset += ROUNDUP(sizeof(DBLENGTH));
00240     rgBindings[cBindings].obValue = dwOffset;
00241
00242     rgBindings[cBindings].pTypeInfo = NULL;
00243     rgBindings[cBindings].pBindExt  = NULL;
00244
00245     rgBindings[cBindings].dwPart  = dwAccessorOpts & (DBPART_VALUE|DBPART_LENGTH|DBPART_STATUS);
00246     rgBindings[cBindings].dwMemOwner= (dwAccessorOpts & ACCESSOR_OWNED_PROVIDER) ? DBMEMOWNER_PROVIDEROWNED : DBMEMOWNER_CLIENTOWNED;
00247
00248     rgBindings[cBindings].eParamIO  = DBPARAMIO_NOTPARAM;
00249     if(rgParamInfo[i].dwFlags & DBPARAMFLAGS_ISINPUT)
00250       rgBindings[cBindings].eParamIO |= DBPARAMIO_INPUT;
00251     if(rgParamInfo[i].dwFlags & DBPARAMFLAGS_ISOUTPUT)
00252       rgBindings[cBindings].eParamIO |= DBPARAMIO_OUTPUT;
00253
00254     rgBindings[cBindings].dwFlags = 0;
00255     rgBindings[cBindings].bPrecision= rgParamInfo[i].bPrecision;
00256     rgBindings[cBindings].bScale  = rgParamInfo[i].bScale;
00257
00258     rgBindings[cBindings].pObject = NULL;
00259     rgBindings[cBindings].wType   = GetOptions()->GetBindingType(rgParamInfo[i].wType);
00260
00261     //MAX_LENGTH
00262     rgBindings[cBindings].cbMaxLen  = GetMaxDisplaySize(rgBindings[cBindings].wType, rgParamInfo[i].wType, rgParamInfo[i].ulParamSize, dwMaxLength);
00263
00264     dwOffset += rgBindings[cBindings].cbMaxLen;
00265     dwOffset = ROUNDUP( dwOffset );
00266     cBindings++;
00267   }
00268
00269   //Size for pData
00270   if(pcRowSize)
00271     *pcRowSize = dwOffset;
00272
00273 CLEANUP:
00274   //Accessors
00275   *pcBindings = cBindings;
00276   *prgBindings = rgBindings;
00277   return hr;
00278 }
00279
00280
00281
00282 /////////////////////////////////////////////////////////////////
00283 // HRESULT CCommand::Prepare
00284 //
00285 /////////////////////////////////////////////////////////////////
00286 HRESULT CCommand::Prepare(ULONG cExpectedRuns)
00287 {
00288   HRESULT hr = S_OK;
00289
00290   //Prepare
00291   if(m_pICommandPrepare)
00292   {
00293     //ICommandPrepare::Prepare
00294     hr = m_pICommandPrepare->Prepare(0);
00295     TRACE_METHOD(hr, L"ICommandPrepare::Prepare(%d)", cExpectedRuns);
00296   }
00297
00298   return hr;
00299 }
00300
00301
00302 /////////////////////////////////////////////////////////////////
00303 // HRESULT CCommand::GetParameterInfo
00304 //
00305 /////////////////////////////////////////////////////////////////
00306 HRESULT CCommand::GetParameterInfo(DB_UPARAMS* pcParams, DBPARAMINFO** prgParamInfo, OLECHAR** ppwszNamesBuffer)
00307 {
00308   HRESULT hr = S_OK;
00309
00310   if(m_pICommandWithParameters)
00311   {
00312     //ICommandWithParameters::GetParameterInfo
00313     hr = m_pICommandWithParameters->GetParameterInfo(pcParams, prgParamInfo, ppwszNamesBuffer);
00314     TRACE_METHOD(hr, L"ICommandWithParameters::GetParameterInfo(&%lu, &0x%p, &0x%p)", pcParams ? *pcParams : 0, prgParamInfo ? *prgParamInfo : NULL, ppwszNamesBuffer ? *ppwszNamesBuffer : NULL);
00315   }
00316
00317   return hr;
00318 }
00319
00320
00321 /////////////////////////////////////////////////////////////////
00322 // HRESULT CCommand::SetCommandText
00323 //
00324 /////////////////////////////////////////////////////////////////
00325 HRESULT CCommand::SetCommandText(WCHAR* pwszText, GUID* pGuidDialect)
00326 {
00327   HRESULT hr = E_NOINTERFACE;
00328   GUID guidDialect = pGuidDialect ? *pGuidDialect : m_guidDialect;
00329
00330   //Set CommandText
00331   if(m_pICommandText)
00332   {
00333     XTEST(hr = m_pICommandText->SetCommandText(guidDialect, pwszText));
00334     TESTC(TRACE_METHOD(hr, L"ICommandText::SetCommandText(%s, \"%s\")", GetDialectName(guidDialect), pwszText));
00335
00336     //Save the Command Text on Success...
00337     if(pGuidDialect)
00338       m_guidDialect = *pGuidDialect;
00339   }
00340
00341 CLEANUP:
00342   return hr;
00343 }
00344
00345
00346 ////////////////////////////////////////////////////////////////
00347 // HRESULT CCommand::SetCommandStream
00348 //
00349 /////////////////////////////////////////////////////////////////
00350 HRESULT CCommand::SetCommandStream(WCHAR* pwszText, REFIID riid, GUID* pGuidDialect, BOOL fUnicode)
00351 {
00352   HRESULT hr = E_NOINTERFACE;
00353   GUID guidDialect = pGuidDialect ? *pGuidDialect : m_guidDialect;
00354   CStorageBuffer* pCStream = NULL;
00355
00356   //Set CommandStream
00357   if(m_pICommandStream)
00358   {
00359     //Create a stream object over the specified text.
00360     pCStream = new CStorageBuffer;
00361     if(pwszText)
00362     {
00363       ULONG cbWritten = 0;
00364       if(fUnicode)
00365       {
00366         //UNICODE-Stream:
00367         //We need to place the BOM mark to indicate its a Unicode stream...
00368         TESTC(pCStream->WriteBuffer(0, &UNICODE_BYTE_ORDER_MARK, sizeof(UNICODE_BYTE_ORDER_MARK), &cbWritten));
00369         TESTC(pCStream->WriteBuffer(cbWritten, pwszText, wcslen(pwszText)*sizeof(WCHAR), NULL));
00370       }
00371       else
00372       {
00373         //MBCS-Stream:
00374         //First convert the Unicode stream to MBCS
00375         CHAR* pszText = ConvertToMBCS(pwszText);
00376         TESTC(pCStream->WriteBuffer(cbWritten, pszText, strlen(pszText)*sizeof(CHAR), NULL));
00377         SAFE_FREE(pszText);
00378       }
00379     }
00380
00381     //ICommandStream::SetCommandStream
00382     //NOTE: The provider has to validate that the object passed in actually supports the interface
00383     //requested, so we can just blindly pass in the IUnknown and it will do the QI, not us...
00384     XTEST(hr = m_pICommandStream->SetCommandStream(riid, guidDialect, (IStream*)pCStream));
00385     TESTC(TRACE_METHOD(hr, L"ICommandStream::SetCommandStream(%s, %s, \"%s\")", GetInterfaceName(riid), GetDialectName(guidDialect), pwszText));
00386
00387     //Save the Command Text on Success...
00388     if(pGuidDialect)
00389       m_guidDialect = *pGuidDialect;
00390   }
00391
00392 CLEANUP:
00393   SAFE_RELEASE(pCStream);
00394   return hr;
00395 }
00396
00397
00398
00399 /////////////////////////////////////////////////////////////////
00400 // HRESULT CCommand::Execute
00401 //
00402 /////////////////////////////////////////////////////////////////
00403 HRESULT CCommand::Execute(CAggregate* pCAggregate, WCHAR* pwszCommandText, REFIID riid, BOOL fUseParams, DBROWCOUNT* pcRowsAffected, IUnknown** ppIUnknown, BOOL fCommandStream)
00404 {
00405   HRESULT hr = S_OK;
00406   DBROWCOUNT cRowsAffected = DB_COUNTUNAVAILABLE;
00407
00408   //Execute
00409   if(m_pICommand)
00410   {
00411     //SetCommandText (if user requested new text)
00412     if(pwszCommandText)
00413     {
00414       //Clear previous object (if requested and really need to...)
00415       if(GetOptions()->m_dwCommandOpts & COMMAND_RELEASE_OPENOBJECTS)
00416       {
00417         //Release all child objects of the command.
00418         //NOTE: This includes: Rowset, Row, DataSet, Stream, etc...
00419         ReleaseChildren();
00420       }
00421
00422       //SetCommandText...
00423       if(fCommandStream)
00424       {
00425         TESTC(hr = SetCommandStream(pwszCommandText));
00426       }
00427       else
00428       {
00429         TESTC(hr = SetCommandText(pwszCommandText));
00430       }
00431     }
00432
00433     //Execute
00434     XTEST_(hr = m_pICommand->Execute(
00435               pCAggregate,      // pUnkOuter
00436               riid,         // refiid
00437               fUseParams ? &m_Parameters.GetParams() : NULL,  // params
00438               &cRowsAffected,     // rows affected
00439               ppIUnknown),S_OK);    // IRowset pointer
00440     TRACE_METHOD(hr, L"ICommand::Execute(0x%p, %s, 0x%p, &%ld, &0x%p)", pCAggregate, GetInterfaceName(riid), fUseParams ? &m_Parameters.GetParams() : NULL, cRowsAffected, ppIUnknown ? *ppIUnknown : NULL);
00441
00442     //Display Property Errors
00443     TESTC(hr = DisplayPropErrors(hr, IID_ICommandProperties, m_pICommand));
00444
00445     //ParameterBinding Errors
00446     if(fUseParams)
00447     {
00448       //Loop through the parameter sets (if any)
00449       for(ULONG iParamSet=0; iParamSet<m_Parameters.GetParams().cParamSets; iParamSet++)
00450         TESTC(hr = DisplayBindingErrors(hr, m_Parameters.GetBindings().GetCount(), m_Parameters.GetBindings().GetElements(), m_Parameters.GetData(iParamSet)));
00451     }
00452
00453     //Handle Aggregation
00454     if(pCAggregate)
00455       TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00456
00457     //Display RowsAffected - (if desired)
00458     if(!pcRowsAffected)
00459     {
00460       if(!ppIUnknown || !*ppIUnknown)
00461       {
00462         if(cRowsAffected==DB_COUNTUNAVAILABLE)
00463           wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONWARNING | MB_OK, wsz_INFO,
00464             L"RowsAffected = %s, No Rowset returned", L"DB_COUNTUNAVAILABLE");
00465         else
00466           wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONWARNING | MB_OK, wsz_INFO,
00467             L"RowsAffected = %ld, No Rowset returned", cRowsAffected );
00468       }
00469     }
00470   }
00471
00472 CLEANUP:
00473   if(pcRowsAffected)
00474     *pcRowsAffected = cRowsAffected;
00475   return hr;
00476 }
00477
00478
00479
00480
00481
Generated on Wed Nov 13 2024 16:52:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAlterTableDlg Member List

This is the complete list of members for CAlterTableDlg, including all inherited members.
AlterTable(HWND hWndParent) | CAlterTableDlg |
CAlterTableDlg(CMDIChild *pCMDIChild) | CAlterTableDlg |
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CRowsetViewerDlg(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CRowsetViewerDlg |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetOptions() | CRowsetViewerDlg | [virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_CPropSets | CAlterTableDlg |
m_editNewTableName | CAlterTableDlg | [private]
m_editTableName | CAlterTableDlg | [private]
m_fModal | CDialogLite |
m_fUseTableProps | CAlterTableDlg |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pCMainWindow | CRowsetViewerDlg |
m_pCMDIChild | CRowsetViewerDlg |
m_pNewTableID | CAlterTableDlg |
m_pSubClassProc | CWndLite |
m_pTableID | CAlterTableDlg |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnCancel() | CDialogLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CAlterTableDlg | [virtual]
CDialogLite::OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | CAlterTableDlg | [virtual]
CDialogLite::OnInitDialog() | CDialogLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CAlterTableDlg | [virtual]
CDialogLite::OnOK() | CDialogLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CAlterTableDlg() | CAlterTableDlg | [virtual]
~CDialogLite() | CDialogLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:55:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IHelloWorld Member List

This is the complete list of members for IHelloWorld, including all inherited members.
Say() | IHelloWorld
Say() | IHelloWorld
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ISAPI_BUFFER Member List

This is the complete list of members for ISAPI_BUFFER, including all inherited members.
_cbBuffer | ISAPI_BUFFER | [private]
_cbData | ISAPI_BUFFER | [private]
_dwMaxAlloc | ISAPI_BUFFER | [private]
_InlineData | ISAPI_BUFFER | [private]
_pData | ISAPI_BUFFER | [private]
AppendData(VOID *pData, DWORD cbData) | ISAPI_BUFFER |
Base64Decode(CHAR *szString) | ISAPI_BUFFER |
ISAPI_BUFFER(DWORD dwMaxAlloc=0) | ISAPI_BUFFER |
QueryBufferSize(VOID) | ISAPI_BUFFER |
QueryDataSize(VOID) | ISAPI_BUFFER |
QueryMaxAlloc(VOID) | ISAPI_BUFFER |
QueryPtr(VOID) | ISAPI_BUFFER |
Reset(BOOL fDealloc=FALSE) | ISAPI_BUFFER |
Resize(DWORD cbNewSize) | ISAPI_BUFFER |
SetData(VOID *pData, DWORD cbData) | ISAPI_BUFFER |
SetDataSize(DWORD cbNewSize) | ISAPI_BUFFER |
SetMaxAlloc(DWORD dwMaxAlloc) | ISAPI_BUFFER |
ZeroBuffer(VOID) | ISAPI_BUFFER |
~ISAPI_BUFFER() | ISAPI_BUFFER | [virtual]
Generated on Wed Nov 13 2024 16:57:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

filebuffer Member List

This is the complete list of members for filebuffer, including all inherited members.
buffer | filebuffer
fh | filebuffer
fUnicode | filebuffer
last | filebuffer
pwzLast | filebuffer
pwzStart | filebuffer
start | filebuffer
wzBuffer | filebuffer
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00025 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00026
00027 //==============================================================
00028 //
00029 // CDelegationBase implementation
00030 //
00031 //
00032 CDelegationBase::CDelegationBase()
00033 : bExpanded(FALSE)
00034 {
00035     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00036         LoadBitmaps();
00037 }
00038
00039 CDelegationBase::~CDelegationBase()
00040 {
00041 }
00042
00043 // CDelegationBase::AddImages sets up the collection of images to be displayed
00044 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00045 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00046 {
00047     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00048         (long *)m_pBMapLg, // pointer to a handle
00049         0, // index of the first image in the strip
00050         RGB(0, 128, 128)  // color of the icon mask
00051         );
00052 }
00053
00054 HRESULT CDelegationBase::OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile)
00055 {
00056     WCHAR topicName[MAX_PATH];
00057
00058     wcscpy(topicName, helpFile);
00059
00060     // we should read this from a resource file
00061     wcscat(topicName, L"::/default.htm");
00062
00063     LPOLESTR pszTopic = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(topicName) + 1) * sizeof(WCHAR)));
00064
00065     wcscpy(pszTopic, topicName);
00066
00067     return m_ipDisplayHelp->ShowTopic(pszTopic);
00068 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/ioipo.Cpp Source File

  • Com
  • Fundamentals
  • SimpSvr

ioipo.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: IOIPO.CPP
00003 //
00004 //    Implementation file for the CClassFactory Class
00005 //
00006 // Functions:
00007 //
00008 //    See ioipo.h for a list of member functions.
00009 //
00010 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "obj.h"
00015 #include "ioipo.h"
00016 #include "app.h"
00017 #include "doc.h"
00018 #include "math.h"
00019
00020 //**********************************************************************
00021 //
00022 // COleInPlaceObject::QueryInterface
00023 //
00024 // Purpose:
00025 //
00026 //
00027 // Parameters:
00028 //
00029 //      REFIID riid         -   Interface being queried for.
00030 //
00031 //      LPVOID FAR *ppvObj  -   Out pointer for the interface.
00032 //
00033 // Return Value:
00034 //
00035 //      S_OK            - Success
00036 //      E_NOINTERFACE   - Failure
00037 //
00038 // Function Calls:
00039 //      Function                    Location
00040 //
00041 //      CSimpSvrObj::QueryInterface OBJ.CPP
00042 //
00043 // Comments:
00044 //
00045 //
00046 //********************************************************************
00047
00048 STDMETHODIMP COleInPlaceObject::QueryInterface ( REFIID riid, LPVOID FAR* ppvObj)
00049 {
00050         OutputDebugString("In COleInPlaceObject::QueryInterface\r\n");
00051         // need to NULL the out parameter
00052         *ppvObj = NULL;
00053         return m_lpObj->QueryInterface(riid, ppvObj);
00054 }
00055
00056 //**********************************************************************
00057 //
00058 // COleInPlaceObject::AddRef
00059 //
00060 // Purpose:
00061 //
00062 //      Increments the reference count on COleInPlaceObject and the "object"
00063 //      object.
00064 //
00065 // Parameters:
00066 //
00067 //      None
00068 //
00069 // Return Value:
00070 //
00071 //      The Reference count on the Object
00072 //
00073 // Function Calls:
00074 //      Function                    Location
00075 //
00076 //      OuputDebugString            Windows API
00077 //      CSimpSvrObj::AddRef         OBJ.CPP
00078 //
00079 // Comments:
00080 //
00081 //
00082 //********************************************************************
00083
00084 STDMETHODIMP_(ULONG) COleInPlaceObject::AddRef ()
00085 {
00086         OutputDebugString("In COleInPlaceObject::AddRef\r\n");
00087         ++m_nCount;
00088         return m_lpObj->AddRef();
00089 }
00090
00091 //**********************************************************************
00092 //
00093 // COleInPlaceObject::Release
00094 //
00095 // Purpose:
00096 //
00097 //      Decrements the reference count of COleInPlaceObject and the
00098 //      object.
00099 //
00100 // Parameters:
00101 //
00102 //      None
00103 //
00104 // Return Value:
00105 //
00106 //      The new reference count
00107 //
00108 // Function Calls:
00109 //      Function                    Location
00110 //
00111 //      OutputDebugString           Windows API
00112 //      CSimpSvrObj::Release        OBJ.CPP
00113 //
00114 // Comments:
00115 //
00116 //
00117 //********************************************************************
00118
00119 STDMETHODIMP_(ULONG) COleInPlaceObject::Release ()
00120 {
00121         OutputDebugString("In COleInPlaceObject::Release\r\n");
00122         --m_nCount;
00123         return m_lpObj->Release();
00124 }
00125
00126 //**********************************************************************
00127 //
00128 // COleInPlaceObject::InPlaceDeactivate
00129 //
00130 // Purpose:
00131 //
00132 //      Called to deactivat the object
00133 //
00134 // Parameters:
00135 //
00136 //      None
00137 //
00138 // Return Value:
00139 //
00140 //
00141 //
00142 // Function Calls:
00143 //      Function                                Location
00144 //
00145 //      OutputDebugString                       Windows API
00146 //      IOleClientSite::QueryInterface          Container
00147 //      IOleInPlaceSite::OnInPlaceDeactivate    Container
00148 //      IOleInPlaceSite::Release                Container
00149 //
00150 // Comments:
00151 //
00152 //
00153 //********************************************************************
00154
00155
00156 STDMETHODIMP COleInPlaceObject::InPlaceDeactivate()
00157 {
00158          OutputDebugString("In COleInPlaceObject::InPlaceDeactivate\r\n");
00159
00160          // if not inplace active, return NOERROR
00161          if (!m_lpObj->m_fInPlaceActive)
00162                  return NOERROR;
00163
00164          // clear inplace flag
00165          m_lpObj->m_fInPlaceActive = FALSE;
00166
00167          // deactivate the UI
00168          m_lpObj->DeactivateUI();
00169          m_lpObj->DoInPlaceHide();
00170
00171          // tell the container that we are deactivating.
00172          if (m_lpObj->m_lpIPSite)
00173                  {
00174                  m_lpObj->m_lpIPSite->OnInPlaceDeactivate();
00175                  m_lpObj->m_lpIPSite->Release();
00176                  m_lpObj->m_lpIPSite =NULL;
00177                  }
00178
00179         return S_OK;
00180 }
00181
00182 //**********************************************************************
00183 //
00184 // COleInPlaceObject::UIDeactivate
00185 //
00186 // Purpose:
00187 //
00188 //      Instructs us to remove our UI.
00189 //
00190 // Parameters:
00191 //
00192 //      None
00193 //
00194 // Return Value:
00195 //
00196 //      NOERROR
00197 //
00198 // Function Calls:
00199 //      Function                                Location
00200 //
00201 //      OutputDebugString                       Windows API
00202 //      IOleInPlaceUIWindow::SetActiveObject    Container
00203 //      IOleInPlaceFrame::SetActiveObject       Container
00204 //      IOleClientSite::QueryInterface          Container
00205 //      IOleInPlaceSite::OnUIDeactivate         Container
00206 //      IOleInPlaceSite::Release                Container
00207 //      CSimpSvrObj::DoInPlaceHide              OBJ.H
00208 //      IDataAdviseHolder::SendOnDataChange     OLE
00209 //
00210 //
00211 // Comments:
00212 //
00213 //
00214 //********************************************************************
00215
00216 STDMETHODIMP COleInPlaceObject::UIDeactivate()
00217 {
00218         OutputDebugString("In COleInPlaceObject::UIDeactivate\r\n");
00219
00220         m_lpObj->DeactivateUI();
00221
00222         return  S_OK;
00223 }
00224
00225 //**********************************************************************
00226 //
00227 // COleInPlaceObject::SetObjectRects
00228 //
00229 // Purpose:
00230 //
00231 //      Called when the container clipping region or the object position
00232 //      changes.
00233 //
00234 // Parameters:
00235 //
00236 //      LPCRECT lprcPosRect     - New Position Rect.
00237 //
00238 //      LPCRECT lprcClipRect    - New Clipping Rect.
00239 //
00240 // Return Value:
00241 //
00242 //      S_OK
00243 //
00244 // Function Calls:
00245 //      Function                    Location
00246 //
00247 //      OutputDebugString           Windows API
00248 //      IntersectRect               Windows API
00249 //      OffsetRect                  Windows API
00250 //      CopyRect                    Windows API
00251 //      MoveWindow                  Windows API
00252 //      CSimpSvrDoc::GethHatchWnd   DOC.H
00253 //      CSimpSvrDoc::gethDocWnd     DOC.h
00254 //      SetHatchWindowSize          OLESTD
00255 //
00256 // Comments:
00257 //
00258 //
00259 //********************************************************************
00260
00261 STDMETHODIMP COleInPlaceObject::SetObjectRects  ( LPCRECT lprcPosRect, LPCRECT lprcClipRect)
00262 {
00263         OutputDebugString("In COleInPlaceObject::SetObjectRects\r\n");
00264
00265         RECT resRect;
00266         POINT pt;
00267
00268         // Get the intersection of the clipping rect and the position rect.
00269         IntersectRect(&resRect, lprcPosRect, lprcClipRect);
00270
00271         m_lpObj->m_xOffset = abs (resRect.left - lprcPosRect->left);
00272         m_lpObj->m_yOffset = abs (resRect.top - lprcPosRect->top);
00273
00274         m_lpObj->m_scale = (float)(lprcPosRect->right - lprcPosRect->left)/m_lpObj->m_size.x;
00275
00276         if (m_lpObj->m_scale == 0)
00277                 m_lpObj->m_scale = (float) 1.0;
00278
00279         char szBuffer[255];
00280         wsprintf(szBuffer,"New Scale %3d\r\n",(int)(m_lpObj->m_scale));
00281         OutputDebugString(szBuffer);
00282
00283         // Adjust the size of the Hatch Window.
00284         SetHatchWindowSize(m_lpObj->m_lpDoc->GethHatchWnd(),(LPRECT) lprcPosRect, (LPRECT) lprcClipRect, &pt);
00285
00286         // offset the rect
00287         OffsetRect(&resRect, pt.x, pt.y);
00288
00289         CopyRect(&m_lpObj->m_posRect, lprcPosRect);
00290
00291         // Move the actual object window
00292         MoveWindow(m_lpObj->m_lpDoc->GethDocWnd(),
00293                                    resRect.left,
00294                                    resRect.top,
00295                                    resRect.right - resRect.left,
00296                                    resRect.bottom - resRect.top,
00297                                    TRUE);
00298
00299
00300         return  S_OK ;
00301 };
00302
00303 //**********************************************************************
00304 //
00305 // COleInPlaceObject::GetWindow
00306 //
00307 // Purpose:
00308 //
00309 //      Returns the Window handle of the inplace object
00310 //
00311 // Parameters:
00312 //
00313 //      HWND FAR* lphwnd    - Out pointer in which to return the window
00314 //                            Handle.
00315 //
00316 // Return Value:
00317 //
00318 //      S_OK
00319 //
00320 // Function Calls:
00321 //      Function                    Location
00322 //
00323 //      OutputDebugString           Windows API
00324 //      CSimpleDoc::GethDocWnd      DOC.H
00325 //
00326 // Comments:
00327 //
00328 //
00329 //********************************************************************
00330
00331 STDMETHODIMP COleInPlaceObject::GetWindow  ( HWND FAR* lphwnd)
00332 {
00333         OutputDebugString("In COleInPlaceObject::GetWindow\r\n");
00334         *lphwnd = m_lpObj->m_lpDoc->GethDocWnd();
00335
00336         return  S_OK ;
00337 };
00338
00339 //**********************************************************************
00340 //
00341 // COleInPlaceObject::ContextSensitiveHelp
00342 //
00343 // Purpose:
00344 //
00345 //      Used in performing Context Sensitive Help
00346 //
00347 // Parameters:
00348 //
00349 //      BOOL fEnterMode     - Flag to determine if enter or exiting
00350 //                            Context Sensitive Help.
00351 //
00352 // Return Value:
00353 //
00354 //      E_NOTIMPL
00355 //
00356 // Function Calls:
00357 //      Function                    Location
00358 //
00359 //      OutputDebugString           Windows API
00360 //
00361 // Comments:
00362 //
00363 //      This function is not implemented due to the fact that it is
00364 //      beyond the scope of a simple object.  All *real* applications
00365 //      are going to want to implement this function, otherwise any
00366 //      container that supports context sensitive help will not work
00367 //      properly while the object is in place.
00368 //
00369 //      See TECHNOTES.WRI include with the OLE SDK for details on
00370 //      Implementing this method.
00371 //
00372 //********************************************************************
00373
00374 STDMETHODIMP COleInPlaceObject::ContextSensitiveHelp  ( BOOL fEnterMode)
00375 {
00376         OutputDebugString("In COleInPlaceObject::ContextSensitiveHelp\r\n");
00377         return  E_NOTIMPL;
00378 };
00379
00380 //**********************************************************************
00381 //
00382 // COleInPlaceObject::ReactivateAndUndo
00383 //
00384 // Purpose:
00385 //
00386 //      Called when the container wants to undo the last edit made in
00387 //      the object.
00388 //
00389 // Parameters:
00390 //
00391 //      None
00392 //
00393 // Return Value:
00394 //
00395 //      INPLACE_E_NOTUNDOABLE
00396 //
00397 // Function Calls:
00398 //      Function                    Location
00399 //
00400 //      OutputDebugString           Windows API
00401 //
00402 // Comments:
00403 //
00404 //      Since this server does not support undo, the value
00405 //      INPLACE_E_NOTUNDOABLE is always returned.
00406 //
00407 //********************************************************************
00408
00409 STDMETHODIMP COleInPlaceObject::ReactivateAndUndo  ()
00410 {
00411         OutputDebugString("In COleInPlaceObject::ReactivateAndUndo\r\n");
00412         return  INPLACE_E_NOTUNDOABLE ;
00413 };
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/version.h Source File

  • Dataaccess
  • oledb
  • tablecopy

version.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB Version File
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module version include file
00008 //
00009 //
00010
00011 // Constants -----------------------------------------------------------------
00012 #ifndef _AXVER_H_
00013 #define _AXVER_H_
00014
00015 #define VER_FILEVERSION 2,50,4809.0
00016 #define VER_FILEVERSION_STR "2.50.4809.0\0"
00017 #define VER_PRODUCTVERSION 2,50,4809.0
00018 #define VER_PRODUCTVERSION_STR "2.50.4809.0\0"
00019
00020 #define VER_FILEFLAGSMASK   (VS_FF_DEBUG | VS_FF_PRERELEASE)
00021 #ifdef DEBUG
00022 #define VER_FILEFLAGS     (VS_FF_DEBUG)
00023 #else
00024 #define VER_FILEFLAGS     (0)
00025 #endif
00026
00027 #define VER_FILEOS        VOS_NT_WINDOWS32
00028
00029 #define VER_COMPANYNAME_STR   "Microsoft Corporation\0"
00030 #define VER_PRODUCTNAME_STR   "Microsoft OLE DB\0"
00031 #define VER_LEGALCOPYRIGHT_STR  "Copyright \251 Microsoft Corporation 1991-2000\0"
00032
00033 // Resource DLL Version Resource ID
00034 #define IDS_RESDLL_VER      1
00035
00036 #endif
00037 //--------------------
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/CConf.Cpp Source File

  • Web
  • NetMeeting
  • NMShare

CConf.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       CCONF.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 // Global Varaiables
00018 INmManager * g_pMgr  = NULL;             // The Conference Manager
00019 CMgrNotify * g_pMgrNotify = NULL;        // Notifications for the Manager
00020 INmConference * g_pConference = NULL;    // The Current Conference
00021 CConfNotify * g_pConferenceNotify =NULL; // Notifications for the Conference
00022
00023 // Local Application Guid : {D29A8C52-774F-11d0-8B1D-00A0C91BC90E}
00024 const GUID g_guidApp =
00025 { 0xd29a8c52, 0x774f, 0x11d0, { 0x8b, 0x1d, 0x0, 0xa0, 0xc9, 0x1b, 0xc9, 0xe} };
00026
00027
00028 //****************************************************************************
00029 //
00030 // HRESULT InitConfMgr(void)
00031 //
00032 //****************************************************************************
00033 HRESULT InitConfMgr(void)
00034 {
00035   HRESULT hr;
00036   LPCLASSFACTORY pcf;
00037
00038     // Notify the system we want to use the conferencing services
00039     // by creating a conference manager object
00040     hr = CoGetClassObject(CLSID_NmManager,
00041                           CLSCTX_INPROC,
00042                           NULL,
00043                           IID_IClassFactory,
00044                           (void**)&pcf);
00045     if (SUCCEEDED(hr))
00046     {
00047         // Get the conference manager object
00048         hr = pcf->CreateInstance(NULL, IID_INmManager, (void**)&g_pMgr);
00049       if (SUCCEEDED(hr))
00050         {
00051             // Connect to the conference manager object
00052             g_pMgrNotify = new CMgrNotify();
00053             if (NULL != g_pMgrNotify)
00054             {
00055                 hr = g_pMgrNotify->Connect(g_pMgr);
00056           if (SUCCEEDED(hr))
00057                 {
00058                   ULONG uchCaps = NMCH_ALL;
00059                   ULONG uOptions = 0;
00060           hr = g_pMgr->Initialize(&uOptions, &uchCaps);
00061           //*** Do we need to verify that it initialized properly? ***
00062         }
00063             }
00064         }
00065
00066         pcf->Release();
00067     }
00068
00069   return hr;
00070 }
00071
00072
00073 //****************************************************************************
00074 //
00075 // VOID FreeConfMgr(void)
00076 //
00077 //****************************************************************************
00078
00079 VOID FreeConfMgr(void)
00080 {
00081   // Release conference manager notify
00082   if (NULL != g_pMgrNotify)
00083   {
00084     g_pMgrNotify->Disconnect();
00085     g_pMgrNotify->Release();
00086     g_pMgrNotify = NULL;
00087   }
00088
00089   // Release conference manager
00090   if (NULL != g_pMgr)
00091   {
00092     g_pMgr->Release();
00093     g_pMgr = NULL;
00094   }
00095 }
00096
00097
00098 //****************************************************************************
00099 //
00100 // VOID FreeConference(void)
00101 //
00102 //****************************************************************************
00103
00104 VOID FreeConference(void)
00105 {
00106   if (NULL != g_pConferenceNotify)
00107   {
00108     g_pConferenceNotify->Disconnect();
00109     g_pConferenceNotify->Release();
00110     g_pConferenceNotify = NULL;
00111   }
00112
00113   if (NULL != g_pConference)
00114   {
00115     g_pConference->Release();
00116     g_pConference = NULL;
00117   }
00118 }
00119
00120
00121 //****************************************************************************
00122 //
00123 // CLASS CMgrNotify
00124 //
00125 //****************************************************************************
00126
00127
00128 //****************************************************************************
00129 //
00130 // Constructor
00131 //
00132 //****************************************************************************
00133
00134 CMgrNotify::CMgrNotify() : RefCount(), CNotify()
00135 {
00136 }
00137
00138
00139 //****************************************************************************
00140 //
00141 // Destructor
00142 //
00143 //****************************************************************************
00144
00145 CMgrNotify::~CMgrNotify()
00146 {
00147 }
00148
00149
00150 //****************************************************************************
00151 //
00152 // Methods from IUnknown
00153 //
00154 //****************************************************************************
00155
00156 ULONG STDMETHODCALLTYPE CMgrNotify::AddRef(void)
00157 {
00158   return RefCount::AddRef();
00159 }
00160
00161
00162 ULONG STDMETHODCALLTYPE CMgrNotify::Release(void)
00163 {
00164   return RefCount::Release();
00165 }
00166
00167 HRESULT STDMETHODCALLTYPE CMgrNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00168 {
00169   if (NULL == ppvObject)
00170   {
00171     return E_POINTER;
00172   }
00173
00174   HRESULT hr = S_OK;
00175
00176   if (riid == IID_IUnknown)
00177   {
00178     *ppvObject = (IUnknown *)this;
00179   }
00180   else if (riid == IID_INmManagerNotify)
00181   {
00182     *ppvObject = (INmManagerNotify *)this;
00183   }
00184   else
00185   {
00186     hr = E_NOINTERFACE;
00187     *ppvObject = NULL;
00188   }
00189
00190   if (S_OK == hr)
00191   {
00192     AddRef();
00193   }
00194
00195   return hr;
00196 }
00197
00198
00199 //****************************************************************************
00200 //
00201 // Methods from ICNotify
00202 //
00203 //****************************************************************************
00204
00205 HRESULT STDMETHODCALLTYPE CMgrNotify::Connect(IUnknown *pUnk)
00206 {
00207   return CNotify::Connect(pUnk, IID_INmManagerNotify, (IUnknown *)this);
00208 }
00209
00210 HRESULT STDMETHODCALLTYPE CMgrNotify::Disconnect(void)
00211 {
00212   return CNotify::Disconnect();
00213 }
00214
00215
00216 //****************************************************************************
00217 //
00218 // Methods from INmManagerNotify
00219 //
00220 //****************************************************************************
00221
00222 HRESULT STDMETHODCALLTYPE CMgrNotify::NmUI(CONFN confn)
00223 {
00224   return S_OK;
00225 }
00226
00227 HRESULT STDMETHODCALLTYPE CMgrNotify::CallCreated(INmCall *pCall)
00228 {
00229   return S_OK;
00230 }
00231
00232 // As soon as a conference is available, create the data channel
00233 HRESULT STDMETHODCALLTYPE CMgrNotify::ConferenceCreated(INmConference *pConference)
00234 {
00235   ASSERT(NULL == g_pConference);
00236   ASSERT(NULL == g_pChannelAppShare);
00237
00238   HookConference(pConference);
00239
00240   return S_OK;
00241 }
00242
00243
00244
00245
00246
00247 //****************************************************************************
00248 //
00249 // HRESULT HookConference(INmConference * pConference)
00250 //
00251 //****************************************************************************
00252
00253 HRESULT HookConference(INmConference * pConference)
00254 {
00255   if (NULL == pConference)
00256   {
00257     return E_POINTER;
00258   }
00259
00260   HRESULT hr = S_OK;
00261
00262   ASSERT(NULL != pConference);
00263   ASSERT(NULL == g_pConference);
00264   g_pConference = pConference;
00265
00266   pConference->AddRef();
00267
00268     // Connect to the conference object
00269     ASSERT(NULL == g_pConferenceNotify)
00270     g_pConferenceNotify = new CConfNotify();
00271     if (NULL == g_pConferenceNotify)
00272     {
00273         hr = E_OUTOFMEMORY;
00274     }
00275     else
00276     {
00277     hr = g_pConferenceNotify->Connect(pConference);
00278     if (FAILED(hr))
00279     {
00280       g_pConferenceNotify->Release();
00281       g_pConferenceNotify = NULL;
00282     }
00283   }
00284
00285   return hr;
00286 }
00287
00288
00289
00290 //****************************************************************************
00291 //
00292 // CLASS CConfNotify
00293 //
00294 //****************************************************************************
00295
00296 CConfNotify::CConfNotify() : RefCount(), CNotify()
00297 {
00298 }
00299
00300 CConfNotify::~CConfNotify()
00301 {
00302 }
00303
00304
00305 //****************************************************************************
00306 //
00307 // Methods from IUnknown
00308 //
00309 //****************************************************************************
00310
00311 ULONG STDMETHODCALLTYPE CConfNotify::AddRef(void)
00312 {
00313   return RefCount::AddRef();
00314 }
00315
00316
00317 ULONG STDMETHODCALLTYPE CConfNotify::Release(void)
00318 {
00319   return RefCount::Release();
00320 }
00321
00322 HRESULT STDMETHODCALLTYPE CConfNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00323 {
00324   if (NULL == ppvObject)
00325   {
00326     return E_POINTER;
00327   }
00328
00329   HRESULT hr = S_OK;
00330
00331   if (riid == IID_IUnknown)
00332   {
00333     *ppvObject = (IUnknown *)this;
00334   }
00335   else if (riid == IID_INmConferenceNotify)
00336   {
00337     *ppvObject = (INmConferenceNotify *)this;
00338   }
00339   else
00340   {
00341     hr = E_NOINTERFACE;
00342     *ppvObject = NULL;
00343   }
00344
00345   if (S_OK == hr)
00346   {
00347     AddRef();
00348   }
00349
00350   return hr;
00351 }
00352
00353
00354
00355 //****************************************************************************
00356 //
00357 // Methods from ICNotify
00358 //
00359 //****************************************************************************
00360
00361 HRESULT STDMETHODCALLTYPE CConfNotify::Connect(IUnknown *pUnk)
00362 {
00363   return CNotify::Connect(pUnk, IID_INmConferenceNotify, (IUnknown *)this);
00364 }
00365
00366 HRESULT STDMETHODCALLTYPE CConfNotify::Disconnect(void)
00367 {
00368   return CNotify::Disconnect();
00369 }
00370
00371
00372 //****************************************************************************
00373 //
00374 // Methods from IConfNotify
00375 //
00376 //****************************************************************************
00377
00378 HRESULT STDMETHODCALLTYPE CConfNotify::NmUI(CONFN uNotify)
00379 {
00380   return S_OK;
00381 }
00382
00383 HRESULT STDMETHODCALLTYPE CConfNotify::StateChanged(NM_CONFERENCE_STATE uState)
00384 {
00385   if (NULL == g_pConference)
00386     return S_OK; // weird
00387
00388   switch (uState)
00389   {
00390     case NM_CONFERENCE_ACTIVE:
00391       DisplayMsg(TEXT("Conference is active"));
00392       break;
00393
00394     case NM_CONFERENCE_INITIALIZING:
00395       break; // can't do anything just yet
00396
00397     case NM_CONFERENCE_WAITING:
00398       DisplayMsg(TEXT("Waiting in Host Mode"));
00399       break;
00400
00401     case NM_CONFERENCE_IDLE:
00402       FreeAppShareChannel();
00403       FreeAllUsers();
00404       FreeConference();
00405       DisplayMsg(TEXT("No conference"));
00406       break;
00407   }
00408
00409   return S_OK;
00410 }
00411
00412 HRESULT STDMETHODCALLTYPE CConfNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00413 {
00414   switch (uNotify)
00415   {
00416     case NM_MEMBER_ADDED:
00417       AddMember(pMember);
00418       break;
00419     case NM_MEMBER_REMOVED:
00420       RemoveMember(pMember);
00421       break;
00422     default:
00423       break;
00424   }
00425
00426   return S_OK;
00427 }
00428
00429 HRESULT STDMETHODCALLTYPE CConfNotify::ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel)
00430 {
00431   switch (uNotify)
00432   {
00433     case NM_CHANNEL_ADDED:
00434       HookChannel(pChannel);
00435       break;
00436     case NM_CHANNEL_REMOVED:
00437       UnHookChannel(pChannel);
00438       break;
00439     default:
00440       break;
00441   }
00442
00443   return S_OK;
00444 }
00445
00446
00447
00448
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/dataobj.h Source File

  • WinUI
  • tsfapp

dataobj.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /******************************************************************************
00011
00012    File:          DataObj.h
00013
00014    Description:   CTSFDataObject definitions.
00015
00016 ******************************************************************************/
00017
00018 #ifndef DATAOBJ_H
00019 #define DATAOBJ_H
00020
00021 #include <windows.h>
00022
00023 /**************************************************************************
00024
00025    CTSFDataObject class definition
00026
00027 **************************************************************************/
00028
00029 class CTSFDataObject : public IDataObject
00030 {
00031 private:
00032     DWORD       m_ObjRefCount;
00033     FORMATETC   m_FormatEtc;
00034     LPWSTR      m_pwszText;
00035
00036 public:
00037     CTSFDataObject();
00038     ~CTSFDataObject();
00039
00040     //IUnknown methods
00041     STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
00042     STDMETHODIMP_(DWORD) AddRef();
00043     STDMETHODIMP_(DWORD) Release();
00044
00045     //IDataObject methods
00046     STDMETHODIMP GetData(LPFORMATETC, LPSTGMEDIUM);
00047     STDMETHODIMP GetDataHere(LPFORMATETC, LPSTGMEDIUM);
00048     STDMETHODIMP QueryGetData(LPFORMATETC);
00049     STDMETHODIMP GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC);
00050     STDMETHODIMP SetData(LPFORMATETC, LPSTGMEDIUM, BOOL);
00051     STDMETHODIMP EnumFormatEtc(DWORD, IEnumFORMATETC**);
00052     STDMETHODIMP DAdvise(LPFORMATETC, DWORD, IAdviseSink*, LPDWORD);
00053     STDMETHODIMP DUnadvise(DWORD dwConnection);
00054     STDMETHODIMP EnumDAdvise(IEnumSTATDATA** ppEnumAdvise);
00055
00056     //utility methods
00057     HRESULT _SetText(LPWSTR pwszText);
00058
00059 private:
00060 };
00061
00062
00063 #endif// DATAOBJ_H
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CONotify Member List

This is the complete list of members for CONotify, including all inherited members.
CONotify() | CONotify | [inline]
CONotify() | CONotify | [inline]
LineItem(long lItemId, long lQuantity, ShipStatus shipStatus) | CONotify |
LineItem(long lItemId, long lQuantity, ShipStatus shipStatus) | CONotify |
m_lCustomerId | CONotify | [private]
m_lOrderId | CONotify | [private]
m_veclItemId | CONotify | [private]
m_veclQuantity | CONotify | [private]
m_vecShipStatus | CONotify | [private]
Process(long lFlags) | CONotify |
Process(long lFlags) | CONotify |
put_CustomerId(long lCustomerId) | CONotify |
put_CustomerId(long lCustomerId) | CONotify |
put_OrderId(long lOrderId) | CONotify |
put_OrderId(long lOrderId) | CONotify |
Generated on Wed Nov 13 2024 16:57:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkRecognition::InkRecognition Member List

This is the complete list of members for InkRecognition::InkRecognition, including all inherited members.
btnRecognize | InkRecognition::InkRecognition | [private]
btnRecognize_Click(object sender, System.EventArgs e) | InkRecognition::InkRecognition | [inline, private]
components | InkRecognition::InkRecognition | [private]
Dispose(bool disposing) | InkRecognition::InkRecognition | [inline, protected]
gbInkArea | InkRecognition::InkRecognition | [private]
InitializeComponent() | InkRecognition::InkRecognition | [inline, private]
InkRecognition() | InkRecognition::InkRecognition | [inline]
InkRecognition_Load(object sender, System.EventArgs e) | InkRecognition::InkRecognition | [inline, private]
Main() | InkRecognition::InkRecognition | [inline, private, static]
myInkCollector | InkRecognition::InkRecognition | [private]
myRecognizers | InkRecognition::InkRecognition | [private]
txtResults | InkRecognition::InkRecognition | [private]
Generated on Wed Nov 13 2024 16:58:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTitleTag Member List

This is the complete list of members for CTitleTag, including all inherited members.
_aTempBuffer | CHtmlElement | [protected]
_cPropChars | CPropertyTag | [protected]
_cPropCharsFiltered | CPropertyTag | [protected]
_eState | CPropertyTag | [protected]
_eTokType | CPropertyTag | [protected]
_htmlIFilter | CHtmlElement | [protected]
_propSpec | CPropertyTag | [protected]
_pwcPropBuf | CPropertyTag | [protected]
_scanner | CHtmlElement | [protected]
_serialStream | CHtmlElement | [protected]
_uLenPropBuf | CPropertyTag | [protected]
_ulIdContentChunk | CPropertyTag | [protected]
CHtmlElement(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CHtmlElement |
ConcatenateProperty(WCHAR *awcPropSuffix, unsigned uLen) | CPropertyTag | [protected]
CPropertyTag(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream, CFullPropSpec &propSpec, HtmlTokenType eTokType) | CPropertyTag |
CTitleTag(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream, CFullPropSpec &propSpec, HtmlTokenType eTokType) | CTitleTag |
dummy | CTitleTag | [private]
GetChunk(STAT_CHUNK *pStat) | CTitleTag | [virtual]
GetText(ULONG *pcwcOutput, WCHAR *awcBuffer) | CTitleTag | [virtual]
GetValue(PROPVARIANT **ppPropValue) | CTitleTag | [virtual]
InitFilterRegion(ULONG &idChunkSource, ULONG &cwcStartSource, ULONG &cwcLenSource) | CHtmlElement | [virtual]
InitStatChunk(STAT_CHUNK *pStat) | CPropertyTag | [virtual]
SkipRemainingTextAndGotoNextChunk(STAT_CHUNK *pStat) | CHtmlElement | [protected]
SwitchToNextHtmlElement(STAT_CHUNK *pStat) | CHtmlElement | [protected]
~CHtmlElement() | CHtmlElement | [inline, virtual]
~CPropertyTag() | CPropertyTag |
Generated on Wed Nov 13 2024 16:57:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/statnode.h Source File

  • SysMgmt
  • MMC
  • Extens

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038
00039 public:
00040     // virtual functions go here (for MMCN_*)
00041     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00042
00043 private:
00044     enum { NUMBER_OF_CHILDREN = 4 };
00045     CDelegationBase *children[NUMBER_OF_CHILDREN];
00046
00047     // {2974380C-4C4B-11d2-89D8-000021473128}
00048     static const GUID thisGuid;
00049 };
00050
00051 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/UnBufCpy/UnBufCp1.c Source File

  • WinBase
  • IO
  • UnBufCpy

UnBufCp1.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1994 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     unbufcp1.c
00012
00013 Abstract:
00014
00015     This single-threaded version shows how to multiplex I/O to a number of files with
00016     a single thread. This is the most efficient mechanism if you do not need the
00017     asynchronous completion model that the dual-threaded version offers.
00018
00019     Only one thread and one I/O completion port is used. The file handles for the
00020     source and destination file are both associated with the same port.  The
00021     thread starts off by posting a number of overlapped
00022     reads from the source file.  It then waits on the I/O completion port.
00023     Whenever a read completes, it immediately turns it around into a write to
00024     the destination file. Whenever a write completes, it immediately posts the
00025     next read from the source file.
00026
00027     Thread 1
00028        |
00029        |
00030     kick off a few
00031     overlapped reads
00032        |
00033        |
00034   ->GetQueuedCompletionStatus(WritePort) <-----------
00035   |    |                                            |
00036   |    |-------------------------------             |
00037   |    |                              |             |
00038   | write has completed,      read has completed,   |
00039   | kick off another          kick off the write.   |
00040   | read                              |             |
00041   |    |                              |             |
00042   |____|                              |_____________|
00043
00044 --*/
00045 #ifdef _IA64_
00046 #pragma warning(disable:4100)
00047 #endif
00048
00049 #include <windows.h>
00050 #include <stdio.h>
00051 #include <stdlib.h>
00052 #include <ctype.h>
00053
00054 //
00055 // File handles for the copy operation. All read operations are
00056 // from SourceFile. All write operations are to DestFile.
00057 //
00058 HANDLE SourceFile;
00059 HANDLE DestFile;
00060
00061 //
00062 //version information
00063 //
00064 OSVERSIONINFO     ver;
00065
00066 //
00067 // I/O completion port. All read and writes to the files complete
00068 // to this port.
00069 //
00070 HANDLE IoPort;
00071
00072 //
00073 // Key values used to determine whether a read or a write
00074 // has completed.
00075 //
00076 #define ReadKey 0
00077 #define WriteKey 1
00078
00079 //
00080 // Structure used to track each outstanding I/O. The maximum
00081 // number of I/Os that will be outstanding at any time is
00082 // controllable by the MAX_CONCURRENT_IO definition.
00083 //
00084
00085 #define MAX_CONCURRENT_IO 20
00086
00087 typedef struct _COPY_CHUNK {
00088     OVERLAPPED Overlapped;
00089     LPVOID Buffer;
00090 } COPY_CHUNK, *PCOPY_CHUNK;
00091
00092 COPY_CHUNK CopyChunk[MAX_CONCURRENT_IO];
00093
00094 //
00095 // Define the size of the buffers used to do the I/O.
00096 // 64K is a nice number.
00097 //
00098 #define BUFFER_SIZE (64*1024)
00099
00100 //
00101 // The system's page size will always be a multiple of the
00102 // sector size. Do all I/Os in page-size chunks.
00103 //
00104 DWORD PageSize;
00105
00106
00107 //
00108 // Local function prototype
00109 //
00110 VOID
00111 CopyLoop(
00112     ULARGE_INTEGER FileSize
00113     );
00114
00115 int
00116 __cdecl
00117 main(
00118     int argc,
00119     char *argv[],
00120     char *envp
00121     )
00122 {
00123     ULARGE_INTEGER FileSize;
00124     ULARGE_INTEGER InitialSize;
00125     BOOL Success;
00126     DWORD Status;
00127     DWORD StartTime, EndTime;
00128     SYSTEM_INFO SystemInfo;
00129     HANDLE BufferedHandle;
00130
00131     if (argc != 3) {
00132         fprintf(stderr, "Usage: %s SourceFile DestinationFile\n", argv[0]);
00133         exit(1);
00134     }
00135
00136     //
00137     //confirm we are running on Windows NT 3.5 or greater, if not, display notice and
00138     //terminate.  Completion ports are only supported on Win32 & Win32s.  Creating a
00139     //Completion port with no handle specified is only supported on NT 3.51, so we need
00140     //to know what we're running on.  Note, Win32s does not support console apps, thats
00141     //why we exit here if we are not on Windows NT.
00142     //
00143     //
00144     //ver.dwOSVersionInfoSize needs to be set before calling GetVersionInfoEx()
00145     //
00146     ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
00147
00148     //
00149     //Failure here could mean several things.  1. On an NT system,
00150     //it indicates NT version 3.1 because GetVersionEx() is only
00151     //implemented on NT 3.5.  2. On Windows 3.1 system, it means
00152     //either Win32s version 1.1 or 1.0 is installed.
00153     //
00154     Success = GetVersionEx((LPOSVERSIONINFO) &ver);
00155
00156     if ( (!Success) ||                                   //GetVersionEx() failed - see above.
00157          (ver.dwPlatformId != VER_PLATFORM_WIN32_NT) )   //GetVersionEx() succeeded but we are not on NT.
00158       {
00159        MessageBox(NULL,
00160                   "This sample application can only be run on Windows NT. 3.5 or greater\n"
00161                   "This application will now terminate.",
00162                   "UnBufCp1",
00163                   MB_OK           |
00164                   MB_ICONSTOP     |
00165                   MB_SETFOREGROUND );
00166        exit( 1 );
00167       }
00168
00169
00170     //
00171     // Get the system's page size.
00172     //
00173     GetSystemInfo(&SystemInfo);
00174     PageSize = SystemInfo.dwPageSize;
00175
00176     //
00177     // Open the source file and create the destination file.
00178     // Use FILE_FLAG_NO_BUFFERING to avoid polluting the
00179     // system cache with two copies of the same data.
00180     //
00181
00182     SourceFile = CreateFile(argv[1],
00183                             GENERIC_READ | GENERIC_WRITE,
00184                             FILE_SHARE_READ,
00185                             NULL,
00186                             OPEN_EXISTING,
00187                             FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
00188                             NULL);
00189     if (SourceFile == INVALID_HANDLE_VALUE) {
00190         fprintf(stderr, "failed to open %s, error %d\n", argv[1], GetLastError());
00191         exit(1);
00192     }
00193     FileSize.LowPart = GetFileSize(SourceFile, &FileSize.HighPart);
00194     if ((FileSize.LowPart == 0xffffffff) && (GetLastError() != NO_ERROR)) {
00195         fprintf(stderr, "GetFileSize failed, error %d\n", GetLastError());
00196         exit(1);
00197     }
00198
00199     DestFile = CreateFile(argv[2],
00200                           GENERIC_READ | GENERIC_WRITE,
00201                           FILE_SHARE_READ | FILE_SHARE_WRITE,
00202                           NULL,
00203                           CREATE_ALWAYS,
00204                           FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
00205                           SourceFile);
00206     if (DestFile == INVALID_HANDLE_VALUE) {
00207         fprintf(stderr, "failed to open %s, error %d\n", argv[2], GetLastError());
00208         exit(1);
00209     }
00210
00211     //
00212     // Extend the destination file so that the filesystem does not
00213     // turn our asynchronous writes into synchronous ones.
00214     //
00215     InitialSize.QuadPart = (FileSize.QuadPart + PageSize - 1) & ~((DWORD_PTR)(PageSize-1));
00216     Status = SetFilePointer(DestFile,
00217                             InitialSize.LowPart,
00218                             (PLONG)&InitialSize.HighPart,
00219                             FILE_BEGIN);
00220     if ((Status == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) {
00221         fprintf(stderr, "initial SetFilePointer failed, error %d\n", GetLastError());
00222         exit(1);
00223     }
00224     Success = SetEndOfFile(DestFile);
00225     if (!Success) {
00226         fprintf(stderr, "SetEndOfFile failed, error %d\n", GetLastError());
00227         exit(1);
00228     }
00229
00230     //
00231     //In NT 3.51 it is not necessary to specify the FileHandle parameter
00232     //of CreateIoCompletionPort()--It is legal to specify the FileHandle
00233     //as INVALID_HANDLE_VALUE.  However, for NT 3.5 an overlapped file
00234     //handle is needed.
00235     //
00236     //We know already that we are running on NT, or else we wouldn't have
00237     //gotten this far, so lets see what version we are running on.
00238     //
00239     if (ver.dwMajorVersion == 3 && ver.dwMinorVersion == 50)
00240         //
00241         //we're running on NT 3.5 - Completion Ports exists.
00242         //
00243         IoPort = CreateIoCompletionPort(SourceFile,            //file handle to associate with I/O completion port.
00244                                         NULL,                  //optional handle to existing I/O completion port.
00245                                         ReadKey,               //completion key.
00246                                         1);                    //# of threads allowed to execute concurrently.
00247     else
00248         {
00249           //
00250           //we are running on NT 3.51 or greater.
00251           //Create the I/O Completion Port
00252           //
00253           IoPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE,//file handle to associate with I/O completion port
00254                                           NULL,                //optional handle to existing I/O completion port
00255                                           ReadKey,             //completion key
00256                                           1);                  //# of threads allowed to execute concurrently
00257
00258
00259           if (IoPort == NULL) {
00260              fprintf(stderr, "failed to create ReadPort, error %d\n", GetLastError());
00261              exit(1);
00262           }
00263
00264          //
00265          //If we need to, aka we're running on NT 3.51, let's associate a file handle with the
00266          //completion port.
00267          //
00268
00269          IoPort = CreateIoCompletionPort(SourceFile,
00270                                          IoPort,
00271                                          ReadKey,
00272                                          1);
00273
00274          if (IoPort == NULL)
00275            {
00276              fprintf(stderr,
00277                      "failed to create IoPort, error %d\n",
00278                      GetLastError());
00279
00280              exit(1);
00281
00282            }
00283         }
00284
00285     //
00286     // Associate the destination file handle with the
00287     // I/O completion port.
00288     //
00289
00290     IoPort = CreateIoCompletionPort(DestFile,
00291                                     IoPort,
00292                                     WriteKey,
00293                                     1);
00294     if (IoPort == NULL) {
00295         fprintf(stderr, "failed to create WritePort, error %d\n", GetLastError());
00296         exit(1);
00297     }
00298
00299
00300
00301     StartTime = GetTickCount();
00302
00303     //
00304     // Do the copy
00305     //
00306     CopyLoop(FileSize);
00307
00308     EndTime = GetTickCount();
00309
00310     CloseHandle(SourceFile);
00311     CloseHandle(DestFile);
00312
00313     //
00314     // We need another handle to the destination file that is
00315     // opened without FILE_FLAG_NO_BUFFERING. This allows us to set
00316     // the end-of-file marker to a position that is not sector-aligned.
00317     //
00318     BufferedHandle = CreateFile(argv[2],
00319                                 GENERIC_WRITE,
00320                                 FILE_SHARE_READ | FILE_SHARE_WRITE,
00321                                 NULL,
00322                                 OPEN_EXISTING,
00323                                 0,
00324                                 NULL);
00325     if (BufferedHandle == INVALID_HANDLE_VALUE) {
00326         fprintf(stderr,
00327                 "failed to open buffered handle to %s, error %d\n",
00328                 argv[2],
00329                 GetLastError());
00330         exit(1);
00331     }
00332
00333
00334     //
00335     // Set the destination's file size to the size of the
00336     // source file, in case the size of the source file was
00337     // not a multiple of the page size.
00338     //
00339     Status = SetFilePointer(BufferedHandle,
00340                             FileSize.LowPart,
00341                             (PLONG)&FileSize.HighPart,
00342                             FILE_BEGIN);
00343     if ((Status == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) {
00344         fprintf(stderr, "final SetFilePointer failed, error %d\n", GetLastError());
00345         exit(1);
00346     }
00347     Success = SetEndOfFile(BufferedHandle);
00348     if (!Success) {
00349         fprintf(stderr, "SetEndOfFile failed, error %d\n", GetLastError());
00350         exit(1);
00351     }
00352     CloseHandle(BufferedHandle);
00353
00354     printf("%d bytes copied in %.3f seconds\n",
00355            FileSize.LowPart,
00356            (float)(EndTime-StartTime)/1000.0);
00357     printf("%.2f MB/sec\n",
00358            ((LONGLONG)FileSize.QuadPart/(1024.0*1024.0)) / (((float)(EndTime-StartTime)) / 1000.0));
00359
00360     return(0);
00361
00362 }
00363
00364 VOID
00365 CopyLoop(
00366     ULARGE_INTEGER FileSize
00367     )
00368 {
00369     ULARGE_INTEGER ReadPointer;
00370     BOOL Success;
00371     DWORD NumberBytes;
00372     LPOVERLAPPED CompletedOverlapped;
00373     DWORD_PTR Key;
00374     PCOPY_CHUNK Chunk;
00375     int PendingIO = 0;
00376     int i;
00377
00378     //
00379     // Start reading the file. Kick off MAX_CONCURRENT_IO reads, then just
00380     // loop waiting for I/O to complete.
00381     //
00382     ReadPointer.QuadPart = 0;
00383
00384     for (i=0; i < MAX_CONCURRENT_IO; i++) {
00385         if (ReadPointer.QuadPart >= FileSize.QuadPart) {
00386             break;
00387         }
00388         //
00389         // Use VirtualAlloc so we get a page-aligned buffer suitable
00390         // for unbuffered I/O.
00391         //
00392         CopyChunk[i].Buffer = VirtualAlloc(NULL,
00393                                            BUFFER_SIZE,
00394                                            MEM_COMMIT,
00395                                            PAGE_READWRITE);
00396         if (CopyChunk[i].Buffer == NULL) {
00397             fprintf(stderr, "VirtualAlloc %d failed, error %d\n",i, GetLastError());
00398             exit(1);
00399         }
00400         CopyChunk[i].Overlapped.Offset = ReadPointer.LowPart;
00401         CopyChunk[i].Overlapped.OffsetHigh = ReadPointer.HighPart;
00402         CopyChunk[i].Overlapped.hEvent = NULL;     // not needed
00403
00404         Success = ReadFile(SourceFile,
00405                            CopyChunk[i].Buffer,
00406                            BUFFER_SIZE,
00407                            &NumberBytes,
00408                            &CopyChunk[i].Overlapped);
00409
00410         if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
00411             fprintf(stderr,
00412                     "ReadFile at %lx failed, error %d\n",
00413                     ReadPointer.LowPart,
00414                     GetLastError());
00415             exit(1);
00416         } else {
00417             ReadPointer.QuadPart += BUFFER_SIZE;
00418             ++PendingIO;
00419         }
00420     }
00421
00422     //
00423     // We have started the initial async. reads, enter the main loop.
00424     // This simply waits until an I/O completes, then issues the next
00425     // I/O.  When a write completes, the next read is issued. When a
00426     // read completes, the corresponding write is issued.
00427     //
00428     while (PendingIO) {
00429         Success = GetQueuedCompletionStatus(IoPort,
00430                                             &NumberBytes,
00431                                             &Key,
00432                                             &CompletedOverlapped,
00433                                             INFINITE);
00434         if (!Success) {
00435             //
00436             // Either the function failed to dequeue a completion packet
00437             // (CompletedOverlapped is not NULL) or it dequeued a completion
00438             // packet of a failed I/O operation (CompletedOverlapped is NULL).
00439             //
00440             fprintf(stderr,
00441                     "GetQueuedCompletionStatus on the IoPort failed, error %d\n",
00442                     GetLastError());
00443             exit(1);
00444         }
00445
00446
00447         Chunk = (PCOPY_CHUNK)CompletedOverlapped;
00448
00449         if (Key == ReadKey) {
00450
00451             //
00452             // A read has completed, issue the corresponding write.
00453             //
00454
00455             //
00456             // Round the number of bytes to write up to a sector boundary.
00457             //
00458             NumberBytes = (NumberBytes + PageSize - 1) & ~(PageSize-1);
00459
00460             Success = WriteFile(DestFile,
00461                                 Chunk->Buffer,
00462                                 NumberBytes,
00463                                 &NumberBytes,
00464                                 &Chunk->Overlapped);
00465
00466             if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
00467                 fprintf(stderr,
00468                         "WriteFile at %lx failed, error %d\n",
00469                         Chunk->Overlapped.Offset,
00470                         GetLastError());
00471                 exit(1);
00472             }
00473
00474             //
00475             // decrement pending I/O count
00476             //
00477             --PendingIO;
00478
00479         } else if (Key == WriteKey) {
00480
00481             //
00482             // A write has completed, issue the next read.
00483             //
00484
00485             if (ReadPointer.QuadPart < FileSize.QuadPart) {
00486                 Chunk->Overlapped.Offset = ReadPointer.LowPart;
00487                 Chunk->Overlapped.OffsetHigh = ReadPointer.HighPart;
00488                 ReadPointer.QuadPart += BUFFER_SIZE;
00489                 Success = ReadFile(SourceFile,
00490                                    Chunk->Buffer,
00491                                    NumberBytes,
00492                                    &NumberBytes,
00493                                    &Chunk->Overlapped);
00494                 if (!Success && (GetLastError() != ERROR_IO_PENDING)) {
00495                     fprintf(stderr,
00496                             "ReadFile at %lx failed, error %d\n",
00497                             Chunk->Overlapped.Offset,
00498                             GetLastError());
00499                     exit(1);
00500                 }
00501             } else {
00502                 //
00503                 // There are no more reads left to issue, just
00504                 // wait for the pending writes to drain.
00505                 //
00506                 --PendingIO;
00507             }
00508         }
00509     }
00510     //
00511     // All done. There is no need to call VirtualFree() to free CopyChunk
00512     // buffers here. The buffers will be freed when this process exits.
00513     //
00514 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/resource.h Source File

  • SysMgmt
  • MMC
  • Ppgeext

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDD_PROPPAGE_LARGE              10
00011 #define IDS_PST_ROCKET_EXT              10
00012 #define IDI_ICON1                       108
00013 #define IDI_PSI_ROCKET                  114
00014 #define IDR_SMICONS                     120
00015 #define IDR_LGICONS                     121
00016 #define IDB_SMOPEN                      124
00017 #define IDB_SMBMP                       125
00018 #define IDB_LGBMP                       126
00019 #define IDB_ROCKET                      40004
00020 #define IDB_CAR                         40005
00021 #define IDB_PLANE                       40006
00022 #define IDB_BIKE                        40007
00023 #define IDB_ROCKET2                     40008
00024 #define IDB_CAR2                        40009
00025 #define IDB_PLANE2                      40010
00026 #define IDB_BIKE2                       40011
00027 #define IDB_CLOSED2                     40012
00028 #define IDB_OPEN2                       40013
00029 #define IDB_CLOSED                      40014
00030 #define IDB_OPEN                        40015
00031 #define ID_BUTTON40016                  40016
00032 #define ID_BUTTON40017                  40017
00033 #define ID_BUTTON40018                  40018
00034 #define ID_BUTTON40019                  40019
00035 #define ID_BUTTON40020                  40020
00036 #define ID_BUTTON40021                  40021
00037 #define ID_BUTTON40022                  40022
00038 #define ID_BUTTON40023                  40023
00039 #define ID_BUTTON40024                  40024
00040 #define ID_BUTTON40025                  40025
00041 #define ID_BUTTON40026                  40026
00042 #define EDIT1                           40027
00043 #define EDIT2                           40028
00044 #define EDIT3                           40029
00045 #define EDIT4                           40030
00046 #define COMBO1                          40031
00047
00048 // Next default values for new objects
00049 //
00050 #ifdef APSTUDIO_INVOKED
00051 #ifndef APSTUDIO_READONLY_SYMBOLS
00052 #define _APS_NEXT_RESOURCE_VALUE        127
00053 #define _APS_NEXT_COMMAND_VALUE         40032
00054 #define _APS_NEXT_CONTROL_VALUE         1000
00055 #define _APS_NEXT_SYMED_VALUE           101
00056 #endif
00057 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagCrmFilesCreateFileLogRecord Member List

This is the complete list of members for tagCrmFilesCreateFileLogRecord, including all inherited members.
CommandType | tagCrmFilesCreateFileLogRecord
dwSourceSize | tagCrmFilesCreateFileLogRecord
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Dialog.c Source File

  • Multimedia
  • Gdi
  • GdiDemo

Dialog.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /*---------------------------------------------------------------------------*\
00013 | DIALOG MODULE
00014 |   This module contains the dialogbox routines for this application.
00015 \*---------------------------------------------------------------------------*/
00016
00017 #include <windows.h>
00018 #include "gdidemo.h"
00019
00020 /*---------------------------------------------------------------------------*\
00021 | DISPLAY DIALOG BOX
00022 |   This is a routine to display a generic modal-dialog box.
00023 |
00024 \*---------------------------------------------------------------------------*/
00025 INT_PTR FAR DisplayDialogBox(HWND hWnd, LPSTR lpszTemplate, WNDPROC lpfFunction, LONG lExtra)
00026 {
00027     HANDLE  hInstance;
00028     WNDPROC lpfDlg;
00029     INT_PTR nRet;
00030
00031
00032     nRet = -1;
00033     if(hInstance = GETINSTANCE(hWnd))
00034     {
00035         if(lpfDlg = MakeProcInstance(lpfFunction,hInstance))
00036         {
00037             nRet = DialogBoxParam(hInstance,lpszTemplate,hWnd,(DLGPROC)lpfDlg,lExtra);
00038             FreeProcInstance(lpfDlg);
00039         }
00040     }
00041     return(nRet);
00042 }
00043
00044
00045 /*---------------------------------------------------------------------------*\
00046 | ABOUT DIALOG PROCEDURE
00047 |   This is the main dialog box routine for the HELPABOUT template.
00048 |
00049 \*---------------------------------------------------------------------------*/
00050 BOOL APIENTRY AboutDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LONG lParam)
00051 {
00052     lParam = lParam;
00053
00054     switch(wMsg)
00055     {
00056         /*
00057         ** Set the focus to the OK button.
00058         */
00059         case WM_INITDIALOG:
00060             SetFocus(GetDlgItem(hDlg,IDOK));
00061             break;
00062
00063
00064         /*
00065         ** Look for an ESC or RETURN event.
00066         */
00067         case WM_COMMAND:
00068             switch(wParam)
00069             {
00070                 case IDOK:
00071                 case IDCANCEL:
00072                     EndDialog(hDlg,TRUE);
00073                     break;
00074
00075                 default:
00076                     return(FALSE);
00077             }
00078             break;
00079
00080
00081         /*
00082         ** Wash the background of the aboutbox to give it a nice blue-scaling
00083         ** effect.  Invalidate the OK button to force it to the top.  This
00084         ** seems to be necessary since the OK button gets overwritten during
00085         ** the washing.
00086         */
00087         case WM_PAINT:
00088             PaintWindow(hDlg,COLOR_SCALE_BLUE);
00089             InvalidateRect(GetDlgItem(hDlg,IDOK),NULL,TRUE);
00090
00091
00092         /*
00093         ** Default handler.
00094         */
00095         default:
00096             return(FALSE);
00097     }
00098     return(TRUE);
00099 }
00100
00101
00102 /*---------------------------------------------------------------------------*\
00103 | PAINT WND BACKGROUND
00104 |   This routine is used to wash the background of a window.
00105 |
00106 \*---------------------------------------------------------------------------*/
00107 VOID PaintWindow(HWND hWnd, int nColor)
00108 {
00109     HDC         hDC;
00110     int         nMapMode,idx,nSize,nReserved,nLoop;
00111     RECT        rect;
00112     HBRUSH      hBrush;
00113     PAINTSTRUCT ps;
00114     HPALETTE    hPal;
00115
00116
00117     if(hDC = BeginPaint(hWnd,&ps))
00118     {
00119         GetClientRect(hWnd,&rect);
00120         nMapMode = SetMapMode(hDC,MM_ANISOTROPIC);
00121
00122
00123         if(GetDeviceCaps(hDC,RASTERCAPS) & RC_PALETTE)
00124         {
00125             nReserved = GetDeviceCaps(hDC,NUMRESERVED);
00126             nSize     = GetDeviceCaps(hDC,SIZEPALETTE) - nReserved;
00127
00128             if(hPal = CreateColorScalePalette(hDC,nColor))
00129             {
00130                 hPal = SelectPalette(hDC,hPal,FALSE);
00131                 RealizePalette(hDC);
00132
00133
00134 #ifdef WIN16
00135                 SetWindowExtEx(hDC,nSize,nSize);
00136                 SetViewportExtEx(hDC,rect.right,-rect.bottom);
00137                 SetViewportOrgEx(hDC,0,rect.bottom);
00138 #else
00139
00140                 SetWindowExtEx(hDC,nSize,nSize,NULL);
00141                 SetViewportExtEx(hDC,rect.right,-rect.bottom,NULL);
00142                 SetViewportOrgEx(hDC,0,rect.bottom,NULL);
00143
00144 #endif
00145
00146                 nLoop = nSize >> 1;
00147                 for(idx=0; idx < nLoop; idx++)
00148                 {
00149                     hBrush = CreateSolidBrush(PALETTEINDEX(idx+nLoop));
00150                     SetRect(&rect,idx,idx,nSize-idx,nSize-idx);
00151                     FillRect(hDC,&rect,hBrush);
00152                     DeleteObject(hBrush);
00153                 }
00154                 DeleteObject(SelectPalette(hDC,hPal,FALSE));
00155                 RealizePalette(hDC);
00156             }
00157         }
00158         else
00159         {
00160
00161 #ifdef WIN16
00162
00163             SetWindowExtEx(hDC,512,512);
00164             SetViewportExtEx(hDC,rect.right,-rect.bottom);
00165             SetViewportOrgEx(hDC,0,rect.bottom);
00166
00167 #else
00168
00169             SetWindowExtEx(hDC,512,512,NULL);
00170             SetViewportExtEx(hDC,rect.right,-rect.bottom,NULL);
00171             SetViewportOrgEx(hDC,0,rect.bottom,NULL);
00172
00173 #endif
00174
00175             for(idx=0; idx < 256; idx++)
00176             {
00177                 hBrush = CreateSolidBrush(RGB(0,0,idx));
00178                 SetRect(&rect,idx,idx,512-idx,512-idx);
00179                 FillRect(hDC,&rect,hBrush);
00180                 DeleteObject(hBrush);
00181             }
00182         }
00183
00184         SetMapMode(hDC,nMapMode);
00185
00186         EndPaint(hWnd,&ps);
00187     }
00188     return;
00189 }
00190
00191
00192
00193
00194
00195
00196 /*---------------------------------------------------------------------------*\
00197 | CREATE COLOR SCALE PALETTE
00198 |   This routine creates a palette representing the scale values of a
00199 |   particular RGB color.  A gray-scale palette can also be created.
00200 |
00201 \*---------------------------------------------------------------------------*/
00202 HPALETTE CreateColorScalePalette(HDC hDC, int nColor)
00203 {
00204     HPALETTE     hPalette;
00205     GLOBALHANDLE hMem;
00206     LPLOGPALETTE lpMem;
00207     int          idx,nReserved,nSize;
00208
00209
00210     hPalette = NULL;
00211     if(GetDeviceCaps(hDC,RASTERCAPS) & RC_PALETTE)
00212     {
00213         nReserved = GetDeviceCaps(hDC,NUMRESERVED);
00214         nSize     = GetDeviceCaps(hDC,SIZEPALETTE) - nReserved;
00215
00216         if(hMem = GlobalAlloc(GHND,(DWORD)sizeof(LOGPALETTE)+(sizeof(PALETTEENTRY)*nSize)))
00217         {
00218             if(lpMem = (LPLOGPALETTE)GlobalLock(hMem))
00219             {
00220                 lpMem->palNumEntries = (WORD)nSize;
00221                 lpMem->palVersion    = (WORD)0x0300;
00222
00223                 switch(nColor)
00224                 {
00225                     case COLOR_SCALE_RED:
00226                         for(idx=0; idx < nSize; idx++)
00227                         {
00228                             lpMem->palPalEntry[idx].peRed   = (BYTE)idx;
00229                             lpMem->palPalEntry[idx].peGreen = 0;
00230                             lpMem->palPalEntry[idx].peBlue  = 0;
00231                             lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00232                         }
00233                         break;
00234
00235                     case COLOR_SCALE_GREEN:
00236                         for(idx=0; idx < nSize; idx++)
00237                         {
00238                             lpMem->palPalEntry[idx].peRed   = 0;
00239                             lpMem->palPalEntry[idx].peGreen = (BYTE)idx;
00240                             lpMem->palPalEntry[idx].peBlue  = 0;
00241                             lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00242                         }
00243                         break;
00244
00245                     case COLOR_SCALE_BLUE:
00246                         for(idx=0; idx < nSize; idx++)
00247                         {
00248                             lpMem->palPalEntry[idx].peRed   = 0;
00249                             lpMem->palPalEntry[idx].peGreen = 0;
00250                             lpMem->palPalEntry[idx].peBlue  = (BYTE)idx;
00251                             lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00252                         }
00253                         break;
00254
00255                     default:
00256                     case COLOR_SCALE_GRAY:
00257                         for(idx=0; idx < nSize; idx++)
00258                         {
00259                             lpMem->palPalEntry[idx].peRed   = (BYTE)idx;
00260                             lpMem->palPalEntry[idx].peGreen = (BYTE)idx;
00261                             lpMem->palPalEntry[idx].peBlue  = (BYTE)idx;
00262                             lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00263                         }
00264                         break;
00265                 }
00266
00267                 hPalette = CreatePalette(lpMem);
00268
00269                 GlobalUnlock(hMem);
00270             }
00271             GlobalFree(hMem);
00272         }
00273     }
00274     return(hPalette);
00275 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkZoom/C#/InkZoom.cs Source File

  • TabletPC
  • InkZoom
  • C#

InkZoom.cs

Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 //
00003 //  This is part of the Microsoft Tablet PC Platform SDK
00004 //  Copyright (C) 2002 Microsoft Corporation
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00009 //  documentation provided with the Software Development Kit.
00010 //  See these sources for more detailed information.
00011 //
00012 //  File: InkCollection.cs
00013 //  Simple Ink Collection Sample Application
00014 //
00015 //  This sample program demonstrates how to zoom and scroll
00016 //  ink.  In particular, it allows the user to zoom in and out
00017 //  of ink in increments.  It also demonstrates how to zoom
00018 //  into a particular region using a zoom rectangle.  Finally,
00019 //  this sample illustrates that ink can be collected at different
00020 //  zoom levels and how to set up scrolling within the zoomed
00021 //  drawing area.
00022 //
00023 //  In the code below, Renderer's view and object transforms are
00024 //  used to perform zooming and scrolling.  The view transform
00025 //  applies to the points and the pen width.  The object transform
00026 //  applies only to the points.  The user can control which transform
00027 //  is used by changing the Mode->Scale Pen Width menu setting of
00028 //  this sample.
00029 //
00030 //  The features used are: InkCollector, Renderer.SetViewTransform(),
00031 //  and Renderer.SetObjectTransform().
00032 //
00033 //--------------------------------------------------------------------------
00034
00035 using System;
00036 using System.Drawing;
00037 using System.Windows.Forms;
00038 using System.Drawing.Drawing2D;
00039
00040 // The Ink namespace, which contains the Tablet PC Platform API
00041 using Microsoft.Ink;
00042
00043 namespace Microsoft.Samples.Ink.Cs.InkZoom
00044 {
00045
00046   /// <summary>
00047   /// The InkZoom Sample Application form class
00048   /// </summary>
00049   public class InkZoom : System.Windows.Forms.Form
00050   {
00051
00052         // Declare the Ink Collector object
00053         private InkCollector myInkCollector = null;
00054
00055         // The pen used for drawing the zoom rectangle
00056         Pen blackPen = null;
00057
00058         // The zoom rectangle
00059         private Rectangle zoomRectangle = Rectangle.Empty;
00060
00061         // The current zoom factor (1 = 100% zoom level)
00062         private float zoomFactor = 1;
00063
00064         // Declare constants for the width and height of the
00065         // drawing area (in ink space coordinates).
00066         private const int InkSpaceWidth = 50000;
00067         private const int InkSpaceHeight = 50000;
00068
00069         // Declare constant for the size of the desired small change
00070         private const int SmallChangeSize = 2;
00071
00072         // Declare constant for the pen width used by this application
00073         private const float MediumInkWidth = 100;
00074
00075         #region Standard Template Code
00076         private System.Windows.Forms.HScrollBar hScrollBar;
00077         private System.Windows.Forms.VScrollBar vScrollBar;
00078         private System.Windows.Forms.MenuItem miOther;
00079         private System.Windows.Forms.MenuItem miZoomToRect;
00080         private System.Windows.Forms.Panel pnlDrawingArea;
00081         private System.Windows.Forms.MenuItem miFile;
00082         private System.Windows.Forms.MenuItem miExit;
00083         private System.Windows.Forms.Label lblZoom;
00084         private System.Windows.Forms.NumericUpDown zoomUpDown;
00085         private System.Windows.Forms.Panel pnlZoom;
00086         private System.Windows.Forms.MenuItem miScalePenWidth;
00087         private System.Windows.Forms.MenuItem miInk;
00088         private System.Windows.Forms.MainMenu miMain;
00089         private System.Windows.Forms.MenuItem miActionSeparator;
00090         private System.Windows.Forms.MenuItem miModeSepararator;
00091         private System.Windows.Forms.MenuItem miClear;
00092         private System.Windows.Forms.ToolBar zoomToolBar;
00093     private System.ComponentModel.Container components = null;
00094         #endregion
00095
00096         /// <summary>
00097         /// The InkZoom Sample Application form class
00098         /// </summary>
00099     public InkZoom()
00100     {
00101
00102             #region Standard Template Code
00103             //
00104             // Required for Windows Form Designer support
00105             //
00106             InitializeComponent();
00107             #endregion
00108         }
00109
00110         #region Standard Template Code
00111     /// <summary>
00112     /// Clean up any resources being used.
00113     /// </summary>
00114     protected override void Dispose( bool disposing )
00115     {
00116       if( disposing )
00117       {
00118         if (components != null)
00119         {
00120           components.Dispose();
00121         }
00122       }
00123       base.Dispose( disposing );
00124     }
00125         #endregion
00126
00127     #region Windows Form Designer generated code
00128     /// <summary>
00129     /// Required method for Designer support - do not modify
00130     /// the contents of this method with the code editor.
00131     /// </summary>
00132     private void InitializeComponent()
00133     {
00134             this.hScrollBar = new System.Windows.Forms.HScrollBar();
00135             this.vScrollBar = new System.Windows.Forms.VScrollBar();
00136             this.miMain = new System.Windows.Forms.MainMenu();
00137             this.miFile = new System.Windows.Forms.MenuItem();
00138             this.miClear = new System.Windows.Forms.MenuItem();
00139             this.miActionSeparator = new System.Windows.Forms.MenuItem();
00140             this.miExit = new System.Windows.Forms.MenuItem();
00141             this.miOther = new System.Windows.Forms.MenuItem();
00142             this.miInk = new System.Windows.Forms.MenuItem();
00143             this.miZoomToRect = new System.Windows.Forms.MenuItem();
00144             this.miModeSepararator = new System.Windows.Forms.MenuItem();
00145             this.miScalePenWidth = new System.Windows.Forms.MenuItem();
00146             this.pnlZoom = new System.Windows.Forms.Panel();
00147             this.lblZoom = new System.Windows.Forms.Label();
00148             this.zoomUpDown = new System.Windows.Forms.NumericUpDown();
00149             this.zoomToolBar = new System.Windows.Forms.ToolBar();
00150             this.pnlDrawingArea = new System.Windows.Forms.Panel();
00151             this.pnlZoom.SuspendLayout();
00152             ((System.ComponentModel.ISupportInitialize)(this.zoomUpDown)).BeginInit();
00153             this.SuspendLayout();
00154             //
00155             // hScrollBar
00156             //
00157             this.hScrollBar.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
00158                 | System.Windows.Forms.AnchorStyles.Right);
00159             this.hScrollBar.LargeChange = 100;
00160             this.hScrollBar.Location = new System.Drawing.Point(0, 279);
00161             this.hScrollBar.Maximum = 1000;
00162             this.hScrollBar.Name = "hScrollBar";
00163             this.hScrollBar.Size = new System.Drawing.Size(275, 17);
00164             this.hScrollBar.TabIndex = 0;
00165             this.hScrollBar.ValueChanged += new System.EventHandler(this.hScrollBar_ValueChanged);
00166             this.hScrollBar.Scroll += new System.Windows.Forms.ScrollEventHandler(this.hScrollBar_Scroll);
00167             //
00168             // vScrollBar
00169             //
00170             this.vScrollBar.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
00171                 | System.Windows.Forms.AnchorStyles.Right);
00172             this.vScrollBar.LargeChange = 100;
00173             this.vScrollBar.Location = new System.Drawing.Point(275, 26);
00174             this.vScrollBar.Maximum = 1000;
00175             this.vScrollBar.Name = "vScrollBar";
00176             this.vScrollBar.Size = new System.Drawing.Size(17, 254);
00177             this.vScrollBar.TabIndex = 1;
00178             this.vScrollBar.ValueChanged += new System.EventHandler(this.vScrollBar_ValueChanged);
00179             this.vScrollBar.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar_Scroll);
00180             //
00181             // miMain
00182             //
00183             this.miMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00184                                                                                    this.miFile,
00185                                                                                    this.miOther});
00186             //
00187             // miFile
00188             //
00189             this.miFile.Index = 0;
00190             this.miFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00191                                                                                    this.miClear,
00192                                                                                    this.miActionSeparator,
00193                                                                                    this.miExit});
00194             this.miFile.Text = "&Action";
00195             //
00196             // miClear
00197             //
00198             this.miClear.Index = 0;
00199             this.miClear.Text = "&Clear";
00200             this.miClear.Click += new System.EventHandler(this.miClear_Click);
00201             //
00202             // miActionSeparator
00203             //
00204             this.miActionSeparator.Index = 1;
00205             this.miActionSeparator.Text = "-";
00206             //
00207             // miExit
00208             //
00209             this.miExit.Index = 2;
00210             this.miExit.Text = "E&xit";
00211             this.miExit.Click += new System.EventHandler(this.miExit_Click);
00212             //
00213             // miOther
00214             //
00215             this.miOther.Index = 1;
00216             this.miOther.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00217                                                                                     this.miInk,
00218                                                                                     this.miZoomToRect,
00219                                                                                     this.miModeSepararator,
00220                                                                                     this.miScalePenWidth});
00221             this.miOther.Text = "&Mode";
00222             //
00223             // miInk
00224             //
00225             this.miInk.Checked = true;
00226             this.miInk.Index = 0;
00227             this.miInk.RadioCheck = true;
00228             this.miInk.Text = "&Ink";
00229             this.miInk.Click += new System.EventHandler(this.miInk_Click);
00230             //
00231             // miZoomToRect
00232             //
00233             this.miZoomToRect.Index = 1;
00234             this.miZoomToRect.RadioCheck = true;
00235             this.miZoomToRect.Text = "&Zoom To Rect";
00236             this.miZoomToRect.Click += new System.EventHandler(this.miZoomToRect_Click);
00237             //
00238             // miModeSepararator
00239             //
00240             this.miModeSepararator.Index = 2;
00241             this.miModeSepararator.Text = "-";
00242             //
00243             // miScalePenWidth
00244             //
00245             this.miScalePenWidth.Checked = true;
00246             this.miScalePenWidth.Index = 3;
00247             this.miScalePenWidth.Text = "&Scale Pen Width";
00248             this.miScalePenWidth.Click += new System.EventHandler(this.miScalePenWidth_Click);
00249             //
00250             // pnlZoom
00251             //
00252             this.pnlZoom.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
00253                 | System.Windows.Forms.AnchorStyles.Right);
00254             this.pnlZoom.BackColor = System.Drawing.SystemColors.Control;
00255             this.pnlZoom.Controls.AddRange(new System.Windows.Forms.Control[] {
00256                                                                                   this.lblZoom,
00257                                                                                   this.zoomUpDown,
00258                                                                                   this.zoomToolBar});
00259             this.pnlZoom.ForeColor = System.Drawing.SystemColors.ControlText;
00260             this.pnlZoom.Name = "pnlZoom";
00261             this.pnlZoom.Size = new System.Drawing.Size(292, 26);
00262             this.pnlZoom.TabIndex = 3;
00263             //
00264             // lblZoom
00265             //
00266             this.lblZoom.Location = new System.Drawing.Point(8, 7);
00267             this.lblZoom.Name = "lblZoom";
00268             this.lblZoom.Size = new System.Drawing.Size(56, 16);
00269             this.lblZoom.TabIndex = 3;
00270             this.lblZoom.Text = "Zoom %:";
00271             //
00272             // zoomUpDown
00273             //
00274             this.zoomUpDown.Location = new System.Drawing.Point(64, 3);
00275             this.zoomUpDown.Maximum = new System.Decimal(new int[] {
00276                                                                        5000,
00277                                                                        0,
00278                                                                        0,
00279                                                                        0});
00280             this.zoomUpDown.Minimum = new System.Decimal(new int[] {
00281                                                                        10,
00282                                                                        0,
00283                                                                        0,
00284                                                                        0});
00285             this.zoomUpDown.Name = "zoomUpDown";
00286             this.zoomUpDown.Size = new System.Drawing.Size(56, 20);
00287             this.zoomUpDown.TabIndex = 2;
00288             this.zoomUpDown.Value = new System.Decimal(new int[] {
00289                                                                      100,
00290                                                                      0,
00291                                                                      0,
00292                                                                      0});
00293             this.zoomUpDown.ValueChanged += new System.EventHandler(this.xZoomUpDown_ValueChanged);
00294             //
00295             // zoomToolBar
00296             //
00297             this.zoomToolBar.DropDownArrows = true;
00298             this.zoomToolBar.Name = "zoomToolBar";
00299             this.zoomToolBar.ShowToolTips = true;
00300             this.zoomToolBar.Size = new System.Drawing.Size(292, 39);
00301             this.zoomToolBar.TabIndex = 4;
00302             //
00303             // pnlDrawingArea
00304             //
00305             this.pnlDrawingArea.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
00306                 | System.Windows.Forms.AnchorStyles.Left)
00307                 | System.Windows.Forms.AnchorStyles.Right);
00308             this.pnlDrawingArea.BackColor = System.Drawing.Color.White;
00309             this.pnlDrawingArea.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
00310             this.pnlDrawingArea.Location = new System.Drawing.Point(0, 26);
00311             this.pnlDrawingArea.Name = "pnlDrawingArea";
00312             this.pnlDrawingArea.Size = new System.Drawing.Size(275, 254);
00313             this.pnlDrawingArea.TabIndex = 4;
00314             this.pnlDrawingArea.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlDrawingArea_MouseUp);
00315             this.pnlDrawingArea.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlDrawingArea_MouseMove);
00316             this.pnlDrawingArea.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlDrawingArea_MouseDown);
00317             //
00318             // InkZoom
00319             //
00320             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00321             this.ClientSize = new System.Drawing.Size(292, 296);
00322             this.Controls.AddRange(new System.Windows.Forms.Control[] {
00323                                                                           this.pnlDrawingArea,
00324                                                                           this.pnlZoom,
00325                                                                           this.vScrollBar,
00326                                                                           this.hScrollBar});
00327             this.Menu = this.miMain;
00328             this.Name = "InkZoom";
00329             this.Text = "InkZoom";
00330             this.Resize += new System.EventHandler(this.InkZoom_Resize);
00331             this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pnlDrawingArea_MouseDown);
00332             this.Load += new System.EventHandler(this.InkZoom_Load);
00333             this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pnlDrawingArea_MouseUp);
00334             this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pnlDrawingArea_MouseMove);
00335             this.pnlZoom.ResumeLayout(false);
00336             ((System.ComponentModel.ISupportInitialize)(this.zoomUpDown)).EndInit();
00337             this.ResumeLayout(false);
00338
00339         }
00340     #endregion
00341
00342         #region Standard Template Code
00343     /// <summary>
00344     /// The main entry point for the application.
00345     /// </summary>
00346     [STAThread]
00347     static void Main()
00348     {
00349       Application.Run(new InkZoom());
00350     }
00351         #endregion
00352
00353         /// <summary>
00354         /// Event Handle from form Load Event
00355         /// </summary>
00356         /// <param name="sender">The control that raised the event.</param>
00357         /// <param name="e">The event arguments.</param>
00358         private void InkZoom_Load(object sender, System.EventArgs e)
00359         {
00360             // Create the pen used to draw the zoom rectangle
00361             blackPen = new Pen(Color.Black, 1);
00362
00363             // Create the ink collector and associate it with the form
00364             myInkCollector = new InkCollector(pnlDrawingArea.Handle);
00365
00366             // Set the pen width
00367             myInkCollector.DefaultDrawingAttributes.Width = MediumInkWidth;
00368
00369             // Enable ink collection
00370             myInkCollector.Enabled = true;
00371
00372             // Define ink space size - note that the scroll bars
00373             // map directly to ink space
00374             hScrollBar.Minimum = 0;
00375             hScrollBar.Maximum = InkSpaceWidth;
00376             vScrollBar.Minimum = 0;
00377             vScrollBar.Maximum = InkSpaceHeight;
00378
00379             // Set the scroll bars to map to the current zoom level
00380             UpdateZoomAndScroll();
00381         }
00382
00383         /// <summary>
00384         /// Event Handle from xZoomUpDown Click Event
00385         /// </summary>
00386         /// <param name="sender">The control that raised the event.</param>
00387         /// <param name="e">The event arguments.</param>
00388         private void xZoomUpDown_ValueChanged(object sender, System.EventArgs e)
00389         {
00390             // Update the zoom factor to the new value
00391             zoomFactor = (float)zoomUpDown.Value/100;
00392
00393             // Apply the new zoom/scroll settings
00394             UpdateZoomAndScroll();
00395         }
00396
00397         /// <summary>
00398         /// Event Handle from Horizontal Scroll Event
00399         /// </summary>
00400         /// <param name="sender">The control that raised the event.</param>
00401         /// <param name="e">The event arguments.</param>
00402         private void hScrollBar_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
00403         {
00404             // Apply the new zoom/scroll settings
00405             UpdateZoomAndScroll();
00406         }
00407
00408         /// <summary>
00409         /// Event Handle from Vertical Scroll Event
00410         /// </summary>
00411         /// <param name="sender">The control that raised the event.</param>
00412         /// <param name="e">The event arguments.</param>
00413         private void vScrollBar_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
00414         {
00415             // Apply the new zoom/scroll settings
00416             UpdateZoomAndScroll();
00417         }
00418
00419         /// <summary>
00420         /// Event Handle from Horizontal Scroll Value Changed Event
00421         /// </summary>
00422         /// <param name="sender">The control that raised the event.</param>
00423         /// <param name="e">The event arguments.</param>
00424         private void hScrollBar_ValueChanged(object sender, System.EventArgs e)
00425         {
00426             // Apply the new zoom/scroll settings
00427             UpdateZoomAndScroll();
00428         }
00429
00430         /// <summary>
00431         /// Event Handle form Vertical Scroll Value Changed Event
00432         /// </summary>
00433         /// <param name="sender">The control that raised the event.</param>
00434         /// <param name="e">The event arguments.</param>
00435         private void vScrollBar_ValueChanged(object sender, System.EventArgs e)
00436         {
00437             // Apply the new zoom/scroll settings
00438             UpdateZoomAndScroll();
00439         }
00440
00441         /// <summary>
00442         /// Event Handle from ApplyToPenWidth Click Event
00443         /// </summary>
00444         /// <param name="sender">The control that raised the event.</param>
00445         /// <param name="e">The event arguments.</param>
00446         private void miScalePenWidth_Click(object sender, System.EventArgs e)
00447         {
00448             // Toggle the value indicating whether to apply the zoom to pen width
00449             // If on,  use the view transform.  Otherwise, use the object transform.
00450             miScalePenWidth.Checked = !miScalePenWidth.Checked;
00451
00452             // Renderer's view and object transforms are used to perform
00453             // zooming and scrolling.  The view transform applies to the
00454             // points and pen width.  The object transform  applies
00455             // only to the points.  Since the sample only uses one of these
00456             // transforms at a time, it is necessary to clear out the unused
00457             // transform and then invoke SetViewTransform to apply the
00458             // zoom/scroll settings on the view or object transform
00459             // (depending if pen width scaling is desired).
00460             if (miScalePenWidth.Checked)
00461             {
00462                 myInkCollector.Renderer.SetObjectTransform(null);
00463             }
00464             else
00465             {
00466                 myInkCollector.Renderer.SetViewTransform(null);
00467             }
00468
00469             // Apply the new zoom/scroll settings
00470             UpdateZoomAndScroll();
00471         }
00472
00473         /// <summary>
00474         /// Event Handle from Ink Click Event
00475         /// </summary>
00476         /// <param name="sender">The control that raised the event.</param>
00477         /// <param name="e">The event arguments.</param>
00478         private void miInk_Click(object sender, System.EventArgs e)
00479         {
00480             // Update the Mode menu to be in ink mode
00481             miInk.Checked = true;
00482             miZoomToRect.Checked = false;
00483
00484             // Update the cursor
00485             // Note that it is necessary to use the full name to avoid a
00486             // namespace conflict with InkCollector's Cursors property.
00487             pnlDrawingArea.Cursor = System.Windows.Forms.Cursors.Default;
00488
00489             // Enable the ink collector
00490             myInkCollector.Enabled = true;
00491         }
00492
00493         /// <summary>
00494         /// Event Handle from ZoomToRect Click Event
00495         /// </summary>
00496         /// <param name="sender">The control that raised the event.</param>
00497         /// <param name="e">The event arguments.</param>
00498         private void miZoomToRect_Click(object sender, System.EventArgs e)
00499         {
00500             // Update the Mode menu to be in zoom to rect mode
00501             miInk.Checked = false;
00502             miZoomToRect.Checked = true;
00503
00504             // Update the cursor
00505             pnlDrawingArea.Cursor = System.Windows.Forms.Cursors.Cross;
00506
00507             // Disable the ink collector
00508             myInkCollector.Enabled = false;
00509         }
00510
00511         /// <summary>
00512         /// Event Handle from Clear Click Event
00513         /// </summary>
00514         /// <param name="sender">The control that raised the event.</param>
00515         /// <param name="e">The event arguments.</param>
00516         private void miClear_Click(object sender, System.EventArgs e)
00517         {
00518             // Set the zoom level to 100%
00519             zoomFactor = 1;
00520
00521             // Set the scroll bars to the top left of the screen
00522             hScrollBar.Value = 0;
00523             vScrollBar.Value = 0;
00524
00525             zoomUpDown.Value = 100;
00526
00527             // remove all strokes from the ink collector
00528             myInkCollector.Ink.DeleteStrokes();
00529
00530             // Apply the new zoom/scroll settings
00531             UpdateZoomAndScroll();
00532
00533             // Reset the application mode to inking
00534             miInk.Checked = true;
00535             miZoomToRect.Checked = false;
00536             Cursor = System.Windows.Forms.Cursors.Default;
00537             myInkCollector.Enabled = true;
00538         }
00539
00540         /// <summary>
00541         /// Event Handle from File->Exit Click Event
00542         /// </summary>
00543         /// <param name="sender">The control that raised the event.</param>
00544         /// <param name="e">The event arguments.</param>
00545         private void miExit_Click(object sender, System.EventArgs e)
00546         {
00547             myInkCollector.Enabled = false;
00548             this.Dispose();
00549         }
00550
00551         /// <summary>
00552         /// Event Handle from form's Resize Event
00553         /// </summary>
00554         /// <param name="sender">The control that raised the event.</param>
00555         /// <param name="e">The event arguments.</param>
00556         private void InkZoom_Resize(object sender, System.EventArgs e)
00557         {
00558             // If the user resizes the window, update the scroll
00559             // bars to reflect the change.  However, it is necessary
00560             // to check whether the ink collector is null before
00561             // invoking this method since the Resize event also occurs
00562             // automatically before the ink collector is created.
00563             if (myInkCollector!=null)
00564             {
00565                 UpdateScrollBars();
00566             }
00567         }
00568
00569         /// <summary>
00570         /// Event Handle from MouseDown Event
00571         /// </summary>
00572         /// <param name="sender">The control that raised the event.</param>
00573         /// <param name="e">The event arguments.</param>
00574         private void pnlDrawingArea_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
00575         {
00576             // If the user has selected to draw a zoom rectangle, update
00577             // the zoom rectangle's start point to the mouse location.
00578             if (miZoomToRect.Checked)
00579             {
00580                 zoomRectangle.Location = new Point(e.X,e.Y);
00581                 zoomRectangle.Width = 0;
00582                 zoomRectangle.Height = 0;
00583             }
00584         }
00585
00586         /// <summary>
00587         /// Event Handle from MouseMove event
00588         /// </summary>
00589         /// <param name="sender">The control that raised the event.</param>
00590         /// <param name="e">The event arguments.</param>
00591         private void pnlDrawingArea_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
00592         {
00593             // If the user has selected to draw a zoom rectangle and has a mouse
00594             // button pressed down, update the zoom rectangle end point to the
00595             // new mouse location.
00596             if ( (miZoomToRect.Checked) &&  (MouseButtons != MouseButtons.None) )
00597             {
00598                 // Erase the previous zoom rectangle
00599                 Rectangle screenRect = zoomRectangle;
00600                 screenRect.Offset(pnlDrawingArea.PointToScreen(Point.Empty));
00601                 ControlPaint.DrawReversibleFrame(screenRect,Color.Transparent,FrameStyle.Dashed);
00602
00603                 int xSize = e.X - zoomRectangle.Location.X;
00604                 int ySize = e.Y - zoomRectangle.Location.Y;
00605
00606                 int zoomRectSize = Math.Max(Math.Abs(xSize),Math.Abs(ySize));
00607
00608                 zoomRectangle.Width = (xSize>0)?zoomRectSize:-zoomRectSize;
00609                 zoomRectangle.Height = (ySize>0)?zoomRectSize:-zoomRectSize;
00610
00611                 // Draw the current zoom rectangle
00612                 screenRect = zoomRectangle;
00613                 screenRect.Offset(pnlDrawingArea.PointToScreen(Point.Empty));
00614                 ControlPaint.DrawReversibleFrame(screenRect,Color.Transparent,FrameStyle.Dashed);
00615             }
00616         }
00617
00618         /// <summary>
00619         /// Event Handle from MouseUp Event
00620         /// </summary>
00621         /// <param name="sender">The control that raised the event.</param>
00622         /// <param name="e">The event arguments.</param>
00623         private void pnlDrawingArea_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
00624         {
00625             // If the user has selected to draw a zoom rectangle...
00626             if (miZoomToRect.Checked)
00627             {
00628                 // Erase the zoom rectangle
00629                 Rectangle screenRect = zoomRectangle;
00630                 screenRect.Offset(pnlDrawingArea.PointToScreen(Point.Empty));
00631                 ControlPaint.DrawReversibleFrame(screenRect,Color.Transparent,FrameStyle.Dashed);
00632
00633                 // Perform the zoom
00634                 ZoomToRectangle();
00635             }
00636         }
00637
00638         /// <summary>
00639         /// Helper method to update the ink collector with the current
00640         /// zoom and scroll values
00641         /// </summary>
00642         private void UpdateZoomAndScroll()
00643         {
00644             // Create a new transformation matrix
00645             Matrix m = new Matrix();
00646
00647             // Apply the current scale factor
00648             m.Scale(zoomFactor,zoomFactor);
00649
00650             // Apply the current translation factor - note that since
00651             // the scroll bars map directly to ink space, their values
00652             // can be used directly.
00653             m.Translate(-hScrollBar.Value, -vScrollBar.Value);
00654
00655             // Renderer's view and object transforms are used to perform
00656             // zooming and scrolling.  The view transform applies to the
00657             // points and pen width.  The object transform  applies
00658             // only to the points.  Depending on whether the user has
00659             // selected to apply the transform to pen width, update the
00660             // view or object transform.
00661             if (miScalePenWidth.Checked)
00662             {
00663                 myInkCollector.Renderer.SetViewTransform(m);
00664             }
00665             else
00666             {
00667                 myInkCollector.Renderer.SetObjectTransform(m);
00668             }
00669
00670             // Set the scroll bars to map to the current zoom level
00671             UpdateScrollBars();
00672
00673             Refresh();
00674         }
00675
00676         /// <summary>
00677         /// Helper method to update the scroll bars small and large change
00678         /// values to the new zoom level.  If the scroll bars are no longer
00679         /// needed, this method will also hide them.
00680         /// </summary>
00681         void UpdateScrollBars()
00682         {
00683             if ( (hScrollBar.Width>0) && (vScrollBar.Height>0))
00684             {
00685                 // The following code sets the small and large change
00686                 // values of the scroll bars.  These values specify
00687                 // desired scroll size when the scroll box is moved a
00688                 // small/large distance.  In this sample, the large
00689                 // change scrolls by the width of the visible drawing
00690                 // area and the small change scrolls by the constant
00691                 // SmallChangeSize.  Note that it is necessary to account
00692                 // for the zoom factor when calculating the large and
00693                 // small change values.  Also, since the scroll bar
00694                 // uses ink space units, it is necessary to calculate
00695                 // the small and large change values in ink space.
00696                 //
00697                 // In summary:
00698                 // 1.  Calculate the large change value as the width
00699                 //     of the visible drawing area in ink space units.
00700                 // 2.  Calculate the small change value as the
00701                 //     SmallChangeSize in ink space units.
00702
00703
00704                 // Create a point representing the top left of the drawing area (in pixels)
00705                 Point ptUpperLeft = new Point(0, 0);
00706
00707                 // Create a point representing the size of a small change
00708                 Point ptSmallChange = new Point(SmallChangeSize, SmallChangeSize);
00709
00710                 // Create a point representing the bottom right of the drawing area (in pixels)
00711                 Point ptLowerRight = new Point(hScrollBar.Width, vScrollBar.Height);
00712
00713                 // Convert each of the points to ink space
00714                 myInkCollector.Renderer.PixelToInkSpace(Handle, ref ptUpperLeft);
00715                 myInkCollector.Renderer.PixelToInkSpace(Handle, ref ptLowerRight);
00716                 myInkCollector.Renderer.PixelToInkSpace(Handle, ref ptSmallChange);
00717
00718                 // Set the SmallChange values (in ink space)
00719                 // Note that it is necessary to subract the upper left point
00720                 // value to account for scrolling.
00721                 hScrollBar.SmallChange = ptSmallChange.X - ptUpperLeft.X;
00722                 vScrollBar.SmallChange = ptSmallChange.Y - ptUpperLeft.Y;
00723
00724                 // Set the LargeChange values to the drawing area width (in ink space)
00725                 // Note that it is necessary to subract the upper left point
00726                 // value to account for scrolling.
00727                 hScrollBar.LargeChange = ptLowerRight.X - ptUpperLeft.X;
00728                 vScrollBar.LargeChange = ptLowerRight.Y - ptUpperLeft.Y;
00729
00730                 // If the scroll bars are not needed, hide them
00731                 hScrollBar.Visible = hScrollBar.LargeChange < hScrollBar.Maximum;
00732                 vScrollBar.Visible = vScrollBar.LargeChange < vScrollBar.Maximum;
00733
00734                 // If the horizontal scroll bar value would run off of the drawing area,
00735                 // adjust it
00736                 if(hScrollBar.Visible && (hScrollBar.Value + hScrollBar.LargeChange > hScrollBar.Maximum))
00737                 {
00738                     hScrollBar.Value = hScrollBar.Maximum - hScrollBar.LargeChange;
00739                 }
00740
00741                 // If the vertical scroll bar value would run off of the drawing area,
00742                 // adjust it
00743                 if(vScrollBar.Visible && (vScrollBar.Value + vScrollBar.LargeChange > vScrollBar.Maximum))
00744                 {
00745                     vScrollBar.Value = vScrollBar.Maximum - vScrollBar.LargeChange;
00746                 }
00747             }
00748         }
00749
00750         /// <summary>
00751         /// Helper method to zoom into a specified rectangle.
00752         /// </summary>
00753         public void ZoomToRectangle()
00754         {
00755
00756             // Calculate the width/height of the zoom rectangle
00757             int newWidth = Math.Abs(zoomRectangle.Width);
00758             int newHeight = Math.Abs(zoomRectangle.Height);
00759
00760             // Check to ensure that the zoom rectangle isn't just a point...
00761             if (newWidth>0 && newHeight>0)
00762             {
00763
00764                 // To determine the new scale factor, take the ratio of the
00765                 // scaled drawing area to the size of the zoom rectangle.
00766                 // Since the ratio of the width could be different than
00767                 // the ratio of the height, the minimum scale value is used.
00768                 float newZoomFactor = Math.Min((zoomFactor*pnlDrawingArea.Width)/newWidth,
00769                                           (zoomFactor*pnlDrawingArea.Height)/newHeight);
00770
00771                 // Check whether the zoom rectangle would exceed the allowable
00772                 // zoom level.  If so, display an error.
00773                 if ((int)(newZoomFactor*100) < zoomUpDown.Minimum)
00774                 {
00775                     MessageBox.Show("Minimum zoom level reached.");
00776                 }
00777                 else if ((int)(newZoomFactor*100) > zoomUpDown.Maximum)
00778                 {
00779                     MessageBox.Show("Maximum zoom level reached.");
00780                 }
00781                 else
00782                 {
00783
00784                     // Set the scroll bar values to the zoom rectangle's top left corner
00785                     // Note that it is necessary to convert to ink space since the scroll
00786                     // bars use ink space coordinates.
00787                     Point scrollValue = new Point();
00788                     scrollValue.X = Math.Min(zoomRectangle.Left,zoomRectangle.Left + zoomRectangle.Width);
00789                     scrollValue.Y = Math.Min(zoomRectangle.Top,zoomRectangle.Top + zoomRectangle.Height);
00790                     myInkCollector.Renderer.PixelToInkSpace(Handle,ref scrollValue);
00791
00792                     // If the new scroll bar values would fall outside of the
00793                     // allowable range, adjust them to the nearest allowable
00794                     // value.
00795                     if (scrollValue.X > hScrollBar.Maximum)
00796                     {
00797                         scrollValue.X = hScrollBar.Maximum;
00798                     }
00799                     else if (scrollValue.X < hScrollBar.Minimum)
00800                     {
00801                         scrollValue.X = hScrollBar.Minimum;
00802                     }
00803
00804                     if (scrollValue.Y > vScrollBar.Maximum)
00805                     {
00806                         scrollValue.Y = vScrollBar.Maximum;
00807                     }
00808                     else if (scrollValue.Y < vScrollBar.Minimum)
00809                     {
00810                         scrollValue.Y = vScrollBar.Minimum;
00811                     }
00812
00813
00814                     // Update the new scale factor to the ratio of the scroll bar
00815                     // to the zoom rectangle's width
00816                     zoomFactor = newZoomFactor;
00817                     zoomUpDown.Value = (decimal)zoomFactor*100;
00818
00819                     // Apply the new zoom/scroll settings
00820                     UpdateZoomAndScroll();
00821
00822                     // Update the scroll bar values.
00823                     hScrollBar.Value = scrollValue.X;
00824                     vScrollBar.Value = scrollValue.Y;
00825
00826                 }
00827             }
00828
00829             // Reset the zoom rectangle
00830             zoomRectangle = Rectangle.Empty;
00831
00832             Refresh();
00833         }
00834   }
00835 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Formdump/formdump.cpp Source File

  • Web
  • iis
  • extensions
  • Formdump

formdump.cpp

Go to the documentation of this file.
00001 //  Copyright (c) 1997  Microsoft Corporation
00002 //
00003 //  Module Name:
00004 //
00005 //    formdump.cpp
00006 //
00007 //  Abstract:
00008 //
00009 //    ISAPI Extension sample illustrating how to obtain data from a web browser
00010 //    and how to build a reply to the form.
00011
00012 #define WIN32_LEAN_AND_MEAN     // the bare essential Win32 API
00013 #include <windows.h>
00014 #include <ctype.h>              // for isprint()
00015 #include <httpext.h>
00016
00017 #include "keys.h"
00018 #include "html.h"
00019
00020 #define MAX_BUFFER 4096
00021
00022 // local prototypes
00023
00024 void SendVariables(EXTENSION_CONTROL_BLOCK *pECB);
00025 void HexDumper(EXTENSION_CONTROL_BLOCK *pECB, LPBYTE lpbyBuf, DWORD dwLength);
00026 void WhoAmI(EXTENSION_CONTROL_BLOCK *pECB);
00027 BOOL SendHttpHeaders(EXTENSION_CONTROL_BLOCK *, LPCSTR, LPCSTR);
00028
00029 //  Description:
00030 //
00031 //    This is required ISAPI Extension DLL entry point.
00032 //
00033 //  Arguments:
00034 //
00035 //    pVer - poins to extension version info structure
00036 //
00037 //  Returns:
00038 //
00039 //    Always returns TRUE
00040
00041 BOOL WINAPI GetExtensionVersion(OUT HSE_VERSION_INFO *pVer)
00042 {
00043   // set version to httpext.h version constants
00044
00045   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00046
00047   lstrcpyn((LPSTR) pVer->lpszExtensionDesc, "FORMDUMP - A Form Decoder and Dumper", HSE_MAX_EXT_DLL_NAME_LEN);
00048
00049   return TRUE;
00050 }
00051
00052 //  Description:
00053 //
00054 //    Pull in all inbound data.  Build a reply page
00055 //    so the user can see how forms appear in our key list.
00056 //
00057 //  Arguments:
00058 //
00059 //    pECB - pointer to the extenstion control block
00060 //
00061 //  Returns:
00062 //
00063 //    HSE_STATUS_SUCCESS on successful completion
00064 //    HSE_STATUS_ERROR on failure
00065
00066 DWORD WINAPI HttpExtensionProc(IN EXTENSION_CONTROL_BLOCK *pECB)
00067 {
00068   // Get the keys sent by the client
00069
00070   HKEYLIST hKeyList = GetKeyList(pECB);
00071
00072   // Send HTTP headers
00073
00074   SendHttpHeaders(pECB, "200 OK", "Content-type: text/html\r\n\r\n");
00075
00076   // Create a basic HTML page
00077
00078   HtmlCreatePage(pECB, "FormDump.dll Reply");
00079   HtmlHeading(pECB, 1, "Data Available via ISAPI");
00080   HtmlHorizontalRule(pECB);
00081
00082   // Send each form field
00083
00084   HtmlHeading(pECB, 2, "Form Fields");
00085
00086   if (!hKeyList) {
00087
00088     // Report no data/error
00089
00090     HtmlBold(pECB, "No form fields sent");
00091     HtmlWriteText(pECB, " (or error decoding keys)");
00092     HtmlEndParagraph(pECB);
00093
00094   } else {
00095
00096     // Print a quick overview
00097
00098     HtmlWriteTextLine(pECB, "The form you submitted data to just called");
00099     HtmlWriteTextLine(pECB, "the Internet Information Server extension");
00100     HtmlWriteTextLine(pECB, "FormDump.dll.  Here is a listing of what was");
00101     HtmlWriteTextLine(pECB, "received and what variables inside FormDump");
00102     HtmlWriteTextLine(pECB, "have the data.");
00103     HtmlEndParagraph(pECB);
00104
00105     // Loop through all of the keys
00106
00107     HKEYLIST hKey = hKeyList;
00108
00109     while (hKey) {
00110
00111       // Details about the key
00112
00113       LPCTSTR lpszKeyName;
00114       DWORD dwLength;
00115       BOOL bHasCtrlChars;
00116       int nInstance;
00117
00118       // We get info, and hKey points to next key in list
00119
00120       HKEYLIST hLastKey = hKey;    // keep this for later
00121
00122       hKey = GetKeyInfo(hKey, &lpszKeyName, &dwLength, &bHasCtrlChars, &nInstance);
00123
00124       // Build web page
00125
00126       HtmlBold(pECB, "Form Field Name (lpszKeyName): ");
00127       HtmlWriteText(pECB, lpszKeyName);
00128       HtmlLineBreak(pECB);
00129
00130       char szMsg[32];
00131
00132       HtmlBold(pECB, "Length of Data (dwLength): ");
00133       wsprintf(szMsg, "%u", dwLength);
00134       HtmlWriteText(pECB, szMsg);
00135       HtmlLineBreak(pECB);
00136
00137       HtmlBold(pECB, "Data Has Control Characters (bHasCtrlChars): ");
00138       wsprintf(szMsg, "%u", bHasCtrlChars);
00139       HtmlWriteText(pECB, szMsg);
00140       HtmlLineBreak(pECB);
00141
00142       HtmlBold(pECB, "Instance of Form Field (nInstance): ");
00143       wsprintf(szMsg, "%u", nInstance);
00144       HtmlWriteText(pECB, szMsg);
00145
00146       if (dwLength) {
00147
00148         HtmlLineBreak(pECB);
00149         HtmlBold(pECB, "Data Sent for Field:");
00150         HtmlLineBreak(pECB);
00151
00152         HexDumper(pECB, GetKeyBuffer(hLastKey), dwLength);
00153       }
00154
00155       HtmlEndParagraph(pECB);
00156     }
00157
00158     // Clean up
00159
00160     FreeKeyList(hKeyList);
00161   }
00162
00163   HtmlHorizontalRule(pECB);
00164
00165   // Get user name from SID and return it in the page
00166
00167   HtmlHeading(pECB, 2, "Security Context for HttpExtensionProc Thread");
00168   WhoAmI(pECB);
00169   HtmlHorizontalRule(pECB);
00170
00171   // Display all server variables
00172
00173   HtmlHeading(pECB, 2, "Server Variables");
00174   HtmlWriteTextLine(pECB, "Below is a list of all variables available via");
00175   HtmlWriteTextLine(pECB, "GetServerVariable ISAPI API.  Much of this");
00176   HtmlWriteTextLine(pECB, "information comes from the browser HTTP header.");
00177   HtmlEndParagraph(pECB);
00178
00179   // Send server variables obtained from the HTTP header
00180
00181   SendVariables(pECB);
00182
00183   // Finish up...
00184
00185   HtmlEndPage(pECB);
00186
00187   return HSE_STATUS_SUCCESS;
00188 }
00189
00190 //  Description:
00191 //
00192 //    This is optional ISAPI extension DLL entry point. If present, it will be
00193 //    called before unloading the DLL, giving it a chance to perform any
00194 //    shutdown procedures.
00195 //
00196 //  Arguments:
00197 //
00198 //    dwFlags - specifies whether the DLL can refuse to unload or not
00199 //
00200 //  Returns:
00201 //
00202 //    TRUE, if the DLL can be unloaded
00203
00204 BOOL WINAPI TerminateExtension(DWORD dwFlags)
00205 {
00206   return TRUE;
00207 }
00208
00209 //  Description:
00210 //
00211 //    Put the inbound data in a hex dump format
00212 //
00213 //  Arguments:
00214 //
00215 //    pECB - points to the extension control block
00216 //    lpbyByf - bytes to dump
00217 //    dwLength - specifies the number of bytes to dump
00218
00219 void HexDumper(IN EXTENSION_CONTROL_BLOCK *pECB, IN LPBYTE lpbyBuf, IN DWORD dwLength)
00220 {
00221   DWORD dwPos = 0;
00222
00223   HtmlBeginPreformattedText(pECB);
00224
00225   while (dwLength) {
00226
00227     // Take min of 16 or dwLength
00228
00229     DWORD dwSize = min(16, dwLength );
00230
00231     // Build text line
00232
00233     char szLine[80];
00234
00235     wsprintf(szLine, "  %04X ", dwPos);
00236
00237     for (DWORD i = 0; i < dwSize; i++) {
00238
00239       char szHex[3];
00240
00241       wsprintf(szHex, "%02X", lpbyBuf[i]);
00242
00243       lstrcat(szLine, szHex);
00244       lstrcat(szLine, " " );
00245     }
00246
00247     // Add spaces for short lines
00248
00249     for (DWORD i = strlen(szLine); i < 16; i++)
00250       lstrcat(szLine, "   ");
00251
00252     // Add ASCII chars
00253
00254     for (i = 0; i < dwSize; i++) {
00255
00256       if (isprint(lpbyBuf[i])) {
00257
00258         char szHex[3];
00259
00260         wsprintf(szHex, "%c", lpbyBuf[i]);
00261
00262         lstrcat(szLine, szHex );
00263
00264       } else {
00265
00266         lstrcat(szLine, "." );
00267       }
00268     }
00269
00270     // Write data to web page
00271
00272     HtmlWriteTextLine(pECB, szLine);
00273
00274     // Advance positions
00275
00276     dwLength -= dwSize;
00277     dwPos += dwSize;
00278     lpbyBuf += dwSize;
00279   }
00280
00281   HtmlEndPreformattedText(pECB);
00282 }
00283
00284 //  Description:
00285 //
00286 //    Dump a server variable
00287 //
00288 //  Arguments:
00289 //
00290 //    pECB - points to the extension control block
00291 //    lpbyByf - points to ASCIIZ name of the server variable to dump
00292
00293 void DumpVariable(IN EXTENSION_CONTROL_BLOCK *pECB, IN LPCTSTR szName)
00294 {
00295   char szBuffer[MAX_BUFFER];
00296
00297   DWORD dwBufferSize = sizeof szBuffer;
00298
00299   if (dwBufferSize > MAX_BUFFER)
00300     return;
00301
00302   BOOL bReturn = pECB->GetServerVariable(pECB->ConnID, (LPSTR)szName, szBuffer, &dwBufferSize);
00303
00304   if (!bReturn || !szBuffer[0])
00305     return;
00306
00307   HtmlWriteText(pECB, szName);
00308   HtmlWriteText(pECB, "=");
00309   HtmlWriteText(pECB, szBuffer);
00310   HtmlLineBreak(pECB);
00311 }
00312
00313 //  Description:
00314 //
00315 //    Send specified HTTP status string and any additional header strings
00316 //    using new ServerSupportFunction() request HSE_SEND_HEADER_EX_INFO
00317 //
00318 //  Arguments:
00319 //
00320 //    pECB - pointer to the extension control block
00321 //    pszStatus - HTTP status string (e.g. "200 OK")
00322 //    pszHeaders - any additional headers, separated by CRLFs and
00323 //                  terminated by empty line
00324 //
00325 //  Returns:
00326 //
00327 //    TRUE if headers were successfully sent
00328 //    FALSE otherwise
00329
00330 BOOL SendHttpHeaders(EXTENSION_CONTROL_BLOCK *pECB, LPCSTR pszStatus, LPCSTR pszHeaders)
00331 {
00332   HSE_SEND_HEADER_EX_INFO header_ex_info;
00333
00334   header_ex_info.pszStatus = pszStatus;
00335   header_ex_info.pszHeader = pszHeaders;
00336   header_ex_info.cchStatus = strlen(pszStatus);
00337   header_ex_info.cchHeader = strlen(pszHeaders);
00338   header_ex_info.fKeepConn = FALSE;
00339
00340   return pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_ex_info, NULL, NULL);
00341 }
00342
00343 //  Description:
00344 //
00345 //    Send all server variables (they came in the HTTP header)
00346 //
00347 //  Arguments:
00348 //
00349 //    pECB - pointer to the extension control block
00350
00351 void SendVariables(IN EXTENSION_CONTROL_BLOCK * pECB)
00352 {
00353   char szBuffer[4096];
00354
00355   // Dump the standard variables
00356
00357   DumpVariable(pECB, "AUTH_TYPE");
00358   DumpVariable(pECB, "CONTENT_LENGTH");
00359   DumpVariable(pECB, "CONTENT_TYPE");
00360   DumpVariable(pECB, "GATEWAY_INTERFACE");
00361   DumpVariable(pECB, "PATH_INFO");
00362   DumpVariable(pECB, "PATH_TRANSLATED");
00363   DumpVariable(pECB, "QUERY_STRING");
00364   DumpVariable(pECB, "REMOTE_ADDR");
00365   DumpVariable(pECB, "REMOTE_HOST");
00366   DumpVariable(pECB, "REMOTE_USER");
00367   DumpVariable(pECB, "REQUEST_METHOD");
00368   DumpVariable(pECB, "SCRIPT_NAME");
00369   DumpVariable(pECB, "SERVER_NAME");
00370   DumpVariable(pECB, "SERVER_PORT");
00371   DumpVariable(pECB, "SERVER_PROTOCOL");
00372   DumpVariable(pECB, "SERVER_SOFTWARE");
00373   DumpVariable(pECB, "AUTH_PASS");
00374
00375   // Dump any others (in ALL_HTTP)
00376
00377   DWORD dwBufferSize = sizeof szBuffer;
00378
00379   BOOL bReturn = pECB->GetServerVariable(pECB->ConnID, "ALL_HTTP", szBuffer, &dwBufferSize);
00380
00381   if (bReturn) {
00382
00383     //
00384     // Find lines, split key/data pair and write them as output
00385     //
00386
00387     char *pChar = szBuffer;
00388
00389     while (*pChar) {
00390
00391       if (*pChar == '\r' || *pChar == '\n') {
00392
00393         pChar++;
00394
00395         continue;
00396       }
00397
00398       char *pOpts = strchr(pChar, ':');   // look for separator
00399
00400       if (!pOpts)
00401           break;
00402
00403       if (!*pOpts)
00404           break;
00405
00406       char *pEnd = pOpts;
00407
00408       while (*pEnd && *pEnd != '\r' && *pEnd != '\n')
00409         pEnd++;
00410
00411       *pOpts = 0;         // split strings
00412
00413       *pEnd = 0;
00414
00415       // pChar points to variable name, pOpts + 1 points to variable val
00416
00417       HtmlWriteText(pECB, pChar);
00418       HtmlWriteText(pECB, "=");
00419       HtmlWriteText(pECB, pOpts + 1);
00420       HtmlLineBreak(pECB);
00421
00422       pChar = pEnd + 1;
00423     }
00424   }
00425
00426   HtmlEndParagraph(pECB);
00427   HtmlHorizontalRule(pECB);
00428 }
00429
00430 //  Description:
00431 //
00432 //    Get the user SID, lookup the account name and display it
00433 //
00434 //  Arguments:
00435 //
00436 //    pECB - pointer to the extension control block
00437
00438 void WhoAmI(IN EXTENSION_CONTROL_BLOCK *pECB)
00439 {
00440   HANDLE hToken;
00441   BYTE byBuf[1024];
00442   DWORD dwLen;
00443
00444   SID_NAME_USE eUse;
00445
00446   if (!OpenThreadToken(GetCurrentThread( ), TOKEN_QUERY, TRUE, &hToken)) {
00447
00448     DWORD dwError = GetLastError();
00449
00450     HtmlBold(pECB, "OpenThreadToken failed. ");
00451     HtmlPrintf(pECB, "Error code=%u", dwError);
00452     HtmlEndParagraph(pECB);
00453
00454     return;
00455   }
00456
00457   PTOKEN_USER pTokenUser = (PTOKEN_USER)byBuf;
00458
00459   if (!GetTokenInformation(hToken, TokenUser, pTokenUser, sizeof byBuf, &dwLen)) {
00460
00461     DWORD dwError = GetLastError();
00462
00463     CloseHandle(hToken);
00464
00465     HtmlBold(pECB, "GetTokenInformation failed. ");
00466     HtmlPrintf(pECB, "Error code=%u dwLen=%u", dwError, dwLen);
00467     HtmlEndParagraph(pECB);
00468
00469     return;
00470   }
00471
00472   char szName[256], szDomain[256];
00473
00474   DWORD dwNameLen = sizeof szName;
00475   DWORD dwDomainLen = sizeof szDomain;
00476
00477   if (!LookupAccountSid(NULL, pTokenUser->User.Sid, szName, &dwNameLen, szDomain, &dwDomainLen, &eUse)) {
00478
00479     DWORD dwError = GetLastError();
00480
00481     CloseHandle(hToken);
00482
00483     HtmlBold(pECB, "LookupAccountSid failed. ");
00484     HtmlPrintf(pECB, "Error code=%u dwNameLen=%u dwDomainLen=%u", dwError, dwNameLen, dwDomainLen);
00485     HtmlEndParagraph(pECB);
00486
00487     return;
00488   }
00489
00490   HtmlBold(pECB, "Domain: ");
00491   HtmlWriteText(pECB, szDomain);
00492   HtmlLineBreak(pECB);
00493   HtmlBold(pECB, "User: ");
00494   HtmlWriteText(pECB, szName);
00495   HtmlEndParagraph(pECB);
00496
00497   CloseHandle( hToken );
00498 }
00499
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/JavaClient/FullSvr/IFullServ.java Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • JavaClient
  • FullSvr

IFullServ.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc958.tmp" /nologo /d "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\JavaClient" "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\FullSvr\Debug\FullSvr.exe")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package fullsvr;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface IFullServ
00019 /** @com.interface(iid=D3140112-D43F-4718-9119-EF62D631F2AB, thread=AUTO) */
00020 public interface IFullServ extends IUnknown
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([in,type=I4] i, [in,type=I4] j, [type=I4] return) */
00024   public int Sum(int i, int j);
00025
00026
00027   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xd3140112, (short)0xd43f, (short)0x4718, (byte)0x91, (byte)0x19, (byte)0xef, (byte)0x62, (byte)0xd6, (byte)0x31, (byte)0xf2, (byte)0xab);
00028 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/CAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

CAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CAR.H
00003
00004   Summary:   Include file for the aggregatable COCar COM object class.
00005
00006              COCar offers a main IUnknown interface and the ICar
00007              interface (Car-related features).  This multiple interface
00008              COM Object Class is achieved via the technique of nested
00009              classes.  The implementation of the ICar interface is
00010              nested inside of the COCar Class.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial DLLSERVE.HTM file.
00014              For more specific technical details on the internal workings
00015              see the comments dispersed throughout the module's source code.
00016
00017   Classes:   COCar.
00018
00019   Functions:
00020
00021   Origin:    9-11-95: atrent - Editor-inheritance from CAR.H in
00022                the COMOBJ Tutorial Code Sample.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 #if !defined(CAR_H)
00040 #define CAR_H
00041
00042 #ifdef __cplusplus
00043
00044 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00045   ObjectClass: COCar
00046
00047   Summary:     COM object class for COCar COM objects.  COM objects of
00048                this class offer ICar interface features (Shift, Clutch,
00049                Speed, and Steer).  The mulitple interfaces on this COM
00050                object are constructed via the nested interface classes
00051                technique.
00052
00053   Interfaces:  IUnknown
00054                  Standard interface providing COM object features.
00055                ICar
00056                  Basic Car operation features.
00057
00058   Aggregation: Yes, COCar COM Objects are aggregatable by passing
00059                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00060 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00061 class COCar : public IUnknown
00062 {
00063   public:
00064     // Main Object Constructor & Destructor.
00065     COCar(IUnknown* pUnkOuter, CServer* pServer);
00066     ~COCar(void);
00067
00068     // IUnknown methods. Main object, non-delegating.
00069     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00070     STDMETHODIMP_(ULONG) AddRef(void);
00071     STDMETHODIMP_(ULONG) Release(void);
00072
00073   private:
00074     // We declare nested class interface implementations here.
00075
00076     class CImpICar : public ICar
00077     {
00078       public:
00079         // Interface Implementation Constructor & Destructor.
00080         CImpICar(COCar* pBackObj, IUnknown* pUnkOuter);
00081         ~CImpICar(void);
00082
00083         // IUnknown methods.
00084         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00085         STDMETHODIMP_(ULONG) AddRef(void);
00086         STDMETHODIMP_(ULONG) Release(void);
00087
00088         // ICar methods.
00089         STDMETHODIMP Shift(short nGear);
00090         STDMETHODIMP Clutch(short nEngaged);
00091         STDMETHODIMP Speed(short nMph);
00092         STDMETHODIMP Steer(short nAngle);
00093
00094       private:
00095         // Data private to this COCar interface implementation of ICar.
00096         ULONG        m_cRefI;        // Interface Ref Count (for debugging).
00097         COCar*       m_pBackObj;     // Parent Object back pointer.
00098         IUnknown*    m_pUnkOuter;    // Outer unknown for Delegation.
00099     };
00100
00101     // Make the otherwise private and nested ICar interface implementation
00102     // a friend to COM object instantiations of this selfsame COCar
00103     // COM object class.
00104     friend CImpICar;
00105
00106     // Private data of COCar COM objects.
00107
00108     // Nested ICar implementation instantiation.  This ICar interface
00109     // is instantiated inside this COCar object as a native interface.
00110     CImpICar         m_ImpICar;
00111
00112     // Main Object reference count.
00113     ULONG            m_cRefs;
00114
00115     // Outer unknown (aggregation & delegation).
00116     IUnknown*        m_pUnkOuter;
00117
00118     // Pointer to this component server's control object.
00119     CServer*         m_pServer;
00120 };
00121
00122 typedef COCar* PCOCar;
00123
00124 #endif // __cplusplus
00125
00126
00127 #endif // CAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreClien/FreClien.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • FreClien

FreClien.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FRECLIEN.CPP
00003
00004   Summary:   Based largely on the DLLCLIEN.EXE application code, this
00005              module is meant to use use muitiple threads in the client to
00006              load and access a free threaded COM component in a separate
00007              in-process COM Server (FRESERVE built in the sibling FRESERVE
00008              directory).  Thus to run FRECLIEN you must build FRESERVE
00009              first. This client application is meant to exercise the
00010              FRESERVE in-process server using multiple client threads.
00011              Three such worker threads are created to function the
00012              principal COM object in the FRESERVE server. This object is
00013              a COBall object which maintains logic and data to simulate a
00014              ball bouncing inside of an enclosed 2-dimensional area. The
00015              worker threads all continuously attempt to move this virtual
00016              ball.
00017
00018              In this client application the main process thread also
00019              asynchronously queries the ball for its display data and
00020              renders this data into a moving GUI image on the screen.
00021              There is no GUI behavior in the server--it is all in this
00022              client.  This client instantiates one instance of the
00023              server's COBall COM object and exercises it with multiple
00024              threads. There is a minimal menu in FRECLIEN. All the action
00025              is automatic. The main application window's client area is
00026              used for visual display of the moving ball.
00027
00028              For a comprehensive tutorial code tour of FRECLIEN's contents
00029              and offerings see the tutorial FRECLIEN.HTM file. For
00030              more specific technical details on the internal workings see
00031              the comments dispersed throughout the FRECLIEN source code.
00032              For more details on the FRESERVE.DLL that FRECLIEN works with
00033              see the FRESERVE.HTM file in the main tutorial directory.
00034
00035   Classes:   CMainWindow
00036
00037   Functions: InitApplication, WinMain
00038
00039   Origin:    4-6-96: atrent - Editor-inheritance from the DLLCLIEN source.
00040              Also borrows from the GDIDEMO sample in the Win32 samples of
00041              the Win32 SDK.
00042
00043 ----------------------------------------------------------------------------
00044   This file is part of the Microsoft COM Tutorial Code Samples.
00045
00046   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00047
00048   This source code is intended only as a supplement to Microsoft
00049   Development Tools and/or on-line documentation.  See these other
00050   materials for detailed information regarding Microsoft code samples.
00051
00052   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00053   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00054   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00055   PARTICULAR PURPOSE.
00056 ==========================================================================+*/
00057
00058 /*--------------------------------------------------------------------------
00059   We include WINDOWS.H for all Win32 applications.
00060   We include OLE2.H because we will be calling the COM/OLE Libraries.
00061   We include INITGUID.H only once (here) in the entire app because we
00062     will be defining GUIDs and want them as constants in the data segment.
00063   We include COMMDLG.H because we will be using the Open File and
00064     potentially other Common dialogs.
00065   We include APPUTIL.H because we will be building this application using
00066     the convenient Virtual Window and Dialog classes and other
00067     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00068   We include IBALL.H and BALLGUID.H for the common Ball-related Interface
00069     class, GUID, and CLSID specifications.
00070   We include FRECLIEN.H because it has class and resource definitions
00071     specific to this FRECLIEN application.
00072   We include GUIBALL.H because it has the C++ class used for GUI display
00073     of the moving ball.
00074 ---------------------------------------------------------------------------*/
00075 #include <windows.h>
00076 #include <ole2.h>
00077 #include <initguid.h>
00078 #include <commdlg.h>
00079 #include <apputil.h>
00080 #include <iball.h>
00081 #include <ballguid.h>
00082 #include "guiball.h"
00083 #include "freclien.h"
00084
00085
00086 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00087   Method:   CMainWindow::CMainWindow
00088
00089   Summary:  CMainWindow Constructor.
00090
00091   Args:     .
00092
00093   Modifies: .
00094
00095   Returns:  .
00096 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00097 CMainWindow::CMainWindow()
00098 {
00099   // Ensure these member variable strings are null strings.
00100   m_szFileName[0] = 0;
00101   m_szFileTitle[0] = 0;
00102
00103   // Fill in the Open File Name Common Dialog's OPENFILENAME structure.
00104   m_ofnFile.lStructSize = sizeof(OPENFILENAME);
00105   m_ofnFile.hwndOwner = m_hWnd;
00106   m_ofnFile.hInstance = m_hInst;
00107   m_ofnFile.lpstrFilter = TEXT(OFN_DEFAULTFILES_STR);
00108   m_ofnFile.lpstrCustomFilter = NULL;
00109   m_ofnFile.nMaxCustFilter = 0;
00110   m_ofnFile.nFilterIndex = 1;
00111   m_ofnFile.lpstrFile = m_szFileName;
00112   m_ofnFile.nMaxFile = MAX_PATH;
00113   m_ofnFile.lpstrInitialDir = TEXT(".");
00114   m_ofnFile.lpstrFileTitle = m_szFileTitle;
00115   m_ofnFile.nMaxFileTitle = MAX_PATH;
00116   m_ofnFile.lpstrTitle = TEXT(OFN_DEFAULTTITLE_STR);
00117   m_ofnFile.lpstrDefExt = NULL;
00118   m_ofnFile.Flags = OFN_HIDEREADONLY;
00119
00120   m_pMsgBox  = NULL;
00121   m_pGuiBall = NULL;
00122 }
00123
00124
00125 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00126   Method:   CMainWindow::~CMainWindow
00127
00128   Summary:  CMainWindow Destructor.  Destruction of the main window
00129             indicates that the application should quit and thus the
00130             PostQuitMessage API is called.
00131
00132   Args:     .
00133
00134   Modifies: .
00135
00136   Returns:  .
00137 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00138 CMainWindow::~CMainWindow()
00139 {
00140   // CMainWindow is derived from CVirWindow which traps the WM_DESTROY
00141   // message and causes a delete of CMainWindow which in turn causes this
00142   // destructor to run. The WM_DESTROY results when the window is destoyed
00143   // after a close of the window. Prior to exiting the main message loop:
00144
00145   // We delete the CGuiBall and CMsgBox objects that were made in
00146   // Initinstance.
00147   DELETE_POINTER(m_pGuiBall);
00148   DELETE_POINTER(m_pMsgBox);
00149
00150   // We then post a WM_QUIT message to cause an exit of the main thread's
00151   // message loop and an exit of this instance of the application.
00152   PostQuitMessage(0);
00153 }
00154
00155
00156 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00157   Method:   CMainWindow::InitInstance
00158
00159   Summary:  Instantiates an instance of the main application window.
00160             This method must be called only once, immediately after
00161             window class construction.  We take care to delete 'this'
00162             CMainWindow if we must return the error condition FALSE.
00163
00164   Args:     HINSTANCE hInstance,
00165               Handle of the application instance.
00166             int nCmdShow)
00167               Command to pass to ShowWindow.
00168
00169   Modifies: m_szHelpFile, m_pMsgBox.
00170
00171   Returns:  BOOL.
00172               TRUE if succeeded.
00173               FALSE if failed.
00174 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00175 BOOL CMainWindow::InitInstance(
00176        HINSTANCE hInstance,
00177        int nCmdShow)
00178 {
00179   BOOL bOk = FALSE;
00180   HWND hWnd = NULL;
00181
00182   // Create the Message Box and Message Log objects.
00183   m_pMsgBox = new CMsgBox;
00184
00185   // Create the CGuiBall object.
00186   m_pGuiBall = new CGuiBall;
00187
00188   if (NULL != m_pMsgBox && NULL != m_pGuiBall)
00189   {
00190     // Note, the Create method sets the m_hWnd member so we don't
00191     // need to set it explicitly here first. Here is the create of this
00192     // window.  Size the window reasonably. Create sets both m_hInst and
00193     // m_hWnd. This creates the main client window.
00194     hWnd = Create(
00195              TEXT(MAIN_WINDOW_CLASS_NAME_STR),
00196              TEXT(MAIN_WINDOW_TITLE_STR),
00197              WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
00198                | WS_MAXIMIZEBOX | WS_THICKFRAME,
00199              CW_USEDEFAULT,
00200              CW_USEDEFAULT,
00201              ::GetSystemMetrics(SM_CXSCREEN)*2/5,
00202              ::GetSystemMetrics(SM_CYSCREEN)*2/5,
00203              NULL,
00204              NULL,
00205              hInstance);
00206     if (NULL != hWnd)
00207     {
00208       // Init the new GuiBall.
00209       bOk = m_pGuiBall->Init(m_hWnd);
00210       if (bOk)
00211       {
00212         // Ensure the new window is shown on screen and content
00213         // is painted.
00214         ::ShowWindow(m_hWnd, nCmdShow);
00215         ::UpdateWindow(m_hWnd);
00216
00217         // Build a path to where the help file should be (it should be in
00218         // the same directory as the .EXE but with the .HTM extension.
00219         MakeFamilyPath(hInstance, m_szHelpFile, TEXT(HELP_FILE_EXT));
00220
00221         // Init the Message Box object.
00222         bOk = m_pMsgBox->Init(m_hInst, m_hWnd);
00223       }
00224     }
00225   }
00226
00227   if (!bOk)
00228   {
00229     DELETE_POINTER(m_pMsgBox);
00230     DELETE_POINTER(m_pGuiBall);
00231   }
00232
00233   return (bOk);
00234 }
00235
00236
00237 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00238   Method:   CMainWindow::DoMenu
00239
00240   Summary:  Dispatch and handle the main menu commands.
00241
00242   Args:     WPARAM wParam,
00243               First message parameter (word sized).
00244             LPARAM lParam)
00245               Second message parameter (long sized).
00246
00247   Modifies: m_ofnFile, ...
00248
00249   Returns:  LRESULT
00250               Standard Windows WindowProc return value.
00251 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00252 LRESULT CMainWindow::DoMenu(
00253           WPARAM wParam,
00254           LPARAM lParam)
00255 {
00256   LRESULT lResult = FALSE;
00257   HMENU hMenu  = ::GetMenu(m_hWnd);
00258
00259   switch (LOWORD(wParam))
00260   {
00261     //----------------------------------------------------------------------
00262     // Handle File Menu Commands.
00263     //----------------------------------------------------------------------
00264     case IDM_FILE_EXIT:
00265       // The user commands us to exit this application so we tell the
00266       // Main window to close itself.
00267       ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00268       break;
00269
00270     //----------------------------------------------------------------------
00271     // Handle Help Menu Commands.
00272     //----------------------------------------------------------------------
00273     case IDM_HELP_CONTENTS:
00274       // We have some stubbed support here for bringing up the online
00275       // Help for this application.
00276       ReadHelp(m_hWnd, m_szHelpFile);
00277       break;
00278     case IDM_HELP_TUTORIAL:
00279       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00280       // tutorial narrative file associated with this tutorial code sample.
00281       ReadTutorial(m_hInst, m_hWnd, TEXT(HTML_FILE_EXT));
00282       break;
00283     case IDM_HELP_TUTSERVER:
00284       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00285       // tutorial narrative file associated with the COM server.
00286       ReadTutorial(m_hInst, m_hWnd, TEXT(SERVER_TUTFILE_STR));
00287       break;
00288     case IDM_HELP_READSOURCE:
00289       // Call the APPUTIL utility function ReadSource to allow the
00290       // user to open and read any of the source files of FRECLIEN.
00291       ReadSource(m_hWnd, &m_ofnFile);
00292       break;
00293     case IDM_HELP_ABOUT:
00294       {
00295         CAboutBox dlgAboutBox;
00296
00297         // Show the standard About Box dialog for this EXE by telling the
00298         // dialog C++ object to show itself by invoking its ShowDialog
00299         // method.  Pass it this EXE instance and the parent window handle.
00300         // Use a dialog resource ID for the dialog template stored in
00301         // this EXE module's resources.
00302         dlgAboutBox.ShowDialog(
00303           m_hInst,
00304           MAKEINTRESOURCE(IDM_HELP_ABOUT),
00305           m_hWnd);
00306       }
00307       break;
00308
00309     default:
00310       // Defer all messages NOT handled here to the Default Window Proc.
00311       lResult = ::DefWindowProc(m_hWnd, WM_COMMAND, wParam, lParam);
00312       break;
00313   }
00314
00315   return(lResult);
00316 }
00317
00318
00319 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00320   Method:   CMainWindow::WindowProc
00321
00322   Summary:  Main window procedure for this window object.  See CVirWindow
00323             in the APPUTIL library (APPUTIL.CPP) for details on how this
00324             method gets called by the global WindowProc.
00325
00326   Args:     UINT uMsg,
00327               Windows message that is "sent" to this window.
00328             WPARAM wParam,
00329               First message parameter (word sized).
00330             LPARAM lParam)
00331               Second message parameter (long sized).
00332
00333   Modifies: ...
00334
00335   Returns:  LRESULT
00336               Standard Windows WindowProc return value.
00337 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00338 LRESULT CMainWindow::WindowProc(
00339           UINT uMsg,
00340           WPARAM wParam,
00341           LPARAM lParam)
00342 {
00343   LRESULT lResult = FALSE;
00344
00345   switch (uMsg)
00346   {
00347     case WM_CREATE:
00348       break;
00349
00350     case WM_MEASUREITEM:
00351       // Get setup for painting text in this window.
00352       {
00353         LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam;
00354         lpmis->itemHeight = m_tm.tmHeight + m_tm.tmExternalLeading;
00355         lpmis->itemWidth = m_wWidth;
00356         lResult = TRUE;
00357       }
00358
00359     case WM_SIZE:
00360       // Handle a resize of this window.
00361       m_wWidth = LOWORD(lParam);
00362       m_wHeight = HIWORD(lParam);
00363       // Handle a resize of this window.
00364       // Restart the ball from upper left, clear window.
00365       m_pGuiBall->Restart();
00366       break;
00367
00368     case WM_TIMER:
00369       // This is our timed attempt to continuously paint the moving ball.
00370       // It doesn't move it. Other non-GUI threads move the virtual ball.
00371       m_pGuiBall->PaintBall();
00372       break;
00373
00374     case WM_COMMAND:
00375       // Dispatch and handle any Menu command messages received.
00376       lResult = DoMenu(wParam, lParam);
00377       break;
00378
00379     case WM_CHAR:
00380       if (wParam == 0x1b)
00381       {
00382         // Exit this app if user hits ESC key.
00383         PostMessage(m_hWnd,WM_CLOSE,0,0);
00384         break;
00385       }
00386     case WM_LBUTTONUP:
00387     case WM_PAINT:
00388       // If something major happened or user clicks or hits key then
00389       // repaint the whole window.
00390       m_pGuiBall->PaintWin();
00391       break;
00392
00393     case WM_CLOSE:
00394       // The user selected Close on the main window's System menu
00395       // or Exit on the File menu.
00396     case WM_QUIT:
00397       // If the app is being quit then close any associated help windows.
00398     default:
00399       // Defer all messages NOT handled here to the Default Window Proc.
00400       lResult = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
00401       break;
00402   }
00403
00404   return(lResult);
00405 }
00406
00407
00408 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00409   Function: UnicodeOk
00410
00411   Summary:  Checks if the platform will handle unicode versions of
00412             Win32 string API calls.
00413
00414   Args:     void
00415
00416   Returns:  BOOL
00417               TRUE if unicode support; FALSE if not.
00418 ------------------------------------------------------------------------F-F*/
00419 BOOL UnicodeOk(void)
00420 {
00421   BOOL bOk = TRUE;
00422   TCHAR szUserName[MAX_STRING_LENGTH];
00423   DWORD dwSize = MAX_STRING_LENGTH;
00424
00425   if (!GetUserName(szUserName, &dwSize))
00426     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00427
00428   return bOk;
00429 }
00430
00431
00432 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00433   Function: InitApplication
00434
00435   Summary:  Initializes the application and registers its main window
00436             class. InitApplication is called only once (in WinMain).
00437
00438   Args:     HINSTANCE hInstance)
00439               Handle to the first instance of the application.
00440
00441   Returns:  BOOL.
00442               TRUE if success.
00443               FALSE if fail.
00444 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00445 BOOL InitApplication(
00446        HINSTANCE hInstance)
00447 {
00448   BOOL bOk;
00449   // The window class for all instances of the main frame window.
00450   WNDCLASSEX wcf;
00451
00452   // Assign the appropriate values for this main frame window class.
00453   wcf.cbSize        = sizeof(WNDCLASSEX);
00454   wcf.cbClsExtra    = 0;            // No per-class extra data.
00455   wcf.cbWndExtra    = 0;            // No per-window extra data.
00456   wcf.hInstance     = hInstance;    // Application module instance.
00457   wcf.lpfnWndProc   = &WindowProc;  // Global Window Procedure (defined in
00458                                     // APPUTIL for all CVirWindows).
00459   wcf.hCursor       = LoadCursor(NULL, IDC_ARROW); // Load app cursor.
00460   wcf.hIcon         = (HICON) LoadIcon(            // Load app icon.
00461                                 hInstance,
00462                                 TEXT("AppIcon"));
00463   wcf.hIconSm       = (HICON) LoadImage(           // Load small icon.
00464                                 hInstance,
00465                                 TEXT("AppIcon"),
00466                                 IMAGE_ICON,
00467                                 16, 16,
00468                                 0);
00469   wcf.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); // Backgnd color.
00470   wcf.style         = CS_HREDRAW | CS_VREDRAW;     // Class style(s).
00471   wcf.lpszClassName = TEXT(MAIN_WINDOW_CLASS_NAME_STR); // Class name.
00472   wcf.lpszMenuName  = TEXT(MAIN_WINDOW_CLASS_MENU_STR); // Menu name.
00473
00474   // Register the window class and return FALSE if unsuccesful.
00475   bOk = RegisterClassEx(&wcf);
00476
00477   return (bOk);
00478 }
00479
00480
00481 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00482   Function: WinMain
00483
00484   Summary:  The Windows main entry point function for this application.
00485             Initializes the application, the COM Libraries, and starts
00486             the main application message loop.
00487
00488   Args:     HINSTANCE hInstance,
00489               Instance handle; a new one for each invocation of this app.
00490             HINSTANCE hPrevInstance,
00491               Instance handle of the previous instance. NULL in Win32.
00492             LPSTR lpCmdLine,
00493               Windows passes a pointer to the application's
00494               invocation command line.
00495             int nCmdShow)
00496               Bits telling the show state of the application.
00497
00498   Returns:  int
00499               msg.wParam (upon exit of message loop).
00500               FALSE if this instance couldn't initialize and run.
00501 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00502 extern "C" int PASCAL WinMain(
00503                         HINSTANCE hInstance,
00504                         HINSTANCE hPrevInstance,
00505                         LPSTR lpCmdLine,
00506                         int nCmdShow)
00507 {
00508   CMainWindow* pWin = NULL;
00509   MSG msg;
00510   HACCEL hAccel;
00511   int iRun = FALSE;
00512
00513   // If we were compiled for UNICODE and the platform seems OK with this
00514   // then proceed.  Else we error and exit the app.
00515   if (UnicodeOk())
00516   {
00517     // Call to initialize the COM Library.  Use the SUCCEEDED macro
00518     // to detect success.  If fail, then exit app with error message.
00519     // Initialize COM here in the main process thread to establish this
00520     // main thread as the founder of the multi-thread apartment
00521     // (MTA) of this process. Other worker free-threads will also live
00522     // in this multi-threaded apartment. The app can have only one such
00523     // multi-threaded apartment but could have a mixed model with other
00524     // single-threaded apartments running. This sample has no other
00525     // single-threaded apartments.
00526     if (SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED)))
00527     {
00528       // Ensure that DCOM (Distributed COM) is installed and enabled.
00529       if (DComOk())
00530       {
00531         // If we succeeded in initializing the COM Library and DCOM is
00532         // available, we proceed to initialize the application.  If we
00533         // can't init the application then we signal shut down with
00534         // an error message exit.
00535         iRun = InitApplication(hInstance);
00536         if (iRun)
00537         {
00538           // Assume we'll set iRun to TRUE when initialization is done.
00539           iRun = FALSE;
00540           // We are still go for running so we try to create a nifty new
00541           // CMainWindow object for this app instance.
00542           pWin = new CMainWindow;
00543           if (NULL != pWin)
00544           {
00545             // Now we initialize an instance of the new CMainWindow.
00546             // This includes creating the main window.
00547             if (pWin->InitInstance(hInstance, nCmdShow))
00548             {
00549               // Load the keyboard accelerators from the resources.
00550               hAccel = LoadAccelerators(hInstance, TEXT("AppAccel"));
00551               if (NULL != hAccel)
00552               {
00553                 // Signal App Initialization is successfully done.
00554                 iRun = TRUE;
00555               }
00556             }
00557           }
00558         }
00559
00560         if (iRun)
00561         {
00562           // If we initialized the app instance properly then we are still
00563           // go for running.  We then start up the main message pump for
00564           // the application.
00565           while (GetMessage(&msg, NULL, 0, 0))
00566           {
00567             if (!TranslateAccelerator(pWin->GetHwnd(), hAccel, &msg))
00568             {
00569               TranslateMessage(&msg);
00570               DispatchMessage(&msg);
00571             }
00572           }
00573
00574           // We also ask COM to unload any unused COM Servers, including our
00575           // friend, FRESERVE.
00576           CoFreeUnusedLibraries();
00577
00578           // We'll pass to Windows the reason why we exited the message loop.
00579           iRun = (int) msg.wParam;
00580         }
00581         else
00582         {
00583           // We failed to initialize the application. Put up error message
00584           // box saying that application couldn't be initialized.  Parent
00585           // window is desktop (ie, NULL). Exit the failed application
00586           // (ie, by returning FALSE to WinMain).
00587           ErrorBox(hInstance, NULL, IDS_APPINITFAILED);
00588
00589           // Delete the CMainWindow object.
00590           DELETE_POINTER(pWin);
00591         }
00592
00593         // We're exiting this app (either normally or by init failure) so
00594         // shut down the COM Library.
00595         CoUninitialize();
00596       }
00597       else
00598       {
00599         // If DCOM isn't installed or is not enabled, then
00600         // indicate an error and exit the app immediately.
00601         ErrorBox(hInstance, NULL, IDS_NODCOM);
00602       }
00603     }
00604     else
00605     {
00606       // We failed to Initialize the COM Library. Put up error message
00607       // box saying that COM Library couldn't be initialized.  Parent
00608       // window is desktop (ie, NULL). Exit the failed application
00609       // (ie, by returning FALSE to WinMain).
00610       ErrorBox(hInstance, NULL, IDS_COMINITFAILED);
00611     }
00612   }
00613   else
00614   {
00615     // If we were compiled for UNICODE but the platform has problems with
00616     // this then indicate an error and exit the app immediately.
00617     CHAR szMsg[MAX_STRING_LENGTH];
00618
00619     if (LoadStringA(
00620           hInstance,
00621           IDS_NOUNICODE,
00622           szMsg,
00623           MAX_STRING_LENGTH))
00624     {
00625       MessageBoxA(
00626         NULL,
00627         szMsg,
00628         ERROR_TITLE_STR,
00629         MB_OK | MB_ICONEXCLAMATION);
00630     }
00631   }
00632
00633   return iRun;
00634 }
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/CursorLocationEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

CursorLocationEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: CursorLocationEnum
00019
00020 public class CursorLocationEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adUseNone = 1;
00023   public static final short adUseServer = 2;
00024   public static final short adUseClient = 3;
00025   public static final short adUseClientBatch = 3;
00026 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/PropertyAttributesEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

PropertyAttributesEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: PropertyAttributesEnum
00019
00020 public class PropertyAttributesEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adPropNotSupported = 0;
00023   public static final short adPropRequired = 1;
00024   public static final short adPropOptional = 2;
00025   public static final short adPropRead = 512;
00026   public static final short adPropWrite = 1024;
00027 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/SMFI.h Source File

  • Multimedia
  • Audio
  • MidiPlyr

SMFI.h

Go to the documentation of this file.
00001 //==========================================================================;
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 //  A PARTICULAR PURPOSE.
00007 //
00008 //  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------;
00011 #ifndef _SMFI_
00012 #define _SMFI_
00013
00014 /* Handle structure for HSMF
00015 */
00016
00017 #define SMF_TF_EOT          0x00000001L
00018 #define SMF_TF_INVALID      0x00000002L
00019
00020 typedef struct tag_tempomapentry
00021 {
00022     TICKS           tkTempo;
00023     DWORD           msBase;
00024     DWORD           dwTempo;
00025 }   TEMPOMAPENTRY,
00026     *PTEMPOMAPENTRY;
00027
00028 typedef struct tag_smf *PSMF;
00029
00030 typedef struct tag_track
00031 {
00032     PSMF            pSmf;
00033
00034     DWORD           idxTrack;
00035
00036     TICKS           tkPosition;
00037     DWORD           cbLeft;
00038     HPBYTE          hpbImage;
00039     BYTE            bRunningStatus;
00040
00041     DWORD           fdwTrack;
00042
00043     struct
00044     {
00045         TICKS       tkLength;
00046         DWORD       cbLength;
00047     }
00048     smti;
00049
00050 }   TRACK,
00051     *PTRACK;
00052
00053 #define SMF_F_EOF               0x00000001L
00054 #define SMF_F_INSERTSYSEX       0x00000002L
00055
00056 #define C_TEMPO_MAP_CHK     16
00057 typedef struct tag_smf
00058 {
00059     char            szName[128];
00060     HPBYTE          hpbImage;
00061     DWORD           cbImage;
00062     HTASK           htask;
00063
00064     TICKS           tkPosition;
00065     TICKS           tkLength;
00066     DWORD           dwFormat;
00067     DWORD           dwTracks;
00068     DWORD           dwTimeDivision;
00069     DWORD           fdwSMF;
00070
00071     DWORD           cTempoMap;
00072     DWORD           cTempoMapAlloc;
00073     HLOCAL          hTempoMap;
00074     PTEMPOMAPENTRY  pTempoMap;
00075
00076     DWORD           dwPendingUserEvent;
00077     DWORD           cbPendingUserEvent;
00078     HPBYTE          hpbPendingUserEvent;
00079
00080     TRACK           rTracks[];
00081 }   SMF;
00082
00083 typedef struct tagEVENT
00084 {
00085     TICKS           tkDelta;
00086     BYTE            abEvent[3];
00087
00088
00089
00090     DWORD           cbParm;
00091     HPBYTE          hpbParm;
00092 }   EVENT,
00093     BSTACK *SPEVENT;
00094
00095 #define EVENT_TYPE(event)       ((event).abEvent[0])
00096 #define EVENT_CH_B1(event)      ((event).abEvent[1])
00097 #define EVENT_CH_B2(event)      ((event).abEvent[2])
00098
00099 #define EVENT_META_TYPE(event)  ((event).abEvent[1])
00100
00101 SMFRESULT FNLOCAL smfBuildFileIndex(
00102     PSMF BSTACK *       ppsmf);
00103
00104 DWORD FNLOCAL smfGetVDword(
00105     HPBYTE              hpbImage,
00106     DWORD               dwLeft,
00107     DWORD BSTACK *      pdw);
00108
00109 SMFRESULT FNLOCAL smfGetNextEvent(
00110     PSMF                psmf,
00111     SPEVENT             pevent,
00112     TICKS               tkMax);
00113
00114 /*
00115 ** Useful macros when dealing with hi-lo format integers
00116 */
00117 #define DWORDSWAP(dw) \
00118     ((((dw)>>24)&0x000000FFL)|\
00119     (((dw)>>8)&0x0000FF00L)|\
00120     (((dw)<<8)&0x00FF0000L)|\
00121     (((dw)<<24)&0xFF000000L))
00122
00123 #define WORDSWAP(w) \
00124     ((((w)>>8)&0x00FF)|\
00125     (((w)<<8)&0xFF00))
00126
00127 #define FOURCC_RMID     mmioFOURCC('R','M','I','D')
00128 #define FOURCC_data     mmioFOURCC('d','a','t','a')
00129 #define FOURCC_MThd     mmioFOURCC('M','T','h','d')
00130 #define FOURCC_MTrk     mmioFOURCC('M','T','r','k')
00131
00132 typedef struct tag_chunkhdr
00133 {
00134     FOURCC  fourccType;
00135     DWORD   dwLength;
00136 }   CHUNKHDR,
00137     *PCHUNKHDR;
00138
00139 #pragma pack(1) // override cl32 default packing, to match disk file.
00140 typedef struct tag_filehdr
00141 {
00142     WORD    wFormat;
00143     WORD    wTracks;
00144     WORD    wDivision;
00145 }   FILEHDR,
00146     *PFILEHDR;
00147 #pragma pack()
00148
00149 /* NOTE: This is arbitrary and only used if there is a tempo map but no
00150 ** entry at tick 0.
00151 */
00152 #define MIDI_DEFAULT_TEMPO      (500000L)
00153
00154 #define MIDI_MSG                ((BYTE)0x80)
00155 #define MIDI_NOTEOFF            ((BYTE)0x80)
00156 #define MIDI_NOTEON             ((BYTE)0x90)
00157 #define MIDI_POLYPRESSURE       ((BYTE)0xA0)
00158 #define MIDI_CONTROLCHANGE      ((BYTE)0xB0)
00159 #define MIDI_PROGRAMCHANGE      ((BYTE)0xC0)
00160 #define MIDI_CHANPRESSURE       ((BYTE)0xD0)
00161 #define MIDI_PITCHBEND          ((BYTE)0xE0)
00162 #define MIDI_META               ((BYTE)0xFF)
00163 #define MIDI_SYSEX              ((BYTE)0xF0)
00164 #define MIDI_SYSEXEND           ((BYTE)0xF7)
00165
00166 #define MIDI_META_TRACKNAME     ((BYTE)0x03)
00167 #define MIDI_META_EOT           ((BYTE)0x2F)
00168 #define MIDI_META_TEMPO         ((BYTE)0x51)
00169 #define MIDI_META_TIMESIG       ((BYTE)0x58)
00170 #define MIDI_META_KEYSIG        ((BYTE)0x59)
00171 #define MIDI_META_SEQSPECIFIC   ((BYTE)0x7F)
00172
00173 #endif
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/SampleMSP/SampStrm.Cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • SampleMSP

SampStrm.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     sampstrm.cpp
00008
00009 Abstract:
00010
00011     This module contains the implementation for a sample MSP stream class.
00012
00013 --*/
00014
00015 #include "stdafx.h"
00016
00017 ///////////////////////////////////////////////////////////////////////////////
00018 ///////////////////////////////////////////////////////////////////////////////
00019 //
00020
00021 CSampleMSPStream::CSampleMSPStream() : CMSPStream()
00022 {
00023     LOG((MSP_TRACE, "CSampleMSPStream::CSampleMSPStream entered."));
00024
00025     m_fTransportConfigured = FALSE;
00026     m_fTerminalConnected   = FALSE;
00027     m_DesiredGraphState    = State_Stopped;
00028     m_ActualGraphState     = State_Stopped;
00029
00030     //
00031     // INSERT HERE: initialize other data members
00032     //
00033
00034     LOG((MSP_TRACE, "CSampleMSPStream::CSampleMSPStream exited."));
00035 }
00036
00037 ///////////////////////////////////////////////////////////////////////////////
00038 ///////////////////////////////////////////////////////////////////////////////
00039 //
00040
00041 CSampleMSPStream::~CSampleMSPStream()
00042 {
00043     LOG((MSP_TRACE, "CSampleMSPStream::~CSampleMSPStream entered."));
00044     LOG((MSP_TRACE, "CSampleMSPStream::~CSampleMSPStream exited."));
00045 }
00046
00047 ///////////////////////////////////////////////////////////////////////////////
00048 ///////////////////////////////////////////////////////////////////////////////
00049 //
00050
00051 void CSampleMSPStream::FinalRelease()
00052 {
00053     LOG((MSP_TRACE, "CSampleMSPStream::FinalRelease entered."));
00054
00055     //
00056     // At this point we should have no terminals selected, since
00057     // Shutdown is supposed to be called before we are destructed.
00058     //
00059
00060     _ASSERTE( 0 == m_Terminals.GetSize() );
00061
00062     if ( m_fTransportConfigured )
00063     {
00064         //
00065         // INSERT HERE: Remove our transport filters from the graph and
00066         // release them.
00067         //
00068     }
00069
00070     //
00071     // Call the base class method to clean up everything else.
00072     //
00073
00074     CMSPStream::FinalRelease();
00075
00076     LOG((MSP_TRACE, "CSampleMSPStream::FinalRelease exited."));
00077 }
00078
00079 ///////////////////////////////////////////////////////////////////////////////
00080 ///////////////////////////////////////////////////////////////////////////////
00081 //
00082
00083 STDMETHODIMP CSampleMSPStream::get_Name (
00084     OUT     BSTR *                  ppName
00085     )
00086 {
00087     LOG((MSP_TRACE, "CSampleMSPStream::get_Name - enter"));
00088
00089     //
00090     // Check argument.
00091     //
00092
00093     if ( IsBadWritePtr(ppName, sizeof(BSTR) ) )
00094     {
00095         LOG((MSP_TRACE, "CSampleMSPStream::get_Name - "
00096             "bad return pointer - returning E_POINTER"));
00097
00098         return E_POINTER;
00099     }
00100
00101     //
00102     // Decide what string to return based on which stream this is.
00103     //
00104
00105     ULONG ulID;
00106
00107     if ( m_Direction == TD_CAPTURE )
00108     {
00109         ulID = IDS_CAPTURE_STREAM;
00110     }
00111     else
00112     {
00113         ulID = IDS_RENDER_STREAM;
00114     }
00115
00116     //
00117     // Get the string from the string table.
00118     //
00119
00120     const int   ciAllocSize = 2048;
00121     WCHAR       wszName[ciAllocSize];
00122
00123     int iReturn = LoadString( _Module.GetModuleInstance(),
00124                               ulID,
00125                               wszName,
00126                               ciAllocSize - 1 );
00127
00128     if ( iReturn == 0 )
00129     {
00130         _ASSERTE( FALSE );
00131
00132         *ppName = NULL;
00133
00134         LOG((MSP_ERROR, "CSampleMSPStream::get_Name - "
00135             "LoadString failed - returning E_UNEXPECTED"));
00136
00137         return E_UNEXPECTED;
00138     }
00139
00140     //
00141     // Convert to a BSTR and return the BSTR.
00142     //
00143
00144     *ppName = SysAllocString(wszName);
00145
00146     if ( *ppName == NULL )
00147     {
00148         LOG((MSP_ERROR, "CSampleMSPStream::get_Name - "
00149             "SysAllocString failed - returning E_OUTOFMEMORY"));
00150
00151         return E_OUTOFMEMORY;
00152     }
00153
00154     LOG((MSP_TRACE, "CSampleMSPStream::get_Name - exit S_OK"));
00155
00156     return S_OK;
00157 }
00158
00159 ///////////////////////////////////////////////////////////////////////////////
00160 ///////////////////////////////////////////////////////////////////////////////
00161 //
00162 // This implementation, typical of the simplest MSPs, limits each stream to
00163 // having at most one terminal selected at a time.
00164 //
00165
00166 STDMETHODIMP CSampleMSPStream::SelectTerminal(
00167     IN      ITTerminal *            pTerminal
00168     )
00169 {
00170     LOG((MSP_TRACE, "CSampleMSPStream::SelectTerminal - enter"));
00171
00172     //
00173     // We are going to access the terminal list -- grab the lock
00174     //
00175
00176     CLock lock(m_lock);
00177
00178     //
00179     // Reject if we already have a terminal selected.
00180     //
00181
00182     if ( 0 != m_Terminals.GetSize() )
00183     {
00184         LOG((MSP_ERROR, "CSampleMSPStream::SelectTerminal - "
00185             "exit TAPI_E_MAXTERMINALS"));
00186
00187         return TAPI_E_MAXTERMINALS;
00188     }
00189
00190     //
00191     // Use base class method to add it to our list of terminals.
00192     //
00193
00194     HRESULT hr = CMSPStream::SelectTerminal(pTerminal);
00195
00196     if ( FAILED(hr) )
00197     {
00198         LOG((MSP_ERROR, "CSampleMSPStream::SelectTerminal - "
00199             "base class method failed - exit 0x%08x", hr));
00200
00201         return hr;
00202     }
00203
00204     //
00205     // Re-pause or re-start the stream if needed.
00206     //
00207
00208     if ( m_DesiredGraphState == State_Paused )
00209     {
00210         hr = PauseStream();
00211     }
00212     else if ( m_DesiredGraphState == State_Running )
00213     {
00214         hr = StartStream();
00215     }
00216     else
00217     {
00218         _ASSERTE( m_DesiredGraphState == State_Stopped );
00219
00220         hr = S_OK;
00221     }
00222
00223     if ( FAILED(hr) )
00224     {
00225         LOG((MSP_TRACE, "CSampleMSPStream::SelectTerminal - "
00226             "can't regain old graph state - unselecting terminal - "
00227             "exit 0x%08x", hr));
00228
00229     //
00230     // Unselect it to undo all of the above.
00231     //
00232
00233       UnselectTerminal(pTerminal);
00234
00235         return hr;
00236     }
00237
00238     LOG((MSP_TRACE, "CSampleMSPStream::SelectTerminal - exit S_OK"));
00239
00240     return S_OK;
00241 }
00242
00243 ///////////////////////////////////////////////////////////////////////////////
00244 ///////////////////////////////////////////////////////////////////////////////
00245 //
00246
00247 STDMETHODIMP CSampleMSPStream::UnselectTerminal (
00248         IN     ITTerminal *             pTerminal
00249         )
00250 {
00251     LOG((MSP_TRACE, "CSampleMSPStream::UnselectTerminal - enter"));
00252
00253     CLock lock(m_lock);
00254
00255     //
00256     // Use base class method to remove terminal from our list of terminals.
00257     //
00258     // Note: the failure cases are messy here. In this sample implementation
00259     // we choose to return an error code but release our reference to the
00260     // terminal when disconnection fails. This is typically better than
00261     // keeping our reference to the terminal, which would cause us to leak
00262     // the terminal whenever disconnection fails.
00263     //
00264
00265     HRESULT hr = CMSPStream::UnselectTerminal(pTerminal);
00266
00267     if (FAILED(hr))
00268     {
00269         LOG((MSP_ERROR, "CSampleMSPStream::UnselectTerminal - "
00270             "base class method failed - exit 0x%08x", hr));
00271
00272         return hr;
00273     }
00274
00275     //
00276     // Stop the graph and disconnect the terminal if this call had it
00277     // connected. (We need a stopped graph to disconnect properly, and
00278     // couldn't have started the graph if the terminal isn't connected.)
00279     //
00280
00281     if ( m_fTerminalConnected )
00282     {
00283         //
00284         // At this point we need to make sure the stream is stopped.
00285         // We can't use our own StopStream method because it
00286         // (1) changes the desired graph state to Stopped and
00287         // (2) does nothing if no terminal has been selected (which it now
00288         //     thinks is the case)
00289         //
00290
00291         _ASSERTE( m_fTransportConfigured );
00292
00293         //
00294         // Stop the stream via the base class method.
00295         //
00296
00297         hr = CMSPStream::StopStream();
00298
00299         m_ActualGraphState = State_Stopped;
00300
00301         if ( FAILED(hr) )
00302         {
00303             LOG((MSP_ERROR, "CSampleMSPStream::UnselectTerminal - "
00304                 "Stop failed - 0x%08x", hr));
00305
00306             // don't return hr -- we really want to continue and
00307             // disconnect if we can!
00308         }
00309
00310         //
00311         // Get the ITTerminalControl interface.
00312         //
00313
00314         ITTerminalControl * pTerminalControl;
00315
00316         hr = pTerminal->QueryInterface(IID_ITTerminalControl,
00317                                        (void **) &pTerminalControl);
00318
00319         if ( FAILED(hr) )
00320         {
00321             LOG((MSP_ERROR, "CSampleMSPStream::UnselectTerminal - "
00322                 "QI for ITTerminalControl failed - exit 0x%08x", hr));
00323
00324             return hr;
00325         }
00326
00327         //
00328         // Disconnect the terminal.
00329         //
00330
00331         hr = pTerminalControl->DisconnectTerminal(m_pIGraphBuilder, 0);
00332
00333         pTerminalControl->Release();
00334
00335         m_fTerminalConnected = FALSE;
00336
00337         if ( FAILED(hr) )
00338         {
00339             LOG((MSP_ERROR, "CSampleMSPStream::UnselectTerminal - "
00340                 "DisconnectTerminal failed - exit 0x%08x", hr));
00341
00342             return hr;
00343         }
00344
00345         //
00346         // INSERT HERE: Additional disconnection may be needed, for example
00347         // for transport fitlers or transform filters that need to be
00348         // used for some terminals but not for others.
00349         //
00350     }
00351
00352     LOG((MSP_TRACE, "CSampleMSPStream::UnselectTerminal - exit S_OK"));
00353
00354     return S_OK;
00355 }
00356
00357 ///////////////////////////////////////////////////////////////////////////////
00358 ///////////////////////////////////////////////////////////////////////////////
00359 //
00360
00361 STDMETHODIMP CSampleMSPStream::StartStream (void)
00362 {
00363     LOG((MSP_TRACE, "CSampleMSPStream::StartStream - enter"));
00364
00365     CLock lock(m_lock);
00366
00367     m_DesiredGraphState = State_Running;
00368
00369     //
00370     // Can't start the stream if our transport filters are not configured.
00371     //
00372
00373     if ( ! m_fTransportConfigured )
00374     {
00375         LOG((MSP_WARN, "CSampleMSPStream::PauseStream - "
00376             "transport not configured so nothing to do yet - exit S_OK"));
00377
00378         return S_OK;
00379     }
00380
00381     //
00382     // Can't start the stream if no terminal has been selected.
00383     //
00384
00385     if ( 0 == m_Terminals.GetSize() )
00386     {
00387         LOG((MSP_WARN, "CSampleMSPStream::StartStream - "
00388             "no Terminal so nothing to do yet - exit S_OK"));
00389
00390         return S_OK;
00391     }
00392
00393     //
00394     // Connect the terminal. This does nothing if this call already
00395     // connected the terminal and fails if another call has the
00396     // terminal connected.
00397     //
00398
00399     HRESULT hr;
00400
00401     hr = ConnectTerminal(m_Terminals[0]);
00402
00403     if ( FAILED(hr) )
00404     {
00405         FireEvent(CALL_TERMINAL_FAIL, hr, CALL_CAUSE_CONNECT_FAIL);
00406         FireEvent(CALL_STREAM_FAIL, hr, CALL_CAUSE_CONNECT_FAIL);
00407
00408         LOG((MSP_ERROR, "CSampleMSPStream::StartStream - "
00409             "our ConnectTerminal failed - exit 0x%08x", hr));
00410
00411         return hr;
00412     }
00413
00414     //
00415     // Run the stream via the base class method.
00416     //
00417
00418     hr = CMSPStream::StartStream();
00419
00420     if ( FAILED(hr) )
00421     {
00422         //
00423         // Failed to run -- tell the app.
00424         //
00425
00426         FireEvent(CALL_STREAM_FAIL, hr, CALL_CAUSE_UNKNOWN);
00427
00428         LOG((MSP_ERROR, "CSampleMSPStream::StartStream - "
00429             "Run failed - exit 0x%08x", hr));
00430
00431         return hr;
00432     }
00433
00434     //
00435     // Fire event if this just made us active.
00436     //
00437
00438     if ( m_ActualGraphState != State_Running )
00439     {
00440         m_ActualGraphState = State_Running;
00441
00442         HRESULT hr2 = FireEvent(CALL_STREAM_ACTIVE, hr, CALL_CAUSE_LOCAL_REQUEST);
00443
00444         if ( FAILED(hr2) )
00445         {
00446             LOG((MSP_ERROR, "CSampleMSPStream::StartStream - "
00447                 "FireEvent failed - exit 0x%08x", hr2));
00448
00449             return hr2;
00450         }
00451     }
00452
00453     LOG((MSP_TRACE, "CSampleMSPStream::StartStream - exit S_OK"));
00454
00455     return S_OK;
00456 }
00457
00458 ///////////////////////////////////////////////////////////////////////////////
00459 ///////////////////////////////////////////////////////////////////////////////
00460 //
00461
00462 STDMETHODIMP CSampleMSPStream::PauseStream (void)
00463 {
00464     LOG((MSP_TRACE, "CSampleMSPStream::PauseStream - enter"));
00465
00466     CLock lock(m_lock);
00467
00468     m_DesiredGraphState = State_Paused;
00469
00470     //
00471     // Can't pause the stream if our transport filters are not configured.
00472     //
00473
00474     if ( ! m_fTransportConfigured )
00475     {
00476         LOG((MSP_WARN, "CSampleMSPStream::PauseStream - "
00477             "transport not configured so nothing to do yet - exit S_OK"));
00478
00479         return S_OK;
00480     }
00481
00482     //
00483     // Can't pause the stream if no terminal has been selected.
00484     //
00485
00486     if ( 0 == m_Terminals.GetSize() )
00487     {
00488         LOG((MSP_WARN, "CSampleMSPStream::PauseStream - "
00489             "no Terminal so nothing to do yet - exit S_OK"));
00490
00491         return S_OK;
00492     }
00493
00494     //
00495     // Connect the terminal. This does nothing if this call already
00496     // connected the terminal and fails if another call has the
00497     // terminal connected.
00498     //
00499
00500     HRESULT hr;
00501
00502     hr = ConnectTerminal(m_Terminals[0]);
00503
00504     if ( FAILED(hr) )
00505     {
00506         FireEvent(CALL_TERMINAL_FAIL, hr, CALL_CAUSE_CONNECT_FAIL);
00507         FireEvent(CALL_STREAM_FAIL, hr, CALL_CAUSE_CONNECT_FAIL);
00508
00509         LOG((MSP_ERROR, "CSampleMSPStream::StartStream - "
00510             "our ConnectTerminal failed - exit 0x%08x", hr));
00511
00512         return hr;
00513     }
00514
00515     //
00516     // Pause the stream via the base class method.
00517     //
00518
00519     hr = CMSPStream::PauseStream();
00520
00521     if ( FAILED(hr) )
00522     {
00523         //
00524         // Failed to pause -- tell the app.
00525         //
00526
00527         FireEvent(CALL_STREAM_FAIL, hr, CALL_CAUSE_UNKNOWN);
00528
00529         LOG((MSP_ERROR, "CSampleMSPStream::PauseStream - "
00530             "Pause failed - exit 0x%08x", hr));
00531
00532         return hr;
00533     }
00534
00535     //
00536     // Fire event if this just made us inactive.
00537     //
00538
00539     if ( m_ActualGraphState == State_Running )
00540     {
00541         HRESULT hr2 = FireEvent(CALL_STREAM_INACTIVE, hr, CALL_CAUSE_LOCAL_REQUEST);
00542
00543         if ( FAILED(hr2) )
00544         {
00545             m_ActualGraphState = State_Paused;
00546
00547             LOG((MSP_ERROR, "CSampleMSPStream::PauseStream - "
00548                 "FireEvent failed - exit 0x%08x", hr2));
00549
00550             return hr2;
00551         }
00552     }
00553
00554     m_ActualGraphState = State_Paused;
00555
00556     LOG((MSP_TRACE, "CSampleMSPStream::PauseStream - exit S_OK"));
00557
00558     return S_OK;
00559 }
00560
00561 ///////////////////////////////////////////////////////////////////////////////
00562 ///////////////////////////////////////////////////////////////////////////////
00563 //
00564
00565 STDMETHODIMP CSampleMSPStream::StopStream (void)
00566 {
00567     LOG((MSP_TRACE, "CSampleMSPStream::StopStream - enter"));
00568
00569     CLock lock(m_lock);
00570
00571     m_DesiredGraphState = State_Stopped;
00572
00573     //
00574     // Nothing to do if our transport is not configured.
00575     //
00576
00577     if ( ! m_fTransportConfigured )
00578     {
00579         LOG((MSP_WARN, "CSampleMSPStream::StopStream - "
00580             "transport not configured - exit S_OK"));
00581
00582         return S_OK;
00583     }
00584
00585     //
00586     // Nothing to do if no terminal has been selected.
00587     //
00588
00589     if ( 0 == m_Terminals.GetSize() )
00590     {
00591         LOG((MSP_WARN, "CSampleMSPStream::StopStream - "
00592             "no Terminal - exit S_OK"));
00593
00594         return S_OK;
00595     }
00596
00597     //
00598     // Stop the stream via the base class method.
00599     //
00600
00601     HRESULT hr;
00602
00603     hr = CMSPStream::StopStream();
00604
00605     if ( FAILED(hr) )
00606     {
00607         //
00608         // Failed to stop -- tell the app.
00609         //
00610
00611         FireEvent(CALL_STREAM_FAIL, hr, CALL_CAUSE_UNKNOWN);
00612
00613         m_DesiredGraphState = m_ActualGraphState;
00614
00615         LOG((MSP_ERROR, "CSampleMSPStream::StopStream - "
00616             "Stop failed - exit 0x%08x", hr));
00617
00618         return hr;
00619     }
00620
00621     //
00622     // Fire event if this just made us inactive.
00623     //
00624
00625     if ( m_ActualGraphState == State_Running )
00626     {
00627         HRESULT hr2 = FireEvent(CALL_STREAM_INACTIVE, hr, CALL_CAUSE_LOCAL_REQUEST);
00628
00629         if ( FAILED(hr2) )
00630         {
00631             m_ActualGraphState = State_Stopped;
00632
00633             LOG((MSP_ERROR, "CSampleMSPStream::StopStream - "
00634                 "FireEvent failed - exit 0x%08x", hr2));
00635
00636             return hr2;
00637         }
00638     }
00639
00640     m_ActualGraphState = State_Stopped;
00641
00642     LOG((MSP_TRACE, "CSampleMSPStream::StopStream - exit S_OK"));
00643
00644     return S_OK;
00645 }
00646
00647 ///////////////////////////////////////////////////////////////////////////////
00648 ///////////////////////////////////////////////////////////////////////////////
00649 //
00650 // A real MSP would have some arguments to this method, which would then be
00651 // used to configure transport filters. The types of information passed here
00652 // vary widely. For example, some MSPs may need to configure their transport
00653 // filters with a GUID that indicates which device to use for streaming. This
00654 // info would be passed to the MSP from the TSP via TAPI 3.0 (see sampcall.cpp).
00655 //
00656
00657 HRESULT CSampleMSPStream::ConfigureTransport(void)
00658 {
00659     LOG((MSP_TRACE, "CSampleMSPStream::ConfigureTransport - enter"));
00660
00661     CLock lock(m_lock);
00662
00663     //
00664     // INSERT HERE:
00665     // * create the transport filter(s)
00666     // * configure the transport filter(s) based on passe-in info
00667     // * add filters to our graph
00668     // * if some transport filters always need to be connected together
00669     //   (irrespective of what terminals are used, etc.) then they can be
00670     //   connected now).
00671     //
00672
00673     m_fTransportConfigured = TRUE;
00674
00675     LOG((MSP_TRACE, "CSampleMSPStream::ConfigureTransport - exit S_OK"));
00676
00677     return S_OK;
00678 }
00679
00680 ///////////////////////////////////////////////////////////////////////////////
00681 ///////////////////////////////////////////////////////////////////////////////
00682 //
00683 // Add the terminal to the graph and connect it to our
00684 // filters, if it is not already in use.
00685 //
00686
00687 HRESULT CSampleMSPStream::ConnectTerminal(ITTerminal * pTerminal)
00688 {
00689     LOG((MSP_TRACE, "CSampleMSPStream::ConnectTerminal - enter"));
00690
00691     //
00692     // Find out the terminal's internal state.
00693     //
00694
00695     TERMINAL_STATE state;
00696     HRESULT hr;
00697
00698     hr = pTerminal->get_State( &state );
00699
00700     if ( FAILED(hr) )
00701     {
00702         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00703             "get_State on terminal failed - exit 0x%08x", hr));
00704
00705         return hr;
00706     }
00707
00708     //
00709     // If we've already connected the terminal on this stream, then
00710     // there is nothing for us to do. Just assert that the terminal
00711     // also thinks it's connected.
00712     //
00713
00714     if ( m_fTerminalConnected )
00715     {
00716         _ASSERTE( state == TS_INUSE );
00717
00718         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00719             "terminal already connected on this stream - exit S_OK"));
00720
00721         return S_OK;
00722     }
00723
00724     //
00725     // Otherwise we need to connect the terminal on this call. If the
00726     // terminal is already connected on another call, we must fail. Note
00727     // that since we are making several calls on the terminal here, the
00728     // terminal could become connected on another call while we are
00729     // in the process of doing this. If this happens, the we will just fail
00730     // later.
00731     //
00732
00733     if ( state == TS_INUSE )
00734     {
00735         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00736             "terminal in use - exit TAPI_E_TERMINALINUSE"));
00737
00738         return TAPI_E_TERMINALINUSE;
00739     }
00740
00741     //
00742     // Get the ITTerminalControl interface.
00743     //
00744
00745     ITTerminalControl * pTerminalControl;
00746
00747     hr = m_Terminals[0]->QueryInterface(IID_ITTerminalControl,
00748                                         (void **) &pTerminalControl);
00749
00750     if ( FAILED(hr) )
00751     {
00752         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00753             "QI for ITTerminalControl failed - exit 0x%08x", hr));
00754
00755         return hr;
00756     }
00757
00758     //
00759     // Find out how many pins the terminal has. If not one then bail as
00760     // we have no idea what to do with multiple-pin terminals (we don't
00761     // expose any such terminals from this MSP).
00762     //
00763
00764     DWORD dwNumPinsAvailable;
00765
00766     hr = pTerminalControl->ConnectTerminal(m_pIGraphBuilder,
00767                                            0,
00768                                            &dwNumPinsAvailable,
00769                                            NULL);
00770
00771     if ( FAILED(hr) )
00772     {
00773         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00774             "query for number of terminal pins failed - exit 0x%08x", hr));
00775
00776         pTerminalControl->Release();
00777
00778         return hr;
00779     }
00780
00781     if ( 1 != dwNumPinsAvailable )
00782     {
00783         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00784             "unsupported number of terminal pins - exit E_FAIL"));
00785
00786         pTerminalControl->Release();
00787
00788         return E_FAIL;
00789     }
00790
00791     //
00792     // Actually connect the terminal.
00793     //
00794
00795     IPin * pTerminalPin;
00796
00797     hr = pTerminalControl->ConnectTerminal(m_pIGraphBuilder,
00798                                            0,
00799                                            &dwNumPinsAvailable,
00800                                            &pTerminalPin);
00801
00802     if ( FAILED(hr) )
00803     {
00804         pTerminalControl->Release();
00805
00806         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00807             "ConnectTerminal on terminal failed - exit 0x%08x", hr));
00808
00809         return hr;
00810     }
00811
00812     //
00813     // Make the connection between our filters and the terminal's pin.
00814     //
00815
00816     hr = ConnectToTerminalPin(pTerminalPin);
00817
00818     pTerminalPin->Release();
00819
00820     if ( FAILED(hr) )
00821     {
00822         pTerminalControl->DisconnectTerminal(m_pIGraphBuilder, 0);
00823
00824         pTerminalControl->Release();
00825
00826         LOG((MSP_ERROR, "CSampleMSPStream::ConnectTerminal - "
00827             "ConnectToTerminalPin failed - exit 0x%08x", hr));
00828
00829         return hr;
00830     }
00831
00832     //
00833     // Now we are actually connected. Update our state and perform postconnection
00834     // (ignore postconnection error code).
00835     //
00836
00837     m_fTerminalConnected  = TRUE;
00838
00839     pTerminalControl->CompleteConnectTerminal();
00840
00841     pTerminalControl->Release();
00842
00843     LOG((MSP_TRACE, "CSampleMSPStream::ConnectTerminal - exit S_OK"));
00844
00845     return S_OK;
00846 }
00847
00848 //////////////////////////////////////////////////////////////////////////////
00849 //////////////////////////////////////////////////////////////////////////////
00850 //
00851
00852 HRESULT CSampleMSPStream::ConnectToTerminalPin(IPin * pTerminalPin)
00853 {
00854     LOG((MSP_TRACE, "CSampleMSPStream::ConnectToTerminalPin - enter"));
00855
00856     //
00857     // INSERT HERE: Code to connect the terminal's pin to some pin on some
00858     // transport filter belonging to the stream. See the documentation on
00859     // DirectShow in the Windows SDK for help.
00860     //
00861
00862     LOG((MSP_TRACE, "CSampleMSPStream::ConnectToTerminalPin - exit S_OK"));
00863
00864     return S_OK;
00865 }
00866
00867
00868 //////////////////////////////////////////////////////////////////////////////
00869 //////////////////////////////////////////////////////////////////////////////
00870 //
00871 // ProcessGraphEvent
00872 //
00873 // Sends an event to the app when we get an event from the filter graph.
00874 // Note: The DirectShow graph events that the MSP cares about will vary
00875 // from MSP to MSP. Be sure to modify this code to correctly propagate the
00876 // events you need, depending on what filters you are using.
00877 //
00878
00879 HRESULT CSampleMSPStream::ProcessGraphEvent(
00880     IN  long lEventCode,
00881     IN  long lParam1,
00882     IN  long lParam2
00883     )
00884 {
00885     LOG((MSP_EVENT, "CSampleMSPStream::ProcessGraphEvent - enter"));
00886
00887     HRESULT        hr = S_OK;
00888
00889     switch (lEventCode)
00890     {
00891     case EC_COMPLETE:
00892
00893         hr = FireEvent(CALL_STREAM_INACTIVE, (HRESULT) lParam1, CALL_CAUSE_UNKNOWN);
00894         break;
00895
00896     case EC_USERABORT:
00897
00898         hr = FireEvent(CALL_STREAM_INACTIVE, S_OK, CALL_CAUSE_UNKNOWN);
00899         break;
00900
00901     case EC_ERRORABORT:
00902     case EC_STREAM_ERROR_STOPPED:
00903     case EC_STREAM_ERROR_STILLPLAYING:
00904     case EC_ERROR_STILLPLAYING:
00905
00906         hr = FireEvent(CALL_STREAM_FAIL, (HRESULT) lParam1, CALL_CAUSE_UNKNOWN);
00907         break;
00908
00909     default:
00910
00911         LOG((MSP_EVENT, "CSampleMSPStream::ProcessGraphEvent - "
00912             "ignoring event code %d", lEventCode));
00913         break;
00914     }
00915
00916     if ( FAILED(hr) )
00917     {
00918         LOG((MSP_ERROR, "CSampleMSPStream::ProcessGraphEvent - "
00919             "FireEvent failed - exit 0x%08x", hr));
00920
00921         return hr;
00922     }
00923
00924     LOG((MSP_EVENT, "CSampleMSPStream::ProcessGraphEvent - exit S_OK"));
00925
00926     return S_OK;
00927 }
00928
00929
00930 //////////////////////////////////////////////////////////////////////////////
00931 //////////////////////////////////////////////////////////////////////////////
00932 //
00933 // FireEvent
00934 //
00935 // Sends an event to the application.
00936 //
00937
00938 HRESULT CSampleMSPStream::FireEvent(
00939     IN MSP_CALL_EVENT        type,
00940     IN HRESULT               hrError,
00941     IN MSP_CALL_EVENT_CAUSE  cause
00942     )
00943 {
00944     LOG((MSP_EVENT, "CSampleMSPStream::FireEvent - enter"));
00945
00946     //
00947     // Create the event structure.
00948     //
00949
00950     //
00951     // Note:
00952     //
00953     // MSPEVENTITEMs are allocated with AllocateEventItem and freed with
00954     // FreeEventItem
00955     //
00956     // AllocateEventItem takes an optional argument that specifies how many
00957     // extra bytes need to be allocated in addition to the size of MSPEVENTITEM
00958     //
00959
00960     MSPEVENTITEM * pEventItem = AllocateEventItem();
00961
00962     if (pEventItem == NULL)
00963     {
00964         LOG((MSP_ERROR, "CSampleMSPStream::FireEvent - "
00965             "can't create MSPEVENTITEM structure - exit E_OUTOFMEMORY"));
00966
00967         return E_OUTOFMEMORY;
00968     }
00969
00970     //
00971     // Fill in the necessary fields for the event structure.
00972     //
00973
00974     pEventItem->MSPEventInfo.dwSize = sizeof(MSP_EVENT_INFO);
00975     pEventItem->MSPEventInfo.Event  = ME_CALL_EVENT;
00976
00977     ITTerminal * pTerminal = NULL;
00978
00979     if ( 0 != m_Terminals.GetSize() )
00980     {
00981         _ASSERTE( 1 == m_Terminals.GetSize() );
00982         pTerminal = m_Terminals[0];
00983         pTerminal->AddRef();
00984     }
00985
00986     ITStream * pStream = (ITStream *) this;
00987     pStream->AddRef();
00988
00989     pEventItem->MSPEventInfo.MSP_CALL_EVENT_INFO.Type      = type;
00990     pEventItem->MSPEventInfo.MSP_CALL_EVENT_INFO.Cause     = cause;
00991     pEventItem->MSPEventInfo.MSP_CALL_EVENT_INFO.pStream   = pStream;
00992     pEventItem->MSPEventInfo.MSP_CALL_EVENT_INFO.pTerminal = pTerminal;
00993     pEventItem->MSPEventInfo.MSP_CALL_EVENT_INFO.hrError   = hrError;
00994
00995
00996 #ifdef MSPLOG
00997     //
00998     // Spew some debug output to indicate what this is.
00999     //
01000
01001     char * pszType;
01002     DWORD dwLevel;
01003
01004     switch (type)
01005     {
01006     case CALL_NEW_STREAM:
01007         pszType = "CALL_NEW_STREAM (unexpected)";
01008         dwLevel = MSP_ERROR;
01009         break;
01010
01011     case CALL_STREAM_FAIL:
01012         pszType = "CALL_STREAM_FAIL";
01013         dwLevel = MSP_INFO;
01014         break;
01015
01016     case CALL_TERMINAL_FAIL:
01017         pszType = "CALL_TERMINAL_FAIL";
01018         dwLevel = MSP_INFO;
01019         break;
01020
01021     case CALL_STREAM_NOT_USED:
01022         pszType = "CALL_STREAM_NOT_USED (unexpected)";
01023         dwLevel = MSP_ERROR;
01024         break;
01025
01026     case CALL_STREAM_ACTIVE:
01027         pszType = "CALL_STREAM_ACTIVE";
01028         dwLevel = MSP_INFO;
01029         break;
01030
01031     case CALL_STREAM_INACTIVE:
01032         pszType = "CALL_STREAM_INACTIVE";
01033         dwLevel = MSP_INFO;
01034         break;
01035
01036     default:
01037         pszType = "UNKNOWN EVENT TYPE";
01038         dwLevel = MSP_ERROR;
01039         break;
01040     }
01041
01042     LOG((dwLevel, "CSampleMSPStream::FireEvent - "
01043                   "EVENT DUMP: type      = %s", pszType));
01044     LOG((dwLevel, "CSampleMSPStream::FireEvent - "
01045                   "EVENT DUMP: pStream   = %p", pStream));
01046     LOG((dwLevel, "CSampleMSPStream::FireEvent - "
01047                   "EVENT DUMP: pTerminal = %p", pTerminal));
01048     LOG((dwLevel, "CSampleMSPStream::FireEvent - "
01049                   "EVENT DUMP: hrError   = %08x", hrError));
01050
01051 #endif // ifdef MSPLOG
01052
01053     //
01054     // Send the event to the app.
01055     //
01056
01057     HRESULT hr = m_pMSPCall->HandleStreamEvent(pEventItem);
01058
01059     if (FAILED(hr))
01060     {
01061         LOG((MSP_ERROR, "CSampleMSPStream::FireEvent - "
01062             "HandleStreamEvent failed - returning 0x%08x", hr));
01063
01064         pStream->Release();
01065         pTerminal->Release();
01066
01067
01068         //
01069         // Note:
01070         //
01071         // MSPEVENTITEMs are allocated with AllocateEventItem and freed with
01072         // FreeEventItem
01073         //
01074
01075         FreeEventItem(pEventItem);
01076         pEventItem = NULL;
01077
01078         return hr;
01079     }
01080
01081     LOG((MSP_EVENT, "CSampleMSPStream::FireEvent - exit S_OK"));
01082
01083     return S_OK;
01084 }
01085
01086
01087 // eof
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/API.h Source File

  • WinBase
  • WtsApi
  • WtsApi

API.h

Go to the documentation of this file.
00001 // API.h : main header file for the API application
00002 //
00003 //  Copyright 1995-1998, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006
00007 #if !defined(AFX_API_H__C090CEEA_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
00008 #define AFX_API_H__C090CEEA_303B_11D1_8310_00C04FBEFCDA__INCLUDED_
00009
00010 #if _MSC_VER >= 1000
00011 #pragma once
00012 #endif // _MSC_VER >= 1000
00013
00014 #ifndef __AFXWIN_H__
00015   #error include 'stdafx.h' before including this file for PCH
00016 #endif
00017
00018 #include "resource.h"       // main symbols
00019
00020 //typedef VOID (CALLBACK* WTSCLOSESERVER)(HANDLE);
00021 //typedef VOID WINAPI (CALLBACK* WTSCLOSESERVER)(IN HANDLE hServer);
00022 //typedef (CALLBACK* WTSOPENSERVER)(HANDLE);
00023 //typedef (CALLBACK* WTSENUMERATESESSIONS)(HANDLE);
00024 //typedef (CALLBACK* WTSENUMERATEPROCESSES)(HANDLE);
00025 //extern WTSCLOSESERVER* pWTSCloseServer;
00026
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CAPIApp:
00030 // See API.cpp for the implementation of this class
00031 //
00032
00033 class CAPIApp : public CWinApp
00034 {
00035 public:
00036   CAPIApp();
00037
00038 // Overrides
00039   // ClassWizard generated virtual function overrides
00040   //{{AFX_VIRTUAL(CAPIApp)
00041   public:
00042   virtual BOOL InitInstance();
00043   //}}AFX_VIRTUAL
00044
00045 // Implementation
00046
00047   //{{AFX_MSG(CAPIApp)
00048   afx_msg void OnAppAbout();
00049   //}}AFX_MSG
00050   DECLARE_MESSAGE_MAP()
00051 };
00052
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055
00056 //{{AFX_INSERT_LOCATION}}
00057 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00058
00059 #endif // !defined(AFX_API_H__C090CEEA_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/BrochureMachine/BrochureMachine.idl Source File

  • Web
  • Browser
  • BrochureMachine

BrochureMachine.idl

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // BrochureMachine.idl : IDL source for BrochureMachine.dll
00006 //
00007
00008 // This file will be processed by the MIDL tool to
00009 // produce the type library (BrochureMachine.tlb) and marshalling code.
00010
00011 import "oaidl.idl";
00012 import "ocidl.idl";
00013   [
00014     object,
00015     uuid(A79007AB-EB8B-46DB-9225-5BF4BDD0BCAF),
00016     dual,
00017     helpstring("IPTLauncher Interface"),
00018     pointer_default(unique)
00019   ]
00020   interface IPTLauncher : IDispatch
00021   {
00022     [id(1), helpstring("method LaunchPT")] HRESULT LaunchPT();
00023   };
00024
00025 [
00026   uuid(083432E4-7D93-43A8-96A5-37533C055A8E),
00027   version(1.0),
00028   helpstring("BrochureMachine 1.0 Type Library")
00029 ]
00030 library BROCHUREMACHINELib
00031 {
00032   importlib("stdole32.tlb");
00033   importlib("stdole2.tlb");
00034
00035   [
00036     uuid(B43D3361-D975-4BE2-87FE-438AB8E74394),
00037     helpstring("PTLauncher Class")
00038   ]
00039   coclass PTLauncher
00040   {
00041     [default] interface IPTLauncher;
00042   };
00043 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/x224.cpp Source File

  • Web
  • NetMeeting
  • PlugTransport

x224.cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     PLUGTRANSPORT.EXE
00003 //  File:       X224.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018
00019 //****************************************************************************
00020 //
00021 //    FUNCTION:   CX224::CX224()
00022 //
00023 //    PURPOSE:    Construction
00024
00025 //    COMMENTS:
00026 //
00027 //
00028 //****************************************************************************
00029
00030 CX224::CX224()
00031 {
00032     m_hListenSocket = INVALID_SOCKET;
00033     m_hSocket = INVALID_SOCKET;
00034     m_szHostName[0] = '\0';
00035 }
00036
00037
00038 //****************************************************************************
00039 //
00040 //    FUNCTION:   CX224::~CX224()
00041 //
00042 //    PURPOSE:    Destruction
00043
00044 //    COMMENTS:
00045 //
00046 //
00047 //****************************************************************************
00048
00049 CX224::~CX224()
00050 {}
00051
00052
00053 //****************************************************************************
00054 //
00055 //    FUNCTION:   HRESULT CX224::CreateListenSocket(HWND hwnd)
00056 //
00057 //    PURPOSE:    Creates a listen socket ready to accept connections
00058
00059 //    COMMENTS:
00060 //
00061 //
00062 //****************************************************************************
00063
00064 HRESULT CX224::CreateListenSocket(HWND hwnd)
00065 {
00066     SOCKADDR_IN socket_control;
00067     SOCKET      socket_number   = INVALID_SOCKET;
00068
00069     // We are already have created a listenning socket
00070     if (m_hListenSocket != INVALID_SOCKET)
00071         return S_OK;
00072
00073     // Create the listening socket.
00074     socket_number = ::socket(AF_INET, SOCK_STREAM, 0);
00075     if (INVALID_SOCKET == socket_number)
00076         return E_FAIL;
00077
00078     // The listen socket only waits for FD_ACCEPT msgs.
00079     int nRet = ::WSAAsyncSelect(socket_number, hwnd, WM_PLUGABLE_SOCKET, FD_ACCEPT);
00080     if (SOCKET_ERROR == nRet)
00081         return E_FAIL;
00082
00083
00084     // Load the socket control structure with the parameters necessary.
00085     // Internet socket
00086     // Let it assign any address to this socket
00087     // Assign our port number
00088     socket_control.sin_family = AF_INET;
00089     socket_control.sin_addr.s_addr = INADDR_ANY;
00090     socket_control.sin_port = htons(PLUGABLE_PORT_NUMBER);
00091
00092     char * szReuse = "1";
00093     nRet = setsockopt(socket_number, SOL_SOCKET, SO_REUSEADDR, szReuse, sizeof(int));
00094
00095     // Issue the bind call
00096     nRet = ::bind(socket_number, (LPSOCKADDR) &socket_control, sizeof(SOCKADDR_IN));
00097     if (SOCKET_ERROR == nRet)
00098     {
00099         return E_FAIL;
00100     }
00101
00102     // Issue a listen to WinSock to tell it we are willing to accept calls.
00103     // This is a non-blocking listen, therefore we will receive FD_ACCEPT
00104     // if someone is trying to call us.
00105     nRet =::listen(socket_number, 3); // LISTEN_QUEUE_SIZE
00106     if (SOCKET_ERROR == nRet)
00107         return E_FAIL;
00108
00109     m_hListenSocket = socket_number;
00110     return S_OK;
00111 }
00112
00113
00114 //****************************************************************************
00115 //
00116 //    FUNCTION:   HRESULT CX224::CreateConnectSocket(HWND hwnd, LPSTR pszHostName)
00117 //
00118 //    PURPOSE:    Creates a socket and establishes a connection to it
00119
00120 //    COMMENTS:
00121 //
00122 //
00123 //****************************************************************************
00124
00125 HRESULT CX224::CreateConnectSocket(HWND hwnd, LPSTR pszHostName)
00126 {
00127     SOCKET      socket_number   = INVALID_SOCKET;
00128     u_short     uPort           = PLUGABLE_PORT_NUMBER;
00129     PHOSTENT    phe             = NULL;
00130     SOCKADDR_IN socket_control;
00131     DWORD       dwIPAddress     = 0;
00132
00133     lstrcpyn(m_szHostName, pszHostName, MAXHOSTNAMELENGTH);
00134
00135     // create the connect socket
00136     socket_number = ::socket(AF_INET, SOCK_STREAM, 0);
00137     if (INVALID_SOCKET == socket_number)
00138         return HRESULT_FROM_WIN32(WSAGetLastError());
00139
00140     // Enable Tx and Rx messages to the window
00141     int nRet = ::WSAAsyncSelect(socket_number, hwnd, WM_PLUGABLE_SOCKET,
00142                            FD_READ | FD_WRITE | FD_CLOSE | FD_CONNECT);
00143     if (SOCKET_ERROR == nRet)
00144         return E_FAIL;
00145
00146     // fill in other info in SockAddr
00147     ::ZeroMemory(&socket_control, sizeof(socket_control));
00148     socket_control.sin_family = AF_INET;
00149     socket_control.sin_port = htons (PLUGABLE_PORT_NUMBER);
00150
00151     // get server's IP address
00152     dwIPAddress = ::inet_addr(m_szHostName);
00153     if (dwIPAddress != INADDR_NONE)
00154     {
00155         *((PDWORD) &socket_control.sin_addr) = dwIPAddress;
00156     }
00157     else
00158     {
00159         phe = ::gethostbyname(m_szHostName);
00160         if (NULL == phe)
00161         {
00162             return 0;
00163         }
00164
00165         ::CopyMemory(&socket_control.sin_addr, phe->h_addr, phe->h_length);
00166     }
00167
00168     // Attempt a connection to the remote site
00169     nRet = ::connect(socket_number, (const struct sockaddr *) &socket_control, sizeof(socket_control));
00170 //    if (SOCKET_ERROR == nRet) //&& WSAEWOULDBLOCK != ::WSAGetLastError())
00171 //        return E_FAIL;
00172
00173     m_hSocket = socket_number;
00174     return S_OK;
00175 }
00176
00177
00178 //****************************************************************************
00179 //
00180 //    FUNCTION:   HRESULT CX224::CreateAcceptSocket(HWND hWnd)
00181 //
00182 //    PURPOSE:    Accepts an incoming connection attempt on a socket
00183
00184 //    COMMENTS:
00185 //
00186 //
00187 //****************************************************************************
00188
00189 HRESULT CX224::CreateAcceptSocket(HWND hWnd)
00190 {
00191     SOCKADDR_IN socket_control;
00192     int         size    = sizeof(socket_control);
00193     int         nRet    = 0;
00194
00195     m_hSocket = accept(m_hListenSocket, (struct sockaddr *) &socket_control, &size);
00196     if (INVALID_SOCKET == m_hSocket)
00197     {
00198         return HRESULT_FROM_WIN32(WSAGetLastError());
00199     }
00200
00201     nRet = ::WSAAsyncSelect(    m_hSocket,
00202                                 hWnd,
00203                                 WM_PLUGABLE_SOCKET,
00204                                 FD_READ | FD_WRITE | FD_CLOSE | FD_CONNECT);
00205     if (SOCKET_ERROR == nRet)
00206        return E_FAIL;
00207
00208     return S_OK;
00209 }
00210
00211
00212 //****************************************************************************
00213 //
00214 //    FUNCTION:   LPSTR CX224::SetAndGetHostName()
00215 //
00216 //    PURPOSE:    Sets and returns the host name of the machine where
00217 //                the application runs
00218
00219 //    COMMENTS:
00220 //
00221 //
00222 //****************************************************************************
00223
00224 LPSTR CX224::SetAndGetHostName()
00225 {
00226     gethostname(m_szHostName, MAXHOSTNAMELENGTH);
00227     return m_szHostName;
00228 }
00229
00230
00231 //****************************************************************************
00232 //
00233 //    FUNCTION:   HRESULT CX224::CloseSocket()
00234 //
00235 //    PURPOSE:
00236
00237 //    COMMENTS:
00238 //
00239 //
00240 //****************************************************************************
00241
00242 HRESULT CX224::CloseSocket()
00243 {
00244     HRESULT hr = S_FALSE;
00245
00246     if (m_hSocket != INVALID_SOCKET)
00247     {
00248         closesocket(m_hListenSocket);
00249         m_hSocket = INVALID_SOCKET;
00250         hr = S_OK;
00251     }
00252
00253     // close listen socket also
00254     CloseListenSocket();
00255
00256     return hr;
00257 }
00258
00259
00260 //****************************************************************************
00261 //
00262 //    FUNCTION:   HRESULT CX224::CloseListenSocket()
00263 //
00264 //    PURPOSE:    Close the listen socket. We stop accepting new connections after it
00265
00266 //    COMMENTS:
00267 //
00268 //
00269 //****************************************************************************
00270
00271 HRESULT CX224::CloseListenSocket()
00272 {
00273     if (m_hListenSocket != INVALID_SOCKET)
00274     {
00275         closesocket(m_hListenSocket);
00276         m_hListenSocket = INVALID_SOCKET;
00277         return S_OK;
00278     }
00279
00280     return S_FALSE;
00281 }
00282
00283
00284 //****************************************************************************
00285 //
00286 //    FUNCTION:   SOCKET CX224::GetSocket()
00287 //
00288 //    PURPOSE:
00289
00290 //    COMMENTS:
00291 //
00292 //
00293 //****************************************************************************
00294
00295 SOCKET CX224::GetSocket()
00296 {
00297   return m_hSocket;
00298 }
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ShlView.Cpp Source File

  • WinUI
  • Shell
  • SampView

ShlView.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ShlView.cpp
00013
00014    Description:   Implements IShellView.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "ShlView.h"
00023 #include "Guid.h"
00024 #include "Commands.h"
00025 #include "resource.h"
00026 #include "Tools.h"
00027 #include "ViewList.h"
00028 #include "DropSrc.h"
00029
00030 /**************************************************************************
00031    global variables
00032 **************************************************************************/
00033
00034 MYTOOLINFO g_Tools[] =
00035    {
00036    IDB_VIEW_SMALL_COLOR, IDM_NEW_FOLDER, VIEW_NEWFOLDER, IDS_NEW_FOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON,
00037    IDB_STD_SMALL_COLOR, IDM_NEW_ITEM, STD_FILENEW, IDS_NEW_ITEM, TBSTATE_ENABLED, TBSTYLE_BUTTON,
00038    0, IDM_SEPARATOR, 0, 0, 0, TBSTYLE_SEP,
00039    IDB_VIEW_SMALL_COLOR, IDM_VIEW_LARGE, VIEW_LARGEICONS, IDS_VIEW_LARGE, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
00040    IDB_VIEW_SMALL_COLOR, IDM_VIEW_SMALL, VIEW_SMALLICONS, IDS_VIEW_SMALL, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
00041    IDB_VIEW_SMALL_COLOR, IDM_VIEW_LIST, VIEW_LIST, IDS_VIEW_LIST, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
00042    IDB_VIEW_SMALL_COLOR, IDM_VIEW_DETAILS, VIEW_DETAILS, IDS_VIEW_DETAILS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP,
00043    0, (UINT)-1, 0, 0, 0, 0,
00044    };
00045
00046 extern CViewList  *g_pViewList;
00047
00048 /**************************************************************************
00049
00050    CShellView::CShellView()
00051
00052 **************************************************************************/
00053
00054 CShellView::CShellView(CShellFolder *pFolder, LPCITEMIDLIST pidl)
00055 {
00056 g_DllRefCount++;
00057
00058 #ifdef INITCOMMONCONTROLSEX
00059
00060 INITCOMMONCONTROLSEX iccex;
00061 iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00062 iccex.dwICC = ICC_LISTVIEW_CLASSES;
00063 InitCommonControlsEx(&iccex);
00064
00065 #else
00066
00067 InitCommonControls();
00068
00069 #endif   //INITCOMMONCONTROLSEX
00070
00071 m_hMenu = NULL;
00072 m_fInEdit = FALSE;
00073 m_hAccels = LoadAccelerators(g_hInst, MAKEINTRESOURCE(IDR_ACCELS));
00074
00075 m_pPidlMgr = new CPidlMgr();
00076 if(!m_pPidlMgr)
00077    {
00078    delete this;
00079    return;
00080    }
00081
00082 m_psfParent = pFolder;
00083 if(m_psfParent)
00084    m_psfParent->AddRef();
00085
00086 //get the shell's IMalloc pointer
00087 //we'll keep this until we get destroyed
00088 if(FAILED(SHGetMalloc(&m_pMalloc)))
00089    {
00090    delete this;
00091    return;
00092    }
00093
00094 m_pidl = m_pPidlMgr->Copy(pidl);
00095
00096 m_uState = SVUIA_DEACTIVATE;
00097
00098 if(g_pViewList)
00099    g_pViewList->AddToList(this);
00100
00101 m_ObjRefCount = 1;
00102 }
00103
00104 /**************************************************************************
00105
00106    CShellView::~CShellView()
00107
00108 **************************************************************************/
00109
00110 CShellView::~CShellView()
00111 {
00112 if(g_pViewList)
00113    g_pViewList->RemoveFromList(this);
00114
00115 if(m_pidl)
00116    {
00117    m_pPidlMgr->Delete(m_pidl);
00118    m_pidl = NULL;
00119    }
00120
00121 if(m_psfParent)
00122    m_psfParent->Release();
00123
00124 if(m_pMalloc)
00125    {
00126    m_pMalloc->Release();
00127    }
00128
00129 if(m_pPidlMgr)
00130    {
00131    delete m_pPidlMgr;
00132    }
00133
00134 g_DllRefCount--;
00135 }
00136
00137 ///////////////////////////////////////////////////////////////////////////
00138 //
00139 // IUnknown Implementation
00140 //
00141
00142 /**************************************************************************
00143
00144    CShellView::QueryInterface
00145
00146 **************************************************************************/
00147
00148 STDMETHODIMP CShellView::QueryInterface(REFIID riid, LPVOID *ppReturn)
00149 {
00150 *ppReturn = NULL;
00151
00152 //IUnknown
00153 if(IsEqualIID(riid, IID_IUnknown))
00154    {
00155    *ppReturn = this;
00156    }
00157
00158 //IOleWindow
00159 else if(IsEqualIID(riid, IID_IOleWindow))
00160    {
00161    *ppReturn = (IOleWindow*)this;
00162    }
00163
00164 //IShellView
00165 else if(IsEqualIID(riid, IID_IShellView))
00166    {
00167    *ppReturn = (IShellView*)this;
00168    }
00169
00170 if(*ppReturn)
00171    {
00172    (*(LPUNKNOWN*)ppReturn)->AddRef();
00173    return S_OK;
00174    }
00175
00176 return E_NOINTERFACE;
00177 }
00178
00179 /**************************************************************************
00180
00181    CShellView::AddRef
00182
00183 **************************************************************************/
00184
00185 STDMETHODIMP_(DWORD) CShellView::AddRef()
00186 {
00187 return ++m_ObjRefCount;
00188 }
00189
00190
00191 /**************************************************************************
00192
00193    CShellView::Release
00194
00195 **************************************************************************/
00196
00197 STDMETHODIMP_(DWORD) CShellView::Release()
00198 {
00199 if(--m_ObjRefCount == 0)
00200    {
00201    delete this;
00202    return 0;
00203    }
00204
00205 return m_ObjRefCount;
00206 }
00207
00208 ///////////////////////////////////////////////////////////////////////////
00209 //
00210 // IOleWindow Implementation
00211 //
00212
00213 /**************************************************************************
00214
00215    CShellView::GetWindow()
00216
00217 **************************************************************************/
00218
00219 STDMETHODIMP CShellView::GetWindow(HWND *phWnd)
00220 {
00221 *phWnd = m_hWnd;
00222
00223 return S_OK;
00224 }
00225
00226 /**************************************************************************
00227
00228    CShellView::ContextSensitiveHelp()
00229
00230 **************************************************************************/
00231
00232 STDMETHODIMP CShellView::ContextSensitiveHelp(BOOL fEnterMode)
00233 {
00234 return E_NOTIMPL;
00235 }
00236
00237 ///////////////////////////////////////////////////////////////////////////
00238 //
00239 // IShellView Implementation
00240 //
00241
00242 /**************************************************************************
00243
00244    CShellView::TranslateAccelerator()
00245
00246 **************************************************************************/
00247
00248 STDMETHODIMP CShellView::TranslateAccelerator(LPMSG pmsg)
00249 {
00250 if(m_fInEdit)
00251    {
00252    if((pmsg->message >= WM_KEYFIRST) && (pmsg->message <= WM_KEYLAST))
00253       {
00254       TranslateMessage(pmsg);
00255       DispatchMessage(pmsg);
00256       return S_OK;
00257       }
00258    }
00259 else if(::TranslateAccelerator(m_hWnd, m_hAccels, pmsg))
00260    return S_OK;
00261
00262 return S_FALSE;
00263 }
00264
00265 /**************************************************************************
00266
00267    CShellView::EnableModeless()
00268
00269 **************************************************************************/
00270
00271 STDMETHODIMP CShellView::EnableModeless(BOOL fEnable)
00272 {
00273 return E_NOTIMPL;
00274 }
00275
00276 /**************************************************************************
00277
00278    CShellView::OnActivate()
00279
00280 **************************************************************************/
00281
00282 LRESULT CShellView::OnActivate(UINT uState)
00283 {
00284 //don't do anything if the state isn't really changing
00285 if(m_uState == uState)
00286    return S_OK;
00287
00288 OnDeactivate();
00289
00290 //only do this if we are active
00291 if(uState != SVUIA_DEACTIVATE)
00292    {
00293    //merge the menus
00294    m_hMenu = CreateMenu();
00295
00296    if(m_hMenu)
00297       {
00298     OLEMENUGROUPWIDTHS   omw = {0, 0, 0, 0, 0, 0};
00299       MENUITEMINFO         mii;
00300
00301       m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
00302
00303       //add your top level sub-menu here, if desired
00304
00305       //get the view menu so we can merge with it
00306       ZeroMemory(&mii, sizeof(mii));
00307       mii.cbSize = sizeof(mii);
00308       mii.fMask = MIIM_SUBMENU;
00309
00310       //merge our items into the File menu
00311       if(GetMenuItemInfo(m_hMenu, FCIDM_MENU_FILE, FALSE, &mii))
00312          {
00313          MergeFileMenu(mii.hSubMenu, (BOOL)(SVUIA_ACTIVATE_FOCUS == uState));
00314          }
00315
00316       //merge our items into the Edit menu
00317       if(GetMenuItemInfo(m_hMenu, FCIDM_MENU_EDIT, FALSE, &mii))
00318          {
00319          MergeEditMenu(mii.hSubMenu, (BOOL)(SVUIA_ACTIVATE_FOCUS == uState));
00320          }
00321
00322       //merge our items into the View menu
00323       if(GetMenuItemInfo(m_hMenu, FCIDM_MENU_VIEW, FALSE, &mii))
00324          {
00325          MergeViewMenu(mii.hSubMenu);
00326          }
00327
00328       //add the items that should only be added if we have the focus
00329       if(SVUIA_ACTIVATE_FOCUS == uState)
00330          {
00331          }
00332
00333       m_pShellBrowser->SetMenuSB(m_hMenu, NULL, m_hWnd);
00334       }
00335    }
00336
00337 m_uState = uState;
00338
00339 UpdateToolbar();
00340
00341 return 0;
00342 }
00343
00344 /**************************************************************************
00345
00346    CShellView::OnDeactivate()
00347
00348 **************************************************************************/
00349
00350 VOID CShellView::OnDeactivate(VOID)
00351 {
00352 if(m_uState != SVUIA_DEACTIVATE)
00353    {
00354    if(m_hMenu)
00355       {
00356       m_pShellBrowser->SetMenuSB(NULL, NULL, NULL);
00357
00358       m_pShellBrowser->RemoveMenusSB(m_hMenu);
00359
00360       DestroyMenu(m_hMenu);
00361
00362       m_hMenu = NULL;
00363       }
00364
00365    m_uState = SVUIA_DEACTIVATE;
00366    }
00367 }
00368
00369 /**************************************************************************
00370
00371    CShellView::UIActivate()
00372
00373    This function activates the view window. Note that activating it
00374    will not change the focus, while setting the focus will activate it.
00375
00376
00377 **************************************************************************/
00378
00379 STDMETHODIMP CShellView::UIActivate(UINT uState)
00380 {
00381 //don't do anything if the state isn't really changing
00382 if(m_uState == uState)
00383    return S_OK;
00384
00385 //OnActivate handles the menu merging and internal state
00386 OnActivate(uState);
00387
00388 //only do this if we are active
00389 if(uState != SVUIA_DEACTIVATE)
00390    {
00391    TCHAR szName[MAX_PATH] = TEXT("");
00392    LRESULT  lResult;
00393    int      nPartArray[1] = {-1};
00394
00395    //update the status bar
00396    //set the number of parts
00397    m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, 1, (LPARAM)nPartArray, &lResult);
00398
00399    //set the text for the parts
00400    m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETTEXT, 0, (LPARAM)g_szExtTitle, &lResult);
00401    }
00402
00403 return S_OK;
00404 }
00405
00406 /**************************************************************************
00407
00408    CShellView::MergeFileMenu()
00409
00410 **************************************************************************/
00411
00412 VOID CShellView::MergeFileMenu(HMENU hMenu, BOOL fFocus)
00413 {
00414 MENUITEMINFO   mii;
00415 UINT           uPos = 0;
00416
00417 ZeroMemory(&mii, sizeof(mii));
00418
00419 //uPos += AddFileMenuItems(hMenu, 0, IDM_SEPARATOR, FALSE);
00420 uPos += AddFileMenuItems(hMenu, 0, 0, TRUE);
00421
00422 //add a separator
00423 mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00424 mii.fType = MFT_SEPARATOR;
00425 mii.wID = IDM_SEPARATOR;
00426 mii.fState = MFS_ENABLED;
00427
00428 //insert this item at the beginning of the menu
00429 InsertMenuItem(hMenu, uPos, TRUE, &mii);
00430 uPos++;
00431
00432 if(fFocus)
00433    {
00434    TCHAR szText[MAX_PATH];
00435
00436    //add the Delete item
00437    LoadString(g_hInst, IDS_DELETE, szText, sizeof(szText));
00438    mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00439    mii.fType = MFT_STRING;
00440    mii.fState = MFS_ENABLED;
00441    mii.dwTypeData = szText;
00442    mii.wID = IDM_DELETE;
00443    InsertMenuItem(hMenu, uPos, TRUE, &mii);
00444    uPos++;
00445
00446    //add the Rename item
00447    LoadString(g_hInst, IDS_RENAME, szText, sizeof(szText));
00448    mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00449    mii.fType = MFT_STRING;
00450    mii.fState = MFS_ENABLED;
00451    mii.dwTypeData = szText;
00452    mii.wID = IDM_RENAME;
00453    InsertMenuItem(hMenu, uPos, TRUE, &mii);
00454    uPos++;
00455
00456    //add a separator
00457    mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00458    mii.fType = MFT_SEPARATOR;
00459    mii.wID = IDM_SEPARATOR;
00460    mii.fState = MFS_ENABLED;
00461    InsertMenuItem(hMenu, uPos, TRUE, &mii);
00462    uPos++;
00463    }
00464 }
00465
00466 /**************************************************************************
00467
00468    CShellView::MergeViewMenu()
00469
00470 **************************************************************************/
00471
00472 VOID CShellView::MergeViewMenu(HMENU hMenu)
00473 {
00474 MENUITEMINFO   mii;
00475
00476 ZeroMemory(&mii, sizeof(mii));
00477 mii.cbSize = sizeof(mii);
00478
00479 //add a separator at the correct position in the menu
00480 mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00481 mii.fType = MFT_SEPARATOR;
00482 mii.wID = IDM_SEPARATOR;
00483 mii.fState = MFS_ENABLED;
00484 InsertMenuItem(hMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii);
00485
00486 AddViewMenuItems(hMenu, 0, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE);
00487 }
00488
00489 /**************************************************************************
00490
00491    CShellView::MergeEditMenu()
00492
00493 **************************************************************************/
00494
00495 VOID CShellView::MergeEditMenu(HMENU hMenu, BOOL fFocus)
00496 {
00497 if(hMenu)
00498    {
00499    MENUITEMINFO   mii;
00500    TCHAR          szText[MAX_PATH];
00501
00502    ZeroMemory(&mii, sizeof(mii));
00503    mii.cbSize = sizeof(mii);
00504
00505    if(fFocus)
00506       {
00507       LoadString(g_hInst, IDS_CUT, szText, sizeof(szText));
00508       mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00509       mii.fType = MFT_STRING;
00510       mii.fState = MFS_ENABLED;
00511       mii.dwTypeData = szText;
00512       mii.wID = IDM_CUT;
00513       InsertMenuItem(hMenu, (UINT)-1, TRUE, &mii);
00514
00515       LoadString(g_hInst, IDS_COPY, szText, sizeof(szText));
00516       mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00517       mii.fType = MFT_STRING;
00518       mii.fState = MFS_ENABLED;
00519       mii.dwTypeData = szText;
00520       mii.wID = IDM_COPY;
00521       InsertMenuItem(hMenu, (UINT)-1, TRUE, &mii);
00522       }
00523
00524    //add the paste menu items at the correct position in the menu
00525    LoadString(g_hInst, IDS_PASTE, szText, sizeof(szText));
00526    mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
00527    mii.fType = MFT_STRING;
00528    mii.fState = MFS_ENABLED;
00529    mii.dwTypeData = szText;
00530    mii.wID = IDM_PASTE;
00531    InsertMenuItem(hMenu, (UINT)-1, TRUE, &mii);
00532    }
00533 }
00534
00535 /**************************************************************************
00536
00537    CShellView::MergeToolbar()
00538
00539 **************************************************************************/
00540
00541 VOID CShellView::MergeToolbar(VOID)
00542 {
00543 int         i;
00544 TBADDBITMAP tbab;
00545 LRESULT     lStdOffset;
00546 LRESULT     lViewOffset;
00547
00548 m_pShellBrowser->SetToolbarItems(NULL, 0, FCT_MERGE);
00549
00550 tbab.hInst = HINST_COMMCTRL;
00551 tbab.nID = (int)IDB_STD_SMALL_COLOR;
00552 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ADDBITMAP, 0, (LPARAM)&tbab, &lStdOffset);
00553
00554 tbab.hInst = HINST_COMMCTRL;
00555 tbab.nID = (int)IDB_VIEW_SMALL_COLOR;
00556 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ADDBITMAP, 0, (LPARAM)&tbab, &lViewOffset);
00557
00558 //get the number of items in tool array
00559 for(i = 0; -1 != g_Tools[i].idCommand; i++)
00560    {
00561    }
00562
00563 LPTBBUTTON  ptbb = (LPTBBUTTON)GlobalAlloc(GPTR, sizeof(TBBUTTON) * i);
00564
00565 if(ptbb)
00566    {
00567    for(i = 0; -1 != g_Tools[i].idCommand; i++)
00568       {
00569       (ptbb + i)->iBitmap = 0;
00570       switch(g_Tools[i].uImageSet)
00571          {
00572          case IDB_STD_SMALL_COLOR:
00573             (ptbb + i)->iBitmap = (int)lStdOffset + g_Tools[i].iImage;
00574             break;
00575
00576          case IDB_VIEW_SMALL_COLOR:
00577             (ptbb + i)->iBitmap = (int)lViewOffset + g_Tools[i].iImage;
00578             break;
00579          }
00580
00581       (ptbb + i)->idCommand = g_Tools[i].idCommand;
00582       (ptbb + i)->fsState = g_Tools[i].bState;
00583       (ptbb + i)->fsStyle = g_Tools[i].bStyle;
00584       (ptbb + i)->dwData = 0;
00585       (ptbb + i)->iString = 0;
00586       }
00587
00588    m_pShellBrowser->SetToolbarItems(ptbb, i, FCT_MERGE);
00589
00590    GlobalFree((HGLOBAL)ptbb);
00591    }
00592
00593 UpdateToolbar();
00594 }
00595
00596 /**************************************************************************
00597
00598    CShellView::Refresh()
00599
00600 **************************************************************************/
00601
00602 STDMETHODIMP CShellView::Refresh(VOID)
00603 {
00604 //empty the list
00605 ListView_DeleteAllItems(m_hwndList);
00606
00607 //refill the list
00608 FillList();
00609
00610 return S_OK;
00611 }
00612
00613 /**************************************************************************
00614
00615    CShellView::CreateViewWindow()
00616
00617 **************************************************************************/
00618
00619 STDMETHODIMP CShellView::CreateViewWindow(   LPSHELLVIEW pPrevView,
00620                                              LPCFOLDERSETTINGS lpfs,
00621                                              LPSHELLBROWSER psb,
00622                                              LPRECT prcView,
00623                                              HWND *phWnd)
00624 {
00625 WNDCLASS wc;
00626
00627 *phWnd = NULL;
00628
00629 //if our window class has not been registered, then do so
00630 if(!GetClassInfo(g_hInst, NS_CLASS_NAME, &wc))
00631    {
00632    ZeroMemory(&wc, sizeof(wc));
00633    wc.style          = CS_HREDRAW | CS_VREDRAW;
00634    wc.lpfnWndProc    = (WNDPROC)WndProc;
00635    wc.cbClsExtra     = 0;
00636    wc.cbWndExtra     = 0;
00637    wc.hInstance      = g_hInst;
00638    wc.hIcon          = NULL;
00639    wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00640    wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW + 1);
00641    wc.lpszMenuName   = NULL;
00642    wc.lpszClassName  = NS_CLASS_NAME;
00643
00644    if(!RegisterClass(&wc))
00645       return E_FAIL;
00646    }
00647
00648 //set up the member variables
00649 m_pShellBrowser = psb;
00650 m_FolderSettings = *lpfs;
00651
00652 //get our parent window
00653 m_pShellBrowser->GetWindow(&m_hwndParent);
00654
00655 *phWnd = CreateWindowEx(   0,
00656                            NS_CLASS_NAME,
00657                            NULL,
00658                            WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
00659                            prcView->left,
00660                            prcView->top,
00661                            prcView->right - prcView->left,
00662                            prcView->bottom - prcView->top,
00663                            m_hwndParent,
00664                            NULL,
00665                            g_hInst,
00666                            (LPVOID)this);
00667
00668 if(!*phWnd)
00669    return E_FAIL;
00670
00671 MergeToolbar();
00672
00673 m_pShellBrowser->AddRef();
00674
00675 return S_OK;
00676 }
00677
00678 /**************************************************************************
00679
00680    CShellView::DestroyViewWindow()
00681
00682 **************************************************************************/
00683
00684 STDMETHODIMP CShellView::DestroyViewWindow(VOID)
00685 {
00686 //Make absolutely sure all our UI is cleaned up.
00687 UIActivate(SVUIA_DEACTIVATE);
00688
00689 if(m_hMenu)
00690    DestroyMenu(m_hMenu);
00691
00692 DestroyWindow(m_hWnd);
00693
00694 //release the shell browser object
00695 m_pShellBrowser->Release();
00696
00697 return S_OK;
00698 }
00699
00700 /**************************************************************************
00701
00702    CShellView::GetCurrentInfo()
00703
00704 **************************************************************************/
00705
00706 STDMETHODIMP CShellView::GetCurrentInfo(LPFOLDERSETTINGS lpfs)
00707 {
00708 *lpfs = m_FolderSettings;
00709
00710 return S_OK;
00711 }
00712
00713 /**************************************************************************
00714
00715    CShellView::AddPropertySheetPages()
00716
00717 **************************************************************************/
00718
00719 STDMETHODIMP CShellView::AddPropertySheetPages( DWORD dwReserved,
00720                                                 LPFNADDPROPSHEETPAGE lpfn,
00721                                                 LPARAM lParam)
00722 {
00723 return E_NOTIMPL;
00724 }
00725
00726 /**************************************************************************
00727
00728    CShellView::SaveViewState()
00729
00730 **************************************************************************/
00731
00732 STDMETHODIMP CShellView::SaveViewState(VOID)
00733 {
00734 return S_OK;
00735 }
00736
00737 /**************************************************************************
00738
00739    CShellView::SelectItem()
00740
00741 **************************************************************************/
00742
00743 STDMETHODIMP CShellView::SelectItem(LPCITEMIDLIST pidlItem, UINT uFlags)
00744 {
00745 return E_NOTIMPL;
00746 }
00747
00748 /**************************************************************************
00749
00750    CShellView::GetItemObject()
00751
00752 **************************************************************************/
00753
00754 STDMETHODIMP CShellView::GetItemObject(UINT uItem, REFIID riid, LPVOID *ppvOut)
00755 {
00756 *ppvOut = NULL;
00757
00758 return E_NOTIMPL;
00759 }
00760
00761
00762 /**************************************************************************
00763
00764    CShellView::WndProc()
00765
00766 **************************************************************************/
00767
00768 LRESULT CALLBACK CShellView::WndProc(  HWND hWnd,
00769                                        UINT uMessage,
00770                                        WPARAM wParam,
00771                                        LPARAM lParam)
00772 {
00773 CShellView  *pThis = (CShellView*)GetWindowLongPtr(hWnd, VIEW_POINTER_OFFSET);
00774
00775 switch (uMessage)
00776    {
00777    case WM_NCCREATE:
00778       {
00779       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00780       pThis = (CShellView*)(lpcs->lpCreateParams);
00781       SetWindowLongPtr(hWnd, VIEW_POINTER_OFFSET, (LONG_PTR)pThis);
00782
00783       //set the window handle
00784       pThis->m_hWnd = hWnd;
00785       }
00786       break;
00787
00788    case WM_SIZE:
00789       return pThis->OnSize(LOWORD(lParam), HIWORD(lParam));
00790
00791    case WM_CREATE:
00792       return pThis->OnCreate();
00793
00794    case WM_DESTROY:
00795       return pThis->OnDestroy();
00796
00797    case WM_SETFOCUS:
00798       return pThis->OnSetFocus();
00799
00800    case WM_KILLFOCUS:
00801       return pThis->OnKillFocus();
00802
00803    case WM_ACTIVATE:
00804       return pThis->OnActivate(SVUIA_ACTIVATE_FOCUS);
00805
00806    case WM_COMMAND:
00807       return pThis->OnCommand(   GET_WM_COMMAND_ID(wParam, lParam),
00808                                  GET_WM_COMMAND_CMD(wParam, lParam),
00809                                  GET_WM_COMMAND_HWND(wParam, lParam));
00810
00811    case WM_INITMENUPOPUP:
00812       return pThis->UpdateMenu((HMENU)wParam);
00813
00814    case WM_NOTIFY:
00815       return pThis->OnNotify((UINT)wParam, (LPNMHDR)lParam);
00816
00817    case WM_SETTINGCHANGE:
00818       return pThis->OnSettingChange((LPCTSTR)lParam);
00819
00820    case WM_CONTEXTMENU:
00821       {
00822       pThis->DoContextMenu(LOWORD(lParam), HIWORD(lParam), FALSE, (UINT)-1);
00823       return 0;
00824       }
00825    }
00826
00827 return DefWindowProc(hWnd, uMessage, wParam, lParam);
00828 }
00829
00830 /**************************************************************************
00831
00832    CShellView::OnSetFocus()
00833
00834 **************************************************************************/
00835
00836 LRESULT CShellView::OnSetFocus(VOID)
00837 {
00838 /*
00839 Tell the browser one of our windows has received the focus. This should always
00840 be done before merging menus (OnActivate merges the menus) if one of our
00841 windows has the focus.
00842 */
00843 m_pShellBrowser->OnViewWindowActive(this);
00844
00845 OnActivate(SVUIA_ACTIVATE_FOCUS);
00846
00847 return 0;
00848 }
00849
00850 /**************************************************************************
00851
00852    CShellView::OnKillFocus()
00853
00854 **************************************************************************/
00855
00856 LRESULT CShellView::OnKillFocus(VOID)
00857 {
00858 OnActivate(SVUIA_ACTIVATE_NOFOCUS);
00859
00860 return 0;
00861 }
00862
00863 /**************************************************************************
00864
00865    CShellView::OnCommand()
00866
00867 **************************************************************************/
00868
00869 LRESULT CShellView::OnCommand(DWORD dwCmdID, DWORD dwCmd, HWND hwndCmd)
00870 {
00871 //ignore command messages while in edit mode
00872 if(m_fInEdit)
00873    return 0;
00874
00875 DoContextMenu(0, 0, FALSE, dwCmdID);
00876
00877 return 0;
00878 }
00879
00880 /**************************************************************************
00881
00882    CShellView::UpdateMenu()
00883
00884 **************************************************************************/
00885
00886 LRESULT CShellView::UpdateMenu(HMENU hMenu)
00887 {
00888 UINT  uCommand;
00889
00890 //enable/disable your menu items here
00891 OpenClipboard(NULL);
00892 HGLOBAL  hClip = GetClipboardData(RegisterClipboardFormat(CFSTR_SAMPVIEWDATA));
00893 CloseClipboard();
00894
00895 EnableMenuItem(hMenu, IDM_PASTE, MF_BYCOMMAND | (hClip ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
00896
00897 uCommand = ListView_GetSelectedCount(m_hwndList);
00898 EnableMenuItem(hMenu, IDM_CUT, MF_BYCOMMAND | (uCommand ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
00899 EnableMenuItem(hMenu, IDM_COPY, MF_BYCOMMAND | (uCommand ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
00900
00901 switch(m_FolderSettings.ViewMode)
00902    {
00903    case FVM_ICON:
00904       uCommand = IDM_VIEW_LARGE;
00905       break;
00906
00907    case FVM_SMALLICON:
00908       uCommand = IDM_VIEW_SMALL;
00909       break;
00910
00911    case FVM_LIST:
00912       uCommand = IDM_VIEW_LIST;
00913       break;
00914
00915    case FVM_DETAILS:
00916    default:
00917       uCommand = IDM_VIEW_DETAILS;
00918       break;
00919    }
00920
00921 CheckMenuRadioItem(hMenu, IDM_VIEW_LARGE, IDM_VIEW_DETAILS, uCommand, MF_BYCOMMAND);
00922
00923 return 0;
00924 }
00925
00926 /**************************************************************************
00927
00928    CShellView::UpdateToolbar()
00929
00930 **************************************************************************/
00931
00932 LRESULT CShellView::UpdateToolbar(VOID)
00933 {
00934 LRESULT  lResult;
00935 UINT     uCommand;
00936
00937 //enable/disable/check the toolbar items here
00938 switch(m_FolderSettings.ViewMode)
00939    {
00940    case FVM_ICON:
00941       uCommand = IDM_VIEW_LARGE;
00942       break;
00943
00944    case FVM_SMALLICON:
00945       uCommand = IDM_VIEW_SMALL;
00946       break;
00947
00948    case FVM_LIST:
00949       uCommand = IDM_VIEW_LIST;
00950       break;
00951
00952    case FVM_DETAILS:
00953    default:
00954       uCommand = IDM_VIEW_DETAILS;
00955       break;
00956    }
00957
00958 m_pShellBrowser->SendControlMsg( FCW_TOOLBAR,
00959                                  TB_CHECKBUTTON,
00960                                  uCommand,
00961                                  MAKELPARAM(TRUE, 0),
00962                                  &lResult);
00963
00964 return 0;
00965 }
00966
00967 /**************************************************************************
00968
00969    CShellView::OnNotify()
00970
00971 **************************************************************************/
00972
00973 #define MENU_MAX     100
00974
00975 LRESULT CShellView::OnNotify(UINT CtlID, LPNMHDR lpnmh)
00976 {
00977 switch(lpnmh->code)
00978    {
00979    /*
00980    The original shell on NT will always send TTN_NEEDTEXTW, so handle the
00981    cases separately.
00982    */
00983    case TTN_NEEDTEXTA:
00984       {
00985       LPNMTTDISPINFOA pttt = (LPNMTTDISPINFOA)lpnmh;
00986       int            i;
00987
00988       for(i = 0; -1 != g_Tools[i].idCommand; i++)
00989          {
00990          if(g_Tools[i].idCommand == pttt->hdr.idFrom)
00991             {
00992             LoadStringA(g_hInst, g_Tools[i].idString, pttt->szText, sizeof(pttt->szText));
00993             return TRUE;
00994             }
00995          }
00996       }
00997       break;
00998
00999    case TTN_NEEDTEXTW:
01000       {
01001       LPNMTTDISPINFOW pttt = (LPNMTTDISPINFOW)lpnmh;
01002       int            i;
01003
01004       for(i = 0; -1 != g_Tools[i].idCommand; i++)
01005          {
01006          if(g_Tools[i].idCommand == pttt->hdr.idFrom)
01007             {
01008             LoadStringW(g_hInst, g_Tools[i].idString, pttt->szText, sizeof(pttt->szText));
01009             return TRUE;
01010             }
01011          }
01012       }
01013       break;
01014
01015    case NM_SETFOCUS:
01016       OnSetFocus();
01017       break;
01018
01019    case NM_KILLFOCUS:
01020       OnDeactivate();
01021       break;
01022
01023    case HDN_ENDTRACK:
01024       {
01025       g_nColumn = ListView_GetColumnWidth(m_hwndList, 0);
01026       ListView_SetColumnWidth(m_hwndList, 1, LVSCW_AUTOSIZE_USEHEADER);
01027       }
01028       return 0;
01029
01030    case LVN_DELETEITEM:
01031       {
01032       NM_LISTVIEW *lpnmlv = (NM_LISTVIEW*)lpnmh;
01033
01034       //delete the pidl because we made a copy of it
01035       m_pPidlMgr->Delete((LPITEMIDLIST)lpnmlv->lParam);
01036       }
01037       break;
01038
01039 #ifdef LVN_ITEMACTIVATE
01040
01041    case LVN_ITEMACTIVATE:
01042
01043 #else    //LVN_ITEMACTIVATE
01044
01045    case NM_DBLCLK:
01046    case NM_RETURN:
01047
01048 #endif   //LVN_ITEMACTIVATE
01049
01050       DoContextMenu(0, 0, TRUE, (DWORD)-1);
01051       return 0;
01052
01053    case LVN_GETDISPINFO:
01054       {
01055       NMLVDISPINFO   *lpdi = (NMLVDISPINFO*)lpnmh;
01056       LPITEMIDLIST   pidl = (LPITEMIDLIST)lpdi->item.lParam;
01057
01058       //is the sub-item information being requested?
01059       if(lpdi->item.iSubItem)
01060          {
01061          //is the text being requested?
01062          if(lpdi->item.mask & LVIF_TEXT)
01063             {
01064             //is this a folder or a value?
01065             if(m_pPidlMgr->IsFolder(pidl))
01066                {
01067                LoadString(g_hInst, IDS_FOLDER_DATA, lpdi->item.pszText, lpdi->item.cchTextMax);
01068                }
01069             //its an item
01070             else
01071                {
01072                m_pPidlMgr->GetData(pidl, lpdi->item.pszText, lpdi->item.cchTextMax);
01073                }
01074             }
01075          }
01076       //the item text is being requested
01077       else
01078          {
01079          //is the text being requested?
01080          if(lpdi->item.mask & LVIF_TEXT)
01081             {
01082             STRRET   str;
01083
01084             if(SUCCEEDED(m_psfParent->GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str)))
01085                {
01086                GetTextFromSTRRET(m_pMalloc, &str, pidl, lpdi->item.pszText, lpdi->item.cchTextMax);
01087                }
01088             }
01089
01090          //is the image being requested?
01091          if(lpdi->item.mask & LVIF_IMAGE)
01092             {
01093             IExtractIcon   *pei;
01094
01095             if(SUCCEEDED(m_psfParent->GetUIObjectOf(m_hWnd, 1, (LPCITEMIDLIST*)&pidl, IID_IExtractIcon, NULL, (LPVOID*)&pei)))
01096                {
01097                UINT  uFlags;
01098
01099                //GetIconLocation will give us the index into our image list
01100                pei->GetIconLocation(GIL_FORSHELL, NULL, 0, &lpdi->item.iImage, &uFlags);
01101
01102                pei->Release();
01103                }
01104             }
01105          }
01106       }
01107       return 0;
01108
01109    case LVN_BEGINLABELEDIT:
01110       {
01111       NMLVDISPINFO   *lpdi = (NMLVDISPINFO*)lpnmh;
01112       LPITEMIDLIST   pidl = (LPITEMIDLIST)lpdi->item.lParam;
01113       DWORD          dwAttr = SFGAO_CANRENAME;
01114
01115       m_psfParent->GetAttributesOf(1, (LPCITEMIDLIST*)&pidl, &dwAttr);
01116       if(SFGAO_CANRENAME & dwAttr)
01117          {
01118          m_fInEdit = TRUE;
01119          return FALSE;
01120          }
01121       }
01122       return TRUE;
01123
01124    case LVN_ENDLABELEDIT:
01125       {
01126       LRESULT        lResult = 0;
01127       NMLVDISPINFO   *pdi = (NMLVDISPINFO*)lpnmh;
01128
01129       if(pdi->item.pszText)
01130          {
01131          //the user wants to keep the change
01132          LVITEM         lvItem;
01133          LPITEMIDLIST   pidl;
01134          WCHAR          wszNewName[MAX_PATH];
01135
01136          ZeroMemory(&lvItem, sizeof(lvItem));
01137          lvItem.mask = LVIF_PARAM;
01138          lvItem.iItem = pdi->item.iItem;
01139          ListView_GetItem(m_hwndList, &lvItem);
01140
01141          LocalToWideChar(wszNewName, pdi->item.pszText, MAX_PATH);
01142
01143          /*
01144          This will cause this class' RenameItem function to be called. This
01145          can cause problems, so the m_fInEdit flag will prevent RenameItem
01146          from being called on this object. SetNameOf will also free the old
01147          PIDL, so we don't have to do it again.
01148          */
01149          HRESULT  hr = m_psfParent->SetNameOf(NULL, (LPITEMIDLIST)lvItem.lParam, wszNewName, 0, &pidl);
01150
01151          if(SUCCEEDED(hr) && pidl)
01152             {
01153             lvItem.mask = LVIF_PARAM;
01154             lvItem.lParam = (LPARAM)pidl;
01155             ListView_SetItem(m_hwndList, &lvItem);
01156             lResult = TRUE;
01157             }
01158          }
01159
01160       m_fInEdit = FALSE;
01161       return lResult;
01162       }
01163
01164    case LVN_BEGINDRAG:
01165       {
01166       HRESULT        hr;
01167       IDataObject    *pDataObject = NULL;
01168       UINT           uItemCount;
01169       LPITEMIDLIST   *aPidls;
01170
01171       //get the number of selected items
01172       uItemCount = ListView_GetSelectedCount(m_hwndList);
01173       if(!uItemCount)
01174          return 0;
01175
01176       aPidls = (LPITEMIDLIST*)m_pMalloc->Alloc(uItemCount * sizeof(LPITEMIDLIST));
01177
01178       if(aPidls)
01179          {
01180          int   i;
01181          UINT  x;
01182
01183          for(i = 0, x = 0; x < uItemCount && i < ListView_GetItemCount(m_hwndList); i++)
01184             {
01185             if(ListView_GetItemState(m_hwndList, i, LVIS_SELECTED))
01186                {
01187                LVITEM   lvItem;
01188
01189                lvItem.mask = LVIF_PARAM;
01190                lvItem.iItem = i;
01191
01192                ListView_GetItem(m_hwndList, &lvItem);
01193                aPidls[x] = (LPITEMIDLIST)lvItem.lParam;
01194                x++;
01195                }
01196             }
01197
01198          hr = m_psfParent->GetUIObjectOf( m_hWnd,
01199                                           uItemCount,
01200                                           (LPCITEMIDLIST*)aPidls,
01201                                           IID_IDataObject,
01202                                           NULL,
01203                                           (LPVOID*)&pDataObject);
01204
01205          if(SUCCEEDED(hr) && pDataObject)
01206             {
01207             IDropSource *pDropSource = new CDropSource;
01208             DWORD       dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
01209             DWORD       dwAttributes = SFGAO_CANLINK;
01210
01211             hr = m_psfParent->GetAttributesOf(  uItemCount,
01212                                                 (LPCITEMIDLIST*)aPidls,
01213                                                 &dwAttributes);
01214
01215             if(SUCCEEDED(hr) && (dwAttributes & SFGAO_CANLINK))
01216                {
01217                dwEffect |= DROPEFFECT_LINK;
01218                }
01219
01220             DoDragDrop( pDataObject,
01221                         pDropSource,
01222                         dwEffect,
01223                         &dwEffect);
01224
01225             pDataObject->Release();
01226             pDropSource->Release();
01227             }
01228
01229          m_pMalloc->Free(aPidls);
01230          }
01231       }
01232       break;
01233
01234    case LVN_ITEMCHANGED:
01235       {
01236       UpdateToolbar();
01237       }
01238       break;
01239    }
01240
01241 return 0;
01242 }
01243
01244 /**************************************************************************
01245
01246    CShellView::OnSize()
01247
01248 **************************************************************************/
01249
01250 LRESULT CShellView::OnSize(WORD wWidth, WORD wHeight)
01251 {
01252 //resize the ListView to fit our window
01253 if(m_hwndList)
01254    {
01255    MoveWindow(m_hwndList, 0, 0, wWidth, wHeight, TRUE);
01256
01257    ListView_SetColumnWidth(m_hwndList, 0, g_nColumn);
01258    ListView_SetColumnWidth(m_hwndList, 1, LVSCW_AUTOSIZE_USEHEADER);
01259    }
01260
01261 return 0;
01262 }
01263
01264 /**************************************************************************
01265
01266    CShellView::OnCreate()
01267
01268 **************************************************************************/
01269
01270 LRESULT CShellView::OnCreate(VOID)
01271 {
01272 //create the ListView
01273 if(CreateList())
01274    {
01275    if(InitList())
01276       {
01277       FillList();
01278       }
01279    }
01280
01281 HRESULT  hr;
01282 IDropTarget *pdt;
01283
01284 //get the IDropTarget for this folder
01285 hr = m_psfParent->CreateViewObject( m_hWnd,
01286                                     IID_IDropTarget,
01287                                     (LPVOID*)&pdt);
01288
01289 if(SUCCEEDED(hr))
01290    {
01291    //register the window as a drop target
01292    RegisterDragDrop(m_hWnd, pdt);
01293
01294    pdt->Release();
01295    }
01296
01297 return 0;
01298 }
01299
01300 /**************************************************************************
01301
01302    CShellView::OnDestroy()
01303
01304 **************************************************************************/
01305
01306 LRESULT CShellView::OnDestroy(VOID)
01307 {
01308 //unregister the window as a drop target
01309 RevokeDragDrop(m_hWnd);
01310
01311 return 0;
01312 }
01313
01314 /**************************************************************************
01315
01316    CShellView::CreateList()
01317
01318 **************************************************************************/
01319
01320 BOOL CShellView::CreateList(VOID)
01321 {
01322 DWORD dwStyle;
01323
01324 dwStyle =   WS_TABSTOP |
01325             WS_VISIBLE |
01326             WS_CHILD |
01327             WS_BORDER |
01328             LVS_NOSORTHEADER |
01329             LVS_SHAREIMAGELISTS |
01330             LVS_EDITLABELS;
01331
01332 switch(m_FolderSettings.ViewMode)
01333    {
01334    default:
01335    case FVM_ICON:
01336       dwStyle |= LVS_ICON;
01337       break;
01338
01339    case FVM_SMALLICON:
01340       dwStyle |= LVS_SMALLICON;
01341       break;
01342
01343    case FVM_LIST:
01344       dwStyle |= LVS_LIST;
01345       break;
01346
01347    case FVM_DETAILS:
01348       dwStyle |= LVS_REPORT;
01349       break;
01350
01351    }
01352
01353 if(FWF_AUTOARRANGE & m_FolderSettings.fFlags)
01354    dwStyle |= LVS_AUTOARRANGE;
01355
01356 m_hwndList = CreateWindowEx(     WS_EX_CLIENTEDGE,
01357                                  WC_LISTVIEW,
01358                                  NULL,
01359                                  dwStyle,
01360                                  0,
01361                                  0,
01362                                  0,
01363                                  0,
01364                                  m_hWnd,
01365                                  (HMENU)ID_LISTVIEW,
01366                                  g_hInst,
01367                                  NULL);
01368
01369 if(!m_hwndList)
01370    return FALSE;
01371
01372 GetShellSettings();
01373
01374 return TRUE;
01375 }
01376
01377 /**************************************************************************
01378
01379    CShellView::InitList()
01380
01381 **************************************************************************/
01382
01383 BOOL CShellView::InitList(VOID)
01384 {
01385 LVCOLUMN    lvColumn;
01386 TCHAR       szString[MAX_PATH];
01387
01388 //empty the list
01389 ListView_DeleteAllItems(m_hwndList);
01390
01391 //initialize the columns
01392 lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
01393 lvColumn.fmt = LVCFMT_LEFT;
01394 lvColumn.pszText = szString;
01395
01396 lvColumn.cx = g_nColumn;
01397 LoadString(g_hInst, IDS_COLUMN1, szString, sizeof(szString));
01398 ListView_InsertColumn(m_hwndList, 0, &lvColumn);
01399
01400 lvColumn.cx = g_nColumn;
01401 LoadString(g_hInst, IDS_COLUMN2, szString, sizeof(szString));
01402 ListView_InsertColumn(m_hwndList, 1, &lvColumn);
01403
01404 ListView_SetImageList(m_hwndList, g_himlLarge, LVSIL_NORMAL);
01405 ListView_SetImageList(m_hwndList, g_himlSmall, LVSIL_SMALL);
01406
01407 return TRUE;
01408 }
01409
01410 /**************************************************************************
01411
01412    CShellView::FillList()
01413
01414 **************************************************************************/
01415
01416 VOID CShellView::FillList(VOID)
01417 {
01418 LPENUMIDLIST   pEnumIDList;
01419
01420 if(SUCCEEDED(m_psfParent->EnumObjects(m_hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList)))
01421    {
01422    LPITEMIDLIST   pidl;
01423    DWORD          dwFetched;
01424
01425    //turn the listview's redrawing off
01426    SendMessage(m_hwndList, WM_SETREDRAW, FALSE, 0);
01427
01428    while((S_OK == pEnumIDList->Next(1, &pidl, &dwFetched)) && dwFetched)
01429       {
01430       AddItem(pidl);
01431 /*
01432 */
01433       }
01434
01435    //sort the items
01436    ListView_SortItems(m_hwndList, CompareItems, (LPARAM)m_psfParent);
01437
01438    //turn the listview's redrawing back on and force it to draw
01439    SendMessage(m_hwndList, WM_SETREDRAW, TRUE, 0);
01440    InvalidateRect(m_hwndList, NULL, TRUE);
01441    UpdateWindow(m_hwndList);
01442
01443    pEnumIDList->Release();
01444    }
01445 }
01446
01447 /**************************************************************************
01448
01449    CShellView::GetShellSettings()
01450
01451 **************************************************************************/
01452
01453 #if (_WIN32_IE >= 0x0400)
01454 typedef VOID (WINAPI *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
01455
01456 VOID CShellView::GetShellSettings(VOID)
01457 {
01458 SHELLFLAGSTATE       sfs;
01459 HINSTANCE            hinstShell32;
01460
01461 /*
01462 Since SHGetSettings is not implemented in all versions of the shell, get the
01463 function address manually at run time. This allows the extension to run on all
01464 platforms.
01465 */
01466
01467 ZeroMemory(&sfs, sizeof(sfs));
01468
01469 /*
01470 The default, in case any of the following steps fails, is classic Windows 95
01471 style.
01472 */
01473 sfs.fWin95Classic = TRUE;
01474
01475 hinstShell32 = LoadLibrary(TEXT("shell32.dll"));
01476 if(hinstShell32)
01477    {
01478    PFNSHGETSETTINGSPROC pfnSHGetSettings;
01479
01480    pfnSHGetSettings = (PFNSHGETSETTINGSPROC)GetProcAddress(hinstShell32, "SHGetSettings");
01481    if(pfnSHGetSettings)
01482       {
01483       (*pfnSHGetSettings)(&sfs, SSF_DOUBLECLICKINWEBVIEW | SSF_WIN95CLASSIC);
01484       }
01485    FreeLibrary(hinstShell32);
01486    }
01487
01488 DWORD dwExStyles = 0;
01489
01490 if(!sfs.fWin95Classic && !sfs.fDoubleClickInWebView)
01491    {
01492    dwExStyles |= LVS_EX_ONECLICKACTIVATE |
01493                   LVS_EX_TRACKSELECT |
01494                   LVS_EX_UNDERLINEHOT;
01495    }
01496
01497 ListView_SetExtendedListViewStyle(m_hwndList, dwExStyles);
01498 }
01499 #else
01500 VOID CShellView::GetShellSettings(VOID)
01501 {
01502 }
01503 #endif
01504
01505 /**************************************************************************
01506
01507    CShellView::OnSettingChange()
01508
01509 **************************************************************************/
01510
01511 LRESULT CShellView::OnSettingChange(LPCTSTR lpszSection)
01512 {
01513 if(0 == lstrcmpi(lpszSection, TEXT("ShellState")))
01514    {
01515    GetShellSettings();
01516    return 0;
01517    }
01518
01519 return 0;
01520 }
01521
01522 /**************************************************************************
01523
01524    CShellView::DoContextMenu()
01525
01526 **************************************************************************/
01527
01528 VOID CShellView::DoContextMenu(WORD x, WORD y, BOOL fDefault, DWORD dwCmdIn)
01529 {
01530 UINT           uSelected = 0;
01531 LPITEMIDLIST   *aSelectedItems = NULL;
01532 LPCONTEXTMENU  pContextMenu = NULL;
01533
01534 if(m_uState != SVUIA_ACTIVATE_NOFOCUS)
01535    {
01536    uSelected = ListView_GetSelectedCount(m_hwndList);
01537    }
01538
01539 if(uSelected)
01540    {
01541    aSelectedItems = (LPITEMIDLIST*)m_pMalloc->Alloc((uSelected + 1) * sizeof(LPITEMIDLIST));
01542
01543    if(aSelectedItems)
01544       {
01545       UINT     i;
01546       LVITEM   lvItem;
01547
01548       ZeroMemory(&lvItem, sizeof(lvItem));
01549       lvItem.mask = LVIF_STATE | LVIF_PARAM;
01550       lvItem.stateMask = LVIS_SELECTED;
01551       lvItem.iItem = 0;
01552
01553       i = 0;
01554
01555       while(ListView_GetItem(m_hwndList, &lvItem) && (i < uSelected))
01556          {
01557          if(lvItem.state & LVIS_SELECTED)
01558             {
01559             aSelectedItems[i] = (LPITEMIDLIST)lvItem.lParam;
01560             i++;
01561             }
01562          lvItem.iItem++;
01563          }
01564       m_psfParent->GetUIObjectOf(   m_hwndParent,
01565                                     uSelected,
01566                                     (LPCITEMIDLIST*)aSelectedItems,
01567                                     IID_IContextMenu,
01568                                     NULL,
01569                                     (LPVOID*)&pContextMenu);
01570
01571       }
01572    }
01573 else
01574    {
01575    m_psfParent->CreateViewObject(   m_hwndParent,
01576                                     IID_IContextMenu,
01577                                     (LPVOID*)&pContextMenu);
01578    }
01579
01580 if(pContextMenu)
01581    {
01582    HMENU hMenu = CreatePopupMenu();
01583
01584    /*
01585    See if we are in Explore or Open mode. If the browser's tree is present,
01586    then we are in Explore mode.
01587    */
01588    BOOL  fExplore = FALSE;
01589    HWND  hwndTree = NULL;
01590    if(SUCCEEDED(m_pShellBrowser->GetControlWindow(FCW_TREE, &hwndTree)) && hwndTree)
01591       {
01592       fExplore = TRUE;
01593       }
01594
01595    if(hMenu && SUCCEEDED(pContextMenu->QueryContextMenu( hMenu,
01596                                                          0,
01597                                                          0,
01598                                                          MENU_MAX,
01599                                                          CMF_NORMAL |
01600                                                             (fExplore ? CMF_EXPLORE : 0) |
01601                                                             ((uSelected > 1) ? MYCMF_MULTISELECT: 0))))
01602       {
01603       UINT  uCommand;
01604
01605       if(fDefault)
01606          {
01607          MENUITEMINFO   mii;
01608          int            nMenuIndex;
01609
01610          uCommand = 0;
01611
01612          ZeroMemory(&mii, sizeof(mii));
01613          mii.cbSize = sizeof(mii);
01614          mii.fMask = MIIM_STATE | MIIM_ID;
01615
01616          nMenuIndex = 0;
01617
01618          //find the default item in the menu
01619          while(GetMenuItemInfo(hMenu, nMenuIndex, TRUE, &mii))
01620             {
01621             if(mii.fState & MFS_DEFAULT)
01622                {
01623                uCommand = mii.wID;
01624                break;
01625                }
01626
01627             nMenuIndex++;
01628             }
01629          }
01630       else if(-1 != dwCmdIn)
01631          {
01632          //this command will get sent directly without bringing up the menu
01633          uCommand = dwCmdIn;
01634          }
01635       else
01636          {
01637          uCommand = TrackPopupMenu( hMenu,
01638                                     TPM_LEFTALIGN | TPM_RETURNCMD,
01639                                     x,
01640                                     y,
01641                                     0,
01642                                     m_hWnd,
01643                                     NULL);
01644          }
01645
01646       if(uCommand > 0)
01647          {
01648          //some commands need to be handled by the view itself
01649          switch(uCommand)
01650             {
01651             case IDM_VIEW_LARGE:
01652                OnViewLarge();
01653                break;
01654
01655             case IDM_VIEW_SMALL:
01656                OnViewSmall();
01657                break;
01658
01659             case IDM_VIEW_LIST:
01660                OnViewList();
01661                break;
01662
01663             case IDM_VIEW_DETAILS:
01664                OnViewDetails();
01665                break;
01666
01667             default:
01668                {
01669                CMINVOKECOMMANDINFO  cmi;
01670
01671                ZeroMemory(&cmi, sizeof(cmi));
01672                cmi.cbSize = sizeof(cmi);
01673                cmi.hwnd = m_hWnd;
01674                cmi.lpVerb = (LPCSTR)MAKEINTRESOURCE(uCommand);
01675
01676                pContextMenu->InvokeCommand(&cmi);
01677                }
01678                break;
01679             }
01680
01681          }
01682
01683       DestroyMenu(hMenu);
01684       }
01685
01686    pContextMenu->Release();
01687    }
01688
01689 if(aSelectedItems)
01690    m_pMalloc->Free(aSelectedItems);
01691
01692 UpdateToolbar();
01693 }
01694
01695 /**************************************************************************
01696
01697    CShellView::AddItem()
01698
01699 **************************************************************************/
01700
01701 BOOL CShellView::AddItem(LPCITEMIDLIST pidl)
01702 {
01703 LVITEM   lvItem;
01704
01705 ZeroMemory(&lvItem, sizeof(lvItem));
01706
01707 //set the mask
01708 lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
01709
01710 //add the item to the end of the list
01711 lvItem.iItem = ListView_GetItemCount(m_hwndList);
01712
01713 //set the item's data
01714 lvItem.lParam = (LPARAM)m_pPidlMgr->Copy(pidl);
01715
01716 //get text on a callback basis
01717 lvItem.pszText = LPSTR_TEXTCALLBACK;
01718
01719 //get the image on a callback basis
01720 lvItem.iImage = I_IMAGECALLBACK;
01721
01722 //add the item
01723 if(-1 == ListView_InsertItem(m_hwndList, &lvItem))
01724    return FALSE;
01725
01726 return TRUE;
01727 }
01728
01729 /**************************************************************************
01730
01731    CShellView::DeleteItem()
01732
01733 **************************************************************************/
01734
01735 BOOL CShellView::DeleteItem(LPCITEMIDLIST pidl)
01736 {
01737 //delete the item from the list
01738 int   nIndex = FindItemPidl(pidl);
01739
01740 if(-1 != nIndex)
01741    {
01742    return ListView_DeleteItem(m_hwndList, nIndex);
01743    }
01744
01745 return FALSE;
01746 }
01747
01748 /**************************************************************************
01749
01750    CShellView::RenameItem()
01751
01752 **************************************************************************/
01753
01754 BOOL CShellView::RenameItem(LPCITEMIDLIST pidlOld, LPCITEMIDLIST pidlNew)
01755 {
01756 //don't allow this to be called if this object is the being edited
01757
01758 if(m_fInEdit)
01759    return TRUE;
01760
01761 //find the item in the list
01762 int   nIndex = FindItemPidl(pidlOld);
01763
01764 if(-1 != nIndex)
01765    {
01766    BOOL     fReturn;
01767    LVITEM   lvItem;
01768
01769    ZeroMemory(&lvItem, sizeof(lvItem));
01770    lvItem.mask = LVIF_PARAM;
01771    lvItem.iItem = nIndex;
01772    ListView_GetItem(m_hwndList, &lvItem);
01773
01774    m_pPidlMgr->Delete((LPITEMIDLIST)lvItem.lParam);
01775
01776    ZeroMemory(&lvItem, sizeof(lvItem));
01777    lvItem.mask = LVIF_PARAM;
01778    lvItem.iItem = nIndex;
01779    lvItem.lParam = (LPARAM)m_pPidlMgr->Copy(pidlNew);
01780    fReturn = ListView_SetItem(m_hwndList, &lvItem);
01781    ListView_Update(m_hwndList, nIndex);
01782    return fReturn;
01783    }
01784
01785 return FALSE;
01786 }
01787
01788 /**************************************************************************
01789
01790    CShellView::GetPidl()
01791
01792 **************************************************************************/
01793
01794 LPITEMIDLIST CShellView::GetPidl()
01795 {
01796 return m_psfParent->CreateFQPidl(NULL);
01797 }
01798
01799 /**************************************************************************
01800
01801    CShellView::GetFQPidl()
01802
01803 **************************************************************************/
01804
01805 LPITEMIDLIST CShellView::GetFQPidl()
01806 {
01807 return m_psfParent->CreateFQPidl(NULL);
01808 }
01809
01810 /**************************************************************************
01811
01812    CShellView::FindItemPidl()
01813
01814 **************************************************************************/
01815
01816 int CShellView::FindItemPidl(LPCITEMIDLIST pidl)
01817 {
01818 LVITEM   lvItem;
01819
01820 ZeroMemory(&lvItem, sizeof(lvItem));
01821 lvItem.mask = LVIF_PARAM;
01822
01823 for(lvItem.iItem = 0; ListView_GetItem(m_hwndList, &lvItem); lvItem.iItem++)
01824    {
01825    LPITEMIDLIST   pidlFound = (LPITEMIDLIST)lvItem.lParam;
01826    HRESULT        hr = m_psfParent->CompareIDs(0, pidl, pidlFound);
01827    if(SUCCEEDED(hr) && 0 == HRESULT_CODE(hr))
01828       {
01829       //we found the item
01830       return lvItem.iItem;
01831       }
01832    }
01833
01834 return -1;
01835 }
01836
01837 /**************************************************************************
01838
01839    CShellView::MarkItemsAsCut()
01840
01841    Marks the items as cut.
01842
01843 **************************************************************************/
01844
01845 VOID CShellView::MarkItemsAsCut(LPCITEMIDLIST *aPidls, UINT uItemCount)
01846 {
01847 UINT  i;
01848
01849 for(i = 0; i < uItemCount; i++)
01850    {
01851    LPITEMIDLIST   pidlTemp = m_pPidlMgr->GetLastItem(aPidls[i]);
01852    int            nIndex = FindItemPidl(pidlTemp);
01853
01854    if(nIndex != -1)
01855       {
01856       ListView_SetItemState(m_hwndList, nIndex, LVIS_CUT, LVIS_CUT);
01857       }
01858    }
01859 }
01860
01861 /**************************************************************************
01862
01863    CShellView::EditItem()
01864
01865 **************************************************************************/
01866
01867 VOID CShellView::EditItem(LPCITEMIDLIST pidl)
01868 {
01869 int   i;
01870
01871 i = FindItemPidl(pidl);
01872
01873 if(-1 != i)
01874    {
01875    SetFocus(m_hwndList);
01876
01877    //put the ListView into edit mode
01878    ListView_EditLabel(m_hwndList, i);
01879    }
01880 }
01881
01882 /**************************************************************************
01883
01884    CShellView::UpdateData()
01885
01886 **************************************************************************/
01887
01888 VOID CShellView::UpdateData(LPCITEMIDLIST pidl)
01889 {
01890 int   i;
01891
01892 i = FindItemPidl(pidl);
01893
01894 if(-1 != i)
01895    {
01896    LVITEM   lvItem;
01897
01898    ZeroMemory(&lvItem, sizeof(lvItem));
01899    lvItem.mask = LVIF_PARAM;
01900    lvItem.iItem = i;
01901    ListView_GetItem(m_hwndList, &lvItem);
01902
01903    m_pPidlMgr->Delete((LPITEMIDLIST)lvItem.lParam);
01904
01905    ZeroMemory(&lvItem, sizeof(lvItem));
01906    lvItem.mask = LVIF_PARAM;
01907    lvItem.iItem = i;
01908    lvItem.lParam = (LPARAM)m_pPidlMgr->Copy(pidl);
01909    ListView_SetItem(m_hwndList, &lvItem);
01910    ListView_Update(m_hwndList, i);
01911    }
01912 }
01913
01914 /**************************************************************************
01915
01916    CShellView::OnViewLarge()
01917
01918 **************************************************************************/
01919
01920 LRESULT CShellView::OnViewLarge(VOID)
01921 {
01922 m_FolderSettings.ViewMode = FVM_ICON;
01923
01924 DWORD dwStyle = GetWindowLong(m_hwndList, GWL_STYLE);
01925 dwStyle &= ~LVS_TYPEMASK;
01926 dwStyle |= LVS_ICON;
01927 SetWindowLong(m_hwndList, GWL_STYLE, dwStyle);
01928
01929 return 0;
01930 }
01931
01932 /**************************************************************************
01933
01934    CShellView::OnViewSmall()
01935
01936 **************************************************************************/
01937
01938 LRESULT CShellView::OnViewSmall(VOID)
01939 {
01940 m_FolderSettings.ViewMode = FVM_SMALLICON;
01941
01942 DWORD dwStyle = GetWindowLong(m_hwndList, GWL_STYLE);
01943 dwStyle &= ~LVS_TYPEMASK;
01944 dwStyle |= LVS_SMALLICON;
01945 SetWindowLong(m_hwndList, GWL_STYLE, dwStyle);
01946
01947 return 0;
01948 }
01949
01950 /**************************************************************************
01951
01952    CShellView::OnViewList()
01953
01954 **************************************************************************/
01955
01956 LRESULT CShellView::OnViewList(VOID)
01957 {
01958 m_FolderSettings.ViewMode = FVM_LIST;
01959
01960 DWORD dwStyle = GetWindowLong(m_hwndList, GWL_STYLE);
01961 dwStyle &= ~LVS_TYPEMASK;
01962 dwStyle |= LVS_LIST;
01963 SetWindowLong(m_hwndList, GWL_STYLE, dwStyle);
01964
01965 return 0;
01966 }
01967
01968 /**************************************************************************
01969
01970    CShellView::OnViewDetails()
01971
01972 **************************************************************************/
01973
01974 LRESULT CShellView::OnViewDetails(VOID)
01975 {
01976 m_FolderSettings.ViewMode = FVM_DETAILS;
01977
01978 DWORD dwStyle = GetWindowLong(m_hwndList, GWL_STYLE);
01979 dwStyle &= ~LVS_TYPEMASK;
01980 dwStyle |= LVS_REPORT;
01981 SetWindowLong(m_hwndList, GWL_STYLE, dwStyle);
01982
01983 return 0;
01984 }
01985
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEnumSyncMgrItems Member List

This is the complete list of members for CEnumSyncMgrItems, including all inherited members.
CEnumSyncMgrItems(LPGENERICITEMLIST pContactItemList, DWORD cOffset) | CEnumSyncMgrItems |
CGenericEnum(LPGENERICITEMLIST pGenericItemList, DWORD cOffset) | CGenericEnum |
Clone(ISyncMgrEnumItems **ppenum) | CEnumSyncMgrItems |
CGenericEnum::Clone(CGenericEnum **ppenum) | CGenericEnum |
DeleteThisObject() | CEnumSyncMgrItems | [virtual]
m_cOffset | CGenericEnum |
m_cRef | CGenericEnum |
m_pGenericItemList | CGenericEnum |
m_pNextItem | CGenericEnum |
Next(ULONG celt, LPSYNCMGRITEM rgelt, ULONG *pceltFetched) | CEnumSyncMgrItems |
CGenericEnum::Next(ULONG celt, LPGENERICITEM rgelt, ULONG *pceltFetched) | CGenericEnum |
QueryInterface(REFIID, LPVOID FAR *) | CEnumSyncMgrItems |
Reset() | CEnumSyncMgrItems |
Skip(ULONG celt) | CEnumSyncMgrItems |
STDMETHODIMP_(ULONG) AddRef() | CEnumSyncMgrItems |
STDMETHODIMP_(ULONG) Release() | CEnumSyncMgrItems |
~CGenericEnum() | CGenericEnum |
Generated on Wed Nov 13 2024 16:56:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CUrlmonCallback Member List

This is the complete list of members for CUrlmonCallback, including all inherited members.
BeginningTransaction(LPCWSTR szURL, LPCWSTR szHeaders, DWORD dwReserved, LPWSTR __RPC_FAR *pszAdditionalHeaders) | CUrlmonCallback |
BufAlloc(DWORD dwSize) | RecvBuf |
BufBeg(void) | RecvBuf | [inline]
BufReset(void) | RecvBuf | [inline]
BufScanInt(DWORD *pdwRet, BYTE cDelimit) | RecvBuf |
BufScanStr(PSTR pszSearch, DWORD cbSearch) | RecvBuf |
BufShift(void) | RecvBuf | [inline]
BufSize(void) | RecvBuf | [inline]
BufSpace(void) | RecvBuf | [inline]
CUrlmonCallback(PHTTP_REQUEST_PARAM) | CUrlmonCallback |
GetBindInfo(DWORD *pgrfBINDF, BINDINFO *pbindinfo) | CUrlmonCallback |
GetPriority(LONG *pnPriority) | CUrlmonCallback |
m_CBParam | CUrlmonCallback |
m_cchRangeDelimiter | CUrlmonCallback |
m_cRef | CUrlmonCallback |
m_dwOffset | CUrlmonCallback |
m_dwRangeBeg | CUrlmonCallback |
m_dwRangeEnd | CUrlmonCallback |
m_dwResponseCode | CUrlmonCallback |
m_pbDataBeg | RecvBuf |
m_pbDataEnd | RecvBuf |
m_pBinding | CUrlmonCallback |
m_pParam | CUrlmonCallback |
m_pstm | CUrlmonCallback |
m_pszRangeDelimiter | CUrlmonCallback |
OnDataAvailable(DWORD grfBSCF, DWORD dwSize, FORMATETC *pfmtetc, STGMEDIUM *pstgmed) | CUrlmonCallback |
OnLowResource(DWORD dwReserved) | CUrlmonCallback |
OnObjectAvailable(REFIID riid, IUnknown *punk) | CUrlmonCallback |
OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR pwzStatusText) | CUrlmonCallback |
OnResponse(DWORD dwResponseCode, LPCWSTR szResponseHeaders, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders) | CUrlmonCallback |
OnStartBinding(DWORD grfBSCOption, IBinding *pBinding) | CUrlmonCallback |
OnStopBinding(HRESULT hrResult, LPCWSTR szError) | CUrlmonCallback |
ParseMultiPartBuffer(BOOL fLastCall) | CUrlmonCallback |
ParseMultiPartHeader(void) | CUrlmonCallback |
QueryInterface(REFIID riid, void **ppv) | CUrlmonCallback |
RecvBuf() | RecvBuf | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CUrlmonCallback |
STDMETHODIMP_(ULONG) Release(void) | CUrlmonCallback |
~CUrlmonCallback() | CUrlmonCallback |
~RecvBuf() | RecvBuf | [inline]
Generated on Wed Nov 13 2024 16:57:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/Registry.h Source File

  • SysMgmt
  • MMC
  • Help

Registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout,   // Class Id for About Class
00040                        const BOOL fSupportExtensions = FALSE);
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/MyDevice.cpp Source File

  • NetDS
  • upnp
  • StepByStep
  • Step3

MyDevice.cpp

Go to the documentation of this file.
00001 // MyDevice.cpp : Implementation of DLL Exports.
00002
00003
00004 // Note: Proxy/Stub Information
00005 //      To build a separate proxy/stub DLL,
00006 //      run nmake -f MyDeviceps.mk in the project directory.
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 #include <initguid.h>
00011 #include "MyDevice.h"
00012
00013 #include "MyDevice_i.c"
00014 #include "Dimmer.h"
00015 #include "DimmerService.h"
00016
00017
00018 CComModule _Module;
00019
00020 BEGIN_OBJECT_MAP(ObjectMap)
00021 OBJECT_ENTRY(CLSID_Dimmer, CDimmer)
00022 //OBJECT_ENTRY(CLSID_DimmerService, CDimmerService)
00023 END_OBJECT_MAP()
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // DLL Entry Point
00027
00028 extern "C"
00029 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00030 {
00031     if (dwReason == DLL_PROCESS_ATTACH)
00032     {
00033         _Module.Init(ObjectMap, hInstance, &LIBID_MYDEVICELib);
00034         DisableThreadLibraryCalls(hInstance);
00035     }
00036     else if (dwReason == DLL_PROCESS_DETACH)
00037         _Module.Term();
00038     return TRUE;    // ok
00039 }
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // Used to determine whether the DLL can be unloaded by OLE
00043
00044 STDAPI DllCanUnloadNow(void)
00045 {
00046     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00047 }
00048
00049 /////////////////////////////////////////////////////////////////////////////
00050 // Returns a class factory to create an object of the requested type
00051
00052 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00053 {
00054     return _Module.GetClassObject(rclsid, riid, ppv);
00055 }
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // DllRegisterServer - Adds entries to the system registry
00059
00060 STDAPI DllRegisterServer(void)
00061 {
00062     // registers object, typelib and all interfaces in typelib
00063     return _Module.RegisterServer(TRUE);
00064 }
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067 // DllUnregisterServer - Removes entries from the system registry
00068
00069 STDAPI DllUnregisterServer(void)
00070 {
00071     return _Module.UnregisterServer(TRUE);
00072 }
00073
00074
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/simple/Simples.c Source File

  • NetDS
  • WinSock
  • simple

Simples.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 * simples.c - Simple TCP/UDP server using Winsock 1.1
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1996 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011 #ifdef _IA64_
00012     #pragma warning(disable:4127)
00013 #endif
00014
00015 #ifndef WIN32_LEAN_AND_MEAN
00016 #define WIN32_LEAN_AND_MEAN
00017 #endif
00018
00019 #include <winsock2.h>
00020 #include <ws2tcpip.h>
00021 #include <wspiapi.h>
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <string.h>
00025
00026 #define DEFAULT_PORT        "5001"            // Default listening port
00027 #define DEFAULT_PROTO       SOCK_STREAM       // Default to TCP protocol
00028 #define DEFAULT_BUFFER_LEN  4096              // Default recv buffer length
00029
00030 // Function prototype
00031 DWORD WINAPI ServerThread(LPVOID lpParam);
00032
00033 //
00034 // Function: Usage
00035 //
00036 // Description:
00037 //     Print usage information to the console and exits.
00038 //
00039 void Usage(char *progname)
00040 {
00041     fprintf(stderr,"Usage\n%s -p [protocol] -e [endpoint] -i [interface] [-4] [-6]\n"
00042             "Where:\n"
00043             "\t-p protocol   - is one of \"TCP\" or \"UDP\"\n"
00044             "\t-e endpoint   - is the port to listen on\n"
00045             "\t-i interface  - is the string local address to bind to\n"
00046             "\t-4            - force IPv4\n"
00047             "\t-6            - force IPv6\n"
00048             "\n"
00049             "Defaults are TCP,5001 and INADDR_ANY and IN6ADDR_ANY (if IPv6 present)\n",
00050             progname
00051            );
00052     WSACleanup();
00053     exit(1);
00054 }
00055
00056
00057 //
00058 // Function: main
00059 //
00060 // Description:
00061 //    Parse the command line arguments and resolve the given local interface.
00062 //    By default we will request AF_UNSPEC which may cause getaddrinfo to return
00063 //    multiple addresses. In this case, we will create a server socket for each
00064 //    address returned (e.g. IPv4 and IPv6). A thread will be created for each
00065 //    socket to service the server socket. For TCP just a single client is handled
00066 //    at a time. For UDP, we'll simply receive a datagram and send it back to its
00067 //    source. The main thread waits until all child threads have terminated at which
00068 //    point it cleans up all resources and exits.
00069 //
00070 int __cdecl main(int argc, char **argv)
00071 {
00072     struct addrinfo  hints,
00073     *results = NULL,
00074     *addrptr = NULL;
00075     WSADATA     wsaData;
00076     SOCKET     *server_sockets = NULL;
00077     HANDLE     *server_threads = NULL;
00078     char        hoststr[NI_MAXHOST],
00079     servstr[NI_MAXSERV];
00080     char       *interface = NULL,
00081     *port = DEFAULT_PORT;
00082     int         socket_type = DEFAULT_PROTO,
00083     address_family = AF_UNSPEC,     // Default to any (IPv4 or IPv6)
00084     socket_count = 0,
00085     retval,
00086     i;
00087
00088     /* Parse arguments */
00089     if (argc >1)
00090     {
00091         for (i=1;i <argc;i++)
00092         {
00093             if ( (strlen(argv[i]) == 2) && ( (argv[i][0] == '-') || (argv[i][0] == '/') ) )
00094             {
00095                 switch (tolower(argv[i][1]))
00096                 {
00097                 case '4':       // IPv4
00098                     address_family = AF_INET;
00099                     break;
00100
00101                 case '6':       // IPv6
00102                     address_family = AF_INET6;
00103                     break;
00104
00105                 case 'p':
00106                     if (!_strnicmp(argv[i+1], "TCP", 3) )
00107                         socket_type = SOCK_STREAM;
00108                     else if (!_strnicmp(argv[i+1], "UDP", 3) )
00109                         socket_type = SOCK_DGRAM;
00110                     else
00111                         Usage(argv[0]);
00112                     i++;
00113                     break;
00114
00115                 case 'i':       // Local interface to listen/recv on
00116                     interface = argv[++i];
00117                     break;
00118
00119                 case 'e':       // Port number to listen/recv on
00120                     port = argv[++i];
00121                     break;
00122
00123                 default:
00124                     Usage(argv[0]);
00125                     break;
00126                 }
00127             }
00128             else
00129                 Usage(argv[0]);
00130         }
00131     }
00132
00133     // Load Winsock
00134     if ((retval = WSAStartup(0x202,&wsaData)) != 0)
00135     {
00136         fprintf(stderr,"WSAStartup failed with error %d\n",retval);
00137         WSACleanup();
00138         return -1;
00139     }
00140
00141     // Make sure the supplied port isn't wildcard
00142     if ( _strnicmp(port, "0", 1) == 0)
00143     {
00144         Usage(argv[0]);
00145     }
00146
00147     memset(&hints, 0, sizeof(hints));
00148     hints.ai_family   = address_family;
00149     hints.ai_socktype = socket_type;
00150     hints.ai_protocol = ((socket_type == SOCK_DGRAM) ? IPPROTO_UDP : IPPROTO_TCP);
00151     // If interface is NULL then request the passive "bind" address
00152     hints.ai_flags    = ((interface == NULL) ? AI_PASSIVE : 0);
00153
00154     retval = getaddrinfo(interface, port, &hints, &results);
00155     if (retval != 0)
00156     {
00157         fprintf(stderr, "getaddrinfo failed: %d\n", retval);
00158         goto cleanup;
00159     }
00160
00161     // Make sure we got at least one address back
00162     if (results == NULL)
00163     {
00164         fprintf(stderr, "Unable to resolve interface %s\n", interface);
00165         goto cleanup;
00166     }
00167
00168     // Count how many addresses were returned
00169     addrptr = results;
00170     while (addrptr)
00171     {
00172         socket_count++;
00173         addrptr = addrptr->ai_next;
00174     }
00175
00176     // Allocate space for the server sockets
00177     server_sockets = (SOCKET *)HeapAlloc(
00178                                         GetProcessHeap(),
00179                                         HEAP_ZERO_MEMORY,
00180                                         sizeof(SOCKET) * socket_count
00181                                         );
00182     if (server_sockets == NULL)
00183     {
00184         fprintf(stderr, "HeapAlloc failed: %d\n", GetLastError());
00185         goto cleanup;
00186     }
00187
00188     // Initialize the socket array first
00189     for (i=0; i < socket_count ;i++)
00190         server_sockets[i] = INVALID_SOCKET;
00191
00192     // Create the server sockets - one for each address returned
00193     socket_count = 0;
00194     addrptr = results;
00195     while (addrptr)
00196     {
00197         // Create the socket according to the parameters returned
00198         server_sockets[socket_count] = socket(
00199                                              addrptr->ai_family,
00200                                              addrptr->ai_socktype,
00201                                              addrptr->ai_protocol
00202                                              );
00203         if (server_sockets[socket_count] == INVALID_SOCKET)
00204         {
00205             fprintf(stderr, "socket failed: %d\n", WSAGetLastError());
00206             goto cleanup;
00207         }
00208
00209         // Bind the socket to the address returned
00210         retval = bind(server_sockets[socket_count],
00211                       addrptr->ai_addr,
00212                       (int)addrptr->ai_addrlen
00213                      );
00214         if (retval == SOCKET_ERROR)
00215         {
00216             fprintf(stderr, "bind failed: %d\n", WSAGetLastError());
00217             goto cleanup;
00218         }
00219
00220         // If a TCP socket, call listen on it
00221         if (addrptr->ai_socktype == SOCK_STREAM)
00222         {
00223             retval = listen(
00224                            server_sockets[socket_count],
00225                            7
00226                            );
00227             if (retval == SOCKET_ERROR)
00228             {
00229                 fprintf(stderr, "listen failed: %d\n", WSAGetLastError());
00230                 goto cleanup;
00231             }
00232         }
00233
00234         // Print the address this socket is bound to
00235         retval = getnameinfo(
00236                             addrptr->ai_addr,
00237                             (socklen_t)addrptr->ai_addrlen,
00238                             hoststr,
00239                             NI_MAXHOST,
00240                             servstr,
00241                             NI_MAXSERV,
00242                             NI_NUMERICHOST | NI_NUMERICSERV
00243                             );
00244         if (retval != 0)
00245         {
00246             fprintf(stderr, "getnameinfo failed: %d\n", retval);
00247             goto cleanup;
00248         }
00249
00250         fprintf(stdout, "socket 0x%x bound to address %s and port %s\n",
00251                 server_sockets[socket_count], hoststr, servstr);
00252
00253         // Increment the socket count again
00254         socket_count++;
00255
00256         // Increment the address pointer
00257         addrptr = addrptr->ai_next;
00258     }
00259
00260     // We need a server thread per socket so allocate space for the thread handle
00261     server_threads = (HANDLE *)HeapAlloc(
00262                                         GetProcessHeap(),
00263                                         HEAP_ZERO_MEMORY,
00264                                         sizeof(HANDLE) * socket_count
00265                                         );
00266     if (server_threads == NULL)
00267     {
00268         fprintf(stderr, "HeapAlloc failed: %d\n", GetLastError());
00269         goto cleanup;
00270     }
00271
00272     // Create a thread for each address family which will handle that socket
00273     for (i=0; i < socket_count ;i++)
00274     {
00275         server_threads[i] = CreateThread(
00276                                         NULL,
00277                                         0,
00278                                         ServerThread,
00279                                         (LPVOID)server_sockets[i],
00280                                         0,
00281                                         NULL
00282                                         );
00283         if (server_threads[i] == NULL)
00284         {
00285             fprintf(stderr, "CreateThread failed: %d\n", GetLastError());
00286             goto cleanup;
00287         }
00288     }
00289
00290     // Wait until the threads exit, then cleanup
00291     retval = WaitForMultipleObjects(
00292                                    socket_count,
00293                                    server_threads,
00294                                    TRUE,
00295                                    INFINITE
00296                                    );
00297     if ((retval == WAIT_FAILED) || (retval == WAIT_TIMEOUT))
00298     {
00299         fprintf(stderr, "WaitForMultipleObjects failed: %d\n", GetLastError());
00300         goto cleanup;
00301     }
00302
00303     cleanup:
00304
00305     if (results != NULL)
00306     {
00307         freeaddrinfo(results);
00308         results = NULL;
00309     }
00310
00311     // Release socket resources
00312     if (server_sockets != NULL)
00313     {
00314         for (i=0; i < socket_count ;i++)
00315         {
00316             if (server_sockets[i] != INVALID_SOCKET)
00317                 closesocket(server_sockets[i]);
00318             server_sockets[i] = INVALID_SOCKET;
00319         }
00320
00321         // Free the array
00322         HeapFree(GetProcessHeap(), 0, server_sockets);
00323         server_sockets = NULL;
00324     }
00325
00326     // Release thread resources
00327     if (server_threads != NULL)
00328     {
00329         for (i=0; i < socket_count ;i++)
00330         {
00331             if (server_threads[i] != NULL)
00332                 CloseHandle(server_threads[i]);
00333             server_threads[i] = NULL;
00334         }
00335
00336         // Free the array
00337         HeapFree(GetProcessHeap(), 0, server_threads);
00338         server_threads = NULL;
00339     }
00340
00341     return 0;
00342 }
00343
00344 //
00345 // Function: ServerThread
00346 //
00347 // Description:
00348 //    This routine services a single server socket. For TCP this means accept
00349 //    a client connection and then recv and send in a loop. When the client
00350 //    closes the connection, wait for another client, etc. For UDP, we simply
00351 //    sit in a loop and recv a datagram and echo it back to its source. For any
00352 //    error, this routine exits.
00353 //
00354 DWORD WINAPI ServerThread(LPVOID lpParam)
00355 {
00356     SOCKET           s,                     // Server socket
00357     sc = INVALID_SOCKET;   // Client socket (TCP)
00358     SOCKADDR_STORAGE from;
00359     char             Buffer[DEFAULT_BUFFER_LEN],
00360     servstr[NI_MAXSERV],
00361     hoststr[NI_MAXHOST];
00362     int              socket_type,
00363     retval,
00364     fromlen,
00365     bytecount;
00366
00367     // Retrieve the socket handle
00368     s = (SOCKET) lpParam;
00369
00370     // Get the socket type back
00371     fromlen = sizeof(socket_type);
00372     retval = getsockopt(s, SOL_SOCKET, SO_TYPE, (char *)&socket_type, &fromlen);
00373     if (retval == INVALID_SOCKET)
00374     {
00375         fprintf(stderr, "getsockopt(SO_TYPE) failed: %d\n", WSAGetLastError());
00376         goto cleanup;
00377     }
00378
00379     for (;;)
00380     {
00381         fromlen = sizeof(from);
00382
00383         if (socket_type == SOCK_STREAM)
00384         {
00385             if (sc != INVALID_SOCKET)
00386             {
00387                 //
00388                 // If we have a client connection recv and send until done
00389                 //
00390                 bytecount = recv(sc, Buffer, DEFAULT_BUFFER_LEN, 0);
00391                 if (bytecount == SOCKET_ERROR)
00392                 {
00393                     fprintf(stderr, "recv failed: %d\n", WSAGetLastError());
00394                     goto cleanup;
00395                 }
00396                 else if (bytecount == 0)
00397                 {
00398                     // Client connection was closed
00399                     retval = shutdown(sc, SD_SEND);
00400                     if (retval == SOCKET_ERROR)
00401                     {
00402                         fprintf(stderr, "shutdown failed: %d\n", WSAGetLastError());
00403                         goto cleanup;
00404                     }
00405
00406                     closesocket(sc);
00407                     sc = INVALID_SOCKET;
00408                 }
00409                 else
00410                 {
00411                     printf("read %d bytes\n", bytecount);
00412
00413                     //
00414                     // Now echo the data back
00415                     //
00416
00417                     bytecount =  send(sc, Buffer, bytecount, 0);
00418                     if (bytecount == SOCKET_ERROR)
00419                     {
00420                         fprintf(stderr, "send failed: %d\n", WSAGetLastError());
00421                         goto cleanup;
00422                     }
00423
00424                     printf("wrote %d bytes\n", bytecount);
00425                 }
00426             }
00427             else
00428             {
00429                 //
00430                 // No client connection so wait for one
00431                 //
00432                 sc = accept(s, (SOCKADDR *)&from, &fromlen);
00433                 if (sc == INVALID_SOCKET)
00434                 {
00435                     fprintf(stderr, "accept failed: %d\n", WSAGetLastError());
00436                     goto cleanup;
00437                 }
00438
00439                 // Display the client's address
00440                 retval = getnameinfo(
00441                                     (SOCKADDR *)&from,
00442                                     fromlen,
00443                                     hoststr,
00444                                     NI_MAXHOST,
00445                                     servstr,
00446                                     NI_MAXSERV,
00447                                     NI_NUMERICHOST | NI_NUMERICSERV
00448                                     );
00449                 if (retval != 0)
00450                 {
00451                     fprintf(stderr, "getnameinfo failed: %d\n", retval);
00452                     goto cleanup;
00453                 }
00454
00455                 printf("Accepted connection from host %s and port %s\n",
00456                        hoststr, servstr);
00457             }
00458         }
00459         else
00460         {
00461             //
00462             // Receive and send data
00463             //
00464             bytecount = recvfrom(s, Buffer, DEFAULT_BUFFER_LEN, 0, (SOCKADDR *)&from, &fromlen);
00465             if (bytecount == SOCKET_ERROR)
00466             {
00467                 //
00468                 // We may get WSAECONNRESET errors in response to ICMP port unreachable
00469                 //    messages so we'll just ignore those
00470                 //
00471                 if (WSAGetLastError() != WSAECONNRESET)
00472                 {
00473                     fprintf(stderr, "recvfrom failed; %d\n", WSAGetLastError());
00474                     goto cleanup;
00475                 }
00476                 else
00477                 {
00478                     continue;
00479                 }
00480             }
00481
00482             //
00483             // Display the source of the datagram
00484             //
00485             retval = getnameinfo(
00486                                 (SOCKADDR *)&from,
00487                                 fromlen,
00488                                 hoststr,
00489                                 NI_MAXHOST,
00490                                 servstr,
00491                                 NI_MAXSERV,
00492                                 NI_NUMERICHOST | NI_NUMERICSERV
00493                                 );
00494             if (retval != 0)
00495             {
00496                 fprintf(stderr, "getnameinfo failed: %d\n", retval);
00497                 goto cleanup;
00498             }
00499
00500             printf("read %d bytes from host %s and port %s\n",
00501                    bytecount, hoststr, servstr);
00502
00503             //
00504             // Echo the datagram back
00505             //
00506             bytecount = sendto(s, Buffer, bytecount, 0, (SOCKADDR *)&from, fromlen);
00507             if (bytecount == SOCKET_ERROR)
00508             {
00509                 fprintf(stderr, "sendto failed: %d\n", WSAGetLastError());
00510                 goto cleanup;
00511             }
00512
00513             printf("sent %d bytes to host %s and port %s\n",
00514                    bytecount, hoststr, servstr);
00515         }
00516
00517     }
00518
00519     cleanup:
00520
00521     // Close the client connection if present
00522     if (sc != INVALID_SOCKET)
00523     {
00524         closesocket(sc);
00525         sc = INVALID_SOCKET;
00526     }
00527
00528     return 0;
00529 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/space.Cpp Source File

  • SysMgmt
  • MMC
  • Nodes

space.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Space.h"
00021 #include "Comp.h"
00022 #define STRSAFE_NO_DEPRECATE
00023 #include <strsafe.h>
00024
00025 const GUID CSpaceVehicle::thisGuid = { 0x29743810, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00026 const GUID CRocket::thisGuid = { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00027
00028 //==============================================================
00029 //
00030 // CSpaceVehicle implementation
00031 //
00032 //
00033 CSpaceVehicle::CSpaceVehicle()
00034 {
00035     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00036         children[n] = new CRocket(_T("Rocket"), n+1, 500000, 265, 75000);
00037     }
00038 }
00039
00040 CSpaceVehicle::~CSpaceVehicle()
00041 {
00042     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00043         if (children[n]) {
00044             delete children[n];
00045         }
00046 }
00047
00048 HRESULT CSpaceVehicle::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00049 {
00050     HRESULT      hr = S_OK;
00051
00052     IHeaderCtrl *pHeaderCtrl = NULL;
00053     IResultData *pResultData = NULL;
00054
00055     if (bShow) {
00056         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00057         _ASSERT( SUCCEEDED(hr) );
00058
00059         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00060         _ASSERT( SUCCEEDED(hr) );
00061
00062         // Set the column headers in the results pane
00063         hr = pHeaderCtrl->InsertColumn( 0, L"Rocket Class", 0, MMCLV_AUTO );
00064         _ASSERT( S_OK == hr );
00065         hr = pHeaderCtrl->InsertColumn( 1, L"Rocket Weight", 0, MMCLV_AUTO );
00066         _ASSERT( S_OK == hr );
00067         hr = pHeaderCtrl->InsertColumn( 2, L"Rocket Height", 0, MMCLV_AUTO );
00068         _ASSERT( S_OK == hr );
00069         hr = pHeaderCtrl->InsertColumn( 3, L"Rocket Payload", 0, MMCLV_AUTO );
00070         _ASSERT( S_OK == hr );
00071         hr = pHeaderCtrl->InsertColumn( 4, L"Status", 0, MMCLV_AUTO );
00072         _ASSERT( S_OK == hr );
00073
00074         // insert items here
00075         RESULTDATAITEM rdi;
00076
00077         hr = pResultData->DeleteAllRsltItems();
00078         _ASSERT( SUCCEEDED(hr) );
00079
00080         if (!bExpanded) {
00081             // create the child nodes, then expand them
00082             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00083                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00084                 rdi.mask       = RDI_STR       |   // Displayname is valid
00085                     RDI_IMAGE     |
00086                     RDI_PARAM;        // nImage is valid
00087
00088                 rdi.nImage      = children[n]->GetBitmapIndex();
00089                 rdi.str         = MMC_CALLBACK;
00090                 rdi.nCol        = 0;
00091                 rdi.lParam      = (LPARAM)children[n];
00092
00093                 hr = pResultData->InsertItem( &rdi );
00094
00095                 _ASSERT( SUCCEEDED(hr) );
00096             }
00097         }
00098
00099         pHeaderCtrl->Release();
00100         pResultData->Release();
00101     }
00102
00103     return hr;
00104 }
00105
00106 //==============================================================
00107 //
00108 // CRocket implementation
00109 //
00110 //
00111 CRocket::CRocket(_TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload)
00112 : szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED)
00113 {
00114     if (szName) {
00115         this->szName = new _TCHAR[(_tcslen(szName) + 1) * sizeof(_TCHAR)];
00116         _tcscpy(this->szName, szName);
00117     }
00118
00119     this->nId = id;
00120     this->lWeight = lWeight;
00121     this->lHeight = lHeight;
00122     this->lPayload = lPayload;
00123 }
00124
00125 CRocket::~CRocket()
00126 {
00127     if (szName)
00128         delete [] szName;
00129 }
00130
00131 const _TCHAR *CRocket::GetDisplayName(int nCol)
00132 {
00133     const size_t cchBuffer = 128;
00134     _TCHAR buf[cchBuffer];
00135
00136     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00137     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00138
00139     switch (nCol) {
00140     case 0:
00141         StringCchPrintf(buf, cchBuffer, _T("%s (#%d)"), szName ? szName : _T(""), nId);
00142         break;
00143
00144     case 1:
00145         StringCchPrintf(buf, cchBuffer, _T("%ld metric tons"), lWeight);
00146         break;
00147
00148     case 2:
00149         StringCchPrintf(buf, cchBuffer, _T("%ld meters"), lHeight);
00150         break;
00151
00152     case 3:
00153         StringCchPrintf(buf, cchBuffer, _T("%ld kilos"), lPayload);
00154         break;
00155
00156     case 4:
00157         StringCchPrintf(buf, cchBuffer, _T("%s"),
00158             iStatus == RUNNING ? _T("running") :
00159         iStatus == PAUSED ? _T("paused") :
00160         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00161         break;
00162
00163     }
00164
00165     _TCHAR *pszCol =
00166         static_cast<_TCHAR *>(CoTaskMemAlloc((_tcslen(buf) + 1) * sizeof(WCHAR)));
00167     _tcscpy(pszCol, buf);
00168
00169     return pszCol;
00170 }
00171
00172 HRESULT CRocket::OnRename(LPOLESTR pszNewName)
00173 {
00174     if (szName) {
00175         delete [] szName;
00176         szName = NULL;
00177     }
00178
00179     MAKE_TSTRPTR_FROMWIDE(ptrname, pszNewName);
00180     szName = new _TCHAR[(_tcslen(ptrname) + 1) * sizeof(_TCHAR)];
00181     _tcscpy(szName, ptrname);
00182
00183     return S_OK;
00184 }
00185
00186 HRESULT CRocket::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00187 {
00188     IConsoleVerb *pConsoleVerb;
00189
00190     HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00191     _ASSERT(SUCCEEDED(hr));
00192
00193     hr = pConsoleVerb->SetVerbState(MMC_VERB_RENAME, ENABLED, TRUE);
00194
00195     pConsoleVerb->Release();
00196
00197     return S_OK;
00198 }
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/RecWDlg.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

RecWDlg.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // RecWDlg.cpp : implementation file
00013 //
00014
00015
00016
00017 #include "stdafx.h"
00018 #include "MQApitst.h"
00019 #include "RecWDlg.h"
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CReceiveWaitDialog dialog
00029
00030
00031 CReceiveWaitDialog::CReceiveWaitDialog(CWnd* pParent /*=NULL*/)
00032   : CDialog(CReceiveWaitDialog::IDD, pParent)
00033 {
00034   //{{AFX_DATA_INIT(CReceiveWaitDialog)
00035     // NOTE: the ClassWizard will add member initialization here
00036   //}}AFX_DATA_INIT
00037 }
00038
00039
00040 void CReceiveWaitDialog::DoDataExchange(CDataExchange* pDX)
00041 {
00042   CDialog::DoDataExchange(pDX);
00043   //{{AFX_DATA_MAP(CReceiveWaitDialog)
00044     // NOTE: the ClassWizard will add DDX and DDV calls here
00045   //}}AFX_DATA_MAP
00046 }
00047
00048
00049 BEGIN_MESSAGE_MAP(CReceiveWaitDialog, CDialog)
00050   //{{AFX_MSG_MAP(CReceiveWaitDialog)
00051     // NOTE: the ClassWizard will add message map macros here
00052   //}}AFX_MSG_MAP
00053 END_MESSAGE_MAP()
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // CReceiveWaitDialog message handlers
00057
00058
00059 void CReceiveWaitDialog::CenterWindow()
00060 {
00061     CWnd * pParent = GetParent();
00062     RECT parentRect;
00063     RECT childRect;
00064
00065     pParent->GetWindowRect(&parentRect);
00066     int dxP = parentRect.right-parentRect.left;
00067     int dyP = parentRect.bottom - parentRect.top;
00068
00069     GetWindowRect(&childRect);
00070     int dxC = childRect.right-childRect.left;
00071     int dyC = childRect.bottom - childRect.top;
00072
00073     childRect.left = dxP/2-dxC/2;
00074     childRect.right = childRect.left+dxC;
00075
00076     childRect.top = dyP/2-dyC/2;
00077     childRect.bottom = childRect.top+dyC;
00078
00079     MoveWindow(&childRect);
00080 };
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/globals.h Source File

  • SysMgmt
  • MMC
  • Nameext

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023 #include <mmc.h>
00024
00025 #ifndef STRINGS_ONLY
00026   #define IDM_BUTTON1    0x100
00027   #define IDM_BUTTON2    0x101
00028
00029   extern HINSTANCE g_hinst;
00030   extern ULONG g_uObjects;
00031
00032   #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00033   #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00034
00035   // uncomment the following #define to enable message cracking
00036   // #define MMC_CRACK_MESSAGES
00037   void MMCN_Crack(BOOL bComponentData,
00038           IDataObject *pDataObject,
00039           IComponentData *pCompData,
00040           IComponent *pComp,
00041           MMC_NOTIFY_TYPE event,
00042           LPARAM arg,
00043           LPARAM param);
00044 #endif
00045
00046 //=--------------------------------------------------------------------------=
00047 // allocates a temporary buffer that will disappear when it goes out of scope
00048 // NOTE: be careful of that -- make sure you use the string in the same or
00049 // nested scope in which you created this buffer. people should not use this
00050 // class directly.  use the macro(s) below.
00051 //
00052 class TempBuffer {
00053   public:
00054     TempBuffer(ULONG cBytes) {
00055         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00056         m_fHeapAlloc = (cBytes > 120);
00057     }
00058     ~TempBuffer() {
00059         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00060     }
00061     void *GetBuffer() {
00062         return m_pBuf;
00063     }
00064
00065   private:
00066     void *m_pBuf;
00067     // we'll use this temp buffer for small cases.
00068     //
00069     char  m_szTmpBuf[120];
00070     unsigned m_fHeapAlloc:1;
00071 };
00072
00073 //=--------------------------------------------------------------------------=
00074 // string helpers.
00075 //
00076 // given a _TCHAR, copy it into a wide buffer.
00077 // be careful about scoping when using this macro!
00078 //
00079 // how to use the below two macros:
00080 //
00081 //  ...
00082 //  LPTSTR pszT;
00083 //  pszT = MyGetTStringRoutine();
00084 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00085 //  MyUseWideStringRoutine(pwsz);
00086 //  ...
00087 #ifdef UNICODE
00088 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00089     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00090     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00091     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00092     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00093 #else // ANSI
00094 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00095     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00096     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00097     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00098     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00099     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00100 #endif
00101
00102 #ifdef UNICODE
00103 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00104     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00105     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00106     lstrcpyW((LPWSTR)ptrname, tstr)
00107 #else // ANSI
00108 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00109     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00110     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00111     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00112     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00113 #endif
00114
00115 //
00116 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00117 // have to be declared, and no clean up must be done.
00118 //
00119 // * 2 for DBCS handling in below length computation
00120 //
00121 #ifdef UNICODE
00122 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00123     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00124     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00125     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00126     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00127 #else // ANSI
00128 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00129     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00130     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00131     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00132     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00133 #endif
00134
00135 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/dataobj.h Source File

  • SysMgmt
  • MMC
  • Nodes

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097 BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
00098
00099 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/Errors.c Source File

  • Multimedia
  • Gdi
  • WinCap32

Errors.c

Go to the documentation of this file.
00001 //
00002 // Errors.c
00003 //
00004 // Contains error messages for DIBAPI.DLL
00005 //
00006 // These error messages all have constants associated with
00007 // them, contained in dibapi.h.
00008 //
00009 // Copyright 1991 - 2000 Microsoft Corporation. All rights reserved.
00010 //
00011
00012 #define     STRICT      // enable strict type checking
00013
00014 #include <windows.h>
00015 #include "dibapi.h"
00016
00017 extern WORD nLangID;
00018 static char *szErrors[] =
00019 {
00020     "Not a Windows DIB file!",
00021     "Couldn't allocate memory!",
00022     "Error reading file!",
00023     "Error locking memory!",
00024     "Error opening file!",
00025     "Error creating palette!",
00026     "Error getting a DC!",
00027     "Error creating Device Dependent Bitmap",
00028     "StretchBlt() failed!",
00029     "StretchDIBits() failed!",
00030     "SetDIBitsToDevice() failed!",
00031     "Printer: StartDoc failed!",
00032     "Printing: GetModuleHandle() couldn't find GDI!",
00033     "Printer: SetAbortProc failed!",
00034     "Printer: StartPage failed!",
00035     "Printer: NEWFRAME failed!",
00036     "Printer: EndPage failed!",
00037     "Printer: EndDoc failed!",
00038     "SetDIBits() failed!",
00039     "File Not Found!",
00040     "Invalid Handle",
00041     "General Error on call to DIB function"
00042 };
00043
00044 static char *szErrorsJ[] =
00045 {
00046     "Windows DIB ファイルではありません。",
00047     "メモリを確保することができませんでした。",
00048     "ファイルの読み込みエラー",
00049     "メモリのロック エラー",
00050     "ファイルのオープン エラー",
00051     "パレットの作成エラー",
00052     "デバイス コンテキストの取得エラー",
00053     "デバイス依存ビットマップの作成エラー",
00054     "StretchBlt() が失敗しました。",
00055     "StretchDIBits() が失敗しました。",
00056     "SetDIBitsToDevice() が失敗しました。",
00057     "プリンタ: StartDoc が失敗しました。",
00058     "印刷: GetModuleHandle() GDI が見つかりませんでした。",
00059     "プリンタ: SetAbortProc が失敗しました。",
00060     "プリンタ: StartPage が失敗しました。",
00061     "プリンタ: NEWFRAME が失敗しました。",
00062     "プリンタ: EndPage が失敗しました。",
00063     "プリンタ: EndDoc が失敗しました。",
00064     "SetDIBits() が失敗しました。",
00065     "ファイルが見つかりませんでした。",
00066     "無効なハンドル",
00067     "DIB ファンクション呼び出しでの一般エラー"
00068 };
00069
00070 void DIBError(int ErrNo)
00071 {
00072     if (nLangID == LANG_JAPANESE) {
00073         if ((ErrNo < ERR_MIN) || (ErrNo >= ERR_MAX))
00074             MessageBox(NULL, "未知のエラー。", NULL, MB_OK | MB_ICONHAND);
00075         else
00076             MessageBox(NULL, szErrorsJ[ErrNo], NULL, MB_OK | MB_ICONHAND);
00077     }
00078     else {
00079         if ((ErrNo < ERR_MIN) || (ErrNo >= ERR_MAX))
00080             MessageBox(NULL, "Undefined Error!", NULL, MB_OK | MB_ICONHAND);
00081         else
00082             MessageBox(NULL, szErrors[ErrNo], NULL, MB_OK | MB_ICONHAND);
00083     }
00084 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBSTR Member List

This is the complete list of members for CBSTR, including all inherited members.
CBSTR() | CBSTR | [inline]
CBSTR(LPWSTR pSrc) | CBSTR | [inline]
CBSTR() | CBSTR | [inline]
CBSTR(LPWSTR pSrc) | CBSTR | [inline]
m_pStr | CBSTR | [private]
operator BSTR() | CBSTR | [inline]
operator BSTR() | CBSTR | [inline]
Unbind() | CBSTR | [inline]
Unbind() | CBSTR | [inline]
~CBSTR() | CBSTR | [inline]
~CBSTR() | CBSTR | [inline]
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcNotify/INotifyDefault.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcNotify

INotifyDefault.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc24F.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCNotify.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcnotify;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface INotifyDefault
00019 /** @com.interface(iid=00020400-0000-0000-C000-000000000046, thread=AUTO, type=DUAL) */
00020 public interface INotifyDefault extends qcnotify.INotify
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPPUT, name="CustomerId", name2="putCustomerId", addFlagsVtable=4)
00023       @com.parameters([in,type=I4] _jcomparam_0) */
00024   public void setCustomerId(int _jcomparam_0);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=PROPPUT, name="OrderId", name2="putOrderId", addFlagsVtable=4)
00027       @com.parameters([in,type=I4] _jcomparam_0) */
00028   public void setOrderId(int _jcomparam_0);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LineItem", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] lItemId, [in,type=I4] lQuantity, [in,type=I4] ShipStatus) */
00032   public void LineItem(int lItemId, int lQuantity, int ShipStatus);
00033
00034   /** @com.method(vtoffset=7, dispid=4, type=METHOD, name="Process", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] lFlags) */
00036   public void Process(int lFlags);
00037
00038
00039   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x20400, (short)0x0, (short)0x0, (byte)0xc0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x46);
00040 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/Provider.h Source File

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

Provider.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  Provider.cpp
00006 //
00007 // Description: Event consumer provider class definition
00008 //
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include <wbemcli.h>
00015 #include <wbemprov.h>
00016
00017 class CProvider : public IWbemEventConsumerProvider
00018 {
00019 public:
00020   CProvider(CListBox  *pOutputList);
00021   ~CProvider();
00022
00023     // IUnknown members
00024     STDMETHODIMP         QueryInterface(REFIID, LPVOID *);
00025     STDMETHODIMP_(ULONG) AddRef(void);
00026     STDMETHODIMP_(ULONG) Release(void);
00027
00028   STDMETHOD(Initialize)(
00029       LPWSTR pszUser,
00030       LONG lFlags,
00031       LPWSTR pszNamespace,
00032       LPWSTR pszLocale,
00033       IWbemServices __RPC_FAR *pNamespace,
00034       IWbemContext __RPC_FAR *pCtx,
00035       IWbemProviderInitSink __RPC_FAR *pInitSink);
00036
00037     STDMETHOD(FindConsumer)(
00038       IWbemClassObject* pLogicalConsumer,
00039       IWbemUnboundObjectSink** ppConsumer);
00040
00041 private:
00042
00043   DWORD m_cRef;
00044   CListBox  *m_pOutputList;
00045 };
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagSHOWPROPERTIESCOMPLETEDMSG Member List

This is the complete list of members for _tagSHOWPROPERTIESCOMPLETEDMSG, including all inherited members.
hr _tagSHOWPROPERTIESCOMPLETEDMSG
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FONTLIST Member List

This is the complete list of members for FONTLIST, including all inherited members.
count | FONTLIST
hList | FONTLIST
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminSynchronizationOptions Member List

This is the complete list of members for comadmin::COMAdminSynchronizationOptions, including all inherited members.
COMAdminSynchronizationIgnored | comadmin::COMAdminSynchronizationOptions | [static]
COMAdminSynchronizationNone | comadmin::COMAdminSynchronizationOptions | [static]
COMAdminSynchronizationRequired | comadmin::COMAdminSynchronizationOptions | [static]
COMAdminSynchronizationRequiresNew | comadmin::COMAdminSynchronizationOptions | [static]
COMAdminSynchronizationSupported | comadmin::COMAdminSynchronizationOptions | [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057
00058     // first things first, make sure that when MMC
00059     // asks if we do property sheets, that we actually
00060     // say "yes"
00061     else if (IsEqualIID(riid, IID_IExtendPropertySheet) ||
00062         IsEqualIID(riid, IID_IExtendPropertySheet2))
00063         *ppv = static_cast<IExtendPropertySheet2 *>(this);
00064
00065     if (*ppv)
00066     {
00067         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00068         return S_OK;
00069     }
00070
00071     return E_NOINTERFACE;
00072 }
00073
00074 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00075 {
00076     return InterlockedIncrement((LONG *)&m_cref);
00077 }
00078
00079 STDMETHODIMP_(ULONG) CComponentData::Release()
00080 {
00081     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00082     {
00083         // we need to decrement our object count in the DLL
00084         delete this;
00085         return 0;
00086     }
00087
00088     return m_cref;
00089 }
00090
00091 ///////////////////////////////
00092 // Interface IComponentData
00093 ///////////////////////////////
00094 HRESULT CComponentData::Initialize(
00095                                    /* [in] */ LPUNKNOWN pUnknown)
00096 {
00097     HRESULT      hr;
00098
00099     //
00100     // Get pointer to name space interface
00101     //
00102     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00103     _ASSERT( S_OK == hr );
00104
00105     //
00106     // Get pointer to console interface
00107     //
00108     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00109     _ASSERT( S_OK == hr );
00110
00111     IImageList *pImageList;
00112     m_ipConsole->QueryScopeImageList(&pImageList);
00113     _ASSERT( S_OK == hr );
00114
00115     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00116         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00117         0, // index of the first image in the strip
00118         RGB(0, 128, 128)  // color of the icon mask
00119         );
00120
00121     pImageList->Release();
00122
00123     return S_OK;
00124 }
00125
00126 HRESULT CComponentData::CreateComponent(
00127                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00128 {
00129     *ppComponent = NULL;
00130
00131     CComponent *pComponent = new CComponent(this);
00132
00133     if (NULL == pComponent)
00134         return E_OUTOFMEMORY;
00135
00136     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00137 }
00138
00139 HRESULT CComponentData::Notify(
00140                                /* [in] */ LPDATAOBJECT lpDataObject,
00141                                /* [in] */ MMC_NOTIFY_TYPE event,
00142                                /* [in] */ LPARAM arg,
00143                                /* [in] */ LPARAM param)
00144 {
00145     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00146
00147     HRESULT hr = S_FALSE;
00148
00149   //Get our data object. If it is NULL, we return with S_FALSE.
00150   //See implementation of GetOurDataObject() to see how to
00151   //handle special data objects.
00152   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00153   if (NULL == pDataObject)
00154     return S_FALSE;
00155
00156   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00157
00158     switch (event)
00159     {
00160     case MMCN_EXPAND:
00161         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00162         break;
00163     }
00164
00165     return hr;
00166 }
00167
00168 HRESULT CComponentData::Destroy( void)
00169 {
00170     // Free interfaces
00171     if (m_ipConsoleNameSpace) {
00172         m_ipConsoleNameSpace->Release();
00173         m_ipConsoleNameSpace = NULL;
00174     }
00175
00176     if (m_ipConsole) {
00177         m_ipConsole->Release();
00178         m_ipConsole = NULL;
00179     }
00180
00181     return S_OK;
00182 }
00183
00184 HRESULT CComponentData::QueryDataObject(
00185                                         /* [in] */ MMC_COOKIE cookie,
00186                                         /* [in] */ DATA_OBJECT_TYPES type,
00187                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00188 {
00189     CDataObject *pObj = NULL;
00190
00191     if (cookie == 0)
00192         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00193     else
00194         pObj = new CDataObject(cookie, type);
00195
00196     if (!pObj)
00197         return E_OUTOFMEMORY;
00198
00199     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00200
00201     return S_OK;
00202 }
00203
00204 HRESULT CComponentData::GetDisplayInfo(
00205                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00206 {
00207     HRESULT hr = S_FALSE;
00208
00209     // if they are asking for the SDI_STR we have one of those to give
00210     if (pScopeDataItem->lParam) {
00211         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00212         if (pScopeDataItem->mask & SDI_STR) {
00213                         LPCTSTR pszT = base->GetDisplayName();
00214                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00215             pScopeDataItem->displayname = pszW;
00216         }
00217
00218         if (pScopeDataItem->mask & SDI_IMAGE) {
00219             pScopeDataItem->nImage = base->GetBitmapIndex();
00220         }
00221     }
00222
00223     return hr;
00224 }
00225
00226 HRESULT CComponentData::CompareObjects(
00227                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00228                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00229 {
00230     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00231     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00232
00233     // compare the object pointers
00234     if (baseA->GetCookie() == baseB->GetCookie())
00235         return S_OK;
00236
00237     return S_FALSE;
00238 }
00239
00240 ///////////////////////////////////
00241 // Interface IExtendPropertySheet2
00242 ///////////////////////////////////
00243 HRESULT CComponentData::CreatePropertyPages(
00244                                             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00245                                             /* [in] */ LONG_PTR handle,
00246                                             /* [in] */ LPDATAOBJECT lpIDataObject)
00247 {
00248     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00249
00250     return base->CreatePropertyPages(lpProvider, handle);
00251 }
00252
00253 HRESULT CComponentData::QueryPagesFor(
00254                                       /* [in] */ LPDATAOBJECT lpDataObject)
00255 {
00256     CDelegationBase *base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00257
00258     return base->HasPropertySheets();
00259 }
00260
00261 HRESULT CComponentData::GetWatermarks(
00262                                       /* [in] */ LPDATAOBJECT lpIDataObject,
00263                                       /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00264                                       /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00265                                       /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00266                                       /* [out] */ BOOL __RPC_FAR *bStretch)
00267 {
00268     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00269
00270     return base->GetWatermarks(lphWatermark, lphHeader, lphPalette, bStretch);
00271 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/ADOVCGEN/adoheader.h Source File

  • Dataaccess
  • ADO
  • ADOVCGEN

adoheader.h

Go to the documentation of this file.
00001 // Start of ADOHeader.h
00002
00003 #ifndef _ADOHEADER_4B4143B7_6072_419e_ADD5_B8B57E5EC713_H
00004 #define _ADOHEADER_4B4143B7_6072_419e_ADD5_B8B57E5EC713_H
00005
00006 #pragma warning(disable: 4146)  // Q231931
00007 #pragma warning(disable: 4192)
00008 #undef EOF
00009 #import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename_namespace("ado20")
00010 #pragma warning(default: 4146)
00011 #import "C:\Program Files\Common Files\System\ole db\oledb32.dll" rename_namespace("msdasc")
00012 #pragma warning(default: 4192)
00013
00014 #define MAX_COUNT 256
00015 #define TRYDB try{
00016 #define CATCHDB } catch(CException *err) {  err->ReportError(); err->Delete(); }
00017
00018 #endif
00019
00020 // Start of ADOHeader.h
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CConfNotify Member List

This is the complete list of members for CConfNotify, including all inherited members.
AddRef(void) | CConfNotify |
AddRef(void) | CConfNotify |
AddRef(void) | CConfNotify |
AddRef(void) | CConfNotify |
AddRef(void) | CConfNotify |
RefCount::AddRef(void) | RefCount |
CRefCount::AddRef(void) | CRefCount |
CConfNotify() | CConfNotify |
CConfNotify() | CConfNotify |
CConfNotify() | CConfNotify |
CConfNotify() | CConfNotify |
CConfNotify() | CConfNotify | [private]
CConfNotify(Conf *) | CConfNotify |
ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel) | CConfNotify |
ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel) | CConfNotify |
ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel) | CConfNotify |
ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel) | CConfNotify |
ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel) | CConfNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
Connect(IUnknown *pUnk) | CConfNotify |
Connect(IUnknown *pUnk) | CConfNotify |
Connect(IUnknown *pUnk) | CConfNotify |
Connect(IUnknown *pUnk) | CConfNotify |
Connect(IUnknown *pUnkOuter) | CConfNotify |
CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN) | CNotify |
CRefCount() | CRefCount |
Disconnect(void) | CConfNotify |
Disconnect(void) | CConfNotify |
Disconnect(void) | CConfNotify |
Disconnect(void) | CConfNotify |
Disconnect(void) | CConfNotify |
GetIMemberArray(void) | CConfNotify | [inline]
GetIMemberCount(void) | CConfNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
m_apIMembers | CConfNotify | [private]
m_cIMembers | CConfNotify | [private]
m_pConf | CConfNotify | [private]
MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pfMember) | CConfNotify |
MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pfMember) | CConfNotify |
MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pfMember) | CConfNotify |
MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pfMember) | CConfNotify |
MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember) | CConfNotify |
NmUI(CONFN uNotify) | CConfNotify |
NmUI(CONFN uNotify) | CConfNotify |
NmUI(CONFN uNotify) | CConfNotify |
NmUI(CONFN uNotify) | CConfNotify |
NmUI(CONFN uNotify) | CConfNotify |
QueryInterface(REFIID riid, PVOID *ppvObj) | CConfNotify |
QueryInterface(REFIID riid, void **ppvObj) | CConfNotify |
QueryInterface(REFIID riid, PVOID *ppvObj) | CConfNotify |
QueryInterface(REFIID riid, PVOID *ppvObj) | CConfNotify |
QueryInterface(REFIID riid, PVOID *ppvObject) | CConfNotify |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
Release(void) | CConfNotify |
Release(void) | CConfNotify |
Release(void) | CConfNotify |
Release(void) | CConfNotify |
Release(void) | CConfNotify |
RefCount::Release(void) | RefCount |
CRefCount::Release(void) | CRefCount |
ReleaseIMemberArray(void) | CConfNotify |
StateChanged(NM_CONFERENCE_STATE uState) | CConfNotify |
StateChanged(NM_CONFERENCE_STATE uState) | CConfNotify |
StateChanged(NM_CONFERENCE_STATE uState) | CConfNotify |
StateChanged(NM_CONFERENCE_STATE uState) | CConfNotify |
StateChanged(NM_CONFERENCE_STATE uState) | CConfNotify |
~CConfNotify() | CConfNotify |
~CConfNotify() | CConfNotify |
~CConfNotify() | CConfNotify |
~CConfNotify() | CConfNotify |
~CConfNotify() | CConfNotify | [virtual]
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~CRefCount() | CRefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
Generated on Wed Nov 13 2024 16:55:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

REQUEST_CONTEXT Member List

This is the complete list of members for REQUEST_CONTEXT, including all inherited members.
dwSize | REQUEST_CONTEXT
dwThreadID | REQUEST_CONTEXT
dwTotalSize | REQUEST_CONTEXT
hConnect | REQUEST_CONTEXT
hOpen | REQUEST_CONTEXT
hRequest | REQUEST_CONTEXT
hResource | REQUEST_CONTEXT
hThread | REQUEST_CONTEXT
hWindow | REQUEST_CONTEXT
lpBuffer | REQUEST_CONTEXT
nHeader | REQUEST_CONTEXT
nResource | REQUEST_CONTEXT
nURL | REQUEST_CONTEXT
szMemo | REQUEST_CONTEXT
szMemo | REQUEST_CONTEXT
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagRGPT Member List

This is the complete list of members for tagRGPT, including all inherited members.
iInfo tagRGPT
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PrintContext Member List

This is the complete list of members for PrintContext, including all inherited members.
foot | PrintContext
head | PrintContext
id | PrintContext
margin | PrintContext
pd | PrintContext
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/StdAfx.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

StdAfx.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            StdAfx.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #include "stdafx.h"
00013
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptServe/Factory.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptServe

Factory.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.CPP
00003
00004   Summary:   Implementation file for the ClassFactories of the APTSERVE
00005              server.  This server provides several Car-related COM
00006              Components: Car, UtilityCar, and CruiseCar.  For each of
00007              these components, IClassFactory is implemented in
00008              appropriate ClassFactory COM objects: CFCar, CFUtilityCar,
00009              and CFCruiseCar. The COM Components that can be manufactured
00010              by this server are known outside the server by their
00011              respective CLSIDs: CLSID_AptCar, CLSID_AptUtilityCar,
00012              and CLSID_AptCruiseCar.
00013
00014              For a comprehensive tutorial code tour of this module's
00015              contents and offerings see the tutorial APTSERVE.HTM file.
00016              For more specific technical details on the internal workings
00017              see the comments dispersed throughout the module's source code.
00018
00019   Classes:   CFCar, CFUtilityCar, CFCruiseCar
00020
00021   Functions: .
00022
00023   Origin:    3-20-96: atrent - Editor-inheritance from CAR.CPP in
00024                the LOCSERVE Tutorial Code Sample.
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 /*---------------------------------------------------------------------------
00042   We include WINDOWS.H for all Win32 applications.
00043   We include OLE2.H because we will be calling the COM/OLE Libraries.
00044   We include APPUTIL.H because we will be building this DLL using
00045     the convenient Virtual Window and Dialog classes and other
00046     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00047   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00048     class, GUID, and CLSID specifications.
00049   We include SERVER.H because it has the necessary internal class and
00050     resource definitions for this DLL.
00051   We include FACTORY.H because it has the necessary internal class factory
00052     declarations for this DLL component server.  Those factories we will be
00053     implementing in this module.
00054   We include CAR.H, UTILCAR,H, and, CRUCAR.H for the object class
00055     declarations for the COCar, COUtilityCar, and COCruiseCar COM objects.
00056 ---------------------------------------------------------------------------*/
00057 #include <windows.h>
00058 #include <ole2.h>
00059 #include <apputil.h>
00060 #include <micars.h>
00061 #include <carguids.h>
00062 #include "server.h"
00063 #include "factory.h"
00064 #include "car.h"
00065 #include "utilcar.h"
00066 #include "crucar.h"
00067
00068 /*---------------------------------------------------------------------------
00069   Implementation the CFCar Class Factory.  CFCar is the COM
00070   object class for the Class Factory that can manufacture COCar
00071   COM Components.
00072 ---------------------------------------------------------------------------*/
00073
00074 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00075   Method:   CFCar::CFCar
00076
00077   Summary:  CFCar Constructor. Note the member initializer:
00078             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00079             to pass the 'this', pUnkOuter, and pServer pointers of this
00080             constructor function to the constructor executed in the
00081             instantiation of the CImpIClassFactory interface whose
00082             implementation is nested inside this present object class.
00083
00084   Args:     IUnknown* pUnkOuter,
00085               Pointer to the the outer Unknown.  NULL means this COM Object
00086               is not being Aggregated.  Non NULL means it is being created
00087               on behalf of an outside COM object that is reusing it via
00088               aggregation.
00089             CServer* pServer)
00090               Pointer to the server's control object.
00091
00092   Modifies: m_cRefs, m_pUnkOuter.
00093
00094   Returns:  void
00095 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00096 CFCar::CFCar(
00097   IUnknown* pUnkOuter,
00098   CServer* pServer) :
00099   m_ImpIClassFactory(this, pUnkOuter, pServer)
00100 {
00101   // Zero the COM object's reference count.
00102   m_cRefs = 0;
00103
00104   // No AddRef necessary if non-NULL, as we're nested.
00105   m_pUnkOuter = pUnkOuter;
00106
00107   // Init the pointer to the server control object.
00108   m_pServer = pServer;
00109
00110   LOGF2("L<%X>: CFCar Constructor. m_pUnkOuter=0x%X.",TID,m_pUnkOuter);
00111
00112   return;
00113 }
00114
00115
00116 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00117   Method:   CFCar::~CFCar
00118
00119   Summary:  CFCar Destructor.
00120
00121   Args:     void
00122
00123   Returns:  void
00124 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00125 CFCar::~CFCar(void)
00126 {
00127   LOGF1("L<%X>: CFCar::Destructor.",TID);
00128
00129   return;
00130 }
00131
00132
00133 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00134   Method:   CFCar::QueryInterface
00135
00136   Summary:  QueryInterface of the CFCar non-delegating
00137             IUnknown implementation.
00138
00139   Args:     REFIID riid,
00140               [in] GUID of the Interface being requested.
00141             PPVOID ppv)
00142               [out] Address of the caller's pointer variable that will
00143               receive the requested interface pointer.
00144
00145   Returns:  HRESULT
00146               Standard result code. NOERROR for success.
00147 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00148 STDMETHODIMP CFCar::QueryInterface(
00149                REFIID riid,
00150                PPVOID ppv)
00151 {
00152   HRESULT hr = E_NOINTERFACE;
00153   *ppv = NULL;
00154
00155   if (IID_IUnknown == riid)
00156   {
00157     *ppv = this;
00158     LOGF1("L<%X>: CFCar::QueryInterface. 'this' pIUnknown returned.",TID);
00159   }
00160   else if (IID_IClassFactory == riid)
00161   {
00162     *ppv = &m_ImpIClassFactory;
00163     LOGF1("L<%X>: CFCar::QueryInterface. pIClassFactory returned.",TID);
00164   }
00165
00166   if (NULL != *ppv)
00167   {
00168     // We've handed out a pointer to the interface so obey the COM rules
00169     // and AddRef the reference count.
00170     ((LPUNKNOWN)*ppv)->AddRef();
00171     hr = NOERROR;
00172   }
00173
00174   return (hr);
00175 }
00176
00177
00178 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00179   Method:   CFCar::AddRef
00180
00181   Summary:  AddRef of the CFCar non-delegating IUnknown implementation.
00182
00183   Args:     void
00184
00185   Modifies: m_cRefs.
00186
00187   Returns:  ULONG
00188               New value of m_cRefs (COM object's reference count).
00189 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00190 STDMETHODIMP_(ULONG) CFCar::AddRef(void)
00191 {
00192   InterlockedIncrement((PLONG) &m_cRefs);
00193
00194   LOGF2("L<%X>: CFCar::AddRef. New cRefs=%i.",TID,m_cRefs);
00195
00196   return m_cRefs;
00197 }
00198
00199
00200 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00201   Method:   CFCar::Release
00202
00203   Summary:  Release of the CFCar non-delegating IUnknown implementation.
00204
00205   Args:     void
00206
00207   Modifies: m_cRefs.
00208
00209   Returns:  ULONG
00210               New value of m_cRefs (COM object's reference count).
00211 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00212 STDMETHODIMP_(ULONG) CFCar::Release(void)
00213 {
00214   ULONG cRefs;
00215   InterlockedDecrement((PLONG) &m_cRefs);
00216   cRefs = m_cRefs;
00217
00218   LOGF2("L<%X>: CFCar::Release. New cRefs=%i.",TID,m_cRefs);
00219
00220   if (0 == m_cRefs)
00221   {
00222     // We artificially bump the main ref count to prevent reentrancy
00223     // via the main object destructor.  Not really needed in this
00224     // CFCar but a good practice because we are aggregatable and
00225     // may at some point in the future add something entertaining like
00226     // some Releases to the CFCar destructor.
00227     InterlockedIncrement((PLONG) &m_cRefs);
00228     delete this;
00229   }
00230
00231   return cRefs;
00232 }
00233
00234
00235 /*---------------------------------------------------------------------------
00236   CFCar's nested implementation of the IClassFactory interface
00237   including Constructor, Destructor, QueryInterface, AddRef, Release,
00238   CreateInstance, and LockServer methods.
00239 ---------------------------------------------------------------------------*/
00240
00241 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00242   Method:   CFCar::CImpIClassFactory::CImpIClassFactory
00243
00244   Summary:  Constructor for the CImpIClassFactory interface instantiation.
00245
00246   Args:     CFCar* pBackObj,
00247               Back pointer to the parent outer object.
00248             IUnknown* pUnkOuter,
00249               Pointer to the outer Unknown.  For delegation.
00250             CServer* pServer)
00251               Pointer to the server's control object.
00252
00253   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter, m_pServer.
00254
00255   Returns:  void
00256 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00257 CFCar::CImpIClassFactory::CImpIClassFactory(
00258   CFCar* pBackObj,
00259   IUnknown* pUnkOuter,
00260   CServer* pServer)
00261 {
00262   // Init the Interface Ref Count (used for debugging only).
00263   m_cRefI = 0;
00264
00265   // Init the Back Object Pointer to point to the parent object.
00266   m_pBackObj = pBackObj;
00267
00268   // Init the pointer to the server control object.
00269   m_pServer = pServer;
00270
00271   // Init the CImpIClassFactory interface's delegating Unknown pointer.
00272   // We use the Back Object pointer for IUnknown delegation here if we are
00273   // not being aggregated.  If we are being aggregated we use the supplied
00274   // pUnkOuter for IUnknown delegation.  In either case the pointer
00275   // assignment requires no AddRef because the CImpIClassFactory lifetime is
00276   // quaranteed by the lifetime of the parent object in which
00277   // CImpIClassFactory is nested.
00278   if (NULL == pUnkOuter)
00279   {
00280     m_pUnkOuter = pBackObj;
00281     LOGF1("L<%X>: CFCar::CImpIClassFactory Constructor. Non-Aggregating.",TID);
00282   }
00283   else
00284   {
00285     m_pUnkOuter = pUnkOuter;
00286     LOGF1("L<%X>: CFCar::CImpIClassFactory Constructor. Aggregating.",TID);
00287   }
00288
00289   return;
00290 }
00291
00292
00293 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00294   Method:   CFCar::CImpIClassFactory::~CImpIClassFactory
00295
00296   Summary:  Destructor for the CImpIClassFactory interface instantiation.
00297
00298   Args:     void
00299
00300   Returns:  void
00301 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00302 CFCar::CImpIClassFactory::~CImpIClassFactory(void)
00303 {
00304   LOGF1("L<%X>: CFCar::CImpIClassFactory Destructor.",TID);
00305
00306   return;
00307 }
00308
00309
00310 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00311   Method:   CFCar::CImpIClassFactory::QueryInterface
00312
00313   Summary:  The QueryInterface IUnknown member of this IClassFactory
00314             interface implementation that delegates to m_pUnkOuter,
00315             whatever it is.
00316
00317   Args:     REFIID riid,
00318               [in] GUID of the Interface being requested.
00319             PPVOID ppv)
00320               [out] Address of the caller's pointer variable that will
00321               receive the requested interface pointer.
00322
00323   Returns:  HRESULT
00324               Standard result code. NOERROR for success.
00325               Returned by the delegated outer QueryInterface call.
00326 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00327 STDMETHODIMP CFCar::CImpIClassFactory::QueryInterface(
00328                REFIID riid,
00329                PPVOID ppv)
00330 {
00331   LOGF1("L<%X>: CFCar::CImpIClassFactory::QueryInterface. Delegating.",TID);
00332
00333   // Delegate this call to the outer object's QueryInterface.
00334   return m_pUnkOuter->QueryInterface(riid, ppv);
00335 }
00336
00337
00338 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00339   Method:   CFCar::CImpIClassFactory::AddRef
00340
00341   Summary:  The AddRef IUnknown member of this IClassFactory interface
00342             implementation that delegates to m_pUnkOuter, whatever it is.
00343
00344   Args:     void
00345
00346   Modifies: m_cRefI.
00347
00348   Returns:  ULONG
00349               Returned by the delegated outer AddRef call.
00350 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00351 STDMETHODIMP_(ULONG) CFCar::CImpIClassFactory::AddRef(void)
00352 {
00353   // Increment the Interface Reference Count.
00354   InterlockedIncrement((PLONG) &m_cRefI);
00355
00356   LOGF2("L<%X>: CFCar::CImpIClassFactory::Addref. Delegating. New cI=%i.",TID,m_cRefI);
00357
00358   // Delegate this call to the outer object's AddRef.
00359   return m_pUnkOuter->AddRef();
00360 }
00361
00362
00363 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00364   Method:   CFCar::CImpIClassFactory::Release
00365
00366   Summary:  The Release IUnknown member of this IClassFactory interface
00367             implementation that delegates to m_pUnkOuter, whatever it is.
00368
00369   Args:     void
00370
00371   Returns:  ULONG
00372               Returned by the delegated outer Release call.
00373 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00374 STDMETHODIMP_(ULONG) CFCar::CImpIClassFactory::Release(void)
00375 {
00376   // Decrement the Interface Reference Count.
00377   InterlockedDecrement((PLONG) &m_cRefI);
00378
00379   LOGF2("L<%X>: CFCar::CImpIClassFactory::Release. Delegating. New cI=%i.",TID,m_cRefI);
00380
00381   // Delegate this call to the outer object's Release.
00382   return m_pUnkOuter->Release();
00383 }
00384
00385
00386 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00387   Method:   CFCar::CImpIClassFactory::CreateInstance
00388
00389   Summary:  The CreateInstance member method of this IClassFactory
00390             interface implementation.  Creates an instance of the COCar
00391             COM component.
00392
00393   Args:     IUnknown* pUnkOuter,
00394               [in] Pointer to the controlling IUnknown.
00395             REFIID riid,
00396               [in] GUID of the Interface being requested.
00397             PPVOID ppvCob)
00398               [out] Address of the caller's pointer variable that will
00399               receive the requested interface pointer.
00400
00401   Returns:  HRESULT
00402               Standard result code. NOERROR for success.
00403 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00404 STDMETHODIMP CFCar::CImpIClassFactory::CreateInstance(
00405                IUnknown* pUnkOuter,
00406                REFIID riid,
00407                PPVOID ppv)
00408 {
00409   HRESULT hr = E_FAIL;
00410   COCar* pCob = NULL;
00411
00412   LOGF2("L<%X>: CFCar::CImpIClassFactory::CreateInstance. pUnkOuter=0x%X.",TID,pUnkOuter);
00413
00414   // NULL the output pointer.
00415   *ppv = NULL;
00416
00417   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00418   // the COM rules state the IUnknown interface MUST also be concomitantly
00419   // requested.  If it is not so requested (riid != IID_IUnknown) then
00420   // an error must be returned indicating that no aggregate creation of
00421   // the CFCar COM Object can be performed.
00422   if (NULL != pUnkOuter && riid != IID_IUnknown)
00423     hr = CLASS_E_NOAGGREGATION;
00424   else
00425   {
00426     // Instantiate a COCar COM Object.
00427     pCob = new COCar(pUnkOuter, m_pServer);
00428     if (NULL != pCob)
00429     {
00430       // We initially created the new COM object so tell the server
00431       // to increment its global server object count to help ensure
00432       // that the server remains loaded until this partial creation
00433       // of a COM component is completed.
00434       m_pServer->ObjectsUp();
00435
00436       // We QueryInterface this new COM Object not only to deposit the
00437       // main interface pointer to the caller's pointer variable, but to
00438       // also automatically bump the Reference Count on the new COM
00439       // Object after handing out this reference to it.
00440       hr = pCob->QueryInterface(riid, (PPVOID)ppv);
00441       if (FAILED(hr))
00442       {
00443         delete pCob;
00444         m_pServer->ObjectsDown();
00445       }
00446     }
00447     else
00448     {
00449       // If we were launched to create this object and could not then
00450       // we should force a shutdown of this server.
00451       m_pServer->ObjectsUp();
00452       m_pServer->ObjectsDown();
00453       hr = E_OUTOFMEMORY;
00454     }
00455   }
00456
00457   if (SUCCEEDED(hr))
00458   {
00459     LOGF2("L<%X>: CFCar::CImpIClassFactory::CreateInstance Succeeded. *ppv=0x%X.",TID,*ppv);
00460   }
00461   else
00462   {
00463     LOGF1("L<%X>: CFCar::CImpIClassFactory::CreateInstance Failed.",TID);
00464   }
00465
00466   return hr;
00467 }
00468
00469
00470 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00471   Method:   CFCar::CImpIClassFactory::LockServer
00472
00473   Summary:  The LockServer member method of this IClassFactory interface
00474             implementation.
00475
00476   Args:     BOOL fLock)
00477               [in] Flag determining whether to Lock or Unlock the server.
00478
00479   Returns:  HRESULT
00480               Standard result code. NOERROR for success.
00481 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00482 STDMETHODIMP CFCar::CImpIClassFactory::LockServer(
00483                BOOL fLock)
00484 {
00485   HRESULT hr = NOERROR;
00486
00487   LOGF1("L<%X>: CFCar::CImpIClassFactory::LockServer.",TID);
00488
00489   if (fLock)
00490     m_pServer->Lock();
00491   else
00492     m_pServer->Unlock();
00493
00494   return hr;
00495 }
00496
00497
00498 /*---------------------------------------------------------------------------
00499   Implementation the CFUtilityCar Class Factory.  CFUtilityCar is the COM
00500   object class for the Class Factory that can manufacture COUtilityCar
00501   COM Components.
00502 ---------------------------------------------------------------------------*/
00503
00504 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00505   Method:   CFUtilityCar::CFUtilityCar
00506
00507   Summary:  CFUtilityCar Constructor. Note the member initializer:
00508             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00509             to pass the 'this', pUnkOuter, and pServer pointers of this
00510             constructor function to the constructor executed in the
00511             instantiation of the CImpIClassFactory interface whose
00512             implementation is nested inside this present object class.
00513
00514   Args:     IUnknown* pUnkOuter,
00515               Pointer to the the outer Unknown.  NULL means this COM Object
00516               is not being Aggregated.  Non NULL means it is being created
00517               on behalf of an outside COM object that is reusing it via
00518               aggregation.
00519             CServer* pServer)
00520               Pointer to the server's control object.
00521
00522   Modifies: m_cRefs, m_pUnkOuter.
00523
00524   Returns:  void
00525 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00526 CFUtilityCar::CFUtilityCar(
00527   IUnknown* pUnkOuter,
00528   CServer* pServer) :
00529   m_ImpIClassFactory(this, pUnkOuter, pServer)
00530 {
00531   // Zero the COM object's reference count.
00532   m_cRefs = 0;
00533
00534   // No AddRef necessary if non-NULL, as we're nested.
00535   m_pUnkOuter = pUnkOuter;
00536
00537   // Init the pointer to the server control object.
00538   m_pServer = pServer;
00539
00540   LOGF2("L<%X>: CFUtilityCar Constructor. m_pUnkOuter=0x%X.",TID,m_pUnkOuter);
00541
00542   return;
00543 }
00544
00545
00546 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00547   Method:   CFUtilityCar::~CFUtilityCar
00548
00549   Summary:  CFUtilityCar Destructor.
00550
00551   Args:     void
00552
00553   Returns:  void
00554 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00555 CFUtilityCar::~CFUtilityCar(void)
00556 {
00557   LOGF1("L<%X>: CFUtilityCar::Destructor.",TID);
00558
00559   return;
00560 }
00561
00562
00563 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00564   Method:   CFUtilityCar::QueryInterface
00565
00566   Summary:  QueryInterface of the CFUtilityCar non-delegating
00567             IUnknown implementation.
00568
00569   Args:     REFIID riid,
00570               [in] GUID of the Interface being requested.
00571             PPVOID ppv)
00572               [out] Address of the caller's pointer variable that will
00573               receive the requested interface pointer.
00574
00575   Returns:  HRESULT
00576               Standard result code. NOERROR for success.
00577 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00578 STDMETHODIMP CFUtilityCar::QueryInterface(
00579                REFIID riid,
00580                PPVOID ppv)
00581 {
00582   HRESULT hr = E_NOINTERFACE;
00583   *ppv = NULL;
00584
00585   if (IID_IUnknown == riid)
00586   {
00587     *ppv = this;
00588     LOGF1("L<%X>: CFUtilityCar::QueryInterface. 'this' pIUnknown returned.",TID);
00589   }
00590   else if (IID_IClassFactory == riid)
00591   {
00592     *ppv = &m_ImpIClassFactory;
00593     LOGF1("L<%X>: CFUtilityCar::QueryInterface. pIClassFactory returned.",TID);
00594   }
00595
00596   if (NULL != *ppv)
00597   {
00598     // We've handed out a pointer to the interface so obey the COM rules
00599     //   and AddRef the reference count.
00600     ((LPUNKNOWN)*ppv)->AddRef();
00601     hr = NOERROR;
00602   }
00603
00604   return (hr);
00605 }
00606
00607
00608 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00609   Method:   CFUtilityCar::AddRef
00610
00611   Summary:  AddRef of the CFUtilityCar non-delegating IUnknown implementation.
00612
00613   Args:     void
00614
00615   Modifies: m_cRefs.
00616
00617   Returns:  ULONG
00618               New value of m_cRefs (COM object's reference count).
00619 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00620 STDMETHODIMP_(ULONG) CFUtilityCar::AddRef(void)
00621 {
00622   InterlockedIncrement((PLONG) &m_cRefs);
00623
00624   LOGF2("L<%X>: CFUtilityCar::AddRef. New cRefs=%i.",TID,m_cRefs);
00625
00626   return m_cRefs;
00627 }
00628
00629
00630 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00631   Method:   CFUtilityCar::Release
00632
00633   Summary:  Release of the CFUtilityCar non-delegating IUnknown implementation.
00634
00635   Args:     void
00636
00637   Modifies: m_cRefs.
00638
00639   Returns:  ULONG
00640               New value of m_cRefs (COM object's reference count).
00641 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00642 STDMETHODIMP_(ULONG) CFUtilityCar::Release(void)
00643 {
00644   ULONG cRefs;
00645   InterlockedDecrement((PLONG) &m_cRefs);
00646   cRefs = m_cRefs;
00647
00648   LOGF2("L<%X>: CFUtilityCar::Release. New cRefs=%i.",TID,m_cRefs);
00649
00650   if (0 == m_cRefs)
00651   {
00652     // We artificially bump the main ref count to prevent reentrancy
00653     // via the main object destructor.  Not really needed in this
00654     // CFUtilityCar but a good practice because we are aggregatable and
00655     // may at some point in the future add something entertaining like
00656     // some Releases to the CFUtilityCar destructor.
00657     InterlockedIncrement((PLONG) &m_cRefs);
00658     delete this;
00659   }
00660
00661   return cRefs;
00662 }
00663
00664
00665 /*---------------------------------------------------------------------------
00666   CFUtilityCar's nested implementation of the IClassFactory interface
00667   including Constructor, Destructor, QueryInterface, AddRef, Release,
00668   CreateInstance, and LockServer methods.
00669 ---------------------------------------------------------------------------*/
00670
00671 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00672   Method:   CFUtilityCar::CImpIClassFactory::CImpIClassFactory
00673
00674   Summary:  Constructor for the CImpIClassFactory interface instantiation.
00675
00676   Args:     CFUtilityCar* pBackObj,
00677               Back pointer to the parent outer object.
00678             IUnknown* pUnkOuter,
00679               Pointer to the outer Unknown.  For delegation.
00680             CServer* pServer)
00681               Pointer to the server's control object.
00682
00683   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter, m_pServer.
00684
00685   Returns:  void
00686 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00687 CFUtilityCar::CImpIClassFactory::CImpIClassFactory(
00688   CFUtilityCar* pBackObj,
00689   IUnknown* pUnkOuter,
00690   CServer* pServer)
00691 {
00692   // Init the Interface Ref Count (used for debugging only).
00693   m_cRefI = 0;
00694
00695   // Init the Back Object Pointer to point to the parent object.
00696   m_pBackObj = pBackObj;
00697
00698   // Init the pointer to the server control object.
00699   m_pServer = pServer;
00700
00701   // Init the CImpIClassFactory interface's delegating Unknown pointer.
00702   // We use the Back Object pointer for IUnknown delegation here if we are
00703   // not being aggregated.  If we are being aggregated we use the supplied
00704   // pUnkOuter for IUnknown delegation.  In either case the pointer
00705   // assignment requires no AddRef because the CImpIClassFactory lifetime is
00706   // quaranteed by the lifetime of the parent object in which
00707   // CImpIClassFactory is nested.
00708   if (NULL == pUnkOuter)
00709   {
00710     m_pUnkOuter = pBackObj;
00711     LOGF1("L<%X>: CFUtilityCar::CImpIClassFactory Constructor. Non-Aggregating.",TID);
00712   }
00713   else
00714   {
00715     m_pUnkOuter = pUnkOuter;
00716     LOGF1("L<%X>: CFUtilityCar::CImpIClassFactory Constructor. Aggregating.",TID);
00717   }
00718
00719   return;
00720 }
00721
00722
00723 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00724   Method:   CFUtilityCar::CImpIClassFactory::~CImpIClassFactory
00725
00726   Summary:  Destructor for the CImpIClassFactory interface instantiation.
00727
00728   Args:     void
00729
00730   Returns:  void
00731 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00732 CFUtilityCar::CImpIClassFactory::~CImpIClassFactory(void)
00733 {
00734   LOGF1("L<%X>: CFUtilityCar::CImpIClassFactory Destructor.",TID);
00735
00736   return;
00737 }
00738
00739
00740 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00741   Method:   CFUtilityCar::CImpIClassFactory::QueryInterface
00742
00743   Summary:  The QueryInterface IUnknown member of this IClassFactory
00744             interface implementation that delegates to m_pUnkOuter,
00745             whatever it is.
00746
00747   Args:     REFIID riid,
00748               [in] GUID of the Interface being requested.
00749             PPVOID ppv)
00750               [out] Address of the caller's pointer variable that will
00751               receive the requested interface pointer.
00752
00753   Returns:  HRESULT
00754               Standard result code. NOERROR for success.
00755               Returned by the delegated outer QueryInterface call.
00756 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00757 STDMETHODIMP CFUtilityCar::CImpIClassFactory::QueryInterface(
00758                REFIID riid,
00759                PPVOID ppv)
00760 {
00761   LOGF1("L<%X>: CFUtilityCar::CImpIClassFactory::QueryInterface. Delegating.",TID);
00762
00763   // Delegate this call to the outer object's QueryInterface.
00764   return m_pUnkOuter->QueryInterface(riid, ppv);
00765 }
00766
00767
00768 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00769   Method:   CFUtilityCar::CImpIClassFactory::AddRef
00770
00771   Summary:  The AddRef IUnknown member of this IClassFactory interface
00772             implementation that delegates to m_pUnkOuter, whatever it is.
00773
00774   Args:     void
00775
00776   Modifies: m_cRefI.
00777
00778   Returns:  ULONG
00779               Returned by the delegated outer AddRef call.
00780 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00781 STDMETHODIMP_(ULONG) CFUtilityCar::CImpIClassFactory::AddRef(void)
00782 {
00783   // Increment the Interface Reference Count.
00784   InterlockedIncrement((PLONG) &m_cRefI);
00785
00786   LOGF2("L<%X>: CFUtilityCar::CImpIClassFactory::Addref. Delegating. New cI=%i.",TID,m_cRefI);
00787
00788   // Delegate this call to the outer object's AddRef.
00789   return m_pUnkOuter->AddRef();
00790 }
00791
00792
00793 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00794   Method:   CFUtilityCar::CImpIClassFactory::Release
00795
00796   Summary:  The Release IUnknown member of this IClassFactory interface
00797             implementation that delegates to m_pUnkOuter, whatever it is.
00798
00799   Args:     void
00800
00801   Modifies: m_cRefI.
00802
00803   Returns:  ULONG
00804               Returned by the delegated outer Release call.
00805 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00806 STDMETHODIMP_(ULONG) CFUtilityCar::CImpIClassFactory::Release(void)
00807 {
00808   // Decrement the Interface Reference Count.
00809   InterlockedDecrement((PLONG) &m_cRefI);
00810
00811   LOGF2("L<%X>: CFUtilityCar::CImpIClassFactory::Release. Delegating. New cI=%i.",TID,m_cRefI);
00812
00813   // Delegate this call to the outer object's Release.
00814   return m_pUnkOuter->Release();
00815 }
00816
00817
00818 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00819   Method:   CFUtilityCar::CImpIClassFactory::CreateInstance
00820
00821   Summary:  The CreateInstance member method of this IClassFactory interface
00822             implementation.  Creates an instance of the COUtilityCar COM
00823             component.
00824
00825   Args:     IUnknown* pUnkOuter,
00826               [in] Pointer to the controlling IUnknown.
00827             REFIID riid,
00828               [in] GUID of the Interface being requested.
00829             PPVOID ppvCob)
00830               [out] Address of the caller's pointer variable that will
00831               receive the requested interface pointer.
00832
00833   Returns:  HRESULT
00834               Standard result code. NOERROR for success.
00835 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00836 STDMETHODIMP CFUtilityCar::CImpIClassFactory::CreateInstance(
00837                IUnknown* pUnkOuter,
00838                REFIID riid,
00839                PPVOID ppv)
00840 {
00841   HRESULT hr = E_FAIL;
00842   COUtilityCar* pCob = NULL;
00843
00844   LOGF2("L<%X>: CFUtilityCar::CImpIClassFactory::CreateInstance. pUnkOuter=0x%X.",TID,pUnkOuter);
00845
00846   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00847   // the COM rules state the IUnknown interface MUST also be concomitantly
00848   // requested.  If it is not so requested ( riid != IID_IUnknown) then
00849   // an error must be returned indicating that no aggregate creation of
00850   // the COUtilityCar COM Object can be performed.
00851   if (NULL != pUnkOuter && riid != IID_IUnknown)
00852     hr = CLASS_E_NOAGGREGATION;
00853   else
00854   {
00855     // Instantiate a COUtilityCar COM Object.
00856     pCob = new COUtilityCar(pUnkOuter, m_pServer);
00857     if (NULL != pCob)
00858     {
00859       // We initially created the new COM object so tell the server
00860       // to increment its global server object count to help ensure
00861       // that the server remains loaded until this partial creation
00862       // of a COM component is completed.
00863       m_pServer->ObjectsUp();
00864
00865       // If we have succeeded in instantiating the COM object we
00866       // initialize it to set up any subordinate objects.
00867       hr = pCob->Init();
00868       if (SUCCEEDED(hr))
00869       {
00870         // We QueryInterface this new COM Object not only to deposit the
00871         // main interface pointer to the caller's pointer variable, but to
00872         // also automatically bump the Reference Count on the new COM
00873         // Object after handing out this reference to it.
00874         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
00875       }
00876
00877       if (FAILED(hr))
00878       {
00879         delete pCob;
00880         m_pServer->ObjectsDown();
00881       }
00882     }
00883     else
00884     {
00885       // If we were launched to create this object and could not then
00886       // we should force a shutdown of this server.
00887       m_pServer->ObjectsUp();
00888       m_pServer->ObjectsDown();
00889       hr = E_OUTOFMEMORY;
00890     }
00891   }
00892
00893   if (SUCCEEDED(hr))
00894   {
00895     LOGF2("L<%X>: CFUtilityCar::CImpIClassFactory::CreateInstance Succeeded. *ppv=0x%X.",TID,*ppv);
00896   }
00897   else
00898   {
00899     LOGF1("L<%X>: CFUtilityCar::CImpIClassFactory::CreateInstance Failed.",TID);
00900   }
00901
00902   return hr;
00903 }
00904
00905
00906 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00907   Method:   CFUtilityCar::CImpIClassFactory::LockServer
00908
00909   Summary:  The LockServer member method of this IClassFactory interface
00910             implementation.
00911
00912   Args:     BOOL fLock)
00913               [in] Flag determining whether to Lock or Unlock the server.
00914
00915   Returns:  HRESULT
00916               Standard result code. NOERROR for success.
00917 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00918 STDMETHODIMP CFUtilityCar::CImpIClassFactory::LockServer(
00919                BOOL fLock)
00920 {
00921   HRESULT hr = NOERROR;
00922
00923   LOGF1("L<%X>: CFUtilityCar::CImpIClassFactory::LockServer.",TID);
00924
00925   if (fLock)
00926     m_pServer->Lock();
00927   else
00928     m_pServer->Unlock();
00929
00930   return hr;
00931 }
00932
00933
00934 /*---------------------------------------------------------------------------
00935   Implementation the CFCruiseCar Class Factory.  CFCruiseCar is the COM
00936   object class for the Class Factory that can manufacture COCruiseCar
00937   COM Components.
00938 ---------------------------------------------------------------------------*/
00939
00940 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00941   Method:   CFCruiseCar::CFCruiseCar
00942
00943   Summary:  CFCruiseCar Constructor. Note the member initializer:
00944             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00945             to pass the 'this', pUnkOuter, and pServer pointers of this
00946             constructor function to the constructor executed in the
00947             instantiation of the CImpIClassFactory interface whose
00948             implementation is nested inside this present object class.
00949
00950   Args:     IUnknown* pUnkOuter,
00951               Pointer to the the outer Unknown.  NULL means this COM Object
00952               is not being Aggregated.  Non NULL means it is being created
00953               on behalf of an outside COM object that is reusing it via
00954               aggregation.
00955             CServer* pServer)
00956               Pointer to the server's control object.
00957
00958   Modifies: m_cRefs, m_pUnkOuter, m_pServer.
00959
00960   Returns:  void
00961 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00962 CFCruiseCar::CFCruiseCar(
00963   IUnknown* pUnkOuter,
00964   CServer* pServer) :
00965   m_ImpIClassFactory(this, pUnkOuter, pServer)
00966 {
00967   // Zero the COM object's reference count.
00968   m_cRefs = 0;
00969
00970   // No AddRef necessary if non-NULL, as we're nested.
00971   m_pUnkOuter = pUnkOuter;
00972
00973   // Init the pointer to the server control object.
00974   m_pServer = pServer;
00975
00976   LOGF2("L<%X>: CFCruiseCar Constructor. m_pUnkOuter=0x%X.",TID,m_pUnkOuter);
00977
00978   return;
00979 }
00980
00981
00982 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00983   Method:   CFCruiseCar::~CFCruiseCar
00984
00985   Summary:  CFCruiseCar Destructor.
00986
00987   Args:     void
00988
00989   Returns:  void
00990 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00991 CFCruiseCar::~CFCruiseCar(void)
00992 {
00993   LOGF1("L<%X>: CFCruiseCar::Destructor.",TID);
00994
00995   return;
00996 }
00997
00998
00999 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01000   Method:   CFCruiseCar::QueryInterface
01001
01002   Summary:  QueryInterface of the CFCruiseCar non-delegating
01003             IUnknown implementation.
01004
01005   Args:     REFIID riid,
01006               [in] GUID of the Interface being requested.
01007             PPVOID ppv)
01008               [out] Address of the caller's pointer variable that will
01009               receive the requested interface pointer.
01010
01011   Returns:  HRESULT
01012               Standard result code. NOERROR for success.
01013 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01014 STDMETHODIMP CFCruiseCar::QueryInterface(
01015                REFIID riid,
01016                PPVOID ppv)
01017 {
01018   HRESULT hr = E_NOINTERFACE;
01019   *ppv = NULL;
01020
01021   if (IID_IUnknown == riid)
01022   {
01023     *ppv = this;
01024     LOGF1("L<%X>: CFCruiseCar::QueryInterface. 'this' pIUnknown returned.",TID);
01025   }
01026   else if (IID_IClassFactory == riid)
01027   {
01028     *ppv = &m_ImpIClassFactory;
01029     LOGF1("L<%X>: CFCruiseCar::QueryInterface. pIClassFactory returned.",TID);
01030   }
01031
01032   if (NULL != *ppv)
01033   {
01034     // We've handed out a pointer to the interface so obey the COM rules
01035     // and AddRef the reference count.
01036     ((LPUNKNOWN)*ppv)->AddRef();
01037     hr = NOERROR;
01038   }
01039
01040   return (hr);
01041 }
01042
01043
01044 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01045   Method:   CFCruiseCar::AddRef
01046
01047   Summary:  AddRef of the CFCruiseCar non-delegating IUnknown implementation.
01048
01049   Args:     void
01050
01051   Modifies: m_cRefs.
01052
01053   Returns:  ULONG
01054               New value of m_cRefs (COM object's reference count).
01055 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01056 STDMETHODIMP_(ULONG) CFCruiseCar::AddRef(void)
01057 {
01058   InterlockedIncrement((PLONG) &m_cRefs);
01059
01060   LOGF2("L<%X>: CFCruiseCar::AddRef. New cRefs=%i.",TID,m_cRefs);
01061
01062   return m_cRefs;
01063 }
01064
01065
01066 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01067   Method:   CFCruiseCar::Release
01068
01069   Summary:  Release of the CFCruiseCar non-delegating IUnknown implementation.
01070
01071   Args:     void
01072
01073   Modifies: m_cRefs.
01074
01075   Returns:  ULONG
01076               New value of m_cRefs (COM object's reference count).
01077 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01078 STDMETHODIMP_(ULONG) CFCruiseCar::Release(void)
01079 {
01080   ULONG cRefs;
01081   InterlockedDecrement((PLONG) &m_cRefs);
01082   cRefs = m_cRefs;
01083
01084   LOGF2("L<%X>: CFCruiseCar::Release. New cRefs=%i.",TID,m_cRefs);
01085
01086   if (0 == m_cRefs)
01087   {
01088     // We artificially bump the main ref count to prevent reentrancy
01089     // via the main object destructor.  Not really needed in this
01090     // CFCruiseCar but a good practice because we are aggregatable and
01091     // may at some point in the future add something entertaining like
01092     // some Releases to the CFCruiseCar destructor.
01093     InterlockedIncrement((PLONG) &m_cRefs);
01094     delete this;
01095   }
01096
01097   return cRefs;
01098 }
01099
01100
01101 /*---------------------------------------------------------------------------
01102   CFCruiseCar's nested implementation of the IClassFactory interface
01103   including Constructor, Destructor, QueryInterface, AddRef, Release,
01104   CreateInstance, and LockServer methods.
01105 ---------------------------------------------------------------------------*/
01106
01107 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01108   Method:   CFCruiseCar::CImpIClassFactory::CImpIClassFactory
01109
01110   Summary:  Constructor for the CImpIClassFactory interface instantiation.
01111
01112   Args:     CFCruiseCar* pBackObj,
01113               Back pointer to the parent outer object.
01114             IUnknown* pUnkOuter,
01115               Pointer to the outer Unknown.  For delegation.
01116             CServer* pServer)
01117               Pointer to the server's control object.
01118
01119   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter, m_pServer.
01120
01121   Returns:  void
01122 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01123 CFCruiseCar::CImpIClassFactory::CImpIClassFactory(
01124   CFCruiseCar* pBackObj,
01125   IUnknown* pUnkOuter,
01126   CServer* pServer)
01127 {
01128   // Init the Interface Ref Count (used for debugging only).
01129   m_cRefI = 0;
01130
01131   // Init the Back Object Pointer to point to the parent object.
01132   m_pBackObj = pBackObj;
01133
01134   // Init the pointer to the server control object.
01135   m_pServer = pServer;
01136
01137   // Init the CImpIClassFactory interface's delegating Unknown pointer.
01138   // We use the Back Object pointer for IUnknown delegation here if we are
01139   // not being aggregated.  If we are being aggregated we use the supplied
01140   // pUnkOuter for IUnknown delegation.  In either case the pointer
01141   // assignment requires no AddRef because the CImpIClassFactory lifetime is
01142   // quaranteed by the lifetime of the parent object in which
01143   // CImpIClassFactory is nested.
01144   if (NULL == pUnkOuter)
01145   {
01146     m_pUnkOuter = pBackObj;
01147     LOGF1("L<%X>: CFCruiseCar::CImpIClassFactory Constructor. Non-Aggregating.",TID);
01148   }
01149   else
01150   {
01151     m_pUnkOuter = pUnkOuter;
01152     LOGF1("L<%X>: CFCruiseCar::CImpIClassFactory Constructor. Aggregating.",TID);
01153   }
01154
01155   return;
01156 }
01157
01158
01159 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01160   Method:   CFCruiseCar::CImpIClassFactory::~CImpIClassFactory
01161
01162   Summary:  Destructor for the CImpIClassFactory interface instantiation.
01163
01164   Args:     void
01165
01166   Returns:  void
01167 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01168 CFCruiseCar::CImpIClassFactory::~CImpIClassFactory(void)
01169 {
01170   LOGF1("L<%X>: CFCruiseCar::CImpIClassFactory Destructor.",TID);
01171
01172   return;
01173 }
01174
01175
01176 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01177   Method:   CFCruiseCar::CImpIClassFactory::QueryInterface
01178
01179   Summary:  The QueryInterface IUnknown member of this IClassFactory
01180             interface implementation that delegates to m_pUnkOuter,
01181             whatever it is.
01182
01183   Args:     REFIID riid,
01184               [in] GUID of the Interface being requested.
01185             PPVOID ppv)
01186               [out] Address of the caller's pointer variable that will
01187               receive the requested interface pointer.
01188
01189   Returns:  HRESULT
01190               Standard result code. NOERROR for success.
01191               Returned by the delegated outer QueryInterface call.
01192 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01193 STDMETHODIMP CFCruiseCar::CImpIClassFactory::QueryInterface(
01194                REFIID riid,
01195                PPVOID ppv)
01196 {
01197   LOGF1("L<%X>: CFCruiseCar::CImpIClassFactory::QueryInterface. Delegating.",TID);
01198
01199   // Delegate this call to the outer object's QueryInterface.
01200   return m_pUnkOuter->QueryInterface(riid, ppv);
01201 }
01202
01203
01204 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01205   Method:   CFCruiseCar::CImpIClassFactory::AddRef
01206
01207   Summary:  The AddRef IUnknown member of this IClassFactory interface
01208             implementation that delegates to m_pUnkOuter, whatever it is.
01209
01210   Args:     void
01211
01212   Modifies: m_cRefI.
01213
01214   Returns:  ULONG
01215               Returned by the delegated outer AddRef call.
01216 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01217 STDMETHODIMP_(ULONG) CFCruiseCar::CImpIClassFactory::AddRef(void)
01218 {
01219   // Increment the Interface Reference Count.
01220   InterlockedIncrement((PLONG) &m_cRefI);
01221
01222   LOGF2("L<%X>: CFCruiseCar::CImpIClassFactory::Addref. Delegating. New cI=%i.",TID,m_cRefI);
01223
01224   // Delegate this call to the outer object's AddRef.
01225   return m_pUnkOuter->AddRef();
01226 }
01227
01228
01229 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01230   Method:   CFCruiseCar::CImpIClassFactory::Release
01231
01232   Summary:  The Release IUnknown member of this IClassFactory interface
01233             implementation that delegates to m_pUnkOuter, whatever it is.
01234
01235   Args:     void
01236
01237   Modifies: m_cRefI.
01238
01239   Returns:  ULONG
01240               Returned by the delegated outer Release call.
01241 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01242 STDMETHODIMP_(ULONG) CFCruiseCar::CImpIClassFactory::Release(void)
01243 {
01244   // Decrement the Interface Reference Count.
01245   InterlockedDecrement((PLONG) &m_cRefI);
01246
01247   LOGF2("L<%X>: CFCruiseCar::CImpIClassFactory::Release. Delegating. New cI=%i.",TID,m_cRefI);
01248
01249   // Delegate this call to the outer object's Release.
01250   return m_pUnkOuter->Release();
01251 }
01252
01253
01254 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01255   Method:   CFCruiseCar::CImpIClassFactory::CreateInstance
01256
01257   Summary:  The CreateInstance member method of this IClassFactory interface
01258             implementation.  Creates an instance of the COCruiseCar COM
01259             component.
01260
01261   Args:     IUnknown* pUnkOuter,
01262               [in] Pointer to the controlling IUnknown.
01263             REFIID riid,
01264               [in] GUID of the Interface being requested.
01265             PPVOID ppvCob)
01266               [out] Address of the caller's pointer variable that will
01267               receive the requested interface pointer.
01268
01269   Returns:  HRESULT
01270               Standard result code. NOERROR for success.
01271 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01272 STDMETHODIMP CFCruiseCar::CImpIClassFactory::CreateInstance(
01273                IUnknown* pUnkOuter,
01274                REFIID riid,
01275                PPVOID ppv)
01276 {
01277   HRESULT hr = E_FAIL;
01278   COCruiseCar* pCob = NULL;
01279
01280   LOGF2("L<%X>: CFCruiseCar::CImpIClassFactory::CreateInstance. pUnkOuter=0x%X.",TID,pUnkOuter);
01281
01282   // If the creation call is requesting aggregation (pUnkOuter != NULL),
01283   // the COM rules state the IUnknown interface MUST also be concomitantly
01284   // requested.  If it is not so requested ( riid != IID_IUnknown) then
01285   // an error must be returned indicating that no aggregate creation of
01286   // the COCruiseCarFactory COM Object can be performed.
01287   if (NULL != pUnkOuter && riid != IID_IUnknown)
01288     hr = CLASS_E_NOAGGREGATION;
01289   else
01290   {
01291     // Instantiate a COCruiseCar COM Object.
01292     pCob = new COCruiseCar(pUnkOuter, m_pServer);
01293     if (NULL != pCob)
01294     {
01295       // We initially created the new COM object so tell the server
01296       // to increment its global server object count to help ensure
01297       // that the server remains loaded until this partial creation
01298       // of a COM component is completed.
01299       m_pServer->ObjectsUp();
01300
01301       // If we have succeeded in instantiating the COM object we
01302       // initialize it to set up any subordinate objects.
01303       hr = pCob->Init();
01304       if (SUCCEEDED(hr))
01305       {
01306         // We QueryInterface this new COM Object not only to deposit the
01307         // main interface pointer to the caller's pointer variable, but to
01308         // also automatically bump the Reference Count on the new COM
01309         // Object after handing out this reference to it.
01310         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
01311       }
01312
01313       if (FAILED(hr))
01314       {
01315         delete pCob;
01316         m_pServer->ObjectsDown();
01317       }
01318     }
01319     else
01320     {
01321       // If we were launched to create this object and could not then
01322       // we should force a shutdown of this server.
01323       m_pServer->ObjectsUp();
01324       m_pServer->ObjectsDown();
01325       hr = E_OUTOFMEMORY;
01326     }
01327   }
01328
01329   if (SUCCEEDED(hr))
01330   {
01331     LOGF2("L<%X>: CFCruiseCar::CImpIClassFactory::CreateInstance Succeeded. *ppv=0x%X.",TID,*ppv);
01332   }
01333   else
01334   {
01335     LOGF1("L<%X>: CFCruiseCar::CImpIClassFactory::CreateInstance Failed.",TID);
01336   }
01337
01338   return hr;
01339 }
01340
01341
01342 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01343   Method:   CFCruiseCar::CImpIClassFactory::LockServer
01344
01345   Summary:  The LockServer member method of this IClassFactory interface
01346             implementation.
01347
01348   Args:     BOOL fLock)
01349               [in] Flag determining whether to Lock or Unlock the server.
01350
01351   Returns:  HRESULT
01352               Standard result code. NOERROR for success.
01353 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01354 STDMETHODIMP CFCruiseCar::CImpIClassFactory::LockServer(
01355                BOOL fLock)
01356 {
01357   HRESULT hr = NOERROR;
01358
01359   LOGF1("L<%X>: CFCruiseCar::CImpIClassFactory::LockServer.",TID);
01360
01361   if (fLock)
01362     m_pServer->Lock();
01363   else
01364     m_pServer->Unlock();
01365
01366   return hr;
01367 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/compdata.h Source File

  • SysMgmt
  • MMC
  • Complete

compdata.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024 #include "StatNode.h"
00025 #include "Comp.h"
00026
00027 class CComponentData : public IComponentData, IExtendPropertySheet2, IExtendContextMenu
00028 {
00029     friend class CComponent;
00030
00031 private:
00032     ULONG       m_cref;
00033     LPCONSOLE     m_ipConsole;
00034     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00035
00036     CStaticNode     *m_pStaticNode;
00037
00038 public:
00039     CComponentData();
00040     ~CComponentData();
00041
00042     ///////////////////////////////
00043     // Interface IUnknown
00044     ///////////////////////////////
00045     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00046     STDMETHODIMP_(ULONG) AddRef();
00047     STDMETHODIMP_(ULONG) Release();
00048
00049     ///////////////////////////////
00050     // Interface IComponentData
00051     ///////////////////////////////
00052     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00053         /* [in] */ LPUNKNOWN pUnknown);
00054
00055         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00056         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00057
00058         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00059         /* [in] */ LPDATAOBJECT lpDataObject,
00060         /* [in] */ MMC_NOTIFY_TYPE event,
00061         /* [in] */ LPARAM arg,
00062         /* [in] */ LPARAM param);
00063
00064         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00065
00066     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00067         /* [in] */ MMC_COOKIE cookie,
00068         /* [in] */ DATA_OBJECT_TYPES type,
00069         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00070
00071         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00072         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00073
00074         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00075         /* [in] */ LPDATAOBJECT lpDataObjectA,
00076         /* [in] */ LPDATAOBJECT lpDataObjectB);
00077
00078         //////////////////////////////////
00079         // Interface IExtendPropertySheet2
00080         //////////////////////////////////
00081         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreatePropertyPages(
00082         /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00083         /* [in] */ LONG_PTR handle,
00084         /* [in] */ LPDATAOBJECT lpIDataObject);
00085
00086         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryPagesFor(
00087         /* [in] */ LPDATAOBJECT lpDataObject);
00088
00089         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetWatermarks(
00090         /* [in] */ LPDATAOBJECT lpIDataObject,
00091         /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00092         /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00093         /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00094         /* [out] */ BOOL __RPC_FAR *bStretch);
00095
00096         ///////////////////////////////
00097         // Interface IExtendContextMenu
00098         ///////////////////////////////
00099         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddMenuItems(
00100         /* [in] */ LPDATAOBJECT piDataObject,
00101         /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
00102         /* [out][in] */ long __RPC_FAR *pInsertionAllowed);
00103
00104         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Command(
00105         /* [in] */ long lCommandID,
00106         /* [in] */ LPDATAOBJECT piDataObject);
00107
00108 };
00109
00110 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Stream.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Stream.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=00000566-0000-0010-8000-00AA006D2EA4,DynamicCasts)
00019     @com.interface(iid=00000565-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public class Stream implements IUnknown,com.ms.com.NoAutoScripting,msado15._Stream
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPGET, name="Size", name2="getSize", addFlagsVtable=4)
00023       @com.parameters([type=I4] return) */
00024   public native int getSize();
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=PROPGET, name="EOS", name2="getEOS", addFlagsVtable=4)
00027       @com.parameters([type=BOOLEAN] return) */
00028   public native boolean getEOS();
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=PROPGET, name="Position", name2="getPosition", addFlagsVtable=4)
00031       @com.parameters([type=I4] return) */
00032   public native int getPosition();
00033
00034   /** @com.method(vtoffset=7, dispid=3, type=PROPPUT, name="Position", name2="putPosition", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] pPos) */
00036   public native void setPosition(int pPos);
00037
00038   /** @com.method(vtoffset=8, dispid=4, type=PROPGET, name="Type", name2="getType", addFlagsVtable=4)
00039       @com.parameters([type=I4] return) */
00040   public native int getType();
00041
00042   /** @com.method(vtoffset=9, dispid=4, type=PROPPUT, name="Type", name2="putType", addFlagsVtable=4)
00043       @com.parameters([in,type=I4] ptype) */
00044   public native void setType(int ptype);
00045
00046   /** @com.method(vtoffset=10, dispid=5, type=PROPGET, name="LineSeparator", name2="getLineSeparator", addFlagsVtable=4)
00047       @com.parameters([type=I4] return) */
00048   public native int getLineSeparator();
00049
00050   /** @com.method(vtoffset=11, dispid=5, type=PROPPUT, name="LineSeparator", name2="putLineSeparator", addFlagsVtable=4)
00051       @com.parameters([in,type=I4] pLS) */
00052   public native void setLineSeparator(int pLS);
00053
00054   /** @com.method(vtoffset=12, dispid=6, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00055       @com.parameters([type=I4] return) */
00056   public native int getState();
00057
00058   /** @com.method(vtoffset=13, dispid=7, type=PROPGET, name="Mode", name2="getMode", addFlagsVtable=4)
00059       @com.parameters([type=I4] return) */
00060   public native int getMode();
00061
00062   /** @com.method(vtoffset=14, dispid=7, type=PROPPUT, name="Mode", name2="putMode", addFlagsVtable=4)
00063       @com.parameters([in,type=I4] pMode) */
00064   public native void setMode(int pMode);
00065
00066   /** @com.method(vtoffset=15, dispid=8, type=PROPGET, name="Charset", name2="getCharset", addFlagsVtable=4)
00067       @com.parameters([type=STRING] return) */
00068   public native String getCharset();
00069
00070   /** @com.method(vtoffset=16, dispid=8, type=PROPPUT, name="Charset", name2="putCharset", addFlagsVtable=4)
00071       @com.parameters([in,type=STRING] pbstrCharset) */
00072   public native void setCharset(String pbstrCharset);
00073
00074   /** @com.method(vtoffset=17, dispid=9, type=METHOD, name="Read", addFlagsVtable=4)
00075       @com.parameters([in,type=I4] NumBytes, [type=VARIANT] return) */
00076   public native Variant Read(int NumBytes);
00077
00078   /** @com.method(vtoffset=18, dispid=10, type=METHOD, name="Open", addFlagsVtable=4)
00079       @com.parameters([in,type=VARIANT] Source, [in,type=I4] Mode, [in,type=I4] Options, [in,type=STRING] UserName, [in,type=STRING] Password) */
00080   public native void Open(Variant Source, int Mode, int Options, String UserName, String Password);
00081
00082   /** @com.method(vtoffset=19, dispid=11, type=METHOD, name="Close", addFlagsVtable=4)
00083       @com.parameters() */
00084   public native void Close();
00085
00086   /** @com.method(vtoffset=20, dispid=12, type=METHOD, name="SkipLine", addFlagsVtable=4)
00087       @com.parameters() */
00088   public native void SkipLine();
00089
00090   /** @com.method(vtoffset=21, dispid=13, type=METHOD, name="Write", addFlagsVtable=4)
00091       @com.parameters([in,type=VARIANT] Buffer) */
00092   public native void Write(Variant Buffer);
00093
00094   /** @com.method(vtoffset=22, dispid=14, type=METHOD, name="SetEOS", addFlagsVtable=4)
00095       @com.parameters() */
00096   public native void SetEOS();
00097
00098   /** @com.method(vtoffset=23, dispid=15, type=METHOD, name="CopyTo", addFlagsVtable=4)
00099       @com.parameters([in,iid=00000565-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] DestStream, [in,type=I4] CharNumber) */
00100   public native void CopyTo(msado15._Stream DestStream, int CharNumber);
00101
00102   /** @com.method(vtoffset=24, dispid=16, type=METHOD, name="Flush", addFlagsVtable=4)
00103       @com.parameters() */
00104   public native void Flush();
00105
00106   /** @com.method(vtoffset=25, dispid=17, type=METHOD, name="SaveToFile", addFlagsVtable=4)
00107       @com.parameters([in,type=STRING] FileName, [in,type=I4] Options) */
00108   public native void SaveToFile(String FileName, int Options);
00109
00110   /** @com.method(vtoffset=26, dispid=18, type=METHOD, name="LoadFromFile", addFlagsVtable=4)
00111       @com.parameters([in,type=STRING] FileName) */
00112   public native void LoadFromFile(String FileName);
00113
00114   /** @com.method(vtoffset=27, dispid=19, type=METHOD, name="ReadText", addFlagsVtable=4)
00115       @com.parameters([in,type=I4] NumChars, [type=STRING] return) */
00116   public native String ReadText(int NumChars);
00117
00118   /** @com.method(vtoffset=28, dispid=20, type=METHOD, name="WriteText", addFlagsVtable=4)
00119       @com.parameters([in,type=STRING] Data, [in,type=I4] Options) */
00120   public native void WriteText(String Data, int Options);
00121
00122   /** @com.method(vtoffset=29, dispid=21, type=METHOD, name="Cancel", addFlagsVtable=4)
00123       @com.parameters() */
00124   public native void Cancel();
00125
00126
00127   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x565, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00128
00129   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0x566, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00130 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFixedAlloc::CNode Member List

This is the complete list of members for CFixedAlloc::CNode, including all inherited members.
pNext CFixedAlloc::CNode
Generated on Wed Nov 13 2024 16:56:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMoveMoney Member List

This is the complete list of members for CMoveMoney, including all inherited members.
CMoveMoney() | CMoveMoney | [inline]
CMoveMoney() | CMoveMoney | [inline]
CMoveMoney() | CMoveMoney | [inline]
FinalConstruct() | CMoveMoney | [inline]
InterfaceSupportsErrorInfo(REFIID riid) | CMoveMoney |
InterfaceSupportsErrorInfo(REFIID riid) | CMoveMoney |
InterfaceSupportsErrorInfo(REFIID riid) | CMoveMoney |
m_bUseComPlus | CMoveMoney | [private]
m_clsctxAccount | CMoveMoney | [private]
Perform(IN long lPrimeAccount, IN long lSecondAccount, IN long lAmount, IN long lTranType, OUT BSTR *pbstrResult) | CMoveMoney |
Perform(IN long lPrimeAccount, IN long lSecondAccount, IN long lAmount, IN long lTranType, OUT BSTR *pbstrResult) | CMoveMoney |
Perform(long lngAcnt1, long lngAcnt2, long lngAmount, long lngType, BSTR *pVal) | CMoveMoney |
SetAccountClsctx(long clsctx) | CMoveMoney | [inline]
UseComPlus() | CMoveMoney | [inline]
Generated on Wed Nov 13 2024 16:56:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Include/GizmoBar.h Source File

  • Com
  • Fundamentals
  • Include

GizmoBar.h

Go to the documentation of this file.
00001 /*
00002  * GIZMOBAR.H
00003  * GizmoBar Version 1.01
00004  *
00005  * Public definitions for application that use the GizmoBar such as
00006  * messages, prototypes for API functions, notification codes, and
00007  * control styles.
00008  *
00009  * Copyright (c)1993 - 2000 Microsoft Corporation, All Rights Reserved
00010  *
00011  * Kraig Brockschmidt, Software Design Engineer
00012  * Microsoft Systems Developer Relations
00013  *
00014  * Internet  :  kraigb@microsoft.com
00015  * Compuserve:  >INTERNET:kraigb@microsoft.com
00016  */
00017
00018
00019 #ifndef _GIZMOBAR_H_
00020 #define _GIZMOBAR_H_
00021
00022 #include <bttncur.h>
00023
00024 #ifdef __cplusplus
00025 extern "C"
00026     {
00027 #endif
00028
00029
00030 //Classname
00031 #define CLASS_GIZMOBAR  TEXT("gizmobar")
00032
00033
00034 //Message API Functions
00035 HWND    WINAPI GBHwndAssociateSet(HWND, HWND);
00036 HWND    WINAPI GBHwndAssociateGet(HWND);
00037
00038 BOOL    WINAPI GBGizmoAddW(HWND, UINT, UINT, UINT, UINT, UINT, LPWSTR , HBITMAP, UINT, UINT);
00039 BOOL    WINAPI GBGizmoAddA(HWND, UINT, UINT, UINT, UINT, UINT, LPSTR , HBITMAP, UINT, UINT);
00040
00041 int     WINAPI GBGizmoTextGetW(HWND, UINT, LPWSTR, UINT);
00042 int     WINAPI GBGizmoTextGetA(HWND, UINT, LPSTR, UINT);
00043
00044 void    WINAPI GBGizmoTextSetW(HWND, UINT, LPWSTR);
00045 void    WINAPI GBGizmoTextSetA(HWND, UINT, LPSTR);
00046
00047 #ifdef UNICODE
00048 #define GBGizmoAdd      GBGizmoAddW
00049 #define GBGizmoTextGet  GBGizmoTextGetW
00050 #define GBGizmoTextSet  GBGizmoTextSetW
00051 #else
00052 #define GBGizmoAdd      GBGizmoAddA
00053 #define GBGizmoTextGet  GBGizmoTextGetA
00054 #define GBGizmoTextSet  GBGizmoTextSetA
00055 #endif
00056
00057 BOOL    WINAPI GBGizmoRemove(HWND, UINT);
00058
00059 LRESULT WINAPI GBGizmoSendMessage(HWND, UINT, UINT, WPARAM, LPARAM);
00060
00061 BOOL    WINAPI GBGizmoShow(HWND, UINT, BOOL);
00062 BOOL    WINAPI GBGizmoEnable(HWND, UINT, BOOL);
00063 BOOL    WINAPI GBGizmoCheck(HWND, UINT, BOOL);
00064 UINT    WINAPI GBGizmoFocusSet(HWND, UINT);
00065 BOOL    WINAPI GBGizmoExist(HWND, UINT);
00066
00067 int     WINAPI GBGizmoTypeGet(HWND, UINT);
00068
00069 DWORD   WINAPI GBGizmoDataSet(HWND, UINT, DWORD);
00070 DWORD   WINAPI GBGizmoDataGet(HWND, UINT);
00071 BOOL    WINAPI GBGizmoNotifySet(HWND, UINT, BOOL);
00072 BOOL    WINAPI GBGizmoNotifyGet(HWND, UINT);
00073
00074 UINT    WINAPI GBGizmoIntGet(HWND, UINT, BOOL FAR *, BOOL);
00075 void    WINAPI GBGizmoIntSet(HWND, UINT, UINT, BOOL);
00076
00077
00078
00079 //Notification codes sent via WM_COMMAND from GBHwndAssociateSet
00080 #define GBN_ASSOCIATEGAIN               1
00081 #define GBN_ASSOCIATELOSS               2
00082 #define GBN_GIZMOADDED                  3
00083 #define GBN_GIZMOREMOVED                4
00084
00085 //Message equivalents for functions.
00086 #define GBM_HWNDASSOCIATESET            (WM_USER+0)
00087 #define GBM_HWNDASSOCIATEGET            (WM_USER+1)
00088 #define GBM_GIZMOADDW                   (WM_USER+2)
00089 #define GBM_GIZMOADDA                   (WM_USER+3)
00090 #define GBM_GIZMOREMOVE                 (WM_USER+4)
00091 #define GBM_GIZMOSENDMESSAGE            (WM_USER+5)
00092 #define GBM_GIZMOSHOW                   (WM_USER+6)
00093 #define GBM_GIZMOENABLE                 (WM_USER+7)
00094 #define GBM_GIZMOCHECK                  (WM_USER+8)
00095 #define GBM_GIZMOFOCUSSET               (WM_USER+9)
00096 #define GBM_GIZMOEXIST                  (WM_USER+10)
00097 #define GBM_GIZMOTYPEGET                (WM_USER+11)
00098 #define GBM_GIZMODATASET                (WM_USER+12)
00099 #define GBM_GIZMODATAGET                (WM_USER+13)
00100 #define GBM_GIZMONOTIFYSET              (WM_USER+14)
00101 #define GBM_GIZMONOTIFYGET              (WM_USER+15)
00102 #define GBM_GIZMOTEXTGETA               (WM_USER+16)
00103 #define GBM_GIZMOTEXTGETW               (WM_USER+17)
00104 #define GBM_GIZMOTEXTSETA               (WM_USER+18)
00105 #define GBM_GIZMOTEXTSETW               (WM_USER+19)
00106 #define GBM_GIZMOINTGET                 (WM_USER+20)
00107 #define GBM_GIZMOINTSET                 (WM_USER+21)
00108
00109 #ifdef UNICODE
00110 #define GBM_GIZMOTEXTGET GBM_GIZMOTEXTGETW
00111 #define GBM_GIZMOTEXTSET GBM_GIZMOTEXTSETW
00112 #define GBM_GIZMOADD GBM_GIZMOADDW
00113 #else
00114 #define GBM_GIZMOTEXTGET GBM_GIZMOTEXTGETA
00115 #define GBM_GIZMOTEXTSET GBM_GIZMOTEXTSETA
00116 #define GBM_GIZMOADD GBM_GIZMOADDA
00117 #endif
00118
00119
00120
00121 /*
00122  * Structure passed in lParam of GBM_GIZMOADD that mirrors the
00123  * parameters to GBGizmoAdd.
00124  */
00125
00126 typedef struct
00127     {
00128     HWND        hWndParent;         //Parent window
00129     UINT        iType;              //Type of gizmo
00130     UINT        iGizmo;             //Position to create gizmo
00131     UINT        uID;                //Identifier of gizmo
00132     UINT        dx;                 //Dimensions of gizmo
00133     UINT        dy;
00134     LPSTR       pszText;            //Gizmo text
00135     HBITMAP     hBmp;               //Source of gizmo button image.
00136     UINT        iImage;             //Index of image from hBmp
00137     UINT        uState;             //Initial state of the gizmo.
00138     } CREATEGIZMOA, FAR *LPCREATEGIZMOA;
00139 typedef struct
00140     {
00141     HWND        hWndParent;         //Parent window
00142     UINT        iType;              //Type of gizmo
00143     UINT        iGizmo;             //Position to create gizmo
00144     UINT        uID;                //Identifier of gizmo
00145     UINT        dx;                 //Dimensions of gizmo
00146     UINT        dy;
00147     LPWSTR      pszText;            //Gizmo text
00148     HBITMAP     hBmp;               //Source of gizmo button image.
00149     UINT        iImage;             //Index of image from hBmp
00150     UINT        uState;             //Initial state of the gizmo.
00151     } CREATEGIZMOW, FAR *LPCREATEGIZMOW;
00152
00153 #ifdef UNICODE
00154 typedef CREATEGIZMOW    CREATEGIZMO;
00155 typedef LPCREATEGIZMOW  LPCREATEGIZMO;
00156 #define CBCREATEGIZMO sizeof(CREATEGIZMOW)
00157 #else
00158 typedef CREATEGIZMOA    CREATEGIZMO;
00159 typedef LPCREATEGIZMOA  LPCREATEGIZMO;
00160 #define CBCREATEGIZMO sizeof(CREATEGIZMOA)
00161 #endif
00162
00163
00164 //For GBM_GIZMOSENDMESSAGE
00165 typedef struct
00166     {
00167     UINT        iMsg;
00168     WPARAM      wParam;
00169     LPARAM      lParam;
00170     } GBMSG, FAR * LPGBMSG;
00171
00172 #define CBGBMSG sizeof(GBMSG);
00173
00174 //For GBM_GIZMOGETTEXT
00175 typedef struct
00176     {
00177     LPSTR       psz;
00178     UINT        cch;
00179     } GBGETTEXTA, FAR * LPGBGETTEXTA;
00180 typedef struct
00181     {
00182     LPWSTR      psz;
00183     UINT        cch;
00184     } GBGETTEXTW, FAR * LPGBGETTEXTW;
00185
00186 #ifdef UNICODE
00187 typedef GBGETTEXTW  GBGETTEXT;
00188 typedef LPGBGETTEXTW  LPGBGETTEXT;
00189 #define CBGBGETTEXT sizeof(GBGETTEXTW);
00190 #else
00191 typedef GBGETTEXTA  GBGETTEXT;
00192 typedef LPGBGETTEXTA  LPGBGETTEXT;
00193 #define CBGBGETTEXT sizeof(GBGETTEXTA);
00194 #endif
00195
00196
00197 //For GBM_GIZMOGETINT
00198 typedef struct
00199     {
00200     BOOL        fSigned;
00201     BOOL        fSuccess;
00202     } GBGETINT, FAR * LPGBGETINT;
00203
00204 #define CBGBGETINT sizeof(GBGETINT);
00205
00206
00207 //For GBM_GIZMOSETINT
00208 typedef struct
00209     {
00210     UINT        uValue;
00211     BOOL        fSigned;
00212     } GBSETINT, FAR * LPGBSETINT;
00213
00214 #define CBGBSETINT sizeof(GBSETINT);
00215
00216
00217
00218 //Gizmo control types.  DO NOT CHANGE THESE!
00219 #define GIZMOTYPE_EDIT                  0x0001
00220 #define GIZMOTYPE_LISTBOX               0x0002
00221 #define GIZMOTYPE_COMBOBOX              0x0004
00222 #define GIZMOTYPE_BUTTONNORMAL          0x0008
00223 #define GIZMOTYPE_TEXT                  0x0010
00224 #define GIZMOTYPE_SEPARATOR             0x0020
00225 #define GIZMOTYPE_BUTTONATTRIBUTEIN     0x0040
00226 #define GIZMOTYPE_BUTTONATTRIBUTEEX     0x0080
00227 #define GIZMOTYPE_BUTTONCOMMAND         0x0100
00228
00229
00230 //Generic state flags for non-buttons based on BTTNCUR.H's groups.
00231 #define GIZMO_NORMAL                    (BUTTONGROUP_ACTIVE)
00232 #define GIZMO_DISABLED                  (BUTTONGROUP_DISABLED)
00233
00234
00235
00236 #ifdef __cplusplus
00237     }   //Match with extern "C" above.
00238 #endif
00239
00240
00241
00242 #endif //_GIZMOBAR_H_
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/Guids.h Source File

  • SysMgmt
  • MMC
  • Help

Guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // {1390C842-88B8-11d2-8A08-000021473128}
00020 DEFINE_GUID(CLSID_CComponentData,
00021             0x1390c842, 0x88b8, 0x11d2, 0x8a, 0x8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28);
00022
00023 // {1390C844-88B8-11d2-8A08-000021473128}
00024 DEFINE_GUID(CLSID_CSnapinAbout,
00025             0x1390c844, 0x88b8, 0x11d2, 0x8a, 0x8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/Priv.h Source File

  • WinUI
  • Shell
  • DropExt

Priv.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------
00002 // common user interface routines
00003 //
00004 //
00005 //--------------------------------------------------------------
00006
00007 #define STRICT
00008 #define _INC_OLE        // WIN32, get ole2 from windows.h
00009 #define CONST_VTABLE
00010
00011 #include <windows.h>
00012 #include <commdlg.h>
00013 #include <dlgs.h>       // commdlg IDs
00014 #include <shellapi.h>
00015 #include <commctrl.h>
00016 #include <windowsx.h>
00017 #include <ole2.h>
00018 #include <shlobj.h>
00019
00020 //
00021 // defclsf.c
00022 //
00023 typedef HRESULT (CALLBACK FAR * LPFNCREATEINSTANCE)(LPUNKNOWN pUnkOuter,
00024   REFIID riid, LPVOID FAR* ppvObject);
00025
00026 STDAPI SHCreateDefClassObject(REFIID riid, LPVOID FAR* ppv,
00027        LPFNCREATEINSTANCE lpfnCI, UINT FAR * pcRefDll,
00028        REFIID riidInst);
00029
00030 //
00031 // Helper macro for implemting OLE classes in C
00032 //
00033 #define _IOffset(class, itf)         ((UINT_PTR)&(((class *)0)->itf))
00034 #define IToClass(class, itf, pitf)   ((class  *)(((LPSTR)pitf)-_IOffset(class, itf)))
00035 #define IToClassN(class, itf, pitf)  IToClass(class, itf, pitf)
00036
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FVInit.Cpp Source File

  • WinUI
  • Shell
  • FileView

FVInit.Cpp

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //      PROGRAM: FVINIT.CPP
00009 //
00010 //      PURPOSE:  All initialization functions and some miscellany for the CFileViewer implementation.
00011 //
00012 //      PLATFORMS:      Windows 95
00013 //
00014 //      FUNCTIONS:
00015 //
00016 //
00017 //      SPECIAL INSTRUCTIONS: N/A
00018 //
00019 #include "fileview.h"
00020
00021 //
00022 //   FUNCTION: CFileViewer::Init
00023 //
00024 //   PURPOSE: Performs any intiailization of a CFileViewer that's prone to
00025 //  failure that we also use internally before exposing the object
00026 //  outside.
00027 //
00028 //   RETURN VALUE:
00029 //   HRESULT         NOERROR if successful, error code otherwise.
00030 //
00031 HRESULT CFileViewer::Init(void)
00032     {
00033     LPUNKNOWN       pIUnknown=(LPUNKNOWN)this;
00034     WNDCLASS        wc;
00035     HRESULT         hr;
00036     HDC             hDC;
00037
00038     //Default error code
00039     hr=ResultFromScode(E_OUTOFMEMORY);
00040
00041     // Make pIUnknown point to outer unknown if we get one.
00042     // The interfaces allocated below are always given an IUnknown
00043     // to which they delegate at all times.  This will be either
00044     // the CFileViewer object's IUnknown itself or the outer
00045     // unknown if this object is aggregated.  The interfaces
00046     // need not know which case is being used.
00047     if (NULL!=m_pUnkOuter)
00048   pIUnknown=m_pUnkOuter;
00049
00050     //Allocate contained interfaces.
00051     m_pIPersistFile=new CImpIPersistFile(this, pIUnknown);
00052
00053     if (NULL==m_pIPersistFile)
00054   return hr;
00055
00056     m_pIFileViewer=new CImpIFileViewer(this, pIUnknown);
00057
00058     if (NULL==m_pIFileViewer)
00059   return hr;
00060
00061     m_pST=new CStringTable(m_hInst);
00062
00063     if (NULL==m_pST)
00064   return hr;
00065
00066     // Go load the strings we need in CFileViewer::String.
00067     if (!m_pST->FInit(IDS_MIN, IDS_MAX, CCHSTRINGMAX))
00068   return hr;
00069
00070     //Register window classes that we'll need to display the file
00071     wc.style         = CS_HREDRAW | CS_VREDRAW;
00072     wc.lpfnWndProc   = FileViewerFrameProc;
00073     wc.cbClsExtra    = 0;
00074     wc.cbWndExtra    = CBWNDEXTRAFRAME;
00075     wc.hInstance     = m_hInst;
00076     wc.hIcon         = LoadIcon(m_hInst, "Icon");
00077     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00078     wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1);
00079     wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU);
00080     wc.lpszClassName = String(IDS_CLASSFRAME);
00081
00082     if (!RegisterClass(&wc))
00083   return hr;
00084
00085     // MODIFY:  This is the viewport window that does the work
00086     // of displaying the data.  Modify it to your needs.
00087     wc.style         = CS_HREDRAW | CS_VREDRAW;
00088     wc.lpfnWndProc   = ViewportWndProc;
00089     wc.cbClsExtra    = 0;
00090     wc.cbWndExtra    = CBWNDEXTRAVIEWPORT;
00091     wc.hInstance     = m_hInst;
00092     wc.hIcon         = NULL;
00093     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00094     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
00095     wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU);
00096     wc.lpszClassName = String(IDS_CLASSVIEWPORT);
00097
00098     if (!RegisterClass(&wc))
00099   return hr;
00100
00101     m_fClassReg=TRUE;
00102
00103     // Create a default fixed pitch font for the Viewport.  We
00104     // use Courier New here instead of say, SYSTEM_FIXED_FONT
00105     // because we want the font sizing buttons to work normally
00106      // when this window appears, and the system fonts do not
00107      // scale, but Courier New does.  Default is 10 point calculated
00108      // from 10*PIXELSPERINCH/72.
00109     hDC=GetDC(NULL);
00110     m_cyPPI=GetDeviceCaps(hDC, LOGPIXELSY);
00111     ReleaseDC(NULL, hDC);
00112
00113     m_hFont=CreateFont(MulDiv(-10, m_cyPPI, 72)
00114   , 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE
00115   , ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS
00116   , DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "Courier New");
00117
00118     return NOERROR;
00119     }
00120 //
00121 //   FUNCTION: CFileViewer::FInitFrameControls
00122 //
00123 //   PURPOSE:  Creates and initializes the toolbar and status bar for the frame window.
00124 //
00125 //   PARAMETERS:
00126 //
00127 //   RETURN VALUE:
00128 //  BOOL            TRUE if the function worked, FALSE otherwise.
00129 //
00130 BOOL CFileViewer::FInitFrameControls(void)
00131     {
00132     BOOL        fRet;
00133     RECT        rc;
00134     TBBUTTON    rgtb[CTBBUTTONS];
00135
00136      // Initialize the toolbar button array.  This uses the TOOLS.BMP
00137      // resource which has three buttons and one separator.  The
00138      // buttons are tied to File/Open As and Increase/Decrease Font
00139      // size.
00140     rgtb[0].iBitmap=IDBT_OPENAS;
00141     rgtb[0].idCommand=IDM_FILEOPENAS;
00142     rgtb[0].fsState=TBSTATE_ENABLED;
00143     rgtb[0].fsStyle=TBSTYLE_BUTTON;
00144     rgtb[0].dwData=0L;
00145     rgtb[0].iString=0;
00146
00147     rgtb[1].iBitmap=0;
00148     rgtb[1].idCommand=0;
00149     rgtb[1].fsState=TBSTATE_ENABLED;
00150     rgtb[1].fsStyle=TBSTYLE_SEP;
00151     rgtb[1].dwData=0L;
00152     rgtb[1].iString=0;
00153
00154     rgtb[2].iBitmap=IDBT_FONTSIZEINCREASE;
00155     rgtb[2].idCommand=IDM_VIEWFONTINCREASE;
00156     rgtb[2].fsState=TBSTATE_ENABLED;
00157     rgtb[2].fsStyle=TBSTYLE_BUTTON;
00158     rgtb[2].dwData=0L;
00159     rgtb[2].iString=0;
00160
00161     rgtb[3].iBitmap=IDBT_FONTSIZEDECREASE;
00162     rgtb[3].idCommand=IDM_VIEWFONTDECREASE;
00163     rgtb[3].fsState=TBSTATE_ENABLED;
00164     rgtb[3].fsStyle=TBSTYLE_BUTTON;
00165     rgtb[3].dwData=0L;
00166     rgtb[3].iString=0;
00167
00168      // Open as button:  call SHGetIconOfFile to retrieve
00169      // the image, then overwrite it in the toolbar bitmap we send
00170      // to CreateToolbarEx.  If SHGetIconOfFile fails, then just
00171      // use the one in the toolbar bitmap already.
00172      //
00173     m_hWndToolbar=CreateToolbarEx(m_hWnd, TBSTYLE_TOOLTIPS
00174   | WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS, ID_TOOLBAR
00175   , CTBBITMAPS, m_hInst, IDB_TOOLS, rgtb, CTBBUTTONS
00176   , 0, 0, 0, 0, sizeof(TBBUTTON));
00177
00178     if (NULL==m_hWndToolbar)
00179   {
00180   ODS("CFileViewer::FInitFrameTools failed to create toolbar");
00181   return FALSE;
00182   }
00183
00184      // Remember the height for resizing this and the viewport.
00185      // Use window rectangles for toolbars.
00186     GetWindowRect(m_hWndToolbar, &rc);
00187     m_cyTools=rc.bottom-rc.top;
00188
00189      // Status line
00190     m_hWndStatus=CreateStatusWindow(WS_CHILD | WS_VISIBLE
00191   , String(IDS_MSGREADY), m_hWnd, ID_STATUSBAR);
00192
00193     if (NULL==m_hWndStatus)
00194   {
00195   ODS("CFileViewer::FInitFrameTools failed to create status bar");
00196   return FALSE;
00197   }
00198
00199      // Remember the height for resizing this and the viewport.
00200      // Use client rectangle for status lines.
00201     GetClientRect(m_hWndStatus, &rc);
00202     m_cyStatus=rc.bottom-rc.top;
00203
00204      // Create a status bar helper and tell it what messages
00205      // to use.  This object will be called from WM_MENUSELECT
00206      // in FileViewerFrameProc in FVPROC.CPP.
00207     m_pSH=new CStatusHelper(m_hWndStatus, m_hInst);
00208
00209     if (NULL==m_pSH)
00210   return FALSE;
00211
00212     fRet=m_pSH->MessageMap(m_hWnd, IDR_STATMESSAGEMAP, IDS_STATUSMSGMIN
00213   , IDS_STATUSMSGMAX, CCHSTATUSMSGMAX, ID_MENUFILE, ID_MENUHELP
00214   , ID_MSGREADY, ID_MSGEMPTY, ID_MENUSYS);
00215
00216     return fRet;
00217     }
00218
00219 //
00220 //   FUNCTION:  CFileViewer::String
00221 //
00222 //   PURPOSE:    string lookup function for access to stringtable.
00223 //
00224 LPSTR CFileViewer::String(UINT uID)
00225     {
00226     return (*m_pST)[uID];
00227     }
00228
00229 //
00230 //   FUNCTION:  CFileViewer::MemAlloc
00231 //
00232 //   PURPOSE:Central allocation function using IMalloc.
00233 //
00234 LPVOID CFileViewer::MemAlloc(ULONG cb)
00235     {
00236     LPMALLOC    pIMalloc;
00237     LPVOID      pv;
00238     HRESULT     hr;
00239
00240     if (FAILED(hr = CoGetMalloc(MEMCTX_TASK, &pIMalloc)))
00241   {
00242   ODSu("CFileViewer::MemAlloc CoGetMalloc failed %ld", hr);
00243
00244   if (hr == CO_E_NOTINITIALIZED)
00245       {
00246       if ((FAILED(hr=CoInitialize(NULL))) ||
00247       FAILED(hr=CoGetMalloc(MEMCTX_TASK, &pIMalloc)))
00248     {
00249     ODSu("CFileViewer::MemAlloc CoInitialize/CoGetMalloc failed %x", hr);
00250     return NULL;
00251     }
00252
00253       }
00254   else
00255       return NULL;
00256   }
00257
00258     pv=pIMalloc->Alloc(cb);
00259     pIMalloc->Release();
00260     return pv;
00261     }
00262 //
00263 //   FUNCTION:CFileViewer::MemFree
00264 //
00265 //   PURPOSE:  Central free function using IMalloc.
00266 //
00267 void CFileViewer::MemFree(LPVOID pv)
00268     {
00269     LPMALLOC    pIMalloc;
00270
00271     if (NULL==pv)
00272   {
00273   ODS("CFileViewer::MemFree passed NULL pointer");
00274   return;
00275   }
00276
00277     if (FAILED(CoGetMalloc(MEMCTX_SHARED, &pIMalloc)))
00278   {
00279   ODS("CFileViewer::MemFree CoGetMalloc failed");
00280   return;
00281   }
00282
00283     pIMalloc->Free(pv);
00284     pIMalloc->Release();
00285     return;
00286     }
00287 //
00288 //   FUNCTION: CFileViewer::QueryInterface
00289 //
00290 STDMETHODIMP CFileViewer::QueryInterface(REFIID riid, PPVOID ppv)
00291     {
00292     *ppv=NULL;
00293
00294      //The only calls for IUnknown are either in a nonaggregated
00295      // case or when created in an aggregation, so in either case
00296      // always return our IUnknown for IID_IUnknown.
00297     if (IsEqualIID(riid, IID_IUnknown))
00298   *ppv=(LPVOID)this;
00299
00300     //IPersist is base of IPersistFile
00301     if (IsEqualIID(riid, IID_IPersist)
00302   || IsEqualIID(riid, IID_IPersistFile))
00303   *ppv=(LPVOID)m_pIPersistFile;
00304
00305     if (IsEqualIID(riid, IID_IFileViewer))
00306   *ppv=(LPVOID)m_pIFileViewer;
00307
00308     //AddRef any interface we'll return.
00309     if (NULL!=*ppv)
00310   {
00311   ((LPUNKNOWN)*ppv)->AddRef();
00312   return NOERROR;
00313   }
00314
00315     return ResultFromScode(E_NOINTERFACE);
00316     }
00317
00318 //
00319 //   FUNCTION:  CFileViewer::AddRef
00320 //
00321 STDMETHODIMP_(ULONG) CFileViewer::AddRef(void)
00322     {
00323     return ++m_cRef;
00324     }
00325
00326 //
00327 //   FUNCTION: CFileViewer::Release
00328 //
00329 STDMETHODIMP_(ULONG) CFileViewer::Release(void)
00330     {
00331     ULONG       cRefT;
00332
00333     cRefT=--m_cRef;
00334
00335     ODSu("CFileViewer::Release Count=%d", cRefT);
00336
00337     if (0L==m_cRef)
00338   {
00339    // Tell the server that an object is going away
00340    // so it can shut down if appropriate.  (See FILEVIEW.CPP
00341    // for the ObjectDestroyed function).
00342   if (NULL!=m_pfnDestroy)
00343       (*m_pfnDestroy)();
00344
00345   delete this;
00346   }
00347
00348     return cRefT;
00349     }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CComponentData Member List

This is the complete list of members for CComponentData, including all inherited members.
AddMenuItems(LPDATAOBJECT piDataObject, LPCONTEXTMENUCALLBACK piCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData | [virtual]
AddMenuItems(LPDATAOBJECT piDataObject, LPCONTEXTMENUCALLBACK piCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData | [virtual]
AddMenuItems(LPDATAOBJECT ipDataObject, LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData |
AddMenuItems(LPDATAOBJECT ipDataObject, LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData |
AddMenuItems(LPDATAOBJECT ipDataObject, LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData |
AddMenuItems(LPDATAOBJECT ipDataObject, LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData |
AddMenuItems(LPDATAOBJECT ipDataObject, LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData |
AddMenuItems(LPDATAOBJECT ipDataObject, LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData |
AddMenuItems(LPDATAOBJECT piDataObject, LPCONTEXTMENUCALLBACK piCallback, long __RPC_FAR *pInsertionAllowed) | CComponentData | [virtual]
bExpanded | CComponentData | [protected]
CComponent class | CComponentData | [friend]
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
CComponentData() | CComponentData |
children | CComponentData | [private]
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData | [virtual]
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData | [virtual]
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData |
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData |
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData |
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData |
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData |
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData |
Command(long lCommandID, LPDATAOBJECT piDataObject) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB) | CComponentData |
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CompareObjects(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData |
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreateComponent(LPCOMPONENT __RPC_FAR *ppComponent) | CComponentData | [virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, LPDATAOBJECT lpIDataObject) | CComponentData | [virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, LPDATAOBJECT lpIDataObject) | CComponentData | [virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, LPDATAOBJECT lpIDataObject) | CComponentData | [virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, LPDATAOBJECT lpIDataObject) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData |
Destroy(void) | CComponentData |
Destroy(void) | CComponentData |
Destroy(void) | CComponentData |
Destroy(void) | CComponentData |
Destroy(void) | CComponentData |
Destroy(void) | CComponentData |
Destroy(void) | CComponentData |
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
Destroy(void) | CComponentData | [virtual]
ExtractData(IDataObject *piDataObject, CLIPFORMAT cfClipFormat, BYTE *pbData, DWORD cbData) | CComponentData | [private]
ExtractObjectTypeGUID(IDataObject *piDataObject, GUID *pguidObjectType) | CComponentData | [private]
ExtractSnapInCLSID(IDataObject *piDataObject, CLSID *pclsidSnapin) | CComponentData | [private]
ExtractString(IDataObject *piDataObject, CLIPFORMAT cfClipFormat, _TCHAR *pstr, DWORD cchMaxLength) | CComponentData | [private]
GetClassID(CLSID __RPC_FAR *pClassID) | CComponentData | [virtual]
GetClassID(CLSID __RPC_FAR *pClassID) | CComponentData | [virtual]
GetConsoleNameSpace() | CComponentData | [inline]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData |
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetDisplayInfo(SCOPEDATAITEM __RPC_FAR *pScopeDataItem) | CComponentData | [virtual]
GetHelpPath() | CComponentData |
GetHelpTopic(LPOLESTR __RPC_FAR *lpCompiledHelpFile) | CComponentData | [virtual]
GetHelpTopic(LPOLESTR __RPC_FAR *lpCompiledHelpFile) | CComponentData | [virtual]
GetHelpTopic(LPOLESTR __RPC_FAR *lpCompiledHelpFile) | CComponentData | [virtual]
GetHelpTopic(LPOLESTR __RPC_FAR *lpCompiledHelpFile) | CComponentData | [virtual]
GetHelpTopic(LPOLESTR *lpHelpFilePath) | CComponentData |
GetHelpTopic(LPOLESTR __RPC_FAR *lpCompiledHelpFile) | CComponentData | [virtual]
GetInterface(DWORD dwRequestedInterface, LONG_PTR *ppInterface) | CComponentData |
GetInterface(DWORD dwRequestedInterface, LONG_PTR *ppInterface) | CComponentData |
GetInterface(DWORD dwRequestedInterface, LONG_PTR *ppInterface) | CComponentData |
GetInterface(DWORD dwRequestedInterface, LONG_PTR *ppInterface) | CComponentData |
GetInterface(DWORD dwRequestedInterface, LONG_PTR *ppInterface) | CComponentData |
GetInterface(DWORD dwRequestedInterface, LONG_PTR *ppInterface) | CComponentData |
GetLinkedTopics(LPOLESTR __RPC_FAR *lpCompiledHelpFiles) | CComponentData | [inline, virtual]
GetLinkedTopics(LPOLESTR *lpHelpFilePath) | CComponentData | [inline]
getPrimaryNodeType() | CComponentData | [inline]
GetSizeMax(ULARGE_INTEGER __RPC_FAR *pcbSize) | CComponentData | [virtual]
GetSizeMax(ULARGE_INTEGER __RPC_FAR *pcbSize) | CComponentData | [virtual]
GetStaticNode() | CComponentData | [inline]
GetStaticNode() | CComponentData | [inline]
GetStaticNode() | CComponentData | [inline]
GetStaticNode() | CComponentData | [inline]
GetStaticNode() | CComponentData | [inline]
GetStaticNode() | CComponentData | [inline]
GetStaticNode() | CComponentData | [inline]
GetStaticNode() | CComponentData | [inline]
GetWatermarks(LPDATAOBJECT lpIDataObject, HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CComponentData | [virtual]
GetWatermarks(LPDATAOBJECT lpIDataObject, HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CComponentData | [virtual]
GetWatermarks(LPDATAOBJECT lpIDataObject, HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CComponentData | [virtual]
GetWatermarks(LPDATAOBJECT lpIDataObject, HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData |
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
Initialize(LPUNKNOWN pUnknown) | CComponentData | [virtual]
IsDirty(void) | CComponentData | [virtual]
IsDirty(void) | CComponentData | [virtual]
Load(IStream __RPC_FAR *pStm) | CComponentData | [virtual]
Load(IStream __RPC_FAR *pStm) | CComponentData | [virtual]
LoadBitmaps() | CComponentData | [inline, protected, static]
m_cRef | CComponentData | [private]
m_cref | CComponentData | [private]
m_HelpFile | CComponentData | [private]
m_hImageStrip16 | CComponentData | [private]
m_hImageStrip32 | CComponentData | [private]
m_hStaticNode | CComponentData | [private]
m_ipConsole | CComponentData | [private]
m_ipConsole | CComponentData | [private]
m_ipConsole2 | CComponentData | [private]
m_ipConsoleNameSpace | CComponentData | [private]
m_ipConsoleNameSpace | CComponentData | [private]
m_ipConsoleNameSpace2 | CComponentData | [private]
m_ipConsoleNameSpace2 | CComponentData | [private]
m_ipScopeImage | CComponentData | [private]
m_pBMapLg | CComponentData | [static]
m_pBMapSm | CComponentData | [static]
m_pStaticNode | CComponentData | [private]
m_pszwHelpPath | CComponentData | [private]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LONG nArg, LONG nParam) | CComponentData |
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LONG nArg, LONG nParam) | CComponentData |
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LONG nArg, LONG nParam) | CComponentData |
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LPARAM nArg, LPARAM nParam) | CComponentData |
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LONG nArg, LONG nParam) | CComponentData |
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LONG nArg, LONG nParam) | CComponentData |
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LPARAM nArg, LPARAM nParam) | CComponentData |
Notify(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE MmcEvent, LONG nArg, LONG nParam) | CComponentData |
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
Notify(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CComponentData | [virtual]
NUMBER_OF_CHILDREN enum value | CComponentData | [private]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CComponentData |
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE uCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE uCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE uCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE uCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE nCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE uCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE uCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE uCookie, DATA_OBJECT_TYPES nEnumType, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData |
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT __RPC_FAR *ppDataObject) | CComponentData | [virtual]
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryDispatch(MMC_COOKIE nCookie, DATA_OBJECT_TYPES eType, LPDISPATCH *pipDispatch) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryInterface(REFIID riid, LPVOID *ppv) | CComponentData |
QueryPagesFor(LPDATAOBJECT lpDataObject) | CComponentData | [virtual]
QueryPagesFor(LPDATAOBJECT lpDataObject) | CComponentData | [virtual]
QueryPagesFor(LPDATAOBJECT lpDataObject) | CComponentData | [virtual]
QueryPagesFor(LPDATAOBJECT lpDataObject) | CComponentData | [virtual]
s_cfDisplayName | CComponentData | [private, static]
s_cfNodeType | CComponentData | [private, static]
s_cfSnapInCLSID | CComponentData | [private, static]
Save(IStream __RPC_FAR *pStm, BOOL fClearDirty) | CComponentData | [virtual]
Save(IStream __RPC_FAR *pStm, BOOL fClearDirty) | CComponentData | [virtual]
skybasedvehicleGuid | CComponentData | [private, static]
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
STDMETHODIMP_(ULONG) AddRef() | CComponentData |
STDMETHODIMP_(ULONG) Release() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
~CComponentData() | CComponentData |
Generated on Wed Nov 13 2024 16:55:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPerson Member List

This is the complete list of members for CPerson, including all inherited members.
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
bExpanded | CDelegationBase | [protected]
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CPerson(int id, CComponentData *pComponentData=NULL) | CPerson |
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
fAnimating | CPerson | [private]
GetBitmapIndex() | CPerson | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetDisplayName(int nCol=0) | CPerson | [virtual]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CDelegationBase | [inline, virtual]
getNodeType() | CPerson | [inline, virtual]
GetParentScopeItem() | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CPerson | [virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CDelegationBase | [inline, virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CDelegationBase | [inline, virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CDelegationBase | [inline, virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
Initialize(_TCHAR *szName, LONG lSpeed, LONG lHeight, LONG lWeight, BOOL fAnimating) | CPerson |
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
lHeight | CPerson | [private]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
lSpeed | CPerson | [private]
lWeight | CPerson | [private]
m_id | CPerson | [private]
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pComponentData | CDelegationBase |
m_pUnknown | CPerson | [private]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CDelegationBase | [inline, virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CDelegationBase | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CPerson | [virtual]
szName | CPerson | [private]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CDelegationBase | [inline, virtual]
thisGuid | CPerson | [private, static]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CPerson() | CPerson | [virtual]
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/resource.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ContextMenu.rc
00004 //
00005 #define IDB_APPIMG_32                   101
00006 #define IDB_APPIMG_16                   104
00007 #define IDI_APP_ICON                    105
00008 #define IDB_NODEIMAGES_16               106
00009 #define IDB_NODEIMAGES_32               107
00010 #define IDD_BASE_DIALOG                 108
00011 #define IDD_ADDDEVICE_DLG               109
00012 #define IDC_ARCHIVE_ATTR                1000
00013 #define IDC_HIDDEN_ATTR                 1001
00014 #define IDC_LOCKED_ATTR                 1002
00015 #define IDC_READONLY_ATTR               1003
00016 #define IDC_DEVNAME_EDIT                1004
00017 #define IDC_BACKUP_FLAG                 1005
00018
00019 // Next default values for new objects
00020 //
00021 #ifdef APSTUDIO_INVOKED
00022 #ifndef APSTUDIO_READONLY_SYMBOLS
00023 #define _APS_NEXT_RESOURCE_VALUE        110
00024 #define _APS_NEXT_COMMAND_VALUE         40001
00025 #define _APS_NEXT_CONTROL_VALUE         1006
00026 #define _APS_NEXT_SYMED_VALUE           101
00027 #endif
00028 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/internetpublishing/ippsample/Sample1.Cpp Source File

  • Dataaccess
  • oledb
  • internetpublishing
  • ippsample

Sample1.Cpp

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003   ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004   TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005   PARTICULAR PURPOSE.
00006
00007   Copyright (C) 1998-2002.  Microsoft Corporation.  All rights reserved.
00008
00009   sample1.cpp
00010
00011   All the code for the sample.
00012
00013 ------------------------------------------------------------------------------*/
00014 #include "stdafx.h"
00015
00016 /*------------------------------------------------------------------------------
00017 Function main
00018
00019 argc
00020    number of command line arguments
00021 argv
00022    array of pointers to command line arguments
00023 ------------------------------------------------------------------------------*/
00024 extern "C" int __cdecl wmain(int argc, wchar_t* argv[])
00025 {
00026   HRESULT     hr = S_OK;
00027    LPWSTR      lpAction = argv[1];
00028
00029    if(3 > argc)
00030   {
00031     //there has to be at least 4 arguments.
00032       hr = E_INVALIDARG;
00033   }
00034   else
00035   {
00036       CoInitialize(NULL);
00037
00038       argc -= 2; //skip the name of command and action
00039       argv += 2;
00040
00041       //switch on the action to perform:
00042       if(0 == _wcsicmp(lpAction, L"download"))
00043       {
00044          hr = Download(argc, argv);
00045       }
00046       else if(0 == _wcsicmp(lpAction, L"upload"))
00047       {
00048          hr = Upload(argc, argv);
00049       }
00050       else if(0 == _wcsicmp(lpAction, L"enum"))
00051       {
00052          hr = Enum(argc, argv);
00053       }
00054       else if(0 == _wcsicmp(lpAction, L"search"))
00055       {
00056          hr = Search(argc, argv);
00057       }
00058       else if(0 == _wcsicmp(lpAction, L"mkdir"))
00059       {
00060          hr = ISO(ISO_MKDIR, argc, argv);
00061       }
00062       else if(0 == _wcsicmp(lpAction, L"copy"))
00063       {
00064          hr = ISO(ISO_COPY, argc, argv);
00065       }
00066       else if(0 == _wcsicmp(lpAction, L"move"))
00067       {
00068          hr = ISO(ISO_MOVE, argc, argv);
00069       }
00070       else if(0 == _wcsicmp(lpAction, L"delete"))
00071       {
00072          hr = ISO(ISO_DELETE, argc, argv);
00073       }
00074       else
00075       {
00076          hr = E_INVALIDARG;
00077       }
00078
00079       CoUninitialize();
00080   }
00081
00082    if(E_INVALIDARG == hr)
00083    {
00084       PrintUsage();
00085       return 1;
00086    }
00087
00088    wprintf(L"\nOperation %s completed with code=0x%08x\n", lpAction, hr);
00089
00090   return 0;
00091 }
00092
00093 /*------------------------------------------------------------------------------
00094 Function Download
00095
00096   This function demonstrates how we download a file using MSDAIPP.
00097   We use the IStream interface synchronously.
00098
00099 argc
00100    number of string pointers in argv
00101 argv
00102    array of string pointers for arguments
00103    possible values:
00104    REQUIRED u=URL to download
00105    OPTIONAL l=local file to write file to
00106    OPTIONAL n=user name to authenticate with
00107    OPTIONAL p=passowrd to authenticate with
00108
00109 returns HRESULT of the test, in particular, E_INVALIDARG when the command
00110 line arguments are suspect.
00111 ------------------------------------------------------------------------------*/
00112 HRESULT Download(int argc, wchar_t* argv[])
00113 {
00114    HRESULT     hr = S_OK;
00115    IStream     *pStream = NULL;
00116    LPWSTR      pwchUrl = NULL;
00117    LPWSTR      pwchLocalFile = NULL;
00118    LPWSTR      pwchUserName = NULL;
00119    LPWSTR      pwchPassword = NULL;
00120    HANDLE      hFile=INVALID_HANDLE_VALUE;
00121    BYTE        rgbBuf[1024]; //a 1-k buffer for reading
00122    ULONG       cbRead, cbWritten;
00123    int         i;
00124
00125    //Parameter checking:
00126    if( (1 > argc) || (4 < argc) )
00127    {
00128       return E_INVALIDARG;
00129    }
00130
00131    for(i = 0; i < argc; i++)
00132    {
00133       if(0 == _wcsnicmp(argv[i], L"u=", 2))
00134       {
00135          pwchUrl = argv[i] + 2;
00136       }
00137       else if(0 == _wcsnicmp(argv[i], L"l=", 2))
00138       {
00139          pwchLocalFile = argv[i] + 2;
00140       }
00141       else if(0 == _wcsnicmp(argv[i], L"n=", 2))
00142       {
00143          pwchUserName = argv[i] + 2;
00144       }
00145       else if(0 == _wcsnicmp(argv[i], L"p=", 2))
00146       {
00147          pwchPassword = argv[i] + 2;
00148       }
00149       else
00150       {
00151          return E_INVALIDARG;
00152       }
00153    }
00154
00155    //URL is not optional:
00156    if( NULL == pwchUrl )
00157    {
00158       return E_INVALIDARG;
00159    }
00160
00161    //You may not set one and not the other:
00162    if(  ( (NULL == pwchUserName) && (NULL != pwchPassword) )
00163       ||( (NULL != pwchUserName) && (NULL == pwchPassword) ) )
00164    {
00165       pwchUserName = NULL;
00166       pwchPassword = NULL;
00167    }
00168
00169    //open the local file to be written to:
00170    if(NULL != pwchLocalFile)
00171    {
00172       hFile = CreateFileW(pwchLocalFile,
00173                           GENERIC_WRITE,
00174                           FILE_SHARE_READ,
00175                           NULL,
00176                           CREATE_ALWAYS,
00177                           FILE_ATTRIBUTE_NORMAL,
00178                           NULL);
00179
00180       if(INVALID_HANDLE_VALUE == hFile)
00181       {
00182          return HRESULT_FROM_WIN32(GetLastError());
00183       }
00184    }
00185
00186    //Bind to a stream:
00187    hr = Bind(pwchUrl,
00188              DBGUID_STREAM,
00189              IID_IStream,
00190              DBBINDURLFLAG_READ | DBBINDURLFLAG_SHARE_DENY_WRITE,
00191              (IUnknown **)&pStream,
00192              pwchUserName,
00193              pwchPassword,
00194              FALSE);
00195    if(FAILED(hr))
00196    {
00197       goto cleanup;
00198       return hr;
00199    }
00200
00201    //loop through the reading of the file using IStream::Read, and
00202    //then write to the local file if need to.
00203    while(TRUE)
00204    {
00205       hr = pStream->Read((void *)rgbBuf,
00206                           1024,
00207                           &cbRead);
00208
00209       if(0 == cbRead)
00210       {
00211          break;
00212       }
00213
00214       if(INVALID_HANDLE_VALUE != hFile)
00215       {
00216          if(FALSE == WriteFile(hFile, rgbBuf, cbRead, &cbWritten, NULL))
00217          {
00218             hr = HRESULT_FROM_WIN32(GetLastError());
00219             goto cleanup;
00220          }
00221       }
00222    }
00223
00224
00225 cleanup:
00226
00227    //cleaning up by releasing pStream
00228    if(NULL != pStream)
00229    {
00230       pStream->Release();
00231       pStream = NULL;
00232    }
00233
00234    if(INVALID_HANDLE_VALUE != hFile)
00235    {
00236       CloseHandle(hFile);
00237       hFile = INVALID_HANDLE_VALUE;
00238    }
00239
00240    return hr;
00241 }
00242
00243 /*------------------------------------------------------------------------------
00244 Function Upload
00245
00246   This function demonstrates how we upload a file using MSDAIPP.
00247   We use the IStream interface synchronously.
00248
00249 argc
00250    number of string pointers in argv
00251 argv
00252    array of string pointers for arguments
00253    possible values:
00254    REQUIRED u=URL to upload to
00255    REQUIRED l=local file to upload
00256    OPTIONAL n=user name to authenticate with
00257    OPTIONAL p=passowrd to authenticate with
00258
00259 returns HRESULT of the test, in particular, E_INVALIDARG when the command
00260 line arguments are suspect.
00261 ------------------------------------------------------------------------------*/
00262 HRESULT Upload(int argc, wchar_t* argv[])
00263 {
00264    HRESULT     hr = S_OK;
00265    IStream     *pStream = NULL;
00266    LPWSTR      pwchUrl = NULL;
00267    LPWSTR      pwchLocalFile = NULL;
00268    LPWSTR      pwchUserName = NULL;
00269    LPWSTR      pwchPassword = NULL;
00270    HANDLE      hFile=INVALID_HANDLE_VALUE;
00271    BYTE        rgbBuf[1024]; //a 1-k buffer for reading
00272    ULONG       cbRead, cbWritten;
00273    int         i;
00274
00275    //parameter checking:
00276    if( (2 > argc) || (4 < argc) )
00277    {
00278       return E_INVALIDARG;
00279    }
00280
00281    for(i = 0; i < argc; i++)
00282    {
00283       if(0 == _wcsnicmp(argv[i], L"u=", 2))
00284       {
00285          pwchUrl = argv[i] + 2;
00286       }
00287       else if(0 == _wcsnicmp(argv[i], L"l=", 2))
00288       {
00289          pwchLocalFile = argv[i] + 2;
00290       }
00291       else if(0 == _wcsnicmp(argv[i], L"n=", 2))
00292       {
00293          pwchUserName = argv[i] + 2;
00294       }
00295       else if(0 == _wcsnicmp(argv[i], L"p=", 2))
00296       {
00297          pwchPassword = argv[i] + 2;
00298       }
00299       else
00300       {
00301          return E_INVALIDARG;
00302       }
00303    }
00304
00305    //you have to have the URL:
00306    if(NULL == pwchUrl)
00307    {
00308       return E_INVALIDARG;
00309    }
00310
00311    //local file source is not optional
00312    if(NULL == pwchLocalFile)
00313    {
00314       return E_INVALIDARG;
00315    }
00316
00317    //You may not set one and not the other:
00318    if(  ( (NULL == pwchUserName) && (NULL != pwchPassword) )
00319       ||( (NULL != pwchUserName) && (NULL == pwchPassword) ) )
00320    {
00321       pwchUserName = NULL;
00322       pwchPassword = NULL;
00323    }
00324
00325    //opening the local file to read from
00326    hFile = CreateFileW(pwchLocalFile,
00327                        GENERIC_READ,
00328                        FILE_SHARE_READ,
00329                        NULL,
00330                        OPEN_EXISTING,
00331                        FILE_ATTRIBUTE_NORMAL,
00332                        NULL);
00333
00334    if(INVALID_HANDLE_VALUE == hFile)
00335    {
00336       return HRESULT_FROM_WIN32(GetLastError());
00337    }
00338
00339    //Bind to a stream:
00340    //note the bindflags or STGM we use will make sure that we can overwrite
00341    //the target file if it exists
00342    hr = Bind(pwchUrl,
00343              DBGUID_STREAM,
00344              IID_IStream,
00345              DBBINDURLFLAG_WRITE
00346                | DBBINDURLFLAG_SHARE_DENY_WRITE
00347                | DBBINDURLFLAG_OVERWRITE,
00348              (IUnknown **)&pStream,
00349              pwchUserName,
00350              pwchPassword,
00351              TRUE);
00352    if(FAILED(hr))
00353    {
00354       goto cleanup;
00355    }
00356
00357    //loop through the file.  read a chunk from the local file, then
00358    //write to the server with IStream::Write
00359    while(TRUE)
00360    {
00361       if(FALSE == ReadFile(hFile, rgbBuf, 1024, &cbRead, NULL))
00362       {
00363          hr = HRESULT_FROM_WIN32(GetLastError());
00364          goto cleanup;
00365       }
00366
00367       if(0 == cbRead)
00368       {
00369          break;
00370       }
00371
00372       hr = pStream->Write((void *)rgbBuf,
00373                            cbRead,
00374                            &cbWritten);
00375       if(FAILED(hr))
00376       {
00377          goto cleanup;
00378       }
00379    }
00380
00381    //after writing completes, we must commit
00382    hr = pStream->Commit(STGC_DEFAULT);
00383
00384 cleanup:
00385
00386    //clean up
00387    if(NULL != pStream)
00388    {
00389       pStream->Release();
00390       pStream = NULL;
00391    }
00392
00393    if(INVALID_HANDLE_VALUE != hFile)
00394    {
00395       CloseHandle(hFile);
00396       hFile = INVALID_HANDLE_VALUE;
00397    }
00398
00399    return hr;
00400 }
00401
00402
00403 /*------------------------------------------------------------------------------
00404 Function Enum
00405
00406   This function demonstrates how we enumerate a collection resource on the
00407   server using MSDAIPP.
00408   This function just checks the validity of the parameters and then delegate
00409   the real work to Enumerate().  We use IRowset and other interfaces on
00410   the rowset object to do this.
00411
00412 argc
00413    number of string pointers in argv
00414 argv
00415    array of string pointers for arguments
00416    possible values:
00417    REQUIRED u=URL to enumerate
00418    OPTIONAL v=yes/no - whether to echo enum results to the console
00419    OPTIONAL n=user name to authenticate with
00420    OPTIONAL p=passowrd to authenticate with
00421
00422 returns HRESULT of the test, in particular, E_INVALIDARG when the command
00423 line arguments are suspect.
00424 ------------------------------------------------------------------------------*/
00425 HRESULT Enum(int argc, wchar_t* argv[])
00426 {
00427    HRESULT           hr = S_OK;
00428
00429    IRowset           *pRowset = NULL;
00430
00431    LPWSTR            pwchUrl = NULL;
00432    LPWSTR            pwchUserName = NULL;
00433    LPWSTR            pwchPassword = NULL;
00434    BOOL              fVerbose = FALSE;
00435    int               i;
00436
00437    //parameter checking:
00438    if( (1 > argc) || (4 < argc) )
00439    {
00440       return E_INVALIDARG;
00441    }
00442
00443    for(i = 0; i < argc; i++)
00444    {
00445       if(0 == _wcsnicmp(argv[i], L"v=", 2))
00446       {
00447          if(0 == _wcsicmp(argv[i] + 2, L"yes"))
00448          {
00449             fVerbose = TRUE;
00450          }
00451          else if (0 == _wcsicmp(argv[i] + 2, L"no"))
00452          {
00453             fVerbose = FALSE;
00454          }
00455          else
00456          {
00457             return E_INVALIDARG;
00458          }
00459       }
00460       else if(0 == _wcsnicmp(argv[i], L"u=", 2))
00461       {
00462          pwchUrl = argv[i] + 2;
00463       }
00464       else if(0 == _wcsnicmp(argv[i], L"n=", 2))
00465       {
00466          pwchUserName = argv[i] + 2;
00467       }
00468       else if(0 == _wcsnicmp(argv[i], L"p=", 2))
00469       {
00470          pwchPassword = argv[i] + 2;
00471       }
00472       else
00473       {
00474          return E_INVALIDARG;
00475       }
00476    }
00477
00478    //this is not optional:
00479    if( NULL == pwchUrl )
00480    {
00481       return E_INVALIDARG;
00482    }
00483
00484    //You may not set one and not the other:
00485    if(  ( (NULL == pwchUserName) && (NULL != pwchPassword) )
00486       ||( (NULL != pwchUserName) && (NULL == pwchPassword) ) )
00487    {
00488       pwchUserName = NULL;
00489       pwchPassword = NULL;
00490    }
00491
00492    //Bind the resource to the IRowset interface
00493    hr = Bind(pwchUrl,
00494              DBGUID_ROWSET,
00495              IID_IRowset,
00496              DBBINDURLFLAG_READ,
00497              (IUnknown **)&pRowset,
00498              pwchUserName,
00499              pwchPassword,
00500              FALSE);
00501    if(FAILED(hr))
00502    {
00503       return hr;
00504    }
00505
00506    //calling Enumerate:
00507    hr = EnumerateWithRowsetPointer(pRowset, fVerbose);
00508
00509    pRowset->Release();
00510
00511    return hr;
00512 }
00513
00514 /*------------------------------------------------------------------------------
00515 Function Search
00516
00517   This function demonstrates how we use the OLEDB Command object to perform
00518   searches against a data source.  Currently, search is only supported on DAV
00519   servers.  There is no search performed against a FrontPage server.
00520
00521   DAV server implementation on Windows 2000 supports SQL queries.  By executing
00522   the SQL query, we obtain a pointer to a rowset, which is enumerated to find
00523   all the rows and columns fitting the search criteria.
00524
00525 argc
00526    number of string pointers in argv
00527 argv
00528    array of string pointers for arguments
00529    possible values:
00530    REQUIRED u=URL to enumerate
00531    OPTIONAL q="query" - the SQL query to execute.
00532    OPTIONAL v=yes/no - whether to echo enum results to the console
00533    OPTIONAL n=user name to authenticate with
00534    OPTIONAL p=passowrd to authenticate with
00535
00536 returns HRESULT of the test, in particular, E_INVALIDARG when the command
00537 line arguments are suspect.
00538 ------------------------------------------------------------------------------*/
00539 HRESULT Search(int argc, wchar_t* argv[])
00540 {
00541    HRESULT           hr = S_OK;
00542    LPWSTR            pwchUrl = NULL;
00543    LPWSTR            pwchQuery = NULL;
00544    LPWSTR            pwchUserName = NULL;
00545    LPWSTR            pwchPassword = NULL;
00546    BOOL              fVerbose = FALSE;
00547    int               i;
00548
00549    IDBCreateCommand  *pCreateCommand = NULL;
00550    ICommand          *pCommand = NULL;
00551    ICommandText      *pCommandText = NULL;
00552    IRowset           *pRowset = NULL;
00553    LONG_PTR          cRowsAffected = 0;
00554
00555
00556    //parameter checking:
00557    if( (1 > argc) || (5 < argc) )
00558    {
00559       hr = E_INVALIDARG;
00560       goto cleanup;
00561    }
00562
00563    for(i = 0; i < argc; i++)
00564    {
00565       if(0 == _wcsnicmp(argv[i], L"v=", 2))
00566       {
00567          if(0 == _wcsicmp(argv[i] + 2, L"yes"))
00568          {
00569             fVerbose = TRUE;
00570          }
00571          else if (0 == _wcsicmp(argv[i] + 2, L"no"))
00572          {
00573             fVerbose = FALSE;
00574          }
00575          else
00576          {
00577             hr = E_INVALIDARG;
00578             goto cleanup;
00579          }
00580       }
00581       else if(0 == _wcsnicmp(argv[i], L"u=", 2))
00582       {
00583          pwchUrl = argv[i] + 2;
00584       }
00585       else if(0 == _wcsnicmp(argv[i], L"q=", 2))
00586       {
00587          DWORD_PTR    cwchQuery = 0;
00588
00589          cwchQuery = wcslen(argv[i] + 2);
00590
00591          if(NULL != pwchQuery)
00592          {
00593             //if the user has two q="xxx", we might have a leak, unless
00594             //we do this.
00595
00596             delete [] pwchQuery;
00597          }
00598
00599          //no need to add one since we're stripping the last "
00600          pwchQuery = new WCHAR[cwchQuery + 1];
00601          if(NULL == pwchQuery)
00602          {
00603             hr = E_OUTOFMEMORY;
00604             goto cleanup;
00605          }
00606
00607          wcsncpy(pwchQuery, argv[i] + 2, cwchQuery + 1);
00608       }
00609       else if(0 == _wcsnicmp(argv[i], L"n=", 2))
00610       {
00611          pwchUserName = argv[i] + 2;
00612       }
00613       else if(0 == _wcsnicmp(argv[i], L"p=", 2))
00614       {
00615          pwchPassword = argv[i] + 2;
00616       }
00617       else
00618       {
00619          hr = E_INVALIDARG;
00620          goto cleanup;
00621       }
00622    }
00623
00624    //this is not optional:
00625    if( NULL == pwchUrl )
00626    {
00627       hr = E_INVALIDARG;
00628       goto cleanup;
00629    }
00630
00631    //You may not set one and not the other:
00632    if(  ( (NULL == pwchUserName) && (NULL != pwchPassword) )
00633       ||( (NULL != pwchUserName) && (NULL == pwchPassword) ) )
00634    {
00635       pwchUserName = NULL;
00636       pwchPassword = NULL;
00637    }
00638
00639    //now on to the real processing.  In order to get a command object,
00640    // we have to bind to a session first.
00641
00642    hr = Bind(pwchUrl,
00643              DBGUID_SESSION,
00644              IID_IDBCreateCommand,
00645              DBBINDURLFLAG_READ,
00646              (IUnknown **)&pCreateCommand,
00647              pwchUserName,
00648              pwchPassword,
00649              FALSE);
00650    if(FAILED(hr))
00651    {
00652       goto cleanup;
00653    }
00654
00655    //now we should create the command:
00656
00657    hr = pCreateCommand->CreateCommand(
00658                            NULL,
00659                            IID_ICommandText,
00660                            (IUnknown **)&pCommandText);
00661    pCreateCommand->Release(); //we don't need this anymore
00662    if(FAILED(hr))
00663    {
00664       goto cleanup;
00665    }
00666
00667    if(NULL == pwchQuery)
00668    {
00669       //we use the default query:
00670       LPWSTR   wszQueryFormat = L"SELECT \"DAV:displayname\" FROM SCOPE ('SHALLOW TRAVERSAL OF \"%s\"')";
00671       INT_PTR      cwchQuery = wcslen(wszQueryFormat) + wcslen(pwchUrl) + 1;
00672       int      nRet;
00673
00674       pwchQuery = new WCHAR[cwchQuery];
00675       if(NULL == pwchQuery)
00676       {
00677          hr = E_OUTOFMEMORY;
00678          goto cleanup;
00679       }
00680
00681       nRet = swprintf(pwchQuery, wszQueryFormat, pwchUrl);
00682       if((0 >= nRet) || (cwchQuery <= nRet))
00683       {
00684          //the number of chars don't add up
00685          hr = E_FAIL;
00686          goto cleanup;
00687       }
00688    }
00689
00690    //we have to set the command text now:
00691    hr = pCommandText->SetCommandText(
00692                DBGUID_DEFAULT,
00693                pwchQuery);
00694    if(FAILED(hr))
00695    {
00696       pCommandText->Release();
00697       goto cleanup;
00698    }
00699
00700    hr = pCommandText->QueryInterface(
00701                         IID_ICommand,
00702                         (void **)&pCommand);
00703    pCommandText->Release();
00704    if(FAILED(hr))
00705    {
00706       goto cleanup;
00707    }
00708
00709
00710    //Finally, execute the command to get the IRowset pointer
00711    hr = pCommand->Execute(
00712                         NULL,
00713                         IID_IRowset,
00714                         NULL,
00715                         &cRowsAffected,
00716                         (IUnknown**)&pRowset);
00717    pCommand->Release();
00718    if(FAILED(hr))
00719    {
00720       goto cleanup;
00721    }
00722
00723    hr = EnumerateWithRowsetPointer(pRowset, fVerbose);
00724    pRowset->Release();
00725
00726 cleanup:
00727
00728    if(NULL != pwchQuery)
00729    {
00730       delete [] pwchQuery;
00731       pwchQuery = NULL;
00732    }
00733
00734    return hr;
00735 }
00736
00737
00738 /*------------------------------------------------------------------------------
00739 Function ISO
00740
00741   This function demonstrates how the various things you can do with the
00742   IScopedOperations interface.  You may
00743   1. create a collection resource (aka, a folder, a directory) on the server
00744   2. Delete a resource
00745   3. copy or move a resource to another.  with these two operations, you may
00746      in fact specify one of them as a local file resource
00747      (e.g., file://c:\file.txt)  You may also specify two resource on two
00748      different servers, as well as the emulation flag, to copy or move
00749      across servers.  The ability to copy or move multiple local resources
00750      enables the consumer to use this interface for bulk upload/download of
00751      resources.  The provider packages the operations more efficiently for
00752      better performance.
00753
00754 argc
00755    number of string pointers in argv
00756 argv
00757    array of string pointers for arguments
00758
00759    possible values for mkdir and delete:
00760    REQUIRED u=URL
00761    OPTIONAL n=user name to authenticate with
00762    OPTIONAL p=passowrd to authenticate with
00763
00764    posilble values for copy and delete:
00765    REQUIRED us=Source URL
00766    REQUIRED ud=Destination URL
00767    OPTIONAL ns=user name to authenticate with to the source
00768    OPTIONAL ps=passowrd to authenticate with to the source
00769    OPTIONAL nd=user name to authenticate with to the destination
00770    OPTIONAL pd=passowrd to authenticate with to the destination
00771
00772 returns HRESULT of the test, in particular, E_INVALIDARG when the command
00773 line arguments are suspect.
00774 ------------------------------------------------------------------------------*/
00775 HRESULT ISO(ISO_OPS op, int argc, wchar_t* argv[])
00776 {
00777    HRESULT              hr = S_OK;
00778    IScopedOperations    *pISO = NULL;
00779    LPWSTR               pwchUrl = NULL;
00780    LPWSTR               pwchUserName = NULL;
00781    LPWSTR               pwchPassword = NULL;
00782
00783    LPWSTR               pwchUrlSrc = NULL;
00784    LPWSTR               pwchUserNameSrc = NULL;
00785    LPWSTR               pwchPasswordSrc = NULL;
00786
00787    LPWSTR               pwchUrlDest = NULL;
00788    LPWSTR               pwchUserNameDest = NULL;
00789    LPWSTR               pwchPasswordDest = NULL;
00790
00791    LPWSTR               pwchUrlBind = NULL;
00792    LPWSTR               pwchUserNameBind = NULL;
00793    LPWSTR               pwchPasswordBind = NULL;
00794
00795    IAuthenticate        *pAuth = NULL;
00796
00797    int                  i;
00798    DWORD                dwStatus = 0;
00799    BOOL                 fAlloc = FALSE;
00800
00801    //parameter checking
00802    if((1 > argc) || (6 < argc))
00803    {
00804       return E_INVALIDARG;
00805    }
00806
00807    for(i = 0; i < argc; i++)
00808    {
00809       if(0 == _wcsnicmp(argv[i], L"u=", 2))
00810       {
00811          pwchUrl = argv[i] + 2;
00812       }
00813       else if(0 == _wcsnicmp(argv[i], L"us=", 3))
00814       {
00815          pwchUrlSrc = argv[i] + 3;
00816       }
00817       else if(0 == _wcsnicmp(argv[i], L"ud=", 3))
00818       {
00819          pwchUrlDest = argv[i] + 3;
00820       }
00821       else if(0 == _wcsnicmp(argv[i], L"n=", 2))
00822       {
00823          pwchUserName = argv[i] + 2;
00824       }
00825       else if(0 == _wcsnicmp(argv[i], L"p=", 2))
00826       {
00827          pwchPassword = argv[i] + 2;
00828       }
00829       else if(0 == _wcsnicmp(argv[i], L"ns=", 3))
00830       {
00831          pwchUserNameSrc = argv[i] + 3;
00832       }
00833       else if(0 == _wcsnicmp(argv[i], L"ps=", 3))
00834       {
00835          pwchPasswordSrc = argv[i] + 3;
00836       }
00837       else if(0 == _wcsnicmp(argv[i], L"nd=", 3))
00838       {
00839          pwchUserNameDest = argv[i] + 3;
00840       }
00841       else if(0 == _wcsnicmp(argv[i], L"pd=", 3))
00842       {
00843          pwchPasswordDest = argv[i] + 3;
00844       }
00845       else
00846       {
00847          return E_INVALIDARG;
00848       }
00849    }
00850
00851    //You may not set one and not the other:
00852    if(  ( (NULL == pwchUserName) && (NULL != pwchPassword) )
00853       ||( (NULL != pwchUserName) && (NULL == pwchPassword) ) )
00854    {
00855       pwchUserName = NULL;
00856       pwchPassword = NULL;
00857    }
00858
00859    if(  ( (NULL == pwchUserNameSrc) && (NULL != pwchPasswordSrc) )
00860       ||( (NULL != pwchUserNameSrc) && (NULL == pwchPasswordSrc) ) )
00861    {
00862       pwchUserNameSrc = NULL;
00863       pwchPasswordSrc = NULL;
00864    }
00865
00866    if(  ( (NULL == pwchUserNameDest) && (NULL != pwchPasswordDest) )
00867       ||( (NULL != pwchUserNameDest) && (NULL == pwchPasswordDest) ) )
00868    {
00869       pwchUserNameDest = NULL;
00870       pwchPasswordDest = NULL;
00871    }
00872
00873
00874    //if we're making a collection or deleting something, we do similar processing:
00875    if(ISO_MKDIR == op)
00876    {
00877       //this is not optional:
00878       if( NULL == pwchUrl )
00879       {
00880          return E_INVALIDARG;
00881       }
00882
00883       //For creation of collection, merely binding is enough.
00884       hr = Bind(pwchUrl,
00885                 DBGUID_ROW,
00886                 IID_IScopedOperations,
00887                 DBBINDURLFLAG_WRITE
00888                   | DBBINDURLFLAG_OVERWRITE
00889                   | DBBINDURLFLAG_COLLECTION,
00890                 (IUnknown **)&pISO,
00891                 pwchUserName,
00892                 pwchPassword,
00893                 TRUE);
00894
00895       if(FAILED(hr))
00896       {
00897          return hr;
00898       }
00899    }
00900    else if(ISO_DELETE == op)
00901    {
00902       //this is not optional:
00903       if( NULL == pwchUrl )
00904       {
00905          return E_INVALIDARG;
00906       }
00907
00908       hr = Bind(pwchUrl,
00909                 DBGUID_ROW,
00910                 IID_IScopedOperations,
00911                 DBBINDURLFLAG_WRITE,
00912                 (IUnknown **)&pISO,
00913                 pwchUserName,
00914                 pwchPassword,
00915                 FALSE);
00916       if(FAILED(hr))
00917       {
00918          return hr;
00919       }
00920
00921       hr = pISO->Delete(1,
00922                         (LPCWSTR *)&pwchUrl,
00923                         0,
00924                         &dwStatus);
00925    }
00926    else if((ISO_COPY == op) || (ISO_MOVE == op))
00927    {
00928       //we require both URLs
00929       if((NULL == pwchUrlSrc) || (NULL == pwchUrlDest))
00930       {
00931          return E_INVALIDARG;
00932       }
00933
00934       //when we bind, we have to bind to a remote server.  If the
00935       //source URL is a file, we have to bind to the destination instead.
00936       //we cannot accept two file:// urls though.
00937       if(0 != _wcsnicmp(pwchUrlSrc, L"file://", 7))
00938       {
00939          pwchUrlBind = pwchUrlSrc;
00940          pwchUserNameBind = pwchUserNameSrc;
00941          pwchPasswordBind = pwchPasswordSrc;
00942       }
00943       else if (0 != _wcsnicmp(pwchUrlDest, L"file://", 7))
00944       {
00945          //we need to bind to the parent folder of the destination URL
00946          //in this case:
00947          hr = GetParentUrl(pwchUrlDest, &pwchUrlBind);
00948          if(FAILED(hr))
00949          {
00950             return hr;
00951          }
00952          fAlloc = TRUE;
00953          pwchUserNameBind = pwchUserNameDest;
00954          pwchPasswordBind = pwchPasswordDest;
00955       }
00956       else
00957       {
00958          return E_INVALIDARG;
00959       }
00960
00961       //binding.  we have to make sure to pass in the right set of
00962       //credentials
00963       hr = Bind(pwchUrlBind,
00964                 DBGUID_ROW,
00965                 IID_IScopedOperations,
00966                 DBBINDURLFLAG_READWRITE,
00967                 (IUnknown **)&pISO,
00968                 pwchUserNameBind,
00969                 pwchPasswordBind,
00970                 FALSE);
00971       if(fAlloc && (NULL != pwchUrlBind))
00972       {
00973          //cleanup while we can
00974          delete [] pwchUrlBind;
00975       }
00976       if(FAILED(hr))
00977       {
00978          return hr;
00979       }
00980
00981       //the Copy/Move call takes an IAuthenticate interface pointer
00982       //for the destination resourecs as one of the arguments.
00983       //This way, we may authenticate to the source and destination
00984       //with different sets of credentials
00985       if((NULL != pwchUserNameDest) && (NULL != pwchPasswordDest))
00986       {
00987          pAuth = new CImpAuth;
00988          if(NULL == pAuth)
00989          {
00990             pISO->Release();
00991
00992             return E_OUTOFMEMORY;
00993          }
00994
00995          hr = ((CImpAuth *)pAuth)->Set(pwchUserNameDest, pwchPasswordDest);
00996          if(FAILED(hr))
00997          {
00998             delete pAuth;
00999
01000             pISO->Release();
01001
01002             return hr;
01003          }
01004
01005          pAuth->AddRef();
01006       }
01007
01008       //finally, the calls
01009       if(ISO_COPY == op)
01010       {
01011          hr = pISO->Copy(1,
01012                          (LPCWSTR *)&pwchUrlSrc,
01013                          (LPCWSTR *)&pwchUrlDest,
01014                          DBCOPY_REPLACE_EXISTING
01015                            | DBCOPY_ALLOW_EMULATION,
01016                          pAuth,
01017                          &dwStatus,
01018                          NULL,
01019                          NULL);
01020       }
01021       else if (ISO_MOVE == op)
01022       {
01023          hr = pISO->Move(1,
01024                          (LPCWSTR *)&pwchUrlSrc,
01025                          (LPCWSTR *)&pwchUrlDest,
01026                          DBMOVE_REPLACE_EXISTING
01027                            | DBMOVE_DONT_UPDATE_LINKS
01028                            | DBMOVE_ALLOW_EMULATION,
01029                          pAuth,
01030                          &dwStatus,
01031                          NULL,
01032                          NULL);
01033       }
01034
01035       //cleaning up:
01036       if(NULL != pAuth)
01037       {
01038          pAuth->Release();
01039       }
01040    }
01041    else
01042    {
01043       return E_INVALIDARG;
01044    }
01045
01046    //cleanup:
01047    if(NULL != pISO)
01048    {
01049       pISO->Release();
01050    }
01051
01052    return hr;
01053 }
01054
01055 /*------------------------------------------------------------------------------
01056 Function Bind
01057    A function to allow us to easily bind to a resource synchronously  This
01058    function instantiates the IAuthenticate callback if neccessary.  An
01059    implementation of IAuthenticate is included with this sample.  We
01060    demonstrates how we bind to MSDAIPP through the Rootbinder.
01061
01062 Parameters:
01063   pwchUrl
01064    the URL to bind to
01065   rguid
01066    a guid to denote the OLEDB object to bind to, only for the binders.
01067   riid
01068    the interface to bind to
01069   dwFlags
01070    the DBBINDURLFLAG for binding through the binders
01071   ppUnk
01072    pointer to return interface pointer requested
01073   pwchUserName
01074    user name for authentication
01075   pwchPassword
01076    password for authentication
01077   fCreate
01078    whether to call IBindResource or ICreateRow
01079
01080 returns HRESULT of the Bind.
01081 ------------------------------------------------------------------------------*/
01082 HRESULT Bind(LPWSTR     pwchUrl,
01083              REFGUID    rguid,
01084              REFIID     riid,
01085              DWORD      dwFlags,
01086              IUnknown** ppUnk,
01087              LPWSTR     pwchUserName,
01088              LPWSTR     pwchPassword,
01089              BOOL       fCreate)
01090 {
01091    HRESULT           hr = S_OK;
01092    IAuthenticate     *pAuth = NULL;
01093    IBindResource     *pBindResource = NULL;
01094    ICreateRow        *pCreateRow = NULL;
01095    DBBINDURLSTATUS   dwBindStatus;
01096
01097
01098    //instantiation of the IAuthenticate callback
01099    if((NULL != pwchUserName) && (NULL != pwchPassword))
01100    {
01101       pAuth = new CImpAuth;
01102       if(NULL == pAuth)
01103       {
01104          return E_OUTOFMEMORY;
01105       }
01106
01107       hr = ((CImpAuth *)pAuth)->Set(pwchUserName, pwchPassword);
01108       if(FAILED(hr))
01109       {
01110          delete pAuth;
01111          return hr;
01112       }
01113
01114       pAuth->AddRef();
01115    }
01116
01117    if(TRUE == fCreate)
01118    {
01119       //Calling CoCreateInstance to get the ICreateRow interface
01120       //on the binder.
01121       hr = CoCreateInstance(CLSID_RootBinder,
01122                             NULL,
01123                             CLSCTX_ALL,
01124                             IID_ICreateRow,
01125                             (void **)&pCreateRow);
01126       if(FAILED(hr))
01127       {
01128          if(NULL != pAuth)
01129          {
01130             pAuth->Release();
01131          }
01132          return hr;
01133       }
01134
01135       //Creating!
01136       hr = pCreateRow->CreateRow(NULL,
01137                                 pwchUrl,
01138                                 dwFlags,
01139                                 rguid,
01140                                 riid,
01141                                 pAuth,
01142                                 NULL,
01143                                 &dwBindStatus,
01144                                  NULL,
01145                                 ppUnk);
01146
01147       pCreateRow->Release();
01148    }
01149    else
01150    {
01151       //Calling CoCreateInstance to get the IBindResource interface
01152       //on the binder.
01153       hr = CoCreateInstance(CLSID_RootBinder,
01154                             NULL,
01155                             CLSCTX_ALL,
01156                             IID_IBindResource,
01157                             (void **)&pBindResource);
01158       if(FAILED(hr))
01159       {
01160          if(NULL != pAuth)
01161          {
01162             pAuth->Release();
01163          }
01164          return hr;
01165       }
01166
01167       //Binding!
01168       hr = pBindResource->Bind(  NULL,
01169                                 pwchUrl,
01170                                 dwFlags,
01171                                 rguid,
01172                                 riid,
01173                                 pAuth,
01174                                 NULL,
01175                                 &dwBindStatus,
01176                                 ppUnk);
01177
01178       pBindResource->Release();
01179    }
01180
01181    if(NULL != pAuth)
01182    {
01183       pAuth->Release();
01184    }
01185
01186    return hr;
01187 }
01188
01189
01190 /*------------------------------------------------------------------------------
01191 FUNCTION EnumerateWithRowsetPointer
01192
01193   this function demonstrate how to enumerate a collection resource.  Those
01194   familiar with OLEDB rowset should not have problem following.  The steps are
01195   1. discover all the columns of the rowset
01196   2. create an accessor to the columns
01197   3. get the rows
01198   4. get the data with the accessor
01199
01200   parameters
01201   pRowset
01202    A pointer to an IRowset pointer
01203   fVerbose
01204    flag to indicate whether to echo the rows and columns to stdout
01205
01206 ------------------------------------------------------------------------------*/
01207 HRESULT EnumerateWithRowsetPointer(
01208                   IRowset  *pRowset,
01209                   BOOL     fVerbose)
01210 {
01211    HRESULT           hr = S_OK;
01212    DWORD             i;
01213
01214    IColumnsInfo      *pColumnsInfo = NULL;
01215    DWORD_PTR          cColumn;
01216    DBCOLUMNINFO      *pInfo = NULL;
01217    OLECHAR           *pStringsBuf = NULL;
01218
01219    IAccessor         *pAccessor = NULL;
01220    DBBINDING         *pBindings = NULL;
01221    HACCESSOR         hAccessor = NULL;
01222    DBBINDSTATUS      *pBindStatus = NULL;
01223
01224    BYTE              *pData = NULL;
01225    DWORD_PTR          cRowsObtained;
01226    HROW              *pRow = NULL;
01227    DWORD             cRow;
01228    ULONG             *pStatus = NULL;
01229    ULONG             *pLength = NULL;
01230
01231    if(NULL == pRowset)
01232    {
01233       return E_INVALIDARG;
01234    }
01235
01236    //since there are a number of places where things may fail and need to
01237    //be cleaned up, we wrap the code in a while(FALSE) loop for easy
01238    //clean up.
01239
01240    do{
01241       //finding out all the columns supported by the rowset.  This is
01242       //accomplished through the IColumnsInfo interface
01243       hr = pRowset->QueryInterface(IID_IColumnsInfo, (void **)&pColumnsInfo);
01244       if(FAILED(hr))
01245       {
01246          break;
01247       }
01248
01249       hr = pColumnsInfo->GetColumnInfo(&cColumn, &pInfo, &pStringsBuf);
01250       if(FAILED(hr))
01251       {
01252          break;
01253       }
01254
01255       if(0 == cColumn)
01256       {
01257          if(fVerbose)
01258          {
01259             printf("There are no columns for our rowset\n");
01260          }
01261          hr = S_OK;
01262          break;
01263       }
01264
01265       //next we need to create an accessor.
01266       hr = pRowset->QueryInterface(IID_IAccessor, (void **)&pAccessor);
01267       if(FAILED(hr))
01268       {
01269          break;
01270       }
01271
01272       pBindings = new DBBINDING [cColumn];
01273       if(NULL == pBindings)
01274       {
01275          hr = E_OUTOFMEMORY;
01276          break;
01277       }
01278       memset(pBindings, 0, cColumn * sizeof(DBBINDING));
01279
01280       pBindStatus = new DBBINDSTATUS [cColumn];
01281       if(NULL == pBindStatus)
01282       {
01283          hr = E_OUTOFMEMORY;
01284          break;
01285       }
01286       memset(pBindStatus, 0, cColumn * sizeof(DBBINDSTATUS));
01287
01288       //We have to transfer the information in the DBCOLUMNINFO
01289       //to our new DBBINDING.  However, we're asking for all the
01290       //columns in WSTR to display them if neccessary.  Almost all
01291       //types can be converted to DBTYPE_WSTR
01292       for(i = 0; i < cColumn; i++)
01293       {
01294          //we are going to ask for all the columns as DBTYPE_WSTR.
01295          pBindings[i].iOrdinal   = pInfo[i].iOrdinal;
01296          pBindings[i].obValue    = i * MAX_PATH;
01297          pBindings[i].obLength   = (cColumn * MAX_PATH) + (i * sizeof(ULONG));
01298          pBindings[i].obStatus   = (cColumn * (MAX_PATH + sizeof(ULONG)))
01299                                     + (i * sizeof(ULONG));
01300          pBindings[i].pTypeInfo  = pInfo[i].pTypeInfo;
01301          pBindings[i].pObject    = NULL;
01302          pBindings[i].pBindExt   = NULL;
01303          pBindings[i].dwPart     = DBPART_VALUE | DBPART_LENGTH | DBPART_STATUS;
01304          pBindings[i].dwMemOwner = DBMEMOWNER_CLIENTOWNED;
01305          pBindings[i].eParamIO   = 0;
01306          pBindings[i].cbMaxLen   = MAX_PATH;
01307          pBindings[i].dwFlags    = 0;
01308          pBindings[i].wType      = DBTYPE_WSTR;
01309          pBindings[i].bPrecision = pInfo[i].bPrecision;
01310          pBindings[i].bScale     = pInfo[i].bScale;
01311       }
01312
01313       hr = pAccessor->CreateAccessor(DBACCESSOR_ROWDATA,
01314                                      cColumn,
01315                                      pBindings,
01316                                      0,
01317                                      &hAccessor,
01318                                      pBindStatus);
01319
01320       if(FAILED(hr))
01321       {
01322          break;
01323       }
01324
01325       //We need to pass a buffer into the GetData call.  here
01326       //we allocate it.
01327       pData = new BYTE [cColumn * (MAX_PATH + (2 * sizeof(ULONG)))];
01328       if(NULL == pData)
01329       {
01330          hr = E_OUTOFMEMORY;
01331          break;
01332       }
01333       pStatus = (ULONG *)( pData + (cColumn * MAX_PATH) );
01334       pLength = (ULONG *)( pData + (cColumn * (MAX_PATH + sizeof(ULONG))) );
01335
01336       //getting the rows row by row and print them to stdout if neccessary.
01337       cRow=0;
01338       while(TRUE)
01339       {
01340          hr = pRowset->GetNextRows(NULL, 0, 1, &cRowsObtained, &pRow);
01341          if(FAILED(hr) || (DB_S_ENDOFROWSET == hr))
01342          {
01343             break;
01344          }
01345
01346          hr = pRowset->GetData(pRow[0], hAccessor, (void *)pData);
01347          pRowset->ReleaseRows(1, pRow, NULL, NULL, NULL);
01348
01349          if(FAILED(hr))
01350          {
01351             break;
01352          }
01353
01354          if(fVerbose)
01355          {
01356             printf("Columns for Row %i:\n", cRow);
01357
01358             for(i = 0; i < cColumn; i++)
01359             {
01360                LPWSTR   lpColData;
01361
01362                lpColData = (LPWSTR) (pData + (i * MAX_PATH));
01363
01364                //making sure the data is terminated.
01365                //The data we get back has the right length, but they may not be
01366                //null-terminated.
01367                if(DBSTATUS_S_OK == pStatus[i])
01368                {
01369                   lpColData[ pLength[i] / sizeof(WCHAR) ] = L'\0';
01370                }
01371                else if(DBSTATUS_S_TRUNCATED == pStatus[i])
01372                {
01373                   lpColData[ (MAX_PATH / sizeof(WCHAR)) - 1 ] = L'\0';
01374                }
01375
01376                printf("  Column %i: %ls\n", i, lpColData);
01377             }
01378          }
01379
01380          cRow++;
01381       }
01382
01383
01384    }while(FALSE);
01385
01386    //cleanup:
01387    if (NULL != pColumnsInfo)
01388    {
01389       pColumnsInfo->Release();
01390    }
01391
01392    if (NULL != pInfo)
01393    {
01394       CoTaskMemFree(pInfo);
01395    }
01396
01397    if (NULL != pStringsBuf)
01398    {
01399       CoTaskMemFree(pStringsBuf);
01400    }
01401
01402    if (NULL != pAccessor)
01403    {
01404       if (NULL != hAccessor)
01405       {
01406          pAccessor->ReleaseAccessor(hAccessor, NULL);
01407       }
01408       pAccessor->Release();
01409    }
01410
01411    if (NULL != pBindings)
01412    {
01413       delete [] pBindings;
01414    }
01415
01416    if (NULL != pBindStatus)
01417    {
01418       delete [] pBindStatus;
01419    }
01420
01421    if (NULL != pData)
01422    {
01423       delete [] pData;
01424    }
01425
01426    return hr;
01427 }
01428
01429 /*------------------------------------------------------------------------------
01430 FUNCTION EnumerateParent
01431
01432   This is just a helper function that enumerates the parent of a resource whose
01433   URL is given.  It strips the last token from the URL and then calls Enumerate.
01434
01435   pwchUrl
01436     the URL whose parent to bind to
01437   pwchUserName
01438     the user name for authentication
01439   pwchPassword
01440     the password for authentication
01441 ------------------------------------------------------------------------------*/
01442 HRESULT EnumerateParent(LPWSTR    pwchUrl,
01443                         LPWSTR    pwchUserName,
01444                         LPWSTR    pwchPassword)
01445 {
01446    HRESULT  hr = S_OK;
01447    LPWSTR   lpParent;
01448    IRowset  *pRowset;
01449
01450    hr = GetParentUrl(pwchUrl, &lpParent);
01451    if(FAILED(hr))
01452    {
01453       return hr;
01454    }
01455
01456    hr = Bind(pwchUrl,
01457              DBGUID_ROWSET,
01458              IID_IRowset,
01459              DBBINDURLFLAG_READ,
01460              (IUnknown **)&pRowset,
01461              pwchUserName,
01462              pwchPassword,
01463              FALSE);
01464    if(FAILED(hr))
01465    {
01466       delete [] lpParent;
01467       return hr;
01468    }
01469
01470    hr = EnumerateWithRowsetPointer(pRowset, FALSE);
01471
01472    delete [] lpParent;
01473
01474    return hr;
01475 }
01476
01477 /*------------------------------------------------------------------------------
01478 FUNCTION GetParentUrl
01479
01480   This is just a helper function that extracts the URL of the parent folder of
01481   the URL passed in.
01482
01483   pwchUrl
01484     [IN] the URL whose parent you want
01485   ppwchParent
01486     [OUT] the URL of the parent.  De-allocate with delete []
01487 ------------------------------------------------------------------------------*/
01488 HRESULT GetParentUrl(LPWSTR    pwchUrl,
01489                      LPWSTR    *ppwchParent)
01490 {
01491    HRESULT     hr = S_OK;
01492    LPWSTR      lpParent = NULL;
01493    PWCHAR      pwchLast;
01494    DWORD_PTR   cwchUrl = wcslen(pwchUrl);
01495
01496    if(NULL == ppwchParent)
01497    {
01498       return E_INVALIDARG;
01499    }
01500    *ppwchParent = NULL;
01501
01502    lpParent = new WCHAR [cwchUrl + 1];
01503    if (NULL == lpParent)
01504    {
01505       return E_OUTOFMEMORY;
01506    }
01507    wcsncpy(lpParent, pwchUrl, cwchUrl + 1);
01508
01509    pwchLast = wcsrchr(lpParent, L'/');
01510    if(NULL == pwchLast)
01511    {
01512       delete [] lpParent;
01513       return E_INVALIDARG;
01514    }
01515
01516    if(pwchLast == (lpParent + cwchUrl - 1))
01517    {
01518       //The last character is a NULL
01519       lpParent[cwchUrl-1] = L'\0';
01520       pwchLast = wcsrchr(lpParent, L'/');
01521       if(NULL == pwchLast)
01522       {
01523          delete [] lpParent;
01524          return E_INVALIDARG;
01525       }
01526    }
01527
01528    if(L'/' == *(pwchLast - 1))
01529    {
01530       //The '/' pointed to by pchLast is the // in the URL.
01531       delete [] lpParent;
01532       return S_OK;
01533    }
01534
01535    *pwchLast = L'\0'; //cutting the URL off at the last '/'
01536
01537    *ppwchParent = lpParent;
01538
01539    return hr;
01540 }
01541
01542
01543
01544 /*------------------------------------------------------------------------------
01545 FUNCTION PrintUsage
01546
01547   Helper function that prints the usage
01548 ------------------------------------------------------------------------------*/
01549 void PrintUsage()
01550 {
01551    wprintf(L"sample1.exe\n");
01552    wprintf(L"Usage:\n");
01553    wprintf(L"   sample1 <action> [action specific parameters]\n");
01554    wprintf(L"      where <action> is one of the followings:\n");
01555    wprintf(L"                download\n");
01556    wprintf(L"                upload\n");
01557    wprintf(L"                enum\n");
01558    wprintf(L"                search\n");
01559    wprintf(L"                mkdir\n");
01560    wprintf(L"                copy\n");
01561    wprintf(L"                move\n");
01562    wprintf(L"                delete\n");
01563    wprintf(L"      action specific parameters:\n");
01564    wprintf(L"         download: u=url [l=local_dest] [n=username p=password]\n");
01565    wprintf(L"         upload:   u=url l=local_src [n=username p=password]\n");
01566    wprintf(L"         enum:     u=url [v=yes/no] [n=username p=password]\n");
01567    wprintf(L"         search:   u=url [q=\"SQL query\"] [v=yes/no] [n=username p=password]\n");
01568    wprintf(L"                   note that '\"' in the query should be typed as '\\\"'\n");
01569    wprintf(L"         mkdir:    u=url [n=username p=password]\n");
01570    wprintf(L"         copy:     us=src ud=dest [ns=username ps=password]\n");
01571    wprintf(L"                                  [nd=username pd=password]\n");
01572    wprintf(L"         move:     us=src ud=dest [ns=username ps=password]\n");
01573    wprintf(L"                                  [nd=username pd=password]\n");
01574    wprintf(L"         delete:   u=url [n=username p=password]\n");
01575 }
01576
01577 /*------------------------------------------------------------------------------
01578 FUNCTION DuplicateWSTR
01579
01580   Helper function duplicates a WSTR by first allocating memory to hold it and
01581   copying the content from the old string to the new string.
01582   The caller should free the memory by calling delete [] on the pointer
01583   returned.
01584
01585   paremeter:
01586   wsz
01587     pointer to the wide char string to be duplicated
01588
01589   returns
01590   the pointer to the freshly allocated memory with the content.
01591 ------------------------------------------------------------------------------*/
01592 LPWSTR DuplicateWSTR(LPWSTR wsz)
01593 {
01594    INT_PTR     cwch = wcslen(wsz) + 1;
01595    LPWSTR   pwchNew = new WCHAR[cwch];
01596
01597    if(NULL == wsz)
01598    {
01599       return NULL;
01600    }
01601
01602    wcsncpy(pwchNew, wsz, cwch);
01603
01604    return pwchNew;
01605 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/ADs.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

ADs.h

Go to the documentation of this file.
00001 // ADs.h: interface for the CADs class.
00002 //
00003 //////////////////////////////////////////////////////////////////////
00004
00005 #if !defined(AFX_ADS_H__81709782_0672_11D2_B218_0000F87A6B50__INCLUDED_)
00006 #define AFX_ADS_H__81709782_0672_11D2_B218_0000F87A6B50__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CDlgIADs dialog
00016
00017 class CDlgIADs : public CDialog
00018 {
00019 // Construction
00020 public:
00021   CDlgIADs(LPUNKNOWN, CWnd* pParent = NULL);   // standard constructor
00022   ~CDlgIADs();
00023 // Dialog Data
00024   //{{AFX_DATA(CDlgIADs)
00025   enum { IDD = IDD_IADS };
00026   CListBox  m_cValueList;
00027   CComboBox m_cAttrList;
00028   CString m_sADsPath;
00029   CString m_sClass;
00030   CString m_sName;
00031   CString m_sParent;
00032   CString m_sSchema;
00033   IADs   *m_pADs;
00034   CString m_sGUID;
00035   //}}AFX_DATA
00036
00037
00038 // Overrides
00039   // ClassWizard generated virtual function overrides
00040   //{{AFX_VIRTUAL(CDlgIADs)
00041   protected:
00042   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00043   //}}AFX_VIRTUAL
00044
00045 // Implementation
00046 protected:
00047
00048   // Generated message map functions
00049   //{{AFX_MSG(CDlgIADs)
00050   virtual BOOL OnInitDialog();
00051   afx_msg void OnGet();
00052   afx_msg void OnGetEx();
00053   afx_msg void OnGetInfo();
00054   afx_msg void OnSetInfo();
00055   afx_msg void OnGetInfoex();
00056   afx_msg void OnPut();
00057   afx_msg void OnPutEx();
00058   afx_msg void OnParentPath();
00059   afx_msg void OnSchemaPath();
00060   afx_msg void OnBindGuid();
00061   afx_msg void OnSelChangeAttrList();
00062   afx_msg void OnDblClkAttrValue();
00063   afx_msg void OnCopy();
00064   //}}AFX_MSG
00065   DECLARE_MESSAGE_MAP()
00066 };
00067
00068
00069 #endif // !defined(AFX_ADS_H__81709782_0672_11D2_B218_0000F87A6B50__INCLUDED_)
00070 /////////////////////////////////////////////////////////////////////////////
00071 // CGetInfoExDlg dialog
00072
00073 class CGetInfoExDlg : public CDialog
00074 {
00075 // Construction
00076 public:
00077   CGetInfoExDlg(CWnd* pParent = NULL);   // standard constructor
00078   CString GetAttribute() { return m_sAttr; }
00079
00080 // Dialog Data
00081   //{{AFX_DATA(CGetInfoExDlg)
00082   enum { IDD = IDD_GETINFOEX };
00083   CString m_sAttrText;
00084   //}}AFX_DATA
00085
00086
00087 // Overrides
00088   // ClassWizard generated virtual function overrides
00089   //{{AFX_VIRTUAL(CGetInfoExDlg)
00090   protected:
00091
00092   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00093   //}}AFX_VIRTUAL
00094
00095 // Implementation
00096 protected:
00097   CString m_sAttr;
00098   // Generated message map functions
00099   //{{AFX_MSG(CGetInfoExDlg)
00100   virtual void OnOK();
00101   //}}AFX_MSG
00102   DECLARE_MESSAGE_MAP()
00103
00104
00105 };
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/Guids.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

Guids.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      Guids.h
00007 //
00008 //  Description:
00009 //      File for definition of CLSIDs, GUIDs, and logging GUIDs.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 #pragma once
00021
00022 //////////////////////////////////////////////////////////////////////////////
00023 // Include Files
00024 //////////////////////////////////////////////////////////////////////////////
00025
00026 #pragma warning( push )
00027 #include <initguid.h>
00028 #pragma warning( pop )
00029
00030 //////////////////////////////////////////////////////////////////////////////
00031 //
00032 // Registration GUIDs
00033 //
00034 //////////////////////////////////////////////////////////////////////////////
00035
00036 //
00037 // The Resource Type's GUID
00038 //
00039 // {E83C5122-8C18-42FA-99E7-221B51E16505}
00040 DEFINE_GUID( RESTYPE_ClipBookServer,
00041 0xE83C5122, 0x8C18, 0x42FA, 0x99, 0xE7, 0x22, 0x1B, 0x51, 0xE1, 0x65, 0x05 );
00042
00043 //
00044 // This is the Cluster Administrator Extension dll CLSID to register for the type.
00045 // This has to match the UUID of the extension class in ExtObjID.idl.
00046 //
00047 // {9E747617-E5D1-42D7-A8C3-0FC1D418B76B}
00048 DEFINE_GUID(CLSID_CoClipBookServerEx,
00049 0x9E747617, 0xE5D1, 0x42D7, 0xA8, 0xC3, 0x0F, 0xC1, 0xD4, 0x18, 0xB7, 0x6B );
00050
00051 //////////////////////////////////////////////////////////////////////////////
00052 //
00053 // Reporting GUIDs
00054 //
00055 //////////////////////////////////////////////////////////////////////////////
00056
00057 //////////////////////////////////////////////////////////////////////////////
00058 // CMgdClusCfgInit
00059 //////////////////////////////////////////////////////////////////////////////
00060
00061 // {308A300C-2A40-4818-B5D2-7B65E39FB4FA}
00062 DEFINE_GUID( TASKID_Minor_ClipBookServer_Initialize,
00063 0x308A300C, 0x2A40, 0x4818, 0xB5, 0xD2, 0x7B, 0x65, 0xE3, 0x9F, 0xB4, 0xFA );
00064
00065 //////////////////////////////////////////////////////////////////////////////
00066 // CMgdResType
00067 //////////////////////////////////////////////////////////////////////////////
00068
00069 // {E4F7A345-EF7C-45F1-95FE-D6BF9C034FEE}
00070 DEFINE_GUID( TASKID_Minor_ClipBookServer_ResType_CommitChanges,
00071 0xE4F7A345, 0xEF7C, 0x45F1, 0x95, 0xFE, 0xD6, 0xBF, 0x9C, 0x03, 0x4F, 0xEE );
00072
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMarkTextService Member List

This is the complete list of members for CMarkTextService, including all inherited members.
_achDisplayPropertyText | CMarkTextService | [private]
_achDisplayText | CMarkTextService | [private]
_ClearCompositionDisplayAttributes(TfEditCookie ec) | CMarkTextService |
_cRef | CMarkTextService | [private]
_dwGlobalCompartmentEventSinkCookie | CMarkTextService | [private]
_dwTextEditSinkCookie | CMarkTextService | [private]
_dwThreadFocusSinkCookie | CMarkTextService | [private]
_dwThreadMgrEventSinkCookie | CMarkTextService | [private]
_fCleaningUp | CMarkTextService | [private]
_gaDisplayAttribute | CMarkTextService | [private]
_GetComposition() | CMarkTextService | [inline]
_HandleArrowKey(TfEditCookie ec, ITfContext *pContext, WPARAM wParam) | CMarkTextService |
_HandleKeyDown(TfEditCookie ec, ITfContext *pContext, WPARAM wParam) | CMarkTextService |
_HandleReturn(TfEditCookie ec, ITfContext *pContext) | CMarkTextService |
_hWorkerWnd | CMarkTextService | [private]
_InitCleanupContextDurationSink() | CMarkTextService | [private]
_InitCleanupContextSink(ITfContext *pContext) | CMarkTextService | [private]
_InitContextCompartment(ITfContext *pContext) | CMarkTextService | [private]
_InitDisplayAttributeGuidAtom() | CMarkTextService | [private]
_InitGlobalCompartment() | CMarkTextService | [private]
_InitKeystrokeSink() | CMarkTextService | [private]
_InitLanguageBar() | CMarkTextService | [private]
_InitTextEditSink(ITfDocumentMgr *pDocMgr) | CMarkTextService | [private]
_InitThreadMgrSink() | CMarkTextService | [private]
_InitWorkerWnd() | CMarkTextService | [private]
_IsComposing() | CMarkTextService | [inline]
_Menu_OnComposition(CMarkTextService *_this) | CMarkTextService | [static]
_Menu_OnSetCaseProperty(CMarkTextService *_this) | CMarkTextService | [static]
_Menu_OnSetCustomProperty(CMarkTextService *_this) | CMarkTextService | [static]
_Menu_OnSetGlobalCompartment(CMarkTextService *_this) | CMarkTextService | [static]
_Menu_OnViewCaseProperty(CMarkTextService *_this) | CMarkTextService | [static]
_Menu_OnViewCustomProperty(CMarkTextService *_this) | CMarkTextService | [static]
_pComposition | CMarkTextService | [private]
_pLangBarItem | CMarkTextService | [private]
_pTextEditSinkContext | CMarkTextService | [private]
_pThreadMgr | CMarkTextService | [private]
_RequestPropertyEditSession(ULONG ulCallback) | CMarkTextService | [private]
_SetCaseProperty(TfEditCookie ec, ITfContext *pContext) | CMarkTextService |
_SetComposition(ITfComposition *pComposition) | CMarkTextService | [inline]
_SetCompositionDisplayAttributes(TfEditCookie ec) | CMarkTextService |
_SetCustomProperty(TfEditCookie ec, ITfContext *pContext) | CMarkTextService |
_TerminateComposition(TfEditCookie ec) | CMarkTextService | [inline]
_TerminateCompositionInContext(ITfContext *pContext) | CMarkTextService |
_tfClientId | CMarkTextService | [private]
_UninitCleanupContextDurationSink() | CMarkTextService | [private]
_UninitCleanupContextSink(ITfContext *pContext) | CMarkTextService | [private]
_UninitCompartment(ITfContext *pContext) | CMarkTextService | [private]
_UninitGlobalCompartment() | CMarkTextService | [private]
_UninitKeystrokeSink() | CMarkTextService | [private]
_UninitLanguageBar() | CMarkTextService | [private]
_UninitThreadMgrSink() | CMarkTextService | [private]
_UninitWorkerWnd() | CMarkTextService | [private]
_ViewCaseProperty(TfEditCookie ec, ITfContext *pContext) | CMarkTextService |
_ViewCustomProperty(TfEditCookie ec, ITfContext *pContext) | CMarkTextService |
_WorkerWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CMarkTextService | [private, static]
Activate(ITfThreadMgr *pThreadMgr, TfClientId tfClientId) | CMarkTextService |
CMarkTextService() | CMarkTextService |
CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObj) | CMarkTextService | [static]
CreatePropertyStore(REFGUID guidProperty, ITfRange *pRange, ULONG cb, IStream *pStream, ITfPropertyStore **ppStore) | CMarkTextService |
Deactivate() | CMarkTextService |
EnumDisplayAttributeInfo(IEnumTfDisplayAttributeInfo **ppEnum) | CMarkTextService |
GetDisplayAttributeInfo(REFGUID guidInfo, ITfDisplayAttributeInfo **ppInfo) | CMarkTextService |
IsStoreSerializable(REFGUID guidProperty, ITfRange *pRange, ITfPropertyStore *pPropertyStore, BOOL *pfSerializable) | CMarkTextService |
OnChange(REFGUID rguidCompartment) | CMarkTextService |
OnCleanupContext(TfEditCookie ecWrite, ITfContext *pContext) | CMarkTextService |
OnCompositionTerminated(TfEditCookie ecWrite, ITfComposition *pComposition) | CMarkTextService |
OnEndCleanupContext() | CMarkTextService |
OnEndEdit(ITfContext *pContext, TfEditCookie ecReadOnly, ITfEditRecord *pEditRecord) | CMarkTextService |
OnInitDocumentMgr(ITfDocumentMgr *pDocMgr) | CMarkTextService |
OnKeyDown(ITfContext *pContext, WPARAM wParam, LPARAM lParam, BOOL *pfEaten) | CMarkTextService |
OnKeyUp(ITfContext *pContext, WPARAM wParam, LPARAM lParam, BOOL *pfEaten) | CMarkTextService |
OnPopContext(ITfContext *pContext) | CMarkTextService |
OnPreservedKey(ITfContext *pContext, REFGUID rguid, BOOL *pfEaten) | CMarkTextService |
OnPushContext(ITfContext *pContext) | CMarkTextService |
OnSetFocus(ITfDocumentMgr *pDocMgrFocus, ITfDocumentMgr *pDocMgrPrevFocus) | CMarkTextService |
OnSetFocus(BOOL fForeground) | CMarkTextService |
OnStartCleanupContext() | CMarkTextService |
OnTestKeyDown(ITfContext *pContext, WPARAM wParam, LPARAM lParam, BOOL *pfEaten) | CMarkTextService |
OnTestKeyUp(ITfContext *pContext, WPARAM wParam, LPARAM lParam, BOOL *pfEaten) | CMarkTextService |
OnUninitDocumentMgr(ITfDocumentMgr *pDocMgr) | CMarkTextService |
QueryInterface(REFIID riid, void **ppvObj) | CMarkTextService |
RegisterCategories(BOOL fRegister) | CMarkTextService | [static]
RegisterProfiles() | CMarkTextService | [static]
RegisterServer() | CMarkTextService | [static]
STDMETHODIMP_(ULONG) AddRef(void) | CMarkTextService |
STDMETHODIMP_(ULONG) Release(void) | CMarkTextService |
UnregisterProfiles() | CMarkTextService | [static]
UnregisterServer() | CMarkTextService | [static]
WM_DISPLAY_PROPERTY enum value | CMarkTextService |
~CMarkTextService() | CMarkTextService |
Generated on Wed Nov 13 2024 16:56:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/mfc_tree/StdAfx.h Source File

  • Web
  • xml
  • mfc_tree

StdAfx.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 // stdafx.h : include file for standard system include files,
00011 //  or project specific include files that are used frequently, but
00012 //      are changed infrequently
00013 //
00014
00015 #if !defined(AFX_STDAFX_H__3C9F0B09_FD51_11D2_AC35_00600812D7F9__INCLUDED_)
00016 #define AFX_STDAFX_H__3C9F0B09_FD51_11D2_AC35_00600812D7F9__INCLUDED_
00017
00018 #if _MSC_VER > 1000
00019 #pragma once
00020 #endif // _MSC_VER > 1000
00021
00022 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00023
00024 #include <afxwin.h>         // MFC core and standard components
00025 #include <afxext.h>         // MFC extensions
00026 #include <afxdisp.h>        // MFC Automation classes
00027 #include <afxdtctl.h>   // MFC support for Internet Explorer 4 Common Controls
00028 #ifndef _AFX_NO_AFXCMN_SUPPORT
00029 #include <afxcmn.h>     // MFC support for Windows Common Controls
00030 #endif // _AFX_NO_AFXCMN_SUPPORT
00031
00032 #import "MSXML.DLL" named_guids
00033
00034 //{{AFX_INSERT_LOCATION}}
00035 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00036
00037 #endif // !defined(AFX_STDAFX_H__3C9F0B09_FD51_11D2_AC35_00600812D7F9__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/STAObject/STAObject.Idl Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • STAObject

STAObject.Idl

Go to the documentation of this file.
00001 // STAObject.idl : IDL source for STAObject.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (STAObject.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009   [
00010     object,
00011     uuid(BAEA7BB0-F391-11D2-A10A-0080C71F306F),
00012     dual,
00013     helpstring("ISyncTest Interface"),
00014     pointer_default(unique)
00015   ]
00016   interface ISyncTest : IDispatch
00017   {
00018     HRESULT Exercise();
00019   };
00020
00021 [
00022   uuid(A6A21490-F391-11D2-A10A-0080C71F306F),
00023   version(1.0),
00024   helpstring("STAObject 1.0 Type Library")
00025 ]
00026 library STAOBJECTLib
00027 {
00028   importlib("stdole32.tlb");
00029   importlib("stdole2.tlb");
00030
00031   [
00032     uuid(CEFEEE70-F391-11D2-A10A-0080C71F306F),
00033     helpstring("STATest Class")
00034   ]
00035   coclass STATest
00036   {
00037     [default] interface ISyncTest;
00038   };
00039 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcOrder/Order.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcOrder

Order.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc7A.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCOrder.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcorder;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017 import com.ms.wfc.data.*;
00018 import java.util.Vector;
00019
00020 /** @com.register(clsid=CB34A1A2-28C2-11D2-B5B6-00C04FC340EE, typelib=6DD1E6C2-28C1-11D2-B5B6-00C04FC340EE, version="1.0", description="Order Class")*/
00021 public class Order implements IUnknown,com.ms.com.NoAutoScripting,qcorder.IOrderDefault
00022 {
00023   private int   customerID    = 0;
00024   private int   orderID     = 0;
00025   private Vector  itemVect    = null;
00026   private Vector  quantityVect  = null;
00027
00028   public Order()
00029   {
00030     itemVect    = new Vector();
00031     quantityVect  = new Vector();
00032   }
00033
00034   /**
00035      * property put for CustomerId property
00036      *
00037      * @param       customerID        A customer identifier
00038      * @return      ---
00039      *
00040      **/
00041   public void setCustomerId(int customerID)
00042   {
00043     this.customerID = customerID;
00044   }
00045
00046   /**
00047      * property put for OrderId property
00048      *
00049      * @param       orderID        An order identifier
00050      * @return      ---
00051      *
00052      **/
00053   public void setOrderId(int orderID)
00054   {
00055     this.orderID  = orderID;
00056   }
00057
00058   /**
00059      * Adds a single item to an order
00060      *
00061      * @param       itemID        An item identifier
00062      * @param   quantity    Quantity of the item ordered
00063      * @return      ---
00064      *
00065      **/
00066   public void LineItem(int itemID, int quantity)
00067   {
00068     if((itemVect != null) && (quantityVect != null))
00069     {
00070       itemVect.addElement(new Integer(itemID));
00071       quantityVect.addElement(new Integer(quantity));
00072     }
00073   }
00074
00075   /**
00076      * Adds order to Order Entry table and sends order to shipping department.
00077      *
00078      * @param       lFlags        option flags
00079      * @return      ---
00080      *
00081      **/
00082   public void Process(int lFlags)
00083   {
00084     boolean dataInsertFlag  = false;
00085     boolean shipInvokeFlag  = false;
00086
00087     dataInsertFlag  = WriteOrderDB();
00088     com.ms.win32.User32.MessageBox(0,"Order is added and queuing message is added for shipment process","Order Status",0);
00089     System.out.println(dataInsertFlag);
00090     if(dataInsertFlag) // if order is successfully added to order table
00091     {
00092       shipInvokeFlag  = InvokeShip();
00093     }
00094
00095     com.ms.mtx.IObjectContext ctxObj = com.ms.mtx.Context.getObjectContext();
00096     if(ctxObj != null)
00097      {
00098       if(shipInvokeFlag)
00099       {
00100         ctxObj.SetComplete();
00101       }
00102       else
00103       {
00104         ctxObj.SetAbort();
00105       }
00106      }
00107   }
00108
00109   /**
00110      * Writes the order into the Order Entry table.
00111      *
00112      * @param       ---
00113      * @return      boolean     True if successful else return false
00114      * @see     com.ms.wfc.data.Connection
00115      **/
00116   private boolean WriteOrderDB()
00117   {
00118     int     result    = 0;
00119     Connection  con     = null;
00120     String    conDetail = null;
00121     boolean   returnValue = false;
00122     try
00123     {
00124       conDetail = "Data Source=" + helper.DatabaseSettings.DSN + ";" + "User Id=" + helper.DatabaseSettings.User + ";" + "Password=" + helper.DatabaseSettings.Pass + ";";
00125       con     = new Connection();
00126       con.open(conDetail);
00127       for(int index = 0;index < itemVect.size(); index++)
00128       {
00129         String value =  String.valueOf(orderID) + "," + String.valueOf(customerID) + "," + String.valueOf(index) + "," + ((Integer)itemVect.elementAt(index)).toString() + "," +((Integer)quantityVect.elementAt(index)).toString()  ;
00130         result  = con.executeUpdate("Insert into QCSampleOrder (order_id,cust_id,line_no,item_id,quantity) values(" + value + ")");
00131         System.out.println(result);
00132         if(result > 0)
00133         {
00134           returnValue = true;   // Database operation is successful
00135         }
00136         else
00137         {
00138           returnValue = false;
00139           break;
00140         }
00141       }
00142     }
00143     catch(Exception exp)
00144     {
00145       System.out.println("Exception in database handling " + exp);
00146     }
00147     finally
00148     {
00149       if(con != null)
00150       {
00151         con.close();  // Close the database connection
00152       }
00153     }
00154     return returnValue;
00155   }
00156
00157   /**
00158      * Creates a Ship object to send to the shipping department
00159      *
00160      * @param       ---
00161      * @return      boolean     True if successful else return false
00162      * @see     com.ms.win32.ole32.CoGetObject
00163      **/
00164   private boolean InvokeShip()
00165   {
00166     boolean returnValue   = false;
00167     qcship.IShip ship_obj = null;
00168     try
00169     {
00170       // Using Queue moniker to create queued component
00171       ship_obj =  (qcship.IShip)com.ms.win32.Ole32.CoGetObject("queue:/new:QCShipLib.Ship",null,qcship.IShip.iid);
00172       if(ship_obj != null)
00173       {
00174         ship_obj.setCustomerId(customerID);
00175         ship_obj.setOrderId(orderID);
00176         for(int index = 0;index < itemVect.size(); index++)
00177         {
00178           ship_obj.LineItem(((Integer)(itemVect.elementAt(index))).intValue(),((Integer)(quantityVect.elementAt(index))).intValue());
00179         }
00180         ship_obj.Process(0);
00181         returnValue = true;
00182       }
00183     }
00184     catch(com.ms.com.ComFailException exp)
00185     {
00186       System.out.println("Exception calling Ship :  " + exp);
00187     }
00188
00189     return returnValue;
00190   }
00191
00192 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPlgFilter Member List

This is the complete list of members for CPlgFilter, including all inherited members.
CPlgFilter() | CPlgFilter |
CPlgPin class | CPlgFilter | [friend]
CreatePin() | CPlgFilter | [private]
GetPin(int nIndex) | CPlgFilter |
GetPinCount() | CPlgFilter | [virtual]
Initialize() | CPlgFilter |
InitializePrivate(ITPlgPrivEventSink *pSink) | CPlgFilter |
m_lpWaveFormatEx | CPlgFilter | [private]
m_pInputPin | CPlgFilter | [private]
m_pPlgEventSink | CPlgFilter | [private]
Pause(void) | CPlgFilter |
Run(REFERENCE_TIME tStart) | CPlgFilter |
Stop(void) | CPlgFilter |
~CPlgFilter() | CPlgFilter |
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextSamplePropPage/resource.h Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification
  • ContextSamplePropPage

resource.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName: Resource.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by ContextSamplePropPage.rc
00014 //
00015 #define IDS_PROJNAME                            100
00016 #define IDD_CONTEXTSAMPLEPROPPAGE               101
00017 #define IDR_CONTEXTSAMPLEPROPPAGE               102
00018 #define IDS_TITLEContextSamplePropPage          103
00019 #define IDS_HELPFILEContextSamplePropPage       104
00020 #define IDS_DOCSTRINGContextSamplePropPage      105
00021 #define IDS_CONTEXTSAMPLE_OUTPUT_PATH_LABEL     106
00022 #define IDS_CONTEXTSAMPLE_CONTEXT_TYPES_LABEL   107
00023 #define IDS_PLUGIN_PROPS_ERROR                  108
00024 #define IDS_SERVER_CONNECT_ERROR                109
00025 #define IDC_EDIT_OUTPUT_PATH                    204
00026 #define IDC_CHECK_USER_CONTEXT                  205
00027 #define IDC_CHECK_PRESENTATION_CONTEXT          206
00028 #define IDC_CHECK_COMMAND_REQUEST_CONTEXT       207
00029 #define IDC_CHECK_COMMAND_RESPONSE_CONTEXT      208
00030
00031 // Next default values for new objects
00032 //
00033 #ifdef APSTUDIO_INVOKED
00034 #ifndef APSTUDIO_READONLY_SYMBOLS
00035 #define _APS_NEXT_RESOURCE_VALUE        301
00036 #define _APS_NEXT_COMMAND_VALUE         32768
00037 #define _APS_NEXT_CONTROL_VALUE         209
00038 #define _APS_NEXT_SYMED_VALUE           110
00039 #endif
00040 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/dlgdest.h Source File

  • Multimedia
  • Audio
  • multichan

dlgdest.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 #if !defined(AFX_DLGDEST_H__3BF53D52_96B1_11D2_9012_00C04FC2D3B8__INCLUDED_)
00006 #define AFX_DLGDEST_H__3BF53D52_96B1_11D2_9012_00C04FC2D3B8__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 // DlgDest.h : header file
00012 //
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CDlgDest dialog
00016
00017 class CDlgDest : public CDialog
00018 {
00019 // Construction
00020 public:
00021   CDlgDest(CWnd* pParent = NULL);     //  standard constructor
00022     ~CDlgDest( void );                  //  dtor
00023     void Create(void);
00024     void Update(void);
00025     void RecalcDependantVariables(void);
00026
00027 //  Attributes
00028     CWnd*                   m_pwndParent;   //
00029     LPWAVEHDR               m_lpwhdr;
00030     WAVEFORMATEXTENSIBLE    m_wfExt;        //
00031     PBYTE                   m_pbData;
00032     ULONG                   m_cbData;
00033     BOOL                    m_fPlayable;
00034     BOOL                    m_fDragging;
00035     CPoint                  m_ptPosInCaption;
00036
00037 //  Accessors
00038 //  Overrides
00039     virtual LRESULT WindowProc( UINT, WPARAM, LPARAM );
00040
00041 // Dialog Data
00042   //{{AFX_DATA(CDlgDest)
00043   enum { IDD = IDD_DST };
00044   CStatic     m_cChannelMask;
00045   CStatic     m_cAveBitsPerSec;
00046   CButton     m_cRemix;
00047   CEdit     m_cValidBits;
00048   CStatic     m_cChannels;
00049   CStatic     m_cOutput;
00050   CComboBox m_comboBitDepth;
00051   CComboBox m_comboSampleRate;
00052   CComboBox m_comboFormat;
00053   CButton     m_butPlay;
00054     CButton     m_butStop;
00055   UINT      m_wValidBitsPerSample;
00056   CString     m_strChannelMask;
00057   //}}AFX_DATA
00058
00059
00060 // Overrides
00061   // ClassWizard generated virtual function overrides
00062   //{{AFX_VIRTUAL(CDlgDest)
00063   protected:
00064   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00065   //}}AFX_VIRTUAL
00066
00067 // Implementation
00068 public:
00069   // Generated message map functions
00070   //{{AFX_MSG(CDlgDest)
00071   afx_msg void OnRemix();
00072   afx_msg void OnPlay();
00073     afx_msg void OnStop();
00074   virtual BOOL OnInitDialog();
00075   afx_msg void OnComboSamplerate();
00076   afx_msg void OnComboWaveformat();
00077   afx_msg void OnComboBitdepth();
00078   virtual void OnOK();
00079   virtual void OnCancel();
00080   afx_msg void OnEditValidbits();
00081   afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
00082   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00083   afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00084   afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00085   //}}AFX_MSG
00086   DECLARE_MESSAGE_MAP()
00087 };
00088
00089 extern CDlgDest*    g_pdlgDest;
00090 extern HWAVEOUT     g_hwo;
00091
00092 //{{AFX_INSERT_LOCATION}}
00093 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00094
00095 #endif // !defined(AFX_DLGDEST_H__3BF53D52_96B1_11D2_9012_00C04FC2D3B8__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/PrintSdiView.h Source File

  • NetDS
  • fax
  • PrintSdi

PrintSdiView.h

Go to the documentation of this file.
00001 // PrintSDIView.h : interface of the CPrintSDIView class
00002 //
00003 /////////////////////////////////////////////////////////////////////////////
00004
00005 #if !defined(AFX_PRINTSDIVIEW_H__5568954B_8B6C_11D1_B7AE_000000000000__INCLUDED_)
00006 #define AFX_PRINTSDIVIEW_H__5568954B_8B6C_11D1_B7AE_000000000000__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012 class CPrintSDIView : public CView
00013 {
00014 protected: // create from serialization only
00015   CPrintSDIView();
00016   DECLARE_DYNCREATE(CPrintSDIView)
00017
00018 // Attributes
00019 public:
00020   CPrintSDIDoc* GetDocument();
00021
00022 // Operations
00023 public:
00024
00025 // Overrides
00026   // ClassWizard generated virtual function overrides
00027   //{{AFX_VIRTUAL(CPrintSDIView)
00028   public:
00029   virtual void OnDraw(CDC* pDC);  // overridden to draw this view
00030   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00031   protected:
00032   virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00033   virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00034   virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
00035   //}}AFX_VIRTUAL
00036
00037 // Implementation
00038 public:
00039   virtual ~CPrintSDIView();
00040 #ifdef _DEBUG
00041   virtual void AssertValid() const;
00042   virtual void Dump(CDumpContext& dc) const;
00043 #endif
00044
00045 protected:
00046
00047 // Generated message map functions
00048 protected:
00049   //{{AFX_MSG(CPrintSDIView)
00050   afx_msg void OnFileFax();
00051   //}}AFX_MSG
00052   DECLARE_MESSAGE_MAP()
00053 };
00054
00055 #ifndef _DEBUG  // debug version in PrintSDIView.cpp
00056 inline CPrintSDIDoc* CPrintSDIView::GetDocument()
00057    { return (CPrintSDIDoc*)m_pDocument; }
00058 #endif
00059
00060 /////////////////////////////////////////////////////////////////////////////
00061
00062 //{{AFX_INSERT_LOCATION}}
00063 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00064
00065 #endif // !defined(AFX_PRINTSDIVIEW_H__5568954B_8B6C_11D1_B7AE_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/threadsub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

threadsub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __THREADSUB_H__
00018 #define __THREADSUB_H__
00019
00020 #include "resource.h"       // main symbols
00021
00022 CComBSTR GuidToBstr(REFGUID guid);
00023
00024 class CComSpy;
00025
00026 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00027 Class:   CThreadSub
00028 Summary: Thread Events Subscriber
00029 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00030 class ATL_NO_VTABLE CThreadSub :
00031   public CSysLCESub,
00032   public IComThreadEvents
00033 {
00034 public:
00035
00036   CThreadSub(CComSpy * pSpy)
00037   {
00038     m_pSpy = pSpy;
00039   }
00040   CThreadSub()
00041   {
00042     m_pSpy = NULL;
00043   }
00044
00045   DECLARE_REGISTRY_RESOURCEID(IDR_TXSINK)
00046   DECLARE_NOT_AGGREGATABLE(CThreadSub)
00047   DECLARE_GET_CONTROLLING_UNKNOWN()
00048
00049   BEGIN_COM_MAP(CThreadSub)
00050     COM_INTERFACE_ENTRY(IComThreadEvents)
00051     COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00052   END_COM_MAP()
00053
00054   STDMETHODIMP GetEventType(EventEnum * e){*e = Thread;return S_OK;}
00055   STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00056   STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComThreadEvents;return S_OK;}
00057
00058   STDMETHODIMP OnThreadStart(COMSVCSEVENTINFO * pInfo, ULONG64 ThreadID, DWORD dwThread, DWORD dwThreadCnt)
00059   {
00060     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadStart"), GuidToBstr(pInfo->guidApp));
00061
00062     WCHAR szThreadID[32];
00063     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00064     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00065
00066     WCHAR szW2KThreadID[16];
00067     wsprintfW(szW2KThreadID,L"0x%08X", dwThread);
00068     m_pSpy -> AddParamValueToList(L"dwThread", szW2KThreadID);
00069
00070     WCHAR szThreadCnt[16];
00071     wsprintfW(szThreadCnt,L"%lu", dwThreadCnt);
00072     m_pSpy -> AddParamValueToList(L"dwThreadCnt", szThreadCnt);
00073
00074     IF_AUDIT_DO(OnThreadStart)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szW2KThreadID,dwThreadCnt);
00075     return S_OK;
00076   }
00077
00078   STDMETHODIMP OnThreadTerminate(COMSVCSEVENTINFO * pInfo, ULONG64 ThreadID, DWORD dwThread, DWORD dwThreadCnt)
00079   {
00080     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadTerminate"), GuidToBstr(pInfo->guidApp));
00081
00082     WCHAR szThreadID[32];
00083     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00084     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00085
00086     WCHAR szW2KThreadID[16];
00087     wsprintfW(szW2KThreadID,L"0x%08X", dwThread);
00088     m_pSpy -> AddParamValueToList(L"dwThread", szW2KThreadID);
00089
00090     WCHAR szThreadCnt[16];
00091     wsprintfW(szThreadCnt,L"%lu", dwThreadCnt);
00092     m_pSpy -> AddParamValueToList(L"dwThreadCnt", szThreadCnt);
00093
00094     IF_AUDIT_DO(OnThreadTerminate)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szW2KThreadID,dwThreadCnt);
00095     return S_OK;
00096   }
00097
00098   STDMETHODIMP OnThreadBindToApartment(COMSVCSEVENTINFO * pInfo,ULONG64 ThreadID,ULONG64 AptID,DWORD dwActCnt,DWORD dwLowCnt)
00099   {
00100     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadBindToApartment"), GuidToBstr(pInfo->guidApp));
00101
00102     WCHAR szThreadID[32];
00103     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00104     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00105
00106     WCHAR szAptID[32];
00107     wsprintfW(szAptID,L"0x%016X", AptID);
00108     m_pSpy -> AddParamValueToList(L"AptID", szAptID);
00109
00110     WCHAR szActCnt[16];
00111     wsprintfW(szActCnt,L"%lu", dwActCnt);
00112     m_pSpy -> AddParamValueToList(L"dwActCnt", szActCnt);
00113
00114     //dwLowCnt  reserved - currently is 0.
00115
00116     IF_AUDIT_DO(OnThreadBindToApartment)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szAptID,dwActCnt);
00117
00118     return S_OK;
00119   }
00120
00121   STDMETHODIMP OnThreadUnBind(COMSVCSEVENTINFO * pInfo,ULONG64 ThreadID,ULONG64 AptID,DWORD dwActCnt)
00122   {
00123     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadUnBind"), GuidToBstr(pInfo->guidApp));
00124
00125     WCHAR szThreadID[32];
00126     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00127     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00128
00129     WCHAR szAptID[32];
00130     wsprintfW(szAptID,L"0x%016X", AptID);
00131     m_pSpy -> AddParamValueToList(L"AptID", szAptID);
00132
00133     WCHAR szActCnt[16];
00134     wsprintfW(szActCnt,L"%lu", dwActCnt);
00135     m_pSpy -> AddParamValueToList(L"dwActCnt", szActCnt);
00136
00137     //dwLowCnt  reserved - currently is 0.
00138
00139     IF_AUDIT_DO(OnThreadUnBind)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szAptID,dwActCnt);
00140
00141     return S_OK;
00142   }
00143
00144   STDMETHODIMP OnThreadWorkEnque(COMSVCSEVENTINFO * pInfo,ULONG64 ThreadID,ULONG64 MsgWorkID,DWORD dwQueueLen)
00145   {
00146     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadWorkEnque"), GuidToBstr(pInfo->guidApp));
00147
00148     WCHAR szThreadID[32];
00149     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00150     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00151
00152     WCHAR szMsgWorkID[32];
00153     wsprintfW(szMsgWorkID,L"0x%016X", MsgWorkID);
00154     m_pSpy -> AddParamValueToList(L"MsgWorkID", szMsgWorkID);
00155
00156     WCHAR szQueueLen[16];
00157     wsprintfW(szQueueLen,L"%lu", dwQueueLen);
00158     m_pSpy -> AddParamValueToList(L"QueueLen", szQueueLen);
00159
00160     IF_AUDIT_DO(OnThreadWorkEnque)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szMsgWorkID,dwQueueLen);
00161
00162     return S_OK;
00163   }
00164
00165   STDMETHODIMP OnThreadWorkPrivate(COMSVCSEVENTINFO * pInfo,ULONG64 ThreadID,ULONG64 MsgWorkID)
00166   {
00167     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadWorkPrivate"), GuidToBstr(pInfo->guidApp));
00168
00169     WCHAR szThreadID[32];
00170     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00171     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00172
00173     WCHAR szMsgWorkID[32];
00174     wsprintfW(szMsgWorkID,L"0x%016X", MsgWorkID);
00175     m_pSpy -> AddParamValueToList(L"MsgWorkID", szMsgWorkID);
00176
00177     IF_AUDIT_DO(OnThreadWorkPrivate)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szMsgWorkID);
00178
00179     return S_OK;
00180   }
00181
00182   STDMETHODIMP OnThreadWorkPublic(COMSVCSEVENTINFO * pInfo,ULONG64 ThreadID,ULONG64 MsgWorkID,DWORD dwQueueLen)
00183   {
00184     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadWorkPublic"), GuidToBstr(pInfo->guidApp));
00185
00186     WCHAR szThreadID[32];
00187     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00188     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00189
00190     WCHAR szMsgWorkID[32];
00191     wsprintfW(szMsgWorkID,L"0x%016X", MsgWorkID);
00192     m_pSpy -> AddParamValueToList(L"MsgWorkID", szMsgWorkID);
00193
00194     WCHAR szQueueLen[16];
00195     wsprintfW(szQueueLen,L"%lu", dwQueueLen);
00196     m_pSpy -> AddParamValueToList(L"QueueLen", szQueueLen);
00197
00198     IF_AUDIT_DO(OnThreadWorkPublic)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szMsgWorkID,dwQueueLen);
00199
00200     return S_OK;
00201   }
00202
00203   STDMETHODIMP OnThreadWorkRedirect(COMSVCSEVENTINFO * pInfo,ULONG64 ThreadID,ULONG64 MsgWorkID,DWORD dwQueueLen,ULONG64 ThreadNum)
00204   {
00205     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadWorkRedirect"), GuidToBstr(pInfo->guidApp));
00206
00207     WCHAR szThreadID[32];
00208     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00209     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00210
00211     WCHAR szMsgWorkID[32];
00212     wsprintfW(szMsgWorkID,L"0x%016X", MsgWorkID);
00213     m_pSpy -> AddParamValueToList(L"MsgWorkID", szMsgWorkID);
00214
00215     WCHAR szQueueLen[16];
00216     wsprintfW(szQueueLen,L"%lu", dwQueueLen);
00217     m_pSpy -> AddParamValueToList(L"QueueLen", szQueueLen);
00218
00219     WCHAR szThreadNum[32];
00220     wsprintfW(szThreadNum,L"0x%016X", ThreadNum);
00221     m_pSpy -> AddParamValueToList(L"ThreadNum", szThreadNum);
00222
00223     IF_AUDIT_DO(OnThreadWorkRedirect)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szMsgWorkID,dwQueueLen,szThreadNum);
00224
00225     return S_OK;
00226   }
00227
00228   STDMETHODIMP OnThreadWorkReject(COMSVCSEVENTINFO * pInfo,ULONG64 ThreadID,ULONG64 MsgWorkID,DWORD dwQueueLen)
00229   {
00230     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadWorkReject"), GuidToBstr(pInfo->guidApp));
00231
00232     WCHAR szThreadID[32];
00233     wsprintfW(szThreadID,L"0x%016X", ThreadID);
00234     m_pSpy -> AddParamValueToList(L"ThreadID", szThreadID);
00235
00236     WCHAR szMsgWorkID[32];
00237     wsprintfW(szMsgWorkID,L"0x%016X", MsgWorkID);
00238     m_pSpy -> AddParamValueToList(L"MsgWorkID", szMsgWorkID);
00239
00240     WCHAR szQueueLen[16];
00241     wsprintfW(szQueueLen,L"%lu", dwQueueLen);
00242     m_pSpy -> AddParamValueToList(L"QueueLen", szQueueLen);
00243
00244     IF_AUDIT_DO(OnThreadWorkReject)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szThreadID,szMsgWorkID,dwQueueLen);
00245
00246     return S_OK;
00247   }
00248
00249   STDMETHODIMP OnThreadAssignApartment(COMSVCSEVENTINFO * pInfo, REFGUID guidActivity, ULONG64 AptId)
00250   {
00251     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadAssignApartment"), GuidToBstr(pInfo->guidApp));
00252
00253     CComBSTR sGuidActivity = GuidToBstr(guidActivity);
00254     m_pSpy -> AddParamValueToList(L"guidActivity", sGuidActivity);
00255
00256     WCHAR szAptID[32];
00257     wsprintfW(szAptID,L"0x%016X", AptId);
00258     m_pSpy -> AddParamValueToList(L"AptID", szAptID);
00259
00260     IF_AUDIT_DO(OnThreadAssignApartment)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),sGuidActivity,szAptID);
00261
00262     return S_OK;
00263   }
00264
00265   STDMETHODIMP OnThreadUnassignApartment(COMSVCSEVENTINFO * pInfo, ULONG64 AptId)
00266   {
00267     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnThreadUnassignApartment"), GuidToBstr(pInfo->guidApp));
00268
00269     WCHAR szAptID[32];
00270     wsprintfW(szAptID,L"0x%016X", AptId);
00271     m_pSpy -> AddParamValueToList(L"AptID", szAptID);
00272
00273     IF_AUDIT_DO(OnThreadUnassignApartment)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),szAptID);
00274
00275     return S_OK;
00276   }
00277
00278 };
00279
00280 #endif //__THREADSUB_H__
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/Util.Cpp Source File

  • Web
  • NetMeeting
  • NMShare

Util.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       UTIL.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 //****************************************************************************
00019 //
00020 // VOID ClearText(void)
00021 //
00022 //****************************************************************************
00023
00024 VOID ClearText(void)
00025 {
00026   SendMessage(ghwndMsg, LB_RESETCONTENT, 0, 0);
00027 }
00028
00029
00030 //****************************************************************************
00031 //
00032 // VOID DisplayMsg(LPTSTR pszMsg)
00033 //
00034 //****************************************************************************
00035
00036 VOID DisplayMsg(LPTSTR pszMsg)
00037 {
00038   SendMessage(ghwndMsg, LB_ADDSTRING, 0, (LPARAM) pszMsg);
00039   PostMessage(ghwndMsg, WM_VSCROLL, SB_BOTTOM, 0);
00040 }
00041
00042
00043 #ifdef NOTUSED
00044
00045 //****************************************************************************
00046 //
00047 // VOID SizeStatus(int dxClient, int dy)
00048 //
00049 //****************************************************************************
00050
00051 VOID SizeStatus(int dxClient, int dy)
00052 {
00053   int rgdxp[3];
00054
00055   rgdxp[2] = dxClient;
00056   dxClient -= 50;
00057   rgdxp[1] = dxClient;
00058   dxClient -= 75;
00059   rgdxp[0] = dxClient;
00060   SendMessage(ghwndSbar, SB_SETPARTS, (WPARAM) 3, (LPARAM) rgdxp);
00061 }
00062 #endif
00063
00064
00065 //****************************************************************************
00066 //
00067 // VOID SizeMsgWindow(int dx, int dy)
00068 //
00069 //****************************************************************************
00070
00071 VOID SizeMsgWindow(int dx, int dy)
00072 {
00073   int dyT = dy;
00074   int dxLeft = XP_LEFT;
00075
00076   if (gPref.fMsgWindow)
00077   {
00078     dyT = dy / 2;
00079     MoveWindow(ghwndMsg, XP_LEFT, dy - dyT, dx, dyT, TRUE);
00080     dy -= (YP_TOP + dyT);
00081   }
00082
00083
00084   if (gPref.fUserList)
00085   {
00086     MoveWindow(ghwndUser, XP_LEFT, YP_TOP, DXP_USER, dyT, TRUE);
00087     dxLeft += DXP_USER;
00088     dx -= DXP_USER;
00089   }
00090
00091   MoveWindow(ghwndApp, dxLeft, YP_TOP, dx, dy, TRUE);
00092 }
00093
00094
00095 //****************************************************************************
00096 //
00097 // VOID RecalcMsgWindow(void)
00098 //
00099 //****************************************************************************
00100
00101 VOID RecalcMsgWindow(void)
00102 {
00103   RECT rc;
00104
00105   GetClientRect(ghwndMain, &rc);
00106   SizeMsgWindow(rc.right, rc.bottom);
00107 }
00108
00109
00110 //****************************************************************************
00111 //
00112 // VOID ShowHwnd(HWND hwnd, BOOL fShow, int idm)
00113 //
00114 // Show/Hide a window
00115 //
00116 //****************************************************************************
00117
00118 VOID ShowHwnd(HWND hwnd, BOOL fShow, int idm)
00119 {
00120   if (IsWindow(hwnd))
00121   {
00122     ShowWindow(hwnd, fShow ? SW_SHOW : SW_HIDE);
00123     SetMenuCheck(idm, fShow);
00124     RecalcMsgWindow();
00125   }
00126 }
00127
00128
00129 //****************************************************************************
00130 //
00131 // LPVOID LpvAlloc(int cb)
00132 //
00133 // Return a pointer to an allocated array of bytes
00134 //
00135 //****************************************************************************
00136
00137 LPVOID LpvAlloc(int cb)
00138 {
00139   return LocalAlloc(LMEM_FIXED, cb);
00140 }
00141
00142 LPTSTR PszAlloc(int cch)
00143 {
00144   return (LPTSTR) LocalAlloc(LMEM_FIXED, sizeof(TCHAR) * (cch+1));
00145 }
00146
00147
00148 //****************************************************************************
00149 //
00150 // VOID FreePlpv(LPVOID plpv)
00151 //
00152 // Free the data pointed to by plpv and set *plpv to NULL
00153 //
00154 //****************************************************************************
00155
00156 VOID FreePlpv(LPVOID plpv)
00157 {
00158   if ((plpv == NULL) || (*(VOID FAR * FAR *)plpv == NULL)) {
00159     return;
00160   }
00161
00162   LocalFree(*(VOID FAR * FAR *)plpv);
00163   *(VOID FAR * FAR *)plpv = NULL;
00164 }
00165
00166
00167 //****************************************************************************
00168 //
00169 // VOID MaybeDeleteObject(HGDIOBJ * phgdi)
00170 //
00171 // Check usage count, delete if we can
00172 //
00173 //****************************************************************************
00174
00175 VOID MaybeDeleteObject(HGDIOBJ * phgdi)
00176 {
00177   if (*phgdi == hgdiNil)
00178     return;
00179
00180   DeleteObject(*phgdi);
00181   *phgdi = hgdiNil;
00182 }
00183
00184
00185 //****************************************************************************
00186 //
00187 // VOID SetMenuCheck(UINT idm, BOOL fCheck)
00188 //
00189 // Set the menu item's check mark.
00190 //
00191 //****************************************************************************
00192
00193 VOID SetMenuCheck(UINT idm, BOOL fCheck)
00194 {
00195   CheckMenuItem(ghMenu, idm,
00196     fCheck ? (MF_CHECKED  | MF_BYCOMMAND) : (MF_UNCHECKED | MF_BYCOMMAND));
00197 }
00198
00199
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/BasePage.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

BasePage.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      BasePage.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the CBasePropertyPage class.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 #include "stdafx.h"
00021 #include "ClipBook ServerEx.h"
00022 #include "ExtObj.h"
00023 #include "BasePage.h"
00024
00025 #ifdef _DEBUG
00026 #define new DEBUG_NEW
00027 #undef THIS_FILE
00028 static char THIS_FILE[] = __FILE__;
00029 #endif
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // CBasePropertyPage property page
00033 /////////////////////////////////////////////////////////////////////////////
00034
00035 IMPLEMENT_DYNCREATE( CBasePropertyPage, CPropertyPage )
00036
00037 /////////////////////////////////////////////////////////////////////////////
00038 // Message Maps
00039 /////////////////////////////////////////////////////////////////////////////
00040
00041 BEGIN_MESSAGE_MAP( CBasePropertyPage, CPropertyPage )
00042     //{{AFX_MSG_MAP(CBasePropertyPage)
00043     ON_WM_CREATE()
00044     ON_WM_DESTROY()
00045     //}}AFX_MSG_MAP
00046 END_MESSAGE_MAP()
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049 //++
00050 //
00051 //  CBasePropertyPage::CBasePropertyPage
00052 //
00053 //  Description:
00054 //      Default constructor.
00055 //
00056 //  Arguments:
00057 //      None.
00058 //
00059 //  Return Value:
00060 //      None.
00061 //
00062 //--
00063 /////////////////////////////////////////////////////////////////////////////
00064 CBasePropertyPage::CBasePropertyPage( void )
00065 {
00066     CommonConstruct();
00067
00068 } //*** CBasePropertyPage::CBasePropertyPage
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 //++
00072 //
00073 //  CBasePropertyPage::CBasePropertyPage
00074 //
00075 //  Description:
00076 //      Default constructor.
00077 //
00078 //  Arguments:
00079 //      nIDTemplateIn
00080 //          Dialog template resource ID.
00081 //
00082 //      nIDCaptionIn
00083 //          Caption string resource ID.
00084 //
00085 //  Return Value:
00086 //      None.
00087 //
00088 //--
00089 /////////////////////////////////////////////////////////////////////////////
00090 CBasePropertyPage::CBasePropertyPage(
00091       UINT  nIDTemplateIn
00092     , UINT  nIDCaptionIn
00093     )
00094     : CPropertyPage( nIDTemplateIn, nIDCaptionIn )
00095 {
00096     CommonConstruct();
00097
00098 } //*** CBasePropertyPage::CBasePropertyPage
00099
00100 /////////////////////////////////////////////////////////////////////////////
00101 //++
00102 //
00103 //  CBasePropertyPage::CommonConstruct
00104 //
00105 //  Description:
00106 //      Common construction.
00107 //
00108 //  Arguments:
00109 //      None.
00110 //
00111 //  Return Value:
00112 //      None.
00113 //
00114 //--
00115 /////////////////////////////////////////////////////////////////////////////
00116 void
00117 CBasePropertyPage::CommonConstruct( void )
00118 {
00119     //{{AFX_DATA_INIT(CBasePropertyPage)
00120     //}}AFX_DATA_INIT
00121
00122     m_peo = NULL;
00123     m_hpage = NULL;
00124     m_bBackPressed = FALSE;
00125     m_bSaved = FALSE;
00126
00127     m_iddPropertyPage = NULL;
00128     m_iddWizardPage = NULL;
00129     m_idsCaption = NULL;
00130
00131     m_bDoDetach = FALSE;
00132
00133 } //*** CBasePropertyPage::CommonConstruct
00134
00135 /////////////////////////////////////////////////////////////////////////////
00136 //++
00137 //
00138 //  CBasePropertyPage::HrInit
00139 //
00140 //  Description:
00141 //      Initialize the page.
00142 //
00143 //  Arguments:
00144 //      peoInout
00145 //          Pointer to the extension object.
00146 //
00147 //  Return Value:
00148 //      S_OK
00149 //          Page initialized successfully.
00150 //
00151 //      Other HRESULTs
00152 //          Page failed to initialize.
00153 //
00154 //--
00155 /////////////////////////////////////////////////////////////////////////////
00156 HRESULT
00157 CBasePropertyPage::HrInit(
00158     CExtObject * peoInout
00159     )
00160 {
00161     ASSERT( peoInout != NULL );
00162
00163     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00164
00165     HRESULT         hr = S_OK;
00166     CWaitCursor     wc;
00167     DWORD           sc = ERROR_SUCCESS;
00168     CClusPropList   cpl;
00169
00170     m_peo = peoInout;
00171
00172     //
00173     //  Don't display a help button.
00174     //
00175
00176     m_psp.dwFlags &= ~PSP_HASHELP;
00177
00178     //
00179     //  Construct the property page.
00180     //
00181
00182     if ( Peo()->BWizard() )
00183     {
00184         ASSERT( IddWizardPage() != NULL);
00185         Construct( IddWizardPage(), IdsCaption() );
00186     } // if: adding page to wizard
00187     else
00188     {
00189         ASSERT( IddPropertyPage() != NULL );
00190         Construct( IddPropertyPage(), IdsCaption() );
00191     } // else: adding page to property sheet
00192
00193     //
00194     //  Read the properties private to this resource and parse them.
00195     //
00196
00197     ASSERT( Peo() != NULL );
00198     ASSERT( Peo()->PodObjData() );
00199
00200     //
00201     //  Read the properties.
00202     //
00203
00204     switch ( Cot() )
00205     {
00206         case CLUADMEX_OT_CLUSTER:
00207         {
00208             CClusterData * pccd = reinterpret_cast< CClusterData * >( Peo()->PodObjData() );
00209             ASSERT( pccd && (pccd->GetHCluster() != NULL) );
00210             sc = cpl.ScGetClusterProperties(
00211                                       pccd->GetHCluster()
00212                                     , CLUSCTL_CLUSTER_GET_PRIVATE_PROPERTIES
00213                                     );
00214             break;
00215         }
00216         case CLUADMEX_OT_NODE:
00217         {
00218             CNodeData * pcnd = reinterpret_cast< CNodeData * >( Peo()->PodObjData() );
00219             ASSERT( pcnd && (pcnd->GetHNode() != NULL) );
00220             sc = cpl.ScGetNodeProperties(
00221                                       pcnd->GetHNode()
00222                                     , CLUSCTL_NODE_GET_PRIVATE_PROPERTIES
00223                                     );
00224             break;
00225         }
00226         case CLUADMEX_OT_GROUP:
00227         {
00228             CGroupData * pcgd = reinterpret_cast< CGroupData * >( Peo()->PodObjData() );
00229             ASSERT( pcgd && (pcgd->GetHGroup() != NULL) );
00230             sc = cpl.ScGetGroupProperties(
00231                                       pcgd->GetHGroup()
00232                                     , CLUSCTL_GROUP_GET_PRIVATE_PROPERTIES
00233                                     );
00234             break;
00235         }
00236         case CLUADMEX_OT_RESOURCE:
00237         {
00238             CResData * pcrd = reinterpret_cast< CResData * >( Peo()->PodObjData() );
00239             ASSERT( pcrd && (pcrd->GetHResource() != NULL) );
00240             sc = cpl.ScGetResourceProperties(
00241                                       pcrd->GetHResource()
00242                                     , CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES
00243                                     );
00244             break;
00245         }
00246         case CLUADMEX_OT_RESOURCETYPE:
00247         {
00248             CResTypeData * pcrd = reinterpret_cast< CResTypeData * >( Peo()->PodObjData() );
00249             ASSERT( pcrd && (pcrd->StrName().GetLength() > 0) );
00250             sc = cpl.ScGetResourceTypeProperties(
00251                                       Hcluster()
00252                                     , pcrd->StrName()
00253                                     , CLUSCTL_RESOURCE_TYPE_GET_PRIVATE_PROPERTIES
00254                                     );
00255             break;
00256         }
00257         case CLUADMEX_OT_NETWORK:
00258         {
00259             CNetworkData * pcnd = reinterpret_cast< CNetworkData * >( Peo()->PodObjData() );
00260             ASSERT( pcnd && (pcnd->GetHNetwork() != NULL) );
00261             sc = cpl.ScGetNetworkProperties(
00262                                       pcnd->GetHNetwork()
00263                                     , CLUSCTL_NETWORK_GET_PRIVATE_PROPERTIES
00264                                     );
00265             break;
00266         }
00267         case CLUADMEX_OT_NETINTERFACE:
00268         {
00269             CNetInterfaceData * pcnd = reinterpret_cast< CNetInterfaceData * >( Peo()->PodObjData() );
00270             ASSERT( pcnd && (pcnd->GetHNetInterface() != NULL) );
00271             sc = cpl.ScGetNetInterfaceProperties(
00272                                       pcnd->GetHNetInterface()
00273                                     , CLUSCTL_NETINTERFACE_GET_PRIVATE_PROPERTIES
00274                                     );
00275             break;
00276         }
00277         default:
00278             ASSERT( 0 );
00279     } // switch: object type
00280
00281     //
00282     //  Parse the properties.
00283     //
00284
00285     if ( sc == ERROR_SUCCESS )
00286     {
00287         // Parse the properties.
00288         try
00289         {
00290             sc = ScParseProperties( cpl );
00291         } // try
00292         catch ( CMemoryException * pme )
00293         {
00294             hr = E_OUTOFMEMORY;
00295             pme->Delete();
00296         } // catch: CMemoryException
00297     } // if: properties read successfully
00298
00299     if ( sc != ERROR_SUCCESS )
00300     {
00301         hr = HRESULT_FROM_WIN32( sc );
00302         goto Cleanup;
00303     } // if: error parsing getting or parsing properties
00304
00305 Cleanup:
00306
00307     return hr;
00308
00309 } //*** CBasePropertyPage::HrInit
00310
00311 /////////////////////////////////////////////////////////////////////////////
00312 //++
00313 //
00314 //  CBasePropertyPage::HrCreatePage
00315 //
00316 //  Description:
00317 //      Create the page.
00318 //
00319 //  Arguments:
00320 //      None.
00321 //
00322 //  Return Value:
00323 //      S_OK
00324 //          Page created successfully.
00325 //
00326 //      Other HRESULTs
00327 //          Error creating the page.
00328 //
00329 //--
00330 /////////////////////////////////////////////////////////////////////////////
00331 HRESULT
00332 CBasePropertyPage::HrCreatePage( void )
00333 {
00334     ASSERT( m_hpage == NULL );
00335
00336     HRESULT hr = S_OK;
00337
00338     m_hpage = CreatePropertySheetPage( reinterpret_cast< LPPROPSHEETPAGEW >( &m_psp ) );
00339     if ( m_hpage == NULL )
00340     {
00341         hr = HRESULT_FROM_WIN32( GetLastError() );
00342     } // if: error creating the page
00343
00344     return hr;
00345
00346 } //*** CBasePropertyPage::HrCreatePage
00347
00348 /////////////////////////////////////////////////////////////////////////////
00349 //++
00350 //
00351 //  CBasePropertyPage::ScParseProperties
00352 //
00353 //  Description:
00354 //      Parse the properties of the resource.  This is in a separate function
00355 //      from HrInit so that the optimizer can do a better job.
00356 //
00357 //  Arguments:
00358 //      rcplIn
00359 //          Cluster property list to parse.
00360 //
00361 //  Return Values:
00362 //      ERROR_SUCCESS
00363 //          Properties were parsed successfully.
00364 //
00365 //      Other HRESULTs
00366 //          Error parsing the properties.  (Includes any error returned from
00367 //          ScParseUnknownProperty().)
00368 //
00369 //  Exceptions Thrown:
00370 //      Any exceptions from CString::operator=().
00371 //
00372 //--
00373 /////////////////////////////////////////////////////////////////////////////
00374 DWORD
00375 CBasePropertyPage::ScParseProperties(
00376     CClusPropList & rcplIn
00377     )
00378 {
00379     DWORD                   sc = ERROR_SUCCESS;
00380     DWORD                   cprop;
00381     const CObjectProperty * pprop;
00382
00383     ASSERT( rcplIn.PbPropList() != NULL );
00384
00385     sc = rcplIn.ScMoveToFirstProperty();
00386     while ( sc == ERROR_SUCCESS )
00387     {
00388         //
00389         // Parse known properties.
00390         //
00391
00392         for ( pprop = Pprops(), cprop = Cprops() ; cprop > 0 ; pprop++, cprop-- )
00393         {
00394             if ( NIStringCompareW(
00395                                    rcplIn.PszCurrentPropertyName()
00396                                  , pprop->m_pwszName
00397                                  , rcplIn.CbhCurrentPropertyName().pName->cbLength / sizeof( WCHAR )
00398                                  ) == 0
00399                )
00400             {
00401                 if ( rcplIn.CpfCurrentValueFormat() == pprop->m_propFormat )
00402                 {
00403                     switch ( pprop->m_propFormat )
00404                     {
00405                         case CLUSPROP_FORMAT_SZ:
00406                         case CLUSPROP_FORMAT_EXPAND_SZ:
00407                             ASSERT(     (rcplIn.CbCurrentValueLength() == (lstrlenW( rcplIn.CbhCurrentValue().pStringValue->sz ) + 1) * sizeof( WCHAR ))
00408                                     ||  (   (rcplIn.CbCurrentValueLength() == 0)
00409                                         &&  (rcplIn.CbhCurrentValue().pStringValue->sz[ 0 ] == L'\0') ) );
00410                             *pprop->m_value.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00411                             *pprop->m_valuePrev.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00412
00413                             //
00414                             //  See if we need to find an expanded version
00415                             //
00416
00417                             if ( pprop->m_valueEx.pstr != NULL )
00418                             {
00419                                 // Copy the non-expanded one just in case there isn't an expanded version
00420                                 *pprop->m_valueEx.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00421
00422                                 // See if they included an expanded version
00423                                 rcplIn.ScMoveToNextPropertyValue( );
00424                                 if ( rcplIn.CpfCurrentValueFormat( ) == CLUSPROP_FORMAT_EXPANDED_SZ )
00425                                 {
00426                                     *pprop->m_valueEx.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00427                                 } // if: found expanded version
00428
00429                             } // if: *pprop->m_valueEx.pstr is present
00430                             break;
00431
00432                         case CLUSPROP_FORMAT_EXPANDED_SZ:
00433                             ASSERT(     (rcplIn.CbCurrentValueLength() == (lstrlenW( rcplIn.CbhCurrentValue().pStringValue->sz ) + 1) * sizeof( WCHAR ))
00434                                     ||  (   (rcplIn.CbCurrentValueLength() == 0)
00435                                         &&  (rcplIn.CbhCurrentValue().pStringValue->sz[ 0 ] == L'\0') ) );
00436                             *pprop->m_value.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00437                             *pprop->m_valuePrev.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00438
00439                             //
00440                             //  See if we need to find an expanded version
00441                             //
00442
00443                             if ( *pprop->m_valueEx.pstr ) // can not use != NULL because overloading tries to do a string compare!
00444                             {
00445                                 // Copy the expanded version
00446                                 *pprop->m_valueEx.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00447
00448                                 // See if they included a non-expanded version
00449                                 rcplIn.ScMoveToNextPropertyValue( );
00450                                 if ( rcplIn.CpfCurrentValueFormat( ) == CLUSPROP_FORMAT_SZ )
00451                                 {
00452                                     *pprop->m_value.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00453                                     *pprop->m_valuePrev.pstr = rcplIn.CbhCurrentValue().pStringValue->sz;
00454                                 } // if: found non-expanded version
00455
00456                             } // if: *pprop->m_valueEx.pstr is present
00457                             break;
00458
00459                         case CLUSPROP_FORMAT_DWORD:
00460                         case CLUSPROP_FORMAT_LONG:
00461                             ASSERT( rcplIn.CbCurrentValueLength() == sizeof( DWORD ) );
00462                             *pprop->m_value.pdw = rcplIn.CbhCurrentValue().pDwordValue->dw;
00463                             *pprop->m_valuePrev.pdw = rcplIn.CbhCurrentValue().pDwordValue->dw;
00464                             break;
00465
00466                         case CLUSPROP_FORMAT_BINARY:
00467                         case CLUSPROP_FORMAT_MULTI_SZ:
00468                             *pprop->m_value.ppb = rcplIn.CbhCurrentValue().pBinaryValue->rgb;
00469                             *pprop->m_value.pcb = rcplIn.CbhCurrentValue().pBinaryValue->cbLength;
00470                             *pprop->m_valuePrev.ppb = rcplIn.CbhCurrentValue().pBinaryValue->rgb;
00471                             *pprop->m_valuePrev.pcb = rcplIn.CbhCurrentValue().pBinaryValue->cbLength;
00472                             break;
00473
00474                         default:
00475                             ASSERT(0);  // don't know how to deal with this type
00476                     } // switch: property format
00477
00478                     //
00479                     //  Exit the loop since we found the parameter.
00480                     //
00481
00482                     break;
00483                 }// if: found a type match
00484             } // if: found a string match
00485         } // for: each property that we know about
00486
00487         //
00488         // If the property wasn't known, ask the derived class to parse it.
00489         //
00490
00491         if ( cprop == 0 )
00492         {
00493             sc = ScParseUnknownProperty(
00494                           rcplIn.CbhCurrentPropertyName().pName->sz
00495                         , rcplIn.CbhCurrentValue()
00496                         , rcplIn.RPvlPropertyValue().CbDataLeft()
00497                         );
00498             if ( sc != ERROR_SUCCESS )
00499             {
00500                 return sc;
00501             } // if: error parsing the unknown property
00502         } // if: property not parsed
00503
00504         //
00505         // Advance the buffer pointer past the value in the value list.
00506         //
00507
00508         sc = rcplIn.ScMoveToNextProperty();
00509     } // while: more properties to parse
00510
00511     //
00512     // If we reached the end of the properties, fix the return code.
00513     //
00514
00515     if ( sc == ERROR_NO_MORE_ITEMS )
00516     {
00517         sc = ERROR_SUCCESS;
00518     } // if: ended loop after parsing all properties
00519
00520     return sc;
00521
00522 } //*** CBasePropertyPage::ScParseProperties
00523
00524 /////////////////////////////////////////////////////////////////////////////
00525 //++
00526 //
00527 //  CBasePropertyPage::OnCreate
00528 //
00529 //  Description:
00530 //      Handler for the WM_CREATE message.
00531 //
00532 //  Arguments:
00533 //      lpCreateStructIn
00534 //          Window create structure.
00535 //
00536 //  Return Value:
00537 //      -1
00538 //          Error.
00539 //
00540 //      0
00541 //          Success.
00542 //
00543 //--
00544 /////////////////////////////////////////////////////////////////////////////
00545 int
00546 CBasePropertyPage::OnCreate(
00547     LPCREATESTRUCT lpCreateStructIn
00548     )
00549 {
00550     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00551
00552     //
00553     // Attach the window to the property page structure.
00554     // This has been done once already in the main application, since the
00555     // main application owns the property sheet.  It needs to be done here
00556     // so that the window handle can be found in the DLL's handle map.
00557     //
00558
00559     if ( FromHandlePermanent( m_hWnd ) == NULL ) // is the window handle already in the handle map
00560     {
00561         HWND hWnd = m_hWnd;
00562         m_hWnd = NULL;
00563         Attach( hWnd );
00564         m_bDoDetach = TRUE;
00565     } // if: is the window handle in the handle map
00566
00567     return CPropertyPage::OnCreate( lpCreateStructIn );
00568
00569 } //*** CBasePropertyPage::OnCreate
00570
00571 /////////////////////////////////////////////////////////////////////////////
00572 //++
00573 //
00574 //  CBasePropertyPage::OnDestroy
00575 //
00576 //  Description:
00577 //      Handler for the WM_DESTROY message.
00578 //
00579 //  Arguments:
00580 //      None.
00581 //
00582 //  Return Value:
00583 //      None.
00584 //
00585 //--
00586 /////////////////////////////////////////////////////////////////////////////
00587 void
00588 CBasePropertyPage::OnDestroy( void )
00589 {
00590     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00591
00592     //
00593     // Detach the window from the property page structure.
00594     // This will be done again by the main application, since it owns the
00595     // property sheet.  It needs to be done here so that the window handle
00596     // can be removed from the DLL's handle map.
00597     //
00598
00599     if ( m_bDoDetach )
00600     {
00601         if ( m_hWnd != NULL )
00602         {
00603             HWND hWnd = m_hWnd;
00604
00605             Detach();
00606             m_hWnd = hWnd;
00607         } // if: do we have a window handle?
00608     } // if: do we need to balance the attach we did with a detach?
00609
00610     CPropertyPage::OnDestroy();
00611
00612 } //*** CBasePropertyPage::OnDestroy
00613
00614 /////////////////////////////////////////////////////////////////////////////
00615 //++
00616 //
00617 //  CBasePropertyPage::DoDataExchange
00618 //
00619 //  Description:
00620 //      Do data exchange between the dialog and the class.
00621 //
00622 //  Arguments:
00623 //      pDXIn
00624 //          Data exchange object
00625 //
00626 //  Return Value:
00627 //      None.
00628 //
00629 //--
00630 /////////////////////////////////////////////////////////////////////////////
00631 void
00632 CBasePropertyPage::DoDataExchange(
00633     CDataExchange * pDXIn
00634     )
00635 {
00636     if ( ! pDXIn->m_bSaveAndValidate || ! BSaved() )
00637     {
00638         AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00639
00640         //{{AFX_DATA_MAP(CBasePropertyPage)
00641             // NOTE: the ClassWizard will add DDX and DDV calls here
00642         //}}AFX_DATA_MAP
00643
00644         DDX_Control( pDXIn, IDC_PP_ICON, m_staticIcon );
00645         DDX_Control( pDXIn, IDC_PP_TITLE, m_staticTitle );
00646
00647         if ( pDXIn->m_bSaveAndValidate )
00648         {
00649             if ( ! BBackPressed() )
00650             {
00651                 CWaitCursor wc;
00652
00653                 //
00654                 //  Validate the data.
00655                 //
00656
00657                 if ( ! BSetPrivateProps( TRUE /*fValidateOnlyIn*/ ) )
00658                 {
00659                     pDXIn->Fail();
00660                 } // if: error setting private properties
00661             } // if: Back button not pressed
00662         } // if: saving data from dialog
00663         else
00664         {
00665             //
00666             //  Set the title.
00667             //
00668
00669             DDX_Text( pDXIn, IDC_PP_TITLE, m_strTitle );
00670         } // if: not saving data
00671     }  // if: not saving or haven't saved yet
00672
00673     //
00674     //  Call the base class method.
00675     //
00676
00677     CPropertyPage::DoDataExchange( pDXIn );
00678
00679 } //*** CBasePropertyPage::DoDataExchange
00680
00681 /////////////////////////////////////////////////////////////////////////////
00682 //++
00683 //
00684 //  CBasePropertyPage::OnInitDialog
00685 //
00686 //  Description:
00687 //      Handler for the WM_INITDIALOG message.
00688 //
00689 //  Arguments:
00690 //      None.
00691 //
00692 //  Return Value:
00693 //      TRUE
00694 //          We need the focus to be set for us.
00695 //
00696 //      FALSE
00697 //          We already set the focus to the proper control.
00698 //
00699 //--
00700 /////////////////////////////////////////////////////////////////////////////
00701 BOOL
00702 CBasePropertyPage::OnInitDialog( void )
00703 {
00704     ASSERT( Peo() != NULL );
00705     ASSERT( Peo()->PodObjData() != NULL );
00706
00707     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00708
00709     //
00710     //  Set the title string.
00711     //
00712
00713     m_strTitle = Peo()->PodObjData()->StrName();
00714
00715     //
00716     //  Call the base class method.
00717     //
00718
00719     CPropertyPage::OnInitDialog();
00720
00721     //
00722     //  Display an icon for the object.
00723     //
00724
00725     if ( Peo()->Hicon() != NULL )
00726     {
00727         m_staticIcon.SetIcon( Peo()->Hicon() );
00728     } // if: an icon was specified
00729
00730     //
00731     //  Return TRUE unless you set the focus to a control.
00732     //
00733     //  EXCEPTION: OCX Property Pages should return FALSE.
00734     //
00735
00736     return TRUE;
00737
00738 } //*** CBasePropertyPage::OnInitDialog
00739
00740 /////////////////////////////////////////////////////////////////////////////
00741 //++
00742 //
00743 //  CBasePropertyPage::OnSetActive
00744 //
00745 //  Description:
00746 //      Handler for the PSN_SETACTIVE message.
00747 //
00748 //  Arguments:
00749 //      None.
00750 //
00751 //  Return Value:
00752 //      TRUE
00753 //          Page successfully initialized.
00754 //
00755 //      FALSE
00756 //          Page not initialized.
00757 //
00758 //--
00759 /////////////////////////////////////////////////////////////////////////////
00760 BOOL
00761 CBasePropertyPage::OnSetActive( void )
00762 {
00763     HRESULT hr = S_OK;
00764
00765     ASSERT( Peo() != NULL);
00766     ASSERT( Peo()->PodObjData() != NULL );
00767
00768     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00769
00770     //
00771     //  Reread the data.
00772     //
00773
00774     hr = Peo()->HrGetObjectInfo();
00775     if ( FAILED( hr ) )
00776     {
00777         return FALSE;
00778     } // if: error getting object info
00779
00780     //
00781     //  Set the title string.
00782     //
00783
00784     m_strTitle = Peo()->PodObjData()->StrName();
00785
00786     m_bBackPressed = FALSE;
00787     m_bSaved = FALSE;
00788     return CPropertyPage::OnSetActive();
00789
00790 } //*** CBasePropertyPage::OnSetActive
00791
00792 /////////////////////////////////////////////////////////////////////////////
00793 //++
00794 //
00795 //  CBasePropertyPage::OnApply
00796 //
00797 //  Description:
00798 //      Handler for the PSM_APPLY message.
00799 //
00800 //  Arguments:
00801 //      None.
00802 //
00803 //  Return Value:
00804 //      TRUE
00805 //          Page successfully applied.
00806 //
00807 //      FALSE
00808 //          Error applying page.
00809 //
00810 //--
00811 /////////////////////////////////////////////////////////////////////////////
00812 BOOL
00813 CBasePropertyPage::OnApply( void )
00814 {
00815     ASSERT( ! BWizard() );
00816
00817     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00818
00819     CWaitCursor wc;
00820
00821     if ( BApplyChanges() == FALSE )
00822     {
00823         return FALSE;
00824     } // if: error applying changes
00825
00826     return CPropertyPage::OnApply();
00827
00828 } //*** CBasePropertyPage::OnApply
00829
00830 /////////////////////////////////////////////////////////////////////////////
00831 //++
00832 //
00833 //  CBasePropertyPage::OnWizardBack
00834 //
00835 //  Description:
00836 //      Handler for the PSN_WIZBACK message.
00837 //
00838 //  Arguments:
00839 //      None.
00840 //
00841 //  Return Value:
00842 //      -1
00843 //          Don't change the page.
00844 //
00845 //      0
00846 //          Change the page.
00847 //
00848 //--
00849 /////////////////////////////////////////////////////////////////////////////
00850 LRESULT
00851 CBasePropertyPage::OnWizardBack( void )
00852 {
00853     LRESULT lResult = 0L;
00854
00855     ASSERT( BWizard() );
00856
00857     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00858
00859     lResult = CPropertyPage::OnWizardBack();
00860     if ( lResult != -1 )
00861     {
00862         m_bBackPressed = TRUE;
00863     } // if: no error occurred
00864
00865     return lResult;
00866
00867 } //*** CBasePropertyPage::OnWizardBack
00868
00869 /////////////////////////////////////////////////////////////////////////////
00870 //++
00871 //
00872 //  CBasePropertyPage::OnWizardNext
00873 //
00874 //  Description:
00875 //      Handler for the PSN_WIZNEXT message.
00876 //
00877 //  Arguments:
00878 //      None.
00879 //
00880 //  Return Value:
00881 //      -1
00882 //          Don't change the page.
00883 //
00884 //      0
00885 //          Change the page.
00886 //
00887 //--
00888 /////////////////////////////////////////////////////////////////////////////
00889 LRESULT
00890 CBasePropertyPage::OnWizardNext( void )
00891 {
00892     ASSERT( BWizard() );
00893
00894     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00895
00896     CWaitCursor wc;
00897
00898     //
00899     //  Update the data in the class from the page.
00900     //  This necessary because, while OnKillActive() will call UpdateData(),
00901     //  it is called after this method is called, and we need to be sure that
00902     //  data has been saved before we apply them.
00903     //
00904
00905     if ( ! UpdateData( TRUE /*bSaveAndValidate*/ ) )
00906     {
00907         return -1;
00908     } // if: error updating data
00909
00910     //
00911     //  Save the data in the sheet.
00912     //
00913
00914     if ( BApplyChanges() == FALSE )
00915     {
00916         return -1;
00917     } // if: error applying changes
00918
00919     //
00920     //  Create the object.
00921     //
00922
00923     return CPropertyPage::OnWizardNext();
00924
00925 } //*** CBasePropertyPage::OnWizardNext
00926
00927 /////////////////////////////////////////////////////////////////////////////
00928 //++
00929 //
00930 //  CBasePropertyPage::OnWizardFinish
00931 //
00932 //  Description:
00933 //      Handler for the PSN_WIZFINISH message.
00934 //
00935 //  Arguments:
00936 //      None.
00937 //
00938 //  Return Value:
00939 //      FALSE
00940 //          Don't change the page.
00941 //
00942 //      TRUE
00943 //          Change the page.
00944 //
00945 //--
00946 /////////////////////////////////////////////////////////////////////////////
00947 BOOL
00948 CBasePropertyPage::OnWizardFinish( void )
00949 {
00950     ASSERT( BWizard() );
00951
00952     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00953
00954     CWaitCursor wc;
00955
00956     //
00957     //  BUG! There should be no need to call UpdateData in this function.
00958     //  See BUG: Finish Button Fails Data Transfer from Page to Variables
00959     //  KB Article ID: Q150349
00960     //
00961
00962     //
00963     //  Update the data in the class from the page.
00964     //
00965
00966     if ( UpdateData( TRUE /*bSaveAndValidate*/ ) == FALSE )
00967     {
00968         return FALSE;
00969     } // if: error updating data
00970
00971     // Save the data in the sheet.
00972     if ( BApplyChanges() == FALSE )
00973     {
00974         return FALSE;
00975     } // if: error applying changes
00976
00977     return CPropertyPage::OnWizardFinish();
00978
00979 } //*** CBasePropertyPage::OnWizardFinish
00980
00981 /////////////////////////////////////////////////////////////////////////////
00982 //++
00983 //
00984 //  CBasePropertyPage::OnChangeCtrl
00985 //
00986 //  Description:
00987 //      Handler for the messages sent when a control is changed.  This
00988 //      method can be specified in a message map if all that needs to be
00989 //      done is enable the Apply button.
00990 //
00991 //  Arguments:
00992 //      None.
00993 //
00994 //  Return Value:
00995 //      None.
00996 //
00997 //--
00998 /////////////////////////////////////////////////////////////////////////////
00999 void
01000 CBasePropertyPage::OnChangeCtrl( void )
01001 {
01002     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
01003
01004     SetModified( TRUE );
01005
01006 } //*** CBasePropertyPage::OnChangeCtrl
01007
01008 /////////////////////////////////////////////////////////////////////////////
01009 //++
01010 //
01011 //  CBasePropertyPage::EnableNext
01012 //
01013 //  Description:
01014 //      Enables or disables the NEXT or FINISH button.
01015 //
01016 //  Arguments:
01017 //      fEnableIn
01018 //          TRUE = enable the button, FALSE = disable the button.
01019 //
01020 //  Return Value:
01021 //      None.
01022 //
01023 //--
01024 /////////////////////////////////////////////////////////////////////////////
01025 void
01026 CBasePropertyPage::EnableNext(
01027     BOOL fEnableIn      // = TRUE
01028     )
01029 {
01030     ASSERT( BWizard() );
01031     ASSERT( PiWizardCallback() );
01032
01033     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
01034
01035     PiWizardCallback()->EnableNext( reinterpret_cast< LONG * >( Hpage() ), fEnableIn );
01036
01037 } //*** CBasePropertyPage::EnableNext
01038
01039 /////////////////////////////////////////////////////////////////////////////
01040 //++
01041 //
01042 //  CBasePropertyPage::BApplyChanges
01043 //
01044 //  Description:
01045 //      Apply changes made on the page.
01046 //
01047 //  Arguments:
01048 //      None.
01049 //
01050 //  Return Value:
01051 //      TRUE
01052 //          Page successfully applied.
01053 //
01054 //      FALSE
01055 //          Error applying page.
01056 //
01057 //--
01058 /////////////////////////////////////////////////////////////////////////////
01059 BOOL
01060 CBasePropertyPage::BApplyChanges( void )
01061 {
01062     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
01063
01064     CWaitCursor wc;
01065
01066     //
01067     //  Save data.
01068     //
01069
01070     return BSetPrivateProps();
01071
01072 } //*** CBasePropertyPage::BApplyChanges
01073
01074 /////////////////////////////////////////////////////////////////////////////
01075 //++
01076 //
01077 //  CBasePropertyPage::BBuildPropList
01078 //
01079 //  Description:
01080 //      Build the property list.
01081 //
01082 //  Arguments:
01083 //      rcplIn
01084 //          Cluster property list.
01085 //
01086 //      fNoNewPropsIn
01087 //          TRUE = exclude properties marked with opfNew.
01088 //
01089 //  Return Value:
01090 //      TRUE
01091 //          Property list built successfully.
01092 //
01093 //      FALSE
01094 //          Error building property list.
01095 //
01096 //  Exceptions Thrown:
01097 //      Any exceptions thrown by CClusPropList::AddProp().
01098 //
01099 //--
01100 /////////////////////////////////////////////////////////////////////////////
01101 BOOL
01102 CBasePropertyPage::BBuildPropList(
01103       CClusPropList &   rcplIn
01104     , BOOL              fNoNewPropsIn     // = FALSE
01105     )
01106 {
01107     BOOL                    fNewPropsFound = FALSE;
01108     DWORD                   cprop;
01109     const CObjectProperty * pprop;
01110
01111     for ( pprop = Pprops(), cprop = Cprops() ; cprop > 0 ; pprop++, cprop-- )
01112     {
01113         if ( fNoNewPropsIn && (pprop->m_dwFlags & CObjectProperty::opfNew) )
01114         {
01115             fNewPropsFound = TRUE;
01116             continue;
01117         } // if: no new props allowed and this is a new property
01118
01119         switch ( pprop->m_propFormat )
01120         {
01121             case CLUSPROP_FORMAT_SZ:
01122                 rcplIn.ScAddProp(
01123                           pprop->m_pwszName
01124                         , *pprop->m_value.pstr
01125                         , *pprop->m_valuePrev.pstr
01126                         );
01127                 break;
01128
01129             case CLUSPROP_FORMAT_EXPAND_SZ:
01130                 rcplIn.ScAddExpandSzProp(
01131                           pprop->m_pwszName
01132                         , *pprop->m_value.pstr
01133                         , *pprop->m_valuePrev.pstr
01134                         );
01135                 break;
01136
01137             case CLUSPROP_FORMAT_DWORD:
01138                 rcplIn.ScAddProp(
01139                           pprop->m_pwszName
01140                         , *pprop->m_value.pdw
01141                         , *pprop->m_valuePrev.pdw
01142                         );
01143                 break;
01144
01145             case CLUSPROP_FORMAT_LONG:
01146                 rcplIn.ScAddProp(
01147                           pprop->m_pwszName
01148                         , *pprop->m_value.pl
01149                         , *pprop->m_valuePrev.pl
01150                         );
01151                 break;
01152
01153             case CLUSPROP_FORMAT_BINARY:
01154             case CLUSPROP_FORMAT_MULTI_SZ:
01155                 rcplIn.ScAddProp(
01156                           pprop->m_pwszName
01157                         , *pprop->m_value.ppb
01158                         , *pprop->m_value.pcb
01159                         , *pprop->m_valuePrev.ppb
01160                         , *pprop->m_valuePrev.pcb
01161                         );
01162                 break;
01163
01164             default:
01165                 ASSERT( 0 ); // don't know how to deal with this type
01166                 return FALSE;
01167
01168         } // switch: property format
01169     } // for: each property
01170
01171     return ( !( fNoNewPropsIn || fNewPropsFound ) );
01172
01173 } //*** CBasePropertyPage::BBuildPropList
01174
01175 /////////////////////////////////////////////////////////////////////////////
01176 //++
01177 //
01178 //  CBasePropertyPage::BSetPrivateProps
01179 //
01180 //  Description:
01181 //      Set the private properties for this object.
01182 //
01183 //  Arguments:
01184 //      fValidateOnlyIn
01185 //          TRUE = only validate the data.
01186 //
01187 //      fNoNewPropsIn
01188 //          TRUE = exclude properties marked with opfNew.
01189 //
01190 //  Return Value:
01191 //      ERROR_SUCCESS
01192 //          The operation was completed successfully.
01193 //
01194 //      Other Win32 values.
01195 //          Failure.
01196 //
01197 //--
01198 /////////////////////////////////////////////////////////////////////////////
01199 BOOL
01200 CBasePropertyPage::BSetPrivateProps(
01201       BOOL fValidateOnlyIn   // = FALSE
01202     , BOOL fNoNewPropsIn     // = FALSE
01203     )
01204 {
01205     BOOL            fSuccess   = TRUE;
01206     CClusPropList   cpl( BWizard() /*bAlwaysAddProp*/ );
01207
01208     ASSERT( Peo() != NULL );
01209     ASSERT( Peo()->PodObjData() );
01210
01211     //
01212     //  Build the property list.
01213     //
01214
01215     try
01216     {
01217         fSuccess = BBuildPropList( cpl, fNoNewPropsIn );
01218     } // try
01219     catch ( CException * pe )
01220     {
01221         pe->ReportError();
01222         pe->Delete();
01223         fSuccess = FALSE;
01224     } // catch: CException
01225
01226     //
01227     //  Set the data.
01228     //
01229
01230     if ( fSuccess )
01231     {
01232         if ( (cpl.PbPropList() != NULL) && (cpl.CbPropList() > 0) )
01233         {
01234             DWORD       sc = ERROR_SUCCESS;
01235             DWORD       dwControlCode;
01236             DWORD       cbProps;
01237
01238             switch ( Cot() )
01239             {
01240                 case CLUADMEX_OT_NODE:
01241                 {
01242                     CNodeData * pcnd = reinterpret_cast< CNodeData * >( Peo()->PodObjData() );
01243                     ASSERT( pcnd && (pcnd->GetHNode() != NULL) );
01244
01245                     //
01246                     //  Determine which control code to use.
01247                     //
01248
01249                     if ( fValidateOnlyIn )
01250                     {
01251                         dwControlCode = CLUSCTL_NODE_VALIDATE_PRIVATE_PROPERTIES;
01252                     } // if: only validating data
01253                     else
01254                     {
01255                         dwControlCode = CLUSCTL_NODE_SET_PRIVATE_PROPERTIES;
01256                     } // else: setting data
01257
01258                     //
01259                     //  Set private properties.
01260                     //
01261
01262                     sc = ClusterNodeControl(
01263                                       pcnd->GetHNode()
01264                                     , NULL   // hNode
01265                                     , dwControlCode
01266                                     , cpl.PbPropList()
01267                                     , cpl.CbPropList()
01268                                     , NULL   // lpOutBuffer
01269                                     , 0      // nOutBufferSize
01270                                     , &cbProps
01271                                     );
01272                     break;
01273                 } // case:
01274
01275                 case CLUADMEX_OT_GROUP:
01276                 {
01277                     CGroupData * pcgd = reinterpret_cast< CGroupData * >( Peo()->PodObjData() );
01278                     ASSERT( pcgd && (pcgd->GetHGroup() != NULL) );
01279
01280                     //
01281                     //  Determine which control code to use.
01282                     //
01283
01284                     if ( fValidateOnlyIn )
01285                     {
01286                         dwControlCode = CLUSCTL_GROUP_VALIDATE_PRIVATE_PROPERTIES;
01287                     } // if: only validating data
01288                     else
01289                     {
01290                         dwControlCode = CLUSCTL_GROUP_SET_PRIVATE_PROPERTIES;
01291                     } // else: setting data
01292
01293                     //
01294                     //  Set private properties.
01295                     //
01296
01297                     sc = ClusterGroupControl(
01298                                       pcgd->GetHGroup()
01299                                     , NULL   // hNode
01300                                     , dwControlCode
01301                                     , cpl.PbPropList()
01302                                     , cpl.CbPropList()
01303                                     , NULL   // lpOutBuffer
01304                                     , 0      // nOutBufferSize
01305                                     , &cbProps
01306                                     );
01307                     break;
01308                 } // case:
01309
01310                 case CLUADMEX_OT_RESOURCE:
01311                 {
01312                     CResData * pcrd = reinterpret_cast< CResData * >( Peo()->PodObjData() );
01313                     ASSERT( pcrd && (pcrd->GetHResource() != NULL) );
01314
01315                     //
01316                     //  Determine which control code to use.
01317                     //
01318
01319                     if ( fValidateOnlyIn )
01320                     {
01321                         dwControlCode = CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES;
01322                     } // if: only validating data
01323                     else
01324                     {
01325                         dwControlCode = CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES;
01326                     } // else: setting data
01327
01328                     //
01329                     //  Set private properties.
01330                     //
01331
01332                     sc = ClusterResourceControl(
01333                                       pcrd->GetHResource()
01334                                     , NULL   // hNode
01335                                     , dwControlCode
01336                                     , cpl.PbPropList()
01337                                     , cpl.CbPropList()
01338                                     , NULL   // lpOutBuffer
01339                                     , 0      // nOutBufferSize
01340                                     , &cbProps
01341                                     );
01342                     break;
01343                 } // case:
01344
01345                 case CLUADMEX_OT_RESOURCETYPE:
01346                 {
01347                     CResTypeData * pcrd = reinterpret_cast< CResTypeData * >( Peo()->PodObjData() );
01348                     ASSERT( pcrd && (pcrd->StrName().GetLength() > 0) );
01349
01350                     //
01351                     //  Determine which control code to use.
01352                     //
01353
01354                     if ( fValidateOnlyIn )
01355                     {
01356                         dwControlCode = CLUSCTL_RESOURCE_TYPE_VALIDATE_PRIVATE_PROPERTIES;
01357                     } // if: only validating data
01358                     else
01359                     {
01360                         dwControlCode = CLUSCTL_RESOURCE_TYPE_SET_PRIVATE_PROPERTIES;
01361                     } // else: setting data
01362
01363                     //
01364                     //  Set private properties.
01365                     //
01366
01367                     sc = ClusterResourceTypeControl(
01368                                       Hcluster()
01369                                     , pcrd->StrName()
01370                                     , NULL   // hNode
01371                                     , dwControlCode
01372                                     , cpl.PbPropList()
01373                                     , cpl.CbPropList()
01374                                     , NULL   // lpOutBuffer
01375                                     , 0      // nOutBufferSize
01376                                     , &cbProps
01377                                     );
01378                     break;
01379                 } // case:
01380
01381                 case CLUADMEX_OT_NETWORK:
01382                 {
01383                     CNetworkData * pcnd = reinterpret_cast< CNetworkData * >( Peo()->PodObjData() );
01384                     ASSERT( pcnd && (pcnd->GetHNetwork() != NULL) );
01385
01386                     //
01387                     //  Determine which control code to use.
01388                     //
01389
01390                     if ( fValidateOnlyIn )
01391                     {
01392                         dwControlCode = CLUSCTL_NETWORK_VALIDATE_PRIVATE_PROPERTIES;
01393                     } // if: only validating data
01394                     else
01395                     {
01396                         dwControlCode = CLUSCTL_NETWORK_SET_PRIVATE_PROPERTIES;
01397                     } // else: setting data
01398
01399                     //
01400                     //  Set private properties.
01401                     //
01402
01403                     sc = ClusterNetworkControl(
01404                                       pcnd->GetHNetwork()
01405                                     , NULL   // hNode
01406                                     , dwControlCode
01407                                     , cpl.PbPropList()
01408                                     , cpl.CbPropList()
01409                                     , NULL   // lpOutBuffer
01410                                     , 0      // nOutBufferSize
01411                                     , &cbProps
01412                                     );
01413                     break;
01414                 } // case:
01415
01416                 case CLUADMEX_OT_NETINTERFACE:
01417                 {
01418                     CNetInterfaceData * pcnd = reinterpret_cast< CNetInterfaceData * >( Peo()->PodObjData() );
01419                     ASSERT( pcnd && (pcnd->GetHNetInterface() != NULL) );
01420
01421                     //
01422                     //  Determine which control code to use.
01423                     //
01424
01425                     if ( fValidateOnlyIn )
01426                     {
01427                         dwControlCode = CLUSCTL_NETINTERFACE_VALIDATE_PRIVATE_PROPERTIES;
01428                     } // if: only validating data
01429                     else
01430                     {
01431                         dwControlCode = CLUSCTL_NETINTERFACE_SET_PRIVATE_PROPERTIES;
01432                     } // else: setting data
01433
01434                     //
01435                     //  Set private properties.
01436                     //
01437
01438                     sc = ClusterNetInterfaceControl(
01439                                       pcnd->GetHNetInterface()
01440                                     , NULL   // hNode
01441                                     , dwControlCode
01442                                     , cpl.PbPropList()
01443                                     , cpl.CbPropList()
01444                                     , NULL   // lpOutBuffer
01445                                     , 0      // nOutBufferSize
01446                                     , &cbProps
01447                                     );
01448                     break;
01449                 } // case:
01450
01451                 default:
01452                     ASSERT( 0 );
01453
01454             } // switch: object type
01455
01456             //
01457             //  Handle errors.
01458             //
01459
01460             if ( sc != ERROR_SUCCESS )
01461             {
01462                 if ( sc == ERROR_INVALID_PARAMETER )
01463                 {
01464                     if ( ! fNoNewPropsIn )
01465                     {
01466                         fSuccess = BSetPrivateProps( fValidateOnlyIn, TRUE /*fNoNewPropsIn*/ );
01467                     } // if: new props are allowed
01468                     else
01469                         fSuccess = FALSE;
01470                 } // if: invalid parameter error occurred
01471                 else
01472                 {
01473                     fSuccess = FALSE;
01474                 } // else: some other error occurred
01475
01476                 //
01477                 // If an error occurred, display an error message.
01478                 //
01479
01480                 if ( ! fSuccess )
01481                 {
01482                     DisplaySetPropsError( sc, fValidateOnlyIn ? IDS_ERROR_VALIDATING_PROPERTIES : IDS_ERROR_SETTING_PROPERTIES );
01483                     if ( sc == ERROR_RESOURCE_PROPERTIES_STORED )
01484                     {
01485                         fSuccess = TRUE;
01486                     } // if: properties only stored
01487                 } // if: error occurred
01488             } // if: error setting/validating data
01489         } // if: there is data to set
01490     } // if: no errors building the property list
01491
01492     //
01493     //  Save data locally.
01494     //
01495
01496     if ( ! fValidateOnlyIn && fSuccess )
01497     {
01498         //
01499         //  Save new values as previous values.
01500         //
01501
01502         try
01503         {
01504             DWORD                   cprop;
01505             const CObjectProperty * pprop;
01506
01507             for ( pprop = Pprops(), cprop = Cprops() ; cprop > 0 ; pprop++, cprop-- )
01508             {
01509                 switch ( pprop->m_propFormat )
01510                 {
01511                     case CLUSPROP_FORMAT_SZ:
01512                     case CLUSPROP_FORMAT_EXPAND_SZ:
01513                         ASSERT(pprop->m_value.pstr != NULL);
01514                         ASSERT(pprop->m_valuePrev.pstr != NULL);
01515                         *pprop->m_valuePrev.pstr = *pprop->m_value.pstr;
01516                         break;
01517
01518                     case CLUSPROP_FORMAT_DWORD:
01519                     case CLUSPROP_FORMAT_LONG:
01520                         ASSERT( pprop->m_value.pdw != NULL );
01521                         ASSERT( pprop->m_valuePrev.pdw != NULL );
01522                         *pprop->m_valuePrev.pdw = *pprop->m_value.pdw;
01523                         break;
01524
01525                     case CLUSPROP_FORMAT_BINARY:
01526                     case CLUSPROP_FORMAT_MULTI_SZ:
01527                         ASSERT( pprop->m_value.ppb != NULL );
01528                         ASSERT( *pprop->m_value.ppb != NULL );
01529                         ASSERT( pprop->m_value.pcb != NULL );
01530                         ASSERT( pprop->m_valuePrev.ppb != NULL );
01531                         ASSERT( *pprop->m_valuePrev.ppb != NULL );
01532                         ASSERT( pprop->m_valuePrev.pcb != NULL );
01533                         delete [] *pprop->m_valuePrev.ppb;
01534                         *pprop->m_valuePrev.ppb = new BYTE[ *pprop->m_value.pcb ];
01535                         CopyMemory( *pprop->m_valuePrev.ppb, *pprop->m_value.ppb, *pprop->m_value.pcb );
01536                         *pprop->m_valuePrev.pcb = *pprop->m_value.pcb;
01537                         break;
01538
01539                     default:
01540                         ASSERT( 0 ); // don't know how to deal with this type
01541
01542                 } // switch: property format
01543             } // for: each property
01544         } // try
01545         catch ( CException * pe )
01546         {
01547             pe->ReportError();
01548             pe->Delete();
01549             fSuccess = FALSE;
01550         } // catch: CException
01551     } // if: not just validating and successful so far
01552
01553     //
01554     // Indicate we successfully saved the properties.
01555     //
01556
01557     if ( ! fValidateOnlyIn && fSuccess )
01558     {
01559         m_bSaved = TRUE;
01560     } // if: successfully saved data
01561
01562     return fSuccess;
01563
01564 } //*** CBasePropertyPage::BSetPrivateProps
01565
01566 /////////////////////////////////////////////////////////////////////////////
01567 //++
01568 //
01569 //  CBasePropertyPage::DisplaySetPropsError
01570 //
01571 //  Routine Description:
01572 //      Display an error caused by setting or validating properties.
01573 //
01574 //  Arguments:
01575 //      scIn
01576 //          Status to display error on.
01577 //
01578 //      idsOperIn
01579 //          Operation message.
01580 //
01581 //  Return Value:
01582 //      None.
01583 //
01584 //--
01585 /////////////////////////////////////////////////////////////////////////////
01586 void
01587 CBasePropertyPage::DisplaySetPropsError(
01588       DWORD    scIn
01589     , UINT     idsOperIn
01590     ) const
01591 {
01592     CString strErrorMsg;
01593     CString strOperMsg;
01594     CString strMsgIdFmt;
01595     CString strMsgId;
01596     CString strMsg;
01597
01598     UNREFERENCED_PARAMETER( idsOperIn );
01599
01600     strOperMsg.LoadString( IDS_ERROR_SETTING_PROPERTIES );
01601     FormatError( strErrorMsg, scIn );
01602     strMsgIdFmt.LoadString( IDS_ERROR_MSG_ID );
01603     strMsgId.Format( strMsgIdFmt, scIn, scIn );
01604     strMsg.Format( _T("%s\n\n%s%s"), strOperMsg, strErrorMsg, strMsgId );
01605     AfxMessageBox( strMsg );
01606
01607 }  //*** CBasePropertyPage::DisplaySetPropsError
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCOrder/processFlags.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCOrder

processFlags.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      processFlags.h
00003   Summary:   Declaration of flags for Process() method
00004
00005   Origin:    Implementation of case study in Queued Components specification
00006 ----------------------------------------------------------------------------
00007   Copyright 1992 - 2000 Microsoft Corporation, All rights reserved.
00008
00009     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012     PARTICULAR PURPOSE
00013 ==========================================================================+*/
00014
00015 #ifndef __PROCESSFLAGS_H_
00016 #define __PROCESSFLAGS_H_
00017
00018 // Constants for Process() lFlag
00019
00020 const long processFlagWriteDB = 1;      // Write to order and ship tables
00021 const long processFlagLateBound = 2;    // Latebound (IDispatch) invocation
00022 const long processFlagQueuedComponents = 4; // invoke Ship & Notify Queued Components
00023
00024 #endif  //__PROCESSFLAGS_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/MyDevice_i.c Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

MyDevice_i.c

Go to the documentation of this file.
00001 /* this file contains the actual definitions of */
00002 /* the IIDs and CLSIDs */
00003
00004 /* link this file in with the server and any clients */
00005
00006
00007 /* File created by MIDL compiler version 5.01.0164 */
00008 /* at Fri Apr 12 22:33:43 2002
00009  */
00010 /* Compiler settings for C:\UPnPSample\SDKDimmer\DimmerDevice\StepByStep\Step3\MyDevice.idl:
00011     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00012     error checks: allocation ref bounds_check enum stub_data
00013 */
00014 //@@MIDL_FILE_HEADING(  )
00015 #ifdef __cplusplus
00016 extern "C"{
00017 #endif
00018
00019
00020 #ifndef __IID_DEFINED__
00021 #define __IID_DEFINED__
00022
00023 typedef struct _IID
00024 {
00025     unsigned long x;
00026     unsigned short s1;
00027     unsigned short s2;
00028     unsigned char  c[8];
00029 } IID;
00030
00031 #endif // __IID_DEFINED__
00032
00033 #ifndef CLSID_DEFINED
00034 #define CLSID_DEFINED
00035 typedef IID CLSID;
00036 #endif // CLSID_DEFINED
00037
00038 const IID LIBID_MYDEVICELib = {0x51AC2F4C,0x3F4F,0x48B3,{0xA0,0x18,0x91,0x0E,0x81,0x67,0x7E,0xEF}};
00039
00040
00041 const IID IID_IUPnPService_DimmingService_SCPD = {0xa315fcbd,0x7f4b,0x4081,{0xa1,0x72,0x2f,0x53,0x4c,0x43,0x89,0x57}};
00042
00043
00044 const CLSID CLSID_Dimmer = {0xd31b8f49,0x367e,0x41b7,{0x8f,0xc4,0x50,0xe2,0x3d,0x36,0x62,0x5d}};
00045
00046
00047 #ifdef __cplusplus
00048 }
00049 #endif
00050
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_PROPSHEETCFG Member List

This is the complete list of members for _PROPSHEETCFG, including all inherited members.
hwndHidden | _PROPSHEETCFG
hwndParentSheet | _PROPSHEETCFG
lNotifyHandle | _PROPSHEETCFG
wParamSheetClose | _PROPSHEETCFG
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSession Member List

This is the complete list of members for CSession, including all inherited members.
Abort(HCHAPTER hChapter, DBASYNCHOP eOperation) | CAsynchBase | [virtual]
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CSession | [virtual]
AutoRelease() | CSession | [virtual]
CAsynchBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CAsynchBase |
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CreateCommand(CAggregate *pCAggregate, REFIID riid, IUnknown **ppIUnknown) | CSession | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CSession(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CSession |
DisplayObject() | CBase | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
GetBaseType() | CBase | [inline]
GetDataSource(REFIID riid, IUnknown **ppIUnknown) | CSession | [virtual]
GetDefaultInterface() | CSession | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CSession | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CSession | [inline, virtual]
GetObjectMenu() | CSession | [inline, virtual]
GetObjectName() | CSession | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
GetProviderTypes() | CSession | [virtual]
GetSchemaRowset(CAggregate *pCAggregate, REFGUID guidSchema, ULONG cRestrictions, VARIANT *rgRestrictions, REFIID riid, ULONG cPropSets, DBPROPSET *rgPropSets, IUnknown **ppIUnknown) | CSession | [virtual]
GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase, LPOLESTR *ppwszStatusText) | CAsynchBase | [virtual]
Initialize() | CAsynchBase | [virtual]
IsInitialized() | CAsynchBase | [inline, virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cProvTypes | CSession |
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_dwCookieAsynchNotify | CAsynchBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_fInitialized | CAsynchBase |
m_guidSource | CBase |
m_hTreeItem | CBase |
m_listCPropSets | CSession |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIAlterIndex | CSession |
m_pIAlterTable | CSession |
m_pIBindResource | CSession |
m_pIConnectionPointContainer | CContainerBase |
m_pICreateRow | CSession |
m_pIDBAsynchStatus | CAsynchBase |
m_pIDBCreateCommand | CSession |
m_pIDBInitialize | CAsynchBase |
m_pIDBSchemaRowset | CSession |
m_pIGetDataSource | CSession |
m_pIIndexDefinition | CSession |
m_pIOpenRowset | CSession |
m_pIService | CBase |
m_pISessionProperties | CSession |
m_pISupportErrorInfo | CBase |
m_pITableDefinition | CSession |
m_pITableDefinitionWithConstraints | CSession |
m_pITransaction | CSession |
m_pITransactionJoin | CSession |
m_pITransactionLocal | CSession |
m_pITransactionObject | CSession |
m_pIUnknown | CBase |
m_rgProvTypes | CSession |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
OpenRowset(CAggregate *pCAggregate, DBID *pTableID, DBID *pIndexID, REFIID riid, ULONG cPropSets, DBPROPSET *rgPropSets, IUnknown **ppIUnknown) | CSession | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
Uninitialize() | CAsynchBase | [virtual]
~CAsynchBase() | CAsynchBase | [virtual]
~CBase() | CBase | [virtual]
~CContainerBase() | CContainerBase | [virtual]
~CSession() | CSession | [virtual]
Generated on Wed Nov 13 2024 16:57:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm Member List

This is the complete list of members for Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm, including all inherited members.
components | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
Dispose(bool disposing) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, protected]
DivideInk() | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
DrawArea | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
DrawArea_Paint(object sender, System.Windows.Forms.PaintEventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
GetUnitBBoxes(DivisionResult divResult, InkDivisionType divType, int inflate) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
InitializeComponent() | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
InkDividerForm() | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline]
InkDividerForm_Load(object sender, System.EventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
Main() | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private, static]
mainMenu | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miAutomaticLayoutAnalysis | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miAutomaticLayoutAnalysis_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
miDivide | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miDivide_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
miErase | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miErase_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
miExit | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miExit_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
miFile | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miInk | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miInk_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
miMode | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
miSeparate | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
myDrawingBoundingBoxes | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
myInkDivider | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
myInkOverlay | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
myInkOverlay_Stroke(object sender, InkCollectorStrokeEventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
myInkOverlay_StrokeDeleted(object sender, System.EventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
myInkOverlay_StrokeDeleting(object sender, InkOverlayStrokesDeletingEventArgs e) | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [inline, private]
myLineBoundingBoxes | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
myParagraphBoundingBoxes | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
myWordBoundingBoxes | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
statusBar | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
statusBarPanelDrawing | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
statusBarPanelDummy | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
statusBarPanelLine | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
statusBarPanelParagraph | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
statusBarPanelWord | Microsoft::Samples::Ink::CS::InkDividerSample::InkDividerForm | [private]
Generated on Wed Nov 13 2024 16:58:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapirecv/Processing.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapirecv

Processing.h

Go to the documentation of this file.
00001 /*
00002
00003 Copyright (c) 1999 - 2000  Microsoft Corporation
00004
00005
00006 Module Name:
00007
00008     Processing.h
00009
00010
00011 Abstract:
00012
00013     Declaration of the CTAPIEventNotification object
00014
00015 */
00016
00017
00018 #ifndef __TAPIEventNotification_H__
00019 #define __TAPIEventNotification_H__
00020
00021
00022 //
00023 // declaration of implementation of the interface that is registered
00024 // with TAPI to receive notification messages
00025 //
00026
00027 class CTAPIEventNotification : public ITTAPIEventNotification
00028 {
00029
00030 private:
00031
00032     //
00033     // reference counting
00034     //
00035
00036     LONG       m_dwRefCount;
00037
00038 public:
00039
00040
00041     //
00042     // ITTAPIEventNotification
00043     //
00044
00045     //
00046     // the method called by TAPI when there is an event
00047     //
00048
00049     HRESULT STDMETHODCALLTYPE Event(IN TAPI_EVENT TapiEvent,
00050                                     IN IDispatch *pEvent);
00051
00052
00053     //
00054     // IUnknown
00055     //
00056
00057     HRESULT STDMETHODCALLTYPE QueryInterface(IN REFIID iid,
00058                                              OUT void **ppvObject)
00059     {
00060         if (iid == IID_ITTAPIEventNotification)
00061         {
00062             AddRef();
00063             *ppvObject = (void *)this;
00064             return S_OK;
00065         }
00066
00067         if (iid == IID_IUnknown)
00068         {
00069             AddRef();
00070             *ppvObject = (void *)this;
00071             return S_OK;
00072         }
00073
00074         return E_NOINTERFACE;
00075     }
00076
00077
00078     //
00079     // reference counting needs to be thread safe
00080     //
00081
00082     ULONG STDMETHODCALLTYPE AddRef()
00083     {
00084         ULONG l = InterlockedIncrement(&m_dwRefCount);
00085
00086         return l;
00087     }
00088
00089   ULONG STDMETHODCALLTYPE Release()
00090     {
00091         ULONG l = InterlockedDecrement(&m_dwRefCount);
00092
00093         if ( 0 == l)
00094         {
00095             delete this;
00096         }
00097
00098         return l;
00099     }
00100
00101
00102
00103 public:
00104
00105
00106     CTAPIEventNotification()
00107     {
00108
00109         //
00110         // freshly created object has an outstanding reference count
00111         //
00112
00113         m_dwRefCount = 1;
00114     }
00115
00116
00117
00118     //
00119     // the object should only be destroyed from Release().
00120     // destructor is private to enforce this.
00121     //
00122
00123 private:
00124
00125     ~CTAPIEventNotification()
00126     {
00127
00128         //
00129         // reference count here must be 0, otherwise we have a bug in the app
00130         //
00131
00132         _ASSERTE(m_dwRefCount == 0);
00133     }
00134
00135 };
00136
00137 #endif //__TAPIEventNotification_H__
00138
00139
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBinder Member List

This is the complete list of members for CBinder, including all inherited members.
AutoQI(DWORD dwCreateOpts) | CBinder | [virtual]
AutoRelease() | CBinder | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CBaseObj(EBaseObjectType botVal) | CBaseObj | [protected]
CBinder(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBinder |
CBinder(LPUNKNOWN) | CBinder |
CImpIBindResource class | CBinder | [friend]
CImpICreateRow class | CBinder | [friend]
CImpIDBBinderProperties class | CBinder | [friend]
CreateBinder(REFCLSID clsidProv) | CBinder | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
FInit() | CBinder |
GetBaseObjectType() | CBaseObj | [inline]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CBinder | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CBinder | [virtual]
GetObjectDesc() | CBinder | [virtual]
GetObjectImage() | CBinder | [inline, virtual]
GetObjectMenu() | CBinder | [inline, virtual]
GetObjectName() | CBinder | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetOuterUnknown() | CBaseObj | [inline]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBinder | [protected]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIBindResource | CBinder |
m_pIBindResource | CBinder | [protected]
m_pICreateRow | CBinder |
m_pICreateRow | CBinder | [protected]
m_pIDBBinderProperties | CBinder |
m_pIDBBinderProperties | CBinder | [protected]
m_pIDBProperties | CBinder |
m_pIRegisterProvider | CBinder |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_pUnkOuter | CBaseObj | [protected]
m_pUtilProp | CBinder | [protected]
m_pwszURL | CBinder |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBinder | [virtual]
QueryInterface(REFIID, LPVOID *) | CBinder |
CBase::QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
SetProperties(ULONG cPropSets, DBPROPSET *rgPropSets) | CBinder | [virtual]
STDMETHODIMP_(DBREFCOUNT) AddRef(void) | CBinder |
STDMETHODIMP_(DBREFCOUNT) Release(void) | CBinder |
CBase::STDMETHODIMP_(ULONG) AddRef() | CBase |
~CBase() | CBase | [virtual]
~CBaseObj() | CBaseObj | [virtual]
~CBinder() | CBinder | [virtual]
~CBinder(void) | CBinder | [virtual]
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLListImpl< TYPE, ARG_TYPE >::CNode Member List

This is the complete list of members for CLListImpl< TYPE, ARG_TYPE >::CNode, including all inherited members.
data | CLListImpl< TYPE, ARG_TYPE >::CNode
pNext | CLListImpl< TYPE, ARG_TYPE >::CNode
pPrev | CLListImpl< TYPE, ARG_TYPE >::CNode
Generated on Wed Nov 13 2024 16:56:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MyOSPObject Member List

This is the complete list of members for MyOSPObject, including all inherited members.
addOLEDBSimpleProviderListener(OLEDBSimpleProviderListener *pospIListener) | MyOSPObject | [virtual]
addOLEDBSimpleProviderListener(OLEDBSimpleProviderListener rListener) | MyOSPObject | [inline]
compareString(String s1, String s2, boolean fCaseSensitive, int findFlags) | MyOSPObject | [inline]
deleteRows(LONG iRow, LONG cRows, LONG *pcRowsDeleted) | MyOSPObject | [virtual]
deleteRows(int iRow, int cRows) | MyOSPObject | [inline]
find(LONG iRowStart, LONG iColumn, VARIANT val, OSPFIND findFlags, OSPCOMP compType, LONG *piRowFound) | MyOSPObject | [virtual]
find(int iRowStart, int iColumn, Object obj, int findFlags, int compType) | MyOSPObject | [inline]
getColumnCount(LONG *pcColumns) | MyOSPObject | [virtual]
getColumnCount() | MyOSPObject | [inline]
getEstimatedRows(LONG *piRows) | MyOSPObject | [virtual]
getEstimatedRows() | MyOSPObject | [inline]
getLocale(BSTR *pbstrLocale) | MyOSPObject | [virtual]
getLocale() | MyOSPObject | [inline]
getRowCount(LONG *pcRows) | MyOSPObject | [virtual]
getRowCount() | MyOSPObject | [inline]
getRWStatus(LONG iRow, LONG iColumn, OSPRW *prwStatus) | MyOSPObject | [virtual]
getRWStatus(int iRow, int iColumn) | MyOSPObject | [inline]
getVariant(LONG iRow, LONG iColumn, OSPFORMAT format, VARIANT *pVar) | MyOSPObject | [virtual]
getVariant(int iRow, int iColumn, int format) | MyOSPObject | [inline]
Init(WCHAR *pwszFilePath) | MyOSPObject | [virtual]
insertRows(LONG iRow, LONG cRows, LONG *pcRowsInserted) | MyOSPObject | [virtual]
insertRows(int iRow, int cRows) | MyOSPObject | [inline]
isAsync(BOOL *pbAsynch) | MyOSPObject | [virtual]
isAsync() | MyOSPObject | [inline]
loadData() | MyOSPObject | [virtual]
loadData() | MyOSPObject | [inline]
m_cColumns | MyOSPObject | [protected]
m_cColumns | MyOSPObject | [package]
m_cRef | MyOSPObject | [protected]
m_cRows | MyOSPObject | [protected]
m_cRows | MyOSPObject | [package]
m_listListeners | MyOSPObject | [protected]
m_rsTable | MyOSPObject | [package]
m_rvTable | MyOSPObject | [protected]
m_sFilePath | MyOSPObject | [package]
m_szFilePath | MyOSPObject | [protected]
m_vListeners | MyOSPObject | [package]
main(String args[]) | MyOSPObject | [inline, static]
MyOSPObject() | MyOSPObject |
MyOSPObject() | MyOSPObject | [inline]
Notify(EOSPEVENTS eEvent, ULONG iRow, ULONG iColumn, ULONG cRows) | MyOSPObject | [virtual]
QueryInterface(REFIID riid, void **ppv) | MyOSPObject | [virtual]
removeOLEDBSimpleProviderListener(OLEDBSimpleProviderListener *pospIListener) | MyOSPObject | [virtual]
removeOLEDBSimpleProviderListener(OLEDBSimpleProviderListener rListener) | MyOSPObject | [inline]
saveData() | MyOSPObject | [private]
saveData() | MyOSPObject | [inline]
setFile(String sFilePath) | MyOSPObject | [inline]
setVariant(LONG iRow, LONG iColumn, OSPFORMAT format, VARIANT Var) | MyOSPObject | [virtual]
setVariant(int iRow, int iColumn, int format, Object obj) | MyOSPObject | [inline]
STDMETHODIMP_(ULONG) AddRef() | MyOSPObject | [inline, virtual]
STDMETHODIMP_(ULONG) Release() | MyOSPObject | [inline, virtual]
stopTransfer() | MyOSPObject | [virtual]
stopTransfer() | MyOSPObject | [inline]
~MyOSPObject() | MyOSPObject | [virtual]
Generated on Wed Nov 13 2024 16:57:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/UIUTILS.c Source File

  • Multimedia
  • Audio
  • MidiPlyr

UIUTILS.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 * UiUtils.C
00013 *
00014 * UI utility routines
00015 *
00016 *****************************************************************************/
00017
00018 #pragma warning(disable:4756)
00019
00020 #define _INC_SHELLAPI
00021 #include <windows.h>
00022 #undef _INC_SHELLAPI
00023
00024 #include <shellapi.h>
00025 #include <windowsx.h>
00026 #include <mmsystem.h>
00027 #include <commdlg.h>
00028 #include <commctrl.h>
00029 #include <ctype.h>
00030
00031 #include "debug.h"
00032
00033 #include "MIDIPlyr.H"
00034
00035 static char BCODE           gszErrFmt[]             = "%s:\n%s";
00036 static char BCODE           gszFace[]               = "arial";
00037 static char                 gszErrDescTxt[256];
00038 static char                 gszErrCodeTxt[256];
00039 static char                 gszErrStr[512];
00040
00041 /*****************************************************************************
00042 *
00043 * Error
00044 *
00045 * Puts up a general error dialog
00046 *
00047 * hWnd                      - Handle of the owner window
00048 * nErrDesc                  - id into the string table of the message
00049 * mmrc                      - Return code from MMSYSTEM or lower layer
00050 *                             which caused the error.
00051 *
00052 * Just formats and puts up an error dialog.
00053 *
00054 * For convenience, all of the sequencer functions return MMSYSERR_ or
00055 * MCIERR_ codes, so we can use mciGetErrorString instead of inventing
00056 * our own error messages again.
00057 *
00058 *****************************************************************************/
00059 VOID FNLOCAL Error(
00060     HWND                    hWnd,
00061     int                     nErrDesc,
00062     MMRESULT                mmrc)
00063 {
00064     LoadString(ghInst, nErrDesc, gszErrDescTxt, sizeof(gszErrDescTxt));
00065     mciGetErrorString(mmrc, gszErrCodeTxt, sizeof(gszErrCodeTxt));
00066
00067     wsprintf(gszErrStr, gszErrFmt, (LPSTR)gszErrDescTxt, (LPSTR)gszErrCodeTxt);
00068     MessageBox(hWnd, gszErrStr, gszAppLongName, MB_ICONEXCLAMATION|MB_OK);
00069 }
00070
00071 /*****************************************************************************
00072 *
00073 * MessagePump
00074 *
00075 * Process messages
00076 *
00077 * This function is called when, in certain cases, we need to wait for a
00078 * window callback to complete. Since callbacks are posted, not sent, we
00079 * need to process messages while waiting.
00080 *
00081 * Note that some documentation refers to this operation as a 'directed
00082 * yield' if messages are being processed for a particular window. This
00083 * is misleading; Yield() merely allows other tasks in the system to run
00084 * and does absolutely nothing to the message queue.
00085 *
00086 *****************************************************************************/
00087 VOID NEAR PASCAL MessagePump(
00088     VOID)
00089 {
00090     MSG                     msg;
00091
00092     while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
00093     {
00094         TranslateMessage(&msg);
00095         DispatchMessage(&msg);
00096     }
00097 }
00098
00099 /*****************************************************************************
00100 *
00101 * EmbossedTextOut
00102 *
00103 * Draw embossed text in the given device context
00104 *
00105 * hDC                       - hDC to draw in
00106 * x, y                      - Upper left corner of text
00107 * lpsz                      - Pointer to the text
00108 * cb                        - Length of text
00109 * crText                    - Color for text face
00110 * crShadow                  - Color for text shadow
00111 * cx, cy                    - Offset for shadow
00112 *
00113 * The text will be drawn with the currently selected font.
00114 *
00115 * If cb == -1, the lstrlen(lpsz) will be used.
00116 *
00117 * If crText == -1, COLOR_BTNTEXT will be used.
00118 *
00119 * If crShadow == -1, COLOR_BTNSHADOW will be used.
00120 *
00121 *****************************************************************************/
00122 VOID NEAR PASCAL EmbossedTextOut(
00123     HDC                     hDC,
00124     int                     x,
00125     int                     y,
00126     LPSTR                   lpsz,
00127     UINT                    cb,
00128     COLORREF                crText,
00129     COLORREF                crShadow,
00130     int                     cx,
00131     int                     cy)
00132 {
00133     COLORREF                crOld;
00134     UINT                    uMode;
00135     SIZE                    sizeText;
00136     RECT                    rcText;
00137
00138     /* If text length is -1, use lstrlen to get the length
00139     ** of the text.
00140     */
00141     if (cb == -1)
00142         cb = lstrlen(lpsz);
00143
00144     /* If the shadow or text color is -1, use the
00145     ** system color for that one.
00146     */
00147     if (crShadow == (COLORREF)-1)
00148         crShadow = GetSysColor (COLOR_BTNSHADOW);
00149     if (crText == (COLORREF)-1)
00150         crText = GetSysColor (COLOR_BTNTEXT);
00151
00152     /* setup the DC, saving off the old values
00153     */
00154     uMode = SetBkMode(hDC, OPAQUE);
00155     crOld = SetTextColor(hDC, crShadow);
00156
00157     /* Draw the text at the desired offset using the
00158     ** shadow color, then again at the normal position
00159     ** using the text color.  This will the text an 'Embossed'
00160     ** or 'drop shadowed' look depending on what shadow color
00161     ** and offset are used.
00162     */
00163     GetTextExtentPoint32(hDC, lpsz, cb, &sizeText);
00164     rcText.left   = x;    rcText.right  = x+cx+sizeText.cx;
00165     rcText.top    = y;    rcText.bottom = y+cy+sizeText.cy;
00166     ExtTextOut(hDC, x+cx, y+cy, ETO_OPAQUE, &rcText, lpsz, cb, NULL);
00167     SetBkMode(hDC, TRANSPARENT);
00168     SetTextColor(hDC, crText);
00169     ExtTextOut(hDC, x, y, 0, NULL, lpsz, cb, NULL);
00170
00171     /* restore the DC
00172     */
00173     SetTextColor(hDC, crOld);
00174     SetBkMode(hDC, uMode);
00175 }
00176
00177 /*****************************************************************************
00178 *
00179 * CreateScaledFont
00180 *
00181 * Create a font scaled so that the given string will fit in the given
00182 * rect, but be as large as possible while maintaining correct aspect ratio.
00183 *
00184 * hDC                       - DC to calculate font for
00185 * lpRect                    - Rectangle to fit text into
00186 * lpszFormat                - Format string to fit into rect
00187 * anPosX[]                  - Will contain the X coordinates for each char
00188 * anPosY                    - Will contain the Y coordinate for the string
00189 *
00190 * Returns HFONT or NULL if one could not be created
00191 *
00192 *****************************************************************************/
00193 HFONT NEAR PASCAL CreateScaledFont(
00194     HDC                     hDC,
00195     LPRECT                  lpRect,
00196     LPSTR                   lpszFormat,
00197     int                     anPosX[],
00198     int*                    nPosY)
00199 {
00200     LOGFONT                 lf;
00201     HFONT                   hFont;
00202     HFONT                   h;
00203     LONG                    FormatWidth;
00204     LONG                    ScaledClientWidth;
00205     LONG                    ScaledClientHeight;
00206     LONG                    AspectN;
00207     LONG                    AspectD;
00208     int                     nPosX;
00209     UINT                    cb;
00210     UINT                    ii;
00211     UINT                    jj;
00212     SIZE                    size;
00213
00214     ScaledClientHeight =  ((lpRect->bottom - lpRect->top)) * 3 / 4;
00215     ScaledClientWidth  =  ((lpRect->right  - lpRect->left)) * 3 / 4;
00216
00217     _fmemset(&lf, 0, sizeof(lf));
00218     lf.lfHeight         = -(int)ScaledClientHeight;
00219     lf.lfWeight         = FW_BOLD;
00220     lf.lfCharSet        = ANSI_CHARSET;
00221     lf.lfClipPrecision  = CLIP_DEFAULT_PRECIS;
00222     lf.lfQuality        = PROOF_QUALITY;
00223     lf.lfPitchAndFamily = FF_ROMAN|DEFAULT_PITCH;
00224     lstrcpyn(lf.lfFaceName, gszFace, sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]));
00225
00226     hFont = CreateFontIndirect(&lf);
00227     h = SelectObject(hDC, hFont);
00228
00229     cb = lstrlen(lpszFormat);
00230     GetTextExtentPoint(hDC, lpszFormat, cb, &size);
00231
00232     AspectN = (LONG)size.cx;
00233     AspectD = (LONG)size.cy;
00234
00235     FormatWidth = (ScaledClientHeight*AspectN)/AspectD;
00236
00237     if (FormatWidth > ScaledClientWidth)
00238     {
00239         ScaledClientHeight =
00240             (ScaledClientWidth*AspectD)/AspectN;
00241       SelectObject(hDC, h);
00242         DeleteObject(hFont);
00243
00244         lf.lfHeight = -(int)ScaledClientHeight;
00245
00246         hFont = CreateFontIndirect(&lf);
00247
00248         SelectObject(hDC, hFont);
00249         GetTextExtentPoint(hDC, lpszFormat, cb, &size);
00250     }
00251
00252     *nPosY  = grcTWnd.top  + (grcTWnd.bottom- grcTWnd.top  - size.cy)/2;
00253     nPosX   = grcTWnd.left + (grcTWnd.right - grcTWnd.left - size.cx)/2;
00254
00255     ii = 0;
00256     for (jj=0; jj < cb; jj++)
00257     {
00258         if (jj != 0)
00259             GetTextExtentPoint(hDC, lpszFormat, jj, &size);
00260         else
00261             size.cx = 0;
00262
00263         anPosX[ii++] = nPosX + size.cx;
00264     }
00265
00266     SelectObject(hDC, h);
00267
00268     return hFont;
00269 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/TestDoc.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

TestDoc.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // testDoc.cpp : implementation of the CTestDoc class
00013 //
00014
00015
00016
00017 #include "stdafx.h"
00018 #include "MQApitst.h"
00019
00020 #include "testDoc.h"
00021
00022 #ifdef _DEBUG
00023 #define new DEBUG_NEW
00024 #undef THIS_FILE
00025 static char THIS_FILE[] = __FILE__;
00026 #endif
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CTestDoc
00030
00031 IMPLEMENT_DYNCREATE(CTestDoc, CDocument)
00032
00033 BEGIN_MESSAGE_MAP(CTestDoc, CDocument)
00034   //{{AFX_MSG_MAP(CTestDoc)
00035     // NOTE - the ClassWizard will add and remove mapping macros here.
00036     //    DO NOT EDIT what you see in these blocks of generated code!
00037   //}}AFX_MSG_MAP
00038 END_MESSAGE_MAP()
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // CTestDoc construction/destruction
00042
00043 CTestDoc::CTestDoc()
00044 {
00045   // TODO: add one-time construction code here
00046
00047 }
00048
00049 CTestDoc::~CTestDoc()
00050 {
00051 }
00052
00053 BOOL CTestDoc::OnNewDocument()
00054 {
00055   if (!CDocument::OnNewDocument())
00056     return FALSE;
00057
00058   ((CEditView*)m_viewList.GetHead())->SetWindowText(NULL);
00059
00060   // TODO: add reinitialization code here
00061   // (SDI documents will reuse this document)
00062
00063   return TRUE;
00064 }
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067 // CTestDoc serialization
00068
00069 void CTestDoc::Serialize(CArchive& ar)
00070 {
00071   // CEditView contains an edit control which handles all serialization
00072   ((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);
00073 }
00074
00075 /////////////////////////////////////////////////////////////////////////////
00076 // CTestDoc diagnostics
00077
00078 #ifdef _DEBUG
00079 void CTestDoc::AssertValid() const
00080 {
00081   CDocument::AssertValid();
00082 }
00083
00084 void CTestDoc::Dump(CDumpContext& dc) const
00085 {
00086   CDocument::Dump(dc);
00087 }
00088 #endif //_DEBUG
00089
00090 /////////////////////////////////////////////////////////////////////////////
00091 // CTestDoc commands
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagPOPUPMENUMAP Member List

This is the complete list of members for tagPOPUPMENUMAP, including all inherited members.
hMenu | tagPOPUPMENUMAP
uID | tagPOPUPMENUMAP
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/PerfUtil.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen

PerfUtil.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1995 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     perfutil.c
00008
00009 Abstract:
00010
00011     This file implements the utility routines used to construct the
00012     common parts of a PERF_INSTANCE_DEFINITION (see winperf.h) and
00013     perform event logging functions.
00014
00015 Created:
00016
00017     Bob Watson  28-Jul-1995
00018
00019 Revision History:
00020
00021 --*/
00022 //
00023 //  include files
00024 //
00025 #include <windows.h>
00026 #include <string.h>
00027 #include <winperf.h>
00028 #include "genctrs.h"     // error message definition
00029 #include "perfmsg.h"
00030 #include "perfutil.h"
00031
00032 //
00033 // Global data definitions.
00034 //
00035
00036 ULONG ulInfoBufferSize = 0;
00037
00038 HANDLE hEventLog = NULL;      // event log handle for reporting events
00039                               // initialized in Open... routines
00040 DWORD  dwLogUsers = 0;        // count of functions using event log
00041
00042 DWORD MESSAGE_LEVEL = 0;
00043
00044 WCHAR GLOBAL_STRING[] = L"Global";
00045 WCHAR FOREIGN_STRING[] = L"Foreign";
00046 WCHAR COSTLY_STRING[] = L"Costly";
00047
00048 WCHAR NULL_STRING[] = L"\0";    // pointer to null string
00049
00050 // test for delimiter, end of line and non-digit characters
00051 // used by IsNumberInUnicodeList routine
00052 //
00053 #define DIGIT       1
00054 #define DELIMITER   2
00055 #define INVALID     3
00056
00057 #define EvalThisChar(c,d) ( \
00058      (c == d) ? DELIMITER : \
00059      (c == 0) ? DELIMITER : \
00060      (c < (WCHAR)'0') ? INVALID : \
00061      (c > (WCHAR)'9') ? INVALID : \
00062      DIGIT)
00063
00064 HANDLE
00065 MonOpenEventLog(
00066 )
00067 /*++
00068
00069 Routine Description:
00070
00071     Reads the level of event logging from the registry and opens the
00072         channel to the event logger for subsequent event log entries.
00073
00074 Arguments:
00075
00076       None
00077
00078 Return Value:
00079
00080     Handle to the event log for reporting events.
00081     NULL if open not successful.
00082
00083 --*/
00084 {
00085     HKEY hAppKey;
00086     TCHAR LogLevelKeyName[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib";
00087     TCHAR LogLevelValueName[] = "EventLogLevel";
00088
00089     LONG lStatus;
00090
00091     DWORD dwLogLevel;
00092     DWORD dwValueType;
00093     DWORD dwValueSize;
00094
00095     // if global value of the logging level not initialized or is disabled,
00096     //  check the registry to see if it should be updated.
00097
00098     if (!MESSAGE_LEVEL) {
00099        lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00100                               LogLevelKeyName,
00101                               0,
00102                               KEY_READ,
00103                               & hAppKey);
00104        if (lStatus == ERROR_SUCCESS) {
00105             dwValueSize = sizeof(dwLogLevel);
00106             lStatus     = RegQueryValueEx(hAppKey,
00107                                           LogLevelValueName,
00108                                           (LPDWORD) NULL,
00109                                           & dwValueType,
00110                                           (LPBYTE) & dwLogLevel,
00111                                           & dwValueSize);
00112             if (lStatus == ERROR_SUCCESS) {
00113                MESSAGE_LEVEL = dwLogLevel;
00114             } else {
00115                MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
00116             }
00117             RegCloseKey(hAppKey);
00118        } else {
00119          MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
00120        }
00121     }
00122
00123     if (hEventLog == NULL){
00124          hEventLog = RegisterEventSource(
00125                          (LPTSTR) NULL,            // Use Local Machine
00126                          APP_NAME);                // event log app name to find in registry
00127          if (hEventLog != NULL) {
00128             REPORT_INFORMATION (UTIL_LOG_OPEN, LOG_DEBUG);
00129          }
00130     }
00131
00132     if (hEventLog != NULL) {
00133          dwLogUsers++;           // increment count of perfctr log users
00134     }
00135     return (hEventLog);
00136 }
00137
00138 VOID
00139 MonCloseEventLog(
00140 )
00141 /*++
00142
00143 Routine Description:
00144
00145       Closes the handle to the event logger if this is the last caller
00146
00147 Arguments:
00148
00149       None
00150
00151 Return Value:
00152
00153       None
00154
00155 --*/
00156 {
00157     if (hEventLog != NULL) {
00158         dwLogUsers --;            // decrement usage
00159         if (dwLogUsers <= 0) {    // and if we're the last, then close up log
00160             REPORT_INFORMATION(UTIL_CLOSING_LOG, LOG_DEBUG);
00161             DeregisterEventSource(hEventLog);
00162         }
00163     }
00164 }
00165
00166 DWORD
00167 GetQueryType(
00168     IN LPWSTR lpValue
00169 )
00170 /*++
00171
00172 GetQueryType
00173
00174     returns the type of query described in the lpValue string so that
00175     the appropriate processing method may be used
00176
00177 Arguments
00178
00179     IN lpValue
00180         string passed to PerfRegQuery Value for processing
00181
00182 Return Value
00183
00184     QUERY_GLOBAL
00185         if lpValue == 0 (null pointer)
00186            lpValue == pointer to Null string
00187            lpValue == pointer to "Global" string
00188
00189     QUERY_FOREIGN
00190         if lpValue == pointer to "Foriegn" string
00191
00192     QUERY_COSTLY
00193         if lpValue == pointer to "Costly" string
00194
00195     otherwise:
00196
00197     QUERY_ITEMS
00198
00199 --*/
00200 {
00201     WCHAR   * pwcArgChar, * pwcTypeChar;
00202     BOOL    bFound;
00203
00204     if (lpValue == 0) {
00205         return QUERY_GLOBAL;
00206     } else if (*lpValue == 0) {
00207         return QUERY_GLOBAL;
00208     }
00209
00210     // check for "Global" request
00211
00212     pwcArgChar  = lpValue;
00213     pwcTypeChar = GLOBAL_STRING;
00214     bFound = TRUE;  // assume found until contradicted
00215
00216     // check to the length of the shortest string
00217
00218     while ((* pwcArgChar != 0) && (* pwcTypeChar != 0)) {
00219         if (* pwcArgChar ++ != * pwcTypeChar ++) {
00220             bFound = FALSE; // no match
00221             break;          // bail out now
00222         }
00223     }
00224
00225     if (bFound) return QUERY_GLOBAL;
00226
00227     // check for "Foreign" request
00228
00229     pwcArgChar  = lpValue;
00230     pwcTypeChar = FOREIGN_STRING;
00231     bFound      = TRUE;  // assume found until contradicted
00232
00233     // check to the length of the shortest string
00234
00235     while ((* pwcArgChar != 0) && (* pwcTypeChar != 0)) {
00236         if (* pwcArgChar ++ != * pwcTypeChar ++) {
00237             bFound = FALSE; // no match
00238             break;          // bail out now
00239         }
00240     }
00241
00242     if (bFound) return QUERY_FOREIGN;
00243
00244     // check for "Costly" request
00245
00246     pwcArgChar  = lpValue;
00247     pwcTypeChar = COSTLY_STRING;
00248     bFound      = TRUE;  // assume found until contradicted
00249
00250     // check to the length of the shortest string
00251
00252     while ((* pwcArgChar != 0) && (* pwcTypeChar != 0)) {
00253         if (* pwcArgChar ++ != * pwcTypeChar ++) {
00254             bFound = FALSE; // no match
00255             break;          // bail out now
00256         }
00257     }
00258
00259     if (bFound) return QUERY_COSTLY;
00260
00261     // if not Global and not Foreign and not Costly,
00262     // then it must be an item list
00263
00264     return QUERY_ITEMS;
00265
00266 }
00267
00268 BOOL
00269 IsNumberInUnicodeList(
00270     IN DWORD   dwNumber,
00271     IN LPWSTR  lpwszUnicodeList
00272 )
00273 /*++
00274
00275 IsNumberInUnicodeList
00276
00277 Arguments:
00278
00279     IN dwNumber
00280         DWORD number to find in list
00281
00282     IN lpwszUnicodeList
00283         Null terminated, Space delimited list of decimal numbers
00284
00285 Return Value:
00286
00287     TRUE:
00288             dwNumber was found in the list of unicode number strings
00289
00290     FALSE:
00291             dwNumber was not found in the list.
00292
00293 --*/
00294 {
00295     DWORD   dwThisNumber;
00296     WCHAR   *pwcThisChar;
00297     BOOL    bValidNumber;
00298     BOOL    bNewItem;
00299     WCHAR   wcDelimiter;    // could be an argument to be more flexible
00300
00301     if (lpwszUnicodeList == 0) return FALSE;    // null pointer, # not founde
00302
00303     pwcThisChar  = lpwszUnicodeList;
00304     dwThisNumber = 0;
00305     wcDelimiter  = (WCHAR)' ';
00306     bValidNumber = FALSE;
00307     bNewItem     = TRUE;
00308
00309     while (TRUE) {
00310         switch (EvalThisChar (*pwcThisChar, wcDelimiter)) {
00311             case DIGIT:
00312                 // if this is the first digit after a delimiter, then
00313                 // set flags to start computing the new number
00314                 if (bNewItem) {
00315                     bNewItem     = FALSE;
00316                     bValidNumber = TRUE;
00317                 }
00318                 if (bValidNumber) {
00319                     dwThisNumber *= 10;
00320                     dwThisNumber += (* pwcThisChar - (WCHAR) '0');
00321                 }
00322                 break;
00323
00324             case DELIMITER:
00325                 // a delimter is either the delimiter character or the
00326                 // end of the string ('\0') if when the delimiter has been
00327                 // reached a valid number was found, then compare it to the
00328                 // number from the argument list. if this is the end of the
00329                 // string and no match was found, then return.
00330                 //
00331                 if (bValidNumber) {
00332                     if (dwThisNumber == dwNumber) return TRUE;
00333                     bValidNumber = FALSE;
00334                 }
00335                 if (* pwcThisChar == 0) {
00336                     return FALSE;
00337                 } else {
00338                     bNewItem     = TRUE;
00339                     dwThisNumber = 0;
00340                 }
00341                 break;
00342
00343             case INVALID:
00344                 // if an invalid character was encountered, ignore all
00345                 // characters up to the next delimiter and then start fresh.
00346                 // the invalid number is not compared.
00347                 bValidNumber = FALSE;
00348                 break;
00349
00350             default:
00351                 break;
00352
00353         }
00354         pwcThisChar++;
00355     }
00356     return FALSE;
00357 }   // IsNumberInUnicodeList
00358
00359 BOOL
00360 MonBuildInstanceDefinition(
00361     PERF_INSTANCE_DEFINITION * pBuffer,
00362     PVOID                    * pBufferNext,
00363     DWORD                      ParentObjectTitleIndex,
00364     DWORD                      ParentObjectInstance,
00365     DWORD                      UniqueID,
00366     LPWSTR                     Name
00367 )
00368 /*++
00369
00370     MonBuildInstanceDefinition  -   Build an instance of an object
00371
00372         Inputs:
00373
00374             pBuffer         -   pointer to buffer where instance is to
00375                                 be constructed
00376
00377             pBufferNext     -   pointer to a pointer which will contain
00378                                 next available location, DWORD aligned
00379
00380             ParentObjectTitleIndex
00381                             -   Title Index of parent object type; 0 if
00382                                 no parent object
00383
00384             ParentObjectInstance
00385                             -   Index into instances of parent object
00386                                 type, starting at 0, for this instances
00387                                 parent object instance
00388
00389             UniqueID        -   a unique identifier which should be used
00390                                 instead of the Name for identifying
00391                                 this instance
00392
00393             Name            -   Name of this instance
00394 --*/
00395 {
00396     DWORD NameLength;
00397     LPWSTR pName;
00398     //
00399     //  Include trailing null in name size
00400     //
00401
00402     NameLength                      = (lstrlenW(Name) + 1) * sizeof(WCHAR);
00403     pBuffer->ByteLength             = sizeof(PERF_INSTANCE_DEFINITION) + DWORD_MULTIPLE(NameLength);
00404     pBuffer->ParentObjectTitleIndex = ParentObjectTitleIndex;
00405     pBuffer->ParentObjectInstance   = ParentObjectInstance;
00406     pBuffer->UniqueID               = UniqueID;
00407     pBuffer->NameOffset             = sizeof(PERF_INSTANCE_DEFINITION);
00408     pBuffer->NameLength             = NameLength;
00409
00410     // copy name to name buffer
00411     pName = (LPWSTR) & pBuffer[1];
00412     RtlMoveMemory(pName, Name, NameLength);
00413
00414     // update "next byte" pointer
00415     * pBufferNext = (PVOID) ((PCHAR) pBuffer + pBuffer->ByteLength);
00416
00417     return 0;
00418 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ClsFact.h Source File

  • WinUI
  • Shell
  • SampView

ClsFact.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ClsFact.h
00013
00014    Description:   CClassFactory definitions.
00015
00016 **************************************************************************/
00017
00018 #ifndef CLASSFACTORY_H
00019 #define CLASSFACTORY_H
00020
00021 #include <windows.h>
00022 #include "ShlFldr.h"
00023 #include "ShlView.h"
00024
00025 /**************************************************************************
00026
00027    CClassFactory class definition
00028
00029 **************************************************************************/
00030
00031 class CClassFactory : public IClassFactory
00032 {
00033 private:
00034    DWORD m_ObjRefCount;
00035
00036 public:
00037    CClassFactory();
00038    ~CClassFactory();
00039
00040    //IUnknown methods
00041    STDMETHODIMP QueryInterface(REFIID, LPVOID*);
00042    STDMETHODIMP_(DWORD) AddRef();
00043    STDMETHODIMP_(DWORD) Release();
00044
00045    //IClassFactory methods
00046    STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID*);
00047    STDMETHODIMP LockServer(BOOL);
00048 };
00049
00050 #endif   //CLASSFACTORY_H
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/backgrnd.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

backgrnd.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "Backgrnd.h"
00021
00022 const GUID CBackgroundFolder::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023 const GUID CBackground::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00024
00025 #define WM_NEWOBJECT WM_APP
00026 #define WM_DISCOVERYCOMPLETE (WM_APP + 1)
00027
00028 //==============================================================
00029 //
00030 // CBackgroundFolder implementation
00031 //
00032 //
00033 CBackgroundFolder::CBackgroundFolder()
00034 : m_pConsoleNameSpace(NULL), m_scopeitem(0), m_threadId(0), m_thread(NULL),
00035 m_running(false), m_bViewUpdated(false)
00036 {
00037     ZeroMemory(m_children, sizeof(m_children));
00038
00039     WNDCLASS wndClass;
00040
00041     ZeroMemory(&wndClass, sizeof(WNDCLASS));
00042
00043     wndClass.lpfnWndProc = WindowProc;
00044     wndClass.lpszClassName = _T("backgroundthreadwindow");
00045     wndClass.hInstance = g_hinst;
00046
00047     ATOM atom = RegisterClass(&wndClass);
00048     m_backgroundHwnd = CreateWindow(
00049             _T("backgroundthreadwindow"),  // pointer to registered class name
00050             NULL, // pointer to window name
00051             0,        // window style
00052             0,                // horizontal position of window
00053             0,                // vertical position of window
00054             0,           // window width
00055             0,          // window height
00056             NULL,      // handle to parent or owner window
00057             NULL,          // handle to menu or child-window identifier
00058             g_hinst,     // handle to application instance
00059             (void *)this        // pointer to window-creation data
00060         );
00061
00062     if (m_backgroundHwnd)
00063         SetWindowLong(m_backgroundHwnd, GWL_USERDATA, (LONG)this);
00064
00065     InitializeCriticalSection(&m_critSect);
00066 }
00067
00068 CBackgroundFolder::~CBackgroundFolder()
00069 {
00070     StopThread();
00071
00072     for (int n = 0; n < MAX_CHILDREN; n++)
00073         if (m_children[n] != NULL)
00074             delete m_children[n];
00075
00076     if (m_backgroundHwnd != NULL)
00077         DestroyWindow(m_backgroundHwnd);
00078
00079     UnregisterClass(_T("backgroundthreadwindow"), NULL);
00080
00081     DeleteCriticalSection(&m_critSect);
00082 }
00083
00084 LRESULT CALLBACK CBackgroundFolder::WindowProc(
00085       HWND hwnd,      // handle to window
00086       UINT uMsg,      // message identifier
00087       WPARAM wParam,  // first message parameter
00088       LPARAM lParam   // second message parameter
00089     )
00090 {
00091     CBackgroundFolder *pThis = (CBackgroundFolder *)GetWindowLong(hwnd, GWL_USERDATA);
00092
00093     switch (uMsg) {
00094     case WM_NEWOBJECT:
00095         _ASSERT(pThis != NULL);
00096         pThis->AddItem(lParam);
00097         break;
00098
00099     case WM_DISCOVERYCOMPLETE:
00100         _ASSERT(pThis != NULL);
00101         pThis->m_bViewUpdated = true;
00102         pThis->StopThread();
00103         break;
00104    }
00105
00106     return DefWindowProc(hwnd, uMsg, wParam, lParam);
00107 }
00108
00109 DWORD WINAPI CBackgroundFolder::ThreadProc(
00110   LPVOID lpParameter   // thread data
00111 )
00112 {
00113     CBackgroundFolder *pThis = (CBackgroundFolder *)lpParameter;
00114
00115     EnterCriticalSection(&pThis->m_critSect);
00116     pThis->m_running = true;
00117     LeaveCriticalSection(&pThis->m_critSect);
00118
00119     for (int n = 0; n < MAX_CHILDREN; n++) {
00120         EnterCriticalSection(&pThis->m_critSect);
00121         bool running = pThis->m_running;
00122         LeaveCriticalSection(&pThis->m_critSect);
00123
00124         if (running == false)
00125             return 0;
00126
00127         PostMessage(pThis->m_backgroundHwnd, WM_NEWOBJECT, 0, n);
00128         Sleep(500);
00129     }
00130
00131     PostMessage(pThis->m_backgroundHwnd, WM_DISCOVERYCOMPLETE, 0, 0);
00132
00133     return 0;
00134 }
00135
00136 void CBackgroundFolder::StartThread()
00137 {
00138     EnterCriticalSection(&m_critSect);
00139     m_thread = CreateThread(NULL, 0, ThreadProc, (void *)this, 0, &m_threadId);
00140     LeaveCriticalSection(&m_critSect);
00141 }
00142
00143 void CBackgroundFolder::StopThread()
00144 {
00145     EnterCriticalSection(&m_critSect);
00146     m_running = false;
00147
00148     if (m_thread != NULL) {
00149         // this is ugly, wait for 10 seconds, then kill the thread
00150         DWORD res = WaitForSingleObject(m_thread, 10000);
00151
00152         if (res == WAIT_TIMEOUT)
00153             TerminateThread(m_thread, 0);
00154
00155         CloseHandle(m_thread);
00156
00157         m_thread = NULL;
00158     }
00159     LeaveCriticalSection(&m_critSect);
00160 }
00161
00162 void CBackgroundFolder::AddItem(int id)
00163 {
00164     HRESULT hr;
00165
00166     EnterCriticalSection(&m_critSect);
00167
00168     _ASSERT(m_children[id] == NULL);
00169
00170     m_children[id] = new CBackground(id);
00171
00172     SCOPEDATAITEM sdi;
00173
00174     // insert items here
00175     ZeroMemory(&sdi, sizeof(SCOPEDATAITEM));
00176
00177     sdi.mask = SDI_STR       |   // Displayname is valid
00178         SDI_PARAM     |   // lParam is valid
00179         SDI_IMAGE     |   // nImage is valid
00180         SDI_OPENIMAGE |   // nOpenImage is valid
00181         SDI_PARENT    |
00182         SDI_CHILDREN;
00183
00184     sdi.relativeID  = (HSCOPEITEM)m_scopeitem;
00185     sdi.nImage      = m_children[id]->GetBitmapIndex();
00186     sdi.nOpenImage  = INDEX_OPENFOLDER;
00187     sdi.displayname = MMC_CALLBACK;
00188     sdi.lParam      = (LPARAM)m_children[id];       // The cookie
00189     sdi.cChildren   = 0;
00190
00191     hr = m_pConsoleNameSpace->InsertItem( &sdi );
00192     _ASSERT( SUCCEEDED(hr) );
00193
00194     m_children[id]->SetHandle((HANDLE)sdi.ID);
00195
00196     LeaveCriticalSection(&m_critSect);
00197
00198     return;
00199 }
00200
00201 HRESULT CBackgroundFolder::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00202 {
00203     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00204         (long *)m_pBMapLg, // pointer to a handle
00205         0, // index of the first image in the strip
00206         RGB(0, 128, 128)  // color of the icon mask
00207         );
00208 }
00209
00210 HRESULT CBackgroundFolder::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00211 {
00212     // cache the stuff
00213     m_pConsoleNameSpace = pConsoleNameSpace;
00214     m_scopeitem = parent;
00215
00216     if (m_bViewUpdated == false && m_running == false)
00217         StartThread();
00218
00219     return S_OK;
00220 }
00221
00222 HRESULT CBackgroundFolder::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00223 {
00224     m_bSelected = (bSelect && bScope) ? true : false;
00225
00226     if (bSelect && !m_running) {
00227         IConsoleVerb *pConsoleVerb;
00228
00229         HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00230         _ASSERT(SUCCEEDED(hr));
00231
00232         hr = pConsoleVerb->SetVerbState(MMC_VERB_REFRESH, ENABLED, TRUE);
00233
00234         pConsoleVerb->Release();
00235     }
00236
00237     return S_OK;
00238 }
00239
00240 HRESULT CBackgroundFolder::OnRefresh()
00241 {
00242     HRESULT hr = S_OK;
00243
00244     StopThread();
00245
00246     EnterCriticalSection(&m_critSect);
00247     for (int n = 0; n < MAX_CHILDREN; n++) {
00248         if (m_children[n] != NULL) {
00249             HSCOPEITEM hItem = (HSCOPEITEM)m_children[n]->GetHandle();
00250             hr = m_pConsoleNameSpace->DeleteItem(hItem, TRUE);
00251
00252             delete m_children[n];
00253             m_children[n] = NULL;
00254         }
00255     }
00256     LeaveCriticalSection(&m_critSect);
00257
00258     m_bViewUpdated = false;
00259
00260     StartThread();
00261
00262     return S_OK;
00263 }
00264
00265 const _TCHAR *CBackground::GetDisplayName(int nCol)
00266 {
00267     static _TCHAR buf[128];
00268
00269     _stprintf(buf, _T("Background object #%d"), m_id);
00270
00271     return buf;
00272 }
00273
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpAsyncSample/browser.h Source File

  • Web
  • winhttp
  • WinHttpAsyncSample

browser.h

Go to the documentation of this file.
00001 //  WinHttpAsyncSample
00002 //  Copyright (c) Microsoft Corporation. All rights reserved.
00003
00004 #ifndef _SIMPLE_BROWSER_H
00005 #define _SIMPLE_BROWSER_H
00006
00007 typedef struct BROWSER_CONFIG
00008 {
00009     PWSTR  pwszHomePage;
00010     BOOL    fProxyAutoDiscovery;
00011     BOOL    fEnableProxyFailover;
00012     UINT    nTimeLimit;         // in seconds
00013     UINT    nFailureRetries;    // retry the request upon some errors (e.g. ERROR_WINHTTP_TIMEOUT)
00014     PWSTR  pwszEmbeddedLinks;  // download these embedded links (in parallel) once the Home Page has been downloaded
00015 } *P_BROWSER_CONFIG;
00016
00017 class ASYNC_REQUESTER;
00018
00019 class SIMPLE_BROWSER
00020 {
00021 public:
00022      SIMPLE_BROWSER(UINT nID);
00023      ~SIMPLE_BROWSER();
00024
00025     BOOL Open(P_BROWSER_CONFIG); // initialize the object and kick start the Home Page download
00026
00027     VOID Close(VOID);   // will block until all pending downloads gracefully shutdown
00028
00029 private:
00030     VOID OnRequesterStopped(ASYNC_REQUESTER*);   // indicate a request transaction stopped for some reason
00031     VOID OnRequesterClosed(ASYNC_REQUESTER*);    // indicate a request is shutdown gracefully
00032
00033 private:
00034     UINT        m_nID;
00035     HINTERNET   m_hSession;
00036
00037     P_BROWSER_CONFIG    m_pBrowserConfig;
00038     ASYNC_REQUESTER* m_pHomePageRequester;
00039
00040     LIST_ENTRY          m_EmbeddedLinks;
00041     CRITICAL_SECTION    m_LinksCritSec;
00042
00043     HANDLE  m_hShutdownEvent;
00044     BOOL    m_fShutdownInProgress;
00045
00046     UINT    m_nRequesterIDSeed;
00047
00048 friend class ASYNC_REQUESTER;
00049 };
00050
00051 class ASYNC_REQUESTER
00052 {
00053 public:
00054     ASYNC_REQUESTER(UINT nRequesterID, SIMPLE_BROWSER* pBrowser);
00055
00056     ~ASYNC_REQUESTER();
00057
00058     BOOL Open(
00059         PWSTR pwszUrl,
00060         BOOL fProxyAutoDiscovery,
00061         BOOL fProxyFailover,
00062         UINT nFailureRetries,
00063         UINT nTimeLimit);
00064
00065     BOOL Start();
00066
00067     VOID RequestToShutdown();   // use to abort live download
00068
00069 private:
00070     VOID Close();
00071
00072     VOID OnRequestError(
00073         LPWINHTTP_ASYNC_RESULT
00074         );
00075     VOID OnSendRequestComplete(
00076         );
00077     VOID OnHeadersAvailable(
00078         );
00079     VOID OnReadComplete(
00080         DWORD dwBytesRead
00081         );
00082     VOID OnHandleClosing(HINTERNET);
00083
00084 private:
00085     LIST_ENTRY  _List;
00086
00087 #ifdef ERROR
00088 #undef ERROR
00089 #endif
00090
00091     enum STATE
00092     {
00093         INIT,
00094         OPENED,
00095         ERROR,
00096         SENDING,
00097         RECEIVING,
00098         HEADERS_AVAILABLE,
00099         WAITING_FOR_DATA,
00100         DATA_AVAILABLE,
00101         DATA_EXHAUSTED,
00102         CLOSING,
00103         CLOSED
00104     };
00105
00106     PWSTR m_pwszUrl;
00107
00108
00109     HINTERNET m_hConnect;
00110     HINTERNET m_hRequest;
00111
00112     UINT m_nID;
00113     SIMPLE_BROWSER* m_pBrowser;
00114
00115     BOOL m_fProxyAutoDiscovery;
00116     BOOL m_fProxyFailover;
00117     UINT m_nFailureRetries;
00118
00119     WINHTTP_PROXY_INFO m_ProxyInfo;
00120
00121     LPWSTR m_pwszNextProxies;
00122
00123     DWORD m_dwLastError;
00124     DWORD m_dwErrorAPI;
00125
00126     STATE m_State;
00127
00128     BOOL m_fClosing;
00129
00130     enum { READ_BUFFER_SIZE = 1024 };
00131     BYTE m_ReadBuffer[READ_BUFFER_SIZE];
00132
00133     int m_ContentLength;
00134     DWORD m_dwBytesReadSoFar;
00135
00136     DWORD m_dwStartingTime; // in millisecond
00137     DWORD m_dwTimeLimit; // in millisecond
00138     int   m_TimeRemaining; // in millsecond
00139
00140     int m_nNumAttempts;
00141
00142 friend class SIMPLE_BROWSER;
00143 friend void CALLBACK RequesterStatusCallback (
00144     HINTERNET hInternet,
00145     DWORD_PTR dwContext,
00146     DWORD dwInternetStatus,
00147     LPVOID lpvStatusInformation,
00148     DWORD dwStatusInformationLength
00149     );
00150 };
00151
00152 #endif // _SIMPLE_BROWSER_H
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::FilterGroupEnum Member List

This is the complete list of members for msado15::FilterGroupEnum, including all inherited members.
adFilterAffectedRecords | msado15::FilterGroupEnum | [static]
adFilterConflictingRecords | msado15::FilterGroupEnum | [static]
adFilterFetchedRecords | msado15::FilterGroupEnum | [static]
adFilterNone | msado15::FilterGroupEnum | [static]
adFilterPendingRecords | msado15::FilterGroupEnum | [static]
adFilterPredicate | msado15::FilterGroupEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/adddevicedlg.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

adddevicedlg.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  AddDeviceDlg.h:  Header for the CAddDeviceDlg class.  This is a
00014 //                   modeless dialog class used to add device nodes.
00015 //
00016
00017
00018 #ifndef _CLASS_ADDDEVICEDLG_
00019 #define _CLASS_ADDDEVICEDLG_
00020
00021
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025
00026
00027 #include "BaseDialog.h"
00028
00029
00030 //---------------------------------------------------------------------------
00031 class CAddDeviceDlg : public CBaseDialog
00032 {
00033   public:
00034     CAddDeviceDlg( ULONG nTemplate, HWND hParentWnd );
00035     ~CAddDeviceDlg();
00036
00037
00038   public:
00039     BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
00040
00041
00042   // Messages we will be handling
00043   private:
00044     LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00045     LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00046
00047   private:
00048     HWND    m_hParentWnd;
00049
00050
00051 };
00052
00053 #endif //_CLASS_ADDDEVICEDLG_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_EXT_WSPPROC_TABLE Member List

This is the complete list of members for _EXT_WSPPROC_TABLE, including all inherited members.
lpfnAcceptEx | _EXT_WSPPROC_TABLE
lpfnConnectEx | _EXT_WSPPROC_TABLE
lpfnDisconnectEx | _EXT_WSPPROC_TABLE
lpfnGetAcceptExSockaddrs | _EXT_WSPPROC_TABLE
lpfnTransmitFile | _EXT_WSPPROC_TABLE
lpfnTransmitPackets | _EXT_WSPPROC_TABLE
lpfnWSARecvMsg | _EXT_WSPPROC_TABLE
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsError/dlldata.c Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsError

dlldata.c

Go to the documentation of this file.
00001 /*********************************************************
00002    DllData file -- generated by MIDL compiler
00003
00004         DO NOT ALTER THIS FILE
00005
00006    This file is regenerated by MIDL on every IDL file compile.
00007
00008    To completely reconstruct this file, delete it and rerun MIDL
00009    on all the IDL files in this DLL, specifying this file for the
00010    /dlldata command line option
00011
00012 *********************************************************/
00013
00014 #define PROXY_DELEGATION
00015
00016 #include <rpcproxy.h>
00017
00018 #ifdef __cplusplus
00019 extern "C"   {
00020 #endif
00021
00022 EXTERN_PROXY_FILE( ADsError )
00023
00024
00025 PROXYFILE_LIST_START
00026 /* Start of list */
00027   REFERENCE_PROXY_FILE( ADsError ),
00028 /* End of list */
00029 PROXYFILE_LIST_END
00030
00031
00032 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00033
00034 #ifdef __cplusplus
00035 }  /*extern "C" */
00036 #endif
00037
00038 /* end of generated dlldata file */
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Incoming/Incoming.Cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Incoming

Incoming.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2000 - 2000 Microsoft Corporation.  All Rights Reserved.
00004
00005 --*/
00006
00007 #include <windows.h>
00008 #include <tapi3.h>
00009 #include <control.h>
00010 #include "callnot.h"
00011 #include "resource.h"
00012
00013 //////////////////////////////////////////////////////////
00014 // Incoming.cpp
00015 //
00016 // Sample application that handles incoming TAPI calls.
00017 // In order to receive incoming calls, the application must
00018 // implement and register the outgoing ITCallNotification
00019 // interface.
00020 //
00021 // This application will register to receive calls on
00022 // all addresses that support at least the audio media type.
00023 //
00024 // NOTE:  This application is limited to working with one
00025 // call at at time, and will not work correctly if multiple
00026 // calls are present at the same time.
00027 //////////////////////////////////////////////////////////
00028
00029 //////////////////////////////////////////////////////////
00030 // constants
00031 //////////////////////////////////////////////////////////
00032
00033 const DWORD MAXTERMINALS    = 5;
00034
00035 //////////////////////////////////////////////////////////
00036 // GLOBALS
00037 //////////////////////////////////////////////////////////
00038
00039 HINSTANCE               ghInst;
00040 ITTAPI *                gpTapi;
00041 ITBasicCallControl *    gpCall;
00042 HWND                    ghDlg = NULL;
00043
00044 BOOL                    gfAutoAnswer = FALSE;
00045
00046 WCHAR gszTapi30[] = L"TAPI 3.0 Incoming Call Sample";
00047
00048
00049 ULONG                         gulAdvise;
00050
00051 //////////////////////////////////////////////////////////
00052 // PROTOTYPES
00053 //////////////////////////////////////////////////////////
00054
00055 INT_PTR
00056 CALLBACK
00057 MainDialogProc(
00058                HWND hDlg,
00059                UINT uMsg,
00060                WPARAM wParam,
00061                LPARAM lParam
00062               );
00063
00064 HRESULT
00065 RegisterTapiEventInterface(CTAPIEventNotification *pTAPIEventNotification);
00066
00067 HRESULT
00068 ListenOnAddresses();
00069
00070 HRESULT
00071 ListenOnThisAddress(
00072                     ITAddress * pAddress
00073                    );
00074
00075 HRESULT
00076 AnswerTheCall();
00077
00078 HRESULT
00079 DisconnectTheCall();
00080
00081 void
00082 ReleaseTheCall();
00083
00084 void
00085 DoMessage(
00086           LPWSTR pszMessage
00087          );
00088
00089 void
00090 SetStatusMessage(
00091                  LPWSTR pszMessage
00092                 );
00093
00094 HRESULT
00095 InitializeTapi();
00096
00097 void
00098 ShutdownTapi();
00099
00100 void
00101 EnableButton(
00102              int ID
00103             );
00104 void
00105 DisableButton(
00106               int ID
00107              );
00108
00109 BOOL
00110 AddressSupportsMediaType(
00111                          ITAddress * pAddress,
00112                          long        lMediaType
00113                         );
00114
00115 //////////////////////////////////////////////////////////
00116 //
00117 //              FUNCTIONS
00118 //
00119 //////////////////////////////////////////////////////////
00120
00121 //////////////////////////////////////////////////////////
00122 // WinMain
00123 //////////////////////////////////////////////////////////
00124 int
00125 WINAPI
00126 WinMain(
00127         HINSTANCE hInst,
00128         HINSTANCE hPrevInst,
00129         LPSTR lpCmdLine,
00130         int nCmdShow
00131        )
00132 {
00133     ghInst = hInst;
00134
00135     //
00136     // Initialize COM.
00137     //
00138
00139     if (!SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED)))
00140     {
00141         return 0;
00142     }
00143
00144     //
00145     // do all tapi initialization
00146     //
00147
00148     if (S_OK != InitializeTapi())
00149     {
00150         return 0;
00151     }
00152
00153     //
00154     // everything is initialized, so
00155     // start the main dialog box
00156     //
00157
00158     DialogBox(
00159               ghInst,
00160               MAKEINTRESOURCE(IDD_MAINDLG),
00161               NULL,
00162               MainDialogProc
00163              );
00164
00165
00166     //
00167     // clean up tapi
00168     //
00169
00170     ShutdownTapi();
00171
00172     //
00173     // Shut down COM.
00174     //
00175
00176     CoUninitialize();
00177
00178     return 1;
00179 }
00180
00181
00182 //////////////////////////////////////////////////////////////
00183 // InitializeTapi
00184 //
00185 // Various tapi initializations
00186 ///////////////////////////////////////////////////////////////
00187
00188 HRESULT
00189 InitializeTapi()
00190 {
00191     HRESULT         hr;
00192
00193     //
00194     // cocreate the TAPI object
00195     //
00196
00197     hr = CoCreateInstance(
00198                           CLSID_TAPI,
00199                           NULL,
00200                           CLSCTX_INPROC_SERVER,
00201                           IID_ITTAPI,
00202                           (LPVOID *)&gpTapi
00203                          );
00204
00205     if ( FAILED(hr) )
00206     {
00207         DoMessage(L"CoCreateInstance on TAPI failed");
00208         return hr;
00209     }
00210
00211     //
00212     // call initialize.  this must be called before
00213     // any other tapi functions are called.
00214     //
00215
00216     hr = gpTapi->Initialize();
00217
00218     if ( FAILED(hr) )
00219     {
00220         DoMessage(L"TAPI failed to initialize");
00221
00222         gpTapi->Release();
00223         gpTapi = NULL;
00224
00225         return hr;
00226     }
00227
00228     //
00229     // Create our own event notification object and register it
00230     // see callnot.h and callnot.cpp
00231     //
00232
00233     CTAPIEventNotification *pTAPIEventNotification = new CTAPIEventNotification;
00234
00235     hr = RegisterTapiEventInterface(pTAPIEventNotification);
00236
00237
00238     //
00239     // no longer need a reference to the callback object. tapi will keep a
00240     // reference to it for as long as it is using it.
00241     //
00242
00243     pTAPIEventNotification->Release();
00244
00245
00246
00247     // Set the Event filter to only give us only the events we process
00248     gpTapi->put_EventFilter(TE_CALLNOTIFICATION | TE_CALLSTATE | TE_CALLMEDIA);
00249
00250
00251     //
00252     // find all address objects that
00253     // we will use to listen for calls on
00254     //
00255
00256     hr = ListenOnAddresses();
00257
00258     if ( FAILED(hr) )
00259     {
00260         DoMessage(L"Could not find any addresses to listen on");
00261
00262         gpTapi->Release();
00263         gpTapi = NULL;
00264
00265         return hr;
00266     }
00267
00268     return S_OK;
00269 }
00270
00271
00272 ///////////////////////////////////////////////////////////////
00273 // ShutdownTapi
00274 ///////////////////////////////////////////////////////////////
00275
00276 void
00277 ShutdownTapi()
00278 {
00279     //
00280     // if there is still a call, release it
00281     //
00282
00283     if (NULL != gpCall)
00284     {
00285         gpCall->Release();
00286         gpCall = NULL;
00287     }
00288
00289     //
00290     // release main object.
00291     //
00292
00293     if (NULL != gpTapi)
00294     {
00295         gpTapi->Shutdown();
00296         gpTapi->Release();
00297     }
00298
00299 }
00300
00301
00302 ///////////////////////////////////////////////////////////////////////////
00303 // MainDlgProc
00304 ///////////////////////////////////////////////////////////////////////////
00305
00306 INT_PTR
00307 CALLBACK
00308 MainDialogProc(
00309                HWND hDlg,
00310                UINT uMsg,
00311                WPARAM wParam,
00312                LPARAM lParam
00313               )
00314 {
00315     switch (uMsg)
00316     {
00317         case WM_PRIVATETAPIEVENT:
00318         {
00319             OnTapiEvent(
00320                         (TAPI_EVENT) wParam,
00321                         (IDispatch *) lParam
00322                        );
00323
00324             return 0;
00325         }
00326
00327         case WM_INITDIALOG:
00328         {
00329             //
00330             // set up dialog
00331             //
00332
00333             ghDlg = hDlg;
00334
00335             DisableButton( IDC_ANSWER );
00336             DisableButton( IDC_DISCONNECT );
00337
00338             SetStatusMessage( L"Waiting for a call..." );
00339
00340             return 0;
00341         }
00342
00343         case WM_COMMAND:
00344         {
00345             if ( LOWORD(wParam) == IDCANCEL )
00346             {
00347                 //
00348                 // quit
00349                 //
00350
00351                 EndDialog( hDlg, 0 );
00352
00353                 return 1;
00354             }
00355
00356             switch ( LOWORD(wParam) )
00357             {
00358                 case IDC_AUTOANSWER:
00359                 {
00360                     //
00361                     // auto answer check box was fiddled around with
00362                     //
00363
00364                     gfAutoAnswer = !gfAutoAnswer;
00365                     return 1;
00366                 }
00367
00368                 case IDC_ANSWER:
00369                 {
00370                     //
00371                     // answer the call
00372                     //
00373
00374                     SetStatusMessage(L"Answering...");
00375
00376                     if ( S_OK == AnswerTheCall() )
00377                     {
00378                         SetStatusMessage(L"Connected");
00379
00380                         EnableButton( IDC_DISCONNECT );
00381                         DisableButton( IDC_ANSWER );
00382                     }
00383                     else
00384                     {
00385                         DisableButton( IDC_ANSWER );
00386                         DoMessage(L"Answer failed");
00387                         SetStatusMessage(L"Waiting for a call...");
00388                     }
00389
00390                     return 1;
00391                 }
00392
00393                 case IDC_DISCONNECT:
00394                 {
00395                     //
00396                     // disconnect request
00397                     //
00398
00399                     SetStatusMessage(L"Disconnecting...");
00400                     if (S_OK != DisconnectTheCall())
00401                     {
00402                         DoMessage(L"Disconnect failed");
00403                     }
00404
00405                     return 1;
00406                 }
00407
00408                 case IDC_DISCONNECTED:
00409                 {
00410                     //
00411                     // disconnected notification -- release the call
00412                     //
00413
00414                     ReleaseTheCall();
00415
00416                     EnableButton( IDOK );
00417                     DisableButton( IDC_DISCONNECT );
00418
00419                     SetStatusMessage(L"Waiting for a call...");
00420
00421                     return 1;
00422                 }
00423                 default:
00424
00425                     return 0;
00426             }
00427         }
00428         default:
00429
00430             return 0;
00431     }
00432 }
00433
00434
00435 ///////////////////////////////////////////////////////////////////////////
00436 // RegisterTapiEventInterface(CTAPIEventNotification *pTAPIEventNotification)
00437 ///////////////////////////////////////////////////////////////////////////
00438
00439 HRESULT
00440 RegisterTapiEventInterface(CTAPIEventNotification *pTAPIEventNotification)
00441 {
00442     HRESULT                       hr = S_OK;
00443     IConnectionPointContainer   * pCPC;
00444     IConnectionPoint            * pCP;
00445
00446
00447     hr = gpTapi->QueryInterface(
00448                                 IID_IConnectionPointContainer,
00449                                 (void **)&pCPC
00450                                );
00451
00452     if ( FAILED(hr) )
00453     {
00454         return hr;
00455     }
00456
00457     hr = pCPC->FindConnectionPoint(
00458                                    IID_ITTAPIEventNotification,
00459                                    &pCP
00460                                   );
00461
00462     pCPC->Release();
00463
00464     if ( FAILED(hr) )
00465     {
00466         return hr;
00467     }
00468
00469     hr = pCP->Advise(
00470                       pTAPIEventNotification,
00471                       &gulAdvise
00472                      );
00473
00474     pCP->Release();
00475
00476
00477     return hr;
00478
00479 }
00480
00481
00482 ////////////////////////////////////////////////////////////////////////
00483 // ListenOnAddresses
00484 //
00485 // This procedure will find all addresses that support audioin and audioout
00486 // and will call ListenOnThisAddress to start listening on it.
00487 ////////////////////////////////////////////////////////////////////////
00488
00489 HRESULT
00490 ListenOnAddresses()
00491 {
00492     HRESULT             hr = S_OK;
00493     IEnumAddress *      pEnumAddress;
00494     ITAddress *         pAddress;
00495
00496     //
00497     // enumerate the addresses
00498     //
00499
00500     hr = gpTapi->EnumerateAddresses( &pEnumAddress );
00501
00502     if ( FAILED(hr) )
00503     {
00504         return hr;
00505     }
00506
00507     while ( TRUE )
00508     {
00509         //
00510         // get the next address
00511         //
00512
00513         hr = pEnumAddress->Next( 1, &pAddress, NULL );
00514
00515         if (S_OK != hr)
00516         {
00517             break;
00518         }
00519
00520         //
00521         // does the address support audio?
00522         //
00523
00524         if ( AddressSupportsMediaType(pAddress, TAPIMEDIATYPE_AUDIO) )
00525         {
00526             //
00527             // If it does then we'll listen.
00528             //
00529
00530             hr = ListenOnThisAddress( pAddress );
00531
00532             if ( FAILED(hr) )
00533             {
00534                 DoMessage(L"Listen failed on an address");
00535             }
00536         }
00537
00538         pAddress->Release();
00539     }
00540
00541     pEnumAddress->Release();
00542
00543     return S_OK;
00544 }
00545
00546
00547 ///////////////////////////////////////////////////////////////////
00548 // ListenOnThisAddress
00549 //
00550 // We call RegisterCallNotifications to inform TAPI that we want
00551 // notifications of calls on this address. We already resistered
00552 // our notification interface with TAPI, so now we are just telling
00553 // TAPI that we want calls from this address to trigger events on
00554 // our existing notification interface.
00555 //
00556 ///////////////////////////////////////////////////////////////////
00557
00558 HRESULT
00559 ListenOnThisAddress(
00560                     ITAddress * pAddress
00561                    )
00562 {
00563
00564     //
00565     // RegisterCallNotifications takes a media type bitmap indicating
00566     // the set of media types we are interested in. We know the
00567     // address supports audio, but let's add in video as well
00568     // if the address supports it.
00569     //
00570
00571     long lMediaTypes = TAPIMEDIATYPE_AUDIO;
00572
00573     if ( AddressSupportsMediaType(pAddress, TAPIMEDIATYPE_VIDEO) )
00574     {
00575         lMediaTypes |= TAPIMEDIATYPE_VIDEO;
00576     }
00577
00578
00579     HRESULT  hr;
00580     long     lRegister;
00581
00582     hr = gpTapi->RegisterCallNotifications(
00583                                            pAddress,
00584                                            VARIANT_TRUE,
00585                                            VARIANT_TRUE,
00586                                            lMediaTypes,
00587                                            0,
00588                                            &lRegister
00589                                           );
00590
00591     return hr;
00592 }
00593
00594 /////////////////////////////////////////////////////////////////
00595 // IsVideoCaptureStream
00596 //
00597 // Returns true if the stream is for video capture
00598 /////////////////////////////////////////////////////////////////
00599
00600 BOOL
00601 IsVideoCaptureStream(
00602                      ITStream * pStream
00603                     )
00604 {
00605     TERMINAL_DIRECTION tdStreamDirection;
00606     long               lStreamMediaType;
00607
00608     if ( FAILED( pStream  ->get_Direction(&tdStreamDirection)   ) ) { return FALSE; }
00609     if ( FAILED( pStream  ->get_MediaType(&lStreamMediaType)    ) ) { return FALSE; }
00610
00611     return (tdStreamDirection == TD_CAPTURE) &&
00612            (lStreamMediaType  == TAPIMEDIATYPE_VIDEO);
00613 }
00614
00615 /////////////////////////////////////////////////////////
00616 // GetVideoRenderTerminal
00617 //
00618 // Creates a dynamic terminal for the Video Render mediatype / direction
00619 //
00620 /////////////////////////////////////////////////////////
00621 HRESULT
00622 GetVideoRenderTerminal(
00623                    ITAddress   * pAddress,
00624                    ITTerminal ** ppTerminal
00625                   )
00626 {
00627     //
00628     // Construct a BSTR for the correct IID.
00629     //
00630
00631     LPOLESTR            lpTerminalClass;
00632
00633     HRESULT             hr;
00634
00635     hr = StringFromIID(CLSID_VideoWindowTerm,
00636                        &lpTerminalClass);
00637
00638     if ( SUCCEEDED(hr) )
00639     {
00640         BSTR                bstrTerminalClass;
00641
00642         bstrTerminalClass = SysAllocString ( lpTerminalClass );
00643
00644         CoTaskMemFree( lpTerminalClass );
00645
00646         if ( bstrTerminalClass == NULL )
00647         {
00648             hr = E_OUTOFMEMORY;
00649         }
00650         else
00651         {
00652
00653             //
00654             // Get the terminal support interface
00655             //
00656
00657             ITTerminalSupport * pTerminalSupport;
00658
00659             hr = pAddress->QueryInterface(IID_ITTerminalSupport,
00660                                           (void **)&pTerminalSupport);
00661
00662             if ( SUCCEEDED(hr) )
00663             {
00664                 //
00665                 // Create the video render terminal.
00666                 //
00667
00668                 hr = pTerminalSupport->CreateTerminal(bstrTerminalClass,
00669                                                       TAPIMEDIATYPE_VIDEO,
00670                                                       TD_RENDER,
00671                                                       ppTerminal);
00672
00673                 pTerminalSupport->Release();
00674
00675                 //
00676                 // We do not make the window visible now -- we will do that
00677                 // when the CME_STREAM_ACTIVE event is received for the stream
00678                 // (and we have placed the window within our frame).
00679                 //
00680             }
00681
00682             SysFreeString( bstrTerminalClass );
00683         }
00684     }
00685
00686     return hr;
00687 }
00688
00689
00690 /////////////////////////////////////////////////////////////////
00691 // EnablePreview
00692 //
00693 // Selects a video render terminal on a video capture stream,
00694 // thereby enabling video preview.
00695 /////////////////////////////////////////////////////////////////
00696
00697 HRESULT
00698 EnablePreview(
00699               ITAddress * pAddress,
00700               ITStream * pStream
00701              )
00702 {
00703     ITTerminal * pTerminal;
00704
00705     HRESULT hr = GetVideoRenderTerminal(pAddress, &pTerminal);
00706
00707     if ( SUCCEEDED(hr) )
00708     {
00709         hr = pStream->SelectTerminal(pTerminal);
00710
00711         pTerminal->Release();
00712     }
00713
00714     return hr;
00715 }
00716
00717
00718 /////////////////////////////////////////////////////////
00719 // GetTerminal
00720 //
00721 // Creates the default terminal for the passed-in stream.
00722 //
00723 /////////////////////////////////////////////////////////
00724 HRESULT
00725 GetTerminal(
00726             ITAddress   * pAddress,
00727             ITStream    * pStream,
00728             ITTerminal ** ppTerminal
00729            )
00730 {
00731     //
00732     // Determine the media type and direction of this stream.
00733     //
00734
00735     HRESULT            hr;
00736     long               lMediaType;
00737     TERMINAL_DIRECTION dir;
00738
00739     hr = pStream->get_MediaType( &lMediaType );
00740     if ( FAILED(hr) ) return hr;
00741
00742     hr = pStream->get_Direction( &dir );
00743     if ( FAILED(hr) ) return hr;
00744
00745     //
00746     // Since video render is a dynamic terminal, the procedure for creating
00747     // it is different.
00748     //
00749
00750     if ( ( lMediaType == TAPIMEDIATYPE_VIDEO ) &&
00751          ( dir        == TD_RENDER ) )
00752     {
00753         return GetVideoRenderTerminal(pAddress, ppTerminal);
00754     }
00755
00756     //
00757     // For all other terminals we use GetDefaultStaticTerminal.
00758     // First, get the terminal support interface.
00759     //
00760
00761     ITTerminalSupport * pTerminalSupport;
00762
00763     hr = pAddress->QueryInterface( IID_ITTerminalSupport,
00764                                    (void **)&pTerminalSupport);
00765
00766     if ( SUCCEEDED(hr) )
00767     {
00768         //
00769         // get the default terminal for this MediaType and direction
00770         //
00771
00772         hr = pTerminalSupport->GetDefaultStaticTerminal(lMediaType,
00773                                                         dir,
00774                                                         ppTerminal);
00775
00776         pTerminalSupport->Release();
00777     }
00778
00779     return hr;
00780
00781 }
00782
00783 /////////////////////////////////////////////////////////////////
00784 // SelectTerminalOnCall
00785 //
00786 // Selects a given terminal on the first compatible stream that
00787 // exists on the given call.
00788 /////////////////////////////////////////////////////////////////
00789
00790 HRESULT
00791 SelectTerminalsOnCall(
00792                      ITAddress * pAddress,
00793                      ITBasicCallControl * pCall
00794                      )
00795 {
00796     HRESULT hr;
00797
00798     //
00799     // get the ITStreamControl interface for this call
00800     //
00801
00802     ITStreamControl * pStreamControl;
00803
00804     hr = pCall->QueryInterface(IID_ITStreamControl,
00805                                (void **) &pStreamControl);
00806
00807     if ( SUCCEEDED(hr) )
00808     {
00809         //
00810         // enumerate the streams
00811         //
00812
00813         IEnumStream * pEnumStreams;
00814
00815         hr = pStreamControl->EnumerateStreams(&pEnumStreams);
00816
00817         pStreamControl->Release();
00818
00819         if ( SUCCEEDED(hr) )
00820         {
00821             //
00822             // for each stream
00823             //
00824
00825             ITStream * pStream;
00826
00827             while ( S_OK == pEnumStreams->Next(1, &pStream, NULL) )
00828             {
00829                 ITTerminal * pTerminal;
00830
00831                 //
00832                 // Find out the media type and direction of this stream,
00833                 // and create the default terminal for this media type and
00834                 // direction.
00835                 //
00836
00837                 hr = GetTerminal(pAddress,
00838                                  pStream,
00839                                  &pTerminal);
00840
00841                 if ( SUCCEEDED(hr) )
00842                 {
00843                     //
00844                     // Select the terminal on the stream.
00845                     //
00846
00847                     hr = pStream->SelectTerminal(pTerminal);
00848
00849                     if ( SUCCEEDED(hr) )
00850                     {
00851                         //
00852                         // Also enable preview on the video capture stream.
00853                         //
00854
00855                         if ( IsVideoCaptureStream( pStream ) )
00856                         {
00857                             EnablePreview( pAddress, pStream );
00858                         }
00859                     }
00860
00861                     pTerminal->Release();
00862                 }
00863
00864                 pStream->Release();
00865             }
00866
00867             pEnumStreams->Release();
00868         }
00869     }
00870
00871     return hr;
00872 }
00873
00874 /////////////////////////////////////////////////////////////////////
00875 // Answer the call
00876 /////////////////////////////////////////////////////////////////////
00877
00878 HRESULT
00879 AnswerTheCall()
00880 {
00881     HRESULT                 hr;
00882     ITCallInfo *            pCallInfo;
00883     ITAddress *             pAddress;
00884
00885
00886
00887     if (NULL == gpCall)
00888     {
00889         return E_UNEXPECTED;
00890     }
00891
00892
00893     //
00894     // get the address object of this call
00895     //
00896
00897     hr = gpCall->QueryInterface( IID_ITCallInfo, (void**)&pCallInfo );
00898
00899     if ( FAILED(hr) )
00900     {
00901         gpCall->Release();
00902         gpCall = NULL;
00903
00904         return hr;
00905     }
00906
00907     hr = pCallInfo->get_Address( &pAddress );
00908
00909     pCallInfo->Release();
00910
00911     if ( FAILED(hr) )
00912     {
00913         gpCall->Release();
00914         gpCall = NULL;
00915
00916         return hr;
00917     }
00918
00919     //
00920     // Select our terminals on the call; if any of the selections fail
00921     // we proceed without that terminal
00922     //
00923
00924     hr = SelectTerminalsOnCall( pAddress, gpCall );
00925
00926     pAddress->Release();
00927
00928     //
00929     // Now we can actually answer the call
00930     //
00931
00932     hr = gpCall->Answer();
00933
00934     return hr;
00935 }
00936
00937 //////////////////////////////////////////////////////////////////////
00938 // DisconnectTheCall
00939 //
00940 // Disconnects the call
00941 //////////////////////////////////////////////////////////////////////
00942
00943 HRESULT
00944 DisconnectTheCall()
00945 {
00946     HRESULT         hr = S_OK;
00947
00948     if (NULL != gpCall)
00949     {
00950         hr = gpCall->Disconnect( DC_NORMAL );
00951
00952         // Do not release the call yet, as that would prevent
00953         // us from receiving the disconnected notification.
00954
00955         return hr;
00956     }
00957
00958     return S_FALSE;
00959 }
00960
00961 //////////////////////////////////////////////////////////////////////
00962 // ReleaseTheCall
00963 //
00964 // Releases the call
00965 //////////////////////////////////////////////////////////////////////
00966 void
00967 ReleaseTheCall()
00968 {
00969     if (NULL != gpCall)
00970     {
00971         gpCall->Release();
00972         gpCall = NULL;
00973     }
00974 }
00975
00976
00977 ///////////////////////////////////////////////////////////////////
00978 //
00979 // HELPER FUNCTIONS
00980 //
00981 ///////////////////////////////////////////////////////////////////
00982
00983
00984 ///////////////////////////////////////////////////////////////////
00985 // DoMessage
00986 ///////////////////////////////////////////////////////////////////
00987
00988 void
00989 DoMessage(
00990           LPWSTR pszMessage
00991          )
00992 {
00993     MessageBox(
00994                ghDlg,
00995                pszMessage,
00996                gszTapi30,
00997                MB_OK
00998               );
00999 }
01000
01001
01002 //////////////////////////////////////////////////////////////////
01003 // SetStatusMessage
01004 //////////////////////////////////////////////////////////////////
01005
01006 void
01007 SetStatusMessage(
01008                  LPWSTR pszMessage
01009                 )
01010 {
01011     SetDlgItemText(
01012                    ghDlg,
01013                    IDC_STATUS,
01014                    pszMessage
01015                   );
01016 }
01017
01018 ///////////////////////////////////////////////////////////////
01019 // EnableButton
01020 //
01021 // Enable, make default, and setfocus to a button
01022 ///////////////////////////////////////////////////////////////
01023
01024 void
01025 EnableButton(
01026              int ID
01027             )
01028 {
01029     SendDlgItemMessage(
01030                        ghDlg,
01031                        ID,
01032                        BM_SETSTYLE,
01033                        BS_DEFPUSHBUTTON,
01034                        0
01035                       );
01036     EnableWindow(
01037                  GetDlgItem( ghDlg, ID ),
01038                  TRUE
01039                 );
01040     SetFocus(
01041              GetDlgItem( ghDlg, ID )
01042             );
01043 }
01044
01045 //////////////////////////////////////////////////////////////
01046 // DisableButton
01047 //
01048 // Disable a button
01049 //////////////////////////////////////////////////////////////
01050
01051 void
01052 DisableButton(
01053               int ID
01054              )
01055 {
01056     SendDlgItemMessage(
01057                        ghDlg,
01058                        ID,
01059                        BM_SETSTYLE,
01060                        BS_PUSHBUTTON,
01061                        0
01062                       );
01063     EnableWindow(
01064                  GetDlgItem( ghDlg, ID ),
01065                  FALSE
01066                 );
01067 }
01068
01069 //////////////////////////////////////////////////////////////
01070 // AddressSupportsMediaType
01071 //
01072 // Finds out if the given address supports the given media
01073 // type, and returns TRUE if it does.
01074 //////////////////////////////////////////////////////////////
01075
01076 BOOL
01077 AddressSupportsMediaType(
01078                          ITAddress * pAddress,
01079                          long        lMediaType
01080                         )
01081 {
01082     VARIANT_BOOL     bSupport = VARIANT_FALSE;
01083     ITMediaSupport * pMediaSupport;
01084
01085     if ( SUCCEEDED( pAddress->QueryInterface( IID_ITMediaSupport,
01086                                               (void **)&pMediaSupport ) ) )
01087     {
01088         //
01089         // does it support this media type?
01090         //
01091
01092         pMediaSupport->QueryMediaType(
01093                                       lMediaType,
01094                                       &bSupport
01095                                      );
01096
01097         pMediaSupport->Release();
01098     }
01099
01100     return (bSupport == VARIANT_TRUE);
01101 }
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IRowsetChangeImpl< T, Storage, RowClass > Member List

This is the complete list of members for IRowsetChangeImpl< T, Storage, RowClass >, including all inherited members.
CreateHRow(LONG lRowsOffset, HROW *phRow) | IRowsetChangeImpl< T, Storage, RowClass > | [inline]
CreateRecord(ULONG &cRowsObtained, HROW *phRow) | IRowsetChangeImpl< T, Storage, RowClass > | [inline]
DeleteRows(HCHAPTER hReserved, ULONG cRows, const HROW __RPC_FAR rghRows[], DBROWSTATUS __RPC_FAR rgRowStatus[]) | IRowsetChangeImpl< T, Storage, RowClass > | [inline]
InsertRow(HCHAPTER hReserved, HACCESSOR hAccessor, void __RPC_FAR *pData, HROW __RPC_FAR *phRow) | IRowsetChangeImpl< T, Storage, RowClass > | [inline]
SetData(HROW hRow, HACCESSOR hAccessor, void __RPC_FAR *pData) | IRowsetChangeImpl< T, Storage, RowClass > | [inline]
Generated on Wed Nov 13 2024 16:57:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/NetMon/experts/blrplate/config.cpp Source File

  • NetDS
  • NetMon
  • experts
  • blrplate

config.cpp

Go to the documentation of this file.
00001 //============================================================================
00002 //  MODULE: Config.cpp
00003 //
00004 //  Description:
00005 //
00006 //  Handles the dialog for configuring the BLRPLATE Expert
00007 //
00008 //  Modification History:
00009 //
00010 //  Your Name Here      01/01/70    Created
00011 //============================================================================
00012 #define STRICT 1
00013 #include <windows.h>
00014 #include <windowsx.h>
00015 #include <netmon.h>
00016 #include "Resrc1.h"
00017 #include "BLRPLATE.h"
00018
00019 //////////////////////////////////////////////////////////////////////////////
00020 // Global Variables
00021
00022 HEXPERTKEY        g_hExpertKey;
00023 PBLRPLATECONFIG * g_ppBLRPLATEConfig;
00024
00025 //////////////////////////////////////////////////////////////////////////////
00026 // Forward Declarations
00027 BOOL CALLBACK ConfigBLRPLATEDlg_DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00028
00029 // input handlers
00030 BOOL ConfigBLRPLATEDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
00031 void ConfigBLRPLATEDlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
00032 void ConfigBLRPLATEDlg_OnOKButton( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
00033 void ConfigBLRPLATEDlg_OnCancelButton( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
00034 void ConfigBLRPLATEDlg_OnHelpButton( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
00035
00036 //////////////////////////////////////////////////////////////////////////////
00037 // ConfigBLRPLATEDlg_Do
00038 BOOL ConfigBLRPLATEDlg_Do(HWND hwnd,
00039                           PBLRPLATECONFIG * ppBLRPLATEConfig,
00040                           HEXPERTKEY hExpertKey)
00041 {
00042     // save the current struture
00043     g_hExpertKey = hExpertKey;
00044     g_ppBLRPLATEConfig = ppBLRPLATEConfig;
00045
00046     // create the dialog box...
00047     return DialogBox( g_hInstance,
00048                       MAKEINTRESOURCE(IDD_BLRPLATE_CONFIG_DIALOG),
00049                       hwnd,
00050                       (DLGPROC)ConfigBLRPLATEDlg_DlgProc);
00051 }
00052
00053 //////////////////////////////////////////////////////////////////////////////
00054 // ConfigBLRPLATEDlg_DlgProc
00055 BOOL CALLBACK ConfigBLRPLATEDlg_DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00056 {
00057     switch (msg)
00058     {
00059         HANDLE_MSG(hwnd, WM_INITDIALOG, ConfigBLRPLATEDlg_OnInitDialog);
00060         HANDLE_MSG(hwnd, WM_COMMAND,    ConfigBLRPLATEDlg_OnCommand);
00061
00062         // this makes the F1 key act like the Help key
00063         case WM_HELP:
00064             ConfigBLRPLATEDlg_OnHelpButton(hwnd, IDM_HELP, NULL, 0);
00065             break;
00066     }
00067     return(FALSE);
00068 }
00069
00070 //////////////////////////////////////////////////////////////////////////////
00071 // ConfigBLRPLATEDlg_OnInitDialog
00072 BOOL ConfigBLRPLATEDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
00073 {
00074     // TODO: Add initialization code
00075
00076     return TRUE;
00077 }
00078
00079 //////////////////////////////////////////////////////////////////////////////
00080 // ConfigBLRPLATEDlg_OnCommand
00081 void ConfigBLRPLATEDlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
00082 {
00083     switch(id)
00084     {
00085         // OK Button has been hit...
00086         case IDOK:
00087             ConfigBLRPLATEDlg_OnOKButton(hwnd, id, hwndCtl, codeNotify);
00088             break;
00089
00090         // Cancel button has been hit
00091         case IDCANCEL:
00092             ConfigBLRPLATEDlg_OnCancelButton(hwnd, id, hwndCtl, codeNotify);
00093             break;
00094
00095         case IDM_HELP:
00096             ConfigBLRPLATEDlg_OnHelpButton(hwnd, id, hwndCtl, codeNotify);
00097             break;
00098     }
00099 }
00100
00101 //////////////////////////////////////////////////////////////////////////////
00102 // ConfigBLRPLATEDlg_OnOKButton
00103 void ConfigBLRPLATEDlg_OnOKButton( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
00104 {
00105     DWORD BufferSize;
00106     DWORD rc;
00107
00108     // TODO: Validate dialog contents ----------------------------------------
00109     BufferSize = 1;
00110
00111     // TODO: Size the buffer -------------------------------------------------
00112     // do we have a config buffer?
00113     if( *g_ppBLRPLATEConfig == NULL )
00114     {
00115         // no, allocate one
00116         *g_ppBLRPLATEConfig = (PBLRPLATECONFIG)ExpertAllocMemory(
00117                                     g_hExpertKey,
00118                                     BufferSize,
00119                                     &rc);
00120         if( *g_ppBLRPLATEConfig == NULL )
00121         {
00122             return;
00123         }
00124     }
00125     else
00126     {
00127         // is the given buffer big enough
00128         if( (*g_ppBLRPLATEConfig)->nTotalLength < BufferSize )
00129         {
00130             PBLRPLATECONFIG TempConfig;
00131
00132             // no, we must grow it
00133             TempConfig = (PBLRPLATECONFIG)ExpertReallocMemory(
00134                                     g_hExpertKey,
00135                                     *g_ppBLRPLATEConfig,
00136                                     BufferSize,
00137                                     &rc);
00138             if( TempConfig == NULL )
00139             {
00140                 return;
00141             }
00142
00143             // it worked
00144             *g_ppBLRPLATEConfig = TempConfig;
00145         }
00146     }
00147
00148     // TODO: Fill in the Config ----------------------------------------------
00149
00150     // we are done
00151     EndDialog(hwnd, TRUE);
00152 }
00153
00154 //////////////////////////////////////////////////////////////////////////////
00155 // ConfigBLRPLATEDlg_OnCancelButton
00156 void ConfigBLRPLATEDlg_OnCancelButton( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
00157 {
00158     // TODO: Release any memory that you have allocated
00159
00160     // we are done
00161     EndDialog(hwnd, FALSE);
00162 }
00163
00164 //////////////////////////////////////////////////////////////////////////////
00165 // ConfigBLRPLATEDlg_OnHelpButton()
00166 void ConfigBLRPLATEDlg_OnHelpButton( HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
00167 {
00168     // TODO: bring up help
00169 }
00170
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/DimmerService.cpp Source File

  • NetDS
  • upnp
  • StepByStep
  • Step3

DimmerService.cpp

Go to the documentation of this file.
00001 // DimmerService.cpp : Implementation of CDimmerService
00002 #include "stdafx.h"
00003 #include "MyDevice.h"
00004 #include "DimmerService.h"
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // CDimmerService
00008
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/tracemacro.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

tracemacro.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This is a part of the MMC SDK.
00004 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  MMC SDK Reference and related electronic documentation
00009 //  provided with the library.
00010 //  See these sources for detailed information regarding the
00011 //  MMC Library product.
00012 //
00013 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00014 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00015 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00016 //  PURPOSE.
00017 //
00018 //  TraceMacro.h : Defines custom tracing helpers.
00019 //
00020
00021
00022 #ifndef _TRACE_MACRO_HEADER_
00023 #define _TRACE_MACRO_HEADER_
00024
00025 //---------------------------------------------------------------------------
00026 //  Function prototypes
00027 //
00028 VOID Trace_Start( LPCTSTR pszClass, LPCTSTR pszFunction );
00029 VOID Trace_HR( LPCTSTR pszClass, LPCTSTR pszFunction, HRESULT hr );
00030 VOID Trace_Value( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszValueName, LONG Value );
00031 VOID Trace_Event( LPCTSTR pszClass, LPCTSTR pszFunction, LONG nEvent );
00032 VOID MapEvent( LONG Event, LPTSTR szEventStr );
00033
00034
00035 // Alternate version provides complete path to the file
00036 // #define TRACE_HRESULT(str,hr)  Trace_HR( _T(__FILE__), (str), (hr) )
00037
00038 #ifdef _DEBUG
00039
00040 #undef  TRACE_HRESULT
00041 #define TRACE_HRESULT(s1,hr) Trace_HR( (MODULESTRING),(s1),(hr) )
00042
00043 #undef  TRACE_VAL
00044 #define TRACE_VAL(s1,s2,val) Trace_Value( (MODULESTRING),(s1),(s2),(val) )
00045
00046 #undef  TRACE_EVENT
00047 #define TRACE_EVENT(s1,val)  Trace_Event( (MODULESTRING),(s1),(val) )
00048
00049 #undef  TRACE_START
00050 #define TRACE_START( s1 )    Trace_Start( (MODULESTRING),(s1) )
00051
00052
00053 #else
00054
00055 #undef  TRACE_HRESULT
00056 #define TRACE_HRESULT
00057
00058 #undef  TRACE_VAL
00059 #define TRACE_VAL
00060
00061 #undef  TRACE_EVENT
00062 #define TRACE_EVENT
00063
00064 #undef  TRACE_START
00065 #define TRACE_START
00066
00067 #endif //_DEBUG
00068
00069
00070 #endif //_TRACE_MACRO_HEADER_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/dataobj.h Source File

  • SysMgmt
  • MMC
  • WMI

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097 BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
00098
00099 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAgentCtlCommandsEx Member List

This is the complete list of members for CAgentCtlCommandsEx, including all inherited members.
Add(LPCTSTR Name, const VARIANT &Caption, const VARIANT &Voice, const VARIANT &Enabled, const VARIANT &Visible) | CAgentCtlCommandsEx |
CAgentCtlCommandsEx() | CAgentCtlCommandsEx | [inline]
CAgentCtlCommandsEx(LPDISPATCH pDispatch) | CAgentCtlCommandsEx | [inline]
CAgentCtlCommandsEx(const CAgentCtlCommandsEx &dispatchSrc) | CAgentCtlCommandsEx | [inline]
Command(LPCTSTR Name) | CAgentCtlCommandsEx |
GetCaption() | CAgentCtlCommandsEx |
GetCount() | CAgentCtlCommandsEx |
GetDefaultCommand() | CAgentCtlCommandsEx |
GetFontName() | CAgentCtlCommandsEx |
GetFontSize() | CAgentCtlCommandsEx |
GetGlobalVoiceCommandsEnabled() | CAgentCtlCommandsEx |
GetHelpContextID() | CAgentCtlCommandsEx |
GetItem(LPCTSTR Name) | CAgentCtlCommandsEx |
GetVisible() | CAgentCtlCommandsEx |
GetVoice() | CAgentCtlCommandsEx |
GetVoiceCaption() | CAgentCtlCommandsEx |
Insert(LPCTSTR Name, LPCTSTR RefName, const VARIANT &Before, const VARIANT &Caption, const VARIANT &Voice, const VARIANT &Enabled, const VARIANT &Visible) | CAgentCtlCommandsEx |
Remove(LPCTSTR Name) | CAgentCtlCommandsEx |
RemoveAll() | CAgentCtlCommandsEx |
SetCaption(LPCTSTR lpszNewValue) | CAgentCtlCommandsEx |
SetDefaultCommand(LPCTSTR lpszNewValue) | CAgentCtlCommandsEx |
SetFontName(LPCTSTR lpszNewValue) | CAgentCtlCommandsEx |
SetFontSize(long nNewValue) | CAgentCtlCommandsEx |
SetGlobalVoiceCommandsEnabled(BOOL bNewValue) | CAgentCtlCommandsEx |
SetHelpContextID(long nNewValue) | CAgentCtlCommandsEx |
SetVisible(BOOL bNewValue) | CAgentCtlCommandsEx |
SetVoice(LPCTSTR lpszNewValue) | CAgentCtlCommandsEx |
SetVoiceCaption(LPCTSTR lpszNewValue) | CAgentCtlCommandsEx |
Generated on Wed Nov 13 2024 16:55:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/OHello/error.Cxx Source File

  • Com
  • Fundamentals
  • Object
  • OHello

error.Cxx

Go to the documentation of this file.
00001 /*+----------------------------------------------------------------------------
00002
00003 Microsoft Windows Sample Program
00004 Copyright 1994 - 2000 Microsoft Corporation.  All rights reserved.
00005
00006 FILE:       error.cxx
00007
00008 PURPOSE:    Demonstrates how to get the message text for an error code from
00009             the system resources.
00010
00011 FUNCTIONS:  PrintErrorMessage - Prints the message text for an error code.
00012
00013 -----------------------------------------------------------------------------*/
00014 #include <windows.h>
00015 #include <stdio.h>
00016
00017 //+---------------------------------------------------------------------------
00018 //
00019 //  Function:   PrintErrorMessage
00020 //
00021 //  Synopsis:   Prints the message text for the specified error code.
00022 //
00023 //  Notes:      PrintErrorMessage uses FormatMessage to get the message
00024 //              text from the system resources.
00025 //
00026 //----------------------------------------------------------------------------
00027 void PrintErrorMessage(HRESULT hr)
00028 {
00029   DWORD cMsgLen;
00030   char *pszErrorMessage = 0; /* buffer for message text from system */
00031
00032   /* get the text description for that error number from the system */
00033   cMsgLen = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
00034                           0,
00035                           (DWORD) hr,
00036                           MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
00037                           (LPTSTR) &pszErrorMessage,
00038                           512,
00039                           0);
00040
00041     if(cMsgLen > 0)
00042     {
00043         printf("Error %x: %s\n", hr, pszErrorMessage);
00044         LocalFree((HLOCAL) pszErrorMessage);
00045     }
00046     else
00047     {
00048         printf("Error %x\n", hr);
00049     }
00050 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/basesnap.h Source File

  • SysMgmt
  • MMC
  • Toolbar

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/comp.h Source File

  • SysMgmt
  • MMC
  • Complete

comp.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMP_H_
00020 #define _SAMPCOMP_H_
00021
00022 #include <mmc.h>
00023
00024 class CComponent : public IComponent,
00025 IExtendPropertySheet2, IExtendControlbar
00026 {
00027 private:
00028     ULONG       m_cref;
00029
00030     IConsole*   m_ipConsole;
00031     IControlbar*    m_ipControlBar;
00032     IToolbar*       m_ipToolbar;
00033
00034     class CComponentData *m_pComponentData;
00035
00036     public:
00037         CComponent(CComponentData *parent);
00038         ~CComponent();
00039
00040         ///////////////////////////////
00041         // Interface IUnknown
00042         ///////////////////////////////
00043         STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00044         STDMETHODIMP_(ULONG) AddRef();
00045         STDMETHODIMP_(ULONG) Release();
00046
00047         ///////////////////////////////
00048         // Interface IComponent
00049         ///////////////////////////////
00050         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00051             /* [in] */ LPCONSOLE lpConsole);
00052
00053             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00054             /* [in] */ LPDATAOBJECT lpDataObject,
00055             /* [in] */ MMC_NOTIFY_TYPE event,
00056             /* [in] */ LPARAM arg,
00057             /* [in] */ LPARAM param);
00058
00059             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
00060             /* [in] */ MMC_COOKIE cookie);
00061
00062             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00063             /* [in] */ MMC_COOKIE cookie,
00064             /* [in] */ DATA_OBJECT_TYPES type,
00065             /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00066
00067             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
00068             /* [in] */ MMC_COOKIE cookie,
00069             /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00070             /* [out] */ long __RPC_FAR *pViewOptions);
00071
00072             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00073             /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
00074
00075             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00076             /* [in] */ LPDATAOBJECT lpDataObjectA,
00077             /* [in] */ LPDATAOBJECT lpDataObjectB);
00078
00079             //////////////////////////////////
00080             // Interface IExtendPropertySheet2
00081             //////////////////////////////////
00082             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreatePropertyPages(
00083             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00084             /* [in] */ LONG_PTR handle,
00085             /* [in] */ LPDATAOBJECT lpIDataObject);
00086
00087             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryPagesFor(
00088             /* [in] */ LPDATAOBJECT lpDataObject);
00089
00090             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetWatermarks(
00091             /* [in] */ LPDATAOBJECT lpIDataObject,
00092             /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00093             /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00094             /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00095             /* [out] */ BOOL __RPC_FAR *bStretch);
00096
00097             ///////////////////////////////
00098             // Interface IExtendControlBar
00099             ///////////////////////////////
00100             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetControlbar(
00101             /* [in] */ LPCONTROLBAR pControlbar);
00102
00103             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ControlbarNotify(
00104             /* [in] */ MMC_NOTIFY_TYPE event,
00105             /* [in] */ LPARAM arg,
00106             /* [in] */ LPARAM param);
00107
00108     public:
00109         IToolbar *getToolbar() { return m_ipToolbar; }
00110
00111 };
00112
00113 #endif _SAMPCOMP_H_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPCMenuApp Member List

This is the complete list of members for CSCPCMenuApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CWinApp() | CWinApp |
ExitInstance() | CSCPCMenuApp | [virtual]
InitInstance() | CSCPCMenuApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:57:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/SCPProppage.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

SCPProppage.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       SCPProppage.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011
00012 // GUID's for Cclasses
00013
00014 extern const GUID CLSID_ProppageSCP;
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/filerepservice.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

filerepservice.cpp

Go to the documentation of this file.
00001 /*
00002
00003     File Replication Sample
00004     Server System Service
00005
00006     FILE: FileRepService.cpp
00007
00008     PURPOSE: Provides file replication services.
00009
00010     USAGE:
00011         FileRepService
00012
00013     FUNCTIONS:
00014         main() - calls the StartServiceCtrlDispatcher function to
00015             connect to the SCM and start the control dispatcher thread.
00016         ServiceMain() - the entry point for the service.
00017         ServiceCtrl() - this function is called by the dispatcher thread.
00018             It handles the control code passed to it.
00019         ServiceStart() - performs actual initialization and starts the service.
00020             Makes the RPC server listen for calls.
00021         ServiceStop() - stops listening for RPCs.
00022
00023     COMMENTS:
00024
00025 */
00026
00027 #define SECURITY_WIN32
00028
00029 #include <windows.h>
00030 #include <stdio.h>
00031 #include <stdlib.h>
00032 #include <process.h>
00033 #include <tchar.h>
00034 #include <rpc.h>
00035 #include <Ntdsapi.h>
00036 #include <Ntsecapi.h>
00037 #include <Security.h>
00038 #include <Secext.h>
00039 #include <Dsgetdc.h>
00040 #include <Lm.h>
00041
00042 // Generated by the MIDL compiler
00043 #include "FileRepServer.h"
00044 #include "FileRepClient.h"
00045
00046 // Contains declarations for system service functions.
00047 #include "Service.h"
00048
00049 #ifdef PROF
00050 #include "Prof.h"
00051 #endif
00052
00053 #ifdef DEBUG
00054 #include "DbgMsg.h"
00055 #endif
00056
00057 // Common definitions
00058 #include "common.h"
00059
00060 /*
00061     Internal funtion declarations.
00062     See definitions for more info.
00063 */
00064
00065 VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv);
00066
00067 VOID WINAPI ServiceCtrl(DWORD Opcode);
00068
00069 VOID ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
00070
00071 VOID ServiceStop();
00072
00073 /*
00074     Internal variables
00075 */
00076
00077 // status handle of the service
00078 SERVICE_STATUS_HANDLE sshStatusHandle;
00079
00080 // current status of the service
00081 SERVICE_STATUS ssStatus;
00082
00083 BOOL bServerListening = FALSE;
00084
00085 #ifdef PROF
00086 BOOL fProfOpenedLog = FALSE;
00087 #endif
00088
00089 #ifdef DEBUG
00090 BOOL fDbgMsgOpenedLog = FALSE;
00091 #endif
00092
00093 BOOL fServerReqCountersCreated = FALSE;
00094 BOOL fClientReqCountersCreated = FALSE;
00095 BOOL fClientActiveReqCountersCreated = FALSE;
00096
00097 BOOL fClientReqQueuesCreated = FALSE;
00098 BOOL fClientActiveReqHashQueuesCreated = FALSE;
00099 BOOL fClientActiveReqHashCountersCreated = FALSE;
00100
00101 /*
00102     FUNCTION: main()
00103
00104     PURPOSE: main() calls StartServiceCtrlDispatcher to register the
00105         main service thread.    When this call returns,
00106         the service has stopped.
00107
00108     PARAMETERS:
00109         dwArgc - number of command line arguments
00110         lpszArgv - array of command line arguments
00111
00112     RETURN VALUE:
00113         none
00114
00115     COMMENTS:
00116 */
00117 VOID _cdecl main(int argc, char **argv){
00118
00119     // Since we provide a single service there is only
00120     // one entry in the service dispatch table
00121     SERVICE_TABLE_ENTRY DispatchTable[] = {
00122         { SERVICENAME, (LPSERVICE_MAIN_FUNCTION)ServiceMain },
00123         { NULL, NULL }
00124     };
00125
00126     // The service control manager may be starting the service with
00127     // this call, so we must call StartServiceCtrlDispatcher.
00128     if (!StartServiceCtrlDispatcher(DispatchTable)) {
00129         AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed"));
00130     }
00131 }
00132
00133 /*
00134     FUNCTION: ServiceMain
00135
00136     PURPOSE: To perform actual initialization of the client service.    It
00137         is the entry point into the service.
00138
00139     PARAMETERS:
00140         dwArgc - number of command line arguments
00141         lpszArgv - array of command line arguments
00142
00143     RETURN VALUE:
00144         none
00145
00146     COMMENTS:
00147         This routine performs the service initialization and then calls
00148         the user defined ServiceStart() routine to perform majority
00149         of the work.
00150 */
00151 VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) {
00152
00153     // Initial service configuration
00154     ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
00155     ssStatus.dwCurrentState = SERVICE_START_PENDING;
00156     ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
00157     ssStatus.dwWin32ExitCode = 0;
00158     ssStatus.dwServiceSpecificExitCode = 0;
00159     ssStatus.dwCheckPoint = 0;
00160     ssStatus.dwWaitHint = 0;
00161
00162     sshStatusHandle = RegisterServiceCtrlHandler(SERVICENAME, ServiceCtrl);
00163
00164     // Tell the SCM that the service is starting up.
00165     if (!SetServiceStatus(sshStatusHandle, &ssStatus)) {
00166         AddToMessageLog(TEXT("ServiceMain: SetServiceStatus failed\n"));
00167         return;
00168     }
00169
00170     // Initialize the service and start it.
00171     ServiceStart(dwArgc, lpszArgv);
00172
00173     return;
00174 }
00175
00176 /*
00177     FUNCTION: ServiceCtrl
00178
00179     PURPOSE: This function is called by the SCM whenever
00180         ControlService() is called on this service.
00181
00182     PARAMETERS:
00183         dwCtrlCode - type of control requested
00184
00185     RETURN VALUE:
00186         none
00187
00188     COMMENTS:
00189 */
00190
00191 VOID WINAPI ServiceCtrl(DWORD Opcode) {
00192
00193     // We only handle the STOP control requsts.
00194     switch(Opcode) {
00195
00196         case SERVICE_CONTROL_STOP:
00197             // Stop the service.
00198             ServiceStop();
00199             break;
00200
00201         default:
00202             AddToMessageLog(TEXT("ServiceCtrl: unrecognized or unimplemented opcode\n"));
00203     }
00204
00205     return;
00206 }
00207
00208
00209 /*
00210     RPC configuration.
00211 */
00212
00213 // The service listens to all the protseqs listed in this array.
00214 // It listens for replication utilities on local RPC and for
00215 // remote requests on TCP/IP
00216 LPTSTR ServerProtocolArray[] = { TEXT("ncacn_ip_tcp"),
00217                                  TEXT("ncalrpc") };
00218
00219 // Used in RpcServerUseProtseq.
00220 // Specifies the maximum number of concurrent remote
00221 // procedure call requests the server wants to handle.
00222 ULONG cMaxCallsListen = RPC_C_PROTSEQ_MAX_REQS_DEFAULT;
00223
00224 // Similarly, but for RpcServerListen.
00225 ULONG cMaxCallsExecute = RPC_C_LISTEN_MAX_CALLS_DEFAULT;
00226
00227 // Used in RpcServerListen().  The minnimum number of threads listening.
00228 ULONG cMinimumThreads = 2;
00229
00230 RPC_BINDING_VECTOR * pBindingVector = NULL;
00231
00232 // Status variable for the RPC calls.
00233 RPC_STATUS status;
00234
00235 /*
00236     FUNCTION: RpcServerIfCallback
00237
00238     PURPOSE: Security callback funtion for the server interface
00239
00240     PARAMETERS:
00241         Interface - the UUID and version of the interface.
00242         Context - server binding handle representing the client.
00243
00244     RETURN VALUE:
00245         Returns RPC_S_OK if the client is allowed to call methods in this
00246         interface.  A different return code will cause the client to receive
00247         the exception RPC_S_ACCESS_DENIED.
00248
00249     COMMENTS:
00250
00251         Specifying a security-callback function allows the server application
00252         to restrict access to its interfaces on a per-client basis.
00253
00254         By default the server run time will dispatch unauthenticated calls
00255         even if the server has called RpcServerRegisterAuthInfo. If the
00256         server wants to accept only authenticated clients it must then call
00257         RpcBindingInqAuthClient to retrieve the security level, or attempt
00258         to impersonate the client with RpcImpersonateClient.
00259
00260         When a server application specifies a security-callback function
00261         for an interface, the RPC run time automatically rejects
00262         unauthenticated calls to that interface. In addition, the run-time
00263         records the interfaces that each client has used. When a client
00264         makes an RPC to an interface that it has not used during the
00265         current communication session, the RPC run-time library will
00266         call the interface's security-callback function.
00267
00268         In some cases, the RPC run time may call the security-callback
00269         function more than once per client, per interface.
00270
00271 */
00272 RPC_STATUS __stdcall RpcServerIfCallback (
00273   IN void *Interface,
00274   IN void *Context
00275 ) {
00276     ULONG ulAuthnLevel;
00277     ULONG ulAuthnSvc;
00278
00279     // Get client security info.
00280     if (RpcBindingInqAuthClient(Context,
00281         NULL,
00282         NULL,
00283         &ulAuthnLevel,
00284         &ulAuthnSvc,
00285         NULL) != RPC_S_OK) {
00286
00287         return RPC_S_ACCESS_DENIED;
00288     }
00289
00290     // Make sure the client has adequate security measures and uses the expected
00291     // security provider.
00292     if (ulAuthnLevel != RPC_C_AUTHN_LEVEL_PKT_PRIVACY || ulAuthnSvc != RPC_C_AUTHN_GSS_KERBEROS) {
00293
00294         return RPC_S_ACCESS_DENIED;
00295     }
00296
00297     return RPC_S_OK;
00298 };
00299
00300 /*
00301     FUNCTION: ServiceStart
00302
00303     PURPOSE: Actual code of the service
00304              that does the work.
00305
00306     PARAMETERS:
00307         dwArgc - number of command line arguments
00308         lpszArgv - array of command line arguments
00309
00310     RETURN VALUE:
00311         none
00312
00313     COMMENTS:
00314         Starts the service listening for RPC requests.
00315 */
00316 VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv){
00317
00318     UINT i;
00319
00320     // Report the status to the service control manager.
00321     if (!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_START_PENDING, NO_ERROR, 1000)) {
00322         AddToMessageLog(TEXT("ServiceStart: ReportStatusToSCMgr failed\n"));
00323         ServiceStop();
00324         return;
00325     }
00326
00327     // Service initialization
00328
00329     // Register the service interfaces.
00330
00331     // The server interface has a security callback RpcServerIfCallback.
00332     // The RPC run time will automatically reject unauthenticated calls to
00333     // this interface.
00334     status = RpcServerRegisterIfEx(s_FileRepServer_v1_0_s_ifspec,
00335            NULL,
00336            NULL,
00337            RPC_IF_ALLOW_SECURE_ONLY,
00338            RPC_C_LISTEN_MAX_CALLS_DEFAULT,
00339            &RpcServerIfCallback);
00340     if (status != RPC_S_OK){
00341             AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterIf(s_FileRepServer_v1_0_s_ifspec, ...)"), status);
00342         ServiceStop();
00343         return;
00344     }
00345
00346     status = RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, NULL, NULL);
00347     if (status != RPC_S_OK){
00348             AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, ...)"), status);
00349         ServiceStop();
00350         return;
00351     }
00352
00353     for (i = 0; i < sizeof(ServerProtocolArray)/sizeof(unsigned char *); i++) {
00354
00355         // Use the protocol sequences specified in ProtocolArray
00356         // for receiving RPCs.
00357         status = RpcServerUseProtseq((_TUCHAR *)ServerProtocolArray[i], cMaxCallsListen, NULL);
00358         if (status != RPC_S_OK){
00359             AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerUseProtseq"), status);
00360             ServiceStop();
00361             return;
00362         }
00363     }
00364
00365     // Obtain a binding vector for the server.
00366     status = RpcServerInqBindings(&pBindingVector);
00367     if (status != RPC_S_OK) {
00368         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerInqBindings"), status);
00369         ServiceStop();
00370         return;
00371     }
00372
00373     // Register the the services in the endpoint map
00374     // of the host computer.
00375     status = RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00376     if (status != RPC_S_OK){
00377         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, ...)"), status);
00378         ServiceStop();
00379         return;
00380     }
00381     status = RpcEpRegister(FileRepClient_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00382     if (status != RPC_S_OK){
00383         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcEpRegister(FileRepClient_v1_0_s_ifspec, ...)"), status);
00384         ServiceStop();
00385         return;
00386     }
00387
00388     // Message buffer.
00389     TCHAR Msg[MSG_SIZE];
00390
00391     // Array of generated SPNs.
00392     TCHAR **Spn;
00393     // Number of generated SPNs.
00394     ULONG ulSpn = 1;
00395
00396     PDOMAIN_CONTROLLER_INFO pDomainControllerInfo;
00397
00398     HANDLE hDS;
00399
00400     TCHAR lpCompDN[128];
00401     ULONG ulCompDNSize = sizeof(lpCompDN);
00402
00403     //
00404     // Set the security info for the client system service.
00405     //
00406
00407     // Principal name is NULL for local system service.
00408     status = RpcServerRegisterAuthInfo(NULL, RPC_C_AUTHN_WINNT, NULL, NULL);
00409     if (status != RPC_S_OK){
00410         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterAuthInfo"), status);
00411         ServiceStop();
00412         return;
00413     }
00414
00415     //
00416     // Set the security info for the server system service.
00417     //
00418
00419     BOOL NoFailure = TRUE;
00420
00421     // Generate the SPN.
00422     status = DsGetSpn(DS_SPN_NB_HOST, // Type of SPN to create.
00423                       SERVICENAME, // Service class
00424                       NULL, // DN of this service.
00425                       0, // Use the default instance port.
00426                       0, // Number of additional instance names.
00427                       NULL, // No additional instance names.
00428                       NULL, // No additional instance ports.
00429                       &ulSpn, // Size of SPN array.
00430                       &Spn); // Returned SPN(s).
00431     if (status != RPC_S_OK){
00432         _stprintf(Msg, TEXT("ServiceStart: DsGetSpn failed with code %d\n"), status);
00433         AddToMessageLog(Msg);
00434         ServiceStop();
00435         return;
00436     }
00437
00438     // Get the name of our domain.
00439     if (status = DsGetDcName(NULL,
00440                              NULL,
00441                              NULL,
00442                              NULL,
00443                              DS_RETURN_DNS_NAME,
00444                              &pDomainControllerInfo) != NO_ERROR) {
00445         _stprintf(Msg, TEXT("ServiceStart: DsGetDcName failed with code %d\n"), status);
00446         AddToMessageLog(Msg);
00447         NoFailure = FALSE;
00448     }
00449
00450     if (NoFailure) {
00451         // Bind to the domain controller for our domain.
00452         if ((status = DsBind(NULL,
00453                              pDomainControllerInfo->DomainName,
00454                              &hDS)) != ERROR_SUCCESS) {
00455             _stprintf(Msg, TEXT("ServiceStart: DsBind failed with code %d\n"), status);
00456             AddToMessageLog(Msg);
00457             NoFailure = FALSE;
00458         }
00459     }
00460
00461     if (NoFailure) {
00462         if ((status = NetApiBufferFree(pDomainControllerInfo)) != NERR_Success) {
00463             _stprintf(Msg, TEXT("ServiceStart: NetApiBufferFree failed with code %d\n"), status);
00464             AddToMessageLog(Msg);
00465             ServiceStop();
00466             return;
00467         }
00468
00469         if (GetComputerObjectName(NameFullyQualifiedDN, lpCompDN, &ulCompDNSize) == 0) {
00470             _stprintf(Msg, TEXT("ServiceStart: GetComputerObjectName failed with code %d\n"), GetLastError());
00471             AddToMessageLog(Msg);
00472             ServiceStop();
00473             return;
00474   }
00475
00476         // We could check whether the SPN is already registered for this
00477         // computer's DN, but we don't have to.  Modification is performed
00478         // permissively by this function, so that adding a value that already
00479         // exists does not return an error.  This way we can opt for the internal
00480         // check instead of doing it ourselves.
00481         status = DsWriteAccountSpn(hDS, DS_SPN_ADD_SPN_OP, lpCompDN, ulSpn, (LPCTSTR *)Spn);
00482         if (status != NO_ERROR) {
00483             _stprintf(Msg, TEXT("ServiceStart: DsWriteAccountSpn failed with code %d\n"), status);
00484             AddToMessageLog(Msg);
00485             return;
00486         }
00487         DsUnBind(&hDS);
00488     }
00489
00490     // We use Kerberos for authentication on the server.
00491     status = RpcServerRegisterAuthInfo(Spn[0], RPC_C_AUTHN_GSS_KERBEROS, NULL, NULL);
00492     if (status != RPC_S_OK){
00493         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterAuthInfo"), status);
00494         ServiceStop();
00495         return;
00496     }
00497
00498     // Don't forget to deallocate the principal name array.
00499     DsFreeSpnArray(ulSpn, Spn);
00500
00501     // Create the heap to be used by midl_user_allocate and midl_user_free
00502     RpcHeap = HeapCreate(0, RPC_HEAP_SIZE_INIT, RPC_HEAP_SIZE_MAX);
00503
00504 #ifdef DEBUG
00505     DbgMsgOpenLog(TEXT("c:\\logs\\FileRepService.dbg"));
00506     fDbgMsgOpenedLog = TRUE;
00507 #endif
00508
00509 #ifdef PROF
00510     ProfOpenLog(TEXT("c:\\logs\\FileRepService.prof"));
00511     fProfOpenedLog = TRUE;
00512 #endif
00513
00514     // Create counters to measure the number of concurrent
00515     // connections to the server system service.
00516     if (CountersCreate(pServerReqCounters, NumPriGroups, (UINT *) ServerReqBounds) == NULL) {
00517         AddToMessageLog(TEXT("ServiceStart: CountersCreate failed\n"));
00518         ServiceStop();
00519         return;
00520     }
00521     fServerReqCountersCreated = TRUE;
00522
00523     // Create the counters and queues for client system service
00524     // to store requests and request numbers.
00525     if (CountersCreate(pClientReqCounters, NumPriGroups, (UINT *) ClientReqBounds) == NULL) {
00526         AddToMessageLog(TEXT("ServiceStart: CountersCreate failed\n"));
00527         ServiceStop();
00528         return;
00529     }
00530     fClientReqCountersCreated = TRUE;
00531
00532     if (CountersCreate(pClientActiveReqCounters, NumPriGroups, (UINT *) ClientActiveReqBounds) == NULL) {
00533         AddToMessageLog(TEXT("ServiceStart: CountersCreate failed\n"));
00534         ServiceStop();
00535         return;
00536     }
00537     fClientActiveReqCountersCreated = TRUE;
00538
00539     if (QueuesCreate(ClientReqQueues, NumPriGroups, FALSE) == FALSE) {
00540         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00541         ServiceStop();
00542         return;
00543     }
00544     fClientReqQueuesCreated = TRUE;
00545
00546     if (QueuesCreate(ClientActiveReqHashQueues, NumPriGroups, FALSE) == FALSE) {
00547         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00548         ServiceStop();
00549         return;
00550     }
00551     fClientActiveReqHashQueuesCreated = TRUE;
00552
00553     if (QueuesCreate(ClientActiveReqHashCounters, NumPriGroups, FALSE) == FALSE) {
00554         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00555         ServiceStop();
00556         return;
00557     }
00558     fClientActiveReqHashCountersCreated = TRUE;
00559
00560     CreateWellKnownSids();
00561
00562     // Start accepting client calls.
00563     // The last argument's being 1 indicates that RpcServerListen
00564     // should return immediately after completing function processing.
00565     status = RpcServerListen(cMinimumThreads, cMaxCallsExecute, 1);
00566     if (status != RPC_S_OK){
00567         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerListen"), status);
00568         ServiceStop();
00569         return;
00570     }
00571
00572     bServerListening = TRUE;
00573
00574     // Tell The SCM that the service is running.
00575     if (!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_RUNNING, NO_ERROR, 0)){
00576         AddToMessageLog(TEXT("ServiceStart: ReportStatusToSCMgr failed"));
00577         ServiceStop();
00578         return;
00579     }
00580
00581     // End of initialization
00582
00583     // RpcMgmtWaitServerListen() will block until the server has
00584     // stopped listening.
00585     status = RpcMgmtWaitServerListen();
00586     if (status != RPC_S_OK){
00587         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcMgmtWaitServerListen"), status);
00588         ServiceStop();
00589         return;
00590     }
00591
00592     return;
00593 }
00594
00595
00596 /*
00597     FUNCTION: ServiceStop
00598
00599     PURPOSE: Stops a service
00600
00601     PARAMETERS:
00602         none
00603
00604     RETURN VALUE:
00605         none
00606
00607     COMMENTS:
00608
00609 */
00610 VOID ServiceStop() {
00611     RPC_STATUS status;
00612
00613     // Stops the server, wakes up the main thread.
00614     if (bServerListening) {
00615         status = RpcMgmtStopServerListening(NULL);
00616         if(status != RPC_S_OK) {
00617                     AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcMgmtWaitServerListen"), status);
00618         }
00619         bServerListening = FALSE;
00620     }
00621
00622     // Delete the binding vector.
00623     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
00624     if(status != RPC_S_OK){
00625         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerUnregisterIf"), status);
00626     }
00627
00628     // Tell The SCM that the service is stopped.
00629     if(!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_STOPPED, NO_ERROR, 0)) {
00630         AddToMessageLogProcFailure(TEXT("ServiceStop: ReportStatusToSCMgr"), GetLastError());
00631     }
00632
00633     // Wait for the client threads to finish so
00634     // that we do not deallocate active data structures.
00635     // We can accomplish this by waiting for the counters
00636     // to become zero.  Performing a check in this
00637     // order should prevent race conditions, since
00638     // pClientActiveReqCounters are incremented before
00639     // pClientReqCounters are decremented.
00640     if (fServerReqCountersCreated) {
00641         if (CountersCheckForNonzero(pServerReqCounters, NumPriGroups)) {
00642             Sleep(1000);
00643         }
00644     }
00645     if (fClientReqCountersCreated) {
00646         if (CountersCheckForNonzero(pClientReqCounters, NumPriGroups)) {
00647             Sleep(1000);
00648         }
00649     }
00650     if (fClientActiveReqCountersCreated) {
00651         if (CountersCheckForNonzero(pClientActiveReqCounters, NumPriGroups)) {
00652             Sleep(1000);
00653         }
00654     }
00655
00656     DeleteWellKnownSids();
00657
00658     // Delete queues and counters.
00659     if (fServerReqCountersCreated) {
00660         CountersDelete(pServerReqCounters, NumPriGroups);
00661         fServerReqCountersCreated = FALSE;
00662     }
00663     if (fClientReqCountersCreated) {
00664         CountersDelete(pClientReqCounters, NumPriGroups);
00665         fClientReqCountersCreated = FALSE;
00666     }
00667     if (fClientActiveReqCountersCreated) {
00668         CountersDelete(pClientActiveReqCounters, NumPriGroups);
00669         fClientActiveReqCountersCreated = FALSE;
00670     }
00671     if (fClientReqQueuesCreated) {
00672         QueuesDelete(ClientReqQueues, NumPriGroups);
00673         fClientReqQueuesCreated = FALSE;
00674     }
00675     if (fClientActiveReqHashQueuesCreated) {
00676         QueuesDelete(ClientActiveReqHashQueues, NumPriGroups);
00677         fClientActiveReqHashQueuesCreated = FALSE;
00678     }
00679     if (fClientActiveReqHashCountersCreated) {
00680         QueuesDelete(ClientActiveReqHashCounters, NumPriGroups);
00681         fClientActiveReqHashCountersCreated = FALSE;
00682     }
00683
00684 #ifdef PROF
00685     if (fProfOpenedLog) {
00686         ProfCloseLog();
00687         fProfOpenedLog = FALSE;
00688     }
00689 #endif
00690
00691 #ifdef DEBUG
00692     if (fDbgMsgOpenedLog) {
00693         DbgMsgCloseLog();
00694         fDbgMsgOpenedLog = FALSE;
00695     }
00696 #endif
00697
00698 }
00699
00700 // end FileRepService.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProvider_IWbemEventProvider Member List

This is the complete list of members for CProvider_IWbemEventProvider, including all inherited members.
CProvider_IWbemEventProvider() | CProvider_IWbemEventProvider |
Initialize(LPWSTR a_User, LONG a_Flags, LPWSTR a_Namespace, LPWSTR a_Locale, IWbemServices *a_Core, IWbemContext *a_Context, IWbemProviderInitSink *a_Sink) | CProvider_IWbemEventProvider |
m_CoreService | CProvider_IWbemEventProvider | [private]
m_CriticalSection | CProvider_IWbemEventProvider | [private]
m_EventObject | CProvider_IWbemEventProvider | [private]
m_EventSink | CProvider_IWbemEventProvider | [private]
m_InternalReferenceCount | CProvider_IWbemEventProvider | [private]
m_Locale | CProvider_IWbemEventProvider | [private]
m_Namespace | CProvider_IWbemEventProvider | [private]
m_ReferenceCount | CProvider_IWbemEventProvider | [private]
m_ThreadHandle | CProvider_IWbemEventProvider | [private]
m_ThreadTerminate | CProvider_IWbemEventProvider | [private]
m_User | CProvider_IWbemEventProvider | [private]
ProvideEvents(IWbemObjectSink *a_Sink, LONG a_Flags) | CProvider_IWbemEventProvider |
QueryInterface(REFIID, LPVOID FAR *) | CProvider_IWbemEventProvider |
Shutdown(LONG a_Flags, ULONG a_MaxMilliSeconds, IWbemContext *a_Context) | CProvider_IWbemEventProvider |
STDMETHODIMP_(ULONG) InternalAddRef() | CProvider_IWbemEventProvider |
STDMETHODIMP_(ULONG) InternalRelease() | CProvider_IWbemEventProvider |
STDMETHODIMP_(ULONG) AddRef() | CProvider_IWbemEventProvider |
STDMETHODIMP_(ULONG) Release() | CProvider_IWbemEventProvider |
ThreadExecutionFunction(void *a_Context) | CProvider_IWbemEventProvider | [private, static]
~CProvider_IWbemEventProvider() | CProvider_IWbemEventProvider |
Generated on Wed Nov 13 2024 16:57:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authentication/AuthenticatePlugin.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Authentication

AuthenticatePlugin.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       AuthenticatePlugin.cpp
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #include "stdafx.h"
00013 #include "Authenticate.h"
00014 #include "AuthenticatePlugin.h"
00015 #include "AuthenticateAdmin.h"
00016 #include "AuthenticateContext.h"
00017
00018 #define PACKET_NAME     "MyPackage"
00019 #define PROTOCOL_NAME   "Anonymous User"
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 /////////////////////////////////////////////////////////////////////////////
00023 CAuthenticatePlugin::CAuthenticatePlugin()
00024 {
00025 }
00026
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 /////////////////////////////////////////////////////////////////////////////
00030 CAuthenticatePlugin::~CAuthenticatePlugin()
00031 {
00032 }
00033
00034
00035 /////////////////////////////////////////////////////////////////////////////
00036 /////////////////////////////////////////////////////////////////////////////
00037 STDMETHODIMP CAuthenticatePlugin::InitializePlugin
00038 (
00039     IWMSContext *pServerContext,
00040     IWMSNamedValues *pNamedValues,
00041     IWMSClassObject *pClassFactory
00042 )
00043 {
00044     if( ( NULL == pServerContext )
00045         || ( NULL == pNamedValues )
00046         || ( NULL == pClassFactory ) )
00047     {
00048         return( E_INVALIDARG );
00049     }
00050
00051     HRESULT hr = S_OK;
00052
00053     if( NULL != pNamedValues )
00054     {
00055         m_spNamedValues = pNamedValues;
00056     }
00057
00058     // TODO: Add any additional initialization here
00059
00060     return( hr );
00061 }
00062
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 /////////////////////////////////////////////////////////////////////////////
00066 STDMETHODIMP CAuthenticatePlugin::EnablePlugin
00067 (
00068     long *pdwFlags,
00069     long *pdwHeartbeatPeriod
00070 )
00071 {
00072     if( NULL == pdwFlags || NULL == pdwHeartbeatPeriod )
00073     {
00074         return( E_POINTER );
00075     }
00076
00077     HRESULT hr = S_OK;
00078
00079     // Set the heartbeat period in milliseconds
00080     *pdwHeartbeatPeriod = 0000;
00081
00082     return( hr );
00083 }
00084
00085
00086 /////////////////////////////////////////////////////////////////////////////
00087 /////////////////////////////////////////////////////////////////////////////
00088 STDMETHODIMP CAuthenticatePlugin::DisablePlugin()
00089 {
00090     HRESULT hr = S_OK;
00091
00092     // TODO: Add any additional code here
00093
00094     return( hr );
00095 }
00096
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 /////////////////////////////////////////////////////////////////////////////
00100 STDMETHODIMP CAuthenticatePlugin::ShutdownPlugin()
00101 {
00102     HRESULT hr = S_OK;
00103
00104     m_spNamedValues = NULL;
00105
00106     // TODO: Add any additional code here
00107
00108     return( hr );
00109 }
00110
00111
00112 /////////////////////////////////////////////////////////////////////////////
00113 /////////////////////////////////////////////////////////////////////////////
00114 STDMETHODIMP CAuthenticatePlugin::OnHeartbeat()
00115 {
00116     HRESULT hr = S_OK;
00117
00118     // TODO: Add code that should execute on every Heartbeat Period
00119
00120     return( hr );
00121 }
00122
00123
00124 /////////////////////////////////////////////////////////////////////////////
00125 /////////////////////////////////////////////////////////////////////////////
00126 STDMETHODIMP CAuthenticatePlugin::GetCustomAdminInterface
00127 (
00128     IDispatch **ppValue
00129 )
00130 {
00131     if( ( NULL == ppValue ) )
00132     {
00133         return( E_POINTER );
00134     }
00135
00136     HRESULT hr = S_OK;
00137
00138     *ppValue = NULL;
00139
00140     CComObject<CAuthenticateAdmin> *pAuthenticateAdmin = NULL;
00141
00142     hr = CComObject<CAuthenticateAdmin>::CreateInstance( &pAuthenticateAdmin );
00143
00144     if( SUCCEEDED( hr ) )
00145     {
00146         pAuthenticateAdmin->AddRef();
00147         hr = pAuthenticateAdmin->Initialize( this );
00148     }
00149
00150     if( SUCCEEDED(hr) )
00151     {
00152         hr = pAuthenticateAdmin->QueryInterface( IID_IDispatch, (void **) ppValue );
00153     }
00154
00155     if( NULL != pAuthenticateAdmin )
00156     {
00157         pAuthenticateAdmin->Release();
00158     }
00159
00160     return( hr );
00161 }
00162
00163
00164 /////////////////////////////////////////////////////////////////////////////
00165 /////////////////////////////////////////////////////////////////////////////
00166 STDMETHODIMP CAuthenticatePlugin::GetPackageName
00167 (
00168     BSTR *PackageName
00169 )
00170 {
00171     if( NULL == PackageName )
00172     {
00173         return( E_POINTER );
00174     }
00175
00176     HRESULT hr = S_OK;
00177
00178     *PackageName = SysAllocString( _T( PACKET_NAME ) );
00179
00180     if( NULL == *PackageName )
00181     {
00182         hr = E_OUTOFMEMORY;
00183     }
00184
00185     return( hr );
00186 }
00187
00188
00189 /////////////////////////////////////////////////////////////////////////////
00190 /////////////////////////////////////////////////////////////////////////////
00191 STDMETHODIMP CAuthenticatePlugin::GetProtocolName
00192 (
00193     BSTR *ProtocolName
00194 )
00195 {
00196     if( NULL == ProtocolName )
00197     {
00198         return( E_POINTER );
00199     }
00200
00201     HRESULT hr = S_OK;
00202
00203     *ProtocolName = SysAllocString( _T( PROTOCOL_NAME ) );
00204
00205     if( NULL == *ProtocolName )
00206     {
00207         hr = E_OUTOFMEMORY;
00208     }
00209
00210     return( hr );
00211 }
00212
00213
00214 /////////////////////////////////////////////////////////////////////////////
00215 /////////////////////////////////////////////////////////////////////////////
00216 STDMETHODIMP CAuthenticatePlugin::GetFlags
00217 (
00218     long *Flags
00219 )
00220 {
00221     if( NULL == Flags )
00222     {
00223         return( E_POINTER );
00224     }
00225
00226     HRESULT hr = S_OK;
00227
00228     *Flags = WMS_AUTHENTICATION_ANONYMOUS;
00229
00230     return( hr );
00231 }
00232
00233
00234 ///////////////////////////////////////////////////////////////////////////////
00235 ///////////////////////////////////////////////////////////////////////////////
00236 STDMETHODIMP CAuthenticatePlugin::CreateAuthenticationContext
00237 (
00238     IWMSAuthenticationContext **ppAuthenCtx
00239 )
00240 {
00241     if( NULL == ppAuthenCtx )
00242     {
00243         return( E_POINTER );
00244     }
00245
00246     HRESULT hr = S_OK;
00247
00248     CComObject<CAuthenticateContext> *pAuthenticateContext = NULL;
00249
00250     if( SUCCEEDED( hr ) )
00251     {
00252         hr = CComObject<CAuthenticateContext>::CreateInstance( &pAuthenticateContext );
00253     }
00254
00255     if( SUCCEEDED( hr ) )
00256     {
00257         pAuthenticateContext->AddRef();
00258         hr = pAuthenticateContext->Initialize( this );
00259     }
00260
00261     if( SUCCEEDED( hr ) )
00262     {
00263         hr = pAuthenticateContext->QueryInterface( IID_IWMSAuthenticationContext, (void **) ppAuthenCtx );
00264     }
00265
00266     if( NULL != pAuthenticateContext )
00267     {
00268         pAuthenticateContext->Release();
00269     }
00270
00271     return( hr );
00272 }
00273
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/dataobj.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

dataobj.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "DataObj.h"
00016 #include "StaticNode.h"
00017
00018                              // Tracing stuff
00019 #include "TraceMacro.h"
00020 #undef  MODULESTRING
00021 #define MODULESTRING  _T("CDataObject")
00022
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // Construction/Destruction
00026
00027
00028 CDataObject::CDataObject()
00029 {
00030   m_cRef     = 0;
00031   m_uCookie  = 0;
00032   m_uContext = 0;
00033
00034 }
00035
00036 CDataObject::~CDataObject()
00037 {
00038 }
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // IUnknown implementation
00042
00043 //---------------------------------------------------------------------------
00044 STDMETHODIMP CDataObject::QueryInterface
00045 (
00046   REFIID   riid,
00047   LPVOID*  ppv
00048 )
00049 {
00050   if( !ppv )
00051     return E_FAIL;
00052
00053   HRESULT hResult = E_NOINTERFACE;
00054   *ppv = NULL;
00055
00056   if( IsEqualIID(riid, IID_IUnknown) )
00057     *ppv = static_cast<IDataObject*>(this);
00058   else if( IsEqualIID(riid, IID_IDataObject) )
00059     *ppv = static_cast<IDataObject*>(this);
00060
00061   if( *ppv )
00062   {
00063     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00064     hResult = S_OK;
00065   }
00066
00067   return hResult;
00068 }
00069
00070 //---------------------------------------------------------------------------
00071 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00072 {
00073   return InterlockedIncrement((LONG*)&m_cRef);
00074 }
00075
00076 //---------------------------------------------------------------------------
00077 STDMETHODIMP_(ULONG) CDataObject::Release()
00078 {
00079   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00080   {
00081     delete this;
00082     return 0;
00083   }
00084   return m_cRef;
00085 }
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 // IDataObject implementation
00089 //
00090
00091 //---------------------------------------------------------------------------
00092 //  MMC will call GetDataHere() for it's required clipboard formats
00093 //
00094 HRESULT CDataObject::GetDataHere
00095 (
00096   FORMATETC* pFormatEtc,     //[in]  Pointer to the FORMATETC structure
00097   STGMEDIUM* pStgMedium      //[out] Pointer to the STGMEDIUM structure
00098 )
00099 {
00100   const CLIPFORMAT cf = pFormatEtc->cfFormat;
00101   IStream* ipStream = NULL;
00102
00103   HRESULT hResult = CreateStreamOnHGlobal( pStgMedium->hGlobal, FALSE, &ipStream );
00104   if( S_OK != hResult )
00105     return hResult;                        // Minimal error checking
00106
00107   hResult = DV_E_FORMATETC;                // Unknown format
00108
00109   if( cf == g_cfDisplayName )
00110   {
00111     hResult = RetrieveDisplayString( ipStream );
00112   }
00113   else if( cf == g_cfSnapinClsid )
00114   {
00115     hResult = RetrieveSnapInClassID( ipStream );
00116   }
00117   else if( cf == g_cfNodeType )
00118   {
00119     hResult = RetrieveNodeTypeGuid( ipStream );
00120   }
00121   else if( cf == g_cfszNodeType )
00122   {
00123     hResult = RetrieveGuidString( ipStream );
00124   }
00125   else if( cf == g_cfBaseNodePtr )
00126   {
00127     hResult = RetrieveBaseNodePtr( ipStream );
00128   }
00129   else if( cf == g_cfDataObjPtr )
00130   {
00131     hResult = RetrieveDataObjPtr( ipStream );
00132   }
00133
00134   ipStream->Release();
00135
00136   return hResult;
00137 }
00138
00139 //---------------------------------------------------------------------------
00140 HRESULT CDataObject::GetData
00141 (
00142   FORMATETC* pFormatEtc,     //[in]  Pointer to the FORMATETC structure
00143   STGMEDIUM* pStgMedium      //[out] Pointer to the STGMEDIUM structure
00144 )
00145 {
00146   HRESULT hResult = DV_E_FORMATETC;
00147
00148   do
00149   {
00150     if( g_cfNodeAttrPtr == pFormatEtc->cfFormat )
00151     {
00152       hResult = RetrieveNodeAttribs( pStgMedium );
00153     }
00154   }while(0);
00155
00156   return hResult;
00157 }
00158
00159
00160 //---------------------------------------------------------------------------
00161 VOID CDataObject::SetPrivateData
00162 (
00163   ULONG  uCookie,      //[in] Pointer to node this object represents
00164   ULONG  uContext      //[in] Context of the node
00165 )
00166 {
00167   m_uCookie  = uCookie;
00168   m_uContext = uContext;
00169 }
00170
00171 /////////////////////////////////////////////////////////////////////////////
00172 //  Handlers for MMC's required clipboard formats
00173
00174
00175 //---------------------------------------------------------------------------
00176 // CCF_DISPLAY_NAME is one of the required clipformats.
00177 // MMC askes for this string to display the name of the SnapIn's StaticNode
00178 // in the ScopePane
00179 //
00180 HRESULT CDataObject::RetrieveDisplayString
00181 (
00182   IStream* ipStream        //[in][out] Stream to return our data in.
00183 )
00184 {
00185   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00186   LPWSTR pNodeName = pNode->GetNodeName();
00187
00188   ULONG ulSizeofName = (wcslen(pNodeName) + 1) * sizeof(WCHAR);
00189   return ipStream->Write(pNodeName, ulSizeofName, NULL);
00190
00191 }
00192
00193 //---------------------------------------------------------------------------
00194 //  CCF_SNAPIN_CLASSID is one of the required clipformats.
00195 //  MMC will ask for this data.  This ClassID which we return represents
00196 //  the COM object which is the entry point for our SnapIn
00197 //
00198 HRESULT CDataObject::RetrieveSnapInClassID
00199 (
00200   IStream* ipStream        //[in][out] Stream to return our data in.
00201 )
00202 {
00203   return ipStream->Write( &CLSID_CComponentData, sizeof(GUID), NULL );
00204 }
00205
00206
00207 //---------------------------------------------------------------------------
00208 //  CCF_NODETYPE is one of the required clipformats.
00209 //  MMC needs the NodeType GUID to determine what extensions to activate
00210 //  for a node.  It looks under the MMC/NodeTypes registry key for the GUID
00211 //  and enumerates the extensions found beneath it.  MMC uses this GUID
00212 //  strictly as a uniquie identifier.  It does not expect it to correspond
00213 //  to the ClaseID of a com object.
00214 //
00215 HRESULT CDataObject::RetrieveNodeTypeGuid
00216 (
00217   IStream* ipStream        //[in][out] Stream to return our data in.
00218 )
00219 {
00220   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00221   GUID* pGuid = (GUID*)&pNode->GetNodeGUID();
00222
00223   return ipStream->Write( (void*)pGuid, sizeof(GUID), NULL );
00224 }
00225
00226
00227 //---------------------------------------------------------------------------
00228 //  CCF_SZNODETYPE is a required clipboard format.
00229 //  We return the node's GUID as a wide string.
00230 //
00231 HRESULT CDataObject::RetrieveGuidString
00232 (
00233   IStream* ipStream        //[in][out] Stream to return our data in.
00234 )
00235 {
00236   LPOLESTR pszGUID;
00237   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00238
00239   HRESULT  hResult = StringFromCLSID( pNode->GetNodeGUID(), &pszGUID );
00240   if( S_OK == hResult )
00241   {
00242     hResult = ipStream->Write( pszGUID, (wcslen(pszGUID) + 1) * sizeof(WCHAR), NULL );
00243     CoTaskMemFree( pszGUID );
00244   }
00245
00246   return hResult;
00247 }
00248
00249 //---------------------------------------------------------------------------
00250 HRESULT CDataObject::RetrieveBaseNodePtr
00251 (
00252   IStream* ipStream        //[in][out] Stream to return our data in.
00253 )
00254 {
00255   LPBASENODE pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00256   return ipStream->Write( &pNode, sizeof(LPBASENODE), NULL );
00257 }
00258
00259 //---------------------------------------------------------------------------
00260 HRESULT CDataObject::RetrieveDataObjPtr
00261 (
00262   IStream* ipStream        //[in][out] Stream to return our data in.
00263 )
00264 {
00265   CDataObject* pThis = this;
00266   return ipStream->Write( &pThis, sizeof(CDataObject*), NULL );
00267 }
00268
00269
00270 //---------------------------------------------------------------------------
00271 //  XPROPPAGE:  New method to support CCF_ATTRIB_PTR
00272 //
00273 HRESULT CDataObject::RetrieveNodeAttribs
00274 (
00275   STGMEDIUM* pStgMedium      //[out] Pointer to the STGMEDIUM structure
00276 )
00277 {
00278   HRESULT     hResult = S_OK;
00279   LPBASENODE  pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00280
00281   DWORD dwSize = sizeof(NODE_ATTRIBS);   //BUGLIST:
00282
00283   HGLOBAL hMem = NULL;
00284   hMem = GlobalAlloc( GMEM_SHARE | GMEM_MOVEABLE, sizeof(NODE_ATTRIBS));
00285   if( NULL == hMem )
00286     hResult = E_OUTOFMEMORY;
00287   else
00288   {
00289     // Set our properties to hGlobal in the StgMedium
00290     NODE_ATTRIBS* pNodeAttribs = NULL;
00291     pNodeAttribs = (NODE_ATTRIBS*)GlobalLock( hMem );
00292
00293     wcscpy( pNodeAttribs->szObjectPath, pNode->GetObjectPath() );
00294
00295     GlobalUnlock( hMem );                  // Unlock and set the rest of the
00296     pStgMedium->hGlobal        = hMem;     // StgMedium variables
00297     pStgMedium->tymed          = TYMED_HGLOBAL;
00298     pStgMedium->pUnkForRelease = NULL;
00299   }
00300
00301   //Just for testing
00302   //NODE_ATTRIBS* pTestAttribs = NULL;
00303   //pTestAttribs = reinterpret_cast<NODE_ATTRIBS*>(hMem);
00304   //pTestAttribs = (NODE_ATTRIBS*)GlobalLock(hMem);
00305
00306
00307   return hResult;
00308 }
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/Getpdriv.h Source File

  • Multimedia
  • Gdi
  • Printer

Getpdriv.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /******************************************************************************\
00013 *
00014 *                               GETPDRIV.H
00015 *
00016 \******************************************************************************/
00017
00018 /******************************************************************************\
00019 *                           SYMBOLIC CONSTANTS
00020 \******************************************************************************/
00021
00022 #define ERR_MOD_NAME        IDS_ERR_GETPDRIV
00023
00024
00025
00026 /******************************************************************************\
00027 *                            GLOBAL VARIABLES
00028 \******************************************************************************/
00029
00030 char *gaDrvInfo[] =
00031
00032     {   "DRIVER_INFO_1",
00033         "  pName\t\t%s",
00034
00035         "DRIVER_INFO_2",
00036         "  cVersion\t%ld",
00037         "  pName\t\t%s",
00038         "  pEnvironment\t%s",
00039         "  pDriverPath\t%s",
00040         "  pDataFile\t%s",
00041         "  pConfigFile\t%s" };
00042
00043
00044
00045 /******************************************************************************\
00046 *                          EXTERNAL VARIABLES
00047 \******************************************************************************/
00048
00049 extern HWND ghwndMain;
00050 extern char gszDeviceName [];
00051 extern char gszDriverName [];
00052 extern char gszPort       [];
00053
00054
00055
00056 /******************************************************************************\
00057 *                               MACROS
00058 \******************************************************************************/
00059
00060 #define outstr()  SendDlgItemMessage (hwnd, DID_LISTBOX, LB_INSERTSTRING, \
00061                                       (WPARAM)-1, (LPARAM) buf);
00062
00063
00064
00065 /******************************************************************************\
00066 *                          FUNCTION PROTOTYPES
00067 \******************************************************************************/
00068
00069 BOOL DisplayPrinterDriverInfo (HWND);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/ctrace.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

ctrace.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CTRACE.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011
00012 /////////////////////////////////////////////////////////////////
00013 // Includes
00014 //
00015 /////////////////////////////////////////////////////////////////
00016 #include "Headers.h"
00017 #include "CTrace.h"
00018
00019
00020 ////////////////////////////////////////////////////////////////
00021 // CIntTrace::CIntTrace
00022 //
00023 /////////////////////////////////////////////////////////////////
00024 CIntTrace::CIntTrace(CMainWindow* pCMainWindow)
00025 {
00026   //Data
00027   ASSERT(pCMainWindow);
00028   m_pCMainWindow    = pCMainWindow;
00029
00030   //TraceProvider
00031   m_ulNestingLevel      = 0;
00032 }
00033
00034
00035 ////////////////////////////////////////////////////////////////
00036 // CIntTrace::~CIntTrace
00037 //
00038 /////////////////////////////////////////////////////////////////
00039 CIntTrace::~CIntTrace()
00040 {
00041 }
00042
00043
00044 ////////////////////////////////////////////////////////////////
00045 // CIntTrace::GetOptions
00046 //
00047 /////////////////////////////////////////////////////////////////
00048 COptionsSheet*  CIntTrace::GetOptions()
00049 {
00050   return m_pCMainWindow->GetOptions();
00051 }
00052
00053
00054 ////////////////////////////////////////////////////////////////
00055 // CIntTrace::OnRButtonDown
00056 //
00057 /////////////////////////////////////////////////////////////////
00058 BOOL CIntTrace::OnRButtonDown(WPARAM fwKeys, REFPOINTS pts)
00059 {
00060   //NOTE: The right mouse button doesn't automatically activate the MDI window...
00061   m_pCMainWindow->MDIActivate(m_hWndParent);
00062
00063   //xPos, yPos are Relative to the Client Area...
00064   DisplayContextMenu(
00065             m_hWnd,
00066             IDM_NOTIFYMENU,
00067             pts,
00068             m_pCMainWindow->GetWnd(),
00069             TRUE
00070             );
00071   return TRUE;
00072 }
00073
00074 ////////////////////////////////////////////////////////////////
00075 // CIntTrace::OnContextMenu
00076 //
00077 /////////////////////////////////////////////////////////////////
00078 BOOL CIntTrace::OnContextMenu(HWND hWnd, REFPOINTS pts)
00079 {
00080   DisplayContextMenu(
00081             hWnd,
00082             IDM_NOTIFYMENU,
00083             pts,
00084             m_pCMainWindow->GetWnd()
00085             );
00086   return  TRUE;
00087 }
00088
00089
00090 /////////////////////////////////////////////////////////////////////////////
00091 // CIntTrace::OnUpdateCommand
00092 //
00093 /////////////////////////////////////////////////////////////////////////////
00094 BOOL CIntTrace::OnUpdateCommand(HMENU hMenu, UINT nID, DWORD* pdwFlags)
00095 {
00096   switch(nID)
00097   {
00098     //Editing
00099     ON_COMMAND_UI_ENABLED(IDM_CLEARNOTIFYWINDOW,      TRUE)
00100     ON_COMMAND_UI_ENABLED(IDM_COPYNOTIFYWINDOW,       OnUpdateOutputSelected())
00101
00102     //Notifications
00103     ON_COMMAND_UI_CHECKED(IDM_NOTIFY_S_OK,          m_pCMainWindow->m_pCListener->GetReturnValue() == S_OK)
00104     ON_COMMAND_UI_CHECKED(IDM_NOTIFY_S_FALSE,       m_pCMainWindow->m_pCListener->GetReturnValue() == S_FALSE)
00105     ON_COMMAND_UI_CHECKED(IDM_NOTIFY_S_UNWANTEDPHASE,   m_pCMainWindow->m_pCListener->GetReturnValue() == DB_S_UNWANTEDPHASE)
00106     ON_COMMAND_UI_CHECKED(IDM_NOTIFY_S_UNWANTEDREASON,    m_pCMainWindow->m_pCListener->GetReturnValue() == DB_S_UNWANTEDREASON)
00107     ON_COMMAND_UI_CHECKED(IDM_NOTIFY_E_FAIL,        m_pCMainWindow->m_pCListener->GetReturnValue() == E_FAIL)
00108   };
00109
00110   return FALSE;
00111 }
00112
00113
00114 /////////////////////////////////////////////////////////////////////////////
00115 // CIntTrace::OnUpdateOutputSelected
00116 //
00117 /////////////////////////////////////////////////////////////////////////////
00118 BOOL CIntTrace::OnUpdateOutputSelected()
00119 {
00120   INDEX iStartPos = 0;
00121   INDEX iEndPos = 0;
00122
00123   //Cut/Copy is only enabled - if something is selected.
00124   SendMessage(m_hWnd, EM_GETSEL, (WPARAM)&iStartPos, (LPARAM)&iEndPos);
00125   return iStartPos != iEndPos;
00126 }
00127
00128
00129 /////////////////////////////////////////////////////////////////////
00130 // CIntTrace::OnCommand
00131 //
00132 /////////////////////////////////////////////////////////////////////
00133 BOOL CIntTrace::OnCommand(UINT iID, HWND hWndCtrl)
00134 {
00135   switch(iID)
00136   {
00137     //Editing
00138     ON_COMMAND(IDM_CLEARNOTIFYWINDOW,       Clear())
00139     ON_COMMAND(IDM_COPYNOTIFYWINDOW,        SendMessage(m_hWnd, WM_COPY, 0, 0))
00140
00141     //Notifications
00142     ON_COMMAND(IDM_NOTIFY_S_OK,           m_pCMainWindow->m_pCListener->SetReturnValue(S_OK))
00143     ON_COMMAND(IDM_NOTIFY_S_FALSE,          m_pCMainWindow->m_pCListener->SetReturnValue(S_FALSE))
00144     ON_COMMAND(IDM_NOTIFY_S_UNWANTEDPHASE,      m_pCMainWindow->m_pCListener->SetReturnValue(DB_S_UNWANTEDPHASE))
00145     ON_COMMAND(IDM_NOTIFY_S_UNWANTEDREASON,     m_pCMainWindow->m_pCListener->SetReturnValue(DB_S_UNWANTEDREASON))
00146     ON_COMMAND(IDM_NOTIFY_E_FAIL,         m_pCMainWindow->m_pCListener->SetReturnValue(E_FAIL))
00147   };
00148
00149   return FALSE;
00150 }
00151
00152 //////////////////////////////////////////////////////////////////
00153 // CIntTrace::OutputLineEnd
00154 //
00155 //////////////////////////////////////////////////////////////////
00156 void CIntTrace::OutputLineEnd()
00157 {
00158   //Standard MultiLine Edit Controls require (\r\n)
00159   //Anything else results in no line break
00160   //Even RichEdit controls "\n" works but when copying to text files they are lost
00161   ReplaceSel(L"\r\n", TRUE);
00162 }
00163
00164
00165 //////////////////////////////////////////////////////////////////
00166 // CIntTrace::OutputText
00167 //
00168 //////////////////////////////////////////////////////////////////
00169 void CIntTrace::OutputTextFmt(DWORD dwMask, COLORREF dwColor, WCHAR* pwszFmt, ...)
00170 {
00171   ASSERT(pwszFmt);
00172
00173   va_list   marker;
00174   WCHAR   wszBuffer[MAX_QUERY_LEN];
00175
00176   // Use format and arguements as input
00177   //This version will not overwrite the stack, since it only copies
00178   //upto the max size of the array
00179   va_start(marker, pwszFmt);
00180   _vsnwprintf(wszBuffer, MAX_QUERY_LEN, pwszFmt, marker);
00181   va_end(marker);
00182
00183   //Make sure there is a NULL Terminator, vsnwprintf will not copy
00184   //the terminator if length==MAX_NAME_LEN
00185   wszBuffer[MAX_QUERY_LEN-1] = wEOL;
00186
00187   //Delegate
00188   OutputText(dwMask, dwColor, wszBuffer);
00189 }
00190
00191
00192
00193 //////////////////////////////////////////////////////////////////
00194 // CIntTrace::OutputText
00195 //
00196 //////////////////////////////////////////////////////////////////
00197 void CIntTrace::OutputText(DWORD dwMask, COLORREF dwColor, WCHAR* pwszText)
00198 {
00199   ASSERT(pwszText);
00200
00201   //No-op - no output window...
00202   if(m_hWnd)
00203   {
00204     //Move the Caret to the End
00205     SetSel(LONG_MAX, LONG_MAX);
00206     //Append the New String
00207     ReplaceSel(pwszText, FALSE, dwMask, dwColor);
00208   }
00209 }
00210
00211
00212 //////////////////////////////////////////////////////////////////
00213 // CIntTrace::OutputIndent
00214 //
00215 //////////////////////////////////////////////////////////////////
00216 void CIntTrace::OutputIndent(ULONG cIndentLevel)
00217 {
00218   for(ULONG i=0; i<cIndentLevel; i++)
00219     OutputText(0, 0, L"\t");
00220 }
00221
00222
00223 //////////////////////////////////////////////////////////////////
00224 // CIntTrace::GetTrace
00225 //
00226 //////////////////////////////////////////////////////////////////
00227 CIntTrace*  CIntTrace::GetTrace()
00228 {
00229   CMainWindow* pCMainWindow = (CMainWindow*)CAppLite::m_pCMainWindow;
00230   if(pCMainWindow)
00231   {
00232     if(pCMainWindow->m_pCMDITrace)
00233       return pCMainWindow->m_pCMDITrace->m_pCTrace;
00234   }
00235
00236   return NULL;
00237 }
00238
00239
00240 //////////////////////////////////////////////////////////////////
00241 // CIntTrace::TraceAddRef
00242 //
00243 //////////////////////////////////////////////////////////////////
00244 ULONG CIntTrace::TraceAddRef(IUnknown* pIUnknown, WCHAR* pwszFmt)
00245 {
00246   ULONG ulRefCount = 0;
00247
00248   //AddRef
00249   if(pIUnknown)
00250   {
00251     ulRefCount = pIUnknown->AddRef();
00252
00253     CIntTrace* pCTrace = GetTrace();
00254     if(pCTrace)
00255     {
00256       if(NOTIFY_ADDREF & pCTrace->GetOptions()->m_dwNotifyOpts)
00257       {
00258         pCTrace->OutputTextFmt(0, 0, L"%s::AddRef() - %d", pwszFmt ? pwszFmt : L"IUnknown", ulRefCount);
00259         pCTrace->OutputLineEnd();
00260       }
00261     }
00262   }
00263
00264   return ulRefCount;
00265 }
00266
00267
00268 //////////////////////////////////////////////////////////////////
00269 // CIntTrace::TraceRelease
00270 //
00271 //////////////////////////////////////////////////////////////////
00272 ULONG CIntTrace::TraceRelease(IUnknown** ppIUnknown, WCHAR* pwszFmt, ULONG ulExpectedRefCount)
00273 {
00274   ULONG ulRefCount = 0;
00275
00276   //Release
00277   if(ppIUnknown && *ppIUnknown)
00278   {
00279     //Actual Release and NULL pointer
00280     ulRefCount = (*ppIUnknown)->Release();
00281     *ppIUnknown = NULL;
00282
00283     //Trace
00284     CIntTrace* pCTrace = GetTrace();
00285     if(pCTrace)
00286     {
00287       if(NOTIFY_RELEASE & pCTrace->GetOptions()->m_dwNotifyOpts)
00288       {
00289         pCTrace->OutputTextFmt(0, 0, L"%s::Release() - %d", pwszFmt ? pwszFmt : L"IUnknown", ulRefCount);
00290         pCTrace->OutputLineEnd();
00291       }
00292     }
00293
00294     //Display Errors if RefCount is not what is expected...
00295     if(ulExpectedRefCount==0 && ulRefCount!=0)
00296       DisplayRefCountErrors(pwszFmt, ulRefCount, ulExpectedRefCount);
00297   }
00298
00299   return ulRefCount;
00300 }
00301
00302
00303 //////////////////////////////////////////////////////////////////
00304 // HRESULT CIntTrace::TraceQI
00305 //
00306 //////////////////////////////////////////////////////////////////
00307 HRESULT CIntTrace::TraceQI(IUnknown* pIUnknown, REFIID riid, IUnknown** ppIUnknown, WCHAR* pwszFmt)
00308 {
00309   HRESULT hr = S_OK;
00310
00311   if(pIUnknown)
00312   {
00313     //QueryInterface
00314     hr = pIUnknown->QueryInterface(riid, (void**)ppIUnknown);
00315
00316     CIntTrace* pCTrace = GetTrace();
00317     if(pCTrace)
00318     {
00319       if(NOTIFY_QI & pCTrace->GetOptions()->m_dwNotifyOpts)
00320         TraceMethod(hr, L"%s::QueryInterface(%s, &0x%p)", pwszFmt ? pwszFmt : L"IUnknown", GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL);
00321     }
00322   }
00323
00324   return hr;
00325 }
00326
00327
00328 //////////////////////////////////////////////////////////////////
00329 // HRESULT CIntTrace::TraceMethod
00330 //
00331 //////////////////////////////////////////////////////////////////
00332 HRESULT CIntTrace::TraceMethod(HRESULT hrActual, WCHAR* pwszFmt, ...)
00333 {
00334   ASSERT(pwszFmt);
00335   CIntTrace* pCTrace = GetTrace();
00336   if(pCTrace)
00337   {
00338     DWORD dwNotifyOpts = pCTrace->GetOptions()->m_dwNotifyOpts;
00339     if(dwNotifyOpts & NOTIFY_OLEDB)
00340     {
00341       //Only if the user is interested in this message
00342       va_list   marker;
00343       WCHAR   wszBuffer[MAX_QUERY_LEN];
00344
00345       // Use format and arguements as input
00346       //This version will not overwrite the stack, since it only copies
00347       //upto the max size of the array
00348       va_start(marker, pwszFmt);
00349       _vsnwprintf(wszBuffer, MAX_QUERY_LEN, pwszFmt, marker);
00350       va_end(marker);
00351
00352       //Make sure there is a NULL Terminator, vsnwprintf will not copy
00353       //the terminator if length==MAX_NAME_LEN
00354       wszBuffer[MAX_QUERY_LEN-1] = wEOL;
00355
00356       //Colored Errors
00357       DWORD dwMask = FAILED(hrActual) ? (CFM_BOLD | CFM_COLOR) : hrActual!=S_OK ? CFM_BOLD : 0;
00358       DWORD dwColor = RGB_RED;
00359
00360       //Delegate
00361       pCTrace->OutputTextFmt(dwMask, dwColor, L"%s - %S", wszBuffer, GetErrorName(hrActual));
00362       pCTrace->OutputLineEnd();
00363     }
00364   }
00365
00366   return hrActual;
00367 }
00368
00369
00370 //////////////////////////////////////////////////////////////////
00371 // HRESULT CIntTrace::TraceNotification
00372 //
00373 //////////////////////////////////////////////////////////////////
00374 HRESULT CIntTrace::TraceNotification(DWORD dwNotifyType, HRESULT hrVeto, WCHAR* pwszInterface, WCHAR* pwszMethod, WCHAR* pwszParams, ...)
00375 {
00376   ASSERT(pwszParams);
00377   CIntTrace* pCTrace = GetTrace();
00378   if(pCTrace)
00379   {
00380     DWORD dwNotifyOpts = pCTrace->GetOptions()->m_dwNotifyOpts;
00381     WCHAR wszBuffer[MAX_QUERY_LEN] = {0};
00382     BOOL fShowVeto = (dwNotifyOpts & NOTIFY_PROMPTVETO) && (dwNotifyType & (NOTIFY_IDBASYNCHNOTIFY | NOTIFY_IROWSETNOTIFY | NOTIFY_IROWPOSITIONCHANGE));
00383
00384     //Only if the user is interested in this message
00385     if(dwNotifyOpts & dwNotifyType || fShowVeto)
00386     {
00387       va_list   marker;
00388
00389       // Use format and arguements as input
00390       //This version will not overwrite the stack, since it only copies
00391       //upto the max size of the array
00392       va_start(marker, pwszParams);
00393       _vsnwprintf(wszBuffer, MAX_QUERY_LEN, pwszParams, marker);
00394       va_end(marker);
00395
00396       //Make sure there is a NULL Terminator, vsnwprintf will not copy
00397       //the terminator if length==MAX_NAME_LEN
00398       wszBuffer[MAX_QUERY_LEN-1] = wEOL;
00399     }
00400
00401     //Do we need to prompt for Accept or veto?
00402     if(fShowVeto)
00403     {
00404       hrVeto = S_OK;
00405       if(IDCANCEL == wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONQUESTION | MB_OKCANCEL | MB_DEFBUTTON1,
00406         L"Received Notification",
00407         L"%s::%s\n"
00408         L"%s\n\n"
00409         L"'OK' - Accept notification, 'CANCEL' - Veto Notification",
00410         pwszInterface,
00411         pwszMethod,
00412         wszBuffer
00413         ))
00414       {
00415         hrVeto = S_FALSE;
00416       }
00417     }
00418
00419     //Only if the user is interested in this message
00420     if(dwNotifyOpts & dwNotifyType)
00421     {
00422       //Colored Errors
00423       DWORD dwMask = FAILED(hrVeto) ? (CFM_BOLD | CFM_COLOR) : hrVeto!=S_OK ? CFM_BOLD : CFM_COLOR;
00424       DWORD dwColor = FAILED(hrVeto) ? RGB_RED : RGB_DARK_GREEN;
00425
00426
00427       //Now acutally output the Notification to the trace
00428       pCTrace->OutputTextFmt(dwMask, dwColor, L"\t%s::%s%s - %S", pwszInterface, pwszMethod, wszBuffer, GetErrorName(hrVeto));
00429       pCTrace->OutputLineEnd();
00430     }
00431   }
00432   return hrVeto;
00433 }
00434
00435
00436
00437
00438
00439 ////////////////////////////////////////////////////////////////
00440 // CIntTrace::Clear
00441 //
00442 /////////////////////////////////////////////////////////////////
00443 HRESULT CIntTrace::Clear()
00444 {
00445   //Select all the Text and Cut it...
00446   //This method allows the text to be undone...
00447 //  SendMessage(m_hWnd, EM_SETSEL, 0, -1);
00448 //  SendMessage(m_hWnd, WM_CUT, 0, 0);
00449
00450   //Since this window is ReadOnly, we can't Cut it, we can only delete...
00451   SendMessage(m_hWnd, WM_SETTEXT, 0, (LPARAM)"");
00452   return S_OK;
00453 }
00454
00455
00456
00457
00458
00459 ////////////////////////////////////////////////////////////////
00460 // CMDITrace::CMDITrace
00461 //
00462 /////////////////////////////////////////////////////////////////
00463 CMDITrace::CMDITrace(CMainWindow* pCMainWindow)
00464 {
00465   //Objects
00466   ASSERT(pCMainWindow);
00467   m_pCMainWindow = pCMainWindow;
00468
00469   //Controls
00470   m_pCTrace   = new CIntTrace(pCMainWindow);
00471 }
00472
00473
00474 ////////////////////////////////////////////////////////////////
00475 // CMDITrace::~CMDITrace
00476 //
00477 /////////////////////////////////////////////////////////////////
00478 CMDITrace::~CMDITrace()
00479 {
00480   //Controls
00481   SAFE_DELETE(m_pCTrace);
00482 }
00483
00484
00485 ////////////////////////////////////////////////////////////////
00486 // CMDITrace::PreCreateWindow
00487 //
00488 /////////////////////////////////////////////////////////////////
00489 BOOL CMDITrace::PreCreateWindow(CREATESTRUCTW& cs)
00490 {
00491   //Load Saved Window Positions
00492   memset(&m_wndPlacement, 0, sizeof(m_wndPlacement));
00493   GetRegEntry(HKEY_ROWSETVIEWER, wszTRACE_KEY, L"WinPosition", &m_wndPlacement, sizeof(m_wndPlacement), NULL);
00494
00495   //Window Hidden?
00496   if(m_wndPlacement.length)
00497   {
00498     if(m_wndPlacement.showCmd == SW_HIDE)
00499       cs.style &= ~WS_VISIBLE;
00500   }
00501
00502   return TRUE;
00503 }
00504
00505
00506 ////////////////////////////////////////////////////////////////
00507 // CMDITrace::AutoPosition
00508 //
00509 /////////////////////////////////////////////////////////////////
00510 BOOL CMDITrace::AutoPosition(BOOL fDefaultPosition)
00511 {
00512   if(fDefaultPosition || m_wndPlacement.length == 0)
00513   {
00514     //Default setting, bottom right corner (1/4 of the client area)...
00515     SIZE sizeClient = GetClientSize(m_pCMainWindow->m_hWndMDIClient);
00516     return MoveWindow(m_hWnd, (INT)((float)sizeClient.cx * 0.25), (INT)((float)sizeClient.cy * 0.75), (INT)((float)sizeClient.cx * 0.75), (INT)((float)sizeClient.cy * 0.25), TRUE);
00517   }
00518   else
00519   {
00520     return SetWindowPlacement();
00521   }
00522 }
00523
00524
00525 ////////////////////////////////////////////////////////////////
00526 // CMDITrace::OnCreate
00527 //
00528 /////////////////////////////////////////////////////////////////
00529 BOOL CMDITrace::OnCreate(LPCREATESTRUCT lpCreateStruct)
00530 {
00531   //Create Trace Window
00532   //NOTE: The older richedit control (RichEd32.dll - 1.0 version) requires the cx,cy to be none-0
00533   //Otherwise the control will fail to be created.
00534   SIZE size = GetClientSize(m_hWnd);
00535   m_pCTrace->Create(m_hWnd, m_pCMainWindow->m_hLibRichEdit20 ? (IsUnicodeOS() ? L"RichEdit20W" : L"RichEdit20A") : L"RICHEDIT", NULL, ID_MDITRACE,
00536     WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL | WS_TABSTOP | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_DISABLENOSCROLL | ES_MULTILINE | ES_NOHIDESEL | ES_SELECTIONBAR | ES_READONLY, WS_EX_CLIENTEDGE,
00537     0, 0, size.cx, size.cy);
00538   m_pCTrace->OnCreate(NULL);
00539
00540   //By default the RichEdit controls have a HUGE text.  Instead of setting it
00541   //to a small size font which is difficult for some international lcids, we will
00542   //set it to the same font as the Tree control...
00543   m_pCTrace->SetFont(m_pCMainWindow->m_pCMDIObjects->m_pCObjTree->GetFont());
00544
00545   //Window Position
00546   AutoPosition(m_wndPlacement.length == 0/*fDefaultPosition*/);
00547   return TRUE;
00548 }
00549
00550
00551 /////////////////////////////////////////////////////////////////////////////
00552 // CMDITrace::OnDestroy
00553 //
00554 /////////////////////////////////////////////////////////////////////////////
00555 BOOL CMDITrace::OnDestroy()
00556 {
00557   //Save Window Positions
00558   if(GetWindowPlacement())
00559     SetRegEntry(HKEY_ROWSETVIEWER, wszTRACE_KEY, L"WinPosition",  &m_wndPlacement,  sizeof(m_wndPlacement));
00560
00561   //Delegate
00562   return CMDIChildLite::OnDestroy();
00563 }
00564
00565
00566 /////////////////////////////////////////////////////////////////////////////
00567 // CMDITrace::OnClose
00568 //
00569 /////////////////////////////////////////////////////////////////////////////
00570 BOOL CMDITrace::OnClose()
00571 {
00572   //NOTE:  OnClose only gets hit for MDI Child Windows when the user actually
00573   //closes the window.  If the mainframe window is closed directly then OnClose is never fired...
00574
00575   //Due to this, if the user has closed the window before exiting the app, then all we really
00576   //want to do is make the window not-visible, so if they bring the window up again it has all
00577   //the info saved.
00578   ShowWindow(SW_HIDE);
00579
00580   //NOTE:  Don't delegate the call, since we don't want to "DestroyWindow"
00581   return TRUE;
00582 }
00583
00584
00585 ////////////////////////////////////////////////////////////////
00586 // CMDITrace::OnInitialUpdate
00587 //
00588 /////////////////////////////////////////////////////////////////
00589 BOOL CMDITrace::OnInitialUpdate()
00590 {
00591   return TRUE;
00592 }
00593
00594
00595 /////////////////////////////////////////////////////////////////////
00596 // CMDITrace::OnMDIActivate
00597 //
00598 /////////////////////////////////////////////////////////////////////
00599 BOOL CMDITrace::OnMDIActivate(BOOL bActivate, HWND hWndActivate, HWND hWndDeactivate)
00600 {
00601   //So see if this window is being activated or deactivated
00602   if(hWndActivate == m_hWnd)
00603   {
00604     //Refresh all Controls
00605     UpdateControls();
00606   }
00607   return TRUE;
00608 }
00609
00610
00611 ////////////////////////////////////////////////////////////////
00612 // CMDITrace::UpdateControls
00613 //
00614 /////////////////////////////////////////////////////////////////
00615 BOOL CMDITrace::UpdateControls()
00616 {
00617   //ToolBar Buttons
00618   m_pCMainWindow->UpdateControls();
00619   return TRUE;
00620 }
00621
00622
00623 /////////////////////////////////////////////////////////////////////////////
00624 // CMDITrace::OnUpdateCommand
00625 //
00626 /////////////////////////////////////////////////////////////////////////////
00627 BOOL CMDITrace::OnUpdateCommand(HMENU hMenu, UINT nID, DWORD* pdwFlags)
00628 {
00629   return m_pCTrace->OnUpdateCommand(hMenu, nID, pdwFlags);
00630 }
00631
00632
00633 /////////////////////////////////////////////////////////////////////
00634 // CMDITrace::OnNotify
00635 //
00636 /////////////////////////////////////////////////////////////////////
00637 BOOL CMDITrace::OnNotify(INT idCtrl, NMHDR* pNMHDR)
00638 {
00639   //Delegate
00640   return m_pCTrace->OnNotify(idCtrl, pNMHDR);
00641 }
00642
00643
00644
00645 /////////////////////////////////////////////////////////////////////
00646 // CMDITrace::OnCommand
00647 //
00648 /////////////////////////////////////////////////////////////////////
00649 BOOL CMDITrace::OnCommand(UINT iID, HWND hWndCtrl)
00650 {
00651   return m_pCTrace->OnCommand(iID, hWndCtrl);
00652 }
00653
00654
00655 /////////////////////////////////////////////////////////////////////
00656 // CMDITrace::OnSize
00657 //
00658 /////////////////////////////////////////////////////////////////////
00659 BOOL CMDITrace::OnSize(WPARAM nType, REFPOINTS pts)
00660 {
00661   ASSERT(m_pCTrace->m_hWnd);
00662
00663   switch(nType)
00664   {
00665     case SIZE_RESTORED:
00666     case SIZE_MAXIMIZED:
00667     {
00668       if(pts.x && pts.y)
00669       {
00670         //Obtain window sizes...
00671         MoveWindow(m_pCTrace->m_hWnd, 0, 0, pts.x, pts.y, TRUE);
00672
00673         //Call default procedure first,
00674         //to let MDI position the child & then move its children
00675         //We simply do this by returning false, to indicate we didn't handle it...
00676         return FALSE;
00677       }
00678       break;
00679     }
00680   };
00681
00682   return FALSE;
00683 }
00684
00685
00686 /////////////////////////////////////////////////////////////////////////////
00687 // CMDITrace::OnSetFocus
00688 //
00689 /////////////////////////////////////////////////////////////////////////////
00690 BOOL CMDITrace::OnSetFocus(HWND hWndPrevFocus)
00691 {
00692   m_pCTrace->SetFocus();
00693   return TRUE;
00694 }
00695
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Consumer/Include/Events.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Consumer
  • Include

Events.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   ProvResv.H
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #ifndef _CProvider_IWbemEventConsumerProvider_H
00017 #define _CProvider_IWbemEventConsumerProvider_H
00018
00019 /******************************************************************************
00020  *
00021  *  Name: CProvider_IWbemEventConsumerProvider
00022  *
00023  *
00024  *  Description:
00025  *
00026  *      Event Consumer implementation of WMI provider interfaces.
00027  *      Implementation allows WMI to locate IWbemUnboundObjectSink implementation
00028  *      to forward events to.
00029  *
00030  *****************************************************************************/
00031
00032 class CProvider_IWbemEventConsumerProvider :  public IWbemEventConsumerProvider ,
00033                         public IWbemProviderInit ,
00034                         public IWbemShutdown
00035 {
00036 private:
00037
00038 // Private Variables
00039
00040 // Reference count for com object garbage collection.
00041
00042   LONG m_ReferenceCount ;
00043
00044 // Pointer passed during provider initialization allowing call to WMI.
00045
00046   IWbemServices *m_CoreService ;
00047
00048 // User/Local/Namespace information passed during initialization.
00049
00050   BSTR m_Namespace ;
00051   BSTR m_Locale ;
00052   BSTR m_User ;
00053
00054 public:
00055
00056 // Constructor/Destructor
00057
00058   CProvider_IWbemEventConsumerProvider () ;
00059     ~CProvider_IWbemEventConsumerProvider () ;
00060
00061 public:
00062
00063   //Non-delegating object IUnknown
00064
00065     STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
00066     STDMETHODIMP_( ULONG ) AddRef () ;
00067     STDMETHODIMP_( ULONG ) Release () ;
00068
00069   /* IWbemEventConsumerProvider methods */
00070
00071   HRESULT STDMETHODCALLTYPE FindConsumer (
00072
00073     IWbemClassObject *a_LogicalConsumer ,
00074     IWbemUnboundObjectSink **a_Consumer
00075   ) ;
00076
00077   /* IWbemProviderInit methods */
00078
00079   HRESULT STDMETHODCALLTYPE Initialize (
00080
00081     LPWSTR a_User ,
00082     LONG a_Flags ,
00083     LPWSTR a_Namespace ,
00084     LPWSTR a_Locale ,
00085     IWbemServices *a_Core ,
00086     IWbemContext *a_Context ,
00087     IWbemProviderInitSink *a_Sink
00088   ) ;
00089
00090   /* IWbemShutdown methods */
00091
00092   HRESULT STDMETHODCALLTYPE Shutdown (
00093
00094     LONG a_Flags ,
00095     ULONG a_MaxMilliSeconds ,
00096     IWbemContext *a_Context
00097   ) ;
00098 } ;
00099
00100 /******************************************************************************
00101  *
00102  *  Name: CProvider_IWbemUnboundObjectSink
00103  *
00104  *
00105  *  Description:
00106  *
00107  *      Event Consumer implementation of WMI provider interfaces.
00108  *      WMI uses this implementation to forwards events received from
00109  *      an event provider. User code for IndicateToConsumer performs
00110  *      some action based on contents of event received.
00111  *
00112  *****************************************************************************/
00113
00114 class CProvider_IWbemUnboundObjectSink :  public IWbemUnboundObjectSink
00115 {
00116 private:
00117
00118 // Private Variables
00119
00120 // Reference count for com object garbage collection.
00121
00122   LONG m_ReferenceCount ;
00123
00124 public:
00125
00126 // Constructor/Destructor
00127
00128   CProvider_IWbemUnboundObjectSink () ;
00129     ~CProvider_IWbemUnboundObjectSink () ;
00130
00131 public:
00132
00133   //Non-delegating object IUnknown
00134
00135     STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
00136     STDMETHODIMP_( ULONG ) AddRef () ;
00137     STDMETHODIMP_( ULONG ) Release () ;
00138
00139   /* IWbemUnboundObjectSink methods */
00140
00141   HRESULT STDMETHODCALLTYPE IndicateToConsumer (
00142
00143     IWbemClassObject *a_LogicalConsumer ,
00144     long a_ObjectCount ,
00145     IWbemClassObject **a_Objects
00146   ) ;
00147
00148 } ;
00149
00150 #endif // _CProvider_IWbemEventConsumerProvider_H
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CXMLTreeApp Member List

This is the complete list of members for CXMLTreeApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CWinApp() | CWinApp |
CXMLTreeApp() | CXMLTreeApp |
ExitInstance() | CWinApp | [virtual]
InitInstance() | CXMLTreeApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcOrder/IOrder.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcOrder

IOrder.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc7A.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCOrder.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcorder;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface IOrder
00019 /** @com.interface(iid=CB34A1A1-28C2-11D2-B5B6-00C04FC340EE, thread=AUTO, type=DUAL) */
00020 public interface IOrder extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPPUT, name="CustomerId", name2="putCustomerId", addFlagsVtable=4)
00023       @com.parameters([in,type=I4] _jcomparam_0) */
00024   public void setCustomerId(int _jcomparam_0);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=PROPPUT, name="OrderId", name2="putOrderId", addFlagsVtable=4)
00027       @com.parameters([in,type=I4] _jcomparam_0) */
00028   public void setOrderId(int _jcomparam_0);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LineItem", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] lItemId, [in,type=I4] lQuantity) */
00032   public void LineItem(int lItemId, int lQuantity);
00033
00034   /** @com.method(vtoffset=7, dispid=4, type=METHOD, name="Process", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] lFlags) */
00036   public void Process(int lFlags);
00037
00038
00039   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xcb34a1a1, (short)0x28c2, (short)0x11d2, (byte)0xb5, (byte)0xb6, (byte)0x0, (byte)0xc0, (byte)0x4f, (byte)0xc3, (byte)0x40, (byte)0xee);
00040 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/FontView/Dialogs.c Source File

  • Multimedia
  • Gdi
  • Fonts
  • FontView

Dialogs.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 #define NOMINMAX
00013 #include <windows.h>
00014 #include <stdio.h>
00015 #include "FontView.h"
00016
00017 #include <stdlib.h>
00018
00019 #if !defined (APIENTRY)
00020 #define APIENTRY FAR PASCAL
00021 #endif
00022
00023 BOOL CenterWindow (HWND, HWND);
00024
00025
00026 typedef struct FONTENUM {
00027     short       ft;
00028     TEXTMETRIC  tm;
00029     LOGFONT     lf;
00030 } FONTSTRUCT;
00031 typedef FONTSTRUCT      *PFONTSTRUCT;
00032 typedef FONTSTRUCT NEAR *NPFONTSTRUCT;
00033 typedef FONTSTRUCT FAR  *LPFONTSTRUCT;
00034
00035 typedef struct FONTLIST {
00036     int     count;
00037     HANDLE  hList;
00038 } FONTLIST;
00039 typedef FONTLIST        *PFONTLIST;
00040 typedef FONTLIST NEAR   *NPFONTLIST;
00041 typedef FONTLIST FAR    *LPFONTLIST;
00042
00043
00044 void SetDlgItemValue (HWND hDlg, int nIDDlgItem, int wValue, BOOL bSigned, int nBase)
00045 {
00046     char szValue[32];
00047
00048     switch (nBase) {
00049         case 8:
00050             if (_snprintf (szValue, sizeof(szValue) - 1, "0o%o", wValue) > 0)
00051             {
00052                 szValue[sizeof(szValue) - 1] = '\0';
00053                 SetDlgItemText (hDlg, nIDDlgItem, szValue);
00054             }
00055             break;
00056         case 16:
00057             if (_snprintf (szValue, sizeof(szValue) - 1, "0x%x", wValue) > 0 )
00058             {
00059                 szValue[sizeof(szValue) - 1] = '\0';
00060                 SetDlgItemText (hDlg, nIDDlgItem, szValue);
00061             }
00062             break;
00063         default:
00064             SetDlgItemInt (hDlg, nIDDlgItem, wValue, bSigned);
00065             break;
00066     }
00067 }
00068
00069 BOOL FAR PASCAL DlgEnumFontSizes (LPLOGFONT lpLogFont, LPTEXTMETRIC lpTextMetric, short nFontType, LPHANDLE lpData)
00070 {
00071     HANDLE hFonts;
00072     LPFONTSTRUCT pFS;
00073     LPFONTLIST pFL;
00074
00075     /*
00076         This function will lock down the incoming handle, properly alloc, and realloc the
00077         handle within it to hold the data of the fonts enumerated, then unlock the handle.
00078     */
00079     hFonts = *lpData;
00080     pFL = (LPFONTLIST)GlobalLock (hFonts);
00081     if (!pFL) {
00082         return FALSE;
00083     } else if (pFL->count == 0) {
00084         pFL->hList = GlobalAlloc (GHND, sizeof(FONTSTRUCT));
00085     } else {
00086         pFL->hList = GlobalReAlloc (pFL->hList, sizeof(FONTSTRUCT)*(1+pFL->count), GMEM_MOVEABLE);
00087     }
00088
00089     if (pFL->hList) {
00090         pFS = (LPFONTSTRUCT)GlobalLock (pFL->hList);
00091         if (pFS) {
00092             pFS[pFL->count].ft = nFontType;
00093             pFS[pFL->count].tm = *lpTextMetric;
00094             pFS[pFL->count].lf = *lpLogFont;
00095             GlobalUnlock (pFL->hList);
00096             pFL->count++;
00097         }
00098         GlobalUnlock (hFonts);
00099
00100     } else {
00101         GlobalUnlock (hFonts);
00102         return FALSE;
00103     }
00104
00105     return TRUE;
00106 }
00107
00108 BOOL FAR PASCAL DlgEnumFontNames (LPLOGFONT lpLogFont, LPTEXTMETRIC lpTextMetric, short nFontType, LPHANDLE lpData)
00109 {
00110     HDC  hdc;
00111     HWND hwnd;
00112     HANDLE hInst;
00113     FARPROC lpFontEnumProc;
00114
00115 /*
00116    This function is just a pass through. For each face encountered, it will in turn enumerate all
00117    sizes available. the lpData, which is a FAR * to a FONTSTRUCT structure will simply be passed
00118    on to the second enumeration procedure which will fill it in.
00119  */
00120     hwnd = GetFocus();
00121     hInst = (HANDLE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
00122
00123     lpFontEnumProc = MakeProcInstance((FARPROC)DlgEnumFontSizes, hInst);
00124     if (lpFontEnumProc) {
00125         hdc  = GetDC(hwnd);
00126         EnumFonts (hdc, lpLogFont->lfFaceName, (FONTENUMPROC)lpFontEnumProc, (LPARAM)lpData);
00127         ReleaseDC(hwnd, hdc);
00128         FreeProcInstance (lpFontEnumProc);
00129     } else {
00130         MessageBox (GetFocus(), "Couldn't create a proc instance", "FontView", MB_OK);
00131         return FALSE;
00132     }
00133     return TRUE;
00134
00135     lpTextMetric;  // unreferenced formal parameter
00136     nFontType;     // unreferenced formal parameter
00137 }
00138
00139
00140
00141 BOOL APIENTRY SimpleDlgProc(HWND hwnd, UINT msg, UINT wParam, LONG lParam)
00142 {
00143     int wmId;
00144     static HBITMAP hbmFontView;
00145     static BITMAP bmFontView;
00146     RECT rect;
00147     HDC hdc, hdcSrc;
00148     HBITMAP hbmOld;
00149     PAINTSTRUCT ps;
00150     HANDLE hInst;
00151
00152     hInst = (HANDLE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
00153
00154     switch (msg) {
00155         case WM_INITDIALOG:
00156             CenterWindow (hwnd, GetWindow (hwnd, GW_OWNER));
00157             hbmFontView = LoadBitmap (hInst, "FONTVIEW");
00158             GetObject (hbmFontView,sizeof(BITMAP), &bmFontView);
00159             if (!hbmFontView) {
00160                 MessageBeep(0);
00161             }
00162             return TRUE;
00163
00164         case WM_DESTROY:
00165             DeleteObject (hbmFontView);
00166             break;
00167
00168         case WM_PAINT:
00169             hdc = BeginPaint (hwnd, &ps);
00170             GetWindowRect (hwnd, &rect);
00171             ScreenToClient (hwnd, (LPPOINT)&rect.left);
00172             ScreenToClient (hwnd, (LPPOINT)&rect.right);
00173             hdc = GetDC (hwnd);
00174             hdcSrc = CreateCompatibleDC (hdc);
00175             hbmOld = SelectObject (hdcSrc, hbmFontView);
00176             if (!BitBlt (hdc, 0, 0, bmFontView.bmWidth, bmFontView.bmHeight, hdcSrc, 0, 0, SRCCOPY)) {
00177                 MessageBeep(0);
00178             }
00179             SelectObject (hdcSrc, hbmOld);
00180             DeleteDC (hdcSrc);
00181             EndPaint (hwnd, &ps);
00182             break;
00183
00184         case WM_COMMAND:
00185             wmId = LOWORD(wParam);
00186             switch (wmId) {
00187
00188                 case IDOK:
00189                     EndDialog(hwnd, TRUE);
00190                     return TRUE;
00191
00192                 case IDCANCEL:
00193                     EndDialog(hwnd, TRUE);
00194                     return TRUE;
00195             }
00196             break;
00197     }
00198     return FALSE;
00199
00200     lParam; // unreferenced formal parameter
00201 }
00202
00203
00204 /*
00205     This dialog will present edit controls for all the parameters of a CreateFont call.
00206     The user can put any value in any of the fields, no validation is done. These parameters
00207     are then used to create a font with, and that will be the font that will be displayed.
00208  */
00209 BOOL APIENTRY CreateDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00210 {
00211     int wmId, i;
00212     BOOL bDone;
00213     static LOGFONT lfDlg;
00214     static LPLOGFONT lplf;
00215
00216     switch (msg) {
00217         case WM_INITDIALOG:
00218             CenterWindow (hwnd, GetWindow (hwnd, GW_OWNER));
00219             lplf = (LOGFONT *)lParam;
00220             if (!lplf) {
00221                 return FALSE;
00222             }
00223             lfDlg = *lplf;
00224             SetDlgItemInt (hwnd, CFD_HEIGHT, (int)lfDlg.lfHeight, TRUE);
00225             SetDlgItemInt (hwnd, CFD_WIDTH, (int)lfDlg.lfWidth, TRUE);
00226             SetDlgItemInt (hwnd, CFD_ESCAPEMENT, (int)lfDlg.lfEscapement, TRUE);
00227             SetDlgItemInt (hwnd, CFD_ORIENTATION, (int)lfDlg.lfOrientation, TRUE);
00228             SetDlgItemInt (hwnd, CFD_WEIGHT, (int)lfDlg.lfWeight, FALSE);
00229             SetDlgItemInt (hwnd, CFD_ITALIC, (int)lfDlg.lfItalic, FALSE);
00230             SetDlgItemInt (hwnd, CFD_UNDERLINE, (int)lfDlg.lfUnderline, FALSE);
00231             SetDlgItemInt (hwnd, CFD_STRIKEOUT, (int)lfDlg.lfStrikeOut, FALSE);
00232             SetDlgItemInt (hwnd, CFD_CHARSET, (int)lfDlg.lfCharSet, FALSE);
00233             SetDlgItemInt (hwnd, CFD_OUTPUTPRECISION, (int)lfDlg.lfOutPrecision, FALSE);
00234             SetDlgItemInt (hwnd, CFD_CLIPPRECISION, (int)lfDlg.lfClipPrecision, FALSE);
00235             SetDlgItemInt (hwnd, CFD_QUALITY, (int)lfDlg.lfQuality, FALSE);
00236             SetDlgItemInt (hwnd, CFD_PITCHANDFAMILY, (int)lfDlg.lfPitchAndFamily, FALSE);
00237             SetDlgItemText(hwnd, CFD_FACENAME, lfDlg.lfFaceName);
00238
00239             return (TRUE);
00240
00241         case WM_COMMAND:
00242             wmId = LOWORD(wParam);
00243             switch (wmId) {
00244                 case CFD_DEFAULT:
00245                     // Set all elements to ZERO. This will give us a 'default' font
00246                     for (i=CFD_BASE; i<=CFD_PITCHANDFAMILY; i++) {
00247                         SetDlgItemInt (hwnd, i, 0, FALSE);
00248                     }
00249                     SetDlgItemText (hwnd, CFD_FACENAME, "");
00250                     break;
00251
00252                 case IDOK:
00253                     // Get the data from the edit control, we will then use this for a 'CreatFont' call
00254                     lfDlg.lfHeight = GetDlgItemInt (hwnd, CFD_HEIGHT, &bDone, TRUE);
00255                     lfDlg.lfWidth = GetDlgItemInt (hwnd, CFD_WIDTH, &bDone, TRUE);
00256                     lfDlg.lfEscapement = GetDlgItemInt (hwnd, CFD_ESCAPEMENT, &bDone, TRUE);
00257                     lfDlg.lfOrientation = GetDlgItemInt (hwnd, CFD_ORIENTATION, &bDone, TRUE);
00258                     lfDlg.lfWeight = GetDlgItemInt (hwnd, CFD_WEIGHT, &bDone, FALSE);
00259                     lfDlg.lfItalic = (BYTE)GetDlgItemInt (hwnd, CFD_ITALIC, &bDone, FALSE);
00260                     lfDlg.lfUnderline = (BYTE)GetDlgItemInt (hwnd, CFD_UNDERLINE, &bDone, FALSE);
00261                     lfDlg.lfStrikeOut = (BYTE)GetDlgItemInt (hwnd, CFD_STRIKEOUT, &bDone, FALSE);
00262                     lfDlg.lfCharSet = (BYTE)GetDlgItemInt (hwnd, CFD_CHARSET, &bDone, FALSE);
00263                     lfDlg.lfOutPrecision = (BYTE)GetDlgItemInt (hwnd, CFD_OUTPUTPRECISION, &bDone, FALSE);
00264                     lfDlg.lfClipPrecision = (BYTE)GetDlgItemInt (hwnd, CFD_CLIPPRECISION, &bDone, FALSE);
00265                     lfDlg.lfQuality = (BYTE)GetDlgItemInt (hwnd, CFD_QUALITY, &bDone, FALSE);
00266                     lfDlg.lfPitchAndFamily = (BYTE)GetDlgItemInt (hwnd, CFD_PITCHANDFAMILY, &bDone, FALSE);
00267                     GetDlgItemText(hwnd, CFD_FACENAME, lfDlg.lfFaceName,20);
00268                     // and copy the data into our external structure
00269                     *lplf = lfDlg;
00270                     EndDialog(hwnd, TRUE);
00271                     return TRUE;
00272
00273                 case IDCANCEL:
00274                     // Exit without changing anything
00275                     EndDialog(hwnd, TRUE);
00276                     return TRUE;
00277
00278             }
00279             break;
00280     }
00281     return FALSE;
00282
00283     lParam; //unreferenced formal paramter
00284 }
00285
00286 /*
00287  This dialog will display the TEXTMETRIC data that is retrieved from a 'GetTextMetric' call.
00288  If the 'Select' button is clicked, then the current CreateFont data will be replaced with
00289  as much data from TEXTMETRIC as possible.
00290 */
00291 BOOL APIENTRY MetricsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00292 {
00293 static LOGFONT lfDlg;
00294 static LPLOGFONT lplf;
00295 static TEXTMETRIC tm;
00296 static char szFacename[LF_FACESIZE];
00297     int wmId;
00298     BOOL bDone;
00299     TEXTMETRIC tmTmp;
00300     HFONT hfont, hfontPrev;
00301     HDC   hdc;
00302     char szBuffer[LF_FACESIZE+15];
00303
00304
00305     switch (msg) {
00306         case WM_INITDIALOG:
00307             CenterWindow (hwnd, GetWindow (hwnd, GW_OWNER));
00308             lplf = (LOGFONT *)lParam;
00309             lfDlg = *lplf;
00310
00311             hfont = CreateFontIndirect (&lfDlg);
00312             hdc = GetDC (hwnd);
00313             hfontPrev = SelectObject (hdc, hfont);
00314             GetTextMetrics (hdc, &tm);
00315             GetTextFace    (hdc, sizeof(szFacename), szFacename);
00316             SelectObject (hdc, hfontPrev);
00317             DeleteObject (hfont);
00318             ReleaseDC (hwnd, hdc);
00319
00320             if (_snprintf (szBuffer, sizeof(szBuffer) - 1, "TextMetrics: %s", (LPSTR)szFacename) > 0 )
00321             {
00322                 szBuffer[sizeof(szBuffer) - 1] = '\0';
00323                 SetWindowText (hwnd, szBuffer);
00324             }
00325
00326             SetDlgItemInt (hwnd, TMD_HEIGHT, (int)tm.tmHeight, TRUE);
00327             SetDlgItemInt (hwnd, TMD_ASCENT, (int)tm.tmAscent, TRUE);
00328             SetDlgItemInt (hwnd, TMD_DESCENT, (int)tm.tmDescent, TRUE);
00329             SetDlgItemInt (hwnd, TMD_INTERNAL, (int)tm.tmInternalLeading, TRUE);
00330             SetDlgItemInt (hwnd, TMD_EXTERNAL, (int)tm.tmExternalLeading, TRUE);
00331             SetDlgItemInt (hwnd, TMD_AVEWIDTH, (int)tm.tmAveCharWidth, TRUE);
00332             SetDlgItemInt (hwnd, TMD_MAXWIDTH, (int)tm.tmMaxCharWidth, TRUE);
00333             SetDlgItemInt (hwnd, TMD_WEIGHT, (int)tm.tmWeight, TRUE);
00334             SetDlgItemInt (hwnd, TMD_ITALIC, (int)tm.tmItalic, FALSE);
00335             SetDlgItemInt (hwnd, TMD_UNDERLINE, (int)tm.tmUnderlined, FALSE);
00336             SetDlgItemInt (hwnd, TMD_STRUCKOUT, (int)tm.tmStruckOut, FALSE);
00337             SetDlgItemInt (hwnd, TMD_FIRSTCHAR, (int)tm.tmFirstChar, FALSE);
00338             SetDlgItemInt (hwnd, TMD_LASTCHAR, (int)tm.tmLastChar, FALSE);
00339             SetDlgItemInt (hwnd, TMD_DEFAULTCHAR, (int)tm.tmDefaultChar, FALSE);
00340             SetDlgItemInt (hwnd, TMD_BREAKCHAR, (int)tm.tmBreakChar, FALSE);
00341             SetDlgItemInt (hwnd, TMD_PITCHANDFAMILY, (int)tm.tmPitchAndFamily, FALSE);
00342             SetDlgItemInt (hwnd, TMD_CHARSET, (int)tm.tmCharSet, FALSE);
00343             SetDlgItemInt (hwnd, TMD_OVERHANG, (int)tm.tmOverhang, TRUE);
00344             SetDlgItemInt (hwnd, TMD_DIGITIZEDASPECTX, (int)tm.tmDigitizedAspectX, TRUE);
00345             SetDlgItemInt (hwnd, TMD_DIGITIZEDASPECTY, (int)tm.tmDigitizedAspectY, TRUE);
00346
00347             return TRUE;
00348
00349         case WM_COMMAND:
00350             wmId = LOWORD(wParam);
00351             switch (wmId) {
00352                 case IDOK:
00353                     // Lets pull in as much data from the TEXTMETRIC structure as possible...
00354                     lfDlg.lfHeight         = tm.tmHeight;
00355                     lfDlg.lfWidth          = tm.tmAveCharWidth;
00356                     //lfDlg.lfEscapement - No Use
00357                     //lfDlg.lfOrientation - No Use
00358                     lfDlg.lfWeight         = tm.tmWeight;
00359                     lfDlg.lfItalic         = tm.tmItalic;
00360                     lfDlg.lfUnderline      = tm.tmUnderlined;
00361                     lfDlg.lfStrikeOut      = tm.tmStruckOut;
00362                     lfDlg.lfCharSet        = tm.tmCharSet;
00363                     //lfDlg.lfOutPrecision - No Use
00364                     //lfDlg.lfClipPrecision - No Use
00365                     //lfDlg.lfQuality - No Use
00366                     lfDlg.lfPitchAndFamily = tm.tmPitchAndFamily;
00367                     lstrcpyn(lfDlg.lfFaceName, szFacename, LF_FACESIZE);
00368
00369                     // Lets create a font with this new data
00370                     hfont = CreateFontIndirect (&lfDlg);
00371                     hdc = GetDC (hwnd);
00372                     hfontPrev = SelectObject (hdc, hfont);
00373                     GetTextMetrics (hdc, &tmTmp);
00374                     // Get the face name
00375                     GetTextFace    (hdc, sizeof(szBuffer), szBuffer);
00376                     SelectObject (hdc, hfontPrev);
00377                     DeleteObject (hfont);
00378                     ReleaseDC (hwnd, hdc);
00379
00380                     // And verify that we did indeed get the same font.
00381                     bDone = TRUE;
00382                     bDone = bDone && (tm.tmHeight==tmTmp.tmHeight);
00383                     bDone = bDone && (tm.tmAscent==tmTmp.tmAscent);
00384                     bDone = bDone && (tm.tmDescent==tmTmp.tmDescent);
00385                     bDone = bDone && (tm.tmInternalLeading==tmTmp.tmInternalLeading);
00386                     bDone = bDone && (tm.tmExternalLeading==tmTmp.tmExternalLeading);
00387                     bDone = bDone && (tm.tmAveCharWidth==tmTmp.tmAveCharWidth);
00388                     bDone = bDone && (tm.tmMaxCharWidth==tmTmp.tmMaxCharWidth);
00389                     bDone = bDone && (tm.tmWeight==tmTmp.tmWeight);
00390                     bDone = bDone && (tm.tmItalic==tmTmp.tmItalic);
00391                     bDone = bDone && (tm.tmUnderlined==tmTmp.tmUnderlined);
00392                     bDone = bDone && (tm.tmStruckOut==tmTmp.tmStruckOut);
00393                     bDone = bDone && (tm.tmFirstChar==tmTmp.tmFirstChar);
00394                     bDone = bDone && (tm.tmLastChar==tmTmp.tmLastChar);
00395                     bDone = bDone && (tm.tmDefaultChar==tmTmp.tmDefaultChar);
00396                     bDone = bDone && (tm.tmBreakChar==tmTmp.tmBreakChar);
00397                     bDone = bDone && (tm.tmPitchAndFamily==tmTmp.tmPitchAndFamily);
00398                     bDone = bDone && (tm.tmCharSet==tmTmp.tmCharSet);
00399                     // Did it work?
00400                     if (bDone) {
00401                         *lplf = lfDlg;
00402                         EndDialog(hwnd, TRUE);
00403                         return TRUE;
00404                     } else {
00405                         // We need to take a close look at the font verification
00406                         // code. Currently, it sometimes will report that the
00407                         // font didn't get properly selected, even if it did.
00408                         *lplf = lfDlg;
00409                         EndDialog(hwnd, TRUE);
00410                         return TRUE;
00411
00412                         // This is what we want to do once we beef up the font
00413                         // verification code:
00414                         //lfDlg = *lplf;
00415                         //MessageBox (GetFocus(),
00416                         //    "Unable to re-create font from TextMetrics",
00417                         //    "FontView", MB_OK);
00418                     }
00419                     break;
00420
00421                 case IDCANCEL:
00422                     EndDialog(hwnd, TRUE);
00423                     return TRUE;
00424
00425             }
00426             break;
00427     }
00428     return FALSE;
00429
00430     /* Just For Reference */
00431     lParam;
00432 }
00433
00434
00435 BOOL FillEnumFields (HWND hwnd, int iType, LPTEXTMETRIC ptm, LPLOGFONT plf, int nBase)
00436 {
00437             if (!ptm)
00438             {
00439                 return FALSE;
00440             }
00441             SetDlgItemValue (hwnd, TMD_HEIGHT, (int)ptm->tmHeight, TRUE, nBase);
00442             SetDlgItemValue (hwnd, TMD_ASCENT, (int)ptm->tmAscent, TRUE, nBase);
00443             SetDlgItemValue (hwnd, TMD_DESCENT, (int)ptm->tmDescent, TRUE, nBase);
00444             SetDlgItemValue (hwnd, TMD_INTERNAL, (int)ptm->tmInternalLeading, TRUE, nBase);
00445             SetDlgItemValue (hwnd, TMD_EXTERNAL, (int)ptm->tmExternalLeading, TRUE, nBase);
00446             SetDlgItemValue (hwnd, TMD_AVEWIDTH, (int)ptm->tmAveCharWidth, TRUE, nBase);
00447             SetDlgItemValue (hwnd, TMD_MAXWIDTH, (int)ptm->tmMaxCharWidth, TRUE, nBase);
00448             SetDlgItemValue (hwnd, TMD_WEIGHT, (int)ptm->tmWeight, TRUE, nBase);
00449             SetDlgItemValue (hwnd, TMD_ITALIC, (int)ptm->tmItalic, FALSE, nBase);
00450             SetDlgItemValue (hwnd, TMD_UNDERLINE, (int)ptm->tmUnderlined, FALSE, nBase);
00451             SetDlgItemValue (hwnd, TMD_STRUCKOUT, (int)ptm->tmStruckOut, FALSE, nBase);
00452             SetDlgItemValue (hwnd, TMD_FIRSTCHAR, (int)ptm->tmFirstChar, FALSE, nBase);
00453             SetDlgItemValue (hwnd, TMD_LASTCHAR, (int)ptm->tmLastChar, FALSE, nBase);
00454             SetDlgItemValue (hwnd, TMD_DEFAULTCHAR, (int)ptm->tmDefaultChar, FALSE, nBase);
00455             SetDlgItemValue (hwnd, TMD_BREAKCHAR, (int)ptm->tmBreakChar, FALSE, nBase);
00456             SetDlgItemValue (hwnd, TMD_PITCHANDFAMILY, (int)ptm->tmPitchAndFamily, FALSE, nBase);
00457             SetDlgItemValue (hwnd, TMD_CHARSET, (int)ptm->tmCharSet, FALSE, nBase);
00458             SetDlgItemValue (hwnd, TMD_OVERHANG, (int)ptm->tmOverhang, TRUE, nBase);
00459             SetDlgItemValue (hwnd, TMD_DIGITIZEDASPECTX, (int)ptm->tmDigitizedAspectX, TRUE, nBase);
00460             SetDlgItemValue (hwnd, TMD_DIGITIZEDASPECTY, (int)ptm->tmDigitizedAspectY, TRUE, nBase);
00461
00462             if (!plf)
00463             {
00464                 return FALSE;
00465             }
00466             SetDlgItemValue (hwnd, CFD_HEIGHT, (int)plf->lfHeight, TRUE, nBase);
00467             SetDlgItemValue (hwnd, CFD_WIDTH, (int)plf->lfWidth, TRUE, nBase);
00468             SetDlgItemValue (hwnd, CFD_ESCAPEMENT, (int)plf->lfEscapement, TRUE, nBase);
00469             SetDlgItemValue (hwnd, CFD_ORIENTATION, (int)plf->lfOrientation, TRUE, nBase);
00470             SetDlgItemValue (hwnd, CFD_WEIGHT, (int)plf->lfWeight, FALSE, nBase);
00471             SetDlgItemValue (hwnd, CFD_ITALIC, (int)plf->lfItalic, FALSE, nBase);
00472             SetDlgItemValue (hwnd, CFD_UNDERLINE, (int)plf->lfUnderline, FALSE, nBase);
00473             SetDlgItemValue (hwnd, CFD_STRIKEOUT, (int)plf->lfStrikeOut, FALSE, nBase);
00474             SetDlgItemValue (hwnd, CFD_CHARSET, (int)plf->lfCharSet, FALSE, nBase);
00475             SetDlgItemValue (hwnd, CFD_OUTPUTPRECISION, (int)plf->lfOutPrecision, FALSE, nBase);
00476             SetDlgItemValue (hwnd, CFD_CLIPPRECISION, (int)plf->lfClipPrecision, FALSE, nBase);
00477             SetDlgItemValue (hwnd, CFD_QUALITY, (int)plf->lfQuality, FALSE, nBase);
00478             SetDlgItemValue (hwnd, CFD_PITCHANDFAMILY, (int)plf->lfPitchAndFamily, FALSE, nBase);
00479             SetDlgItemText(hwnd, CFD_FACENAME, plf->lfFaceName);
00480
00481             SetDlgItemValue (hwnd, ED_TYPE, (int)iType, FALSE, nBase);
00482
00483             return TRUE;
00484 }
00485
00486
00487 BOOL DrawSample (HWND hwnd, LPLOGFONT plf)
00488 {
00489     HFONT   hfont, hfontPrev;
00490     HDC     hdc;
00491     RECT    r;
00492
00493     hfont = CreateFontIndirect (plf);
00494     hdc = GetDC (hwnd);
00495     hfontPrev = SelectObject (hdc, hfont);
00496     GetWindowRect (hwnd, &r);
00497     ScreenToClient (hwnd, (LPPOINT)&r.left);
00498     ScreenToClient (hwnd, (LPPOINT)&r.right);
00499
00500     Rectangle (hdc, r.left, r.top, r.right, r.bottom);
00501
00502     InflateRect (&r, -1, -1);
00503     SetTextAlign (hdc, TA_BOTTOM | TA_CENTER);
00504     ExtTextOut (hdc, r.left + ((r.right-r.left)/2), r.bottom, ETO_CLIPPED, &r,"AaBbCcDdEe 012345", 17, NULL);
00505
00506     SelectObject (hdc, hfontPrev);
00507     DeleteObject (hfont);
00508     ReleaseDC (hwnd, hdc);
00509     return TRUE;
00510 }
00511
00512
00513 /*
00514     Display a dialog that the user can use to enumerate through all of the fonts in the system.
00515     Show him not only all of the metrics for the font, but a sample of the font as well.
00516     If the user picks the 'Select' button, then the Metrics of this font will be used for
00517     the CreateFont call.
00518 */
00519 BOOL APIENTRY EnumDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00520 {
00521     static HANDLE /*TO FONTLIST*/ hFonts;
00522     static int iLoc=0;
00523     static int count=0;
00524     static BOOL bHex = FALSE;
00525     static LOGFONT *lplf;
00526     static LOGFONT lfDlg;
00527     int wmId, i, j;
00528     HANDLE hInst;
00529     HWND   hwndItem;
00530     HDC hdc;
00531     FARPROC lpEnumFonts;
00532     LPFONTLIST    pFL;
00533     LPFONTSTRUCT  pFS;
00534     char szTmp[80];
00535     HFONT hfont, hfontPrev;
00536     BOOL bDone;
00537     TEXTMETRIC tmTmp;
00538
00539
00540     switch (msg) {
00541         case WM_INITDIALOG:
00542             lplf = (LOGFONT *)lParam;
00543             if (!lplf)
00544             {
00545                 return FALSE;
00546             }
00547
00548             lfDlg = *lplf;
00549             iLoc = 0;
00550             count = 0;
00551             bHex = FALSE;
00552             /* First, lets enumerate ALL fonts, and store them in our list */
00553             hFonts = GlobalAlloc (GHND, sizeof(FONTLIST));
00554             if (hFonts) {
00555                 hInst = (HANDLE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
00556                 lpEnumFonts = MakeProcInstance((FARPROC)DlgEnumFontNames, hInst);
00557
00558                 if (lpEnumFonts) {
00559                     hdc  = GetDC(hwnd);
00560                     // The enumeration function will lock down the handle
00561                     EnumFonts (hdc, NULL, (FONTENUMPROC)lpEnumFonts, (LPARAM)&hFonts);
00562                     // The handle will come back to us properly unlocked
00563                     ReleaseDC(hwnd, hdc);
00564                     FreeProcInstance (lpEnumFonts);
00565                  }
00566             }
00567             pFL = (LPFONTLIST)GlobalLock (hFonts);
00568             if (pFL) {
00569                 pFS = (LPFONTSTRUCT)GlobalLock (pFL->hList);
00570                 if (pFS) {
00571                     iLoc = 0;
00572                     j = 100;
00573                     for (i=0; i<pFL->count; i++) {
00574                         if (lstrcmp(lfDlg.lfFaceName, pFS[i].lf.lfFaceName) == 0) {
00575                             if (abs(lfDlg.lfHeight-pFS[i].lf.lfHeight) < j) {
00576                                 j = abs(lfDlg.lfHeight-pFS[i].lf.lfHeight);
00577                                 iLoc = i;
00578                             }
00579                         }
00580                     }
00581                     FillEnumFields (hwnd, pFS[iLoc].ft, &pFS[iLoc].tm, &pFS[iLoc].lf, (bHex?16:10));
00582                     hwndItem = GetDlgItem (hwnd, ED_SAMPLE);
00583                     DrawSample (hwndItem, &pFS[iLoc].lf);
00584                     GlobalUnlock (pFL->hList);
00585
00586                 }
00587                 count = pFL->count;
00588                 GlobalUnlock (hFonts);
00589
00590             }
00591             /* now fill in the dialog values */
00592             if (_snprintf (szTmp, sizeof(szTmp) - 1, "EnumFonts %d of %d", iLoc+1, count) > 0)
00593             {
00594                 szTmp[sizeof(szTmp) - 1] = '\0';
00595                 SetWindowText (hwnd, szTmp);
00596             }
00597             CenterWindow (hwnd, GetWindow (hwnd, GW_OWNER));
00598
00599             return TRUE;
00600
00601         case WM_PAINT:
00602             pFL = (LPFONTLIST)GlobalLock (hFonts);
00603             if (pFL) {
00604                 pFS = (LPFONTSTRUCT)GlobalLock (pFL->hList);
00605                 if (pFS) {
00606                     FillEnumFields (hwnd, pFS[iLoc].ft, &pFS[iLoc].tm, &pFS[iLoc].lf, (bHex?16:10));
00607                     hwndItem = GetDlgItem (hwnd, ED_SAMPLE);
00608                     DrawSample (hwndItem, &pFS[iLoc].lf);
00609                     GlobalUnlock (pFL->hList);
00610                 }
00611                 GlobalUnlock (hFonts);
00612             }
00613             return TRUE;
00614
00615         case WM_COMMAND:
00616             wmId = LOWORD(wParam);
00617             switch (wmId) {
00618
00619                 case ED_HEX:
00620                     // Display the data in either Hex mode or Dec mode.
00621                     bHex = !bHex;
00622                     CheckDlgButton (hwnd, wmId, bHex);
00623                     pFL = (LPFONTLIST)GlobalLock (hFonts);
00624                     if (pFL) {
00625                         pFS = (LPFONTSTRUCT)GlobalLock (pFL->hList);
00626                         if (pFS) {
00627                             FillEnumFields (hwnd, pFS[iLoc].ft, &pFS[iLoc].tm, &pFS[iLoc].lf, (bHex?16:10));
00628                             if (GlobalUnlock (pFL->hList)) {
00629                                 MessageBox (GetFocus(), "In HEX", "Unlock pFL->hList", MB_OK);
00630                             }
00631                         }
00632                         if (GlobalUnlock (hFonts)) {
00633                             MessageBox (GetFocus(), "In HEX", "Unlock hFonts", MB_OK);
00634                         }
00635
00636                     }
00637                     break;
00638
00639                 case ED_PREV:
00640                     pFL = (LPFONTLIST)GlobalLock (hFonts);
00641                     if (pFL) {
00642                         if (iLoc > 0) {
00643                             iLoc--;
00644                             pFS = (LPFONTSTRUCT)GlobalLock (pFL->hList);
00645                             if (pFS) {
00646                                 FillEnumFields (hwnd, pFS[iLoc].ft, &pFS[iLoc].tm, &pFS[iLoc].lf, (bHex?16:10));
00647                                 hwndItem = GetDlgItem (hwnd, ED_SAMPLE);
00648                                 DrawSample (hwndItem, &pFS[iLoc].lf);
00649                                 GlobalUnlock (pFL->hList);
00650                             }
00651                         }
00652                         GlobalUnlock (hFonts);
00653                     }
00654
00655                     if (_snprintf (szTmp, sizeof(szTmp) - 1, "EnumFonts %d of %d", iLoc+1, count) > 0 )
00656                     {
00657                         szTmp[sizeof(szTmp) - 1] = '\0';
00658                         SetWindowText (hwnd, szTmp);
00659                     }
00660                     break;
00661
00662                 case ED_NEXT:
00663                     pFL = (LPFONTLIST)GlobalLock (hFonts);
00664                     if (pFL) {
00665                         if ((pFL->count-1) > iLoc) {
00666                             iLoc++;
00667                             pFS = (LPFONTSTRUCT)GlobalLock (pFL->hList);
00668                             if (pFS) {
00669                                 FillEnumFields (hwnd, pFS[iLoc].ft, &pFS[iLoc].tm, &pFS[iLoc].lf, (bHex?16:10));
00670                                 hwndItem = GetDlgItem (hwnd, ED_SAMPLE);
00671                                 DrawSample (hwndItem, &pFS[iLoc].lf);
00672                                 GlobalUnlock (pFL->hList);
00673                             }
00674
00675                         }
00676                         GlobalUnlock (hFonts);
00677                     }
00678
00679                     if (_snprintf (szTmp, sizeof(szTmp) - 1, "EnumFonts %d of %d", iLoc+1, count) > 0 )
00680                     {
00681                         szTmp[sizeof(szTmp) - 1] = '\0';
00682                         SetWindowText (hwnd, szTmp);
00683                     }
00684                     break;
00685
00686                 case IDOK:
00687                     // Copy the LOGFONT structure from the enumeration list, into our private LF
00688                     pFL = (LPFONTLIST)GlobalLock (hFonts);
00689                     bDone = FALSE;
00690                     if (pFL) {
00691                         if ((pFL->count-1) >= iLoc) {
00692                             pFS = (LPFONTSTRUCT)GlobalLock (pFL->hList);
00693                             if (pFS) {
00694                                 lfDlg = pFS[iLoc].lf;
00695
00696                                 // Lets create a font with this new data
00697                                 hfont = CreateFontIndirect (&lfDlg);
00698                                 hdc = GetDC (hwnd);
00699                                 hfontPrev = SelectObject (hdc, hfont);
00700                                 GetTextMetrics (hdc, &tmTmp);
00701                                 // Get the face name
00702                                 GetTextFace    (hdc, sizeof(szTmp), szTmp);
00703                                 SelectObject (hdc, hfontPrev);
00704                                 DeleteObject (hfont);
00705                                 ReleaseDC (hwnd, hdc);
00706
00707                                 // And verify that we did indeed get the same font.
00708                                 bDone = TRUE;
00709                                 bDone = bDone && (pFS[iLoc].tm.tmHeight==tmTmp.tmHeight);
00710                                 bDone = bDone && (pFS[iLoc].tm.tmAscent==tmTmp.tmAscent);
00711                                 bDone = bDone && (pFS[iLoc].tm.tmDescent==tmTmp.tmDescent);
00712                                 bDone = bDone && (pFS[iLoc].tm.tmInternalLeading==tmTmp.tmInternalLeading);
00713                                 bDone = bDone && (pFS[iLoc].tm.tmExternalLeading==tmTmp.tmExternalLeading);
00714                                 bDone = bDone && (pFS[iLoc].tm.tmAveCharWidth==tmTmp.tmAveCharWidth);
00715                                 bDone = bDone && (pFS[iLoc].tm.tmMaxCharWidth==tmTmp.tmMaxCharWidth);
00716                                 bDone = bDone && (pFS[iLoc].tm.tmWeight==tmTmp.tmWeight);
00717                                 bDone = bDone && (pFS[iLoc].tm.tmItalic==tmTmp.tmItalic);
00718                                 bDone = bDone && (pFS[iLoc].tm.tmUnderlined==tmTmp.tmUnderlined);
00719                                 bDone = bDone && (pFS[iLoc].tm.tmStruckOut==tmTmp.tmStruckOut);
00720                                 bDone = bDone && (pFS[iLoc].tm.tmFirstChar==tmTmp.tmFirstChar);
00721                                 bDone = bDone && (pFS[iLoc].tm.tmLastChar==tmTmp.tmLastChar);
00722                                 bDone = bDone && (pFS[iLoc].tm.tmDefaultChar==tmTmp.tmDefaultChar);
00723                                 bDone = bDone && (pFS[iLoc].tm.tmBreakChar==tmTmp.tmBreakChar);
00724                                 bDone = bDone && (pFS[iLoc].tm.tmPitchAndFamily==tmTmp.tmPitchAndFamily);
00725                                 bDone = bDone && (pFS[iLoc].tm.tmCharSet==tmTmp.tmCharSet);
00726                                 // Did it work?
00727                                 if (bDone) {
00728                                     *lplf = lfDlg;
00729                                     //EndDialog(hwnd, TRUE);
00730                                     //return (TRUE);
00731                                 } else {
00732                                     // Again, font verification code is'nt quite up to
00733                                     // snuff yet, so just Select the font anyway:
00734                                     *lplf = lfDlg;
00735
00736                                     // ...and this is what we want to do once we fix the
00737                                     // font verification code:
00738                                     //lfDlg = *lplf;
00739                                     //MessageBox (GetFocus(),
00740                                     //    "Unable to re-create font from TextMetrics",
00741                                     //    "FontView", MB_OK);
00742                                 }
00743
00744
00745                                 GlobalUnlock (pFL->hList);
00746                             }
00747                         }
00748                         GlobalUnlock (hFonts);
00749                     }
00750
00751
00752                     // Now set our master lf to this value. This way, we 'could' verify that the
00753                     // LOGFONT structure will in fact select this particular font, we just aren't yet
00754                     // *lplf = lfDlg;
00755
00756                     pFL = (LPFONTLIST)GlobalLock (hFonts);
00757                     if (pFL) {
00758                         if (GlobalFree (pFL->hList)) {
00759                             MessageBox (GetFocus(), "Failed To Free", "pFL->hList", MB_OK);
00760                         } else {
00761                             GlobalUnlock (hFonts);
00762                             if (GlobalFree (hFonts)) {
00763                                 MessageBox (GetFocus(), "Failed To Free", "hFonts", MB_OK);
00764                             }
00765                         }
00766                     }
00767                     EndDialog(hwnd, TRUE);
00768                     return bDone;
00769
00770                 case IDCANCEL:
00771                     pFL = (LPFONTLIST)GlobalLock (hFonts);
00772                     if (pFL) {
00773                         if (GlobalFree (pFL->hList)) {
00774                             MessageBox (GetFocus(), "Failed To Free", "pFL->hList", MB_OK);
00775                         } else {
00776                             GlobalUnlock (hFonts);
00777                             if (GlobalFree (hFonts)) {
00778                                 MessageBox (GetFocus(), "Failed To Free", "hFonts", MB_OK);
00779                             }
00780                         }
00781                     }
00782                     EndDialog(hwnd, TRUE);
00783                     return TRUE;
00784             }
00785             break;
00786     }
00787     return FALSE;
00788
00789     lParam; // unreferenced formal parameter
00790 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/ScaleDemo/stdafx.h Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • ScaleDemo

stdafx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 /*+==========================================================================
00007
00008 File: StdAfx.h
00009 ----------------------------------------------------------------------------
00010
00011 This file is part of the Microsoft COM+ Samples.
00012
00013 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00014
00015 This source code is intended only as a supplement to Microsoft
00016 Development Tools and/or on-line documentation. See these other
00017 materials for detailed information regarding Microsoft code samples.
00018
00019 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00020 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00022 PARTICULAR PURPOSE.
00023
00024 ==========================================================================+*/
00025 #ifndef AFX_STDAFX_H__B2CBE3C0_EBAE_47C9_BEA5_42EAAF915CED__INCLUDED_
00026 #define AFX_STDAFX_H__B2CBE3C0_EBAE_47C9_BEA5_42EAAF915CED__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031
00032 #define WIN32_LEAN_AND_MEAN   // Exclude rarely-used stuff from Windows headers
00033
00034 #include <stdio.h>
00035
00036 #define STRICT
00037 #ifndef _WIN32_WINNT
00038 #define _WIN32_WINNT 0x0400
00039 #endif
00040 #define _ATL_APARTMENT_THREADED
00041
00042 #include <atlbase.h>
00043 //You may derive a class from CComModule and use it if you want to override
00044 //something, but do not change the name of _Module
00045 extern CComModule _Module;
00046 #include <atlcom.h>
00047
00048 //{{AFX_INSERT_LOCATION}}
00049 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00050
00051 #endif // !defined(AFX_STDAFX_H__B2CBE3C0_EBAE_47C9_BEA5_42EAAF915CED__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ReadTut/ReadTut.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ReadTut

ReadTut.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      READTUT.H
00003
00004   Summary:   Include file for the READTUT.EXE utility application.
00005              READTUT.H contains definitions of the application's string
00006              resource IDs.
00007
00008              For a comprehensive tutorial code tour of READTUT's
00009              contents and offerings see the tutorial READTUT.HTM file.
00010              For more specific technical details on the internal workings
00011              see the comments dispersed throughout the READTUT source code.
00012
00013   Classes:   .
00014
00015   Functions: WinMain
00016
00017   Origin:    12-18-96: atrent - Created for COM Tutorial Samples.
00018
00019 ----------------------------------------------------------------------------
00020   This file is part of the Microsoft COM Tutorial Code Samples.
00021
00022   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00023
00024   This source code is only intended as a supplement to Microsoft
00025   Development Tools and/or on-line documentation.  See these other
00026   materials for detailed information regarding Microsoft code samples.
00027
00028   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00029   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00030   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00031   PARTICULAR PURPOSE.
00032 ==========================================================================+*/
00033
00034 #if !defined(READTUT_H)
00035 #define READTUT_H
00036
00037 #define MAX_STRING 128
00038
00039 // Error-related String Identifiers.
00040 #define IDS_COMINITFAILED           2000
00041 #define IDS_OUTOFMEMORY             2001
00042
00043 #define IDS_ASSERT_FAIL             2200
00044
00045 // Notice-related String Identifiers.
00046 #define IDS_NOTIMPLEMENTED          2301
00047
00048 #define IDS_ERROR_TITLE             2400
00049
00050 #define IDD_LOADING_MSG             2500
00051
00052
00053 #endif
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Check_SD/Check_SD.c Source File

  • Security
  • Authorization
  • Check_SD

Check_SD.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1997 - 2000.  Microsoft Corporation.  All rights reserved
00008
00009 Module Name:
00010
00011     check_sd.c
00012
00013 Abstract:
00014
00015     This module calls a variety of different functions in the
00016     other modules to obtain security descriptor information
00017     associated with the object name passed to this module.
00018
00019 --*/
00020
00021 #include "check_sd.h"
00022 #include <tchar.h>
00023 #include <stdio.h>
00024
00025 void DisplayUsage(void)
00026 {
00027      _tprintf(TEXT("\nUsage: check_sd [object] [name]\n"));
00028          _tprintf(TEXT(" -a : mailslot, use \\\\[server]\\mailslot\\[mailslotname]\n"));
00029      _tprintf(TEXT(" -d : directory or driver letter, use \\\\.\\[driveletter]\n"));
00030      _tprintf(TEXT(" -e : event\n"));
00031      _tprintf(TEXT(" -f : file\n"));
00032      _tprintf(TEXT(" -i : memory mapped file\n"));
00033      _tprintf(TEXT(" -k : desktop, use [window station\\desktop]\n"));
00034      _tprintf(TEXT(" -l : printer, use \\\\[server]\\[printername]\n"));
00035      _tprintf(TEXT(" -m : mutex\n"));
00036      _tprintf(TEXT(" -n : named pipe, use \\\\[server or .]\\pipe\\[pipename]\n"));
00037      _tprintf(TEXT(" -o : process access token, use pid instead of name\n"));
00038      _tprintf(TEXT(" -p : process, use pid instead of name\n"));
00039      _tprintf(TEXT(" -r : registry key\n"));
00040      _tprintf(TEXT(" -s : sempahore\n"));
00041      _tprintf(TEXT(" -t : network share, use [server\\sharename]\n"));
00042      _tprintf(TEXT(" -v : service\n"));
00043      _tprintf(TEXT(" -w : window station\n"));
00044      return;
00045 }
00046
00047 void _tmain(int argc, TCHAR *argv[])
00048 {
00049      int u = 0;
00050
00051      //
00052      // display usage
00053      //
00054      if (argc != 3){
00055           DisplayUsage();
00056           return;
00057      }
00058
00059
00060    //
00061    // Do validation on the user input to help avoid buffer overruns.
00062    //
00063
00064    _try{
00065       //
00066     // argv[1] should be a null terminated string
00067       // of exactly two characters in length (not including the NULL).
00068     //
00069     if ((_T('-') != argv[1][0]) || (_T('\0') == argv[1][1]) || (_T('\0') != argv[1][2])){
00070        DisplayUsage();
00071        return;
00072     }
00073
00074     //
00075     // argv[2] should have at least one non-NULL character before a NULL character.
00076     //
00077     if (_T('\0') == argv[2][0]){
00078            DisplayUsage();
00079        return;
00080       }
00081
00082     //
00083     // argv[2] should not be a string of more than MAX_PATH characters.
00084     //
00085     u = 0;
00086     while (_T('\0') != argv[2][u]){
00087        if (MAX_PATH == u){
00088             DisplayUsage();
00089             return;
00090        }
00091        u++;
00092     }
00093
00094    }
00095    _except(EXCEPTION_EXECUTE_HANDLER){
00096           DisplayUsage();
00097           return;
00098    }
00099
00100      _tprintf(TEXT(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"));
00101      _tprintf(TEXT(">>                 SECURITY INFORMATION                >>\n"));
00102      _tprintf(TEXT(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n"));
00103      _tprintf(TEXT("object name ........ %s\n"), argv[2]);
00104      _tprintf(TEXT("object type ........ "));
00105
00106      switch (argv[1][1])
00107      {
00108           case 'a':
00109                _tprintf(TEXT("mailslot\n"));
00110                DumpKernelObject(argv[2], argv[1][1]);
00111                break;
00112           case 'e':
00113                _tprintf(TEXT("event\n"));
00114                DumpKernelObject(argv[2], argv[1][1]);
00115                break;
00116           case 'f':
00117                _tprintf(TEXT("file\n"));
00118                DumpFile(argv[2], argv[1][1]);
00119                break;
00120           case 'd':
00121                _tprintf(TEXT("directory\n"));
00122                DumpFile(argv[2], argv[1][1]);
00123                break;
00124           case 'm':
00125                _tprintf(TEXT("mutex\n"));
00126                DumpKernelObject(argv[2], argv[1][1]);
00127                break;
00128           case 'r':
00129                _tprintf(TEXT("registry\n"));
00130                DumpRegistryKey(argv[2]);
00131                break;
00132           case 's':
00133                _tprintf(TEXT("semaphore\n"));
00134                DumpKernelObject(argv[2], argv[1][1]);
00135                break;
00136           case 'p':
00137                _tprintf(TEXT("process\n"));
00138                DumpKernelObject(argv[2], argv[1][1]);
00139                break;
00140           case 'i':
00141                _tprintf(TEXT("memory mapped file\n"));
00142                DumpKernelObject(argv[2], argv[1][1]);
00143                break;
00144           case 'v':
00145                _tprintf(TEXT("service\n"));
00146                DumpService(NULL, argv[2]);
00147                break;
00148           case 'w':
00149                _tprintf(TEXT("window station\n"));
00150                DumpUserObject(argv[2], argv[1][1]);
00151                break;
00152           case 'k':
00153                _tprintf(TEXT("desktop\n"));
00154                DumpUserObject(argv[2], argv[1][1]);
00155                break;
00156           case 'n':
00157                _tprintf(TEXT("named pipe\n"));
00158                DumpKernelObject(argv[2], argv[1][1]);
00159                break;
00160           case 'o':
00161                _tprintf(TEXT("process access token\n"));
00162                DumpKernelObject(argv[2], argv[1][1]);
00163                break;
00164           case 'l':
00165                _tprintf(TEXT("printer\n"));
00166                DumpPrinter(argv[2]);
00167                break;
00168           case 't':
00169                _tprintf(TEXT("network share\n"));
00170                DumpNetShare(argv[2]);
00171                break;
00172           default:
00173                DisplayUsage();
00174      }
00175 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSimpleApp Member List

This is the complete list of members for CSimpleApp, including all inherited members.
AddFrameLevelTools() | CSimpleApp |
AddFrameLevelUI() | CSimpleApp |
ContextSensitiveHelp(BOOL fEnterMode) | CSimpleApp |
CSafeRefCount() | CSafeRefCount |
CSimpleApp() | CSimpleApp |
CSimpleApp() | CSimpleApp |
DecrementNestCount() | CSafeRefCount |
DestroyDocs() | CSimpleApp |
DestroyDocs() | CSimpleApp |
fInitApplication(HANDLE hInstance) | CSimpleApp |
fInitApplication(HANDLE hInstance) | CSimpleApp |
fInitInstance(HANDLE hInstance, int nCmdShow) | CSimpleApp |
fInitInstance(HANDLE hInstance, int nCmdShow) | CSimpleApp |
HandleAccelerators(LPMSG lpMsg) | CSimpleApp |
HandleAccelerators(LPMSG lpMsg) | CSimpleApp |
IncrementNestCount() | CSafeRefCount |
lCommandHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpleApp |
lCommandHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpleApp |
lCreateDoc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpleApp |
lCreateDoc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpleApp |
lSizeHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpleApp |
lSizeHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpleApp |
m_fAppActive | CSimpleApp |
m_fCSHMode | CSimpleApp |
m_fInitialized | CSimpleApp |
m_fMenuMode | CSimpleApp |
m_fOleStdInit | CSimpleApp |
m_hAppWnd | CSimpleApp |
m_hCascadeMenu | CSimpleApp |
m_hEditMenu | CSimpleApp |
m_hFileMenu | CSimpleApp |
m_hHelpMenu | CSimpleApp |
m_hInst | CSimpleApp |
m_hMainMenu | CSimpleApp |
m_hStdPal | CSimpleApp |
m_hwndUIActiveObj | CSimpleApp |
m_lpDoc | CSimpleApp |
m_nDragDelay | CSimpleApp |
m_nDragMinDist | CSimpleApp |
m_nScrollDelay | CSimpleApp |
m_nScrollInset | CSimpleApp |
m_nScrollInterval | CSimpleApp |
m_OleInPlaceFrame | CSimpleApp |
nullRect | CSimpleApp |
PaintApp(HDC hDC) | CSimpleApp |
PaintApp(HDC hDC) | CSimpleApp |
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CSimpleApp |
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CSimpleApp |
QueryNewPalette(void) | CSimpleApp |
SafeAddRef() | CSafeRefCount |
SafeRelease() | CSafeRefCount |
STDMETHODIMP_(ULONG) AddRef() | CSimpleApp |
STDMETHODIMP_(ULONG) Release() | CSimpleApp |
STDMETHODIMP_(ULONG) AddRef() | CSimpleApp |
STDMETHODIMP_(ULONG) Release() | CSimpleApp |
~CSafeRefCount() | CSafeRefCount | [virtual]
~CSimpleApp() | CSimpleApp |
~CSimpleApp() | CSimpleApp |
Generated on Wed Nov 13 2024 16:57:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminOS Member List

This is the complete list of members for comadmin::COMAdminOS, including all inherited members.
COMAdminOSWindows3_1 | comadmin::COMAdminOS | [static]
COMAdminOSWindows9x | comadmin::COMAdminOS | [static]
COMAdminOSWindowsNT | comadmin::COMAdminOS | [static]
COMAdminOSWindowsNTEnterprise | comadmin::COMAdminOS | [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

fullsvr::IFullServ Member List

This is the complete list of members for fullsvr::IFullServ, including all inherited members.
iid | fullsvr::IFullServ | [static]
Sum(int i, int j) | fullsvr::IFullServ |
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SuperUsr/SuperUsr.cpp Source File

  • Security
  • Authorization
  • SuperUsr

SuperUsr.cpp

Go to the documentation of this file.
00001 /*
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1998 - 2002.  Microsoft Corporation.  All rights reserved.
00008
00009
00010 This code sample requires the following import library:
00011     advapi32.lib
00012 */
00013
00014 #define UNICODE
00015 #define _UNICODE
00016 #define _WIN32_WINNT 0x0400
00017
00018 #include <windows.h>
00019 #include <aclapi.h>
00020 #include <stdio.h>
00021 #include <stdlib.h>
00022 #include <tchar.h>
00023 #include <strsafe.h> // for proper buffer handling
00024
00025 #define MAX_PID_DIGITS 6
00026
00027 #define CheckAndLocalFree(ptr) \
00028             if (ptr != NULL) \
00029             { \
00030                LocalFree(ptr); \
00031                ptr = NULL; \
00032             }
00033
00034 BOOL EnableDebugPriv(void);
00035 BOOL ModifySecurity(HANDLE hToken, DWORD dwAccess, PSECURITY_DESCRIPTOR *pOldSD);
00036 BOOL ResetSecurity(HANDLE hToken, PSECURITY_DESCRIPTOR pSid);
00037 void __cdecl MyPrintf(LPCTSTR lpszFormat, ...);
00038 BOOL BuildAdministratorsExplicitAccess(EXPLICIT_ACCESS *pExplicitAccess, DWORD dwAccess);
00039
00040 void _tmain(int argc, TCHAR *argv[])
00041 {
00042    HANDLE hProc = NULL;
00043    HANDLE hToken = NULL;
00044    HANDLE hOldToken = NULL;
00045    TCHAR szCmdExe[] = { _T("cmd.exe") } ;
00046    PROCESS_INFORMATION pi = { NULL, NULL, 0, 0 };
00047    PSECURITY_DESCRIPTOR pOldSD = NULL;
00048    STARTUPINFO si;
00049    DWORD SystemPID;
00050    BOOL fResult;
00051    CHAR szPID[MAX_PID_DIGITS];
00052    DWORD dwPID;
00053    HRESULT hr;
00054    int n;
00055
00056    if (argc != 2)
00057    {
00058       MyPrintf(_T("Usage: SuperUsr <System PID>\n"));
00059       return;
00060    }
00061
00062    __try
00063    {
00064       hr = StringCchLength(argv[1], MAX_PID_DIGITS, (size_t *)&dwPID);
00065       if (FAILED(hr))
00066       {
00067          MyPrintf(_T("StringCbLength failed with %X\n"), hr);
00068          __leave;
00069       }
00070
00071 #ifdef UNICODE
00072       n = WideCharToMultiByte(0, 0, argv[1], -1, szPID, dwPID + 1, NULL, NULL);
00073       if (n == 0)
00074       {
00075          MyPrintf(_T("WideCharToMultiByte failed with %d\n"), GetLastError());
00076          __leave;
00077       }
00078 #else
00079       hr = StringCchCopy(szPID, dwPID + 1, argv[1]);
00080       if (FAILED(hr))
00081       {
00082          MyPrintf(_T("StringCchCopy failed with %X\n"), hr);
00083          __leave;
00084       }
00085 #endif
00086
00087       SystemPID = (DWORD)atoi(szPID);
00088
00089       fResult = EnableDebugPriv();
00090       if(!fResult)
00091       {
00092          MyPrintf(_T("You probably don't have the SE_DEBUG_NAME privilege.\n"));
00093          MyPrintf(_T("You are probably not a member of the administrator group.\n"));
00094          __leave;
00095       }
00096
00097       hProc = OpenProcess(PROCESS_ALL_ACCESS,
00098                           FALSE,
00099                           SystemPID);
00100       if (!hProc)
00101       {
00102          MyPrintf(_T("OpenProcess failed with %d.\n"), GetLastError());
00103          __leave;
00104       }
00105
00106       //
00107       // Open the process token with this access
00108       // so that we can modify the DACL and add
00109       // TOKEN_DUPLICATE & TOKEN_ASSIGN_PRIMARY
00110       // rights for this user
00111       //
00112       fResult = OpenProcessToken(hProc,
00113                                  READ_CONTROL|WRITE_DAC,
00114                                  &hOldToken);
00115       if (!fResult)
00116       {
00117          MyPrintf(_T("OpenProcessToken failed with %d.\n"), GetLastError());
00118          __leave;
00119       }
00120
00121       fResult = ModifySecurity(hOldToken,
00122                                TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_QUERY,
00123                                &pOldSD);
00124       if (!fResult)
00125       {
00126          __leave;
00127       }
00128
00129       fResult = OpenProcessToken(hProc,
00130                                  TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_QUERY,
00131                                  &hToken);
00132       if (!fResult)
00133       {
00134          MyPrintf(_T("OpenProcessToken failed with %d.\n"), GetLastError());
00135          __leave;
00136       }
00137
00138       // Reset the security to the old permissions
00139       // We still retain the modified permissions
00140       // because we haven't closed the handle
00141       ResetSecurity(hOldToken, pOldSD);
00142
00143       //
00144       // setup STARTUPINFO structure
00145       //
00146       ZeroMemory(&si, sizeof(STARTUPINFO));
00147       si.cb = sizeof(STARTUPINFO);
00148
00149       //
00150       // winsta0\default is the interactive user's
00151       // desktop.  Setting lpDesktop to winsta0\default
00152       // tells CreateProcessAsUser to launch
00153       // cmd.exe in the interactive user's desktop.
00154       //
00155       si.lpDesktop = _T("winsta0\\default");
00156
00157       fResult = CreateProcessAsUser(hToken,
00158                                     NULL,
00159                                     szCmdExe,
00160                                     NULL, // default process attributes
00161                                     NULL, // default thread attributes
00162                                     FALSE, // don't inherit handles
00163                                     CREATE_NEW_CONSOLE,
00164                                     NULL,  // inherit environment
00165                                     NULL,  // same directory
00166                                     &si,
00167                                     &pi );
00168       if (!fResult)
00169       {
00170          MyPrintf(_T("CreateProcessAsUser failed with %d.\n"), GetLastError());
00171       }
00172       else
00173       {
00174          MyPrintf(_T("\"SuperUsr\" mode console started!\n"));
00175       }
00176    }
00177    __finally
00178    {
00179       // Cleanup
00180       if (pi.hThread != NULL) CloseHandle(pi.hThread);
00181       if (pi.hProcess != NULL) CloseHandle(pi.hProcess);
00182       if (hProc != NULL) CloseHandle(hProc);
00183       if (hToken != NULL) CloseHandle(hToken);
00184       if (hOldToken != NULL) CloseHandle(hOldToken);
00185       CheckAndLocalFree(pOldSD);
00186    }
00187 }
00188
00189 BOOL EnableDebugPriv(void)
00190 {
00191    TOKEN_PRIVILEGES tp;
00192    HANDLE hToken = NULL;
00193    BOOL fReturn = FALSE;
00194    BOOL fResult;
00195    LUID luid;
00196
00197    __try
00198    {
00199       fResult = OpenProcessToken(GetCurrentProcess(),
00200                                  TOKEN_ADJUST_PRIVILEGES,
00201                                  &hToken);
00202       if (!fResult)
00203       {
00204          MyPrintf(_T("OpenProcessToken failed with %d.\n"), GetLastError());
00205          __leave;
00206       }
00207
00208       // Lookup Debug Privilege Luid
00209       fResult = LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luid);
00210       if (!fResult)
00211       {
00212          MyPrintf(_T("LookupPrivilegeValue failed with %d.\n"), GetLastError());
00213          __leave;
00214       }
00215
00216       tp.PrivilegeCount           = 1;
00217       tp.Privileges[0].Luid       = luid;
00218       tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
00219
00220       // Enable privilege
00221       fResult = AdjustTokenPrivileges(hToken,
00222                                       FALSE,
00223                                       &tp,
00224                                       sizeof(TOKEN_PRIVILEGES),
00225                                       NULL,
00226                                       NULL);
00227       if (!fResult || GetLastError() != ERROR_SUCCESS)
00228       {
00229          MyPrintf(_T("AdjustTokenPrivileges failed with %d.\n"), GetLastError());
00230          __leave;
00231       }
00232
00233       fReturn = TRUE;
00234    }
00235    __finally
00236    {
00237       // Cleanup
00238       if (hToken != NULL) CloseHandle(hToken);
00239    }
00240
00241    return(fReturn);
00242 }
00243
00244 BOOL ModifySecurity(HANDLE hToken, DWORD dwAccess, PSECURITY_DESCRIPTOR *pOldSD)
00245 {
00246    PSECURITY_DESCRIPTOR pSD = NULL;
00247    PSECURITY_DESCRIPTOR pAbsSD = NULL;
00248    PACL pNewAcl = NULL;
00249    DWORD dwAclSize = 0, dwSaclSize = 0;
00250    DWORD dwSidOwnLen = 0, dwSidPrimLen = 0;
00251    DWORD dwSDLength = 0;
00252    DWORD dwSDLengthNeeded;
00253    EXPLICIT_ACCESS explicitaccess;
00254    DWORD dwResult;
00255    PACL pAcl;
00256    PACL pacl;
00257    BOOL fDaclPresent,fDaclDefaulted;
00258    BOOL fResult;
00259    BOOL fReturn = FALSE;
00260
00261    __try
00262    {
00263       explicitaccess.Trustee.ptstrName = NULL;
00264
00265       // Get size of security descriptor
00266       fResult = GetKernelObjectSecurity(hToken,
00267                                         DACL_SECURITY_INFORMATION,
00268                                         NULL,
00269                                         0,
00270                                         &dwSDLengthNeeded);
00271       if (!fResult)
00272       {
00273          if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
00274          {
00275             // Allocate memory for security descriptor
00276             pSD = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, dwSDLengthNeeded);
00277             if (!pSD)
00278             {
00279                MyPrintf(_T("Unable to allocate memory for security descriptor.\n"));
00280                __leave;
00281             }
00282
00283             *pOldSD = pSD;
00284
00285             // Get Security Descriptor from token
00286             fResult = GetKernelObjectSecurity(hToken,
00287                                         DACL_SECURITY_INFORMATION,
00288                                         pSD,
00289                                         dwSDLengthNeeded,
00290                                         &dwSDLengthNeeded);
00291             if (!fResult)
00292             {
00293                MyPrintf(_T("GetKernelObjectSecurity failed with %d.\n"), GetLastError());
00294                __leave;
00295             }
00296          }
00297          else
00298          {
00299             MyPrintf(_T("GetKernelObjectSecurity failed with %d.\n"), GetLastError());
00300             __leave;
00301          }
00302       }
00303
00304       // Get pointer to the DACL
00305       fResult = GetSecurityDescriptorDacl(pSD,
00306                                           &fDaclPresent,
00307                                           &pAcl,
00308                                           &fDaclDefaulted);
00309       if (!fResult)
00310       {
00311          MyPrintf(_T("GetSecurityDescriptorDacl failed with %d.\n"), GetLastError());
00312          __leave;
00313       }
00314
00315       // Build Administrators EXPLICIT_ACCESS Structure
00316       fResult = BuildAdministratorsExplicitAccess(&explicitaccess, dwAccess);
00317       if (!fResult)
00318       {
00319          __leave;
00320       }
00321
00322       // Add the entry to the ACL
00323       dwResult = SetEntriesInAcl(1,
00324                                  &explicitaccess,
00325                                  pAcl,
00326                                  &pNewAcl);
00327       if (dwResult != ERROR_SUCCESS)
00328       {
00329          MyPrintf(_T("SetEntriesInAcl failed with %d.\n"), GetLastError());
00330          __leave;
00331       }
00332
00333       // Get Sizes for Absolute Security Descriptor
00334       // We only need dwSDLength and dwAclSize.
00335       // The SACL, SID owner, and SID primary group
00336       // are not present.
00337       fResult = MakeAbsoluteSD(pSD,
00338                                NULL,
00339                                &dwSDLength,
00340                                NULL,
00341                                &dwAclSize,
00342                                NULL,
00343                                &dwSaclSize,
00344                                NULL,
00345                                &dwSidOwnLen,
00346                                NULL,
00347                                &dwSidPrimLen);
00348       if (!fResult)
00349       {
00350          if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
00351          {
00352             // Allocate memory for absolute Security Descriptor
00353             pAbsSD = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, dwSDLength);
00354             if (!pAbsSD)
00355             {
00356                MyPrintf(_T("Unable to allocate memory for Absolute SID.\n"));
00357                __leave;
00358             }
00359
00360             // Allocate memory for DACL
00361             pacl = (PACL)LocalAlloc(LPTR, dwAclSize);
00362             if (!pacl)
00363             {
00364                MyPrintf(_T("Unable to allocate memory for DACL.\n"));
00365                __leave;
00366             }
00367          }
00368          else
00369          {
00370             MyPrintf(_T("MakeAbsoluteSD failed with %d.\n"), GetLastError());
00371             __leave;
00372          }
00373       }
00374
00375       // Create absolute Security Descriptor
00376       fResult = MakeAbsoluteSD(pSD,
00377                                pAbsSD,
00378                                &dwSDLength,
00379                                pacl,
00380                                &dwAclSize,
00381                                NULL,
00382                                &dwSaclSize,
00383                                NULL,
00384                                &dwSidOwnLen,
00385                                NULL,
00386                                &dwSidPrimLen);
00387       if (!fResult)
00388       {
00389          MyPrintf(_T("MakeAbsoluteSD failed with %d.\n"), GetLastError());
00390          __leave;
00391       }
00392
00393       // Add the new DACL to the SD
00394       fResult = SetSecurityDescriptorDacl(pAbsSD,
00395                                           fDaclPresent,
00396                                           pNewAcl,
00397                                           fDaclDefaulted);
00398       if (!fResult)
00399       {
00400          MyPrintf(_T("SetSecurityDescriptorDacl failed with %d.\n"), GetLastError());
00401          __leave;
00402       }
00403
00404       // Add the new SD to the token
00405       fResult = SetKernelObjectSecurity(hToken,
00406                                         DACL_SECURITY_INFORMATION,
00407                                         pAbsSD);
00408       if (!fResult)
00409       {
00410          MyPrintf(_T("SetKernelObjectSecurity failed with %d.\n"), GetLastError());
00411          __leave;
00412       }
00413
00414       fReturn = TRUE;
00415    }
00416    __finally
00417    {
00418       // Cleanup
00419       if (explicitaccess.Trustee.ptstrName != NULL)
00420       {
00421          FreeSid(explicitaccess.Trustee.ptstrName);
00422       }
00423       CheckAndLocalFree(pAbsSD);
00424       CheckAndLocalFree(pacl);
00425       CheckAndLocalFree(pNewAcl);
00426       if (!fReturn)
00427       {
00428          CheckAndLocalFree(pSD);
00429          *pOldSD = NULL;
00430       }
00431    }
00432
00433    return fReturn;
00434 }
00435
00436 BOOL BuildAdministratorsExplicitAccess(EXPLICIT_ACCESS *pExplicitAccess, DWORD dwAccess)
00437 {
00438    SID_IDENTIFIER_AUTHORITY SystemSidAuthority = SECURITY_NT_AUTHORITY;
00439    PSID pSid = NULL;
00440    BOOL fResult;
00441
00442    // Create "Administrators" SID
00443    fResult = AllocateAndInitializeSid(&SystemSidAuthority,
00444                                        2,
00445                                        SECURITY_BUILTIN_DOMAIN_RID,
00446                                        DOMAIN_ALIAS_RID_ADMINS,
00447                                        0,
00448                                        0,
00449                                        0,
00450                                        0,
00451                                        0,
00452                                        0,
00453                                        &pSid);
00454    if (!fResult)
00455    {
00456       MyPrintf(_T("AllocateAndInitializeSid failed with %d.\n"), GetLastError());
00457       return FALSE;
00458    }
00459
00460    pExplicitAccess->grfAccessMode = GRANT_ACCESS;
00461    pExplicitAccess->grfAccessPermissions = dwAccess;
00462    pExplicitAccess->grfInheritance = 0;
00463
00464    // Build the Trustee with the SID
00465    BuildTrusteeWithSid(&(pExplicitAccess->Trustee), pSid);
00466
00467    return TRUE;
00468 }
00469
00470 void __cdecl MyPrintf(LPCTSTR lpszFormat, ...)
00471 {
00472    TCHAR szOutput[2048];
00473    va_list v1 = NULL;
00474    HRESULT hr = S_OK;
00475
00476    va_start(v1, lpszFormat);
00477    hr = StringCbVPrintf(szOutput, sizeof(szOutput), lpszFormat, v1);
00478    if (SUCCEEDED(hr))
00479    {
00480       OutputDebugString(szOutput);
00481       _tprintf(szOutput);
00482    }
00483    else
00484    {
00485       _tprintf(_T("StringCbVPrintf failed with %X\n"), hr);
00486    }
00487 }
00488
00489 BOOL ResetSecurity(HANDLE hToken, PSECURITY_DESCRIPTOR pSD)
00490 {
00491    BOOL fResult;
00492
00493    // Add the new SD to the token
00494    fResult = SetKernelObjectSecurity(hToken,
00495                                      DACL_SECURITY_INFORMATION,
00496                                      pSD);
00497    if (!fResult)
00498    {
00499       MyPrintf(_T("SetKernelObjectSecurity failed with %d.\n"), GetLastError());
00500       return FALSE;
00501    }
00502
00503    return TRUE;
00504 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/mfc_tree/XMLTree.h Source File

  • Web
  • xml
  • mfc_tree

XMLTree.h

Go to the documentation of this file.
00001
00002 //=--------------------------------------------------------------------------=
00003 //  (C) Copyright 1996 - 2000 Microsoft Corporation. All Rights Reserved.
00004 //=--------------------------------------------------------------------------=
00005 // XMLTree.h : main header file for the XMLTREE application
00006 //
00007
00008 #if !defined(AFX_XMLTREE_H__3C9F0B05_FD51_11D2_AC35_00600812D7F9__INCLUDED_)
00009 #define AFX_XMLTREE_H__3C9F0B05_FD51_11D2_AC35_00600812D7F9__INCLUDED_
00010
00011 #if _MSC_VER > 1000
00012 #pragma once
00013 #endif // _MSC_VER > 1000
00014
00015 #ifndef __AFXWIN_H__
00016   #error include 'stdafx.h' before including this file for PCH
00017 #endif
00018
00019 #include "resource.h"   // main symbols
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 // CXMLTreeApp:
00023 // See XMLTree.cpp for the implementation of this class
00024 //
00025
00026 class CXMLTreeApp : public CWinApp
00027 {
00028 public:
00029   CXMLTreeApp();
00030
00031 // Overrides
00032   // ClassWizard generated virtual function overrides
00033   //{{AFX_VIRTUAL(CXMLTreeApp)
00034   public:
00035   virtual BOOL InitInstance();
00036   //}}AFX_VIRTUAL
00037
00038 // Implementation
00039
00040   //{{AFX_MSG(CXMLTreeApp)
00041     // NOTE - the ClassWizard will add and remove member functions here.
00042     //    DO NOT EDIT what you see in these blocks of generated code !
00043   //}}AFX_MSG
00044   DECLARE_MESSAGE_MAP()
00045 };
00046
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049
00050 //{{AFX_INSERT_LOCATION}}
00051 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00052
00053 #endif // !defined(AFX_XMLTREE_H__3C9F0B05_FD51_11D2_AC35_00600812D7F9__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/res.h Source File

  • WinUI
  • GlobalDev
  • globaldev

res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Used by GRes409.rc
00003 //
00004 #define STR_LANGID                      1
00005 #define STR_LANG                        2
00006 #define STR_NLANG                       3
00007 #define STR_NCOUNTRY                    4
00008 #define STR_ACP                         5
00009 #define STR_OEMCP                       6
00010 #define IDS_RESTART                     7
00011 #define IDS_NLSWEB                      8
00012 #define IDS_MUIWEB                      9
00013 #define IDS_GLOBALDEV                   10
00014 #define IDS_MULTILINGUAL                11
00015 #define DLG_NLS                         101
00016 #define DLG_FONT                        102
00017 #define DLG_USP                         103
00018 #define DLG_MIRRORING                   104
00019 #define DLG_GENERAL                     104
00020 #define DLG_MUI                         105
00021 #define DLG_TEXT                        106
00022 #define DLG_LCID                        107
00023 #define IDB_BITMAP1                     108
00024 #define IDC_LV_LCID                     1005
00025 #define IDC_POS_NUMBER                  1009
00026 #define IDC_NEG_NUMBER                  1010
00027 #define IDC_POS_CURRENCY                1011
00028 #define IDC_NEG_CURRENCY                1012
00029 #define IDC_TIMESAMPLE                  1013
00030 #define IDC_TIMEFORMAT                  1015
00031 #define IDC_SDATESAMPLE                 1016
00032 #define IDC_SDATEFORMAT                 1017
00033 #define IDC_LDATESAMPLE                 1018
00034 #define IDC_LANGNAME                    1018
00035 #define IDC_EDITWIN                     1018
00036 #define IDC_LDATEFORMAT                 1019
00037 #define IDC_NLANGNAME                   1019
00038 #define IDB_CLEAR                       1019
00039 #define IDC_CALFORMAT                   1020
00040 #define IDC_NCOUNTRYNAME                1020
00041 #define IDB_FONT                        1020
00042 #define IDC_LANGUAGES                   1020
00043 #define IDC_ACP                         1021
00044 #define IDB_READING                     1021
00045 #define IDC_OEM                         1022
00046 #define IDB_ALIGN                       1022
00047 #define IDC_MUIWEB                      1032
00048 #define IDC_GLOBALDEV                   1033
00049 #define IDC_MUIWEB2                     1033
00050 #define IDC_MULTILINGUAL                1036
00051 #define IDC_PURPOSE                     1044
00052 #define IDC_NLSWEB                      1086
00053
00054 // Next default values for new objects
00055 //
00056 #ifdef APSTUDIO_INVOKED
00057 #ifndef APSTUDIO_READONLY_SYMBOLS
00058 #define _APS_NEXT_RESOURCE_VALUE        113
00059 #define _APS_NEXT_COMMAND_VALUE         40001
00060 #define _APS_NEXT_CONTROL_VALUE         1048
00061 #define _APS_NEXT_SYMED_VALUE           101
00062 #endif
00063 #endif
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/cxhndl/Cxhndl.Idl Source File

  • NetDS
  • RPC
  • Handles
  • cxhndl

Cxhndl.Idl

Go to the documentation of this file.
00001 [ uuid (A4F1DB00-CA47-1067-B31F-00DD010662DA),
00002   version(1.0),
00003   pointer_default(unique)
00004 ]
00005 interface cxhndl
00006 {
00007
00008 const short BUFSIZE = 1024;
00009
00010 typedef [context_handle] void *PCONTEXT_HANDLE_TYPE;
00011
00012 short RemoteOpen( [out] PCONTEXT_HANDLE_TYPE *pphContext,
00013                   [in, string] unsigned char *pszFile
00014                 );
00015
00016 short RemoteRead( [in]  PCONTEXT_HANDLE_TYPE phContext,
00017                   [out] unsigned char achBuf[BUFSIZE],
00018                   [out] short *pcbBuf
00019                 );
00020
00021 short RemoteClose( [in, out] PCONTEXT_HANDLE_TYPE *pphContext );
00022
00023 void Shutdown(void);
00024
00025 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

UPNPDimmerDevice Member List

This is the complete list of members for UPNPDimmerDevice, including all inherited members.
descriptionDoc | UPNPDimmerDevice | [private]
GetServiceObject(BSTR bstrUDN, BSTR bstrServiceId, IDispatch **ppdispService) | UPNPDimmerDevice |
Initialize(BSTR bstrXMLDesc, BSTR deviceID, BSTR bstrInitString) | UPNPDimmerDevice |
pDisPtrs | UPNPDimmerDevice | [private]
serviceIDDeviceMap | UPNPDimmerDevice | [private]
UDNmapping | UPNPDimmerDevice | [private]
UPNPDimmerDevice() | UPNPDimmerDevice |
~UPNPDimmerDevice() | UPNPDimmerDevice |
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/perstor.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

perstor.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          PerStor.cpp
00021
00022   Description:   CPersistStorage implementation.
00023
00024 **************************************************************************/
00025
00026 /**************************************************************************
00027 #include statements
00028 **************************************************************************/
00029
00030 #include "PerStor.h"
00031
00032 /**************************************************************************
00033
00034   CPersistStorage::CPersistStorage()
00035
00036 **************************************************************************/
00037
00038 CPersistStorage::CPersistStorage(COleDocument *pOleDoc)
00039 {
00040   OutputDebugString(TEXT("CPersistStorage's constructor\n"));
00041
00042   m_pOleDoc = pOleDoc;
00043
00044   m_pStorage = NULL;
00045   m_pColorStream = NULL;
00046   m_fSameAsLoad = FALSE;
00047 }
00048
00049 /**************************************************************************
00050
00051   CPersistStorage::~CPersistStorage()
00052
00053 **************************************************************************/
00054
00055 CPersistStorage::~CPersistStorage()
00056 {
00057   OutputDebugString(TEXT("CPersistStorage's destructor\n"));
00058 }
00059
00060 /**************************************************************************
00061
00062   CPersistStorage::QueryInterface()
00063
00064 **************************************************************************/
00065
00066 STDMETHODIMP CPersistStorage::QueryInterface(REFIID riid, LPVOID *ppReturn)
00067 {
00068   OutputDebugString(TEXT("CPersistStorage::QueryInterface\n"));
00069
00070   return m_pOleDoc->QueryInterface(riid, ppReturn);
00071 }
00072
00073 /**************************************************************************
00074
00075   CPersistStorage::AddRef()
00076
00077 **************************************************************************/
00078
00079 STDMETHODIMP_(ULONG) CPersistStorage::AddRef()
00080 {
00081   OutputDebugString(TEXT("CPersistStorage::AddRef\n"));
00082
00083   return m_pOleDoc->AddRef();
00084 }
00085
00086 /**************************************************************************
00087
00088   CPersistStorage::Release()
00089
00090 **************************************************************************/
00091
00092 STDMETHODIMP_(ULONG) CPersistStorage::Release()
00093 {
00094   OutputDebugString(TEXT("CPersistStorage::Release\n"));
00095
00096   return m_pOleDoc->Release();
00097 }
00098
00099 /**************************************************************************
00100
00101   CPersistStorage::InitNew()
00102
00103 **************************************************************************/
00104
00105 STDMETHODIMP CPersistStorage::InitNew(LPSTORAGE pStg)
00106 {
00107   OutputDebugString(TEXT("CPersistStorage::InitNew\n"));
00108
00109   // release any streams and storages that may be open
00110   ReleaseStreamsAndStorage();
00111
00112   m_pStorage = pStg;
00113
00114   // AddRef the new Storage
00115   if (m_pStorage)
00116     m_pStorage->AddRef();
00117
00118   CreateStreams(m_pStorage);
00119
00120   return S_OK;
00121 }
00122
00123 /**************************************************************************
00124
00125   CPersistStorage::GetClassID()
00126
00127 **************************************************************************/
00128
00129 STDMETHODIMP CPersistStorage::GetClassID(LPCLSID pClassID)
00130 {
00131   OutputDebugString(TEXT("CPersistStorage::GetClassID\n"));
00132
00133   *pClassID = CLSID_SimpleDocObject;
00134
00135   return S_OK;
00136 }
00137
00138 /**************************************************************************
00139
00140   CPersistStorage::Save()
00141
00142 **************************************************************************/
00143
00144 STDMETHODIMP CPersistStorage::Save(LPSTORAGE pStg, BOOL fSameAsLoad)
00145 {
00146   OutputDebugString(TEXT("CPersistStorage::Save\n"));
00147
00148   m_pOleDoc->m_fNoScribbleMode = TRUE;
00149
00150   // save the data
00151   LPSTREAM pTempColor;
00152
00153   if(!fSameAsLoad)
00154   {
00155     if(!pStg)
00156       return E_FAIL;
00157
00158     CreateStreams(pStg, &pTempColor);
00159   }
00160   else
00161   {
00162     pStg = m_pStorage;
00163
00164     if(!pStg)
00165       return E_FAIL;
00166
00167     pTempColor = m_pColorStream;
00168     pTempColor->AddRef();
00169   }
00170
00171   //write our class ID into the storage
00172   CLSID clsid;
00173   GetClassID(&clsid);
00174   WriteClassStg(pStg, clsid);
00175
00176   ULARGE_INTEGER uli;
00177
00178   uli.LowPart = 0;
00179   uli.HighPart = 0;
00180
00181   pTempColor->SetSize(uli);
00182
00183   LARGE_INTEGER li;
00184
00185   li.LowPart = 0;
00186   li.HighPart = 0;
00187
00188   pTempColor->Seek(li, STREAM_SEEK_SET, NULL);
00189
00190   // write the color to the stream
00191   pTempColor->Write(&m_pOleDoc->m_Color, sizeof(m_pOleDoc->m_Color), NULL);
00192
00193   pTempColor->Release();
00194
00195   m_fSameAsLoad = fSameAsLoad;
00196
00197   m_pOleDoc->m_fDirty = FALSE;
00198
00199   return S_OK;
00200 }
00201
00202 /**************************************************************************
00203
00204   CPersistStorage::SaveCompleted()
00205
00206 **************************************************************************/
00207
00208 STDMETHODIMP CPersistStorage::SaveCompleted(LPSTORAGE pStgNew)
00209 {
00210   OutputDebugString(TEXT("CPersistStorage::SaveCompleted\n"));
00211
00212   if(pStgNew)
00213   {
00214     ReleaseStreamsAndStorage();
00215     m_pStorage = pStgNew;
00216     m_pStorage->AddRef();
00217     OpenStreams(pStgNew);
00218   }
00219
00220   if(pStgNew || m_fSameAsLoad)
00221   {
00222     if(m_pOleDoc->m_fNoScribbleMode)
00223     {
00224       if(m_pOleDoc->m_pOleAdviseHolder)
00225         m_pOleDoc->m_pOleAdviseHolder->SendOnSave();
00226     }
00227
00228     m_fSameAsLoad = FALSE;
00229   }
00230
00231   m_pOleDoc->m_fNoScribbleMode = FALSE;
00232
00233   return S_OK;
00234 }
00235
00236 /**************************************************************************
00237
00238   CPersistStorage::Load()
00239
00240 **************************************************************************/
00241
00242 STDMETHODIMP CPersistStorage::Load(LPSTORAGE pStg)
00243 {
00244   OutputDebugString(TEXT("CPersistStorage::Load\n"));
00245
00246   // remember the storage
00247   if(m_pStorage)
00248   {
00249     m_pStorage->Release();
00250     m_pStorage = NULL;
00251   }
00252
00253   m_pStorage = pStg;
00254
00255   m_pStorage->AddRef();
00256
00257   //read our class ID from the storage
00258   CLSID clsidStg;
00259   ReadClassStg(m_pStorage, &clsidStg);
00260
00261   OpenStreams(m_pStorage);
00262
00263   // read the color
00264   if(FAILED(m_pColorStream->Read(&m_pOleDoc->m_Color, sizeof(m_pOleDoc->m_Color), NULL)))
00265   {
00266     m_pOleDoc->m_Color = DEFAULT_COLOR;
00267   }
00268
00269   m_pOleDoc->m_fDirty = FALSE;
00270
00271   return S_OK;
00272 }
00273
00274 /**************************************************************************
00275
00276   CPersistStorage::IsDirty()
00277
00278 **************************************************************************/
00279
00280 STDMETHODIMP CPersistStorage::IsDirty()
00281 {
00282   OutputDebugString(TEXT("CPersistStorage::IsDirty\n"));
00283
00284   return (m_pOleDoc->m_fDirty ? S_OK : S_FALSE);
00285 }
00286
00287 /**************************************************************************
00288
00289   CPersistStorage::HandsOffStorage()
00290
00291 **************************************************************************/
00292
00293 STDMETHODIMP CPersistStorage::HandsOffStorage()
00294 {
00295   OutputDebugString(TEXT("CPersistStorage::HandsOffStorage\n"));
00296
00297   ReleaseStreamsAndStorage();
00298
00299   return S_OK;
00300 }
00301
00302 /**************************************************************************
00303
00304   CPersistStorage::CreateStreams()
00305
00306 **************************************************************************/
00307
00308 void CPersistStorage::CreateStreams(LPSTORAGE pStg)
00309 {
00310   if(m_pColorStream)
00311     m_pColorStream->Release();
00312
00313   // create a stream to save the color
00314   pStg->CreateStream(  OLESTR("Color"),
00315     STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
00316     0,
00317     0,
00318     &m_pColorStream);
00319
00320 }
00321
00322 /**************************************************************************
00323
00324   CPersistStorage::CreateStreams()
00325
00326 **************************************************************************/
00327
00328 void CPersistStorage::CreateStreams(   LPSTORAGE pStg,
00329                   LPSTREAM* ppNewColorStream)
00330 {
00331   LPSTREAM pTempColorStream;
00332
00333   //save the member streams
00334   pTempColorStream = m_pColorStream;
00335
00336   //initialize the streams
00337   m_pColorStream = *ppNewColorStream = NULL;
00338
00339   //create the streams
00340   CreateStreams(pStg);
00341
00342   //copy the new streams
00343   *ppNewColorStream = m_pColorStream;
00344
00345   //restore the member streams
00346   m_pColorStream = pTempColorStream;
00347 }
00348
00349 /**************************************************************************
00350
00351   CPersistStorage::OpenStreams()
00352
00353 **************************************************************************/
00354
00355 void CPersistStorage::OpenStreams(LPSTORAGE pStg)
00356 {
00357   if(m_pColorStream)
00358     m_pColorStream->Release();
00359
00360   // open the color stream
00361   pStg->OpenStream( OLESTR("Color"),
00362     0,
00363     STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
00364     0,
00365     &m_pColorStream);
00366
00367 }
00368
00369 /**************************************************************************
00370
00371   CPersistStorage::ReleaseStreamsAndStorage()
00372
00373 **************************************************************************/
00374
00375 void CPersistStorage::ReleaseStreamsAndStorage()
00376 {
00377   if(m_pColorStream)
00378   {
00379     m_pColorStream->Release();
00380     m_pColorStream = NULL;
00381   }
00382
00383   if(m_pStorage)
00384   {
00385     m_pStorage->Release();
00386     m_pStorage = NULL;
00387   }
00388 }
00389
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDllData Member List

This is the complete list of members for CDllData, including all inherited members.
hDllInst | CDllData
iUserCount | CDllData
pMsgBox | CDllData
Generated on Wed Nov 13 2024 16:56:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/msistuff/msistuff.cpp Source File

  • SysMgmt
  • Msi
  • msistuff

msistuff.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //      Copyright (C) Microsoft Corporation. All rights reserved.
00004 //
00005 //      File:           msistuff.cpp
00006 //
00007 //--------------------------------------------------------------------------
00008
00009 #include <windows.h>
00010 #include <tchar.h>
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 #include "..\setup.exe\common.h"
00014 #include "strsafe.h"
00015
00016 //=======================================================
00017 // command line options and matching properties
00018 // ORDER is IMPORTANT!
00019 //=======================================================
00020 TCHAR rgszCommandOptions[]= TEXT("udnviwpmo");
00021 //////////////////////////        012345678
00022
00023 TCHAR* rgszResName[] = {
00024 /* BaseURL                 */ ISETUPPROPNAME_BASEURL,
00025 /* Msi Package             */ ISETUPPROPNAME_DATABASE,
00026 /* Product Name            */ ISETUPPROPNAME_PRODUCTNAME,
00027 /* Minimum Msi Version     */ ISETUPPROPNAME_MINIMUM_MSI,
00028 /* Update URL Location     */ ISETUPPROPNAME_UPDATELOCATION,
00029 /* InstMsiW                */ ISETUPPROPNAME_UPDATE,
00030 /* Properties              */ ISETUPPROPNAME_PROPERTIES,
00031 /* Patch                   */ ISETUPPROPNAME_PATCH,
00032 /* Operation               */ ISETUPPROPNAME_OPERATION
00033 };
00034 const int cStandardProperties = sizeof(rgszResName)/sizeof(TCHAR*);
00035
00036 TCHAR rgchResSwitch[] ={TEXT('u'),TEXT('d'),TEXT('n'),TEXT('v'),TEXT('i'),TEXT('w'),TEXT('p'),TEXT('m'),TEXT('o')};
00037
00038 const DWORD lcidLOCALE_INVARIANT = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
00039
00040 //=======================================================
00041 // special options
00042 //=======================================================
00043 const TCHAR chProperties      = TEXT('p');
00044 const TCHAR chMinMsiVer       = TEXT('v');
00045 const TCHAR chOperation       = TEXT('o');
00046 const TCHAR szInstall[]         = TEXT("INSTALL");
00047 const TCHAR szInstallUpd[]      = TEXT("INSTALLUPD");
00048 const TCHAR szMinPatch[]        = TEXT("MINPATCH");
00049 const TCHAR szMajPatch[]        = TEXT("MAJPATCH");
00050 const int   iMinMsiAllowedVer = 150;
00051
00052
00053
00054 //=======================================================
00055 // function prototypes
00056 //=======================================================
00057
00058 void           DisplayHelp();
00059 bool           ParseCommandLine(LPTSTR lpCommandLine);
00060 TCHAR          SkipWhiteSpace(TCHAR*& rpch);
00061 bool           SkipValue(TCHAR*& rpch);
00062 bool           RemoveQuotes(LPCTSTR lpOriginal, LPTSTR lpStripped, DWORD cchStripped);
00063 bool           DisplayResources(LPCTSTR lpExecutable);
00064 bool           DisplayInstallResource(HMODULE hExeModule, LPCTSTR lpszType, LPCTSTR lpszName);
00065 BOOL  CALLBACK EnumResNamesProc(HMODULE hExeModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam);
00066
00067 //=======================================================
00068 // global constants
00069 //=======================================================
00070 int g_cResources = 0; // count of resources in setup.exe; information purposes only
00071
00072 //_____________________________________________________________________________________________________
00073 //
00074 // main
00075 //_____________________________________________________________________________________________________
00076
00077 extern "C" int __cdecl _tmain(int argc, TCHAR* argv[])
00078 {
00079         if (argc <= 2)
00080         {
00081                 if (1 == argc
00082                     || 0 == lstrcmp(argv[1], TEXT("/?"))
00083                     || 0 == lstrcmp(argv[1], TEXT("-?")))
00084                 {
00085                         //
00086                         // display help
00087
00088                         DisplayHelp();
00089                 }
00090                 else
00091                 {
00092                         //
00093                         // display setup resources
00094
00095                         TCHAR szExecutable[MAX_PATH] = {0};
00096                         if (FAILED(StringCchCopy(szExecutable, sizeof(szExecutable)/sizeof(szExecutable[0]), argv[1])))
00097                             return -1;
00098                         if (!DisplayResources(szExecutable))
00099                                 return -1;
00100                 }
00101
00102         }
00103         else
00104         {
00105                 //
00106                 // set resource properties
00107
00108                 TCHAR *szCommandLine = GetCommandLine();
00109                 if (!ParseCommandLine(szCommandLine))
00110                         return -1;
00111         }
00112
00113         return 0;
00114 }
00115
00116 //_____________________________________________________________________________________________________
00117 //
00118 // DisplayHelp
00119 //_____________________________________________________________________________________________________
00120
00121 void DisplayHelp()
00122 {
00123         TCHAR szHelp[] =
00124                                         TEXT("Copyright (c) Microsoft Corporation. All rights reserved.\n")
00125                                         TEXT("\n")
00126                                         TEXT("MsiStuff will display or update the resources \n")
00127                                         TEXT(" in the setup.exe boot strap executable\n")
00128                                         TEXT("\n")
00129                                         TEXT("[MsiStuff Command Line Syntax]\n")
00130                                         TEXT(" Display Properties->> msistuff setup.exe \n")
00131                                         TEXT(" Set Properties    ->> msistuff setup.exe option {data} ... \n")
00132                                         TEXT("\n")
00133                                         TEXT("[MsiStuff Options -- Multiple specifications are allowed]\n")
00134                                         TEXT(" BaseURL                             - /u {value} \n")
00135                                         TEXT(" Msi                                 - /d {value} \n")
00136                                         TEXT(" Product Name                        - /n {value} \n")
00137                                         TEXT(" Minimum Msi Version                 - /v {value} \n")
00138                                         TEXT(" Update URL Location                 - /i {value} \n")
00139                                         TEXT(" Windows Installer Update            - /w {value} \n")
00140                                         TEXT(" Patch                               - /m {value} \n")
00141                                         TEXT(" Operation                           - /o {value} \n")
00142                                         TEXT(" Properties (PROPERTY=VALUE strings) - /p {value} \n")
00143                                         TEXT("\n")
00144                                         TEXT("If an option is specified multiple times, the last one wins\n")
00145                                         TEXT("\n")
00146                                         TEXT("/p must be last on the command line.  The remainder of\n")
00147                                         TEXT("the command line is considered a part of the {value}\n")
00148                                         TEXT("This also means that /p cannot be specified multiple times\n");
00149         _tprintf(TEXT("%s"), szHelp);
00150 }
00151
00152 //_____________________________________________________________________________________________________
00153 //
00154 // ParseCommandLine
00155 //
00156 //       If a property has a value that contains spaces, the value must be enclosed in quotation marks
00157 //_____________________________________________________________________________________________________
00158
00159 bool ParseCommandLine(LPTSTR lpCommandLine)
00160 {
00161         if (!lpCommandLine)
00162             return false;
00163
00164         TCHAR szSetupEXE[MAX_PATH] = {0};
00165         TCHAR szFullPath[2*MAX_PATH] = {0};
00166
00167         TCHAR  chNextCommand;
00168         TCHAR *pchCommandLine = lpCommandLine;
00169
00170         // skip over module name and subsequent white space
00171         if (!SkipValue(pchCommandLine))
00172             return false;
00173         chNextCommand = SkipWhiteSpace(pchCommandLine);
00174
00175         TCHAR* pchCommandData = pchCommandLine;
00176         if (!SkipValue(pchCommandLine))
00177             return false;
00178         if (!RemoveQuotes(pchCommandData, szSetupEXE, sizeof(szSetupEXE)/sizeof(szSetupEXE[0])))
00179             return false;
00180
00181         // handle possibility of a relative path
00182         LPTSTR lpszFilePart = 0;
00183         int cchFullPath = 0;
00184         if (0 == (cchFullPath = GetFullPathName(szSetupEXE, sizeof(szFullPath)/sizeof(TCHAR), szFullPath, &lpszFilePart)))
00185         {
00186                 // error
00187                 _tprintf(TEXT("Unable to obtain fullpath for %s\n"), szSetupEXE);
00188                 return false;
00189         }
00190         else if (cchFullPath > sizeof(szFullPath)/sizeof(TCHAR))
00191         {
00192             // szFullPath buffer is too small; we could resize, but we'll simply fail here
00193             _tprintf(TEXT("szFullPath buffer is insufficiently sized for obtaining the full path for %s\n"), szSetupEXE);
00194             return false;
00195         }
00196
00197         _tprintf(TEXT("\nModifying setup properties in:\n\t<%s>\n\n"), szFullPath);
00198
00199         // make sure the EXE is not already loaded,in use, or read-only
00200         HANDLE hInUse = CreateFile(szFullPath, GENERIC_WRITE, (DWORD)0, (LPSECURITY_ATTRIBUTES)0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, (HANDLE)0);
00201         if (INVALID_HANDLE_VALUE == hInUse)
00202         {
00203                 // error
00204                 _tprintf(TEXT("Unable to obtain file handle for %s.  The file probably does not exist, is marked read-only, or is in use.  LastError = %d\n"), szFullPath, GetLastError());
00205                 return false;
00206         }
00207         CloseHandle(hInUse);
00208
00209         // begin update resource
00210         HANDLE hUpdate = BeginUpdateResource(szFullPath, /* bDeleteExistingResources = */ FALSE);
00211         if ( !hUpdate )
00212         {
00213                 // error
00214                 _tprintf(TEXT("Unable to update resources in %s.  LastError = %d\n"), szFullPath, GetLastError());
00215                 return false;
00216         }
00217
00218         while ((chNextCommand = SkipWhiteSpace(pchCommandLine)) != 0)
00219         {
00220                 if (chNextCommand == TEXT('/') || chNextCommand == TEXT('-'))
00221                 {
00222                         TCHAR *szOption = pchCommandLine++;  // save for error msg
00223                         TCHAR  chOption = (TCHAR)(*pchCommandLine++ | 0x20); // lower case flag
00224                         chNextCommand = SkipWhiteSpace(pchCommandLine);
00225                         pchCommandData = pchCommandLine;
00226
00227                         for (const TCHAR* pchOptions = rgszCommandOptions; *pchOptions; pchOptions++)
00228                         {
00229                                 if (*pchOptions == chOption)
00230                                         break;
00231                         }
00232
00233                         if (*pchOptions)
00234                         {
00235                                 bool fSkipValue   = true; // whether or not to look for next option in command line; (true = look)
00236                                 bool fDeleteValue = false;// whether to delete the value
00237
00238                                 // option is recognized
00239                                 const TCHAR chIndex = (TCHAR)(pchOptions - rgszCommandOptions);
00240                                 if (chIndex >= cStandardProperties)
00241                                 {
00242                                         // error
00243                                         _tprintf(TEXT("Invalid index (chIndex = %d, chOption = %c)!!!\n"), chIndex, chOption);
00244                                         return false;
00245                                 }
00246
00247                                 if (chOption == chProperties)
00248                                 {
00249                                         fSkipValue = false;
00250                                         // special for /p -- remainder of command line is part of property
00251                                         TCHAR chNext = *pchCommandData;
00252                                         if (chNext == 0 || chNext == TEXT('/') || chNext == TEXT('-'))
00253                                         {
00254                                                 // no value present
00255                                                 fDeleteValue = true;
00256                                         }
00257                                         else
00258                                         {
00259                                                 // set value to remainder of command line, i.e. all of pchCommandData
00260                                                 // with enclosing quotes stripped -- we do this by telling the command
00261                                                 // line processor to not attempt to look for other options on the
00262                                                 // command line; the remainder is part of this property
00263                                                 fSkipValue = false;
00264                                         }
00265                                 }
00266
00267                                 if (fSkipValue)
00268                                         fDeleteValue = (SkipValue(pchCommandLine)) ? false : true;
00269
00270                                 if (fDeleteValue)
00271                                 {
00272                                         // delete value and reset to ensure resource is properly removed
00273                                         if (!UpdateResource(hUpdate, RT_INSTALL_PROPERTY, rgszResName[chIndex], MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL), NULL, 0)
00274                                                 || !EndUpdateResource(hUpdate, /* fDiscard = */ FALSE)
00275                                                 || (!(hUpdate = BeginUpdateResource(szFullPath, /* bDeleteExistingResources = */ FALSE))))
00276                                         {
00277                                                 // error
00278                                                 _tprintf(TEXT("Unable to delete resource %s in %s.  LastError = %d\n"), rgszResName[chIndex], szFullPath, GetLastError());
00279                                                 return false;
00280                                         }
00281                                         _tprintf(TEXT("Removing '%s' . . .\n"), rgszResName[chIndex]);
00282                                 }
00283                                 else
00284                                 {
00285                                         TCHAR szValueBuf[1024] = {0};
00286                                         if (!RemoveQuotes(pchCommandData, szValueBuf, sizeof(szValueBuf)/sizeof(szValueBuf[0])))
00287                                             return false;
00288
00289                                         if (chOption == chMinMsiVer && (_ttoi(szValueBuf) < iMinMsiAllowedVer))
00290                                         {
00291                                                 // extra validation: must be >= iMinAllowedVer
00292                                                 _tprintf(TEXT("Skipping option %c with data %s. Data value must be >= %d. . .\n"), chOption, szValueBuf, iMinMsiAllowedVer);
00293                                                 continue;
00294                                         }
00295
00296                                         if (chOption == chOperation
00297                                             && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szValueBuf, -1, szInstall, -1)
00298                                             && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szValueBuf, -1, szInstallUpd, -1)
00299                                             && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szValueBuf, -1, szMinPatch, -1)
00300                                             && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szValueBuf, -1, szMajPatch, -1))
00301                                         {
00302                                             // extra validation: must be one of those values
00303                                             _tprintf(TEXT("Skipping option %c with data %s. Data value must be INSTALL, INSTALLUPD, MINPATCH, or MAJPATCH...\n"), chOption, szValueBuf);
00304                                             continue;
00305                                         }
00306
00307                                         // update value -- this is our own custom resource, so to make it easier on ourselves, we will pack in the NULL as well
00308                                 #ifdef UNICODE
00309                                         if (!UpdateResource(hUpdate, RT_INSTALL_PROPERTY, rgszResName[chIndex], MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL), szValueBuf, (lstrlen(szValueBuf) + 1)*sizeof(TCHAR)))
00310                                         {
00311                                                 // error
00312                                                 _tprintf(TEXT("Unable to update resource %s in %s with value %s.  LastError = %d\n"), rgszResName[chIndex], szFullPath, szValueBuf, GetLastError());
00313                                                 return false;
00314                                         }
00315                                 #else // !UNICODE
00316                                         // must convert value to Unicode
00317                                         int cchWide = MultiByteToWideChar(CP_ACP, 0, szValueBuf, -1, NULL, 0);
00318                                         WCHAR* wszValueBuf = new WCHAR[cchWide];
00319                                         if (!wszValueBuf)
00320                                             return false; // out of memory
00321                                         ZeroMemory(wszValueBuf, cchWide*sizeof(WCHAR));
00322                                         if (0 == MultiByteToWideChar(CP_ACP, 0, szValueBuf, -1, wszValueBuf, cchWide))
00323                                         {
00324                                             // error
00325                                             _tprintf(TEXT("Unable to convert value to Unicode. LastError = %d\n"), GetLastError());
00326                                             delete [] wszValueBuf;
00327                                             return false;
00328                                         }
00329                                         if (!UpdateResource(hUpdate, RT_INSTALL_PROPERTY, rgszResName[chIndex], MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL), wszValueBuf, (lstrlenW(wszValueBuf) +1)*sizeof(WCHAR)))
00330                                         {
00331                                                 // error
00332                                                 _tprintf(TEXT("Unable to update resource %s in %s with value %s.  LastError = %d\n"), rgszResName[chIndex], szFullPath, szValueBuf, GetLastError());
00333                                                 delete [] wszValueBuf;
00334                                                 return false;
00335                                         }
00336                                         delete [] wszValueBuf;
00337                                 #endif // UNICODE
00338                                         _tprintf(TEXT("Setting '%s' to '%s' . . .\n"), rgszResName[chIndex], szValueBuf);
00339                                         if (!fSkipValue)
00340                                                 break; // done processing
00341                                 }
00342                         }
00343                         else
00344                         {
00345                                 // invalid option
00346                                 _tprintf(TEXT("Skipping invalid option %c . . .\n"), chOption);
00347                                 SkipValue(pchCommandLine);
00348                                 continue;
00349                         }
00350                 }
00351                 else
00352                 {
00353                         // error
00354                         _tprintf(TEXT("Switch is missing\n"));
00355                         return false;
00356                 }
00357         }
00358
00359         // persist changes
00360         if (!EndUpdateResource(hUpdate, /* fDiscard = */ FALSE))
00361         {
00362                 // error
00363                 _tprintf(TEXT("Unable to update resources in %s.  LastError = %d\n"), szFullPath, GetLastError());
00364                 return false;
00365         }
00366
00367         return true;
00368 }
00369
00370 //_____________________________________________________________________________________________________
00371 //
00372 // SkipWhiteSpace
00373 //
00374 //       Skips whitespace in the string and returns next non-tab non-whitespace charcter
00375 //_____________________________________________________________________________________________________
00376
00377 TCHAR SkipWhiteSpace(TCHAR*& rpch)
00378 {
00379         TCHAR ch = 0;
00380         if (rpch)
00381         {
00382             for (; (ch = *rpch) == TEXT(' ') || ch == TEXT('\t'); rpch++)
00383                     ;
00384         }
00385         return ch;
00386 }
00387
00388 //_____________________________________________________________________________________________________
00389 //
00390 // SkipValue
00391 //
00392 //       Skips over the value of a switch and returns true if a value was present. Handles value enclosed
00393 //       in quotation marks
00394 //_____________________________________________________________________________________________________
00395
00396 bool SkipValue(TCHAR*& rpch)
00397 {
00398         if (!rpch)
00399             return false;
00400
00401         TCHAR ch = *rpch;
00402         if (ch == 0 || ch == TEXT('/') || ch == TEXT('-'))
00403                 return false;   // no value present
00404         for (int i = 0; (ch = *rpch) != TEXT(' ') && ch != TEXT('\t') && ch != 0; rpch = CharNext(rpch), i++)
00405         {
00406                 if (0 == i && *rpch == TEXT('"'))
00407                 {
00408                         rpch++; // for '"'
00409                         for (; (ch = *rpch) != TEXT('"') && ch != 0; rpch++)
00410                                 ;
00411                         ch = *(++rpch);
00412                         break;
00413                 }
00414         }
00415         if (ch != 0)
00416         {
00417                 TCHAR* pch = rpch;
00418                 rpch = CharNext(rpch);
00419                 *pch = 0;
00420         }
00421         return true;
00422 }
00423
00424 //_____________________________________________________________________________________________________
00425 //
00426 // RemoveQuotes
00427 //
00428 //  Removes enclosing quotation marks for the value. Returns copy of original string
00429 //  if no enclosing quotation mark at front of string.  Returns false on error.
00430 //_____________________________________________________________________________________________________
00431
00432 bool RemoveQuotes(LPCTSTR lpOriginal, LPTSTR lpStripped, DWORD cchStripped)
00433 {
00434         if (!lpOriginal)
00435             return false;
00436
00437         bool fEnclosedInQuotes = false;
00438
00439         const TCHAR *pchOrig = lpOriginal;
00440
00441         // check for "
00442         if (*pchOrig == TEXT('"'))
00443         {
00444                 fEnclosedInQuotes = true;
00445                 pchOrig++;
00446         }
00447
00448         if (FAILED(StringCchCopy(lpStripped, cchStripped, pchOrig)))
00449             return false;
00450
00451         if (!fEnclosedInQuotes)
00452                 return true;
00453
00454         TCHAR *pch = lpStripped + lstrlen(lpStripped) + 1; // start at NULL
00455
00456         pch = CharPrev(lpStripped, pch);
00457
00458         // look for trailing "
00459         while (pch != lpStripped)
00460         {
00461                 if (*pch == TEXT('"'))
00462                 {
00463                         *pch = 0;
00464                         break; // only care about trailing ", and not quotes in middle
00465                 }
00466                 pch = CharPrev(lpStripped, pch);
00467         }
00468
00469         return true;
00470 }
00471
00472 //_____________________________________________________________________________________________________
00473 //
00474 // DisplayInstallResource
00475 //_____________________________________________________________________________________________________
00476
00477 bool DisplayInstallResource(HMODULE hExeModule, LPCTSTR lpszType, LPCTSTR lpszName)
00478 {
00479         HRSRC   hRsrc   = 0;
00480         HGLOBAL hGlobal = 0;
00481         WCHAR   *pch    = 0;
00482
00483         if ((hRsrc = FindResource(hExeModule, lpszName, lpszType)) != 0
00484                 && (hGlobal = LoadResource(hExeModule, hRsrc)) != 0
00485                 && (pch = (WCHAR*)LockResource(hGlobal)) != 0)
00486         {
00487                 // resource exists
00488                 g_cResources++;
00489
00490                 if (!pch)
00491                         _tprintf(TEXT("%s = NULL\n"), lpszName);
00492                 else
00493                 {
00494                 #ifdef UNICODE
00495                         _tprintf(TEXT("%s = %s\n"), lpszName, pch);
00496                 #else // !UNICODE
00497                         unsigned int cch = WideCharToMultiByte(CP_ACP, 0, pch, -1, NULL, 0, NULL, NULL);
00498                         char *szValue = new char[cch];
00499                         if (!szValue)
00500                         {
00501                                 _tprintf(TEXT("Error -- out of memory\n"));
00502                                 return false;
00503                         }
00504                         ZeroMemory(szValue, cch * sizeof(char));
00505
00506                         if (0 == WideCharToMultiByte(CP_ACP, 0, pch, -1, szValue, cch, NULL, NULL))
00507                         {
00508                             // error -- could not convert
00509                             _tprintf(TEXT("Unable to convert value.  LastError = %d\n"), GetLastError());
00510                             delete [] szValue;
00511                             return false;
00512                         }
00513
00514                         _tprintf(TEXT("%s = %s\n"), lpszName, szValue);
00515                         delete [] szValue;
00516                 #endif // UNICODE
00517                 }
00518         }
00519
00520         return true;
00521 }
00522
00523 //_____________________________________________________________________________________________________
00524 //
00525 // EnumResNamesProc
00526 //_____________________________________________________________________________________________________
00527
00528 BOOL CALLBACK EnumResNamesProc(HMODULE hExeModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR /*lParam*/)
00529 {
00530         if (!DisplayInstallResource(hExeModule, lpszType, lpszName))
00531                 return FALSE;
00532         return TRUE;
00533 }
00534
00535 //_____________________________________________________________________________________________________
00536 //
00537 // DisplayResources
00538 //_____________________________________________________________________________________________________
00539
00540 bool DisplayResources(LPCTSTR szExecutable)
00541 {
00542         // handle possibility of a relative path
00543         TCHAR szFullPath[2*MAX_PATH] = {0};
00544         LPTSTR lpszFilePart = 0;
00545         int cchFullPath = 0;
00546         if (0 == (cchFullPath = GetFullPathName(szExecutable, sizeof(szFullPath)/sizeof(TCHAR), szFullPath, &lpszFilePart)))
00547         {
00548                 // error
00549                 _tprintf(TEXT("Unable to obtain full file path for %s.  LastError = %d\n"), szExecutable, GetLastError());
00550                 return false;
00551         }
00552         else if (cchFullPath > sizeof(szFullPath)/sizeof(TCHAR))
00553         {
00554             // szFullPath buffer is too small; we could resize, but we'll simply fail here
00555             _tprintf(TEXT("szFullPath buffer is insufficiently sized for obtaining the full path for %s\n"), szExecutable);
00556             return false;
00557         }
00558
00559         _tprintf(TEXT("\n<%s>\n\n"), szFullPath);
00560
00561         HMODULE hExeModule = LoadLibraryEx(szFullPath, NULL, LOAD_LIBRARY_AS_DATAFILE);
00562         if (NULL == hExeModule)
00563         {
00564                 // error
00565                 _tprintf(TEXT("Unable to load %s.  LastError = %d\n"), szFullPath, GetLastError());
00566                 return false;
00567         }
00568
00569         // only enumerate on RT_INSTALL_PROPERTY type
00570         if (!EnumResourceNames(hExeModule, RT_INSTALL_PROPERTY, EnumResNamesProc, (LPARAM)0))
00571         {
00572                 DWORD dwLastErr = GetLastError();
00573                 if (ERROR_RESOURCE_TYPE_NOT_FOUND == dwLastErr)
00574                         _tprintf(TEXT("No RT_INSTALL_PROPERTY resources were found.\n"));
00575                 else if (ERROR_RESOURCE_DATA_NOT_FOUND == dwLastErr)
00576                         _tprintf(TEXT("This file does not have a resource section.\n"));
00577                 else
00578                 {
00579                         // error
00580                         _tprintf(TEXT("Failed to enumerate all resources in %s.  LastError = %d\n"), szFullPath, GetLastError());
00581                         FreeLibrary(hExeModule);
00582                         return false;
00583                 }
00584         }
00585
00586         if (g_cResources)
00587         {
00588                 if (1 == g_cResources)
00589                         _tprintf(TEXT("\n\n 1 RT_INSTALL_PROPERTY resource was found.\n"));
00590                 else
00591                         _tprintf(TEXT("\n\n %d RT_INSTALL_PROPERTY resources were found.\n"), g_cResources);
00592         }
00593
00594         if (!FreeLibrary(hExeModule))
00595         {
00596                 // error
00597                 _tprintf(TEXT("Failed to unload %s.  LastError = %d\n"), szFullPath, GetLastError());
00598                 return false;
00599         }
00600
00601         return true;
00602 }
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authentication/AuthenticateAdmin.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Authentication

AuthenticateAdmin.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       AuthenticateAdmin.cpp
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #include "stdafx.h"
00013 #include "Authenticate.h"
00014 #include "AuthenticateAdmin.h"
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // CAuthenticateAdmin
00018
00019 STDMETHODIMP CAuthenticateAdmin::InterfaceSupportsErrorInfo
00020 (
00021     REFIID riid
00022 )
00023 {
00024     static const IID* arr[] =
00025     {
00026         &IID_IAuthenticateAdmin
00027     };
00028
00029     for( int i = 0; i < sizeof( arr ) / sizeof( arr[ 0 ] ); i++ )
00030     {
00031         if( IsEqualGUID( *arr[i], riid ) )
00032             return( S_OK );
00033     }
00034     return( S_FALSE );
00035 }
00036
00037 STDMETHODIMP CAuthenticateAdmin::Initialize
00038 (
00039     CAuthenticatePlugin *pPlugin
00040 )
00041 {
00042     HRESULT hr = S_OK;
00043
00044     if( NULL == pPlugin )
00045     {
00046         return( E_INVALIDARG );
00047     }
00048
00049     m_pAuthenticatePlugin = pPlugin;
00050
00051     return( hr );
00052 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropSets Member List

This is the complete list of members for CPropSets, including all inherited members.
AddElement(DBPROPSETelement) | CVector< DBPROPSET > | [virtual]
AddPropSet(REFGUID guidPropertySet) | TPropSetBase< DBPROPSET, CProperties > | [virtual]
Attach(CVector &rVector) | CVector< DBPROPSET > | [virtual]
Attach(ULONGcElements, DBPROPSET *rgElements) | CVector< DBPROPSET > | [virtual]
CPropSets(ULONG cPropSets=0, DBPROPSET *rgPropSets=NULL) | CPropSets |
CVector(ULONGulLowerBound=0, ULONGulGrowSize=10) | CVector< DBPROPSET > |
Detach(ULONG *pcElements, DBPROPSET **prgElements) | CVector< DBPROPSET > | [virtual]
FindProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet, const DBID &colid) | CPropSets | [virtual]
FindPropSet(REFGUID guidPropertySet) | TPropSetBase< DBPROPSET, CProperties > | [virtual]
GetCount() | CVector< DBPROPSET > | [inline, virtual]
GetElement(ULONGiIndex) | CVector< DBPROPSET > | [virtual]
GetElements() const | CVector< DBPROPSET > | [inline, virtual]
GetPropSets() | TPropSetBase< DBPROPSET, CProperties > | [inline, virtual]
InsertAt(ULONGiIndex, DBPROPSETelement) | CVector< DBPROPSET > | [virtual]
m_cElements | CVector< DBPROPSET > | [protected]
m_rgElements | CVector< DBPROPSET > | [protected]
m_ulGrowSize | CVector< DBPROPSET > | [protected]
m_ulLowerBound | CVector< DBPROPSET > | [protected]
m_ulMaxSize | CVector< DBPROPSET > | [protected]
operator[](ULONGiIndex) | CVector< DBPROPSET > | [inline, virtual]
RemoveAll() | TPropSetBase< DBPROPSET, CProperties > | [virtual]
RemoveAt(ULONGiIndex) | CVector< DBPROPSET > | [virtual]
SetProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet, DBTYPE wType, void *pv, DBPROPOPTIONS dwOptions=DBPROPOPTIONS_REQUIRED, const DBID &colid=DB_NULLID) | CPropSets | [virtual]
TPropSetBase(ULONG cElements=0, DBPROPSET *rgElements=NULL) | TPropSetBase< DBPROPSET, CProperties > |
~CPropSets() | CPropSets | [virtual]
~CVector() | CVector< DBPROPSET > | [virtual]
~TPropSetBase() | TPropSetBase< DBPROPSET, CProperties > | [virtual]
Generated on Wed Nov 13 2024 16:57:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Table Member List

This is the complete list of members for Table, including all inherited members.
avewidth | Table
hdr | Table
nlines | Table
pcellpos | Table
pcolhdr | Table
pdata | Table
rowheight | Table
rowwidth | Table
scroll_dx | Table
scrollscale | Table
select | Table
selvisible | Table
show_whitespace | Table
tabchars | Table
toprow | Table
trackline1 | Table
trackline2 | Table
trackmode | Table
tracknr | Table
winwidth | Table
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Outgoing/Resource.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Outgoing

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Script1.rc
00004 //
00005 #define IDD_MAINDLG                     102
00006 #define IDC_ADDRESSTYPE                 1002
00007 #define IDC_ADDRESS                     1009
00008 #define IDC_DISCONNECT                  1001
00009 #define IDC_STATIC                      -1
00010
00011 // Next default values for new objects
00012 //
00013 #ifdef APSTUDIO_INVOKED
00014 #ifndef APSTUDIO_READONLY_SYMBOLS
00015 #define _APS_NO_MFC                     1
00016 #define _APS_NEXT_RESOURCE_VALUE        103
00017 #define _APS_NEXT_COMMAND_VALUE         40001
00018 #define _APS_NEXT_CONTROL_VALUE         1010
00019 #define _APS_NEXT_SYMED_VALUE           101
00020 #endif
00021 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/TapiCode.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

TapiCode.h

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // PURPOSE:
00009 //    Contains public declarations for the TapiCode module.
00010 //
00011
00012 BOOL InitializeTAPI(HWND hParentWnd);
00013 BOOL ShutdownTAPI();
00014 BOOL DialCall();
00015 BOOL HangupCall();
00016 void PostHangupCall();
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/QosEvent/SetQos.Cpp Source File

  • NetDS
  • GQos
  • QosEvent

SetQos.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      setqos.cpp
00010 //
00011 // Abstract:
00012 //      This file contains the functionality needed to fill in a
00013 //      QOS structure.
00014 //
00015 // Entry Points:
00016 //      SetQos
00017 //
00018 // Author:
00019 //      Barry R. Butterklee
00020
00021 #include "qosevent.h"
00022
00023 static VOID FillQosFlowspecDefault(QOS *pQos, DWORD *cbQosLen, QOS_OPTIONS *pQosOptions);
00024 static BOOL FillQosFlowspecFromTemplate(SOCKET sd, QOS *pQos, DWORD *cbQosLen, QOS_OPTIONS *pQosOptions);
00025 static BOOL FillQosProviderSpecific(QOS *pQos, DWORD *cbQosLen, QOS_OPTIONS *pQosOptions);
00026
00027 // Abstract:
00028 //      Depending upon commandline QoS options, either use some default values
00029 //      (see FillQosDefault) or pick up the QoS data by template name.
00030 //
00031 BOOL SetQos(
00032     SOCKET          sd,
00033     QOS_OPTIONS     *pQosOptions,
00034     BOOL            bSetQos,
00035     QOS             *pQos,
00036     DWORD           *cbQosLen
00037     )
00038 {
00039     // fill in some default values
00040     if (_stricmp(pQosOptions->szTemplate, QOS_DEFAULTNAME) == 0)
00041         FillQosFlowspecDefault(pQos, cbQosLen, pQosOptions);
00042     else if (!FillQosFlowspecFromTemplate(sd, pQos, cbQosLen, pQosOptions))
00043         return FALSE;
00044
00045     if (pQosOptions->bDisableSignalling)
00046         pQos->ReceivingFlowspec.ServiceType |= SERVICE_NO_QOS_SIGNALING;
00047
00048     if (!FillQosProviderSpecific(pQos, cbQosLen, pQosOptions))
00049         return FALSE;
00050
00051     if (bSetQos)
00052     {
00053         int     nRet;
00054         DWORD   dwBytes;
00055
00056         if (pQosOptions->bFineGrainErrorAvail)
00057         {
00058             RSVP_STATUS_INFO rsvpStatus;
00059
00060             // uncomment next line to test error handling on SIO_SET_QOS
00061             // pQos->ReceivingFlowspec.ServiceType = 0x555;
00062             nRet = WSAIoctl(sd, SIO_SET_QOS, (LPVOID)pQos, *cbQosLen,
00063                             &rsvpStatus, sizeof(RSVP_STATUS_INFO), &dwBytes,
00064                             NULL, NULL);
00065
00066             if (SOCKET_ERROR == nRet)
00067             {
00068                 printf("WSAIoctl(SIO_SET_QOS) %d, \n\tStatusCode=%d\n\tExtendedStatus1=%d\n\tExtendedStatus2=%d\n",
00069                             WSAGetLastError(),
00070                             rsvpStatus.StatusCode,
00071                             rsvpStatus.ExtendedStatus1,
00072                             rsvpStatus.ExtendedStatus2);
00073                 return FALSE;
00074             }
00075
00076         } else {
00077             nRet = WSAIoctl(sd, SIO_SET_QOS, (LPVOID)pQos, *cbQosLen,
00078                             NULL, 0, &dwBytes, NULL, NULL);
00079
00080             if (SOCKET_ERROR == nRet)
00081             {
00082                 printf("WSAIoctl(SIO_SET_QOS) %d\n", WSAGetLastError());
00083                 return FALSE;
00084             }
00085         }
00086     }
00087
00088     return(TRUE);
00089 }
00090
00091
00092 // Abstract:
00093 //      Fill in values for QoS structure from WSAGetQOSByName. We then
00094 //      adjust the template from bits to bytes, and set the opposite
00095 //      direction to notraffic.
00096 //
00097 static BOOL FillQosFlowspecFromTemplate(
00098     SOCKET          sd,
00099     QOS             *pQos,
00100     DWORD           *cbQosLen,
00101     QOS_OPTIONS     *pQosOptions
00102     )
00103 {
00104     WSABUF wsabuf;
00105
00106     ZeroMemory(pQos, sizeof(QOS));
00107     wsabuf.len = (int) strlen(pQosOptions->szTemplate) + 1;
00108     wsabuf.buf = pQosOptions->szTemplate;
00109
00110     // Attempt
00111     if (!WSAGetQOSByName(sd, &wsabuf, pQos))
00112     {
00113         printf("WSAGetQosByName: %d\n", WSAGetLastError());
00114         return FALSE;
00115     }
00116
00117     if (pQosOptions->bReceiver)
00118     {
00119         pQos->SendingFlowspec   = default_notraffic;
00120         if (pQosOptions->bFixTemplate)
00121         {
00122             pQos->ReceivingFlowspec.TokenRate /= 8;
00123             pQos->ReceivingFlowspec.PeakBandwidth /= 8;
00124         }
00125     }
00126     else
00127     {
00128         pQos->ReceivingFlowspec = default_notraffic;
00129         if (pQosOptions->bFixTemplate)
00130         {
00131             pQos->SendingFlowspec.TokenRate /= 8;
00132             pQos->SendingFlowspec.PeakBandwidth /= 8;
00133         }
00134     }
00135
00136     pQos->ProviderSpecific.len = 0;
00137     pQos->ProviderSpecific.buf = NULL;
00138     *cbQosLen = sizeof(QOS);
00139
00140     return TRUE;
00141 }
00142
00143 // Abstract:
00144 //      Fill in default values for QoS structure.  The default values were
00145 //      simply choosen from existing QOS templates available via WSAGetQosByName.
00146 //      Notice that ProviderSpecific settings are being allowed when picking the
00147 //      "default" template but not for "well-known" QOS templates.  Also notice
00148 //      that since data is only flowing from sender to receiver, different
00149 //      flowspecs are filled in depending upon whether this application is
00150 //      acting as a sender or receiver.
00151 //
00152 static VOID FillQosFlowspecDefault(
00153     QOS             *pQos,
00154     DWORD           *cbQosLen,
00155     QOS_OPTIONS     *pQosOptions
00156     )
00157 {
00158
00159     if (pQosOptions->bReceiver) {
00160         pQos->ReceivingFlowspec = default_g711;
00161         pQos->SendingFlowspec   = default_notraffic;
00162     } else {
00163         pQos->SendingFlowspec   = default_g711;
00164         pQos->ReceivingFlowspec = default_notraffic;
00165     }
00166
00167     pQos->ProviderSpecific.len = 0;
00168     pQos->ProviderSpecific.buf = NULL;
00169     *cbQosLen = sizeof(QOS);
00170 }
00171
00172 // Abstract:
00173 //      Fill in the Provider-specific portion of the QOS structure.  Potentially
00174 //      no provider-specific changes may need to be made or an existing
00175 //      provider-specific buffer may need to be added to and/or changed.
00176 //
00177 //      *** Currently if a Provider-specific buffer already exists it is not
00178 //      overwritten and this call will fail.
00179 //
00180 static BOOL FillQosProviderSpecific(
00181     QOS             *pQos,
00182     DWORD           *cbQosLen,
00183     QOS_OPTIONS     *pQosOptions
00184     )
00185 {
00186     UNREFERENCED_PARAMETER(cbQosLen);
00187
00188     if (!pQosOptions->bProviderSpecific)
00189         return(TRUE);
00190
00191     if (0 != pQos->ProviderSpecific.len)
00192     {
00193         printf("FillQosProviderSpecific: reallocating existing ProviderSpecific buf not supported\n");
00194         return(FALSE);
00195     }
00196
00197     _assume(NULL == pQos->ProviderSpecific.buf);
00198
00199     if (pQosOptions->bReceiver)
00200     {
00201         if (!pQosOptions->bConfirmResv) {
00202
00203             static RSVP_RESERVE_INFO RsvpResv;  // since we are returning a ptr to this
00204                                                 //   structure it must be static
00205
00206             ZeroMemory((char *)&RsvpResv, sizeof(RsvpResv));
00207             RsvpResv.ObjectHdr.ObjectType = RSVP_OBJECT_RESERVE_INFO;
00208             RsvpResv.ObjectHdr.ObjectLength = sizeof(RsvpResv);
00209
00210             RsvpResv.Style = RSVP_DEFAULT_STYLE;
00211             RsvpResv.ConfirmRequest = 1;
00212             RsvpResv.PolicyElementList = NULL;
00213             RsvpResv.NumFlowDesc = 0;
00214             RsvpResv.FlowDescList = NULL;
00215
00216             pQos->ProviderSpecific.len = RsvpResv.ObjectHdr.ObjectLength;
00217             pQos->ProviderSpecific.buf = (char *)&RsvpResv;
00218             PrintQos(pQos, "  ");
00219         }
00220     } else { // sender
00221         if (pQosOptions->bSetDestaddr)
00222         {
00223
00224             static QOS_DESTADDR QosDestaddr;    // since we are returning a ptr to
00225                                                 // this structure it must be static
00226
00227             ZeroMemory((char *)&QosDestaddr, sizeof(QosDestaddr));
00228             QosDestaddr.ObjectHdr.ObjectType   = QOS_OBJECT_DESTADDR;
00229             QosDestaddr.ObjectHdr.ObjectLength = sizeof(QosDestaddr);
00230
00231             QosDestaddr.SocketAddress = (SOCKADDR *)&g_destaddr;
00232             QosDestaddr.SocketAddressLength = sizeof(g_destaddr);
00233
00234             pQos->ProviderSpecific.len = QosDestaddr.ObjectHdr.ObjectLength;
00235             pQos->ProviderSpecific.buf = (char *)&QosDestaddr;
00236             PrintQos(pQos, "  ");
00237         }
00238     }
00239
00240     return(TRUE);
00241 }
00242
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/datasrc.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

datasrc.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module DATASRC.CPP | CDataSource object implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012
00013 #include "headers.h"
00014 #include <shlobj.h>   //SHBrowseForFolder
00015 #include <shellapi.h> //ShellExecute
00016
00017 // Code ----------------------------------------------------------------------
00018
00019 // CDataSource::CDataSource --------------------------------------------------
00020 //
00021 // @mfunc Constructor for this class
00022 //
00023 // @rdesc NONE
00024 //
00025 CDataSource::CDataSource
00026     (
00027     LPUNKNOWN pUnkOuter         //@parm IN | Outer Unkown Pointer
00028     ) // invoke ctor for base class
00029   : CBaseObj( BOT_DATASOURCE )
00030 {
00031
00032     //  Initialize simple member vars
00033     m_cRef              = 0L;
00034     m_pUnkOuter         = pUnkOuter ? pUnkOuter : this;
00035     m_wszPath[0]        = L'\0';
00036     m_fDSOInitialized   = FALSE;
00037     m_fDBSessionCreated = FALSE;
00038     m_pUtilProp         = NULL;
00039
00040     //  Initially, NULL all contained interfaces
00041     m_pIDBInitialize    = NULL;
00042     m_pIDBProperties  = NULL;
00043     m_pIDBInfo      = NULL;
00044   m_pIDBCreateSession = NULL;
00045   m_pIPersist     = NULL;
00046
00047   //Data Links optional pages
00048   m_pIServiceProvider = NULL;
00049
00050     // Increment global object count.
00051     OBJECT_CONSTRUCTED();
00052
00053     return;
00054 }
00055
00056
00057 // CDataSource::~CDataSource -------------------------------------------------
00058 //
00059 // @mfunc Destructor for this class
00060 //
00061 // @rdesc NONE
00062 //
00063 CDataSource:: ~CDataSource
00064     (
00065     void
00066     )
00067 {
00068   DBREFCOUNT  ulRefCount;
00069
00070   // Decrement the ref count on the data conversion object
00071   if( g_pIDataConvert )
00072   {
00073     ulRefCount = g_pIDataConvert->Release();
00074
00075     // Is it gone for good?
00076     if( !ulRefCount )
00077       g_pIDataConvert = NULL;
00078   }
00079
00080     // Free properties management object
00081     SAFE_DELETE( m_pUtilProp );
00082
00083     //  Free contained interfaces
00084     SAFE_DELETE( m_pIDBInitialize );
00085     SAFE_DELETE( m_pIDBProperties );
00086     SAFE_DELETE( m_pIDBInfo );
00087   SAFE_DELETE( m_pIDBCreateSession );
00088   SAFE_DELETE( m_pIPersist );
00089   SAFE_DELETE( m_pIServiceProvider );
00090
00091     // Decrement global object count.
00092     OBJECT_DESTRUCTED();
00093
00094     return;
00095 }
00096
00097
00098 // CDataSource::FInit --------------------------------------------------------
00099 //
00100 // @mfunc Initialize the command Object
00101 //
00102 // @rdesc Did the Initialization Succeed
00103 //      @flag  TRUE | Initialization succeeded
00104 //      @flag  FALSE | Initialization failed
00105 //
00106 BOOL CDataSource::FInit
00107     (
00108     void
00109     )
00110 {
00111   // Instantiate the data conversion service object
00112   if( !g_pIDataConvert )
00113   {
00114     CoCreateInstance(CLSID_OLEDB_CONVERSIONLIBRARY,
00115              NULL,
00116              CLSCTX_INPROC_SERVER,
00117              IID_IDataConvert,
00118              (void **)&g_pIDataConvert);
00119
00120     //
00121     // Tell the DC that we are 2.5
00122     //
00123     if( g_pIDataConvert )
00124     {
00125       DCINFO rgInfo[] = {{DCINFOTYPE_VERSION,{VT_UI4, 0, 0, 0, 0x0}}};
00126       IDCInfo *pIDCInfo = NULL;
00127
00128       if( g_pIDataConvert->QueryInterface(IID_IDCInfo, (void **)&pIDCInfo) == S_OK &&
00129         pIDCInfo )
00130       {
00131         // OLE DB Version 02.50
00132         V_UI4(&rgInfo->vData) = 0x250;
00133         pIDCInfo->SetInfo(NUMELEM(rgInfo),rgInfo);
00134         pIDCInfo->Release();
00135       }
00136     }
00137   }
00138   else
00139     // Already instantiated, increment reference count
00140     g_pIDataConvert->AddRef();
00141
00142     // Allocate properties management object
00143     m_pUtilProp = new CUtilProp();
00144
00145     //Allocate contained interface objects
00146   //[MANDATORY]
00147     m_pIDBInitialize    = new CImpIDBInitialize( this, m_pUnkOuter );
00148     m_pIDBProperties  = new CImpIDBProperties( this, m_pUnkOuter );
00149     m_pIDBCreateSession = new CImpIDBCreateSession( this, m_pUnkOuter );
00150
00151   //[OPTIONAL]
00152   m_pIDBInfo      = new CImpIDBInfo( this, m_pUnkOuter );
00153     m_pIPersist     = new CImpIPersist( this, m_pUnkOuter );
00154     m_pIServiceProvider = new CImpIServiceProvider( this, m_pUnkOuter );
00155
00156     return (BOOL) (m_pUtilProp && m_pIDBInitialize && m_pIDBProperties &&
00157            m_pIDBCreateSession && m_pIDBInfo && m_pIPersist &&
00158            m_pIServiceProvider);
00159 }
00160
00161
00162 // CDataSource::QueryInterface -----------------------------------------------
00163 //
00164 // @mfunc Returns a pointer to a specified interface. Callers use
00165 // QueryInterface to determine which interfaces the called object
00166 // supports.
00167 //
00168 // @rdesc HRESULT indicating the status of the method
00169 //      @flag S_OK          | Interface is supported and ppvObject is set.
00170 //      @flag E_NOINTERFACE | Interface is not supported by the object
00171 //      @flag E_INVALIDARG  | One or more arguments are invalid.
00172 //
00173 STDMETHODIMP CDataSource::QueryInterface
00174     (
00175     REFIID riid,    //@parm IN | Interface ID of the interface being queried for.
00176     LPVOID * ppv    //@parm OUT | Pointer to interface that was instantiated
00177     )
00178 {
00179     // Is the pointer bad?
00180     if (ppv == NULL)
00181         return ResultFromScode( E_INVALIDARG );
00182
00183     //  Place NULL in *ppv in case of failure
00184     *ppv = NULL;
00185
00186     //  This is the non-delegating IUnknown implementation
00187     if (riid == IID_IUnknown)
00188         *ppv = (LPVOID) this;
00189     else if (riid == IID_IDBInitialize)
00190         *ppv = (LPVOID) m_pIDBInitialize;
00191   else if (riid == IID_IDBProperties)
00192         *ppv = (LPVOID) m_pIDBProperties;
00193     else if (riid == IID_IPersist)
00194         *ppv = (LPVOID) m_pIPersist;
00195   else if (riid == IID_IServiceProvider)
00196     *ppv = (LPVOID) m_pIServiceProvider;
00197   else
00198   {
00199     // These are not valid at Uninit state.
00200     if( riid == IID_IDBCreateSession )
00201       *ppv = (LPVOID)m_pIDBCreateSession;
00202     else if (riid == IID_IDBInfo)
00203       *ppv = (LPVOID) m_pIDBInfo;
00204
00205     // Special case for uninitialized.
00206     if( *ppv && !m_fDSOInitialized )
00207     {
00208       *ppv = NULL;
00209       return ResultFromScode( E_UNEXPECTED );
00210     }
00211   }
00212
00213     //  If we're going to return an interface, AddRef it first
00214     if (*ppv)
00215         {
00216         ((LPUNKNOWN) *ppv)->AddRef();
00217         return ResultFromScode( S_OK );
00218         }
00219     else
00220         return ResultFromScode( E_NOINTERFACE );
00221 }
00222
00223
00224 // CDataSource::AddRef -------------------------------------------------------
00225 //
00226 // @mfunc Increments a persistence count for the object
00227 //
00228 // @rdesc Current reference count
00229 //
00230 STDMETHODIMP_( DBREFCOUNT ) CDataSource::AddRef
00231      (
00232      void
00233      )
00234 {
00235     return ++m_cRef;
00236 }
00237
00238
00239 // CDataSource::Release ------------------------------------------------------
00240 //
00241 // @mfunc Decrements a persistence count for the object and if
00242 // persistence count is 0, the object destroys itself.
00243 //
00244 // @rdesc Current reference count
00245 //
00246 STDMETHODIMP_( DBREFCOUNT ) CDataSource::Release
00247      (
00248      void
00249      )
00250 {
00251     if (!--m_cRef)
00252         {
00253         delete this;
00254         return 0;
00255         }
00256
00257     return m_cRef;
00258 }
00259
00260
00261 ////////////////////////////////////////////////////////
00262 // CDataSource::OpenFile
00263 //
00264 ////////////////////////////////////////////////////////
00265 HRESULT   CDataSource::OpenFile(WCHAR* pwszFileName, CFileIO** ppCFileIO)
00266 {
00267   ASSERT(ppCFileIO);
00268   HRESULT hr = S_OK;
00269   WCHAR wszFullPath[_MAX_PATH + _MAX_PATH + 1]={0};
00270   CHAR  szFullPath[_MAX_PATH + _MAX_PATH + 1]={0};
00271
00272   //open and initialize a file object
00273   CFileIO* pCFileIO = new CFileIO();
00274   if(!pCFileIO)
00275     return E_OUTOFMEMORY;
00276
00277   //Do we have a base directory
00278   if(m_wszPath[0])
00279   {
00280     //Contruct the filename
00281     wcsncat(wszFullPath, m_wszPath, wcslen(m_wszPath));
00282     wcsncat(wszFullPath, L"\\", wcslen(L"\\"));
00283     wcsncat(wszFullPath, pwszFileName,
00284         (_MAX_PATH + _MAX_PATH - wcslen(wszFullPath)));
00285
00286     //Convert to MBCS (stream operations)
00287     ConvertToMBCS(wszFullPath, szFullPath, _MAX_PATH+_MAX_PATH);
00288
00289     //Now try to initialize the stream, if successful we are done...
00290     if(SUCCEEDED(hr = pCFileIO->fInit(  szFullPath )))
00291       goto CLEANUP;
00292   }
00293
00294   //Otherwise its a full filename...
00295   ConvertToMBCS(pwszFileName, szFullPath, _MAX_PATH+_MAX_PATH);
00296
00297   //Now try to initialize the stream...
00298   hr = pCFileIO->fInit(  szFullPath );
00299
00300 CLEANUP:
00301   if(FAILED( hr ))
00302     SAFE_DELETE( pCFileIO );
00303   *ppCFileIO = pCFileIO;
00304   return hr;
00305 }
00306
00307
00308
00309 ////////////////////////////////////////////////////////
00310 // CImpIServiceProvider::QueryService
00311 //
00312 ////////////////////////////////////////////////////////
00313 STDMETHODIMP  CImpIServiceProvider::QueryService
00314 (
00315   REFGUID guidService,
00316   REFIID riid,
00317   void** ppvObject
00318 )
00319 {
00320   HRESULT hr = S_OK;
00321   if(!ppvObject)
00322     return E_INVALIDARG;
00323   *ppvObject = NULL;
00324
00325   //DSL property Pages
00326   if(guidService == OLEDB_SVC_DSLPropertyPages)
00327   {
00328     CImpISpecifyPropertyPages* pCImpISpecifyPropertyPages = new CImpISpecifyPropertyPages;
00329     if(!pCImpISpecifyPropertyPages)
00330       return E_OUTOFMEMORY;
00331
00332     return pCImpISpecifyPropertyPages->QueryInterface(IID_ISpecifyPropertyPages, ppvObject);
00333   }
00334   else
00335   {
00336 //    TODO? hr = SVC_E_UNKNOWNSERVICE;
00337     hr = E_FAIL;
00338   }
00339
00340   return hr;
00341 }
00342
00343
00344
00345
00346 ////////////////////////////////////////////////////////
00347 // CPropertyPage
00348 //
00349 ////////////////////////////////////////////////////////
00350 CPropertyPage::CPropertyPage(REFCLSID clsid, INT iDialogID)
00351 {
00352   m_cRef    = 0;
00353   m_clsid   = clsid;
00354   m_iDialogID = iDialogID;
00355   m_hWnd    = NULL;
00356
00357   m_pIPropertyPageSite = NULL;
00358 }
00359
00360 ////////////////////////////////////////////////////////
00361 // ~CPropertyPage
00362 //
00363 ////////////////////////////////////////////////////////
00364 CPropertyPage::~CPropertyPage()
00365 {
00366   SAFE_RELEASE(m_pIPropertyPageSite);
00367 }
00368
00369 ////////////////////////////////////////////////////////
00370 // CPropertyPage::QueryInterface
00371 //
00372 ////////////////////////////////////////////////////////
00373 STDMETHODIMP  CPropertyPage::QueryInterface(REFIID riid, LPVOID *ppv)
00374 {
00375   if(!ppv)
00376     return E_INVALIDARG;
00377
00378   if(riid == IID_IUnknown)
00379     *ppv = (IUnknown*)(IPropertyPage*)this;
00380   else if(riid == IID_IPropertyPage)
00381     *ppv = (IPropertyPage*)this;
00382   else if(riid == IID_IPersistPropertyBag)
00383     *ppv = (IPersistPropertyBag*)this;
00384   else
00385   {
00386     *ppv = NULL;
00387     return E_NOINTERFACE;
00388   }
00389
00390   SAFE_ADDREF(*ppv);
00391   return S_OK;
00392 }
00393
00394 ////////////////////////////////////////////////////////
00395 // CPropertyPage::SetPageSite
00396 //
00397 ////////////////////////////////////////////////////////
00398 STDMETHODIMP CPropertyPage::SetPageSite(IPropertyPageSite* pPageSite)
00399 {
00400   //SetPageSite can call with NULL to indicate to release interface.
00401   if(!pPageSite)
00402   {
00403     SAFE_RELEASE(m_pIPropertyPageSite);
00404     return S_OK;
00405   }
00406
00407   //Otherwise...
00408   ASSERT(m_pIPropertyPageSite == NULL);
00409   return pPageSite->QueryInterface(IID_IPropertyPageSite, (void**)&m_pIPropertyPageSite);
00410 }
00411
00412
00413 ////////////////////////////////////////////////////////
00414 // CPropertyPage::Activate
00415 //
00416 ////////////////////////////////////////////////////////
00417 STDMETHODIMP CPropertyPage::Activate
00418 (
00419   HWND hWndParent,
00420   LPCRECT pRect,
00421   BOOL bModal
00422 )
00423 {
00424   //Create a modeless dialog...
00425   m_hWnd = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(m_iDialogID), hWndParent, DialogProc, (LPARAM)this);
00426   if(m_hWnd)
00427   {
00428     return Move(pRect);
00429   }
00430
00431   return E_FAIL;
00432 }
00433
00434
00435 ////////////////////////////////////////////////////////
00436 // CPropertyPage::Deactivate
00437 //
00438 ////////////////////////////////////////////////////////
00439 STDMETHODIMP CPropertyPage::Deactivate()
00440 {
00441   if(m_hWnd)
00442   {
00443     DestroyWindow(m_hWnd);
00444     m_hWnd = NULL;
00445   }
00446
00447   return S_OK;
00448 }
00449
00450
00451 ////////////////////////////////////////////////////////
00452 // CPropertyPage::TranslateAccelerator
00453 //
00454 ////////////////////////////////////////////////////////
00455 STDMETHODIMP CPropertyPage::TranslateAccelerator(MSG* pMsg)
00456 {
00457   ASSERT(pMsg);
00458
00459   if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
00460     (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
00461     return S_FALSE;
00462
00463   return IsDialogMessage(m_hWnd, pMsg) ? S_OK : S_FALSE;
00464 }
00465
00466
00467 ////////////////////////////////////////////////////////
00468 // CPropertyPage::IsPageDirty
00469 //
00470 ////////////////////////////////////////////////////////
00471 STDMETHODIMP CPropertyPage::IsPageDirty()
00472 {
00473   //Out page is always dirty since we don't want to go through the overhead of
00474   //determining if the user used any of the controls on the page, S_OK = Dirty...
00475   return S_OK;
00476 }
00477
00478
00479 ////////////////////////////////////////////////////////
00480 // CPropertyPage::Apply
00481 //
00482 ////////////////////////////////////////////////////////
00483 STDMETHODIMP CPropertyPage::Apply()
00484 {
00485   return S_OK;
00486 }
00487
00488
00489 ////////////////////////////////////////////////////////
00490 // CPropertyPage::Show
00491 //
00492 ////////////////////////////////////////////////////////
00493 STDMETHODIMP CPropertyPage::Show(UINT nCmdShow)
00494 {
00495   ShowWindow(m_hWnd, nCmdShow);
00496   return S_OK;
00497 }
00498
00499
00500 ////////////////////////////////////////////////////////
00501 // CPropertyPage::Move
00502 //
00503 ////////////////////////////////////////////////////////
00504 STDMETHODIMP CPropertyPage::Move(LPCRECT pRect)
00505 {
00506   ASSERT(pRect);
00507   MoveWindow(m_hWnd, pRect->left, pRect->top, pRect->right - pRect->left,  pRect->bottom - pRect->top, TRUE);
00508   return S_OK;
00509 }
00510
00511
00512 ////////////////////////////////////////////////////////
00513 // CPropertyPage::DialogProc
00514 //
00515 ////////////////////////////////////////////////////////
00516 INT_PTR CALLBACK CPropertyPage::DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00517 {
00518   switch(message)
00519   {
00520     case WM_INITDIALOG:
00521     {
00522       //Save the "this" pointer
00523       SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam);
00524       return 0;
00525     }
00526
00527     case WM_COMMAND:
00528     {
00529       //Get the "this" pointer
00530       CPropertyPage* pThis = (CPropertyPage*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
00531       return pThis->HandleMessage(hWnd, message, wParam, lParam);
00532     }
00533   }
00534
00535   return 0;
00536 }
00537
00538 ////////////////////////////////////////////////////////
00539 // CPropertyPage::HandleMessage
00540 //
00541 ////////////////////////////////////////////////////////
00542 BOOL CPropertyPage::HandleMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00543 {
00544   return FALSE;
00545 }
00546
00547
00548
00549 ////////////////////////////////////////////////////////
00550 // CDSLConnectionPage
00551 //
00552 ////////////////////////////////////////////////////////
00553 CDSLConnectionPage::CDSLConnectionPage()
00554   : CPropertyPage(CLSID_SampProvConnectionPage, IDD_DSL_CONNECTION)
00555 {
00556   VariantInit(&m_vDataSource);
00557 }
00558
00559 ////////////////////////////////////////////////////////
00560 // ~CDSLConnectionPage
00561 //
00562 ////////////////////////////////////////////////////////
00563 CDSLConnectionPage::~CDSLConnectionPage()
00564 {
00565   VariantClear(&m_vDataSource);
00566 }
00567
00568
00569 ////////////////////////////////////////////////////////
00570 // CDSLConnectionPage::HandleMessage
00571 //
00572 ////////////////////////////////////////////////////////
00573 BOOL CDSLConnectionPage::HandleMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00574 {
00575   switch (message)
00576   {
00577     case WM_COMMAND:
00578     {
00579       //Filter out any Control Notification codes
00580       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
00581       {
00582         break;
00583       }
00584
00585       switch(GET_WM_COMMAND_ID(wParam, lParam))
00586       {
00587         case IDB_BROWSE_DIRECTORY:
00588         {
00589           //Obtain the current value for the default
00590           CHAR szDirectory[MAX_QUERY_LEN] = {0};
00591           SendMessage(GetDlgItem(m_hWnd, IDE_DATASOURCE), WM_GETTEXT, MAX_QUERY_LEN, (LPARAM)szDirectory);
00592
00593           //Display Common Dialog to obtain Directory...
00594           BROWSEINFO browseInfo;
00595           memset( &browseInfo, 0, sizeof(browseInfo));
00596           browseInfo.hwndOwner    = m_hWnd;
00597           browseInfo.pidlRoot     = NULL;
00598           browseInfo.pszDisplayName = szDirectory;
00599           browseInfo.lpszTitle    = "Browse for default directory";;
00600           browseInfo.ulFlags      = 0;
00601           browseInfo.lpfn       = NULL;
00602           browseInfo.lParam     = 0;
00603           browseInfo.iImage     = 0;
00604
00605           //Display Common Dialog to obtain File To Load...
00606           ITEMIDLIST* pidl = SHBrowseForFolder(&browseInfo);
00607           if(pidl)
00608           {
00609             //Obtain the file path from the ITemID...
00610             if(SHGetPathFromIDList(pidl, szDirectory))
00611             {
00612               //Update the Property value on the Dialog...
00613               SendMessage(GetDlgItem(m_hWnd, IDE_DATASOURCE), WM_SETTEXT, 0, (LPARAM)szDirectory);
00614             }
00615
00616             SAFE_FREE(pidl);
00617           }
00618           break;
00619         }
00620       };
00621       break;
00622     }
00623   };
00624
00625   return FALSE;
00626 }
00627
00628
00629 ////////////////////////////////////////////////////////
00630 // CDSLConnectionPage::Load
00631 //
00632 ////////////////////////////////////////////////////////
00633 STDMETHODIMP  CDSLConnectionPage::Load
00634 (
00635   IPropertyBag* pPropBag,
00636     IErrorLog*  pErrorLog
00637 )
00638 {
00639   if(!pPropBag)
00640     return E_INVALIDARG;
00641
00642   //Delegate
00643   HRESULT hr = pPropBag->Read(L"Data Source", &m_vDataSource, pErrorLog);
00644
00645   //Update our dialog (maybe empty...)
00646   if(SUCCEEDED(hr) && V_VT(&m_vDataSource)==VT_BSTR)
00647   {
00648     //Update the Property value on the Dialog...
00649     wSendMessage(GetDlgItem(m_hWnd, IDE_DATASOURCE), WM_SETTEXT, 0, V_BSTR(&m_vDataSource));
00650   }
00651
00652   return hr;
00653 }
00654
00655
00656 ////////////////////////////////////////////////////////
00657 // CDSLConnectionPage::Save
00658 //
00659 ////////////////////////////////////////////////////////
00660 STDMETHODIMP  CDSLConnectionPage::Save
00661 (
00662   IPropertyBag __RPC_FAR *pPropBag,
00663   BOOL fClearDirty,
00664   BOOL fSaveAllProperties
00665 )
00666 {
00667   if(!pPropBag)
00668     return E_INVALIDARG;
00669
00670   //Obtain the Property value from the Dialog...
00671   WCHAR wszBuffer[MAX_QUERY_LEN] = {0};
00672   wSendMessage(GetDlgItem(m_hWnd, IDE_DATASOURCE), WM_GETTEXT, MAX_QUERY_LEN, wszBuffer);
00673
00674   //Indicate this page is dirty...
00675   ASSERT(m_pIPropertyPageSite);
00676   m_pIPropertyPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
00677
00678   //Store it into our variant...
00679   VariantClear(&m_vDataSource);
00680   V_VT(&m_vDataSource)  = VT_BSTR;
00681   V_BSTR(&m_vDataSource)  = SysAllocString(wszBuffer);
00682
00683   //Delegate
00684   return pPropBag->Write(L"Data Source", &m_vDataSource);
00685 }
00686
00687
00688
00689 ////////////////////////////////////////////////////////
00690 // CDSLAdvancedPage
00691 //
00692 ////////////////////////////////////////////////////////
00693 CDSLAdvancedPage::CDSLAdvancedPage()
00694   : CPropertyPage(CLSID_SampProvAdvancedPage, IDD_DSL_ADVANCED)
00695 {
00696 }
00697
00698 ////////////////////////////////////////////////////////
00699 // ~CDSLAdvancedPage
00700 //
00701 ////////////////////////////////////////////////////////
00702 CDSLAdvancedPage::~CDSLAdvancedPage()
00703 {
00704 }
00705
00706
00707
00708 ////////////////////////////////////////////////////////
00709 // CDSLAdvancedPage::HandleMessage
00710 //
00711 ////////////////////////////////////////////////////////
00712 BOOL CDSLAdvancedPage::HandleMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00713 {
00714   return FALSE;
00715 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Critsect.h Source File

  • NetDS
  • SyncMgr
  • SyncDir

Critsect.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012
00013 #ifndef _CRITSECT_
00014 #define _CRITSECT_
00015
00016 class CLock;
00017
00018 class CCriticalSection
00019 {
00020 DWORD cRefs;
00021 CRITICAL_SECTION *m_pcsect;
00022 DWORD m_dwThreadID;
00023
00024 public:
00025     inline CCriticalSection(CRITICAL_SECTION *pcsect,DWORD dwThreadID)
00026     {
00027     m_pcsect = pcsect;
00028     cRefs = 0;
00029     m_dwThreadID = dwThreadID;
00030     };
00031
00032
00033     inline ~CCriticalSection()
00034     {
00035     AssertSz(0 == cRefs,"UnReleased Critical Section");
00036     Assert(m_dwThreadID == GetCurrentThreadId());
00037
00038     while(cRefs--) // unwind any left over cRefs
00039     {
00040         LeaveCriticalSection(m_pcsect);
00041     }
00042
00043     };
00044
00045     inline void Enter()
00046     {
00047     EnterCriticalSection(m_pcsect);
00048
00049     Assert(m_dwThreadID == GetCurrentThreadId());
00050     ++cRefs;
00051
00052     Assert(1 == cRefs); // we don't allow nested calls.
00053     };
00054
00055     inline void Leave()
00056     {
00057     Assert(m_dwThreadID == GetCurrentThreadId());
00058     Assert(0 < cRefs);
00059
00060     if (0 >= cRefs)
00061         return;
00062
00063     --cRefs;
00064     Assert(0 == cRefs);
00065
00066     LeaveCriticalSection(m_pcsect);
00067     };
00068
00069 };
00070
00071
00072 class CLockHandler {
00073
00074 public:
00075     CLockHandler();
00076     ~CLockHandler();
00077
00078     void Lock(DWORD dwThreadId);
00079     void UnLock();
00080     inline DWORD GetLockThreadId() { return m_dwLockThreadId; };
00081
00082 private:
00083     CRITICAL_SECTION m_CriticalSection; // critical section for the queue.
00084     DWORD m_dwLockThreadId; // thread that has the lock.
00085
00086     friend CLock;
00087 };
00088
00089
00090 // helper class for making sure locks on the queue are released.
00091 class CLock
00092 {
00093 DWORD cRefs;
00094 CLockHandler *m_pLockHandler;
00095 DWORD m_dwThreadID;
00096
00097 public:
00098     inline CLock(CLockHandler *pLockHandler)
00099     {
00100     m_pLockHandler = pLockHandler;
00101     cRefs = 0;
00102     m_dwThreadID = GetCurrentThreadId();
00103     };
00104
00105
00106     inline ~CLock()
00107     {
00108     AssertSz(0 == cRefs,"UnReleased Lock");
00109     Assert(m_dwThreadID == GetCurrentThreadId());
00110
00111     while(cRefs--) // unwind any left over cRefs
00112     {
00113         m_pLockHandler->UnLock();
00114     }
00115
00116     };
00117
00118     inline void Enter()
00119     {
00120     Assert(m_dwThreadID == GetCurrentThreadId());
00121
00122     ++cRefs;
00123     Assert(1 == cRefs); // we don't allow nested calls.
00124     m_pLockHandler->Lock(m_dwThreadID);
00125     };
00126
00127     inline void Leave()
00128     {
00129     Assert(m_dwThreadID == GetCurrentThreadId());
00130     Assert(0 < cRefs);
00131
00132     if (0 >= cRefs)
00133         return;
00134
00135     --cRefs;
00136     Assert(0 == cRefs);
00137     m_pLockHandler->UnLock();
00138
00139     };
00140
00141 };
00142
00143 #define ASSERT_LOCKHELD(pLockHandler) Assert(pLockHandler->GetLockThreadId() == GetCurrentThreadId());
00144 #define ASSERT_LOCKNOTHELD(pLockHandler) Assert(pLockHandler->GetLockThreadId() == 0);
00145
00146 #endif // _CRITSECT_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120                 MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122                 // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal)     {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/STATBAR.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

STATBAR.h

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // PURPOSE:
00009 //    Contains declarations for the status bar module.
00010 //
00011
00012 //-------------------------------------------------------------------------
00013 #define IDM_STATUSBAR       501
00014 #define IDM_TIMER           701
00015 #define TIMER_TIMEOUT       1000
00016
00017
00018 // System Menu string ID's
00019 #define IDS_SYSMENU         900
00020
00021
00022 // Global variables for status bar window
00023 extern HWND hWndStatusbar;
00024
00025 // Function prototypes for status bar creation
00026 BOOL CreateSBar(HWND);
00027 void InitializeStatusBar(HWND);
00028 void UpdateStatusBar(LPSTR, WORD, WORD);
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::EventReasonEnum Member List

This is the complete list of members for msado15::EventReasonEnum, including all inherited members.
adRsnAddNew | msado15::EventReasonEnum | [static]
adRsnClose | msado15::EventReasonEnum | [static]
adRsnDelete | msado15::EventReasonEnum | [static]
adRsnFirstChange | msado15::EventReasonEnum | [static]
adRsnMove | msado15::EventReasonEnum | [static]
adRsnMoveFirst | msado15::EventReasonEnum | [static]
adRsnMoveLast | msado15::EventReasonEnum | [static]
adRsnMoveNext | msado15::EventReasonEnum | [static]
adRsnMovePrevious | msado15::EventReasonEnum | [static]
adRsnRequery | msado15::EventReasonEnum | [static]
adRsnResynch | msado15::EventReasonEnum | [static]
adRsnUndoAddNew | msado15::EventReasonEnum | [static]
adRsnUndoDelete | msado15::EventReasonEnum | [static]
adRsnUndoUpdate | msado15::EventReasonEnum | [static]
adRsnUpdate | msado15::EventReasonEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreServe/BALL.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • FreServe

BALL.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      BALL.CPP
00003
00004   Summary:   Implementation file for the COBall COM Object Class (for
00005              aggregatable COBall COM Objects). This module provides a free
00006              threaded virtual ball object. The ball has internal
00007              algorithms that determine its position within a bounded two
00008              dimensional area. No display or other GUI behavior is done in
00009              this ball.  It is a mathematical entity. Clients of this ball
00010              can command it to reset, move, and reveal its current
00011              position, size, and color. These last are used by a client
00012              that displays images of this ball. The color in particular is
00013              an internal property maintained by the ball that indicates
00014              the thread of execution that last moved this ball.
00015
00016              COBall offers a main standard IUnknown interface (basic COM
00017              object features) and the custom IBall interface (Moving Ball
00018              related features).  This multiple interface COM Object Class
00019              is achieved via the technique of nested classes.  The
00020              implementation of the IBall interface is nested inside the
00021              COBall Class.
00022
00023              This file also implements some internal C++ classes (CXForm
00024              and CBallThread) that provide internal support for the custom
00025              IBall interface.
00026
00027              For a comprehensive tutorial code tour of this module's
00028              contents and offerings see the tutorial FRESERVE.HTM
00029              file. For more specific technical details on the internal
00030              workings see the comments dispersed throughout the module's
00031              source code.
00032
00033   Classes:   CXForm, CBallThread, COBall.
00034
00035   Functions: none.
00036
00037   Origin:    4-5-96: atrent - Editor-inheritance from CAR.CPP in
00038              the DLLSERVE Tutorial Code Sample. Also borrows from
00039              the GDIDEMO sample in the Win32 samples of the Win32 SDK.
00040
00041 ----------------------------------------------------------------------------
00042   This file is part of the Microsoft COM Tutorial Code Samples.
00043
00044   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00045
00046   This source code is intended only as a supplement to Microsoft
00047   Development Tools and/or on-line documentation.  See these other
00048   materials for detailed information regarding Microsoft code samples.
00049
00050   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00051   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00052   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00053   PARTICULAR PURPOSE.
00054 ==========================================================================+*/
00055
00056
00057 /*---------------------------------------------------------------------------
00058   We include WINDOWS.H for all Win32 applications.
00059   We include OLE2.H because we will be calling the COM/OLE Libraries.
00060   We include APPUTIL.H because we will be building this application using
00061     the convenient Virtual Window and Dialog classes and other
00062     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00063   We include IBALL.H and BALLGUID.H for the common Ball-related Interface
00064     class, GUID, and CLSID specifications.
00065   We include SERVER.H because it has internal class declarations and
00066     resource ID definitions specific for this DLL.
00067   We include BALL.H because it has the class COBall declarations.
00068 ---------------------------------------------------------------------------*/
00069 #include <windows.h>
00070 #include <ole2.h>
00071 #include <apputil.h>
00072 #include <iball.h>
00073 #include <ballguid.h>
00074 #include "server.h"
00075 #include "ball.h"
00076
00077
00078 /*---------------------------------------------------------------------------
00079   COBall's implementation of its internal utility class CXForm.
00080 ---------------------------------------------------------------------------*/
00081
00082
00083 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00084   Method:   CXForm::Clear
00085
00086   Summary:  Clears and initializes the transformation matrix.
00087
00088   Args:     void
00089
00090   Modifies: ...
00091
00092   Returns:  void
00093 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00094 void CXForm::Clear(void)
00095 {
00096   int Row,Col;
00097
00098   for(Row=0; Row < 3; Row++)
00099     for(Col=0; Col < 3; Col++)
00100       if(Row == Col)
00101         XForm[Row][Col] = 1;
00102       else
00103         XForm[Row][Col] = 0;
00104
00105   return;
00106 }
00107
00108
00109 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00110   Method:   CXForm::Scale
00111
00112   Summary:  Method to allow setting the transformation to multiply
00113             by a scale factor.
00114
00115   Args:     int xScale
00116               x Scale factor.
00117             int yScale
00118               y Scale factor.
00119
00120   Modifies: ...
00121
00122   Returns:  void
00123 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00124 void CXForm::Scale(int xScale, int yScale)
00125 {
00126   int idx;
00127
00128   for(idx=0; idx < 3; idx++)
00129   {
00130     XForm[idx][0] = XForm[idx][0] * xScale;
00131     XForm[idx][1] = XForm[idx][1] * yScale;
00132   }
00133
00134   return;
00135 }
00136
00137
00138 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00139   Method:   CXForm::Trans
00140
00141   Summary:  Perform the transform using the internal matrix.
00142
00143   Args:     int xTrans
00144               x coordinate.
00145             int yTrans
00146               y coordinate.
00147
00148   Modifies: ...
00149
00150   Returns:  void
00151 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00152 void CXForm::Trans(int xTrans, int yTrans)
00153 {
00154   XForm[2][0] = XForm[2][0] + xTrans;
00155   XForm[2][1] = XForm[2][1] + yTrans;
00156
00157   return;
00158 }
00159
00160
00161 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00162   Method:   CXForm::Point
00163
00164   Summary:  Transform a point.
00165
00166   Args:     POINT* pPoint
00167               Pointer to the point.
00168
00169   Modifies: ...
00170
00171   Returns:  void
00172 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00173 void CXForm::Point(POINT* pPoint)
00174 {
00175   int x,y;
00176
00177   x = (XForm[0][0] * pPoint->x) + (XForm[1][0] * pPoint->y) + XForm[2][0];
00178   y = (XForm[0][1] * pPoint->x) + (XForm[1][1] * pPoint->y) + XForm[2][1];
00179
00180   pPoint->x = x;
00181   pPoint->y = y;
00182
00183   return;
00184 }
00185
00186
00187 /*---------------------------------------------------------------------------
00188   COBall's implementation of its main COM object class including
00189   Constructor, Destructor, QueryInterface, AddRef, and Release.
00190 ---------------------------------------------------------------------------*/
00191
00192 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00193   Method:   COBall::COBall
00194
00195   Summary:  COBall Constructor. Note the member initializer:
00196             "m_ImpIBall(this, pUnkOuter)" which is used to pass the 'this'
00197             and pUnkOuter pointers of this constructor function to the
00198             constructor in the instantiation of the implementation of the
00199             CImpIBall interface (which is nested inside this present
00200             COBall Object Class).
00201
00202   Args:     IUnknown* pUnkOuter,
00203               Pointer to the the outer Unknown.  NULL means this COM Object
00204               is not being Aggregated.  Non NULL means it is being created
00205               on behalf of an outside COM object that is reusing it via
00206               aggregation.
00207             CServer* pServer)
00208               Pointer to the server's control object.
00209
00210   Modifies: m_cRefs, m_pUnkOuter, m_pServer.
00211
00212   Returns:  void
00213 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00214 COBall::COBall(
00215   IUnknown* pUnkOuter,
00216   CServer* pServer) :
00217   m_ImpIBall(this, pUnkOuter)
00218 {
00219   // Zero the COM object's reference count.
00220   m_cRefs = 0;
00221
00222   // No AddRef necessary if non-NULL, as we're nested.
00223   m_pUnkOuter = pUnkOuter;
00224
00225   // Assign the pointer to the server control object.
00226   m_pServer = pServer;
00227
00228   return;
00229 }
00230
00231
00232 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00233   Method:   COBall::~COBall
00234
00235   Summary:  COBall Destructor.
00236
00237   Args:     void
00238
00239   Modifies: .
00240
00241   Returns:  void
00242 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00243 COBall::~COBall(void)
00244 {
00245   return;
00246 }
00247
00248
00249 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00250   Method:   COBall::QueryInterface
00251
00252   Summary:  QueryInterface of the COBall non-delegating
00253             IUnknown implementation.
00254
00255   Args:     REFIID riid,
00256               [in] GUID of the Interface being requested.
00257             PPVOID ppv)
00258               [out] Address of the caller's pointer variable that will
00259               receive the requested interface pointer.
00260
00261   Modifies: .
00262
00263   Returns:  HRESULT
00264 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00265 STDMETHODIMP COBall::QueryInterface(
00266                REFIID riid,
00267                PPVOID ppv)
00268 {
00269   HRESULT hr = E_NOINTERFACE;
00270
00271   if (OwnThis())
00272   {
00273     *ppv = NULL;
00274
00275     if (IID_IUnknown == riid)
00276       *ppv = this;
00277     else if (IID_IBall == riid)
00278       *ppv = &m_ImpIBall;
00279
00280     if (NULL != *ppv)
00281     {
00282       // We've handed out a pointer to the interface so obey the COM rules
00283       // and AddRef the reference count.
00284       ((LPUNKNOWN)*ppv)->AddRef();
00285       hr = NOERROR;
00286     }
00287
00288     UnOwnThis();
00289   }
00290
00291   return (hr);
00292 }
00293
00294
00295 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00296   Method:   COBall::AddRef
00297
00298   Summary:  AddRef of the COBall non-delegating IUnknown implementation.
00299
00300   Args:     void
00301
00302   Modifies: m_cRefs.
00303
00304   Returns:  ULONG
00305               New value of m_cRefs (COM object's reference count).
00306 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00307 STDMETHODIMP_(ULONG) COBall::AddRef(void)
00308 {
00309   ULONG cRefs;
00310
00311   if (OwnThis())
00312   {
00313     cRefs = ++m_cRefs;
00314
00315     UnOwnThis();
00316   }
00317
00318   return cRefs;
00319 }
00320
00321
00322 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00323   Method:   COBall::Release
00324
00325   Summary:  Release of the COBall non-delegating IUnknown implementation.
00326
00327   Args:     void
00328
00329   Modifies: m_cRefs.
00330
00331   Returns:  ULONG
00332               New value of m_cRefs (COM object's reference count).
00333 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00334 STDMETHODIMP_(ULONG) COBall::Release(void)
00335 {
00336   ULONG cRefs;
00337   CServer* pServer;
00338
00339   if (OwnThis())
00340   {
00341     cRefs = --m_cRefs;
00342
00343     if (0 == cRefs)
00344     {
00345       // Save a local copy of the pointer to the server control object.
00346       pServer = m_pServer;
00347
00348       // We artificially bump the main ref count to prevent reentrancy
00349       // via the main object destructor.  Not really needed in this
00350       // COBall but a good practice because we are aggregatable and
00351       // may at some point in the future add something entertaining like
00352       // some Releases to the COBall destructor. We relinquish thread
00353       // ownership of this object before deleting it--a good practice.
00354       m_cRefs++;
00355       UnOwnThis();
00356       delete this;
00357
00358       // We've reached a zero reference count for this COM object and
00359       // we have deleted the COM object. So we tell the server housing
00360       // to decrement its global object count so that the server will
00361       // be unloaded if appropriate.
00362       if (NULL != pServer)
00363         pServer->ObjectsDown();
00364     }
00365     else
00366       UnOwnThis();
00367   }
00368
00369   return cRefs;
00370 }
00371
00372
00373 /*---------------------------------------------------------------------------
00374   COBall's nested implementation of the IBall interface including
00375   Constructor, Destructor, QueryInterface, AddRef, Release, Reset, Move,
00376   and GetBall. This interface implementation also has internal methods
00377   that are not particulary intended for outside clients: GetDimensions,
00378   SetDimensions, GetDirection, SetDirection, GetPosition, SetPostion,
00379   CheckBounce, and FindThread. The IBall interface only provides client
00380   access to the IUnknown methods and the Reset, Move, and GetBall methods.
00381 ---------------------------------------------------------------------------*/
00382
00383 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00384   Method:   COBall::CImpIBall::CImpIBall
00385
00386   Summary:  Constructor for the CImpIBall interface instantiation.
00387
00388   Args:     COBall* pBackObj,
00389               Back pointer to the parent outer object.
00390             IUnknown* pUnkOuter
00391               Pointer to the outer Unknown.  For delegation.
00392
00393   Modifies: m_pBackObj, m_pUnkOuter.
00394
00395   Returns:  void
00396 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00397 COBall::CImpIBall::CImpIBall(
00398   COBall* pBackObj,
00399   IUnknown* pUnkOuter)
00400 {
00401   size_t i;
00402   BYTE r=128, g=128, b=128;
00403
00404   // Init the Back Object Pointer to point to the parent object.
00405   m_pBackObj = pBackObj;
00406
00407   // Init the CImpIBall interface's delegating Unknown pointer.  We use
00408   // the Back Object pointer for IUnknown delegation here if we are not
00409   // being aggregated.  If we are being aggregated we use the supplied
00410   // pUnkOuter for IUnknown delegation.  In either case the pointer
00411   // assignment requires no AddRef because the CImpIBall lifetime is
00412   // quaranteed by the lifetime of the parent object in which
00413   // CImpIBall is nested.
00414   if (NULL == pUnkOuter)
00415     m_pUnkOuter = pBackObj;
00416   else
00417     m_pUnkOuter = pUnkOuter;
00418
00419   // Now initialize the Ball application entity data.
00420   m_bAlive       = TRUE;
00421   m_xDirection   = 0;
00422   m_yDirection   = 0;
00423   m_bNewPosition = FALSE;
00424   m_xPosition    = 0;
00425   m_yPosition    = 0;
00426   m_nWidth       = 30;
00427   m_nHeight      = 30;
00428   m_xSkew        = BALL_MOVE_SKEW;
00429   m_ySkew        = BALL_MOVE_SKEW;
00430   m_crColor      = RGB(0,0,0);
00431
00432   // Clear point transformation array.
00433   m_XForm.Clear();
00434
00435   // Init BallThread array--init colors and clear thread Ids.
00436   // The BallThreads are the threads that contend to move and/or
00437   // paint the ball object.
00438   for (i = 0; i < MAX_BALLTHREADS; i++)
00439     m_aBallThreads[i].Id = 0;
00440   m_aBallThreads[0].Color = RGB(0  ,  0,  0);  // Black
00441   m_aBallThreads[1].Color = RGB(255,  0,  0);  // Red
00442   m_aBallThreads[2].Color = RGB(0  ,255,  0);  // Green
00443   m_aBallThreads[3].Color = RGB(0  ,  0,255);  // Blue
00444   m_aBallThreads[4].Color = RGB(255,  0,255);  // Purple
00445   m_aBallThreads[5].Color = RGB(0  ,255,255);  // Aqua
00446   m_aBallThreads[6].Color = RGB(255,255,  0);  // Brown
00447   if (MAX_BALLTHREADS > 8)
00448     for (i=7; i<MAX_BALLTHREADS; i++)
00449     {
00450       // Fill the remainder with some random colors.
00451       m_aBallThreads[i].Color = RGB(r,g,b);
00452       r = (BYTE) lRandom() % 255;
00453       g = (BYTE) lRandom() % 255;
00454       b = (BYTE) lRandom() % 255;
00455     }
00456
00457   return;
00458 }
00459
00460
00461 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00462   Method:   COBall::CImpIBall::~CImpIBall
00463
00464   Summary:  Destructor for the CImpIBall interface instantiation.
00465
00466   Args:     void
00467
00468   Modifies: .
00469
00470   Returns:  void
00471 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00472 COBall::CImpIBall::~CImpIBall(void)
00473 {
00474   return;
00475 }
00476
00477
00478 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00479   Method:   COBall::CImpIBall::GetDimensions
00480
00481   Summary:  Internal utility method to get the ball x,y dimensions.
00482
00483   Args:     POINT* pDimension
00484               Pointer to the point that will contain the dimensions.
00485
00486   Modifies: *pDimension.
00487
00488   Returns:  void
00489 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00490 void COBall::CImpIBall::GetDimensions(POINT* pDimension)
00491 {
00492   pDimension->x = m_nWidth;
00493   pDimension->y = m_nHeight;
00494
00495   return;
00496 }
00497
00498
00499 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00500   Method:   COBall::CImpIBall::SetDimensions
00501
00502   Summary:  Internal utility method to set the ball x,y dimensions.
00503
00504   Args:     int nWidth
00505               New Ball width.
00506             int nHeight
00507               New Ball Height.
00508
00509   Modifies: .
00510
00511   Returns:  void
00512 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00513 void COBall::CImpIBall::SetDimensions(int nWidth, int nHeight)
00514 {
00515   m_nWidth  = nWidth;
00516   m_nHeight = nHeight;
00517
00518   return;
00519 }
00520
00521
00522 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00523   Method:   COBall::CImpIBall::GetDirection
00524
00525   Summary:  Internal utility method to get the ball direction.
00526
00527   Args:     POINT* pDirection
00528               Pointer to the Point that will contain the x,y direction
00529               data.
00530
00531   Modifies: ...
00532
00533   Returns:  void
00534 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00535 void COBall::CImpIBall::GetDirection(POINT* pDirection)
00536 {
00537   pDirection->x = m_xDirection;
00538   pDirection->y = m_yDirection;
00539
00540   return;
00541 }
00542
00543
00544 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00545   Method:   COBall::CImpIBall::SetDirection
00546
00547   Summary:  Internal utility method to set the ball direction.
00548
00549   Args:     int xDirection
00550               x coordinate of the new direction.
00551             int yDirection
00552               y coordinate of the new direction.
00553
00554   Modifies: ...
00555
00556   Returns:  void
00557 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00558 void COBall::CImpIBall::SetDirection(int xDirection, int yDirection)
00559 {
00560   m_xDirection = xDirection;
00561   m_yDirection = yDirection;
00562
00563   return;
00564 }
00565
00566
00567 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00568   Method:   COBall::CImpIBall::GetPosition
00569
00570   Summary:  Internal utility method to get current the ball position.
00571
00572   Args:     POINT* pPosition
00573               Pointer to the Point that is the position.
00574
00575   Modifies: *pPostion.
00576
00577   Returns:  void
00578 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00579 void COBall::CImpIBall::GetPosition(POINT* pPosition)
00580 {
00581   POINT Org;
00582
00583   Org.x = 0;
00584   Org.y = 0;
00585   m_XForm.Point(&Org);
00586
00587   pPosition->x = Org.x;
00588   pPosition->y = Org.y;
00589
00590   return;
00591 }
00592
00593
00594 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00595   Method:   COBall::CImpIBall::SetPosition
00596
00597   Summary:  Internal utility method to set current the ball position.
00598
00599   Args:     int x
00600               x-coordinate of new position.
00601             int y
00602               y-coordinate of new position.
00603
00604   Modifies: ...
00605
00606   Returns:  void
00607 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00608 void COBall::CImpIBall::SetPosition(int x, int y)
00609 {
00610   m_bNewPosition = TRUE;
00611   m_xPosition    = x;
00612   m_yPosition    = y;
00613
00614   return;
00615 }
00616
00617
00618 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00619   Method:   COBall::CImpIBall::CheckBounce
00620
00621   Summary:  Internal utility method to check the current ball position,
00622             dimension, and direction data and determine if the ball has
00623             hit the internal WinRect bounding rectangle. If it has then
00624             the ball data is recalculated to achieve a "bounce" effect
00625             for the ball as it moves.
00626
00627   Args:     void
00628
00629   Modifies: ...
00630
00631   Returns:  void
00632 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00633 void COBall::CImpIBall::CheckBounce(void)
00634 {
00635   POINT Pos, Dir, Dim;
00636   int   xNewPos, yNewPos, xNewDir, yNewDir;
00637
00638   GetPosition(&Pos);
00639   GetDirection(&Dir);
00640   GetDimensions(&Dim);
00641
00642   // Check each edge of the client rectangle.  If the ball goes past the
00643   // boundries, reset its position and direction to give it a "bounce"
00644   // effect the next time it is displayed.
00645   xNewDir = Dir.x;
00646   yNewDir = Dir.y;
00647   xNewPos = Pos.x + Dir.x;
00648   yNewPos = Pos.y + Dir.y;
00649
00650   if(xNewPos < m_WinRect.left)
00651   {
00652     xNewDir = ((lRandom() % m_xSkew) + m_xSkew);
00653     SetPosition(m_WinRect.left, Pos.y);
00654   }
00655   if((xNewPos + Dim.x) > m_WinRect.right)
00656   {
00657     xNewDir = -(((int)lRandom() % m_xSkew) + m_xSkew);
00658     SetPosition(m_WinRect.right - Dim.x, Pos.y);
00659   }
00660   if(yNewPos < m_WinRect.top)
00661   {
00662     yNewDir = ((lRandom() % m_ySkew) + m_ySkew);
00663     SetPosition(Pos.x, m_WinRect.top);
00664   }
00665   if((yNewPos + Dim.y) > m_WinRect.bottom)
00666   {
00667     yNewDir = -(((int)lRandom() % m_ySkew) + m_ySkew);
00668     SetPosition(Pos.x, m_WinRect.bottom - Dim.y);
00669   }
00670
00671   SetDirection(xNewDir, yNewDir);
00672
00673   return;
00674 }
00675
00676
00677 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00678   Method:   COBall::CImpIBall::FindThread
00679
00680   Summary:  Internal utility method to Find the thread that is now
00681             executing this code. If the executing thread is not already in
00682             the Thread array remember the new Thread's Id and add it to the
00683             array. This in effect assigns the thread a color that can be
00684             used for tutorial display of which thread is executing on the
00685             ball object.
00686
00687   Args:     void
00688
00689   Modifies: ...
00690
00691   Returns:  void
00692 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00693 void COBall::CImpIBall::FindThread(void)
00694 {
00695   BOOL bFound = FALSE;
00696   DWORD dwTId = GetCurrentThreadId();
00697   size_t i = 0;
00698
00699   while(!bFound && i<MAX_BALLTHREADS)
00700   {
00701     if (m_aBallThreads[i].Id == 0)
00702     {
00703       // Found empty slot. This simple array logic allows no empty holes.
00704       m_aBallThreads[i].Id = dwTId;
00705       bFound = TRUE;
00706     }
00707     else
00708     {
00709       if (m_aBallThreads[i].Id == dwTId)
00710       {
00711         // Found previous visiting thread--use its assigned color.
00712         m_crColor = m_aBallThreads[i].Color;
00713         bFound = TRUE;
00714       }
00715       else
00716       {
00717         i++;
00718         if (i >= MAX_BALLTHREADS)
00719         {
00720           // Thread array is full--use a gray color for all other
00721           // excess visiting threads.
00722           m_crColor = RGB(127,127,127);
00723           bFound = TRUE;
00724         }
00725       }
00726     }
00727   }
00728
00729   return;
00730 }
00731
00732
00733 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00734   Method:   COBall::CImpIBall::QueryInterface
00735
00736   Summary:  The QueryInterface IUnknown member of this IBall interface
00737             implementation that delegates to m_pUnkOuter, whatever it is.
00738
00739   Args:     REFIID riid,
00740               [in] GUID of the Interface being requested.
00741             PPVOID ppv)
00742               [out] Address of the caller's pointer variable that will
00743               receive the requested interface pointer.
00744
00745   Modifies: .
00746
00747   Returns:  HRESULT
00748               Returned by the delegated outer QueryInterface call.
00749 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00750 STDMETHODIMP COBall::CImpIBall::QueryInterface(
00751                REFIID riid,
00752                PPVOID ppv)
00753 {
00754   // Delegate this call to the outer object's QueryInterface.
00755   return m_pUnkOuter->QueryInterface(riid, ppv);
00756 }
00757
00758
00759 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00760   Method:   COBall::CImpIBall::AddRef
00761
00762   Summary:  The AddRef IUnknown member of this IBall interface
00763             implementation that delegates to m_pUnkOuter, whatever it is.
00764
00765   Args:     void
00766
00767   Modifies: .
00768
00769   Returns:  ULONG
00770               Returned by the delegated outer AddRef call.
00771 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00772 STDMETHODIMP_(ULONG) COBall::CImpIBall::AddRef(void)
00773 {
00774   // Delegate this call to the outer object's AddRef.
00775   return m_pUnkOuter->AddRef();
00776 }
00777
00778
00779 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00780   Method:   COBall::CImpIBall::Release
00781
00782   Summary:  The Release IUnknown member of this IBall interface
00783             implementation that delegates to m_pUnkOuter, whatever it is.
00784
00785   Args:     void
00786
00787   Modifies: .
00788
00789   Returns:  ULONG
00790               Returned by the delegated outer Release call.
00791 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00792 STDMETHODIMP_(ULONG) COBall::CImpIBall::Release(void)
00793 {
00794   // Delegate this call to the outer object's Release.
00795   return m_pUnkOuter->Release();
00796 }
00797
00798
00799 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00800   Method:   COBall::CImpIBall::Reset
00801
00802   Summary:  The Reset member method of the IBall interface implementation.
00803             Called by outside clients of a COBall object to reset the
00804             virtual ball. It is restored to the upper left corner.
00805
00806   Args:     RECT* pNewRect,
00807               Pointer to a RECT structure. Tells the COBall the bounding
00808               rectangle within which the ball can move.
00809             short nBallSize,
00810               The size of the ball in pixels. nBallSize == Width == Height
00811               meaning that a circle is assumed.
00812
00813   Modifies: ...
00814
00815   Returns:  HRESULT
00816               Standard result code. NOERROR for success.
00817 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00818 STDMETHODIMP COBall::CImpIBall::Reset(
00819                RECT* pNewRect,
00820                short nBallSize)
00821 {
00822   HRESULT hr = E_FAIL;
00823   int nDim, xDirection, yDirection;
00824
00825   if (OwnThis())
00826   {
00827     // Find the thread who is executing this and remember its color.
00828     FindThread();
00829
00830     m_xSkew = m_ySkew = BALL_MOVE_SKEW;
00831     m_WinRect.left = pNewRect->left;
00832     m_WinRect.top = pNewRect->top;
00833     m_WinRect.right = pNewRect->right;
00834     m_WinRect.bottom = pNewRect->bottom;
00835     nDim = nBallSize ? nBallSize : max(5, m_WinRect.right / 13);
00836     SetDimensions(nDim, nDim);
00837     SetPosition(0, 0);
00838     xDirection = ((lRandom() % m_xSkew) + m_xSkew);
00839     yDirection = ((lRandom() % m_ySkew) + m_ySkew);
00840     SetDirection(xDirection, yDirection);
00841
00842     hr = NOERROR;
00843
00844     UnOwnThis();
00845   }
00846
00847   return hr;
00848 }
00849
00850
00851 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00852   Method:   COBall::CImpIBall::Move
00853
00854   Summary:  The Move member method of this IBall interface implementation.
00855             Called by outside clients of a COBall object to advance the
00856             "motion" of this COBall virtual ball entity.
00857
00858   Args:     BOOL bAlive
00859               TRUE means stay alive; FALSE means don't move and die.
00860
00861   Modifies: m_bAlive.
00862
00863   Returns:  HRESULT
00864               Standard result code. NOERROR for success and means the move
00865               was done and the ball is still alive. E_FAIL means the move
00866               was not done and the ball has been killed.
00867 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00868 STDMETHODIMP COBall::CImpIBall::Move(
00869                BOOL bAlive)
00870 {
00871   HRESULT hr = E_FAIL;
00872
00873   if (OwnThis())
00874   {
00875     if (bAlive && m_bAlive)
00876     {
00877       // Find thread that is now executing this code. Remember its Id and
00878       // assign it a color. If this thread previously visited here then
00879       // use its remembered values. In any case, set a color value in
00880       // m_crColor of its existing or newly assigned color.
00881       FindThread();
00882
00883       // Ask the Ball if it has hit any of the edges of the current window
00884       // rectangle. If so, it will recalculate its position and direction to
00885       // achieve a "bounce" effect in its motion the next time it is painted.
00886       CheckBounce();
00887
00888       // Calculate and set new ball position.
00889       if(m_bNewPosition)
00890       {
00891         m_bNewPosition = FALSE;
00892         m_XForm.Clear();
00893         m_XForm.Trans(m_xPosition, m_yPosition);
00894       }
00895       else
00896         m_XForm.Trans(m_xDirection, m_yDirection);
00897     }
00898     else
00899       m_bAlive = FALSE;
00900
00901     hr = m_bAlive ? NOERROR : E_FAIL;
00902
00903     UnOwnThis();
00904   }
00905
00906   return hr;
00907 }
00908
00909
00910 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00911   Method:   COBall::CImpIBall::GetBall
00912
00913   Summary:  The GetBall member method of this IBall interface
00914             implementation. Called by outside clients of a COBall object
00915             to get the necessary data on the moving ball to enable GUI
00916             display of an actual image of this virtual ball. This COBall
00917             is a data entity only that is kept alive by client threads
00918             that call Move. A GUI client can independently call GetBall
00919             to allow it to display some visual representation of the Ball.
00920
00921   Args:     POINT* pOrg,
00922               Pointer to a point that will contain the current origin
00923               position of the ball.
00924             POINT* pExt,
00925               Pointer to a point that will contain the current extent
00926               size of the ball.
00927             COLORREF* pcrColor)
00928               Pointer to a COLORREF that will contain the current color
00929               of the ball. This color is determined by the last thread
00930               that was executing in the ball before this call is made.
00931
00932   Returns:  HRESULT
00933               Standard result code. NOERROR for success.
00934 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00935 STDMETHODIMP COBall::CImpIBall::GetBall(
00936        POINT* pOrg,
00937        POINT* pExt,
00938        COLORREF* pcrColor)
00939 {
00940   HRESULT hr = E_FAIL;
00941
00942   if (OwnThis())
00943   {
00944     *pcrColor = m_crColor;
00945
00946     pOrg->x = 0;
00947     pOrg->y = 0;
00948     m_XForm.Point(pOrg);
00949     pExt->x = m_nWidth;
00950     pExt->y = m_nHeight;
00951     m_XForm.Point(pExt);
00952
00953     hr = NOERROR;
00954
00955     UnOwnThis();
00956   }
00957
00958   return hr;
00959 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDefClassFactory Member List

This is the complete list of members for CDefClassFactory, including all inherited members.
cf | CDefClassFactory
cRef | CDefClassFactory
lpfnCI | CDefClassFactory
pcRefDll | CDefClassFactory
riidInst | CDefClassFactory
Generated on Wed Nov 13 2024 16:56:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DComDraw/SINK.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DComDraw

SINK.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SINK.CPP
00003
00004   Summary:   Implementation file for the COPaperSink COM Object Class.
00005              Connectable object notifications are handled by COPaperSink.
00006
00007              COPaperSink offers a main IUnknown interface and the custom
00008              IPaperSink interface (with the drawing Paper related event
00009              features). This multiple interface COM Object Class is
00010              achieved via the technique of nested classes.  The
00011              implementation of the IPaperSink interface is nested inside
00012              the COPaperSink Class.
00013
00014              For a comprehensive tutorial code tour of this module's
00015              contents and offerings see the tutorial DCOMDRAW.HTM
00016              file. For more specific technical details on the internal
00017              workings see the comments dispersed throughout the module's
00018              source code.
00019
00020   Classes:   COPaperSink.
00021
00022   Functions: none.
00023
00024   Origin:    8-23-97: atrent - Editor-inheritance from BALL.CPP in
00025              the CONSERVE Tutorial Code Sample. [Revised]
00026
00027 ----------------------------------------------------------------------------
00028   This file is part of the Microsoft COM Tutorial Code Samples.
00029
00030   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00031
00032   This source code is intended only as a supplement to Microsoft
00033   Development Tools and/or on-line documentation.  See these other
00034   materials for detailed information regarding Microsoft code samples.
00035
00036   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00037   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00038   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00039   PARTICULAR PURPOSE.
00040 ==========================================================================+*/
00041
00042
00043 /*---------------------------------------------------------------------------
00044   We include WINDOWS.H for all Win32 applications.
00045   We include OLE2.H because we will be calling the COM/OLE Libraries.
00046   We include OLECTL.H because it has definitions for connectable objects.
00047   We include APPUTIL.H because we will be building this application using
00048     the convenient Virtual Window and Dialog classes and other
00049     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00050   We include PAPINT.H and PAPGUIDS.H for the common paper-related
00051     Interface class, GUID, and CLSID specifications.
00052   We include GUIPAPER.H because it declares the class for the main C++
00053     object that can service the Sink events.
00054   We include SINK.H because it has the class COPaperSink declarations.
00055 ---------------------------------------------------------------------------*/
00056 #include <windows.h>
00057 #include <ole2.h>
00058 #include <olectl.h>
00059 #include <apputil.h>
00060 #include <papint.h>
00061 #include <papguids.h>
00062 #include "guipaper.h"
00063 #include "sink.h"
00064
00065
00066 /*---------------------------------------------------------------------------
00067   COPaperSink's implementation of its main COM object class including
00068   Constructor, Destructor, QueryInterface, AddRef, and Release.
00069 ---------------------------------------------------------------------------*/
00070
00071 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00072   Method:   COPaperSink::COPaperSink
00073
00074   Summary:  COPaperSink Constructor. Note the member initializer:
00075             "m_ImpIPaperSink(this, pUnkOuter)" which is used to pass the
00076             'this' and pUnkOuter pointers of this constructor function to
00077             the constructor in the instantiation of the implementation of
00078             the CImpIPaperSink interface (which is nested inside this
00079             present COPaperSink Object Class).
00080
00081   Args:     IUnknown* pUnkOuter,
00082               Pointer to the the outer Unknown.  NULL means this COM Object
00083               is not being Aggregated.  Non NULL means it is being created
00084               on behalf of an outside COM object that is reusing it via
00085               aggregation.
00086             CGuiPaper* pGuiPaper)
00087               Pointer to the main C++ object that can service the PaperSink
00088               events.
00089
00090   Modifies: m_cRefs, m_pUnkOuter, m_pGuiPaper.
00091
00092   Returns:  void
00093 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00094 COPaperSink::COPaperSink(
00095   IUnknown* pUnkOuter,
00096   CGuiPaper* pGuiPaper) :
00097   m_ImpIPaperSink(this, pUnkOuter)
00098 {
00099   // Zero the COM object's reference count.
00100   m_cRefs = 0;
00101
00102   // No AddRef necessary if non-NULL, as we're nested.
00103   m_pUnkOuter = pUnkOuter;
00104
00105   // Assign the pointer to the Sink service C++ object.
00106   m_pGuiPaper = pGuiPaper;
00107
00108   return;
00109 }
00110
00111
00112 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00113   Method:   COPaperSink::~COPaperSink
00114
00115   Summary:  COPaperSink Destructor.
00116
00117   Args:     void
00118
00119   Returns:  void
00120 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00121 COPaperSink::~COPaperSink(void)
00122 {
00123   return;
00124 }
00125
00126
00127 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00128   Method:   COPaperSink::QueryInterface
00129
00130   Summary:  QueryInterface of the COPaperSink non-delegating
00131             IUnknown implementation.
00132
00133   Args:     REFIID riid,
00134               [in] GUID of the Interface being requested.
00135             PPVOID ppv)
00136               [out] Address of the caller's pointer variable that will
00137               receive the requested interface pointer.
00138
00139   Returns:  HRESULT
00140 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00141 STDMETHODIMP COPaperSink::QueryInterface(
00142                REFIID riid,
00143                PPVOID ppv)
00144 {
00145   HRESULT hr = E_NOINTERFACE;
00146
00147   *ppv = NULL;
00148
00149   if (IID_IUnknown == riid)
00150     *ppv = this;
00151   else if (IID_IPaperSink == riid)
00152     *ppv = &m_ImpIPaperSink;
00153
00154   if (NULL != *ppv)
00155   {
00156     // We've handed out a pointer to the interface so obey the COM rules
00157     // and AddRef the reference count.
00158     ((LPUNKNOWN)*ppv)->AddRef();
00159     hr = NOERROR;
00160   }
00161
00162
00163   return (hr);
00164 }
00165
00166
00167 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00168   Method:   COPaperSink::AddRef
00169
00170   Summary:  AddRef of the COPaperSink non-delegating IUnknown
00171             implementation.
00172
00173   Args:     void
00174
00175   Modifies: m_cRefs.
00176
00177   Returns:  ULONG
00178               New value of m_cRefs (COM object's reference count).
00179 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00180 STDMETHODIMP_(ULONG) COPaperSink::AddRef(void)
00181 {
00182   ULONG cRefs;
00183
00184   cRefs = ++m_cRefs;
00185
00186   return cRefs;
00187 }
00188
00189
00190 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00191   Method:   COPaperSink::Release
00192
00193   Summary:  Release of the COPaperSink non-delegating IUnknown
00194             implementation.
00195
00196   Args:     void
00197
00198   Modifies: m_cRefs.
00199
00200   Returns:  ULONG
00201               New value of m_cRefs (COM object's reference count).
00202 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00203 STDMETHODIMP_(ULONG) COPaperSink::Release(void)
00204 {
00205   ULONG cRefs;
00206
00207   cRefs = --m_cRefs;
00208
00209   if (0 == cRefs)
00210   {
00211     // We artificially bump the main ref count to prevent reentrancy
00212     // via the main object destructor.  Not really needed in this
00213     // COPaperSink but a good practice because we are aggregatable and
00214     // may at some point in the future add something entertaining like
00215     // some Releases to the COPaperSink destructor.
00216     m_cRefs++;
00217     delete this;
00218   }
00219
00220   return cRefs;
00221 }
00222
00223
00224 /*---------------------------------------------------------------------------
00225   COPaperSink's nested implementation of the IPaperSink interface
00226   including Constructor, Destructor, QueryInterface, AddRef, Release,
00227   Locked, Unlocked, Loaded, Saved, InkStart, InkDraw, InkStop, Erased,
00228   and Resized. Methods in this interface are called by COM objects on
00229   the server side to send notifications to the client.
00230 ---------------------------------------------------------------------------*/
00231
00232 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00233   Method:   COPaperSink::CImpIPaperSink::CImpIPaperSink
00234
00235   Summary:  Constructor for the CImpIPaperSink interface instantiation.
00236
00237   Args:     COPaperSink* pCO,
00238               Back pointer to the parent outer object.
00239             IUnknown* pUnkOuter
00240               Pointer to the outer Unknown.  For delegation.
00241
00242   Modifies: m_pCO, m_pUnkOuter.
00243
00244   Returns:  void
00245 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00246 COPaperSink::CImpIPaperSink::CImpIPaperSink(
00247   COPaperSink* pCO,
00248   IUnknown* pUnkOuter)
00249 {
00250   // Init the Back Object Pointer to point to the parent object.
00251   m_pCO = pCO;
00252
00253   // Init the CImpIPaperSink interface's delegating Unknown pointer.  We
00254   // use the Back Object pointer for IUnknown delegation here if we are
00255   // not being aggregated.  If we are being aggregated we use the supplied
00256   // pUnkOuter for IUnknown delegation.  In either case the pointer
00257   // assignment requires no AddRef because the CImpIPaperSink lifetime is
00258   // quaranteed by the lifetime of the parent object in which
00259   // CImpIPaperSink is nested.
00260   if (NULL == pUnkOuter)
00261     m_pUnkOuter = pCO;
00262   else
00263     m_pUnkOuter = pUnkOuter;
00264
00265   return;
00266 }
00267
00268
00269 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00270   Method:   COPaperSink::CImpIPaperSink::~CImpIPaperSink
00271
00272   Summary:  Destructor for the CImpIPaperSink interface instantiation.
00273
00274   Args:     void
00275
00276   Returns:  void
00277 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00278 COPaperSink::CImpIPaperSink::~CImpIPaperSink(void)
00279 {
00280   return;
00281 }
00282
00283
00284 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00285   Method:   COPaperSink::CImpIPaperSink::QueryInterface
00286
00287   Summary:  The QueryInterface IUnknown member of this IPaperSink interface
00288             implementation that delegates to m_pUnkOuter, whatever it is.
00289
00290   Args:     REFIID riid,
00291               [in] GUID of the Interface being requested.
00292             PPVOID ppv)
00293               [out] Address of the caller's pointer variable that will
00294               receive the requested interface pointer.
00295
00296   Returns:  HRESULT
00297               Returned by the delegated outer QueryInterface call.
00298 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00299 STDMETHODIMP COPaperSink::CImpIPaperSink::QueryInterface(
00300                REFIID riid,
00301                PPVOID ppv)
00302 {
00303   // Delegate this call to the outer object's QueryInterface.
00304   return m_pUnkOuter->QueryInterface(riid, ppv);
00305 }
00306
00307
00308 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00309   Method:   COPaperSink::CImpIPaperSink::AddRef
00310
00311   Summary:  The AddRef IUnknown member of this IPaperSink interface
00312             implementation that delegates to m_pUnkOuter, whatever it is.
00313
00314   Args:     void
00315
00316   Returns:  ULONG
00317               Returned by the delegated outer AddRef call.
00318 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00319 STDMETHODIMP_(ULONG) COPaperSink::CImpIPaperSink::AddRef(void)
00320 {
00321   // Delegate this call to the outer object's AddRef.
00322   return m_pUnkOuter->AddRef();
00323 }
00324
00325
00326 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00327   Method:   COPaperSink::CImpIPaperSink::Release
00328
00329   Summary:  The Release IUnknown member of this IPaperSink interface
00330             implementation that delegates to m_pUnkOuter, whatever it is.
00331
00332   Args:     void
00333
00334   Returns:  ULONG
00335               Returned by the delegated outer Release call.
00336 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00337 STDMETHODIMP_(ULONG) COPaperSink::CImpIPaperSink::Release(void)
00338 {
00339   // Delegate this call to the outer object's Release.
00340   return m_pUnkOuter->Release();
00341 }
00342
00343
00344 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00345   Method:   COPaperSink::CImpIPaperSink::Locked
00346
00347   Summary:  The COPaper object was locked by a client.
00348
00349   Args:     void
00350
00351   Returns:  HRESULT
00352               Standard result code. NOERROR for success.
00353 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00354 STDMETHODIMP COPaperSink::CImpIPaperSink::Locked(
00355                void)
00356 {
00357   HRESULT hr = E_NOTIMPL;
00358
00359   // For future evolution.
00360
00361   return hr;
00362 }
00363
00364
00365 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00366   Method:   COPaperSink::CImpIPaperSink::Unlocked
00367
00368   Summary:  The COPaper object was Unlocked by a client.
00369
00370   Args:     void
00371
00372   Returns:  HRESULT
00373               Standard result code. NOERROR for success.
00374 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00375 STDMETHODIMP COPaperSink::CImpIPaperSink::Unlocked(
00376                void)
00377 {
00378   HRESULT hr = E_NOTIMPL;
00379
00380   // For future evolution.
00381
00382   return hr;
00383 }
00384
00385
00386 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00387   Method:   COPaperSink::CImpIPaperSink::Loaded
00388
00389   Summary:  The COPaper object's ink drawing data was loaded from a
00390             client's compound file.
00391
00392   Args:     void
00393
00394   Returns:  HRESULT
00395               Standard result code. NOERROR for success.
00396 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00397 STDMETHODIMP COPaperSink::CImpIPaperSink::Loaded(
00398                void)
00399 {
00400   HRESULT hr;
00401
00402   // We have been notified that a load was done. Thus, a whole new array
00403   // of ink data must be displayed in a cleared window of this client.
00404   m_pCO->m_pGuiPaper->ClearWin();
00405   hr = m_pCO->m_pGuiPaper->PaintWin();
00406
00407   return hr;
00408 }
00409
00410
00411 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00412   Method:   COPaperSink::CImpIPaperSink::Saved
00413
00414   Summary:  The COPaper object's drawing paper data was saved to a
00415             client's compound file.
00416
00417   Args:     void
00418
00419   Returns:  HRESULT
00420               Standard result code. NOERROR for success.
00421 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00422 STDMETHODIMP COPaperSink::CImpIPaperSink::Saved(
00423                void)
00424 {
00425   HRESULT hr = E_NOTIMPL;
00426
00427   // For future evolution.
00428
00429   return hr;
00430 }
00431
00432
00433 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00434   Method:   COPaperSink::CImpIPaperSink::InkStart
00435
00436   Summary:  Client is being told to start a display ink drawing sequence.
00437
00438   Args:     SHORT nX,
00439               X coordinate of the start point.
00440             SHORT nY,
00441               Y coordinate of the start point.
00442             SHORT nWidth,
00443               Ink Width in pixels.
00444             COLORREF crInkColor)
00445               RGB Ink color to be used in the subsequent inking sequence.
00446
00447   Returns:  HRESULT
00448               Standard result code. NOERROR for success.
00449 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00450 STDMETHODIMP COPaperSink::CImpIPaperSink::InkStart(
00451                                             SHORT nX,
00452                                             SHORT nY,
00453                                             SHORT nWidth,
00454                                             COLORREF crInkColor)
00455 {
00456   // Only echo drawing action if we are not the current Master.
00457   if (!m_pCO->m_pGuiPaper->Master())
00458   {
00459     // Play the data back to the CGuiPaper for display only.
00460     m_pCO->m_pGuiPaper->InkWidth(nWidth);
00461     m_pCO->m_pGuiPaper->InkColor(crInkColor);
00462     m_pCO->m_pGuiPaper->InkStart(nX, nY);
00463   }
00464
00465   return NOERROR;
00466 }
00467
00468
00469 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00470   Method:   COPaperSink::CImpIPaperSink::InkDraw
00471
00472   Summary:  Client is being told to draw/display ink drawing sequence data.
00473
00474   Args:     SHORT nX,
00475               X coordinate of the start point.
00476             SHORT nY,
00477               Y coordinate of the start point.
00478
00479   Returns:  HRESULT
00480               Standard result code. NOERROR for success.
00481 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00482 STDMETHODIMP COPaperSink::CImpIPaperSink::InkDraw(
00483                                             SHORT nX,
00484                                             SHORT nY)
00485 {
00486   // Only echo drawing action if we are not the current Master.
00487   if (!m_pCO->m_pGuiPaper->Master())
00488   {
00489     // Play the data back to the CGuiPaper for display only.
00490     m_pCO->m_pGuiPaper->InkDraw(nX, nY);
00491   }
00492
00493   return NOERROR;
00494 }
00495
00496
00497 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00498   Method:   COPaperSink::CImpIPaperSink::InkStop
00499
00500   Summary:  Client is being told to stop an ink drawing sequence.
00501
00502   Args:     SHORT nX,
00503               X coordinate of the start point.
00504             SHORT nY,
00505               Y coordinate of the start point.
00506
00507   Returns:  HRESULT
00508               Standard result code. NOERROR for success.
00509 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00510 STDMETHODIMP COPaperSink::CImpIPaperSink::InkStop(
00511                                             SHORT nX,
00512                                             SHORT nY)
00513 {
00514   // Only echo drawing action if we are not the current Master.
00515   if (!m_pCO->m_pGuiPaper->Master())
00516   {
00517     // Stop the play of the data back to the CGuiPaper for display.
00518     m_pCO->m_pGuiPaper->InkStop(nX, nY);
00519   }
00520
00521   return NOERROR;
00522 }
00523
00524
00525 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00526   Method:   COPaperSink::CImpIPaperSink::Erased
00527
00528   Summary:  The COPaper object's drawing paper data was erased by a client.
00529
00530   Args:     void
00531
00532   Returns:  HRESULT
00533               Standard result code. NOERROR for success.
00534 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00535 STDMETHODIMP COPaperSink::CImpIPaperSink::Erased(
00536                void)
00537 {
00538   HRESULT hr = E_FAIL;
00539
00540   // Only echo drawing action if we are not the current Master.
00541   if (!m_pCO->m_pGuiPaper->Master())
00542     hr = m_pCO->m_pGuiPaper->Erase();
00543
00544   return hr;
00545 }
00546
00547
00548 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00549   Method:   COPaperSink::CImpIPaperSink::Resized
00550
00551   Summary:  The COPaper object's drawing rectangle was resized by a client.
00552
00553   Args:     LONG lWidth,
00554               Rectangle width in pixels.
00555             LONG lHeight)
00556               Rectangle height in pixels.
00557
00558   Returns:  HRESULT
00559               Standard result code. NOERROR for success.
00560 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00561 STDMETHODIMP COPaperSink::CImpIPaperSink::Resized(
00562                LONG lWidth,
00563                LONG lHeight)
00564 {
00565   HRESULT hr = E_FAIL;
00566
00567   // Only echo drawing action if we are not the current Master.
00568   if (!m_pCO->m_pGuiPaper->Master())
00569     hr = m_pCO->m_pGuiPaper->Resize(lWidth, lHeight);
00570
00571   return hr;
00572 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/about.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163         MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164         *lpDest = wszStr;
00165
00166
00167     return S_OK;
00168 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/lrsample.HXX Source File

  • WinBase
  • Indexing
  • lrsample

lrsample.HXX

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // PROGRAM:  lrsample.hxx
00011 //
00012 // PURPOSE:  Sample wordbreaker and stemmer.
00013 //
00014 // PLATFORM: Windows 2000 and later
00015 //
00016 //--------------------------------------------------------------------------
00017
00018 #pragma once
00019
00020 #include "minici.hxx"
00021
00022 extern long g_cInstances;
00023
00024 // Invent a new sublanguage of English -- English Sample
00025
00026 const ULONG SUBLANG_ENGLISH_SAMPLE = 0x13;
00027
00028 // Unicode zero width space
00029
00030 const WCHAR ZERO_WIDTH_SPACE = 0x200B;
00031
00032
00033 // Standard COM exports
00034
00035 extern "C" HRESULT STDMETHODCALLTYPE DllGetClassObject( REFCLSID cid,
00036                                                         REFIID   iid,
00037                                                         void **  ppvObj );
00038
00039 extern "C" HRESULT STDMETHODCALLTYPE DllCanUnloadNow( void );
00040
00041 //+---------------------------------------------------------------------------
00042 //
00043 //  Class:      CLanguageResrouceSampleCF
00044 //
00045 //  Purpose:    Class factory for the sample language resources
00046 //
00047 //----------------------------------------------------------------------------
00048
00049 class CLanguageResourceSampleCF : public IClassFactory
00050 {
00051 public:
00052
00053     CLanguageResourceSampleCF();
00054
00055     HRESULT STDMETHODCALLTYPE QueryInterface( REFIID   riid,
00056                                               void  ** ppvObject);
00057
00058     ULONG STDMETHODCALLTYPE AddRef();
00059
00060     ULONG STDMETHODCALLTYPE Release();
00061
00062     HRESULT STDMETHODCALLTYPE CreateInstance( IUnknown * pUnkOuter,
00063                                               REFIID     riid,
00064                                               void **    ppvObject );
00065
00066     HRESULT STDMETHODCALLTYPE LockServer( BOOL fLock );
00067
00068 protected:
00069
00070     friend HRESULT STDMETHODCALLTYPE DllGetClassObject( REFCLSID cid,
00071                                                         REFIID   iid,
00072                                                         void **  ppvObj );
00073     ~CLanguageResourceSampleCF();
00074
00075     long _lRefs;
00076 };
00077
00078 //+---------------------------------------------------------------------------
00079 //
00080 //  Class:      CSampleWordBreaker
00081 //
00082 //  Purpose:    Sample word breaker
00083 //
00084 //----------------------------------------------------------------------------
00085
00086 class CSampleWordBreaker : public IWordBreaker
00087 {
00088 public:
00089
00090     HRESULT STDMETHODCALLTYPE QueryInterface( REFIID  riid,
00091                                               void ** ppvObject )
00092     {
00093         if ( 0 == ppvObject )
00094             return E_INVALIDARG;
00095
00096         if ( IID_IWordBreaker == riid )
00097             *ppvObject = (IUnknown *)(IWordBreaker *) this;
00098         else if ( IID_IUnknown == riid )
00099             *ppvObject = (IUnknown *) this;
00100         else
00101         {
00102             *ppvObject = 0;
00103             return E_NOINTERFACE;
00104         }
00105
00106         AddRef();
00107         return S_OK;
00108     }
00109
00110     ULONG STDMETHODCALLTYPE AddRef()
00111     {
00112         return InterlockedIncrement( &_cRefs );
00113     }
00114
00115     ULONG STDMETHODCALLTYPE Release()
00116     {
00117         unsigned long c = InterlockedDecrement( &_cRefs );
00118
00119         if ( 0 == c )
00120             delete this;
00121
00122         return c;
00123     }
00124
00125     HRESULT STDMETHODCALLTYPE Init( BOOL   fQuery,
00126                                     ULONG  cwcMaxToken,
00127                                     BOOL * pfLicense )
00128     {
00129         if ( 0 == pfLicense )
00130             return E_INVALIDARG;
00131
00132         _cwcMaxToken = cwcMaxToken;
00133
00134         *pfLicense = FALSE;
00135
00136         return S_OK;
00137     }
00138
00139     HRESULT STDMETHODCALLTYPE BreakText( TEXT_SOURCE *pTextSource,
00140                                          IWordSink *pWordSink,
00141                                          IPhraseSink *pPhraseSink );
00142
00143     HRESULT STDMETHODCALLTYPE ComposePhrase( WCHAR const *pwcNoun,
00144                                              ULONG cwcNoun,
00145                                              WCHAR const *pwcModifier,
00146                                              ULONG cwcModifier,
00147                                              ULONG ulAttachmentType,
00148                                              WCHAR *pwcPhrase,
00149                                              ULONG *pcwcPhrase )
00150     {
00151         return E_NOTIMPL;
00152     }
00153
00154     HRESULT STDMETHODCALLTYPE GetLicenseToUse( const WCHAR **ppwcsLicense )
00155     {
00156         if ( 0 == ppwcsLicense )
00157             return E_INVALIDARG;
00158
00159         *ppwcsLicense = L"Copyright Microsoft, 1991-2001";
00160         return S_OK;
00161     }
00162
00163     CSampleWordBreaker() :
00164         _cRefs( 1 )
00165     {
00166         InterlockedIncrement( &g_cInstances );
00167     }
00168
00169 private:
00170
00171     HRESULT Tokenize( TEXT_SOURCE * pTextSource,
00172                       ULONG         cwc,
00173                       IWordSink *   pWordSink,
00174                       ULONG &       cwcProcd );
00175
00176     ~CSampleWordBreaker()
00177     {
00178         InterlockedDecrement( &g_cInstances );
00179     }
00180
00181     enum _EBufSize
00182     {
00183         cwcAtATime = 500
00184     };
00185
00186     long _cRefs;
00187
00188     // Maximum length for any word emitted
00189
00190     ULONG _cwcMaxToken;
00191
00192     //
00193     // Note: There is no state data that prevents BreakText() from being
00194     //       called recursively or from multiple threads at the same time.
00195     //       This isn't a requirement of wordbreakers, but it'd be good if
00196     //       all were like this
00197     //
00198 };
00199
00200 //+---------------------------------------------------------------------------
00201 //
00202 //  Class:      CSampleStemmer
00203 //
00204 //  Purpose:    Sample stemmer
00205 //
00206 //----------------------------------------------------------------------------
00207
00208 class CSampleStemmer : public IStemmer
00209 {
00210 public:
00211
00212     HRESULT STDMETHODCALLTYPE QueryInterface( REFIID  riid,
00213                                               void ** ppvObject )
00214     {
00215         if ( 0 == ppvObject )
00216             return E_INVALIDARG;
00217
00218         if ( IID_IStemmer == riid )
00219             *ppvObject = (IUnknown *)(IStemmer *) this;
00220         else if ( IID_IUnknown == riid )
00221             *ppvObject = (IUnknown *) this;
00222         else
00223         {
00224             *ppvObject = 0;
00225             return E_NOINTERFACE;
00226         }
00227
00228         AddRef();
00229         return S_OK;
00230     }
00231
00232     ULONG STDMETHODCALLTYPE AddRef()
00233     {
00234         return InterlockedIncrement( &_cRefs );
00235     }
00236
00237     ULONG STDMETHODCALLTYPE Release()
00238     {
00239         unsigned long c = InterlockedDecrement( &_cRefs );
00240
00241         if ( 0 == c )
00242             delete this;
00243
00244         return c;
00245     }
00246
00247     HRESULT STDMETHODCALLTYPE Init(
00248         ULONG  ulMaxTokenSize,
00249         BOOL * pfLicense )
00250     {
00251         if ( 0 == pfLicense )
00252             return E_INVALIDARG;
00253
00254         *pfLicense = TRUE;
00255         return S_OK;
00256     }
00257
00258     HRESULT STDMETHODCALLTYPE GetLicenseToUse( const WCHAR ** ppwcsLicense )
00259     {
00260         if ( 0 == ppwcsLicense )
00261             return E_INVALIDARG;
00262
00263         *ppwcsLicense = L"Copyright Microsoft, 1991-2001";
00264         return S_OK;
00265     }
00266
00267     HRESULT STDMETHODCALLTYPE GenerateWordForms(
00268         WCHAR const *   pwcInBuf,
00269         ULONG           cwc,
00270         IWordFormSink * pWordFormSink );
00271
00272     CSampleStemmer() : _cRefs( 1 )
00273     {
00274         InterlockedIncrement( &g_cInstances );
00275     }
00276
00277     ~CSampleStemmer()
00278     {
00279         InterlockedDecrement( &g_cInstances );
00280     }
00281
00282 private:
00283
00284     long _cRefs;
00285 };
00286
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPermEventsApp Member List

This is the complete list of members for CPermEventsApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CPermEventsApp() | CPermEventsApp |
CWinApp() | CWinApp |
ExitInstance() | CPermEventsApp | [virtual]
InitInstance() | CPermEventsApp | [virtual]
m_clsReg | CPermEventsApp | [private]
m_factory | CPermEventsApp | [private]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
RegisterServer(void) | CPermEventsApp | [private]
Run() | CAppLite | [virtual]
UnregisterServer(void) | CPermEventsApp | [private]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/FontView/Tools.c Source File

  • Multimedia
  • Gdi
  • Fonts
  • FontView

Tools.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 #define NOMINMAX
00013 #include <windows.h>
00014
00015 #include <stdlib.h> // For 'abs'
00016
00017 #if !defined (APIENTRY)
00018 #define APIENTRY FAR PASCAL
00019 #endif
00020
00021 HWND    hwndTools, hwndToolText, hwndToolCombo, hwndToolButton, hwndMain;
00022 HFONT   hfontTools=0;
00023 TEXTMETRIC tmToolFont;
00024 int     dyTools = 0, cxToolBorder, cyToolBorder, cntToolCtrls = 0, dyCombo;
00025 int     xCurrent = 10;
00026 HBRUSH  hbrBtnFace=0, hbrWindow=0;
00027 HANDLE  hInst=0;
00028
00029 #define MAXCTRLS 25
00030 #define TC_SPACE 0
00031 #define TC_LABEL 1
00032 #define TC_COMBO 2
00033 #define TC_BUTTON 3
00034 typedef struct _tagTools {
00035                         HWND    hwnd;
00036                         WORD    wType;
00037                         int     iWidth, iHeight;
00038                         HICON   hIcon;
00039                 } Tools;
00040 Tools  toolCtrl[MAXCTRLS];
00041
00042 LONG_PTR APIENTRY ToolsProc       (HWND, UINT, WPARAM, LPARAM);
00043 LONG APIENTRY MyComboProc     (HWND, UINT, UINT, LONG);
00044
00045 BOOL InitToolBar (HANDLE hInstance)
00046 {
00047         WNDCLASS    wndclass;
00048
00049         hbrBtnFace = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
00050         hbrWindow = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
00051
00052         wndclass.style         = CS_HREDRAW | CS_VREDRAW;
00053         wndclass.lpfnWndProc   = (WNDPROC)ToolsProc;
00054         wndclass.cbClsExtra    = 0;
00055         wndclass.cbWndExtra    = 0;
00056         wndclass.hInstance      = hInstance;
00057         wndclass.hIcon     = NULL;
00058         wndclass.hbrBackground = hbrBtnFace;
00059         wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW);
00060         wndclass.lpszMenuName  = NULL;
00061         wndclass.lpszClassName = "SamplerTools";
00062
00063         if (!RegisterClass (&wndclass))
00064         {
00065             return FALSE;
00066         }
00067
00068         return TRUE;
00069 }
00070
00071 BOOL CreateToolBar (HWND hwnd, HANDLE hInstance, int iId)
00072 {
00073         HWND hwndTmp;
00074         RECT rect;
00075
00076
00077         hInst = (HANDLE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
00078
00079         if (hbrBtnFace==0) {
00080                 hbrBtnFace = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
00081         }
00082         if (hbrWindow==0) {
00083                 hbrWindow = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
00084         }
00085
00086
00087         cxToolBorder = GetSystemMetrics (SM_CXBORDER);
00088         cyToolBorder = GetSystemMetrics (SM_CYBORDER);
00089
00090         hwndTools = CreateWindow ("SamplerTools", "SamplerTools",
00091                 WS_CHILD | WS_CLIPSIBLINGS | WS_BORDER | WS_VISIBLE,
00092                 0, 0, 0, 0,
00093         hwnd, (HMENU)(INT_PTR)iId, hInst, NULL);
00094         if (!hwndTools) {
00095                 return FALSE;
00096         }
00097
00098         /* Lets find out how big a combo box is... */
00099         hwndTmp = CreateWindow ("COMBOBOX", "Combo",
00100                         WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,
00101                         0, 0, 0, 0,
00102                         hwndTools, NULL, hInst, NULL);
00103         if (hwndTmp) {
00104                 SendMessage (hwndTmp, WM_SETFONT, (UINT_PTR)hfontTools, (LONG_PTR)MAKELONG (TRUE, 0));
00105                 GetClientRect (hwndTmp, &rect);
00106                 dyCombo = rect.bottom - rect.top;
00107                 DestroyWindow (hwndTmp);
00108         } else {
00109                 dyCombo = 30; // Just for a default value
00110         }
00111
00112         hwndMain = hwnd; // So we can pass WM_CONTROL messages back to the master parent
00113
00114         return TRUE;
00115
00116         hInstance; // unreferenced formal parameter
00117 }
00118
00119 int ToolBarHeight (HWND hwnd)
00120 {
00121         RECT rect;
00122         GetClientRect (hwndTools, &rect);
00123         return rect.bottom-rect.top;
00124
00125         hwnd; //unreferenced formal parameter
00126 }
00127
00128 BOOL AdjustToolBar (HWND hwnd)
00129 {
00130         RECT rect;
00131
00132         GetClientRect (hwnd, &rect);
00133         MoveWindow (hwndTools,
00134                 rect.left-cxToolBorder,
00135                 rect.top - cyToolBorder,
00136                 rect.right - rect.left + (cxToolBorder*2),
00137                 dyTools,
00138                 TRUE);
00139         return TRUE;
00140 }
00141
00142 void UpdatePositions (void)
00143 {
00144         int i, x, y = 0, dx, dy = 0, cnt;
00145
00146         x = 10;
00147         for (i=0; i<cntToolCtrls; i++) {
00148                 switch (toolCtrl[i].wType) {
00149                         case TC_SPACE:
00150                                 dx = toolCtrl[i].iWidth;
00151                                 break;
00152                         case TC_LABEL:
00153                                 dy = toolCtrl[i].iHeight;
00154                                 y = (dyTools/2) - (dy/2) - 1;
00155                                 dx = toolCtrl[i].iWidth;
00156                                 break;
00157                         case TC_COMBO:
00158                                 dy = toolCtrl[i].iHeight;
00159                                 y = (dyTools/2) - (dy/2) - 1;
00160                                 dx = toolCtrl[i].iWidth;
00161                                 cnt = (int)SendMessage (toolCtrl[i].hwnd, CB_GETCOUNT, (UINT)0, (LONG)0);
00162                                 if (cnt > 5) cnt = 5;
00163                                 dy = dy * cnt;
00164                                 break;
00165                         case TC_BUTTON:
00166                                 dy = toolCtrl[i].iHeight;
00167                                 y = (dyTools/2) - (dy/2) - 1;
00168                                 dx = toolCtrl[i].iWidth;
00169                                 break;
00170                         default:
00171                                 dy = toolCtrl[i].iHeight;
00172                                 y = (dyTools/2) - (dy/2) - 1;
00173                                 dx = toolCtrl[i].iWidth;
00174                                 break;
00175                 }
00176                 if (toolCtrl[i].wType != TC_SPACE) {
00177                         MoveWindow (toolCtrl[i].hwnd, x, y, dx, dy, FALSE);
00178                 }
00179                 x += dx;
00180         }
00181         if (hwndTools) {
00182                 UpdateWindow (hwndTools);
00183         }
00184 }
00185
00186 BOOL AddToolSpace (int iWidth, int iHeight)
00187 {
00188         if (cntToolCtrls >= MAXCTRLS) return FALSE;
00189         toolCtrl[cntToolCtrls].hwnd = 0;
00190         toolCtrl[cntToolCtrls].wType = TC_SPACE;
00191         toolCtrl[cntToolCtrls].iWidth = iWidth;
00192         toolCtrl[cntToolCtrls].iHeight = iHeight;
00193         if ((toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder)) > dyTools) {
00194                 dyTools = (toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder));
00195         }
00196         UpdatePositions();
00197         cntToolCtrls++;
00198         return TRUE;
00199 }
00200
00201 HWND AddToolLabel (HANDLE hInst, int iId, LPSTR szLabel, int iWidth, DWORD dwStyle)
00202 {
00203         HDC hdc;
00204
00205         if (cntToolCtrls >= MAXCTRLS) return (HWND)0; // No room left in our fixed array
00206
00207         toolCtrl[cntToolCtrls].hwnd = CreateWindow ("STATIC", szLabel,
00208                 WS_CHILD | WS_VISIBLE | dwStyle,
00209                 0, 0, 0, 0,
00210                 hwndTools, (HMENU)(INT_PTR)iId, hInst, NULL);
00211
00212         if (!toolCtrl[cntToolCtrls].hwnd) return (HWND)0; // CreateWindow failed for some reason
00213
00214         SendMessage (toolCtrl[cntToolCtrls].hwnd, WM_SETFONT, (UINT_PTR)hfontTools, (LONG_PTR)MAKELONG (TRUE, 0));
00215         toolCtrl[cntToolCtrls].wType = TC_LABEL;
00216
00217         hdc = GetDC (hwndTools);
00218         if (iWidth < 0) {
00219                 toolCtrl[cntToolCtrls].iWidth = tmToolFont.tmAveCharWidth * abs(iWidth);
00220         } else if (iWidth == 0) {
00221                 SIZE size;
00222                 GetTextExtentPoint (hdc, szLabel, lstrlen(szLabel), &size);
00223                 toolCtrl[cntToolCtrls].iWidth = size.cx;
00224         } else {
00225                 toolCtrl[cntToolCtrls].iWidth = iWidth;
00226         }
00227         toolCtrl[cntToolCtrls].iHeight = tmToolFont.tmHeight;
00228
00229         if ((toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder)) > dyTools) {
00230                 dyTools = (toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder));
00231         }
00232
00233         ReleaseDC (hwndTools, hdc);
00234         UpdatePositions();
00235         return toolCtrl[cntToolCtrls++].hwnd;
00236 }
00237
00238 HWND AddToolCombo (HANDLE hInst, int iId, int iWidth, DWORD dwStyle)
00239 {
00240
00241         if (cntToolCtrls >= MAXCTRLS) return (HWND)0; // No room left in our fixed array
00242
00243         if (dwStyle==0) dwStyle = CBS_DROPDOWNLIST;
00244         toolCtrl[cntToolCtrls].hwnd = CreateWindow ("COMBOBOX", "",
00245                 WS_CHILD | WS_VISIBLE | dwStyle,
00246                 0, 0, 0, 0,
00247                 hwndTools, (HMENU)(INT_PTR)iId, hInst, NULL);
00248
00249         if (!toolCtrl[cntToolCtrls].hwnd) return (HWND)0; // CreateWindow failed for some reason
00250
00251         SendMessage (toolCtrl[cntToolCtrls].hwnd, WM_SETFONT, (UINT_PTR)hfontTools, MAKELONG (TRUE, 0));
00252         toolCtrl[cntToolCtrls].wType = TC_COMBO;
00253
00254         if (iWidth < 0) {
00255                 toolCtrl[cntToolCtrls].iWidth = tmToolFont.tmAveCharWidth * abs(iWidth);
00256         } else if (iWidth == 0) {
00257                 toolCtrl[cntToolCtrls].iWidth = tmToolFont.tmAveCharWidth * 15; // just a default width
00258         } else {
00259                 toolCtrl[cntToolCtrls].iWidth = iWidth;
00260         }
00261         toolCtrl[cntToolCtrls].iHeight = dyCombo;
00262
00263         if ((toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder)) > dyTools) {
00264                 dyTools = (toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder));
00265         }
00266
00267         UpdatePositions();
00268         return toolCtrl[cntToolCtrls++].hwnd;
00269 }
00270
00271
00272 HWND AddToolButton (HANDLE hInst, int iId, LPSTR szLabel, int iWidth, int iHeight, DWORD dwStyle)
00273 {
00274         HDC hdc;
00275
00276         if (cntToolCtrls >= MAXCTRLS) return (HWND)0; // No room left in our fixed array
00277
00278         if (dwStyle == 0) dwStyle = BS_PUSHBUTTON;
00279         toolCtrl[cntToolCtrls].hwnd = CreateWindow ("BUTTON", szLabel,
00280                 WS_CHILD | WS_VISIBLE | dwStyle,
00281                 0, 0, 0, 0,
00282                 hwndTools, (HMENU)(INT_PTR)iId, hInst, NULL);
00283
00284         if (!toolCtrl[cntToolCtrls].hwnd) return (HWND)0; // CreateWindow failed for some reason
00285
00286         SendMessage (toolCtrl[cntToolCtrls].hwnd, WM_SETFONT, (UINT_PTR)hfontTools, MAKELONG (TRUE, 0));
00287         toolCtrl[cntToolCtrls].wType = TC_BUTTON;
00288
00289         hdc = GetDC (hwndTools);
00290         SelectObject (hdc, hfontTools);
00291         if (iWidth < 0) {
00292                 toolCtrl[cntToolCtrls].iWidth = tmToolFont.tmAveCharWidth * abs(iWidth);
00293                 toolCtrl[cntToolCtrls].iWidth += (6*cxToolBorder);
00294         } else if (iWidth == 0) {
00295                 SIZE size;
00296                 GetTextExtentPoint (hdc, szLabel, lstrlen(szLabel), &size);
00297                 toolCtrl[cntToolCtrls].iWidth = size.cx;
00298                 toolCtrl[cntToolCtrls].iWidth += (6*cxToolBorder);
00299         } else {
00300                 toolCtrl[cntToolCtrls].iWidth = iWidth;
00301         }
00302         if (iHeight < 0) {
00303                 toolCtrl[cntToolCtrls].iHeight = tmToolFont.tmHeight;
00304                 toolCtrl[cntToolCtrls].iHeight += (6*cyToolBorder);
00305         } else if (iHeight==0) {
00306                 toolCtrl[cntToolCtrls].iHeight = dyTools - (6*cyToolBorder);
00307         } else {
00308                 toolCtrl[cntToolCtrls].iHeight = iHeight;
00309         }
00310
00311         if ((toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder)) > dyTools) {
00312                 dyTools = (toolCtrl[cntToolCtrls].iHeight + (6*cyToolBorder));
00313         }
00314
00315         if (dwStyle & BS_OWNERDRAW) {
00316                 toolCtrl[cntToolCtrls].hIcon = LoadIcon (hInst, szLabel);
00317         } else {
00318                 toolCtrl[cntToolCtrls].hIcon = NULL;
00319         }
00320
00321         ReleaseDC (hwndTools, hdc);
00322         UpdatePositions();
00323         return toolCtrl[cntToolCtrls++].hwnd;
00324 }
00325
00326
00327 BOOL DestroyToolBar (void)
00328 {
00329         return DeleteObject (hbrBtnFace);
00330 }
00331
00332 void DrawButton (HDC hdc, RECT rect, BOOL bDown, HICON hIcon)
00333 {
00334         HBRUSH  hBrush, hbrFrame, hbrFace, hbrHilite, hbrShadow;
00335         RECT    border;
00336         int     i;
00337
00338         hbrFrame = CreateSolidBrush(GetSysColor(COLOR_WINDOWFRAME));
00339         hbrFace = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
00340         hbrHilite = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
00341         hbrShadow = CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW));
00342
00343         FillRect (hdc, &rect, hbrFace);
00344
00345         if (hIcon) {
00346                 if (bDown) {
00347                         DrawIcon (hdc, rect.left + (4*cyToolBorder), rect.top + (4*cyToolBorder), hIcon);
00348                 } else {
00349                         DrawIcon (hdc, rect.left + (3*cyToolBorder), rect.top + (3*cyToolBorder), hIcon);
00350                 }
00351         }
00352
00353         hBrush = hbrFrame;
00354         border = rect; border.bottom = border.top + cyToolBorder;
00355         FillRect (hdc, &border, hBrush);
00356         border = rect; border.right = border.left + cxToolBorder;
00357         FillRect (hdc, &border, hBrush);
00358         border = rect; border.top = border.bottom - cyToolBorder;
00359         FillRect (hdc, &border, hBrush);
00360         border = rect; border.left = border.right - cxToolBorder;
00361         FillRect (hdc, &border, hBrush);
00362
00363         for (i= 0; i<2; i++) {
00364                 InflateRect (&rect, -cxToolBorder, -cyToolBorder);
00365                 hBrush = (bDown?hbrShadow:hbrHilite);
00366                 border = rect; border.bottom = border.top + cyToolBorder;
00367                 FillRect (hdc, &border, hBrush);
00368                 border = rect; border.right = border.left + cxToolBorder;
00369                 FillRect (hdc, &border, hBrush);
00370                 if (!bDown) {
00371                         hBrush = hbrShadow;
00372                         border = rect; border.top = border.bottom - cyToolBorder;
00373                         FillRect (hdc, &border, hBrush);
00374                         border = rect; border.left = border.right - cxToolBorder;
00375                         FillRect (hdc, &border, hBrush);
00376                 }
00377         }
00378
00379         DeleteObject (hbrFrame);
00380         DeleteObject (hbrFace);
00381         DeleteObject (hbrHilite);
00382         DeleteObject (hbrShadow);
00383
00384 }
00385
00386
00387 LONG_PTR APIENTRY ToolsProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00388 {
00389         HDC          hdc;
00390         PAINTSTRUCT      ps;
00391         int          iType, idCtrl, msgCtrl, i;
00392         RECT         rect, border;
00393         COLORREF         clrColor;
00394         HWND         hwndCtl;
00395         LONG         lStyle;
00396         HBRUSH       hBrush;
00397         LPDRAWITEMSTRUCT lpdi;
00398         HICON        hIcon;
00399         LOGFONT     lfTmp ={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
00400
00401         switch (msg) {
00402                 case WM_CREATE:
00403                         lfTmp.lfHeight = 14;
00404                         lfTmp.lfPitchAndFamily = VARIABLE_PITCH | FF_SWISS;
00405                         hfontTools = CreateFontIndirect (&lfTmp);
00406                         if (!hfontTools) {
00407                                 MessageBox (GetFocus(),
00408                                         "Unable to get an unnamed variable pitch swiss font",
00409                                         "Tool Bar CreateFont Error",
00410                                          MB_OK);
00411                                 hfontTools = CreateFont(14, 0, 0, 0, 0, 0, 0, 0,
00412                                         0, 0, 0, 0,
00413                                         VARIABLE_PITCH | FF_SWISS, "Arial");
00414                         }
00415
00416                         if (!hfontTools) {
00417                                 MessageBox (GetFocus(), "Failed To Create Font", "StatusProc", MB_OK);
00418                         }
00419                         hdc = GetDC (hwnd);
00420                         SelectObject (hdc, hfontTools);
00421                         GetTextMetrics (hdc, &tmToolFont);
00422                         ReleaseDC (hwnd, hdc);
00423                         return DefWindowProc (hwnd, msg, wParam, lParam);
00424
00425                 case WM_DESTROY:
00426                         if (hfontTools) {
00427                                 DeleteObject (hfontTools);
00428                         }
00429                         break;
00430
00431                 case WM_SIZE:
00432                         UpdatePositions();
00433                         break;
00434
00435                 case WM_CTLCOLORLISTBOX:
00436                 case WM_CTLCOLOREDIT:
00437                 case WM_CTLCOLORSTATIC:
00438                 case WM_CTLCOLORBTN:
00439                 case WM_CTLCOLORDLG:
00440                 case WM_CTLCOLORMSGBOX:
00441                 case WM_CTLCOLORSCROLLBAR:
00442                         iType   = msg - WM_CTLCOLORMSGBOX;
00443                         hdc     = (HDC)wParam;
00444                         hwndCtl = (HWND)lParam;
00445                         switch (iType) {
00446                                 case CTLCOLOR_EDIT: //Edit control
00447                                         clrColor = GetSysColor (COLOR_BTNFACE);
00448                                         hBrush = hbrWindow;
00449                                         break;
00450
00451                                 case CTLCOLOR_LISTBOX: //List-box control
00452                                         lStyle = (LONG)GetWindowLongPtr (hwndCtl, GWL_STYLE);
00453                                         if (lStyle & CBS_SIMPLE) {
00454                                                 clrColor = GetSysColor (COLOR_WINDOW);
00455                                                 hBrush = hbrWindow;
00456                                         } else {
00457                                                 clrColor = GetSysColor (COLOR_BTNFACE);
00458                                                 hBrush = hbrBtnFace;
00459                                         }
00460                                         break;
00461
00462                                 case CTLCOLOR_STATIC:
00463                                         clrColor = GetSysColor (COLOR_BTNFACE);
00464                                         hBrush = hbrBtnFace;
00465                                         break;
00466
00467                                 case CTLCOLOR_BTN:
00468                                         clrColor = GetSysColor (COLOR_BTNFACE);
00469                                         hBrush = hbrBtnFace;
00470                                         break;
00471
00472                                 case CTLCOLOR_SCROLLBAR:
00473                                 case CTLCOLOR_DLG:
00474                                 case CTLCOLOR_MSGBOX:
00475                                 default:
00476                                         return DefWindowProc (hwnd, msg, wParam, lParam);
00477                         }
00478                         SetBkColor(hdc, clrColor);
00479                 return (LONG_PTR)hBrush;
00480
00481                 case WM_PAINT:
00482                         hdc = BeginPaint (hwnd, &ps);
00483                         GetClientRect (hwnd, &rect);
00484
00485                         /* Shade the top of the bar white */
00486                         hBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
00487                         border = rect;
00488                         border.bottom = border.top + cyToolBorder;
00489                         FillRect (hdc, &border, hBrush);
00490                         DeleteObject (hBrush);
00491
00492                         /* Shade the bottom of the bar dark gray */
00493                         hBrush = CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW));
00494                         border = rect;
00495                         border.top = border.bottom - cyToolBorder;
00496                         FillRect (hdc, &border, hBrush);
00497                         DeleteObject (hBrush);
00498
00499                         EndPaint (hwnd, &ps);
00500
00501                         return DefWindowProc (hwnd, msg, wParam, lParam);
00502
00503                 case WM_DRAWITEM: // Indicates that an owner-draw control needs to be redrawn.
00504                         lpdi = (LPDRAWITEMSTRUCT)lParam;
00505
00506                         switch (lpdi->itemAction) {
00507                                 // handle normal drawing of button, but check if its selected or focus
00508                                 case ODA_SELECT:
00509                                 case ODA_DRAWENTIRE:
00510                                         // handle button pressed down select state -- button down bitmap
00511                                         //   text is right & down 2 pixels
00512                                                                                 hIcon = NULL;
00513                                         for (i=0; i< cntToolCtrls; i++) {
00514                                                 if (toolCtrl[i].hwnd == lpdi->hwndItem) {
00515                                                         hIcon = toolCtrl[i].hIcon;
00516                                                 }
00517                                         }
00518                                         if (lpdi->itemState & ODS_SELECTED) {
00519                                                 DrawButton (lpdi->hDC,lpdi->rcItem, TRUE, hIcon);
00520                                         } else { // not selected -- button up; text is in normal position
00521                                                 DrawButton (lpdi->hDC,lpdi->rcItem, FALSE, hIcon);
00522                                         }
00523                                         return TRUE;
00524                         }
00525                         break;
00526
00527                 case WM_COMMAND:
00528                         idCtrl = LOWORD(wParam);
00529                         msgCtrl = HIWORD(wParam);
00530                         hwndCtl = (HWND)lParam;
00531
00532                         if (GetWindowLongPtr (hwndCtl, GWL_STYLE) & BS_OWNERDRAW) {
00533                                 if (msgCtrl == BN_DOUBLECLICKED) {
00534                                         PostMessage (hwndCtl, WM_LBUTTONDOWN, 0, 0);
00535                                         return TRUE;
00536                                 }
00537                         }
00538                         PostMessage (hwndMain, msg, wParam, lParam);
00539                         return DefWindowProc (hwnd, msg, wParam, lParam);
00540
00541
00542                 default:
00543                         return DefWindowProc (hwnd, msg, wParam, lParam);
00544         }
00545         return 0L;
00546 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmDebug/CrmDebug.Idl Source File

  • Com
  • Services
  • Crm
  • CrmDebug

CrmDebug.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: CrmDebug.idl
00004
00005
00006 ----------------------------------------------------------------------------
00007
00008 This file is part of the Microsoft COM+ Samples.
00009
00010
00011
00012 Copyright (C) 1995-1998 Microsoft Corporation. All rights reserved.
00013
00014
00015
00016 This source code is intended only as a supplement to Microsoft
00017
00018 Development Tools and/or on-line documentation. See these other
00019
00020 materials for detailed information regarding Microsoft code samples.
00021
00022
00023
00024 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00025
00026 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00027
00028 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00029
00030 PARTICULAR PURPOSE.
00031
00032 ==========================================================================+*/
00033
00034 // CrmDebug.idl : IDL source for CrmDebug.dll
00035 //
00036
00037 // This file will be processed by the MIDL tool to
00038 // produce the type library (CrmDebug.tlb) and marshalling code.
00039
00040 import "oaidl.idl";
00041 import "ocidl.idl";
00042
00043   [
00044
00045     uuid(FA796173-D8B0-11D1-AB85-00A0C91EEDE9),
00046
00047     helpstring("ICrmDebugCompensator Interface"),
00048     pointer_default(unique)
00049   ]
00050   interface ICrmDebugCompensator : IUnknown
00051   {
00052   };
00053 [
00054   uuid(FA796164-D8B0-11D1-AB85-00A0C91EEDE9),
00055   version(1.0),
00056   helpstring("CrmDebug 1.0 Type Library")
00057 ]
00058 library CRMDEBUGLib
00059 {
00060   importlib("stdole32.tlb");
00061   importlib("stdole2.tlb");
00062
00063   [
00064     uuid(FA796174-D8B0-11D1-AB85-00A0C91EEDE9),
00065     helpstring("CrmDebugCompensator Class")
00066   ]
00067   coclass CrmDebugCompensator
00068   {
00069     [default] interface ICrmDebugCompensator;
00070   };
00071 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/MulDiv32.h Source File

  • Multimedia
  • Audio
  • MidiPlyr

MulDiv32.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 *  MulDiv32.h
00013 *
00014 *  Description:
00015 *      math routines for 32 bit signed and unsiged numbers.
00016 *
00017 *      MulDiv32(a,b,c) = (a * b) / c         (round down, signed)
00018 *
00019 *      MulDivRD(a,b,c) = (a * b) / c         (round down, unsigned)
00020 *      MulDivRN(a,b,c) = (a * b + c/2) / c   (round nearest, unsigned)
00021 *      MulDivRU(a,b,c) = (a * b + c-1) / c   (round up, unsigned)
00022 *
00023 *****************************************************************************/
00024
00025 #ifndef _INC_MULDIV32
00026 #define _INC_MULDIV32
00027
00028
00029 #ifndef INLINE
00030 #define INLINE __inline
00031 #endif
00032
00033
00034 #ifdef _WIN32
00035
00036     //----------------------------------------------------------------------;
00037     //
00038     //  Win 32
00039     //
00040     //----------------------------------------------------------------------;
00041
00042     #ifdef _X86_
00043
00044         //
00045         //  Use 32-bit x86 assembly.
00046         //
00047
00048         #pragma warning(disable:4035 4704)
00049
00050     #define MulDivRN MulDiv // Doesn't work with /Ox; MSVC20 messes up
00051                 // the inline asm code, instead of including
00052                 // it prolog/verbatim/epilog.
00053                 // So use the Windows function for now
00054         #if 0
00055         INLINE LONG MulDiv32(LONG a,LONG b,LONG c)
00056         {
00057             _asm     mov     eax,dword ptr a  //  mov  eax, a
00058             _asm     mov     ebx,dword ptr b  //  mov  ebx, b
00059             _asm     mov     ecx,dword ptr c  //  mov  ecx, c
00060             _asm     imul    ebx              //  imul ebx
00061             _asm     idiv    ecx              //  idiv ecx
00062             _asm   shld  edx, eax, 16     //  shld edx, eax, 16
00063
00064         } // MulDiv32()
00065
00066         INLINE DWORD MulDivRN(DWORD a,DWORD b,DWORD c)
00067         {
00068             _asm     mov     eax,dword ptr a  //  mov  eax, a
00069             _asm     mov     ebx,dword ptr b  //  mov  ebx, b
00070             _asm     mov     ecx,dword ptr c  //  mov  ecx, c
00071             _asm     mul     ebx              //  mul  ebx
00072             _asm     mov     ebx,ecx          //  mov  ebx,ecx
00073             _asm     shr     ebx,1            //  sar  ebx,1
00074             _asm     add     eax,ebx          //  add  eax,ebx
00075             _asm     adc     edx,0            //  adc  edx,0
00076             _asm     div     ecx              //  div  ecx
00077             _asm     shld    edx, eax, 16     //  shld edx, eax, 16
00078
00079         } // MulDiv32()
00080
00081         INLINE DWORD MulDivRU(DWORD a,DWORD b,DWORD c)
00082         {
00083             _asm     mov     eax,dword ptr a  //  mov  eax, a
00084             _asm     mov     ebx,dword ptr b  //  mov  ebx, b
00085             _asm     mov     ecx,dword ptr c  //  mov  ecx, c
00086             _asm     mul     ebx              //  mul  ebx
00087             _asm     mov     ebx,ecx          //  mov  ebx,ecx
00088             _asm     dec     ebx              //  dec  ebx
00089             _asm     add     eax,ebx          //  add  eax,ebx
00090             _asm     adc     edx,0            //  adc  edx,0
00091             _asm     div     ecx              //  div  ecx
00092             _asm     shld    edx, eax, 16     //  shld edx, eax, 16
00093
00094         } // MulDivRU32()
00095
00096         INLINE DWORD MulDivRD(DWORD a,DWORD b,DWORD c)
00097         {
00098             _asm     mov     eax,dword ptr a  //  mov  eax, a
00099             _asm     mov     ebx,dword ptr b  //  mov  ebx, b
00100             _asm     mov     ecx,dword ptr c  //  mov  ecx, c
00101             _asm     mul     ebx              //  mul  ebx
00102             _asm     div     ecx              //  div  ecx
00103             _asm     shld    edx, eax, 16     //  shld edx, eax, 16
00104
00105         } // MulDivRD32()
00106         #endif
00107
00108         #pragma warning(default:4035 4704)
00109
00110
00111     #else
00112
00113         //
00114         //  Use C9 __int64 support for Daytona RISC platforms.
00115         //
00116
00117         INLINE LONG MulDiv32( LONG a, LONG b, LONG c )
00118         {
00119             return (LONG)( Int32x32To64(a,b) / c );
00120         }
00121
00122
00123         INLINE DWORD MulDivRD( DWORD a, DWORD b, DWORD c )
00124         {
00125             return (DWORD)( UInt32x32To64(a,b) / c );
00126         }
00127
00128
00129         INLINE DWORD MulDivRN( DWORD a, DWORD b, DWORD c )
00130         {
00131             return (DWORD)( (UInt32x32To64(a,b)+c/2) / c );
00132         }
00133
00134
00135         INLINE DWORD MulDivRU( DWORD a, DWORD b, DWORD c )
00136         {
00137             return (DWORD)( (UInt32x32To64(a,b)+c-1) / c );
00138         }
00139
00140     #endif
00141
00142
00143 #else
00144
00145     //----------------------------------------------------------------------;
00146     //
00147     //  Win 16
00148     //
00149     //----------------------------------------------------------------------;
00150
00151     #pragma warning(disable:4035 4704)
00152
00153     //
00154     //  Compile for 16-bit - we can use x86 with proper opcode prefixes
00155     //      to get 32-bit instructions.
00156     //
00157
00158     INLINE LONG MulDiv32(LONG a,LONG b,LONG c)
00159     {
00160         _asm _emit 0x66 _asm    mov     ax,word ptr a   //  mov  eax, a
00161         _asm _emit 0x66 _asm    mov     bx,word ptr b   //  mov  ebx, b
00162         _asm _emit 0x66 _asm    mov     cx,word ptr c   //  mov  ecx, c
00163         _asm _emit 0x66 _asm    imul    bx              //  imul ebx
00164         _asm _emit 0x66 _asm    idiv    cx              //  idiv ecx
00165         _asm _emit 0x66                                 //  shld edx, eax, 16
00166         _asm _emit 0x0F
00167         _asm _emit 0xA4
00168         _asm _emit 0xC2
00169         _asm _emit 0x10
00170
00171     } // MulDiv32()
00172
00173     INLINE DWORD MulDivRN(DWORD a,DWORD b,DWORD c)
00174     {
00175         _asm _emit 0x66 _asm    mov     ax,word ptr a   //  mov  eax, a
00176         _asm _emit 0x66 _asm    mov     bx,word ptr b   //  mov  ebx, b
00177         _asm _emit 0x66 _asm    mov     cx,word ptr c   //  mov  ecx, c
00178         _asm _emit 0x66 _asm    mul     bx              //  mul  ebx
00179         _asm _emit 0x66 _asm    mov     bx,cx           //  mov  ebx,ecx
00180         _asm _emit 0x66 _asm    shr     bx,1            //  sar  ebx,1
00181         _asm _emit 0x66 _asm    add     ax,bx           //  add  eax,ebx
00182         _asm _emit 0x66 _asm    adc     dx,0            //  adc  edx,0
00183         _asm _emit 0x66 _asm    div     cx              //  div  ecx
00184         _asm _emit 0x66                                 //  shld edx, eax, 16
00185         _asm _emit 0x0F
00186         _asm _emit 0xA4
00187         _asm _emit 0xC2
00188         _asm _emit 0x10
00189
00190     } // MulDiv32()
00191
00192     INLINE DWORD MulDivRU(DWORD a,DWORD b,DWORD c)
00193     {
00194         _asm _emit 0x66 _asm    mov     ax,word ptr a   //  mov  eax, a
00195         _asm _emit 0x66 _asm    mov     bx,word ptr b   //  mov  ebx, b
00196         _asm _emit 0x66 _asm    mov     cx,word ptr c   //  mov  ecx, c
00197         _asm _emit 0x66 _asm    mul     bx              //  mul  ebx
00198         _asm _emit 0x66 _asm    mov     bx,cx           //  mov  ebx,ecx
00199         _asm _emit 0x66 _asm    dec     bx              //  dec  ebx
00200         _asm _emit 0x66 _asm    add     ax,bx           //  add  eax,ebx
00201         _asm _emit 0x66 _asm    adc     dx,0            //  adc  edx,0
00202         _asm _emit 0x66 _asm    div     cx              //  div  ecx
00203         _asm _emit 0x66                                 //  shld edx, eax, 16
00204         _asm _emit 0x0F
00205         _asm _emit 0xA4
00206         _asm _emit 0xC2
00207         _asm _emit 0x10
00208
00209     } // MulDivRU32()
00210
00211
00212     INLINE DWORD MulDivRD(DWORD a,DWORD b,DWORD c)
00213     {
00214         _asm _emit 0x66 _asm    mov     ax,word ptr a   //  mov  eax, a
00215         _asm _emit 0x66 _asm    mov     bx,word ptr b   //  mov  ebx, b
00216         _asm _emit 0x66 _asm    mov     cx,word ptr c   //  mov  ecx, c
00217         _asm _emit 0x66 _asm    mul     bx              //  mul  ebx
00218         _asm _emit 0x66 _asm    div     cx              //  div  ecx
00219         _asm _emit 0x66                                 //  shld edx, eax, 16
00220         _asm _emit 0x0F
00221         _asm _emit 0xA4
00222         _asm _emit 0xC2
00223         _asm _emit 0x10
00224
00225     } // MulDivRD32()
00226
00227     #pragma warning(default:4035 4704)
00228
00229 #endif
00230
00231
00232 //
00233 //  some code references these by other names.
00234 //
00235 #define muldiv32    MulDivRN
00236 #define muldivrd32  MulDivRD
00237 #define muldivru32  MulDivRU
00238
00239 #endif  // _INC_MULDIV32
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/service.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

service.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     System Service Procedures
00006
00007     FILE: Service.c
00008
00009     PURPOSE: Provides file replication service function definitions.
00010
00011     FUNCTIONS:
00012         IsLocalSystem - Checks whether the service is running as
00013       local system.
00014         ReportStatusToSCMgr - Changes the service's status and
00015       registers change with SCM.
00016         AddToMessageLog - Adds a string to the system message log.
00017
00018     COMMENTS:
00019
00020         These funtions may be used by the main service routines
00021       as well as by the client and server file replication RPC routines.
00022
00023     IMPORTANT:
00024
00025         Counter and Queueing code provides the necessary functionality for
00026       the service and is strictly a sample.  It does not demonstrate how to queue
00027       user requests properly and write high-performance servers.  The purpose of this
00028       sample is demostration of RPC features and the following code is refined to
00029       the extent it allows us to accomplish that.
00030
00031 */
00032
00033 #include <windows.h>
00034 #include <stdio.h>
00035 #include <tchar.h>
00036 #include <lm.h>
00037
00038 #include "common.h"
00039
00040 #include "Service.h"
00041
00042 #ifdef DEBUG
00043 #include "DbgMsg.h"
00044 #endif
00045
00046 // We support anonymous, regular, and system
00047 // user groups.
00048 const UINT NumPriGroups = 3;
00049
00050 #ifdef LARGE_RES_BOUNDS
00051
00052 // The maximum number of requests
00053 // that can be placed by anonymous, regular,
00054 // and system accounts respectively on the server.
00055 const UINT ServerReqBounds[] =  {1000, 2000, 3000};
00056
00057 // Equivalent bounds on the client.
00058 const UINT ClientReqBounds[] =  {1000, 2000, 3000};
00059
00060 // The maximum number of requests that can be
00061 // simultaneously handled on the client.
00062 const UINT ClientActiveReqBounds[] =  {100, 500, 1000};
00063
00064 const UINT MaxUserReqs = 1000;
00065
00066 #else
00067
00068 const UINT ServerReqBounds[] =  {10, 20, 30};
00069
00070 const UINT ClientReqBounds[] =  {10, 20, 30};
00071
00072 const UINT ClientActiveReqBounds[] =  {1, 5, 10};
00073
00074 const UINT MaxUserReqs = 5;
00075
00076 #endif
00077
00078 Counter *pServerReqCounters[NumPriGroups];
00079 Counter *pClientReqCounters[NumPriGroups];
00080 Counter *pClientActiveReqCounters[NumPriGroups];
00081
00082 Queue *ClientReqQueues[NumPriGroups];
00083 Queue *ClientActiveReqHashQueues[NumPriGroups];
00084 Queue *ClientActiveReqHashCounters[NumPriGroups];
00085
00086 const UINT RegUsersPri = 1;
00087
00088 /*
00089
00090     FUNCTION: GetUserSid
00091
00092     PURPOSE: Obtains a pointer to the SID for the current user
00093
00094     PARAMETERS:
00095         none
00096
00097     RETURN VALUE:
00098         Pointer to the SID
00099
00100     COMMENTS:
00101         The SID buffer returned by this function is allocated with
00102         HeapAlloc and should be freed with HeapFree.
00103
00104 */
00105 PSID GetUserSID() {
00106     SID_NAME_USE snuType;
00107     PSID pUserSID = NULL;
00108     DWORD cbUserSID = 0;
00109
00110     LPTSTR szUserName = NULL;
00111     DWORD cbUserName = 0;
00112
00113     LPTSTR szDomainName = NULL;
00114     DWORD cbDomainName = 0;
00115
00116     BOOL fAPISuccess;
00117
00118 #ifdef DEBUG
00119     TCHAR Msg[MSG_SIZE];
00120
00121     DbgMsgRecord(TEXT("->GetUserSID\n"));
00122 #endif
00123
00124     // Get the logged on user name.  First we determine the size
00125     // of the buffer required and then get the username.
00126
00127     // Get the size of the name.
00128     fAPISuccess = GetUserName(szUserName, &cbUserName);
00129
00130     // API should have failed with insufficient buffer.
00131     ASSERTE(!fAPISuccess);
00132
00133 #ifdef DEBUG
00134     _stprintf(Msg, TEXT("GetUserSID: cbUserName=%d\n"), cbUserName);
00135     DbgMsgRecord(Msg);
00136 #endif
00137
00138     if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
00139         AddToMessageLogProcFailure(TEXT("GetUserSID: GetUserName"), GetLastError());
00140         return NULL;
00141     }
00142
00143     // Allocate buffer for the name.
00144     szUserName = (LPTSTR) AutoHeapAlloc(cbUserName * sizeof(TCHAR));
00145     if (szUserName == NULL) {
00146         AddToMessageLog(TEXT("GetUserSID: AutoHeapAlloc failed"));
00147         return NULL;
00148     }
00149
00150     // Finally get the name.
00151     fAPISuccess = GetUserName(szUserName, &cbUserName);
00152     if (!fAPISuccess) {
00153         AutoHeapFree(szUserName);
00154         AddToMessageLogProcFailure(TEXT("GetUserSID: GetUserName"), GetLastError());
00155         return NULL;
00156     }
00157
00158 #ifdef DEBUG
00159     _stprintf(Msg, TEXT("GetUserSID: UserName=%s cbUserName=%d\n"), szUserName, cbUserName),
00160     DbgMsgRecord(Msg);
00161 #endif
00162
00163     // Do the same for SID.  First get the size and then allocate the buffer
00164     // and perform the actual call.
00165     fAPISuccess = LookupAccountName(NULL, szUserName,
00166                                     pUserSID, &cbUserSID, szDomainName, &cbDomainName, &snuType);
00167
00168     // API should have failed with insufficient buffer.
00169     ASSERTE(fAPISuccess);
00170
00171 #ifdef DEBUG
00172     _stprintf(Msg, TEXT("GetUserSID: cbUserSID=%d\n"), cbUserSID),
00173     DbgMsgRecord(Msg);
00174 #endif
00175
00176     if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
00177         AutoHeapFree(szUserName);
00178         AddToMessageLogProcFailure(TEXT("GetUserSID: LookupAccountName"), GetLastError());
00179         return NULL;
00180     }
00181
00182     // Allocate the SID buffer...
00183     pUserSID = AutoHeapAlloc(cbUserSID);
00184     if (pUserSID == NULL) {
00185         AutoHeapFree(szUserName);
00186         AddToMessageLog(TEXT("GetUserSID: AutoHeapAlloc failed"));
00187         return NULL;
00188     }
00189
00190     // And the domain name buffer.
00191     szDomainName = (LPTSTR) AutoHeapAlloc(cbDomainName * sizeof(TCHAR));
00192     if (!szDomainName) {
00193         AutoHeapFree(szUserName);
00194         AutoHeapFree(pUserSID);
00195         AddToMessageLog(TEXT("GetUserSID: AutoHeapAlloc failed"));
00196         return NULL;
00197     }
00198
00199     // Now get the SID.
00200     fAPISuccess = LookupAccountName(NULL, szUserName,
00201                                     pUserSID, &cbUserSID, szDomainName, &cbDomainName, &snuType);
00202     if (!fAPISuccess) {
00203         AutoHeapFree(szUserName);
00204         AutoHeapFree(szDomainName);
00205         AutoHeapFree(pUserSID);
00206         AddToMessageLogProcFailure(TEXT("GetUserSID: LookupAccountName"), GetLastError());
00207         return NULL;
00208     }
00209
00210     AutoHeapFree(szUserName);
00211     AutoHeapFree(szDomainName);
00212
00213 #ifdef DEBUG
00214     _stprintf(Msg, TEXT("GetUserSID: pUserSID=%p cbUserSID=%d\n"), pUserSID, cbUserSID),
00215     DbgMsgRecord(Msg);
00216 #endif
00217
00218 #ifdef DEBUG
00219     DbgMsgRecord(TEXT("<-GetUserSID\n"));
00220 #endif
00221
00222     return pUserSID;
00223 }
00224
00225 /*
00226
00227     FUNCTION: GetUserGroups
00228
00229     PURPOSE: Obtains a pointer to the groups that current
00230     token is member of.
00231
00232     PARAMETERS:
00233         none
00234
00235     COMMENTS:
00236         The PTOKEN_GROUPS pointer returned by this function is allocated with
00237         HeapAlloc and should be freed with HeapFree.
00238
00239 */
00240 PTOKEN_GROUPS GetUserGroups(VOID) {
00241     DWORD dwSize;
00242     DWORD dwResult;
00243     HANDLE hToken;
00244     PTOKEN_GROUPS pGroupInfo = NULL;
00245
00246 #ifdef DEBUG
00247     DbgMsgRecord(TEXT("->GetUserGroups\n"));
00248 #endif
00249
00250     // Open a handle to the access token for the calling thread.
00251     if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &hToken)) {
00252         AddToMessageLogProcFailure(TEXT("GetUserGroups: OpenProcessToken"), GetLastError());
00253         return NULL;
00254     }
00255
00256     // Call GetTokenInformation to get the buffer size.
00257     dwSize = 0;
00258     if(GetTokenInformation(hToken, TokenGroups, NULL, dwSize, &dwSize) == 0) {
00259         dwResult = GetLastError();
00260         if(dwResult != ERROR_INSUFFICIENT_BUFFER ) {
00261             AddToMessageLogProcFailure(TEXT("GetUserGroups: GetTokenInformation"), dwResult);
00262
00263             CloseHandle(hToken);
00264             return NULL;
00265         }
00266     }
00267     else {
00268         // We should have returned with an error above.
00269         ASSERTE(TRUE);
00270     }
00271
00272     // Allocate the buffer.
00273     if ((pGroupInfo = (PTOKEN_GROUPS) AutoHeapAlloc(dwSize)) == NULL) {
00274         AddToMessageLog(TEXT("GetUserGroups: AutoHeapAlloc failed"));
00275
00276         CloseHandle(hToken);
00277         return NULL;
00278     }
00279
00280     // Call GetTokenInformation again to get the group information.
00281     if(GetTokenInformation(hToken, TokenGroups, pGroupInfo, dwSize, &dwSize) == 0) {
00282         AddToMessageLogProcFailure(TEXT("GetUserGroups: GetTokenInformation"), GetLastError());
00283
00284         AutoHeapFree(pGroupInfo);
00285         CloseHandle(hToken);
00286         return NULL;
00287     }
00288
00289 #ifdef DEBUG
00290     DbgMsgRecord(TEXT("<-GetUserGroups\n"));
00291 #endif
00292
00293     CloseHandle(hToken);
00294     return pGroupInfo;
00295 }
00296
00297 /*
00298
00299     FUNCTION: IsGroupMember
00300
00301     PURPOSE: Returns true if a given SID is found in a given group.
00302
00303     PARAMETERS:
00304         pSID - sid to look for.
00305         pGroupInfo - group to look in.
00306
00307 */
00308 BOOL IsGroupMember(PSID pSID, PTOKEN_GROUPS pGroupInfo) {
00309
00310 #ifdef DEBUG
00311     DbgMsgRecord(TEXT("->IsGroupMember\n"));
00312 #endif
00313
00314     // Loop through the group SIDs looking for the administrator SID.
00315     for(UINT i=0; i<pGroupInfo->GroupCount; i++) {
00316         if (EqualSid(pSID, pGroupInfo->Groups[i].Sid)) {
00317             // Find out if the SID is enabled in the token
00318             if (pGroupInfo->Groups[i].Attributes & SE_GROUP_ENABLED) {
00319
00320 #ifdef DEBUG
00321                 DbgMsgRecord(TEXT("<-IsGroupMember\n"));
00322 #endif
00323                 return TRUE;
00324             }
00325         }
00326     }
00327
00328 #ifdef DEBUG
00329     DbgMsgRecord(TEXT("<-IsGroupMember\n"));
00330 #endif
00331
00332     return FALSE;
00333 }
00334
00335 PSID pSystemSID = NULL;
00336 PSID pAdminSID = NULL;
00337 PSID pAnonSID = NULL;
00338
00339 VOID CreateWellKnownSids(VOID) {
00340     SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
00341
00342     // Generate SID for the system if necessary.
00343     if (pSystemSID == NULL) {
00344         if (AllocateAndInitializeSid(&SIDAuth, 1,
00345                                      SECURITY_LOCAL_SYSTEM_RID,
00346                                      0, 0, 0, 0, 0, 0, 0,
00347                                      &pSystemSID) == 0) {
00348             AddToMessageLogProcFailure(TEXT("CreateWellKnownSids: AllocateAndInitializeSid"), GetLastError());
00349         }
00350     }
00351
00352     // Generate SID for the admin group if necessary.
00353     if (pAdminSID == NULL) {
00354         if (AllocateAndInitializeSid(&SIDAuth, 1,
00355                                      DOMAIN_ALIAS_RID_ADMINS,
00356                                      0, 0, 0, 0, 0, 0, 0,
00357                                      &pAdminSID) == 0) {
00358             AddToMessageLogProcFailure(TEXT("CreateWellKnownSids: AllocateAndInitializeSid"), GetLastError());
00359         }
00360     }
00361
00362     // Generate the anonymous SID if necessary.
00363     if (pAnonSID == NULL) {
00364         if (AllocateAndInitializeSid(&SIDAuth, 1,
00365                                      SECURITY_ANONYMOUS_LOGON_RID,
00366                                      0, 0, 0, 0, 0, 0, 0,
00367                                      &pAnonSID) == 0) {
00368             AddToMessageLogProcFailure(TEXT("CreateWellKnownSids: AllocateAndInitializeSid"), GetLastError());
00369         }
00370     }
00371 }
00372
00373 VOID DeleteWellKnownSids(VOID) {
00374     AutoHeapFree(pSystemSID);
00375     pSystemSID = NULL;
00376     AutoHeapFree(pAdminSID);
00377     pAdminSID = NULL;
00378     AutoHeapFree(pAnonSID);
00379     pAnonSID = NULL;
00380 }
00381
00382 /*
00383     FUNCTION: GetCurrentUserPriority()
00384
00385     PURPOSE: Returns the priority of the current user.
00386         Priority is an integer between 0 and 2.
00387         0 - anonymous users
00388         1 - regular users
00389         2 - system
00390
00391     PARAMETERS:
00392         pPri - pointer to the variable that receives the priority.
00393
00394     RETURN VALUE:  True on success, False on error.
00395
00396     COMMENTS:  Returns 0 on errors.
00397
00398 */
00399 UINT GetCurrentUserPriority(VOID) {
00400     PSID pSID;
00401     PTOKEN_GROUPS pUserGroups;
00402
00403     UINT Pri;
00404
00405     // If well-known sids were not allocated, we can't work.
00406     if (pSystemSID == NULL || pAdminSID == NULL || pAnonSID == NULL) {
00407         return 0;
00408     }
00409
00410     // The SID gets dynamically allocated inside GetUserSID(), so
00411     // we need to remember about that.
00412     if ((pSID = GetUserSID()) == NULL) {
00413         return 0;
00414     }
00415
00416     if ((pUserGroups = GetUserGroups()) == NULL) {
00417         AutoHeapFree(pSID);
00418         return 0;
00419     }
00420
00421     // Test if current SID is system SID or it
00422     // is a member of the administrator group.
00423     if (EqualSid(pSID, pSystemSID) || IsGroupMember(pAdminSID, pUserGroups)) {
00424         // Return system priority.
00425         Pri = 2;
00426     }
00427     // Test if current SID is anonyous SID.
00428     else if (EqualSid(pSID, pAnonSID)) {
00429         // Return anonymous priority.
00430         Pri = 0;
00431     }
00432     else {
00433         // We are left with the regular user priority.
00434         Pri = 1;
00435     }
00436
00437     AutoHeapFree(pSID);
00438     AutoHeapFree(pUserGroups);
00439     return Pri;
00440 }
00441
00442 /*
00443     FUNCTION: ReportStatusToSCMgr()
00444
00445     PURPOSE: Sets the current status of the service and
00446              reports it to the Service Control Manager
00447
00448     PARAMETERS:
00449         dwCurrentState - the state of the service
00450         dwWin32ExitCode - error code to report
00451         dwWaitHint - worst case estimate to next checkpoint
00452
00453     RETURN VALUE:
00454         TRUE - success
00455         FALSE - failure
00456
00457     COMMENTS:
00458
00459 */
00460 BOOL ReportStatusToSCMgr(SERVICE_STATUS_HANDLE *sshStatusHandle,
00461                          SERVICE_STATUS *ssStatus,
00462                          DWORD dwCurrentState,
00463                          DWORD dwWin32ExitCode,
00464                          DWORD dwWaitHint){
00465
00466     static DWORD dwCheckPoint = 1;
00467     BOOL fResult = TRUE;
00468
00469     if (dwCurrentState == SERVICE_START_PENDING) {
00470         ssStatus->dwControlsAccepted = 0;
00471     }
00472     else {
00473         ssStatus->dwControlsAccepted = SERVICE_ACCEPT_STOP;
00474     }
00475
00476     ssStatus->dwCurrentState = dwCurrentState;
00477     ssStatus->dwWin32ExitCode = dwWin32ExitCode;
00478     ssStatus->dwWaitHint = dwWaitHint;
00479
00480     if ((dwCurrentState == SERVICE_RUNNING) || (dwCurrentState == SERVICE_STOPPED)) {
00481         ssStatus->dwCheckPoint = 0;
00482     }
00483     else {
00484         ssStatus->dwCheckPoint = dwCheckPoint++;
00485     }
00486
00487     // Report the status of the service to the service control manager.
00488     if (!(fResult = SetServiceStatus(*sshStatusHandle, ssStatus))) {
00489         AddToMessageLog(TEXT("ReportStatusToSCMgr: SetServiceStatus failed"));
00490     }
00491     return fResult;
00492 }
00493
00494 /*
00495     FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
00496
00497     PURPOSE: Allows any thread to log an error message.
00498       Messages are logged in a simplistic manner with some
00499       fields omitted.
00500
00501     PARAMETERS:
00502         lpszMsg - text for message
00503
00504     RETURN VALUE:
00505         none
00506
00507     COMMENTS:
00508
00509 */
00510 VOID AddToMessageLog(LPTSTR szMsg2) {
00511     TCHAR szMsg1[256];
00512     HANDLE hEventSource;
00513     LPTSTR lpszStrings[2];
00514     DWORD dwErr = 0;
00515
00516     dwErr = GetLastError();
00517
00518     // Use event logging to log the error.
00519     hEventSource = RegisterEventSource(NULL, SERVICENAME);
00520
00521     _stprintf(szMsg1, TEXT("%s error: %d"), SERVICENAME, dwErr);
00522     lpszStrings[0] = szMsg1;
00523     lpszStrings[1] = szMsg2;
00524
00525     if (hEventSource != NULL) {
00526         ReportEvent(hEventSource, // handle of event source
00527                     EVENTLOG_ERROR_TYPE, // event type
00528                     0, // event category
00529                     0, // event ID
00530                     NULL, // current user's SID
00531                     2, // strings in lpszStrings
00532                     0, // no bytes of raw data
00533                     (LPCTSTR *) lpszStrings, // array of error strings
00534                     NULL); // no raw data
00535
00536         (VOID) DeregisterEventSource(hEventSource);
00537     }
00538 }
00539
00540 VOID AddToMessageLogProcFailure(LPTSTR ProcName, DWORD ErrCode) {
00541     TCHAR Msg[MSG_SIZE];
00542     _stprintf(Msg, TEXT("%s failed with code %d"), ProcName, ErrCode);
00543     AddToMessageLog(Msg);
00544 }
00545
00546 VOID AddToMessageLogProcFailureEEInfo(LPTSTR ProcName, DWORD ErrCode) {
00547     TCHAR Msg[MSG_SIZE];
00548     UINT MsgSize = 0;
00549
00550     MsgSize += _stprintf(&Msg[MsgSize], TEXT("%s failed with code %d\n"), ProcName, ErrCode);
00551     GetEEInfoText(Msg, MSG_SIZE, &MsgSize);
00552
00553     Msg[MsgSize] = 0;
00554
00555     AddToMessageLog(Msg);
00556 }
00557
00558 VOID AddRpcEEInfo(DWORD Status, LPTSTR Msg) {
00559     RPC_STATUS rpcstatus;
00560
00561     RPC_EXTENDED_ERROR_INFO ErrorInfo;
00562
00563     ErrorInfo.Version = RPC_EEINFO_VERSION;
00564     ErrorInfo.ComputerName = NULL;
00565     ErrorInfo.ProcessID = 0;
00566     ErrorInfo.GeneratingComponent = 0;
00567     ErrorInfo.Status = Status;
00568     ErrorInfo.DetectionLocation = 0;
00569     ErrorInfo.Flags = 0;
00570     ErrorInfo.NumberOfParameters = 1;
00571     ErrorInfo.Parameters[0].ParameterType = eeptUnicodeString;
00572     ErrorInfo.Parameters[0].u.UnicodeString = Msg;
00573
00574     rpcstatus = RpcErrorAddRecord(&ErrorInfo);
00575
00576     RpcRaiseException(Status);
00577 }
00578
00579 VOID AddRpcEEInfoAndRaiseException(DWORD Status, LPTSTR Msg) {
00580     AddRpcEEInfo(Status, Msg);
00581     RpcRaiseException(Status);
00582 }
00583
00584 // Heap for use by midl_user_allocate and midl_user_free.
00585 HANDLE RpcHeap;
00586
00587 /*
00588     MIDL allocate() and free()
00589 */
00590
00591 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
00592     return(HeapAlloc(RpcHeap, 0, len));
00593 }
00594
00595 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
00596     if(ptr != NULL) {
00597         HeapFree(RpcHeap, 0, ptr);
00598     }
00599 }
00600
00601 // end Service.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/tablecopy.cpp Source File

  • Dataaccess
  • oledb
  • tablecopy

tablecopy.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module TABLECOPY.CPP
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011
00012 /////////////////////////////////////////////////////////////////
00013 // Includes
00014 //
00015 /////////////////////////////////////////////////////////////////
00016 #define DBINITCONSTANTS  //Initilaizes OLEDB Guids / Constants
00017 #define INITGUID
00018
00019 #include "winmain.h"
00020 #include "common.h"
00021 #include "tablecopy.h"
00022 #include "table.h"
00023 #include "wizard.h"
00024
00025 #include "msdaguid.h" //CLSID_OLEDB_ENUMERATOR
00026
00027
00028
00029 /////////////////////////////////////////////////////////////////
00030 // CTableCopy::CTableCopy
00031 //
00032 /////////////////////////////////////////////////////////////////
00033 CTableCopy::CTableCopy(CWizard* pCWizard)
00034 {
00035   ASSERT(pCWizard);
00036
00037   m_pCFromTable = new CTable(pCWizard);
00038   m_pCToTable   = new CTable(pCWizard);
00039
00040   //RowOptions
00041   m_dwRowOpt    = IDR_ALL_ROWS;
00042   m_ulMaxRows   = 1;
00043
00044   //InsertOptions
00045   m_dwInsertOpt = IDR_PARAM_SETS;
00046   m_ulParamSets = 10;
00047
00048   //BLOB options
00049   m_dwBlobOpt   = IDR_BLOB_SIZE;
00050   m_ulBlobSize  = 5000;   //Some reasonable value less than MAX_COL_SIZE
00051
00052   //Create Options
00053   m_fCopyTables   = TRUE;
00054   m_fCopyIndexes    = TRUE;
00055   m_fCopyPrimaryKeys  = TRUE;
00056   m_fShowQuery    = FALSE;
00057
00058   //Data
00059   m_fTranslate  = TRUE;
00060   m_pCWizard    = pCWizard;  //Back pointer to windowing class
00061 }
00062
00063
00064 /////////////////////////////////////////////////////////////////
00065 // CTableCopy::~CTableCopy
00066 //
00067 /////////////////////////////////////////////////////////////////
00068 CTableCopy::~CTableCopy()
00069 {
00070   delete m_pCFromTable;
00071   delete m_pCToTable;
00072 }
00073
00074
00075
00076
00077 /////////////////////////////////////////////////////////////////
00078 // HRESULT CTableCopy::MapTypes
00079 //
00080 /////////////////////////////////////////////////////////////////
00081 HRESULT CTableCopy::MapTypes()
00082 {
00083   HRESULT hr = S_OK;
00084
00085   //Now get the TypeInfo for all columns
00086   //IDBSchemaRowsets may not be supported, which we may be able to do without
00087   //on the source table, we are going to lose IsNullable, IsAutoInc and other options
00088   hr = m_pCFromTable->GetTypeInfo();
00089
00090   //Now map all the Types correctly from the Source to the Target
00091   QTESTC(hr = m_pCToTable->MapTableInfo(m_pCFromTable));
00092
00093 CLEANUP:
00094   if(FAILED(hr))
00095     wMessageBox(NULL, MB_TASKMODAL | MB_ICONEXCLAMATION | MB_OK, wsz_ERROR, wsz_TYPEMAPPING_FAILURE);
00096
00097   return hr;
00098 }
00099
00100
00101
00102 ///////////////////////////////////////////////////////////////////////
00103 // HRESULT CTableCopy::CopyTables
00104 //
00105 ///////////////////////////////////////////////////////////////////////
00106 HRESULT CTableCopy::CopyTables()
00107 {
00108   HRESULT hr = S_OK;
00109   ULONG cRowsCopied = 0;
00110
00111   // Create the Table (if desired)
00112   if(m_fCopyTables)
00113     QTESTC(hr = m_pCToTable->CreateTable());
00114
00115   // Create the indexes (if desired)
00116   if(m_fCopyIndexes)
00117     QTESTC(hr = m_pCToTable->CopyIndexes(m_pCFromTable));
00118
00119   //GetColInfo for TargetTable
00120   QTESTC(hr = m_pCToTable->GetColInfo(m_dwInsertOpt));
00121
00122   //Now Copy the Data
00123   QTESTC(hr = m_pCToTable->CopyData(m_pCFromTable, &cRowsCopied));
00124
00125 CLEANUP:
00126   //Display Results
00127   if(SUCCEEDED(hr))
00128     wMessageBox(NULL, MB_TASKMODAL | MB_ICONINFORMATION | MB_OK, wsz_SUCCESS, wsz_COPY_SUCCESS, cRowsCopied);
00129   else
00130     wMessageBox(NULL, MB_TASKMODAL | MB_ICONEXCLAMATION | MB_OK, wsz_ERROR, wsz_COPY_FAILURE);
00131
00132   return hr;
00133 }
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IPSAMPLE_GLOBAL_STATS Member List

This is the complete list of members for _IPSAMPLE_GLOBAL_STATS, including all inherited members.
ulNumInterfaces _IPSAMPLE_GLOBAL_STATS
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Search/vc/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Search
  • vc

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  Search.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/Xmit/Xmitc.c Source File

  • NetDS
  • RPC
  • Data
  • Xmit

Xmitc.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                        xmit Example
00005
00006     FILE:       xmitc.c
00007
00008     USAGE:      xmitc  -n network_address
00009                        -p protocol_sequence
00010                        -e endpoint
00011                        -o options
00012                        -c count of elements in linked list
00013                        -v value of first element in linked list
00014                        -d delta between values in linked list
00015
00016     PURPOSE:    Client side of RPC distributed application.
00017                 This sample demonstrates the transmit_as example.
00018                 A doubly-linked list is transmitted over the network
00019                 as a sized array.
00020
00021     RELATED:    xmits.c - server main
00022                 xmitp.c - remote procedures
00023                 xmitu.c - utility procedures
00024
00025     FUNCTIONS:  main() - bind to server and call remote procedure
00026
00027     COMMENTS:   This sample program generates a linked list to
00028                 demonstrate how a list with aliasing can be transmitted
00029                 using the transmit_as attribute as a sized array.
00030                 The pointers are rebuilt on the server side.
00031
00032                 The [transmit_as] attribute (used in the typedef of
00033                 DOUBLE_LINK_TYPE in the file XMIT.IDL) requires the
00034                 four user-supplied functions whose names start with
00035                 the name of the presented type, DOUBLE_LINK_TYPE.
00036
00037                 The [in, out] attributes applied to remote procedure
00038                 parameters require the two user-supplied functions
00039                 midl_user_allocate and midl_user_free.
00040
00041                 The other functions are utilities that are used to
00042                 build or display the data structures.
00043
00044
00045 ****************************************************************************/
00046
00047 #include <stdlib.h>
00048 #include <stdio.h>
00049 #include <ctype.h>
00050 #include "xmit.h"     // header file generated by MIDL compiler
00051 #include "xmitu.h"    // utility function prototypes
00052
00053 #define PURPOSE \
00054 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00055 the use of the [transmit_as] attribute. For more information\n\
00056 about the attributes and the RPC API functions, see the\n\
00057 RPC programming guide and reference.\n\n"
00058
00059 #define MAX_ELEMENTS 50
00060
00061 void Usage(char * pszProgramName)
00062 {
00063     fprintf(stderr, "%s", PURPOSE);
00064     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00065     fprintf(stderr, " -p protocol_sequence\n");
00066     fprintf(stderr, " -n network_address\n");
00067     fprintf(stderr, " -e endpoint\n");
00068     fprintf(stderr, " -o options\n");
00069     fprintf(stderr, " -c count_of_elements\n");
00070     fprintf(stderr, " -v value\n");
00071     fprintf(stderr, " -d delta\n");
00072     exit(1);
00073 }
00074
00075 void __cdecl main(int argc, char **argv)
00076 {
00077     RPC_STATUS status;
00078     unsigned char * pszUuid             = NULL;
00079     unsigned char * pszProtocolSequence = "ncacn_np";
00080     unsigned char * pszNetworkAddress   = NULL;
00081     unsigned char * pszEndpoint         = "\\pipe\\xmit";
00082     unsigned char * pszOptions          = NULL;
00083     unsigned char * pszStringBinding    = NULL;
00084     int i;
00085     int cElements = 10;
00086     short sValue = 100;
00087     short sDelta = 10;
00088
00089     DOUBLE_LINK_TYPE *pFirst, *pCurrent;
00090
00091     /* allow the user to override settings with command line switches */
00092     for (i = 1; i < argc; i++) {
00093         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00094             switch (tolower(*(argv[i]+1))) {
00095             case 'p':  // protocol sequence
00096                 pszProtocolSequence = argv[++i];
00097                 break;
00098             case 'n':  // network address
00099                 pszNetworkAddress = argv[++i];
00100                 break;
00101             case 'e':
00102                 pszEndpoint = argv[++i];
00103                 break;
00104             case 'o':
00105                 pszOptions = argv[++i];
00106                 break;
00107             case 'c':
00108                 cElements = atoi(argv[++i]);
00109                 if (cElements > MAX_ELEMENTS)
00110                     cElements = MAX_ELEMENTS;
00111                 break;
00112             case 'v':
00113                 sValue = (short)atoi(argv[++i]);
00114                 break;
00115             case 'd':
00116                 sDelta = (short)atoi(argv[++i]);
00117                 break;
00118             case 'h':
00119             case '?':
00120             default:
00121                 Usage(argv[0]);
00122             }
00123         }
00124         else
00125             Usage(argv[0]);
00126     }
00127
00128     /* initialize a list with a number of elements */
00129     pFirst = InsertNewNode(sValue, NULL);
00130     pCurrent = pFirst;   // assign some values to the list nodes
00131     sValue += sDelta;    // make them different values
00132
00133     for (i = 1; i < cElements; i++) {
00134         pCurrent = InsertNewNode(sValue, pCurrent);
00135         sValue += sDelta;
00136     }
00137     ListWalkProc(pFirst);
00138
00139     /* Use a convenience function to concatenate the elements of the string */
00140     /* binding into the syntax needed by RpcBindingFromStringBinding.       */
00141     status = RpcStringBindingCompose(pszUuid,
00142                                      pszProtocolSequence,
00143                                      pszNetworkAddress,
00144                                      pszEndpoint,
00145                                      pszOptions,
00146                                      &pszStringBinding);
00147     printf("RpcStringBindingCompose returned 0x%x\n", status);
00148     printf("pszStringBinding = %s\n", pszStringBinding);
00149     if (status) {
00150         exit(status);
00151     }
00152
00153     /* Set the binding handle that will be used to bind to the server. */
00154     status = RpcBindingFromStringBinding(pszStringBinding,
00155                                          &hXmit);
00156     printf("RpcBindingFromStringBinding returned 0x%x\n", status);
00157     if (status) {
00158         exit(status);
00159     }
00160
00161     RpcTryExcept {
00162         printf("Calling the remote procedure 'ModifyListProc'\n");
00163         ModifyListProc(pFirst);  // call the remote procedure
00164
00165         printf("Calling the remote procedure 'Shutdown'\n");
00166         Shutdown();  // shut down the server side
00167     }
00168     RpcExcept(1) {
00169         printf("Runtime reported exception %ld\n", RpcExceptionCode() );
00170     }
00171     RpcEndExcept
00172
00173     printf("After ModifyListProc, the list appears as follows:\n");
00174     ListWalkProc(pFirst);  // call the utility that displays the list
00175
00176     /* The calls to the remote procedures are complete.            */
00177     /* Free the string and the binding handle using RPC API calls. */
00178     status = RpcStringFree(&pszStringBinding);
00179     printf("RpcStringFree returned 0x%x\n", status);
00180     if (status) {
00181         exit(status);
00182     }
00183
00184     status = RpcBindingFree(&hXmit);
00185     printf("RpcBindingFree returned 0x%x\n", status);
00186     if (status) {
00187         exit(status);
00188     }
00189
00190     exit(0);
00191
00192 }  // end main()
00193
00194 /* end file xmitc.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/filerepclient.idl Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

filerepclient.idl

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005
00006     FILE: FileRepClient.idl
00007
00008     PURPOSE:  Defines the interface for the client system service.
00009
00010 */
00011
00012 [
00013     uuid(fe7f2eda-5da1-4041-928c-d2534d3fa129),
00014     pointer_default(ref),
00015     version(1.0)
00016 ]
00017
00018 interface FileRepClient {
00019
00020 // Declare the string data type. This should work for UNICODE.
00021 #ifdef _UNICODE
00022     typedef wchar_t * STR;
00023 #else
00024     typedef unsigned char * STR;
00025 #endif
00026
00027     /*
00028         A replication request is made by making this RPC.  With ServerName
00029   specifying the source machine for replication, RemoteFileName
00030   specifying the source file for replication, and LocalFileName
00031   the name for the file on the local machine.  A thread is forked
00032   to handle the actual file replication and an error encountered by
00033   the thread will not produce the error return status.
00034     */
00035     void RequestFile([in] handle_t hFileRepClient,
00036          [in, ref, string] STR ServerName,
00037          [in, ref, string] STR RemoteFileName,
00038          [in, ref, string] STR LocalFileName);
00039 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_VIRTUAL_BUFFER Member List

This is the complete list of members for _VIRTUAL_BUFFER, including all inherited members.
Base | _VIRTUAL_BUFFER
CommitLimit | _VIRTUAL_BUFFER
PageSize | _VIRTUAL_BUFFER
ReserveLimit | _VIRTUAL_BUFFER
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTransaction Member List

This is the complete list of members for CTransaction, including all inherited members.
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CTransaction | [virtual]
AutoRelease() | CTransaction | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CTransaction(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CTransaction |
DisplayObject() | CBase | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CTransaction | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CTransaction | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CTransaction | [inline, virtual]
GetObjectMenu() | CTransaction | [inline, virtual]
GetObjectName() | CTransaction | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_dwCookieTransNotify | CTransaction |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIConnectionPointContainer | CContainerBase |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pITransaction | CTransaction |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
~CBase() | CBase | [virtual]
~CContainerBase() | CContainerBase | [virtual]
~CTransaction() | CTransaction | [virtual]
Generated on Wed Nov 13 2024 16:57:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/rowset.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

rowset.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module ROWSET.CPP | CRowset object implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012
00013 #include "headers.h"
00014
00015 static const MAX_BITS = 1008;
00016
00017 static const TYPE_CHAR = 1;
00018 static const TYPE_SLONG = 3;
00019
00020 // Code ----------------------------------------------------------------------
00021
00022 // CRowset::CRowset ----------------------------------------------------------
00023 //
00024 // @mfunc Constructor for this class
00025 //
00026 // @rdesc NONE
00027 //
00028 CRowset::CRowset
00029     (
00030     LPUNKNOWN pUnkOuter         //@parm IN | Outer Unkown Pointer
00031     ) // invoke ctor for base class
00032   : CBaseObj( BOT_ROWSET )
00033 {
00034
00035     //  Initialize simple member vars
00036     m_cRef          = 0L;
00037   m_pUnkOuter   = pUnkOuter ? pUnkOuter : this;
00038
00039     // Intialize buffered row count + pointers to allocated memory
00040     m_pFileio           = NULL;
00041     m_cRows             = 0;
00042     m_irowFilePos       = 0;
00043     m_irowLastFilePos   = 0;
00044     m_cbTotalRowSize    = 0;
00045     m_cbRowSize         = 0;
00046     m_irowMin           = 0;
00047     m_ulRowRefCount     = 0;
00048     m_pextbufferAccessor= NULL;
00049     m_pIBuffer          = NULL;
00050     m_prowbitsIBuffer   = NULL;
00051     m_pLastBindBase     = NULL;
00052     m_rgbRowData        = NULL;
00053     m_dwStatus          = 0;
00054     m_pUtilProp         = NULL;
00055   m_pCreator      = NULL;
00056
00057   m_wszFilePath[0]    = L'\0';
00058   m_wszDataSourcePath[0]  = L'\0';
00059
00060     //  Initially, NULL all contained interfaces
00061     m_pIAccessor                    = NULL;
00062     m_pIColumnsInfo                 = NULL;
00063   m_pIConvertType         = NULL;
00064     m_pIRowset                      = NULL;
00065     m_pIRowsetChange                = NULL;
00066     m_pIRowsetIdentity              = NULL;
00067     m_pIRowsetInfo                  = NULL;
00068   m_pIGetRow            = NULL;
00069
00070     // Increment global object count.
00071     OBJECT_CONSTRUCTED();
00072
00073     return;
00074 }
00075
00076
00077 // CRowset::~CRowset ---------------------------------------------------------
00078 //
00079 // @mfunc Destructor for this class
00080 //
00081 // @rdesc NONE
00082 //
00083 CRowset:: ~CRowset
00084     (
00085     void
00086     )
00087 {
00088     // Free pointers.
00089     // (Note delete is safe for NULL ptr.)
00090     SAFE_DELETE( m_prowbitsIBuffer );
00091     SAFE_DELETE( m_pUtilProp );
00092
00093     if (m_pIBuffer)
00094         ReleaseSlotList( m_pIBuffer );
00095
00096     // Free accessors.
00097     // Each accessor is allocated via new/delete.
00098     // We store an array of ptrs to each accessor (m_pextbufferAccessor).
00099     if (m_pextbufferAccessor)
00100   {
00101         HACCESSOR   hAccessor, hAccessorLast;
00102         PACCESSOR   pAccessor;
00103
00104         m_pextbufferAccessor->GetFirstLastItemH(hAccessor, hAccessorLast);
00105
00106     for (; hAccessor <= hAccessorLast; hAccessor++)
00107     {
00108             m_pextbufferAccessor->GetItemOfExtBuffer(hAccessor, &pAccessor);
00109             SAFE_DELETE( pAccessor );
00110     }
00111
00112     SAFE_DELETE( m_pextbufferAccessor );
00113   }
00114
00115     //  Free contained interfaces
00116     SAFE_DELETE( m_pIAccessor );
00117     SAFE_DELETE( m_pIColumnsInfo );
00118     SAFE_DELETE( m_pIConvertType );
00119     SAFE_DELETE( m_pIRowset );
00120     SAFE_DELETE( m_pIRowsetChange );
00121     SAFE_DELETE( m_pIRowsetIdentity );
00122     SAFE_DELETE( m_pIRowsetInfo );
00123   SAFE_DELETE( m_pIGetRow );
00124
00125     // free CFileio object
00126     if (m_pFileio)
00127         SAFE_DELETE( m_pFileio );
00128
00129   if( m_pCreator )
00130     m_pCreator->GetOuterUnknown()->Release();
00131
00132   if( m_pParentObj )
00133     m_pParentObj->GetOuterUnknown()->Release();
00134
00135     // Decrement global object count.
00136     OBJECT_DESTRUCTED();
00137
00138     return;
00139 }
00140
00141 // CRowset::FInit ------------------------------------------------------------
00142 //
00143 // @mfunc Initialize the rowset Object
00144 //
00145 // @rdesc Did the Initialization Succeed
00146 //      @flag  TRUE | Initialization succeeded
00147 //      @flag  FALSE | Initialization failed
00148 //
00149 BOOL CRowset::FInit
00150     (
00151     CFileIO *   pCFileio,   //@parm IN | pointer to Fileio object
00152   CBaseObj *  pParentBaseObj, //@parm IN | pointer to Base Object creating the rowset
00153   WCHAR *   pwszFilePath, //@parm IN | The File Path of the csv file
00154   WCHAR *   pwszDataSource  //@parm IN | The datasource path
00155     )
00156 {
00157   // Asserts
00158   assert(pCFileio);
00159   assert(pParentBaseObj);
00160     assert(m_pUnkOuter);
00161     assert(pParentBaseObj);
00162
00163     LPUNKNOWN pIUnknown = m_pUnkOuter;
00164     m_pFileio = pCFileio;
00165
00166   m_pParentObj = pParentBaseObj;
00167   m_pParentObj->GetOuterUnknown()->AddRef();
00168
00169     //--------------------
00170     // Get FileInfo
00171     //--------------------
00172     // Find # of columns in the result set.
00173     m_cCols = m_pFileio->GetColumnCnt();
00174     if( m_cCols <= 0 )
00175         return FALSE;
00176
00177   m_cbRowSize = m_pFileio->GetRowSize();
00178
00179     if (FAILED( CreateHelperFunctions()))
00180         return FALSE;
00181
00182     m_cbTotalRowSize = m_pIBuffer->cbSlot;
00183
00184     //--------------------
00185     // Perform binding
00186     //--------------------
00187     // Bind result set columns to the first row of the internal buffer.
00188     // For each column bind it's data as well as length. Leave space for
00189     // derived status info.
00190     // Note that we could defer binding, but this way we can check for
00191     // bad errors before we begin.
00192     // We may need to bind again if going back and forth
00193     // with GetNextRows.
00194     assert(m_rgbRowData);
00195     if (FAILED( Rebind((BYTE *) GetRowBuff( m_irowMin, TRUE ))))
00196         return FALSE;
00197
00198     // allocate utility object that manages our properties
00199     m_pUtilProp = new CUtilProp();
00200   if (!m_pUtilProp)
00201     return FALSE;
00202
00203     // Allocate contained interface objects
00204     // Note that our approach is simple - we always create *all* of the Rowset interfaces
00205     // If our properties were read\write (i.e., could be set), we would need to
00206     // consult properties to known which interfaces to create.
00207     // Also, none of our interfaces conflict. If any did conflict, then we could
00208     // not just blindly create them all.
00209     m_pIColumnsInfo             = new CImpIColumnsInfo( this, pIUnknown );
00210   m_pIConvertType       = new CImpIConvertType(this, pIUnknown);
00211     m_pIRowset                  = new CImpIRowset( this, pIUnknown );
00212     m_pIRowsetIdentity          = new CImpIRowsetIdentity( this, pIUnknown );
00213     m_pIRowsetInfo              = new CImpIRowsetInfo( this, pIUnknown );
00214   m_pIAccessor                = new CImpIAccessor( this, pIUnknown );
00215   m_pIGetRow          = new CImpIGetRow( this, pIUnknown );
00216
00217   if (!m_pFileio->IsReadOnly())
00218     m_pIRowsetChange    = new CImpIRowsetChange( this, pIUnknown );
00219
00220   if (m_pIAccessor && FAILED(m_pIAccessor->FInit(TRUE)))
00221     return FALSE;
00222
00223   wcsncpy(m_wszFilePath, pwszFilePath, MAX_PATH);
00224   wcsncpy(m_wszDataSourcePath, pwszDataSource, MAX_PATH);
00225
00226     // if all interfaces were created, return success
00227     return (BOOL) (m_pIAccessor && m_pIColumnsInfo && m_pIConvertType &&
00228                    m_pIRowset && m_pIRowsetIdentity && m_pIRowsetInfo &&
00229            ((m_pFileio->IsReadOnly() && !m_pIRowsetChange) ||
00230             (!m_pFileio->IsReadOnly() && m_pIRowsetChange)) &&
00231           m_pIGetRow);
00232 }
00233
00234
00235 // CRowset::QueryInterface ---------------------------------------------------
00236 //
00237 // @mfunc Returns a pointer to a specified interface. Callers use
00238 // QueryInterface to determine which interfaces the called object
00239 // supports.
00240 //
00241 // @rdesc HRESULT indicating the status of the method
00242 //      @flag S_OK | Interface is supported and ppvObject is set.
00243 //      @flag E_NOINTERFACE | Interface is not supported by the object
00244 //      @flag E_INVALIDARG | One or more arguments are invalid.
00245 //
00246 STDMETHODIMP CRowset::QueryInterface
00247     (
00248     REFIID riid,
00249     LPVOID * ppv
00250     )
00251 {
00252     if (NULL == ppv)
00253         return ResultFromScode( E_INVALIDARG );
00254
00255     //  Place NULL in *ppv in case of failure
00256     *ppv = NULL;
00257
00258     //  This is the non-delegating IUnknown implementation
00259     if (riid == IID_IUnknown)
00260         *ppv = (LPVOID) this;
00261     else if (riid == IID_IAccessor)
00262         *ppv = (LPVOID) m_pIAccessor;
00263     else if (riid == IID_IColumnsInfo)
00264         *ppv = (LPVOID) m_pIColumnsInfo;
00265     else if (riid == IID_IConvertType)
00266         *ppv = (LPVOID) m_pIConvertType;
00267     else if (riid == IID_IRowset)
00268         *ppv = (LPVOID) m_pIRowset;
00269     else if (riid == IID_IRowsetChange && SupportIRowsetChange() )
00270         *ppv = (LPVOID) m_pIRowsetChange;
00271     else if (riid == IID_IRowsetIdentity)
00272         *ppv = (LPVOID) m_pIRowsetIdentity;
00273     else if (riid == IID_IRowsetInfo)
00274         *ppv = (LPVOID) m_pIRowsetInfo;
00275   else if (riid == IID_IGetRow)
00276     *ppv = (LPVOID) m_pIGetRow;
00277
00278     //  If we're going to return an interface, AddRef it first
00279     if (*ppv)
00280         {
00281         ((LPUNKNOWN) *ppv)->AddRef();
00282         return ResultFromScode( S_OK );
00283         }
00284     else
00285         return ResultFromScode( E_NOINTERFACE );
00286 }
00287
00288
00289 // CRowset::AddRef -----------------------------------------------------------
00290 //
00291 // @mfunc Increments a persistence count for the object
00292 //
00293 // @rdesc Current reference count
00294 //
00295 STDMETHODIMP_( DBREFCOUNT ) CRowset::AddRef
00296      (
00297      void
00298      )
00299 {
00300     return ++m_cRef;
00301 }
00302
00303
00304 // CRowset::Release ----------------------------------------------------------
00305 //
00306 // @mfunc Decrements a persistence count for the object and if
00307 // persistence count is 0, the object destroys itself.
00308 //
00309 // @rdesc Current reference count
00310 //
00311 STDMETHODIMP_( DBREFCOUNT ) CRowset::Release
00312      (
00313      void
00314      )
00315 {
00316     if (!--m_cRef)
00317         {
00318         this->m_pCreator->DecrementOpenRowsets();
00319         delete this;
00320         return 0;
00321         }
00322
00323     return m_cRef;
00324 }
00325
00326 // CRowset::CreateHelperFunctions --------------------------------------------
00327 //
00328 // @mfunc Creates Helper classes that are needed to manage the Rowset Object
00329 //
00330 // @rdesc HRESULT
00331 //      @flag S_OK | Helper classes created
00332 //      @flag E_FAIL | Helper classes were not created
00333 //
00334 HRESULT CRowset::CreateHelperFunctions
00335     (
00336     void
00337     )
00338 {
00339     //----------------------
00340     // Create helper objects
00341     //----------------------
00342
00343     // Bit array to track presence/absense of rows.
00344     m_prowbitsIBuffer = new CBitArray;
00345     if( !m_prowbitsIBuffer || FAILED(m_prowbitsIBuffer->FInit(MAX_BITS, g_dwPageSize)))
00346         return ResultFromScode( E_FAIL );
00347
00348     // List of free slots.
00349     // This manages the allocation of sets of contiguous rows.
00350     if (FAILED( InitializeSlotList( MAX_TOTAL_ROWBUFF_SIZE / (ULONG)m_cbRowSize,
00351                          (ULONG) m_cbRowSize, g_dwPageSize, m_prowbitsIBuffer,
00352                          &m_pIBuffer, &m_rgbRowData )))
00353         return ResultFromScode( E_FAIL );
00354
00355     // Locate some free slots.
00356     // Should be at very beginning.
00357     // This tells us which row we will bind to: m_irowMin.
00358     if (FAILED( GetNextSlots( m_pIBuffer, 1, &m_irowMin )))
00359         return ResultFromScode( E_FAIL );
00360
00361     ReleaseSlots( m_pIBuffer, m_irowMin, 1 );
00362
00363     return ResultFromScode( S_OK );
00364 }
00365
00366
00367 // CRowset::Rebind --------------------------------------------
00368 //
00369 // @mfunc Establishes data offsets and type for the file
00370 // routines to place the data
00371 //
00372 // @rdesc HRESULT
00373 //      @flag S_OK | Bindings set fine
00374 //      @flag E_FAIL | Bindings could not be set
00375 //
00376 HRESULT CRowset::Rebind
00377     (
00378     BYTE *pBase                 //@parm IN | Base pointer for Data Area
00379     )
00380 {
00381     COLUMNDATA  *pColumn;
00382
00383     // Bind result set columns.
00384     // Use established types and sizes and offsets.
00385     // Bind to internal row buffer, area beginning with 'pRowBuff'.
00386     //
00387     // For each column, bind it's data as well as length.
00388     // Offsets point to start of COLUMNDATA structure.
00389
00390     assert( pBase );
00391
00392     // Optimize by not doing it over again.
00393     if( pBase != m_pLastBindBase )
00394   {
00395         m_pLastBindBase = 0;
00396
00397         for (DBORDINAL cCols=1; cCols <= m_cCols; cCols++)
00398     {
00399       pColumn = m_pFileio->GetColumnData(cCols, (ROWBUFF *)pBase);
00400
00401       if( FAILED( m_pFileio->SetColumnBind(cCols, pColumn)) )
00402                 return( E_FAIL );
00403     }
00404
00405         // Remember in case we bind to same place again.
00406         m_pLastBindBase = pBase;
00407   }
00408
00409     return( S_OK );
00410 }
00411
00412
00413 // CRowset::GetRowBuff--------------------------------------------
00414 //
00415 // @mfunc Shorthand way to get the address of a row buffer.
00416 // Later we may extend this so that it can span several
00417 // non-contiguous blocks of memory.
00418 //
00419 // @rdesc Pointer to the buffer.
00420 //
00421 ROWBUFF* CRowset::GetRowBuff
00422     (
00423     DBCOUNTITEM iRow,           //@parm IN | Row to get address of.
00424     BOOL  fDataLocation         //@parm IN | Get the Data offset.
00425     )
00426 {
00427     // This assumes iRow is valid...
00428     // How can we calculate maximum row?
00429     // Should we return NULL if it's out of range?
00430     assert( m_rgbRowData );
00431     assert( m_cbRowSize );
00432     assert( iRow > 0 );
00433
00434   // Get the LSTSlot address or the Data offset (We need to make sure this structure is properly aligned)
00435   if ( fDataLocation )
00436     return (ROWBUFF *) ROUND_UP ((m_rgbRowData + m_cbTotalRowSize*iRow), COLUMN_ALIGNVAL);
00437   else
00438     return (ROWBUFF *) ROUND_UP ((m_rgbRowData + m_cbRowSize + (m_cbTotalRowSize*(iRow-1))), COLUMN_ALIGNVAL);
00439 }
00440
00441
00442
00443
00444 //////////////////////////////////////////////////////////////////////////////
00445 //      Helper functions    Helper functions    Helper functions
00446 //////////////////////////////////////////////////////////////////////////////
00447
00448 // GetInternalTypeFromCSVType ------------------------------------------------
00449 //
00450 // @func This function returns the default OLE DB representation
00451 // for a data type
00452 //
00453 HRESULT GetInternalTypeFromCSVType
00454     (
00455     SWORD  swDataType,  //@parm IN | Data Type
00456     BOOL   fIsSigned,   //@parm IN | Signed or Unsigned
00457     DWORD  *pdwdbType   //@parm OUT | OLE DB type for DBColumnInfo
00458     )
00459 {
00460     static struct {
00461         SWORD   swCSVType;
00462         BOOL    fIsSigned;          // 1=signed, 0=unsigned
00463         BOOL    fSignedDistinction; // 1=signed matters
00464         DWORD   dwdbType;
00465     } TypeTable[] =
00466         {
00467             {TYPE_CHAR,         0, 0, DBTYPE_STR },
00468             {TYPE_SLONG,        1, 1, DBTYPE_I4  },
00469         };
00470
00471     for (int j=0; j < NUMELEM( TypeTable ); j++)
00472         {
00473         if (swDataType == TypeTable[j].swCSVType        // type match
00474         && (!TypeTable[j].fSignedDistinction            // care about sign?
00475             || fIsSigned == TypeTable[j].fIsSigned))    // sign match
00476             {
00477             assert( pdwdbType );
00478             *pdwdbType     = TypeTable[j].dwdbType;
00479             return ResultFromScode( S_OK );
00480             }
00481         }
00482
00483     // Should never get here, since we supposedly have
00484     // a table of all possible CSV types.
00485     assert( !"Unmatched CSV Type." );
00486     return ResultFromScode( E_FAIL );
00487 }
00488
00489 // SupportIRowsetChange ------------------------------------------------
00490 //
00491 // @func This function returns if IrowsetChange is supported
00492 //
00493 BOOL CRowset::SupportIRowsetChange()
00494 {
00495   BOOL    fIRowsetChange = FALSE;
00496   ULONG   cPropSets      = 0;
00497   DBPROPSET * rgPropSets     = NULL;
00498   DBPROPID  rgPropId[1];
00499   DBPROPIDSET rgPropertySets[1];
00500
00501     // Get the value of the DBPROP_CANHOLDROWS property
00502   rgPropertySets[0].guidPropertySet = DBPROPSET_ROWSET;
00503   rgPropertySets[0].rgPropertyIDs   = rgPropId;
00504   rgPropertySets[0].cPropertyIDs    = 1;
00505   rgPropId[0]                       = DBPROP_IRowsetChange;
00506
00507   // Get the IRowsetChange Property from m_pUtilProp
00508   GetCUtilProp()->GetProperties(PROPSET_ROWSET, 1, rgPropertySets,
00509                       &cPropSets, &rgPropSets);
00510
00511   // Get the Prompt value
00512   if( V_BOOL(&rgPropSets->rgProperties->vValue) == VARIANT_TRUE )
00513     fIRowsetChange = TRUE;
00514
00515   // release properties
00516   FreeProperties(&cPropSets, &rgPropSets);
00517
00518   return fIRowsetChange;
00519 }
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/localres.h Source File

  • SysMgmt
  • MMC
  • Help

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/Global.h Source File

  • Web
  • NetMeeting
  • NMChat

Global.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       GLOBAL.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef GLOBAL_H
00016 #define GLOBAL_H
00017
00018 // #define NM2_CHAT_PROTOCOL  // Define this to use the NM 2.0 chat protocol
00019 #ifdef NM2_CHAT_PROTOCOL
00020 #define CB_NM2_HDR   8     // NetMeeting 2.0 chat protocol has an 8 byte header
00021 #endif
00022
00023
00024 //-------------------------------------------------------
00025 // Useful constants
00026
00027 #define chNull   ('\0')
00028 #define lpNil    (NULL)
00029
00030 #define hwndNil      ((HWND) NULL)
00031 #define hfontNil     ((HFONT) NULL)
00032 #define hgdiNil      ((HGDIOBJ) NULL)
00033
00034
00035 //-------------------------------------------------------
00036 // Useful macros
00037
00038 #define ClearStruct(lpv)    ZeroMemory((LPVOID) (lpv), sizeof(*(lpv)))
00039 #define InitStruct(lpv)        {ClearStruct(lpv); (* (LPDWORD) lpv) = sizeof(*(lpv));}
00040
00041 #define SetEmptySz(sz)      ( *(sz) = _T('\0') )
00042 #define FEmptySz(sz)            (((sz) == NULL) || (*(sz) == _T('\0')))
00043
00044 #define ARRAY_ELEMENTS(rg)      (sizeof(rg) / sizeof(rg[0]))
00045 #define CCHMAX(sz)              (sizeof(sz) / sizeof(TCHAR))
00046
00047
00048 #ifdef DEBUG
00049 VOID FAR PASCAL AssertProc(LPTSTR lpszMsg, LPTSTR lpszAssert, LPTSTR lpszFile, UINT line);
00050
00051 #define DEBASSERT(exp,szMsg)  \
00052   if (!(exp))                                                      \
00053   {                                                                \
00054     static char _szAssert[] = #exp ;   \
00055     static char _szMsg[]    = szMsg;   \
00056     AssertProc(_szMsg,_szAssert,__FILE__,__LINE__); \
00057   }
00058
00059 #define ASSERT(f)       DEBASSERT(f, "(" #f ")")
00060 #define AssertSz(f,sz)  DEBASSERT(f, sz)
00061 #define NotReached()    DEBASSERT(FALSE, "NotReached declaration was reached!")
00062 #else
00063 #define ASSERT(f)
00064 #define AssertSz(f, sz)
00065 #define NotReached()
00066 #endif
00067
00068
00069 //****************************************************************************
00070 //
00071 // Functions for handling main window messages.  The message-dispatching
00072 // mechanism expects all message-handling functions to have the following
00073 // prototype:
00074 //
00075 // Function pointer prototype for message handling functions:
00076 // LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
00077 //
00078 //****************************************************************************
00079
00080
00081
00082 typedef LRESULT (*PFNMSG)(HWND, UINT, WPARAM, LPARAM);
00083
00084 // This structure maps messages to message handling functions.
00085 typedef struct _MSD
00086 {
00087   UINT   uMsg;
00088   PFNMSG pfnmsg;
00089 } MSD;                 // MeSsage Dispatch structure
00090 typedef MSD * LPMSD;
00091
00092
00093 //****************************************************************************
00094 //
00095 // Functions for handling main window commands--ie. functions for
00096 // processing WM_COMMAND messages based on the wParam value.
00097 // The message-dispatching mechanism expects all command-handling
00098 // functions to have the following prototype:
00099 //
00100 //****************************************************************************
00101
00102 typedef VOID (*PFNCMD)(VOID);
00103
00104 // This structure maps command IDs to command handling functions.
00105 typedef struct _CMD
00106 {
00107   UINT     wCmd;
00108   PFNCMD pfncmd;
00109 } CMD;                 // CoMmand Dispatch structure
00110 typedef CMD * LPCMD;
00111
00112
00113 //****************************************************************************
00114 //
00115 // Special resource constants
00116 //
00117 //****************************************************************************
00118
00119 #define IDW_MSG   100
00120 #define IDW_USER  101
00121 #define IDW_EDIT  102
00122
00123 // See _rgColMember
00124 #define ILV_NAME    0
00125 #define ILV_TIME    1
00126 #define ILV_TEXT    2
00127
00128 const int DYP_EDIT   = 30;  // Fixed Height of Edit control
00129 const int DXP_USER   = 80;  // Fixed Width of User List
00130 const int YP_TOP     = 3;
00131 const int XP_LEFT    = 0;
00132
00133
00134 //****************************************************************************
00135 //
00136 // Global Function Prototypes.
00137 //
00138 //****************************************************************************
00139
00140 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00141
00142
00143 // from util.cpp
00144 LPVOID LpvAlloc(int cb);
00145 LPTSTR PszAlloc(int cch);
00146 VOID FreePlpv(LPVOID plpv);
00147 VOID MaybeDeleteObject(HGDIOBJ * phgdi);
00148 VOID SizeMsgWindow(int dx, int dy);
00149 VOID RecalcMsgWindow(void);
00150
00151 VOID SendText(void);
00152 VOID ClearText(void);
00153 VOID DisplayMsg(LPTSTR pszMsg, INmMember * pMember);
00154 VOID DisplaySysMsg(LPTSTR pszMsg, INmMember * pMember);
00155 VOID DisplayMessage(LPTSTR pszMsg, LPTSTR pszUser);
00156
00157
00158 //****************************************************************************
00159 //
00160 // Global Variables
00161 //
00162 //****************************************************************************
00163
00164 extern HINSTANCE ghInst;          // The current instance handle
00165 extern HACCEL    ghAccelTable;    // Menu accelerators
00166 extern HWND      ghwndMain;       // Main Window
00167 extern HMENU     ghMenu;          // Main Menu
00168 extern HWND      ghwndMsg;        // Message Window
00169 extern HWND      ghwndUser;       // User List
00170 extern HWND      ghwndEdit;       // Edit control
00171 extern HFONT     ghfontEntry;     // Font for message Window
00172
00173 extern const GUID g_guidApp;      // Our NmChat Guid
00174 extern const GUID g_guidNM2Chat;  // NM 2.0 Chat guid
00175
00176 #endif /* GLOBAL_H */
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

cascadeec::CascadeEC Member List

This is the complete list of members for cascadeec::CascadeEC, including all inherited members.
iid | cascadeec::INewsEventDefault | [static]
LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate) | cascadeec::CascadeEC | [inline]
NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL) | cascadeec::CascadeEC | [inline]
ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow) | cascadeec::CascadeEC | [inline]
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CModel Member List

This is the complete list of members for CModel, including all inherited members.
_fPageMode | CModel | [protected]
_fr | CModel | [protected]
_hInst | CModel | [protected]
_iPage | CModel | [protected]
_macPage | CModel | [protected]
_pf | CModel | [protected]
_pPage | CModel | [protected]
CanNextPage() | CModel | [inline]
CanNextSection() | CModel | [inline]
CanPrevPage() | CModel | [inline]
CanPrevSection() | CModel | [inline]
ChooseFont(HWND hwnd) | CModel |
CModel(HINSTANCE hInst, HWND hwnd, UINT fuFormat=HEXADECIMAL, UINT fUsedPageOnly=USEDONLY) | CModel |
CreateFont(LOGFONT &lf) | CModel |
GetFont() | CModel |
GetFormat(UINT &fuFormat) | CModel |
GetLineSize(SIZE *psize) | CModel | [inline]
GetMaxPage() | CModel | [inline]
GetMaxSection() | CModel | [inline]
GetPage() | CModel | [inline]
GetPageMode(UINT &fPageMode) | CModel |
Hittest(POINT pt) | CModel |
IsModelPageUsed(UINT nPage) | CModel | [inline]
NextPage() | CModel |
NextSection() | CModel |
Paint(CCanvas &canvas, RECT rc) | CModel | [inline]
PrevPage() | CModel |
PrevSection() | CModel |
SetCSet(CSet *pCset) | CModel |
SetFormat(UINT fuFormat=HEXADECIMAL) | CModel |
SetPage(UINT nPage) | CModel |
SetPageMode(UINT fPageMode=USEDONLY) | CModel |
~CModel() | CModel |
Generated on Wed Nov 13 2024 16:56:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEnumStorageResource Member List

This is the complete list of members for CEnumStorageResource, including all inherited members.
CClusterUtils(void) | CClusterUtils | [inline, protected]
CEnumStorageResource(void) | CEnumStorageResource |
CEnumStorageResource(const CEnumStorageResource &nodeSrc) | CEnumStorageResource | [private]
Clone(IEnumClusCfgManagedResources **ppEnumClusCfgStorageDevicesOut) | CEnumStorageResource |
CMgdClusCfgInit(void) | CMgdClusCfgInit |
CMgdClusCfgInit(void) | CMgdClusCfgInit |
Count(DWORD *pnCountOut) | CEnumStorageResource |
GetCallback(void) | CMgdClusCfgInit | [inline]
GetCallback(void) | CMgdClusCfgInit | [inline]
GetDisplayName(void) | CMgdClusCfgInit | [inline]
GetDisplayName(void) | CMgdClusCfgInit | [inline]
GetDllName(void) | CMgdClusCfgInit | [inline]
GetDllName(void) | CMgdClusCfgInit | [inline]
GetLCID(void) | CMgdClusCfgInit | [inline]
GetLCID(void) | CMgdClusCfgInit | [inline]
GetNodeName(void) | CMgdClusCfgInit | [inline]
GetNodeName(void) | CMgdClusCfgInit | [inline]
GetResTypeName(void) | CMgdClusCfgInit | [inline]
GetResTypeName(void) | CMgdClusCfgInit | [inline]
HrAddObjectToArray(IUnknown *punkIn) | CEnumStorageResource | [private]
HrConvertDeviceVolumeToLogicalDisk(BSTR bstrDeviceVolumeIn, BSTR *pbstrLogicalDiskOut) | CEnumStorageResource | [private]
HrConvertDeviceVolumeToWMIDeviceID(BSTR bstrDeviceVolumeIn, BSTR *pbstrWMIDeviceIDOut) | CEnumStorageResource | [private]
HrEnumNodeResources(BSTR bstrNodeNameIn) | CClusterUtils |
HrFindDiskWithLogicalDisk(WCHAR cLogicalDiskIn, ULONG *pidxDiskOut) | CEnumStorageResource | [private]
HrFindDiskWithWMIDeviceID(BSTR bstrWMIDeviceIDIn, ULONG *pidxDiskOut) | CEnumStorageResource | [private]
HrFixupDisks(void) | CEnumStorageResource | [private]
HrGetBootLogicalDisk(BSTR *pbstrBootDeviceOut) | CEnumStorageResource | [private]
HrGetClusterDiskInfo(HRESOURCE hResourceIn, CLUS_SCSI_ADDRESS *pcsaOut, DWORD *pdwSignatureOut) | CEnumStorageResource | [private]
HrGetClusterProperties(HRESOURCE hResourceIn, BSTR *pbstrResourceNameOut) | CEnumStorageResource | [private]
HrGetCrashDumpLogicalDisk(BSTR *pbstrCrashDumpLogicalDiskOut) | CEnumStorageResource | [private]
HrGetDisks(void) | CEnumStorageResource | [private]
HrGetPageFileLogicalDisks(IClusCfgCallback *picccIn, WCHAR szLogicalDisksOut[26], int *pcLogicalDisksOut) | CEnumStorageResource | [private]
HrGetQuorumResourceName(BSTR *pbstrQuorumResourceNameOut) | CClusterUtils |
HrGetSCSIInfo(ULONG idxDiskIn, ULONG *pulSCSIBusOut, ULONG *pulSCSIPortOut) | CEnumStorageResource | [private]
HrGetSystemDevice(BSTR *pbstrSystemDeviceOut) | CEnumStorageResource | [private]
HrIsClusterServiceRunning(void) | CClusterUtils |
HrIsCoreResource(HRESOURCE hResourceIn) | CClusterUtils |
HrIsGroupOwnedByThisNode(HGROUP hGroupIn, BSTR bstrNodeNameIn) | CClusterUtils |
HrIsLogicalDiskNTFS(BSTR bstrLogicalDiskIn) | CEnumStorageResource | [private]
HrIsNodeClustered(void) | CClusterUtils |
HrIsSystemBusManaged(void) | CEnumStorageResource | [private]
HrLoadEnum(void) | CEnumStorageResource | [private]
HrLoadGroupResources(HCLUSTER hClusterIn, HGROUP hGroupIn) | CClusterUtils |
HrLogDiskInfo(IWbemClassObject *pDiskIn) | CEnumStorageResource | [private]
HrNodeResourceCallback(HRESOURCE hResourceIn) | CEnumStorageResource |
CClusterUtils::HrNodeResourceCallback(HRESOURCE hResourceIn)=0 | CClusterUtils | [pure virtual]
HrProcessWMIDiskObject(IWbemClassObject *pDiskIn) | CEnumStorageResource | [private]
HrPruneCrashDumpBus(BOOL fPruneBusIn, ULONG *pcPrunedInout) | CEnumStorageResource | [private]
HrPruneDisks(ULONG ulSCSIBusIn, ULONG ulSCSIPortIn, const GUID *pcguidMajorIdIn, int nMsgIdIn, int nRefIdIn, ULONG *pulRemovedOut) | CEnumStorageResource | [private]
HrPruneDynamicDisks(ULONG *pcPrunedInout) | CEnumStorageResource | [private]
HrPruneGPTDisks(ULONG *pcPrunedInout) | CEnumStorageResource | [private]
HrPrunePageFileDiskBuses(BOOL fPruneBusIn, ULONG *pcPrunedInout) | CEnumStorageResource | [private]
HrPruneSystemDisks(void) | CEnumStorageResource | [private]
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, UINT idsDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, UINT idsDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSetThisDiskToBeManaged(ULONG ulSCSITidIn, ULONG ulSCSILunIn, BOOL fIsQuorumIn, BSTR bstrResourceNameIn, DWORD dwSignatureIn) | CEnumStorageResource | [private]
HrSortDisksByIndex(void) | CEnumStorageResource | [private]
Initialize(IUnknown *punkCallbackIn, LCID lcidIn) | CEnumStorageResource |
IsDiskSCSI(IWbemClassObject *pDiskIn) | CEnumStorageResource | [private]
LogPrunedDisk(IUnknown *punkIn, ULONG ulSCSIBusIn, ULONG ulSCSIPortIn) | CEnumStorageResource | [private]
m_bstrBootDevice | CEnumStorageResource | [private]
m_bstrBootLogicalDisk | CEnumStorageResource | [private]
m_bstrCrashDumpLogicalDisk | CEnumStorageResource | [private]
m_bstrSystemDevice | CEnumStorageResource | [private]
m_bstrSystemLogicalDisk | CEnumStorageResource | [private]
m_bstrSystemWMIDeviceID | CEnumStorageResource | [private]
m_cDiskCount | CEnumStorageResource | [private]
m_fLoadedDevices | CEnumStorageResource | [private]
m_idxEnumNext | CEnumStorageResource | [private]
m_idxNext | CEnumStorageResource | [private]
m_pIWbemServices | CEnumStorageResource | [private]
m_prgDisks | CEnumStorageResource | [private]
Next(ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo **rgpManagedResourceInfoOut, ULONG *pcNumberFetchedOut) | CEnumStorageResource |
operator=(const CEnumStorageResource &nodeSrc) | CEnumStorageResource | [private]
RemoveDiskFromArray(ULONG idxDiskIn) | CEnumStorageResource | [private]
Reset(void) | CEnumStorageResource |
SetWbemServices(IWbemServices *pIWbemServicesIn) | CEnumStorageResource |
IWMIServices::SetWbemServices(IWbemServices *pIWbemServicesIn) | IWMIServices |
Skip(ULONG cNumberToSkipIn) | CEnumStorageResource |
~CClusterUtils(void) | CClusterUtils | [inline, protected, virtual]
~CEnumStorageResource(void) | CEnumStorageResource | [virtual]
~CMgdClusCfgInit(void) | CMgdClusCfgInit | [virtual]
~CMgdClusCfgInit(void) | CMgdClusCfgInit | [virtual]
Generated on Wed Nov 13 2024 16:56:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCNotify/QCNotify.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCNotify

QCNotify.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      QCNotify.cpp
00003   Summary:   Implementation of DLL exports
00004   Classes:   None
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #include "resource.h"
00024 #include "initguid.h"
00025 #include <adoid.h>    // ADO
00026 #include "QCNotify.h"
00027
00028 #include "QCNotify_i.c"
00029 #include "Notify.h"
00030
00031 CComModule _Module;
00032
00033 BEGIN_OBJECT_MAP(ObjectMap)
00034   OBJECT_ENTRY(CLSID_Notify, CONotify)
00035 END_OBJECT_MAP()
00036
00037 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00038   Function: DllMain
00039   Summary:  Main QCNotify DLL entry point
00040   Args:     HINSTANCE hInstance   An instance identifier
00041       DWORD dwReason      Reason DLL loaded
00042       LPVOID                  Reserved
00043   Returns:  BOOL - always TRUE
00044 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00045
00046 extern "C"
00047 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00048 {
00049   if (dwReason == DLL_PROCESS_ATTACH)
00050   {
00051     _Module.Init(ObjectMap, hInstance);
00052     DisableThreadLibraryCalls(hInstance);
00053   }
00054   else if (dwReason == DLL_PROCESS_DETACH)
00055     _Module.Term();
00056   return TRUE;    // ok
00057 }
00058
00059 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00060   Function: DllCanUnloadNow
00061   Summary:  Is this DLL in use or can it be unloaded
00062   Args:     None
00063   Returns:  S_OK    Can be unloaded
00064             S_FALSE Still in use
00065 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00066
00067 STDAPI DllCanUnloadNow(void)
00068 {
00069   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00070 }
00071
00072 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00073   Function: DllGetClassObject
00074   Summary:  Returns a class factory to create an object of the requested type
00075   Args:     REFCLSID rclsid     Class ID
00076             REFIID riid         Interface ID
00077             LPVOID *ppv         Returned class factory
00078   Returns:  Status from GetClassObject
00079 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00080
00081 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00082 {
00083   return _Module.GetClassObject(rclsid, riid, ppv);
00084 }
00085
00086 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00087   Function: DllRegisterServer
00088   Summary:  Adds entries to the system registry
00089   Args:     None
00090   Returns:  Status from RegisterServer
00091 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00092
00093 STDAPI DllRegisterServer(void)
00094 {
00095   // registers object, typelib and all interfaces in typelib
00096   return _Module.RegisterServer(TRUE);
00097 }
00098
00099 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00100   Function: DllUnregisterServer
00101   Summary:  Removes entries from the system registry
00102   Args:     None
00103   Returns:  Status from UnregisterServer
00104 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00105
00106 STDAPI DllUnregisterServer(void)
00107 {
00108   _Module.UnregisterServer();
00109   return S_OK;
00110 }
00111
00112
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/CeFormat.Cpp Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

CeFormat.Cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1995 - 2000
00006 //
00007 //  File:       ceformat.cpp
00008 //
00009 //  Contents:   helper functions
00010 //
00011 //--------------------------------------------------------------------------
00012
00013 #include "pch.cpp"
00014 #pragma hdrstop
00015
00016 #include <stdio.h>
00017 #include <assert.h>
00018 #include "celibw2k.h"
00019 #include <wininet.h>
00020
00021
00022
00023 HRESULT
00024 ceDupString(
00025     IN WCHAR const *pwszIn,
00026     IN WCHAR **ppwszOut)
00027 {
00028     DWORD cb;
00029     HRESULT hr;
00030
00031     cb = (DWORD)((wcslen(pwszIn) + 1) * sizeof(WCHAR));
00032     *ppwszOut = (WCHAR *) LocalAlloc(LMEM_FIXED, cb);
00033     if (NULL == *ppwszOut)
00034     {
00035   hr = E_OUTOFMEMORY;
00036   _JumpError(hr, error, "LocalAlloc");
00037     }
00038     CopyMemory(*ppwszOut, pwszIn, cb);
00039     hr = S_OK;
00040
00041 error:
00042     return(hr);
00043 }
00044
00045
00046 #define cwcCNMAX  64    // 64 chars max for CN
00047 #define cwcCHOPHASHMAX  (1 + 5)   // "-%05hu" decimal USHORT hash digits
00048 #define cwcCHOPBASE   (cwcCNMAX - (cwcCHOPHASHMAX + cwcSUFFIXMAX))
00049
00050 HRESULT
00051 ceSanitizedNameToDSName(
00052     IN WCHAR const *pwszSanitizedName,
00053     OUT WCHAR **ppwszNameOut)
00054 {
00055     HRESULT hr;
00056     DWORD cwc;
00057     DWORD cwcCopy;
00058     WCHAR wszDSName[cwcCHOPBASE + cwcCHOPHASHMAX + 1];
00059
00060     *ppwszNameOut = NULL;
00061
00062     cwc = (DWORD)wcslen(pwszSanitizedName);
00063     cwcCopy = cwc;
00064     if (cwcCHOPBASE < cwcCopy)
00065     {
00066   cwcCopy = cwcCHOPBASE;
00067     }
00068     CopyMemory(wszDSName, pwszSanitizedName, cwcCopy * sizeof(WCHAR));
00069     wszDSName[cwcCopy] = L'\0';
00070
00071     if (cwcCHOPBASE < cwc)
00072     {
00073         // Hash the rest of the name into a USHORT
00074         USHORT usHash = 0;
00075   DWORD i;
00076   WCHAR *pwsz;
00077
00078   // Truncate an incomplete sanitized Unicode character
00079
00080   pwsz = wcsrchr(wszDSName, L'!');
00081   if (NULL != pwsz && wcslen(pwsz) < 5)
00082   {
00083       cwcCopy -= (DWORD)wcslen(pwsz);
00084       *pwsz = L'\0';
00085   }
00086
00087         for (i = cwcCopy; i < cwc; i++)
00088         {
00089             USHORT usLowBit = (0x8000 & usHash)? 1 : 0;
00090
00091       usHash = ((usHash << 1) | usLowBit) + pwszSanitizedName[i];
00092         }
00093   wsprintf(&wszDSName[cwcCopy], L"-%05hu", usHash);
00094   assert(wcslen(wszDSName) < ARRAYSIZE(wszDSName));
00095     }
00096
00097     hr = ceDupString(wszDSName, ppwszNameOut);
00098     _JumpIfError(hr, error, "ceDupString");
00099
00100 error:
00101     return(hr);
00102 }
00103
00104
00105 HRESULT
00106 ceInternetCanonicalizeUrl(
00107     IN WCHAR const *pwszIn,
00108     OUT WCHAR **ppwszOut)
00109 {
00110     HRESULT hr;
00111     WCHAR *pwsz = NULL;
00112
00113     assert(NULL != pwszIn);
00114
00115     // Calculate required buffer size by passing a very small buffer
00116     // The call will fail, and tell us how big the buffer should be.
00117
00118     WCHAR wszPlaceHolder[1];
00119     DWORD cwc = ARRAYSIZE(wszPlaceHolder);
00120     BOOL bResult;
00121
00122     bResult = InternetCanonicalizeUrl(
00123         pwszIn,   // lpszUrl
00124         wszPlaceHolder, // lpszBuffer
00125         &cwc,   // lpdwBufferLength
00126         0);   // dwFlags
00127     assert(!bResult); // This will always fail
00128
00129     hr = ceHLastError();
00130     if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) != hr)
00131     {
00132         // unexpected error
00133
00134         _JumpError(hr, error, "InternetCanonicalizeUrl");
00135     }
00136
00137     // NOTE: InternetCanonicalizeUrl counts characters, not bytes as doc'd
00138     // cwc includes trailing L'0'
00139
00140     pwsz = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
00141     if (NULL == pwsz)
00142     {
00143   hr = E_OUTOFMEMORY;
00144   _JumpError(hr, error, "LocalAlloc");
00145     }
00146
00147     // canonicalize
00148     if (!InternetCanonicalizeUrl(
00149           pwszIn, // lpszUrl
00150           pwsz, // lpszBuffer
00151           &cwc, // lpdwBufferLength
00152           0))   // dwFlags
00153     {
00154         hr = ceHLastError();
00155         _JumpError(hr, error, "InternetCanonicalizeUrl");
00156     }
00157     *ppwszOut = pwsz;
00158     pwsz = NULL;
00159     hr = S_OK;
00160
00161 error:
00162     if (NULL != pwsz)
00163     {
00164         LocalFree(pwsz);
00165     }
00166     return(hr);
00167 }
00168
00169
00170 // ceFormatCertsrvStringArray FormatMessage arguments:
00171 //
00172 // %1 -- Machine full DNS name: pwszServerName_p1_2;
00173 //
00174 // %2 -- Machine short name: first DNS component of pwszServerName_p1_2
00175 //
00176 // %3 -- Sanitized CA name: pwszSanitizedName_p3_7
00177 //
00178 // %4 -- Cert Filename Suffix: L"" if 0 == iCert_p4; else L"(%u)"
00179 //
00180 // %5 -- DS DN path to Domain root: pwszDomainDN_p5
00181 //
00182 // %6 -- DS DN path to Configuration container: pwszConfigDN_p6
00183 //
00184 // %7 -- Sanitized CA name, truncated and hash suffix added if too long:
00185 //   pwszSanitizedName_p3_7
00186 //
00187 // %8 -- CRL Filename/Key Name Suffix: L"" if 0 == iCRL_p8; else L"(%u)"
00188 //
00189 // %9 -- CRL Filename Suffix: L"" if !fDeltaCRL_p9; else L"+"
00190 //
00191 // %10 -- DS CRL attribute: L"" if !fDSAttrib_p10_11; depends on fDeltaCRL_p9
00192 //
00193 // %11 -- DS CA Cert attribute: L"" if !fDSAttrib_p10_11
00194
00195 #ifndef wszDSSEARCHBASECRLATTRIBUTE
00196 #define wszDSSEARCHBASECRLATTRIBUTE L"?certificateRevocationList?base?objectclass=cRLDistributionPoint"
00197 #endif
00198
00199 #ifndef wszDSSEARCHDELTACRLATTRIBUTE
00200 #define wszDSSEARCHDELTACRLATTRIBUTE L"?deltaRevocationList?base?objectclass=cRLDistributionPoint"
00201 #endif
00202
00203 #ifndef wszDSSEARCHCACERTATTRIBUTE
00204 #define wszDSSEARCHCACERTATTRIBUTE L"?cACertificate?base?objectclass=certificationAuthority"
00205 #endif
00206
00207 HRESULT
00208 ceFormatCertsrvStringArray(
00209     IN BOOL    fURL,
00210     IN LPCWSTR pwszServerName_p1_2,
00211     IN LPCWSTR pwszSanitizedName_p3_7,
00212     IN DWORD   iCert_p4,
00213     IN LPCWSTR pwszDomainDN_p5,
00214     IN LPCWSTR pwszConfigDN_p6,
00215     IN DWORD   iCRL_p8,
00216     IN BOOL    fDeltaCRL_p9,
00217     IN BOOL    fDSAttrib_p10_11,
00218     IN DWORD   cStrings,
00219     IN LPCWSTR *apwszStringsIn,
00220     OUT LPWSTR *apwszStringsOut)
00221 {
00222     HRESULT hr = S_OK;
00223     LPCWSTR apwszInsertionArray[100];  // 100 'cause this is the max number of insertion numbers allowed by FormatMessage
00224     LPWSTR    pwszCurrent = NULL;
00225     BSTR      strShortMachineName = NULL;
00226     DWORD     i;
00227     WCHAR *pwszSanitizedDSName = NULL;
00228     WCHAR wszCertSuffix[cwcFILENAMESUFFIXMAX];
00229     WCHAR wszCRLSuffix[cwcFILENAMESUFFIXMAX];
00230     WCHAR wszDeltaCRLSuffix[cwcFILENAMESUFFIXMAX];
00231     WCHAR const *pwszT;
00232
00233
00234     ZeroMemory(apwszStringsOut, cStrings * sizeof(apwszStringsOut[0]));
00235     ZeroMemory(apwszInsertionArray, sizeof(apwszInsertionArray));
00236
00237     // Format the template into a real name
00238
00239     // Initialize the insertion string array.
00240     // Machine DNS name (%1)
00241
00242     assert(L'1' == wszFCSAPARM_SERVERDNSNAME[1]);
00243     apwszInsertionArray[1 - 1] = pwszServerName_p1_2;
00244
00245     // Short Machine Name (%2)
00246
00247     assert(L'2' == wszFCSAPARM_SERVERSHORTNAME[1]);
00248     strShortMachineName = SysAllocString(pwszServerName_p1_2);
00249     if (strShortMachineName == NULL)
00250     {
00251         hr = E_OUTOFMEMORY;
00252         _JumpIfError(hr, error, "SysAllocString");
00253     }
00254
00255     pwszCurrent = wcschr(strShortMachineName, L'.');
00256     if(pwszCurrent)
00257     {
00258         *pwszCurrent = 0;
00259     }
00260     apwszInsertionArray[2 - 1] = strShortMachineName;
00261
00262     // sanitized name (%3)
00263
00264     assert(L'3' == wszFCSAPARM_SANITIZEDCANAME[1]);
00265     apwszInsertionArray[3 - 1] = pwszSanitizedName_p3_7;
00266
00267     // Cert filename suffix (%4)
00268
00269     assert(L'4' == wszFCSAPARM_CERTFILENAMESUFFIX[1]);
00270     wszCertSuffix[0] = L'\0';
00271     if (0 != iCert_p4)
00272     {
00273         wsprintf(wszCertSuffix, L"(%u)", iCert_p4);
00274     }
00275     apwszInsertionArray[4 - 1] = wszCertSuffix;
00276
00277     assert(L'5' == wszFCSAPARM_DOMAINDN[1]);
00278     apwszInsertionArray[5 - 1] = pwszDomainDN_p5;
00279
00280     assert(L'6' == wszFCSAPARM_CONFIGDN[1]);
00281     apwszInsertionArray[6 - 1] = pwszConfigDN_p6;
00282
00283     // Don't pass pwszSanitizedName_p3_7 to SysAllocStringLen with the extended
00284     // length to avoid faulting past end of pwszSanitizedName_p3_7.
00285
00286     assert(L'7' == wszFCSAPARM_SANITIZEDCANAMEHASH[1]);
00287     hr = ceSanitizedNameToDSName(pwszSanitizedName_p3_7, &pwszSanitizedDSName);
00288     _JumpIfError(hr, error, "ceSanitizedNameToDSName");
00289
00290     apwszInsertionArray[7 - 1] = pwszSanitizedDSName;
00291
00292     // CRL filename suffix (%8)
00293
00294     assert(L'8' == wszFCSAPARM_CRLFILENAMESUFFIX[1]);
00295     wszCRLSuffix[0] = L'\0';
00296     if (0 != iCRL_p8)
00297     {
00298         wsprintf(wszCRLSuffix, L"(%u)", iCRL_p8);
00299     }
00300     apwszInsertionArray[8 - 1] = wszCRLSuffix;
00301
00302     assert(L'9' == wszFCSAPARM_CRLDELTAFILENAMESUFFIX[1]);
00303     wszDeltaCRLSuffix[0] = L'\0';
00304     if (fDeltaCRL_p9)
00305     {
00306         wcscpy(wszDeltaCRLSuffix, L"+");
00307     }
00308     apwszInsertionArray[9 - 1] = wszDeltaCRLSuffix;
00309
00310     assert(L'1' == wszFCSAPARM_DSCRLATTRIBUTE[1]);
00311     assert(L'0' == wszFCSAPARM_DSCRLATTRIBUTE[2]);
00312     pwszT = L"";
00313     if (fDSAttrib_p10_11)
00314     {
00315   pwszT = fDeltaCRL_p9?
00316         wszDSSEARCHDELTACRLATTRIBUTE :
00317         wszDSSEARCHBASECRLATTRIBUTE;
00318     }
00319     apwszInsertionArray[10 - 1] = pwszT;
00320
00321     assert(L'1' == wszFCSAPARM_DSCACERTATTRIBUTE[1]);
00322     assert(L'1' == wszFCSAPARM_DSCACERTATTRIBUTE[2]);
00323     pwszT = L"";
00324     if (fDSAttrib_p10_11)
00325     {
00326   pwszT = wszDSSEARCHCACERTATTRIBUTE;
00327     }
00328     apwszInsertionArray[11 - 1] = pwszT;
00329
00330     for (i = 0; i < cStrings; i++)
00331     {
00332         if (0 == FormatMessage(
00333       FORMAT_MESSAGE_ALLOCATE_BUFFER |
00334           FORMAT_MESSAGE_FROM_STRING |
00335           FORMAT_MESSAGE_ARGUMENT_ARRAY,
00336       (VOID *) apwszStringsIn[i],
00337       0,              // dwMessageID
00338       0,              // dwLanguageID
00339       (LPWSTR) &apwszStringsOut[i],
00340       (DWORD)wcslen(apwszStringsIn[i]),
00341       (va_list *) apwszInsertionArray))
00342         {
00343             hr = ceHLastError();
00344       _JumpError(hr, error, "FormatMessage");
00345         }
00346   if (fURL)
00347   {
00348       WCHAR *pwsz;
00349
00350       hr = ceInternetCanonicalizeUrl(apwszStringsOut[i], &pwsz);
00351       _JumpIfError(hr, error, "ceInternetCanonicalizeUrl");
00352
00353       LocalFree(apwszStringsOut[i]);
00354       apwszStringsOut[i] = pwsz;
00355   }
00356     }
00357
00358 error:
00359     if (S_OK != hr)
00360     {
00361   for (i = 0; i < cStrings; i++)
00362   {
00363       if (NULL != apwszStringsOut[i])
00364       {
00365     LocalFree(apwszStringsOut[i]);
00366     apwszStringsOut[i] = NULL;
00367       }
00368   }
00369     }
00370     if(strShortMachineName)
00371     {
00372         SysFreeString(strShortMachineName);
00373     }
00374     if (NULL != pwszSanitizedDSName)
00375     {
00376         LocalFree(pwszSanitizedDSName);
00377     }
00378     return (hr);
00379 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagESTABLISHCONNECTIONMSG Member List

This is the complete list of members for _tagESTABLISHCONNECTIONMSG, including all inherited members.
dwReserved | _tagESTABLISHCONNECTIONMSG
lpwszConnection | _tagESTABLISHCONNECTIONMSG
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/JavaClient/FullSvr/FullServ.java Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • JavaClient
  • FullSvr

FullServ.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc958.tmp" /nologo /d "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\JavaClient" "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\FullSvr\Debug\FullSvr.exe")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package fullsvr;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=F03BE175-A8DE-40D1-9161-A36BCBE1FEA6,DynamicCasts)
00019     @com.interface(iid=D3140112-D43F-4718-9119-EF62D631F2AB, thread=AUTO) */
00020 public class FullServ implements IUnknown,com.ms.com.NoAutoScripting,fullsvr.IFullServ,fullsvr.ICallFactory
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([in,type=I4] i, [in,type=I4] j, [type=I4] return) */
00024   public native int Sum(int i, int j);
00025
00026
00027   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xd3140112, (short)0xd43f, (short)0x4718, (byte)0x91, (byte)0x19, (byte)0xef, (byte)0x62, (byte)0xd6, (byte)0x31, (byte)0xf2, (byte)0xab);
00028   /** @com.method()
00029       @hidden */
00030   public native void CreateCall(com.ms.com._Guid riid, IUnknown pCtrlUnk, com.ms.com._Guid riid2, IUnknown[] ppv);
00031
00032
00033   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0xf03be175, (short)0xa8de, (short)0x40d1, (byte)0x91, (byte)0x61, (byte)0xa3, (byte)0x6b, (byte)0xcb, (byte)0xe1, (byte)0xfe, (byte)0xa6);
00034 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/enumStat.c Source File

  • Com
  • Fundamentals
  • OleStd

enumStat.c

Go to the documentation of this file.
00001 /*************************************************************************
00002 **
00003 **    OLE 2 Utility Code
00004 **
00005 **    enumstat.c
00006 **
00007 **    This file contains a standard implementation of IEnumStatData
00008 **    interface.
00009 **    This file is part of the OLE 2.0 User Interface support library.
00010 **
00011 **    (c) Copyright Microsoft Corp. 1990 - 2000 All Rights Reserved
00012 **
00013 *************************************************************************/
00014
00015 #define STRICT  1
00016 #include "olestd.h"
00017
00018
00019 typedef struct tagOleStdEnumStatData {
00020   IEnumSTATDATAVtbl FAR* lpVtbl;
00021   ULONG m_dwRefs;       /* referance count */
00022   ULONG m_nIndex;       /* current index in list */
00023   ULONG m_nCount;       /* how many items in list */
00024   LPSTATDATA m_lpStat;  /* list of STATDATA */
00025 } OLESTDENUMSTATDATA, FAR* LPOLESTDENUMSTATDATA;
00026
00027 VOID  OleStdEnumStatData_Destroy(LPOLESTDENUMSTATDATA pStat);
00028
00029 STDMETHODIMP OleStdEnumStatData_QueryInterface(
00030       LPENUMSTATDATA lpThis, REFIID riid, LPVOID FAR* ppobj);
00031 STDMETHODIMP_(ULONG)  OleStdEnumStatData_AddRef(LPENUMSTATDATA lpThis);
00032 STDMETHODIMP_(ULONG)  OleStdEnumStatData_Release(LPENUMSTATDATA lpThis);
00033 STDMETHODIMP  OleStdEnumStatData_Next(LPENUMSTATDATA lpThis, ULONG celt,
00034                           LPSTATDATA rgelt, ULONG FAR* pceltFetched);
00035 STDMETHODIMP  OleStdEnumStatData_Skip(LPENUMSTATDATA lpThis, ULONG celt);
00036 STDMETHODIMP  OleStdEnumStatData_Reset(LPENUMSTATDATA lpThis);
00037 STDMETHODIMP  OleStdEnumStatData_Clone(LPENUMSTATDATA lpThis,
00038                             LPENUMSTATDATA FAR* ppenum);
00039
00040 static IEnumSTATDATAVtbl g_EnumSTATDATAVtbl = {
00041       OleStdEnumStatData_QueryInterface,
00042       OleStdEnumStatData_AddRef,
00043       OleStdEnumStatData_Release,
00044       OleStdEnumStatData_Next,
00045       OleStdEnumStatData_Skip,
00046       OleStdEnumStatData_Reset,
00047       OleStdEnumStatData_Clone,
00048 };
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051
00052 STDAPI_(BOOL)
00053   OleStdCopyStatData(LPSTATDATA pDest, LPSTATDATA pSrc)
00054 //----------------------------------------------------------------------------
00055 //
00056 //----------------------------------------------------------------------------
00057 {
00058   if ((pDest == NULL) || (pSrc == NULL)) {
00059    return FALSE;
00060   }
00061
00062   if (OleStdCopyFormatEtc(&pDest->formatetc, &pSrc->formatetc) == FALSE) {
00063    return FALSE;
00064   }
00065
00066   pDest->advf = pSrc->advf;
00067   pDest->pAdvSink = pSrc->pAdvSink;
00068   pDest->dwConnection = pSrc->dwConnection;
00069
00070   if (pDest->pAdvSink != NULL) {
00071    pDest->pAdvSink->lpVtbl->AddRef(pDest->pAdvSink);
00072   }
00073
00074   return TRUE;
00075
00076 } /* OleStdCopyStatData()
00077    */
00078
00079 STDAPI_(LPENUMSTATDATA)
00080   OleStdEnumStatData_Create(ULONG nCount, LPSTATDATA lpStatOrg)
00081 //----------------------------------------------------------------------------
00082 //
00083 //----------------------------------------------------------------------------
00084 {
00085   LPMALLOC lpMalloc=NULL;
00086   LPOLESTDENUMSTATDATA lpSD=NULL;
00087   DWORD dwSize;
00088   WORD i;
00089   HRESULT hRes;
00090
00091   hRes = CoGetMalloc(MEMCTX_TASK, &lpMalloc);
00092   if (hRes != NOERROR) {
00093    return NULL;
00094   }
00095
00096   lpSD = (LPOLESTDENUMSTATDATA)lpMalloc->lpVtbl->Alloc(lpMalloc,
00097                                      sizeof(OLESTDENUMSTATDATA));
00098   if (lpSD == NULL) {
00099    goto errReturn;
00100   }
00101
00102   lpSD->lpVtbl = &g_EnumSTATDATAVtbl;
00103   lpSD->m_dwRefs = 1;
00104   lpSD->m_nCount = nCount;
00105   lpSD->m_nIndex = 0;
00106
00107   dwSize = sizeof(STATDATA) * lpSD->m_nCount;
00108
00109   lpSD->m_lpStat = (LPSTATDATA)lpMalloc->lpVtbl->Alloc(lpMalloc, dwSize);
00110   if (lpSD->m_lpStat == NULL)
00111    goto errReturn;
00112
00113   lpMalloc->lpVtbl->Release(lpMalloc);
00114
00115   for (i=0; i<nCount; i++) {
00116    OleStdCopyStatData(
00117          (LPSTATDATA)&(lpSD->m_lpStat[i]), (LPSTATDATA)&(lpStatOrg[i]));
00118   }
00119
00120   g_dwObjectCount++ ;
00121
00122   return (LPENUMSTATDATA)lpSD;
00123
00124 errReturn:
00125   if (lpSD != NULL)
00126    lpMalloc->lpVtbl->Free(lpMalloc, lpSD);
00127
00128   if (lpMalloc != NULL)
00129    lpMalloc->lpVtbl->Release(lpMalloc);
00130
00131   return NULL;
00132
00133 } /* OleStdEnumStatData_Create()
00134    */
00135
00136
00137 VOID
00138   OleStdEnumStatData_Destroy(LPOLESTDENUMSTATDATA lpSD)
00139 //----------------------------------------------------------------------------
00140 //
00141 //----------------------------------------------------------------------------
00142 {
00143    LPMALLOC lpMalloc=NULL;
00144    WORD i;
00145
00146    if (lpSD != NULL) {
00147
00148       if (CoGetMalloc(MEMCTX_TASK, &lpMalloc) == NOERROR) {
00149
00150          /* NOTE: we MUST free any memory that was allocated for
00151          **    TARGETDEVICES contained within the STATDATA elements.
00152          */
00153          for (i=0; i<lpSD->m_nCount; i++) {
00154             if( lpSD->m_lpStat[i].pAdvSink )
00155                lpSD->m_lpStat[i].pAdvSink->lpVtbl->Release(lpSD->m_lpStat[i].pAdvSink);
00156
00157             OleStdFree(lpSD->m_lpStat[i].formatetc.ptd);
00158          }
00159
00160          if (lpSD->m_lpStat != NULL) {
00161             lpMalloc->lpVtbl->Free(lpMalloc, lpSD->m_lpStat);
00162          }
00163
00164          lpMalloc->lpVtbl->Free(lpMalloc, lpSD);
00165          lpMalloc->lpVtbl->Release(lpMalloc);
00166       }
00167    }
00168
00169    g_dwObjectCount-- ;
00170
00171 } /* OleStdEnumStatData_Destroy()
00172    */
00173
00174
00175 STDMETHODIMP
00176   OleStdEnumStatData_QueryInterface(
00177             LPENUMSTATDATA lpThis, REFIID riid, LPVOID FAR* ppobj)
00178 //----------------------------------------------------------------------------
00179 //
00180 //----------------------------------------------------------------------------
00181 {
00182   LPOLESTDENUMSTATDATA lpSD = (LPOLESTDENUMSTATDATA)lpThis;
00183   *ppobj = NULL;
00184
00185   if (IsEqualIID(riid,&IID_IUnknown) || IsEqualIID(riid,&IID_IEnumSTATDATA)){
00186    *ppobj = (LPVOID)lpSD;
00187   }
00188
00189   if (*ppobj == NULL) return E_NOINTERFACE;
00190   else{
00191    OleStdEnumStatData_AddRef(lpThis);
00192    return NOERROR;
00193   }
00194
00195 } /* OleStdEnumStatData_QueryInterface()
00196    */
00197
00198
00199 STDMETHODIMP_(ULONG)
00200   OleStdEnumStatData_AddRef(LPENUMSTATDATA lpThis)
00201 //----------------------------------------------------------------------------
00202 //
00203 //----------------------------------------------------------------------------
00204 {
00205   LPOLESTDENUMSTATDATA lpSD = (LPOLESTDENUMSTATDATA)lpThis;
00206   return lpSD->m_dwRefs++;
00207
00208 } /* OleStdEnumStatData_AddRef()
00209    */
00210
00211
00212 STDMETHODIMP_(ULONG)
00213   OleStdEnumStatData_Release(LPENUMSTATDATA lpThis)
00214 //----------------------------------------------------------------------------
00215 //
00216 //----------------------------------------------------------------------------
00217 {
00218   LPOLESTDENUMSTATDATA lpSD = (LPOLESTDENUMSTATDATA)lpThis;
00219   DWORD dwRefs = --lpSD->m_dwRefs;
00220
00221   if (dwRefs == 0)
00222    OleStdEnumStatData_Destroy(lpSD);
00223
00224   return dwRefs;
00225
00226 } /* OleStdEnumStatData_Release()
00227    */
00228
00229
00230 STDMETHODIMP
00231   OleStdEnumStatData_Next(LPENUMSTATDATA lpThis, ULONG celt, LPSTATDATA rgelt,
00232                  ULONG FAR* pceltFetched)
00233 //----------------------------------------------------------------------------
00234 //
00235 //----------------------------------------------------------------------------
00236 {
00237   LPOLESTDENUMSTATDATA lpSD = (LPOLESTDENUMSTATDATA)lpThis;
00238   ULONG i=0;
00239   ULONG nOffset;
00240
00241   if (rgelt == NULL) {
00242    return E_INVALIDARG;
00243   }
00244
00245   while (i < celt) {
00246    nOffset = lpSD->m_nIndex + i;
00247
00248    if (nOffset < lpSD->m_nCount) {
00249      OleStdCopyStatData(
00250          (LPSTATDATA)&(rgelt[i]), (LPSTATDATA)&(lpSD->m_lpStat[nOffset]));
00251      i++;
00252    }else{
00253      break;
00254    }
00255   }
00256
00257   lpSD->m_nIndex += (WORD)i;
00258
00259   if (pceltFetched != NULL) {
00260    *pceltFetched = i;
00261   }
00262
00263   if (i != celt) {
00264    return S_FALSE;
00265   }
00266
00267   return NOERROR;
00268 } /* OleStdEnumStatData_Next()
00269    */
00270
00271
00272 STDMETHODIMP
00273   OleStdEnumStatData_Skip(LPENUMSTATDATA lpThis, ULONG celt)
00274 //----------------------------------------------------------------------------
00275 //
00276 //----------------------------------------------------------------------------
00277 {
00278   LPOLESTDENUMSTATDATA lpSD = (LPOLESTDENUMSTATDATA)lpThis;
00279   ULONG i=0;
00280   ULONG nOffset;
00281
00282   while (i < celt) {
00283    nOffset = lpSD->m_nIndex + i;
00284
00285    if (nOffset < lpSD->m_nCount) {
00286      i++;
00287    }else{
00288      break;
00289    }
00290   }
00291
00292   lpSD->m_nIndex += (WORD)i;
00293
00294   if (i != celt) {
00295    return S_FALSE;
00296   }
00297
00298   return NOERROR;
00299 } /* OleStdEnumStatData_Skip()
00300    */
00301
00302
00303 STDMETHODIMP
00304   OleStdEnumStatData_Reset(LPENUMSTATDATA lpThis)
00305 //----------------------------------------------------------------------------
00306 //
00307 //----------------------------------------------------------------------------
00308 {
00309   LPOLESTDENUMSTATDATA lpSD = (LPOLESTDENUMSTATDATA)lpThis;
00310   lpSD->m_nIndex = 0;
00311
00312   return NOERROR;
00313 } /* OleStdEnumStatData_Reset()
00314    */
00315
00316
00317 STDMETHODIMP
00318   OleStdEnumStatData_Clone(LPENUMSTATDATA lpThis, LPENUMSTATDATA FAR* ppenum)
00319 //----------------------------------------------------------------------------
00320 //
00321 //----------------------------------------------------------------------------
00322 {
00323   LPOLESTDENUMSTATDATA lpSD = (LPOLESTDENUMSTATDATA)lpThis;
00324
00325   if (ppenum == NULL) {
00326    return E_INVALIDARG;
00327   }
00328
00329   *ppenum = OleStdEnumStatData_Create(lpSD->m_nCount, lpSD->m_lpStat);
00330
00331   // make sure cloned enumerator has same index state as the original
00332   if (*ppenum) {
00333      LPOLESTDENUMSTATDATA lpSDClone = (LPOLESTDENUMSTATDATA)*ppenum;
00334      lpSDClone->m_nIndex = lpSD->m_nIndex;
00335      return NOERROR;
00336   } else
00337      return E_OUTOFMEMORY;
00338
00339 } /* OleStdEnumStatData_Clone()
00340    */
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/register.cpp Source File

  • WinUI
  • TSFmark

register.cpp

Go to the documentation of this file.
00001 //
00002 // register.cpp
00003 //
00004 // Server registration code.
00005 //
00006
00007 #include <windows.h>
00008 #include <ole2.h>
00009 #include "msctf.h"
00010 #include "globals.h"
00011 #include "mark.h"
00012
00013 #define CLSID_STRLEN 38  // strlen("{xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx}")
00014
00015 const struct
00016 {
00017     const GUID *pguidCategory;
00018     const GUID *pguid;
00019 }
00020 c_rgCategories[] =
00021 {
00022     { &GUID_TFCAT_TIP_KEYBOARD, &c_clsidMarkTextService },
00023     { &GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, &c_clsidMarkTextService },
00024     { &GUID_TFCAT_PROPSTYLE_STATICCOMPACT, &c_guidCaseProperty },
00025     { &GUID_TFCAT_PROPSTYLE_CUSTOM, &c_guidCustomProperty },
00026 };
00027
00028 static const TCHAR c_szInfoKeyPrefix[] = TEXT("CLSID\\");
00029 static const TCHAR c_szInProcSvr32[] = TEXT("InProcServer32");
00030 static const TCHAR c_szModelName[] = TEXT("ThreadingModel");
00031
00032 //+---------------------------------------------------------------------------
00033 //
00034 //  RegisterProfiles
00035 //
00036 //----------------------------------------------------------------------------
00037
00038 BOOL CMarkTextService::RegisterProfiles()
00039 {
00040     ITfInputProcessorProfiles *pInputProcessProfiles;
00041     WCHAR achIconFile[MAX_PATH];
00042     char achFileNameA[MAX_PATH];
00043     DWORD cchA;
00044     int cchIconFile;
00045     HRESULT hr;
00046
00047     hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER,
00048                           IID_ITfInputProcessorProfiles, (void**)&pInputProcessProfiles);
00049
00050     if (hr != S_OK)
00051         return E_FAIL;
00052
00053     hr = pInputProcessProfiles->Register(c_clsidMarkTextService);
00054
00055     if (hr != S_OK)
00056         goto Exit;
00057
00058     cchA = GetModuleFileNameA(g_hInst, achFileNameA, ARRAYSIZE(achFileNameA));
00059
00060     cchIconFile = MultiByteToWideChar(CP_ACP, 0, achFileNameA, cchA, achIconFile, ARRAYSIZE(achIconFile)-1);
00061     achIconFile[cchIconFile] = '\0';
00062
00063     hr = pInputProcessProfiles->AddLanguageProfile(c_clsidMarkTextService,
00064                                   MARK_LANGID,
00065                                   c_guidMarkProfile,
00066                                   MARK_DESC,
00067                                   wcslen(MARK_DESC),
00068                                   achIconFile,
00069                                   cchIconFile,
00070                                   MARK_ICON_INDEX);
00071
00072 Exit:
00073     pInputProcessProfiles->Release();
00074     return (hr == S_OK);
00075 }
00076
00077 //+---------------------------------------------------------------------------
00078 //
00079 //  UnregisterProfiles
00080 //
00081 //----------------------------------------------------------------------------
00082
00083 void CMarkTextService::UnregisterProfiles()
00084 {
00085     ITfInputProcessorProfiles *pInputProcessProfiles;
00086     HRESULT hr;
00087
00088     hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER,
00089                           IID_ITfInputProcessorProfiles, (void**)&pInputProcessProfiles);
00090
00091     if (hr != S_OK)
00092         return;
00093
00094     pInputProcessProfiles->Unregister(c_clsidMarkTextService);
00095     pInputProcessProfiles->Release();
00096 }
00097
00098 //+---------------------------------------------------------------------------
00099 //
00100 //  RegisterCategories
00101 //
00102 //----------------------------------------------------------------------------
00103
00104 BOOL CMarkTextService::RegisterCategories(BOOL fRegister)
00105 {
00106     ITfCategoryMgr *pCategoryMgr;
00107     int i;
00108     HRESULT hr;
00109
00110     hr = CoCreateInstance(CLSID_TF_CategoryMgr, NULL, CLSCTX_INPROC_SERVER,
00111                           IID_ITfCategoryMgr, (void**)&pCategoryMgr);
00112
00113     if (hr != S_OK)
00114         return FALSE;
00115
00116     for (i=0; i<ARRAYSIZE(c_rgCategories); i++)
00117     {
00118         if (fRegister)
00119         {
00120             hr = pCategoryMgr->RegisterCategory(c_clsidMarkTextService,
00121                    *c_rgCategories[i].pguidCategory, *c_rgCategories[i].pguid);
00122         }
00123         else
00124         {
00125             hr = pCategoryMgr->UnregisterCategory(c_clsidMarkTextService,
00126                    *c_rgCategories[i].pguidCategory, *c_rgCategories[i].pguid);
00127         }
00128
00129         if (hr != S_OK)
00130             break;
00131     }
00132
00133     pCategoryMgr->Release();
00134     return (hr == S_OK);
00135 }
00136
00137 //+---------------------------------------------------------------------------
00138 //
00139 // CLSIDToStringA
00140 //
00141 //----------------------------------------------------------------------------
00142
00143 BOOL CLSIDToStringA(REFGUID refGUID, char *pchA)
00144 {
00145     static const BYTE GuidMap[] = {3, 2, 1, 0, '-', 5, 4, '-', 7, 6, '-',
00146                                    8, 9, '-', 10, 11, 12, 13, 14, 15};
00147
00148     static const char szDigits[] = "0123456789ABCDEF";
00149
00150     int i;
00151     char *p = pchA;
00152
00153     const BYTE * pBytes = (const BYTE *) &refGUID;
00154
00155     *p++ = '{';
00156     for (i = 0; i < sizeof(GuidMap); i++)
00157     {
00158         if (GuidMap[i] == '-')
00159         {
00160             *p++ = '-';
00161         }
00162         else
00163         {
00164             *p++ = szDigits[ (pBytes[GuidMap[i]] & 0xF0) >> 4 ];
00165             *p++ = szDigits[ (pBytes[GuidMap[i]] & 0x0F) ];
00166         }
00167     }
00168
00169     *p++ = '}';
00170     *p   = '\0';
00171
00172     return TRUE;
00173 }
00174
00175 //+---------------------------------------------------------------------------
00176 //
00177 // RecurseDeleteKey
00178 //
00179 // RecurseDeleteKey is necessary because on NT RegDeleteKey doesn't work if the
00180 // specified key has subkeys
00181 //----------------------------------------------------------------------------
00182 LONG RecurseDeleteKey(HKEY hParentKey, LPCTSTR lpszKey)
00183 {
00184     HKEY hKey;
00185     LONG lRes;
00186     FILETIME time;
00187     TCHAR szBuffer[256];
00188     DWORD dwSize = ARRAYSIZE(szBuffer);
00189
00190     if (RegOpenKey(hParentKey, lpszKey, &hKey) != ERROR_SUCCESS)
00191         return ERROR_SUCCESS; // let's assume we couldn't open it because it's not there
00192
00193     lRes = ERROR_SUCCESS;
00194     while (RegEnumKeyEx(hKey, 0, szBuffer, &dwSize, NULL, NULL, NULL, &time)==ERROR_SUCCESS)
00195     {
00196         szBuffer[ARRAYSIZE(szBuffer)-1] = '\0';
00197         lRes = RecurseDeleteKey(hKey, szBuffer);
00198         if (lRes != ERROR_SUCCESS)
00199             break;
00200         dwSize = ARRAYSIZE(szBuffer);
00201     }
00202     RegCloseKey(hKey);
00203
00204     return lRes == ERROR_SUCCESS ? RegDeleteKey(hParentKey, lpszKey) : lRes;
00205 }
00206
00207 //+---------------------------------------------------------------------------
00208 //
00209 //  RegisterServer
00210 //
00211 //----------------------------------------------------------------------------
00212
00213 BOOL CMarkTextService::RegisterServer()
00214 {
00215     DWORD dw;
00216     HKEY hKey;
00217     HKEY hSubKey;
00218     BOOL fRet;
00219     TCHAR achIMEKey[ARRAYSIZE(c_szInfoKeyPrefix) + CLSID_STRLEN];
00220     TCHAR achFileName[MAX_PATH];
00221
00222     if (!CLSIDToStringA(c_clsidMarkTextService, achIMEKey + ARRAYSIZE(c_szInfoKeyPrefix) - 1))
00223         return FALSE;
00224     memcpy(achIMEKey, c_szInfoKeyPrefix, sizeof(c_szInfoKeyPrefix)-sizeof(TCHAR));
00225
00226     if (fRet = RegCreateKeyEx(HKEY_CLASSES_ROOT, achIMEKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, &dw)
00227             == ERROR_SUCCESS)
00228     {
00229         fRet &= RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE *)MARK_DESC_A, (lstrlen(MARK_DESC_A)+1)*sizeof(TCHAR))
00230             == ERROR_SUCCESS;
00231
00232         if (fRet &= RegCreateKeyEx(hKey, c_szInProcSvr32, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hSubKey, &dw)
00233             == ERROR_SUCCESS)
00234         {
00235             dw = GetModuleFileNameA(g_hInst, achFileName, ARRAYSIZE(achFileName));
00236
00237             fRet &= RegSetValueEx(hSubKey, NULL, 0, REG_SZ, (BYTE *)achFileName, (lstrlen(achFileName)+1)*sizeof(TCHAR)) == ERROR_SUCCESS;
00238             fRet &= RegSetValueEx(hSubKey, c_szModelName, 0, REG_SZ, (BYTE *)MARK_MODEL, (lstrlen(MARK_MODEL)+1)*sizeof(TCHAR)) == ERROR_SUCCESS;
00239             RegCloseKey(hSubKey);
00240         }
00241         RegCloseKey(hKey);
00242     }
00243
00244     return fRet;
00245 }
00246
00247 //+---------------------------------------------------------------------------
00248 //
00249 //  UnregisterServer
00250 //
00251 //----------------------------------------------------------------------------
00252
00253 void CMarkTextService::UnregisterServer()
00254 {
00255     TCHAR achIMEKey[ARRAYSIZE(c_szInfoKeyPrefix) + CLSID_STRLEN];
00256
00257     if (!CLSIDToStringA(c_clsidMarkTextService, achIMEKey + ARRAYSIZE(c_szInfoKeyPrefix) - 1))
00258         return;
00259     memcpy(achIMEKey, c_szInfoKeyPrefix, sizeof(c_szInfoKeyPrefix)-sizeof(TCHAR));
00260
00261     RecurseDeleteKey(HKEY_CLASSES_ROOT, achIMEKey);
00262 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/basesnap.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

basesnap.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  Abstract:  This module provides the basic COM and DLL methods to create
00015 //             and load the Snap-in.  IClassFactory::CreateInstance creates
00016 //             an instance of CComponentData which is the Snap-in's root
00017 //             or static node
00018 //
00019
00020
00021 #ifndef _BASESNAP_H_
00022 #define _BASESNAP_H_
00023
00024 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj);
00025 STDAPI DllCanUnloadNow(void);
00026
00027 //---------------------------------------------------------------------------
00028 class CClassFactory : public IClassFactory
00029 {
00030   private:
00031     ULONG m_cRef;
00032
00033   public:
00034     CClassFactory();
00035     ~CClassFactory();
00036
00037     STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv);
00038     STDMETHODIMP_(ULONG) AddRef();
00039     STDMETHODIMP_(ULONG) Release();
00040
00041     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID*);
00042     STDMETHODIMP LockServer(BOOL);
00043 };
00044
00045 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

newseventclass::INewsEvent Member List

This is the complete list of members for newseventclass::INewsEvent, including all inherited members.
iid | newseventclass::INewsEvent | [static]
LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate) | newseventclass::INewsEvent |
NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL) | newseventclass::INewsEvent |
ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow) | newseventclass::INewsEvent |
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

qcorder::IOrder Member List

This is the complete list of members for qcorder::IOrder, including all inherited members.
iid | qcorder::IOrder | [static]
LineItem(int lItemId, int lQuantity) | qcorder::IOrder |
Process(int lFlags) | qcorder::IOrder |
setCustomerId(int _jcomparam_0) | qcorder::IOrder |
setOrderId(int _jcomparam_0) | qcorder::IOrder |
Generated on Wed Nov 13 2024 16:58:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminServiceOptions Member List

This is the complete list of members for comadmin::COMAdminServiceOptions, including all inherited members.
COMAdminServiceLoadBalanceRouter comadmin::COMAdminServiceOptions [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/internetpublishing/ippsample/Sample1.h Source File

  • Dataaccess
  • oledb
  • internetpublishing
  • ippsample

Sample1.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003   ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004   TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005   PARTICULAR PURPOSE.
00006
00007   Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009   sample1.h
00010
00011   header file for sample1.cpp
00012
00013 ------------------------------------------------------------------------------*/
00014
00015 #ifndef _SAMPLE1_H_
00016 #define _SAMPLE1_H_
00017
00018 //operations to perform with IScopedOperations
00019 enum ISO_OPS
00020 {
00021    ISO_MKDIR,
00022    ISO_COPY,
00023    ISO_MOVE,
00024    ISO_DELETE
00025 };
00026
00027 //Tests:
00028 HRESULT Download(int argc, wchar_t* argv[]);
00029
00030 HRESULT Upload(int argc, wchar_t* argv[]);
00031
00032 HRESULT Enum(int argc, wchar_t* argv[]);
00033
00034 HRESULT Search(int argc, wchar_t* argv[]);
00035
00036 HRESULT ISO(ISO_OPS Op, int argc, wchar_t* argv[]);
00037
00038
00039 //Binding:
00040 HRESULT Bind(      LPWSTR           wszUrl,
00041                    REFGUID          rguid,
00042                    REFIID           riid,
00043                    DWORD            dwFlags,
00044                    IUnknown**       ppUnk,
00045                    LPWSTR           wszUserName,
00046                    LPWSTR           wszPassword,
00047                    BOOL             fCreate);
00048
00049
00050 //Helpers:
00051 HRESULT EnumerateWithRowsetPointer(
00052                   IRowset  *pIRowset,
00053                   BOOL     fVerbose);
00054
00055 HRESULT EnumerateParent(LPWSTR    wszUrl,
00056                         LPWSTR    wszUserName,
00057                         LPWSTR    wszPassword);
00058
00059 HRESULT GetParentUrl(LPWSTR    wszUrl,
00060                      LPWSTR    *ppwchParent);
00061
00062 LPWSTR DuplicateWSTR(LPWSTR wsz);
00063
00064 void PrintUsage();
00065
00066
00067
00068 //IAuthenticate:
00069 class CImpAuth : public IAuthenticate
00070 {
00071 public:
00072
00073    CImpAuth();
00074
00075    ~CImpAuth();
00076
00077    virtual HRESULT STDMETHODCALLTYPE QueryInterface(
00078          REFIID   iid,
00079          void     **ppvObject);
00080
00081    virtual ULONG STDMETHODCALLTYPE AddRef(void);
00082
00083    virtual ULONG STDMETHODCALLTYPE Release(void);
00084
00085    //For IAuthenticate:
00086    virtual HRESULT STDMETHODCALLTYPE Authenticate(
00087          /* out */      HWND     *phwnd,
00088          /* out */      LPWSTR   *pwszUserName,
00089          /* out */      LPWSTR   *pwszPassword );
00090
00091    HRESULT  Set(
00092          /* in */       LPWSTR    wszUserName,
00093          /* in */       LPWSTR    wszPassword);
00094
00095 private:
00096
00097         ULONG          m_nRefs;
00098
00099         LPWSTR         m_wszUserName;
00100         LPWSTR         m_wszPassword;
00101 };
00102
00103
00104 #endif
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/registry.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

registry.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include <ObjBase.h>
00016 #include "Registry.h"
00017 #include "Globals.h"
00018
00019
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("Registry")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Internal helper functions prototypes
00027
00028
00029 // Set the given key and its value.
00030 HRESULT SetKeyAndValue( const TCHAR* pszPath, const TCHAR* szSubkey, const TCHAR* szValue);
00031
00032 // Set the given key and its value in the MMC Snapin location
00033 HRESULT SetSnapInKeyAndValue( const TCHAR* szKey, const TCHAR* szSubkey, const TCHAR* szName, const TCHAR* szValue );
00034
00035 // Set the given valuename under the key to value
00036 HRESULT SetValue( const TCHAR* szKey, const TCHAR* szValueName, const TCHAR* szValue);
00037
00038 // Delete szKeyChild and all of its descendents.
00039 HRESULT RecursiveDeleteKey( HKEY hKeyParent, const TCHAR* szKeyChild );
00040
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // Public function implementation
00044
00045
00046 //---------------------------------------------------------------------------
00047 //  Register the component in the registry.  This is the minimalist way
00048 //  to register a component, you may want to add keys for ProgID.
00049 //
00050 HRESULT RegisterServer
00051 (
00052   HMODULE        hModule,          //[in] DLL module handle
00053   const CLSID&   clsid,            //[in] Class ID
00054   const TCHAR*   szFriendlyName    //[in] Name string
00055 )
00056 {
00057   // Get server location.
00058   TCHAR    szModule[512] ;
00059   TCHAR*   pszCLSID = NULL;
00060   WCHAR*   wszCLSID = NULL ;
00061   HRESULT  hResult  = S_FALSE;
00062
00063   DWORD dwResult = ::GetModuleFileName( hModule,
00064                                         szModule,
00065                                         sizeof(szModule)/sizeof(TCHAR)
00066                                       );
00067   if( 0 == dwResult ) return HRESULT_FROM_WIN32( dwResult );
00068
00069   do                         // Fail unless we complete everything
00070   {
00071     // Get CLSID string in wide char
00072     hResult = StringFromCLSID( clsid, &wszCLSID ) ;
00073     if( S_OK != hResult )
00074     {
00075       CoTaskMemFree( wszCLSID );
00076       BREAK_ON_ERROR( hResult );
00077     }
00078
00079     W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00080     CoTaskMemFree( wszCLSID );           // Through with wide version
00081
00082     TCHAR szKey[64];                     // Build the CLSID key string CLSID\\{...}
00083     _tcscpy( szKey, _T("CLSID\\") );
00084     _tcscat( szKey, pszCLSID );
00085
00086     // Add the CLSID to the registry.
00087     hResult = SetKeyAndValue( szKey, NULL, szFriendlyName );
00088     BREAK_ON_ERROR( hResult );
00089
00090     // Add the server filename subkey under the CLSID key.
00091     hResult = SetKeyAndValue( szKey, _T("InprocServer32"), szModule );
00092     BREAK_ON_ERROR( hResult );
00093
00094     // Set the threading model
00095     _tcscat( szKey, _T("\\InprocServer32") );
00096     hResult = SetValue( szKey, _T("ThreadingModel"), _T("Apartment") );
00097     BREAK_ON_ERROR( hResult );
00098
00099   }while( 0 );
00100
00101   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00102
00103   return hResult;
00104 }
00105
00106
00107 //---------------------------------------------------------------------------
00108 // Remove the component from the registry.
00109 //
00110 LONG UnregisterServer
00111 (
00112   const CLSID& clsid         //[in] Class ID of component to remove
00113 )
00114 {
00115   HRESULT hResult = S_OK;
00116
00117   // Allocate the CLSID string
00118   LPOLESTR wszCLSID = NULL ;
00119   hResult = StringFromCLSID( clsid, &wszCLSID );
00120   if( S_OK != hResult )
00121   {
00122     CoTaskMemFree( wszCLSID );
00123     return hResult;
00124   }
00125
00126   // Build the key CLSID\\{...}
00127   TCHAR szKey[64];
00128   _tcscpy( szKey, _T("CLSID\\") );
00129
00130   TCHAR* pszCLSID = NULL;
00131   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00132   CoTaskMemFree( wszCLSID );           // Through with wide version
00133
00134   _tcscat( szKey, pszCLSID );
00135   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00136
00137   // Delete the CLSID Key - CLSID\{...}
00138   LONG lResult = RecursiveDeleteKey( HKEY_CLASSES_ROOT, szKey );
00139   if( ERROR_SUCCESS != lResult )
00140     hResult = HRESULT_FROM_WIN32( lResult );
00141
00142   return hResult;
00143 }
00144
00145 //---------------------------------------------------------------------------
00146 // Register the snap-in in the registry.
00147 //
00148 HRESULT RegisterSnapin
00149 (
00150   const  CLSID&  clsid,              //[in] Class ID
00151   const  TCHAR*  szNameString,       //[in] NameString
00152   const  CLSID&  clsidAbout,         //[in] Class Id for About Class
00153   const  BOOL    bSupportExtensions  //[in] TRUE if we support extensions
00154 )
00155 {
00156   HRESULT hResult = S_FALSE;
00157   TCHAR*  pszSnapCLSID = NULL;         // Needed for TCHAR version of the ClassID
00158
00159   // If any part of this process fails, jump out of the loop and return
00160   // the error code
00161   do
00162   {
00163     // Allocate the CLSID string
00164     LPOLESTR wszSnapCLSID  = NULL ;
00165     hResult = StringFromCLSID( clsid, &wszSnapCLSID ) ;
00166     if( S_OK != hResult )
00167     {
00168        CoTaskMemFree( wszSnapCLSID );
00169        continue;
00170     }
00171
00172     W2T( &pszSnapCLSID, wszSnapCLSID );  // W2T is defined in Globals.h
00173     CoTaskMemFree( wszSnapCLSID );       // Through with wide version
00174
00175     // Add the Snap-in's CLSID to the registry
00176     hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("NameString"), szNameString );
00177     BREAK_ON_ERROR( hResult );
00178
00179     hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("StandAlone"), NULL, NULL );
00180     BREAK_ON_ERROR( hResult );
00181
00182     // Add registry information for ISnapinAbout if we support it
00183     LPOLESTR wszAboutCLSID = NULL;
00184     TCHAR*   pszAboutCLSID = NULL;
00185     if( IID_NULL != clsidAbout )
00186     {
00187       hResult = StringFromCLSID( clsidAbout, &wszAboutCLSID );
00188       if( S_OK != hResult )
00189       {
00190         CoTaskMemFree( wszAboutCLSID ); // Free this memory before exiting
00191         continue;
00192       }
00193
00194       W2T( &pszAboutCLSID, wszAboutCLSID );
00195       hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("About"), pszAboutCLSID );
00196       CoTaskMemFree( wszAboutCLSID );
00197       CoTaskMemFree( pszAboutCLSID );
00198       BREAK_ON_ERROR( hResult );
00199     }
00200
00201     if( TRUE == bSupportExtensions )     // Build the NodeTypesKey
00202     {
00203       hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("NodeTypes"), NULL, NULL );
00204       BREAK_ON_ERROR( hResult );
00205       TCHAR szKey[64];
00206       _tcscpy( szKey, pszSnapCLSID );
00207       _tcscat(szKey, _T("\\NodeTypes"));
00208       hResult = SetSnapInKeyAndValue( szKey, pszSnapCLSID, NULL, NULL );
00209       BREAK_ON_ERROR( hResult );
00210     }
00211   }while( 0 );
00212
00213   CoTaskMemFree( pszSnapCLSID);
00214   return hResult;
00215 }
00216
00217
00218 //---------------------------------------------------------------------------
00219 // Unregister the snap-in in the registry.
00220 //
00221 HRESULT UnregisterSnapin
00222 (
00223   const CLSID& clsid         //[in] Class ID of object to unregister
00224 )
00225 {
00226   HRESULT hResult = S_OK;
00227
00228   TCHAR    szKeyBuf[1024];
00229   LPOLESTR wszCLSID = NULL;
00230   TCHAR*   pszCLSID = NULL;        // Needed for TCHAR version of the ClassID
00231
00232   // Get CLSID as a wide string
00233   hResult = StringFromCLSID( clsid, &wszCLSID );
00234   if( S_OK != hResult )
00235   {
00236     CoTaskMemFree( wszCLSID );
00237     return hResult;
00238   }
00239
00240   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00241   CoTaskMemFree( wszCLSID );           // Through with wide version
00242
00243   // Load the buffer with the Snap-In Location
00244   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00245
00246   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00247   _tcscat( szKeyBuf, pszCLSID );
00248
00249   // Delete the CLSID Key - CLSID\{...}
00250   LONG lResult = RecursiveDeleteKey( HKEY_LOCAL_MACHINE, szKeyBuf );
00251   if( ERROR_SUCCESS != lResult )
00252     hResult = HRESULT_FROM_WIN32( lResult );
00253
00254   CoTaskMemFree( pszCLSID );
00255   return hResult;
00256 }
00257
00258 //---------------------------------------------------------------------------
00259 // Delete a key and all of its descendents.
00260 //
00261 HRESULT RecursiveDeleteKey
00262 (
00263   HKEY          hKeyParent,    //[in] Parent of key to delete
00264   const TCHAR*  lpszKeyChild   //[in] Key to delete
00265 )
00266 {
00267   // Open the child.
00268   HKEY hKeyChild = NULL;
00269   LONG lResult   = ERROR_SUCCESS;
00270
00271   do                     // We go to all this trouble to prevent any
00272   {                      // possibility of exiting while leaving a key open
00273
00274     lResult = RegOpenKeyEx( hKeyParent,
00275                             lpszKeyChild,
00276                             0,
00277                             KEY_ALL_ACCESS,
00278                             &hKeyChild
00279                           );
00280     if( ERROR_SUCCESS != lResult )
00281       continue;
00282
00283     // Enumerate all of the decendents of this child.
00284     FILETIME time;
00285     _TCHAR szBuffer[256];
00286     DWORD dwSize = 256;
00287     while( S_OK == RegEnumKeyEx(hKeyChild,0,szBuffer,&dwSize,NULL,NULL,NULL,&time) )
00288     {
00289       // Delete the decendents of this child.
00290       lResult = RecursiveDeleteKey( hKeyChild, szBuffer );
00291       if( ERROR_SUCCESS != lResult )
00292       {
00293         continue;
00294       }
00295       dwSize = 256;
00296     }
00297   }while( 0 );
00298
00299   RegCloseKey( hKeyChild );            // Always try to close the child
00300                                        // then delete this child.
00301   return RegDeleteKey( hKeyParent, lpszKeyChild );
00302 }
00303
00304 //---------------------------------------------------------------------------
00305 // Create a Registry Key and set its value.
00306 //   - This helper function was borrowed and modifed from
00307 //     Kraig Brockschmidt's book Inside OLE.
00308 //
00309 HRESULT SetKeyAndValue
00310 (
00311   const TCHAR*  szKey,       //[in] Parent key
00312   const TCHAR*  szSubkey,    //[in] Child key
00313   const TCHAR*  szValue      //[in] Value to set
00314 )
00315 {
00316   HKEY hKey = NULL;
00317   HRESULT hResult = S_FALSE;
00318   TCHAR szKeyBuf[1024];
00319
00320   // Copy keyname into buffer.
00321   _tcscpy( szKeyBuf, szKey );
00322
00323   // Add subkey name to buffer.
00324   if( NULL != szSubkey )
00325   {
00326     _tcscat( szKeyBuf, _T("\\") );
00327     _tcscat( szKeyBuf, szSubkey );
00328   }
00329
00330   do                     // We go to all this trouble to prevent any
00331   {                      // possibility of exiting while leaving a key open
00332
00333     // Create and open key and subkey.
00334     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT,
00335                                    szKeyBuf,
00336                                    0,
00337                                    NULL,
00338                                    REG_OPTION_NON_VOLATILE,
00339                                    KEY_ALL_ACCESS,
00340                                    NULL,
00341                                    &hKey,
00342                                    NULL
00343                                  );
00344     if( ERROR_SUCCESS != lResult )
00345     {
00346       hResult = HRESULT_FROM_WIN32( lResult );
00347       continue;
00348     }
00349
00350     if( NULL != szValue )    // Now set the value
00351     {
00352       hResult = RegSetValueEx( hKey,
00353                                NULL,
00354                                0,
00355                                REG_SZ,
00356                                (BYTE*)szValue,
00357                                BYTE_SIZE( szValue )    // BYTE_SIZE is in Globals.h
00358                              );
00359       BREAK_ON_ERROR( hResult );
00360     }
00361   }while( 0 );
00362
00363   RegCloseKey( hKey );       // Always try to close the key
00364   return hResult;
00365 }
00366
00367
00368 //---------------------------------------------------------------------------
00369 // Open a key value and set it
00370 //
00371 HRESULT SetValue
00372 (
00373   const TCHAR*  szKey,         //[in] Parent key
00374   const TCHAR*  szValueName,   //[in] Name of value
00375   const TCHAR*  szValue        //[in] Value in string format
00376 )
00377 {
00378   HKEY    hKey = NULL;
00379   HRESULT hResult = S_FALSE;
00380   TCHAR szKeyBuf[1024];
00381
00382   // Copy keyname into buffer.
00383   _tcscpy( szKeyBuf, szKey );
00384
00385   do                     // We go to all this trouble to prevent any
00386   {                      // possibility of exiting while leaving a key open
00387
00388     // Create and open key and subkey.
00389     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT ,
00390                                    szKeyBuf,
00391                                    0,
00392                                    NULL,
00393                                    REG_OPTION_NON_VOLATILE,
00394                                    KEY_ALL_ACCESS,
00395                                    NULL,
00396                                    &hKey,
00397                                    NULL
00398                                  );
00399     if( ERROR_SUCCESS != lResult )
00400     {
00401       hResult = HRESULT_FROM_WIN32( lResult );
00402       continue;
00403     }
00404
00405     if( NULL != szValue )    // Now set the value
00406     {
00407       hResult = RegSetValueEx( hKey,
00408                                szValueName,
00409                                0,
00410                                REG_SZ,
00411                                (BYTE*)szValue,
00412                                BYTE_SIZE( szValue )
00413                              );
00414       BREAK_ON_ERROR( hResult );
00415     }
00416   }while( 0 );
00417
00418   RegCloseKey( hKey );       //Always attempt to close the key
00419   return hResult;
00420 }
00421
00422
00423 //---------------------------------------------------------------------------
00424 // Create a key and set its value.
00425 //   - This helper function was borrowed and modifed from
00426 //     Kraig Brockschmidt's book Inside OLE.
00427 //
00428 HRESULT SetSnapInKeyAndValue
00429 (
00430   const TCHAR*  szKey,       //[in] Parent key
00431   const TCHAR*  szSubkey,    //[in] Child key
00432   const TCHAR*  szName,      //[in] Value name
00433   const TCHAR*  szValue      //[in] Value in string format
00434 )
00435 {
00436   HKEY    hKey = NULL;
00437   HRESULT hResult = S_FALSE;
00438   TCHAR   szKeyBuf[1024];
00439
00440   // Load the buffer with the Snap-In Location
00441   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00442
00443   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00444   _tcscat( szKeyBuf, szKey );
00445
00446   if( NULL != szSubkey )               // Add subkey name to buffer.
00447   {
00448     _tcscat( szKeyBuf, _T("\\") );
00449     _tcscat( szKeyBuf, szSubkey );
00450   }
00451
00452   do                     // We go to all this trouble to prevent any
00453   {                      // possibility of exiting while leaving a key open
00454
00455     // Create and open key and subkey.
00456     long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00457                                    szKeyBuf,
00458                                    0,
00459                                    NULL,
00460                                    REG_OPTION_NON_VOLATILE,
00461                                    KEY_ALL_ACCESS,
00462                                    NULL,
00463                                    &hKey,
00464                                    NULL
00465                                  );
00466     if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00467       continue;
00468
00469     // Set the Value.
00470     if( szValue != NULL )
00471     {
00472       hResult = RegSetValueEx( hKey,
00473                                szName,
00474                                0,
00475                                REG_SZ,
00476                                (BYTE*)szValue,
00477                                BYTE_SIZE(szValue)
00478                              );
00479       BREAK_ON_ERROR( hResult );
00480     }
00481     else
00482     {                        // Got this far so everything is OK.
00483       hResult = S_OK;
00484     }
00485   }while( 0 );
00486
00487   RegCloseKey( hKey );       //Always attempt to close the key
00488   return hResult;
00489 }
00490
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/compart.cpp Source File

  • WinUI
  • TSFmark

compart.cpp

Go to the documentation of this file.
00001 //
00002 // compart.cpp
00003 //
00004 // Compartment example.
00005 //
00006
00007 #include "globals.h"
00008 #include "mark.h"
00009
00010 //+---------------------------------------------------------------------------
00011 //
00012 // _InitCompartment
00013 //
00014 // Initialize a compartment on a particular context.
00015 //
00016 // The Mark sample doesn't really do any with its context compartment, this
00017 // code is purely for demonstration purposes.
00018 //----------------------------------------------------------------------------
00019
00020 BOOL CMarkTextService::_InitContextCompartment(ITfContext *pContext)
00021 {
00022     ITfCompartmentMgr *pCompartmentMgr;
00023     ITfCompartment *pCompartment;
00024     VARIANT varValue;
00025     HRESULT hr;
00026
00027     // we want the mgr associated with pContext
00028     if (pContext->QueryInterface(IID_ITfCompartmentMgr, (void **)&pCompartmentMgr) != S_OK)
00029         return FALSE;
00030
00031     hr = E_FAIL;
00032
00033     if (pCompartmentMgr->GetCompartment(c_guidMarkContextCompartment, &pCompartment) != S_OK)
00034         goto Exit;
00035
00036     // if we don't initialize the value, it will be VT_EMPTY
00037     // but let's initialize it to 0
00038
00039     // NB: to keep things simple, we use a VT_I4
00040     // but you could use VT_UNKNOWN and store a pointer to anything
00041     varValue.vt = VT_I4;
00042     varValue.lVal = 0; // arbitrary value
00043
00044     hr = pCompartment->SetValue(_tfClientId, &varValue);
00045
00046     pCompartment->Release();
00047
00048 Exit:
00049     pCompartmentMgr->Release();
00050
00051     return (hr == S_OK);
00052 }
00053
00054 //+---------------------------------------------------------------------------
00055 //
00056 // _UninitCompartment
00057 //
00058 // Uninitialize a compartment on a particular context.
00059 //
00060 // The Mark sample doesn't really do any with its context compartment, this
00061 // code is purely for demonstration purposes.
00062 //----------------------------------------------------------------------------
00063
00064 void CMarkTextService::_UninitCompartment(ITfContext *pContext)
00065 {
00066     ITfCompartmentMgr *pCompartmentMgr;
00067
00068     // we want the mgr associated with pContext
00069     if (pContext->QueryInterface(IID_ITfCompartmentMgr, (void **)&pCompartmentMgr) != S_OK)
00070         return;
00071
00072     pCompartmentMgr->ClearCompartment(_tfClientId, c_guidMarkContextCompartment);
00073
00074     pCompartmentMgr->Release();
00075 }
00076
00077 //+---------------------------------------------------------------------------
00078 //
00079 // _Menu_OnSetGlobalCompartment
00080 //
00081 // Callback for the "Set Global Compartment" menu item.
00082 // Set the value of our global compartment.  This will trigger a callback
00083 // on our compartment change sinks in every thread/instance of this service.
00084 //----------------------------------------------------------------------------
00085
00086 /* static */
00087 void CMarkTextService::_Menu_OnSetGlobalCompartment(CMarkTextService *_this)
00088 {
00089     ITfCompartmentMgr *pCompartmentMgr;
00090     ITfCompartment *pCompartment;
00091     VARIANT varValue;
00092
00093     // we want the global mgr
00094     if (_this->_pThreadMgr->GetGlobalCompartment(&pCompartmentMgr) != S_OK)
00095         return;
00096
00097     if (pCompartmentMgr->GetCompartment(c_guidMarkGlobalCompartment, &pCompartment) != S_OK)
00098     {
00099         pCompartment = NULL;
00100         goto Exit;
00101     }
00102
00103     // let's toggle the value
00104     // notice that global compartments are persisted, unlike all others
00105     if (FAILED(pCompartment->GetValue(&varValue))) // will return S_FALSE if varValue.vt == VT_EMPTY
00106         goto Exit;
00107
00108     if (varValue.vt == VT_EMPTY)
00109     {
00110         // if we get here, the compartment has never been initialized
00111         varValue.vt = VT_I4;
00112         varValue.lVal = 0;
00113     }
00114
00115     // toggle value
00116     varValue.lVal = ~varValue.lVal;
00117
00118     pCompartment->SetValue(_this->_tfClientId, &varValue);
00119
00120 Exit:
00121     SafeRelease(pCompartment);
00122     pCompartmentMgr->Release();
00123 }
00124
00125 //+---------------------------------------------------------------------------
00126 //
00127 // _InitGlobalCompartment
00128 //
00129 // Ininit a change sink on our global compartment.  The system will call us
00130 // back anytime the compartment is modified from any thread in the desktop.
00131 //
00132 // NB: ITfCompartmentEventSink's attached to thread local compartments will
00133 // only get callbacks to changes that occur within a single thread.  Global
00134 // compartments are different.
00135 //----------------------------------------------------------------------------
00136
00137 BOOL CMarkTextService::_InitGlobalCompartment()
00138 {
00139     ITfCompartmentMgr *pCompartmentMgr;
00140     ITfCompartment *pCompartment;
00141     BOOL fRet;
00142
00143     // we want the global mgr
00144     if (_pThreadMgr->GetGlobalCompartment(&pCompartmentMgr) != S_OK)
00145         return FALSE;
00146
00147     fRet = FALSE;
00148
00149     if (pCompartmentMgr->GetCompartment(c_guidMarkGlobalCompartment, &pCompartment) != S_OK)
00150         goto Exit;
00151
00152     fRet = AdviseSink(pCompartment, (ITfCompartmentEventSink *)this,
00153                       IID_ITfCompartmentEventSink, &_dwGlobalCompartmentEventSinkCookie);
00154
00155     pCompartment->Release();
00156
00157     if (!fRet)
00158     {
00159         // don't try to unadvise a bogus cookie later
00160         _dwGlobalCompartmentEventSinkCookie = TF_INVALID_COOKIE;
00161     }
00162
00163 Exit:
00164     pCompartmentMgr->Release();
00165     return fRet;
00166 }
00167
00168 //+---------------------------------------------------------------------------
00169 //
00170 // _UninitCompartment
00171 //
00172 // Unitialize the global compartment if we have previously accessed it.
00173 // This method only frees resources the system has allocated in this thread.
00174 // Other threads can still access the global compartment, and the value (which
00175 // is persisted across the desktop) does not change.
00176 //
00177 // Also, uninit the change sink we attached to the compartment.
00178 //----------------------------------------------------------------------------
00179
00180 void CMarkTextService::_UninitGlobalCompartment()
00181 {
00182     ITfCompartmentMgr *pCompartmentMgr;
00183     ITfCompartment *pCompartment;
00184
00185     // we want the global mgr
00186     if (_pThreadMgr->GetGlobalCompartment(&pCompartmentMgr) != S_OK)
00187         return;
00188
00189     // unadvise our event sink
00190     if (pCompartmentMgr->GetCompartment(c_guidMarkGlobalCompartment, &pCompartment) == S_OK)
00191     {
00192         UnadviseSink(pCompartment, &_dwGlobalCompartmentEventSinkCookie);
00193         pCompartment->Release();
00194     }
00195
00196     // let the system free resources associated with the compartment on this
00197     // thread
00198     pCompartmentMgr->ClearCompartment(_tfClientId, c_guidMarkGlobalCompartment);
00199
00200     pCompartmentMgr->Release();
00201 }
00202
00203 //+---------------------------------------------------------------------------
00204 //
00205 // ITfCompartmentEventSink::OnChange
00206 //
00207 // TSF calls this method anytime our private global compartment is modified,
00208 // even from other threads/processes.
00209 //----------------------------------------------------------------------------
00210
00211 STDAPI CMarkTextService::OnChange(REFGUID rguidCompartment)
00212 {
00213     // nothing to do in this sample
00214     return S_OK;
00215 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkBlog::_Default Member List

This is the complete list of members for InkBlog::_Default, including all inherited members.
InitializeComponent() | InkBlog::_Default | [inline, private]
OnInit(EventArgs e) | InkBlog::_Default | [inline, protected]
Page_Load(object sender, System.EventArgs e) | InkBlog::_Default | [inline, private]
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PRIMARYKEY Member List

This is the complete list of members for PRIMARYKEY, including all inherited members.
wszColName PRIMARYKEY
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/basesnap.h Source File

  • SysMgmt
  • MMC
  • Nodes

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMMCControlVtbl Member List

This is the complete list of members for IMMCControlVtbl, including all inherited members.
cNames | IMMCControlVtbl
dispIdMember | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(IMMCControl __RPC_FAR *This | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(IMMCControl __RPC_FAR *This | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(IMMCControl __RPC_FAR *This | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(IMMCControl __RPC_FAR *This | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(IMMCControl __RPC_FAR *This | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *StartAnimation)(IMMCControl __RPC_FAR *This) | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *StopAnimation)(IMMCControl __RPC_FAR *This) | IMMCControlVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *DoHelp)(IMMCControl __RPC_FAR *This) | IMMCControlVtbl
iTInfo | IMMCControlVtbl
lcid | IMMCControlVtbl
lcid | IMMCControlVtbl
lcid | IMMCControlVtbl
pctinfo | IMMCControlVtbl
pDispParams | IMMCControlVtbl
pExcepInfo | IMMCControlVtbl
ppTInfo | IMMCControlVtbl
ppvObject | IMMCControlVtbl
puArgErr | IMMCControlVtbl
pVarResult | IMMCControlVtbl
rgDispId | IMMCControlVtbl
rgszNames | IMMCControlVtbl
riid | IMMCControlVtbl
riid | IMMCControlVtbl
riid | IMMCControlVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(IMMCControl __RPC_FAR *This) | IMMCControlVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(IMMCControl __RPC_FAR *This) | IMMCControlVtbl
wFlags | IMMCControlVtbl
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/repas/Repasp.c Source File

  • NetDS
  • RPC
  • Data
  • repas

Repasp.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                          repas Example
00005
00006     FILE:       repasp.c
00007
00008     PURPOSE:    Remote procedures that are linked with the server
00009                 side of RPC distributed application
00010
00011     FUNCTIONS:  ModifyListProc() - changes the doubly-linked list
00012                 Shutdown() - shuts down the server side
00013
00014     COMMENTS:   Related to repass.c
00015
00016 ****************************************************************************/
00017
00018 #include <stdlib.h>
00019 #include <stdio.h>
00020 #include "repass.h"    // header file generated by MIDL compiler
00021
00022
00023 /****************************************************************************
00024
00025 Function:   ModifyMyWString
00026
00027 Parameters: pStr : Pointer to pointer to UNICODE string
00028
00029 Returns:    none
00030
00031 Purpose:    Display the string passed in, modify it, and return
00032
00033 Comments:   This sample is meant to demonstrate a typical use of the
00034             represent_as attribute:  The client and server have different
00035             local views of the data, although the IDL file describes the
00036             wire contract.
00037
00038 ****************************************************************************/
00039 void ModifyMyWString(WCHAR_STRING * pStr)
00040 {
00041     wprintf(L"\nModifyMyWString: received UNICODE string:\n%s\n\n", *pStr );
00042     wcscpy(*pStr, L"This string comes back on the wire as UNICODE");
00043     wprintf(L"ModifyMyWString: sending UNICODE string:\n%s\n\n", *pStr );
00044
00045 }
00046
00047 /****************************************************************************
00048
00049 Function:   ModifyMyString
00050
00051 Parameters: pStr : Pointer to pointer to UNICODE string
00052
00053 Returns:    none
00054
00055 Purpose:    Display the string passed in, modify it, and return
00056
00057 Comments:   This sample is meant to demonstrate a typical use of the
00058             represent_as attribute:  The client and server have different
00059             local views of the data, although the IDL file describes the
00060             wire contract.
00061
00062 ****************************************************************************/
00063 void ModifyMyString(WCHAR_STRING * pStr)
00064 {
00065     wprintf(L"\nModifyMyString: received UNICODE string:\n%s\n\n", *pStr );
00066     wcscpy(*pStr, L"This UNICODE string comes back on the wire as ASCII");
00067     wprintf(L"ModifyMyString: sending UNICODE string:\n%s\n\n", *pStr );
00068
00069 }
00070
00071
00072 /****************************************************************************
00073
00074 Function:   Shutdown
00075
00076 Parameters: none
00077
00078 Returns:    none
00079
00080 Purpose:    Make the server stop listening for client applications.
00081
00082 Comments:   The two NULL parameters passed to RpcServerUnregisterIf are
00083             a show of brute force:  they tell the function to turn
00084             off all registered interfaces.  See the RPC API function
00085             reference for more information about these functions.
00086
00087 ****************************************************************************/
00088
00089 void Shutdown(void)
00090 {
00091     RPC_STATUS status;
00092
00093     printf("Calling RpcMgmtStopServerListening\n");
00094     status = RpcMgmtStopServerListening(NULL);
00095     printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
00096     if (status) {
00097         exit(status);
00098     }
00099
00100     printf("Calling RpcServerUnregisterIf\n");
00101     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
00102     printf("RpcServerUnregisterIf returned 0x%x\n", status);
00103     if (status) {
00104         exit(status);
00105     }
00106 }
00107
00108 /* end file repasp.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/HelpDll/stdafx.h Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • HelpDll

stdafx.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 // stdafx.h : include file for standard system include files,
00020 //  or project specific include files that are used frequently, but
00021 //      are changed infrequently
00022 //
00023
00024 #if !defined(AFX_STDAFX_H__F8163294_0EC7_4276_841E_E4D8A004F83B__INCLUDED_)
00025 #define AFX_STDAFX_H__F8163294_0EC7_4276_841E_E4D8A004F83B__INCLUDED_
00026
00027 #if _MSC_VER > 1000
00028 #pragma once
00029 #endif // _MSC_VER > 1000
00030
00031
00032 // Insert your headers here
00033 //#define WIN32_LEAN_AND_MEAN   // Exclude rarely-used stuff from Windows headers
00034
00035 #include <windows.h>
00036
00037 // TODO: reference additional headers your program requires here
00038
00039 //{{AFX_INSERT_LOCATION}}
00040 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00041
00042 #endif // !defined(AFX_STDAFX_H__F8163294_0EC7_4276_841E_E4D8A004F83B__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/sky.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Enumidl.Cpp Source File

  • WinUI
  • Shell
  • SampView

Enumidl.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          EnumIDL.cpp
00013
00014    Description:   Implements IEnumIDList.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "EnumIDL.h"
00023 #include "ShlFldr.h"
00024 #include <shlwapi.h>
00025
00026 /**************************************************************************
00027
00028    CEnumIDList::CEnumIDList
00029
00030 **************************************************************************/
00031
00032 CEnumIDList::CEnumIDList(LPCTSTR pszPath, DWORD dwFlags)
00033 {
00034 g_DllRefCount++;
00035
00036 m_pFirst = m_pLast = m_pCurrent = NULL;
00037
00038 m_szPath[0] = 0;
00039 if(pszPath)
00040    lstrcpyn(m_szPath, pszPath, MAX_PATH);
00041
00042 m_dwFlags = dwFlags;
00043
00044 m_pPidlMgr = new CPidlMgr();
00045 if(!m_pPidlMgr)
00046    {
00047    delete this;
00048    return;
00049    }
00050
00051 //get the shell's IMalloc pointer
00052 //we'll keep this until we get destroyed
00053 if(FAILED(SHGetMalloc(&m_pMalloc)))
00054    {
00055    delete this;
00056    return;
00057    }
00058
00059 if(!CreateEnumList())
00060    {
00061    delete this;
00062    return;
00063    }
00064
00065 m_ObjRefCount = 1;
00066 }
00067
00068 /**************************************************************************
00069
00070    CEnumIDList::~CEnumIDList
00071
00072 **************************************************************************/
00073
00074 CEnumIDList::~CEnumIDList()
00075 {
00076 DeleteList();
00077
00078 if(m_pMalloc)
00079    m_pMalloc->Release();
00080
00081 if(m_pPidlMgr)
00082    delete m_pPidlMgr;
00083
00084 g_DllRefCount--;
00085 }
00086
00087 /**************************************************************************
00088
00089    CEnumIDList::QueryInterface
00090
00091 **************************************************************************/
00092
00093 STDMETHODIMP CEnumIDList::QueryInterface(REFIID riid, LPVOID *ppReturn)
00094 {
00095 *ppReturn = NULL;
00096
00097 //IUnknown
00098 if(IsEqualIID(riid, IID_IUnknown))
00099    {
00100    *ppReturn = this;
00101    }
00102
00103 //IEnumIDList
00104 else if(IsEqualIID(riid, IID_IEnumIDList))
00105    {
00106    *ppReturn = (IEnumIDList*)this;
00107    }
00108
00109 if(*ppReturn)
00110    {
00111    (*(LPUNKNOWN*)ppReturn)->AddRef();
00112    return S_OK;
00113    }
00114
00115 return E_NOINTERFACE;
00116 }
00117
00118 /**************************************************************************
00119
00120    CEnumIDList::AddRef
00121
00122 **************************************************************************/
00123
00124 STDMETHODIMP_(DWORD) CEnumIDList::AddRef()
00125 {
00126 return ++m_ObjRefCount;
00127 }
00128
00129
00130 /**************************************************************************
00131
00132    CEnumIDList::Release
00133
00134 **************************************************************************/
00135
00136 STDMETHODIMP_(DWORD) CEnumIDList::Release()
00137 {
00138 if(--m_ObjRefCount == 0)
00139    {
00140    delete this;
00141    return 0;
00142    }
00143
00144 return m_ObjRefCount;
00145 }
00146
00147 /**************************************************************************
00148
00149    CEnumIDList::Next()
00150
00151 **************************************************************************/
00152
00153 STDMETHODIMP CEnumIDList::Next(DWORD dwElements, LPITEMIDLIST apidl[], LPDWORD pdwFetched)
00154 {
00155 DWORD    dwIndex;
00156 HRESULT  hr = S_OK;
00157
00158 if(dwElements > 1 && !pdwFetched)
00159    return E_INVALIDARG;
00160
00161 for(dwIndex = 0; dwIndex < dwElements; dwIndex++)
00162    {
00163    //is this the last item in the list?
00164    if(!m_pCurrent)
00165       {
00166       hr =  S_FALSE;
00167       break;
00168       }
00169
00170    apidl[dwIndex] = m_pPidlMgr->Copy(m_pCurrent->pidl);
00171
00172    m_pCurrent = m_pCurrent->pNext;
00173    }
00174
00175 if(pdwFetched)
00176    *pdwFetched = dwIndex;
00177
00178 return hr;
00179 }
00180
00181 /**************************************************************************
00182
00183    CEnumIDList::Skip()
00184
00185 **************************************************************************/
00186
00187 STDMETHODIMP CEnumIDList::Skip(DWORD dwSkip)
00188 {
00189 DWORD    dwIndex;
00190 HRESULT  hr = S_OK;
00191
00192 for(dwIndex = 0; dwIndex < dwSkip; dwIndex++)
00193    {
00194    //is this the last item in the list?
00195    if(!m_pCurrent)
00196       {
00197       hr = S_FALSE;
00198       break;
00199       }
00200
00201    m_pCurrent = m_pCurrent->pNext;
00202    }
00203
00204 return hr;
00205 }
00206
00207 /**************************************************************************
00208
00209    CEnumIDList::Reset()
00210
00211 **************************************************************************/
00212
00213 STDMETHODIMP CEnumIDList::Reset(VOID)
00214 {
00215 m_pCurrent = m_pFirst;
00216
00217 return S_OK;
00218 }
00219
00220 /**************************************************************************
00221
00222    CEnumIDList::Clone()
00223
00224 **************************************************************************/
00225
00226 STDMETHODIMP CEnumIDList::Clone(LPENUMIDLIST *ppEnum)
00227 {
00228 HRESULT  hr = E_OUTOFMEMORY;
00229
00230 *ppEnum = new CEnumIDList(m_szPath, m_dwFlags);
00231
00232 if(*ppEnum)
00233    {
00234    LPENUMLIST  pTemp;
00235
00236    //synchronize the current pointer
00237    for(pTemp = m_pFirst; pTemp != m_pCurrent; pTemp = pTemp->pNext)
00238       {
00239       (*ppEnum)->Skip(1);
00240       }
00241    hr = S_OK;
00242    }
00243
00244 return hr;
00245 }
00246
00247 /**************************************************************************
00248
00249    CEnumIDList::CreateEnumList()
00250
00251 **************************************************************************/
00252
00253 BOOL CEnumIDList::CreateEnumList(VOID)
00254 {
00255 LPITEMIDLIST   pidl;
00256
00257 //enumerate the folders
00258 if(m_dwFlags & SHCONTF_FOLDERS)
00259    {
00260    HANDLE            hFind;
00261    WIN32_FIND_DATA   wfd;
00262    TCHAR             szTemp[MAX_PATH];
00263
00264    lstrcpyn(szTemp, m_szPath, ARRAYSIZE(szTemp));
00265    SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
00266    StrCatBuff(szTemp, TEXT("*.*"), ARRAYSIZE(szTemp));
00267
00268    hFind = FindFirstFile(szTemp, &wfd);
00269
00270    if(INVALID_HANDLE_VALUE != hFind)
00271       {
00272       do
00273          {
00274          if((FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes) &&
00275             ((wfd.dwFileAttributes & FILTER_ATTRIBUTES) == FILTER_ATTRIBUTES) &&
00276             lstrcmpi(wfd.cFileName, TEXT(".")) &&
00277             lstrcmpi(wfd.cFileName, TEXT("..")))
00278             {
00279             //We found one of our directories. Make sure it contains a data file.
00280             TCHAR szFolder[MAX_PATH];
00281             lstrcpyn(szFolder, wfd.cFileName, ARRAYSIZE(szFolder));
00282
00283             //build the path of the directory or file found
00284             lstrcpyn(szTemp, m_szPath, ARRAYSIZE(szTemp));
00285             SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
00286             StrCatBuff(szTemp, wfd.cFileName, ARRAYSIZE(szTemp));
00287             SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
00288             StrCatBuff(szTemp, c_szDataFile, ARRAYSIZE(szTemp));
00289             HANDLE   hDataFile = FindFirstFile(szTemp, &wfd);
00290             if(INVALID_HANDLE_VALUE != hDataFile)
00291                {
00292                FindClose(hDataFile);
00293
00294                pidl = m_pPidlMgr->CreateFolderPidl(szFolder);
00295
00296                if(pidl)
00297                   AddToEnumList(pidl);
00298                }
00299
00300             }
00301          }
00302       while(FindNextFile(hFind, &wfd));
00303
00304       FindClose(hFind);
00305       }
00306
00307    }
00308
00309 //enumerate the non-folder items
00310 if(m_dwFlags & SHCONTF_NONFOLDERS)
00311    {
00312    TCHAR    szDataFile[MAX_PATH];
00313    TCHAR    szKeys[10000] = TEXT("");
00314    LPTSTR   pStr;
00315
00316    BuildDataFileName(szDataFile, m_szPath, MAX_PATH);
00317
00318    //get the items from the [Items] section
00319
00320    //now enumerate the items in the INI file
00321    GetPrivateProfileString(   c_szSection,
00322                               NULL,
00323                               TEXT(""),
00324                               szKeys,
00325                               sizeof(szKeys),
00326                               szDataFile);
00327
00328    for(pStr = szKeys; *pStr; pStr += lstrlen(pStr) + 1)
00329       {
00330       TCHAR szData[MAX_DATA];
00331
00332       GetPrivateProfileString(   c_szSection,
00333                                  pStr,
00334                                  TEXT(""),
00335                                  szData,
00336                                  MAX_DATA,
00337                                  szDataFile);
00338
00339       pidl = m_pPidlMgr->CreateItemPidl(pStr, szData);
00340
00341       if(pidl)
00342          AddToEnumList(pidl);
00343       }
00344    }
00345
00346 return TRUE;
00347 }
00348
00349 /**************************************************************************
00350
00351    CEnumIDList::AddToEnumList()
00352
00353 **************************************************************************/
00354
00355 BOOL CEnumIDList::AddToEnumList(LPITEMIDLIST pidl)
00356 {
00357 LPENUMLIST  pNew;
00358
00359 pNew = (LPENUMLIST)m_pMalloc->Alloc(sizeof(ENUMLIST));
00360
00361 if(pNew)
00362    {
00363    //set the next pointer
00364    pNew->pNext = NULL;
00365    pNew->pidl = pidl;
00366
00367    //is this the first item in the list?
00368    if(!m_pFirst)
00369       {
00370       m_pFirst = pNew;
00371       m_pCurrent = m_pFirst;
00372       }
00373
00374    if(m_pLast)
00375       {
00376       //add the new item to the end of the list
00377       m_pLast->pNext = pNew;
00378       }
00379
00380    //update the last item pointer
00381    m_pLast = pNew;
00382
00383    return TRUE;
00384    }
00385
00386 return FALSE;
00387 }
00388
00389 /**************************************************************************
00390
00391    CEnumIDList::DeleteList()
00392
00393 **************************************************************************/
00394
00395 BOOL CEnumIDList::DeleteList(VOID)
00396 {
00397 LPENUMLIST  pDelete;
00398
00399 while(m_pFirst)
00400    {
00401    pDelete = m_pFirst;
00402    m_pFirst = pDelete->pNext;
00403
00404    //free the pidl
00405    m_pPidlMgr->Delete(pDelete->pidl);
00406
00407    //free the list item
00408    m_pMalloc->Free(pDelete);
00409    }
00410
00411 m_pFirst = m_pLast = m_pCurrent = NULL;
00412
00413 return TRUE;
00414 }
00415
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CClipBookServerApp Member List

This is the complete list of members for CClipBookServerApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CWinApp() | CWinApp |
ExitInstance() | CClipBookServerApp | [virtual]
InitInstance() | CClipBookServerApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:55:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSkyBasedVehicle Member List

This is the complete list of members for CSkyBasedVehicle, including all inherited members.
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
bExpanded | CDelegationBase | [protected]
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CSkyBasedVehicle(CComponentData *pComponentData=NULL) | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
CSkyBasedVehicle(CComponentData *pComponentData=NULL) | CSkyBasedVehicle | [inline]
CSkyBasedVehicle() | CSkyBasedVehicle | [inline]
Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetBitmapIndex() | CSkyBasedVehicle | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyBasedVehicle | [inline, virtual]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CDelegationBase | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
getNodeType() | CSkyBasedVehicle | [inline, virtual]
GetParentScopeItem() | CSkyBasedVehicle | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CSkyBasedVehicle | [virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CSkyBasedVehicle | [virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CSkyBasedVehicle | [virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CDelegationBase | [inline, virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CDelegationBase | [inline, virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CDelegationBase | [inline, virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
IDM_NEW_SKY enum value | CSkyBasedVehicle | [private]
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
m_hParentHScopeItem | CSkyBasedVehicle | [private]
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pComponentData | CDelegationBase |
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CSkyBasedVehicle | [virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CDelegationBase | [inline, virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CSkyBasedVehicle | [virtual]
CDelegationBase::OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CSkyBasedVehicle | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CSkyBasedVehicle | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CSkyBasedVehicle | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CSkyBasedVehicle | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CDelegationBase | [inline, virtual]
thisGuid | CSkyBasedVehicle | [private, static]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
~CSkyBasedVehicle() | CSkyBasedVehicle | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/deleBase.h Source File

  • SysMgmt
  • MMC
  • Help

deleBase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CDelegationBase {
00030 public:
00031     CDelegationBase();
00032     virtual ~CDelegationBase();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00035     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00036
00037     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00038     virtual const int GetBitmapIndex() = 0;
00039
00040     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00041
00042 public:
00043     // virtual functions go here (for MMCN_*)
00044     virtual HRESULT OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) { return S_FALSE; }
00045
00046 private:
00047     // {2974380B-4C4B-11d2-89D8-000021473128}
00048     static const GUID thisGuid;
00049 };
00050
00051 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/dataobj.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

dataobj.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "DataObj.h"
00016 #include "StaticNode.h"
00017
00018                              // Tracing stuff
00019 #include "TraceMacro.h"
00020 #undef  MODULESTRING
00021 #define MODULESTRING  _T("CDataObject")
00022
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // Construction/Destruction
00026
00027
00028 CDataObject::CDataObject()
00029 {
00030   m_cRef     = 0;
00031   m_uCookie  = 0;
00032   m_uContext = 0;
00033
00034 }
00035
00036 CDataObject::~CDataObject()
00037 {
00038 }
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // IUnknown implementation
00042
00043 //---------------------------------------------------------------------------
00044 STDMETHODIMP CDataObject::QueryInterface
00045 (
00046   REFIID   riid,
00047   LPVOID*  ppv
00048 )
00049 {
00050   if( !ppv )
00051     return E_FAIL;
00052
00053   HRESULT hResult = E_NOINTERFACE;
00054   *ppv = NULL;
00055
00056   if( IsEqualIID(riid, IID_IUnknown) )
00057     *ppv = static_cast<IDataObject*>(this);
00058   else if( IsEqualIID(riid, IID_IDataObject) )
00059     *ppv = static_cast<IDataObject*>(this);
00060
00061   if( *ppv )
00062   {
00063     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00064     hResult = S_OK;
00065   }
00066
00067   return hResult;
00068 }
00069
00070 //---------------------------------------------------------------------------
00071 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00072 {
00073   return InterlockedIncrement((LONG*)&m_cRef);
00074 }
00075
00076 //---------------------------------------------------------------------------
00077 STDMETHODIMP_(ULONG) CDataObject::Release()
00078 {
00079   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00080   {
00081     delete this;
00082     return 0;
00083   }
00084   return m_cRef;
00085 }
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 // IDataObject implementation
00089 //
00090
00091 //---------------------------------------------------------------------------
00092 //  MMC will call GetDataHere() for it's required clipboard formats
00093 //
00094 HRESULT CDataObject::GetDataHere
00095 (
00096   FORMATETC *pFormatEtc,     //[in]  Pointer to the FORMATETC structure
00097   STGMEDIUM *pMedium         //[out] Pointer to the STGMEDIUM structure
00098 )
00099 {
00100   const CLIPFORMAT cf = pFormatEtc->cfFormat;
00101   IStream* ipStream = NULL;
00102
00103   HRESULT hResult = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &ipStream );
00104   if( S_OK != hResult )
00105     return hResult;                        // Minimal error checking
00106
00107   hResult = DV_E_FORMATETC;                // Unknown format
00108
00109   if( cf == g_cfDisplayName )
00110   {
00111     hResult = RetrieveDisplayString( ipStream );
00112   }
00113   else if( cf == g_cfSnapinClsid )
00114   {
00115     hResult = RetrieveSnapInClassID( ipStream );
00116   }
00117   else if( cf == g_cfNodeType )
00118   {
00119     hResult = RetrieveNodeTypeGuid( ipStream );
00120   }
00121   else if( cf == g_cfszNodeType )
00122   {
00123     hResult = RetrieveGuidString( ipStream );
00124   }
00125   else if( cf == g_cfBaseNodePtr )
00126   {
00127     hResult = RetrieveBaseNodePtr( ipStream );
00128   }
00129   else if( cf == g_cfDataObjPtr )
00130   {
00131     hResult = RetrieveDataObjPtr( ipStream );
00132   }
00133
00134   ipStream->Release();
00135
00136   return hResult;
00137 }
00138
00139 //---------------------------------------------------------------------------
00140 VOID CDataObject::SetPrivateData
00141 (
00142   LONG_PTR uCookie,      //[in] Pointer to node this object represents
00143   ULONG    uContext      //[in] Context of the node
00144 )
00145 {
00146   m_uCookie  = uCookie;
00147   m_uContext = uContext;
00148 }
00149
00150 /////////////////////////////////////////////////////////////////////////////
00151 //  Handlers for MMC's required clipboard formats
00152
00153
00154 //---------------------------------------------------------------------------
00155 // CCF_DISPLAY_NAME is one of the required clipformats.
00156 // MMC askes for this string to display the name of the SnapIn's StaticNode
00157 // in the ScopePane
00158 //
00159 HRESULT CDataObject::RetrieveDisplayString
00160 (
00161   IStream* ipStream        //[in][out] Stream to return our data in.
00162 )
00163 {
00164   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00165   LPWSTR pNodeName = pNode->GetNodeName();
00166
00167   ULONG ulSizeofName = (wcslen(pNodeName) + 1) * sizeof(WCHAR);
00168   return ipStream->Write(pNodeName, ulSizeofName, NULL);
00169
00170 }
00171
00172 //---------------------------------------------------------------------------
00173 //  CCF_SNAPIN_CLASSID is one of the required clipformats.
00174 //  MMC will ask for this data.  This ClassID which we return represents
00175 //  the COM object which is the entry point for our SnapIn
00176 //
00177 HRESULT CDataObject::RetrieveSnapInClassID
00178 (
00179   IStream* ipStream        //[in][out] Stream to return our data in.
00180 )
00181 {
00182   return ipStream->Write( &CLSID_CComponentData, sizeof(GUID), NULL );
00183 }
00184
00185
00186 //---------------------------------------------------------------------------
00187 //  CCF_NODETYPE is one of the required clipformats.
00188 //  MMC needs the NodeType GUID to determine what extensions to activate
00189 //  for a node.  It looks under the MMC/NodeTypes registry key for the GUID
00190 //  and enumerates the extensions found beneath it.  MMC uses this GUID
00191 //  strictly as a uniquie identifier.  It does not expect it to correspond
00192 //  to the ClaseID of a com object.
00193 //
00194 HRESULT CDataObject::RetrieveNodeTypeGuid
00195 (
00196   IStream* ipStream        //[in][out] Stream to return our data in.
00197 )
00198 {
00199   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00200   GUID* pGuid = (GUID*)&pNode->GetNodeGUID();
00201
00202   return ipStream->Write( (void*)pGuid, sizeof(GUID), NULL );
00203 }
00204
00205
00206 //---------------------------------------------------------------------------
00207 //  CCF_SZNODETYPE is a required clipboard format.
00208 //  We return the node's GUID as a wide string.
00209 //
00210 HRESULT CDataObject::RetrieveGuidString
00211 (
00212   IStream* ipStream        //[in][out] Stream to return our data in.
00213 )
00214 {
00215   LPOLESTR pszGUID;
00216   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00217
00218   HRESULT  hResult = StringFromCLSID( pNode->GetNodeGUID(), &pszGUID );
00219   if( S_OK == hResult )
00220   {
00221     hResult = ipStream->Write( pszGUID, (wcslen(pszGUID) + 1) * sizeof(WCHAR), NULL );
00222     CoTaskMemFree( pszGUID );
00223   }
00224
00225   return hResult;
00226 }
00227
00228 //---------------------------------------------------------------------------
00229 HRESULT CDataObject::RetrieveBaseNodePtr
00230 (
00231   IStream* ipStream        //[in][out] Stream to return our data in.
00232 )
00233 {
00234   LPBASENODE pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00235   return ipStream->Write( &pNode, sizeof(LPBASENODE), NULL );
00236 }
00237
00238 //---------------------------------------------------------------------------
00239 HRESULT CDataObject::RetrieveDataObjPtr
00240 (
00241   IStream* ipStream        //[in][out] Stream to return our data in.
00242 )
00243 {
00244   CDataObject* pThis = this;
00245   return ipStream->Write( &pThis, sizeof(CDataObject*), NULL );
00246 }
00247
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/basenode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

basenode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Generic base node class.  All nodes are derived from this.
00014
00015
00016 #ifndef _CLASS_CBASENODE_
00017 #define _CLASS_CBASENODE_
00018
00019 #include "Globals.h"
00020 #include "Resource.h"
00021
00022
00023 #define DEFAULT_SDI_MASK  (SDI_STR | SDI_PARAM | SDI_IMAGE | SDI_OPENIMAGE | SDI_PARENT | SDI_CHILDREN)
00024 #define DEFAULT_RDI_MASK  (RDI_STR | RDI_PARAM | RDI_IMAGE)
00025
00026 #define MAX_NAME_LEN     64
00027
00028
00029 class CBaseNode;             // References
00030
00031
00032 //---------------------------------------------------------------------------
00033 //  Data types specific to this object
00034 //
00035 typedef struct tag_BASENODE_PROPERTIES
00036 {
00037   WCHAR      szNodeName[MAX_NAME_LEN];
00038   LONG_PTR   pComponentData;
00039   LONG_PTR   pParentObject;
00040   DWORD      dwAttributes;
00041
00042 }NODE_PROPERTIES;
00043
00044
00045 typedef NODE_PROPERTIES*  LPNODE_PROPERTIES;
00046 typedef CBaseNode*        LPBASENODE;
00047
00048
00049 //---------------------------------------------------------------------------
00050 class CBaseNode
00051 {
00052   public:
00053     CBaseNode()
00054     {
00055       m_pwszNodeName      = NULL;
00056
00057       ZeroMemory( &m_SDI, sizeof(SCOPEDATAITEM) );
00058       ZeroMemory( &m_RDI, sizeof(RESULTDATAITEM) );
00059     };
00060
00061     virtual ~CBaseNode()
00062     {
00063       if( NULL != m_pwszNodeName )
00064         CoTaskMemFree( m_pwszNodeName );
00065     };
00066
00067   public:
00068     LPWSTR   GetNodeName()     { return m_pwszNodeName;  };
00069
00070     virtual  HRESULT Initialize( NODE_PROPERTIES* pProperties ) = 0;
00071     virtual  ULONG   GetNodeType() = 0;
00072     virtual  GUID&   GetNodeGUID() = 0;
00073     virtual  HRESULT GetProperty( BSTR szPropertyName, PBSTR pbstrProperty ) = 0;
00074
00075
00076   ///////////////////////////////////////////////////////////////////////////
00077   // These virtual methods handle calls from the console
00078   //
00079   public:
00080     virtual  HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI ) = 0;
00081     virtual  HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI ) = 0;
00082     virtual  HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo ) = 0;
00083
00084   ///////////////////////////////////////////////////////////////////////////
00085   // Context Menu methods
00086   //
00087   public:
00088     virtual  HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed ) = 0;
00089     virtual  HRESULT Command( long lCommandID ) = 0;
00090
00091   ///////////////////////////////////////////////////////////////////////////
00092   // These virtual methods handle notifications
00093   //
00094   public:
00095     virtual  HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent ) = 0;
00096     virtual  HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent ) = 0;
00097     virtual  HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData ) = 0;
00098     virtual  HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData ) = 0;
00099     virtual  HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent ) = 0;
00100     virtual  HRESULT OnDelete( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent ) = 0;
00101
00102     virtual  HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent ) = 0;
00103
00104   public:
00105     SCOPEDATAITEM    m_SDI;
00106     RESULTDATAITEM   m_RDI;
00107
00108   protected:
00109     LPWSTR     m_pwszNodeName;
00110
00111 }; //end class CBaseNode
00112
00113 #endif //_CLASS_CBASENODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBicycleFolder Member List

This is the complete list of members for CBicycleFolder, including all inherited members.
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
bExpanded | CDelegationBase | [protected]
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CBicycleFolder() | CBicycleFolder |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
children | CBicycleFolder | [private]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
DisplayChildren(void) | CBicycleFolder | [private]
EmptyChildren(void) | CBicycleFolder | [private]
EnumChildren(IWbemServices *service) | CBicycleFolder | [private]
ErrorString(HRESULT hr, TCHAR *errMsg, UINT errSize) | CBicycleFolder | [private]
Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetBitmapIndex() | CBicycleFolder | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycleFolder | [inline, virtual]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CBicycleFolder | [virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
getNodeType() | CBicycleFolder | [inline, virtual]
GetParentScopeItem() | CBicycleFolder | [inline, virtual]
GetPtr(IWbemServices **ptr) | CBicycleFolder |
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CBicycleFolder | [virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CBicycleFolder | [virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CBicycleFolder | [virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CBicycleFolder | [virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CBicycleFolder | [virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
m_children | CBicycleFolder | [private]
m_connectHwnd | CBicycleFolder | [private]
m_critSect | CBicycleFolder | [private]
m_doWork | CBicycleFolder | [private]
m_hParentHScopeItem | CBicycleFolder | [private]
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pComponentData | CDelegationBase |
m_pResultData | CBicycleFolder | [private]
m_pStream | CBicycleFolder | [private]
m_pStubSink | CBicycleFolder | [private]
m_ptrReady | CBicycleFolder | [private]
m_pUnsecApp | CBicycleFolder | [private]
m_realWMI | CBicycleFolder | [private]
m_running | CBicycleFolder | [private]
m_thread | CBicycleFolder | [private]
m_threadCmd | CBicycleFolder | [private]
m_threadId | CBicycleFolder | [private]
NUMBER_OF_CHILDREN enum value | CBicycleFolder | [private]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CBicycleFolder | [virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CBicycleFolder | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
RegisterEventSink(IWbemServices *service) | CBicycleFolder | [private]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CBicycleFolder | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
StopThread() | CBicycleFolder | [private]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CBicycleFolder | [virtual]
thisGuid | CBicycleFolder | [private, static]
ThreadProc(LPVOID lpParameter) | CBicycleFolder | [private, static]
WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBicycleFolder | [private, static]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CBicycleFolder() | CBicycleFolder | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/CConf.h Source File

  • Web
  • NetMeeting
  • NMFT

CConf.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMFT.EXE
00003 //  File:       CCONF.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 //****************************************************************************
00017 //
00018 // CLASS CFtNotify
00019 //
00020 //****************************************************************************
00021
00022 class CFtNotify : public RefCount, public CNotify, public INmChannelFtNotify
00023 {
00024 public:
00025   CFtNotify();
00026   ~CFtNotify();
00027
00028   // INmChannelNotify
00029   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00030   HRESULT STDMETHODCALLTYPE MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember * pMember);
00031
00032   // INmChannelFtNotify
00033   HRESULT STDMETHODCALLTYPE FtUpdate(CONFN uNotify, INmFt *pFt);
00034
00035   // ICNotify methods
00036   HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00037   HRESULT STDMETHODCALLTYPE Disconnect(void);
00038
00039   // IUnknown methods
00040   ULONG STDMETHODCALLTYPE AddRef(void);
00041   ULONG STDMETHODCALLTYPE Release(void);
00042   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
00043 };
00044
00045
00046 //****************************************************************************
00047 //
00048 // Global Variables
00049 //
00050 //****************************************************************************
00051
00052 extern INmManager    * g_pMgr;
00053 extern INmConference * g_pConference;
00054 extern INmChannelFt  * g_pChannelFt;
00055 extern CFtNotify     * g_pNotifyFt;
00056 extern INmMember     * g_pMember;
00057 extern INmFt         * g_pFt;
00058
00059
00060 //****************************************************************************
00061 //
00062 // Global Functions
00063 //
00064 //****************************************************************************
00065
00066 BOOL FInitNm(void);
00067 VOID FreeNmObjects(void);
00068 HRESULT SendFile(void);
00069
00070
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CContext Member List

This is the complete list of members for CContext, including all inherited members.
Application() | CContext | [inline]
get_All enum value | CContext |
get_Application enum value | CContext |
get_Request enum value | CContext |
get_Response enum value | CContext |
get_Server enum value | CContext |
get_Session enum value | CContext |
GetServerObject(IGetContextProperties *, BSTR, const IID &, void **) | CContext | [static]
Init(DWORD) | CContext |
m_piApplication | CContext | [private]
m_piRequest | CContext | [private]
m_piResponse | CContext | [private]
m_piServer | CContext | [private]
m_piSession | CContext | [private]
Request() | CContext | [inline]
Response() | CContext | [inline]
Server() | CContext | [inline]
Session() | CContext | [inline]
Generated on Wed Nov 13 2024 16:55:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFrameFormat Member List

This is the complete list of members for CFrameFormat, including all inherited members.
_fontChar | CBlockFormat |
_fontCode | CBlockFormat |
_fontHeader | CFrameFormat |
_fontLabel | CFrameFormat |
_fuFormat | CBlockFormat |
_size | CBlockFormat |
CBlockFormat() | CBlockFormat | [protected]
CFrameFormat() | CFrameFormat | [protected]
Generated on Wed Nov 13 2024 16:56:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStream Member List

This is the complete list of members for CStream, including all inherited members.
Abort(HCHAPTER hChapter, DBASYNCHOP eOperation) | CAsynchBase | [virtual]
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CStream | [virtual]
AutoRelease() | CStream | [virtual]
CAsynchBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CAsynchBase |
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CBaseObj(EBaseObjectType botVal) | CBaseObj | [protected]
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CImpIGetSourceRow class | CStream | [friend]
CImpIStream class | CStream | [friend]
Clone(IStream **ppStream) | CStream | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CStream(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CStream |
CStream(LPUNKNOWN) | CStream |
DisplayObject() | CStream | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
FInit(CRow *, ROWBUFF *) | CStream |
GetBaseObjectType() | CBaseObj | [inline]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CStream | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CStream | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CStream | [inline, virtual]
GetObjectMenu() | CStream | [inline, virtual]
GetObjectName() | CStream | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetOuterUnknown() | CBaseObj | [inline]
GetParent(SOURCE eSource) | CBase | [virtual]
GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase, LPOLESTR *ppwszStatusText) | CAsynchBase | [virtual]
Initialize() | CAsynchBase | [virtual]
IsInitialized() | CAsynchBase | [inline, virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cMaxSize | CStream | [protected]
m_cRef | CStream | [protected]
m_dwCLSCTX | CBase |
m_dwCookieAsynchNotify | CAsynchBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_fInitialized | CAsynchBase |
m_guidSource | CBase |
m_hTreeItem | CBase |
m_iPos | CStream | [protected]
m_pBuffer | CStream | [protected]
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIConnectionPointContainer | CContainerBase |
m_pIDBAsynchStatus | CAsynchBase |
m_pIDBInitialize | CAsynchBase |
m_pIGetSourceRow | CStream | [protected]
m_pILockBytes | CStream |
m_pISequentialStream | CStream |
m_pIService | CBase |
m_pIStorage | CStream |
m_pIStream | CStream |
m_pIStream | CStream | [protected]
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_pParentObj | CStream | [protected]
m_pUnkOuter | CBaseObj | [protected]
m_strObjectDesc | CBase | [protected]
m_wType | CStream |
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CStream | [virtual]
QueryInterface(REFIID, LPVOID *) | CStream |
CAsynchBase::QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReadBytes(REFIID riid, DBLENGTH ulOffset, DBLENGTH cBytes, DBLENGTH cbMaxSize, void *pBuffer, DBLENGTH *pcbRead=NULL) | CStream | [virtual]
ReadString(REFIID riid, DBLENGTH ulOffset, DBLENGTH cBytes, DBLENGTH ulMaxSize, WCHAR *pwszBuffer, DBLENGTH *pcbRead=NULL) | CStream | [virtual]
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) | CStream | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
Stat(STATSTG *pSTATSTG) | CStream | [virtual]
STDMETHODIMP_(ULONG) AddRef(void) | CStream |
STDMETHODIMP_(ULONG) Release(void) | CStream |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
Uninitialize() | CAsynchBase | [virtual]
WriteBytes(REFIID riid, DBLENGTH ulOffset, DBLENGTH cBytes, void *pBuffer, DBLENGTH *pcbWritten=NULL) | CStream | [virtual]
WriteString(REFIID riid, DBLENGTH ulOffset, DBLENGTH cBytes, WCHAR *pwszBuffer, DBLENGTH *pcbWritten=NULL) | CStream | [virtual]
~CAsynchBase() | CAsynchBase | [virtual]
~CBase() | CBase | [virtual]
~CBaseObj() | CBaseObj | [virtual]
~CContainerBase() | CContainerBase | [virtual]
~CStream() | CStream | [virtual]
~CStream(void) | CStream |
Generated on Wed Nov 13 2024 16:57:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcADO/StdAfx.Cpp Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcADO

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/about.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

about.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     This class implements ISnapinAbout
00014
00015
00016
00017 #ifndef _CLASS_CSNAPINABOUT_
00018 #define _CLASS_CSNAPINABOUT_
00019
00020 #include <mmc.h>
00021
00022
00023 //---------------------------------------------------------------------------
00024 class CSnapinAbout : public ISnapinAbout
00025 {
00026   private:
00027     ULONG       m_cRef;
00028     HBITMAP     m_hSmallImage;
00029     HBITMAP     m_hLargeImage;
00030     HBITMAP     m_hOpenImage;
00031     HICON       m_hAppIcon;
00032
00033   public:
00034     CSnapinAbout();
00035     ~CSnapinAbout();
00036
00037     /////////////////////////////////////////////////////////////////////////
00038     // Interface IUnknown
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     /////////////////////////////////////////////////////////////////////////
00044     // Interface ISnapinAbout
00045     STDMETHODIMP GetSnapinDescription(/*[out]*/ LPOLESTR* pszDescription );
00046
00047     STDMETHODIMP GetProvider(/*[out]*/ LPOLESTR* pszProvider );
00048
00049     STDMETHODIMP GetSnapinVersion(/*[out]*/ LPOLESTR* pszVersion);
00050
00051     STDMETHODIMP GetSnapinImage(/*[out]*/ HICON* hAppIcon );
00052
00053     STDMETHODIMP GetStaticFolderImage
00054                  (/*[out]*/ HBITMAP*  hSmallImage,
00055                   /*[out]*/ HBITMAP*  hOpenImage,
00056                   /*[out]*/ HBITMAP*  hLargeImage,
00057                   /*[out]*/ COLORREF* cMask
00058                  );
00059 };
00060
00061 #endif _CLASS_CSNAPINABOUT_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/iphdrinc/resolve.h Source File

  • NetDS
  • WinSock
  • iphdrinc

resolve.h

Go to the documentation of this file.
00001 //
00002 // This file contains function prototypes for resolve.cpp
00003 //
00004 // Description:
00005 //    These are common routines for resolving and printing IPv4 and IPv6
00006 //    addresses.
00007 //
00008 // NOTE:
00009 //    From Network Programming for Microsoft Windows, Second Edition
00010 //    by Anthony Jones and James Ohlund.  Copyright 2002.
00011 //    Reproduced by permission of Microsoft Press.  All rights reserved.
00012 //
00013 #ifndef _RESOLVE_H_
00014 #define _RESOLVE_H_
00015
00016 #ifdef _cplusplus
00017 extern "C" {
00018 #endif
00019
00020 int              PrintAddress(SOCKADDR *sa, int salen);
00021 int              FormatAddress(SOCKADDR *sa, int salen, char *addrbuf, int addrbuflen);
00022 int              ReverseLookup(SOCKADDR *sa, int salen, char *namebuf, int namebuflen);
00023 struct addrinfo *ResolveAddress(char *addr, char *port, int af, int type, int proto);
00024
00025 #ifdef _cplusplus
00026 }
00027 #endif
00028
00029 #endif
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/File Share SampleEx.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

File Share SampleEx.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      File Share SampleEx.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the CFileShareSampleApp class and DLL initialization
00010 //      routines.
00011 //
00012 //  Author:
00013 //      <name> (<e-mail name>) Mmmm DD, 2003
00014 //
00015 //  Revision History:
00016 //
00017 //  Notes:
00018 //
00019 /////////////////////////////////////////////////////////////////////////////
00020
00021 #include "stdafx.h"
00022
00023 #pragma warning( push )
00024 #include <initguid.h>
00025 #include <CluAdmEx.h>
00026 #pragma warning( pop )
00027
00028 #include "File Share SampleEx.h"
00029 #include "ExtObj.h"
00030 #include "BasePage.h"
00031 #include "RegExt.h"
00032
00033 #ifdef _DEBUG
00034 #define new DEBUG_NEW
00035 #undef THIS_FILE
00036 static char THIS_FILE[] = __FILE__;
00037 #endif
00038
00039 CComModule _Module;
00040
00041 BEGIN_OBJECT_MAP( ObjectMap )
00042     OBJECT_ENTRY( CLSID_CoFileShareSampleEx, CExtObject )
00043 END_OBJECT_MAP()
00044
00045 /////////////////////////////////////////////////////////////////////////////
00046 // Global Function Prototypes
00047 /////////////////////////////////////////////////////////////////////////////
00048
00049 STDAPI
00050 DllCanUnloadNow( void );
00051
00052 STDAPI
00053 DllGetClassObject(
00054       REFCLSID  rclsidIn
00055     , REFIID    riidIn
00056     , LPVOID *  ppvOut
00057     );
00058
00059 STDAPI
00060 DllRegisterServer( void );
00061
00062 STDAPI
00063 DllUnregisterServer( void );
00064
00065 STDAPI
00066 DllRegisterCluAdminExtension(
00067     HCLUSTER hClusterIn
00068     );
00069
00070 STDAPI
00071 DllUnregisterCluAdminExtension(
00072     HCLUSTER hClusterIn
00073     );
00074
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // class CFileShareSampleApp
00078 /////////////////////////////////////////////////////////////////////////////
00079
00080 class CFileShareSampleApp : public CWinApp
00081 {
00082 public:
00083     virtual BOOL InitInstance();
00084     virtual int ExitInstance();
00085
00086 }; //*** class CFileShareSampleApp
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // The one and only CFileShareSampleApp object
00090
00091 CFileShareSampleApp theApp;
00092
00093 /////////////////////////////////////////////////////////////////////////////
00094 //++
00095 //
00096 //  CFileShareSampleApp::InitInstance
00097 //
00098 //  Description:
00099 //      Initialize this instance of the application.
00100 //
00101 //  Arguments:
00102 //      None.
00103 //
00104 //  Return Value:
00105 //      Any return codes from CWinApp::InitInstance().
00106 //
00107 //--
00108 /////////////////////////////////////////////////////////////////////////////
00109 BOOL
00110 CFileShareSampleApp::InitInstance( void )
00111 {
00112     _Module.Init( ObjectMap, m_hInstance );
00113
00114     return CWinApp::InitInstance();
00115
00116 }  //*** CFileShareSampleApp::InitInstance
00117
00118 /////////////////////////////////////////////////////////////////////////////
00119 //++
00120 //
00121 //  CFileShareSampleApp::ExitInstance
00122 //
00123 //  Description:
00124 //      Deinitialize this instance of the application.
00125 //
00126 //  Arguments:
00127 //      None.
00128 //
00129 //  Return Value:
00130 //      Any return codes from CWinApp::ExitInstance().
00131 //
00132 //--
00133 /////////////////////////////////////////////////////////////////////////////
00134 int
00135 CFileShareSampleApp::ExitInstance( void )
00136 {
00137     _Module.Term();
00138
00139     return CWinApp::ExitInstance();
00140
00141 }  //*** CFileShareSampleApp::ExitInstance
00142
00143 /////////////////////////////////////////////////////////////////////////////
00144 //++
00145 //
00146 //  FormatError
00147 //
00148 //  Description:
00149 //      Format an error.
00150 //
00151 //  Arguments:
00152 //      rstrError   String in which to return the error message.
00153 //      dwError     Error code to format.
00154 //
00155 //  Return Value:
00156 //      None.
00157 //
00158 //--
00159 /////////////////////////////////////////////////////////////////////////////
00160 void
00161 FormatError(
00162       CString & rstrErrorInout
00163     , DWORD     dwErrorIn
00164     )
00165 {
00166     DWORD   cch;
00167     TCHAR   szError[ 512 ];
00168
00169     //
00170     // Format the NT status code from CLUSAPI.  This is necessary
00171     // for the cases where cluster messages haven't been added to
00172     // the system message file yet.
00173     //
00174
00175     cch = FormatMessage(
00176                       FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS
00177                     , ::GetModuleHandle( _T( "CLUSAPI.DLL" ) )
00178                     , dwErrorIn
00179                     , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00180                     , szError
00181                     , RTL_NUMBER_OF( szError )
00182                     , 0
00183                     );
00184     if ( cch == 0 )
00185     {
00186         cch = FormatMessage(
00187                           FORMAT_MESSAGE_FROM_SYSTEM
00188                         , NULL
00189                         , dwErrorIn
00190                         , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00191                         , szError
00192                         , RTL_NUMBER_OF( szError )
00193                         , 0
00194                         );
00195         if ( cch == 0 )
00196         {
00197             //
00198             // Format the NT status code from NTDLL since this hasn't been
00199             // integrated into the system yet.
00200             //
00201
00202             cch = FormatMessage(
00203                               FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS
00204                             , ::GetModuleHandle( _T( "NTDLL.DLL" ) )
00205                             , dwErrorIn
00206                             , MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)
00207                             , szError
00208                             , RTL_NUMBER_OF( szError )
00209                             , 0
00210                             );
00211         }  // if:  error formatting status code from system
00212     }  // if:  error formatting status code from ClusApi
00213
00214     if ( cch > 0 )
00215     {
00216         rstrErrorInout = szError;
00217     }  // if:  no error
00218     else
00219     {
00220         TRACE( _T( "FormatError() - Error 0x%08.8x formatting string for error code 0x%08.8x\n" ), GetLastError(), dwErrorIn );
00221         rstrErrorInout.Format( _T( "Error 0x%08.8x" ), dwErrorIn );
00222     }  // else:  error formatting the message
00223
00224 }  //*** FormatError
00225
00226 /////////////////////////////////////////////////////////////////////////////
00227 //++
00228 //
00229 //  DllCanUnloadNow
00230 //
00231 //  Description:
00232 //      Used to determine whether the DLL can be unloaded by COM.
00233 //
00234 //  Arguments:
00235 //      None.
00236 //
00237 //  Return Value:
00238 //      S_OK
00239 //          Dll can be unloaded now.
00240 //
00241 //      S_FALSE
00242 //          Dll cannot be unloaded now...
00243 //
00244 //--
00245 /////////////////////////////////////////////////////////////////////////////
00246 STDAPI
00247 DllCanUnloadNow( void )
00248 {
00249     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00250
00251     return ( AfxDllCanUnloadNow() && _Module.GetLockCount() == 0 ) ? S_OK : S_FALSE;
00252
00253 }  //*** DllCanUnloadNow
00254
00255 /////////////////////////////////////////////////////////////////////////////
00256 //++
00257 //
00258 //  DllGetClassObject
00259 //
00260 //  Description:
00261 //      Returns a class factory to create an object of the requested type
00262 //
00263 //  Arguments:
00264 //      rclsidIn    - CLSID of the class to create.
00265 //      riidIn      - Requested interface of the class.
00266 //      ppvOut      - Pointer to send the class back to the caller.
00267 //
00268 //  Return Value:
00269 //      S_OK
00270 //          Success.
00271 //
00272 //      Other errors as HRESULTs...
00273 //
00274 //--
00275 /////////////////////////////////////////////////////////////////////////////
00276 STDAPI
00277 DllGetClassObject(
00278       REFCLSID  rclsidIn
00279     , REFIID    riidIn
00280     , LPVOID *  ppvOut
00281     )
00282 {
00283     return _Module.GetClassObject( rclsidIn, riidIn, ppvOut );
00284
00285 }  //*** DllGetClassObject
00286
00287 /////////////////////////////////////////////////////////////////////////////
00288 //++
00289 //
00290 //  DllRegisterServer
00291 //
00292 //  Description:
00293 //      Perform all relevant COM registration for this component.
00294 //
00295 //  Arguments:
00296 //      None.
00297 //
00298 //  Return Value:
00299 //      S_OK
00300 //          Success.
00301 //
00302 //      Other errors as HRESULTs...
00303 //
00304 //--
00305 /////////////////////////////////////////////////////////////////////////////
00306 STDAPI
00307 DllRegisterServer( void )
00308 {
00309     HRESULT hr = S_OK;
00310
00311     //
00312     //  Registers object, typelib and all interfaces in typelib
00313     //
00314
00315     hr = _Module.RegisterServer( FALSE /*bRegTypeLib*/ );
00316
00317     return hr;
00318
00319 }  //*** DllRegisterServer
00320
00321 /////////////////////////////////////////////////////////////////////////////
00322 //++
00323 //
00324 //  DllRegisterServer
00325 //
00326 //  Description:
00327 //      Perform all relevant COM un-registration for this component.
00328 //
00329 //  Arguments:
00330 //      None.
00331 //
00332 //  Return Value:
00333 //      S_OK
00334 //          Success.
00335 //
00336 //      Other errors as HRESULTs...
00337 //
00338 //--
00339 /////////////////////////////////////////////////////////////////////////////
00340 STDAPI
00341 DllUnregisterServer( void )
00342 {
00343     HRESULT hr = S_OK;
00344
00345     hr = _Module.UnregisterServer();
00346
00347     return hr;
00348
00349 }  //*** DllUnregisterServer
00350
00351 /////////////////////////////////////////////////////////////////////////////
00352 //++
00353 //
00354 //  DllRegisterCluAdminExtension
00355 //
00356 //  Description:
00357 //      Register the extension with the cluster database.
00358 //
00359 //  Arguments:
00360 //      hClusterIn      Handle to the cluster to modify.
00361 //
00362 //  Return Value:
00363 //      S_OK            Extension registered successfully.
00364 //      Win32 error code if another failure occurred.
00365 //
00366 //--
00367 /////////////////////////////////////////////////////////////////////////////
00368 STDAPI
00369 DllRegisterCluAdminExtension(
00370     HCLUSTER hClusterIn
00371     )
00372 {
00373     DWORD       sc = ERROR_SUCCESS;
00374     DWORD       scTemp = ERROR_SUCCESS;
00375     LPCWSTR     pwszResTypes = g_wszResourceTypeNames;
00376
00377     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00378
00379     //
00380     // Register to extend our resource type(s).
00381     //
00382
00383     while ( *pwszResTypes != L'\0' )
00384     {
00385         wprintf( L"  %s\n", pwszResTypes );
00386         scTemp = RegisterCluAdminResourceTypeExtension(
00387                       hClusterIn
00388                     , pwszResTypes
00389                     , &CLSID_CoFileShareSampleEx
00390                     );
00391         if ( scTemp != ERROR_SUCCESS )
00392         {
00393             sc = scTemp;
00394         } // if:  error registering the extension
00395
00396         pwszResTypes += lstrlenW( pwszResTypes ) + 1;
00397     }  // while:  more resource types
00398
00399     if ( sc != ERROR_SUCCESS )
00400     {
00401         goto Cleanup;
00402     } // if:
00403
00404 Cleanup:
00405
00406     return HRESULT_FROM_WIN32( sc );
00407
00408 }  //*** DllRegisterCluAdminExtension
00409
00410 /////////////////////////////////////////////////////////////////////////////
00411 //++
00412 //
00413 //  DllUnregisterCluAdminExtension
00414 //
00415 //  Description:
00416 //      Unregister the extension with the cluster database.
00417 //
00418 //  Arguments:
00419 //      hClusterIn      Handle to the cluster to modify.
00420 //
00421 //  Return Value:
00422 //      S_OK            Extension unregistered successfully.
00423 //      Win32 error code if another failure occurred.
00424 //
00425 //--
00426 /////////////////////////////////////////////////////////////////////////////
00427 STDAPI
00428 DllUnregisterCluAdminExtension(
00429     HCLUSTER hClusterIn
00430     )
00431 {
00432     DWORD       sc = ERROR_SUCCESS;
00433     DWORD       scTemp = ERROR_SUCCESS;
00434     LPCWSTR     pwszResTypes = g_wszResourceTypeNames;
00435
00436     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00437
00438
00439     //
00440     // Unregister to extend our resource type(s).
00441     //
00442
00443     while ( *pwszResTypes != L'\0' )
00444     {
00445         wprintf( L"  %s\n", pwszResTypes );
00446         scTemp = UnregisterCluAdminResourceTypeExtension(
00447                       hClusterIn
00448                     , pwszResTypes
00449                     , &CLSID_CoFileShareSampleEx
00450                     );
00451         if ( scTemp != ERROR_SUCCESS )
00452         {
00453             sc = scTemp;
00454         } // if:  error unregistering the extension
00455
00456         pwszResTypes += lstrlenW( pwszResTypes ) + 1;
00457     }  // while:  more resource types
00458
00459     if ( sc != ERROR_SUCCESS )
00460     {
00461         goto Cleanup;
00462     } // if:
00463
00464 Cleanup:
00465
00466     return HRESULT_FROM_WIN32( sc );
00467
00468 }  //*** DllUnregisterCluAdminExtension
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Except.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

Except.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       Except.cxx
00006 //
00007 //  Contents:   Conversion to Ole errors
00008 //
00009 //----------------------------------------------------------------------------
00010
00011 #include <pch.cxx>
00012 #pragma hdrstop
00013
00014 typedef LONG NTSTATUS;
00015
00016 //+-------------------------------------------------------------------------
00017 //
00018 //  Method:     IsOleError, public
00019 //
00020 //  Synopsis:   return TRUE if sc looks like an OLE SCODE.
00021 //
00022 //--------------------------------------------------------------------------
00023
00024 inline BOOL IsOleError (NTSTATUS sc)
00025 {
00026     return ((sc & 0xFFF00000) == 0x80000000) ||
00027            (SUCCEEDED(sc) && (sc & 0xFFFFF000) != 0);
00028 }
00029
00030 //+-------------------------------------------------------------------------
00031 //
00032 //  Method:     GetOleError, public
00033 //
00034 //  Purpose:    Converts a status code to an Ole error code, because interfaces
00035 //              return Ole error code only.
00036 //
00037 //--------------------------------------------------------------------------
00038
00039 SCODE GetOleError(CException & e)
00040 {
00041     NTSTATUS scError = e.GetErrorCode();
00042
00043     if (IsOleError(scError))
00044     {
00045         return scError;
00046     }
00047     else if ( STATUS_NO_MEMORY == scError )
00048     {
00049         return E_OUTOFMEMORY;
00050     }
00051     else
00052     {
00053         return E_FAIL;
00054     }
00055 }
00056
00057 void _cdecl SystemExceptionTranslator( unsigned int uiWhat,
00058                                        struct _EXCEPTION_POINTERS * pexcept )
00059 {
00060     throw CException( uiWhat ) ;
00061 }
00062
00063
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/cMemb.h Source File

  • Web
  • NetMeeting
  • NMUI

cMemb.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CMEMB.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 typedef struct tagUser {
00017   INmMember * pMember;
00018   int    iItem;
00019   ULONG  uId;
00020   LPTSTR pszName;
00021   LPTSTR pszAddr;
00022   NM_ADDR_TYPE uType;
00023   ULONG  uVersion;
00024   ULONG  uchCaps;
00025   BOOL   fLocal;
00026   BOOL   fMcu;
00027   BOOL   fTop;
00028   INmChannelAudio * m_pChannelAudio;
00029   INmChannelAppShare * m_pChannelAs;
00030   INmChannelFt       * m_pChannelFt;
00031   INmChannelData   * m_pChannelData;
00032 } USER;
00033 typedef USER * PUSER;
00034
00035 // from cMemb.cpp
00036 VOID AddMember(INmMember * pMember);
00037 VOID RemoveMember(INmMember * pMember);
00038 VOID FreeAllUsers(void);
00039 VOID FreeUser(PUSER pUser);
00040 PUSER PUserFromINmMember(INmMember * pMember);
00041 VOID UpdateUserChannel(PUSER pUser, INmChannel * pChannel, NM_MEMBER_NOTIFY uNotify);
00042 PUSER PUserLocal();
00043
00044 // from dlg.cpp
00045 VOID AddUserToUList(PUSER pUser, HWND hwndCombo, BOOL fEveryone);
00046 VOID RemoveUserFromUList(PUSER pUser, HWND hwndCombo);
00047 VOID UpdateConfView(void);
00048
00049 extern COBLIST * g_pListUser;
00050
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/ViewDIB/ViewDIB.c Source File

  • Multimedia
  • Gdi
  • ViewDIB

ViewDIB.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *                                         *
00003  *       THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF   *
00004  *       ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED    *
00005  *       TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A   *
00006  *       PARTICULAR PURPOSE.                                                 *
00007  *                                                                           *
00008  *       Copyright (C) 2000  Microsoft Corporation.  All rights reserved.    *
00009  *                                                                           *
00010  ****************************************************************************/
00011
00012 /*****************************************************************************
00013  *                                                                           *
00014  *   PROGRAM: ViewDIB.c                                                      *
00015  *                                                                           *
00016  *   PURPOSE: Demonstrate how to load, save, convert, display, and print     *
00017  *            DIB Sections                                                   *
00018  *                                                                           *
00019  *   FUNCTIONS:                                                              *
00020  *                                                                           *
00021  *   GetLastErrorBox() - Report GetLastError() values as text                *
00022  *   InitApplication() - initializes window data and registers window        *
00023  *   InitInstance() - saves instance handle and creates main window          *
00024  *   WinMain() - calls initialization function, processes message loop       *
00025  *   SetWindowTitle() - Sets the title text for the main window              *
00026  *   PrintDIBSection() - Prints a DIB section to a user selected printer     *
00027  *   WndProc() - processes messages                                          *
00028  *   About() - processes messages for "About" dialog box                     *
00029  *                                                                           *
00030  ****************************************************************************/
00031
00032 #include <windows.h>   // required for all Windows applications
00033 #include <stdio.h>
00034 #include <commdlg.h>
00035 #include "DIBSectn.h"  // library of DIB Section manipulation functions
00036 #include "OpenDIB.h"   // contains code for reading a DIB file name w/preview
00037 #include "resource.h"  // specific to this program
00038
00039 HINSTANCE hInst;          // current instance
00040
00041 char szAppName[] = "ViewDIB";   // The name of this application
00042 char szTitle[]   = "ViewDIB: DIB Section Demo"; // The title bar text
00043
00044 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00045 LRESULT CALLBACK About  (HWND, UINT, WPARAM, LPARAM);
00046
00047 /*****************************************************************************
00048  *                                                                           *
00049  * FUNCTION:  GetLastErrorBox(HWND, LPSTR)                                   *
00050  *                                                                           *
00051  * PURPOSE:   Gets the error status and, if an error is indicated,           *
00052  *            converts the error number into text and displays it            *
00053  *            in a MessageBox.                                               *
00054  *                                                                           *
00055  ****************************************************************************/
00056 DWORD GetLastErrorBox(HWND hWnd, LPSTR lpTitle)
00057 {
00058    LPVOID lpv;
00059    DWORD  dwRv;
00060
00061    if (GetLastError() == 0) return 0;
00062
00063    dwRv = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
00064                         FORMAT_MESSAGE_FROM_SYSTEM,
00065                         NULL,
00066                         GetLastError(),
00067                         MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
00068                         (LPVOID)&lpv,
00069                         0,
00070                         NULL);
00071
00072    MessageBox(hWnd, lpv, lpTitle, MB_OK);
00073
00074    if(dwRv)
00075       LocalFree(lpv);
00076
00077    SetLastError(0);
00078    return dwRv;
00079 }
00080
00081 /*****************************************************************************
00082  *                                                                           *
00083  *  FUNCTION: InitApplication(HINSTANCE)                                     *
00084  *                                                                           *
00085  *  PURPOSE: Initializes window data and registers window class              *
00086  *                                                                           *
00087  *  COMMENTS:                                                                *
00088  *                                                                           *
00089  *    This function is called at initialization time only if no other        *
00090  *    instances of the application are running.  This function performs      *
00091  *    initialization tasks that can be done once for any number of running   *
00092  *    instances.                                                             *
00093  *                                                                           *
00094  *    In this case, we initialize a window class by filling out a data       *
00095  *    structure of type WNDCLASS and calling the Windows RegisterClass()     *
00096  *    function.  Since all instances of this application use the same window *
00097  *    class, we only need to do this when the first instance is initialized. *
00098  *                                                                           *
00099  *****************************************************************************/
00100
00101 BOOL InitApplication(HINSTANCE hInstance)
00102 {
00103     WNDCLASS  wc;
00104
00105     // Fill in window class structure with parameters that describe the
00106     // main window.
00107
00108     wc.style         = CS_VREDRAW | CS_HREDRAW;  // Class style(s).
00109     wc.lpfnWndProc   = (WNDPROC)WndProc;       // Window Procedure
00110     wc.cbClsExtra    = 0;                      // No per-class extra data.
00111     wc.cbWndExtra    = 0;                      // No per-window extra data.
00112     wc.hInstance     = hInstance;              // Owner of this class
00113     wc.hIcon         = LoadIcon (hInstance, "VD_ICON"); // Icon name from .RC
00114     wc.hCursor       = LoadCursor(NULL, IDC_ARROW); // Cursor
00115     wc.hbrBackground = GetStockObject(NULL_BRUSH);
00116     wc.lpszMenuName  = "VD_MENU";              // Menu name from .RC
00117     wc.lpszClassName = szAppName;              // Name to register as
00118
00119     // Register the window class and return success/failure code.
00120     return (RegisterClass(&wc));
00121 }
00122
00123
00124 /*****************************************************************************
00125  *                                                                           *
00126  *   FUNCTION:  InitInstance(HINSTANCE, int)                                 *
00127  *                                                                           *
00128  *   PURPOSE:  Saves instance handle and creates main window                 *
00129  *                                                                           *
00130  *   COMMENTS:                                                               *
00131  *                                                                           *
00132  *      This function is called at initialization time for every instance of *
00133  *      this application.  This function performs initialization tasks that  *
00134  *      cannot be shared by multiple instances.                              *
00135  *                                                                           *
00136  *      In this case, we save the instance handle in a static variable and   *
00137  *      create and display the main program window.                          *
00138  *                                                                           *
00139  ****************************************************************************/
00140 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
00141 {
00142     HWND            hWnd; // Main window handle.
00143
00144     // Save the instance handle in static variable, which will be used in
00145     // many subsequence calls from this application to Windows.
00146
00147     hInst = hInstance; // Store instance handle in our global variable
00148
00149     // Create a main window for this application instance.
00150     hWnd = CreateWindow(
00151             szAppName,           // See RegisterClass() call.
00152             szTitle,             // Text for window title bar.
00153             WS_OVERLAPPEDWINDOW,// Window style.
00154             CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, // Use default positioning
00155             NULL,                // Overlapped windows have no parent.
00156             NULL,                // Use the window class menu.
00157             hInstance,           // This instance owns this window.
00158             NULL                 // We don't use any data in our WM_CREATE
00159     );
00160
00161     // If window could not be created, return "failure"
00162     if (!hWnd) {
00163             return (FALSE);
00164     }
00165
00166     // Make the window visible; update its client area; and return "success"
00167     ShowWindow(hWnd, nCmdShow); // Show the window
00168     UpdateWindow(hWnd);         // Sends WM_PAINT message
00169
00170     return (TRUE);              // We succeeded...
00171 }
00172
00173 /*****************************************************************************
00174  *                                                                           *
00175  * FUNCTION: WinMain(HINSTANCE, HINSTANCE, LPSTR, int)                       *
00176  *                                                                           *
00177  * PURPOSE: calls initialization function, processes message loop            *
00178  *                                                                           *
00179  * COMMENTS:                                                                 *
00180  *                                                                           *
00181  *    Windows recognizes this function by name as the initial entry point    *
00182  *    for the program.  This function calls the application initialization   *
00183  *    routine, if no other instance of the program is running, and always    *
00184  *    calls the instance initialization routine.  It then executes a message *
00185  *    retrieval and dispatch loop that is the top-level control structure    *
00186  *    for the remainder of execution.  The loop is terminated when a WM_QUIT *
00187  *    message is received, at which time this function exits the application *
00188  *    instance by returning the value passed by PostQuitMessage().           *
00189  *                                                                           *
00190  *    If this function must abort before entering the message loop, it       *
00191  *    returns the conventional value NULL.                                   *
00192  *                                                                           *
00193  ****************************************************************************/
00194 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
00195 {
00196     MSG msg;
00197     HANDLE hAccelTable;
00198
00199     if (!hPrevInstance) {       // Other instances of app running?
00200     if (!InitApplication(hInstance)) { // Initialize shared things
00201             return (FALSE);     // Exits if unable to initialize
00202         }
00203     }
00204
00205     // Perform initializations that apply to a specific instance
00206     if (!InitInstance(hInstance, nCmdShow))
00207     return (FALSE);
00208
00209     // Load the keyboard a accelerators for this app
00210   hAccelTable = LoadAccelerators (hInstance, "VIEWDIB");
00211
00212     /* Acquire and dispatch messages until a WM_QUIT message is received. */
00213     while (GetMessage(&msg, NULL, 0, 0))  {
00214         if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) {
00215             TranslateMessage(&msg);// Translates virtual key codes
00216             DispatchMessage(&msg); // Dispatches message to window
00217         }
00218     }
00219
00220     return (int)msg.wParam; // Returns the value from PostQuitMessage
00221
00222     UNREFERENCED_PARAMETER(lpCmdLine); // This will prevent 'unused formal parameter' warnings
00223 }
00224
00225 /*****************************************************************************
00226  *                                                                           *
00227  * FUNCTION: SetWindowTitle(HWND, LPSTR, HBITMAP)                            *
00228  *                                                                           *
00229  * PURPOSE: Sets the title text for the main window to include the name of   *
00230  *          the file that's currently being displayed along with the         *
00231  *          resolution and color depth.                                      *
00232  *                                                                           *
00233  ****************************************************************************/
00234 void SetWindowTitle(HWND hWnd,LPSTR szFilename, HBITMAP hbm)
00235 {
00236   DIBSECTION  ds;
00237   char    szNewTitle[MAX_PATH*2];
00238
00239   if (hbm) {
00240     GetObject(hbm, sizeof(DIBSECTION), &ds);
00241
00242     _snprintf(szNewTitle, sizeof(szNewTitle)-1,
00243          "%s - %s  (%lu x %lu x %lu bpp)",
00244          szAppName,
00245          szFilename,
00246          ds.dsBmih.biWidth,
00247          ds.dsBmih.biHeight,
00248          ds.dsBmih.biPlanes * ds.dsBmih.biBitCount);
00249     } else {
00250     lstrcpyn(szNewTitle, szAppName, sizeof(szNewTitle)-1);
00251     }
00252     szNewTitle[sizeof(szNewTitle)-1] = '\0';
00253
00254     SetWindowText(hWnd, szNewTitle);
00255 }
00256
00257 /*****************************************************************************
00258  *                                                                           *
00259  * FUNCTION: PrintDIBSection(HWND, HBITMAP)                                  *
00260  *                                                                           *
00261  * PURPOSE: Lets the user for a printer and then prints a DIB section to it. *
00262  *                                                                           *
00263  ****************************************************************************/
00264
00265 void PrintDIBSection(HWND hWnd, HBITMAP hbmp)
00266 {
00267   PRINTDLG pd;
00268   RECT rc;
00269   DOCINFO di;
00270
00271   // Clear the structure so it doesn't contain random values
00272   ZeroMemory(&pd, sizeof(pd));
00273
00274   // Initialize the structure for retrieving an HDC
00275   pd.lStructSize = sizeof(PRINTDLG);
00276   pd.hwndOwner = hWnd;
00277   pd.Flags = PD_RETURNDC | PD_PRINTSETUP;
00278
00279   // Let the user pick a printer
00280   if (!PrintDlg(&pd))
00281     return;
00282
00283   // Make sure we got a DC
00284   if (!pd.hDC)
00285     return;
00286
00287   if (pd.hDevMode) GlobalFree(pd.hDevMode);
00288   if (pd.hDevNames) GlobalFree(pd.hDevNames);
00289
00290   // Get a rectangle that covers the entire page
00291   SetRect(&rc,0,0,GetDeviceCaps(pd.hDC, HORZRES), GetDeviceCaps(pd.hDC, VERTRES));
00292
00293   // Initialize the DOCINFO with the document name
00294   ZeroMemory(&di, sizeof(di));
00295   di.cbSize = sizeof(di);
00296   di.lpszDocName = "ViewDIB Image";
00297
00298   // Initiate document
00299   StartDoc(pd.hDC, &di);
00300
00301   // Initiate page
00302   StartPage(pd.hDC);
00303
00304   // Draw the image
00305   if (!DSDrawDIBSectionOnDC(pd.hDC, hbmp, &rc))
00306     GetLastErrorBox(hWnd, "Error during printing");
00307
00308   EndPage(pd.hDC);
00309   EndDoc(pd.hDC);
00310
00311   // Clean up
00312   DeleteDC(pd.hDC);
00313 }
00314
00315 /*****************************************************************************
00316  *                                                                           *
00317  *   FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)                           *
00318  *                                                                           *
00319  *   PURPOSE:  Processes messages for main application window                *
00320  *                                                                           *
00321  ****************************************************************************/
00322 LRESULT CALLBACK WndProc(
00323                 HWND hWnd,         // window handle
00324                 UINT message,      // type of message
00325                 WPARAM uParam,     // additional information
00326                 LPARAM lParam)     // additional information
00327 {
00328     static char szDirName[MAX_PATH] = "";
00329   int wmId, wmEvent;
00330     static HBITMAP hbmp = NULL;
00331     static HANDLE hPalette = NULL;
00332
00333     switch (message) {
00334   case WM_PAINT:
00335     {
00336       PAINTSTRUCT ps;
00337       HDC    hDC = BeginPaint(hWnd, &ps);
00338       RECT   rect;
00339       HDC    hdcMem;
00340       BITMAP bm;
00341
00342       // Get the extents of our drawing area
00343       GetClientRect(hWnd, &rect);
00344
00345       if (hbmp) { // If we have a DIB section loaded
00346
00347         // Get the attributes of our DIB section
00348         if (GetObject(hbmp, sizeof(BITMAP), &bm)) {
00349           // If our DIB has a color table
00350           if (DSBitsPerPixel(hbmp) <= 8)
00351             SetStretchBltMode(hDC, COLORONCOLOR); // Yes: COLORONCOLOR is sufficient
00352           else
00353             SetStretchBltMode(hDC, HALFTONE);     // No: It will probably look better in HALFTONE
00354
00355           // If we have a palette, map the colors into the system palette
00356           if (hPalette) {
00357             SelectPalette(hDC, hPalette, FALSE);
00358             RealizePalette(hDC);
00359           }
00360
00361           // Create a temporary memory DC to hold the DIB section
00362           hdcMem = CreateCompatibleDC(hDC);
00363           SelectObject(hdcMem, hbmp);
00364
00365           // Display it
00366           StretchBlt(hDC,    0, 0, rect.right, rect.bottom,
00367                    hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
00368
00369           DeleteDC(hdcMem);
00370         }
00371       } else
00372         PatBlt(hDC, 0, 0, rect.right, rect.bottom, BLACKNESS);
00373
00374       EndPaint(hWnd, &ps);
00375     }
00376     break;
00377
00378   case WM_PALETTECHANGED:
00379     if ((HWND) uParam == hWnd)
00380       return 0;
00381
00382     // Otherwise, fall through to WM_QUERYNEWPALETTE.
00383   case WM_QUERYNEWPALETTE:
00384     if (hPalette)
00385     {
00386       HDC hdc = GetDC(hWnd);
00387       HPALETTE hpal;
00388       UINT i;
00389
00390       // If realizing the palette causes the palette to change,
00391       // redraw completely.
00392       hpal = SelectPalette (hdc, hPalette, FALSE);
00393       i = RealizePalette(hdc); // i == entries that changed
00394
00395       SelectPalette (hdc, hpal, FALSE);
00396       ReleaseDC(hWnd, hdc);
00397
00398       // If any palette entries changed, repaint the entire window.
00399       if (i > 0)
00400         InvalidateRect(hWnd, NULL, TRUE);
00401       return i;
00402     }
00403     break;
00404
00405   case WM_INITMENU:
00406     // Initialize all of the menu items
00407     EnableMenuItem((HMENU)uParam, IDM_PASTE,   (IsClipboardFormatAvailable(CF_DIB) || IsClipboardFormatAvailable(CF_BITMAP)) ? MF_ENABLED : MF_GRAYED);
00408     EnableMenuItem((HMENU)uParam, IDM_COPY,    hbmp ? MF_ENABLED : MF_GRAYED);
00409     EnableMenuItem((HMENU)uParam, IDM_SAVEDIB, hbmp ? MF_ENABLED : MF_GRAYED);
00410     EnableMenuItem((HMENU)uParam, IDM_PRINT,   hbmp ? MF_ENABLED : MF_GRAYED);
00411     EnableMenuItem((HMENU)uParam, IDM_DIBINFO, hbmp ? MF_ENABLED : MF_GRAYED);
00412     EnableMenuItem((HMENU)uParam, IDM_CD1BPP,  hbmp ? MF_ENABLED : MF_GRAYED);
00413     EnableMenuItem((HMENU)uParam, IDM_CD4BPP,  hbmp ? MF_ENABLED : MF_GRAYED);
00414     EnableMenuItem((HMENU)uParam, IDM_CD8BPP,  hbmp ? MF_ENABLED : MF_GRAYED);
00415     EnableMenuItem((HMENU)uParam, IDM_CD15BPP, hbmp ? MF_ENABLED : MF_GRAYED);
00416     EnableMenuItem((HMENU)uParam, IDM_CD16BPP, hbmp ? MF_ENABLED : MF_GRAYED);
00417     EnableMenuItem((HMENU)uParam, IDM_CD24BPP, hbmp ? MF_ENABLED : MF_GRAYED);
00418     EnableMenuItem((HMENU)uParam, IDM_CD32BPP, hbmp ? MF_ENABLED : MF_GRAYED);
00419     break;
00420
00421   case WM_COMMAND:
00422     wmId    = LOWORD(uParam);
00423     wmEvent = HIWORD(uParam);
00424
00425     switch (wmId) {
00426     case IDM_DIBINFO:  // Display the DIB section attributes to the user in a MessageBox
00427       {
00428         char szBuffer[256];
00429         DIBSECTION ds;
00430
00431         // Bail if we don't have a DIB section
00432         if (!hbmp)
00433           break;
00434
00435         // Get the surface attributes
00436         if (!GetObject(hbmp, sizeof(DIBSECTION), &ds))
00437           break;  // bail if there is an error
00438
00439         // Compose the message
00440         _snprintf(szBuffer, sizeof(szBuffer)-1,
00441                                    "biSize       \t%lu\n"
00442                    "biWidth      \t%lu\n"
00443                    "biHeight     \t%lu\n"
00444                    "biPlanes     \t%u\n"
00445                    "biBitCount   \t%u\n"
00446                    "biCompression\t%lu\n"
00447                    "biSizeImage  \t%lu\n"
00448                    "biXPelsPerMtr\t%lu\n"
00449                    "biYPelsPerMtr\t%lu\n"
00450                    "biClrUsed    \t%lu\n"
00451                    "biClrImportant\t%lu\n",
00452             ds.dsBmih.biSize,
00453             ds.dsBmih.biWidth,
00454             ds.dsBmih.biHeight,
00455             ds.dsBmih.biPlanes,
00456             ds.dsBmih.biBitCount,
00457             ds.dsBmih.biCompression,
00458             ds.dsBmih.biSizeImage,
00459             ds.dsBmih.biXPelsPerMeter,
00460             ds.dsBmih.biYPelsPerMeter,
00461             ds.dsBmih.biClrUsed,
00462             ds.dsBmih.biClrImportant);
00463                szBuffer[sizeof(szBuffer)-1] = '\0';
00464
00465              // Tack on the bitfields information if the DIB section uses bitfields
00466         if (ds.dsBmih.biCompression == BI_BITFIELDS) {
00467           _snprintf(&szBuffer[lstrlen(szBuffer)], sizeof(szBuffer)-lstrlen(szBuffer)-1,
00468                  "Bitfields:\n\tR: 0x%08X\n\tG: 0x%08X\n\tB: 0x%08X",
00469                ds.dsBitfields[0],ds.dsBitfields[1],ds.dsBitfields[2]);
00470                     szBuffer[sizeof(szBuffer)-1] = '\0';
00471         }
00472
00473         // Show the user the information
00474         MessageBox (NULL, szBuffer, "DIB Section Information", MB_ICONINFORMATION);
00475       }
00476       break;
00477
00478     // Handle format conversions
00479     case IDM_CD1BPP:
00480     case IDM_CD4BPP:
00481     case IDM_CD8BPP:
00482     case IDM_CD15BPP:
00483     case IDM_CD16BPP:
00484     case IDM_CD24BPP:
00485     case IDM_CD32BPP:
00486       {
00487         HBITMAP hbmNew;
00488
00489         // Convert into the surface format the user asked for
00490         switch (wmId) {
00491           case IDM_CD1BPP: hbmNew = DSCopyBitmapEx(hbmp, NULL, 1); break;
00492           case IDM_CD4BPP: hbmNew = DSCopyBitmapEx(hbmp, NULL, 4); break;
00493           case IDM_CD8BPP: hbmNew = DSCopyBitmapEx(hbmp, NULL, 8); break;
00494           case IDM_CD15BPP: hbmNew = DSCopyBitmapEx(hbmp, NULL, 15); break;
00495           case IDM_CD16BPP: hbmNew = DSCopyBitmapEx(hbmp, NULL, 16); break;
00496           case IDM_CD24BPP: hbmNew = DSCopyBitmapEx(hbmp, NULL, 24); break;
00497           case IDM_CD32BPP: hbmNew = DSCopyBitmapEx(hbmp, NULL, 32); break;
00498         }
00499
00500         // If we sucessfully converted, update the titlebar and redisplay
00501         if (hbmNew) {
00502           // Delete the old bitmap and palette
00503           DeleteObject(hbmp);
00504           if (hPalette)
00505             DeleteObject(hPalette);
00506
00507           // Update our bitmap and palette to reference the new image
00508           hbmp = hbmNew;
00509           hPalette = DSCreatePaletteForDIBSection(hbmp);
00510
00511           // Set our title to reflect the name of the file we loaded
00512           SetWindowTitle(hWnd, "Untitled.BMP", hbmp);
00513
00514           // Force the new image to be displayed
00515           InvalidateRect(hWnd, NULL, FALSE);
00516         } else
00517           GetLastErrorBox(hWnd, "Error during format conversion");
00518       }
00519       break;
00520
00521     // Print the DIB section
00522     case IDM_PRINT:
00523       if (hbmp)
00524         PrintDIBSection(hWnd, hbmp);
00525       break;
00526
00527       // Copy the DIB section to the clipboard
00528     case IDM_COPY:
00529       if (hbmp) {
00530         DSPutDIBSectionOnClipboard(hbmp);
00531       }
00532       break;
00533
00534     // Paste the DIB section from the clipboard
00535     case IDM_PASTE:
00536       {
00537         HBITMAP hbmNew;
00538
00539         // Retrieve the DIB
00540         hbmNew = DSGetDIBSectionFromClipboard();
00541
00542         if (hbmNew) {
00543           if (hbmp)
00544             DeleteObject(hbmp);
00545
00546           if (hPalette)
00547             DeleteObject(hPalette);
00548
00549           hbmp = hbmNew;
00550           hPalette = DSCreatePaletteForDIBSection(hbmp);
00551
00552           // Set our title to reflect the origin/attributes of the image
00553           SetWindowTitle(hWnd, "<Clipboard>", hbmp);
00554
00555           InvalidateRect(hWnd, NULL, FALSE);
00556         } else
00557           GetLastErrorBox(hWnd, "Error during paste");
00558       }
00559       break;
00560
00561     case IDM_LOADDIB:
00562       {
00563         char szFilename[MAX_PATH] = "*.BMP";
00564
00565         // Retreive a filename
00566                 szDirName[sizeof(szDirName)-1] = '\0';
00567         if (GetDIBFilename(szFilename, szDirName, FALSE)) {
00568
00569           // Save the current directory
00570           GetCurrentDirectory(MAX_PATH, szDirName);
00571
00572           if (hbmp)
00573             DeleteObject(hbmp);
00574
00575           if (hPalette)
00576             DeleteObject(hPalette);
00577
00578           if (!DSLoadDIBSectionFromBMPFile(szFilename, &hbmp, (HPALETTE*)&hPalette)) {
00579             MessageBox(hWnd, "Unable to load file!", szFilename, MB_ICONSTOP);
00580             hbmp = NULL;
00581             hPalette = NULL;
00582           }
00583         } else  // user canceled
00584           return 0;
00585
00586         // Set our title to reflect the name of the file we loaded
00587         SetWindowTitle(hWnd, szFilename, hbmp);
00588
00589         InvalidateRect(hWnd, NULL, FALSE);
00590       }
00591       break;
00592
00593     case IDM_SAVEDIB:
00594       {
00595         char szFilename[MAX_PATH] = "*.BMP";
00596
00597         // Do we have a DIB loaded?
00598         if (!hbmp)
00599           break;
00600
00601         // Retreive a filename
00602                 szDirName[sizeof(szDirName)-1] = '\0';
00603         if (GetDIBFilename(szFilename, szDirName, TRUE)) {
00604
00605           // Save the current directory
00606           GetCurrentDirectory(MAX_PATH, szDirName);
00607
00608           // Save the current image to the filename the user selected
00609           DSStoreDIBSectionInBMPFile(szFilename, hbmp);
00610
00611           // Set our title to reflect the new name of the file
00612           SetWindowTitle(hWnd, szFilename, hbmp);
00613         } else  // user canceled
00614           return 0;
00615       }
00616       break;
00617
00618     case IDM_ABOUT:
00619       DialogBox(hInst,          // current instance
00620         "ABOUTBOX",      // dlg resource to use
00621         hWnd,            // parent handle
00622         (DLGPROC)About); // About() instance address
00623       break;
00624
00625     case IDM_EXIT:
00626       DestroyWindow (hWnd);
00627       break;
00628
00629     default:
00630       return (DefWindowProc(hWnd, message, uParam, lParam));
00631     }
00632     break;
00633
00634         case WM_DESTROY:  // message: window being destroyed
00635       // Clean up the objects we created
00636       if (hbmp)
00637         DeleteObject(hbmp);
00638
00639       if (hPalette)
00640         DeleteObject(hPalette);
00641
00642       // Hasta la vista...
00643       PostQuitMessage(0);
00644       break;
00645
00646         default:          // Passes it on if unproccessed
00647       return (DefWindowProc(hWnd, message, uParam, lParam));
00648     }
00649     return (0);
00650 }
00651
00652
00653 /*****************************************************************************
00654  *                                                                           *
00655  *   FUNCTION: About(HWND, UINT, WPARAM, LPARAM)                             *
00656  *                                                                           *
00657  *   PURPOSE:  Processes messages for "About" dialog box                     *
00658  *                                                                           *
00659  *   Wait for user to click on "Ok" button, then close the dialog box.       *
00660  *                                                                           *
00661  ****************************************************************************/
00662 LRESULT CALLBACK About(
00663                 HWND hDlg,           // window handle of the dialog box
00664                 UINT message,        // type of message
00665                 WPARAM uParam,       // message-specific information
00666                 LPARAM lParam)
00667 {
00668     switch (message) {
00669         case WM_COMMAND:                      // message: received a command
00670             if (LOWORD(uParam) == IDOK || LOWORD(uParam) == IDCANCEL) {
00671                 EndDialog(hDlg, TRUE);        // Exit the dialog
00672                 return (TRUE);
00673             }
00674             break;
00675     }
00676     return (FALSE); // Didn't process the message
00677
00678     UNREFERENCED_PARAMETER(lParam); // This will prevent 'unused formal parameter' warnings
00679 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IPSAMPLE_IF_CONFIG Member List

This is the complete list of members for _IPSAMPLE_IF_CONFIG, including all inherited members.
ulMetric _IPSAMPLE_IF_CONFIG
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/ChgState/ChgState.Cxx Source File

  • WinBase
  • Indexing
  • ChgState

ChgState.Cxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // PROGRAM:  ChgState.cxx
00011 //
00012 // PURPOSE:  To change the state of a catalog (on local machine)
00013 //
00014 // PLATFORM: Windows  2000
00015 //
00016 //--------------------------------------------------------------------------
00017
00018 //+-------------------------------------------------------------------------
00019 //
00020 //  Function:   wmain
00021 //
00022 //  Synopsis:   Entry point for the app.
00023 //
00024 //  Arguments:  [argc]     - Argument count
00025 //              [argv]     - Arguments
00026 //
00027 //--------------------------------------------------------------------------
00028
00029 #include <stdio.h>
00030 #include <windows.h>
00031
00032 #include <ntquery.h>
00033
00034 //+-------------------------------------------------------------------------
00035 //
00036 //  Function:   Usage
00037 //
00038 //  Synopsis:   Displays information about how to use the app and exits
00039 //
00040 //--------------------------------------------------------------------------
00041
00042 void Usage()
00043 {
00044     printf( "Usage: ChgState /a:<RO|RW|Stop|GetState> /c:<Catalog Name>\n" );
00045     printf( "    /m:<Machine Name>\n\n" );
00046     printf( "    ChgState            Change the state of a catalog\n" );
00047     printf( "    /a:<Action>         the action to be taken, default is RO\n" );
00048     printf( "    The three actions are states RO (Read Only), RW (Read\\Write) and Stop (Stopped)\n" );
00049     printf( "    You can also specify GetState to check the state of a catalog\n" );
00050     printf( "    /c:<Catalog Name>   name of the catalog, default is SYSTEM\n" );
00051     printf( "    /m:<Machine Name>   name of the machine, default is local machine\n" );
00052     exit( -1 );
00053 } //Usage
00054
00055 extern "C" int __cdecl wmain( int argc, WCHAR * argv[] )
00056 {
00057     WCHAR const * pwcsCatalog     = L"system"; // default: system
00058     WCHAR const * pwcsMachine     = L".";      // default: local machine
00059     WCHAR const * pwcsAction      = L"RO";     // default: ReadOnly
00060     DWORD dwNewState              = CICAT_READONLY;
00061     DWORD dwOldState;
00062
00063     SCODE sc = S_OK;
00064
00065     // Parse the command for arguments
00066     if ( argc > 1 )
00067     {
00068         for ( int i = 1; i < argc; i++ )
00069         {
00070             if ( L'/' == argv[i][0] )
00071             {
00072                 WCHAR wc = (WCHAR) toupper( argv[i][1] );
00073
00074                 if ( ':' != argv[i][2] )
00075                     Usage();
00076
00077                 if ( 'A' == wc )
00078                     pwcsAction = argv[i] + 3;
00079                 else if ( 'C' == wc )
00080                     pwcsCatalog = argv[i] + 3;
00081                 else if ( 'M' == wc )
00082                     pwcsMachine = argv[i] + 3;
00083                 else
00084                     Usage();
00085             }
00086             else
00087                 Usage();
00088         }
00089     }
00090     else
00091     {
00092         Usage();
00093     }
00094
00095     if ( !wcscmp( pwcsAction, L"RO" ) )          // ReadOnly
00096         dwNewState = CICAT_READONLY;
00097     else if ( !wcscmp( pwcsAction, L"RW" ) )     // ReadWrite
00098         dwNewState = CICAT_WRITABLE;
00099     else if ( !wcscmp( pwcsAction, L"Stop" ) )   // Stop
00100         dwNewState = CICAT_STOPPED;
00101     else if ( !wcscmp( pwcsAction, L"GetState" ) ) // Get the current state
00102         dwNewState = CICAT_GET_STATE;
00103     else
00104     {
00105         fprintf( stderr, "Action undefined!\n" );
00106         exit(-1);
00107     }
00108
00109     // call the API
00110     sc = SetCatalogState ( pwcsCatalog,
00111                            pwcsMachine,
00112                            dwNewState,
00113                            &dwOldState );
00114
00115     if ( FAILED( sc ) )
00116     {
00117         printf( "ChangeState for catalog %ws failed with error %#x\n", pwcsCatalog ,sc );
00118         return -1;
00119     }
00120
00121     printf(" Old State is " );
00122     if ( CICAT_STOPPED == dwOldState )
00123         printf( "CICAT_STOPPED.\n" );
00124     else
00125     {
00126         if ( CICAT_WRITABLE & dwOldState )
00127             printf( "CICAT_WRITABLE.\n" );
00128         else if ( CICAT_READONLY & dwOldState )
00129             printf( "CICAT_READONLY.\n" );
00130         else printf( "Error obtaining oldState. The return value is %d\n", dwOldState );
00131     }
00132
00133     return 0;
00134 } //wmain
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/foldernode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

foldernode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CFolderNode class.
00014 //
00015
00016
00017 #include "FolderNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "AddVFileDlg.h"
00021 #include "DataObj.h"
00022 #include "DeviceNode.h"
00023 #include "VirtualFIle.h"
00024                              // Tracing stuff
00025 #include "TraceMacro.h"
00026 #undef  MODULESTRING
00027 #define MODULESTRING  _T("CFolderNode")
00028
00029
00030 // Initialize our static GUID just once
00031 GUID CFolderNode::m_thisGUID = CLSID_CFolderNode;
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Construction/Destruction
00036
00037 //---------------------------------------------------------------------------
00038 CFolderNode::CFolderNode()
00039 {
00040   m_SDI.mask        = DEFAULT_SDI_MASK;
00041   m_SDI.displayname = MMC_CALLBACK;
00042   m_SDI.nImage      = IMG_FOLDER_DEFAULT;
00043   m_SDI.nOpenImage  = IMG_FOLDER_DEFAULT;
00044   m_SDI.cChildren   = 0;              // Determines if the '+' is displayed
00045   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00046
00047   m_dwAttributes    = 0;
00048   m_pCompData       = NULL;
00049   m_hAddVFileDlg    = NULL;
00050   m_pParentNode     = NULL;
00051 }
00052
00053 //---------------------------------------------------------------------------
00054 CFolderNode::~CFolderNode()
00055 {
00056   RemoveNodes();             // Remove children if we are being deleted
00057
00058   if( NULL != m_hMessageWnd )
00059     DestroyWindow( m_hMessageWnd );
00060 }
00061
00062 //---------------------------------------------------------------------------
00063 HRESULT CFolderNode::Initialize
00064 (
00065   LPNODEPROPS  pNodeProps    //[in] Properties of this node
00066 )
00067 {
00068   _ASSERT( NULL != pNodeProps );
00069   HRESULT hResult = S_FALSE;
00070
00071   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00072   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00073   wcscpy( pszTmp, pNodeProps->szNodeName );
00074   if( NULL != m_pwszNodeName )
00075     CoTaskMemFree( m_pwszNodeName );
00076
00077   m_pwszNodeName = pszTmp;
00078   m_pCompData = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00079   // We don't call back to our parent so pNodeProps->pParentObject is ignored.
00080
00081   InitDefaultVFile();        // Create a default Result Item node
00082
00083   // We create a hidden window to allow us to communicate with modeless
00084   // dialogs and other things which run in a seperate thread.
00085
00086   WNDCLASS wc;
00087   ZeroMemory (&wc, sizeof(WNDCLASS));
00088   wc.cbWndExtra    = sizeof(this);
00089   wc.lpfnWndProc   = FolderNodeWndProc;
00090   wc.hInstance     = g_hInst;
00091   wc.lpszClassName = _T("FolderNodeMessageWindow");
00092
00093   RegisterClass( &wc );
00094   m_hMessageWnd = CreateWindow( _T("FolderNodeMessageWindow"), NULL,
00095                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00096
00097   if( NULL == m_hMessageWnd )
00098     hResult = S_FALSE;
00099
00100   return hResult;
00101 }
00102
00103
00104 //---------------------------------------------------------------------------
00105 //  This is our hidden window which is just used for handling messages.  We
00106 //  go to all this trouble so that we don't ever pass interface pointers or
00107 //  other objects across threads.
00108 //
00109 LRESULT CALLBACK CFolderNode::FolderNodeWndProc
00110 (
00111   HWND   hWnd,     //[in] Handle to window
00112   UINT   uMsg,     //[in] Message identifier
00113   WPARAM wParam,   //[in] First message parameter
00114   LPARAM lParam    //[in] Second message parameter
00115 )
00116 {
00117   switch( uMsg )
00118   {
00119     case WM_CREATE:
00120     {
00121       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00122       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00123       break;
00124     }
00125
00126     case WM_ADD_VIRTUALFILE:
00127     {
00128       CFolderNode* pThisNode = (CFolderNode*)GetWindowLongPtr( hWnd, 0 );
00129       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00130       pThisNode->AddVirtualFile( pProps );
00131       break;
00132     }
00133
00134     case WM_VIRTUALFILE_CLOSED:
00135     {
00136       CFolderNode* pThisNode = (CFolderNode*)GetWindowLongPtr( hWnd, 0 );
00137       pThisNode->m_hAddVFileDlg = NULL;
00138       break;
00139     }
00140     default:
00141       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00142   }
00143   return 0;
00144 }
00145
00146
00147 /////////////////////////////////////////////////////////////////////////////
00148 // Implementation of virtual methods
00149
00150
00151 //---------------------------------------------------------------------------
00152 HRESULT CFolderNode::GetResultViewType2
00153 (
00154   MMC_COOKIE             nCookie,  //[in] Identifier of object
00155   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00156 )
00157 {
00158   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+sizeof(WCHAR) );
00159   if( NULL == pszDescStr )
00160     return E_OUTOFMEMORY;
00161
00162   wcscpy( pszDescStr, L"DefaultListView" );
00163   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00164
00165   pRVTinfo->dwListOptions |= RVTI_LIST_OPTIONS_MULTISELECT;
00166
00167   return S_OK;
00168 }
00169
00170
00171 //---------------------------------------------------------------------------
00172 HRESULT CFolderNode::GetDisplayInfo
00173 (
00174   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00175 )
00176 {
00177   _ASSERT( NULL != pSDI );
00178   pSDI->displayname = m_pwszNodeName;
00179
00180   return S_OK;
00181 }
00182
00183 //---------------------------------------------------------------------------
00184 HRESULT CFolderNode::GetDisplayInfo
00185 (
00186   RESULTDATAITEM* pRDI
00187 )
00188 {
00189   _ASSERT( NULL != pRDI );
00190
00191   HRESULT hResult = S_OK;
00192
00193   if( pRDI->mask & RDI_STR )         // Console is requesting strings...
00194   {                                  // for each column
00195     switch( pRDI->nCol )
00196     {
00197       case 0:
00198         pRDI->str = m_pwszNodeName;
00199         break;
00200
00201       case 1:                        // Attributes not supported yet
00202         pRDI->str = L"No attributes";
00203         break;
00204
00205       default:
00206         hResult = S_FALSE;
00207         TRACE_VAL(_T("GetDisplayInfo"), _T("Column"), pRDI->nCol );
00208         break;
00209     }
00210   }
00211   if( pRDI->mask & RDI_IMAGE )       // Looking for an image?
00212   {
00213     pRDI->nImage = m_SDI.nImage;
00214   }
00215
00216   //TRACE_HRESULT(_T("GetDisplayInfo"), hResult );
00217   return hResult;
00218
00219 }
00220
00221 /////////////////////////////////////////////////////////////////////////////
00222 // Implementation of notification handlers
00223
00224
00225 //---------------------------------------------------------------------------
00226 HRESULT CFolderNode::OnSelect
00227 (
00228   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00229   LPARAM        nArg,          //[in] Bools for context & selection state
00230   LPARAM        nParam,        //[in] Not used
00231   LONG_PTR      pComponent     //[in] Points calling CComponent
00232 )
00233 {
00234   HRESULT hResult    = S_FALSE;
00235   BOOL    fScopePane = LOWORD(nArg);
00236   BOOL    fSelected  = HIWORD(nArg);
00237
00238   if( TRUE == fSelected )
00239   {
00240     CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00241
00242     IConsoleVerb* ipConsoleVerb = NULL;
00243     hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00244
00245     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_RENAME, ENABLED, TRUE );
00246   }
00247
00248   //TRACE_HRESULT(_T("OnSelect"), hResult );
00249   return hResult;
00250 }
00251
00252
00253 //---------------------------------------------------------------------------
00254 HRESULT CFolderNode::OnShow
00255 (
00256   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00257   LPARAM        nArg,          //[in] TRUE if node was selcted
00258   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00259   LONG_PTR      pComponent     //[in] Points calling CComponent
00260 )
00261 {
00262   HRESULT  hResult = S_FALSE;
00263
00264   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00265
00266   LPHEADERCTRL2  ipHeaderCtrl = NULL;
00267   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL, (LONG_PTR*)&ipHeaderCtrl );
00268   if( S_OK != hResult )
00269     return hResult;
00270
00271   LPRESULTDATA  ipResultData = NULL;
00272   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00273   if( S_OK != hResult )
00274     return hResult;
00275
00276
00277   if( TRUE == nArg )         // Selecting a scope node
00278   {
00279     do
00280     {
00281       hResult = ipHeaderCtrl->InsertColumn( 0, L"File Name", 0, 150 );
00282       BREAK_ON_ERROR( hResult );
00283
00284       hResult = ipHeaderCtrl->InsertColumn( 1, L"Attributes", 0, 150 );
00285       BREAK_ON_ERROR( hResult );
00286
00287       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00288       BREAK_ON_ERROR( hResult );
00289
00290       hResult = EnumerateResultItems( ipResultData );
00291       BREAK_ON_ERROR( hResult );
00292
00293     }while(0);
00294   }
00295   else                       // Clean up result items on deselection
00296   {
00297     hResult = ipResultData->DeleteAllRsltItems();
00298   }
00299
00300   //TRACE_HRESULT(_T("OnShow"), hResult );
00301   return hResult;
00302 }
00303
00304 //---------------------------------------------------------------------------
00305 HRESULT CFolderNode::OnExpand
00306 (
00307   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00308   LPARAM         nArg,         //[in] TRUE if node was selcted
00309   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00310   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00311 )
00312 {
00313   HRESULT hResult = S_FALSE;
00314
00315   if( NULL == m_pCompData )
00316     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00317
00318   //TRACE_HRESULT( _T("OnExpand"), hResult );
00319   return hResult;              // Not expanding anything
00320 }
00321
00322 //---------------------------------------------------------------------------
00323 HRESULT CFolderNode::OnRemoveChildren
00324 (
00325   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00326   LPARAM         nArg,         //[in] TRUE if node was selcted
00327   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00328   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00329 )
00330 {
00331   HRESULT hResult = S_OK;      // Just delete our child nodes, the
00332                                // corresponding result items are cleaned
00333   RemoveNodes();               // up in MMCN_SHOW -> FALSE
00334
00335   //TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00336   return hResult;
00337 }
00338
00339 //---------------------------------------------------------------------------
00340 HRESULT CFolderNode::OnViewChange
00341 (
00342   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00343   LPARAM         nArg,         //[in] TRUE if node was selcted
00344   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00345   LONG_PTR       pComponent    //[in] Points to calling IComponent
00346 )
00347 {
00348   HRESULT hResult = S_FALSE;
00349   LPRESULTDATA ipResultData = NULL;
00350
00351   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00352   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00353
00354   INT_PTR pScopeCookie = pComp->GetScopeCookie();
00355
00356   if( pScopeCookie == (INT_PTR)this )
00357     hResult = EnumerateResultItems( ipResultData );
00358
00359   //TRACE_HRESULT( _T("OnViewChange"), hResult );
00360   return hResult;
00361 }
00362
00363 //---------------------------------------------------------------------------
00364 //  This message must return S_OK to allow the rename.  Anything else will
00365 //  disallow the rename
00366 //
00367 HRESULT CFolderNode::OnRename
00368 (
00369   LPDATAOBJECT ipDataObject,   //[in] Points to Data Object
00370   LPARAM       nArg,           //[in] Not used
00371   LPARAM       nParam,         //[in] Pointer to the new name
00372   LONG_PTR     pCompData       //[in] Points to calling IComponentData
00373 )
00374 {
00375   _ASSERT( NULL != ipDataObject );
00376   HRESULT hResult = S_OK;
00377
00378   LPWSTR pszTmpName = NULL;
00379   LPWSTR pszNewName = (LPWSTR)nParam;  // New name
00380   LONG   nLen = wcslen( pszNewName ) + 1;
00381
00382   pszTmpName = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00383   if( NULL == pszTmpName )
00384   {
00385     hResult = S_FALSE;                 // Can't change the name
00386   }
00387   else
00388   {
00389     wcscpy( pszTmpName, pszNewName );
00390     CoTaskMemFree( m_pwszNodeName );   // Free existing name...
00391     m_pwszNodeName = pszTmpName;       // Assign new name to pointer
00392   }
00393   return hResult;
00394 }
00395
00396
00397 /////////////////////////////////////////////////////////////////////////////
00398 //  Support for Context Menus
00399
00400 //---------------------------------------------------------------------------
00401 HRESULT CFolderNode::AddMenuItems
00402 (
00403   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00404   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00405 )
00406 {
00407   _ASSERT( NULL != ipCallback );
00408   HRESULT hResult = S_FALSE;
00409
00410   static CONTEXTMENUITEM ctxMenu;
00411     ctxMenu.lCommandID        = IDM_NEW_VIRTFILE;
00412     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00413     ctxMenu.fSpecialFlags     = 0;
00414     ctxMenu.strName           = L"New Virtual File...";
00415     ctxMenu.strStatusBarText  = L"Add a new virtual file";
00416
00417
00418   if( NULL == m_hAddVFileDlg )     // If the AddVFile dialog is running
00419     ctxMenu.fFlags = 0;            // gray the menu selection
00420   else
00421     ctxMenu.fFlags = MF_GRAYED;
00422
00423
00424   // Add the 'New Device' option to the New menu if allowed...
00425   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00426   {
00427     hResult = ipCallback->AddItem( &ctxMenu );
00428   }
00429
00430   return hResult;
00431 }
00432
00433 //---------------------------------------------------------------------------
00434 HRESULT CFolderNode::Command
00435 (
00436   long lCommandID          //[in] Indentifier for menu ID
00437 )
00438 {
00439   HRESULT hResult = S_OK;
00440
00441   switch( lCommandID )
00442   {
00443     case IDM_NEW_VIRTFILE:
00444     {
00445       CAddVFileDlg* pDlg = new CAddVFileDlg( IDD_ADDVFILE_DLG, m_hMessageWnd );
00446       m_hAddVFileDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00447       break;
00448     }
00449     default:
00450     {
00451       hResult = S_FALSE;
00452       break;
00453     }
00454   }
00455   return hResult;
00456 }
00457
00458
00459 //---------------------------------------------------------------------------
00460 HRESULT CFolderNode::ControlbarNotify
00461 (
00462   LPARAM   nArg,         //[in] Selection status
00463   LPARAM   lParam,       //[in] Not used
00464   LONG_PTR pComp         //[in] Points to CComponent
00465 )
00466 {
00467   return E_NOTIMPL;
00468 }
00469
00470 /////////////////////////////////////////////////////////////////////////////
00471 //  Helper methods
00472
00473 //---------------------------------------------------------------------------
00474 //  This is called by a child node to have itself removed from the list
00475 //  of child nodes.  The node itself is not deleted, the child node will
00476 //  delete itself when this function returns.
00477 //
00478 VOID CFolderNode::RemoveChildNode
00479 (
00480   LONG_PTR pChildNode    //[in] Child node to remove from list
00481 )
00482 {
00483   CVirtualFile* pNode  = NULL;
00484   CVirtualFile* pChild = reinterpret_cast<CVirtualFile*>(pChildNode);
00485   POSITION      NewPos = m_NodeList.GetHeadPosition();
00486   POSITION      OldPos = NULL;
00487   while( NewPos )
00488   {
00489     OldPos = NewPos;                   // Need to save this
00490     pNode = m_NodeList.GetNext( NewPos );
00491     if( pNode == pChild )
00492     {
00493       m_NodeList.RemoveAt( OldPos );
00494       continue;                        // Exit, found it
00495     }
00496   }
00497 }
00498
00499
00500 //---------------------------------------------------------------------------
00501 // Creates a default Virtual File
00502 //
00503 HRESULT CFolderNode::InitDefaultVFile()
00504 {
00505   NODE_PROPERTIES NodeProps;
00506   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00507   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00508   NodeProps.dwAttributes   = ATTRIBUTE_DATA_ARCHIVE;
00509
00510   RemoveNodes();             // Clean the node list
00511
00512   wcscpy( NodeProps.szNodeName, L"Virtual File_1" );
00513   CVirtualFile* pNode = new CVirtualFile;
00514   pNode->Initialize( &NodeProps );
00515   m_NodeList.AddTail( pNode );
00516
00517   return S_OK;
00518 }
00519
00520 //---------------------------------------------------------------------------
00521 //  This is only called to cleanup when we are being deleted
00522 //
00523 VOID CFolderNode::RemoveNodes()
00524 {
00525   CVirtualFile* pNode = NULL;
00526   POSITION   Pos = m_NodeList.GetHeadPosition();
00527   while( Pos )
00528   {
00529     pNode = m_NodeList.GetNext( Pos );
00530     delete pNode;
00531   }
00532   m_NodeList.RemoveAll();              // Clean the list
00533 }
00534
00535
00536 //---------------------------------------------------------------------------
00537 //  This is where OOP gets to be fun.
00538 //  We use the NodeProperties pointer which originally came from the
00539 //  modeless AddVFileDlg, by way of our hidden window, to create a new
00540 //  Virtual File node and add it to our linked list.
00541 //  This by itself will not cause the new node to be displayed.  To do
00542 //  that we need to call IResultData::InsertItem().  However we don't
00543 //  have a way to get that pointer.  So we have to be indirect.  We call
00544 //  IComponentData::QueryDataObject() to create a data object.  The data
00545 //  object points back to this node.  We can then pass that to
00546 //  IConsole3::UpdateAllViews().  This makes sure all instances of
00547 //  IComponent are called (there may me several running).  Then the
00548 //  MMCN_VIEW_CHANGE notification is delegated back to this node, along
00549 //  with a pointer to the correct IComponent.  With this pointer we can
00550 //  call GetInterface() to get an IResultData pointer which we can then
00551 //  pass to EnumerateResultItems() to display the new Virtual File.
00552 //
00553 HRESULT CFolderNode::AddVirtualFile
00554 (
00555   LPNODEPROPS pNodeProps     //[in] Properties of new node
00556 )
00557 {
00558   _ASSERT( NULL != pNodeProps );
00559   HRESULT hResult = S_FALSE;
00560
00561   pNodeProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00562   pNodeProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00563
00564   CVirtualFile* pNode = NULL;
00565   pNode = new CVirtualFile;
00566   pNode->Initialize( pNodeProps );
00567   m_NodeList.AddTail( pNode );
00568
00569   LPCONSOLE3 ipConsole = NULL;
00570   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLE, (LONG_PTR*)&ipConsole );
00571   if( S_OK != hResult )
00572     return hResult;
00573
00574   LPDATAOBJECT pDO = NULL;
00575   m_pCompData->QueryDataObject( (MMC_COOKIE)this, CCT_SCOPE, &pDO );
00576
00577   hResult = ipConsole->UpdateAllViews( pDO, 0, 0 );
00578   pDO->Release();
00579
00580   return hResult;
00581 }
00582
00583
00584 //---------------------------------------------------------------------------
00585 HRESULT CFolderNode::EnumerateResultItems
00586 (
00587   LPRESULTDATA ipResultData  //[in] Points to cached IResultData
00588 )
00589 {
00590   _ASSERT( NULL != ipResultData );
00591   HRESULT hResult = S_OK;
00592
00593   if( FALSE == m_NodeList.IsEmpty() )
00594     hResult = ipResultData->DeleteAllRsltItems();
00595
00596   if( S_OK == hResult )
00597   {
00598     CVirtualFile*  pNode = NULL;
00599     POSITION       Pos   = m_NodeList.GetHeadPosition();
00600     while( Pos )
00601     {
00602       pNode = m_NodeList.GetNext( Pos );
00603       hResult = ipResultData->InsertItem( &pNode->m_RDI );
00604       _ASSERT( S_OK == hResult );
00605     }
00606   }
00607
00608   //TRACE_HRESULT( _T("EnumerateResultItems"), hResult );
00609   return hResult;
00610 }
00611
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/localres.h Source File

  • SysMgmt
  • MMC
  • Simple

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/imsconf3.idl Source File

  • Web
  • NetMeeting
  • PlugTransport

imsconf3.idl

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright 1995 - 2002 Microsoft Corporation. All Rights Reserved.
00004 //
00005 //  Contents:   Conferencing Services Object interfaces
00006 //
00007 //----------------------------------------------------------------------------
00008
00009 cpp_quote("//+-------------------------------------------------------------------------")
00010 cpp_quote("//")
00011 cpp_quote("//  Microsoft Windows")
00012 cpp_quote("//  Copyright 1995-2002 Microsoft Corporation. All Rights Reserved.")
00013 cpp_quote("//")
00014 cpp_quote("//  File: imsconf3.h")
00015 cpp_quote("//")
00016 cpp_quote("//--------------------------------------------------------------------------")
00017
00018 //////////////////////////////////////////////////////////////////////////////////
00019 // GUID usage:
00020 //
00021 // {068B0700-718C-11d0-8B1A-00A0C91BC90E} - {068B08FF-718C-11d0-8B1A-00A0C91BC90E}
00022 //
00023
00024 import "objidl.idl";
00025 import "oleidl.idl";
00026 import "oaidl.idl";
00027
00028 interface INmManager;
00029 interface INmManagerNotify;
00030 interface INmSysInfo;
00031 interface INmMember;
00032 interface INmCall;
00033 interface INmCallNotify;
00034 interface INmConference;
00035 interface INmConferenceNotify;
00036 interface INmChannel;
00037 interface INmChannelNotify;
00038 interface INmChannelData;
00039 interface INmChannelDataNotify;
00040 interface INmChannelFt;
00041 interface INmChannelFtNotify;
00042 interface INmChannelVideo;
00043 interface INmChannelVideoNotify;
00044 interface INmChannelAudio;
00045 interface INmChannelAudioNotify;
00046 interface INmChannelAppShare;
00047 interface INmChannelAppShareNotify;
00048 interface INmFt;
00049 interface INmSharableApp;
00050 interface IEnumNmConference;
00051 interface IEnumNmMember;
00052 interface IEnumNmChannel;
00053 interface IEnumNmCall;
00054 interface IEnumNmSharableApp;
00055
00056
00057 cpp_quote("")
00058 cpp_quote("////////////////////////////////////////////////////////////////////////////")
00059 cpp_quote("//")
00060 cpp_quote("// Constants")
00061 cpp_quote("")
00062
00063
00064 cpp_quote("// NetMeeting Channel Types")
00065 cpp_quote("#define NMCH_NONE                     0x00000000")
00066 cpp_quote("#define NMCH_DATA                     0x00000001")
00067 cpp_quote("#define NMCH_AUDIO                    0x00000002")
00068 cpp_quote("#define NMCH_VIDEO                    0x00000004")
00069 cpp_quote("#define NMCH_SHARE                    0x00000010")
00070 cpp_quote("#define NMCH_FT                       0x00000020")
00071 cpp_quote("#define NMCH_ALL                      0x0000FFFF")
00072 cpp_quote("#define NMCH_SECURE                   0x00010000")
00073
00074 cpp_quote("")
00075 cpp_quote("// Initialization options")
00076 cpp_quote("#define NM_INIT_NORMAL                0x00000000")
00077 cpp_quote("#define NM_INIT_CONTROL               0x00000001")
00078 cpp_quote("#define NM_INIT_NO_LAUNCH             0x00000002")
00079 cpp_quote("#define NM_INIT_BACKGROUND            0x00000005")
00080
00081 cpp_quote("")
00082 cpp_quote("// INmChannelDataNotify.DataReceived dwFlags")
00083 cpp_quote("#define NM_DF_BROADCAST               0x00000010") // data was broadcast to everyone
00084 cpp_quote("#define NM_DF_PRIVATE                 0x00000020") // data was private
00085 cpp_quote("#define NM_DF_SEGMENT_END             0x00000040") // end of data block
00086 cpp_quote("#define NM_DF_SEGMENT_BEGIN           0x00000080") // start of data block
00087
00088 cpp_quote("")
00089 cpp_quote("// Audio")
00090 cpp_quote("#define NM_MAX_AUDIO_LEVEL            0x0000FFFF")
00091
00092 cpp_quote("")
00093 cpp_quote("// Video")
00094 cpp_quote("#define NM_VIDEO_NO_AUTOSIZE          0x00000000")
00095 cpp_quote("#define NM_VIDEO_SMALL                0x00000001")
00096 cpp_quote("#define NM_VIDEO_MEDIUM               0x00000002")
00097 cpp_quote("#define NM_VIDEO_LARGE                0x00000004")
00098 cpp_quote("#define NM_VIDEO_MIN_QUALITY          0x00000000")
00099 cpp_quote("#define NM_VIDEO_MAX_QUALITY          0x0000001F")
00100 cpp_quote("#define NM_VIDEO_DEFAULT_QUALITY      NM_VIDEO_MAX_QUALITY")
00101 cpp_quote("#define NM_VIDEO_SOURCE_DIALOG        0x00000001")
00102 cpp_quote("#define NM_VIDEO_FORMAT_DIALOG        0x00000002")
00103
00104 cpp_quote("")
00105 cpp_quote("// Version Numbers")
00106 cpp_quote("#define NM_VER_UNKNOWN                0x00000000")
00107 cpp_quote("#define NM_VER_1                      0x00000001")
00108 cpp_quote("#define NM_VER_2                      0x00000002")
00109 cpp_quote("#define NM_VER_3                      0x00000003")
00110 cpp_quote("#define NM_VER_NetMeeting3            0x00000004")
00111 cpp_quote("#define NM_VER_FUTURE                 0x0000000F")
00112 cpp_quote("")
00113
00114
00115 cpp_quote("")
00116 cpp_quote("// User Categories")
00117 cpp_quote("#define NM_CATEGORY_PERSONAL          0x00000001")
00118 cpp_quote("#define NM_CATEGORY_BUSINESS          0x00000002")
00119 cpp_quote("#define NM_CATEGORY_ADULT             0x00000004")
00120 cpp_quote("")
00121
00122 cpp_quote("")
00123 cpp_quote("////////////////////////////////////////////////////////////////////////////")
00124 cpp_quote("//  Error Codes")
00125 cpp_quote("")
00126 cpp_quote("#define NM_E(e) (0x81000000UL | (ULONG) (e))")
00127 cpp_quote("")
00128 cpp_quote("enum {")
00129
00130 cpp_quote("")
00131 cpp_quote("// NetMeeting specific error codes")
00132 cpp_quote("//")
00133 cpp_quote("  NM_S_NEXT_CONFERENCE          = ((ULONG) 0x0201),") // INmSysInfo.SetProperty
00134 cpp_quote("  NM_S_ON_RESTART               = ((ULONG) 0x0202),") // INmSysInfo.SetProperty
00135 cpp_quote("")
00136
00137 cpp_quote("")
00138 cpp_quote("// Call specific error codes")
00139 cpp_quote("//")
00140 cpp_quote("  NM_CALLERR_NOT_INITIALIZED    = NM_E(0x0100),") // Local system not initialized
00141 cpp_quote("  NM_CALLERR_MEDIA              = NM_E(0x0101),") // Invalid channel/media types
00142 cpp_quote("  NM_CALLERR_NAME_RESOLUTION    = NM_E(0x0102),") // Name resolution failed
00143 cpp_quote("  NM_CALLERR_PASSWORD           = NM_E(0x0103),") // Invalid conference password
00144 cpp_quote("  NM_CALLERR_CONFERENCE_NAME    = NM_E(0x0104),") // Problem with the conference name
00145 cpp_quote("  NM_CALLERR_IN_CONFERENCE      = NM_E(0x0105),") // Remote system is in a conference
00146 cpp_quote("  NM_CALLERR_NOT_FOUND          = NM_E(0x0106),") // User/Address not found
00147 cpp_quote("  NM_CALLERR_MCU                = NM_E(0x0107),") // Can't invite MCU into existing conference
00148 cpp_quote("  NM_CALLERR_REJECTED           = NM_E(0x0108),") // Remote system rejected the request
00149 cpp_quote("  NM_CALLERR_AUDIO              = NM_E(0x0109),") // Audio connection failed
00150 cpp_quote("  NM_CALLERR_AUDIO_LOCAL        = NM_E(0x010A),") // Local audio device already in use
00151 cpp_quote("  NM_CALLERR_AUDIO_REMOTE       = NM_E(0x010B),") // Remote audio device in use
00152 cpp_quote("  NM_CALLERR_INVALID_PHONE_NUMBER  = NM_E(0x01F0),") // Tried phone type with invalid phone number
00153 cpp_quote("  NM_CALLERR_NO_PHONE_SUPPORT    = NM_E(0x01F1),") // Tried phone type with no GK/GW configured
00154 cpp_quote("  NM_CALLERR_INVALID_IPADDRESS   = NM_E(0x01F2),") // Tried ip type with invalid ip address
00155 cpp_quote("  NM_CALLERR_HOST_RESOLUTION_FAILED  = NM_E(0x01F3),") // Tried computer type with unreachable host name
00156 cpp_quote("  NM_CALLERR_NO_ILS          = NM_E(0x01F4),") // Tried ils type with no ils configured
00157 cpp_quote("  NM_CALLERR_ILS_RESOLUTION_FAILED = NM_E(0x01F5),") // Name not found on ils
00158 cpp_quote("  NM_CALLERR_NO_ADDRESS        = NM_E(0x01F6),") // No address component
00159 cpp_quote("  NM_CALLERR_INVALID_ADDRESS     = NM_E(0x01F7),") // Invalid address component
00160 cpp_quote("  NM_CALLERR_NO_GATEKEEPER     = NM_E(0x01F8),") // Could not reach gatekeeper
00161 cpp_quote("  NM_CALLERR_NO_GATEWAY        = NM_E(0x01F9),") // Could not reach gateway
00162 cpp_quote("  NM_CALLERR_PARAM_ERROR       = NM_E(0x01FA),") // Error in parameter syntax
00163 cpp_quote("  NM_CALLERR_SECURITY_MISMATCH   = NM_E(0x01FB),") // Desired security didnt match policy or current conference
00164 cpp_quote("  NM_CALLERR_UNESCAPE_ERROR      = NM_E(0x01FC),") // Parse error during unescaping
00165 cpp_quote("  NM_CALLERR_ALREADY_CALLING    = NM_E(0x01FD),") // Already calling this person
00166 cpp_quote("  NM_CALLERR_LOOPBACK           = NM_E(0x01FE),") // Called Local Machine
00167 cpp_quote("  NM_CALLERR_UNKNOWN            = NM_E(0x01FF),") // Unknown call error
00168 cpp_quote("")
00169 cpp_quote("// other error codes")
00170 cpp_quote("//")
00171 cpp_quote("  NM_E_NOT_INITIALIZED          = NM_E(0x0200),") // INmManager not Initialized
00172 cpp_quote("  NM_E_CHANNEL_ALREADY_EXISTS   = NM_E(0x0201),") // Data channel already exists
00173 cpp_quote("  NM_E_NO_T120_CONFERENCE       = NM_E(0x0202),") // Not in a T.120 data conference
00174 cpp_quote("  NM_E_NOT_ACTIVE               = NM_E(0x0203),") // NetMeeting is not running
00175 cpp_quote("  NM_E_FILE_TOO_BIG             = NM_E(0x0204),") // The file we attempted to send is too big
00176 cpp_quote("  NM_E_USER_CANCELED_SETUP    = NM_E(0x0205),") // User canceled NetMeeting setup wizard
00177 cpp_quote("  NM_E_ALREADY_RUNNING      = NM_E(0x0206),") // This means that NetMeeting is already running
00178 cpp_quote("  NM_E_SHARING_NOT_AVAILABLE    = NM_E(0x0207),") // This means that NetMeeting is already running
00179
00180
00181
00182 cpp_quote("};")
00183 cpp_quote("")
00184
00185 cpp_quote("")
00186 cpp_quote("// GUID to receive userdata from \"callto:\" via INmCall::GetUserData")
00187 cpp_quote("//")
00188 cpp_quote("// {068B0780-718C-11d0-8B1A-00A0C91BC90E}")
00189 cpp_quote("DEFINE_GUID(GUID_CallToUserData,")
00190 cpp_quote("0x068b0780, 0x718c, 0x11d0, 0x8b, 0x1a, 0x0, 0xa0, 0xc9, 0x1b, 0xc9, 0x0e);")
00191 cpp_quote("")
00192
00193
00194 typedef enum tagNmConferenceState{
00195     NM_CONFERENCE_IDLE                           = 0,
00196     NM_CONFERENCE_WAITING                        = 1,
00197     NM_CONFERENCE_INITIALIZING                   = 2,
00198     NM_CONFERENCE_ACTIVE                         = 3,
00199 } NM_CONFERENCE_STATE;
00200
00201 typedef enum tagNmCallType{
00202     NM_CALL_DEFAULT                              = 0,
00203     NM_CALL_T120                                 = 1,
00204     NM_CALL_H323                                 = 2,
00205 } NM_CALL_TYPE;
00206
00207 typedef enum tagNmAddrType{
00208     NM_ADDR_UNKNOWN                              = 0,
00209     NM_ADDR_IP                                   = 1,
00210     NM_ADDR_MACHINENAME                          = 2,
00211     NM_ADDR_PSTN                                 = 3,
00212     NM_ADDR_ULS                                  = 4,
00213     NM_ADDR_H323_GATEWAY                         = 5,
00214     NM_ADDR_CALLTO                               = 6,
00215     NM_ADDR_T120_TRANSPORT                       = 7,
00216 } NM_ADDR_TYPE;
00217
00218 typedef enum tagNmCallState{
00219     NM_CALL_INVALID                              = 0,
00220     NM_CALL_INIT                                 = 1,
00221     NM_CALL_RING                                 = 2,
00222     NM_CALL_SEARCH                               = 3,
00223     NM_CALL_WAIT                                 = 4,
00224     NM_CALL_ACCEPTED                             = 5,
00225     NM_CALL_REJECTED                             = 6,
00226     NM_CALL_CANCELED                             = 7,
00227 } NM_CALL_STATE;
00228
00229 typedef enum tagNmMemberNotify{
00230     NM_MEMBER_ADDED                              = 0,
00231     NM_MEMBER_REMOVED                            = 1,
00232     NM_MEMBER_UPDATED                            = 2,
00233 } NM_MEMBER_NOTIFY;
00234
00235 typedef enum tagNmChannelNotify{
00236     NM_CHANNEL_ADDED                             = 0,
00237     NM_CHANNEL_REMOVED                           = 1,
00238     NM_CHANNEL_UPDATED                           = 2,
00239 } NM_CHANNEL_NOTIFY;
00240
00241 typedef enum tagNmFtState{
00242     NM_FT_INVALID                                = 0,
00243     NM_FT_SENDING                                = 1,
00244     NM_FT_RECEIVING                              = 2,
00245     NM_FT_COMPLETE                               = 3,
00246 } NM_FT_STATE;
00247
00248 typedef enum tagNmAudioState{
00249     NM_AUDIO_IDLE                                = 0,
00250     NM_AUDIO_LOCAL_PAUSED                        = 1,
00251     NM_AUDIO_TRANSFERRING                        = 3,
00252 } NM_AUDIO_STATE;
00253
00254 typedef enum tagNmAudProp{
00255     NM_AUDPROP_LEVEL                             = 1,
00256     NM_AUDPROP_PAUSE                             = 2,
00257 } NM_AUDPROP;
00258
00259 typedef enum tagNmVideoState{
00260     NM_VIDEO_IDLE                                = 0,
00261     NM_VIDEO_LOCAL_PAUSED                        = 1,
00262     NM_VIDEO_PREVIEWING                          = 2,
00263     NM_VIDEO_TRANSFERRING                        = 3,
00264     NM_VIDEO_BOTH_PAUSED                         = 5,
00265     NM_VIDEO_REMOTE_PAUSED                       = 7,
00266 } NM_VIDEO_STATE;
00267
00268 typedef enum tagNmVidProp{
00269     NM_VIDPROP_PAUSE                             = 1,
00270     NM_VIDPROP_WINDOW_AUTO_SIZE                  = 2,
00271     NM_VIDPROP_WINDOW_SIZE                       = 3,
00272     NM_VIDPROP_WINDOW_POSITION                   = 4,
00273     NM_VIDPROP_WINDOW_TOP_MOST                   = 5,
00274     NM_VIDPROP_WINDOW_VISIBLE                    = 6,
00275     NM_VIDPROP_IMAGE_PREFERRED_SIZE              = 7,
00276     NM_VIDPROP_IMAGE_QUALITY                     = 8,
00277     NM_VIDPROP_CAMERA_DIALOG                     = 9,
00278 } NM_VIDPROP;
00279
00280 typedef enum tagNmShareState{
00281     NM_SHARE_UNKNOWN                             = 0,
00282     NM_SHARE_WORKING_ALONE                       = 1,
00283     NM_SHARE_COLLABORATING                       = 2,
00284     NM_SHARE_IN_CONTROL                          = 3,
00285 } NM_SHARE_STATE;
00286
00287 typedef enum tagNmShAppState{
00288     NM_SHAPP_NOT_SHARED                          = 0,
00289     NM_SHAPP_SHARED                              = 1,
00290 } NM_SHAPP_STATE;
00291
00292 typedef enum tagNmSysProp{
00293     NM_SYSPROP_EMAIL_NAME                        = 1,
00294     NM_SYSPROP_SERVER_NAME                       = 2,
00295     NM_SYSPROP_RESOLVE_NAME                      = 3,
00296     NM_SYSPROP_FIRST_NAME                        = 4,
00297     NM_SYSPROP_LAST_NAME                         = 5,
00298     NM_SYSPROP_USER_NAME                         = 6,
00299     NM_SYSPROP_USER_CITY                         = 7,
00300     NM_SYSPROP_USER_COUNTRY                      = 8,
00301     NM_SYSPROP_USER_COMMENTS                     = 9,
00302     NM_SYSPROP_USER_CATEGORY                     = 10,
00303     NM_SYSPROP_USER_PHONENUM                     = 11,
00304     NM_SYSPROP_USER_LOCATION                     = 12,
00305     NM_SYSPROP_H323_GATEWAY                      = 20,
00306     NM_SYSPROP_H323_GATEWAY_ENABLE               = 21,
00307     NM_SYSPROP_INSTALL_DIRECTORY                 = 50,
00308     NM_SYSPROP_APP_NAME                          = 51,
00309   NM_SYSPROP_ICA_ENABLE                        = 60,
00310     NM_SYSPROP_LOGGED_ON                         = 69,
00311     NM_SYSPROP_IS_RUNNING                        = 100,
00312     NM_SYSPROP_IN_CONFERENCE                     = 101,
00313   NM_SYSPROP_BUILD_VER             = 200,
00314   NM_SYSPROP_DISABLE_H323            = 201,
00315   NM_SYSPROP_DISABLE_INITIAL_ILS_LOGON     = 202
00316 } NM_SYSPROP;
00317
00318 typedef enum tagConfn{
00319
00320 // File Transfer
00321     CONFN_FT_UI                                  = 0x000211,
00322     CONFN_FT_OFFERED                             = 0x000212,
00323     CONFN_FT_STARTED                             = 0x000213,
00324     CONFN_FT_PROGRESS                            = 0x000214,
00325     CONFN_FT_COMPLETE                            = 0x000215,
00326     CONFN_FT_CANCELED                            = 0x000216,
00327 // Sharing
00328     CONFN_CLICK_CONTROL                          = 0x000220,
00329     CONFN_CLICK_OBSCURE                          = 0x000221,
00330     CONFN_CLICK_REMOTE_NOT_COLLABORATING         = 0x000222,
00331     CONFN_CLICK_LOCAL_NOT_COLLABORATING          = 0x000223,
00332     CONFN_ESCAPE_KEY_CONTROL                     = 0x000224,
00333     CONFN_RIGHT_CLICK_LOCAL_NOT_COLLABORATING    = 0x000225,
00334     CONFN_RIGHT_CLICK_REMOTE_NOT_COLLABORATING   = 0x000226,
00335     CONFN_DOUBLE_CLICK_SHARED_APP                = 0x000227,
00336     CONFN_SHARE_STARTED                          = 0x000228,
00337     CONFN_SHARE_ENDED                            = 0x000229,
00338     CONFN_SHARE_FAILED                           = 0x000230,
00339
00340
00341 // Call control
00342     CONFN_CALL_INCOMPATIBLE                      = 0x000400,
00343     CONFN_CALL_OLDER                             = 0x000401,
00344     CONFN_CALL_NEWER                             = 0x000402,
00345     CONFN_CALL_IGNORED                           = 0x000403,
00346     CONFN_CALL_FAILED                            = 0x000404,
00347     CONFN_CALL_IN_CONFERENCE                     = 0x000405,
00348
00349 // Manager notifications
00350     CONFN_NM_STARTED                             = 0x000600,
00351     CONFN_NM_STOPPED                             = 0x000601,
00352
00353 } CONFN;
00354
00355
00356
00357 // INmObject constants
00358 typedef enum NM_APPID {
00359   NM_APPID_CHAT       = 1,
00360   NM_APPID_WHITEBOARD     = 2,
00361   NM_APPID_T126_WHITEBOARD  = 3,
00362   NM_APPID_FILE_TRANSFER    = 4,
00363   NM_APPID_APPSHARING     = 5
00364
00365 } NM_APPID;
00366
00367 typedef enum NM_VUI {
00368   NM_VUI_CHECK = 0,
00369   NM_VUI_SHOW = 1
00370 } NM_VUI;
00371
00372 typedef enum NM_CALLDLG {
00373   NM_CALLDLG_RESERVED = 0
00374 } NM_CALLDLG;
00375
00376
00377 //--------------------------------------------------------------------------
00378 // INmManager Interface
00379 [
00380     object,
00381     uuid(068B0701-718C-11d0-8B1A-00A0C91BC90E),
00382     pointer_default(unique)
00383 ]
00384 interface INmManager : IUnknown
00385 {
00386     typedef [unique] INmManager *LPNMMANAGER;
00387
00388   [local]
00389     HRESULT Initialize(
00390         [in, out] ULONG * puOptions, // Can be NULL
00391         [in, out] ULONG * puchCaps); // Can be NULL
00392
00393   [call_as(Initialize)]
00394   HRESULT RemoteInitialize(
00395     [in, out] ULONG * puOptions,
00396         [in, out] ULONG * puchCaps);
00397
00398     HRESULT GetSysInfo(
00399         [out] INmSysInfo **ppSysInfo);
00400
00401     HRESULT EnumConference(
00402         [out] IEnumNmConference **ppEnum);
00403
00404   [local]
00405     HRESULT CreateConference(
00406         [out] INmConference **ppConference,
00407         [in] BSTR bstrName,
00408         [in] BSTR bstrPassword,
00409         [in] ULONG uchCaps);
00410
00411   [call_as(CreateConference)]
00412     HRESULT RemoteCreateConference(
00413         [out] INmConference **ppConference,
00414         [in] BSTR bstrName,
00415         [in] BSTR bstrPassword,
00416         [in] ULONG uchCaps);
00417
00418
00419     HRESULT EnumCall(
00420         [out] IEnumNmCall **ppEnum);
00421
00422   [local]
00423     HRESULT CreateCall(
00424         [out] INmCall **ppCall,   // Can be NULL
00425         [in] NM_CALL_TYPE callType,
00426         [in] NM_ADDR_TYPE addrType,
00427         [in] BSTR bstrAddr,
00428         [in] INmConference * pConference);
00429
00430   [call_as(CreateCall)]
00431     HRESULT RemoteCreateCall(
00432         [out] INmCall **ppCall,
00433         [in] NM_CALL_TYPE callType,
00434         [in] NM_ADDR_TYPE addrType,
00435         [in] BSTR bstrAddr,
00436         [in] INmConference * pConference);
00437
00438   [local]
00439     HRESULT CallConference(
00440         [out] INmCall **ppCall,
00441         [in] NM_CALL_TYPE callType,
00442         [in] NM_ADDR_TYPE addrType,
00443         [in] BSTR bstrAddr,
00444         [in] BSTR bstrName,
00445         [in] BSTR bstrPassword);
00446
00447   [call_as(CallConference)]
00448     HRESULT RemoteCallConference(
00449         [out] INmCall **ppCall,
00450         [in] NM_CALL_TYPE callType,
00451         [in] NM_ADDR_TYPE addrType,
00452         [in] BSTR bstrAddr,
00453         [in] BSTR bstrName,
00454         [in] BSTR bstrPassword);
00455
00456 }
00457
00458 //--------------------------------------------------------------------------
00459 // INmManagerNotify Interface
00460 [
00461     object,
00462     uuid(068B0702-718C-11d0-8B1A-00A0C91BC90E),
00463     pointer_default(unique)
00464 ]
00465 interface INmManagerNotify : IUnknown
00466 {
00467     typedef [unique] INmManagerNotify *LPNMMANAGERNOTIFY;
00468
00469     HRESULT NmUI(
00470         [in] CONFN uNotify);
00471
00472     HRESULT ConferenceCreated(
00473         [in] INmConference *pConference);
00474
00475     HRESULT CallCreated(
00476         [in] INmCall *pCall);
00477 }
00478
00479
00480 //--------------------------------------------------------------------------
00481 // INmSysInfo Interface
00482 [
00483   local,
00484     object,
00485     uuid(068B0703-718C-11d0-8B1A-00A0C91BC90E),
00486     pointer_default(unique)
00487 ]
00488 interface INmSysInfo : IUnknown
00489 {
00490     typedef [unique] INmSysInfo *LPNMSYSINFO;
00491
00492     HRESULT IsInstalled(
00493         void);
00494
00495     HRESULT GetProperty(
00496         [in] NM_SYSPROP uProp,
00497         [out] BSTR *pbstrName);
00498
00499     HRESULT SetProperty(
00500         [in] NM_SYSPROP uProp,
00501         [in] BSTR bstrName);
00502
00503     HRESULT GetUserData(
00504         [in] REFGUID rguid,
00505         [out] BYTE **ppb,
00506         [out] ULONG *pcb);
00507
00508     HRESULT SetUserData(
00509         [in] REFGUID rguid,
00510         [in] BYTE *pb,
00511         [in] ULONG cb);
00512
00513     HRESULT GetNmApp(
00514         [in] REFGUID rguid,
00515         [out] BSTR *pbstrApplication,
00516         [out] BSTR *pbstrCommandLine,
00517         [out] BSTR *pbstrDirectory);
00518
00519     HRESULT SetNmApp(
00520         [in] REFGUID rguid,
00521         [in] BSTR bstrApplication,
00522         [in] BSTR bstrCommandLine,
00523         [in] BSTR bstrDirectory);
00524
00525     HRESULT GetNmchCaps(
00526         [out] ULONG *pchCaps);
00527
00528     HRESULT GetLaunchInfo(
00529         [out] INmConference **ppConference, // Can be NULL
00530         [out] INmMember **ppMember);    // Can be NULL
00531
00532 }
00533
00534
00535 //--------------------------------------------------------------------------
00536 // INmCall Interface
00537 [
00538     object,
00539     uuid(068B0704-718C-11d0-8B1A-00A0C91BC90E),
00540     pointer_default(unique)
00541 ]
00542 interface INmCall : IUnknown
00543 {
00544     typedef [unique] INmCall *LPNMCALL;
00545
00546     HRESULT IsIncoming(
00547         void);
00548
00549     HRESULT GetState(
00550         [out] NM_CALL_STATE *pState);
00551
00552     HRESULT GetName(
00553         [out] BSTR *pbstrName);
00554
00555     HRESULT GetAddr(
00556         [out] BSTR *pbstrAddr,
00557         [out] NM_ADDR_TYPE *puType);
00558
00559     HRESULT GetUserData(
00560         [in] REFGUID rguid,
00561         [out, size_is(,*pcb)] BYTE **ppb,
00562         [out] ULONG *pcb);
00563
00564     HRESULT GetConference(
00565         [out] INmConference **ppConference);
00566
00567     HRESULT Accept(
00568         void);
00569
00570     HRESULT Reject(
00571         void);
00572
00573     HRESULT Cancel(
00574         void);
00575 }
00576
00577 //--------------------------------------------------------------------------
00578 // INmCallNotify Interface
00579 [
00580     object,
00581     uuid(068B0705-718C-11d0-8B1A-00A0C91BC90E),
00582     pointer_default(unique)
00583 ]
00584 interface INmCallNotify : IUnknown
00585 {
00586     HRESULT NmUI(
00587         [in] CONFN uNotify);
00588
00589     HRESULT StateChanged(
00590         [in] NM_CALL_STATE uState);
00591
00592     HRESULT Failed(
00593         [in] ULONG uError);
00594
00595     HRESULT Accepted(
00596         [in] INmConference *pConference);
00597 }
00598
00599 //--------------------------------------------------------------------------
00600 // INmConference Interface
00601 [
00602     object,
00603     uuid(068B0710-718C-11d0-8B1A-00A0C91BC90E),
00604     pointer_default(unique)
00605 ]
00606 interface INmConference : IUnknown
00607 {
00608     typedef [unique] INmConference *LPNMCONFERENCE;
00609
00610     HRESULT GetName(
00611         [out] BSTR *pbstrName);
00612
00613     HRESULT GetID(
00614         [out] ULONG *puID);
00615
00616     HRESULT GetState(
00617         [out] NM_CONFERENCE_STATE *pState);
00618
00619     HRESULT GetNmchCaps(
00620         [out] ULONG *puchCaps);
00621
00622     HRESULT GetTopProvider(
00623         [out] INmMember **ppMember);
00624
00625     HRESULT EnumMember(
00626         [out] IEnumNmMember **ppEnum);
00627
00628     HRESULT GetMemberCount(
00629         [out] ULONG * puCount);
00630
00631     HRESULT EnumChannel(
00632         [out] IEnumNmChannel **ppEnum);
00633
00634     HRESULT GetChannelCount(
00635         [out] ULONG * puCount);
00636
00637   [local]
00638     HRESULT CreateDataChannel(
00639         [out] INmChannelData **ppChannel, // Can be NULL
00640         [in] REFGUID rguid);
00641
00642   [call_as(CreateDataChannel)]
00643     HRESULT RemoteCreateDataChannel(
00644         [out] INmChannelData **ppChannel,
00645         [in] REFGUID rguid);
00646
00647
00648     HRESULT IsHosting(
00649         void);
00650
00651     HRESULT Host(
00652         void);
00653
00654     HRESULT Leave(
00655         void);
00656
00657     HRESULT LaunchRemote(
00658         [in] REFGUID rguid,
00659         [in] INmMember *pMember);
00660 }
00661
00662 //--------------------------------------------------------------------------
00663 // INmConferenceNotify Interface
00664 [
00665     object,
00666     uuid(068B0711-718C-11d0-8B1A-00A0C91BC90E),
00667     pointer_default(unique)
00668 ]
00669 interface INmConferenceNotify : IUnknown
00670 {
00671     HRESULT NmUI(
00672         [in] CONFN uNotify);
00673
00674     HRESULT StateChanged(
00675         [in] NM_CONFERENCE_STATE uState);
00676
00677     HRESULT MemberChanged(
00678         [in] NM_MEMBER_NOTIFY uNotify,
00679         [in] INmMember *pMember);
00680
00681     HRESULT ChannelChanged(
00682         [in] NM_CHANNEL_NOTIFY uNotify,
00683         [in] INmChannel *pChannel);
00684 }
00685
00686 //--------------------------------------------------------------------------
00687 // INmMember Interface
00688 [
00689     object,
00690     uuid(068B0712-718C-11d0-8B1A-00A0C91BC90E),
00691     pointer_default(unique)
00692 ]
00693 interface INmMember : IUnknown
00694 {
00695     HRESULT GetName(
00696         [out] BSTR *pbstrName);
00697
00698     HRESULT GetID(
00699         [out] ULONG *puID);
00700
00701     HRESULT GetNmVersion(
00702         [out] ULONG *puVersion);
00703
00704     HRESULT GetAddr(
00705         [out] BSTR *pbstrAddr,
00706         [out] NM_ADDR_TYPE *puType);
00707
00708     HRESULT GetUserData(
00709         [in] REFGUID rguid,
00710         [out, size_is(,*pcb)] BYTE **ppb,
00711         [out] ULONG *pcb);
00712
00713     HRESULT GetConference(
00714         [out] INmConference **ppConference);
00715
00716     HRESULT GetNmchCaps(
00717         [out] ULONG *puchCaps);
00718
00719     HRESULT GetShareState(
00720         [out] NM_SHARE_STATE *puState);
00721
00722     HRESULT IsSelf(
00723         void);
00724
00725     HRESULT IsMCU(
00726         void);
00727
00728     HRESULT Eject(
00729         void);
00730 }
00731
00732
00733 //--------------------------------------------------------------------------
00734 // INmChannel Interface
00735 [
00736     object,
00737     uuid(068B0720-718C-11d0-8B1A-00A0C91BC90E),
00738     pointer_default(unique)
00739 ]
00740 interface INmChannel : IUnknown
00741 {
00742     HRESULT IsSameAs(
00743         [in] INmChannel *pChannel);
00744
00745     HRESULT IsActive(
00746         void);
00747
00748     HRESULT SetActive(
00749         [in] BOOL fActive);
00750
00751     HRESULT GetConference(
00752         [out] INmConference **ppConference);
00753
00754     HRESULT GetInterface(
00755         [out] IID *piid);
00756
00757     HRESULT GetNmch(
00758         [out] ULONG *puCh);
00759
00760     HRESULT EnumMember(
00761         [out] IEnumNmMember **ppEnum);
00762
00763     HRESULT GetMemberCount(
00764         [out] ULONG * puCount);
00765 }
00766
00767
00768 //--------------------------------------------------------------------------
00769 // INmChannelNotify Interface
00770 [
00771     object,
00772     uuid(068B0721-718C-11d0-8B1A-00A0C91BC90E),
00773     pointer_default(unique)
00774 ]
00775 interface INmChannelNotify : IUnknown
00776 {
00777     HRESULT NmUI(
00778         [in] CONFN uNotify);
00779
00780     HRESULT MemberChanged(
00781         [in] NM_MEMBER_NOTIFY uNotify,
00782         [in] INmMember *pMember);
00783 }
00784
00785
00786 //--------------------------------------------------------------------------
00787 // INmChannelData Interface
00788 [
00789     object,
00790     uuid(068B0722-718C-11d0-8B1A-00A0C91BC90E),
00791     pointer_default(unique)
00792 ]
00793 interface INmChannelData : INmChannel
00794 {
00795     HRESULT GetGuid(
00796         [out] GUID *pguid);
00797
00798     HRESULT SendData(
00799         [in] INmMember *pMember,
00800         [in] ULONG uSize,
00801         [in, size_is(uSize)] byte *pvBuffer,
00802         [in] ULONG uOptions);
00803 }
00804
00805
00806 //--------------------------------------------------------------------------
00807 // INmChannelDataNotify Interface
00808 [
00809     object,
00810     uuid(068B0723-718C-11d0-8B1A-00A0C91BC90E),
00811     pointer_default(unique)
00812 ]
00813 interface INmChannelDataNotify : INmChannelNotify
00814 {
00815     HRESULT DataSent(
00816         [in] INmMember *pMember,
00817         [in] ULONG uSize,
00818         [in, size_is(uSize)] byte *pvBuffer);
00819
00820     HRESULT DataReceived(
00821         [in] INmMember *pMember,
00822         [in] ULONG uSize,
00823         [in, size_is(uSize)] byte *pvBuffer,
00824         [in] ULONG dwFlags);
00825 }
00826
00827
00828 //--------------------------------------------------------------------------
00829 // INmChannelAudio Interface
00830 [
00831     object,
00832     uuid(068B0724-718C-11d0-8B1A-00A0C91BC90E),
00833     pointer_default(unique)
00834 ]
00835 interface INmChannelAudio : INmChannel
00836 {
00837     HRESULT IsIncoming(
00838         void);
00839
00840     HRESULT GetState(
00841         [out] NM_AUDIO_STATE *puState);
00842
00843     HRESULT GetProperty(
00844         [in] NM_AUDPROP uID,
00845         [out] ULONG *puValue);
00846
00847     HRESULT SetProperty(
00848         [in] NM_AUDPROP uID,
00849         [in] ULONG uValue);
00850 }
00851
00852 //--------------------------------------------------------------------------
00853 // INmChannelAudioNotify Interface
00854 [
00855     object,
00856     uuid(068B0725-718C-11d0-8B1A-00A0C91BC90E),
00857     pointer_default(unique)
00858 ]
00859 interface INmChannelAudioNotify : INmChannelNotify
00860 {
00861     HRESULT StateChanged(
00862         [in] NM_AUDIO_STATE uState);
00863
00864     HRESULT PropertyChanged(
00865         [in] DWORD dwReserved);
00866 }
00867
00868
00869 //--------------------------------------------------------------------------
00870 // INmChannelVideo Interface
00871 [
00872     object,
00873     uuid(068B0726-718C-11d0-8B1A-00A0C91BC90E),
00874     pointer_default(unique)
00875 ]
00876 interface INmChannelVideo : INmChannel
00877 {
00878     HRESULT IsIncoming(
00879         void);
00880
00881     HRESULT GetState(
00882         [out] NM_VIDEO_STATE *puState);
00883
00884     HRESULT GetProperty(
00885         [in] NM_VIDPROP uID,
00886         [out] ULONG *puValue);
00887
00888     HRESULT SetProperty(
00889         [in] NM_VIDPROP uID,
00890         [in] ULONG uValue);
00891 }
00892
00893
00894 //--------------------------------------------------------------------------
00895 // INmChannelVideoNotify Interface
00896 [
00897     object,
00898     uuid(068B0727-718C-11d0-8B1A-00A0C91BC90E),
00899     pointer_default(unique)
00900 ]
00901 interface INmChannelVideoNotify : INmChannelNotify
00902 {
00903     HRESULT StateChanged(
00904         [in] NM_VIDEO_STATE uState);
00905
00906     HRESULT PropertyChanged(
00907         [in] DWORD dwReserved);
00908 }
00909
00910
00911
00912
00913 //--------------------------------------------------------------------------
00914 // INmChannelFt Interface
00915 [
00916     object,
00917     uuid(068B0728-718C-11d0-8B1A-00A0C91BC90E),
00918     pointer_default(unique)
00919 ]
00920 interface INmChannelFt : INmChannel
00921 {
00922   [local]
00923     HRESULT SendFile(
00924         [out] INmFt **ppFt,     // Can be NULL
00925         [in] INmMember *pMember,
00926         [in] BSTR bstrFile,
00927         [in] ULONG uOptions);
00928
00929   [call_as(SendFile)]
00930     HRESULT RemoteSendFile(
00931         [out] INmFt **ppFt,
00932         [in] INmMember *pMember,
00933         [in] BSTR bstrFile,
00934         [in] ULONG uOptions);
00935
00936
00937   [local]
00938     HRESULT SetReceiveFileDir(
00939         [in] BSTR bstrDir);
00940
00941   [call_as(SetReceiveFileDir)]
00942     HRESULT RemoteSetReceiveFileDir(
00943         [in] BSTR bstrDir);
00944
00945     HRESULT GetReceiveFileDir(
00946         [out] BSTR *pbstrDir);
00947 }
00948
00949
00950 //--------------------------------------------------------------------------
00951 // INmChannelFtNotify Interface
00952 [
00953     object,
00954     uuid(068B0729-718C-11d0-8B1A-00A0C91BC90E),
00955     pointer_default(unique)
00956 ]
00957 interface INmChannelFtNotify : INmChannelNotify
00958 {
00959     HRESULT FtUpdate(
00960         [in] CONFN uNotify,
00961         [in] INmFt *pFt);
00962 }
00963
00964
00965 //--------------------------------------------------------------------------
00966 // INmFt Interface
00967 [
00968     object,
00969     uuid(068B0732-718C-11d0-8B1A-00A0C91BC90E),
00970     pointer_default(unique)
00971 ]
00972 interface INmFt : IUnknown
00973 {
00974     HRESULT IsIncoming(
00975         void);
00976
00977     HRESULT GetState(
00978         [out] NM_FT_STATE *puState);
00979
00980     HRESULT GetName(
00981         [out] BSTR *pbstrName);
00982
00983     HRESULT GetSize(
00984         [out] ULONG *puBytes);
00985
00986     HRESULT GetBytesTransferred(
00987         [out] ULONG *puBytes);
00988
00989     HRESULT GetMember(
00990         [out] INmMember **ppMember);
00991
00992     HRESULT Cancel(
00993         void);
00994 }
00995
00996
00997 //--------------------------------------------------------------------------
00998 // INmChannelAppShare Interface
00999 [
01000     object,
01001     uuid(068B072A-718C-11d0-8B1A-00A0C91BC90E),
01002     pointer_default(unique)
01003 ]
01004 interface INmChannelAppShare : INmChannel
01005 {
01006     HRESULT GetState(
01007         [out] NM_SHARE_STATE *puState);
01008
01009     HRESULT SetState(
01010         [in] NM_SHARE_STATE uState);
01011
01012     HRESULT EnumSharableApp(
01013         [out] IEnumNmSharableApp **ppEnum);
01014 }
01015
01016 //--------------------------------------------------------------------------
01017 // INmChannelAppShareNotify Interface
01018 [
01019     object,
01020     uuid(068B072B-718C-11d0-8B1A-00A0C91BC90E),
01021     pointer_default(unique)
01022 ]
01023 interface INmChannelAppShareNotify : INmChannelNotify
01024 {
01025     HRESULT StateChanged(
01026         [in] NM_SHAPP_STATE uState,
01027         [in] INmSharableApp *pApp);
01028 }
01029
01030
01031 //--------------------------------------------------------------------------
01032 // INmSharableApp Interface
01033 [
01034     object,
01035     uuid(068B0734-718C-11d0-8B1A-00A0C91BC90E),
01036     pointer_default(unique)
01037 ]
01038 interface INmSharableApp : IUnknown
01039 {
01040     HRESULT GetName(
01041         [out] BSTR *pbstrName);
01042
01043     HRESULT GetHwnd(
01044         [out] HWND * phwnd);
01045
01046      HRESULT GetState(
01047         [out] NM_SHAPP_STATE *puState);
01048
01049      HRESULT SetState(
01050         [in] NM_SHAPP_STATE uState);
01051 }
01052
01053
01054
01055 cpp_quote("")
01056 cpp_quote("////////////////////////////////////////////////////////////////////////////")
01057 cpp_quote("//  Enumerator Definitions")
01058
01059
01060 //--------------------------------------------------------------------------
01061 // IEnumNmConference Interface
01062 [
01063     object,
01064     uuid(068B0741-718C-11d0-8B1A-00A0C91BC90E),
01065     pointer_default(unique)
01066 ]
01067 interface IEnumNmConference : IUnknown
01068 {
01069   [local]
01070     HRESULT Next(
01071         [in] ULONG cConference,
01072         [out] INmConference **rgpConference,
01073         [out] ULONG *pcFetched);
01074
01075   [call_as(Next)]
01076     HRESULT RemoteNext(
01077         [in] ULONG cConference,
01078         [out, size_is(cConference), length_is(*pcFetched) ] INmConference **rgpConference,
01079         [out] ULONG *pcFetched,
01080     [out] ULONG *pcItems,
01081     [in] BOOL bGetNumberRemaining);
01082
01083     HRESULT Skip(
01084         [in] ULONG cConference);
01085
01086     HRESULT Reset();
01087
01088     HRESULT Clone(
01089         [out] IEnumNmConference **ppEnum);
01090 }
01091
01092
01093 //--------------------------------------------------------------------------
01094 // IEnumNmMember Interface
01095 [
01096     object,
01097     uuid(068B0742-718C-11d0-8B1A-00A0C91BC90E),
01098     pointer_default(unique)
01099 ]
01100 interface IEnumNmMember : IUnknown
01101 {
01102   [local]
01103     HRESULT Next(
01104         [in] ULONG cMember,
01105         [out] INmMember **rgpMember,
01106         [out] ULONG *pcFetched);
01107
01108   [call_as(Next)]
01109     HRESULT RemoteNext(
01110         [in] ULONG cMember,
01111         [out, size_is(cMember), length_is(*pcFetched) ] INmMember **rgpMember,
01112         [out] ULONG *pcFetched,
01113     [out] ULONG *pcItems,
01114     [in] BOOL bGetNumberRemaining);
01115
01116     HRESULT Skip(
01117         [in] ULONG cMember);
01118
01119     HRESULT Reset();
01120
01121     HRESULT Clone(
01122         [out] IEnumNmMember **ppEnum);
01123 }
01124
01125
01126 //--------------------------------------------------------------------------
01127 // IEnumNmChannel Interface
01128 [
01129     object,
01130     uuid(068B0743-718C-11d0-8B1A-00A0C91BC90E),
01131     pointer_default(unique)
01132 ]
01133 interface IEnumNmChannel : IUnknown
01134 {
01135   [local]
01136     HRESULT Next(
01137         [in] ULONG cChannel,
01138         [out, size_is(cChannel), length_is(*pcFetched)] INmChannel **rgpChannel,
01139         [out] ULONG *pcFetched);
01140
01141   [call_as(Next)]
01142     HRESULT RemoteNext(
01143         [in] ULONG cChannel,
01144         [out, size_is(cChannel), length_is(*pcFetched)] INmChannel **rgpChannel,
01145         [out] ULONG *pcFetched,
01146     [out] ULONG *pcItems,
01147     [in] BOOL bGetNumberRemaining);
01148
01149     HRESULT Skip(
01150         [in] ULONG cChannel);
01151
01152     HRESULT Reset();
01153
01154     HRESULT Clone(
01155         [out] IEnumNmChannel **ppEnum);
01156 }
01157
01158
01159 //--------------------------------------------------------------------------
01160 // IEnumNmCall Interface
01161 [
01162     object,
01163     uuid(068B0744-718C-11d0-8B1A-00A0C91BC90E),
01164     pointer_default(unique)
01165 ]
01166 interface IEnumNmCall : IUnknown
01167 {
01168   [local]
01169   HRESULT Next(
01170         [in] ULONG cCall,
01171         [out] INmCall **rgpCall,
01172         [out] ULONG *pcFetched);
01173
01174   [call_as(Next)]
01175     HRESULT RemoteNext(
01176         [in] ULONG cCall,
01177         [out, size_is(cCall), length_is(*pcFetched)] INmCall **rgpCall,
01178         [out] ULONG *pcFetched,
01179     [out] ULONG *pcItems,
01180     [in] BOOL bGetNumberRemaining);
01181
01182     HRESULT Skip(
01183         [in] ULONG cCall);
01184
01185     HRESULT Reset();
01186
01187     HRESULT Clone(
01188         [out] IEnumNmCall **ppEnum);
01189 }
01190
01191
01192 //--------------------------------------------------------------------------
01193 // IEnumNmSharableApp Interface
01194 [
01195     object,
01196     uuid(068B0745-718C-11d0-8B1A-00A0C91BC90E),
01197     pointer_default(unique)
01198 ]
01199 interface IEnumNmSharableApp : IUnknown
01200 {
01201   [local]
01202     HRESULT Next(
01203         [in] ULONG cApp,
01204         [out] INmSharableApp **rgpApp,
01205         [out] ULONG *pcFetched);
01206
01207   [call_as(Next)]
01208     HRESULT RemoteNext(
01209         [in] ULONG cApp,
01210         [out, size_is(cApp), length_is(*pcFetched)] INmSharableApp **rgpApp,
01211         [out] ULONG *pcFetched,
01212     [out] ULONG *pcItems,
01213     [in] BOOL bGetNumberRemaining);
01214
01215     HRESULT Skip(
01216         [in] ULONG cApp);
01217
01218     HRESULT Reset();
01219
01220     HRESULT Clone(
01221         [out] IEnumNmSharableApp **ppEnum);
01222 }
01223
01224 [
01225   object,
01226   uuid(068B0780-718C-11d0-8B1A-00A0C91BC90E), // IID_INmOffice
01227   pointer_default(unique)
01228 ]
01229 interface INmObject : IUnknown
01230 {
01231   HRESULT CallDialog([in] long hwnd, [in] int options);
01232
01233   HRESULT ShowLocal([in] NM_APPID appId);
01234
01235   [local]
01236   HRESULT VerifyUserInfo([in] long hwnd, [in] NM_VUI options);
01237
01238   [call_as(VerifyUserInfo)]
01239   HRESULT RemoteVerifyUserInfo([in] long hwnd, [in] NM_VUI options);
01240
01241 };
01242
01243 [
01244     uuid(068B07FF-718C-11d0-8B1A-00A0C91BC90E),
01245     version(1.0),
01246     helpstring("NmManager 2.0 Type Library")
01247 ]
01248 library NmManager
01249 {
01250
01251     [
01252         uuid(068B0700-718C-11d0-8B1A-00A0C91BC90E),
01253         helpstring("NetMeeting Manager")
01254     ]
01255     coclass NmManager
01256     {
01257         [default] interface INmManager;
01258     };
01259 };
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/SERVER.CPP Source File

  • Com
  • async
  • server

SERVER.CPP

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "CFactory.h"
00018 #include "DCOMServer.h"
00019 ///////////////////////////////////////////////////////////
00020 //
00021 // Server.cpp
00022 //
00023 // This file contains the component server code.
00024 // The FactoryDataArray contains the components that
00025 // can be served.
00026 //
00027
00028 // Each component derived from CUnknown defines a static function
00029 // for creating the component with the following prototype.
00030 // HRESULT CreateInstance(IUnknown* pUnknownOuter,
00031 //                        CUnknown** ppNewComponent) ;
00032 // This function is used to create the component.
00033 //
00034
00035 //
00036 // The following array contains the data used by CFactory
00037 // to create components. Each element in the array contains
00038 // the CLSID, the pointer to the creation function, and the name
00039 // of the component to place in the Registry.
00040 //
00041
00042
00043 #define _OLEIVERB_PRIMARY   0
00044 #define _OLEIVERB_SHOW      FF
00045 #define _OLEIVERB_OPEN      FE
00046 #define _OLEIVERB_HIDE      FD
00047 #define _OLEIVERB_PROPERTIES  F9
00048 // MACRO's used to combine and extract the OLE verb and name
00049
00050 #define MAKEINTS1(s) #s
00051 #define MAKEINTS2(iVerb) MAKEINTS1(\x ## iVerb)
00052 #define MAKEINTVERB(iVerb, lpstrName) MAKEINTS2(iVerb) lpstrName
00053 #define MAKEINTI(i) i
00054
00055 #define MAKEVERSION(M, m) ((DWORD)(WORD)(m) | (DWORD)(WORD)(M) << 16) // M=Major, m=minor
00056
00057 #if defined(_EVENTSINK_)
00058 #pragma message("Build for asynchronous Event sinks")
00059 #endif
00060
00061 CFactoryData g_FactoryDataArray[] =
00062 {
00063   {
00064     MAKEVERSION(1, 0),            // Version of CFactoryData
00065     LOCAL,                  // Type of COM server
00066     NULL,                 // Threading model
00067     &CLSID_AsyncTest,           // CLSID for object
00068     CServer::CreateInstance,        // Helper function for ICF::CreateInstance()
00069     "Async COM - Work in Progress",     // Friendly Name
00070     L"ASYNC_SVR.1",             // ProgID
00071     L"ASYNC_SVR",             // Version-independent ProgID
00072     NULL,                 // Short User type
00073     NULL,                 // Appliction name
00074 #if defined(_EVENTSINK_)
00075     &LIBID_Async_Lib,           // TypeLibrary
00076     MAKELCID(               // LCID of typelib
00077       MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT),
00078     MAKEVERSION(1, 0),            // Version of typelib
00079 #else
00080     &CLSID_NULL,              // TypeLibrary
00081     0,                    // LCID of typelib
00082     0,                    // Version of typelib
00083 #endif
00084     true,                 // True for custom interface
00085     0,                    // Verbs
00086     0                   // MISC bits
00087   }
00088
00089 } ;
00090
00091 int g_cFactoryDataEntries
00092   = sizeof(g_FactoryDataArray) / sizeof(CFactoryData) ;
00093
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/sky.h Source File

  • SysMgmt
  • MMC
  • Openserv

sky.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SKY_H
00021 #define _SKY_H
00022
00023 #include "DeleBase.h"
00024
00025 class CSkyBasedVehicle : public CDelegationBase {
00026 public:
00027     CSkyBasedVehicle() { }
00028
00029     virtual ~CSkyBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Sky-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_SKYICON; }
00034
00035 private:
00036     enum { IDM_NEW_SKY = 3 };
00037
00038     // {2974380F-4C4B-11d2-89D8-000021473128}
00039     static const GUID thisGuid;
00040 };
00041
00042
00043 #endif // _SKY_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/registry.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

registry.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include <ObjBase.h>
00016 #include "Registry.h"
00017 #include "Globals.h"
00018
00019
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("Registry")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Internal helper functions prototypes
00027
00028
00029 // Set the given key and its value.
00030 HRESULT SetKeyAndValue( const TCHAR* pszPath, const TCHAR* szSubkey, const TCHAR* szValue);
00031
00032 // Set the given key and its value in the MMC Snapin location
00033 HRESULT SetSnapInKeyAndValue( const TCHAR* szKey, const TCHAR* szSubkey, const TCHAR* szName, const TCHAR* szValue );
00034
00035 // Set the given valuename under the key to value
00036 HRESULT SetValue( const TCHAR* szKey, const TCHAR* szValueName, const TCHAR* szValue);
00037
00038 // Delete szKeyChild and all of its descendents.
00039 HRESULT RecursiveDeleteKey( HKEY hKeyParent, const TCHAR* szKeyChild );
00040
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // Public function implementation
00044
00045
00046 //---------------------------------------------------------------------------
00047 //  Register the component in the registry.  This is the minimalist way
00048 //  to register a component, you may want to add keys for ProgID.
00049 //
00050 HRESULT RegisterServer
00051 (
00052   HMODULE        hModule,          //[in] DLL module handle
00053   const CLSID&   clsid,            //[in] Class ID
00054   const TCHAR*   szFriendlyName    //[in] Name string
00055 )
00056 {
00057   // Get server location.
00058   TCHAR    szModule[512] ;
00059   TCHAR*   pszCLSID = NULL;
00060   LPOLESTR wszCLSID = NULL ;
00061   HRESULT  hResult  = S_FALSE;
00062
00063   DWORD dwResult = ::GetModuleFileName( hModule,
00064                                         szModule,
00065                                         sizeof(szModule)/sizeof(TCHAR)
00066                                       );
00067   if( 0 == dwResult ) return HRESULT_FROM_WIN32( dwResult );
00068
00069   do                         // Fail unless we complete everything
00070   {
00071     // Get CLSID string in wide char
00072     hResult = StringFromCLSID( clsid, &wszCLSID ) ;
00073     if( S_OK != hResult )
00074     {
00075       CoTaskMemFree( wszCLSID );
00076       BREAK_ON_ERROR( hResult );
00077     }
00078
00079     W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00080     CoTaskMemFree( wszCLSID );           // Through with wide version
00081
00082     TCHAR szKey[64];                     // Build the CLSID key string CLSID\\{...}
00083     _tcscpy( szKey, _T("CLSID\\") );
00084     _tcscat( szKey, pszCLSID );
00085
00086     // Add the CLSID to the registry.
00087     hResult = SetKeyAndValue( szKey, NULL, szFriendlyName );
00088     BREAK_ON_ERROR( hResult );
00089
00090     // Add the server filename subkey under the CLSID key.
00091     hResult = SetKeyAndValue( szKey, _T("InprocServer32"), szModule );
00092     BREAK_ON_ERROR( hResult );
00093
00094     // Set the threading model
00095     _tcscat( szKey, _T("\\InprocServer32") );
00096     hResult = SetValue( szKey, _T("ThreadingModel"), _T("Apartment") );
00097     BREAK_ON_ERROR( hResult );
00098
00099   }while( 0 );
00100
00101   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00102
00103   return hResult;
00104 }
00105
00106
00107 //---------------------------------------------------------------------------
00108 // Remove the component from the registry.
00109 //
00110 LONG UnregisterServer
00111 (
00112   const CLSID& clsid         //[in] Class ID of component to remove
00113 )
00114 {
00115   HRESULT hResult = S_OK;
00116
00117   // Allocate the CLSID string
00118   LPOLESTR wszCLSID = NULL ;
00119   hResult = StringFromCLSID( clsid, &wszCLSID );
00120   if( S_OK != hResult )
00121   {
00122     CoTaskMemFree( wszCLSID );
00123     return hResult;
00124   }
00125
00126   // Build the key CLSID\\{...}
00127   TCHAR szKey[64];
00128   _tcscpy( szKey, _T("CLSID\\") );
00129
00130   TCHAR* pszCLSID = NULL;
00131   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00132   CoTaskMemFree( wszCLSID );           // Through with wide version
00133
00134   _tcscat( szKey, pszCLSID );
00135   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00136
00137   // Delete the CLSID Key - CLSID\{...}
00138   LONG lResult = RecursiveDeleteKey( HKEY_CLASSES_ROOT, szKey );
00139   if( ERROR_SUCCESS != lResult )
00140     hResult = HRESULT_FROM_WIN32( lResult );
00141
00142   return hResult;
00143 }
00144
00145 //---------------------------------------------------------------------------
00146 // Register the snap-in in the registry.
00147 //
00148 HRESULT RegisterSnapin
00149 (
00150   const  CLSID&  clsid,              //[in] Class ID
00151   const  TCHAR*  szNameString,       //[in] NameString
00152   const  CLSID&  clsidAbout,         //[in] Class Id for About Class
00153   const  BOOL    bSupportExtensions  //[in] TRUE if we support extensions
00154 )
00155 {
00156   HRESULT hResult = S_FALSE;
00157   TCHAR*  pszSnapCLSID = NULL;         // Needed for TCHAR version of the ClassID
00158
00159   // If any part of this process fails, jump out of the loop and return
00160   // the error code
00161   do
00162   {
00163     // Allocate the CLSID string
00164     LPOLESTR wszSnapCLSID  = NULL ;
00165     hResult = StringFromCLSID( clsid, &wszSnapCLSID ) ;
00166     if( S_OK != hResult )
00167     {
00168        CoTaskMemFree( wszSnapCLSID );
00169        continue;
00170     }
00171
00172     W2T( &pszSnapCLSID, wszSnapCLSID );  // W2T is defined in Globals.h
00173     CoTaskMemFree( wszSnapCLSID );       // Through with wide version
00174
00175     // Add the Snap-in's CLSID to the registry
00176     hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("NameString"), szNameString );
00177     BREAK_ON_ERROR( hResult );
00178
00179     hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("StandAlone"), NULL, NULL );
00180     BREAK_ON_ERROR( hResult );
00181
00182     // Add registry information for ISnapinAbout if we support it
00183     LPOLESTR wszAboutCLSID = NULL;
00184     TCHAR*   pszAboutCLSID = NULL;
00185     if( IID_NULL != clsidAbout )
00186     {
00187       hResult = StringFromCLSID( clsidAbout, &wszAboutCLSID );
00188       if( S_OK != hResult )
00189       {
00190         CoTaskMemFree( wszAboutCLSID ); // Free this memory before exiting
00191         continue;
00192       }
00193
00194       W2T( &pszAboutCLSID, wszAboutCLSID );
00195       hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("About"), pszAboutCLSID );
00196       CoTaskMemFree( wszAboutCLSID );
00197       CoTaskMemFree( pszAboutCLSID );
00198       BREAK_ON_ERROR( hResult );
00199     }
00200
00201     if( TRUE == bSupportExtensions )     // Build the NodeTypesKey
00202     {
00203       hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("NodeTypes"), NULL, NULL );
00204       BREAK_ON_ERROR( hResult );
00205       TCHAR szKey[64];
00206       _tcscpy( szKey, pszSnapCLSID );
00207       _tcscat(szKey, _T("\\NodeTypes"));
00208       hResult = SetSnapInKeyAndValue( szKey, pszSnapCLSID, NULL, NULL );
00209       BREAK_ON_ERROR( hResult );
00210     }
00211   }while( 0 );
00212
00213   CoTaskMemFree( pszSnapCLSID);
00214   return hResult;
00215 }
00216
00217
00218 //---------------------------------------------------------------------------
00219 // Unregister the snap-in in the registry.
00220 //
00221 HRESULT UnregisterSnapin
00222 (
00223   const CLSID& clsid         //[in] Class ID of object to unregister
00224 )
00225 {
00226   HRESULT hResult = S_OK;
00227
00228   TCHAR    szKeyBuf[1024];
00229   LPOLESTR wszCLSID = NULL;
00230   TCHAR*   pszCLSID = NULL;        // Needed for TCHAR version of the ClassID
00231
00232   // Get CLSID as a wide string
00233   hResult = StringFromCLSID( clsid, &wszCLSID );
00234   if( S_OK != hResult )
00235   {
00236     CoTaskMemFree( wszCLSID );
00237     return hResult;
00238   }
00239
00240   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00241   CoTaskMemFree( wszCLSID );           // Through with wide version
00242
00243   // Load the buffer with the Snap-In Location
00244   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00245
00246   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00247   _tcscat( szKeyBuf, pszCLSID );
00248
00249   // Delete the CLSID Key - CLSID\{...}
00250   LONG lResult = RecursiveDeleteKey( HKEY_LOCAL_MACHINE, szKeyBuf );
00251   if( ERROR_SUCCESS != lResult )
00252     hResult = HRESULT_FROM_WIN32( lResult );
00253
00254   CoTaskMemFree( pszCLSID );
00255   return hResult;
00256 }
00257
00258 //---------------------------------------------------------------------------
00259 // Delete a key and all of its descendents.
00260 //
00261 HRESULT RecursiveDeleteKey
00262 (
00263   HKEY          hKeyParent,    //[in] Parent of key to delete
00264   const TCHAR*  lpszKeyChild   //[in] Key to delete
00265 )
00266 {
00267   // Open the child.
00268   HKEY hKeyChild = NULL;
00269   LONG lResult   = ERROR_SUCCESS;
00270
00271   do                     // We go to all this trouble to prevent any
00272   {                      // possibility of exiting while leaving a key open
00273
00274     lResult = RegOpenKeyEx( hKeyParent,
00275                             lpszKeyChild,
00276                             0,
00277                             KEY_ALL_ACCESS,
00278                             &hKeyChild
00279                           );
00280     if( ERROR_SUCCESS != lResult )
00281       continue;
00282
00283     // Enumerate all of the decendents of this child.
00284     FILETIME time;
00285     _TCHAR szBuffer[256];
00286     DWORD dwSize = 256;
00287     while( S_OK == RegEnumKeyEx(hKeyChild,0,szBuffer,&dwSize,NULL,NULL,NULL,&time) )
00288     {
00289       // Delete the decendents of this child.
00290       lResult = RecursiveDeleteKey( hKeyChild, szBuffer );
00291       if( ERROR_SUCCESS != lResult )
00292       {
00293         continue;
00294       }
00295       dwSize = 256;
00296     }
00297   }while( 0 );
00298
00299   RegCloseKey( hKeyChild );            // Always try to close the child
00300                                        // then delete this child.
00301   return RegDeleteKey( hKeyParent, lpszKeyChild );
00302 }
00303
00304 //---------------------------------------------------------------------------
00305 // Create a Registry Key and set its value.
00306 //   - This helper function was borrowed and modifed from
00307 //     Kraig Brockschmidt's book Inside OLE.
00308 //
00309 HRESULT SetKeyAndValue
00310 (
00311   const TCHAR*  szKey,       //[in] Parent key
00312   const TCHAR*  szSubkey,    //[in] Child key
00313   const TCHAR*  szValue      //[in] Value to set
00314 )
00315 {
00316   HKEY hKey = NULL;
00317   HRESULT hResult = S_FALSE;
00318   TCHAR szKeyBuf[1024];
00319
00320   // Copy keyname into buffer.
00321   _tcscpy( szKeyBuf, szKey );
00322
00323   // Add subkey name to buffer.
00324   if( NULL != szSubkey )
00325   {
00326     _tcscat( szKeyBuf, _T("\\") );
00327     _tcscat( szKeyBuf, szSubkey );
00328   }
00329
00330   do                     // We go to all this trouble to prevent any
00331   {                      // possibility of exiting while leaving a key open
00332
00333     // Create and open key and subkey.
00334     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT,
00335                                    szKeyBuf,
00336                                    0,
00337                                    NULL,
00338                                    REG_OPTION_NON_VOLATILE,
00339                                    KEY_ALL_ACCESS,
00340                                    NULL,
00341                                    &hKey,
00342                                    NULL
00343                                  );
00344     if( ERROR_SUCCESS != lResult )
00345     {
00346       hResult = HRESULT_FROM_WIN32( lResult );
00347       continue;
00348     }
00349
00350     if( NULL != szValue )    // Now set the value
00351     {
00352       hResult = RegSetValueEx( hKey,
00353                                NULL,
00354                                0,
00355                                REG_SZ,
00356                                (BYTE*)szValue,
00357                                BYTE_SIZE( szValue )    // BYTE_SIZE is in Globals.h
00358                              );
00359       BREAK_ON_ERROR( hResult );
00360     }
00361   }while( 0 );
00362
00363   RegCloseKey( hKey );       // Always try to close the key
00364   return hResult;
00365 }
00366
00367
00368 //---------------------------------------------------------------------------
00369 // Open a key value and set it
00370 //
00371 HRESULT SetValue
00372 (
00373   const TCHAR*  szKey,         //[in] Parent key
00374   const TCHAR*  szValueName,   //[in] Name of value
00375   const TCHAR*  szValue        //[in] Value in string format
00376 )
00377 {
00378   HKEY    hKey = NULL;
00379   HRESULT hResult = S_FALSE;
00380   TCHAR szKeyBuf[1024];
00381
00382   // Copy keyname into buffer.
00383   _tcscpy( szKeyBuf, szKey );
00384
00385   do                     // We go to all this trouble to prevent any
00386   {                      // possibility of exiting while leaving a key open
00387
00388     // Create and open key and subkey.
00389     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT ,
00390                                    szKeyBuf,
00391                                    0,
00392                                    NULL,
00393                                    REG_OPTION_NON_VOLATILE,
00394                                    KEY_ALL_ACCESS,
00395                                    NULL,
00396                                    &hKey,
00397                                    NULL
00398                                  );
00399     if( ERROR_SUCCESS != lResult )
00400     {
00401       hResult = HRESULT_FROM_WIN32( lResult );
00402       continue;
00403     }
00404
00405     if( NULL != szValue )    // Now set the value
00406     {
00407       hResult = RegSetValueEx( hKey,
00408                                szValueName,
00409                                0,
00410                                REG_SZ,
00411                                (BYTE*)szValue,
00412                                BYTE_SIZE( szValue )
00413                              );
00414       BREAK_ON_ERROR( hResult );
00415     }
00416   }while( 0 );
00417
00418   RegCloseKey( hKey );       //Always attempt to close the key
00419   return hResult;
00420 }
00421
00422
00423 //---------------------------------------------------------------------------
00424 // Create a key and set its value.
00425 //   - This helper function was borrowed and modifed from
00426 //     Kraig Brockschmidt's book Inside OLE.
00427 //
00428 HRESULT SetSnapInKeyAndValue
00429 (
00430   const TCHAR*  szKey,       //[in] Parent key
00431   const TCHAR*  szSubkey,    //[in] Child key
00432   const TCHAR*  szName,      //[in] Value name
00433   const TCHAR*  szValue      //[in] Value in string format
00434 )
00435 {
00436   HKEY    hKey = NULL;
00437   HRESULT hResult = S_FALSE;
00438   TCHAR   szKeyBuf[1024];
00439
00440   // Load the buffer with the Snap-In Location
00441   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00442
00443   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00444   _tcscat( szKeyBuf, szKey );
00445
00446   if( NULL != szSubkey )               // Add subkey name to buffer.
00447   {
00448     _tcscat( szKeyBuf, _T("\\") );
00449     _tcscat( szKeyBuf, szSubkey );
00450   }
00451
00452   do                     // We go to all this trouble to prevent any
00453   {                      // possibility of exiting while leaving a key open
00454
00455     // Create and open key and subkey.
00456     long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00457                                    szKeyBuf,
00458                                    0,
00459                                    NULL,
00460                                    REG_OPTION_NON_VOLATILE,
00461                                    KEY_ALL_ACCESS,
00462                                    NULL,
00463                                    &hKey,
00464                                    NULL
00465                                  );
00466     if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00467       continue;
00468
00469     // Set the Value.
00470     if( szValue != NULL )
00471     {
00472       hResult = RegSetValueEx( hKey,
00473                                szName,
00474                                0,
00475                                REG_SZ,
00476                                (BYTE*)szValue,
00477                                BYTE_SIZE(szValue)
00478                              );
00479       BREAK_ON_ERROR( hResult );
00480     }
00481     else
00482     {                        // Got this far so everything is OK.
00483       hResult = S_OK;
00484     }
00485   }while( 0 );
00486
00487   RegCloseKey( hKey );       //Always attempt to close the key
00488   return hResult;
00489 }
00490
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • Extens

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00025 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00026
00027
00028 //==============================================================
00029 //
00030 // CDelegationBase implementation
00031 //
00032 //
00033 CDelegationBase::CDelegationBase()
00034 : bExpanded(FALSE)
00035 {
00036     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00037         LoadBitmaps();
00038 }
00039
00040 CDelegationBase::~CDelegationBase()
00041 {
00042 }
00043
00044 // CDelegationBase::AddImages sets up the collection of images to be displayed
00045 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00046 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00047 {
00048     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00049         (long *)m_pBMapLg, // pointer to a handle
00050         0, // index of the first image in the strip
00051         RGB(0, 128, 128)  // color of the icon mask
00052         );
00053 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/Upload/main.cpp Source File

  • Web
  • bits
  • Upload

main.cpp

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //
00006 //  BITS Upload sample
00007 //  ==================
00008 //
00009 //  Module name:
00010 //  main.cpp
00011 //
00012 //  Purpose:
00013 //  This module contains the entry point for the uploadsample.exe (WinMain).
00014 //  It takes care of initialization of COM and launches the User Interface.
00015 //
00016 //----------------------------------------------------------------------------
00017
00018
00019 #include <windows.h>
00020 #include <crtdbg.h>
00021 #include <strsafe.h>
00022 #include <bits.h>
00023
00024 #include "resource.h"
00025 #include "main.h"
00026 #include "util.h"
00027 #include "cdialog.h"
00028
00029
00030 CSmartComPtr<IBackgroundCopyManager> g_JobManager;
00031 CMonitor                             g_NotificationReceiver;
00032 CSimpleDialog                       *g_pDialog = NULL;
00033 HANDLE                               g_hSafeToExitEvent = INVALID_HANDLE_VALUE;
00034
00035 int APIENTRY WinMain(HINSTANCE hInstance,
00036                      HINSTANCE hPrevInstance,
00037                      LPSTR     lpCmdLine,
00038                      INT       iShowState)
00039 {
00040     HRESULT        hr      = S_OK;
00041     LRESULT        lResult = 0;
00042
00043     hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00044     if (FAILED(hr))
00045     {
00046         goto cleanup;
00047     }
00048
00049     //
00050     // Instantiate the main BITS object, the Job Manager
00051     //
00052     hr = CoCreateInstance(CLSID_BackgroundCopyManager, NULL, CLSCTX_LOCAL_SERVER, __uuidof(IBackgroundCopyManager), reinterpret_cast<LPVOID *>(g_JobManager.GrabOutPtr()));
00053     if (FAILED(hr))
00054     {
00055         DisplayErrorMessage(L"Failed to instantiate a CLSID_BackgroundCopyManager COM object. Aborting"
00056                             L"Check if BITS is correctly installed on your system.", hr);
00057         goto cleanup;
00058     }
00059
00060     //
00061     // Create the dialog for our test application
00062     //
00063     g_pDialog = new CSimpleDialog(hInstance, IDD_UPLOADSAMPLECLIENTDIALOG);
00064     if (!g_pDialog)
00065     {
00066         DisplayErrorMessage(L"Could not create the UI for the BITS upload sample application. Aborting.", E_OUTOFMEMORY);
00067         goto cleanup;
00068     }
00069
00070     hr = g_pDialog->Show(iShowState);
00071     if (FAILED(hr))
00072     {
00073         DisplayErrorMessage(L"Could not display the UI for the BITS upload sample application. Aborting.", hr);
00074         goto cleanup;
00075     }
00076
00077
00078     //
00079     // Starts the message loop for the dialog
00080     //
00081
00082     INT iRet;
00083     MSG msg;
00084
00085     iRet = GetMessage(&msg, NULL, 0, 0);
00086     while (iRet != 0)
00087     {
00088         if (iRet == -1)
00089         {
00090             hr = HRESULT_FROM_WIN32(GetLastError());
00091             DisplayErrorMessage(L"Error processing the application window message loop", hr);
00092             goto cleanup;
00093         }
00094         else
00095         {
00096             if (!IsWindow(g_pDialog->GetHwnd()) || !IsDialogMessage(g_pDialog->GetHwnd(), &msg))
00097             {
00098                 TranslateMessage(&msg);
00099                 DispatchMessage(&msg);
00100             }
00101         }
00102
00103         iRet = GetMessage(&msg, NULL, 0, 0);
00104     }
00105
00106 cleanup:
00107
00108     if (g_pDialog)
00109     {
00110         delete g_pDialog;
00111     }
00112
00113     if (g_hSafeToExitEvent != INVALID_HANDLE_VALUE)
00114     {
00115         //
00116         // We need to wait here because there's chances that COM isn't yet done with
00117         // releasing our callback interface. The app needs to be around in case any pending reference
00118         // is executed.
00119         // The the last reference is released, the g_hSafeToExitEvent is going to be signaled
00120         // and we will unblock from this wait.
00121         //
00122         DWORD dwWait = WaitForSingleObject(g_hSafeToExitEvent, INFINITE);
00123
00124         // Regardless of the reason we unblocked, go ahead and close
00125         // the event because we are about to quit the application
00126         CloseHandle(g_hSafeToExitEvent);
00127         g_hSafeToExitEvent = INVALID_HANDLE_VALUE;
00128     }
00129
00130
00131     // g_JobManager is a global variable, so force the release of the interface pointer
00132     g_JobManager.Clear();
00133     CoUninitialize();
00134
00135     return 0;
00136 }
00137
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCOrder/QCOrder.Idl Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCOrder

QCOrder.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      QCOrder.idl
00003   Summary:   Interfaces for Queued Components Order Entry Sample 1
00004   Classes:   Declared: Order
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1998 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "mtxattr.h"  // For TRANSACTION_REQUIRED
00023 import "oaidl.idl";   // Automation data types
00024
00025 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00026   Interface: IOrder
00027   Summary:   Represents an order and its line items
00028   Methods:   HRESULT CustomerId - sets Customer Identifier property
00029        HRESULT OrderId - sets Order Identifier property
00030        HRESULT LineItem - adds an item to an order
00031              HRESULT ProcessOrder - Completes order
00032 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00033
00034 [
00035   helpstring("IOrder Interface"), uuid(CB34A1A1-28C2-11D2-B5B6-00C04FC340EE),
00036   object, dual, nonextensible, hidden, pointer_default(unique)
00037 ]
00038 interface IOrder : IDispatch
00039 {
00040   [id(1), propput] HRESULT CustomerId([in] long lCustomerId);
00041   [id(2), propput] HRESULT OrderId([in] long lOrderId);
00042   [id(3)] HRESULT LineItem([in] long lItemId, [in] long lQuantity);
00043   [id(4)] HRESULT Process([in] long lFlags);
00044 };
00045
00046 // Library and classes
00047
00048 [
00049   uuid(6DD1E6C2-28C1-11D2-B5B6-00C04FC340EE),
00050   version(1.0),
00051   helpstring("QCOrder 1.0 Type Library")
00052 ]
00053 library QCORDERLib
00054 {
00055   importlib("stdole2.tlb");
00056
00057 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00058   Class:     Order
00059   Summary:     Order Entry - accept an order and its line items
00060   Interfaces:  IUnknown     Standard COM object interface
00061                IOrder     The order being entered
00062   Aggregation: Not supported
00063 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00064
00065   [
00066     helpstring("Order Class"), uuid(CB34A1A2-28C2-11D2-B5B6-00C04FC340EE),
00067     TRANSACTION_REQUIRED
00068   ]
00069   coclass Order { [default] interface IOrder; };
00070
00071 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authentication/AuthenticateAdmin.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Authentication

AuthenticateAdmin.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       AuthenticateAdmin.h
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011
00012
00013 #if !defined(AFX_AUTHENTICATEADMIN_H__64E4D8A6_C0B8_4A51_8275_FC89BFF207A4__INCLUDED_)
00014 #define AFX_AUTHENTICATEADMIN_H__64E4D8A6_C0B8_4A51_8275_FC89BFF207A4__INCLUDED_
00015
00016 #include "resource.h"       // main symbols
00017 #include "AuthenticatePlugin.h"
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CAuthenticateAdmin
00021 class ATL_NO_VTABLE CAuthenticateAdmin :
00022     public IDispatchImpl<IAuthenticateAdmin, &IID_IAuthenticateAdmin, &LIBID_AUTHENTICATEPLUGINLib, 9, 0 >,
00023     public ISupportErrorInfo,
00024     public CComObjectRootEx<CComMultiThreadModel>,
00025     public CComCoClass<CAuthenticateAdmin, &CLSID_AuthenticateAdmin>
00026 {
00027 public:
00028     CAuthenticateAdmin() :
00029         m_pAuthenticatePlugin( NULL )
00030     {
00031     }
00032
00033     STDMETHOD( Initialize )( CAuthenticatePlugin *pPlugin );
00034
00035
00036 DECLARE_REGISTRY_RESOURCEID(IDR_AUTHENTICATEADMIN)
00037
00038 DECLARE_PROTECT_FINAL_CONSTRUCT()
00039
00040 BEGIN_COM_MAP(CAuthenticateAdmin)
00041     COM_INTERFACE_ENTRY(IDispatch)
00042     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00043     COM_INTERFACE_ENTRY(IAuthenticateAdmin)
00044 END_COM_MAP()
00045
00046 // ISupportsErrorInfo
00047     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00048
00049 // IAuthenticateAdmin
00050
00051 public:
00052
00053 private:
00054     CAuthenticatePlugin   *m_pAuthenticatePlugin;
00055
00056 protected:
00057 };
00058
00059 #endif // !defined(AFX_AUTHENTICATEADMIN_H__64E4D8A6_C0B8_4A51_8275_FC89BFF207A4__INCLUDED_)
00060
00061
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/DisDraw.h Source File

  • NetDS
  • MessageQueuing
  • c_draw

DisDraw.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // disdraw.h : main header file for the DISDRAW application
00014 //
00015 //
00016
00017
00018 #ifndef __AFXWIN_H__
00019   #error include 'stdafx.h' before including this file for PCH
00020 #endif
00021
00022 #include "resource.h"   // main symbols
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CDisdrawApp:
00026 // See disdraw.cpp for the implementation of this class.
00027 //
00028
00029 class CDisdrawApp : public CWinApp
00030 {
00031 public:
00032   CDisdrawApp();
00033
00034 // Overrides
00035   // ClassWizard generated virtual function overrides
00036   //{{AFX_VIRTUAL(CDisdrawApp)
00037   public:
00038   virtual BOOL InitInstance();
00039   //}}AFX_VIRTUAL
00040
00041 // Implementation
00042
00043   //{{AFX_MSG(CDisdrawApp)
00044     // NOTE - the ClassWizard will add and remove member functions here.
00045     //    DO NOT EDIT what you see in these blocks of generated code !
00046   //}}AFX_MSG
00047   DECLARE_MESSAGE_MAP()
00048 };
00049
00050
00051 /////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/errors.c Source File

  • Multimedia
  • Gdi
  • PrintJob

errors.c

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 * PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   Errors.C
00010 *
00011 *   PURPOSE:    Implements an Error display box that conveniently shows
00012 *       the user what Win32 Error was reported.
00013 *
00014 *   FUNCTIONS:
00015 *       ErrorBox() - Displays a MessageBox() with a formatted version of
00016 *                    the Win32 Error code passed in.
00017 *
00018 ******************************************************************************/
00019
00020 #define STRICT
00021 #include <Windows.h>
00022 #include "Errors.h"
00023
00024
00025 /******************************************************************************
00026
00027   FUNCTION: ErrorBox( DWORD, LPCSTR )
00028
00029   PURPOSE:  Shows a Message Box withe a formatted string for the Win32
00030             error passed via DWORD.
00031
00032   COMMENTS:
00033             LPCSTR is the title of the Message Box().
00034             The MessageBox() contains a single OK button.
00035
00036 ******************************************************************************/
00037
00038 void ErrorBox( DWORD dwError, LPCSTR lpszString )
00039 {
00040 #define MAX_MSG_BUF_SIZE 512
00041     char    *msgBuf;
00042     DWORD   cMsgLen;
00043
00044     cMsgLen = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
00045                 FORMAT_MESSAGE_ALLOCATE_BUFFER | 40,
00046                 NULL, dwError,
00047                 MAKELANGID(0, SUBLANG_ENGLISH_US),
00048                 (LPTSTR) &msgBuf, MAX_MSG_BUF_SIZE,
00049                 NULL);
00050
00051     MessageBox( NULL, msgBuf, lpszString, MB_OK );
00052
00053     LocalFree( msgBuf );
00054 #undef MAX_MSG_BUF_SIZE
00055 }
00056
00057 /* end of source file Errors.c */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/filerepserverproc.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

filerepserverproc.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: FileRepServerProc.cpp
00008
00009     PURPOSE: Remote procedures for server system service
00010
00011     FUNCTIONS:
00012         RemoteOpen() - Open the file.  It also gets some
00013     some data from the file, and closes the file if all data
00014     has been read at once.  This enhances performance.
00015         RemoteRead() - Read a buffer's worth of the file.  It
00016     closes the file if EOF has been reached.
00017
00018     COMMENTS:
00019
00020 */
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <string.h>
00025
00026 #include "common.h"
00027
00028 // header file generated by MIDL compiler
00029 #include "FileRepServer.h"
00030
00031 // Declarations for service routines.
00032 #include "Service.h"
00033
00034 typedef struct {
00035     HANDLE hFile;
00036     // We use this byte to check if EOF has been
00037     // reached on read.  The byte is put into
00038     // the first position of the next buffer read if EOF
00039     // has not been reached.
00040     BYTE EOFCheck;
00041 } FILE_CONTEXT_TYPE;
00042
00043 /*
00044   This is a procedure that actually reads file data.
00045   It performs the reading tasks common to RemoteOpen and RemoteRead.
00046   Notice that nToRead is the number of bytes to read.
00047 */
00048 VOID ReadData(HANDLE hFile, VOID *pbBuf, unsigned long nToRead, unsigned long *cbRead, BOOL *bEOF, BYTE *EOFCheck) {
00049
00050     if(!ReadFile(hFile, pbBuf, nToRead+1, cbRead, NULL)) {
00051
00052         // We want to raise an exception but leave the context intact
00053         // so that subsequent reads may be attempted.  Later versions
00054         // may implement this feature.
00055
00056         AddRpcEEInfoAndRaiseException(GetLastError(), TEXT("ReadData: ReadFile failed"));
00057         return;
00058     }
00059
00060     // Check for EOF.
00061     *bEOF = FALSE;
00062     // If we read in the whole buffer, save the last byte.
00063     if(*cbRead == nToRead+1) {
00064         *EOFCheck = ((BYTE *)pbBuf)[(nToRead+1)-1];
00065
00066         // return at most nToRead read bytes.
00067         *cbRead = nToRead;
00068     }
00069     // If we did not read the whole buffer then we reached the EOF.
00070     else{
00071         *bEOF = TRUE;
00072     }
00073 }
00074
00075 /*
00076     FUNCTION: s_RemoteOpen
00077
00078     PURPOSE: Opens a file on the server and returns some file data.
00079
00080     PARAMETERS:
00081         hFileRepServer - RPC binding
00082         pphContext - the context handle associated with the open file
00083         pszFileName -  file to open
00084         pbBuf - buffer to read into
00085         cbRead - number of bytes read into the buffer
00086
00087     RETURN VALUE:
00088         none
00089
00090     COMMENTS:
00091 */
00092 VOID s_RemoteOpen(handle_t hFileRepServer,
00093                   PCONTEXT_HANDLE_TYPE *pphContext,
00094                   LPTSTR pszFileName,
00095                   BYTE *pbBuf,
00096                   unsigned long *cbRead)
00097 {
00098     HANDLE hFile;
00099     FILE_CONTEXT_TYPE *pFileContext;
00100     BOOL bEOF = FALSE;
00101     BYTE EOFCheck;
00102     INT status;
00103
00104     BOOL bImpersonating = FALSE;
00105
00106     // The priority level of the calling user.
00107     UINT Pri;
00108
00109     // Set if we reached the maximum number of concurrent requests.
00110     BOOL bMaxConcurrentRequests = FALSE;
00111
00112     RPC_STATUS rpcstatus;
00113
00114     // We need to impersonate the user that has issued the
00115     // remote call.  If we impersonate here then we make sure that
00116     // the user has adequate permissions to open the file.
00117     if (!bImpersonating) {
00118         if ((rpcstatus = RpcImpersonateClient(hFileRepServer)) != RPC_S_OK) {
00119             AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("s_RemoteOpen: RpcImpersonateClient failed"));
00120             return;
00121         }
00122         bImpersonating = TRUE;
00123     }
00124
00125     //
00126     // Check that we are not exceeding the bound on the number
00127     // of concurrent requests for this user's priority group.
00128     // And update the number of such requests.
00129     //
00130
00131     // Determine current user's priority level.  This corresponds to the
00132     // priority level of the callee, since we are impersonating.
00133     Pri = GetCurrentUserPriority();
00134
00135     // Increment the counter for the number of concurrent requests.
00136     if (!CounterIncrement(pServerReqCounters[Pri])) {
00137         AddRpcEEInfoAndRaiseException(RPC_S_SERVER_TOO_BUSY, TEXT("s_RemoteOpen: CounterIncrement failed"));
00138         return;
00139     }
00140
00141     // It is enough to impersonate while opening the file, since this is where all
00142     // the security checks are done.  We can later read from this handle
00143     // while not impersonating.
00144     if ((hFile = CreateFile(pszFileName,
00145                             GENERIC_READ,
00146                             FILE_SHARE_READ,
00147                             NULL,
00148                             OPEN_EXISTING,
00149                             FILE_ATTRIBUTE_NORMAL,
00150                             NULL)) == INVALID_HANDLE_VALUE) {
00151         if (bImpersonating) {
00152             if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
00153                 CounterDecrement(pServerReqCounters[Pri]);
00154                 AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("s_RemoteOpen: RpcRevertToSelf failed"));
00155
00156                 return;
00157             }
00158         }
00159
00160         CounterDecrement(pServerReqCounters[Pri]);
00161         AddRpcEEInfoAndRaiseException(GetLastError(), TEXT("s_RemoteOpen: CreateFile failed"));
00162
00163         return;
00164     }
00165
00166     // We can now revert to self, since file has been opened while
00167     // impersonating and hence the security requirements have been met.
00168     if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
00169
00170         CounterDecrement(pServerReqCounters[Pri]);
00171         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("s_RemoteOpen: RpcRevertToSelf failed"));
00172
00173         return;
00174     }
00175
00176     // Read data from file into the buffer.
00177     // This function may throw exceptions, but we would want
00178     // those to propagate out.
00179     ReadData(hFile, (VOID *)pbBuf, OPEN_BUFSIZE, cbRead, &bEOF, &EOFCheck);
00180
00181     // Check if EOF has been reached.
00182     if(bEOF) {
00183         // If it has, we can simply return.
00184
00185         // Since all of the read has completed, the [out] context handle
00186         // pointer is NULL.
00187         pFileContext = NULL;
00188         *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00189
00190         status = CloseHandle(hFile);
00191         ASSERTE(status != 0);
00192
00193         CounterDecrement(pServerReqCounters[Pri]);
00194         return;
00195     }
00196     else {
00197         // Otherwise we need to allocate, initialize, and return the
00198         // context handle.
00199         if((pFileContext = (FILE_CONTEXT_TYPE *) midl_user_allocate(sizeof(FILE_CONTEXT_TYPE))) == NULL) {
00200
00201             status = CloseHandle(hFile);
00202             ASSERTE(status != 0);
00203
00204             CounterDecrement(pServerReqCounters[Pri]);
00205             AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("s_RemoteOpen: midl_user_allocate failed"));
00206
00207             return;
00208         }
00209
00210         // Initialize the context handle fields.
00211         pFileContext->hFile = hFile;
00212
00213         pFileContext->EOFCheck = EOFCheck;
00214
00215         *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00216
00217         CounterDecrement(pServerReqCounters[Pri]);
00218         return;
00219     }
00220 }
00221
00222 /*
00223     FUNCTION: s_RemoteRead
00224
00225     PURPOSE: Opens a file on the server and returns some file data.
00226
00227     PARAMETERS:
00228         hFileRepServer - RPC binding
00229         pphContext - the context handle associated with the open file
00230         pbBuf - buffer to read into
00231         cbRead - number of bytes read into the buffer
00232
00233     RETURN VALUE:
00234         none
00235
00236     COMMENTS:
00237 */
00238 VOID s_RemoteRead(handle_t hFileRepServer,
00239                   PCONTEXT_HANDLE_TYPE *pphContext,
00240                   BYTE *pbBuf,
00241                   unsigned long *cbRead)
00242 {
00243     FILE_CONTEXT_TYPE *pFileContext;
00244     BOOL bEOF = FALSE;
00245     BYTE EOFCheck;
00246     INT status;
00247     RPC_STATUS rpcstatus;
00248
00249     UINT Pri;
00250
00251     BOOL bMaxConcurrentRequests = FALSE;
00252
00253     BOOL bImpersonating = FALSE;
00254
00255     // We need to impersonate the user that has issued the
00256     // remote call.  We need to do this to determine
00257     // the priority level of the requests below.
00258     if (!bImpersonating) {
00259         if ((rpcstatus = RpcImpersonateClient(hFileRepServer)) != RPC_S_OK) {
00260             AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("s_RemoteRead: RpcImpersonateClient failed"));
00261             return;
00262         }
00263         bImpersonating = TRUE;
00264     }
00265
00266     //
00267     // Check that we are not exceeding the bound on the number
00268     // of concurrent requests for this user's priority group.
00269     // And update the number of such requests.
00270     //
00271
00272     // Determine current user's priority level.  This corresponds to the
00273     // priority level of the callee, since we are impersonating.
00274     Pri = GetCurrentUserPriority();
00275
00276     // We can now revert to self, since file has been opened while
00277     // impersonating and hence the security requirements have been met.
00278     if (bImpersonating) {
00279         if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
00280             AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("s_RemoteRead: RpcRevertToSelf failed"));
00281
00282             CounterDecrement(pServerReqCounters[Pri]);
00283             return;
00284         }
00285     }
00286
00287     // Increment the counter for the number of concurrent requests.
00288     if (!CounterIncrement(pServerReqCounters[Pri])) {
00289         AddRpcEEInfoAndRaiseException(RPC_S_SERVER_TOO_BUSY, TEXT("s_RemoteRead: CounterIncrement failed"));
00290         return;
00291     }
00292
00293     if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
00294         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("s_RemoteRead: RpcRevertToSelf failed"));
00295
00296         CounterDecrement(pServerReqCounters[Pri]);
00297         return;
00298     }
00299
00300     // Clients have already been authenticated in RemoteOpen.
00301     // Here we operate on the context handle generated in RemoteOpen,
00302     // hence no additional security precations need to be taken.
00303
00304     // Make sure that the provided context handle is not NULL.
00305     if(*pphContext == NULL) {
00306
00307         AddRpcEEInfoAndRaiseException(RPC_X_SS_IN_NULL_CONTEXT, TEXT("s_RemoteRead: pphContext == NULL"));
00308
00309         CounterDecrement(pServerReqCounters[Pri]);
00310         return;
00311     }
00312
00313     pFileContext = (FILE_CONTEXT_TYPE *) *pphContext;
00314
00315     // Remember that we have a byte left over from RemoteOpen EOF check.
00316     pbBuf[0] = pFileContext->EOFCheck;
00317
00318     // Read the following bytes from file, but remember that we now only
00319     // have space for READ_BUFSIZE-1 bytes and we write starting
00320     // from the 1st index.  We will let possible exceptions propagate out.
00321     ReadData(pFileContext->hFile, (VOID *)&(pbBuf[1]), READ_BUFSIZE-1, cbRead, &bEOF, &EOFCheck);
00322
00323     // Since we had the first byte left over from the previous read, pretend
00324     // that we read it.
00325     (*cbRead)++;
00326
00327     if(bEOF){
00328         // If it has, we can destroy the context handle, close
00329         // the file and return.
00330         status = CloseHandle(pFileContext->hFile);
00331         ASSERTE(status != 0);
00332
00333         midl_user_free(*pphContext);
00334
00335         // Return NULL context handle to signify that the file has
00336         // been completely read.
00337         pFileContext = NULL;
00338         *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00339
00340         CounterDecrement(pServerReqCounters[Pri]);
00341         return;
00342     }
00343
00344     // Memorize the last byte read for the next read.
00345     pFileContext->EOFCheck = EOFCheck;
00346
00347     // Otherwise we just return the number of symbols read in cbRead.
00348     CounterDecrement(pServerReqCounters[Pri]);
00349     return;
00350 }
00351
00352 // The rundown routine is associated with the context handle type.
00353 // When a connection breaks, the server stub and the run-time
00354 // library will call this routine.
00355 void __RPC_USER PCONTEXT_HANDLE_TYPE_rundown(PCONTEXT_HANDLE_TYPE phContext) {
00356     FILE_CONTEXT_TYPE *pFileContext;
00357     INT status;
00358
00359     // We need to try and close the file associated with the
00360     // context handle...
00361
00362     // Context handle can not be NULL in this section, so we can
00363     // go ahead and try closing the file.
00364     pFileContext = (FILE_CONTEXT_TYPE *) phContext;
00365
00366     // Also, we do not need to worry about pFileContext->hFile's being
00367     // null since we checked for it when we opened the file.
00368     status = CloseHandle(pFileContext->hFile);
00369     ASSERTE(status != 0);
00370
00371     // And then free the memory taken up by it.
00372     midl_user_free(phContext);
00373 }
00374
00375 // end FileRepServerProc.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFreeTest Member List

This is the complete list of members for CFreeTest, including all inherited members.
CFreeTest() | CFreeTest | [inline]
Exercise(void) | CFreeTest |
Generated on Wed Nov 13 2024 16:56:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpCntr/app.h Source File

  • Com
  • Fundamentals
  • SimpCntr

app.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: app.h
00003 //
00004 //      Definition of CSimpleApp
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _APP_H_)
00010 #define _APP_H_
00011
00012 #include <ole2.h>
00013 #include <stablize.h>
00014 #include "ioipf.h"
00015
00016 class CSimpleDoc;
00017
00018 class CSimpleApp : public IUnknown, public CSafeRefCount
00019 {
00020 public:
00021
00022         HWND m_hAppWnd;         // main window handle
00023         HINSTANCE m_hInst;          // application instance
00024         HMENU           m_hMainMenu;
00025         HMENU           m_hFileMenu;
00026         HMENU           m_hEditMenu;
00027         HMENU           m_hHelpMenu;
00028         HMENU           m_hCascadeMenu;
00029
00030
00031         COleInPlaceFrame m_OleInPlaceFrame; // IOleInPlaceFrame Implementation
00032
00033         CSimpleDoc FAR * m_lpDoc;   // pointer to document object
00034         BOOL m_fInitialized;        // OLE initialization flag
00035         BOOL m_fCSHMode;
00036         BOOL m_fMenuMode;
00037         HWND m_hwndUIActiveObj; // HWND of UIActive Object
00038         HPALETTE m_hStdPal;     // Color palette used by container
00039         BOOL m_fAppActive;      // TRUE if app is active
00040
00041         CSimpleApp();           // Constructor
00042         ~CSimpleApp();          // Destructor
00043         RECT nullRect;
00044
00045
00046         // IUnknown Interfaces
00047         STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
00048         STDMETHODIMP_(ULONG) AddRef();
00049         STDMETHODIMP_(ULONG) Release();
00050
00051         // Initialization methods
00052
00053         BOOL fInitApplication (HANDLE hInstance);
00054         BOOL fInitInstance (HANDLE hInstance, int nCmdShow);
00055
00056         // Message handling methods
00057
00058         long lCommandHandler (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00059         long lSizeHandler (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00060         long lCreateDoc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00061         BOOL HandleAccelerators (LPMSG lpMsg);
00062         void PaintApp(HDC hDC);
00063         void DestroyDocs();
00064
00065         // In-Place support functions
00066         void AddFrameLevelUI();
00067         void AddFrameLevelTools();
00068         void ContextSensitiveHelp (BOOL fEnterMode);
00069         LRESULT QueryNewPalette(void);
00070 };
00071
00072 LRESULT wSelectPalette(HWND hWnd, HPALETTE hPal, BOOL fBackground);
00073
00074 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/datasrc.h Source File

  • Dataaccess
  • oledb
  • sampprov

datasrc.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module DATASRC.H | CDataSource base object and contained interface
00008 // definitions
00009 //
00010 //
00011 #ifndef _DATASRC_H_
00012 #define _DATASRC_H_
00013
00014 #include "fileio.h"
00015 #include "baseobj.h"
00016
00017
00018 // Forward declarations ------------------------------------------------------
00019
00020 class CDataSource;
00021 class   CImpIDBInitialize;
00022 class   CImpIDBProperties;
00023 class   CImpIDBCreateSession;
00024 class CImpIDBInfo;
00025 class   CImpIPersist;
00026 class CImpIServiceProvider;
00027
00028 typedef CDataSource*      PCDATASOURCE;
00029 typedef CImpIDBInitialize*      PIMPIDBINITIALIZE;
00030 typedef CImpIDBProperties*      PIMPIDBProperties;
00031 typedef CImpIDBCreateSession*   PIMPIDBCREATESESSION;
00032 typedef CImpIDBInfo*      PIMPIDBINFO;
00033 typedef CImpIPersist*     PIMPIPERSIST;
00034
00035
00036 // Classes -------------------------------------------------------------------
00037
00038 //----------------------------------------------------------------------------
00039 // @class CDataSource | Containing class for all interfaces on the Datasource
00040 // CoType Object
00041 //
00042 class CDataSource : public CBaseObj         //@base public | CBaseObj
00043 {
00044   //  Contained interfaces are friends
00045   friend class CImpIDBInitialize;
00046     friend class CImpIDBInfo;
00047   friend class CImpIDBProperties;
00048     friend class CImpIDBCreateSession;
00049     friend class CImpIPersist;
00050     friend class CImpIServiceProvider;
00051     friend class CDBSession;
00052
00053   protected: //@access protected
00054     //@cmember Reference count
00055     DBREFCOUNT          m_cRef;
00056     //@cmember Path Name
00057     WCHAR           m_wszPath[MAX_PATH];
00058         //@member flag == TRUE if this Data Source object is an an initialized state
00059         BOOL                        m_fDSOInitialized;
00060         //@member flag == TRUE if DBSession object has been created
00061         BOOL                        m_fDBSessionCreated;
00062         //@member Utility object to manage properties
00063         PCUTILPROP                  m_pUtilProp;
00064     //@cmember Contained IDBInitialize
00065     PIMPIDBINITIALIZE     m_pIDBInitialize;
00066         //@cmember Contained IDBProperties
00067         PIMPIDBProperties           m_pIDBProperties;
00068     //@cmember Contained IDBInfo
00069     PIMPIDBINFO         m_pIDBInfo;
00070         //@member contained IDBCreateSession
00071         PIMPIDBCREATESESSION        m_pIDBCreateSession;
00072         //@member contained IPersist
00073         CImpIPersist*       m_pIPersist;
00074         //@member contained IServiceProvider
00075         CImpIServiceProvider*   m_pIServiceProvider;
00076
00077   public: //@access public
00078     //@cmember Constructor
00079      CDataSource(LPUNKNOWN);
00080     //@cmember Destructor
00081     ~CDataSource(void);
00082
00083     //@cmember Intitialization Routine
00084     BOOL FInit(void);
00085
00086     //@cmember Controlling IUnknown
00087     LPUNKNOWN         m_pUnkOuter;
00088
00089     //  Object's base IUnknown
00090     //@cmember Request an Interface
00091     STDMETHODIMP        QueryInterface(REFIID, LPVOID *);
00092     //@cmember Increments the Reference count
00093     STDMETHODIMP_(DBREFCOUNT) AddRef(void);
00094     //@cmember Decrements the Reference count
00095     STDMETHODIMP_(DBREFCOUNT) Release(void);
00096
00097     //@cmember Set the DBSessionCreated flag to FALSE
00098     inline VOID       RemoveSession(void)   { m_fDBSessionCreated = FALSE; }
00099     //@cmember Return the DataSource path
00100     inline WCHAR *      GetFilePath(void)   { return m_wszPath; };
00101     //@cmember OpenFile
00102     STDMETHODIMP      OpenFile(WCHAR* pwszFileName, CFileIO** ppCFileIO);
00103 };
00104
00105 typedef CDataSource *PCDATASOURCE;
00106
00107
00108 //----------------------------------------------------------------------------
00109 // @class CImpIDBInitialize | Contained IDBInitialize class
00110 //
00111 class CImpIDBInitialize : public IDBInitialize    //@base public | IDBInitialize
00112 {
00113   private:  //@access private
00114     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDataSource)
00115
00116   public:  //@access public
00117     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIDBInitialize);
00118     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00119
00120     //  IDBInitialize members
00121     //@cmember Initialize Method
00122       STDMETHODIMP      Initialize(void);
00123     //@cmember Uninitialize Method
00124         STDMETHODIMP            Uninitialize(void);
00125 };
00126
00127
00128
00129 //----------------------------------------------------------------------------------------
00130 // @class CImpIDBCreateSession   | contained IDBCreateSession class
00131
00132
00133 class CImpIDBCreateSession : public IDBCreateSession    //@base public | IDBCreateSession
00134 {
00135   private:        //@access private
00136     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDataSource)
00137
00138   public:         //@access public
00139     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIDBCreateSession);
00140     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00141
00142         // IDBCreateSession method
00143         //@cmember CreateSession method
00144         STDMETHODIMP    CreateSession( IUnknown*, REFIID, IUnknown** );
00145 };
00146
00147
00148
00149 //----------------------------------------------------------------------------
00150 // @class CImpIDBProperties | Contained IDBProperties class
00151 //
00152 class CImpIDBProperties : public IDBProperties    //@base public | IDBProperties
00153 {
00154   private:        //@access private
00155     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDataSource)
00156
00157   public:         //@access public
00158     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIDBProperties);
00159     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00160
00161     //  IDBProperties member functions
00162
00163         //@cmember GetProperties method
00164         STDMETHODIMP GetProperties
00165           (
00166             ULONG       cPropertySets,
00167                 const DBPROPIDSET rgPropertySets[],
00168                 ULONG*              pcProperties,
00169             DBPROPSET**     prgProperties
00170               );
00171
00172         //@cmember GetPropertyInfo method
00173         STDMETHODIMP    GetPropertyInfo
00174                     (
00175             ULONG       cPropertySets,
00176             const DBPROPIDSET rgPropertySets[],
00177             ULONG*        pcPropertyInfoSets,
00178             DBPROPINFOSET**   prgPropertyInfoSets,
00179             WCHAR**       ppDescBuffer
00180                     );
00181
00182         //@cmember SetProperties method
00183         STDMETHODIMP  SetProperties
00184           (
00185             ULONG       cPropertySets,
00186             DBPROPSET     rgPropertySets[]
00187           );
00188 };
00189
00190 //----------------------------------------------------------------------------
00191 // @class CImpIDBInfo | Contained IDBInfo class
00192 //
00193 class CImpIDBInfo : public IDBInfo    //@base public | IDBInfo
00194 {
00195   private:        //@access private
00196     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDataSource)
00197
00198   public:         //@access public
00199     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIDBInfo);
00200     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00201
00202     //  IDBProperties member functions
00203
00204         //@cmember GetKeywords method
00205         STDMETHODIMP    GetKeywords
00206                         (
00207                           LPWSTR*     ppwsKeywords
00208                         );
00209
00210         //@cmember GetLiteralInfo method
00211         STDMETHODIMP    GetLiteralInfo
00212                         (
00213                           ULONG           cLiterals,
00214               const DBLITERAL rgLiterals[ ],
00215               ULONG*          pcLiteralInfo,
00216               DBLITERALINFO** prgLiteralInfo,
00217               WCHAR**         ppCharBuffer
00218                         );
00219 };
00220
00221
00222 //----------------------------------------------------------------------------------------
00223 // @class CImpIPersist   | contained IPersist class
00224
00225
00226 class CImpIPersist : public IPersist    //@base public | IPersist
00227 {
00228   private:        //@access private
00229     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDataSource)
00230
00231   public:         //@access public
00232     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIPersist);
00233     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00234
00235         // IPersist method
00236         //@cmember GetClassID method
00237         STDMETHODIMP    GetClassID( CLSID *pClassID );
00238 };
00239
00240
00241
00242 ////////////////////////////////////////////////////////
00243 // CImpIServiceProvider
00244 //
00245 ////////////////////////////////////////////////////////
00246 class CImpIServiceProvider : public IServiceProvider    //@base public | IServiceProvider
00247 {
00248   private:        //@access private
00249     DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CDataSource)
00250
00251   public:         //@access public
00252     DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIServiceProvider);
00253     DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00254
00255         // IServiceProvider method
00256         //@cmember QueryService method
00257         STDMETHODIMP    QueryService( REFGUID guidService, REFIID riid, void** ppvObject);
00258 };
00259
00260
00261 ////////////////////////////////////////////////////////
00262 // CImpISpecifyPropertyPages
00263 //
00264 ////////////////////////////////////////////////////////
00265 class CImpISpecifyPropertyPages : public ISpecifyPropertyPages    //@base public | ISpecifyPropertyPages
00266 {
00267   private:        //@access private
00268     ULONG     m_cRef;
00269
00270   public:         //@access public
00271     CImpISpecifyPropertyPages()
00272     {
00273       m_cRef    = 0;
00274     }
00275     virtual ~CImpISpecifyPropertyPages()
00276     {
00277     }
00278
00279     DEFINE_ADDREF_RELEASE
00280     STDMETHODIMP  QueryInterface(REFIID riid, LPVOID *ppv)
00281     {
00282       if(!ppv)
00283         return E_INVALIDARG;
00284
00285       if(riid == IID_IUnknown)
00286         *ppv = (IUnknown*)this;
00287       else if(riid == IID_ISpecifyPropertyPages)
00288         *ppv = (ISpecifyPropertyPages*)this;
00289       else
00290       {
00291         *ppv = NULL;
00292         return E_NOINTERFACE;
00293       }
00294
00295       SAFE_ADDREF(*ppv);
00296       return S_OK;
00297     }
00298
00299     //ISpecifyPropertyPages member functions
00300         STDMETHODIMP  GetPages(CAUUID* pPages)
00301     {
00302       //Outer array is consumer allocated.
00303       HRESULT hr = E_OUTOFMEMORY;
00304       if(!pPages)
00305         return E_INVALIDARG;
00306
00307       //Inner sets are provider allocaed
00308       pPages->cElems = 2;
00309       SAFE_ALLOC(pPages->pElems, GUID, pPages->cElems);
00310
00311       //Fill in the array
00312       pPages->pElems[0] = CLSID_SampProvConnectionPage;
00313       pPages->pElems[1] = CLSID_SampProvAdvancedPage;
00314       hr = S_OK;
00315
00316     CLEANUP:
00317       return hr;
00318     }
00319 };
00320
00321
00322 ////////////////////////////////////////////////////////
00323 // CPropertyPage
00324 //
00325 ////////////////////////////////////////////////////////
00326 class CPropertyPage : public IPropertyPage, public IPersistPropertyBag    //@base public | IPropertyPage
00327 {
00328   protected:        //@access
00329     ULONG     m_cRef;
00330     CLSID     m_clsid;
00331     INT       m_iDialogID;
00332     HWND      m_hWnd;
00333
00334     IPropertyPageSite* m_pIPropertyPageSite;
00335
00336   public:         //@access public
00337     CPropertyPage(REFCLSID clsid, INT iDialogID);
00338     virtual ~CPropertyPage();
00339
00340     //Dialog Proc
00341     static INT_PTR WINAPI DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
00342     virtual BOOL      HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
00343
00344     //IUnknown
00345     DEFINE_ADDREF_RELEASE;
00346     STDMETHODIMP  QueryInterface(REFIID riid, LPVOID *ppv);
00347
00348     //IPropertyPage
00349         STDMETHODIMP SetPageSite(IPropertyPageSite* pPageSite);
00350         STDMETHODIMP Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal);
00351         STDMETHODIMP Deactivate();
00352
00353         virtual STDMETHODIMP GetPageInfo(
00354             /* [out] */ PROPPAGEINFO __RPC_FAR *pPageInfo)
00355     {
00356       ASSERT(pPageInfo);
00357       ASSERT(pPageInfo->cb == sizeof(PROPPAGEINFO));
00358       memset(pPageInfo, 0, sizeof(PROPPAGEINFO));
00359       return S_OK;
00360     }
00361
00362         STDMETHODIMP SetObjects(
00363             /* [in] */ ULONG cObjects,
00364             /* [size_is][in] */ IUnknown __RPC_FAR *__RPC_FAR *ppUnk)
00365     {
00366       return E_NOTIMPL;
00367     }
00368
00369         STDMETHODIMP Show(UINT nCmdShow);
00370         STDMETHODIMP Move(LPCRECT pRect);
00371         STDMETHODIMP IsPageDirty();
00372         STDMETHODIMP Apply();
00373
00374         STDMETHODIMP Help(
00375             /* [in] */ LPCOLESTR pszHelpDir)
00376     {
00377       return E_NOTIMPL;
00378     }
00379
00380         STDMETHODIMP TranslateAccelerator(MSG* pMsg);
00381
00382     //IPersistPropertyBag
00383         STDMETHODIMP InitNew( void)
00384     {
00385       return E_NOTIMPL;
00386     }
00387
00388         STDMETHODIMP Load(
00389             /* [in] */ IPropertyBag __RPC_FAR *pPropBag,
00390             /* [in] */ IErrorLog __RPC_FAR *pErrorLog)
00391     {
00392       return S_OK;
00393     }
00394
00395         STDMETHODIMP Save(
00396             /* [in] */ IPropertyBag __RPC_FAR *pPropBag,
00397             /* [in] */ BOOL fClearDirty,
00398             /* [in] */ BOOL fSaveAllProperties)
00399     {
00400       return E_NOTIMPL;
00401     }
00402
00403         STDMETHODIMP GetClassID(
00404             /* [out] */ CLSID __RPC_FAR *pClassID)
00405     {
00406       if(!pClassID)
00407         return E_INVALIDARG;
00408
00409       *pClassID = m_clsid;
00410       return S_OK;
00411     }
00412 };
00413
00414
00415 ////////////////////////////////////////////////////////
00416 // CDSLConnectionPage
00417 //
00418 ////////////////////////////////////////////////////////
00419 class CDSLConnectionPage : public CPropertyPage
00420 {
00421   public:         //@access public
00422     CDSLConnectionPage();
00423     virtual ~CDSLConnectionPage();
00424
00425     //Dialog
00426     virtual BOOL  HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
00427
00428     //Overloaded methods
00429         STDMETHODIMP Load(
00430             /* [in] */ IPropertyBag __RPC_FAR *pPropBag,
00431             /* [in] */ IErrorLog __RPC_FAR *pErrorLog);
00432
00433     STDMETHODIMP Save(
00434             /* [in] */ IPropertyBag __RPC_FAR *pPropBag,
00435             /* [in] */ BOOL fClearDirty,
00436             /* [in] */ BOOL fSaveAllProperties);
00437
00438   protected:
00439     //data
00440     VARIANT   m_vDataSource;
00441 };
00442
00443
00444 ////////////////////////////////////////////////////////
00445 // CDSLAdvancedPage
00446 //
00447 ////////////////////////////////////////////////////////
00448 class CDSLAdvancedPage : public CPropertyPage
00449 {
00450   public:         //@access public
00451     CDSLAdvancedPage();
00452     virtual ~CDSLAdvancedPage();
00453
00454     //Dialog
00455     virtual BOOL  HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
00456
00457   protected:
00458     //data
00459 };
00460
00461
00462 #endif
00463
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcevents.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcevents.h

Go to the documentation of this file.
00001 // rtcevents.h
00002 //
00003
00004 #ifndef _RTCEVENTS_H_
00005 #define _RTCEVENTS_H_
00006
00007 // Class to sink RTC events
00008 class CRTCEvents :
00009   public IRTCEventNotification
00010 {
00011 private:
00012     DWORD m_dwRefCount;
00013     DWORD m_dwCookie;
00014     HWND  m_hWnd;
00015
00016 public:
00017     CRTCEvents() : m_dwRefCount(0),
00018                    m_dwCookie(0),
00019                    m_hWnd(NULL)
00020     {}
00021
00022     /////////////////////////////////////////////
00023     //
00024     // QueryInterface
00025     //
00026
00027   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
00028     {
00029         if (iid == IID_IRTCEventNotification)
00030         {
00031             *ppvObject = (void *)this;
00032             AddRef();
00033             return S_OK;
00034         }
00035
00036         if (iid == IID_IUnknown)
00037         {
00038             *ppvObject = (void *)this;
00039             AddRef();
00040             return S_OK;
00041         }
00042
00043         return E_NOINTERFACE;
00044     }
00045
00046     /////////////////////////////////////////////
00047     //
00048     // AddRef
00049     //
00050
00051   ULONG STDMETHODCALLTYPE AddRef()
00052     {
00053         m_dwRefCount++;
00054         return m_dwRefCount;
00055     }
00056
00057     /////////////////////////////////////////////
00058     //
00059     // Release
00060     //
00061
00062   ULONG STDMETHODCALLTYPE Release()
00063     {
00064         m_dwRefCount--;
00065
00066         if ( 0 == m_dwRefCount)
00067         {
00068             delete this;
00069         }
00070
00071         return 1;
00072     }
00073
00074     /////////////////////////////////////////////
00075     //
00076     // Advise
00077     //
00078
00079     HRESULT Advise(IRTCClient * pClient, HWND hWnd)
00080     {
00081       IConnectionPointContainer * pCPC = NULL;
00082       IConnectionPoint * pCP = NULL;
00083         HRESULT hr;
00084
00085         // Find the connection point container
00086       hr = pClient->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
00087
00088       if (SUCCEEDED(hr))
00089         {
00090             // Find the connection point
00091         hr = pCPC->FindConnectionPoint(IID_IRTCEventNotification, &pCP);
00092
00093             SAFE_RELEASE(pCPC);
00094
00095             if (SUCCEEDED(hr))
00096             {
00097                 // Advise the connection
00098             hr = pCP->Advise(this, &m_dwCookie);
00099
00100                 SAFE_RELEASE(pCP);
00101             }
00102         }
00103
00104         // Store the window handle of the application so we
00105         // can post messages to it when events are fired
00106         m_hWnd = hWnd;
00107
00108       return hr;
00109     }
00110
00111     /////////////////////////////////////////////
00112     //
00113     // Unadvise
00114     //
00115
00116     HRESULT Unadvise(IRTCClient * pClient)
00117     {
00118       IConnectionPointContainer * pCPC = NULL;
00119       IConnectionPoint * pCP = NULL;
00120         HRESULT hr;
00121
00122         if (m_dwCookie)
00123         {
00124             // Find the connection point container
00125           hr = pClient->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
00126
00127           if (SUCCEEDED(hr))
00128             {
00129                 // Find the connection point
00130             hr = pCPC->FindConnectionPoint(IID_IRTCEventNotification, &pCP);
00131
00132                 SAFE_RELEASE(pCPC);
00133
00134                 if (SUCCEEDED(hr))
00135                 {
00136                     // Unadvise this connection
00137                 hr = pCP->Unadvise(m_dwCookie);
00138
00139                     SAFE_RELEASE(pCP);
00140                 }
00141             }
00142         }
00143
00144       return hr;
00145     }
00146
00147     /////////////////////////////////////////////
00148     //
00149     // Event
00150     //
00151
00152   HRESULT STDMETHODCALLTYPE Event(
00153         RTC_EVENT enEvent,
00154         IDispatch * pDisp
00155         )
00156     {
00157         // We will post a message containing the event to the
00158         // application window.
00159
00160         // Add a reference to the event so we can hold onto it while
00161         // the event is in the message queue.
00162         pDisp->AddRef();
00163
00164         // Post the message
00165         PostMessage( m_hWnd, WM_RTC_EVENT, (WPARAM)enEvent, (LPARAM)pDisp );
00166
00167         return S_OK;
00168     }
00169 };
00170
00171 #endif //__RTCTEST__
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/ImeUI.C Source File

  • WinUI
  • Input
  • Ime
  • FullIME

ImeUI.C

Go to the documentation of this file.
00001 #include <assert.h>
00002 #include <windows.h>
00003 #include <imm.h>
00004 #include "FullIME.h"
00005
00006 static DWORD CompColor[ 4 ] = { RGB( 255, 0, 0 ),
00007                                 RGB( 255, 0 , 255 ),
00008                                 RGB( 0, 0, 255 ),
00009                                 RGB( 0, 255, 0 ) };
00010
00011 //**********************************************************************
00012 //
00013 // void ImeUIStartComposition()
00014 //
00015 // This handles WM_IME_STARTCOMPOSITION message.
00016 //
00017 //**********************************************************************
00018 void ImeUIStartComposition(
00019     HWND hwnd )
00020 {
00021
00022     //
00023     // Change caption title to DBCS composition mode.
00024     //
00025
00026     SetWindowText( hwnd, szSteCompTitle );
00027
00028     //
00029     // Reset global variables.
00030     //
00031
00032     gImeUIData.uCompLen = 0;             // length of composition string.
00033
00034     gImeUIData.ImeState |= IME_IN_COMPOSITION;
00035 }
00036
00037
00038 //**********************************************************************
00039 //
00040 // void ImeUIComposition()
00041 //
00042 // This handles WM_IME_COMPOSITION message. It here just handles
00043 // composition string and result string. For normal case, it should
00044 // examine all posibile flags indicated by CompFlag, then do some
00045 // actitions to reflect what kinds of composition info. IME conversion
00046 // engine informs.
00047 //
00048 //**********************************************************************
00049 void ImeUIComposition(
00050     HWND hwnd,
00051     WPARAM wParam,
00052     LPARAM CompFlag )
00053 {
00054
00055     if ( CompFlag & GCS_RESULTSTR )
00056     {
00057          GetResultStr( hwnd );
00058     }
00059     else
00060     {
00061         if ( CompFlag & GCS_COMPSTR )
00062         {
00063             GetCompositionStr( hwnd, CompFlag );
00064         }
00065     }
00066
00067 }
00068
00069
00070 //**********************************************************************
00071 //
00072 // void GetCompositionStr()
00073 //
00074 // This handles WM_IME_COMPOSITION message with GCS_COMPSTR flag on.
00075 //
00076 //**********************************************************************
00077 void GetCompositionStr(
00078     HWND hwnd,
00079     LPARAM CompFlag )
00080 {
00081      LONG       bufLen;               // Stogare for len. of composition str
00082      LPSTR      lpCompStr;              // Pointer to composition str.
00083      HIMC       hIMC;                   // Input context handle.
00084      HLOCAL     hMem;                   // Memory handle.
00085      LPSTR      lpCompStrAttr;          // Pointer to composition str array.
00086      HLOCAL     hMemAttr = NULL;        // Memory handle for comp. str. array.
00087      LONG       bufLenAttr;
00088
00089      //
00090      // If fail to get input context handle then do nothing.
00091      // Applications should call ImmGetContext API to get
00092      // input context handle.
00093      //
00094
00095      if ( !( hIMC = ImmGetContext( hwnd ) ) )
00096          return;
00097
00098      //
00099      // Determines how much memory space to store the composition string.
00100      // Applications should call ImmGetCompositionString with
00101      // GCS_COMPSTR flag on, buffer length zero, to get the bullfer
00102      // length.
00103      //
00104
00105      bufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR, (void*)NULL, 0l );
00106      if ( ( IMM_ERROR_NODATA == bufLen) ||
00107           ( IMM_ERROR_GENERAL == bufLen) )
00108      {
00109          goto exit2;
00110      }
00111
00112      //
00113      // Allocates memory with bufLen+1 bytes to store the composition
00114      // string. Here we allocale on more byte to put null character.
00115      //
00116
00117      if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
00118          goto exit2;
00119
00120      if ( !( lpCompStr = (LPSTR) LocalLock( hMem ) ) )
00121          goto exit1;
00122
00123      //
00124      // Reads in the composition string.
00125      //
00126
00127      ImmGetCompositionString( hIMC, GCS_COMPSTR, lpCompStr, bufLen );
00128
00129      //
00130      // Null terminated.
00131      //
00132
00133      lpCompStr[ bufLen ] = 0;
00134
00135      //
00136      // If GCS_COMPATTR flag is on, then we need to take care of it.
00137      //
00138
00139      if ( CompFlag & GCS_COMPATTR )
00140      {
00141          bufLenAttr = ImmGetCompositionString( hIMC, GCS_COMPATTR, (void*)NULL, 0l );
00142          if ( ( IMM_ERROR_NODATA == bufLenAttr) ||
00143               ( IMM_ERROR_GENERAL == bufLenAttr) )
00144          {
00145              goto nothing;
00146          }
00147
00148          //
00149          // Allocate memory to store attributes of composition strings.
00150          //
00151
00152          if ( !( hMemAttr = LocalAlloc( LPTR, (int)bufLenAttr + 1 ) ) )
00153              goto nothing;
00154
00155          if ( !( lpCompStrAttr = (LPSTR) LocalLock( hMemAttr ) ) )
00156          {
00157              LocalFree( hMemAttr );
00158              goto nothing;
00159          }
00160
00161          //
00162          // Reads in the attribute array.
00163          //
00164
00165          ImmGetCompositionString( hIMC, GCS_COMPATTR, lpCompStrAttr,
00166                                   bufLenAttr );
00167
00168          lpCompStrAttr[ bufLenAttr ] = 0;
00169
00170      } else
00171      {
00172
00173 nothing:
00174          lpCompStrAttr = NULL;
00175      }
00176
00177
00178      //
00179      // Display new composition chars.
00180      //
00181
00182      DisplayCompString( hwnd, lpCompStr, lpCompStrAttr );
00183
00184      //
00185      // Keep the length of the composition string for using later.
00186      //
00187
00188      gImeUIData.uCompLen = (UINT)bufLen;
00189
00190      LocalUnlock( hMem );
00191
00192      if ( lpCompStrAttr )
00193      {
00194          if (NULL != hMemAttr)
00195          {
00196              LocalUnlock( hMemAttr );
00197              LocalFree( hMemAttr );
00198          }
00199      }
00200
00201 exit1:
00202
00203      LocalFree( hMem );
00204
00205 exit2:
00206
00207      ImmReleaseContext( hwnd, hIMC );
00208
00209 }
00210
00211
00212 //***********************************************************************
00213 //
00214 // void GetResultStr()
00215 //
00216 // This handles WM_IME_COMPOSITION with GCS_RESULTSTR flag on.
00217 //
00218 //***********************************************************************
00219 void GetResultStr(
00220     HWND hwnd )
00221 {
00222     LONG        bufLen;                 // Storage for length of result str.
00223     LPSTR       lpResultStr;            // Pointer to result string.
00224     HIMC        hIMC;                   // Input context handle.
00225     HLOCAL      hMem;                   // Memory handle.
00226
00227     //
00228     // If fail to get input context handle then do nothing.
00229     //
00230
00231     if ( !( hIMC = ImmGetContext( hwnd ) ) )
00232         return;
00233
00234     //
00235     // Determines how much memory space to store the result string.
00236     // Applications should call ImmGetCompositionString with
00237     // GCS_RESULTSTR flag on, buffer length zero, to get the bullfer
00238     // length.
00239     //
00240
00241     if ( ( bufLen = ImmGetCompositionString( hIMC, GCS_RESULTSTR,
00242                                   (void *)NULL, (DWORD) 0 ) ) <= 0 )
00243         goto exit2;
00244
00245     //
00246     // Allocates memory with bufLen+1 bytes to store the result
00247     // string. Here we allocale on more byte to put null character.
00248     //
00249
00250     if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
00251         goto exit2;
00252
00253     if ( !( lpResultStr = (LPSTR) LocalLock( hMem ) ) )
00254         goto exit1;
00255
00256     //
00257     // Reads in the result string.
00258     //
00259
00260     ImmGetCompositionString( hIMC, GCS_RESULTSTR, lpResultStr, bufLen );
00261
00262     //
00263     // Displays the result string.
00264     //
00265
00266     DisplayResultString( hwnd, lpResultStr );
00267
00268     LocalUnlock( hMem );
00269
00270 exit1:
00271
00272     LocalFree( hMem );
00273
00274 exit2:
00275
00276     ImmReleaseContext( hwnd, hIMC );
00277
00278 }
00279
00280
00281 //**********************************************************************
00282 //
00283 // void ImeUIEndComposition
00284 //
00285 // This handles WM_IME_ENDCOMPOSITION message.
00286 //
00287 //**********************************************************************
00288 void ImeUIEndComposition(
00289     HWND hwnd )
00290 {
00291
00292     RECT rect = {0};
00293
00294     //
00295     // Change caption title to normal
00296     //
00297
00298     SetWindowText( hwnd, szSteTitle );
00299
00300     //
00301     // Update client area.
00302     //
00303
00304     GetClientRect( hwnd, &rect );
00305
00306     InvalidateRect( hwnd, &rect, FALSE );
00307
00308     //
00309     // Reset the length of composition string to zero.
00310     //
00311
00312     gImeUIData.uCompLen = 0;
00313
00314     gImeUIData.ImeState &= ~IME_IN_COMPOSITION;
00315
00316 }
00317
00318 //**********************************************************************
00319 //
00320 // BOOL ImeUINotify()
00321 //
00322 // This handles WM_IME_NOTIFY message.
00323 //
00324 //**********************************************************************
00325 BOOL ImeUINotify(
00326     HWND hwnd,
00327     WPARAM wParam,
00328     LPARAM lParam )
00329 {
00330     switch (wParam )
00331     {
00332         case IMN_OPENCANDIDATE:
00333
00334             ImeUIOpenCandidate( hwnd, lParam );
00335             break;
00336
00337         case IMN_CLOSECANDIDATE:
00338
00339             ImeUICloseCandidate( hwnd, lParam );
00340             break;
00341
00342         case IMN_CHANGECANDIDATE:
00343
00344             ImeUIChangeCandidate( hwnd, lParam );
00345             break;
00346
00347         case IMN_SETOPENSTATUS:
00348
00349             ImeUISetOpenStatus( hwnd );
00350             break;
00351
00352   default:
00353       return FALSE;
00354
00355     }
00356
00357     return TRUE;
00358 }
00359
00360
00361 //**********************************************************************
00362 //
00363 // void ImeUIOpenCandidate()
00364 //
00365 // This handles WM_IME_NOTIFY message with wParam = IMN_OPENCANDIDATE.
00366 //
00367 //**********************************************************************
00368 void ImeUIOpenCandidate(
00369     HWND hwnd,
00370     LPARAM CandList )
00371 {
00372     HIMC            hIMC;               // Input context handle.
00373     LPCANDIDATELIST lpCandList;         // Storage for LP to candidate list.
00374     CANDIDATELIST   tempCandList;       // Storage for LP to candidate list.
00375     DWORD           bufLen;           // Storage for candidate strings.
00376     LPSTR           lpStr;              // Storage for LP to a string.
00377     DWORD           dwIndex;            // Storage for index of ListCand array
00378     DWORD           i;                  // Loop count.
00379     int             width = 0;          // Storage for width of listCand
00380     int             CurNumCandList = 0; // Storage for number of cand. lists.
00381     DWORD           dwPreferNumPerPage; // Storage for PreferNumPerPage
00382     POINT           point;              // Storage for caret position.
00383
00384     //
00385     // If fail to get input context handle, do nothing.
00386     //
00387
00388     if ( ! (hIMC = ImmGetContext( hwnd ) ) )
00389         return;
00390
00391     //
00392     // Change caption title to DBCS candidate mode.
00393     //
00394
00395     SetWindowText( hwnd, szSteCandTitle );
00396
00397     //
00398     // Find out how many candidate windows have already been opened.
00399     //
00400
00401     for( i = 0; i < MAX_LISTCAND; i++ )
00402     {
00403         if ( gImeUIData.hListCand[ i ] )
00404         {
00405             CurNumCandList++;
00406         }
00407     }
00408
00409     //
00410     // Check which candidate lists should be displayed by loopping
00411     // through all possible candidate lists.
00412     //
00413
00414     for( dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ )
00415     {
00416
00417         if ( CandList & ( 1 << dwIndex ) )
00418         {
00419             //
00420             // The dwIndex-th candidate list contains candidate strings.
00421             // So here we want to display them.
00422             //
00423
00424             //
00425             // Determines how musch memory space should be allocated to
00426             // read in the corresponding candidate list .
00427             //
00428
00429             if ( ! ( bufLen = ImmGetCandidateList( hIMC, dwIndex, &tempCandList, 0 ) ) )
00430                 goto exit2;
00431
00432
00433             //
00434             // Allocate memory space.
00435             //
00436
00437             if( !( gImeUIData.hListCandMem[ dwIndex ]  =
00438                    GlobalAlloc( LPTR, (int)bufLen ) ) )
00439                 goto exit2;
00440
00441             if( !( lpStr =
00442                  (LPSTR)GlobalLock( gImeUIData.hListCandMem[ dwIndex ] ) ) )
00443             {
00444                 GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
00445                 gImeUIData.hListCandMem[ dwIndex ] = NULL;
00446                 goto exit2;
00447             }
00448
00449             lpCandList = (LPCANDIDATELIST) lpStr;
00450
00451             //
00452             // Reads in the corresponding candidate list.
00453             //
00454
00455             ImmGetCandidateList( hIMC, dwIndex, lpCandList, bufLen );
00456
00457             //
00458             // Get current caret position.
00459             //
00460
00461             GetCaretPos( (POINT *)&point );
00462             ClientToScreen( hwnd, &point );
00463
00464             //
00465             // Determines how many candidate strings per page.
00466             //
00467
00468             dwPreferNumPerPage = ( !lpCandList->dwPageSize ) ?
00469                                  DEFAULT_CAND_NUM_PER_PAGE :
00470                                  lpCandList->dwPageSize;
00471             //
00472             // Determining maximum character length the list box
00473             // will display by loopping through all candidate strings.
00474             //
00475
00476             for( i = 0; i < lpCandList->dwCount; i++ )
00477             {
00478                 //
00479                 // Get the pointer to i-th candidate string.
00480                 //
00481
00482                 lpStr = (LPSTR)lpCandList +
00483                         lpCandList->dwOffset[ i ];
00484
00485                 width = ( width < lstrlen( lpStr ) ) ? lstrlen( lpStr ) : width;
00486
00487             }
00488
00489             //
00490             // Create a candidate window for the candidate list.
00491             //
00492
00493
00494             gImeUIData.hListCand[ dwIndex ] =
00495                    CreateWindow( szCandClass,
00496                                  NULL,
00497                                  WS_BORDER | WS_POPUP | WS_DISABLED,
00498                                  CurNumCandList * X_INDENT + point.x,
00499                                  CurNumCandList * Y_INDENT +
00500                                      point.y + cyMetrics,
00501                                  ( width ) * cxMetrics + 10,
00502                                  (int)(dwPreferNumPerPage) * cyMetrics + 5,
00503                                  hwnd,
00504                                  NULL,
00505                                  (HANDLE)GetWindowLongPtr( hwnd, GWLP_HINSTANCE ),
00506                                  NULL );
00507             //
00508             // If fail to create the candidate window then do nothing.
00509             //
00510
00511             if ( gImeUIData.hListCand[ dwIndex ] < 0 )
00512             {
00513                 GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );
00514                 GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
00515                 goto exit2;
00516             }
00517
00518
00519             //
00520             // Show candidate window.
00521             //
00522
00523             ShowWindow( gImeUIData.hListCand[ dwIndex ], SW_SHOWNOACTIVATE );
00524
00525             //
00526             // Display candidate strings.
00527             //
00528
00529             DisplayCandStrings( gImeUIData.hListCand[ dwIndex ], lpCandList );
00530
00531             GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );
00532
00533             CurNumCandList++;
00534         }
00535     }
00536
00537     //
00538     // Reset IME state.
00539     //
00540
00541     gImeUIData.ImeState |= IME_IN_CHOSECAND;
00542
00543 exit2:
00544
00545     ImmReleaseContext( hwnd, hIMC );
00546
00547 }
00548
00549
00550 //**********************************************************************
00551 //
00552 // void ImeUICloseCandidate()
00553 //
00554 // This handles WM_IME_NOTIFY message with
00555 // wParam = IMN_CLOSECANDIDATE.
00556 //
00557 //**********************************************************************
00558 void ImeUICloseCandidate(
00559     HWND hwnd,
00560     LPARAM CandList )
00561 {
00562     int index;
00563
00564     //
00565     // Change window's caption title to normal.
00566     //
00567
00568     SetWindowText( hwnd, szSteCompTitle );
00569
00570     //
00571     // If the i-th bit on of CandList that means the i-th
00572     // candidate list should be closed.
00573     //
00574
00575     for( index = 0; index < MAX_LISTCAND; index ++ )
00576     {
00577         if (( CandList & ( 1 << index ) ) && gImeUIData.hListCand[ index ])
00578         {
00579
00580             //
00581             // Destroy the candidate window.
00582             //
00583
00584             DestroyWindow( gImeUIData.hListCand[ index ] );
00585
00586             gImeUIData.hListCand[ index ] = NULL;
00587
00588             //
00589             // Free memory.
00590             //
00591
00592             GlobalFree( gImeUIData.hListCandMem[ index ] );
00593
00594             gImeUIData.hListCandMem[ index ] = NULL;
00595
00596         }
00597     }
00598
00599     gImeUIData.ImeState &= ~IME_IN_CHOSECAND;
00600
00601 }
00602
00603
00604 //**********************************************************************
00605 //
00606 // void ImeUIChangeCandidate()
00607 //
00608 // This handles WM_IME_NOTIFY message with wParam = IMN_CHANGECANDIDATE.
00609 //
00610 //**********************************************************************
00611 void ImeUIChangeCandidate(
00612     HWND hwnd,
00613     LPARAM CandList )
00614 {
00615     HIMC            hIMC;
00616     LPCANDIDATELIST lpCandList = NULL;
00617     DWORD           dwIndex;
00618     DWORD           bufLen;
00619     LPSTR         lpStr;
00620     DWORD         i;
00621     RECT          rect = {0};
00622     int           width = 0;
00623     DWORD         dwPreferNumPerPage;
00624
00625
00626     //
00627     // If fail to get input context, do nothing.
00628     //
00629
00630     if ( !( hIMC = ImmGetContext( hwnd ) ) )
00631         return;
00632
00633     //
00634     // Determine which candidate list should be updated.
00635     //
00636
00637     for ( dwIndex = 0; dwIndex < MAX_LISTCAND; dwIndex++ )
00638         if ( CandList & ( 1 << dwIndex ) )
00639             break;
00640
00641     //
00642     // If dwIndex == MAX_LISTCAND, then something wrong, do nothing.
00643     //
00644
00645     if ( dwIndex == MAX_LISTCAND )
00646         return;
00647
00648     //
00649     // Determines how much memory space should be allocated to read in the
00650     // corresponding candidate list.
00651     //
00652
00653     if ( !( bufLen = ImmGetCandidateList( hIMC, dwIndex, lpCandList, 0 ) ) )
00654         goto exit2;
00655
00656     //
00657     // Relocate memory space.
00658     //
00659
00660     if ( !( gImeUIData.hListCandMem[ dwIndex ] = GlobalReAlloc(
00661       gImeUIData.hListCandMem[ dwIndex ], (int)bufLen, LPTR ) ) )
00662     {
00663         goto exit2;
00664     }
00665
00666     if ( !( lpStr =
00667         (LPSTR)GlobalLock( gImeUIData.hListCandMem[ dwIndex ] ) ) )
00668     {
00669         GlobalFree( gImeUIData.hListCandMem[ dwIndex ] );
00670         gImeUIData.hListCandMem[ dwIndex ] = NULL;
00671         goto exit2;
00672     }
00673
00674     lpCandList = (LPCANDIDATELIST) lpStr;
00675
00676     //
00677     // Reads in the corresponding candidate list.
00678     //
00679
00680     ImmGetCandidateList( hIMC, dwIndex, lpCandList, bufLen );
00681
00682     //
00683     // Determines how many candidate strings per page.
00684     //
00685
00686     dwPreferNumPerPage = ( !lpCandList->dwPageSize ) ?
00687                          DEFAULT_CAND_NUM_PER_PAGE :
00688                          lpCandList->dwPageSize;
00689     //
00690     // Determining maximum character length  the list box
00691     // will display by loopping through all candidate strings.
00692     //
00693
00694     for( i = 0; i < lpCandList->dwCount; i++ )
00695     {
00696         //
00697         // Get the pointer to i-th candidate string.
00698         //
00699
00700         lpStr = (LPSTR)lpCandList +
00701                 lpCandList->dwOffset[ i ];
00702
00703         width = ( width < lstrlen( lpStr ) ) ? lstrlen( lpStr ) :
00704                   width;
00705     }
00706
00707     GetWindowRect( gImeUIData.hListCand[ dwIndex ] , &rect);
00708
00709     SetWindowPos( gImeUIData.hListCand[ dwIndex ],
00710               hwnd,
00711               rect.left,
00712               rect.top,
00713               ( width ) * cxMetrics + 10,
00714               (int)(dwPreferNumPerPage) * cyMetrics + 5,
00715               SWP_NOZORDER | SWP_NOACTIVATE );
00716
00717
00718     DisplayCandStrings( gImeUIData.hListCand[ dwIndex ], lpCandList );
00719
00720     GlobalUnlock( gImeUIData.hListCandMem[ dwIndex ] );
00721
00722 exit2:
00723
00724     return;
00725
00726 }
00727
00728
00729 //***********************************************************************
00730 //
00731 // void ImeUISetOpenStatus()
00732 //
00733 // This handles WM_IME_REPORT message with wParam = IR_NOTIFY &
00734 // lParam = IMC_SETOPENSTATUS.
00735 //
00736 //**********************************************************************
00737 void ImeUISetOpenStatus(
00738     HWND hwnd )
00739 {
00740     int  i;       // Lopp counter
00741     HIMC hIMC;    // Storage for input context handle.
00742
00743     //
00744     // If fail to get input context handle then do nothing
00745     //
00746
00747     if ( !( hIMC = ImmGetContext( hwnd ) ) )
00748         return;
00749
00750     if ( ImmGetOpenStatus( hIMC ) )
00751     {
00752
00753         //
00754         // If the IME conversion engine is open, here we change
00755         // window's caption title to DBCS composition mode.
00756         //
00757
00758         SetWindowText( hwnd, (LPSTR)szSteCompTitle );
00759     }
00760     else
00761     {
00762         RECT rect = {0};
00763
00764         //
00765         // If the IME conversion engine is closed, here we
00766         // erase all already displayed composition chars if any,
00767         // change the window's caption title to normal.
00768         //
00769
00770         GetClientRect( hwnd, &rect );
00771         InvalidateRect( hwnd, &rect, FALSE );
00772
00773         SetWindowText( hwnd, (LPSTR)szSteTitle );
00774
00775         //
00776         // Here we close and destroy all of candidate windows
00777         // if IME conversion engine is closed.
00778         //
00779
00780         for( i = 0; i <= MAX_LISTCAND; i++ )
00781         {
00782             if ( gImeUIData.hListCand[ i ] )
00783             {
00784                 DestroyWindow( gImeUIData.hListCand[ i ] );
00785                 gImeUIData.hListCand[ i ] = NULL;
00786                 GlobalFree( gImeUIData.hListCandMem[ i ] );
00787                 gImeUIData.hListCandMem[ i ] = NULL;
00788             }
00789         }
00790
00791         //
00792         // Reset IMEUI's global data.
00793         //
00794
00795         gImeUIData.uCompLen = 0;
00796         gImeUIData.ImeState = 0;
00797
00798         ResetCaret( hwnd );
00799
00800     }
00801
00802     ImmReleaseContext( hwnd, hIMC );
00803 }
00804
00805
00806 //*********************************************************************
00807 //
00808 // void DisplayCompString()
00809 //
00810 // This displays composition string.
00811 //
00812 // This function supports only fixed pitch font.
00813 //
00814 //*********************************************************************
00815 void DisplayCompString( HWND hwnd, LPSTR lpStr, LPSTR lpStrAttr )
00816 {
00817     HDC         hdc;
00818     int         StrLen = lstrlen( lpStr );
00819     RECT        rect;
00820     DWORD       dwColor;
00821     int         i;
00822     BOOL        fDBCSTrailByte = FALSE;
00823
00824
00825     hdc = GetDC( hwnd );
00826
00827     HideCaret( hwnd );
00828
00829     //
00830     // Determine OPAQUE rect.
00831     //
00832
00833     rect.left = xPos * cxMetrics;
00834     rect.top  = yPos * cyMetrics;
00835     rect.bottom = rect.top + cyMetrics;
00836     rect.right = ( (int)gImeUIData.uCompLen > StrLen ) ?
00837                  ( xPos + gImeUIData.uCompLen ) * cxMetrics:
00838                  ( xPos + StrLen ) * cxMetrics;
00839
00840     //
00841     // This example we use red to display composition chars
00842     // with attribute 000, pink for attribute 001,
00843     // blue for attribute 010, green for attribute 011.
00844     //
00845
00846     //
00847     // Each composition character has different attribute.
00848     // We here use different kinds of color to represent attributes.
00849     // Red, pink, blue and green are for attribute 000, 001, 010 and 011,
00850     // respectively.
00851     //
00852
00853
00854     dwColor = GetTextColor( hdc );
00855
00856     if ( ( StrLen % 2 ) )
00857     {
00858         if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
00859         {
00860             textbuf[ yPos ][ xPos + StrLen ] = ' ';
00861             fDBCSTrailByte = TRUE;
00862         }
00863     } else
00864     {
00865         if ( !IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 2 ] ) )
00866         {
00867             if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
00868       {
00869                 textbuf[ yPos ][ xPos + StrLen ] = ' ';
00870                 fDBCSTrailByte = TRUE;
00871             }
00872         }
00873     }
00874
00875     if ( !lpStrAttr )
00876     {
00877         //
00878         // If there are not attribute array, here we use default color, RED,
00879         // to display all of composition characters.
00880         //
00881
00882         SetTextColor( hdc, CompColor[ 0 ] ); // default color
00883
00884         ExtTextOut( hdc, xPos * cxMetrics, yPos * cyMetrics,
00885                 ETO_OPAQUE, &rect, lpStr, StrLen, 0 );
00886
00887     } else
00888     {
00889
00890         int  ColorIndex;
00891
00892         ExtTextOut( hdc, xPos * cxMetrics, yPos * cyMetrics, ETO_OPAQUE,
00893                     &rect, NULL, 0, 0 );
00894
00895         for( i = 0; *lpStr;)
00896         {
00897             int cnt = IsDBCSLeadByte(*lpStr) ? 2 : 1;
00898
00899             ColorIndex = ( ((int)*lpStrAttr) < 0 ) ? 0 : (int)*lpStrAttr;
00900             ColorIndex = ( ColorIndex > 3 ) ? 3 : ColorIndex;
00901
00902             SetTextColor( hdc, CompColor[ ColorIndex ] );
00903
00904             TextOut( hdc, ( i + xPos ) * cxMetrics, yPos * cyMetrics,
00905                      lpStr, cnt );
00906             lpStr += cnt;
00907             lpStrAttr += cnt;
00908             i += cnt;
00909         }
00910     }
00911
00912
00913     SetTextColor( hdc, dwColor );
00914
00915     if ( fDBCSTrailByte )
00916     {
00917         TextOut( hdc, ( xPos + StrLen ) * cxMetrics, yPos * cyMetrics,
00918            " ", 1 );
00919     }
00920
00921     SetCaretPos( ( xPos + StrLen ) * cxMetrics, yPos * cyMetrics );
00922
00923     ShowCaret( hwnd );
00924
00925     ReleaseDC( hwnd, hdc );
00926
00927 }
00928
00929
00930 //*********************************************************************
00931 //
00932 // void DisplayResultString()
00933 //
00934 // This displays result string.
00935 //
00936 // This function supports only fixed pitch font.
00937 //
00938 //*********************************************************************
00939 void DisplayResultString(
00940     HWND hwnd,
00941     LPSTR lpStr )
00942 {
00943
00944     int         StrLen;         // Storage for string length.
00945     int         i;              // Loop counter.
00946     HDC         hdc;            // Display context handle.
00947
00948     StrLen = lstrlen( lpStr );
00949
00950     //
00951     // If there is no room for compsoition string, discard it
00952     //
00953
00954     if ( xPos == ( LASTCOL - StrLen - 1 ) )
00955         return;
00956
00957     //
00958     // if insert mode or during composition session,
00959     // move rest of line to the right by StrLen bytes.
00960     //
00961
00962     if ( fInsertMode )
00963     {
00964
00965         for( i = LASTCOL; i > xPos; i-- )
00966             textbuf[ yPos ][ i ] = textbuf[ yPos ][ i - StrLen ];
00967
00968         //
00969         // If the row ends on a lead byte, blank it out,
00970         // To do this we must first traverse the string starting
00971         // from a know character boundry until we reach the last column.
00972         // If the last column is a character boundry then the last
00973         // character is either a string byte or a lead byte.
00974         //
00975
00976         for( i = xPos + StrLen; i < LASTCOL; )
00977         {
00978             if ( IsDBCSLeadByte( textbuf[ yPos ][ i ] ) )
00979                 i++;
00980             i++;
00981         }
00982
00983         if ( i == LASTCOL && IsDBCSLeadByte( textbuf[ yPos ][ i ] ) )
00984             textbuf[ yPos ][ LASTCOL ] = ' ';
00985
00986     }
00987     else
00988     {
00989         //
00990         // overtype mode
00991         //
00992
00993         if ( ( StrLen % 2 ) )
00994         {
00995             if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
00996                 textbuf[ yPos ][ xPos + StrLen ] = ' ';
00997         }
00998         else
00999         {
01000             if ( !IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 2 ] ) )
01001             {
01002                 //
01003                 // Overtyping the current byte, plus the following byte
01004                 // which could be a lead byte.
01005                 //
01006
01007                 if ( IsDBCSLeadByte( textbuf[ yPos ][ xPos + StrLen - 1 ] ) )
01008                     textbuf[ yPos ][ xPos + StrLen ] = ' ';
01009             }
01010         }
01011     }
01012
01013     //
01014     // Store input character at current caret position.
01015     //
01016
01017     for( i = 0; i <= LASTCOL && *lpStr; i++ )
01018         textbuf[ yPos ][ xPos + i ] = *lpStr++;
01019
01020     //
01021     // Display input character
01022     //
01023
01024
01025     hdc = GetDC( hwnd );
01026
01027     HideCaret( hwnd );
01028
01029     //
01030     // Displays result string with normal color.
01031     //
01032
01033     TextOut( hdc, xPos *cxMetrics, yPos * cyMetrics,
01034              (LPCSTR)&( textbuf[ yPos][xPos] ), MAXCOL - xPos );
01035
01036
01037     ShowCaret( hwnd );
01038
01039     ReleaseDC( hwnd, hdc );
01040
01041     //
01042     // Reset Caret position
01043     //
01044
01045     xPos += StrLen;
01046
01047     if ( xPos > LASTCOL )
01048         xPos = LASTCOL;
01049
01050     ResetCaret( hwnd );
01051
01052     gImeUIData.uCompLen = 0;
01053
01054 }
01055
01056
01057 //**********************************************************************
01058 //
01059 // void RestoreImeUI()
01060 //
01061 // This repaints all displayed composition string if need.
01062 // Main window procedure will call this upon receiving
01063 // WM_PAINT message.
01064 //
01065 //**********************************************************************
01066 void RestoreImeUI(
01067     HWND hwnd )
01068 {
01069     HIMC        hIMC;           // Storage for input context handle.
01070     LONG        bufLen;         //
01071
01072
01073     //
01074     // If fail to get input context handle then do nothing.
01075     //
01076
01077     if ( !( hIMC = ImmGetContext( hwnd ) ) )
01078         return;
01079
01080     //
01081     // If IME conversion engine is open and there are any composition
01082     // string in the context then we redisplay them.
01083     //
01084
01085     if ( ImmGetOpenStatus( hIMC ) && gImeUIData.ImeState &&
01086          ( bufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR,
01087                       (void *)NULL, 0l ) ) > 0 )
01088     {
01089         LPSTR  lpCompStr;            // Pointer to composition string
01090         HLOCAL hMem;                 // Storage for memory handle.
01091         LPSTR  lpCompStrAttr = NULL; // Pointer to composition string's attribute
01092         LONG   bufLenAttr;           //
01093         HLOCAL hMemAttr = NULL;      // Memory handle for composition string's
01094                                      // attributes.
01095
01096         //
01097         // If fail to allocate and lock memory space for reading in
01098         // the composition string then do nothing.
01099         //
01100
01101         if ( !( hMem = LocalAlloc( LPTR, (int)bufLen + 1 ) ) )
01102             goto exit2;
01103
01104         if( !( lpCompStr = (LPSTR) LocalLock( hMem ) ) )
01105         {
01106             LocalFree( hMem );
01107             goto exit2;
01108         }
01109
01110         //
01111         // Get composition string and redisplay them.
01112         //
01113
01114         if ( ImmGetCompositionString( hIMC, GCS_COMPSTR, lpCompStr,
01115                                       bufLen ) > 0 )
01116         {
01117
01118             //
01119             // Make sure whether we need to handle composition string's
01120             // attributes.
01121             //
01122
01123             if ( ( bufLenAttr = ( ImmGetCompositionString( hIMC,
01124                        GCS_COMPATTR, (void FAR*)NULL, 0l ) ) ) > 0 )
01125             {
01126                 //
01127                 // If fail to allocate and lock memory space for reading in
01128                 // the composition string's attribute then we assume
01129                 // no attribute array.
01130                 //
01131
01132                 if ( !( hMemAttr = LocalAlloc(LPTR, (int)bufLenAttr + 1 )))
01133                     goto nothing;
01134
01135                 if ( !( lpCompStrAttr = (LPSTR) LocalLock( hMemAttr ) ) )
01136                 {
01137                     LocalFree( hMemAttr );
01138                     goto nothing;
01139                 }
01140
01141                 ImmGetCompositionString( hIMC, GCS_COMPATTR, lpCompStrAttr,
01142                                          bufLenAttr );
01143
01144                 lpCompStrAttr[ bufLenAttr ] = 0;
01145             }
01146             else
01147             {
01148 nothing:
01149                 lpCompStrAttr = NULL;
01150             }
01151
01152
01153             lpCompStr[ bufLen ] = 0;
01154
01155             DisplayCompString( hwnd, lpCompStr, lpCompStrAttr );
01156
01157         }
01158
01159         LocalUnlock( hMem );
01160         LocalFree( hMem );
01161
01162         if ( lpCompStrAttr )
01163         {
01164             if (NULL != hMemAttr)
01165             {
01166                 LocalUnlock( hMemAttr );
01167                 LocalFree( hMemAttr );
01168             }
01169         }
01170
01171
01172     }
01173
01174 exit2:
01175
01176     ImmReleaseContext( hwnd, hIMC );
01177
01178 }
01179
01180
01181 //**********************************************************************
01182 //
01183 // void ImeUIMove()
01184 //
01185 // Handler routine of WM_MOVE message.
01186 //
01187 //*********************************************************************
01188 void ImeUIMoveCandWin(
01189     HWND hwnd )
01190 {
01191
01192     if ( gImeUIData.ImeState & IME_IN_CHOSECAND )
01193     {
01194         POINT point;          // Storage for caret position.
01195         int   i;              // loop counter.
01196         int   NumCandWin;     // Storage for num of cand win.
01197         RECT  rect;           // Storage for client rect.
01198
01199         //
01200         // If current IME state is in chosing candidate, here we
01201         // move all candidate windows, if any, to the appropriate
01202         // position based on the parent window's position.
01203         //
01204
01205         NumCandWin = 0;
01206
01207         GetCaretPos( &point );
01208         ClientToScreen( hwnd, &point );
01209
01210         for ( i = 0; i < MAX_LISTCAND ; i++ )
01211         {
01212             if ( gImeUIData.hListCand[ i ] )
01213             {
01214                 GetClientRect( gImeUIData.hListCand[ i ], &rect );
01215
01216                 MoveWindow( gImeUIData.hListCand[ i ],
01217                             point.x + X_INDENT * NumCandWin,
01218                             point.y + Y_INDENT * NumCandWin + cyMetrics,
01219                             ( rect.right - rect.left + 1 ),
01220                             ( rect.bottom - rect.top + 1 ), TRUE );
01221
01222                 NumCandWin++;
01223             }
01224         }
01225     }
01226 }
01227
01228
01229 //**********************************************************************
01230 //
01231 // void ImeUIClearData()
01232 //
01233 // Handler routine of WM_IME_SELECT message.
01234 //
01235 //**********************************************************************
01236 void ImeUIClearData(
01237     HWND hwnd )
01238 {
01239
01240     RECT            rect;
01241     int             i;
01242
01243     SetWindowText( hwnd, szSteTitle );
01244
01245     //
01246     // If user switches to other IME, here we destroy all candidate
01247     // windows which has been opened and erase all composition
01248     // chars if any.
01249     //
01250
01251     for( i = 0; i < MAX_LISTCAND; i++ )
01252     {
01253         if ( gImeUIData.hListCand[ i ] )
01254         {
01255             //
01256             // The i-th candidate list has already been displayed,
01257             // destroy it and free memory which stores candidate
01258             // strings.
01259             //
01260
01261             DestroyWindow( gImeUIData.hListCand[ i] );
01262             GlobalFree( gImeUIData.hListCandMem[ i ] );
01263
01264             gImeUIData.hListCand[ i ] =
01265             gImeUIData.hListCandMem[ i ] = NULL;
01266
01267         }
01268     }
01269
01270     //
01271     // Update client area.
01272     //
01273
01274     GetClientRect( hwnd, &rect );
01275
01276     InvalidateRect( hwnd, &rect, FALSE );
01277
01278
01279     //
01280     // Reset IMEUI's global data.
01281     //
01282
01283     gImeUIData.uCompLen = gImeUIData.ImeState = 0;
01284
01285     //
01286     // Reset caret to the original position.
01287     //
01288
01289     HideCaret( hwnd );
01290     ResetCaret( hwnd );
01291     ShowCaret( hwnd );
01292
01293 }
01294
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Resource_Dispenser/Resource.h Source File

  • Com
  • Services
  • Resource_Dispenser

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Disp1.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_LDISP                       101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcav.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcav.h

Go to the documentation of this file.
00001 // rtcavsession.h
00002 //
00003
00004 #ifndef _RTCAVSESSION_H_
00005 #define _RTCAVSESSION_H_
00006
00007 // Class for audio/video session windows
00008 class CRTCAVSession : public CRTCSession
00009 {
00010 public:
00011     CRTCAVSession();
00012     ~CRTCAVSession();
00013
00014     // Registers the window class
00015     static HRESULT RegisterClass();
00016
00017     // Window procedure
00018     static LRESULT CALLBACK WindowProc(
00019       HWND hWnd,      // handle to window
00020       UINT uMsg,      // message identifier
00021       WPARAM wParam,  // first message parameter
00022       LPARAM lParam   // second message parameter
00023     );
00024
00025 protected:
00026
00027     friend class CRTCWin;
00028
00029     // Only one audio/video session can exist at a time. We will
00030     // treat this object as a singleton.
00031     static CRTCAVSession * m_Singleton;
00032
00033     static HWND m_hRecvVideoParent;
00034     static HWND m_hPrevVideoParent;
00035
00036     BOOL m_fShowRecv;
00037     BOOL m_fShowPrev;
00038     long m_lRecvWidth;
00039     long m_lRecvHeight;
00040     long m_lPrevWidth;
00041     long m_lPrevHeight;
00042
00043     HWND m_hMicText;
00044     HWND m_hSpkText;
00045     HWND m_hMicLevel;
00046     HWND m_hSpkLevel;
00047     HWND m_hMicVol;
00048     HWND m_hSpkVol;
00049     HWND m_hMicMute;
00050     HWND m_hSpkMute;
00051
00052     // Set the audio mute
00053     HRESULT DoMute(RTC_AUDIO_DEVICE enDevice);
00054
00055     // Set the audio volume
00056     HRESULT DoVolume(RTC_AUDIO_DEVICE enDevice, long lVolume);
00057
00058     // Update the audio controls display
00059     HRESULT ShowAudio();
00060
00061     // Update the video controls display
00062     HRESULT ShowVideo(RTC_VIDEO_DEVICE enDevice, BOOL fShow);
00063
00064     // Window message handlers
00065     virtual LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam);
00066     virtual LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam);
00067     virtual LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam);
00068     LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam);
00069     LRESULT OnHScroll(UINT uMsg, WPARAM wParam, LPARAM lParam);
00070
00071     // Event handlers
00072     virtual HRESULT DeliverMedia(long lMediaType, RTC_MEDIA_EVENT_TYPE enType, RTC_MEDIA_EVENT_REASON enReason);
00073     virtual HRESULT DeliverIntensity(RTC_AUDIO_DEVICE enDevice, long lLevel);
00074     virtual HRESULT DeliverClient(RTC_CLIENT_EVENT_TYPE enEventType);
00075 };
00076
00077 #endif //_RTCAVSESSION_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/about.Cpp Source File

  • SysMgmt
  • MMC
  • Extens

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163   MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164   *lpDest = wszStr;
00165
00166     return S_OK;
00167 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Formdump/keys.cpp Source File

  • Web
  • iis
  • extensions
  • Formdump

keys.cpp

Go to the documentation of this file.
00001 //  Copyright (c) 1997-2002 Microsoft Corporation
00002 //
00003 //  Module Name:
00004 //
00005 //    keys.cpp
00006 //
00007 //  Abstract:
00008 //
00009 //    This module contains functions which deal with keys and values
00010 //    on inbound form data. Please, see keys.h for details.
00011
00012 #define WIN32_LEAN_AND_MEAN     // the bare essential Win32 API
00013 #include <windows.h>
00014 #include <httpext.h>
00015
00016 // If your application plans to receive huge amounts of data
00017 // and you don't want megabytes of memory allocated, define
00018 // the USE_TEMPORARY_FILES.  It is recommended to leave the
00019 // define line below commented out unless absolutely necessary.
00020
00021 //#define USE_TEMPORARY_FILES
00022
00023 #include "keys.h"
00024
00025 #ifndef USE_MEMORY
00026   #ifndef USE_TEMPORARY_FILES
00027     #define USE_MEMORY
00028   #endif
00029 #endif
00030
00031 // If you want to record errors, modify this macro definition to
00032 // call your own logging function.  This sample does not save
00033 // error strings.
00034
00035 #define LOG(errorstring)        // OutputDebugString( errorstring ); \
00036                                 // OutputDebugString ( "\r\n" )
00037
00038 // Intended external interface:
00039 //
00040 // GetKeyList       Determines if data was sent, and if it was, the
00041 // data is extracted by GetPostKeys or GetUrlKeys,
00042 // two private functions within this file.  A
00043 // pointer to a linked list is returned ( as a
00044 // handle ).
00045 //
00046 // GetKeyInfo       Returns a pointer to the key name,
00047 // the length of the data, a flag indicating if
00048 // the data has control characters in it, and an
00049 // instance number for duplicate key names.
00050 //
00051 // GetKeyBuffer Returns a pointer to the buffer holding the key's
00052 // data.
00053 //
00054 // FindKey          Sequentially searches linked list for key name.
00055 //
00056 // FreeKeyList      Deallocates memory used by the linked list of
00057 // keys.  Also deletes content resources.
00058 //
00059 // GetKeyOffset Returns the offset to either the content memory
00060 // buffer or the content temporary file.
00061 //
00062 // GetContentFile   Returns a pointer to the temporary file, only
00063 // when USE_TEMPORARY_FILES is defined.
00064 //
00065 // CloseContentFile Closes the content file, normally left open
00066 // until FreeKeyList is called, available only
00067 // when USE_TEMPORARY_FILES is defined.
00068 //
00069 // OpenContentFile Reopens the content file for additional use
00070 // by GetKeyBuffer, available only when
00071 // USE_TEMPORARY_FILES is defined.
00072 //
00073 // GetDataBuffer    Returns a pointer to the content, only if the
00074 // USE_TEMPORARY_FILES constant is NOT defined.
00075 //
00076 // Helper functions called only in this source file:
00077 //
00078 // GetQueryByte Similar to GetPostedByte, this function
00079 // extracts data from the query string.
00080 //
00081 // HexDigitToInt    Returns the decimal value of a hex character.
00082 //
00083 // GetFirstByte Sets up POSDATA struct and calls GetNextByte.
00084 // Caller specifies function used to retrieve
00085 // data, either GetPostedByte or GetQueryByte.
00086 //
00087 // GetNextByte      Uses GetInboundByte ( specified in GetFirstByte )
00088 // to retrieve inbound data, and decodes it using
00089 // the URL encoding rules.
00090 //
00091 // BKL_Alloc        Allocates memory used in GetPostKeys.
00092 //
00093 // BKL_Dealloc      Deallocates memory used in GetPostKeys.
00094 //
00095 // BKL_Abort        Cleans up all resources for abnormal exits from
00096 // GetPostKeys.
00097 //
00098 // IsKeySeparator   Returns TRUE if character is one of "=\r\n&\0".
00099 //
00100 // BuildKeyList Given a data extraction function ( i.e.
00101 // GetPostedByte or GetQueryByte ), this function
00102 // converts all keys into a linked list of POSTKEY
00103 // structures.
00104 //
00105 // GetPostKeys      Takes inbound data off the wire by calling
00106 // BuildKeyList with GetPostedByte as the extraction
00107 // function.
00108 //
00109 // GetUrlKeys       Extracts data from the query string by calling
00110 // BuildKeyList with GetQueryByte as the extraction
00111 // function.
00112 //
00113 // GetPropAddr      Calculates the address of the list's properties,
00114 // appended to the first key in a list.
00115 //
00116 // The typedef for the linked list is kept privately in this file,
00117 // and our interface isolates other source files from the
00118 // implementation details.
00119 //
00120
00121 // Constants for this source file only
00122
00123 #define MAX_KEY_NAME_LENGTH 256 // maximum size of an inbound key name
00124 #define CONTENT_BUF_LENGTH 8192 // amount of content buffered before
00125                                 // WriteFile call
00126                                 // ( used for temporary files only )
00127 #define GNB_NOTHING_LEFT 0      // GetNextByte return values
00128 #define GNB_DECODED_CHAR 1
00129 #define GNB_NORMAL_CHAR 2
00130
00131 // POSDATA struct is used with GetInboundByte to keep
00132 // track of the position within incoming data.
00133 // GETINBOUNDBYTE is a function pointer type.
00134
00135 typedef struct _tagPOSDATA {
00136
00137     EXTENSION_CONTROL_BLOCK *pECB;
00138
00139     int nCurrentPos;            // overall position
00140
00141     int nBufferLength;          // length of buffer
00142
00143     int nBufferPos;             // position within buffer
00144
00145     int nAllocLength;           // size of buffer as allocated
00146
00147     LPBYTE pData;
00148
00149     int (*GetInboundByte)(struct _tagPOSDATA * p);
00150
00151 } POSDATA, *PPOSDATA;
00152
00153 typedef int (*GETINBOUNDBYTE)(PPOSDATA p);
00154
00155 #ifdef USE_MEMORY
00156
00157   // LISTPROP struct is used to maintain a set of list-wide properties.  This implementation
00158   // uses the properties list to hold a buffer pointer.
00159
00160   typedef struct _tagLISTPROP {
00161     LPBYTE lpbyBuf;
00162   } LISTPROP, *PLISTPROP;
00163
00164 #elif defined USE_TEMPORARY_FILES
00165
00166   // This LISTPROP struct holds temporary file information.
00167
00168   typedef struct _tagLISTPROP {
00169     char szTempFileName[MAX_PATH];
00170     HANDLE hFile;
00171   } LISTPROP, *PLISTPROP;
00172
00173 #endif
00174
00175 // This private helper needs a prototype
00176
00177 PLISTPROP GetPropAddr( HKEYLIST hKey );
00178
00179 //  Description:
00180 //
00181 //    GetPostedByte returns a waiting character that is not
00182 //    decoded yet.  We have this function to smooth out the
00183 //    inbound data: the server gives us blocks of data, one at
00184 //    a time, and there can be any number of blocks.
00185 //
00186 //    For the first call, pPosData->nAllocLength must be zero,
00187 //    and pECB must be set.
00188 //
00189 //  Arguments:
00190 //
00191 //    pPostData - pointer to POSTDATA struct
00192 //
00193 //  Returns:
00194 //
00195 //    incoming byte value or -1 to indicate an error
00196
00197 int GetPostedByte(PPOSDATA pPosData)
00198 {
00199     int nBytesToCopy;
00200
00201     // For readability only...
00202     EXTENSION_CONTROL_BLOCK *pECB;
00203
00204     pECB = pPosData->pECB;
00205
00206     //
00207     // Initialize position struct on first call.
00208     //
00209
00210     if ( !pPosData->nAllocLength ) {
00211         // Initialize the members
00212         pPosData->nCurrentPos = 0;
00213         pPosData->nBufferPos = 0;
00214         pPosData->nBufferLength = 0;
00215         pPosData->nAllocLength = 0x10000;   // 65536 bytes
00216
00217         // Allocate the memory
00218         pPosData->pData = (LPBYTE) HeapAlloc(
00219             GetProcessHeap( ),
00220             HEAP_ZERO_MEMORY,
00221             pPosData->nAllocLength );
00222     }
00223     //
00224     // Was memory allocated?  Is it still allocated?
00225     // If not, return right away.
00226     //
00227
00228     if ( !pPosData->pData ) {
00229         LOG( "GetPostedByte: Buffer not allocated." );
00230         return -1;
00231     }
00232     //
00233     // Check for end.  Deallocate and return if we're done.
00234     //
00235
00236     if ( (DWORD) pPosData->nCurrentPos == pECB->cbTotalBytes ) {
00237
00238         HeapFree( GetProcessHeap( ), 0, (LPVOID) pPosData->pData );
00239         pPosData->pData = 0;
00240
00241         return -1;
00242     }
00243
00244     //
00245     // Check for buffer not loaded.  Load if necessary.
00246     //
00247
00248     if ( pPosData->nBufferPos == pPosData->nBufferLength ) {
00249
00250         //
00251         // Fill the buffer with new inbound data.
00252         // Request it via ReadClient if necessary.
00253         //
00254
00255         if ( pECB->cbAvailable < 1 ) {
00256
00257             // Calculate how much we should go and get
00258             nBytesToCopy = pECB->cbTotalBytes - pPosData->nCurrentPos;
00259             if ( nBytesToCopy > pPosData->nAllocLength ) {
00260                 nBytesToCopy = pPosData->nAllocLength;
00261             }
00262
00263             // Let's go get the data
00264             if ( !pECB->ReadClient(
00265                     pECB->ConnID,
00266                     pPosData->pData,
00267                     (LPDWORD) & nBytesToCopy
00268                     )) {
00269                 HeapFree( GetProcessHeap( ), 0, (LPVOID) pPosData->pData );
00270                 pPosData->pData = 0;
00271
00272                 LOG( "GetPostedByte: Error reading data via ReadClient" );
00273                 return -1;
00274             }
00275         }else{
00276             // Take at most nAllocLength bytes of data
00277             if ( pECB->cbAvailable > (DWORD) (pPosData->nAllocLength) ) {
00278                 nBytesToCopy = pPosData->nAllocLength;
00279             }else{
00280                 nBytesToCopy = pECB->cbAvailable;
00281             }
00282
00283             // Copy the inbound data to our buffer
00284             memcpy(
00285                 pPosData->pData,
00286                 &pECB->lpbData[pPosData->nCurrentPos],
00287                 nBytesToCopy
00288                 );
00289
00290             // Account for removed data
00291             pECB->cbAvailable -= nBytesToCopy;
00292         }
00293
00294         // Our buffer is now full
00295         pPosData->nBufferLength = nBytesToCopy;
00296         pPosData->nBufferPos = 0;
00297
00298         // Make sure we have something
00299         if ( !nBytesToCopy ) {
00300             HeapFree( GetProcessHeap( ), 0, (LPVOID) pPosData->pData );
00301             pPosData->pData = 0;
00302             return -1;
00303         }
00304     }
00305     //
00306     // Inc current pos, buffer pos, and return a character
00307     //
00308
00309     pPosData->nCurrentPos++;
00310     pPosData->nBufferPos++;
00311     return ( (int)pPosData->pData[pPosData->nBufferPos - 1] );
00312 }
00313
00314 //  Description:
00315 //
00316 //    Returns a waiting character that is not
00317 //    decoded yet.  We have this function to match GetPostedData.
00318 //
00319 //    For the first call, pPosData->nAllocLength must be zero,
00320 //    and pECB must be set.
00321 //
00322 //  Arguments:
00323 //
00324 //    pPostData - points to POSDATA structura
00325 //
00326 //  Returns:
00327 //
00328 //    byte value or -1 to indicate an error
00329
00330 int GetQueryByte(IN OUT PPOSDATA pPosData)
00331 {
00332     // For readability only...
00333     EXTENSION_CONTROL_BLOCK *pECB;
00334
00335     pECB = pPosData->pECB;
00336
00337     //
00338     // Initialize position struct on first call.
00339     //
00340
00341     if ( !pPosData->nAllocLength ) {
00342         // Initialize the useful members
00343         pPosData->nBufferPos = 0;
00344         pPosData->nBufferLength = lstrlen( (LPCSTR) pECB->lpszQueryString );
00345         pPosData->nAllocLength = -1;
00346
00347         char szMsg[256];
00348
00349         wsprintf(
00350             szMsg,
00351             "pPosData->nBufferLength=%i",
00352             pPosData->nBufferLength
00353             );
00354         LOG( szMsg );
00355     }
00356
00357     //
00358     // Check for end.  Deallocate and return if we're done.
00359     //
00360
00361     if ( pPosData->nBufferPos == pPosData->nBufferLength ) {
00362         return -1;
00363     }
00364
00365     //
00366     // Inc buffer pos and return a character
00367     //
00368
00369     pPosData->nBufferPos++;
00370     return ( (int)pECB->lpszQueryString[pPosData->nBufferPos - 1] );
00371 }
00372
00373 // Now that we have GetPostedByte, and GetQueryByte, we can
00374 // build a more useful function that decodes URL-style
00375 // encoded characters.
00376 //
00377 // Recall that there are two special cases for this encoding:
00378 //
00379 // 1. Each plus sign must be converted to a space
00380 // 2. A percent sign denotes a hex value-encoded character
00381 //
00382 // Percents are used to specify characters that are otherwise
00383 // illegal.  This includes percents themselves, ampersands,
00384 // control characters, and so on.
00385 //
00386 // GetNextByte returns the decoded byte, plus a flag indicating
00387 // normal character, decoded character, or failure.  See top of
00388 // file for return value constants.
00389
00390 //  Description:
00391 //
00392 //    HexDigitToInt simply converts a hex-based character to an int.
00393 //
00394 //  Arguments:
00395 //
00396 //    tc - character to convert
00397 //
00398 //  Returns:
00399 //
00400 //    binary value of the character (0-15) -1 if the character is not hex digit
00401
00402 int HexDigitToInt(IN char c)
00403 {
00404   if (c >= '0' && c <= '9')
00405     return (c - '0');
00406
00407   if (tolower( c ) >= 'a' && tolower( c ) <= 'f')
00408     return (tolower( c ) - 'a'  + 10);
00409
00410   return -1;
00411 }
00412
00413
00414 int
00415 GetNextByte(
00416     IN OUT PPOSDATA pPosData,
00417     OUT char * pc
00418 )
00419 /*++
00420
00421 Purpose:
00422     Decode single byte of the input data
00423
00424 Arguments:
00425     pPostData - points to POSDATA struct
00426     pc - points to variable to accept decoded byte
00427
00428 Returns:
00429     GNB_NORMAL_CHAR, GNB_NOTHING_LEFT or GNB_DECODED_CHAR
00430
00431 --*/
00432 {
00433     int nChar;
00434     int nDigit;
00435
00436     // Initialize character pointer
00437     *pc = 0;
00438
00439     // Fetch the next inbound character
00440     nChar = pPosData->GetInboundByte( pPosData );
00441     if ( nChar == -1 ) {
00442         return GNB_NOTHING_LEFT;
00443     }
00444
00445     // Plus signs: convert to spaces
00446     if ( nChar == '+' ) {
00447         *pc = ' ';
00448         return GNB_DECODED_CHAR;
00449     }
00450     // Percent signs: convert hex values
00451     else if ( nChar == '%' ) {
00452         nChar = pPosData->GetInboundByte( pPosData );
00453         nDigit = HexDigitToInt( nChar );
00454         if ( nDigit == -1 ) {
00455             return GNB_NOTHING_LEFT;
00456         }
00457
00458         *pc = ( char ) ( ( UINT ) nDigit << 4 );
00459
00460         nChar = pPosData->GetInboundByte( pPosData );
00461         nDigit = HexDigitToInt( nChar );
00462         if ( nDigit == -1 ) {
00463             *pc = 0;            // incomplete
00464
00465             return GNB_NOTHING_LEFT;
00466         }
00467         *pc |= ( char ) ( UINT ) nDigit;
00468
00469         return GNB_DECODED_CHAR;
00470     }
00471     // Must be normal character then
00472     *pc = (char) nChar;
00473
00474     return GNB_NORMAL_CHAR;
00475 }
00476
00477
00478 int
00479 GetFirstByte(
00480     IN OUT PPOSDATA pPosData,
00481     IN EXTENSION_CONTROL_BLOCK * pECB,
00482     OUT char * pc,
00483     IN GETINBOUNDBYTE GetInboundByte
00484 )
00485 /*++
00486
00487 Purpose:
00488
00489     GetFirstByte eliminates the guesswork from initialization.
00490     We call GetFirstByte with an uninitialized POSDATA structure,
00491     and we call GetNextByte from there on.
00492
00493 Arguments:
00494     pPosData - points to POSDATA struct to initialize
00495     pECB - points to the extenstion control block
00496     pc - points to variable to accept decoded byte
00497     GetInboundByte - points to function to get incoming bytes
00498
00499
00500 Returns:
00501     same as GetNextByte()
00502
00503 --*/
00504 {
00505     // Initialize struct
00506     pPosData->nAllocLength = 0;
00507     pPosData->pECB = pECB;
00508     pPosData->GetInboundByte = GetInboundByte;
00509
00510     // Make the call as usual
00511     return GetNextByte( pPosData, pc );
00512 }
00513
00514
00515 //
00516 // Structure used in data processing - the elements of the
00517 // key list.
00518 //
00519
00520 typedef struct _tagPOSTKEY {
00521     int nInstance;              // used when key name is the same as another,
00522                                 // normally 0
00523
00524     DWORD dwOffset;             // offset into content file
00525     DWORD dwLength;             // length of data
00526     BOOL bHasCtrlChars;         // a character value < 32 is in data
00527     struct _tagPOSTKEY *pNext;  // linked list
00528     struct _tagPOSTKEY *pHead;  // first in linked list
00529     LPBYTE lpbyBuf;             // pointer to the key's data in the list
00530                                 // buffer
00531
00532     // key string appended to structure
00533     // for the head key, list properties are appended
00534 } POSTKEY, *PPOSTKEY;
00535
00536
00537
00538 //
00539 // These three helper functions isolate the memory allocation,
00540 // deallocation and abnormal exit code.  They are used only to
00541 // keep BuildKeyList readable.
00542 //
00543
00544
00545 BOOL
00546 BKL_Alloc(
00547     OUT LPSTR * plpszKey,
00548     OUT LPBYTE * plpbyBuf
00549 )
00550 {
00551     // Allocate a buffer for the key name
00552     *plpszKey = (LPSTR) HeapAlloc( GetProcessHeap( ),
00553         HEAP_ZERO_MEMORY,
00554         MAX_KEY_NAME_LENGTH );
00555
00556     if ( !*plpszKey ) {
00557         return FALSE;
00558     }
00559
00560 #ifdef USE_MEMORY
00561     // Init buffer to NULL
00562     *plpbyBuf = NULL;
00563
00564 #elif defined USE_TEMPORARY_FILES
00565
00566     // Allocate a buffer for the content
00567     *plpbyBuf = (LPBYTE) HeapAlloc( GetProcessHeap( ),
00568         HEAP_ZERO_MEMORY,
00569         CONTENT_BUF_LENGTH );
00570
00571     if ( !*plpbyBuf ) {
00572         HeapFree( GetProcessHeap( ), 0, (LPVOID) * plpszKey );
00573         return FALSE;
00574     }
00575 #endif
00576
00577     return TRUE;
00578 }
00579
00580
00581 void
00582 BKL_Dealloc(
00583     IN LPSTR * plpsz,
00584     IN LPBYTE * plpby
00585 )
00586 {
00587     if ( plpsz && *plpsz ) {
00588         HeapFree( GetProcessHeap( ), 0, (LPVOID) * plpsz );
00589     }
00590     if ( plpby && *plpby ) {
00591         HeapFree( GetProcessHeap( ), 0, (LPVOID) * plpby );
00592     }
00593 }
00594
00595 //
00596 // This allows us to clean up... with temporary files we have to close
00597 // and delete them.  Otherwise, we have to free a lot of memory.
00598 //
00599
00600 #ifdef USE_TEMPORARY_FILES
00601 #define MACRO_AbortCleanup BKL_Abort( pHead, hDataFile, \
00602     lpszKeyNameBuf, lpbyContentBuf );\
00603     if ( hDataFile != INVALID_HANDLE_VALUE ) DeleteFile( szTempPath )
00604
00605 #elif defined USE_MEMORY
00606
00607 #define MACRO_AbortCleanup BKL_Abort( pHead, INVALID_HANDLE_VALUE, \
00608     lpszKeyNameBuf,lpbyContentBuf )
00609 #endif
00610
00611
00612 void
00613 BKL_Abort(
00614     IN PPOSTKEY pHead,
00615     IN HANDLE hFile,
00616     IN LPSTR lpszKey,
00617     IN LPBYTE lpbyBuf
00618 )
00619 {
00620     if ( pHead ) {
00621         FreeKeyList( (HKEYLIST) pHead );
00622     }
00623
00624     if ( hFile != INVALID_HANDLE_VALUE ) {
00625         CloseHandle( hFile );
00626     }
00627
00628     BKL_Dealloc( &lpszKey, &lpbyBuf );
00629 }
00630
00631
00632 BOOL
00633 IsKeySeparator(
00634     char c
00635 )
00636 /*++
00637
00638 Purpose:
00639     Identify key separators
00640
00641 Arguments:
00642     c - character
00643
00644 Returns:
00645     TRUE if character is a key separator,
00646     FALSE otherwise
00647
00648 --*/
00649 {
00650     return ( c == '=' || c == '\r' || c == '\n' || c == '&' || !c );
00651 }
00652
00653
00654 PPOSTKEY
00655 BuildKeyList(
00656     IN EXTENSION_CONTROL_BLOCK * pECB,
00657     IN GETINBOUNDBYTE GetInboundByte
00658 )
00659 /*++
00660
00661 Purpose:
00662
00663     Now that we have a way to get a decoded byte from the stream,
00664     we can parse POST data.  POST data comes in as:
00665
00666     key=data&key=data&key=data\r\n
00667
00668     A linked list of keys is established, and the head node
00669     of the list is returned.  A NULL indicates no keys or
00670     an error.
00671
00672
00673 Arguments:
00674     pECB - pointer to the extension control block
00675     GetInboundByte - pointer to function to get input data
00676
00677 Returns:
00678     Pointer to the head node or NULL
00679
00680 --*/
00681 {
00682     PPOSTKEY pHead = NULL;      // head of linked list ( the return val )
00683     PPOSTKEY pTail = NULL;      // last member in linked list
00684     PPOSTKEY pNewPostKey;       // pointer for unlinked, newly allocated
00685                                 // objects
00686
00687     PPOSTKEY pListWalk;         // linked list walking pointer
00688     PLISTPROP pProp;            // pointer to list properties
00689     LPSTR lpszKeyNameBuf;       // pointer to buffer, used in obtaining key
00690                                 // name
00691
00692     int nPos;                   // position within key name buffer
00693     DWORD dwOffset;             // offset from start of content buffer or
00694                                 // file
00695
00696     DWORD dwLength;             // length of key data
00697     char c;                     // general-purpose character
00698     int nReturn;                // general-purpose return code
00699     POSDATA pd;                 // POSDATA struct needed in GetInboundByte
00700     int nContentPos;            // position within content buffer
00701     LPBYTE lpbyContentBuf;      // pointer to buffer
00702     BOOL bHasCtrlChars;         // flag to detect ctrl chars
00703
00704     // Call helper to allocate a buffer
00705     if ( !BKL_Alloc( &lpszKeyNameBuf, &lpbyContentBuf ) ) {
00706         LOG( "BuildKeyList: Memory allocation failure" );
00707         return NULL;
00708     }
00709     nContentPos = dwOffset = 0;
00710
00711
00712 #ifdef USE_MEMORY
00713     //
00714     // Allocate enough memory for all the content.
00715     // For the POST method, the cbTotalBytes gives us the number
00716     // of bytes that are being sent by the browser.  We can
00717     // allocate that much but we'll really only use about 75% of it.
00718     // For the GET method, we need to allocate the size of the
00719     // query string plus 1.
00720     //
00721
00722     lpbyContentBuf = (LPBYTE) HeapAlloc( GetProcessHeap( ),
00723         HEAP_ZERO_MEMORY,
00724         pECB->cbTotalBytes +
00725         lstrlen( pECB->lpszQueryString ) + 1 );
00726
00727     if ( !lpbyContentBuf ) {
00728
00729         LOG( "BuildKeyList: Error allocating content memory" );
00730         BKL_Dealloc( &lpszKeyNameBuf, &lpbyContentBuf );
00731
00732         return NULL;
00733     }
00734 #elif defined USE_TEMPORARY_FILES
00735
00736     //
00737     // When USE_TEMPORARY_FILES is chosen, we create
00738     // a temporary file to store all the inbound data.
00739     // This is done to support huge amounts of inbound
00740     // data, like file uploads.
00741     //
00742
00743     char szTempDir[MAX_PATH];   // directory of temporary files
00744     char szTempPath[MAX_PATH];  // path of content file
00745     HANDLE hDataFile;           // handle to content file
00746     DWORD dwBytesWritten;       // used with WriteFile
00747
00748     // Get a temp file name
00749     GetTempPath( MAX_PATH, szTempDir );
00750     if ( !GetTempFileName( szTempDir, "key", 0, szTempPath ) ) {
00751
00752         LOG( "BuildKeyList: Error creating temporary file" );
00753         BKL_Dealloc( &lpszKeyNameBuf, &lpbyContentBuf );
00754
00755         return NULL;
00756     }
00757     // Create the content file
00758     hDataFile = CreateFile( szTempPath,
00759         GENERIC_READ | GENERIC_WRITE,
00760         0,                      // No sharing mode
00761         NULL,                   // Default security attribs
00762         CREATE_ALWAYS,
00763         FILE_ATTRIBUTE_NORMAL,
00764         NULL                    // No template file
00765         );
00766
00767     // Return if an error occured
00768     if ( hDataFile == INVALID_HANDLE_VALUE ) {
00769         LOG( "BuildKeyList: Error opening temporary file" );
00770         MACRO_AbortCleanup;
00771         return NULL;
00772     }
00773 #endif
00774
00775
00776     //
00777     // 'for' statement detects the start of a valid key name.
00778     //
00779     // To do inside 'for' loop:
00780     // Obtain key name
00781     // Write data to buffer or content file
00782     // Create POSTKEY object
00783     // Update links
00784     //
00785
00786     for ( nReturn = GetFirstByte( &pd, pECB, &c, GetInboundByte );
00787         nReturn != GNB_NOTHING_LEFT;
00788         nReturn = GetNextByte( &pd, &c ) ) {
00789
00790         // If \r or \n, ignore and continue
00791         if ( c == '\r' || c == '\n' ) {
00792             continue;
00793         }
00794
00795         // Get a key name
00796         nPos = 0;
00797         while ( !IsKeySeparator( c ) ) {
00798             if ( nPos < MAX_KEY_NAME_LENGTH ) {
00799                 lpszKeyNameBuf[nPos] = c;
00800                 nPos++;
00801             }
00802             nReturn = GetNextByte( &pd, &c );
00803             if ( nReturn == GNB_NOTHING_LEFT )  { // abrupt end!
00804                 break;
00805             }
00806         }
00807
00808         // If no equals sign or name too long,
00809         // we have a browser formatting error
00810         if ( c != '=' || nPos == MAX_KEY_NAME_LENGTH ) {
00811             LOG( "BuildKeyList: Browser formatting error" );
00812
00813             MACRO_AbortCleanup;
00814             return NULL;
00815         }
00816
00817         // Truncate the name string, reset data info variables
00818         lpszKeyNameBuf[nPos] = 0;
00819         nPos++;
00820         dwLength = 0;
00821         bHasCtrlChars = FALSE;
00822
00823         //
00824         // Move the data to the content buffer or file.
00825         //
00826         for ( nReturn = GetNextByte( &pd, &c );
00827             !IsKeySeparator( c ) || nReturn == GNB_DECODED_CHAR;
00828             nReturn = GetNextByte( &pd, &c ) ) {
00829
00830             lpbyContentBuf[nContentPos] = c;
00831
00832             nContentPos += sizeof ( char );
00833             dwLength++;
00834
00835             // Check for ctrl chars
00836             if ( c < 0x20 ) {
00837                 bHasCtrlChars = TRUE;
00838             }
00839
00840 #ifdef USE_TEMPORARY_FILES
00841             // If we have enough data, write buffer to disk
00842             if ( nContentPos == CONTENT_BUF_LENGTH ) {
00843                 if ( !WriteFile( hDataFile, lpbyContentBuf,
00844                     nContentPos, &dwBytesWritten, NULL ) ) {
00845
00846                     LOG( "BuildKeyList: Error writing to content file" );
00847                     MACRO_AbortCleanup;
00848                     return NULL;
00849                 }
00850                 nContentPos = 0;
00851             }
00852 #endif
00853
00854         } // for( nReturn
00855
00856
00857 #ifdef USE_MEMORY
00858         //
00859         // Put a terminating NULL at the end of the key data.
00860         //
00861
00862         lpbyContentBuf[nContentPos] = 0;
00863         nContentPos++;
00864
00865 #elif defined USE_TEMPORARY_FILES
00866
00867         // Drain buffer
00868         if ( nContentPos ) {
00869             if ( !WriteFile( hDataFile, lpbyContentBuf,
00870                 nContentPos, &dwBytesWritten, NULL ) ) {
00871
00872                 LOG( "BuildKeyList: Error writing to content file" );
00873                 MACRO_AbortCleanup;
00874                 return NULL;
00875             }
00876             nContentPos = 0;
00877         }
00878 #endif
00879
00880
00881         // Allocate a POSTKEY object, allocate extra for first key
00882         if ( pHead ) {
00883             pNewPostKey = (PPOSTKEY) HeapAlloc(
00884                 GetProcessHeap( ),
00885                 HEAP_ZERO_MEMORY,
00886                 sizeof (POSTKEY) + nPos
00887                 );
00888         }else{
00889             pNewPostKey = (PPOSTKEY) HeapAlloc(
00890                 GetProcessHeap( ),
00891                 HEAP_ZERO_MEMORY,
00892                 sizeof (POSTKEY) + nPos +
00893                 sizeof (LISTPROP) );
00894
00895             pProp = (PLISTPROP) ( (LPBYTE)pNewPostKey +
00896                     sizeof (POSTKEY) + nPos );
00897         }
00898
00899         // Check for valid pointer
00900         if ( !pNewPostKey ) {
00901             LOG( "BuildKeyList: POSTKEY memory allocation failure" );
00902             MACRO_AbortCleanup;
00903             return NULL;
00904         }
00905
00906         //
00907         // Set pNewPostKey members
00908         //
00909
00910         // Set nInstance
00911         pNewPostKey->nInstance = 0;
00912         pListWalk = pHead;
00913         while ( pListWalk ) {
00914             // Check for duplicate key names
00915             if ( !lstrcmpi( (LPCSTR) ( &pListWalk[1] ), lpszKeyNameBuf )) {
00916                 pNewPostKey->nInstance++;
00917             }
00918             pListWalk = pListWalk->pNext;
00919         }
00920
00921         // Set dwOffset, dwLength, bHasCtrlChars, lpbyBuf
00922         pNewPostKey->dwOffset = dwOffset;
00923         pNewPostKey->dwLength = dwLength;
00924         pNewPostKey->bHasCtrlChars = bHasCtrlChars;
00925
00926 #ifdef USE_MEMORY
00927         pNewPostKey->lpbyBuf = &lpbyContentBuf[dwOffset];
00928         dwOffset += dwLength + 1;
00929
00930 #elif defined USE_TEMPORARY_FILES
00931
00932         pNewPostKey->lpbyBuf = NULL;
00933         dwOffset += dwLength;
00934 #endif
00935
00936
00937         // Copy key name
00938         lstrcpy( (LPSTR) ( &pNewPostKey[1] ), lpszKeyNameBuf );
00939
00940         // Link
00941         if ( pTail ) {
00942             pTail->pNext = pNewPostKey;
00943         }else{
00944
00945 #ifdef USE_TEMPORARY_FILES
00946             // Copy content file name to list properties
00947             lstrcpy( pProp->szTempFileName, szTempPath );
00948
00949             // Set handle
00950             pProp->hFile = hDataFile;
00951
00952 #elif defined USE_MEMORY
00953
00954             // Set content buffer pointer
00955             pProp->lpbyBuf = lpbyContentBuf;
00956 #endif
00957
00958             // Set head
00959             pHead = pNewPostKey;
00960         }
00961
00962         pNewPostKey->pNext = NULL;
00963         pTail = pNewPostKey;
00964
00965         pNewPostKey->pHead = pHead;     // may point to itself
00966
00967     } // for ( nReturn
00968
00969 #ifdef USE_TEMPORARY_FILES
00970     //
00971     // If content file is empty, close it and delete it
00972     //
00973
00974     if ( !pHead ) {
00975         LOG( "Empty content file is being deleted." );
00976         CloseHandle( hDataFile );
00977         DeleteFile( szTempPath );
00978     }
00979     // Free work buffer
00980     BKL_Dealloc( &lpszKeyNameBuf, &lpbyContentBuf );
00981
00982 #elif defined USE_MEMORY
00983
00984     // Free work buffer
00985     BKL_Dealloc( &lpszKeyNameBuf, pHead ? NULL : &lpbyContentBuf );
00986 #endif
00987
00988
00989     return pHead;
00990 }
00991
00992
00993 //
00994 // We are now pretty much done with anything complex. BuildKeyList
00995 // will do all our parse work, so now we need a few wrappers to
00996 // make a nice, clean external interface.
00997 //
00998 // GetPostKeys calls BuildKeyList with GetPostedByte.
00999 //
01000 // GetUrlKeys calls BuildKeyList with GetQueryByte.
01001 //
01002
01003 PPOSTKEY
01004 GetPostKeys(
01005     IN EXTENSION_CONTROL_BLOCK * pECB
01006 )
01007 {
01008     return BuildKeyList( pECB, GetPostedByte );
01009 }
01010
01011 PPOSTKEY
01012 GetUrlKeys(
01013     IN EXTENSION_CONTROL_BLOCK * pECB
01014 )
01015 {
01016     return BuildKeyList( pECB, GetQueryByte );
01017 }
01018
01019
01020 PLISTPROP
01021 GetPropAddr(
01022     IN HKEYLIST hKey
01023 )
01024 /*++
01025
01026 Purpose:
01027
01028     GetPropAddr returns the address of the end of
01029     the first key.  We stuff list properties there.
01030     This implementation of keys.cpp keeps a pointer
01031     to the content buffer.  The second version ( used
01032     in IS2WCGI ) appends a temporary file name
01033     to the first key.
01034
01035 Arguments:
01036     hKey - pointer to a key list
01037
01038 Returns:
01039     The address of the end of the first key
01040
01041 --*/
01042 {
01043     LPCSTR lpszKeyName;
01044     PPOSTKEY pHead;
01045
01046     // Safety
01047     if ( !hKey ) {
01048         return NULL;
01049     }
01050
01051     // ContentPath follows POSTKEY struct and key name
01052     pHead = (PPOSTKEY) hKey;
01053     pHead = pHead->pHead;
01054
01055     lpszKeyName = (LPCSTR) ( &pHead[1] );
01056
01057     return (PLISTPROP) ( lpszKeyName + lstrlen( lpszKeyName ) + 1 );
01058 }
01059
01060
01061 HKEYLIST
01062 GetKeyList(
01063     IN EXTENSION_CONTROL_BLOCK * pECB
01064 )
01065 /*++
01066
01067 Purpose:
01068
01069     Examines the method and calls GetPostKeys or GetUrlKeys,
01070     whichever is relevant.
01071
01072
01073 Arguments:
01074     pECB - points to the extension control block
01075
01076 Returns:
01077     GetPropAddr returns the address of the end of
01078     the first key.  We stuff list properties there.
01079     This implementation of keys.cpp keeps a pointer
01080     to the content buffer.  The second version ( used
01081     in IS2WCGI ) appends a temporary file name
01082     to the first key.
01083
01084 --*/
01085 {
01086     if ( !lstrcmpi( pECB->lpszMethod, "POST" ) ) {
01087         LOG( "Method=POST" );
01088         return (HKEYLIST) GetPostKeys( pECB );
01089     }else if ( !lstrcmpi( pECB->lpszMethod, "GET" ) ) {
01090         LOG( "Method=GET" );
01091         return (HKEYLIST) GetUrlKeys( pECB );
01092     }
01093     LOG( "Unknown method" );
01094
01095     return NULL;
01096 }
01097
01098
01099 HKEYLIST
01100 GetKeyInfo(
01101     IN HKEYLIST hKey,
01102     OUT LPCSTR * plpszKeyName,
01103     OUT LPDWORD pdwLength,
01104     OUT BOOL * pbHasCtrlChars,
01105     OUT LPINT pnInstance
01106 )
01107 //
01108 // GetKeyInfo is a wrapper for the POSTKEY linked list.
01109 // It returns the members of the supplied POSTKEY object.
01110 //
01111 {
01112     PPOSTKEY pPostKey;
01113
01114     // Safety
01115     if ( !hKey ) {
01116         return NULL;
01117     }
01118
01119     pPostKey = (PPOSTKEY) hKey;
01120
01121     // Set the data members
01122     if ( plpszKeyName )
01123         *plpszKeyName = ( LPCSTR ) ( &pPostKey[1] );
01124     if ( pdwLength )
01125         *pdwLength = pPostKey->dwLength;
01126     if ( pbHasCtrlChars )
01127         *pbHasCtrlChars = pPostKey->bHasCtrlChars;
01128     if ( pnInstance )
01129         *pnInstance = pPostKey->nInstance;
01130
01131     // Return a handle to the next object in the list
01132     return ( ( HKEYLIST ) pPostKey->pNext );
01133 }
01134
01135
01136
01137 #ifdef USE_MEMORY
01138 LPBYTE
01139 GetKeyBuffer(
01140     IN HKEYLIST hKey
01141 )
01142 {
01143     //
01144     // We have two versions of this function because
01145     // we may want to use file i/o when the extension
01146     // deals with massive amounts of inbound data
01147     // ( like multi-megabyte uploads ).
01148     //
01149
01150     //
01151     // This version uses a memory buffer.
01152     //
01153
01154     PPOSTKEY pKey;
01155
01156     // Safety
01157     if ( !hKey ) {
01158         return NULL;
01159     }
01160
01161     pKey = (PPOSTKEY) hKey;
01162
01163     return (LPBYTE) pKey->lpbyBuf;
01164 }
01165
01166 #elif defined USE_TEMPORARY_FILES
01167
01168 LPBYTE
01169 GetKeyBuffer(
01170     IN HKEYLIST hKey
01171 )
01172 {
01173     //
01174     // This version uses slow temporary files.
01175     //
01176
01177     PLISTPROP pProp;
01178     PPOSTKEY pKey;
01179     DWORD dwRead;
01180
01181     // Get pointer to list properties
01182     pProp = GetPropAddr( hKey );
01183
01184     // Safety
01185     if ( !pProp ) {
01186         return NULL;
01187     }
01188
01189     pKey = (PPOSTKEY) hKey;
01190
01191     // Check if memory was already loaded for this key
01192     if ( pKey->lpbyBuf ) {
01193         return pKey->lpbyBuf;
01194     }
01195
01196     // If not, let's allocate memory and do a ReadFile
01197     pKey->lpbyBuf = (LPBYTE) HeapAlloc( GetProcessHeap( ),
01198         HEAP_ZERO_MEMORY,
01199         pKey->dwLength + 1 );
01200     if ( !pKey->lpbyBuf ) {
01201         LOG( "GetKeyBuffer: HeapAlloc failed" );
01202         return NULL;
01203     }
01204     // Do the ReadFile
01205     SetFilePointer( pProp->hFile, pKey->dwOffset, NULL, FILE_BEGIN );
01206     if ( !ReadFile( pProp->hFile, pKey->lpbyBuf,
01207             pKey->dwLength, &dwRead, NULL ) ||
01208         dwRead != pKey->dwLength ) {
01209         HeapFree( GetProcessHeap( ), 0, (LPVOID) pKey->lpbyBuf );
01210         pKey->lpbyBuf = NULL;
01211
01212         LOG( "GetKeyBuffer: ReadFile failed" );
01213         return NULL;
01214     }
01215     return pKey->lpbyBuf;
01216 }
01217 #endif
01218
01219
01220 HKEYLIST
01221 FindKey(
01222     IN HKEYLIST hKeyList,
01223     IN LPCSTR lpszSearchName
01224 )
01225 /*++
01226
01227 Purpose:
01228
01229     FindKey sequentially searches the linked list for a given key.
01230
01231 Arguments:
01232
01233     hKeyList - points to key list
01234     lpszSearchName - points to a key name to find
01235
01236 Returns:
01237
01238     The return handle points to the element within the linked list.
01239     Use it in GetKeyInfo, but not FreeKeyList.
01240
01241 --*/
01242 {
01243     PPOSTKEY pFindKey;
01244
01245     pFindKey = (PPOSTKEY) hKeyList;
01246     while ( pFindKey ) {
01247         if ( !lstrcmpi( lpszSearchName, ( LPCSTR ) ( &pFindKey[1] ) ) ) {
01248             return ( ( HKEYLIST ) pFindKey );
01249         }
01250
01251         pFindKey = pFindKey->pNext;
01252     }
01253
01254     return NULL;
01255 }
01256
01257
01258 void
01259 FreeKeyList(
01260     IN HKEYLIST hHeadKey
01261 )
01262 /*++
01263
01264 Purpose:
01265
01266     FreeKeyList deallocates all the objects in the key list.
01267     The content file is also deleted.
01268
01269 Arguments:
01270     hHeadKey - points to the list head
01271
01272 --*/
01273 {
01274     PPOSTKEY pObject;
01275     PPOSTKEY pDel;
01276     PLISTPROP pProp;
01277
01278     // Safety
01279     if ( !hHeadKey ) {
01280         return;
01281     }
01282
01283 #ifdef USE_TEMPORARY_FILES
01284     // Close the content file
01285     CloseContentFile( hHeadKey );
01286
01287     // delete the content file
01288     pProp = GetPropAddr( hHeadKey );
01289     DeleteFile( pProp->szTempFileName );
01290
01291 #elif defined USE_MEMORY
01292
01293     // delete content
01294     pProp = GetPropAddr( hHeadKey );
01295     HeapFree( GetProcessHeap( ), 0, (LPVOID) pProp->lpbyBuf );
01296 #endif
01297
01298     // delete all objects in the list
01299     pObject = (PPOSTKEY) hHeadKey;
01300     pObject = pObject->pHead;
01301     while ( pObject ) {
01302
01303 #ifdef USE_TEMPORARY_FILES
01304         //
01305         // Free each buffer when using temporary files
01306         //
01307
01308         if ( pObject->lpbyBuf )
01309             HeapFree( GetProcessHeap( ), 0, (LPVOID) pObject->lpbyBuf );
01310 #endif
01311
01312         pDel = pObject;
01313         pObject = pObject->pNext;
01314
01315         HeapFree( GetProcessHeap( ), 0, (LPVOID) pDel );
01316     }
01317 }
01318
01319
01320 DWORD
01321 GetKeyOffset(
01322     IN HKEYLIST hKey
01323 )
01324 /*++
01325
01326 Purpose:
01327
01328     GetKeyOffset returns the offset of a key into the internal
01329     buffer or temporary file.  This is provided for IS2WCGI
01330     so it can return an offset within the content file.
01331
01332 Arguments:
01333
01334     hKey - points to a key
01335
01336 Returns:
01337
01338     Offset of a key or NULL if no key provided
01339
01340 --*/
01341 {
01342     // Safety
01343     if ( !hKey )
01344         return NULL;
01345
01346     return ( (PPOSTKEY) hKey )->dwOffset;
01347 }
01348
01349
01350 #ifdef USE_TEMPORARY_FILES
01351
01352 LPCSTR
01353 GetContentFile(
01354     IN HKEYLIST hKeyList
01355 )
01356 /*++
01357
01358 Purpose:
01359
01360     GetContentFile returns a pointer to the name of the
01361     temporary file.  This is provided for the IS2WCGI
01362     sample.
01363
01364 Arguments:
01365
01366
01367 Returns:
01368
01369 --*/
01370 {
01371     PLISTPROP pProp;
01372
01373     // safety
01374     if ( !hKeyList )
01375         return NULL;
01376
01377     pProp = GetPropAddr( hKeyList );
01378
01379     return ( LPCSTR ) pProp->szTempFileName;
01380 }
01381
01382
01383 void
01384 CloseContentFile(
01385     IN HKEYLIST hKey
01386 )
01387 /*++
01388
01389 Purpose:
01390
01391     CloseContentFile forces the content file to be closed.  This
01392     allows you to pass the file to something else that may open
01393     it.  Call OpenContentFile before calling any other key
01394     function.
01395
01396 Arguments:
01397
01398 --*/
01399 {
01400     PLISTPROP pProp;
01401
01402     if ( !hKey )
01403         return;
01404
01405     pProp = GetPropAddr( hKey );
01406     if ( pProp->hFile != INVALID_HANDLE_VALUE ) {
01407         CloseHandle( pProp->hFile );
01408         pProp->hFile = INVALID_HANDLE_VALUE;
01409     }
01410 }
01411
01412
01413 void
01414 OpenContentFile(
01415     IN HKEYLIST hKey
01416 )
01417 /*++
01418
01419 Purpose:
01420
01421     OpenContentFile forces the content file to be reopened.
01422     GetKeyBuffer will fail if the content file was closed by
01423     CloseContentFile, but not reopened.
01424
01425 Arguments:
01426
01427
01428 Returns:
01429
01430 --*/
01431 {
01432     PLISTPROP pProp;
01433
01434     if ( !hKey )
01435         return;
01436
01437     pProp = GetPropAddr( hKey );
01438
01439     if ( pProp->hFile != INVALID_HANDLE_VALUE )
01440         return;
01441
01442     // Create the content file
01443     pProp->hFile = CreateFile( pProp->szTempFileName,
01444         GENERIC_READ | GENERIC_WRITE,
01445         0,                      // No sharing mode
01446          NULL,                  // Default security attribs
01447          OPEN_EXISTING,
01448         FILE_ATTRIBUTE_NORMAL,
01449         NULL );
01450 }
01451
01452 #elif defined USE_MEMORY
01453
01454
01455 LPBYTE
01456 GetDataBuffer(
01457     IN HKEYLIST hKeyList
01458 )
01459 /*++
01460
01461 Purpose:
01462
01463     GetBufferPointer returns a pointer to the buffer used
01464     for content storage.
01465
01466 Arguments:
01467
01468     hKeyList - points to a key list
01469
01470 Returns:
01471
01472     pointer to the content buffer or NULL
01473
01474 --*/
01475 {
01476     PLISTPROP pProp;
01477
01478     // safety
01479     if ( !hKeyList )
01480         return NULL;
01481
01482     pProp = GetPropAddr( hKeyList );
01483
01484     return pProp->lpbyBuf;
01485 }
01486 #endif
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMyPersistStreamImpl< T > Member List

This is the complete list of members for IMyPersistStreamImpl< T >, including all inherited members.
GetClassID(CLSID *pClassID) | IMyPersistStreamImpl< T > | [inline]
GetSizeMax(ULARGE_INTEGER FAR *pcbSize) | IMyPersistStreamImpl< T > | [inline]
IsDirty() | IMyPersistStreamImpl< T > | [inline]
Load(LPSTREAM pStm) | IMyPersistStreamImpl< T > | [inline]
QueryInterface(REFIID riid, void **ppvObject)=0 | IMyPersistStreamImpl< T > | [pure virtual]
Save(LPSTREAM pStm, BOOL fClearDirty) | IMyPersistStreamImpl< T > | [inline]
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::CursorLocationEnum Member List

This is the complete list of members for msado15::CursorLocationEnum, including all inherited members.
adUseClient | msado15::CursorLocationEnum | [static]
adUseClientBatch | msado15::CursorLocationEnum | [static]
adUseNone | msado15::CursorLocationEnum | [static]
adUseServer | msado15::CursorLocationEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/about.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

about.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Implementation of ISnapinAbout
00014 //
00015
00016
00017 #include "Globals.h"
00018 #include "About.h"
00019 #include "Resource.h"
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 //  Construction/Destruction
00023
00024 //---------------------------------------------------------------------------
00025 CSnapinAbout::CSnapinAbout()
00026 {
00027   m_cRef = 0;
00028   InterlockedIncrement((long*)&g_uObjectCount);
00029
00030   m_hSmallImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00031   m_hLargeImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_32), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00032
00033   // This image is displayed when the static node is selected
00034   m_hOpenImage  = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00035
00036   m_hAppIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_APP_ICON));
00037 }
00038
00039 CSnapinAbout::~CSnapinAbout()
00040 {
00041   SAFE_FREE_BITMAP( m_hSmallImage );
00042   SAFE_FREE_BITMAP( m_hLargeImage );
00043   SAFE_FREE_BITMAP( m_hOpenImage  );
00044   SAFE_FREE_ICON( m_hAppIcon );
00045
00046   InterlockedDecrement((long*)&g_uObjectCount);
00047 }
00048
00049 /////////////////////////////////////////////////////////////////////////////
00050 // IUnknown implementation
00051
00052 //---------------------------------------------------------------------------
00053 STDMETHODIMP CSnapinAbout::QueryInterface
00054 (
00055   REFIID   riid,       //[in] Identifier of the requested interface
00056   LPVOID   *ppv        //[out] Address of requested interface
00057 )
00058 {
00059   if( !ppv )
00060     return E_FAIL;
00061
00062   *ppv = NULL;
00063
00064   if( IsEqualIID(riid, IID_IUnknown) )
00065     *ppv = static_cast<ISnapinAbout*>(this);
00066   else if( IsEqualIID(riid, IID_ISnapinAbout) )
00067     *ppv = static_cast<ISnapinAbout*>(this);
00068
00069   if( *ppv )
00070   {
00071     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00072     return S_OK;
00073   }
00074
00075   return E_NOINTERFACE;
00076 }
00077
00078 //---------------------------------------------------------------------------
00079 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00080 {
00081   return InterlockedIncrement((long*)&m_cRef);
00082 }
00083
00084 //---------------------------------------------------------------------------
00085 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00086 {
00087   if( 0 == InterlockedDecrement((long*)&m_cRef) )
00088   {
00089     // we need to decrement our object count in the DLL
00090     delete this;
00091     return 0;
00092   }
00093   return m_cRef;
00094 }
00095
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // Interface ISnapinAbout
00099
00100 //---------------------------------------------------------------------------
00101 STDMETHODIMP CSnapinAbout::GetSnapinDescription
00102 (
00103   LPOLESTR* pszDescription   //[out] Pointer to the description text
00104 )
00105 {
00106   LONG nLen = wcslen( gwszABOUT_DESCRIPTION ) + 1;
00107   *pszDescription = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00108   if( NULL == *pszDescription )
00109     return E_OUTOFMEMORY;
00110
00111   wcscpy( *pszDescription, gwszABOUT_DESCRIPTION );
00112   return S_OK;
00113 }
00114
00115 //---------------------------------------------------------------------------
00116 STDMETHODIMP CSnapinAbout::GetProvider
00117 (
00118   LPOLESTR* pszProvider      //[out] Pointer to provider text
00119 )
00120 {
00121   LONG nLen = wcslen( gwszABOUT_PROVIDER ) + 1;
00122   *pszProvider = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00123   if( NULL == *pszProvider )
00124     return E_OUTOFMEMORY;
00125
00126   wcscpy( *pszProvider, gwszABOUT_PROVIDER );
00127   return S_OK;
00128 }
00129
00130 //---------------------------------------------------------------------------
00131 STDMETHODIMP CSnapinAbout::GetSnapinVersion
00132 (
00133   LPOLESTR*  pszVersion      //[out] Pointer to version text
00134 )
00135 {
00136   LONG nLen = wcslen( gwszABOUT_VERSION ) + 1;
00137   *pszVersion = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00138   if( NULL == *pszVersion )
00139     return E_OUTOFMEMORY;
00140
00141   wcscpy( *pszVersion, gwszABOUT_VERSION );
00142   return S_OK;
00143 }
00144
00145 //---------------------------------------------------------------------------
00146 STDMETHODIMP CSnapinAbout::GetSnapinImage
00147 (
00148   HICON *hAppIcon            //[out] Pointer to the Snap-in's main icon
00149 )
00150 {
00151   *hAppIcon = m_hAppIcon;
00152   HRESULT hResult = S_FALSE;
00153   (NULL == *hAppIcon ) ? hResult = E_FAIL : hResult = S_OK;
00154
00155   return hResult;
00156 }
00157
00158 //---------------------------------------------------------------------------
00159 STDMETHODIMP CSnapinAbout::GetStaticFolderImage
00160 (
00161   HBITMAP*   hSmallImage,      //[out] Pointer to small image
00162   HBITMAP*   hOpenImage,       //[out] Pointer to open folder image
00163   HBITMAP*   hLargeImage,      //[out] Pointer to large image
00164   COLORREF*  cMask             //[out] Pointer to image color mask
00165 )
00166 {
00167   *hSmallImage = m_hSmallImage;
00168   *hLargeImage = m_hLargeImage;
00169   *hOpenImage  = m_hOpenImage;
00170   *cMask       = RGB(0, 255, 0);
00171
00172   if( NULL == *hSmallImage || NULL == *hLargeImage || NULL == *hOpenImage )
00173     return E_FAIL;
00174
00175   return S_OK;
00176 }
00177
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CContextSamplePropPage Member List

This is the complete list of members for CContextSamplePropPage, including all inherited members.
Apply(void) | CContextSamplePropPage | [private]
CContextSamplePropPage() | CContextSamplePropPage |
Connect(void) | CContextSamplePropPage | [private]
GetPluginSetting() | CContextSamplePropPage | [private]
IDD enum value | CContextSamplePropPage |
m_bstrOrigOutputPath | CContextSamplePropPage | [private]
m_bstrOutputPath | CContextSamplePropPage | [private]
m_fInitializing | CContextSamplePropPage | [private]
m_pPluginAdmin | CContextSamplePropPage | [private]
m_wmsContextTypes | CContextSamplePropPage | [private]
m_wmsOrigContextTypes | CContextSamplePropPage | [private]
MessageBox(UINT id) | CContextSamplePropPage | [private]
OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CContextSamplePropPage | [private]
PopulateControls() | CContextSamplePropPage | [private]
RetrieveDialogInformation() | CContextSamplePropPage | [private]
SetDirtyFlag(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CContextSamplePropPage | [inline, private]
Generated on Wed Nov 13 2024 16:55:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/resource.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by rtcsample.rc
00004 //
00005 #define IDD_DIALOG_LOGON                101
00006 #define IDD_DIALOG_WATCHER              102
00007 #define IDR_MENU1                       103
00008 #define IDR_MENU_APP                    103
00009 #define IDD_DIALOG_ADDRESS_NAME         104
00010 #define IDD_DIALOG_ADDRESS              105
00011 #define IDR_MENU_IM                     105
00012 #define IDR_MENU_AV                     106
00013 #define IDD_DIALOG_SESSION              106
00014 #define IDR_MENU_BUDDY                  107
00015 #define IDD_DIALOG_AUTH                 107
00016 #define IDC_EDIT_LOGON_USERURI          1000
00017 #define IDC_COMBO_LOGON_TRANSPORT       1001
00018 #define IDC_EDIT_LOGON_SERVER           1002
00019 #define IDC_BUTTON_WATCHER_ALLOW        1002
00020 #define IDC_BUTTON_WATCHER_BLOCK        1003
00021 #define IDC_CHECK_WATCHER_ADD_BUDDY     1004
00022 #define IDC_STATIC_WATCHER_URI          1005
00023 #define IDC_STATIC_WATCHER_NAME         1006
00024 #define IDC_EDIT_ADDRESS_URI            1006
00025 #define IDC_EDIT_ADDRESS_NAME           1007
00026 #define IDC_STATIC_SESSION_NAME         1008
00027 #define IDC_STATIC_SESSION_URI          1009
00028 #define IDC_BUTTON_SESSION_ACCEPT       1010
00029 #define IDC_BUTTON_SESSION_REJECT       1011
00030 #define IDC_EDIT_AUTH_ACCOUNT           1012
00031 #define IDC_EDIT_AUTH_USERURI           1013
00032 #define IDC_EDIT_AUTH_PASSWORD          1014
00033 #define IDC_STATUSBAR                   2000
00034 #define IDC_BUDDYLIST                   2001
00035 #define IDC_IM_DISPLAY                  2002
00036 #define IDC_IM_EDIT                     2003
00037 #define IDC_IM_SEND                     2004
00038 #define IDC_MIC_VOL                     2005
00039 #define IDC_MIC_MUTE                    2006
00040 #define IDC_SPK_VOL                     2007
00041 #define IDC_SPK_MUTE                    2008
00042 #define ID_FILE_LOGON                   40001
00043 #define ID_FILE_LOGOFF                  40002
00044 #define ID_FILE_EXIT                    40003
00045 #define ID_ACTION_ADDBUDDY              40004
00046 #define ID_ACTION_CALL                  40005
00047 #define ID_ACTION_MESSAGE               40006
00048 #define ID_TOOLS_TUNINGWIZARD           40007
00049 #define ID_BUDDY_CALL                   40008
00050 #define ID_BUDDY_MESSAGE                40009
00051 #define ID_BUDDY_REMOVE                 40010
00052 #define ID_FILE_PRESENCESTATUS_OFFLINE  40011
00053 #define ID_FILE_PRESENCESTATUS_ONLINE   40012
00054 #define ID_FILE_PRESENCESTATUS_AWAY     40013
00055 #define ID_FILE_PRESENCESTATUS_IDLE     40014
00056 #define ID_FILE_PRESENCESTATUS_BUSY     40015
00057 #define ID_FILE_PRESENCESTATUS_BERIGHTBACK 40016
00058 #define ID_FILE_PRESENCESTATUS_ONTHEPHONE 40017
00059 #define ID_FILE_PRESENCESTATUS_OUTTOLUNCH 40018
00060
00061
00062 // Next default values for new objects
00063 //
00064 #ifdef APSTUDIO_INVOKED
00065 #ifndef APSTUDIO_READONLY_SYMBOLS
00066 #define _APS_NEXT_RESOURCE_VALUE        108
00067 #define _APS_NEXT_COMMAND_VALUE         40020
00068 #define _APS_NEXT_CONTROL_VALUE         1014
00069 #define _APS_NEXT_SYMED_VALUE           101
00070 #endif
00071 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/sky.h Source File

  • SysMgmt
  • MMC
  • Complete

sky.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SKY_H
00021 #define _SKY_H
00022
00023 #include "DeleBase.h"
00024
00025 class CSkyBasedVehicle : public CDelegationBase {
00026 public:
00027     CSkyBasedVehicle() { }
00028
00029     virtual ~CSkyBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Sky-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_SKYICON; }
00034
00035     virtual void SetScopeItemValue(HSCOPEITEM hscopeitem) { m_hParentHScopeItem = hscopeitem; }
00036     virtual HSCOPEITEM GetParentScopeItem() { return m_hParentHScopeItem; }
00037
00038 private:
00039     enum { IDM_NEW_SKY = 3 };
00040
00041     HSCOPEITEM m_hParentHScopeItem;
00042
00043     // {B17867B9-6BE7-11d3-9156-00C04F65B3F9}
00044     static const GUID thisGuid;
00045 };
00046
00047
00048 #endif // _SKY_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/msiloc/msiloc.cpp Source File

  • SysMgmt
  • Msi
  • msiloc

msiloc.cpp

Go to the documentation of this file.
00001 #if 0  // makefile definitions
00002 DESCRIPTION = MSI Localization tool
00003 MODULENAME = msiloc
00004 SUBSYSTEM = console
00005 FILEVERSION = MSI
00006 LINKLIBS = OLE32.lib
00007 !include "..\TOOLS\MsiTool.mak"
00008 !if 0  #nmake skips the rest of this file
00009 #endif // end of makefile definitions
00010
00011 //+--------------------------------------------------------------------------------------------------+\\
00012 //                                                                                                    \\
00013 //  Microsoft Windows                                                                                 \\
00014 //                                                                                                    \\
00015 //  Copyright (C) Microsoft Corporation. All rights reserved.                                         \\
00016 //                                                                                                    \\
00017 //  File:       msiloc.cpp                                                                            \\
00018 //                                                                                                    \\
00019 //----------------------------------------------------------------------------------------------------\\
00020
00021 //-----------------------------------------------------------------------------------------
00022 //
00023 // BUILD Instructions
00024 //
00025 // notes:
00026 //  - SDK represents the full path to the install location of the
00027 //     Windows Installer SDK
00028 //
00029 // Using NMake:
00030 //    %vcbin%\nmake -f msiloc.cpp include="%include;SDK\Include" lib="%lib%;SDK\Lib"
00031 //
00032 // Using MsDev:
00033 //    1. Create a new Win32 Console Application project
00034 //      2. Add msiloc.cpp to the project
00035 //      3. Add SDK\Include and SDK\Lib directories on the Tools\Options Directories tab
00036 //      4. Add msi.lib to the library list in the Project Settings dialog
00037 //          (in addition to the standard libs included by MsDev)
00038 //
00039 //------------------------------------------------------------------------------------------
00040
00041 // Required headers
00042 #define WINDOWS_LEAN_AND_MEAN  // faster compile
00043 #include <windows.h>
00044
00045 #ifndef RC_INVOKED    // start of source code
00046
00047 ///////////////////////////////////////////////////////////////////////////////
00048 // HEADERS
00049 #include "msiquery.h"
00050 #include "msidefs.h"
00051 #include <stdio.h>   // wprintf
00052 #include <stdlib.h>  // strtoul
00053 #include <tchar.h>   // define UNICODE=1 on nmake command line to build UNICODE
00054 #include <assert.h>  // assert
00055 #include "strsafe.h"
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // CONSTANT STRINGS
00059 /*headers for resource file*/
00060 const TCHAR szWndwHdrFile[]      = TEXT("#include <windows.h>");
00061 const TCHAR szCommCtrlHdrFile[]  = TEXT("#include <commctrl.h>");
00062 /*tabs and carriage returns*/
00063 const TCHAR szCRLF[]             = TEXT("\r\n");
00064 const TCHAR szCommaTab[]         = TEXT(",\t");
00065 const TCHAR szTab[]              = TEXT("\t");
00066 const TCHAR szCurlyBeg[]         = TEXT("{");
00067 const TCHAR szCurlyEnd[]         = TEXT("}");
00068 const TCHAR szQuotes[]           = TEXT("\"");
00069 /*resource types or keywords WINDOWS*/
00070 const TCHAR resDialog[]          = TEXT("DIALOGEX");
00071 const TCHAR resPushButton[]      = TEXT("PUSHBUTTON");
00072 const TCHAR resCheckBox[]        = TEXT("CHECKBOX");
00073 const TCHAR resGroupBox[]        = TEXT("GROUPBOX");
00074 const TCHAR resRadioButton[]     = TEXT("RADIOBUTTON");
00075 const TCHAR resControl[]         = TEXT("CONTROL");
00076 const TCHAR resBitmap[]          = TEXT("BITMAP");
00077 const TCHAR resIcon[]            = TEXT("ICON");
00078 const TCHAR resJPEG[]            = TEXT("JPEG");
00079 const TCHAR resStringTable[]     = TEXT("STRINGTABLE");
00080 const TCHAR tokCaption[]         = TEXT("CAPTION");
00081 const TCHAR resSelTreeClass[]   = TEXT("WC_TREEVIEW");
00082 const TCHAR resButtonClass[]    = TEXT("BUTTON");
00083 const TCHAR resProgBar32Class[] = TEXT("PROGRESS_CLASS");
00084 const TCHAR resListViewClass[]  = TEXT("WC_LISTVIEW");
00085 const TCHAR resStaticClass[]    = TEXT("STATIC");
00086 const TCHAR resComboBoxClass[]  = TEXT("COMBOBOX");
00087 const TCHAR resEditClass[]      = TEXT("EDIT");
00088 const TCHAR resListBoxClass[]   = TEXT("LISTBOX");
00089 const TCHAR resRichEditClass[]  = TEXT("STATIC"); // TEXT("RICHEDIT") not working;
00090 /*control types INSTALLER*/
00091 const TCHAR* szMsiPushbutton =      TEXT("PushButton");
00092 const TCHAR* szMsiBillboard  =      TEXT("Billboard");
00093 const TCHAR* szMsiVolumeCostList =  TEXT("VolumeCostList");
00094 const TCHAR* szMsiScrollableText =  TEXT("ScrollableText");
00095 const TCHAR* szMsiMaskedEdit =      TEXT("MaskedEdit");
00096 const TCHAR* szMsiCheckBox =        TEXT("CheckBox");
00097 const TCHAR* szMsiGroupBox =        TEXT("GroupBox");
00098 const TCHAR* szMsiText =            TEXT("Text");
00099 const TCHAR* szMsiListBox =         TEXT("ListBox");
00100 const TCHAR* szMsiEdit =            TEXT("Edit");
00101 const TCHAR* szMsiPathEdit =        TEXT("PathEdit");
00102 const TCHAR* szMsiProgressBar =     TEXT("ProgressBar");
00103 const TCHAR* szMsiDirList =         TEXT("DirectoryList");
00104 const TCHAR* szMsiList =            TEXT("ListView");
00105 const TCHAR* szMsiComboBox =        TEXT("ComboBox");
00106 const TCHAR* szMsiDirCombo =        TEXT("DirectoryCombo");
00107 const TCHAR* szMsiVolSelCombo =     TEXT("VolumeSelectCombo");
00108 const TCHAR* szMsiRadioButtonGroup =TEXT("RadioButtonGroup");
00109 const TCHAR* szMsiRadioButton =     TEXT("RadioButton");
00110 const TCHAR* szMsiBitmap =          TEXT("Bitmap");
00111 const TCHAR* szMsiSelTree =         TEXT("SelectionTree");
00112 const TCHAR* szMsiIcon =            TEXT("Icon");
00113 const TCHAR* szMsiLine =            TEXT("Line");
00114 /*max sizes*/
00115 const int iMaxResStrLen          = 256;
00116 const TCHAR strOverLimit[]       = TEXT("!! STR OVER LIMIT !!");
00117 ////////////////////////////////////////////////////////////////////////
00118 // EXPORT SQL QUERIES
00119 /*particular column of strings from a particular table*/
00120 const TCHAR* sqlStrCol = TEXT("SELECT %s, `%s` FROM `%s`");
00121 const TCHAR sqlCreateStrMap[] = TEXT("CREATE TABLE `_RESStrings` (`Table` CHAR(72) NOT NULL, `Column` CHAR(72) NOT NULL, `Key` CHAR(0), `RCID` SHORT NOT NULL PRIMARY KEY `Table`, `Column`, `Key`)");
00122 const TCHAR* sqlSelMaxStrRcId = TEXT("SELECT `RCID` FROM `_RESStrings` WHERE `Table`='MAX_RESOURCE_ID' AND `Column`='MAX_RESOURCE_ID'");
00123 const TCHAR* sqlStrMark = TEXT("SELECT `Table`,`Column`, `Key`, `RCID` FROM `_RESStrings`");
00124 const TCHAR* sqlInsertStr = TEXT("SELECT `Table`,`Column`,`Key`, `RCID` FROM `_RESStrings`");
00125 const TCHAR* sqlFindStrResId  = TEXT("SELECT `RCID` FROM `_RESStrings` WHERE `Table`='%s' AND `Column`='%s' AND `Key`='%s'");
00126 /*binary table*/
00127 const TCHAR* sqlBinary = TEXT("SELECT `Name`,`Data` FROM `Binary`");
00128 const int ibcName = 1; // these constants must match query above
00129 const int ibcData = 2;
00130 /*dialog table*/
00131 const TCHAR* sqlCreateDlgMap = TEXT("CREATE TABLE `_RESDialogs` (`RCStr` CHAR(72) NOT NULL, `Dialog` CHAR(72) PRIMARY KEY `RCStr`)");
00132 const TCHAR* sqlDlgMap = TEXT("SELECT `RCStr`,`Dialog` FROM `_RESDialogs`");
00133 const TCHAR* sqlDialog = TEXT("SELECT `Dialog`,`HCentering`,`VCentering`,`Width`,`Height`,`Attributes`,`Title` FROM `Dialog`");
00134 const TCHAR* sqlDialogSpecific = TEXT("SELECT `Dialog`,`HCentering`,`VCentering`,`Width`,`Height`,`Attributes`,`Title` FROM `Dialog` WHERE `Dialog`=?");
00135 const int idcName   = 1; // these constants must match query above
00136 const int idcX      = 2;
00137 const int idcY      = 3;
00138 const int idcWd     = 4;
00139 const int idcHt     = 5;
00140 const int idcAttrib = 6;
00141 const int idcTitle  = 7;
00142 /*control table*/
00143 const TCHAR* sqlCreateCtrlMark = TEXT("CREATE TABLE `_RESControls` (`Dialog_` CHAR(72) NOT NULL, `Control_` CHAR(72) NOT NULL, `RCID` INT NOT NULL  PRIMARY KEY `Dialog_`, `Control_`)");
00144 const TCHAR* sqlCtrlMark = TEXT("SELECT `Dialog_`,`Control_`,`RCID` FROM `_RESControls`");
00145 const TCHAR* sqlSelMaxRcId = TEXT("SELECT `RCID` FROM `_RESControls` WHERE `Dialog_`='MAX_RESOURCE_ID' AND `Control_`='MAX_RESOURCE_ID'");
00146 const TCHAR* sqlInsertCtrl = TEXT("SELECT `Dialog_`,`Control_`,`RCID` FROM `_RESControls`");
00147 const TCHAR* sqlFindResId  = TEXT("SELECT `RCID` FROM `_RESControls` WHERE `Dialog_`='%s' AND `Control_`='%s'");
00148 const TCHAR* sqlControl = TEXT("SELECT `Control`,`Type`,`X`,`Y`,`Width`,`Height`,`Attributes`,`Text`,`Property` FROM `Control` WHERE `Dialog_`=?");
00149 const int iccName    = 1; // these constants must match query above
00150 const int iccType    = 2;
00151 const int iccX       = 3;
00152 const int iccY       = 4;
00153 const int iccWd      = 5;
00154 const int iccHt      = 6;
00155 const int iccAttrib  = 7;
00156 const int iccText    = 8;
00157 const int iccProperty= 9;
00158 /*radiobutton table*/
00159 const TCHAR* sqlRadioButton = TEXT("SELECT `Order`, `X`, `Y`, `Width`, `Height`, `Text` FROM `RadioButton` WHERE `Property`=?");
00160 const int irbcOrder = 1; // these constants must match query above
00161 const int irbcX     = 2;
00162 const int irbcY     = 3;
00163 const int irbcWd    = 4;
00164 const int irbcHt    = 5;
00165 const int irbcText  = 6;
00166 ////////////////////////////////////////////////////////////////////////
00167 // IMPORT SQL QUERIES
00168 /*dialog table*/
00169 const TCHAR* sqlDialogImport = TEXT("SELECT `HCentering`,`VCentering`,`Width`,`Height`,`Title` FROM `Dialog` WHERE `Dialog`=?");
00170 const int idiHCentering = 1; // these constants must match query above
00171 const int idiVCentering = 2;
00172 const int idiWidth      = 3;
00173 const int idiHeight     = 4;
00174 const int idiTitle      = 5;
00175 /*control table*/
00176 const TCHAR* sqlControlImport = TEXT("SELECT `X`,`Y`,`Width`,`Height`,`Text` FROM `Control` WHERE `Dialog_`=? AND `Control`=?");
00177 const int iciX          = 1; // these constants must match query above
00178 const int iciY          = 2;
00179 const int iciWidth      = 3;
00180 const int iciHeight     = 4;
00181 const int iciText       = 5;
00182 /*radiobutton table*/
00183 const TCHAR* sqlRadioButtonImport = TEXT("SELECT `Width`, `Height`, `Text` FROM `RadioButton` WHERE `Property`=? AND `Order`=?");
00184 const int irbiWidth     = 1; // these constants must match query above
00185 const int irbiHeight    = 2;
00186 const int irbiText      = 3;
00187 /*string table*/
00188 const TCHAR* sqlStringImport = TEXT("SELECT `%s` FROM `%s` WHERE ");
00189 const TCHAR* sqlStrTemp      = TEXT("SELECT * FROM `%s`");
00190 /*find Installer name*/
00191 const TCHAR sqlDialogInstallerName[] = TEXT("SELECT `Dialog` FROM `_RESDialogs` WHERE `RCStr`=?");
00192 const TCHAR sqlControlInstallerName[] = TEXT("SELECT `Dialog_`,`Control_` FROM `_RESControls` WHERE `RCID`=?");
00193 const TCHAR sqlStringInstallerName[] = TEXT("SELECT `Table`,`Column`,`Key` FROM `_RESStrings` WHERE `RCID`=? AND `Table`<>'MAX_RESOURCE_ID'");
00194 //////////////////////////////////////////////////////////////////////////
00195 // MISCELLANEOUS - CODEPAGE, etc.
00196 const TCHAR szTokenSeps[] = TEXT(":");
00197 const TCHAR* szCodepageFile = TEXT("codepage.idt");
00198 const TCHAR* szForceCodepage = TEXT("_ForceCodepage");
00199 const TCHAR* szLineFeed = TEXT("\r\n\r\n");
00200 const TCHAR* szCodepageExport = TEXT("_ForceCodepage.idt");
00201 //////////////////////////////////////////////////////////////////////////
00202 // COMMAND LINE PARSING
00203 /*mode*/
00204 const int iEXPORT_MSI     = 1 << 0;
00205 const int iIMPORT_RES     = 1 << 1;
00206 /*data type*/
00207 const int iDIALOGS = 1 << 2;
00208 const int iSTRINGS = 1 << 3;
00209 /*extra options*/
00210 const int iSKIP_BINARY = 1 << 4;
00211 const int iCREATE_NEW_DB = 1 << 5;
00212 /*max values*/
00213 const int MAX_DIALOGS = 32;
00214 const int MAX_STRINGS = 32;
00215 ////////////////////////////////////////////////////////////////////////////
00216 // ENUMS
00217 static enum bdtBinaryDataType
00218 {
00219   bdtBitmap,        // bitmap
00220   bdtJPEG,          // JPEG
00221   bdtIcon,          // Icon
00222   bdtEXE_DLL_SCRIPT // EXE, DLL, or SCRIPT
00223 };
00224 /////////////////////////////////////////////////////////////////////////////
00225 // FUNCTION PROTOTYPES
00226 BOOL __stdcall EnumDialogCallback(HINSTANCE hModule, const TCHAR* szType, TCHAR* szDialogName, long lParam);
00227 BOOL __stdcall EnumStringCallback(HINSTANCE hModule, const TCHAR* szType, TCHAR* szName, long lParam);
00228 BOOL __stdcall EnumLanguageCallback(HINSTANCE hModule, const TCHAR* szType, const TCHAR* szName, WORD wIDLanguage, long lParam);
00229 /////////////////////////////////////////////////////////////////////////////
00230 // GLOBAL VARIABLES - IMPORT
00231 UINT g_uiCodePage;
00232 WORD g_wLangId = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); // initialize to language neutral
00233
00234
00235 //__________________________________________________________________________________________
00236 //
00237 // CLASSES
00238 //__________________________________________________________________________________________
00239
00240 /////////////////////////////////////////////////////////////////////////////
00241 // class CGenerateRC -- handles creation of .rc file from .msi database
00242 //
00243 class CGenerateRC
00244 {
00245 public: // constructor and destructor
00246   CGenerateRC(const TCHAR* szDatabase, const TCHAR* szSavedDatabase) : m_szDatabase(szSavedDatabase), m_szOrigDb(szDatabase),
00247     m_hFile(0), m_hDatabase(0), m_iCtrlResID(0), m_fError(FALSE), m_cWriteFileErr(0), m_iStrResID(0), m_fWroteBinary(FALSE){};
00248   ~CGenerateRC();
00249 public: // methods
00250   UINT OutputDialogs(BOOL fBinary);
00251   UINT OutputDialog(TCHAR* szDialog, BOOL fBinary);
00252   UINT OutputString(TCHAR* szTable, TCHAR* szColumn);
00253   BOOL IsInErrorState(){return m_fError;}
00254 private: // methods
00255   UINT   Initialize();
00256   UINT   CreateResourceFile();
00257   BOOL   WriteDialogToRC(TCHAR* szDialog, TCHAR* szTitle, int x, int y, int wd, int ht, int attrib);
00258   BOOL   PrintDimensions(int x, int y, int wd, int ht);
00259   BOOL   OutputControls(TCHAR* szDialog);
00260   UINT   OutputDialogInit(BOOL fBinary);
00261   UINT   OutputDialogFinalize();
00262   UINT   OutputStringInit();
00263   BOOL   WriteBinaries();
00264   BOOL   WriteRadioButtons(TCHAR* szDialog, TCHAR* szRBGroup, TCHAR* szProperty, int x, int y, int attrib);
00265   BOOL   WriteControlToRC(TCHAR* szDialog, TCHAR* szCtrlName, TCHAR* szCtrlType, TCHAR* szCtrlText, TCHAR* szCtrlProperty, int x,
00266               int y, int wd, int ht, int attrib);
00267   BOOL   WriteStdWinCtrl(int iResId, const TCHAR* resType, TCHAR* szCtrlText, int x, int y, int wd, int ht, int attrib);
00268   BOOL   WriteWin32Ctrl(int iResId, const TCHAR* szClass, TCHAR* szCtrlText, TCHAR* szAttrib, int x, int y, int wd, int ht, int attrib);
00269   UINT   VerifyDatabaseCodepage();
00270   TCHAR* EscapeSlashAndQuoteForRC(TCHAR* szStr);
00271 private: // data
00272   const TCHAR* m_szDatabase; // name of database to generate from
00273   const TCHAR* m_szOrigDb;   // name of original database
00274   HANDLE       m_hFile;      // handle to resource file
00275   MSIHANDLE    m_hDatabase;  // handle to database
00276   int          m_iCtrlResID; // current max resource Id used for controls
00277   int          m_iStrResID;  // current max resource Id used for strings
00278   BOOL         m_fError;     // store current error state
00279   BOOL         m_fWroteBinary;// already wrote binary data to rc file
00280   int          m_cWriteFileErr; // number of write file errors
00281 };
00282
00283 ///////////////////////////////////////////////////////////////////////////////
00284 // class CImportRes -- handles import of resource .dll file into .msi database
00285 //
00286 class CImportRes
00287 {
00288 public: // constructor and destructor
00289   CImportRes(const TCHAR* szDatabase, const TCHAR* szSaveDatabase, const TCHAR* szDLLFile) : m_szDatabase(szSaveDatabase), m_szOrigDb(szDatabase), m_szDLLFile(szDLLFile), m_hDatabase(0), m_fError(FALSE),
00290         m_hControl(0), m_hDialog(0), m_hRadioButton(0), m_hInst(0), m_fSetCodepage(FALSE), m_fFoundLang(FALSE){};
00291    ~CImportRes();
00292 public: // methods
00293   UINT ImportDialogs();
00294   UINT ImportStrings();
00295   UINT ImportDialog(TCHAR* szDialog);
00296   BOOL IsInErrorState(){return m_fError;}
00297 public: // but only for enumeration purposes
00298   BOOL WasLanguagePreviouslyFound(){return m_fFoundLang;}
00299   void SetFoundLang(BOOL fValue){ m_fFoundLang = fValue; }
00300   BOOL LoadDialog(HINSTANCE hModule, const TCHAR* szType, TCHAR* szDialog);
00301   BOOL LoadString(HINSTANCE hModule, const TCHAR* szType, TCHAR* szString);
00302   void SetErrorState(BOOL fState) { m_fError = fState; }
00303   BOOL SetCodePage(WORD wLang);
00304 private: // methods
00305   UINT ImportDlgInit();
00306   UINT Initialize();
00307   UINT VerifyDatabaseCodepage();
00308 private: // data
00309   const TCHAR* m_szOrigDb;   // orginal database for opening
00310   const TCHAR* m_szDatabase; // name of database to save to, optional if you want to create a new Db
00311   const TCHAR* m_szDLLFile;  // name of DLL file to import
00312   MSIHANDLE    m_hDatabase;  // handle to database
00313   MSIHANDLE    m_hControl;   // handle to control table
00314   MSIHANDLE    m_hDialog;    // handle to dialog table
00315   MSIHANDLE    m_hRadioButton;// handle to radiobutton table
00316   BOOL         m_fError;     // store current error state
00317   HINSTANCE    m_hInst;      // DLL (with localized resources)
00318   BOOL         m_fSetCodepage; // whether codepage of database has been set
00319   BOOL         m_fFoundLang;  // whether resource has already been found in previous language
00320 };
00321
00322 ///////////////////////////////////////////////////////////////////////////////////////
00323 // CDialogStream class -- used for walking DLGTEMPLATEEX and DLGITEMTEMPLATE in memory
00324 //
00325 class CDialogStream
00326 {
00327 public:
00328   unsigned short  __stdcall GetUInt16();
00329   short  __stdcall GetInt16();
00330   int    __stdcall GetInt32();
00331   int    __stdcall GetInt8();
00332   TCHAR* __stdcall GetStr();
00333   BOOL   __stdcall Align16();
00334   BOOL   __stdcall Align32();
00335   BOOL   __stdcall Undo16();
00336   BOOL   __stdcall Move(int cbBytes);
00337 public:  // constructor, destructor
00338    CDialogStream(HGLOBAL hResource);
00339   ~CDialogStream();
00340 private:
00341   char*  m_pch;
00342 };
00343
00344 //_______________________________________________________________________________________
00345 //
00346 // CGENERATERC CLASS IMPLEMENTATION
00347 //_______________________________________________________________________________________
00348
00349 /////////////////////////////////////////////////////////////////////////////
00350 // CGenerateRC::~CGenerateRC
00351 // --  Handles destruction of necessary objects.
00352 // --  Commits database if no errors
00353 CGenerateRC::~CGenerateRC()
00354 {
00355   UINT iStat;
00356   if (m_hFile)
00357     CloseHandle(m_hFile);
00358   if (m_hDatabase)
00359   {
00360     // commit database for internal tables
00361     // only commit database if no errors
00362     if (!m_fError && !m_cWriteFileErr)
00363     {
00364       if (ERROR_SUCCESS != (iStat = MsiDatabaseCommit(m_hDatabase)))
00365         _tprintf(TEXT("!! DATABASE COMMIT FAILED.  Error = %d\n"), iStat);
00366     }
00367     else
00368       _tprintf(TEXT("!! NO CHANGES SAVED TO DATABASE. '%d' WriteFile errors occured. Error state = %s\n"), m_cWriteFileErr, m_fError ? TEXT("ERRORS OCCURED") : TEXT("NO ERRORS"));
00369     MsiCloseHandle(m_hDatabase);
00370   }
00371 }
00372
00373 /////////////////////////////////////////////////////////////////////////////
00374 // CGenerateRC::CreateResourceFile
00375 // -- Creates .rc file using base name from .msi file
00376 // -- Outputs required header files to .rc file
00377 UINT CGenerateRC::CreateResourceFile()
00378 {
00379   // assumption of database with ".msi" extension
00380   // resource file generated from the database we are saving to
00381   // if m_szDatabase = NULL, then no output database specified, so use m_szOrigDb
00382   // if m_szDatabase, then output database specified, so use m_szDatabase
00383
00384   int cchLen = _tcslen(m_szDatabase ? m_szDatabase : m_szOrigDb) + 1;
00385   TCHAR* szFile = new TCHAR[cchLen];
00386   if ( !szFile )
00387     return m_fError = true, ERROR_OUTOFMEMORY;
00388
00389   // copy database name over
00390   if (FAILED(StringCchCopy(szFile, cchLen, m_szDatabase ? m_szDatabase : m_szOrigDb)))
00391   {
00392     delete [] szFile;
00393     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
00394   }
00395
00396   // ensure input conforms to {base}.msi format
00397   //                                12345
00398   // cchLen must be >= 6 since .msi plus \0 is 5
00399   if (cchLen < 6
00400     || szFile[cchLen-5] != '.'
00401     || (szFile[cchLen-4] != 'm' && szFile[cchLen-4] != 'M')
00402     || (szFile[cchLen-3] != 's' && szFile[cchLen-3] != 'S')
00403     || (szFile[cchLen-2] != 'i' && szFile[cchLen-2] != 'I'))
00404   {
00405     delete [] szFile;
00406     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
00407   }
00408
00409   // remove "msi" and change to "rc"
00410   szFile[cchLen-4] = 'r';
00411   szFile[cchLen-3] = 'c';
00412   szFile[cchLen-2] = '\0';
00413
00414   if (m_szDatabase)
00415     _tprintf(TEXT("LOG>> Original Database: %s, Saved Database: %s, Generated RC File: %s\n"), m_szOrigDb, m_szDatabase, szFile);
00416   else
00417     _tprintf(TEXT("LOG>> Database: %s, Generated RC file: %s\n"), m_szOrigDb , szFile);
00418
00419   // attempt to create resource file
00420   m_hFile = CreateFile(szFile, GENERIC_WRITE, FILE_SHARE_WRITE,
00421                 0, CREATE_ALWAYS, 0, 0);
00422   if (!m_hFile)
00423   {
00424     _tprintf(TEXT("Unable to create resource file: %s\n"), szFile);
00425     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
00426   }
00427
00428   // write required headers to resource file (needed for successful compilation)
00429   DWORD dwBytesWritten = 0;
00430   // need <windows.h> for most rc requirements
00431   if (!WriteFile(m_hFile, szWndwHdrFile, sizeof(szWndwHdrFile)-sizeof(TCHAR), &dwBytesWritten, 0))
00432     m_cWriteFileErr++;
00433   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwBytesWritten, 0))
00434     m_cWriteFileErr++;
00435   // need <commctrl.h> for listview control
00436   if (!WriteFile(m_hFile, szCommCtrlHdrFile, sizeof(szCommCtrlHdrFile)-sizeof(TCHAR), &dwBytesWritten, 0))
00437     m_cWriteFileErr++;
00438   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwBytesWritten, 0))
00439     m_cWriteFileErr++;
00440
00441   // whitespace output (required)
00442   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwBytesWritten, 0))
00443     m_cWriteFileErr++;
00444   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwBytesWritten, 0))
00445     m_cWriteFileErr++;
00446
00447   // return success
00448   return m_cWriteFileErr ? ERROR_FUNCTION_FAILED : ERROR_SUCCESS;
00449 }
00450
00451 /////////////////////////////////////////////////////////////////////////////
00452 // CGenerateRC::WriteBinaries
00453 BOOL CGenerateRC::WriteBinaries()
00454 {
00455   m_fWroteBinary = TRUE;
00456   MSICONDITION eCond = MsiDatabaseIsTablePersistent(m_hDatabase, TEXT("Binary"));
00457   if (eCond == MSICONDITION_ERROR)
00458   {
00459     _tprintf(TEXT("LOG_ERROR>> MsiDatabaseIsTablePersisent(Binary)\n"));
00460     return m_fError = TRUE, FALSE; // error - ABORT
00461   }
00462   if (eCond != MSICONDITION_TRUE)
00463   {
00464     _tprintf(TEXT("LOG>> Binary table does not exist or is not persistent\n"));
00465     return TRUE;
00466   }
00467
00468 #ifdef DEBUG
00469   _tprintf(TEXT("LOG>>...BEGIN WRITING BINARY DATA TO RESOURCE FILE...\n"));
00470 #endif
00471
00472   UINT uiStat = ERROR_SUCCESS;
00473   PMSIHANDLE hViewBinary = 0;
00474   if (ERROR_SUCCESS != MsiDatabaseOpenView(m_hDatabase, sqlBinary, &hViewBinary)
00475     || ERROR_SUCCESS != MsiViewExecute(hViewBinary, 0))
00476     return m_fError = TRUE, FALSE; // error - ABORT
00477
00478   PMSIHANDLE hRecBinary = 0;
00479   bdtBinaryDataType bdt;
00480   DWORD dwWritten = 0;
00481   while (ERROR_SUCCESS == (uiStat = MsiViewFetch(hViewBinary, &hRecBinary)))
00482   {
00483     TCHAR szFileBuf[2*MAX_PATH+1] = {0};
00484     TCHAR szPathBuf[MAX_PATH+1] = {0};
00485     DWORD cchLen = 0;
00486
00487     if (ERROR_MORE_DATA != MsiRecordGetString(hRecBinary, ibcName, TEXT(""), &cchLen))
00488       return m_fError = TRUE, FALSE;
00489
00490     TCHAR* szName = new TCHAR[++cchLen];
00491     if ( !szName )
00492       return m_fError = TRUE, FALSE;
00493
00494     if (ERROR_SUCCESS != (uiStat = MsiRecordGetString(hRecBinary, ibcName, szName, &cchLen)))
00495     {
00496       delete [] szName;
00497       return m_fError = TRUE, FALSE; // error - ABORT
00498     }
00499
00500     // find the temp directory to dump out the binary data into temp files
00501     DWORD cchRet = GetTempPath(sizeof(szPathBuf)/sizeof(szPathBuf[0]), szPathBuf);
00502     if (0 == cchRet || cchRet > sizeof(szPathBuf)/sizeof(szPathBuf[0]))
00503     {
00504       delete [] szName;
00505       return m_fError = TRUE, FALSE; // error - ABORT
00506     }
00507
00508     // generate a temporary file name, prefix with IBD for Installer Binary Data
00509     if (0 == GetTempFileName(szPathBuf, TEXT("IBD"), 0, szFileBuf))
00510     {
00511       delete [] szName;
00512       return m_fError = TRUE, FALSE; // error - ABORT
00513     }
00514
00515     // create the file
00516     HANDLE hBinFile = CreateFile(szFileBuf, GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, 0, 0);
00517     // verify handle
00518     if (hBinFile == INVALID_HANDLE_VALUE)
00519     {
00520       delete [] szName;
00521       return m_fError = TRUE, FALSE; // error - ABORT
00522     }
00523
00524 #ifdef DEBUG
00525   _tprintf(TEXT("LOG>>Binary data temp file created: '%s'\n"), szFileBuf);
00526 #endif
00527
00528     // read in stream of data and write to file
00529     char szStream[1024] = {0};
00530     DWORD cbBuf = sizeof(szStream);
00531     BOOL fFirstRun = TRUE;
00532     do
00533     {
00534       if (MsiRecordReadStream(hRecBinary, ibcData, szStream, &cbBuf) != ERROR_SUCCESS)
00535       {
00536         delete [] szName;
00537         return m_fError = TRUE, FALSE;
00538       }
00539
00540       if (fFirstRun)
00541       {
00542         // binary data prefixed with "BM" in stream
00543
00544         if (cbBuf >= 2)
00545         {
00546           if (szStream[0] == 'B' && szStream[1] == 'M')
00547             bdt = bdtBitmap;
00548           else if (szStream[0] == 0xFF && szStream[1] == 0xD8)
00549             bdt = bdtJPEG;
00550           else if (szStream[0] == 'M' && szStream[1] == 'Z')
00551             bdt = bdtEXE_DLL_SCRIPT; // 'MZ prefix with exe's and dll's
00552           else if (szStream[0] == 0x00 && szStream[1] == 0x00)
00553             bdt = bdtIcon;
00554           else
00555             bdt = bdtEXE_DLL_SCRIPT;
00556         }
00557         else
00558           bdt = bdtEXE_DLL_SCRIPT;
00559 #ifdef DEBUG
00560         if (fFirstRun && bdt != bdtEXE_DLL_SCRIPT)
00561           _tprintf(TEXT("LOG>> Writing <%s> '%s'\n"), bdt == bdtIcon ? TEXT("ICON") : ((bdt == bdtJPEG) ? TEXT("JPEG") : TEXT("BITMAP")), szName);
00562 #endif // DEBUG
00563         fFirstRun = FALSE;
00564       }
00565
00566       if (cbBuf && bdt != bdtEXE_DLL_SCRIPT)
00567       {
00568         if (!WriteFile(hBinFile, szStream, cbBuf, &dwWritten, 0))
00569         {
00570           delete [] szName;
00571           return m_fError = TRUE, FALSE; // error - ABORT
00572         }
00573       }
00574     }
00575     while (cbBuf == sizeof(szStream) && bdt != bdtEXE_DLL_SCRIPT);
00576
00577     // close file
00578     if (!CloseHandle(hBinFile))
00579     {
00580       delete [] szName;
00581       return m_fError = TRUE, FALSE; // error - ABORT
00582     }
00583
00584     if (bdt == bdtEXE_DLL_SCRIPT)
00585     {
00586       delete [] szName;
00587       continue; // skip over DLL and EXE binary data, not UI related
00588     }
00589
00590     // output to resource file
00591     // escape chars in str
00592     TCHAR* szEscTitle = EscapeSlashAndQuoteForRC(szFileBuf);
00593
00594     if ( !szEscTitle )
00595     {
00596       delete [] szName;
00597       return m_fError = TRUE, FALSE;
00598     }
00599
00600     if (_tcslen(szEscTitle) > iMaxResStrLen)
00601     {
00602       _tprintf(TEXT("!! >> STR TOO LONG FOR RC FILE >> BITMAP FILE: %s\n"), szName);
00603       delete [] szName;
00604       delete [] szEscTitle;
00605       continue; // can't output this
00606     }
00607     /*NAMEID<tab>*/
00608     if (!WriteFile(m_hFile, szName, _tcslen(szName)*sizeof(TCHAR), &dwWritten, 0))
00609       m_cWriteFileErr++;
00610     if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
00611       m_cWriteFileErr++;
00612     switch (bdt)
00613     {
00614     case bdtBitmap: /*BITMAP*/
00615       if (!WriteFile(m_hFile, resBitmap, _tcslen(resBitmap)*sizeof(TCHAR), &dwWritten, 0))
00616         m_cWriteFileErr++;
00617       break;
00618     case bdtJPEG:   /*JPEG*/
00619       if (!WriteFile(m_hFile, resJPEG, _tcslen(resJPEG)*sizeof(TCHAR), &dwWritten, 0))
00620         m_cWriteFileErr++;
00621       break;
00622     case bdtIcon: /*ICON*/
00623       if (!WriteFile(m_hFile, resIcon, _tcslen(resIcon)*sizeof(TCHAR), &dwWritten, 0))
00624         m_cWriteFileErr++;
00625       break;
00626     default:
00627       return m_fError = TRUE, FALSE; // error - ABORT
00628     }
00629     /*<tab>"filename"*/
00630     if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
00631       m_cWriteFileErr++;
00632     if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
00633       m_cWriteFileErr++;
00634     if (!WriteFile(m_hFile, szEscTitle, _tcslen(szEscTitle)*sizeof(TCHAR), &dwWritten, 0))
00635       m_cWriteFileErr++;
00636
00637     delete [] szEscTitle;
00638
00639     if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
00640       m_cWriteFileErr++;
00641     if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
00642       m_cWriteFileErr++;
00643
00644     delete [] szName;
00645   }
00646   if (ERROR_NO_MORE_ITEMS != uiStat)
00647     return m_fError = TRUE, FALSE; // error - ABORT
00648
00649   // whitespace in .rc file for readability
00650   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
00651     m_cWriteFileErr++;
00652   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
00653     m_cWriteFileErr++;
00654
00655 #ifdef DEBUG
00656   _tprintf(TEXT("LOG>>...END WRITING BINARY DATA TO RESOURCE FILE...\n"));
00657 #endif
00658
00659   return TRUE;
00660 }
00661
00662 /////////////////////////////////////////////////////////////////////////////
00663 // CGenerateRC::OutputStringInit
00664 UINT CGenerateRC::OutputStringInit()
00665 {
00666   /**********************************************************************************
00667    create internal table for mapping string IDs to strings
00668    TABLE: _RESStrings
00669    COLUMNS: RCID (Short, Primary Key), Table (String), Column (String), Key (String)
00670   ***********************************************************************************/
00671   UINT iStat;
00672   // see if _RESStrings table is already there
00673   MSICONDITION eCondition = MsiDatabaseIsTablePersistent(m_hDatabase, TEXT("_RESStrings"));
00674   if (eCondition == MSICONDITION_TRUE)
00675   {
00676     // table persistent
00677     // find the last resource Id
00678     PMSIHANDLE hViewSelMaxRc = 0;
00679     PMSIHANDLE hRecMaxRc = 0;
00680     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlSelMaxStrRcId, &hViewSelMaxRc))
00681       || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewSelMaxRc, 0))
00682       || ERROR_SUCCESS != (iStat = MsiViewFetch(hViewSelMaxRc, &hRecMaxRc)))
00683       return m_fError = TRUE, iStat; // error - ABORT
00684
00685     // update resource Id
00686     m_iStrResID = MsiRecordGetInteger(hRecMaxRc, 1);
00687 #ifdef DEBUG
00688   _tprintf(TEXT("LOG>> _RESStrings Table is Present. MAX RES ID = %d\n"), m_iStrResID);
00689 #endif
00690   }
00691   else if (eCondition == MSICONDITION_FALSE || eCondition == MSICONDITION_ERROR) // error or table temporary
00692     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
00693   else
00694   {
00695     // table not exist -- create it
00696     PMSIHANDLE h_StrMarkingView = 0;
00697     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlCreateStrMap, &h_StrMarkingView))
00698       || ERROR_SUCCESS != (iStat = MsiViewExecute(h_StrMarkingView, 0)))
00699       return m_fError = TRUE, iStat; // error - ABORT
00700   }
00701   return ERROR_SUCCESS;
00702 }
00703
00704 /////////////////////////////////////////////////////////////////////////////
00705 // CGenerateRC::OutputString
00706 UINT CGenerateRC::OutputString(TCHAR* szTable, TCHAR* szColumn)
00707 {
00708   UINT iStat;
00709   if (ERROR_SUCCESS != (iStat = Initialize()))
00710     return m_fError = TRUE, iStat; // error - ABORT
00711
00712   // initialize _RESStrings marking table
00713   if (ERROR_SUCCESS != (iStat = OutputStringInit()))
00714     return m_fError = TRUE, iStat; // error - ABORT
00715
00716   // verify table exists
00717   MSICONDITION eCond = MsiDatabaseIsTablePersistent(m_hDatabase, szTable);
00718   switch (eCond)
00719   {
00720   case MSICONDITION_FALSE: // table is temporary
00721   case MSICONDITION_NONE: // table does not exist
00722     _tprintf(TEXT("LOG_ERROR>> TABLE: %s is temporary or does not exist.\n"), szTable);
00723     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
00724   case MSICONDITION_ERROR: // error occured
00725     _tprintf(TEXT("LOG_ERROR>> MsiDatabaseIsTablePersistent\n"));
00726     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
00727   case MSICONDITION_TRUE: // table is persistent
00728     break;
00729   default:
00730     assert(0);
00731     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
00732   }
00733
00734   // build query to open view on table
00735   PMSIHANDLE hRecPrimaryKeys = 0;
00736   if (ERROR_SUCCESS != (iStat = MsiDatabaseGetPrimaryKeys(m_hDatabase, szTable, &hRecPrimaryKeys)))
00737     return m_fError = TRUE, iStat; // error - ABORT
00738   int cPrimaryKeys = MsiRecordGetFieldCount(hRecPrimaryKeys);
00739
00740   // determine length of list of column names for query
00741   DWORD cchKeyColumns = 0;
00742   int iCol;
00743   for (iCol=1; iCol<=cPrimaryKeys; iCol++)
00744   {
00745     DWORD cchLen = 0;
00746     if (ERROR_MORE_DATA != MsiRecordGetString(hRecPrimaryKeys, iCol, TEXT(""), &cchLen))
00747       return m_fError = TRUE, ERROR_FUNCTION_FAILED;
00748     cchKeyColumns += cchLen + 3; // extra 3 is for enclosing back ticks '`' and ','
00749   }
00750
00751   TCHAR* szKeyCols = new TCHAR[++cchKeyColumns];
00752   if ( !szKeyCols )
00753     return m_fError = TRUE, ERROR_OUTOFMEMORY;
00754
00755   ZeroMemory(szKeyCols, cchKeyColumns*sizeof(TCHAR));
00756   DWORD cchRemain = cchKeyColumns;
00757   TCHAR* pchKeyCols = szKeyCols;
00758   for (iCol=1; iCol<=cPrimaryKeys; iCol++)
00759   {
00760     if (iCol != 1)
00761     {
00762       *pchKeyCols++ = ',';
00763       cchRemain--;
00764     }
00765
00766     *pchKeyCols++ = '`';
00767     cchRemain--;
00768
00769     DWORD cchLen = cchRemain;
00770     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecPrimaryKeys, iCol, pchKeyCols, &cchLen)))
00771     {
00772       delete [] szKeyCols;
00773       return m_fError = TRUE, iStat;
00774     }
00775
00776     pchKeyCols += cchLen;
00777     *pchKeyCols++ = '`';
00778     cchRemain -= (cchLen + 1);
00779   }
00780
00781   szKeyCols[cchKeyColumns-1] = '\0'; // ensure null terminated
00782
00783   DWORD cchSQL = _tcslen(sqlStrCol) + _tcslen(szKeyCols) + _tcslen(szColumn) + _tcslen(szTable) + 1;
00784   TCHAR* szSQL = new TCHAR[cchSQL];
00785   if ( !szSQL )
00786   {
00787     delete [] szKeyCols;
00788     return m_fError = TRUE, ERROR_OUTOFMEMORY;
00789   }
00790
00791   if (FAILED(StringCchPrintf(szSQL, cchSQL, sqlStrCol, szKeyCols, szColumn, szTable)))
00792   {
00793     delete [] szKeyCols;
00794     delete [] szSQL;
00795     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
00796   }
00797
00798   PMSIHANDLE hViewStrCol = 0;
00799
00800   // open view
00801   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, szSQL, &hViewStrCol)))
00802   {
00803     if (ERROR_BAD_QUERY_SYNTAX == iStat)
00804       _tprintf(TEXT("LOG_ERROR>> Query failed, probably because the column '%s' does not exist in table '%s'\n"), szColumn, szTable);
00805     else
00806       _tprintf(TEXT("LOG_ERROR>> MsiDatabaseOpenView(Column=%s, Table=%s)\n"), szColumn, szTable);
00807
00808     delete [] szKeyCols;
00809     delete [] szSQL;
00810     return m_fError = TRUE, iStat; // error - ABORT
00811   }
00812
00813   delete [] szKeyCols;
00814   szKeyCols = NULL;
00815   delete [] szSQL;
00816   szSQL = NULL;
00817
00818   if (ERROR_SUCCESS != (iStat = MsiViewExecute(hViewStrCol, 0)))
00819     return m_fError = TRUE, iStat; // error - ABORT
00820
00821   // verify column is localizable
00822   PMSIHANDLE hRecColNames = 0;
00823   PMSIHANDLE hRecColType = 0;
00824   if (ERROR_SUCCESS != (iStat = MsiViewGetColumnInfo(hViewStrCol, MSICOLINFO_NAMES, &hRecColNames)))
00825   {
00826     return m_fError = TRUE, iStat; // error - ABORT
00827   }
00828   int cCols = MsiRecordGetFieldCount(hRecColNames);
00829   int iStrCol = 0;
00830   for (int iFindCol = 1; iFindCol <= cCols; iFindCol++)
00831   {
00832     TCHAR szColumnName[72] = {0};
00833     DWORD cchColumnName = sizeof(szColumnName)/sizeof(szColumnName[0]);
00834     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecColNames, iFindCol, szColumnName, &cchColumnName)))
00835       return m_fError = TRUE, iStat; // error - ABORT
00836     if (_tcscmp(szColumnName, szColumn) == 0)
00837     {
00838       iStrCol = iFindCol;
00839       break;
00840     }
00841   }
00842   if (!iStrCol
00843     || ERROR_SUCCESS != (iStat = MsiViewGetColumnInfo(hViewStrCol, MSICOLINFO_TYPES, &hRecColType)))
00844   {
00845     _tprintf(TEXT("LOG_ERROR>> MsiViewGetColumnInfo\n"));
00846     return m_fError = TRUE, iStat; // error - ABORT
00847   }
00848   DWORD cchColType = 0;
00849   if (ERROR_MORE_DATA != MsiRecordGetString(hRecColType, iStrCol, TEXT(""), &cchColType))
00850     return m_fError = TRUE, iStat;
00851
00852   TCHAR* szColType = new TCHAR[++cchColType];
00853   if ( !szColType )
00854     return m_fError = TRUE, ERROR_OUTOFMEMORY;
00855
00856   if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecColType, iStrCol, szColType, &cchColType))
00857     || cchColType < 2)
00858   {
00859     delete [] szColType;
00860     return m_fError = TRUE, iStat; // error - ABORT
00861   }
00862
00863   // for column to be localizable, first char in szColType must be an 'L' or an 'l'
00864   if (*szColType != 'L' && *szColType != 'l')
00865   {
00866     _tprintf(TEXT("LOG_ERROR>> Column '%s' of Table '%s' is not localizable\n"), szColumn, szTable);
00867     delete [] szColType;
00868     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
00869   }
00870
00871   delete [] szColType;
00872
00873   // write whitespace for readability
00874   // whitespace in .rc file for readability
00875   DWORD dwWritten = 0;
00876   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
00877     m_cWriteFileErr++;
00878   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
00879     m_cWriteFileErr++;
00880
00881   // output STRINGTABLE resource header
00882   // format is:
00883   //  STRINGTABLE  [[optional-statements]]  {      stringID string      . . .  }
00884   /*STRINGTABLE*/
00885   if (!WriteFile(m_hFile, resStringTable, _tcslen(resStringTable)*sizeof(TCHAR), &dwWritten, 0))
00886     m_cWriteFileErr++;
00887   /*<tab>{*/
00888   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
00889     m_cWriteFileErr++;
00890   if (!WriteFile(m_hFile, szCurlyBeg, sizeof(szCurlyBeg)-sizeof(TCHAR), &dwWritten, 0))
00891     m_cWriteFileErr++;
00892   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
00893     m_cWriteFileErr++;
00894
00895   // output all strings
00896   PMSIHANDLE hRecStr = 0;
00897   while (ERROR_SUCCESS == (iStat = MsiViewFetch(hViewStrCol, &hRecStr)))
00898   {
00899     // string to localize is at cPrimaryKeys+1 in record hRecStr
00900
00901     // determine length of key identifier
00902     DWORD cchKeyIdentifier = 0;
00903     int iKey;
00904     for (iKey = 1; iKey <= cPrimaryKeys; iKey++)
00905     {
00906       DWORD cchLen = 0;
00907       if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecStr, iKey, TEXT(""), &cchLen)))
00908         return m_fError = TRUE, iStat;
00909       cchKeyIdentifier += cchLen + 1; // add extra 1 for ':'
00910     }
00911
00912     TCHAR* szKeyIdentifier = new TCHAR[++cchKeyIdentifier];
00913     if ( !szKeyIdentifier )
00914       return m_fError = TRUE, ERROR_OUTOFMEMORY;
00915
00916     ZeroMemory(szKeyIdentifier, cchKeyIdentifier*sizeof(TCHAR));
00917
00918     DWORD cchKeyRemain = cchKeyIdentifier;
00919     TCHAR* pchKeyIdentifier = szKeyIdentifier;
00920     for (iKey=1; iKey<=cPrimaryKeys; iKey++)
00921     {
00922       if (iKey != 1)
00923       {
00924         *pchKeyIdentifier++ = ':';
00925         cchKeyRemain--;
00926       }
00927
00928       DWORD cchLen = cchKeyRemain;
00929       if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecStr, iKey, pchKeyIdentifier, &cchLen)))
00930       {
00931         delete [] szKeyIdentifier;
00932         return m_fError = TRUE, iStat;
00933       }
00934
00935       pchKeyIdentifier += cchLen;
00936       cchKeyRemain -= cchLen;
00937     }
00938
00939     // ensure null terminated
00940     szKeyIdentifier[cchKeyIdentifier-1] = '\0';
00941
00942     int iResId = 0;
00943
00944     DWORD cchFindSQL = _tcslen(sqlFindStrResId) + _tcslen(szTable) + _tcslen(szColumn) + _tcslen(szKeyIdentifier) + 1;
00945     TCHAR* szFindSQL = new TCHAR[cchFindSQL];
00946     if ( !szFindSQL )
00947     {
00948       delete [] szKeyIdentifier;
00949       return m_fError = TRUE, ERROR_OUTOFMEMORY;
00950     }
00951
00952     if (FAILED(StringCchPrintf(szFindSQL, cchFindSQL, sqlFindStrResId, szTable, szColumn, szKeyIdentifier)))
00953     {
00954       delete [] szKeyIdentifier;
00955       delete [] szFindSQL;
00956       return m_fError = TRUE, ERROR_FUNCTION_FAILED;
00957     }
00958
00959     PMSIHANDLE hViewFindRes = 0;
00960     PMSIHANDLE hRecFindRes = 0;
00961     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, szFindSQL, &hViewFindRes)))
00962     {
00963       delete [] szKeyIdentifier;
00964       delete [] szFindSQL;
00965       return m_fError = TRUE, iStat;
00966     }
00967
00968     delete [] szFindSQL;
00969     szFindSQL = NULL;
00970
00971     if (ERROR_SUCCESS != (iStat = MsiViewExecute(hViewFindRes, 0)))
00972     {
00973       delete [] szKeyIdentifier;
00974       return m_fError = TRUE, iStat; // error - ABORT
00975     }
00976     if (ERROR_SUCCESS == (iStat = MsiViewFetch(hViewFindRes, &hRecFindRes)))
00977     {
00978       // grab res id
00979       iResId = MsiRecordGetInteger(hRecFindRes, 1);
00980     }
00981     else if (ERROR_NO_MORE_ITEMS == iStat)
00982     {
00983       // use next available resource Id
00984       iResId = ++m_iStrResID;
00985     }
00986     else
00987     {
00988       delete [] szKeyIdentifier;
00989       return m_fError = TRUE, iStat; // error - ABORT
00990     }
00991
00992     // output string to resource file
00993     DWORD cchLenStr = 0;
00994     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecStr, cPrimaryKeys+1, TEXT(""), &cchLenStr)))
00995     {
00996       delete [] szKeyIdentifier;
00997       return m_fError = TRUE, iStat;
00998     }
00999
01000     TCHAR* szStr = new TCHAR[++cchLenStr];
01001     if ( !szStr )
01002     {
01003       delete [] szKeyIdentifier;
01004       return m_fError = TRUE, ERROR_OUTOFMEMORY;
01005     }
01006
01007     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecStr, cPrimaryKeys+1, szStr, &cchLenStr)))
01008     {
01009       delete [] szKeyIdentifier;
01010       delete [] szStr;
01011       return m_fError = TRUE, iStat; // error - ABORT
01012     }
01013 #ifdef DEBUG
01014     _tprintf(TEXT("LOG>> WRITING string '%s'. TABLE:%s COLUMN:%s KEY:%s\n"), szStr, szTable, szColumn, szKeyIdentifier);
01015 #endif
01016     // escape chars in str
01017     TCHAR* szEscTitle = EscapeSlashAndQuoteForRC(szStr);
01018     if ( !szEscTitle )
01019     {
01020       delete [] szKeyIdentifier;
01021       delete [] szStr;
01022       return m_fError = TRUE, ERROR_OUTOFMEMORY;
01023     }
01024
01025     if (_tcslen(szEscTitle) > iMaxResStrLen)
01026     {
01027       _tprintf(TEXT("!! >> STR TOO LONG FOR RC FILE >> STRING: %s FROM TABLE: %s, COLUMN: %s, KEY: %s\n"), szStr, szTable, szColumn, szKeyIdentifier);
01028       delete [] szKeyIdentifier;
01029       delete [] szStr;
01030       delete [] szEscTitle;
01031       continue; // can't output this
01032     }
01033
01034     delete [] szStr;
01035     szStr = NULL;
01036
01037     /*<tab>ID*/
01038     if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
01039       m_cWriteFileErr++;
01040     TCHAR szTempBuf[10] = {0};
01041
01042     if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), iResId)))
01043     {
01044       delete [] szKeyIdentifier;
01045       return m_fError = TRUE, ERROR_FUNCTION_FAILED;
01046     }
01047
01048     if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
01049       m_cWriteFileErr++;
01050
01051     /*,<tab>"str"*/
01052     if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
01053       m_cWriteFileErr++;
01054     if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
01055       m_cWriteFileErr++;
01056     if (!WriteFile(m_hFile, szEscTitle, _tcslen(szEscTitle)*sizeof(TCHAR), &dwWritten, 0))
01057       m_cWriteFileErr++;
01058     delete [] szEscTitle;
01059     if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
01060       m_cWriteFileErr++;
01061     if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
01062       m_cWriteFileErr++;
01063
01064     // update resid in _RESStrings
01065     PMSIHANDLE hViewRes = 0;
01066     PMSIHANDLE hRecInsertStr = MsiCreateRecord(4);
01067     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlInsertStr, &hViewRes))
01068       || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewRes, 0))
01069       || ERROR_SUCCESS != (iStat = MsiRecordSetInteger(hRecInsertStr, 4, iResId))
01070       || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecInsertStr, 1, szTable))
01071       || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecInsertStr, 2, szColumn))
01072       || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecInsertStr, 3, szKeyIdentifier))
01073       || ERROR_SUCCESS != (iStat = MsiViewModify(hViewRes, MSIMODIFY_ASSIGN, hRecInsertStr)))
01074     {
01075       delete [] szKeyIdentifier;
01076       return m_fError = TRUE, iStat;
01077     }
01078
01079     delete [] szKeyIdentifier;
01080     szKeyIdentifier = NULL;
01081
01082   }
01083   if (iStat != ERROR_NO_MORE_ITEMS)
01084     return m_fError = TRUE, iStat; // error - ABORT
01085
01086   /*}*/
01087   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
01088     m_cWriteFileErr++;
01089   if (!WriteFile(m_hFile, szCurlyEnd, sizeof(szCurlyEnd)-sizeof(TCHAR), &dwWritten, 0))
01090     m_cWriteFileErr++;
01091
01092
01093   // update _RESStrings table with MAX_RESOURCE_ID
01094   PMSIHANDLE hViewStrMark = 0;
01095   PMSIHANDLE hRecMaxRcId = MsiCreateRecord(4);
01096   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlStrMark, &hViewStrMark))
01097     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewStrMark, 0))
01098     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecMaxRcId, 1, TEXT("MAX_RESOURCE_ID")))
01099     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecMaxRcId, 2, TEXT("MAX_RESOURCE_ID")))
01100     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecMaxRcId, 3, TEXT("")))
01101     || ERROR_SUCCESS != (iStat = MsiRecordSetInteger(hRecMaxRcId, 4, m_iStrResID))
01102     || ERROR_SUCCESS != (iStat = MsiViewModify(hViewStrMark, MSIMODIFY_ASSIGN, hRecMaxRcId)))
01103     return m_fError = TRUE, iStat; // error - ABORT
01104
01105   return ERROR_SUCCESS;
01106 }
01107
01108 /////////////////////////////////////////////////////////////////////////////
01109 // CGenerateRC::Initialize
01110 UINT CGenerateRC::Initialize()
01111 {
01112   UINT iStat;
01113   // open database if not already open
01114   assert(m_szOrigDb);
01115   if (!m_hDatabase)
01116   {
01117     // if m_szDatabase is specified, then we use it for specifying an output database
01118     iStat = MsiOpenDatabase(m_szOrigDb, m_szDatabase ? m_szDatabase : MSIDBOPEN_TRANSACT, &m_hDatabase);
01119     if (ERROR_SUCCESS != iStat)
01120     {
01121       _tprintf(TEXT("LOG_ERROR>> Unable to open database %s\n"), m_szOrigDb);
01122       return m_fError = TRUE, iStat; // error - ABORT
01123     }
01124   }
01125
01126   // verify database codepage is NEUTRAL
01127   if  (ERROR_SUCCESS != (iStat = VerifyDatabaseCodepage()))
01128     return m_fError = TRUE, iStat; // error - ABORT
01129
01130   // create resource file if not already created
01131   if (!m_hFile && ERROR_SUCCESS != (iStat = CreateResourceFile()))
01132   {
01133     _tprintf(TEXT("LOG_ERROR>> Unable to create resource file.\n"));
01134     return m_fError = TRUE, iStat; // error - ABORT
01135   }
01136
01137   return ERROR_SUCCESS;
01138 }
01139
01140 /////////////////////////////////////////////////////////////////////////////
01141 // CGenerateRC::OutputDialogFinalize
01142 UINT CGenerateRC::OutputDialogFinalize()
01143 {
01144   // update _RESControls table with MAX_RESOURCE_ID
01145   PMSIHANDLE hViewCtrlMark = 0;
01146   PMSIHANDLE hRecMaxRcId = MsiCreateRecord(3);
01147   UINT iStat;
01148   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlCtrlMark, &hViewCtrlMark))
01149     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewCtrlMark, 0))
01150     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecMaxRcId, 1, TEXT("MAX_RESOURCE_ID")))
01151     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecMaxRcId, 2, TEXT("MAX_RESOURCE_ID")))
01152     || ERROR_SUCCESS != (iStat = MsiRecordSetInteger(hRecMaxRcId, 3, m_iCtrlResID))
01153     || ERROR_SUCCESS != (iStat = MsiViewModify(hViewCtrlMark, MSIMODIFY_ASSIGN, hRecMaxRcId)))
01154     return m_fError = TRUE, iStat; // error - ABORT
01155
01156 #ifdef DEBUG
01157   _tprintf(TEXT("LOG>>...END WRITING DIALOG DATA TO RESOURCE FILE...\n"));
01158 #endif
01159
01160   return ERROR_SUCCESS;
01161 }
01162
01163 /////////////////////////////////////////////////////////////////////////////
01164 // CGenerateRC::VerifyDatabaseCodepage
01165 UINT CGenerateRC::VerifyDatabaseCodepage()
01166 {
01167   UINT iStat;
01168
01169   // only output from language neutral database
01170   TCHAR szTempPath[MAX_PATH+1] = {0};
01171   DWORD cchRet = GetTempPath(sizeof(szTempPath)/sizeof(szTempPath[0]), szTempPath);
01172   if (0 == cchRet || cchRet > sizeof(szTempPath)/sizeof(szTempPath[0]))
01173     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
01174
01175   // export _ForceCodepage table so can verify codepage
01176   if (ERROR_SUCCESS != (iStat = MsiDatabaseExport(m_hDatabase, TEXT("_ForceCodepage"), szTempPath, szCodepageExport)))
01177   {
01178     _tprintf(TEXT("LOG_ERROR>> MsiDatabaseExport(_ForceCodepage)\n"));
01179     return m_fError = TRUE, iStat; // error - ABORT
01180   }
01181
01182   // open _ForceCodepage.idt to read it
01183   DWORD cchFullPath = _tcslen(szTempPath) + _tcslen(szCodepageExport) + 1;
01184   TCHAR* szFullPath = new TCHAR[cchFullPath];
01185   if ( !szFullPath )
01186     return m_fError = TRUE, ERROR_OUTOFMEMORY;
01187
01188   if (FAILED(StringCchPrintf(szFullPath, cchFullPath, TEXT("%s%s"), szTempPath, szCodepageExport)))
01189   {
01190     delete [] szFullPath;
01191     return m_fError = TRUE, ERROR_OUTOFMEMORY;
01192   }
01193
01194   HANDLE hFile = CreateFile(szFullPath, GENERIC_READ, FILE_SHARE_READ, (LPSECURITY_ATTRIBUTES)0, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, 0);
01195   if (hFile == NULL)
01196   {
01197     _tprintf(TEXT("LOG_ERROR>> OpenFile(_ForceCodepage.idt)\n"));
01198     delete [] szFullPath;
01199     return m_fError = TRUE, iStat; // error - ABORT
01200   }
01201
01202   delete [] szFullPath;
01203   szFullPath = NULL;
01204
01205   // read file for information
01206   DWORD dwSize = GetFileSize(hFile, NULL);
01207   if (0xFFFFFFFF == dwSize)
01208     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01209
01210   char* szBuf = new char[dwSize+1];
01211   if ( !szBuf )
01212   {
01213     CloseHandle(hFile);
01214     return m_fError = TRUE, ERROR_OUTOFMEMORY;
01215   }
01216
01217   DWORD dwRead = 0;
01218   if (!ReadFile(hFile, (LPVOID)szBuf, dwSize, &dwRead, NULL)
01219     || 0 == dwRead)
01220   {
01221     delete [] szBuf;
01222     CloseHandle(hFile);
01223     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01224   }
01225   // parse buffer
01226   // format should be : blank line, blank line, "codepage<tab>_ForceCodepage"
01227   char* pch = szBuf;
01228   int cBlankLines = 0;
01229   while (dwRead && cBlankLines != 2)
01230   {
01231     if (*pch == '\n')
01232       cBlankLines++;
01233     pch++;
01234     dwRead--;
01235   }
01236   if (!dwRead || cBlankLines != 2)
01237   {
01238     _tprintf(TEXT("LOG_ERROR>> Invalid ForceCodepage idt format\n"));
01239     delete [] szBuf;
01240     CloseHandle(hFile);
01241     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
01242   }
01243   // codepage is next
01244   char* pchCodepage = pch;
01245   while (dwRead && *pch != ' ' && *pch != '\t')
01246   {
01247     pch++;
01248     dwRead--;
01249   }
01250   assert(dwRead);
01251   *pch = '\0';
01252   // convert codepage to int
01253   UINT uiCodepage = strtoul(pchCodepage, NULL, 10);
01254
01255   delete [] szBuf;
01256   szBuf = NULL;
01257
01258   if (uiCodepage != 0) // 0 is language neutral
01259   {
01260     _tprintf(TEXT("LOG_ERROR>> DATABASE IS NOT LANGUAGE NEUTRAL. CANNOT EXPORT\n"));
01261     _tprintf(TEXT("LOG_ERROR>> CURRENT CODEPAGE IS %d\n"), uiCodepage);
01262     CloseHandle(hFile);
01263     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01264   }
01265   if (!CloseHandle(hFile))
01266     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01267
01268   return ERROR_SUCCESS;
01269 }
01270
01271 /////////////////////////////////////////////////////////////////////////////
01272 // CGenerateRC::OutputDialogInit
01273 UINT CGenerateRC::OutputDialogInit(BOOL fBinary)
01274 {
01275   UINT iStat;
01276   if (ERROR_SUCCESS != (iStat = Initialize()))
01277     return m_fError = TRUE, iStat; // error - ABORT
01278
01279   // only output if Dialog table exists
01280   MSICONDITION eCond = MsiDatabaseIsTablePersistent(m_hDatabase, TEXT("Dialog"));
01281   if (eCond == MSICONDITION_ERROR)
01282   {
01283     _tprintf(TEXT("LOG_ERROR>> MsiDatabaseIsTablePersistent(Dialog)\n"));
01284     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01285   }
01286   // require PERSISTENT tables
01287   if (eCond != MSICONDITION_TRUE)
01288   {
01289     _tprintf(TEXT("LOG>> Dialog table is not persistent or does not exist\n"));
01290     return ERROR_SUCCESS;
01291   }
01292
01293   /**********************************************************************************
01294    create internal table for mapping DIALOGS to Dialogs (resource file stores
01295    strings IDs in ALL CAPS.  Installer is case-sensitive
01296    TABLE: _RESDialogs
01297    COLUMNS: RCStr (String, Primary Key), Dialog (String, Primary Key)
01298   ***********************************************************************************/
01299
01300   // see if _RESDialogs table is already there
01301   MSICONDITION eCondition = MsiDatabaseIsTablePersistent(m_hDatabase, TEXT("_RESDialogs"));
01302   if (eCondition == MSICONDITION_TRUE)
01303   {
01304     // table persistent
01305 #ifdef DEBUG
01306     _tprintf(TEXT("LOG>> _RESDialogs Table is Present.\n"));
01307 #endif
01308   }
01309   else if (eCondition == MSICONDITION_FALSE || eCondition == MSICONDITION_ERROR) // error or table temporary
01310     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01311   else
01312   {
01313     // table not exist -- create it
01314     PMSIHANDLE h_DlgMarkingView = 0;
01315     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlCreateDlgMap, &h_DlgMarkingView))
01316       || ERROR_SUCCESS != (iStat = MsiViewExecute(h_DlgMarkingView, 0)))
01317       return m_fError = TRUE, iStat; // error - ABORT
01318   }
01319
01320   /**********************************************************************************
01321    create internal table for managing resource IDs of controls
01322    TABLE: _RESControls
01323    COLUMNS: Dialog_ (String, Primary Key), Control_ (String, Primary Key), RCID (Int)
01324   ***********************************************************************************/
01325
01326   // see if _RESControls table is already there
01327   eCondition = MsiDatabaseIsTablePersistent(m_hDatabase, TEXT("_RESControls"));
01328   if (eCondition == MSICONDITION_TRUE)
01329   {
01330     // table persistent
01331     // find the last resource Id
01332     PMSIHANDLE hViewSelMaxRc = 0;
01333     PMSIHANDLE hRecMaxRc = 0;
01334     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlSelMaxRcId, &hViewSelMaxRc))
01335       || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewSelMaxRc, 0))
01336       || ERROR_SUCCESS != (iStat = MsiViewFetch(hViewSelMaxRc, &hRecMaxRc)))
01337       return m_fError = TRUE, iStat; // error - ABORT
01338
01339     // update resource Id
01340     m_iCtrlResID = MsiRecordGetInteger(hRecMaxRc, 1);
01341
01342 #ifdef DEBUG
01343   _tprintf(TEXT("LOG>> _RESControls Table is Present. MAX RES ID = %d\n"), m_iCtrlResID);
01344 #endif
01345
01346   }
01347   else if (eCondition == MSICONDITION_ERROR || eCondition == MSICONDITION_FALSE) // error or temporary
01348     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
01349   else
01350   {
01351     // table not exist -- create it
01352     PMSIHANDLE h_CtrlMarkingView = 0;
01353     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlCreateCtrlMark, &h_CtrlMarkingView))
01354       || ERROR_SUCCESS != (iStat = MsiViewExecute(h_CtrlMarkingView, 0)))
01355       return m_fError = TRUE, iStat; // error - ABORT
01356   }
01357
01358 #ifdef DEBUG
01359   _tprintf(TEXT("LOG>>...BEGIN WRITING DIALOG DATA TO RESOURCE FILE...\n"));
01360 #endif
01361
01362   return ERROR_SUCCESS;
01363 }
01364
01365 /////////////////////////////////////////////////////////////////////////////
01366 // CGenerateRC::OutputDialogs
01367 UINT CGenerateRC::OutputDialogs(BOOL fBinary)
01368 {
01369   // write out each dialog in Dialog table
01370   // According to MSDN, new applications should use DIALOGEX resource instead of DIALOG
01371
01372   UINT iStat;
01373   if (ERROR_SUCCESS != (iStat = OutputDialogInit(fBinary)))
01374     return m_fError = TRUE, iStat; // error - ABORT
01375
01376     // write out the bitmaps and icons from the Binary table
01377 #ifdef DEBUG
01378   if (!fBinary)
01379     _tprintf(TEXT("LOG>> SKIPPING Binary data export.\n"));
01380 #endif
01381   if (fBinary && !m_fWroteBinary && !WriteBinaries())
01382     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01383
01384   // prepare Dialog strResource --> Dialog mapping table
01385   PMSIHANDLE hViewDlgMap = 0;
01386   PMSIHANDLE hRecDlgMap = MsiCreateRecord(2);
01387   PMSIHANDLE hViewDialog = 0;
01388   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlDlgMap, &hViewDlgMap))
01389     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewDlgMap, 0))
01390     || ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlDialog, &hViewDialog))
01391     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewDialog, 0)))
01392     return m_fError = TRUE, iStat; // error - ABORT
01393
01394   // fetch all row records of dialogs from Dialog table and output to .rc file
01395   PMSIHANDLE hRecDialog = 0;
01396   while (ERROR_NO_MORE_ITEMS != (iStat = MsiViewFetch(hViewDialog, &hRecDialog)))
01397   {
01398     if (ERROR_SUCCESS != iStat)
01399       return m_fError = TRUE, iStat; // error - ABORT
01400
01401     // use dialog name as nameID
01402     // Reasoning: guarantees uniqueness since Dialog name is primary key of table
01403     // Potential caveat:  Dialog strId is stored in ALL CAPS. Installer is case-sensitive
01404     //   so we must store a mapping between this and original.  Could have case where we
01405     //   try Action1 and ACTion1 as two different strIds.  RC will fail on this
01406
01407     // 1st call, obtain size needed
01408     // 2nd call, get string
01409     DWORD cchDialog = 0;
01410     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecDialog, idcName, TEXT(""), &cchDialog)))
01411       return m_fError = TRUE, iStat;
01412     TCHAR* szDialog = new TCHAR[++cchDialog];
01413     if ( !szDialog )
01414       return m_fError = TRUE, ERROR_OUTOFMEMORY;
01415     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecDialog, idcName, szDialog, &cchDialog)))
01416     {
01417       delete [] szDialog;
01418       return m_fError = TRUE, iStat; // error - ABORT
01419     }
01420
01421     // update Dialog Mapping table with information
01422     if (ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecDlgMap, 2, szDialog)))
01423     {
01424       delete [] szDialog;
01425       return m_fError = TRUE, iStat;
01426     }
01427
01428     DWORD cchTempDialog = _tcslen(szDialog) + 1;
01429     TCHAR* szTempDialog = new TCHAR[cchTempDialog];
01430     if ( !szTempDialog )
01431     {
01432       delete [] szDialog;
01433       return m_fError = TRUE, ERROR_OUTOFMEMORY;
01434     }
01435
01436     if (FAILED(StringCchCopy(szTempDialog, cchTempDialog, szDialog)))
01437     {
01438       delete [] szDialog;
01439       delete [] szTempDialog;
01440       return m_fError = TRUE, ERROR_FUNCTION_FAILED;
01441     }
01442
01443     // resource file format -- ALL CAPS
01444     if (ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecDlgMap, 1, _tcsupr(szTempDialog))))
01445     {
01446       delete [] szDialog;
01447       delete [] szTempDialog;
01448       return m_fError = TRUE, iStat;
01449     }
01450
01451     // update _RESDialogs table, note:  we will overwrite pre-existing. Rely on rc.exe to bail
01452     if (ERROR_SUCCESS != (iStat = MsiViewModify(hViewDlgMap, MSIMODIFY_ASSIGN, hRecDlgMap)))
01453     {
01454       delete [] szDialog;
01455       delete [] szTempDialog;
01456       return m_fError = TRUE, iStat; // error - ABORT
01457     }
01458
01459     // get x, y, wd, ht, and attrib values
01460     int x,y,wd,ht,attrib;
01461     x      = MsiRecordGetInteger(hRecDialog, idcX);
01462     y      = MsiRecordGetInteger(hRecDialog, idcY);
01463     wd     = MsiRecordGetInteger(hRecDialog, idcWd);
01464     ht     = MsiRecordGetInteger(hRecDialog, idcHt);
01465     attrib = MsiRecordGetInteger(hRecDialog, idcAttrib);
01466
01467
01468     // obtain title of dialog
01469     DWORD cchTitle = 0;
01470     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecDialog, idcTitle, TEXT(""), &cchTitle)))
01471     {
01472       delete [] szDialog;
01473       delete [] szTempDialog;
01474       return m_fError = TRUE, iStat;
01475     }
01476
01477     TCHAR* szTitle = new TCHAR[++cchTitle];
01478     if ( !szTitle )
01479     {
01480       delete [] szDialog;
01481       delete [] szTempDialog;
01482       return m_fError = TRUE, ERROR_OUTOFMEMORY;
01483     }
01484     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecDialog, idcTitle, szTitle, &cchTitle)))
01485     {
01486       delete [] szDialog;
01487       delete [] szTempDialog;
01488       delete [] szTitle;
01489       return m_fError = TRUE, iStat; // error - ABORT
01490     }
01491
01492     if (!WriteDialogToRC(szDialog, szTitle, x, y, wd, ht, attrib))
01493     {
01494       delete [] szDialog;
01495       delete [] szTempDialog;
01496       delete [] szTitle;
01497       return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01498     }
01499
01500     delete [] szDialog;
01501     szDialog = NULL;
01502     delete [] szTempDialog;
01503     szTempDialog = NULL;
01504     delete [] szTitle;
01505     szTitle = NULL;
01506   }
01507
01508   if (ERROR_SUCCESS != (iStat = OutputDialogFinalize()))
01509     return m_fError = TRUE, iStat; // error - ABORT
01510
01511
01512   // return success
01513   return ERROR_SUCCESS;
01514 }
01515
01516 /////////////////////////////////////////////////////////////////////////////
01517 // CGenerateRC::OutputDialog
01518 UINT CGenerateRC::OutputDialog(TCHAR* szDialog, BOOL fBinary)
01519 {
01520   // write out specified dialog in Dialog table
01521   // According to MSDN, new applications should use DIALOGEX resource instead of DIALOG
01522
01523   UINT iStat;
01524   if (ERROR_SUCCESS != (iStat = OutputDialogInit(fBinary)))
01525     return m_fError = TRUE, iStat; // error - ABORT
01526
01527   // prepare Dialog strResource --> Dialog mapping table
01528   PMSIHANDLE hViewDlgMap = 0;
01529   PMSIHANDLE hViewDialog = 0;
01530   PMSIHANDLE hRecDlgMap = MsiCreateRecord(2);
01531   PMSIHANDLE hRecFindDlg = MsiCreateRecord(1);
01532   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlDlgMap, &hViewDlgMap))
01533     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewDlgMap, 0))
01534     || ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlDialogSpecific, &hViewDialog))
01535     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecFindDlg, 1, szDialog))
01536     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewDialog, hRecFindDlg)))
01537     return m_fError = TRUE, iStat; // error - ABORT
01538
01539   // fetch specified Dialog from Dialog table and output to .rc file
01540   PMSIHANDLE hRecDialog = 0;
01541   if (ERROR_SUCCESS == (iStat = MsiViewFetch(hViewDialog, &hRecDialog)))
01542   {
01543     // write out the bitmaps and icons from the Binary table
01544 #ifdef DEBUG
01545     if (!fBinary)
01546       _tprintf(TEXT("LOG>> SKIPPING Binary data export.\n"));
01547 #endif
01548     if (fBinary && !m_fWroteBinary && !WriteBinaries())
01549       return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01550
01551     // use dialog name as nameID
01552     // Reasoning: guarantees uniqueness since Dialog name is primary key of table
01553     // Potential caveat:  Dialog strId is stored in ALL CAPS. Installer is case-sensitive
01554     //   so we must store a mapping between this and original.  Could have case where we
01555     //   try Action1 and ACTion1 as two different strIds.  RC will fail on this
01556
01557     // update Dialog Mapping table with information
01558     if (ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecDlgMap, 2, szDialog)))
01559       return m_fError = TRUE, iStat;
01560
01561     DWORD cchTempDialog = _tcslen(szDialog) + 1;
01562     TCHAR* szTempDialog = new TCHAR[cchTempDialog];
01563     if ( !szTempDialog )
01564       return m_fError = TRUE, ERROR_OUTOFMEMORY;
01565
01566     if (FAILED(StringCchCopy(szTempDialog, cchTempDialog, szDialog)))
01567     {
01568       delete [] szTempDialog;
01569       return m_fError = TRUE, ERROR_FUNCTION_FAILED;
01570     }
01571
01572     // resource file format, ALL CAPS
01573     if (ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecDlgMap, 1, _tcsupr(szTempDialog))))
01574     {
01575       delete [] szTempDialog;
01576       return m_fError = TRUE, iStat;
01577     }
01578
01579     // update _RESDialogs table, note:  we will overwrite pre-existing. Rely on rc.exe to bail
01580     if (ERROR_SUCCESS != (iStat = MsiViewModify(hViewDlgMap, MSIMODIFY_ASSIGN, hRecDlgMap)))
01581     {
01582       delete [] szTempDialog;
01583       return m_fError = TRUE, iStat; // error - ABORT
01584     }
01585
01586     // get x, y, wd, ht, and attrib values
01587     int x,y,wd,ht,attrib;
01588     x      = MsiRecordGetInteger(hRecDialog, idcX);
01589     y      = MsiRecordGetInteger(hRecDialog, idcY);
01590     wd     = MsiRecordGetInteger(hRecDialog, idcWd);
01591     ht     = MsiRecordGetInteger(hRecDialog, idcHt);
01592     attrib = MsiRecordGetInteger(hRecDialog, idcAttrib);
01593
01594
01595     // obtain title of dialog
01596     DWORD cchTitle = 0;
01597     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecDialog, idcTitle, TEXT(""), &cchTitle)))
01598     {
01599       delete [] szTempDialog;
01600       return m_fError = TRUE, iStat;
01601     }
01602
01603     TCHAR* szTitle = new TCHAR[++cchTitle];
01604     if ( !szTitle )
01605     {
01606       delete [] szTempDialog;
01607       return m_fError = TRUE, ERROR_OUTOFMEMORY;
01608     }
01609
01610     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecDialog, idcTitle, szTitle, &cchTitle)))
01611     {
01612       delete [] szTempDialog;
01613       delete [] szTitle;
01614       return m_fError = TRUE, iStat; // error - ABORT
01615     }
01616
01617     if (!WriteDialogToRC(szDialog, szTitle, x, y, wd, ht, attrib))
01618     {
01619       delete [] szTempDialog;
01620       delete [] szTitle;
01621       return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
01622     }
01623
01624     delete [] szTempDialog;
01625     szTempDialog = NULL;
01626
01627     delete [] szTitle;
01628     szTitle = NULL;
01629
01630   }
01631   else if (ERROR_NO_MORE_ITEMS == iStat)
01632   {
01633     _tprintf(TEXT("LOG_ERROR>> Dialog '%s' not found in Dialog table\n"), szDialog);
01634     if (ERROR_SUCCESS != (iStat = OutputDialogFinalize()))
01635       return m_fError = TRUE, iStat;
01636     return ERROR_SUCCESS; // error, but not fatal...keep processing
01637   }
01638   else
01639   {
01640     _tprintf(TEXT("LOG_ERROR>> MsiViewFetch(specific dialog)\n"));
01641     return iStat;
01642   }
01643
01644   if (ERROR_SUCCESS != (iStat = OutputDialogFinalize()))
01645     return m_fError = TRUE, iStat; // error - ABORT
01646
01647   return ERROR_SUCCESS;
01648 }
01649
01650 /////////////////////////////////////////////////////////////////////////////
01651 // CGenerateRC::EscapeSlashAndQuteForRc
01652 TCHAR* CGenerateRC::EscapeSlashAndQuoteForRC(TCHAR* szStr)
01653 {
01654   TCHAR* szNewStr = 0;
01655
01656   // check for NULL str
01657   if (szStr == 0)
01658     return szNewStr;
01659
01660   // determine if str contains any esc char
01661   int cEscChar = 0;
01662   TCHAR* pch = szStr;
01663   while (*pch != 0)
01664   {
01665     if (*pch == TEXT('\\') || *pch == TEXT('"'))
01666       cEscChar++;
01667     pch++;
01668   }
01669
01670   if (cEscChar == 0)
01671   {
01672     int iLen = _tcslen(szStr) + 1; // for null
01673     szNewStr = new TCHAR[iLen];
01674     if ( !szNewStr )
01675       return NULL;
01676     if (FAILED(StringCchCopy(szNewStr, iLen, szStr)))
01677     {
01678       delete [] szNewStr;
01679       return NULL;
01680     }
01681   }
01682   else
01683   {
01684     int iLen = _tcslen(szStr) + 1 + cEscChar;
01685     szNewStr = new TCHAR[iLen];
01686     if ( !szNewStr )
01687       return NULL;
01688     pch = szStr;
01689     TCHAR* pchNew = szNewStr;
01690     while (*pch != 0)
01691     {
01692       if (*pch == TEXT('\\'))
01693         *pchNew++ = TEXT('\\');
01694       else if (*pch == TEXT('"'))
01695         *pchNew++ = TEXT('"');
01696       *pchNew++ = *pch++;
01697     }
01698     *pchNew = TEXT('\0');
01699   }
01700
01701   return szNewStr;
01702 }
01703
01704 /////////////////////////////////////////////////////////////////////////////
01705 // CGenerateRC::WriteDialogToRC
01706 BOOL CGenerateRC::WriteDialogToRC(TCHAR* szDialog, TCHAR* szTitle, int x, int y, int wd, int ht, int attrib)
01707 {
01708 #ifdef DEBUG
01709   _tprintf(TEXT("LOG>> Writing <%s> Dialog\n"), szDialog);
01710 #endif
01711   // Format for DIALOGEX is:
01712   // nameID DIALOGEX x, y, width, height [ , helpID]]  [[ optional-statements]]  {control-statements}
01713
01714   // write out to file
01715
01716   DWORD dwWritten;
01717   /*nameId*/
01718   if (!WriteFile(m_hFile, szDialog, _tcslen(szDialog)*sizeof(TCHAR), &dwWritten, 0))
01719     m_cWriteFileErr++;
01720   /*<tab>DIALOGEX*/
01721   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
01722     m_cWriteFileErr++;
01723   if (!WriteFile(m_hFile, resDialog, sizeof(resDialog)-sizeof(TCHAR), &dwWritten, 0))
01724     m_cWriteFileErr++;
01725   /*x, y, wd, ht DIMENSIONS*/
01726   if (!PrintDimensions(x, y, wd, ht))
01727     return m_fError = TRUE, FALSE; // error - ABORT
01728
01729   // At this point, one could optionally output the HelpId
01730
01731   /*<tab>CAPTION<tab>"str"*/
01732   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
01733     m_cWriteFileErr++;
01734   if (!WriteFile(m_hFile, tokCaption, sizeof(tokCaption)-sizeof(TCHAR), &dwWritten, 0))
01735     m_cWriteFileErr++;
01736   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
01737     m_cWriteFileErr++;
01738   if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
01739     m_cWriteFileErr++;
01740
01741   // escape chars in str
01742   TCHAR* szEscTitle = EscapeSlashAndQuoteForRC(szTitle);
01743   if ( !szEscTitle )
01744     return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
01745   if (_tcslen(szEscTitle) > iMaxResStrLen)
01746   {
01747     _tprintf(TEXT("!! >> STR TOO LONG FOR RC FILE >> DIALOG: %s\n"), szDialog);
01748     if (FAILED(StringCchCopy(szEscTitle, _tcslen(szEscTitle) + 1, strOverLimit)))
01749     {
01750       delete [] szEscTitle;
01751       return m_fError = TRUE, FALSE;
01752     }
01753   }
01754   if (!WriteFile(m_hFile, szEscTitle, _tcslen(szEscTitle)*sizeof(TCHAR), &dwWritten, 0))
01755     m_cWriteFileErr++;
01756
01757   delete [] szEscTitle;
01758
01759   if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
01760     m_cWriteFileErr++;
01761   //attributes are ignored at this time (would require conversion from Installer to Windows and masking of Installer specific)
01762   /*<tab>{*/
01763   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
01764     m_cWriteFileErr++;
01765   if (!WriteFile(m_hFile, szCurlyBeg, sizeof(szCurlyBeg)-sizeof(TCHAR), &dwWritten, 0))
01766     m_cWriteFileErr++;
01767
01768   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
01769     m_cWriteFileErr++;
01770   // Select all controls associated with said dialog and output
01771   if (!OutputControls(szDialog))
01772     return m_fError = TRUE, FALSE; // error - ABORT
01773   if (!WriteFile(m_hFile, szCurlyEnd, sizeof(szCurlyEnd)-sizeof(TCHAR), &dwWritten, 0))
01774     m_cWriteFileErr++;
01775   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
01776     m_cWriteFileErr++;
01777
01778   // whitespace in .rc file for readability
01779   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
01780     m_cWriteFileErr++;
01781   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
01782     m_cWriteFileErr++;
01783
01784
01785   // return success
01786   return TRUE;
01787 }
01788
01789 /////////////////////////////////////////////////////////////////////////////
01790 // CGenerateRC::PrintDimensions
01791 BOOL CGenerateRC::PrintDimensions(int x, int y, int wd, int ht)
01792 {
01793   TCHAR szTempBuf[64] = {0};
01794   DWORD dwWritten;
01795
01796   /*<tab>x*/
01797   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
01798     m_cWriteFileErr++;
01799
01800   if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), x)))
01801     return m_fError = TRUE, FALSE;
01802
01803   if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
01804     m_cWriteFileErr++;
01805   /*,<tab>y*/
01806   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
01807     m_cWriteFileErr++;
01808
01809   if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), y)))
01810     return m_fError = TRUE, FALSE;
01811
01812   if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
01813     m_cWriteFileErr++;
01814   /*,<tab>wd*/
01815   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
01816     m_cWriteFileErr++;
01817
01818   if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), wd)))
01819     return m_fError = TRUE, FALSE;
01820
01821   if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
01822     m_cWriteFileErr++;
01823   /*,<tab>ht*/
01824   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
01825     m_cWriteFileErr++;
01826
01827   if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), ht)))
01828     return m_fError = TRUE, FALSE;
01829   if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
01830     m_cWriteFileErr++;
01831
01832   // return success
01833   return TRUE;
01834 }
01835
01836 /////////////////////////////////////////////////////////////////////////////
01837 // CGenerateRC::OutputControls
01838 BOOL CGenerateRC::OutputControls(TCHAR* szDialog)
01839 {
01840   // It's possible that one could output the controls in the correct tab order.
01841   // It's fairly easy for export if you remember to output
01842   // all non tab order controls first.  The Control_Next column of the Control table would be
01843   // used as well as the Control_First column of the Dialog table.  Control_First is the start
01844   // of the tab order.  Control_Next is the next control in the tab order.  It is difficult to
01845   // handle the tab order when importing if you allow the tab order to change between export
01846   // and import.
01847   UINT iStat;
01848
01849   // only have controls to write if Control table exists
01850   MSICONDITION eCond = MsiDatabaseIsTablePersistent(m_hDatabase, TEXT("Control"));
01851   if (eCond == MSICONDITION_ERROR)
01852   {
01853     _tprintf(TEXT("LOG_ERROR>> MsiDatabaseIsTablePersistent(Control)\n"));
01854     return m_fError = TRUE, FALSE; // error - ABORT
01855   }
01856   // require Control table to be persistent
01857   if (eCond != MSICONDITION_TRUE)
01858   {
01859     _tprintf(TEXT("LOG: Control table is not persistent or present\n"));
01860     return TRUE;
01861   }
01862
01863   // open view on Control table
01864   PMSIHANDLE hViewControl = 0;
01865   PMSIHANDLE hRec = MsiCreateRecord(1);
01866   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlControl, &hViewControl))
01867     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRec, 1, szDialog))
01868     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewControl, hRec)))
01869     return m_fError = TRUE, FALSE; // error - ABORT
01870
01871   // begin fetching rows from Control table
01872   PMSIHANDLE hRecControl = 0;
01873   while (ERROR_NO_MORE_ITEMS != (iStat = MsiViewFetch(hViewControl, &hRecControl)))
01874   {
01875     if (ERROR_SUCCESS != iStat)
01876       return m_fError = TRUE, FALSE; // error - ABORT
01877
01878
01879     /**********************************************
01880      obtain all values for control
01881     ***********************************************/
01882     // control's type determines how control is output to resource file
01883     // 1st call, obtain size needed
01884     // 2nd call, get string
01885
01886     DWORD cchLen = 0;
01887     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecControl, iccType, TEXT(""), &cchLen)))
01888       return m_fError = TRUE, FALSE;
01889     TCHAR* szCtrlType = new TCHAR[++cchLen];
01890     if ( !szCtrlType )
01891       return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
01892
01893     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecControl, iccType, szCtrlType, &cchLen)))
01894     {
01895       delete [] szCtrlType;
01896       return m_fError = TRUE, FALSE; // error - ABORT
01897     }
01898
01899     cchLen = 0;
01900     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecControl, iccName, TEXT(""), &cchLen)))
01901     {
01902       delete [] szCtrlType;
01903       return m_fError = TRUE, FALSE;
01904     }
01905     TCHAR* szCtrlName = new TCHAR[++cchLen];
01906     if ( !szCtrlName )
01907     {
01908       delete [] szCtrlType;
01909       return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
01910     }
01911     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecControl, iccName, szCtrlName, &cchLen)))
01912     {
01913       delete [] szCtrlType;
01914       delete [] szCtrlName;
01915       return m_fError = TRUE, FALSE; // error - ABORT
01916     }
01917
01918     cchLen = 0;
01919     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecControl, iccText, TEXT(""), &cchLen)))
01920     {
01921       delete [] szCtrlType;
01922       delete [] szCtrlName;
01923       return m_fError = TRUE, FALSE; // error - ABORT
01924     }
01925     TCHAR* szCtrlText = new TCHAR[++cchLen];
01926     if ( !szCtrlText )
01927     {
01928       delete [] szCtrlType;
01929       delete [] szCtrlName;
01930       return m_fError = TRUE, FALSE; // error - ABORT
01931     }
01932     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecControl, iccText, szCtrlText, &cchLen)))
01933     {
01934       delete [] szCtrlType;
01935       delete [] szCtrlName;
01936       delete [] szCtrlText;
01937       return m_fError = TRUE, FALSE; // error - ABORT
01938     }
01939
01940     cchLen = 0;
01941     if (ERROR_MORE_DATA != (iStat = MsiRecordGetString(hRecControl, iccProperty, TEXT(""), &cchLen)))
01942     {
01943       delete [] szCtrlType;
01944       delete [] szCtrlName;
01945       delete [] szCtrlText;
01946       return m_fError = TRUE, FALSE; // error - ABORT
01947     }
01948     TCHAR* szCtrlProperty = new TCHAR[++cchLen];
01949     if ( !szCtrlProperty )
01950     {
01951       delete [] szCtrlType;
01952       delete [] szCtrlName;
01953       delete [] szCtrlText;
01954       return m_fError = TRUE, FALSE; // error - ABORT
01955     }
01956     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecControl, iccProperty, szCtrlProperty, &cchLen)))
01957     {
01958       delete [] szCtrlType;
01959       delete [] szCtrlName;
01960       delete [] szCtrlText;
01961       delete [] szCtrlProperty;
01962       return m_fError = TRUE, FALSE; // error - ABORT
01963     }
01964
01965     // get x, y, wd, ht, and attrib values
01966     int x,y,wd,ht,attrib;
01967     x      = MsiRecordGetInteger(hRecControl, iccX);
01968     y      = MsiRecordGetInteger(hRecControl, iccY);
01969     wd     = MsiRecordGetInteger(hRecControl, iccWd);
01970     ht     = MsiRecordGetInteger(hRecControl, iccHt);
01971     attrib = MsiRecordGetInteger(hRecControl, iccAttrib);
01972
01973 #ifdef DEBUG
01974   _tprintf(TEXT("LOG>>\tWriting control <%s>\n"), szCtrlName);
01975 #endif
01976
01977     if (!WriteControlToRC(szDialog, szCtrlName, szCtrlType, szCtrlText, szCtrlProperty, x, y, wd, ht, attrib))
01978     {
01979       delete [] szCtrlType;
01980       delete [] szCtrlName;
01981       delete [] szCtrlText;
01982       delete [] szCtrlProperty;
01983       return m_fError = TRUE, FALSE; // error - ABORT
01984     }
01985   }
01986
01987   // return success
01988   return TRUE;
01989 }
01990
01991 //////////////////////////////////////////////////////////////////////////////////////
01992 // NOTES:
01993 // 1.)Output control to RC file according to control type
01994 // 2.)For simplicity, controls are classified into two types:
01995 //                StdWinCtrl and Win32Ctrl.
01996 //    StdWinCtrl = PushButtons, RadioButtons, ComboBoxes, and ListBoxes
01997 //    Win32Ctrl  = ListView, ComboBox, etc.
01998 //
01999 // 3.)Some controls used in the installer are simply StdWinCtrls with special
02000 //      attributes set
02001 //
02002 // 4.)Bitmaps and Icons should be output to prevent improper resizing of dialogs.
02003 //      If a dialog were shrunk, the display area could be reduced to the point where
02004 //      the bitmap or icon would not be shown correctly
02005 ///////////////////////////////////////////////////////////////////////////////////////
02006
02007 /////////////////////////////////////////////////////////////////////////////
02008 // CGenerateRC::WriteControlToRC
02009 BOOL CGenerateRC::WriteControlToRC(TCHAR* szDialog, TCHAR* szCtrlName, TCHAR* szCtrlType, TCHAR* szCtrlText, TCHAR* szCtrlProperty, int x,
02010                    int y, int wd, int ht, int attrib)
02011 {
02012   assert(szCtrlType != NULL);
02013
02014   int iResId = 0;
02015   // attempt to find resource ID if previously used
02016   DWORD cchFindIdSQL = _tcslen(sqlFindResId) + _tcslen(szDialog) + _tcslen(szCtrlName) + 1;
02017   TCHAR* szFindIdSQL = new TCHAR[cchFindIdSQL];
02018   if ( !szFindIdSQL )
02019     return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02020
02021   if (FAILED(StringCchPrintf(szFindIdSQL, cchFindIdSQL, sqlFindResId, szDialog, szCtrlName)))
02022   {
02023     delete [] szFindIdSQL;
02024     return m_fError = TRUE, FALSE;
02025   }
02026
02027   PMSIHANDLE hViewFindRes = 0;
02028   PMSIHANDLE hRecFindRes = 0;
02029   UINT iStat;
02030   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, szFindIdSQL, &hViewFindRes)))
02031   {
02032     delete [] szFindIdSQL;
02033     return m_fError = TRUE, FALSE; // error - ABORT
02034   }
02035
02036   delete [] szFindIdSQL;
02037   szFindIdSQL = NULL;
02038
02039   if (ERROR_SUCCESS != (iStat = MsiViewExecute(hViewFindRes, 0)))
02040     return m_fError = TRUE, FALSE; // error - ABORT
02041   if (ERROR_SUCCESS == (iStat = MsiViewFetch(hViewFindRes, &hRecFindRes)))
02042   {
02043     // grab res id
02044     iResId = MsiRecordGetInteger(hRecFindRes, 1);
02045   }
02046   else if (ERROR_NO_MORE_ITEMS == iStat)
02047   {
02048     // use next available resource Id
02049     iResId = ++m_iCtrlResID;
02050   }
02051   else
02052     return m_fError = TRUE, FALSE; // error - ABORT
02053
02054
02055   if (0 == _tcscmp(szCtrlType, szMsiPushbutton))
02056   {
02057     // StdWin
02058     if (!WriteStdWinCtrl(iResId, resPushButton, szCtrlText, x, y, wd, ht, attrib))
02059       return m_fError = TRUE, FALSE; // error - ABORT
02060   }
02061   else if (0 == _tcscmp(szCtrlType, szMsiText))
02062   {
02063     // Win32
02064     if (!WriteWin32Ctrl(iResId, resStaticClass, szCtrlText, TEXT("SS_LEFT"), x, y, wd, ht, attrib))
02065       return m_fError = TRUE, FALSE; // error - ABORT
02066   }
02067   else if (0 == _tcscmp(szCtrlType, szMsiBillboard))
02068   {
02069     // StdWin
02070     // output GROUPBOX for placeholder for billboard
02071     // it's possible one could output Billboards here, but you would need to connect changes in
02072     // the billboard size back and forth with the dialog dimensions on which it is displayed
02073     if (!WriteStdWinCtrl(iResId, resGroupBox, szCtrlText, x, y, wd, ht, attrib))
02074       return m_fError = TRUE, FALSE;
02075   }
02076   else if (0 == _tcscmp(szCtrlType, szMsiVolumeCostList))
02077   {
02078     // Win32
02079     if (!WriteWin32Ctrl(iResId, resListViewClass, szCtrlText, TEXT("WS_GROUP"), x, y, wd, ht, attrib))
02080       return m_fError = TRUE, FALSE; // error - ABORT
02081   }
02082   else if (0 == _tcscmp(szCtrlType, szMsiCheckBox))
02083   {
02084     // StdWin
02085     if (!WriteStdWinCtrl(iResId, resCheckBox, szCtrlText, x, y, wd, ht, attrib))
02086       return m_fError = TRUE, FALSE; // error - ABORT
02087   }
02088   else if (0 == _tcscmp(szCtrlType, szMsiGroupBox))
02089   {
02090     // StdWin
02091     if (!WriteStdWinCtrl(iResId, resGroupBox, szCtrlText, x, y, wd, ht, attrib))
02092       return m_fError = TRUE, FALSE; // error - ABORT
02093   }
02094   else if (0 == _tcscmp(szCtrlType, szMsiRadioButtonGroup))
02095   {
02096     // StdWin
02097     if (!WriteStdWinCtrl(iResId, resGroupBox, szCtrlText, x, y, wd, ht, attrib))
02098       return m_fError = TRUE, FALSE; // error - ABORT
02099     // write out radiobuttons
02100     if (!WriteRadioButtons(szDialog, szCtrlName, szCtrlProperty, x, y, attrib))
02101       return m_fError = TRUE, FALSE; // error - ABORT
02102   }
02103   else if (0 == _tcscmp(szCtrlType, szMsiListBox))
02104   {
02105     // Win32
02106     if (!WriteWin32Ctrl(iResId, resListBoxClass, szCtrlText, TEXT("LBS_STANDARD"), x, y, wd, ht, attrib))
02107       return m_fError = TRUE, FALSE; // error - ABORT
02108   }
02109   else if ((0 == _tcscmp(szCtrlType, szMsiEdit))
02110         || (0 == _tcscmp(szCtrlType, szMsiPathEdit))
02111         || (0 == _tcscmp(szCtrlType, szMsiMaskedEdit)))
02112   {
02113     // Win32
02114     if (!WriteWin32Ctrl(iResId, resEditClass, szCtrlText, TEXT("0x000"), x, y, wd, ht, attrib))
02115       return m_fError = TRUE, FALSE; // error - ABORT
02116   }
02117   else if (0 == _tcscmp(szCtrlType, szMsiProgressBar))
02118   {
02119     // Win32
02120     if (!WriteWin32Ctrl(iResId, resProgBar32Class, szCtrlText, TEXT("0x000"), x, y, wd, ht, attrib))
02121       return m_fError = TRUE, FALSE; // error - ABORT
02122   }
02123   else if (0 == _tcscmp(szCtrlType, szMsiDirList))
02124   {
02125     // Win32
02126     if (!WriteWin32Ctrl(iResId, resListViewClass, szCtrlText, TEXT("WS_BORDER"), x, y, wd, ht, attrib))
02127       return m_fError = TRUE, FALSE; // error - ABORT
02128   }
02129   else if (0 == _tcscmp(szCtrlType, szMsiList))
02130   {
02131     // Win32
02132     if (!WriteWin32Ctrl(iResId, resListViewClass, szCtrlText, TEXT("WS_BORDER"), x, y, wd, ht, attrib))
02133       return m_fError = TRUE, FALSE; // error - ABORT
02134   }
02135   else if (0 == _tcscmp(szCtrlType, szMsiComboBox))
02136   {
02137     // Win32
02138     if (!WriteWin32Ctrl(iResId, resComboBoxClass, szCtrlText, TEXT("CBS_AUTOHSCROLL"), x, y, wd, ht, attrib))
02139       return m_fError = TRUE, FALSE; // error - ABORT
02140   }
02141   else if (0 == _tcscmp(szCtrlType, szMsiDirCombo))
02142   {
02143     // Win32
02144     if (!WriteWin32Ctrl(iResId, resComboBoxClass, szCtrlText, TEXT("WS_VSCROLL"), x, y, wd, ht, attrib))
02145       return m_fError = TRUE, FALSE; // error - ABORT
02146   }
02147   else if (0 == _tcscmp(szCtrlType, szMsiVolSelCombo))
02148   {
02149     // Win32
02150     if (!WriteWin32Ctrl(iResId, resComboBoxClass, szCtrlText, TEXT("WS_VSCROLL"), x, y, wd, ht, attrib))
02151       return m_fError = TRUE, FALSE; // error - ABORT
02152   }
02153   else if (0 == _tcscmp(szCtrlType, szMsiBitmap))
02154   {
02155     // Win32
02156     if (!WriteWin32Ctrl(iResId, resStaticClass, szCtrlText, TEXT("SS_BITMAP | SS_CENTERIMAGE"), x, y, wd, ht, attrib))
02157       return m_fError = TRUE, FALSE; // error - ABORT
02158   }
02159   else if (0 == _tcscmp(szCtrlType, szMsiIcon))
02160   {
02161     // Win32
02162     if (!WriteWin32Ctrl(iResId, resStaticClass, szCtrlText, TEXT("SS_ICON | SS_CENTERIMAGE"), x, y, wd, ht, attrib))
02163       return m_fError = TRUE, FALSE; // error - ABORT
02164   }
02165   else if (0 == _tcscmp(szCtrlType, szMsiSelTree))
02166   {
02167     // Win32
02168     if (!WriteWin32Ctrl(iResId, resSelTreeClass, szCtrlText, TEXT("WS_BORDER"), x, y, wd, ht, attrib))
02169       return m_fError = TRUE, FALSE; // error - ABORT
02170   }
02171   else if (0 == _tcscmp(szCtrlType, szMsiLine))
02172   {
02173     // Win32
02174     if (!WriteWin32Ctrl(iResId, resStaticClass, szCtrlText, TEXT("SS_ETCHEDHORZ | SS_SUNKEN"), x, y, wd, ht, attrib))
02175       return m_fError = TRUE, FALSE; // error - ABORT
02176   }
02177   else if (0 == _tcscmp(szCtrlType, szMsiScrollableText))
02178   {
02179     // Win32
02180     if (!WriteWin32Ctrl(iResId, resRichEditClass, szCtrlText, TEXT("WS_GROUP"), x, y, wd, ht, attrib))
02181       return m_fError = TRUE, FALSE; // error - ABORT
02182   }
02183   else
02184   {
02185     // unsupported control type
02186     _tprintf(TEXT("!! >> Control Type: '%s' is unsupported\n"), szCtrlType);
02187     return m_fError = TRUE, FALSE;
02188   }
02189
02190   // update _RESControls table with new info
02191   PMSIHANDLE hViewRes = 0;
02192   PMSIHANDLE hRecInsertCtrl = MsiCreateRecord(3);
02193   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlInsertCtrl, &hViewRes))
02194     || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewRes, 0))
02195     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecInsertCtrl, 1, szDialog))
02196     || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecInsertCtrl, 2, szCtrlName))
02197     || ERROR_SUCCESS != (iStat = MsiRecordSetInteger(hRecInsertCtrl, 3, iResId))
02198     || ERROR_SUCCESS != (iStat = MsiViewModify(hViewRes, MSIMODIFY_ASSIGN, hRecInsertCtrl)))
02199   {
02200     _tprintf(TEXT("!! >> Unable to update _RESControls table\n"));
02201     return m_fError = TRUE, FALSE;
02202   }
02203
02204   // return success
02205   return TRUE;
02206 }
02207
02208 /////////////////////////////////////////////////////////////////////////////
02209 // CGenerateRC::WriteRadioButtons
02210 BOOL CGenerateRC::WriteRadioButtons(TCHAR* szDialog, TCHAR* szRBGroup, TCHAR* szProperty, int x, int y, int attrib)
02211 {
02212   // Format for RadioButton is
02213   //  RADIOBUTTON<tab>"str",<tab>RESID,<tab>x,<tab>y,<tab>wd,<tab>ht[[,<tab> STYLE ]]
02214   // radiobuttons come from the RadioButton table based on the Property of the RBGroup in the Control table
02215   // radiobutton dimensions (X and Y) are local to the radiobutton group
02216   // because you can have multiple radiobutton groups with the same property in a dialog, we have to use the following
02217   // scheme when updating the _RESControls table:
02218   // Dialog<tab>RadioButtonGroup:Property:Order<tab>RESID
02219
02220   // make sure radiobutton table exists
02221   MSICONDITION eCond = MsiDatabaseIsTablePersistent(m_hDatabase, TEXT("RadioButton"));
02222   switch (eCond)
02223   {
02224   case MSICONDITION_ERROR:
02225   case MSICONDITION_NONE:
02226   case MSICONDITION_FALSE:
02227     _tprintf(TEXT("LOG_ERROR>> RadioButton table does not exist, is not persistent, or an error occured.\n"));
02228     return m_fError = TRUE, FALSE; // error - ABORT
02229   case MSICONDITION_TRUE:
02230     break;
02231   default:
02232     assert(0);
02233   }
02234   int iResId = 0;
02235
02236   // open view on RadioButton table
02237   PMSIHANDLE hViewRB = 0;
02238   PMSIHANDLE hRecExec = MsiCreateRecord(1);
02239   if (ERROR_SUCCESS != MsiDatabaseOpenView(m_hDatabase, sqlRadioButton, &hViewRB)
02240     || ERROR_SUCCESS != MsiRecordSetString(hRecExec, 1, szProperty)
02241     || ERROR_SUCCESS != MsiViewExecute(hViewRB, hRecExec))
02242   {
02243     return m_fError = TRUE, FALSE; // error - ABORT
02244   }
02245   // fetch record
02246   PMSIHANDLE hRecRB = 0;
02247   UINT iStat;
02248   while (ERROR_SUCCESS == (iStat = MsiViewFetch(hViewRB, &hRecRB)))
02249   {
02250     DWORD cchLen = 0;
02251     if (ERROR_MORE_DATA != MsiRecordGetString(hRecRB, irbcText, TEXT(""), &cchLen))
02252       return m_fError = TRUE, FALSE;
02253     TCHAR* szRBText = new TCHAR[++cchLen];
02254     if ( !szRBText )
02255       return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02256     if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecRB, irbcText, szRBText, &cchLen)))
02257     {
02258       _tprintf(TEXT("LOG_ERROR>> MsiRecordGetString(radio button text).  %d\n"), iStat);
02259       delete [] szRBText;
02260       return m_fError = TRUE, FALSE; // error - ABORT
02261     }
02262     int iRBX = MsiRecordGetInteger(hRecRB, irbcX);
02263     int iRBY = MsiRecordGetInteger(hRecRB, irbcY);
02264     int iRBWd = MsiRecordGetInteger(hRecRB, irbcWd);
02265     int iRBHt = MsiRecordGetInteger(hRecRB, irbcHt);
02266
02267     // grab order value
02268     int iOrder = MsiRecordGetInteger(hRecRB, irbcOrder);
02269
02270     // attempt to find resource ID if previously used
02271     DWORD cchGeneratedName = _tcslen(szRBGroup) + _tcslen(szProperty) + 25; // 25 = null + 2 ':' + iOrder
02272     TCHAR* szGeneratedName = new TCHAR[cchGeneratedName];
02273     if ( !szGeneratedName )
02274     {
02275       delete [] szRBText;
02276       return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02277     }
02278
02279     if (FAILED(StringCchPrintf(szGeneratedName, cchGeneratedName, TEXT("%s:%s:%d"), szRBGroup, szProperty, iOrder)))
02280     {
02281       delete [] szRBText;
02282       delete [] szGeneratedName;
02283       return m_fError = TRUE, FALSE;
02284     }
02285
02286     DWORD cchSQL = _tcslen(sqlFindResId) + _tcslen(szDialog) + _tcslen(szGeneratedName) + 1;
02287     TCHAR* szSQL = new TCHAR[cchSQL];
02288     if ( !szSQL )
02289     {
02290       delete [] szRBText;
02291       delete [] szGeneratedName;
02292       return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02293     }
02294
02295     if (FAILED(StringCchPrintf(szSQL, cchSQL, sqlFindResId, szDialog, szGeneratedName)))
02296     {
02297       delete [] szRBText;
02298       delete [] szGeneratedName;
02299       delete [] szSQL;
02300       return m_fError = TRUE, FALSE;
02301     }
02302
02303     PMSIHANDLE hViewFindRes = 0;
02304     PMSIHANDLE hRecFindRes = 0;
02305     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, szSQL, &hViewFindRes))
02306       || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewFindRes, 0)))
02307     {
02308       delete [] szRBText;
02309       delete [] szGeneratedName;
02310       delete [] szSQL;
02311       return m_fError = TRUE, FALSE;
02312     }
02313     if (ERROR_SUCCESS == (iStat = MsiViewFetch(hViewFindRes, &hRecFindRes)))
02314     {
02315       // grab res id
02316       iResId = MsiRecordGetInteger(hRecFindRes, 1);
02317     }
02318     else if (ERROR_NO_MORE_ITEMS == iStat)
02319     {
02320       // use next available resource Id
02321       iResId = ++m_iCtrlResID;
02322     }
02323     else
02324     {
02325       delete [] szRBText;
02326       delete [] szGeneratedName;
02327       delete [] szSQL;
02328       return m_fError = TRUE, FALSE;
02329     }
02330
02331     delete [] szSQL;
02332     szSQL = NULL;
02333
02334     TCHAR szTempBuf[64] = {0};
02335     DWORD dwWritten = 0;
02336     /*KEYWORD*/
02337     if (!WriteFile(m_hFile, resRadioButton, _tcslen(resRadioButton)*sizeof(TCHAR), &dwWritten, 0))
02338       m_cWriteFileErr++;
02339     /*<tab>"str",*/
02340     if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
02341       m_cWriteFileErr++;
02342     if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
02343       m_cWriteFileErr++;
02344     // escape chars in str
02345     TCHAR* szEscText = EscapeSlashAndQuoteForRC(szRBText);
02346     if ( !szEscText )
02347     {
02348       delete [] szRBText;
02349       delete [] szGeneratedName;
02350       return m_fError = TRUE, FALSE;
02351     }
02352     if (_tcslen(szEscText) > iMaxResStrLen)
02353     {
02354       _tprintf(TEXT("!! >> STR TOO LONG FOR RC FILE >> CONTROL ID: %d\n"), iResId);
02355       if (FAILED(StringCchCopy(szEscText, _tcslen(szEscText) + 1, strOverLimit)))
02356       {
02357         delete [] szEscText;
02358         delete [] szRBText;
02359         delete [] szGeneratedName;
02360         return m_fError = TRUE, FALSE;
02361       }
02362     }
02363     if (!WriteFile(m_hFile, szEscText, _tcslen(szEscText)*sizeof(TCHAR), &dwWritten, 0))
02364       m_cWriteFileErr++;
02365     delete [] szEscText;
02366     if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
02367       m_cWriteFileErr++;
02368     if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02369       m_cWriteFileErr++;
02370     /*<tab>RESId,*/
02371     if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
02372       m_cWriteFileErr++;
02373
02374     if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), iResId)))
02375     {
02376       delete [] szRBText;
02377       delete [] szGeneratedName;
02378       return m_fError = TRUE, FALSE;
02379     }
02380
02381     if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
02382       m_cWriteFileErr++;
02383     if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02384       m_cWriteFileErr++;
02385     /*x, y, wd, ht DIMENSIONS*/
02386     // for RB, X & Y dimensions are local to group, so must add in group's x and y
02387     if (!PrintDimensions(x+iRBX, y+iRBY, iRBWd, iRBHt))
02388     {
02389       delete [] szRBText;
02390       delete [] szGeneratedName;
02391       return m_fError = TRUE, FALSE; // error - ABORT
02392     }
02393     //attributes are ignored at this time (would require conversion from Installer to Windows and masking of Installer specific)
02394     if (attrib & msidbControlAttributesBitmap)
02395     {
02396       // control with bitmap picture -- want to prevent localization of picture property names
02397       /*,<tab>BS_BITMAP*/
02398       if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02399         m_cWriteFileErr++;
02400
02401       if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%s"), TEXT("BS_BITMAP"))))
02402       {
02403         delete [] szRBText;
02404         delete [] szGeneratedName;
02405         return m_fError = TRUE, FALSE;
02406       }
02407
02408       if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten,0))
02409         m_cWriteFileErr++;
02410     }
02411     else if (attrib & msidbControlAttributesIcon)
02412     {
02413       // control with icon picture
02414       /*<tab>BS_ICON*/
02415       if(!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02416         m_cWriteFileErr++;
02417
02418       if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%s"), TEXT("BS_ICON"))))
02419       {
02420         delete [] szRBText;
02421         delete [] szGeneratedName;
02422         return m_fError = TRUE, FALSE;
02423       }
02424
02425       if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten,0))
02426         m_cWriteFileErr++;
02427     }
02428     if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
02429       m_cWriteFileErr++;
02430
02431     // update _RESControls table with new info
02432     PMSIHANDLE hViewRes = 0;
02433     PMSIHANDLE hRecInsertCtrl = MsiCreateRecord(3);
02434     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlInsertCtrl, &hViewRes))
02435       || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewRes, 0))
02436       || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecInsertCtrl, 1, szDialog))
02437       || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecInsertCtrl, 2, szGeneratedName))
02438       || ERROR_SUCCESS != (iStat = MsiRecordSetInteger(hRecInsertCtrl, 3, iResId))
02439       || ERROR_SUCCESS != (iStat = MsiViewModify(hViewRes, MSIMODIFY_ASSIGN, hRecInsertCtrl)))
02440     {
02441       _tprintf(TEXT("!! >> Unable to update _RESControls table\n"));
02442       delete [] szRBText;
02443       delete [] szGeneratedName;
02444       return m_fError = TRUE, FALSE;
02445     }
02446
02447     delete [] szRBText;
02448     szRBText = NULL;
02449     delete [] szGeneratedName;
02450     szGeneratedName = NULL;
02451   }
02452   if (ERROR_NO_MORE_ITEMS != iStat)// doesn't catch where property never in RadioButton table
02453   {
02454     _tprintf(TEXT("LOG_ERROR>> MsiViewFetch(RadioButton table)\n"));
02455     return m_fError = TRUE, FALSE; // error - ABORT
02456   }
02457
02458   // return success
02459   return TRUE;
02460 }
02461
02462 /////////////////////////////////////////////////////////////////////////////
02463 // CGenerateRC::WriteStdWinCtrl
02464 BOOL CGenerateRC::WriteStdWinCtrl(int iResId, const TCHAR* resType, TCHAR* szCtrlText, int x, int y, int wd, int ht, int attrib)
02465 {
02466   // Format for StdWinCtrl is
02467   //   KEYWORD<tab>"str",<tab>RESID,<tab>x,<tab>y,<tab>wd,<tab>ht[[,<tab> STYLE ]]
02468   // Keyword can be one of PUSHBUTTON, CHECKBOX, GROUPBOX
02469
02470   TCHAR szTempBuf[64] = {0};
02471   DWORD dwWritten = 0;
02472   /*KEYWORD*/
02473   if (!WriteFile(m_hFile, resType, _tcslen(resType)*sizeof(TCHAR), &dwWritten, 0))
02474     m_cWriteFileErr++;
02475   /*<tab>"str",*/
02476   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
02477     m_cWriteFileErr++;
02478   if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
02479     m_cWriteFileErr++;
02480   // escape chars in str
02481   TCHAR* szEscText = EscapeSlashAndQuoteForRC(szCtrlText);
02482   if ( !szEscText )
02483     return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02484
02485   if (_tcslen(szEscText) > iMaxResStrLen)
02486   {
02487     _tprintf(TEXT("!! >> STR TOO LONG FOR RC FILE >> CONTROL ID: %d\n"), iResId);
02488     if (FAILED(StringCchCopy(szEscText, _tcslen(szEscText) + 1, strOverLimit)))
02489     {
02490       delete [] szEscText;
02491       return m_fError = TRUE, FALSE;
02492     }
02493   }
02494   if (!WriteFile(m_hFile, szEscText, _tcslen(szEscText)*sizeof(TCHAR), &dwWritten, 0))
02495     m_cWriteFileErr++;
02496
02497   delete [] szEscText;
02498   szEscText = NULL;
02499
02500   if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
02501     m_cWriteFileErr++;
02502   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02503     m_cWriteFileErr++;
02504   /*<tab>RESId,*/
02505   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
02506     m_cWriteFileErr++;
02507
02508   if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), iResId)))
02509     return m_fError = TRUE, FALSE;
02510
02511   if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
02512     m_cWriteFileErr++;
02513   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02514     m_cWriteFileErr++;
02515   /*x, y, wd, ht DIMENSIONS*/
02516   if (!PrintDimensions(x, y, wd, ht))
02517     return FALSE; // error - ABORT
02518   //attributes are ignored at this time (would require conversion from Installer to Windows and masking of Installer specific)
02519   // valid picture controls are CheckBox, PushButton, and RadioButtons
02520   if (0 != _tcscmp(resType, szMsiGroupBox))
02521   {
02522     if (attrib & msidbControlAttributesBitmap)
02523     {
02524       // control with bitmap picture -- want to prevent localization of picture property names
02525       /*,<tab>BS_BITMAP*/
02526       if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02527         m_cWriteFileErr++;
02528
02529       if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%s"), TEXT("BS_BITMAP"))))
02530         return m_fError = TRUE, FALSE;
02531
02532       if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten,0))
02533         m_cWriteFileErr++;
02534     }
02535     else if (attrib & msidbControlAttributesIcon)
02536     {
02537       // control with icon picture
02538       /*<tab>BS_ICON*/
02539       if(!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02540         m_cWriteFileErr++;
02541
02542       if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%s"), TEXT("BS_ICON"))))
02543         return m_fError = TRUE, FALSE;
02544       if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten,0))
02545         m_cWriteFileErr++;
02546     }
02547   }
02548   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
02549     m_cWriteFileErr++;
02550
02551   // return success
02552   return TRUE;
02553 }
02554
02555 /////////////////////////////////////////////////////////////////////////////
02556 // CGenerateRC::WriteWin32Ctrl
02557 BOOL CGenerateRC::WriteWin32Ctrl(int iResId, const TCHAR* szClass, TCHAR* szCtrlText, TCHAR* szAttrib, int x, int y, int wd, int ht, int attrib)
02558 {
02559   // Format for StdWinCtrl is
02560   //   CONTROL<tab>"str",<tab>RESID,<tab>class,<tab>attrib,<tab>x,<tab>y,<tab>wd,<tab>ht[[,<tab> STYLE ]]
02561
02562   TCHAR szTempBuf[64] = {0};
02563   DWORD dwWritten = 0;
02564   /*CONTROL*/
02565   if (!WriteFile(m_hFile, resControl, _tcslen(resControl)*sizeof(TCHAR), &dwWritten, 0))
02566     m_cWriteFileErr++;
02567   /*<tab>"str",*/
02568   if (!WriteFile(m_hFile, szTab, sizeof(szTab)-sizeof(TCHAR), &dwWritten, 0))
02569     m_cWriteFileErr++;
02570   if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
02571     m_cWriteFileErr++;
02572   // escape chars in str
02573   TCHAR* szEscText = EscapeSlashAndQuoteForRC(szCtrlText);
02574   if ( !szEscText )
02575     return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02576
02577   if (_tcslen(szEscText) > iMaxResStrLen)
02578   {
02579     _tprintf(TEXT("!! >> STR TOO LONG FOR RC FILE >> CONTROL ID:%d\n"), iResId);
02580     if (FAILED(StringCchCopy(szEscText, _tcslen(szEscText) + 1, strOverLimit)))
02581     {
02582       delete [] szEscText;
02583       return m_fError = TRUE, FALSE;
02584     }
02585   }
02586   if (!WriteFile(m_hFile, szEscText, _tcslen(szEscText)*sizeof(TCHAR), &dwWritten, 0))
02587     m_cWriteFileErr++;
02588
02589   delete [] szEscText;
02590   szEscText = NULL;
02591
02592   if (!WriteFile(m_hFile, szQuotes, sizeof(szQuotes)-sizeof(TCHAR), &dwWritten, 0))
02593     m_cWriteFileErr++;
02594   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02595     m_cWriteFileErr++;
02596   /*<tab>RESId,*/
02597   if (FAILED(StringCchPrintf(szTempBuf, sizeof(szTempBuf)/sizeof(szTempBuf[0]), TEXT("%d"), iResId)))
02598     return m_fError = TRUE, FALSE;
02599   if (!WriteFile(m_hFile, szTempBuf, _tcslen(szTempBuf)*sizeof(TCHAR), &dwWritten, 0))
02600     m_cWriteFileErr++;
02601   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02602     m_cWriteFileErr++;
02603   /*<tab>class,*/
02604   if (!WriteFile(m_hFile, szClass, _tcslen(szClass)*sizeof(TCHAR), &dwWritten, 0))
02605     m_cWriteFileErr++;
02606   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02607     m_cWriteFileErr++;
02608   /*<tab>attrib,*/
02609   if (!WriteFile(m_hFile, szAttrib, _tcslen(szAttrib)*sizeof(TCHAR), &dwWritten, 0))
02610     m_cWriteFileErr++;
02611   if (!WriteFile(m_hFile, szCommaTab, sizeof(szCommaTab)-sizeof(TCHAR), &dwWritten, 0))
02612     m_cWriteFileErr++;
02613   /*x, y, wd, ht DIMENSIONS*/
02614   if (!PrintDimensions(x, y, wd, ht))
02615     return FALSE; // error - ABORT
02616   //attributes are ignored at this time (would require conversion from Installer to Windows and masking of Installer specific)
02617   if (!WriteFile(m_hFile, szCRLF, sizeof(szCRLF)-sizeof(TCHAR), &dwWritten, 0))
02618     m_cWriteFileErr++;
02619
02620   // return success
02621   return TRUE;
02622 }
02623
02624
02625 //_______________________________________________________________________________________
02626 //
02627 // CIMPORTRES CLASS IMPLEMENTATION
02628 //_______________________________________________________________________________________
02629
02630
02631
02632 /////////////////////////////////////////////////////////////////////////////
02633 // CImportRes::~CImportRes
02634 // --  Handles destruction of necessary objects.
02635 // --  Commits database if no errors
02636 CImportRes::~CImportRes()
02637 {
02638   UINT iStat;
02639   if (m_hDatabase)
02640   {
02641     // only commit database if no errors
02642     if (!m_fError)
02643     {
02644       if (ERROR_SUCCESS != (iStat = MsiDatabaseCommit(m_hDatabase)))
02645         _tprintf(TEXT("!! DATABASE COMMIT FAILED. Error = %d\n"), iStat);
02646     }
02647     else
02648       _tprintf(TEXT("NO CHANGES SAVED TO DATABASE DUE TO ERROR\n"));
02649     MsiCloseHandle(m_hDatabase);
02650   }
02651   if (m_hControl)
02652     MsiCloseHandle(m_hControl);
02653   if (m_hDialog)
02654     MsiCloseHandle(m_hDialog);
02655   if (m_hRadioButton)
02656     MsiCloseHandle(m_hRadioButton);
02657   if (m_hInst)
02658     FreeLibrary(m_hInst);
02659
02660 }
02661
02662 /////////////////////////////////////////////////////////////////////////////
02663 // Notes:
02664 // 1.)We will only update vcenter, hcenter, width, height and title
02665 //         of Dialog.
02666 //
02667 // 2.)We will only update x, y, width, height, and text of Control.
02668 // 3.)We will only update width, height, and text of RadioButton.
02669 //       RadioButtons can be used multiply in different dialogs and multiple
02670 //       RadioButtonGroups using same properties can be wired on the same dialog
02671 //       Plus, RadioButtons are local to the GroupBox that contains them therefore
02672 //       it would require maintaining state data of the GroupBox's X and Y dimensions
02673
02674 //////////////////////////////////////////////////////////////////////////////
02675 // VerifyDatabaseCodepage
02676 UINT CImportRes::VerifyDatabaseCodepage()
02677 {
02678   UINT iStat;
02679   // only output from language neutral database
02680   TCHAR szTempPath[MAX_PATH+1] = {0};
02681   DWORD cchRet = GetTempPath(sizeof(szTempPath)/sizeof(szTempPath[0]), szTempPath);
02682   if (0 == cchRet || cchRet > sizeof(szTempPath)/sizeof(szTempPath[0]))
02683     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
02684
02685   // export _ForceCodepage table so can verify codepage
02686   if (ERROR_SUCCESS != (iStat = MsiDatabaseExport(m_hDatabase, TEXT("_ForceCodepage"), szTempPath, szCodepageExport)))
02687   {
02688     _tprintf(TEXT("LOG_ERROR>> MsiDatabaseExport(_ForceCodepage)\n"));
02689     return m_fError = TRUE, iStat; // error - ABORT
02690   }
02691   // open _ForceCodepage.idt to read it
02692   DWORD cchFullPath = _tcslen(szTempPath) + _tcslen(szCodepageExport) + 1;
02693   TCHAR* szFullPath = new TCHAR[cchFullPath];
02694   if ( !szFullPath )
02695     return m_fError = TRUE, ERROR_OUTOFMEMORY;
02696
02697   if (FAILED(StringCchPrintf(szFullPath, cchFullPath, TEXT("%s%s"), szTempPath, szCodepageExport)))
02698   {
02699     delete [] szFullPath;
02700     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
02701   }
02702   HANDLE hFile = CreateFile(szFullPath, GENERIC_READ, FILE_SHARE_READ, (LPSECURITY_ATTRIBUTES)0, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, 0);
02703   if (hFile == NULL)
02704   {
02705     _tprintf(TEXT("LOG_ERROR>> OpenFile(_ForceCodepage.idt)\n"));
02706     delete [] szFullPath;
02707     return m_fError = TRUE, iStat; // error - ABORT
02708   }
02709
02710   delete [] szFullPath;
02711   szFullPath = NULL;
02712
02713   // read file for information
02714   DWORD dwSize = GetFileSize(hFile, NULL);
02715   if (0xFFFFFFFF == dwSize)
02716   {
02717     CloseHandle(hFile);
02718     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
02719   }
02720
02721   char* szBuf = new char[dwSize+1];
02722   if ( !szBuf )
02723   {
02724     CloseHandle(hFile);
02725     return m_fError = TRUE, ERROR_OUTOFMEMORY;
02726   }
02727
02728   DWORD dwRead = 0;
02729   if (!ReadFile(hFile, (LPVOID)szBuf, dwSize, &dwRead, NULL)
02730     || 0 == dwRead)
02731   {
02732     delete [] szBuf;
02733     CloseHandle(hFile);
02734     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
02735   }
02736   // parse buffer
02737   // format should be : blank line, blank line, "codepage<tab>_ForceCodepage"
02738   char* pch = szBuf;
02739   int cBlankLines = 0;
02740   while (dwRead && cBlankLines != 2)
02741   {
02742     if (*pch == '\n')
02743       cBlankLines++;
02744     pch++;
02745     dwRead--;
02746   }
02747   if (!dwRead || cBlankLines != 2)
02748   {
02749     _tprintf(TEXT("LOG_ERROR>> Invalid ForceCodepage idt format\n"));
02750     delete [] szBuf;
02751     CloseHandle(hFile);
02752     return m_fError = TRUE, ERROR_FUNCTION_FAILED;
02753   }
02754   // codepage is next
02755   char* pchCodepage = pch;
02756   while (dwRead && *pch != ' ' && *pch != '\t')
02757   {
02758     pch++;
02759     dwRead--;
02760   }
02761   assert(dwRead);
02762   *pch = '\0';
02763   // convert codepage to int
02764   UINT uiCodepage = strtoul(pchCodepage, NULL, 10);
02765   delete [] szBuf;
02766   szBuf = NULL;
02767   if (uiCodepage != 0 && uiCodepage != g_uiCodePage) // 0 is language neutral
02768   {
02769     _tprintf(TEXT("LOG_ERROR>> DATABASE IS NOT LANGUAGE NEUTRAL OR OF SAME CODEPAGE AS RESOURCE STRINGS. CANNOT IMPORT\n"));
02770     _tprintf(TEXT("LOG_ERROR>> DATABASE CODEPAGE= %d\n"), uiCodepage);
02771     CloseHandle(hFile);
02772     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
02773   }
02774   if (!CloseHandle(hFile))
02775     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
02776
02777   return ERROR_SUCCESS;
02778 }
02779
02780 /////////////////////////////////////////////////////////////////////////////
02781 // CImportRes::ImportDialog
02782 UINT CImportRes::ImportDialog(TCHAR* szDialog)
02783 {
02784   UINT iStat = Initialize();
02785   if (ERROR_SUCCESS != iStat)
02786     return m_fError = TRUE, iStat; // error - ABORT
02787
02788   if (ERROR_SUCCESS != (iStat = ImportDlgInit()))
02789     return m_fError = TRUE, iStat; // error - ABORT
02790
02791   // convert dialog name to resource identifier (all upper case)
02792   _tcsupr(szDialog);
02793
02794 #ifdef DEBUG
02795   _tprintf(TEXT("LOG>>...BEGIN SEARCH FOR DIALOG <%s>...\n"), szDialog);
02796 #endif
02797
02798   // load dialog
02799   if (!LoadDialog(m_hInst, RT_DIALOG, szDialog))
02800   {
02801     _tprintf(TEXT("LOG_ERROR>> UNABLE LOAD DIALOG: %s\n"), szDialog);
02802     return ERROR_FUNCTION_FAILED; // fatal error state set in LoadDialog
02803   }
02804
02805   return ERROR_SUCCESS;
02806 }
02807
02808 /////////////////////////////////////////////////////////////////////////////
02809 // CImportRes::ImportDlgInit
02810 UINT CImportRes::ImportDlgInit()
02811 {
02812   // open up view on Dialog table
02813   UINT iStat;
02814   if (!m_hDialog)
02815   {
02816     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlDialogImport, &m_hDialog)))
02817       return m_fError = TRUE, iStat; // error - ABORT
02818   }
02819   // open up view on Control table
02820   if (!m_hControl)
02821   {
02822     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlControlImport, &m_hControl)))
02823     {
02824       if (ERROR_BAD_QUERY_SYNTAX != iStat)
02825         return m_fError = TRUE, iStat; // error - ABORT
02826     }
02827   }
02828   // open up view on RadioButton table
02829   if (!m_hRadioButton)
02830   {
02831     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlRadioButtonImport, &m_hRadioButton)))
02832     {
02833       if (ERROR_BAD_QUERY_SYNTAX != iStat)
02834         return ERROR_SUCCESS; // they just don't have a radiobutton table
02835       else
02836         return m_fError = TRUE, iStat; // error - ABORT
02837     }
02838   }
02839
02840   return ERROR_SUCCESS;
02841 }
02842
02843 ///////////////////////////////////////////////////////////////////////////////
02844 // CImportRes::Initialize
02845 UINT CImportRes::Initialize()
02846 {
02847   // attempt to load the DLL in memory
02848   if (!m_hInst)
02849   {
02850     m_hInst = LoadLibrary(m_szDLLFile);
02851     if (NULL == m_hInst)
02852     {
02853       _tprintf(TEXT("LOG_ERROR>> Unable to load DLL '%s'\n"), m_szDLLFile);
02854       return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
02855     }
02856   }
02857
02858   // open up database in TRANSACT mode so we can update
02859   if (!m_hDatabase)
02860   {
02861     assert(m_szOrigDb);
02862     // open up existing database in transacted mode, or specify a new database for creation
02863     UINT iStat;
02864     if (ERROR_SUCCESS != (iStat = MsiOpenDatabase(m_szOrigDb, m_szDatabase ? m_szDatabase : MSIDBOPEN_TRANSACT, &m_hDatabase)))
02865     {
02866       _tprintf(TEXT("LOG_ERROR>> Unable to open database '%s'\n"), m_szOrigDb);
02867       return m_fError = TRUE, iStat; // error - ABORT
02868     }
02869     _tprintf(TEXT("LOG>> Database opened from-->%s, Database saving to-->%s\n"),m_szOrigDb, m_szDatabase ? m_szDatabase : m_szOrigDb);
02870   }
02871   return ERROR_SUCCESS;
02872 }
02873
02874 /////////////////////////////////////////////////////////////////////////////
02875 // CImportRes::ImportStrings
02876 UINT CImportRes::ImportStrings()
02877 {
02878   UINT iStat = Initialize();
02879   if (ERROR_SUCCESS != iStat)
02880     return m_fError = TRUE, iStat; // error - ABORT
02881
02882 #ifdef DEBUG
02883   _tprintf(TEXT("LOG>>...BEGIN STRING RESOURCE ENUMERATION...\n"));
02884 #endif
02885
02886   // enumerate through string resources
02887   BOOL fOK = EnumResourceNames(m_hInst, RT_STRING, EnumStringCallback, (long)this);
02888   if (!fOK)
02889     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
02890
02891 #ifdef DEBUG
02892   _tprintf(TEXT("LOG>>...END STRING RESOURCE ENUMERATION...\n"));
02893 #endif
02894
02895   return ERROR_SUCCESS;
02896 }
02897
02898 /////////////////////////////////////////////////////////////////////////////
02899 // CImportRes::ImportDialogs
02900 UINT CImportRes::ImportDialogs()
02901 {
02902   UINT iStat = Initialize();
02903   if (ERROR_SUCCESS != iStat)
02904     return m_fError = TRUE, iStat; // error - ABORT
02905   if (ERROR_SUCCESS != (iStat = ImportDlgInit()))
02906     return m_fError = TRUE, iStat; // error - ABORT
02907
02908 #ifdef DEBUG
02909   _tprintf(TEXT("LOG>>...BEGIN DIALOG RESOURCE ENUMERATION...\n"));
02910 #endif
02911
02912   // enumerate through dialog resources
02913   BOOL fOK = EnumResourceNames(m_hInst, RT_DIALOG, EnumDialogCallback, (long)this);
02914   if (!fOK)
02915     return m_fError = TRUE, ERROR_FUNCTION_FAILED; // error - ABORT
02916
02917 #ifdef DEBUG
02918   _tprintf(TEXT("LOG>>...END DIALOG RESOURCE ENUMERATION...\n"));
02919 #endif
02920
02921   return ERROR_SUCCESS;
02922 }
02923
02924 /////////////////////////////////////////////////////////////////////////////
02925 // CImportRes::LoadString
02926 BOOL CImportRes::LoadString(HINSTANCE hModule, const TCHAR* szType, TCHAR* szStringName)
02927 {
02928   PMSIHANDLE hViewStrId = 0;
02929   PMSIHANDLE hRecStrId = 0;
02930   UINT iStat;
02931   if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlStringInstallerName, &hViewStrId)))
02932   {
02933     _tprintf(TEXT("LOG_ERROR>> _RESStrings table is missing from database.\n"));
02934     return m_fError = TRUE, FALSE;
02935   }
02936
02937   int iFirst = (int(szStringName) - 1) * 16;
02938   TCHAR rgchBuffer[512] = {0}; // 512 should be large enough for any string in resource file
02939   DWORD cchBuffer = sizeof(rgchBuffer)/sizeof(TCHAR);
02940   for (int i = 0; i < 16; i++)
02941   {
02942     int cchWritten = ::LoadString(hModule, iFirst + i, rgchBuffer, cchBuffer);
02943     if (cchWritten == 0)
02944       continue; // null string
02945
02946     if (_tcscmp(rgchBuffer, strOverLimit) == 0)
02947       continue; // string greater than limit, leave alone
02948
02949     // use id of string to find table, column, and row it belongs to
02950     PMSIHANDLE hRecExec = MsiCreateRecord(1);
02951     if (ERROR_SUCCESS != (iStat = MsiRecordSetInteger(hRecExec, 1, iFirst + i))
02952       || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewStrId, hRecExec))
02953       || ERROR_SUCCESS != (iStat = MsiViewFetch(hViewStrId, &hRecStrId)))
02954       return m_fError = TRUE, FALSE;
02955
02956
02957     // we now have the table and column and row
02958     // want to SELECT `column` from `table` WHERE row matches
02959     DWORD cchLen = 0;
02960     if (ERROR_MORE_DATA != MsiRecordGetString(hRecStrId, 1, TEXT(""), &cchLen))
02961       return m_fError = TRUE, FALSE;
02962     TCHAR* szTable = new TCHAR[++cchLen];
02963     if ( !szTable )
02964       return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02965     if (ERROR_SUCCESS != MsiRecordGetString(hRecStrId, 1, szTable, &cchLen))
02966     {
02967       delete [] szTable;
02968       return m_fError = TRUE, FALSE;
02969     }
02970
02971     cchLen = 0;
02972     if (ERROR_MORE_DATA != MsiRecordGetString(hRecStrId, 2, TEXT(""), &cchLen))
02973     {
02974       delete [] szTable;
02975       return m_fError = TRUE, FALSE;
02976     }
02977     TCHAR* szColumn = new TCHAR[++cchLen];
02978     if ( !szColumn )
02979     {
02980       delete [] szTable;
02981       return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
02982     }
02983     if (ERROR_SUCCESS != MsiRecordGetString(hRecStrId, 2, szColumn, &cchLen))
02984     {
02985       delete [] szTable;
02986       delete [] szColumn;
02987       return m_fError = TRUE, FALSE;
02988     }
02989
02990     cchLen = 0;
02991     if (ERROR_MORE_DATA != MsiRecordGetString(hRecStrId, 3, TEXT(""), &cchLen))
02992     {
02993       delete [] szTable;
02994       delete [] szColumn;
02995       return m_fError = TRUE, FALSE;
02996     }
02997     TCHAR* szKey = new TCHAR[++cchLen];
02998     if ( !szKey )
02999     {
03000       delete [] szTable;
03001       delete [] szColumn;
03002       return m_fError = TRUE, FALSE;
03003     }
03004     if (ERROR_SUCCESS != MsiRecordGetString(hRecStrId, 3, szKey, &cchLen))
03005     {
03006       delete [] szTable;
03007       delete [] szColumn;
03008       delete [] szKey;
03009       return m_fError = TRUE, FALSE;
03010     }
03011
03012     // need to determine how big to make WHERE clause, i.e. # of primary keys
03013     PMSIHANDLE hRecPrimaryKeys = 0;
03014     if (ERROR_SUCCESS != (iStat = MsiDatabaseGetPrimaryKeys(m_hDatabase, szTable, &hRecPrimaryKeys)))
03015     {
03016       delete [] szTable;
03017       delete [] szColumn;
03018       delete [] szKey;
03019       return m_fError = TRUE, FALSE;
03020     }
03021     int cKeys = MsiRecordGetFieldCount(hRecPrimaryKeys);
03022
03023     // determine number of keys in "szKey" by counting # of ':'
03024     TCHAR* pch = szKey;
03025     int cKeyFromTable = 1;
03026     while (pch != 0 && *pch != '\0')
03027     {
03028       if (*pch++ == ':')
03029         cKeyFromTable++;
03030     }
03031
03032     if (cKeyFromTable != cKeys)
03033     {
03034       delete [] szTable;
03035       delete [] szColumn;
03036       delete [] szKey;
03037       return m_fError = TRUE, FALSE;
03038     }
03039
03040     int iKey;
03041
03042     // determine length of Primary key column names
03043     DWORD cchColNames = 0;
03044     for (iKey = 1; iKey <= cKeys; iKey++)
03045     {
03046       DWORD cchTemp = 0;
03047       if (ERROR_MORE_DATA == MsiRecordGetString(hRecPrimaryKeys, iKey, TEXT(""), &cchTemp))
03048         cchColNames += cchTemp;
03049     }
03050
03051     if (0 == cchColNames)
03052     {
03053       delete [] szTable;
03054       delete [] szColumn;
03055       delete [] szKey;
03056       return m_fError = TRUE, FALSE;
03057     }
03058
03059     // sql query length is sqlStringImport + szColumn + szTable + WHERE clause
03060     //  where clause is ' AND ' + KeyColumn='KeyColumnValue' at max for each key
03061     DWORD cchStrSQL = _tcslen(sqlStringImport)
03062             + _tcslen(szColumn)
03063             + _tcslen(szTable)
03064             + cKeys*_tcslen(TEXT(" AND "))
03065             + cchColNames
03066             + cKeys*2 // for enclosing '' on string columns
03067             + _tcslen(szKey)
03068             + 1;
03069     TCHAR* szStrSQL = new TCHAR[cchStrSQL];
03070     if ( !szStrSQL )
03071     {
03072       delete [] szTable;
03073       delete [] szColumn;
03074       delete [] szKey;
03075       return m_fError = TRUE, FALSE;
03076     }
03077     if (FAILED(StringCchPrintf(szStrSQL, cchStrSQL, sqlStringImport, szColumn, szTable)))
03078     {
03079       delete [] szTable;
03080       delete [] szColumn;
03081       delete [] szKey;
03082       delete [] szStrSQL;
03083       return m_fError = TRUE, FALSE;
03084     }
03085
03086     // need to get column types
03087     TCHAR sqlTemp[255] = {0};
03088     if (FAILED(StringCchPrintf(sqlTemp, sizeof(sqlTemp)/sizeof(sqlTemp[0]), sqlStrTemp, szTable)))
03089     {
03090       delete [] szTable;
03091       delete [] szColumn;
03092       delete [] szKey;
03093       delete [] szStrSQL;
03094       return m_fError = TRUE, FALSE;
03095     }
03096
03097     PMSIHANDLE hViewTemp = 0;
03098     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, sqlTemp, &hViewTemp))
03099       || ERROR_SUCCESS != MsiViewExecute(hViewTemp, 0))
03100     {
03101       delete [] szTable;
03102       delete [] szColumn;
03103       delete [] szKey;
03104       delete [] szStrSQL;
03105       return m_fError = TRUE, FALSE;
03106     }
03107     PMSIHANDLE hRecColInfo = 0;
03108     if (ERROR_SUCCESS != (iStat = MsiViewGetColumnInfo(hViewTemp, MSICOLINFO_TYPES, &hRecColInfo)))
03109     {
03110       delete [] szTable;
03111       delete [] szColumn;
03112       delete [] szKey;
03113       delete [] szStrSQL;
03114       return m_fError = TRUE, FALSE;
03115     }
03116
03117
03118     // for each primary key, add to WHERE clause
03119     TCHAR szColType[10] = {0};
03120     DWORD cchColType = sizeof(szColType)/sizeof(TCHAR);
03121     for (iKey = 1; iKey <= cKeys; iKey++)
03122     {
03123       DWORD cchKey = 0;
03124       if (ERROR_MORE_DATA != MsiRecordGetString(hRecPrimaryKeys, iKey, TEXT(""), &cchKey))
03125       {
03126         delete [] szTable;
03127         delete [] szColumn;
03128         delete [] szKey;
03129         delete [] szStrSQL;
03130         return m_fError = TRUE, FALSE;
03131       }
03132       TCHAR* szPrimaryKeyCol = new TCHAR[++cchKey];
03133       if ( !szPrimaryKeyCol )
03134       {
03135         delete [] szTable;
03136         delete [] szColumn;
03137         delete [] szKey;
03138         delete [] szStrSQL;
03139         return m_fError = TRUE, FALSE; // ERROR_OUTOFMEMORY
03140       }
03141       if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecPrimaryKeys, iKey, szPrimaryKeyCol, &cchKey)))
03142       {
03143         delete [] szTable;
03144         delete [] szColumn;
03145         delete [] szKey;
03146         delete [] szStrSQL;
03147         delete [] szPrimaryKeyCol;
03148         return m_fError = TRUE, FALSE;
03149       }
03150
03151       if (ERROR_SUCCESS != (iStat = MsiRecordGetString(hRecColInfo, iKey, szColType, &cchColType)))
03152       {
03153         delete [] szTable;
03154         delete [] szColumn;
03155         delete [] szKey;
03156         delete [] szStrSQL;
03157         delete [] szPrimaryKeyCol;
03158         return m_fError = TRUE, FALSE;
03159       }
03160
03161       cchColType = sizeof(szColType)/sizeof(TCHAR); // reset
03162
03163       TCHAR* szKeyValue = NULL;
03164       if (iKey == 1)
03165         szKeyValue = _tcstok(szKey, szTokenSeps);
03166       else
03167         szKeyValue = _tcstok(NULL, szTokenSeps);
03168
03169       if ( !szKeyValue )
03170       {
03171         delete [] szTable;
03172         delete [] szColumn;
03173         delete [] szKey;
03174         delete [] szStrSQL;
03175         delete [] szPrimaryKeyCol;
03176         return m_fError = TRUE, FALSE;
03177       }
03178
03179       if (iKey != 1)
03180       {
03181         if (FAILED(StringCchCat(szStrSQL, cchStrSQL, TEXT(" AND "))))
03182         {
03183           delete [] szTable;
03184           delete [] szColumn;
03185           delete [] szKey;
03186           delete [] szStrSQL;
03187           delete [] szPrimaryKeyCol;
03188           return m_fError = TRUE, FALSE;
03189         }
03190       }
03191
03192       if (FAILED(StringCchCat(szStrSQL, cchStrSQL, szPrimaryKeyCol)))
03193       {
03194         delete [] szTable;
03195         delete [] szColumn;
03196         delete [] szKey;
03197         delete [] szStrSQL;
03198         delete [] szPrimaryKeyCol;
03199         return m_fError = TRUE, FALSE;
03200       }
03201
03202       if ((*szColType | 0x20) == 'i') // integer
03203       {
03204         if (FAILED(StringCchCat(szStrSQL, cchStrSQL, TEXT("=")))
03205           || FAILED(StringCchCat(szStrSQL, cchStrSQL, szKeyValue)))
03206         {
03207           delete [] szTable;
03208           delete [] szColumn;
03209           delete [] szKey;
03210           delete [] szStrSQL;
03211           delete [] szPrimaryKeyCol;
03212           return m_fError = TRUE, FALSE;
03213         }
03214       }
03215       else if ((*szColType | 0x20) == 's' || (*szColType | 0x20) == 'l')
03216       {
03217         // string constants must be enclosed in 'str'
03218         if (FAILED(StringCchCat(szStrSQL, cchStrSQL, TEXT("='")))
03219           || FAILED(StringCchCat(szStrSQL, cchStrSQL, szKeyValue))
03220           || FAILED(StringCchCat(szStrSQL, cchStrSQL, TEXT("'"))))
03221         {
03222           delete [] szTable;
03223           delete [] szColumn;
03224           delete [] szKey;
03225           delete [] szStrSQL;
03226           delete [] szPrimaryKeyCol;
03227           return m_fError = TRUE, FALSE;
03228         }
03229       }
03230       else
03231       {
03232         assert(0); // unexpected column type
03233         delete [] szTable;
03234         delete [] szColumn;
03235         delete [] szKey;
03236         delete [] szStrSQL;
03237         delete [] szPrimaryKeyCol;
03238         return m_fError = TRUE, FALSE;
03239       }
03240       delete [] szPrimaryKeyCol;
03241     }
03242
03243     // now grab row from table
03244     PMSIHANDLE hViewRow = 0;
03245     PMSIHANDLE hRecRow = 0;
03246     if (ERROR_SUCCESS != (iStat = MsiDatabaseOpenView(m_hDatabase, szStrSQL, &hViewRow))
03247       || ERROR_SUCCESS != (iStat = MsiViewExecute(hViewRow, 0))
03248       || ERROR_SUCCESS != (iStat = MsiViewFetch(hViewRow, &hRecRow))
03249       || ERROR_SUCCESS != (iStat = MsiRecordSetString(hRecRow, 1, rgchBuffer))
03250       || ERROR_SUCCESS != (iStat = MsiViewModify(hViewRow, MSIMODIFY_UPDATE, hRecRow)))
03251     {
03252       _tprintf(TEXT("LOG_ERROR>> ROW: %s is Missing From Table: %s\n"), szKey, szTable);
03253       delete [] szTable;
03254       delete [] szColumn;
03255       delete [] szKey;
03256       delete [] szStrSQL;
03257       return m_fError = TRUE, FALSE;
03258     }
03259
03260     // clean-up
03261     delete [] szStrSQL;
03262     delete [] szTable;
03263     delete [] szColumn;
03264     delete [] szKey;
03265   }//For block of 16 string table strings
03266
03267   return TRUE;
03268 }
03269
03270 /////////////////////////////////////////////////////////////////////////////
03271 // CImportRes::LoadDialog
03272 BOOL CImportRes::LoadDialog(HINSTANCE hModule, const TCHAR* szType, TCHAR* szDialog)
03273 {
03274   // Find dialog resource into memory
03275   HRSRC hrsrc = FindResource(hModule, szDialog, szType);
03276   if (hrsrc == NULL)
03277   {
03278     _tprintf(TEXT("LOG_ERROR>> DIALOG RESOURCE: %s NOT FOUND!\n"), szDialog);
03279     // not set error state here we could be attempting to load individual dlg resources and we want to continue
03280     return FALSE;
03281   }
03282
03283   // Load resource
03284   HGLOBAL hResource = LoadResource(hModule, hrsrc);
03285   if (hResource == NULL)
03286     return m_fError = TRUE, FALSE; // error - ABORT
03287
03288   // Create stream object to read from resource in memory
03289   CDialogStream DialogRes(LockResource(hResource));
03290
03291   const unsigned short STANDARD_MARKER = 0xFFFF;
03292
03293   ////////////////////////////////////////////////////////////////
03294   //                  Dialog Information                        //
03295   //                                                            //
03296   // stored as DLGTEMPLATEEX (should not have DLGTEMPLATE)      //
03297       /*  typedef struct {
03298         WORD      dlgVer;
03299         WORD      signature;
03300         DWORD     helpID;
03301         DWORD     exStyle;
03302         DWORD     style;
03303         WORD      cDlgItems;
03304         short     x;
03305         short     y;
03306         short     cx;
03307         short     cy;
03308         sz_Or_Ord menu;
03309         sz_Or_Ord windowClass;
03310         WCHAR     title[titleLen];
03311       // The following members exist only if the style member is
03312       // set to DS_SETFONT or DS_SHELLFONT.
03313         short     pointsize;
03314         short     weight;
03315         short     italic;
03316         WCHAR     typeface[stringLen];
03317       } DLGTEMPLATEEX; */
03318   ////////////////////////////////////////////////////////////////
03319
03320   ////////////////////////////////////////////////////////////////////
03321   // DLGTEMPLATE structure does not have dlgVer, signature, helpID,
03322   //             weight, or italic members
03323   //
03324
03325   /* dlgVer */
03326   unsigned short iDlgVer = DialogRes.GetUInt16();
03327   BOOL fOldVersion = FALSE;
03328   if (iDlgVer != 1)
03329   {
03330     // we have the old style -- DLGTEMPLATE + DLGITEMTEMPLATE
03331     fOldVersion = TRUE;
03332     DialogRes.Undo16();
03333   }
03334   if (!fOldVersion)
03335   {
03336     /* signature */
03337     DialogRes.GetInt16();
03338     /* helpID */
03339     DialogRes.GetInt32();
03340   }
03341   /* Extended Style + Style */
03342   int iDlgStyle = DialogRes.GetInt32() | DialogRes.GetInt32();
03343   /* Number of Controls on Dialog */
03344   unsigned short iNumCtrl  = DialogRes.GetUInt16();
03345   /* X-coord (maps to HCentering value) */
03346   unsigned short iDlgXDim  = DialogRes.GetUInt16();
03347   /* Y-coord (maps to VCentering value) */
03348   unsigned short iDlgYDim  = DialogRes.GetUInt16();
03349   /* width */
03350   unsigned short iDlgWdDim = DialogRes.GetUInt16();
03351   /* height */
03352   unsigned short iDlgHtDim = DialogRes.GetUInt16();
03353   /* menu, aligned on WORD boundary */
03354   DialogRes.Align16();
03355   unsigned short iDlgMenu = DialogRes.GetUInt16();
03356   if (iDlgMenu == STANDARD_MARKER)
03357     DialogRes.GetInt16(); // ordinal menu value
03358   else if (iDlgMenu != 0x0000)
03359   {
03360     TCHAR* szMenu = DialogRes.GetStr();
03361     if (szMenu)
03362       delete [] szMenu;
03363   }
03364   /* class, aligned on WORD boundary */
03365   DialogRes.Align16();
03366   unsigned short iDlgClass = DialogRes.GetUInt16();
03367   if (iDlgClass == STANDARD_MARKER)
03368     DialogRes.GetInt16(); // ordinal window class value
03369   else if (iDlgClass != 0x00)
03370   {
03371     TCHAR* szClass = DialogRes.GetStr();
03372     if (szClass)
03373       delete [] szClass;
03374   }
03375   /* title, aligned on WORD boundary */
03376   DialogRes.Align16();
03377   TCHAR* szDlgTitle = DialogRes.GetStr();
03378   if ( !szDlgTitle )
03379     return m_fError = TRUE, TRUE;
03380   /* font */
03381   if (iDlgStyle & DS_SETFONT)
03382   {
03383     /* font point size */
03384     short iDlgPtSize = DialogRes.GetInt16();
03385     if (!fOldVersion)
03386     {
03387       /* font weight */
03388       short iDlgFontWt = DialogRes.GetInt16();
03389       /* font italic */
03390       short iDlgFontItalic = DialogRes.GetInt16();
03391     }
03392     /* font typeface, aligned on WORD boundary */
03393     DialogRes.Align16();
03394     TCHAR* szFont = DialogRes.GetStr();
03395     if (szFont)
03396       delete [] szFont;
03397   }
03398
03399 #ifdef DEBUG
03400   _tprintf(TEXT("LOG>> DIALOG '%s' with '%d' controls at x=%d,y=%d,wd=%d,ht=%d. Title = \"%s\"\n"),
03401         szDialog,iNumCtrl,iDlgXDim,iDlgYDim,iDlgWdDim,iDlgHtDim,szDlgTitle);
03402 #endif
03403
03404   /* find dialog in Dialog table, if fail, we ignore */
03405   //UNSUPPORTED: additional dialogs
03406
03407   // first find match to dialog in _RESDialogs table
03408   PMSIHANDLE hViewFindDlgInstlrName = 0;
03409   PMSIHANDLE hRecDlgInstlrName = 0;
03410   PMSIHANDLE hRecDlgRESName = MsiCreateRecord(1);
03411   assert(hRecDlgRESName);
03412   UINT iStat;
03413   if (ERROR_SUCCESS != MsiRecordSetString(hRecDlgRESName, 1, szDialog)
03414     || ERROR_SUCCESS != MsiDatabaseOpenView(m_hDatabase, sqlDialogInstallerName, &hViewFindDlgInstlrName)
03415     || ERROR_SUCCESS != MsiViewExecute(hViewFindDlgInstlrName, hRecDlgRESName)
03416     || ERROR_SUCCESS != (iStat = MsiViewFetch(hViewFindDlgInstlrName, &hRecDlgInstlrName))
03417     || ERROR_SUCCESS != MsiViewExecute(m_hDialog, hRecDlgInstlrName))
03418   {
03419     delete [] szDlgTitle;
03420     return m_fError = TRUE, TRUE;
03421   }
03422
03423   // fetch dialog for update
03424   PMSIHANDLE hRecDlg = 0;
03425   if (ERROR_SUCCESS != (iStat = MsiViewFetch(m_hDialog, &hRecDlg)))
03426   {
03427     assert(iStat == ERROR_NO_MORE_ITEMS);
03428     // could be ERROR_NO_MORE_ITEMS -- someone removed the dialog
03429     _tprintf(TEXT("LOG_ERROR>> Dialog '%s' not found in database '%s'. New Dialogs are not supported.\n"), szDialog, m_szDatabase);
03430     delete [] szDlgTitle;
03431     return m_fError = TRUE, TRUE; // error - ABORT, but TRUE to continue processing
03432   }
03433
03434   // update dialog
03435   if (ERROR_SUCCESS != MsiRecordSetInteger(hRecDlg, idiHCentering, iDlgXDim)
03436     || ERROR_SUCCESS != MsiRecordSetInteger(hRecDlg, idiVCentering, iDlgYDim)
03437     || ERROR_SUCCESS != MsiRecordSetInteger(hRecDlg, idiWidth, iDlgWdDim)
03438     || ERROR_SUCCESS != MsiRecordSetInteger(hRecDlg, idiHeight, iDlgHtDim))
03439   {
03440     delete [] szDlgTitle;
03441     return m_fError = TRUE, TRUE;
03442   }
03443
03444   if (_tcscmp(strOverLimit, szDlgTitle) != 0) // don't update if "!! STR OVER LIMIT !!"
03445   {
03446     if (ERROR_SUCCESS != MsiRecordSetString(hRecDlg, idiTitle, szDlgTitle))
03447     {
03448       delete [] szDlgTitle;
03449       return m_fError = TRUE, TRUE;
03450     }
03451   }
03452
03453   if (ERROR_SUCCESS != (iStat = MsiViewModify(m_hDialog, MSIMODIFY_UPDATE, hRecDlg)))
03454   {
03455     _tprintf(TEXT("LOG_ERROR>>Failed to update Dialog '%s'.\n"), szDialog);
03456     delete [] szDlgTitle;
03457     return m_fError = TRUE, TRUE; // error - ABORT, but TRUE to continue with other Dialogs
03458   }
03459
03460   delete [] szDlgTitle;
03461   szDlgTitle = NULL;
03462
03463   ///////////////////////////////////////////////////////////////////////
03464   //                  Control Information                              //
03465   //                                                                   //
03466   // stored as DLGITEMTEMPLATEEX (should not have DLGITEMTEMPLATE)     //
03467   /*  typedef struct {
03468       DWORD  helpID;
03469       DWORD  exStyle;
03470       DWORD  style;
03471       short  x;
03472       short  y;
03473       short  cx;
03474       short  cy;
03475       WORD   id;
03476       sz_Or_Ord windowClass;
03477       sz_Or_Ord title;
03478       WORD   extraCount;
03479     } DLGITEMTEMPLATEEX; */
03480   /////////////////////////////////////////////////////////////////////////
03481
03482   /////////////////////////////////////////////////////////////////////////
03483   // DLGITEMTEMPLATE does not have helpID
03484   //
03485   if (iNumCtrl > 0 && !m_hControl)
03486   {
03487     _tprintf(TEXT("LOG_ERROR>> Unable to update controls.  Control table does not exist\n"));
03488     return m_fError = TRUE, TRUE; // error - ABORT, but TRUE to continue processing
03489   }
03490   PMSIHANDLE hViewCtrlInstallerName = 0;
03491   PMSIHANDLE hRecCtrl = 0;
03492   PMSIHANDLE hRecRadioButton = MsiCreateRecord(2);
03493   PMSIHANDLE hRecCtrlResId = MsiCreateRecord(1);
03494   assert(hRecCtrlResId);
03495   if (ERROR_SUCCESS != MsiDatabaseOpenView(m_hDatabase, sqlControlInstallerName, &hViewCtrlInstallerName))
03496   {
03497     _tprintf(TEXT("LOG_ERROR>> _RESControls table is missing from database\n"));
03498     return m_fError = TRUE, TRUE;
03499   }
03500   bool fRadioButton = false;
03501   // cycle through the controls
03502   for (int i = 1; i <= iNumCtrl; i++)
03503   {
03504     /* DLGITEMTEMPLATEEX is aligned on a DWORD boundary */
03505     DialogRes.Align32();
03506
03507     fRadioButton = false;
03508
03509     if (!fOldVersion)
03510     {
03511       /* helpID */
03512       DialogRes.GetInt32();
03513     }
03514     /* exStyle | style */
03515     int iCtrlAttrib = DialogRes.GetInt32() | DialogRes.GetInt32();
03516     /* x */
03517     unsigned short iCtrlXDim = DialogRes.GetUInt16();
03518     /* y */
03519     unsigned short iCtrlYDim = DialogRes.GetUInt16();
03520     /* cx */
03521     unsigned short iCtrlWdDim = DialogRes.GetUInt16();
03522     /* cy */
03523     unsigned short iCtrlHtDim = DialogRes.GetUInt16();
03524     /* id */
03525     unsigned short iCtrlId = DialogRes.GetUInt16();
03526     /* windowClass -- aligned on word boundary*/
03527     if (!fOldVersion)
03528       DialogRes.GetInt16(); //!! don't appear to be aligned on word boundary, instead have extra 16 though ??
03529     else
03530       DialogRes.Align16();
03531     unsigned short iWndwClass = DialogRes.GetUInt16();
03532     if (iWndwClass == STANDARD_MARKER)
03533     {
03534       // pre-defined window class
03535       unsigned short iCtrlWindowClass = DialogRes.GetUInt16();
03536       switch (iCtrlWindowClass)
03537       {
03538       case 0x0080: // button
03539         if (iCtrlAttrib & BS_RADIOBUTTON)
03540           fRadioButton = true;
03541         break;
03542       case 0x0081: // edit
03543         break;
03544       case 0x0082: // static
03545         break;
03546       case 0x0083: // list box
03547         break;
03548       case 0x0084: // scroll bar
03549         break;
03550       case 0x0085: // combo box
03551         break;
03552       default: assert(0);
03553         break;
03554       }
03555     }
03556     else
03557     {
03558       // custom window class, stored as str
03559       DialogRes.Undo16();
03560       TCHAR* szCtrlType = DialogRes.GetStr();
03561       if (szCtrlType)
03562         delete [] szCtrlType;
03563     }
03564
03565     /* title -- aligned on word boundary*/
03566     DialogRes.Align16();
03567     TCHAR* szCtrlText = 0;
03568     if (DialogRes.GetUInt16() == STANDARD_MARKER)
03569     {
03570       // ordinal
03571       DialogRes.GetInt16();
03572     }
03573     else
03574     {
03575       // str title
03576       DialogRes.Undo16();
03577       szCtrlText = DialogRes.GetStr();
03578     }
03579     if ( !szCtrlText )
03580       return m_fError = TRUE, TRUE;
03581
03582     /* extra count */
03583     short iCtrlCreationData = DialogRes.GetInt16();
03584     if (iCtrlCreationData > 0)
03585     {
03586       DialogRes.Align16(); // data begins at next WORD boundary
03587       DialogRes.Move(iCtrlCreationData);
03588     }
03589
03590     // find control's real name (for use with Installer)
03591     if (ERROR_SUCCESS != MsiRecordSetInteger(hRecCtrlResId, 1, iCtrlId)
03592       || ERROR_SUCCESS != MsiViewExecute(hViewCtrlInstallerName, hRecCtrlResId))
03593     {
03594       delete [] szCtrlText;
03595       return m_fError = TRUE, TRUE;
03596     }
03597
03598     // fetch control's real name
03599     if (ERROR_SUCCESS != (iStat = MsiViewFetch(hViewCtrlInstallerName, &hRecCtrl)))
03600     {
03601       if (ERROR_NO_MORE_ITEMS == iStat)
03602       {
03603         // new control, unsupported feature
03604         _tprintf(TEXT("LOG_ERROR>>\t Control with ID '%d' not found. New Controls are not supported.\n"), iCtrlId);
03605       }
03606
03607       delete [] szCtrlText;
03608       return m_fError = TRUE, TRUE; // error - ABORT, but TRUE to continue processing
03609     }
03610
03611     DWORD dwName = 0;
03612     if (ERROR_MORE_DATA != MsiRecordGetString(hRecCtrl, 2, TEXT(""), &dwName))
03613     {
03614       delete [] szCtrlText;
03615       return m_fError = TRUE, TRUE;
03616     }
03617
03618     TCHAR* szCtrlName = new TCHAR[++dwName];
03619     if ( !szCtrlName )
03620     {
03621       delete [] szCtrlText;
03622       return m_fError = TRUE, FALSE;
03623     }
03624
03625     if (ERROR_SUCCESS != MsiRecordGetString(hRecCtrl, 2, szCtrlName, &dwName))
03626     {
03627       delete [] szCtrlText;
03628       delete [] szCtrlName;
03629       return m_fError = TRUE, TRUE;
03630     }
03631 #ifdef DEBUG
03632     _tprintf(TEXT("LOG>>\tCONTROL '%d' ('%s') at x=%d,y=%d,wd=%d,ht=%d. Text = \"%s\"\n"),
03633       iCtrlId,szCtrlName,iCtrlXDim,iCtrlYDim,iCtrlWdDim,iCtrlHtDim,szCtrlText);
03634 #endif
03635
03636     // fetch control's info for update
03637     // for radiobuttons, we have to get it from the radiobutton table
03638     // we also have to parse the szCtrlName string to get out the property and order keys used in the radiobutton table
03639     // assumes that radiobuttons follow group:property:order syntax
03640     if (fRadioButton && !_tcschr(szCtrlName, ':'))
03641       fRadioButton = false; // not really a radiobutton, just the group encapsulating them
03642
03643     PMSIHANDLE hRecRBExec = 0;
03644     if (fRadioButton)
03645     {
03646       if (!m_hRadioButton)
03647       {
03648         _tprintf(TEXT("LOG_ERROR>> RadioButtons found, but no RadioButton table exists in the database\n"));
03649         delete [] szCtrlText;
03650         delete [] szCtrlName;
03651         return m_fError = TRUE, TRUE; // error - ABORT, but TRUE to continue processing
03652       }
03653       // parse name RadioButtonGroup:Property:Order
03654       TCHAR* szRBGroup = _tcstok(szCtrlName, szTokenSeps);
03655       if ( !szRBGroup )
03656       {
03657         delete [] szCtrlText;
03658         delete [] szCtrlName;
03659         return m_fError = TRUE, TRUE;
03660       }
03661       TCHAR* szRBProperty = _tcstok(NULL, szTokenSeps);
03662       if ( !szRBProperty )
03663       {
03664         delete [] szCtrlText;
03665         delete [] szCtrlName;
03666         return m_fError = TRUE, TRUE;
03667       }
03668       TCHAR* szRBOrder = _tcstok(NULL, szTokenSeps);
03669       if ( !szRBOrder )
03670       {
03671         delete [] szCtrlText;
03672         delete [] szCtrlName;
03673         return m_fError = TRUE, TRUE;
03674       }
03675       int iRBOrder = _ttoi(szRBOrder);
03676 #ifdef DEBUG
03677       _tprintf(TEXT("LOG>> RadioButton belongs to RBGroup: %s, Property: %s, and has Order=%d"), szRBGroup, szRBProperty, iRBOrder);
03678 #endif
03679       hRecRBExec = MsiCreateRecord(2);
03680       if (ERROR_SUCCESS != MsiRecordSetString(hRecRBExec, 1, szRBProperty)
03681         || ERROR_SUCCESS != MsiRecordSetInteger(hRecRBExec, 2, iRBOrder))
03682       {
03683         delete [] szCtrlText;
03684         delete [] szCtrlName;
03685         return m_fError = TRUE, TRUE;
03686       }
03687     }
03688     if (ERROR_SUCCESS != MsiViewExecute(fRadioButton ? m_hRadioButton : m_hControl, fRadioButton ? hRecRBExec : hRecCtrl))
03689     {
03690       delete [] szCtrlText;
03691       delete [] szCtrlName;
03692       return m_fError = TRUE, TRUE;
03693     }
03694     PMSIHANDLE hRecCtrlUpdate = 0;
03695     if (ERROR_SUCCESS != (iStat = MsiViewFetch(fRadioButton ? m_hRadioButton : m_hControl, &hRecCtrlUpdate)))
03696     {
03697       if (ERROR_NO_MORE_ITEMS == iStat)
03698       {
03699         // control has been removed from database
03700         _tprintf(TEXT("LOG_ERROR>>\t Control with ID '%d' not found in database.\n"), iCtrlId);
03701       }
03702
03703       delete [] szCtrlText;
03704       delete [] szCtrlName;
03705       return m_fError = TRUE, TRUE; // error - ABORT, but TRUE to continue processing
03706     }
03707
03708     // update info
03709     if (!fRadioButton)
03710     {
03711       if (ERROR_SUCCESS != MsiRecordSetInteger(hRecCtrlUpdate, iciX, iCtrlXDim)
03712         || ERROR_SUCCESS != MsiRecordSetInteger(hRecCtrlUpdate, iciY, iCtrlYDim))
03713       {
03714         delete [] szCtrlText;
03715         delete [] szCtrlName;
03716         return m_fError = TRUE, TRUE;
03717       }
03718     }
03719     if (ERROR_SUCCESS != MsiRecordSetInteger(hRecCtrlUpdate, fRadioButton ? irbiWidth : iciWidth, iCtrlWdDim)
03720       || ERROR_SUCCESS != MsiRecordSetInteger(hRecCtrlUpdate, fRadioButton ? irbiHeight : iciHeight, iCtrlHtDim))
03721     {
03722       delete [] szCtrlText;
03723       delete [] szCtrlName;
03724       return m_fError = TRUE, TRUE;
03725     }
03726     if (0 != _tcscmp(strOverLimit, szCtrlText)) // don't update if "!! STR OVER LIMIT !!"
03727     {
03728       if (ERROR_SUCCESS != MsiRecordSetString(hRecCtrlUpdate, fRadioButton ? irbiText : iciText, szCtrlText))
03729       {
03730         delete [] szCtrlText;
03731         delete [] szCtrlName;
03732         return m_fError = TRUE, TRUE;
03733       }
03734     }
03735     if (ERROR_SUCCESS != (iStat = MsiViewModify(fRadioButton ? m_hRadioButton : m_hControl, MSIMODIFY_UPDATE, hRecCtrlUpdate)))
03736     {
03737       _tprintf(TEXT("LOG_ERROR>>Failed to update Control '%d'.\n"), iCtrlId);
03738       delete [] szCtrlText;
03739       delete [] szCtrlName;
03740       return m_fError = TRUE, TRUE; // error - ABORT, but TRUE to continue with other Dialogs
03741     }
03742
03743     delete [] szCtrlText;
03744     delete [] szCtrlName;
03745     if (ERROR_SUCCESS != MsiViewClose(hViewCtrlInstallerName)) // for re-execute
03746       return m_fError = TRUE, TRUE;
03747   }
03748
03749   return TRUE;
03750 }
03751
03752
03753 //////////////////////////////////////////////////////////////////////////////
03754 // CImportRes::SetCodePage
03755 BOOL CImportRes::SetCodePage(WORD wLang)
03756 {
03757   // if we have already set the codepage, we don't need to do it again
03758   if (m_fSetCodepage)
03759     return TRUE;
03760
03761   DWORD dwLocale = MAKELCID(wLang, SORT_DEFAULT);
03762   TCHAR szLocaleBuf[7]; // from MSDN, max # char allowed is 6
03763   int cch = GetLocaleInfo(dwLocale, LOCALE_IDEFAULTANSICODEPAGE, szLocaleBuf, sizeof(szLocaleBuf)/sizeof(TCHAR));
03764   if (0 == cch)
03765     return m_fError = TRUE, FALSE;
03766
03767   // GetLocaleInfo always returns information in text format
03768   // Numeric data is written in decimal format
03769   // Expect numeric data because ask for CodePage...need to convert to int
03770   TCHAR* szStop;
03771   g_uiCodePage = _tcstoul(szLocaleBuf, &szStop, 0);
03772
03773   //verify database's codepage
03774   // database's codepage must either be language NEUTRAL or match g_uiCodepage
03775   if (ERROR_SUCCESS != VerifyDatabaseCodepage())
03776     return m_fError = TRUE, FALSE;
03777
03778   // verify codepage is available on system
03779   // A code page is considered valid only if it is installed in the system.
03780   if (!IsValidCodePage(g_uiCodePage))
03781     return m_fError = TRUE, FALSE; // codepage not valid for this system
03782
03783   // set codepage in database using _ForceCodepage table
03784   // find temp directory
03785   TCHAR szTempPath[MAX_PATH+1] = {0};
03786   DWORD cchRet = GetTempPath(sizeof(szTempPath)/sizeof(szTempPath[0]), szTempPath);
03787   if (0 == cchRet || cchRet > sizeof(szTempPath)/sizeof(szTempPath[0]))
03788     return m_fError = TRUE, FALSE;
03789
03790   // create full path (TEMP directory already has backslash)
03791   DWORD cchFileFullPath = _tcslen(szTempPath) + _tcslen(szCodepageFile) + 1;
03792   TCHAR* szFileFullPath = new TCHAR[cchFileFullPath];
03793   if ( !szFileFullPath )
03794     return m_fError = TRUE, FALSE;
03795   if (FAILED(StringCchPrintf(szFileFullPath, cchFileFullPath, TEXT("%s%s"), szTempPath, szCodepageFile)))
03796   {
03797     delete [] szFileFullPath;
03798     return m_fError = TRUE, FALSE;
03799   }
03800   DWORD dwWritten = 0;
03801   HANDLE hFile = CreateFile(szFileFullPath, GENERIC_WRITE, FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0);
03802   if (!hFile)
03803   {
03804     _tprintf(TEXT("!! Unable to set codepage of database.\n"));
03805     delete [] szFileFullPath;
03806     return m_fError = TRUE, FALSE;
03807   }
03808
03809   /*********************************
03810    FORMAT FOR FORCING CODEPAGE
03811   **********************************/
03812   // blank line
03813   // blank line
03814   // codepage<tab>_ForceCodepage
03815   DWORD cchCodepage = _tcslen(szLocaleBuf) + _tcslen(szForceCodepage) + _tcslen(TEXT("\r\n\r\n%s\t%s\r\n")) + 1;
03816   TCHAR* szCodepage = new TCHAR[cchCodepage];
03817   if ( !szCodepage )
03818   {
03819     delete [] szFileFullPath;
03820     return m_fError = TRUE, FALSE;
03821   }
03822
03823   if (FAILED(StringCchPrintf(szCodepage, cchCodepage, TEXT("\r\n\r\n%s\t%s\r\n"), szLocaleBuf, szForceCodepage)))
03824   {
03825     delete [] szFileFullPath;
03826     delete [] szCodepage;
03827     return m_fError = TRUE, FALSE;
03828   }
03829
03830 #ifdef UNICODE
03831   int cchAnsi = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, szCodepage, -1, NULL, 0, NULL, NULL);
03832   char* szBuf = new char[cchAnsi];
03833   if ( !szBuf )
03834   {
03835     delete [] szFileFullPath;
03836     delete [] szCodepage;
03837     return m_fError = TRUE, FALSE;
03838   }
03839   if (0 == WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, szCodepage, -1, szBuf, cchAnsi, NULL, NULL))
03840   {
03841     delete [] szFileFullPath;
03842     delete [] szCodepage;
03843     delete [] szBuf;
03844     return m_fError = TRUE, FALSE;
03845   }
03846   if (!WriteFile(hFile, szBuf, strlen(szBuf), &dwWritten, 0))
03847   {
03848     delete [] szFileFullPath;
03849     delete [] szCodepage;
03850     delete [] szBuf;
03851     return m_fError = TRUE, FALSE;
03852   }
03853   delete [] szBuf;
03854 #else
03855   if (!WriteFile(hFile, szCodepage, cchCodepage-1, &dwWritten, 0))
03856   {
03857     delete [] szFileFullPath;
03858     delete [] szCodepage;
03859     return m_fError = TRUE, FALSE;
03860   }
03861 #endif
03862
03863   delete [] szCodepage;
03864
03865   if (!CloseHandle(hFile))
03866   {
03867     delete [] szFileFullPath;
03868     return m_fError = TRUE, FALSE;
03869   }
03870
03871   // set codepage of database
03872   UINT iStat = MsiDatabaseImport(m_hDatabase, szTempPath, szCodepageFile);
03873   if (iStat != ERROR_SUCCESS)
03874   {
03875     _tprintf(TEXT("!! Unable to set codepage of database. Error = %d\n"), iStat);
03876     delete [] szFileFullPath;
03877     return m_fError = TRUE, FALSE;
03878   }
03879
03880   // attempt to delete the file we created for clean-up
03881   DeleteFile(szFileFullPath);
03882
03883   delete [] szFileFullPath;
03884
03885   // update status flage
03886   m_fSetCodepage = TRUE;
03887
03888   return TRUE;
03889 }
03890
03891 /////////////////////////////////////////////////////////////////////////////
03892 // EnumDialogCallback
03893 BOOL __stdcall EnumDialogCallback(HINSTANCE hModule, const TCHAR* szType, TCHAR* szDialogName, long lParam)
03894 {
03895   // determine codepage required.  steps, enumerate languages in resource file (better be no more than two)
03896   // possibilities are NEUTRAL (non-localized) + other lang
03897
03898   if ( !lParam )
03899     return FALSE;
03900
03901   ((CImportRes*)lParam)->SetFoundLang(FALSE); // init to FALSE
03902   if (!EnumResourceLanguages(hModule, szType, szDialogName, EnumLanguageCallback, lParam))
03903     return FALSE;
03904
03905 #ifdef DEBUG
03906   _tprintf(TEXT("LOG>> DIALOG: '%s' FOUND\n"),szDialogName);
03907 #endif
03908
03909   BOOL fOK = ((CImportRes*)lParam)->LoadDialog(hModule, szType, szDialogName);
03910   if (!fOK)
03911   {
03912     // error occured
03913     ((CImportRes*)lParam)->SetErrorState(TRUE);
03914     return FALSE;
03915   }
03916   return TRUE;
03917 }
03918
03919 /////////////////////////////////////////////////////////////////////////////
03920 // EnumStringCallback
03921 BOOL __stdcall EnumStringCallback(HINSTANCE hModule, const TCHAR* szType, TCHAR* szName, long lParam)
03922 {
03923   if ( !lParam )
03924     return FALSE;
03925
03926   ((CImportRes*)lParam)->SetFoundLang(FALSE); // init to FALSE
03927
03928   // determine codepage required.  steps, enumerate languages in resource file (better be no more than two)
03929   // possibilities are NEUTRAL (non-localized) + other lang
03930   if (!EnumResourceLanguages(hModule, szType, szName, EnumLanguageCallback, lParam))
03931     return FALSE;
03932
03933
03934   BOOL fOK = ((CImportRes*)lParam)->LoadString(hModule, szType, szName);
03935   if (!fOK)
03936   {
03937     // error occured
03938     ((CImportRes*)lParam)->SetErrorState(TRUE);
03939     return FALSE;
03940   }
03941   return TRUE;
03942 }
03943
03944 /////////////////////////////////////////////////////////////////////////////
03945 // EnumLanguageCallback
03946 BOOL __stdcall EnumLanguageCallback(HINSTANCE hModule, const TCHAR* szType, const TCHAR* szName, WORD wIDLanguage, long lParam)
03947 {
03948   /*************************************************************************************
03949   RESTRICTIONS:
03950   1.) ONLY 1 language per resource
03951   2.) UP To 2 languages per resource file (but 1 must be LANG_NEUTRAL)
03952   3.) On Win9x we must be on a system matching the required codepage
03953   4.) We should only be able to update a language neutral database or
03954       a database set with the required code page
03955   5.) Database can only have one code page (Although _SummaryInformation stream
03956       can have a code page different from database as _SummaryInformation is considered
03957     to be different
03958   **************************************************************************************/
03959
03960   if ( !lParam )
03961     return FALSE;
03962
03963   if (((CImportRes*)lParam)->WasLanguagePreviouslyFound())
03964   {
03965     // ERROR -- more than 1 language per dialog
03966     _tprintf(TEXT("!! STRING RESOURCE IS IN MORE THAN ONE LANGUAGE IN RESOURCE FILE\n"));
03967     ((CImportRes*)lParam)->SetErrorState(TRUE);
03968     return FALSE;
03969   }
03970
03971   // if languages match we are good to go
03972   if (g_wLangId != wIDLanguage)
03973   {
03974     // languages don't match
03975     // 2 valid scenarios
03976
03977     // valid SCENARIO 1: g_wLangId is NEUTRAL, wIDLanguage new language
03978     // valid SCENARIO 2: g_wLangId is language, wIDLanguage is NEUTRAL
03979     // all other scenarios invalid
03980     if (g_wLangId == MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL))
03981     {
03982       // set codepage, update g_uiCodePage
03983       if (!((CImportRes*)lParam)->SetCodePage(wIDLanguage))
03984         return ((CImportRes*)lParam)->SetErrorState(TRUE), FALSE;
03985       g_wLangId = wIDLanguage;
03986     }
03987     else if (wIDLanguage != MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL))
03988     {
03989       // invalid, 2 different languages, neither one NEUTRAL
03990       _tprintf(TEXT("!! Resource file contains more than one language. Not Supported. Lang1 = %d, Lang2 = %d\n"), g_wLangId, wIDLanguage);
03991       return ((CImportRes*)lParam)->SetErrorState(TRUE), FALSE;
03992     }
03993   }
03994
03995   ((CImportRes*)lParam)->SetFoundLang(TRUE); // language found for resource
03996   return TRUE;
03997 }
03998
03999 //_______________________________________________________________________________________
04000 //
04001 // CDIALOGSTREAM CLASS IMPLEMENTATION
04002 //_______________________________________________________________________________________
04003
04004 /////////////////////////////////////////////////////////////////////////////
04005 // CDialogStream::GetInt16 -- returns a 16 bit integer, moves internal ptr 16
04006 short CDialogStream::GetInt16()
04007 {
04008   short i = *(short*)m_pch;
04009   m_pch += sizeof(short);
04010   return i;
04011 }
04012
04013 /////////////////////////////////////////////////////////////////////////////
04014 // CDialogStream::GetUInt16 -- returns a 16 bit unsigned integer, moves internal ptr 16
04015 unsigned short CDialogStream::GetUInt16()
04016 {
04017   unsigned short i = *(unsigned short*)m_pch;
04018   m_pch += sizeof(unsigned short);
04019   return i;
04020 }
04021
04022 /////////////////////////////////////////////////////////////////////////////
04023 // CDialogStream::GetInt32 -- returns a 32 bit integer, moves internal ptr 32
04024 int CDialogStream::GetInt32()
04025 {
04026   int i = *(int*)m_pch;
04027   m_pch += sizeof(int);
04028   return i;
04029 }
04030
04031 /////////////////////////////////////////////////////////////////////////////
04032 // CDialogStream::GetInt8 -- returns a 8 bit integer, moves internal ptr 8
04033 int CDialogStream::GetInt8()
04034 {
04035   int i = *(unsigned char*)m_pch;
04036   m_pch += sizeof(unsigned char);
04037   return i;
04038 }
04039
04040 /////////////////////////////////////////////////////////////////////////////
04041 // CDialogStream::GetStr -- returns a null terminated str from memory.
04042 //   Handles DBCS, Unicode str storage.  Moves ptr length of str.
04043 //   Resource strings stored as unicode
04044 TCHAR* CDialogStream::GetStr()
04045 {
04046   TCHAR* sz = NULL;
04047
04048   int cchwide = lstrlenW((wchar_t*)m_pch);
04049 #ifdef UNICODE
04050   sz = new TCHAR[cchwide + 1];
04051   if ( !sz )
04052     return NULL;
04053   lstrcpyW(sz, (wchar_t*)m_pch);
04054 #else
04055   // what codepage to use to translate?
04056   int cb = WideCharToMultiByte(CP_ACP, 0, (wchar_t*)m_pch, -1, 0, 0, 0, 0);
04057   sz = new TCHAR[cb+1];
04058   if ( !sz )
04059     return NULL;
04060   BOOL fUsedDefault;
04061   if (0 == WideCharToMultiByte(CP_ACP, 0, (wchar_t*)m_pch, -1, sz, cb, 0, &fUsedDefault))
04062   {
04063     delete [] sz;
04064     return NULL;
04065   }
04066 #endif // UNICODE
04067
04068   m_pch += 2*(cchwide+1);
04069   return sz;
04070 }
04071
04072 /////////////////////////////////////////////////////////////////////////////
04073 // CDialogStream::Align32-- moves pointer to DWORD boundary
04074 BOOL CDialogStream::Align32()
04075 {
04076   m_pch = (char*)(int(m_pch) + 3 & ~ 3);
04077   return TRUE;
04078 }
04079
04080 /////////////////////////////////////////////////////////////////////////////
04081 // CDialogStream::Align16-- moves pointer to WORD boundary
04082 BOOL CDialogStream::Align16()
04083 {
04084   m_pch = (char*)(int(m_pch) + 1 & ~ 1);
04085   return TRUE;
04086 }
04087
04088 /////////////////////////////////////////////////////////////////////////////
04089 // CDialogStream::Undo16 -- moves ptr back 16
04090 BOOL CDialogStream::Undo16()
04091 {
04092   m_pch -= sizeof(unsigned short);
04093   return TRUE;
04094 }
04095
04096 /////////////////////////////////////////////////////////////////////////////
04097 // CDialogStream::Move -- moves pointer cbBytes
04098 BOOL CDialogStream::Move(int cbBytes)
04099 {
04100   m_pch += cbBytes;
04101   return TRUE;
04102 }
04103
04104 CDialogStream::CDialogStream(HGLOBAL hResource)
04105   : m_pch((char*)hResource)
04106 {
04107   // Constructor
04108 }
04109
04110 CDialogStream::~CDialogStream()
04111 {
04112   // Destructor
04113 }
04114
04115
04116 //__________________________________________________________________________________________
04117 //
04118 // MAIN + HELPER FUNCTIONS
04119 //__________________________________________________________________________________________
04120
04121 ///////////////////////////////////////////////////////////
04122 // usage
04123 void Usage()
04124 {
04125   _tprintf(
04126       TEXT("MSILOC.EXE -- Copyright (C) Microsoft Corporation, 2000-2001.  All rights reserved\n")
04127       TEXT("\t*Generates a resource file from the UI in the installation package\n")
04128       TEXT("\t*Imports a localized resource DLL into an installation package\n")
04129       TEXT("\n")
04130       TEXT("SYNTAX -->EXPORT MSI TO RC (creates a resource file):\n")
04131       TEXT("  msiloc -e {database} {option 1}{option 2}...\n")
04132       TEXT("SYNTAX -->IMPORT (RES)DLL TO MSI:\n")
04133       TEXT("  msiloc -i {database} {resource DLL} {option 1}{option 2}...\n")
04134       TEXT("OPTIONS:\n")
04135       TEXT("    -d * all dialogs\n")
04136       TEXT("    -d {Dialog1} specific dialog\n")
04137       TEXT("    -s {Table Column} specific column of strings (EXPORT ONLY)\n")
04138       TEXT("    -s * * all strings (IMPORT ONLY)\n")
04139       TEXT("    -x option to not export binary data (bitmaps, icons, jpegs) (EXPORT ONLY)\n")
04140       TEXT("    -c {database} option to save to a new database\n")
04141       TEXT("\n")
04142       TEXT("CREATING A .RES FILE:\n")
04143       TEXT("    rc.exe {resource file}\n")
04144       TEXT("CREATING A .DLL FILE:\n")
04145       TEXT("    link.exe /DLL /NOENTRY /NODEFAULTLIB /MACHINE:iX86\n")
04146       TEXT("         /OUT:{resource DLL} {compiled res file}\n")
04147       );
04148 }
04149
04150 ///////////////////////////////////////////////////////////
04151 // SkipWhiteSpace
04152 TCHAR SkipWhiteSpace(TCHAR*& rpch)
04153 {
04154   TCHAR ch = 0;
04155   if (rpch)
04156   {
04157     for (; (ch = *rpch) == TEXT(' ') || ch == TEXT('\t'); rpch++)
04158       ;
04159   }
04160   return ch;
04161 }
04162
04163 ///////////////////////////////////////////////////////////
04164 // SkipValue
04165 BOOL SkipValue(TCHAR*& rpch)
04166 {
04167   if ( !rpch )
04168     return FALSE;
04169
04170   TCHAR ch = *rpch;
04171   if (ch == 0 || ch == TEXT('/') || ch == TEXT('-'))
04172     return FALSE;   // no value present
04173
04174   TCHAR *pchSwitchInUnbalancedQuotes = NULL;
04175
04176   for (; (ch = *rpch) != TEXT(' ') && ch != TEXT('\t') && ch != 0; rpch++)
04177   {
04178     if (*rpch == TEXT('"'))
04179     {
04180       rpch++; // for '"'
04181
04182       for (; (ch = *rpch) != TEXT('"') && ch != 0; rpch = CharNext(rpch))
04183       {
04184         if ((ch == TEXT('/') || ch == TEXT('-')) && (NULL == pchSwitchInUnbalancedQuotes))
04185         {
04186           pchSwitchInUnbalancedQuotes = rpch;
04187         }
04188       }
04189       rpch = CharNext(rpch);
04190             ch = *rpch;
04191             break;
04192     }
04193   }
04194   if (ch != 0)
04195   {
04196     *rpch++ = 0;
04197   }
04198   else
04199   {
04200     if (pchSwitchInUnbalancedQuotes)
04201       rpch=pchSwitchInUnbalancedQuotes;
04202   }
04203   return TRUE;
04204 }
04205
04206 ///////////////////////////////////////////////////////////
04207 // Error
04208 void Error(TCHAR* szMsg)
04209 {
04210   if (szMsg)
04211     _tprintf(TEXT("MSILOC ERROR: %s\n"), szMsg);
04212   throw 1;
04213 }
04214
04215 ///////////////////////////////////////////////////////////
04216 // ErrorIf
04217 void ErrorIf(BOOL fError, TCHAR* szMsg, BOOL fThrow)
04218 {
04219   if (fError)
04220   {
04221     if (szMsg)
04222             _tprintf(TEXT("MSILOC ERROR: %s\n"), szMsg);
04223     if (fThrow)
04224       throw 1;
04225   }
04226 }
04227
04228 ///////////////////////////////////////////////////////////
04229 // _tmain
04230 extern "C" int __cdecl _tmain(int argc, TCHAR* argv[])
04231 {
04232   // WE WANT UNICODE ON NT/Windows2000
04233   // ?? ANSI on WIN9x
04234
04235   try
04236   {
04237     TCHAR* szCmdLine = GetCommandLine();
04238     if ( !szCmdLine )
04239     {
04240       Usage();
04241       throw 1;
04242     }
04243
04244     TCHAR* pch = szCmdLine;
04245     // skip module name
04246     if ( !SkipValue(pch) )
04247     {
04248       Usage();
04249       throw 1;
04250     }
04251
04252     TCHAR chCmdNext;
04253
04254     TCHAR* rgszTables[MAX_STRINGS];
04255     TCHAR* rgszColumns[MAX_STRINGS];
04256     TCHAR* rgszDialogs[MAX_DIALOGS];
04257     TCHAR* szDb = 0;
04258     TCHAR* szRESDLL = 0;
04259     TCHAR* szSaveDatabase = 0;
04260     int cStr = 0;
04261     int cDlg = 0;
04262     int iMode = 0;
04263     while ((chCmdNext = SkipWhiteSpace(pch)) != 0)
04264     {
04265       if (chCmdNext == TEXT('/') || chCmdNext == TEXT('-'))
04266       {
04267         TCHAR* szCmdOption = pch++;
04268         TCHAR chOption = (TCHAR)(*pch++ | 0x20);
04269         chCmdNext = SkipWhiteSpace(pch);
04270         TCHAR* szCmdData = pch;
04271         switch (chOption)
04272         {
04273         case TEXT('i'):
04274           iMode |= iIMPORT_RES;
04275           if (!SkipValue(pch))
04276             Error(TEXT("Missing Option Data (option = I)\n"));
04277           szDb = szCmdData;
04278           szCmdData = pch;
04279           if (!SkipValue(pch))
04280             Error(TEXT("Missing Option Data (option = I)\n"));
04281           szRESDLL = szCmdData;
04282           break;
04283         case TEXT('e'):
04284           iMode |= iEXPORT_MSI;
04285           if (!SkipValue(pch))
04286             Error(TEXT("Missing Option Data (option = E)\n"));
04287           szDb = szCmdData;
04288           break;
04289         case TEXT('d'):
04290           iMode |= iDIALOGS;
04291           if (!SkipValue(pch))
04292             Error(TEXT("Missing Option Data (option = D)\n"));
04293           if (cDlg == MAX_DIALOGS)
04294             Error(TEXT("Too Many Dialogs On Command Line\n"));
04295           rgszDialogs[cDlg++] = szCmdData;
04296           break;
04297         case TEXT('s'):
04298           iMode |= iSTRINGS;
04299           if (!SkipValue(pch))
04300             Error(TEXT("Missing Option Data (option = S)\n"));
04301           if (cStr == MAX_STRINGS)
04302             Error(TEXT("Too Many Table:Column Pairs On Command Line\n"));
04303           rgszTables[cStr] = szCmdData;
04304           szCmdData = pch;
04305           if (!SkipValue(pch))
04306             Error(TEXT("Missing Option Data (option = S)\n"));
04307           rgszColumns[cStr++] = szCmdData;
04308           break;
04309         case TEXT('x'):
04310           iMode |= iSKIP_BINARY;
04311           break;
04312         case TEXT('c'):
04313           iMode |= iCREATE_NEW_DB;
04314           if (!SkipValue(pch))
04315             Error(TEXT("Missing Option Data (option = C)\n"));
04316           szSaveDatabase = szCmdData;
04317           break;
04318         case TEXT('?'):
04319           Usage();
04320           return 0;
04321         default:
04322           Usage();
04323           return 1;
04324         }
04325       }
04326       else
04327       {
04328         Usage();
04329         return 1;
04330       }
04331     }
04332
04333     // must specify either EXPORT or IMPORT, but not both
04334     if (iMode == 0 || (iMode & (iEXPORT_MSI | iIMPORT_RES)) == (iEXPORT_MSI | iIMPORT_RES) ||
04335       (iMode & ~(iEXPORT_MSI | iIMPORT_RES)) == 0)
04336     {
04337       Usage();
04338       throw 1;
04339     }
04340
04341     if ((iMode & iCREATE_NEW_DB) && !szDb)
04342     {
04343       Usage();
04344       throw 1;
04345     }
04346
04347     if ((iMode & iEXPORT_MSI) && szDb)
04348     {
04349       // export MSI to RESOURCE file
04350       CGenerateRC genRC(szDb, (iMode & iCREATE_NEW_DB) ? szSaveDatabase : NULL);
04351       if (iMode & iDIALOGS)
04352       {
04353         // export DIALOGS
04354         BOOL fBinary = (iMode & iSKIP_BINARY) ? FALSE : TRUE;
04355         if (1 == cDlg && 0 == _tcscmp(TEXT("*"), rgszDialogs[0]))
04356         {
04357           // export all dialogs
04358           ErrorIf(ERROR_SUCCESS != genRC.OutputDialogs(fBinary), TEXT("Failed to Export Dialogs To Resource File"), true);
04359         }
04360         else
04361         {
04362           // export specified dialogs only
04363           // we'll try every dialog listed so we won't through the error
04364           for (int i = 0; i < cDlg; i++)
04365             ErrorIf(ERROR_SUCCESS != genRC.OutputDialog(rgszDialogs[i], fBinary), TEXT("Failed to Export Dialog To Resource File"), false);
04366           ErrorIf(genRC.IsInErrorState(), TEXT("EXPORT failed"), true);
04367         }
04368       }
04369       if (iMode & iSTRINGS)
04370       {
04371         // export STRINGS
04372         if (1 == cStr && 0 == _tcscmp(TEXT("*"), rgszTables[0]) && 0 == _tcscmp(TEXT("*"), rgszColumns[0]))
04373         {
04374           // export all strings
04375           // NOT SUPPORTED
04376           _tprintf(TEXT("EXPORT ALL STRINGS OPTION is not supported\n"));
04377           Usage();
04378           throw 1;
04379         }
04380         for (int i = 0; i < cStr; i++)
04381           ErrorIf(ERROR_SUCCESS != genRC.OutputString(rgszTables[i], rgszColumns[i]), TEXT("Failed to Export Strings"), false);
04382         ErrorIf(genRC.IsInErrorState(), TEXT("EXPORT STRINGS failed"), true);
04383       }
04384     }
04385     else if ((iMode & iIMPORT_RES) && szDb && szRESDLL)
04386     {
04387       // import RESOURCE DLL into MSI
04388       CImportRes importRes(szDb, (iMode & iCREATE_NEW_DB) ? szSaveDatabase  : NULL, szRESDLL);
04389       if (iMode & iDIALOGS)
04390       {
04391         // import DIALOGS
04392         if (1 == cDlg && 0 == _tcscmp(TEXT("*"), rgszDialogs[0]))
04393         {
04394           // import all dialogs
04395           ErrorIf(ERROR_SUCCESS != importRes.ImportDialogs(), TEXT("Failed to Import Dialogs Into Database"), true);
04396         }
04397         else
04398         {
04399           // import specified dialogs only
04400           // we'll try every dialog listed so we won't through the error
04401           for (int i = 0; i < cDlg; i++)
04402             ErrorIf(ERROR_SUCCESS != importRes.ImportDialog(rgszDialogs[i]), TEXT("Failed to Import Dialog Into Database"), false);
04403           ErrorIf(importRes.IsInErrorState(), TEXT("IMPORT failed"), true);
04404         }
04405       }
04406       if (iMode & iSTRINGS)
04407       {
04408         // import STRINGS
04409         if (1 == cStr && 0 == _tcscmp(TEXT("*"), rgszTables[0]) && 0 == _tcscmp(TEXT("*"), rgszColumns[0]))
04410         {
04411           // import all strings
04412           ErrorIf(importRes.ImportStrings(), TEXT("IMPORT STRINGS failed"), true);
04413         }
04414         else
04415         {
04416           // import specific strings only
04417           // UNSUPPORTED option
04418           _tprintf(TEXT("IMPORT SPECIFIC STRINGS option is not supported\n"));
04419           Usage();
04420           throw 1;
04421         }
04422       }
04423     }
04424     else
04425     {
04426       Usage();
04427       throw 1;
04428     }
04429     return 0;
04430   }
04431   catch (int i)
04432   {
04433     i;
04434     return 1;
04435   }
04436   catch (...)
04437   {
04438     _tprintf(TEXT("\n MSILOC: unhandled exception.\n"));
04439     return 2;
04440   }
04441
04442 } // end of main
04443
04444 #else // RC_INVOKED, end of source code, start of resources
04445 // resource definition go here
04446 #endif // RC_INVOKED
04447 #if 0
04448 !endif // makefile terminator
04449 #endif
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditHost/Snap.h Source File

  • Web
  • Browser
  • EditHost

Snap.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Snap.h : Declaration of the CSnap
00006
00007 #ifndef __SNAP_H_
00008 #define __SNAP_H_
00009
00010 #include "resource.h"       // main symbols
00011 #include "mshtml.h"
00012
00013 /////////////////////////////////////////////////////////////////////////////
00014 // CSnap
00015 class ATL_NO_VTABLE CSnap :
00016   public CComObjectRootEx<CComSingleThreadModel>,
00017   public CComCoClass<CSnap, &CLSID_Snap>,
00018   public IDispatchImpl<ISnap, &IID_ISnap, &LIBID_EDHOSTLib>,
00019   public IHTMLEditHost
00020 {
00021 public:
00022   CSnap() : m_lSnapIncrement(40), m_bSnapOn(FALSE)
00023   {
00024   }
00025
00026 DECLARE_REGISTRY_RESOURCEID(IDR_SNAP)
00027
00028 DECLARE_PROTECT_FINAL_CONSTRUCT()
00029
00030 BEGIN_COM_MAP(CSnap)
00031   COM_INTERFACE_ENTRY(ISnap)
00032   COM_INTERFACE_ENTRY(IDispatch)
00033   COM_INTERFACE_ENTRY(IHTMLEditHost)
00034 END_COM_MAP()
00035
00036 long m_lSnapIncrement;
00037 BOOL m_bSnapOn;
00038
00039 // ISnap
00040
00041 public:
00042   STDMETHOD(get_SnapOn)(/*[out, retval]*/ BOOL *pVal);
00043   STDMETHOD(put_SnapOn)(/*[in]*/ BOOL newVal);
00044   STDMETHOD(get_SnapIncrement)(/*[out, retval]*/ long *pVal);
00045   STDMETHOD(put_SnapIncrement)(/*[in]*/ long newVal);
00046   STDMETHOD(SnapRect)(IHTMLElement *pIElement,
00047             RECT *prcNew,
00048             ELEMENT_CORNER eHandle);
00049 };
00050
00051 #endif //__SNAP_H_
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCloseQueueDialog Member List

This is the complete list of members for CCloseQueueDialog, including all inherited members.
CCloseQueueDialog(CArray< ARRAYQ *, ARRAYQ * > *, CWnd *pParent=NULL) | CCloseQueueDialog |
DoDataExchange(CDataExchange *pDX) | CCloseQueueDialog | [protected, virtual]
GetPathName(TCHAR szPathName[BUFFERSIZE]) | CCloseQueueDialog | [inline]
IDD enum value | CCloseQueueDialog |
m_PathNameCB | CCloseQueueDialog |
m_pStrArray | CCloseQueueDialog |
m_szPathName | CCloseQueueDialog |
OnInitDialog() | CCloseQueueDialog | [protected, virtual]
Generated on Wed Nov 13 2024 16:55:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/adddevicedlg.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

adddevicedlg.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  AddDeviceDlg.h:  Header for the CAddDeviceDlg class.  This is a
00014 //                   modeless dialog class used to add device nodes.
00015 //
00016
00017
00018 #ifndef _CLASS_ADDDEVICEDLG_
00019 #define _CLASS_ADDDEVICEDLG_
00020
00021
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025
00026
00027 #include "BaseDialog.h"
00028
00029
00030 //---------------------------------------------------------------------------
00031 class CAddDeviceDlg : public CBaseDialog
00032 {
00033   public:
00034     CAddDeviceDlg( ULONG nTemplate, HWND hParentWnd );
00035     ~CAddDeviceDlg();
00036
00037
00038   public:
00039     BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
00040
00041
00042   // Messages we will be handling
00043   private:
00044     LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00045     LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00046
00047   private:
00048     HWND    m_hParentWnd;
00049
00050
00051 };
00052
00053 #endif //_CLASS_ADDDEVICEDLG_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PMmStream Member List

This is the complete list of members for PMmStream, including all inherited members.
Close()=0 | PMmStream | [pure virtual]
Flush(CMmStreamBuf &sbuf, ULONG cb)=0 | PMmStream | [pure virtual]
Flush() | PMmStream | [inline, virtual]
isEmpty()=0 | PMmStream | [pure virtual]
isWritable()=0 | PMmStream | [pure virtual]
Map(CMmStreamBuf &sbuf, ULONG cb=0, ULONG offLow=0, ULONG offHigh=0, BOOL fMapForWrite=FALSE)=0 | PMmStream | [pure virtual]
MapAll(CMmStreamBuf &sbuf)=0 | PMmStream | [pure virtual]
Ok()=0 | PMmStream | [pure virtual]
SetSize(PStorage &storage, ULONG newSizeLow, ULONG newSizeHigh=0)=0 | PMmStream | [pure virtual]
ShrinkFromFront(ULONG firstPage, ULONG numPages) | PMmStream | [inline, virtual]
Size() const =0 | PMmStream | [pure virtual]
SizeHigh()=0 | PMmStream | [pure virtual]
SizeLow()=0 | PMmStream | [pure virtual]
Unmap(CMmStreamBuf &sbuf)=0 | PMmStream | [pure virtual]
~PMmStream() | PMmStream | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IAS/MapName/mapname.c Source File

  • NetDS
  • IAS
  • MapName

mapname.c

Go to the documentation of this file.
00001 /* Copyright (c) Microsoft Corporation. All rights reserved. */
00002
00003 #include "windows.h"
00004 #include "authif.h"
00005 #include "lmcons.h"
00006 #include "ntsecapi.h"
00007 #include "radutil.h"
00008
00009 /* The registry value where this extension is registered. */
00010 LPCWSTR pwszDllType = AUTHSRV_EXTENSIONS_VALUE_W;
00011
00012 /* Global handle to the LSA. This is initialized once at start-up and reused
00013  * until shutdown. */
00014 LSA_HANDLE hPolicy = NULL;
00015
00016
00017 DWORD
00018 WINAPI
00019 RadiusExtensionInit( VOID )
00020 {
00021    NTSTATUS status;
00022    LSA_OBJECT_ATTRIBUTES objectAttributes;
00023
00024    memset(&objectAttributes, 0, sizeof(objectAttributes));
00025    status = LsaOpenPolicy(
00026                NULL,
00027                &objectAttributes,
00028                POLICY_LOOKUP_NAMES,
00029                &hPolicy
00030                );
00031
00032    return LsaNtStatusToWinError(status);
00033 }
00034
00035
00036 VOID
00037 WINAPI
00038 RadiusExtensionTerm( VOID )
00039 {
00040    LsaClose(hPolicy);
00041    hPolicy = NULL;
00042 }
00043
00044
00045 DWORD
00046 WINAPI
00047 RadiusExtensionProcess2(
00048    PRADIUS_EXTENSION_CONTROL_BLOCK pECB
00049    )
00050 {
00051    PRADIUS_ATTRIBUTE_ARRAY pInAttrs;
00052    const RADIUS_ATTRIBUTE* pAttr;
00053    int nChar;
00054    WCHAR wszUserName[UNLEN];
00055    CHAR szUserName[UNLEN];
00056    LSA_UNICODE_STRING lusName;
00057    NTSTATUS status;
00058    PLSA_REFERENCED_DOMAIN_LIST pReferencedDomains;
00059    PLSA_TRANSLATED_SID pSids;
00060    DWORD cbDataLength, dwResult;
00061    RADIUS_ATTRIBUTE raNewName;
00062
00063    /* We only process authentication. */
00064    if (pECB->repPoint != repAuthentication)
00065    {
00066       return NO_ERROR;
00067    }
00068
00069    /* We only process Access-Requests. */
00070    if (pECB->rcRequestType != rcAccessRequest)
00071    {
00072       return NO_ERROR;
00073    }
00074
00075    /* Don't process if it's already been rejected. */
00076    if (pECB->rcResponseType == rcAccessReject)
00077    {
00078       return NO_ERROR;
00079    }
00080
00081    /* Get the attributes from the Access-Request. */
00082    pInAttrs = pECB->GetRequest(pECB);
00083
00084    /* Only process Windows users */
00085    pAttr = RadiusFindFirstAttribute(pInAttrs, ratProvider);
00086    if ((pAttr == NULL) || (pAttr->dwValue != rapWindowsNT))
00087    {
00088       return NO_ERROR;
00089    }
00090
00091    /* Retrieve the username. If it doesn't exist, there's nothing to do. */
00092    pAttr = RadiusFindFirstAttribute(pInAttrs, ratUserName);
00093    if (pAttr == NULL)
00094    {
00095       return NO_ERROR;
00096    }
00097
00098    /* If the username already includes a domain name or if it's a user
00099     * principal name (UPN), then we don't have to do anything. */
00100    if (memchr(pAttr->lpValue, '\\', pAttr->cbDataLength) != NULL)
00101    {
00102       return NO_ERROR;
00103    }
00104    if (memchr(pAttr->lpValue, '@', pAttr->cbDataLength) != NULL)
00105    {
00106       return NO_ERROR;
00107    }
00108
00109    /* Convert the username to Unicode. */
00110    nChar = MultiByteToWideChar(
00111               CP_ACP,
00112               MB_ERR_INVALID_CHARS,
00113               pAttr->lpValue,
00114               pAttr->cbDataLength,
00115               wszUserName,
00116               UNLEN
00117               );
00118    if (nChar == 0)
00119    {
00120       return GetLastError();
00121    }
00122
00123    /* Pack the username into an LSA_UNICODE_STRING struct. */
00124    lusName.Length = nChar * sizeof(WCHAR);
00125    lusName.MaximumLength = lusName.Length;
00126    lusName.Buffer = wszUserName;
00127
00128    /* Lookup the name. */
00129    status = LsaLookupNames(
00130                hPolicy,
00131                1,
00132                &lusName,
00133                &pReferencedDomains,
00134                &pSids
00135                );
00136    if (!LSA_SUCCESS(status))
00137    {
00138       return LsaNtStatusToWinError(status);
00139    }
00140
00141    /* Get the domain which has the user account */
00142    lusName = pReferencedDomains->Domains[pSids[0].DomainIndex].Name;
00143
00144    /* Convert to an ANSI string. */
00145    nChar = WideCharToMultiByte(
00146               CP_ACP,
00147               0,
00148               lusName.Buffer,
00149               (lusName.Length / sizeof(WCHAR)),
00150               szUserName,
00151               UNLEN,
00152               NULL,
00153               NULL
00154               );
00155
00156    LsaFreeMemory(pReferencedDomains);
00157    LsaFreeMemory(pSids);
00158
00159    if (nChar == 0)
00160    {
00161       return GetLastError();
00162    }
00163
00164    /* New attribute is the domain plus delimiter plus username */
00165    cbDataLength = nChar + 1 + pAttr->cbDataLength;
00166    if (cbDataLength > UNLEN)
00167    {
00168       return ERROR_BAD_USERNAME;
00169    }
00170
00171    /* Build the fully-qualified username. */
00172    szUserName[nChar] = '\\';
00173    memcpy(szUserName + nChar + 1, pAttr->lpValue, pAttr->cbDataLength);
00174
00175    /* Fill in the RADIUS_ATTRIBUTE struct. */
00176    raNewName.fDataType = rdtString;
00177    raNewName.cbDataLength = cbDataLength;
00178    raNewName.lpValue = szUserName;
00179
00180    /* Add as both the ratStrippedUserName and the ratFQUserName. */
00181    raNewName.dwAttrType = ratStrippedUserName;
00182    dwResult = RadiusReplaceFirstAttribute(pInAttrs, &raNewName);
00183    if (dwResult == NO_ERROR)
00184    {
00185       raNewName.dwAttrType = ratFQUserName;
00186       dwResult = RadiusReplaceFirstAttribute(pInAttrs, &raNewName);
00187    }
00188
00189    return dwResult;
00190 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpAuth Member List

This is the complete list of members for CImpAuth, including all inherited members.
AddRef(void) | CImpAuth | [virtual]
Authenticate(HWND *phwnd, LPWSTR *pwszUserName, LPWSTR *pwszPassword) | CImpAuth | [virtual]
CImpAuth() | CImpAuth |
m_nRefs | CImpAuth | [private]
m_wszPassword | CImpAuth | [private]
m_wszUserName | CImpAuth | [private]
QueryInterface(REFIID iid, void **ppvObject) | CImpAuth | [virtual]
Release(void) | CImpAuth | [virtual]
Set(LPWSTR wszUserName, LPWSTR wszPassword) | CImpAuth |
~CImpAuth() | CImpAuth |
Generated on Wed Nov 13 2024 16:56:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/PreComp.h Source File

  • NetDS
  • SyncMgr
  • SyncDir

PreComp.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #include <objbase.h>
00013 #include <windows.h>
00014 #include <shlobj.h>
00015 #include <commctrl.h>
00016 #include <advpub.h>
00017
00018 #include <mobsync.h>
00019
00020 #include "resource.h"
00021
00022 #include "debug.h"
00023 #include "alloc.h"
00024 #include "critsect.h"
00025 #include "helper.h"
00026 #include "enum.h"
00027
00028 #include "guid.h"
00029 #include "settings.h"
00030 #include "cfact.h"
00031 #include "reg.h"
00032 #include "dllmain.h"
00033
00034 #include "handler.h"
00035
00036 #pragma hdrstop
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims_WebControl/C#/AutoClaims.cs Source File

  • TabletPC
  • AutoClaims_WebControl
  • C#

AutoClaims.cs

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 //  This is part of the Microsoft Tablet PC Platform SDK
00004 //  Copyright (C) 2002 Microsoft Corporation
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00009 //  documentation provided with the Software Development Kit.
00010 //  See these sources for more detailed information.
00011 //
00012 //  File: AutoClaims.cs
00013 //  AutoClaims Sample Application
00014 //
00015 //  This sample program simulates an auto insurance claim
00016 //  control. It uses the InkEdit control to allow the user to
00017 //  enter vehicle information and the InkPicture control to
00018 //  illustrate car damage.  The car damage diagram allows
00019 //  the user to select from multiple ink layers;  each layer
00020 //  has its own color and visibility setting.
00021 //
00022 //  The features used are: InkEdit, InkPicture, providing
00023 //  multiple layers of ink within a control.
00024 //
00025 //--------------------------------------------------------------------------
00026
00027 using System;
00028 using System.Drawing;
00029 using System.Windows.Forms;
00030 using System.Data;
00031
00032 // The Ink namespace, which contains the Tablet PC Platform API
00033 using Microsoft.Ink;
00034
00035 namespace AutoClaims
00036 {
00037     /// <summary>
00038     /// InkLayer represents a given ink layer, which has a
00039     /// color and visibility setting associated with it.
00040     /// </summary>
00041     struct InkLayer
00042     {
00043         // Declare the ink, color, and visibility for this layer
00044         private Ink myInk;
00045         private Color myColor;
00046         private bool myHidden;
00047
00048         /// <summary>
00049         /// Constructor for InkLayer
00050         /// </summary>
00051         /// <param name="ink">The ink</param>
00052         /// <param name="color">The color of the layer</param>
00053         /// <param name="hidden">True if the layer is hidden</param>
00054         public InkLayer(Ink ink, Color color, bool hidden)
00055         {
00056             myInk = ink;
00057             myColor = color;
00058             myHidden = hidden;
00059         }
00060
00061         /// <summary>
00062         /// The property used to set the ink associated with this layer
00063         /// </summary>
00064         public Ink ActiveInk
00065         {
00066             get
00067             {
00068                 return myInk;
00069             }
00070             set
00071             {
00072                 myInk = value;
00073             }
00074         }
00075
00076         /// <summary>
00077         /// The color associated with this layer
00078         /// </summary>
00079         public Color ActiveColor
00080         {
00081             get
00082             {
00083                 return myColor;
00084             }
00085             set
00086             {
00087                 myColor = value;
00088             }
00089         }
00090
00091         /// <summary>
00092         /// True if this layer is hidden.
00093         /// </summary>
00094         public bool Hidden
00095         {
00096             get
00097             {
00098                 return myHidden;
00099             }
00100             set
00101             {
00102                 myHidden = value;
00103             }
00104         }
00105     }
00106
00107     /// <summary>
00108     /// The AutoClaims Sample Application form class
00109     /// </summary>
00110     public class AutoClaims : System.Windows.Forms.UserControl
00111     {
00112
00113         // Declare the array of ink layers used the vehicle illustration.
00114         InkLayer[] inkLayers;
00115
00116         // Declare an empty ink object (used when we don't want to draw
00117         // any ink).
00118         Ink emptyInk;
00119
00120         // Declare a value to hold the index of selected ink
00121         int selectedIndex = -1;
00122
00123         // Declare a value to hold whether the selected ink is hidden
00124         bool selectedHidden = false;
00125
00126         #region Standard Template Code
00127         internal System.Windows.Forms.CheckBox chHideLayer;
00128         internal System.Windows.Forms.Label lblVehicleDamage;
00129         internal System.Windows.Forms.Label lblVehicleDescription;
00130         internal System.Windows.Forms.Label lblModel;
00131         internal System.Windows.Forms.Label lblYear;
00132         internal System.Windows.Forms.Label lblMake;
00133         internal System.Windows.Forms.Label lblPolicyNumber;
00134         internal System.Windows.Forms.Label lblInsuredName;
00135         internal System.Windows.Forms.Label lblInstructions;
00136         internal System.Windows.Forms.Label lblTitle;
00137         internal System.Windows.Forms.PictureBox pictVehicleBox;
00138         internal System.Windows.Forms.PictureBox pictPolicyBox;
00139         internal System.Windows.Forms.PictureBox pictHorzontalBar2;
00140         internal System.Windows.Forms.PictureBox pictHorzontalBar3;
00141         internal System.Windows.Forms.PictureBox pictHorzontalBar1;
00142         internal System.Windows.Forms.PictureBox pictCheckmarks;
00143         internal System.Windows.Forms.ListBox lstAnnotationLayer;
00144         private Microsoft.Ink.InkPicture inkPictVehicle;
00145         private Microsoft.Ink.InkEdit inkEdPolicyNumber;
00146         private Microsoft.Ink.InkEdit inkEdName;
00147         private Microsoft.Ink.InkEdit inkEdYear;
00148         private Microsoft.Ink.InkEdit inkEdMake;
00149         private Microsoft.Ink.InkEdit inkEdModel;
00150         private System.ComponentModel.Container components = null;
00151         #endregion
00152
00153         public AutoClaims()
00154         {
00155             #region Standard Template Code
00156             //
00157             // Required for Windows Form Designer support
00158             //
00159             InitializeComponent();
00160             #endregion
00161         }
00162
00163         #region Standard Template Code
00164         /// <summary>
00165         /// Clean up any resources being used.
00166         /// </summary>
00167         protected override void Dispose( bool disposing )
00168         {
00169             if( disposing )
00170             {
00171                 if (components != null)
00172                 {
00173                     components.Dispose();
00174                 }
00175             }
00176             base.Dispose( disposing );
00177         }
00178         #endregion
00179
00180         #region Windows Form Designer generated code
00181         /// <summary>
00182         /// Required method for Designer support - do not modify
00183         /// the contents of this method with the code editor.
00184         /// </summary>
00185         private void InitializeComponent()
00186         {
00187             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AutoClaims));
00188             this.lblVehicleDamage = new System.Windows.Forms.Label();
00189             this.lblVehicleDescription = new System.Windows.Forms.Label();
00190             this.lblModel = new System.Windows.Forms.Label();
00191             this.lblYear = new System.Windows.Forms.Label();
00192             this.lblMake = new System.Windows.Forms.Label();
00193             this.lblPolicyNumber = new System.Windows.Forms.Label();
00194             this.lblInsuredName = new System.Windows.Forms.Label();
00195             this.chHideLayer = new System.Windows.Forms.CheckBox();
00196             this.pictHorzontalBar2 = new System.Windows.Forms.PictureBox();
00197             this.pictVehicleBox = new System.Windows.Forms.PictureBox();
00198             this.pictHorzontalBar3 = new System.Windows.Forms.PictureBox();
00199             this.pictPolicyBox = new System.Windows.Forms.PictureBox();
00200             this.pictHorzontalBar1 = new System.Windows.Forms.PictureBox();
00201             this.lblInstructions = new System.Windows.Forms.Label();
00202             this.lblTitle = new System.Windows.Forms.Label();
00203             this.pictCheckmarks = new System.Windows.Forms.PictureBox();
00204             this.inkPictVehicle = new Microsoft.Ink.InkPicture();
00205             this.lstAnnotationLayer = new System.Windows.Forms.ListBox();
00206             this.inkEdPolicyNumber = new Microsoft.Ink.InkEdit();
00207             this.inkEdName = new Microsoft.Ink.InkEdit();
00208             this.inkEdYear = new Microsoft.Ink.InkEdit();
00209             this.inkEdMake = new Microsoft.Ink.InkEdit();
00210             this.inkEdModel = new Microsoft.Ink.InkEdit();
00211             this.SuspendLayout();
00212             //
00213             // lblVehicleDamage
00214             //
00215             this.lblVehicleDamage.AutoSize = true;
00216             this.lblVehicleDamage.BackColor = System.Drawing.Color.White;
00217             this.lblVehicleDamage.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00218             this.lblVehicleDamage.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00219             this.lblVehicleDamage.Location = new System.Drawing.Point(8, 408);
00220             this.lblVehicleDamage.Name = "lblVehicleDamage";
00221             this.lblVehicleDamage.Size = new System.Drawing.Size(256, 20);
00222             this.lblVehicleDamage.TabIndex = 58;
00223             this.lblVehicleDamage.Text = "Description of vehicle damage";
00224             this.lblVehicleDamage.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00225             //
00226             // lblVehicleDescription
00227             //
00228             this.lblVehicleDescription.AutoSize = true;
00229             this.lblVehicleDescription.BackColor = System.Drawing.Color.White;
00230             this.lblVehicleDescription.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00231             this.lblVehicleDescription.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00232             this.lblVehicleDescription.Location = new System.Drawing.Point(8, 240);
00233             this.lblVehicleDescription.Name = "lblVehicleDescription";
00234             this.lblVehicleDescription.Size = new System.Drawing.Size(386, 20);
00235             this.lblVehicleDescription.TabIndex = 56;
00236             this.lblVehicleDescription.Text = "Enter the involved vehicle listed on the policy ";
00237             this.lblVehicleDescription.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00238             //
00239             // lblModel
00240             //
00241             this.lblModel.AutoSize = true;
00242             this.lblModel.BackColor = System.Drawing.Color.Gainsboro;
00243             this.lblModel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00244             this.lblModel.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00245             this.lblModel.Location = new System.Drawing.Point(112, 360);
00246             this.lblModel.Name = "lblModel";
00247             this.lblModel.Size = new System.Drawing.Size(73, 23);
00248             this.lblModel.TabIndex = 52;
00249             this.lblModel.Text = "Model:";
00250             this.lblModel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00251             //
00252             // lblYear
00253             //
00254             this.lblYear.AutoSize = true;
00255             this.lblYear.BackColor = System.Drawing.Color.Gainsboro;
00256             this.lblYear.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00257             this.lblYear.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00258             this.lblYear.Location = new System.Drawing.Point(48, 280);
00259             this.lblYear.Name = "lblYear";
00260             this.lblYear.Size = new System.Drawing.Size(135, 23);
00261             this.lblYear.TabIndex = 51;
00262             this.lblYear.Text = "Year (YYYY):";
00263             this.lblYear.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00264             //
00265             // lblMake
00266             //
00267             this.lblMake.AutoSize = true;
00268             this.lblMake.BackColor = System.Drawing.Color.Gainsboro;
00269             this.lblMake.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00270             this.lblMake.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00271             this.lblMake.Location = new System.Drawing.Point(112, 320);
00272             this.lblMake.Name = "lblMake";
00273             this.lblMake.Size = new System.Drawing.Size(67, 23);
00274             this.lblMake.TabIndex = 50;
00275             this.lblMake.Text = "Make:";
00276             this.lblMake.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00277             //
00278             // lblPolicyNumber
00279             //
00280             this.lblPolicyNumber.AutoSize = true;
00281             this.lblPolicyNumber.BackColor = System.Drawing.Color.Gainsboro;
00282             this.lblPolicyNumber.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00283             this.lblPolicyNumber.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00284             this.lblPolicyNumber.Location = new System.Drawing.Point(32, 136);
00285             this.lblPolicyNumber.Name = "lblPolicyNumber";
00286             this.lblPolicyNumber.Size = new System.Drawing.Size(157, 23);
00287             this.lblPolicyNumber.TabIndex = 47;
00288             this.lblPolicyNumber.Text = "Policy Number:";
00289             this.lblPolicyNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00290             //
00291             // lblInsuredName
00292             //
00293             this.lblInsuredName.AutoSize = true;
00294             this.lblInsuredName.BackColor = System.Drawing.Color.Gainsboro;
00295             this.lblInsuredName.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00296             this.lblInsuredName.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00297             this.lblInsuredName.Location = new System.Drawing.Point(32, 176);
00298             this.lblInsuredName.Name = "lblInsuredName";
00299             this.lblInsuredName.Size = new System.Drawing.Size(154, 23);
00300             this.lblInsuredName.TabIndex = 46;
00301             this.lblInsuredName.Text = "Insured Name:";
00302             this.lblInsuredName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00303             //
00304             // chHideLayer
00305             //
00306             this.chHideLayer.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00307             this.chHideLayer.Location = new System.Drawing.Point(416, 576);
00308             this.chHideLayer.Name = "chHideLayer";
00309             this.chHideLayer.Size = new System.Drawing.Size(144, 24);
00310             this.chHideLayer.TabIndex = 61;
00311             this.chHideLayer.Text = "Hide Layer";
00312             this.chHideLayer.CheckedChanged += new System.EventHandler(this.chHideLayer_CheckedChanged);
00313             //
00314             // pictHorzontalBar2
00315             //
00316             this.pictHorzontalBar2.BackColor = System.Drawing.SystemColors.AppWorkspace;
00317             this.pictHorzontalBar2.Location = new System.Drawing.Point(8, 224);
00318             this.pictHorzontalBar2.Name = "pictHorzontalBar2";
00319             this.pictHorzontalBar2.Size = new System.Drawing.Size(536, 2);
00320             this.pictHorzontalBar2.TabIndex = 57;
00321             this.pictHorzontalBar2.TabStop = false;
00322             //
00323             // pictVehicleBox
00324             //
00325             this.pictVehicleBox.BackColor = System.Drawing.Color.Gainsboro;
00326             this.pictVehicleBox.Location = new System.Drawing.Point(8, 272);
00327             this.pictVehicleBox.Name = "pictVehicleBox";
00328             this.pictVehicleBox.Size = new System.Drawing.Size(184, 120);
00329             this.pictVehicleBox.TabIndex = 49;
00330             this.pictVehicleBox.TabStop = false;
00331             //
00332             // pictHorzontalBar3
00333             //
00334             this.pictHorzontalBar3.BackColor = System.Drawing.SystemColors.AppWorkspace;
00335             this.pictHorzontalBar3.Location = new System.Drawing.Point(8, 400);
00336             this.pictHorzontalBar3.Name = "pictHorzontalBar3";
00337             this.pictHorzontalBar3.Size = new System.Drawing.Size(536, 2);
00338             this.pictHorzontalBar3.TabIndex = 48;
00339             this.pictHorzontalBar3.TabStop = false;
00340             //
00341             // pictPolicyBox
00342             //
00343             this.pictPolicyBox.BackColor = System.Drawing.Color.Gainsboro;
00344             this.pictPolicyBox.Location = new System.Drawing.Point(8, 128);
00345             this.pictPolicyBox.Name = "pictPolicyBox";
00346             this.pictPolicyBox.Size = new System.Drawing.Size(184, 80);
00347             this.pictPolicyBox.TabIndex = 44;
00348             this.pictPolicyBox.TabStop = false;
00349             //
00350             // pictHorzontalBar1
00351             //
00352             this.pictHorzontalBar1.BackColor = System.Drawing.SystemColors.AppWorkspace;
00353             this.pictHorzontalBar1.Location = new System.Drawing.Point(8, 112);
00354             this.pictHorzontalBar1.Name = "pictHorzontalBar1";
00355             this.pictHorzontalBar1.Size = new System.Drawing.Size(536, 2);
00356             this.pictHorzontalBar1.TabIndex = 43;
00357             this.pictHorzontalBar1.TabStop = false;
00358             //
00359             // lblInstructions
00360             //
00361             this.lblInstructions.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00362             this.lblInstructions.Location = new System.Drawing.Point(96, 48);
00363             this.lblInstructions.Name = "lblInstructions";
00364             this.lblInstructions.Size = new System.Drawing.Size(456, 56);
00365             this.lblInstructions.TabIndex = 42;
00366             this.lblInstructions.Text = "Enter the required information for the policy applicable to the auto claim you ar" +
00367                 "e submitting. Enter the vehicle exactly as it appears on the policy or insurance" +
00368                 " card.";
00369             //
00370             // lblTitle
00371             //
00372             this.lblTitle.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00373             this.lblTitle.Location = new System.Drawing.Point(8, 8);
00374             this.lblTitle.Name = "lblTitle";
00375             this.lblTitle.Size = new System.Drawing.Size(288, 32);
00376             this.lblTitle.TabIndex = 41;
00377             this.lblTitle.Text = "Auto Claim";
00378             //
00379             // pictCheckmarks
00380             //
00381             this.pictCheckmarks.BackColor = System.Drawing.Color.White;
00382             this.pictCheckmarks.BackgroundImage = ((System.Drawing.Bitmap)(resources.GetObject("pictCheckmarks.BackgroundImage")));
00383             this.pictCheckmarks.Location = new System.Drawing.Point(32, 40);
00384             this.pictCheckmarks.Name = "pictCheckmarks";
00385             this.pictCheckmarks.Size = new System.Drawing.Size(40, 72);
00386             this.pictCheckmarks.TabIndex = 66;
00387             this.pictCheckmarks.TabStop = false;
00388             //
00389             // inkPictVehicle
00390             //
00391             this.inkPictVehicle.AutoRedraw = false;
00392             this.inkPictVehicle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
00393             this.inkPictVehicle.Image = ((System.Drawing.Bitmap)(resources.GetObject("inkPictVehicle.Image")));
00394             this.inkPictVehicle.Location = new System.Drawing.Point(32, 440);
00395             this.inkPictVehicle.MarginX = -1;
00396             this.inkPictVehicle.MarginY = -1;
00397             this.inkPictVehicle.Name = "inkPictVehicle";
00398             this.inkPictVehicle.Size = new System.Drawing.Size(352, 232);
00399             this.inkPictVehicle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
00400             this.inkPictVehicle.TabIndex = 67;
00401             this.inkPictVehicle.Paint += new System.Windows.Forms.PaintEventHandler(this.inkPictVehicle_Paint);
00402             //
00403             // lstAnnotationLayer
00404             //
00405             this.lstAnnotationLayer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
00406             this.lstAnnotationLayer.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00407             this.lstAnnotationLayer.ItemHeight = 19;
00408             this.lstAnnotationLayer.Items.AddRange(new object[] {
00409                                                                     "Body",
00410                                                                     "Windows",
00411                                                                     "Tires",
00412                                                                     "Headlights"});
00413             this.lstAnnotationLayer.Location = new System.Drawing.Point(416, 432);
00414             this.lstAnnotationLayer.Name = "lstAnnotationLayer";
00415             this.lstAnnotationLayer.Size = new System.Drawing.Size(104, 135);
00416             this.lstAnnotationLayer.TabIndex = 68;
00417             this.lstAnnotationLayer.SelectedIndexChanged += new System.EventHandler(this.lstAnnotationLayer_SelectedIndexChanged);
00418             //
00419             // inkEdPolicyNumber
00420             //
00421             this.inkEdPolicyNumber.Cursor = System.Windows.Forms.Cursors.Default;
00422             this.inkEdPolicyNumber.Location = new System.Drawing.Point(208, 136);
00423             this.inkEdPolicyNumber.Name = "inkEdPolicyNumber";
00424             this.inkEdPolicyNumber.Size = new System.Drawing.Size(312, 32);
00425             this.inkEdPolicyNumber.TabIndex = 69;
00426             this.inkEdPolicyNumber.Text = "";
00427             this.inkEdPolicyNumber.UseMouseForInput = true;
00428             //
00429             // inkEdName
00430             //
00431             this.inkEdName.Cursor = System.Windows.Forms.Cursors.Default;
00432             this.inkEdName.Location = new System.Drawing.Point(208, 176);
00433             this.inkEdName.Name = "inkEdName";
00434             this.inkEdName.Size = new System.Drawing.Size(312, 32);
00435             this.inkEdName.TabIndex = 70;
00436             this.inkEdName.Text = "";
00437             this.inkEdName.UseMouseForInput = true;
00438             //
00439             // inkEdYear
00440             //
00441             this.inkEdYear.Cursor = System.Windows.Forms.Cursors.Default;
00442             this.inkEdYear.Location = new System.Drawing.Point(208, 280);
00443             this.inkEdYear.Name = "inkEdYear";
00444             this.inkEdYear.Size = new System.Drawing.Size(312, 32);
00445             this.inkEdYear.TabIndex = 71;
00446             this.inkEdYear.Text = "";
00447             this.inkEdYear.UseMouseForInput = true;
00448             //
00449             // inkEdMake
00450             //
00451             this.inkEdMake.Cursor = System.Windows.Forms.Cursors.Default;
00452             this.inkEdMake.Location = new System.Drawing.Point(208, 320);
00453             this.inkEdMake.Name = "inkEdMake";
00454             this.inkEdMake.Size = new System.Drawing.Size(312, 32);
00455             this.inkEdMake.TabIndex = 72;
00456             this.inkEdMake.Text = "";
00457             this.inkEdMake.UseMouseForInput = true;
00458             //
00459             // inkEdModel
00460             //
00461             this.inkEdModel.Cursor = System.Windows.Forms.Cursors.Default;
00462             this.inkEdModel.Location = new System.Drawing.Point(208, 360);
00463             this.inkEdModel.Name = "inkEdModel";
00464             this.inkEdModel.Size = new System.Drawing.Size(312, 32);
00465             this.inkEdModel.TabIndex = 73;
00466             this.inkEdModel.Text = "";
00467             this.inkEdModel.UseMouseForInput = true;
00468             //
00469             // AutoClaims
00470             //
00471             this.AutoScroll = true;
00472             this.BackColor = System.Drawing.Color.White;
00473             this.ClientSize = new System.Drawing.Size(560, 694);
00474             this.Controls.AddRange(new System.Windows.Forms.Control[] {
00475                                                                           this.inkEdModel,
00476                                                                           this.inkEdMake,
00477                                                                           this.inkEdYear,
00478                                                                           this.inkEdName,
00479                                                                           this.inkEdPolicyNumber,
00480                                                                           this.lstAnnotationLayer,
00481                                                                           this.inkPictVehicle,
00482                                                                           this.lblVehicleDamage,
00483                                                                           this.lblVehicleDescription,
00484                                                                           this.lblModel,
00485                                                                           this.lblYear,
00486                                                                           this.lblMake,
00487                                                                           this.lblPolicyNumber,
00488                                                                           this.lblInsuredName,
00489                                                                           this.chHideLayer,
00490                                                                           this.pictHorzontalBar2,
00491                                                                           this.pictVehicleBox,
00492                                                                           this.pictHorzontalBar3,
00493                                                                           this.pictPolicyBox,
00494                                                                           this.pictHorzontalBar1,
00495                                                                           this.lblInstructions,
00496                                                                           this.lblTitle,
00497                                                                           this.pictCheckmarks});
00498             this.Name = "AutoClaims";
00499             this.Text = "AutoClaims";
00500             this.Load += new System.EventHandler(this.AutoClaims_Load);
00501             this.ResumeLayout(false);
00502
00503         }
00504         #endregion
00505
00506         /// <summary>
00507         /// Disposes of the internal child controls used for collecting ink.
00508         /// </summary>
00509         public void DisposeResources()
00510         {
00511             // Call Dispose on all controls that sink ink events (this is
00512             // always required for a clean shutdown).
00513             inkEdPolicyNumber.Dispose();
00514             inkEdName.Dispose();
00515             inkEdYear.Dispose();
00516             inkEdMake.Dispose();
00517             inkEdModel.Dispose();
00518             inkPictVehicle.Dispose();
00519
00520             // Garbage collection will not necessarily occur when
00521             // the page is shut down; in fact, the garbage collector might
00522             // never clean up ink resources when running from within IE.
00523             // As a result, we manually ensure that all ink resources are
00524             // garbage collected by setting them to null and then calling
00525             // GC.Collect().
00526             emptyInk = null;
00527             inkLayers = null;
00528             inkEdPolicyNumber = null;
00529             inkEdName = null;
00530             inkEdYear = null;
00531             inkEdMake = null;
00532             inkEdModel = null;
00533             inkPictVehicle = null;
00534
00535             GC.Collect();
00536             GC.WaitForPendingFinalizers();
00537         }
00538
00539         /// <summary>
00540         /// This method occurs when the control is loaded.  It
00541         /// configures the insertion mode and the ink used by
00542         /// this application.
00543         /// </summary>
00544         /// <param name="sender">The control that raised the event.</param>
00545         /// <param name="e">The event arguments.</param>
00546         private void AutoClaims_Load(object sender, System.EventArgs e)
00547         {
00548             // Initialize the empty ink
00549             emptyInk = new Ink();
00550
00551             // Initialize the four different layers of ink on the vehicle diagram:
00552             // vehicle body, windows, tires, and headlights.
00553             inkLayers = new InkLayer[4];
00554             inkLayers[0] = new InkLayer(new Ink(), Color.Red, false);
00555             inkLayers[1] = new InkLayer(new Ink(), Color.Violet, false);
00556             inkLayers[2] = new InkLayer(new Ink(), Color.LightGreen, false);
00557             inkLayers[3] = new InkLayer(new Ink(), Color.Aqua, false);
00558
00559             // By default, select the first ink layer
00560             lstAnnotationLayer.SelectedIndex = 0;
00561             inkPictVehicle.DefaultDrawingAttributes.Color = inkLayers[lstAnnotationLayer.SelectedIndex].ActiveColor;
00562
00563             // Currently there are recognizers that do not support regular expression
00564             // input scopes, thus raising exceptions.  This try catch handler copes
00565             // with these differences in the recognizer. For policy numbers, nothing
00566             // is being done in reaction to this exception though since there is no
00567             // factoid that serves the same purpose.
00568             try
00569             {
00570                 inkEdPolicyNumber.Factoid = "(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)-(0|1|2|3|4|5|6|7|" +
00571                     "8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)";
00572             }
00573             catch
00574             {
00575                 // Do nothing
00576             }
00577
00578             // There are also recognizers that do not support common input scopes as
00579             // well.  This try catch handler copes with these differences in the
00580             // recognizer. For year, the NUMBER factoid is being set in reaction to
00581             // this exception.
00582             try
00583             {
00584                 inkEdYear.Factoid = "(!IS_DATE_YEAR)";
00585             }
00586             catch
00587             {
00588                 inkEdYear.Factoid = Factoid.Number;
00589             }
00590         }
00591
00592         /// <summary>
00593         ///  Event Handler from lstAnnotationLayer->SelectedIndexChanged Event
00594         /// </summary>
00595         /// <param name="sender">The control that raised the event.</param>
00596         /// <param name="e">The event arguments.</param>
00597         private void lstAnnotationLayer_SelectedIndexChanged(object sender, System.EventArgs e)
00598         {
00599             // Provided that the new selected index value is different than
00600             // the previous value...
00601             if (lstAnnotationLayer.SelectedIndex != selectedIndex)
00602             {
00603                 if (!inkPictVehicle.CollectingInk)
00604                 {
00605                     // Set the ink and visiblity of the current ink layer
00606                     inkPictVehicle.DefaultDrawingAttributes.Color = inkLayers[lstAnnotationLayer.SelectedIndex].ActiveColor;
00607                     chHideLayer.Checked = inkLayers[lstAnnotationLayer.SelectedIndex].Hidden;
00608
00609                     // Set the active ink object to the selected ink
00610                     // Note that if the current layer is not visible, empty
00611                     // ink is used to prevent flicker.
00612                     inkPictVehicle.InkEnabled = false;
00613                     inkPictVehicle.Ink = chHideLayer.Checked?emptyInk:inkLayers[lstAnnotationLayer.SelectedIndex].ActiveInk;
00614                     inkPictVehicle.InkEnabled = !chHideLayer.Checked;
00615
00616                     selectedIndex = lstAnnotationLayer.SelectedIndex;
00617
00618                     this.Refresh();
00619                 }
00620                 else
00621                 {
00622                     // If ink collection is enabled, the active ink cannot be changed
00623                     // and it is necessary to restore the selection to its previous value.
00624                     lstAnnotationLayer.SelectedIndex = selectedIndex;
00625                     MessageBox.Show("Cannot change active ink while collecting ink.");
00626                 }
00627             }
00628         }
00629
00630         /// <summary>
00631         /// Event Handler from chHideLayer->CheckChanged Event
00632         /// </summary>
00633         /// <param name="sender">The control that raised the event.</param>
00634         /// <param name="e">The event arguments.</param>
00635         private void chHideLayer_CheckedChanged(object sender, System.EventArgs e)
00636         {
00637             // Provided that the new checked hidden value is different than
00638             // the previous value...
00639             if (chHideLayer.Checked != selectedHidden)
00640             {
00641                 if (!inkPictVehicle.CollectingInk)
00642                 {
00643                     // Update the array indicating the visibility of each ink layer
00644                     inkLayers[lstAnnotationLayer.SelectedIndex].Hidden = chHideLayer.Checked;
00645
00646                     // Set the active ink object to the selected ink
00647                     // Note that if the current layer is not visible, empty
00648                     // ink is used to prevent flicker.
00649                     inkPictVehicle.InkEnabled = false;
00650                     inkPictVehicle.Ink = chHideLayer.Checked?emptyInk:inkLayers[lstAnnotationLayer.SelectedIndex].ActiveInk;
00651
00652                     // If the layer is marked hidden, disable ink collections
00653                     inkPictVehicle.InkEnabled = !chHideLayer.Checked;
00654
00655                     // Update the previous checkbox value to reflect the current
00656                     selectedHidden = chHideLayer.Checked;
00657
00658                     this.Refresh();
00659                 }
00660                 else
00661                 {
00662                     // If ink collection is enabled, the active ink cannot be changed
00663                     // and it is necessary to restore the checkbox to its previous value.
00664                     chHideLayer.Checked = selectedHidden;
00665                     MessageBox.Show("Cannot change visiblity while collecting ink.");
00666                 }
00667             }
00668         }
00669
00670         /// <summary>
00671         /// Event Handler from inkPictVehicle->Paint Event
00672         ///
00673         /// It is necessary to draw four different types of ink
00674         /// and the ink picture only has one ink associated with it.
00675         /// As a result, the autoredraw feature is turned off
00676         /// and the paint event is handled.
00677         /// </summary>
00678         /// <param name="sender">The control that raised the event.</param>
00679         /// <param name="e">The event arguments.</param>
00680         private void inkPictVehicle_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
00681         {
00682             // Cycle through each ink layer.  If it is visible, paint it.
00683             // Note that it is necessary to customize the paint
00684             // behavior, since we want to hide/show different ink layers.
00685             foreach (InkLayer layer in inkLayers)
00686             {
00687                 if (!layer.Hidden)
00688                 {
00689                     inkPictVehicle.Renderer.Draw(e.Graphics,layer.ActiveInk.Strokes);
00690                 }
00691             }
00692         }
00693
00694     }
00695 }
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/PerClien.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

PerClien.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PERCLIEN.H
00003
00004   Summary:   Include file for the PERCLIEN code sample application. Has
00005              class definitions for the the main window and dialogs.
00006
00007              For a comprehensive tutorial code tour of PERCLIEN's contents
00008              and offerings see the tutorial PERCLIEN.HTM file. For more
00009              specific technical details on the internal workings see the
00010              comments dispersed throughout the PERCLIEN source code.
00011
00012   Classes:   CMainWindow.
00013
00014   Functions: WinMain.
00015
00016   Origin:    5-25-97: atrent - Editor-inheritance from STOCLIEN source.
00017
00018 ----------------------------------------------------------------------------
00019   This file is part of the Microsoft COM Tutorial Code Samples.
00020
00021   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00022
00023   This source code is intended only as a supplement to Microsoft
00024   Development Tools and/or on-line documentation.  See these other
00025   materials for detailed information regarding Microsoft code samples.
00026
00027   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00028   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00029   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00030   PARTICULAR PURPOSE.
00031 ==========================================================================+*/
00032
00033 #if !defined(PERCLIEN_H)
00034 #define PERCLIEN_H
00035
00036 #ifdef __cplusplus
00037
00038
00039 extern TCHAR g_szPageTitle[];
00040
00041 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00042   Class:    CMainWindow
00043
00044   Summary:  Class to encapsulate the application's main window, menu, and
00045             message dispatching behavior. Derives from and extends
00046             APPUTIL's CVirWindow class.
00047
00048   Methods:  CMainWindow
00049               Constructor.
00050             ~CMainWindow
00051               Destructor.
00052             BOOL InitInstance(
00053                    HINSTANCE hInst,
00054                    LPSTR pszCmdLine,
00055                    int nCmdShow);
00056               Creates a new instance of the main window.
00057 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00058 class CMainWindow: public CVirWindow
00059 {
00060   public:
00061     CMainWindow();
00062     ~CMainWindow();
00063     BOOL InitInstance(HINSTANCE hInst, LPSTR pszCmdLine, int nCmdShow);
00064
00065     TCHAR m_szFileName[MAX_PATH];
00066     CGuiList*  m_pGuiList;
00067
00068   protected:
00069     LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00070
00071   private:
00072     LRESULT DoCommand(WPARAM wParam, LPARAM lParam);
00073
00074     WORD m_wWidth;
00075     WORD m_wHeight;
00076     TCHAR m_szFileTitle[MAX_PATH];
00077     TCHAR m_szHelpFile[MAX_PATH];
00078     TEXTMETRIC m_tm;
00079     OPENFILENAME m_ofnFile;
00080 };
00081
00082
00083 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00084   Class:    CDlgPageProps
00085
00086   Summary:  Class to encapsulate the Page Properties entry Dialog. This
00087             currently edits a new title for a page. Derived from APPUTIL's
00088             CVirDialog.
00089
00090   Methods:  DialogProc
00091               Dialog procedure
00092 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00093 class CDlgPageProps: public CVirDialog
00094 {
00095 public:
00096   BOOL DialogProc(
00097          HWND hWndDlg,
00098          UINT uMsg,
00099          WPARAM wParam,
00100          LPARAM lParam);
00101 };
00102
00103
00104 #endif // __cplusplus
00105
00106
00107 #endif
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/Debug.Cpp Source File

  • Web
  • NetMeeting
  • NMFT

Debug.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMFT.EXE
00003 //  File:       DEBUG.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 #ifdef DEBUG /* The whole file! */
00019
00020
00021 //****************************************************************************
00022 //
00023 // VOID FAR PASCAL AssertProc(LPSTR lpszMsg, LPSTR lpszAssert, LPSTR lpszFile, UINT line)
00024 //
00025 //****************************************************************************
00026
00027 VOID FAR PASCAL AssertProc(LPTSTR lpszMsg, LPTSTR lpszAssert, LPTSTR lpszFile, UINT line)
00028 {
00029   int  id = 0;
00030   TCHAR szBuffer[1024]; // a big buffer
00031
00032   ZeroMemory(szBuffer, 1024);
00033
00034   _sntprintf(szBuffer, 1023, TEXT("Assert: %s\nFile %s, Line %d"),
00035     (lpszMsg && *lpszMsg) ? lpszMsg : lpszAssert,
00036     lpszFile ? lpszFile : TEXT(""), line);
00037
00038   OutputDebugString(szBuffer);
00039
00040   do {
00041     id = MessageBox(NULL, szBuffer, TEXT("NmUi Assert"),
00042           MB_ICONHAND | MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL);
00043
00044     switch (id)
00045     {
00046     case IDRETRY:
00047       DebugBreak();
00048       break;
00049     case IDABORT:
00050       FatalAppExit(0, szBuffer);
00051       break;
00052     case IDIGNORE:
00053     default:
00054       break;
00055     }
00056   } while (id == IDRETRY);
00057 }
00058
00059
00060
00061 #endif /* DEBUG - the whole file! */
00062
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStatusHelper Member List

This is the complete list of members for CStatusHelper, including all inherited members.
CStatusHelper(HWND, HINSTANCE) | CStatusHelper |
IDFromHMenu(HMENU) | CStatusHelper | [private]
IStringFromID(USHORT) | CStatusHelper | [private]
m_cMessages | CStatusHelper | [protected]
m_cPopups | CStatusHelper | [protected]
m_fMapped | CStatusHelper | [protected]
m_hInst | CStatusHelper | [protected]
m_hMemSMM | CStatusHelper | [protected]
m_hWnd | CStatusHelper | [protected]
m_hWndOwner | CStatusHelper | [protected]
m_idsMax | CStatusHelper | [protected]
m_idsMin | CStatusHelper | [protected]
m_pPMM | CStatusHelper | [protected]
m_pSMM | CStatusHelper | [protected]
m_pST | CStatusHelper | [protected]
m_uIDBlank | CStatusHelper | [protected]
m_uIDCur | CStatusHelper | [protected]
m_uIDPopupMax | CStatusHelper | [protected]
m_uIDPopupMin | CStatusHelper | [protected]
m_uIDStatic | CStatusHelper | [protected]
m_uIDSysMenu | CStatusHelper | [protected]
MenuSelect(WORD, WORD, HMENU) | CStatusHelper |
MessageDisplay(UINT) | CStatusHelper |
MessageMap(HWND, UINT, UINT, UINT, UINT, UINT, UINT, UINT, UINT, UINT) | CStatusHelper |
Sort(void) | CStatusHelper | [private]
~CStatusHelper(void) | CStatusHelper |
Generated on Wed Nov 13 2024 16:57:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Include/msgfiltr.h Source File

  • Com
  • Fundamentals
  • Include

msgfiltr.h

Go to the documentation of this file.
00001 /*************************************************************************
00002 **
00003 **    OLE 2 Utility Code
00004 **
00005 **    msgfiltr.h
00006 **
00007 **    This file contains Private definitions, structures, types, and
00008 **    function prototypes for the OleStdMessageFilter implementation of
00009 **    the IMessageFilter interface.
00010 **    This file is part of the OLE 2.0 User Interface support library.
00011 **
00012 **    (c) Copyright Microsoft Corp. 1990 - 2000 All Rights Reserved
00013 **
00014 *************************************************************************/
00015
00016 #if !defined( _MSGFILTR_H_ )
00017 #define _MSGFILTR_H_
00018
00019 #ifndef RC_INVOKED
00020 #pragma message ("INCLUDING MSGFILTR.H from " __FILE__)
00021 #endif  /* RC_INVOKED */
00022
00023 #include "ansiapi.h"
00024
00025 // Message Pending callback procedure
00026 typedef BOOL (CALLBACK* MSGPENDINGPROC)(MSG FAR *);
00027
00028 // HandleInComingCall callback procedure
00029 typedef DWORD (CALLBACK* HANDLEINCOMINGCALLBACKPROC)
00030    (
00031       DWORD               dwCallType,
00032       HTASK               htaskCaller,
00033       DWORD               dwTickCount,
00034       LPINTERFACEINFO     lpInterfaceInfo
00035    );
00036
00037 /* PUBLIC FUNCTIONS */
00038 STDAPI_(LPMESSAGEFILTER) OleStdMsgFilter_Create(
00039       HWND hWndParent,
00040       LPOLESTR szAppName,
00041       MSGPENDINGPROC lpfnCallback,
00042       LPFNOLEUIHOOK  lpfnOleUIHook         // Busy dialog hook callback
00043 );
00044
00045 STDAPI_(void) OleStdMsgFilter_SetInComingCallStatus(
00046       LPMESSAGEFILTER lpThis, DWORD dwInComingCallStatus);
00047
00048 STDAPI_(DWORD) OleStdMsgFilter_GetInComingCallStatus(
00049       LPMESSAGEFILTER lpThis);
00050
00051 STDAPI_(HANDLEINCOMINGCALLBACKPROC)
00052    OleStdMsgFilter_SetHandleInComingCallbackProc(
00053       LPMESSAGEFILTER             lpThis,
00054       HANDLEINCOMINGCALLBACKPROC  lpfnHandleInComingCallback);
00055
00056 STDAPI_(BOOL) OleStdMsgFilter_EnableBusyDialog(
00057       LPMESSAGEFILTER lpThis, BOOL fEnable);
00058
00059 STDAPI_(BOOL) OleStdMsgFilter_EnableNotRespondingDialog(
00060       LPMESSAGEFILTER lpThis, BOOL fEnable);
00061
00062 STDAPI_(HWND) OleStdMsgFilter_SetParentWindow(
00063       LPMESSAGEFILTER lpThis, HWND hWndParent);
00064
00065
00066 #endif // _MSGFILTR_H_
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/LogWriter/LogFile.Cpp Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest
  • LogWriter

LogFile.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: LogFile.cpp
00004
00005 Summary: Implementation of CLogFile
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021 #include "stdafx.h"
00022 #include "LogWriter.h"
00023 #include "LogFile.h"
00024
00025 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00026
00027 Class: CLogFile
00028
00029 CLogFile is a poolable object that opens a file on creation and closes
00030 it on destruction. During the Write method it sets the done bit to allow COM+
00031 to pool this object so it can be shared among several different applications
00032 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00033
00034 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00035
00036 Method: Destructor
00037
00038 Summary: Close the file that was opened for this class
00039
00040 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00041 CLogFile::~CLogFile()
00042 {
00043   // close the file
00044   CloseHandle(m_hFile);
00045 }
00046
00047 // interface IObjectControl
00048
00049 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00050
00051 Method: Activate
00052
00053 Summary: COM+ tells us when we have been activated. We need to setup our
00054      object for this context
00055
00056 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00057 HRESULT CLogFile::Activate()
00058 {
00059   IObjectContext* pObjectContext;
00060
00061   // get our context
00062   HRESULT hr = GetObjectContext(&pObjectContext);
00063   if (FAILED(hr))
00064     return hr;
00065
00066   // now get the ContextState
00067   hr = pObjectContext->QueryInterface(IID_IContextState, (void **)&m_pContextState);
00068   if (FAILED(hr))
00069   {
00070     pObjectContext->Release();
00071     return hr;
00072   }
00073   return hr;
00074
00075 }
00076
00077 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00078
00079 Method: Deactivate
00080
00081 Summary: COM+ tells us when we are being deactivated. Remove any context state
00082      we have. We don't close the file here since it's state is maintained
00083      througout all contexts
00084
00085 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00086 void CLogFile::Deactivate()
00087 {
00088   m_pContextState->Release();
00089 }
00090
00091 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00092
00093 Method: CanBePooled
00094
00095 Summary: COM+ asks us if our object can be pooled
00096
00097 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00098 BOOL CLogFile::CanBePooled()
00099 {
00100   // we can be pooled
00101   return TRUE;
00102 }
00103
00104 // interface IObjectConstruct
00105 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00106
00107 Method: Construct
00108
00109 Summary: This method is called by COM+ with the value specified in the COM+
00110      explorer for this object. This is where we open our file for logging
00111
00112 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00113
00114 HRESULT CLogFile::Construct(IDispatch * pCtorObj)
00115 {
00116   // first we need to get the IObjectConstructString from the IDispatch
00117   // passed in
00118
00119   IObjectConstructString  *pOCS = NULL;
00120   HRESULT hr = pCtorObj->QueryInterface(IID_IObjectConstructString, (void **)&pOCS);
00121   if FAILED(hr)
00122     return hr;
00123
00124   // get the construction string
00125   BSTR  bstrLogFileName;
00126   hr = pOCS->get_ConstructString(&bstrLogFileName);
00127   if FAILED(hr)
00128   {
00129     // free our file name string
00130     SysFreeString(bstrLogFileName);
00131     pOCS->Release();
00132     return hr;
00133   }
00134
00135   // if we didn't get a value then default
00136   if (!bstrLogFileName)
00137     return E_FAIL;
00138
00139   // open the file
00140   m_hFile = CreateFile(bstrLogFileName,
00141               GENERIC_WRITE,
00142               FILE_SHARE_READ,
00143               NULL,
00144               OPEN_ALWAYS,
00145               FILE_ATTRIBUTE_NORMAL,
00146               NULL);
00147   if (m_hFile == INVALID_HANDLE_VALUE)
00148   {
00149     // free our file name string
00150     SysFreeString(bstrLogFileName);
00151     pOCS->Release();
00152     return E_FAIL;
00153   }
00154
00155   // if we have a new file the size will be zero so write out the Unicode
00156   // byte order
00157   DWORD dwSize = GetFileSize(m_hFile, NULL);
00158   DWORD dwBytesWritten = 0;
00159   ULONG dwUnicodeByteOrder = 0xFEFF;  // Unicode stream header
00160   if (dwSize == 0)
00161   {
00162     if (!WriteFile(m_hFile, &dwUnicodeByteOrder, 2, &dwBytesWritten, NULL))
00163     {
00164       // free our file name string
00165       SysFreeString(bstrLogFileName);
00166       pOCS->Release();
00167       return E_FAIL;
00168     }
00169   }
00170
00171   // free our file name string
00172   SysFreeString(bstrLogFileName);
00173
00174   pOCS->Release();
00175
00176   return S_OK;
00177 }
00178
00179 // interface ILogFile
00180
00181 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00182
00183 Method: Write
00184
00185 Summary: Write out the buffer passed in and the ID into the log file. It also
00186      adds the date and time to the log entry.
00187
00188 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00189 STDMETHODIMP CLogFile::Write(BSTR buf, DWORD dwID)
00190 {
00191
00192   HRESULT hr = S_OK;
00193
00194   DWORD dwPos = 0;
00195   DWORD dwBytesWritten = 0;
00196   _bstr_t newBuf;
00197   DWORD dwBufLen = 0;
00198
00199   // get the local date and time
00200   int nSize = GetDateFormat(NULL, 0, NULL, NULL, NULL, 0);
00201   WCHAR* sBuffer = new WCHAR[nSize];
00202   GetDateFormatW(NULL, 0, NULL, NULL, sBuffer, nSize);
00203   newBuf = sBuffer;
00204   delete [] sBuffer;
00205
00206   newBuf += L" ";
00207
00208   nSize = GetTimeFormat(NULL, 0, NULL, NULL, NULL, 0);
00209   sBuffer = new WCHAR[nSize];
00210   GetTimeFormatW(NULL, 0, NULL, NULL, sBuffer, nSize);
00211   newBuf += sBuffer;
00212   delete [] sBuffer;
00213
00214
00215   // put the proc ID and the text passed in on
00216   sBuffer = new WCHAR[200];
00217   wsprintfW(sBuffer, L" : ProcID = %#08x : ", dwID);
00218   newBuf += sBuffer;
00219   delete [] sBuffer;
00220   newBuf += buf;
00221
00222   dwBufLen = SysStringByteLen(newBuf);
00223
00224     dwPos = SetFilePointer(m_hFile, 0, NULL, FILE_END);
00225     if (!WriteFile(m_hFile, (wchar_t *)newBuf, dwBufLen, &dwBytesWritten, NULL))
00226   {
00227     hr = E_FAIL;
00228   }
00229
00230     m_pContextState->SetDeactivateOnReturn(TRUE);
00231
00232   return hr;
00233 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/LogWriter/Resource.h Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest
  • LogWriter

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by LogWriter.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_LOGFILE                     101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

statel Member List

This is the complete list of members for statel, including all inherited members.
flags | statel
id | statel
rc | statel
text | statel
type | statel
width | statel
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Mode.c Source File

  • WinUI
  • Input
  • Ime
  • IMEApps

Mode.c

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      MODE.C                                                        */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation                */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <imm.h>
00011 #include "resource.h"
00012 #include "imeapps.h"
00013
00014
00015 LRESULT HandleModeCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
00016 {
00017     HIMC hIMC = ImmGetContext(hWndCompStr);
00018     DWORD dwConv, dwSent;
00019     DWORD dwTemp;
00020
00021     ImmGetConversionStatus(hIMC,&dwConv,&dwSent);
00022
00023     switch(LOWORD(wParam))
00024     {
00025         case IDM_NATIVEMODE:
00026             dwTemp = dwConv & ~IME_CMODE_LANGUAGE;
00027
00028             switch (dwConv & IME_CMODE_LANGUAGE)
00029             {
00030                 case IME_CMODE_ALPHANUMERIC:
00031                     dwTemp |= IME_CMODE_NATIVE;
00032                     break;
00033
00034                 case IME_CMODE_NATIVE:
00035                     dwTemp |= (IME_CMODE_NATIVE | IME_CMODE_KATAKANA);
00036                     break;
00037
00038                 case (IME_CMODE_NATIVE | IME_CMODE_KATAKANA): /* fall-through */
00039                 default:
00040                     break;
00041             }
00042             dwConv = dwTemp;
00043             break;
00044
00045         case IDM_FULLHALF:
00046             if (dwConv & IME_CMODE_FULLSHAPE)
00047             {
00048                 dwConv &= ~IME_CMODE_FULLSHAPE;
00049             }
00050             else
00051             {
00052                 dwConv |= IME_CMODE_FULLSHAPE;
00053             }
00054             break;
00055
00056         case IDM_ROMAN:
00057             if (dwConv & IME_CMODE_ROMAN)
00058             {
00059                 dwConv &= ~IME_CMODE_ROMAN;
00060             }
00061             else
00062             {
00063                 dwConv |= IME_CMODE_ROMAN;
00064             }
00065             break;
00066
00067         case IDM_CHARCODE:
00068             if (dwConv & IME_CMODE_CHARCODE)
00069             {
00070                 dwConv &= ~IME_CMODE_CHARCODE;
00071             }
00072             else
00073             {
00074                 dwConv |= IME_CMODE_CHARCODE;
00075             }
00076             break;
00077
00078         case IDM_HANJA:
00079             if (dwConv & IME_CMODE_HANJACONVERT)
00080             {
00081                 dwConv &= ~IME_CMODE_HANJACONVERT;
00082             }
00083             else
00084             {
00085                 dwConv |= IME_CMODE_HANJACONVERT;
00086             }
00087             break;
00088
00089         case IDM_SOFTKBD:
00090             if (dwConv & IME_CMODE_SOFTKBD)
00091             {
00092                 dwConv &= ~IME_CMODE_SOFTKBD;
00093             }
00094             else
00095             {
00096                 dwConv |= IME_CMODE_SOFTKBD;
00097             }
00098             break;
00099
00100         case IDM_EUDC:
00101             if (dwConv & IME_CMODE_EUDC)
00102             {
00103                 dwConv &= ~IME_CMODE_EUDC;
00104             }
00105             else
00106             {
00107                 dwConv |= IME_CMODE_EUDC;
00108             }
00109             break;
00110
00111         case IDM_SYMBOL:
00112             if (dwConv & IME_CMODE_SYMBOL)
00113             {
00114                 dwConv &= ~IME_CMODE_SYMBOL;
00115             }
00116             else
00117             {
00118                 dwConv |= IME_CMODE_SYMBOL;
00119             }
00120             break;
00121     }
00122
00123     ImmSetConversionStatus(hIMC,dwConv,dwSent);
00124     ImmReleaseContext(hWndCompStr,hIMC);
00125
00126     return 1L;
00127 }
00128
00129 LRESULT HandleConvertCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
00130 {
00131     HIMC hIMC = ImmGetContext(hWndCompStr);
00132     DWORD dwSel;
00133     DWORD dwSize;
00134     LPCANDIDATELIST lpCL = NULL;
00135
00136     switch(wParam)
00137     {
00138         case IDM_CONVERT:
00139             ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_CONVERT,0);
00140             break;
00141
00142         case IDM_CANCEL:
00143             ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_CANCEL,0);
00144             break;
00145
00146         case IDM_REVERT:
00147             ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_REVERT,0);
00148             break;
00149
00150         case IDM_COMPLETE:
00151             ImmNotifyIME(hIMC,NI_COMPOSITIONSTR,CPS_COMPLETE,0);
00152             break;
00153
00154         case IDM_OPENCAND:
00155             ImmNotifyIME(hIMC,NI_OPENCANDIDATE,0,0);
00156             break;
00157
00158         case IDM_CLOSECAND:
00159             ImmNotifyIME(hIMC,NI_CLOSECANDIDATE,0,0);
00160             break;
00161
00162         case IDM_NEXTCAND: /* fall-through */
00163         case IDM_PREVCAND:
00164             if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
00165             {
00166                 lpCL = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);
00167
00168                 ImmGetCandidateList(hIMC,0x0,lpCL,dwSize);
00169
00170                 dwSel = lpCL->dwSelection;
00171
00172                 if (wParam == IDM_NEXTCAND)
00173                 {
00174                    if (++dwSel >= lpCL->dwCount)
00175                    {
00176                       dwSel = 0;
00177                    }
00178                 }
00179                 else
00180                 {
00181                    if (dwSel)
00182                    {
00183                       dwSel--;
00184                    }
00185                    else
00186                    {
00187                       dwSel = lpCL->dwCount - 1;
00188                    }
00189                 }
00190                 GlobalFree((HANDLE)lpCL);
00191
00192                 ImmNotifyIME(hIMC,NI_SELECTCANDIDATESTR,0,dwSel);
00193             }
00194             break;
00195
00196     }
00197
00198     ImmReleaseContext(hWndCompStr,hIMC);
00199
00200     return 1;
00201 }
00202
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/comp.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

comp.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #ifndef _CLASS_CCOMPONENT_
00016 #define _CLASS_CCOMPONENT_
00017
00018 #include "Globals.h"
00019
00020
00021 class CComponentData;                  // References
00022
00023
00024 //---------------------------------------------------------------------------
00025 class CComponent : public IComponent2,
00026                           IExtendPropertySheet2
00027
00028 {
00029   // Construction/Destruction
00030   public:
00031     CComponent( CComponentData* pParent );
00032     ~CComponent();
00033
00034
00035   ///////////////////////////////////////////////////////////////////////////
00036   // Interface IUnknown
00037   //
00038   public:
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043   ///////////////////////////////////////////////////////////////////////////
00044   // Interface IComponent2
00045   //
00046   public:
00047     HRESULT STDMETHODCALLTYPE Initialize
00048             ( /*[in]*/ LPCONSOLE ipConsole );
00049
00050     HRESULT STDMETHODCALLTYPE Notify
00051             ( /*[in]*/ LPDATAOBJECT ipDataObject,
00052               /*[in]*/ MMC_NOTIFY_TYPE MmcEvent,
00053               /*[in]*/ LPARAM nArg,
00054               /*[in]*/ LPARAM nParam
00055             );
00056
00057     HRESULT STDMETHODCALLTYPE Destroy
00058             ( /*[in]*/ MMC_COOKIE nCookie );
00059
00060     HRESULT STDMETHODCALLTYPE QueryDataObject
00061             ( /*[in]*/  MMC_COOKIE nCookie,
00062               /*[in]*/  DATA_OBJECT_TYPES nEnumType,
00063               /*[out]*/ LPDATAOBJECT __RPC_FAR* ppDataObject
00064             );
00065
00066     HRESULT STDMETHODCALLTYPE GetResultViewType
00067             ( /*[in]*/  MMC_COOKIE nCookie,
00068               /*[out]*/ LPOLESTR __RPC_FAR* ppViewType,
00069               /*[out]*/ long __RPC_FAR* pViewOptions
00070             );
00071
00072     HRESULT STDMETHODCALLTYPE GetDisplayInfo
00073             ( /*[out][in]*/ RESULTDATAITEM __RPC_FAR* pResultDataItem );
00074
00075     HRESULT STDMETHODCALLTYPE CompareObjects
00076             ( /*[in]*/ LPDATAOBJECT lpDataObjectA,
00077               /*[in]*/ LPDATAOBJECT lpDataObjectB
00078             );
00079
00080     HRESULT STDMETHODCALLTYPE QueryDispatch
00081             ( /*[in] */  MMC_COOKIE  nCookie,
00082               /*[in] */  DATA_OBJECT_TYPES eType,
00083               /*[out]*/  LPDISPATCH* pipDispatch
00084             );
00085
00086     HRESULT STDMETHODCALLTYPE GetResultViewType2
00087             ( /*[in] */    MMC_COOKIE nCookie,
00088               /*[in,out]*/ PRESULT_VIEW_TYPE_INFO pRVTinfo
00089             );
00090
00091     HRESULT STDMETHODCALLTYPE RestoreResultView
00092             ( /*[in] */    MMC_COOKIE nCookie,
00093               /*[in,out]*/ PRESULT_VIEW_TYPE_INFO pResultViewType
00094             );
00095
00096
00097   /////////////////////////////////////////////////////////////////////////
00098   // Interface IExtendPropertySheet2
00099   //
00100   public:
00101     HRESULT STDMETHODCALLTYPE CreatePropertyPages
00102             ( /*[in]*/ LPPROPERTYSHEETCALLBACK lpProvider,
00103               /*[in]*/ LONG_PTR Handle,
00104               /*[in]*/ LPDATAOBJECT ipIDataObject
00105             );
00106
00107     HRESULT STDMETHODCALLTYPE QueryPagesFor
00108             ( /*[in]*/ LPDATAOBJECT ipDataObject
00109             );
00110
00111     HRESULT STDMETHODCALLTYPE GetWatermarks
00112             ( /*[in] */ LPDATAOBJECT lpIDataObject,
00113               /*[out]*/ HBITMAP __RPC_FAR *lphWatermark,
00114               /*[out]*/ HBITMAP __RPC_FAR *lphHeader,
00115               /*[out]*/ HPALETTE __RPC_FAR *lphPalette,
00116               /*[out]*/ BOOL __RPC_FAR *bStretch
00117             );
00118
00119   // Private data
00120   private:
00121     ULONG            m_cRef;
00122     HBITMAP          m_hImageStrip16;
00123     HBITMAP          m_hImageStrip32;
00124     IConsole3*       m_ipConsole;
00125     LPCONSOLEVERB    m_ipConsoleVerb;
00126     LPRESULTDATA     m_ipResultData;
00127     LPHEADERCTRL2    m_ipHeaderCtrl2;
00128     IDisplayHelp*    m_ipDisplayHelp;
00129     CComponentData*  m_pComponentData;
00130
00131
00132   ///////////////////////////////////////////////////////////////////////////
00133   //  Handlers for notifications which are not delegated
00134   private:
00135     HRESULT  OnAddImages( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam );
00136
00137
00138   ///////////////////////////////////////////////////////////////////////////
00139   //  Public helpers
00140   public:
00141     HRESULT  GetInterface( DWORD dwRequestedInterface,  LONG_PTR* ppInterface );
00142     LONG_PTR GetParent() { return (LONG_PTR)m_pComponentData; }
00143
00144 };
00145
00146 #endif //_CLASS_CCOMPONENT_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/selectEventsDlg.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

selectEventsDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __SELECTEVENTSDLG_H_
00018 #define __SELECTEVENTSDLG_H_
00019
00020 #include "resource.h"       // main symbols
00021
00022 class CComSpy;
00023
00024
00025 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00026 Class:   CSelectEventsDlg
00027 Summary: Dialog for selecting which events to subscribe to.
00028 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00029 class CSelectEventsDlg : public CDialogImpl<CSelectEventsDlg>
00030 {
00031 private:
00032   MapStringToAppInfo * m_map;
00033   CAppInfo * m_pSysAppInfo;
00034   CComSpy * m_pSpyObj;
00035
00036   // Cannot call default constructor because it's Private.
00037   CSelectEventsDlg();
00038
00039 public:
00040   CSelectEventsDlg(MapStringToAppInfo* spMap, CAppInfo * pSysAppInfo, CComSpy* pSpyObj);
00041
00042   void PopulateEventList();
00043   void PopulateSysEventList();
00044   bool GetRunningApps();
00045   bool GetCatalogApps();
00046   bool SelectApplication(int nItem);
00047   void MarkAllAppsForDelete(bool bDeleteUnused);
00048   void ShowSelectedEvents(CAppInfo* pInfo);
00049   void ShowSelectedSystemEvents();
00050   bool SelectAllApps(bool bSelectAll);
00051
00052   enum { IDD = IDD_CONFIGUREEVENTSDLG };
00053
00054
00055   BEGIN_MSG_MAP(CSelectEventsDlg)
00056     MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
00057     COMMAND_ID_HANDLER(IDOK, OnOK)
00058     COMMAND_ID_HANDLER(IDC_LIST_APPS, AppsListHandler)
00059     COMMAND_ID_HANDLER(IDC_CHECK_ALLAPPS, OnSelectAllApps)
00060     NOTIFY_HANDLER(IDC_LISTVIEWEVENTS, LVN_ITEMCHANGED, LVEventItemChanged)
00061     NOTIFY_HANDLER(IDC_LISTVIEWSYSEVENTS, LVN_ITEMCHANGED, LVSystemEventItemChanged)
00062     MESSAGE_HANDLER(WM_DESTROY, OnDestroyDlg)
00063   END_MSG_MAP()
00064
00065   //  Message Handles
00066   LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00067   LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00068   LRESULT AppsListHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00069   LRESULT OnSelectAllApps(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00070   LRESULT LVEventItemChanged(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
00071   LRESULT LVSystemEventItemChanged(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
00072   LRESULT OnDestroyDlg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00073 };
00074
00075 #endif //__SELECTEVENTSDLG_H_
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/cplusplus/proxyplugin.idl Source File

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • cplusplus

proxyplugin.idl

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            ProxyPlugin.idl
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 cpp_quote("//*****************************************************************************")
00013 cpp_quote("//")
00014 cpp_quote("// Microsoft Windows Media")
00015 cpp_quote("// Copyright (C) Microsoft Corporation. All rights reserved.")
00016 cpp_quote("//")
00017 cpp_quote("// Automatically generated by Midl from ProxyPlugin.idl" )
00018 cpp_quote("//")
00019 cpp_quote("// DO NOT EDIT THIS FILE.")
00020 cpp_quote("//")
00021 cpp_quote("//*****************************************************************************")
00022
00023
00024 cpp_quote( "EXTERN_GUID( LIBID_PROXYPLUGINLib, 0x65cc485b, 0xaac6, 0x457a, 0xa6, 0x88, 0x9, 0x79, 0xb9, 0x5e, 0x4a, 0x95 );" )
00025 cpp_quote( "EXTERN_GUID( CLSID_ProxyPlugin, 0xc5403bb1, 0x1b30, 0x49bf, 0xa8, 0x73, 0x77, 0xfd, 0xfd, 0x4c, 0xf6, 0xe6 );" )
00026
00027 import "oaidl.idl";
00028
00029 [
00030     uuid(65CC485B-AAC6-457a-A688-0979B95E4A95),
00031   version(9.0),
00032     helpstring("ProxyPlugin 9.0 Type Library")
00033 ]
00034 library PROXYPLUGINLib
00035 {
00036     importlib("stdole32.tlb");
00037     importlib("stdole2.tlb");
00038 };
00039
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/EventSink.cpp Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

EventSink.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // EventSink.cpp : Implementation of CEventSink
00006 #include "stdafx.h"
00007 #include "Render.h"
00008 #include "Behavior.h"
00009 #include "EventSink.h"
00010
00011 /////////////////////////////////////////////////////////////////////////////
00012 // CEventSink
00013
00014 STDMETHODIMP
00015 CEventSink::Invoke(
00016     DISPID dispidMember,
00017     REFIID riid,
00018     LCID lcid,
00019     WORD wFlags,
00020     DISPPARAMS* pdispparams,
00021     VARIANT* pvarResult,
00022     EXCEPINFO* pexcepinfo,
00023     UINT* puArgErr)
00024 {
00025   long X = NULL;
00026   long Y = NULL;
00027
00028   HRESULT hr = NULL;
00029   IHTMLEventObj* pEvent = NULL;
00030
00031     switch (dispidMember)
00032   {
00033     case DISPID_HTMLDOCUMENTEVENTS_ONMOUSEDOWN:
00034       // Calculate parameters for ClipCursor
00035       POINT ptElemOriginLocal, ptElemOriginGlobal;
00036       IHTMLWindow3* pWin3;
00037       long winTop, winLeft;
00038       RECT clipRect;
00039
00040       ptElemOriginLocal.x = HANDLE_RADIUS;
00041       ptElemOriginLocal.y = HANDLE_RADIUS;
00042
00043       m_pBehavior->m_pPaintSite->TransformLocalToGlobal(ptElemOriginLocal, &ptElemOriginGlobal);
00044
00045       m_pBehavior->m_spWin->QueryInterface(IID_IHTMLWindow3, (void**)&pWin3);
00046       pWin3->get_screenTop(&winTop);
00047       pWin3->get_screenLeft(&winLeft);
00048       pWin3->Release();
00049
00050       clipRect.top = m_pBehavior->m_rtElemCorners.top + ptElemOriginGlobal.y + winTop;
00051       clipRect.bottom = m_pBehavior->m_rtElemCorners.bottom + ptElemOriginGlobal.y + winTop;
00052       clipRect.left = m_pBehavior->m_rtElemCorners.left + ptElemOriginGlobal.x + winLeft;
00053       clipRect.right = m_pBehavior->m_rtElemCorners.right + ptElemOriginGlobal.x + winLeft;
00054
00055       // Invoke ClipCursor
00056       ClipCursor(&clipRect);
00057
00058       // Prevent selection on this element
00059       m_pBehavior->m_spSel->empty();
00060       OnClick();
00061       break;
00062
00063     case DISPID_HTMLDOCUMENTEVENTS2_ONMOUSEUP:
00064       // Prevent selection on this element
00065       m_pBehavior->m_spSel->empty();
00066       mouseDown = FALSE;
00067
00068       // Free mouse cursor to move anywhere on screen
00069       ClipCursor(NULL);
00070
00071       m_pBehavior->m_lPartID = -1;
00072       m_pBehavior->m_pPaintSite->InvalidateRect(NULL);
00073       break;
00074
00075     case DISPID_HTMLDOCUMENTEVENTS2_ONMOUSEMOVE:
00076       // Prevent selection on this element
00077       m_pBehavior->m_spSel->empty();
00078
00079       // If mouse button is not down, don't do anything
00080       if (mouseDown != TRUE) break;
00081
00082       // Otherwise, recalculate position of the handle being moved and redraw
00083       hr = m_pBehavior->GetEventObject(&pEvent);
00084
00085       // Obtain X & Y
00086       hr = pEvent->get_offsetY(&Y);
00087       hr = pEvent->get_offsetX(&X);
00088
00089       m_pBehavior->m_ptPolyCorners[m_pBehavior->m_lPartID].x = X;
00090       m_pBehavior->m_ptPolyCorners[m_pBehavior->m_lPartID].y = Y;
00091
00092       m_pBehavior->m_pPaintSite->InvalidateRect(NULL);
00093       pEvent->Release();
00094
00095       break;
00096
00097     default:
00098       break;
00099     }
00100
00101     return S_OK;
00102 }
00103
00104 void
00105 CEventSink::OnClick()
00106 {
00107   if (!m_pBehavior) return;
00108
00109   HRESULT hr = NULL;
00110   IHTMLEventObj* pEvent = NULL;
00111
00112   long X = NULL;
00113   long Y = NULL;
00114
00115   hr = m_pBehavior->GetEventObject(&pEvent);
00116
00117   // Obtain X & Y
00118   hr = pEvent->get_offsetY(&Y);
00119   hr = pEvent->get_offsetX(&X);
00120
00121   POINT mousePoint;
00122   mousePoint.x = X;
00123   mousePoint.y = Y;
00124
00125   m_pBehavior->m_lPartID = -1;
00126
00127   for (int i = 0; i < 4; i++)
00128   {
00129     if (m_pBehavior->Distance(mousePoint, m_pBehavior->m_ptPolyCorners[i]) <= HANDLE_RADIUS)
00130     {
00131       m_pBehavior->m_lPartID = i;
00132       m_pBehavior->m_pPaintSite->InvalidateRect(NULL);
00133       mouseDown = TRUE;
00134     }
00135   }
00136
00137   pEvent->Release();
00138 }
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagADSERRMSG Member List

This is the complete list of members for tagADSERRMSG, including all inherited members.
hr | tagADSERRMSG
pszError | tagADSERRMSG
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Debug.h Source File

  • NetDS
  • SyncMgr
  • SyncDir

Debug.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #ifndef _SAMPLEDEBUG_
00013 #define _SAMPLEDEBUG_
00014
00015
00016 #if (DBG == 1)
00017 #undef DEBUG
00018 #undef _DEBUG
00019
00020 #define DEBUG 1
00021 #define _DEBUG 1
00022
00023 #endif // DGB
00024 #if DEBUG
00025
00026 STDAPI FnAssert( LPSTR lpstrExpr, LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine );
00027
00028 #undef Assert
00029 #undef AssertSz
00030 #undef Puts
00031 #undef TRACE
00032
00033 #define Assert(a) { if (!(a)) FnAssert(#a, NULL, __FILE__, __LINE__); }
00034 #define AssertSz(a, b) { if (!(a)) FnAssert(#a, b, __FILE__, __LINE__); }
00035 #define Puts(s) OutputDebugStringA(s)
00036 #define TRACE(s)  OutputDebugStringA(s)
00037
00038 #else // !DEBUG
00039
00040 #define Assert(a)
00041 #define AssertSz(a, b)
00042 #define Puts(s)
00043 #define TRACE(s)
00044
00045 #endif  // DEBUG
00046
00047
00048 #endif // _SAMPLEDEBUG_
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/Resource.h Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

Resource.h

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 //{{NO_DEPENDENCIES}}
00003 // Microsoft Developer Studio generated include file.
00004 // Used by CmdLineConsumer.rc
00005 //
00006 #define IDM_ABOUTBOX                    0x0010
00007 #define IDD_ABOUTBOX                    100
00008 #define IDS_ABOUTBOX                    101
00009 #define IDD_CMDLINECONSUMER_DIALOG      102
00010 #define IDR_MAINFRAME                   128
00011 #define IDC_LIST                        1000
00012 #define IDC_CUSTOM1                     1001
00013
00014 // Next default values for new objects
00015 //
00016 #ifdef APSTUDIO_INVOKED
00017 #ifndef APSTUDIO_READONLY_SYMBOLS
00018 #define _APS_NEXT_RESOURCE_VALUE        129
00019 #define _APS_NEXT_COMMAND_VALUE         32771
00020 #define _APS_NEXT_CONTROL_VALUE         1002
00021 #define _APS_NEXT_SYMED_VALUE           101
00022 #endif
00023 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/attributes/vc/attributes.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • attributes
  • vc

attributes.cpp

Go to the documentation of this file.
00001 // attributes.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include <wchar.h>
00005 #include <activeds.h>
00006 #ifndef ADS_SYSTEMFLAG_ATTR_NOT_REPLICATED
00007 #define ADS_SYSTEMFLAG_ATTR_NOT_REPLICATED         (0x00000001) // Non-replicated attribute
00008 #endif
00009
00010 #ifndef ADS_SYSTEMFLAG_ATTR_IS_CONSTRUCTED
00011 #define ADS_SYSTEMFLAG_ATTR_IS_CONSTRUCTED         (0x00000004) // Attribute is a constructed att
00012 #endif
00013
00014 HRESULT FindAttributesByType(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00015          DWORD dwAttributeType, //Bit flags to search for in systemFlags
00016          LPWSTR pszAttributerNameType, //ldapDisplayName of the naming attribute you want to display for each returned attribute.
00017                                          //NULL returns common name.
00018          BOOL bIsExactMatch //TRUE to find attributes that have systemFlags exactly matching dwAttributeType
00019                             //FALSE to find attributes that have the dwAttributeType bit set (and possibly others).
00020         );
00021
00022 HRESULT FindIndexedAttributes(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00023          LPWSTR pszAttributeNameType, //ldapDisplayName of the naming attribute you want to display for each returned attribute.
00024                                          //NULL returns common name.
00025          BOOL bIsIndexed //TRUE to find indexed attributes.
00026                          //FALSE to find non-indexed attributes.
00027         );
00028
00029 HRESULT FindGCAttributes(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00030          LPWSTR pszAttributeNameType, //ldapDisplayName of the naming attribute you want to display for each returned attribute.
00031                                          //NULL returns common name.
00032          BOOL bInGC //TRUE to find indexed attributes.
00033                          //FALSE to find non-indexed attributes.
00034         );
00035
00036 #define LDAP_PROV L"LDAP://"
00037
00038 int main(int argc, char* argv[])
00039 {
00040 LPWSTR szPath = new WCHAR[MAX_PATH];
00041 HRESULT hr = S_OK;
00042 IADs *pObject = NULL;
00043 IDirectorySearch *pSchemaNC = NULL;
00044 VARIANT var;
00045
00046 //Initialize COM
00047 CoInitialize(NULL);
00048
00049 wprintf(L"This program displays the following types of attributes in the schema:\n");
00050 wprintf(L"Non-Replicated, Indexed, Constructed, Global Catalog\n\n");
00051
00052 //wcscpy(szPath, L"LDAP://");
00053 //Get rootDSE and the schema container's DN.
00054 //Bind to current user's domain using current user's security context.
00055 hr = ADsOpenObject(L"LDAP://rootDSE", //NOTE: If you're running NT 4.0, Win9x, you must add
00056                                       // the server name, e.g LDAP://myServer/rootDSE
00057                  NULL,
00058                  NULL,
00059                  ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00060                  IID_IADs,
00061                  (void**)&pObject);
00062
00063 if (SUCCEEDED(hr))
00064 {
00065     hr = pObject->Get(L"schemaNamingContext",&var);
00066     if (SUCCEEDED(hr))
00067     {
00068         memset(szPath, 0, MAX_PATH);
00069         if (MAX_PATH >= (wcslen(LDAP_PROV) + wcslen(var.bstrVal)))
00070         {
00071             wcsncpy(szPath,LDAP_PROV, wcslen(LDAP_PROV));
00072             wcsncat(szPath,var.bstrVal, wcslen(var.bstrVal));
00073         }
00074         hr = ADsOpenObject(szPath,
00075                          NULL,
00076                          NULL,
00077                          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00078                          IID_IDirectorySearch,
00079                          (void**)&pSchemaNC);
00080
00081         if (SUCCEEDED(hr))
00082         {
00083             //Find non-replicated attributes
00084             wprintf (L"----------------------------------------------\n");
00085             wprintf(L"Non-Replicated attributes (stored on each domain controller but are not replicated elsewhere)\n");
00086             wprintf(L"Find non-replicated attributes\n");
00087             hr = FindAttributesByType(pSchemaNC, //IDirectorySearch pointer to schema naming context.
00088                                      ADS_SYSTEMFLAG_ATTR_NOT_REPLICATED, //Bit flags to search for in systemFlags
00089                                      L"ldapDisplayName",
00090                                      TRUE
00091                                      );
00092
00093             //Find attributes included in the global catalog
00094             wprintf (L"----------------------------------------------\n");
00095             wprintf(L"Global Catalog attributes (replicated to the Global Catalog)\n");
00096             wprintf(L"Find attributes included in the global catalog\n");
00097             hr = FindGCAttributes(pSchemaNC,
00098                                  L"ldapDisplayName",
00099                                  TRUE
00100                                  );
00101
00102             //Find constructed attributes
00103             wprintf (L"----------------------------------------------\n");
00104             wprintf(L"Constructed attributes (not stored in the directory but are calculated by the domain controller)\n");
00105             wprintf(L"Find constructed attributes\n");
00106             hr = FindAttributesByType(pSchemaNC, //IDirectorySearch pointer to schema naming context.
00107                                      ADS_SYSTEMFLAG_ATTR_IS_CONSTRUCTED, //Bit flags to search for in systemFlags
00108                                      L"ldapDisplayName",
00109                                      FALSE
00110                                      );
00111
00112
00113             //Find indexed attributes
00114             wprintf (L"----------------------------------------------\n");
00115             wprintf(L"Indexed attributes (indexed for efficient search)\n");
00116             wprintf(L"Find indexed attributes\n");
00117             hr = FindIndexedAttributes(pSchemaNC, //IDirectorySearch pointer to schema naming context.
00118                                       L"ldapDisplayName",
00119                                       TRUE
00120                                       );
00121
00122         }
00123         if (pSchemaNC)
00124            pSchemaNC->Release();
00125     }
00126     VariantClear(&var);
00127 }
00128 if (pObject)
00129     pObject->Release();
00130
00131 // Uninitialize COM
00132 CoUninitialize();
00133 delete szPath;
00134 return 0;
00135 }
00136
00137 HRESULT FindAttributesByType(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00138          DWORD dwAttributeType, //Bit flags to search for in systemFlags
00139          LPWSTR pszAttributeNameType, //ldapDisplayName of the naming attribute you want to display for each returned attribute.
00140                                          //NULL returns common name.
00141          BOOL bIsExactMatch //TRUE to find attributes that have systemFlags exactly matching dwAttributeType
00142                             //FALSE to find attributes that have the dwAttributeType bit set (and possibly others).
00143         )
00144 {
00145     //Create search filter
00146     LPWSTR pszSearchFilter = new WCHAR[MAX_PATH*2];
00147     if (bIsExactMatch)
00148        //Find attributes with systemFlags that exactly match dwAttributeType
00149        wsprintf(pszSearchFilter, L"(&(objectCategory=attributeSchema)(systemFlags=%d))",dwAttributeType);
00150     else
00151        //Find attributes with systemFlags that contain dwAttributeType
00152         wsprintf(pszSearchFilter, L"(&(objectCategory=attributeSchema)(systemFlags:1.2.840.113556.1.4.804:=%d))",dwAttributeType);
00153
00154     //Attributes are one-level deep in the Schema container so only need to search one level.
00155     ADS_SEARCHPREF_INFO SearchPrefs;
00156     SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00157     SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
00158     SearchPrefs.vValue.Integer = ADS_SCOPE_ONELEVEL;
00159     DWORD dwNumPrefs = 1;
00160
00161     // COL for iterations
00162     ADS_SEARCH_COLUMN col;
00163     HRESULT hr;
00164
00165     // Interface Pointers
00166     IADs    *pObj = NULL;
00167     IADs    * pIADs = NULL;
00168
00169     // Handle used for searching
00170     ADS_SEARCH_HANDLE hSearch;
00171
00172     // Set the search preference
00173     hr = pSchemaNC->SetSearchPreference( &SearchPrefs, dwNumPrefs);
00174     if (FAILED(hr))
00175         return hr;
00176
00177     CONST DWORD dwAttrNameSize = 1;
00178     LPWSTR pszAttribute[dwAttrNameSize];
00179
00180     if (!pszAttributeNameType)
00181         pszAttribute[0] = L"cn";
00182     else
00183         pszAttribute[0] = pszAttributeNameType;
00184
00185
00186     // Execute the search
00187     hr = pSchemaNC->ExecuteSearch(pszSearchFilter,
00188                                   pszAttribute,
00189                                   dwAttrNameSize,
00190                                   &hSearch
00191                                   );
00192     if ( SUCCEEDED(hr) )
00193     {
00194
00195     // Call IDirectorySearch::GetNextRow() to retrieve the next row
00196     //of data
00197         while( pSchemaNC->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
00198         {
00199
00200             // loop through the array of passed column names,
00201             // print the data for each column
00202             for (DWORD x = 0; x < dwAttrNameSize; x++)
00203             {
00204
00205                 // Get the data for this column
00206                 hr = pSchemaNC->GetColumn( hSearch, pszAttribute[x], &col );
00207
00208                 if ( SUCCEEDED(hr) )
00209                 {
00210
00211                     if (ADSTYPE_CASE_IGNORE_STRING == col.dwADsType)
00212                     {
00213                         // Print the data for the column and free the column
00214                         wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString);
00215                     }
00216                     else
00217                         wprintf(L"<%s property is not a string>",pszAttribute[x]);
00218
00219                     pSchemaNC->FreeColumn( &col );
00220                 }
00221                 else
00222                     wprintf(L"<Could not get value for %s property>",pszAttribute[x]);
00223
00224             }
00225         }
00226
00227         // Close the search handle to clean up
00228         pSchemaNC->CloseSearchHandle(hSearch);
00229     }
00230     delete pszSearchFilter;
00231     return hr;
00232 }
00233
00234 HRESULT FindIndexedAttributes(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00235          LPWSTR pszAttributeNameType, //ldapDisplayName of the naming attribute you want to display for each returned attribute.
00236                                          //NULL returns common name.
00237          BOOL bIsIndexed //TRUE to find indexed attributes.
00238                          //FALSE to find non-indexed attributes.
00239         )
00240 {
00241     //Create search filter
00242     LPWSTR pszSearchFilter = new WCHAR[MAX_PATH*2];
00243     DWORD dwIndexed;
00244     if (bIsIndexed)
00245        dwIndexed = 1;
00246     else
00247        dwIndexed = 0;
00248
00249     wsprintf(pszSearchFilter, L"(&(objectCategory=attributeSchema)(searchFlags=%d))",dwIndexed);
00250
00251     //Attributes are one-level deep in the Schema container so only need to search one level.
00252     ADS_SEARCHPREF_INFO SearchPrefs;
00253     SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00254     SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
00255     SearchPrefs.vValue.Integer = ADS_SCOPE_ONELEVEL;
00256     DWORD dwNumPrefs = 1;
00257
00258     // COL for iterations
00259     ADS_SEARCH_COLUMN col;
00260     HRESULT hr;
00261
00262     // Interface Pointers
00263     IADs    *pObj = NULL;
00264     IADs    * pIADs = NULL;
00265
00266     // Handle used for searching
00267     ADS_SEARCH_HANDLE hSearch;
00268
00269     // Set the search preference
00270     hr = pSchemaNC->SetSearchPreference( &SearchPrefs, dwNumPrefs);
00271     if (FAILED(hr))
00272         return hr;
00273
00274     CONST DWORD dwAttrNameSize = 1;
00275     LPWSTR pszAttribute[dwAttrNameSize];
00276
00277     if (!pszAttributeNameType)
00278         pszAttribute[0] = L"cn";
00279     else
00280         pszAttribute[0] = pszAttributeNameType;
00281
00282
00283     // Execute the search
00284     hr = pSchemaNC->ExecuteSearch(pszSearchFilter,
00285                                   pszAttribute,
00286                                   dwAttrNameSize,
00287                                   &hSearch
00288                                   );
00289     if ( SUCCEEDED(hr) )
00290     {
00291
00292     // Call IDirectorySearch::GetNextRow() to retrieve the next row
00293     //of data
00294         while( pSchemaNC->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
00295         {
00296
00297             // loop through the array of passed column names,
00298             // print the data for each column
00299             for (DWORD x = 0; x < dwAttrNameSize; x++)
00300             {
00301
00302                 // Get the data for this column
00303                 hr = pSchemaNC->GetColumn( hSearch, pszAttribute[x], &col );
00304
00305                 if ( SUCCEEDED(hr) )
00306                 {
00307
00308                     if (ADSTYPE_CASE_IGNORE_STRING == col.dwADsType)
00309                     {
00310                         // Print the data for the column and free the column
00311                         wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString);
00312                     }
00313                     else
00314                         wprintf(L"<%s property is not a string>",pszAttribute[x]);
00315
00316                     pSchemaNC->FreeColumn( &col );
00317                 }
00318                 else
00319                     wprintf(L"<Could not get value for %s property>",pszAttribute[x]);
00320             }
00321         }
00322
00323         // Close the search handle to clean up
00324         pSchemaNC->CloseSearchHandle(hSearch);
00325     }
00326     delete pszSearchFilter;
00327     return hr;
00328 }
00329
00330 HRESULT FindGCAttributes(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00331          LPWSTR pszAttributeNameType, //ldapDisplayName of the naming attribute you want to display for each returned attribute.
00332                                          //NULL returns common name.
00333          BOOL bInGC //TRUE to find GC attributes.
00334                          //FALSE to find non-GC attributes.
00335         )
00336 {
00337     //Create search filter
00338     LPWSTR pszSearchFilter = new WCHAR[MAX_PATH*2];
00339     LPWSTR szBool = NULL;
00340     if (bInGC)
00341        szBool = L"TRUE";
00342     else
00343        szBool = L"FALSE";
00344
00345     wsprintf(pszSearchFilter, L"(&(objectCategory=attributeSchema)(isMemberOfPartialAttributeSet=%s))",szBool);
00346
00347     //Attributes are one-level deep in the Schema container so only need to search one level.
00348     ADS_SEARCHPREF_INFO SearchPrefs;
00349     SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00350     SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
00351     SearchPrefs.vValue.Integer = ADS_SCOPE_ONELEVEL;
00352     DWORD dwNumPrefs = 1;
00353
00354     // COL for iterations
00355     ADS_SEARCH_COLUMN col;
00356     HRESULT hr;
00357
00358     // Interface Pointers
00359     IADs    *pObj = NULL;
00360     IADs    * pIADs = NULL;
00361
00362     // Handle used for searching
00363     ADS_SEARCH_HANDLE hSearch;
00364
00365     // Set the search preference
00366     hr = pSchemaNC->SetSearchPreference( &SearchPrefs, dwNumPrefs);
00367     if (FAILED(hr))
00368         return hr;
00369
00370     CONST DWORD dwAttrNameSize = 1;
00371     LPWSTR pszAttribute[dwAttrNameSize];
00372
00373     if (!pszAttributeNameType)
00374         pszAttribute[0] = L"cn";
00375     else
00376         pszAttribute[0] = pszAttributeNameType;
00377
00378
00379     // Execute the search
00380     hr = pSchemaNC->ExecuteSearch(pszSearchFilter,
00381                                   pszAttribute,
00382                                   dwAttrNameSize,
00383                                   &hSearch
00384                                   );
00385     if ( SUCCEEDED(hr) )
00386     {
00387
00388     // Call IDirectorySearch::GetNextRow() to retrieve the next row
00389     //of data
00390         while( pSchemaNC->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
00391         {
00392
00393             // loop through the array of passed column names,
00394             // print the data for each column
00395             for (DWORD x = 0; x < dwAttrNameSize; x++)
00396             {
00397
00398                 // Get the data for this column
00399                 hr = pSchemaNC->GetColumn( hSearch, pszAttribute[x], &col );
00400
00401                 if ( SUCCEEDED(hr) )
00402                 {
00403
00404                     if (ADSTYPE_CASE_IGNORE_STRING == col.dwADsType)
00405                     {
00406                         // Print the data for the column and free the column
00407                         wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString);
00408                     }
00409                     else
00410                         wprintf(L"<%s property is not a string>",pszAttribute[x]);
00411
00412                     pSchemaNC->FreeColumn( &col );
00413                 }
00414                 else
00415                     wprintf(L"<Could not get value for %s property>",pszAttribute[x]);
00416             }
00417         }
00418
00419         // Close the search handle to clean up
00420         pSchemaNC->CloseSearchHandle(hSearch);
00421     }
00422     delete pszSearchFilter;
00423     return hr;
00424 }
00425
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/localres.h Source File

  • SysMgmt
  • MMC
  • Ppgeext

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #define INDEX_SUN 6
00031 #define INDEX_SNOW 7
00032 #define INDEX_RAIN 8
00033 #define INDEX_CLOUD 9
00034 #define INDEX_WORLD 10
00035 #define INDEX_THUNDER 11
00036
00037
00038 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/land.h Source File

  • SysMgmt
  • MMC
  • Multisel

land.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _LAND_H
00021 #define _LAND_H
00022
00023 #include "DeleBase.h"
00024
00025 class CLandBasedVehicle : public CDelegationBase {
00026 public:
00027     CLandBasedVehicle() { }
00028
00029     virtual ~CLandBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Land-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_LANDICON; }
00034
00035 private:
00036     enum { IDM_NEW_LAND = 2 };
00037
00038     // {2974380E-4C4B-11d2-89D8-000021473128}
00039     static const GUID thisGuid;
00040 };
00041
00042
00043 #endif // _LAND_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/PingResp/PingResponder.h Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • PingResp

PingResponder.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: PingResponder.h
00004
00005 Summary:  Define implementation class (CPingResponder) for object that implements
00006           IPingResponder. Generated by VC6 ATL Wizard.
00007
00008 ----------------------------------------------------------------------------
00009
00010 This file is part of the Microsoft COM+ Samples.
00011
00012 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00013
00014 This source code is intended only as a supplement to Microsoft
00015 Development Tools and/or on-line documentation. See these other
00016 materials for detailed information regarding Microsoft code samples.
00017
00018 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00021 PARTICULAR PURPOSE.
00022
00023 ==========================================================================+*/
00024
00025 // PingResponder.h : Declaration of the CPingResponder
00026
00027 #ifndef __PINGRESP_H_
00028 #define __PINGRESP_H_
00029
00030 #include "resource.h"       // main symbols
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // CPingResponder
00034 class ATL_NO_VTABLE CPingResponder :
00035   public CComObjectRootEx<CComMultiThreadModel>,
00036   public CComCoClass<CPingResponder, &CLSID_PingResponder>,
00037   public IPingResponder
00038 {
00039 public:
00040   CPingResponder()
00041   {
00042   }
00043
00044 DECLARE_REGISTRY_RESOURCEID(IDR_PINGRESP)
00045 DECLARE_NOT_AGGREGATABLE(CPingResponder)
00046
00047 DECLARE_PROTECT_FINAL_CONSTRUCT()
00048
00049 BEGIN_COM_MAP(CPingResponder)
00050   COM_INTERFACE_ENTRY(IPingResponder)
00051 END_COM_MAP()
00052
00053 // IPingResponder
00054 public:
00055   STDMETHOD(Ping)();
00056 };
00057
00058 #endif //__PINGRESP_H_
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/DisDraw.Cpp Source File

  • NetDS
  • MessageQueuing
  • c_draw

DisDraw.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // disdraw.cpp : Defines the class behaviors for the application.
00014 //
00015 //
00016
00017 #include "stdafx.h"
00018 #include "disdraw.h"
00019 #include "drawdlg.h"
00020 #include "logindlg.h"
00021
00022 #ifdef _DEBUG
00023 #define new DEBUG_NEW
00024 #undef THIS_FILE
00025 static char THIS_FILE[] = __FILE__;
00026 #endif
00027
00028 #define MAX_USERNAME_LEN 32
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 // CDisdrawApp
00032
00033 BEGIN_MESSAGE_MAP(CDisdrawApp, CWinApp)
00034   //{{AFX_MSG_MAP(CDisdrawApp)
00035     // NOTE - the ClassWizard will add and remove mapping macros here.
00036     //    DO NOT EDIT what you see in these blocks of generated code!
00037   //}}AFX_MSG
00038   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00039 END_MESSAGE_MAP()
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // CDisdrawApp construction
00043
00044 CDisdrawApp::CDisdrawApp()
00045 {
00046   // TODO: add construction code here,
00047   // Place all significant initialization in InitInstance
00048 }
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // The one and only CDisdrawApp object
00052
00053 CDisdrawApp theApp;
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // CDisdrawApp initialization
00057
00058 BOOL CDisdrawApp::InitInstance()
00059 {
00060   // Standard initialization
00061   // If you are not using these features and wish to reduce the size
00062   //  of your final executable, you should remove from the following
00063   //  the specific initialization routines you do not need.
00064
00065 #ifdef _AFXDLL
00066   Enable3dControls();     // Call this when using MFC in a shared DLL
00067 #else
00068   Enable3dControlsStatic(); // Call this when linking to MFC statically
00069 #endif
00070
00071   //
00072   // Prompt for the user's name
00073   //
00074   char mbsUserName[MAX_USERNAME_LEN];
00075   DWORD dwNumBytes = MAX_USERNAME_LEN;
00076   GetUserName(mbsUserName, &dwNumBytes);
00077   CLoginDlg dlgLogin;
00078   dlgLogin.m_strLogin = mbsUserName;
00079   if (dlgLogin.DoModal() == IDCANCEL || dlgLogin.m_strLogin == "" )
00080   {
00081     return FALSE;
00082   }
00083
00084   dlgLogin.m_strLogin.MakeUpper();
00085
00086   CDisdrawDlg dlg;
00087   m_pMainWnd = &dlg;
00088   dlg.m_strLogin = dlgLogin.m_strLogin;
00089   int nResponse = dlg.DoModal();
00090   if (nResponse == IDOK)
00091   {
00092     // TODO: Place code here to handle when the dialog is
00093     //  dismissed with OK
00094   }
00095   else if (nResponse == IDCANCEL)
00096   {
00097     // TODO: Place code here to handle when the dialog is
00098     //  dismissed with Cancel
00099   }
00100
00101   // Since the dialog has been closed, return FALSE so that we exit the
00102   //  application, rather than start the application's message pump.
00103   return FALSE;
00104 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/Factory.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

Factory.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.H
00003
00004   Summary:   Include file for the class factory COM objects:
00005              CFCar, CFUtilityCar, CFCruiseCar, and CFCarSample.
00006              These constitute the DLLSERVE server's Class Factorys for
00007              those COM components.
00008
00009              The multiple interface COM Object Classes are achieved via
00010              the technique of nested classes: the implementation of the
00011              IClassFactory interfaces are nested inside of the class
00012              factory COM object classes.
00013
00014              For a comprehensive tutorial code tour of this module's
00015              contents and offerings see the tutorial DLLSERVE.HTM file.
00016              For more specific technical details on the internal workings
00017              see the comments dispersed throughout the module's source code.
00018
00019   Classes:   CFCar, CFUtilityCar, CFCruiseCar, CFCarSample.
00020
00021   Functions: .
00022
00023   Origin:    9-11-95: atrent - Editor-inheritance from CRUCAR.H in
00024                the COMOBJ Tutorial Code Sample.
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 #if !defined(FACTORY_H)
00042 #define FACTORY_H
00043
00044 #ifdef __cplusplus
00045
00046 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00047   ObjectClass: CFCar
00048
00049   Summary:     Class Factory COM Object Class for Car COM components.
00050                Used to manufacture COCar COM objects.  The mulitple
00051                interfaces on this COM object class are constructed via
00052                the nested interface classes technique.
00053
00054   Interfaces:  IUnknown
00055                  Standard interface providing COM object features.
00056                IClassFactory
00057                  Standard interface providing COM Class Factory features.
00058
00059   Aggregation: Yes, CFCar COM objects are aggregatable by
00060                passing a non-NULL pUnkOuter IUnknown pointer into the
00061                constructor.
00062 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00063 class CFCar : public IUnknown
00064 {
00065   public:
00066     // Main Object Constructor & Destructor.
00067     CFCar(IUnknown* pUnkOuter, CServer* pServer);
00068     ~CFCar(void);
00069
00070     // IUnknown methods. Main object, non-delegating.
00071     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00072     STDMETHODIMP_(ULONG) AddRef(void);
00073     STDMETHODIMP_(ULONG) Release(void);
00074
00075   private:
00076     // We declare nested class interface implementations here.
00077
00078     // We implement the IClassFactory interface (ofcourse) in this class
00079     // factory COM object class.
00080     class CImpIClassFactory : public IClassFactory
00081     {
00082       public:
00083         // Interface Implementation Constructor & Destructor.
00084         CImpIClassFactory(
00085           CFCar* pBackObj,
00086           IUnknown* pUnkOuter,
00087           CServer* pServer);
00088         ~CImpIClassFactory(void);
00089
00090         // IUnknown methods.
00091         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00092         STDMETHODIMP_(ULONG) AddRef(void);
00093         STDMETHODIMP_(ULONG) Release(void);
00094
00095         // IClassFactory methods.
00096         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00097         STDMETHODIMP         LockServer(BOOL);
00098
00099       private:
00100         // Data private to this interface implementation of IClassFactory.
00101         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00102         CFCar*        m_pBackObj;    // Parent Object back pointer.
00103         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00104         CServer*      m_pServer;     // Server's control object.
00105     };
00106
00107     // Make the otherwise private and nested IClassFactory interface
00108     // implementation a friend to COM object instantiations of this
00109     // selfsame CFCar COM object class.
00110     friend CImpIClassFactory;
00111
00112     // Private data of CFCar COM objects.
00113
00114     // Nested IClassFactory implementation instantiation.
00115     CImpIClassFactory m_ImpIClassFactory;
00116
00117     // Main Object reference count.
00118     ULONG             m_cRefs;
00119
00120     // Outer unknown (aggregation & delegation). Used when this
00121     // CFCar object is being aggregated.  Otherwise it is used
00122     // for delegation if this object is reused via containment.
00123     IUnknown*         m_pUnkOuter;
00124
00125     // Pointer to this component server's control object.
00126     CServer*          m_pServer;
00127 };
00128
00129 typedef CFCar* PCFCar;
00130
00131
00132 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00133   ObjectClass: CFUtilityCar
00134
00135   Summary:     Class Factory COM Object Class for UtilityCar COM
00136                components.  Used to manufacture COUtilityCar COM
00137                objects.  The mulitple interfaces on this COM object
00138                class are constructed via the nested interface
00139                classes technique.
00140
00141   Interfaces:  IUnknown
00142                  Standard interface providing COM object features.
00143                IClassFactory
00144                  Standard interface providing COM Class Factory features.
00145
00146   Aggregation: Yes, CFUtilityCar COM objects are aggregatable by
00147                passing a non-NULL pUnkOuter IUnknown pointer into the
00148                constructor.
00149 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00150 class CFUtilityCar : public IUnknown
00151 {
00152   public:
00153     // Main Object Constructor & Destructor.
00154     CFUtilityCar(IUnknown* pUnkOuter, CServer* pServer);
00155     ~CFUtilityCar(void);
00156
00157     // A general method for initializing a newly created CFUtilityCar.
00158     HRESULT Init(void);
00159
00160     // IUnknown methods. Main object, non-delegating.
00161     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00162     STDMETHODIMP_(ULONG) AddRef(void);
00163     STDMETHODIMP_(ULONG) Release(void);
00164
00165   private:
00166     // We declare nested class interface implementations here.
00167
00168     // We implement the IClassFactory interface (ofcourse) in this class
00169     // factory COM object class.
00170     class CImpIClassFactory : public IClassFactory
00171     {
00172       public:
00173         // Interface Implementation Constructor & Destructor.
00174         CImpIClassFactory(
00175           CFUtilityCar* pBackObj,
00176           IUnknown* pUnkOuter,
00177           CServer* pServer);
00178         ~CImpIClassFactory(void);
00179
00180         // IUnknown methods.
00181         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00182         STDMETHODIMP_(ULONG) AddRef(void);
00183         STDMETHODIMP_(ULONG) Release(void);
00184
00185         // IClassFactory methods.
00186         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00187         STDMETHODIMP         LockServer(BOOL);
00188
00189       private:
00190         // Data private to this interface implementation of IClassFactory.
00191         ULONG            m_cRefI;       // Interface Ref Count (debugging).
00192         CFUtilityCar*    m_pBackObj;    // Parent Object back pointer.
00193         IUnknown*        m_pUnkOuter;   // Outer unknown for Delegation.
00194         CServer*         m_pServer;     // Server Control Object.
00195     };
00196
00197     // Make the otherwise private and nested IClassFactory interface
00198     // implementation a friend to COM object instantiations of this
00199     // selfsame CFUtilityCar COM object class.
00200     friend CImpIClassFactory;
00201
00202     // Private data of CFUtilityCar COM objects.
00203
00204     // Nested IClassFactory implementation instantiation.
00205     CImpIClassFactory m_ImpIClassFactory;
00206
00207     // Main Object reference count.
00208     ULONG             m_cRefs;
00209
00210     // Outer unknown (aggregation & delegation). Used when this
00211     // CFUtilityCar object is being aggregated.  Otherwise it is used
00212     // for delegation if this object is reused via containment.
00213     IUnknown*         m_pUnkOuter;
00214
00215     // Pointer to this component server's control object.
00216     CServer*          m_pServer;
00217 };
00218
00219 typedef CFUtilityCar* PCFUtilityCar;
00220
00221
00222 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00223   ObjectClass: CFCruiseCar
00224
00225   Summary:     Class Factory COM Object Class for CruiseCar COM
00226                components.  Used to manufacture COCruiseCar COM objects.
00227                The mulitple interfaces on this COM object class are
00228                constructed via the nested interface classes technique.
00229
00230   Interfaces:  IUnknown
00231                  Standard interface providing COM object features.
00232                IClassFactory
00233                  Standard interface providing COM Class Factory features.
00234
00235   Aggregation: Yes, CFCruiseCar COM objects are aggregatable by
00236                passing a non-NULL pUnkOuter IUnknown pointer into the
00237                constructor.
00238 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00239 class CFCruiseCar : public IUnknown
00240 {
00241   public:
00242     // Main Object Constructor & Destructor.
00243     CFCruiseCar(IUnknown* pUnkOuter, CServer* pServer);
00244     ~CFCruiseCar(void);
00245
00246     // A general method for initializing a newly created CFCruiseCar.
00247     HRESULT Init(void);
00248
00249     // IUnknown methods. Main object, non-delegating.
00250     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00251     STDMETHODIMP_(ULONG) AddRef(void);
00252     STDMETHODIMP_(ULONG) Release(void);
00253
00254   private:
00255     // We declare nested class interface implementations here.
00256
00257     // We implement the IClassFactory interface (ofcourse) in this class
00258     // factory COM object class.
00259     class CImpIClassFactory : public IClassFactory
00260     {
00261       public:
00262         // Interface Implementation Constructor & Destructor.
00263         CImpIClassFactory(
00264           CFCruiseCar* pBackObj,
00265           IUnknown* pUnkOuter,
00266           CServer* pServer);
00267         ~CImpIClassFactory(void);
00268
00269         // IUnknown methods.
00270         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00271         STDMETHODIMP_(ULONG) AddRef(void);
00272         STDMETHODIMP_(ULONG) Release(void);
00273
00274         // IClassFactory methods.
00275         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00276         STDMETHODIMP         LockServer(BOOL);
00277
00278       private:
00279         // Data private to this interface implementation of IClassFactory.
00280         ULONG            m_cRefI;       // Interface Ref Count (debugging).
00281         CFCruiseCar*     m_pBackObj;    // Parent Object back pointer.
00282         IUnknown*        m_pUnkOuter;   // Outer unknown for Delegation.
00283         CServer*         m_pServer;     // Server Control Object.
00284     };
00285
00286     // Make the otherwise private and nested IClassFactory interface
00287     // implementation a friend to COM object instantiations of this
00288     // selfsame CFCruiseCar COM object class.
00289     friend CImpIClassFactory;
00290
00291     // Private data of CFCruiseCar COM objects.
00292
00293     // Nested IClassFactory implementation instantiation.
00294     CImpIClassFactory m_ImpIClassFactory;
00295
00296     // Main Object reference count.
00297     ULONG             m_cRefs;
00298
00299     // Outer unknown (aggregation & delegation). Used when this
00300     // CFCruiseCar object is being aggregated.  Otherwise it is used
00301     // for delegation if this object is reused via containment.
00302     IUnknown*         m_pUnkOuter;
00303
00304     // Pointer to this component server's control object.
00305     CServer*          m_pServer;
00306 };
00307
00308 typedef CFCruiseCar* PCFCruiseCar;
00309
00310
00311 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00312   ObjectClass: CFCarSample
00313
00314   Summary:     Class Factory COM Object Class for CarSample COM
00315                components.  Used to manufacture COCarSample COM
00316                objects.  The mulitple interfaces on this COM object
00317                class are constructed via the nested interface classes
00318                technique.
00319
00320   Interfaces:  IUnknown
00321                  Standard interface providing COM object features.
00322                IClassFactory
00323                  Standard interface providing COM Class Factory features.
00324
00325   Aggregation: Yes, CFCarSample COM objects are aggregatable by
00326                passing a non-NULL pUnkOuter IUnknown pointer into the
00327                constructor.
00328 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00329 class CFCarSample : public IUnknown
00330 {
00331   public:
00332     // Main Object Constructor & Destructor.
00333     CFCarSample(IUnknown* pUnkOuter, CServer* pServer);
00334     ~CFCarSample(void);
00335
00336     // A general method for initializing a newly created CFCarSample.
00337     HRESULT Init(void);
00338
00339     // IUnknown methods. Main object, non-delegating.
00340     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00341     STDMETHODIMP_(ULONG) AddRef(void);
00342     STDMETHODIMP_(ULONG) Release(void);
00343
00344   private:
00345     // We declare nested class interface implementations here.
00346
00347     // We implement the IClassFactory interface (ofcourse) in this Class
00348     // Factory COM object class.
00349     class CImpIClassFactory : public IClassFactory
00350     {
00351       public:
00352         // Interface Implementation Constructor & Destructor.
00353         CImpIClassFactory(
00354           CFCarSample* pBackObj,
00355           IUnknown* pUnkOuter,
00356           CServer* pServer);
00357         ~CImpIClassFactory(void);
00358
00359         // IUnknown methods.
00360         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00361         STDMETHODIMP_(ULONG) AddRef(void);
00362         STDMETHODIMP_(ULONG) Release(void);
00363
00364         // IClassFactory methods.
00365         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00366         STDMETHODIMP         LockServer(BOOL);
00367
00368       private:
00369         // Data private to this interface implementation of IClassFactory.
00370         ULONG           m_cRefI;     // Interface Ref Count (for debugging).
00371         CFCarSample*    m_pBackObj;  // Parent Object back pointer.
00372         IUnknown*       m_pUnkOuter; // Outer unknown for Delegation.
00373         CServer*        m_pServer;   // Server Control Object.
00374     };
00375
00376     // Make the otherwise private and nested IClassFactory interface
00377     // implementation a friend to COM object instantiations of this
00378     // selfsame CFCarSample COM object class.
00379     friend CImpIClassFactory;
00380
00381     // Private data of CFCarSample COM objects.
00382
00383     // Nested IClassFactory implementation instantiation.
00384     CImpIClassFactory m_ImpIClassFactory;
00385
00386     // Main Object reference count.
00387     ULONG             m_cRefs;
00388
00389     // Outer unknown (aggregation & delegation). Used when this
00390     // CFCarSample object is being aggregated.  Otherwise it is used
00391     // for delegation if this object is reused via containment.
00392     IUnknown*         m_pUnkOuter;
00393
00394     // Pointer to this component server's control object.
00395     CServer*          m_pServer;
00396 };
00397
00398 typedef CFCarSample* PCFCarSample;
00399
00400 #endif // __cplusplus
00401
00402
00403 #endif // FACTORY_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/property.cpp Source File

  • Dataaccess
  • oledb
  • tablecopy

property.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module PROPERTY.CPP
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011 ////////////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 ////////////////////////////////////////////////////////////////////////
00015 #include "WinMain.h"
00016 #include "Property.h"
00017
00018
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // HRESULT GetProperty
00022 //
00023 // Get the property information from the data source or object.
00024 // propid specifies the property and propset specifies the property set to which
00025 // propid belongs. The datatype of the property is required for the correct
00026 // coercion of the data
00027 /////////////////////////////////////////////////////////////////////////////
00028 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet,
00029            DBPROP** ppProperty)
00030 {
00031   ASSERT(pIUnknown && ppProperty);
00032   *ppProperty = NULL;
00033
00034   HRESULT hr = S_OK;
00035
00036   IDBProperties* pIDBProperties = NULL;
00037   ICommandProperties* pICommandProperties = NULL;
00038   IRowsetInfo* pIRowsetInfo = NULL;
00039
00040   ULONG   cPropSets = 0;
00041   DBPROPSET*  rgPropSets = NULL;
00042
00043   const ULONG   cPropertyIDSets = 1;
00044   DBPROPIDSET   rgPropertyIDSets[cPropertyIDSets];
00045
00046   //SetUp input DBPROPIDSET struct (all static)
00047   rgPropertyIDSets[0].cPropertyIDs = cPropertyIDSets;
00048   rgPropertyIDSets[0].rgPropertyIDs = &PropertyID;
00049   rgPropertyIDSets[0].guidPropertySet = guidPropertySet;
00050
00051   //Need to figure out which Interface was passed in
00052   //IDBInitialize, or ICommand, or IRowset, all three allow GetProperties
00053   if(SUCCEEDED(hr = pIUnknown->QueryInterface(IID_IDBProperties,(void **)&pIDBProperties)))
00054   {
00055     //GetProperties
00056     //Property might not be supported
00057     hr = pIDBProperties->GetProperties(cPropertyIDSets, rgPropertyIDSets, &cPropSets, &rgPropSets);
00058   }
00059   else if(SUCCEEDED(hr = pIUnknown->QueryInterface(IID_ICommandProperties,(void **)&pICommandProperties)))
00060   {
00061     //GetProperties
00062     //Property might not be supported
00063     hr = pICommandProperties->GetProperties(cPropertyIDSets, rgPropertyIDSets, &cPropSets, &rgPropSets);
00064   }
00065   else
00066   {
00067     XTESTC(hr = pIUnknown->QueryInterface(IID_IRowsetInfo, (void **)&pIRowsetInfo));
00068
00069     //GetProperties
00070     //Property might not be supported
00071     hr = pIRowsetInfo->GetProperties(cPropertyIDSets, rgPropertyIDSets, &cPropSets, &rgPropSets);
00072   }
00073
00074   //Check return result
00075   //Can be DB_S_ / DB_E_ERRORSOCCURRED if notsupported property...
00076   if(FAILED(hr) && hr != DB_E_ERRORSOCCURRED)
00077     XTESTC(hr);
00078
00079   //Verify results
00080   CHECKC(cPropSets==1 && rgPropSets!=NULL);
00081   CHECKC(rgPropSets[0].cProperties==1 && rgPropSets[0].rgProperties!=NULL);
00082   CHECKC(rgPropSets[0].rgProperties[0].dwPropertyID == PropertyID);
00083
00084   //Return the property to the user
00085   *ppProperty = rgPropSets[0].rgProperties;
00086   hr = S_OK;
00087
00088 CLEANUP:
00089   //Just Free the outer Struct,
00090   //since we return the inner Property for the user to free
00091   SAFE_FREE(rgPropSets);
00092
00093   SAFE_RELEASE(pIDBProperties);
00094   SAFE_RELEASE(pICommandProperties);
00095   SAFE_RELEASE(pIRowsetInfo);
00096   return hr;
00097 }
00098
00099 /////////////////////////////////////////////////////////////////////////////
00100 // HRESULT GetProperty
00101 //
00102 /////////////////////////////////////////////////////////////////////////////
00103 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, WCHAR** ppwszValue)
00104 {
00105   ASSERT(pIUnknown && ppwszValue);
00106   HRESULT hr;
00107
00108   DBPROP* pProperty = NULL;
00109   *ppwszValue = NULL;
00110
00111   //Property might not be supported
00112   hr = GetProperty(pIUnknown, PropertyID, guidPropertySet, &pProperty);
00113
00114   //Copy the value
00115   //GetProperty might return VT_EMPTY for no default string
00116   if(SUCCEEDED(hr) && pProperty && pProperty->vValue.vt == VT_BSTR)
00117     (*ppwszValue) = wcsDuplicate(V_BSTR(&pProperty->vValue));
00118
00119   if(*ppwszValue == NULL)
00120   {
00121     SAFE_ALLOC(*ppwszValue, WCHAR, 1);
00122     (*ppwszValue)[0] = EOL;
00123   }
00124
00125 CLEANUP:
00126   FreeProperties(1, pProperty);
00127   return hr;
00128 }
00129
00130 /////////////////////////////////////////////////////////////////////////////
00131 // HRESULT GetProperty
00132 //
00133 /////////////////////////////////////////////////////////////////////////////
00134 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, WCHAR* pwszValue)
00135 {
00136   ASSERT(pIUnknown && pwszValue);
00137   HRESULT hr;
00138
00139   DBPROP* pProperty = NULL;
00140   *pwszValue = EOL;
00141
00142   //Might not be supported
00143   hr = GetProperty(pIUnknown, PropertyID, guidPropertySet, &pProperty);
00144
00145   //Copy the value
00146   //GetProperty might return VT_EMPTY for no default string
00147   if(SUCCEEDED(hr) && pProperty && pProperty->vValue.vt == VT_BSTR)
00148     wcscpy(pwszValue, V_BSTR(&pProperty->vValue));
00149
00150   FreeProperties(1, pProperty);
00151   return hr;
00152 }
00153
00154 /////////////////////////////////////////////////////////////////////////////
00155 // HRESULT GetProperty
00156 //
00157 /////////////////////////////////////////////////////////////////////////////
00158 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, ULONG* pcValue)
00159 {
00160   ASSERT(pIUnknown && pcValue);
00161   HRESULT hr;
00162
00163   DBPROP* pProperty = NULL;
00164   *pcValue = 0;
00165
00166   //Might not be supported
00167   hr = GetProperty(pIUnknown, PropertyID, guidPropertySet, &pProperty);
00168
00169   //Copy the value
00170   //GetProperty might return VT_EMPTY for no default string
00171   if(SUCCEEDED(hr) && pProperty && pProperty->vValue.vt == VT_I4)
00172     *pcValue = V_I4(&pProperty->vValue);
00173
00174   FreeProperties(1, pProperty);
00175   return hr;
00176 }
00177
00178 /////////////////////////////////////////////////////////////////////////////
00179 // HRESULT GetProperty
00180 //
00181 /////////////////////////////////////////////////////////////////////////////
00182 HRESULT GetProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, BOOL* pbValue)
00183 {
00184   ASSERT(pIUnknown && pbValue);
00185   HRESULT hr;
00186
00187   DBPROP* pProperty = NULL;
00188   *pbValue = FALSE;
00189
00190   //Might not be supported
00191   hr = GetProperty(pIUnknown, PropertyID, guidPropertySet, &pProperty);
00192
00193   //Copy the value
00194   //GetProperty might return VT_EMPTY for no default string
00195   if(SUCCEEDED(hr) && pProperty && pProperty->vValue.vt == VT_BOOL)
00196     *pbValue = V_BOOL(&pProperty->vValue) == VARIANT_TRUE;
00197
00198   FreeProperties(1, pProperty);
00199   return hr;
00200 }
00201
00202
00203 /////////////////////////////////////////////////////////////////////////////
00204 // HRESULT GetPropInfo
00205 //
00206 /////////////////////////////////////////////////////////////////////////////
00207 HRESULT GetPropInfo(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet, DBPROPINFO** ppPropInfo)
00208 {
00209   ASSERT(pIUnknown && ppPropInfo);
00210   HRESULT hr;
00211   IDBProperties* pIDBProperties = NULL;
00212
00213   const ULONG cPropIDSets = 1;
00214   DBPROPIDSET rgPropIDSets[cPropIDSets];
00215
00216   ULONG cPropInfoSets = 0;
00217   DBPROPINFOSET* rgPropInfoSets = NULL;
00218
00219   //Construct the DBPROPIDSET structure
00220   rgPropIDSets[0].cPropertyIDs = 1;
00221   rgPropIDSets[0].rgPropertyIDs = &PropertyID;
00222   rgPropIDSets[0].guidPropertySet = guidPropertySet;
00223
00224   //Obtain IDBProperties
00225   XTESTC(hr = pIUnknown->QueryInterface(IID_IDBProperties,(void**)&pIDBProperties));
00226
00227   //Don't display dialog if errors occurred.
00228   //Errors can occur if properties are not supported by the provider
00229   QTESTC(hr = pIDBProperties->GetPropertyInfo(cPropIDSets,rgPropIDSets,&cPropInfoSets,&rgPropInfoSets,NULL));
00230
00231 CLEANUP:
00232   *ppPropInfo = rgPropInfoSets ? rgPropInfoSets[0].rgPropertyInfos  : NULL;
00233   SAFE_FREE(rgPropInfoSets);
00234   SAFE_RELEASE(pIDBProperties);
00235   return hr;
00236 }
00237
00238
00239 /////////////////////////////////////////////////////////////////////////////
00240 // DBPROPFLAGS GetPropInfoFlags
00241 //
00242 /////////////////////////////////////////////////////////////////////////////
00243 DBPROPFLAGS GetPropInfoFlags(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet)
00244 {
00245   ASSERT(pIUnknown);
00246   DBPROPINFO* pPropInfo = NULL;
00247   DBPROPFLAGS dwFlags = DBPROPFLAGS_NOTSUPPORTED;
00248
00249   //GetPropInfo
00250   QTESTC(GetPropInfo(pIUnknown, PropertyID, guidPropertySet, &pPropInfo))
00251   if(pPropInfo)
00252     dwFlags = pPropInfo->dwFlags;
00253
00254 CLEANUP:
00255   SAFE_FREE(pPropInfo);
00256   return dwFlags;
00257 }
00258
00259
00260 /////////////////////////////////////////////////////////////////////////////
00261 // BOOL IsSupportedProperty
00262 //
00263 /////////////////////////////////////////////////////////////////////////////
00264 BOOL IsSupportedProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet)
00265 {
00266   return GetPropInfoFlags(pIUnknown, PropertyID, guidPropertySet) != DBPROPFLAGS_NOTSUPPORTED;
00267 }
00268
00269
00270 /////////////////////////////////////////////////////////////////////////////
00271 // BOOL IsSettableProperty
00272 //
00273 /////////////////////////////////////////////////////////////////////////////
00274 BOOL IsSettableProperty(IUnknown* pIUnknown, DBPROPID PropertyID, GUID guidPropertySet)
00275 {
00276   return GetPropInfoFlags(pIUnknown, PropertyID, guidPropertySet) & DBPROPFLAGS_WRITE;
00277 }
00278
00279
00280 /////////////////////////////////////////////////////////////////////////////
00281 // HRESULT SetProperty
00282 //
00283 /////////////////////////////////////////////////////////////////////////////
00284 HRESULT SetProperty(DBPROPID PropertyID, GUID guidPropertySet, ULONG* pcPropSets, DBPROPSET** prgPropSets, DBTYPE wType, ULONG ulValue, DBPROPOPTIONS dwOptions, DBID colid)
00285 {
00286   if(wType == DBTYPE_BOOL)
00287     ulValue = ulValue ? VARIANT_TRUE : VARIANT_FALSE;
00288   return SetProperty(PropertyID, guidPropertySet, pcPropSets, prgPropSets, wType, &ulValue, dwOptions, colid);
00289 }
00290
00291
00292 /////////////////////////////////////////////////////////////////////////////
00293 // HRESULT SetProperty
00294 //
00295 /////////////////////////////////////////////////////////////////////////////
00296 HRESULT SetProperty(DBPROPID PropertyID, GUID guidPropertySet, ULONG* pcPropSets, DBPROPSET** prgPropSets, DBTYPE wType, void* pv, DBPROPOPTIONS dwOptions, DBID colid)
00297 {
00298   ASSERT(PropertyID && prgPropSets && pcPropSets && pv);
00299   HRESULT hr = S_OK;
00300
00301   ULONG cProperties = 0;
00302   DBPROP* rgProperties = NULL;
00303
00304   //Make our lives a little easier
00305   ULONG cPropSets = *pcPropSets;
00306   DBPROPSET* rgPropSets = *prgPropSets;
00307
00308   ULONG iPropSet = ULONG_MAX;
00309
00310   //Find the correct PropSet structure to add the property to
00311   for(ULONG i=0; i<cPropSets; i++)
00312     if(guidPropertySet == rgPropSets[i].guidPropertySet)
00313       iPropSet = i;
00314
00315   //Do we need to create another PropSets structure for this property
00316   if(iPropSet==ULONG_MAX)
00317   {
00318     iPropSet = cPropSets;
00319     SAFE_REALLOC(rgPropSets, DBPROPSET, cPropSets+1);
00320     rgPropSets[iPropSet].cProperties = 0;
00321     rgPropSets[iPropSet].rgProperties = NULL;
00322     rgPropSets[iPropSet].guidPropertySet = guidPropertySet;
00323     cPropSets++;
00324   }
00325
00326   //Now make our lives really easy
00327   cProperties = rgPropSets[iPropSet].cProperties;
00328   rgProperties = rgPropSets[iPropSet].rgProperties;
00329
00330   //do we need to enlarge the list
00331   SAFE_REALLOC(rgProperties, DBPROP, cProperties+1);
00332
00333   //Add the new property to the list
00334   rgProperties[cProperties].dwPropertyID = PropertyID;
00335   rgProperties[cProperties].dwOptions    = dwOptions;
00336   rgProperties[cProperties].dwStatus     = DBPROPSTATUS_OK;
00337   rgProperties[cProperties].colid        = colid;
00338   VariantInit(&rgProperties[cProperties].vValue);
00339
00340   switch(wType)
00341   {
00342     case DBTYPE_BOOL:
00343       rgProperties[cProperties].vValue.vt          = VT_BOOL;
00344       V_BOOL(&(rgProperties[cProperties].vValue))  = *(VARIANT_BOOL*)pv;
00345       break;
00346
00347     case DBTYPE_I2:
00348       rgProperties[cProperties].vValue.vt     = VT_I2;
00349       V_I2(&(rgProperties[cProperties].vValue)) = *(SHORT*)pv;
00350       break;
00351
00352     case DBTYPE_I4:
00353       rgProperties[cProperties].vValue.vt     = VT_I4;
00354       V_I4(&(rgProperties[cProperties].vValue)) = *(LONG*)pv;
00355       break;
00356
00357     case DBTYPE_WSTR:
00358     case DBTYPE_BSTR:
00359       rgProperties[cProperties].vValue.vt          = VT_BSTR;
00360       V_BSTR(&(rgProperties[cProperties].vValue))  = SysAllocString((BSTR)pv);
00361       break;
00362
00363     case DBTYPE_VARIANT:
00364       VariantCopy(&rgProperties[cProperties].vValue, (VARIANT*)pv);
00365       break;
00366
00367     default:
00368       ASSERT(FALSE); //Unhandled property type
00369       break;
00370   }
00371
00372   //Increment the number of properties
00373   cProperties++;
00374
00375 CLEANUP:
00376   //Now go back to the rediculous property structures
00377   rgPropSets[iPropSet].cProperties  = cProperties;
00378   rgPropSets[iPropSet].rgProperties = rgProperties;
00379   *pcPropSets = cPropSets;
00380   *prgPropSets = rgPropSets;
00381   return hr;
00382 }
00383
00384
00385 /////////////////////////////////////////////////////////////////////////////
00386 // HRESULT SetRestriction
00387 //
00388 /////////////////////////////////////////////////////////////////////////////
00389 HRESULT SetRestriction(VARIANT* pRestriction, WCHAR* pwszValue)
00390 {
00391   ASSERT(pRestriction);
00392   ASSERT(pwszValue);
00393
00394   //VT_BSTR case
00395   if(pwszValue && pwszValue[0])
00396   {
00397     pRestriction->vt = VT_BSTR;
00398     SAFE_SYSALLOC(V_BSTR(pRestriction), pwszValue);
00399   }
00400
00401 CLEANUP:
00402   return S_OK;
00403 }
00404
00405
00406 /////////////////////////////////////////////////////////////////////////////
00407 // HRESULT InitVariants
00408 //
00409 /////////////////////////////////////////////////////////////////////////////
00410 HRESULT InitVariants(ULONG cVariants, VARIANT* rgVariants)
00411 {
00412   HRESULT hr = S_OK;
00413
00414   //Free all variants
00415   for(ULONG i=0; i<cVariants; i++)
00416     VariantInit(&rgVariants[i]);
00417
00418   return hr;
00419 }
00420
00421
00422 /////////////////////////////////////////////////////////////////////////////
00423 // HRESULT FreeVariants
00424 //
00425 /////////////////////////////////////////////////////////////////////////////
00426 HRESULT FreeVariants(ULONG cVariants, VARIANT* rgVariants)
00427 {
00428   HRESULT hr = S_OK;
00429
00430   //Free the inner variants first
00431   for(ULONG i=0; i<cVariants; i++)
00432     XTEST(hr = VariantClear(&rgVariants[i]));
00433
00434   return hr;
00435 }
00436
00437
00438 /////////////////////////////////////////////////////////////////////////////
00439 // HRESULT FreeProperties
00440 //
00441 /////////////////////////////////////////////////////////////////////////////
00442 HRESULT FreeProperties(ULONG cProperties, DBPROP* rgProperties)
00443 {
00444   HRESULT hr = S_OK;
00445
00446   //no-op case
00447   if(cProperties==0 || rgProperties==NULL)
00448     return S_OK;
00449
00450   //Free the inner variants first
00451   for(ULONG i=0; i<cProperties; i++)
00452   {
00453     //if DBPROPSTATUS_NOTSUPPORTED then vValue is undefined
00454     if(rgProperties[i].dwStatus != DBPROPSTATUS_NOTSUPPORTED)
00455       XTEST(hr = VariantClear(&rgProperties[i].vValue));
00456   }
00457
00458   //Now free the set
00459   SAFE_FREE(rgProperties);
00460   return hr;
00461 }
00462
00463 /////////////////////////////////////////////////////////////////////////////
00464 // HRESULT FreeProperties
00465 //
00466 /////////////////////////////////////////////////////////////////////////////
00467 HRESULT FreeProperties(ULONG cPropSets, DBPROPSET* rgPropSets)
00468 {
00469   HRESULT hr = S_OK;
00470
00471   //Loop over all the property sets
00472   for(ULONG i=0; i<cPropSets; i++)
00473     FreeProperties(rgPropSets[i].cProperties, rgPropSets[i].rgProperties);
00474
00475   //Now free the outer set
00476   SAFE_FREE(rgPropSets);
00477   return hr;
00478 }
00479
00480
00481
00482
00483
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/FileTerm/CallNot.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • FileTerm

CallNot.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////
00002 //
00003 //
00004 // Copyright (c) 1998-2001  Microsoft Corporation
00005 //
00006 //
00007 // TAPIEventNotification.h : Declaration of the CTAPIEventNotification object
00008 //
00009 ////////////////////////////////////////////////////////////////////////////
00010 #ifndef __TAPIEventNotification_H__
00011 #define __TAPIEventNotification_H__
00012
00013
00014 #define WM_PRIVATETAPIEVENT   WM_USER+101
00015 #define MAX_REC_TIME      60000
00016 #define TIMER_ID        1
00017
00018 #define PLAY_FILENAME     _T("Welcome.wav")
00019 #define REC_FILENAME      _T("Message")
00020 #define REC_FILEEXT       _T(".avi")
00021
00022 HRESULT
00023 OnTapiEvent(
00024         IN TAPI_EVENT TapiEvent,
00025         IN IDispatch * pEvent
00026         );
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CTAPIEventNotification
00030 class CTAPIEventNotification : public ITTAPIEventNotification
00031 {
00032 private:
00033
00034   LONG       m_dwRefCount;
00035
00036 public:
00037
00038   // CTAPIEventNotification implements ITTAPIEventNotification
00039   //  Declare ITTAPIEventNotification methods here
00040   HRESULT STDMETHODCALLTYPE Event(
00041                                     IN TAPI_EVENT TapiEvent,
00042                                     IN IDispatch * pEvent
00043                                    );
00044
00045 // other COM stuff:
00046 public:
00047
00048   // constructor
00049   CTAPIEventNotification() { m_dwRefCount = 1;}
00050
00051   // IUnknown implementation
00052   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
00053   {
00054     if (iid == IID_ITTAPIEventNotification)
00055     {
00056       AddRef();
00057       *ppvObject = (void *)this;
00058       return S_OK;
00059     }
00060
00061     if (iid == IID_IUnknown)
00062     {
00063       AddRef();
00064       *ppvObject = (void *)this;
00065       return S_OK;
00066     }
00067
00068     return E_NOINTERFACE;
00069   }
00070
00071   //
00072   // reference counting needs to be thread safe
00073   //
00074
00075   ULONG STDMETHODCALLTYPE AddRef()
00076   {
00077     ULONG l = InterlockedIncrement(&m_dwRefCount);
00078     return l;
00079   }
00080
00081   ULONG STDMETHODCALLTYPE Release()
00082   {
00083     ULONG l = InterlockedDecrement(&m_dwRefCount);
00084
00085     if ( 0 == l)
00086     {
00087       delete this;
00088     }
00089
00090     return l;
00091   }
00092
00093 };
00094
00095 //
00096 //helper functions
00097 //
00098 HRESULT
00099 CreateAndSelectFileRecordTerminal();
00100
00101 bool
00102 SameCall(
00103     IN ITCallStateEvent* pCallStateEvent
00104     );
00105
00106 HRESULT
00107 DoCallNotification(
00108     IN IDispatch * pEvent
00109     );
00110
00111 HRESULT
00112 DoCallState(
00113     IN IDispatch * pEvent
00114     );
00115
00116 HRESULT
00117 DoCallMedia(
00118     IN IDispatch * pEvent
00119     );
00120
00121 HRESULT
00122 DoFileEvent(
00123     IN IDispatch * pEvent
00124     );
00125
00126
00127 #endif //__TAPIEventNotification_H__
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/StdAfx.cpp Source File

  • Multimedia
  • wia
  • GetImage

StdAfx.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007
00008 #include "stdafx.h"
00009
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030         static TCHAR error[64];
00031
00032         switch (verb) {
00033     case MMC_VERB_NONE:
00034                 return _T("NONE");
00035     case MMC_VERB_OPEN:
00036                 return _T("OPEN");
00037     case MMC_VERB_COPY:
00038                 return _T("COPY");
00039     case MMC_VERB_PASTE:
00040                 return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042                 return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044                 return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046                 return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048                 return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050                 return _T("PRINT");
00051     case MMC_VERB_CUT:
00052                 return _T("CUT");
00053         default:
00054                 wsprintf(error, _T("Unknown verb id %d"), verb);
00055                 return error;
00056         }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061                                 IComponentData *pCompData,
00062                                 IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064                                 LPARAM arg,
00065                                 LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069         TCHAR message[cchMessage] = {0};
00070
00071         if (bComponentData == TRUE)
00072                 OutputDebugString(_T("IComponentData::Notify( "));
00073         else
00074                 OutputDebugString(_T("IComponent::Notify( "));
00075
00076         wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077         OutputDebugString(message);
00078
00079     switch (event)      {
00080                 case MMCN_ACTIVATE:
00081                         wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082                         break;
00083
00084                 case MMCN_ADD_IMAGES:
00085                         wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086                         break;
00087
00088                 case MMCN_BTN_CLICK:
00089                         wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090                         break;
00091
00092                 case MMCN_COLUMN_CLICK:
00093                         wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,       param);
00094                         break;
00095
00096                 case MMCN_COLUMNS_CHANGED:
00097                         wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098                         break;
00099
00100                 case MMCN_CONTEXTHELP:
00101                         wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102                         break;
00103
00104                 case MMCN_CONTEXTMENU:
00105                         wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106                         break;
00107
00108                 case MMCN_CUTORMOVE:
00109                         wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110                         break;
00111
00112                 case MMCN_DBLCLICK:
00113                         wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114                         break;
00115
00116                 case MMCN_DELETE:
00117                         wsprintf(message, _T("MMCN_DELETE\n"));
00118                         break;
00119
00120                 case MMCN_DESELECT_ALL:
00121                         wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122                         break;
00123
00124                 case MMCN_EXPAND:
00125                         wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126                         break;
00127
00128                 case MMCN_EXPANDSYNC:
00129                         wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130                         break;
00131
00132                 case MMCN_FILTERBTN_CLICK:
00133                         wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134                         break;
00135
00136                 case MMCN_FILTER_CHANGE:
00137                         wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138                         break;
00139
00140                 case MMCN_HELP:
00141                         wsprintf(message, _T("MMCN_HELP\n"));
00142                         break;
00143
00144                 case MMCN_INITOCX:
00145                         wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146                         break;
00147
00148                 case MMCN_LISTPAD:
00149                         wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150                         break;
00151
00152                 case MMCN_MENU_BTNCLICK:
00153                         wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154                         break;
00155
00156                 case MMCN_MINIMIZED:
00157                         wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158                         break;
00159
00160                 case MMCN_PASTE:
00161                         wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162                         break;
00163
00164                 case MMCN_PRELOAD:
00165                         wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166                         break;
00167
00168                 case MMCN_PRINT:
00169                         wsprintf(message, _T("MMCN_PRINT\n"));
00170                         break;
00171
00172                 case MMCN_PROPERTY_CHANGE:
00173                         wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174                         break;
00175
00176                 case MMCN_QUERY_PASTE:
00177                         wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178                         break;
00179
00180                 case MMCN_REFRESH:
00181                         wsprintf(message, _T("MMCN_REFRESH\n"));
00182                         break;
00183
00184                 case MMCN_REMOVE_CHILDREN:
00185                         wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186                         break;
00187
00188                 case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192                         StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193                         break;
00194
00195                 case MMCN_RESTORE_VIEW:
00196                         wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197                         break;
00198
00199                 case MMCN_SELECT:
00200                         wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201                         break;
00202
00203                 case MMCN_SHOW:
00204                         wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205                         break;
00206
00207                 case MMCN_SNAPINHELP:
00208                         wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209                         break;
00210
00211                 case MMCN_VIEW_CHANGE:
00212                         wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213                         break;
00214         }
00215
00216         if (message[0] != 0)
00217                 OutputDebugString(message);
00218         else
00219                 OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222         return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/CCall.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

CCall.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CCALL.CPP
00004 //  Content:    INmCall Routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018 COBLIST * g_pListCall   = NULL;
00019 COBLIST * g_pListCallNotify = NULL;
00020
00021
00022 //****************************************************************************
00023 //
00024 // INmCall * GetCurrentCall(void)
00025 //
00026 //****************************************************************************
00027
00028 INmCall * GetCurrentCall(void)
00029 {
00030   if (NULL == g_pListCall)
00031     return NULL;
00032
00033   return (INmCall *) g_pListCall->GetTail();
00034 }
00035
00036
00037 //****************************************************************************
00038 //
00039 // HRESULT HookCall(INmCall * pCall)
00040 //
00041 // Hook into notification callback for the call
00042 //
00043 //****************************************************************************
00044
00045 HRESULT HookCall(INmCall * pCall)
00046 {
00047   HRESULT     hr    = NO_ERROR;
00048   CCallNotify * pNotify = NULL;
00049
00050   ASSERT(NULL != pCall);
00051   if  (NULL == pCall)
00052   {
00053     return E_POINTER;
00054   }
00055
00056   pCall->AddRef();
00057   if  (NULL == AddNode(pCall, &g_pListCall))
00058   {
00059     pCall -> Release();
00060     return E_FAIL;
00061   }
00062
00063     // Connect to the conference object
00064     pNotify = new CCallNotify();
00065     if (pNotify == NULL)
00066     {
00067         hr = E_OUTOFMEMORY;
00068     }
00069     else
00070     {
00071     hr = pNotify->Connect(pCall);
00072     if (FAILED(hr))
00073     {
00074       ERROR_MSG(TEXT("CConfNotify Failed (%s)"), GetHrSz(hr));
00075       pNotify->Release();
00076     }
00077     else
00078     {
00079       OBJECT_MSG(TEXT("Call Connection point established successfully"));
00080       if  (NULL == AddNode(pNotify, &g_pListCallNotify))
00081       {
00082         ERROR_MSG(TEXT("AddNode Failed in Hook Call"));
00083         pNotify -> Disconnect();
00084         pNotify -> Release();
00085         return E_FAIL;
00086       }
00087     }
00088   }
00089
00090   return hr;
00091 }
00092
00093
00094 //****************************************************************************
00095 //
00096 // VOID FreeCalls(void)
00097 //
00098 //****************************************************************************
00099
00100 VOID FreeCalls(void)
00101 {
00102   // Release all notify
00103   if (NULL != g_pListCallNotify)
00104   {
00105     while (!g_pListCallNotify->IsEmpty())
00106     {
00107       CCallNotify * pNotify = (CCallNotify *) g_pListCallNotify->RemoveHead();
00108       ASSERT(NULL != pNotify);
00109       if  (NULL == pNotify)
00110         break;
00111
00112       OBJECT_MSG(TEXT("[%08X] call notify released"), pNotify);
00113       pNotify->Disconnect();
00114       pNotify->Release();
00115     }
00116   }
00117
00118   if (NULL != g_pListCall)
00119   {
00120     while (!g_pListCall->IsEmpty())
00121     {
00122       INmCall * pCall = (INmCall *) g_pListCall->RemoveHead();
00123       ASSERT(NULL != pCall);
00124       if  (NULL == pCall)
00125         break;
00126
00127       OBJECT_MSG(TEXT("[%08X] call released"), pCall);
00128       pCall->Release();
00129     }
00130   }
00131 }
00132
00133
00134 //****************************************************************************
00135 //
00136 // CLASS CCallNotify
00137 //
00138 //****************************************************************************
00139
00140 CCallNotify::CCallNotify() : RefCount(), CNotify()
00141 {
00142   OBJECT_MSG(TEXT("CCallNotify created"));
00143 }
00144
00145 CCallNotify::~CCallNotify()
00146 {
00147   OBJECT_MSG(TEXT("CCallNotify destroyed"));
00148 }
00149
00150
00151 //****************************************************************************
00152 //
00153 // Methods from IUnknown
00154 //
00155 //****************************************************************************
00156
00157 ULONG STDMETHODCALLTYPE CCallNotify::AddRef(void)
00158 {
00159   return RefCount::AddRef();
00160 }
00161
00162
00163 ULONG STDMETHODCALLTYPE CCallNotify::Release(void)
00164 {
00165   return RefCount::Release();
00166 }
00167
00168 HRESULT STDMETHODCALLTYPE CCallNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00169 {
00170   HRESULT hr = S_OK;
00171
00172   if  (NULL == ppvObject)
00173     return E_POINTER;
00174
00175   if (riid == IID_IUnknown)
00176   {
00177     *ppvObject = (IUnknown *)this;
00178     OBJECT_MSG(TEXT("CCallNotify::QueryInterface(): Returning IUnknown."));
00179   }
00180   else if (riid == IID_INmCallNotify)
00181   {
00182     *ppvObject = (INmCallNotify *)this;
00183     OBJECT_MSG(TEXT("CCallNotify::QueryInterface(): Returning INmCallNotify."));
00184   }
00185   else
00186   {
00187     hr = E_NOINTERFACE;
00188     *ppvObject = NULL;
00189     OBJECT_MSG(TEXT("CCallNotify::QueryInterface(): Called on unknown interface."));
00190   }
00191
00192   if SUCCEEDED(hr)
00193   {
00194     AddRef();
00195   }
00196
00197   return hr;
00198 }
00199
00200
00201
00202 //****************************************************************************
00203 //
00204 // Methods from ICNotify
00205 //
00206 //****************************************************************************
00207
00208 HRESULT STDMETHODCALLTYPE CCallNotify::Connect(IUnknown *pUnk)
00209 {
00210   return CNotify::Connect(pUnk, IID_INmCallNotify, (IUnknown *)this);
00211 }
00212
00213 HRESULT STDMETHODCALLTYPE CCallNotify::Disconnect(void)
00214 {
00215   return CNotify::Disconnect();
00216 }
00217
00218
00219 //****************************************************************************
00220 //
00221 // Methods from IConfNotify
00222 //
00223 //****************************************************************************
00224
00225
00226 //****************************************************************************
00227 //
00228 // HRESULT STDMETHODCALLTYPE CCallNotify::StateChanged(NM_CALL_STATE uState)
00229 //
00230 //****************************************************************************
00231
00232 HRESULT STDMETHODCALLTYPE CCallNotify::StateChanged(NM_CALL_STATE uState)
00233 {
00234   INmCall * pINmCall  = (INmCall *) CNotify::GetPunk();
00235
00236   STATE_MSG(TEXT("CCallNotify::StateChanged uState=%s"), GetCallStateSz(uState));
00237
00238   if  (NULL != pINmCall)
00239   {
00240     DumpCallInfo((INmCall *) CNotify::GetPunk());
00241     STATE_MSG(TEXT("Call direction is %d"), ((INmCall *)CNotify::GetPunk())->IsIncoming());
00242   }
00243   else
00244   {
00245     WARN_MSG(TEXT("CCallNotify::StateChanged when pINmCall == NULL"));
00246   }
00247
00248   return S_OK;
00249 }
00250
00251
00252 //****************************************************************************
00253 //
00254 // HRESULT STDMETHODCALLTYPE CCallNotify::Failed(ULONG uError)
00255 //
00256 //****************************************************************************
00257
00258 HRESULT STDMETHODCALLTYPE CCallNotify::Failed(ULONG uError)
00259 {
00260   LOG_MSG(RGB(255, 0, 0), TEXT("CCallNotify::Failed uError=%08X"), uError);
00261   return S_OK;
00262 }
00263
00264
00265 //****************************************************************************
00266 //
00267 // HRESULT STDMETHODCALLTYPE CCallNotify::Accepted(INmConference * pConference)
00268 //
00269 //****************************************************************************
00270
00271 HRESULT STDMETHODCALLTYPE CCallNotify::Accepted(INmConference * pConference)
00272 {
00273   NOTIFY_MSG(TEXT("CCallNotify::Accepted"));
00274   DumpConferenceInfo(pConference);
00275   return S_OK;
00276 }
00277
00278
00279 //****************************************************************************
00280 //
00281 // HRESULT STDMETHODCALLTYPE CCallNotify::NmUI(CONFN uNotify)
00282 //
00283 //****************************************************************************
00284
00285 HRESULT STDMETHODCALLTYPE CCallNotify::NmUI(CONFN uNotify)
00286 {
00287   LOG_MSG(RGB(255, 0, 255), TEXT("CCallNotify::NmUI uNotify=%s"), GetConfnSz(uNotify));
00288   return S_OK;
00289 }
00290
00291
00292 //****************************************************************************
00293 //
00294 // VOID DoCallConference(void)
00295 //
00296 //****************************************************************************
00297
00298 VOID DoCallConference(void)
00299 {
00300   HRESULT       hr      = E_FAIL  ;
00301   INmCall     * pCall     = NULL    ;
00302
00303   BSTRING       bstrAddr(gPref.pszAddr);
00304   BSTRING       bstrConference(gPref.pszConferenceName);
00305   BSTRING       bstrPassword(gPref.pszPassword);
00306
00307   if  ( ( (NULL == bstrAddr.GetLPBSTR())      && (NULL != gPref.pszAddr)    )
00308     ||  ( (NULL == bstrConference.GetLPBSTR())  && (NULL != gPref.pszConferenceName)  )
00309     ||  ( (NULL == bstrPassword.GetLPBSTR())    && (NULL != gPref.pszPassword)  )
00310     )
00311   {
00312     return;
00313   }
00314
00315   // Validate system
00316
00317   if (NULL == g_pMgr)
00318   {
00319     ERROR_MSG(TEXT("No conference manager object"));
00320     return;
00321   }
00322
00323   if (NULL != GetCurrentConference())
00324   {
00325     WARN_MSG(TEXT("can't join conferences!"));
00326   }
00327
00328   hr = g_pMgr->CallConference(&pCall, gPref.nmCallType, gPref.nmAddrType, bstrAddr, bstrConference, bstrPassword);
00329
00330   if (FAILED(hr))
00331   {
00332     ERROR_MSG(TEXT("CallConference failed HResult=%s"), GetHrSz(hr));
00333   }
00334   else
00335   {
00336     ASSERT(pCall == GetCurrentCall());
00337
00338     if  (NULL != pCall)
00339     {
00340       pCall->Release();
00341       TRACE_MSG(TEXT("CallConference succeeded"));
00342     }
00343     else
00344     {
00345       ERROR_MSG(TEXT("CallConference returned a null pointer"));
00346     }
00347   }
00348 }
00349
00350
00351 //****************************************************************************
00352 //
00353 // VOID DoCallCreate(void)
00354 //
00355 //****************************************************************************
00356
00357 VOID DoCallCreate(void)
00358 {
00359   HRESULT       hr      = E_FAIL  ;
00360   INmCall     * pCall     = NULL    ;
00361   INmConference * pConference = NULL    ;
00362
00363   BSTRING   bstrAddr(gPref.pszAddr);
00364   if  ((NULL == bstrAddr.GetLPBSTR()) && (NULL != gPref.pszAddr))
00365     return;
00366
00367   // Validate system
00368   if (NULL == g_pMgr)
00369   {
00370     ERROR_MSG(TEXT("No conference manager object"));
00371     return;
00372   }
00373
00374   pConference = GetCurrentConference();
00375   if (NULL == pConference)
00376   {
00377     TRACE_MSG(TEXT("using no conference"));
00378   }
00379
00380   hr = g_pMgr->CreateCall(&pCall, gPref.nmCallType, gPref.nmAddrType, bstrAddr, pConference);
00381   if (FAILED(hr))
00382   {
00383     ERROR_MSG(TEXT("CreateCall failed HResult=%s"), GetHrSz(hr));
00384   }
00385   else
00386   {
00387     ASSERT(pCall == GetCurrentCall());
00388
00389     if  (NULL != pCall)
00390     {
00391       pCall->Release();
00392       TRACE_MSG(TEXT("CreateCall succeeded"));
00393     }
00394     else
00395     {
00396       ERROR_MSG(TEXT("CreateCall returned a NULL pointer"));
00397     }
00398   }
00399 }
00400
00401
00402 //****************************************************************************
00403 //
00404 // VOID DoHandleCall(BOOL fAccept)
00405 //
00406 //****************************************************************************
00407
00408 VOID DoHandleCall(BOOL fAccept)
00409 {
00410   HRESULT   hr  = E_FAIL;
00411   INmCall * pCall = GetCurrentCall();
00412
00413   if (NULL == pCall)
00414   {
00415     TRACE_MSG(TEXT("No call to handle?"));
00416     return;
00417   }
00418
00419   if (fAccept)
00420   {
00421     hr = pCall->Accept();
00422   }
00423   else
00424   {
00425     hr = pCall->Reject();
00426   }
00427
00428   TRACE_MSG(TEXT("Call result = %s"), GetHrSz(hr));
00429 }
00430
00431
00432 //****************************************************************************
00433 //
00434 // VOID DoCancelCall(void)
00435 //
00436 //****************************************************************************
00437
00438 VOID DoCancelCall(void)
00439 {
00440   HRESULT   hr  = E_FAIL;
00441   INmCall * pCall = GetCurrentCall();
00442
00443   if (NULL == pCall)
00444   {
00445     TRACE_MSG(TEXT("No call to destroy?"));
00446     return;
00447   }
00448
00449   hr = pCall->Cancel();
00450   TRACE_MSG(TEXT("Call Cancel result = %s"), GetHrSz(hr));
00451
00452   // Free just the single call - watch the notify proc
00453   FreeCalls();
00454 }
00455
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/NewsEventClass/stdafx.Cpp Source File

  • Com
  • Services
  • Events
  • EventNews
  • NewsEventClass

stdafx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/Fakemenu/fakemenu.h Source File

  • WinUI
  • Shell
  • Fakemenu

fakemenu.h

Go to the documentation of this file.
00001 /*
00002  *  fakemenu.h
00003  */
00004
00005 #define STRICT
00006 #include <windows.h>
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/compdata.h Source File

  • SysMgmt
  • MMC
  • CMenu

compdata.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024 #include "StatNode.h"
00025 #include "Comp.h"
00026
00027 class CComponentData : public IComponentData,
00028 IExtendContextMenu,
00029 ISnapinHelp
00030 {
00031     friend class CComponent;
00032
00033 private:
00034     ULONG                               m_cref;
00035     LPCONSOLE                   m_ipConsole;
00036     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00037
00038     CStaticNode     *m_pStaticNode;
00039
00040     WCHAR            m_HelpFile[MAX_PATH];
00041
00042 public:
00043     CComponentData();
00044     ~CComponentData();
00045
00046     ///////////////////////////////
00047     // Interface IUnknown
00048     ///////////////////////////////
00049     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00050     STDMETHODIMP_(ULONG) AddRef();
00051     STDMETHODIMP_(ULONG) Release();
00052
00053     ///////////////////////////////
00054     // Interface IComponentData
00055     ///////////////////////////////
00056     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00057         /* [in] */ LPUNKNOWN pUnknown);
00058
00059         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00060         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00061
00062         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00063         /* [in] */ LPDATAOBJECT lpDataObject,
00064         /* [in] */ MMC_NOTIFY_TYPE event,
00065         /* [in] */ LPARAM arg,
00066         /* [in] */ LPARAM param);
00067
00068         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00069
00070     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00071         /* [in] */ MMC_COOKIE cookie,
00072         /* [in] */ DATA_OBJECT_TYPES type,
00073         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00074
00075         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00076         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00077
00078         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00079         /* [in] */ LPDATAOBJECT lpDataObjectA,
00080         /* [in] */ LPDATAOBJECT lpDataObjectB);
00081
00082         ///////////////////////////////
00083         // Interface ISnapinHelp
00084         ///////////////////////////////
00085         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetHelpTopic(
00086         /* [out] */ LPOLESTR __RPC_FAR *lpCompiledHelpFile);
00087
00088         ///////////////////////////////
00089         // Interface IExtendContextMenu
00090         ///////////////////////////////
00091         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddMenuItems(
00092         /* [in] */ LPDATAOBJECT piDataObject,
00093         /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
00094         /* [out][in] */ long __RPC_FAR *pInsertionAllowed);
00095
00096         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Command(
00097         /* [in] */ long lCommandID,
00098         /* [in] */ LPDATAOBJECT piDataObject);
00099 };
00100
00101 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/PrintSdi.Cpp Source File

  • NetDS
  • fax
  • PrintSdi

PrintSdi.Cpp

Go to the documentation of this file.
00001 // PrintSDI.cpp : Defines the class behaviors for the application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "PrintSDI.h"
00006
00007 #include "MainFrm.h"
00008 #include "PrintSDIDoc.h"
00009 #include "PrintSDIView.h"
00010
00011 #ifdef _DEBUG
00012 #define new DEBUG_NEW
00013 #undef THIS_FILE
00014 static char THIS_FILE[] = __FILE__;
00015 #endif
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CPrintSDIApp
00019
00020 BEGIN_MESSAGE_MAP(CPrintSDIApp, CWinApp)
00021   //{{AFX_MSG_MAP(CPrintSDIApp)
00022   ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00023     // NOTE - the ClassWizard will add and remove mapping macros here.
00024     //    DO NOT EDIT what you see in these blocks of generated code!
00025   //}}AFX_MSG_MAP
00026   // Standard file based document commands
00027   ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
00028   ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00029   // Standard print setup command
00030   ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
00031 END_MESSAGE_MAP()
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // CPrintSDIApp construction
00035
00036 CPrintSDIApp::CPrintSDIApp()
00037 {
00038   // TODO: add construction code here,
00039   // Place all significant initialization in InitInstance
00040 }
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // The one and only CPrintSDIApp object
00044
00045 CPrintSDIApp theApp;
00046
00047 /////////////////////////////////////////////////////////////////////////////
00048 // CPrintSDIApp initialization
00049
00050 BOOL CPrintSDIApp::InitInstance()
00051 {
00052   AfxEnableControlContainer();
00053
00054   // Standard initialization
00055   // If you are not using these features and wish to reduce the size
00056   //  of your final executable, you should remove from the following
00057   //  the specific initialization routines you do not need.
00058
00059 #ifdef _AFXDLL
00060   Enable3dControls();     // Call this when using MFC in a shared DLL
00061 #else
00062   Enable3dControlsStatic(); // Call this when linking to MFC statically
00063 #endif
00064
00065   // Change the registry key under which our settings are stored.
00066   // You should modify this string to be something appropriate
00067   // such as the name of your company or organization.
00068   SetRegistryKey(_T("Local AppWizard-Generated Applications"));
00069
00070   LoadStdProfileSettings();  // Load standard INI file options (including MRU)
00071
00072   // Register the application's document templates.  Document templates
00073   //  serve as the connection between documents, frame windows and views.
00074
00075   CSingleDocTemplate* pDocTemplate = NULL;
00076   pDocTemplate = new CSingleDocTemplate(
00077     IDR_MAINFRAME,
00078     RUNTIME_CLASS(CPrintSDIDoc),
00079     RUNTIME_CLASS(CMainFrame),       // main SDI frame window
00080     RUNTIME_CLASS(CPrintSDIView));
00081   if (pDocTemplate == NULL)
00082     return FALSE;
00083   AddDocTemplate(pDocTemplate);
00084
00085   // Enable DDE Execute open
00086   EnableShellOpen();
00087   RegisterShellFileTypes(TRUE);
00088
00089   // Parse command line for standard shell commands, DDE, file open
00090   CCommandLineInfo cmdInfo;
00091   ParseCommandLine(cmdInfo);
00092
00093   // Dispatch commands specified on the command line
00094   if (!ProcessShellCommand(cmdInfo))
00095     return FALSE;
00096
00097   // The one and only window has been initialized, so show and update it.
00098   m_pMainWnd->ShowWindow(SW_SHOW);
00099   m_pMainWnd->UpdateWindow();
00100
00101   // Enable drag/drop open
00102   //m_pMainWnd->DragAcceptFiles();
00103
00104   return TRUE;
00105 }
00106
00107 /////////////////////////////////////////////////////////////////////////////
00108 // CAboutDlg dialog used for App About
00109
00110 class CAboutDlg : public CDialog
00111 {
00112 public:
00113   CAboutDlg();
00114
00115 // Dialog Data
00116   //{{AFX_DATA(CAboutDlg)
00117   enum { IDD = IDD_ABOUTBOX };
00118   //}}AFX_DATA
00119
00120   // ClassWizard generated virtual function overrides
00121   //{{AFX_VIRTUAL(CAboutDlg)
00122   protected:
00123   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00124   //}}AFX_VIRTUAL
00125
00126 // Implementation
00127 protected:
00128   //{{AFX_MSG(CAboutDlg)
00129     // No message handlers
00130   //}}AFX_MSG
00131   DECLARE_MESSAGE_MAP()
00132 };
00133
00134 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00135 {
00136   //{{AFX_DATA_INIT(CAboutDlg)
00137   //}}AFX_DATA_INIT
00138 }
00139
00140 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00141 {
00142   CDialog::DoDataExchange(pDX);
00143   //{{AFX_DATA_MAP(CAboutDlg)
00144   //}}AFX_DATA_MAP
00145 }
00146
00147 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00148   //{{AFX_MSG_MAP(CAboutDlg)
00149     // No message handlers
00150   //}}AFX_MSG_MAP
00151 END_MESSAGE_MAP()
00152
00153 // App command to run the dialog
00154 void CPrintSDIApp::OnAppAbout()
00155 {
00156   CAboutDlg aboutDlg;
00157   aboutDlg.DoModal();
00158 }
00159
00160 /////////////////////////////////////////////////////////////////////////////
00161 // CPrintSDIApp commands
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpAsyncSample/browser.cpp Source File

  • Web
  • winhttp
  • WinHttpAsyncSample

browser.cpp

Go to the documentation of this file.
00001 //  WinHttpAsyncSample
00002 //  Copyright (c) Microsoft Corporation. All rights reserved. #include <windows.h>
00003
00004 #include <windows.h>
00005 #include <winhttp.h>
00006 #include "defs.h"
00007 #include "browser.h"
00008
00009 #include <stdio.h>
00010
00011 //
00012 // SIMPLE_BROWSER class implementation
00013 //
00014
00015 SIMPLE_BROWSER::SIMPLE_BROWSER(UINT nID)
00016 {
00017     m_nID = nID + 1;
00018     m_hSession = NULL;
00019
00020     m_hShutdownEvent = NULL;
00021     m_fShutdownInProgress = FALSE;
00022
00023     m_pBrowserConfig = NULL;
00024     m_pHomePageRequester = NULL;
00025
00026     m_nRequesterIDSeed = m_nID * 10; // for example, if the browser is 1, then the
00027                                      // embedded links are numbered 10, 11, 12, and etc.
00028 }
00029
00030 SIMPLE_BROWSER::~SIMPLE_BROWSER()
00031 {
00032 }
00033
00034 BOOL SIMPLE_BROWSER::Open(P_BROWSER_CONFIG pBrowserConfig)
00035 {
00036     ASSERT(pBrowserConfig != NULL);
00037
00038     m_pBrowserConfig = pBrowserConfig;
00039
00040     InitializeListHead(&m_EmbeddedLinks);
00041
00042     ::InitializeCriticalSection(&m_LinksCritSec);
00043
00044     PWSTR pwszEmbeddedLinks = NULL;
00045
00046     fprintf(stdout,
00047             "Browser #%d is initializing...\n",
00048             m_nID);
00049
00050     m_hShutdownEvent = ::CreateEvent(NULL,
00051                                      TRUE,  // manual reset
00052                                      FALSE, // not initially set
00053                                      NULL);
00054
00055     if (m_hShutdownEvent == NULL)
00056     {
00057         fprintf(stderr,
00058                "Browser #%d failed to open; CreateEvent() failed; error = %d.\n",
00059                 m_nID,
00060                 ::GetLastError());
00061
00062         goto error_cleanup;
00063     }
00064
00065     DWORD dwAccessType = pBrowserConfig->fProxyAutoDiscovery ?
00066                          WINHTTP_ACCESS_TYPE_NO_PROXY :
00067                          WINHTTP_ACCESS_TYPE_DEFAULT_PROXY;
00068
00069     m_hSession = ::WinHttpOpen(L"Microsoft-Windows-HTTP-Services-Async-Sample/1.0",
00070                                dwAccessType,
00071                                WINHTTP_NO_PROXY_NAME,
00072                                WINHTTP_NO_PROXY_BYPASS,
00073                                WINHTTP_FLAG_ASYNC);
00074     if (m_hSession == NULL)
00075     {
00076         fprintf(stderr,
00077                "Browser #%d failed to open; WinHttpOpen() failed; error = %d.\n",
00078                 m_nID,
00079                 ::GetLastError());
00080
00081         goto error_cleanup;
00082     }
00083
00084     m_pHomePageRequester = new ASYNC_REQUESTER(m_nRequesterIDSeed++, this);
00085     if (m_pHomePageRequester == NULL)
00086     {
00087         fprintf(stderr,
00088                "Browser #%d failed to open; not enough memory.\n",
00089                 m_nID);
00090
00091         goto error_cleanup;
00092     }
00093
00094     if (m_pHomePageRequester->Open(pBrowserConfig->pwszHomePage,
00095                                  pBrowserConfig->fProxyAutoDiscovery,
00096                                  pBrowserConfig->fEnableProxyFailover,
00097                                  pBrowserConfig->nFailureRetries,
00098                                  pBrowserConfig->nTimeLimit) == FALSE)
00099     {
00100         fprintf(stderr,
00101                "Browser #%d failed to open; can not initialize a requester.\n",
00102                 m_nID);
00103
00104         goto error_cleanup;
00105     }
00106
00107     pwszEmbeddedLinks = new WCHAR[::wcslen(m_pBrowserConfig->pwszEmbeddedLinks) + 1];
00108     if (pwszEmbeddedLinks == NULL)
00109     {
00110         fprintf(stderr,
00111                "Browser #%d failed to open; not enough memory.\n",
00112                 m_nID);
00113
00114         goto error_cleanup;
00115     }
00116
00117     ::wcscpy(pwszEmbeddedLinks, m_pBrowserConfig->pwszEmbeddedLinks);
00118
00119     PWSTR pwszLink = ::wcstok(pwszEmbeddedLinks, L";");
00120     while (pwszLink != NULL)
00121     {
00122         fprintf(stdout,
00123                 "Browser #%d is initializing link %S...\n",
00124                 m_nID,
00125                 pwszLink);
00126
00127         ASYNC_REQUESTER* pNewRequester = new ASYNC_REQUESTER(m_nRequesterIDSeed++, this);
00128         if (pNewRequester == NULL)
00129         {
00130             fprintf(stderr,
00131                     "Browser #%d failed to create a new request; not enough memory.\n",
00132                     m_nID);
00133
00134             goto next_link;
00135         }
00136
00137         if (pNewRequester->Open(pwszLink,
00138                                 m_pBrowserConfig->fProxyAutoDiscovery,
00139                                 m_pBrowserConfig->fEnableProxyFailover,
00140                                 m_pBrowserConfig->nFailureRetries,
00141                                 m_pBrowserConfig->nTimeLimit) == FALSE)
00142         {
00143             fprintf(stderr,
00144                 "Browser #%d failed to initialize a new requester.\n",
00145                     m_nID);
00146
00147             goto next_link;
00148         }
00149
00150         InsertHeadList(&m_EmbeddedLinks, (PLIST_ENTRY)pNewRequester);
00151         pNewRequester = NULL;
00152
00153     next_link:
00154
00155         if (pNewRequester)
00156         {
00157             if (m_pHomePageRequester->m_State == ASYNC_REQUESTER::OPENED)
00158             {
00159                 m_pHomePageRequester->Close();
00160             }
00161
00162             delete pNewRequester;
00163         }
00164
00165         pwszLink = ::wcstok(NULL, L";");
00166     }
00167
00168     delete [] pwszEmbeddedLinks;
00169     pwszEmbeddedLinks = NULL;
00170
00171     if (m_pHomePageRequester->Start() == FALSE)
00172     {
00173         fprintf(stderr,
00174                "Browser #%d failed to open; can not start a requester.\n",
00175                 m_nID);
00176
00177         goto error_cleanup;
00178     }
00179
00180     return TRUE;
00181
00182 error_cleanup:
00183
00184     if (m_pHomePageRequester)
00185     {
00186         if (m_pHomePageRequester->m_State == ASYNC_REQUESTER::OPENED)
00187         {
00188             m_pHomePageRequester->Close();
00189         }
00190         delete m_pHomePageRequester;
00191         m_pHomePageRequester = NULL;
00192     }
00193     if (m_hSession)
00194     {
00195         ::WinHttpCloseHandle(m_hSession);
00196         m_hSession = NULL;
00197     }
00198     if (m_hShutdownEvent)
00199     {
00200         ::CloseHandle(m_hShutdownEvent);
00201         m_hShutdownEvent = NULL;
00202     }
00203     if (pwszEmbeddedLinks)
00204     {
00205         delete [] pwszEmbeddedLinks;
00206     }
00207     ::DeleteCriticalSection(&m_LinksCritSec);
00208
00209     return FALSE;
00210 }
00211
00212 VOID SIMPLE_BROWSER::Close(VOID)
00213 {
00214     m_fShutdownInProgress = TRUE;
00215
00216     BOOL fNeedToWait = FALSE;
00217
00218     ::EnterCriticalSection(&m_LinksCritSec);
00219
00220     if (m_pHomePageRequester)
00221     {
00222         if (m_pHomePageRequester->m_State != ASYNC_REQUESTER::CLOSED)
00223         {
00224             m_pHomePageRequester->RequestToShutdown();
00225             fNeedToWait = TRUE;
00226         }
00227     }
00228
00229     for (PLIST_ENTRY entry = (&m_EmbeddedLinks)->Flink;
00230             entry != (PLIST_ENTRY)&((&m_EmbeddedLinks)->Flink);
00231             entry = entry->Flink)
00232     {
00233         ASYNC_REQUESTER* pRequester = (ASYNC_REQUESTER*)entry;
00234
00235         if (pRequester->m_State != ASYNC_REQUESTER::CLOSED)
00236         {
00237             pRequester->RequestToShutdown();
00238             fNeedToWait = TRUE;
00239         }
00240     }
00241
00242     ::LeaveCriticalSection(&m_LinksCritSec);
00243
00244     if (fNeedToWait)
00245     {
00246         fprintf(stdout,
00247                "Browser #%d waiting for all requesters to exit...\n",
00248                 m_nID);
00249
00250         if (::WaitForSingleObject(m_hShutdownEvent, /*60000*/INFINITE) == WAIT_TIMEOUT)
00251         {
00252             fprintf(stderr,
00253                 "...and Browser #%d timed out waiting all requesters to exit... exit anyway...\n",
00254                     m_nID);
00255         }
00256         else
00257         {
00258             fprintf(stdout,
00259                 "...and Browser #%d is notified that all requesters are exited...\n",
00260                     m_nID);
00261         }
00262
00263     }
00264
00265     while (!IsListEmpty(&m_EmbeddedLinks))
00266     {
00267         PLIST_ENTRY pEntry = RemoveHeadList(&m_EmbeddedLinks);
00268         ASYNC_REQUESTER* pRequester = (ASYNC_REQUESTER*)pEntry;
00269
00270         delete pRequester;
00271     }
00272
00273     if (m_hSession)
00274     {
00275         ::WinHttpCloseHandle(m_hSession);
00276         m_hSession = NULL;
00277     }
00278     if (m_hShutdownEvent)
00279     {
00280         ::CloseHandle(m_hShutdownEvent);
00281         m_hShutdownEvent = NULL;
00282     }
00283     ::DeleteCriticalSection(&m_LinksCritSec);
00284 }
00285
00286
00287 VOID SIMPLE_BROWSER::OnRequesterStopped(ASYNC_REQUESTER* pRequester)
00288 {
00289     ASSERT(pRequester != NULL);
00290
00291     //if (m_fShutdownInProgress  &&
00292     //    pRequester->m_State != ASYNC_REQUESTER::CLOSING)
00293     //{
00294     //    return;
00295     //}
00296
00297     ::EnterCriticalSection(&m_LinksCritSec);
00298
00299     if (pRequester == m_pHomePageRequester)
00300     {
00301         if (pRequester->m_State == ASYNC_REQUESTER::DATA_EXHAUSTED)
00302         {
00303             fprintf(stdout,
00304                     "Browser #%d fetched its Home Page, now it attempts to download all embedded lnks.\n",
00305                     m_nID);
00306
00307             for (PLIST_ENTRY entry = (&m_EmbeddedLinks)->Flink;
00308                     entry != (PLIST_ENTRY)&((&m_EmbeddedLinks)->Flink);
00309                     entry = entry->Flink)
00310             {
00311                 ASYNC_REQUESTER* pRequesterNew = (ASYNC_REQUESTER*)entry;
00312                 if (pRequesterNew->Start() == FALSE)
00313                 {
00314                     fprintf(stderr,
00315                         "Browser #%d failed to start a new requester.\n",
00316                             m_nID);
00317                 }
00318             }
00319
00320             // now we can close the home page request
00321             pRequester->Close();
00322
00323             goto exit;
00324         }
00325     }
00326
00327     BOOL fClosingRequest = TRUE;
00328
00329     if (pRequester->m_State == ASYNC_REQUESTER::CLOSING)
00330     {
00331         pRequester->Close();    // a live download has been aborted, now close it.
00332     }
00333     else if (pRequester->m_State == ASYNC_REQUESTER::ERROR)
00334     {
00335         if (m_pBrowserConfig->nFailureRetries)
00336         {
00337             switch(pRequester->m_dwLastError)
00338             {
00339                 case ERROR_WINHTTP_CANNOT_CONNECT:
00340                 case ERROR_WINHTTP_TIMEOUT:
00341                 case ERROR_NOT_ENOUGH_MEMORY:
00342                 case ERROR_WINHTTP_INTERNAL_ERROR:
00343                 case ERROR_WINHTTP_NAME_NOT_RESOLVED:
00344
00345                     if (pRequester->Start() == FALSE)
00346                     {
00347                         pRequester->Close(); // retry upon certain errors
00348                     }
00349                     else
00350                     {
00351                         fClosingRequest = FALSE;
00352                     }
00353                     break;
00354
00355                 default:
00356                     pRequester->Close();
00357             }
00358         }
00359         else  // close the request since we don't need to retry
00360         {
00361             pRequester->Close();
00362         }
00363     }
00364     else // close the request if some other state is hit
00365     {
00366         pRequester->Close();
00367     }
00368
00369     // the main page is interrupted, so we'll need to close all embedded links
00370     if (pRequester == m_pHomePageRequester && fClosingRequest)
00371     {
00372         for (PLIST_ENTRY entry = (&m_EmbeddedLinks)->Flink;
00373                 entry != (PLIST_ENTRY)&((&m_EmbeddedLinks)->Flink);
00374                 entry = entry->Flink)
00375         {
00376             ASYNC_REQUESTER* pRequesterToC = (ASYNC_REQUESTER*)entry;
00377             pRequesterToC->Close();
00378         }
00379     }
00380
00381 exit:
00382     ::LeaveCriticalSection(&m_LinksCritSec);
00383 }
00384
00385 VOID SIMPLE_BROWSER::OnRequesterClosed(ASYNC_REQUESTER* pRequester)
00386 {
00387     ::EnterCriticalSection(&m_LinksCritSec);
00388
00389     if (m_fShutdownInProgress)
00390     {
00391         BOOL fAllClosed = TRUE;
00392         if (m_pHomePageRequester && m_pHomePageRequester->m_State != ASYNC_REQUESTER::CLOSED)
00393         {
00394             fAllClosed = FALSE;
00395         }
00396
00397         for (PLIST_ENTRY entry = (&m_EmbeddedLinks)->Flink;
00398                 entry != (PLIST_ENTRY)&((&m_EmbeddedLinks)->Flink);
00399                 entry = entry->Flink)
00400         {
00401             ASYNC_REQUESTER* pRequesterNew = (ASYNC_REQUESTER*)entry;
00402             if (pRequesterNew->m_State != ASYNC_REQUESTER::CLOSED)
00403             {
00404                 fAllClosed = FALSE;
00405             }
00406         }
00407
00408         if (fAllClosed)
00409         {
00410             ::SetEvent(m_hShutdownEvent);
00411         }
00412     }
00413
00414     ::LeaveCriticalSection(&m_LinksCritSec);
00415 }
00416
00417 //
00418 // ASYNC_REQUESTER class implementation
00419 //
00420
00421 ASYNC_REQUESTER::ASYNC_REQUESTER(
00422     UINT nRequesterID,
00423     SIMPLE_BROWSER* pBrowser)
00424 {
00425     m_hConnect = NULL;
00426     m_hRequest = NULL;
00427
00428     m_pwszUrl = NULL;
00429
00430     m_nID = nRequesterID;
00431     m_pBrowser = pBrowser;
00432
00433     m_fProxyAutoDiscovery = FALSE;
00434     m_fProxyFailover = FALSE;
00435     m_nFailureRetries = 0;
00436
00437     ZeroMemory(&m_ProxyInfo, sizeof(m_ProxyInfo));
00438
00439     m_pwszNextProxies = NULL;
00440
00441     m_State = INIT;
00442
00443     m_fClosing = FALSE;
00444
00445     m_dwLastError = ERROR_SUCCESS;
00446
00447     m_ContentLength = -1;
00448     m_dwBytesReadSoFar = 0;
00449 }
00450
00451 ASYNC_REQUESTER::~ASYNC_REQUESTER()
00452 {
00453     if (m_ProxyInfo.lpszProxy)
00454     {
00455         ::GlobalFree(m_ProxyInfo.lpszProxy);
00456     }
00457     if (m_ProxyInfo.lpszProxyBypass)
00458     {
00459         ::GlobalFree(m_ProxyInfo.lpszProxyBypass);
00460     }
00461     if (m_pwszUrl)
00462     {
00463         delete [] m_pwszUrl;
00464     }
00465 }
00466
00467 void CALLBACK RequesterStatusCallback (
00468     HINTERNET hInternet,
00469     DWORD_PTR dwContext,
00470     DWORD dwInternetStatus,
00471     LPVOID lpvStatusInformation,
00472     DWORD dwStatusInformationLength
00473     )
00474 {
00475     ASYNC_REQUESTER* pRequester = (ASYNC_REQUESTER*)dwContext;
00476     ASSERT(pRequester != NULL);
00477
00478     ASSERT(pRequester->m_hRequest == hInternet);
00479
00480     switch(dwInternetStatus)
00481     {
00482         case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE:
00483             pRequester->OnSendRequestComplete();
00484             break;
00485         case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE:
00486             pRequester->OnHeadersAvailable();
00487             break;
00488         case WINHTTP_CALLBACK_STATUS_READ_COMPLETE:
00489             pRequester->OnReadComplete(dwStatusInformationLength);
00490             break;
00491         case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR:
00492             pRequester->OnRequestError((LPWINHTTP_ASYNC_RESULT)lpvStatusInformation);
00493             break;
00494         case WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING:
00495             pRequester->OnHandleClosing(hInternet);
00496             pRequester->m_hRequest = NULL;
00497             break;
00498         default:
00499             ;
00500     }
00501 }
00502
00503 BOOL ASYNC_REQUESTER::Open(
00504     PWSTR pwszUrl,
00505     BOOL fProxyAutoDiscovery,
00506     BOOL fProxyFailover,
00507     UINT nFailureRetries,
00508     UINT dwTimeLimit
00509     )
00510 {
00511     m_fProxyFailover = fProxyFailover;
00512
00513     ASSERT(pwszUrl != NULL);
00514     m_pwszUrl = new WCHAR[::wcslen(pwszUrl) + 1];
00515     if (m_pwszUrl == NULL)
00516     {
00517         fprintf(stderr,
00518                 "Requester #%d failed to open; not enough memory.\n",
00519                 m_nID);
00520
00521         goto error_exit;
00522     }
00523     ::wcscpy(m_pwszUrl, pwszUrl);
00524
00525     m_nNumAttempts = nFailureRetries + 1;
00526
00527     m_dwStartingTime = ::GetTickCount();
00528     m_TimeRemaining = m_dwTimeLimit = dwTimeLimit * 1000;
00529
00530     BOOL fProxyDiscovered = FALSE;
00531
00532     if (fProxyAutoDiscovery)
00533     {
00534         fprintf(stdout,
00535                 "Requester #%d is detecting proxy settings for %S...\n",
00536                 m_nID,
00537                 m_pwszUrl);
00538
00539         WINHTTP_AUTOPROXY_OPTIONS AutoProxyOptions;
00540         ZeroMemory(&AutoProxyOptions, sizeof(AutoProxyOptions));
00541
00542         AutoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
00543         AutoProxyOptions.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A;
00544         AutoProxyOptions.lpszAutoConfigUrl = NULL;
00545         AutoProxyOptions.fAutoLogonIfChallenged = TRUE;
00546
00547         if (::WinHttpGetProxyForUrl(m_pBrowser->m_hSession,
00548                                     m_pwszUrl,
00549                                     &AutoProxyOptions,
00550                                     &m_ProxyInfo) == FALSE)
00551         {
00552             fprintf(stderr,
00553                    "Requester #%d failed to discover proxy info; ::WinHttpGetProxyForUrl() failed; error = %d.\n",
00554                     m_nID,
00555                     ::GetLastError());
00556
00557             WINHTTP_PROXY_INFO pi;
00558             pi.dwAccessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY;
00559             pi.lpszProxy = NULL;
00560             pi.lpszProxyBypass = NULL;
00561
00562             if (::WinHttpSetOption(m_hRequest,
00563                                 WINHTTP_OPTION_PROXY,
00564                                 &pi,
00565                                 sizeof(pi)) == FALSE)
00566             {
00567                 fprintf(stderr,
00568                     "Requester #%d failed to open; ::WinHttpSetOption() failed; error = %d.\n",
00569                         m_nID,
00570                         ::GetLastError());
00571
00572                 goto error_exit;
00573             }
00574         }
00575         else
00576         {
00577             fProxyDiscovered = TRUE;
00578
00579             fprintf(stdout,
00580                     "Requester #%d detected the proxy settings for %S is %S.\n",
00581                     m_nID,
00582                     m_pwszUrl,
00583                     m_ProxyInfo.lpszProxy
00584                     );
00585         }
00586     }
00587
00588     if (!fProxyDiscovered)
00589     {
00590         DWORD dwProxyInfoSize = sizeof(m_ProxyInfo);
00591         ::WinHttpQueryOption(NULL, // query for global proxy config
00592                              WINHTTP_OPTION_PROXY,
00593                              &m_ProxyInfo,
00594                              &dwProxyInfoSize);
00595
00596     }
00597
00598     if (fProxyFailover && m_ProxyInfo.lpszProxy)
00599     {
00600         m_pwszNextProxies = ::wcschr(m_ProxyInfo.lpszProxy, L';');
00601         if (m_pwszNextProxies)
00602         {
00603             ++m_pwszNextProxies;
00604         }
00605     }
00606
00607     URL_COMPONENTS UrlComponents;
00608     ZeroMemory(&UrlComponents, sizeof(UrlComponents));
00609     UrlComponents.dwStructSize = sizeof(UrlComponents);
00610
00611     UrlComponents.dwSchemeLength    = (DWORD)-1;
00612     UrlComponents.dwHostNameLength  = (DWORD)-1;
00613     UrlComponents.dwUrlPathLength   = (DWORD)-1;
00614
00615     if (::WinHttpCrackUrl(m_pwszUrl,
00616                       (DWORD)::wcslen(m_pwszUrl),
00617                       0,
00618                       &UrlComponents) == NULL)
00619     {
00620         fprintf(stderr,
00621                "Requester #%d failed to open; ::WinHttpCrackUrl() failed; error = %d.\n",
00622                 m_nID,
00623                 ::GetLastError());
00624
00625         goto error_exit;
00626     }
00627
00628     WCHAR wCharSave = UrlComponents.lpszHostName[UrlComponents.dwHostNameLength];
00629     UrlComponents.lpszHostName[UrlComponents.dwHostNameLength] = L'\0';
00630
00631     m_hConnect = ::WinHttpConnect(m_pBrowser->m_hSession,
00632                                   UrlComponents.lpszHostName,
00633                                   UrlComponents.nPort,
00634                                   0);
00635
00636     UrlComponents.lpszHostName[UrlComponents.dwHostNameLength] = wCharSave;
00637
00638     if (m_hConnect == NULL)
00639     {
00640         fprintf(stderr,
00641                "Requester #%d failed to open; ::WinHttpConnect() failed; error = %d.\n",
00642                 m_nID,
00643                 ::GetLastError());
00644
00645         goto error_exit;
00646     }
00647
00648     m_hRequest = ::WinHttpOpenRequest(m_hConnect,
00649                                       L"GET",
00650                                       UrlComponents.lpszUrlPath,
00651                                       L"HTTP/1.1",
00652                                       WINHTTP_NO_REFERER,
00653                                       WINHTTP_DEFAULT_ACCEPT_TYPES,
00654                                       (UrlComponents.nScheme == INTERNET_SCHEME_HTTPS) ? WINHTTP_FLAG_SECURE : 0);
00655
00656     if (m_hRequest == NULL)
00657     {
00658         fprintf(stderr,
00659                "Requester #%d failed to open; ::WinHttpOpenRequest() failed; error = %d.\n",
00660                 m_nID,
00661                 ::GetLastError());
00662
00663         goto error_exit;
00664     }
00665
00666     if (::WinHttpSetOption(m_hRequest,
00667                            WINHTTP_OPTION_PROXY,
00668                            &m_ProxyInfo,
00669                            sizeof(m_ProxyInfo)) == FALSE)
00670     {
00671         fprintf(stderr,
00672                "Requester #%d failed to open; ::WinHttpSetOption() failed; error = %d.\n",
00673                 m_nID,
00674                 ::GetLastError());
00675
00676         goto error_exit;
00677     }
00678
00679     // in some cases we need to abort the transaction beforing sending (i.e. calling WinHttpSendRequest()), to make sure we
00680     // can point back to this object in thoses cases we need to set the context here.
00681
00682     void* _this = this;
00683     if (::WinHttpSetOption(m_hRequest,
00684                            WINHTTP_OPTION_CONTEXT_VALUE,
00685                            &_this,
00686                            sizeof(this)) == FALSE)
00687     {
00688         fprintf(stderr,
00689                "Requester #%d failed to open; ::WinHttpSetOption() failed; error = %d.\n",
00690                 m_nID,
00691                 ::GetLastError());
00692
00693         goto error_exit;
00694     }
00695
00696     ::WinHttpSetStatusCallback(m_hRequest,
00697                                RequesterStatusCallback,
00698                                WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS |
00699                                WINHTTP_CALLBACK_FLAG_HANDLES,   // to listen to the HANDLE_CLOSING event
00700                                0);
00701
00702     m_State = OPENED;
00703
00704     return TRUE;
00705
00706 error_exit:
00707
00708     if (m_hRequest)
00709     {
00710         ::WinHttpCloseHandle(m_hRequest);
00711         // m_hRequest will be set to NULL during the HANDLE_CLOSING callback
00712     }
00713     if (m_hConnect)
00714     {
00715         ::WinHttpCloseHandle(m_hConnect);
00716         m_hConnect = NULL;
00717     }
00718     return FALSE;
00719 }
00720
00721 BOOL ASYNC_REQUESTER::Start(
00722     )
00723 {
00724     DWORD dwThreadId = ::GetCurrentThreadId();
00725
00726     // make sure we are in the right state to kick start a transaction
00727     if (m_State != OPENED &&
00728         m_State != ERROR  &&
00729         m_State != DATA_EXHAUSTED)
00730     {
00731         return FALSE;
00732     }
00733
00734     if (m_nNumAttempts-- <= 0)
00735     {
00736         m_State = ERROR;
00737         m_dwLastError = (DWORD)-1; // retry limit is up
00738         return FALSE;
00739     }
00740
00741     // initialize or re-initialize states
00742
00743     m_ContentLength = -1;
00744     m_dwBytesReadSoFar = 0;
00745
00746     m_State = SENDING;
00747
00748     if (::WinHttpSendRequest(m_hRequest,
00749                              WINHTTP_NO_ADDITIONAL_HEADERS,
00750                              0,
00751                              WINHTTP_NO_REQUEST_DATA,
00752                              0,
00753                              0,
00754                              (DWORD_PTR)this)== FALSE)
00755     {
00756         m_dwLastError = ::GetLastError();
00757
00758         fprintf(stderr,
00759                 "[%d] The Requester #%d failed to fetch %S, WinHttpSendRequest() failed; error = %d.\n",
00760                 dwThreadId,
00761                 m_nID,
00762                 m_pwszUrl,
00763                 m_dwLastError);
00764
00765         m_State = ERROR;
00766         return FALSE;
00767     }
00768
00769     return TRUE;
00770 }
00771
00772 VOID ASYNC_REQUESTER::OnSendRequestComplete(
00773     )
00774 {
00775     DWORD dwThreadId = ::GetCurrentThreadId();
00776
00777     if (m_fClosing)
00778     {
00779         fprintf(stdout,
00780                "[%d] The Requester #%d stops downloading from %S; it's signaled to shut down.\n",
00781                 dwThreadId,
00782                 m_nID,
00783                 m_pwszUrl);
00784
00785         m_State = CLOSING;
00786         goto exit;
00787     }
00788
00789     m_TimeRemaining = m_dwTimeLimit - (::GetTickCount() - m_dwStartingTime);
00790     if (m_TimeRemaining <= 0)
00791     {
00792         fprintf(stderr,
00793                 "[%d] The Requester #%d timed out fetching %S; elapsed time = %d.\n",
00794                 dwThreadId,
00795                 m_nID,
00796                 m_pwszUrl,
00797                 m_dwTimeLimit);
00798
00799         m_TimeRemaining = 0;
00800
00801         m_State = ERROR;
00802         goto exit;
00803     }
00804
00805     m_State = RECEIVING;
00806
00807     if (::WinHttpReceiveResponse(m_hRequest, NULL) == FALSE)
00808     {
00809         m_dwLastError = ::GetLastError();
00810
00811         fprintf(stderr,
00812                 "[%d] The Requester #%d failed to fetch %S, WinHttpReceiveResponse() failed; error = %d.\n",
00813                 dwThreadId,
00814                 m_nID,
00815                 m_pwszUrl,
00816                 m_dwLastError);
00817
00818         m_State = ERROR;
00819         goto exit;
00820     }
00821
00822     return;
00823
00824 exit:
00825
00826     m_pBrowser->OnRequesterStopped(this);
00827 }
00828
00829 VOID ASYNC_REQUESTER::OnHeadersAvailable(
00830         )
00831 {
00832     DWORD dwThreadId = ::GetCurrentThreadId();
00833
00834     if (m_fClosing)
00835     {
00836         fprintf(stdout,
00837                "[%d] The Requester #%d stops downloading from %S; it's signaled to shut down.\n",
00838                 dwThreadId,
00839                 m_nID,
00840                 m_pwszUrl);
00841
00842         m_State = CLOSING;
00843         goto exit;
00844     }
00845
00846     m_TimeRemaining = m_dwTimeLimit - (::GetTickCount() - m_dwStartingTime);
00847     if (m_TimeRemaining <= 0)
00848     {
00849         fprintf(stderr,
00850                 "[%d] The Requester #%d timed out fetching %S; elapsed time = %d.\n",
00851                 dwThreadId,
00852                 m_nID,
00853                 m_pwszUrl,
00854                 m_dwTimeLimit);
00855
00856         m_TimeRemaining = 0;
00857
00858         m_State = ERROR;
00859         goto exit;
00860     }
00861
00862     m_State = HEADERS_AVAILABLE;
00863
00864     DWORD dwStatusCode = 0;
00865     DWORD dwSize = sizeof(DWORD);
00866
00867     if (::WinHttpQueryHeaders(m_hRequest,
00868                              WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER,
00869                              NULL,
00870                              &dwStatusCode,
00871                              &dwSize,
00872                              NULL) == FALSE)
00873     {
00874         m_dwLastError = ::GetLastError();
00875
00876         fprintf(stderr,
00877                 "[%d] The Requester #%d failed to fetch %S, WinHttpQueryHeaders() failed; error = %d.\n",
00878                 dwThreadId,
00879                 m_nID,
00880                 m_pwszUrl,
00881                 m_dwLastError);
00882
00883         m_State = ERROR;
00884         goto exit;
00885     }
00886
00887     if ((dwStatusCode == HTTP_STATUS_DENIED) || (dwStatusCode == HTTP_STATUS_PROXY_AUTH_REQ))
00888     {
00889         fprintf(stderr,
00890                 "[%d] The Requester #%d failed to fetch %S, the proxy or server requires authentication; Status Code = %d.\n",
00891                 dwThreadId,
00892                 m_nID,
00893                 m_pwszUrl,
00894                 dwStatusCode);
00895
00896         // NOTE: This sample does not show how authentication should be handled; please refer to the
00897         // authentication sample in this SDK to see how credentials should be supplied in respond
00898         // to auth requests.
00899
00900         m_dwLastError = dwStatusCode;
00901
00902         m_State = ERROR;
00903         goto exit;
00904     }
00905
00906     if (dwStatusCode != HTTP_STATUS_OK)
00907     {
00908         fprintf(stderr,
00909                 "[%d] The Requester #%d failed to fetch %S; Status Code = %d.\n",
00910                 dwThreadId,
00911                 m_nID,
00912                 m_pwszUrl,
00913                 dwStatusCode);
00914
00915         m_dwLastError = dwStatusCode;
00916
00917         m_State = ERROR;
00918         goto exit;
00919     }
00920
00921     DWORD dwContentLength = 0;
00922     DWORD dwCLSize = sizeof(DWORD);
00923
00924     if (::WinHttpQueryHeaders(m_hRequest,
00925                              WINHTTP_QUERY_CONTENT_LENGTH | WINHTTP_QUERY_FLAG_NUMBER,
00926                              NULL,
00927                              &dwContentLength,
00928                              &dwCLSize,
00929                              NULL) == FALSE)
00930     {
00931         m_dwLastError = ::GetLastError();
00932
00933         fprintf(stderr,
00934                 "[%d] The Requester #%d failed to fetch %S, WinHttpQueryHeaders() failed; error = %d.\n",
00935                 dwThreadId,
00936                 m_nID,
00937                 m_pwszUrl,
00938                 m_dwLastError);
00939
00940     }
00941     else
00942     {
00943         fprintf(stdout,
00944             "[%d] The Requester #%d attemps to download %d bytes of data from %S.\n",
00945             dwThreadId,
00946             m_nID,
00947             dwContentLength,
00948             m_pwszUrl);
00949
00950         m_ContentLength = dwContentLength;
00951     }
00952
00953     m_State = WAITING_FOR_DATA;
00954
00955     if (::WinHttpReadData(m_hRequest,
00956                           m_ReadBuffer,
00957                           READ_BUFFER_SIZE,
00958                           NULL) == FALSE)
00959     {
00960         m_dwLastError = ::GetLastError();
00961         fprintf(stderr,
00962                 "[%d] The Requester #%d failed to read data from %S, WinHttpReadData() failed; error = %d.\n",
00963                 dwThreadId,
00964                 m_nID,
00965                 m_pwszUrl,
00966                 m_dwLastError);
00967
00968         m_State = ERROR;
00969         goto exit;
00970     }
00971
00972     return;
00973
00974 exit:
00975
00976     m_pBrowser->OnRequesterStopped(this);
00977 }
00978
00979 VOID ASYNC_REQUESTER::OnReadComplete(
00980     DWORD dwBytesRead
00981     )
00982 {
00983    DWORD dwThreadId = ::GetCurrentThreadId();
00984
00985     if (m_fClosing)
00986     {
00987         fprintf(stdout,
00988                "[%d] The Requester #%d stops downloading from %S; it's signaled to shut down.\n",
00989                 dwThreadId,
00990                 m_nID,
00991                 m_pwszUrl);
00992
00993         m_State = CLOSING;
00994         goto exit;
00995     }
00996
00997     m_TimeRemaining = m_dwTimeLimit - (::GetTickCount() - m_dwStartingTime);
00998     if (m_TimeRemaining <= 0)
00999     {
01000         fprintf(stderr,
01001                 "[%d] The Requester #%d timed out fetching %S; elapsed time = %d.\n",
01002                 dwThreadId,
01003                 m_nID,
01004                 m_pwszUrl,
01005                 m_dwTimeLimit);
01006
01007         m_TimeRemaining = 0;
01008
01009         m_State = ERROR;
01010         goto exit;
01011     }
01012
01013     if (dwBytesRead == 0)
01014     {
01015         m_State = DATA_EXHAUSTED;
01016
01017         fprintf(stdout,
01018             "[%d] Requester #%d has downloaded all data from from %S.\n",
01019             dwThreadId,
01020             m_nID,
01021             m_pwszUrl);
01022
01023         goto exit;
01024     }
01025     else
01026     {
01027         m_State = DATA_AVAILABLE;
01028
01029         m_dwBytesReadSoFar += dwBytesRead;
01030
01031         fprintf(stdout,
01032                 "[%d] Requester #%d has downloaded %d bytes from from %S",
01033                 dwThreadId,
01034                 m_nID,
01035                 m_dwBytesReadSoFar,
01036                 m_pwszUrl);
01037
01038         if (m_ContentLength == -1)
01039         {
01040             fprintf(stdout, ".\n");  // total size unknown
01041         }
01042         else
01043         {
01044             fprintf(stdout, " (%.2f%% Complete).\n", ((float)m_dwBytesReadSoFar/m_ContentLength) * 100);
01045         }
01046
01047     }
01048
01049     m_State = WAITING_FOR_DATA;
01050
01051     if (::WinHttpReadData(m_hRequest,
01052                           m_ReadBuffer,
01053                           READ_BUFFER_SIZE,
01054                           NULL) == FALSE)
01055     {
01056         m_dwLastError = ::GetLastError();
01057
01058         fprintf(stderr,
01059                 "[%d] The Requester #%d failed to read data from %S, WinHttpReadData() failed; error = %d.\n",
01060                 dwThreadId,
01061                 m_nID,
01062                 m_pwszUrl,
01063                 m_dwLastError);
01064
01065         m_State = ERROR;
01066         goto exit;
01067     }
01068
01069     return;
01070
01071 exit:
01072
01073     m_pBrowser->OnRequesterStopped(this);
01074 }
01075
01076 VOID ASYNC_REQUESTER::OnRequestError(
01077     LPWINHTTP_ASYNC_RESULT pAsyncResult
01078 )
01079 {
01080     DWORD dwThreadId = ::GetCurrentThreadId();
01081
01082     if (m_fClosing)
01083     {
01084         fprintf(stdout,
01085                "[%d] The Requester #%d stops downloading from %S; it's signaled to shut down.\n",
01086                 dwThreadId,
01087                 m_nID,
01088                 m_pwszUrl);
01089
01090         m_State = CLOSING;
01091         goto exit;
01092     }
01093
01094     m_TimeRemaining = m_dwTimeLimit - (::GetTickCount() - m_dwStartingTime);
01095     if (m_TimeRemaining <= 0)
01096     {
01097         fprintf(stderr,
01098                 "[%d] The Requester #%d timed out fetching %S; elapsed time = %d.\n",
01099                 dwThreadId,
01100                 m_nID,
01101                 m_pwszUrl,
01102                 m_dwTimeLimit);
01103
01104         m_TimeRemaining = 0;
01105
01106         m_State = ERROR;
01107         goto exit;
01108     }
01109
01110     m_State = ERROR;
01111
01112     m_dwErrorAPI = (DWORD)pAsyncResult->dwResult;
01113     m_dwLastError = pAsyncResult->dwError;
01114
01115     if (m_dwErrorAPI == API_SEND_REQUEST)
01116     {
01117         if (m_dwLastError == ERROR_WINHTTP_CANNOT_CONNECT || m_dwLastError == ERROR_WINHTTP_NAME_NOT_RESOLVED)
01118         {
01119             fprintf(stderr,
01120                     "[%d] The Requester #%d failed to fetch %S, WinHttpSendRequest() c/b failed; error = %d.\n",
01121                     dwThreadId,
01122                     m_nID,
01123                     m_pwszUrl,
01124                     m_dwLastError);
01125
01126             // *** proxy failover logic ***
01127
01128             // WinHttp 5.1 has a limitation that it only uses the first proxy in a WINHTTP_PROXY_INFO structure
01129             // to attempt connect. Here we try to work around that by feeding the rest of the proxies and force
01130             // winHttp to retry.
01131
01132             if (m_fProxyFailover && m_pwszNextProxies && m_pwszNextProxies[0])
01133             {
01134                 WINHTTP_PROXY_INFO NextProxiesInfo;
01135                 NextProxiesInfo.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY;
01136                 NextProxiesInfo.lpszProxy = m_pwszNextProxies;
01137                 NextProxiesInfo.lpszProxyBypass = m_ProxyInfo.lpszProxyBypass;
01138
01139                 m_pwszNextProxies = ::wcschr(m_pwszNextProxies, L';');
01140                 if (m_pwszNextProxies)
01141                 {
01142                     ++m_pwszNextProxies;
01143                 }
01144
01145                 if (::WinHttpSetOption(m_hRequest,
01146                                        WINHTTP_OPTION_PROXY,
01147                                        &NextProxiesInfo,
01148                                        sizeof(NextProxiesInfo)) == TRUE)
01149                 {
01150                     fprintf(stdout,
01151                             "[%d] The Requester #%d retries sending using a new proxy list %S.\n",
01152                             dwThreadId,
01153                             m_nID,
01154                             NextProxiesInfo.lpszProxy);
01155                 }
01156             }
01157         }
01158     }
01159     else if (m_dwErrorAPI == API_RECEIVE_RESPONSE)
01160     {
01161         if (m_dwLastError == ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED)
01162         {
01163             fprintf(stderr,
01164                     "[%d] The Requester #%d failed to fetch %S, WinHttpReceiveResponse() c/b failed; the server requires SSL client auth.\n",
01165                     dwThreadId,
01166                     m_nID,
01167                     m_pwszUrl);
01168
01169             // NOTE: This sample does not show how SSL client authentication should be handled; please refer to the
01170             // SSL client authentication sample in this SDK to see how a client certificate should be supplied in respond
01171             // to SSL client auth requests.
01172         }
01173         else
01174         {
01175             fprintf(stderr,
01176                     "[%d] The Requester #%d failed to fetch %S, WinHttpReceiveResponse() c/b failed; error = %d.\n",
01177                     dwThreadId,
01178                     m_nID,
01179                     m_pwszUrl,
01180                     m_dwLastError);
01181         }
01182     }
01183     else if (m_dwErrorAPI == API_READ_DATA)
01184     {
01185         fprintf(stderr,
01186                 "[%d] The Requester #%d failed to read data from %S, WinHttpReadData() c/b failed; error = %d\n",
01187                 dwThreadId,
01188                 m_nID,
01189                 m_pwszUrl,
01190                 m_dwLastError);
01191     }
01192
01193
01194 exit:
01195
01196     m_pBrowser->OnRequesterStopped(this);
01197 }
01198
01199
01200 VOID ASYNC_REQUESTER::RequestToShutdown()
01201 {
01202     DWORD dwThreadId = ::GetCurrentThreadId();
01203
01204     fprintf(stdout,
01205             "[%d] Requester #%d has been signaled to shutdown.\n",
01206             dwThreadId,
01207             m_nID);
01208
01209     m_fClosing = TRUE;
01210
01211     // this will cause an on-going request to transit to CLOSING state. The browser
01212     // will then be notified the CLOSING event, and it can then safely call
01213     // ASYNC_REQUESTER::Close().
01214
01215     // if a requester has been stopped, it can be safely closed w/o calling RequestToShutdown() first.
01216 }
01217
01218 VOID ASYNC_REQUESTER::OnHandleClosing(HINTERNET hRequest)
01219 {
01220     DWORD dwThreadId = ::GetCurrentThreadId();
01221
01222     ASSERT(hRequest == m_hRequest);
01223
01224     if (m_State == CLOSING)
01225     {
01226         m_State = CLOSED;
01227
01228         ASSERT(m_pBrowser != NULL);
01229
01230         fprintf(stdout,
01231                 "[%d] Requester #%d shuts down.\n",
01232                 dwThreadId,
01233                 m_nID);
01234
01235         m_pBrowser->OnRequesterClosed(this);
01236     }
01237 }
01238
01239 VOID ASYNC_REQUESTER::Close(VOID)
01240 {
01241     DWORD dwThreadId = ::GetCurrentThreadId();
01242
01243     if (m_State == ERROR ||
01244         m_State == DATA_EXHAUSTED ||
01245         m_State == CLOSING ||
01246         m_State == OPENED)
01247     {
01248         m_State = CLOSING;
01249
01250         fprintf(stdout,
01251                 "[%d] Requester #%d is shutting down.\n",
01252                 dwThreadId,
01253                 m_nID);
01254
01255         if (m_hRequest)
01256         {
01257             ::WinHttpCloseHandle(m_hRequest);
01258             // m_hRequest will be set to NULL during the HANDLE_CLOSING callback
01259         }
01260         if (m_hConnect)
01261         {
01262             ::WinHttpCloseHandle(m_hConnect);
01263             m_hConnect = NULL;
01264         }
01265         return;
01266     }
01267
01268     ASSERT(0);
01269 }
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAsyncFullServ Member List

This is the complete list of members for CAsyncFullServ, including all inherited members.
Begin_Sum(int i, int j) | CAsyncFullServ |
CAsyncFullServ() | CAsyncFullServ | [inline]
doSum() | CAsyncFullServ |
Finish_Sum(int *sum) | CAsyncFullServ |
Init(IFullServ *pIFullServ) | CAsyncFullServ | [inline]
m_callInProgress | CAsyncFullServ | [private]
m_hr | CAsyncFullServ | [private]
m_i | CAsyncFullServ | [private]
m_j | CAsyncFullServ | [private]
m_pAggISync | CAsyncFullServ |
m_pIFullServ | CAsyncFullServ | [private]
m_sum | CAsyncFullServ | [private]
Generated on Wed Nov 13 2024 16:55:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/adevent/adevent.h Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • adevent

adevent.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2002 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ADEvent.h
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 #ifndef ADEVENT_H
00019 #define ADEVENT_H
00020
00021 /**************************************************************************
00022    #include statements
00023 **************************************************************************/
00024
00025 #include <windows.h>
00026 #include <iads.h>
00027 #include <dsadmin.h>
00028
00029 /**************************************************************************
00030
00031    CClassFactory class definition
00032
00033 **************************************************************************/
00034
00035 class CClassFactory : public IClassFactory
00036 {
00037 protected:
00038     DWORD m_ObjRefCount;
00039
00040 public:
00041     CClassFactory();
00042     ~CClassFactory();
00043
00044     //IUnknown methods
00045     STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
00046     STDMETHODIMP_(DWORD) AddRef();
00047     STDMETHODIMP_(DWORD) Release();
00048
00049     //IClassFactory methods
00050     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *);
00051     STDMETHODIMP LockServer(BOOL);
00052 };
00053
00054 /**************************************************************************
00055
00056    CAdminNotifyHandler class definition
00057
00058 **************************************************************************/
00059
00060 class CAdminNotifyHandler : public IDsAdminNotifyHandler
00061 {
00062 protected:
00063     DWORD       m_ObjRefCount;
00064     IDataObject *m_pdoFrom;
00065     IDataObject *m_pdoTo;
00066
00067 public:
00068     CAdminNotifyHandler();
00069     ~CAdminNotifyHandler();
00070
00071     //IUnknown methods
00072     STDMETHOD(QueryInterface)(REFIID, LPVOID FAR *);
00073     STDMETHOD_(DWORD, AddRef)();
00074     STDMETHOD_(DWORD, Release)();
00075
00076     //IDsAdminNotifyHandler methods
00077     STDMETHOD(Initialize)(IDataObject* pExtraInfo, ULONG* puEventFlags);
00078     STDMETHOD(Begin)(ULONG uEvent, IDataObject* pArg1, IDataObject* pArg2, ULONG* puFlags, BSTR* pBstr);
00079     STDMETHOD(Notify)(ULONG nItem, ULONG uFlags);
00080     STDMETHOD(End)(void);
00081
00082
00083 private:
00084 };
00085
00086 #endif   //ADEVENT_H
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/cData.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

cData.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CDATA.CPP
00004 //  Content:    INmChannelData Routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 INmChannelData  * g_pChannelData  = NULL;
00018 CDataNotify   * g_pNotifyData   = NULL;
00019
00020 //****************************************************************************
00021 //
00022 // HRESULT HookData(INmChannel * pChannel)
00023 //
00024 //****************************************************************************
00025
00026 HRESULT HookData(INmChannel * pChannel)
00027 {
00028   ASSERT(NULL != pChannel);
00029   if  (NULL == pChannel)
00030   {
00031     ERROR_MSG(TEXT("NULL == pChannel"));
00032     return E_POINTER;
00033   }
00034
00035   HRESULT     hr    = NO_ERROR  ;
00036   CDataNotify * pNotify = NULL    ;
00037
00038   if (NULL != g_pChannelData)
00039   {
00040     ERROR_MSG(TEXT("HookData: replacing existing g_pChannelData"));
00041
00042     g_pChannelData->Release();
00043     g_pChannelData = NULL;
00044   }
00045
00046   if  (NULL != g_pNotifyData)
00047   {
00048     g_pNotifyData -> Disconnect();
00049     g_pNotifyData -> Release();
00050     g_pNotifyData =  NULL;
00051   }
00052
00053   hr = pChannel->QueryInterface(IID_INmChannelData, (void **)&g_pChannelData);
00054   if FAILED(hr)
00055   {
00056     ERROR_MSG(TEXT("HookData:Unable to get Data Channel"));
00057     return hr;
00058   }
00059
00060   if  (NULL == g_pChannelData)
00061   {
00062     ERROR_MSG(TEXT("HookData:QI returned a NULL pointer"));
00063     return E_POINTER;
00064   }
00065
00066   // keep QI ref around
00067
00068     // Connect to the channel object
00069
00070     pNotify = new CDataNotify();
00071     if (pNotify == NULL)
00072     {
00073         hr = E_OUTOFMEMORY;
00074     }
00075     else
00076     {
00077     hr = pNotify->Connect(g_pChannelData);
00078     if (FAILED(hr))
00079     {
00080       ERROR_MSG(TEXT("CConfNotify Failed (%s)"), GetHrSz(hr));
00081       pNotify->Release();
00082     }
00083     else
00084     {
00085       OBJECT_MSG(TEXT("Data Connection point established successfully"));
00086       g_pNotifyData = pNotify;
00087     }
00088   }
00089
00090   if (FAILED(hr))
00091   {
00092     g_pChannelData->Release();
00093     g_pChannelData = NULL;
00094   }
00095
00096   return hr;
00097 }
00098
00099
00100 //****************************************************************************
00101 //
00102 // VOID FreeDataChannel(void)
00103 //
00104 //****************************************************************************
00105
00106 VOID FreeDataChannel(void)
00107 {
00108   // Release all notify
00109   if  (NULL != g_pNotifyData)
00110   {
00111     OBJECT_MSG(TEXT("[%08X] data notify released"), g_pNotifyData);
00112     g_pNotifyData->Disconnect();
00113     g_pNotifyData->Release();
00114     g_pNotifyData = NULL;
00115   }
00116
00117   if  (NULL != g_pChannelData)
00118   {
00119     OBJECT_MSG(TEXT("[%08X] data channel released"), g_pChannelData);
00120     g_pChannelData->Release();
00121     g_pChannelData = NULL;
00122   }
00123 }
00124
00125
00126 //****************************************************************************
00127 //
00128 // CLASS CDataNotify
00129 //
00130 //****************************************************************************
00131
00132 CDataNotify::CDataNotify() : RefCount(), CNotify()
00133 {
00134   OBJECT_MSG(TEXT("CDataNotify created"));
00135 }
00136
00137 CDataNotify::~CDataNotify()
00138 {
00139   OBJECT_MSG(TEXT("CDataNotify destroyed"));
00140 }
00141
00142
00143 //****************************************************************************
00144 //
00145 // Methods from IUnknown
00146 //
00147 //****************************************************************************
00148
00149 ULONG STDMETHODCALLTYPE CDataNotify::AddRef(void)
00150 {
00151   return RefCount::AddRef();
00152 }
00153
00154
00155 ULONG STDMETHODCALLTYPE CDataNotify::Release(void)
00156 {
00157   return RefCount::Release();
00158 }
00159
00160 HRESULT STDMETHODCALLTYPE CDataNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00161 {
00162   if  (NULL == ppvObject)
00163     return E_POINTER;
00164
00165   HRESULT hr  = NO_ERROR;
00166
00167   if (riid == IID_IUnknown)
00168   {
00169     *ppvObject = (IUnknown *)this;
00170     OBJECT_MSG(TEXT("CDataNotify::QueryInterface(): Returning IUnknown."));
00171   }
00172   else if (riid == IID_INmChannelDataNotify)
00173   {
00174     *ppvObject = (INmChannelDataNotify *)this;
00175     OBJECT_MSG(TEXT("CDataNotify::QueryInterface(): Returning INmChannelDataNotify."));
00176   }
00177   else
00178   {
00179     hr = E_NOINTERFACE;
00180     *ppvObject = NULL;
00181     OBJECT_MSG(TEXT("CDataNotify::QueryInterface(): Called on unknown interface."));
00182   }
00183
00184   if  SUCCEEDED(hr)
00185   {
00186     AddRef();
00187   }
00188
00189   return hr;
00190 }
00191
00192
00193 //****************************************************************************
00194 //
00195 // Methods from ICNotify
00196 //
00197 //****************************************************************************
00198
00199 HRESULT STDMETHODCALLTYPE CDataNotify::Connect(IUnknown *pUnk)
00200 {
00201   return CNotify::Connect(pUnk, IID_INmChannelDataNotify, (IUnknown *)this);
00202 }
00203
00204 HRESULT STDMETHODCALLTYPE CDataNotify::Disconnect(void)
00205 {
00206   return CNotify::Disconnect();
00207 }
00208
00209
00210 //****************************************************************************
00211 //
00212 // HRESULT STDMETHODCALLTYPE CDataNotify::NmUI(CONFN uNotify)
00213 //
00214 //****************************************************************************
00215
00216 HRESULT STDMETHODCALLTYPE CDataNotify::NmUI(CONFN uNotify)
00217 {
00218   NOTIFY_MSG(TEXT("CDataNotify::NmUI uNotify=%08X, pChannel=%08X"), uNotify, CNotify::GetPunk());
00219   return S_OK;
00220 }
00221
00222
00223 //****************************************************************************
00224 //
00225 // HRESULT STDMETHODCALLTYPE CDataNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00226 //
00227 //****************************************************************************
00228
00229 HRESULT STDMETHODCALLTYPE CDataNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00230 {
00231   NOTIFY_MSG(TEXT("CDataNotify::MemberChanged uNotify=%d pMember=%08X, pChannel=%08X"), uNotify, pMember, CNotify::GetPunk());
00232
00233   PUSER pUser = PUserFromINmMember(pMember);
00234   if (NULL != pUser)
00235   {
00236     UpdateUserChannel(pUser, (INmChannel *) (CNotify::GetPunk()), uNotify);
00237   }
00238
00239   return S_OK;
00240 }
00241
00242
00243 //****************************************************************************
00244 //
00245 // Methods from IConfNotify
00246 //
00247 //****************************************************************************
00248
00249
00250 //****************************************************************************
00251 //
00252 // HRESULT STDMETHODCALLTYPE CDataNotify::DataSent(INmMember *pMember, ULONG uSize, LPBYTE pb)
00253 //
00254 //****************************************************************************
00255
00256 HRESULT STDMETHODCALLTYPE CDataNotify::DataSent(INmMember *pMember, ULONG uSize, LPBYTE pb)
00257 {
00258   LPTSTR  psz   = NULL;
00259   NOTIFY_MSG(TEXT("CDataNotify::DataSent uSize=%08X"), uSize);
00260
00261 #ifdef NMUI_CHAT_PROTOCOL
00262   ASSERT(uSize > CB_NMUI_HDR);
00263   if  (uSize <= CB_NMUI_HDR)
00264   {
00265     ERROR_MSG(TEXT("DataSent: [uSize <= CB_NMUI_HDR]"));
00266     return E_FAIL;
00267   }
00268
00269   psz = (LPTSTR) (pb + *(LPDWORD) pb);  // skip past header
00270 #else
00271   psz = (LPTSTR) pb;
00272 #endif /* NMUI_CHAT_PROTOCOL */
00273
00274   DisplayChatMsg(pMember, psz, MSG_SENT);
00275   return S_OK;
00276 }
00277
00278
00279 //****************************************************************************
00280 //
00281 // HRESULT STDMETHODCALLTYPE CDataNotify::DataReceived(INmMember *pMember, ULONG uSize, LPBYTE pb, ULONG dwFlags)
00282 //
00283 //****************************************************************************
00284
00285 HRESULT STDMETHODCALLTYPE CDataNotify::DataReceived(INmMember *pMember, ULONG uSize, LPBYTE pb, ULONG dwFlags)
00286 {
00287   LPTSTR psz  = NULL;
00288   NOTIFY_MSG(TEXT("CDataNotify::DataReceived uSize=%08X"), uSize);
00289
00290 #ifdef NMUI_CHAT_PROTOCOL
00291   ASSERT(uSize > CB_NMUI_HDR);
00292   if  (uSize <= CB_NMUI_HDR)
00293   {
00294     ERROR_MSG(TEXT("DataReceived : [uSize <= CB_NMUI_HDR]"));
00295     return E_FAIL;
00296   }
00297   psz = (LPTSTR) (pb + *(LPDWORD) pb);  // skip past header
00298 #else
00299   psz = (LPTSTR) pb;
00300 #endif /* NMUI_CHAT_PROTOCOL */
00301
00302   if (dwFlags & NM_DF_SEGMENT_BEGIN)
00303   {
00304     DisplayChatMsg(pMember, psz, MSG_RECEIVED, dwFlags);
00305   }
00306   else
00307   {
00308     WARN_MSG(TEXT("Partial data received"));
00309   }
00310
00311   return S_OK;
00312 }
00313
00314
00315 //****************************************************************************
00316 //
00317 // VOID DisplayChatMsg(INmMember * pMember, PTCHAR pszMsg, int msgType, DWORD dwFlags)
00318 //
00319 //****************************************************************************
00320
00321 VOID DisplayChatMsg(INmMember * pMember, PTCHAR pszMsg, int msgType, DWORD dwFlags)
00322 {
00323   COLORREF cv = RGB(0, 0, 0);
00324
00325   TCHAR sz[MAX_PATH + 1];
00326   ZeroMemory(sz, (MAX_PATH + 1) * sizeof(TCHAR));
00327
00328   PUSER pUser = PUserFromINmMember(pMember);
00329
00330   switch (msgType)
00331     {
00332   case MSG_SENT:
00333   {
00334     cv = RGB(127, 0, 127);
00335     if (NULL == pUser)
00336     {
00337       lstrcpyn(sz, TEXT("Msg to Everyone\0"), MAX_PATH+1);
00338       sz[MAX_PATH] = 0;
00339     }
00340     else
00341     {
00342       _sntprintf(sz, MAX_PATH, TEXT("Whisper to %s"), pUser -> pszName);
00343     }
00344     break;
00345   }
00346   case MSG_RECEIVED:
00347   {
00348     cv = RGB(255, 0, 255);
00349     if (NULL == pUser)
00350     {
00351       lstrcpyn(sz, TEXT("Message from ????\0"), MAX_PATH+1);
00352       sz[MAX_PATH] = 0;
00353     }
00354     else if (dwFlags & NM_DF_PRIVATE)
00355     {
00356       _sntprintf(sz, MAX_PATH, TEXT("Whisper from %s\0"), pUser -> pszName);
00357     }
00358     else if (dwFlags & NM_DF_BROADCAST)
00359     {
00360       _sntprintf(sz, MAX_PATH, TEXT("Message from %s\0"), pUser -> pszName);
00361     }
00362     break;
00363   }
00364   default:
00365     cv = RGB(0, 0, 0);
00366     break;
00367     }
00368
00369   Log(RGB(0, 0, 0), sz);
00370
00371 #ifdef NMUI_CHAT_PROTOCOL
00372 #ifndef UNICODE
00373   // Convert UNICODE to ANSI
00374   WideCharToMultiByte(CP_ACP, 0, (LPWSTR) pszMsg, -1, sz, MAX_PATH, NULL, NULL);
00375   pszMsg = sz;
00376 #endif /* UNICODE */
00377 #endif /* NMUI_CHAT_PROTOCOL */
00378
00379   Log(cv, pszMsg);
00380 }
00381
00382
00383 //****************************************************************************
00384 //
00385 // VOID DoSendChatMsg(LPTSTR psz, INmMember * pMember)
00386 //
00387 //****************************************************************************
00388
00389 VOID DoSendChatMsg(LPTSTR psz, INmMember * pMember)
00390 {
00391   HRESULT hr  = NO_ERROR;
00392   UINT  cb  = lstrlen(psz) + 1; // include final null
00393
00394   if ((1 == cb) || (NULL == g_pChannelData) || (MAX_PATH + 1 < cb) )
00395   {
00396     return;
00397   }
00398
00399 #ifdef NMUI_CHAT_PROTOCOL
00400
00401   BYTE buffer[CB_NMUI_HDR + (MAX_PATH + 1) * sizeof(WCHAR)];
00402   ZeroMemory(buffer, CB_NMUI_HDR + (MAX_PATH + 1) * sizeof(WCHAR));
00403
00404 #ifdef UNICODE
00405   lstrcpyn((LPTSTR) &buffer[CB_NMUI_HDR], psz, MAX_PATH+1);
00406   buffer[CB_NMUI_HDR + MAX_PATH] = 0;
00407 #else
00408   cb = MultiByteToWideChar(CP_ACP, 0, psz, cb, (LPWSTR) &buffer[CB_NMUI_HDR], MAX_PATH);
00409   cb *= 2; // adjust for UNICODE
00410 #endif /* !UNICODE */
00411
00412   // Add special prefix
00413   cb += CB_NMUI_HDR;
00414   ZeroMemory(buffer, CB_NMUI_HDR);
00415   * ((LPDWORD) buffer) = CB_NMUI_HDR;
00416
00417   psz = (LPTSTR) buffer;
00418
00419 #else
00420   cb++; // include final null
00421 #endif /* NMUI_CHAT_PROTOCOL */
00422
00423   if ((NULL != pMember) && (S_OK == pMember->IsSelf()))
00424     pMember = NULL; // local machine = everyone
00425
00426   hr = g_pChannelData->SendData(pMember, cb, (LPBYTE) psz, 0);
00427   if (FAILED(hr))
00428   {
00429     ERROR_MSG(TEXT("DoSendChatMsg: SendData failed: %s"), GetHrSz(hr));
00430   }
00431 }
00432
00433
00434 //****************************************************************************
00435 //
00436 // VOID DoCreateDataChannel(INmConference * pConference)
00437 //
00438 //****************************************************************************
00439
00440 VOID DoCreateDataChannel(INmConference * pConference)
00441 {
00442   INmChannelData  * pChannelData  = NULL;
00443   HRESULT       hr      = NO_ERROR;
00444
00445   if (NULL == pConference)
00446   {
00447     WARN_MSG(TEXT("No conference."));
00448     return;
00449   }
00450
00451   if (NULL != g_pChannelData)
00452   {
00453     WARN_MSG(TEXT("Data channel already exists"));
00454   }
00455
00456   hr = pConference->CreateDataChannel(&pChannelData, g_guidNMUIChat);
00457   if (FAILED(hr))
00458   {
00459     ERROR_MSG(TEXT("CreateDataChannel: Failed hr=%s"), GetHrSz(hr));
00460     return;
00461   }
00462
00463   if (NULL == g_pChannelData)
00464   {
00465     ERROR_MSG(TEXT("DoCreateDataChannel: Failed to hook"));
00466   }
00467   else
00468   {
00469     // The AddRef was done in the hook code.
00470     pChannelData->Release();
00471   }
00472
00473   TRACE_MSG(TEXT("Created Data Channel"));
00474 }
00475
00476
00477 //****************************************************************************
00478 //
00479 // VOID DoActivateDataChannel(BOOL fActive)
00480 //
00481 //****************************************************************************
00482
00483 VOID DoActivateDataChannel(BOOL fActive)
00484 {
00485   HRESULT hr  = NO_ERROR;
00486
00487   if (NULL == g_pChannelData)
00488     return;
00489
00490   hr = g_pChannelData->IsActive();
00491   TRACE_MSG(TEXT("Data channel is %s"), (S_OK == hr) ? "Active" : "Inactive");
00492
00493   hr = g_pChannelData->SetActive(fActive);
00494   TRACE_MSG(TEXT("Data channel SetActive Result=%s"), GetHrSz(hr));
00495 }
00496
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlScan.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

HtmlScan.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       htmlscan.cxx
00006 //
00007 //  Contents:   Scanner for html files
00008 //
00009 //  Classes:    CHtmlScanner
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <htmlguid.hxx>
00017 #include <charhash.hxx>
00018 #include <htmlfilt.hxx>
00019
00020 //+-------------------------------------------------------------------------
00021 //
00022 //  Method:     CToken::IsMatchProperty
00023 //
00024 //  Synopsis:   Does the token's property match the given property ?
00025 //
00026 //  Arguments:  [propSpec]   -- Property to match
00027 //
00028 //--------------------------------------------------------------------------
00029
00030 BOOL CToken::IsMatchProperty( CFullPropSpec& propSpec )
00031 {
00032     if ( propSpec.IsPropertyPropid()
00033          && propSpec.GetPropSet() == _guidPropset
00034          && propSpec.GetPropertyPropid() == _propid )
00035     {
00036         return TRUE;
00037     }
00038     else
00039         return FALSE;
00040 }
00041
00042
00043 //+-------------------------------------------------------------------------
00044 //
00045 //  Method:     CHtmlScanner::CHtmlScanner
00046 //
00047 //  Synopsis:   Constructor
00048 //
00049 //  Arguments:  [htmlIFilter]    -- Reference to Html filter
00050 //              [serialStream]   -- Reference to input stream to scan
00051 //
00052 //--------------------------------------------------------------------------
00053
00054 CHtmlScanner::CHtmlScanner( CHtmlIFilter& htmlIFilter,
00055                             CSerialStream& serialStream )
00056     : _htmlIFilter(htmlIFilter),
00057       _serialStream(serialStream),
00058       _uLenTagBuf(TAG_BUFFER_SIZE),
00059       _cTagCharsRead(0)
00060 {
00061     _pwcTagBuf = newk(mtNewX, NULL) WCHAR[ TAG_BUFFER_SIZE ];
00062 }
00063
00064
00065 //+-------------------------------------------------------------------------
00066 //
00067 //  Method:     CHtmlScanner::~CHtmlScanner
00068 //
00069 //  Synopsis:   Destructor
00070 //
00071 //--------------------------------------------------------------------------
00072
00073 CHtmlScanner::~CHtmlScanner()
00074 {
00075     delete[] _pwcTagBuf;
00076 }
00077
00078
00079
00080 //+-------------------------------------------------------------------------
00081 //
00082 //  Method:     CHtmlScanner::GetBlockOfChars
00083 //
00084 //  Synopsis:   Returns a block of chars upto the size requested by user. If
00085 //              any Html tag is encountered, it stops scanning, and returns the
00086 //              token found.
00087 //
00088 //  Arguments:  [cCharsNeeded]   -- Maximum # chars to scan
00089 //              [awcBuffer]      -- Buffer to fill with scanned chars
00090 //              [cCharsScanned]  -- # chars actually scanned
00091 //              [token]          -- Token found (if any)
00092 //
00093 //--------------------------------------------------------------------------
00094
00095 void CHtmlScanner::GetBlockOfChars( ULONG cCharsNeeded,
00096                                     WCHAR *awcBuffer,
00097                                     ULONG& cCharsScanned,
00098                                     CToken& token )
00099 {
00100     cCharsScanned = 0;
00101
00102     while ( cCharsNeeded > 0 )
00103     {
00104         if ( _serialStream.Eof() )
00105         {
00106             token.SetTokenType( EofToken );
00107             return;
00108         }
00109
00110         WCHAR wch = _serialStream.GetChar();
00111         if ( wch == L'<' )
00112         {
00113             //
00114             // Html tag encountered
00115             //
00116             ScanTag( token );
00117             return;
00118         }
00119         else
00120         {
00121             //
00122             // &lt; and &gt; were mapped to Unicode chars from private use area
00123             // to avoid collision with '<' and '>' chars in Html tags. Map them
00124             // back to '<' and '>'.
00125             //
00126             if ( wch == PRIVATE_USE_MAPPING_FOR_LT )
00127                 wch = L'<';
00128             else if ( wch == PRIVATE_USE_MAPPING_FOR_GT )
00129                 wch = L'>';
00130
00131             awcBuffer[cCharsScanned++] = wch;
00132             cCharsNeeded--;
00133         }
00134     }
00135 }
00136
00137
00138
00139 //+-------------------------------------------------------------------------
00140 //
00141 //  Method:     CHtmlScanner::SkipCharsUntilNextRelevantToken
00142 //
00143 //  Synopsis:   Skips characters in input until EOF or an interesting token
00144 //              is found. The list of properties that were asked to be filtered
00145 //              as part of the IFilter::Init call determines whether a token is
00146 //              interesting or not.
00147 //
00148 //  Arguments:  [fFilterContents]     -- Are contents filtered ?
00149 //              [fFilterProperties]   -- Are properties filtered ?
00150 //              [cAttributes]          -- Count of properties
00151 //              [pAttributes]         -- List of properties to be filtered
00152 //
00153 //--------------------------------------------------------------------------
00154
00155 void CHtmlScanner::SkipCharsUntilNextRelevantToken( CToken& token )
00156 {
00157     //
00158     // Loop until we find a stop token or end of file
00159     //
00160     for (;;)
00161     {
00162         if ( _serialStream.Eof() )
00163         {
00164             token.SetTokenType( EofToken );
00165             return;
00166         }
00167
00168         WCHAR wch = _serialStream.GetChar();
00169         if ( wch == L'<' )
00170         {
00171             ScanTag( token );
00172
00173             if ( token.GetTokenType() == EofToken
00174                  || _htmlIFilter.IsStopToken( token ) )
00175             {
00176                 return;
00177             }
00178             else
00179             {
00180                 //
00181                 // Uninteresting tag, hence skip tag
00182                 //
00183                 EatTag();
00184             }
00185         }
00186         else
00187         {
00188             //
00189             // Vanilla text
00190             //
00191             if ( _htmlIFilter.FFilterContent() )
00192             {
00193                 _serialStream.UnGetChar( wch );
00194                 token.SetTokenType( TextToken );
00195                 return;
00196             }
00197             else
00198                 EatText();
00199         }
00200     }
00201 }
00202
00203
00204 //+-------------------------------------------------------------------------
00205 //
00206 //  Method:     CHtmlScanner::ScanTag
00207 //
00208 //  Synopsis:   Scans a Html tag from input
00209 //
00210 //  Arguments:  [token]  -- Token info returned here
00211 //
00212 //--------------------------------------------------------------------------
00213
00214 void CHtmlScanner::ScanTag( CToken& token )
00215 {
00216
00217     EatBlanks();
00218
00219     if ( _serialStream.Eof() )
00220     {
00221         token.SetTokenType( EofToken );
00222         return;
00223     }
00224     WCHAR wch = _serialStream.GetChar();
00225
00226     token.SetStartTokenFlag( TRUE );
00227     if ( wch == L'/' )
00228     {
00229         //
00230         // This is an end tag
00231         //
00232         token.SetStartTokenFlag( FALSE );
00233         EatBlanks();
00234
00235         if ( _serialStream.Eof() )
00236         {
00237             token.SetTokenType( EofToken );
00238             return;
00239         }
00240         wch = _serialStream.GetChar();
00241     }
00242
00243     WCHAR awcTagName[MAX_TAG_LENGTH+1];
00244     unsigned uLenTag = 0;
00245
00246     //
00247     // Scan the tag name into szTagName. We scan MAX_TAG_LENGTH
00248     // characters only, because anything longer is most probably
00249     // a bogus tag.
00250     //
00251     while ( !iswspace(wch)
00252             && wch != L'>'
00253             && uLenTag < MAX_TAG_LENGTH )
00254     {
00255         awcTagName[uLenTag++] = wch;
00256
00257         if ( _serialStream.Eof() )
00258             break;
00259         wch = _serialStream.GetChar();
00260     }
00261     awcTagName[uLenTag] = 0;
00262
00263     if ( _serialStream.Eof() )
00264     {
00265         token.SetTokenType( EofToken );
00266         return;
00267     }
00268     else if ( wch == L'>' || uLenTag == MAX_TAG_LENGTH )
00269     {
00270         //
00271         // Push char back into input stream because a subsequent GetChar()
00272         // will be expecting to see the char in the input
00273         //
00274         _serialStream.UnGetChar( wch );
00275     }
00276
00277     TagNameToToken( awcTagName, token );
00278 }
00279
00280
00281
00282
00283 //+-------------------------------------------------------------------------
00284 //
00285 //  Method:     CHtmlScanner::ReadTagIntoBuffer
00286 //
00287 //  Synopsis:   Reads the rest of Html tag into the internal buffer
00288 //
00289 //--------------------------------------------------------------------------
00290
00291 void CHtmlScanner::ReadTagIntoBuffer()
00292 {
00293     _cTagCharsRead = 0;
00294
00295     if ( _serialStream.Eof() )
00296         return;
00297
00298     WCHAR wch = _serialStream.GetChar();
00299     while ( wch != L'>' )
00300     {
00301         if ( _cTagCharsRead >= _uLenTagBuf )
00302             GrowTagBuffer();
00303         Win4Assert( _cTagCharsRead < _uLenTagBuf );
00304
00305         _pwcTagBuf[_cTagCharsRead++] = wch;
00306
00307         if ( _serialStream.Eof() )
00308             return;
00309         wch = _serialStream.GetChar();
00310     }
00311 }
00312
00313
00314
00315
00316 //+-------------------------------------------------------------------------
00317 //
00318 //  Method:     CHtmlScanner::ScanTagBuffer
00319 //
00320 //  Synopsis:   Scans the internal tag buffer for a given name, and returns the
00321 //              corresponding value
00322 //
00323 //  Arguments:  [awcName]   -- Pattern to match
00324 //              [pwcValue]  -- Start position of value returned here
00325 //              [uLenValue  -- Length of value field
00326 //
00327 //--------------------------------------------------------------------------
00328
00329 void CHtmlScanner::ScanTagBuffer( WCHAR *awcName,
00330                                   WCHAR * & pwcValue,
00331                                   unsigned& uLenValue )
00332 {
00333     unsigned uLenName = (unsigned) wcslen( awcName );
00334
00335     if ( _cTagCharsRead <= uLenName )
00336     {
00337         //
00338         // Pattern to match is longer than scanned tag
00339         //
00340         pwcValue = 0;
00341         uLenValue = 0;
00342
00343         return;
00344     }
00345
00346     for ( unsigned i=0; i<_cTagCharsRead-uLenName; i++ )
00347     {
00348         BOOL fMatch = TRUE;
00349         for ( unsigned j=0; j<uLenName; j++ )
00350         {
00351             //
00352             // Case insensitive match
00353             //
00354             if ( towlower(awcName[j]) != towlower(_pwcTagBuf[i+j]) )
00355             {
00356                 fMatch = FALSE;
00357                 break;
00358             }
00359         }
00360
00361         if ( fMatch )
00362         {
00363             unsigned k = i + uLenName;
00364             while ( _pwcTagBuf[k] != L'"' && k < _cTagCharsRead )
00365                 k++;
00366
00367             uLenValue = k - (i + uLenName);
00368             pwcValue = &_pwcTagBuf[i+uLenName];
00369
00370             return;
00371         }
00372     }
00373
00374     uLenValue = 0;
00375     pwcValue = 0;
00376 }
00377
00378
00379
00380 //+-------------------------------------------------------------------------
00381 //
00382 //  Method:     CHtmlScanner::EatTag
00383 //
00384 //  Synopsis:   Skips characters in input until the '>' char, which demarcates
00385 //              the end of the tag
00386 //
00387 //--------------------------------------------------------------------------
00388
00389 void CHtmlScanner::EatTag()
00390 {
00391     if ( _serialStream.Eof() )
00392         return;
00393
00394     WCHAR wch = _serialStream.GetChar();
00395     while ( wch != L'>' &&  !_serialStream.Eof() )
00396         wch = _serialStream.GetChar();
00397 }
00398
00399
00400
00401 //+-------------------------------------------------------------------------
00402 //
00403 //  Method:     CHtmlScanner::EatText
00404 //
00405 //  Synopsis:   Skips characters in input until a '<', ie a tag is encountered
00406 //
00407 //--------------------------------------------------------------------------
00408
00409 void CHtmlScanner::EatText()
00410 {
00411     if ( _serialStream.Eof() )
00412         return;
00413
00414     WCHAR wch = _serialStream.GetChar();
00415     while ( wch != L'<' && !_serialStream.Eof() )
00416         wch = _serialStream.GetChar();
00417
00418     if ( wch == L'<' )
00419         _serialStream.UnGetChar( wch );
00420 }
00421
00422
00423
00424 //+-------------------------------------------------------------------------
00425 //
00426 //  Method:     CHtmlScanner::EatBlanks
00427 //
00428 //  Synopsis:   Skips generic white space characters in input
00429 //
00430 //--------------------------------------------------------------------------
00431
00432 void CHtmlScanner::EatBlanks()
00433 {
00434     if ( _serialStream.Eof() )
00435         return;
00436
00437     WCHAR wch = _serialStream.GetChar();
00438     while ( iswspace(wch) && !_serialStream.Eof() )
00439         wch = _serialStream.GetChar();
00440
00441     if ( !iswspace(wch) )
00442         _serialStream.UnGetChar( wch );
00443 }
00444
00445
00446
00447
00448 //+-------------------------------------------------------------------------
00449 //
00450 //  Method:     CHtmlScanner::TagNameToToken
00451 //
00452 //  Synopsis:   Maps a tag name to token information
00453 //
00454 //  Arguments:  [awcTagName]  -- Tag name to map
00455 //              [token]       -- Token information returned here
00456 //
00457 //--------------------------------------------------------------------------
00458
00459 void CHtmlScanner::TagNameToToken( WCHAR *awcTagName, CToken& token )
00460 {
00461     //
00462     // The number of interesting Html tags will be small, hence no need for
00463     // a table lookup
00464     //
00465     switch( awcTagName[0] )
00466     {
00467     case L'a':
00468     case L'A':
00469         if ( _wcsicmp( awcTagName, L"a" ) == 0 )
00470         {
00471             token.SetTokenType( AnchorToken );
00472             token.SetPropset( CLSID_HtmlInformation );
00473             token.SetPropid( PID_HREF );
00474         }
00475         else if ( _wcsicmp( awcTagName, L"address" ) == 0 )
00476             token.SetTokenType( BreakToken );
00477         else
00478             token.SetTokenType( GenericToken );
00479
00480         break;
00481
00482     case L'b':
00483     case L'B':
00484         if ( _wcsicmp( awcTagName, L"br" ) == 0
00485              || _wcsicmp( awcTagName, L"blockquote" ) == 0 )
00486         {
00487             token.SetTokenType( BreakToken );
00488         }
00489         else
00490             token.SetTokenType( GenericToken );
00491
00492         break;
00493
00494     case L'd':
00495     case L'D':
00496         if ( _wcsicmp( awcTagName, L"dd" ) == 0
00497              || _wcsicmp( awcTagName, L"dl" ) == 0
00498              || _wcsicmp( awcTagName, L"dt" ) == 0 )
00499         {
00500             token.SetTokenType( BreakToken );
00501         }
00502         else
00503             token.SetTokenType( GenericToken );
00504
00505         break;
00506
00507     case L'f':
00508     case L'F':
00509         if ( _wcsicmp( awcTagName, L"form" ) == 0 )
00510             token.SetTokenType( BreakToken );
00511         else
00512             token.SetTokenType( GenericToken );
00513
00514         break;
00515
00516     case L'h':
00517     case L'H':
00518         if ( _wcsicmp( awcTagName, L"h1" ) == 0 )
00519         {
00520             token.SetTokenType( Heading1Token );
00521             token.SetPropset( CLSID_HtmlInformation );
00522             token.SetPropid( PID_HEADING_1 );
00523         }
00524         else if ( _wcsicmp( awcTagName, L"h2" ) == 0 )
00525         {
00526             token.SetTokenType( Heading2Token );
00527             token.SetPropset( CLSID_HtmlInformation );
00528             token.SetPropid( PID_HEADING_2 );
00529         }
00530         else if ( _wcsicmp( awcTagName, L"h3" ) == 0 )
00531         {
00532             token.SetTokenType( Heading3Token );
00533             token.SetPropset( CLSID_HtmlInformation );
00534             token.SetPropid( PID_HEADING_3 );
00535         }
00536         else if ( _wcsicmp( awcTagName, L"h4" ) == 0 )
00537         {
00538             token.SetTokenType( Heading4Token );
00539             token.SetPropset( CLSID_HtmlInformation );
00540             token.SetPropid( PID_HEADING_4 );
00541         }
00542         else if ( _wcsicmp( awcTagName, L"h5" ) == 0 )
00543         {
00544             token.SetTokenType( Heading5Token );
00545             token.SetPropset( CLSID_HtmlInformation );
00546             token.SetPropid( PID_HEADING_5 );
00547         }
00548         else if ( _wcsicmp( awcTagName, L"h6" ) == 0 )
00549         {
00550             token.SetTokenType( Heading6Token );
00551             token.SetPropset( CLSID_HtmlInformation );
00552             token.SetPropid( PID_HEADING_6 );
00553         }
00554         else
00555             token.SetTokenType( GenericToken );
00556
00557         break;
00558
00559     case L'i':
00560     case L'I':
00561         if ( _wcsicmp( awcTagName, L"input" ) == 0 )
00562             token.SetTokenType( InputToken );
00563         else if ( _wcsicmp( awcTagName, L"img" ) == 0 )
00564             token.SetTokenType( ImageToken );
00565         else
00566             token.SetTokenType( GenericToken );
00567
00568         break;
00569
00570     case L'l':
00571     case L'L':
00572         if ( _wcsicmp( awcTagName, L"li" ) == 0 )
00573             token.SetTokenType( BreakToken );
00574         else
00575             token.SetTokenType( GenericToken );
00576
00577         break;
00578
00579     case L'm':
00580     case L'M':
00581         if ( _wcsicmp( awcTagName, L"math" ) == 0 )
00582             token.SetTokenType( BreakToken );
00583         else if (  _wcsicmp( awcTagName, L"meta" ) == 0 )
00584             token.SetTokenType( MetaToken );
00585         else
00586             token.SetTokenType( GenericToken );
00587
00588         break;
00589
00590     case L'o':
00591     case L'O':
00592         if ( _wcsicmp( awcTagName, L"ol" ) == 0 )
00593             token.SetTokenType( BreakToken );
00594         else
00595             token.SetTokenType( GenericToken );
00596
00597         break;
00598
00599     case L'p':
00600     case L'P':
00601         if ( _wcsicmp( awcTagName, L"p" ) == 0 )
00602             token.SetTokenType( BreakToken );
00603         else
00604             token.SetTokenType( GenericToken );
00605
00606         break;
00607
00608     case L's':
00609     case L'S':
00610         if ( _wcsicmp( awcTagName, L"script" ) == 0 )
00611             token.SetTokenType( ScriptToken );
00612         else
00613             token.SetTokenType( GenericToken );
00614
00615         break;
00616
00617     case L't':
00618     case L'T':
00619         if ( _wcsicmp( awcTagName, L"title" ) == 0 )
00620         {
00621             token.SetTokenType( TitleToken );
00622             token.SetPropset( CLSID_SummaryInformation );
00623             token.SetPropid( PID_TITLE );
00624         }
00625         else if ( _wcsicmp( awcTagName, L"table" ) == 0
00626                   || _wcsicmp( awcTagName, L"th" ) == 0
00627                   || _wcsicmp( awcTagName, L"tr" ) == 0
00628                   || _wcsicmp( awcTagName, L"td" ) == 0 )
00629             token.SetTokenType( BreakToken );
00630         else
00631             token.SetTokenType( GenericToken );
00632
00633         break;
00634
00635     case L'u':
00636     case L'U':
00637         if ( _wcsicmp( awcTagName, L"ul" ) == 0 )
00638             token.SetTokenType( BreakToken );
00639         else
00640             token.SetTokenType( GenericToken );
00641
00642         break;
00643
00644     case L'!':
00645         if  ( _wcsicmp( awcTagName, L"!--" ) == 0 )
00646             token.SetTokenType( CommentToken );
00647         else
00648             token.SetTokenType( GenericToken );
00649
00650         break;
00651
00652     default:
00653         //
00654         // It's an uninteresting tag
00655         //
00656         token.SetTokenType( GenericToken );
00657     }
00658 }
00659
00660
00661
00662
00663 //+-------------------------------------------------------------------------
00664 //
00665 //  Method:     CHtmlScanner::GrowTagBuffer
00666 //
00667 //  Synopsis:   Grow internal tag buffer to twice its current size
00668 //
00669 //--------------------------------------------------------------------------
00670
00671 void CHtmlScanner::GrowTagBuffer()
00672 {
00673     WCHAR *pwcNewTagBuf = newk(mtNewX, NULL) WCHAR[2 * _uLenTagBuf];
00674     RtlCopyMemory( pwcNewTagBuf,
00675                    _pwcTagBuf,
00676                    _uLenTagBuf * sizeof(WCHAR) );
00677
00678     delete[] _pwcTagBuf;
00679     _uLenTagBuf *= 2;
00680     _pwcTagBuf = pwcNewTagBuf;
00681 }
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/fulldrag/fulldrag.c Source File

  • WinUI
  • fulldrag

fulldrag.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  *  Fulldrag.c
00004  *
00005  *  Copyright (c) 1997 Microsoft Corporation.
00006  *
00007  *  <blah blah standard SDK sample copyright>
00008  *
00009  *  Abstract:
00010  *
00011  *      Sample program to demonstrate how a program can override
00012  *      Full Drag.
00013  *
00014  *      This program is to be read in conjunction with KB article Q121541.
00015  *
00016  *****************************************************************************/
00017
00018 #include "fulldrag.h"
00019
00020 /*****************************************************************************
00021  *
00022  *      Globals
00023  *
00024  *      g_fMoveSize
00025  *
00026  *          Set while we are in a move/size loop.  The WM_ENTERSIZEMOVE
00027  *          and WM_EXITSIZEMOVE messages tell us when these things happen.
00028  *
00029  *      g_fPaintDeferred
00030  *
00031  *          Set if we deferred a paint that occured while we were
00032  *          busy doing a Move/Size.  When the Move/Size completes
00033  *          and we discover that a paint was deferred, we force
00034  *          a full repaint to complete the deferred paint.
00035  *
00036  *
00037  *      Note:
00038  *
00039  *      In a real (i.e., non-sample) program, these would not be global
00040  *      variables.  They would be per-window variables.
00041  *
00042  *****************************************************************************/
00043
00044 BOOL g_fDragging;
00045 BOOL g_fPaintDeferred;
00046
00047 /*****************************************************************************
00048  *
00049  *  Hilbert
00050  *
00051  *      Draws a segment of the hilbert curve.
00052  *
00053  *      The math is not important.  What is important is that drawing
00054  *      a hilbert curve takes a long time.
00055  *
00056  *****************************************************************************/
00057
00058 #define MAXDEPTH 8      /* Bigger depth takes longer to draw */
00059
00060 void
00061 Hilbert(HDC hdc, int x, int y, int vx, int vy, int wx, int wy, int n)
00062 {
00063     if (n >= MAXDEPTH) {
00064         LineTo(hdc, x + (vx+wx)/2, y + (vy+wy)/2);
00065     } else {
00066         n++;
00067         Hilbert(hdc, x, y, wx/2, wy/2, vx/2, vy/2, n);
00068         Hilbert(hdc, x+vx/2, y+vy/2, vx/2, vy/2, wx/2, wy/2, n);
00069         Hilbert(hdc, x+vx/2+wx/2, y+vy/2+wy/2, vx/2, vy/2, wx/2, wy/2, n);
00070         Hilbert(hdc, x+vx/2+wx, y+vy/2+wy, -wx/2, -wy/2, -vx/2, -vy/2, n);
00071     }
00072 }
00073
00074 /*****************************************************************************
00075  *
00076  *  Hilbert_OnPaint
00077  *
00078  *      Handle the WM_PAINT message.
00079  *
00080  *      If the user is dragging the window, then don't do our painting,
00081  *      because that would make the dragging very jerky.  Instead, just
00082  *      remember that there was a paint message that we ignored.  After
00083  *      the size/move is complete, we will perform one big paint to do
00084  *      the things that we had ignored.
00085  *
00086  *****************************************************************************/
00087
00088 void
00089 Hilbert_OnPaint(HWND hwnd)
00090 {
00091     PAINTSTRUCT ps;
00092     HDC hdc;
00093
00094     hdc = BeginPaint(hwnd, &ps);
00095     if (hdc) {
00096         if (g_fDragging) {
00097             g_fPaintDeferred = TRUE;
00098         } else {
00099
00100             HBRUSH hbrOld;
00101             HPEN hpenOld;
00102             HCURSOR hcurOld;
00103
00104             hcurOld = SetCursor(LoadCursor(0, IDC_WAIT));
00105
00106             hbrOld = SelectObject(hdc, GetStockObject(BLACK_BRUSH));
00107             hpenOld = SelectObject(hdc, GetStockObject(BLACK_PEN));
00108
00109             MoveToEx(hdc, 0, 0, 0);
00110             Hilbert(hdc, 0, 0, GetSystemMetrics(SM_CXFULLSCREEN), 0,
00111                                0, GetSystemMetrics(SM_CYFULLSCREEN), 0);
00112             SelectObject(hdc, hpenOld);
00113             SelectObject(hdc, hbrOld);
00114
00115             SetCursor(hcurOld);
00116         }
00117         EndPaint(hwnd, &ps);
00118     }
00119 }
00120
00121 /*****************************************************************************
00122  *
00123  *  Hilbert_WndProc
00124  *
00125  *      Window procedure.
00126  *
00127  *****************************************************************************/
00128
00129 LRESULT CALLBACK
00130 Hilbert_WndProc(HWND hwnd, UINT wm, WPARAM wp, LPARAM lp)
00131 {
00132     switch (wm) {
00133     case WM_PAINT:
00134         Hilbert_OnPaint(hwnd);
00135         break;
00136
00137     case WM_DESTROY:
00138         PostQuitMessage(0);
00139         break;
00140
00141     /*
00142      *  When we begin a size/move operation, remember the fact
00143      *  so we won't paint during the size/move.
00144      */
00145     case WM_ENTERSIZEMOVE:
00146         g_fDragging = TRUE;
00147         break;
00148
00149     /*
00150      *  When we finish a size/move operation, remember the fact
00151      *  so we will resume painting, and if there were any deferred
00152      *  paint messages, re-invalidate ourselves so they will be
00153      *  regenerated.
00154      */
00155     case WM_EXITSIZEMOVE:
00156         g_fDragging = FALSE;
00157         if (g_fPaintDeferred) {
00158             g_fPaintDeferred = FALSE;
00159             InvalidateRect(hwnd, 0, TRUE);
00160         }
00161         break;
00162
00163     }
00164
00165     return DefWindowProc(hwnd, wm, wp, lp);
00166 }
00167
00168 /*****************************************************************************
00169  *
00170  *  WinMain
00171  *
00172  *      Program entry point.
00173  *
00174  *      Register the class, create the window, and go into a message loop.
00175  *
00176  *****************************************************************************/
00177
00178 int WINAPI
00179 WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
00180 {
00181     HWND hwnd;
00182     MSG msg;
00183     WNDCLASS wc = {
00184         0,
00185         Hilbert_WndProc,
00186         0,
00187         0,
00188         hinst,
00189         LoadIcon(0, IDI_APPLICATION),
00190         LoadCursor(0, IDC_ARROW),
00191         (HBRUSH)(COLOR_WINDOW+1),
00192         0,
00193         "Hilbert"
00194     };
00195
00196     RegisterClass(&wc);
00197     hwnd = CreateWindow("Hilbert", "Hilbert", WS_OVERLAPPEDWINDOW,
00198                         CW_USEDEFAULT, CW_USEDEFAULT,
00199                         CW_USEDEFAULT, CW_USEDEFAULT,
00200                         0, 0, hinst, 0);
00201     ShowWindow(hwnd, nCmdShow);
00202     while (GetMessage(&msg, 0, 0, 0)) {
00203         TranslateMessage(&msg);
00204         DispatchMessage(&msg);
00205     }
00206
00207     return 0;
00208 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAgentCtlCommandEx Member List

This is the complete list of members for CAgentCtlCommandEx, including all inherited members.
CAgentCtlCommandEx() | CAgentCtlCommandEx | [inline]
CAgentCtlCommandEx(LPDISPATCH pDispatch) | CAgentCtlCommandEx | [inline]
CAgentCtlCommandEx(const CAgentCtlCommandEx &dispatchSrc) | CAgentCtlCommandEx | [inline]
GetCaption() | CAgentCtlCommandEx |
GetConfidence() | CAgentCtlCommandEx |
GetConfidenceText() | CAgentCtlCommandEx |
GetEnabled() | CAgentCtlCommandEx |
GetHelpContextID() | CAgentCtlCommandEx |
GetVisible() | CAgentCtlCommandEx |
GetVoice() | CAgentCtlCommandEx |
GetVoiceCaption() | CAgentCtlCommandEx |
SetCaption(LPCTSTR lpszNewValue) | CAgentCtlCommandEx |
SetConfidence(long nNewValue) | CAgentCtlCommandEx |
SetConfidenceText(LPCTSTR lpszNewValue) | CAgentCtlCommandEx |
SetEnabled(BOOL bNewValue) | CAgentCtlCommandEx |
SetHelpContextID(long nNewValue) | CAgentCtlCommandEx |
SetVisible(BOOL bNewValue) | CAgentCtlCommandEx |
SetVoice(LPCTSTR lpszNewValue) | CAgentCtlCommandEx |
SetVoiceCaption(LPCTSTR lpszNewValue) | CAgentCtlCommandEx |
Generated on Wed Nov 13 2024 16:55:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/prof.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

prof.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     Server Profiling Routines
00005
00006     FILE: Prof.cpp
00007
00008     PURPOSE: Routines for profiling server system services.
00009
00010     FUNCTIONS:
00011         ProfOpenLog - Opens the profile log file and prepares to
00012     take timings.
00013         ProfRecordTime - Records the time of an event.
00014         ProfCloseLog - Writes the profiling data to the file
00015     and closes it.
00016
00017     COMMENTS: See the header file for function info.
00018         These routines depend on the existence of a high-resolution
00019     performance counter.
00020
00021 */
00022
00023 #include <windows.h>
00024 #include <stdio.h>
00025 #include <stdlib.h>
00026 #include <process.h>
00027 #include <tchar.h>
00028
00029 #include "Prof.h"
00030 #include "Service.h"
00031 #include "common.h"
00032
00033 // Handle to the profile log file.
00034 HANDLE hProfLog = NULL;
00035
00036 // Counters for the timings.
00037 LARGE_INTEGER lpStartTime, lpCurrentTime, lpFrequency;
00038
00039 // The profile log text data.
00040 // Profile log gets acumulated in this string first, and then
00041 // gets written out when the log gets closed.
00042 TCHAR PROF_LOG[PROF_LOG_MAX_SIZE];
00043
00044 // Current size of the profile log.
00045 UINT nProfLogSize = 0;
00046
00047 // This is the maximum size of the log entry without the
00048 // user-specified message.  It is basically the size of a string
00049 // with an integer and a float.
00050 #define MAX_ENTRY_SIZE_NOMSG (32)
00051
00052 CRITICAL_SECTION ProfCriticalSection;
00053
00054 VOID ProfOpenLog(LPTSTR LogFileName) {
00055
00056     // Init the critsec.
00057     if (InitializeCriticalSectionAndSpinCount(&ProfCriticalSection, 0) == 0) {
00058         AddToMessageLogProcFailure(TEXT("ProfOpenLog: InitializeCriticalSectionAndSpinCount"), GetLastError());
00059         return;
00060     }
00061
00062     // Open the profiling log.
00063     if ((hProfLog = CreateFile(LogFileName,
00064                                GENERIC_WRITE,
00065                                0,
00066                                NULL,
00067                                CREATE_ALWAYS,
00068                                FILE_ATTRIBUTE_NORMAL,
00069                                NULL)) == INVALID_HANDLE_VALUE) {
00070         AddToMessageLogProcFailure(TEXT("ProfOpenLog: CreateFile"), GetLastError());
00071         return;
00072     }
00073
00074     // Get the current time.
00075     if (QueryPerformanceCounter(&lpStartTime) == FALSE) {
00076         AddToMessageLogProcFailure(TEXT("ProfOpenLog: QueryPerformanceCounter"), GetLastError());
00077         return;
00078     }
00079
00080     // Get the frequency.
00081     if (QueryPerformanceFrequency(&lpFrequency) == FALSE) {
00082         AddToMessageLogProcFailure(TEXT("ProfOpenLog: QueryPerformanceCounter"), GetLastError());
00083         return;
00084     }
00085 }
00086
00087 VOID ProfRecordTime(UINT id, LPTSTR msg) {
00088     FLOAT dt;
00089
00090     EnterCriticalSection(&ProfCriticalSection);
00091
00092     // Write the entry only if there is enough space left in
00093     // the log.
00094     if (nProfLogSize < PROF_LOG_MAX_SIZE - (MAX_ENTRY_SIZE_NOMSG + _tcslen(msg))) {
00095         if (QueryPerformanceCounter(&lpCurrentTime) == FALSE) {
00096             AddToMessageLogProcFailure(TEXT("ProfRecordTime: QueryPerformanceCounter"), GetLastError());
00097             LeaveCriticalSection(&ProfCriticalSection);
00098             return;
00099         }
00100
00101         // Get the time stamp for the event.
00102         dt = (FLOAT)(lpCurrentTime.QuadPart - lpStartTime.QuadPart)/(FLOAT)(lpFrequency.QuadPart);
00103
00104         // Append the entry to the log.
00105         nProfLogSize+=_stprintf(&PROF_LOG[nProfLogSize], TEXT("%d %s %f\n"), id, msg, dt);
00106     }
00107
00108     LeaveCriticalSection(&ProfCriticalSection);
00109 }
00110
00111 VOID ProfCloseLog(VOID) {
00112     ULONG cbWritten;
00113     DWORD status;
00114
00115     // Delete the critsec.
00116     // Here we make the assumption that no outside functions will use
00117     // the critsec anymore.  This should be valid, since all the profiling data
00118     // has been written.
00119     // Also we make an assumption that only one thread will attempt
00120     // to close the profile log.  This should be valid as well, or the
00121     // user can inmplement a semaphore to take care of that.
00122     DeleteCriticalSection(&ProfCriticalSection);
00123
00124     // Write out the profile log.
00125     if(!WriteFile(hProfLog,
00126                   (LPVOID)PROF_LOG,
00127                   nProfLogSize*sizeof(TCHAR),
00128                   &cbWritten,
00129                   NULL)) {
00130
00131         AddToMessageLogProcFailure(TEXT("ProfCloseLog: WriteFile"), GetLastError());
00132         return;
00133     }
00134
00135     // Close the profile log.
00136     if (hProfLog != NULL && hProfLog != INVALID_HANDLE_VALUE) {
00137         status = CloseHandle(hProfLog);
00138         ASSERTE(status);
00139     }
00140 }
00141
00142 // end Prof.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CExList< TYPE > Member List

This is the complete list of members for CExList< TYPE >, including all inherited members.
AddHead(TYPE element) | CExList< TYPE > | [virtual]
AddTail(TYPE element) | CExList< TYPE > | [virtual]
CExList() | CExList< TYPE > |
Find(TYPE element) | CExList< TYPE > | [virtual]
FindIndex(ULONG iIndex) | CExList< TYPE > | [virtual]
GetAt(POS position) const | CExList< TYPE > | [inline, virtual]
GetCount() | CExList< TYPE > | [inline, virtual]
GetHead() | CExList< TYPE > | [inline, virtual]
GetHeadPosition() | CExList< TYPE > | [inline, virtual]
GetNext(POS &position) | CExList< TYPE > | [inline, virtual]
GetPrev(POS &position) | CExList< TYPE > | [inline, virtual]
GetTail() | CExList< TYPE > | [inline, virtual]
GetTailPosition() | CExList< TYPE > | [inline, virtual]
InsertAfter(POS position, TYPE element) | CExList< TYPE > | [virtual]
InsertBefore(POS position, TYPE element) | CExList< TYPE > | [virtual]
IsEmpty() | CExList< TYPE > | [inline, virtual]
m_pHeadNode | CExList< TYPE > | [private]
m_pTailNode | CExList< TYPE > | [private]
m_ulElements | CExList< TYPE > | [private]
RemoveAll() | CExList< TYPE > | [virtual]
RemoveAt(POS position) | CExList< TYPE > | [virtual]
RemoveHead() | CExList< TYPE > | [virtual]
RemoveTail() | CExList< TYPE > | [virtual]
SetAt(POS position, TYPE element) | CExList< TYPE > | [inline, virtual]
~CExList() | CExList< TYPE > | [virtual]
Generated on Wed Nov 13 2024 16:56:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/basesnap.h Source File

  • SysMgmt
  • MMC
  • Openserv

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/IMSConf2.Idl Source File

  • Web
  • NetMeeting
  • NMFT

IMSConf2.Idl

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright 1995 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 //  Contents:   Conferencing Services Object interfaces
00006 //
00007 //----------------------------------------------------------------------------
00008
00009 cpp_quote("//+-------------------------------------------------------------------------")
00010 cpp_quote("//")
00011 cpp_quote("//  Microsoft Windows")
00012 cpp_quote("//  Copyright 1995-1999 Microsoft Corporation. All Rights Reserved.")
00013 cpp_quote("//")
00014 cpp_quote("//  File: imsconf2.h")
00015 cpp_quote("//")
00016 cpp_quote("//--------------------------------------------------------------------------")
00017
00018 //////////////////////////////////////////////////////////////////////////////////
00019 // GUID usage:
00020 //
00021 // {068B0700-718C-11d0-8B1A-00A0C91BC90E} - {068B08FF-718C-11d0-8B1A-00A0C91BC90E}
00022 //
00023
00024 import "objidl.idl";
00025 import "oleidl.idl";
00026 import "oaidl.idl";
00027
00028 interface INmManager;
00029 interface INmManagerNotify;
00030 interface INmSysInfo;
00031 interface INmMember;
00032 interface INmCall;
00033 interface INmCallNotify;
00034 interface INmConference;
00035 interface INmConferenceNotify;
00036 interface INmChannel;
00037 interface INmChannelNotify;
00038 interface INmChannelData;
00039 interface INmChannelDataNotify;
00040 interface INmChannelFt;
00041 interface INmChannelFtNotify;
00042 interface INmChannelVideo;
00043 interface INmChannelVideoNotify;
00044 interface INmChannelAudio;
00045 interface INmChannelAudioNotify;
00046 interface INmChannelAppShare;
00047 interface INmChannelAppShareNotify;
00048 interface INmFt;
00049 interface INmSharableApp;
00050 interface IEnumNmConference;
00051 interface IEnumNmMember;
00052 interface IEnumNmChannel;
00053 interface IEnumNmCall;
00054 interface IEnumNmSharableApp;
00055
00056
00057 cpp_quote("")
00058 cpp_quote("////////////////////////////////////////////////////////////////////////////")
00059 cpp_quote("//")
00060 cpp_quote("// Constants")
00061 cpp_quote("")
00062
00063
00064 cpp_quote("// NetMeeting Channel Types")
00065 cpp_quote("#define NMCH_NONE                     0x00000000")
00066 cpp_quote("#define NMCH_DATA                     0x00000001")
00067 cpp_quote("#define NMCH_AUDIO                    0x00000002")
00068 cpp_quote("#define NMCH_VIDEO                    0x00000004")
00069 cpp_quote("#define NMCH_SHARE                    0x00000010")
00070 cpp_quote("#define NMCH_FT                       0x00000020")
00071 cpp_quote("#define NMCH_ALL                      0x0000FFFF")
00072 cpp_quote("#define NMCH_SECURE                   0x00010000")
00073
00074 cpp_quote("")
00075 cpp_quote("// Initialization options")
00076 cpp_quote("#define NM_INIT_NORMAL                0x00000000")
00077 cpp_quote("#define NM_INIT_CONTROL               0x00000001")
00078 cpp_quote("#define NM_INIT_NO_LAUNCH             0x00000002")
00079 cpp_quote("#define NM_INIT_BACKGROUND            0x00000005")
00080
00081 cpp_quote("")
00082 cpp_quote("// INmChannelDataNotify.DataReceived dwFlags")
00083 cpp_quote("#define NM_DF_BROADCAST               0x00000010") // data was broadcast to everyone
00084 cpp_quote("#define NM_DF_PRIVATE                 0x00000020") // data was private
00085 cpp_quote("#define NM_DF_SEGMENT_END             0x00000040") // end of data block
00086 cpp_quote("#define NM_DF_SEGMENT_BEGIN           0x00000080") // start of data block
00087
00088 cpp_quote("")
00089 cpp_quote("// Audio")
00090 cpp_quote("#define NM_MAX_AUDIO_LEVEL            0x0000FFFF")
00091
00092 cpp_quote("")
00093 cpp_quote("// Video")
00094 cpp_quote("#define NM_VIDEO_NO_AUTOSIZE          0x00000000")
00095 cpp_quote("#define NM_VIDEO_SMALL                0x00000001")
00096 cpp_quote("#define NM_VIDEO_MEDIUM               0x00000002")
00097 cpp_quote("#define NM_VIDEO_LARGE                0x00000004")
00098 cpp_quote("#define NM_VIDEO_MIN_QUALITY          0x00000000")
00099 cpp_quote("#define NM_VIDEO_MAX_QUALITY          0x0000001F")
00100 cpp_quote("#define NM_VIDEO_SOURCE_DIALOG        0x00000001")
00101 cpp_quote("#define NM_VIDEO_FORMAT_DIALOG        0x00000002")
00102
00103 cpp_quote("")
00104 cpp_quote("// Version Numbers")
00105 cpp_quote("#define NM_VER_UNKNOWN                0x00000000")
00106 cpp_quote("#define NM_VER_1                      0x00000001")
00107 cpp_quote("#define NM_VER_2                      0x00000002")
00108 cpp_quote("#define NM_VER_NetMeeting2_11         0x00000003")
00109 cpp_quote("#define NM_VER_NetMeeting3            0x00000004")
00110 cpp_quote("#define NM_VER_FUTURE                 0x0000000F")
00111 cpp_quote("")
00112
00113
00114 cpp_quote("")
00115 cpp_quote("// User Categories")
00116 cpp_quote("#define NM_CATEGORY_PERSONAL          0x00000001")
00117 cpp_quote("#define NM_CATEGORY_BUSINESS          0x00000002")
00118 cpp_quote("#define NM_CATEGORY_ADULT             0x00000004")
00119 cpp_quote("")
00120
00121 cpp_quote("")
00122 cpp_quote("////////////////////////////////////////////////////////////////////////////")
00123 cpp_quote("//  Error Codes")
00124 cpp_quote("")
00125 cpp_quote("#define NM_E(e) (0x81000000UL | (ULONG) (e))")
00126 cpp_quote("")
00127 cpp_quote("enum {")
00128
00129 cpp_quote("")
00130 cpp_quote("// NetMeeting specific error codes")
00131 cpp_quote("//")
00132 cpp_quote("  NM_S_NEXT_CONFERENCE          = ((ULONG) 0x0201),") // INmSysInfo.SetProperty
00133 cpp_quote("  NM_S_ON_RESTART               = ((ULONG) 0x0202),") // INmSysInfo.SetProperty
00134 cpp_quote("")
00135
00136 cpp_quote("")
00137 cpp_quote("// Call specific error codes")
00138 cpp_quote("//")
00139 cpp_quote("  NM_CALLERR_NOT_INITIALIZED    = NM_E(0x0100),") // Local system not initialized
00140 cpp_quote("  NM_CALLERR_MEDIA              = NM_E(0x0101),") // Invalid channel/media types
00141 cpp_quote("  NM_CALLERR_NAME_RESOLUTION    = NM_E(0x0102),") // Name resolution failed
00142 cpp_quote("  NM_CALLERR_PASSWORD           = NM_E(0x0103),") // Invalid conference password
00143 cpp_quote("  NM_CALLERR_CONFERENCE_NAME    = NM_E(0x0104),") // Problem with the conference name
00144 cpp_quote("  NM_CALLERR_IN_CONFERENCE      = NM_E(0x0105),") // Remote system is in a conference
00145 cpp_quote("  NM_CALLERR_NOT_FOUND          = NM_E(0x0106),") // User/Address not found
00146 cpp_quote("  NM_CALLERR_MCU                = NM_E(0x0107),") // Can't invite MCU into existing conference
00147 cpp_quote("  NM_CALLERR_REJECTED           = NM_E(0x0108),") // Remote system rejected the request
00148 cpp_quote("  NM_CALLERR_AUDIO              = NM_E(0x0109),") // Audio connection failed
00149 cpp_quote("  NM_CALLERR_AUDIO_LOCAL        = NM_E(0x010A),") // Local audio device already in use
00150 cpp_quote("  NM_CALLERR_AUDIO_REMOTE       = NM_E(0x010B),") // Remote audio device in use
00151 cpp_quote("  NM_CALLERR_ALREADY_CALLING    = NM_E(0x01FD),") // Already calling this person
00152 cpp_quote("  NM_CALLERR_LOOPBACK           = NM_E(0x01FE),") // Called Local Machine
00153 cpp_quote("  NM_CALLERR_UNKNOWN            = NM_E(0x01FF),") // Unknown call error
00154 cpp_quote("")
00155 cpp_quote("// other error codes")
00156 cpp_quote("//")
00157 cpp_quote("  NM_E_NOT_INITIALIZED          = NM_E(0x0200),") // INmManager not Initialized
00158 cpp_quote("  NM_E_CHANNEL_ALREADY_EXISTS   = NM_E(0x0201),") // Data channel already exists
00159 cpp_quote("  NM_E_NO_T120_CONFERENCE       = NM_E(0x0202),") // Not in a T.120 data conference
00160 cpp_quote("  NM_E_NOT_ACTIVE               = NM_E(0x0203),") // NetMeeting is not running
00161 cpp_quote("  NM_E_FILE_TOO_BIG             = NM_E(0x0204),") // The file we attempted to send is too big
00162 cpp_quote("  NM_E_USER_CANCELED_SETUP    = NM_E(0x0205),") // User canceled NetMeeting setup wizard
00163 cpp_quote("  NM_E_ALREADY_RUNNING      = NM_E(0x0206),") // This means that NetMeeting is already running
00164 cpp_quote("  NM_E_SHARING_NOT_AVAILABLE    = NM_E(0x0207),") // This means that Shring is not available
00165 cpp_quote("};")
00166 cpp_quote("")
00167
00168 typedef enum tagNmConferenceState{
00169     NM_CONFERENCE_IDLE                           = 0,
00170     NM_CONFERENCE_WAITING                        = 1,
00171     NM_CONFERENCE_INITIALIZING                   = 2,
00172     NM_CONFERENCE_ACTIVE                         = 3,
00173 } NM_CONFERENCE_STATE;
00174
00175 typedef enum tagNmCallType{
00176     NM_CALL_DEFAULT                              = 0,
00177     NM_CALL_T120                                 = 1,
00178     NM_CALL_H323                                 = 2,
00179 } NM_CALL_TYPE;
00180
00181 typedef enum tagNmAddrType{
00182     NM_ADDR_UNKNOWN                              = 0,
00183     NM_ADDR_IP                                   = 1,
00184     NM_ADDR_MACHINENAME                          = 2,
00185     NM_ADDR_PSTN                                 = 3,
00186     NM_ADDR_ULS                                  = 4,
00187     NM_ADDR_H323_GATEWAY                         = 5,
00188     NM_ADDR_CALLTO                               = 6,
00189     NM_ADDR_T120_TRANSPORT                       = 7,
00190 } NM_ADDR_TYPE;
00191
00192 typedef enum tagNmCallState{
00193     NM_CALL_INVALID                              = 0,
00194     NM_CALL_INIT                                 = 1,
00195     NM_CALL_RING                                 = 2,
00196     NM_CALL_SEARCH                               = 3,
00197     NM_CALL_WAIT                                 = 4,
00198     NM_CALL_ACCEPTED                             = 5,
00199     NM_CALL_REJECTED                             = 6,
00200     NM_CALL_CANCELED                             = 7,
00201 } NM_CALL_STATE;
00202
00203 typedef enum tagNmMemberNotify{
00204     NM_MEMBER_ADDED                              = 0,
00205     NM_MEMBER_REMOVED                            = 1,
00206     NM_MEMBER_UPDATED                            = 2,
00207 } NM_MEMBER_NOTIFY;
00208
00209 typedef enum tagNmChannelNotify{
00210     NM_CHANNEL_ADDED                             = 0,
00211     NM_CHANNEL_REMOVED                           = 1,
00212     NM_CHANNEL_UPDATED                           = 2,
00213 } NM_CHANNEL_NOTIFY;
00214
00215 typedef enum tagNmFtState{
00216     NM_FT_INVALID                                = 0,
00217     NM_FT_SENDING                                = 1,
00218     NM_FT_RECEIVING                              = 2,
00219     NM_FT_COMPLETE                               = 3,
00220 } NM_FT_STATE;
00221
00222 typedef enum tagNmAudioState{
00223     NM_AUDIO_IDLE                                = 0,
00224     NM_AUDIO_LOCAL_PAUSED                        = 1,
00225     NM_AUDIO_TRANSFERRING                        = 3,
00226 } NM_AUDIO_STATE;
00227
00228 typedef enum tagNmAudProp{
00229     NM_AUDPROP_LEVEL                             = 1,
00230     NM_AUDPROP_PAUSE                             = 2,
00231 } NM_AUDPROP;
00232
00233 typedef enum tagNmVideoState{
00234     NM_VIDEO_IDLE                                = 0,
00235     NM_VIDEO_LOCAL_PAUSED                        = 1,
00236     NM_VIDEO_PREVIEWING                          = 2,
00237     NM_VIDEO_TRANSFERRING                        = 3,
00238     NM_VIDEO_BOTH_PAUSED                         = 5,
00239     NM_VIDEO_REMOTE_PAUSED                       = 7,
00240 } NM_VIDEO_STATE;
00241
00242 typedef enum tagNmVidProp{
00243     NM_VIDPROP_PAUSE                             = 1,
00244     NM_VIDPROP_WINDOW_AUTO_SIZE                  = 2,
00245     NM_VIDPROP_WINDOW_SIZE                       = 3,
00246     NM_VIDPROP_WINDOW_POSITION                   = 4,
00247     NM_VIDPROP_WINDOW_TOP_MOST                   = 5,
00248     NM_VIDPROP_WINDOW_VISIBLE                    = 6,
00249     NM_VIDPROP_IMAGE_PREFERRED_SIZE              = 7,
00250     NM_VIDPROP_IMAGE_QUALITY                     = 8,
00251     NM_VIDPROP_CAMERA_DIALOG                     = 9,
00252 } NM_VIDPROP;
00253
00254 typedef enum tagNmShareState{
00255     NM_SHARE_UNKNOWN                             = 0,
00256     NM_SHARE_WORKING_ALONE                       = 1,
00257     NM_SHARE_COLLABORATING                       = 2,
00258     NM_SHARE_IN_CONTROL                          = 3,
00259 } NM_SHARE_STATE;
00260
00261 typedef enum tagNmShAppState{
00262     NM_SHAPP_NOT_SHARED                          = 0,
00263     NM_SHAPP_SHARED                              = 1,
00264 } NM_SHAPP_STATE;
00265
00266 typedef enum tagNmSysProp{
00267     NM_SYSPROP_EMAIL_NAME                        = 1,
00268     NM_SYSPROP_SERVER_NAME                       = 2,
00269     NM_SYSPROP_RESOLVE_NAME                      = 3,
00270     NM_SYSPROP_FIRST_NAME                        = 4,
00271     NM_SYSPROP_LAST_NAME                         = 5,
00272     NM_SYSPROP_USER_NAME                         = 6,
00273     NM_SYSPROP_USER_CITY                         = 7,
00274     NM_SYSPROP_USER_COUNTRY                      = 8,
00275     NM_SYSPROP_USER_COMMENTS                     = 9,
00276     NM_SYSPROP_USER_CATEGORY                     = 10,
00277     NM_SYSPROP_USER_PHONENUM                     = 11,
00278     NM_SYSPROP_USER_LOCATION                     = 12,
00279     NM_SYSPROP_H323_GATEWAY                      = 20,
00280     NM_SYSPROP_H323_GATEWAY_ENABLE               = 21,
00281     NM_SYSPROP_INSTALL_DIRECTORY                 = 50,
00282     NM_SYSPROP_APP_NAME                          = 51,
00283     NM_SYSPROP_LOGGED_ON                         = 69,
00284     NM_SYSPROP_IS_RUNNING                        = 100,
00285     NM_SYSPROP_IN_CONFERENCE                     = 101,
00286   NM_SYSPROP_BUILD_VER             = 200,
00287   NM_SYSPROP_DISABLE_H323            = 201,
00288   NM_SYSPROP_DISABLE_INITIAL_ILS_LOGON     = 202
00289 } NM_SYSPROP;
00290
00291 typedef enum tagConfn{
00292
00293 // File Transfer
00294     CONFN_FT_UI                                  = 0x000211,
00295     CONFN_FT_OFFERED                             = 0x000212,
00296     CONFN_FT_STARTED                             = 0x000213,
00297     CONFN_FT_PROGRESS                            = 0x000214,
00298     CONFN_FT_COMPLETE                            = 0x000215,
00299     CONFN_FT_CANCELED                            = 0x000216,
00300 // Sharing
00301     CONFN_CLICK_CONTROL                          = 0x000220,
00302     CONFN_CLICK_OBSCURE                          = 0x000221,
00303     CONFN_CLICK_REMOTE_NOT_COLLABORATING         = 0x000222,
00304     CONFN_CLICK_LOCAL_NOT_COLLABORATING          = 0x000223,
00305
00306 // Call control
00307     CONFN_CALL_INCOMPATIBLE                      = 0x000400,
00308     CONFN_CALL_OLDER                             = 0x000401,
00309     CONFN_CALL_NEWER                             = 0x000402,
00310     CONFN_CALL_IGNORED                           = 0x000403,
00311     CONFN_CALL_FAILED                            = 0x000404,
00312     CONFN_CALL_IN_CONFERENCE                     = 0x000405,
00313
00314 // Manager notifications
00315     CONFN_NM_STARTED                             = 0x000600,
00316     CONFN_NM_STOPPED                             = 0x000601,
00317
00318 } CONFN;
00319
00320
00321
00322 // INmObject constants
00323 typedef enum NM_APPID {
00324   NM_APPID_CHAT       = 1,
00325   NM_APPID_WHITEBOARD     = 2,
00326   NM_APPID_T126_WHITEBOARD  = 3,
00327   NM_APPID_FILE_TRANSFER    = 4,
00328   NM_APPID_APPSHARING     = 5
00329
00330 } NM_APPID;
00331
00332 typedef enum NM_VUI {
00333   NM_VUI_CHECK = 0,
00334   NM_VUI_SHOW = 1
00335 } NM_VUI;
00336
00337 //--------------------------------------------------------------------------
00338 // INmManager Interface
00339 [
00340     object,
00341     uuid(068B0701-718C-11d0-8B1A-00A0C91BC90E),
00342     pointer_default(unique)
00343 ]
00344 interface INmManager : IUnknown
00345 {
00346     typedef [unique] INmManager *LPNMMANAGER;
00347
00348   [local]
00349     HRESULT Initialize(
00350         [in, out] ULONG * puOptions, // Can be NULL
00351         [in, out] ULONG * puchCaps); // Can be NULL
00352
00353   [call_as(Initialize)]
00354   HRESULT RemoteInitialize(
00355     [in, out] ULONG * puOptions,
00356         [in, out] ULONG * puchCaps);
00357
00358     HRESULT GetSysInfo(
00359         [out] INmSysInfo **ppSysInfo);
00360
00361     HRESULT EnumConference(
00362         [out] IEnumNmConference **ppEnum);
00363
00364   [local]
00365     HRESULT CreateConference(
00366         [out] INmConference **ppConference,
00367         [in] BSTR bstrName,
00368         [in] BSTR bstrPassword,
00369         [in] ULONG uchCaps);
00370
00371   [call_as(CreateConference)]
00372     HRESULT RemoteCreateConference(
00373         [out] INmConference **ppConference,
00374         [in] BSTR bstrName,
00375         [in] BSTR bstrPassword,
00376         [in] ULONG uchCaps);
00377
00378
00379     HRESULT EnumCall(
00380         [out] IEnumNmCall **ppEnum);
00381
00382   [local]
00383     HRESULT CreateCall(
00384         [out] INmCall **ppCall,   // Can be NULL
00385         [in] NM_CALL_TYPE callType,
00386         [in] NM_ADDR_TYPE addrType,
00387         [in] BSTR bstrAddr,
00388         [in] INmConference * pConference);
00389
00390   [call_as(CreateCall)]
00391     HRESULT RemoteCreateCall(
00392         [out] INmCall **ppCall,
00393         [in] NM_CALL_TYPE callType,
00394         [in] NM_ADDR_TYPE addrType,
00395         [in] BSTR bstrAddr,
00396         [in] INmConference * pConference);
00397
00398   [local]
00399     HRESULT CallConference(
00400         [out] INmCall **ppCall,
00401         [in] NM_CALL_TYPE callType,
00402         [in] NM_ADDR_TYPE addrType,
00403         [in] BSTR bstrAddr,
00404         [in] BSTR bstrName,
00405         [in] BSTR bstrPassword);
00406
00407   [call_as(CallConference)]
00408     HRESULT RemoteCallConference(
00409         [out] INmCall **ppCall,
00410         [in] NM_CALL_TYPE callType,
00411         [in] NM_ADDR_TYPE addrType,
00412         [in] BSTR bstrAddr,
00413         [in] BSTR bstrName,
00414         [in] BSTR bstrPassword);
00415
00416 }
00417
00418 //--------------------------------------------------------------------------
00419 // INmManagerNotify Interface
00420 [
00421     object,
00422     uuid(068B0702-718C-11d0-8B1A-00A0C91BC90E),
00423     pointer_default(unique)
00424 ]
00425 interface INmManagerNotify : IUnknown
00426 {
00427     typedef [unique] INmManagerNotify *LPNMMANAGERNOTIFY;
00428
00429     HRESULT NmUI(
00430         [in] CONFN uNotify);
00431
00432     HRESULT ConferenceCreated(
00433         [in] INmConference *pConference);
00434
00435     HRESULT CallCreated(
00436         [in] INmCall *pCall);
00437 }
00438
00439
00440 //--------------------------------------------------------------------------
00441 // INmSysInfo Interface
00442 [
00443   local,
00444     object,
00445     uuid(068B0703-718C-11d0-8B1A-00A0C91BC90E),
00446     pointer_default(unique)
00447 ]
00448 interface INmSysInfo : IUnknown
00449 {
00450     typedef [unique] INmSysInfo *LPNMSYSINFO;
00451
00452     HRESULT IsInstalled(
00453         void);
00454
00455     HRESULT GetProperty(
00456         [in] NM_SYSPROP uProp,
00457         [out] BSTR *pbstrName);
00458
00459     HRESULT SetProperty(
00460         [in] NM_SYSPROP uProp,
00461         [in] BSTR bstrName);
00462
00463     HRESULT GetUserData(
00464         [in] REFGUID rguid,
00465         [out] BYTE **ppb,
00466         [out] ULONG *pcb);
00467
00468     HRESULT SetUserData(
00469         [in] REFGUID rguid,
00470         [in] BYTE *pb,
00471         [in] ULONG cb);
00472
00473     HRESULT GetNmApp(
00474         [in] REFGUID rguid,
00475         [out] BSTR *pbstrApplication,
00476         [out] BSTR *pbstrCommandLine,
00477         [out] BSTR *pbstrDirectory);
00478
00479     HRESULT SetNmApp(
00480         [in] REFGUID rguid,
00481         [in] BSTR bstrApplication,
00482         [in] BSTR bstrCommandLine,
00483         [in] BSTR bstrDirectory);
00484
00485     HRESULT GetNmchCaps(
00486         [out] ULONG *pchCaps);
00487
00488     HRESULT GetLaunchInfo(
00489         [out] INmConference **ppConference, // Can be NULL
00490         [out] INmMember **ppMember);    // Can be NULL
00491
00492 }
00493
00494
00495 //--------------------------------------------------------------------------
00496 // INmCall Interface
00497 [
00498     object,
00499     uuid(068B0704-718C-11d0-8B1A-00A0C91BC90E),
00500     pointer_default(unique)
00501 ]
00502 interface INmCall : IUnknown
00503 {
00504     typedef [unique] INmCall *LPNMCALL;
00505
00506     HRESULT IsIncoming(
00507         void);
00508
00509     HRESULT GetState(
00510         [out] NM_CALL_STATE *pState);
00511
00512     HRESULT GetName(
00513         [out] BSTR *pbstrName);
00514
00515     HRESULT GetAddr(
00516         [out] BSTR *pbstrAddr,
00517         [out] NM_ADDR_TYPE *puType);
00518
00519     HRESULT GetUserData(
00520         [in] REFGUID rguid,
00521         [out, size_is(,*pcb)] BYTE **ppb,
00522         [out] ULONG *pcb);
00523
00524     HRESULT GetConference(
00525         [out] INmConference **ppConference);
00526
00527     HRESULT Accept(
00528         void);
00529
00530     HRESULT Reject(
00531         void);
00532
00533     HRESULT Cancel(
00534         void);
00535 }
00536
00537 //--------------------------------------------------------------------------
00538 // INmCallNotify Interface
00539 [
00540     object,
00541     uuid(068B0705-718C-11d0-8B1A-00A0C91BC90E),
00542     pointer_default(unique)
00543 ]
00544 interface INmCallNotify : IUnknown
00545 {
00546     HRESULT NmUI(
00547         [in] CONFN uNotify);
00548
00549     HRESULT StateChanged(
00550         [in] NM_CALL_STATE uState);
00551
00552     HRESULT Failed(
00553         [in] ULONG uError);
00554
00555     HRESULT Accepted(
00556         [in] INmConference *pConference);
00557 }
00558
00559 //--------------------------------------------------------------------------
00560 // INmConference Interface
00561 [
00562     object,
00563     uuid(068B0710-718C-11d0-8B1A-00A0C91BC90E),
00564     pointer_default(unique)
00565 ]
00566 interface INmConference : IUnknown
00567 {
00568     typedef [unique] INmConference *LPNMCONFERENCE;
00569
00570     HRESULT GetName(
00571         [out] BSTR *pbstrName);
00572
00573     HRESULT GetID(
00574         [out] ULONG *puID);
00575
00576     HRESULT GetState(
00577         [out] NM_CONFERENCE_STATE *pState);
00578
00579     HRESULT GetNmchCaps(
00580         [out] ULONG *puchCaps);
00581
00582     HRESULT GetTopProvider(
00583         [out] INmMember **ppMember);
00584
00585     HRESULT EnumMember(
00586         [out] IEnumNmMember **ppEnum);
00587
00588     HRESULT GetMemberCount(
00589         [out] ULONG * puCount);
00590
00591     HRESULT EnumChannel(
00592         [out] IEnumNmChannel **ppEnum);
00593
00594     HRESULT GetChannelCount(
00595         [out] ULONG * puCount);
00596
00597   [local]
00598     HRESULT CreateDataChannel(
00599         [out] INmChannelData **ppChannel, // Can be NULL
00600         [in] REFGUID rguid);
00601
00602   [call_as(CreateDataChannel)]
00603     HRESULT RemoteCreateDataChannel(
00604         [out] INmChannelData **ppChannel,
00605         [in] REFGUID rguid);
00606
00607
00608     HRESULT IsHosting(
00609         void);
00610
00611     HRESULT Host(
00612         void);
00613
00614     HRESULT Leave(
00615         void);
00616
00617     HRESULT LaunchRemote(
00618         [in] REFGUID rguid,
00619         [in] INmMember *pMember);
00620 }
00621
00622 //--------------------------------------------------------------------------
00623 // INmConferenceNotify Interface
00624 [
00625     object,
00626     uuid(068B0711-718C-11d0-8B1A-00A0C91BC90E),
00627     pointer_default(unique)
00628 ]
00629 interface INmConferenceNotify : IUnknown
00630 {
00631     HRESULT NmUI(
00632         [in] CONFN uNotify);
00633
00634     HRESULT StateChanged(
00635         [in] NM_CONFERENCE_STATE uState);
00636
00637     HRESULT MemberChanged(
00638         [in] NM_MEMBER_NOTIFY uNotify,
00639         [in] INmMember *pMember);
00640
00641     HRESULT ChannelChanged(
00642         [in] NM_CHANNEL_NOTIFY uNotify,
00643         [in] INmChannel *pChannel);
00644 }
00645
00646 //--------------------------------------------------------------------------
00647 // INmMember Interface
00648 [
00649     object,
00650     uuid(068B0712-718C-11d0-8B1A-00A0C91BC90E),
00651     pointer_default(unique)
00652 ]
00653 interface INmMember : IUnknown
00654 {
00655     HRESULT GetName(
00656         [out] BSTR *pbstrName);
00657
00658     HRESULT GetID(
00659         [out] ULONG *puID);
00660
00661     HRESULT GetNmVersion(
00662         [out] ULONG *puVersion);
00663
00664     HRESULT GetAddr(
00665         [out] BSTR *pbstrAddr,
00666         [out] NM_ADDR_TYPE *puType);
00667
00668     HRESULT GetUserData(
00669         [in] REFGUID rguid,
00670         [out, size_is(,*pcb)] BYTE **ppb,
00671         [out] ULONG *pcb);
00672
00673     HRESULT GetConference(
00674         [out] INmConference **ppConference);
00675
00676     HRESULT GetNmchCaps(
00677         [out] ULONG *puchCaps);
00678
00679     HRESULT GetShareState(
00680         [out] NM_SHARE_STATE *puState);
00681
00682     HRESULT IsSelf(
00683         void);
00684
00685     HRESULT IsMCU(
00686         void);
00687
00688     HRESULT Eject(
00689         void);
00690 }
00691
00692
00693 //--------------------------------------------------------------------------
00694 // INmChannel Interface
00695 [
00696     object,
00697     uuid(068B0720-718C-11d0-8B1A-00A0C91BC90E),
00698     pointer_default(unique)
00699 ]
00700 interface INmChannel : IUnknown
00701 {
00702     HRESULT IsSameAs(
00703         [in] INmChannel *pChannel);
00704
00705     HRESULT IsActive(
00706         void);
00707
00708     HRESULT SetActive(
00709         [in] BOOL fActive);
00710
00711     HRESULT GetConference(
00712         [out] INmConference **ppConference);
00713
00714     HRESULT GetInterface(
00715         [out] IID *piid);
00716
00717     HRESULT GetNmch(
00718         [out] ULONG *puCh);
00719
00720     HRESULT EnumMember(
00721         [out] IEnumNmMember **ppEnum);
00722
00723     HRESULT GetMemberCount(
00724         [out] ULONG * puCount);
00725 }
00726
00727
00728 //--------------------------------------------------------------------------
00729 // INmChannelNotify Interface
00730 [
00731     object,
00732     uuid(068B0721-718C-11d0-8B1A-00A0C91BC90E),
00733     pointer_default(unique)
00734 ]
00735 interface INmChannelNotify : IUnknown
00736 {
00737     HRESULT NmUI(
00738         [in] CONFN uNotify);
00739
00740     HRESULT MemberChanged(
00741         [in] NM_MEMBER_NOTIFY uNotify,
00742         [in] INmMember *pMember);
00743 }
00744
00745
00746 //--------------------------------------------------------------------------
00747 // INmChannelData Interface
00748 [
00749     object,
00750     uuid(068B0722-718C-11d0-8B1A-00A0C91BC90E),
00751     pointer_default(unique)
00752 ]
00753 interface INmChannelData : INmChannel
00754 {
00755     HRESULT GetGuid(
00756         [out] GUID *pguid);
00757
00758     HRESULT SendData(
00759         [in] INmMember *pMember,
00760         [in] ULONG uSize,
00761         [in, size_is(uSize)] byte *pvBuffer,
00762         [in] ULONG uOptions);
00763 }
00764
00765
00766 //--------------------------------------------------------------------------
00767 // INmChannelDataNotify Interface
00768 [
00769     object,
00770     uuid(068B0723-718C-11d0-8B1A-00A0C91BC90E),
00771     pointer_default(unique)
00772 ]
00773 interface INmChannelDataNotify : INmChannelNotify
00774 {
00775     HRESULT DataSent(
00776         [in] INmMember *pMember,
00777         [in] ULONG uSize,
00778         [in, size_is(uSize)] byte *pvBuffer);
00779
00780     HRESULT DataReceived(
00781         [in] INmMember *pMember,
00782         [in] ULONG uSize,
00783         [in, size_is(uSize)] byte *pvBuffer,
00784         [in] ULONG dwFlags);
00785 }
00786
00787
00788 //--------------------------------------------------------------------------
00789 // INmChannelAudio Interface
00790 [
00791     object,
00792     uuid(068B0724-718C-11d0-8B1A-00A0C91BC90E),
00793     pointer_default(unique)
00794 ]
00795 interface INmChannelAudio : INmChannel
00796 {
00797     HRESULT IsIncoming(
00798         void);
00799
00800     HRESULT GetState(
00801         [out] NM_AUDIO_STATE *puState);
00802
00803     HRESULT GetProperty(
00804         [in] NM_AUDPROP uID,
00805         [out] ULONG *puValue);
00806
00807     HRESULT SetProperty(
00808         [in] NM_AUDPROP uID,
00809         [in] ULONG uValue);
00810 }
00811
00812 //--------------------------------------------------------------------------
00813 // INmChannelAudioNotify Interface
00814 [
00815     object,
00816     uuid(068B0725-718C-11d0-8B1A-00A0C91BC90E),
00817     pointer_default(unique)
00818 ]
00819 interface INmChannelAudioNotify : INmChannelNotify
00820 {
00821     HRESULT StateChanged(
00822         [in] NM_AUDIO_STATE uState);
00823
00824     HRESULT PropertyChanged(
00825         [in] DWORD dwReserved);
00826 }
00827
00828
00829 //--------------------------------------------------------------------------
00830 // INmChannelVideo Interface
00831 [
00832     object,
00833     uuid(068B0726-718C-11d0-8B1A-00A0C91BC90E),
00834     pointer_default(unique)
00835 ]
00836 interface INmChannelVideo : INmChannel
00837 {
00838     HRESULT IsIncoming(
00839         void);
00840
00841     HRESULT GetState(
00842         [out] NM_VIDEO_STATE *puState);
00843
00844     HRESULT GetProperty(
00845         [in] NM_VIDPROP uID,
00846         [out] ULONG *puValue);
00847
00848     HRESULT SetProperty(
00849         [in] NM_VIDPROP uID,
00850         [in] ULONG uValue);
00851 }
00852
00853
00854 //--------------------------------------------------------------------------
00855 // INmChannelVideoNotify Interface
00856 [
00857     object,
00858     uuid(068B0727-718C-11d0-8B1A-00A0C91BC90E),
00859     pointer_default(unique)
00860 ]
00861 interface INmChannelVideoNotify : INmChannelNotify
00862 {
00863     HRESULT StateChanged(
00864         [in] NM_VIDEO_STATE uState);
00865
00866     HRESULT PropertyChanged(
00867         [in] DWORD dwReserved);
00868 }
00869
00870
00871
00872
00873 //--------------------------------------------------------------------------
00874 // INmChannelFt Interface
00875 [
00876     object,
00877     uuid(068B0728-718C-11d0-8B1A-00A0C91BC90E),
00878     pointer_default(unique)
00879 ]
00880 interface INmChannelFt : INmChannel
00881 {
00882   [local]
00883     HRESULT SendFile(
00884         [out] INmFt **ppFt,     // Can be NULL
00885         [in] INmMember *pMember,
00886         [in] BSTR bstrFile,
00887         [in] ULONG uOptions);
00888
00889   [call_as(SendFile)]
00890     HRESULT RemoteSendFile(
00891         [out] INmFt **ppFt,
00892         [in] INmMember *pMember,
00893         [in] BSTR bstrFile,
00894         [in] ULONG uOptions);
00895
00896
00897   [local]
00898     HRESULT SetReceiveFileDir(
00899         [in] BSTR bstrDir);
00900
00901   [call_as(SetReceiveFileDir)]
00902     HRESULT RemoteSetReceiveFileDir(
00903         [in] BSTR bstrDir);
00904
00905     HRESULT GetReceiveFileDir(
00906         [out] BSTR *pbstrDir);
00907 }
00908
00909
00910 //--------------------------------------------------------------------------
00911 // INmChannelFtNotify Interface
00912 [
00913     object,
00914     uuid(068B0729-718C-11d0-8B1A-00A0C91BC90E),
00915     pointer_default(unique)
00916 ]
00917 interface INmChannelFtNotify : INmChannelNotify
00918 {
00919     HRESULT FtUpdate(
00920         [in] CONFN uNotify,
00921         [in] INmFt *pFt);
00922 }
00923
00924
00925 //--------------------------------------------------------------------------
00926 // INmFt Interface
00927 [
00928     object,
00929     uuid(068B0732-718C-11d0-8B1A-00A0C91BC90E),
00930     pointer_default(unique)
00931 ]
00932 interface INmFt : IUnknown
00933 {
00934     HRESULT IsIncoming(
00935         void);
00936
00937     HRESULT GetState(
00938         [out] NM_FT_STATE *puState);
00939
00940     HRESULT GetName(
00941         [out] BSTR *pbstrName);
00942
00943     HRESULT GetSize(
00944         [out] ULONG *puBytes);
00945
00946     HRESULT GetBytesTransferred(
00947         [out] ULONG *puBytes);
00948
00949     HRESULT GetMember(
00950         [out] INmMember **ppMember);
00951
00952     HRESULT Cancel(
00953         void);
00954 }
00955
00956
00957 //--------------------------------------------------------------------------
00958 // INmChannelAppShare Interface
00959 [
00960     object,
00961     uuid(068B072A-718C-11d0-8B1A-00A0C91BC90E),
00962     pointer_default(unique)
00963 ]
00964 interface INmChannelAppShare : INmChannel
00965 {
00966     HRESULT GetState(
00967         [out] NM_SHARE_STATE *puState);
00968
00969     HRESULT SetState(
00970         [in] NM_SHARE_STATE uState);
00971
00972     HRESULT EnumSharableApp(
00973         [out] IEnumNmSharableApp **ppEnum);
00974 }
00975
00976 //--------------------------------------------------------------------------
00977 // INmChannelAppShareNotify Interface
00978 [
00979     object,
00980     uuid(068B072B-718C-11d0-8B1A-00A0C91BC90E),
00981     pointer_default(unique)
00982 ]
00983 interface INmChannelAppShareNotify : INmChannelNotify
00984 {
00985     HRESULT StateChanged(
00986         [in] NM_SHAPP_STATE uState,
00987         [in] INmSharableApp *pApp);
00988 }
00989
00990
00991 //--------------------------------------------------------------------------
00992 // INmSharableApp Interface
00993 [
00994     object,
00995     uuid(068B0734-718C-11d0-8B1A-00A0C91BC90E),
00996     pointer_default(unique)
00997 ]
00998 interface INmSharableApp : IUnknown
00999 {
01000     HRESULT GetName(
01001         [out] BSTR *pbstrName);
01002
01003     HRESULT GetHwnd(
01004         [out] HWND * phwnd);
01005
01006      HRESULT GetState(
01007         [out] NM_SHAPP_STATE *puState);
01008
01009      HRESULT SetState(
01010         [in] NM_SHAPP_STATE uState);
01011 }
01012
01013
01014
01015 cpp_quote("")
01016 cpp_quote("////////////////////////////////////////////////////////////////////////////")
01017 cpp_quote("//  Enumerator Definitions")
01018
01019
01020 //--------------------------------------------------------------------------
01021 // IEnumNmConference Interface
01022 [
01023     object,
01024     uuid(068B0741-718C-11d0-8B1A-00A0C91BC90E),
01025     pointer_default(unique)
01026 ]
01027 interface IEnumNmConference : IUnknown
01028 {
01029   [local]
01030     HRESULT Next(
01031         [in] ULONG cConference,
01032         [out] INmConference **rgpConference,
01033         [out] ULONG *pcFetched);
01034
01035   [call_as(Next)]
01036     HRESULT RemoteNext(
01037         [in] ULONG cConference,
01038         [out, size_is(cConference), length_is(*pcFetched) ] INmConference **rgpConference,
01039         [out] ULONG *pcFetched,
01040     [out] ULONG *pcItems,
01041     [in] BOOL bGetNumberRemaining);
01042
01043     HRESULT Skip(
01044         [in] ULONG cConference);
01045
01046     HRESULT Reset();
01047
01048     HRESULT Clone(
01049         [out] IEnumNmConference **ppEnum);
01050 }
01051
01052
01053 //--------------------------------------------------------------------------
01054 // IEnumNmMember Interface
01055 [
01056     object,
01057     uuid(068B0742-718C-11d0-8B1A-00A0C91BC90E),
01058     pointer_default(unique)
01059 ]
01060 interface IEnumNmMember : IUnknown
01061 {
01062   [local]
01063     HRESULT Next(
01064         [in] ULONG cMember,
01065         [out] INmMember **rgpMember,
01066         [out] ULONG *pcFetched);
01067
01068   [call_as(Next)]
01069     HRESULT RemoteNext(
01070         [in] ULONG cMember,
01071         [out, size_is(cMember), length_is(*pcFetched) ] INmMember **rgpMember,
01072         [out] ULONG *pcFetched,
01073     [out] ULONG *pcItems,
01074     [in] BOOL bGetNumberRemaining);
01075
01076     HRESULT Skip(
01077         [in] ULONG cMember);
01078
01079     HRESULT Reset();
01080
01081     HRESULT Clone(
01082         [out] IEnumNmMember **ppEnum);
01083 }
01084
01085
01086 //--------------------------------------------------------------------------
01087 // IEnumNmChannel Interface
01088 [
01089     object,
01090     uuid(068B0743-718C-11d0-8B1A-00A0C91BC90E),
01091     pointer_default(unique)
01092 ]
01093 interface IEnumNmChannel : IUnknown
01094 {
01095   [local]
01096     HRESULT Next(
01097         [in] ULONG cChannel,
01098         [out, size_is(cChannel), length_is(*pcFetched)] INmChannel **rgpChannel,
01099         [out] ULONG *pcFetched);
01100
01101   [call_as(Next)]
01102     HRESULT RemoteNext(
01103         [in] ULONG cChannel,
01104         [out, size_is(cChannel), length_is(*pcFetched)] INmChannel **rgpChannel,
01105         [out] ULONG *pcFetched,
01106     [out] ULONG *pcItems,
01107     [in] BOOL bGetNumberRemaining);
01108
01109     HRESULT Skip(
01110         [in] ULONG cChannel);
01111
01112     HRESULT Reset();
01113
01114     HRESULT Clone(
01115         [out] IEnumNmChannel **ppEnum);
01116 }
01117
01118
01119 //--------------------------------------------------------------------------
01120 // IEnumNmCall Interface
01121 [
01122     object,
01123     uuid(068B0744-718C-11d0-8B1A-00A0C91BC90E),
01124     pointer_default(unique)
01125 ]
01126 interface IEnumNmCall : IUnknown
01127 {
01128   [local]
01129   HRESULT Next(
01130         [in] ULONG cCall,
01131         [out] INmCall **rgpCall,
01132         [out] ULONG *pcFetched);
01133
01134   [call_as(Next)]
01135     HRESULT RemoteNext(
01136         [in] ULONG cCall,
01137         [out, size_is(cCall), length_is(*pcFetched)] INmCall **rgpCall,
01138         [out] ULONG *pcFetched,
01139     [out] ULONG *pcItems,
01140     [in] BOOL bGetNumberRemaining);
01141
01142     HRESULT Skip(
01143         [in] ULONG cCall);
01144
01145     HRESULT Reset();
01146
01147     HRESULT Clone(
01148         [out] IEnumNmCall **ppEnum);
01149 }
01150
01151
01152 //--------------------------------------------------------------------------
01153 // IEnumNmSharableApp Interface
01154 [
01155     object,
01156     uuid(068B0745-718C-11d0-8B1A-00A0C91BC90E),
01157     pointer_default(unique)
01158 ]
01159 interface IEnumNmSharableApp : IUnknown
01160 {
01161   [local]
01162     HRESULT Next(
01163         [in] ULONG cApp,
01164         [out] INmSharableApp **rgpApp,
01165         [out] ULONG *pcFetched);
01166
01167   [call_as(Next)]
01168     HRESULT RemoteNext(
01169         [in] ULONG cApp,
01170         [out, size_is(cApp), length_is(*pcFetched)] INmSharableApp **rgpApp,
01171         [out] ULONG *pcFetched,
01172     [out] ULONG *pcItems,
01173     [in] BOOL bGetNumberRemaining);
01174
01175     HRESULT Skip(
01176         [in] ULONG cApp);
01177
01178     HRESULT Reset();
01179
01180     HRESULT Clone(
01181         [out] IEnumNmSharableApp **ppEnum);
01182 }
01183
01184 [
01185   object,
01186   uuid(068B0780-718C-11d0-8B1A-00A0C91BC90E), // IID_INmObject
01187   pointer_default(unique)
01188 ]
01189 interface INmObject : IUnknown
01190 {
01191   HRESULT CallDialog([in] long hwnd, [in] int options);
01192
01193   HRESULT ShowLocal([in] NM_APPID appId);
01194
01195   [local]
01196   HRESULT VerifyUserInfo([in] long hwnd, [in] NM_VUI options);
01197
01198   [call_as(VerifyUserInfo)]
01199   HRESULT RemoteVerifyUserInfo([in] long hwnd, [in] NM_VUI options);
01200
01201 };
01202
01203 [
01204     uuid(068B07FF-718C-11d0-8B1A-00A0C91BC90E),
01205     version(1.0),
01206     helpstring("NmManager 2.0 Type Library")
01207 ]
01208 library NmManager
01209 {
01210
01211     [
01212         uuid(068B0700-718C-11d0-8B1A-00A0C91BC90E),
01213         helpstring("NetMeeting Manager")
01214     ]
01215     coclass NmManager
01216     {
01217         [default] interface INmManager;
01218     };
01219 };
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/stdafx.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

stdafx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__B14C8EA8_3632_11D3_AC81_00C04F8DB3D5__INCLUDED_)
00006 #define AFX_STDAFX_H__B14C8EA8_3632_11D3_AC81_00C04F8DB3D5__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 #define _ATL_DEBUG_QI
00012 // When the OLEDB_SERVICES key is set to -1 it is assumed that the Provider
00013 // supports Aggregation.
00014 // With _ATL_DEBUG_INTERFACES -
00015 // _QIThunk::Release does not handle the aggregated release properly. Hence,
00016 // do not use _ATL_DEBUG_INTERFACES with the OLEDB_SERVICES key set to -1
00017
00018 //#define _ATL_DEBUG_INTERFACES
00019
00020 #define STRICT
00021 #ifndef _WIN32_WINNT
00022 #define _WIN32_WINNT 0x0400
00023 #endif
00024 #define _ATL_APARTMENT_THREADED
00025
00026 #include <atlbase.h>
00027 //You may derive a class from CComModule and use it if you want to override
00028 //something, but do not change the name of _Module
00029 extern CComModule _Module;
00030 #include <atlcom.h>
00031 #include <atlctl.h>
00032 #include <atldb.h>
00033 #include <stdio.h> // for FILE operations
00034
00035 //{{AFX_INSERT_LOCATION}}
00036 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00037
00038 #endif // !defined(AFX_STDAFX_H__B14C8EA8_3632_11D3_AC81_00C04F8DB3D5__INCLUDED)
00039
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/Dimmer.cpp Source File

  • NetDS
  • upnp
  • StepByStep
  • Step2

Dimmer.cpp

Go to the documentation of this file.
00001 // Dimmer.cpp : Implementation of CDimmer
00002 #include "stdafx.h"
00003 #include "MyDevice.h"
00004 #include "Dimmer.h"
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // CDimmer
00008
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/iec.Cpp Source File

  • Com
  • Fundamentals
  • SimpSvr

iec.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: IEC.CPP
00003 //
00004 //    Implementation file for the CExternalConnection Class
00005 //
00006 // Functions:
00007 //
00008 //    See iec.h for a list of member functions.
00009 //
00010 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "obj.h"
00015 #include "iec.h"
00016 #include "app.h"
00017 #include "doc.h"
00018
00019
00020 //**********************************************************************
00021 //
00022 // CExternalConnection::QueryInterface
00023 //
00024 // Purpose:
00025 //
00026 //
00027 // Parameters:
00028 //
00029 //      REFIID riid         -   Interface being queried for.
00030 //
00031 //      LPVOID FAR *ppvObj  -   Out pointer for the interface.
00032 //
00033 // Return Value:
00034 //
00035 //      S_OK            - Success
00036 //      E_NOINTERFACE   - Failure
00037 //
00038 // Function Calls:
00039 //      Function                    Location
00040 //
00041 //      CSimpSvrObj::QueryInterface OBJ.CPP
00042 //
00043 // Comments:
00044 //
00045 //
00046 //********************************************************************
00047
00048 STDMETHODIMP CExternalConnection::QueryInterface (REFIID riid, LPVOID FAR* ppvObj)
00049 {
00050   OutputDebugString("In CExternalConnection::QueryInterface\r\n");
00051
00052   return m_lpObj->QueryInterface(riid, ppvObj);
00053 }
00054
00055
00056 //**********************************************************************
00057 //
00058 // CExternalConnection::AddRef
00059 //
00060 // Purpose:
00061 //
00062 //      Increments the reference count on CExternalConnection and the "object"
00063 //      object.
00064 //
00065 // Parameters:
00066 //
00067 //      None
00068 //
00069 // Return Value:
00070 //
00071 //      The Reference count on the Object.
00072 //
00073 // Function Calls:
00074 //      Function                    Location
00075 //
00076 //      OuputDebugString            Windows API
00077 //      CSimpSvrObj::AddRef         OBJ.CPP
00078 //
00079 // Comments:
00080 //
00081 //
00082 //********************************************************************
00083
00084 STDMETHODIMP_(ULONG) CExternalConnection::AddRef ()
00085 {
00086   OutputDebugString("In CExternalConnection::AddRef\r\n");
00087   ++m_nCount;
00088   return m_lpObj->AddRef();
00089 };
00090
00091 //**********************************************************************
00092 //
00093 // CExternalConnection::Release
00094 //
00095 // Purpose:
00096 //
00097 //      Decrements the reference count of COleObject and the
00098 //      "object" object.
00099 //
00100 // Parameters:
00101 //
00102 //      None
00103 //
00104 // Return Value:
00105 //
00106 //      The new reference count
00107 //
00108 // Function Calls:
00109 //      Function                    Location
00110 //
00111 //      OutputDebugString           Windows API
00112 //      CSimpSvrObj::Release        OBJ.CPP
00113 //
00114 // Comments:
00115 //
00116 //
00117 //********************************************************************
00118
00119
00120 STDMETHODIMP_(ULONG) CExternalConnection::Release ()
00121 {
00122   OutputDebugString("In CExternalConnection::Release\r\n");
00123   --m_nCount;
00124   return m_lpObj->Release();
00125 };
00126
00127
00128
00129 //**********************************************************************
00130 //
00131 // CExternalConnection::AddConnection
00132 //
00133 // Purpose:
00134 //
00135 //      Called when another connection is made to the object.
00136 //
00137 // Parameters:
00138 //
00139 //      DWORD extconn   -   Type of connection
00140 //
00141 //      DWORD reserved  -   Reserved
00142 //
00143 // Return Value:
00144 //
00145 //      Strong connection count
00146 //
00147 // Function Calls:
00148 //      Function                    Location
00149 //
00150 //      OutputDebugString           Windows API
00151 //
00152 // Comments:
00153 //
00154 //
00155 //********************************************************************
00156
00157 STDMETHODIMP_(DWORD) CExternalConnection::AddConnection (DWORD extconn, DWORD reserved)
00158 {
00159   OutputDebugString("In CExternalConnection::AddConnection\r\n");
00160
00161   if (extconn & EXTCONN_STRONG)
00162     return ++m_dwStrong;
00163
00164   return 0;
00165 }
00166
00167 //**********************************************************************
00168 //
00169 // CExternalConnection::ReleaseConnection
00170 //
00171 // Purpose:
00172 //
00173 //      Called when a connection to the object is released.
00174 //
00175 // Parameters:
00176 //
00177 //      DWORD extconn               - Type of Connection
00178 //
00179 //      DWORD reserved              - Reserved
00180 //
00181 //      BOOL fLastReleaseCloses     - Close flag
00182 //
00183 // Return Value:
00184 //
00185 //      The new reference count
00186 //
00187 // Function Calls:
00188 //      Function                    Location
00189 //
00190 //      OutputDebugString           Windows API
00191 //      COleObject::Close           IOO.CPP
00192 //
00193 // Comments:
00194 //
00195 //
00196 //********************************************************************
00197
00198 STDMETHODIMP_(DWORD) CExternalConnection::ReleaseConnection (DWORD extconn, DWORD reserved, BOOL fLastReleaseCloses)
00199 {
00200   OutputDebugString("In CExternalConnection::ReleaseConnection\r\n");
00201
00202   if (extconn & EXTCONN_STRONG)
00203     {
00204     DWORD dwSave = --m_dwStrong;
00205
00206     if (!m_dwStrong && fLastReleaseCloses)
00207       m_lpObj->m_OleObject.Close(OLECLOSE_SAVEIFDIRTY);
00208
00209     return dwSave;
00210     }
00211   return 0;
00212 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/guids.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

guids.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 // {A04E8E71-2D76-4967-901F-2CCFB5F91E21}
00016 DEFINE_GUID(CLSID_CComponentData,
00017       0xa04e8e71, 0x2d76, 0x4967, 0x90, 0x1f, 0x2c, 0xcf, 0xb5, 0xf9, 0x1e, 0x21);
00018
00019
00020 // {A04E8E73-2D76-4967-901F-2CCFB5F91E21}
00021 DEFINE_GUID(CLSID_CSnapinAbout,
00022       0xa04e8e73, 0x2d76, 0x4967, 0x90, 0x1f, 0x2c, 0xcf, 0xb5, 0xf9, 0x1e, 0x21);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/basedialog.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

basedialog.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  BaseDialog.cpp: implementation of the CBaseDialog class.
00014 //
00015
00016 #include "BaseDialog.h"
00017 #include "Globals.h"
00018
00019
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 // Construction/Destruction
00023
00024 //---------------------------------------------------------------------------
00025 CBaseDialog::CBaseDialog( ULONG nTemplate )
00026 {
00027   _ASSERT( NULL != nTemplate );
00028
00029   m_nTemplate = nTemplate;
00030   m_hWnd      = NULL;          // Handle returned by CreateDialogParam
00031   m_DlgProc   = (DLGPROC)DlgProc;       // Point to default dialog proc
00032   m_dwFlags   = 0;
00033 }
00034
00035 //---------------------------------------------------------------------------
00036 CBaseDialog::~CBaseDialog()
00037 {
00038 }
00039
00040 //---------------------------------------------------------------------------
00041 //  Use CreateDialogParam rather than CreateDialog so that we can later
00042 //  retrieve the 'this' pointer which we will need to point back to the
00043 //  particular instance of this class.
00044 //
00045 HWND CBaseDialog::Create
00046 (
00047   HINSTANCE  hInstance,      //[in] Global instance handle
00048   HWND       hWndParent,     //[in] Handle to parent window
00049   DWORD      dwFlags         //[in] Create flags - not used
00050 )
00051 {
00052   _ASSERT( NULL != hInstance );
00053
00054   m_dwFlags = dwFlags;
00055   m_hWnd = CreateDialogParam( hInstance,
00056                               MAKEINTRESOURCE(m_nTemplate),
00057                               hWndParent,
00058                               m_DlgProc,
00059                               (LPARAM)this
00060                             );
00061
00062   BOOL bReturn = ShowWindow( m_hWnd, SW_SHOW );  // Should return 0
00063
00064   return m_hWnd;
00065 }
00066
00067
00068 /////////////////////////////////////////////////////////////////////////////
00069 //  Message Handlers
00070
00071 //---------------------------------------------------------------------------
00072 LRESULT CBaseDialog::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
00073 {
00074   return 1;
00075 }
00076
00077 //---------------------------------------------------------------------------
00078 //  This is the first message sent by the DetroyWindow() function.
00079 //  It is sent after the window is removed from the screen, but it should
00080 //  be assumed that any child windows still exist.
00081 //
00082 LRESULT CBaseDialog::OnDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam )
00083 {
00084   return 1;
00085 }
00086
00087 //---------------------------------------------------------------------------
00088 //  This is sent after WM_DESTROY, and informs the app that the non-client
00089 //  area is being destroyed.  This is where allocated resources should be
00090 //  cleaned up.
00091 //
00092 LRESULT CBaseDialog::OnNcDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam )
00093 {
00094   m_hWnd = NULL;             // Since this is a modeless-only dialog
00095   delete this;               // class we delete ourselves here
00096
00097   return 1;
00098 }
00099
00100 //---------------------------------------------------------------------------
00101 LRESULT CBaseDialog::OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam )
00102 {
00103   return DestroyWindow( m_hWnd);
00104 }
00105
00106 //---------------------------------------------------------------------------
00107 LRESULT CBaseDialog::OnCancel( HWND hDlg, WPARAM wParam, LPARAM lParam )
00108 {
00109   return DestroyWindow( m_hWnd);
00110 }
00111
00112 //---------------------------------------------------------------------------
00113 LRESULT CBaseDialog::OnClose( HWND hDlg, WPARAM wParam, LPARAM lParam )
00114 {
00115   return DestroyWindow( m_hWnd);
00116 }
00117
00118
00119 /////////////////////////////////////////////////////////////////////////////
00120 //  Dialog Procedures
00121
00122 //---------------------------------------------------------------------------
00123 //  Since this is a static function we can't use a 'this' pointer or call
00124 //  the base class directly.  There may be multiple base classes using
00125 //  this method.  We get around this by storing the 'this' pointer in the
00126 //  lParam of CreateDialogParam.  When we get WM_INITDIALOG we get this
00127 //  pointer back in the lParam.  Now we can use SetWindowLongPtr to store
00128 //  it, and later retireve it with GetWindowLongPtr.  Once we have a
00129 //  valid 'this' pointer we can cast it back to the base class and then
00130 //  call the base class's ProcessMessage function.
00131 //
00132 BOOL CALLBACK CBaseDialog::DlgProc
00133 (
00134   HWND     hDlg,           //[in] Handle to dialog box
00135   UINT     uMsg,           //[in] Message
00136   WPARAM   wParam,         //[in] First message parameter
00137   LPARAM   lParam          //[in] Second message parameter
00138 )
00139 {
00140   BOOL bReturn = FALSE;
00141   if( WM_INITDIALOG == uMsg )
00142   {
00143     SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam);
00144   }
00145
00146   CBaseDialog* pThis = reinterpret_cast<CBaseDialog*>(GetWindowLongPtr(hDlg, GWLP_USERDATA));
00147   if( NULL != pThis )
00148   {
00149     bReturn = pThis->ProcessMessage( hDlg, uMsg, wParam, lParam );
00150   }
00151
00152   return bReturn;
00153 }
00154
00155 //---------------------------------------------------------------------------
00156 //  This is the instance specific method used to process messages.  The
00157 //  DialogProc delegates this responsibiliy to each instance of the class.
00158 //  This is a pure virtual function.  The code below is provided to cut
00159 //  and paste into the derived class's implementation.
00160 /*
00161 BOOL CBaseDialog::ProcessMessage
00162 (
00163   HWND     hDlg,           //[in] Handle to dialog box
00164   UINT     uMsg,           //[in] Message
00165   WPARAM   wParam,         //[in] First message parameter
00166   LPARAM   lParam          //[in] Second message parameter
00167 )
00168 {
00169   LRESULT lResult = 0;
00170   switch( uMsg )
00171   {
00172     case WM_INITDIALOG:
00173       lResult = OnInitDialog( hDlg, wParam, lParam );
00174       break;
00175
00176     case WM_DESTROY:
00177       lResult = OnDestroy( hDlg, wParam, lParam );
00178       break;
00179
00180     case WM_NCDESTROY:
00181       lResult = OnNcDestroy( hDlg, wParam, lParam );
00182       break;
00183
00184     case WM_CLOSE:
00185       lResult = OnClose( hDlg, wParam, lParam );
00186
00187     case WM_COMMAND:
00188       switch( wParam )
00189       {
00190         case IDOK:
00191           lResult = OnOK( hDlg, wParam, lParam );
00192           break;
00193
00194         case IDCANCEL:
00195           lResult = OnCancel( hDlg, wParam, lParam );
00196           break;
00197
00198         default:
00199           break;
00200       }
00201     default:
00202       break;
00203   }
00204   return (BOOL)lResult;
00205 }
00206 */
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/statnode.h Source File

  • SysMgmt
  • MMC
  • About

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028     virtual ~CStaticNode();
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00031         static _TCHAR szDisplayName[256];
00032         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00033         return szDisplayName;
00034     }
00035     virtual const GUID & getNodeType() { return thisGuid; }
00036     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00037
00038 public:
00039     // virtual functions go here (for MMCN_*)
00040
00041 private:
00042     // {2974380C-4C4B-11d2-89D8-000021473128}
00043     static const GUID thisGuid;
00044 };
00045
00046 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/CommCode.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

CommCode.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE: CommCode.c
00009 //
00010 //  PURPOSE: Handles all the COMM routines for TapiComm.
00011 //
00012 //  EXPORTED FUNCTIONS:  These functions are for use by other modules.
00013 //    StartComm        - Start communications.
00014 //    StopComm         - Stop Communications.
00015 //    WriteCommString  - Write a string to the Comm port.
00016 //
00017 //  INTERNAL FUNCTION:  These functions are for this module only.
00018 //    CloseReadThread  - Close the Read Thread.
00019 //    CloseWriteThread - Close the Write Thread.
00020 //
00021 //    StartReadThreadProc    - Starting function for the Read Thread.
00022 //    StartWriteThreadProc   - Starting function for the Write Thread.
00023 //
00024 //    - Write Thread helper function
00025 //    HandleWriteData - Actually does the work of writing a string to comm.
00026 //
00027 //    - Read Thread helper functions
00028 //    SetupReadEvent  - Sets up the overlapped ReadFile
00029 //    HandleReadEvent - Gets the results from the overlapped ReadFile
00030 //    HandleReadData  - Handles data returned from the ReadFile
00031 //
00032 //    HandleCommEvent - Sets up the CommEvent event.
00033 //    SetupCommEvent  - Handles CommEvent events (if they occur).
00034 //
00035
00036
00037 #include <windows.h>
00038 #include <string.h>
00039 #include "TapiCode.h"
00040 #include "CommCode.h"
00041 #include "globals.h"
00042 #include "TapiInfo.h"
00043 #include "EditCtls.h"
00044
00045 // This is the message posted to the WriteThread
00046 // When we have something to write.
00047 #define PWM_COMMWRITE   WM_USER+1
00048
00049 // Default size of the Input Buffer used by this code.
00050 #define INPUTBUFFERSIZE 2048
00051
00052 //*****************************************
00053 // Global variables.
00054 //*****************************************
00055
00056 HANDLE g_hCommFile = NULL;
00057
00058 DWORD g_dwReadThreadID  = 0;
00059 DWORD g_dwWriteThreadID = 0;
00060 HANDLE g_hReadThread  = NULL;
00061 HANDLE g_hWriteThread = NULL;
00062
00063 HANDLE g_hCloseEvent = NULL;
00064
00065 //*****************************************
00066 // CommCode internal Function Prototypes
00067 //*****************************************
00068
00069 void CloseReadThread();
00070 void CloseWriteThread();
00071
00072 DWORD WINAPI StartReadThreadProc(LPVOID lpvParam);
00073 DWORD WINAPI StartWriteThreadProc(LPVOID lpvParam);
00074
00075
00076 BOOL HandleWriteData(LPOVERLAPPED lpOverlappedWrite,
00077         LPCSTR lpszStringToWrite, DWORD dwNumberOfBytesToWrite);
00078
00079
00080 BOOL SetupReadEvent(LPOVERLAPPED lpOverlappedRead,
00081         LPSTR lpszInputBuffer, DWORD dwSizeofBuffer,
00082         LPDWORD lpnNumberOfBytesRead);
00083 BOOL HandleReadEvent(LPOVERLAPPED lpOverlappedRead,
00084         LPSTR lpszInputBuffer, DWORD dwSizeofBuffer,
00085         LPDWORD lpnNumberOfBytesRead);
00086 BOOL HandleReadData(LPCSTR lpszInputBuffer, DWORD dwSizeofBuffer);
00087
00088
00089 BOOL HandleCommEvent(LPOVERLAPPED lpOverlappedCommEvent,
00090         LPDWORD lpfdwEvtMask, BOOL fRetrieveEvent);
00091 BOOL SetupCommEvent(LPOVERLAPPED lpOverlappedCommEvent,
00092         LPDWORD lpfdwEvtMask);
00093
00094
00095
00096 //*****************************************
00097 // Functions exported for use by other modules
00098 //*****************************************
00099
00100
00101
00102 //
00103 //  FUNCTION: StartComm(HANDLE)
00104 //
00105 //  PURPOSE: Starts communications over the comm port.
00106 //
00107 //  PARAMETERS:
00108 //    hNewCommFile - This is the COMM File handle to communicate with.
00109 //                   This handle is obtained from TAPI.
00110 //
00111 //  RETURN VALUE:
00112 //    TRUE if able to setup the communications.
00113 //
00114 //  COMMENTS:
00115 //
00116 //    StartComm makes sure there isn't communication in progress already,
00117 //    the hNewCommFile is valid, and all the threads can be created.  It
00118 //    also configures the hNewCommFile for the appropriate COMM settings.
00119 //
00120 //    If StartComm fails for any reason, it's up to the calling application
00121 //    to close the Comm file handle.
00122 //
00123 //
00124
00125 BOOL StartComm(HANDLE hNewCommFile)
00126 {
00127     // Is this a valid comm handle?
00128     if (GetFileType(hNewCommFile) != FILE_TYPE_CHAR)
00129     {
00130         OutputDebugString("File handle is not a comm handle.\n");
00131         return FALSE;
00132     }
00133
00134     // Are we already doing comm?
00135     if (g_hCommFile != NULL)
00136     {
00137         OutputDebugString("Already have a comm file open\n");
00138         return FALSE;
00139     }
00140
00141     // Its ok to continue.
00142
00143     g_hCommFile = hNewCommFile;
00144
00145     // Setting and querying the comm port configurations.
00146
00147     { // Configure the comm settings.
00148         COMMTIMEOUTS commtimeouts;
00149         DCB dcb;
00150         COMMPROP commprop;
00151         DWORD fdwEvtMask;
00152
00153         // These are here just so you can set a breakpoint
00154         // and see what the comm settings are.  Most Comm settings
00155         // are already set through TAPI.
00156         GetCommState(hNewCommFile, &dcb);
00157         GetCommProperties(hNewCommFile, &commprop);
00158         GetCommMask(g_hCommFile, &fdwEvtMask);
00159         GetCommTimeouts(g_hCommFile, &commtimeouts);
00160
00161
00162         // The CommTimeout numbers will very likely change if you are
00163         // coding to meet some kind of specification where
00164         // you need to reply within a certain amount of time after
00165         // recieving the last byte.  However,  If 1/4th of a second
00166         // goes by between recieving two characters, its a good
00167         // indication that the transmitting end has finished, even
00168         // assuming a 1200 baud modem.
00169
00170         commtimeouts.ReadIntervalTimeout         = 250;
00171         commtimeouts.ReadTotalTimeoutMultiplier  = 0;
00172         commtimeouts.ReadTotalTimeoutConstant    = 0;
00173         commtimeouts.WriteTotalTimeoutMultiplier = 0;
00174         commtimeouts.WriteTotalTimeoutConstant   = 0;
00175
00176         SetCommTimeouts(g_hCommFile, &commtimeouts);
00177
00178         // fAbortOnError is the only DCB dependancy in TapiComm.
00179         // Can't guarentee that the SP will set this to what we expect.
00180         dcb.fAbortOnError = FALSE;
00181         SetCommState(hNewCommFile, &dcb);
00182     }
00183
00184     // Create the event that will signal the threads to close.
00185     g_hCloseEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
00186
00187     if (g_hCloseEvent == NULL)
00188     {
00189         OutputDebugLastError(GetLastError(), "Unable to CreateEvent: ");
00190         g_hCommFile = NULL;
00191         return FALSE;
00192     }
00193
00194     // Create the Read thread.
00195     g_hReadThread =
00196         CreateThread(NULL, 0, StartReadThreadProc, 0, 0, &g_dwReadThreadID);
00197
00198     if (g_hReadThread == NULL)
00199     {
00200         OutputDebugLastError(GetLastError(),"Unable to create Read thread");
00201
00202         g_dwReadThreadID = 0;
00203         g_hCommFile = 0;
00204         return FALSE;
00205     }
00206
00207     // Comm threads should to have a higher base priority than the UI thread.
00208     // If they don't, then any temporary priority boost the UI thread gains
00209     // could cause the COMM threads to loose data.
00210     SetThreadPriority(g_hReadThread, THREAD_PRIORITY_HIGHEST);
00211
00212     // Create the Write thread.
00213     g_hWriteThread =
00214         CreateThread(NULL, 0, StartWriteThreadProc, 0, 0, &g_dwWriteThreadID);
00215
00216     if (g_hWriteThread == NULL)
00217     {
00218         OutputDebugLastError(GetLastError(),"Unable to create Write thread");
00219
00220         CloseReadThread();
00221         g_dwWriteThreadID = 0;
00222         g_hCommFile = 0;
00223         return FALSE;
00224     }
00225
00226     SetThreadPriority(g_hWriteThread, THREAD_PRIORITY_ABOVE_NORMAL);
00227
00228     // Everything was created ok.  Ready to go!
00229     return TRUE;
00230 }
00231
00232
00233 //
00234 //  FUNCTION: StopComm
00235 //
00236 //  PURPOSE: Stop and end all communication threads.
00237 //
00238 //  PARAMETERS:
00239 //    none
00240 //
00241 //  RETURN VALUE:
00242 //    none
00243 //
00244 //  COMMENTS:
00245 //
00246 //    Tries to gracefully signal all communication threads to
00247 //    close, but terminates them if it has to.
00248 //
00249 //
00250
00251 void StopComm()
00252 {
00253     // No need to continue if we're not communicating.
00254     if (g_hCommFile == NULL)
00255         return;
00256
00257     OutputDebugString("Stopping the Comm\n");
00258
00259     // Close the threads.
00260     CloseReadThread();
00261     CloseWriteThread();
00262
00263     // Not needed anymore.
00264     CloseHandle(g_hCloseEvent);
00265
00266     // Now close the comm port handle.
00267     CloseHandle(g_hCommFile);
00268     g_hCommFile = NULL;
00269 }
00270
00271
00272 //
00273 //  FUNCTION: WriteCommString(LPCSTR, DWORD)
00274 //
00275 //  PURPOSE: Send a String to the Write Thread to be written to the Comm.
00276 //
00277 //  PARAMETERS:
00278 //    pszStringToWrite     - String to Write to Comm port.
00279 //    nSizeofStringToWrite - length of pszStringToWrite.
00280 //
00281 //  RETURN VALUE:
00282 //    Returns TRUE if the PostMessage is successful.
00283 //    Returns FALSE if PostMessage fails or Write thread doesn't exist.
00284 //
00285 //  COMMENTS:
00286 //
00287 //    This is a wrapper function so that other modules don't care that
00288 //    Comm writing is done via PostMessage to a Write thread.  Note that
00289 //    using PostMessage speeds up response to the UI (very little delay to
00290 //    'write' a string) and provides a natural buffer if the comm is slow
00291 //    (ie:  the messages just pile up in the message queue).
00292 //
00293 //    Note that it is assumed that pszStringToWrite is allocated with
00294 //    LocalAlloc, and that if WriteCommString succeeds, its the job of the
00295 //    Write thread to LocalFree it.  If WriteCommString fails, then its
00296 //    the job of the calling function to free the string.
00297 //
00298 //
00299
00300 BOOL WriteCommString(LPCSTR lpszStringToWrite, DWORD dwSizeofStringToWrite)
00301 {
00302     if (g_hWriteThread)
00303     {
00304         if (PostThreadMessage(g_dwWriteThreadID, PWM_COMMWRITE,
00305                 (WPARAM) dwSizeofStringToWrite, (LPARAM) lpszStringToWrite))
00306         {
00307             return TRUE;
00308         }
00309         else
00310             OutputDebugString("Failed to Post to Write thread.\n");
00311     }
00312     else
00313         OutputDebugString("Write thread not created\n");
00314
00315     return FALSE;
00316 }
00317
00318
00319
00320 //*****************************************
00321 // The rest of the functions are intended for use
00322 // only within the CommCode module.
00323 //*****************************************
00324
00325
00326
00327 //
00328 //  FUNCTION: CloseReadThread
00329 //
00330 //  PURPOSE: Close the Read Thread.
00331 //
00332 //  PARAMETERS:
00333 //    none
00334 //
00335 //  RETURN VALUE:
00336 //    none
00337 //
00338 //  COMMENTS:
00339 //
00340 //    Closes the Read thread by signaling the CloseEvent.
00341 //    Purges any outstanding reads on the comm port.
00342 //
00343 //    Note that terminating a thread leaks memory (read the docs).
00344 //    Besides the normal leak incurred, there is an event object
00345 //    that doesn't get closed.  This isn't worth worrying about
00346 //    since it shouldn't happen anyway.
00347 //
00348 //
00349
00350 void CloseReadThread()
00351 {
00352     // If it exists...
00353     if (g_hReadThread)
00354     {
00355         OutputDebugString("Closing Read Thread\n");
00356
00357         // Signal the event to close the worker threads.
00358         SetEvent(g_hCloseEvent);
00359
00360         // Purge all outstanding reads
00361         PurgeComm(g_hCommFile, PURGE_RXABORT | PURGE_RXCLEAR);
00362
00363         // Wait 10 seconds for it to exit.  Shouldn't happen.
00364         if (WaitForSingleObject(g_hReadThread, 10000) == WAIT_TIMEOUT)
00365         {
00366             OutputDebugString("Read thread not exiting.  Terminating it.\n");
00367
00368             TerminateThread(g_hReadThread, 0);
00369
00370             // The ReadThread cleans up these itself if it terminates
00371             // normally.
00372             CloseHandle(g_hReadThread);
00373             g_hReadThread = 0;
00374             g_dwReadThreadID = 0;
00375         }
00376     }
00377 }
00378
00379
00380 //
00381 //  FUNCTION: CloseWriteThread
00382 //
00383 //  PURPOSE: Closes the Write Thread.
00384 //
00385 //  PARAMETERS:
00386 //    none
00387 //
00388 //  RETURN VALUE:
00389 //    none
00390 //
00391 //  COMMENTS:
00392 //
00393 //    Closes the write thread by signaling the CloseEvent.
00394 //    Purges any outstanding writes on the comm port.
00395 //
00396 //    Note that terminating a thread leaks memory (read the docs).
00397 //    Besides the normal leak incurred, there is an event object
00398 //    that doesn't get closed.  This isn't worth worrying about
00399 //    since it shouldn't happen anyway.
00400 //
00401 //
00402
00403 void CloseWriteThread()
00404 {
00405     // If it exists...
00406     if (g_hWriteThread)
00407     {
00408         OutputDebugString("Closing Write Thread\n");
00409
00410         // Signal the event to close the worker threads.
00411         SetEvent(g_hCloseEvent);
00412
00413         // Purge all outstanding writes.
00414         PurgeComm(g_hCommFile, PURGE_TXABORT | PURGE_TXCLEAR);
00415
00416         // Wait 10 seconds for it to exit.  Shouldn't happen.
00417         if (WaitForSingleObject(g_hWriteThread, 10000) == WAIT_TIMEOUT)
00418         {
00419             OutputDebugString("Write thread not exiting.  Terminating it.\n");
00420
00421             TerminateThread(g_hWriteThread, 0);
00422
00423             // The WriteThread cleans up these itself if it terminates
00424             // normally.
00425             CloseHandle(g_hWriteThread);
00426             g_hWriteThread = 0;
00427             g_dwWriteThreadID = 0;
00428
00429         }
00430     }
00431 }
00432
00433
00434 //
00435 //  FUNCTION: StartWriteThreadProc(LPVOID)
00436 //
00437 //  PURPOSE: The starting point for the Write thread.
00438 //
00439 //  PARAMETERS:
00440 //    lpvParam - unused.
00441 //
00442 //  RETURN VALUE:
00443 //    DWORD - unused.
00444 //
00445 //  COMMENTS:
00446 //
00447 //    The Write thread uses a PeekMessage loop to wait for a string to write,
00448 //    and when it gets one, it writes it to the Comm port.  If the CloseEvent
00449 //    object is signaled, then it exits.  The use of messages to tell the
00450 //    Write thread what to write provides a natural desynchronization between
00451 //    the UI and the Write thread.
00452 //
00453 //
00454
00455 DWORD WINAPI StartWriteThreadProc(LPVOID lpvParam)
00456 {
00457     MSG msg;
00458     DWORD dwHandleSignaled;
00459
00460     // Needed for overlapped I/O.
00461     OVERLAPPED overlappedWrite = {0, 0, 0, 0, NULL};
00462
00463     overlappedWrite.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
00464     if (overlappedWrite.hEvent == NULL)
00465     {
00466         OutputDebugLastError(GetLastError(), "Unable to CreateEvent: ");
00467         PostHangupCall();
00468         goto EndWriteThread;
00469     }
00470
00471     // This is the main loop.  Loop until we break out.
00472     while (TRUE)
00473     {
00474         if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
00475         {
00476             // If there are no messages pending, wait for a message or
00477             // the CloseEvent.
00478             dwHandleSignaled =
00479                 MsgWaitForMultipleObjects(1, &g_hCloseEvent, FALSE,
00480                     INFINITE, QS_ALLINPUT);
00481
00482             switch(dwHandleSignaled)
00483             {
00484                 case WAIT_OBJECT_0:     // CloseEvent signaled!
00485                 {
00486                     // Time to exit.
00487                     goto EndWriteThread;
00488                 }
00489
00490                 case WAIT_OBJECT_0 + 1: // New message was received.
00491                 {
00492                     // Get the message that woke us up by looping again.
00493                     continue;
00494                 }
00495
00496                 case WAIT_FAILED:       // Wait failed.  Shouldn't happen.
00497                 {
00498                     OutputDebugLastError(GetLastError(),"Write WAIT_FAILED: ");
00499                     PostHangupCall();
00500                     goto EndWriteThread;
00501                 }
00502
00503                 default:                // This case should never occur.
00504                 {
00505                     OutputDebugPrintf("Unexpected Wait return value '%lx'",
00506                         dwHandleSignaled);
00507                     PostHangupCall();
00508                     goto EndWriteThread;
00509                 }
00510
00511             }
00512         }
00513
00514         // Make sure the CloseEvent isn't signaled while retrieving messages.
00515         if (WAIT_TIMEOUT != WaitForSingleObject(g_hCloseEvent,0))
00516             goto EndWriteThread;
00517
00518         // Process the message.
00519
00520         // This could happen if a dialog is created on this thread.
00521         // This doesn't occur in this sample, but might if modified.
00522         if (msg.hwnd != NULL)
00523         {
00524             TranslateMessage(&msg);
00525             DispatchMessage(&msg);
00526
00527             continue;
00528         }
00529
00530         // Handle the message.
00531         switch(msg.message)
00532         {
00533             case PWM_COMMWRITE:  // New string to write to Comm port.
00534             {
00535                 OutputDebugString("Writing to comm port\n");
00536
00537                 // Write the string to the comm port.  HandleWriteData
00538                 // does not return until the whole string has been written,
00539                 // an error occurs or until the CloseEvent is signaled.
00540                 if (!HandleWriteData(&overlappedWrite,
00541                         (LPSTR) msg.lParam, (DWORD) msg.wParam))
00542                 {
00543                     // If it failed, either we got a signal to end or there
00544                     // really was a failure.
00545
00546                     LocalFree((HLOCAL) msg.lParam);
00547                     goto EndWriteThread;
00548                 }
00549
00550                 // Data was sent in a LocalAlloc()d buffer.  Must free it.
00551                 LocalFree((HLOCAL) msg.lParam);
00552                 break;
00553             }
00554
00555
00556             // What other messages could the thread get?
00557             default:
00558             {
00559                 char Output[256];
00560
00561                 wsprintf(Output,
00562                     "Unexpected message posted to Write thread: %ui\n",
00563                     msg.message );
00564
00565                 OutputDebugString(Output);
00566                 break;
00567             }
00568         } // End of switch(message)
00569
00570     } // End of main loop.
00571
00572     // Thats the end.  Now clean up.
00573   EndWriteThread:
00574
00575     OutputDebugString("Write thread shutting down\n");
00576
00577     PurgeComm(g_hCommFile, PURGE_TXABORT | PURGE_TXCLEAR);
00578
00579     CloseHandle(overlappedWrite.hEvent);
00580
00581     g_dwWriteThreadID = 0;
00582     CloseHandle(g_hWriteThread);
00583     g_hWriteThread = 0;
00584
00585     return 0;
00586 }
00587
00588
00589 //
00590 //  FUNCTION: HandleWriteData(LPOVERLAPPED, LPCSTR, DWORD)
00591 //
00592 //  PURPOSE: Writes a given string to the comm file handle.
00593 //
00594 //  PARAMETERS:
00595 //    lpOverlappedWrite      - Overlapped structure to use in WriteFile
00596 //    lpszStringToWrite      - String to write.
00597 //    dwNumberOfBytesToWrite - Length of String to write.
00598 //
00599 //  RETURN VALUE:
00600 //    TRUE if all bytes were written.  False if there was a failure to
00601 //    write the whole string.
00602 //
00603 //  COMMENTS:
00604 //
00605 //    This function is a helper function for the Write Thread.  It
00606 //    is this call that actually writes a string to the comm file.
00607 //    Note that this call blocks and waits for the Write to complete
00608 //    or for the CloseEvent object to signal that the thread should end.
00609 //    Another possible reason for returning FALSE is if the comm port
00610 //    is closed by the service provider.
00611 //
00612 //
00613
00614 BOOL HandleWriteData(LPOVERLAPPED lpOverlappedWrite,
00615     LPCSTR lpszStringToWrite, DWORD dwNumberOfBytesToWrite)
00616 {
00617     DWORD dwLastError;
00618
00619     DWORD dwNumberOfBytesWritten = 0;
00620     DWORD dwWhereToStartWriting = 0; // Start at the beginning.
00621
00622     DWORD dwHandleSignaled;
00623     HANDLE HandlesToWaitFor[2];
00624
00625     HandlesToWaitFor[0] = g_hCloseEvent;
00626     HandlesToWaitFor[1] = lpOverlappedWrite -> hEvent;
00627
00628     // Keep looping until all characters have been written.
00629     do
00630     {
00631         // Start the overlapped I/O.
00632         if (!WriteFile(g_hCommFile,
00633                 &lpszStringToWrite[ dwWhereToStartWriting ],
00634                 dwNumberOfBytesToWrite, &dwNumberOfBytesWritten,
00635                 lpOverlappedWrite))
00636         {
00637             // WriteFile failed.  Expected; lets handle it.
00638             dwLastError = GetLastError();
00639
00640             // Its possible for this error to occur if the
00641             // service provider has closed the port.  Time to end.
00642             if (dwLastError == ERROR_INVALID_HANDLE)
00643             {
00644                 OutputDebugString("ERROR_INVALID_HANDLE, "
00645                     "Likely that the Service Provider has closed the port.\n");
00646                 return FALSE;
00647             }
00648
00649             // Unexpected error.  No idea what.
00650             if (dwLastError != ERROR_IO_PENDING)
00651             {
00652                 OutputDebugLastError(dwLastError,
00653                     "Error to writing to CommFile");
00654
00655                 OutputDebugString("Closing TAPI\n");
00656                 PostHangupCall();
00657                 return FALSE;
00658             }
00659
00660             // This is the expected ERROR_IO_PENDING case.
00661
00662
00663             // Wait for either overlapped I/O completion,
00664             // or for the CloseEvent to get signaled.
00665             dwHandleSignaled =
00666                 WaitForMultipleObjects(2, HandlesToWaitFor,
00667                     FALSE, INFINITE);
00668
00669             switch(dwHandleSignaled)
00670             {
00671                 case WAIT_OBJECT_0:     // CloseEvent signaled!
00672                 {
00673                     // Time to exit.
00674                     return FALSE;
00675                 }
00676
00677                 case WAIT_OBJECT_0 + 1: // Wait finished.
00678                 {
00679                     // Time to get the results of the WriteFile
00680                     break;
00681                 }
00682
00683                 case WAIT_FAILED: // Wait failed.  Shouldn't happen.
00684                 {
00685                     OutputDebugLastError(GetLastError(),
00686                         "Write WAIT_FAILED: ");
00687                     PostHangupCall();
00688                     return FALSE;
00689                 }
00690
00691                 default: // This case should never occur.
00692                 {
00693                     OutputDebugPrintf(
00694                         "Unexpected Wait return value '%lx'",
00695                         dwHandleSignaled);
00696                     PostHangupCall();
00697                     return FALSE;
00698                 }
00699             }
00700
00701             if (!GetOverlappedResult(g_hCommFile,
00702                      lpOverlappedWrite,
00703                      &dwNumberOfBytesWritten, TRUE))
00704             {
00705                 dwLastError = GetLastError();
00706
00707                 // Its possible for this error to occur if the
00708                 // service provider has closed the port.
00709                 if (dwLastError == ERROR_INVALID_HANDLE)
00710                 {
00711                     OutputDebugString("ERROR_INVALID_HANDLE, "
00712                         "Likely that the Service Provider has closed the port.\n");
00713                     return FALSE;
00714                 }
00715
00716                 // No idea what could cause another error.
00717                 OutputDebugLastError(dwLastError,
00718                     "Error writing to CommFile while waiting");
00719                 OutputDebugString("Closing TAPI\n");
00720                 PostHangupCall();
00721                 return FALSE;
00722             }
00723         }
00724
00725         // Some data was written.  Make sure it all got written.
00726
00727         dwNumberOfBytesToWrite -= dwNumberOfBytesWritten;
00728         dwWhereToStartWriting += dwNumberOfBytesWritten;
00729     }
00730     while(dwNumberOfBytesToWrite > 0);  // Write the whole thing!
00731
00732     // Wrote the whole string.
00733     return TRUE;
00734 }
00735
00736
00737 //
00738 //  FUNCTION: StartReadThreadProc(LPVOID)
00739 //
00740 //  PURPOSE: This is the starting point for the Read Thread.
00741 //
00742 //  PARAMETERS:
00743 //    lpvParam - unused.
00744 //
00745 //  RETURN VALUE:
00746 //    DWORD - unused.
00747 //
00748 //  COMMENTS:
00749 //
00750 //    The Read Thread uses overlapped ReadFile and sends any strings
00751 //    read from the comm port to the UI to be printed.  This is
00752 //    eventually done through a PostMessage so that the Read Thread
00753 //    is never away from the comm port very long.  This also provides
00754 //    natural desynchronization between the Read thread and the UI.
00755 //
00756 //    If the CloseEvent object is signaled, the Read Thread exits.
00757 //
00758 //    Note that there is absolutely *no* interpretation of the data,
00759 //    which means no terminal emulation.  It basically means that this
00760 //    sample is pretty useless as a TTY program.
00761 //
00762 //    Separating the Read and Write threads is natural for a application
00763 //    like this sample where there is no need for synchronization between
00764 //    reading and writing.  However, if there is such a need (for example,
00765 //    most file transfer algorithms synchronize the reading and writing),
00766 //    then it would make a lot more sense to have a single thread to handle
00767 //    both reading and writing.
00768 //
00769 //
00770
00771 DWORD WINAPI StartReadThreadProc(LPVOID lpvParam)
00772 {
00773     char szInputBuffer[INPUTBUFFERSIZE];
00774     DWORD nNumberOfBytesRead;
00775
00776     HANDLE HandlesToWaitFor[3];
00777     DWORD dwHandleSignaled;
00778
00779     DWORD fdwEvtMask;
00780
00781     // Needed for overlapped I/O (ReadFile)
00782     OVERLAPPED overlappedRead  = {0, 0, 0, 0, NULL};
00783
00784     // Needed for overlapped Comm Event handling.
00785     OVERLAPPED overlappedCommEvent = {0, 0, 0, 0, NULL};
00786
00787     // Lets put an event in the Read overlapped structure.
00788     overlappedRead.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
00789     if (overlappedRead.hEvent == NULL)
00790     {
00791         OutputDebugLastError(GetLastError(), "Unable to CreateEvent: ");
00792         PostHangupCall();
00793         goto EndReadThread;
00794     }
00795
00796     // And an event for the CommEvent overlapped structure.
00797     overlappedCommEvent.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
00798     if (overlappedCommEvent.hEvent == NULL)
00799     {
00800         OutputDebugLastError(GetLastError(), "Unable to CreateEvent: ");
00801         PostHangupCall();
00802         goto EndReadThread;
00803     }
00804
00805     // We will be waiting on these objects.
00806     HandlesToWaitFor[0] = g_hCloseEvent;
00807     HandlesToWaitFor[1] = overlappedCommEvent.hEvent;
00808     HandlesToWaitFor[2] = overlappedRead.hEvent;
00809
00810
00811     // Setup CommEvent handling.
00812
00813     // Set the comm mask so we receive error signals.
00814     if (!SetCommMask(g_hCommFile, EV_ERR))
00815     {
00816         OutputDebugLastError(GetLastError(),"Unable to SetCommMask: ");
00817         PostHangupCall();
00818         goto EndReadThread;
00819     }
00820
00821     // Start waiting for CommEvents (Errors)
00822     if (!SetupCommEvent(&overlappedCommEvent, &fdwEvtMask))
00823     {
00824         PostHangupCall();
00825         goto EndReadThread;
00826     }
00827
00828     // Start waiting for Read events.
00829     if (!SetupReadEvent(&overlappedRead,
00830                 szInputBuffer, INPUTBUFFERSIZE,
00831                 &nNumberOfBytesRead))
00832     {
00833         PostHangupCall();
00834         goto EndReadThread;
00835     }
00836
00837     // Keep looping until we break out.
00838     while (TRUE)
00839     {
00840         // Wait until some event occurs (data to read; error; stopping).
00841         dwHandleSignaled =
00842             WaitForMultipleObjects(3, HandlesToWaitFor,
00843                 FALSE, INFINITE);
00844
00845         // Which event occured?
00846         switch(dwHandleSignaled)
00847         {
00848             case WAIT_OBJECT_0:     // Signal to end the thread.
00849             {
00850                 // Time to exit.
00851                 goto EndReadThread;
00852             }
00853
00854             case WAIT_OBJECT_0 + 1: // CommEvent signaled.
00855             {
00856                 // Handle the CommEvent.
00857                 if (!HandleCommEvent(&overlappedCommEvent, &fdwEvtMask, TRUE))
00858                 {
00859                     PostHangupCall();
00860                     goto EndReadThread;
00861                 }
00862
00863                 // Start waiting for the next CommEvent.
00864                 if (!SetupCommEvent(&overlappedCommEvent, &fdwEvtMask))
00865                 {
00866                     PostHangupCall();
00867                     goto EndReadThread;
00868                 }
00869                 break;
00870             }
00871
00872             case WAIT_OBJECT_0 + 2: // Read Event signaled.
00873             {
00874                 // Get the new data!
00875                 if (!HandleReadEvent(&overlappedRead,
00876                             szInputBuffer, INPUTBUFFERSIZE,
00877                             &nNumberOfBytesRead))
00878                 {
00879                     PostHangupCall();
00880                     goto EndReadThread;
00881                 }
00882
00883                 // Wait for more new data.
00884                 if (!SetupReadEvent(&overlappedRead,
00885                             szInputBuffer, INPUTBUFFERSIZE,
00886                             &nNumberOfBytesRead))
00887                 {
00888                     PostHangupCall();
00889                     goto EndReadThread;
00890                 }
00891                 break;
00892             }
00893
00894             case WAIT_FAILED:       // Wait failed.  Shouldn't happen.
00895             {
00896                 OutputDebugLastError(GetLastError(),"Read WAIT_FAILED: ");
00897                 PostHangupCall();
00898                 goto EndReadThread;
00899             }
00900
00901             default:    // This case should never occur.
00902             {
00903                 OutputDebugPrintf("Unexpected Wait return value '%lx'",
00904                     dwHandleSignaled);
00905                 PostHangupCall();
00906                 goto EndReadThread;
00907             }
00908         } // End of switch(dwHandleSignaled).
00909
00910     } // End of while(TRUE) loop.
00911
00912
00913     // Time to clean up Read Thread.
00914   EndReadThread:
00915
00916     OutputDebugString("Read thread shutting down\n");
00917     PurgeComm(g_hCommFile, PURGE_RXABORT | PURGE_RXCLEAR);
00918     CloseHandle(overlappedRead.hEvent);
00919     CloseHandle(overlappedCommEvent.hEvent);
00920     g_dwReadThreadID = 0;
00921     CloseHandle(g_hReadThread);
00922     g_hReadThread = 0;
00923     return 0;
00924 }
00925
00926
00927 //
00928 //  FUNCTION: SetupReadEvent(LPOVERLAPPED, LPSTR, DWORD, LPDWORD)
00929 //
00930 //  PURPOSE: Sets up an overlapped ReadFile
00931 //
00932 //  PARAMETERS:
00933 //    lpOverlappedRead      - address of overlapped structure to use.
00934 //    lpszInputBuffer       - Buffer to place incoming bytes.
00935 //    dwSizeofBuffer        - size of lpszInputBuffer.
00936 //    lpnNumberOfBytesRead  - address of DWORD to place the number of read bytes.
00937 //
00938 //  RETURN VALUE:
00939 //    TRUE if able to successfully setup the ReadFile.  FALSE if there
00940 //    was a failure setting up or if the CloseEvent object was signaled.
00941 //
00942 //  COMMENTS:
00943 //
00944 //    This function is a helper function for the Read Thread.  This
00945 //    function sets up the overlapped ReadFile so that it can later
00946 //    be waited on (or more appropriatly, so the event in the overlapped
00947 //    structure can be waited upon).  If there is data waiting, it is
00948 //    handled and the next ReadFile is initiated.
00949 //    Another possible reason for returning FALSE is if the comm port
00950 //    is closed by the service provider.
00951 //
00952 //
00953 //
00954
00955 BOOL SetupReadEvent(LPOVERLAPPED lpOverlappedRead,
00956     LPSTR lpszInputBuffer, DWORD dwSizeofBuffer,
00957     LPDWORD lpnNumberOfBytesRead)
00958 {
00959     DWORD dwLastError;
00960
00961   StartSetupReadEvent:
00962
00963     // Make sure the CloseEvent hasn't been signaled yet.
00964     // Check is needed because this function is potentially recursive.
00965     if (WAIT_TIMEOUT != WaitForSingleObject(g_hCloseEvent,0))
00966         return FALSE;
00967
00968     // Start the overlapped ReadFile.
00969     if (ReadFile(g_hCommFile,
00970             lpszInputBuffer, dwSizeofBuffer,
00971             lpnNumberOfBytesRead, lpOverlappedRead))
00972     {
00973         // This would only happen if there was data waiting to be read.
00974
00975         OutputDebugString("Data waiting for ReadFile.\n");
00976
00977         // Handle the data.
00978         if (!HandleReadData(lpszInputBuffer, *lpnNumberOfBytesRead))
00979         {
00980             return FALSE;
00981         }
00982
00983         // Start waiting for more data.
00984         goto StartSetupReadEvent;
00985     }
00986
00987     // ReadFile failed.  Expected because of overlapped I/O.
00988     dwLastError = GetLastError();
00989
00990
00991     // LastError was ERROR_IO_PENDING, as expected.
00992     if (dwLastError == ERROR_IO_PENDING)
00993     {
00994         OutputDebugString("Waiting for data from comm connection.\n");
00995         return TRUE;
00996     }
00997
00998     // Its possible for this error to occur if the
00999     // service provider has closed the port.  Time to end.
01000     if (dwLastError == ERROR_INVALID_HANDLE)
01001     {
01002         OutputDebugString("ERROR_INVALID_HANDLE, "
01003             "Likely that the Service Provider has closed the port.\n");
01004         return FALSE;
01005     }
01006
01007     // Unexpected error. No idea what could cause this to happen.
01008     OutputDebugLastError(dwLastError,"Unexpected ReadFile error: ");
01009
01010     PostHangupCall();
01011     return FALSE;
01012 }
01013
01014
01015 //
01016 //  FUNCTION: HandleReadEvent(LPOVERLAPPED, LPSTR, DWORD, LPDWORD)
01017 //
01018 //  PURPOSE: Retrieves and handles data when there is data ready.
01019 //
01020 //  PARAMETERS:
01021 //    lpOverlappedRead      - address of overlapped structure to use.
01022 //    lpszInputBuffer       - Buffer to place incoming bytes.
01023 //    dwSizeofBuffer        - size of lpszInputBuffer.
01024 //    lpnNumberOfBytesRead  - address of DWORD to place the number of read bytes.
01025 //
01026 //  RETURN VALUE:
01027 //    TRUE if able to successfully retrieve and handle the available data.
01028 //    FALSE if unable to retrieve or handle the data.
01029 //
01030 //  COMMENTS:
01031 //
01032 //    This function is another helper function for the Read Thread.  This
01033 //    is the function that is called when there is data available after
01034 //    an overlapped ReadFile has been setup.  It retrieves the data and
01035 //    handles it.
01036 //
01037 //
01038
01039 BOOL HandleReadEvent(LPOVERLAPPED lpOverlappedRead,
01040     LPSTR lpszInputBuffer, DWORD dwSizeofBuffer,
01041     LPDWORD lpnNumberOfBytesRead)
01042 {
01043     DWORD dwLastError;
01044
01045     if (GetOverlappedResult(g_hCommFile,
01046             lpOverlappedRead, lpnNumberOfBytesRead, FALSE))
01047     {
01048         return HandleReadData(lpszInputBuffer, *lpnNumberOfBytesRead);
01049     }
01050
01051     // Error in GetOverlappedResult; handle it.
01052
01053     dwLastError = GetLastError();
01054
01055     // Its possible for this error to occur if the
01056     // service provider has closed the port.  Time to end.
01057     if (dwLastError == ERROR_INVALID_HANDLE)
01058     {
01059         OutputDebugString("ERROR_INVALID_HANDLE, "
01060             "Likely that the Service Provider has closed the port.\n");
01061         return FALSE;
01062     }
01063
01064     OutputDebugLastError(dwLastError,
01065         "Unexpected GetOverlappedResult Read Error: ");
01066
01067     PostHangupCall();
01068     return FALSE;
01069 }
01070
01071
01072 //
01073 //  FUNCTION: HandleReadData(LPCSTR, DWORD)
01074 //
01075 //  PURPOSE: Deals with data after its been read from the comm file.
01076 //
01077 //  PARAMETERS:
01078 //    lpszInputBuffer  - Buffer to place incoming bytes.
01079 //    dwSizeofBuffer   - size of lpszInputBuffer.
01080 //
01081 //  RETURN VALUE:
01082 //    TRUE if able to successfully handle the data.
01083 //    FALSE if unable to allocate memory or handle the data.
01084 //
01085 //  COMMENTS:
01086 //
01087 //    This function is yet another helper function for the Read Thread.
01088 //    It LocalAlloc()s a buffer, copies the new data to this buffer and
01089 //    calls PostWriteToDisplayCtl to let the EditCtls module deal with
01090 //    the data.  Its assumed that PostWriteToDisplayCtl posts the message
01091 //    rather than dealing with it right away so that the Read Thread
01092 //    is free to get right back to waiting for data.  Its also assumed
01093 //    that the EditCtls module is responsible for LocalFree()ing the
01094 //    pointer that is passed on.
01095 //
01096 //
01097
01098 BOOL HandleReadData(LPCSTR lpszInputBuffer, DWORD dwSizeofBuffer)
01099 {
01100     // If we got data and didn't just time out empty...
01101     if (dwSizeofBuffer)
01102     {
01103         LPSTR lpszPostedBytes;
01104
01105         // Do something with the bytes read.
01106         OutputDebugString("Got something from Comm port!!!\n");
01107
01108         lpszPostedBytes = LocalAlloc(LPTR,dwSizeofBuffer+1);
01109         if (lpszPostedBytes == NULL)
01110         {
01111             OutputDebugLastError(GetLastError(), "LocalAlloc: ");
01112             return FALSE;
01113         }
01114
01115         memcpy(lpszPostedBytes, lpszInputBuffer, dwSizeofBuffer);
01116         lpszPostedBytes[dwSizeofBuffer] = '\0';
01117
01118         return PostWriteToDisplayCtl(lpszPostedBytes, dwSizeofBuffer);
01119     }
01120   return FALSE;
01121
01122 }
01123
01124
01125 //
01126 //  FUNCTION: SetupCommEvent(LPOVERLAPPED, LPDWORD)
01127 //
01128 //  PURPOSE: Sets up the overlapped WaitCommEvent call.
01129 //
01130 //  PARAMETERS:
01131 //    lpOverlappedCommEvent - Pointer to the overlapped structure to use.
01132 //    lpfdwEvtMask          - Pointer to DWORD to received Event data.
01133 //
01134 //  RETURN VALUE:
01135 //    TRUE if able to successfully setup the WaitCommEvent.
01136 //    FALSE if unable to setup WaitCommEvent, unable to handle
01137 //    an existing outstanding event or if the CloseEvent has been signaled.
01138 //
01139 //  COMMENTS:
01140 //
01141 //    This function is a helper function for the Read Thread that sets up
01142 //    the WaitCommEvent so we can deal with comm events (like Comm errors)
01143 //    if they occur.
01144 //
01145 //
01146
01147 BOOL SetupCommEvent(LPOVERLAPPED lpOverlappedCommEvent,
01148     LPDWORD lpfdwEvtMask)
01149 {
01150     DWORD dwLastError;
01151
01152   StartSetupCommEvent:
01153
01154     // Make sure the CloseEvent hasn't been signaled yet.
01155     // Check is needed because this function is potentially recursive.
01156     if (WAIT_TIMEOUT != WaitForSingleObject(g_hCloseEvent,0))
01157         return FALSE;
01158
01159     // Start waiting for Comm Errors.
01160     if (WaitCommEvent(g_hCommFile, lpfdwEvtMask, lpOverlappedCommEvent))
01161     {
01162         // This could happen if there was an error waiting on the
01163         // comm port.  Lets try and handle it.
01164
01165         OutputDebugString("Event (Error) waiting before WaitCommEvent.\n");
01166
01167         if (!HandleCommEvent(NULL, lpfdwEvtMask, FALSE))
01168             return FALSE;
01169
01170         // What could cause infinite recursion at this point?
01171         goto StartSetupCommEvent;
01172     }
01173
01174     // We expect ERROR_IO_PENDING returned from WaitCommEvent
01175     // because we are waiting with an overlapped structure.
01176
01177     dwLastError = GetLastError();
01178
01179     // LastError was ERROR_IO_PENDING, as expected.
01180     if (dwLastError == ERROR_IO_PENDING)
01181     {
01182         OutputDebugString("Waiting for a CommEvent (Error) to occur.\n");
01183         return TRUE;
01184     }
01185
01186     // Its possible for this error to occur if the
01187     // service provider has closed the port.  Time to end.
01188     if (dwLastError == ERROR_INVALID_HANDLE)
01189     {
01190         OutputDebugString("ERROR_INVALID_HANDLE, "
01191             "Likely that the Service Provider has closed the port.\n");
01192         return FALSE;
01193     }
01194
01195     // Unexpected error. No idea what could cause this to happen.
01196     OutputDebugLastError(dwLastError, "Unexpected WaitCommEvent error: ");
01197     return FALSE;
01198 }
01199
01200
01201 //
01202 //  FUNCTION: HandleCommEvent(LPOVERLAPPED, LPDWORD, BOOL)
01203 //
01204 //  PURPOSE: Handle an outstanding Comm Event.
01205 //
01206 //  PARAMETERS:
01207 //    lpOverlappedCommEvent - Pointer to the overlapped structure to use.
01208 //    lpfdwEvtMask          - Pointer to DWORD to received Event data.
01209 //     fRetrieveEvent       - Flag to signal if the event needs to be
01210 //                            retrieved, or has already been retrieved.
01211 //
01212 //  RETURN VALUE:
01213 //    TRUE if able to handle a Comm Event.
01214 //    FALSE if unable to setup WaitCommEvent, unable to handle
01215 //    an existing outstanding event or if the CloseEvent has been signaled.
01216 //
01217 //  COMMENTS:
01218 //
01219 //    This function is a helper function for the Read Thread that (if
01220 //    fRetrieveEvent == TRUE) retrieves an outstanding CommEvent and
01221 //    deals with it.  The only event that should occur is an EV_ERR event,
01222 //    signalling that there has been an error on the comm port.
01223 //
01224 //    Normally, comm errors would not be put into the normal data stream
01225 //    as this sample is demonstrating.  Putting it in a status bar would
01226 //    be more appropriate for a real application.
01227 //
01228 //
01229
01230 BOOL HandleCommEvent(LPOVERLAPPED lpOverlappedCommEvent,
01231     LPDWORD lpfdwEvtMask, BOOL fRetrieveEvent)
01232 {
01233     DWORD dwDummy;
01234     LPSTR lpszOutput;
01235     char szError[128] = "";
01236     DWORD dwErrors;
01237     DWORD nOutput;
01238     DWORD dwLastError;
01239   DWORD dwRemainingLength;
01240
01241
01242     lpszOutput = LocalAlloc(LPTR,256);
01243     if (lpszOutput == NULL)
01244     {
01245         OutputDebugLastError(GetLastError(), "LocalAlloc: ");
01246         return FALSE;
01247     }
01248
01249     // If this fails, it could be because the file was closed (and I/O is
01250     // finished) or because the overlapped I/O is still in progress.  In
01251     // either case (or any others) its a bug and return FALSE.
01252     if (fRetrieveEvent)
01253         if (!GetOverlappedResult(g_hCommFile,
01254                 lpOverlappedCommEvent, &dwDummy, FALSE))
01255         {
01256             dwLastError = GetLastError();
01257
01258             // Its possible for this error to occur if the
01259             // service provider has closed the port.  Time to end.
01260             if (dwLastError == ERROR_INVALID_HANDLE)
01261             {
01262                 OutputDebugString("ERROR_INVALID_HANDLE, "
01263                     "Likely that the Service Provider has closed the port.\n");
01264                 return FALSE;
01265             }
01266
01267             OutputDebugLastError(dwLastError,
01268                 "Unexpected GetOverlappedResult for WaitCommEvent: ");
01269             return FALSE;
01270         }
01271
01272     // Was the event an error?
01273     if (*lpfdwEvtMask & EV_ERR)
01274     {
01275         // Which error was it?
01276         if (!ClearCommError(g_hCommFile, &dwErrors, NULL))
01277         {
01278             dwLastError = GetLastError();
01279
01280             // Its possible for this error to occur if the
01281             // service provider has closed the port.  Time to end.
01282             if (dwLastError == ERROR_INVALID_HANDLE)
01283             {
01284                 OutputDebugString("ERROR_INVALID_HANDLE, "
01285                     "Likely that the Service Provider has closed the port.\n");
01286                 return FALSE;
01287             }
01288
01289             OutputDebugLastError(GetLastError(),"ClearCommError: ");
01290             return FALSE;
01291         }
01292
01293         // Its possible that multiple errors occured and were handled
01294         // in the last ClearCommError.  Because all errors were signaled
01295         // individually, but cleared all at once, pending comm events
01296         // can yield EV_ERR while dwErrors equals 0.  Ignore this event.
01297         if (dwErrors == 0)
01298         {
01299       dwRemainingLength = 127 - strlen(szError);
01300             strncat(szError, "NULL Error",dwRemainingLength);
01301       szError [127] = '\0';
01302
01303         }
01304
01305
01306
01307         if (dwErrors & CE_FRAME)
01308         {
01309       dwRemainingLength = 127 - strlen(szError);
01310             if (szError[0])
01311       {
01312                 strncat(szError," and ",dwRemainingLength);
01313         szError [127] = '\0';
01314       }
01315
01316       dwRemainingLength = 127 - strlen(szError);
01317             strncat(szError,"CE_FRAME",dwRemainingLength);
01318       szError [127] = '\0';
01319
01320         }
01321
01322         if (dwErrors & CE_OVERRUN)
01323         {
01324       dwRemainingLength = 127 - strlen(szError);
01325             if (szError[0])
01326       {
01327                 strncat(szError," and ",dwRemainingLength);
01328         szError [127] = '\0';
01329       }
01330       dwRemainingLength = 127 - strlen(szError);
01331             strncat(szError,"CE_OVERRUN",dwRemainingLength);
01332       szError [127] = '\0';
01333         }
01334
01335         if (dwErrors & CE_RXPARITY)
01336         {
01337             dwRemainingLength = 127 - strlen(szError);
01338       if (szError[0])
01339       {
01340                 strncat(szError," and ",dwRemainingLength);
01341         szError [127] = '\0';
01342       }
01343       dwRemainingLength = 127 - strlen(szError);
01344             strncat(szError,"CE_RXPARITY",dwRemainingLength);
01345       szError [127] = '\0';
01346         }
01347
01348         if (dwErrors & ~ (CE_FRAME | CE_OVERRUN | CE_RXPARITY))
01349         {
01350             dwRemainingLength = 127 - strlen(szError);
01351       if (szError[0])
01352       {
01353                 strncat(szError," and ",dwRemainingLength);
01354         szError [127] = '\0';
01355       }
01356       dwRemainingLength = 127 - strlen(szError);
01357             strncat(szError,"EV_ERR Unknown EvtMask",dwRemainingLength);
01358       szError [127] = '\0';
01359         }
01360
01361
01362         nOutput = wsprintf(lpszOutput,
01363             "Comm Event: '%s', EvtMask = '%lx'\n",
01364             szError, dwErrors);
01365
01366         PostWriteToDisplayCtl(lpszOutput, nOutput);
01367         return TRUE;
01368
01369     }
01370
01371     // Should not have gotten here.  Only interested in ERR conditions.
01372
01373     OutputDebugPrintf("Unexpected comm event %lx",*lpfdwEvtMask);
01374     return FALSE;
01375 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Simple

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057     else if (IsEqualIID(riid, IID_IPersistStream))
00058         *ppv = static_cast<IPersistStream *>(this);
00059
00060     if (*ppv)
00061     {
00062         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00063         return S_OK;
00064     }
00065
00066     return E_NOINTERFACE;
00067 }
00068
00069 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00070 {
00071     return InterlockedIncrement((LONG *)&m_cref);
00072 }
00073
00074 STDMETHODIMP_(ULONG) CComponentData::Release()
00075 {
00076     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00077     {
00078         // we need to decrement our object count in the DLL
00079         delete this;
00080         return 0;
00081     }
00082
00083     return m_cref;
00084 }
00085
00086 ///////////////////////////////
00087 // Interface IComponentData
00088 ///////////////////////////////
00089 HRESULT CComponentData::Initialize(
00090                                    /* [in] */ LPUNKNOWN pUnknown)
00091 {
00092     HRESULT hr = S_FALSE;
00093
00094     //
00095     // Get pointer to namespace interface
00096     // First try to get pointer to IConsoleNameSpace2. If that fails, we are in
00097     // MMC1.0, so get pointer to IConsoleNameSpace instead
00098     //
00099
00100     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace2, (void **)&m_ipConsoleNameSpace);
00101
00102     if (S_OK == hr)
00103     {
00104         //We are in MMC 1.1 or higher. QI for IConsole2
00105         hr = pUnknown->QueryInterface(IID_IConsole2, (void **)&m_ipConsole);
00106     }
00107     else //We are in MMC 1.0
00108     {
00109         hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00110         if (FAILED(hr))
00111             return hr;
00112
00113         hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00114     }
00115
00116     return hr;
00117 }
00118
00119 HRESULT CComponentData::CreateComponent(
00120                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00121 {
00122     *ppComponent = NULL;
00123
00124     CComponent *pComponent = new CComponent(this);
00125
00126     if (NULL == pComponent)
00127         return E_OUTOFMEMORY;
00128
00129     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00130 }
00131
00132 HRESULT CComponentData::Notify(
00133                                /* [in] */ LPDATAOBJECT lpDataObject,
00134                                /* [in] */ MMC_NOTIFY_TYPE event,
00135                                /* [in] */ LPARAM arg,
00136                                /* [in] */ LPARAM param)
00137 {
00138   MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00139
00140     //Notify doesn't handle any notifications from MMC, so return E_NOTIMPL
00141     return E_NOTIMPL;
00142 }
00143
00144 HRESULT CComponentData::Destroy( void)
00145 {
00146     // Free interfaces
00147     if (m_ipConsoleNameSpace) {
00148         m_ipConsoleNameSpace->Release();
00149         m_ipConsoleNameSpace = NULL;
00150     }
00151
00152     if (m_ipConsole) {
00153         m_ipConsole->Release();
00154         m_ipConsole = NULL;
00155     }
00156
00157     return S_OK;
00158 }
00159
00160 HRESULT CComponentData::QueryDataObject(
00161                                         /* [in] */ MMC_COOKIE cookie,
00162                                         /* [in] */ DATA_OBJECT_TYPES type,
00163                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00164 {
00165     CDataObject *pObj = NULL;
00166
00167     if (cookie == 0)
00168         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00169     else
00170         pObj = new CDataObject(cookie, type);
00171
00172     if (!pObj)
00173         return E_OUTOFMEMORY;
00174
00175     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00176
00177     return S_OK;
00178 }
00179
00180 HRESULT CComponentData::GetDisplayInfo(
00181                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00182 {
00183     HRESULT hr = S_FALSE;
00184
00185     // if they are asking for the SDI_STR we have one of those to give
00186     if (pScopeDataItem->lParam) {
00187         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00188         if (pScopeDataItem->mask & SDI_STR) {
00189       LPCTSTR pszT = base->GetDisplayName();
00190       MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00191             pScopeDataItem->displayname = pszW;
00192         }
00193
00194         if (pScopeDataItem->mask & SDI_IMAGE) {
00195             pScopeDataItem->nImage = base->GetBitmapIndex();
00196         }
00197     }
00198
00199     return hr;
00200 }
00201
00202 HRESULT CComponentData::CompareObjects(
00203                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00204                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00205 {
00206     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00207     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00208
00209     // compare the object pointers
00210     if (baseA->GetCookie() == baseB->GetCookie())
00211         return S_OK;
00212
00213     return S_FALSE;
00214 }
00215
00216 ///////////////////////////////
00217 // Interface IPersistStream
00218 ///////////////////////////////
00219 HRESULT CComponentData::GetClassID(
00220                                    /* [out] */ CLSID __RPC_FAR *pClassID)
00221 {
00222     *pClassID = m_pStaticNode->getNodeType();
00223
00224     return S_OK;
00225 }
00226
00227 HRESULT CComponentData::IsDirty( void)
00228 {
00229     return m_pStaticNode->isDirty() == true ? S_OK : S_FALSE;
00230 }
00231
00232 HRESULT CComponentData::Load(
00233                              /* [unique][in] */ IStream __RPC_FAR *pStm)
00234 {
00235     void *snapInData = m_pStaticNode->getData();
00236     ULONG dataSize = m_pStaticNode->getDataSize();
00237
00238     return pStm->Read(snapInData, dataSize, NULL);
00239 }
00240
00241 HRESULT CComponentData::Save(
00242                              /* [unique][in] */ IStream __RPC_FAR *pStm,
00243                              /* [in] */ BOOL fClearDirty)
00244 {
00245     void *snapInData = m_pStaticNode->getData();
00246     ULONG dataSize = m_pStaticNode->getDataSize();
00247
00248     if (fClearDirty)
00249         m_pStaticNode->clearDirty();
00250
00251     return pStm->Write(snapInData, dataSize, NULL);
00252 }
00253
00254 HRESULT CComponentData::GetSizeMax(
00255                                    /* [out] */ ULARGE_INTEGER __RPC_FAR *pcbSize)
00256 {
00257     return m_pStaticNode->getDataSize();
00258 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       resource.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by SCPCMenu.rc
00014 //
00015 #define IDS_TEST_STRING                 1
00016 #define IDS_SCP_MENU                    2
00017 #define IDD_SCP_MENU_DIALOG             101
00018 #define IDC_PREFIX_EDIT                 1003
00019 #define IDC_USER_EDIT                   1004
00020 #define IDC_SERVER_EDIT                 1005
00021 #define IDC_SERVER_CONFIG_PATH_EDIT     1006
00022 #define IDC_PATH_EDIT                   1007
00023 #define IDC_CLASS_EDIT                  1008
00024
00025 // Next default values for new objects
00026 //
00027 #ifdef APSTUDIO_INVOKED
00028 #ifndef APSTUDIO_READONLY_SYMBOLS
00029 #define _APS_NEXT_RESOURCE_VALUE        102
00030 #define _APS_NEXT_COMMAND_VALUE         40001
00031 #define _APS_NEXT_CONTROL_VALUE         1004
00032 #define _APS_NEXT_SYMED_VALUE           101
00033 #endif
00034 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/WMIDiskPerf/DpDetail.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • WMIDiskPerf

DpDetail.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002 //
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 //  File:  dpdetail.cpp
00006 //
00007 //  Description:
00008 //    This file implements the DiskPerfDetails() routine which
00009 //    demonstrates how to enumerate properties for the DiskPerf
00010 //    class and instances.
00011 //
00012 //  Part of : WMIDiskPerf
00013 //
00014 //  History:
00015 //
00016 //***************************************************************************
00017 #include <wbemidl.h>
00018 #include <stdio.h>
00019 #include <strsafe.h>
00020
00021 void ShowPropInfo( IWbemClassObject *pInst );
00022
00023 char PropListHeader[] =
00024   "DiskPerf Property Descriptions:\n\n"
00025   "WMI Data ID\tProperty\tDescription\n"
00026   "======================================="
00027   "=======================================\n"
00028   "";
00029
00030
00031 //==============================================================================
00032 //
00033 //  DiskPerfDetails( IWbemServices * pIWbemServices )
00034 //
00035 //==============================================================================
00036 void DiskPerfDetails( IWbemServices * pIWbemServices )
00037 {
00038   HRESULT   hr;
00039   long    lLower, lUpper, lCount;
00040   SAFEARRAY *psaNames = NULL;
00041   BSTR    PropName  = NULL;
00042   VARIANT   vVal;
00043   ULONG   uReturned;
00044
00045   IEnumWbemClassObject  *pEnum      = NULL;
00046   IWbemClassObject    *pPerfData  = NULL;
00047   IWbemClassObject    *pPerfInst  = NULL;
00048   IWbemQualifierSet   *pQualSet   = NULL;
00049   VariantInit( &vVal );
00050   // Alloc class name string for DiskPerf
00051   BSTR PerfClass = SysAllocString( L"MSDiskDriver_PerformanceData" );
00052   if (!PerfClass)
00053   {
00054     printf("Out of memory\n");
00055     return;
00056   }
00057
00058   // Get the Descriptions for the WMIDataId properties in the Embedded class.
00059   // Here the object info for the Class - MSDiskDriver_PerformanceData is
00060   // retrieved and displayed.
00061   // Collect object information for PerfClass
00062     hr = pIWbemServices->GetObject( PerfClass,
00063                                     0L,
00064                                     NULL,
00065                                     &pPerfData,
00066                                       NULL );
00067     SysFreeString( PerfClass );
00068
00069     PerfClass = NULL;
00070   if ( hr == WBEM_NO_ERROR )
00071   {
00072     // show the property description list header
00073     printf( PropListHeader );
00074
00075     // Load up a safearray of property names
00076     if ( ( pPerfData->GetNames( NULL,
00077                                 WBEM_FLAG_ALWAYS | WBEM_FLAG_NONSYSTEM_ONLY,
00078                                 NULL,
00079                                 &psaNames ) ) == WBEM_NO_ERROR )
00080     {
00081       // Get the upper and lower bounds of the Names array
00082       if ( ( hr = SafeArrayGetLBound( psaNames, 1, &lLower ) ) == S_OK )
00083       {
00084         hr = SafeArrayGetUBound( psaNames, 1, &lUpper );
00085       }
00086
00087       if ( hr != S_OK )
00088       {
00089         printf( "Problem with property name array.\n" );
00090       }
00091       else
00092       {
00093         BSTR WmiQual  = SysAllocString( L"WmiDataId" );
00094         if (!WmiQual)
00095         {
00096           pPerfData->Release( );
00097           SafeArrayDestroy( psaNames );
00098           printf("Out of memory\n");
00099           return;
00100         }
00101         BSTR DescQual = SysAllocString( L"Description" );
00102         if (!DescQual)
00103         {
00104           pPerfData->Release( );
00105           SafeArrayDestroy( psaNames );
00106           SysFreeString(WmiQual);
00107           printf("Out of memory\n");
00108           return;
00109         }
00110         UINT uWmiId;
00111
00112         for ( lCount = lLower; lCount <= lUpper; lCount++ )
00113         {
00114           // get the property name for this element
00115           if ( ( SafeArrayGetElement( psaNames,
00116                                       &lCount,
00117                                       &PropName)) == S_OK )
00118           {
00119             if ( ( pPerfData->GetPropertyQualifierSet( PropName, &pQualSet ) ) == WBEM_NO_ERROR )
00120             {
00121               // check to see if the property is a WMI data Item and save its description
00122               // these are the DiskPerf counters
00123               if ( ( pQualSet->Get( WmiQual, 0L, &vVal, NULL ) ) == WBEM_NO_ERROR )
00124               {
00125                 uWmiId = vVal.lVal;
00126
00127                 VariantClear( &vVal );
00128                 if ( ( pQualSet->Get( DescQual, 0L, &vVal, NULL ) ) == WBEM_NO_ERROR )
00129                 {
00130                   wprintf( L"( %d )\t\t%s\t%s\n", uWmiId, PropName, vVal.bstrVal );
00131                   VariantClear( &vVal );
00132                 }
00133                 else // No Description qualifier available
00134                   wprintf( L"( %d )\t\t%s\n", uWmiId, PropName);
00135
00136               }
00137
00138               pQualSet->Release( );
00139               pQualSet = NULL;
00140             }
00141             SysFreeString( PropName );
00142                               PropName  = NULL;
00143           }
00144         }
00145         SysFreeString( WmiQual );
00146         SysFreeString( DescQual );
00147       }
00148       SafeArrayDestroy( psaNames );
00149     }
00150     pPerfData->Release( );
00151   }
00152
00153
00154   // Now that the data class info is displayed, go get the values for all the
00155   // disk instances
00156   PerfClass = SysAllocString( L"MSDiskDriver_Performance" );
00157   if (!PerfClass)
00158   {
00159     printf("Out of memory\n");
00160     return;
00161   }
00162
00163   // Create enumerator for all disk instances
00164   hr = pIWbemServices->CreateInstanceEnum( PerfClass,
00165                                            WBEM_FLAG_SHALLOW,
00166                                            NULL,
00167                                            &pEnum );
00168   SysFreeString( PerfClass );
00169   PerfClass = NULL;
00170
00171   if ( hr == WBEM_NO_ERROR )
00172   {
00173         while ( pEnum->Next( INFINITE,
00174                          1,
00175                              &pPerfInst,
00176                              &uReturned ) == WBEM_NO_ERROR )
00177     {
00178       // Explicitly get the properties of InstanceName and Active state
00179
00180       // Get the Instance Name string
00181       PropName = L"InstanceName";
00182       if ( ( pPerfInst->Get( PropName,
00183                              0L,
00184                              &vVal,
00185                              NULL, NULL ) ) == WBEM_NO_ERROR )
00186       {
00187         wprintf( L"\n%s\n", vVal.bstrVal );
00188         VariantClear( &vVal );
00189       }
00190
00191       // Get Active status boolean
00192
00193       PropName = L"Active";
00194       if ( ( pPerfInst->Get( PropName,
00195                              0L,
00196                              &vVal,
00197                              NULL, NULL ) ) == WBEM_NO_ERROR )
00198       {
00199         wprintf( L"\t%s\t\t= %s\n", PropName, vVal.boolVal ? L"TRUE" : L"FALSE" );
00200         VariantClear( &vVal );
00201       }
00202
00203       // Get the performance data embedded object
00204       PropName = L"PerfData" ;
00205       if ( ( pPerfInst->Get( PropName,
00206                              0L,
00207                              &vVal,
00208                              NULL, NULL ) ) == WBEM_NO_ERROR )
00209       {
00210         if ( vVal.punkVal->QueryInterface( IID_IWbemClassObject,
00211                                           (PVOID *) &pPerfData ) == S_OK )
00212         {
00213           // display the WMI data item from this instance
00214           ShowPropInfo( pPerfData );
00215           pPerfData->Release( );
00216         }
00217         VariantClear( &vVal );
00218       }
00219
00220       pPerfInst->Release( );
00221     }
00222     pEnum->Release( );
00223   }
00224   else
00225   {
00226     printf( "Can't enumerate DiskPerf instances!\n" );
00227   }
00228 }
00229
00230
00231 // Display property names and values for an instance.
00232 void ShowPropInfo( IWbemClassObject *pInst )
00233 {
00234   HRESULT hr;
00235   VARIANT vVal;
00236   BSTR PropName;
00237
00238   if ( pInst )
00239   {
00240     hr = pInst->BeginEnumeration( WBEM_FLAG_LOCAL_ONLY );
00241     while ( hr == WBEM_NO_ERROR )
00242     {
00243       if ( ( hr = pInst->Next( 0, &PropName,
00244                                &vVal,
00245                                NULL, NULL ) ) == WBEM_NO_ERROR )
00246       {
00247         switch( vVal.vt )
00248         {
00249           case VT_I4:
00250           {
00251             wprintf( L"\t%s\t= %d\n", PropName, vVal.lVal );
00252           }
00253           break;
00254           case VT_BSTR:
00255           {
00256             wprintf( L"\t%s\t= %s\n", PropName, vVal.bstrVal );
00257           }
00258           break;
00259           default:
00260           {
00261             wprintf( L"\t%s\t= NULL\n", PropName );
00262           }
00263           break;
00264         }
00265         VariantClear( &vVal );
00266         SysFreeString( PropName );
00267       }
00268     }
00269     pInst->EndEnumeration(  );
00270   }
00271 }
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CScrollableView Member List

This is the complete list of members for CScrollableView, including all inherited members.
_iScale | CView | [protected]
_nHScrollPos | CScrollableView | [protected]
_nVScrollPos | CScrollableView | [protected]
_ptClient | CView | [protected]
_ptOrg | CView | [protected]
_ptScroll | CView | [protected]
_size | CView | [protected]
CScrollableView(int cx, int cy) | CScrollableView | [inline]
CView(int cx, int cy) | CView |
GetScale(UINT &iScale) | CScrollableView | [inline]
Hittest(CCanvas &canvas, POINT pt, CModel *_pModel) | CView |
Invalidate(HWND hwnd, LPRECT lpRect=NULL) | CView |
Paint(CCanvas &canvas, CModel *_pModel, RECT rc) | CView |
Scroll(CCanvas &canvas) | CView | [protected]
SetHScrollPos(HWND hwnd, WPARAM wParam, LPARAM lParam, CModel *pModel) | CScrollableView |
SetScale(UINT iScale) | CScrollableView | [inline]
SetSize(int cx, int cy) | CView |
SetVScrollPos(HWND hwnd, WPARAM wParam, LPARAM lParam, CModel *pModel) | CScrollableView |
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InstDef Member List

This is the complete list of members for InstDef, including all inherited members.
lValue | InstDef
pwcKey | InstDef
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/SpinCube.h Source File

  • WinUI
  • Controls
  • Custom
  • SpinCube

SpinCube.h

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *
00003 *                                  SPINCUBE.H
00004 *
00005 \******************************************************************************/
00006
00007 #include <custcntl.h>
00008
00009
00010
00011 /******************************************************************************\
00012 *                               SYMBOLIC CONSTANTS
00013 \******************************************************************************/
00014
00015 #define SPINCUBECLASS           TEXT("Spincube")
00016 #define SPINCUBEDESCRIPTION     TEXT("An animated control")
00017 #define SPINCUBEDEFAULTTEXT     TEXT(":-)")
00018
00019 #define CCHSTYLE                20  // size of style string, i.e. "SS_ERASE"
00020
00021 #define NUM_SPINCUBE_STYLES     2
00022
00023 #define SS_ERASE                0x0001  // spincube window styles
00024 #define SS_INMOTION             0x0002
00025
00026
00027 #define SPINCUBE_EXTRA          4   // number of extra bytes for spincube class
00028
00029 #define SPIN_EVENT              1   // timer event id to repaint control
00030 #ifdef _ALPHA_
00031 #define SPIN_INTERVAL           0   // milliseconds between repaints. what
00032                                     //   would be really cool is a way to
00033                                     //   dynamically adjust the interval-
00034                                     //   on real fast machines we might
00035                                     //   almost be able to get decent-looking
00036                                     //   animation! :)
00037
00038 #else
00039 #define SPIN_INTERVAL           75  // milliseconds between repaints. what
00040                                     //   would be really cool is a way to
00041                                     //   dynamically adjust the interval-
00042                                     //   on real fast machines we might
00043                                     //   almost be able to get decent-looking
00044                                     //   animation! :)
00045
00046 #endif
00047 #define DID_ERASE               101 // dialog control id's
00048 #define DID_INMOTION            102
00049 #define DID_OK                  103
00050
00051 #define GWL_SPINCUBEDATA        0   // offset of control's instance data
00052
00053 #define SPINCUBE_REPAINT_BKGND  0x00000001
00054
00055 #define DO_ERASE(hwnd)          GetWindowLongPtr(hwnd,GWL_STYLE) & SS_ERASE \
00056                                            ? TRUE : FALSE
00057
00058 #define IN_MOTION(hwnd)         GetWindowLongPtr(hwnd,GWL_STYLE) & SS_INMOTION \
00059                                            ? TRUE : FALSE
00060
00061 #define REPAINT_BKGND(pSCI)     pSCI->iOptions&SPINCUBE_REPAINT_BKGND \
00062                                            ? TRUE : FALSE
00063
00064 #define IDS_REGCLASSFAIL      16
00065 #define IDS_UNREGFAIL         17
00066 #define IDS_DLGBOXFAIL        18
00067 #define IDS_ALLOCFAIL         19
00068 #define IDS_CREATEDCFAIL      20
00069 #define IDS_CREATEBITMAPFAIL  21
00070
00071 #define ARRAYSIZE(x)            (sizeof(x)/sizeof(x[0]))
00072
00073
00074
00075 /******************************************************************************\
00076 *                                    TYPEDEFs
00077 \******************************************************************************/
00078
00079 typedef struct
00080 {
00081   HDC      hdcCompat;               // the DC that will contain our off-screen
00082                                     //   image
00083   HBITMAP  hbmSave;                 // Save previous selected bitmap
00084   HBITMAP  hbmCompat;               // The bitmap that will contain the actual
00085                                     //   image, i.e. we will always do our
00086                                     //   drawing on this bmp & then blt the
00087                                     //   result to the screen.
00088
00089   float    fCurrentXRotation;       // Angle (in radians) to rotate cube about
00090   float    fCurrentYRotation;       //   x, y, z axis
00091   float    fCurrentZRotation;
00092
00093   float    fCurrentXRotationInc;    // Amount to inc rotation angle each
00094   float    fCurrentYRotationInc;    //   time we repaint (and are in motion)
00095   float    fCurrentZRotationInc;
00096
00097   int      iCurrentXTranslation;    // Distance (in pels) to translate cube
00098   int      iCurrentYTranslation;
00099   int      iCurrentZTranslation;
00100
00101   int      iCurrentXTranslationInc; // Amount to inc translation distance each
00102   int      iCurrentYTranslationInc; //   time we repaint (and are in motion)
00103   int      iCurrentZTranslationInc;
00104
00105   RECT     rcCubeBoundary;          // Bounding rectangle (in 2D) of the last
00106                                     //   cube drawn.  We invalidate only this
00107                                     //   region when we're doing animation
00108                                     //   and get the WM_TIMER- it's alot more
00109                                     //   efficient that invalidating the whole
00110                                     //   control (there's less screen flashing.
00111
00112   int      iOptions;                // Contains the current options for this
00113                                     //   ctrl, i.e. erase background.
00114
00115 } SPINCUBEINFO, *PSPINCUBEINFO;
00116
00117
00118
00119 /******************************************************************************\
00120 *                                FUNCTION PROTOTYPES
00121 \******************************************************************************/
00122
00123 INT     CALLBACK SpincubeSizeToText (DWORD, DWORD, HFONT,  LPTSTR);
00124 BOOL    CALLBACK SpincubeStyle      (HWND,  LPCCSTYLE);
00125 LRESULT CALLBACK SpincubeWndProc    (HWND,  UINT,  WPARAM, LPARAM);
00126 LRESULT CALLBACK SpincubeDlgProc    (HWND,  UINT,  WPARAM, LPARAM);
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IADsErrorVtbl Member List

This is the complete list of members for IADsErrorVtbl, including all inherited members.
cNames | IADsErrorVtbl
dispIdMember | IADsErrorVtbl
hResult | IADsErrorVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(IADsError __RPC_FAR *This | IADsErrorVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(IADsError __RPC_FAR *This | IADsErrorVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(IADsError __RPC_FAR *This | IADsErrorVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(IADsError __RPC_FAR *This | IADsErrorVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(IADsError __RPC_FAR *This | IADsErrorVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetErrorMessage)(IADsError __RPC_FAR *This | IADsErrorVtbl
iTInfo | IADsErrorVtbl
lcid | IADsErrorVtbl
lcid | IADsErrorVtbl
lcid | IADsErrorVtbl
pbMsg | IADsErrorVtbl
pctinfo | IADsErrorVtbl
pDispParams | IADsErrorVtbl
pExcepInfo | IADsErrorVtbl
ppTInfo | IADsErrorVtbl
ppvObject | IADsErrorVtbl
puArgErr | IADsErrorVtbl
pVarResult | IADsErrorVtbl
rgDispId | IADsErrorVtbl
rgszNames | IADsErrorVtbl
riid | IADsErrorVtbl
riid | IADsErrorVtbl
riid | IADsErrorVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(IADsError __RPC_FAR *This) | IADsErrorVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(IADsError __RPC_FAR *This) | IADsErrorVtbl
wFlags | IADsErrorVtbl
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Poly.h Source File

  • Multimedia
  • Gdi
  • GdiDemo

Poly.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012
00013 #ifdef WIN16
00014 #define APIENTRY FAR PASCAL
00015 typedef WORD WPARAM;
00016 //#else
00017 //typedef DWORD WPARAM;
00018 #endif
00019
00020
00021 #define POLYCLASS  "POLYDEMO"
00022
00023 #define MAX_BEZIER 80
00024 #define VELMAX     10
00025 #define VELMIN      2
00026 #define BEZ_CURVES  1              //Number of Curves in the Bezier
00027 #define BEZ_PTS    3*BEZ_CURVES+1  //Number of Points is the #Curves * 3 + 1
00028
00029
00030 /*
00031 ** This structue defines a basic bezier curve.  It is intended to be used in
00032 ** an array of beziers.
00033 */
00034 typedef struct _BEZBUFFER
00035 {
00036     POINT pPts[BEZ_PTS];
00037 } BEZBUFFER;
00038 typedef BEZBUFFER      *PBEZBUFFER;
00039 typedef BEZBUFFER NEAR *NPBEZBUFFER;
00040 typedef BEZBUFFER FAR  *LPBEZBUFFER;
00041
00042
00043 /*
00044 ** This is the main object for the polybezier window.  This structure defines
00045 ** a series of bezier curves and the distance between each curve.
00046 */
00047 typedef struct _POLYDATA
00048 {
00049     int      nBezTotal;
00050     int      nBezCurr;
00051     int      nColor;
00052     POINT    pVel[BEZ_PTS];
00053     HANDLE   hBezBuffer;
00054 } POLYDATA;
00055 typedef POLYDATA      *PPOLYDATA;
00056 typedef POLYDATA NEAR *NPPOLYDATA;
00057 typedef POLYDATA FAR  *LPPOLYDATA;
00058
00059
00060 /*
00061 ** POLYBEZIER WINDOW ROUTINES (poly.c)
00062 */
00063 HWND  FAR      CreatePolyWindow(HWND,int);
00064 LRESULT  CALLBACK PolyProc(HWND,UINT,WPARAM,LPARAM);
00065 BOOL           PolyCreateProc(HWND);
00066 VOID           PolyDestroyProc(HWND);
00067 BOOL           PolyCommandProc(HWND,WPARAM,LPARAM);
00068 VOID           PolyPaintProc(HWND);
00069
00070
00071 VOID           PolyRedraw(HWND);
00072 int            PolyNewVel(int);
00073 VOID           PolyInitPoints(HWND);
00074 VOID           PolyDrawBez(HWND);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpwizard/SCPPageUI.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpwizard

SCPPageUI.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       SCPPageUI.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "SCPPageUI.h"
00013 #include "SCPWiz.h"
00014 #include "util.h"
00015
00016 BEGIN_MESSAGE_MAP(CSCPPageGeneral, CPropertyPage)
00017   ON_EN_CHANGE(IDC_NAME_EDIT, OnNameChange)
00018   ON_EN_CHANGE(IDC_DNS_NAME_EDIT, OnDNSNameChange)
00019   ON_EN_CHANGE(IDC_SERVICE_CLASS_EDIT, OnServiceClassChange)
00020   ON_EN_CHANGE(IDC_DNS_NAME_TYPE_EDIT, OnDNSNameTypeChange)
00021 END_MESSAGE_MAP()
00022
00023 BOOL CSCPPageGeneral::OnInitDialog()
00024 {
00025   BOOL bResult = CPropertyPage::OnInitDialog();
00026
00027   //
00028   // Set the name of the container
00029   //
00030   SetDlgItemText(IDC_EDIT_CONTAINER, m_pWizExt->GetContainerCanonicalName());
00031
00032   //
00033   // Set the class icon
00034   //
00035   ((CStatic*)GetDlgItem(IDC_STATIC_ICON))->SetIcon(m_pWizExt->GetClassIcon());
00036
00037   // Disable the Next wizard button until all the controls are filled with valid data.
00038   HRESULT hr = m_pWizExt->GetIDsAdminNewObj()->SetButtons(0, FALSE);
00039   if (FAILED(hr))
00040   {
00041     // Give error message if the buttons don't get set
00042     CString szErrorMessage;
00043     szErrorMessage.Format(_T("SetButtons(0, FALSE) failed with %x"), hr);
00044     AfxMessageBox(szErrorMessage);
00045   }
00046   return bResult;
00047 }
00048
00049 void CSCPPageGeneral::OnDNSNameChange()
00050 {
00051   GetDlgItem(IDC_DNS_NAME_EDIT)->GetWindowText(m_szServiceDNSName);
00052   SetWizardButtons();
00053 }
00054
00055 void CSCPPageGeneral::OnDNSNameTypeChange()
00056 {
00057   GetDlgItem(IDC_DNS_NAME_TYPE_EDIT)->GetWindowText(m_szServiceDNSNameType);
00058   SetWizardButtons();
00059 }
00060
00061 void CSCPPageGeneral::OnServiceClassChange()
00062 {
00063   GetDlgItem(IDC_SERVICE_CLASS_EDIT)->GetWindowText(m_szServiceClassName);
00064   SetWizardButtons();
00065 }
00066
00067 void CSCPPageGeneral::OnNameChange()
00068 {
00069   GetDlgItem(IDC_NAME_EDIT)->GetWindowText(m_szName);
00070   if (m_pWizExt->GetObj() != NULL)
00071   {
00072     m_bNeedCreate = TRUE;
00073   }
00074   SetWizardButtons();
00075 }
00076
00077 BOOL CSCPPageGeneral::OnKillActive()
00078 {
00079   HRESULT hr = S_OK;
00080   BOOL bRet = TRUE;
00081
00082   // Write changes to temporary object
00083   ASSERT(m_pWizExt != NULL);
00084   CComPtr<IDsAdminNewObjPrimarySite> spPrimarySite;
00085   spPrimarySite = m_pWizExt->GetIDsAdminNewObjPrimarySite();
00086   ASSERT(spPrimarySite != NULL);
00087
00088   if (spPrimarySite != NULL)
00089   {
00090     CString szName;
00091     GetDlgItem(IDC_NAME_EDIT)->GetWindowText(szName);
00092     if (!szName.IsEmpty() && m_bNeedCreate)
00093     {
00094       hr = spPrimarySite->CreateNew(szName);
00095       if (FAILED(hr))
00096       {
00097         AfxMessageBox(_T("Failed to create temporary object."));
00098         bRet = FALSE;
00099       }
00100       else
00101       {
00102         m_bNeedCreate = FALSE;
00103       }
00104     }
00105   }
00106
00107   if (m_pWizExt->GetObj() != NULL && bRet)
00108   {
00109     CString szDescription;
00110     GetDlgItem(IDC_DESCRIPTION_EDIT)->GetWindowText(szDescription);
00111     if (!szDescription.IsEmpty())
00112     {
00113       hr = SetStringAttribute(m_pWizExt->GetObj(), L"adminDescription", szDescription);
00114       if (FAILED(hr))
00115       {
00116         AfxMessageBox(_T("Failed to set the description."));
00117         bRet = FALSE;
00118       }
00119     }
00120     if (bRet)
00121     {
00122       hr = SetStringAttribute(m_pWizExt->GetObj(), L"serviceClassName", m_szServiceClassName);
00123       if (FAILED(hr))
00124       {
00125         AfxMessageBox(_T("Failed to set the service class name."));
00126         bRet = FALSE;
00127       }
00128     }
00129
00130     if (bRet)
00131     {
00132       hr = SetStringAttribute(m_pWizExt->GetObj(), L"serviceDNSName", m_szServiceDNSName);
00133       if (FAILED(hr))
00134       {
00135         AfxMessageBox(_T("Failed to set the service DNS name."));
00136         bRet = FALSE;
00137       }
00138     }
00139
00140     if (bRet)
00141     {
00142       hr = SetStringAttribute(m_pWizExt->GetObj(), L"serviceDNSNameType", m_szServiceDNSNameType);
00143       if (FAILED(hr))
00144       {
00145         AfxMessageBox(_T("Failed to set the service DNS name type."));
00146         bRet = FALSE;
00147       }
00148     }
00149
00150   }
00151
00152   return bRet;
00153 }
00154
00155 BOOL CSCPPageGeneral::OnSetActive()
00156 {
00157   SetWizardButtons();
00158   return TRUE;
00159 }
00160
00161 void CSCPPageGeneral::SetWizardButtons()
00162 {
00163   ASSERT(m_pWizExt != NULL);
00164
00165   //
00166   // Enable the next button if the user has supplied a name, dns name,
00167   // class name, and dns name type
00168   //
00169   BOOL bValid = FALSE;
00170   if (!m_szName.IsEmpty() &&
00171       !m_szServiceDNSName.IsEmpty() &&
00172       !m_szServiceClassName.IsEmpty() &&
00173       !m_szServiceDNSNameType.IsEmpty())
00174   {
00175     bValid = TRUE;
00176   }
00177   HRESULT hr = m_pWizExt->GetIDsAdminNewObj()->SetButtons(0, bValid);
00178 }
00179
00180 void CSCPPageGeneral::GetSummaryInfo(CString& szSummary)
00181 {
00182   szSummary =   _T("Name:\t") + m_szName + _T("\n");
00183   szSummary +=  _T("Service DNS Name:\t") + m_szServiceDNSName + _T("\n");
00184   szSummary +=  _T("Service DNS Name Type:\t") + m_szServiceDNSNameType + _T("\n");
00185   szSummary +=  _T("Service Class Name:\t") + m_szServiceClassName + _T("\n");
00186
00187   CString szDescription;
00188   GetDlgItem(IDC_DESCRIPTION_EDIT)->GetWindowText(szDescription);
00189   if (!szDescription.IsEmpty())
00190   {
00191     szSummary += _T("Description:\t") + szDescription + _T("\n");
00192   }
00193 }
00194
00195 //
00196 //
00197 //
00198
00199
00200 BEGIN_MESSAGE_MAP(CSCPPageBindingInfo, CPropertyPage)
00201   ON_BN_CLICKED(IDC_ADD_BUTTON, OnButtonClick)
00202   ON_BN_CLICKED(IDC_DELETE_BUTTON, OnButtonClick)
00203 END_MESSAGE_MAP()
00204
00205 CSCPPageBindingInfo::CSCPPageBindingInfo(CSCPWiz* pWizExt)
00206   : CPropertyPage(IDD_SCP_PAGE_BINDING_INFO)
00207 {
00208   m_pWizExt = pWizExt;
00209   m_pAttributeEditor = NULL;
00210 }
00211
00212
00213 BOOL CSCPPageBindingInfo::OnInitDialog()
00214 {
00215   BOOL bResult = CPropertyPage::OnInitDialog();
00216
00217   //
00218   // Set the name of the container
00219   //
00220   SetDlgItemText(IDC_EDIT_CONTAINER, m_pWizExt->GetContainerCanonicalName());
00221
00222   //
00223   // Set the class icon
00224   //
00225   ((CStatic*)GetDlgItem(IDC_STATIC_ICON))->SetIcon(m_pWizExt->GetClassIcon());
00226
00227   // Disable the Next wizard button until all the controls are filled with valid data.
00228   HRESULT hr = m_pWizExt->GetIDsAdminNewObj()->SetButtons(1, FALSE);
00229   if (FAILED(hr))
00230   {
00231     // Give error message if the buttons don't get set
00232     CString szErrorMessage;
00233     szErrorMessage.Format(_T("SetButtons(1, FALSE) failed with %x"), hr);
00234     AfxMessageBox(szErrorMessage);
00235   }
00236
00237   m_pAttributeEditor = new CMultiValuedAttributeEditor(m_szValueList);
00238   m_pAttributeEditor->Initialize(IDC_KEYWORD_EDIT,
00239                                   IDC_KEYWORD_LIST,
00240                                   IDC_ADD_BUTTON,
00241                                   IDC_DELETE_BUTTON,
00242                                   this);
00243
00244   return bResult;
00245 }
00246
00247 BOOL CSCPPageBindingInfo::OnKillActive()
00248 {
00249   BOOL bRet = TRUE;
00250   HRESULT hr = S_OK;
00251
00252   // Write changes to temporary object
00253   ASSERT(m_pWizExt != NULL);
00254   if (m_pWizExt != NULL && m_pWizExt->GetObj() != NULL)
00255   {
00256     hr = SetStringListAttribute(m_pWizExt->GetObj(), L"serviceBindingInformation", m_szValueList);
00257     if (FAILED(hr))
00258     {
00259       AfxMessageBox(_T("Failed to set binding information in temporary object."));
00260       bRet = FALSE;
00261     }
00262   }
00263   return bRet;
00264 }
00265
00266 BOOL CSCPPageBindingInfo::OnSetActive()
00267 {
00268   SetWizardButtons();
00269   return TRUE;
00270 }
00271
00272 void CSCPPageBindingInfo::OnButtonClick()
00273 {
00274   SetWizardButtons();
00275 }
00276
00277 void CSCPPageBindingInfo::SetWizardButtons()
00278 {
00279   ASSERT(m_pWizExt != NULL);
00280
00281   //
00282   // Enable the next button if the user has supplied at least one value
00283   //
00284   BOOL bValid = (m_szValueList.GetCount() > 0) ? TRUE : FALSE;
00285   HRESULT hr = m_pWizExt->GetIDsAdminNewObj()->SetButtons(1, bValid);
00286 }
00287
00288 void CSCPPageBindingInfo::GetSummaryInfo(CString& szSummary)
00289 {
00290   szSummary = _T("Binding Info:\n");
00291   POSITION pos = m_szValueList.GetHeadPosition();
00292   while (pos != NULL)
00293   {
00294     CString szValue = m_szValueList.GetNext(pos);
00295     szSummary += _T("\t") + szValue + _T("\n");
00296   }
00297 }
00298
00299 //
00300 //
00301 //
00302
00303
00304 BEGIN_MESSAGE_MAP(CSCPPageKeywords, CPropertyPage)
00305 END_MESSAGE_MAP()
00306
00307 CSCPPageKeywords::CSCPPageKeywords(CSCPWiz* pWizExt)
00308   : CPropertyPage(IDD_SCP_PAGE_KEYWORDS)
00309 {
00310   m_pWizExt = pWizExt;
00311   m_pAttributeEditor = NULL;
00312 }
00313
00314 BOOL CSCPPageKeywords::OnInitDialog()
00315 {
00316   BOOL bResult = CPropertyPage::OnInitDialog();
00317
00318   //
00319   // Set the name of the container
00320   //
00321   SetDlgItemText(IDC_EDIT_CONTAINER, m_pWizExt->GetContainerCanonicalName());
00322
00323   //
00324   // Set the class icon
00325   //
00326   ((CStatic*)GetDlgItem(IDC_STATIC_ICON))->SetIcon(m_pWizExt->GetClassIcon());
00327
00328   // Disable the Next wizard button until all the controls are filled with valid data.
00329   HRESULT hr = m_pWizExt->GetIDsAdminNewObj()->SetButtons(2, FALSE);
00330   if (FAILED(hr))
00331   {
00332     // Give error message if the buttons don't get set
00333     CString szErrorMessage;
00334     szErrorMessage.Format(_T("SetButtons(2, FALSE) failed with %x"), hr);
00335     AfxMessageBox(szErrorMessage);
00336   }
00337
00338
00339   m_pAttributeEditor = new CMultiValuedAttributeEditor(m_szValueList);
00340   m_pAttributeEditor->Initialize(IDC_KEYWORD_EDIT,
00341                                   IDC_KEYWORD_LIST,
00342                                   IDC_ADD_BUTTON,
00343                                   IDC_DELETE_BUTTON,
00344                                   this);
00345
00346
00347   return bResult;
00348 }
00349
00350 BOOL CSCPPageKeywords::OnKillActive()
00351 {
00352   BOOL bRet = TRUE;
00353   HRESULT hr = S_OK;
00354
00355   // Write changes to temporary object
00356   ASSERT(m_pWizExt != NULL);
00357   if (m_pWizExt != NULL && m_pWizExt->GetObj() != NULL)
00358   {
00359     if (m_szValueList.GetCount() > 0)
00360     {
00361       hr = SetStringListAttribute(m_pWizExt->GetObj(), L"keywords", m_szValueList);
00362       if (FAILED(hr))
00363       {
00364         AfxMessageBox(_T("Failed to set keywords in temporary object."));
00365         bRet = FALSE;
00366       }
00367     }
00368   }
00369   return bRet;
00370 }
00371
00372 BOOL CSCPPageKeywords::OnSetActive()
00373 {
00374   SetWizardButtons();
00375   return TRUE;
00376 }
00377
00378 void CSCPPageKeywords::SetWizardButtons()
00379 {
00380   ASSERT(m_pWizExt != NULL);
00381
00382   //
00383   // Enable the next button if the user has supplied at least on value
00384   //
00385   BOOL bValid = TRUE;
00386   HRESULT hr = m_pWizExt->GetIDsAdminNewObj()->SetButtons(2, bValid);
00387 }
00388
00389 void CSCPPageKeywords::GetSummaryInfo(CString& szSummary)
00390 {
00391   szSummary = _T("Keywords:\n");
00392   POSITION pos = m_szValueList.GetHeadPosition();
00393   while (pos != NULL)
00394   {
00395     CString szValue = m_szValueList.GetNext(pos);
00396     szSummary += _T("\t") + szValue + _T("\n");
00397   }
00398 }
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/AsyncRPC/AsyncRPCc.c Source File

  • NetDS
  • RPC
  • AsyncRPC

AsyncRPCc.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright Microsoft Corp. 1992 - 2000
00007 //
00008 // FILE:      AsyncRPCc.c
00009 //
00010 // USAGE:     AsyncRPCc /?
00011 //
00012 // PURPOSE:   Client side main program
00013 //
00014 // COMMENTS:  The Microsoft RPC AsyncRPC sample program demonstrates
00015 //            the use of the [async] attribute and the related asynchronous
00016 //            RPC API functions. The client will first call the asynchronous
00017 //            function. The time it will take to run on the server side is
00018 //            specified by the user and is passed by the asynchronous function
00019 //            to the server as one of its parameters (asynchronous_delay).
00020 //            The non-asynchronous routine is called next while the asynchronous one
00021 //            is still running on the server side. The asynchronous routine can be
00022 //            cancelled by supplying the command line option "-c".
00023 //
00024 //            The user can choose any of the following three types of asynchronous
00025 //            notification methods: event, iocp, or apc.
00026 //
00027 //            For more information, see MSDN online reference.
00028 //
00029 // WRITTEN BY:    Mike Liu
00030 //
00031
00032 #include <stdlib.h>
00033 #include <stdio.h>
00034 #include <ctype.h>
00035 #include "AsyncRPC.h"   // header file generated by MIDL compiler
00036
00037 #define DEFAULT_NOTIFICATION "event"
00038 #define DEFAULT_MESSAGE      "message from client"
00039
00040 void Usage(char * pszProgramName)
00041 {
00042    fprintf(stderr, "USAGE:  %s\n", pszProgramName);
00043    fprintf(stderr, "          -p protocol_sequence\n");
00044    fprintf(stderr, "          -e endpoint\n");
00045    fprintf(stderr, "          -n network_address\n");
00046    fprintf(stderr, "          -o network_options\n");
00047    fprintf(stderr, "          -m notification_method\n");
00048    fprintf(stderr, "          -d asynchronous_delay\n");
00049    fprintf(stderr, "          -c\n");
00050    fprintf(stderr, "          -s\n\n");
00051
00052    fprintf(stderr, "DESCRIPTION:\n");
00053    fprintf(stderr, " -p protocol_sequence:\n"
00054                    "   Specifies the protocol sequence (default is %s).\n",
00055                    DEFAULT_PROTOCOL_SEQUENCE);
00056    fprintf(stderr, " -e endpoint:\n"
00057                    "   Specifies the endpoint (default is %s).\n",
00058                    DEFAULT_ENDPOINT);
00059    fprintf(stderr, " -n network_address:\n"
00060                    "   Specifies the host name or IP address (default is localhost).\n");
00061    fprintf(stderr, " -o network_options:\n"
00062                    "   Specified the network options.\n");
00063    fprintf(stderr, " -m notification_method:\n"
00064                    "   Specifies the notification method used by the asynchronous function.\n"
00065                    "   Supported method: event, iocp, or apc (default is %s).\n",
00066                    DEFAULT_NOTIFICATION);
00067    fprintf(stderr, " -d asynchronous_delay:\n"
00068                    "   Specifies the number of seconds how long the asynchronous function\n"
00069                    "   will take ro run on the server (default is %u seconds).\n",
00070                    DEFAULT_ASYNC_DELAY);
00071    fprintf(stderr, " -c:\n"
00072                    "   Indicates the asynchronous call will be cancelled.\n");
00073    fprintf(stderr, " -s:\n"
00074                    "   Indicates the server will be shutdown.\n");
00075    exit(1);
00076 }
00077
00078
00079 void RPC_ENTRY APCNotificationRoutine(PRPC_ASYNC_STATE pAsync,
00080                                       void *Context,
00081                                       RPC_ASYNC_EVENT Event);
00082
00083
00084 void __cdecl main(int argc, char **argv)
00085 {
00086    unsigned char *pszUuid               = NULL;
00087    unsigned char *pszProtocolSequence   = DEFAULT_PROTOCOL_SEQUENCE;
00088    unsigned char *pszEndpoint           = DEFAULT_ENDPOINT;
00089    unsigned char *pszNetworkAddress     = NULL;
00090    unsigned char *pszOptions            = NULL;
00091    unsigned char *pszStringBinding      = NULL;
00092    unsigned char *pszNotificationMethod = DEFAULT_NOTIFICATION;
00093    unsigned char *pszMessage            = DEFAULT_MESSAGE;
00094    unsigned long nAsychDelay            = DEFAULT_ASYNC_DELAY;
00095    unsigned long ulCode;
00096    unsigned long nAsychTimeOut;
00097    BOOL bAsychCancel = FALSE;
00098    BOOL bShutDownServer = FALSE;
00099    BOOL bIsUDP = FALSE;
00100    BOOL bCallFinished = TRUE;
00101    BOOL bAsyncCallSuccess = TRUE;
00102    int i, nReply;
00103    RPC_ASYNC_STATE Async;
00104    RPC_STATUS status;
00105    DWORD dwResult;
00106
00107    for (i = 1; i < argc; i++)
00108    {
00109       if ((*argv[i] == '-') || (*argv[i] == '/'))
00110       {
00111          switch (tolower(*(argv[i]+1)))
00112          {
00113             case 'p':
00114                pszProtocolSequence = argv[++i];
00115                break;
00116             case 'e':  // endpoint
00117                pszEndpoint = argv[++i];
00118                break;
00119             case 'n':  // network address
00120                pszNetworkAddress = argv[++i];
00121                break;
00122             case 'o':
00123                pszOptions = argv[++i];
00124                break;
00125             case 'm':
00126                pszNotificationMethod = argv[++i];
00127                break;
00128             case 'd':
00129                if (argv[i+1][0] != '-')
00130                   nAsychDelay = atol(argv[++i]);
00131                else
00132                   Usage(argv[0]);
00133                break;
00134             case 'c':
00135                bAsychCancel = TRUE;
00136                break;
00137             case 's':
00138                bShutDownServer = TRUE;
00139                break;
00140             case 'h':
00141             case '?':
00142             default:
00143                Usage(argv[0]);
00144          }
00145       }
00146       else
00147          Usage(argv[0]);
00148    }
00149
00150    if ((pszProtocolSequence == NULL) || (pszEndpoint == NULL) ||
00151        (pszNotificationMethod == NULL) || (pszMessage == NULL) ||
00152        (nAsychDelay < 0))
00153    {
00154       Usage(argv[0]);
00155    }
00156
00157    // Use a convenience function to concatenate the elements of
00158    // the string binding into the proper sequence.
00159    status = RpcStringBindingCompose(pszUuid,
00160                                     pszProtocolSequence,
00161                                     pszNetworkAddress,
00162                                     pszEndpoint,
00163                                     pszOptions,
00164                                     &pszStringBinding);
00165    printf("RpcStringBindingCompose returned 0x%x\n", status);
00166    printf("pszStringBinding = %s\n", pszStringBinding);
00167    if (status)
00168       exit(status);
00169
00170    // Set the binding handle that will be used to bind to the server.
00171    status = RpcBindingFromStringBinding(pszStringBinding,
00172                                         &AsyncRPC_ClientIfHandle);
00173    printf("RpcBindingFromStringBinding returned 0x%x\n", status);
00174    if (status)
00175       exit(status);
00176
00177    status = RpcAsyncInitializeHandle(&Async, sizeof(RPC_ASYNC_STATE));
00178    printf("RpcAsyncInitializeHandle returned 0x%x\n", status);
00179    if (status)
00180       exit(status);
00181
00182    Async.UserInfo = NULL;
00183
00184    // Detemine what type of notification method should be used
00185    if (stricmp(pszNotificationMethod, "apc") == 0)
00186    {
00187       Async.NotificationType = RpcNotificationTypeApc;
00188       if (stricmp(pszProtocolSequence, "ncadg_ip_udp") == 0)
00189          bIsUDP = TRUE;
00190    }
00191    else if (stricmp(pszNotificationMethod, "iocp") == 0)
00192       Async.NotificationType = RpcNotificationTypeIoc;
00193    else // "event"
00194       Async.NotificationType = RpcNotificationTypeEvent;
00195
00196    // Fill in the RPC_ASYNC_STATE structure
00197    switch (Async.NotificationType)
00198    {
00199       case RpcNotificationTypeApc:
00200          Async.u.APC.NotificationRoutine = (PFN_RPCNOTIFICATION_ROUTINE)APCNotificationRoutine;
00201          Async.u.APC.hThread = 0;
00202          // Using APC and UDP will potentially cause SleepEx() to
00203          // block forever. We use a user defined flag to check
00204          // whether the call is completed or not.
00205          if (bIsUDP)
00206             Async.UserInfo = (void*)&bCallFinished;
00207          break;
00208       case RpcNotificationTypeIoc:
00209          Async.u.IOC.hIOPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
00210          if (Async.u.IOC.hIOPort == NULL)
00211          {
00212             printf("CreateIoCompletionPort() failed: %d\n", GetLastError());
00213             exit(1);
00214          }
00215          break;
00216       default:  // case RpcNotificationTypeEvent:
00217          Async.u.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
00218          if (Async.u.hEvent == 0)
00219          {
00220             printf("CreateEvent() failed: %d\n", GetLastError());
00221             exit(1);
00222          }
00223          break;
00224    }
00225
00226    // Call an asynchronous RPC rountine here
00227    RpcTryExcept
00228    {
00229       printf("\nCalling the remote procedure 'AsyncFunc'\n");
00230       AsyncFunc(&Async, AsyncRPC_ClientIfHandle, nAsychDelay);
00231    }
00232    RpcExcept(1)
00233    {
00234       ulCode = RpcExceptionCode();
00235       printf("AsyncFunc: Runtime reported exception 0x%lx = %ld\n", ulCode, ulCode);
00236    }
00237    RpcEndExcept
00238
00239    // Call a non-synchronous routine while
00240    // the synchronous routine is still running
00241    RpcTryExcept
00242    {
00243       printf("\nCalling the remote procedure 'NonAsyncFunc'\n");
00244       NonAsyncFunc(AsyncRPC_ClientIfHandle, pszMessage);
00245       fprintf(stderr, "You see, while 'AsyncFunc' is running asyncronously,\n"
00246                       "we still can send message to the server in the mean time.\n\n");
00247    }
00248    RpcExcept(1)
00249    {
00250       ulCode = RpcExceptionCode();
00251       printf("NonAsyncFunc: Runtime reported exception 0x%lx = %ld\n", ulCode, ulCode);
00252    }
00253    RpcEndExcept
00254
00255    if (bAsychCancel)
00256    {
00257       // nonabortive cancel
00258       status = RpcAsyncCancelCall(&Async, FALSE);
00259       printf("RpcAsyncCancelCall returned 0x%x\n", status);
00260       if (status)
00261          exit(status);
00262    }
00263
00264    // should plus the synchronous call
00265    // time if it also takes long
00266    nAsychTimeOut = nAsychDelay * 1000 * 3;
00267
00268    // Wait for asynchronous notification
00269    printf("Waiting for asynchronous call to finish ...\n");
00270    switch (Async.NotificationType)
00271    {
00272       case RpcNotificationTypeApc:
00273          // Over ncadg_ip_udp, the RPC calls are executed sequentially on the server side
00274          // according to the order they are called by the client, regardless of their
00275          // async attributes. When the client is using APC, we need to "manually" check
00276          // whether AsyncFunc() is finished or not.
00277          if (bIsUDP)
00278          {
00279             if (!bCallFinished)
00280             {
00281                printf("Asynchronous call failed\n");
00282                bAsyncCallSuccess = FALSE;
00283             }
00284          }
00285          else
00286          {
00287             dwResult = SleepEx(nAsychTimeOut, TRUE);
00288             if (dwResult != WAIT_IO_COMPLETION)
00289             {
00290                if (dwResult == 0)
00291                   printf("SleepEx() is timed out\n");
00292                else
00293                   printf("SleepEx() failed: %d\n", dwResult);
00294
00295                bAsyncCallSuccess = FALSE;
00296             }
00297          }
00298          break;
00299       case RpcNotificationTypeIoc:
00300          if (!GetQueuedCompletionStatus(Async.u.IOC.hIOPort,
00301                                         &Async.u.IOC.dwNumberOfBytesTransferred,
00302                                         &Async.u.IOC.dwCompletionKey,
00303                                         &Async.u.IOC.lpOverlapped,
00304                                         nAsychTimeOut))
00305          {
00306             dwResult = GetLastError();
00307
00308             if (dwResult == WAIT_TIMEOUT)
00309                printf("GetQueuedCompletionStatus() is timed out\n");
00310             else
00311                printf("GetQueuedCompletionStatus() failed: %d\n", dwResult);
00312
00313             bAsyncCallSuccess = FALSE;
00314          }
00315          break;
00316       default:  // case RpcNotificationTypeEvent:
00317          dwResult = WaitForSingleObject(Async.u.hEvent, nAsychTimeOut);
00318          if (dwResult == WAIT_FAILED)
00319          {
00320             printf("WaitForSingleObject() failed: %d\n", GetLastError());
00321             bAsyncCallSuccess = FALSE;
00322          }
00323          else if (dwResult == WAIT_TIMEOUT)
00324          {
00325             printf("WaitForSingleObject() is timed out\n");
00326             bAsyncCallSuccess = FALSE;
00327          }
00328          break;
00329    }
00330
00331    if (bAsyncCallSuccess)
00332    {
00333       printf("Calling RpcAsyncCompleteCall\n");
00334       status = RpcAsyncCompleteCall(&Async, &nReply);
00335       printf("RpcAsyncCompleteCall returned 0x%x\n", status);
00336       if (status)
00337          exit(status);
00338
00339       printf("Remote procedure 'AsyncFunc' returned successfully\n\n");
00340    }
00341
00342    // Clean up notification resources
00343    switch (Async.NotificationType)
00344    {
00345       case RpcNotificationTypeApc:
00346          break;
00347       case RpcNotificationTypeIoc:
00348          CloseHandle(Async.u.IOC.hIOPort);
00349          break;
00350       default:  // case RpcNotificationTypeEvent:
00351          CloseHandle(Async.u.hEvent);
00352          break;
00353    }
00354
00355    if (bShutDownServer)
00356    {
00357       printf("Shutting down server ...\n");
00358       Shutdown(AsyncRPC_ClientIfHandle); // shut down the server side
00359    }
00360
00361    // The calls to the remote procedures are complete.
00362    // Free the string and the binding handle.
00363    status = RpcStringFree(&pszStringBinding);
00364    printf("RpcStringFree returned 0x%x\n", status);
00365    if (status)
00366       exit(status);
00367
00368    status = RpcBindingFree(&AsyncRPC_ClientIfHandle);
00369    printf("RpcBindingFree returned 0x%x\n", status);
00370    if (status)
00371       exit(status);
00372
00373    exit(0);
00374 }
00375
00376
00377 void RPC_ENTRY APCNotificationRoutine(PRPC_ASYNC_STATE pAsync,
00378                             void *Context,
00379                             RPC_ASYNC_EVENT Event)
00380 {
00381    BOOL *pbCallFinished = (BOOL*)(pAsync->UserInfo);
00382
00383    printf("APCNotificationRoutine reported ");
00384
00385    switch (Event)
00386    {
00387       case RpcCallComplete:
00388          printf("event RpcCallComplete\n");
00389          if (pbCallFinished != NULL)
00390             *pbCallFinished = TRUE;  // used for ncadg_ip_udp
00391          break;
00392       case RpcSendComplete:
00393          printf("event RpcSendComplete\n");
00394          break;
00395       case RpcReceiveComplete:
00396          printf("event RpcReceiveComplete\n");
00397          break;
00398       default:
00399          printf("event unknown\n");
00400          break;
00401    }
00402
00403    return;
00404 }
00405
00406
00407 // MIDL allocate and free
00408 void  __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00409 {
00410    return(malloc(len));
00411 }
00412
00413
00414 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00415 {
00416    free(ptr);
00417 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/VCExploreDlg.Cpp Source File

  • Com
  • Administration
  • Explore.VC

VCExploreDlg.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 #include "stdafx.h"
00020 #include "VCExplore.h"
00021 #include "VCExploreDlg.h"
00022 #include "AppExportDlg.h"
00023 #include "AppInstallDlg.h"
00024 #include "AppUtilDlg.h"
00025 #include "CompImportDlg.h"
00026 #include "CompInstallDlg.h"
00027 #include "ConnectDlg.h"
00028 #include "UtilitiesDlg.h"
00029
00030 #include <comdef.h>
00031
00032 #include "comadmin.h"
00033
00034
00035 #ifdef _DEBUG
00036 #define new DEBUG_NEW
00037 #undef THIS_FILE
00038 static char THIS_FILE[] = __FILE__;
00039 #endif
00040
00041
00042 #define RELEASE_ALL_PARENT_OBJECTS      0
00043
00044 #define DLG_APP_EXPORT            1
00045 #define DLG_APP_INSTALL           2
00046 #define DLG_APP_UTIL_START          3
00047 #define DLG_APP_UTIL_STOP         4
00048 #define DLG_COMPONENT_IMPORT        5
00049 #define DLG_COMPONENT_INSTALL       6
00050 #define DLG_CONNECT             7
00051 #define DLG_UTILITIES           8
00052 #define DLG_ABOUT             9
00053
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // CAboutDlg dialog used for App About
00057
00058 class CAboutDlg : public CDialog
00059 {
00060 public:
00061   CAboutDlg();
00062
00063 // Dialog Data
00064   //{{AFX_DATA(CAboutDlg)
00065   enum { IDD = IDD_ABOUTBOX };
00066   //}}AFX_DATA
00067
00068   // ClassWizard generated virtual function overrides
00069   //{{AFX_VIRTUAL(CAboutDlg)
00070   protected:
00071   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00072   //}}AFX_VIRTUAL
00073
00074 // Implementation
00075 protected:
00076   //{{AFX_MSG(CAboutDlg)
00077   virtual BOOL OnInitDialog();
00078   afx_msg void OnEasterEgg();
00079   //}}AFX_MSG
00080   DECLARE_MESSAGE_MAP()
00081 };
00082
00083 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00084 {
00085   //{{AFX_DATA_INIT(CAboutDlg)
00086   //}}AFX_DATA_INIT
00087 }
00088
00089 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00090 {
00091   CDialog::DoDataExchange(pDX);
00092   //{{AFX_DATA_MAP(CAboutDlg)
00093   //}}AFX_DATA_MAP
00094 }
00095
00096 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00097   //{{AFX_MSG_MAP(CAboutDlg)
00098   ON_BN_CLICKED(IDC_APPLICATION_ICON, OnEasterEgg)
00099   //}}AFX_MSG_MAP
00100 END_MESSAGE_MAP()
00101
00102
00103 BOOL CAboutDlg::OnInitDialog()
00104 {
00105   CDialog::OnInitDialog();
00106
00107   // TODO: Add extra initialization here
00108
00109   return TRUE;  // return TRUE unless you set the focus to a control
00110                 // EXCEPTION: OCX Property Pages should return FALSE
00111 }
00112
00113 void CAboutDlg::OnEasterEgg()
00114 {
00115   MessageBox("Built By:\tAllen Herring\n\tApplication Developer Consultant\n\tMicrosoft Corporation\n\n\tFebruary 1999",
00116         "Party On!",
00117         (MB_OK | MB_ICONINFORMATION));
00118 }
00119
00120
00121 /////////////////////////////////////////////////////////////////////////////
00122 // CVCExploreDlg dialog
00123
00124 CVCExploreDlg::CVCExploreDlg(CWnd* pParent /*=NULL*/)
00125   : CDialog(CVCExploreDlg::IDD)
00126 {
00127   UNREFERENCED_PARAMETER(pParent);
00128   //{{AFX_DATA_INIT(CVCExploreDlg)
00129     // NOTE: the ClassWizard will add member initialization here
00130   //}}AFX_DATA_INIT
00131   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
00132   m_hIcon = AfxGetApp()->LoadIcon(IDI_APP_ICON);
00133
00134   // Pointer Initialization
00135   m_pCatalog = NULL;
00136   m_pCurrCollection = NULL;
00137   m_bChangesArePending = FALSE;
00138 }
00139
00140 void CVCExploreDlg::DoDataExchange(CDataExchange* pDX)
00141 {
00142   CDialog::DoDataExchange(pDX);
00143   //{{AFX_DATA_MAP(CVCExploreDlg)
00144   DDX_Control(pDX, IDC_BUTTON_SET_PROPERTY, m_btnSetProperty);
00145   DDX_Control(pDX, IDC_EDIT_PROPERTY_VALUE, m_edtPropertyValue);
00146   DDX_Control(pDX, IDC_LIST_RELATED_COLLECTIONS, m_lstRelatedCollections);
00147   DDX_Control(pDX, IDC_LIST_PROPERTIES, m_lstProperties);
00148   DDX_Control(pDX, IDC_LIST_PARENT_COLLECTIONS, m_lstParentCollections);
00149   DDX_Control(pDX, IDC_LIST_OBJECTS, m_lstObjects);
00150   DDX_Control(pDX, IDC_LABEL_COMPUTER_NAME_VALUE, m_lblComputerName);
00151   DDX_Control(pDX, IDC_LABEL_COLLECTION_NAME_VALUE, m_lblCollectionName);
00152   //}}AFX_DATA_MAP
00153 }
00154
00155 BEGIN_MESSAGE_MAP(CVCExploreDlg, CDialog)
00156   //{{AFX_MSG_MAP(CVCExploreDlg)
00157   ON_WM_SYSCOMMAND()
00158   ON_WM_PAINT()
00159   ON_WM_QUERYDRAGICON()
00160   ON_COMMAND(ID_TBTN_ABOUT, OnTBtnAbout)
00161   ON_COMMAND(ID_TBTN_CONNECT, OnTBtnConnect)
00162   ON_COMMAND(ID_TBTN_DELETE, OnTBtnDelete)
00163   ON_COMMAND(ID_TBTN_EXPORT_APP, OnTBtnExportApp)
00164   ON_COMMAND(ID_TBTN_IMPORT_COMPONENT, OnTBtnImportComponent)
00165   ON_COMMAND(ID_TBTN_INSTALL_APP, OnTBtnInstallApp)
00166   ON_COMMAND(ID_TBTN_INSTALL_COMPONENT, OnTBtnInstallComponent)
00167   ON_COMMAND(ID_TBTN_NEW, OnTBtnNew)
00168   ON_COMMAND(ID_TBTN_REFRESH, OnTBtnRefresh)
00169   ON_COMMAND(ID_TBTN_SAVE, OnTBtnSave)
00170   ON_COMMAND(ID_TBTN_START_APP, OnTBtnStartApp)
00171   ON_COMMAND(ID_TBTN_STOP_APP, OnTBtnStopApp)
00172   ON_COMMAND(ID_TBTN_UTILITY, OnTBtnUtility)
00173   ON_WM_CLOSE()
00174   ON_LBN_SELCHANGE(IDC_LIST_RELATED_COLLECTIONS, OnSelChangeRelatedCollections)
00175   ON_LBN_SELCHANGE(IDC_LIST_PARENT_COLLECTIONS, OnSelChangeParentCollections)
00176   ON_LBN_SELCHANGE(IDC_LIST_OBJECTS, OnSelChangeObjects)
00177   ON_LBN_SELCHANGE(IDC_LIST_PROPERTIES, OnSelChangeProperties)
00178   ON_BN_CLICKED(IDC_BUTTON_SET_PROPERTY, OnSetProperty)
00179   //}}AFX_MSG_MAP
00180 END_MESSAGE_MAP()
00181
00182 /////////////////////////////////////////////////////////////////////////////
00183 // CVCExploreDlg message handlers
00184
00185 BOOL CVCExploreDlg::OnInitDialog()
00186 {
00187   CDialog::OnInitDialog();
00188
00189   // Add "About..." menu item to system menu.
00190
00191   // IDM_ABOUTBOX must be in the system command range.
00192   ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
00193   ASSERT(IDM_ABOUTBOX < 0xF000);
00194
00195   CMenu* pSysMenu = GetSystemMenu(FALSE);
00196   if (pSysMenu != NULL)
00197   {
00198     CString strAboutMenu;
00199     strAboutMenu.LoadString(IDS_ABOUTBOX);
00200     if (!strAboutMenu.IsEmpty())
00201     {
00202       pSysMenu->AppendMenu(MF_SEPARATOR);
00203       pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
00204     }
00205   }
00206
00207   // Set the icon for this dialog.  The framework does this automatically
00208   //  when the application's main window is not a dialog
00209   SetIcon(m_hIcon, TRUE);     // Set big icon
00210   SetIcon(m_hIcon, FALSE);    // Set small icon
00211
00212   // Create the button structure
00213   TBBUTTON tbButtons[] = {
00214     {0, ID_TBTN_CONNECT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00215     {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, (UCHAR)-1},
00216     {1, ID_TBTN_REFRESH, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00217     {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, (UCHAR)-1},
00218     {2, ID_TBTN_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00219     {3, ID_TBTN_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00220     {4, ID_TBTN_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00221     {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, (UCHAR)-1},
00222     {5, ID_TBTN_START_APP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00223     {6, ID_TBTN_STOP_APP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00224     {7, ID_TBTN_INSTALL_APP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00225     {8, ID_TBTN_EXPORT_APP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00226     {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, (UCHAR)-1},
00227     {9, ID_TBTN_INSTALL_COMPONENT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00228     {10, ID_TBTN_IMPORT_COMPONENT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00229     {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, (UCHAR)-1},
00230     {11, ID_TBTN_UTILITY, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
00231     {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0L, (UCHAR)-1},
00232     {12, ID_TBTN_ABOUT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0}
00233   };
00234
00235   // Create the bitmap structure that represents the toolbar
00236   TBADDBITMAP tbBitmap;
00237   tbBitmap.hInst = AfxGetApp()->m_hInstance;
00238   tbBitmap.nID = IDR_TOOLBAR_MAIN;
00239
00240   // Create the toolbar
00241   m_hwndToolBar = CreateToolbarEx(this->m_hWnd,                     // HWND of the toolbar's parent
00242                   WS_CHILD | WS_BORDER | WS_VISIBLE | TBSTYLE_TOOLTIPS, // Toolbar style
00243                   IDR_TOOLBAR_MAIN,                   // Toolbar Command ID
00244                   13,                           // Number of bitmaps
00245                   AfxGetApp()->m_hInstance,               // HINST of the module that contains the resource
00246                   IDR_TOOLBAR_MAIN,                   // Toolbar Resoure ID
00247                   (LPCTBBUTTON) &tbButtons,               // Toolbar button structure
00248                   19,                           // Number of buttons (including seperators)
00249                   16, 16,                         // Button width & height
00250                   16, 16,                         // Bitmap width & height
00251                   sizeof(TBBUTTON));                    // Size of single TBBUTTON structure (i.e., individual button)
00252
00253   if (NULL != m_hwndToolBar)
00254   {
00255     CWnd* pToolBar = GetDlgItem(IDR_TOOLBAR_MAIN);
00256     pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_NEW, MAKELONG(false, 0));
00257     pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_SAVE, MAKELONG(false, 0));
00258     pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_DELETE, MAKELONG(false, 0));
00259   }
00260   else
00261     MessageBox("Failed to create toolbar.\n\nPress OK to continue.",
00262           "Error",
00263           (MB_OK | MB_ICONERROR));
00264
00265   // Enable the tooltip window for this CWnd object
00266   this->EnableToolTips(true);
00267
00268   // Load the COM libraries
00269   HRESULT hr = CoInitialize(NULL);
00270   if SUCCEEDED(hr)
00271   {
00272     hr = CreateCatalog();
00273     if SUCCEEDED(hr)
00274       hr = NavigateTo(m_pCurrCollection);
00275   }
00276
00277   // Display the computer name
00278   _bstr_t bstrComputerName = "( Local )";
00279   set_ComputerName(bstrComputerName);
00280
00281   return TRUE;  // return TRUE  unless you set the focus to a control
00282 }
00283
00284 void CVCExploreDlg::OnSysCommand(UINT nID, LPARAM lParam)
00285 {
00286   if ((nID & 0xFFF0) == IDM_ABOUTBOX)
00287   {
00288     CAboutDlg dlgAbout;
00289     dlgAbout.DoModal();
00290   }
00291   else
00292   {
00293     CDialog::OnSysCommand(nID, lParam);
00294   }
00295 }
00296
00297 // If you add a minimize button to your dialog, you will need the code below
00298 //  to draw the icon.  For MFC applications using the document/view model,
00299 //  this is automatically done for you by the framework.
00300
00301 void CVCExploreDlg::OnPaint()
00302 {
00303   if (IsIconic())
00304   {
00305     CPaintDC dc(this); // device context for painting
00306
00307     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00308
00309     // Center icon in client rectangle
00310     int cxIcon = GetSystemMetrics(SM_CXICON);
00311     int cyIcon = GetSystemMetrics(SM_CYICON);
00312     CRect rect;
00313     GetClientRect(&rect);
00314     int x = (rect.Width() - cxIcon + 1) / 2;
00315     int y = (rect.Height() - cyIcon + 1) / 2;
00316
00317     // Draw the icon
00318     dc.DrawIcon(x, y, m_hIcon);
00319   }
00320   else
00321   {
00322     CDialog::OnPaint();
00323   }
00324 }
00325
00326 // The system calls this to obtain the cursor to display while the user drags
00327 //  the minimized window.
00328 HCURSOR CVCExploreDlg::OnQueryDragIcon()
00329 {
00330   return (HCURSOR) m_hIcon;
00331 }
00332
00333 void CVCExploreDlg::OnTBtnAbout()
00334 {
00335   // Continue only if we have a valid reference to a Catalog object
00336   if (NULL != GetCatalog())
00337   {
00338     CAboutDlg dlg;
00339
00340     // Display the "About" dialog
00341     dlg.DoModal();
00342   }
00343 }
00344
00345 void CVCExploreDlg::OnTBtnConnect()
00346 {
00347   if (NULL != GetCatalog())
00348   {
00349     CConnectDlg dlg;
00350
00351     // Set the dialog's catalog reference...
00352     dlg.set_Catalog(GetCatalog());
00353     //... and set the "child" dialog's parent (i.e., communication channel)
00354     dlg.set_ParentDlg(this);
00355
00356     // Display the "Connect" dialog
00357     dlg.DoModal();
00358   }
00359 }
00360
00361 void CVCExploreDlg::OnTBtnDelete()
00362 {
00363   // Get the current object selected
00364   int nObjectIndex = m_lstObjects.GetCurSel();
00365
00366   // Continue only if an object is selected
00367   if (LB_ERR == nObjectIndex)
00368     return;
00369
00370   // Attempt to remove the item from the collection
00371   HRESULT hr = m_pCurrCollection->Remove(nObjectIndex);
00372   if (SUCCEEDED(hr))
00373   {
00374     CWnd* pToolBar = GetDlgItem(IDR_TOOLBAR_MAIN);
00375     pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_SAVE, MAKELONG(true, 0));
00376     m_bChangesArePending = TRUE;
00377   }
00378   else
00379   {
00380     MessageBox("Failed to delete the specified object from the current collection.\n\nPress OK to continue.",
00381           "Error",
00382           (MB_OK | MB_ICONERROR));
00383   }
00384 }
00385
00386 void CVCExploreDlg::OnTBtnExportApp()
00387 {
00388   if (NULL != GetCatalog())
00389   {
00390     CAppExportDlg dlg;
00391
00392     // Set the dialog's catalog reference... ONLY if we aren't invoking the Connect dialog
00393     dlg.set_Catalog(GetCatalog());
00394
00395     // Display the "App Export" dialog
00396     dlg.DoModal();
00397   }
00398 }
00399
00400 void CVCExploreDlg::OnTBtnImportComponent()
00401 {
00402   if (NULL != GetCatalog())
00403   {
00404     CCompImportDlg dlg;
00405
00406     // Set the dialog's catalog reference... ONLY if we aren't invoking the Connect dialog
00407     dlg.set_Catalog(GetCatalog());
00408
00409     // Display the "Import Component" dialog
00410     dlg.DoModal();
00411   }
00412 }
00413
00414 void CVCExploreDlg::OnTBtnInstallApp()
00415 {
00416   if (NULL != GetCatalog())
00417   {
00418     CAppInstallDlg dlg;
00419
00420     // Set the dialog's catalog reference... ONLY if we aren't invoking the Connect dialog
00421     dlg.set_Catalog(GetCatalog());
00422
00423     // Display the "Import Component" dialog
00424     dlg.DoModal();
00425   }
00426 }
00427
00428 void CVCExploreDlg::OnTBtnInstallComponent()
00429 {
00430   if (NULL != GetCatalog())
00431   {
00432     CCompInstallDlg dlg;
00433
00434     // Set the dialog's catalog reference... ONLY if we aren't invoking the Connect dialog
00435     dlg.set_Catalog(GetCatalog());
00436
00437     // Display the "Import Component" dialog
00438     dlg.DoModal();
00439   }
00440 }
00441
00442 void CVCExploreDlg::OnTBtnNew()
00443 {
00444   ICatalogObject* pCatalogObject = NULL;
00445
00446   // Attempt to add a new item to the current collection
00447   HRESULT hr = m_pCurrCollection->Add((IDispatch**) &pCatalogObject);
00448
00449   // Validate success/fail of the requested operation
00450   if SUCCEEDED(hr)
00451   {
00452      // Toggle the toolbar save button
00453     CWnd* pToolBar = GetDlgItem(IDR_TOOLBAR_MAIN);
00454     pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_SAVE, MAKELONG(true, 0));
00455     m_bChangesArePending = TRUE;
00456
00457     // Release the new CatalogObject reference
00458     pCatalogObject->Release();
00459   }
00460   else
00461     MessageBox("Failed to add the new object to the current collection.\n\nPress OK to continue.",
00462           "Error",
00463           (MB_OK | MB_ICONERROR));
00464
00465   // Refresh the UI
00466   NavigateTo(m_pCurrCollection, FALSE);
00467 }
00468
00469 void CVCExploreDlg::OnTBtnRefresh()
00470 {
00471   // Refresh the UI with the current collection
00472   NavigateTo(m_pCurrCollection);
00473 }
00474
00475 void CVCExploreDlg::OnTBtnSave()
00476 {
00477   // Attempt to save the requested changes
00478   long lRetValue = 0;
00479   HRESULT hr = m_pCurrCollection->SaveChanges(&lRetValue);
00480   if FAILED(hr)
00481   {
00482     MessageBox("Failed to save changes to the current collection.\n\nPress OK to continue.",
00483           "Error",
00484           (MB_OK | MB_ICONERROR));
00485   }
00486
00487    // Turn off the toolbar save button
00488   CWnd* pToolBar = GetDlgItem(IDR_TOOLBAR_MAIN);
00489   pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_SAVE, MAKELONG(false, 0));
00490   m_bChangesArePending = FALSE;
00491
00492   // Refresh the UI with the current collection
00493   NavigateTo(m_pCurrCollection);
00494 }
00495
00496 void CVCExploreDlg::OnTBtnStartApp()
00497 {
00498   if (NULL != GetCatalog())
00499   {
00500     CAppUtilDlg dlg;
00501
00502     // Set the dialog's catalog reference... ONLY if we aren't invoking the Connect dialog
00503     dlg.set_Catalog(GetCatalog());
00504
00505     // Set the dialog "type"
00506     dlg.set_UtilityType(UTILITY_TYPE_START_APP);
00507
00508     // Display the "Import Component" dialog
00509     dlg.DoModal();
00510   }
00511 }
00512
00513 void CVCExploreDlg::OnTBtnStopApp()
00514 {
00515   if (NULL != GetCatalog())
00516   {
00517     CAppUtilDlg dlg;
00518
00519     // Set the dialog's catalog reference... ONLY if we aren't invoking the Connect dialog
00520     dlg.set_Catalog(GetCatalog());
00521
00522     // Set the dialog "type"
00523     dlg.set_UtilityType(UTILITY_TYPE_STOP_APP);
00524
00525     // Display the "Import Component" dialog
00526     dlg.DoModal();
00527   }
00528 }
00529
00530 void CVCExploreDlg::OnTBtnUtility()
00531 {
00532   if (NULL != GetCatalog())
00533   {
00534     CUtilitiesDlg dlg;
00535
00536     // Set the dialog's catalog reference... ONLY if we aren't invoking the Connect dialog
00537     dlg.set_Catalog(GetCatalog());
00538
00539     // Display the "Import Component" dialog
00540     dlg.DoModal();
00541   }
00542 }
00543
00544 void CVCExploreDlg::OnClose()
00545 {
00546   // Release the pointers to out objects and unload the COM libraries
00547   RemoveParent(RELEASE_ALL_PARENT_OBJECTS);
00548   DestroyCatalog();
00549   CoUninitialize();
00550
00551   CDialog::OnClose();
00552 }
00553
00554 HRESULT CVCExploreDlg::CreateCatalog()
00555 {
00556   // Close any previous Catalog instances
00557   DestroyCatalog();
00558
00559   IUnknown* pUnknown = NULL;
00560
00561   // Attempt to get a reference to the objects IUnknown pointer
00562   HRESULT hr = CoCreateInstance(CLSID_COMAdminCatalog,
00563                   NULL,
00564                   CLSCTX_INPROC_SERVER,
00565                   IID_IUnknown,
00566                   (void**) &pUnknown);
00567
00568   // Continue only if successful
00569   if SUCCEEDED(hr)
00570   {
00571     // Attempt to get a reference to the object's ICOMAdminCatalog interface
00572     hr = pUnknown->QueryInterface(IID_ICOMAdminCatalog,
00573                     (void**) &m_pCatalog);
00574
00575     // Release the IUnknown pointer
00576     pUnknown->Release();
00577
00578     // Continue only if successful
00579     if SUCCEEDED(hr)
00580     {
00581       _bstr_t bstrRootCollection = "Root";
00582
00583       // Attempt to connect to "Root" of the Catalog object
00584       hr = m_pCatalog->GetCollection(bstrRootCollection,
00585                       (IDispatch**) &m_pCurrCollection);
00586
00587       // Continue only if successful
00588       if SUCCEEDED(hr)
00589       {
00590         // Attempt to load the "Root" collection objects
00591         hr = m_pCurrCollection->Populate();
00592
00593         // Continue only if successful
00594         if SUCCEEDED(hr)
00595           return S_OK;
00596         else
00597           MessageBox("Failed to populate the current Catalog objects root collection.\n\nPress OK to continue.",
00598                 "Error",
00599                 (MB_OK | MB_ICONERROR));
00600       }
00601       else
00602         MessageBox("Failed to obtain a reference to the current Catalog objects root collection.\n\nNo processing will be performed.\n\nPress OK to continue.",
00603               "Error",
00604               (MB_OK | MB_ICONERROR));
00605     }
00606     else
00607       MessageBox("ICOMAdminCatalog interface is not supported.\n\nNo processing will be performed.\n\nPress OK to continue.",
00608             "Error",
00609             (MB_OK | MB_ICONERROR));
00610   }
00611   else
00612     MessageBox("Failed to instantiate the COMAdmin object.\n\nNo processing will be performed.\n\nPress OK to continue.",
00613           "Error",
00614           (MB_OK | MB_ICONERROR));
00615
00616   // Default return value
00617   return hr;
00618 }
00619
00620 void CVCExploreDlg::DestroyCatalog()
00621 {
00622   if (NULL != m_pCurrCollection)
00623   {
00624     m_pCurrCollection->Release();
00625     m_pCurrCollection = NULL;
00626   }
00627
00628   if (NULL != m_pCatalog)
00629   {
00630     m_pCatalog->Release();
00631     m_pCatalog = NULL;
00632   }
00633 }
00634
00635 HRESULT CVCExploreDlg::NavigateTo(ICatalogCollection *pCatalogCollection, BOOL bPopulate)
00636 {
00637   long          lObjCount = 0;
00638
00639   _bstr_t         bstrRelatedCollectionInfo = "RelatedCollectionInfo";
00640   _bstr_t         bstrPropertyInfo = "PropertyInfo";
00641
00642   _variant_t        vtRelatedCollInfoKey = "RelatedCollectionInfo";
00643   _variant_t        vtPropertyInfoKey = "PropertyInfo";
00644   _variant_t        vtKey = "";
00645   _variant_t        vtName = "";
00646
00647   ICatalogObject*     pCatalogObject = NULL;
00648   ICatalogCollection*   pRelatedCollInfo = NULL;
00649   ICatalogCollection*   pPropertyInfo = NULL;
00650
00651   // Make sure the current CatalogCollection object has been populated
00652   HRESULT hr;
00653
00654   if (bPopulate)
00655     hr = pCatalogCollection->Populate();
00656
00657   ////////////////////////////////////////////////////////////////////////////////////////
00658   // FIRST...
00659   //  Display the current CatalogCollection's name
00660
00661   hr = pCatalogCollection->get_Name(&vtName);
00662   if SUCCEEDED(hr)
00663     m_lblCollectionName.SetWindowText(_bstr_t(vtName));
00664
00665   ////////////////////////////////////////////////////////////////////////////////////////
00666   // SECOND...
00667   //  Enumerate "RelatedCollectionInfo" for the current collection
00668   //
00669
00670   // Clear the listbox control
00671   m_lstRelatedCollections.ResetContent();
00672
00673   hr = pCatalogCollection->GetCollection(bstrRelatedCollectionInfo,
00674                           vtRelatedCollInfoKey,
00675                           (IDispatch**) &pRelatedCollInfo);
00676   if SUCCEEDED(hr)
00677   {
00678     // Attempt to populate the RelatedCollectionInfo
00679     hr = pRelatedCollInfo->Populate();
00680     if SUCCEEDED(hr)
00681     {
00682       // Output the number of RelatedCollectionInfo objects in the collection
00683       long lCount = 0;
00684       hr = pRelatedCollInfo->get_Count(&lCount);
00685
00686       for (long lIndex = 0; lIndex < lCount; lIndex++)
00687       {
00688         hr = pRelatedCollInfo->get_Item(lIndex,
00689                         (IDispatch**) &pCatalogObject);
00690         if SUCCEEDED(hr)
00691         {
00692           // Display the current CatalogObject's Key and Name
00693           pCatalogObject->get_Key(&vtKey);
00694           pCatalogObject->get_Name(&vtName);
00695
00696           // Add the RelatedCollection's name to the listbox control
00697           m_lstRelatedCollections.AddString(_bstr_t(vtName));
00698
00699           // Release the ICatalogObject pointer
00700           pCatalogObject->Release();
00701         }
00702       }
00703     }
00704
00705     // Release the ICatalogCollection pointer
00706     pRelatedCollInfo->Release();
00707   }
00708
00709   ////////////////////////////////////////////////////////////////////////////////////////
00710   // THIRD...
00711   //  Enumerate "PropertyInfo" for the current collection
00712   //
00713
00714   // Clear the listbox control
00715   m_lstProperties.ResetContent();
00716
00717   hr = pCatalogCollection->GetCollection(bstrPropertyInfo,
00718                       vtPropertyInfoKey,
00719                       (IDispatch**) &pPropertyInfo);
00720   if SUCCEEDED(hr)
00721   {
00722     // Populate the collection
00723     hr = pPropertyInfo->Populate();
00724     if SUCCEEDED(hr)
00725     {
00726       // Display the number of PropertyInfo objects in the collection
00727       long lPropCnt = 0;
00728       pPropertyInfo->get_Count(&lPropCnt);
00729
00730       for (int lIndex = 0; lIndex < lPropCnt; lIndex++)
00731       {
00732         hr = pPropertyInfo->get_Item(lIndex,
00733                       (IDispatch**) &pCatalogObject);
00734         if SUCCEEDED(hr)
00735         {
00736           // Display the current CatalogObject's Key and Name
00737           pCatalogObject->get_Key(&vtKey);
00738           pCatalogObject->get_Name(&vtName);
00739
00740           // Add property names to the listbox control
00741           m_lstProperties.AddString(_bstr_t(vtName));
00742
00743           // Release the ICatalogObject pointer
00744           pCatalogObject->Release();
00745         }
00746       }
00747     }
00748
00749     // Release the ICatalogCollection pointer
00750     pPropertyInfo->Release();
00751   }
00752
00753   ////////////////////////////////////////////////////////////////////////////////////////
00754   // FORTH...
00755   //  Enumerate the current collection's objects
00756   //
00757
00758   // Clear the listbox control
00759   m_lstObjects.ResetContent();
00760
00761   // Get the number of objects available in this CatalogCollection
00762   hr = pCatalogCollection->get_Count(&lObjCount);
00763
00764   // Output each objects (i.e., CatalogObject) properties in the current collection
00765   for (long lIndex = 0; lIndex < lObjCount; lIndex++)
00766   {
00767     hr = pCatalogCollection->get_Item(lIndex,
00768                       (IDispatch**) &pCatalogObject);
00769
00770     if SUCCEEDED(hr)
00771     {
00772       // Get the current CatalogObject's Name
00773       pCatalogObject->get_Name(&vtName);
00774
00775       // Add the Object names to the listbox control
00776       m_lstObjects.AddString(_bstr_t(vtName));
00777
00778       // Release the temporary ICatalogObject pointer
00779       pCatalogObject->Release();
00780     }
00781   }
00782
00783   ////////////////////////////////////////////////////////////////////////////////////////
00784   // FIFTH...
00785   //  Set the state of the persistence (i.e., new & delete) toolbar buttons
00786   //
00787
00788   // Set the persistence toolbar buttons state depending upon the current collections
00789   //  properties (i.e., whether or not save & delete are permitted
00790   short sSaveEnabled = 0;
00791   short sRemoveEnabled = 0;
00792   CWnd* pToolBar = GetDlgItem(IDR_TOOLBAR_MAIN);
00793
00794   hr = pCatalogCollection->get_AddEnabled(&sSaveEnabled);
00795   if (sSaveEnabled && SUCCEEDED(hr))
00796     pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_NEW, MAKELONG(true, 0));
00797
00798   hr = pCatalogCollection->get_RemoveEnabled(&sRemoveEnabled);
00799   if (sRemoveEnabled && SUCCEEDED(hr))
00800     pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_DELETE, MAKELONG(true, 0));
00801
00802   ////////////////////////////////////////////////////////////////////////////////////////
00803   // SIXTH...
00804   //  Clear any existing property value
00805   //
00806   m_edtPropertyValue.SetSel(0, -1, false);
00807   m_edtPropertyValue.Clear();
00808
00809   m_lstObjects.SetCurSel(0);
00810   m_lstProperties.SetCurSel(0);
00811
00812   return hr;
00813 }
00814
00815
00816 void CVCExploreDlg::OnSelChangeRelatedCollections()
00817 {
00818   TryToSaveChanges();
00819
00820   // Get the index of the currently selected listbox item
00821   int   nCurrSelection = m_lstRelatedCollections.GetCurSel();
00822
00823   // Get the currently selected items text (i.e., new collection name)
00824   int   nBufSize = m_lstRelatedCollections.GetTextLen(nCurrSelection) + 1;
00825   char* pBuf = new char[nBufSize];
00826   int   nRetVal = m_lstRelatedCollections.GetText(nCurrSelection, pBuf);
00827
00828   // Attempt to get a reference to the new CatalogCollection object
00829   _bstr_t       bstrCollectionName = pBuf;
00830   _variant_t    vtCollectionKey;
00831   ICatalogCollection* pCatalogCollection = NULL;
00832
00833   // We might need an object key, depending on which related collection was
00834   // selected
00835   HRESULT hr = E_UNEXPECTED;
00836
00837   if (!lstrcmpW(bstrCollectionName, L"RolesForMethod") ||
00838       !lstrcmpW(bstrCollectionName, L"MethodsForInterface") ||
00839       !lstrcmpW(bstrCollectionName, L"InterfacesForComponent") ||
00840       !lstrcmpW(bstrCollectionName, L"RolesForComponent") ||
00841       !lstrcmpW(bstrCollectionName, L"Roles") ||
00842       !lstrcmpW(bstrCollectionName, L"SubscriptionsForComponent") ||
00843       !lstrcmpW(bstrCollectionName, L"UsersInRole") ||
00844       !lstrcmpW(bstrCollectionName, L"Components") )
00845   {
00846     //  Need to get the object key
00847     int   nObjectCurrSelection = m_lstObjects.GetCurSel();
00848     int   nObjectBufSize = m_lstObjects.GetTextLen(nObjectCurrSelection) + 1;
00849     char* pObjectBuf = new char[nObjectBufSize];
00850     nRetVal = m_lstObjects.GetText(nObjectCurrSelection, pObjectBuf);
00851
00852     long  lCollectionCount;
00853     int   iLoopIndex;
00854     ICatalogObject* pCatalogObject = NULL;
00855
00856     m_pCurrCollection->get_Count(&lCollectionCount);
00857
00858     _bstr_t bstrSelObjName = pObjectBuf;
00859     for (iLoopIndex = 0; iLoopIndex < lCollectionCount; iLoopIndex++)
00860     {
00861       hr = m_pCurrCollection->get_Item(iLoopIndex, (IDispatch**)&pCatalogObject);
00862       if (SUCCEEDED(hr))
00863       {
00864         _variant_t vtName;
00865         hr = pCatalogObject->get_Name(&vtName);
00866         if (SUCCEEDED(hr) && !lstrcmp(bstrSelObjName, (_bstr_t)vtName))
00867         {
00868           // Found it
00869           break;
00870         }
00871         pCatalogObject->Release();
00872         pCatalogObject = NULL;
00873       }
00874     }
00875
00876     if (pCatalogObject)
00877     {
00878       hr = pCatalogObject->get_Key(&vtCollectionKey);
00879       pCatalogObject->Release();
00880     }
00881
00882     delete [] pObjectBuf;
00883   }
00884   else
00885   {
00886     // No key needed
00887     vtCollectionKey = bstrCollectionName;
00888   }
00889
00890   hr = m_pCurrCollection->GetCollection(bstrCollectionName,
00891                         vtCollectionKey,
00892                         (IDispatch**) &pCatalogCollection);
00893
00894   if SUCCEEDED(hr)
00895   {
00896     // Navigate to the new collection
00897     hr = NavigateTo(pCatalogCollection);
00898
00899     if SUCCEEDED(hr)
00900     {
00901       // Increment the reference count to the current CatalogCollection
00902       //  before caching its value
00903       m_pCurrCollection->AddRef();
00904
00905       // Add the current CatalogCollection to the ParentCollection
00906       //  listbox (i.e., cache the current CatalogCollection object)
00907       AddParent(m_pCurrCollection);
00908
00909       // Increment the reference count to the temporary CatalogCollection
00910       //  object before setting/copying it as the currenct CatalogCollection
00911       pCatalogCollection->AddRef();
00912
00913       // Set the "new" current CatalogCollection to the user's selection
00914       m_pCurrCollection = pCatalogCollection;
00915     }
00916
00917     // Release the temporary ICatalogCollection pointer
00918     pCatalogCollection->Release();
00919   }
00920
00921   // Cleanup
00922   delete [] pBuf;
00923 }
00924
00925 void CVCExploreDlg::OnSelChangeParentCollections()
00926 {
00927   TryToSaveChanges();
00928
00929   // Determine which item is selected
00930   int nIndex = m_lstParentCollections.GetCurSel();
00931
00932   // Remove the strings from the listbox and release the un-needed objects (i.e., un-wind/pop values off the stack)
00933   RemoveParent(nIndex);
00934
00935   // Navigate to the "new" currrent CatalogCollection
00936   NavigateTo(m_pCurrCollection);
00937
00938 }
00939
00940 int CVCExploreDlg::AddParent(ICatalogCollection *pCatalogCollection)
00941 {
00942   _variant_t  vtName;
00943   int     nIndex = -1;
00944
00945   // Add the CatalogCollections name to the ParentCollection listbox
00946   HRESULT hr = pCatalogCollection->get_Name(&vtName);
00947   if SUCCEEDED(hr)
00948   {
00949     // Attempt to dd the name to the ParentCollections listbox
00950     nIndex = m_lstParentCollections.AddString(_bstr_t(vtName));
00951
00952     // If successful, store/cache the ICatalogCollection pointer
00953     if ((LB_ERR != nIndex) && (LB_ERRSPACE != nIndex))
00954       m_lstParentCollections.SetItemDataPtr(nIndex, pCatalogCollection);
00955   }
00956
00957   return nIndex;
00958 }
00959
00960 void CVCExploreDlg::RemoveParent(int nNewCurrIndex)
00961 {
00962   // Remove the strings from the listbox and release the un-needed objects (i.e., un-wind/pop values off the stack)
00963   for (int nPtr = (m_lstParentCollections.GetCount() - 1); nPtr >= nNewCurrIndex; nPtr--)
00964   {
00965     // Get the current listbox item's cached ICatalogCollection pointer
00966     ICatalogCollection* pCatalogCollection = (ICatalogCollection*) m_lstParentCollections.GetItemDataPtr(nPtr);
00967
00968     // If we are on the item the user selected...
00969     if (nNewCurrIndex == nPtr)
00970     {
00971       //... release the CatalogCollection we are currently pointing to...
00972       m_pCurrCollection->Release();
00973       //... increment the number of references to the CatalogCollection we are currently using...
00974       pCatalogCollection->AddRef();
00975       //... set the "new" current CatalogCollection
00976       m_pCurrCollection = pCatalogCollection;
00977     }
00978
00979     // Remove the current listbox item
00980     m_lstParentCollections.DeleteString(nPtr);
00981
00982     // Release the temporary CatalogCollection object
00983     pCatalogCollection->Release();
00984   }
00985 }
00986
00987 void CVCExploreDlg::DisplayPropertyValue()
00988 {
00989   // Clear the current contents of the edit control
00990   m_edtPropertyValue.SetSel(0, -1, false);
00991   m_edtPropertyValue.Clear();
00992
00993   // Determine which (if any) CatalogObject is selected
00994   int nObjectIndex = m_lstObjects.GetCurSel();
00995   int nPropertyIndex = m_lstProperties.GetCurSel();
00996
00997   // Bail if no CatalogObject OR Property selected
00998   if ((LB_ERR == nObjectIndex) || (LB_ERR == nPropertyIndex))
00999     return;
01000
01001   // Attempt to get a reference to the currently selected CatalogObject
01002   ICatalogObject* pCatalogObject = NULL;
01003
01004   HRESULT hr = m_pCurrCollection->get_Item(nObjectIndex,
01005                       (IDispatch**) &pCatalogObject);
01006   if SUCCEEDED(hr)
01007   {
01008     // Get the Properties name
01009     int nTextLength = m_lstProperties.GetTextLen(nPropertyIndex);
01010     char* pBuf = new char[nTextLength + 1];
01011     m_lstProperties.GetText(nPropertyIndex, pBuf);
01012
01013     // Attempt to get the actual properties value
01014     _bstr_t   bstrPropertyName = pBuf;
01015     delete [] pBuf;
01016
01017     _variant_t  vtPropertyValue = "";
01018
01019     hr = pCatalogObject->get_Value(bstrPropertyName, &vtPropertyValue);
01020
01021     // Set the text if successful
01022     if SUCCEEDED(hr)
01023     {
01024       short sFlag = 0;
01025
01026       // Read only check (i.e., enable update only if allowed)
01027       hr = pCatalogObject->IsPropertyReadOnly(bstrPropertyName, &sFlag);
01028       if (sFlag || FAILED(hr))
01029         m_btnSetProperty.EnableWindow(false);
01030       else
01031         m_btnSetProperty.EnableWindow(true);
01032
01033       // Write only check (i.e., display the value only if allowed)
01034       hr = pCatalogObject->IsPropertyWriteOnly(bstrPropertyName, &sFlag);
01035       if (!sFlag && SUCCEEDED(hr))
01036       {
01037         // Set the new edit control text
01038         try
01039         {
01040           m_edtPropertyValue.SetWindowText(_bstr_t(vtPropertyValue));
01041           // Select the text
01042           m_edtPropertyValue.SetSel(0, -1, false);
01043         }
01044
01045         catch (...)
01046         {
01047           m_btnSetProperty.EnableWindow(false);
01048           vtPropertyValue = "";
01049           m_edtPropertyValue.SetWindowText(_bstr_t(vtPropertyValue));
01050         }
01051       }
01052     }
01053
01054     // Release the temporary CatalogObject
01055     pCatalogObject->Release();
01056   }
01057 }
01058
01059 void CVCExploreDlg::OnSelChangeObjects()
01060 {
01061   DisplayPropertyValue();
01062 }
01063
01064 void CVCExploreDlg::OnSelChangeProperties()
01065 {
01066   DisplayPropertyValue();
01067 }
01068
01069
01070
01071 ICOMAdminCatalog* CVCExploreDlg::GetCatalog()
01072 {
01073   // Increment the reference count on the Catalog object only if it's valid
01074   if (NULL != m_pCatalog)
01075     m_pCatalog->AddRef();
01076
01077   // Return a reference to the current Catalog object
01078   return m_pCatalog;
01079 }
01080
01081 void CVCExploreDlg::set_CurrentCollection(ICatalogCollection* pCollection)
01082 {
01083   // Clear the Object and Property listbox contents, if any
01084   m_lstObjects.ResetContent();
01085   m_lstProperties.ResetContent();
01086
01087   // Release all of the parent Collection objects, if any
01088   RemoveParent(RELEASE_ALL_PARENT_OBJECTS);
01089
01090   // Release the current Collection
01091   if (NULL != m_pCurrCollection)
01092     m_pCurrCollection->Release();
01093
01094   // Assign the new Catalog
01095   m_pCurrCollection = pCollection;
01096
01097   // Populate the collection
01098   HRESULT hr = m_pCurrCollection->Populate();
01099   if SUCCEEDED(hr)
01100     // Navigate to the new collection (i.e., fill in the UI)
01101     NavigateTo(m_pCurrCollection);
01102 }
01103
01104 void CVCExploreDlg::set_ComputerName(_bstr_t bstrComputerName)
01105 {
01106   m_lblComputerName.SetWindowText(bstrComputerName);
01107 }
01108
01109 void CVCExploreDlg::OnSetProperty()
01110 {
01111   // Continue only if we have a valid reference to a Catalog object
01112   if (NULL != m_pCatalog)
01113   {
01114     ICatalogObject* pCatalogObject = NULL;
01115     int       nObjectIndex = m_lstObjects.GetCurSel();
01116     int       nPropertyIndex = m_lstProperties.GetCurSel();
01117
01118     // Only try to set a property value if a property of an object has actually
01119     //  been selected
01120     if ((LB_ERR == nObjectIndex) || (LB_ERR == nPropertyIndex))
01121       return;
01122
01123     // Attempt to get a reference to the current CatalogObject selected
01124     HRESULT hr = m_pCurrCollection->get_Item(nObjectIndex,
01125                         (IDispatch**) &pCatalogObject);
01126     if SUCCEEDED(hr)
01127     {
01128       // Get the currently selected Properties name
01129       int   nTextLength = m_lstProperties.GetTextLen(nPropertyIndex);
01130       char* pBuf = new char[nTextLength + 1];
01131       m_lstProperties.GetText(nPropertyIndex, pBuf);
01132       _bstr_t bstrPropertyName = pBuf;
01133       delete [] pBuf;
01134
01135       // Extract the new value from the UI
01136       int     nNewValueLength = m_edtPropertyValue.GetWindowTextLength() + 1;
01137       char*   pNewValueBuf = new char[nNewValueLength];
01138       m_edtPropertyValue.GetWindowText(pNewValueBuf, nNewValueLength);
01139       _bstr_t   bstrNewValue = pNewValueBuf;
01140       delete [] pNewValueBuf;
01141       _variant_t  vtPropertyValue = bstrNewValue;
01142
01143       // Attempt to update the Properties value
01144       hr = pCatalogObject->put_Value(bstrPropertyName, vtPropertyValue);
01145
01146       // Validate success/fail of the operation
01147       if SUCCEEDED(hr)
01148       {
01149         CWnd* pToolbar = GetDlgItem(IDR_TOOLBAR_MAIN);
01150         pToolbar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_SAVE, MAKELONG(true, 0));
01151         m_bChangesArePending = TRUE;
01152       }
01153       else
01154         MessageBox("Failed to save the selected CatalogObject's property value.\n\nPress OK to continue.",
01155               "Error",
01156               (MB_OK | MB_ICONERROR));
01157
01158       // Release the temporary CatalogObject
01159       pCatalogObject->Release();
01160     }
01161     else
01162       MessageBox("Failed to obtain a reference to the selected CatalogObject.\n\nNo Processing will be performed.\n\nPress OK to continue.",
01163             "Error",
01164             (MB_OK | MB_ICONERROR));
01165   }
01166   else
01167     MessageBox("Invalid Catalog object.\n\nNo Processing will be performed.\n\nPress OK to continue.",
01168           "Error",
01169           (MB_OK | MB_ICONERROR));
01170 }
01171
01172 void CVCExploreDlg::TryToSaveChanges()
01173 {
01174   if (!m_bChangesArePending)
01175   {
01176     // nothing to do
01177     return;
01178   }
01179
01180   int iMBRet = MessageBox("Do you wish to save your changes before continuing?", "Changes may be lost!", MB_ICONQUESTION | MB_YESNO);
01181   if (iMBRet == IDYES)
01182   {
01183     long lCount;
01184     m_pCurrCollection->SaveChanges(&lCount);
01185   }
01186   CWnd* pToolBar = GetDlgItem(IDR_TOOLBAR_MAIN);
01187   pToolBar->SendMessage(TB_ENABLEBUTTON, ID_TBTN_SAVE, MAKELONG(false, 0));
01188   m_bChangesArePending = FALSE;
01189 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/getreceipt.Cpp Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

getreceipt.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: GetReceipt.cpp
00003 //
00004 // Description: Implementation of CGetReceipt
00005 //
00006 //
00007 // This file is part of the Microsoft COM+ Samples
00008 //
00009 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00010 //
00011 // This source code is intended only as a supplement to Microsoft
00012 // Development Tools and/or on-line documentation.  See these other
00013 // materials for detailed information reagrding Microsoft code samples.
00014 //
00015 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 // PARTICULAR PURPOSE.
00019 //
00020 //==============================================================================
00021
00022
00023 #include "stdafx.h"
00024 #include "Account.h"
00025 #include "GetReceipt.h"
00026 #include "UpdateReceipt.h"
00027
00028 #include <comsvcs.h>
00029
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 //
00033
00034 STDMETHODIMP CGetReceipt::InterfaceSupportsErrorInfo(REFIID riid)
00035 {
00036   static const IID* arr[] =
00037   {
00038     &IID_IGetReceipt,
00039   };
00040
00041   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00042   {
00043     if (::InlineIsEqualGUID(*arr[i],riid))
00044       return S_OK;
00045   }
00046   return S_FALSE;
00047 }
00048
00049 //F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++
00050 //
00051 // Function:  GetNextReceipt
00052 //
00053 // This function uses Shared Properties to get the next receipt value
00054 //
00055 // Args:  ReceiptNo:  Receipt number for this transction
00056 //
00057 // Returns:  S_OK or E_FAIL
00058 //
00059 //F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-
00060
00061 STDMETHODIMP CGetReceipt::GetNextReceipt (OUT long* plReceiptNo) {
00062
00063   HRESULT hr = S_OK;
00064
00065   IObjectContext* pObjectContext = NULL;
00066
00067   ISharedPropertyGroupManager* spmMgr = NULL;
00068   ISharedPropertyGroup* spmGroup = NULL;
00069   ISharedProperty* spmPropNextReceipt = NULL;
00070   ISharedProperty* spmPropMaxNum = NULL;
00071
00072   IUpdateReceipt* pObjUpdateReceipt = NULL;
00073
00074   CComVariant vNextReceipt;
00075
00076   long lErrFlag = 0;
00077   TCHAR* pErrMsg = NULL;
00078
00079
00080   try {
00081
00082     // First of all, get the object context
00083     THROW_ERR (CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext), "GetObjectContext" );
00084
00085     // Create the SharedPropertyGroupManager
00086     THROW_ERR ( CoCreateInstance (CLSID_SharedPropertyGroupManager, NULL, CLSCTX_ALL,
00087       IID_ISharedPropertyGroupManager, (void**)&spmMgr), "CreateInstance(CLSID_SharedPropertyGroupManager)" );
00088
00089     // Create the SharedPropertyGroup
00090     LONG lIsolationMode = LockMethod;
00091     LONG lReleaseMode = Process;
00092     VARIANT_BOOL bExists = VARIANT_FALSE;
00093     THROW_ERR ( spmMgr->CreatePropertyGroup (L"Receipt", &lIsolationMode, &lReleaseMode, &bExists, &spmGroup),
00094       "CreatePropertyGroup" );
00095
00096     // Create the two shared properties
00097     THROW_ERR ( spmGroup->CreateProperty (L"Next", &bExists, &spmPropNextReceipt), "CreateProperty(Next)" );
00098     THROW_ERR ( spmGroup->CreateProperty (L"MaxNum", &bExists, &spmPropMaxNum), "CreateProperty(MaxNum)" );
00099
00100     // Obtain their current values
00101     CComVariant vMaxNum;
00102     THROW_ERR ( spmPropNextReceipt->get_Value (&vNextReceipt), "spmPropNextReceipt->get_Value" );
00103     THROW_ERR ( spmPropMaxNum->get_Value (&vMaxNum), "spmPropMaxNum->get_Value" );
00104
00105     // Does MaxNum require an update?
00106     if (vNextReceipt.lVal >= vMaxNum.lVal) {
00107
00108       // Create an UpdateReceipt object
00109       THROW_ERR( CoCreateInstance (CLSID_CUpdateReceipt, NULL, CLSCTX_ALL, IID_IUpdateReceipt,
00110         (void**)&pObjUpdateReceipt), "CreateInstance(CLSID_CUpdateReceipt)" );
00111
00112       // Update NextReceipt
00113       RETHROW_ERR ( pObjUpdateReceipt->Update (&vNextReceipt.lVal) );
00114
00115       // Update NextReceipt shared property
00116       THROW_ERR ( spmPropNextReceipt->put_Value (vNextReceipt), "spmPropNextReceipt->put_Value" );
00117
00118       // Update MaxNum shared property
00119       vMaxNum.lVal = vNextReceipt.lVal + 100;
00120       THROW_ERR ( spmPropMaxNum->put_Value (vMaxNum), "spmPropMaxNum->put_Value" );
00121     }
00122
00123     // Increment NextReceipt shared property
00124     vNextReceipt.lVal ++;
00125     THROW_ERR ( spmPropNextReceipt->put_Value (vNextReceipt), "spmPropNextReceipt->put_Value" );
00126     *plReceiptNo = vNextReceipt.lVal;
00127     hr = S_OK;
00128
00129     // We're finished and happy
00130     pObjectContext->SetComplete();
00131
00132   } catch (HRESULT hr) {
00133
00134     //
00135     //  ErrorInfo is saved here because the following ADO cleanup code
00136     //  may clear it.
00137     //
00138     IErrorInfo * pErrorInfo = NULL;
00139     GetErrorInfo(NULL, &pErrorInfo);
00140
00141     // Fill in error information
00142     switch (lErrFlag) {
00143
00144     // Unknown error occurred in this object
00145     case (0):
00146       TCHAR szErr [512];
00147       wsprintf (szErr, _T("Error 0x%x from CGetReceipt calling %s."), hr, pErrMsg);
00148       pErrMsg = szErr;
00149       // Fall through
00150
00151     // An application error occurred in this object
00152     case (1):
00153       //
00154       //  we are going to put our own error in TLS, so if there is one there, clear it
00155       //
00156       if (pErrorInfo)
00157         pErrorInfo -> Release();
00158
00159       AtlReportError( CLSID_CGetReceipt, pErrMsg, IID_IGetReceipt, hr);
00160       break;
00161
00162     case (2): // An error occurred in a called object
00163       //
00164       //  put the error back in TLS
00165       //
00166       SetErrorInfo(NULL, pErrorInfo);
00167       break;
00168
00169     // Will never reach here
00170     default:
00171       break;
00172     }
00173
00174     // Indicate our unhappiness
00175     if (pObjectContext)
00176       pObjectContext->SetAbort();
00177   }
00178
00179   // Resource cleanup
00180   if (pObjectContext)
00181     pObjectContext->Release();
00182
00183   if (spmMgr)
00184     spmMgr->Release();
00185
00186   if (spmGroup)
00187     spmGroup->Release();
00188
00189   if (spmPropNextReceipt)
00190     spmPropNextReceipt->Release();
00191
00192   if (spmPropMaxNum)
00193     spmPropMaxNum->Release();
00194
00195   if (pObjUpdateReceipt)
00196     pObjUpdateReceipt->Release();
00197
00198   return hr;
00199 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/basesnap.h Source File

  • SysMgmt
  • MMC
  • CMenu

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/Getcaps.c Source File

  • Multimedia
  • Gdi
  • Printer

Getcaps.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /******************************************************************************\
00013 *
00014 *  PROGRAM:     GETCAPS.C
00015 *
00016 *  PURPOSE:     Handles display of information returned by call to
00017 *               GetDeviceCaps. GetDeviceCaps is called for the
00018 *               currently selected deivce (in the tool bar comobobox),
00019 *               and the results are formatted and displayed in a dialog
00020 *               box.
00021 *
00022 *  FUNTIONS:    GetDeviceCapsDlgProc - handles messages for dialog
00023 *               DisplayDeviceCapsInfo- retrieves device caps info
00024 *               TranslateDeviceCaps  - displays a capability in listbox
00025 *               ComplexDeviceCapsLine- formats a bitfield capability
00026 *
00027 \******************************************************************************/
00028
00029 #include <windows.h>
00030 #include <winspool.h>
00031 #include <string.h>
00032 #include <stdio.h>
00033 #include <winspool.h>
00034 #include "common.h"
00035 #include "getcaps.h"
00036 #include "resource.h"
00037
00038 /******************************************************************************\
00039 *
00040 *  FUNCTION:    GetDeviceCapsDlgProc (standard dialog procedure INPUTS/RETURNS)
00041 *
00042 *  COMMENTS:    Processes messages for GetDeviceCaps dialog box
00043 *
00044 \******************************************************************************/
00045
00046 LRESULT CALLBACK   GetDeviceCapsDlgProc (HWND   hwnd, UINT msg, WPARAM wParam,
00047                                          LPARAM lParam)
00048 {
00049   switch (msg)
00050   {
00051     case WM_INITDIALOG:
00052     {
00053       BOOL bReturn;
00054       char buf[BUFSIZE];
00055
00056       SendDlgItemMessage (hwnd, DID_LISTBOX, WM_SETFONT, (WPARAM)GetStockObject(ANSI_FIXED_FONT), (LPARAM)0);
00057
00058     ghwndDevCaps = hwnd;
00059
00060       //
00061       // shove all the caps info in the list box
00062       //
00063
00064       SetCursor (LoadCursor (NULL, IDC_WAIT));
00065       bReturn = DisplayDeviceCapsInfo ();
00066       SetCursor (LoadCursor (NULL, IDC_ARROW));
00067
00068       if (!bReturn)
00069       {
00070         EndDialog (hwnd, TRUE);
00071       }
00072
00073       //
00074       // set window title to reflect current device
00075       //
00076
00077       else
00078       {
00079         if ( _snprintf (buf, BUFSIZE-1, "GetDeviceCaps: %s;%s;%s", gszDeviceName, gszPort, gszDriverName) > 0 )
00080           SetWindowText (hwnd, (LPCSTR) buf);
00081       }
00082
00083       break;
00084     }
00085
00086     case WM_COMMAND:
00087
00088       switch (LOWORD (wParam))
00089       {
00090         case DID_OK:
00091
00092           EndDialog (hwnd, TRUE);
00093           return 1;
00094       }
00095       break;
00096   }
00097   return 0;
00098 }
00099
00100
00101
00102 /******************************************************************************\
00103 *
00104 *  FUNCTION:    DisplayDeviceCapsInfo
00105 *
00106 *  RETURNS:     TRUE if successful,
00107 *               FALSE otherwise
00108 *
00109 *  COMMENTS:    Retrieves all device caps for current deivce & calls
00110 *                 TranslateCaps to insert them in the dialog's listbox.
00111 *
00112 \******************************************************************************/
00113
00114 BOOL DisplayDeviceCapsInfo ()
00115 {
00116   HDC hdc;
00117   int i, iValue;
00118
00119   if (!strcmp (gszDeviceName, "Display"))
00120   {
00121     if (!(hdc = GetDC (ghwndDevCaps)))
00122     {
00123       ErrMsgBox (GetStringRes(IDS_GETDCFAIL), ERR_MOD_NAME);
00124       return FALSE;
00125     }
00126   }
00127
00128   else
00129   {
00130     if (!(hdc = CreateDC (gszDriverName, gszDeviceName, gszPort, NULL)))
00131     {
00132       char buf[BUFSIZE];
00133
00134       if (_snprintf (buf, BUFSIZE-1, GetStringRes(IDS_FMT_CREDCFAIL), gszDriverName, gszDeviceName, gszPort) > 0)
00135         ErrMsgBox (buf, ERR_MOD_NAME);
00136
00137       return FALSE;
00138     }
00139   }
00140
00141   for (i = 0; i < MAX_DEVICE_CAPS; i++)
00142   {
00143     iValue = GetDeviceCaps (hdc, gaCaps[i].iValue);
00144     TranslateDeviceCaps (i, gaCaps[i].iValue, iValue);
00145   }
00146
00147   if (!strcmp (gszDeviceName, "Display"))
00148     ReleaseDC(ghwndDevCaps, hdc);
00149   else
00150     DeleteDC (hdc);
00151
00152   return TRUE;
00153 }
00154
00155
00156
00157 /******************************************************************************\
00158 *
00159 *  FUNCTION:    TranslateDeviceCaps
00160 *
00161 *  INPUTS:      arrayIndex - index into gaCaps[]
00162 *               capIndex   - devcap index (eg. TECHNOLOGY, CURVECAPS)
00163 *               iValue     - value returned by GetDeviceCaps
00164 *
00165 *  COMMENTS:    For simple devcaps (eg. tjose with single numeric return
00166 *               value), appends caps value to string and inserts into
00167 *               listbox. For "complex" caps (those returning multiple
00168 *               bit-values) calls ComplexCapsLine which handles text
00169 *               formattting & insertion.
00170 *
00171 \******************************************************************************/
00172
00173 void TranslateDeviceCaps (int arrayIndex, int capIndex, int iValue)
00174 {
00175   char buf[BUFSIZE];
00176
00177   lstrcpyn (buf, gaCaps[arrayIndex].szValue, BUFSIZE);
00178
00179   switch (capIndex)
00180   {
00181     case TECHNOLOGY:
00182     {
00183       int     i;
00184
00185       for (i = 0; i < MAX_TECHNOLOGY_CAPS; i++)
00186         if (iValue == (gaTechnologyCaps + i)->iValue)
00187         {
00188           strncat(buf, (gaTechnologyCaps + i)->szValue, BUFSIZE - strlen(buf));
00189           SendDlgItemMessage (ghwndDevCaps, DID_LISTBOX, LB_INSERTSTRING,
00190                               (UINT)-1, (LONG_PTR) buf);
00191           break;
00192         }
00193
00194       break;
00195     }
00196
00197     case CURVECAPS:
00198
00199       ComplexDeviceCapsLine (buf, gaCurveCaps, MAX_CURVE_CAPS, iValue, BUFSIZE);
00200       break;
00201
00202     case LINECAPS:
00203
00204       ComplexDeviceCapsLine (buf, gaLineCaps, MAX_LINE_CAPS, iValue, BUFSIZE);
00205       break;
00206
00207     case POLYGONALCAPS:
00208
00209       ComplexDeviceCapsLine (buf, gaPolygonCaps, MAX_POLYGON_CAPS, iValue, BUFSIZE);
00210       break;
00211
00212     case TEXTCAPS:
00213
00214       ComplexDeviceCapsLine (buf, gaTextCaps, MAX_TEXT_CAPS, iValue, BUFSIZE);
00215       break;
00216
00217     case CLIPCAPS:
00218
00219       ComplexDeviceCapsLine (buf, gaClipCaps, MAX_CLIP_CAPS, iValue, BUFSIZE);
00220       break;
00221
00222     case RASTERCAPS:
00223
00224       ComplexDeviceCapsLine (buf, gaRasterCaps, MAX_RASTER_CAPS, iValue, BUFSIZE);
00225       break;
00226
00227     default:
00228
00229       wsprintf(buf, gaCaps[arrayIndex].szValue, iValue);
00230
00231       SendDlgItemMessage (ghwndDevCaps, DID_LISTBOX, LB_INSERTSTRING,
00232                           (UINT)-1, (LONG_PTR) buf);
00233       break;
00234   }
00235 }
00236
00237
00238
00239 /******************************************************************************\
00240 *
00241 *  FUNCTION:     ComplexDeviceCapsLine
00242 *
00243 *  INPUTS:       pbuf        - pointer to buffer containing a cap-type
00244 *                              string
00245 *                pLkUp       - pointer to a CAPSLOOKUP table
00246 *                iMaxEntries - # of enries in table pointed at by pLkUp
00247 *                iValue      - an integer containing 1+ bit-value flags.
00248 *
00249 *  COMMENTS:     This function is used to expand an int containing
00250 *                multiple bit-values into a set of strings which are
00251 *                inserted into the DevCapsDlg listbox. The iValue
00252 *                parameter is checked against each iIndex entry in the
00253 *                CAPSLOOKUP table pointed at by pLkUp, and when matches
00254 *                are found the corresponding (lpszValue) string is
00255 *                inserted.
00256 *
00257 *                The buffer pointed to by pbuf will be destroyed.
00258 *
00259 \******************************************************************************/
00260
00261 void ComplexDeviceCapsLine (char *pbuf, CAPSLOOKUP *pLkUp, int iMaxEntries,
00262                      int iValue, int iBuffSize)
00263 {
00264   int  i;
00265   BOOL bNewLine = FALSE;
00266
00267   for (i = 0; i < iMaxEntries; i++)
00268
00269     if (iValue & (pLkUp + i)->iValue)
00270     {
00271       if (bNewLine)
00272       {
00273         //
00274         // Keep the first symbolic constant on the same line as the
00275         //   cap type, eg:  "TECHNOLOGY:     DT_RASDISPLAY".
00276         //
00277
00278         lstrcpyn (pbuf, BLANKS, iBuffSize);
00279         strncat (pbuf, (pLkUp + i)->szValue, iBuffSize - strlen(pbuf));
00280       }
00281       else
00282       {
00283         //
00284         // Put symbolic constant on new line, eg:
00285         //                  "                DT_RASPRINTER".
00286         //
00287
00288         strncat (pbuf, (pLkUp + i)->szValue, iBuffSize - strlen(pbuf));
00289         bNewLine = TRUE;
00290       }
00291       SendDlgItemMessage (ghwndDevCaps, DID_LISTBOX, LB_INSERTSTRING,
00292                           (UINT)-1, (LONG_PTR) pbuf);
00293    }
00294 }
00295
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/land.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

land.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Land.h"
00021
00022 const GUID CLandBasedVehicle::thisGuid = { 0x2974380e, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CLandBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

udp_hdr Member List

This is the complete list of members for udp_hdr, including all inherited members.
dest_portno | udp_hdr
dst_portno | udp_hdr
src_portno | udp_hdr
udp_checksum | udp_hdr
udp_length | udp_hdr
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapirecv/workerthread.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapirecv

workerthread.cpp

Go to the documentation of this file.
00001 /*
00002
00003 Copyright (c) 1999 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     WorkerThread.cpp
00008
00009 Abstract:
00010
00011     Implementation of CWorkerThread class
00012
00013 */
00014
00015
00016 #include "common.h"
00017 #include "WorkerThread.h"
00018
00019
00020
00021 ///////////////////////////////////////////////////////////////////////////////
00022 //
00023 // CWorkerThread::Initialize
00024 //
00025 // create the thread
00026 //
00027 ///////////////////////////////////////////////////////////////////////////////
00028
00029 HRESULT CWorkerThread::Initialize()
00030 {
00031
00032     //
00033     // if the thread is already initialized
00034     //
00035
00036     if ( (NULL != m_hThreadHandle) && (0 != m_nThreadID) )
00037     {
00038
00039         LogError("CWorkerThread::Initialize() thread is already running");
00040
00041         return E_UNEXPECTED;
00042     }
00043
00044
00045     //
00046     // start the thread
00047     //
00048
00049     m_hThreadHandle = CreateThread(NULL,        // security
00050                                    0,           // stack
00051                                    ThreadFunction,    // thread function
00052                                    0,           // thread parameter
00053                                    0,           // flags
00054                                    &m_nThreadID);
00055
00056     //
00057     // thread creation failed. log a message and return an error
00058     //
00059
00060     if (NULL == m_hThreadHandle)
00061     {
00062         LogError("CWorkerThread::Initialize() "
00063                  "failed to start the worker thread");
00064
00065         return E_FAIL;
00066     }
00067
00068
00069     //
00070     // thread created. log thread id.
00071     //
00072
00073     LogMessage("CWorkerThread::Initialize() succeeded. thread id [0x%lx]",
00074                 m_nThreadID);
00075
00076     return S_OK;
00077
00078 }
00079
00080
00081 ///////////////////////////////////////////////////////////////////////////////
00082 //
00083 // CWorkerThread::Shutdown
00084 //
00085 // exit the thread and close thread handle
00086 //
00087 ///////////////////////////////////////////////////////////////////////////////
00088
00089 HRESULT CWorkerThread::Shutdown()
00090 {
00091
00092      LogError("CWorkerThread::Shutdown() entered");
00093
00094     //
00095     // if the thread is running, post quit message and wait for thread to exit
00096     //
00097
00098     if (NULL != m_hThreadHandle)
00099     {
00100
00101         //
00102         // let the thread know it's time to go home
00103         //
00104
00105         PostMessage(WM_QUIT, NULL, NULL);
00106
00107
00108         //
00109         // wait for the thread to disappear
00110         //
00111
00112         DWORD rc = WaitForSingleObject(m_hThreadHandle, INFINITE);
00113
00114         //
00115         // close thread handle
00116         //
00117
00118         CloseHandle(m_hThreadHandle);
00119         m_hThreadHandle = NULL;
00120
00121         m_nThreadID = 0;
00122
00123
00124         if (rc != WAIT_OBJECT_0)
00125         {
00126             LogError("CWorkerThread::Shutdown() "
00127                      "Failed waiting for thread to shutdown");
00128
00129             return E_FAIL;
00130         }
00131         else
00132         {
00133
00134             LogMessage("CWorkerThread::Shutdown() finished");
00135
00136             return S_OK;
00137
00138         }
00139
00140     }
00141     else
00142     {
00143         //
00144         // thread was not running
00145         //
00146
00147         LogError("CWorkerThread::Shutdown() thread is not running");
00148
00149         return E_FAIL;
00150     }
00151
00152 }
00153
00154
00155 ///////////////////////////////////////////////////////////////////////////////
00156 //
00157 // CWorkerThread::~CWorkerThread
00158 //
00159 // log a message and fire assert in the thread is still running
00160 //
00161 ///////////////////////////////////////////////////////////////////////////////
00162
00163 CWorkerThread::~CWorkerThread()
00164 {
00165     LogError("CWorkerThread::~CWorkerThread() entered");
00166
00167
00168     //
00169     // the thread should not be running at this point -- the app should have
00170     // called Shutdown()
00171     //
00172
00173     if (NULL != m_hThreadHandle)
00174     {
00175         LogError("CWorkerThread::~CWorkerThread thread [%ld] is still running",
00176                   m_nThreadID);
00177     }
00178
00179     _ASSERTE(NULL == m_hThreadHandle);
00180
00181
00182     LogError("CWorkerThread::~CWorkerThread() finished");
00183 }
00184
00185
00186 ///////////////////////////////////////////////////////////////////////////////
00187 //
00188 // CWorkerThread::PostMessage
00189 //
00190 // posts a message to the thread
00191 //
00192 ///////////////////////////////////////////////////////////////////////////////
00193
00194 BOOL CWorkerThread::PostMessage( UINT Msg,       // message to post
00195                                  WPARAM wParam,  // first message parameter
00196                                  LPARAM lParam   // second message parameter
00197                                  )
00198 {
00199
00200     BOOL bReturn = FALSE;
00201
00202
00203     if (NULL != m_hThreadHandle)
00204     {
00205
00206         //
00207         // the thread is running, post the message
00208         //
00209
00210         bReturn = PostThreadMessage(m_nThreadID, Msg, wParam, lParam);
00211
00212     }
00213
00214
00215     return bReturn;
00216 }
00217
00218
00219 ///////////////////////////////////////////////////////////////////////////////
00220 //
00221 // CWorkerThread::ThreadFunction
00222 //
00223 //
00224 // thread function. receives messages posted to the thread. Forwards TAPI
00225 // messages to TAPI event handler. Exits on WM_QUIT.
00226 //
00227 ///////////////////////////////////////////////////////////////////////////////
00228
00229 unsigned long _stdcall CWorkerThread::ThreadFunction(void *)
00230 {
00231
00232     LogMessage("CWorkerThread::ThreadFunction() starting");
00233
00234
00235     CoInitializeEx(NULL, COINIT_MULTITHREADED);
00236
00237     //
00238     // force creation of message queue
00239     //
00240
00241     MSG msg;
00242
00243
00244     //
00245     // keep retrieving messages until we fail or get WM_QUIT
00246     //
00247
00248     while (GetMessage(&msg, NULL, 0, 0))
00249     {
00250
00251         switch (msg.message)
00252         {
00253
00254         case WM_PRIVATETAPIEVENT:
00255             {
00256
00257                 //
00258                 // get event from the message
00259                 //
00260
00261                 TAPI_EVENT TapiEvent = (TAPI_EVENT)msg.wParam;
00262                 IDispatch *pEvent = (IDispatch*)msg.lParam;
00263
00264
00265                 //
00266                 // pass event to the event handler
00267                 //
00268
00269                 OnTapiEvent(TapiEvent, pEvent);
00270
00271                 pEvent = NULL;
00272
00273
00274                 //
00275                 // do not check the error code from event handler -
00276                 // there is not much we can do here anyway.
00277                 //
00278
00279                 //
00280                 // Note: pEvent is released by OnTapiEvent, so we should not
00281                 // use it after OnTapiEvent returns
00282                 //
00283
00284
00285             }
00286
00287             break;
00288
00289         default:
00290
00291             //
00292             // we are not interested in any other messages
00293             //
00294
00295             break;
00296         }
00297
00298
00299     } // while (GetMessage())
00300
00301
00302     CoUninitialize();
00303
00304     LogMessage("CWorkerThread::ThreadFunction() exiting");
00305
00306     return 0;
00307
00308 } // CWorkerThread::ThreadFunction
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRowset Member List

This is the complete list of members for CRowset, including all inherited members.
Abort(HCHAPTER hChapter, DBASYNCHOP eOperation) | CAsynchBase | [virtual]
AddRefAccessor(HACCESSOR hAccessor) | CDataAccess | [virtual]
AddRefRows(DBROWCOUNT cRows, HROW *rghRows, ULONG *rgRefCounts=NULL) | CRowset | [virtual]
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CRowset | [virtual]
AutoRelease() | CRowset | [virtual]
CAsynchBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CAsynchBase |
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CBaseObj(EBaseObjectType botVal) | CBaseObj | [protected]
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CDataAccess(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CDataAccess |
CImpIAccessor class | CRowset | [friend]
CImpIColumnsInfo class | CRowset | [friend]
CImpIConvertType class | CRowset | [friend]
CImpIGetRow class | CRowset | [friend]
CImpIGetSession class | CRowset | [friend]
CImpIRow class | CRowset | [friend]
CImpIRowChange class | CRowset | [friend]
CImpIRowset class | CRowset | [friend]
CImpIRowsetChange class | CRowset | [friend]
CImpIRowsetIdentity class | CRowset | [friend]
CImpIRowsetInfo class | CRowset | [friend]
CreateAccessor(DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings, const DBBINDING *rgBindings, DBLENGTH cRowSize, HACCESSOR *phAccessor) | CDataAccess | [virtual]
CreateAccessors(BINDCOLS eBindCols) | CDataAccess | [virtual]
CreateHelperFunctions(void) | CRowset | [private]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CRow class | CRowset | [friend]
CRowset(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CRowset |
CRowset(LPUNKNOWN) | CRowset |
DisplayObject() | CRowset | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
FInit(CFileIO *, CBaseObj *, WCHAR *pwszFileName, WCHAR *pwszDataSource) | CRowset |
GetBaseObjectType() | CBaseObj | [inline]
GetBaseType() | CBase | [inline]
GetBookmark(HROW hRow, DBBKMARK *pcbBookmark, BYTE **ppBookmark) | CRowset | [virtual]
GetChapter(HROW hRow, DBORDINAL iOrdinal, HCHAPTER *phChapter) | CRowset | [virtual]
GetColInfo() | CDataAccess | [virtual]
GetColInfo(DBORDINAL *pcColumns, DBCOLUMNINFO **prgColumnInfo, WCHAR **ppStringBuffer, DBORDINAL *pcHiddenColumns) | CDataAccess | [virtual]
GetColumnData(const DBBINDING *pBinding, void *pData, DBSTATUS *pdbStatus, DBLENGTH *pdbLength, DBTYPE *pwSubType, WCHAR *pwszValue, ULONG ulMaxSize, DWORD dwFlags, DBTYPE wBackendType) | CDataAccess | [virtual]
GetColumnImage(const DBCOLUMNINFO *pColInfo, DBSTATUS dbStatus=DBSTATUS_S_OK) | CDataAccess | [virtual]
GetColumnsRowset(CAggregate *pCAggregate, bool fOptColumns, REFIID riid, ULONG cPropSets, DBPROPSET *rgPropSets, IUnknown **ppIUnknown) | CDataAccess | [virtual]
GetCUtilProp() | CRowset | [inline]
GetData(HROW hRow, HACCESSOR hAccessor=NULL, void *pData=NULL, DBPROPID dwSourceID=DBPROP_IRowset) | CRowset | [virtual]
GetDefaultInterface() | CRowset | [inline, virtual]
GetFileObj() | CRowset | [inline]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CRowset | [virtual]
GetNextRows(DBROWOFFSET lOffset, DBROWCOUNT cRows, DBCOUNTITEM *pcRowsObtained, HROW **prghRows) | CRowset | [virtual]
GetObjectDesc() | CRowset | [virtual]
GetObjectImage() | CRowset | [inline, virtual]
GetObjectMenu() | CRowset | [inline, virtual]
GetObjectName() | CRowset | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetOuterUnknown() | CBaseObj | [inline]
GetParent(SOURCE eSource) | CBase | [virtual]
GetRowBuff(DBCOUNTITEM iRow, BOOL fDataLocation=FALSE) | CRowset | [private]
GetRowFromHROW(CAggregate *pCAggregate, HROW hRow, REFIID riid, IUnknown **ppIUnknown) | CRowset | [virtual]
GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase, LPOLESTR *ppwszStatusText) | CAsynchBase | [virtual]
Initialize() | CAsynchBase | [virtual]
IsInitialized() | CAsynchBase | [inline, virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_Bindings | CDataAccess |
m_bSchemaRowset | CDataAccess |
m_cbRowSize | CRowset | [protected]
m_cbTotalRowSize | CRowset | [protected]
m_cCols | CRowset | [protected]
m_ColumnInfo | CDataAccess |
m_cRef | CRowset | [protected]
m_cRows | CRowset | [protected]
m_dwCLSCTX | CBase |
m_dwCookieAsynchNotify | CAsynchBase |
m_dwCookieRowsetNotify | CRowset |
m_dwStatus | CRowset | [protected]
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_fInitialized | CAsynchBase |
m_fRemoveDeleted | CRowset |
m_guidSource | CBase |
m_hAccessor | CDataAccess |
m_hBmkAccessor | CDataAccess |
m_hChapter | CRowset |
m_hTreeItem | CBase |
m_irowFilePos | CRowset | [protected]
m_irowLastFilePos | CRowset | [protected]
m_irowMin | CRowset | [protected]
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pCreator | CRowset |
m_pData | CDataAccess |
m_pextbufferAccessor | CRowset | [protected]
m_pFileio | CRowset | [protected]
m_pIAccessor | CRowset | [protected]
m_pIAggregate | CBase |
m_pIBuffer | CRowset | [protected]
m_pIChapteredRowset | CRowset |
m_pIColumnsInfo | CRowset | [protected]
m_pIColumnsRowset | CDataAccess |
m_pIConnectionPointContainer | CContainerBase |
m_pIConvertType | CRowset | [protected]
m_pIDBAsynchStatus | CAsynchBase |
m_pIDBInitialize | CAsynchBase |
m_pIGetRow | CRowset |
m_pIGetRow | CRowset | [protected]
m_pIRowset | CRowset |
m_pIRowset | CRowset | [protected]
m_pIRowsetBookmark | CRowset |
m_pIRowsetChange | CRowset |
m_pIRowsetChange | CRowset | [protected]
m_pIRowsetFind | CRowset |
m_pIRowsetIdentity | CRowset |
m_pIRowsetIdentity | CRowset | [protected]
m_pIRowsetIndex | CRowset |
m_pIRowsetInfo | CRowset |
m_pIRowsetInfo | CRowset | [protected]
m_pIRowsetLocate | CRowset |
m_pIRowsetRefresh | CRowset |
m_pIRowsetResynch | CRowset |
m_pIRowsetScroll | CRowset |
m_pIRowsetUpdate | CRowset |
m_pIRowsetView | CRowset |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_pLastBindBase | CRowset | [protected]
m_pParentObj | CRowset | [protected]
m_prowbitsIBuffer | CRowset | [protected]
m_pUnkOuter | CBaseObj | [protected]
m_pUtilProp | CRowset | [protected]
m_rgbRowData | CRowset | [protected]
m_strObjectDesc | CBase | [protected]
m_ulRowRefCount | CRowset | [protected]
m_wszDataSourcePath | CRowset | [protected]
m_wszFilePath | CRowset | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID, LPVOID *) | CRowset |
CDataAccess::QueryInterface(REFIID riid, void **ppvObject) | CBase |
Rebind(BYTE *pBase) | CRowset | [private]
ReleaseAccessor(HACCESSOR *phAccessor, BOOL fReleaseAlways=FALSE) | CDataAccess | [virtual]
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
ReleaseRows(DBROWCOUNT cRows, HROW *rghRows, ULONG *rgRefCounts=NULL) | CRowset | [virtual]
RestartPosition() | CRowset | [virtual]
SetColumnData(const DBBINDING *pBinding, void *pData, DBSTATUS dbStatus, DBLENGTH dbLength, WCHAR *pwszValue, DWORD dwFlags, DBTYPE wBackendType) | CDataAccess | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
SetupBindings(BINDCOLS eBindCols, DBCOUNTITEM *cBindings, DBBINDING **prgBindings, DBLENGTH *pcRowSize=NULL) | CDataAccess | [virtual]
STDMETHODIMP_(DBREFCOUNT) AddRef(void) | CRowset |
STDMETHODIMP_(DBREFCOUNT) Release(void) | CRowset |
CDataAccess::STDMETHODIMP_(ULONG) AddRef() | CBase |
SupportIRowsetChange() | CRowset | [private]
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
Uninitialize() | CAsynchBase | [virtual]
ValidateAccessor(HACCESSOR hAccessor, ULONG ulRefCount=1) | CDataAccess | [virtual]
ValidateRow(HROW hRow, ULONG ulRefCount=1) | CRowset | [virtual]
~CAsynchBase() | CAsynchBase | [virtual]
~CBase() | CBase | [virtual]
~CBaseObj() | CBaseObj | [virtual]
~CContainerBase() | CContainerBase | [virtual]
~CDataAccess() | CDataAccess | [virtual]
~CRowset() | CRowset | [virtual]
~CRowset(void) | CRowset |
Generated on Wed Nov 13 2024 16:57:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/dlgsrc.h Source File

  • Multimedia
  • Audio
  • multichan

dlgsrc.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 #if !defined(AFX_DLGSRC_H__D1BB3766_96B0_11D2_9012_00C04FC2D3B8__INCLUDED_)
00006 #define AFX_DLGSRC_H__D1BB3766_96B0_11D2_9012_00C04FC2D3B8__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 // DlgSrc.h : header file
00012 //
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CDlgSrc dialog
00016
00017 /*
00018  *
00019  *  Class           :   CDlgSrc
00020  *  Purpose         :   represents one audio channel along with its UI
00021  *
00022  */
00023 class CDlgSrc : public CDialog
00024 {
00025 //
00026 //  Construction
00027 //
00028 public:
00029                   CDlgSrc             ( CWnd * );
00030                     ~CDlgSrc            ( void );
00031     void            Create              ( LPCSTR, SIZE, DWORD );
00032
00033 //
00034 //  Attributes
00035 //
00036 public:
00037     CWnd*           m_pwndParent;       //  link to parent
00038     LPWAVEHDR       m_lpwhdr;           //  ptr to a wave header
00039     PVOID           m_pvData;           //  ptr to data buffer
00040     ULONG           m_cbData;           //  size of the data buffer
00041     ULONG           m_cSamples;         //  estimated number of samples
00042     DWORD           m_dwChannelMask;    //  speakers used
00043     WAVEFORMATEX    m_wfx;              //  waveformatex structure
00044     UINT            m_nChannel;         //  channel's ID
00045     BOOL            m_fDragging;        //  dragging flag
00046     BOOL            m_fPlayable;        //  play flag
00047     CPoint          m_ptPosInCaption;   //
00048
00049 //
00050 //  Accessors
00051 //
00052 public:
00053     void      SetChannelNum   ( UINT );               //  sets the channel ID
00054     BOOL            AquireData          ( WAVEFORMATEX *, PVOID, ULONG, UINT ); //  acquire data off of the multichan input wave
00055
00056 //  Overrides
00057     virtual LRESULT WindowProc          ( UINT, WPARAM, LPARAM );               //  message processing procedure
00058
00059 // Dialog Data
00060 public:                                 //  MFC/UI stuff
00061   //{{AFX_DATA(CDlgSrc)
00062   enum            { IDD = IDD_SRC };  //  Identifier
00063   CButton         m_butClose;         //  close button
00064     CButton         m_butPlay;          //  start button
00065     CButton         m_butStop;          //  stop button
00066   CStatic         m_cInput;
00067   CComboBox     m_comboSpeaker;     //  speaker selection list
00068   BOOL          m_fUse;             //  include flag; not used
00069   int             m_nSpeaker;         //  selected speaker
00070   CString         m_strName;          //  window title
00071   //}}AFX_DATA
00072
00073 // Overrides
00074   // ClassWizard generated virtual function overrides
00075   //{{AFX_VIRTUAL(CDlgSrc)
00076   protected:
00077   virtual void    DoDataExchange      (CDataExchange* pDX);    // DDX/DDV support
00078   //}}AFX_VIRTUAL
00079
00080 // Implementation
00081 protected:
00082
00083   // Generated message map functions
00084   //{{AFX_MSG(CDlgSrc)
00085   afx_msg void    OnComboSpeaker      ();                     //  speaker selection function
00086   afx_msg void    OnPlay              ();                     //  play function
00087     afx_msg void    OnStop              ();                     //  stop function
00088   virtual void    OnOK                ();                     //
00089   virtual void    OnCancel            ();                     //
00090   afx_msg HBRUSH  OnCtlColor          ( CDC*, CWnd*, UINT );  //
00091   afx_msg void    OnLButtonDown       (UINT, CPoint );        //
00092   afx_msg void    OnLButtonUp         (UINT, CPoint );        //
00093   afx_msg void    OnMouseMove         (UINT, CPoint );        //
00094   virtual BOOL    OnInitDialog        ();                     //
00095   //}}AFX_MSG
00096   DECLARE_MESSAGE_MAP()
00097 };  //  CDlgSrc
00098
00099 //
00100 //  list of opened channels
00101 //
00102 extern CList<CDlgSrc*,CDlgSrc*>    g_listSources;
00103
00104 /*
00105  *  Inlines
00106  */
00107
00108 //
00109 // ----------------------------------------------------------------------------------
00110 // CDlgSrc::SetChannelNum
00111 //  Updates m_nChannel and corresponding UI
00112 // ----------------------------------------------------------------------------------
00113 inline
00114 void
00115 CDlgSrc::SetChannelNum
00116 (
00117     UINT    nChannel
00118 )
00119 {
00120     char sz[10];
00121     m_nChannel = nChannel;
00122     _snprintf(sz, 10, "%d", nChannel);
00123     SetDlgItemText( IDC_CHANNELNUM, sz );
00124 }   //  CDglSrc::SetChannelNum
00125
00126
00127 //{{AFX_INSERT_LOCATION}}
00128
00129 #endif // !defined(AFX_DLGSRC_H__D1BB3766_96B0_11D2_9012_00C04FC2D3B8__INCLUDED_)
00130
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/statnode.h Source File

  • SysMgmt
  • MMC
  • Complete

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038     virtual void SetScopeItemValue(HSCOPEITEM hscopeitem) { m_hParentHScopeItem = hscopeitem; }
00039     virtual HSCOPEITEM GetParentScopeItem() { return m_hParentHScopeItem; }
00040
00041 public:
00042     // virtual functions go here (for MMCN_*)
00043     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00044
00045 private:
00046     enum { NUMBER_OF_CHILDREN = 4 };
00047     CDelegationBase *children[NUMBER_OF_CHILDREN];
00048
00049     HSCOPEITEM m_hParentHScopeItem;
00050
00051     // {C094012C-6BE7-11d3-9156-00C04F65B3F9}
00052     static const GUID thisGuid;
00053 };
00054
00055
00056
00057 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/ClUuid/ClUuid.Idl Source File

  • NetDS
  • RPC
  • ClUuid

ClUuid.Idl

Go to the documentation of this file.
00001 [ uuid (4AF72C40-4DAA-1068-A9AD-08002B2EB23C),
00002   version(1.0),
00003   pointer_default(unique)
00004 ]
00005 interface cluuid
00006 {
00007
00008 void HelloProc([in, string] unsigned char * pszString);
00009
00010 void Shutdown(void);
00011
00012 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/FileRepAsyncPipe/FileRep.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • FileRepAsyncPipe

FileRep.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     File Replication Client Utility
00006
00007     FILE: FileRep.cpp
00008
00009     USAGE:
00010         FileRep [server name] [remote file] [local file] <options...>
00011
00012     OPTIONS:
00013         -n network_address
00014         -p protocol_sequence
00015         -e endpoint
00016         -d print messages
00017
00018     PURPOSE: Client utility for the file replication application
00019
00020     FUNCTIONS: main() - binds to replication server and requests
00021         file replication.
00022
00023     COMMENTS:
00024
00025 */
00026
00027 #include "common.h"
00028
00029 #include <process.h>
00030 #include <rpc.h>
00031 #include <Ntdsapi.h>
00032
00033 #include "Service.h"
00034
00035 // header file generated by MIDL compiler
00036 #include "FileRepClient.h"
00037
00038 /*
00039     FUNCTION: PrintUsage()
00040
00041     PURPOSE: Prints help information.
00042
00043     PARAMETERS:
00044         ProgName - name of the executable
00045
00046     RETURN VALUE:
00047         none
00048
00049     COMMENTS:
00050 */
00051 void PrintUsage(TCHAR *ProgName) {
00052     _tprintf(TEXT("%s - File Replication Client Utility\n\n"), ProgName);
00053     _tprintf(TEXT("Usage: %s [server name] [remote file] [local file] <options...> \n\n"), ProgName);
00054     _tprintf(TEXT("Options:\n"));
00055     _tprintf(TEXT(" -p protocol_sequence\n"));
00056     _tprintf(TEXT(" -n network_address\n"));
00057     _tprintf(TEXT(" -e endpoint\n"));
00058     _tprintf(TEXT(" -d print messages\n"));
00059 }
00060
00061 /*
00062     FUNCTION: main()
00063
00064     PURPOSE: Main funciton for the utility.  It binds to the local server
00065         and requests file replication.
00066
00067     PARAMETERS:
00068         dwArgc - number of command line arguments
00069         lpszArgv - array of command line arguments
00070
00071     RETURN VALUE:
00072         none
00073
00074     COMMENTS:
00075
00076 */
00077 INT _cdecl main(int argc, char **argv) {
00078
00079     INT i;
00080     RPC_STATUS rpcstatus;
00081
00082     // Controlls printing out of messages.
00083     BOOL bDebug = FALSE;
00084
00085     // Explicit binding handle to the client system service.
00086     handle_t hFileRepClient = NULL;
00087
00088     // These are the default values for extablishing connections.
00089     // Default connection is to a local server over local rpc.
00090     LPTSTR pszProtocolSequence = TEXT("ncalrpc");
00091     LPTSTR pszNetworkAddress = NULL;
00092
00093     // An empty endpoint string is used, since we are going to
00094     // connect to the endpoint dynamically generated by the
00095     // RPC run-time library.  Server calls RpcServerUseProtseq to
00096     // obtain a binding hadnle and a dynamic endpoint.
00097     LPTSTR pszEndpoint = TEXT("");
00098
00099     LPTSTR pszUuid = NULL;
00100     LPTSTR pszOptions = NULL;
00101     LPTSTR pszStringBinding = NULL;
00102
00103     LPTSTR ServerName = NULL;
00104     LPTSTR RemoteFileName = NULL;
00105     LPTSTR LocalFileName = NULL;
00106
00107     INT nNumArgs;
00108
00109 #ifndef NO_SEC
00110     // Quality of service structure to ensure authentication.
00111     RPC_SECURITY_QOS SecurityQOS;
00112
00113     // Used in generating the principal name for the local system service.
00114     TCHAR Name[128];
00115     DWORD cbName = sizeof(Name);
00116
00117     TCHAR DomainName[128];
00118     DWORD cbDomainName = sizeof(DomainName);
00119     SID_NAME_USE Use;
00120
00121     SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
00122     BYTE sidBuffer[100];
00123     PSID pSID = (PSID)&sidBuffer;
00124 #endif
00125
00126     // Get a common handle on the command line arguments for both
00127     // UNICODE and ASCII
00128 #ifdef _UNICODE
00129     LPWSTR *szArgList = CommandLineToArgvW(GetCommandLine(), &nNumArgs);
00130     if (NULL == szArgList) {
00131         _tprintf(TEXT("FileRep main: CommandLineToArgW failed"));
00132         exit(EXIT_FAILURE);
00133     }
00134 #else
00135     char **szArgList = argv;
00136     nNumArgs = argc;
00137 #endif
00138
00139     // Check that the correct number of arguments is given.
00140     if(nNumArgs<4){
00141         PrintUsage(szArgList[0]);
00142         exit(EXIT_FAILURE);
00143     }
00144
00145     // Extract the required arguments.
00146     ServerName = szArgList[1];
00147     RemoteFileName = szArgList[2];
00148     LocalFileName = szArgList[3];
00149
00150     // Allow the user to override settings with command line switches.
00151     for (i = 4; i < nNumArgs; i++) {
00152         // Well-formed argument switches start with '/' or '-' and are
00153         // two characters long.
00154         if (((*szArgList[i] == TEXT('-')) || (*szArgList[i] == TEXT('/'))) && _tcsclen(szArgList[i]) == 2) {
00155
00156             switch (_totlower(*(szArgList[i]+1))) {
00157
00158                 case TEXT('p'):
00159
00160                     // Override protocol sequence.
00161
00162                     // Check that the next argument exists and is not a
00163                     // switch.
00164                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00165                         pszProtocolSequence = szArgList[++i];
00166                     }
00167                     // Otherwise we have an empty protocol sequence.
00168                     else {
00169                         // We do not allow an empty protocol sequence.
00170                         _tprintf(TEXT("Protocol sequence can't be \"\".\n"));
00171                         exit(EXIT_FAILURE);
00172                     }
00173
00174                     break;
00175
00176                 case TEXT('n'):
00177
00178                     // Override the network address.
00179                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00180                         pszNetworkAddress = szArgList[++i];
00181                     }
00182                     else {
00183                         pszNetworkAddress = TEXT("");
00184                     }
00185
00186                     break;
00187
00188                 case TEXT('e'):
00189
00190                     // Override the endpoint.
00191                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00192                         pszEndpoint = szArgList[++i];
00193                     }
00194                     else {
00195                         pszEndpoint = TEXT("");
00196                     }
00197
00198                     break;
00199
00200                 case TEXT('d'):
00201                     // Turn on debugging.
00202                     bDebug = TRUE;
00203                     break;
00204
00205                 case TEXT('h'):
00206                 case TEXT('?'):
00207                 default:
00208                     PrintUsage(szArgList[0]);
00209                     exit(EXIT_SUCCESS);
00210             }
00211         }
00212         else {
00213             PrintUsage(szArgList[0]);
00214             exit(EXIT_FAILURE);
00215         }
00216     }
00217
00218     // Concatenate the elements of
00219     // the string binding into the proper sequence.
00220     rpcstatus = RpcStringBindingCompose(pszUuid,
00221                                         pszProtocolSequence,
00222                                         pszNetworkAddress,
00223                                         pszEndpoint,
00224                                         pszOptions,
00225                                         &pszStringBinding);
00226     if(bDebug){
00227         _tprintf(TEXT("RpcStringBindingCompose returned 0x%x\n"), rpcstatus);
00228         _tprintf(TEXT("pszStringBinding = %s\n"), pszStringBinding);
00229     }
00230     RPC_EEINFO_EXIT_IF_FAIL(rpcstatus, TEXT("RpcStringBindingCompose"));
00231
00232     // Set the binding handle that will be used to bind to the server.
00233     rpcstatus = RpcBindingFromStringBinding(pszStringBinding, &hFileRepClient);
00234     if(bDebug) _tprintf(TEXT("RpcBindingFromStringBinding returned 0x%x\n"), rpcstatus);
00235     RPC_EEINFO_EXIT_IF_FAIL(rpcstatus, TEXT("RpcBindingFromStringBinding"));
00236
00237     // Free the binding string.
00238     rpcstatus = RpcStringFree(&pszStringBinding);
00239     ASSERT(rpcstatus == RPC_S_OK);
00240
00241 #ifndef NO_SEC
00242     // Specify quality of service parameters.
00243     SecurityQOS.Version = RPC_C_SECURITY_QOS_VERSION;
00244     SecurityQOS.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH;
00245     // Dynamic identity tracking is more efficient for a single LRPC call.
00246     SecurityQOS.IdentityTracking = RPC_C_QOS_IDENTITY_DYNAMIC;
00247     // The client system service needs to impersonate the security context
00248     // of the client utility on the remote systems where it may replicate
00249     // files from.
00250     // We need to impersonate with level delegate, since the server system
00251     // service will need to impersonate the user further.
00252     SecurityQOS.ImpersonationType = RPC_C_IMP_LEVEL_DELEGATE;
00253
00254     // Generate the principal name for the local system service.
00255     // We can't just use the a string constant, because then
00256     // we rely on a particular English-language representation of the
00257     // principal.
00258
00259     if (AllocateAndInitializeSid(&SIDAuth, 1,
00260                                  SECURITY_NETWORK_SERVICE_RID,
00261                                  0, 0, 0, 0, 0, 0, 0,
00262                                  &pSID) == 0) {
00263         printf("AllocateAndInitializeSid failed\n");
00264         exit(EXIT_FAILURE);
00265     }
00266
00267     if (LookupAccountSid(NULL, // name of local or remote computer
00268                          pSID, // security identifier
00269                          Name, // account name buffer
00270                          &cbName, // size of account name buffer
00271                          DomainName, // domain name
00272                          &cbDomainName, // size of domain name buffer
00273                          &Use) == 0) { // SID type
00274         printf("LookupAccountSid failed\n");
00275         exit(EXIT_FAILURE);
00276     }
00277
00278     if(bDebug) _tprintf(TEXT("Server \"magic name\" is %s\n"), Name);
00279
00280     // Set authentication and authorisation information for
00281     // the binding handle.
00282     // By speciying NULL for the 5th parameter we use the security login
00283     // context for the current address space.
00284     // The security level is "PRIVACY" since it is the only level
00285     // provided by LRPC.
00286     // We are assured of talking to a local service running with
00287     // system privileges.
00288     rpcstatus = RpcBindingSetAuthInfoEx(hFileRepClient, Name, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_WINNT, NULL, NULL, &SecurityQOS);
00289     RPC_EEINFO_EXIT_IF_FAIL(rpcstatus, TEXT("RpcBindingSetAuthInfo"));
00290
00291 #endif
00292
00293     // Make the RPC to request file replication.
00294     RpcTryExcept {
00295         if(bDebug) _tprintf(TEXT("Calling the remote procedure RequestFile(hFileRepClient, %s, %s, %s)\n"), ServerName, RemoteFileName, LocalFileName);
00296
00297         RequestFile(hFileRepClient, ServerName, RemoteFileName, LocalFileName);
00298
00299         if(bDebug) _tprintf(TEXT("RequestFile() finished\n"));
00300     }
00301     // Return "non-fatal" errors.  Catching fatal errors
00302     // makes it harder to debug.
00303     RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00304                   (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00305                   (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00306                   (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00307                   (RpcExceptionCode() != STATUS_BREAKPOINT))
00308                   ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00309
00310       PrintProcFailureEEInfo(TEXT("RequestFile"), RpcExceptionCode());
00311         exit(EXIT_FAILURE);
00312     }
00313     RpcEndExcept;
00314
00315     // Free the binding.
00316     rpcstatus = RpcBindingFree((VOID **)&hFileRepClient);
00317     ASSERT(rpcstatus == RPC_S_OK);
00318
00319     if(bDebug) _tprintf(TEXT("Success!\n"));
00320
00321     return(EXIT_SUCCESS);
00322
00323 } // end main()
00324
00325 /*
00326     MIDL allocate() and free()
00327 */
00328
00329 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
00330     return(AutoHeapAlloc(len));
00331 }
00332
00333 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
00334     if(ptr != NULL) {
00335         AutoHeapFree(ptr);
00336     }
00337 }
00338
00339 // end FileRep.cpp
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHtmlScanner Member List

This is the complete list of members for CHtmlScanner, including all inherited members.
_cTagCharsRead | CHtmlScanner | [private]
_htmlIFilter | CHtmlScanner | [private]
_pwcTagBuf | CHtmlScanner | [private]
_serialStream | CHtmlScanner | [private]
_uLenTagBuf | CHtmlScanner | [private]
CHtmlScanner(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CHtmlScanner |
EatBlanks() | CHtmlScanner | [private]
EatTag() | CHtmlScanner |
EatText() | CHtmlScanner | [private]
GetBlockOfChars(ULONG cCharsNeeded, WCHAR *awcInputBuf, ULONG &cCharsScanned, CToken &token) | CHtmlScanner |
GrowTagBuffer() | CHtmlScanner | [private]
ReadTagIntoBuffer() | CHtmlScanner |
ScanTag(CToken &token) | CHtmlScanner |
ScanTagBuffer(WCHAR *awcName, WCHAR *&pwcValue, unsigned &uLenValue) | CHtmlScanner |
SkipCharsUntilNextRelevantToken(CToken &token) | CHtmlScanner |
TagNameToToken(WCHAR *awcTagName, CToken &token) | CHtmlScanner | [private]
~CHtmlScanner() | CHtmlScanner |
Generated on Wed Nov 13 2024 16:56:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagSTATUSBARLOOKUP Member List

This is the complete list of members for tagSTATUSBARLOOKUP, including all inherited members.
szText | tagSTATUSBARLOOKUP
wMenuItem | tagSTATUSBARLOOKUP
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Common/Inc/MtsAudit.Idl Source File

  • Com
  • Common
  • Inc

MtsAudit.Idl

Go to the documentation of this file.
00001 // MtsAudit.idl : IDL source for MtsAudit.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (MtsAudit.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010 typedef ULONG64 MTS_OBJID;
00011 typedef ULONG64 MTS_RESID;
00012
00013
00014   [
00015
00016     uuid(AFCF0622-1429-11D1-B1B8-00AA00BA3258),
00017
00018     helpstring("IMtsSqlAudit Interface"),
00019     pointer_default(unique)
00020   ]
00021   interface IMtsSqlAudit : IUnknown
00022   {
00023     HRESULT OnUserEvent(
00024                 [in] LONGLONG perfCount,
00025                 [in] VARIANT * pvarEvent
00026           );
00027     HRESULT OnThreadStart(
00028           [in] LONGLONG perfCount,
00029           [in] ULONG ThreadID
00030         );
00031
00032     HRESULT OnThreadTerminate(
00033           [in] LONGLONG perfCount,
00034           [in] ULONG ThreadID
00035         );
00036
00037     HRESULT OnThreadAssignToActivity(
00038           [in] LONGLONG perfCount,
00039           [in] LPCOLESTR guidActivity,
00040           [in] ULONG ThreadID
00041         );
00042
00043     HRESULT OnThreadUnassignFromActivity(
00044           [in] LONGLONG perfCount,
00045           [in] LPCOLESTR guidActivity,
00046           [in] ULONG ThreadID
00047         );
00048     HRESULT OnPackageActivation(
00049           [in] LONGLONG perfCount,
00050           [in] LPCOLESTR guidPackage,
00051           [in] LPCOLESTR sPackageName
00052         );
00053
00054     HRESULT OnPackageShutdown(
00055           [in] LONGLONG perfCount,
00056           [in] LPCOLESTR guidPackage,
00057           [in] LPCOLESTR sPackageName
00058         );
00059     HRESULT OnObjectCreate(
00060           [in] LONGLONG perfCount,
00061           [in] LPCOLESTR guidActivity,
00062           [in] LPCOLESTR clsid,
00063           [in] LPCOLESTR tsid,
00064           [in] MTS_OBJID ObjectID
00065         );
00066
00067     HRESULT OnObjectRelease(
00068           [in] LONGLONG perfCount,
00069           [in] MTS_OBJID ObjectID
00070         );
00071
00072     HRESULT OnTransactionStart(
00073           [in] LONGLONG perfCount,
00074           [in] LPCOLESTR guidTx,
00075           [in] LPCOLESTR tsid,
00076           [in] BOOL fRoot
00077         );
00078
00079     HRESULT OnTransactionPrepared(
00080           [in] LONGLONG perfCount,
00081           [in] LPCOLESTR guidTx,
00082           [in] BOOL fVoteYes
00083         );
00084
00085     HRESULT OnTransactionAborted(
00086           [in] LONGLONG perfCount,
00087           [in] LPCOLESTR guidTx
00088         );
00089
00090     HRESULT OnMethodCall(
00091           [in] LONGLONG perfCount,
00092           [in] MTS_OBJID oid,
00093           [in] LPCOLESTR guidCid,
00094           [in] LPCOLESTR guidRid,
00095           [in] LPCOLESTR sMethod
00096         );
00097
00098     HRESULT OnMethodReturn(
00099           [in] LONGLONG perfCount,
00100           [in] MTS_OBJID oid,
00101           [in] LPCOLESTR guidCid,
00102           [in] LPCOLESTR guidRid,
00103           [in] LPCOLESTR sMethod,
00104           [in] HRESULT hresult
00105         );
00106
00107     HRESULT OnMethodException(
00108           [in] LONGLONG perfCount,
00109           [in] MTS_OBJID oid,
00110           [in] LPCOLESTR guidCid,
00111           [in] LPCOLESTR guidRid,
00112           [in] LPCOLESTR sMethod
00113         );
00114     HRESULT OnObjectActivate(
00115           [in] LONGLONG perfCount,
00116           [in] MTS_OBJID ObjectID
00117         );
00118
00119     HRESULT OnObjectDeactivate(
00120           [in] LONGLONG perfCount,
00121           [in] MTS_OBJID ObjectID
00122         );
00123
00124     HRESULT OnDisableCommit(
00125           [in] LONGLONG perfCount,
00126           [in] MTS_OBJID ObjectID
00127         );
00128
00129     HRESULT OnEnableCommit(
00130           [in] LONGLONG perfCount,
00131           [in] MTS_OBJID ObjectID
00132         );
00133
00134     HRESULT OnSetComplete(
00135           [in] LONGLONG perfCount,
00136           [in] MTS_OBJID ObjectID
00137         );
00138      HRESULT OnResourceCreate(
00139           [in] LONGLONG perfCount,
00140           [in] LPCOLESTR guidActivity,
00141           [in] MTS_OBJID ObjectID,
00142           [in] LPCOLESTR pszType,
00143           [in] MTS_RESID resId
00144         );
00145
00146     HRESULT OnResourceAllocate(
00147           [in] LONGLONG perfCount,
00148           [in] LPCOLESTR guidActivity,
00149           [in] MTS_OBJID ObjectID,
00150           [in] LPCOLESTR pszType,
00151           [in] MTS_RESID resId
00152         );
00153
00154     HRESULT OnResourceRecycle(
00155           [in] LONGLONG perfCount,
00156           [in] MTS_OBJID ObjectID,
00157           [in] LPCOLESTR pszType,
00158           [in] MTS_RESID resId
00159         );
00160
00161     HRESULT OnResourceDestroy(
00162           [in] LONGLONG perfCount,
00163           [in] MTS_OBJID ObjectID,
00164           [in] LPCOLESTR pszType,
00165           [in] MTS_RESID resId
00166         );
00167     HRESULT OnAuthenticate(
00168             LONGLONG perfCount,
00169             LPCOLESTR guidActivity,
00170             LPCOLESTR sOriginalUser,
00171             LPCOLESTR sDirectUser,
00172             BOOL bCurrentUserInpersonatingInProc
00173         );
00174
00175     HRESULT Init(LPCOLESTR sDSN, LPCOLESTR sUser, LPCOLESTR sPw);
00176
00177
00178   };
00179 [
00180   uuid(AFCF0615-1429-11D1-B1B8-00AA00BA3258),
00181   version(1.0),
00182   helpstring("MtsAudit 1.0 Type Library")
00183 ]
00184 library MTSAUDITLib
00185 {
00186   importlib("stdole32.tlb");
00187   importlib("stdole2.tlb");
00188
00189   [
00190     uuid(AFCF0623-1429-11D1-B1B8-00AA00BA3258),
00191     helpstring("MtsSqlAudit Class")
00192   ]
00193   coclass MtsSqlAudit
00194   {
00195     [default] interface IMtsSqlAudit;
00196   };
00197 };
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/npClient/Client32.c Source File

  • WinBase
  • IPC
  • NamePipe
  • npClient

Client32.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014 \******************************************************************************/
00015
00016 /*************************************************************************\
00017 *  PROGRAM: client32.c
00018 *
00019 *  PURPOSE:
00020 *
00021 *     To demonstrate the use of named pipes and the overlapped structure.
00022 *     This code serves as the client side of the named pipe instances.
00023 *     For more details on an overview of this codes designs or use, see
00024 *     the README file.  For details on the implementation, see the comments
00025 *     in this code.
00026 *
00027 *
00028 \*************************************************************************/
00029
00030 #define  STRICT
00031 #include <windows.h>
00032 #include "client32.h"
00033
00034 #include <string.h>
00035 #include <stdio.h>
00036 #include <stdlib.h>
00037
00038 HANDLE hInst;
00039 HWND   hWndClient;
00040
00041 CHAR ShrName[LINE_LEN];                 // Global: net share name.
00042 CHAR ClntName[NAME_SIZE];               // Global: user or pipe client name.
00043 CHAR lpBuffer[255];                     // Global: buffer for string resources
00044
00045 /*************************************************************************\
00046 *
00047 *  FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
00048 *
00049 *  PURPOSE: Launches the Client's dialog box.
00050 *
00051 *  COMMENTS:
00052 *
00053 \*************************************************************************/
00054
00055 int APIENTRY WinMain (HINSTANCE hInstance,
00056                       HINSTANCE hPrevInstance,
00057                       LPSTR     lpCmdLine,
00058                       int       nCmdShow)
00059
00060
00061 {
00062
00063   UNREFERENCED_PARAMETER( nCmdShow );
00064   UNREFERENCED_PARAMETER( lpCmdLine );
00065   UNREFERENCED_PARAMETER( hPrevInstance );
00066
00067   hInst   = hInstance;
00068   return (int)(DialogBox ((HANDLE)hInst, (LPCTSTR)"ClientDialog",
00069                        0L, (DLGPROC)ClientDlgProc));
00070
00071 }
00072
00073
00074 /*************************************************************************\
00075 *
00076 *  PROCEDURE: InitDlgProc (HWND hDlg, WORD wMsg, LONG wParam, LONG lParam)
00077 *
00078 *  PURPOSE:  This dialog box prompts the user for a net share name and
00079 *            a client or user name.  These values are placed into global
00080 *            strings ShrName and ClntName.
00081 *
00082 *  CALLED BY:
00083 *
00084 *    ClientDlgProc();
00085 *
00086 \*************************************************************************/
00087
00088 LONG CALLBACK InitDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
00089   {
00090
00091   UNREFERENCED_PARAMETER(lParam);
00092
00093   switch (wMsg)
00094     {
00095     case WM_INITDIALOG:
00096       PostMessage (GetDlgItem (hDlg, IDD_SVREDIT),
00097                    EM_LIMITTEXT, LINE_LEN, 0);
00098
00099       PostMessage (GetDlgItem (hDlg, IDD_CLNTEDIT),
00100                    EM_LIMITTEXT, NAME_SIZE, 0);
00101     case WM_COMMAND:
00102       switch (LOWORD(wParam))
00103         {                            // When the user clicks okay, get the
00104         case IDB_INITOK:             // share name and user name from the
00105                                      // edit fields.
00106           GetWindowText (GetDlgItem (hDlg, IDD_SVREDIT), ShrName, LINE_LEN);
00107           GetWindowText (GetDlgItem (hDlg, IDD_CLNTEDIT), ClntName, NAME_SIZE);
00108           EndDialog(hDlg, 0);
00109           return (0);
00110
00111         default:
00112           return (0);
00113         }
00114     default:
00115       return (0);
00116     }
00117   return (0);
00118   }
00119
00120
00121 /*************************************************************************\
00122 *
00123 *  PROCEDURE: ClientDlgProc (HWND hDlg, WORD wMsg, LONG wParam, LONG lParam)
00124 *
00125 *  PURPOSE:  This procedure services the dialog box that serves as an interface
00126 *            to the named pipe server instance.  The larger edit field is used
00127 *            to read messages from the server instance.  The smaller edit field
00128 *            is used to type messages to the server instance.  This procedure
00129 *            is responsible for connecting to the named pipe, creating a
00130 *            seperate thread to read the pipe, and sending to the pipe.
00131 *
00132 *  CALLED BY:
00133 *
00134 *    WinMain();
00135 *
00136 *  CALLS TO:
00137 *
00138 *    InitDlgProc();
00139 *    ReadPipe();
00140 *
00141 \**************************************************************************/
00142
00143 LONG CALLBACK ClientDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam)
00144   {
00145   DWORD  retCode;                      // Return code.
00146   CHAR   errorBuf[LINE_LEN] = "";      // Error message buffer.
00147   CHAR   outBuf[OUT_BUF_SIZE]  = "";   // Buffer trapping message to send.
00148   CHAR   sendBuf[OUT_BUF_SIZE] = "";   // Buffer used to modify message.
00149   DWORD  bytesWritten;                 // Used for WriteFile().
00150   DWORD  threadID;                     // Used for CreateThread().
00151   CHAR   fileName[LINE_LEN+NAME_SIZE+2]; // Used to modify pipe/file name.
00152   DWORD  lastError;                    // Used to get returns from GetLastError.
00153
00154   static HANDLE hPipe;                 // File or Pipe handle.
00155   static OVERLAPPED OverLapWrt;        // Overlapped structure
00156   static HANDLE     hEventWrt;         // Event handle for overlapped writes.
00157
00158   UNREFERENCED_PARAMETER( lParam );
00159
00160   hWndClient = hDlg;
00161
00162   switch (wMsg)
00163     {
00164
00165     case WM_COMMAND:
00166       switch (LOWORD(wParam))
00167         {
00168
00169         // When the user presses Send: capture the string from the edit
00170         // field, prepend it with the user name, and overlap write it to
00171         // the server instance of the named pipe.
00172
00173         case IDB_SEND:                 // Get the text from the edit field.
00174           GetWindowText (GetDlgItem(hDlg,IDD_EDITWRITE),
00175                          outBuf, PLEASE_WRITE);
00176
00177                                        // Prepend it with the user name, and
00178                                        // terminate it with a new line
00179                                        // character.
00180
00181           //wsprintf (sendBuf, "%s%s %s\n", ClntName, ":", outBuf);
00182       // If you use wsprintf, you can't prevent a buffer-overflow when outBuf
00183       // is long. Instead, use strncpy and strncat to control how much gets
00184       // written to the buffer. If input is too long, it gets truncated.
00185           strncpy(sendBuf, ClntName, sizeof(sendBuf) - 1);
00186       strncat(sendBuf, ": ", sizeof(sendBuf) - strlen(sendBuf) - 1);
00187       strncat(sendBuf, outBuf, sizeof(sendBuf) - strlen(sendBuf) - 1);
00188       sendBuf[OUT_BUF_SIZE - 1] = '\0'; // null terminate it
00189
00190                                        // Do the overlapped write.
00191           retCode = WriteFile (hPipe, sendBuf, PLEASE_WRITE,
00192                      &bytesWritten, &OverLapWrt);
00193           if (!retCode)
00194             {
00195             lastError = GetLastError();
00196                                        // If Error = IO_PENDING, wait til
00197                                        // the event signals success.
00198             if (lastError == ERROR_IO_PENDING)
00199               WaitForSingleObject (hEventWrt, (DWORD)-1);
00200             }
00201
00202           return (0);
00203
00204         default:
00205           return (0);
00206
00207         }
00208
00209
00210     case WM_INITCLIENT:
00211
00212        // On initialization, use the Init dialog box prompt the user for a
00213        // net share name and a client or user name.  A share name of "."
00214        // means that the named pipe is local to this machine.  Named pipe
00215        // names should have the form '\\.\PIPE<pipename>', for a local machine
00216        // or '\<machinename>\PIPE<pipename>' for remote machines.
00217        // Once the share name is captured from the Init dialog box,
00218        // convert the name into the proper form; then do a CreateFile()
00219        // to connect to the pipe.  Handle any error from the CreateFile().
00220        // Then write the user name to the server instance of the named
00221        // pipe.  Finally, create a thread to read the named pipe.
00222
00223                                        // Launch Init dialog box to capture
00224                                        // share name and user name.
00225        DialogBox ((HANDLE)GetModuleHandle(NULL),
00226                   (LPCTSTR)"InitDialog",
00227                   (HWND)hDlg,
00228                   (DLGPROC)InitDlgProc);
00229
00230                                        // Put captured user name in window
00231                                        // caption.
00232        SetWindowText (hDlg, ClntName);
00233
00234                                        // Construct file/pipe name.
00235        wsprintf (fileName, "%s%s%s", "\\\\", ShrName, "\\PIPE\\test");
00236
00237                                        // Do CreateFile() to connect to the
00238                                        // named pipe.
00239        hPipe = CreateFile (fileName,              // Pipe name.
00240                            GENERIC_WRITE          // Generic access, read/write.
00241                            | GENERIC_READ,
00242                            FILE_SHARE_READ        // Share both read and write.
00243                            | FILE_SHARE_WRITE ,
00244                            NULL,                  // No security.
00245                            OPEN_EXISTING,         // Fail if not existing.
00246                            FILE_FLAG_OVERLAPPED,  // Use overlap.
00247                            NULL);                 // No template.
00248
00249                                        // Do some error checking.
00250        if ((DWORD)(DWORD_PTR)hPipe == 0xFFFFFFFF)
00251          {
00252          retCode = GetLastError();
00253
00254                                        // This error means pipe wasn't found.
00255          if ((retCode == ERROR_SEEK_ON_DEVICE) ||
00256              (retCode == ERROR_FILE_NOT_FOUND)) {
00257              LoadString(hInst, IDS_CANTFINDPIPE, lpBuffer, sizeof(lpBuffer));
00258              MessageBox (hDlg, lpBuffer, "", MB_OK);
00259          }
00260          else
00261            {                           // Flagging unknown errors.
00262              LoadString(hInst, IDS_GENERALERROR, lpBuffer, sizeof(lpBuffer));
00263              wsprintf (errorBuf, lpBuffer, retCode);
00264              LoadString(hInst, IDS_DEBUGTITLE, lpBuffer, sizeof(lpBuffer));
00265              MessageBox (hDlg, errorBuf, lpBuffer,
00266                        MB_ICONINFORMATION | MB_OK | MB_APPLMODAL);
00267            }
00268
00269          EndDialog (hDlg, 0);          // Kill app if pipe didn't connect.
00270          };
00271
00272                                        // Create and init overlapped structure
00273                                        // for writes.
00274        hEventWrt = CreateEvent (NULL, TRUE, FALSE, NULL);
00275        OverLapWrt.hEvent = hEventWrt;
00276
00277                                        // Write the client name to server.
00278        retCode = WriteFile (hPipe, ClntName, PLEASE_WRITE,
00279                             &bytesWritten, &OverLapWrt);
00280
00281        if (!retCode)                   // Wait on overlapped if need be.
00282          {
00283          lastError = GetLastError();
00284          if (lastError == ERROR_IO_PENDING)
00285            WaitForSingleObject (hEventWrt, (DWORD)-1);
00286          }
00287                                        // Create a thread to read the pipe.
00288        CreateThread (NULL,
00289                      0,
00290                      (LPTHREAD_START_ROUTINE)ReadPipe,
00291                      (LPVOID)&hPipe,
00292                      0,
00293                      &threadID);
00294        return (0);
00295
00296
00297
00298      case WM_INITDIALOG:
00299                                        // PostMessage() give time for the
00300                                        // dialog box to be created.
00301        PostMessage (hDlg, WM_INITCLIENT, 0, 0);
00302        return (0);
00303
00304
00305
00306      case WM_GO_AWAY:
00307        CloseHandle (hPipe);
00308        CloseHandle (hEventWrt);
00309        EndDialog (hDlg, TRUE);
00310        return TRUE;
00311
00312
00313
00314      case WM_SYSCOMMAND:
00315        if (wParam == SC_CLOSE)
00316          {
00317          CloseHandle (hPipe);
00318          CloseHandle (hEventWrt);
00319          EndDialog(hDlg, TRUE);
00320          return TRUE;
00321          }
00322        break;
00323      }
00324     return (FALSE);
00325
00326   }
00327
00328 /*************************************************************************\
00329 *
00330 *  PROCEDURE: ReadPipe (HANDLE *hRead)
00331 *
00332 *  PURPOSE:  This is a thread function which loops and reads the named pipe.
00333 *
00334 *  CALLED BY:
00335 *
00336 *    ClientDlgProc.
00337 *
00338 *
00339 \*************************************************************************/
00340
00341 VOID ReadPipe (HANDLE *hPipe)
00342   {
00343     CHAR       inBuf[IN_BUF_SIZE] = "";// Input buffer.
00344     DWORD      bytesRead;              // Used for ReadFile()
00345     DWORD      retCode;                // Used to trap return codes.
00346     CHAR       Buf[80];                // Message box buffer.
00347     DWORD      lastError;              // Used to trap returns from GetLastError.
00348
00349     HANDLE     hEventRd;               // Event handle for overlapped reads.
00350     OVERLAPPED OverLapRd;              // Overlapped structure.
00351     DWORD      bytesTrans;             // Bytes transferred in read.
00352
00353                                        // Create and init overlap structure.
00354     hEventRd = CreateEvent (NULL, TRUE, FALSE, NULL);
00355     memset (&OverLapRd, 0, sizeof(OVERLAPPED));
00356     OverLapRd.hEvent = hEventRd;
00357
00358     // Loop, reading the named pipe until it is broken.  The ReadFile() uses
00359     // an overlapped structure.  When the event handle signals a completed
00360     // read, this loop writes the message to the larger edit field.
00361
00362     do{
00363                                        // Read the pipe handle.
00364       retCode = ReadFile (*hPipe, inBuf, IN_BUF_SIZE, &bytesRead, &OverLapRd);
00365
00366       if (!retCode) {                  // Do some error checking.
00367
00368         lastError = GetLastError();
00369                                        // Check for 3 kinds of errors:
00370                                        // IO_PENDING, BROKEN_PIPE, or
00371                                        // other.
00372                                        // If Error = IO_PENDING, wait for
00373                                        // event handle to signal success.
00374         if (lastError == ERROR_IO_PENDING)
00375           {
00376           WaitForSingleObject (hEventRd, (DWORD)-1);
00377
00378           }
00379         else {                         // If pipe is broken, tell user and break.
00380
00381           if (lastError == (DWORD)ERROR_BROKEN_PIPE) {
00382             LoadString(hInst, IDS_CONNECTBROKEN, lpBuffer, sizeof(lpBuffer));
00383             MessageBox (hWndClient, lpBuffer, "", MB_OK);
00384           }
00385           else {                       // Or flag unknown errors, and break.
00386              LoadString(hInst, IDS_READFAILED, lpBuffer, sizeof(lpBuffer));
00387              wsprintf (Buf, lpBuffer, GetLastError());
00388              LoadString(hInst, IDS_CLIENTDBG, lpBuffer, sizeof(lpBuffer));
00389              MessageBox (hWndClient, Buf, lpBuffer, MB_OK);
00390           }
00391           break;
00392         }
00393       }
00394                                        // NULL terminate string.
00395       GetOverlappedResult (*hPipe, &OverLapRd, &bytesTrans, FALSE);
00396       inBuf[bytesTrans] = '\0';
00397
00398                                        // Write message to larger edit field.
00399       SendMessage (GetDlgItem (hWndClient, IDD_EDITREAD),
00400                    EM_REPLACESEL,
00401                    0, (LONG_PTR)inBuf);
00402                                        // Add a new line.
00403       SendMessage (GetDlgItem (hWndClient, IDD_EDITREAD),
00404                    EM_REPLACESEL,
00405                    0, (LONG_PTR)"\r\n");
00406       }while(1);
00407
00408                                        // When pipe is broken, send quit
00409                                        // messages to Client dialog box.
00410     PostMessage (hWndClient, WM_GO_AWAY, 0,0);
00411     ExitThread(0);
00412   }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/ADsLargeInteger.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

ADsLargeInteger.h

Go to the documentation of this file.
00001 #if !defined(AFX_ADSLARGEINTEGER_H__AAEF26E2_E0AA_11D2_BC85_00C04FD430AF__INCLUDED_)
00002 #define AFX_ADSLARGEINTEGER_H__AAEF26E2_E0AA_11D2_BC85_00C04FD430AF__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // ADsLargeInteger.h : header file
00008 //
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CDlgIADsLargeInteger dialog
00012
00013 class CDlgIADsLargeInteger : public CDialog
00014 {
00015 // Construction
00016 public:
00017   CDlgIADsLargeInteger(LPUNKNOWN, CWnd* pParent = NULL);   // standard constructor
00018   ~CDlgIADsLargeInteger();
00019
00020 // Dialog Data
00021   //{{AFX_DATA(CDlgIADsLargeInteger)
00022   enum { IDD = IDD_LARGEINTEGER };
00023   long  m_lHiPart;
00024   long  m_lLowPart;
00025   //}}AFX_DATA
00026
00027
00028 // Overrides
00029   // ClassWizard generated virtual function overrides
00030   //{{AFX_VIRTUAL(CDlgIADsLargeInteger)
00031   protected:
00032   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00033   //}}AFX_VIRTUAL
00034
00035 // Implementation
00036 protected:
00037   IADsLargeInteger *m_pLargeInt;
00038
00039   // Generated message map functions
00040   //{{AFX_MSG(CDlgIADsLargeInteger)
00041   virtual void OnOK();
00042   virtual BOOL OnInitDialog();
00043   //}}AFX_MSG
00044   DECLARE_MESSAGE_MAP()
00045 };
00046
00047 //{{AFX_INSERT_LOCATION}}
00048 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00049
00050 #endif // !defined(AFX_ADSLARGEINTEGER_H__AAEF26E2_E0AA_11D2_BC85_00C04FD430AF__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/basesnap.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

basesnap.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <olectl.h>
00021 #include <initguid.h>
00022 #include "guids.h"
00023 #include "basesnap.h"
00024 #include "Comp.h"
00025 #include "CompData.h"
00026 #include "About.h"
00027 #include "Registry.h"
00028
00029 // our globals
00030 HINSTANCE g_hinst;
00031
00032 BOOL WINAPI DllMain(HINSTANCE hinstDLL,
00033                     DWORD fdwReason,
00034                     void* lpvReserved)
00035 {
00036
00037     if (fdwReason == DLL_PROCESS_ATTACH) {
00038         g_hinst = hinstDLL;
00039     }
00040
00041     return TRUE;
00042 }
00043
00044
00045 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
00046 {
00047     if ((rclsid != CLSID_CComponentData) && (rclsid != CLSID_CSnapinAbout))
00048         return CLASS_E_CLASSNOTAVAILABLE;
00049
00050
00051     if (!ppvObj)
00052         return E_FAIL;
00053
00054     *ppvObj = NULL;
00055
00056     // We can only hand out IUnknown and IClassFactory pointers.  Fail
00057     // if they ask for anything else.
00058     if (!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00059         return E_NOINTERFACE;
00060
00061     CClassFactory *pFactory = NULL;
00062
00063     // make the factory passing in the creation function for the type of object they want
00064     if (rclsid == CLSID_CComponentData)
00065         pFactory = new CClassFactory(CClassFactory::COMPONENT);
00066     else if (rclsid == CLSID_CSnapinAbout)
00067         pFactory = new CClassFactory(CClassFactory::ABOUT);
00068
00069     if (NULL == pFactory)
00070         return E_OUTOFMEMORY;
00071
00072     HRESULT hr = pFactory->QueryInterface(riid, ppvObj);
00073
00074     return hr;
00075 }
00076
00077 STDAPI DllCanUnloadNow(void)
00078 {
00079     if (g_uObjects == 0 && g_uSrvLock == 0)
00080         return S_OK;
00081     else
00082         return S_FALSE;
00083 }
00084
00085
00086 CClassFactory::CClassFactory(FACTORY_TYPE factoryType)
00087 : m_cref(0), m_factoryType(factoryType)
00088 {
00089     OBJECT_CREATED
00090 }
00091
00092 CClassFactory::~CClassFactory()
00093 {
00094     OBJECT_DESTROYED
00095 }
00096
00097 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv)
00098 {
00099     if (!ppv)
00100         return E_FAIL;
00101
00102     *ppv = NULL;
00103
00104     if (IsEqualIID(riid, IID_IUnknown))
00105         *ppv = static_cast<IClassFactory *>(this);
00106     else
00107         if (IsEqualIID(riid, IID_IClassFactory))
00108             *ppv = static_cast<IClassFactory *>(this);
00109
00110         if (*ppv)
00111         {
00112             reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00113             return S_OK;
00114         }
00115
00116         return E_NOINTERFACE;
00117 }
00118
00119 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00120 {
00121     return InterlockedIncrement((LONG *)&m_cref);
00122 }
00123
00124 STDMETHODIMP_(ULONG) CClassFactory::Release()
00125 {
00126     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00127     {
00128         delete this;
00129         return 0;
00130     }
00131     return m_cref;
00132 }
00133
00134 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj)
00135 {
00136     HRESULT  hr;
00137     void* pObj;
00138
00139     if (!ppvObj)
00140         return E_FAIL;
00141
00142     *ppvObj = NULL;
00143
00144     // Our object does does not support aggregation, so we need to
00145     // fail if they ask us to do aggregation.
00146     if (pUnkOuter)
00147         return CLASS_E_NOAGGREGATION;
00148
00149     if (COMPONENT == m_factoryType) {
00150         pObj = new CComponentData();
00151     } else {
00152         pObj = new CSnapinAbout();
00153     }
00154
00155     if (!pObj)
00156         return E_OUTOFMEMORY;
00157
00158     // QueryInterface will do the AddRef() for us, so we do not
00159     // do it in this function
00160     hr = ((LPUNKNOWN)pObj)->QueryInterface(riid, ppvObj);
00161
00162     if (FAILED(hr))
00163         delete pObj;
00164
00165     return hr;
00166 }
00167
00168 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00169 {
00170     if (fLock)
00171         InterlockedIncrement((LONG *)&g_uSrvLock);
00172     else
00173         InterlockedDecrement((LONG *)&g_uSrvLock);
00174
00175     return S_OK;
00176 }
00177
00178 //////////////////////////////////////////////////////////
00179 //
00180 // Exported functions
00181 //
00182
00183
00184 //
00185 // Server registration
00186 //
00187 STDAPI DllRegisterServer()
00188 {
00189     HRESULT hr = SELFREG_E_CLASS;
00190     _TCHAR szName[256];
00191     _TCHAR szSnapInName[256];
00192
00193     LoadString(g_hinst, IDS_NAME, szName, (sizeof szName)/(sizeof szName[0]));
00194     LoadString(g_hinst, IDS_SNAPINNAME, szSnapInName, (sizeof szSnapInName)/(sizeof szSnapInName[0]));
00195
00196     _TCHAR szAboutName[256];
00197
00198     LoadString(g_hinst, IDS_ABOUTNAME, szAboutName, (sizeof szAboutName)/(sizeof szAboutName[0]));
00199
00200     // register our CoClasses
00201     hr = RegisterServer(g_hinst,
00202         CLSID_CComponentData,
00203         szName);
00204
00205     if SUCCEEDED(hr)
00206         hr = RegisterServer(g_hinst,
00207         CLSID_CSnapinAbout,
00208         szAboutName);
00209
00210     // place the registry information for SnapIns
00211     if SUCCEEDED(hr)
00212         hr = RegisterSnapin(CLSID_CComponentData, szSnapInName, CLSID_CSnapinAbout, FALSE);
00213
00214     return hr;
00215 }
00216
00217
00218 STDAPI DllUnregisterServer()
00219 {
00220     if (UnregisterServer(CLSID_CComponentData) == S_OK)
00221         return UnregisterSnapin(CLSID_CComponentData);
00222     else
00223         return E_FAIL;
00224 }
00225
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Rebar/Rebar.c Source File

  • WinUI
  • Controls
  • Common
  • Rebar

Rebar.c

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ReBar.c
00013
00014    Description:   ReBar sample implementation.
00015
00016 **************************************************************************/
00017
00018 #define STRICT
00019
00020 /**************************************************************************
00021    Include Files
00022 **************************************************************************/
00023
00024 #include <windows.h>
00025 #include <windowsx.h>
00026 #include <commctrl.h>
00027 #include "resource.h"
00028
00029 /**************************************************************************
00030    Local Function Prototypes
00031 **************************************************************************/
00032
00033 int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
00034 BOOL InitApplication(HINSTANCE);
00035 BOOL InitInstance(HINSTANCE, int);
00036 LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
00037 INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
00038 HWND BuildRebar(HWND);
00039 void MoveRebar(HWND);
00040 LRESULT HandleMenuPopup(HMENU);
00041 LRESULT HandleCommand(HWND, WPARAM, LPARAM);
00042
00043 /**************************************************************************
00044    Global Variables
00045 **************************************************************************/
00046
00047 #define ID_REBAR     1000
00048 #define ID_BUTTON    2000
00049 #define ID_COMBOBOX  2001
00050
00051 #define TOP    0x00
00052 #define LEFT   0x01
00053 #define BOTTOM 0x02
00054 #define RIGHT  0x03
00055
00056 HINSTANCE   g_hInst;
00057 WORD        g_wSide;
00058
00059 /******************************************************************************
00060
00061    WinMain
00062
00063    Parameters:
00064
00065    Description:
00066
00067    Returns:
00068
00069 ******************************************************************************/
00070
00071 int PASCAL WinMain(  HINSTANCE hInstance,
00072                      HINSTANCE hPrevInstance,
00073                      LPSTR lpCmdLine,
00074                      int nCmdShow)
00075 {
00076 MSG      msg;
00077 INITCOMMONCONTROLSEX iccex;
00078
00079 iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00080 iccex.dwICC = ICC_COOL_CLASSES;
00081 InitCommonControlsEx(&iccex);
00082
00083 if(!hPrevInstance)
00084    if(!InitApplication(hInstance))
00085       return FALSE;
00086
00087 if (!InitInstance(hInstance, nCmdShow))
00088    return FALSE;
00089
00090 while(GetMessage( &msg, NULL, 0x00, 0x00))
00091    {
00092    TranslateMessage(&msg);
00093    DispatchMessage(&msg);
00094    }
00095
00096 return (int)msg.wParam;
00097 }
00098
00099 /*****************************************************************************
00100
00101    InitApplication
00102
00103    Parameters:
00104
00105    Description:
00106
00107    Returns:
00108
00109 *****************************************************************************/
00110
00111 BOOL InitApplication(HINSTANCE hInstance)
00112 {
00113 WNDCLASS  wc;
00114
00115 wc.style          = 0;
00116 wc.lpfnWndProc    = (WNDPROC)MainWndProc;
00117 wc.cbClsExtra     = 0;
00118 wc.cbWndExtra     = 0;
00119 wc.hInstance      = hInstance;
00120 wc.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
00121 wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00122 wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
00123 wc.lpszMenuName   = MAKEINTRESOURCE(IDM_GENERICMENU);
00124 wc.lpszClassName  = TEXT("GenericClass");
00125
00126 return RegisterClass(&wc);
00127 }
00128
00129 /*****************************************************************************
00130
00131    InitInstance
00132
00133    Parameters:
00134
00135    Description:
00136
00137    Returns:
00138
00139 *****************************************************************************/
00140
00141 BOOL InitInstance(   HINSTANCE hInstance,
00142                      int nCmdShow)
00143 {
00144 HWND  hWnd;
00145
00146 g_hInst = hInstance;
00147
00148 hWnd = CreateWindowEx(  0,
00149                         TEXT("GenericClass"),
00150                         TEXT("Generic Application"),
00151                         WS_OVERLAPPEDWINDOW,
00152                         CW_USEDEFAULT,
00153                         CW_USEDEFAULT,
00154                         CW_USEDEFAULT,
00155                         CW_USEDEFAULT,
00156                         NULL,
00157                         NULL,
00158                         hInstance,
00159                         NULL);
00160
00161 if (!hWnd)
00162    return FALSE;
00163
00164 ShowWindow(hWnd, nCmdShow);
00165 UpdateWindow(hWnd);
00166
00167 return TRUE;
00168
00169 }
00170
00171 /*****************************************************************************
00172
00173    MainWndProc
00174
00175    Parameters:
00176
00177    Description:
00178
00179    Returns:
00180
00181 *****************************************************************************/
00182
00183 LRESULT CALLBACK MainWndProc( HWND hWnd,
00184                               UINT uMessage,
00185                               WPARAM wParam,
00186                               LPARAM lParam)
00187 {
00188 switch (uMessage)
00189    {
00190    case WM_CREATE:
00191       g_wSide = TOP;
00192
00193       BuildRebar(hWnd);
00194       break;
00195
00196    case WM_SIZE:
00197       MoveRebar(hWnd);
00198       break;
00199
00200    case WM_DESTROY:
00201       PostQuitMessage(0);
00202       break;
00203
00204    case WM_INITMENUPOPUP:
00205       return HandleMenuPopup((HMENU)wParam);
00206
00207    case WM_COMMAND:
00208       return HandleCommand(hWnd, wParam, lParam);
00209
00210    default:
00211       break;
00212    }
00213 return DefWindowProc(hWnd, uMessage, wParam, lParam);
00214 }
00215
00216 /*****************************************************************************
00217
00218    About
00219
00220    Parameters:
00221
00222    Description:
00223
00224    Returns:
00225
00226 *****************************************************************************/
00227
00228 INT_PTR CALLBACK About( HWND hDlg,
00229                         UINT uMessage,
00230                         WPARAM wParam,
00231                         LPARAM lParam)
00232 {
00233 switch (uMessage)
00234    {
00235    case WM_INITDIALOG:
00236       return TRUE;
00237
00238    case WM_COMMAND:
00239       switch(wParam)
00240          {
00241          case IDOK:
00242             EndDialog(hDlg, IDOK);
00243             return TRUE;
00244
00245          case IDCANCEL:
00246             EndDialog(hDlg, IDCANCEL);
00247             return TRUE;
00248          }
00249       break;
00250     }
00251
00252 return FALSE;
00253 }
00254
00255 /*****************************************************************************
00256
00257    BuildRebar
00258
00259 *****************************************************************************/
00260
00261 HWND BuildRebar(HWND hwndParent)
00262 {
00263 HWND     hwndRebar = NULL;
00264 LRESULT  lResult;
00265
00266 hwndRebar = CreateWindowEx(   WS_EX_TOOLWINDOW,
00267                               REBARCLASSNAME,
00268                               NULL,
00269                               WS_VISIBLE |
00270                                  WS_BORDER |
00271                                  WS_CHILD |
00272                                  WS_CLIPCHILDREN |
00273                                  WS_CLIPSIBLINGS |
00274                                  RBS_VARHEIGHT |
00275                                  RBS_BANDBORDERS |
00276                                  ((g_wSide & 0x01) ? CCS_VERT : 0) | //g_wSide is odd if this is a vertical bar
00277                                  ((g_wSide == BOTTOM) ? CCS_BOTTOM : 0) |
00278                                  ((g_wSide == RIGHT) ? CCS_RIGHT : 0) |
00279                                  0,
00280                               0,
00281                               0,
00282                               200,
00283                               100,
00284                               hwndParent,
00285                               (HMENU)ID_REBAR,
00286                               g_hInst,
00287                               NULL);
00288
00289 if(hwndRebar)
00290    {
00291    REBARINFO      rbi;
00292    HIMAGELIST     himlRebar;
00293    HICON          hIcon;
00294    REBARBANDINFO  rbbi;
00295    HWND           hwndChild;
00296    RECT           rc;
00297    TCHAR          szString[64];
00298
00299    //set up the ReBar
00300    himlRebar = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 1, 0);
00301    hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON1));
00302
00303    ImageList_AddIcon(himlRebar, hIcon);
00304
00305    rbi.cbSize  = sizeof(rbi);
00306    rbi.fMask   = RBIM_IMAGELIST;
00307    rbi.himl    = himlRebar;
00308    lResult = SendMessage(hwndRebar, RB_SETBARINFO, 0, (LPARAM)&rbi);
00309
00310    //add a band that contains a combobox
00311    hwndChild = CreateWindowEx(   0,
00312                                  TEXT("combobox"),
00313                                  NULL,
00314                                  WS_VISIBLE |
00315                                     WS_CHILD |
00316                                     WS_TABSTOP |
00317                                     WS_VSCROLL |
00318                                     WS_CLIPCHILDREN |
00319                                     WS_CLIPSIBLINGS |
00320                                     CBS_AUTOHSCROLL |
00321                                     CBS_DROPDOWN |
00322                                     0,
00323                                  0,
00324                                  0,
00325                                  100,
00326                                  200,
00327                                  hwndRebar,
00328                                  (HMENU)ID_COMBOBOX,
00329                                  g_hInst,
00330                                  NULL);
00331
00332    //add some stuff to the combobox
00333    {
00334    int   i;
00335
00336    SendMessage(hwndChild, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0));
00337
00338    for(i = 0; i < 25; i++)
00339       {
00340       wsprintf(szString, TEXT("Item %d"), i + 1);
00341       SendMessage(hwndChild, CB_ADDSTRING, 0, (LPARAM)szString);
00342       }
00343    }
00344
00345    GetWindowRect(hwndChild, &rc);
00346
00347    ZeroMemory(&rbbi, sizeof(rbbi));
00348    rbbi.cbSize       = sizeof(REBARBANDINFO);
00349    rbbi.fMask        = RBBIM_SIZE |
00350                         RBBIM_CHILD |
00351                         RBBIM_CHILDSIZE |
00352                         RBBIM_ID |
00353                         RBBIM_STYLE |
00354                         RBBIM_TEXT |
00355                         RBBIM_BACKGROUND |
00356                         RBBIM_IMAGE |
00357                         0;
00358
00359    rbbi.cxMinChild   = rc.right - rc.left;
00360    rbbi.cyMinChild   = rc.bottom - rc.top;
00361    rbbi.cx           = 100;
00362    rbbi.fStyle       = RBBS_CHILDEDGE |
00363                         RBBS_FIXEDBMP |
00364                         RBBS_GRIPPERALWAYS |
00365                         0;
00366    rbbi.wID          = ID_COMBOBOX;
00367    rbbi.hwndChild    = hwndChild;
00368    rbbi.lpText       = TEXT("ComboBox");
00369    rbbi.cch          = 2;
00370    rbbi.hbmBack      = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BACKGROUND));
00371    rbbi.iImage       = 0;
00372
00373    lResult = SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(LPREBARBANDINFO)&rbbi);
00374
00375    //add a band that contains a button
00376    hwndChild = CreateWindowEx(   0,
00377                                  TEXT("button"),
00378                                  TEXT("Button"),
00379                                  WS_CHILD |
00380                                     BS_PUSHBUTTON |
00381                                     0,
00382                                  0,
00383                                  0,
00384                                  100,
00385                                  50,
00386                                  hwndRebar,
00387                                  (HMENU)ID_BUTTON,
00388                                  g_hInst,
00389                                  NULL);
00390
00391    GetWindowRect(hwndChild, &rc);
00392
00393    ZeroMemory(&rbbi, sizeof(rbbi));
00394    rbbi.cbSize       = sizeof(REBARBANDINFO);
00395    rbbi.fMask        = RBBIM_SIZE |
00396                         RBBIM_CHILD |
00397                         RBBIM_CHILDSIZE |
00398                         RBBIM_ID |
00399                         RBBIM_STYLE |
00400                         RBBIM_TEXT |
00401                         RBBIM_BACKGROUND |
00402                         0;
00403    rbbi.cxMinChild   = rc.right - rc.left;
00404    rbbi.cyMinChild   = rc.bottom - rc.top;
00405    rbbi.cx           = 100;
00406    rbbi.fStyle       = RBBS_CHILDEDGE |
00407                         RBBS_FIXEDBMP |
00408                         RBBS_GRIPPERALWAYS |
00409                         0;
00410    rbbi.wID          = ID_BUTTON;
00411    rbbi.hwndChild    = hwndChild;
00412    rbbi.lpText       = TEXT("Button");
00413    rbbi.hbmBack      = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BACKGROUND));
00414
00415
00416    lResult = SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(LPREBARBANDINFO)&rbbi);
00417    }
00418
00419 return hwndRebar;
00420 }
00421
00422
00423 /**************************************************************************
00424
00425    MoveRebar()
00426
00427 **************************************************************************/
00428
00429 void MoveRebar(HWND hWnd)
00430 {
00431 RECT  rc,
00432       rcRebar;
00433 int   x,
00434       y,
00435       cx,
00436       cy;
00437
00438 GetClientRect(hWnd, &rc);
00439 GetWindowRect(GetDlgItem(hWnd, ID_REBAR), &rcRebar);
00440
00441 switch(g_wSide)
00442    {
00443    default:
00444    case TOP:
00445       //align the rebar along the top of the window
00446       x = 0;
00447       y = 0;
00448       cx = rc.right - rc.left;
00449       cy = rc.bottom - rc.top;
00450       break;
00451
00452    case LEFT:
00453       //align the rebar along the left side of the window
00454       x = 0;
00455       y = 0;
00456       cx = rcRebar.right - rcRebar.left;
00457       cy = rc.bottom - rc.top;
00458       break;
00459
00460    case BOTTOM:
00461       //align the rebar along the bottom of the window
00462       x = 0;
00463       y = rc.bottom - (rcRebar.bottom - rcRebar.top);
00464       cx = rc.right - rc.left;
00465       cy = rcRebar.bottom - rcRebar.top;
00466       break;
00467
00468    case RIGHT:
00469       //align the coolbar along the right side of the window
00470       x = rc.right - (rcRebar.right - rcRebar.left);
00471       y = 0;
00472       cx = rcRebar.right - rcRebar.left;
00473       cy = rc.bottom - rc.top;
00474       break;
00475    }
00476
00477 MoveWindow( GetDlgItem(hWnd, ID_REBAR),
00478             x,
00479             y,
00480             cx,
00481             cy,
00482             TRUE);
00483 }
00484
00485 /**************************************************************************
00486
00487    HandleMenuPopup()
00488
00489 **************************************************************************/
00490
00491 LRESULT HandleMenuPopup(HMENU hMenu)
00492 {
00493 UINT  uSelect;
00494
00495 switch(g_wSide)
00496    {
00497    default:
00498    case TOP:
00499       uSelect = IDM_TOP;
00500       break;
00501
00502    case LEFT:
00503       uSelect = IDM_LEFT;
00504       break;
00505
00506    case BOTTOM:
00507       uSelect = IDM_BOTTOM;
00508       break;
00509
00510    case RIGHT:
00511       uSelect = IDM_RIGHT;
00512       break;
00513    }
00514
00515 CheckMenuRadioItem(hMenu, IDM_TOP, IDM_BOTTOM, uSelect, MF_BYCOMMAND);
00516
00517 return 0;
00518 }
00519
00520 /**************************************************************************
00521
00522    HandleCommand()
00523
00524 **************************************************************************/
00525
00526 LRESULT HandleCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
00527 {
00528 switch(GET_WM_COMMAND_ID(wParam, lParam))
00529    {
00530    case ID_BUTTON:
00531       break;
00532
00533    case ID_COMBOBOX:
00534       break;
00535
00536    case IDM_TOP:
00537       if(g_wSide != TOP)
00538          {
00539          //destroy the existing Rebar
00540          DestroyWindow(GetDlgItem(hWnd, ID_REBAR));
00541
00542          //change to the new side
00543          g_wSide = TOP;
00544
00545          //create the new Rebar
00546          BuildRebar(hWnd);
00547
00548          }
00549       break;
00550
00551    case IDM_BOTTOM:
00552       if(g_wSide != BOTTOM)
00553          {
00554          //destroy the existing Rebar
00555          DestroyWindow(GetDlgItem(hWnd, ID_REBAR));
00556
00557          g_wSide = BOTTOM;
00558
00559          //create the new Rebar
00560          BuildRebar(hWnd);
00561
00562          }
00563       break;
00564
00565    case IDM_LEFT:
00566       if(g_wSide != LEFT)
00567          {
00568          //destroy the existing Rebar
00569          DestroyWindow(GetDlgItem(hWnd, ID_REBAR));
00570
00571          g_wSide = LEFT;
00572
00573          //create the new Rebar
00574          BuildRebar(hWnd);
00575
00576          }
00577       break;
00578
00579    case IDM_RIGHT:
00580       if(g_wSide != RIGHT)
00581          {
00582          //destroy the existing Rebar
00583          DestroyWindow(GetDlgItem(hWnd, ID_REBAR));
00584
00585          g_wSide = RIGHT;
00586
00587          //create the new Rebar
00588          BuildRebar(hWnd);
00589
00590          }
00591       break;
00592
00593    case IDM_EXIT:
00594       DestroyWindow(hWnd);
00595       break;
00596
00597    case IDM_ABOUT:
00598       DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
00599       break;
00600
00601    }
00602
00603 return TRUE;
00604 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AppUtil/AppUtil.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • AppUtil

AppUtil.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      APPUTIL.CPP
00003
00004   Summary:   Implementation file for the general application utility
00005              classes and functions offered by the APPUTIL library.
00006
00007              For a comprehensive tutorial code tour of APPUTIL's
00008              contents and offerings see the tutorial APPUTIL.HTM file.
00009              For more specific details see the comments dispersed
00010              throughout the APPUTIL source code.
00011
00012   Classes:   CVirWindow, CVirDialog, CAboutBox, CDelayBox, CMsgBox, CMsgLog,
00013              CSendLog, CThreaded.
00014
00015   Functions: WindowProc, DialogProc, SkipAnsi, FileExist, MakeFamilyPath,
00016              GetExeName, CmdExec, HrMsg, HrMsgId, ReadHelp, ReadTutorial,
00017              GoWeb, ReadSource, OutputDebugFmt, DComOk, lRandom, AnsiToUc,
00018              UcToAnsi, A_StringFromGUID2, A_WriteFmtUserTypeStg,
00019              A_StgIsStorageFile, A_StgCreateDocfile, A_StgOpenStorage,
00020              DelayBox, ErrorBox, CreateColorScalePalette, PaintWindow,
00021              GetErrorMsg.
00022
00023   Origin:    8-28-97: atrent - Revised (based on WINHLPRS by stevebl).
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 /*---------------------------------------------------------------------------
00041   We include WINDOWS.H for all Win32 applications.
00042   We include TCHAR.H for general Unicode/Ansi prototype of utility
00043     functions like _tsplitpath, etc.
00044   We include SHELLAPI.H for the shell execute functions used to read
00045     the tutorial HTM pages.
00046   We include APPUTIL.H for the defines of this APPUTIL library.  We use
00047     the _NOANSIMACROS_ to turn off the ANSI macro undefines so that
00048     function calls to certain COM APIs inside this module get to the
00049     original COM library functions instead of the ANSI surrogates.
00050   We include ASSERT.H for the assertion checking methods.
00051   We include ACLAPI.H for the security descriptor building functions.
00052 ---------------------------------------------------------------------------*/
00053 #include <windows.h>
00054 #include <tchar.h>
00055 #include <shellapi.h>
00056 #define _NOANSIMACROS_
00057 #include "apputil.h"
00058 #include <assert.h>
00059 #include <aclapi.h>
00060
00061
00062
00063 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00064   Function: AnsiToUc
00065
00066   Summary:  Convert an ANSI 'multibyte' string into a UNICODE 'wide
00067             character' string.
00068
00069   Args:     LPSTR pszAnsi
00070               Pointer to a caller's null terminated input ANSI string.
00071             LPWSTR pwszUc
00072               Pointer to a caller's output UNICODE wide string buffer.
00073             int cch
00074               Size of pwszUc in number of wide characters.  Must be greater
00075               than 0.
00076
00077   Returns:  HRESULT
00078               Standard result code. NOERROR for success.
00079 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00080 HRESULT AnsiToUc(
00081           LPSTR pszAnsi,
00082           LPWSTR pwszUc,
00083           int cch)
00084 {
00085   HRESULT hr = E_POINTER;
00086   int cOut;
00087
00088   assert(cch > 0);
00089
00090   if (NULL != pszAnsi && NULL != pwszUc)
00091   {
00092     cOut = MultiByteToWideChar(CP_ACP, 0, pszAnsi, -1, pwszUc, cch);
00093
00094     if (0 != cOut)
00095       hr = NOERROR;
00096     else
00097       hr = E_FAIL;
00098   }
00099
00100   return hr;
00101 }
00102
00103
00104 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00105   Function: UcToAnsi
00106
00107   Summary:  Convert a UNICODE 'wide character' input string to an output
00108             ANSI 'multi-byte' string.
00109
00110   Args:     LPWSTR pwszUc
00111               Pointer to a caller's input UNICODE wide string.
00112             LPSTR pszAnsi
00113               Pointer to a caller's output ANSI string.
00114             int cch
00115               Size of pszAnsi in number of characters.  Must be greater than
00116               0.
00117
00118   Returns:  HRESULT
00119               Standard result code. NOERROR for success.
00120 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00121 HRESULT UcToAnsi(
00122           LPWSTR pwszUc,
00123           LPSTR pszAnsi,
00124           int cch)
00125 {
00126   HRESULT hr = E_POINTER;
00127   int cOut;
00128
00129   assert(cch > 0);
00130
00131   if (NULL != pszAnsi && NULL != pwszUc)
00132   {
00133     cOut = WideCharToMultiByte(CP_ACP, 0, pwszUc, -1, pszAnsi, cch, NULL, NULL);
00134     if (0 != cOut)
00135       hr = NOERROR;
00136     else
00137       hr = E_FAIL;
00138   }
00139
00140   return hr;
00141 }
00142
00143
00144 #if !defined(UNICODE)
00145
00146
00147 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00148   Function: A_StringFromGUID2
00149
00150   Summary:  ANSI Surrogate for the Unicode API call.
00151 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00152 STDAPI A_StringFromGUID2(REFGUID guid, LPSTR pszGUID, int cch)
00153 {
00154   HRESULT hr = E_INVALIDARG;
00155   LPWSTR  pszUc;
00156   IMalloc* pIMalloc;
00157
00158   if (NULL != pszGUID && 0 < cch)
00159   {
00160     hr = CoGetMalloc(MEMCTX_TASK, &pIMalloc);
00161     if (SUCCEEDED(hr))
00162     {
00163       pszUc = (LPWSTR)pIMalloc->Alloc((cch+1)*sizeof(TCHAR));
00164       pIMalloc->Release();
00165       if (NULL != pszUc)
00166       {
00167         hr = StringFromGUID2(guid, pszUc, cch);
00168         if (SUCCEEDED(hr))
00169           hr = UcToAnsi(pszUc, pszGUID, cch);
00170         CoTaskMemFree((void *)pszUc);
00171       }
00172       else
00173         hr = E_OUTOFMEMORY;
00174     }
00175   }
00176
00177   return hr;
00178 }
00179
00180
00181 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00182   Function: A_WriteFmtUserTypeStg
00183
00184   Summary:  ANSI Surrogate for the Unicode API call.
00185 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00186 STDAPI A_WriteFmtUserTypeStg(
00187          IStorage* pIStorage,
00188          CLIPFORMAT ClipFmt,
00189          LPSTR pszUserType)
00190 {
00191   HRESULT hr = E_INVALIDARG;
00192   WCHAR wszUc[MAX_PATH];
00193
00194   if (NULL != pszUserType)
00195   {
00196     AnsiToUc(pszUserType, wszUc, MAX_PATH);
00197     hr = WriteFmtUserTypeStg(pIStorage, ClipFmt, wszUc);
00198   }
00199
00200   return hr;
00201 }
00202
00203
00204 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00205   Function: A_StgIsStorageFile
00206
00207   Summary:  ANSI Surrogate for the Unicode API call.
00208 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00209 STDAPI A_StgIsStorageFile(
00210          LPSTR pszFileName)
00211 {
00212   HRESULT hr = E_INVALIDARG;
00213   WCHAR wszUc[MAX_PATH];
00214
00215   if (NULL != pszFileName)
00216   {
00217     AnsiToUc(pszFileName, wszUc, MAX_PATH);
00218     hr = StgIsStorageFile(wszUc);
00219   }
00220
00221   return hr;
00222 }
00223
00224
00225 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00226   Function: A_StgCreateDocfile
00227
00228   Summary:  ANSI Surrogate for the Unicode API call.
00229 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00230 STDAPI A_StgCreateDocfile(
00231          LPSTR pszFileName,
00232          DWORD dwAccessMode,
00233          DWORD reserved,
00234          IStorage** ppIStorage)
00235 {
00236   HRESULT hr = E_INVALIDARG;
00237   WCHAR wszUc[MAX_PATH];
00238   LPWSTR pwszUc = NULL;
00239
00240   // Null the caller's output variable.
00241   *ppIStorage = NULL;
00242
00243   if (NULL != pszFileName)
00244   {
00245     AnsiToUc(pszFileName, wszUc, MAX_PATH);
00246     pwszUc = wszUc;
00247   }
00248
00249   hr = StgCreateDocfile(pwszUc, dwAccessMode, reserved, ppIStorage);
00250
00251   return hr;
00252 }
00253
00254
00255 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00256   Function: A_StgOpenStorage
00257
00258   Summary:  ANSI Surrogate for the Unicode API call.
00259 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00260 STDAPI A_StgOpenStorage(
00261          LPSTR pszFileName,
00262          IStorage* pIStorage,
00263          DWORD dwAccessMode,
00264          SNB snbExclude,
00265          DWORD reserved,
00266          IStorage** ppIStorage)
00267 {
00268   HRESULT hr = E_INVALIDARG;
00269   WCHAR wszUc[MAX_PATH];
00270   LPWSTR pwszUc = NULL;
00271
00272   // Null the caller's output variable.
00273   *ppIStorage = NULL;
00274
00275   if (NULL != pszFileName)
00276   {
00277     AnsiToUc(pszFileName, wszUc, MAX_PATH);
00278     pwszUc = wszUc;
00279   }
00280
00281   hr = StgOpenStorage(
00282          pwszUc,
00283          pIStorage,
00284          dwAccessMode,
00285          snbExclude,
00286          reserved,
00287          ppIStorage);
00288
00289   return hr;
00290 }
00291
00292
00293 #endif  // !UNICODE
00294
00295
00296 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00297   Function: DComOk
00298
00299   Summary:  Determine if DCOM (Distributed COM) can be used. It can if it
00300             is installed on the current machine. This will always succeed
00301             under WinNT 4.x or above. I will succeed on Win95 only if the
00302             DCOM95 addon is installed.
00303
00304   Args:     void
00305
00306   Returns:  BOOL
00307               TRUE - DCOM installed; FALSE - NOT.
00308 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00309 BOOL DComOk(void)
00310 {
00311   BOOL bOk = FALSE;
00312
00313   if (NULL != GetProcAddress(
00314                 GetModuleHandle(TEXT("OLE32")),
00315                 "CoInitializeEx"))
00316     bOk = TRUE;
00317
00318   return(bOk);
00319 }
00320
00321
00322 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00323   Function: lRandom
00324
00325   Summary:  Simple random number generator. Returns a random DWORD.
00326
00327   Args:     void
00328
00329   Returns:  DWORD
00330               Random number.
00331 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00332 DWORD lRandom(void)
00333 {
00334   static DWORD glSeed = (DWORD)-365387184;
00335
00336   glSeed *= 69069;
00337
00338   return(++glSeed);
00339 }
00340
00341
00342 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00343   Function: CreateColorScalePalette
00344
00345   Summary:  This function creates a palette representing the scale values
00346             of a particular RGB color.  A gray-scale palette can also be
00347             created. Borrowed from GDIDEMO in the Win32 samples of the
00348             Win32 SDK.
00349
00350   Args:     HDC hDC,
00351               Handle to device context.
00352             int nColor
00353               New color.
00354
00355   Returns:  HPALETTE
00356               Handle to new pallete.
00357 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00358 HPALETTE CreateColorScalePalette(
00359            HDC hDC,
00360            int nColor)
00361 {
00362   HPALETTE     hPalette;
00363   GLOBALHANDLE hMem;
00364   LPLOGPALETTE lpMem;
00365   int          idx,nReserved,nSize;
00366
00367   hPalette = NULL;
00368   if(GetDeviceCaps(hDC,RASTERCAPS) & RC_PALETTE)
00369   {
00370     nReserved = GetDeviceCaps(hDC,NUMRESERVED);
00371     nSize     = GetDeviceCaps(hDC,SIZEPALETTE) - nReserved;
00372
00373     hMem = GlobalAlloc(
00374              GHND,
00375              (DWORD)sizeof(LOGPALETTE)+(sizeof(PALETTEENTRY)*nSize));
00376     if(hMem)
00377     {
00378       if(lpMem = (LPLOGPALETTE)GlobalLock(hMem))
00379       {
00380         lpMem->palNumEntries = (WORD)nSize;
00381         lpMem->palVersion    = (WORD)0x0300;
00382         switch(nColor)
00383         {
00384           case COLOR_SCALE_RED:
00385             for(idx=0; idx < nSize; idx++)
00386             {
00387               lpMem->palPalEntry[idx].peRed   = (BYTE)idx;
00388               lpMem->palPalEntry[idx].peGreen = 0;
00389               lpMem->palPalEntry[idx].peBlue  = 0;
00390               lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00391             }
00392             break;
00393
00394           case COLOR_SCALE_GREEN:
00395             for(idx=0; idx < nSize; idx++)
00396             {
00397               lpMem->palPalEntry[idx].peRed   = 0;
00398               lpMem->palPalEntry[idx].peGreen = (BYTE)idx;
00399               lpMem->palPalEntry[idx].peBlue  = 0;
00400               lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00401             }
00402             break;
00403
00404           case COLOR_SCALE_BLUE:
00405             for(idx=0; idx < nSize; idx++)
00406             {
00407               lpMem->palPalEntry[idx].peRed   = 0;
00408               lpMem->palPalEntry[idx].peGreen = 0;
00409               lpMem->palPalEntry[idx].peBlue  = (BYTE)idx;
00410               lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00411             }
00412             break;
00413
00414           default:
00415           case COLOR_SCALE_GRAY:
00416             for(idx=0; idx < nSize; idx++)
00417             {
00418               lpMem->palPalEntry[idx].peRed   = (BYTE)idx;
00419               lpMem->palPalEntry[idx].peGreen = (BYTE)idx;
00420               lpMem->palPalEntry[idx].peBlue  = (BYTE)idx;
00421               lpMem->palPalEntry[idx].peFlags = PC_RESERVED;
00422             }
00423             break;
00424         }
00425
00426         hPalette = CreatePalette(lpMem);
00427
00428         GlobalUnlock(hMem);
00429       }
00430       GlobalFree(hMem);
00431     }
00432   }
00433
00434   return(hPalette);
00435 }
00436
00437
00438 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00439   Function: PaintWindow
00440
00441   Summary:  This function is used to paint the background of a window.
00442             Borrowed from GDIDEMO in the Win32 samples of the Win32 SDK.
00443
00444   Args:     HWND hWnd,
00445               Window handle.
00446             int nColor
00447               New window color.
00448
00449   Returns:  void.
00450 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00451 VOID PaintWindow(HWND hWnd, int nColor)
00452 {
00453   HDC         hDC;
00454   int         nMapMode,idx,nSize,nReserved,nLoop;
00455   RECT        rect;
00456   HBRUSH      hBrush;
00457   PAINTSTRUCT ps;
00458   HPALETTE    hPal;
00459
00460   if(hDC = BeginPaint(hWnd,&ps))
00461   {
00462     GetClientRect(hWnd,&rect);
00463     nMapMode = SetMapMode(hDC,MM_ANISOTROPIC);
00464
00465     if(GetDeviceCaps(hDC,RASTERCAPS) & RC_PALETTE)
00466     {
00467       nReserved = GetDeviceCaps(hDC,NUMRESERVED);
00468       nSize     = GetDeviceCaps(hDC,SIZEPALETTE) - nReserved;
00469
00470       if(hPal = CreateColorScalePalette(hDC,nColor))
00471       {
00472         hPal = SelectPalette(hDC,hPal,FALSE);
00473         RealizePalette(hDC);
00474
00475         SetWindowExtEx(hDC,nSize,nSize,NULL);
00476         SetViewportExtEx(hDC,rect.right,-rect.bottom,NULL);
00477         SetViewportOrgEx(hDC,0,rect.bottom,NULL);
00478
00479         nLoop = nSize >> 1;
00480         for(idx=0; idx < nLoop; idx++)
00481         {
00482           hBrush = CreateSolidBrush(PALETTEINDEX(idx+nLoop));
00483           SetRect(&rect,idx,idx,nSize-idx,nSize-idx);
00484           FillRect(hDC,&rect,hBrush);
00485           DeleteObject(hBrush);
00486         }
00487         DeleteObject(SelectPalette(hDC,hPal,FALSE));
00488         RealizePalette(hDC);
00489       }
00490     }
00491     else
00492     {
00493       SetWindowExtEx(hDC,512,512,NULL);
00494       SetViewportExtEx(hDC,rect.right,-rect.bottom,NULL);
00495       SetViewportOrgEx(hDC,0,rect.bottom,NULL);
00496
00497       for(idx=0; idx < 256; idx++)
00498       {
00499         hBrush = CreateSolidBrush(RGB(0,0,idx));
00500         SetRect(&rect,idx,idx,512-idx,512-idx);
00501         FillRect(hDC,&rect,hBrush);
00502         DeleteObject(hBrush);
00503       }
00504     }
00505
00506     SetMapMode(hDC,nMapMode);
00507
00508     EndPaint(hWnd,&ps);
00509   }
00510
00511   return;
00512 }
00513
00514
00515 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00516   Function: SkipAnsi
00517
00518   Summary:  Utility function to scan an input ANSI string and either skips
00519             white characters or skips non-white characters.
00520
00521   Args;     LPSTR psz,
00522               Input ANSI string to be scanned.
00523             BOOL bSkip)
00524               Input boolean determining whether to skip white space
00525               or not.  TRUE means skip white space; FALSE means skip
00526               non-white chars.
00527
00528   Returns:  LPSTR
00529               String pointer after the skip.
00530 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00531 LPSTR SkipAnsi(
00532          LPSTR psz,
00533          BOOL bSkipWhite)
00534 {
00535   char ch;
00536   BOOL bWhite;
00537
00538   while (ch = *psz)
00539   {
00540     bWhite = ('\n'==ch || '\r'==ch || '\t'==ch || ' '==ch);
00541
00542     if ((bSkipWhite && !bWhite) || (!bSkipWhite && bWhite))
00543       break;
00544
00545     psz++;
00546   }
00547
00548   return psz;
00549 }
00550
00551
00552 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00553   Function: FileExist
00554
00555   Summary:  Function to test for the existance of a file.
00556
00557   Args:     TCHAR* pszFileName
00558               String pointer to file's path/name.
00559
00560   Returns:  BOOL.  TRUE if file exists; FALSE if not.
00561 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00562 BOOL FileExist(TCHAR* pszFileName)
00563 {
00564   BOOL bExist = FALSE;
00565   HANDLE hFile;
00566
00567   if (NULL != pszFileName)
00568   {
00569     // Use the preferred Win32 API call and not the older OpenFile.
00570     hFile = CreateFile(
00571               pszFileName,
00572               GENERIC_READ,
00573               FILE_SHARE_READ | FILE_SHARE_WRITE,
00574               NULL,
00575               OPEN_EXISTING,
00576               0,
00577               0);
00578
00579     if (hFile != INVALID_HANDLE_VALUE)
00580     {
00581       // If the handle is valid then the file exists.
00582       CloseHandle(hFile);
00583       bExist = TRUE;
00584     }
00585   }
00586
00587   return (bExist);
00588 }
00589
00590
00591 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00592   Function: MakeFamilyPath
00593
00594   Summary:  Function to make a family file/path/name string using the
00595             detetected pathname of the current executable module.
00596             Makes paths like d:\dir1\dir2\mymodule.hlp,
00597             d:\dir1\dir2\mymodule.lic, etc.
00598
00599   Args:     HINSTANCE hInst
00600               Handle to the module intstance.
00601             TCHAR* pszNewPath
00602               String pointer to the new path/name.
00603             TCHAR* pszFileExt
00604               String pointer to the filename extension for the new path.
00605
00606   Returns:  BOOL.  TRUE if success; FALSE if not.
00607 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00608 BOOL MakeFamilyPath(
00609        HINSTANCE hInst,
00610        TCHAR* pszNewPath,
00611        TCHAR* pszFileExt)
00612 {
00613   BOOL bOk = FALSE;
00614   TCHAR  szPath[MAX_PATH];
00615   TCHAR  szDrive[64];
00616   TCHAR  szDir[MAX_PATH];
00617   TCHAR  szName[64];
00618
00619   if (NULL != pszNewPath)
00620   {
00621     pszNewPath[0] = 0;
00622
00623     bOk = (0 != GetModuleFileName(hInst, szPath, MAX_PATH));
00624     if (bOk)
00625     {
00626       _tsplitpath(szPath, szDrive, szDir, szName, NULL);
00627       lstrcpyn(pszNewPath, szDrive, MAX_PATH);
00628       lstrncat(pszNewPath, szDir, MAX_PATH - lstrlen(pszNewPath));
00629       lstrncat(pszNewPath, szName, MAX_PATH - lstrlen(pszNewPath));
00630       lstrncat(pszNewPath, pszFileExt, MAX_PATH - lstrlen(pszNewPath));
00631     }
00632   }
00633
00634   return bOk;
00635 }
00636
00637
00638 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00639   Function: GetExeName
00640
00641   Summary:  Function to get the executable file name of the current
00642             module. Makes names like: MyApp.EXE or MyDll.DLL.
00643
00644   Args:     HINSTANCE hInst
00645               Handle to the module intstance.
00646             TCHAR* pszExeName
00647               String pointer to the new executable file name.
00648               A char string allocated by user.
00649
00650   Returns:  BOOL.  TRUE if success; FALSE if not.
00651 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00652 BOOL GetExeName(
00653        HINSTANCE hInst,
00654        TCHAR* pszExeName)
00655 {
00656   BOOL bOk = FALSE;
00657   TCHAR  szPath[MAX_PATH];
00658   TCHAR  szName[64];
00659   TCHAR  szFileExt[64];
00660
00661   if (NULL != pszExeName)
00662   {
00663     pszExeName[0] = 0;
00664
00665     bOk = (0 != GetModuleFileName(hInst, szPath, MAX_PATH));
00666     if (bOk)
00667     {
00668       _tsplitpath(szPath, NULL, NULL, szName, szFileExt);
00669       lstrcpyn(pszExeName, szName, MAX_PATH);
00670       lstrncat(pszExeName, szFileExt, MAX_PATH - lstrlen(pszExeName));
00671     }
00672   }
00673
00674   return bOk;
00675 }
00676
00677
00678 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00679   Function: CmdExec
00680
00681   Summary:  Execute an EXE Win32 program by creating a process and
00682             running the specified EXE in it.
00683
00684   Args:     LPTSTR szCmd,
00685               Entire command line (eg, "notepad.exe mytext.txt")
00686
00687   Returns:  BOOL
00688               TRUE if succeed; FALSE if fail.
00689 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00690 BOOL CmdExec(
00691        LPTSTR szCmd)
00692 {
00693   BOOL bOk;
00694   STARTUPINFO si;
00695   PROCESS_INFORMATION pi;
00696
00697   // Execute the command with a call to the CreateProcess API call.
00698   memset(&si,0,sizeof(STARTUPINFO));
00699   si.cb = sizeof(STARTUPINFO);
00700   si.wShowWindow = SW_SHOW;
00701   bOk = CreateProcess(NULL,szCmd,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
00702   CloseHandle(pi.hThread);
00703   CloseHandle(pi.hProcess);
00704
00705   return bOk;
00706 }
00707
00708
00709 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00710   Function: GetErrorMsg
00711
00712   Summary:  Accepts a Win32 error code and retrieves a human readable
00713             system message for it.
00714
00715   Args:     HRESULT hr
00716               SCODE error code.
00717             LPTSTR pszMsg
00718               Pointer string where message will be placed.
00719             UINT uiSize
00720               Max size of the msg string.
00721
00722   Returns:  BOOL
00723               TRUE if hr was error; FALSE if not.
00724 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00725 BOOL GetErrorMsg(
00726        HRESULT hr,
00727        LPTSTR pszMsg,
00728        UINT uiSize)
00729 {
00730   BOOL bErr = FAILED(hr);
00731   DWORD dwSize;
00732
00733   if (bErr)
00734   {
00735     memset(pszMsg, 0, uiSize * sizeof(TCHAR));
00736
00737     dwSize = FormatMessage(
00738       FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
00739       NULL,
00740       hr,
00741       MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
00742       pszMsg,
00743       uiSize,
00744       NULL);
00745     if (dwSize>2)
00746     {
00747       // Take out the trailing CRLF.
00748       pszMsg[--dwSize] = 0;
00749       pszMsg[--dwSize] = 0;
00750     }
00751   }
00752
00753   return bErr;
00754 }
00755
00756
00757 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00758   Function: HrMsg
00759
00760   Summary:  HRESULT Error Message box. Takes standard result code,
00761             looks it up in the system tables, and shows a message
00762             box with the error code (in hex) and the associated
00763             system message.
00764
00765   Args:     HWND hWndOwner,
00766               Handle to owner parent window.
00767             LPTSTR pszTitle
00768               User message string (eg, designating the attempted function).
00769               Appears in dialog title bar.
00770             HRESULT hr,
00771               Standard result code.
00772
00773   Returns:  void
00774 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00775 void HrMsg(
00776        HWND hWndOwner,
00777        LPTSTR pszTitle,
00778        HRESULT hr)
00779 {
00780   TCHAR szMsg[MAX_PATH];
00781   TCHAR szErrMsg[MAX_PATH];
00782   int iResult;
00783
00784   wsprintf(szMsg, TEXT("Error=0x%X:\r\n"), hr);
00785   GetErrorMsg(hr, szErrMsg, MAX_PATH);
00786   lstrncat(szMsg, szErrMsg, MAX_PATH - lstrlen(szMsg));
00787   iResult = MessageBox(
00788               hWndOwner,
00789               szMsg,
00790               pszTitle,
00791               MB_OK | MB_ICONEXCLAMATION);
00792
00793   return;
00794 }
00795
00796
00797 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00798   Function: HrMsgId
00799
00800   Summary:  HRESULT Error Message box using string resource ID. Takes
00801             standard result code, looks it up in the system tables, and
00802             shows a message box with the error code (in hex) and the
00803             associated system message. An additional user message string
00804             (specified as a resource ID) is also shown.
00805
00806   Args:     HINSTANCE hInst,
00807               Handle of the module instance.  Needed to specify the
00808               module instance for fetching the specified string resource.
00809             HWND hwndOwner,
00810               Handle of the owner window. NULL for desktop.
00811             INT iStringID
00812               Resource ID of user error message string. Appears in dialog
00813               title bar.
00814             HRESULT hr,
00815               Standard result code.
00816
00817   Returns:  void
00818 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00819 void HrMsgId(
00820       HINSTANCE hInst,
00821       HWND hWndOwner,
00822       INT iStringID,
00823       HRESULT hr)
00824 {
00825   TCHAR szMsg[MAX_STRING_LENGTH];
00826
00827   // Load the error message string from the resources.
00828   if (LoadString(
00829         hInst,
00830         iStringID,
00831         szMsg,
00832         MAX_STRING_LENGTH))
00833   {
00834     // Put up error message box with the retrieved error string message.
00835     HrMsg(hWndOwner, szMsg, hr);
00836   }
00837
00838   return;
00839 }
00840
00841
00842 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00843   Function: ReadHelp
00844
00845   Summary:  The ReadHelp function is a general help reader for
00846             applications. It uses the shell to run the reader application
00847             associated with the extension of the specified file/path.
00848             For example, if the family-named file name is MYAPP.HTM, then
00849             the web browser will be used to read the HTML help file.
00850
00851   Args:     HWND hWndOwner,
00852               Handle to owner parent window.
00853             LPTSTR pszHelpFile,
00854               Pointer to the help file/path name string.
00855
00856   Returns:  void
00857 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00858 void ReadHelp(
00859        HWND hWndOwner,
00860        LPTSTR pszHelpFile)
00861 {
00862   INT_PTR iRes;
00863
00864   if (NULL != pszHelpFile)
00865   {
00866     // First check if the .HTM help file is there at all.
00867     if (FileExist(pszHelpFile))
00868     {
00869       // Use shell to invoke web browser on the HTML help file.
00870       iRes = (INT_PTR) ShellExecute(
00871                      hWndOwner,
00872                      TEXT("open"),
00873                      pszHelpFile,
00874                      NULL,
00875                      NULL,
00876                      SW_SHOWNORMAL);
00877       if (iRes <= 32)
00878       {
00879         // If unable to browse then put up an error box.
00880         HrMsg(hWndOwner, TEXT(NOBROWSE_ERROR_STR), E_FAIL);
00881       }
00882     }
00883     else
00884     {
00885       // If the .HTM file doesn't exist the put up an error box.
00886       iRes = MessageBox(
00887                hWndOwner,
00888                TEXT(NOHTM_ERROR_STR),
00889                TEXT(ERROR_TITLE_STR),
00890                MB_OK | MB_ICONEXCLAMATION);
00891     }
00892   }
00893
00894   return;
00895 }
00896
00897
00898 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00899   Function: ReadTutorial
00900
00901   Summary:  The ReadTutorial function is for use by tutorial code sample
00902             applications that study themselves. This function uses the
00903             Win32 ShellExecute function to launch the web browser to read
00904             an HTML web page that contains a tutorial covering the sample.
00905             If no HTM file (in a sibling or parent directory) is
00906             specified, this function assumes a family-named <sample>.HTM
00907             tutorial HTML file that is located next to the main .EXE file
00908             of the application calling ReadTutorial. "Family-named" means
00909             that if the EXE program calling this function is MYAPP.EXE
00910             then the associated family-named HTML file is constructed as
00911             MYAPP.HTM.
00912
00913   Args:     HINSTANCE hInst,
00914               Handle of the executable module instance.
00915             HWND hWndOwner,
00916               Handle to owner parent window.
00917             LPTSTR pszHTMLFile,
00918               Pointer to an optional HTML FileName string. If this pointer
00919               is NULL, then the family-named file is assumed for the HTML
00920               file and is assumed to be located next to the main .EXE file
00921               of the program executing this function. Non-NULL values are
00922               of the form "MySiblingDirectory\MyHTMLFile.HTM" or of the
00923               form "MyHTMLFileInTheParentDirectory.HTM". Special non-NULL
00924               values beginning with '.' (eg. ".HTM" or ".ASP") specify
00925               that the family-named file is assumed to be located in the
00926               parent directory. In this case, the specified file extension
00927               is used.
00928
00929   Returns:  void
00930 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00931 void ReadTutorial(
00932        HINSTANCE hInst,
00933        HWND hWndOwner,
00934        LPTSTR pszHTMLFile)
00935 {
00936   TCHAR szFileName[MAX_PATH];
00937
00938   szFileName[0] = 0;
00939
00940   if (NULL == pszHTMLFile)
00941   {
00942     // Build a path to where the .HTM file should be. It should be in
00943     // the same directory as the .EXE but with the .HTM extension.
00944     MakeFamilyPath(hInst, szFileName, TEXT(HTML_FILE_EXT));
00945   }
00946   else
00947   {
00948     // Use the HTML file specified in a sibling directory.
00949     BOOL bOk = FALSE;
00950     TCHAR  szPath[MAX_PATH];
00951     TCHAR  szDrive[64];
00952     TCHAR  szDir[MAX_PATH];
00953     TCHAR  szName[64];
00954     LPTSTR psz;
00955     LONG   len;
00956
00957     bOk = (0 != GetModuleFileName(hInst, szPath, MAX_PATH));
00958     if (bOk)
00959     {
00960       _tsplitpath(szPath, szDrive, szDir, szName, NULL);
00961       len = lstrlen(szDir);
00962       if (len > 1)
00963       {
00964         // Scan backwards in the Dir path to obtain the path to the
00965         // parent directory.
00966         psz = &szDir[0] + len - 1;
00967         while (psz > &szDir[0])
00968         {
00969           psz--;
00970           if (*psz == '\\' || *psz == '/')
00971           {
00972             psz++;
00973             *psz = 0;
00974             break;
00975           }
00976         }
00977         // Now build the complete Path & FileName using the Specified
00978         // HTML file name.
00979         lstrcpyn(szFileName, szDrive, MAX_PATH);
00980         lstrncat(szFileName, szDir, MAX_PATH - lstrlen(szFileName));
00981         if ('.' == *pszHTMLFile)
00982           lstrncat(szFileName, szName, MAX_PATH - lstrlen(szFileName));
00983         lstrncat(szFileName, pszHTMLFile, MAX_PATH - lstrlen(szFileName));
00984       }
00985     }
00986   }
00987
00988   // Now Browse/Read the HTM file.
00989   ReadHelp(hWndOwner, szFileName);
00990
00991   return;
00992 }
00993
00994
00995 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00996   Function: GoWeb
00997
00998   Summary:  General utility function to launch a web browser on a
00999             specified HTML file via either a URL or a full file path/name.
01000
01001   Args:     HINSTANCE hInst,
01002               Handle of the executable module instance.
01003             LPSTR pszTarget
01004               Pointer to the Target specification string (must be ANSI).
01005               If null then call the ReadTutorial function. If pszTarget
01006               starts with '//' then the target is assumed to be a www URL
01007               trailer of the form: //www.microsoft.com. If any other
01008               string, then it is assumed to be a full path/file name.
01009
01010   Returns:  void
01011 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01012 void GoWeb(
01013        HINSTANCE hInst,
01014        LPSTR pszTarget)
01015 {
01016   INT_PTR iRes;
01017   BOOL bOk = FALSE;
01018   LPTSTR pszNew;
01019   TCHAR  szNew[MAX_PATH];
01020   TCHAR  szWork[MAX_PATH];
01021
01022   szNew[0] = 0;
01023   pszNew = (LPTSTR) &szNew[0];
01024
01025 #if defined(UNICODE)
01026   AnsiToUc(pszTarget, pszNew, MAX_PATH);
01027 #else
01028   lstrcpyn(pszNew, pszTarget, MAX_PATH);
01029 #endif
01030
01031   if (NULL == pszTarget)
01032     ReadTutorial(hInst, NULL, NULL);
01033   else if ('/' == *pszNew)
01034   {
01035     lstrcpyn(szWork, TEXT("http:"), MAX_PATH);
01036     lstrncat(szWork, pszNew, MAX_PATH - lstrlen(szWork));
01037     pszNew = szWork;
01038     bOk = TRUE;
01039   }
01040   else
01041   {
01042     // First check if the .HTM file is there at all.
01043     bOk = FileExist(pszNew);
01044     if (!bOk)
01045     {
01046       // If the .HTM file doesn't exist the put up an error box.
01047       iRes = MessageBox(
01048                NULL,
01049                TEXT(NOHTM_ERROR_STR),
01050                TEXT(ERROR_TITLE_STR),
01051                MB_OK | MB_ICONEXCLAMATION);
01052     }
01053   }
01054
01055   if (bOk)
01056   {
01057     // Use shell to invoke web browser on the readme HTML file.
01058     iRes = (INT_PTR) ShellExecute(NULL, NULL, pszNew, NULL, NULL, 0);
01059     if (iRes <= 32)
01060     {
01061       // If unable to browse then put up an error box.
01062       HrMsg(NULL, TEXT(NOBROWSE_ERROR_STR), E_FAIL);
01063     }
01064   }
01065
01066   return;
01067 }
01068
01069
01070 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01071   Function: ReadSource
01072
01073   Summary:  For use by code sample applications that study themselves
01074             as it were.  This function allows you to select one of the
01075             source files of this code sample and launch a reader to
01076             edit/read it.  NOTEPAD.EXE is the default editor/reader.
01077             You can change this by changing EDITOR_FILE_STR in APPUTIL.H.
01078
01079   Args:     HWND hWndOwner
01080               Handle of parent window.
01081             OPENFILENAME* pofn,
01082               Pointer to the Open File Name Common Dialog structure.
01083
01084   Returns:  void
01085 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01086 void ReadSource(
01087        HWND hWndOwner,
01088        OPENFILENAME* pOfn)
01089 {
01090   TCHAR szReadCmd[MAX_PATH+12];
01091   TCHAR szFileName[MAX_PATH];
01092   BOOL bOk;
01093   int iResult;
01094
01095   // We'll use the OpenFileName Common Dialog (defined in main app).
01096   // Set the dialog's file filter and title.
01097   szFileName[0] = 0;
01098   pOfn->lpstrFilter = TEXT(OFN_SOURCEFILES_STR);
01099   pOfn->lpstrTitle = TEXT(OFN_SOURCETITLE_STR);
01100   pOfn->lpstrFile = szFileName;
01101
01102   // Call up the dialog to get a file name from the user.
01103   if (GetOpenFileName(pOfn))
01104   {
01105     // If the user provided a file name then assemble a command string
01106     lstrcpyn(szReadCmd, TEXT(EDITOR_EXE_STR), MAX_PATH+12);
01107     lstrncat(szReadCmd, szFileName, MAX_PATH+12 - lstrlen(szReadCmd));
01108     // And execute it.
01109     bOk = CmdExec(szReadCmd);
01110     if (!bOk)
01111     {
01112       // If create procees failed then put up an error box.
01113       iResult = MessageBox(
01114                   hWndOwner,
01115                   TEXT(NOEDITOR_ERROR_STR),
01116                   TEXT(ERROR_TITLE_STR),
01117                   MB_OK | MB_ICONEXCLAMATION);
01118     }
01119   }
01120
01121   return;
01122 }
01123
01124
01125 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01126   Function: OutputDebugFmt
01127
01128   Summary:  Wraps the Win32 OutputDebugString API call to provide
01129             printf-style formatted (and variable argument) output.
01130
01131   Args:     LPTSTR pszFmt,
01132               Format string.
01133             [...]
01134               Arguments to match those specified in the format string.
01135
01136   Returns:  void
01137 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01138 void OutputDebugFmt(
01139        LPTSTR pszFmt,
01140        ...)
01141 {
01142   va_list arglist;
01143   va_start(arglist, pszFmt);
01144   TCHAR szMsg[MAX_STRING_LENGTH];
01145
01146   // Use the format string and arguments to format the content text.
01147   wvsprintf(szMsg, pszFmt, arglist);
01148   // Output the newly formated message string to the debugger display.
01149   OutputDebugString(szMsg);
01150
01151   return;
01152 }
01153
01154
01155 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01156   Function: WindowProc
01157
01158   Summary:  Standard WindowProc callback function that forwards Windows
01159             messages on to the CVirWindow::WindowProc method.  This
01160             Window procedure expects that it will receive a "this"
01161             pointer as the lpCreateParams member passed as part of the
01162             WM_NCCREATE message.  It saves the "this" pointer in the
01163             GWL_USERDATA field of the window structure.
01164
01165   Args:     HWND hWnd,
01166               Window handle.
01167             UINT uMsg,
01168               Windows message.
01169             WPARAM wParam,
01170               First message parameter (word sized).
01171             LPARAM lParam);
01172               Second message parameter (long sized).
01173
01174   Returns:  LRESULT.  Windows window procedure callback return value.
01175 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01176 LRESULT CALLBACK WindowProc(
01177                    HWND hWnd,
01178                    UINT uMsg,
01179                    WPARAM wParam,
01180                    LPARAM lParam)
01181 {
01182   // Get a pointer to the window class object.
01183   CVirWindow* pWin = (CVirWindow*) GetWindowLongPtr(hWnd, GWLP_USERDATA);
01184
01185   switch (uMsg)
01186   {
01187     case WM_NCCREATE:
01188       // Since this is the first time that we can get ahold of
01189       // a pointer to the window class object, all messages that might
01190       // have been sent before this are never seen by the Windows object
01191       // and only get passed on to the DefWindowProc
01192
01193       // Get the initial creation pointer to the window object
01194       pWin = (CVirWindow *) ((CREATESTRUCT *)lParam)->lpCreateParams;
01195
01196       // Set it's protected m_hWnd member variable to ensure that
01197       // member functions have access to the correct window handle.
01198       pWin->m_hWnd = hWnd;
01199
01200       // Set its USERDATA DWORD to point to the window object
01201       SetWindowLongPtr(hWnd, GWLP_USERDATA, (INT_PTR) pWin);
01202       break;
01203
01204     case WM_DESTROY:
01205       // This is our signal to destroy the window object.
01206       SetWindowLongPtr(hWnd, GWLP_USERDATA, 0);
01207       DELETE_POINTER(pWin);
01208       break;
01209
01210     default:
01211       break;
01212   }
01213
01214   // Call its message proc method.
01215   if (NULL != pWin)
01216     return (pWin->WindowProc(uMsg, wParam, lParam));
01217   else
01218     return (DefWindowProc(hWnd, uMsg, wParam, lParam));
01219 }
01220
01221
01222 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01223   Method:   CVirWindow::Create
01224
01225   Summary:  Envelopes the Windows' CreateWindow call.  Uses its
01226             window-creation data pointer to pass the 'this' pointer.
01227
01228   Args:     LPTSTR lpszClassName,
01229               Address of registered class name.
01230             LPTSTR lpszWindowName,
01231               Address of window name/title.
01232             DWORD dwStyle,
01233               Window style.
01234             int x,
01235               Horizontal position of window.
01236             int y,
01237               Vertical position of window.
01238             int nWidth,
01239               Window width.
01240             int nHeight,
01241               Window height.
01242             HWND hwndParent,
01243               Handle of parent or owner window.
01244             HMENU hmenu,
01245               Handle of menu, or child window identifier.
01246             HINSTANCE hinst)
01247               Handle of application instance.
01248
01249   Modifies: m_hWnd, m_hInst.
01250
01251   Returns:  HWND (Window handle) of the created window.
01252 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01253 HWND CVirWindow::Create(
01254        LPTSTR lpszClassName,
01255        LPTSTR lpszWindowName,
01256        DWORD dwStyle,
01257        int x,
01258        int y,
01259        int nWidth,
01260        int nHeight,
01261        HWND hWndParent,
01262        HMENU hMenu,
01263        HINSTANCE hInst)
01264 {
01265   // Remember the passed instance handle in a member variable of the
01266   // C++ Window object.
01267   m_hInst = hInst;
01268
01269   // Call the Win32 API to create the window.
01270   m_hWnd = ::CreateWindow(
01271                lpszClassName,
01272                lpszWindowName,
01273                dwStyle,
01274                x,
01275                y,
01276                nWidth,
01277                nHeight,
01278                hWndParent,
01279                hMenu,
01280                hInst,
01281                this);
01282
01283   return (m_hWnd);
01284 }
01285
01286
01287 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01288   Function: DialogProc
01289
01290   Summary:  The general dialog procedure callback function.  Used by all
01291             CVirDialog class objects.  This procedure is the DialogProc
01292             registered for all dialogs created with the CVirDialog class.
01293             It uses the parameter passed with the WM_INITDIALOG message
01294             to identify the dialog classes' "this" pointer which it then
01295             stores in the window structure's GWL_USERDATA field.
01296             All subsequent messages can then be forwarded on to the
01297             correct dialog class's DialogProc method by using the pointer
01298             stored in the GWL_USERDATA field.
01299
01300   Args:     HWND hWndDlg,
01301               Handle of dialog box.
01302             UINT uMsg,
01303               Message.
01304             WPARAM wParam,
01305               First message parameter (word sized).
01306             LPARAM lParam);
01307               Second message parameter (long sized).
01308
01309   Returns:  BOOL.  Return of the CVirDialog::DialogProc method.
01310 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01311 BOOL CALLBACK DialogProc(
01312                 HWND hWndDlg,
01313                 UINT uMsg,
01314                 WPARAM wParam,
01315                 LPARAM lParam)
01316 {
01317   // Get a pointer to the window class object.
01318   CVirDialog* pdlg = (CVirDialog*) GetWindowLongPtr(hWndDlg, GWLP_USERDATA);
01319
01320   switch (uMsg)
01321   {
01322     case WM_INITDIALOG:
01323       // Get a pointer to the window class object.
01324       pdlg = (CVirDialog*) lParam;
01325
01326       // Assign the m_hWnd member variable.
01327       pdlg->m_hWnd = hWndDlg;
01328
01329       // Set the USERDATA word to point to the class object.
01330       SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (INT_PTR) pdlg);
01331       break;
01332
01333     default:
01334       break;
01335   }
01336
01337   // Call its message proc method.
01338   if (pdlg != (CVirDialog *) 0)
01339     return (pdlg->DialogProc(hWndDlg, uMsg, wParam, lParam));
01340   else
01341     return (FALSE);
01342 }
01343
01344
01345 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01346   Method:   CVirDialog::ShowDialog
01347
01348   Summary:  Creates the dialog so that it's DialogProc member function can
01349             be invoked.  The dialog box object exists until deleted by the
01350             caller.  It can be shown any number of times.  This function is
01351             analgous to Windows' DialogBox function.  The main difference
01352             being that you don't specify a DialogProc; you override the
01353             pure virtal function CVirDialog::DialogProc.
01354
01355   Args:     HINSTANCE hInst,
01356               Handle of the module instance.  Needed to specify the
01357               module instance for fetching the dialog template resource
01358               (ie, from either a host EXE or DLL).
01359             LPTSTR lpszTemplate,
01360               Identifies the dialog box template.
01361             HWND hwndOwner)
01362               Handle of the owner window.
01363
01364   Modifies: m_hInst.
01365
01366   Returns:  Return value from the DialogBoxParam Windows API function.
01367 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01368 int CVirDialog::ShowDialog(
01369       HINSTANCE hInst,
01370       LPTSTR lpszTemplate,
01371       HWND hWndOwner)
01372 {
01373   int iResult;
01374
01375   // Assign the module instance handle in the Dialog object.
01376   m_hInst = hInst;
01377
01378   // Create and show the dialog on screen.  Load the dialog resource
01379   // from the specified module instance (could be a module other than
01380   // that of the EXE that is running--the resources could be in a DLL
01381   // that is calling this ShowDialog).  Pass the 'this' pointer to the
01382   // dialog object so that it can be assigned inside the dialog object
01383   // during WM_INITDIALOG and later available to the dailog procedure
01384   // via the GWL_USERDATA associated with the dialog window.
01385   iResult = (int)::DialogBoxParam(
01386                 hInst,
01387                 lpszTemplate,
01388                 hWndOwner,
01389                 (DLGPROC)::DialogProc,
01390                 (INT_PTR)this);
01391
01392   return (iResult);
01393 }
01394
01395
01396 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01397   Method:   CAboutBox::DialogProc
01398
01399   Summary:  Dialog proc for the About dialog box.  This DialogProc
01400             method definition overrides the same-named pure virtual
01401             function in abstract base class CVirDialog thus giving
01402             AboutBox-unique message dispatching behavior to this
01403             derivation of CVirDialog.  The remaining behavior of
01404             CAboutBox is inherited from CVirDialog and is common to
01405             all CVirDialogs.
01406
01407   Args:     HWND hWndDlg,
01408               Handle to the dialog.
01409             UINT uMsg,
01410               Windows message to dialog.
01411             WPARAM wParam,
01412               First message parameter (word sized).
01413             LPARAM lParam)
01414               Second message parameter (long sized).
01415
01416   Modifies: .
01417
01418   Returns:  BOOL.  TRUE if message was handled; FALSE otherwise.
01419 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01420 BOOL CAboutBox::DialogProc(
01421        HWND hWndDlg,
01422        UINT uMsg,
01423        WPARAM wParam,
01424        LPARAM lParam)
01425 {
01426   BOOL bResult = TRUE;
01427
01428   switch (uMsg)
01429   {
01430     case WM_INITDIALOG:
01431       SetFocus(GetDlgItem(hWndDlg,IDOK));
01432       break;
01433
01434     case WM_COMMAND:
01435       if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
01436         ::EndDialog(hWndDlg, TRUE);
01437       break;
01438
01439     case WM_PAINT:
01440       // Wash the background of the aboutbox to give it a nice
01441       // blue-scaling effect.  Invalidate the OK button to force it to the
01442       // top.  This seems to be necessary since the OK button gets
01443       // overwritten during the washing.
01444       PaintWindow(hWndDlg,COLOR_SCALE_BLUE);
01445       InvalidateRect(GetDlgItem(hWndDlg,IDOK),NULL,TRUE);
01446       break;
01447
01448     default:
01449       bResult = FALSE;
01450       break;
01451   }
01452
01453   return(bResult);
01454 }
01455
01456
01457 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01458   Method:   CDelayBox::DialogProc
01459
01460   Summary:  Dialog proc for the Delay dialog box.  This DialogProc method
01461             definition overrides the same-named pure virtual function in
01462             abstract base class CVirDialog thus giving DelayBox-unique
01463             message dispatching behavior to this derivation of CVirDialog.
01464             The remaining behavior of CDelayBox is inherited from
01465             CVirDialog and is common to all CVirDialogs.
01466
01467   Args:     HWND hWndDlg,
01468               Handle to the dialog.
01469             UINT uMsg,
01470               Windows message to dialog.
01471             WPARAM wParam,
01472               First message parameter (word sized).
01473             LPARAM lParam)
01474               Second message parameter (long sized).
01475
01476   Modifies: .
01477
01478   Returns:  BOOL.  TRUE if message was handled; FALSE otherwise.
01479 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01480 BOOL CDelayBox::DialogProc(
01481        HWND hWndDlg,
01482        UINT uMsg,
01483        WPARAM wParam,
01484        LPARAM lParam)
01485 {
01486   BOOL  bResult = TRUE;
01487   DWORD nEndCount;
01488   TCHAR szPath[MAX_PATH];
01489   TCHAR szName[64];
01490
01491   switch (uMsg)
01492   {
01493     case WM_INITDIALOG:
01494       break;
01495
01496     case WM_PAINT:
01497       // Get a title based on this module's name.
01498       if (0 != GetModuleFileName(m_hInst, szPath, MAX_PATH))
01499       {
01500         _tsplitpath(szPath, NULL, NULL, szName, NULL);
01501         SetWindowText(hWndDlg, szName);
01502       }
01503       // Wash the background of the dialog to give it a nice
01504       // blue-scaling effect.
01505       PaintWindow(hWndDlg, COLOR_SCALE_BLUE);
01506       PostMessage(hWndDlg, WM_COMMAND, 0, 0);
01507       break;
01508
01509     case WM_COMMAND:
01510       nEndCount = GetTickCount() + DELAYBOX_DURATION;
01511       while (GetTickCount() < nEndCount)
01512       { }
01513       ::EndDialog(hWndDlg, TRUE);
01514       break;
01515
01516     default:
01517       bResult = FALSE;
01518       break;
01519   }
01520
01521   return(bResult);
01522 }
01523
01524
01525 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01526   Function: DelayBox
01527
01528   Summary:  Uses the specified dialog template from the caller's resources
01529             and shows a buttonless dialog message box that remains on
01530             screen for about 5 seconds.
01531
01532   Args:     HINSTANCE hInst,
01533               Handle of the module instance.  Needed to specify the
01534               module instance for fetching the dialog template resource
01535               (ie, from either a host EXE or DLL).
01536             LPTSTR pszTemplate,
01537               Identifies the dialog box template.
01538             HWND hwndOwner)
01539               Handle of the owner window. NULL for desktop.
01540
01541   Returns:  void
01542 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01543 void DelayBox(
01544       HINSTANCE hInst,
01545       LPTSTR pszTemplate,
01546       HWND hWndOwner)
01547 {
01548   CDelayBox dlgBox;
01549
01550   // Show a time-delayed message box.
01551   dlgBox.ShowDialog(hInst, pszTemplate, hWndOwner);
01552
01553   return;
01554 }
01555
01556
01557 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01558   Function: ErrorBox
01559
01560   Summary:  The ErrorBox function displays an error message dialog box. It
01561             displays an error message string in the dialog that is
01562             specified in the call by a resource ID.
01563
01564   Args:     HINSTANCE hInst,
01565               Handle of the module instance.  Needed to specify the
01566               module instance for fetching the specified string resource.
01567             HWND hwndOwner,
01568               Handle of the owner window. NULL for desktop.
01569             INT iStringID
01570               Resource ID of the error message sting.
01571
01572   Returns:  void
01573 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01574 void ErrorBox(
01575       HINSTANCE hInst,
01576       HWND hWndOwner,
01577       INT iStringID)
01578 {
01579   TCHAR szMsg[MAX_STRING_LENGTH];
01580
01581   // Load the error message string from the resources.
01582   if (LoadString(
01583         hInst,
01584         iStringID,
01585         szMsg,
01586         MAX_STRING_LENGTH))
01587   {
01588     // Put up error message box with the retrieved error string message.
01589     MessageBox(
01590       hWndOwner,
01591       szMsg,
01592       TEXT(ERROR_TITLE_STR),
01593       MB_OK | MB_ICONEXCLAMATION);
01594   }
01595
01596   return;
01597 }
01598
01599
01600 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01601   Method:   CMsgBox::Init
01602
01603   Summary:  CMsgBox constructor.  Initializes private member data handles
01604             for both the eventual Parent window of any MsgBox and the
01605             application instance.
01606
01607   Args:     HINSTANCE hInst,
01608               Handle of app instance.
01609             HWND hWndParent)
01610               Handle of parent window.
01611
01612   Returns:  BOOL
01613               TRUE.
01614 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01615 BOOL CMsgBox::Init(
01616       HINSTANCE hInst,
01617       HWND hWndOwner)
01618 {
01619   m_hInst = hInst;
01620   m_hWndOwner = hWndOwner;
01621
01622   return (TRUE);
01623 }
01624
01625
01626 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01627   Method:   CMsgBox::Error
01628
01629   Summary:  Shows a specified message string in an Error MessageBox Dialog.
01630
01631   Args:     LPTSTR szMsg
01632               The message string to display.
01633
01634   Returns:  int
01635               Result of the MessageBox call.
01636 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01637 int CMsgBox::Error(
01638       LPTSTR szMsg)
01639 {
01640   int iResult;
01641
01642   iResult = MessageBox(
01643               m_hWndOwner,
01644               szMsg,
01645               TEXT(ERROR_TITLE_STR),
01646               MB_OK | MB_ICONEXCLAMATION);
01647
01648   return (iResult);
01649 }
01650
01651
01652 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01653   Method:   CMsgBox::ErrorID
01654
01655   Summary:  Shows a resource ID specified message string in an Error
01656             MessageBox Dialog.
01657
01658   Args:     UINT uMsgID
01659               The resource ID of the message string to display.
01660
01661   Returns:  int
01662               Result of the MessageBox call.
01663 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01664 int CMsgBox::ErrorID(
01665       UINT uMsgID)
01666 {
01667   int iResult = FALSE;
01668   TCHAR szMsg[MAX_STRING_LENGTH];
01669
01670   if (LoadString(m_hInst, uMsgID, szMsg, MAX_STRING_LENGTH))
01671   {
01672     iResult = MessageBox(
01673                 m_hWndOwner,
01674                 szMsg,
01675                 TEXT(ERROR_TITLE_STR),
01676                 MB_OK | MB_ICONEXCLAMATION);
01677   }
01678
01679   return (iResult);
01680 }
01681
01682
01683 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01684   Method:   CMsgBox::Note
01685
01686   Summary:  Shows a specified message string in a Notice MessageBox Dialog.
01687
01688   Args:     LPTSTR szMsg
01689               The message string to display.
01690
01691   Returns:  int
01692               Result of the MessageBox call.
01693 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01694 int CMsgBox::Note(
01695       LPTSTR szMsg)
01696 {
01697   int iResult;
01698
01699   iResult = MessageBox(
01700               m_hWndOwner,
01701               szMsg,
01702               TEXT(NOTICE_TITLE_STR),
01703               MB_OK | MB_ICONINFORMATION);
01704
01705   return (iResult);
01706 }
01707
01708
01709 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01710   Method:   CMsgBox::NoteID
01711
01712   Summary:  Shows a resource ID specified message string in a Notice
01713             MessageBox Dialog.
01714
01715   Args:     UINT uMsgID
01716               The resource ID of the message string to display.
01717
01718   Returns:  int
01719               Result of the MessageBox call.
01720 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01721 int CMsgBox::NoteID(
01722       UINT uMsgID)
01723 {
01724   int iResult = FALSE;
01725   TCHAR szMsg[MAX_STRING_LENGTH];
01726
01727   if (LoadString(m_hInst, uMsgID, szMsg, MAX_STRING_LENGTH))
01728   {
01729     iResult = MessageBox(
01730                 m_hWndOwner,
01731                 szMsg,
01732                 TEXT(NOTICE_TITLE_STR),
01733                 MB_OK | MB_ICONINFORMATION);
01734   }
01735
01736   return (iResult);
01737 }
01738
01739
01740 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01741   Method:   CMsgBox::NoteFmt
01742
01743   Summary:  Shows a printf-style formatted message string in a Notice
01744             MessageBox Dialog.
01745
01746   Args:     LPTSTR szFmtMsg
01747               The format/message string to display.
01748             [...]
01749               Arguments to match those specified in the format string.
01750
01751   Returns:  int
01752               Result of the MessageBox call.
01753 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01754 int CMsgBox::NoteFmt(
01755       LPTSTR szFmtMsg
01756            ...)
01757 {
01758   int iResult = 0;
01759   va_list arglist;
01760   va_start(arglist, szFmtMsg);
01761   TCHAR szMsg[MAX_STRING_LENGTH];
01762
01763   // Use the format string to format the messagebox's content text.
01764   wvsprintf(szMsg, szFmtMsg, arglist);
01765   iResult = MessageBox(
01766               m_hWndOwner,
01767               szMsg,
01768               TEXT(NOTICE_TITLE_STR),
01769               MB_OK | MB_ICONINFORMATION);
01770
01771   return (iResult);
01772 }
01773
01774
01775 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01776   Method:   CMsgBox::NoteFmtID
01777
01778   Summary:  Shows a resource ID specified printf-style formatted message
01779             string in a Notice MessageBox Dialog.
01780
01781   Args:     UINT uFmtMsgID
01782               The resource ID of the format message string to display.
01783             [...]
01784               Arguments to match those specified in the format string.
01785
01786   Returns:  int
01787               Result of the MessageBox call.
01788 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01789 int CMsgBox::NoteFmtID(
01790       UINT uFmtMsgID,
01791       ...)
01792 {
01793   int iResult = 0;
01794   va_list arglist;
01795   va_start(arglist, uFmtMsgID);
01796   TCHAR szFmtMsg[MAX_STRING_LENGTH];
01797   TCHAR szMsg[MAX_STRING_LENGTH];
01798
01799   if (LoadString(m_hInst, uFmtMsgID, szFmtMsg, MAX_STRING_LENGTH))
01800   {
01801     // Use the format string to format the messagebox's content text.
01802     wvsprintf(szMsg, szFmtMsg, arglist);
01803     iResult = MessageBox(
01804                 m_hWndOwner,
01805                 szMsg,
01806                 TEXT(NOTICE_TITLE_STR),
01807                 MB_OK | MB_ICONINFORMATION);
01808   }
01809
01810   return (iResult);
01811 }
01812
01813
01814 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01815   Method:   CMsgLog::Create
01816
01817   Summary:  Creates the ListBox as a child window to fill the client area
01818             of the specified parent window or to exist as a separate
01819             window owned by the parent window.
01820
01821   Args:     HINSTANCE hInst,
01822               Instance handle of the application.
01823             HWND hWndparent,
01824               Window handle for the parent window of the listbox.
01825             BOOL bChild)
01826               Flag to create the listbox as a child window.  TRUE means fit
01827               the child window to fill the client area of the parent window.
01828               FALSE means the window is a separate (but owned) window.
01829
01830   Returns:  BOOL
01831               TRUE if successful; FALSE if not.
01832 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01833 BOOL CMsgLog::Create(
01834        HINSTANCE hInst,
01835        HWND hWndParent,
01836        BOOL bChild)
01837 {
01838   BOOL bResult = FALSE;
01839   HWND hWnd;
01840   RECT rect;
01841   DWORD dwStyle = WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | LBS_NOSEL |
01842                     LBS_NOINTEGRALHEIGHT;
01843   TCHAR* pszTitle = bChild ? NULL : TEXT("Trace Log");
01844
01845   dwStyle |= bChild ? WS_CHILD : WS_OVERLAPPEDWINDOW;
01846
01847   // Logging will be flagged as on when creation is successful.
01848   m_bLogging = FALSE;
01849
01850   if (IsWindow(hWndParent))
01851   {
01852     GetClientRect(hWndParent, &rect);
01853
01854     // Create the child ListBox window and fill the parent window with it.
01855     hWnd = ::CreateWindowEx(
01856                0,                // Extended Window Style
01857                TEXT("LISTBOX"),  // Class Name
01858                pszTitle,         // Window Title
01859                dwStyle,          // The window style
01860                0,                // (x,y)=Upper left of Parent window
01861                0,
01862                rect.right,       // Width; Fill Client Window
01863                rect.bottom,      // Height
01864                hWndParent,       // Parent Window Handle
01865                0,                // No menu
01866                hInst,            // App Instance Handle
01867                NULL);            // Window Creation Data
01868
01869     if (NULL != hWnd)
01870     {
01871       // Remember the window handle of this listbox window.
01872       m_hWndLog = hWnd;
01873       // Remember the instance of this application.
01874       m_hInstLog = hInst;
01875       // Remember if this is a child window (bChild==TRUE).
01876       m_bChild = bChild;
01877       // Turn on message logging by default after create.
01878       m_bLogging = TRUE;
01879       // Return success.
01880       bResult = TRUE;
01881     }
01882   }
01883
01884   return (bResult);
01885 }
01886
01887
01888 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01889   Method:   CMsgLog::Logging
01890
01891   Summary:  Turns logging of or off.
01892
01893   Args:     BOOL bLogging
01894               TRUE to turn on; FALSE to turn off.
01895
01896   Returns:  BOOL
01897               New logging status.
01898 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01899 BOOL CMsgLog::Logging(
01900        BOOL bLogging)
01901 {
01902   BOOL bResult = bLogging;
01903
01904   m_bLogging = bLogging;
01905
01906   return (bResult);
01907 }
01908
01909
01910 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01911   Method:   CMsgLog::Msg
01912
01913   Summary:  Logs a message string as a separate line in the listbox.
01914
01915   Args:     LPTSTR szMsg
01916               Pointer to String of the message to display/log.
01917
01918   Returns:  BOOL
01919               TRUE if successful; FALSE if not.
01920 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01921 BOOL CMsgLog::Msg(
01922        LPTSTR szMsg)
01923 {
01924   BOOL bResult = FALSE;
01925   int iIndex;
01926
01927   if (m_bLogging && IsWindow(m_hWndLog))
01928   {
01929     ::SendMessage(
01930         m_hWndLog,
01931         LB_ADDSTRING,
01932         0,
01933         (LPARAM)szMsg);
01934     iIndex = (int)::SendMessage(
01935                  m_hWndLog,
01936                  LB_GETCOUNT,
01937                  0,
01938                  0);
01939     if (LB_ERR != iIndex && iIndex > 0)
01940     {
01941       --iIndex;
01942       ::SendMessage(
01943           m_hWndLog,
01944           LB_SETCURSEL,
01945           (WPARAM)iIndex,
01946           0);
01947     }
01948     bResult = TRUE;
01949   }
01950
01951 #if defined(DEBUG)
01952   ::OutputDebugString(szMsg);
01953 #endif
01954
01955   return (bResult);
01956 }
01957
01958
01959 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01960   Method:   CMsgLog::MsgFmt
01961
01962   Summary:  Logs a printf-style formated message as a separate line in the
01963             Message log listbox.
01964
01965   Args:     LPTSTR szFmtMsg
01966               The format/message string to display/log.
01967             [...]
01968               Arguments to match those specified in the format string.
01969
01970   Returns:  BOOL
01971               TRUE if successful; FALSE if not.
01972 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01973 BOOL CMsgLog::MsgFmt(
01974        LPTSTR szFmtMsg,
01975        ...)
01976 {
01977   BOOL bResult = FALSE;
01978   va_list arglist;
01979   va_start(arglist, szFmtMsg);
01980   TCHAR szMsg[MAX_STRING_LENGTH];
01981   int iIndex;
01982
01983   // Use the format string and arguments to format the content text.
01984   wvsprintf(szMsg, szFmtMsg, arglist);
01985
01986   // Send the newly formated message string to the Log Listbox.
01987   if (m_bLogging && IsWindow(m_hWndLog))
01988   {
01989     ::SendMessage(
01990         m_hWndLog,
01991         LB_ADDSTRING,
01992         0,
01993         (LPARAM)szMsg);
01994     iIndex = (int)::SendMessage(
01995                  m_hWndLog,
01996                  LB_GETCOUNT,
01997                  0,
01998                  0);
01999     if (LB_ERR != iIndex && iIndex > 0)
02000     {
02001       --iIndex;
02002       ::SendMessage(
02003           m_hWndLog,
02004           LB_SETCURSEL,
02005           (WPARAM)iIndex,
02006           0);
02007     }
02008     bResult = TRUE;
02009   }
02010
02011 #if defined(DEBUG)
02012   ::OutputDebugString(szMsg);
02013 #endif
02014
02015   return (bResult);
02016 }
02017
02018
02019 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02020   Method:   CMsgLog::MsgID
02021
02022   Summary:  Logs a message string as a separate line in the listbox.
02023
02024   Args:     int iMsgID
02025               String Resource ID for the message to display/log.
02026
02027   Returns:  BOOL
02028               TRUE if successful; FALSE if not.
02029 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02030 BOOL CMsgLog::MsgID(
02031        int iMsgID)
02032 {
02033   BOOL bResult = FALSE;
02034   TCHAR szMsg[MAX_STRING_LENGTH];
02035
02036   if (LoadString(m_hInstLog, iMsgID, szMsg, MAX_STRING_LENGTH))
02037     bResult = Msg(szMsg);
02038
02039   return (bResult);
02040 }
02041
02042
02043 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02044   Method:   CMsgLog::MsgFmtID
02045
02046   Summary:  Logs a printf-style formated message as a separate line in the
02047             Message log listbox.
02048
02049   Args:     int iFmtID
02050               The resource ID for the format/message string to display/log.
02051             [...]
02052               Arguments to match those specified in the format string.
02053
02054   Returns:  BOOL
02055               TRUE if successful; FALSE if not.
02056 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02057 BOOL CMsgLog::MsgFmtID(
02058        int iFmtID,
02059        ...)
02060 {
02061   BOOL bResult = FALSE;
02062   va_list arglist;
02063   va_start(arglist, iFmtID);
02064   TCHAR szFormat[MAX_STRING_LENGTH];
02065   TCHAR szMsg[MAX_STRING_LENGTH];
02066
02067   // Load the format string from the app's string resources.
02068   if (LoadString(m_hInstLog, iFmtID, szFormat, MAX_STRING_LENGTH))
02069   {
02070     // Use the format string and arguments to format the content text.
02071     wvsprintf(szMsg, szFormat, arglist);
02072
02073     // Send the newly formated message string to the Log Listbox.
02074     bResult = Msg(szMsg);
02075   }
02076
02077   return (bResult);
02078 }
02079
02080
02081 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02082   Method:   CMsgLog::Resize
02083
02084   Summary:  Resizes the listbox to a new width and height.  Called during
02085             the parent window's WM_SIZE to fit the listbox to the client
02086             area of the parent window.  It only honors this request if it
02087             is an integral child window.
02088
02089   Args:     int nWidth
02090               New width in pixels of the listbox.
02091             int nHeight
02092               New height in pixels of the listbox.
02093
02094   Returns:  BOOL
02095               TRUE if successful; FALSE if not.
02096 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02097 BOOL CMsgLog::Resize(
02098        int nWidth,
02099        int nHeight)
02100 {
02101   BOOL bResult = FALSE;
02102
02103   if (m_bChild)
02104     bResult = ::MoveWindow(m_hWndLog, 0, 0, nWidth, nHeight, TRUE);
02105
02106   return (bResult);
02107 }
02108
02109
02110 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02111   Method:   CMsgLog::Clear
02112
02113   Summary:  Clears all logged messages from the message log listbox.
02114
02115   Args:     void
02116
02117   Returns:  BOOL
02118               TRUE.
02119 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02120 BOOL CMsgLog::Clear(
02121        void)
02122 {
02123   if (IsWindow(m_hWndLog))
02124     ::SendMessage(
02125         m_hWndLog,
02126         LB_RESETCONTENT,
02127         0,
02128         0);
02129
02130   return (TRUE);
02131 }
02132
02133
02134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02135   Method:   CMsgLog::Copy
02136
02137   Summary:  Copies the current content of the trace message log to the
02138             Windows clipboard.
02139
02140   Args:     void
02141
02142   Returns:  BOOL
02143               TRUE if success; FALSE if failure.
02144 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02145 BOOL CMsgLog::Copy(void)
02146 {
02147   BOOL bResult = FALSE;
02148   DWORD iIndex;
02149   DWORD cbLen;
02150   HANDLE hClip;
02151   LPTSTR pLogData;
02152   TCHAR szLine[MAX_STRING_LENGTH];
02153   DWORD cItems = 0;
02154
02155   if (IsWindow(m_hWndLog))
02156     cItems = (DWORD) ::SendMessage(m_hWndLog,LB_GETCOUNT,0,0);
02157
02158   if (LB_ERR != cItems
02159       && 0 < cItems
02160       && MAX_LOG_LINES > cItems
02161       && OpenClipboard(m_hWndLog))
02162   {
02163     if (EmptyClipboard())
02164     {
02165       m_hLogData = GlobalAlloc(GHND, cItems * MAX_STRING_LENGTH);
02166       if (m_hLogData)
02167       {
02168         // Lock the global memory while we write to it.
02169         pLogData = (LPTSTR) GlobalLock(m_hLogData);
02170         // Loop thru the log text lines and concat them to one big string.
02171         for (iIndex = 0; iIndex < cItems; iIndex++)
02172         {
02173           // Get each log text line.
02174           cbLen = (DWORD)::SendMessage(
02175                       m_hWndLog,
02176                       LB_GETTEXT,
02177                       (WPARAM)iIndex,
02178                       (LPARAM) (LPSTR)szLine);
02179           if (LB_ERR != cbLen && (MAX_STRING_LENGTH-3) > cbLen)
02180           {
02181             // Put CRLF at end.
02182             szLine[cbLen]   = '\r';
02183             szLine[cbLen+1] = '\n';
02184             szLine[cbLen+2] = '\0';
02185             if (0 == iIndex)
02186               lstrcpyn((LPTSTR)pLogData, szLine, (cItems * MAX_STRING_LENGTH)
02187                 /sizeof(TCHAR));
02188             else
02189               lstrncat((LPTSTR)pLogData, szLine, (cItems * MAX_STRING_LENGTH)
02190                 /sizeof(TCHAR) - lstrlen(pLogData));
02191           }
02192         }
02193         // We're done with writing so unlock the memory block.
02194         GlobalUnlock(m_hLogData);
02195         // If there were any lines at all then copy them to clipboard.
02196         if (0 < iIndex)
02197           hClip = SetClipboardData(CF_TEXT, m_hLogData);
02198         if (!hClip)
02199         {
02200           // If we couldn't clip the data then free the global handle.
02201           GlobalFree(m_hLogData);
02202           m_hLogData = 0;
02203         }
02204         // We're done with the clipboard so close it.
02205         bResult = CloseClipboard();
02206       }
02207     }
02208   }
02209
02210   return (bResult);
02211 }
02212
02213
02214 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02215   Method:   CSendLog::CreateServerLog
02216
02217   Summary:  Creates the ListBox as a child window to fill the client area
02218             of the specified local server's parent window.
02219
02220   Args:     HINSTANCE hInst,
02221               Instance handle of the application.
02222             HWND hWndparent,
02223               Window handle for the parent window of the listbox.
02224             BOOL bChild)
02225               Flag to create the listbox as a child window.  TRUE means fit
02226               the child window to fill the client area of the parent window.
02227               FALSE means the window is a separate (but owned) window.
02228
02229   Returns:  BOOL
02230               TRUE if successful; FALSE if not.
02231 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02232 BOOL CSendLog::CreateServerLog(
02233        HINSTANCE hInst,
02234        HWND hWndParent,
02235        BOOL bChild)
02236 {
02237   BOOL bResult = FALSE;
02238   HWND hWnd;
02239   RECT rect;
02240   DWORD dwStyle = WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | LBS_NOSEL |
02241                     LBS_NOINTEGRALHEIGHT;
02242
02243   if (bChild)
02244     dwStyle |= WS_CHILD;
02245   else
02246     dwStyle |= WS_OVERLAPPEDWINDOW;
02247
02248   if (IsWindow(hWndParent))
02249   {
02250     GetClientRect(hWndParent, &rect);
02251
02252     // Create the child ListBox window and fill the parent window with it.
02253     hWnd = ::CreateWindowEx(
02254                0,                // Extended Window Style
02255                TEXT("LISTBOX"),  // Class Name
02256                NULL,             // No Window Title
02257                dwStyle,          // The window style
02258                0,                // (x,y)=Upper left of Parent window
02259                0,
02260                rect.right,       // Width; Fill Client Window
02261                rect.bottom,      // Hight
02262                hWndParent,       // Parent Window Handle
02263                0,                // No menu
02264                hInst,            // App Instance Handle
02265                NULL);            // Window Creation Data
02266
02267     if (NULL != hWnd)
02268     {
02269       // Remember the instance of this application.
02270       m_hInstSender = hInst;
02271       // Remember the window handle of this Sending application.
02272       m_hWndSender = hWndParent;
02273       // Remember the window handle of the new listbox window.
02274       m_hWndListBox = hWnd;
02275       // Remember if this is a child window (bChild==TRUE).
02276       m_bChild = bChild;
02277       // Return success.
02278       bResult = TRUE;
02279     }
02280   }
02281
02282   return (bResult);
02283 }
02284
02285
02286 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02287   Method:   CSendLog::SetClient
02288
02289   Summary:  Initialize the SendLog facility for logging to the client.
02290
02291   Args:     HINSTANCE hInstSender,
02292               Instance handle of the sending server application.
02293             HWND hWndSender,
02294               Window handle for the sending server's main window.
02295             HWND hWndReceiver,
02296               Window handle for the destination receiving client window.
02297
02298   Returns:  BOOL
02299               Returns TRUE.
02300 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02301 BOOL CSendLog::SetClient(
02302        HINSTANCE hInstSender,
02303        HWND hWndSender,
02304        HWND hWndReceiver)
02305 {
02306   BOOL bOk;
02307
02308   bOk = (NULL != hWndReceiver);
02309
02310   if (bOk)
02311   {
02312     // Remember the instance of this sending application.
02313     m_hInstSender = hInstSender;
02314     // Remember the main window of this sending application.
02315     m_hWndSender = hWndSender;
02316     // Remember the window handle of the receiving window.
02317     m_hWndReceiver = hWndReceiver;
02318   }
02319
02320   return bOk;
02321 }
02322
02323
02324 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02325   Method:   CSendLog::LogToServer
02326
02327   Summary:  Switches logging to either server or client display.
02328
02329   Args:     BOOL bLogToServer
02330               TRUE for logging to server; FALSE for logging to client.
02331
02332   Returns:  BOOL
02333               New logging status.
02334 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02335 BOOL CSendLog::LogToServer(
02336        BOOL bLogToServer)
02337 {
02338   BOOL bResult = bLogToServer;
02339
02340   m_bLogToServer = bLogToServer;
02341
02342   return (bResult);
02343 }
02344
02345
02346 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02347   Method:   CSendLog::Msg
02348
02349   Summary:  Logs a message string as a separate line in the receiving
02350             CMsgLog facility.
02351
02352   Args:     LPTSTR szMsg
02353               Pointer to String of the message to display/log.
02354
02355   Returns:  BOOL bResult
02356               TRUE if successful; FALSE if not.
02357 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02358 BOOL CSendLog::Msg(
02359        LPTSTR szMsg)
02360 {
02361   BOOL bResult = FALSE;
02362   COPYDATASTRUCT cds;
02363
02364   if (NULL != szMsg)
02365   {
02366     if (m_bLogToServer)
02367     {
02368       int iIndex;
02369
02370       bResult = TRUE;
02371       ::SendMessage(
02372           m_hWndListBox,
02373           LB_ADDSTRING,
02374           0,
02375           (LPARAM)szMsg);
02376       iIndex = (int)::SendMessage(
02377                    m_hWndListBox,
02378                    LB_GETCOUNT,
02379                    0,
02380                    0);
02381       if (LB_ERR != iIndex && iIndex > 0)
02382       {
02383         --iIndex;
02384         ::SendMessage(
02385             m_hWndListBox,
02386             LB_SETCURSEL,
02387             (WPARAM)iIndex,
02388             0);
02389       }
02390     }
02391     else
02392     {
02393       cds.dwData = 0;
02394       cds.cbData = sizeof(TCHAR) * (lstrlen(szMsg)+1);
02395       cds.lpData = szMsg;
02396
02397       bResult = (BOOL) SendMessage(
02398                   m_hWndReceiver,
02399                   WM_COPYDATA,
02400                   (WPARAM) m_hWndSender,
02401                   (LPARAM) &cds);
02402     }
02403
02404     #if defined(DEBUG)
02405       ::OutputDebugString(szMsg);
02406     #endif
02407   }
02408
02409   return (bResult);
02410 }
02411
02412
02413 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02414   Method:   CSendLog::MsgFmt
02415
02416   Summary:  Logs a printf-style formated message as a separate line in the
02417             receiving CMsgLog facility.
02418
02419   Args:     LPTSTR szFmtMsg
02420               The format/message string to display/log.
02421             [...]
02422               Arguments to match those specified in the format string.
02423
02424   Returns:  BOOL
02425               TRUE if successful; FALSE if not.
02426 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02427 BOOL CSendLog::MsgFmt(
02428        LPTSTR szFmtMsg,
02429        ...)
02430 {
02431   BOOL bResult = FALSE;
02432   va_list arglist;
02433   va_start(arglist, szFmtMsg);
02434   TCHAR szMsg[MAX_STRING_LENGTH];
02435
02436   if (NULL != szFmtMsg)
02437   {
02438     // Use the format string and arguments to format the content text.
02439     wvsprintf(szMsg, szFmtMsg, arglist);
02440     // Send the newly formated message string to the trace Log Listbox.
02441     bResult = Msg(szMsg);
02442   }
02443
02444   return (bResult);
02445 }
02446
02447
02448 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02449   Method:   CSendLog::MsgID
02450
02451   Summary:  Logs a message string as a separate line in the receiving
02452             CMsgLog facility.
02453
02454   Args:     int iMsgID
02455               String Resource ID for the message to display/log.
02456
02457   Returns:  BOOL
02458               TRUE if successful; FALSE if not.
02459 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02460 BOOL CSendLog::MsgID(
02461        int iMsgID)
02462 {
02463   BOOL bResult = FALSE;
02464   TCHAR szMsg[MAX_STRING_LENGTH];
02465
02466   // Load the message string from the sender's resources and log/send it.
02467   if (LoadString(m_hInstSender, iMsgID, szMsg, MAX_STRING_LENGTH))
02468     bResult = Msg(szMsg);
02469
02470   return (bResult);
02471 }
02472
02473
02474 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02475   Method:   CSendLog::MsgFmtID
02476
02477   Summary:  Logs a printf-style formated message as a separate line in the
02478             receiving CMsgLog facility.
02479
02480   Args:     int iFmtID
02481               The resource ID for the format/message string to display/log.
02482             [...]
02483               Arguments to match those specified in the format string.
02484
02485   Returns:  BOOL
02486               TRUE if successful; FALSE if not.
02487 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02488 BOOL CSendLog::MsgFmtID(
02489        int iFmtID,
02490        ...)
02491 {
02492   BOOL bResult = FALSE;
02493   va_list arglist;
02494   va_start(arglist, iFmtID);
02495   TCHAR szFormat[MAX_STRING_LENGTH];
02496   TCHAR szMsg[MAX_STRING_LENGTH];
02497
02498   // Load the format string from the app's string resources.
02499   if (LoadString(m_hInstSender, iFmtID, szFormat, MAX_STRING_LENGTH))
02500   {
02501     // Use the format string and arguments to format the content text.
02502     wvsprintf(szMsg, szFormat, arglist);
02503     // Send the newly formated message string to the trace Log Listbox.
02504     bResult = Msg(szMsg);
02505   }
02506
02507   return (bResult);
02508 }
02509
02510
02511 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02512   Method:   CSendLog::Resize
02513
02514   Summary:  Resizes the listbox to a new width and height.  Called during
02515             the parent window's WM_SIZE to fit the listbox to the client
02516             area of the parent window.  It only honors this request if it
02517             is an integral child window.
02518
02519   Args:     int nWidth
02520               New width in pixels of the listbox.
02521             int nHeight
02522               New height in pixels of the listbox.
02523
02524   Returns:  BOOL
02525               TRUE if successful; FALSE if not.
02526 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02527 BOOL CSendLog::Resize(
02528        int nWidth,
02529        int nHeight)
02530 {
02531   BOOL bResult = FALSE;
02532
02533   if (m_bChild)
02534     bResult = ::MoveWindow(m_hWndListBox, 0, 0, nWidth, nHeight, TRUE);
02535
02536   return (bResult);
02537 }
02538
02539
02540 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02541   Method:   CSendLog::Clear
02542
02543   Summary:  Clears all logged messages from the message log listbox.
02544
02545   Args:     void
02546
02547   Returns:  BOOL
02548               TRUE.
02549 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02550 BOOL CSendLog::Clear(
02551        void)
02552 {
02553   ::SendMessage(
02554       m_hWndListBox,
02555       LB_RESETCONTENT,
02556       0,
02557       0);
02558
02559   return (TRUE);
02560 }
02561
02562
02563 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
02564   Method:   CSendLog::Copy
02565
02566   Summary:  Copies the current content of the trace message log to the
02567             Windows clipboard.
02568
02569   Args:     void
02570
02571   Returns:  BOOL
02572               TRUE if success; FALSE if failure.
02573 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
02574 BOOL CSendLog::Copy(void)
02575 {
02576   BOOL bResult = FALSE;
02577   DWORD iIndex;
02578   DWORD cbLen;
02579   HANDLE hClip;
02580   LPTSTR pLogData;
02581   TCHAR szLine[MAX_STRING_LENGTH];
02582   DWORD cItems = (DWORD)::SendMessage(m_hWndListBox,LB_GETCOUNT,0,0);
02583
02584   if (LB_ERR != cItems
02585       && 0 < cItems
02586       && MAX_LOG_LINES > cItems
02587       && OpenClipboard(m_hWndListBox))
02588   {
02589     if (EmptyClipboard())
02590     {
02591       m_hLogData = GlobalAlloc(GHND, cItems * MAX_STRING_LENGTH);
02592       if (m_hLogData)
02593       {
02594         // Lock the global memory while we write to it.
02595         pLogData = (LPTSTR) GlobalLock(m_hLogData);
02596         // Loop thru the log text lines and concat them to one big string.
02597         for (iIndex = 0; iIndex < cItems; iIndex++)
02598         {
02599           // Get each log text line.
02600           cbLen = (DWORD)::SendMessage(
02601                       m_hWndListBox,
02602                       LB_GETTEXT,
02603                       (WPARAM)iIndex,
02604                       (LPARAM) (LPSTR)szLine);
02605           if (LB_ERR != cbLen && (MAX_STRING_LENGTH-3) > cbLen)
02606           {
02607             // Put CRLF at end.
02608             szLine[cbLen]   = '\r';
02609             szLine[cbLen+1] = '\n';
02610             szLine[cbLen+2] = '\0';
02611             if (0 == iIndex)
02612               lstrcpyn((LPTSTR)pLogData, szLine, (cItems * MAX_STRING_LENGTH)
02613                 /sizeof(TCHAR));
02614             else
02615               lstrncat((LPTSTR)pLogData, szLine, (cItems * MAX_STRING_LENGTH)
02616                 /sizeof(TCHAR) - lstrlen(pLogData));
02617           }
02618         }
02619         // We're done with writing so unlock the memory block.
02620         GlobalUnlock(m_hLogData);
02621         // If there were any lines at all then copy them to clipboard.
02622         if (0 < iIndex)
02623           hClip = SetClipboardData(CF_TEXT, m_hLogData);
02624         if (!hClip)
02625         {
02626           // If we couldn't clip the data then free the global handle.
02627           GlobalFree(m_hLogData);
02628           m_hLogData = 0;
02629         }
02630         // We're done with the clipboard so close it.
02631         bResult = CloseClipboard();
02632       }
02633     }
02634   }
02635
02636   return (bResult);
02637 }
02638
02639
02640 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
02641   Function: SetRegKeyValue
02642
02643   Summary:  Internal utility function to set a Key, Subkey, and value
02644             in the system Registry.
02645
02646   Args:     LPTSTR pszKey,
02647             LPTSTR pszSubkey,
02648             LPTSTR pszValue)
02649
02650   Returns:  BOOL
02651               TRUE if success; FALSE if not.
02652 ------------------------------------------------------------------------F-F*/
02653 BOOL SetRegKeyValue(
02654        LPTSTR pszKey,
02655        LPTSTR pszSubkey,
02656        LPTSTR pszValue)
02657 {
02658   BOOL bOk = FALSE;
02659   LONG ec;
02660   HKEY hKey;
02661   TCHAR szKey[MAX_STRING_LENGTH];
02662   DWORD dwRes;
02663   PSID pEveryoneSID = NULL, pAdminSID = NULL;
02664   PACL pACL = NULL;
02665   PSECURITY_DESCRIPTOR pSD = NULL;
02666   EXPLICIT_ACCESS ea[2];
02667   SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
02668   SID_IDENTIFIER_AUTHORITY SIDAuthNT = SECURITY_NT_AUTHORITY;
02669   SECURITY_ATTRIBUTES sa;
02670   LONG lRes;
02671
02672   lstrcpyn(szKey, pszKey, MAX_STRING_LENGTH);
02673
02674   if (NULL != pszSubkey)
02675   {
02676     lstrncat(szKey, TEXT("\\"), MAX_STRING_LENGTH - lstrlen(szKey));
02677     lstrncat(szKey, pszSubkey, MAX_STRING_LENGTH - lstrlen(szKey));
02678   }
02679
02680
02681   // Create a well-known SID for the Everyone group.
02682   if(!AllocateAndInitializeSid( &SIDAuthWorld, 1,
02683     SECURITY_WORLD_RID,
02684     0, 0, 0, 0, 0, 0, 0,
02685     &pEveryoneSID))
02686   {
02687     goto Cleanup;
02688   }
02689
02690   // Initialize an EXPLICIT_ACCESS structure for an ACE.
02691   // The ACE will allow Everyone read access to the key.
02692   ZeroMemory(&ea, 2 * sizeof(EXPLICIT_ACCESS));
02693   ea[0].grfAccessPermissions = KEY_READ;
02694   ea[0].grfAccessMode = SET_ACCESS;
02695   ea[0].grfInheritance= NO_INHERITANCE;
02696   ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
02697   ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
02698   ea[0].Trustee.ptstrName  = (LPTSTR) pEveryoneSID;
02699
02700   // Create a SID for the BUILTIN\Administrators group.
02701   if(!AllocateAndInitializeSid( &SIDAuthNT, 2,
02702     SECURITY_BUILTIN_DOMAIN_RID,
02703     DOMAIN_ALIAS_RID_ADMINS,
02704     0, 0, 0, 0, 0, 0,
02705     &pAdminSID))
02706   {
02707     goto Cleanup;
02708   }
02709
02710   // Initialize an EXPLICIT_ACCESS structure for an ACE.
02711   // The ACE will allow the Administrators group full access to the key.
02712   ea[1].grfAccessPermissions = KEY_ALL_ACCESS;
02713   ea[1].grfAccessMode = SET_ACCESS;
02714   ea[1].grfInheritance= NO_INHERITANCE;
02715   ea[1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
02716   ea[1].Trustee.TrusteeType = TRUSTEE_IS_GROUP;
02717   ea[1].Trustee.ptstrName  = (LPTSTR) pAdminSID;
02718
02719   // Create a new ACL that contains the new ACEs.
02720   dwRes = SetEntriesInAcl(2, ea, NULL, &pACL);
02721   if (ERROR_SUCCESS != dwRes)
02722   {
02723     goto Cleanup;
02724   }
02725
02726   // Initialize a security descriptor.
02727   pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR,
02728     SECURITY_DESCRIPTOR_MIN_LENGTH);
02729   if (pSD == NULL)
02730   {
02731     goto Cleanup;
02732   }
02733
02734   if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION))
02735   {
02736     goto Cleanup;
02737   }
02738
02739   // Add the ACL to the security descriptor.
02740   if (!SetSecurityDescriptorDacl(pSD,
02741     TRUE,     // fDaclPresent flag
02742     pACL,
02743     FALSE))   // not a default DACL
02744   {
02745     goto Cleanup;
02746   }
02747
02748   // Initialize a security attributes structure.
02749   sa.nLength = sizeof (SECURITY_ATTRIBUTES);
02750   sa.lpSecurityDescriptor = pSD;
02751   sa.bInheritHandle = FALSE;
02752
02753   // Use the security attributes to set the security descriptor
02754   // when you create a key.
02755   ec = RegCreateKeyEx(
02756          HKEY_CLASSES_ROOT,
02757          szKey,
02758          0,
02759          NULL,
02760          REG_OPTION_NON_VOLATILE,
02761          KEY_READ | KEY_WRITE,
02762          &sa,
02763          &hKey,
02764          NULL);
02765
02766   if (NULL != pszValue && ERROR_SUCCESS == ec)
02767   {
02768     ec = RegSetValueEx(
02769            hKey,
02770            NULL,
02771            0,
02772            REG_SZ,
02773            (BYTE *)pszValue,
02774            (lstrlen(pszValue)+1)*sizeof(TCHAR));
02775     if (ERROR_SUCCESS == ec)
02776       bOk = TRUE;
02777   }
02778
02779 Cleanup:
02780
02781   if (pEveryoneSID)
02782     FreeSid(pEveryoneSID);
02783   if (pAdminSID)
02784     FreeSid(pAdminSID);
02785   if (pACL)
02786     LocalFree(pACL);
02787   if (pSD)
02788     LocalFree(pSD);
02789   if (hKey)
02790     RegCloseKey(hKey);
02791
02792   return bOk;
02793 }
02794
02795
02796 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
02797   Function: AddRegNamedValue
02798
02799   Summary:  Internal utility function to add a named data value to an
02800             existing Key (with optional Subkey) in the system Registry
02801             under HKEY_CLASSES_ROOT.
02802
02803   Args:     LPTSTR pszKey,
02804             LPTSTR pszSubkey,
02805             LPTSTR pszValueName,
02806             LPTSTR pszValue)
02807
02808   Returns:  BOOL
02809               TRUE if success; FALSE if not.
02810 ------------------------------------------------------------------------F-F*/
02811 BOOL AddRegNamedValue(
02812        LPTSTR pszKey,
02813        LPTSTR pszSubkey,
02814        LPTSTR pszValueName,
02815        LPTSTR pszValue)
02816 {
02817   BOOL bOk = FALSE;
02818   LONG ec;
02819   HKEY hKey;
02820   TCHAR szKey[MAX_STRING_LENGTH];
02821
02822   lstrcpyn(szKey, pszKey, MAX_STRING_LENGTH);
02823
02824   if (NULL != pszSubkey)
02825   {
02826     lstrncat(szKey, TEXT("\\"), MAX_STRING_LENGTH - lstrlen(szKey));
02827     lstrncat(szKey, pszSubkey, MAX_STRING_LENGTH - lstrlen(szKey));
02828   }
02829
02830   ec = RegOpenKeyEx(
02831          HKEY_CLASSES_ROOT,
02832          szKey,
02833          0,
02834          KEY_ALL_ACCESS,
02835          &hKey);
02836
02837   if (NULL != pszValue && ERROR_SUCCESS == ec)
02838   {
02839     ec = RegSetValueEx(
02840            hKey,
02841            pszValueName,
02842            0,
02843            REG_SZ,
02844            (BYTE *)pszValue,
02845            (lstrlen(pszValue)+1)*sizeof(TCHAR));
02846     if (ERROR_SUCCESS == ec)
02847       bOk = TRUE;
02848     RegCloseKey(hKey);
02849   }
02850
02851   return bOk;
02852 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyMemberSetChangeListener/resource.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyMemberSetChangeListener

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by MyMemberSetChangeListener.rc
00004 //
00005 #define IDS_PROJNAME                        100
00006 #define IDR_MYMEMBERSETCHANGELISTENER       101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/StoServe/StoServe.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • StoServe

StoServe.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      STOSERVE.CPP
00003
00004   Summary:   Main implementation file for a DLL COM Component server
00005              providing a Paper-related COM Component: DllPaper. Access to
00006              Class Factories is provided in this module.  This module also
00007              supports self registration and unregistration for the server.
00008              STOSERVE and its managed COPaper COM objects are thread-safe.
00009
00010              For a comprehensive tutorial code tour of STOSERVE's contents
00011              and offerings see the tutorial STOSERVE.HTM file. For more
00012              specific technical details on the internal workings see the
00013              comments dispersed throughout the STOSERVE source code. For
00014              more details on how STOSERVE's components are functioned by
00015              the STOCLIEN client see STOCLIEN.HTM in the main tutorial
00016              directory.
00017
00018   Classes:   none.
00019
00020   Functions: DllMain, DllGetClassObject, DllCanUnloadNow, DllRegisterServer,
00021              DllUnregisterServer.
00022
00023   Origin:    6-10-96: atrent - Editor-inheritance from CONSERVE.CPP in
00024                the CONSERVE Tutorial Code Sample.
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 /*---------------------------------------------------------------------------
00042   We include WINDOWS.H for all Win32 applications.
00043   We include OLE2.H because we will be calling the COM/OLE Libraries.
00044   We include INITGUID.H only once (here) in the entire DLL because we
00045     will be defining GUIDs and want them as constants in the data segment.
00046   We include APPUTIL.H because we will be building this DLL using
00047     the convenient Virtual Window and Dialog classes and other
00048     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00049   We include IPAPER.H and PAPRGUID.H for the common Paper-related
00050     Interface class, GUID, and CLSID specifications.
00051   We include STOSERVE.H because it has the _DLLEXPORT_ controlled import
00052     and export specifications.
00053   We include SERVER.H because it has internal class declarations for
00054     the server's control object.
00055   We include FACTORY.H because it has the necessary internal class factory
00056     declarations for this DLL component server.
00057 ---------------------------------------------------------------------------*/
00058 #include <windows.h>
00059 #include <ole2.h>
00060 #include <initguid.h>
00061 #include <apputil.h>
00062 #include <ipaper.h>
00063 #include <papguids.h>
00064 #define _DLLEXPORT_
00065 #include "stoserve.h"
00066 #include "server.h"
00067 #include "factory.h"
00068
00069
00070 // Global variable definitions. Some Initialized in DllMain() below.
00071
00072 // We encapsulate the control of this COM server (eg, lock and object
00073 // counting) in a server control C++ object. Here is it's global pointer.
00074 CServer* g_pServer = NULL;
00075
00076
00077 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00078   Function: UnicodeOk
00079
00080   Summary:  Checks if the platform will handle unicode versions of
00081             Win32 string API calls.
00082
00083   Args:     void
00084
00085   Returns:  BOOL
00086               TRUE if unicode support; FALSE if not.
00087 ------------------------------------------------------------------------F-F*/
00088 BOOL UnicodeOk(void)
00089 {
00090   BOOL bOk = TRUE;
00091   TCHAR szUserName[MAX_STRING_LENGTH];
00092   DWORD dwSize = MAX_STRING_LENGTH;
00093
00094   if (!GetUserName(szUserName, &dwSize))
00095     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00096
00097   return bOk;
00098 }
00099
00100
00101 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00102   Function: DllMain
00103
00104   Summary:  Just as WinMain is for an EXE application, this DllMain
00105             function is the main entry point for this DLL.  It is called
00106             when the DLL is loaded by a process, and when new threads are
00107             created by a process that has already loaded this DLL.
00108             DllMain is also called when threads of a process that has
00109             loaded the DLL exit cleanly and when the process itself
00110             unloads the DLL.
00111
00112             If you want to use C runtime libraries, keep this function
00113             named "DllMain" and you won't have to do anything special to
00114             initialize the runtime libraries.
00115
00116             When fdwReason == DLL_PROCESS_ATTACH, the return value is used
00117             to determine if the DLL should remain loaded, or should be
00118             immediately unloaded depending upon whether the DLL could be
00119             initialized properly.  For all other values of fdwReason, the
00120             return value is ignored.
00121
00122   Args:     HINSTANCE hDLLInst,
00123               Instance handle of the DLL.
00124             DWORD fdwReason,
00125               Process attach/detach or thread attach/detach.
00126               Reason for calling.
00127             LPVOID lpvReserved)
00128               Reserved and not used.
00129
00130   Returns:  BOOL,
00131               Return value is used only when fdwReason == DLL_PROCESS_ATTACH.
00132               TRUE  -  Used to signify that the DLL should remain loaded.
00133               FALSE -  Used to signify that the DLL should be
00134                 immediately unloaded.
00135 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00136 BOOL WINAPI DllMain(
00137               HINSTANCE hDllInst,
00138               DWORD fdwReason,
00139               LPVOID lpvReserved)
00140 {
00141   BOOL bResult = TRUE;
00142
00143   // Dispatch this main call based on the reason it was called.
00144   switch (fdwReason)
00145   {
00146     case DLL_PROCESS_ATTACH:
00147       // The DLL is being loaded for the first time by a given process.
00148       // Perform per-process initialization here.  If the initialization
00149       // is successful, return TRUE; if unsuccessful, return FALSE.
00150       bResult = FALSE;
00151       if (UnicodeOk())
00152       {
00153         // Instantiate the CServer utility class.
00154         g_pServer = new CServer;
00155         if (NULL != g_pServer)
00156         {
00157           // Remember the DLL Instance handle.
00158           g_pServer->m_hDllInst = hDllInst;
00159           bResult = TRUE;
00160         }
00161       }
00162       break;
00163
00164     case DLL_PROCESS_DETACH:
00165       // The DLL is being unloaded by a given process.  Do any
00166       // per-process clean up here, such as undoing what was done in
00167       // DLL_PROCESS_ATTACH.  The return value is ignored.
00168       DELETE_POINTER(g_pServer);
00169       break;
00170
00171     case DLL_THREAD_ATTACH:
00172       // A thread is being created in a process that has already loaded
00173       // this DLL.  Perform any per-thread initialization here.  The
00174       // return value is ignored.
00175       break;
00176
00177     case DLL_THREAD_DETACH:
00178       // A thread is exiting cleanly in a process that has already
00179       // loaded this DLL.  Perform any per-thread clean up here.  The
00180       // return value is ignored.
00181       break;
00182
00183     default:
00184       break;
00185   }
00186
00187   return (bResult);
00188 }
00189
00190
00191 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00192   Function: DllGetClassObject
00193
00194   Summary:  The standard exported function that the COM service library
00195             uses to obtain an object class of the class factory for a
00196             specified component provided by this server DLL.
00197
00198   Args:     REFCLSID rclsid,
00199               [in] The CLSID of the requested Component.
00200             REFIID riid,
00201               [in] GUID of the requested interface on the Class Factory.
00202             PPVOID ppv)
00203               [out] Address of the caller's pointer variable that will
00204               receive the requested interface pointer.
00205
00206   Returns:  HRESULT
00207               E_FAIL if requested component isn't supported.
00208               E_OUTOFMEMORY if out of memory.
00209               Error code out of the QueryInterface.
00210 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00211 STDAPI DllGetClassObject(
00212          REFCLSID rclsid,
00213          REFIID riid,
00214          PPVOID ppv)
00215 {
00216   HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
00217   IUnknown* pCob = NULL;
00218
00219   if (CLSID_DllPaper == rclsid)
00220   {
00221     hr = E_OUTOFMEMORY;
00222     pCob = new CFPaper(NULL, g_pServer);
00223   }
00224
00225   if (NULL != pCob)
00226   {
00227     g_pServer->ObjectsUp();
00228     hr = pCob->QueryInterface(riid, ppv);
00229     if (FAILED(hr))
00230     {
00231       g_pServer->ObjectsDown();
00232       DELETE_POINTER(pCob);
00233     }
00234   }
00235
00236   return hr;
00237 }
00238
00239
00240 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00241   Function: DllCanUnloadNow
00242
00243   Summary:  The standard exported function that the COM service library
00244             uses to determine if this server DLL can be unloaded.
00245
00246   Args:     void.
00247
00248   Returns:  HRESULT
00249               S_OK if this DLL server can be unloaded.
00250               S_FALSE if this DLL can not be unloaded.
00251 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00252 STDAPI DllCanUnloadNow(void)
00253 {
00254   HRESULT hr;
00255
00256   // We return S_OK if there are no longer any living objects AND
00257   // there are no outstanding client locks on this server.
00258   hr = g_pServer->CanUnloadNow();
00259
00260   return hr;
00261 }
00262
00263
00264 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00265   Function: DllRegisterServer
00266
00267   Summary:  The standard exported function that can be called to command
00268             this DLL server to register itself in the system registry.
00269
00270   Args:     void.
00271
00272   Returns:  HRESULT
00273               NOERROR
00274 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00275 STDAPI DllRegisterServer(void)
00276 {
00277   HRESULT  hr = NOERROR;
00278   TCHAR    szID[GUID_SIZE+1];
00279   TCHAR    szCLSID[GUID_SIZE+32];
00280   TCHAR    szModulePath[MAX_PATH];
00281
00282   // Obtain the path to this module's executable file for later use.
00283   GetModuleFileName(
00284     g_pServer->m_hDllInst,
00285     szModulePath,
00286     sizeof(szModulePath)/sizeof(TCHAR));
00287
00288   /*-------------------------------------------------------------------------
00289     Create registry entries for the DllPaper Component.
00290   -------------------------------------------------------------------------*/
00291   // Create some base key strings.
00292   StringFromGUID2(CLSID_DllPaper, szID, GUID_SIZE);
00293   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00294   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00295
00296   // Create ProgID keys.
00297   SetRegKeyValue(
00298     TEXT("CTS.DllPaper.1"),
00299     NULL,
00300     TEXT("DllPaper Component - STOSERVE Code Sample"));
00301   SetRegKeyValue(
00302     TEXT("CTS.DllPaper.1"),
00303     TEXT("CLSID"),
00304     szID);
00305
00306   // Create VersionIndependentProgID keys.
00307   SetRegKeyValue(
00308     TEXT("CTS.DllPaper"),
00309     NULL,
00310     TEXT("DllPaper Component - STOSERVE Code Sample"));
00311   SetRegKeyValue(
00312     TEXT("CTS.DllPaper"),
00313     TEXT("CurVer"),
00314     TEXT("CTS.DllPaper.1"));
00315   SetRegKeyValue(
00316     TEXT("CTS.DllPaper"),
00317     TEXT("CLSID"),
00318     szID);
00319
00320   // Create entries under CLSID.
00321   SetRegKeyValue(
00322     szCLSID,
00323     NULL,
00324     TEXT("DllPaper Component - STOSERVE Code Sample"));
00325   SetRegKeyValue(
00326     szCLSID,
00327     TEXT("ProgID"),
00328     TEXT("CTS.DllPaper.1"));
00329   SetRegKeyValue(
00330     szCLSID,
00331     TEXT("VersionIndependentProgID"),
00332     TEXT("CTS.DllPaper"));
00333   SetRegKeyValue(
00334     szCLSID,
00335     TEXT("NotInsertable"),
00336     NULL);
00337   SetRegKeyValue(
00338     szCLSID,
00339     TEXT("InprocServer32"),
00340     szModulePath);
00341   AddRegNamedValue(
00342     szCLSID,
00343     TEXT("InprocServer32"),
00344     TEXT("ThreadingModel"),
00345     TEXT("Apartment"));
00346
00347   return hr;
00348 }
00349
00350
00351 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00352   Function: DllUnregisterServer
00353
00354   Summary:  The standard exported function that can be called to command
00355             this DLL server to unregister itself from the system Registry.
00356
00357   Args:     void.
00358
00359   Returns:  HRESULT
00360               NOERROR
00361 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00362 STDAPI DllUnregisterServer(void)
00363 {
00364   HRESULT  hr = NOERROR;
00365   TCHAR    szID[GUID_SIZE+1];
00366   TCHAR    szCLSID[GUID_SIZE+32];
00367   TCHAR    szTemp[MAX_PATH+GUID_SIZE];
00368
00369   /*-------------------------------------------------------------------------
00370     Delete registry entries for the Paper Component.
00371   -------------------------------------------------------------------------*/
00372   //Create some base key strings.
00373   StringFromGUID2(CLSID_DllPaper, szID, GUID_SIZE);
00374   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00375   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00376
00377   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DllPaper\\CurVer"));
00378   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DllPaper\\CLSID"));
00379   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DllPaper"));
00380
00381   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DllPaper.1\\CLSID"));
00382   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DllPaper.1"));
00383
00384   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00385   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00386
00387   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00388   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00389
00390   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00391   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00392
00393   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("InprocServer32"));
00394   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00395
00396   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00397
00398   return hr;
00399 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/Resource.h Source File

  • Web
  • NetMeeting
  • NMShare

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by res.rc
00004 //
00005 #define IDS_APP_TITLE                   1
00006 #define IDS_VERSION                     2
00007 #define IDS_SYSMENU                     4
00008 #define ICO_MAIN                        101
00009 #define IDM_APP                         104
00010 #define ID_APPACCEL                     105
00011 #define IDD_OPTIONS                     123
00012 #define IDM_SAVE_AS                     40001
00013 #define IDM_EXIT                        40002
00014 #define IDM_VIEW_FONT                   40011
00015 #define IDM_VIEW_CLEAR                  40012
00016 #define IDM_OPTIONS                     40013
00017 #define IDM_EJECT                       40021
00018 #define IDM_HELP                        40090
00019 #define IDM_HELP_CONTENTS               40091
00020 #define IDM_ABOUT                       40092
00021 #define IDM_VIEW_NAME                   40142
00022 #define IDM_VIEW_TIME                   40143
00023 #define IDM_VIEW_USERS                  40144
00024 #define IDM_CALL                        40145
00025 #define IDM_REFRESH                     40146
00026 #define IDM_WORK_ALONE                  40147
00027 #define IDM_COLLABORATE                 40148
00028 #define IDM_IN_CONTROL                  40149
00029 #define IDM_SHARE                       40150
00030 #define IDM_VIEW_SBAR                   40151
00031 #define IDM_VIEW_USERLIST               40152
00032 #define IDM_VIEW_MSG                    40153
00033
00034 // Next default values for new objects
00035 //
00036 #ifdef APSTUDIO_INVOKED
00037 #ifndef APSTUDIO_READONLY_SYMBOLS
00038 #define _APS_NEXT_RESOURCE_VALUE        125
00039 #define _APS_NEXT_COMMAND_VALUE         40154
00040 #define _APS_NEXT_CONTROL_VALUE         1028
00041 #define _APS_NEXT_SYMED_VALUE           101
00042 #endif
00043 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/CPPClient/cppclient.Cpp Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • CPPClient

cppclient.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 #include "stdafx.h"
00017 #include <iostream.h>
00018 #include <conio.h>
00019 #include "FullSvr.h"
00020 #include "FullSvr_i.c"
00021
00022 int main(int argc, char* argv[])
00023 {
00024
00025   HRESULT hr;
00026   int i;
00027   AsyncIFullServ * pAsyncIFullServ = NULL;
00028   ICallFactory   * pICallFactory = NULL;
00029   ISynchronize   * pISynchronize = NULL;
00030   IUnknown       * pIUnknown = NULL;
00031
00032   //Create an STA
00033   CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
00034
00035   //Create the server object
00036   hr = CoCreateInstance(CLSID_FullServ,NULL,CLSCTX_LOCAL_SERVER,IID_IUnknown,(void**)&pIUnknown);
00037   if(FAILED(hr)){
00038     cerr<<"CoCreateInstance failed"<<endl;
00039     goto CleanUp;
00040   }
00041
00042   //Get a pointer to ICallFactory
00043   hr = pIUnknown->QueryInterface(IID_ICallFactory,(void **)&pICallFactory);
00044   if(FAILED(hr)){
00045     cerr<<"Query for ICallFactory failed."<<endl;
00046     goto CleanUp;
00047   }
00048
00049   //Create the call object and get a pointer to the async interface
00050   hr = pICallFactory->CreateCall(IID_AsyncIFullServ,NULL,IID_AsyncIFullServ,(IUnknown**)&pAsyncIFullServ);
00051   if(FAILED(hr)){
00052     cerr<<"Unable to create Call Object."<<endl;
00053     goto CleanUp;
00054   }
00055
00056   //Get a pointer to ISynchronize
00057   hr = pAsyncIFullServ->QueryInterface(IID_ISynchronize,(void**)&pISynchronize);
00058   if(FAILED(hr)){
00059     cerr<<"Query for ISynchronize failed."<<endl;
00060     goto CleanUp;
00061   }
00062
00063   //Begin the non-blocking call
00064   hr = pAsyncIFullServ->Begin_Sum(2,3);
00065   if(FAILED(hr)){
00066     cerr<<"Begin_Sum failed.  Call was not sent succesfully to the server"<<endl;
00067     //this failed call will be cleaned up by releasing the call object
00068     goto CleanUp;
00069   }
00070
00071   cout<<"Waiting for call completion."<<endl;
00072   //Wait for call completion
00073   hr = pISynchronize->Wait(0,INFINITE);
00074   if(FAILED(hr)){
00075     cerr<<"Wait failed"<<endl;
00076     goto CleanUp;
00077   }
00078
00079   //Finish the call and retrieve the results
00080   hr = pAsyncIFullServ->Finish_Sum(&i);
00081   if(FAILED(hr)){
00082     cerr<<"Finish_Sum failed."<<hr<<endl;
00083     goto CleanUp;
00084   }
00085
00086   cout<<"Sum of 2 and 3 is: "<< i <<endl;
00087
00088 //Release all allocated resources
00089 CleanUp:
00090
00091   if(pAsyncIFullServ) pAsyncIFullServ->Release();
00092   if(pISynchronize)   pISynchronize->Release();
00093   if(pIUnknown)       pIUnknown->Release();
00094   if(pICallFactory)   pICallFactory->Release();
00095
00096   CoUninitialize();
00097
00098
00099   cout<<endl<<"Press Enter to continue..\n \n"<<endl;
00100   _getch();
00101
00102   return 0;
00103 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPlgPin Member List

This is the complete list of members for CPlgPin, including all inherited members.
Active(void) | CPlgPin |
CheckMediaType(const CMediaType *pmt) | CPlgPin |
CPlgPin(CPlgFilter *pFilter, HRESULT *phr, LPCWSTR pPinName) | CPlgPin |
DECLARE_IUNKNOWN | CPlgPin |
GetMediaType(CMediaType *pmt) | CPlgPin |
Inactive(void) | CPlgPin |
InitMediaType() | CPlgPin | [private]
m_wfxFormat | CPlgPin | [private]
Receive(IMediaSample *pSample) | CPlgPin |
SetMediaType(const CMediaType *pmt) | CPlgPin |
~CPlgPin() | CPlgPin | [virtual]
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/resource.h Source File

  • SysMgmt
  • MMC
  • ActiveX

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDB_SMOPEN                      116
00012 #define IDB_SMBMP                       117
00013 #define IDB_LGBMP                       118
00014 #define IDR_SMICONS                     120
00015 #define IDR_LGICONS                     121
00016 #define IDB_ROCKET                      40004
00017 #define IDB_CAR                         40005
00018 #define IDB_PLANE                       40006
00019 #define IDB_BIKE                        40007
00020 #define IDB_ROCKET2                     40008
00021 #define IDB_CAR2                        40009
00022 #define IDB_PLANE2                      40010
00023 #define IDB_BIKE2                       40011
00024 #define IDB_CLOSED2                     40012
00025 #define IDB_OPEN2                       40013
00026 #define IDB_CLOSED                      40014
00027 #define IDB_OPEN                        40015
00028 #define ID_COMMAND_COMMAND1             40016
00029 #define ID_COMMAND_COMMAND2             40017
00030 #define ID_COMMAND_COMMAND3             40018
00031 #define ID_COMMAND_COMMAND4             40020
00032 #define ID_BUTTONSTART                  40021
00033 #define ID_BUTTONPAUSE                  40022
00034 #define ID_BUTTONSTOP                   40023
00035
00036 // Next default values for new objects
00037 //
00038 #ifdef APSTUDIO_INVOKED
00039 #ifndef APSTUDIO_READONLY_SYMBOLS
00040 #define _APS_NEXT_RESOURCE_VALUE        119
00041 #define _APS_NEXT_COMMAND_VALUE         40024
00042 #define _APS_NEXT_CONTROL_VALUE         1000
00043 #define _APS_NEXT_SYMED_VALUE           101
00044 #endif
00045 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAttributeValueDeleteButton Member List

This is the complete list of members for CAttributeValueDeleteButton, including all inherited members.
CAttributeValueDeleteButton(CMultiValuedAttributeEditor *pEditor) | CAttributeValueDeleteButton | [inline]
CAttributeValueDeleteButton(CMultiValuedAttributeEditor *pEditor) | CAttributeValueDeleteButton | [inline]
m_pEditor | CAttributeValueDeleteButton | [protected]
OnDelete() | CAttributeValueDeleteButton |
OnDelete() | CAttributeValueDeleteButton |
~CAttributeValueDeleteButton() | CAttributeValueDeleteButton | [inline]
~CAttributeValueDeleteButton() | CAttributeValueDeleteButton | [inline]
Generated on Wed Nov 13 2024 16:55:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/internetpublishing/ippsample/IAuth.Cpp Source File

  • Dataaccess
  • oledb
  • internetpublishing
  • ippsample

IAuth.Cpp

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003   ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004   TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005   PARTICULAR PURPOSE.
00006
00007   Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009   iauth.cpp
00010
00011   sample implementation of the IAuthenticate callback
00012 ------------------------------------------------------------------------------*/
00013 #include "stdafx.h"
00014
00015
00016 /*------------------------------------------------------------------------------
00017 FUNCTION CImpAuth
00018 ------------------------------------------------------------------------------*/
00019 CImpAuth::CImpAuth()
00020 {
00021    m_nRefs = 0;
00022    m_wszUserName = NULL;
00023    m_wszPassword = NULL;
00024 }
00025
00026 /*------------------------------------------------------------------------------
00027 FUNCTION ~CImpAuth
00028 ------------------------------------------------------------------------------*/
00029 CImpAuth::~CImpAuth()
00030 {
00031    if(NULL != m_wszUserName)
00032    {
00033       delete [] m_wszUserName;
00034    }
00035
00036    if(NULL != m_wszPassword)
00037    {
00038       delete [] m_wszPassword;
00039    }
00040 }
00041
00042 /*------------------------------------------------------------------------------
00043 FUNCTION QueryInterface
00044 ------------------------------------------------------------------------------*/
00045 HRESULT CImpAuth::QueryInterface(REFIID iid, void ** ppvObject)
00046 {
00047    if(NULL == ppvObject)
00048    {
00049       return E_INVALIDARG;
00050    }
00051
00052    if((IID_IAuthenticate == iid)
00053       || (IID_IUnknown == iid))
00054    {
00055       *ppvObject = this;
00056       m_nRefs++;
00057
00058       return S_OK;
00059    }
00060    else
00061    {
00062       *ppvObject = NULL;
00063       return E_NOINTERFACE;
00064    }
00065 }
00066
00067 /*------------------------------------------------------------------------------
00068 FUNCTION AddRef
00069 ------------------------------------------------------------------------------*/
00070 ULONG CImpAuth::AddRef(void)
00071 {
00072    return (++m_nRefs);
00073 }
00074
00075 /*------------------------------------------------------------------------------
00076 FUNCTION Release
00077 ------------------------------------------------------------------------------*/
00078 ULONG CImpAuth::Release(void)
00079 {
00080    ULONG nRef = (--m_nRefs);
00081
00082    if(0 >= nRef)
00083    {
00084       delete this;
00085    }
00086
00087    return nRef;
00088 }
00089
00090 /*------------------------------------------------------------------------------
00091 FUNCTION Authenticate
00092
00093   The only useful method in the IAuthenticate interface.  We do not display a
00094   UI.  We just return the username and password.  If this object is not
00095   initialized with Set(), we return empty strings.
00096
00097   Consumers of MSDAIPP are encouraged to implement this differently and pass
00098   their window handle to the provider.  MSDAIPP has built in ability to display
00099   a dialog to interactively ask the username and password from the users.
00100
00101 ------------------------------------------------------------------------------*/
00102 HRESULT STDMETHODCALLTYPE CImpAuth::Authenticate(
00103       /* out */      HWND     *phwnd,
00104       /* out */      LPWSTR   *pwszUserName,
00105       /* out */      LPWSTR   *pwszPassword )
00106 {
00107    if(   (NULL == phwnd)
00108       || (NULL == pwszUserName)
00109       || (NULL == pwszPassword) )
00110    {
00111       return E_INVALIDARG;
00112    }
00113
00114    if( (NULL == m_wszUserName) || (NULL == m_wszPassword) )
00115    {
00116       *phwnd = GetDesktopWindow();
00117
00118       *pwszUserName = NULL;
00119
00120       *pwszPassword = NULL;
00121    }
00122    else
00123    {
00124       *phwnd = (HWND)INVALID_HANDLE_VALUE;
00125
00126       *pwszUserName = (LPWSTR)CoTaskMemAlloc(
00127                                  (wcslen(m_wszUserName) + 1) * sizeof(WCHAR));
00128       if(NULL == *pwszUserName)
00129       {
00130          *pwszUserName = NULL;
00131
00132          return E_OUTOFMEMORY;
00133       }
00134
00135       *pwszPassword = (LPWSTR)CoTaskMemAlloc(
00136                                  (wcslen(m_wszPassword) + 1) * sizeof(WCHAR));
00137       if(NULL == *pwszPassword)
00138       {
00139          CoTaskMemFree(*pwszUserName);
00140          *pwszUserName=NULL;
00141
00142          return E_OUTOFMEMORY;
00143       }
00144
00145       wcscpy(*pwszUserName, m_wszUserName);
00146
00147       wcscpy(*pwszPassword, m_wszPassword);
00148    }
00149
00150    return S_OK;
00151 }
00152
00153 /*------------------------------------------------------------------------------
00154 Function Set
00155
00156   This function is for initializing this object with the username and password.
00157
00158   It cannot be safely done in the constructor because we need to return failure
00159   when neccessary.
00160 ------------------------------------------------------------------------------*/
00161 HRESULT  CImpAuth::Set(
00162       /* in */       LPWSTR    wszUserName,
00163       /* in */       LPWSTR    wszPassword)
00164 {
00165    if((NULL == wszUserName)
00166       || (NULL == wszPassword))
00167    {
00168       return E_INVALIDARG;
00169    }
00170
00171    m_wszUserName = DuplicateWSTR(wszUserName);
00172    if(NULL == m_wszUserName)
00173    {
00174       return E_OUTOFMEMORY;
00175    }
00176
00177    m_wszPassword = DuplicateWSTR(wszPassword);
00178    if(NULL == m_wszPassword)
00179    {
00180       delete [] m_wszPassword;
00181       return E_OUTOFMEMORY;
00182    }
00183
00184    return S_OK;
00185 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/EDITCTLS.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

EDITCTLS.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE: EditCtls.c
00009 //
00010 //  PURPOSE: Handles the UI Edit controls to get data from user and display
00011 //    data recieved from the COMM port.
00012 //
00013 //  EXPORTED FUNCTIONS:  These functions are for use by other modules.
00014 //    InitEditCtls              - Initialize the edit controls.
00015 //    SizeEditCtls              - Size and resize the edit controls.
00016 //    SetFocusEditCtls          - Set the focus to the correct edit control.
00017 //    WriteToDisplayCtl         - Write a string to the Display edit control.
00018 //    PostWriteToDisplayCtl     - Posts a message to the UI thread
00019 //                                with data to write.
00020 //
00021 //  INTERNAL FUNCTIONS:  These functions are for this module only.
00022 //    SubclassInputEditProc     - Subclass proc to catch the 'enter' keystroke.
00023 //
00024 // COMMENTS:
00025 //   This sample uses exceptionally simple terminal emulation: none.
00026 //   There are two edit controls involved.  One for the user to type the
00027 //   outgoing strings (called the InputCtl) and another to display both
00028 //   transmitted and received strings (called the DisplayCtl).  There is
00029 //   absolutely *no* translation of incoming strings, and the only
00030 //   modifications to outgoing strings is to append "/r/n" to it.
00031 //
00032 //   This sample only emulates line mode transmission.  The string is only
00033 //   read from the InputCtl when the 'Enter' key is typed.
00034 //
00035
00036 #include <windows.h>
00037 #include <string.h>
00038 #include "globals.h"
00039 #include "EditCtls.h"
00040 #include "CommCode.h"
00041 #include "toolbar.h"
00042 #include "statbar.h"
00043
00044 // Maximum size of Edit control buffers
00045
00046 #define MAXDISPLAYSIZE 0xF000  // Almost 64K
00047 #define MAXINPUTSIZE 0x400      // 1K
00048
00049 #define PWM_WRITESTRING WM_USER + 741 // Arbitrary number
00050
00051 HWND hWndInputCtl;      // Edit control to get input from user
00052 HWND hWndDisplayCtl;    // Edit control to display all output
00053 HWND hWndParent;        // Parent window of edit controls
00054
00055 WNDPROC lpfnInputEdit;  // Storage for subclassed edit control function
00056
00057
00058 // Prototype for the subclassed procedure.
00059 LRESULT CALLBACK SubclassInputEditProc(
00060     HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00061
00062
00063 //
00064 //  FUNCTION: InitEditCtls(HWND)
00065 //
00066 //  PURPOSE: Initialize the UI edit controls.
00067 //
00068 //  PARAMETERS:
00069 //    hWndMain - The window that is to contain the edit controls.
00070 //
00071 //  RETURN VALUE:
00072 //    TRUE if the edit controls are successfully initialized.
00073 //
00074 //  COMMENTS:
00075 //    This function should only need to be called once, when
00076 //    creating the main window.  The only reason it could fail
00077 //    is if the edit controls couldn't be created.
00078 //
00079
00080 BOOL InitEditCtls(HWND hWndMain)
00081 {
00082     hWndParent = hWndMain;
00083
00084     if (!hWndMain)
00085     {
00086         OutputDebugString("Invalid parent hWnd for EditCtls!\n");
00087         return FALSE;
00088     }
00089
00090     hWndDisplayCtl = CreateWindowEx(
00091         WS_EX_CLIENTEDGE,
00092         "EDIT","",
00093         WS_CHILD | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE
00094         | ES_OEMCONVERT | WS_VISIBLE | WS_BORDER,
00095         0, 0, 0, 0, hWndParent,
00096         NULL, hInst, NULL);
00097
00098     hWndInputCtl = CreateWindowEx(
00099         WS_EX_CLIENTEDGE,
00100         "EDIT","",
00101         WS_CHILD | ES_AUTOHSCROLL | WS_VISIBLE | WS_BORDER,
00102         0, 0, 0, 0, hWndParent,
00103         NULL, hInst, NULL);
00104
00105     if (!hWndDisplayCtl || !hWndInputCtl)
00106     {
00107         OutputDebugString("Unable to create EditCtls.\n");
00108         return FALSE;
00109     }
00110
00111     SendMessage(hWndInputCtl, EM_LIMITTEXT, MAXINPUTSIZE, 0);
00112     SendMessage(hWndDisplayCtl, EM_LIMITTEXT, MAXDISPLAYSIZE, 0);
00113
00114         // This is where we subclass the input edit control
00115         // so we can catch the 'enter' keystroke
00116     lpfnInputEdit = (WNDPROC)
00117         SetWindowLongPtr(hWndInputCtl, GWLP_WNDPROC, (LONG_PTR)SubclassInputEditProc);
00118
00119     return TRUE;
00120 }
00121
00122
00123 //
00124 //  FUNCTION: SizeEditCtls
00125 //
00126 //  PURPOSE: Sizes, resizes and positions the edit controls.
00127 //
00128 //  PARAMETERS:
00129 //    none
00130 //
00131 //  RETURN VALUE:
00132 //    none
00133 //
00134 //  COMMENTS:
00135 //    Anytime the parent window is resized, it needs to signal
00136 //    the edit controls to also resize.  The size of the edit
00137 //    controls assumes that the edit controls are going to
00138 //    contain the full client area of the parent, allowing for
00139 //    the toolbar and statusbar.
00140 //
00141
00142 void SizeEditCtls()
00143 {
00144     RECT rectParent, rectTemp;
00145     LONG HeightToolbar, HeightStatusbar;
00146     LONG HeightDisplayCtl, HeightInputCtl;
00147     LONG WidthCtls;
00148     LONG yposTopInputCtl, yposTopDisplayCtl;
00149     HDC hdc;
00150     TEXTMETRIC tm;
00151
00152     // Get the client area of the parent.
00153     if (!GetClientRect(hWndParent, &rectParent))
00154     {
00155         OutputDebugString("GetClientRect on EditCtls parent failed\n");
00156         return;
00157     }
00158
00159     // leave a pixel on each side
00160     WidthCtls = rectParent.right - 2;
00161
00162     // Allow for the toolbar at the top.
00163     GetWindowRect(hWndToolbar, &rectTemp);
00164     HeightToolbar = rectTemp.bottom - rectTemp.top;
00165
00166     // Allow for the statusbar at the bottom.
00167     GetWindowRect(hWndStatusbar, &rectTemp);
00168     HeightStatusbar = rectTemp.bottom - rectTemp.top;
00169
00170     // How high should the input control be?
00171     hdc = GetDC(hWndInputCtl);
00172     GetTextMetrics(hdc, &tm);
00173     ReleaseDC(hWndInputCtl, hdc);
00174     HeightInputCtl = tm.tmHeight + tm.tmExternalLeading + 6;
00175         // 6 == 3 extra pixels between text and edit control vertical borders.
00176
00177     // Position Input control.
00178     yposTopInputCtl = rectParent.bottom - HeightStatusbar - HeightInputCtl - 1;
00179
00180     // Position Display control.
00181     yposTopDisplayCtl = rectParent.top + HeightToolbar + 2;
00182     HeightDisplayCtl = yposTopInputCtl - yposTopDisplayCtl - 1;
00183
00184     // Move them both.
00185     MoveWindow(
00186         hWndInputCtl,
00187         1, yposTopInputCtl,
00188         WidthCtls, HeightInputCtl,
00189         TRUE);
00190
00191     MoveWindow(
00192         hWndDisplayCtl,
00193         1, yposTopDisplayCtl,
00194         WidthCtls, HeightDisplayCtl,
00195         TRUE);
00196 }
00197
00198
00199 //
00200 //  FUNCTION: SetFocusEditCtls
00201 //
00202 //  PURPOSE: Sets the focus to the correct edit control.
00203 //
00204 //  PARAMETERS:
00205 //    none
00206 //
00207 //  RETURN VALUE:
00208 //    none
00209 //
00210 //  COMMENTS:
00211 //    Everytime the parent window gets focus, it needs to signal
00212 //    the edit controls to set focus also.  This very simple
00213 //    algorythm always sets focus to the Input control.
00214 //
00215
00216 void SetFocusEditCtls()
00217 {
00218     DefWindowProc(hWndParent, WM_SETFOCUS, (WPARAM) NULL, (LPARAM) NULL);
00219
00220     if (GetFocus() == hWndParent)
00221         SetFocus(hWndInputCtl);
00222
00223     return;
00224 }
00225
00226
00227 //
00228 //  FUNCTION: SubclassInputEditProc
00229 //
00230 //  PURPOSE: Subclass proceedure of Input control.
00231 //
00232 //  PARAMETERS:
00233 //    Standard WNDPROC parameters.
00234 //
00235 //  RETURN VALUE:
00236 //    Standard WNDPROC return value.
00237 //
00238 //  COMMENTS:
00239 //    We subclass the Input edit control so that we can catch the 'Enter'
00240 //    keystroke (VK_RETURN).  This is how we know when the user wants to
00241 //    transmit something to the COMM port.  This indeed means that only
00242 //    line based terminal emulation is supported by this sample.  However,
00243 //    it makes editing the outgoing text much easier.
00244 //
00245 //    WriteCommString is the call that writes a string to the COMM port.
00246 //    However, the string that is written *must* be allocated with
00247 //    LocalAlloc, and if WriteCommString succeeds, then it will also
00248 //    LocalFree the string.  If WriteCommString fails, then it refused
00249 //    the string and its our job to free it.
00250 //
00251
00252 LRESULT CALLBACK SubclassInputEditProc(
00253     HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00254 {
00255     switch(message)
00256     {
00257         case WM_CHAR:
00258
00259             // Found a RETURN keystroke!
00260             if ((TCHAR) wParam == VK_RETURN)
00261             {
00262
00263                 LPSTR pszString;
00264                 long lSizeofString;
00265
00266                 // Get the size of the string to send.
00267                 lSizeofString =
00268                     (LONG)SendMessage(hWndInputCtl, WM_GETTEXTLENGTH, 0, 0);
00269
00270                 // Allocate enough space for the string and "\r\0"
00271                 if (!(pszString = (LPSTR) LocalAlloc(LPTR, lSizeofString +2)))
00272                   break;
00273
00274                 // Get the string
00275                 SendMessage(hWndInputCtl, WM_GETTEXT,
00276                     lSizeofString + 1, (LPARAM) pszString);
00277
00278                 // Terminate it.
00279                 strncat(pszString, "\r",lSizeofString+1);
00280         pszString[lSizeofString+1] = '\0';
00281                 lSizeofString += 1;
00282
00283                 // If the write to Comm failed, its probably because
00284                 // a connection isn't made yet.
00285                 if (WriteCommString(pszString, lSizeofString))
00286                 {
00287                     // This is what we'd do to local echo user input
00288                     // Unnecessary usually.
00289                     //WriteToOutputEdit(pszString, lSizeofString);
00290                     ;
00291                 }
00292                 else
00293                 {
00294                     WriteToDisplayCtl("Not yet connected\r", 20);
00295
00296                     // The comm code refused the string, so we must free it.
00297                     LocalFree(pszString);
00298                 }
00299
00300                 // Clear the Input control.
00301                 SendMessage(hWndInputCtl, WM_SETTEXT, 0, (LPARAM) "");
00302
00303                 // Don't let default processing handle the RETURN key.
00304                 return 0;
00305             }
00306
00307             break;
00308
00309         case PWM_WRITESTRING:
00310             WriteToDisplayCtl((LPSTR) lParam, (DWORD) wParam);
00311             LocalFree((LPSTR) lParam);
00312             break;
00313
00314         default:
00315             break;
00316     }
00317     return CallWindowProc(lpfnInputEdit, hWnd, message, wParam, lParam);
00318 }
00319
00320
00321 //
00322 //  FUNCTION: WriteToDisplayCtl(LPSTR, DWORD)
00323 //
00324 //  PURPOSE: Writes a string to the Display control.
00325 //
00326 //  PARAMETERS:
00327 //    lpNewString       - The string to display.
00328 //    dwSizeofNewString - The length of the string.
00329 //
00330 //  RETURN VALUE:
00331 //    none.
00332 //
00333 //  COMMENTS:
00334 //
00335
00336 void WriteToDisplayCtl(LPSTR lpNewString, DWORD dwSizeofNewString)
00337 {
00338     DWORD dwSizeofEdit;
00339
00340     dwSizeofEdit = (DWORD)SendMessage(hWndDisplayCtl, WM_GETTEXTLENGTH, 0, 0);
00341
00342     if ((dwSizeofEdit + dwSizeofNewString) > MAXDISPLAYSIZE)
00343     {
00344         // Suggestion for future additions:
00345         // Handle edit control overflow by deleting from top of edit control
00346     }
00347
00348     // Actually place the string into the Display control.
00349     SendMessage(hWndDisplayCtl, EM_SETSEL, dwSizeofEdit, dwSizeofEdit);
00350     SendMessage(hWndDisplayCtl, EM_REPLACESEL, 0, (LPARAM) lpNewString);
00351     SendMessage(hWndDisplayCtl, EM_SETSEL,
00352         dwSizeofEdit+dwSizeofNewString, dwSizeofEdit+dwSizeofNewString);
00353 }
00354
00355
00356 //
00357 //  FUNCTION: PostWriteToDisplayCtl(LPSTR, DWORD)
00358 //
00359 //  PURPOSE: Writes a string to the Display control.
00360 //
00361 //  PARAMETERS:
00362 //    lpNewString       - The string to display.
00363 //    dwSizeofNewString - The length of the string.
00364 //
00365 //  RETURN VALUE:
00366 //    none.
00367 //
00368 //  COMMENTS:
00369 //
00370 //    Its very important that when data is recieved from the comm port,
00371 //    the thread reading the comm port doesn't have to wait for the
00372 //    data to be interpreted.  Instead, it posts the data to the main UI
00373 //    thread to be handled when it is convenient.  This is the API to
00374 //    wrap up the PostMessage.
00375 //
00376 //    Note that the string posted must be LocalAlloc()d, and its the job
00377 //    of the window recieving the message to LocalFree it.
00378 //
00379
00380 BOOL PostWriteToDisplayCtl(LPSTR lpNewString, DWORD dwSizeofNewString)
00381 {
00382     return PostMessage(hWndInputCtl, PWM_WRITESTRING,
00383         (WPARAM)dwSizeofNewString, (LPARAM) lpNewString);
00384 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/tsfapp.cpp Source File

  • WinUI
  • tsfapp

tsfapp.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          TSFApp.cpp
00013
00014    Description:   Main Windows App Implementation
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    Include Files
00020 **************************************************************************/
00021
00022 #include "TSFWnd.h"
00023
00024 /**************************************************************************
00025    Local Function Prototypes
00026 **************************************************************************/
00027
00028 int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
00029
00030 /**************************************************************************
00031    Global Variables
00032 **************************************************************************/
00033
00034 ITfThreadMgr    *g_pThreadMgr;
00035
00036 /**************************************************************************
00037
00038    WinMain()
00039
00040 **************************************************************************/
00041
00042 int WINAPI WinMain( HINSTANCE hInstance,
00043                     HINSTANCE hPrevInstance,
00044                     LPSTR lpCmdLine,
00045                     int nCmdShow)
00046 {
00047     CTSFMainWnd *pMainWnd;
00048     int         nReturn = 0;
00049
00050     CoInitialize(NULL);
00051
00052     pMainWnd = new CTSFMainWnd(hInstance);
00053
00054     if(NULL == pMainWnd)
00055     {
00056         return 0;
00057     }
00058
00059     if(pMainWnd->Initialize(nCmdShow))
00060     {
00061         ITfKeystrokeMgr *pKeyMgr;
00062         ITfMessagePump  *pMsgPump;
00063
00064         // get the keystroke manager interfce
00065         if(SUCCEEDED(g_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr, (void **)&pKeyMgr)))
00066         {
00067             // get the message pump wrapper interface
00068             if(SUCCEEDED(g_pThreadMgr->QueryInterface(IID_ITfMessagePump, (void **)&pMsgPump)))
00069             {
00070                 BOOL    fResult = TRUE;
00071
00072                 while(fResult)
00073                 {
00074                     MSG     msg;
00075                     BOOL    fEaten;
00076
00077                     /*
00078                     Get the next message in the queue. fResult receives FALSE if WM_QUIT is encountered
00079                     */
00080                     if(FAILED(pMsgPump->GetMessage(&msg, NULL, 0, 0, &fResult)))
00081                     {
00082                         fResult = FALSE;
00083                     }
00084                     else if(WM_KEYDOWN == msg.message)
00085                     {
00086                         // does an ime want it?
00087                         if (pKeyMgr->TestKeyDown(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten &&
00088                             pKeyMgr->KeyDown(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten)
00089                         {
00090                             continue;
00091                         }
00092                     }
00093                     else if(WM_KEYUP == msg.message)
00094                     {
00095                         // does an ime want it?
00096                         if (pKeyMgr->TestKeyUp(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten &&
00097                             pKeyMgr->KeyUp(msg.wParam, msg.lParam, &fEaten) == S_OK && fEaten)
00098                         {
00099                             continue;
00100                         }
00101                     }
00102
00103                     if(fResult)
00104                     {
00105                         TranslateMessage(&msg);
00106                         DispatchMessage(&msg);
00107                     }
00108
00109                     if(WM_QUIT == msg.message)
00110                     {
00111                         nReturn = (int)msg.wParam;
00112                     }
00113                 }
00114
00115                 pMsgPump->Release();
00116             }
00117
00118             pKeyMgr->Release();
00119         }
00120     }
00121
00122     delete pMainWnd;
00123
00124     CoUninitialize();
00125
00126     return nReturn;
00127 }
00128
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/About.h Source File

  • Web
  • MSAgent
  • c
  • Cap

About.h

Go to the documentation of this file.
00001 #ifndef _About_h_
00002 #define _About_h_
00003
00004
00005 // Standard About Dialog
00006
00007 class AboutDlg {
00008 public:
00009   AboutDlg();
00010    ~AboutDlg();
00011
00012     void  DoModal(HWND hWndParent, short sAgentVersionMajor, short sAgentVersionMinor);
00013
00014
00015 private:
00016   BOOL  OnInitDialog();
00017
00018
00019 private:
00020   HWND  m_hWnd;
00021   HICON m_hIcon;
00022   RECT  m_rcIcon;
00023   short m_sAgentMajor;
00024   short m_sAgentMinor;
00025
00026
00027 private:
00028   friend BOOL CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00029 };
00030
00031
00032 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DHCP/DHCPNotify/dhcpnotify.cpp Source File

  • NetDS
  • DHCP
  • DHCPNotify

dhcpnotify.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright © 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008  *
00009  * Author: Stephen R. Husak - Microsoft Developer Support
00010  *
00011  * Abstract:
00012  *    This code demonstrates the use of the DHCP Client Options API -
00013  *    DhcpRegisterParamChange/DhcpDeRegisterParamChange
00014  */
00015
00016 /*
00017  * Includes
00018  */
00019 #include <windows.h>      // windows
00020 #include <stdio.h>        // standard i/o
00021 #include <iphlpapi.h>     // ip helper
00022 #include <dhcpcsdk.h>     // dhcp client options api
00023
00024 // Exit Event Handler
00025 HANDLE g_hExitEvent;
00026
00027 /*
00028  * OutputError
00029  *
00030  * retrieves the system message for an error
00031  */
00032 void OutputError(DWORD dwError)
00033 {
00034   LPVOID lpMsgBuf;    // buffer to copy string into (allocated by call)
00035
00036   if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
00037                 FORMAT_MESSAGE_FROM_SYSTEM |
00038                 FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwError,
00039                 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00040                 (LPTSTR) &lpMsgBuf, 0, NULL) == 0)
00041     printf("Error Reported: %d GetLastError: %d\n", dwError, GetLastError());
00042   else
00043     {
00044     printf("Error %d: %s\n", dwError, (LPCSTR) lpMsgBuf);
00045
00046     // free the buffer.
00047     LocalFree(lpMsgBuf);
00048     }
00049 }
00050
00051 /*
00052  * DetermineAdapter
00053  *
00054  * NOTE:
00055  *
00056  *    This code retrieves the Adapter Name to use for the DHCP Client API
00057  *    using the IPHelper API.
00058  *
00059  *    NT has a name for the adapter that through this API has device
00060  *    information in front of it followed by a {GUID}, 98 does not and
00061  *    the Index is used instead. So if the string is set to ?? (what it is
00062  *    in 98) we revert to using the string representation of the index.
00063  *
00064  */
00065 LPSTR DetermineAdapter()
00066 {
00067   DWORD dwResult;                            // result of API calls
00068   IP_INTERFACE_INFO * pInfo = NULL;          // adapter information structure
00069   DWORD dwSize = 0;                          // size of required buffer
00070   CHAR szAdapter[MAX_ADAPTER_NAME] = {0};    // the adapter to use
00071   char * ptr;                                // pointer to adapter name
00072
00073   // get buffer size
00074   dwResult = GetInterfaceInfo(NULL, &dwSize);
00075   if (dwResult == ERROR_INSUFFICIENT_BUFFER)
00076     {
00077     // allocate buffer
00078     pInfo = (IP_INTERFACE_INFO *) LocalAlloc(LPTR, dwSize);
00079     if (!pInfo)
00080       {
00081       OutputError(GetLastError());
00082       exit(1);
00083       }
00084
00085     // make the actual call
00086     dwResult = GetInterfaceInfo(pInfo, &dwSize);
00087     if (dwResult != ERROR_SUCCESS)
00088       {
00089       OutputError(GetLastError());
00090       exit(2);
00091       }
00092     }
00093   else
00094     {
00095     OutputError(GetLastError());
00096     exit(3);
00097     }
00098
00099   // convert, parse, and convert back
00100   ptr = NULL;
00101   WideCharToMultiByte(0, 0, pInfo->Adapter[0].Name,
00102                             lstrlenW(pInfo->Adapter[0].Name),
00103                             szAdapter, MAX_ADAPTER_NAME, NULL, NULL);
00104   if (szAdapter[0] != '?')
00105     {
00106     // find the GUID
00107     ptr = strchr(szAdapter, '{');
00108     }
00109
00110   // use index if the pointer is not set
00111   if (!ptr)
00112     {
00113     sprintf(szAdapter, "%ld\0", pInfo->Adapter[0].Index);
00114     ptr = szAdapter;
00115     }
00116
00117   // free what was allocated
00118   if (pInfo)
00119     LocalFree(pInfo);
00120
00121   return ptr;
00122 }
00123
00124 /*
00125  * CtrlHandler
00126  *
00127  * handle control events to provide graceful cleanup
00128  */
00129 BOOL WINAPI CtrlHandler(DWORD dwCtrlType)
00130 {
00131   printf("\n\nStop Event Received... Aborting... \n\n");
00132
00133   switch (dwCtrlType)
00134     {
00135     case CTRL_C_EVENT:
00136     case CTRL_BREAK_EVENT:
00137     case CTRL_SHUTDOWN_EVENT:
00138     case CTRL_LOGOFF_EVENT:
00139     case CTRL_CLOSE_EVENT:
00140       SetEvent(g_hExitEvent);
00141       break;
00142     default:
00143       return FALSE;
00144     }
00145
00146   return TRUE;
00147 }
00148
00149 /*
00150  * main
00151  *
00152  * this is where it all happens
00153  */
00154 int main(int argc, char * argv[])
00155 {
00156   DWORD dwResult;                            // result from API call
00157   DWORD dwVersion;                           // API version reported
00158   WCHAR wszAdapter[MAX_ADAPTER_NAME] = {0};  // the adapter name in wide chars
00159   char * ptr;                                // pointer to adapter name
00160
00161   g_hExitEvent = CreateEvent(NULL, FALSE, FALSE, "DHCP_EXIT_EVENT");
00162   if (g_hExitEvent == NULL)
00163     OutputError(GetLastError());
00164
00165   SetConsoleCtrlHandler(CtrlHandler, true);
00166
00167   if (argc > 1)
00168     // use what's on the command line for the adapter ID
00169     ptr = argv[1];
00170   else
00171     // use IP Helper API to get the adapter ID to use
00172     ptr = DetermineAdapter();
00173
00174   // convert it for the API call
00175   MultiByteToWideChar(0, 0, ptr, (int) strlen(ptr), wszAdapter, MAX_ADAPTER_NAME);
00176
00177   // initialize the DHCP Client Options API
00178   dwResult = DhcpCApiInitialize(&dwVersion);
00179   if (dwResult != 0)
00180     {
00181     OutputError(dwResult);
00182     exit(4);
00183     }
00184   else
00185     printf("DHCP Client Options API version %d\n", dwVersion);
00186
00187   //
00188   // Here the watch is set up - since this is an easy example, the request
00189   // is set up statically, however in a real-world scenario this may require
00190   // building the watch array in a more 'dynamic' way
00191   //
00192   // Also for this sample we are using one item that is almost always in a
00193   // DHCP configuration.
00194   //
00195   // the DHCP Client Options API array for watching the options
00196   //
00197   DHCPCAPI_PARAMS watch[1] =
00198               {{0, OPTION_ROUTER_ADDRESS, FALSE, NULL, 0}}; // gateway address
00199
00200   // set-up the actual array
00201   DHCPCAPI_PARAMS_ARRAY watcharray = {1, watch}; // we are watching 1 item
00202
00203   printf("Watching DHCP Options Change on Adapter [%S]\n", wszAdapter);
00204
00205   HANDLE hEvent;  // handle that will be set when parameter(s) change
00206
00207   // make the request on the adapter
00208   dwResult = DhcpRegisterParamChange(DHCPCAPI_REGISTER_HANDLE_EVENT,
00209                                      NULL,
00210                                      wszAdapter,
00211                                      NULL,
00212                                      watcharray,
00213                                      &hEvent);
00214
00215   // wait for the events to become signaled
00216   if (dwResult == ERROR_SUCCESS)
00217     {
00218     HANDLE lpHandles[2] = {g_hExitEvent, hEvent};
00219     DWORD rc = 0;
00220
00221     while (rc = WaitForMultipleObjects(2, lpHandles, FALSE, INFINITE))
00222       {
00223       if (rc == WAIT_OBJECT_0)
00224         break;
00225
00226       ResetEvent(hEvent);
00227       printf("Parameter has changed.\n");
00228
00229       // the change could then be read and applied as needed
00230       // see the sample DHCPREQUEST or the DhcpRequestParams() API
00231       // for more information
00232       }
00233     }
00234   else
00235     {
00236     OutputError(dwResult);
00237     }
00238
00239   dwResult = DhcpDeRegisterParamChange(DHCPCAPI_REGISTER_HANDLE_EVENT,
00240                                        NULL, &hEvent);
00241   if (dwResult != ERROR_SUCCESS)
00242     OutputError(dwResult);
00243
00244   // de-init the api
00245   DhcpCApiCleanup();
00246
00247   // close out the exit event handle
00248   CloseHandle(g_hExitEvent);
00249
00250   return 0;
00251 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cmainwindow.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cmainwindow.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CMAINWINDOW.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 //////////////////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 //////////////////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016 #include "version.h"  //ABOUT Box
00017
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // Defines
00021 //
00022 /////////////////////////////////////////////////////////////////////////////
00023 enum
00024 {
00025   STATUSBAR_TEXT  = 0,
00026   STATUSBAR_DESC  = 1
00027 } STATUSBAR;
00028
00029
00030 ////////////////////////////////////////////////////////////////
00031 // CMainWindow::CMainWindow
00032 //
00033 /////////////////////////////////////////////////////////////////
00034 CMainWindow::CMainWindow()
00035 {
00036   //Objects
00037   m_pCRootBinder    = NULL;
00038   m_pCFullConnect   = NULL;
00039   m_pCOptionsSheet  = NULL;
00040   m_pCRootEnumerator  = NULL;
00041   m_pCServiceComp   = NULL;
00042   m_pCDataLinks   = NULL;
00043   m_pCListener    = NULL;
00044
00045   //Controls
00046   m_pCMDITrace    = NULL;
00047   m_pCMDIObjects    = NULL;
00048
00049   //Cursors
00050   m_hCurSizeNS    = NULL;
00051   m_hLibRichEdit20  = NULL;
00052   m_hLibRichEdit10  = NULL;
00053
00054   //Bitmaps
00055   m_hImageList    = ImageList_LoadImage(GetAppLite()->m_hInstance, MAKEINTRESOURCE(IDB_IMAGE), 16, 16, CLR_DEFAULT , IMAGE_BITMAP, LR_DEFAULTCOLOR);
00056   m_hStateList    = ImageList_LoadImage(GetAppLite()->m_hInstance, MAKEINTRESOURCE(IDB_STATE), 16, 16, CLR_DEFAULT , IMAGE_BITMAP, LR_DEFAULTCOLOR);
00057
00058   //make sure NULL is an option to pass into JoinTransaction as the transaction pointer
00059   m_listTransactions.AddTail(NULL);
00060 }
00061
00062
00063 ////////////////////////////////////////////////////////////////
00064 // CMainWindow::~CMainWindow
00065 //
00066 /////////////////////////////////////////////////////////////////
00067 CMainWindow::~CMainWindow()
00068 {
00069   ITransaction  *pITransaction  = NULL;
00070
00071   while(!m_listTransactions.IsEmpty())
00072   {
00073     //get first in list
00074     pITransaction = m_listTransactions.GetHead();
00075     //Remove from list
00076     m_listTransactions.RemoveHead();
00077
00078     //make sure this isn't the NULL option
00079     if (pITransaction)
00080     {
00081       //make sure the txn is stopped
00082       pITransaction->Abort(NULL,FALSE,FALSE);
00083     }
00084     //Free pITransaction
00085     SAFE_RELEASE(pITransaction);
00086   }
00087
00088   SAFE_RELEASE(m_pCRootEnumerator);
00089   SAFE_RELEASE(m_pCRootBinder);
00090   SAFE_DELETE(m_pCFullConnect);
00091   SAFE_RELEASE(m_pCServiceComp);
00092   SAFE_RELEASE(m_pCDataLinks);
00093   SAFE_RELEASE(m_pCListener);
00094
00095   if(m_hLibRichEdit20)
00096     FreeLibrary(m_hLibRichEdit20);
00097   if(m_hLibRichEdit10)
00098     FreeLibrary(m_hLibRichEdit10);
00099
00100   SAFE_DELETE(m_pCMDIObjects);
00101   SAFE_DELETE(m_pCMDITrace);
00102
00103   //Options
00104   if(m_pCOptionsSheet)
00105     m_pCOptionsSheet->SaveOptions();
00106   SAFE_DELETE(m_pCOptionsSheet);
00107 }
00108
00109
00110 /////////////////////////////////////////////////////////////////////////////
00111 // CMainWindow::OnCreate
00112 //
00113 /////////////////////////////////////////////////////////////////////////////
00114 BOOL CMainWindow::OnCreate(LPCREATESTRUCT lpCreateStruct)
00115 {
00116   //Create the client area first...
00117   CMDIFrameLite::OnCreate(lpCreateStruct);
00118
00119   //Load Saved Settings
00120   LoadSettings();
00121
00122   //ToolBar
00123   const static TBBUTTON rgButtons[] =
00124   {
00125     { 0, IDM_FULLCONNECT,               TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00126     { 1, IDM_FULLDISCONNECT,              TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00127     { 0, 0,                       TBSTATE_ENABLED,  TBSTYLE_SEP,  0L, 0},
00128     { 2, IDM_IDBCREATESESSION_CREATESESSION,      TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00129     { 0, 0,                       TBSTATE_ENABLED,  TBSTYLE_SEP,  0L, 0},
00130     { 3, IDM_OPENROWSET,                TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00131     { 4, IDM_EXECUTE,                 TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00132     { 0, 0,                       TBSTATE_ENABLED,  TBSTYLE_SEP,  0L, 0},
00133     { 5, IDM_RESTARTPOSITION,             TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00134     { 6, IDM_REFRESH,                 TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00135     { 7, IDM_GETSCHEMAROWSET,             TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00136     { 0, 0,                       TBSTATE_ENABLED,  TBSTYLE_SEP,  0L, 0},
00137     { 8, IDM_SETDATA,                 TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00138     { 9, IDM_INSERTROW,                 TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00139     {10, IDM_DELETEROWS,                TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00140     { 0, 0,                       TBSTATE_ENABLED,  TBSTYLE_SEP,  0L, 0},
00141     {11, IDM_UPDATE,                  TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00142     {12, IDM_UNDO,                    TBSTATE_ENABLED,  TBSTYLE_BUTTON, 0L, 0},
00143     { 0, 0,                       TBSTATE_ENABLED,  TBSTYLE_SEP,  0L, 0},
00144   };
00145   m_CToolBar.Create(m_hWnd, ID_TOOLBAR, IDB_TOOLBAR, NUMELE(rgButtons), (TBBUTTON*)rgButtons);
00146
00147   //Status Bar...
00148   m_CStatusBar.Create(m_hWnd, ID_STATUSBAR);
00149   m_CStatusBar.SetText(L"", STATUSBAR_TEXT, 0/*SBT_NOBORDERS*/);
00150   m_CStatusBar.SetText(L"", STATUSBAR_DESC, 0);
00151
00152   //Controls
00153   m_pCListener    = new CListener();
00154   m_pCMDITrace    = new CMDITrace(this);
00155   m_pCMDIObjects    = new CMDIObjects(this);
00156
00157   //See if we can load the new version RichEdit Controls
00158   //NOTE:  We always need to load the older one, since the Dialog Resource uses the old "RICHEDIT".
00159   //The newer one, we will try and use for the tracing window...
00160   m_hLibRichEdit20 = LoadLibrary("RICHED20.DLL");
00161
00162   //All systems must have the RichEdit controls for RowsetViewer to work.
00163   //The resource, (built with the VC resource editor, hard codes to the 1.0 version = richedt32)
00164   //So dialogs will not appear if for some reason this dialog or its dependencies are missing...
00165   GETLASTERROR(m_hLibRichEdit10 = LoadLibrary("RICHED32.DLL"));
00166
00167   //Objects
00168   m_pCFullConnect   = new CFullConnect(this);
00169   m_pCOptionsSheet  = new COptionsSheet;
00170   m_pCRootBinder    = new CBinder(this);
00171   m_pCRootEnumerator  = new CEnumerator(this);
00172   m_pCServiceComp   = new CServiceComp(this);
00173
00174   //Deferred Objects
00175   m_pCDataLinks   = NULL;
00176
00177   //Load Cursors
00178   m_hCurSizeNS = LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS));
00179
00180   //Register this window for Drag and Drop capabilities...
00181   DragAcceptFiles(m_hWnd, TRUE/*fAccept*/);
00182   return TRUE;
00183 }
00184
00185
00186 /////////////////////////////////////////////////////////////////////////////
00187 // CMainWindow::OnInitialUpdate
00188 //
00189 /////////////////////////////////////////////////////////////////////////////
00190 BOOL CMainWindow::OnInitialUpdate()
00191 {
00192   //Make sure the MDIClient area is sized correctly before displaying the
00193   //MDIChild windows...
00194   SIZE size = GetClientSize(m_hWnd);
00195   POINTS pts = { (SHORT)size.cx, (SHORT)size.cy };
00196   OnSize(0, pts);
00197
00198   //Display the Objects Window
00199   //NOTE: We display the objects window first so we can use the
00200   //font from the tree with our output window...
00201   OnObjectsWindow();
00202
00203   //Display the Trace Window
00204   OnTraceWindow();
00205
00206   //Update the Controls
00207   UpdateControls();
00208   return TRUE;
00209 }
00210
00211
00212 /////////////////////////////////////////////////////////////////////////////
00213 // CMainWindow::OnDestroy
00214 //
00215 /////////////////////////////////////////////////////////////////////////////
00216 BOOL CMainWindow::OnDestroy()
00217 {
00218   //Save Settings
00219   SaveSettings();
00220
00221   //Remove all MDIChildren....
00222   RemoveAllChildren();
00223
00224   //Now remove the MDI Objects Tree window
00225   MDIDestroy(m_pCMDIObjects->m_hWnd);
00226   //Now remove the MDI Trace window
00227   MDIDestroy(m_pCMDITrace->m_hWnd);
00228
00229   //Unregister this window for Drag and Drop capabilities...
00230   DragAcceptFiles(m_hWnd, FALSE/*fAccept*/);
00231
00232   //Delegate
00233   return CMDIFrameLite::OnDestroy();
00234 }
00235
00236
00237 ////////////////////////////////////////////////////////////////
00238 // CMainWindow::DisplayDialog
00239 //
00240 /////////////////////////////////////////////////////////////////
00241 INT_PTR   CMainWindow::DisplayDialog(UINT uID, HWND hWndParent, DLGPROC lpDialogFunc, CBase* pCObject, UINT idSource)
00242 {
00243   m_idSource = idSource;
00244   m_pCSource = pCObject;
00245   return ::DisplayDialog(uID, hWndParent, lpDialogFunc, (LPARAM)this);
00246 }
00247
00248
00249 /////////////////////////////////////////////////////////////////////////////
00250 // CMainWindow::OnDropFiles
00251 //
00252 /////////////////////////////////////////////////////////////////////////////
00253 BOOL CMainWindow::OnDropFiles(HDROP hDrop)
00254 {
00255   //Obtain the number of files...
00256   UINT cFiles = DragQueryFile(hDrop, (UINT)-1, NULL, 0);
00257
00258   //For every file...
00259   for(ULONG iFile=0; iFile<cFiles; iFile++)
00260   {
00261     WCHAR wszFileName[_MAX_PATH];
00262     WCHAR wszExt[_MAX_EXT];
00263
00264     if(IsUnicodeOS())
00265     {
00266       DragQueryFileW(hDrop, iFile, wszFileName, NUMELE(wszFileName));
00267     }
00268     else
00269     {
00270       CHAR szFileName[_MAX_PATH]={0};
00271       DragQueryFileA(hDrop, iFile, szFileName, NUMELE(szFileName));
00272       ConvertToWCHAR(szFileName, wszFileName, _MAX_PATH);
00273     }
00274
00275     _wsplitpath(wszFileName, NULL, NULL, NULL, wszExt);
00276     {
00277       //Load the UDL file
00278       OnLoadStringFromStorage(wszFileName);
00279     }
00280   }
00281
00282   return TRUE;
00283 }
00284
00285
00286 /////////////////////////////////////////////////////////////////////////////
00287 // CMainWindow::OnUpdateCommand
00288 //
00289 /////////////////////////////////////////////////////////////////////////////
00290 BOOL CMainWindow::OnUpdateCommand(HMENU hMenu, UINT nID, DWORD* pdwFlags)
00291 {
00292   //Determine the source object for this menu
00293   SOURCE eSource = (SOURCE)GetMenuData(hMenu, 0, TRUE/*fByPosition*/);
00294
00295   //Is there an active object, make sure its the same type as the selected object
00296   CBase*  pCObject  = m_pCMDIObjects->m_pCObjTree->GetSelectedObject();
00297   if(pCObject && pCObject->GetObjectType() != eSource)
00298     pCObject = NULL;
00299
00300   //Reset Resent Configurations
00301   if(GetMenuItemID(hMenu, 0)==IDM_RECENTCONFIG1)
00302   {
00303     WCHAR wszBuffer[MAX_NAME_LEN+10];
00304     CHAR  szBuffer[MAX_NAME_LEN+10];
00305     CList<WCHAR*,WCHAR*>* pCList = &m_pCFullConnect->m_listConfigs;
00306
00307     ASSERT(pCList);
00308     LONG cRecentConfigs = pCList->GetCount();
00309
00310     //Remove all menu items
00311     if(cRecentConfigs)
00312     {
00313       INT iMenuItems = GetMenuItemCount(hMenu);
00314       for(INT i=0; i<iMenuItems; i++)
00315         DeleteMenu(hMenu, 0, MF_BYPOSITION);
00316     }
00317
00318     //Display all Recent Configs
00319     for(LONG i=0; i<cRecentConfigs; i++)
00320     {
00321       StringFormat(wszBuffer, NUMELE(wszBuffer), L"&%d - %s", i+1, pCList->GetAt(pCList->FindIndex(i)));
00322       ConvertToMBCS(wszBuffer, szBuffer, NUMELE(szBuffer));
00323       AppendMenu(hMenu, MF_STRING, IDM_RECENTCONFIG1 + i, szBuffer);
00324     }
00325   }
00326
00327   //Reset Resent Files
00328   if(GetMenuItemID(hMenu, 0)==IDM_RECENTFILE1)
00329   {
00330     CHAR szBuffer[MAX_NAME_LEN+10];
00331     WCHAR wszBuffer[MAX_NAME_LEN+10];
00332     CList<WCHAR*,WCHAR*>* pCList = &m_pCFullConnect->m_listFiles;
00333
00334     ASSERT(pCList);
00335     LONG cRecentFiles = pCList->GetCount();
00336
00337     //Remove all menu items
00338     if(cRecentFiles)
00339     {
00340       INT iMenuItems = GetMenuItemCount(hMenu);
00341       for(INT i=0; i<iMenuItems; i++)
00342         DeleteMenu(hMenu, 0, MF_BYPOSITION);
00343     }
00344
00345     //Display all Recent Files
00346     for(LONG i=0; i<cRecentFiles; i++)
00347     {
00348       StringFormat(wszBuffer, NUMELE(wszBuffer), L"&%d - %s", i+1, pCList->GetAt(pCList->FindIndex(i)));
00349       ConvertToMBCS(wszBuffer, szBuffer, NUMELE(szBuffer));
00350       AppendMenu(hMenu, MF_STRING, IDM_RECENTFILE1 + i, szBuffer);
00351     }
00352   }
00353
00354   switch(nID)
00355   {
00356     ///////////////////////////////////////////////////////////////////
00357     // File Menu
00358     //
00359     ///////////////////////////////////////////////////////////////////
00360     ON_COMMAND_UI_ENABLED(IDM_FULLCONNECT,                  TRUE)
00361     ON_COMMAND_UI_ENABLED(IDM_FULLDISCONNECT,               GetActiveWindow(L"MDICHILD") ? TRUE : FALSE)
00362     //----------------------------
00363     ON_COMMAND_UI_ENABLED(IDM_CREATE_ROOTBINDER,              TRUE)
00364     ON_COMMAND_UI_ENABLED(IDM_CREATE_ROOTENUMERATOR,            TRUE)
00365     ON_COMMAND_UI_ENABLED(IDM_CREATE_SERVICECOMPONENTS,           TRUE)
00366     ON_COMMAND_UI_ENABLED(IDM_CREATE_DATALINKS,               TRUE)
00367     //----------------------------
00368     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG1,                m_pCFullConnect->m_listConfigs.GetCount())
00369     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG2,                m_pCFullConnect->m_listConfigs.GetCount())
00370     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG3,                m_pCFullConnect->m_listConfigs.GetCount())
00371     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG4,                m_pCFullConnect->m_listConfigs.GetCount())
00372     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG5,                m_pCFullConnect->m_listConfigs.GetCount())
00373     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG6,                m_pCFullConnect->m_listConfigs.GetCount())
00374     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG7,                m_pCFullConnect->m_listConfigs.GetCount())
00375     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG8,                m_pCFullConnect->m_listConfigs.GetCount())
00376     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG9,                m_pCFullConnect->m_listConfigs.GetCount())
00377     ON_COMMAND_UI_ENABLED(IDM_RECENTCONFIG10,               m_pCFullConnect->m_listConfigs.GetCount())
00378     //----------------------------
00379     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE1,                  m_pCFullConnect->m_listFiles.GetCount())
00380     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE2,                  m_pCFullConnect->m_listFiles.GetCount())
00381     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE3,                  m_pCFullConnect->m_listFiles.GetCount())
00382     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE4,                  m_pCFullConnect->m_listFiles.GetCount())
00383     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE5,                  m_pCFullConnect->m_listFiles.GetCount())
00384     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE6,                  m_pCFullConnect->m_listFiles.GetCount())
00385     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE7,                  m_pCFullConnect->m_listFiles.GetCount())
00386     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE8,                  m_pCFullConnect->m_listFiles.GetCount())
00387     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE9,                  m_pCFullConnect->m_listFiles.GetCount())
00388     ON_COMMAND_UI_ENABLED(IDM_RECENTFILE10,                 m_pCFullConnect->m_listFiles.GetCount())
00389     //----------------------------
00390     ON_COMMAND_UI_ENABLED(IDM_EXIT,                     TRUE)
00391
00392
00393     ///////////////////////////////////////////////////////////////////
00394     // Unknown
00395     //
00396     ///////////////////////////////////////////////////////////////////
00397     ON_COMMAND_UI_ENABLED(IDM_UNKNOWN_ADDREF,               SOURCE_GETINTERFACE(pCObject, IUnknown))
00398     ON_COMMAND_UI_ENABLED(IDM_IUNKNOWN_RELEASE,               SOURCE_GETINTERFACE(pCObject, IUnknown))
00399     ON_COMMAND_UI_ENABLED(IDM_IUNKNOWN_QUERYINTERFACE,            SOURCE_GETINTERFACE(pCObject, IUnknown))
00400     ON_COMMAND_UI_ENABLED(IDM_IUNKNOWN_AUTOQI,                SOURCE_GETINTERFACE(pCObject, IUnknown))
00401     ON_COMMAND_UI_ENABLED(IDM_IUNKNOWN_RELEASEALL,              SOURCE_GETINTERFACE(pCObject, IUnknown))
00402     ON_COMMAND_UI_ENABLED(IDM_IUNKNOWN_RELEASECHILDREN,           SOURCE_GETINTERFACE(pCObject, IUnknown))
00403     //----------------------------
00404     ON_COMMAND_UI_ENABLED(IDM_ISUPPORTERRORINFO,              SOURCE_GETINTERFACE(pCObject, ISupportErrorInfo))
00405
00406
00407
00408     ///////////////////////////////////////////////////////////////////
00409     // DataSource
00410     //
00411     ///////////////////////////////////////////////////////////////////
00412     ON_COMMAND_UI_ENABLED(IDM_DATASOURCE_ADDREF,              SOURCE_GETINTERFACE(pCObject, IUnknown))
00413     //----------------------------
00414     ON_COMMAND_UI_ENABLED(IDM_IDBINITIALIZE_INITIALIZE,           SOURCE_GETINTERFACE(pCObject, IDBInitialize))
00415     ON_COMMAND_UI_ENABLED(IDM_IDBINITIALIZE_UNINITIALIZE,         SOURCE_GETINTERFACE(pCObject, IDBInitialize))
00416     ON_COMMAND_UI_ENABLED(IDM_IDBCREATESESSION_CREATESESSION,       SOURCE_GETINTERFACE(pCObject, IDBCreateSession))
00417     ON_COMMAND_UI_ENABLED(IDM_IDBPROPERTIES_GETPROPERTYINFO,        SOURCE_GETINTERFACE(pCObject, IDBProperties))
00418     ON_COMMAND_UI_ENABLED(IDM_IDBPROPERTIES_GETPROPERTIES,          SOURCE_GETINTERFACE(pCObject, IDBProperties))
00419     ON_COMMAND_UI_ENABLED(IDM_IDBPROPERTIES_SETPROPERTIES,          SOURCE_GETINTERFACE(pCObject, IDBProperties))
00420     ON_COMMAND_UI_ENABLED(IDM_IPERSIST_GETCLASSID,              SOURCE_GETINTERFACE(pCObject, IPersist))
00421     //----------------------------
00422     ON_COMMAND_UI_ENABLED(IDM_ICPC_FINDCONNECTIONPOINT,           SOURCE_GETINTERFACE(pCObject, IConnectionPointContainer))
00423     ON_COMMAND_UI_ENABLED(IDM_ICPC_ENUMCONNECTIONPOINTS,          FALSE)
00424     ON_COMMAND_UI_ENABLED(IDM_IDBASYNCHSTATUS_ABORT,            SOURCE_GETINTERFACE(pCObject, IDBAsynchStatus))
00425     ON_COMMAND_UI_ENABLED(IDM_IDBASYNCHSTATUS_GETSTATUS,          SOURCE_GETINTERFACE(pCObject, IDBAsynchStatus))
00426     ON_COMMAND_UI_ENABLED(IDM_IDATASOURCEADMIN_CREATEDATASOURCE,      SOURCE_GETINTERFACE(pCObject, IDBDataSourceAdmin))
00427     ON_COMMAND_UI_ENABLED(IDM_IDATASOURCEADMIN_DESTROYDATASOURCE,     SOURCE_GETINTERFACE(pCObject, IDBDataSourceAdmin))
00428     ON_COMMAND_UI_ENABLED(IDM_IDATASOURCEADMIN_GETCREATIONPROPERTIES,   SOURCE_GETINTERFACE(pCObject, IDBDataSourceAdmin))
00429     ON_COMMAND_UI_ENABLED(IDM_IDATASOURCEADMIN_MODIFYDATASOURCE,      SOURCE_GETINTERFACE(pCObject, IDBDataSourceAdmin))
00430     ON_COMMAND_UI_ENABLED(IDM_IDBINFO_GETKEYWORDS,              SOURCE_GETINTERFACE(pCObject, IDBInfo))
00431     ON_COMMAND_UI_ENABLED(IDM_IDBINFO_GETLITERALINFO,           SOURCE_GETINTERFACE(pCObject, IDBInfo))
00432     ON_COMMAND_UI_ENABLED(IDM_IPERSISTFILE_LOAD,              SOURCE_GETINTERFACE(pCObject, IPersistFile))
00433     ON_COMMAND_UI_ENABLED(IDM_IPERSISTFILE_SAVE,              SOURCE_GETINTERFACE(pCObject, IPersistFile))
00434     ON_COMMAND_UI_ENABLED(IDM_IPERSISTFILE_SAVECOMPLETED,         SOURCE_GETINTERFACE(pCObject, IPersistFile))
00435     ON_COMMAND_UI_ENABLED(IDM_IPERSISTFILE_GETCURFILE,            SOURCE_GETINTERFACE(pCObject, IPersistFile))
00436     ON_COMMAND_UI_ENABLED(IDM_IPERSISTFILE_ISDIRTY,             SOURCE_GETINTERFACE(pCObject, IPersistFile))
00437     //----------------------------
00438     ON_COMMAND_UI_ENABLED(IDM_IGETPOOL_GETPOOL,               FALSE)
00439     ON_COMMAND_UI_ENABLED(IDM_IGETPOOL_GETPOOLSTATE,            FALSE)
00440     ON_COMMAND_UI_ENABLED(IDM_ISERVICEPROVIDER,               SOURCE_GETINTERFACE(pCObject, IServiceProvider))
00441     //----------------------------
00442
00443
00444
00445     ///////////////////////////////////////////////////////////////////
00446     // Session
00447     //
00448     ///////////////////////////////////////////////////////////////////
00449     ON_COMMAND_UI_ENABLED(IDM_SESSION_ADDREF,               SOURCE_GETINTERFACE(pCObject, IUnknown))
00450     //----------------------------
00451     ON_COMMAND_UI_ENABLED(IDM_GETDATASOURCE,                SOURCE_GETINTERFACE(pCObject, IGetDataSource))
00452     ON_COMMAND_UI_ENABLED(IDM_OPENROWSET,                 SOURCE_GETINTERFACE(pCObject, IOpenRowset))
00453     ON_COMMAND_UI_ENABLED(IDM_ISESSIONPROPERTIES_GETPROPERTIES,       SOURCE_GETINTERFACE(pCObject, ISessionProperties))
00454     ON_COMMAND_UI_ENABLED(IDM_ISESSIONPROPERTIES_SETPROPERTIES,       SOURCE_GETINTERFACE(pCObject, ISessionProperties))
00455     //----------------------------
00456     ON_COMMAND_UI_ENABLED(IDM_IDBCREATECOMMAND_CREATECOMMAND,       SOURCE_GETINTERFACE(pCObject, IDBCreateCommand))
00457     ON_COMMAND_UI_ENABLED(IDM_GETSCHEMAS,                 SOURCE_GETINTERFACE(pCObject, IDBSchemaRowset))
00458     ON_COMMAND_UI_ENABLED(IDM_GETSCHEMAROWSET,                SOURCE_GETINTERFACE(pCObject, IDBSchemaRowset))
00459     ON_COMMAND_UI_ENABLED(IDM_INDEX_CREATEINDEX,              SOURCE_GETINTERFACE(pCObject, IIndexDefinition))
00460     ON_COMMAND_UI_ENABLED(IDM_INDEX_DROPINDEX,                SOURCE_GETINTERFACE(pCObject, IIndexDefinition))
00461     ON_COMMAND_UI_ENABLED(IDM_INDEX_ALTERINDEX,               SOURCE_GETINTERFACE(pCObject, IAlterIndex))
00462     ON_COMMAND_UI_ENABLED(IDM_TABLE_CREATETABLE,              SOURCE_GETINTERFACE(pCObject, ITableDefinition))
00463     ON_COMMAND_UI_ENABLED(IDM_TABLE_ADDCOLUMN,                SOURCE_GETINTERFACE(pCObject, ITableDefinition))
00464     ON_COMMAND_UI_ENABLED(IDM_TABLE_DROPCOLUMN,               SOURCE_GETINTERFACE(pCObject, ITableDefinition))
00465     ON_COMMAND_UI_ENABLED(IDM_TABLE_DROPTABLE,                SOURCE_GETINTERFACE(pCObject, ITableDefinition))
00466     ON_COMMAND_UI_ENABLED(IDM_TABLE_CREATETABLEWITHCONSTRAINTS,       NULL); //SOURCE_GETINTERFACE(pCObject, ITableDefinitionWithConstraints))
00467     ON_COMMAND_UI_ENABLED(IDM_TABLE_ADDCONSTRAINT,              SOURCE_GETINTERFACE(pCObject, ITableDefinitionWithConstraints))
00468     ON_COMMAND_UI_ENABLED(IDM_TABLE_DROPCONSTRAINT,             SOURCE_GETINTERFACE(pCObject, ITableDefinitionWithConstraints))
00469     ON_COMMAND_UI_ENABLED(IDM_TABLE_ALTERTABLE,               SOURCE_GETINTERFACE(pCObject, IAlterTable))
00470     ON_COMMAND_UI_ENABLED(IDM_TABLE_ALTERCOLUMN,              SOURCE_GETINTERFACE(pCObject, IAlterTable))
00471     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONLOCAL_GETOPTIONSOBJECT,     SOURCE_GETINTERFACE(pCObject, ITransactionLocal))
00472     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONLOCAL_STARTTRANSACTION,     SOURCE_GETINTERFACE(pCObject, ITransactionLocal))
00473     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONOBJECT_GETTRANSACTIONOBJECT,    SOURCE_GETINTERFACE(pCObject, ITransactionObject))
00474     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONJOIN_GETOPTIONSOBJECT,      SOURCE_GETINTERFACE(pCObject, ITransactionJoin))
00475     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONJOIN_JOINTRANSACTION,       SOURCE_GETINTERFACE(pCObject, ITransactionJoin))
00476     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONJOIN_RELEASETRANSACTION,      SOURCE_GETINTERFACE(pCObject, ITransactionJoin))
00477 #ifdef MTSTXN
00478     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONDISPENSOR_BEGINTRANSACTION,   SOURCE_GETINTERFACE(pCObject, ITransactionJoin))
00479 #else  //MTSTXN
00480     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONDISPENSOR_BEGINTRANSACTION,   FALSE)
00481 #endif //MTSTXN
00482     //----------------------------
00483     //----------------------------
00484
00485
00486     ////////////////////////////////////////////////////////////////
00487     // Command
00488     //
00489     ////////////////////////////////////////////////////////////////
00490     ON_COMMAND_UI_ENABLED(IDM_COMMAND_ADDREF,               SOURCE_GETINTERFACE(pCObject, IUnknown))
00491     //----------------------------
00492     ON_COMMAND_UI_ENABLED(IDM_IACCESSOR_GETBINDINGS,            SOURCE_GETINTERFACE(pCObject, IAccessor))
00493     ON_COMMAND_UI_ENABLED(IDM_IACCESSOR_ADDREFACCESSOR,           SOURCE_GETINTERFACE(pCObject, IAccessor))
00494     ON_COMMAND_UI_ENABLED(IDM_IACCESSOR_RELEASEACCESSOR,          SOURCE_GETINTERFACE(pCObject, IAccessor))
00495     ON_COMMAND_UI_ENABLED(IDM_IACCESSOR_CREATEACCESSOR,           SOURCE_GETINTERFACE(pCObject, IAccessor))
00496     ON_COMMAND_UI_ENABLED(IDM_ICOLUMNSINFO_GETCOLUMNINFO,         SOURCE_GETINTERFACE(pCObject, IColumnsInfo))
00497     ON_COMMAND_UI_ENABLED(IDM_ICOLUMNSINFO_MAPCOLUMNIDS,          FALSE)
00498     ON_COMMAND_UI_ENABLED(IDM_EXECUTE,                    SOURCE_GETINTERFACE(pCObject, ICommand))
00499     ON_COMMAND_UI_ENABLED(IDM_COMMAND_CANCEL,               SOURCE_GETINTERFACE(pCObject, ICommand))
00500     ON_COMMAND_UI_ENABLED(IDM_COMMAND_GETDBSESSION,             SOURCE_GETINTERFACE(pCObject, ICommand))
00501     ON_COMMAND_UI_ENABLED(IDM_COMMAND_GETPROPERTIES,            SOURCE_GETINTERFACE(pCObject, ICommandProperties))
00502     ON_COMMAND_UI_ENABLED(IDM_COMMAND_SETPROPERTIES,            SOURCE_GETINTERFACE(pCObject, ICommandProperties))
00503     ON_COMMAND_UI_ENABLED(IDM_SETCOMMANDTEXT,               SOURCE_GETINTERFACE(pCObject, ICommandText))
00504     ON_COMMAND_UI_ENABLED(IDM_GETCOMMANDTEXT,               SOURCE_GETINTERFACE(pCObject, ICommandText))
00505     ON_COMMAND_UI_ENABLED(IDM_SETCOMMANDSTREAM,               SOURCE_GETINTERFACE(pCObject, ICommandStream))
00506     ON_COMMAND_UI_ENABLED(IDM_GETCOMMANDSTREAM,               SOURCE_GETINTERFACE(pCObject, ICommandStream))
00507     ON_COMMAND_UI_ENABLED(IDM_COMMANDTEXT_EXECUTE,              SOURCE_GETINTERFACE(pCObject, ICommandText))
00508     ON_COMMAND_UI_ENABLED(IDM_ICONVERTTYPE_CANCONVERT,            SOURCE_GETINTERFACE(pCObject, IConvertType))
00509     //----------------------------
00510     ON_COMMAND_UI_ENABLED(IDM_ICOLUMNSROWSET_GETCOLUMNSROWSET,        SOURCE_GETINTERFACE(pCObject, IColumnsRowset))
00511     ON_COMMAND_UI_ENABLED(IDM_ICOLUMNSROWSET_GETAVAILABLECOLUMNS,     FALSE)
00512     ON_COMMAND_UI_ENABLED(IDM_COMMANDPREPARE,               SOURCE_GETINTERFACE(pCObject, ICommandPrepare))
00513     ON_COMMAND_UI_ENABLED(IDM_COMMANDUNPREPARE,               SOURCE_GETINTERFACE(pCObject, ICommandPrepare))
00514     ON_COMMAND_UI_ENABLED(IDM_COMMANDPERSIST_DELETECOMMAND,         SOURCE_GETINTERFACE(pCObject, ICommandPersist))
00515     ON_COMMAND_UI_ENABLED(IDM_COMMANDPERSIST_GETCURRENTCOMMAND,       SOURCE_GETINTERFACE(pCObject, ICommandPersist))
00516     ON_COMMAND_UI_ENABLED(IDM_COMMANDPERSIST_LOADCOMMAND,         SOURCE_GETINTERFACE(pCObject, ICommandPersist))
00517     ON_COMMAND_UI_ENABLED(IDM_COMMANDPERSIST_SAVECOMMAND,         SOURCE_GETINTERFACE(pCObject, ICommandPersist))
00518     ON_COMMAND_UI_ENABLED(IDM_GETPARAMETERINFO,               SOURCE_GETINTERFACE(pCObject, ICommandWithParameters))
00519     ON_COMMAND_UI_ENABLED(IDM_SETPARAMETERINFO,               SOURCE_GETINTERFACE(pCObject, ICommandWithParameters))
00520     ON_COMMAND_UI_ENABLED(IDM_MAPPARAMETERNAMES,              FALSE)
00521     //----------------------------
00522     //----------------------------
00523     ON_COMMAND_UI_ENABLED(IDM_COMMAND_CLEARCOMMAND,             SOURCE_GETINTERFACE(pCObject, ICommand))
00524
00525
00526     ///////////////////////////////////////////////////////////////////
00527     // Rowset
00528     //
00529     ///////////////////////////////////////////////////////////////////
00530     ON_COMMAND_UI_ENABLED(IDM_ROWSET_ADDREF,                SOURCE_GETINTERFACE(pCObject, IUnknown))
00531     //----------------------------
00532     ON_COMMAND_UI_ENABLED(IDM_GETDATA,                    SOURCE_GETINTERFACE(pCObject, IRowset))
00533     ON_COMMAND_UI_ENABLED(IDM_GETNEXTROWS,                  SOURCE_GETINTERFACE(pCObject, IRowset))
00534     ON_COMMAND_UI_ENABLED(IDM_RELEASEROWS,                  SOURCE_GETINTERFACE(pCObject, IRowset))
00535     ON_COMMAND_UI_ENABLED(IDM_ADDREFROWS,                 SOURCE_GETINTERFACE(pCObject, IRowset))
00536     ON_COMMAND_UI_ENABLED(IDM_REFRESH,                    SOURCE_GETINTERFACE(pCObject, IRowset))
00537     ON_COMMAND_UI_ENABLED(IDM_RESTARTPOSITION,                SOURCE_GETINTERFACE(pCObject, IRowset))
00538     ON_COMMAND_UI_ENABLED(IDM_RELEASEALLROWS,               SOURCE_GETINTERFACE(pCObject, IRowset))
00539
00540     ON_COMMAND_UI_ENABLED(IDM_IROWSET_GETPROPERTIES,            SOURCE_GETINTERFACE(pCObject, IRowsetInfo))
00541     ON_COMMAND_UI_ENABLED(IDM_GETSPECIFICATION,               SOURCE_GETINTERFACE(pCObject, IRowsetInfo))
00542     ON_COMMAND_UI_ENABLED(IDM_GETREFERENCEDROWSET,              SOURCE_GETINTERFACE(pCObject, IRowsetInfo))
00543     //----------------------------
00544     ON_COMMAND_UI_ENABLED(IDM_INSERTROW,                  SOURCE_GETINTERFACE(pCObject, IRowsetChange))
00545     ON_COMMAND_UI_ENABLED(IDM_DELETEROWS,                 SOURCE_GETINTERFACE(pCObject, IRowsetChange))
00546     ON_COMMAND_UI_ENABLED(IDM_SETDATA,                    SOURCE_GETINTERFACE(pCObject, IRowsetChange))
00547     ON_COMMAND_UI_ENABLED(IDM_IROWSETFIND_FINDNEXTROW,            SOURCE_GETINTERFACE(pCObject, IRowsetFind))
00548     ON_COMMAND_UI_ENABLED(IDM_IROWSETINDENTITY_ISSAMEROW,         SOURCE_GETINTERFACE(pCObject, IRowsetIdentity))
00549     ON_COMMAND_UI_ENABLED(IDM_IROWSETLOCATE_GETDATA,            SOURCE_GETINTERFACE(pCObject, IRowsetLocate))
00550     ON_COMMAND_UI_ENABLED(IDM_IROWSETLOCATE_COMPARE,            SOURCE_GETINTERFACE(pCObject, IRowsetLocate))
00551     ON_COMMAND_UI_ENABLED(IDM_IROWSETLOCATE_GETROWSAT,            SOURCE_GETINTERFACE(pCObject, IRowsetLocate))
00552     ON_COMMAND_UI_ENABLED(IDM_IROWSETLOCATE_GETROWSBYBOOKMARK,        SOURCE_GETINTERFACE(pCObject, IRowsetLocate))
00553     ON_COMMAND_UI_ENABLED(IDM_IROWSETLOCATE_HASH,             SOURCE_GETINTERFACE(pCObject, IRowsetLocate))
00554     ON_COMMAND_UI_ENABLED(IDM_IROWSETBOOKMARK_POSITIONONBOOKMARK,     SOURCE_GETINTERFACE(pCObject, IRowsetBookmark))
00555     ON_COMMAND_UI_ENABLED(IDM_GETVISIBLEDATA,               SOURCE_GETINTERFACE(pCObject, IRowsetResynch))
00556     ON_COMMAND_UI_ENABLED(IDM_RESYNCHROWS,                  SOURCE_GETINTERFACE(pCObject, IRowsetResynch))
00557     ON_COMMAND_UI_ENABLED(IDM_GETLASTVISIBLEDATA,             SOURCE_GETINTERFACE(pCObject, IRowsetRefresh))
00558     ON_COMMAND_UI_ENABLED(IDM_REFRESHVISIBLEDATA,             SOURCE_GETINTERFACE(pCObject, IRowsetRefresh))
00559     ON_COMMAND_UI_ENABLED(IDM_IROWSETSCROLL_GETDATA,            SOURCE_GETINTERFACE(pCObject, IRowsetScroll))
00560     ON_COMMAND_UI_ENABLED(IDM_IROWSETSCROLL_GETAPPROXIMATEPOSITION,     SOURCE_GETINTERFACE(pCObject, IRowsetScroll))
00561     ON_COMMAND_UI_ENABLED(IDM_IROWSETSCROLL_GETROWSATRATIO,         FALSE)
00562     ON_COMMAND_UI_ENABLED(IDM_UNDO,                     SOURCE_GETINTERFACE(pCObject, IRowsetUpdate))
00563     ON_COMMAND_UI_ENABLED(IDM_UPDATE,                   SOURCE_GETINTERFACE(pCObject, IRowsetUpdate))
00564     ON_COMMAND_UI_ENABLED(IDM_GETPENDINGROWS,               SOURCE_GETINTERFACE(pCObject, IRowsetUpdate))
00565     ON_COMMAND_UI_ENABLED(IDM_GETROWSTATUS,                 SOURCE_GETINTERFACE(pCObject, IRowsetUpdate))
00566     ON_COMMAND_UI_ENABLED(IDM_GETORIGINALDATA,                SOURCE_GETINTERFACE(pCObject, IRowsetUpdate))
00567     //----------------------------
00568     ON_COMMAND_UI_ENABLED(IDM_GETROWFROMHROW,               SOURCE_GETINTERFACE(pCObject, IGetRow))
00569     ON_COMMAND_UI_ENABLED(IDM_GETURLFROMHROW,               SOURCE_GETINTERFACE(pCObject, IGetRow))
00570     //----------------------------
00571     ON_COMMAND_UI_ENABLED(IDM_CREATE_ROWPOSITION,             TRUE)
00572     ON_COMMAND_UI_ENABLED(IDM_IROWSET_CURSORENGINE,             FALSE)
00573     ON_COMMAND_UI_ENABLED(IDM_MSPERSIST_ROWSET_SAVE,            FALSE)
00574     ON_COMMAND_UI_ENABLED(IDM_MSPERSIST_ROWSET_LOAD,            FALSE)
00575
00576
00577
00578     ///////////////////////////////////////////////////////////////////
00579     // Row
00580     //
00581     ///////////////////////////////////////////////////////////////////
00582     ON_COMMAND_UI_ENABLED(IDM_ROW_ADDREF,                 SOURCE_GETINTERFACE(pCObject, IUnknown))
00583     //----------------------------
00584     ON_COMMAND_UI_ENABLED(IDM_IROW_GETCOLUMNS,                SOURCE_GETINTERFACE(pCObject, IRow))
00585     ON_COMMAND_UI_ENABLED(IDM_IROW_GETSOURCEROWSET,             SOURCE_GETINTERFACE(pCObject, IRow))
00586     ON_COMMAND_UI_ENABLED(IDM_IROW_OPEN,                  SOURCE_GETINTERFACE(pCObject, IRow))
00587     ON_COMMAND_UI_ENABLED(IDM_IGETSESSION_GETSESSION,           SOURCE_GETINTERFACE(pCObject, IGetSession))
00588     //----------------------------
00589     ON_COMMAND_UI_ENABLED(IDM_ICOLUMNSINFO2_GETRESTRICTEDCOLUMNINFO,    FALSE)
00590     ON_COMMAND_UI_ENABLED(IDM_IROW_SETCOLUMNS,                SOURCE_GETINTERFACE(pCObject, IRowChange))
00591     ON_COMMAND_UI_ENABLED(IDM_IROW_ADDCOLUMNS,                FALSE)
00592     ON_COMMAND_UI_ENABLED(IDM_IROW_DELETECOLUMNS,             SOURCE_GETINTERFACE(pCObject, IRowSchemaChange))
00593     ON_COMMAND_UI_ENABLED(IDM_ISCOPEDOPERATIONS_OPENROWSET,         SOURCE_GETINTERFACE(pCObject, IScopedOperations))
00594     ON_COMMAND_UI_ENABLED(IDM_ISCOPEDOPERATIONS_DELETE,           SOURCE_GETINTERFACE(pCObject, IScopedOperations))
00595     ON_COMMAND_UI_ENABLED(IDM_ISCOPEDOPERATIONS_COPY,           SOURCE_GETINTERFACE(pCObject, IScopedOperations))
00596     ON_COMMAND_UI_ENABLED(IDM_ISCOPEDOPERATIONS_MOVE,           SOURCE_GETINTERFACE(pCObject, IScopedOperations))
00597     //----------------------------
00598     //----------------------------
00599
00600
00601     ///////////////////////////////////////////////////////////////////
00602     // Error Object
00603     //
00604     ///////////////////////////////////////////////////////////////////
00605     ON_COMMAND_UI_ENABLED(IDM_ERROR_ADDREF,                 SOURCE_GETINTERFACE(pCObject, IUnknown))
00606     //----------------------------
00607     ON_COMMAND_UI_ENABLED(IDM_ERRORINFO_GETDESCRIPTION,           SOURCE_GETINTERFACE(pCObject, IErrorInfo))
00608     ON_COMMAND_UI_ENABLED(IDM_ERRORINFO_GETGUID,              SOURCE_GETINTERFACE(pCObject, IErrorInfo))
00609     ON_COMMAND_UI_ENABLED(IDM_ERRORINFO_GETHELPCONTEXT,           SOURCE_GETINTERFACE(pCObject, IErrorInfo))
00610     ON_COMMAND_UI_ENABLED(IDM_ERRORINFO_GETHELPFILE,            SOURCE_GETINTERFACE(pCObject, IErrorInfo))
00611     ON_COMMAND_UI_ENABLED(IDM_ERRORINFO_GETSOURCE,              SOURCE_GETINTERFACE(pCObject, IErrorInfo))
00612     ON_COMMAND_UI_ENABLED(IDM_ERRORRECORDS_GETRECORDCOUNT,          SOURCE_GETINTERFACE(pCObject, IErrorRecords))
00613     ON_COMMAND_UI_ENABLED(IDM_ERRORRECORDS_GETCUSTOMERROROBJECT,      SOURCE_GETINTERFACE(pCObject, IErrorRecords))
00614     ON_COMMAND_UI_ENABLED(IDM_ERRORRECORDS_GETERRORINFO,          SOURCE_GETINTERFACE(pCObject, IErrorRecords))
00615     //----------------------------
00616     ON_COMMAND_UI_ENABLED(IDM_GETERRORINFO,                 TRUE)
00617     ON_COMMAND_UI_ENABLED(IDM_SETERRORINFO,                 TRUE)
00618     ON_COMMAND_UI_ENABLED(IDM_DISPLAYERRORINFO,               TRUE)
00619     //----------------------------
00620
00621
00622     ///////////////////////////////////////////////////////////////////
00623     // Custom Error Object
00624     //
00625     ///////////////////////////////////////////////////////////////////
00626     ON_COMMAND_UI_ENABLED(IDM_CUSTOMERROR_ADDREF,             SOURCE_GETINTERFACE(pCObject, IUnknown))
00627     //----------------------------
00628     ON_COMMAND_UI_ENABLED(IDM_SQLERRORINFO_GETSQLINFO,            SOURCE_GETINTERFACE(pCObject, ISQLErrorInfo))
00629     //----------------------------
00630
00631
00632     ///////////////////////////////////////////////////////////////////
00633     // Binder
00634     //
00635     ///////////////////////////////////////////////////////////////////
00636     ON_COMMAND_UI_ENABLED(IDM_BINDER_ADDREF,                SOURCE_GETINTERFACE(pCObject, IUnknown))
00637     //----------------------------
00638     ON_COMMAND_UI_ENABLED(IDM_IBINDRESOURCE_BIND,             SOURCE_GETINTERFACE(pCObject, IBindResource))
00639     ON_COMMAND_UI_ENABLED(IDM_ICREATEROW_CREATEROW,             SOURCE_GETINTERFACE(pCObject, ICreateRow))
00640     ON_COMMAND_UI_ENABLED(IDM_IDBBINDERPROPERTIES_RESET,          SOURCE_GETINTERFACE(pCObject, IDBBinderProperties))
00641     //----------------------------
00642     ON_COMMAND_UI_ENABLED(IDM_IREGISTERPROVIDER_SETURLMAPPING,        SOURCE_GETINTERFACE(pCObject, IRegisterProvider))
00643     ON_COMMAND_UI_ENABLED(IDM_IREGISTERPROVIDER_GETURLMAPPING,        SOURCE_GETINTERFACE(pCObject, IRegisterProvider))
00644     ON_COMMAND_UI_ENABLED(IDM_IREGISTERPROVIDER_UNREGISTERPROVIDER,     SOURCE_GETINTERFACE(pCObject, IRegisterProvider))
00645     //----------------------------
00646
00647
00648     ///////////////////////////////////////////////////////////////////
00649     // ConnectionPoint
00650     //
00651     ///////////////////////////////////////////////////////////////////
00652     ON_COMMAND_UI_ENABLED(IDM_CONNECTIONPOINT_ADDREF,           SOURCE_GETINTERFACE(pCObject, IUnknown))
00653     //----------------------------
00654     ON_COMMAND_UI_ENABLED(IDM_ICONNECTIONPOINT_GETCONNECTIONINTERFACE,    SOURCE_GETINTERFACE(pCObject, IConnectionPoint))
00655     ON_COMMAND_UI_ENABLED(IDM_ICONNECTIONPOINT_ADVISE,            SOURCE_GETINTERFACE(pCObject, IConnectionPoint))
00656     ON_COMMAND_UI_ENABLED(IDM_ICONNECTIONPOINT_UNADVISE,          SOURCE_GETINTERFACE(pCObject, IConnectionPoint))
00657     ON_COMMAND_UI_ENABLED(IDM_ICONNECTIONPOINT_ENUMCONNECTIONS,       FALSE)
00658     ON_COMMAND_UI_ENABLED(IDM_ICONNECTIONPOINT_GETCONNECTIONPOINTCONTAINER, FALSE)
00659     //----------------------------
00660     //----------------------------
00661
00662
00663     ///////////////////////////////////////////////////////////////////
00664     // Service Components
00665     //
00666     ///////////////////////////////////////////////////////////////////
00667     ON_COMMAND_UI_ENABLED(IDM_SERVICECOMP_ADDREF,                 SOURCE_GETINTERFACE(pCObject, IUnknown))
00668     //----------------------------
00669     ON_COMMAND_UI_ENABLED(IDM_IDATAINITIALIZE_CREATEDBINSTANCE,           SOURCE_GETINTERFACE(pCObject, IDataInitialize))
00670     ON_COMMAND_UI_ENABLED(IDM_IDATAINITIALIZE_CREATEDBINSTANCEEX,         SOURCE_GETINTERFACE(pCObject, IDataInitialize))
00671     ON_COMMAND_UI_ENABLED(IDM_IDATAINITIALIZE_LOADSTRINGFROMSTORAGE,        SOURCE_GETINTERFACE(pCObject, IDataInitialize))
00672     ON_COMMAND_UI_ENABLED(IDM_IDATAINITIALIZE_GETDATASOURCE,            SOURCE_GETINTERFACE(pCObject, IDataInitialize))
00673     ON_COMMAND_UI_ENABLED(IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING,        SOURCE_GETINTERFACE(pCObject, IDataInitialize))
00674     ON_COMMAND_UI_ENABLED(IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING_NOPASSWORD, SOURCE_GETINTERFACE(pCObject, IDataInitialize))
00675     ON_COMMAND_UI_ENABLED(IDM_IDATAINITIALIZE_WRITESTRINGTOSTORAGE,         SOURCE_GETINTERFACE(pCObject, IDataInitialize))
00676     ON_COMMAND_UI_ENABLED(IDM_CREATEFILEMONIKER,                  TRUE)
00677     //----------------------------
00678     ON_COMMAND_UI_ENABLED(IDM_POOLMNGR_ENUMPOOLS,                 FALSE)
00679     ON_COMMAND_UI_ENABLED(IDM_POOLMNGR_REFRESH,                   FALSE)
00680     //----------------------------
00681
00682
00683
00684     ///////////////////////////////////////////////////////////////////
00685     // Data Links
00686     //
00687     ///////////////////////////////////////////////////////////////////
00688     ON_COMMAND_UI_ENABLED(IDM_DATALINKS_ADDREF,                   SOURCE_GETINTERFACE(pCObject, IUnknown))
00689     //----------------------------
00690     ON_COMMAND_UI_ENABLED(IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE,         SOURCE_GETINTERFACE(pCObject, IDBPromptInitialize))
00691     ON_COMMAND_UI_ENABLED(IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE_ADVANCED,    SOURCE_GETINTERFACE(pCObject, IDBPromptInitialize))
00692     ON_COMMAND_UI_ENABLED(IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME,         SOURCE_GETINTERFACE(pCObject, IDBPromptInitialize))
00693     ON_COMMAND_UI_ENABLED(IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME_ADVANCED,      SOURCE_GETINTERFACE(pCObject, IDBPromptInitialize))
00694     //----------------------------
00695     //----------------------------
00696
00697
00698     ////////////////////////////////////////////////////////////////
00699     // Dataset
00700     //
00701     ////////////////////////////////////////////////////////////////
00702     ON_COMMAND_UI_ENABLED(IDM_DATASET_ADDREF,               SOURCE_GETINTERFACE(pCObject, IUnknown))
00703     //----------------------------
00704     ON_COMMAND_UI_ENABLED(IDM_DATASET_GETAXISINFO,              SOURCE_GETINTERFACE(pCObject, IMDDataset))
00705       ON_COMMAND_UI_ENABLED(IDM_DATASET_GETAXISROWSET,            SOURCE_GETINTERFACE(pCObject, IMDDataset))
00706       ON_COMMAND_UI_ENABLED(IDM_DATASET_GETCELLDATA,              SOURCE_GETINTERFACE(pCObject, IMDDataset))
00707       ON_COMMAND_UI_ENABLED(IDM_DATASET_FREEAXISINFO,             SOURCE_GETINTERFACE(pCObject, IMDDataset))
00708       ON_COMMAND_UI_ENABLED(IDM_DATASET_GETSPECIFICATION,           SOURCE_GETINTERFACE(pCObject, IMDDataset))
00709     //----------------------------
00710     ON_COMMAND_UI_ENABLED(IDM_IMDFIND_FINDCELL,               FALSE && SOURCE_GETINTERFACE(pCObject, IMDFind))
00711       ON_COMMAND_UI_ENABLED(IDM_IMDFIND_FINDTUPEL,              FALSE && SOURCE_GETINTERFACE(pCObject, IMDDataset))
00712     //----------------------------
00713     ON_COMMAND_UI_ENABLED(IDM_IMDRANGEROWSET_GETRANGEROWSET,        FALSE && SOURCE_GETINTERFACE(pCObject, IMDRangeRowset))
00714     //----------------------------
00715     //----------------------------
00716
00717
00718     ////////////////////////////////////////////////////////////////
00719     // Enumerator
00720     //
00721     ////////////////////////////////////////////////////////////////
00722     ON_COMMAND_UI_ENABLED(IDM_ENUMERATOR_ADDREF,              SOURCE_GETINTERFACE(pCObject, IUnknown))
00723     //----------------------------
00724     ON_COMMAND_UI_ENABLED(IDM_ISOURCESROWSET_GETSOURCESROWSET,        SOURCE_GETINTERFACE(pCObject, ISourcesRowset))
00725     //----------------------------
00726     //----------------------------
00727
00728
00729     ////////////////////////////////////////////////////////////////
00730     // MultipleResults
00731     //
00732     ////////////////////////////////////////////////////////////////
00733     ON_COMMAND_UI_ENABLED(IDM_MULTIPLERESULTS_ADDREF,           SOURCE_GETINTERFACE(pCObject, IUnknown))
00734     //----------------------------
00735     ON_COMMAND_UI_ENABLED(IDM_IMULTIPLERESULTS_GETRESULT,         SOURCE_GETINTERFACE(pCObject, IMultipleResults))
00736     //----------------------------
00737     //----------------------------
00738
00739
00740     ////////////////////////////////////////////////////////////////
00741     // Stream
00742     //
00743     ////////////////////////////////////////////////////////////////
00744     ON_COMMAND_UI_ENABLED(IDM_STREAM_ADDREF,                SOURCE_GETINTERFACE(pCObject, IUnknown))
00745     //----------------------------
00746     ON_COMMAND_UI_ENABLED(IDM_ISEQSTREAM_READ,                SOURCE_GETINTERFACE(pCObject, ISequentialStream))
00747     ON_COMMAND_UI_ENABLED(IDM_ISEQSTREAM_WRITE,               SOURCE_GETINTERFACE(pCObject, ISequentialStream))
00748     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_READ,                 SOURCE_GETINTERFACE(pCObject, IStream))
00749     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_WRITE,                SOURCE_GETINTERFACE(pCObject, IStream))
00750     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_SEEK,                 SOURCE_GETINTERFACE(pCObject, IStream))
00751     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_CLONE,                SOURCE_GETINTERFACE(pCObject, IStream))
00752     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_SETSIZE,                SOURCE_GETINTERFACE(pCObject, IStream) && FALSE)
00753     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_COPYTO,               SOURCE_GETINTERFACE(pCObject, IStream) && FALSE)
00754     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_COMMIT,               SOURCE_GETINTERFACE(pCObject, IStream) && FALSE)
00755     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_REVERT,               SOURCE_GETINTERFACE(pCObject, IStream) && FALSE)
00756     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_LOCKREGION,             SOURCE_GETINTERFACE(pCObject, IStream) && FALSE)
00757     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_UNLOCKREGION,             SOURCE_GETINTERFACE(pCObject, IStream) && FALSE)
00758     ON_COMMAND_UI_ENABLED(IDM_ISTREAM_STAT,                 SOURCE_GETINTERFACE(pCObject, IStream) && FALSE)
00759     ON_COMMAND_UI_ENABLED(IDM_ILOCKBYTES_READAT,              SOURCE_GETINTERFACE(pCObject, ILockBytes))
00760     ON_COMMAND_UI_ENABLED(IDM_ILOCKBYTES_WRITE,               SOURCE_GETINTERFACE(pCObject, ILockBytes))
00761     ON_COMMAND_UI_ENABLED(IDM_ILOCKBYTES_STAT,                SOURCE_GETINTERFACE(pCObject, ILockBytes) && FALSE)
00762     ON_COMMAND_UI_ENABLED(IDM_ILOCKBYTES_FLUSH,               SOURCE_GETINTERFACE(pCObject, ILockBytes) && FALSE)
00763     ON_COMMAND_UI_ENABLED(IDM_ILOCKBYTES_SETSIZE,             SOURCE_GETINTERFACE(pCObject, ILockBytes) && FALSE)
00764     ON_COMMAND_UI_ENABLED(IDM_ILOCKBYTES_LOCKREGION,            SOURCE_GETINTERFACE(pCObject, ILockBytes) && FALSE)
00765     ON_COMMAND_UI_ENABLED(IDM_ILOCKBYTES_UNLOCKREGION,            SOURCE_GETINTERFACE(pCObject, ILockBytes) && FALSE)
00766     //----------------------------
00767     //----------------------------
00768
00769
00770     ////////////////////////////////////////////////////////////////
00771     // PoolInfo
00772     //
00773     ////////////////////////////////////////////////////////////////
00774     ON_COMMAND_UI_ENABLED(IDM_POOLINFO_ADDREF,                SOURCE_GETINTERFACE(pCObject, IUnknown))
00775     //----------------------------
00776     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_REFRESH,              FALSE)
00777     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_GETCOUNT,             FALSE)
00778     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_GETPOOLID,              FALSE)
00779     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_GETPROTOTYPE,           FALSE)
00780     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_SETPOOLTIMEOUT,           FALSE)
00781     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_GETPOOLTIMEOUT,           FALSE)
00782     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_SETRETRYTIMEOUT,          FALSE)
00783     ON_COMMAND_UI_ENABLED(IDM_IPOOLINFO_GETRETRYTIMEOUT,          FALSE)
00784     //----------------------------
00785     //----------------------------
00786
00787
00788     ////////////////////////////////////////////////////////////////
00789     // RowPosition
00790     //
00791     ////////////////////////////////////////////////////////////////
00792     ON_COMMAND_UI_ENABLED(IDM_ROWPOS_ADDREF,                SOURCE_GETINTERFACE(pCObject, IUnknown))
00793     //----------------------------
00794     ON_COMMAND_UI_ENABLED(IDM_IROWPOS_INITIALIZE,             SOURCE_GETINTERFACE(pCObject, IRowPosition))
00795     ON_COMMAND_UI_ENABLED(IDM_IROWPOS_GETROWSET,              SOURCE_GETINTERFACE(pCObject, IRowPosition))
00796     ON_COMMAND_UI_ENABLED(IDM_IROWPOS_CLEARROWPOSITION,           SOURCE_GETINTERFACE(pCObject, IRowPosition))
00797     ON_COMMAND_UI_ENABLED(IDM_IROWPOS_SETROWPOSITION,           SOURCE_GETINTERFACE(pCObject, IRowPosition))
00798     ON_COMMAND_UI_ENABLED(IDM_IROWPOS_GETROWPOSITION,           SOURCE_GETINTERFACE(pCObject, IRowPosition))
00799     //----------------------------
00800     //----------------------------
00801
00802
00803     ///////////////////////////////////////////////////////////////////
00804     // Transaction
00805     //
00806     ///////////////////////////////////////////////////////////////////
00807     ON_COMMAND_UI_ENABLED(IDM_TRANSACTION_ADDREF,             SOURCE_GETINTERFACE(pCObject, IUnknown))
00808     //----------------------------
00809     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTION_ABORT,             SOURCE_GETINTERFACE(pCObject, ITransaction))
00810     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTION_COMMIT,              SOURCE_GETINTERFACE(pCObject, ITransaction))
00811     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTION_GETTRANSACTIONINFO,        SOURCE_GETINTERFACE(pCObject, ITransaction))
00812     //----------------------------
00813     //----------------------------
00814
00815
00816     ///////////////////////////////////////////////////////////////////
00817     // TransactionOptions
00818     //
00819     ///////////////////////////////////////////////////////////////////
00820     ON_COMMAND_UI_ENABLED(IDM_TRANSACTIONOPTIONS_ADDREF,          SOURCE_GETINTERFACE(pCObject, IUnknown))
00821     //----------------------------
00822     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONOPTIONS_GETOPTIONS,       SOURCE_GETINTERFACE(pCObject, ITransactionOptions))
00823     ON_COMMAND_UI_ENABLED(IDM_ITRANSACTIONOPTIONS_SETOPTIONS,       SOURCE_GETINTERFACE(pCObject, ITransactionOptions))
00824     //----------------------------
00825     //----------------------------
00826
00827
00828
00829     ///////////////////////////////////////////////////////////////////
00830     // Tools Menu
00831     //
00832     ///////////////////////////////////////////////////////////////////
00833     ON_COMMAND_UI_ENABLED(IDM_OPTIONS,                    TRUE)
00834     ON_COMMAND_UI_ENABLED(IDM_TRACEWINDOW,                  TRUE)
00835     ON_COMMAND_UI_ENABLED(IDM_OBJECTSWINDOW,                TRUE)
00836
00837     ///////////////////////////////////////////////////////////////////
00838     // Window Menu
00839     //
00840     ///////////////////////////////////////////////////////////////////
00841     ON_COMMAND_UI_ENABLED(IDM_CLOSEWINDOW,                  GetActiveWindow())
00842
00843     ON_COMMAND_UI_ENABLED(IDM_TILEHORIZONTAL,               GetActiveWindow())
00844     ON_COMMAND_UI_ENABLED(IDM_TILEVERTICAL,                 GetActiveWindow())
00845     ON_COMMAND_UI_ENABLED(IDM_CASCADE,                    GetActiveWindow())
00846     ON_COMMAND_UI_ENABLED(IDM_ARRANGEICONS,                 GetActiveWindow())
00847     ON_COMMAND_UI_ENABLED(IDM_AUTOPOSITION,                 GetActiveWindow())
00848     ON_COMMAND_UI_ENABLED(IDM_CLOSEALL,                   GetActiveWindow())
00849     ON_COMMAND_UI_ENABLED(IDM_NEXTWINDOW,                 GetActiveWindow())
00850     ON_COMMAND_UI_ENABLED(IDM_PREVWINDOW,                 GetActiveWindow())
00851
00852     //Help Menu
00853     ON_COMMAND_UI_ENABLED(IDM_ABOUT,                    TRUE)
00854   };
00855
00856   return CMDIFrameLite::OnUpdateCommand(hMenu, nID, pdwFlags);
00857 }
00858
00859
00860 /////////////////////////////////////////////////////////////////////////////
00861 // CMainWindow::OnCommand
00862 //
00863 /////////////////////////////////////////////////////////////////////////////
00864 BOOL CMainWindow::OnCommand(UINT iID, HWND hWndCtrl)
00865 {
00866   HRESULT hr = S_OK;
00867   DWORD dwValue = 0;
00868
00869   //Is there an active object...
00870   CBase*        pCObject        = m_pCMDIObjects->m_pCObjTree->GetSelectedObject();
00871   CContainerBase*   pCContainerBase     = SOURCE_GETOBJECT(pCObject, CContainerBase);
00872   CAsynchBase*    pCAsynchBase      = SOURCE_GETOBJECT(pCObject, CAsynchBase);
00873   CConnectionPoint* pCConnectionPoint   = SOURCE_GETOBJECT(pCObject, CConnectionPoint);
00874   CRowPosition*   pCRowPosition     = SOURCE_GETOBJECT(pCObject, CRowPosition);
00875   CError*       pCError         = SOURCE_GETOBJECT(pCObject, CError);
00876   CStream*      pCStream        = SOURCE_GETOBJECT(pCObject, CStream);
00877
00878
00879   //Setup the Source info
00880   m_idSource = iID;
00881   m_pCSource = pCObject;
00882
00883   switch(iID)
00884   {
00885     //File Menu
00886     ON_COMMAND(IDM_EXIT,                  OnClose())
00887 //    ON_COMMAND(IDM_SAVE,                  OnSave())
00888 //    ON_COMMAND(IDM_SAVEAS,                  OnSave(TRUE))
00889
00890     ON_COMMAND(IDM_FULLCONNECT,               OnConnect())
00891     ON_COMMAND(IDM_FULLDISCONNECT,              OnDisconnect())
00892
00893
00894     ///////////////////////////////////////////////////////////////////
00895     // IUnknown
00896     //
00897     ///////////////////////////////////////////////////////////////////
00898     ON_COMMAND(IDM_UNKNOWN_ADDREF,                  OnAddRef(pCObject))
00899     ON_COMMAND(IDM_DATASOURCE_ADDREF,               OnAddRef(pCObject))
00900     ON_COMMAND(IDM_SESSION_ADDREF,                  OnAddRef(pCObject))
00901     ON_COMMAND(IDM_COMMAND_ADDREF,                  OnAddRef(pCObject))
00902     ON_COMMAND(IDM_MULTIPLERESULTS_ADDREF,              OnAddRef(pCObject))
00903     ON_COMMAND(IDM_ROWSET_ADDREF,                 OnAddRef(pCObject))
00904     ON_COMMAND(IDM_ROW_ADDREF,                    OnAddRef(pCObject))
00905     ON_COMMAND(IDM_STREAM_ADDREF,                 OnAddRef(pCObject))
00906     ON_COMMAND(IDM_ENUMERATOR_ADDREF,               OnAddRef(pCObject))
00907     ON_COMMAND(IDM_BINDER_ADDREF,                 OnAddRef(pCObject))
00908     ON_COMMAND(IDM_SERVICECOMP_ADDREF,                OnAddRef(pCObject))
00909     ON_COMMAND(IDM_DATALINKS_ADDREF,                OnAddRef(pCObject))
00910     ON_COMMAND(IDM_DATASET_ADDREF,                  OnAddRef(pCObject))
00911     ON_COMMAND(IDM_TRANSACTION_ADDREF,                OnAddRef(pCObject))
00912     ON_COMMAND(IDM_TRANSACTIONOPTIONS_ADDREF,           OnAddRef(pCObject))
00913     ON_COMMAND(IDM_ERROR_ADDREF,                  OnAddRef(pCObject))
00914     ON_COMMAND(IDM_CUSTOMERROR_ADDREF,                OnAddRef(pCObject))
00915     ON_COMMAND(IDM_ROWPOS_ADDREF,                 OnAddRef(pCObject))
00916     ON_COMMAND(IDM_CONNECTIONPOINT_ADDREF,              OnAddRef(pCObject))
00917     ON_COMMAND(IDM_POOLINFO_ADDREF,                 OnAddRef(pCObject))
00918
00919     ON_COMMAND(IDM_IUNKNOWN_RELEASE,                OnRelease(pCObject))
00920     ON_COMMAND(IDM_IUNKNOWN_QUERYINTERFACE,             OnQueryInterface(pCObject))
00921     ON_COMMAND(IDM_IUNKNOWN_AUTOQI,                 OnAutoQI(pCObject))
00922     ON_COMMAND(IDM_IUNKNOWN_RELEASEALL,               OnReleaseAll(pCObject))
00923     ON_COMMAND(IDM_IUNKNOWN_RELEASECHILDREN,            OnReleaseAll(pCObject, TRUE/*fChildren*/))
00924
00925
00926     ///////////////////////////////////////////////////////////////////
00927     // ISupportErrorInfo
00928     //
00929     ///////////////////////////////////////////////////////////////////
00930     ON_COMMAND(IDM_ISUPPORTERRORINFO,               OnSupportErrorInfo(pCObject))
00931
00932     ///////////////////////////////////////////////////////////////////
00933     // ISupportErrorInfo
00934     //
00935     ///////////////////////////////////////////////////////////////////
00936     ON_COMMAND(IDM_ICPC_FINDCONNECTIONPOINT,            OnFindConnectionPoint(pCContainerBase, IID_IDBAsynchNotify))
00937     ON_COMMAND(IDM_ICPC_ENUMCONNECTIONPOINTS,           FALSE)
00938
00939
00940     ///////////////////////////////////////////////////////////////////
00941     // IConnectionPoint
00942     //
00943     ///////////////////////////////////////////////////////////////////
00944     ON_COMMAND(IDM_ICONNECTIONPOINT_GETCONNECTIONINTERFACE,     OnGetConnectionInterface(pCConnectionPoint))
00945     ON_COMMAND(IDM_ICONNECTIONPOINT_ADVISE,             OnAdvise(pCConnectionPoint))
00946     ON_COMMAND(IDM_ICONNECTIONPOINT_UNADVISE,           OnUnadvise(pCConnectionPoint))
00947     ON_COMMAND(IDM_ICONNECTIONPOINT_ENUMCONNECTIONS,        FALSE)
00948     ON_COMMAND(IDM_ICONNECTIONPOINT_GETCONNECTIONPOINTCONTAINER,  FALSE)
00949
00950
00951     ///////////////////////////////////////////////////////////////////
00952     // IDBAsynchStatus
00953     //
00954     ///////////////////////////////////////////////////////////////////
00955     ON_COMMAND(IDM_IDBASYNCHSTATUS_ABORT,             OnAbort(pCAsynchBase))
00956     ON_COMMAND(IDM_IDBASYNCHSTATUS_GETSTATUS,           OnGetStatus(pCAsynchBase))
00957     ON_COMMAND(IDM_IDBINITIALIZE_INITIALIZE,            OnInitialize(pCAsynchBase))
00958     ON_COMMAND(IDM_IDBINITIALIZE_UNINITIALIZE,            OnUninitialize(pCAsynchBase))
00959
00960
00961     ///////////////////////////////////////////////////////////////////
00962     // IDBProperties
00963     //
00964     ///////////////////////////////////////////////////////////////////
00965     case IDM_IDBPROPERTIES_SETPROPERTIES:
00966     {
00967       IDBProperties* pIDBProperties = SOURCE_GETINTERFACE(pCObject, IDBProperties);
00968       if(pIDBProperties)
00969       {
00970         CDataSource* pCDataSource = SOURCE_GETOBJECT(pCObject, CDataSource);
00971
00972         CPropertiesDlg sCPropertiesDlg(this);
00973         sCPropertiesDlg.SetProperties(m_hWnd, pCDataSource ? (pCDataSource->IsInitialized() ? &DBPROPSET_DATASOURCEALL : &DBPROPSET_DBINITALL) : NULL, IID_IDBProperties, pIDBProperties, pIDBProperties);
00974       }
00975       return TRUE;
00976     }
00977
00978     case IDM_IDBPROPERTIES_GETPROPERTIES:
00979     {
00980       IDBProperties* pIDBProperties = SOURCE_GETINTERFACE(pCObject, IDBProperties);
00981       if(pIDBProperties)
00982       {
00983         CPropertiesDlg sCPropertiesDlg(this);
00984         sCPropertiesDlg.GetProperties(m_hWnd, &DBPROPSET_DATASOURCEALL, IID_IDBProperties, pIDBProperties, pIDBProperties);
00985       }
00986       return TRUE;
00987     }
00988
00989     case IDM_IDBPROPERTIES_GETPROPERTYINFO:
00990     {
00991       IDBProperties* pIDBProperties = SOURCE_GETINTERFACE(pCObject, IDBProperties);
00992       if(pIDBProperties)
00993       {
00994         CPropertiesDlg sCPropertiesDlg(this);
00995         sCPropertiesDlg.GetPropertyInfo(m_hWnd, &DBPROPSET_DATASOURCEALL, IID_IDBProperties, pIDBProperties);
00996       }
00997       return TRUE;
00998     }
00999
01000
01001     ///////////////////////////////////////////////////////////////////
01002     // IBindResource
01003     //
01004     ///////////////////////////////////////////////////////////////////
01005     case IDM_IBINDRESOURCE_BIND:
01006       if(SOURCE_GETINTERFACE(pCObject, IBindResource))
01007         DisplayDialog(IDD_BINDRESOURCE, m_hWnd, CMainWindow::BindResourceProc, pCObject, iID);
01008       return TRUE;
01009
01010     case IDM_ICREATEROW_CREATEROW:
01011       if(SOURCE_GETINTERFACE(pCObject, ICreateRow))
01012         DisplayDialog(IDD_BINDRESOURCE, m_hWnd, CMainWindow::BindResourceProc, pCObject, iID);
01013       return TRUE;
01014
01015
01016     case IDM_IREGISTERPROVIDER_SETURLMAPPING:
01017       if(SOURCE_GETINTERFACE(pCObject, IRegisterProvider))
01018         DisplayDialog(IDD_URLMAPPING, m_hWnd, CMainWindow::RegisterProviderProc, pCObject, iID);
01019       return TRUE;
01020
01021     case IDM_IREGISTERPROVIDER_GETURLMAPPING:
01022       if(SOURCE_GETINTERFACE(pCObject, IRegisterProvider))
01023         DisplayDialog(IDD_URLMAPPING, m_hWnd, CMainWindow::RegisterProviderProc, pCObject, iID);
01024       return TRUE;
01025
01026     case IDM_IREGISTERPROVIDER_UNREGISTERPROVIDER:
01027       if(SOURCE_GETINTERFACE(pCObject, IRegisterProvider))
01028         DisplayDialog(IDD_URLMAPPING, m_hWnd, CMainWindow::RegisterProviderProc, pCObject, iID);
01029       return TRUE;
01030
01031     case IDM_IDBBINDERPROPERTIES_RESET:
01032     {
01033       IDBBinderProperties* pIDBBinderProperties = SOURCE_GETINTERFACE(pCObject, IDBBinderProperties);
01034       if(pIDBBinderProperties)
01035       {
01036         CWaitCursor waitCursor;
01037
01038         //IDBBinderProperties::Reset
01039         XTEST(hr = pIDBBinderProperties->Reset());
01040         TRACE_METHOD(hr, L"IDBBinderProperties::Reset()");
01041       }
01042       return TRUE;
01043     }
01044
01045
01046     ///////////////////////////////////////////////////////////////////
01047     // Stream
01048     //
01049     ///////////////////////////////////////////////////////////////////
01050     case IDM_ISTREAM_READ:
01051     case IDM_ISTREAM_WRITE:
01052     case IDM_ISEQSTREAM_READ:
01053     case IDM_ISEQSTREAM_WRITE:
01054       if(pCStream)
01055         DisplayDialog(IDD_STREAM_VIEWER, m_hWnd, CMainWindow::StreamViewerProc, pCObject, iID);
01056       return TRUE;
01057
01058     case IDM_ISTREAM_CLONE:
01059       if(pCStream)
01060       {
01061         IStream* pIStream = NULL;
01062
01063         //IStream::Clone
01064         if(SUCCEEDED(pCStream->Clone(&pIStream)))
01065         {
01066           //Display the new object
01067           HandleObjectType(pCStream, pIStream, IID_IStream, eCStream, 0, NULL, CREATE_DETERMINE_TYPE);
01068         }
01069
01070         SAFE_RELEASE(pIStream);
01071       }
01072       return TRUE;
01073
01074     case IDM_ISTREAM_SEEK:
01075       if(pCStream)
01076       {
01077         LARGE_INTEGER lgOffset;
01078         lgOffset.QuadPart = 0;
01079
01080         //IStream::Seek
01081         XTEST(pCStream->Seek(lgOffset, STREAM_SEEK_SET, NULL));
01082       }
01083       return TRUE;
01084
01085     case IDM_ISTREAM_STAT:
01086       if(pCStream)
01087       {
01088         STATSTG statstg;
01089         pCStream->Stat(&statstg);
01090       }
01091       return TRUE;
01092
01093
01094     ///////////////////////////////////////////////////////////////////
01095     // Enumerator
01096     //
01097     ///////////////////////////////////////////////////////////////////
01098     case IDM_ISOURCESROWSET_GETSOURCESROWSET:
01099       if(SOURCE_GETINTERFACE(pCObject, ISourcesRowset))
01100         DisplayDialog(IDD_GETSOURCESROWSET, m_hWnd, CMainWindow::GetSourcesRowsetProc, pCObject, iID);
01101       return TRUE;
01102
01103
01104     //Service Components
01105     ON_COMMAND(IDM_IDATAINITIALIZE_CREATEDBINSTANCE,        OnConnect())
01106     ON_COMMAND(IDM_IDATAINITIALIZE_CREATEDBINSTANCEEX,        OnConnect())
01107     ON_COMMAND(IDM_IDATAINITIALIZE_LOADSTRINGFROMSTORAGE,     OnLoadStringFromStorage())
01108     ON_COMMAND(IDM_IDATAINITIALIZE_GETDATASOURCE,         OnGetDataSource())
01109     ON_COMMAND(IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE,      OnPromptDataSource())
01110     ON_COMMAND(IDM_IDBPROMPTINITIALIZE_PROMPTDATASOURCE_ADVANCED, OnPromptDataSource(TRUE/*fAdvanced*/))
01111     ON_COMMAND(IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME,        OnPromptFileName())
01112     ON_COMMAND(IDM_IDBPROMPTINITIALIZE_PROMPTFILENAME_ADVANCED,   OnPromptFileName(TRUE/*fAdvanced*/))
01113
01114
01115     //IDataInitialize
01116     case IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING:
01117     case IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING_NOPASSWORD:
01118       if(m_pCServiceComp)
01119       {
01120         CWaitCursor waitCursor;
01121
01122         //Password
01123         WCHAR* pwszInitString = NULL;
01124         boolean fIncludePassword = (iID == IDM_IDATAINITIALIZE_GETINITIALIZATIONSTRING);
01125
01126         //Obtain the Active DataSource
01127         IUnknown* pIUnknown = NULL;
01128         CMDIChild* pCMDIChild = (CMDIChild*)FindWindow(L"MDICHILD");
01129         if(pCMDIChild)
01130           pIUnknown = SOURCE_GETINTERFACE(pCMDIChild->GetObject(eCDataSource), IUnknown);
01131
01132         //GetInitializationString
01133         m_pCServiceComp->GetInitString(pIUnknown, fIncludePassword, &pwszInitString);
01134         SAFE_FREE(pwszInitString);
01135       }
01136       return TRUE;
01137
01138     //IDataInitialize
01139     case IDM_IDATAINITIALIZE_WRITESTRINGTOSTORAGE:
01140       if(m_pCServiceComp)
01141       {
01142         CWaitCursor waitCursor;
01143
01144         WCHAR* pwszInitString = NULL;
01145         boolean fIncludePassword = TRUE;
01146
01147         //Use active object...
01148         CServiceComp* pCServiceComp = m_pCServiceComp;
01149
01150         //Obtain the Active DataSource
01151         IUnknown* pIUnknown = NULL;
01152         CMDIChild* pCMDIChild = (CMDIChild*)FindWindow(L"MDICHILD");
01153         if(pCMDIChild)
01154           pIUnknown = SOURCE_GETINTERFACE(pCMDIChild->GetObject(eCDataSource), IUnknown);
01155
01156         //Get the InitString for this DataSource
01157         hr = pCServiceComp->GetInitString(pIUnknown, fIncludePassword, &pwszInitString);
01158         if(SUCCEEDED(hr))
01159         {
01160           //Find the FileName to Save as...
01161           WCHAR wszFileName[MAX_QUERY_LEN] = {0};
01162
01163           //Display Common Dialog to obtain File To Save...
01164           hr = BrowseSaveFileName(GetAppLite()->m_hInstance, m_hWnd, L"IDataInitialize::WriteStringToStorage", wszFileName, MAX_QUERY_LEN, L"udl", L"Microsoft Data Link Files (.udl)\0*.udl\0All Files (*.*)\0*.*\0\0");
01165           if(SUCCEEDED(hr))
01166             pCServiceComp->SaveInitString(wszFileName, pwszInitString);
01167         }
01168         SAFE_FREE(pwszInitString);
01169       }
01170       return TRUE;
01171
01172
01173     ON_COMMAND(IDM_CREATEFILEMONIKER,           OnCreateFileMoniker())
01174
01175     ON_COMMAND(IDM_CREATE_ROOTBINDER,           OnRootBinder())
01176     ON_COMMAND(IDM_CREATE_ROOTENUMERATOR,         OnRootEnumerator())
01177     ON_COMMAND(IDM_CREATE_SERVICECOMPONENTS,        OnServiceComponents())
01178     ON_COMMAND(IDM_CREATE_DATALINKS,            OnDataLinks())
01179
01180     ON_COMMAND(IDM_RECENTCONFIG1,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01181     ON_COMMAND(IDM_RECENTCONFIG2,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01182     ON_COMMAND(IDM_RECENTCONFIG3,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01183     ON_COMMAND(IDM_RECENTCONFIG4,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01184     ON_COMMAND(IDM_RECENTCONFIG5,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01185     ON_COMMAND(IDM_RECENTCONFIG6,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01186     ON_COMMAND(IDM_RECENTCONFIG7,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01187     ON_COMMAND(IDM_RECENTCONFIG8,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01188     ON_COMMAND(IDM_RECENTCONFIG9,             OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01189     ON_COMMAND(IDM_RECENTCONFIG10,              OnLoadRecentConfig(iID - IDM_RECENTCONFIG1))
01190
01191     ON_COMMAND(IDM_RECENTFILE1,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01192     ON_COMMAND(IDM_RECENTFILE2,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01193     ON_COMMAND(IDM_RECENTFILE3,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01194     ON_COMMAND(IDM_RECENTFILE4,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01195     ON_COMMAND(IDM_RECENTFILE5,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01196     ON_COMMAND(IDM_RECENTFILE6,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01197     ON_COMMAND(IDM_RECENTFILE7,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01198     ON_COMMAND(IDM_RECENTFILE8,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01199     ON_COMMAND(IDM_RECENTFILE9,               OnLoadRecentFile(iID - IDM_RECENTFILE1))
01200     ON_COMMAND(IDM_RECENTFILE10,              OnLoadRecentFile(iID - IDM_RECENTFILE1))
01201
01202     //DataSource Menu
01203
01204     //Session Menu
01205
01206     //Command Menu
01207
01208     //Rowset Menu
01209     case IDM_CREATE_ROWPOSITION:
01210       if(m_pCRootEnumerator)
01211       {
01212         CWaitCursor waitCursor;
01213         IUnknown* pIUnknown = NULL;
01214
01215         //Create the Row Position object...
01216         hr = m_pCRootEnumerator->CreateInstance(NULL, CLSID_OLEDB_ROWPOSITIONLIBRARY, CLSCTX_ALL, IID_IUnknown, (IUnknown**)&pIUnknown);
01217         if(SUCCEEDED(hr))
01218           HandleObjectType(pCObject, pIUnknown, IID_IUnknown, eCRowPosition, 0, NULL, pCObject ? CREATE_INITIALIZE : 0);
01219         TRACE_RELEASE(pIUnknown, L"IUnknown");
01220       }
01221       return TRUE;
01222
01223     case IDM_IROWPOS_INITIALIZE:
01224       if(pCRowPosition && pCRowPosition->m_pIRowPosition)
01225       {
01226         CWaitCursor waitCursor;
01227         IUnknown* pIUnknown = NULL;
01228         CMDIChild* pCMDIChild = (CMDIChild*)FindWindow(L"MDICHILD");
01229         if(pCMDIChild)
01230           pIUnknown = SOURCE_GETINTERFACE(pCMDIChild->GetObject(eCRowset), IUnknown);
01231
01232         //Initialize RowPosition Object to use the current rowset object...
01233         pCRowPosition->Initialize(pIUnknown);
01234       }
01235       return TRUE;
01236
01237     case IDM_IROWPOS_GETROWSET:
01238       if(pCRowPosition && pCRowPosition->m_pIRowPosition)
01239       {
01240         CInterfaceDlg interfaceDlg(IDD_INTERFACE, L"IRowPosition::GetRowset", IID_IRowset);
01241         if(interfaceDlg.DoModal(m_hWnd) == IDOK)
01242         {
01243           CWaitCursor waitCursor;
01244
01245           //IRowPosition::GetRowset
01246           IUnknown* pIUnknown = NULL;
01247
01248           //What type of object, let our helper determine...
01249           if(SUCCEEDED(hr = pCRowPosition->GetRowset(interfaceDlg.GetSelInterface(), &pIUnknown)))
01250             HandleObjectType(pCRowPosition, pIUnknown, interfaceDlg.GetSelInterface(), eCRowset, 0, NULL, CREATE_FINDWINDOW);
01251           TRACE_RELEASE(pIUnknown, L"IUnknown");
01252         }
01253       }
01254       return TRUE;
01255
01256     case IDM_IROWPOS_CLEARROWPOSITION:
01257       if(pCRowPosition && pCRowPosition->m_pIRowPosition)
01258       {
01259         CWaitCursor waitCursor;
01260
01261         XTEST(hr = pCRowPosition->m_pIRowPosition->ClearRowPosition());
01262         TRACE_METHOD(hr, L"IRowPosition::ClearRowPosition()");
01263       }
01264       return TRUE;
01265
01266     case IDM_IROWPOS_SETROWPOSITION:
01267       if(pCRowPosition && pCRowPosition->m_pIRowPosition)
01268       {
01269         //Find the SelectedRow
01270         HROW hRow = NULL;
01271         HCHAPTER hChapter = NULL;
01272         CMDIChild* pCMDIChild = (CMDIChild*)FindWindow(L"MDICHILD");
01273         if(pCMDIChild)
01274         {
01275           pCMDIChild->m_pCDataGrid->GetSelectedRow(&hRow);
01276           CRowset* pCRowset = (CRowset*)pCMDIChild->GetObject(eCRowset);
01277           if(pCRowset)
01278             hChapter = pCRowset->m_hChapter;
01279         }
01280
01281         CWaitCursor waitCursor;
01282
01283         //Set RowPosition
01284         XTEST(hr = pCRowPosition->m_pIRowPosition->SetRowPosition(hChapter, hRow, DBPOSITION_OK));
01285         TRACE_METHOD(hr, L"IRowPosition::SetRowPosition(0x%p, 0x%p, %d)", hChapter, hRow, DBPOSITION_OK);
01286       }
01287       return TRUE;
01288
01289     case IDM_IROWPOS_GETROWPOSITION:
01290       if(pCRowPosition && pCRowPosition->m_pIRowPosition)
01291       {
01292         CWaitCursor waitCursor;
01293
01294         HCHAPTER hChapter = NULL;
01295         HROW hRow = NULL;
01296         DBPOSITIONFLAGS dwPositionFlag = DBPOSITION_OK;
01297         IRowset* pIRowset = NULL;
01298
01299         //IRowPosition::GetRowPoisition
01300         XTEST(hr = pCRowPosition->m_pIRowPosition->GetRowPosition(&hChapter, &hRow, &dwPositionFlag));
01301         TRACE_METHOD(hr, L"IRowPosition::GetRowPosition(&0x%p, &0x%p, &%d)", hChapter, hRow, dwPositionFlag);
01302
01303         //Now release the info...
01304         if(SUCCEEDED(hr) && hRow)
01305         {
01306           //The simplest is to just obtain the Rowset that this RowPosition object is
01307           //initialized to, and then call ReleaseRows...
01308           if(SUCCEEDED(pCRowPosition->GetRowset(IID_IRowset, (IUnknown**)&pIRowset)))
01309           {
01310             ULONG ulRefCount = 0;
01311             DBROWSTATUS ulRowStatus = 0;
01312
01313             //IRowset::ReleaseRows
01314             hr = pIRowset->ReleaseRows(1, &hRow, NULL, &ulRefCount, &ulRowStatus);
01315             TRACE_METHOD(hr, L"IRowset::ReleaseRows(%lu, &0x%p, NULL, &%d, &%d)", 1, hRow, ulRefCount, ulRowStatus);
01316
01317             //Release the rowset...
01318             TRACE_RELEASE(pIRowset, L"IUnknown");
01319           }
01320         }
01321       }
01322       return TRUE;
01323
01324
01325     //Row Menu
01326
01327     //Error Menu
01328     ON_COMMAND(IDM_DISPLAYERRORINFO,            DisplayErrorInfo(S_OK))
01329
01330     case IDM_GETERRORINFO:
01331     {
01332       IErrorInfo* pIErrorInfo = NULL;
01333
01334       //Obtain an errorinfo...
01335       XTEST(hr = GetErrorInfo(0, &pIErrorInfo));
01336       TRACE_METHOD(hr, L"GetErrorInfo(0, &0x%p)", pIErrorInfo);
01337
01338       if(SUCCEEDED(hr) && pIErrorInfo)
01339         HandleObjectType(NULL/*pCSource*/, pIErrorInfo, IID_IErrorInfo, eCError, 0/*cPropSets*/, NULL/*rgPropSets*/, 0/*dwFlags*/);
01340       TRACE_RELEASE(pIErrorInfo, L"IErrorInfo");
01341       break;
01342     }
01343
01344     case IDM_SETERRORINFO:
01345     {
01346       XTEST(hr = SetErrorInfo(0, NULL));
01347       TRACE_METHOD(hr, L"SetErrorInfo(0, NULL)");
01348       break;
01349     }
01350
01351     //IErrorInfo
01352     case IDM_ERRORINFO_GETDESCRIPTION:
01353       if(pCError)
01354       {
01355         //IErrorInfo::GetDescription
01356         CComBSTR bstrDescription;
01357         pCError->GetDescription(&bstrDescription);
01358       }
01359       return TRUE;
01360
01361     case IDM_ERRORINFO_GETGUID:
01362       if(pCError)
01363       {
01364         GUID guid;
01365
01366         //IErrorInfo::GetGUID
01367         pCError->GetGUID(&guid);
01368       }
01369       return TRUE;
01370
01371     case IDM_ERRORINFO_GETHELPCONTEXT:
01372       if(pCError)
01373       {
01374         DWORD dwHelpContext = 0;
01375
01376         //IErrorInfo::GetHelpContext
01377         pCError->GetHelpContext(&dwHelpContext);
01378       }
01379       return TRUE;
01380
01381     case IDM_ERRORINFO_GETHELPFILE:
01382       if(pCError)
01383       {
01384         //IErrorInfo::GetHelpFile
01385         CComBSTR bstrHelpFile;
01386         pCError->GetHelpFile(&bstrHelpFile);
01387       }
01388       return TRUE;
01389
01390     case IDM_ERRORINFO_GETSOURCE:
01391       if(pCError)
01392       {
01393         //IErrorInfo::GetSource
01394         CComBSTR bstrSource;
01395         pCError->GetSource(&bstrSource);
01396       }
01397       return TRUE;
01398
01399     //IErrorRecords
01400     case IDM_ERRORRECORDS_GETRECORDCOUNT:
01401       if(pCError)
01402       {
01403         ULONG ulCount = 0;
01404
01405         //IErrorRecords::GetRecordCount
01406         pCError->GetRecordCount(&ulCount);
01407       }
01408       return TRUE;
01409
01410     case IDM_ERRORRECORDS_GETCUSTOMERROROBJECT:
01411       if(pCError)
01412       {
01413         CInterfaceDlg interfaceDlg(IDD_INTERFACE, L"IErrorRecords::GetCustomErrorObject", IID_ISQLErrorInfo);
01414         if(interfaceDlg.DoModal(m_hWnd) == IDOK)
01415         {
01416           CWaitCursor waitCursor;
01417           ULONG ulRecord = 0;
01418
01419           //IErrorRecords::GetCustomErrorObject
01420           //What type of object, let our helper determine...
01421           if(SUCCEEDED(hr = pCError->GetCustomErrorObject(ulRecord, interfaceDlg.GetSelInterface(), interfaceDlg.ppUnknown())))
01422             HandleObjectType(pCError, interfaceDlg.pUnknown(), interfaceDlg.GetSelInterface(), eCCustomError, 0, NULL, 0/*dwFlags*/);
01423         }
01424       }
01425       return TRUE;
01426
01427     case IDM_ERRORRECORDS_GETERRORINFO:
01428       if(pCError)
01429         DisplayDialog(IDD_ERRORRECORDS, m_hWnd, CMainWindow::ErrorRecordsProc, pCError);
01430       return TRUE;
01431
01432
01433     case IDM_SQLERRORINFO_GETSQLINFO:
01434     {
01435       CCustomError* pCCustomError = SOURCE_GETOBJECT(pCObject, CCustomError);
01436       if(pCCustomError && pCCustomError->m_pISQLErrorInfo)
01437       {
01438         CComBSTR bstr;
01439         LONG lNativeError = 0;
01440
01441         //ISQLErrorInfo::GetSQLInfo
01442         hr = pCCustomError->GetSQLInfo(&bstr, &lNativeError);
01443       }
01444       return TRUE;
01445     }
01446
01447
01448     //Objects Menu
01449
01450     //Tools Menu
01451     ON_COMMAND(IDM_OPTIONS,       OnOptions())
01452     ON_COMMAND(IDM_TRACEWINDOW,     OnTraceWindow())
01453     ON_COMMAND(IDM_OBJECTSWINDOW,   OnObjectsWindow())
01454
01455     //Window Menu
01456     ON_COMMAND(IDM_CLOSEWINDOW,     OnDisconnect())
01457
01458     ON_COMMAND(IDM_TILEHORIZONTAL,    OnTile(TRUE))
01459     ON_COMMAND(IDM_TILEVERTICAL,    OnTile(FALSE))
01460     ON_COMMAND(IDM_CASCADE,       OnCascade())
01461     ON_COMMAND(IDM_ARRANGEICONS,    OnArrangeIcons())
01462     ON_COMMAND(IDM_AUTOPOSITION,    OnAutoPosition())
01463     ON_COMMAND(IDM_CLOSEALL,      OnCloseAll())
01464     ON_COMMAND(IDM_NEXTWINDOW,      OnNextWindow(TRUE))
01465     ON_COMMAND(IDM_PREVWINDOW,      OnNextWindow(FALSE))
01466
01467     //Help Menu
01468     ON_COMMAND(IDM_ABOUT,       OnAbout())
01469   };
01470
01471   return CMDIFrameLite::OnCommand(iID, hWndCtrl);
01472 }
01473
01474
01475
01476 ////////////////////////////////////////////////////////////////
01477 // CMainWindow::OnMenuSelect
01478 //
01479 /////////////////////////////////////////////////////////////////
01480 BOOL CMainWindow::OnMenuSelect(UINT uID)
01481 {
01482   //TODO - status text should probably also be for free...
01483
01484   if(uID)
01485   {
01486     WCHAR wszBuffer[MAX_NAME_LEN+1] = {0};
01487
01488     if(IsUnicodeOS())
01489     {
01490       //Load the string from the StringTable in the resource
01491       //To diaply the text associated with this menu item...
01492       LoadStringW(GetAppLite()->m_hInstance, uID, wszBuffer, MAX_NAME_LEN);
01493       m_CStatusBar.SetText(wszBuffer, STATUSBAR_TEXT, 0/*SBT_NOBORDERS*/);
01494     }
01495     else
01496     {
01497       CHAR szBuffer[MAX_NAME_LEN];
01498
01499       LoadStringA(GetAppLite()->m_hInstance, uID, szBuffer, MAX_NAME_LEN);
01500       ConvertToWCHAR(szBuffer, wszBuffer, MAX_NAME_LEN);
01501       m_CStatusBar.SetText(wszBuffer, STATUSBAR_TEXT, 0/*SBT_NOBORDERS*/);
01502     }
01503
01504   }
01505   else
01506   {
01507     //Otherwise we are using the Status Bar to indicate
01508     //the number of selected variations
01509     UpdateControls();
01510   }
01511
01512   return TRUE;
01513 }
01514
01515
01516 ////////////////////////////////////////////////////////////////
01517 // CMainWindow::OnInitMenuPopup
01518 //
01519 /////////////////////////////////////////////////////////////////
01520 BOOL CMainWindow::OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu)
01521 {
01522   //NOTE: Having every menu item in all objects menu have unique ids, makes adding the same interface
01523   //to another object very painful, and causes manually editing the menu resources, making sure its
01524   //added to OnUpdateCommand for enabling/disabling the menu item, as well as adding another
01525   //case in OnCommand for the same interface!
01526
01527   //Instead we have devised a design where we can intitally set the item data of every menu
01528   //to contain the object identifier.  This way we can always obtain the stored data of the menu
01529   //and instantly know the type of object this interface/method is called from.  Saves hundreads
01530   //of lines of code, and almost ellimiates all places to remember to add code to...
01531
01532   //To do this we must first know what menu we have.  This is also a designed that all object
01533   //menu have as the first item an "IUnknown" menu, which contains as the first element
01534   //a IDM_*_ADDREF call, so we know exactly the object source...
01535
01536   //Obtain the first SubMenu
01537   HMENU hSubMenu = GetSubMenu(hMenu, 0);
01538   if(hSubMenu)
01539   {
01540     SOURCE eSource = eInvalid;
01541     ULONG ulMenuID = GetMenuItemID(hSubMenu, 0);
01542
01543     switch(ulMenuID)
01544     {
01545       case IDM_UNKNOWN_ADDREF:
01546         eSource = eCUnknown;
01547         break;
01548       case IDM_DATASOURCE_ADDREF:
01549         eSource = eCDataSource;
01550         break;
01551       case IDM_SESSION_ADDREF:
01552         eSource = eCSession;
01553         break;
01554       case IDM_COMMAND_ADDREF:
01555         eSource = eCCommand;
01556         break;
01557       case IDM_MULTIPLERESULTS_ADDREF:
01558         eSource = eCMultipleResults;
01559         break;
01560       case IDM_ROWSET_ADDREF:
01561         eSource = eCRowset;
01562         break;
01563       case IDM_ROW_ADDREF:
01564         eSource = eCRow;
01565         break;
01566       case IDM_STREAM_ADDREF:
01567         eSource = eCStream;
01568         break;
01569       case IDM_ENUMERATOR_ADDREF:
01570         eSource = eCEnumerator;
01571         break;
01572       case IDM_BINDER_ADDREF:
01573         eSource = eCBinder;
01574         break;
01575       case IDM_SERVICECOMP_ADDREF:
01576         eSource = eCServiceComp;
01577         break;
01578       case IDM_DATALINKS_ADDREF:
01579         eSource = eCDataLinks;
01580         break;
01581       case IDM_DATASET_ADDREF:
01582         eSource = eCDataset;
01583         break;
01584       case IDM_TRANSACTION_ADDREF:
01585         eSource = eCTransaction;
01586         break;
01587       case IDM_TRANSACTIONOPTIONS_ADDREF:
01588         eSource = eCTransactionOptions;
01589         break;
01590       case IDM_ERROR_ADDREF:
01591         eSource = eCError;
01592         break;
01593       case IDM_CUSTOMERROR_ADDREF:
01594         eSource = eCCustomError;
01595         break;
01596       case IDM_ROWPOS_ADDREF:
01597         eSource = eCRowPosition;
01598         break;
01599       case IDM_CONNECTIONPOINT_ADDREF:
01600         eSource = eCConnectionPoint;
01601         break;
01602       default:
01603   //      ASSERT(!"Unknown Menu?");
01604         break;
01605     };
01606
01607     //Store this object as an data value of the menu and all sub menus...
01608     if(eSource != eInvalid)
01609       SetSubMenuData(hMenu, 0, TRUE/*fByPosition*/, eSource);
01610
01611     CBase* pCBase     = NULL;
01612
01613     //Now that we know what object the menu refers to, select
01614     //the corresponding object in the tree...
01615     CMDIChild* pCMDIChild = (CMDIChild*)GetActiveWindow(L"MDICHILD");
01616     if(pCMDIChild)
01617     {
01618       pCBase = pCMDIChild->GetObject(eSource);
01619       if(!pCBase)
01620       {
01621         //Try and work backwards...
01622         pCBase = pCMDIChild->GetObject();
01623         if(pCBase && (pCBase->GetObjectType() != eSource))
01624           pCBase = pCBase->GetParent(eSource);
01625       }
01626     }
01627
01628     //If the MDIChild window is not active, try and guess which object this action
01629     //is for by the selected object in the tree...
01630     if(!pCBase)
01631     {
01632       //If the objects window is active
01633       CMDIObjects* pCMDIObjects = m_pCMDIObjects;
01634       if(pCMDIObjects)
01635       {
01636         //we know exactly what object this refers to...
01637         pCBase = pCMDIObjects->m_pCObjTree->GetSelectedObject();
01638         if(pCBase)
01639         {
01640           //If its not the correct type, then maybe its the parent...
01641           if(pCBase->GetObjectType() != eSource)
01642             pCBase = pCBase->GetParent(eSource);
01643         }
01644       }
01645     }
01646
01647     //Maybe its part of the main window...
01648     if(!pCBase)
01649       pCBase = GetObject(eSource);
01650
01651     //Select the object
01652     if(pCBase)
01653       m_pCMDIObjects->m_pCObjTree->SelectObject(pCBase);
01654   }
01655
01656   //Delegate
01657   return CMDIFrameLite::OnInitMenuPopup(hMenu, uPos, fSysMenu);
01658 }
01659
01660
01661
01662 ////////////////////////////////////////////////////////////////
01663 // CMainWindow::GetObject
01664 //
01665 /////////////////////////////////////////////////////////////////
01666 CBase* CMainWindow::GetObject(SOURCE eSource, BOOL fAlways)
01667 {
01668   CBase** ppCBase = GetObjectAddress(eSource);
01669   if(ppCBase)
01670   {
01671     CBase* pCBase = *ppCBase;
01672     if(pCBase && (eSource==eCUnknown || pCBase->GetObjectType()==eSource || pCBase->GetBaseType() & eSource) && (fAlways || pCBase->m_pIUnknown))
01673       return pCBase;
01674   }
01675
01676   return NULL;
01677 }
01678
01679
01680 ////////////////////////////////////////////////////////////////
01681 // CMainWindow::GetObjectAddress
01682 //
01683 /////////////////////////////////////////////////////////////////
01684 CBase** CMainWindow::GetObjectAddress(SOURCE eSource)
01685 {
01686   CBase** ppCObject = NULL;
01687
01688   switch(eSource)
01689   {
01690     case eCBinder:
01691       ppCObject = (CBase**)&m_pCRootBinder;
01692       break;
01693
01694     case eCEnumerator:
01695       ppCObject = (CBase**)&m_pCRootEnumerator;
01696       break;
01697
01698     case eCServiceComp:
01699       ppCObject = (CBase**)&m_pCServiceComp;
01700       break;
01701
01702     case eCDataLinks:
01703       ppCObject = (CBase**)&m_pCDataLinks;
01704       break;
01705
01706     case eCUnknown:
01707       //Determine "Last" object type...
01708       if(m_pCRootEnumerator && m_pCRootEnumerator->m_pIUnknown)
01709         return (CBase**)&m_pCRootEnumerator;
01710       else if(m_pCRootBinder && m_pCRootBinder->m_pIUnknown)
01711         return (CBase**)&m_pCRootBinder;
01712       else if(m_pCServiceComp && m_pCServiceComp->m_pIUnknown)
01713         return (CBase**)&m_pCServiceComp;
01714       else if(m_pCDataLinks && m_pCDataLinks->m_pIUnknown)
01715         return (CBase**)&m_pCDataLinks;
01716       break;
01717
01718     default:
01719       break;
01720   };
01721
01722   return ppCObject;
01723 }
01724
01725
01726 /////////////////////////////////////////////////////////////////////////////
01727 // CMainWindow::OnSize
01728 //
01729 /////////////////////////////////////////////////////////////////////////////
01730 BOOL CMainWindow::OnSize(WPARAM nType, REFPOINTS pts)
01731 {
01732   ASSERT(m_CToolBar.m_hWnd);
01733   ASSERT(m_CStatusBar.m_hWnd);
01734
01735   // calculate proper text height for tool and status bars
01736   SIZE sizeToolBar  = GetWindowSize(m_CToolBar.m_hWnd);
01737   SIZE sizeStatusBar  = GetWindowSize(m_CStatusBar.m_hWnd);
01738
01739   switch(nType)
01740   {
01741     case SIZE_RESTORED:
01742     case SIZE_MAXIMIZED:
01743     {
01744       if(pts.x && pts.y)
01745       {
01746         //ToolBar
01747         MoveWindow(m_CToolBar.m_hWnd, 0, 0, pts.x, sizeToolBar.cy, /*FALSE*/TRUE);
01748
01749         //StatusBar
01750         MoveWindow(m_CStatusBar.m_hWnd, 0, pts.y-sizeStatusBar.cy, pts.x, sizeStatusBar.cy, /*FALSE*/TRUE);
01751
01752         //MDI Client Area
01753         MoveWindow(m_hWndMDIClient,   0, sizeToolBar.cy, pts.x, pts.y-sizeToolBar.cy-sizeStatusBar.cy, /*FALSE*/TRUE);
01754         return TRUE;
01755       }
01756
01757       return FALSE;
01758     }
01759   };
01760
01761   return FALSE;
01762 }
01763
01764
01765 /////////////////////////////////////////////////////////////////////////////
01766 // CMainWindow::LoadSettings
01767 //
01768 /////////////////////////////////////////////////////////////////////////////
01769 BOOL CMainWindow::LoadSettings()
01770 {
01771   HKEY hOptionsKey = NULL;
01772   memset(&m_wndPlacement, 0, sizeof(m_wndPlacement));
01773
01774   //Open the key to make things a little quicker and direct...
01775   TESTC_(OpenRegKey(HKEY_ROWSETVIEWER, wszOPTIONS_KEY, 0, KEY_READ, &hOptionsKey),S_OK);
01776
01777   //Window Positions
01778   GetRegEntry(hOptionsKey, NULL, L"WinPosition",    &m_wndPlacement,  sizeof(m_wndPlacement), NULL);
01779
01780 CLEANUP:
01781   CloseRegKey(hOptionsKey);
01782   return TRUE;
01783 }
01784
01785
01786 /////////////////////////////////////////////////////////////////////////////
01787 // CMainWindow::SaveSettings
01788 //
01789 /////////////////////////////////////////////////////////////////////////////
01790 BOOL CMainWindow::SaveSettings()
01791 {
01792   HKEY hOptionsKey = NULL;
01793
01794   //Open the key to make things a little quicker and direct...
01795   TESTC_(CreateRegKey(HKEY_ROWSETVIEWER, wszOPTIONS_KEY, &hOptionsKey),S_OK);
01796
01797   //Window Positions
01798   if(GetWindowPlacement())
01799     SetRegEntry(hOptionsKey, NULL, L"WinPosition",    &m_wndPlacement,  sizeof(m_wndPlacement));
01800
01801 CLEANUP:
01802   CloseRegKey(hOptionsKey);
01803   return TRUE;
01804 }
01805
01806
01807 /////////////////////////////////////////////////////////////////////////////
01808 // CMainWindow::OnAbout
01809 //
01810 /////////////////////////////////////////////////////////////////////////////
01811 void CMainWindow::OnAbout()
01812 {
01813   CAboutDlg aboutDlg;
01814   aboutDlg.DoModal(m_hWnd);
01815 }
01816
01817
01818 ////////////////////////////////////////////////////////////////
01819 // CMainWindow::UpdateControls
01820 //
01821 /////////////////////////////////////////////////////////////////
01822 BOOL CMainWindow::UpdateControls()
01823 {
01824   //Obtain the Active MDI window
01825   CMDIChild*    pCMDIChild    = (CMDIChild*)GetActiveWindow(L"MDICHILD");
01826   CDataSource*  pCDataSource  = pCMDIChild ? (CDataSource*)pCMDIChild->GetObject(eCDataSource) : NULL;
01827   CSession*   pCSession   = pCMDIChild ? (CSession*)pCMDIChild->GetObject(eCSession) : NULL;
01828   CCommand*   pCCommand   = pCMDIChild ? (CCommand*)pCMDIChild->GetObject(eCCommand) : NULL;
01829   CRowset*    pCRowset    = pCMDIChild ? (CRowset*)pCMDIChild->GetObject(eCRowset) : NULL;
01830
01831   //Update the ToolBar
01832   m_CToolBar.EnableButton(IDM_FULLCONNECT,            TRUE);
01833   m_CToolBar.EnableButton(IDM_FULLDISCONNECT,           pCMDIChild != NULL);
01834   m_CToolBar.EnableButton(IDM_IDBCREATESESSION_CREATESESSION,   pCDataSource  && pCDataSource->m_pIDBCreateSession);
01835   m_CToolBar.EnableButton(IDM_OPENROWSET,             pCSession && pCSession->m_pIOpenRowset);
01836   m_CToolBar.EnableButton(IDM_EXECUTE,              pCCommand   && pCCommand->m_pICommand);
01837   m_CToolBar.EnableButton(IDM_RESTARTPOSITION,          pCRowset    && pCRowset->m_pIRowset);
01838   m_CToolBar.EnableButton(IDM_REFRESH,              pCRowset    && pCRowset->m_pIRowset);
01839   m_CToolBar.EnableButton(IDM_GETSCHEMAROWSET,          pCSession   && pCSession->m_pIDBSchemaRowset);
01840   m_CToolBar.EnableButton(IDM_INSERTROW,              pCRowset    && pCRowset->m_pIRowsetChange);
01841   m_CToolBar.EnableButton(IDM_DELETEROWS,             pCRowset    && pCRowset->m_pIRowsetChange);
01842   m_CToolBar.EnableButton(IDM_SETDATA,              pCRowset    && pCRowset->m_pIRowsetChange);
01843   m_CToolBar.EnableButton(IDM_UPDATE,               pCRowset    && pCRowset->m_pIRowsetUpdate);
01844   m_CToolBar.EnableButton(IDM_UNDO,               pCRowset    && pCRowset->m_pIRowsetUpdate);
01845   return TRUE;
01846 }
01847
01848
01849 ////////////////////////////////////////////////////////////////
01850 // CMainWindow::RemoveAllChildren
01851 //
01852 /////////////////////////////////////////////////////////////////
01853 BOOL CMainWindow::RemoveAllChildren()
01854 {
01855   CMDIChild* pCMDIChild = NULL;
01856
01857   //hide MDI Client Windows to avoid repaints
01858 	::ShowWindow(m_hWndMDIClient, SW_HIDE);
01859
01860   //First remove all MDI Child windows
01861   while(pCMDIChild = (CMDIChild*)FindWindow(L"MDICHILD"))
01862   {
01863     MDIDestroy(pCMDIChild->m_hWnd);
01864     SAFE_DELETE(pCMDIChild);
01865   }
01866
01867 	::ShowWindow(m_hWndMDIClient, SW_SHOW);
01868   return TRUE;
01869 }
01870
01871
01872 /////////////////////////////////////////////////////////////////////////////
01873 // CMainWindow::OnAddRef
01874 //
01875 /////////////////////////////////////////////////////////////////////////////
01876 void CMainWindow::OnAddRef(CBase* pCBase)
01877 {
01878   if(pCBase && pCBase->m_pIUnknown)
01879   {
01880     CWaitCursor waitCursor;
01881     pCBase->ObjectAddRef();
01882   }
01883 }
01884
01885
01886 /////////////////////////////////////////////////////////////////////////////
01887 // CMainWindow::OnRelease
01888 //
01889 /////////////////////////////////////////////////////////////////////////////
01890 void CMainWindow::OnRelease(CBase* pCBase)
01891 {
01892   if(pCBase && pCBase->m_pIUnknown)
01893   {
01894     CWaitCursor waitCursor;
01895
01896     //Release this object
01897     pCBase->ObjectRelease();
01898     UpdateControls();
01899
01900     //Update the Window
01901     CMDIChild* pCMDIChild = pCBase->m_pCMDIChild;
01902     if(pCMDIChild)
01903     {
01904       //if there are no more objects remaining for this window,
01905       //there is no real reason to display it...
01906       if(!pCMDIChild->GetObject())
01907       {
01908         //No objects left, remove the window...
01909         MDIDestroy(pCMDIChild->m_hWnd);
01910         SAFE_DELETE(pCMDIChild);
01911       }
01912       else
01913       {
01914         //There is at least one object, just update the controls...
01915         pCMDIChild->UpdateControls();
01916       }
01917     }
01918   }
01919 }
01920
01921
01922 /////////////////////////////////////////////////////////////////////////////
01923 // CMainWindow::OnReleaseAll
01924 //
01925 /////////////////////////////////////////////////////////////////////////////
01926 void CMainWindow::OnReleaseAll(CBase* pCBase, BOOL fChildren)
01927 {
01928   if(pCBase && pCBase->m_pIUnknown)
01929   {
01930     CWaitCursor waitCursor;
01931
01932     //Release children
01933     if(fChildren)
01934       pCBase->ReleaseChildren();
01935
01936     //Now, Release this object
01937     pCBase->ReleaseObject();
01938     UpdateControls();
01939
01940     //Update the Window
01941     CMDIChild* pCMDIChild = pCBase->m_pCMDIChild;
01942     if(pCMDIChild)
01943     {
01944       //if there are no more objects remaining for this window,
01945       //there is no real reason to display it...
01946       CBase* pCBase = pCMDIChild->GetObject();
01947       if(!pCBase || pCBase->m_pCMDIChild!=pCMDIChild)
01948       {
01949         //No objects left, remove the window...
01950         MDIDestroy(pCMDIChild->m_hWnd);
01951         SAFE_DELETE(pCMDIChild);
01952       }
01953       else
01954       {
01955         //There is at least one object, just update the controls...
01956         pCMDIChild->UpdateControls();
01957       }
01958     }
01959   }
01960 }
01961
01962 /////////////////////////////////////////////////////////////////////////////
01963 // CMainWindow::OnQueryInterface
01964 //
01965 /////////////////////////////////////////////////////////////////////////////
01966 void CMainWindow::OnQueryInterface(CBase* pCBase)
01967 {
01968   if(pCBase && pCBase->m_pIUnknown)
01969   {
01970     CInterfaceDlg interfaceDlg(IDD_INTERFACE, L"IUnknown::QueryInterface", pCBase->GetDefaultInterface());
01971     if(interfaceDlg.DoModal(GetFocus()) == IDOK)
01972     {
01973       CWaitCursor waitCursor;
01974
01975       //IUnknown::QueryInterface
01976       pCBase->ObjectQI(interfaceDlg.GetSelInterface(), interfaceDlg.ppUnknown());
01977
01978       UpdateControls();
01979       if(pCBase->m_pCMDIChild)
01980         pCBase->m_pCMDIChild->UpdateControls();
01981     }
01982   }
01983 }
01984
01985
01986 /////////////////////////////////////////////////////////////////////////////
01987 // CMainWindow::OnAutoQI
01988 //
01989 /////////////////////////////////////////////////////////////////////////////
01990 void CMainWindow::OnAutoQI(CBase* pCBase)
01991 {
01992   if(pCBase && pCBase->m_pIUnknown)
01993   {
01994     CWaitCursor waitCursor;
01995
01996     //Obtain all interfaces
01997     pCBase->AutoQI(CREATE_QI_MANDATORY | CREATE_QI_OPTIONAL);
01998
01999     //Also "redraw" the object now that more interfaces are available for use
02000     //For Example: If the rowset was originally obtained with AutiQI off, and
02001     //now the user wished to see the rowset, we display the object...
02002     pCBase->DisplayObject();
02003
02004     //And update any common controls...
02005     UpdateControls();
02006     if(pCBase->m_pCMDIChild)
02007       pCBase->m_pCMDIChild->UpdateControls();
02008   }
02009 }
02010
02011
02012 /////////////////////////////////////////////////////////////////////////////
02013 // CMainWindow::OnSupportErrorInfo
02014 //
02015 /////////////////////////////////////////////////////////////////////////////
02016 void CMainWindow::OnSupportErrorInfo(CBase* pCBase)
02017 {
02018   if(pCBase && pCBase->m_pISupportErrorInfo)
02019   {
02020     HRESULT hr = S_OK;
02021
02022     CInterfaceDlg interfaceDlg(IDD_INTERFACE, L"ISupportErrorInfo::InterfaceSupportsErrorInfo", pCBase->GetDefaultInterface());
02023     if(interfaceDlg.DoModal(GetFocus()) == IDOK)
02024     {
02025       CWaitCursor waitCursor;
02026
02027       //ISupportErrorInfo::InterfaceSupportsErrorInfo
02028       XTEST(hr = pCBase->m_pISupportErrorInfo->InterfaceSupportsErrorInfo(interfaceDlg.GetSelInterface()));
02029       TRACE_METHOD(hr, L"ISupportErrorInfo::InterfaceSupportsErrorInfo(%s)", GetInterfaceName(interfaceDlg.GetSelInterface()));
02030     }
02031   }
02032 }
02033
02034
02035 /////////////////////////////////////////////////////////////////////////////
02036 // CMainWindow::OnFindConnectionPoint
02037 //
02038 /////////////////////////////////////////////////////////////////////////////
02039 void CMainWindow::OnFindConnectionPoint(CContainerBase* pCCPoint, REFIID riid)
02040 {
02041   if(pCCPoint && pCCPoint->m_pIConnectionPointContainer)
02042   {
02043     //Display the Generic interface list...
02044     CInterfaceDlg interfaceDlg(IDD_INTERFACE, L"IConnectionPointContainer::FindConnectionPoint", riid);
02045     if(interfaceDlg.DoModal(GetFocus()) == IDOK)
02046     {
02047       CWaitCursor waitCursor;
02048       IConnectionPoint* pIConnectionPoint = NULL;
02049
02050       //IConnectionPointContainer::FindConnectionPoint
02051       if(SUCCEEDED(pCCPoint->FindConnectionPoint(interfaceDlg.GetSelInterface(), &pIConnectionPoint)))
02052         HandleObjectType(pCCPoint, pIConnectionPoint, interfaceDlg.GetSelInterface(), eCConnectionPoint, 0, NULL, CREATE_NEWWINDOW_IFEXISTS);
02053       TRACE_RELEASE(pIConnectionPoint, L"IConnectionPoint");
02054     }
02055   }
02056 }
02057
02058
02059 /////////////////////////////////////////////////////////////////////////////
02060 // CMainWindow::OnAdvise
02061 //
02062 /////////////////////////////////////////////////////////////////////////////
02063 void CMainWindow::OnAdvise(CConnectionPoint* pCConnectionPoint)
02064 {
02065   if(pCConnectionPoint && pCConnectionPoint->m_pIConnectionPoint)
02066   {
02067     m_pCListener->Advise(pCConnectionPoint->m_pIConnectionPoint, &pCConnectionPoint->m_dwCookie);
02068   }
02069 }
02070
02071
02072 /////////////////////////////////////////////////////////////////////////////
02073 // CMainWindow::OnUnadvise
02074 //
02075 /////////////////////////////////////////////////////////////////////////////
02076 void CMainWindow::OnUnadvise(CConnectionPoint* pCConnectionPoint)
02077 {
02078   if(pCConnectionPoint && pCConnectionPoint->m_pIConnectionPoint)
02079   {
02080     m_pCListener->Unadvise(pCConnectionPoint->m_pIConnectionPoint, &pCConnectionPoint->m_dwCookie);
02081   }
02082 }
02083
02084
02085 /////////////////////////////////////////////////////////////////////////////
02086 // CMainWindow::OnGetConnectionInterface
02087 //
02088 /////////////////////////////////////////////////////////////////////////////
02089 void CMainWindow::OnGetConnectionInterface(CConnectionPoint* pCConnectionPoint)
02090 {
02091   if(pCConnectionPoint && pCConnectionPoint->m_pIConnectionPoint)
02092   {
02093     CWaitCursor waitCursor;
02094     IID iid;
02095
02096     pCConnectionPoint->GetConnectionInterface(&iid);
02097   }
02098 }
02099
02100
02101 /////////////////////////////////////////////////////////////////////////////
02102 // CMainWindow::OnAbort
02103 //
02104 /////////////////////////////////////////////////////////////////////////////
02105 void CMainWindow::OnAbort(CAsynchBase* pCAsynchBase)
02106 {
02107   if(pCAsynchBase && pCAsynchBase->m_pIDBAsynchStatus)
02108   {
02109     CWaitCursor waitCursor;
02110
02111     //IDBAsynchStatus::Abort
02112     XTEST(pCAsynchBase->Abort(NULL, DBASYNCHOP_OPEN));
02113   }
02114 }
02115
02116 /////////////////////////////////////////////////////////////////////////////
02117 // CMainWindow::OnGetStatus
02118 //
02119 /////////////////////////////////////////////////////////////////////////////
02120 void CMainWindow::OnGetStatus(CAsynchBase* pCAsynchBase)
02121 {
02122   if(pCAsynchBase && pCAsynchBase->m_pIDBAsynchStatus)
02123   {
02124     CWaitCursor waitCursor;
02125
02126     DBCOUNTITEM ulProgress = 0;
02127     DBCOUNTITEM ulProgressMax = 0;
02128     DBASYNCHPHASE ulAsynchPhase = 0;
02129     LPOLESTR pwszStatusText = NULL;
02130
02131     //IDBAsynchStatus::GetStatus
02132     XTEST(pCAsynchBase->GetStatus(NULL, DBASYNCHOP_OPEN, &ulProgress, &ulProgressMax, &ulAsynchPhase, &pwszStatusText));
02133     SAFE_FREE(pwszStatusText);
02134   }
02135 }
02136
02137
02138 /////////////////////////////////////////////////////////////////////////////
02139 // CMainWindow::OnInitialize
02140 //
02141 /////////////////////////////////////////////////////////////////////////////
02142 void CMainWindow::OnInitialize(CAsynchBase* pCAsynchBase)
02143 {
02144   if(pCAsynchBase && pCAsynchBase->m_pIDBInitialize)
02145   {
02146     CWaitCursor waitCursor;
02147
02148     pCAsynchBase->Initialize();
02149     UpdateControls();
02150   }
02151 }
02152
02153
02154 /////////////////////////////////////////////////////////////////////////////
02155 // CMainWindow::OnUninitialize
02156 //
02157 /////////////////////////////////////////////////////////////////////////////
02158 void CMainWindow::OnUninitialize(CAsynchBase* pCAsynchBase)
02159 {
02160   if(pCAsynchBase && pCAsynchBase->m_pIDBInitialize)
02161   {
02162     CWaitCursor waitCursor;
02163
02164     pCAsynchBase->Uninitialize();
02165     UpdateControls();
02166   }
02167 }
02168
02169
02170 /////////////////////////////////////////////////////////////////////////////
02171 // CMainWindow::OnConnect
02172 //
02173 /////////////////////////////////////////////////////////////////////////////
02174 void CMainWindow::OnConnect()
02175 {
02176   CWaitCursor waitCursor;
02177
02178   //Bring up FullConnect dialog
02179   m_pCFullConnect->Display(m_hWnd);
02180   UpdateControls();
02181 }
02182
02183
02184 /////////////////////////////////////////////////////////////////////////////
02185 // CMainWindow::OnLoadStringFromStorage
02186 //
02187 /////////////////////////////////////////////////////////////////////////////
02188 void CMainWindow::OnLoadStringFromStorage(WCHAR* pwszFileName)
02189 {
02190   CWaitCursor waitCursor;
02191   WCHAR wszFileName[MAX_QUERY_LEN] = {0};
02192   HRESULT hr = S_OK;
02193
02194   //Display Common Dialog to obtain File To Load...
02195   if(!pwszFileName)
02196   {
02197     hr = BrowseOpenFileName(GetAppLite()->m_hInstance, m_hWnd, L"IDataInitialize::LoadStringFromStorage", wszFileName, MAX_QUERY_LEN, L"udl", L"Microsoft Data Link Files (.udl)\0*.udl\0All Files (*.*)\0*.*\0\0");
02198     pwszFileName = wszFileName;
02199   }
02200
02201   //Load the UDL file
02202   if(SUCCEEDED(hr))
02203   {
02204     WCHAR* pwszInitString = NULL;
02205
02206     //Now LoadStringFromStorage
02207     hr = m_pCServiceComp->LoadInitString(pwszFileName, &pwszInitString);
02208     if(SUCCEEDED(hr))
02209     {
02210       SAFE_FREE(m_pCServiceComp->m_pwszInitString);
02211       m_pCServiceComp->m_pwszInitString = pwszInitString;
02212
02213       //Need to bring up the GetDataSource Dialog
02214       DisplayDialog(IDD_DATAINIT_GETDATASOURCE, m_hWnd, CMainWindow::GetDataSourceProc, m_pCServiceComp);
02215       UpdateControls();
02216     }
02217   }
02218 }
02219
02220
02221 /////////////////////////////////////////////////////////////////////////////
02222 // CMainWindow::OnGetDataSource
02223 //
02224 /////////////////////////////////////////////////////////////////////////////
02225 void CMainWindow::OnGetDataSource()
02226 {
02227   //Default Operation for DataLinks is GetDataSource...
02228   m_pCServiceComp->OnDefOperation();
02229 }
02230
02231 /////////////////////////////////////////////////////////////////////////////
02232 // CMainWindow::OnCreateFileMoniker
02233 //
02234 /////////////////////////////////////////////////////////////////////////////
02235 void CMainWindow::OnCreateFileMoniker()
02236 {
02237   WCHAR wszFileName[MAX_QUERY_LEN] = {0};
02238   IMoniker* pIMoniker = NULL;
02239   IBindCtx* pIBindCtx = NULL;
02240
02241   //Display Common Dialog to obtain File To Load...
02242   HRESULT hr = BrowseOpenFileName(GetAppLite()->m_hInstance, m_hWnd, L"CreateFileMoniker", wszFileName, MAX_QUERY_LEN, L"udl", L"Microsoft Data Link Files (.udl)\0*.udl\0All Files (*.*)\0*.*\0\0");
02243   if(SUCCEEDED(hr))
02244   {
02245     //CreateFileMoniker
02246     //TODO: Do we just want to create this as a tree object, and let the user play with
02247     //it or always just call BindToObject?
02248     XTEST(hr = CreateFileMoniker(wszFileName, &pIMoniker));
02249     TESTC(TRACE_METHOD(hr, L"CreateFileMoniker(\"%s\", &0x%p)", wszFileName, pIMoniker));
02250
02251     //Need to ask for the riid...
02252     CInterfaceDlg interfaceDlg(IDD_INTERFACE, L"IMoniker::BindToObject", IID_IDBInitialize);
02253     if(interfaceDlg.DoModal(GetFocus()) == IDOK)
02254     {
02255       CWaitCursor waitCursor;
02256
02257       //Setup BIND_OPTS
02258       BIND_OPTS2 BindOps2;
02259       BindOps2.cbStruct   = sizeof(BIND_OPTS2);
02260       BindOps2.grfFlags   = BIND_MAYBOTHERUSER;
02261       BindOps2.grfMode    = STGM_READWRITE;
02262       BindOps2.dwTickCountDeadline = 0;
02263       BindOps2.dwTrackFlags = 1;
02264       BindOps2.dwClassContext = CLSCTX_INPROC_SERVER;
02265       BindOps2.locale     = GetSystemDefaultLCID();
02266       BindOps2.pServerInfo  = NULL;
02267
02268       //If this fails for some reason, we may be albe to still continue...
02269       hr = CreateBindCtx(0, &pIBindCtx);
02270       if(SUCCEEDED(hr) && pIBindCtx)
02271         hr = pIBindCtx->SetBindOptions(&BindOps2);
02272
02273       //IMoniker::BindToObject
02274       XTEST(hr = pIMoniker->BindToObject(pIBindCtx, NULL, interfaceDlg.GetSelInterface(), (void**)interfaceDlg.ppUnknown()));
02275       TESTC(TRACE_METHOD(hr, L"IMoniker::BindToObject(0x%p, 0x%p, %s, &0x%p)", pIBindCtx, NULL, GetInterfaceName(interfaceDlg.GetSelInterface()), interfaceDlg.pUnknown()));
02276
02277       //Now dump the resultant object into our tree...
02278       //Make a guess that its probably a datasource
02279       //NOTE: Can pontentially return other object types: (ie: CREATE_DETERMINE_TYPE)
02280       if(!HandleObjectType(NULL, interfaceDlg.pUnknown(), interfaceDlg.GetSelInterface(), eCDataSource, 0, NULL, CREATE_NEWWINDOW | CREATE_DETERMINE_TYPE | GetOptions()->m_dwCreateOpts))
02281         TESTC(hr = E_FAIL);
02282     }
02283   }
02284
02285 CLEANUP:
02286   TRACE_RELEASE(pIMoniker, L"IMoniker");
02287   TRACE_RELEASE(pIBindCtx, L"IBindCtx");
02288 }
02289
02290
02291 /////////////////////////////////////////////////////////////////////////////
02292 // CMainWindow::OnPromptDataSource
02293 //
02294 /////////////////////////////////////////////////////////////////////////////
02295 void CMainWindow::OnPromptDataSource(BOOL fAdvanced)
02296 {
02297   if(m_pCDataLinks && m_pCDataLinks->m_pIDBPromptInitialize)
02298   {
02299     if(fAdvanced)
02300     {
02301       //Bring up dialog to allow setting of all parameters...
02302       DisplayDialog(IDD_PROMPTDATASOURCE, m_hWnd, CMainWindow::PromptDataSourceProc, m_pCDataLinks);
02303     }
02304     else
02305     {
02306       //Default Operation for DataLinks is to Prompt...
02307       m_pCDataLinks->OnDefOperation();
02308     }
02309
02310     UpdateControls();
02311   }
02312 }
02313
02314 /////////////////////////////////////////////////////////////////////////////
02315 // CMainWindow::OnPromptFileName
02316 //
02317 /////////////////////////////////////////////////////////////////////////////
02318 void CMainWindow::OnPromptFileName(BOOL fAdvanced)
02319 {
02320   if(m_pCDataLinks && m_pCDataLinks->m_pIDBPromptInitialize)
02321   {
02322     if(fAdvanced)
02323     {
02324       //Bring up dialog to allow setting of all parameters...
02325       m_pCSource = m_pCDataLinks;
02326       DisplayDialog(IDD_PROMPTFILENAME, m_hWnd, CMainWindow::PromptFileNameProc, m_pCDataLinks);
02327     }
02328     else
02329     {
02330       WCHAR* pwszSelectedFile = NULL;
02331
02332       //Just display the PromptFileName dialog directly (common case)
02333       if(SUCCEEDED(m_pCDataLinks->PromptFileName(
02334                 m_hWnd,               // hWndParent
02335                 0,                  // dwPromptOptions
02336                       NULL,               // pwszInitialDirectory
02337                       NULL,               // pwszInitialFile
02338                       &pwszSelectedFile         // pwszSelectedFile
02339                 )))
02340       {
02341         //Delegate, and Connect from the Selected File
02342         m_pCServiceComp->ConnectFromFile(pwszSelectedFile);
02343       }
02344
02345       SAFE_FREE(pwszSelectedFile);
02346     }
02347
02348     UpdateControls();
02349   }
02350 }
02351
02352
02353
02354
02355 ////////////////////////////////////////////////////////////////
02356 // CMainWindow::ErrorRecordsProc
02357 //
02358 /////////////////////////////////////////////////////////////////
02359 INT_PTR WINAPI CMainWindow::ErrorRecordsProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
02360 {
02361   static CComboBoxLite    s_CComboRecord;
02362   static CComboBoxLite    s_CComboLCID;
02363   static ULONG  ulRecord  = 0;                //Default
02364   static LCID   lcid    = GetSystemDefaultLCID();     //Default
02365   static BOOL   fOutput   = TRUE;               //Default
02366
02367   switch(message)
02368   {
02369     case WM_INITDIALOG:
02370     {
02371       CWaitCursor waitCursor;
02372
02373       //Save the "this" pointer
02374       CMainWindow* pThis  = (CMainWindow*)SetThis(hWnd, (void*)lParam);
02375       CError* pCError   = SOURCE_GETOBJECT(pThis->m_pCSource, CError);
02376       ULONG cRecords = 0;
02377       WCHAR wszBuffer[POINTER_DISPLAYSIZE] = {0};
02378       HRESULT hr = S_OK;
02379
02380       //Obtain the total number of error records...
02381       hr = pCError->GetRecordCount(&cRecords);
02382       if(FAILED(hr) || !cRecords)
02383         cRecords=0;
02384
02385       //Record List...
02386       s_CComboRecord.CreateIndirect(hWnd, IDC_RECORD);
02387       for(ULONG i=0; i<cRecords; i++)
02388       {
02389         StringFormat(wszBuffer, NUMELE(wszBuffer), L"%d", i);
02390         s_CComboRecord.AddString(wszBuffer, i);
02391       }
02392       StringFormat(wszBuffer, NUMELE(wszBuffer), L"%d", ulRecord);
02393       s_CComboRecord.SetSelText(wszBuffer, TRUE/*fAddItem*/);
02394
02395       //LCID List...
02396       s_CComboLCID.CreateIndirect(hWnd, IDC_LCID);
02397       s_CComboLCID.Populate(g_cLCID, g_rgLCID);
02398       if(s_CComboLCID.SetSelValue(lcid) == CB_ERR)
02399       {
02400         StringFormat(wszBuffer, NUMELE(wszBuffer), L"%d", lcid);
02401         s_CComboLCID.SetSelText(wszBuffer, TRUE/*fAddItem*/);
02402       }
02403
02404       //Output (ppIUnknown)
02405 			::CheckDlgButton(hWnd, IDB_OUTPUT,     BST2STATE(fOutput));
02406
02407       CenterDialog(hWnd);
02408       return TRUE;
02409     }
02410
02411     case WM_COMMAND:
02412     {
02413       //Filter out any Control Notification codes
02414       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
02415       {
02416         return UNHANDLED_MSG;
02417       }
02418
02419       switch (GET_WM_COMMAND_ID(wParam, lParam))
02420       {
02421         case IDOK:
02422         {
02423           CWaitCursor waitCursor;
02424
02425           //Get the "this" pointer
02426           CMainWindow* pThis  = (CMainWindow*)GetThis(hWnd);
02427           CError* pCError   = SOURCE_GETOBJECT(pThis->m_pCSource, CError);
02428           IErrorInfo* pIErrorInfo = NULL;
02429           HRESULT hr = S_OK;
02430
02431           //Obtain the Output (ppIUnknown) argument
02432           fOutput   = ::IsDlgButtonChecked(hWnd, IDB_OUTPUT);
02433
02434           //Record
02435           if(!GetEditBoxValue(s_CComboRecord.m_hWnd, (LONG*)&ulRecord, 0/*Min*/))
02436             return FALSE;
02437
02438           //LCID
02439           lcid = (LCID)s_CComboLCID.GetItemParam(s_CComboLCID.GetCurSel());
02440           if(lcid == CB_ERR)
02441           {
02442             if(!GetEditBoxValue(s_CComboLCID.m_hWnd, (LONG*)&lcid, 0/*Min*/))
02443               return FALSE;
02444           }
02445
02446           //IErrorRecords::GetErrorInfo
02447           hr = pCError->GetErrorInfo(ulRecord, lcid, fOutput ? &pIErrorInfo : NULL);
02448
02449           //Display the ErrorInfo object returned
02450           if(SUCCEEDED(hr))
02451             pThis->HandleObjectType(pCError, pIErrorInfo, IID_IErrorInfo, eCError, 0, NULL, 0/*dwFlags*/);
02452           TRACE_RELEASE(pIErrorInfo, L"IErrorInfo");
02453
02454           if(SUCCEEDED(hr))
02455             EndDialog(hWnd, TRUE);
02456           return 0;
02457         }
02458
02459         case IDCANCEL:
02460         {
02461           EndDialog(hWnd, FALSE);
02462           return 0;
02463         }
02464       }
02465       break;
02466     }//WM_COMMAND
02467   }
02468
02469   return FALSE;
02470 }
02471
02472
02473 ////////////////////////////////////////////////////////////////
02474 // CMainWindow::StreamViewerProc
02475 //
02476 /////////////////////////////////////////////////////////////////
02477 INT_PTR WINAPI CMainWindow::StreamViewerProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
02478 {
02479   static CDialogLite      s_CDialog;
02480   static CRichEditLite    s_editBox;
02481   static CComboBoxLite    s_comboTypes;
02482   static CButtonLite      s_button;
02483   static CWebBrowser      s_webBrowser;
02484
02485   static CRichEditLite    s_editOffset;
02486   static CRichEditLite    s_editCount;
02487   static LONG         s_lOffset   = 0;
02488   static LONG         s_cCount    = 1000;
02489
02490   switch(message)
02491   {
02492     case WM_INITDIALOG:
02493     {
02494       CWaitCursor waitCursor;
02495
02496       //Save the "this" pointer
02497       CMainWindow* pThis  = (CMainWindow*)SetThis(hWnd, (void*)lParam);
02498       CStream* pCStream = SOURCE_GETOBJECT(pThis->m_pCSource, CStream);
02499
02500       //Controls
02501       s_CDialog.CreateIndirect(hWnd);
02502       s_comboTypes.CreateIndirect(hWnd, IDC_BINDINGTYPE);
02503       s_button.CreateIndirect(hWnd, IDOK);
02504
02505       s_editBox.CreateIndirect(hWnd, IDE_VALUE);
02506       s_editBox.SetWordWrap(TRUE);
02507
02508       s_editOffset.CreateIndirect(hWnd, IDE_OFFSET);
02509       s_editOffset.EnableWindow();
02510       s_editCount.CreateIndirect(hWnd, IDE_COUNT);
02511       s_editCount.EnableWindow();
02512
02513       //Setup the webbrowser
02514       s_webBrowser.CreateIndirect(s_editBox.m_hWnd);
02515
02516       switch(pThis->m_idSource)
02517       {
02518         case IDM_ISEQSTREAM_READ:
02519           //Default text
02520 //          s_CDialog.SetWindowText(L"ISequentialStream::Read");
02521 //          s_button.SetWindowText(L"&Read");
02522
02523           //Offsets are not used in ISequentialStream
02524           s_editOffset.EnableWindow(FALSE);
02525           break;
02526
02527         case IDM_ISTREAM_READ:
02528           //Default text
02529           s_CDialog.SetWindowText(L"IStream::Read");
02530 //          s_button.SetWindowText(L"&Read");
02531           break;
02532
02533         case IDM_ISEQSTREAM_WRITE:
02534           s_CDialog.SetWindowText(L"ISequentialStream::Write");
02535           s_button.SetWindowText(L"&Write");
02536
02537           //Offsets are not used in ISequentialStream
02538           s_editOffset.EnableWindow(FALSE);
02539           break;
02540
02541         case IDM_ISTREAM_WRITE:
02542           s_CDialog.SetWindowText(L"ISequentialStream::Write");
02543           s_button.SetWindowText(L"&Write");
02544           break;
02545
02546         default:
02547           ASSERT(!L"Unhandled Case");
02548           break;
02549       };
02550
02551       //Supply Defaults to the lOffset and cRows
02552       wSendMessageFmt(s_editOffset.m_hWnd, WM_SETTEXT, 0, L"%ld", s_lOffset);
02553       wSendMessageFmt(s_editCount.m_hWnd, WM_SETTEXT, 0, L"%ld", s_cCount);
02554
02555       //Viewer
02556 			::CheckDlgButton(hWnd, IDB_XML_EDITBOX,    TRUE);
02557 			::CheckDlgButton(hWnd, IDB_XML_BROWSER,    FALSE);
02558 			::CheckDlgButton(hWnd, IDB_XML_DOM,      FALSE);
02559
02560       //Initialize the Type Dropdown
02561       for(ULONG i=0; i<g_cDBTypes; i++)
02562         s_comboTypes.Populate(g_cDBTypes, g_rgDBTypes);
02563       s_comboTypes.SetSelValue(pCStream->m_wType);
02564
02565       CenterDialog(hWnd);
02566       return TRUE;
02567     }
02568
02569     case WM_COMMAND:
02570     {
02571       //Filter out any Control Notification codes
02572       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
02573       {
02574         return UNHANDLED_MSG;
02575       }
02576
02577       switch(GET_WM_COMMAND_CMD(wParam, lParam))
02578       {
02579         case CBN_SELCHANGE:
02580         {
02581           //Convert the Data to the new selected type...
02582           //TODO:
02583           break;
02584         }
02585       }
02586
02587       switch (GET_WM_COMMAND_ID(wParam, lParam))
02588       {
02589         case IDB_XML_EDITBOX:
02590         {
02591           //Get the "this" pointer
02592           CMainWindow* pThis  = (CMainWindow*)GetThis(hWnd);
02593           CStream* pCStream = SOURCE_GETOBJECT(pThis->m_pCSource, CStream);
02594
02595           //Hide the Web Browser
02596           s_webBrowser.Show(OLEIVERB_HIDE);
02597           break;
02598         }
02599
02600         case IDB_XML_BROWSER:
02601         {
02602           //Get the "this" pointer
02603           CMainWindow* pThis  = (CMainWindow*)GetThis(hWnd);
02604           CStream* pCStream = SOURCE_GETOBJECT(pThis->m_pCSource, CStream);
02605
02606           if(pCStream->m_pIUnknown)
02607           {
02608             //TODO: I cannot get IE (Web Browser control) to load the stream directly
02609             //The best that I have found is to dump the stream to a file, and then
02610             WCHAR* pwszFileName = L"RowsetViewer_Temp.xml";
02611             WCHAR wszFullPath[MAX_PATH+1] = {0};
02612             BOOL  fUnicodeStream = -1;
02613
02614             DBLENGTH cbRead = 0;
02615             DBLENGTH lOffset = 0;
02616             BYTE rgBytes[MAX_BLOCK_SIZE];
02617             BYTE* pBytes = rgBytes;
02618
02619             //Save the stream of bytes to a file
02620             //Open file as "CreateAlways" so we don't create numerous temp files...
02621             CFileLite cFile;
02622             XTEST(cFile.Open(pwszFileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS));
02623
02624             //NOTE: The SQLXML Stream returned does not have the root node, only data.
02625             //So we have to output the Header/Root node ourseleves.  But we have to do it
02626             //after we know weither its a unicode stream or not, since we need to place
02627             //the BOM
02628
02629             //Write out the header
02630             //NOTE: Our stream has to store the type of it, since the Stream returned from
02631             //the provider doesn't have the BOM mark included, even for unicode stream...
02632             if(pCStream->m_wType == DBTYPE_WSTR)
02633               cFile.SetUnicode();
02634             cFile.Write("<RowsetViewer>");
02635
02636             //Write out the stream (in chunks)
02637             while(SUCCEEDED(pCStream->ReadBytes(IID_IUnknown, lOffset, sizeof(rgBytes), sizeof(rgBytes), rgBytes, &cbRead))
02638               && cbRead)
02639             {
02640               cFile.WriteBytes((ULONG)cbRead, pBytes, NULL);
02641               lOffset += cbRead;
02642             }
02643
02644             //Write Footer
02645             cFile.Write("</RowsetViewer>");
02646
02647             //Flush the file
02648             cFile.Close();
02649
02650             //Now load the file - using the IE Browser
02651             //NOTE: IE requires a full path and fails with a relative path,
02652             //so formulate the full path of the current directory
02653             XTEST(CreateDefFileName(pwszFileName, wszFullPath, NUMELE(wszFullPath)));
02654             XTEST(s_webBrowser.Navigate(wszFullPath));
02655           }
02656           break;
02657         }
02658
02659         case IDB_XML_DOM:
02660         {
02661           //Get the "this" pointer
02662           CMainWindow* pThis  = (CMainWindow*)GetThis(hWnd);
02663           CStream* pCStream = SOURCE_GETOBJECT(pThis->m_pCSource, CStream);
02664
02665           //Hide the Web Browser
02666           s_webBrowser.Show(OLEIVERB_HIDE);
02667           if(pCStream->m_pIUnknown)
02668           {
02669             CXmlDOM   xmlDOM;
02670             CComPtr<IXMLDOMNode>    spXMLNode;
02671             CStorageBuffer        cStorageBuffer;
02672             HRESULT hr = S_OK;
02673
02674             //Create the DOM
02675             XTEST(hr = xmlDOM.Create());
02676
02677             //NOTE: We need to add the root node, since the stream returned from the
02678             //provider only contains the data and the DOM requires only 1 root element.
02679             //We can obtain the stream from the document, and manually build
02680             //the xml from pieces...
02681             DBLENGTH cbRead = 0;
02682             DBLENGTH lOffset = 0;
02683             BYTE rgBytes[MAX_BLOCK_SIZE];
02684
02685             //Write the Header (not the null terminator)
02686             if(pCStream->m_wType == DBTYPE_WSTR)
02687             {
02688               //BOM
02689               XTEST(cStorageBuffer.Write(&UNICODE_BYTE_ORDER_MARK, sizeof(UNICODE_BYTE_ORDER_MARK), NULL));
02690               XTEST(cStorageBuffer.Write(L"<RowsetViewer>", sizeof(L"<RowsetViewer>")-sizeof(WCHAR), NULL));
02691             }
02692             else
02693             {
02694               XTEST(cStorageBuffer.Write("<RowsetViewer>", sizeof("<RowsetViewer>")-sizeof(CHAR), NULL));
02695             }
02696
02697             //Dump the entire provider stream into the DOM (manually)
02698             //Write out the stream (in chunks)
02699             while(SUCCEEDED(pCStream->ReadBytes(IID_IUnknown, lOffset, sizeof(rgBytes), sizeof(rgBytes), rgBytes, &cbRead))
02700               && cbRead)
02701             {
02702               XTEST(cStorageBuffer.Write(rgBytes, (ULONG)cbRead, NULL));
02703               lOffset += cbRead;
02704             }
02705
02706             //Write the Footer (including the null terminator)
02707             if(pCStream->m_wType == DBTYPE_WSTR)
02708             {
02709               XTEST(cStorageBuffer.Write(L"</RowsetViewer>", sizeof(L"</RowsetViewer>")-sizeof(WCHAR), NULL));
02710             }
02711             else
02712             {
02713               XTEST(cStorageBuffer.Write("</RowsetViewer>", sizeof("</RowsetViewer>")-sizeof(CHAR), NULL));
02714             }
02715             cStorageBuffer.Seek(0);
02716
02717             //Load the XML Stream
02718             XTEST(hr = xmlDOM.LoadStream((IStream*)&cStorageBuffer));
02719
02720             //Walk the tree...
02721             if(SUCCEEDED(hr))
02722             {
02723               XTEST(xmlDOM.m_spXMLDocument.QueryInterface(&spXMLNode));
02724               XTEST(xmlDOM.PrintNode(spXMLNode, s_editBox));
02725             }
02726           }
02727           break;
02728         }
02729
02730         case IDOK:
02731         {
02732           CWaitCursor waitCursor;
02733
02734           //Get the "this" pointer
02735           CMainWindow* pThis  = (CMainWindow*)GetThis(hWnd);
02736           CStream* pCStream = SOURCE_GETOBJECT(pThis->m_pCSource, CStream);
02737           BOOL fRead = TRUE;
02738           IID iid = IID_NULL;
02739
02740           switch(pThis->m_idSource)
02741           {
02742             case IDM_ISEQSTREAM_READ:
02743               fRead = TRUE;
02744               iid = IID_ISequentialStream;
02745               break;
02746
02747             case IDM_ISTREAM_READ:
02748               fRead = TRUE;
02749               iid = IID_IStream;
02750               break;
02751
02752             case IDM_ISEQSTREAM_WRITE:
02753               fRead = FALSE;
02754               iid = IID_ISequentialStream;
02755               break;
02756
02757             case IDM_ISTREAM_WRITE:
02758               fRead = FALSE;
02759               iid = IID_IStream;
02760               break;
02761
02762             default:
02763               ASSERT(!L"Unhandled Case");
02764               break;
02765           };
02766
02767           //Obtain Defaults to the lOffset and cRows
02768           GetEditBoxValue(s_editOffset.m_hWnd, &s_lOffset);
02769           GetEditBoxValue(s_editCount.m_hWnd, &s_cCount, LONG_MIN/*Min*/, MAX_COL_SIZE/*Max*/);
02770
02771           //Viewer
02772           BOOL bEditBox = ::IsDlgButtonChecked(hWnd, IDB_XML_EDITBOX);
02773
02774           //Obtain the selected type to convert the stream to...
02775           pCStream->m_wType = (DBTYPE)s_comboTypes.GetSelValue();
02776
02777           //Do we need to read or write the data?
02778           if(fRead)
02779           {
02780             //Read the stream into a buffer to display...
02781             WCHAR wszBuffer[MAX_COL_SIZE] = {0};
02782             if(SUCCEEDED(pCStream->ReadString(iid, 0, s_cCount, MAX_COL_SIZE, wszBuffer)))
02783             {
02784               if(bEditBox)
02785               {
02786                 //Display the new data at the end
02787                 s_editBox.SetSel(LONG_MAX, LONG_MAX);
02788
02789                 //Plase the new data at the end (ie: read in chunks)
02790                 s_editBox.ReplaceSel(wszBuffer, TRUE);
02791               }
02792             }
02793           }
02794           else
02795           {
02796             //Obtain the data entered
02797             WCHAR* pwszValue = NULL;
02798             if(bEditBox)
02799             {
02800               pwszValue = s_editBox.GetWindowText();
02801             }
02802
02803             //ISequentialStream::Write
02804             if(SUCCEEDED(pCStream->WriteString(iid, 0, pwszValue ? wcslen(pwszValue)*sizeof(WCHAR) : 0, pwszValue)))
02805             {
02806             }
02807
02808             SAFE_FREE(pwszValue);
02809           }
02810
02811           return 0;
02812         }
02813
02814         case IDCANCEL:
02815         {
02816           EndDialog(hWnd, FALSE);
02817           return 0;
02818         }
02819       }
02820       break;
02821     }//WM_COMMAND
02822
02823     case WM_NOTIFY:
02824     {
02825       NM_UPDOWN* pUpDown = (NM_UPDOWN*)lParam;
02826
02827       //lOffset
02828       if(pUpDown->hdr.idFrom == IDC_SPIN_OFFSET)
02829       {
02830         s_lOffset += pUpDown->iDelta;
02831         wSendMessageFmt(::GetDlgItem(hWnd, IDE_OFFSET), WM_SETTEXT, 0, L"%ld", s_lOffset);
02832       }
02833
02834       //cRows
02835       if(pUpDown->hdr.idFrom == IDC_SPIN_COUNT)
02836       {
02837         s_cCount += pUpDown->iDelta;
02838         wSendMessageFmt(::GetDlgItem(hWnd, IDE_COUNT), WM_SETTEXT, 0, L"%ld", s_cCount);
02839       }
02840
02841       break;
02842     }//WM_NOTIFY
02843   }
02844
02845   return FALSE;
02846 }
02847
02848
02849 /////////////////////////////////////////////////////////////////////////////
02850 // CMainWindow::OnRootBinder
02851 //
02852 /////////////////////////////////////////////////////////////////////////////
02853 void CMainWindow::OnRootBinder()
02854 {
02855   //NOTE:  Creating the root binder is deferred.
02856   if(!m_pCRootBinder->m_pIBindResource)
02857   {
02858     CWaitCursor waitCursor;
02859     m_pCRootBinder->CreateBinder(CLSID_RootBinder);
02860   }
02861
02862   //Not only create the object so it ends up in the tree, but actually
02863   //automatically bring up the dialog, so its not always a 2 step process...
02864   m_pCRootBinder->OnDefOperation();
02865 }
02866
02867
02868 /////////////////////////////////////////////////////////////////////////////
02869 // CMainWindow::OnRootEnumerator
02870 //
02871 /////////////////////////////////////////////////////////////////////////////
02872 void CMainWindow::OnRootEnumerator()
02873 {
02874   //NOTE:  Creating the Root Enumerator is deferred.
02875   if(!m_pCRootEnumerator->m_pISourcesRowset)
02876   {
02877     CWaitCursor waitCursor;
02878     m_pCRootEnumerator->Create(CLSID_OLEDB_ENUMERATOR);
02879   }
02880
02881   //Not only create the object so it ends up in the tree, but actually
02882   //automatically bring up the dialog, so its not always a 2 step process...
02883   m_pCRootEnumerator->OnDefOperation();
02884 }
02885
02886
02887 /////////////////////////////////////////////////////////////////////////////
02888 // CMainWindow::OnServiceComponents
02889 //
02890 /////////////////////////////////////////////////////////////////////////////
02891 void CMainWindow::OnServiceComponents()
02892 {
02893   //NOTE:  Creating Service Components is deferred.
02894   if(!m_pCServiceComp->m_pIDataInitialize)
02895   {
02896     CWaitCursor waitCursor;
02897     m_pCServiceComp->Create(NULL);
02898   }
02899
02900   //Not only create the object so it ends up in the tree, but actually
02901   //automatically bring up the dialog, so its not always a 2 step process...
02902   OnGetDataSource();
02903 }
02904
02905
02906 /////////////////////////////////////////////////////////////////////////////
02907 // CMainWindow::OnDataLinks
02908 //
02909 /////////////////////////////////////////////////////////////////////////////
02910 void CMainWindow::OnDataLinks()
02911 {
02912   //NOTE:  Creating Service Components is deferred.
02913   if(!m_pCDataLinks || !m_pCDataLinks->m_pIDBPromptInitialize)
02914   {
02915     //Deferred Object Creation
02916     if(!m_pCDataLinks)
02917       m_pCDataLinks = new CDataLinks(this);
02918
02919     CWaitCursor waitCursor;
02920     m_pCDataLinks->Create(NULL);
02921   }
02922
02923   //Not only create the object so it ends up in the tree, but actually
02924   //automatically bring up the dialog, so its not always a 2 step process...
02925   m_pCDataLinks->OnDefOperation();
02926 }
02927
02928
02929 /////////////////////////////////////////////////////////////////////////////
02930 // CMainWindow::OnLoadRecentConfig
02931 //
02932 /////////////////////////////////////////////////////////////////////////////
02933 void CMainWindow::OnLoadRecentConfig(UINT iID)
02934 {
02935   if(m_pCFullConnect)
02936     m_pCFullConnect->LoadRecentConfig(iID);
02937 }
02938
02939 /////////////////////////////////////////////////////////////////////////////
02940 // CMainWindow::OnLoadRecentFile
02941 //
02942 /////////////////////////////////////////////////////////////////////////////
02943 void CMainWindow::OnLoadRecentFile(UINT iID)
02944 {
02945   if(m_pCFullConnect)
02946     m_pCFullConnect->LoadRecentFile(iID);
02947 }
02948
02949
02950 /////////////////////////////////////////////////////////////////////////////
02951 // CMainWindow::OnOptions
02952 //
02953 /////////////////////////////////////////////////////////////////////////////
02954 void CMainWindow::OnOptions()
02955 {
02956   if(m_pCFullConnect)
02957   {
02958     //Bring up the Property Sheet, and save if user pressed APPLY (OK)
02959     if(m_pCOptionsSheet->DoModal(m_hWnd) == IDOK)
02960     {
02961       CWaitCursor waitCursor;
02962       m_pCOptionsSheet->SaveOptions();
02963     }
02964   }
02965 }
02966
02967
02968 /////////////////////////////////////////////////////////////////////////////
02969 // CMainWindow::OnTraceWindow
02970 //
02971 /////////////////////////////////////////////////////////////////////////////
02972 void CMainWindow::OnTraceWindow()
02973 {
02974   //Is the trace window already active?
02975   CWndLite* pCWndLite = FindWindow(L"MDITRACE");
02976   if(pCWndLite)
02977   {
02978     //Just activate the existing window...
02979     MDIActivate(pCWndLite->m_hWnd);
02980     pCWndLite->ShowWindow(SW_SHOWNORMAL);
02981   }
02982   else
02983   {
02984     //Create and Display the Window...
02985     m_pCMDITrace->Create(m_hWndMDIClient, L"MDITRACE", L"Output", IDR_ROWSETVIEWER, ImageList_GetIcon(m_hImageList, IMAGE_FORM, ILD_NORMAL));
02986   }
02987 }
02988
02989
02990 /////////////////////////////////////////////////////////////////////////////
02991 // CMainWindow::OnObjectsWindow
02992 //
02993 /////////////////////////////////////////////////////////////////////////////
02994 void CMainWindow::OnObjectsWindow()
02995 {
02996   //Is the Objects window already active?
02997   CWndLite* pCWndLite = FindWindow(L"MDIOBJECTS");
02998   if(pCWndLite)
02999   {
03000     //Just activate the existing window...
03001     MDIActivate(pCWndLite->m_hWnd);
03002     pCWndLite->ShowWindow(SW_SHOWNORMAL);
03003   }
03004   else
03005   {
03006     //Create and Display the Window...
03007     m_pCMDIObjects->Create(m_hWndMDIClient, L"MDIOBJECTS", L"Objects", IDR_ROWSETVIEWER, ImageList_GetIcon(m_hImageList, IMAGE_OBJECTS, ILD_NORMAL));
03008   }
03009 }
03010
03011
03012 /////////////////////////////////////////////////////////////////////////////
03013 // CMainWindow::OnDisconnect
03014 //
03015 /////////////////////////////////////////////////////////////////////////////
03016 void CMainWindow::OnDisconnect()
03017 {
03018   CWaitCursor waitCursor;
03019
03020   //Disconnect and destroy this window
03021   CMDIChild* pCMDIChild = (CMDIChild*)GetActiveWindow(L"MDICHILD");
03022   if(pCMDIChild)
03023   {
03024     //Tell the window to destroy itself
03025     MDIDestroy(pCMDIChild->m_hWnd);
03026     SAFE_DELETE(pCMDIChild);
03027     UpdateControls();
03028   }
03029 }
03030
03031
03032 /////////////////////////////////////////////////////////////////////////////
03033 // CMainWindow::OnTile
03034 //
03035 /////////////////////////////////////////////////////////////////////////////
03036 void CMainWindow::OnTile(BOOL fHorizontal)
03037 {
03038   //let MDI Client tile the MDI children
03039   SendMessage(m_hWndMDIClient, WM_MDITILE, fHorizontal ? MDITILE_HORIZONTAL : MDITILE_VERTICAL, 0);
03040 }
03041
03042
03043 /////////////////////////////////////////////////////////////////////////////
03044 // CMainWindow::OnCascade
03045 //
03046 /////////////////////////////////////////////////////////////////////////////
03047 void CMainWindow::OnCascade()
03048 {
03049   // let MDI Client cascade MDI children
03050   SendMessage(m_hWndMDIClient, WM_MDICASCADE, 0, 0);
03051 }
03052
03053 /////////////////////////////////////////////////////////////////////////////
03054 // CMainWindow::OnArrangeIcons
03055 //
03056 /////////////////////////////////////////////////////////////////////////////
03057 void CMainWindow::OnArrangeIcons()
03058 {
03059   // let MDI Client arrange iconic MDI children
03060   SendMessage(m_hWndMDIClient, WM_MDIICONARRANGE, 0, 0);
03061 }
03062
03063 /////////////////////////////////////////////////////////////////////////////
03064 // CMainWindow::OnCloseAll
03065 //
03066 /////////////////////////////////////////////////////////////////////////////
03067 void CMainWindow::OnCloseAll()
03068 {
03069   CWaitCursor waitCursor;
03070
03071   RemoveAllChildren();
03072   UpdateControls();
03073 }
03074
03075 /////////////////////////////////////////////////////////////////////////////
03076 // CMainWindow::OnNextWindow
03077 //
03078 /////////////////////////////////////////////////////////////////////////////
03079 void CMainWindow::OnNextWindow(BOOL fNextWindow)
03080 {
03081   CWndLite* pCWndLite = GetActiveWindow();
03082   if(pCWndLite)
03083     SendMessage(m_hWndMDIClient, WM_MDINEXT, (WPARAM)pCWndLite->m_hWnd, fNextWindow ? 1 : 0);
03084 }
03085
03086
03087 ////////////////////////////////////////////////////////////////
03088 // CMainWindow::BindResourceProc
03089 //
03090 /////////////////////////////////////////////////////////////////
03091 INT_PTR WINAPI CMainWindow::BindResourceProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
03092 {
03093   static CComboBoxGuid    s_CComboInterface;
03094   static INDEX        iSavedType      = 3;  //DBGUID_ROW
03095   static DWORD        dwSavedBindFlags  = DBBINDURLFLAG_READ;
03096   static BOOL fAggregation  = FALSE;      //Default
03097   static BOOL fOutput     = TRUE;       //Default
03098
03099   switch(message)
03100   {
03101     case WM_INITDIALOG:
03102     {
03103       CWaitCursor waitCursor;
03104
03105       //Save the "this" pointer
03106       CMainWindow* pThis    = (CMainWindow*)SetThis(hWnd, (void*)lParam);
03107
03108       INDEX iSel = 0;
03109       HWND hWndURL    = ::GetDlgItem(hWnd, IDE_URL);
03110       HWND hWndObjectType = ::GetDlgItem(hWnd, IDC_OBJECTTYPE);
03111       HWND hWndBindFlags  = ::GetDlgItem(hWnd, IDL_BINDFLAGS);
03112       HWND hWndProperties = ::GetDlgItem(hWnd, IDB_SETPROPERTIES);
03113
03114       //Set the Title (since this is shared with ICreateRow)
03115       if(pThis->m_idSource == IDM_ICREATEROW_CREATEROW)
03116       {
03117         SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)"ICreateRow::CreateRow");
03118         SendMessage(::GetDlgItem(hWnd, IDOK), WM_SETTEXT, 0, (LPARAM)"CreateRow");
03119       }
03120
03121       //Enable Properties
03122       switch(pThis->m_pCSource->GetObjectType())
03123       {
03124         case eCRow:
03125         case eCSession:
03126 					::EnableWindow(hWndProperties, FALSE);
03127           break;
03128       }
03129
03130       //Fill In URL default
03131       wSendMessage(hWndURL, WM_SETTEXT, 0, pThis->m_pCRootBinder->m_pwszURL);
03132
03133       //Fill In ObjectType drop down
03134       for(ULONG i=0; i<g_cObjectTypeMaps; i++)
03135       {
03136         iSel = (INDEX)wSendMessage(hWndObjectType, CB_ADDSTRING, 0, g_rgObjectTypeMaps[i].pwszName);
03137         SendMessage(hWndObjectType, CB_SETITEMDATA, iSel, (LPARAM)&g_rgObjectTypeMaps[i]);
03138       }
03139       SendMessage(hWndObjectType, CB_SETCURSEL, iSavedType, 0);
03140
03141       //Aggregation
03142 			::CheckDlgButton(hWnd, IDB_AGGREGATION,    BST2STATE(fAggregation));
03143
03144       //Output (ppIUnknown)
03145 			::CheckDlgButton(hWnd, IDB_OUTPUT,     BST2STATE(fOutput));
03146
03147       //Interface List...
03148       s_CComboInterface.CreateIndirect(hWnd, IDC_INTERFACE);
03149       s_CComboInterface.Populate(g_cInterfaceMaps, g_rgInterfaceMaps);
03150       if(s_CComboInterface.RestoreSelection() == CB_ERR)
03151         s_CComboInterface.SetGuid(IID_IRow);
03152
03153       //BindFlags List...
03154       SendMessage(hWndBindFlags, LB_RESETCONTENT, 0, 0);
03155       for(i=0; i<g_cBindURLMaps; i++)
03156       {
03157         //BindFlags Name
03158         iSel = (INDEX)wSendMessage(hWndBindFlags, LB_ADDSTRING, 0, g_rgBindURLMaps[i].pwszName);
03159         SendMessage(hWndBindFlags, LB_SETITEMDATA, iSel, (LPARAM)g_rgBindURLMaps[i].lItem);
03160
03161         //Select Saved BindFlags
03162         if((dwSavedBindFlags & g_rgBindURLMaps[i].lItem) == (DWORD)g_rgBindURLMaps[i].lItem)
03163            SendMessage(hWndBindFlags, LB_SETSEL, TRUE, i);
03164       }
03165
03166       //Allow the horizontal scroll bar
03167       SendMessage(hWndBindFlags, LB_SETHORIZONTALEXTENT, 500, 0);
03168       CenterDialog(hWnd);
03169       return TRUE;
03170     }
03171
03172     case WM_COMMAND:
03173     {
03174       //Filter out any Control Notification codes
03175       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
03176       {
03177         return UNHANDLED_MSG;
03178       }
03179
03180       switch (GET_WM_COMMAND_ID(wParam, lParam))
03181       {
03182         case IDB_SETPROPERTIES:
03183         {
03184           //Get the "this" pointer
03185           CMainWindow* pThis        = (CMainWindow*)GetThis(hWnd);
03186           IDBProperties* pIDBProperties = SOURCE_GETINTERFACE(pThis->m_pCSource, IDBProperties);
03187
03188           //SetProperties
03189           CPropertiesDlg sCPropertiesDlg(pThis);
03190           sCPropertiesDlg.SetProperties(hWnd, NULL/*No Default PropSet*/, IID_IDBProperties, pIDBProperties, pIDBProperties);
03191           return 0;
03192         }
03193
03194         case IDB_AGGREGATION:
03195         {
03196           //Aggregation Combo Selection has changed...
03197           //If we are now using Aggregation, automatically change the requested
03198           //riid to IID_IUnknown, since its an error otherwise...
03199           if(::IsDlgButtonChecked(hWnd, IDB_AGGREGATION))
03200             s_CComboInterface.SetGuid(IID_IUnknown);
03201           return 0;
03202         }
03203
03204         case IDOK:
03205         {
03206           CWaitCursor waitCursor;
03207
03208           //Get the "this" pointer
03209           CMainWindow* pThis    = (CMainWindow*)GetThis(hWnd);
03210           IUnknown* pIUnknown   = NULL;
03211
03212           HWND hWndURL    = ::GetDlgItem(hWnd, IDE_URL);
03213           HWND hWndObjectType = ::GetDlgItem(hWnd, IDC_OBJECTTYPE);
03214           HWND hWndBindFlags  = ::GetDlgItem(hWnd, IDL_BINDFLAGS);
03215           BOOL dwWindowFlags  = CREATE_NEWWINDOW;
03216           HRESULT hr = S_OK;
03217
03218           DBBINDURLSTATUS dwBindStatus = 0;
03219           WCHAR* pwszNewURL = NULL;
03220
03221           //URL
03222           SAFE_FREE(pThis->m_pCRootBinder->m_pwszURL);
03223           pThis->m_pCRootBinder->m_pwszURL = wGetWindowText(hWndURL);
03224
03225           //ObjectType
03226           iSavedType = (INDEX)SendMessage(hWndObjectType, CB_GETCURSEL, 0, 0);
03227           WIDEGUIDMAP* pObjectMap = (WIDEGUIDMAP*)SendMessage(hWndObjectType, CB_GETITEMDATA, iSavedType, 0);
03228           GUID guidObjectType = *pObjectMap->pGuid;
03229
03230           //Obtain the Aggregation argument
03231           CAggregate* pCAggregate = NULL;
03232           fAggregation = ::IsDlgButtonChecked(hWnd, IDB_AGGREGATION);
03233           if(fAggregation)
03234             pCAggregate = new CAggregate();
03235
03236           //Obtain the Output (ppIUnknown) argument
03237           fOutput = ::IsDlgButtonChecked(hWnd, IDB_OUTPUT);
03238
03239           //Interface
03240           REFIID riid = s_CComboInterface.GetGuid();
03241
03242           //BindFlags
03243           //Obtain all Selected BindFlags...
03244           INDEX iSelCount = (INDEX)SendMessage(hWndBindFlags, LB_GETSELCOUNT, 0, 0);
03245           ASSERT(iSelCount < 20);
03246           LONG rgSelItems[20];
03247           SendMessage(hWndBindFlags, LB_GETSELITEMS, (WPARAM)20, (LPARAM)rgSelItems);
03248
03249           dwSavedBindFlags = 0;
03250           for(LONG i=0; i<iSelCount; i++)
03251             dwSavedBindFlags |= SendMessage(hWndBindFlags, LB_GETITEMDATA, rgSelItems[i], 0);
03252
03253           switch(pThis->m_idSource)
03254           {
03255             case IDM_ICREATEROW_CREATEROW:
03256             {
03257               ICreateRow* pICreateRow = SOURCE_GETINTERFACE(pThis->m_pCSource, ICreateRow);
03258               ASSERT(pICreateRow);
03259
03260               //ICreateRow::CreateRow
03261               XTEST(hr = pICreateRow->CreateRow(pCAggregate, pThis->m_pCRootBinder->m_pwszURL, dwSavedBindFlags, guidObjectType,  riid, NULL, NULL, &dwBindStatus, &pwszNewURL, fOutput ? &pIUnknown : NULL));
03262               TESTC(TRACE_METHOD(hr, L"ICreateRow::CreateRow(0x%p, \"%s\", 0x%08x, %s, %s, NULL, NULL, &0x%p, &\"%s\", &0x%p)", pCAggregate, pThis->m_pCRootBinder->m_pwszURL, dwSavedBindFlags, GetObjectTypeName(guidObjectType), GetInterfaceName(riid), &dwBindStatus, pwszNewURL, pIUnknown));
03263               break;
03264             }
03265
03266             case IDM_IBINDRESOURCE_BIND:
03267             {
03268               IBindResource* pIBindResource = SOURCE_GETINTERFACE(pThis->m_pCSource, IBindResource);
03269               ASSERT(pIBindResource);
03270
03271               //IBindResource::Bind
03272               XTEST(hr = pIBindResource->Bind(pCAggregate, pThis->m_pCRootBinder->m_pwszURL, dwSavedBindFlags, guidObjectType,  riid, NULL, NULL, &dwBindStatus, fOutput ? &pIUnknown : NULL));
03273               TESTC(TRACE_METHOD(hr, L"IBindResource::Bind(0x%p, \"%s\", 0x%08x, %s, %s, NULL, NULL, &0x%p, &0x%p)", pCAggregate, pThis->m_pCRootBinder->m_pwszURL, dwSavedBindFlags, GetObjectTypeName(guidObjectType), GetInterfaceName(riid), &dwBindStatus, pIUnknown));
03274             }
03275               break;
03276
03277             default:
03278               ASSERT(!"Unhandled Type!");
03279               break;
03280           };
03281
03282           //Do we create in a new window?  If this is called from a session object
03283           //and we are interested in a DSO, or Session, then just use the same
03284           //Window, since Bind returns the same existing object addref'd
03285           if(pThis->m_pCSource->GetObjectType() == eCSession && (guidObjectType == DBGUID_DSO || guidObjectType == DBGUID_SESSION))
03286             dwWindowFlags = CREATE_FINDWINDOW;
03287
03288           //Handle Aggregation
03289           if(pCAggregate)
03290             pCAggregate->HandleAggregation(riid, &pIUnknown);
03291
03292           //Handle the returned object type...
03293           //All bind objects are by default returned in there own window...
03294           //NOTE: We already know the object type, or eCUnknown is passed
03295           if(!pThis->HandleObjectType(pThis->m_pCSource, pIUnknown, riid, GuidToSourceType(guidObjectType), 0, NULL, dwWindowFlags))
03296             TESTC(hr = E_FAIL);
03297
03298         CLEANUP:
03299           SAFE_RELEASE(pCAggregate);
03300           SAFE_RELEASE(pIUnknown);
03301
03302           SAFE_FREE(pwszNewURL);
03303           if(SUCCEEDED(hr))
03304             EndDialog(hWnd, TRUE);
03305           return 0;
03306         }
03307
03308         case IDCANCEL:
03309         {
03310           EndDialog(hWnd, FALSE);
03311           return 0;
03312         }
03313       }
03314       break;
03315     }//WM_COMMAND
03316   }
03317
03318   return FALSE;
03319 }
03320
03321
03322 ////////////////////////////////////////////////////////////////
03323 // CMainWindow::RegisterProviderProc
03324 //
03325 /////////////////////////////////////////////////////////////////
03326 INT_PTR WINAPI CMainWindow::RegisterProviderProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
03327 {
03328   switch(message)
03329   {
03330     case WM_INITDIALOG:
03331     {
03332       CWaitCursor waitCursor;
03333
03334       //Save the "this" pointer
03335       CMainWindow* pThis    = (CMainWindow*)SetThis(hWnd, (void*)lParam);
03336       CEnumerator* pCRootEnum   = pThis->m_pCRootEnumerator;
03337
03338       INDEX iSel        = 0;
03339       HWND hWndURL      = ::GetDlgItem(hWnd, IDE_URL);
03340       HWND hWndProvider   = ::GetDlgItem(hWnd, IDC_PROVIDER);
03341
03342       //Update the Window title, since this is called from either method of IRegisterProvider
03343       if(pThis->m_idSource == IDM_IREGISTERPROVIDER_GETURLMAPPING)
03344       {
03345         wSendMessage(hWnd, WM_SETTEXT, 0, L"IRegisterProvider::GetURLMapping");
03346       }
03347       else if(pThis->m_idSource == IDM_IREGISTERPROVIDER_UNREGISTERPROVIDER)
03348       {
03349         wSendMessage(hWnd, WM_SETTEXT, 0, L"IRegisterProvider::UnregisterProvider");
03350       }
03351
03352       //Fill In URL default
03353       //TODO can we provide a better default?
03354       wSendMessage(hWndURL, WM_SETTEXT, 0, L"http://");
03355
03356       //GetURLMapping, output is CLSID, not input...
03357       if(pThis->m_idSource == IDM_IREGISTERPROVIDER_GETURLMAPPING)
03358       {
03359 				::EnableWindow(hWndProvider, FALSE);
03360         SendMessage(hWndProvider, WM_SETTEXT, 0, (LPARAM)"");
03361       }
03362       else
03363       {
03364         //Do we need to connect to the root enumerator...
03365         pCRootEnum->CreateEnumInfo(CLSID_OLEDB_ENUMERATOR);
03366
03367         //Fill In Provider drop down
03368         for(ULONG i=0; i<pCRootEnum->m_cEnumInfo; i++)
03369         {
03370           iSel = (INDEX)wSendMessage(hWndProvider, CB_ADDSTRING, 0, pCRootEnum->m_rgEnumInfo[i].wszName);
03371           SendMessage(hWndProvider, CB_SETITEMDATA, iSel, (LPARAM)&pCRootEnum->m_rgEnumInfo[i]);
03372         }
03373         //TODO can we provide a better default?
03374         SendMessage(hWndProvider, CB_SETCURSEL, 0, 0);
03375       }
03376
03377
03378       CenterDialog(hWnd);
03379       return TRUE;
03380     }
03381
03382     case WM_COMMAND:
03383     {
03384       //Filter out any Control Notification codes
03385       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
03386       {
03387         return UNHANDLED_MSG;
03388       }
03389
03390       switch (GET_WM_COMMAND_ID(wParam, lParam))
03391       {
03392         case IDOK:
03393         {
03394           CWaitCursor waitCursor;
03395
03396           //Get the "this" pointer
03397           CMainWindow* pThis    = (CMainWindow*)GetThis(hWnd);
03398
03399           HWND hWndURL      = ::GetDlgItem(hWnd, IDE_URL);
03400           HWND hWndProvider   = ::GetDlgItem(hWnd, IDC_PROVIDER);
03401           WCHAR wszProgID[MAX_NAME_LEN] = {0};
03402           WCHAR*  pwszURL = NULL;
03403           WCHAR*  pwszProgID = NULL;
03404           CLSID clsid = GUID_NULL;
03405           HRESULT hr = S_OK;
03406
03407           //Currently this is only for Provider Binder callers...
03408           CBinder* pCBinder = SOURCE_GETOBJECT(pThis->m_pCSource, CBinder);
03409           ASSERT(pCBinder);
03410
03411           //URL
03412           pwszURL = wGetWindowText(hWndURL);
03413
03414           //Provider
03415           wSendMessage(hWndProvider, WM_GETTEXT, MAX_NAME_LEN, wszProgID);
03416           CLSIDFromProgID(wszProgID, &clsid);
03417
03418           if(pThis->m_idSource == IDM_IREGISTERPROVIDER_SETURLMAPPING)
03419           {
03420             //IRegisterProvider::SetURLMapping
03421             XTEST(hr = pCBinder->m_pIRegisterProvider->SetURLMapping(pwszURL, 0, clsid));
03422             TESTC(TRACE_METHOD(hr, L"IRegisterProvider::SetURLMapping(\"%s\", 0x%08x, \"%s\")", pwszURL, 0, wszProgID));
03423           }
03424           else if(pThis->m_idSource == IDM_IREGISTERPROVIDER_GETURLMAPPING)
03425           {
03426             //IRegisterProvider::GetURLMapping
03427             XTEST(hr = pCBinder->m_pIRegisterProvider->GetURLMapping(pwszURL, 0, &clsid));
03428             pwszProgID = GetProgID(clsid);
03429             TESTC(TRACE_METHOD(hr, L"IRegisterProvider::GetURLMapping(\"%s\", 0x%08x, \"%s\")", pwszURL, 0, pwszProgID));
03430           }
03431           else
03432           {
03433             //IRegisterProvider::UnregisterProvider
03434             //NOTE:  NULL has special allowed meaning in unregister provider, so if the
03435             //edit box contains empty we will treat it as null...
03436             XTEST(hr = pCBinder->m_pIRegisterProvider->UnregisterProvider(pwszURL, 0, clsid));
03437             TESTC(TRACE_METHOD(hr, L"IRegisterProvider::UnregisterProvider(\"%s\", 0x%08x, \"%s\")", pwszURL, 0, wszProgID));
03438           }
03439
03440         CLEANUP:
03441           SAFE_FREE(pwszProgID);
03442           SAFE_FREE(pwszURL);
03443
03444           if(SUCCEEDED(hr))
03445             EndDialog(hWnd, TRUE);
03446           return 0;
03447         }
03448
03449         case IDCANCEL:
03450         {
03451           EndDialog(hWnd, FALSE);
03452           return 0;
03453         }
03454       }
03455       break;
03456     }//WM_COMMAND
03457   }
03458
03459   return FALSE;
03460 }
03461
03462
03463 ////////////////////////////////////////////////////////////////
03464 // CMainWindow::GetSourcesRowsetProc
03465 //
03466 /////////////////////////////////////////////////////////////////
03467 INT_PTR WINAPI CMainWindow::GetSourcesRowsetProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
03468 {
03469   static CComboBoxGuid  s_CComboInterface;
03470   static CPropSets    s_CPropSets;
03471
03472   static BOOL fUseProps   = TRUE;     //Default
03473   static BOOL fAggregation  = FALSE;    //Default
03474   static BOOL fOutput     = TRUE;     //Default
03475
03476   switch(message)
03477   {
03478     case WM_INITDIALOG:
03479     {
03480       CWaitCursor waitCursor;
03481
03482       //Save the "this" pointer
03483       CMainWindow* pThis = (CMainWindow*)SetThis(hWnd, (void*)lParam);
03484
03485       //Use Properties
03486 			::CheckDlgButton(hWnd, IDB_USEPROPERTIES,  BST2STATE(fUseProps));
03487
03488       //Aggregation
03489 			::CheckDlgButton(hWnd, IDB_AGGREGATION,    BST2STATE(fAggregation));
03490
03491       //Output (ppIUnknown)
03492 			::CheckDlgButton(hWnd, IDB_OUTPUT,     BST2STATE(fOutput));
03493
03494       //Only set these "Default" properties, if requested by the user
03495       if(pThis->GetOptions()->m_dwRowsetOpts & ROWSET_SETDEFAULTPROPS)
03496       {
03497         //DBPROP_CANHOLDROWS is required by the OLE DB Spec - Level-0 Conformance
03498         //Since it is also legal to set a ReadOnly property, just blindy set it...
03499         s_CPropSets.SetProperty(DBPROP_CANHOLDROWS, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, DBPROPOPTIONS_REQUIRED);
03500       }
03501
03502       //Interface List...
03503       s_CComboInterface.CreateIndirect(hWnd, IDC_INTERFACE);
03504       s_CComboInterface.Populate(g_cInterfaceMaps, g_rgInterfaceMaps);
03505       if(s_CComboInterface.RestoreSelection() == CB_ERR)
03506         s_CComboInterface.SetGuid(IID_IRowset);
03507
03508       CenterDialog(hWnd);
03509       return TRUE;
03510     }
03511
03512     case WM_COMMAND:
03513     {
03514       //Filter out any Control Notification codes
03515       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
03516       {
03517         return UNHANDLED_MSG;
03518       }
03519
03520       switch (GET_WM_COMMAND_ID(wParam, lParam))
03521       {
03522         case IDB_SETPROPERTIES:
03523         {
03524           //Get the "this" pointer
03525           CMainWindow* pThis      = (CMainWindow*)GetThis(hWnd);
03526           CEnumerator* pCEnumerator = SOURCE_GETPARENT(pThis->m_pCSource, CEnumerator);
03527
03528           CPropertiesDlg sCPropertiesDlg(pThis);
03529           sCPropertiesDlg.SetProperties(hWnd, &DBPROPSET_ROWSETALL, IID_IRowsetInfo, NULL, pCEnumerator ? pCEnumerator->m_pIDBProperties : NULL, &s_CPropSets);
03530           return 0;
03531         }
03532
03533         case IDB_AGGREGATION:
03534         {
03535           //Aggregation Combo Selection has changed...
03536           //If we are now using Aggregation, automatically change the requested
03537           //riid to IID_IUnknown, since its an error otherwise...
03538           if(::IsDlgButtonChecked(hWnd, IDB_AGGREGATION))
03539             s_CComboInterface.SetGuid(IID_IUnknown);
03540           return 0;
03541         }
03542
03543         case IDOK:
03544         {
03545           CWaitCursor waitCursor;
03546
03547           //Get the "this" pointer
03548           CMainWindow* pThis      = (CMainWindow*)GetThis(hWnd);
03549           CEnumerator* pCEnumerator = SOURCE_GETOBJECT(pThis->m_pCSource, CEnumerator);
03550           CMDIChild*   pCMDIChild   = pCEnumerator ? pCEnumerator->m_pCMDIChild : NULL;
03551
03552           HRESULT hr = S_OK;
03553           IUnknown* pIUnknown = NULL;
03554
03555           ULONG cPropSets = 0;
03556           DBPROPSET* rgPropSets = NULL;
03557
03558           //Obtain the Aggregation argument
03559           CAggregate* pCAggregate = NULL;
03560           fAggregation = ::IsDlgButtonChecked(hWnd, IDB_AGGREGATION);
03561           if(fAggregation)
03562             pCAggregate = new CAggregate();
03563
03564           //Obtain the Output (ppIUnknown) argument
03565           fOutput = ::IsDlgButtonChecked(hWnd, IDB_OUTPUT);
03566
03567           //Interface
03568           REFIID riid = s_CComboInterface.GetGuid();
03569
03570           //Use Properties
03571           fUseProps = ::IsDlgButtonChecked(hWnd, IDB_USEPROPERTIES);
03572           if(fUseProps)
03573           {
03574             cPropSets = s_CPropSets.GetCount();
03575             rgPropSets = s_CPropSets.GetPropSets();
03576           }
03577
03578           //ISourcesRowset::GetSourcesRowset
03579           hr = pCEnumerator->GetSourcesRowset(pCAggregate, riid, cPropSets, rgPropSets, fOutput ? &pIUnknown : NULL);
03580
03581           //Process the Rowset
03582           if(SUCCEEDED(hr))
03583           {
03584             //NOTE: Can pontentially return other object types: (ie: CREATE_DETERMINE_TYPE)
03585             if(!pThis->HandleObjectType(pCEnumerator, pIUnknown, riid, eCRowset, 0, NULL, pCMDIChild ? CREATE_NEWWINDOW_IFEXISTS | CREATE_DETERMINE_TYPE : CREATE_NEWWINDOW | CREATE_DETERMINE_TYPE))
03586               hr = E_FAIL;
03587           }
03588
03589           SAFE_RELEASE(pIUnknown);
03590           SAFE_RELEASE(pCAggregate);
03591
03592           if(SUCCEEDED(hr))
03593             EndDialog(hWnd, TRUE);
03594           return 0;
03595         }
03596
03597         case IDCANCEL:
03598         {
03599           EndDialog(hWnd, FALSE);
03600           return 0;
03601         }
03602       }
03603       break;
03604     }//WM_COMMAND
03605   }
03606
03607   return FALSE;
03608 }
03609
03610
03611
03612
03613 ////////////////////////////////////////////////////////////////
03614 // CMainWindow::GetDataSourceProc
03615 //
03616 /////////////////////////////////////////////////////////////////
03617 INT_PTR WINAPI CMainWindow::GetDataSourceProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
03618 {
03619   static CComboBoxGuid  s_CComboInterface;
03620   static CInitStringBox s_CInitStringBox;
03621   static BOOL fUseExistingDSO   = FALSE;
03622   static BOOL fAggregation    = FALSE;      //Default
03623   static BOOL fOutput       = TRUE;       //Default
03624
03625   switch(msg)
03626   {
03627     case WM_INITDIALOG:
03628     {
03629       CWaitCursor waitCursor;
03630
03631       //Save the "this" pointer
03632       CMainWindow* pThis        = (CMainWindow*)SetThis(hWnd, (void*)lParam);
03633       CServiceComp*  pCServiceComp  = SOURCE_GETOBJECT(pThis->m_pCSource, CServiceComp);
03634       ASSERT(pCServiceComp);
03635
03636       //Set the Saved InitString
03637       s_CInitStringBox.CreateIndirect(hWnd, IDE_INITSTRING);
03638       s_CInitStringBox.SetWindowText(pCServiceComp->m_pwszInitString);
03639       s_CInitStringBox.SubClassWindow(WndProc);
03640
03641       //Aggregation
03642 			::CheckDlgButton(hWnd, IDB_AGGREGATION,    BST2STATE(fAggregation));
03643
03644       //Output (ppIUnknown)
03645 			::CheckDlgButton(hWnd, IDB_OUTPUT,     BST2STATE(fOutput));
03646
03647       //Interface List...
03648       s_CComboInterface.CreateIndirect(hWnd, IDC_INTERFACE);
03649       s_CComboInterface.Populate(g_cInterfaceMaps, g_rgInterfaceMaps);
03650       if(s_CComboInterface.RestoreSelection() == CB_ERR)
03651         s_CComboInterface.SetGuid(IID_IDBInitialize);
03652
03653       //Existing DSO
03654 			::CheckDlgButton(hWnd, IDB_EXISTING_DSO, BST2STATE(fUseExistingDSO));
03655       CenterDialog(hWnd);
03656       return TRUE;
03657     }
03658
03659     case WM_COMMAND:
03660     {
03661       //Filter out any Control Notification codes
03662       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
03663         break;
03664
03665       switch (GET_WM_COMMAND_ID(wParam, lParam))
03666       {
03667         case IDB_OPTIONS:
03668         {
03669           //Get the "this" pointer
03670           CMainWindow* pThis = (CMainWindow*)GetThis(hWnd);
03671
03672           //Bring up the Main Window Options
03673           pThis->OnOptions();
03674           return 0;
03675         }
03676
03677         case IDB_AGGREGATION:
03678         {
03679           //Aggregation Combo Selection has changed...
03680           //If we are now using Aggregation, automatically change the requested
03681           //riid to IID_IUnknown, since its an error otherwise...
03682           if(::IsDlgButtonChecked(hWnd, IDB_AGGREGATION))
03683             s_CComboInterface.SetGuid(IID_IUnknown);
03684           return 0;
03685         }
03686
03687         case IDOK:
03688         {
03689           CWaitCursor waitCursor;
03690
03691           //Get the "this" pointer
03692           CMainWindow*  pThis     = (CMainWindow*)GetThis(hWnd);
03693           IUnknown*   pIUnknown   = NULL;
03694           HRESULT hr = S_OK;
03695
03696           CServiceComp*  pCServiceComp  = SOURCE_GETOBJECT(pThis->m_pCSource, CServiceComp);
03697           ASSERT(pCServiceComp);
03698
03699           //Get the InitString from the EditBox
03700           SAFE_FREE(pCServiceComp->m_pwszInitString);
03701           pCServiceComp->m_pwszInitString = s_CInitStringBox.GetWindowText();
03702
03703           //Obtain the Aggregation argument
03704           CAggregate* pCAggregate = NULL;
03705           fAggregation = ::IsDlgButtonChecked(hWnd, IDB_AGGREGATION);
03706           if(fAggregation)
03707             pCAggregate = new CAggregate();
03708
03709           //Obtain the Output (ppIUnknown) argument
03710           fOutput = ::IsDlgButtonChecked(hWnd, IDB_OUTPUT);
03711
03712           //Interface
03713           REFIID riid = s_CComboInterface.GetGuid();
03714
03715           //Obtain the correct MDI Child
03716           CMDIChild* pCMDIChild = (CMDIChild*)pThis->FindWindow(L"MDICHILD");
03717
03718           //Existing DataSource
03719           fUseExistingDSO = ::IsDlgButtonChecked(hWnd, IDB_EXISTING_DSO);
03720           if(fUseExistingDSO && pCMDIChild && fOutput)
03721           {
03722             //Release is called on input, for successful cases...
03723             //I don't want them to release my DataSource, so AddRef...
03724             pIUnknown = SOURCE_GETINTERFACE(pCMDIChild->GetObject(eCDataSource), IUnknown);
03725             SAFE_ADDREF(pIUnknown);
03726           }
03727
03728           //GetDataSource - with the specified InitString
03729           //NOTE:  The release of the input/ouput datasource is a likely tricky
03730           // 1.  *ppIUnknown == NULL on input - Succeeded - output 1 reference
03731           // 2.  *ppIUnknown == NULL on input - Failed  - output NULL
03732           // 3.  *ppIUnknown != NULL on input - Succeeded - input is released, and output is QI'd. (in effect refcount has not changed)
03733           // 4.  *ppIUnknown != NULL on input - Failed  - input is untouched, output is NULL. (in effect refcount has not changed)
03734           //Although this seems a little odd, its entirly optimized for the consumer
03735           //All we have to do is AddRef the input and always release the output
03736           TESTC(hr = pCServiceComp->GetDataSource(pCAggregate, pThis->GetOptions()->m_dwCLSCTX, pCServiceComp->m_pwszInitString, riid, fOutput ? &pIUnknown : NULL));
03737
03738           //Handle the returned object...
03739           //NOTE: Can pontentially return other object types: (ie: CREATE_DETERMINE_TYPE)
03740           if(!pThis->HandleObjectType(pCServiceComp, pIUnknown, riid, eCDataSource, 0, NULL, CREATE_NEWWINDOW | CREATE_DETERMINE_TYPE | pThis->GetOptions()->m_dwCreateOpts))
03741             TESTC(hr = E_FAIL);
03742
03743         CLEANUP:
03744           SAFE_RELEASE(pCAggregate);
03745           SAFE_RELEASE(pIUnknown);
03746           if(SUCCEEDED(hr))
03747             EndDialog(hWnd, TRUE);
03748           return 0;
03749         }
03750
03751         case IDB_BROWSE_PROVIDER:
03752         {
03753           CMainWindow* pThis = (CMainWindow*)GetThis(hWnd);
03754           pThis->DisplayDialog(IDD_SIMPLE_LISTBOX, hWnd, CMainWindow::EnumPropertiesProc, pThis->m_pCSource, pThis->m_idSource);
03755           return 0;
03756         }
03757
03758         case IDCANCEL:
03759         {
03760           EndDialog(hWnd, FALSE);
03761           return 0;
03762         }
03763       }
03764       break;
03765     }//WM_COMMAND
03766   }
03767
03768   return FALSE;
03769 }
03770
03771
03772 ////////////////////////////////////////////////////////////////
03773 // CMainWindow::EnumPropertiesProc
03774 //
03775 /////////////////////////////////////////////////////////////////
03776 INT_PTR WINAPI CMainWindow::EnumPropertiesProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
03777 {
03778   static CDSLContextBox   s_CDSLContextBox;
03779   static CRichEditLite    s_CEditSource;
03780
03781   switch(message)
03782   {
03783     case WM_INITDIALOG:
03784     {
03785       CWaitCursor waitCursor;
03786
03787       //save off the this pointer
03788       CMainWindow* pThis      = (CMainWindow*)SetThis(hWnd, (void*)lParam);
03789       HRESULT hr = S_OK;
03790
03791       IDBProperties* pIDBProperties = NULL;
03792       ULONG iPropSet,cPropInfoSets = 0;
03793       DBPROPINFOSET* rgPropInfoSets = NULL;
03794       WCHAR* pStringBuffer = NULL;
03795       IUnknown* pIUnknown = NULL;
03796
03797       INDEX iStart = 0;
03798       INDEX iEnd = 0;
03799       RECT rect, rectDlg;
03800       POINT pt = {0, 0};
03801
03802       //Create the ListBox
03803       s_CDSLContextBox.CreateIndirect(hWnd, IDL_VALUES);
03804       s_CDSLContextBox.SubClassWindow(WndProc);
03805
03806       //Obtain the currently entered connection string
03807       //NOTE: We don't subclass the initstring here, since we have already done it
03808       //in the caller function - GetDataSourceProc
03809       s_CEditSource.CreateIndirect(GetParent(hWnd), IDE_INITSTRING);
03810       WCHAR* pwszInitString = s_CEditSource.GetWindowText();
03811       BOOL fDisplayedInfo = FALSE;
03812
03813       if(pwszInitString)
03814       {
03815         CHAR szBuffer[MAX_NAME_LEN] = {0};
03816
03817         //Obtain the current cursor location, to determine what info the user really wants...
03818         s_CEditSource.GetSel(&iStart, &iEnd);
03819         if(iStart)
03820         {
03821           //End is limited to our buffer size...
03822           iEnd = min(iEnd, MAX_NAME_LEN-1);
03823
03824           //If the last character was an = sign, then we probably want a list of providers.
03825           CHARRANGE cr = { 0, (LONG)iEnd };
03826           s_CEditSource.GetTextRange(cr, szBuffer);
03827         }
03828
03829         //Value Context
03830         if(szBuffer[iEnd ? iEnd-1 : 0] == '=')
03831         {
03832           //Provider Enumerator?
03833           if( (iEnd >= 12 /*"Data Source"*/ && (_stricmp(&szBuffer[iEnd-12], "Data Source=")==0 || _stricmp(&szBuffer[iEnd-12], "data Source=")==0)) ||
03834             (iEnd >= 4 /*"DSN"*/ && (_stricmp(&szBuffer[iEnd-4], "DSN=")==0 || _stricmp(&szBuffer[iEnd-4], "dsn=")==0)) )
03835           {
03836             //Root Enumerator
03837             CEnumerator* pCRootEnum = pThis->m_pCRootEnumerator;
03838
03839             //We may need to connect to the RootEnumerator, if not done already
03840             pCRootEnum->CreateEnumInfo(CLSID_OLEDB_ENUMERATOR);
03841
03842             //Fill out the ListBox
03843             for(ULONG i=0; i<pCRootEnum->m_cEnumInfo; i++)
03844             {
03845               ENUMINFO* pEnumInfo = &pCRootEnum->m_rgEnumInfo[i];
03846               if(pEnumInfo->eType ==  DBSOURCETYPE_ENUMERATOR)
03847               {
03848                 WCHAR wszSubName[10] = {0};
03849                 wcsncpy(wszSubName, pEnumInfo->wszName, 7);
03850                 wszSubName[7] = L'\0';
03851
03852                 //See if anything in the string assoicates it with this enumerator...
03853                 //If no provider is specified, the default provider is MSDASQL so use that enumerator
03854                 if(wcsstr(pwszInitString, wszSubName) ||
03855                   (wcsstr(pwszInitString, L"Provider")==NULL && wcsstr(pwszInitString, L"provider")==NULL && StringCompare(pEnumInfo->wszName, L"MSDASQL Enumerator")) )
03856                 {
03857                   CEnumerator cEnum(pThis);
03858
03859                   //Create this enumerator.
03860                   TESTC(hr = pCRootEnum->ParseDisplayName(pEnumInfo->wszParseName, CLSCTX_INPROC_SERVER, IID_IUnknown, &pIUnknown, NULL));
03861                   TESTC(hr = cEnum.CreateObject(pCRootEnum, IID_IUnknown, pIUnknown));
03862                   TESTC(hr = cEnum.CreateEnumInfo());
03863
03864                   //Now display the enuminfo
03865                   for(ULONG iEnum=0; iEnum<cEnum.m_cEnumInfo; iEnum++)
03866                   {
03867                     //Add the name to the list
03868                     s_CDSLContextBox.AddString(cEnum.m_rgEnumInfo[iEnum].wszName);
03869                   }
03870                   fDisplayedInfo = TRUE;
03871                   break;
03872                 }
03873               }
03874             }
03875           }
03876           //Catalog?
03877           else if(iEnd >= 8 /*"Catalog"*/ && (_stricmp(&szBuffer[iEnd-8], "Catalog=")==0 || _stricmp(&szBuffer[iEnd-8], "catalog=")==0) )
03878           {
03879             CDataSource cDataSource(pThis);
03880             CSession cSession(pThis);
03881
03882             //Obtain the current provider...
03883             //If the user has typed enough, (Provider=) then they will get that provider
03884             //otherwise DSL defaults to MSDASQL
03885             TESTC(hr = pThis->m_pCServiceComp->GetDataSource(NULL, pThis->GetOptions()->m_dwCLSCTX, pwszInitString, IID_IDBProperties, (IUnknown**)&pIDBProperties));
03886             TESTC(hr = cDataSource.CreateObject(pThis->m_pCServiceComp, IID_IDBProperties, pIDBProperties));
03887             TESTC(hr = cDataSource.Initialize());
03888
03889             //Create Session
03890             XTESTC(hr = cDataSource.CreateSession(NULL, IID_IUnknown, &pIUnknown));
03891             TESTC(hr = cSession.CreateObject(&cDataSource, IID_IUnknown, pIUnknown));
03892
03893             //Obtain SchemaInfo
03894             if(cSession.m_pIDBSchemaRowset)
03895             {
03896               SAFE_RELEASE(pIUnknown);
03897               WCHAR wszBuffer[MAX_NAME_LEN];
03898               HACCESSOR hAccessor = NULL;
03899               DBCOUNTITEM cRowsObtained = 0;
03900               HROW rghRows[MAX_BLOCK_SIZE];
03901               HROW* phRows = rghRows;
03902               CRowset cRowset(pThis);
03903
03904               //DBSCHEMA_CATALOGS
03905               TESTC(hr = cSession.GetSchemaRowset(NULL, DBSCHEMA_CATALOGS, 0, NULL, IID_IUnknown, 0, NULL, &pIUnknown));
03906               TESTC(hr = cRowset.CreateObject(&cSession, IID_IUnknown, pIUnknown));
03907
03908               //Bind only the CATALOG_NAME column...
03909               const static DBCOUNTITEM cBindings = 1;
03910               DBBINDING rgBindings[cBindings] =
03911               {
03912                   1,    //iOrinal
03913                   0,    //pData = phChapter + 0 offset = phChapter
03914                   0,
03915                   0,
03916                   NULL,
03917                   NULL,
03918                   NULL,
03919                   DBPART_VALUE,
03920                   DBMEMOWNER_CLIENTOWNED,
03921                   DBPARAMIO_NOTPARAM,
03922                   sizeof(wszBuffer),
03923                   0,
03924                   DBTYPE_WSTR,
03925                   0,
03926                   0,
03927               };
03928
03929               //Create the Accessor...
03930               TESTC(hr = cRowset.CreateAccessor(DBACCESSOR_ROWDATA, cBindings, rgBindings, 0, &hAccessor));
03931
03932               //Loop through all the rows...
03933               while(TRUE)
03934               {
03935                 hr = cRowset.GetNextRows(0, MAX_BLOCK_SIZE, &cRowsObtained, &phRows);
03936                 if(FAILED(hr) || cRowsObtained==0)
03937                   break;
03938
03939                 //Loop over rows obtained...
03940                 for(ULONG i=0; i<cRowsObtained; i++)
03941                 {
03942                   //Get the Data
03943                   wszBuffer[0] = wEOL;  //Since were not binding status...
03944                   TESTC(hr = cRowset.GetData(rghRows[i], hAccessor, wszBuffer));
03945
03946                   //Add the name to the list
03947                   s_CDSLContextBox.AddString(wszBuffer);
03948                   fDisplayedInfo = TRUE;
03949                 }
03950
03951                 //Release all the rows
03952                 TESTC(hr = cRowset.ReleaseRows(cRowsObtained, rghRows));
03953               }
03954
03955               //Release Accessor
03956               TESTC(cRowset.ReleaseAccessor(&hAccessor));
03957             }
03958           }
03959           //Root Enumerator?
03960           else if(iEnd >= 9 /*"Provider"*/ && (_stricmp(&szBuffer[iEnd-9], "Provider=")==0 || _stricmp(&szBuffer[iEnd-9], "provider=")==0) )
03961           {
03962             //Root Enumerator
03963             CEnumerator* pCRootEnum = pThis->m_pCRootEnumerator;
03964
03965             //We may need to connect to the RootEnumerator, if not done already
03966             pCRootEnum->CreateEnumInfo(CLSID_OLEDB_ENUMERATOR);
03967
03968             //Fill out the ListBox
03969             for(ULONG i=0; i<pCRootEnum->m_cEnumInfo; i++)
03970             {
03971               //Add the name to the list
03972               s_CDSLContextBox.AddString(pCRootEnum->m_rgEnumInfo[i].wszName);
03973             }
03974             fDisplayedInfo = TRUE;
03975           }
03976           else
03977           {
03978             //Default Values?
03979             s_CDSLContextBox.AddString(L";");
03980             s_CDSLContextBox.AddString(L"True");
03981             s_CDSLContextBox.AddString(L"False");
03982             fDisplayedInfo = TRUE;
03983           }
03984         }
03985         //Not a value context
03986         else
03987         {
03988           //Property Description Context?
03989           if(szBuffer[iEnd ? iEnd-1 : 0] == ' ' || szBuffer[iEnd ? iEnd-1 : 0] == ';')
03990           {
03991             //Obtain the current provider...
03992             //If the user has typed enough, (Provider=) then they will get that provider
03993             //otherwise DSL defaults to MSDASQL
03994             TESTC(hr = pThis->m_pCServiceComp->GetDataSource(NULL, pThis->GetOptions()->m_dwCLSCTX, pwszInitString, IID_IDBProperties, (IUnknown**)&pIDBProperties));
03995
03996             //Obtain all property descriptions...
03997             TESTC(hr = pIDBProperties->GetPropertyInfo(0, NULL, &cPropInfoSets, &rgPropInfoSets, &pStringBuffer));
03998
03999             //Loop through and display properties...
04000             for(iPropSet=0; iPropSet<cPropInfoSets; iPropSet++)
04001             {
04002               DBPROPINFOSET* pPropInfoSet = &rgPropInfoSets[iPropSet];
04003               for(ULONG iProp=0; iProp<pPropInfoSet->cPropertyInfos; iProp++)
04004               {
04005                 //Add this property to the list...
04006                 DBPROPINFO* pPropInfo = &pPropInfoSet->rgPropertyInfos[iProp];
04007                 s_CDSLContextBox.AddString(pPropInfo->pwszDescription);
04008               }
04009             }
04010             fDisplayedInfo = TRUE;
04011           }
04012         }
04013       }
04014
04015       if(!fDisplayedInfo)
04016       {
04017         //No InitString, so just populate listbox with special reserved words for DSL
04018         s_CDSLContextBox.AddString(L"Provider=");
04019         s_CDSLContextBox.AddString(L"=");
04020         s_CDSLContextBox.AddString(L";");
04021         s_CDSLContextBox.AddString(L"\"");
04022         s_CDSLContextBox.AddString(L"'");
04023       }
04024
04025       //Obain the current cursor location, where to place the dialog...
04026       GetWindowRect(s_CEditSource.m_hWnd, &rect);
04027       GetWindowRect(hWnd, &rectDlg);
04028
04029       //NOTE: RichEdit 1.0 EM_POSFROMCHAR requires an a &point for the first param and
04030       //charpos for the second, RichEdit 2.0 is completly different!  Since this RichEdit
04031       //box was created with the resource editor, we can be assured that its always
04032       //"RICHEDIT" which is 1.0, if this ever changes this will crash!
04033       SendMessage(s_CEditSource.m_hWnd, EM_POSFROMCHAR, (WPARAM)&pt, (LPARAM)iStart);
04034
04035       //Place the dialog
04036       MoveWindow(hWnd, rect.left + pt.x, rect.bottom, rectDlg.right-rectDlg.left, rectDlg.bottom-rectDlg.top, TRUE);
04037
04038     CLEANUP:
04039       FreeProperties(&cPropInfoSets, &rgPropInfoSets);
04040       SAFE_FREE(pStringBuffer);
04041       SAFE_RELEASE(pIDBProperties);
04042       SAFE_RELEASE(pIUnknown);
04043       SAFE_FREE(pwszInitString);
04044
04045       if(FAILED(hr))
04046         EndDialog(hWnd, FALSE);
04047       return TRUE;
04048     }
04049
04050     case WM_COMMAND:
04051     {
04052       //Filter out any Control Notification codes
04053       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
04054       {
04055         switch(GET_WM_COMMAND_CMD(wParam, lParam))
04056         {
04057           //Selection change in a list box occurred
04058           case LBN_DBLCLK:
04059           {
04060             //Double-Click, send OK to end dialog...
04061             SendMessage(hWnd, WM_COMMAND, GET_WM_COMMAND_MPS(IDOK, hWnd, 0));
04062             return 0;
04063           }
04064         };
04065
04066         break;
04067       };
04068
04069       switch (GET_WM_COMMAND_ID(wParam, lParam))
04070       {
04071         case IDOK:
04072         {
04073           CWaitCursor waitCursor;
04074           WCHAR wszBuffer[MAX_QUERY_LEN] = {0};
04075
04076           //Obtain all Options Selected Items...
04077           INDEX iSel = s_CDSLContextBox.GetCurSel();
04078           if(iSel != LB_ERR)
04079           {
04080             //Obtain this property description
04081             s_CDSLContextBox.GetText(iSel, wszBuffer);
04082
04083             //Now replace the entire edit box with the new selected value
04084             s_CEditSource.ReplaceAll(wszBuffer);
04085           }
04086
04087           EndDialog(hWnd, TRUE);
04088           return 0;
04089         }
04090
04091         case IDCANCEL:
04092         {
04093           EndDialog(hWnd, FALSE);
04094           return 0;
04095         }
04096       }
04097       break;
04098     }//WM_COMMAND
04099   }
04100
04101   return FALSE;
04102 }
04103
04104
04105 ////////////////////////////////////////////////////////////////
04106 // CMainWindow::PromptDataSourceProc
04107 //
04108 /////////////////////////////////////////////////////////////////
04109 INT_PTR WINAPI CMainWindow::PromptDataSourceProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
04110 {
04111   static DWORD  dwPromptOptions = DBPROMPTOPTIONS_PROPERTYSHEET;  //Default
04112   static BOOL   fUseExistingDSO = FALSE;
04113
04114   static ULONG  cTypeFilters  = 1;
04115   static DWORD  rgTypeFilters[20] = { DBSOURCETYPE_DATASOURCE };
04116   static WCHAR  wszProvFilter[MAX_QUERY_LEN] = { 0 };
04117
04118   static CComboBoxGuid    s_CComboInterface;
04119   static BOOL fAggregation  = FALSE;    //Default
04120   static BOOL fOutput     = TRUE;     //Default
04121
04122   switch(message)
04123   {
04124     case WM_INITDIALOG:
04125     {
04126       CWaitCursor waitCursor;
04127
04128       //Save the "this" pointer
04129       CMainWindow* pThis  = (CMainWindow*)SetThis(hWnd, (void*)lParam);
04130       CEnumerator* pCRootEnum =  pThis->m_pCRootEnumerator;
04131       INDEX iSel = 0;
04132
04133       HWND  hWndOptions     = ::GetDlgItem(hWnd, IDL_OPTIONS);
04134       HWND  hWndTypeFilter    = ::GetDlgItem(hWnd, IDL_TYPEFILTER);
04135       HWND  hWndProvFilter    = ::GetDlgItem(hWnd, IDL_PROVIDERFILTER);
04136
04137       //Interface List...
04138       s_CComboInterface.CreateIndirect(hWnd, IDC_INTERFACE);
04139       s_CComboInterface.Populate(g_cInterfaceMaps, g_rgInterfaceMaps);
04140       if(s_CComboInterface.RestoreSelection() == CB_ERR)
04141         s_CComboInterface.SetGuid(IID_IDBInitialize);
04142
04143       //Populate the Options ListBox
04144       SendMessage(hWndOptions, LB_RESETCONTENT, 0, 0);
04145       for(ULONG i=0; i<g_cPromptOptions; i++)
04146       {
04147         iSel = (INDEX)wSendMessage(hWndOptions, LB_ADDSTRING, 0, g_rgPromptOptions[i].pwszName);
04148         SendMessage(hWndOptions,  LB_SETITEMDATA, iSel, (LPARAM)g_rgPromptOptions[i].lItem);
04149
04150         //Reselect all previously selected items...
04151         SendMessage(hWndOptions, LB_SETSEL, (dwPromptOptions & g_rgPromptOptions[i].lItem) == (DWORD)g_rgPromptOptions[i].lItem, i);
04152       }
04153
04154       //Populate the TypeFilter ListBox
04155       SendMessage(hWndTypeFilter, LB_RESETCONTENT, 0, 0);
04156       for(i=0; i<g_cSourceType; i++)
04157       {
04158         iSel = (INDEX)wSendMessage(hWndTypeFilter, LB_ADDSTRING, 0, g_rgSourceType[i].pwszName);
04159         SendMessage(hWndTypeFilter, LB_SETITEMDATA, iSel, (LPARAM)g_rgSourceType[i].lItem);
04160
04161         //Reselect all previously selected items...
04162         for(ULONG iFilter=0; iFilter<cTypeFilters; iFilter++)
04163           SendMessage(hWndTypeFilter, LB_SETSEL, rgTypeFilters[iFilter] == (DWORD)g_rgSourceType[i].lItem, i);
04164       }
04165
04166
04167       //We may need to connect to the RootEnumerator, if not done already
04168       pCRootEnum->CreateEnumInfo(CLSID_OLEDB_ENUMERATOR);
04169
04170       //Populate the Provider Filter ListBox
04171       SendMessage(hWndProvFilter, LB_RESETCONTENT, 0, 0);
04172       for(i=0; i<pCRootEnum->m_cEnumInfo; i++)
04173       {
04174         iSel = (INDEX)wSendMessage(hWndProvFilter, LB_ADDSTRING, 0, pCRootEnum->m_rgEnumInfo[i].wszName);
04175         SendMessage(hWndProvFilter, LB_SETITEMDATA, iSel, (LPARAM)&pCRootEnum->m_rgEnumInfo[i]);
04176
04177         //Reselect all previously selected items...
04178         SendMessage(hWndProvFilter, LB_SETSEL, wcsstr(wszProvFilter, pCRootEnum->m_rgEnumInfo[i].wszName)!=NULL, i);
04179       }
04180
04181       //Aggregation
04182 			::CheckDlgButton(hWnd, IDB_AGGREGATION,    BST2STATE(fAggregation));
04183
04184       //Output (ppIUnknown)
04185 			::CheckDlgButton(hWnd, IDB_OUTPUT,     BST2STATE(fOutput));
04186
04187       //Existing DSO
04188 			::CheckDlgButton(hWnd, IDB_EXISTING_DSO, BST2STATE(fUseExistingDSO));
04189
04190       CenterDialog(hWnd);
04191       return TRUE;
04192     }
04193
04194     case WM_COMMAND:
04195     {
04196       //Filter out any Control Notification codes
04197       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
04198       {
04199         return UNHANDLED_MSG;
04200       }
04201
04202       switch (GET_WM_COMMAND_ID(wParam, lParam))
04203       {
04204         case IDB_AGGREGATION:
04205         {
04206           //Aggregation Combo Selection has changed...
04207           //If we are now using Aggregation, automatically change the requested
04208           //riid to IID_IUnknown, since its an error otherwise...
04209           if(::IsDlgButtonChecked(hWnd, IDB_AGGREGATION))
04210             s_CComboInterface.SetGuid(IID_IUnknown);
04211           return 0;
04212         }
04213
04214         case IDOK:
04215         {
04216           CWaitCursor waitCursor;
04217
04218           //Get the "this" pointer
04219           CMainWindow* pThis      = (CMainWindow*)GetThis(hWnd);
04220           CDataLinks* pCDataLinks   = SOURCE_GETOBJECT(pThis->m_pCSource, CDataLinks);
04221           ASSERT(pCDataLinks);
04222
04223           HRESULT hr        = S_OK;
04224           HWND  hWndOptions   = ::GetDlgItem(hWnd, IDL_OPTIONS);
04225           HWND  hWndTypeFilter  = ::GetDlgItem(hWnd, IDL_TYPEFILTER);
04226           HWND  hWndProvFilter  = ::GetDlgItem(hWnd, IDL_PROVIDERFILTER);
04227           IUnknown* pIUnknown = NULL;
04228
04229           //Obtain the Aggregation argument
04230           CAggregate* pCAggregate = NULL;
04231           fAggregation = ::IsDlgButtonChecked(hWnd, IDB_AGGREGATION);
04232           if(fAggregation)
04233             pCAggregate = new CAggregate();
04234
04235           //Obtain the Output (ppIUnknown) argument
04236           fOutput = ::IsDlgButtonChecked(hWnd, IDB_OUTPUT);
04237
04238           //Interface
04239           REFIID riid = s_CComboInterface.GetGuid();
04240
04241           //Obtain all Options Selected Items...
04242           INDEX iSelCount = (INDEX)SendMessage(hWndOptions, LB_GETSELCOUNT, 0, 0);
04243           INDEX rgSelItems[MAX_NAME_LEN];
04244           SendMessage(hWndOptions, LB_GETSELITEMS, (WPARAM)MAX_NAME_LEN, (LPARAM)rgSelItems);
04245           dwPromptOptions = 0;
04246           for(LONG i=0; i<iSelCount; i++)
04247             dwPromptOptions |= SendMessage(hWndOptions, LB_GETITEMDATA, rgSelItems[i], 0);
04248
04249           //Obtain all TypeFilter Options Selected Items...
04250           iSelCount = (INDEX)SendMessage(hWndTypeFilter, LB_GETSELCOUNT, 0, 0);
04251           SendMessage(hWndTypeFilter, LB_GETSELITEMS, (WPARAM)MAX_NAME_LEN, (LPARAM)rgSelItems);
04252           for(i=0; i<iSelCount; i++)
04253             rgTypeFilters[i] = (DWORD)SendMessage(hWndOptions, LB_GETITEMDATA, rgSelItems[i], 0);
04254           cTypeFilters = (ULONG)iSelCount;
04255
04256           //Provider Filter
04257           iSelCount = (INDEX)SendMessage(hWndProvFilter, LB_GETSELCOUNT, 0, 0);
04258           SendMessage(hWndProvFilter, LB_GETSELITEMS, (WPARAM)MAX_NAME_LEN, (LPARAM)rgSelItems);
04259           memset(wszProvFilter, 0, sizeof(wszProvFilter));
04260           WCHAR* pwsz = wszProvFilter;
04261           for(i=0; i<iSelCount; i++)
04262           {
04263             ENUMINFO* pEnumInfo = (ENUMINFO*)SendMessage(hWndProvFilter, LB_GETITEMDATA, rgSelItems[i], 0);
04264             CLSID clsid;
04265             WCHAR* pwszProgID = NULL;
04266
04267             //Protect overflowing the buffer...
04268             //NOTE: The Provider Filter requires a ProgID, not Provider Name.
04269             //So we need to convert the ParseName -> CLSID -> ProgID first...
04270             if(SUCCEEDED(CLSIDFromString(pEnumInfo->wszParseName, &clsid)))
04271             {
04272               if(SUCCEEDED(ProgIDFromCLSID(clsid, &pwszProgID)))
04273               {
04274                 ULONG ulStrLen = wcslen(pwszProgID);
04275                 if(pwsz + ulStrLen > wszProvFilter + sizeof(wszProvFilter))
04276                   break;
04277
04278                 wcscat(pwsz, pwszProgID);
04279                 pwsz += ulStrLen + 1;
04280               }
04281             }
04282             SAFE_FREE(pwszProgID);
04283           }
04284
04285           //Obtain the Active MDI Child
04286           CMDIChild* pCMDIChild = (CMDIChild*)pThis->FindWindow(L"MDICHILD");
04287
04288           //Existing DataSource
04289           fUseExistingDSO = ::IsDlgButtonChecked(hWnd, IDB_EXISTING_DSO);
04290           if(fUseExistingDSO && pCMDIChild && fOutput)
04291           {
04292             //Release is called on input, for successful cases...
04293             //I don't want them to release my DataSource, so AddRef...
04294             pIUnknown = SOURCE_GETINTERFACE(pCMDIChild->GetObject(eCDataSource), IUnknown);
04295             SAFE_ADDREF(pIUnknown);
04296           }
04297
04298           //IDBPromptInitialize::PromptDataSource
04299           //NOTE:  The release of the input/ouput datasource is a likely tricky
04300           // 1.  *ppIUnknown == NULL on input - Succeeded - output 1 reference
04301           // 2.  *ppIUnknown == NULL on input - Failed  - output NULL
04302           // 3.  *ppIUnknown != NULL on input - Succeeded - input is released, and output is QI'd. (in effect refcount has not changed)
04303           // 4.  *ppIUnknown != NULL on input - Failed  - input is untouched, output is NULL. (in effect refcount has not changed)
04304           //Although this seems a little odd, its entirly optimized for the consumer
04305           //All we have to do is AddRef the input and always release the output
04306           TESTC(hr = pCDataLinks->PromptDataSource(pCAggregate, hWnd, dwPromptOptions, cTypeFilters, rgTypeFilters, wszProvFilter[0] ? wszProvFilter : NULL, riid, fOutput ? &pIUnknown : NULL));
04307
04308           //Handle the returned object...
04309           //NOTE: Can pontentially return other object types: (ie: CREATE_DETERMINE_TYPE)
04310           if(!pThis->HandleObjectType(pCDataLinks, pIUnknown, riid, eCDataSource, 0, NULL, CREATE_NEWWINDOW | CREATE_DETERMINE_TYPE | pThis->GetOptions()->m_dwCreateOpts))
04311             TESTC(hr = E_FAIL);
04312
04313         CLEANUP:
04314           SAFE_RELEASE(pCAggregate);
04315           SAFE_RELEASE(pIUnknown);
04316           if(SUCCEEDED(hr))
04317             EndDialog(hWnd, TRUE);
04318           return 0;
04319         }
04320
04321         case IDCANCEL:
04322         {
04323           EndDialog(hWnd, FALSE);
04324           return 0;
04325         }
04326       }
04327       break;
04328     }//WM_COMMAND
04329   }
04330
04331   return FALSE;
04332 }
04333
04334
04335 ////////////////////////////////////////////////////////////////
04336 // CMainWindow::PromptFileNameProc
04337 //
04338 /////////////////////////////////////////////////////////////////
04339 INT_PTR WINAPI CMainWindow::PromptFileNameProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
04340 {
04341   static DWORD dwPromptOptions = DBPROMPTOPTIONS_PROPERTYSHEET; //Default
04342
04343   switch(message)
04344   {
04345     case WM_INITDIALOG:
04346     {
04347       CWaitCursor waitCursor;
04348
04349       //Save the "this" pointer
04350       CMainWindow* pThis = (CMainWindow*)SetThis(hWnd, (void*)lParam);
04351
04352       HWND  hWndOptions   = ::GetDlgItem(hWnd, IDL_OPTIONS);
04353       INDEX iSel = 0;
04354
04355       //Directory
04356       //FileName
04357
04358       //Populate the Options ListBox
04359       SendMessage(hWndOptions, LB_RESETCONTENT, 0, 0);
04360       for(ULONG i=0; i<g_cPromptOptions; i++)
04361       {
04362         iSel = (INDEX)wSendMessage(hWndOptions, LB_ADDSTRING, 0, g_rgPromptOptions[i].pwszName);
04363         SendMessage(hWndOptions,  LB_SETITEMDATA, iSel, (LPARAM)g_rgPromptOptions[i].lItem);
04364
04365         //Reselect all previously selected items...
04366         SendMessage(hWndOptions, LB_SETSEL, (dwPromptOptions & g_rgPromptOptions[i].lItem) == (DWORD)g_rgPromptOptions[i].lItem, i);
04367       }
04368
04369       CenterDialog(hWnd);
04370       return TRUE;
04371     }
04372
04373     case WM_COMMAND:
04374     {
04375       //Filter out any Control Notification codes
04376       if(GET_WM_COMMAND_CMD(wParam, lParam) > 1)
04377       {
04378         return UNHANDLED_MSG;
04379       }
04380
04381       switch (GET_WM_COMMAND_ID(wParam, lParam))
04382       {
04383         case IDB_DIRECTORY:
04384         case IDB_FILENAME:
04385         {
04386           HWND  hWndEdit  = ::GetDlgItem(hWnd, IDE_FILENAME);
04387           WCHAR*  pwszTitle = NULL;
04388           WCHAR wszBuffer[MAX_NAME_LEN] = {0};
04389           DWORD dwFlags   = 0;
04390
04391           if(GET_WM_COMMAND_ID(wParam, lParam) == IDB_DIRECTORY)
04392           {
04393             hWndEdit  = ::GetDlgItem(hWnd, IDE_DIRECTORY);
04394             pwszTitle = L"Directory Name";
04395             dwFlags   = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_SHAREAWARE;
04396           }
04397           else
04398           {
04399             hWndEdit  = ::GetDlgItem(hWnd, IDE_FILENAME);
04400             pwszTitle = L"File Name";
04401             dwFlags   = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_SHAREAWARE;
04402           }
04403
04404           //Display Common Dialog to obtain DataSource...
04405           //This is for providers that take a filename/path for this property
04406           if(SUCCEEDED(BrowseOpenFileName(GetAppLite()->m_hInstance, hWnd, pwszTitle, wszBuffer, MAX_NAME_LEN, NULL, L"All Files (*.*)\0*.*\0\0", NULL, dwFlags)))
04407           {
04408             //Just update value
04409             wSendMessage(hWndEdit, WM_SETTEXT, 0, wszBuffer);
04410           }
04411           return 0;
04412         }
04413
04414         case IDOK:
04415         {
04416           CWaitCursor waitCursor;
04417
04418           //Get the "this" pointer
04419           CMainWindow*  pThis   = (CMainWindow*)GetThis(hWnd);
04420           CDataLinks*   pCDataLinks = SOURCE_GETOBJECT(pThis->m_pCSource, CDataLinks);
04421           ASSERT(pCDataLinks);
04422
04423           HRESULT hr = S_OK;
04424           WCHAR* pwszSelectedFile = NULL;
04425           IUnknown* pIUnknown = NULL;
04426
04427           HWND  hWndDirectory = ::GetDlgItem(hWnd, IDE_DIRECTORY);
04428           HWND  hWndFileName  = ::GetDlgItem(hWnd, IDE_FILENAME);
04429           HWND  hWndOptions   = ::GetDlgItem(hWnd, IDL_OPTIONS);
04430
04431           //Directory
04432           WCHAR* pwszDirectory = wGetWindowText(hWndDirectory);
04433
04434           //FileName
04435           WCHAR* pwszFileName = wGetWindowText(hWndFileName);
04436
04437           //Obtain all Options Selected Items...
04438           INDEX iSelCount = (INDEX)SendMessage(hWndOptions, LB_GETSELCOUNT, 0, 0);
04439           ASSERT(iSelCount < 20);
04440           LONG rgSelItems[20];
04441           SendMessage(hWndOptions, LB_GETSELITEMS, (WPARAM)20, (LPARAM)rgSelItems);
04442           dwPromptOptions = 0;
04443           for(LONG i=0; i<iSelCount; i++)
04444             dwPromptOptions |= SendMessage(hWndOptions, LB_GETITEMDATA, rgSelItems[i], 0);
04445
04446           //IDBPromptInitalize::PromptFileName
04447           TESTC(hr = pCDataLinks->PromptFileName(
04448                 hWnd,               // hWndParent
04449                 dwPromptOptions,          // dwPromptOptions
04450                       pwszDirectory,            // pwszInitialDirectory
04451                       pwszFileName,           // pwszInitialFile
04452                       &pwszSelectedFile         // pwszSelectedFile
04453                 ));
04454
04455           //Delegate, and Connect from the Selected File
04456           TESTC(hr = pThis->m_pCServiceComp->ConnectFromFile(pwszSelectedFile));
04457
04458         CLEANUP:
04459           SAFE_FREE(pwszDirectory);
04460           SAFE_FREE(pwszFileName);
04461           SAFE_FREE(pwszSelectedFile);
04462           SAFE_RELEASE(pIUnknown);
04463
04464           if(SUCCEEDED(hr))
04465           {
04466             EndDialog(hWnd, TRUE);
04467           }
04468           return 0;
04469         }
04470
04471         case IDCANCEL:
04472         {
04473           EndDialog(hWnd, FALSE);
04474           return 0;
04475         }
04476       }
04477       break;
04478     }//WM_COMMAND
04479   }
04480
04481   return FALSE;
04482 }
04483
04484
04485
04486 ////////////////////////////////////////////////////////////////
04487 // CMainWindow::HandleObjectType
04488 //
04489 /////////////////////////////////////////////////////////////////
04490 CBase* CMainWindow::HandleObjectType(CBase* pCSource, IUnknown* pIUnknown, REFIID riid, SOURCE eSource, ULONG cPropSets, DBPROPSET* rgPropSets, DWORD dwFlags)
04491 {
04492   CWaitCursor waitCursor;
04493   HRESULT hr = S_OK;
04494   CMDIChild*  pCMDIChild  = pCSource ? pCSource->m_pCMDIChild : NULL;
04495   CMDIChild*  pCNewChild  = NULL;
04496   CBase*    pCObject  = NULL;
04497   DWORD dwCreateOpts    = GetOptions()->m_dwCreateOpts;
04498
04499   //No-op
04500   if(!pIUnknown)
04501     return NULL;
04502
04503   if(dwFlags & CREATE_DETERMINE_TYPE)
04504   {
04505     //Don't rely upon the caller knowing exactly what the object type is...
04506     //Since many OLE DB methods can return different objects depending upon interface or properties
04507     //requested.  So use the "suggested" type as an optimizing starting point, and if not
04508     //then proceed the hard way to determine exactly what it is...
04509     eSource = DetermineObjectType(pIUnknown, eSource);
04510   }
04511
04512   //Does the object already exists, we may need to create a new window
04513   if(pCMDIChild && (dwFlags & CREATE_NEWWINDOW_IFEXISTS))
04514   {
04515     //NOTE: Some objects occupy the same location (address) - (ie: only one is active at a time).
04516     //For example: Only one DataSet, Row, or Rowset will be within a MDIChild, but all reside
04517     //in the base class CDataAccess for simplity (no special casing).  Because of this you can't
04518     //just do ->GetObject(eSource) since it will return NULL if not the exact object type, but
04519     //their could still be another type of object present.  For example, a rowset -> row,
04520     //if we asked for GetObject(eCRow) we would get NULL, and think we don't need to create
04521     //antoher window, but in reality the "address" is already taken for another object.  The
04522     //reason we use GetObjectAddress instread of GetObject.
04523     CBase** ppCBase = pCMDIChild->GetObjectAddress(eSource);
04524     if(ppCBase)
04525     {
04526       CBase* pCBase = *ppCBase;
04527       if(pCBase && pCBase->m_pIUnknown)
04528       {
04529         //If its not the same object then create a new window.  This way the
04530         //user knows if the object returned is the same as before or not...
04531         if(!pCBase->IsSameObject(pIUnknown))
04532           dwFlags |= CREATE_NEWWINDOW;
04533       }
04534     }
04535   }
04536
04537   //Do we need to find the parent window
04538   if(pCSource && (dwFlags & CREATE_FINDWINDOW))
04539   {
04540     //Unless we find the window, we will have to create a new one...
04541     dwFlags |= CREATE_NEWWINDOW;
04542
04543     //Try to find the parent window...
04544     CBase* pCParent = pCSource->GetParent(eSource);
04545     if(pCParent)
04546     {
04547       if(pCParent->m_pIUnknown && !pCParent->IsSameObject(pIUnknown))
04548       {
04549         //Found window/object, but an object already exists of this type,
04550         //and its not the same object.  Looks like a different object was
04551         //returned.  Display the new object, so the user visually sees that
04552         //a new object was created, and not just the parent returned...
04553         dwFlags |= CREATE_NEWWINDOW;
04554       }
04555       else
04556       {
04557         //Since we found the parent, we need to use the parent for this object/display
04558         pCSource  = pCParent->m_pCParent;
04559         pCMDIChild  = pCParent->m_pCMDIChild;
04560
04561         //Found window and object.
04562         if(pCMDIChild)
04563           MDIActivate(pCMDIChild->GetWnd());
04564         dwFlags &= ~CREATE_NEWWINDOW;
04565       }
04566     }
04567   }
04568
04569   //Create a new window...
04570   if(dwFlags & CREATE_NEWWINDOW)
04571   {
04572     pCNewChild = NULL;
04573     pCMDIChild = NULL;
04574   }
04575
04576   //Now that we know the type, do the appropiate thing...
04577   switch(eSource)
04578   {
04579     case eCBinder:
04580     {
04581       //Stand Alone Object (no window required)
04582       CBinder* pCBinder = new CBinder(this);
04583       pCObject = pCBinder;
04584
04585       //Binder - Connect using the passed in Instance
04586       TESTC(hr = pCBinder->CreateObject(pCSource, riid, pIUnknown));
04587
04588       //Binder - SetProperties
04589       if(cPropSets)
04590         TESTC(hr = pCBinder->SetProperties(cPropSets, rgPropSets));
04591       break;
04592     }
04593
04594     case eCEnumerator:
04595     {
04596       //Stand Alone Object (no window required)
04597       CEnumerator* pCEnumerator = new CEnumerator(this);
04598       pCObject = pCEnumerator;
04599
04600       //Enum - Connect using the passed in Instance
04601       TESTC(hr = pCEnumerator->CreateObject(pCSource, riid, pIUnknown));
04602
04603       //Enum - SetProperties
04604       if(cPropSets && dwFlags & CREATE_SETPROPERTIES)
04605         TESTC(hr = pCEnumerator->SetProperties(cPropSets, rgPropSets));
04606
04607       //Enum - Initialize
04608       if(dwFlags & CREATE_INITIALIZE)
04609       {
04610         //Initialize and Obtain interfaces
04611         TESTC(hr = pCEnumerator->Initialize());
04612       }
04613       break;
04614     }
04615
04616     case eCDataSource:
04617     {
04618       //Object requires a window
04619       if(!pCMDIChild)
04620         pCNewChild = pCMDIChild = new CMDIChild(this);
04621
04622       //If the user has requested to Initialize the object, then don't AutoQI
04623       //for optional interfaces until after Initialization.  This way we improve
04624       //performance and help to allow pooling.  We do want to QI for Optional
04625       //interfaces if not going to initialize since the object may already
04626       //be initialized or the user may want optional interfaces before initialization
04627       if(dwFlags & CREATE_INITIALIZE)
04628         ENABLE_BIT(dwCreateOpts, CREATE_QI_OPTIONAL, FALSE);
04629
04630       //Defferred Object
04631       if(!pCMDIChild->m_pCDataSource)
04632         pCMDIChild->m_pCDataSource = new CDataSource(NULL, pCMDIChild);
04633       CDataSource* pCDataSource = pCMDIChild->m_pCDataSource;
04634       pCObject = pCDataSource;
04635
04636       //Create the Object
04637       TESTC(hr = pCDataSource->CreateObject(pCSource, riid, pIUnknown, dwCreateOpts));
04638
04639       //DataSource - SetProperties
04640       if(cPropSets && (dwFlags & CREATE_SETPROPERTIES))
04641         TESTC(hr = pCDataSource->SetProperties(cPropSets, rgPropSets));
04642
04643       //DataSource - Initialize
04644       if(dwFlags & CREATE_INITIALIZE)
04645       {
04646         //Initialize and Obtain datasource interfaces
04647         TESTC(hr = pCDataSource->Initialize());
04648       }
04649
04650       //Create Session
04651       //Since this is a generic routine, we are not totally sure that we are initialized
04652       //or not.  The CREATE_INITIALIZE flag is a good indication, but this could be called
04653       //from other places that return initialized DSOs (Bind for example) and we want to provide
04654       //the user with a helper to provide the sub objects.  So if IDBCreateSession is exposed
04655       //try and create a session, but don't popup the error to the user. It will be in the trace.
04656       if((dwCreateOpts & CREATE_QI_MANDATORY) /*&& d(wFlags & CREATE_INITIALIZE)*/)
04657       {
04658         //NOTE: We only "automatically" create a session if the user requests
04659         //MANDATORY interfaces, we have IDBCreateSession,
04660         //and there already isn't an existing session
04661         if(pCDataSource->m_pIDBCreateSession && !pCMDIChild->GetObject(eCSession))
04662         {
04663           //Recurse
04664           IUnknown* pIUnkSession = NULL;
04665
04666           //IDBCreateSession::CreateSession
04667           //NOTE: Don't fail creation of the object if CreateSession fails...
04668           //NOTE: We don't use IID_IOpenRowset since its not a required session interface
04669           //if the DataSource if of type MDP exclusively...
04670           if(SUCCEEDED(pCDataSource->CreateSession(NULL, IID_IUnknown, (IUnknown**)&pIUnkSession)))
04671             HandleObjectType(pCDataSource, pIUnkSession, IID_IUnknown, eCSession, 0, NULL, CREATE_NEWWINDOW_IFEXISTS);
04672           SAFE_RELEASE(pIUnkSession);
04673         }
04674       }
04675       break;
04676     }
04677
04678     case eCSession:
04679     {
04680       //Object requires a window
04681       if(!pCMDIChild)
04682         pCNewChild = pCMDIChild = new CMDIChild(this);
04683
04684       //Defferred Object
04685       if(!pCMDIChild->m_pCSession)
04686         pCMDIChild->m_pCSession = new CSession(NULL, pCMDIChild);
04687       CSession* pCSession = pCMDIChild->m_pCSession;
04688       pCObject = pCSession;
04689
04690       //Update our Session object
04691       TESTC(hr = pCSession->CreateObject(pCSource, riid, pIUnknown));
04692
04693       //Command (optional - provider may not support commands)
04694       //NOTE: We only "automatically" create a command if the user requests
04695       //MANDATORY interfaces, we have IDBCreateCommand,
04696       //and there already isn't an existing command
04697       if(dwCreateOpts & CREATE_QI_MANDATORY)
04698       {
04699         if(pCSession->m_pIDBCreateCommand && !pCMDIChild->GetObject(eCCommand))
04700         {
04701           //Recurse
04702           ICommand* pICommand = NULL;
04703
04704           //NOTE: Don't fail creation of the object if CreateCommand fails...
04705           if(SUCCEEDED(pCSession->CreateCommand(NULL, IID_ICommand, (IUnknown**)&pICommand)))
04706             HandleObjectType(pCSession, pICommand, IID_ICommand, eCCommand, 0, NULL, CREATE_NEWWINDOW_IFEXISTS);
04707           SAFE_RELEASE(pICommand);
04708         }
04709       }
04710       break;
04711     }
04712
04713     case eCCommand:
04714     {
04715       //Object requires a window
04716       if(!pCMDIChild)
04717         pCNewChild = pCMDIChild = new CMDIChild(this);
04718
04719       //Defferred Object
04720       if(!pCMDIChild->m_pCCommand)
04721         pCMDIChild->m_pCCommand = new CCommand(NULL, pCMDIChild);
04722       CCommand* pCCommand = pCMDIChild->m_pCCommand;
04723       pCObject = pCCommand;
04724
04725       //Update our Command object (and set default properties)
04726       TESTC(hr = pCCommand->CreateObject(pCSource, riid, pIUnknown));
04727
04728       //Command - SetProperties
04729       if(cPropSets)
04730         TESTC(hr = pCCommand->SetProperties(cPropSets, rgPropSets));
04731
04732       //We should set the default properties on the Command object as well...
04733       if(GetOptions()->m_dwRowsetOpts & ROWSET_SETDEFAULTPROPS)
04734       {
04735         if(pCMDIChild->m_CDefPropSets.GetCount())
04736           pCCommand->SetProperties(pCMDIChild->m_CDefPropSets.GetCount(), pCMDIChild->m_CDefPropSets.GetPropSets());
04737       }
04738       break;
04739     }
04740
04741     case eCMultipleResults:
04742       //Object requires a window
04743       if(!pCMDIChild)
04744         pCNewChild = pCMDIChild = new CMDIChild(this);
04745
04746       //Defferred Object
04747       if(!pCMDIChild->m_pCMultipleResults)
04748         pCMDIChild->m_pCMultipleResults = new CMultipleResults(NULL, pCMDIChild);
04749       pCObject = pCMDIChild->m_pCMultipleResults;
04750
04751       //Obtain IMultipleResults
04752       TESTC(hr = pCMDIChild->m_pCMultipleResults->CreateObject(pCSource, riid, pIUnknown));
04753       break;
04754
04755     case eCRowset:
04756     {
04757       //Object requires a window
04758       if(!pCMDIChild)
04759         pCNewChild = pCMDIChild = new CMDIChild(this);
04760
04761       //NOTE: We delete the previous class, since we may be creating a different type
04762       //Only if its of a different type, (so we don't have duplicate similar objects in the tree...
04763       CRowset* pCRowset = SOURCE_GETOBJECT(pCMDIChild->m_pCDataAccess, CRowset);
04764       if(!pCRowset)
04765       {
04766         SAFE_RELEASE(pCMDIChild->m_pCDataAccess);
04767         pCRowset = new CRowset(NULL, pCMDIChild);
04768       }
04769       pCObject = pCMDIChild->m_pCDataAccess = pCRowset;
04770
04771
04772       //Now, update our rowset object with the rowset pointer
04773       TESTC(hr = pCRowset->CreateObject(pCSource, riid, pIUnknown));
04774
04775
04776       //Do we need to restart the cursor before displaying this object?
04777       if(dwFlags & CREATE_RESTARTPOSITION)
04778       {
04779         pCRowset->RestartPosition();
04780       }
04781       break;
04782     }
04783
04784     case eCRow:
04785     {
04786       //Object requires a window
04787       if(!pCMDIChild)
04788         pCNewChild = pCMDIChild = new CMDIChild(this);
04789
04790       //NOTE: We delete the previous class, since we may be creating a different type
04791       //Only if its of a different type, (so we don't have duplicate similar objects in the tree...
04792       CRow* pCRow = SOURCE_GETOBJECT(pCMDIChild->m_pCDataAccess, CRow);
04793       if(!pCRow)
04794       {
04795         SAFE_RELEASE(pCMDIChild->m_pCDataAccess);
04796         pCRow = new CRow(NULL, pCMDIChild);
04797       }
04798       pCObject = pCMDIChild->m_pCDataAccess = pCRow;
04799
04800       //Update our row object (in new window always)
04801       TESTC(hr = pCRow->CreateObject(pCSource, riid, pIUnknown));
04802
04803       //Create the command object off the row by default...
04804       //NOTE: We only "automatically" create a command if the user requests
04805       //MANDATORY interfaces, we have IDBCreateCommand,
04806       //and there already isn't an existing command
04807       if(dwCreateOpts & CREATE_QI_MANDATORY)
04808       {
04809         if(pCRow->m_pIDBCreateCommand && !pCMDIChild->GetObject(eCCommand))
04810         {
04811           //Recurse
04812           ICommand* pICommand = NULL;
04813           if(SUCCEEDED(pCRow->CreateCommand(NULL, IID_ICommand, (IUnknown**)&pICommand)))
04814             HandleObjectType(pCRow, pICommand, IID_ICommand, eCCommand, 0, NULL, CREATE_NEWWINDOW_IFEXISTS);
04815           SAFE_RELEASE(pICommand);
04816         }
04817       }
04818       break;
04819     }
04820
04821     case eCStream:
04822     {
04823       //Stand Alone Object (no window required)
04824       CStream* pCStream = new CStream(this);
04825       pCObject = pCStream;
04826
04827       //Update our Stream object
04828       TESTC(hr = pCStream->CreateObject(pCSource, riid, pIUnknown));
04829       break;
04830     }
04831
04832     case eCDataset:
04833     {
04834       //Object requires a window
04835       if(!pCMDIChild)
04836         pCNewChild = pCMDIChild = new CMDIChild(this);
04837
04838       //NOTE: We delete the previous class, since we may be creating a different type
04839       //Only if its of a different type, (so we don't have duplicate similar objects in the tree...
04840       CDataset* pCDataset = SOURCE_GETOBJECT(pCMDIChild->m_pCDataAccess, CDataset);
04841       if(!pCDataset)
04842       {
04843         SAFE_RELEASE(pCMDIChild->m_pCDataAccess);
04844         pCDataset = new CDataset(NULL, pCMDIChild);
04845       }
04846       pCObject = pCMDIChild->m_pCDataAccess = pCDataset;
04847
04848       //Update our data set
04849       TESTC(hr = pCDataset->CreateObject(pCSource, riid, pIUnknown));
04850       break;
04851     }
04852
04853     case eCServiceComp:
04854       pCObject = m_pCServiceComp;
04855
04856       //Update our object
04857       TESTC(hr = m_pCServiceComp->CreateObject(pCSource, riid, pIUnknown));
04858       break;
04859
04860     case eCDataLinks:
04861       //Object requires a window
04862       if(!pCMDIChild)
04863         pCNewChild = pCMDIChild = new CMDIChild(this);
04864
04865       //Defferred Object
04866       if(!m_pCDataLinks)
04867         m_pCDataLinks = new CDataLinks(this);
04868       pCObject = m_pCDataLinks;
04869
04870       //Update our object
04871       TESTC(hr = m_pCDataLinks->CreateObject(pCSource, riid, pIUnknown));
04872       break;
04873
04874     case eCTransaction:
04875     {
04876       //Stand Alone Object (no window required)
04877       CTransaction* pCTransaction = new CTransaction(this);
04878       pCObject = pCTransaction;
04879
04880       //Update our object
04881       TESTC(hr = pCTransaction->CreateObject(pCSource, riid, pIUnknown));
04882       break;
04883     }
04884
04885     case eCTransactionOptions:
04886     {
04887       //Stand Alone Object (no window required)
04888       CTransactionOptions* pCTransactionOptions = new CTransactionOptions(this);
04889       pCObject = pCTransactionOptions;
04890
04891       //Update our object
04892       TESTC(hr = pCTransactionOptions->CreateObject(pCSource, riid, pIUnknown));
04893       break;
04894     }
04895
04896     case eCError:
04897     {
04898       //Stand Alone Object (no window required)
04899       CError* pCError = new CError(this);
04900       pCObject = pCError;
04901
04902       //Update our object
04903       TESTC(hr = pCError->CreateObject(pCSource, riid, pIUnknown));
04904       break;
04905      }
04906
04907     case eCCustomError:
04908     {
04909       //Stand Alone Object (no window required)
04910       CCustomError* pCCustomError = new CCustomError(this);
04911       pCObject = pCCustomError;
04912
04913       //Update our object
04914       TESTC(hr = pCCustomError->CreateObject(pCSource, riid, pIUnknown));
04915       break;
04916      }
04917
04918     case eCRowPosition:
04919     {
04920       //Stand Alone Object (no window required)
04921       CRowPosition* pCRowPosition = new CRowPosition(this);
04922       pCObject = pCRowPosition;
04923
04924       //Update our object
04925       TESTC(hr = pCRowPosition->CreateObject(pCSource, riid, pIUnknown));
04926
04927       //Now Initialize (if source was a rowset)...
04928       if(dwFlags & CREATE_INITIALIZE)
04929         TESTC(hr = pCRowPosition->Initialize(pCSource ? pCSource->m_pIUnknown : NULL));
04930       break;
04931     }
04932
04933
04934     case eCConnectionPoint:
04935     {
04936       //Stand Alone Object (no window required)
04937       CConnectionPoint* pCConnectionPoint = new CConnectionPoint(this);
04938       pCObject = pCConnectionPoint;
04939
04940       //Update our object
04941       TESTC(hr = pCConnectionPoint->CreateObject(pCSource, riid, pIUnknown));
04942       break;
04943     }
04944
04945     case eCUnknown:
04946     {
04947       //Stand Alone Object (no window required)
04948       CUnknown* pCUnknown = new CUnknown(this);
04949       pCObject = pCUnknown;
04950
04951       //Update our object
04952       TESTC(hr = pCUnknown->CreateObject(pCSource, riid, pIUnknown));
04953
04954       //Inform user that we don't have a clue what type of object this is?
04955       wMessageBox(GetFocus(), MB_OK|MB_ICONWARNING|MB_SYSTEMMODAL, wsz_WARNING,
04956         L"The object returned does not support any of the mandatory interfaces for any recognized OLE DB Object?\n");
04957       break;
04958     }
04959
04960     default:
04961       ASSERT(!"Unhandled Object Type!");
04962       TESTC(hr = E_FAIL);
04963       break;
04964   };
04965
04966   //Now display the new window
04967   if(pCNewChild)
04968   {
04969     //Copy(AddRef) the previous objects for this wiindow...
04970     if(pCObject)
04971     {
04972       CBase* pCParent = pCObject->m_pCParent;
04973       while(pCParent)
04974       {
04975         //Copy into our objects, if they don't already exist...
04976         CBase** ppCBase = pCNewChild->GetObjectAddress(pCParent->GetObjectType());
04977         if(ppCBase && *ppCBase==NULL)
04978         {
04979           //NOTE: We don't want to replace objects of the same type.
04980           //For example: If the parent of this object is of the same
04981           //type, (IRowset -> ColumnsRowset) then we don't need to replace
04982           //the current object.  The simplest way to do this is to only
04983           //replace NULL addresses (ie: *ppCBase == NULL)
04984           SAFE_ADDREF(pCParent);
04985           *ppCBase = pCParent;
04986         }
04987
04988         pCParent = pCParent->m_pCParent;
04989       }
04990     }
04991
04992     //Create the new window...
04993     pCNewChild->Create(m_hWndMDIClient, L"MDICHILD", NULL, IDR_ROWSETVIEWER, ImageList_GetIcon(m_hImageList, IMAGE_OBJECTS, ILD_NORMAL));
04994   }
04995
04996   //Display the object, unless the caller app wishes to...
04997   if(!(dwFlags & CREATE_NODISPLAY))
04998     pCObject->DisplayObject();
04999
05000 CLEANUP:
05001   if(FAILED(hr) || !pCObject)
05002   {
05003     SAFE_DELETE(pCNewChild);
05004     pCObject = NULL;
05005   }
05006
05007   UpdateControls();
05008   return pCObject;
05009 }
05010
05011
05012
05013 /////////////////////////////////////////////////////////////////////////////
05014 // CAboutDlg
05015 //
05016 /////////////////////////////////////////////////////////////////////////////
05017 CAboutDlg::CAboutDlg()
05018   : CDialogLite(IDD_ABOUT)
05019 {
05020 }
05021
05022
05023 /////////////////////////////////////////////////////////////////////////////
05024 // CAboutDlg::OnInitDialog
05025 //
05026 /////////////////////////////////////////////////////////////////////////////
05027 BOOL CAboutDlg::OnInitDialog()
05028 {
05029   CWaitCursor waitCursor;
05030
05031   //Fill in About Text
05032   wSendMessageFmt(GetDlgItem(IDT_FILEINFO), WM_SETTEXT, 0,
05033     L"%s\n"       //ProductName
05034     L"Version %S\n"   //Version/Build
05035     L"%S\n",      //CopyWrite
05036
05037     L"Microsoft OLE DB RowsetViewer",
05038     VER_PRODUCTVERSION_STR,
05039     VER_LEGALCOPYRIGHT_STR
05040     );
05041
05042   return CDialogLite::OnInitDialog();
05043 }
Generated on Wed Nov 13 2024 16:52:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/InOut/InOuts.c Source File

  • NetDS
  • RPC
  • Data
  • InOut

InOuts.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                         inout Example
00005
00006     FILE:       inouts.c
00007
00008     USAGE:      inouts   -p protocol_sequence
00009                          -e endpoint
00010                          -m max calls
00011                          -n min calls
00012                          -f flag for RpcServerListen
00013
00014     PURPOSE:    Server side of RPC distributed application inout
00015
00016     FUNCTIONS:  main() - registers server as RPC server
00017
00018     COMMENTS:   This distributed application demonstrates in, out
00019                 parameters.
00020
00021 ****************************************************************************/
00022
00023 #include <stdlib.h>
00024 #include <stdio.h>
00025 #include <ctype.h>
00026 #include "inout.h"    // header file generated by MIDL compiler
00027
00028 #define PURPOSE \
00029 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00030 the [in] and [out] directional attributes. For more information\n\
00031 about these attributes and the RPC API functions, see the\n\
00032 RPC programming guide and reference.\n\n"
00033
00034 void Usage(char * pszProgramName)
00035 {
00036     fprintf(stderr, "%s", PURPOSE);
00037     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00038     fprintf(stderr, " -p protocol_sequence\n");
00039     fprintf(stderr, " -e endpoint\n");
00040     fprintf(stderr, " -m maxcalls\n");
00041     fprintf(stderr, " -n mincalls\n");
00042     fprintf(stderr, " -f flag_wait_op\n");
00043     exit(1);
00044 }
00045
00046 void __cdecl main(int argc, char * argv[])
00047 {
00048     RPC_STATUS status;
00049     unsigned char * pszProtocolSequence = "ncacn_np";
00050     unsigned char * pszSecurity         = NULL;
00051     unsigned char * pszEndpoint         = "\\pipe\\inout";
00052     unsigned int    cMinCalls           = 1;
00053     unsigned int    cMaxCalls           = 20;
00054     unsigned int    fDontWait           = FALSE;
00055     int i;
00056
00057     /* allow the user to override settings with command line switches */
00058     for (i = 1; i < argc; i++) {
00059         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00060             switch (tolower(*(argv[i]+1))) {
00061             case 'p':  // protocol sequence
00062                 pszProtocolSequence = argv[++i];
00063                 break;
00064             case 'e':
00065                 pszEndpoint = argv[++i];
00066                 break;
00067             case 'm':
00068                 cMaxCalls = (unsigned int) atoi(argv[++i]);
00069                 break;
00070             case 'n':
00071                 cMinCalls = (unsigned int) atoi(argv[++i]);
00072                 break;
00073             case 'f':
00074                 fDontWait = (unsigned int) atoi(argv[++i]);
00075                 break;
00076             case 'h':
00077             case '?':
00078             default:
00079                 Usage(argv[0]);
00080             }
00081         }
00082         else
00083             Usage(argv[0]);
00084     }
00085
00086     status = RpcServerUseProtseqEp(pszProtocolSequence,
00087                                    cMaxCalls,
00088                                    pszEndpoint,
00089                                    pszSecurity);  // Security descriptor
00090     printf("RpcServerUseProtseqEp returned 0x%x\n", status);
00091     if (status) {
00092         exit(status);
00093     }
00094
00095     status = RpcServerRegisterIf(inout_ServerIfHandle,  // interface to register
00096                                  NULL,   // MgrTypeUuid
00097                                  NULL);  // MgrEpv; null means use default
00098     printf("RpcServerRegisterIf returned 0x%x\n", status);
00099     if (status) {
00100         exit(status);
00101     }
00102
00103     printf("Calling RpcServerListen\n");
00104     status = RpcServerListen(cMinCalls,
00105                              cMaxCalls,
00106                              fDontWait);
00107     printf("RpcServerListen returned: 0x%x\n", status);
00108     if (status) {
00109         exit(status);
00110     }
00111
00112     if (fDontWait) {
00113         printf("Calling RpcMgmtWaitServerListen\n");
00114         status = RpcMgmtWaitServerListen();  //  wait operation
00115         printf("RpcMgmtWaitServerListen returned: 0x%x\n", status);
00116         if (status) {
00117             exit(status);
00118         }
00119     }
00120
00121 }  // end main()
00122
00123
00124 /*********************************************************************/
00125 /*                 MIDL allocate and free                            */
00126 /*********************************************************************/
00127
00128 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00129 {
00130     return(malloc(len));
00131 }
00132
00133 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00134 {
00135     free(ptr);
00136 }
00137
00138 /* end file inouts.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/SampleMSP/SampMsp.Cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • SampleMSP

SampMsp.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sampmsp.cpp
00008
00009 Abstract:
00010
00011     Implementation of DLL Exports.
00012
00013 --*/
00014
00015
00016 // Note: Proxy/Stub Information
00017 //    To merge the proxy/stub code into the object DLL, add the file
00018 //    dlldatax.c to the project.  Make sure precompiled headers
00019 //    are turned off for this file, and add _MERGE_PROXYSTUB to the
00020 //    defines for the project.
00021 //
00022 //    If you are not running WinNT4.0 or Win95 with DCOM, then you
00023 //    need to remove the following define from dlldatax.c
00024 //    #define _WIN32_WINNT 0x0400
00025 //
00026 //    Further, if you are running MIDL without /Oicf switch, you also
00027 //    need to remove the following define from dlldatax.c.
00028 //    #define USE_STUBLESS_PROXY
00029 //
00030 //    Modify the custom build rule for sampmsp.idl by adding the following
00031 //    files to the Outputs.
00032 //      sampmsp_p.c
00033 //      dlldata.c
00034 //    To build a separate proxy/stub DLL,
00035 //    run nmake -f sampmspps.mk in the project directory.
00036
00037 #include "stdafx.h"
00038 #include "resource.h"
00039 #include "initguid.h"
00040
00041 #include "sampmsp_i.c"
00042
00043
00044 #ifdef _MERGE_PROXYSTUB
00045 extern "C" HINSTANCE hProxyDll;
00046 #endif
00047
00048 #ifdef DEBUG_HEAPS
00049 #include <crtdbg.h>
00050 #endif // DEBUG_HEAPS
00051
00052 CComModule _Module;
00053
00054 BEGIN_OBJECT_MAP(ObjectMap)
00055   OBJECT_ENTRY(CLSID_SampleMSP, CSampleMSP)
00056 END_OBJECT_MAP()
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 // DLL Entry Point
00060
00061 extern "C"
00062 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00063 {
00064   lpReserved;
00065
00066 #ifdef _MERGE_PROXYSTUB
00067     if (!PrxDllMain(hInstance, dwReason, lpReserved))
00068     {
00069     return FALSE;
00070     }
00071 #endif
00072
00073     if (dwReason == DLL_PROCESS_ATTACH)
00074   {
00075
00076 #ifdef DEBUG_HEAPS
00077       // turn on leak detection on process exit
00078       _CrtSetDbgFlag( _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF );
00079 #endif // DEBUG_HEAPS
00080
00081         _Module.Init(ObjectMap, hInstance);
00082     DisableThreadLibraryCalls(hInstance);
00083
00084         // Register for trace output.
00085         MSPLOGREGISTER(_T("sampmsp"));
00086   }
00087   else if (dwReason == DLL_PROCESS_DETACH)
00088     {
00089         // Deregister for trace output.
00090         MSPLOGDEREGISTER();
00091
00092         _Module.Term();
00093     }
00094   return TRUE;    // ok
00095 }
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // Used to determine whether the DLL can be unloaded by OLE
00099
00100 STDAPI DllCanUnloadNow(void)
00101 {
00102 #ifdef _MERGE_PROXYSTUB
00103   if (PrxDllCanUnloadNow() != S_OK)
00104     return S_FALSE;
00105 #endif
00106   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00107 }
00108
00109 /////////////////////////////////////////////////////////////////////////////
00110 // Returns a class factory to create an object of the requested type
00111
00112 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00113 {
00114 #ifdef _MERGE_PROXYSTUB
00115   if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
00116     return S_OK;
00117 #endif
00118   return _Module.GetClassObject(rclsid, riid, ppv);
00119 }
00120
00121 /////////////////////////////////////////////////////////////////////////////
00122 // DllRegisterServer - Adds entries to the system registry
00123
00124 STDAPI DllRegisterServer(void)
00125 {
00126 #ifdef _MERGE_PROXYSTUB
00127   HRESULT hRes = PrxDllRegisterServer();
00128   if (FAILED(hRes))
00129     return hRes;
00130 #endif
00131   // registers object, typelib and all interfaces in typelib
00132   return _Module.RegisterServer(TRUE);
00133 }
00134
00135 /////////////////////////////////////////////////////////////////////////////
00136 // DllUnregisterServer - Removes entries from the system registry
00137
00138 STDAPI DllUnregisterServer(void)
00139 {
00140 #ifdef _MERGE_PROXYSTUB
00141   PrxDllUnregisterServer();
00142 #endif
00143   _Module.UnregisterServer();
00144   return S_OK;
00145 }
00146
00147
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/resource.h Source File

  • SysMgmt
  • MMC
  • CutCopy

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resource.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDB_SMOPEN                      111
00012 #define IDB_SMBMP                       112
00013 #define IDB_LGBMP                       113
00014 #define IDR_SMICONS                     120
00015 #define IDR_LGICONS                     121
00016 #define IDB_ROCKET                      40004
00017 #define IDB_CAR                         40005
00018 #define IDB_PLANE                       40006
00019 #define IDB_BIKE                        40007
00020 #define IDB_ROCKET2                     40008
00021 #define IDB_CAR2                        40009
00022 #define IDB_PLANE2                      40010
00023 #define IDB_BIKE2                       40011
00024 #define IDB_CLOSED2                     40012
00025 #define IDB_OPEN2                       40013
00026 #define IDB_CLOSED                      40014
00027 #define IDB_OPEN                        40015
00028
00029 // Next default values for new objects
00030 //
00031 #ifdef APSTUDIO_INVOKED
00032 #ifndef APSTUDIO_READONLY_SYMBOLS
00033 #define _APS_NEXT_RESOURCE_VALUE        114
00034 #define _APS_NEXT_COMMAND_VALUE         40016
00035 #define _APS_NEXT_CONTROL_VALUE         1000
00036 #define _APS_NEXT_SYMED_VALUE           101
00037 #endif
00038 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/GridFont/View.Hxx Source File

  • Multimedia
  • Gdi
  • Fonts
  • GridFont

View.Hxx

Go to the documentation of this file.
00001 #ifndef __VIEW_HXX_
00002 #define __VIEW_HXX_
00003
00004 #include "canvas.hxx"
00005
00006 //--------------------------------------------------------------------
00007 // File: View.hxx
00008 //
00009 // Classes:
00010 //      CView          - Base class for Views
00011 //      CScrollaleView - Scrollable View
00012 //
00013 //      CPrintCanvas  - Device context for printing
00014 //      CPrintRequest  - Print Job
00015 //
00016 // History: 22-Jan-1993 Asmusf  Created
00017 //
00018 // Copyright 1993 - 1998 Microsoft Corp. All Rights reserved
00019 //
00020 //--------------------------------------------------------------------
00021
00022 class CModel;
00023
00024 //======== CView ============================================
00025 class CView
00026 {
00027 public:
00028         CView(int cx, int cy);
00029         void SetSize( int cx, int cy);
00030         BOOL Paint(CCanvas& canvas, CModel * _pModel, RECT rc);
00031         UINT Hittest(CCanvas& canvas, POINT pt, CModel * _pModel);
00032         void Invalidate(HWND hwnd, LPRECT lpRect=NULL);
00033 protected:
00034         void Scroll(CCanvas &canvas);
00035         SIZE _size;
00036         UINT _iScale;
00037         POINT _ptOrg;
00038         POINT _ptScroll;
00039         POINT _ptClient;
00040 };
00041
00042 //======== CScrollableView ==================================
00043 class CScrollableView : public CView
00044 {
00045 public:
00046         CScrollableView(int cx, int cy):CView(cx,cy){};
00047         void GetScale(UINT &iScale);
00048         void SetScale(UINT iScale);
00049         void SetVScrollPos(HWND hwnd, WPARAM wParam, LPARAM lParam,
00050                                 CModel * pModel);
00051         void SetHScrollPos(HWND hwnd, WPARAM wParam, LPARAM lParam,
00052                                 CModel * pModel);
00053 protected:
00054         int _nHScrollPos;
00055         int _nVScrollPos;
00056 };
00057
00058
00059 inline void CScrollableView::GetScale(UINT &iScale)
00060 {
00061         iScale=_iScale;
00062 };
00063
00064 inline void CScrollableView::SetScale(UINT iScale)
00065 {
00066         _iScale=iScale;
00067 };
00068
00069
00070 //======== CPrintRequest =======================================
00071
00072 #define PREQ_SUCCESS   NULL
00073 #define PREQ_CANCEL       1
00074 #define PREQ_USERABORT    2
00075 #define PREQ_ERRENDPAGE   4
00076 #define PREQ_ERRSTARTPAGE 8
00077 #define PREQ_ERRSTARTDOC  16
00078 #define PREQ_ERROR        32
00079
00080
00081 class CPrintRequest
00082 {
00083 friend class CPrintCanvas;
00084 public:
00085         CPrintRequest(HWND hwnd, UINT minPage=1, UINT maxPage=1);
00086         ~CPrintRequest();
00087
00088         UINT Print(HINSTANCE hInst, CCanvas &canvas, CModel *pModel);
00089         BOOL Cancelled() { return _status == PREQ_CANCEL; };
00090         BOOL Error()     { return _status != PREQ_SUCCESS; };
00091
00092 protected:
00093         HDC    _hdc;
00094         HWND   _hwnd;
00095         UINT   _nFromPage;
00096         UINT   _nToPage;
00097         UINT   _status;
00098         HANDLE _hDevNames;
00099         CModel* _pModel;
00100         CView * _pView;
00101 };
00102
00103
00104 //======== CPrintCanvas =======================================
00105
00106 class CPrintCanvas : public CCanvas
00107 {
00108 public:
00109         CPrintCanvas(CPrintRequest &pr)
00110         {
00111             Init(pr._hdc);
00112             pr._hdc = 0;
00113         }
00114         ~CPrintCanvas()
00115         {
00116             DeleteDC(_hdc);
00117         }
00118 };
00119
00120
00121 extern "C" {
00122 BOOL CALLBACK PrintDlgProc
00123    ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
00124
00125 BOOL CALLBACK AbortProc
00126    (HDC hdcPrn, short nCode);
00127 }
00128
00129 class CPrintAux
00130 {
00131 friend class CPrintRequest;
00132 friend BOOL CALLBACK PrintDlgProc
00133    ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
00134 friend BOOL CALLBACK AbortProc (HDC hdcPrn, short nCode);
00135
00136         BOOL _bUserAbort;
00137         HWND _hDlgPrint;
00138 };
00139
00140
00141
00142 #endif
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/ADQIDlg.cpp Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

ADQIDlg.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       ADQIDlg.cpp
00008 //
00009 //  Contents:   Main ADQI User Interface Implementation
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #include "stdafx.h"
00015 #include "ADQI.h"
00016 #include "ADQIDlg.h"
00017 #include "lmcons.h"
00018 #include "ads.h"
00019 #include "adscontainer.h"
00020 #include "directorysearch.h"
00021 #include "directoryobject.h"
00022 #include "adspropertylist.h"
00023 #include "adsopendsobject.h"
00024 #include "adslargeinteger.h"
00025 #include "security.h"
00026
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00034
00035 DECLAREADSPROC(IADs)
00036 DECLAREADSPROC(IADsContainer)
00037 DECLAREADSPROC(IDirectorySearch)
00038 DECLAREADSPROC(IDirectoryObject)
00039 DECLAREADSPROC(IADsPropertyList)
00040 DECLAREADSPROC(IADsSecurityDescriptor)
00041 DECLAREADSPROC(IADsLargeInteger)
00042
00043
00044
00045
00046
00047 ADSIIF  adsiIfs[] = {
00048   MAKEADSENTRY(IADs), DlgProcIADs,
00049   MAKEADSENTRY(IADsContainer), DlgProcIADsContainer,
00050   MAKEADSENTRY(IADsCollection), NULL,
00051   MAKEADSENTRY(IADsMembers), NULL,
00052   MAKEADSENTRY(IADsPropertyList), DlgProcIADsPropertyList,
00053   MAKEADSENTRY(IADsPropertyEntry), NULL,
00054   MAKEADSENTRY(IADsPropertyValue), NULL,
00055   MAKEADSENTRY(IADsExtension), NULL,
00056   MAKEADSENTRY(IADsNamespaces), NULL,
00057   MAKEADSENTRY(IADsClass), NULL,
00058   MAKEADSENTRY(IADsProperty), NULL,
00059   MAKEADSENTRY(IADsSyntax), NULL,
00060   MAKEADSENTRY(IADsLocality), NULL,
00061   MAKEADSENTRY(IADsO), NULL,
00062   MAKEADSENTRY(IADsOU), NULL,
00063   MAKEADSENTRY(IADsDomain), NULL,
00064   MAKEADSENTRY(IADsComputer), NULL,
00065   MAKEADSENTRY(IADsComputerOperations), NULL,
00066   MAKEADSENTRY(IADsGroup), NULL,
00067   MAKEADSENTRY(IADsUser), NULL,
00068   MAKEADSENTRY(IADsPrintQueue), NULL,
00069   MAKEADSENTRY(IADsPrintQueueOperations), NULL,
00070   MAKEADSENTRY(IADsPrintJob), NULL,
00071   MAKEADSENTRY(IADsPrintJobOperations), NULL,
00072   MAKEADSENTRY(IADsService), NULL,
00073   MAKEADSENTRY(IADsServiceOperations), NULL,
00074   MAKEADSENTRY(IADsFileService), NULL,
00075   MAKEADSENTRY(IADsFileServiceOperations), NULL,
00076   MAKEADSENTRY(IADsFileShare), NULL,
00077   MAKEADSENTRY(IADsSession), NULL,
00078   MAKEADSENTRY(IADsResource), NULL,
00079   MAKEADSENTRY(IADsOpenDSObject), DlgProcIADsOpenDSObject,
00080   MAKEADSENTRY(IDirectoryObject), DlgProcIDirectoryObject,
00081   MAKEADSENTRY(IDirectorySearch), DlgProcIDirectorySearch,
00082   MAKEADSENTRY(IADsAccessControlEntry), NULL,
00083   MAKEADSENTRY(IADsSecurityDescriptor), DlgProcIADsSecurityDescriptor,
00084   MAKEADSENTRY(IADsLargeInteger), DlgProcIADsLargeInteger,
00085   MAKEADSENTRY(IADsObjectOptions), NULL,
00086   MAKEADSENTRY(IADsPropertyValue2), NULL,
00087 //The following interfaces is CoCreateable, not living off on any object,
00088 //so we comment this out, because QI won't return any of these interfaces
00089 //  MAKEADSENTRY(IADsPathname), NULL,
00090 //  MAKEADSENTRY(IADsNameTranslate),  NULL,
00091   MAKEADSENTRY(NULL), NULL
00092 };
00093
00094
00095
00096 /////////////////////////////////////////////////////////////////////////////
00097 // CADQIDlg dialog
00098
00099 CADQIDlg::CADQIDlg(CWnd* pParent /*=NULL*/)
00100   : CDialog(CADQIDlg::IDD, pParent)
00101 {
00102   //{{AFX_DATA_INIT(CADQIDlg)
00103   m_sADsPath = _T("");
00104   //}}AFX_DATA_INIT
00105   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
00106   m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
00107   m_pUnk = NULL;
00108 }
00109
00110 void CADQIDlg::DoDataExchange(CDataExchange* pDX)
00111 {
00112   CDialog::DoDataExchange(pDX);
00113   //{{AFX_DATA_MAP(CADQIDlg)
00114   DDX_Control(pDX, IDC_INTERFACES, m_cListIf);
00115   DDX_Control(pDX, IDOK, m_cOK);
00116   DDX_Control(pDX, IDC_ADSPATH, m_cADsPath);
00117   DDX_Text(pDX, IDC_ADSPATH, m_sADsPath);
00118   //}}AFX_DATA_MAP
00119 }
00120
00121 BEGIN_MESSAGE_MAP(CADQIDlg, CDialog)
00122   //{{AFX_MSG_MAP(CADQIDlg)
00123   ON_WM_PAINT()
00124   ON_WM_QUERYDRAGICON()
00125   ON_EN_CHANGE(IDC_ADSPATH, OnChangeADsPath)
00126   ON_LBN_DBLCLK(IDC_INTERFACES, OnDblClkInterfaces)
00127   //}}AFX_MSG_MAP
00128 END_MESSAGE_MAP()
00129
00130 /////////////////////////////////////////////////////////////////////////////
00131 // CADQIDlg message handlers
00132
00133 BOOL CADQIDlg::OnInitDialog()
00134 {
00135   CDialog::OnInitDialog();
00136   OnChangeADsPath();
00137
00138
00139   // Set the icon for this dialog.  The framework does this automatically
00140   //  when the application's main window is not a dialog
00141   SetIcon(m_hIcon, TRUE);     // Set big icon
00142   SetIcon(m_hIcon, FALSE);    // Set small icon
00143
00144
00145
00146   return TRUE;  // return TRUE  unless you set the focus to a control
00147 }
00148
00149
00150 // If you add a minimize button to your dialog, you will need the code below
00151 //  to draw the icon.  For MFC applications using the document/view model,
00152 //  this is automatically done for you by the framework.
00153
00154 void CADQIDlg::OnPaint()
00155 {
00156   if (IsIconic())
00157   {
00158     CPaintDC dc(this); // device context for painting
00159
00160     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00161
00162     // Center icon in client rectangle
00163     int cxIcon = GetSystemMetrics(SM_CXICON);
00164     int cyIcon = GetSystemMetrics(SM_CYICON);
00165     CRect rect;
00166     GetClientRect(&rect);
00167     int x = (rect.Width() - cxIcon + 1) / 2;
00168     int y = (rect.Height() - cyIcon + 1) / 2;
00169
00170     // Draw the icon
00171     dc.DrawIcon(x, y, m_hIcon);
00172   }
00173   else
00174   {
00175     CDialog::OnPaint();
00176   }
00177 }
00178
00179 // The system calls this to obtain the cursor to display while the user drags
00180 //  the minimized window.
00181 HCURSOR CADQIDlg::OnQueryDragIcon()
00182 {
00183   return (HCURSOR) m_hIcon;
00184 }
00185
00186 void CADQIDlg::OnOK()
00187 {
00188
00189   HRESULT   hr;
00190   CWaitCursor wait;
00191   IUnknown *pSave = NULL;
00192
00193   UpdateData( TRUE );
00194
00195
00196   if ( m_pUnk )
00197   {
00198     pSave = m_pUnk; // save it first
00199   }
00200
00201   USES_CONVERSION;
00202   hr = App->ADsOpenObject(T2OLE(m_sADsPath), IID_IUnknown, (void**) &m_pUnk );
00203
00204
00205   if ( !SUCCEEDED(hr) )
00206   {
00207      AfxMessageBox(GetErrorMessage(hr));
00208      m_pUnk = NULL;
00209      return;
00210   }
00211
00212
00213   if ( pSave ) // release the previous pointer
00214   {
00215     pSave->Release();
00216
00217   }
00218
00219
00220   EnumerateInterface();
00221
00222
00223
00224 }
00225
00226 void CADQIDlg::OnChangeADsPath()
00227 {
00228   BOOL bEnabled;
00229   bEnabled = m_cADsPath.GetWindowTextLength() > 0 ? TRUE : FALSE;
00230
00231   m_cOK.EnableWindow( bEnabled );
00232
00233 }
00234
00235 void CADQIDlg::OnCancel()
00236 {
00237   CDialog::OnCancel();
00238 }
00239
00240 void CADQIDlg::EnumerateInterface()
00241 {
00242   int xx=0;
00243   HRESULT hr;
00244   LPUNKNOWN pQI;
00245
00246   m_cListIf.ResetContent();
00247
00248   ///////////////////////////////////////////////////////////////
00249   // Query Interface all known ADSI Interfaces
00250   ////////////////////////////////////////////////////////////////
00251   while( !IsEqualIID( *adsiIfs[xx].pIID, IID_NULL ) )
00252   {
00253     hr = m_pUnk->QueryInterface( *adsiIfs[xx].pIID, (void**) &pQI );
00254     if ( SUCCEEDED(hr) )
00255     {
00256       m_cListIf.AddString( adsiIfs[xx].szIf );
00257       pQI->Release();
00258     }
00259     xx++;
00260   }
00261
00262
00263
00264 }
00265
00266 void CADQIDlg::OnDblClkInterfaces()
00267 {
00268   CString s;
00269   int xx=0;
00270   int idx;
00271   IUnknown *pNewUnk = NULL;
00272
00273
00274   idx = m_cListIf.GetCurSel();
00275   if ( idx == LB_ERR )
00276   {
00277     MessageBeep(0);
00278     return;
00279   }
00280
00281
00282   CWaitCursor wait;
00283   m_cListIf.GetText( idx, s );
00284
00285
00286   //////////////////////////////////////////////////////////////
00287   //
00288   // Find the appropriate dialog box to display
00289   //
00290   /////////////////////////////////////////////////////////////////
00291   while( !IsEqualIID( *adsiIfs[xx].pIID, IID_NULL ) && s != adsiIfs[xx].szIf  )
00292   {
00293     xx++;
00294   }
00295
00296   ASSERT( !IsEqualIID( *adsiIfs[xx].pIID, IID_NULL ) );
00297   if ( adsiIfs[xx].pFn )
00298   {
00299     m_pUnk->AddRef();
00300     (*adsiIfs[xx].pFn)( m_pUnk, &pNewUnk );
00301   }
00302   else
00303   {
00304      wait.Restore();
00305      AfxMessageBox(_T("No UI implemented yet"));
00306   }
00307
00308
00309
00310   ////////////////////////////////////////////////////
00311   // if IADsOpenObject is selected, special care
00312   ///////////////////////////////////////////////////
00313   if ( pNewUnk )
00314   {
00315
00316     HRESULT hr;
00317     BSTR  bstr;
00318     IADs  *pADs;
00319
00320     hr = pNewUnk->QueryInterface( IID_IADs, (void**) &pADs );
00321     if ( SUCCEEDED(hr) )
00322     {
00323       pADs->get_ADsPath( &bstr );
00324     }
00325     pADs->Release();
00326
00327     m_sADsPath = bstr;
00328     SysFreeString( bstr );
00329
00330
00331     m_pUnk->Release(); // old ads iunknown path;
00332     m_pUnk = pNewUnk;
00333
00334     UpdateData(FALSE);
00335     EnumerateInterface();
00336
00337   }
00338
00339
00340 }
00341
00342
00343
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/sky.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/server.cpp Source File

  • WinUI
  • TSFcase

server.cpp

Go to the documentation of this file.
00001 //
00002 // server.cpp
00003 //
00004 // COM server exports.
00005 //
00006
00007 #include "globals.h"
00008 #include "case.h"
00009
00010 void FreeGlobalObjects(void);
00011
00012 class CClassFactory;
00013 static CClassFactory *g_ObjectInfo[1] = { NULL };
00014
00015 //+---------------------------------------------------------------------------
00016 //
00017 //  DllAddRef
00018 //
00019 //----------------------------------------------------------------------------
00020
00021 void DllAddRef(void)
00022 {
00023     InterlockedIncrement(&g_cRefDll);
00024 }
00025
00026 //+---------------------------------------------------------------------------
00027 //
00028 //  DllRelease
00029 //
00030 //----------------------------------------------------------------------------
00031
00032 void DllRelease(void)
00033 {
00034     if (InterlockedDecrement(&g_cRefDll) < 0) // g_cRefDll == -1 with zero refs
00035     {
00036         EnterCriticalSection(&g_cs);
00037
00038         // need to check ref again after grabbing mutex
00039         if (g_ObjectInfo[0] != NULL)
00040         {
00041             FreeGlobalObjects();
00042         }
00043         assert(g_cRefDll == -1);
00044
00045         LeaveCriticalSection(&g_cs);
00046     }
00047 }
00048
00049 //+---------------------------------------------------------------------------
00050 //
00051 //  CClassFactory declaration with IClassFactory Interface
00052 //
00053 //----------------------------------------------------------------------------
00054
00055 class CClassFactory : public IClassFactory
00056 {
00057 public:
00058     // IUnknown methods
00059     STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
00060     STDMETHODIMP_(ULONG) AddRef(void);
00061     STDMETHODIMP_(ULONG) Release(void);
00062
00063     // IClassFactory methods
00064     STDMETHODIMP CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObj);
00065     STDMETHODIMP LockServer(BOOL fLock);
00066
00067     // Constructor
00068     CClassFactory(REFCLSID rclsid, HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, REFIID riid, void **ppvObj))
00069         : _rclsid(rclsid)
00070     {
00071         _pfnCreateInstance = pfnCreateInstance;
00072     }
00073
00074 public:
00075     REFCLSID _rclsid;
00076     HRESULT (*_pfnCreateInstance)(IUnknown *pUnkOuter, REFIID riid, void **ppvObj);
00077 };
00078
00079 //+---------------------------------------------------------------------------
00080 //
00081 //  CClassFactory::QueryInterface
00082 //
00083 //----------------------------------------------------------------------------
00084
00085 STDAPI CClassFactory::QueryInterface(REFIID riid, void **ppvObj)
00086 {
00087     if (IsEqualIID(riid, IID_IClassFactory) || IsEqualIID(riid, IID_IUnknown))
00088     {
00089         *ppvObj = this;
00090         DllAddRef();
00091         return NOERROR;
00092     }
00093     *ppvObj = NULL;
00094     return E_NOINTERFACE;
00095 }
00096
00097 //+---------------------------------------------------------------------------
00098 //
00099 //  CClassFactory::AddRef
00100 //
00101 //----------------------------------------------------------------------------
00102
00103 STDAPI_(ULONG) CClassFactory::AddRef()
00104 {
00105     DllAddRef();
00106     return g_cRefDll+1; // -1 w/ no refs
00107 }
00108
00109 //+---------------------------------------------------------------------------
00110 //
00111 //  CClassFactory::Release
00112 //
00113 //----------------------------------------------------------------------------
00114
00115 STDAPI_(ULONG) CClassFactory::Release()
00116 {
00117     DllRelease();
00118     return g_cRefDll+1; // -1 w/ no refs
00119 }
00120
00121 //+---------------------------------------------------------------------------
00122 //
00123 //  CClassFactory::CreateInstance
00124 //
00125 //----------------------------------------------------------------------------
00126
00127 STDAPI CClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObj)
00128 {
00129     return _pfnCreateInstance(pUnkOuter, riid, ppvObj);
00130 }
00131
00132 //+---------------------------------------------------------------------------
00133 //
00134 //  CClassFactory::LockServer
00135 //
00136 //----------------------------------------------------------------------------
00137
00138 STDAPI CClassFactory::LockServer(BOOL fLock)
00139 {
00140     if (fLock)
00141     {
00142         DllAddRef();
00143     }
00144     else
00145     {
00146         DllRelease();
00147     }
00148
00149     return S_OK;
00150 }
00151
00152 //+---------------------------------------------------------------------------
00153 //
00154 //  BuildGlobalObjects
00155 //
00156 //----------------------------------------------------------------------------
00157
00158 void BuildGlobalObjects(void)
00159 {
00160     // Build CClassFactory Objects
00161
00162     g_ObjectInfo[0] = new CClassFactory(c_clsidCaseTextService, CCaseTextService::CreateInstance);
00163
00164     // You can add more object info here.
00165     // Don't forget to increase number of item for g_ObjectInfo[],
00166 }
00167
00168 //+---------------------------------------------------------------------------
00169 //
00170 //  FreeGlobalObjects
00171 //
00172 //----------------------------------------------------------------------------
00173
00174 void FreeGlobalObjects(void)
00175 {
00176     // Free CClassFactory Objects
00177     for (int i = 0; i < ARRAYSIZE(g_ObjectInfo); i++)
00178     {
00179         if (NULL != g_ObjectInfo[i])
00180         {
00181             delete g_ObjectInfo[i];
00182             g_ObjectInfo[i] = NULL;
00183         }
00184     }
00185 }
00186
00187 //+---------------------------------------------------------------------------
00188 //
00189 //  DllGetClassObject
00190 //
00191 //----------------------------------------------------------------------------
00192
00193 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppvObj)
00194 {
00195     if (g_ObjectInfo[0] == NULL)
00196     {
00197         EnterCriticalSection(&g_cs);
00198
00199             // need to check ref again after grabbing mutex
00200             if (g_ObjectInfo[0] == NULL)
00201             {
00202                 BuildGlobalObjects();
00203             }
00204
00205         LeaveCriticalSection(&g_cs);
00206     }
00207
00208     if (IsEqualIID(riid, IID_IClassFactory) ||
00209         IsEqualIID(riid, IID_IUnknown))
00210     {
00211         for (int i = 0; i < ARRAYSIZE(g_ObjectInfo); i++)
00212         {
00213             if (NULL != g_ObjectInfo[i] &&
00214                 IsEqualGUID(rclsid, g_ObjectInfo[i]->_rclsid))
00215             {
00216                 *ppvObj = (void *)g_ObjectInfo[i];
00217                 DllAddRef();    // class factory holds DLL ref count
00218                 return NOERROR;
00219             }
00220         }
00221     }
00222
00223     *ppvObj = NULL;
00224
00225     return CLASS_E_CLASSNOTAVAILABLE;
00226 }
00227
00228 //+---------------------------------------------------------------------------
00229 //
00230 //  DllCanUnloadNow
00231 //
00232 //----------------------------------------------------------------------------
00233
00234 STDAPI DllCanUnloadNow(void)
00235 {
00236     if (g_cRefDll >= 0) // -1 with no refs
00237         return S_FALSE;
00238
00239     return S_OK;
00240 }
00241
00242 //+---------------------------------------------------------------------------
00243 //
00244 //  DllUnregisterServer
00245 //
00246 //----------------------------------------------------------------------------
00247
00248 STDAPI DllUnregisterServer(void)
00249 {
00250     CCaseTextService::RegisterCategories(FALSE);
00251     CCaseTextService::UnregisterProfiles();
00252     CCaseTextService::UnregisterServer();
00253
00254     return S_OK;
00255 }
00256
00257 //+---------------------------------------------------------------------------
00258 //
00259 //  DllRegisterServer
00260 //
00261 //----------------------------------------------------------------------------
00262
00263 STDAPI DllRegisterServer(void)
00264 {
00265     // register this service's profile with the tsf
00266     if (!CCaseTextService::RegisterServer() ||
00267         !CCaseTextService::RegisterProfiles() ||
00268         !CCaseTextService::RegisterCategories(TRUE))
00269     {
00270         DllUnregisterServer(); // cleanup any loose ends
00271         return E_FAIL;
00272     }
00273
00274     return S_OK;
00275 }
00276
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCOrder/processFlags.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCOrder

processFlags.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      processFlags.h
00003   Summary:   Declaration of flags for Process() method
00004   Classes:   None
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #ifndef __PROCESSFLAGS_H_
00023 #define __PROCESSFLAGS_H_
00024
00025 // Constants for Process() lFlag
00026
00027 const long processFlagWriteDB = 1;      // Write to order and ship tables
00028 const long processFlagLateBound = 2;    // Latebound (IDispatch) invocation
00029 const long processFlagQueuedComponents = 4; // invoke Ship & Notify Queued Components
00030
00031 #endif  //__PROCESSFLAGS_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/wizext.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

wizext.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       wizext.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // WizExt.cpp : Implementation of CWizExtUser
00012 #include "stdafx.h"
00013 #include "WizExt.h"
00014 #include "util.h"
00015
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CWizExtBase
00019
00020 HRESULT CWizExtUser::Initialize(IADsContainer*        pADsContainerObj,
00021                                 IADs*                 pADsCopySource,
00022                                 LPCWSTR               lpszClassName,
00023                                 IDsAdminNewObj*       pDsAdminNewObj,
00024                                 LPDSA_NEWOBJ_DISPINFO pDispInfo)
00025 {
00026   //
00027   // Debug Traces
00028   //
00029   TRACE(_T("IDsAdminNewObjExt::Initialize()\n"));
00030   TRACE(_T("\tpADsContainerObj = %p\n"), pADsContainerObj);
00031   TRACE(_T("\tlpszClassName = <%s>\n"), lpszClassName);
00032   TRACE(_T("\tpDsAdminNewObj = %p\n"), pDsAdminNewObj);
00033   TRACE(_T("\tpDispInfo = %p\n"), pDispInfo);
00034
00035   //
00036   // make sure we have valid parameters
00037   //
00038   if ( (pADsContainerObj == NULL) || (pDsAdminNewObj == NULL) || (lpszClassName == NULL) )
00039   {
00040     return E_INVALIDARG;
00041   }
00042
00043   if ( (pDispInfo == NULL) || (pDispInfo->dwSize != sizeof(DSA_NEWOBJ_DISPINFO)) )
00044   {
00045     return E_INVALIDARG;
00046   }
00047
00048   //
00049   // save the parameters passed
00050   //
00051   m_spDsAdminNewObj     = pDsAdminNewObj;
00052   m_spADsCopySourceObj  = pADsCopySource;
00053   m_spADsContainerObj   = pADsContainerObj;
00054   m_szClassName         = lpszClassName;
00055
00056   //
00057   // save data from the DSA_NEWOBJ_DISPINFO struct
00058   //
00059   TRACE(_T("\tpDispInfo->dwSize = %d\n"), pDispInfo->dwSize);
00060   TRACE(_T("\tpDispInfo->hObjClassIcon  = 0x%x\n"), pDispInfo->hObjClassIcon);
00061   TRACE(_T("\tpDispInfo->lpszWizTitle = <%s>\n"), pDispInfo->lpszWizTitle);
00062   TRACE(_T("\tpDispInfo->lpszContDisplayName = <%s>\n"), pDispInfo->lpszContDisplayName);
00063
00064   m_hObjClassIcon = pDispInfo->hObjClassIcon;
00065   m_szTitle = pDispInfo->lpszWizTitle;
00066   m_szContCanonicalName = pDispInfo->lpszContDisplayName;
00067
00068   return S_OK;
00069 }
00070
00071
00072 HRESULT CWizExtUser::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
00073 {
00074   //
00075   // Add the pages for the wizard extension in the order they are to appear.
00076   //
00077   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00078   m_pExtPageUser = new CExtPageUser(this);
00079   (*lpfnAddPage)(CreatePropertySheetPage((PROPSHEETPAGE*)(&m_pExtPageUser->m_psp)), lParam);
00080   return S_OK;
00081 }
00082
00083 HRESULT CWizExtUser::SetObject(IADs* pADsObj)
00084 {
00085   //
00086   // Hang on to the object passed in
00087   // the smart pointer will handle the ref count
00088   //
00089   m_spADsObj = pADsObj;
00090   return S_OK;
00091 }
00092
00093 HRESULT CWizExtUser::WriteData(HWND hWnd, ULONG uContext)
00094 {
00095   //
00096   // NOTICE: when the property page has received the kill focus
00097   // notification, it has already written the data, so we do not
00098   // need to do anything on a precommit notification.
00099   //
00100   if (uContext == DSA_NEWOBJ_CTX_PRECOMMIT)
00101   {
00102     return S_OK;
00103   }
00104
00105   //
00106   // This extension does not write anything during the post commit phase
00107   // so we can just return.
00108   //
00109   if (uContext == DSA_NEWOBJ_CTX_POSTCOMMIT)
00110   {
00111     return S_OK;
00112   }
00113
00114   //
00115   // We have to handle the case when the creation failed, the object
00116   // got destroyed, a new temporary object was created, and it has to
00117   // be initialized again.
00118   //
00119   if (uContext == DSA_NEWOBJ_CTX_CLEANUP)
00120   {
00121     //
00122     // Call the helper function to do a precommit write.
00123     //
00124     ASSERT(m_pExtPageUser != NULL);
00125     return m_pExtPageUser->WriteDataHelper();
00126   }
00127
00128   //
00129   // This should never happen.  We have covered all the cases.
00130   //
00131   ASSERT(FALSE);
00132   return E_INVALIDARG;
00133 }
00134
00135
00136 HRESULT CWizExtUser::GetSummaryInfo(BSTR* pBstrText)
00137 {
00138   //
00139   // Verify valid arguments
00140   //
00141   if (pBstrText == NULL)
00142   {
00143     return E_INVALIDARG;
00144   }
00145
00146   ASSERT(m_pExtPageUser != NULL);
00147   m_pExtPageUser->GetSummaryInfo(pBstrText);
00148
00149   return S_OK;
00150 }
00151
00152 HRESULT CWizExtUser::OnError(HWND hWnd, HRESULT hr, ULONG uContext)
00153 {
00154   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00155
00156   CString szMessage;
00157
00158   if (uContext == DSA_NEWOBJ_CTX_COMMIT)
00159   {
00160     //
00161     // The extension gets notified if the SetInfo() or an attempt to cleanup
00162     // a temporary object failed.
00163     //
00164     szMessage.Format(_T("SetInfo() failed: hr = 0x%x"), hr);
00165     AfxMessageBox(szMessage);
00166   }
00167   else if (uContext == DSA_NEWOBJ_CTX_PRECOMMIT)
00168   {
00169     //
00170     // Pre-commit failure is rare.  If it does occur handle the error here.
00171     //
00172   }
00173   else if (uContext == DSA_NEWOBJ_CTX_POSTCOMMIT)
00174   {
00175     //
00176     // Post-commit failure is rare.  If it does occur handle the error here.
00177     //
00178   }
00179   else if (uContext == DSA_NEWOBJ_CTX_CLEANUP)
00180   {
00181     //
00182     // For some reason (e.g. network failure or not enough privileges) DS Admin
00183     // could not remove the ill constructed (but committed) object after a
00184     // failure to write on post commit.  If appropriate, the extension can
00185     // handle the error message.
00186     //
00187
00188     //
00189     // NOTE : this is not a primary extension so we will leave it up to DS Admin
00190     //        to handle this error message.
00191     //
00192     return E_FAIL;
00193   }
00194
00195   //
00196   // Returning success means that DS Admin will not put up its own generic
00197   // error message.
00198   //
00199   return S_OK;
00200 }
00201
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LicServe/LicServe.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LicServe

LicServe.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      LICSERVE.H
00003
00004   Summary:   Include file for the LICSERVE.DLL dynamic link library.
00005              Intended primarily for external users of this DLL who exploit
00006              it via static linkage to the DllRegisterServer and
00007              DllUnregisterServer exported service calls.
00008
00009              For a comprehensive tutorial code tour of LICSERVE's contents
00010              and offerings see the tutorial LICSERVE.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the LICSERVE source code.
00013
00014   Classes:   none.
00015
00016   Functions: DllRegisterServer, DllUnregisterServer.
00017
00018   Origin:    12-10-96: atrent - Editor-inheritance from DLLSERVE.H in
00019                the DLLSERVE Tutorial Code Sample. [Revised]
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(LICSERVE_H)
00037 #define LICSERVE_H
00038
00039 #if !defined(RC_INCLUDE)
00040
00041 #if !defined(_DLLEXPORT_)
00042
00043 // If _DLLEXPORT_ is NOT defined then the default is to import.
00044 #if defined(__cplusplus)
00045 #define DLLENTRY extern "C" __declspec(dllimport)
00046 #else
00047 #define DLLENTRY extern __declspec(dllimport)
00048 #endif
00049 #define STDENTRY DLLENTRY HRESULT WINAPI
00050 #define STDENTRY_(type) DLLENTRY type WINAPI
00051
00052 // Here is the list of server APIs offered by the DLL (using the
00053 // appropriate entry API declaration macros just #defined above).
00054
00055 STDENTRY DllRegisterServer(void);
00056
00057 STDENTRY DllUnregisterServer(void);
00058
00059 #else  // _DLLEXPORT_
00060
00061 // Else if _DLLEXPORT_ is indeed defined then we've been told to export.
00062 #if defined(__cplusplus)
00063 #define DLLENTRY extern "C" __declspec(dllexport)
00064 #else
00065 #define DLLENTRY __declspec(dllexport)
00066 #endif
00067 #define STDENTRY DLLENTRY HRESULT WINAPI
00068 #define STDENTRY_(type) DLLENTRY type WINAPI
00069
00070 #endif // _DLLEXPORT_
00071
00072 #endif // RC_INCLUDE
00073
00074 #endif // LICSERVE_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Consumer/Include/Globals.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Consumer
  • Include

Globals.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   Globals.h
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #ifndef _Globals_H
00017 #define _Globals_H
00018
00019 /******************************************************************************
00020  *
00021  *  Name: Provider_Globals
00022  *
00023  *
00024  *  Description:
00025  *
00026  *    class encapsulates global helper functions.
00027  *    Add extra user code here.
00028  *
00029  *****************************************************************************/
00030
00031 class Provider_Globals
00032 {
00033 public:
00034
00035 // Public Static Variables.
00036
00037   static LONG s_LocksInProgress ;
00038   static LONG s_ObjectsInProgress ;
00039
00040 public:
00041
00042 // Public Functions
00043
00044   static HRESULT Global_Startup () ;
00045   static HRESULT Global_Shutdown () ;
00046
00047   static HRESULT CreateInstance (
00048
00049     const CLSID &a_ReferenceClsid ,
00050     LPUNKNOWN a_OuterUnknown ,
00051     const DWORD &a_ClassContext ,
00052     const UUID &a_ReferenceInterfaceId ,
00053     void **a_ObjectInterface
00054   );
00055 } ;
00056
00057 #endif // _Globals_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/devicenode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

devicenode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CDeviceNode class.  This node is a child of
00014 //                CStaticNode.  It represents a Virtual Storage device
00015 //
00016 //
00017
00018
00019 #ifndef _CLASS_CDEVICENODE_
00020 #define _CLASS_CDEVICENODE_
00021
00022 #include "Globals.h"
00023 #include "FolderNode.h"      // Folders are children of this node
00024 #include "LListImpl.h"
00025
00026
00027 class CComponentData;        // References
00028
00029 //---------------------------------------------------------------------------
00030 class CDeviceNode : public CBaseNode
00031 {
00032   public:
00033     CDeviceNode();
00034     virtual ~CDeviceNode();
00035
00036     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00037     VOID    ToggleStatus();
00038
00039   // Virtual methods
00040   public:
00041     ULONG   GetNodeType() { return NODETYPE_DEVICE; };
00042     GUID&   GetNodeGUID() { return thisGUID; };
00043
00044     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00045     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00046     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00047
00048   // Property page methods
00049   public:
00050     HRESULT QueryForPropertyPage()
00051             { return E_NOTIMPL; }
00052
00053     HRESULT CreatePropertyPages( LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle )
00054             { return E_NOTIMPL; }
00055
00056     HRESULT GetWatermarks( HBITMAP __RPC_FAR *lphWatermark,
00057                            HBITMAP __RPC_FAR *lphHeader,
00058                            HPALETTE __RPC_FAR *lphPalette,
00059                            BOOL __RPC_FAR *bStretch )
00060             { return E_NOTIMPL; }
00061
00062
00063   ///////////////////////////////////////////////////////////////////////////
00064   // Required Notification handlers
00065   //
00066   public:
00067     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00068     HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00069     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00070     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00071     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00072             { return E_NOTIMPL; }
00073
00074   ///////////////////////////////////////////////////////////////////////////
00075   //  Context Menu methods
00076   //
00077   public:
00078     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00079     HRESULT Command( long lCommandID );
00080
00081
00082   ///////////////////////////////////////////////////////////////////////////
00083   // Private helpers
00084   private:
00085     HRESULT  DeleteChildItems( LPCONSOLENAMESPACE2 ipCNS2 );
00086     HRESULT  InsertChildItems( LPCONSOLENAMESPACE2 ipCNS2 );
00087     HRESULT  RefreshNodeList();
00088     VOID     RemoveNodes();
00089
00090
00091   private:
00092     static GUID  thisGUID;
00093     DWORD        m_dwAttributes;
00094     HSCOPEITEM   m_hParentNode;
00095     LPWSTR       m_wzStatus;
00096     BOOL         m_bOnlineStatus;
00097
00098     CLListImpl<CBaseNode*,CBaseNode*>  m_NodeList;
00099     CComponentData*                    m_pCompData;
00100
00101   // XPROPPAGE: Support for attributes
00102   public:
00103     BOOL    IsAttributeSet( DWORD dwAttribute ) { return FALSE; }
00104     VOID    SetAttribute( DWORD dwAttribute ) {}
00105     VOID    RemoveAttribute( DWORD dwAttribute ) {}
00106     LPWSTR  GetAttributeString() { return m_pAttributeStr; }
00107     DWORD   GetAttributes() { return 0; }
00108     LPWSTR  GetObjectPath() { return NULL; }
00109
00110 };
00111
00112 #endif //_CLASS_CDEVICENODE_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcBall.Cpp Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcBall.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 - 2000 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00045
00046 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00047 //  Microsoft Visual C++, your modifications will be overwritten.
00048
00049
00050 #include "stdafx.h"
00051 #include "ACBall.h"
00052
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // CAgentCtlBalloonEx properties
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // CAgentCtlBalloonEx operations
00059
00060 BOOL CAgentCtlBalloonEx::GetEnabled()
00061 {
00062   BOOL result;
00063   InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00064   return result;
00065 }
00066
00067 long CAgentCtlBalloonEx::GetNumberOfLines()
00068 {
00069   long result;
00070   InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00071   return result;
00072 }
00073
00074 long CAgentCtlBalloonEx::GetCharsPerLine()
00075 {
00076   long result;
00077   InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00078   return result;
00079 }
00080
00081 CString CAgentCtlBalloonEx::GetFontName()
00082 {
00083   CString result;
00084   InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00085   return result;
00086 }
00087
00088 long CAgentCtlBalloonEx::GetFontSize()
00089 {
00090   long result;
00091   InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00092   return result;
00093 }
00094
00095 BOOL CAgentCtlBalloonEx::GetFontBold()
00096 {
00097   BOOL result;
00098   InvokeHelper(0xa, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00099   return result;
00100 }
00101
00102 BOOL CAgentCtlBalloonEx::GetFontItalic()
00103 {
00104   BOOL result;
00105   InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00106   return result;
00107 }
00108
00109 BOOL CAgentCtlBalloonEx::GetFontStrikethru()
00110 {
00111   BOOL result;
00112   InvokeHelper(0xc, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00113   return result;
00114 }
00115
00116 BOOL CAgentCtlBalloonEx::GetFontUnderline()
00117 {
00118   BOOL result;
00119   InvokeHelper(0xd, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00120   return result;
00121 }
00122
00123 long CAgentCtlBalloonEx::GetForeColor()
00124 {
00125   long result;
00126   InvokeHelper(0x7, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00127   return result;
00128 }
00129
00130 long CAgentCtlBalloonEx::GetBackColor()
00131 {
00132   long result;
00133   InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00134   return result;
00135 }
00136
00137 long CAgentCtlBalloonEx::GetBorderColor()
00138 {
00139   long result;
00140   InvokeHelper(0x9, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00141   return result;
00142 }
00143
00144 void CAgentCtlBalloonEx::SetVisible(BOOL bNewValue)
00145 {
00146   static BYTE parms[] =
00147     VTS_BOOL;
00148   InvokeHelper(0xe, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00149      bNewValue);
00150 }
00151
00152 BOOL CAgentCtlBalloonEx::GetVisible()
00153 {
00154   BOOL result;
00155   InvokeHelper(0xe, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00156   return result;
00157 }
00158
00159 void CAgentCtlBalloonEx::SetFontName(LPCTSTR lpszNewValue)
00160 {
00161   static BYTE parms[] =
00162     VTS_BSTR;
00163   InvokeHelper(0x4, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00164      lpszNewValue);
00165 }
00166
00167 void CAgentCtlBalloonEx::SetFontSize(long nNewValue)
00168 {
00169   static BYTE parms[] =
00170     VTS_I4;
00171   InvokeHelper(0x5, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00172      nNewValue);
00173 }
00174
00175 void CAgentCtlBalloonEx::SetFontCharSet(short nNewValue)
00176 {
00177   static BYTE parms[] =
00178     VTS_I2;
00179   InvokeHelper(0xf, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00180      nNewValue);
00181 }
00182
00183 short CAgentCtlBalloonEx::GetFontCharSet()
00184 {
00185   short result;
00186   InvokeHelper(0xf, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00187   return result;
00188 }
00189
00190 void CAgentCtlBalloonEx::SetStyle(long nNewValue)
00191 {
00192   static BYTE parms[] =
00193     VTS_I4;
00194   InvokeHelper(0x10, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00195      nNewValue);
00196 }
00197
00198 long CAgentCtlBalloonEx::GetStyle()
00199 {
00200   long result;
00201   InvokeHelper(0x10, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00202   return result;
00203 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/FrameworkProv/MainDll.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • FrameworkProv

MainDll.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  MAINDLL.CPP
00006
00007 //
00008
00009 //  Module: WMI Framework Instance provider
00010
00011 //
00012
00013 //  Purpose: Contains DLL entry points.  Also has code that controls
00014
00015 //           when the DLL can be unloaded by tracking the number of
00016
00017 //           objects and locks as well as routines that support
00018
00019 //           self registration.
00020
00021 //
00022
00023 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00024 //
00025 //***************************************************************************
00026
00027 #include <FWcommon.h>
00028 #include <objbase.h>
00029 #include <initguid.h>
00030 #include <strsafe.h>
00031
00032 HMODULE ghModule;
00033 //============
00034
00035 WCHAR *GUIDSTRING = L"{9a5dd473-d410-11d1-b829-00c04f94c7c3}";
00036 CLSID CLSID_CIM_REINDEER;
00037
00038 //Count number of objects and number of locks.
00039 long g_cLock=0;
00040
00041 //***************************************************************************
00042 //
00043 //  DllGetClassObject
00044 //
00045 //  Purpose: Called by Ole when some client wants a class factory.  Return
00046 //           one only if it is the sort of class this DLL supports.
00047 //
00048 //***************************************************************************
00049
00050 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, PPVOID ppv)
00051 {
00052     HRESULT hr;
00053     CWbemGlueFactory *pObj;
00054
00055     CLSIDFromString(GUIDSTRING, &CLSID_CIM_REINDEER);
00056     if (CLSID_CIM_REINDEER!=rclsid)
00057         return E_FAIL;
00058
00059     pObj=new CWbemGlueFactory();
00060
00061     if (NULL==pObj)
00062         return E_OUTOFMEMORY;
00063
00064     hr=pObj->QueryInterface(riid, ppv);
00065
00066     if (FAILED(hr))
00067         delete pObj;
00068
00069     return hr;
00070 }
00071
00072 //***************************************************************************
00073 //
00074 // DllCanUnloadNow
00075 //
00076 // Purpose: Called periodically by Ole in order to determine if the
00077 //          DLL can be freed.
00078 //
00079 // Return:  S_OK if there are no objects in use and the class factory
00080 //          isn't locked.
00081 //
00082 //***************************************************************************
00083
00084 STDAPI DllCanUnloadNow(void)
00085 {
00086     SCODE   sc;
00087
00088     // It is OK to unload if there are no objects or locks on the
00089     // class factory and the framework is done with you.
00090
00091     if ((0L==g_cLock) && CWbemProviderGlue::FrameworkLogoffDLL(L"ReindeerProv"))
00092     {
00093         sc = S_OK;
00094     }
00095     else
00096     {
00097         sc = S_FALSE;
00098     }
00099     return sc;
00100 }
00101
00102 //***************************************************************************
00103 //
00104 //  Is4OrMore
00105 //
00106 //  Returns true if win95 or any version of NT > 3.51
00107 //
00108 //***************************************************************************
00109
00110 BOOL Is4OrMore(void)
00111 {
00112     OSVERSIONINFO os;
00113
00114     os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
00115     if(!GetVersionEx(&os))
00116         return FALSE;           // should never happen
00117
00118     return os.dwMajorVersion >= 4;
00119 }
00120
00121 //***************************************************************************
00122 //
00123 // DllRegisterServer
00124 //
00125 // Purpose: Called during setup or by regsvr32.
00126 //
00127 // Return:  NOERROR if registration successful, error otherwise.
00128 //***************************************************************************
00129
00130 STDAPI DllRegisterServer(void)
00131 {
00132     char       szID[128];
00133     WCHAR      wcID[128];
00134     char       szCLSID[128];
00135     TCHAR       szModule[MAX_PATH + 1];
00136     const char * pName = "Sample provider using the Provider Framework";
00137     const char * pModel;
00138     HKEY hKey1, hKey2;
00139
00140     // TO DO: Using 'Both' is preferable.  The framework is designed and written to support
00141     // free threaded code.  If you will be writing free-threaded code, uncomment these
00142     // three lines.
00143
00144     // Since Reindeer is free threaded, these lines have been uncommented
00145
00146     if(Is4OrMore())
00147         pModel = "Both";
00148     else
00149         pModel = "Apartment";
00150
00151     // Create the path.
00152
00153   memset(wcID, NULL, sizeof(wcID));
00154   memset(szID, NULL, sizeof(szID));
00155
00156     CLSIDFromString(GUIDSTRING, &CLSID_CIM_REINDEER);
00157     StringFromGUID2(CLSID_CIM_REINDEER, wcID, sizeof(wcID)/sizeof(WCHAR) - 1);
00158     wcstombs(szID, wcID,  sizeof(szID));
00159   StringCbCopy(szCLSID, sizeof(szCLSID), "Software\\classes\\CLSID\\");
00160   StringCbCat(szCLSID, sizeof(szCLSID), (LPCTSTR)szID);
00161
00162
00163     // Create entries under CLSID
00164
00165   LONG lRet = RegCreateKeyEx( HKEY_LOCAL_MACHINE, szCLSID, 0, NULL,
00166                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00167                     &hKey1, NULL );
00168   if (lRet != ERROR_SUCCESS)
00169   {
00170     return E_FAIL;
00171   }
00172
00173     lRet = RegSetValueEx(hKey1, NULL, 0, REG_SZ, (BYTE *)pName, strlen(pName)+1);
00174   if (lRet != ERROR_SUCCESS)
00175   {
00176     RegCloseKey(hKey1);
00177     return E_FAIL;
00178   }
00179
00180   lRet = RegCreateKeyEx( hKey1, "InprocServer32", 0, NULL,
00181                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00182                     &hKey2, NULL );
00183   if (lRet != ERROR_SUCCESS)
00184   {
00185     RegCloseKey(hKey1);
00186     return E_FAIL;
00187   }
00188
00189   memset(&szModule, NULL, sizeof(szModule));
00190     GetModuleFileName(ghModule, szModule,  sizeof(szModule)/sizeof(TCHAR) - 1);
00191     lRet = RegSetValueEx(hKey2, NULL, 0, REG_SZ, (BYTE *)szModule,
00192                                         strlen(szModule)+1);
00193   if (lRet != ERROR_SUCCESS)
00194   {
00195       RegCloseKey(hKey2);
00196     RegCloseKey(hKey1);
00197     return E_FAIL;
00198   }
00199     lRet = RegSetValueEx(hKey2, "ThreadingModel", 0, REG_SZ,
00200                                         (BYTE *)pModel, strlen(pModel)+1);
00201   if (lRet != ERROR_SUCCESS)
00202   {
00203       RegCloseKey(hKey2);
00204     RegCloseKey(hKey1);
00205     return E_FAIL;
00206   }
00207     RegCloseKey(hKey1);
00208     RegCloseKey(hKey2);
00209
00210     return NOERROR;
00211 }
00212
00213 //***************************************************************************
00214 //
00215 // DllUnregisterServer
00216 //
00217 // Purpose: Called when it is time to remove the registry entries.
00218 //
00219 // Return:  NOERROR if registration successful, error otherwise.
00220 //***************************************************************************
00221
00222 STDAPI DllUnregisterServer(void)
00223 {
00224     char       szID[128];
00225     WCHAR      wcID[128];
00226     char  szCLSID[128];
00227     HKEY hKey;
00228
00229     // Create the path using the CLSID
00230   memset(wcID, NULL, sizeof(wcID));
00231   memset(szID, NULL, sizeof(szID));
00232     CLSIDFromString(GUIDSTRING, &CLSID_CIM_REINDEER);
00233     StringFromGUID2(CLSID_CIM_REINDEER, wcID, sizeof(wcID)/sizeof(WCHAR));
00234
00235     wcstombs(szID, wcID, sizeof(szID));
00236
00237   StringCbCopy(szCLSID, sizeof(szCLSID), "Software\\classes\\CLSID\\");
00238   StringCbCat(szCLSID, sizeof(szCLSID), (LPCTSTR)szID);
00239
00240      // First delete the InProcServer subkey.
00241
00242     DWORD dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szCLSID, 0, KEY_WRITE, &hKey);
00243     if(dwRet == NO_ERROR)
00244     {
00245         RegDeleteKey(hKey, "InProcServer32");
00246         RegCloseKey(hKey);
00247     }
00248
00249     dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\CLASSES\\CLSID\\"), 0, KEY_WRITE, &hKey);
00250     if(dwRet == NO_ERROR)
00251     {
00252         RegDeleteKey(hKey,szID);
00253         RegCloseKey(hKey);
00254     }
00255
00256     return NOERROR;
00257 }
00258
00259 //***************************************************************************
00260 //
00261 // DllMain
00262 //
00263 // Purpose: Called by the operating system when processes and threads are
00264 //          initialized and terminated, or upon calls to the LoadLibrary
00265 //          and FreeLibrary functions
00266 //
00267 // Return:  TRUE if load was successful, else FALSE
00268 //***************************************************************************
00269
00270 BOOL APIENTRY DllMain ( HINSTANCE hInstDLL, // handle to dll module
00271                         DWORD fdwReason,    // reason for calling function
00272                         LPVOID lpReserved   )   // reserved
00273 {
00274     BOOL bRet = TRUE;
00275
00276     // Perform actions based on the reason for calling.
00277     switch( fdwReason )
00278     {
00279         case DLL_PROCESS_ATTACH:
00280     // TO DO: Consider adding DisableThreadLibraryCalls().
00281             DisableThreadLibraryCalls(hInstDLL);
00282
00283          // Initialize once for each new process.
00284          // Return FALSE to fail DLL load.
00285             ghModule = hInstDLL;
00286             bRet = CWbemProviderGlue::FrameworkLoginDLL(L"ReindeerProv");
00287             break;
00288
00289         case DLL_THREAD_ATTACH:
00290          // Do thread-specific initialization.
00291             break;
00292
00293         case DLL_THREAD_DETACH:
00294          // Do thread-specific cleanup.
00295             break;
00296
00297         case DLL_PROCESS_DETACH:
00298          // Perform any necessary cleanup.
00299             break;
00300     }
00301
00302     return bRet;  // Sstatus of DLL_PROCESS_ATTACH.
00303 }
00304
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_APPMEM_INSTANCE Member List

This is the complete list of members for _APPMEM_INSTANCE, including all inherited members.
dwAllocCalls | _APPMEM_INSTANCE
dwApplicationBytes | _APPMEM_INSTANCE
dwFreeCalls | _APPMEM_INSTANCE
dwOffsetOfNext | _APPMEM_INSTANCE
dwProcessId | _APPMEM_INSTANCE
dwReAllocCalls | _APPMEM_INSTANCE
dwReserved1 | _APPMEM_INSTANCE
dwReserved2 | _APPMEM_INSTANCE
hProcessHeap | _APPMEM_INSTANCE
wcszInstanceName | _APPMEM_INSTANCE
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/Dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • Help

Dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120     MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122     // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal) {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/FullSvr/fullserv.Cpp Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • FullSvr

fullserv.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: FullServ.cpp
00004
00005 Summary:  Implements CFullServ and CAsyncFullServ methods.
00006
00007
00008 ----------------------------------------------------------------------------
00009
00010 This file is part of the Microsoft COM+ Samples.
00011
00012 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00013
00014 This source code is intended only as a supplement to Microsoft
00015 Development Tools and/or on-line documentation. See these other
00016 materials for detailed information regarding Microsoft code samples.
00017
00018 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00021 PARTICULAR PURPOSE.
00022
00023 ==========================================================================+*/
00024 #include "stdafx.h"
00025 #include "FullSvr.h"
00026 #include "FullServ.h"
00027
00028 DWORD WINAPI WorkerFcn(LPVOID context);
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 // CFullServ
00032
00033 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00034   Method:   CFullServ::Sum implementing IFullServ::Sum
00035   Summary:  synchronous implementation of the Sum method of IFullServ
00036   Args:     [in] i,j the numbers to sum
00037       [out,retval] sum the result
00038   Returns:  HRESULT - Always returns S_OK
00039   Note:   This method will never be called.  Because CreateCall creates
00040       call objects for AsyncIFullServ all calls to both IFullServ
00041       and AsyncIFullServ will be handled asynchronously with the Begin
00042       and Finish methods.
00043 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00044 STDMETHODIMP CFullServ::Sum(int i, int j, int * sum){
00045   *sum = i + j;
00046   return S_OK;
00047 }
00048
00049 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00050   Method:   CFullServ::Work implementing ISample::Work
00051   Summary:  method used to compare scalability of sync and async implementation
00052       in scaledemo.  Simulates work before returning results
00053   Args:     [in] i,j the numbers to sum
00054       [out,retval] sum the result
00055   Returns:  HRESULT - Always returns S_OK
00056   Note:   Because CreateCall does not create call objects for AsyncISample
00057       this method will be used for all calls to both ISample
00058       and AsyncISample.  This method will be executed by an RPC thread
00059 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00060 STDMETHODIMP CFullServ::Work(int i, int j,int * sum){
00061
00062   for(int k = 0; k < 10000; k++){
00063     for(int l = 0; l < 10000; l++){
00064     }
00065   }
00066
00067   *sum = i + j;
00068   return S_OK;
00069 }
00070
00071 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00072   Method:   CFullServ::CreateCall
00073   Summary:  method used by the stub to create call objects for asynchronous
00074       handeling of calls.  In this case call objects are CAsyncFullServ
00075       instances that implement AsyncIFullServ
00076   Args:     [in] riid1 the IID of an asynchronous interface for which the stub
00077       needs a call object
00078       [in] pUnk a controlling unknown for aggregation with the call object
00079       [in] riid2 the call object interface to be placed in ppObj
00080       [out] ppObj the requested interface pointer
00081   Returns:  HRESULT
00082   Note:   CreateCall offers the opportunity to pass data between the objects
00083       implementing the synchronous and asynchronous interfaces.  In this
00084       case CFullServ passes a pointer to IFullServ to CAsyncFullServ
00085 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00086 STDMETHODIMP CFullServ::CreateCall(REFIID riid1,
00087            IUnknown * pUnk,
00088            REFIID riid2,
00089            IUnknown ** ppObj)
00090 {
00091   HRESULT hr;
00092   IFullServ * pIFullServ;
00093   if (ppObj == NULL) return E_POINTER;
00094
00095   //We only support one async interface: AsyncIFullServ + check for proper
00096   //aggregation
00097   if((riid1 != IID_AsyncIFullServ) || (pUnk && (riid2 != IID_IUnknown)))
00098     return E_INVALIDARG;
00099
00100   //Obtain a pointer to the synchronous IFullServ interface
00101   hr = ((IFullServ * )this)->QueryInterface(IID_IFullServ,(void**)&pIFullServ);
00102   _ASSERT(SUCCEEDED(hr));
00103
00104   //Create our object
00105   CComPolyObject<CAsyncFullServ>* pPolyFullServ = NULL;
00106   hr = CComPolyObject<CAsyncFullServ>::CreateInstance(pUnk,&pPolyFullServ);
00107
00108   if(FAILED(hr)){
00109     pIFullServ->Release();
00110     return hr;
00111   }
00112
00113   //Store pointer to the synchronous interface
00114   pPolyFullServ->m_contained.Init(pIFullServ);
00115   pIFullServ->Release();
00116
00117   //Return requested interface
00118   hr = pPolyFullServ->QueryInterface(riid2,(void**)ppObj);
00119
00120   return hr;
00121 }
00122
00123
00124 /////////////////////////////////////////////////////////////////////////////
00125 // CFullServ
00126
00127 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00128   Method:   CAsyncFullServ::Begin_Sum implementing AsyncIFullServ::Begin_Sum
00129   Summary:  This method is used to queue the [in] parameters for work by the
00130       system supplied thread pool.
00131   Args:     [in] i,j the numbers to sum
00132   Modifies: member vars m_i,m_j store params for later processing, m_hr stores
00133       a HRESULT for transmission back to the client
00134   Returns:  HRESULT - this result will not be seen by the client.  To return
00135       an error code to the client Begin must store an HRESULT call Signal()
00136       and let Finish return the HRESULT to the client
00137 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00138 STDMETHODIMP CAsyncFullServ::Begin_Sum(int i, int j){
00139
00140   HRESULT hr = S_OK;
00141   ISynchronize * pISynchronize;
00142   m_hr = S_OK;
00143
00144   if(m_callInProgress) return RPC_S_CALLPENDING;
00145
00146   m_callInProgress = TRUE;
00147
00148   // Get and store ptr to ISynchronize
00149   hr = ((AsyncIFullServ *)this)->QueryInterface(IID_ISynchronize,
00150                    (void**)&pISynchronize);
00151   _ASSERT(SUCCEEDED(hr));
00152
00153   pISynchronize->Reset();
00154
00155   //store [in] params
00156   m_i = i;
00157   m_j = j;
00158
00159   //Queue CAsyncFullServ for processing by a worker thread
00160   if(!QueueUserWorkItem(WorkerFcn, this, WT_EXECUTEDEFAULT)){
00161     m_hr = E_FAIL;
00162     pISynchronize->Signal();
00163   }
00164
00165   pISynchronize->Release();
00166   return S_OK;
00167 }//RPC thread is returned to the RPC thread pool
00168
00169 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00170   Function: WorkerFcn
00171   Summary:  This function is called by a worker thread from the thread pool.
00172       The function first simulates real work then calls the doSum method
00173   Args:     pContext a CAsyncFullServ instance that was queued for processing
00174       with QueueUserWorkItem
00175   Returns:  DWORD always returns 0
00176 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00177 DWORD WINAPI WorkerFcn(LPVOID pContext){
00178     // This thread from the system thread pool does not have
00179     // a predetermined COM thread type. So this code calls
00180     // CoInitializeEx to setup a proper execution environment
00181     // (i.e. same apartment (MTA) as Begin_Sum call was dispatched in.)
00182     HRESULT hr = CoInitializeEx(NULL,COINIT_MULTITHREADED);
00183   _ASSERT(SUCCEEDED(hr));
00184
00185     CAsyncFullServ * pAsyncFullServ = (CAsyncFullServ *) pContext;
00186
00187   //Simulate work
00188   for(int i = 0; i < 1000; i++){
00189     for(int j = 0; j < 1000; j++){
00190     }
00191   }
00192
00193   //Do the real Work of the function
00194   pAsyncFullServ->doSum();
00195
00196     // Call CoUninitialize to return this thread to
00197     // the uninitialized COM state.
00198     CoUninitialize();
00199   return 0;
00200 }
00201
00202 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00203   Method:   CAsyncFullServ::doSum
00204   Summary:  This method checks for call cancellation and then does the real
00205       work of Sum.  This method is executed by a worker thread
00206   Args:
00207   Modifies: member vars m_i,m_j store params for later processing, m_hr stores
00208       a HRESULT for transmission back to the client
00209   Returns:  HRESULT - always returns S_OK;
00210 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00211 STDMETHODIMP CAsyncFullServ::doSum(){
00212
00213   HRESULT hr;
00214   ISynchronize * pISynchronize;
00215   ICancelMethodCalls * pICancelMethodCalls = NULL;
00216
00217   //Get ISynchronize
00218   hr = ((AsyncIFullServ *)this)->QueryInterface(IID_ISynchronize,
00219                    (void**)&pISynchronize);
00220   _ASSERT(SUCCEEDED(hr));
00221
00222
00223   //Attempt to get pointer to ICancelMethod Calls
00224   hr = ((AsyncIFullServ *)this)->QueryInterface(IID_ICancelMethodCalls,
00225                                                       (void**)&pICancelMethodCalls);
00226
00227   //Check for call cancellation
00228   if(SUCCEEDED(hr)){
00229     hr = pICancelMethodCalls->TestCancel();
00230     if(hr == RPC_E_CALL_CANCELED){
00231       m_hr = hr; //record call cancellation for Finish
00232       pICancelMethodCalls->Release();
00233       pISynchronize->Signal();
00234       pISynchronize->Release();
00235       return S_OK;
00236     }
00237   }
00238
00239   //do the work of the function
00240   m_sum = m_i + m_j;
00241
00242     // Work complete, signal the stub so that the Finish_Sum method is called.
00243   pISynchronize->Signal();
00244   pISynchronize->Release();
00245   if(pICancelMethodCalls) pICancelMethodCalls->Release();
00246   return S_OK;
00247 }
00248
00249 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00250   Method:   CAsyncFullServ::Finish_Sum implements AsyncIFullServ::Finish_Sum
00251   Summary:  If the call was successful to this point, Finish will return the
00252       results of the call in the [out] params; otherwise Finish
00253       will return the error code to the client
00254   Args:     [out] sum
00255   Returns:  HRESULT - the result of Begin or doSum
00256   Note:   This method is called when Begin or doSum call ISynchronize::Signal
00257 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00258 STDMETHODIMP CAsyncFullServ::Finish_Sum(int * sum){
00259   HRESULT hr;
00260   ISynchronize * pISynchronize;
00261   if(!m_callInProgress)
00262     return RPC_E_CALL_COMPLETE;
00263   m_callInProgress = FALSE;
00264
00265   //Get ISynchronize
00266   hr = ((AsyncIFullServ *)this)->QueryInterface(IID_ISynchronize,
00267                    (void**)&pISynchronize);
00268   _ASSERT(SUCCEEDED(hr));
00269
00270   pISynchronize->Wait(COWAIT_WAITALL,INFINITE);
00271
00272   pISynchronize->Release();
00273
00274   //Check if call was canceled or if Begin failed
00275   if(FAILED(m_hr)){
00276     return m_hr; //Call failed or was canceled. m_sum is garbage
00277   }
00278
00279   *sum = m_sum;
00280   return m_hr; //call was successful
00281 }
00282
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DataObj.h Source File

  • WinUI
  • Shell
  • DragImg

DataObj.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DataObj.h
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 #ifndef DATAOBJ_H
00019 #define DATAOBJ_H
00020
00021 /**************************************************************************
00022    #include statements
00023 **************************************************************************/
00024
00025 #include <windows.h>
00026 #include <ole2.h>
00027
00028 /**************************************************************************
00029    global variables and definitions
00030 **************************************************************************/
00031
00032 #define MAX_NUM_FORMAT 5
00033
00034 /**************************************************************************
00035    class definitions
00036 **************************************************************************/
00037
00038 class CDataObject: public IDataObject
00039 {
00040 private:
00041    DWORD m_cRefCount;
00042    LPFORMATETC m_pFormatEtc;
00043    LPSTGMEDIUM m_pStgMedium;
00044    DWORD m_cDataCount;
00045
00046 public:
00047    CDataObject();
00048    ~CDataObject();
00049
00050    //IUnknown members that delegate to m_pUnkOuter.
00051    STDMETHOD(QueryInterface)(REFIID, LPVOID*);
00052    STDMETHOD_(ULONG, AddRef)(void);
00053    STDMETHOD_(ULONG, Release)(void);
00054
00055    /* IDataObject methods */
00056    STDMETHOD(GetData)(LPFORMATETC,  LPSTGMEDIUM);
00057    STDMETHOD(GetDataHere)(LPFORMATETC, LPSTGMEDIUM);
00058    STDMETHOD(QueryGetData)(LPFORMATETC);
00059    STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC, LPFORMATETC);
00060    STDMETHOD(SetData)(LPFORMATETC, LPSTGMEDIUM, BOOL);
00061    STDMETHOD(EnumFormatEtc)(DWORD, LPENUMFORMATETC*);
00062    STDMETHOD(DAdvise)(FORMATETC*, DWORD, LPADVISESINK, LPDWORD);
00063    STDMETHOD(DUnadvise)(DWORD);
00064    STDMETHOD(EnumDAdvise)(LPENUMSTATDATA*);
00065 };
00066
00067 #endif   //DATAOBJ_H
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/WinHlprs/cDialog.Cxx Source File

  • Com
  • Fundamentals
  • WinHlprs

cDialog.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright Microsoft Corporation.
00005 //
00006 //  File:       dialog.cxx
00007 //
00008 //  Contents:
00009 //
00010 //  Classes:    CHlprDialog
00011 //
00012 //  Functions:  DialogProc
00013 //
00014 //  History:    4-12-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include "cdialog.h"
00020
00021 //+---------------------------------------------------------------------------
00022 //
00023 //  Member:     CHlprDialog::ShowDialog
00024 //
00025 //  Synopsis:   Creates the dialog so that it's DialogProc member function can
00026 //              be invoked.
00027 //
00028 //  Arguments:  [hinst]        - handle of the application instance
00029 //              [lpszTemplate] - identifies the dialog box template
00030 //              [hwndOwner]    - handle of the owner window
00031 //
00032 //  Returns:    return value from the dialog box
00033 //
00034 //  History:    4-12-94   stevebl   Created
00035 //
00036 //  Notes:      The dialog box object exists until deleted by the caller.
00037 //              It can be shown any number of times.
00038 //
00039 //              This function is analgous to Windows' DialogBox function.  The
00040 //              main difference being that you don't specify a DialogProc;
00041 //              you override the pure virtal function CHlprDialog::DialogProc.
00042 //
00043 //----------------------------------------------------------------------------
00044
00045 int CHlprDialog::ShowDialog(HINSTANCE hinst, LPCTSTR lpszTemplate, HWND hwndOwner)
00046 {
00047     _hInstance = hinst;
00048     return((INT)DialogBoxParam(hinst, lpszTemplate, hwndOwner, (DLGPROC)::DialogProc, (long)this));
00049 }
00050
00051 //+---------------------------------------------------------------------------
00052 //
00053 //  Function:   DialogProc
00054 //
00055 //  Synopsis:   Common DialogProc used by all CHlprDialog class objects.
00056 //
00057 //  Arguments:  [hwndDlg] - handle of dialog box
00058 //              [uMsg]    - message
00059 //              [wParam]  - first message parameter
00060 //              [lParam]  - second message parameter
00061 //
00062 //  Returns:    response from the CHlprDialog::DialogProc method
00063 //
00064 //  History:    4-12-94   stevebl   Created
00065 //
00066 //  Notes:      This procedure is the DialogProc registered for all dialogs
00067 //              created with the CHlprDialog class.  It uses the parameter
00068 //              passed with the WM_INITDIALOG message to identify the dialog
00069 //              classes' "this" pointer which it then stores in the window
00070 //              structure's GWL_USERDATA field.  All subsequent messages
00071 //              can then be forwarded on to the correct dialog class's
00072 //              DialogProc method by using the pointer stored in the
00073 //              GWL_USERDATA field.
00074 //
00075 //----------------------------------------------------------------------------
00076
00077 BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00078 {
00079     CHlprDialog * pdlg;
00080     switch (uMsg)
00081     {
00082     case WM_INITDIALOG:
00083         // This message is how we identify the dialog object.
00084
00085         // get a pointer to the window class object
00086         pdlg = (CHlprDialog *) lParam;
00087         // set its USERDATA word to point to the class object
00088         SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) pdlg);
00089         break;
00090     default:
00091         // get a pointer to the window class object
00092         pdlg = (CHlprDialog *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
00093         break;
00094     }
00095     // and call its message proc method
00096     if (pdlg != (CHlprDialog *) 0)
00097     {
00098         return(pdlg->DialogProc(hwndDlg, uMsg, wParam, lParam));
00099     }
00100     else
00101     {
00102         return(FALSE);
00103     }
00104 }
00105
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/StrOut/Server.c Source File

  • NetDS
  • RPC
  • StrOut

Server.c

Go to the documentation of this file.
00001 /*************************************************************************
00002                     Copyright Microsoft Corp. 1992 - 2000
00003                         Remote Machine strout sample
00004
00005   FILE      :   server.c
00006
00007   USAGE     :   server  -p protocol_sequence
00008                         -e endpoint
00009
00010   PURPOSE   :   Server side of the RPC distributed application strout.
00011
00012   COMMENTS  :   This application uses the implicit binding method.
00013
00014 *************************************************************************/
00015 #include "strout.h"                 /* Generated by the midl compiler   */
00016 #include "common.h"                 /* Common definitions in this file  */
00017
00018 /* Local Procedures */
00019 void CleanUpServer(void);
00020
00021
00022 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00023 /*  Procedure   :   void Usage(_TUCHAR *)                               */
00024 /*  Desc        :   This procedure prints out an error message if the   */
00025 /*                  command line arguments are wrong                    */
00026 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00027 void Usage(_TUCHAR * pszProgramName)
00028 {
00029     _tprintf(TEXT("USAGE : %s [-option]\n"), pszProgramName);
00030     _tprintf(TEXT("Options : -p Protocol Sequence\n"));
00031     _tprintf(TEXT("          -e Endpoint\n"));
00032     exit(EXECUTION_OK);
00033 }
00034
00035
00036 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00037 /* The server main program                                              */
00038 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00039 int main(int argc, char *argv[])
00040 {
00041     int             nNumArgs,   /* The number of command line arguments */
00042                     nIdx;       /* Counter in loops                     */
00043     RPC_STATUS      nStatus;    /* Error status returned                */
00044
00045     // Variabels used for selecting the protocol and the endpoint
00046     _TUCHAR *pszProtocolSequence    = PROTOCOL_SEQUENCE;
00047     _TUCHAR *pszEndpoint            = END_POINT;
00048     _TUCHAR *pszSecurity            = NULL;
00049
00050
00051 /* Get a common handle on the command line arguments for both UNICODE   */
00052 /* and ASCII                                                            */
00053 #ifdef _UNICODE
00054     LPWSTR  *pArglist = CommandLineToArgvW(GetCommandLine(), &nNumArgs);
00055     if (NULL == pArglist)
00056     {
00057         _tprintf(TEXT("SERVER.C : CommandLineToArgW failed"));
00058         exit(EXECUTION_FAILED);
00059     }
00060 #else
00061     char **pArglist = argv;
00062     nNumArgs = argc;
00063 #endif
00064
00065     /* Allow the user to override settings with commandline switches    */
00066     for (nIdx = 1; nIdx < nNumArgs; nIdx++)
00067     {
00068         if((_tcscmp(pArglist[nIdx], TEXT("-p")) == 0) ||
00069            (_tcscmp(pArglist[nIdx], TEXT("-P")) == 0))
00070         {
00071             pszProtocolSequence = pArglist[++nIdx];
00072         }
00073         else if((_tcscmp(pArglist[nIdx], TEXT("-e")) == 0) ||
00074                 (_tcscmp(pArglist[nIdx], TEXT("-e")) == 0))
00075         {
00076             pszEndpoint = pArglist[++nIdx];
00077         }
00078         else
00079         {
00080             Usage(pArglist[0]);
00081         }
00082     }
00083
00084     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00085     /* Register the interface with the RPC run-time library             */
00086     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00087     _tprintf(TEXT("Registering the interface\n"));
00088     nStatus = RpcServerRegisterIf(
00089         strout_sample_v1_0_s_ifspec,    // Interface specification
00090         NULL,                           // UUID to ass. with MgrEnv arg.
00091         NULL);                          // Managers entry point vector.
00092     EXIT_IF_FAIL(nStatus, "RpcServerRegisterIf");
00093
00094
00095     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00096     /* Select Protocal sequence : This sample uses namedpipes as the    */
00097     /* default protocol. The RpcServerUseProtseqEp function tells the   */
00098     /* RPC run-time library to use the specified protocol sequence      */
00099     /* combined with the specified endpoint for receiving remote        */
00100     /* procedure calls                                                  */
00101     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00102     _tprintf(TEXT("Selecting the protocol sequence: \"%s\"\n"),
00103         pszProtocolSequence);
00104     nStatus = RpcServerUseProtseqEp(
00105         pszProtocolSequence,            // String with the protocol in
00106         RPC_C_PROTSEQ_MAX_REQS_DEFAULT, // Max number of calls
00107         pszEndpoint,                    // Endpoint addres information
00108         pszSecurity);                   // Security
00109     EXIT_IF_FAIL(nStatus, "RpcServerUseProtseqsEp");
00110
00111
00112     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00113     /* Now start listening for remote procedure calls from the client   */
00114     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00115     RpcTryExcept
00116     {
00117         _tprintf(TEXT("Listening for remote calls...\n"));
00118         nStatus = RpcServerListen(
00119             1,                              // The minimum number of calls
00120             RPC_C_LISTEN_MAX_CALLS_DEFAULT, // The maximum number of calls
00121             FALSE);                         // Cont. until expl. stopped
00122         EXIT_IF_FAIL(nStatus, "RpcServerListen");
00123     }
00124     RpcExcept(DO_EXCEPTION)
00125     {
00126         // Print out the exception code
00127         _tprintf(TEXT("Run-time exception %u in %s at line %d\n"),
00128                 RpcExceptionCode(), TEXT(__FILE__), __LINE__);
00129         exit(EXECUTION_FAILED);
00130     }
00131     RpcEndExcept
00132
00133
00134     // If no exceptions occured, clean up the server and exit
00135     CleanUpServer();
00136
00137     // Deallocate the memory used for the ARGLIST if using UNICODE
00138 #ifdef _UNICODE
00139     if (NULL != pArglist)
00140         free(pArglist);
00141 #endif
00142
00143     return (EXECUTION_OK);
00144 }
00145
00146 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00147 /* Procedure    : void CleanUpServer(RPC_BINDING_VECTOR);               */
00148 /* Desc.        : This procedure will unregister the interface          */
00149 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00150 void CleanUpServer(void)
00151 {
00152     RPC_STATUS nStatus;          // Error status returned from RPC calls
00153
00154     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00155     /* Unregister the interface from the RPC run-time library           */
00156     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00157     _tprintf(TEXT("Unregistering the Interface"));
00158     nStatus = RpcServerUnregisterIf(
00159         NULL, NULL, // Prevents server from receiving new remote calls
00160         FALSE);     // Wait until all the active calls are complete
00161     EXIT_IF_FAIL(nStatus, "RpcServerUnRegisterIf");
00162 }
00163
00164 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00165 /* Procedure    :   midl_user_allocate() and midl_user_free()           */
00166 /* Desc.        :   These procedure are declared in the header file     */
00167 /*                  generated by the midl compiler. These procedures    */
00168 /*                  should be used for all memory allocation and        */
00169 /*                  deallocation.                                       */
00170 /*                  These procedures are also called by the stub code   */
00171 /*                  to allocate and free memory.                        */
00172 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00173 void __RPC_FAR * __RPC_API midl_user_allocate(size_t nLen)
00174 {
00175     return (malloc(nLen));
00176 }
00177
00178 void __RPC_API midl_user_free(void __RPC_FAR * lpvPointer)
00179 {
00180     if(NULL != lpvPointer)
00181         free (lpvPointer);
00182 }
00183
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DBCONN Member List

This is the complete list of members for DBCONN, including all inherited members.
hdbc | DBCONN
hstmt | DBCONN
pszPasswd | DBCONN
pszSrv | DBCONN
pszUser | DBCONN
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/dataobj.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

dataobj.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "DataObj.h"
00016 #include "StaticNode.h"
00017
00018                              // Tracing stuff
00019 #include "TraceMacro.h"
00020 #undef  MODULESTRING
00021 #define MODULESTRING  _T("CDataObject")
00022
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // Construction/Destruction
00026
00027
00028 CDataObject::CDataObject()
00029 {
00030   m_cRef     = 0;
00031   m_uCookie  = 0;
00032   m_uContext = 0;
00033
00034 }
00035
00036 CDataObject::~CDataObject()
00037 {
00038 }
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // IUnknown implementation
00042
00043 //---------------------------------------------------------------------------
00044 STDMETHODIMP CDataObject::QueryInterface
00045 (
00046   REFIID   riid,
00047   LPVOID*  ppv
00048 )
00049 {
00050   if( !ppv )
00051     return E_FAIL;
00052
00053   HRESULT hResult = E_NOINTERFACE;
00054   *ppv = NULL;
00055
00056   if( IsEqualIID(riid, IID_IUnknown) )
00057     *ppv = static_cast<IDataObject*>(this);
00058   else if( IsEqualIID(riid, IID_IDataObject) )
00059     *ppv = static_cast<IDataObject*>(this);
00060
00061   if( *ppv )
00062   {
00063     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00064     hResult = S_OK;
00065   }
00066
00067   return hResult;
00068 }
00069
00070 //---------------------------------------------------------------------------
00071 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00072 {
00073   return InterlockedIncrement((LONG*)&m_cRef);
00074 }
00075
00076 //---------------------------------------------------------------------------
00077 STDMETHODIMP_(ULONG) CDataObject::Release()
00078 {
00079   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00080   {
00081     delete this;
00082     return 0;
00083   }
00084   return m_cRef;
00085 }
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 // IDataObject implementation
00089 //
00090
00091 //---------------------------------------------------------------------------
00092 //  MMC will call GetDataHere() for it's required clipboard formats
00093 //
00094 HRESULT CDataObject::GetDataHere
00095 (
00096   FORMATETC *pFormatEtc,     //[in]  Pointer to the FORMATETC structure
00097   STGMEDIUM *pMedium         //[out] Pointer to the STGMEDIUM structure
00098 )
00099 {
00100   const CLIPFORMAT cf = pFormatEtc->cfFormat;
00101   IStream* ipStream = NULL;
00102
00103   HRESULT hResult = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &ipStream );
00104   if( S_OK != hResult )
00105     return hResult;                        // Minimal error checking
00106
00107   hResult = DV_E_FORMATETC;                // Unknown format
00108
00109   if( cf == g_cfDisplayName )
00110   {
00111     hResult = RetrieveDisplayString( ipStream );
00112   }
00113   else if( cf == g_cfSnapinClsid )
00114   {
00115     hResult = RetrieveSnapInClassID( ipStream );
00116   }
00117   else if( cf == g_cfNodeType )
00118   {
00119     hResult = RetrieveNodeTypeGuid( ipStream );
00120   }
00121   else if( cf == g_cfszNodeType )
00122   {
00123     hResult = RetrieveGuidString( ipStream );
00124   }
00125   else if( cf == g_cfBaseNodePtr )
00126   {
00127     hResult = RetrieveBaseNodePtr( ipStream );
00128   }
00129   else if( cf == g_cfDataObjPtr )
00130   {
00131     hResult = RetrieveDataObjPtr( ipStream );
00132   }
00133
00134   ipStream->Release();
00135
00136   return hResult;
00137 }
00138
00139 //---------------------------------------------------------------------------
00140 VOID CDataObject::SetPrivateData
00141 (
00142   ULONG_PTR  uCookie,      //[in] Pointer to node this object represents
00143   ULONG  uContext      //[in] Context of the node
00144 )
00145 {
00146   m_uCookie  = uCookie;
00147   m_uContext = uContext;
00148 }
00149
00150 /////////////////////////////////////////////////////////////////////////////
00151 //  Handlers for MMC's required clipboard formats
00152
00153
00154 //---------------------------------------------------------------------------
00155 // CCF_DISPLAY_NAME is one of the required clipformats.
00156 // MMC askes for this string to display the name of the SnapIn's StaticNode
00157 // in the ScopePane
00158 //
00159 HRESULT CDataObject::RetrieveDisplayString
00160 (
00161   IStream* ipStream        //[in][out] Stream to return our data in.
00162 )
00163 {
00164   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00165   LPWSTR pNodeName = pNode->GetNodeName();
00166
00167   ULONG ulSizeofName = (wcslen(pNodeName) + 1) * sizeof(WCHAR);
00168   return ipStream->Write(pNodeName, ulSizeofName, NULL);
00169
00170 }
00171
00172 //---------------------------------------------------------------------------
00173 //  CCF_SNAPIN_CLASSID is one of the required clipformats.
00174 //  MMC will ask for this data.  This ClassID which we return represents
00175 //  the COM object which is the entry point for our SnapIn
00176 //
00177 HRESULT CDataObject::RetrieveSnapInClassID
00178 (
00179   IStream* ipStream        //[in][out] Stream to return our data in.
00180 )
00181 {
00182   return ipStream->Write( &CLSID_CComponentData, sizeof(GUID), NULL );
00183 }
00184
00185
00186 //---------------------------------------------------------------------------
00187 //  CCF_NODETYPE is one of the required clipformats.
00188 //  MMC needs the NodeType GUID to determine what extensions to activate
00189 //  for a node.  It looks under the MMC/NodeTypes registry key for the GUID
00190 //  and enumerates the extensions found beneath it.  MMC uses this GUID
00191 //  strictly as a uniquie identifier.  It does not expect it to correspond
00192 //  to the ClaseID of a com object.
00193 //
00194 HRESULT CDataObject::RetrieveNodeTypeGuid
00195 (
00196   IStream* ipStream        //[in][out] Stream to return our data in.
00197 )
00198 {
00199   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00200   GUID* pGuid = (GUID*)&pNode->GetNodeGUID();
00201
00202   return ipStream->Write( (void*)pGuid, sizeof(GUID), NULL );
00203 }
00204
00205
00206 //---------------------------------------------------------------------------
00207 //  CCF_SZNODETYPE is a required clipboard format.
00208 //  We return the node's GUID as a wide string.
00209 //
00210 HRESULT CDataObject::RetrieveGuidString
00211 (
00212   IStream* ipStream        //[in][out] Stream to return our data in.
00213 )
00214 {
00215   LPOLESTR pszGUID;
00216   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00217
00218   HRESULT  hResult = StringFromCLSID( pNode->GetNodeGUID(), &pszGUID );
00219   if( S_OK == hResult )
00220   {
00221     hResult = ipStream->Write( pszGUID, (wcslen(pszGUID) + 1) * sizeof(WCHAR), NULL );
00222     CoTaskMemFree( pszGUID );
00223   }
00224
00225   return hResult;
00226 }
00227
00228 //---------------------------------------------------------------------------
00229 HRESULT CDataObject::RetrieveBaseNodePtr
00230 (
00231   IStream* ipStream        //[in][out] Stream to return our data in.
00232 )
00233 {
00234   LPBASENODE pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00235   return ipStream->Write( &pNode, sizeof(LPBASENODE), NULL );
00236 }
00237
00238 //---------------------------------------------------------------------------
00239 HRESULT CDataObject::RetrieveDataObjPtr
00240 (
00241   IStream* ipStream        //[in][out] Stream to return our data in.
00242 )
00243 {
00244   CDataObject* pThis = this;
00245   return ipStream->Write( &pThis, sizeof(CDataObject*), NULL );
00246 }
00247
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/SessionDlg.Cpp Source File

  • WinBase
  • WtsApi
  • WtsApi

SessionDlg.Cpp

Go to the documentation of this file.
00001 // SessionDlg.cpp : implementation file
00002 //
00003 //  Copyright 1995-1998, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006
00007 #include "stdafx.h"
00008 #include "API.h"
00009 #include "SessionDlg.h"
00010 #include "QueryDlg.h"
00011 //#include "SetSessionDlg.h"
00012 #include "APIDoc.h"
00013 //#include "wtsapi32.h"
00014
00015 #ifdef _DEBUG
00016 #define new DEBUG_NEW
00017 #undef THIS_FILE
00018 static char THIS_FILE[] = __FILE__;
00019 #endif
00020
00021 char *VCName[] = {
00022     "CTXTW  ",
00023     "CTXLPT1",
00024     "CTXCPM ",
00025     "CTXCDM ",
00026     "CTXCLIP",
00027     NULL,
00028   };
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 // CSessionDlg dialog
00032
00033
00034 CSessionDlg::CSessionDlg(CWnd* pParent /*=NULL*/)
00035   : CDialog(CSessionDlg::IDD, pParent)
00036 {
00037   //{{AFX_DATA_INIT(CSessionDlg)
00038   //}}AFX_DATA_INIT
00039 }
00040
00041 void CSessionDlg::DoDataExchange(CDataExchange* pDX)
00042 {
00043   CDialog::DoDataExchange(pDX);
00044   //{{AFX_DATA_MAP(CSessionDlg)
00045   DDX_Control(pDX, IDC_LIST_SESSION, m_sessionList);
00046   DDX_Control(pDX, IDC_SERVER_NAME, m_serverName);
00047   //}}AFX_DATA_MAP
00048 }
00049
00050
00051 BEGIN_MESSAGE_MAP(CSessionDlg, CDialog)
00052   //{{AFX_MSG_MAP(CSessionDlg)
00053   ON_BN_CLICKED(IDC_DISCONNECT_SESSION, OnDisconnectSession)
00054   ON_BN_CLICKED(IDC_LOGOFF_SESSION, OnLogoffSession)
00055   ON_BN_CLICKED(IDC_QUERY_SESSION, OnQuerySession)
00056   ON_BN_CLICKED(IDC_VIRTUAL_CHANNEL, OnVirtualChannel)
00057   ON_BN_CLICKED(IDC_REFRESH, OnRefresh)
00058   //}}AFX_MSG_MAP
00059 END_MESSAGE_MAP()
00060
00061 /////////////////////////////////////////////////////////////////////////////
00062 // CSessionDlg message handlers
00063
00064 void CSessionDlg::OnDisconnectSession()
00065 {
00066   GetSessionID();
00067   if (!WTSDisconnectSession(serverHandle,sessionID,0x0))
00068     AfxMessageBox("Unable to disconnect session");
00069   else
00070     Refresh();
00071 }
00072
00073 void CSessionDlg::OnLogoffSession()
00074 {
00075   GetSessionID();
00076   if (!WTSLogoffSession(serverHandle,sessionID,0x0))
00077     AfxMessageBox("Unable to logoff session");
00078   else
00079     Refresh();
00080 }
00081
00082 void CSessionDlg::OnQuerySession()
00083 {
00084   SetSessionID();
00085   CQueryDlg dialog;
00086   dialog.DoModal();
00087 }
00088
00089 BOOL CSessionDlg::OnInitDialog()
00090 {
00091   CDialog::OnInitDialog();
00092
00093   serverName = g_pDoc->GetServerName();
00094   serverHandle = WTSOpenServer(serverName);
00095
00096   CString serverDisplay;
00097   serverDisplay = "List of sessions on ";
00098   if (*serverName == NULL)
00099     serverDisplay += "local server";
00100   else
00101     serverDisplay += serverName;
00102   m_serverName.SetWindowText(serverDisplay);
00103
00104
00105   LV_COLUMN lvColumn;
00106   lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00107   lvColumn.fmt = LVCFMT_LEFT;
00108   lvColumn.cx = 120;
00109   lvColumn.iSubItem = 0;
00110   lvColumn.pszText = "WinStation";
00111   m_sessionList.InsertColumn(0, &lvColumn);
00112   lvColumn.iSubItem = 1;
00113   lvColumn.pszText = "Session ID";
00114   m_sessionList.InsertColumn(1, &lvColumn);
00115   lvColumn.iSubItem = 2;
00116   lvColumn.pszText = "Connection Status";
00117   m_sessionList.InsertColumn(2, &lvColumn);
00118
00119   connectState[0] = "Active";
00120   connectState[1] = "Connected";
00121   connectState[2] = "ConnectQuery";
00122   connectState[3] = "Shadow";
00123   connectState[4] = "Disconnected";
00124   connectState[5] = "Idle";
00125   connectState[6] = "Listen";
00126   connectState[7] = "Reset";
00127   connectState[8] = "Down";
00128   connectState[9] = "Init";
00129
00130   Refresh();
00131   return TRUE;
00132 }
00133
00134 void CSessionDlg::Refresh()
00135 {
00136   if (!m_sessionList.DeleteAllItems())
00137     AfxMessageBox("Error unable to delete items");
00138
00139   if (!WTSEnumerateSessions(serverHandle,0,1,&pSessionInfo,&count))
00140     AfxMessageBox("Unable to enumerate sessions");
00141   PWTS_SESSION_INFO pSession = pSessionInfo;
00142
00143   CString temp;
00144   LV_ITEM lvItem;
00145   lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;
00146   lvItem.state = 0;
00147   lvItem.stateMask = 0;
00148   lvItem.iImage = 0;
00149
00150   CString tempString;
00151
00152   for (DWORD i=0; i < count; i++)
00153   {
00154     lvItem.iItem = i;
00155     lvItem.iSubItem = 0;
00156     if (*pSession->pWinStationName == NULL)
00157       lvItem.pszText = "<No Name>";
00158     else
00159       lvItem.pszText = pSession->pWinStationName;
00160
00161     m_sessionList.InsertItem(&lvItem);
00162     tempString.Format("%d", pSession->SessionId);
00163     m_sessionList.SetItemText(i, 1, tempString);
00164     tempString = connectState[pSession->State];
00165       m_sessionList.SetItemText(i, 2, tempString);
00166     temp = m_sessionList.GetItemText(i,0);
00167     pSession++;
00168   }
00169 }
00170
00171 void CSessionDlg::OnVirtualChannel()
00172 {
00173   HANDLE VCHandle;
00174   //int i, j, k;
00175   int i;
00176   //PVOID DataBuf;
00177   ULONG BytesReturned = 0;
00178   //int Words;
00179   //PULONG pw;
00180
00181   serverName = g_pDoc->GetServerName();
00182   serverHandle = WTSOpenServer(serverName);
00183
00184   GetSessionID();
00185
00186   AfxMessageBox("Starting Virtual Channel Test");
00187   CString virtualMessage, data1, data2;
00188     for (i=0; VCName[i]; i++)
00189   {
00190     virtualMessage.Format("String length of %s is %d\r\n",VCName[i],strlen(VCName[i]));
00191         AfxMessageBox(virtualMessage);
00192
00193     if (VCHandle = WTSVirtualChannelOpen(serverHandle, sessionID, VCName[i]))
00194     {
00195
00196 #ifdef ICA_STUFF_INCLUDED
00197         if (WTSVirtualChannelQuery(VCHandle,
00198                                       WTSVirtualClientData,
00199                                       &DataBuf,
00200                                       &BytesReturned))
00201     {
00202       int Words;
00203       PULONG pw;
00204       PVOID DataBuf;
00205       int j, k;
00206
00207       virtualMessage.Format("WTSVirtualChannelQuery(WTSVirtualClientData) Passed Bytes Returned: %d\r\n",
00208                           BytesReturned);
00209       AfxMessageBox(virtualMessage);
00210
00211           Words = (BytesReturned + sizeof(ULONG) - 1) / sizeof(ULONG);
00212
00213       virtualMessage = "";
00214       for (j=0,pw=(PULONG)DataBuf;j<Words;) {
00215                data1.Format("%04x: ",j*4);
00216                for(k=0;((k < 4) && (j<Words));j++,k++,pw++) {
00217                     data2.Format("%08x  ",*pw);
00218           data1 += data2;
00219                }
00220          virtualMessage += data1;
00221          virtualMessage += "\r\n";
00222           }
00223       AfxMessageBox(virtualMessage);
00224           WTSFreeMemory(DataBuf);
00225         }
00226     else {
00227                 virtualMessage.Format("*** WTSVirtualChannelQuery(WTSVirtualClientData) failed - error: %d\r\n",
00228                        GetLastError());
00229         AfxMessageBox(virtualMessage);
00230     }
00231 #endif
00232
00233         if (WTSVirtualChannelPurgeInput(VCHandle)) {
00234             virtualMessage.Format("WTSVirtualChannelPurgeInput Passed\r\n");
00235       AfxMessageBox(virtualMessage);
00236         } else {
00237             virtualMessage.Format("*** WTSVirtualChannelPurgeInput failed - error: %d\r\n",
00238                 GetLastError());
00239       AfxMessageBox(virtualMessage);
00240         }
00241
00242             if (WTSVirtualChannelPurgeOutput(VCHandle)) {
00243                 virtualMessage.Format("WTSVirtualChannelPurgeOutput Passed\r\n" );
00244         AfxMessageBox(virtualMessage);
00245             } else {
00246                 virtualMessage.Format("*** WTSVirtualChannelPurgeOutput failed - error: %d\r\n",
00247                        GetLastError() );
00248         AfxMessageBox(virtualMessage);
00249             }
00250
00251             if (WTSVirtualChannelClose(VCHandle)) {
00252                 virtualMessage.Format("Open/Close channel %s Passed\r\n", VCName[i]);
00253         AfxMessageBox(virtualMessage);
00254             } else {
00255                 virtualMessage.Format("*** Close channel %s failed - error: %d\r\n",
00256                    VCName[i], GetLastError());
00257           AfxMessageBox(virtualMessage);
00258             }
00259         } else {
00260             virtualMessage.Format("*** Open channel %s failed - error: %d\r\n",
00261                      VCName[i], GetLastError());
00262       AfxMessageBox(virtualMessage);
00263     }
00264     }
00265     virtualMessage.Format("Ending Virtual Channel Test\r\n" );
00266   AfxMessageBox(virtualMessage);
00267 }
00268
00269 void CSessionDlg::OnRefresh()
00270 {
00271   Refresh();
00272 }
00273
00274 void CSessionDlg::OnCancel()
00275 {
00276   WTSFreeMemory(pSessionInfo);
00277   WTSCloseServer(serverHandle);
00278   CDialog::OnCancel();
00279 }
00280
00281 void CSessionDlg::SetSessionID()
00282 {
00283   PWTS_SESSION_INFO pSession = pSessionInfo;
00284   CString tempName;
00285   UINT state;
00286   for (DWORD i=0; i < count; i++)
00287   {
00288     state = m_sessionList.GetItemState(i, LVIS_SELECTED);
00289     if (state == LVIS_SELECTED)
00290     {
00291       sessionID = pSession->SessionId;
00292       i = count;
00293     }
00294     pSession++;
00295   }
00296   g_pDoc->SetSessionID(sessionID);
00297 }
00298
00299
00300 void CSessionDlg::GetSessionID()
00301 {
00302   PWTS_SESSION_INFO pSession = pSessionInfo;
00303   UINT state;
00304   for (DWORD i=0; i < count; i++)
00305   {
00306     state = m_sessionList.GetItemState(i, LVIS_SELECTED);
00307     if (state == LVIS_SELECTED)
00308       sessionID = pSession->SessionId;
00309     pSession++;
00310   }
00311 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CExtObject Member List

This is the complete list of members for CExtObject, including all inherited members.
AddContextMenuItems(IUnknown *piDataIn, IWCContextMenuCallback *piCallbackIn) | CExtObject |
BWizard(void) const | CExtObject | [inline]
BWizard(void) const | CExtObject | [inline]
CExtObject(void) | CExtObject |
CExtObject(void) | CExtObject |
Cobj(void) const | CExtObject | [inline]
Cobj(void) const | CExtObject | [inline]
Cot() | CExtObject | [inline]
Cot() | CExtObject | [inline]
CreatePropertySheetPages(IUnknown *piDataIn, IWCPropertySheetCallback *piCallbackIn) | CExtObject |
CreatePropertySheetPages(IUnknown *piDataIn, IWCPropertySheetCallback *piCallbackIn) | CExtObject |
CreateWizardPages(IUnknown *piDataIn, IWCWizardCallback *piCallbackIn) | CExtObject |
CreateWizardPages(IUnknown *piDataIn, IWCWizardCallback *piCallbackIn) | CExtObject |
DECLARE_REGISTRY(CExtObject, _T("CLUADMEX.ClipBookServerEx"), _T("CLUADMEX.ClipBookServerEx"), IDS_CLUADMEX_COMOBJ_DESC, THREADFLAGS_APARTMENT) | CExtObject |
DECLARE_REGISTRY(CExtObject, _T("CLUADMEX.FileShareSampleEx"), _T("CLUADMEX.FileShareSampleEx"), IDS_CLUADMEX_COMOBJ_DESC, THREADFLAGS_APARTMENT) | CExtObject |
Hcluster(void) const | CExtObject | [inline]
Hcluster(void) const | CExtObject | [inline]
Hfont(void) const | CExtObject | [inline]
Hfont(void) const | CExtObject | [inline]
Hicon(void) const | CExtObject | [inline]
Hicon(void) const | CExtObject | [inline]
HrGetObjectInfo(void) | CExtObject |
HrGetObjectInfo(void) | CExtObject |
HrGetUIInfo(IUnknown *piDataIn) | CExtObject | [protected]
HrGetUIInfo(IUnknown *piDataIn) | CExtObject | [protected]
HrSaveData(IUnknown *piDataIn) | CExtObject | [protected]
HrSaveData(IUnknown *piDataIn) | CExtObject | [protected]
InterfaceSupportsErrorInfo(REFIID riid) | CExtObject |
InterfaceSupportsErrorInfo(REFIID riid) | CExtObject |
InvokeCommand(ULONG nCommandIDIn, IUnknown *piDataIn) | CExtObject |
Lcid(void) const | CExtObject | [inline]
Lcid(void) const | CExtObject | [inline]
m_bWizard | CExtObject | [protected]
m_cobj | CExtObject | [protected]
m_hCluster | CExtObject | [protected]
m_hfont | CExtObject | [protected]
m_hicon | CExtObject | [protected]
m_lcid | CExtObject | [protected]
m_lpg | CExtObject | [protected]
m_piData | CExtObject | [protected]
m_piWizardCallback | CExtObject | [protected]
m_podObjData | CExtObject | [protected]
PiWizardCallback(void) const | CExtObject | [inline]
PiWizardCallback(void) const | CExtObject | [inline]
PodObjData(void) | CExtObject | [inline]
PodObjData(void) | CExtObject | [inline]
~CExtObject(void) | CExtObject | [protected, virtual]
~CExtObject(void) | CExtObject | [protected, virtual]
Generated on Wed Nov 13 2024 16:56:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/dbprop.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

dbprop.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module DBPROP.CPP | IDBProperties and IDBInfo interface implementations
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012 #include "headers.h"
00013
00014 // Code ----------------------------------------------------------------------
00015
00016 //  IDBInfo specific interface methods
00017 // CImpIDBInfo::GetKeywords  --------------------------------------------
00018 //
00019 // @mfunc Returns information about keywords used in text commands
00020 //
00021 // @rdesc HRESULT
00022 //    @flag S_OK | Keywords successfully returned, NULL because no keywords
00023 //      @flag E_INVALIDARG  | ppwszKeywords was NULL
00024 //      @flag E_UNEXPECTED  | Can not be called unless initialized
00025 //
00026 STDMETHODIMP    CImpIDBInfo::GetKeywords
00027     (
00028       LPWSTR* ppwszKeywords
00029     )
00030 {
00031     //
00032   // Asserts
00033     //
00034     assert(m_pObj);
00035
00036     //
00037     // Check in-params and NULL out-params in case of error
00038     //
00039     if( !ppwszKeywords )
00040     return E_INVALIDARG;
00041
00042   *ppwszKeywords = NULL;
00043
00044     //
00045   // Check to see if initialized
00046     //
00047   if( !m_pObj->m_fDSOInitialized )
00048     return E_UNEXPECTED;
00049
00050     return S_OK;
00051 }
00052
00053 // CImpIDBInfo::GetLiteralInfo  -----------------------------------------
00054 //
00055 // @mfunc Returns information about literals used in text command
00056 //
00057 // @rdesc HRESULT
00058 //    @flag S_OK      | cLiterals was 0
00059 //      @flag E_INVALIDARG  | cLiterals not equal to 0 and rgLiterals was NULL or
00060 //              | pcLiteralInfo, prgLiteralInfo, or ppCharBuffer was NULL
00061 //      @flag E_UNEXPECTED  | Can not be called unless initialized
00062 //    @flag DB_E_ERRORSOCCURRED | None of the requested literals are supported
00063 //
00064 STDMETHODIMP    CImpIDBInfo::GetLiteralInfo
00065     (
00066       ULONG           cLiterals,      //@parm IN | # of literals
00067     const DBLITERAL rgLiterals[],   //@parm IN | Array of literals
00068     ULONG*          pcLiteralInfo,  //@parm OUT | # of literals returned
00069     DBLITERALINFO** prgLiteralInfo, //@parm OUT | Array of info structures
00070     WCHAR**         ppCharBuffer    //@parm OUT | Buffer for characters
00071     )
00072 {
00073     HRESULT hr = DB_E_ERRORSOCCURRED;
00074   ULONG   ulIndex = 0;
00075
00076     //
00077   // Asserts
00078     //
00079     assert(m_pObj);
00080
00081     //
00082     // Check in-params and NULL out-params in case of error
00083     //
00084   if( pcLiteralInfo )
00085     *pcLiteralInfo = 0;
00086
00087   if( prgLiteralInfo )
00088     *prgLiteralInfo = NULL;
00089
00090   if( ppCharBuffer )
00091     *ppCharBuffer = NULL;
00092
00093     //
00094   // Check input and output values pointers
00095     //
00096     if( cLiterals && !rgLiterals )
00097         return E_INVALIDARG;
00098
00099     if( !pcLiteralInfo || !prgLiteralInfo || !ppCharBuffer )
00100         return E_INVALIDARG;
00101
00102     //
00103   // Check to see if initialized
00104     //
00105   if( !m_pObj->m_fDSOInitialized )
00106     return E_UNEXPECTED;
00107
00108     //
00109   // If cLiterals is 0, ignore rgLiterals
00110   // return all supported values
00111     //
00112   if( cLiterals == 0 )
00113     return S_OK;
00114
00115     //
00116   // Allocate memory for DBLITERALINFO array
00117     //
00118     SAFE_ALLOC(*prgLiteralInfo, DBLITERALINFO, cLiterals);
00119
00120     //
00121   // Process each of the DBLITERAL values that are in the restriction array
00122     //
00123   *pcLiteralInfo = cLiterals;
00124
00125   for(ulIndex=0; ulIndex < cLiterals; ulIndex++)
00126   {
00127     (*prgLiteralInfo)[ulIndex].lt = rgLiterals[ulIndex];
00128     (*prgLiteralInfo)[ulIndex].fSupported = FALSE;
00129     (*prgLiteralInfo)[ulIndex].pwszLiteralValue = NULL;
00130     (*prgLiteralInfo)[ulIndex].pwszInvalidChars = NULL;
00131     (*prgLiteralInfo)[ulIndex].pwszInvalidStartingChars = NULL;
00132     (*prgLiteralInfo)[ulIndex].cchMaxLen = 0;
00133   }
00134
00135 CLEANUP:
00136
00137   return hr;
00138 }
00139
00140
00141
00142 //  IDBProperties specific interface methods
00143
00144 // CImpIDBProperties::GetPropertyInfo  -----------------------------------------
00145 //
00146 // @mfunc Returns information about rowset and data source properties supported
00147 // by the provider
00148 //
00149 // @rdesc HRESULT
00150 //      @flag S_OK          | The method succeeded
00151 //      @flag E_INVALIDARG  | pcPropertyInfo or prgPropertyInfo was NULL
00152 //      @flag E_OUTOFMEMORY | Out of memory
00153 //
00154 STDMETHODIMP    CImpIDBProperties::GetPropertyInfo
00155     (
00156       ULONG       cPropertySets,    //@parm IN  | # of properties
00157       const DBPROPIDSET rgPropertySets[], //@parm IN  | Array of properties
00158       ULONG*        pcPropertyInfoSets, //@parm OUT | # of properties returned
00159       DBPROPINFOSET**   prgPropertyInfoSets,//@parm OUT | Property values returned
00160     WCHAR**       ppDescBuffer    //@parm OUT | Description Buffer
00161     )
00162 {
00163     //
00164   // Asserts
00165     //
00166   assert(m_pObj);
00167     assert(m_pObj->m_pUtilProp);
00168
00169     //
00170     // Just pass this call on to the utility object that manages our properties
00171     //
00172     return m_pObj->m_pUtilProp->GetPropertyInfo(
00173                   m_pObj->m_fDSOInitialized,
00174                   cPropertySets,
00175                   rgPropertySets,
00176                   pcPropertyInfoSets,
00177                   prgPropertyInfoSets,
00178                   ppDescBuffer );
00179 }
00180
00181
00182 // IDBProperties::GetProperties ----------------------------------------------------
00183 //
00184 // @mfunc Returns current settings of all properties in the FLAGS_DATASRCINF
00185 //      property group
00186 //
00187 // @rdesc HRESULT
00188 //      @flag S_OK          | The method succeeded
00189 //      @flag E_INVALIDARG  | pcProperties or prgPropertyInfo was NULL
00190 //      @flag E_OUTOFMEMORY | Out of memory
00191 //
00192 STDMETHODIMP CImpIDBProperties::GetProperties
00193     (
00194       ULONG       cPropertySets,    //@parm IN | count of restiction guids
00195     const DBPROPIDSET rgPropertySets[], //@parm IN | restriction guids
00196     ULONG*              pcProperties,   //@parm OUT | count of properties returned
00197     DBPROPSET**     prgProperties   //@parm OUT | property information returned
00198     )
00199 {
00200     HRESULT hr = E_FAIL;
00201
00202     //
00203   // Asserts
00204     //
00205   assert(m_pObj);
00206     assert(m_pObj->m_pUtilProp);
00207
00208     //
00209     // Check in-params and NULL out-params in case of error
00210     //
00211   hr = m_pObj->m_pUtilProp->GetPropertiesArgChk(
00212                   m_pObj->m_fDSOInitialized ?
00213                   PROPSET_DSOINIT :
00214                   PROPSET_DSO,
00215                   cPropertySets,
00216                   rgPropertySets,
00217                   pcProperties,
00218                   prgProperties );
00219   if( FAILED(hr) )
00220     return hr;
00221
00222     //
00223     // Just pass this call on to the utility object that manages our properties
00224     //
00225     return m_pObj->m_pUtilProp->GetProperties(
00226                   m_pObj->m_fDSOInitialized ?
00227                   PROPSET_DSOINIT :
00228                   PROPSET_DSO,
00229                   cPropertySets,
00230                   rgPropertySets,
00231                   pcProperties,
00232                   prgProperties );
00233 }
00234
00235
00236 // CImpIDBProperties::SetProperties  --------------------------------------------
00237 //
00238 // @mfunc Set properties in the FLAGS_DATASRCINF property group
00239 //
00240 // @rdesc HRESULT
00241 //      @flag S_OK          | The method succeeded
00242 //      @flag E_INVALIDARG  | cProperties was not equal to 0 and rgProperties was NULL
00243 //
00244 STDMETHODIMP    CImpIDBProperties::SetProperties
00245     (
00246   ULONG   cPropertySets,    //@parm IN | Count of structs returned
00247   DBPROPSET rgPropertySets[]    //@parm IN | Array of Properties
00248   )
00249 {
00250     HRESULT hr = E_FAIL;
00251
00252     //
00253   // Asserts
00254     //
00255   assert(m_pObj);
00256     assert(m_pObj->m_pUtilProp);
00257
00258     //
00259   // No-op if cPropertySets is 0
00260     //
00261   if( cPropertySets == 0 )
00262     return S_OK;
00263
00264     //
00265     // Check in-params and NULL out-params in case of error
00266     //
00267   hr=m_pObj->m_pUtilProp->SetPropertiesArgChk(cPropertySets, rgPropertySets);
00268
00269   if( FAILED(hr) )
00270     return hr;
00271
00272     //
00273     // Just pass this call on to the utility object that manages our properties
00274     //
00275     return m_pObj->m_pUtilProp->SetProperties(
00276                   m_pObj->m_fDSOInitialized ?
00277                   PROPSET_DSOINIT : PROPSET_DSO,
00278                   cPropertySets,
00279                   rgPropertySets );
00280 }
00281
00282
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/utiltest.cpp Source File

  • Dataaccess
  • rds
  • handler
  • vc

utiltest.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File:    utiltest.cpp
00004 //
00005 // Copyright: Copyright (c) 1997-1999 Microsoft Corporation
00006 //
00007 // Contents:  Small test program for class CUtil
00008 //
00009 // Comments:
00010 //
00011 //-----------------------------------------------------------------------------
00012
00013 #include <stdio.h>
00014
00015 #define dump(x)  printf("%s = \"",#x); DumpWChar(x); printf("\"\n")
00016
00017
00018 // %S does not work in printf in Win95!
00019 static void DumpWChar(WCHAR * str)
00020 {
00021   char buf[4096];
00022
00023   if (WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL))
00024     printf("%s", buf);
00025   else
00026     printf("*DumpWChar*");
00027 }
00028
00029
00030 void main(void)
00031 {
00032   CUtil util;
00033   WCHAR * conn = L"name1=value1;Data Source=CustomerDatabase;name2=value2";
00034   WCHAR * sql = L"CustomerById(2)";
00035
00036   dump(conn);
00037   dump(sql);
00038   util.SetConn(conn);
00039   printf("GetUsername=%s\n", util.GetUsername());
00040   printf("HasReadAccess=%d\n", util.HasReadAccess());
00041   printf("HasWriteAccess=%d\n", util.HasWriteAccess());
00042   util.SetSql(sql);
00043   dump(util.GetConn());
00044   dump(util.GetSql());
00045 }
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagCONFIGSETTINGSLPARAM Member List

This is the complete list of members for _tagCONFIGSETTINGSLPARAM, including all inherited members.
hr | _tagCONFIGSETTINGSLPARAM
pSettings | _tagCONFIGSETTINGSLPARAM
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Shared_Property_Manager/TServer/TServer.Idl Source File

  • Com
  • Services
  • Shared_Property_Manager
  • TServer

TServer.Idl

Go to the documentation of this file.
00001 // Filename: tServer.idl
00002 //
00003 // Description:  IDL source for tServer.dll
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (tServer.tlb) and marshalling code.
00006 //
00007 // This file is provided as part of the Microsoft Transaction Server Samples
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
00010 // WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
00011 // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00012 // OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
00013 // PURPOSE.
00014 //
00015 // Copyright (C) 1997 Microsoft Corporation, All rights reserved
00016
00017 import "oaidl.idl";
00018 import "ocidl.idl";
00019
00020   [
00021     object,
00022     uuid(CAAD7F9A-F22D-11D0-B5CB-00C04FB957D8),
00023     dual,
00024     helpstring("IComputer Interface"),
00025     pointer_default(unique)
00026   ]
00027   interface IComputer : IDispatch
00028   {
00029     HRESULT AddNewGame ([in] VARIANT_BOOL bEasy, [out] VARIANT* pvGameID, [out] VARIANT* pvOrder, [out] VARIANT* pvX, [out] VARIANT* pvY);
00030     HRESULT NewMove ([in] long lGameID, [in] VARIANT_BOOL bEasy, [in] long lX, [in] long lY, [out] VARIANT* pvMyX, [out] VARIANT* pvMyY, [out] VARIANT* pvWin);
00031   };
00032
00033   [
00034     object,
00035     uuid(CAAD7FA0-F22D-11D0-B5CB-00C04FB957D8),
00036     dual,
00037     helpstring("IHuman Interface"),
00038     pointer_default(unique)
00039   ]
00040   interface IHuman : IDispatch
00041   {
00042     HRESULT EnterNewGame ([in] BSTR bstrLocalName, [out] VARIANT* pvGameID, [out] VARIANT* pvName, [out] VARIANT* pvOrder);
00043     HRESULT NewMove ([in] long lGameID, [in] long lOrder, [in] long lX, [in] long lY, [out] VARIANT* pvWin);
00044     HRESULT GetNewMove ([in] long lGameID, [in] long lOrder, [out] VARIANT* pvName, [out] VARIANT* pvFoeX, [out] VARIANT* pvFoeY, [out] VARIANT* pvWin, [out] VARIANT* pvUpdate);
00045   };
00046
00047
00048 [
00049   uuid(CAAD7F8B-F22D-11D0-B5CB-00C04FB957D8),
00050   version(1.0),
00051   helpstring("tServer 1.0 Type Library")
00052 ]
00053 library TSERVERLib
00054 {
00055   importlib("stdole32.tlb");
00056   importlib("stdole2.tlb");
00057
00058
00059   [
00060     uuid(CAAD7F9B-F22D-11D0-B5CB-00C04FB957D8),
00061     helpstring("Computer Class")
00062   ]
00063   coclass Computer
00064   {
00065     [default] interface IComputer;
00066   };
00067
00068
00069   [
00070     uuid(CAAD7FA1-F22D-11D0-B5CB-00C04FB957D8),
00071     helpstring("Human Class")
00072   ]
00073   coclass Human
00074   {
00075     [default] interface IHuman;
00076   };
00077
00078 };
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/queue.h Source File

  • Multimedia
  • Gdi
  • PrintJob

queue.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 * PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   Queue.h
00010 *
00011 *   PURPOSE:    Data structure declaration.
00012 *
00013 *
00014 *   PUBLIC FUNCTIONS:
00015 *       AddChange () - Marks that field in the jobs as changed.
00016 *       ClearChanges () - Clears all of the fields flags.
00017 *       IsChanged () - Test for a fields state of change.
00018 *       GetColumnData () - Returns a string representation of the field
00019 *                          data for use in the ListView.
00020 *       FreeJobs () - Toss the current job list.
00021 *       SetPrinterQueueData () - Update the printer data in the data structure.
00022 *       AddJobData () - Add a new Job to the list.
00023 *       SetJobData () - Update and existing job.
00024 *       UpdateQueue () - Apply the change notification as appropriate.
00025 *
00026 *   HELPER FUNCTIONS:
00027 *       AllocQueueData () - Data structure init.
00028 *       FreeQueueData () - Data structure destroy.
00029 *       UpdateJobData () - Apply a Job change notification to the data structure.
00030 *       UpdatePrinterData () - Apply a Printer change notification to the data structure.
00031 *
00032 *   COMMENTS:
00033 *
00034 *           See the actual source file for most comments.
00035 *
00036 ******************************************************************************/
00037
00038 /*
00039  * Indices for the fields of interest
00040  * These indices correspond directly to the column position of the
00041  * data as it is shown in the derived ListView control: QueList.
00042  * They are also the index parameter to GetColumnData().
00043  */
00044 #define DOCUMENTNAME    0
00045 #define OWNERNAME       1
00046 #define STATUS          2
00047 #define SUBMITTED       3
00048 #define PROGRESS        4
00049 #define NFIELDS         5
00050
00051
00052 /*
00053  * Current state of the Printer Queue we are watching
00054  */
00055 typedef struct _Printer
00056 {
00057     LPTSTR  pszPrinterName; // The shell "friendly" name
00058     LPTSTR  pszServerName;  // The server of the printer
00059     LPTSTR  pszShareName;   // The share for the printer
00060     DWORD   dwStatus;       // Current status of the printer
00061     DWORD   cJobs;          // # of jobs currently in the printer
00062     HANDLE  hPrinter;       // An open handle to the printer
00063 } PRINTERDATA;
00064
00065 /*
00066  * Current state of a particular job in the queue.
00067  */
00068 typedef struct _Job
00069 {
00070     // members of the JOB_INFO_* structure we are interested in.
00071     // Copy them here for safekeeping between updates
00072     DWORD       JobId;
00073     LPTSTR      pszDocument;    //DOCUMENTNAME
00074     LPTSTR      pszOwner;       //OWNERNAME
00075
00076     LPTSTR      pszStatus;      //STATUS
00077     DWORD       dwStatus;
00078
00079     DWORD       PagesPrinted;   //PROGRESS
00080     DWORD       TotalPages;
00081     DWORD       Size;
00082     DWORD       BytesPrinted;
00083
00084     SYSTEMTIME  Submitted;      //SUBMITTED
00085
00086     // Keep track of what parts change on each update.
00087     // Usefull for altering only that piece of data
00088     // in the ListView control
00089     BOOL        Changed[NFIELDS];
00090 } JOBDATA;
00091
00092
00093 /*
00094  * Top of the data structure
00095  */
00096 typedef struct _Queue
00097 {
00098     PRINTERDATA Printer;
00099     DWORD       nJobs;
00100     DWORD       nAllocated;
00101     JOBDATA     *pJobs;
00102 } QUEUEDATA;
00103
00104
00105 /*
00106  * Functions for recording changes in the data structure
00107  */
00108 void AddChange(JOBDATA *pJob, WORD Change);
00109 void ClearChanges(JOBDATA *pJob);
00110 BOOL IsChanged(JOBDATA *pJob, WORD Change);
00111
00112 /*
00113  * Accessing the data by Columnal semantic meaning
00114  */
00115 char *GetColumnData(JOBDATA *pJob, unsigned short iCol);
00116
00117 /*
00118  * Basic data structure manipulation
00119  */
00120 BOOL AllocQueueData(QUEUEDATA *pQueueData, DWORD nJobs);
00121 void FreeQueueData(QUEUEDATA *pQueueData);
00122 void FreeJobs(QUEUEDATA *pQueueData);
00123 BOOL SetPrinterQueueData(QUEUEDATA *pQueueData, PRINTER_INFO_2 *pPI);
00124 BOOL AddJobData(QUEUEDATA *pQueueData, JOB_INFO_2 *pJI);
00125 BOOL SetJobData(QUEUEDATA *pQueueData, JOB_INFO_2 *pJI);
00126
00127 /*
00128  * Process Printer Notifictions.
00129  */
00130 BOOL UpdateJobData(QUEUEDATA *pQueueData, PRINTER_NOTIFY_INFO_DATA *pPNID);
00131 BOOL UpdatePrinterData(QUEUEDATA *pQueueData, PRINTER_NOTIFY_INFO_DATA *pPNID);
00132 BOOL UpdateQueue(QUEUEDATA *pQueueData, PRINTER_NOTIFY_INFO *pPNI);
00133
00134 /* end of header file Queue.h */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/OLEDoc.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

OLEDoc.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /******************************************************************************
00019
00020   File:          OleDoc.h
00021
00022   Description:   COleDocumentView definitions.
00023
00024 ******************************************************************************/
00025
00026 #ifndef OLEDOC_H
00027 #define OLEDOC_H
00028
00029 #include "DOServer.h"
00030
00031 /**************************************************************************
00032
00033   COleDocument class definition
00034
00035 **************************************************************************/
00036
00037 class COleDocumentView;
00038 class COleObject;
00039 class CDataObject;
00040 class COleInPlaceObject;
00041 class COleInPlaceActiveObject;
00042 class CPersistStorage;
00043 class CPersistFile;
00044
00045 class COleDocument : public IOleDocument
00046 {
00047   friend class COleDocumentView;
00048   friend class COleObject;
00049   friend class CDataObject;
00050   friend class COleInPlaceObject;
00051   friend class COleInPlaceActiveObject;
00052   friend class CPersistStorage;
00053
00054 private:
00055   COLORREF                m_Color;
00056   DWORD                   m_dwRegister;
00057   LPOLECLIENTSITE         m_pOleClientSite;
00058   DWORD                   m_ObjRefCount;
00059   BOOL                    m_fDirty;
00060   BOOL                    m_fNoScribbleMode;
00061   LPOLEADVISEHOLDER       m_pOleAdviseHolder;
00062   BOOL                    m_fCreated;
00063
00064   COleDocumentView        *m_pOleDocView;
00065   COleObject              *m_pOleObject;
00066   CDataObject             *m_pDataObject;
00067   COleInPlaceObject       *m_pOleInPlaceObject;
00068   COleInPlaceActiveObject *m_pOleInPlaceActiveObject;
00069   CPersistStorage         *m_pPersistStorage;
00070   CPersistFile            *m_pPersistFile;
00071
00072 public:
00073   COleDocument();
00074   ~COleDocument();
00075
00076   //IUnknown methods
00077   STDMETHODIMP QueryInterface(REFIID, LPVOID*);
00078   STDMETHODIMP_(DWORD) AddRef();
00079   STDMETHODIMP_(DWORD) Release();
00080
00081   //IOleDocument methods
00082   STDMETHODIMP CreateView(IOleInPlaceSite*, IStream*, DWORD, IOleDocumentView**);
00083   STDMETHODIMP GetDocMiscStatus(DWORD*);
00084   STDMETHODIMP EnumViews(IEnumOleDocumentViews**, IOleDocumentView**);
00085
00086   //public utility methods
00087   BOOL RegisterServer(void);
00088   BOOL CreateFile(HWND);
00089   BOOL CreateFile(LPTSTR);
00090
00091 private:
00092   STDMETHODIMP GetWindow(HWND*);
00093   STDMETHODIMP DeactivateUI();
00094   STDMETHODIMP DeactivateInPlace();
00095
00096   friend BOOL CALLBACK ColorHookProc(HWND, UINT, WPARAM, LPARAM);
00097 };
00098
00099 #endif   //OLEDOC_H
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComObj/UtilCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • ComObj

UtilCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTILCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COUtilityCar COM
00005              object class.
00006
00007              UTILCAR showcases the construction of the COUtilityCar COM
00008              object class with the IUnknown, ICar, and IUtility interfaces.
00009              This is done through Containment reuse of COCar's ICar
00010              interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the accompanying COMOBJ.TXT
00014              file.  For more specific technical details on the internal
00015              workings see the comments dispersed throughout the
00016              module's source code.
00017
00018   Classes:   COUtilityCar
00019
00020   Functions: none.
00021
00022   Origin:    10-3-97: atrent - Created. [Revised]
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will make calls to the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include COMOBJI.H because it has internal class declarations and
00048     resource ID definitions specific for this DLL.
00049   We include COMOBJ.H because it has the interface declarations.
00050   We include CAR.H because it has the class COCar declarations.
00051   We include UTILCAR.H because it has the class COUtilityCar declarations.
00052 ---------------------------------------------------------------------------*/
00053 #include <windows.h>
00054 #include <ole2.h>
00055 #include <apputil.h>
00056 #include <icars.h>
00057 #include <carguids.h>
00058 #include "comobji.h"
00059 #define _LOCALCALLS_
00060 #include "comobj.h"
00061 #include "car.h"
00062 #include "utilcar.h"
00063
00064
00065 /*---------------------------------------------------------------------------
00066   COUtilityCar's implementation of its main COM object class including
00067   Constructor, Destructor, QueryInterface, AddRef, and Release.
00068 ---------------------------------------------------------------------------*/
00069
00070 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00071   Method:   COUtilityCar::COUtilityCar
00072
00073   Summary:  COUtilityCar Constructor. Note the member initializers:
00074             "m_ImpICar(this, pUnkOuter)" and "m_ImpIUtility(this,
00075             pUnkOuter)" which are used to pass the 'this' and
00076             pUnkOuter pointers of this constructor function to the
00077             constructors that instantiate the implementations of
00078             the CImpICar and CImpIUtility interfaces (which are both
00079             nested inside this present COUtilityCar Object Class.
00080
00081   Args:     IUnknown* pUnkOuter)
00082               Pointer to the the outer Unknown.  NULL means this COM Object
00083               is not being Aggregated.  Non NULL means it is being created
00084               on behalf of an outside COM object that is reusing it via
00085               aggregation.
00086
00087   Modifies: m_cRefs, m_pUnkOuter.
00088
00089   Returns:  void
00090 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00091 COUtilityCar::COUtilityCar(
00092   IUnknown* pUnkOuter) :
00093   m_ImpICar(this, pUnkOuter),
00094   m_ImpIUtility(this, pUnkOuter)
00095 {
00096   // Zero the COM object's reference count.
00097   m_cRefs = 0;
00098
00099   // No AddRef necessary if non-NULL, as we're nested.
00100   m_pUnkOuter = pUnkOuter;
00101
00102   // Zero the pointer to the contained COCar object's ICar interface.
00103   m_pICar = NULL;
00104
00105   LOGF1("D: COUtilityCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00106
00107   return;
00108 }
00109
00110
00111 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00112   Method:   COUtilityCar::~COUtilityCar
00113
00114   Summary:  COUtilityCar Destructor.
00115
00116   Args:     void
00117
00118   Returns:  void
00119 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00120 COUtilityCar::~COUtilityCar(void)
00121 {
00122   LOG("D: COUtilityCar::Destructor.");
00123
00124   m_pICar->Release();
00125
00126   return;
00127 }
00128
00129
00130 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00131   Method:   COUtilityCar::Init
00132
00133   Summary:  COUtilityCar Initialization method.
00134
00135   Args:     void
00136
00137   Modifies: m_pUnkCar, m_pICar, m_cRefs.
00138
00139   Returns:  HRESULT
00140               Standard result code. NOERROR for success.
00141 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00142 HRESULT COUtilityCar::Init(void)
00143 {
00144   HRESULT hr;
00145
00146   LOG("D: COUtilityCar::Init.");
00147
00148   // Create an instance of the COCar object and ask for its ICar
00149   // interface directly.  We pass NULL for the pUnkOuter because we
00150   // are not aggregating.  It is here that we are reusing the COCar
00151   // COM Object through the Containment technique.  We cache the
00152   // pointer to the ICar interface for later delegation use.  We
00153   // don't need to AddRef it here because CreateCar does that for us.
00154   hr = CreateCar(NULL, IID_ICar, (PPVOID) &m_pICar);
00155
00156   return (hr);
00157 }
00158
00159
00160 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00161   Method:   COUtilityCar::QueryInterface
00162
00163   Summary:  QueryInterface of the COUtilityCar non-delegating
00164             IUnknown implementation.
00165
00166   Args:     REFIID riid,
00167               [in] GUID of the Interface being requested.
00168             PPVOID ppv)
00169               [out] Address of the caller's pointer variable that will
00170               receive the requested interface pointer.
00171
00172   Returns:  HRESULT
00173 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00174 STDMETHODIMP COUtilityCar::QueryInterface(
00175                REFIID riid,
00176                PPVOID ppv)
00177 {
00178   HRESULT hr = E_NOINTERFACE;
00179   *ppv = NULL;
00180
00181   if (IID_IUnknown == riid)
00182   {
00183     *ppv = this;
00184     LOG("D: COUtilityCar::QueryInterface. 'this' pIUnknown returned");
00185   }
00186   else if (IID_ICar == riid)
00187   {
00188     *ppv = &m_ImpICar;
00189     LOG("D: COUtilityCar::QueryInterface. pICar returned");
00190   }
00191   else if (IID_IUtility == riid)
00192   {
00193     *ppv = &m_ImpIUtility;
00194     LOG("D: COUtilityCar::QueryInterface. pIUtility returned");
00195   }
00196
00197   if (NULL != *ppv)
00198   {
00199     // We've handed out a pointer to the interface so obey the COM rules
00200     //   and AddRef the reference count.
00201     ((LPUNKNOWN)*ppv)->AddRef();
00202     hr = NOERROR;
00203   }
00204
00205   return (hr);
00206 }
00207
00208
00209 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00210   Method:   COUtilityCar::AddRef
00211
00212   Summary:  AddRef of the COUtilityCar non-delegating IUnknown implementation.
00213
00214   Args:     void
00215
00216   Modifies: m_cRefs.
00217
00218   Returns:  ULONG
00219               New value of m_cRefs (COM object's reference count).
00220 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00221 STDMETHODIMP_(ULONG) COUtilityCar::AddRef(void)
00222 {
00223   m_cRefs++;
00224
00225   LOGF1("D: COUtilityCar::AddRef. New cRefs=%i.", m_cRefs);
00226
00227   return m_cRefs;
00228 }
00229
00230
00231 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00232   Method:   COUtilityCar::Release
00233
00234   Summary:  Release of the COUtilityCar non-delegating IUnknown implementation.
00235
00236   Args:     void
00237
00238   Modifies: m_cRefs.
00239
00240   Returns:  ULONG
00241               New value of m_cRefs (COM object's reference count).
00242 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00243 STDMETHODIMP_(ULONG) COUtilityCar::Release(void)
00244 {
00245   m_cRefs--;
00246
00247   LOGF1("D: COUtilityCar::Release. New cRefs=%i.", m_cRefs);
00248
00249   if (0 == m_cRefs)
00250   {
00251     // We artificially bump the main ref count to prevent reentrancy
00252     // via the main object destructor.
00253     m_cRefs++;
00254     delete this;
00255   }
00256
00257   return m_cRefs;;
00258 }
00259
00260
00261 /*---------------------------------------------------------------------------
00262   COUtilityCar's nested implementation of the ICar interface including
00263   Constructor, Destructor, QueryInterface, AddRef, Release,
00264   Shift, Clutch, Speed, and Steer.
00265 ---------------------------------------------------------------------------*/
00266
00267 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00268   Method:   COUtilityCar::CImpICar::CImpICar
00269
00270   Summary:  Constructor for the CImpICar interface instantiation.
00271
00272   Args:     COUtilityCar* pBackObj,
00273               Back pointer to the parent outer object.
00274             IUnknown* pUnkOuter)
00275               Pointer to the outer Unknown.  For delegation.
00276
00277   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00278
00279   Returns:  void
00280 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00281 COUtilityCar::CImpICar::CImpICar(
00282   COUtilityCar* pBackObj,
00283   IUnknown* pUnkOuter)
00284 {
00285   // Init the Interface Ref Count (used for debugging only).
00286   m_cRefI=0;
00287
00288   // Init the Back Object Pointer to point to the outer object.
00289   m_pBackObj=pBackObj;
00290
00291   // Init the CImpICar interface's delegating Unknown pointer.  We use
00292   // the Back Object pointer for IUnknown delegation here if we are not
00293   // being aggregated.  If we are being aggregated we use the supplied
00294   // pUnkOuter for IUnknown delegation.  In either case the pointer
00295   // assignment requires no AddRef because the CImpICar lifetime is
00296   // quaranteed by the lifetime of the parent object in which
00297   // CImpICar is nested.
00298   if (NULL == pUnkOuter)
00299   {
00300     m_pUnkOuter = pBackObj;
00301     LOG("D: COUtilityCar::CImpICar Constructor. Non-Aggregating");
00302   }
00303   else
00304   {
00305     m_pUnkOuter = pUnkOuter;
00306     LOG("D: COUtilityCar::CImpICar Constructor. Aggregating");
00307   }
00308
00309   return;
00310 }
00311
00312
00313 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00314   Method:   COUtilityCar::CImpICar::~CImpICar
00315
00316   Summary:  Destructor for the CImpICar interface instantiation.
00317
00318   Args:     void
00319
00320   Returns:  void
00321 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00322 COUtilityCar::CImpICar::~CImpICar(void)
00323 {
00324   LOG("D: COUtilityCar::CImpICar Destructor.");
00325
00326   return;
00327 }
00328
00329
00330 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00331   Method:   COUtilityCar::CImpICar::QueryInterface
00332
00333   Summary:  The QueryInterface IUnknown member of this ICar interface
00334             implementation that delegates to m_pUnkOuter, whatever it is.
00335
00336   Args:     REFIID riid,
00337               [in] GUID of the Interface being requested.
00338             PPVOID ppv)
00339               [out] Address of the caller's pointer variable that will
00340               receive the requested interface pointer.
00341
00342   Returns:  HRESULT
00343               Returned by the delegated outer QueryInterface call.
00344 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00345 STDMETHODIMP COUtilityCar::CImpICar::QueryInterface(
00346                REFIID riid,
00347                PPVOID ppv)
00348 {
00349   LOG("D: COUtilityCar::CImpICar::QueryInterface. Delegating.");
00350
00351   // Delegate this call to the outer object's QueryInterface.
00352   return m_pUnkOuter->QueryInterface(riid, ppv);
00353 }
00354
00355
00356 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00357   Method:   COUtilityCar::CImpICar::AddRef
00358
00359   Summary:  The AddRef IUnknown member of this ICar interface
00360             implementation that delegates to m_pUnkOuter, whatever it is.
00361
00362   Args:     void
00363
00364   Modifies: m_cRefI.
00365
00366   Returns:  ULONG
00367               Returned by the delegated outer AddRef call.
00368 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00369 STDMETHODIMP_(ULONG) COUtilityCar::CImpICar::AddRef(void)
00370 {
00371   // Increment the Interface Reference Count.
00372   ++m_cRefI;
00373
00374   LOGF1("D: COUtilityCar::CImpICar::Addref. Delegating. New cI=%i.", m_cRefI);
00375
00376   // Delegate this call to the outer object's AddRef.
00377   return m_pUnkOuter->AddRef();
00378 }
00379
00380
00381 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00382   Method:   COUtilityCar::CImpICar::Release
00383
00384   Summary:  The Release IUnknown member of this ICar interface
00385             implementation that delegates to m_pUnkOuter, whatever it is.
00386
00387   Args:     void
00388
00389   Returns:  ULONG
00390               Returned by the delegated outer Release call.
00391 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00392 STDMETHODIMP_(ULONG) COUtilityCar::CImpICar::Release(void)
00393 {
00394   // Decrement the Interface Reference Count.
00395   --m_cRefI;
00396
00397   LOGF1("D: COUtilityCar::CImpICar::Release. Delegating. New cI=%i.", m_cRefI);
00398
00399   // Delegate this call to the outer object's Release.
00400   return m_pUnkOuter->Release();
00401 }
00402
00403
00404 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00405   Method:   COUtilityCar::CImpICar::Shift
00406
00407   Summary:  The Shift member method of this ICar interface implementation.
00408             A simple empty method on a COUtilityCar COM object for tutorial
00409             purposes.  Presumably if this Car object were modeling
00410             a real Car then the Shift method would shift to the specified
00411             gear.
00412
00413   Args:     short nGear
00414               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00415
00416   Returns:  HRESULT
00417               NOERROR
00418 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00419 STDMETHODIMP COUtilityCar::CImpICar::Shift(
00420                short nGear)
00421 {
00422   LOGF1("D: COUtilityCar::CImpICar::Shift. Delegating. nGear=%i.",nGear);
00423
00424   m_pBackObj->m_pICar->Shift(nGear);
00425
00426   return NOERROR;
00427 }
00428
00429
00430 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00431   Method:   COUtilityCar::CImpICar::Clutch
00432
00433   Summary:  The Clutch member method of this ICar interface implementation.
00434             A simple empty method on a COUtilityCar COM object for tutorial
00435             purposes.  Presumably if this Car object were modeling
00436             a real Car then the Clutch method would engage the clutch the
00437             specified amount.
00438
00439   Args:     short nEngaged)
00440               Percent clutch is engaged (0 to 100%).
00441
00442   Returns:  HRESULT
00443               NOERROR
00444 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00445 STDMETHODIMP COUtilityCar::CImpICar::Clutch(
00446                short nEngaged)
00447 {
00448   LOGF1("D: COUtilityCar::CImpICar::Clutch. Delegating. nEngaged=%i.",nEngaged);
00449
00450   m_pBackObj->m_pICar->Clutch(nEngaged);
00451
00452   return NOERROR;
00453 }
00454
00455
00456 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00457   Method:   COUtilityCar::CImpICar::Speed
00458
00459   Summary:  The Propel member method of this ICar interface implementation.
00460             A simple empty method on a COUtilityCar COM object for tutorial
00461             purposes.  Presumably if this Car object were modeling
00462             a real Car then this method would accelerate/brake to bring
00463             the car to the specified speed.
00464
00465   Args:     short nMph
00466               New speed in miles per hour.
00467
00468   Returns:  HRESULT
00469               NOERROR
00470 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00471 STDMETHODIMP COUtilityCar::CImpICar::Speed(
00472                short nMph)
00473 {
00474   LOGF1("D: COUtilityCar::CImpICar::Speed. Delegating. nMph=%i.",nMph);
00475
00476   m_pBackObj->m_pICar->Speed(nMph);
00477
00478   return NOERROR;
00479 }
00480
00481
00482 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00483   Method:   COUtilityCar::CImpICar::Steer
00484
00485   Summary:  The Steer member method of this ICar interface implementation.
00486             A simple empty method on a COUtilityCar COM object for tutorial
00487             purposes.  Presumably if this Car object were modeling
00488             a real Car then the Steer method would set the steering
00489             angle of the Car.
00490
00491   Args:     short nAngle)
00492               0 degrees straight ahead, -45 Full left, +45 Full right.
00493
00494   Returns:  HRESULT
00495               NOERROR
00496 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00497 STDMETHODIMP COUtilityCar::CImpICar::Steer(
00498                short nAngle)
00499 {
00500  LOGF1("D: COUtilityCar::CImpICar::Steer. Delegating. nAngle=%i.",nAngle);
00501
00502   m_pBackObj->m_pICar->Steer(nAngle);
00503
00504   return NOERROR;
00505 }
00506
00507
00508 /*---------------------------------------------------------------------------
00509   COUtilityCar's nested implementation of the IUtility interface including
00510   Constructor, Destructor, QueryInterface, AddRef, Release,
00511   Offroad, and Winch.
00512 ---------------------------------------------------------------------------*/
00513
00514 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00515   Method:   COUtilityCar::CImpIUtility::CImpIUtility
00516
00517   Summary:  Constructor for the CImpIUtility interface instantiation.
00518
00519   Args:     COUtilityCar* pBackObj,
00520               Back pointer to the parent outer object.
00521             IUnknown* pUnkOuter)
00522               Pointer to the outer Unknown.  For delegation.
00523
00524   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00525
00526   Returns:  void
00527 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00528 COUtilityCar::CImpIUtility::CImpIUtility(
00529   COUtilityCar* pBackObj,
00530   IUnknown* pUnkOuter)
00531 {
00532   // Init the Interface Ref Count (used for debugging only).
00533   m_cRefI = 0;
00534
00535   // Init the Back Object Pointer to point to the outer object.
00536   m_pBackObj = pBackObj;
00537
00538   // Init the CImpIUtility interface's delegating Unknown pointer.  We use
00539   // the Back Object pointer for IUnknown delegation here if we are not
00540   // being aggregated.  If we are being aggregated we use the supplied
00541   // pUnkOuter for IUnknown delegation.  In either case the pointer
00542   // assignment requires no AddRef because the CImpIUtility lifetime is
00543   // quaranteed by the lifetime of the parent object in which
00544   // CImpIUtility is nested.
00545   if (NULL == pUnkOuter)
00546   {
00547     m_pUnkOuter = pBackObj;
00548     LOG("D: COUtilityCar::CImpIUtility Constructor. Non-Aggregating.");
00549   }
00550   else
00551   {
00552     m_pUnkOuter = pUnkOuter;
00553     LOG("D: COUtilityCar::CImpIUtility Constructor. Aggregating.");
00554   }
00555
00556   return;
00557 }
00558
00559
00560 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00561   Method:   COUtilityCar::CImpIUtility::~CImpIUtility
00562
00563   Summary:  Destructor for the CImpIUtility interface instantiation.
00564
00565   Args:     void
00566
00567   Returns:  void
00568 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00569 COUtilityCar::CImpIUtility::~CImpIUtility(void)
00570 {
00571   LOG("D: COUtilityCar::CImpIUtility Destructor.");
00572
00573   return;
00574 }
00575
00576
00577 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00578   Method:   COUtilityCar::CImpIUtility::QueryInterface
00579
00580   Summary:  The QueryInterface IUnknown member of this IUtility interface
00581             implementation that delegates to m_pUnkOuter, whatever it is.
00582
00583   Args:     REFIID riid,
00584               [in] GUID of the Interface being requested.
00585             PPVOID ppv)
00586               [out] Address of the caller's pointer variable that will
00587               receive the requested interface pointer.
00588
00589   Returns:  HRESULT
00590               Returned by the delegated outer QueryInterface call.
00591 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00592 STDMETHODIMP COUtilityCar::CImpIUtility::QueryInterface(
00593                REFIID riid,
00594                PPVOID ppv)
00595 {
00596   LOG("D: COUtilityCar::CImpIUtility::QueryInterface. Delegating.");
00597
00598   // Delegate this call to the outer object's QueryInterface.
00599   return m_pUnkOuter->QueryInterface(riid, ppv);
00600 }
00601
00602
00603 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00604   Method:   COUtilityCar::CImpIUtility::AddRef
00605
00606   Summary:  The AddRef IUnknown member of this IUtility interface
00607             implementation that delegates to m_pUnkOuter, whatever it is.
00608
00609   Args:     void
00610
00611   Modifies: m_cRefI.
00612
00613   Returns:  ULONG
00614               Returned by the delegated outer AddRef call.
00615 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00616 STDMETHODIMP_(ULONG) COUtilityCar::CImpIUtility::AddRef(void)
00617 {
00618   // Increment the Interface Reference Count.
00619   ++m_cRefI;
00620
00621   LOGF1("D: COUtilityCar::CImpIUtility::Addref. Delegating. New cI=%i.", m_cRefI);
00622
00623   // Delegate this call to the outer object's AddRef.
00624   return m_pUnkOuter->AddRef();
00625 }
00626
00627
00628 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00629   Method:   COUtilityCar::CImpIUtility::Release
00630
00631   Summary:  The Release IUnknown member of this IUtility interface
00632             implementation that delegates to m_pUnkOuter, whatever it is.
00633
00634   Args:     void
00635
00636   Returns:  ULONG
00637               Returned by the delegated outer Release call.
00638 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00639 STDMETHODIMP_(ULONG) COUtilityCar::CImpIUtility::Release(void)
00640 {
00641   // Decrement the Interface Reference Count.
00642   --m_cRefI;
00643
00644   LOGF1("D: COUtilityCar::CImpIUtility::Release. Delegating. New cI=%i.", m_cRefI);
00645
00646   // Delegate this call to the outer object's Release.
00647   return m_pUnkOuter->Release();
00648 }
00649
00650
00651 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00652   Method:   COUtilityCar::CImpIUtility::Offroad
00653
00654   Summary:  The Offroad member method of this IUtility interface
00655             implementation.  A simple empty method on a COUtilityCar
00656             COM object for tutorial purposes.  Presumably if this
00657             UtilityCar object were modeling a real Car then the Offroad
00658             method would function the 4-wheel drive transfer case and
00659             shift it to the specified 4-wheel drive mode.
00660
00661   Args:     short nGear
00662               0 = 2H or regular 2-wheel drive;
00663               1 = 4H or 4-wheel drive high speed;
00664               2 = neutral; and
00665               3 = 4L or 4-wheel drive low speed).
00666
00667   Returns:  HRESULT
00668               NOERROR
00669 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00670 STDMETHODIMP COUtilityCar::CImpIUtility::Offroad(
00671                short nGear)
00672 {
00673   LOGF1("D: COUtilityCar::CImpIUtility::Offroad. Called. nGear=%i.",nGear);
00674
00675   return NOERROR;
00676 }
00677
00678
00679 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00680   Method:   COUtilityCar::CImpIUtility::Winch
00681
00682   Summary:  The Winch member method of this IUtility interface
00683             implementation.  A simple empty method on a COUtilityCar COM
00684             object for tutorial purposes.  Presumably if this UtilityCar
00685             object were modeling a real Car then the Winch method would
00686             turn on/off the front-mounted Winch to the specified RPMs.
00687
00688   Args:     short nRpm
00689               0 = off; 1 - 50 RPM.
00690
00691   Returns:  HRESULT
00692               NOERROR
00693 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00694 STDMETHODIMP COUtilityCar::CImpIUtility::Winch(
00695                short nRpm)
00696 {
00697   LOGF1("D: COUtilityCar::CImpIUtility::Winch. Called. nRpm=%i.",nRpm);
00698
00699   return NOERROR;
00700 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/baseobj.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

baseobj.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module BASEOBJ.CPP | Base Object for CCommand and CRowset implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012
00013 #include "headers.h"
00014
00015 // Code ----------------------------------------------------------------------
00016
00017 // CBaseObj::CBaseObj----------------------------------------------------------
00018 //
00019 // @mfunc Constructor for this class
00020 //
00021 // @rdesc NONE
00022 //
00023 CBaseObj::CBaseObj
00024   (
00025   EBaseObjectType   botVal      // @parm IN | Base Object Type
00026   )
00027 {
00028   m_BaseObjectType = botVal;
00029 }
00030
00031
00032 //-----------------------------------------------------------------------------
00033 // CBaseObj::~CBaseObj
00034 //
00035 // @mfunc Destructor for this class
00036 //
00037 // @rdesc NONE
00038 //
00039 CBaseObj::~CBaseObj()
00040 {
00041 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/MTXSample/BankVC.cpp Source File

  • Web
  • iis
  • Components
  • Cpp
  • MTXSample

BankVC.cpp

Go to the documentation of this file.
00001 // BankVC.cpp : Implementation of DLL Exports.
00002
00003
00004 // Note: Proxy/Stub Information
00005 //      To build a separate proxy/stub DLL,
00006 //      run nmake -f BankVCps.mk in the project directory.
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 #include <initguid.h>
00011 #include "BankVC.h"
00012
00013 #include "BankVC_i.c"
00014 #include "Account.h"
00015 #include "CreateTable.h"
00016 #include "MoveMoney.h"
00017
00018 CComModule _Module;
00019
00020 BEGIN_OBJECT_MAP(ObjectMap)
00021   OBJECT_ENTRY(CLSID_Account, CAccount)
00022   OBJECT_ENTRY(CLSID_CreateTable, CCreateTable)
00023   OBJECT_ENTRY(CLSID_MoveMoney, CMoveMoney)
00024 END_OBJECT_MAP()
00025
00026 // DLL Entry Point
00027
00028 extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00029 {
00030   if (dwReason == DLL_PROCESS_ATTACH)
00031   {
00032     _Module.Init(ObjectMap, hInstance, &LIBID_BANKVCLib);
00033
00034     DisableThreadLibraryCalls(hInstance);
00035   }
00036   else if (dwReason == DLL_PROCESS_DETACH)
00037   {
00038     _Module.Term();
00039   }
00040
00041   return TRUE;
00042 }
00043
00044 // Used to determine whether the DLL can be unloaded
00045
00046 STDAPI DllCanUnloadNow(void)
00047 {
00048   return (_Module.GetLockCount() == 0) ? S_OK : S_FALSE;
00049 }
00050
00051 // Returns a class factory to create an object of the requested type
00052
00053 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
00054 {
00055   return _Module.GetClassObject(rclsid, riid, ppv);
00056 }
00057
00058 // DllRegisterServer - Adds entries to the system registry
00059
00060 STDAPI DllRegisterServer(void)
00061 {
00062   // registers object, typelib and all interfaces in typelib
00063
00064   return _Module.RegisterServer(TRUE);
00065 }
00066
00067 // DllUnregisterServer - Removes entries from the system registry
00068
00069 STDAPI DllUnregisterServer(void)
00070 {
00071   return _Module.UnregisterServer(TRUE);
00072 }
00073
00074
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/UpCase/UpCase.c Source File

  • Web
  • iis
  • filters
  • UpCase

UpCase.c

Go to the documentation of this file.
00001 /* Copyright (c) 1995-2002  Microsoft Corporation
00002
00003 Module Name:
00004
00005 upcase.c
00006
00007 Abstract:
00008
00009 This filter converts HTML response data to upper case if requested
00010 by the client. The request is made by specifying an extra
00011 subdirectory in the URL, which doesnt actually exist on the server,
00012 but is used by the filter to indicate that upper case is desired.
00013 The extra subdirectory is removed from the request before the HTTP
00014 server sees the request.
00015
00016 When a request is received, the filter inspects the
00017 subdirectories specified in the URL. If a subdirectory is 'UC'
00018 or 'uc', the subdirectory is removed from the request, and the
00019 filter saves in its pFilterContext field, a value indicating that
00020 the response data should be converted to upper case.
00021
00022 When the filter entrypoint is later called for the response, it
00023 checks the pFilterContext field and converts the data if
00024 the mime-type of the response indicates that its an html file.
00025 This avoids conversions on binary data.
00026
00027 An example URL entered by a user might be:
00028
00029 http://www.example.com/sales/uc/projections.htm
00030
00031 While the functionality of this filter is somewhat contrived, this
00032 filter does a good job of demonstrating the following features of
00033 filters:
00034 - parsing/modifying HTTP headers (in the request)
00035 - modifying data following HTTP headers (in the response)
00036 - saving state to be used by the filter later
00037 - adding request/response level functionality to the server
00038 (instead of using a mechanism like this to convert to
00039 uppercase, you may use it to do on-the-fly customized
00040 translations of HTML pages (English -> French perhaps?)
00041 */
00042
00043 #include <windows.h>
00044 #include <stdio.h>
00045 #include <stdlib.h>
00046 #include <httpfilt.h>
00047
00048 BOOL WINAPI __stdcall GetFilterVersion(HTTP_FILTER_VERSION *pVer)
00049 {
00050   /* Specify the types and order of notification */
00051
00052   pVer->dwFlags = (SF_NOTIFY_NONSECURE_PORT | SF_NOTIFY_URL_MAP | SF_NOTIFY_SEND_RAW_DATA | SF_NOTIFY_ORDER_DEFAULT);
00053
00054   pVer->dwFilterVersion = HTTP_FILTER_REVISION;
00055
00056   strcpy(pVer->lpszFilterDesc, "Upper case conversion filter, Version 1.0");
00057
00058   return TRUE;
00059 }
00060
00061 DWORD WINAPI __stdcall HttpFilterProc(HTTP_FILTER_CONTEXT *pfc, DWORD NotificationType, VOID *pvData)
00062 {
00063   CHAR *pchIn, *pPhysPath;
00064   DWORD cbBuffer, cbtemp;
00065   PHTTP_FILTER_URL_MAP pURLMap;
00066   PHTTP_FILTER_RAW_DATA pRawData;
00067
00068   switch (NotificationType) {
00069
00070     case SF_NOTIFY_URL_MAP :
00071
00072       /* Check the URL for a subdirectory in the form of /UC/ or /uc/ */
00073
00074       pURLMap = (PHTTP_FILTER_URL_MAP)pvData;
00075
00076       pPhysPath = pURLMap->pszPhysicalPath;
00077
00078       pfc->pFilterContext = 0;
00079
00080       for ( ; *pPhysPath; pPhysPath++)
00081       {
00082         /* Ensure that there are at least 4 characters (checking for "\UC\") left in the URL before checking */
00083
00084         if (strlen(pPhysPath) > 3)
00085         {
00086           if (*pPhysPath == '\\' && (*(pPhysPath + 1) == 'u' || *(pPhysPath + 1) == 'U') && (*(pPhysPath + 2) == 'c' || *(pPhysPath + 2) == 'C') && *(pPhysPath + 3) == '\\')
00087           {
00088             /* Now that we've found it, remove it by collapsing everything down */
00089
00090             for ( ; *(pPhysPath + 3) ; pPhysPath++)
00091               *pPhysPath = *(pPhysPath + 3);
00092
00093             /* NULL terminate the string */
00094
00095             *pPhysPath = '\0';
00096
00097             /* And set the flag to let the SF_NOTIFY_SEND_RAW_DATA handler know to uppercase the content */
00098
00099             pfc->pFilterContext = (VOID *)1;
00100
00101             /* Break us out of the loop - note that this will only find the first instance of /UC/ in the URL */
00102
00103             break;
00104           }
00105         }
00106       }
00107
00108       break;
00109
00110     case SF_NOTIFY_SEND_RAW_DATA :
00111
00112       if (pfc->pFilterContext)
00113       {
00114         pRawData = (PHTTP_FILTER_RAW_DATA)pvData;
00115
00116         pchIn = (BYTE *)pRawData->pvInData;
00117
00118         cbBuffer = 0;
00119
00120         if (pfc->pFilterContext == (VOID *)1)
00121         {
00122           /*
00123           As this is the first block, scan through it until 2 CRLFs are seen, to pass
00124           all of the headers.
00125           */
00126
00127           for ( ; cbBuffer < pRawData->cbInData - 2; cbBuffer++)
00128           {
00129             if (pchIn[cbBuffer] == '\n' && pchIn[cbBuffer + 2]  == '\n')
00130             {
00131               cbBuffer += 3;
00132
00133               break;
00134             }
00135
00136             cbBuffer++;
00137           }
00138
00139           for (cbtemp = 0; cbtemp < (cbBuffer - 3); cbtemp++)
00140           {
00141             if (pchIn[cbtemp] == '/' && pchIn[cbtemp + 1] == 'h' && pchIn[cbtemp + 2] == 't' && pchIn[cbtemp + 3] == 'm')
00142             {
00143               pfc->pFilterContext = (VOID *)2;
00144
00145               break;
00146             }
00147           }
00148
00149           if (cbtemp == cbBuffer)
00150             pfc->pFilterContext = 0; /* not an  html file */
00151         }
00152
00153         /* Now uppercase everything */
00154
00155         if (pfc->pFilterContext)
00156           for ( ; cbBuffer < pRawData->cbInData; cbBuffer++)
00157             pchIn[cbBuffer] = (pchIn[cbBuffer] >= 'a' && pchIn[cbBuffer] <= 'z') ? (pchIn[cbBuffer] - 'a' + 'A') : pchIn[cbBuffer];
00158       }
00159
00160       break;
00161
00162     default :
00163
00164       break;
00165   }
00166
00167   return SF_STATUS_REQ_NEXT_NOTIFICATION;
00168 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/WinHlprs/cDialog.h Source File

  • Com
  • Fundamentals
  • WinHlprs

cDialog.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright Microsoft Corporation.
00005 //
00006 //  File:       cdialog.h
00007 //
00008 //  Contents:   definition for common dialog functionality
00009 //
00010 //  Classes:    CHlprDialog (pure virtual class)
00011 //
00012 //  Functions:  DialogProc
00013 //
00014 //  History:    4-12-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #ifndef __CDIALOG_H__
00019 #define __CDIALOG_H__
00020
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024
00025 BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
00026
00027 #ifdef __cplusplus
00028 }
00029
00030 //+---------------------------------------------------------------------------
00031 //
00032 //  Class:      CHlprDialog
00033 //
00034 //  Purpose:    virtual base class for wrapping Windows' dialog functionality
00035 //
00036 //  Interface:  ShowDialog -- analagous to the Windows DialogBox function
00037 //              DialogProc -- pure virtual DialogProc for the dialog box
00038 //              ~CHlprDialog   -- destructor
00039 //
00040 //  History:    4-12-94   stevebl   Created
00041 //
00042 //  Notes:      This class allows a dialog box to be cleanly wrapped in
00043 //              a c++ class.  Specifically, it provides a way for a c++ class
00044 //              to use one of its methods as a DialogProc, giving it a "this"
00045 //              pointer and allowing it to have direct access to all of its
00046 //              private members.
00047 //
00048 //----------------------------------------------------------------------------
00049
00050 class CHlprDialog
00051 {
00052 public:
00053     virtual int ShowDialog(HINSTANCE hinst, LPCTSTR lpszTemplate, HWND hwndOwner);
00054     virtual BOOL DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
00055     virtual ~CHlprDialog(){};
00056 protected:
00057     HINSTANCE _hInstance;
00058 };
00059
00060 #endif //__cplusplus
00061
00062 #endif //__CDIALOG_H__
00063
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CThumbNailPhotoHolder Member List

This is the complete list of members for CThumbNailPhotoHolder, including all inherited members.
_Clear() | CThumbNailPhotoHolder | [inline, private]
_Clear() | CThumbNailPhotoHolder | [inline, private]
_DisplayPicture(LPCWSTR lpszPath) | CThumbNailPhotoHolder | [private]
_DisplayPicture(LPCWSTR lpszPath) | CThumbNailPhotoHolder | [private]
_SetPictureControl(HBITMAP hBitmap) | CThumbNailPhotoHolder | [inline, private]
_SetPictureControl(HBITMAP hBitmap) | CThumbNailPhotoHolder | [inline, private]
_WriteHelper(HRESULT hr) | CThumbNailPhotoHolder | [private]
_WriteHelper(HRESULT hr) | CThumbNailPhotoHolder | [private]
Change(HWND hWndOwner) | CThumbNailPhotoHolder |
Change(HWND hWndOwner) | CThumbNailPhotoHolder |
Clear() | CThumbNailPhotoHolder |
Clear() | CThumbNailPhotoHolder |
CThumbNailPhotoHolder() | CThumbNailPhotoHolder | [inline]
CThumbNailPhotoHolder() | CThumbNailPhotoHolder | [inline]
Initialize(HWND hWndFileNameEdit, HWND hWndPictureControl) | CThumbNailPhotoHolder | [inline]
Initialize(HWND hWndFileNameEdit, HWND hWndPictureControl) | CThumbNailPhotoHolder | [inline]
m_dwPictureSize | CThumbNailPhotoHolder | [private]
m_hWndFileNameEdit | CThumbNailPhotoHolder | [private]
m_hWndPictureControl | CThumbNailPhotoHolder | [private]
m_pPictureArray | CThumbNailPhotoHolder | [private]
Read(IADs *pIADs) | CThumbNailPhotoHolder |
Read(IDirectoryObject *pDirObj) | CThumbNailPhotoHolder |
Read(IADs *pIADs) | CThumbNailPhotoHolder |
Read(IDirectoryObject *pDirObj) | CThumbNailPhotoHolder |
Write(IADs *pIADs) | CThumbNailPhotoHolder |
Write(IDirectoryObject *pDirObj) | CThumbNailPhotoHolder |
Write(IADs *pIADs) | CThumbNailPhotoHolder |
Write(IDirectoryObject *pDirObj) | CThumbNailPhotoHolder |
~CThumbNailPhotoHolder() | CThumbNailPhotoHolder | [inline]
~CThumbNailPhotoHolder() | CThumbNailPhotoHolder | [inline]
Generated on Wed Nov 13 2024 16:57:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/cMgr.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

cMgr.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CMGR.CPP
00004 //  Content:    Conference Manager Routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016 #include <atlbase.h>
00017
00018 // There should be only one conference manager
00019 INmManager * g_pMgr  = NULL;
00020
00021 CMgrNotify * g_pMgrNotify = NULL;
00022
00023
00024 // {D29A8C50-774F-11d0-8B1D-00A0C91BC90E}
00025 const GUID g_guid =
00026 { 0xd29a8c51, 0x774f, 0x11d0, { 0x8b, 0x1d, 0x0, 0xa0, 0xc9, 0x1b, 0xc9, 0xe} };
00027
00028 const GUID g_guidNMUIChat =
00029 // {9F7F48B5-4A97-11d3-A12D-00C04F79C1D9}
00030 { 0x9f7f48b5, 0x4a97, 0x11d3, { 0xa1, 0x2d, 0x0, 0xc0, 0x4f, 0x79, 0xc1, 0xd9 } };
00031
00032 HRESULT InitializeNm(void)
00033 {
00034   HRESULT hr      = NO_ERROR;
00035   ULONG uchCaps   = 0;
00036   ULONG uOptions  = (ULONG) gPref.iInit;
00037
00038   hr = g_pMgr->Initialize(&uOptions, &uchCaps);
00039   TRACE_MSG(TEXT("CConfMgr result=%s uOptions=%08X"), GetHrSz(hr), uOptions);
00040
00041   return hr;
00042 }
00043
00044
00045 //****************************************************************************
00046 //
00047 // HRESULT InitConfMgr(void)
00048 //
00049 //****************************************************************************
00050
00051 HRESULT InitConfMgr(void)
00052 {
00053   HRESULT     hr  = NO_ERROR;
00054   LPCLASSFACTORY  pcf = NULL;
00055
00056     // Notify the system we want to use the conferencing services
00057     // by creating a conference manager object
00058     hr = CoGetClassObject(CLSID_NmManager,
00059                           CLSCTX_INPROC,
00060                           NULL,
00061                           IID_IClassFactory,
00062                           (void**)&pcf);
00063     if (FAILED(hr))
00064     {
00065       ERROR_MSG(TEXT("CoGetClassObject Failed (%s)"), GetHrSz(hr));
00066     }
00067   else if (NULL == pcf)
00068   {
00069     ERROR_MSG(TEXT("CoGetClassObject Succeeded but returned a Null Ptr"));
00070     hr  = E_POINTER;
00071   }
00072     else
00073     {
00074         // Get the conference manager object
00075         hr = pcf->CreateInstance(NULL, IID_INmManager, (void**)&g_pMgr);
00076         if (FAILED(hr))
00077         {
00078         ERROR_MSG(TEXT("CreateInstance Failed (%s)"), GetHrSz(hr));
00079         }
00080         else if (NULL == g_pMgr)
00081     {
00082       ERROR_MSG(TEXT("CreateInstance Succeeded but returned a Null Ptr"));
00083       hr  = E_POINTER;
00084     }
00085     else
00086         {
00087             // Connect to the conference manager object
00088             g_pMgrNotify = new CMgrNotify();
00089             if (g_pMgrNotify == NULL)
00090             {
00091                 hr = E_OUTOFMEMORY;
00092           ERROR_MSG(TEXT("CConfMgrNotify: out of memory!"));
00093             }
00094             else
00095             {
00096                 hr = g_pMgrNotify->Connect(g_pMgr);
00097                 if (FAILED(hr))
00098                 {
00099             ERROR_MSG(TEXT("CConfMgrNotify Failed (%s)"), GetHrSz(hr));
00100                     g_pMgrNotify->Release();
00101                     g_pMgrNotify = NULL;
00102                 }
00103                 else
00104                 {
00105           DumpSysInfo();
00106                   hr = InitializeNm();
00107                   DumpLaunchInfo();
00108         }
00109             }
00110         }
00111
00112         pcf->Release();
00113     }
00114
00115   if  FAILED(hr)
00116   {
00117     FreeConfMgr();
00118   }
00119
00120   return hr;
00121 }
00122
00123 //****************************************************************************
00124 //
00125 // VOID FreeConfMgr(void)
00126 //
00127 //****************************************************************************
00128
00129 VOID FreeConfMgr(void)
00130 {
00131   // Release conference manager notify
00132   if (NULL != g_pMgrNotify)
00133   {
00134     OBJECT_MSG(TEXT("Freeing g_pMgrNotify"));
00135     g_pMgrNotify->Disconnect();
00136     g_pMgrNotify->Release();
00137     g_pMgrNotify = NULL;
00138   }
00139
00140   // Release conference manager
00141   if (NULL != g_pMgr)
00142   {
00143     OBJECT_MSG(TEXT("Freeing g_pMgr"));
00144     g_pMgr->Release();
00145     g_pMgr = NULL;
00146   }
00147 }
00148
00149 //****************************************************************************
00150 //
00151 // CLASS CMgrNotify
00152 //
00153 //****************************************************************************
00154
00155 CMgrNotify::CMgrNotify() : RefCount(), CNotify()
00156 {
00157   OBJECT_MSG(TEXT("CMgrNotify created"));
00158 }
00159
00160 CMgrNotify::~CMgrNotify()
00161 {
00162   OBJECT_MSG(TEXT("CMgrNotify destroyed"));
00163 }
00164
00165
00166 //****************************************************************************
00167 //
00168 // Methods from IUnknown
00169 //
00170 //****************************************************************************
00171
00172 ULONG STDMETHODCALLTYPE CMgrNotify::AddRef(void)
00173 {
00174   return RefCount::AddRef();
00175 }
00176
00177
00178 ULONG STDMETHODCALLTYPE CMgrNotify::Release(void)
00179 {
00180   return RefCount::Release();
00181 }
00182
00183 HRESULT STDMETHODCALLTYPE CMgrNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00184 {
00185   if  (NULL == ppvObject)
00186     return E_POINTER;
00187
00188   HRESULT hr = S_OK;
00189
00190   if (riid == IID_IUnknown)
00191   {
00192     *ppvObject = (IUnknown *)this;
00193     OBJECT_MSG(TEXT("CMgrNotify::QueryInterface(): Returning IUnknown."));
00194   }
00195   else if (riid == IID_INmManagerNotify)
00196   {
00197     *ppvObject = (INmManagerNotify *)this;
00198     OBJECT_MSG(TEXT("CMgrNotify::QueryInterface(): Returning INmManagerNotify."));
00199   }
00200   else
00201   {
00202     hr = E_NOINTERFACE;
00203     *ppvObject = NULL;
00204     OBJECT_MSG(TEXT("CMgrNotify::QueryInterface(): Called on unknown interface."));
00205   }
00206
00207   if SUCCEEDED(hr)
00208   {
00209     AddRef();
00210   }
00211
00212   return hr;
00213 }
00214
00215
00216
00217 //****************************************************************************
00218 //
00219 // Methods from ICNotify
00220 //
00221 //****************************************************************************
00222
00223 HRESULT STDMETHODCALLTYPE CMgrNotify::Connect(IUnknown *pUnk)
00224 {
00225   return CNotify::Connect(pUnk, IID_INmManagerNotify, (IUnknown *)this);
00226 }
00227
00228 HRESULT STDMETHODCALLTYPE CMgrNotify::Disconnect(void)
00229 {
00230   return CNotify::Disconnect();
00231 }
00232
00233
00234 //****************************************************************************
00235 //
00236 // Methods from INmManagerNotify
00237 //
00238 //****************************************************************************
00239
00240 HRESULT STDMETHODCALLTYPE CMgrNotify::NmUI(CONFN confn)
00241 {
00242   NOTIFY_MSG(TEXT("CMgrNotify::NmUI"));
00243   TRACE_MSG(TEXT("CONFN=%s"), GetConfnSz(confn));
00244   return S_OK;
00245 }
00246
00247 HRESULT STDMETHODCALLTYPE CMgrNotify::CallCreated(INmCall *pCall)
00248 {
00249   if  (NULL == pCall)
00250   {
00251     ERROR_MSG(TEXT("CMgrNotify::CallCreated: NULL == pCall"));
00252     return E_POINTER;
00253   }
00254
00255   BYTE  * ppb = NULL;
00256   ULONG   pcb = 0;
00257
00258   const GUID guid = { 0x068b0780, 0x718c, 0x11d0,{ 0x8b, 0x1a, 0x0, 0xa0, 0xc9, 0x1b, 0xc9, 0x0e}};
00259
00260   NOTIFY_MSG(TEXT("CMgrNotify::CallCreated"));
00261
00262   pCall->GetUserData(GUID_NULL, (BYTE**) &ppb, &pcb);
00263
00264   DumpCallInfo(pCall);
00265   HookCall(pCall);
00266
00267   return S_OK;
00268 }
00269
00270 HRESULT STDMETHODCALLTYPE CMgrNotify::ConferenceCreated(INmConference *pConference)
00271 {
00272   if  (NULL == pConference)
00273   {
00274     ERROR_MSG(TEXT("CMgrNotify::ConferenceCreated: Null == pConference"));
00275     return E_POINTER;
00276   }
00277
00278   NOTIFY_MSG(TEXT("CMgrNotify::ConferenceCreated"));
00279
00280   DumpConferenceInfo(pConference);
00281   HookConference(pConference);
00282
00283   return S_OK;
00284 }
00285
00286
00287 DWSTR _rgSysInfo[] = {
00288   {NM_SYSPROP_EMAIL_NAME,    TEXT("Email     ")},
00289   {NM_SYSPROP_SERVER_NAME,   TEXT("Server    ")},
00290   {NM_SYSPROP_RESOLVE_NAME,  TEXT("Resolve   ")},
00291   {NM_SYSPROP_FIRST_NAME,    TEXT("First Name")},
00292   {NM_SYSPROP_LAST_NAME,     TEXT("Last Name ")},
00293   {NM_SYSPROP_USER_NAME,     TEXT("Name      ")},
00294   {NM_SYSPROP_USER_CITY,     TEXT("City      ")},
00295   {NM_SYSPROP_USER_COUNTRY,  TEXT("Country   ")},
00296   {NM_SYSPROP_USER_COMMENTS, TEXT("Comments  ")},
00297   {NM_SYSPROP_USER_CATEGORY, TEXT("Category  ")},
00298   {NM_SYSPROP_INSTALL_DIRECTORY, TEXT("Directory ")},
00299   {NM_SYSPROP_APP_NAME,      TEXT("App Name  ")},
00300   {NM_SYSPROP_IS_RUNNING,    TEXT("Is Running")},
00301   {NM_SYSPROP_IN_CONFERENCE, TEXT("In Conference")},
00302   {NM_SYSPROP_H323_GATEWAY,  TEXT("H323 Gateway ")},
00303   {NM_SYSPROP_H323_GATEWAY_ENABLE, TEXT("H323 Enable  ")},
00304   {NM_SYSPROP_LOGGED_ON,     TEXT("Logged on    ")},
00305   {200,            TEXT("Build Ver   ")},
00306 };
00307
00308
00309 //****************************************************************************
00310 //
00311 // VOID DumpSysInfo(void)
00312 //
00313 //****************************************************************************
00314
00315 VOID DumpSysInfo(void)
00316 {
00317   HRESULT     hr    = NO_ERROR;
00318   INmSysInfo  * pSysInfo  = 0;
00319
00320   if (NULL == g_pMgr)
00321     return;
00322
00323   if (FAILED(g_pMgr->GetSysInfo(&pSysInfo)))
00324   {
00325     return;
00326   }
00327
00328   hr = pSysInfo->IsInstalled();
00329
00330   TRACE_MSG(TEXT("NetMeeting IsInstalled (%s)"), GetHrSz(hr));
00331
00332   TRACE_MSG(TEXT("--- NetMeeting System Information ---"));
00333
00334   for (int i = 0; i < ARRAY_ELEMENTS(_rgSysInfo); i++)
00335   {
00336     BSTR bstr = NULL;
00337     hr = pSysInfo->GetProperty((NM_SYSPROP)_rgSysInfo[i].dw, &bstr);
00338     if FAILED(hr)
00339     {
00340       TRACE_MSG(TEXT("%s: HRESULT = %s"), _rgSysInfo[i].psz, GetHrSz(hr));
00341     }
00342     else
00343     {
00344       LPTSTR psz = PszFromBstr(bstr);
00345       TRACE_MSG(TEXT("%s = [%s]"), _rgSysInfo[i].psz, psz);
00346       FreePlpv(&psz);
00347       SysFreeString(bstr);
00348     }
00349   }
00350   TRACE_MSG(TEXT("--- NetMeeting System Information ---"));
00351
00352   ULONG nmch  = 0;
00353   hr = pSysInfo->GetNmchCaps(&nmch);
00354
00355   HRESULT hrInstalled = pSysInfo->IsInstalled();
00356   TRACE_MSG(TEXT("Installed=%s, Caps=%08X  hr=%s"), GetHrSz(hrInstalled), nmch, GetHrSz(hr));
00357
00358   BSTRING bstr(TEXT("1"));
00359   if  (NULL == bstr.GetLPBSTR())
00360   {
00361     ERROR_MSG(TEXT("DumpSysInfo: NULL == bstr"));
00362   }
00363   else
00364   {
00365     hr = pSysInfo->SetProperty(NM_SYSPROP_DISABLE_INITIAL_ILS_LOGON, bstr);
00366   }
00367
00368   pSysInfo->Release();
00369
00370   DumpAllCalls();
00371 }
00372
00373
00374 //****************************************************************************
00375 //
00376 // VOID DumpLaunchInfo(void)
00377 //
00378 //****************************************************************************
00379
00380 VOID DumpLaunchInfo(void)
00381 {
00382   HRESULT       hr      = NO_ERROR  ;
00383   INmSysInfo    * pSysInfo    = NULL    ;
00384   INmConference * pConference = NULL    ;
00385   INmMember   * pMember   = NULL    ;
00386
00387   if (NULL == g_pMgr)
00388     return;
00389
00390   if (FAILED(g_pMgr->GetSysInfo(&pSysInfo)))
00391   {
00392     return;
00393   }
00394
00395   GUID g = IID_INmSysInfo;
00396
00397   hr = pSysInfo->SetUserData(g, reinterpret_cast<byte*>(&g), sizeof(g));
00398   if(SUCCEEDED(hr))
00399   {
00400
00401     BYTE* pb  = 0;
00402     ULONG ul  = 0;
00403     if  SUCCEEDED(hr = pSysInfo->GetUserData(g, &pb, &ul))
00404     {
00405       ASSERT(ul == sizeof(g));
00406       ASSERT(0 == memcmp(pb, &g, ul));
00407
00408       CoTaskMemFree(pb);
00409     }
00410     else
00411     {
00412       ERROR_MSG(TEXT("DumpLaunchInfo: pSysInfo->GetUserData returned 0x%08X"), hr);
00413     }
00414   }
00415
00416   hr = pSysInfo->GetLaunchInfo(&pConference, &pMember);
00417   TRACE_MSG(TEXT("GetLaunchInfo: (%s) Conference=%08X Member=%08X"), GetHrSz(hr), pConference, pMember);
00418
00419   if (NULL != pConference)
00420     pConference->Release();
00421
00422   if (NULL != pMember)
00423     pMember->Release();
00424
00425   pSysInfo->Release();
00426 }
00427
00428
00429 //****************************************************************************
00430 //
00431 // VOID SysLogOnOff(int iDirection)
00432 //
00433 //****************************************************************************
00434
00435 VOID SysLogOnOff(int iDirection)
00436 {
00437   HRESULT     hr      = NO_ERROR  ;
00438   INmSysInfo  * pSysInfo    = NULL    ;
00439   BSTRING     bstrDirection       ;
00440   BSTR      bstrServer  = NULL    ;
00441
00442   if (NULL == g_pMgr)
00443     return;
00444
00445   if (FAILED(g_pMgr->GetSysInfo(&pSysInfo)))
00446   {
00447     TRACE_MSG(TEXT("NetMeeting GetSysInfo failed"));
00448     return;
00449   }
00450
00451   hr = pSysInfo->GetProperty(NM_SYSPROP_IS_RUNNING, &bstrServer);
00452   if(FAILED(hr))
00453     TRACE_MSG(TEXT("NetMeeting GetProperty [Is Running] (%s) "), GetHrSz(hr));
00454
00455   if  (NULL != bstrServer)
00456   {
00457     ::SysFreeString(bstrServer);
00458     bstrServer = NULL;
00459   }
00460
00461
00462   hr = pSysInfo->GetProperty(NM_SYSPROP_SERVER_NAME, &bstrServer);
00463   if(FAILED(hr))
00464     TRACE_MSG(TEXT("NetMeeting GetProperty [ServerName] (%s) "), GetHrSz(hr));
00465   else
00466     TRACE_MSG(TEXT("Server is %s"), PszFromBstr(bstrServer));
00467
00468   if  (NULL != bstrServer)
00469   {
00470     ::SysFreeString(bstrServer);
00471     bstrServer = NULL;
00472   }
00473
00474   bstrDirection = (iDirection==LOGON ? BSTRING(TEXT("1")) : BSTRING(TEXT("0")));
00475
00476   hr = pSysInfo->SetProperty(NM_SYSPROP_LOGGED_ON, bstrDirection);
00477
00478   TRACE_MSG(TEXT("NetMeeting SetProperty [Logon/Logoff] (%s)"), GetHrSz(hr));
00479
00480   pSysInfo->Release();
00481 }
00482
00483
00484
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebMisc.h Source File

  • WinBase
  • Debug
  • Deb

DebMisc.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014 \******************************************************************************/
00015
00016
00017 #ifndef DEBMISC_H
00018
00019  #define DEBMISC_H
00020
00021  #ifndef DEBDEBUG_H
00022    #include "DEBDebug.H"
00023  #endif
00024
00025  #ifndef DEBMAIN_H
00026    #include "DEBMain.H"
00027  #endif
00028
00029  //-- function prototypes
00030  BOOL          StartDebuggee( LPTSTR, HWND );
00031  BOOL          AttachToDebuggee( DWORD, HWND );
00032  BOOL CALLBACK EnumProcessListFunc( HWND, LPARAM );
00033  BOOL          GetDebuggeeFileName( LPTSTR, HWND );
00034  BOOL          ChooseNewFont( HWND );
00035  BOOL          ChooseNewBackColor( HWND );
00036  BOOL          MakeCommonDebugEventString( LPTSTR, DWORD, LPDEBUG_EVENT);
00037  HWND          CreateTextButtonBar( HWND, LPINT );
00038  HWND          CreateIconWindow( HWND, LPCTSTR );
00039  BOOL          GetPrivateProfileSettings( LPCTSTR, LPCTSTR, PPROFILE );
00040  BOOL          WritePrivateProfileSettings( LPCTSTR, LPCTSTR, PPROFILE );
00041  BOOL          WritePrivateProfileInt( LPCTSTR, LPCTSTR, INT, LPCTSTR );
00042  BOOL          UpdateMenuSettings( HWND );
00043  BOOL          OutOfMemoryMessageBox( HWND );
00044  BOOL          MaxDebuggeesMessageBox( HWND );
00045  BOOL          ErrorMessageBox( LPCTSTR, LPCTSTR, LPCTSTR, INT );
00046  WNDPROC       SubclassWindow( HWND, WNDPROC );
00047  LRESULT       SendWmSizeMessage( HWND );
00048  UINT          GetPathFromFullPathName( LPCTSTR, LPTSTR, UINT );
00049  BOOL          CopyListBoxToClipboard( HWND, LONG );
00050  LRESULT       ListBoxInsert( HWND, LPLONG, LPCTSTR );
00051  LRESULT       ListBoxPrintF( HWND, LPCTSTR, ... );
00052  LPTSTR        StringPrintF( LPTSTR, DWORD, LPCTSTR, ...  );
00053  BOOL          StringAppendF( LPTSTR, DWORD, LPCTSTR, ... );
00054
00055 #endif // DEBMISC_H
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/about.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

about.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Implementation of ISnapinAbout
00014 //
00015
00016
00017 #include "Globals.h"
00018 #include "About.h"
00019 #include "Resource.h"
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 //  Construction/Destruction
00023
00024 //---------------------------------------------------------------------------
00025 CSnapinAbout::CSnapinAbout()
00026 {
00027   m_cRef = 0;
00028   InterlockedIncrement((long*)&g_uObjectCount);
00029
00030   m_hSmallImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00031   m_hLargeImage = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_32), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00032
00033   // This image is displayed when the static node is selected
00034   m_hOpenImage  = (HBITMAP)LoadImage(g_hInst, MAKEINTRESOURCE(IDB_APPIMG_16), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00035
00036   m_hAppIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_APP_ICON));
00037 }
00038
00039 CSnapinAbout::~CSnapinAbout()
00040 {
00041   SAFE_FREE_BITMAP( m_hSmallImage );
00042   SAFE_FREE_BITMAP( m_hLargeImage );
00043   SAFE_FREE_BITMAP( m_hOpenImage  );
00044   SAFE_FREE_ICON( m_hAppIcon );
00045
00046   InterlockedDecrement((long*)&g_uObjectCount);
00047 }
00048
00049 /////////////////////////////////////////////////////////////////////////////
00050 // IUnknown implementation
00051
00052 //---------------------------------------------------------------------------
00053 STDMETHODIMP CSnapinAbout::QueryInterface
00054 (
00055   REFIID   riid,       //[in] Identifier of the requested interface
00056   LPVOID   *ppv        //[out] Address of requested interface
00057 )
00058 {
00059   if( !ppv )
00060     return E_FAIL;
00061
00062   *ppv = NULL;
00063
00064   if( IsEqualIID(riid, IID_IUnknown) )
00065     *ppv = static_cast<ISnapinAbout*>(this);
00066   else if( IsEqualIID(riid, IID_ISnapinAbout) )
00067     *ppv = static_cast<ISnapinAbout*>(this);
00068
00069   if( *ppv )
00070   {
00071     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00072     return S_OK;
00073   }
00074
00075   return E_NOINTERFACE;
00076 }
00077
00078 //---------------------------------------------------------------------------
00079 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00080 {
00081   return InterlockedIncrement((long*)&m_cRef);
00082 }
00083
00084 //---------------------------------------------------------------------------
00085 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00086 {
00087   if( 0 == InterlockedDecrement((long*)&m_cRef) )
00088   {
00089     // we need to decrement our object count in the DLL
00090     delete this;
00091     return 0;
00092   }
00093   return m_cRef;
00094 }
00095
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // Interface ISnapinAbout
00099
00100 //---------------------------------------------------------------------------
00101 STDMETHODIMP CSnapinAbout::GetSnapinDescription
00102 (
00103   LPOLESTR* pszDescription   //[out] Pointer to the description text
00104 )
00105 {
00106   LONG nLen = wcslen( gwszABOUT_DESCRIPTION ) + 1;
00107   *pszDescription = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00108   if( NULL == *pszDescription )
00109     return E_OUTOFMEMORY;
00110
00111   wcscpy( *pszDescription, gwszABOUT_DESCRIPTION );
00112   return S_OK;
00113 }
00114
00115 //---------------------------------------------------------------------------
00116 STDMETHODIMP CSnapinAbout::GetProvider
00117 (
00118   LPOLESTR* pszProvider      //[out] Pointer to provider text
00119 )
00120 {
00121   LONG nLen = wcslen( gwszABOUT_PROVIDER ) + 1;
00122   *pszProvider = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00123   if( NULL == *pszProvider )
00124     return E_OUTOFMEMORY;
00125
00126   wcscpy( *pszProvider, gwszABOUT_PROVIDER );
00127   return S_OK;
00128 }
00129
00130 //---------------------------------------------------------------------------
00131 STDMETHODIMP CSnapinAbout::GetSnapinVersion
00132 (
00133   LPOLESTR*  pszVersion      //[out] Pointer to version text
00134 )
00135 {
00136   LONG nLen = wcslen( gwszABOUT_VERSION ) + 1;
00137   *pszVersion = (LPOLESTR)CoTaskMemAlloc( nLen * sizeof(WCHAR) );
00138   if( NULL == *pszVersion )
00139     return E_OUTOFMEMORY;
00140
00141   wcscpy( *pszVersion, gwszABOUT_VERSION );
00142   return S_OK;
00143 }
00144
00145 //---------------------------------------------------------------------------
00146 STDMETHODIMP CSnapinAbout::GetSnapinImage
00147 (
00148   HICON *hAppIcon            //[out] Pointer to the Snap-in's main icon
00149 )
00150 {
00151   *hAppIcon = m_hAppIcon;
00152   HRESULT hResult = S_FALSE;
00153   (NULL == *hAppIcon ) ? hResult = E_FAIL : hResult = S_OK;
00154
00155   return hResult;
00156 }
00157
00158 //---------------------------------------------------------------------------
00159 STDMETHODIMP CSnapinAbout::GetStaticFolderImage
00160 (
00161   HBITMAP*   hSmallImage,      //[out] Pointer to small image
00162   HBITMAP*   hOpenImage,       //[out] Pointer to open folder image
00163   HBITMAP*   hLargeImage,      //[out] Pointer to large image
00164   COLORREF*  cMask             //[out] Pointer to image color mask
00165 )
00166 {
00167   *hSmallImage = m_hSmallImage;
00168   *hLargeImage = m_hLargeImage;
00169   *hOpenImage  = m_hOpenImage;
00170   *cMask       = RGB(0, 255, 0);
00171
00172   if( NULL == *hSmallImage || NULL == *hLargeImage || NULL == *hOpenImage )
00173     return E_FAIL;
00174
00175   return S_OK;
00176 }
00177
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/WKGUID/vc/wkguid.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • WKGUID
  • vc

wkguid.cpp

Go to the documentation of this file.
00001 // wkguid.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include <wchar.h>
00005 #include <objbase.h>
00006
00007 //For ADSI
00008 #include <activeds.h>
00009
00010 //Make sure you define UNICODE
00011 //Need to define version 5 for Windows 2000
00012 #define _WIN32_WINNT 0x0500
00013 #include <ntdsapi.h>
00014
00015 HRESULT GetWKDomainObject(LPOLESTR szBindableWKGUID, //IN. Bindable string GUID of well-known object.
00016               IADs **ppObject //OUT. Return a pointer to the specified well-known object.
00017               );
00018
00019
00020 void wmain( int argc, wchar_t *argv[ ])
00021 {
00022 wprintf(L"This program finds the User's container in the current Window 2000 domain\n");
00023 wprintf(L"It uses the WKGUID binding string format.\n");
00024 //Intialize COM
00025 CoInitialize(NULL);
00026 HRESULT hr = S_OK;
00027 //Get rootDSE and the domain container's DN.
00028 IADs *pObject = NULL;
00029 hr = GetWKDomainObject(GUID_USERS_CONTAINER_W, //IN. Bindable string GUID of Users container.
00030               &pObject //OUT. Return a pointer to the specified well-known object.
00031               );
00032 if (FAILED(hr))
00033 {
00034    wprintf(L"Not Found. Could not bind to the User container.\n");
00035    if (pObject)
00036      pObject->Release();
00037    return;
00038 }
00039
00040 BSTR bstr = NULL;
00041 hr = pObject->get_ADsPath(&bstr);
00042 if (SUCCEEDED(hr))
00043 {
00044     wprintf (L"\nADsPath of Users Container (using WKGUID binding format):\n%s\n", bstr);
00045     FreeADsStr(bstr);
00046 }
00047
00048 hr = pObject->get_Name(&bstr);
00049 if (SUCCEEDED(hr))
00050 {
00051     wprintf (L"\nName of Users Container (using WKGUID binding format):\n%s\n", bstr);
00052     FreeADsStr(bstr);
00053 }
00054
00055 VARIANT var;
00056 VariantInit(&var);
00057 hr = pObject->Get(L"distinguishedName",&var);
00058 if (SUCCEEDED(hr))
00059 {
00060     wprintf (L"\nName of Users Container: %s\n", V_BSTR(&var));
00061 }
00062 VariantClear(&var);
00063
00064 if (pObject)
00065   pObject->Release();
00066
00067
00068 //Uninitalize COM
00069 CoUninitialize();
00070 return;
00071
00072 }
00073
00074 // This function gets the specified well-known object for the current user's domain.
00075 /* Note that the following well-known GUIDs are defined for domainDNS in ntdsapi.h:
00076 #define GUID_USERS_CONTAINER_W              L"a9d1ca15768811d1aded00c04fd8d5cd"
00077 #define GUID_COMPUTRS_CONTAINER_W           L"aa312825768811d1aded00c04fd8d5cd"
00078 #define GUID_SYSTEMS_CONTAINER_W            L"ab1d30f3768811d1aded00c04fd8d5cd"
00079 #define GUID_DOMAIN_CONTROLLERS_CONTAINER_W L"a361b2ffffd211d1aa4b00c04fd7d83a"
00080 #define GUID_INFRASTRUCTURE_CONTAINER_W     L"2fbac1870ade11d297c400c04fd8d5cd"
00081 #define GUID_DELETED_OBJECTS_CONTAINER_W    L"18e2ea80684f11d2b9aa00c04f79f805"
00082 #define GUID_LOSTANDFOUND_CONTAINER_W       L"ab8153b7768811d1aded00c04fd8d5cd"
00083 */
00084
00085 HRESULT GetWKDomainObject(LPOLESTR szBindableWKGUID, //IN. Bindable string GUID of well-known object.
00086               IADs **ppObject //OUT. Return a pointer to the specified well-known object.
00087               )
00088 {
00089 HRESULT hr = E_FAIL;
00090 //Get rootDSE and the domain container's DN.
00091 IADs *pObject = NULL;
00092 LPOLESTR szPath = new OLECHAR[MAX_PATH];
00093 VARIANT var;
00094 hr = ADsOpenObject(L"LDAP://rootDSE",
00095          NULL,
00096          NULL,
00097          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00098          IID_IADs,
00099          (void**)&pObject);
00100
00101 VariantInit(&var);
00102 //Get current domain DN.
00103 if (SUCCEEDED(hr))
00104 {
00105   hr = pObject->Get(L"defaultNamingContext",&var);
00106   if (SUCCEEDED(hr))
00107   {
00108     //Build the WKGUID binding string.
00109     wcscpy(szPath,L"LDAP://");
00110     wcscat(szPath,L"<WKGUID=");
00111     wcscat(szPath,szBindableWKGUID);
00112     wcscat(szPath,L",");
00113     wcscat(szPath,V_BSTR(&var));
00114     wcscat(szPath,L">");
00115     //Print the binding string.
00116     //wprintf(L"WKGUID binding string: %s\n",szPath);
00117     VariantClear(&var);
00118     //Bind to the well-known object.
00119     hr = ADsOpenObject(szPath,
00120              NULL,
00121              NULL,
00122              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00123              IID_IADs,
00124              (void**)ppObject);
00125     if (FAILED(hr))
00126     {
00127       if (*ppObject)
00128       {
00129         (*ppObject)->Release();
00130         (*ppObject) = NULL;
00131       }
00132     }
00133   }
00134 }
00135 if (pObject)
00136   pObject->Release();
00137
00138 return hr;
00139 }
00140
00141
00142
00143
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Pch.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

Pch.Cxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       pch.cxx
00006 //
00007 //  Contents:   Pre-compiled header
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include <windows.h>
00012
00013 #pragma warning(disable: 4512)
00014
00015 #include <filter.h>
00016 #include <global.hxx>
00017 #include <filterr.h>
00018 #include <htmlscan.hxx>
00019
00020 #pragma hdrstop
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/LogWriter/StdAfx.h Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest
  • LogWriter

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__4C3F9EC1_088C_11D3_A115_0080C71F306F__INCLUDED_)
00006 #define AFX_STDAFX_H__4C3F9EC1_088C_11D3_A115_0080C71F306F__INCLUDED_
00007
00008 // we only work in UNICODE
00009 #ifndef _UNICODE
00010 #error This module must be build in UNICODE
00011 #endif
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017 #define STRICT
00018 #ifndef _WIN32_WINNT
00019 #define _WIN32_WINNT 0x0500
00020 #endif
00021 #define _ATL_APARTMENT_THREADED
00022
00023 #include <atlbase.h>
00024 //You may derive a class from CComModule and use it if you want to override
00025 //something, but do not change the name of _Module
00026 extern CComModule _Module;
00027 #include <atlcom.h>
00028 #include <comdef.h>
00029 #include <comsvcs.h>
00030
00031 //{{AFX_INSERT_LOCATION}}
00032 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00033
00034 #endif // !defined(AFX_STDAFX_H__4C3F9EC1_088C_11D3_A115_0080C71F306F__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/dataobj.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

dataobj.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _CLASS_CDATAOBJECT_
00015 #define _CLASS_CDATAOBJECT_
00016
00017 #include "Globals.h"
00018 #include "StaticNode.h"
00019
00020 //---------------------------------------------------------------------------
00021 class CDataObject : public IDataObject
00022 {
00023   private:
00024     ULONG     m_cRef;
00025     ULONG     m_uCookie;
00026     ULONG     m_uContext;
00027
00028   public:
00029     CDataObject();
00030     ~CDataObject();
00031
00032   public:  // Interface IUnknown
00033     STDMETHODIMP QueryInterface( REFIID riid, LPVOID* ppv );
00034     STDMETHODIMP_(ULONG) AddRef();
00035     STDMETHODIMP_(ULONG) Release();
00036
00037   public:  // IDataObject methods
00038     STDMETHODIMP GetDataHere (FORMATETC* pFormatEtc, STGMEDIUM* pStgMedium);
00039
00040     //XPROPPAGE:  We now support this for extensions
00041     STDMETHODIMP GetData (FORMATETC* pFormatEtc, STGMEDIUM* pStgMedium);
00042
00043     // The rest are not implemented
00044     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00045     { return E_NOTIMPL; };
00046
00047     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00048     { return E_NOTIMPL; };
00049
00050     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00051     { return E_NOTIMPL; };
00052
00053     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00054     { return E_NOTIMPL; };
00055
00056     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00057     { return E_NOTIMPL; };
00058
00059     STDMETHODIMP DUnadvise (DWORD dwConnection)
00060     { return E_NOTIMPL; };
00061
00062     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00063     { return E_NOTIMPL; };
00064
00065   ///////////////////////////////////////////////////////////////////////////
00066   // Custom Methods
00067   public:
00068     VOID   SetPrivateData( ULONG uCookie, ULONG uContext );
00069
00070     // For future use, not used in this sample
00071     ULONG  GetContext() { return m_uContext; }
00072     ULONG  GetCookie()  { return m_uCookie;  }
00073
00074   ///////////////////////////////////////////////////////////////////////////
00075   // Handlers for required clipboard formats
00076   private:
00077     HRESULT  RetrieveDisplayString( IStream* ipStream );
00078     HRESULT  RetrieveSnapInClassID( IStream* ipStream );
00079     HRESULT  RetrieveNodeTypeGuid(  IStream* ipStream );
00080     HRESULT  RetrieveGuidString(  IStream* ipStream );
00081     HRESULT  RetrieveBaseNodePtr( IStream* ipStream );
00082     HRESULT  RetrieveDataObjPtr(  IStream* ipStream );
00083
00084     HRESULT  RetrieveNodeAttribs( STGMEDIUM* pStgMedium );
00085
00086 };
00087
00088 #endif //_CLASS_CDATAOBJECT_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PropertyVtbl Member List

This is the complete list of members for PropertyVtbl, including all inherited members.
cNames | PropertyVtbl
dispIdMember | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Value)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Value)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Name)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Type)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Attributes)(ADOProperty __RPC_FAR *This | PropertyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Attributes)(ADOProperty __RPC_FAR *This | PropertyVtbl
iTInfo | PropertyVtbl
lAttributes | PropertyVtbl
lcid | PropertyVtbl
lcid | PropertyVtbl
lcid | PropertyVtbl
pbstr | PropertyVtbl
pctinfo | PropertyVtbl
pDispParams | PropertyVtbl
pExcepInfo | PropertyVtbl
plAttributes | PropertyVtbl
ppTInfo | PropertyVtbl
ppvObject | PropertyVtbl
ptype | PropertyVtbl
puArgErr | PropertyVtbl
pval | PropertyVtbl
pVarResult | PropertyVtbl
rgDispId | PropertyVtbl
rgszNames | PropertyVtbl
riid | PropertyVtbl
riid | PropertyVtbl
riid | PropertyVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ADOProperty __RPC_FAR *This) | PropertyVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ADOProperty __RPC_FAR *This) | PropertyVtbl
val | PropertyVtbl
wFlags | PropertyVtbl
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/main.cpp Source File

  • NetDS
  • RRas
  • rqs
  • server

main.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       main.cpp
00004 //
00005 //      Synopsis:   Main file for ras quarantine removal utility (server)
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011 #include <Rqs.h>
00012 #include <conio.h>
00013
00014 #define RQS_CONTROLS_ACCEPTED SERVICE_ACCEPT_STOP;
00015
00016 //+--------------------------------------------------------------------------
00017 //
00018 // Synopsis: Thread function to execute an instance of the quarantine engine.
00019 //           Used only in stand-alone mode (e.g. not when running as a
00020 //           service.
00021 //
00022 //+--------------------------------------------------------------------------
00023 DWORD WINAPI
00024 MainThread(
00025     IN LPVOID lpParameter)
00026 {
00027     RqsEngine* pEngine = (RqsEngine*)lpParameter;
00028     HRESULT hr = S_OK;
00029
00030     hr = pEngine->Initialize();
00031     if (S_OK != hr)
00032     {
00033         printf("Unable to initialize engine %x\n", hr);
00034         return hr;
00035     }
00036
00037     hr = pEngine->Execute();
00038     if (S_OK != hr)
00039     {
00040         printf("Engine execute error: %x\n", hr);
00041     }
00042
00043     return hr;
00044 }
00045
00046 //+--------------------------------------------------------------------------
00047 //
00048 // Synopsis: Console mode execution
00049 //
00050 //+--------------------------------------------------------------------------
00051 INT
00052 MainExecute()
00053 {
00054     HRESULT hr;
00055     HANDLE hThread = NULL;
00056     RqsEngine Engine;
00057
00058     hr = RuSocket::Initialize();
00059     if (S_OK != hr)
00060     {
00061         printf("Socket initialization failed %x\n", hr);
00062         return -1;
00063     }
00064
00065     Engine.SetConsoleTracing(TRUE);
00066
00067     // Create a thread to execute the server
00068     //
00069     hThread = CreateThread(
00070                     NULL,
00071                     0,
00072                     MainThread,
00073                     (LPVOID)&Engine,
00074                     0,
00075                     NULL);
00076     if (hThread)
00077     {
00078         // Wait for the user to enter something.  Signal that we're done when it
00079         // happens
00080         //
00081         printf("Press any key to stop...\n");
00082         _getch();
00083
00084         printf("Stopping...\n");
00085         Engine.Stop();
00086
00087         // Wait for the engine to complete its stop
00088         //
00089         WaitForSingleObjectEx(hThread, INFINITE, FALSE);
00090         printf("Stop complete.\n");
00091         CloseHandle(hThread);
00092     }
00093     else
00094     {
00095         printf("Unable to create execution thread. %x\n", GetLastError());
00096     }
00097
00098     RuSocket::Cleanup();
00099
00100     return 0;
00101 }
00102
00103 //+--------------------------------------------------------------------------
00104 //
00105 // Synopsis: Console mode execution
00106 //
00107 //+--------------------------------------------------------------------------
00108 INT
00109 MainConsole(
00110     int argc,
00111     char** argv)
00112 {
00113     //  Note that argc > 1 was verified in main()
00114     //
00115     if (strcmp(argv[1], "/?") == 0)
00116     {
00117         printf("Usage:\n");
00118         printf("  %s /run         Execute quarantine engine\n", argv[0]);
00119         printf("  %s /?           Display this help\n", argv[0]);
00120         printf("\n");
00121     }
00122
00123     else if (strcmp(argv[1], "/run") == 0)
00124     {
00125         MainExecute();
00126     }
00127
00128     return 0;
00129 }
00130
00131
00132 //+--------------------------------------------------------------------------
00133 //
00134 // Synopsis: Service control handler
00135 //
00136 //+--------------------------------------------------------------------------
00137 DWORD
00138 WINAPI
00139 ServiceHandlerEx(
00140     DWORD                 fdwControl,
00141     DWORD                 fdwEventType,
00142     LPVOID                lpEventData,
00143     LPVOID                lpContext)
00144 {
00145     RqsEngine* pEngine = reinterpret_cast<RqsEngine*>(lpContext);
00146
00147     if (NULL == pEngine)
00148     {
00149         return ERROR_INVALID_PARAMETER;
00150     }
00151
00152     pEngine->Trace(
00153         "ServiceHandlerEx enter.  ctrl=%d type=%d",
00154         fdwControl,
00155         fdwEventType);
00156
00157     DWORD dwRetCode =  ERROR_SUCCESS;
00158     SERVICE_STATUS status;
00159     ZeroMemory (&status, sizeof(status));
00160     status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
00161
00162     switch (fdwControl)
00163     {
00164         case SERVICE_CONTROL_INTERROGATE:
00165             pEngine->Trace("ServiceHandlerEx: pause/cont/interrogate");
00166             status.dwCurrentState       = SERVICE_RUNNING;
00167             status.dwControlsAccepted   = RQS_CONTROLS_ACCEPTED;
00168             status.dwCheckPoint         = pEngine->GetCheckpoint();
00169             SetServiceStatus(pEngine->GetServiceHandle(), &status);
00170             break;
00171
00172             // Do not worry about shutdown as we do not want to slow down
00173             // down shutdown time.  We do not need to clean up anything that
00174             // the reboot would not on its own.  On service stop, make sure to
00175             // clean up connections in progress.
00176             //
00177         case SERVICE_CONTROL_STOP:
00178             pEngine->Trace("ServiceHandlerEx: stop/shutdown");
00179             status.dwCurrentState = SERVICE_STOP_PENDING;
00180             SetServiceStatus(pEngine->GetServiceHandle(), &status);
00181             pEngine->Stop();
00182             break;
00183
00184         default:
00185             //  We should never get here, but just in case we get a state we did not
00186             //  expect we will return an invalid parameter error.
00187             //
00188             dwRetCode = ERROR_CALL_NOT_IMPLEMENTED;
00189     }
00190
00191     return dwRetCode;
00192 } // ServiceHandler
00193
00194 //+--------------------------------------------------------------------------
00195 //
00196 // Synopsis: ServiceMain
00197 //
00198 //+--------------------------------------------------------------------------
00199 VOID WINAPI
00200 ServiceMain(
00201     DWORD dwArgc,
00202     LPTSTR *lpszArgv)
00203 {
00204     SERVICE_STATUS sStatus;
00205     HRESULT hr;
00206     RqsEngine Engine;
00207     SERVICE_STATUS_HANDLE hService;
00208
00209     Engine.Trace("Service Main entered.");
00210
00211     ZeroMemory (&sStatus, sizeof(sStatus));
00212     sStatus.dwServiceType = SERVICE_WIN32_SHARE_PROCESS;
00213
00214     // Register the control request handler.
00215     //
00216     hService = RegisterServiceCtrlHandlerEx(
00217                     TEXT("rqs"),
00218                     ServiceHandlerEx,
00219                     (LPVOID)&Engine);
00220     if (NULL == hService)
00221     {
00222         Engine.Trace("Unable to set service control handler");
00223         return;
00224     }
00225     Engine.SetServiceHandle(hService);
00226
00227     // Mark the service as start pending
00228     //
00229     sStatus.dwCheckPoint = 1;
00230     sStatus.dwWaitHint = 5000; // Our best guess of RQS's initialization is that it should take no more than 5 seconds
00231     sStatus.dwCurrentState = SERVICE_START_PENDING;
00232     SetServiceStatus(hService, &sStatus);
00233
00234     // Perform initialization.
00235     //
00236     BOOL bSocketInitialized = FALSE;
00237     hr = RuSocket::Initialize();
00238     if (S_OK != hr)
00239     {
00240         Engine.Trace("Socket initialization failed %x", hr);
00241         sStatus.dwWin32ExitCode = HRESULT_CODE(hr);
00242         goto exit;
00243     }
00244
00245     bSocketInitialized = TRUE;
00246
00247     hr = Engine.Initialize();
00248     if (S_OK != hr)
00249     {
00250         Engine.Trace("Initialization failed %x", hr);
00251         sStatus.dwWin32ExitCode = HRESULT_CODE(hr);
00252         goto exit;
00253     }
00254
00255     // Initialization succeeded.  Update status.
00256     //
00257     sStatus.dwControlsAccepted = RQS_CONTROLS_ACCEPTED;
00258     sStatus.dwCurrentState     = SERVICE_RUNNING;
00259     SetServiceStatus(hService, &sStatus);
00260
00261     // Tell the engine to execute. This method will return when all
00262     // pending clients are serviced and we are ready to stop.
00263     //
00264     Engine.Execute();
00265
00266     //
00267     // Update return code status.
00268     //
00269     sStatus.dwWin32ExitCode = NO_ERROR;
00270     sStatus.dwServiceSpecificExitCode = 0;
00271
00272
00273 exit:
00274
00275     if (bSocketInitialized)
00276     {
00277         RuSocket::Cleanup();
00278     }
00279
00280     sStatus.dwControlsAccepted = 0;
00281     sStatus.dwCurrentState     = SERVICE_STOPPED;
00282     SetServiceStatus(hService, &sStatus);
00283 }
00284
00285 //+--------------------------------------------------------------------------
00286 //
00287 // Synopsis: Main function
00288 //
00289 //+--------------------------------------------------------------------------
00290 int
00291 __cdecl
00292 main(
00293     int argc,
00294     char *argv[ ],
00295     char *envp[ ])
00296 {
00297     SERVICE_TABLE_ENTRY DispatchTable[] =
00298     {
00299         { L"rqs",        ServiceMain },
00300         {  NULL,         NULL}
00301     };
00302
00303     if (argc == 1)
00304     {
00305         StartServiceCtrlDispatcher( DispatchTable);
00306     }
00307     else
00308     {
00309         MainConsole(argc, argv);
00310     }
00311
00312     return 0;
00313 }
00314
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/Resource.h Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

Resource.h

Go to the documentation of this file.
00001 //==============================================================================
00002 // This file is part of the Microsoft COM+ Samples
00003 //
00004 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00005 //
00006 // This source code is intended only as a supplement to Microsoft
00007 // Development Tools and/or on-line documentation.  See these other
00008 // materials for detailed information reagrding Microsoft code samples.
00009 //
00010 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00011 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00012 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00013 // PARTICULAR PURPOSE.
00014 //
00015 //==============================================================================
00016
00017 //{{NO_DEPENDENCIES}}
00018 // Microsoft Developer Studio generated include file.
00019 // Used by Oledbkb.rc
00020 //
00021 #define IDS_PROJNAME                    100
00022 #define IDR_OLEDBCOMPONENT              101
00023
00024 // Next default values for new objects
00025 //
00026 #ifdef APSTUDIO_INVOKED
00027 #ifndef APSTUDIO_READONLY_SYMBOLS
00028 #define _APS_NEXT_RESOURCE_VALUE        201
00029 #define _APS_NEXT_COMMAND_VALUE         32768
00030 #define _APS_NEXT_CONTROL_VALUE         201
00031 #define _APS_NEXT_SYMED_VALUE           102
00032 #endif
00033 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerServe/Connect.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerServe

Connect.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CONNECT.CPP
00003
00004   Summary:   Implementation file for the connection points (and their
00005              connections) offered by the connectable objects in the
00006              PERSERVE server sample. COM objects are implemented for
00007              Connection Point Enumerators, Connection Points, and
00008              Connection Enumerators.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial PERSERVE.HTM
00012              file. For more specific technical details on the internal
00013              workings see the comments dispersed throughout the module's
00014              source code.
00015
00016   Classes:   COEnumConnectionPoints, COConnectionPoint, and
00017              COEnumConnections.
00018
00019   Functions: none.
00020
00021   Origin:    6-10-96: atrent - Editor inheritance from CONSERVE COM
00022              Tutorial Code Sample. Very little change was required.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039
00040 /*---------------------------------------------------------------------------
00041   We include WINDOWS.H for all Win32 applications.
00042   We include OLE2.H because we will be calling the COM/OLE Libraries.
00043   We include OLECTL.H because it has definitions for connectable objects.
00044   We include APPUTIL.H because we will be building this application using
00045     the convenient Virtual Window and Dialog classes and other
00046     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00047   We include IPAGES.H and PAGEGUID.H for the common page-related
00048     Interface class, GUID, and CLSID specifications.
00049   We include SERVER.H because it has internal class declarations and
00050     resource ID definitions specific for this DLL.
00051   We include CONNECT.H for object class declarations for the various
00052     connection point and connection COM objects used in CONSERVE.
00053   We include PAGELIST.H because it has the class COEnumConnectionPoints
00054     declarations as well as the COPageList class declaration.
00055 ---------------------------------------------------------------------------*/
00056 #include <windows.h>
00057 #include <ole2.h>
00058 #include <olectl.h>
00059 #include <apputil.h>
00060 #include <ipages.h>
00061 #include <pageguid.h>
00062 #include "server.h"
00063 #include "connect.h"
00064 #include "pagelist.h"
00065
00066
00067 /*---------------------------------------------------------------------------
00068   COEnumConnectionPoints's implementation of its main COM object class
00069   including Constructor, Destructor, QueryInterface, AddRef, Release,
00070   Next, Skip, Reset, and Clone.
00071 ---------------------------------------------------------------------------*/
00072
00073 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00074   Method:   COEnumConnectionPoints::COEnumConnectionPoints
00075
00076   Summary:  COEnumConnectionPoints Constructor.
00077
00078   Args:     IUnknown* pHostObj
00079               Pointer to the host object whose connection points are
00080               being enumerated.
00081
00082   Modifies: m_cRefs, m_pHostObj, m_iEnumIndex, m_cConnPts, and m_paConnPts.
00083
00084   Returns:  void
00085 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00086 COEnumConnectionPoints::COEnumConnectionPoints(
00087   IUnknown* pHostObj)
00088 {
00089   // Zero the COM object's reference count.
00090   m_cRefs = 0;
00091
00092   // Assign the Host Object pointer.
00093   m_pHostObj = pHostObj;
00094
00095   // Initialize the Connection Point enumerator variables.
00096   m_iEnumIndex = 0;
00097   m_cConnPts = 0;
00098   m_paConnPts = NULL;
00099
00100   return;
00101 }
00102
00103
00104 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00105   Method:   COEnumConnectionPoints::~COEnumConnectionPoints
00106
00107   Summary:  COEnumConnectionPoints Destructor.
00108
00109   Args:     void
00110
00111   Modifies: m_paConnPts.
00112
00113   Returns:  void
00114 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00115 COEnumConnectionPoints::~COEnumConnectionPoints(void)
00116 {
00117   if (NULL != m_paConnPts)
00118   {
00119     UINT i;
00120
00121     // Release all the connection point interface pointers.
00122     for (i=0; i<m_cConnPts; i++)
00123       if (NULL != m_paConnPts[i])
00124         m_paConnPts[i]->Release();
00125
00126     // Delete the array of interface pointers.
00127     delete [] m_paConnPts;
00128   }
00129
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   COEnumConnectionPoints::Init
00136
00137   Summary:  COEnumConnectionPoints Initialization method.  Create any
00138             necessary arrays, structures, and objects.
00139
00140   Args:     ULONG cConnPts,
00141               Number of Connections Points.
00142             IConnectionPoint** paConnPts,
00143               Pointer to array of connection point interface pointers.
00144             ULONG iEnumIndex
00145               The initial Enumerator index value.
00146
00147   Modifies: m_cConnPts, m_paConnPts, m_iEnumIndex.
00148
00149   Returns:  HRESULT
00150               Standard result code. NOERROR for success.
00151 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00152 HRESULT COEnumConnectionPoints::Init(
00153           ULONG cConnPts,
00154           IConnectionPoint** paConnPts,
00155           ULONG iEnumIndex)
00156 {
00157   HRESULT hr = NOERROR;
00158   UINT i;
00159
00160   // Remember the number of Connection points.
00161   m_cConnPts = cConnPts;
00162
00163   // Remember the initial enumerator index.
00164   m_iEnumIndex = iEnumIndex;
00165
00166   // Create a copy of the array of connection points and keep it inside
00167   // this enumerator COM object.
00168   m_paConnPts = new IConnectionPoint* [(UINT) cConnPts];
00169
00170   // Fill the array copy with the IConnectionPoint interface pointers from
00171   // the array passed. AddRef for each new Interface pointer copy made.
00172   if (NULL != m_paConnPts)
00173   {
00174     for (i=0; i<cConnPts; i++)
00175     {
00176       m_paConnPts[i] = paConnPts[i];
00177       m_paConnPts[i]->AddRef();
00178     }
00179   }
00180   else
00181     hr = E_OUTOFMEMORY;
00182
00183   return (hr);
00184 }
00185
00186
00187 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00188   Method:   COEnumConnectionPoints::QueryInterface
00189
00190   Summary:  QueryInterface of the COEnumConnectionPoints non-delegating
00191             IUnknown implementation.
00192
00193   Args:     REFIID riid,
00194               [in] GUID of the Interface being requested.
00195             PPVOID ppv)
00196               [out] Address of the caller's pointer variable that will
00197               receive the requested interface pointer.
00198
00199   Returns:  HRESULT
00200 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00201 STDMETHODIMP COEnumConnectionPoints::QueryInterface(
00202                REFIID riid,
00203                PPVOID ppv)
00204 {
00205   HRESULT hr = E_NOINTERFACE;
00206
00207   *ppv = NULL;
00208
00209   // The IEnumConnectionPoints interface is implemented directly in
00210   // this COM object rather than being a nested interface implementation.
00211   if (IID_IUnknown == riid || IID_IEnumConnectionPoints == riid)
00212     *ppv = (LPVOID)this;
00213
00214   if (NULL != *ppv)
00215   {
00216     // We've handed out a pointer to the interface so obey the COM rules
00217     // and AddRef the reference count.
00218     ((LPUNKNOWN)*ppv)->AddRef();
00219     hr = NOERROR;
00220   }
00221
00222   return (hr);
00223 }
00224
00225
00226 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00227   Method:   COEnumConnectionPoints::AddRef
00228
00229   Summary:  AddRef of the COEnumConnectionPoints non-delegating IUnknown
00230             implementation.
00231
00232   Args:     void
00233
00234   Modifies: m_cRefs.
00235
00236   Returns:  ULONG
00237               New value of m_cRefs (COM object's reference count).
00238 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00239 STDMETHODIMP_(ULONG) COEnumConnectionPoints::AddRef(void)
00240 {
00241   ULONG cRefs;
00242
00243   cRefs = ++m_cRefs;
00244
00245   // Also AddRef the host object to ensure it stays around as long as
00246   // this enumerator.
00247   m_pHostObj->AddRef();
00248
00249   return cRefs;
00250 }
00251
00252
00253 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00254   Method:   COEnumConnectionPoints::Release
00255
00256   Summary:  Release of the COEnumConnectionPoints non-delegating IUnknown
00257             implementation.
00258
00259   Args:     void
00260
00261   Modifies: m_cRefs.
00262
00263   Returns:  ULONG
00264               New value of m_cRefs (COM object's reference count).
00265 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00266 STDMETHODIMP_(ULONG) COEnumConnectionPoints::Release(void)
00267 {
00268   ULONG cRefs;
00269
00270   // Pass this release along to the Host object being enumerated.
00271   m_pHostObj->Release();
00272
00273   cRefs = --m_cRefs;
00274
00275   if (0 == cRefs)
00276   {
00277     // We artificially bump the main ref count to prevent reentrancy via
00278     // the main object destructor.
00279     m_cRefs++;
00280     delete this;
00281   }
00282
00283   return cRefs;
00284 }
00285
00286
00287 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00288   Method:   COEnumConnectionPoints::Next
00289
00290   Summary:  The Next member method of this IEnumConnectionPoints interface
00291             implementation. Called by outside clients of a
00292             COEnumConnectionPoints object to request that a number of next
00293             connection point interface pointers be deposited into an array
00294             supplied by the caller.
00295
00296   Args:     ULONG cReq
00297               Number of connection points requested for return (starting at
00298               the current Enumerator index).
00299             IConnectionPoint** paConnPts,
00300               Pointer to a caller's output array that will receive the
00301               enumerated IConnectionPoint interface pointers.
00302             ULONG* cEnumerated)
00303               Pointer to a ULONG variable that will contain the number of
00304               connection points actually enumerated by this call.
00305
00306   Returns:  HRESULT
00307               Standard result code. NOERROR for success.
00308 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00309 STDMETHODIMP COEnumConnectionPoints::Next(
00310                ULONG cReq,
00311                IConnectionPoint** paConnPts,
00312                ULONG* pcEnumerated)
00313 {
00314   HRESULT hr = NOERROR;
00315   ULONG cRet = 0;
00316
00317   // Make sure the argument values passed are valid.
00318   if (NULL != m_paConnPts)
00319   {
00320     if (NULL != paConnPts)
00321     {
00322       if (NULL != *paConnPts && m_iEnumIndex < m_cConnPts)
00323       {
00324         if (NULL != pcEnumerated)
00325           *pcEnumerated = 0L;
00326         else
00327           if (1L != cReq)
00328             hr = E_POINTER;
00329       }
00330       else
00331         hr = S_FALSE;
00332     }
00333     else
00334       hr = E_POINTER;
00335   }
00336   else
00337     hr = S_FALSE;
00338
00339   if (SUCCEEDED(hr))
00340   {
00341     // Starting at the current Enumerator index, loop to assign the
00342     // requested number of output connection point interface pointers.
00343     for (; m_iEnumIndex < m_cConnPts && cReq > 0;
00344            paConnPts++, cRet++, cReq--)
00345     {
00346       // Assign from the inside Enumerator array to the specified receiving
00347       // array.
00348       *paConnPts = m_paConnPts[m_iEnumIndex++];
00349       // After assigning a copy of an IConnectionPoint pointer, AddRef it.
00350       if (NULL != *paConnPts)
00351         (*paConnPts)->AddRef();
00352     }
00353
00354     // Assign the output number of connection points enumerated.
00355     if (NULL != pcEnumerated)
00356       *pcEnumerated = cRet;
00357   }
00358
00359   return hr;
00360 }
00361
00362
00363 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00364   Method:   COEnumConnectionPoints::Skip
00365
00366   Summary:  The Skip member method of this IEnumConnectionPoints interface
00367             implementation. Starting at the current Enumerator index, skip
00368             the specified number of connection point items.
00369
00370   Args:     ULONG cSkip
00371               Number of Connection Point items to skip.
00372
00373   Returns:  HRESULT
00374               Standard result code. NOERROR for success.
00375 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00376 STDMETHODIMP COEnumConnectionPoints::Skip(
00377                ULONG cSkip)
00378 {
00379   HRESULT hr = NOERROR;
00380
00381   // If there really is a connection point array and the requested
00382   // amount of skip does not exceed the number of connection points,
00383   // then bump the index by the requested skip amount.
00384   if (NULL != m_paConnPts && (m_iEnumIndex + cSkip) < m_cConnPts)
00385     m_iEnumIndex += cSkip;
00386   else
00387     hr = S_FALSE;
00388
00389   return hr;
00390 }
00391
00392
00393 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00394   Method:   COEnumConnectionPoints::Reset
00395
00396   Summary:  The Reset member method of the IEnumConnectionPoints interface
00397             implementation. Resets the Enumeration index to the first
00398             connection point item in the array.
00399
00400   Args:     void.
00401
00402   Returns:  HRESULT
00403               Standard result code. NOERROR for success.
00404 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00405 STDMETHODIMP COEnumConnectionPoints::Reset(
00406                void)
00407 {
00408   // Zero the main Enumerator index.
00409   m_iEnumIndex = 0;
00410
00411   return NOERROR;
00412 }
00413
00414
00415 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00416   Method:   COEnumConnectionPoints::Clone
00417
00418   Summary:  The Clone member method of this IEnumConnectionPoints
00419             interface implementation. Creates a new clone of this entire
00420             Connection Point enumerator COM object.
00421
00422   Args:     IEnumConnectionPoints** ppIEnum
00423               Address of the caller's output pointer variable that will
00424               receive the IEnumConnectionPoints interface pointer of the
00425               new enumerator clone.
00426
00427   Returns:  HRESULT
00428               Standard result code. NOERROR for success.
00429 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00430 STDMETHODIMP COEnumConnectionPoints::Clone(
00431                IEnumConnectionPoints** ppIEnum)
00432 {
00433   HRESULT hr;
00434   COEnumConnectionPoints* pCOEnum;
00435
00436   // NULL the output variable first.
00437   *ppIEnum = NULL;
00438
00439   // Create the Clone Enumerator COM object.
00440   pCOEnum = new COEnumConnectionPoints(m_pHostObj);
00441   if (NULL != pCOEnum)
00442   {
00443     // Initialize it with same values as in this existing enumerator.
00444     hr = pCOEnum->Init(m_cConnPts, m_paConnPts, m_iEnumIndex);
00445     if (SUCCEEDED(hr))
00446     {
00447       // QueryInterface to return the requested interface pointer.
00448       // An AddRef will be conveniently done by the QI.
00449       if (SUCCEEDED(hr))
00450         hr = pCOEnum->QueryInterface(
00451                         IID_IEnumConnectionPoints,
00452                         (PPVOID)ppIEnum);
00453     }
00454   }
00455   else
00456     hr = E_OUTOFMEMORY;
00457
00458   return hr;
00459 }
00460
00461
00462 /*---------------------------------------------------------------------------
00463   COConnectionPoint's implementation of its main COM object class
00464   including Constructor, Destructor, QueryInterface, AddRef, Release,
00465   GetConnectionInterface, GetConnectionPointContainer, Advise, Unadvise,
00466   and EnumConnections.
00467 ---------------------------------------------------------------------------*/
00468
00469 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00470   Method:   COConnectionPoint::COConnectionPoint
00471
00472   Summary:  COConnectionPoint Constructor.
00473
00474   Args:     IUnknown* pHostObj
00475               Pointer to IUnknown of the connectable object offering this
00476               connection point.
00477
00478   Returns:  void
00479 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00480 COConnectionPoint::COConnectionPoint(
00481   IUnknown* pHostObj)
00482 {
00483   // Zero the COM object's reference count.
00484   m_cRefs = 0;
00485
00486   // Remember an IUnknown pointer to the connectable object that offers
00487   // this connection point. Since this connection point object's lifetime
00488   // is geared to that of the connectable object there is no need to
00489   // AddRef the following copied pointer to the connectable object.
00490   m_pHostObj = pHostObj;
00491
00492   // Initialize the Connection Point variables.
00493   m_dwNextCookie = COOKIE_START_VALUE;
00494   m_uiMaxIndex = 0;
00495   m_cConnections = 0;
00496   m_paConnections = NULL;
00497
00498   return;
00499 }
00500
00501
00502 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00503   Method:   COConnectionPoint::~COConnectionPoint
00504
00505   Summary:  COConnectionPoint Destructor.
00506
00507   Args:     void
00508
00509   Modifies: m_paConnections.
00510
00511   Returns:  void
00512 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00513 COConnectionPoint::~COConnectionPoint(void)
00514 {
00515   UINT i;
00516   IUnknown* pUnk;
00517
00518   if (NULL != m_paConnections)
00519   {
00520     // Release all the connection sink interface pointers.
00521     for (i=0; i<m_uiMaxIndex; i++)
00522     {
00523       pUnk = m_paConnections[i].pUnk;
00524       if (NULL != pUnk)
00525         pUnk->Release();
00526     }
00527
00528     // Delete the array of interface pointers.
00529     delete [] m_paConnections;
00530   }
00531
00532   return;
00533 }
00534
00535
00536 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00537   Method:   COConnectionPoint::Init
00538
00539   Summary:  COConnectionPoint Initialization method.  Create any
00540             necessary arrays, structures, and subordinate objects.
00541
00542   Args:     REFIID riid
00543               Reference to the IID of the Sink interface associated with
00544               this connection point.
00545
00546   Returns:  HRESULT
00547               Standard result code. NOERROR for success.
00548 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00549 HRESULT COConnectionPoint::Init(
00550           REFIID riid)
00551 {
00552   HRESULT hr = NOERROR;
00553   CONNECTDATA* paConns;
00554
00555   // Keep a copy of the reference to the IID of the sink interface
00556   // associated with this connection point. Needed for later
00557   // use by the GetConnectionInterface method.
00558   m_iidSink = riid;
00559
00560   // Build the initial dynamic array for connections.
00561   paConns = new CONNECTDATA[ALLOC_CONNECTIONS];
00562   if (NULL != paConns)
00563   {
00564     // Zero the array.
00565     memset(paConns, 0, ALLOC_CONNECTIONS * sizeof(CONNECTDATA));
00566
00567     // Rig this connection point object so that it will use the
00568     // new internal array of connections.
00569     m_uiMaxIndex = ALLOC_CONNECTIONS;
00570     m_paConnections = paConns;
00571   }
00572   else
00573     hr = E_OUTOFMEMORY;
00574
00575   return (hr);
00576 }
00577
00578
00579 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00580   Method:   COConnectionPoint::QueryInterface
00581
00582   Summary:  QueryInterface of the COConnectionPoint non-delegating
00583             IUnknown implementation.
00584
00585   Args:     REFIID riid,
00586               [in] GUID of the Interface being requested.
00587             PPVOID ppv)
00588               [out] Address of the caller's pointer variable that will
00589               receive the requested interface pointer.
00590
00591   Returns:  HRESULT
00592 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00593 STDMETHODIMP COConnectionPoint::QueryInterface(
00594                REFIID riid,
00595                PPVOID ppv)
00596 {
00597   HRESULT hr = E_NOINTERFACE;
00598
00599   *ppv = NULL;
00600
00601   // The IConnectionPoint interface is implemented directly in this
00602   // COM object rather than being a nested interface implementation.
00603   if (IID_IUnknown == riid || IID_IConnectionPoint == riid)
00604     *ppv = (LPVOID)this;
00605
00606   if (NULL != *ppv)
00607   {
00608     // We've handed out a pointer to the interface so obey the COM rules
00609     // and AddRef the reference count.
00610     ((LPUNKNOWN)*ppv)->AddRef();
00611     hr = NOERROR;
00612   }
00613
00614   return (hr);
00615 }
00616
00617
00618 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00619   Method:   COConnectionPoint::AddRef
00620
00621   Summary:  AddRef of the COConnectionPoint non-delegating IUnknown
00622             implementation.
00623
00624   Args:     void
00625
00626   Modifies: m_cRefs.
00627
00628   Returns:  ULONG
00629               New value of m_cRefs (COM object's reference count).
00630 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00631 STDMETHODIMP_(ULONG) COConnectionPoint::AddRef(void)
00632 {
00633   ULONG cRefs;
00634
00635   cRefs = ++m_cRefs;
00636
00637   return cRefs;
00638 }
00639
00640
00641 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00642   Method:   COConnectionPoint::Release
00643
00644   Summary:  Release of the COConnectionPoint non-delegating IUnknown
00645             implementation.
00646
00647   Args:     void
00648
00649   Modifies: m_cRefs.
00650
00651   Returns:  ULONG
00652               New value of m_cRefs (COM object's reference count).
00653 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00654 STDMETHODIMP_(ULONG) COConnectionPoint::Release(void)
00655 {
00656   ULONG cRefs;
00657
00658   cRefs = --m_cRefs;
00659
00660   if (0 == cRefs)
00661   {
00662     // We artificially bump the main ref count to prevent reentrancy via
00663     // the main object destructor. We relinquish thread ownership of this
00664     // object prior to deleting it--a good practice.
00665     m_cRefs++;
00666     delete this;
00667   }
00668
00669   return cRefs;
00670 }
00671
00672
00673 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00674   Method:   COConnectionPoint::GetSlot
00675
00676   Summary:  An internal private utility member method to obtain a free
00677             slot in the dynamic connections array. GetSlot will expand the
00678             dynamic array for more entries if needed.
00679
00680   Args:     UINT* puiFreeSlot
00681               Address of an output variable to receive the free slot index.
00682
00683   Modifies: m_uiMaxIndex, m_paConnections.
00684
00685   Returns:  HRESULT
00686               Standard result code. NOERROR for success.
00687 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00688 HRESULT COConnectionPoint::GetSlot(
00689           UINT* puiFreeSlot)
00690 {
00691   HRESULT hr = NOERROR;
00692   BOOL bOpen = FALSE;
00693   UINT i;
00694   CONNECTDATA* paConns;
00695
00696   // Zero the output variable.
00697   *puiFreeSlot = 0;
00698
00699   // Loop to find an empty slot.
00700   for (i=0; i<m_uiMaxIndex; i++)
00701   {
00702     if (m_paConnections[i].dwCookie == 0)
00703     {
00704       // We found an open empty slot.
00705       *puiFreeSlot = i;
00706       bOpen = TRUE;
00707       break;
00708     }
00709   }
00710
00711   if (!bOpen)
00712   {
00713     // We didn't find an existing open slot in the array--it's full.
00714     // Expand the array by ALLOC_CONNECTIONS entries and assign the
00715     // appropriate output index.
00716     paConns = new CONNECTDATA[m_uiMaxIndex + ALLOC_CONNECTIONS];
00717     if (NULL != paConns)
00718     {
00719       // Copy the content of the old full array to the new larger array.
00720       for (i=0; i<m_uiMaxIndex; i++)
00721       {
00722         paConns[i].pUnk = m_paConnections[i].pUnk;
00723         paConns[i].dwCookie = m_paConnections[i].dwCookie;
00724       }
00725
00726       // Zero (ie mark as empty) the expanded portion of the new array.
00727       for (i=m_uiMaxIndex; i<m_uiMaxIndex+ALLOC_CONNECTIONS; i++)
00728       {
00729         paConns[i].pUnk = NULL;
00730         paConns[i].dwCookie = 0;
00731       }
00732
00733       // New larger array is ready--delete the old array.
00734       delete [] m_paConnections;
00735
00736       // Rig the connection point to use the new larger array.
00737       m_paConnections = paConns;
00738
00739       // Assign the output free slot as first entry in new expanded area.
00740       *puiFreeSlot = m_uiMaxIndex;
00741
00742       // Calculate the new max index.
00743       m_uiMaxIndex += ALLOC_CONNECTIONS;
00744     }
00745     else
00746       hr = E_OUTOFMEMORY;
00747   }
00748
00749   return hr;
00750 }
00751
00752
00753 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00754   Method:   COConnectionPoint::FindSlot
00755
00756   Summary:  An internal private utility member method to find an existing
00757             slot (identified by the specified dwCookie value) in the
00758             dynamic connections array.
00759
00760   Args:     DWORD dwCookie,
00761               The connection key (cookie) to find.
00762             UINT* puiSlot)
00763               Address of an output variable to receive the slot index.
00764
00765   Returns:  HRESULT
00766               Standard result code. NOERROR for success.
00767 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00768 HRESULT COConnectionPoint::FindSlot(
00769           DWORD dwCookie,
00770           UINT* puiSlot)
00771 {
00772   HRESULT hr = CONNECT_E_NOCONNECTION;
00773   UINT i;
00774
00775   // Loop to find the Cookie.
00776   for (i=0; i<m_uiMaxIndex; i++)
00777   {
00778     if (dwCookie == m_paConnections[i].dwCookie)
00779     {
00780       // If a cookie match is found, assign the output slot index.
00781       *puiSlot = i;
00782       hr = NOERROR;
00783       break;
00784     }
00785   }
00786
00787   return hr;
00788 }
00789
00790
00791 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00792   Method:   COConnectionPoint::GetConnectionInterface
00793
00794   Summary:  The GetConnectionInterface member method of this
00795             IConnectionPoint interface implementation. Called to get the
00796             IID of the Sink interface associated with this connection
00797             point.
00798
00799   Args:     IID* piidSink
00800               Pointer to the IID of the associated sink interface.
00801
00802   Returns:  HRESULT
00803               Standard result code. NOERROR for success.
00804 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00805 STDMETHODIMP COConnectionPoint::GetConnectionInterface(
00806                IID* piidSink)
00807 {
00808   HRESULT hr = NOERROR;
00809
00810   if (NULL != piidSink)
00811     *piidSink = m_iidSink;
00812   else
00813     hr = E_POINTER;
00814
00815   return hr;
00816 }
00817
00818
00819 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00820   Method:   COConnectionPoint::GetConnectionPointContainer
00821
00822   Summary:  The GetConnectionPointContainer member method of this
00823             IConnectionPoint interface implementation. Called to get the
00824             connection point container that contains this connection
00825             point.
00826
00827   Args:     IConnectionPointContainer** ppConnPtCon
00828               Address of the pointer variable that will recieve the
00829               IConnectionPointContainer interface pointer.
00830
00831   Returns:  HRESULT
00832               Standard result code. NOERROR for success.
00833 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00834 STDMETHODIMP COConnectionPoint::GetConnectionPointContainer(
00835                IConnectionPointContainer** ppConnPtCon)
00836 {
00837   HRESULT hr;
00838
00839   // Use QueryInterface to get the interface pointer and to perform the
00840   // needed AddRef on the returned pointer.
00841   hr = m_pHostObj->QueryInterface(
00842                      IID_IConnectionPointContainer,
00843                      (PPVOID) ppConnPtCon);
00844
00845   return hr;
00846 }
00847
00848
00849 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00850   Method:   COConnectionPoint::Advise
00851
00852   Summary:  The Advise member method of this IConnectionPoint interface
00853             implementation. Called by clients to establish a connection of
00854             their sink to this connection point.
00855
00856   Args:     IUnknown* pUnkSink
00857               IUnknown interface pointer of the Sink object in the client.
00858             DWORD* pdwCookie
00859               Pointer to a DWORD in the client that will receive a unique
00860               key used by the client to refer to the connection established
00861               by this Advise call.
00862
00863   Returns:  HRESULT
00864               Standard result code. NOERROR for success.
00865 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00866 STDMETHODIMP COConnectionPoint::Advise(
00867                IUnknown* pUnkSink,
00868                DWORD* pdwCookie)
00869 {
00870   HRESULT hr = NOERROR;
00871   UINT uiFreeSlot = 0;
00872   IUnknown* pISink = NULL;
00873
00874   // Zero the output connection key.
00875   *pdwCookie = 0;
00876
00877   // Get the specific associated client Sink interface that this
00878   // connection point expects to use for notifications.
00879   hr = pUnkSink->QueryInterface(m_iidSink, (PPVOID)&pISink);
00880   if (SUCCEEDED(hr))
00881   {
00882     // Store the specific sink interface in this connection point's
00883     // array of live connections. First find a free slot (expand the
00884     // array if needed).
00885     hr = GetSlot(&uiFreeSlot);
00886     if (SUCCEEDED(hr))
00887     {
00888       // Assign the new slot with the connection entry.
00889       m_paConnections[uiFreeSlot].pUnk = pISink;
00890       m_paConnections[uiFreeSlot].dwCookie = m_dwNextCookie;
00891
00892       // Assign the output Cookie value.
00893       *pdwCookie = m_dwNextCookie;
00894
00895       // Increment the Cookie counter.
00896       m_dwNextCookie++;
00897
00898       // Increment the number of live connections.
00899       m_cConnections++;
00900     }
00901   }
00902   else if (hr == E_NOINTERFACE)
00903   {
00904      // The sink does not support m_iidSink.
00905      hr = CONNECT_E_CANNOTCONNECT;
00906   }
00907
00908   return hr;
00909 }
00910
00911
00912 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00913   Method:   COConnectionPoint::Unadvise
00914
00915   Summary:  The Unadvise member method of this IConnectionPoint interface
00916             implementation. Called by clients to disconnect a connection
00917             of their sink to this connection point. The connection is
00918             identified by the dwCookie argument (obtained by a previous
00919             Advise call).
00920
00921   Args:     DWORD dwCookie
00922               Connection key that was obtained by a previous Advise call.
00923
00924   Returns:  HRESULT
00925               Standard result code. NOERROR for success.
00926 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00927 STDMETHODIMP COConnectionPoint::Unadvise(
00928                DWORD dwCookie)
00929 {
00930   HRESULT hr = NOERROR;
00931   UINT uiSlot;
00932
00933   if (0 != dwCookie)
00934   {
00935     hr = FindSlot(dwCookie, &uiSlot);
00936     if (SUCCEEDED(hr))
00937     {
00938       // Release the sink interface.
00939       RELEASE_INTERFACE(m_paConnections[uiSlot].pUnk);
00940
00941       // Mark the array entry as empty.
00942       m_paConnections[uiSlot].dwCookie = 0;
00943
00944       // Decrement the number of live connections.
00945       m_cConnections--;
00946     }
00947   }
00948   else
00949     hr = E_INVALIDARG;
00950
00951   return hr;
00952 }
00953
00954
00955 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00956   Method:   COConnectionPoint::EnumConnections
00957
00958   Summary:  The EnumConnections member method of this IConnectionPoint
00959             interface implementation. Called to obtain an IEnumConnections
00960             enumerator interface that can be used to enumerate the
00961             connections of this connection point.
00962
00963   Args:     IEnumConnections** ppIEnum
00964               Address of the caller's output pointer variable that will
00965               receive the enumerator IEnumConnections interface pointer.
00966
00967   Returns:  HRESULT
00968               Standard result code. NOERROR for success.
00969 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00970 STDMETHODIMP COConnectionPoint::EnumConnections(
00971                IEnumConnections** ppIEnum)
00972 {
00973   HRESULT hr = OLE_E_NOCONNECTION;
00974   CONNECTDATA* paConns;
00975   COEnumConnections* pCOEnum;
00976   UINT i,j;
00977
00978   // Zero the output enumerator interface pointer.
00979   *ppIEnum = NULL;
00980
00981   if (0 != m_cConnections)
00982   {
00983     // Create an array of CONNECTDATA structures.
00984     paConns = new CONNECTDATA[(UINT)m_cConnections];
00985     if (NULL != paConns)
00986     {
00987       for (i=0, j=0; i<m_uiMaxIndex && j<m_cConnections; i++)
00988       {
00989         // Copy non-empty entries only.
00990         if (0 != m_paConnections[i].dwCookie)
00991         {
00992           // Assign the occupied entry.
00993           paConns[j].pUnk = (IUnknown*)m_paConnections[i].pUnk;
00994           paConns[j].dwCookie = m_paConnections[i].dwCookie;
00995           j++;
00996         }
00997       }
00998
00999       // Create a new COM object for enumerating connections. Pass
01000       // 'this' as a pHostObj pointer used later to ensure the host
01001       // connection point object stays alive as long as the enumerator
01002       // that enumerates connections to that connection point.
01003       pCOEnum = new COEnumConnections(this);
01004       if (NULL != pCOEnum)
01005       {
01006         // Use the previously constructed (paConns) array of connections
01007         // to init the new COEnumConnections COM object. The Init will
01008         // build yet another internal copy of this array. Set the
01009         // initial enumerator index to 0.
01010         hr = pCOEnum->Init(m_cConnections, paConns, 0);
01011
01012         // QueryInterface to return the requested interface pointer.
01013         // An AddRef will be conveniently done by the QI.
01014         if (SUCCEEDED(hr))
01015           hr = pCOEnum->QueryInterface(
01016                           IID_IEnumConnections,
01017                           (PPVOID)ppIEnum);
01018       }
01019       else
01020         hr = E_OUTOFMEMORY;
01021
01022       // We're done with the locally constructed array copy--delete it.
01023       delete [] paConns;
01024     }
01025     else
01026       hr = E_OUTOFMEMORY;
01027   }
01028
01029   return hr;
01030 }
01031
01032
01033 /*---------------------------------------------------------------------------
01034   COEnumConnections's implementation of its main COM object class
01035   including Constructor, Destructor, QueryInterface, AddRef, Release,
01036   Next, Skip, Reset, and Clone.
01037 ---------------------------------------------------------------------------*/
01038
01039 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01040   Method:   COEnumConnections::COEnumConnections
01041
01042   Summary:  COEnumConnections Constructor.
01043
01044   Args:     IUnknown* pHostObj
01045               Pointer to IUnknown interface of the host Connection Point
01046               COM object whose connections are being enumerated.
01047
01048   Modifies: m_cRefs, m_pHostObj, m_iEnumIndex, m_cConnections,
01049             and m_paConnections.
01050
01051   Returns:  void
01052 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01053 COEnumConnections::COEnumConnections(
01054   IUnknown* pHostObj)
01055 {
01056   // Zero the COM object's reference count.
01057   m_cRefs = 0;
01058
01059   // Assign the Host Object pointer.
01060   m_pHostObj = pHostObj;
01061
01062   // Initialize the Connection Point enumerator variables.
01063   m_iEnumIndex = 0;
01064   m_cConnections = 0;
01065   m_paConnections = NULL;
01066
01067   return;
01068 }
01069
01070
01071 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01072   Method:   COEnumConnections::~COEnumConnections
01073
01074   Summary:  COEnumConnections Destructor.
01075
01076   Args:     void
01077
01078   Modifies: m_paConnections.
01079
01080   Returns:  void
01081 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01082 COEnumConnections::~COEnumConnections(void)
01083 {
01084   if (NULL != m_paConnections)
01085   {
01086     UINT i;
01087
01088     // Release all the connected sink interface pointers.
01089     for (i=0; i<m_cConnections; i++)
01090       m_paConnections[i].pUnk->Release();
01091
01092     // Delete the array of connections.
01093     delete [] m_paConnections;
01094   }
01095
01096   return;
01097 }
01098
01099
01100 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01101   Method:   COEnumConnections::Init
01102
01103   Summary:  COEnumConnections Initialization method.  Create any
01104             necessary subordinate arrays, structures, and objects.
01105
01106   Args:     ULONG cConnections
01107               Number of Connections.
01108             CONNECTDATA* paConnections,
01109               Pointer to array of connections.
01110             ULONG iEnumIndex
01111               The Enumerator index initial value.
01112
01113   Modifies: m_cConnections, m_paConnections, m_pHostObj, m_iEnumIndex.
01114
01115   Returns:  HRESULT
01116               Standard result code. NOERROR for success.
01117 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01118 HRESULT COEnumConnections::Init(
01119           ULONG cConnections,
01120           CONNECTDATA* paConnections,
01121           ULONG iEnumIndex)
01122 {
01123   HRESULT hr = NOERROR;
01124   UINT i;
01125
01126   // Remember the number of live Connections.
01127   m_cConnections = cConnections;
01128
01129   // Remember the initial enumerator index.
01130   m_iEnumIndex = iEnumIndex;
01131
01132   // Create a copy of the array of connections and keep it inside
01133   // this enumerator COM object.
01134   m_paConnections = new CONNECTDATA [(UINT) cConnections];
01135
01136   // Fill the array copy with the connection data from the connections
01137   // array passed. AddRef for each new sink Interface pointer copy made.
01138   if (NULL != m_paConnections)
01139   {
01140     for (i=0; i<cConnections; i++)
01141     {
01142       m_paConnections[i] = paConnections[i];
01143       m_paConnections[i].pUnk->AddRef();
01144     }
01145   }
01146   else
01147     hr = E_OUTOFMEMORY;
01148
01149   return (hr);
01150 }
01151
01152
01153 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01154   Method:   COEnumConnections::QueryInterface
01155
01156   Summary:  QueryInterface of the COEnumConnections non-delegating
01157             IUnknown implementation.
01158
01159   Args:     REFIID riid,
01160               [in] GUID of the Interface being requested.
01161             PPVOID ppv)
01162               [out] Address of the caller's pointer variable that will
01163               receive the requested interface pointer.
01164
01165   Returns:  HRESULT
01166 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01167 STDMETHODIMP COEnumConnections::QueryInterface(
01168                REFIID riid,
01169                PPVOID ppv)
01170 {
01171   HRESULT hr = E_NOINTERFACE;
01172
01173   *ppv = NULL;
01174
01175   // The IEnumConnections interface is implemented directly in
01176   // this COM object rather than being a nested interface implementation.
01177   if (IID_IUnknown == riid || IID_IEnumConnections == riid)
01178     *ppv = (LPVOID)this;
01179
01180   if (NULL != *ppv)
01181   {
01182     // We've handed out a pointer to the interface so obey the COM rules
01183     // and AddRef the reference count.
01184     ((LPUNKNOWN)*ppv)->AddRef();
01185     hr = NOERROR;
01186   }
01187
01188   return (hr);
01189 }
01190
01191
01192 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01193   Method:   COEnumConnections::AddRef
01194
01195   Summary:  AddRef of the COEnumConnections non-delegating IUnknown
01196             implementation.
01197
01198   Args:     void
01199
01200   Modifies: m_cRefs.
01201
01202   Returns:  ULONG
01203               New value of m_cRefs (COM object's reference count).
01204 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01205 STDMETHODIMP_(ULONG) COEnumConnections::AddRef(void)
01206 {
01207   ULONG cRefs;
01208
01209   cRefs = ++m_cRefs;
01210
01211   // Also AddRef the host object to ensure it stays around as long as
01212   // this enumerator.
01213   m_pHostObj->AddRef();
01214
01215   return cRefs;
01216 }
01217
01218
01219 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01220   Method:   COEnumConnections::Release
01221
01222   Summary:  Release of the COEnumConnections non-delegating IUnknown
01223             implementation.
01224
01225   Args:     void
01226
01227   Modifies: m_cRefs.
01228
01229   Returns:  ULONG
01230               New value of m_cRefs (COM object's reference count).
01231 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01232 STDMETHODIMP_(ULONG) COEnumConnections::Release(void)
01233 {
01234   ULONG cRefs;
01235
01236   // Pass this release along to the Host object being enumerated.
01237   m_pHostObj->Release();
01238
01239   cRefs = --m_cRefs;
01240
01241   if (0 == cRefs)
01242   {
01243     // We artificially bump the main ref count to prevent reentrancy via
01244     // the main object destructor.
01245     m_cRefs++;
01246     delete this;
01247   }
01248
01249   return cRefs;
01250 }
01251
01252
01253 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01254   Method:   COEnumConnections::Next
01255
01256   Summary:  The Next member method of this IEnumConnections interface
01257             implementation. Called by outside clients of a
01258             COEnumConnections object to request a number of next
01259             connections be returned in an array supplied by the caller.
01260
01261   Args:     ULONG cReq
01262               Number of connection points requested for return (starting at
01263               the current Enumerator index).
01264             CONNECTDATA* paConnections,
01265               Pointer to a caller's output array that will receive the
01266               enumerated connection data structures.
01267             ULONG* pcEnumerated)
01268               Pointer to a ULONG variable that will contain the number of
01269               connection points actually enumerated by this call.
01270
01271   Returns:  HRESULT
01272               Standard result code. NOERROR for success.
01273 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01274 STDMETHODIMP COEnumConnections::Next(
01275                ULONG cReq,
01276                CONNECTDATA* paConnections,
01277                ULONG* pcEnumerated)
01278 {
01279   HRESULT hr = NOERROR;
01280   ULONG cRet = 0;
01281
01282   // Make sure the argument values passed are valid.
01283   if (NULL != m_paConnections)
01284   {
01285     if (NULL != paConnections)
01286     {
01287       if (m_iEnumIndex < m_cConnections)
01288       {
01289         if (NULL != pcEnumerated)
01290           *pcEnumerated = 0L;
01291         else
01292           if (1L != cReq)
01293             hr = E_POINTER;
01294       }
01295       else
01296         hr = S_FALSE;
01297     }
01298     else
01299       hr = E_POINTER;
01300   }
01301   else
01302     hr = S_FALSE;
01303
01304   if (SUCCEEDED(hr))
01305   {
01306     // Starting at the current Enumerator index, loop to assign the
01307     // requested number of output connection data structures.
01308     for (; m_iEnumIndex < m_cConnections && cReq > 0;
01309            paConnections++, m_iEnumIndex++, cRet++, cReq--)
01310     {
01311       // Because we are assigning a copy of a connection's data, AddRef
01312       // its sink interface pointer.
01313       if (NULL != m_paConnections[m_iEnumIndex].pUnk)
01314         m_paConnections[m_iEnumIndex].pUnk->AddRef();
01315
01316       // Assign a connection's data from the inside Enumerator array to
01317       // the specified output receiving array.
01318       *paConnections = m_paConnections[m_iEnumIndex];
01319     }
01320
01321     // Assign the output number of connections enumerated.
01322     if (NULL != pcEnumerated)
01323       *pcEnumerated = cRet;
01324   }
01325
01326   return hr;
01327 }
01328
01329
01330 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01331   Method:   COEnumConnections::Skip
01332
01333   Summary:  The Skip member method of this IEnumConnections interface
01334             implementation. Starting at the current Enumerator index, skip
01335             the specified number of connection items.
01336
01337   Args:     ULONG cSkip
01338               Number of Connection items to skip.
01339
01340   Returns:  HRESULT
01341               Standard result code. NOERROR for success.
01342 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01343 STDMETHODIMP COEnumConnections::Skip(
01344                ULONG cSkip)
01345 {
01346   HRESULT hr = NOERROR;
01347
01348   // If there really is a connection array and the requested
01349   // amount of skip does not exceed the number of connections,
01350   // then bump the index by the requested skip amount.
01351   if (NULL != m_paConnections && (m_iEnumIndex + cSkip) < m_cConnections)
01352     m_iEnumIndex += cSkip;
01353   else
01354     hr = S_FALSE;
01355
01356   return hr;
01357 }
01358
01359
01360 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01361   Method:   COEnumConnections::Reset
01362
01363   Summary:  The Reset member method of the IEnumConnections interface
01364             implementation. Resets the Enumeration index to the first
01365             connection item in the array.
01366
01367   Args:     void.
01368
01369   Returns:  HRESULT
01370               Standard result code. NOERROR for success.
01371 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01372 STDMETHODIMP COEnumConnections::Reset(
01373                void)
01374 {
01375   // Zero the main Enumerator index.
01376   m_iEnumIndex = 0;
01377
01378   return NOERROR;
01379 }
01380
01381
01382 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01383   Method:   COEnumConnections::Clone
01384
01385   Summary:  The Clone member method of this IEnumConnections interface
01386             implementation. Creates a new clone of this entire Connection
01387             enumerator COM object and returns a pointer to its
01388             IEnumConnections interface.
01389
01390   Args:     IEnumConnections** ppIEnum
01391               Address of the caller's output pointer variable that will
01392               receive the IEnumConnections interface pointer of the
01393               new enumerator clone.
01394
01395   Returns:  HRESULT
01396               Standard result code. NOERROR for success.
01397 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01398 STDMETHODIMP COEnumConnections::Clone(
01399                IEnumConnections** ppIEnum)
01400 {
01401   HRESULT hr;
01402   COEnumConnections* pCOEnum;
01403
01404   // NULL the output variable first.
01405   *ppIEnum = NULL;
01406
01407   // Create the Clone Enumerator COM object.
01408   pCOEnum = new COEnumConnections(m_pHostObj);
01409   if (NULL != pCOEnum)
01410   {
01411     // Initialize it with same values as in this existing enumerator.
01412     hr = pCOEnum->Init(m_cConnections, m_paConnections, m_iEnumIndex);
01413     if (SUCCEEDED(hr))
01414     {
01415       // QueryInterface to return the requested interface pointer.
01416       // An AddRef will be conveniently done by the QI.
01417       if (SUCCEEDED(hr))
01418         hr = pCOEnum->QueryInterface(
01419                         IID_IEnumConnections,
01420                         (PPVOID)ppIEnum);
01421     }
01422   }
01423   else
01424     hr = E_OUTOFMEMORY;
01425
01426   return hr;
01427 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/CommBand.Cpp Source File

  • WinUI
  • Shell
  • BandObjs

CommBand.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          CommBand.cpp
00013
00014    Description:   Implements CCommBand
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "CommBand.h"
00023 #include "Guid.h"
00024 #include <mshtmhst.h>
00025
00026 /**************************************************************************
00027
00028    CCommBand::CCommBand()
00029
00030 **************************************************************************/
00031
00032 CCommBand::CCommBand()
00033 {
00034 m_pSite = NULL;
00035
00036 m_hWnd = NULL;
00037 m_hwndParent = NULL;
00038
00039 m_bFocus = FALSE;
00040
00041 m_dwViewMode = 0;
00042 m_dwBandID = 0;
00043
00044 m_ObjRefCount = 1;
00045 g_DllRefCount++;
00046 }
00047
00048 /**************************************************************************
00049
00050    CCommBand::~CCommBand()
00051
00052 **************************************************************************/
00053
00054 CCommBand::~CCommBand()
00055 {
00056 //this should have been freed in a call to SetSite(NULL), but just to be safe
00057 if(m_pSite)
00058    {
00059    m_pSite->Release();
00060    m_pSite = NULL;
00061    }
00062
00063 g_DllRefCount--;
00064 }
00065
00066 ///////////////////////////////////////////////////////////////////////////
00067 //
00068 // IUnknown Implementation
00069 //
00070
00071 /**************************************************************************
00072
00073    CCommBand::QueryInterface
00074
00075 **************************************************************************/
00076
00077 STDMETHODIMP CCommBand::QueryInterface(REFIID riid, LPVOID *ppReturn)
00078 {
00079 *ppReturn = NULL;
00080
00081 //IUnknown
00082 if(IsEqualIID(riid, IID_IUnknown))
00083    {
00084    *ppReturn = this;
00085    }
00086
00087 //IOleWindow
00088 else if(IsEqualIID(riid, IID_IOleWindow))
00089    {
00090    *ppReturn = (IOleWindow*)this;
00091    }
00092
00093 //IDockingWindow
00094 else if(IsEqualIID(riid, IID_IDockingWindow))
00095    {
00096    *ppReturn = (IDockingWindow*)this;
00097    }
00098
00099 //IInputObject
00100 else if(IsEqualIID(riid, IID_IInputObject))
00101    {
00102    *ppReturn = (IInputObject*)this;
00103    }
00104
00105 //IObjectWithSite
00106 else if(IsEqualIID(riid, IID_IObjectWithSite))
00107    {
00108    *ppReturn = (IObjectWithSite*)this;
00109    }
00110
00111 //IDeskBand
00112 else if(IsEqualIID(riid, IID_IDeskBand))
00113    {
00114    *ppReturn = (IDeskBand*)this;
00115    }
00116
00117 //IPersist
00118 else if(IsEqualIID(riid, IID_IPersist))
00119    {
00120    *ppReturn = (IPersist*)this;
00121    }
00122
00123 //IPersistStream
00124 else if(IsEqualIID(riid, IID_IPersistStream))
00125    {
00126    *ppReturn = (IPersistStream*)this;
00127    }
00128
00129 //IDocHostUIHandler
00130 else if(IsEqualIID(riid, IID_IDocHostUIHandler))
00131    {
00132    MessageBeep(MB_OK);
00133    }
00134
00135 if(*ppReturn)
00136    {
00137    (*(LPUNKNOWN*)ppReturn)->AddRef();
00138    return S_OK;
00139    }
00140
00141 return E_NOINTERFACE;
00142 }
00143
00144 /**************************************************************************
00145
00146    CCommBand::AddRef
00147
00148 **************************************************************************/
00149
00150 STDMETHODIMP_(DWORD) CCommBand::AddRef()
00151 {
00152 return ++m_ObjRefCount;
00153 }
00154
00155
00156 /**************************************************************************
00157
00158    CCommBand::Release
00159
00160 **************************************************************************/
00161
00162 STDMETHODIMP_(DWORD) CCommBand::Release()
00163 {
00164 if(--m_ObjRefCount == 0)
00165    {
00166    delete this;
00167    return 0;
00168    }
00169
00170 return m_ObjRefCount;
00171 }
00172
00173 ///////////////////////////////////////////////////////////////////////////
00174 //
00175 // IOleWindow Implementation
00176 //
00177
00178 /**************************************************************************
00179
00180    CCommBand::GetWindow()
00181
00182 **************************************************************************/
00183
00184 STDMETHODIMP CCommBand::GetWindow(HWND *phWnd)
00185 {
00186 *phWnd = m_hWnd;
00187
00188 return S_OK;
00189 }
00190
00191 /**************************************************************************
00192
00193    CCommBand::ContextSensitiveHelp()
00194
00195 **************************************************************************/
00196
00197 STDMETHODIMP CCommBand::ContextSensitiveHelp(BOOL fEnterMode)
00198 {
00199 return E_NOTIMPL;
00200 }
00201
00202 ///////////////////////////////////////////////////////////////////////////
00203 //
00204 // IDockingWindow Implementation
00205 //
00206
00207 /**************************************************************************
00208
00209    CCommBand::ShowDW()
00210
00211 **************************************************************************/
00212
00213 STDMETHODIMP CCommBand::ShowDW(BOOL fShow)
00214 {
00215 if(m_hWnd)
00216    {
00217    if(fShow)
00218       {
00219       //show our window
00220       ShowWindow(m_hWnd, SW_SHOW);
00221       }
00222    else
00223       {
00224       //hide our window
00225       ShowWindow(m_hWnd, SW_HIDE);
00226       }
00227    }
00228
00229 return S_OK;
00230 }
00231
00232 /**************************************************************************
00233
00234    CCommBand::CloseDW()
00235
00236 **************************************************************************/
00237
00238 STDMETHODIMP CCommBand::CloseDW(DWORD dwReserved)
00239 {
00240 ShowDW(FALSE);
00241
00242 if(IsWindow(m_hWnd))
00243    DestroyWindow(m_hWnd);
00244
00245 m_hWnd = NULL;
00246
00247 return S_OK;
00248 }
00249
00250 /**************************************************************************
00251
00252    CCommBand::ResizeBorderDW()
00253
00254 **************************************************************************/
00255
00256 STDMETHODIMP CCommBand::ResizeBorderDW(   LPCRECT prcBorder,
00257                                           IUnknown* punkSite,
00258                                           BOOL fReserved)
00259 {
00260 /*
00261 This method is never called for Band Objects.
00262 */
00263 return E_NOTIMPL;
00264 }
00265
00266 ///////////////////////////////////////////////////////////////////////////
00267 //
00268 // IInputObject Implementation
00269 //
00270
00271 /**************************************************************************
00272
00273    CCommBand::UIActivateIO()
00274
00275 **************************************************************************/
00276
00277 STDMETHODIMP CCommBand::UIActivateIO(BOOL fActivate, LPMSG pMsg)
00278 {
00279 if(fActivate)
00280    SetFocus(m_hWnd);
00281
00282 return S_OK;
00283 }
00284
00285 /**************************************************************************
00286
00287    CCommBand::HasFocusIO()
00288
00289    If this window or one of its decendants has the focus, return S_OK. Return
00290    S_FALSE if we don't have the focus.
00291
00292 **************************************************************************/
00293
00294 STDMETHODIMP CCommBand::HasFocusIO(void)
00295 {
00296 if(m_bFocus)
00297    return S_OK;
00298
00299 return S_FALSE;
00300 }
00301
00302 /**************************************************************************
00303
00304    CCommBand::TranslateAcceleratorIO()
00305
00306    If the accelerator is translated, return S_OK or S_FALSE otherwise.
00307
00308 **************************************************************************/
00309
00310 STDMETHODIMP CCommBand::TranslateAcceleratorIO(LPMSG pMsg)
00311 {
00312 return S_FALSE;
00313 }
00314
00315 ///////////////////////////////////////////////////////////////////////////
00316 //
00317 // IObjectWithSite implementations
00318 //
00319
00320 /**************************************************************************
00321
00322    CCommBand::SetSite()
00323
00324 **************************************************************************/
00325
00326 STDMETHODIMP CCommBand::SetSite(IUnknown* punkSite)
00327 {
00328 //If a site is being held, release it.
00329 if(m_pSite)
00330    {
00331    m_pSite->Release();
00332    m_pSite = NULL;
00333    }
00334
00335 //If punkSite is not NULL, a new site is being set.
00336 if(punkSite)
00337    {
00338    //Get the parent window.
00339    IOleWindow  *pOleWindow;
00340
00341    m_hwndParent = NULL;
00342
00343    if(SUCCEEDED(punkSite->QueryInterface(IID_IOleWindow, (LPVOID*)&pOleWindow)))
00344       {
00345       pOleWindow->GetWindow(&m_hwndParent);
00346       pOleWindow->Release();
00347       }
00348
00349    if(!m_hwndParent)
00350       return E_FAIL;
00351
00352    if(!RegisterAndCreateWindow())
00353       return E_FAIL;
00354
00355    //Get and keep the IInputObjectSite pointer.
00356    if(SUCCEEDED(punkSite->QueryInterface(IID_IInputObjectSite, (LPVOID*)&m_pSite)))
00357       {
00358       return S_OK;
00359       }
00360
00361    return E_FAIL;
00362    }
00363
00364 return S_OK;
00365 }
00366
00367 /**************************************************************************
00368
00369    CCommBand::GetSite()
00370
00371 **************************************************************************/
00372
00373 STDMETHODIMP CCommBand::GetSite(REFIID riid, LPVOID *ppvReturn)
00374 {
00375 *ppvReturn = NULL;
00376
00377 if(m_pSite)
00378    return m_pSite->QueryInterface(riid, ppvReturn);
00379
00380 return E_FAIL;
00381 }
00382
00383 ///////////////////////////////////////////////////////////////////////////
00384 //
00385 // IDeskBand implementation
00386 //
00387
00388 /**************************************************************************
00389
00390    CCommBand::GetBandInfo()
00391
00392 **************************************************************************/
00393
00394 STDMETHODIMP CCommBand::GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO* pdbi)
00395 {
00396 if(pdbi)
00397    {
00398    m_dwBandID = dwBandID;
00399    m_dwViewMode = dwViewMode;
00400
00401    if(pdbi->dwMask & DBIM_MINSIZE)
00402       {
00403       pdbi->ptMinSize.x = 0;
00404       pdbi->ptMinSize.y = 30;
00405       }
00406
00407    if(pdbi->dwMask & DBIM_MAXSIZE)
00408       {
00409       pdbi->ptMaxSize.x = -1;
00410       pdbi->ptMaxSize.y = 30;
00411       }
00412
00413    if(pdbi->dwMask & DBIM_INTEGRAL)
00414       {
00415       pdbi->ptIntegral.x = 1;
00416       pdbi->ptIntegral.y = 1;
00417       }
00418
00419    if(pdbi->dwMask & DBIM_ACTUAL)
00420       {
00421       pdbi->ptActual.x = 0;
00422       pdbi->ptActual.y = 0;
00423       }
00424
00425    if(pdbi->dwMask & DBIM_TITLE)
00426       {
00427       lstrcpyW(pdbi->wszTitle, L"");
00428       }
00429
00430    if(pdbi->dwMask & DBIM_MODEFLAGS)
00431       {
00432       pdbi->dwModeFlags = DBIMF_NORMAL;
00433       }
00434
00435    if(pdbi->dwMask & DBIM_BKCOLOR)
00436       {
00437       //Use the default background color by removing this flag.
00438       pdbi->dwMask &= ~DBIM_BKCOLOR;
00439       }
00440
00441    return S_OK;
00442    }
00443
00444 return E_INVALIDARG;
00445 }
00446
00447 ///////////////////////////////////////////////////////////////////////////
00448 //
00449 // IPersistStream implementations
00450 //
00451 // This is only supported to allow the desk band to be dropped on the
00452 // desktop and to prevent multiple instances of the desk band from showing
00453 // up in the context menu. This desk band doesn't actually persist any data.
00454 //
00455
00456 /**************************************************************************
00457
00458    CCommBand::GetClassID()
00459
00460 **************************************************************************/
00461
00462 STDMETHODIMP CCommBand::GetClassID(LPCLSID pClassID)
00463 {
00464 *pClassID = CLSID_SampleCommBand;
00465
00466 return S_OK;
00467 }
00468
00469 /**************************************************************************
00470
00471    CCommBand::IsDirty()
00472
00473 **************************************************************************/
00474
00475 STDMETHODIMP CCommBand::IsDirty(void)
00476 {
00477 return S_FALSE;
00478 }
00479
00480 /**************************************************************************
00481
00482    CCommBand::Load()
00483
00484 **************************************************************************/
00485
00486 STDMETHODIMP CCommBand::Load(LPSTREAM pStream)
00487 {
00488 return S_OK;
00489 }
00490
00491 /**************************************************************************
00492
00493    CCommBand::Save()
00494
00495 **************************************************************************/
00496
00497 STDMETHODIMP CCommBand::Save(LPSTREAM pStream, BOOL fClearDirty)
00498 {
00499 return S_OK;
00500 }
00501
00502 /**************************************************************************
00503
00504    CCommBand::GetSizeMax()
00505
00506 **************************************************************************/
00507
00508 STDMETHODIMP CCommBand::GetSizeMax(ULARGE_INTEGER *pul)
00509 {
00510 return E_NOTIMPL;
00511 }
00512
00513 ///////////////////////////////////////////////////////////////////////////
00514 //
00515 // private method implementations
00516 //
00517
00518 /**************************************************************************
00519
00520    CCommBand::WndProc()
00521
00522 **************************************************************************/
00523
00524 LRESULT CALLBACK CCommBand::WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
00525 {
00526 CCommBand  *pThis = (CCommBand*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
00527
00528 switch (uMessage)
00529    {
00530    case WM_NCCREATE:
00531       {
00532       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00533       pThis = (CCommBand*)(lpcs->lpCreateParams);
00534       SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pThis);
00535
00536       //set the window handle
00537       pThis->m_hWnd = hWnd;
00538       }
00539       break;
00540
00541    case WM_PAINT:
00542       return pThis->OnPaint();
00543
00544    case WM_COMMAND:
00545       return pThis->OnCommand(wParam, lParam);
00546
00547    case WM_SETFOCUS:
00548       return pThis->OnSetFocus();
00549
00550    case WM_KILLFOCUS:
00551       return pThis->OnKillFocus();
00552    }
00553
00554 return DefWindowProc(hWnd, uMessage, wParam, lParam);
00555 }
00556
00557 /**************************************************************************
00558
00559    CCommBand::OnPaint()
00560
00561 **************************************************************************/
00562
00563 LRESULT CCommBand::OnPaint(void)
00564 {
00565 PAINTSTRUCT ps;
00566 RECT        rc;
00567
00568 BeginPaint(m_hWnd, &ps);
00569
00570 GetClientRect(m_hWnd, &rc);
00571 SetTextColor(ps.hdc, RGB(0, 0, 0));
00572 SetBkMode(ps.hdc, TRANSPARENT);
00573 DrawText(ps.hdc, TEXT("Sample Comm Band"), -1, &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
00574
00575 EndPaint(m_hWnd, &ps);
00576
00577 return 0;
00578 }
00579
00580 /**************************************************************************
00581
00582    CCommBand::OnCommand()
00583
00584 **************************************************************************/
00585
00586 LRESULT CCommBand::OnCommand(WPARAM wParam, LPARAM lParam)
00587 {
00588 return 0;
00589 }
00590
00591 /**************************************************************************
00592
00593    CCommBand::FocusChange()
00594
00595 **************************************************************************/
00596
00597 void CCommBand::FocusChange(BOOL bFocus)
00598 {
00599 m_bFocus = bFocus;
00600
00601 //inform the input object site that the focus has changed
00602 if(m_pSite)
00603    {
00604    m_pSite->OnFocusChangeIS((IDockingWindow*)this, bFocus);
00605    }
00606 }
00607
00608 /**************************************************************************
00609
00610    CCommBand::OnSetFocus()
00611
00612 **************************************************************************/
00613
00614 LRESULT CCommBand::OnSetFocus(void)
00615 {
00616 FocusChange(TRUE);
00617
00618 return 0;
00619 }
00620
00621 /**************************************************************************
00622
00623    CCommBand::OnKillFocus()
00624
00625 **************************************************************************/
00626
00627 LRESULT CCommBand::OnKillFocus(void)
00628 {
00629 FocusChange(FALSE);
00630
00631 return 0;
00632 }
00633
00634 /**************************************************************************
00635
00636    CCommBand::RegisterAndCreateWindow()
00637
00638 **************************************************************************/
00639
00640 BOOL CCommBand::RegisterAndCreateWindow(void)
00641 {
00642 //If the window doesn't exist yet, create it now.
00643 if(!m_hWnd)
00644    {
00645    //Can't create a child window without a parent.
00646    if(!m_hwndParent)
00647       {
00648       return FALSE;
00649       }
00650
00651    //If the window class has not been registered, then do so.
00652    WNDCLASS wc;
00653    if(!GetClassInfo(g_hInst, CB_CLASS_NAME, &wc))
00654       {
00655       ZeroMemory(&wc, sizeof(wc));
00656       wc.style          = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
00657       wc.lpfnWndProc    = (WNDPROC)WndProc;
00658       wc.cbClsExtra     = 0;
00659       wc.cbWndExtra     = 0;
00660       wc.hInstance      = g_hInst;
00661       wc.hIcon          = NULL;
00662       wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00663       wc.hbrBackground  = (HBRUSH)CreateSolidBrush(RGB(0, 192, 0));
00664       wc.lpszMenuName   = NULL;
00665       wc.lpszClassName  = CB_CLASS_NAME;
00666
00667       if(!RegisterClass(&wc))
00668          {
00669          //If RegisterClass fails, CreateWindow below will fail.
00670          }
00671       }
00672
00673    RECT  rc;
00674
00675    GetClientRect(m_hwndParent, &rc);
00676
00677    //Create the window. The WndProc will set m_hWnd.
00678    CreateWindowEx(   0,
00679                      CB_CLASS_NAME,
00680                      NULL,
00681                      WS_CHILD | WS_CLIPSIBLINGS | WS_BORDER,
00682                      rc.left,
00683                      rc.top,
00684                      rc.right - rc.left,
00685                      rc.bottom - rc.top,
00686                      m_hwndParent,
00687                      NULL,
00688                      g_hInst,
00689                      (LPVOID)this);
00690
00691    }
00692
00693 return (NULL != m_hWnd);
00694 }
00695
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/LoginDlg.h Source File

  • NetDS
  • MessageQueuing
  • c_draw

LoginDlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // logindlg.h : header file
00013 //
00014 //
00015
00016
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CLoginDlg dialog
00020
00021 class CLoginDlg : public CDialog
00022 {
00023 // Construction
00024 public:
00025   CLoginDlg(CWnd* pParent = NULL);   // standard constructor
00026
00027 // Dialog Data
00028   //{{AFX_DATA(CLoginDlg)
00029   enum { IDD = IDD_LOGIN };
00030   CString m_strLogin;
00031   //}}AFX_DATA
00032
00033
00034 // Overrides
00035   // ClassWizard generated virtual function overrides
00036   //{{AFX_VIRTUAL(CLoginDlg)
00037   protected:
00038   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00039   //}}AFX_VIRTUAL
00040
00041 // Implementation
00042 protected:
00043
00044   // Generated message map functions
00045   //{{AFX_MSG(CLoginDlg)
00046     // NOTE: the ClassWizard will add member functions here
00047   //}}AFX_MSG
00048   DECLARE_MESSAGE_MAP()
00049 };
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditCommands/BrowserHost.h Source File

  • Web
  • Browser
  • EditCommands

BrowserHost.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // BrowserHost.h : Declaration of the CBrowserHost
00006
00007 #ifndef __BROWSERHOST_H_
00008 #define __BROWSERHOST_H_
00009
00010 #include "resource.h"       // main symbols
00011 #include <commctrl.h>
00012 #include <atlwin.h>
00013 #include <exdisp.h>
00014 #include <mshtml.h>
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // CBrowserHost
00018 class ATL_NO_VTABLE CBrowserHost :
00019   public CComObjectRootEx<CComSingleThreadModel>,
00020   public CComCoClass<CBrowserHost, &CLSID_BrowserHost>,
00021   public IDispatchImpl<IBrowserHost, &IID_IBrowserHost, &LIBID_EDCOMMANDSLib>,
00022   public CWindowImpl<CBrowserHost>,
00023   public IOleClientSite,
00024   public IOleInPlaceSite
00025
00026 {
00027 public:
00028   CBrowserHost() :
00029     m_bInPlaceActive(FALSE),
00030     m_lLeftBandWidth(180),
00031     m_lTopBandHeight(35),
00032     m_dwCookie(NULL),
00033     m_dwCookie2(NULL),
00034     m_bIsChecked(FALSE), // for check box state
00035     m_wndTopBand(_T("Static"), this, 0),
00036     m_wndLeftBand(_T("Static"), this, 0),
00037     m_wndButton1(_T("Button"), this, 0),
00038     m_wndButton2(_T("Button"), this, 0),
00039     m_wndButton3(_T("Button"), this, 0),
00040     m_wndButton4(_T("Button"), this, 0),
00041     m_wndButton5(_T("Button"), this, 0),
00042     m_wndButton6(_T("Button"), this, 0),
00043     m_wndButton7(_T("Button"), this, 0),
00044     m_wndCheckBox(_T("Button"), this, 0),
00045     m_wndAddressBox(_T("ComboBox"), this, 1),
00046     m_wndBox1(_T("ComboBox"), this, 2),
00047     m_wndBox2(_T("ComboBox"), this, 3),
00048     m_wndBox3(_T("ComboBox"), this, 4),
00049     m_wndBox4(_T("ComboBox"), this, 5)
00050   {
00051   }
00052
00053 DECLARE_REGISTRY_RESOURCEID(IDR_BROWSERHOST)
00054
00055 DECLARE_PROTECT_FINAL_CONSTRUCT()
00056
00057 BEGIN_COM_MAP(CBrowserHost)
00058   COM_INTERFACE_ENTRY(IBrowserHost)
00059   COM_INTERFACE_ENTRY(IDispatch)
00060   COM_INTERFACE_ENTRY(IOleClientSite)
00061   COM_INTERFACE_ENTRY(IOleWindow)
00062   COM_INTERFACE_ENTRY(IOleInPlaceSite)
00063 END_COM_MAP()
00064
00065 BEGIN_MSG_MAP(CBrowserHost)
00066   MESSAGE_HANDLER(WM_CREATE, OnCreate)
00067   MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
00068   MESSAGE_HANDLER(WM_SIZE, OnSize)
00069   MESSAGE_HANDLER(WM_KEYDOWN,   OnKeydown)
00070
00071   // Button message handlers
00072   COMMAND_ID_HANDLER(ID_BUTTON1, OnButton1)
00073   COMMAND_ID_HANDLER(ID_BUTTON2, OnButton2)
00074   COMMAND_ID_HANDLER(ID_BUTTON3, OnButton3)
00075   COMMAND_ID_HANDLER(ID_BUTTON4, OnButton4)
00076   COMMAND_ID_HANDLER(ID_BUTTON5, OnButton5)
00077   COMMAND_ID_HANDLER(ID_BUTTON6, OnButton6)
00078   COMMAND_ID_HANDLER(ID_BUTTON7, OnButton7)
00079   COMMAND_ID_HANDLER(ID_CHECKBOX, OnCheckBox)
00080
00081   // Combobox message handlers
00082   ALT_MSG_MAP(1) // For subclassed window - m_wndAddressBox
00083   MESSAGE_HANDLER(WM_KEYDOWN, OnAddressBox)
00084
00085   ALT_MSG_MAP(2) // For subclassed window - m_wndBox1
00086   MESSAGE_HANDLER(WM_KEYDOWN, OnBox1)
00087
00088   ALT_MSG_MAP(3) // For subclassed window - m_wndBox2
00089   MESSAGE_HANDLER(WM_KEYDOWN, OnBox2)
00090
00091   ALT_MSG_MAP(4) // For subclassed window - m_wndBox3
00092   MESSAGE_HANDLER(WM_KEYDOWN, OnBox3)
00093
00094   ALT_MSG_MAP(5) // For subclassed window - m_wndBox4
00095   MESSAGE_HANDLER(WM_KEYDOWN, OnBox4)
00096
00097 END_MSG_MAP()
00098
00099 private:
00100   BOOL        m_bInPlaceActive;
00101   LONG        m_lTopBandHeight;
00102   LONG        m_lLeftBandWidth;
00103   DWORD       m_dwCookie; // for connection point to WebBrowserEvents2
00104   DWORD       m_dwCookie2; // for connection point to HTMLDocumentEvents2
00105   BOOL        m_bIsChecked; // for check box state
00106   CWindow       m_wndStatusBar;
00107   CContainedWindow  m_wndTopBand;
00108   CContainedWindow  m_wndLeftBand;
00109   CContainedWindow  m_wndButton1;
00110   CContainedWindow  m_wndButton2;
00111   CContainedWindow  m_wndButton3;
00112   CContainedWindow  m_wndButton4;
00113   CContainedWindow  m_wndButton5;
00114   CContainedWindow  m_wndButton6;
00115   CContainedWindow  m_wndButton7;
00116   CContainedWindow  m_wndAddressBox;
00117   CContainedWindow  m_wndCheckBox;
00118   CContainedWindow  m_wndBox1;
00119   CContainedWindow  m_wndBox2;
00120   CContainedWindow  m_wndBox3;
00121   CContainedWindow  m_wndBox4;
00122   CComQIPtr<IWebBrowser2, &IID_IWebBrowser2> m_spWebBrowser;
00123   CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> m_spDoc;
00124   CComQIPtr<IOleInPlaceObject, &IID_IOleInPlaceObject> m_spInPlaceObject;
00125   CComQIPtr<IOleCommandTarget, &IID_IOleCommandTarget> m_spOleCmdTarg;
00126
00127   // Message handlers
00128   LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00129   LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00130   LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00131   LRESULT OnKeydown(UINT, WPARAM wParam, LPARAM lParam, BOOL&);
00132
00133   LRESULT OnButton1(WORD, WORD, HWND, BOOL&);
00134   LRESULT OnButton2(WORD, WORD, HWND, BOOL&);
00135   LRESULT OnButton3(WORD, WORD, HWND, BOOL&);
00136   LRESULT OnButton4(WORD, WORD, HWND, BOOL&);
00137   LRESULT OnButton5(WORD, WORD, HWND, BOOL&);
00138   LRESULT OnButton6(WORD, WORD, HWND, BOOL&);
00139   LRESULT OnButton7(WORD, WORD, HWND, BOOL&);
00140   LRESULT OnCheckBox(WORD, WORD, HWND, BOOL&);
00141   LRESULT OnAddressBox(UINT, WPARAM, LPARAM, BOOL&);
00142   LRESULT OnBox1(UINT, WPARAM, LPARAM, BOOL&);
00143   LRESULT OnBox2(UINT, WPARAM, LPARAM, BOOL&);
00144   LRESULT OnBox3(UINT, WPARAM, LPARAM, BOOL&);
00145   LRESULT OnBox4(UINT, WPARAM, LPARAM, BOOL&);
00146
00147 // IBrowserHost
00148 public:
00149   STDMETHOD(Run)();
00150   STDMETHOD(Stop)();
00151
00152 // IDispatch Methods
00153 private:
00154   STDMETHOD(Invoke)(DISPID dispidMember,
00155             REFIID riid,
00156             LCID lcid,
00157             WORD wFlags,
00158             DISPPARAMS* pdispparams,
00159             VARIANT * pvarResult,
00160             EXCEPINFO* pexcepinfo,
00161             UINT* puArgErr);
00162
00163 // IOleClientSite Methods
00164 private:
00165   STDMETHOD(SaveObject)(void) {return E_NOTIMPL;}
00166   STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) {return E_NOTIMPL;}
00167   STDMETHOD(GetContainer)(IOleContainer **ppContainer) {return E_NOTIMPL;}
00168   STDMETHOD(ShowObject)(void) {return E_NOTIMPL;}
00169   STDMETHOD(OnShowWindow)(BOOL fShow) {return E_NOTIMPL;}
00170   STDMETHOD(RequestNewObjectLayout)(void) {return E_NOTIMPL;}
00171
00172 // IOleWindow Methods
00173 private:
00174   STDMETHOD(GetWindow)(HWND *phwnd)
00175   {
00176      *phwnd = m_hWnd;
00177     return S_OK;
00178   }
00179
00180    STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) {return E_NOTIMPL;}
00181
00182
00183 // IOleInPlaceSite Methods
00184 private:
00185   STDMETHOD(CanInPlaceActivate)() {return S_OK;}
00186
00187   STDMETHOD(OnInPlaceActivate)()
00188   {
00189       m_bInPlaceActive = TRUE;
00190       return S_OK;
00191   }
00192
00193   STDMETHOD(GetWindowContext)(IOleInPlaceFrame** ppFrame,
00194                 IOleInPlaceUIWindow** ppDoc,
00195                 LPRECT lprcPosRect,
00196                 LPRECT lprcClipRect,
00197                 LPOLEINPLACEFRAMEINFO lpFrameInfo)
00198   {
00199     GetClientRect(lprcPosRect);
00200     GetClientRect(lprcClipRect);
00201     return S_OK;
00202   }
00203
00204   STDMETHOD(OnInPlaceDeactivate)()
00205   {
00206     m_bInPlaceActive = FALSE;
00207     return S_OK;
00208   }
00209
00210   STDMETHOD(OnUIActivate)() {return E_NOTIMPL;}
00211   STDMETHOD(Scroll)(SIZE scrollExtant) {return E_NOTIMPL;}
00212   STDMETHOD(OnUIDeactivate)(BOOL fUndoable) {return E_NOTIMPL;}
00213   STDMETHOD(DiscardUndoState)() {return E_NOTIMPL;}
00214   STDMETHOD(DeactivateAndUndo)( void) {return E_NOTIMPL;}
00215   STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect) {return E_NOTIMPL;}
00216
00217 };
00218
00219 #endif //__BROWSERHOST_H_
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/ICatalogCollection.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

ICatalogCollection.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface ICatalogCollection
00019 /** @com.interface(iid=6EB22872-8A19-11D0-81B6-00A0C9231C29, thread=AUTO, type=DUAL) */
00020 public interface ICatalogCollection extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=4294967292, type=PROPGET, name="_NewEnum", addFlagsVtable=4)
00023       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00024   public IUnknown get_NewEnum();
00025
00026   /** @com.method(vtoffset=5, dispid=1, type=PROPGET, name="Item", addFlagsVtable=4)
00027       @com.parameters([in,type=I4] lIndex, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00028   public Object getItem(int lIndex);
00029
00030   /** @com.method(vtoffset=6, dispid=1610743810, type=PROPGET, name="Count", addFlagsVtable=4)
00031       @com.parameters([type=I4] return) */
00032   public int getCount();
00033
00034   /** @com.method(vtoffset=7, dispid=1610743811, type=METHOD, name="Remove", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] lIndex) */
00036   public void Remove(int lIndex);
00037
00038   /** @com.method(vtoffset=8, dispid=1610743812, type=METHOD, name="Add", addFlagsVtable=4)
00039       @com.parameters([iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00040   public Object Add();
00041
00042   /** @com.method(vtoffset=9, dispid=2, type=METHOD, name="Populate", addFlagsVtable=4)
00043       @com.parameters() */
00044   public void Populate();
00045
00046   /** @com.method(vtoffset=10, dispid=3, type=METHOD, name="SaveChanges", addFlagsVtable=4)
00047       @com.parameters([type=I4] return) */
00048   public int SaveChanges();
00049
00050   /** @com.method(vtoffset=11, dispid=4, type=METHOD, name="GetCollection", addFlagsVtable=4)
00051       @com.parameters([in,type=STRING] bstrCollName, [in,type=VARIANT] varObjectKey, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00052   public Object GetCollection(String bstrCollName, Variant varObjectKey);
00053
00054   /** @com.method(vtoffset=12, dispid=6, type=PROPGET, name="Name", addFlagsVtable=4)
00055       @com.parameters([type=VARIANT] return) */
00056   public Variant getName();
00057
00058   /** @com.method(vtoffset=13, dispid=7, type=PROPGET, name="AddEnabled", addFlagsVtable=4)
00059       @com.parameters([type=BOOLEAN] return) */
00060   public boolean getAddEnabled();
00061
00062   /** @com.method(vtoffset=14, dispid=8, type=PROPGET, name="RemoveEnabled", addFlagsVtable=4)
00063       @com.parameters([type=BOOLEAN] return) */
00064   public boolean getRemoveEnabled();
00065
00066   /** @com.method(vtoffset=15, dispid=9, type=METHOD, name="GetUtilInterface", addFlagsVtable=4)
00067       @com.parameters([iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00068   public Object GetUtilInterface();
00069
00070   /** @com.method(vtoffset=16, dispid=10, type=PROPGET, name="DataStoreMajorVersion", addFlagsVtable=4)
00071       @com.parameters([type=I4] return) */
00072   public int getDataStoreMajorVersion();
00073
00074   /** @com.method(vtoffset=17, dispid=11, type=PROPGET, name="DataStoreMinorVersion", addFlagsVtable=4)
00075       @com.parameters([type=I4] return) */
00076   public int getDataStoreMinorVersion();
00077
00078   /** @com.method(vtoffset=18, dispid=12, type=METHOD, name="PopulateByKey", addFlagsVtable=4)
00079       @com.parameters([in,vt=12,type=SAFEARRAY] aKeys) */
00080   public void PopulateByKey(com.ms.com.SafeArray aKeys);
00081
00082   /** @com.method(vtoffset=19, dispid=13, type=METHOD, name="PopulateByQuery", addFlagsVtable=4)
00083       @com.parameters([in,type=STRING] bstrQueryString, [in,type=I4] lQueryType) */
00084   public void PopulateByQuery(String bstrQueryString, int lQueryType);
00085
00086
00087   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x6eb22872, (short)0x8a19, (short)0x11d0, (byte)0x81, (byte)0xb6, (byte)0x0, (byte)0xa0, (byte)0xc9, (byte)0x23, (byte)0x1c, (byte)0x29);
00088 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/MessageDlg.h Source File

  • WinBase
  • WtsApi
  • WtsApi

MessageDlg.h

Go to the documentation of this file.
00001 //  Copyright 1995-1999, Citrix Systems Inc.
00002 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00003 #if !defined(AFX_MESSAGEDLG_H__4CE42083_334F_11D1_8311_00C04FBEFCDA__INCLUDED_)
00004 #define AFX_MESSAGEDLG_H__4CE42083_334F_11D1_8311_00C04FBEFCDA__INCLUDED_
00005
00006 #if _MSC_VER >= 1000
00007 #pragma once
00008 #endif // _MSC_VER >= 1000
00009 // MessageDlg.h : header file
00010 //
00011
00012 /////////////////////////////////////////////////////////////////////////////
00013 // CMessageDlg dialog
00014
00015 class CMessageDlg : public CDialog
00016 {
00017 // Construction
00018 public:
00019   CMessageDlg(CWnd* pParent = NULL);   // standard constructor
00020
00021 // Dialog Data
00022   //{{AFX_DATA(CMessageDlg)
00023   enum { IDD = IDD_SEND_MESSAGE };
00024   CEdit m_serverName;
00025   CEdit m_sendMessage;
00026   CString m_message;
00027   //}}AFX_DATA
00028
00029
00030 // Overrides
00031   // ClassWizard generated virtual function overrides
00032   //{{AFX_VIRTUAL(CMessageDlg)
00033   protected:
00034   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00035   //}}AFX_VIRTUAL
00036
00037 // Implementation
00038 protected:
00039
00040   // Generated message map functions
00041   //{{AFX_MSG(CMessageDlg)
00042   afx_msg void OnSendMessage();
00043   virtual BOOL OnInitDialog();
00044   //}}AFX_MSG
00045   DECLARE_MESSAGE_MAP()
00046 };
00047
00048 //{{AFX_INSERT_LOCATION}}
00049 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00050
00051 #endif // !defined(AFX_MESSAGEDLG_H__4CE42083_334F_11D1_8311_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/registry.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091         _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124         _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,         // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154         MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/ComPerf/ComPerf.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • ComPerf

ComPerf.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define PURPOSE "This is the reference performance sample for COM/DCOM run on local\n\
00018 and remote machines. This program is both a client and a server.\n\
00019 It launches as a client by default, registering its executable as a\n\
00020 server with COM and creating other instances of itself on a remote and\n\
00021 local machine to be servers. A single command-line argument is allowed\n\
00022 for a remote server name. Performance numbers in calls/sec are output\n\
00023 in tabular form. Tests COM and IDispatch method calls with two security\n\
00024 levels: default/min and full. Use DCOMCNFG to set default security to \n\
00025 Authn Lvl to NONE for best comparison. Parameter sizes are varied to see\n\
00026 effect on security levels(~4/50/4k bytes). Uses psoleperf.dll MIDL generated\n\
00027 proxy/stub implementation. Put pscomperf.dll in same dir as this exe on\n\
00028 all machines. Run exe on each machine to automatically register class code\n\
00029 and proxy/stub dll. You can then run on either machine and pass a remote\n\
00030 machine name (DNS or IP address) as single cmd-line parameter.\n\n"
00031
00032 // Instructions:
00033 // Install on one or more machines as described above. Run on command-line as "comperf".
00034 // A single command-line argument is allowed for a remote server name. E.g.
00035 // "comperf MyComputer" or "comperf 123.44.44.234" using IP address.
00036 // This sample may be compiled as UNICODE or ANSI
00037 //
00038 // Copyright 1996 Microsoft Corporation.  All Rights Reserved.
00039 // ===========================================================================
00040
00041 // %%Includes: ---------------------------------------------------------------
00042 #define _WIN32_WINNT 0x0400
00043 #define INC_OLE2
00044 #define STRICT
00045 #define LOOPS 2000  // default number of test function calls
00046 #include <windows.h>
00047 #include <initguid.h>
00048 #include <tchar.h>
00049 #include <stdio.h>
00050 #include "psperf.h" // MIDL generated header
00051
00052 // %%Constants: --------------------------------------------------------------
00053 #define cServerThreads  3 // number support threads each server will generate
00054 #define dispidICOMPerformance_Test1  11
00055 #define dispidICOMPerformance_Test23  12
00056 #define szTitleServer   TEXT("SERVER: COM Performance Sample")
00057 #define szTitleClient   TEXT("COM Performance Sample")
00058 const LARGE_INTEGER     bZero = {0,0};
00059
00060 // %%IDispatch support
00061 PARAMDATA paramdata[2] = {{L"i", VT_I4},{L"bstr", VT_BSTR}};
00062 METHODDATA methoddata[2] = {{L"Test1", &paramdata[0], 11, 3, CC_CDECL, 1, DISPATCH_METHOD, VT_I4},
00063       {L"Test23", &paramdata[1], 12, 4, CC_CDECL, 1, DISPATCH_METHOD, VT_I4}};
00064 INTERFACEDATA interfacedata = { methoddata, 2 };
00065
00066 // %%Guids: ------------------------------------------------------------------
00067 // {DDC68870-E08E-11cf-A535-00AA00615B03}
00068 DEFINE_GUID(CLSID_CTestCOMPerformance,0xddc68870,0xe08e,0x11cf,0xa5,0x35,0x0,0xaa,0x0,0x61,0x5b,0x3);
00069
00070 // %%typedefs: --------------------------------------------------------------
00071 typedef HRESULT (WINAPI *LPFNREG)();
00072 typedef struct  perf
00073 {
00074     TCHAR   *szTest;
00075     float    sec[3]; // time for all three methods in ICOMPerformance
00076 } PERF;
00077
00078 // %%Globals: ----------------------------------------------------------------
00079 BOOL        vfServer = FALSE;               // is this instance a server or client?
00080 BOOL        vfRemote = FALSE;               // is there a remote server?
00081 HANDLE      vrghThread[cServerThreads];     // worker thread handles
00082 DWORD       vrgtid[cServerThreads];         // worker thread id's
00083 HANDLE      vrghEvent[cServerThreads];      // creation event for each worker
00084 HANDLE          vhEventCliDone;
00085 HANDLE      vhEventServer;                  // creation-complete event for class-factory
00086 HANDLE          vhEventCliStart;
00087 HANDLE          hKillSvr;                       // shuts down the server
00088 UINT        viNextThread;                   // next worker to create an object on
00089 UINT            g_cObjectCount = 0;
00090 LPSTREAM    vpstmMarshalling;               // scratch stream used for cross-apt marshalling
00091 HRESULT     vhrThreadStatus;                // signals status to class-factory
00092
00093 LPWSTR pszDesc1 = L"String is passed to Test methd of ICOMPerformance";
00094
00095 PERF    vrgperfloc[] = {
00096     { TEXT("COM FreeToApt"), {-1.0f,-1.0f,-1.0f}},
00097     { TEXT("IDisp FreeToApt"), {-1.0f,-1.0f,-1.0f}},
00098     { TEXT("COM FreeTo Free"), {-1.0f,-1.0f,-1.0f}},
00099     { TEXT("IDispFreeToFree"), {-1.0f,-1.0f,-1.0f}},
00100     { TEXT("COM AptToApt"), {-1.0f,-1.0f,-1.0f}},
00101     { TEXT("IDispAptToApt"), {-1.0f,-1.0f,-1.0f}},
00102     { NULL, {-1.0f,-1.0f,-1.0f}} };
00103
00104 PERF    vrgperfrmt[] = {
00105     { TEXT("COM FreeToApt"), {-1.0f,-1.0f,-1.0f}},
00106     { TEXT("IDisp FreeToApt"), {-1.0f,-1.0f,-1.0f}},
00107     { TEXT("COM FreeTo Free"), {-1.0f,-1.0f,-1.0f}},
00108     { TEXT("IDispFreeToFree"), {-1.0f,-1.0f,-1.0f}},
00109     { TEXT("COM AptToApt"), {-1.0f,-1.0f,-1.0f}},
00110     { TEXT("IDispAptToApt"), {-1.0f,-1.0f,-1.0f}},
00111     { NULL, {-1.0f,-1.0f,-1.0f}} };
00112
00113 // %%Prototypes: -------------------------------------------------------------
00114 LRESULT     ServerThreadProc(LPARAM lParam);
00115 LRESULT     ClientThreadProc(LPARAM lParam);
00116 BOOL        FAutoRegister();
00117 void            Message(LPTSTR szPrefix, HRESULT hr);
00118 void            FPrintResults(void);
00119 BOOL        AptFreeCOMTest(int cLoops);
00120 BOOL            AptFreeAutoTest(int cLoops);
00121 BOOL            FreeFreeCOMTest(int cLoops);
00122 BOOL            FreeFreeAutoTest(int cLoops);
00123 BOOL            DoTests(void);
00124 void            Usage(void);
00125
00126 typedef IClientSecurity *LPCLIENTSECURITY;
00127 typedef ICOMPerformance *LPCOMPERFORMANCE;
00128 LPCOMPERFORMANCE pCOMApt, pCOMFree, pCOMAptRmt, pCOMFreeRmt;
00129 LPDISPATCH pAutoApt, pAutoFree, pAutoAptRmt, pAutoFreeRmt;
00130
00131 // %%Classes: ----------------------------------------------------------------
00132 // the class-factory object exists in the main application apartment/thread
00133 // and is used to create instances of the worker objects on worker threads.
00134 class CClassFactory : public IClassFactory
00135 {
00136 public:
00137   // IClassFactory
00138     STDMETHODIMP            QueryInterface(REFIID iid, void **ppv);
00139     STDMETHODIMP_(ULONG)    AddRef(void)  { return m_cRef++; }
00140     STDMETHODIMP_(ULONG)    Release(void) { if (--m_cRef == 0){ delete this; return 0; } return m_cRef;}
00141     STDMETHODIMP            CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv);
00142     STDMETHODIMP            LockServer(BOOL fLock);
00143
00144     CClassFactory() { m_cRef = 1; }
00145 private:
00146   ULONG   m_cRef;
00147 };
00148
00149 // this worker object is simple: it simply supports IUnknown. more interesting
00150 // interfaces can be readily added here and implemented for the worker.
00151 class CTestCOMPerformance : public ICOMPerformance , public IDispatch
00152 {
00153 public:
00154   // IUnknown
00155     STDMETHODIMP            QueryInterface(REFIID iid, void **ppv);
00156     STDMETHODIMP_(ULONG)    AddRef(void)    { return m_cRef++; }
00157     STDMETHODIMP_(ULONG)    Release(void);
00158
00159   // ICOMPerformance
00160   STDMETHODIMP                    Test1(int l);
00161     STDMETHODIMP                        Test23(BSTR szDesc);
00162
00163   // IDispatch
00164   STDMETHODIMP  GetTypeInfoCount(unsigned int  *pcti);
00165     STDMETHODIMP  GetTypeInfo(unsigned int iti, LCID lcid, LPTYPEINFO  *ppti);
00166     STDMETHODIMP  GetIDsOfNames(REFIID riid, WCHAR  *  *rgszNames, unsigned int cNames, LCID lcid, DISPID  *pdispid);
00167     STDMETHODIMP  Invoke(DISPID dispidMember, REFIID riid, LCID lcid, unsigned short wFlags,
00168     DISPPARAMS  *pdispparams, VARIANT  *pvarResult, EXCEPINFO  *pexcepinfo, unsigned int  *puArgErr);
00169
00170     CTestCOMPerformance() { m_cRef = 1;}
00171 private:
00172     ULONG   m_cRef;
00173 };
00174
00175 class CTIMER
00176 {
00177   public:
00178     inline CTIMER()              { memset(this, 0, sizeof(*this)); }
00179     inline void Start()  { QueryPerformanceCounter(&m_sStart); }
00180     inline void Stop()   { QueryPerformanceCounter(&m_sStop); }
00181   inline float OutputTime()       { QueryPerformanceFrequency(&m_liFreq);
00182       return (float)(( m_sStop.LowPart - m_sStart.LowPart)/(float)m_liFreq.LowPart);}
00183     // data members
00184     LARGE_INTEGER   m_sStart, m_sStop, m_liFreq;
00185 };
00186
00187 // ---------------------------------------------------------------------------
00188 // %%Function: Message
00189 //
00190 //  Formats and displays a message to the console.
00191 // ---------------------------------------------------------------------------
00192  void
00193 Message(LPTSTR szPrefix, HRESULT hr)
00194 {
00195     LPTSTR   szMessage;
00196
00197     if (hr == S_OK)
00198     {
00199   _tprintf(szPrefix);
00200   _tprintf(TEXT("\n"));
00201   return;
00202     }
00203
00204     if (HRESULT_FACILITY(hr) == FACILITY_WINDOWS)
00205   hr = HRESULT_CODE(hr);
00206
00207     FormatMessage(
00208   FORMAT_MESSAGE_ALLOCATE_BUFFER |
00209   FORMAT_MESSAGE_FROM_SYSTEM,
00210   NULL,
00211   hr,
00212   MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00213   (LPTSTR)&szMessage,
00214   0,
00215   NULL );
00216
00217   _tprintf(TEXT("%s: %s(%lx)\n"), szPrefix, szMessage, hr);
00218     LocalFree(szMessage);
00219 }  // Message
00220
00221 // ---------------------------------------------------------------------------
00222 // %%Function: main
00223 // ---------------------------------------------------------------------------
00224  int __cdecl
00225 main(int argc, CHAR **argv)
00226 {
00227     HRESULT hr;
00228     int     i;
00229     DWORD   dwRegister = 0;
00230     COSERVERINFO csi, *pcsi=NULL;
00231     WCHAR wsz [MAX_PATH];
00232   CClassFactory   *pcf = NULL;
00233   LPCLASSFACTORY pcflocal = NULL;
00234   LPCLASSFACTORY pcfrmt = NULL;
00235   LPCLIENTSECURITY pclntsec = NULL;
00236   TCHAR    rgch[32];
00237
00238   DWORD AuthnSvc, AuthzSvc, AuthnLvl, ImpLvl, Capabilities;
00239
00240
00241   if(!FAutoRegister())
00242   {
00243     exit(-1);
00244   }
00245   // parse command-line
00246     if (argc > 1)
00247     {
00248   // either started as server or passing in server name
00249   MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, argv[1], -1,
00250       wsz, MAX_PATH);
00251
00252     // register the CTestCOMPerformance class in the registry so
00253     // that the client can create instances of the server
00254     if((!lstrcmpW(L"-?", wsz)) || (!lstrcmpW(L"/?", wsz)))
00255     {
00256       Usage();
00257       return 0;
00258     }
00259     if(!lstrcmpW(L"-Embedding", wsz))
00260       vfServer = TRUE;
00261     else
00262     {
00263       // allow a machine-name as the command-line argument
00264       csi.dwReserved1 = 0;
00265       csi.pAuthInfo = NULL;
00266       csi.dwReserved2 = 0;
00267       csi.pwszName = wsz;
00268       pcsi = &csi;
00269       vfRemote = TRUE;
00270     }
00271     }
00272   if(vfServer)
00273     Message(szTitleServer, S_OK);
00274   else
00275     Message(szTitleClient, S_OK);
00276
00277     // initialize COM
00278     hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00279     if (FAILED(hr))
00280     {
00281   Message(TEXT("CoInitializeEx"), hr);
00282     exit(hr);
00283     }
00284
00285   // create an IStream to be used for marshalling interfaces
00286     hr = CreateStreamOnHGlobal(NULL, TRUE, &vpstmMarshalling);
00287     if (FAILED(hr))
00288   {
00289     Message(TEXT("CreateStreamOnHGlobal"), hr);
00290   goto LCleanup;
00291   }
00292
00293     if (vfServer)
00294     {
00295   // create the threads and synchronization events
00296   // which the server will need
00297   for (i=0; i<cServerThreads; i++)
00298   {
00299       // create the thread suspended so its event can be
00300       // created using its thread-id and it will be able to
00301       // use it as soon as it runs
00302       vrghThread[i] = CreateThread(NULL,
00303     0,
00304     (LPTHREAD_START_ROUTINE)&ServerThreadProc,
00305     0,
00306     CREATE_SUSPENDED,
00307     &vrgtid[i]);
00308       if (vrghThread[i] == NULL)
00309     {
00310     hr = GetLastError();
00311     goto LCleanup;
00312     }
00313
00314       // this event signals to a worker thread to create a new CTestCOMPerformance
00315       wsprintf(rgch, TEXT("Thread_%d"), vrgtid[i]);
00316       vrghEvent[i] = CreateEvent(NULL, FALSE, FALSE, rgch);
00317       if (vrghEvent[i] == NULL)
00318       {
00319     hr = GetLastError();
00320     goto LCleanup;
00321       }
00322       // now that the event is available, let the thread run
00323       ResumeThread(vrghThread[i]);
00324     }
00325     hKillSvr = CreateEvent(NULL, FALSE, FALSE, NULL);
00326   if (hKillSvr == NULL)
00327       {
00328       hr = GetLastError();
00329       goto LCleanup;
00330    }
00331
00332   // this signals the status of a worker threads creation after
00333   // receiving its create signal via vrghEvent[i]
00334   vhEventServer = CreateEvent(NULL, FALSE, FALSE, TEXT("Server"));
00335   if (vhEventServer == NULL)
00336   {
00337       hr = GetLastError();
00338       goto LCleanup;
00339   }
00340     pcf = new CClassFactory;
00341     if(pcf == NULL)
00342   {
00343       hr = E_OUTOFMEMORY;
00344       goto LCleanup;
00345   }
00346
00347   // register the class-factory with COM
00348   hr = CoRegisterClassObject(CLSID_CTestCOMPerformance,
00349       (IUnknown *)pcf,
00350       CLSCTX_LOCAL_SERVER,
00351       REGCLS_MULTIPLEUSE,
00352       &dwRegister);
00353   if (FAILED(hr))
00354     {
00355       Message(TEXT("CoRegisterClassObject"), hr);
00356       goto LCleanup;
00357     }
00358
00359     Message(TEXT("Server waiting"), S_OK);
00360     WaitForSingleObject(hKillSvr, INFINITE);
00361     Sleep(7000); // allow time for last Release call processing
00362     delete pcf;
00363     pcf = NULL;
00364   }
00365
00366     else // client case
00367     {
00368     pCOMApt = pCOMFree = pCOMAptRmt =pCOMFreeRmt = NULL;
00369     pAutoFree = pAutoFree = pAutoAptRmt = pAutoFreeRmt = NULL;
00370
00371     // get local class factory
00372   hr = CoGetClassObject(CLSID_CTestCOMPerformance, CLSCTX_LOCAL_SERVER, NULL,
00373       IID_IClassFactory, (void**)&pcflocal);
00374     if(FAILED(hr))
00375     {
00376       Message(TEXT("CoGetClassObject:"), hr);
00377       goto LCleanup;
00378     }
00379     // apt-model obj
00380     hr = pcflocal->CreateInstance(NULL, IID_ICOMPerformance, (void**)&pCOMApt);
00381   if (FAILED(hr))
00382     {
00383       Message(TEXT("Create Local Apt Instance:"), hr);
00384       goto LCleanup;
00385     }
00386     hr = pCOMApt->QueryInterface(IID_IDispatch, (void**)&pAutoApt);
00387     if (FAILED(hr))
00388     {
00389       Message(TEXT("QI for pAutoApt:"), hr);
00390       goto LCleanup;
00391     }
00392     // get free-threaded obj
00393     hr = pcflocal->CreateInstance(NULL, IID_ICOMPerformance, (void**)&pCOMFree);
00394   if (FAILED(hr))
00395     {
00396       Message(TEXT("Create Local Free Instance"), hr);
00397       goto LCleanup;
00398     }
00399     hr = pCOMFree->QueryInterface(IID_IDispatch, (void**)&pAutoFree);
00400     if (FAILED(hr))
00401     {
00402       Message(TEXT("QI for pAutoFree"), hr);
00403       goto LCleanup;
00404     }
00405     hr = pcflocal->Release();
00406     pcflocal = NULL;
00407     if(vfRemote)
00408     {
00409       hr = CoGetClassObject(CLSID_CTestCOMPerformance, CLSCTX_REMOTE_SERVER, pcsi,
00410         IID_IClassFactory, (void**)&pcfrmt);
00411       if(FAILED(hr))
00412       {
00413         Message(TEXT("CoGetClassObject for remote CF"), hr);
00414         vfRemote = FALSE;
00415         goto LContinue;
00416       }
00417       // apt-model obj
00418       hr = pcfrmt->CreateInstance(NULL, IID_ICOMPerformance, (void**)&pCOMAptRmt);
00419       if (FAILED(hr))
00420       {
00421         Message(TEXT("Create Remote Instance"), hr);
00422         goto LCleanup;
00423       }
00424       hr = pCOMAptRmt->QueryInterface(IID_IDispatch, (void**)&pAutoAptRmt);
00425       if (FAILED(hr))
00426       {
00427         Message(TEXT("QI for pAutoAptFreeRmt"), hr);
00428         goto LCleanup;
00429       }
00430       // get free-threaded obj
00431       hr = pcfrmt->CreateInstance(NULL, IID_ICOMPerformance, (void**)&pCOMFreeRmt);
00432       if (FAILED(hr))
00433       {
00434         Message(TEXT("Create Remote Free Instance"), hr);
00435         goto LCleanup;
00436       }
00437       hr = pCOMFreeRmt->QueryInterface(IID_IDispatch, (void**)&pAutoFreeRmt);
00438       if (FAILED(hr))
00439       {
00440         Message(TEXT("QI for pAutoFreeFreeRmt"), hr);
00441         goto LCleanup;
00442       }
00443       hr = pcfrmt->Release();
00444       pcfrmt = NULL;
00445     }
00446 LContinue:
00447     // create apartment thread for client
00448     DWORD   dwClienttid;
00449   // create the thread suspended so its event can be
00450   // created using its thread-id and it will be able to
00451   // use it as soon as it runs
00452   HANDLE hClientThread = CreateThread(NULL,
00453       0,
00454       (LPTHREAD_START_ROUTINE)&ClientThreadProc,
00455       0,
00456       CREATE_SUSPENDED,
00457       &dwClienttid);
00458   if (hClientThread == NULL)
00459   {
00460       hr = GetLastError();
00461       goto LCleanup;
00462   }
00463     wsprintf(rgch, TEXT("Thread_%d"), dwClienttid);
00464
00465     vhEventCliStart = CreateEvent(NULL, FALSE, FALSE, rgch);
00466   if (vhEventCliStart == NULL)
00467   {
00468       hr = GetLastError();
00469       goto LCleanup;
00470   }
00471     vhEventCliDone = CreateEvent(NULL, FALSE, FALSE, NULL);
00472   if (vhEventCliDone == NULL)
00473   {
00474       hr = GetLastError();
00475       goto LCleanup;
00476   }
00477     // Marshall local apt thread
00478     hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00479   if (FAILED(hr))
00480       throw hr;
00481   hr = CoMarshalInterface(vpstmMarshalling,
00482       IID_IUnknown,
00483       (ICOMPerformance*)pCOMApt,
00484       MSHCTX_INPROC,
00485       NULL,
00486       MSHLFLAGS_NORMAL);
00487   if (FAILED(hr))
00488       throw hr;
00489     // now that the event is available, let the thread run
00490   ResumeThread(hClientThread);
00491     SetEvent(vhEventCliStart);
00492     WaitForSingleObject(vhEventCliDone, INFINITE);
00493
00494     if(vfRemote && NULL != pCOMAptRmt)
00495     {
00496       // Marshall local apt thread
00497       hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00498       if (FAILED(hr))
00499         throw hr;
00500       hr = CoMarshalInterface(vpstmMarshalling,
00501         IID_IUnknown,
00502         (ICOMPerformance*)pCOMAptRmt,
00503         MSHCTX_INPROC,
00504         NULL,
00505         MSHLFLAGS_NORMAL);
00506       if (FAILED(hr))
00507         throw hr;
00508       SetEvent(vhEventCliStart);
00509       WaitForSingleObject(vhEventCliDone, INFINITE);
00510     }
00511
00512     // Test
00513     _tprintf(TEXT("Output in Calls per sec\n"));
00514     _tprintf(TEXT("DEF Sec:\t\tLOCAL\t\t\tREMOTE\n"));
00515     // Do all tests
00516     if(!DoTests())
00517       goto LCleanup;
00518     // Up security on proxies
00519     // Get current security
00520     hr = pCOMApt->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00521     hr = pclntsec->QueryBlanket(pCOMApt, &AuthnSvc, &AuthzSvc, NULL, &AuthnLvl, &ImpLvl, NULL,
00522       &Capabilities);
00523
00524     _tprintf(TEXT("Increasing local security from AuthnLvl:%d  ImpLvl:%d\n"), AuthnLvl, ImpLvl);
00525
00526     hr = pclntsec->SetBlanket(pCOMApt, AuthnSvc, AuthzSvc, NULL, 6,
00527         4, NULL, Capabilities);
00528     hr = pclntsec->QueryBlanket(pCOMApt, &AuthnSvc, &AuthzSvc, NULL, &AuthnLvl, &ImpLvl, NULL,
00529       &Capabilities);
00530
00531     _tprintf(TEXT("Local security is now AuthnLvl:%d  ImpLvl:%d\n"), AuthnLvl, ImpLvl);
00532
00533     pclntsec->Release();
00534     pclntsec = NULL;
00535     hr = pCOMFree->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00536     hr = pclntsec->SetBlanket(pCOMFree, AuthnSvc, AuthzSvc, NULL, 6,
00537         4, NULL, Capabilities);
00538     pclntsec->Release();
00539     pclntsec = NULL;
00540     hr = pAutoApt->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00541     hr = pclntsec->SetBlanket(pAutoApt, AuthnSvc, AuthzSvc, NULL, 6,
00542         4, NULL, Capabilities);
00543     pclntsec->Release();
00544     pclntsec = NULL;
00545     hr = pAutoFree->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00546     hr = pclntsec->SetBlanket(pAutoFree, AuthnSvc, AuthzSvc, NULL, 6,
00547         4, NULL, Capabilities);
00548     pclntsec->Release();
00549     pclntsec = NULL;
00550     if(vfRemote)
00551     {
00552       hr = pCOMAptRmt->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00553       hr = pclntsec->QueryBlanket(pCOMAptRmt, &AuthnSvc, &AuthzSvc, NULL, &AuthnLvl, &ImpLvl, NULL,
00554       &Capabilities);
00555
00556       _tprintf(TEXT("Increasing remote security from AuthnLvl:%d  ImpLvl:%d\n"), AuthnLvl, ImpLvl);
00557
00558       hr = pclntsec->SetBlanket(pCOMAptRmt, AuthnSvc, AuthzSvc, NULL, 6,
00559         4, NULL, Capabilities);
00560
00561       _tprintf(TEXT("Remote security is now AuthnLvl:%d  ImpLvl:%d\n"), AuthnLvl, ImpLvl);
00562
00563       pclntsec->Release();
00564       pclntsec = NULL;
00565       hr = pCOMFreeRmt->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00566       hr = pclntsec->SetBlanket(pCOMFreeRmt, AuthnSvc, AuthzSvc, NULL, 6,
00567         4, NULL, Capabilities);
00568       pclntsec->Release();
00569       pclntsec = NULL;
00570       hr = pAutoAptRmt->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00571       hr = pclntsec->SetBlanket(pAutoAptRmt, AuthnSvc, AuthzSvc, NULL, 6,
00572         4, NULL, Capabilities);
00573       pclntsec->Release();
00574       pclntsec = NULL;
00575       hr = pAutoFreeRmt->QueryInterface(IID_IClientSecurity, (void**)&pclntsec);
00576       hr = pclntsec->SetBlanket(pAutoFreeRmt, AuthnSvc, AuthzSvc, NULL, 6,
00577         4, NULL, Capabilities);
00578       pclntsec->Release();
00579       pclntsec = NULL;
00580     }
00581     // Do all tests with FULL sec
00582     // Apt to Apt first
00583     // Marshall local apt thread
00584     hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00585   if (FAILED(hr))
00586       throw hr;
00587   hr = CoMarshalInterface(vpstmMarshalling,
00588       IID_IUnknown,
00589       (ICOMPerformance*)pCOMApt,
00590       MSHCTX_INPROC,
00591       NULL,
00592       MSHLFLAGS_NORMAL);
00593   if (FAILED(hr))
00594       throw hr;
00595     // now that the event is available, let the thread run
00596   ResumeThread(hClientThread);
00597     SetEvent(vhEventCliStart);
00598     WaitForSingleObject(vhEventCliDone, INFINITE);
00599
00600     if(vfRemote && NULL != pCOMAptRmt)
00601     {
00602       // Marshall local apt thread
00603       hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00604       if (FAILED(hr))
00605         throw hr;
00606       hr = CoMarshalInterface(vpstmMarshalling,
00607         IID_IUnknown,
00608         (ICOMPerformance*)pCOMAptRmt,
00609         MSHCTX_INPROC,
00610         NULL,
00611         MSHLFLAGS_NORMAL);
00612       if (FAILED(hr))
00613         throw hr;
00614       SetEvent(vhEventCliStart);
00615       WaitForSingleObject(vhEventCliDone, INFINITE);
00616     }
00617     _tprintf(TEXT("Modified Sec:\t\tLOCAL\t\t\tREMOTE\n"));
00618     DoTests();
00619     }
00620 LCleanup:
00621   if (vpstmMarshalling != NULL)
00622       vpstmMarshalling->Release();
00623   if (vfServer)
00624     {
00625     // we explicitly don't clean up threads and events
00626     if (dwRegister != 0)
00627       CoRevokeClassObject(dwRegister);
00628     if(NULL != pcf)
00629       delete pcf;
00630     }
00631     else // client
00632   {
00633     // client case: release objects
00634     if(NULL != pcflocal)
00635       hr = pcflocal->Release();
00636     if(NULL != pcfrmt)
00637       hr = pcfrmt->Release();
00638     if(NULL != pCOMFree)
00639       hr = pCOMFree->Release();
00640     if(NULL != pAutoFree)
00641       hr = pAutoFree->Release();
00642     if(NULL != pCOMApt)
00643       hr = pCOMApt->Release();
00644     if(NULL != pAutoApt)
00645       hr = pAutoApt->Release();
00646     if(NULL != pCOMFreeRmt)
00647       hr = pCOMFreeRmt->Release();
00648     if(NULL != pAutoFreeRmt)
00649       hr = pAutoFreeRmt->Release();
00650     if(NULL != pCOMAptRmt)
00651       hr = pCOMAptRmt->Release();
00652     if(NULL != pAutoAptRmt)
00653       hr = pAutoAptRmt->Release();
00654     }
00655     CoUninitialize();
00656     return hr;
00657 }  // main
00658
00659 // ---------------------------------------------------------------------------
00660 // %%Function: FAutoRegister
00661 //  Registers the CTestCOMPerformance class in the registry.
00662 // ---------------------------------------------------------------------------
00663  BOOL
00664 FAutoRegister()
00665 {
00666     static TCHAR szClassDesc[] = TEXT("COM Performance Sample");
00667   static TCHAR szCLSIDEntry[] = TEXT("CLSID\\{DDC68870-E08E-11cf-A535-00AA00615B03}");
00668     TCHAR       szBuf[512];
00669     TCHAR       szPath[512];
00670     HKEY        hkeyT = NULL;
00671
00672
00673   HRESULT hr;
00674   LPFNREG lpfn = NULL;
00675   HINSTANCE hLib = NULL;
00676
00677     // register class code
00678     if ((RegSetValue(HKEY_CLASSES_ROOT, szCLSIDEntry, REG_SZ, szClassDesc,
00679       lstrlen(szClassDesc)) != ERROR_SUCCESS) ||
00680   (RegCreateKey(HKEY_CLASSES_ROOT, szCLSIDEntry, &hkeyT)
00681       != ERROR_SUCCESS) ||
00682   !GetModuleFileName(NULL, szBuf, sizeof(szBuf)))
00683   return FALSE;
00684     lstrcpy(szPath, szBuf);
00685     if (RegSetValue(hkeyT, TEXT("LocalServer32"), REG_SZ, szBuf, lstrlen(szBuf))
00686       != ERROR_SUCCESS)
00687   goto LErrExit;
00688     RegCloseKey(hkeyT);
00689   hkeyT = NULL;
00690   // Register the ICOMPerformance MIDL-generated proxy-stub component
00691   hLib = LoadLibrary(TEXT("psperf.dll"));
00692   if (NULL == hLib)
00693   {
00694     goto  LErrExit;
00695   }
00696   // Find entry point.
00697   lpfn = (LPFNREG)GetProcAddress(hLib, TEXT("DllRegisterServer"));
00698   if (lpfn == NULL)
00699   {
00700     //Message(_T("Couldn't find entry point in DLL"), S_OK); //unable to locate entry point
00701     goto LErrExit;
00702   }
00703   hr = (*lpfn)();
00704
00705   FreeLibrary(hLib);
00706   if(SUCCEEDED(hr))
00707     return TRUE;
00708 LErrExit:
00709   if(NULL != hkeyT)
00710     RegCloseKey(hkeyT);
00711   return FALSE;
00712 }  // FAutoRegister
00713
00714 // ===========================================================================
00715 //                          C C L A S S F A C T O R Y
00716 // ===========================================================================
00717
00718 // ---------------------------------------------------------------------------
00719 // %%Function: CClassFactory::QueryInterface
00720 //  Returns a new reference of the specified iid-type to a CClassFactory.
00721 // ---------------------------------------------------------------------------
00722  STDMETHODIMP
00723 CClassFactory::QueryInterface(REFIID iid, void **ppv)
00724 {
00725     *ppv = NULL;
00726
00727     if (iid == IID_IClassFactory || iid == IID_IUnknown)
00728   {
00729   *ppv = (IClassFactory *)this;
00730   }
00731     if (*ppv != NULL)
00732   {
00733   AddRef();
00734   return S_OK;
00735   }
00736     return E_NOINTERFACE;
00737 }  // CClassFactory::QueryInterface
00738
00739 // ---------------------------------------------------------------------------
00740 // %%Function: CClassFactory::CreateInstance
00741 //  Creates a new instance of a CTestCOMPerformance on the next worker thread.
00742 // ---------------------------------------------------------------------------
00743  STDMETHODIMP
00744 CClassFactory::CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv)
00745 {
00746     LPUNKNOWN   punk;
00747     HRESULT     hr;
00748
00749     *ppv = NULL;
00750     if (punkOuter != NULL)
00751   return CLASS_E_NOAGGREGATION;
00752
00753     // trigger the worker thread that we want to create an object
00754     SetEvent(vrghEvent[viNextThread]);
00755
00756     // now wait for the object to signal its completion
00757     WaitForSingleObject(vhEventServer, INFINITE);
00758
00759     // once the worker thread signals completion, vhrThreadStatus
00760     // lets us know if the creation process was successful, and if
00761     // vpstmMarshalling creates a marshalled interface pointer
00762     if (FAILED(vhrThreadStatus))
00763   return vhrThreadStatus;
00764
00765     // unmarshal an IUnknown from the scratch stream. if unmarshaling
00766     // fails, it takes care of releasing the object inside the marshal-data
00767     hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00768     if (FAILED(hr))
00769   return hr;
00770     hr = CoUnmarshalInterface(vpstmMarshalling, IID_IUnknown, (void **)&punk);
00771     if (FAILED(hr))
00772   return hr;
00773
00774     // get a reference to the interface asked for
00775     hr = punk->QueryInterface(iid, ppv);
00776     punk->Release();
00777   ++g_cObjectCount;
00778     viNextThread++;
00779 //    viNextThread %= cServerThreads;
00780
00781     return hr;
00782 }  // CClassFactory::CreateInstance
00783
00784  STDMETHODIMP
00785 CClassFactory::LockServer(BOOL fLock)
00786 {
00787     // there's no need to support this for this sample
00788     return E_FAIL;
00789 }  // CClassFactory::LockServer
00790
00791
00792 // ===========================================================================
00793 //                               C O B J E C T
00794 // ===========================================================================
00795
00796 // ---------------------------------------------------------------------------
00797 // %%Function: ServerThreadProc
00798 //  The worker thread function. Handles messages for objects of its thread/apt
00799 // and creates new objects.
00800 // ---------------------------------------------------------------------------
00801  LRESULT
00802 ServerThreadProc(LPARAM lParam)
00803 {
00804     HRESULT hr;
00805     MSG     msg;
00806     int     iThread;
00807
00808     // figure out which thread this is: it needs its synchronization event
00809     for (iThread=0; iThread<cServerThreads; iThread++)
00810   {
00811   if (vrgtid[iThread] == GetCurrentThreadId())
00812       break;
00813   }
00814     if (iThread==cServerThreads)
00815   return E_UNEXPECTED;
00816
00817     // initialize COM
00818   if((0 == iThread) || (2 == iThread))
00819   {
00820     hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00821     Message(TEXT("Apartment Thread"), hr);
00822   }
00823   else
00824   {
00825     hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00826     Message(TEXT("Free-threaded Model"), hr);
00827   }
00828     if (FAILED(hr))
00829   {
00830   MessageBeep(0);
00831   return hr;
00832   }
00833
00834     // apartment message/event loop
00835     // here worker message loops last forever. in situations without a
00836     // static number of worker threads, the loop could easily be terminated by
00837     // WM_QUITs sent from the main thread which might manage the worker thread
00838     // pool more carefully.
00839     while (TRUE)
00840   {
00841   DWORD dwWaitResult;
00842
00843   // wait for any message sent or posted to this queue
00844   // or for one of the passed handles to become signaled
00845   dwWaitResult = MsgWaitForMultipleObjects(1, &vrghEvent[iThread],
00846       FALSE, INFINITE, QS_ALLINPUT);
00847
00848   // result tells us the type of event we have:
00849   // a message or a signaled handle
00850
00851   // if there are one or more messages in the queue ...
00852   if (dwWaitResult == (WAIT_OBJECT_0 + 1))
00853       {
00854       // dispatch all of the messages in this next loop
00855       // (here is where we'd check for WM_QUITs to end this
00856       // worker thread if we wanted to)
00857       while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
00858     DispatchMessage(&msg);
00859       }
00860   else
00861       {
00862       // this thread was signaled to create a new object
00863       try
00864     {
00865     LPUNKNOWN   punk;
00866
00867     // create a new CTestCOMPerformance
00868     punk = (ICOMPerformance *)new CTestCOMPerformance;
00869     if (punk == NULL)
00870         throw E_OUTOFMEMORY;
00871
00872     hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00873     if (FAILED(hr))
00874         throw hr;
00875     hr = CoMarshalInterface(vpstmMarshalling,
00876         IID_IUnknown,
00877         punk,
00878         MSHCTX_INPROC,
00879         NULL,
00880         MSHLFLAGS_NORMAL);
00881     if (FAILED(hr))
00882         throw hr;
00883
00884     // punk is now referenced by its marshal-data in vpstmMarshalling.
00885     // we release our local reference here so the unmarshaller will
00886     // have the sole reference. a common mistake is to forget this
00887     // release and end up with orphaned objects in the server.
00888     punk->Release();
00889     vhrThreadStatus = S_OK;
00890     }
00891       catch (HRESULT hr)
00892     {
00893     vhrThreadStatus = hr;
00894     }
00895       SetEvent(vhEventServer);
00896       }
00897
00898   }
00899
00900     CoUninitialize();
00901     return msg.wParam;
00902 }  // ServerThreadProc
00903
00904 // ---------------------------------------------------------------------------
00905 // %%Function: ServerThreadProc
00906 //  The worker thread function. Handles messages for objects of its thread/apt
00907 // and creates new objects.
00908 // ---------------------------------------------------------------------------
00909  LRESULT
00910 ClientThreadProc(LPARAM lParam)
00911 {
00912     HRESULT hr;
00913     MSG     msg;
00914   UINT cCount = 0;
00915   hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00916     if (FAILED(hr))
00917     {
00918   return hr;
00919     }
00920     while (TRUE)
00921     {
00922   DWORD dwWaitResult;
00923
00924   // wait for any message sent or posted to this queue
00925   // or for one of the passed handles to become signaled
00926   dwWaitResult = MsgWaitForMultipleObjectsEx(1, &vhEventCliStart,
00927       INFINITE, QS_SENDMESSAGE, 0);
00928
00929   // result tells us the type of event we have:
00930   // a message or a signaled handle
00931
00932   // if there are one or more messages in the queue ...
00933   if (dwWaitResult == (WAIT_OBJECT_0 + 1))
00934   {
00935       // dispatch all of the messages in this next loop
00936       // (here is where we'd check for WM_QUITs to end this
00937       // worker thread if we wanted to)
00938       while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
00939     DispatchMessage(&msg);
00940   }
00941   else
00942   {
00943       // this thread was signaled to test Apt to Apt
00944       try
00945       {
00946       //Message(TEXT("Testing Apt to Apt"), hr);
00947       LPUNKNOWN   punk;
00948       LPDISPATCH   pdisp;
00949       // unmarshal an IUnknown from the scratch stream. if unmarshaling
00950       // fails, it takes care of releasing the object inside the marshal-data
00951       hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00952       if (FAILED(hr))
00953         return hr;
00954       hr = CoUnmarshalInterface(vpstmMarshalling, IID_IUnknown, (void **)&punk);
00955       if (FAILED(hr))
00956         return hr;
00957       ICOMPerformance *pcomperf = NULL;
00958       // get a reference to ICOMPerformance and IDispatch interface
00959       hr = punk->QueryInterface(IID_ICOMPerformance, (void**)&pcomperf);
00960       hr = punk->QueryInterface(IID_IDispatch, (void**)&pdisp);
00961       LONG    i, k;
00962       CTIMER  tmElapsed;
00963       BSTR bstr1, bstr2;
00964       bstr1 = SysAllocString(pszDesc1);
00965       bstr2 = SysAllocStringByteLen((const char *)pszDesc1, 4096);
00966       // Test1
00967       tmElapsed.Start();
00968       for (i=0; i<LOOPS; i++)
00969         k = (LONG)pcomperf->Test1(i);
00970       tmElapsed.Stop();
00971       if(cCount && vfRemote)
00972         vrgperfrmt[4].sec[0] = tmElapsed.OutputTime();
00973       else
00974         vrgperfloc[4].sec[0] = tmElapsed.OutputTime();
00975       // Test2
00976       tmElapsed.Start();
00977       for (i=0; i<LOOPS; i++)
00978         k = (LONG)pcomperf->Test23(bstr1);
00979       tmElapsed.Stop();
00980       if(cCount && vfRemote)
00981         vrgperfrmt[4].sec[1] = tmElapsed.OutputTime();
00982       else
00983         vrgperfloc[4].sec[1] = tmElapsed.OutputTime();
00984       // Test3
00985       tmElapsed.Start();
00986       for (i=0; i<LOOPS; i++)
00987         k = (LONG)pcomperf->Test23(bstr2);
00988       tmElapsed.Stop();
00989       if(cCount && vfRemote)
00990         vrgperfrmt[4].sec[2] = tmElapsed.OutputTime();
00991       else
00992         vrgperfloc[4].sec[2] = tmElapsed.OutputTime();
00993       // Now IDispatch
00994       VARIANTARG  rgvt[1];
00995       DISPPARAMS  dispparams = { rgvt, NULL, 1, 0 };
00996       EXCEPINFO  excepinfo;
00997
00998       VARIANT vtResult;
00999       UINT    argerr;
01000       // Test1
01001       tmElapsed.Start();
01002       V_VT(&vtResult) = VT_HRESULT;
01003       for (i=0; i<LOOPS; i++)
01004       {
01005         V_VT(&rgvt[0]) = VT_I4;
01006         V_I4(&rgvt[0]) = i;
01007         hr = pdisp->Invoke(dispidICOMPerformance_Test1, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01008           &vtResult, &excepinfo, &argerr);
01009         k = V_I4(&vtResult);
01010       }
01011       tmElapsed.Stop();
01012       if(cCount && vfRemote)
01013         vrgperfrmt[5].sec[0] = tmElapsed.OutputTime();
01014       else
01015         vrgperfloc[5].sec[0] = tmElapsed.OutputTime();
01016       // Test2
01017       tmElapsed.Start();
01018       V_VT(&vtResult) = VT_HRESULT;
01019       for (i=0; i<LOOPS; i++)
01020       {
01021         V_VT(&rgvt[0]) = VT_BSTR;
01022         V_BSTR(&rgvt[0]) = bstr1;
01023         hr = pdisp->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01024           &vtResult, &excepinfo, &argerr);
01025         k = V_I4(&vtResult);
01026       }
01027       tmElapsed.Stop();
01028       if(cCount && vfRemote)
01029         vrgperfrmt[5].sec[1] = tmElapsed.OutputTime();
01030       else
01031         vrgperfloc[5].sec[1] = tmElapsed.OutputTime();
01032       // Test3
01033       tmElapsed.Start();
01034       V_VT(&vtResult) = VT_HRESULT;
01035       for (i=0; i<LOOPS; i++)
01036       {
01037         V_VT(&rgvt[0]) = VT_BSTR;
01038         V_BSTR(&rgvt[0]) = bstr2;
01039         hr = pdisp->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01040           &vtResult, &excepinfo, &argerr);
01041         k = V_I4(&vtResult);
01042       }
01043       tmElapsed.Stop();
01044       if(cCount && vfRemote)
01045         vrgperfrmt[5].sec[2] = tmElapsed.OutputTime();
01046       else
01047         vrgperfloc[5].sec[2] = tmElapsed.OutputTime();
01048       SysFreeString(bstr1);
01049       SysFreeString(bstr2);
01050       hr = pcomperf->Release();
01051       hr = pdisp->Release();
01052       hr = punk->Release();
01053
01054       vhrThreadStatus = S_OK;
01055       }
01056       catch (HRESULT hr)
01057       {
01058     vhrThreadStatus = hr;
01059       }
01060       SetEvent(vhEventCliDone);
01061       if(cCount)
01062         --cCount;
01063       else
01064         ++cCount;
01065   }
01066     }
01067     CoUninitialize();
01068     return msg.wParam;
01069 }  // ClientThreadProc
01070 // ---------------------------------------------------------------------------
01071 // %%Function: CTestCOMPerformance::QueryInterface
01072 //  Returns a new reference of the specified iid-type to a CTestCOMPerformance.
01073 // ---------------------------------------------------------------------------
01074  STDMETHODIMP
01075 CTestCOMPerformance::QueryInterface(REFIID iid, void **ppv)
01076 {
01077     *ppv = NULL;
01078
01079     if (iid == IID_IUnknown || iid == IID_ICOMPerformance)
01080     {
01081   *ppv = (ICOMPerformance *)this;
01082     }
01083   else if (iid == IID_IDispatch)
01084     *ppv = (IDispatch *)this;
01085     if (*ppv == NULL)
01086     {
01087     return E_NOINTERFACE;
01088     }
01089   AddRef();
01090     return S_OK;
01091 }  // CTestCOMPerformance::QueryInterface
01092
01093 // ---------------------------------------------------------------------------
01094 // %%Function: CTestCOMPerformance::Release
01095 //  Handles releases of references to a CTestCOMPerformance. Purpose here is to have code
01096 // which alters the global state which is displayed in the servers UI.
01097 // ---------------------------------------------------------------------------
01098  STDMETHODIMP_(ULONG)
01099 CTestCOMPerformance::Release(void)
01100 {
01101   if (--m_cRef == 0)
01102     {
01103     --g_cObjectCount;
01104     delete this;
01105   Message(TEXT("Object Deleted"), S_OK);
01106     if(g_cObjectCount == 0) SetEvent(hKillSvr);
01107     return 0;
01108     }
01109     return m_cRef;
01110 }  // CTestCOMPerformance::Release
01111
01112 // ---------------------------------------------------------------------------
01113 // %%Function: CTestCOMPerformance::GetTypeInfoCount
01114 // ---------------------------------------------------------------------------
01115  STDMETHODIMP
01116 CTestCOMPerformance::GetTypeInfoCount(UINT  *pctInfo)
01117 {
01118     *pctInfo = 1;
01119     return S_OK;
01120 }  // CTestCOMPerformance::GetTypeInfoCount
01121
01122 // ---------------------------------------------------------------------------
01123 // %%Function: CTestCOMPerformance::GetTypeInfo
01124 // ---------------------------------------------------------------------------
01125  STDMETHODIMP
01126 CTestCOMPerformance::GetTypeInfo(unsigned int itInfo, LCID lcid, LPTYPEINFO  *ppti)
01127 {
01128   HRESULT hr;
01129
01130     if (ppti == NULL)
01131     return E_POINTER;
01132   hr = CreateDispTypeInfo( &interfacedata, 0, ppti);
01133     return hr;
01134 }  // CTestCOMPerformance::GetTypeInfo
01135
01136 // ---------------------------------------------------------------------------
01137 // %%Function: CTestCOMPerformance::GetIDsOfNames
01138 // ---------------------------------------------------------------------------
01139  STDMETHODIMP
01140 CTestCOMPerformance::GetIDsOfNames(REFIID riid, WCHAR  *  *rgszNames, unsigned int cNames, LCID lcid, DISPID  *pdispid)
01141 {
01142     return E_NOTIMPL;
01143 }  // CTestCOMPerformance::GetIDsOfNames
01144
01145 // ---------------------------------------------------------------------------
01146 // %%Function: CTestCOMPerformance::Invoke
01147 // ---------------------------------------------------------------------------
01148  STDMETHODIMP
01149 CTestCOMPerformance::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, unsigned short wFlags, DISPPARAMS  *pdispparams, VARIANT  *pvarResult,
01150       EXCEPINFO  *pexcepinfo, unsigned int  *puArgErr)
01151 {
01152     LPTYPEINFO pti = NULL;
01153   HRESULT hr = GetTypeInfo(0, lcid, &pti);
01154   if(FAILED(hr))
01155     return hr;
01156
01157   hr =  pti->Invoke((ICOMPerformance*)this, dispidMember,
01158       wFlags, pdispparams, pvarResult,
01159       pexcepinfo, puArgErr);
01160   hr = pti->Release();
01161   return hr;
01162 }  // CTestCOMPerformance::Invoke
01163
01164
01165  STDMETHODIMP
01166 CTestCOMPerformance::Test1(int l)
01167 {
01168    return S_OK;
01169 }
01170
01171  STDMETHODIMP
01172 CTestCOMPerformance::Test23(BSTR bstr)
01173 {
01174    return S_OK;
01175 }
01176
01177 // Tests
01178  BOOL
01179 AptFreeCOMTest(int cLoops)
01180 {
01181   LONG    i, k;
01182     CTIMER  tmElapsed;
01183   BSTR bstr1, bstr2;
01184   bstr1 = SysAllocString(pszDesc1);
01185   bstr2 = SysAllocStringByteLen((const char *)pszDesc1, 4096);
01186   // Local
01187   // Test1
01188     tmElapsed.Start();
01189     for (i=0; i<cLoops; i++)
01190     k = (LONG)pCOMApt->Test1(i);
01191     tmElapsed.Stop();
01192     vrgperfloc[0].sec[0] = tmElapsed.OutputTime();
01193   // Test2
01194     tmElapsed.Start();
01195     for (i=0; i<cLoops; i++)
01196     k = (LONG)pCOMApt->Test23(bstr1);
01197     tmElapsed.Stop();
01198     vrgperfloc[0].sec[1] = tmElapsed.OutputTime();
01199   // Test3
01200     tmElapsed.Start();
01201   for (i=0; i<cLoops; i++)
01202     k = (LONG)pCOMApt->Test23(bstr2);
01203     tmElapsed.Stop();
01204     vrgperfloc[0].sec[2] = tmElapsed.OutputTime();
01205
01206   // Remote
01207   if(vfRemote)
01208   {
01209     tmElapsed.Start();
01210     for (i=0; i<cLoops; i++)
01211       k = (LONG)pCOMAptRmt->Test1(i);
01212     tmElapsed.Stop();
01213     vrgperfrmt[0].sec[0] = tmElapsed.OutputTime();
01214     // Test2
01215     tmElapsed.Start();
01216     for (i=0; i<cLoops; i++)
01217       k = (LONG)pCOMAptRmt->Test23(bstr1);
01218     tmElapsed.Stop();
01219     vrgperfrmt[0].sec[1] = tmElapsed.OutputTime();
01220     // Test3
01221     tmElapsed.Start();
01222     for (i=0; i<cLoops; i++)
01223       k = (LONG)pCOMAptRmt->Test23(bstr2);
01224     tmElapsed.Stop();
01225     vrgperfrmt[0].sec[2] = tmElapsed.OutputTime();
01226
01227   }
01228   SysFreeString(bstr1);
01229   SysFreeString(bstr2);
01230   return TRUE;
01231 }
01232
01233  BOOL
01234 AptFreeAutoTest(int cLoops)
01235 {
01236   HRESULT hr;
01237   static VARIANTARG  rgvt[1];
01238     static DISPPARAMS  dispparams = { rgvt, NULL, 1, 0 };
01239     static EXCEPINFO  excepinfo;
01240     VARIANT vtResult;
01241     UINT    argerr;
01242     LONG    i, k;
01243     CTIMER  tmElapsed;
01244   BSTR bstr1, bstr2;
01245   bstr1 = SysAllocString(pszDesc1);
01246   bstr2 = SysAllocStringByteLen((const char *)pszDesc1, 4096);
01247
01248   // Test1
01249     tmElapsed.Start();
01250     V_VT(&vtResult) = VT_HRESULT;
01251     for (i=0; i<cLoops; i++)
01252   {
01253     V_VT(&rgvt[0]) = VT_I4;
01254     V_I4(&rgvt[0]) = i;
01255     hr = pAutoApt->Invoke(dispidICOMPerformance_Test1, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01256       &vtResult, &excepinfo, &argerr);
01257     k = V_I4(&vtResult);
01258   }
01259     tmElapsed.Stop();
01260     vrgperfloc[1].sec[0] = tmElapsed.OutputTime();
01261   // Test2
01262   tmElapsed.Start();
01263     V_VT(&vtResult) = VT_HRESULT;
01264     for (i=0; i<cLoops; i++)
01265   {
01266     V_VT(&rgvt[0]) = VT_BSTR;
01267     V_BSTR(&rgvt[0]) = bstr1;
01268     hr = pAutoApt->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01269       &vtResult, &excepinfo, &argerr);
01270     k = V_I4(&vtResult);
01271   }
01272     tmElapsed.Stop();
01273     vrgperfloc[1].sec[1] = tmElapsed.OutputTime();
01274   // Test3
01275   tmElapsed.Start();
01276     V_VT(&vtResult) = VT_HRESULT;
01277     for (i=0; i<cLoops; i++)
01278   {
01279     V_VT(&rgvt[0]) = VT_BSTR;
01280     V_BSTR(&rgvt[0]) = bstr2;
01281     hr = pAutoApt->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01282       &vtResult, &excepinfo, &argerr);
01283     k = V_I4(&vtResult);
01284   }
01285     tmElapsed.Stop();
01286     vrgperfloc[1].sec[2] = tmElapsed.OutputTime();
01287   // Remote
01288   if(vfRemote)
01289   {
01290     // Test1
01291     tmElapsed.Start();
01292     V_VT(&vtResult) = VT_HRESULT;
01293     for (i=0; i<cLoops; i++)
01294     {
01295       V_VT(&rgvt[0]) = VT_I4;
01296       V_I4(&rgvt[0]) = i;
01297       hr = pAutoAptRmt->Invoke(dispidICOMPerformance_Test1, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01298         &vtResult, &excepinfo, &argerr);
01299       k = V_I4(&vtResult);
01300     }
01301     tmElapsed.Stop();
01302     vrgperfrmt[1].sec[0] = tmElapsed.OutputTime();
01303     // Test2
01304     tmElapsed.Start();
01305     V_VT(&vtResult) = VT_HRESULT;
01306     for (i=0; i<cLoops; i++)
01307     {
01308       V_VT(&rgvt[0]) = VT_BSTR;
01309       V_BSTR(&rgvt[0]) = bstr1;
01310       hr = pAutoAptRmt->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01311         &vtResult, &excepinfo, &argerr);
01312       k = V_I4(&vtResult);
01313     }
01314     tmElapsed.Stop();
01315     vrgperfrmt[1].sec[1] = tmElapsed.OutputTime();
01316     // Test3
01317     tmElapsed.Start();
01318     V_VT(&vtResult) = VT_HRESULT;
01319     for (i=0; i<cLoops; i++)
01320     {
01321       V_VT(&rgvt[0]) = VT_BSTR;
01322       V_BSTR(&rgvt[0]) = bstr2;
01323       hr = pAutoAptRmt->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01324         &vtResult, &excepinfo, &argerr);
01325       k = V_I4(&vtResult);
01326     }
01327     tmElapsed.Stop();
01328     vrgperfrmt[1].sec[2] = tmElapsed.OutputTime();
01329   }
01330
01331   SysFreeString(bstr1);
01332   SysFreeString(bstr2);
01333   return TRUE;
01334 }
01335
01336  BOOL
01337 FreeFreeCOMTest(int cLoops)
01338 {
01339   LONG    i, k;
01340     CTIMER  tmElapsed;
01341   BSTR bstr1, bstr2;
01342   bstr1 = SysAllocString(pszDesc1);
01343   bstr2 = SysAllocStringByteLen((const char *)pszDesc1, 4096);
01344
01345   // Test1
01346     tmElapsed.Start();
01347     for (i=0; i<cLoops; i++)
01348     k = (LONG)pCOMFree->Test1(i);
01349     tmElapsed.Stop();
01350     vrgperfloc[2].sec[0] = tmElapsed.OutputTime();
01351   // Test2
01352     tmElapsed.Start();
01353     for (i=0; i<cLoops; i++)
01354     k = (LONG)pCOMFree->Test23(bstr1);
01355     tmElapsed.Stop();
01356     vrgperfloc[2].sec[1] = tmElapsed.OutputTime();
01357   // Test3
01358     tmElapsed.Start();
01359   for (i=0; i<cLoops; i++)
01360   {
01361     k = (LONG)pCOMFree->Test23(bstr2);
01362   }
01363     tmElapsed.Stop();
01364     vrgperfloc[2].sec[2] = tmElapsed.OutputTime();
01365
01366   // Remote
01367   if(vfRemote)
01368   {
01369     // Test1
01370     tmElapsed.Start();
01371     for (i=0; i<cLoops; i++)
01372     k = (LONG)pCOMFreeRmt->Test1(i);
01373     tmElapsed.Stop();
01374     vrgperfrmt[2].sec[0] = tmElapsed.OutputTime();
01375     // Test2
01376     tmElapsed.Start();
01377     for (i=0; i<cLoops; i++)
01378       k = (LONG)pCOMFreeRmt->Test23(bstr1);
01379     tmElapsed.Stop();
01380     vrgperfrmt[2].sec[1] = tmElapsed.OutputTime();
01381     // Test3
01382     tmElapsed.Start();
01383     for (i=0; i<cLoops; i++)
01384     {
01385       k = (LONG)pCOMFreeRmt->Test23(bstr2);
01386     }
01387     tmElapsed.Stop();
01388     vrgperfrmt[2].sec[2] = tmElapsed.OutputTime();
01389   }
01390
01391   SysFreeString(bstr1);
01392   SysFreeString(bstr2);
01393   return TRUE;
01394 }
01395
01396  BOOL
01397 FreeFreeAutoTest(int cLoops)
01398 {
01399   HRESULT hr;
01400   static VARIANTARG  rgvt[1];
01401     static DISPPARAMS  dispparams = { rgvt, NULL, 1, 0 };
01402     static EXCEPINFO  excepinfo;
01403     VARIANT vtResult;
01404     UINT    argerr;
01405     LONG    i, k;
01406     CTIMER  tmElapsed;
01407   BSTR bstr1, bstr2;
01408   bstr1 = SysAllocString(pszDesc1);
01409   bstr2 = SysAllocStringByteLen((const char *)pszDesc1, 4096);
01410
01411   // Local
01412   // Test1
01413     tmElapsed.Start();
01414     V_VT(&vtResult) = VT_HRESULT;
01415     for (i=0; i<cLoops; i++)
01416   {
01417     V_VT(&rgvt[0]) = VT_I4;
01418     V_I4(&rgvt[0]) = i;
01419     hr = pAutoFree->Invoke(dispidICOMPerformance_Test1, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01420       &vtResult, &excepinfo, &argerr);
01421     k = V_I4(&vtResult);
01422   }
01423     tmElapsed.Stop();
01424     vrgperfloc[3].sec[0] = tmElapsed.OutputTime();
01425   // Test2
01426   tmElapsed.Start();
01427     V_VT(&vtResult) = VT_HRESULT;
01428     for (i=0; i<cLoops; i++)
01429   {
01430     V_VT(&rgvt[0]) = VT_BSTR;
01431     V_BSTR(&rgvt[0]) = bstr1;
01432     hr = pAutoFree->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01433       &vtResult, &excepinfo, &argerr);
01434     k = V_I4(&vtResult);
01435   }
01436     tmElapsed.Stop();
01437     vrgperfloc[3].sec[1] = tmElapsed.OutputTime();
01438   // Test3
01439   tmElapsed.Start();
01440     V_VT(&vtResult) = VT_HRESULT;
01441     for (i=0; i<cLoops; i++)
01442   {
01443     V_VT(&rgvt[0]) = VT_BSTR;
01444     V_BSTR(&rgvt[0]) = bstr2;
01445     hr = pAutoFree->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01446       &vtResult, &excepinfo, &argerr);
01447     k = V_I4(&vtResult);
01448   }
01449     tmElapsed.Stop();
01450     vrgperfloc[3].sec[2] = tmElapsed.OutputTime();
01451
01452   // Remote
01453   if(vfRemote)
01454   {
01455     // Test1
01456     tmElapsed.Start();
01457     V_VT(&vtResult) = VT_HRESULT;
01458     for (i=0; i<cLoops; i++)
01459     {
01460       V_VT(&rgvt[0]) = VT_I4;
01461       V_I4(&rgvt[0]) = i;
01462       hr = pAutoFreeRmt->Invoke(dispidICOMPerformance_Test1, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01463         &vtResult, &excepinfo, &argerr);
01464       k = V_I4(&vtResult);
01465     }
01466     tmElapsed.Stop();
01467     vrgperfrmt[3].sec[0] = tmElapsed.OutputTime();
01468     // Test2
01469     tmElapsed.Start();
01470     V_VT(&vtResult) = VT_HRESULT;
01471     for (i=0; i<cLoops; i++)
01472     {
01473       V_VT(&rgvt[0]) = VT_BSTR;
01474       V_BSTR(&rgvt[0]) = bstr1;
01475       hr = pAutoFreeRmt->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01476         &vtResult, &excepinfo, &argerr);
01477       k = V_I4(&vtResult);
01478     }
01479     tmElapsed.Stop();
01480     vrgperfrmt[3].sec[1] = tmElapsed.OutputTime();
01481     // Test3
01482     tmElapsed.Start();
01483     V_VT(&vtResult) = VT_HRESULT;
01484     for (i=0; i<cLoops; i++)
01485     {
01486       V_VT(&rgvt[0]) = VT_BSTR;
01487       V_BSTR(&rgvt[0]) = bstr2;
01488       hr = pAutoFreeRmt->Invoke(dispidICOMPerformance_Test23, IID_NULL, 0, DISPATCH_METHOD, &dispparams,
01489         &vtResult, &excepinfo, &argerr);
01490       k = V_I4(&vtResult);
01491     }
01492     tmElapsed.Stop();
01493     vrgperfrmt[3].sec[2] = tmElapsed.OutputTime();
01494   }
01495   SysFreeString(bstr1);
01496   SysFreeString(bstr2);
01497   return TRUE;
01498 }
01499
01500  void
01501 FPrintResults()
01502 {
01503   _tprintf(TEXT("Data Size\t\t4\t50\t4k\t4\t50\t4k\n"));
01504   _tprintf(TEXT("%s\t\t"), vrgperfloc[0].szTest);
01505   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[0].sec[0]);
01506   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[0].sec[1]);
01507   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[0].sec[2]);
01508   if(vfRemote)
01509   {
01510     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[0].sec[0]);
01511     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[0].sec[1]);
01512     _tprintf(TEXT("%4.2f\n"), LOOPS/vrgperfrmt[0].sec[2]);
01513   }
01514   else
01515   {
01516     _tprintf(TEXT("--\t"));
01517     _tprintf(TEXT("--\t"));
01518     _tprintf(TEXT("--\n"));
01519   }
01520   _tprintf(TEXT("%s\t\t"), vrgperfloc[1].szTest);
01521   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[1].sec[0]);
01522   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[1].sec[1]);
01523   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[1].sec[2]);
01524   if(vfRemote)
01525   {
01526     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[1].sec[0]);
01527     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[1].sec[1]);
01528     _tprintf(TEXT("%4.2f\n"), LOOPS/vrgperfrmt[1].sec[2]);
01529   }
01530   else
01531   {
01532     _tprintf(TEXT("--\t"));
01533     _tprintf(TEXT("--\t"));
01534     _tprintf(TEXT("--\n"));
01535   }
01536   _tprintf(TEXT("%s\t\t"), vrgperfloc[2].szTest);
01537   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[2].sec[0]);
01538   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[2].sec[1]);
01539   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[2].sec[2]);
01540   if(vfRemote)
01541   {
01542     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[2].sec[0]);
01543     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[2].sec[1]);
01544     _tprintf(TEXT("%4.2f\n"), LOOPS/vrgperfrmt[2].sec[2]);
01545   }
01546   else
01547   {
01548     _tprintf(TEXT("--\t"));
01549     _tprintf(TEXT("--\t"));
01550     _tprintf(TEXT("--\n"));
01551   }
01552   _tprintf(TEXT("%s\t\t"), vrgperfloc[3].szTest);
01553   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[3].sec[0]);
01554   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[3].sec[1]);
01555   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[3].sec[2]);
01556   if(vfRemote)
01557   {
01558     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[3].sec[0]);
01559     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[3].sec[1]);
01560     _tprintf(TEXT("%4.2f\n"), LOOPS/vrgperfrmt[3].sec[2]);
01561   }
01562   else
01563   {
01564     _tprintf(TEXT("--\t"));
01565     _tprintf(TEXT("--\t"));
01566     _tprintf(TEXT("--\n"));
01567   }
01568   _tprintf(TEXT("%s\t\t"), vrgperfloc[4].szTest);
01569   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[4].sec[0]);
01570   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[4].sec[1]);
01571   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[4].sec[2]);
01572   if(vfRemote)
01573   {
01574     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[4].sec[0]);
01575     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[4].sec[1]);
01576     _tprintf(TEXT("%4.2f\n"), LOOPS/vrgperfrmt[4].sec[2]);
01577   }
01578   else
01579   {
01580     _tprintf(TEXT("--\t"));
01581     _tprintf(TEXT("--\t"));
01582     _tprintf(TEXT("--\n"));
01583   }
01584   _tprintf(TEXT("%s\t\t"), vrgperfloc[5].szTest);
01585   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[5].sec[0]);
01586   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[5].sec[1]);
01587   _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfloc[5].sec[2]);
01588   if(vfRemote)
01589   {
01590     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[5].sec[0]);
01591     _tprintf(TEXT("%4.2f\t"), LOOPS/vrgperfrmt[5].sec[1]);
01592     _tprintf(TEXT("%4.2f\n"), LOOPS/vrgperfrmt[5].sec[2]);
01593   }
01594   else
01595   {
01596     _tprintf(TEXT("--\t"));
01597     _tprintf(TEXT("--\t"));
01598     _tprintf(TEXT("--\n"));
01599   }
01600
01601
01602 }
01603
01604  BOOL
01605 DoTests(void)
01606 {
01607   if(!AptFreeCOMTest(LOOPS))
01608     return FALSE;
01609   if(!AptFreeAutoTest(LOOPS))
01610     return FALSE;
01611   if(!FreeFreeCOMTest(LOOPS))
01612     return FALSE;
01613   if(!FreeFreeAutoTest(LOOPS))
01614     return FALSE;
01615   FPrintResults();
01616   return TRUE;
01617 } // DoTests
01618
01619 void Usage()
01620 {
01621   _tprintf(TEXT("Usage: COMPERF [machine name | IP address | /? | -?]\n\n"));
01622   _tprintf(TEXT("/?\t\t\tDisplays this help screen.\n"));
01623   _tprintf(TEXT("machine name\t\tName of remote machine.\n"));
01624   _tprintf(TEXT("IP address\t\tIP address of remote machine.\n\n"));
01625   _tprintf("%s", PURPOSE);
01626 }
01627
01628 // EOF =======================================================================
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/Dllinit.c Source File

  • Multimedia
  • Gdi
  • WinCap32

Dllinit.c

Go to the documentation of this file.
00001 // -----------------------------------------------------------------
00002 // File name:  DLLINIT.C
00003 //
00004 // This is the DLL's initialization source file.  It contains DllEntry,
00005 // the Win32 DLL's entry and exit point.
00006 //
00007 // Written by Microsoft Product Support Services, Windows Developer Support.
00008 //
00009 // Copyright 1991 - 2000 Microsoft Corporation.  All rights reserved.
00010 //
00011 // -----------------------------------------------------------------
00012
00013
00014 #define     STRICT      // enable strict type checking
00015
00016 #include <windows.h>
00017 #include "dibdll.h"
00018
00019 #pragma data_seg("._WINCAP")
00020     HWND ghWndMain = 0;         // Handle to main window -- used to post msgs
00021 #pragma data_seg()
00022
00023
00024 HANDLE ghDLLInst = 0;   // Handle to the DLL's instance.
00025 WORD nLangID;
00026
00027 // entry point for DLL loading and unloading
00028
00029 BOOL WINAPI DllMain (HANDLE hModule, DWORD dwFunction, LPVOID lpNot)
00030 {
00031     ghDLLInst = hModule;
00032
00033     switch (dwFunction)
00034     {
00035         case DLL_PROCESS_ATTACH:
00036             nLangID = PRIMARYLANGID(GetUserDefaultLangID());
00037             break;
00038
00039         case DLL_PROCESS_DETACH:
00040
00041                // When we are finally going away, do something here
00042
00043         default:
00044             break;
00045     }
00046     return TRUE;
00047 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIPersist Member List

This is the complete list of members for CImpIPersist, including all inherited members.
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIPersist) | CImpIPersist
GetClassID(CLSID *pClassID) | CImpIPersist
Generated on Wed Nov 13 2024 16:56:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WiaWrap::CComPtrArray< T > Member List

This is the complete list of members for WiaWrap::CComPtrArray< T >, including all inherited members.
CComPtrArray() | WiaWrap::CComPtrArray< T > | [inline]
CComPtrArray(int nCount) | WiaWrap::CComPtrArray< T > | [inline, explicit]
CComPtrArray(const CComPtrArray &rhs) | WiaWrap::CComPtrArray< T > | [inline]
Clear() | WiaWrap::CComPtrArray< T > | [inline]
Copy(const CComPtrArray &rhs) | WiaWrap::CComPtrArray< T > | [inline]
Count() | WiaWrap::CComPtrArray< T > | [inline]
m_nCount | WiaWrap::CComPtrArray< T > | [private]
m_pArray | WiaWrap::CComPtrArray< T > | [private]
operator T **() | WiaWrap::CComPtrArray< T > | [inline]
operator!() | WiaWrap::CComPtrArray< T > | [inline]
operator&() | WiaWrap::CComPtrArray< T > | [inline]
operator=(const CComPtrArray &rhs) | WiaWrap::CComPtrArray< T > | [inline]
~CComPtrArray() | WiaWrap::CComPtrArray< T > | [inline]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/GSS/GssAPI.h Source File

  • Security
  • SSPI
  • GSS

GssAPI.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1993 by OpenVision Technologies, Inc.
00003  *
00004  * Permission to use, copy, modify, distribute, and sell this software
00005  * and its documentation for any purpose is hereby granted without fee,
00006  * provided that the above copyright notice appears in all copies and
00007  * that both that copyright notice and this permission notice appear in
00008  * supporting documentation, and that the name of OpenVision not be used
00009  * in advertising or publicity pertaining to distribution of the software
00010  * without specific, written prior permission. OpenVision makes no
00011  * representations about the suitability of this software for any
00012  * purpose.  It is provided "as is" without express or implied warranty.
00013  *
00014  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
00015  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
00016  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
00017  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
00018  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
00019  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00020  * PERFORMANCE OF THIS SOFTWARE.
00021  */
00022
00023 #ifndef _GSSAPI_H_
00024    #define _GSSAPI_H_
00025
00026 /*
00027  * Determine platform-dependent configuration.
00028  */
00029    #if defined(_MSDOS) || defined(_WIN32)
00030
00031 /* Windows 32 specific definitions */
00032       #define GSS_SIZEOF_INT      4
00033       #define GSS_SIZEOF_SHORT    2
00034       #define GSS_SIZEOF_LONG     4
00035
00036       #ifndef KRB5_CALLCONV
00037          #ifdef KRB5_DLL_FILE
00038             #define KRB5_DECLSPEC dllexport
00039          #else
00040             #define KRB5_DECLSPEC dllimport
00041          #endif
00042          #define KRB5_DLLIMP __declspec(KRB5_DECLSPEC)
00043          #define KRB5_CALLCONV __stdcall
00044          #define KRB5_CALLCONV_C __cdecl
00045          #define INTERFACE   KRB5_DLLIMP KRB5_CALLCONV
00046          #define INTERFACE_C KRB5_DLLIMP KRB5_CALLCONV_C
00047       #endif /* !KRB5_CALLCONV */
00048
00049       #include <windows.h>
00050
00051       #ifndef _SIZE_T_DEFINED
00052 typedef unsigned int size_t;
00053          #define _SIZE_T_DEFINED
00054       #endif /* _SIZE_T_DEFINED */
00055
00056       #ifndef _UID_T_DEFINED
00057 typedef unsigned int uid_t;
00058          #define _UID_T_DEFINED
00059       #endif
00060    #else /* _MSDOS_ */
00061
00062       #ifndef KRB5_CALLCONV
00063          #define KRB5_CALLCONV
00064          #define KRB5_CALLCONV_C
00065          #define KRB5_DLLIMP
00066          #define INTERFACE
00067          #define INTERFACE_C
00068          #define FAR
00069          #define NEAR
00070       #endif /* !KRB5_CALLCONV */
00071
00072       #define GSS_SIZEOF_INT          SIZEOF_INT
00073       #define GSS_SIZEOF_LONG         SIZEOF_LONG
00074       #define GSS_SIZEOF_SHORT        SIZEOF_SHORT
00075    #endif /* _MSDOS */
00076
00077    #ifndef FAR
00078       #define FAR
00079    #endif
00080    #ifndef NEAR
00081       #define NEAR
00082    #endif
00083
00084 /*
00085  * Make sure we have a definition for PROTOTYPE.
00086  */
00087    #if !defined(PROTOTYPE)
00088       #define PROTOTYPE(x) x
00089    #endif
00090
00091    #include <stddef.h>
00092
00093    #include <sys/types.h>
00094
00095 typedef void FAR * gss_name_t;
00096 typedef void FAR * gss_cred_id_t;
00097 typedef void FAR * gss_ctx_id_t;
00098
00099 typedef unsigned long gss_uint32;
00100 typedef long gss_int32;
00101
00102 typedef gss_uint32      OM_uint32;
00103
00104 typedef struct gss_OID_desc_struct
00105 {
00106    OM_uint32 length;
00107    void      FAR *elements;
00108 } gss_OID_desc, FAR *gss_OID;
00109
00110 typedef struct gss_OID_set_desc_struct
00111 {
00112    size_t  count;
00113    gss_OID elements;
00114 } gss_OID_set_desc, FAR *gss_OID_set;
00115
00116 typedef struct gss_buffer_desc_struct
00117 {
00118    size_t length;
00119    void FAR *value;
00120 } gss_buffer_desc, FAR *gss_buffer_t;
00121
00122 typedef struct gss_channel_bindings_struct
00123 {
00124    OM_uint32 initiator_addrtype;
00125    gss_buffer_desc initiator_address;
00126    OM_uint32 acceptor_addrtype;
00127    gss_buffer_desc acceptor_address;
00128    gss_buffer_desc application_data;
00129 } FAR *gss_channel_bindings_t;
00130
00131 /*
00132  * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
00133  * discussions).
00134  */
00135 typedef OM_uint32       gss_qop_t;
00136 typedef int             gss_cred_usage_t;
00137
00138 /*
00139  * Flag bits for context-level services.
00140  */
00141    #define GSS_C_DELEG_FLAG 1
00142    #define GSS_C_MUTUAL_FLAG 2
00143    #define GSS_C_REPLAY_FLAG 4
00144    #define GSS_C_SEQUENCE_FLAG 8
00145    #define GSS_C_CONF_FLAG 16
00146    #define GSS_C_INTEG_FLAG 32
00147    #define GSS_C_ANON_FLAG 64
00148
00149 /*
00150  * Credential usage options
00151  */
00152    #define GSS_C_BOTH 0
00153    #define GSS_C_INITIATE 1
00154    #define GSS_C_ACCEPT 2
00155
00156 /*
00157  * Status code types for gss_display_status
00158  */
00159    #define GSS_C_GSS_CODE 1
00160    #define GSS_C_MECH_CODE 2
00161
00162 /*
00163  * The constant definitions for channel-bindings address families
00164  */
00165    #define GSS_C_AF_UNSPEC     0
00166    #define GSS_C_AF_LOCAL      1
00167    #define GSS_C_AF_INET       2
00168    #define GSS_C_AF_IMPLINK    3
00169    #define GSS_C_AF_PUP        4
00170    #define GSS_C_AF_CHAOS      5
00171    #define GSS_C_AF_NS         6
00172    #define GSS_C_AF_NBS        7
00173    #define GSS_C_AF_ECMA       8
00174    #define GSS_C_AF_DATAKIT    9
00175    #define GSS_C_AF_CCITT      10
00176    #define GSS_C_AF_SNA        11
00177    #define GSS_C_AF_DECnet     12
00178    #define GSS_C_AF_DLI        13
00179    #define GSS_C_AF_LAT        14
00180    #define GSS_C_AF_HYLINK     15
00181    #define GSS_C_AF_APPLETALK  16
00182    #define GSS_C_AF_BSC        17
00183    #define GSS_C_AF_DSS        18
00184    #define GSS_C_AF_OSI        19
00185    #define GSS_C_AF_X25        21
00186
00187    #define GSS_C_AF_NULLADDR   255
00188
00189 /*
00190  * Various Null values.
00191  */
00192    #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
00193    #define GSS_C_NO_OID ((gss_OID) 0)
00194    #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
00195    #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
00196    #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
00197    #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
00198    #define GSS_C_EMPTY_BUFFER {0, NULL}
00199
00200 /*
00201  * Some alternate names for a couple of the above values.  These are defined
00202  * for V1 compatibility.
00203  */
00204    #define GSS_C_NULL_OID          GSS_C_NO_OID
00205    #define GSS_C_NULL_OID_SET      GSS_C_NO_OID_SET
00206
00207 /*
00208  * Define the default Quality of Protection for per-message services.  Note
00209  * that an implementation that offers multiple levels of QOP may either reserve
00210  * a value (for example zero, as assumed here) to mean "default protection", or
00211  * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
00212  * QOP value.  However a value of 0 should always be interpreted by a GSSAPI
00213  * implementation as a request for the default protection level.
00214  */
00215    #define GSS_C_QOP_DEFAULT 0
00216
00217 /*
00218  * Expiration time of 2^32-1 seconds means infinite lifetime for a
00219  * credential or security context
00220  */
00221    #define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful)
00222
00223
00224 /* Major status codes */
00225
00226    #define GSS_S_COMPLETE 0
00227
00228 /*
00229  * Some "helper" definitions to make the status code macros obvious.
00230  */
00231    #define GSS_C_CALLING_ERROR_OFFSET 24
00232    #define GSS_C_ROUTINE_ERROR_OFFSET 16
00233    #define GSS_C_SUPPLEMENTARY_OFFSET 0
00234    #define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul)
00235    #define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul)
00236    #define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul)
00237
00238 /*
00239  * The macros that test status codes for error conditions.  Note that the
00240  * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
00241  * evaluates its argument only once.
00242  */
00243    #define GSS_CALLING_ERROR(x) \
00244   ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
00245    #define GSS_ROUTINE_ERROR(x) \
00246   ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
00247    #define GSS_SUPPLEMENTARY_INFO(x) \
00248   ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
00249    #define GSS_ERROR(x) \
00250   ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
00251           (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
00252
00253 /*
00254  * Now the actual status code definitions
00255  */
00256
00257 /*
00258  * Calling errors:
00259  */
00260    #define GSS_S_CALL_INACCESSIBLE_READ \
00261                              (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET)
00262    #define GSS_S_CALL_INACCESSIBLE_WRITE \
00263                              (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET)
00264    #define GSS_S_CALL_BAD_STRUCTURE \
00265                              (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET)
00266
00267 /*
00268  * Routine errors:
00269  */
00270    #define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00271    #define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00272    #define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00273    #define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00274    #define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00275    #define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00276    #define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00277    #define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00278    #define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00279    #define GSS_S_DEFECTIVE_CREDENTIAL \
00280      (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00281    #define GSS_S_CREDENTIALS_EXPIRED \
00282      (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00283    #define GSS_S_CONTEXT_EXPIRED \
00284      (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00285    #define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00286    #define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00287    #define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00288    #define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00289 /*
00290  * XXX new functions.  Check to get official error number assigments?
00291  */
00292    #define GSS_S_DUPLICATE_ELEMENT \
00293      (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET)
00294
00295 /*
00296  * Supplementary info bits:
00297  */
00298    #define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
00299    #define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
00300    #define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
00301    #define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
00302 /*
00303  * XXX not in the cbindings yet.  remove this comment when it is
00304  */
00305    #define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
00306
00307
00308 /*
00309  * Finally, function prototypes for the GSSAPI routines.
00310  */
00311
00312 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_acquire_cred
00313 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00314             gss_name_t,                 /* desired_name */
00315             OM_uint32,                  /* time_req */
00316             gss_OID_set,                /* desired_mechs */
00317             gss_cred_usage_t,           /* cred_usage */
00318             gss_cred_id_t FAR *,        /* output_cred_handle */
00319             gss_OID_set FAR *,          /* actual_mechs */
00320             OM_uint32 FAR *             /* time_rec */
00321            ));
00322
00323 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_release_cred
00324 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00325             gss_cred_id_t FAR *         /* cred_handle */
00326            ));
00327
00328 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_init_sec_context
00329 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00330             gss_cred_id_t,              /* claimant_cred_handle */
00331             gss_ctx_id_t FAR *,         /* context_handle */
00332             gss_name_t,                 /* target_name */
00333             gss_OID,                    /* mech_type (used to be const) */
00334             OM_uint32,                  /* req_flags */
00335             OM_uint32,                  /* time_req */
00336             gss_channel_bindings_t,     /* input_chan_bindings */
00337             gss_buffer_t,               /* input_token */
00338             gss_OID FAR *,              /* actual_mech_type */
00339             gss_buffer_t,               /* output_token */
00340             OM_uint32 FAR *,            /* ret_flags */
00341             OM_uint32 FAR *             /* time_rec */
00342            ));
00343
00344 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_accept_sec_context
00345 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00346             gss_ctx_id_t FAR *,         /* context_handle */
00347             gss_cred_id_t,              /* acceptor_cred_handle */
00348             gss_buffer_t,               /* input_token_buffer */
00349             gss_channel_bindings_t,     /* input_chan_bindings */
00350             gss_name_t FAR *,           /* src_name */
00351             gss_OID FAR *,              /* mech_type */
00352             gss_buffer_t,               /* output_token */
00353             OM_uint32 FAR *,            /* ret_flags */
00354             OM_uint32 FAR *,            /* time_rec */
00355             gss_cred_id_t FAR *         /* delegated_cred_handle */
00356            ));
00357
00358 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_process_context_token
00359 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00360             gss_ctx_id_t,               /* context_handle */
00361             gss_buffer_t                /* token_buffer */
00362            ));
00363
00364 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_delete_sec_context
00365 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00366             gss_ctx_id_t FAR *,         /* context_handle */
00367             gss_buffer_t                /* output_token */
00368            ));
00369
00370 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_context_time
00371 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00372             gss_ctx_id_t,               /* context_handle */
00373             OM_uint32 FAR *             /* time_rec */
00374            ));
00375
00376 /* New for V2 */
00377 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_get_mic
00378 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00379             gss_ctx_id_t,               /* context_handle */
00380             gss_qop_t,                  /* qop_req */
00381             gss_buffer_t,               /* message_buffer */
00382             gss_buffer_t                /* message_token */
00383            ));
00384
00385 /* New for V2 */
00386 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_verify_mic
00387 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00388             gss_ctx_id_t,               /* context_handle */
00389             gss_buffer_t,               /* message_buffer */
00390             gss_buffer_t,               /* message_token */
00391             gss_qop_t *                 /* qop_state */
00392            ));
00393
00394 /* New for V2 */
00395 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_wrap
00396 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00397             gss_ctx_id_t,               /* context_handle */
00398             int,                        /* conf_req_flag */
00399             gss_qop_t,                  /* qop_req */
00400             gss_buffer_t,               /* input_message_buffer */
00401             int FAR *,                  /* conf_state */
00402             gss_buffer_t                /* output_message_buffer */
00403            ));
00404
00405 /* New for V2 */
00406 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_unwrap
00407 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00408             gss_ctx_id_t,               /* context_handle */
00409             gss_buffer_t,               /* input_message_buffer */
00410             gss_buffer_t,               /* output_message_buffer */
00411             int FAR *,                  /* conf_state */
00412             gss_qop_t FAR *             /* qop_state */
00413            ));
00414
00415 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_display_status
00416 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00417             OM_uint32,                  /* status_value */
00418             int,                        /* status_type */
00419             gss_OID,                    /* mech_type (used to be const) */
00420             OM_uint32 FAR *,            /* message_context */
00421             gss_buffer_t                /* status_string */
00422            ));
00423
00424 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_indicate_mechs
00425 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00426             gss_OID_set FAR *           /* mech_set */
00427            ));
00428
00429 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_compare_name
00430 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00431             gss_name_t,                 /* name1 */
00432             gss_name_t,                 /* name2 */
00433             int FAR *                   /* name_equal */
00434            ));
00435
00436 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_display_name
00437 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00438             gss_name_t,                 /* input_name */
00439             gss_buffer_t,               /* output_name_buffer */
00440             gss_OID FAR *               /* output_name_type */
00441            ));
00442
00443 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_import_name
00444 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00445             gss_buffer_t,               /* input_name_buffer */
00446             gss_OID,                    /* input_name_type(used to be const) */
00447             gss_name_t FAR *            /* output_name */
00448            ));
00449
00450 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_release_name
00451 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00452             gss_name_t FAR *            /* input_name */
00453            ));
00454
00455 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_release_buffer
00456 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00457             gss_buffer_t                /* buffer */
00458            ));
00459
00460 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_release_oid_set
00461 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00462             gss_OID_set FAR *           /* set */
00463            ));
00464
00465 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_inquire_cred
00466 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00467             gss_cred_id_t,              /* cred_handle */
00468             gss_name_t FAR *,           /* name */
00469             OM_uint32 FAR *,            /* lifetime */
00470             gss_cred_usage_t FAR *,     /* cred_usage */
00471             gss_OID_set FAR *           /* mechanisms */
00472            ));
00473
00474 /* Last argument new for V2 */
00475 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_inquire_context
00476 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00477             gss_ctx_id_t,               /* context_handle */
00478             gss_name_t FAR *,           /* src_name */
00479             gss_name_t FAR *,           /* targ_name */
00480             OM_uint32 FAR *,            /* lifetime_rec */
00481             gss_OID FAR *,              /* mech_type */
00482             OM_uint32 FAR *,            /* ctx_flags */
00483             int FAR *,                  /* locally_initiated */
00484             int FAR *                   /* open */
00485            ));
00486
00487 /* New for V2 */
00488 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_wrap_size_limit
00489 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00490             gss_ctx_id_t,               /* context_handle */
00491             int,                        /* conf_req_flag */
00492             gss_qop_t,                  /* qop_req */
00493             OM_uint32,                  /* req_output_size */
00494             OM_uint32 *                 /* max_input_size */
00495            ));
00496
00497 /* New for V2 */
00498 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_import_name_object
00499 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00500             void FAR *,                 /* input_name */
00501             gss_OID,                    /* input_name_type */
00502             gss_name_t FAR *            /* output_name */
00503            ));
00504
00505 /* New for V2 */
00506 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_export_name_object
00507 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00508             gss_name_t,                 /* input_name */
00509             gss_OID,                    /* desired_name_type */
00510             void FAR * FAR *            /* output_name */
00511            ));
00512
00513 /* New for V2 */
00514 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_add_cred
00515 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00516             gss_cred_id_t,              /* input_cred_handle */
00517             gss_name_t,                 /* desired_name */
00518             gss_OID,                    /* desired_mech */
00519             gss_cred_usage_t,           /* cred_usage */
00520             OM_uint32,                  /* initiator_time_req */
00521             OM_uint32,                  /* acceptor_time_req */
00522             gss_cred_id_t FAR *,        /* output_cred_handle */
00523             gss_OID_set FAR *,          /* actual_mechs */
00524             OM_uint32 FAR *,            /* initiator_time_rec */
00525             OM_uint32 FAR *             /* acceptor_time_rec */
00526            ));
00527
00528 /* New for V2 */
00529 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_inquire_cred_by_mech
00530 PROTOTYPE( (OM_uint32  FAR *,           /* minor_status */
00531             gss_cred_id_t,              /* cred_handle */
00532             gss_OID,                    /* mech_type */
00533             gss_name_t FAR *,           /* name */
00534             OM_uint32 FAR *,            /* initiator_lifetime */
00535             OM_uint32 FAR *,            /* acceptor_lifetime */
00536             gss_cred_usage_t FAR *      /* cred_usage */
00537            ));
00538
00539 /* New for V2 */
00540 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_export_sec_context
00541 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00542             gss_ctx_id_t FAR *,         /* context_handle */
00543             gss_buffer_t                /* interprocess_token */
00544            ));
00545
00546 /* New for V2 */
00547 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_import_sec_context
00548 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00549             gss_buffer_t,               /* interprocess_token */
00550             gss_ctx_id_t FAR *          /* context_handle */
00551            ));
00552
00553 /* New for V2 */
00554 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_release_oid
00555 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00556             gss_OID FAR *               /* oid */
00557            ));
00558
00559 /* New for V2 */
00560 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_create_empty_oid_set
00561 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00562             gss_OID_set FAR *           /* oid_set */
00563            ));
00564
00565 /* New for V2 */
00566 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_add_oid_set_member
00567 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00568             gss_OID,                    /* member_oid */
00569             gss_OID_set FAR *           /* oid_set */
00570            ));
00571
00572 /* New for V2 */
00573 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_test_oid_set_member
00574 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00575             gss_OID,                    /* member */
00576             gss_OID_set,                /* set */
00577             int FAR *                   /* present */
00578            ));
00579
00580 /* New for V2 */
00581 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_str_to_oid
00582 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00583             gss_buffer_t,               /* oid_str */
00584             gss_OID FAR *               /* oid */
00585            ));
00586
00587 /* New for V2 */
00588 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_oid_to_str
00589 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00590             gss_OID,                    /* oid */
00591             gss_buffer_t                /* oid_str */
00592            ));
00593
00594 /* New for V2 */
00595 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_inquire_names_for_mech
00596 PROTOTYPE( (OM_uint32 FAR *,            /* minor_status */
00597             gss_OID,                    /* mechanism */
00598             gss_OID_set FAR *           /* name_types */
00599            ));
00600
00601 /*
00602  * The following routines are obsolete variants of gss_get_mic, gss_wrap,
00603  * gss_verify_mic and gss_unwrap.  They should be provided by GSSAPI V2
00604  * implementations for backwards compatibility with V1 applications.  Distinct
00605  * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
00606  * V1 applications to link against GSSAPI V2 implementations.
00607  */
00608 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_sign
00609 PROTOTYPE( (OM_uint32 FAR *,    /* minor_status */
00610             gss_ctx_id_t,       /* context_handle */
00611             int,                /* qop_req */
00612             gss_buffer_t,       /* message_buffer */
00613             gss_buffer_t        /* message_token */
00614            ));
00615
00616 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_verify
00617 PROTOTYPE( (OM_uint32 FAR *,    /* minor_status */
00618             gss_ctx_id_t,       /* context_handle */
00619             gss_buffer_t,       /* message_buffer */
00620             gss_buffer_t,       /* token_buffer */
00621             int FAR *           /* qop_state */
00622            ));
00623
00624 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_seal
00625 PROTOTYPE( (OM_uint32 FAR *,    /* minor_status */
00626             gss_ctx_id_t,       /* context_handle */
00627             int,                /* conf_req_flag */
00628             int,                /* qop_req */
00629             gss_buffer_t,       /* input_message_buffer */
00630             int FAR *,          /* conf_state */
00631             gss_buffer_t        /* output_message_buffer */
00632            ));
00633
00634 KRB5_DLLIMP OM_uint32 KRB5_CALLCONV gss_unseal
00635 PROTOTYPE( (OM_uint32 FAR *,    /* minor_status */
00636             gss_ctx_id_t,       /* context_handle */
00637             gss_buffer_t,       /* input_message_buffer */
00638             gss_buffer_t,       /* output_message_buffer */
00639             int FAR *,          /* conf_state */
00640             int FAR *           /* qop_state */
00641            ));
00642
00643 /* XXXX these are not part of the GSSAPI C bindings!  (but should be) */
00644
00645    #define GSS_CALLING_ERROR_FIELD(x) \
00646    (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
00647    #define GSS_ROUTINE_ERROR_FIELD(x) \
00648    (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
00649    #define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
00650    (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
00651
00652 /* XXXX This is a necessary evil until the spec is fixed */
00653    #define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
00654
00655 #endif /* _GSSAPI_H_ */
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/DataTypeEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

DataTypeEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: DataTypeEnum
00019
00020 public class DataTypeEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adEmpty = 0;
00023   public static final short adTinyInt = 16;
00024   public static final short adSmallInt = 2;
00025   public static final short adInteger = 3;
00026   public static final short adBigInt = 20;
00027   public static final short adUnsignedTinyInt = 17;
00028   public static final short adUnsignedSmallInt = 18;
00029   public static final short adUnsignedInt = 19;
00030   public static final short adUnsignedBigInt = 21;
00031   public static final short adSingle = 4;
00032   public static final short adDouble = 5;
00033   public static final short adCurrency = 6;
00034   public static final short adDecimal = 14;
00035   public static final short adNumeric = 131;
00036   public static final short adBoolean = 11;
00037   public static final short adError = 10;
00038   public static final short adUserDefined = 132;
00039   public static final short adVariant = 12;
00040   public static final short adIDispatch = 9;
00041   public static final short adIUnknown = 13;
00042   public static final short adGUID = 72;
00043   public static final short adDate = 7;
00044   public static final short adDBDate = 133;
00045   public static final short adDBTime = 134;
00046   public static final short adDBTimeStamp = 135;
00047   public static final short adBSTR = 8;
00048   public static final short adChar = 129;
00049   public static final short adVarChar = 200;
00050   public static final short adLongVarChar = 201;
00051   public static final short adWChar = 130;
00052   public static final short adVarWChar = 202;
00053   public static final short adLongVarWChar = 203;
00054   public static final short adBinary = 128;
00055   public static final short adVarBinary = 204;
00056   public static final short adLongVarBinary = 205;
00057   public static final short adChapter = 136;
00058   public static final short adFileTime = 64;
00059   public static final short adDBFileTime = 137;
00060   public static final short adPropVariant = 138;
00061   public static final short adVarNumeric = 139;
00062 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/FontView/Display.c Source File

  • Multimedia
  • Gdi
  • Fonts
  • FontView

Display.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 #include <windows.h>
00013 #include <string.h>
00014 #include <stdio.h>
00015 #include <math.h>
00016
00017 // These are the 'exported' functions from this file:
00018 void DrawAscii (HDC hdc, RECT *pRect, WORD direction);
00019 void DrawGlyph (HDC hdc, RECT *pRect, BYTE glyph, HFONT hfont);
00020 BYTE FindChar (HDC hdc, RECT *pRect, int x, int y);
00021
00022 #pragma warning(4 : 4309)
00023 // A data structure that DrawAscii will use:
00024 char ascii[]=
00025     {
00026     // Low Ascii:
00027
00028     1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
00029     20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
00030
00031     // Standard Ascii:
00032
00033     ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',',
00034     '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
00035     ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F',
00036     'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
00037     'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`',
00038     'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
00039     'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
00040     '{', '|', '}', '~', '',
00041
00042     // High Ascii:
00043
00044     '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
00045     '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
00046     '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
00047     '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
00048     '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
00049     '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
00050     '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
00051     '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
00052
00053     '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
00054     '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
00055     '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
00056     '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
00057     '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
00058     '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
00059     '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
00060     '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
00061
00062
00063     // End of the list:
00064
00065     000, 000};
00066 #pragma warning(3 : 4309)
00067
00068 /* A function that the CharSet window will use to display the text */
00069 void DrawAscii (HDC hdc, RECT *pRect, WORD direction)
00070 {
00071     BYTE *pch;
00072     int h, w, incx, incy, width;
00073     unsigned int  wDisplay;
00074     POINT pt;
00075     TEXTMETRIC tm;
00076
00077
00078     GetTextMetrics (hdc, &tm);
00079     h = tm.tmHeight;
00080     w = tm.tmMaxCharWidth;
00081
00082     incx = 0;
00083     incy = h;
00084     pt.x = 0;
00085     pt.y = 0;
00086
00087     //
00088     pt.y = tm.tmAscent + tm.tmExternalLeading;
00089     //
00090
00091     pch = (BYTE*)&(ascii[tm.tmFirstChar]);
00092
00093     if (!pRect)     // check pRect validity
00094     {
00095         return;
00096     }
00097
00098     wDisplay = pRect->right -pRect->left;
00099
00100     //
00101     SetTextAlign (hdc, TA_BASELINE | TA_CENTER);
00102     SetBkMode (hdc, TRANSPARENT);
00103     //
00104
00105     while (pch[0] && (pch[0]<=tm.tmLastChar)) {
00106         SIZE size;
00107         GetTextExtentPoint (hdc, (LPCTSTR)pch, 1, &size);
00108         width = size.cx;
00109         if ((unsigned)(pt.x + width) > wDisplay) {
00110             pt.x = 0;
00111             pt.y += incy;
00112         }
00113         TextOut (hdc, pt.x + (width/2), pt.y, (LPCTSTR)pch, 1);
00114         pt.x += width;
00115         pch++;
00116     }
00117     return;
00118
00119     direction;
00120 }
00121
00122 // Return the character that was drawn at the provided location
00123 // This allows us to 'click' on a character, and determined what
00124 // it was we actually clicked on.
00125 BYTE FindChar (HDC hdc, RECT *pRect, int x, int y)
00126 {
00127     BYTE *pch;
00128     int h, w, incx, incy, width;
00129     unsigned int wDisplay;
00130     POINT pt;
00131     TEXTMETRIC tm;
00132
00133
00134     GetTextMetrics (hdc, &tm);
00135     h = tm.tmHeight;
00136     w = tm.tmMaxCharWidth;
00137
00138     incx = 0;
00139     incy = h;
00140     pt.x = 0;
00141     pt.y = 0;
00142
00143     pch = (BYTE*)&(ascii[tm.tmFirstChar]);
00144
00145     if (!pRect)
00146     {
00147         return 0xFF;
00148     }
00149
00150     wDisplay = pRect->right -pRect->left;
00151
00152     while (pch[0] && (pch[0]<=tm.tmLastChar)) {
00153     SIZE size;
00154         GetTextExtentPoint (hdc, (LPCTSTR)pch, 1, &size);
00155         width = size.cx;
00156         if ((unsigned)(pt.x + width) > wDisplay) {
00157             pt.x = 0;
00158             pt.y += incy;
00159         }
00160         if ((x>=pt.x) && (x <=(pt.x+width)) && (y>=pt.y) && (y<=pt.y+incy)) {
00161             return pch[0];
00162         }
00163         pt.x += width;
00164         pch++;
00165     }
00166     return 0;
00167 }
00168
00169 // Essentially, a StretchBlt, but draws cicular pels.
00170 BOOL CircleBlt (HDC hdcDest, int xDst, int yDst, int iWidthDst, int iHeightDst, HDC hdcSrc, int xSrc, int ySrc, int iWidthSrc, int iHeightSrc, DWORD dwROP)
00171 {
00172     int x, y, x1, y1, x2, y2;
00173     DWORD rgb;
00174     float fXUnit, fYUnit;
00175     HBRUSH hbrush, hbrushOld;
00176
00177     if (iWidthSrc != 0){
00178         fXUnit = (float)iWidthDst / (float)iWidthSrc;
00179     } else {
00180         fXUnit = (float)iWidthDst;
00181     }
00182     if (iHeightSrc != 0) {
00183         fYUnit = (float)iHeightDst / (float)iHeightSrc;
00184     } else {
00185         fYUnit = (float)iHeightDst;
00186     }
00187
00188     for (y=ySrc; y<(ySrc+iHeightSrc); y++) {
00189         for (x=xSrc; x<(xSrc+iWidthSrc); x++) {
00190
00191             rgb = GetPixel (hdcSrc, x, y);
00192             if (rgb != -1 && rgb != 0x00FFFFFF) {
00193                 hbrush = CreateSolidBrush (rgb);
00194                 hbrushOld = SelectObject (hdcDest, hbrush);
00195                 x1 = xDst + (int)((x-xSrc)*fXUnit);
00196                 y1 = yDst + (int)((y-ySrc)*fYUnit);
00197                 x2 = xDst + (int)(((x-xSrc)+1)*fXUnit)+1;
00198                 y2 = yDst + (int)(((y-ySrc)+1)*fYUnit)+1;
00199                 Ellipse (hdcDest, x1, y1, x2, y2);
00200                 DeleteObject(SelectObject(hdcDest, hbrushOld));
00201             }
00202         }
00203     }
00204
00205     return TRUE;
00206
00207     dwROP;
00208 }
00209
00210 double Radian(double ang)
00211 {
00212         return ang * (double)3.1415926535 / (double)180.0;
00213 }
00214
00215 void CalcRot (double x, double y, double ang, double* x1, double* y1)
00216 {
00217         ang = Radian(-ang);
00218         *x1 = (x * cos(ang)) - (y * sin(ang));
00219         *y1 = (x * sin(ang)) + (y * cos(ang));
00220 }
00221
00222 void DrawGlyph (HDC hdc, RECT *pRect, BYTE glyph, HFONT hfont)
00223 {
00224     TEXTMETRIC tm;
00225     LOGFONT lf;
00226     int wChar, h1, h2, w1, w2, x, y;
00227     double xTL, yTL, xTR, yTR, xBL, yBL, xBR, yBR, xML, yML, xMR, yMR;
00228     int cWidth, cExtentW, cExtentH;
00229     int unit, margin;
00230     RECT rect, rectChar;
00231     HDC hdcMem;
00232     HBITMAP hbitmap, hbitmapOld;
00233     HFONT hfontOld, hfontTmp;
00234     char szText[80];
00235     double fAng, fWa, fWb, fHa, fHb, fHeight, fWidth;
00236     BOOL bRotateable;
00237     double fxOff, fyOff;
00238 #if defined(TT_AVAILABLE)
00239     ABC abc;
00240 #endif
00241
00242     GetTextMetrics (hdc, &tm);
00243     hfontTmp = SelectObject (hdc, GetStockObject(SYSTEM_FONT));
00244     GetObject (hfontTmp, sizeof(LOGFONT), &lf);
00245
00246 // Some fields of 'lf' need to be whacked out depending on the type of
00247 // font involved. For instance, lfEscapement should only be non-zero for
00248 // rotatable fonts.
00249         bRotateable = FALSE;
00250 #if defined (TMPF_VECTOR)
00251         bRotateable = (tm.tmPitchAndFamily & TMPF_VECTOR);
00252 #endif
00253 #if defined (TMPF_TRUETYPE)
00254         bRotateable |= (tm.tmPitchAndFamily & TMPF_TRUETYPE);
00255 #endif
00256         if (!bRotateable) {
00257                 lf.lfEscapement = 0;
00258         }
00259
00260     SelectObject (hdc, hfontTmp);
00261     GetCharWidth (hdc, glyph, glyph, &cWidth);
00262
00263     {
00264         SIZE size;
00265         GetTextExtentPoint (hdc, (LPSTR)&glyph, 1, &size);
00266         cExtentW = size.cx;
00267         cExtentH = size.cy;
00268     }
00269
00270     wChar = max(cWidth, cExtentW);
00271
00272 #if defined(TT_AVAILABLE)
00273     if (GetCharABCWidths (hdc, (UINT)glyph, (UINT)glyph, &abc)) {
00274         wChar = abc.abcA + abc.abcB + abc.abcC;
00275         wChar = max(abc.abcA,0) + max (abc.abcB,0) + max (abc.abcC,0);
00276     } else {
00277         abc.abcA = 0;
00278         abc.abcB = wChar;
00279         abc.abcC = 0;
00280     }
00281 #endif
00282
00283 // ****
00284         // Lets figure out how large of a bitmap we need to draw this character into.
00285         // This will take lfEscapement into account.
00286
00287         // Turn the 'escapement' value into a valid angle
00288     fAng = 90.0 - ((double)lf.lfEscapement/10.0);
00289
00290     // We now need to calculate two values for height and width. These
00291     // represent the bases of the triangles that are formed as the
00292     // character cell rotates. Thus fWa+fWb is the 'width' of the space
00293     // required by the given character at the current rotation.
00294     // At 0, 90, 180, 270 and 360, one of the two values will be '0'.
00295     fWa = (double)cExtentW * sin(Radian(fAng));
00296     fHa = (double)cExtentW * sin(Radian((double)lf.lfEscapement/10.0));
00297     fHb = (double)cExtentH * sin(Radian(fAng));
00298     fWb = (double)cExtentH * sin(Radian((double)lf.lfEscapement/10.0));
00299
00300     // This gives us a width/height of:
00301     fHeight = fabs(fHa) + fabs(fHb);
00302     fWidth = fabs(fWa) + fabs(fWb);
00303 // ****
00304
00305     if (!pRect) //check for pRect validity
00306     {
00307         return;
00308     }
00309
00310     h1 = pRect->bottom - pRect->top;
00311     h2 = tm.tmHeight + tm.tmExternalLeading;
00312     h2 = (int)fHeight;
00313     if (h2 == 0) {
00314         MessageBeep (0);
00315         h2 = 10;
00316     }
00317
00318     w1 = pRect->right - pRect->left;
00319     w2 = (int)fWidth;
00320
00321     unit = (h1 / h2);
00322
00323     margin = (h1 - (unit * h2)) / 2;
00324     margin = 0;
00325     // Define a rectangle that will enclose our drawing area
00326     SetRect (&rect, 0, 0, wChar*unit, (tm.tmHeight*unit) + (tm.tmExternalLeading*unit));
00327     OffsetRect (&rect, margin, margin);
00328     // Define a rectangle that will define the bounding box of the character
00329     SetRect (&rectChar, 0, 0, wChar*unit, tm.tmHeight*unit);
00330     OffsetRect (&rectChar, margin, margin + (tm.tmExternalLeading*unit));
00331
00332
00333 // ****
00334     // These are floating point values.
00335     SetRect (&rect, 0, 0, (int)(fWidth)*unit, ((int)(fHeight)*unit) + (tm.tmExternalLeading*unit));
00336     OffsetRect (&rect, margin, margin);
00337     // Define a rectangle that will define the bounding box of the character
00338     SetRect (&rectChar, 0, 0, (int)(fWidth)*unit, ((int)(fHeight)*unit));
00339     OffsetRect (&rectChar, margin, margin + (tm.tmExternalLeading*unit));
00340
00341     // Calculate the points of the 'character cell'. This will take full
00342     // rotation into consideration.
00343         CalcRot (0, 0, (double)lf.lfEscapement/10.0, &xTL, &yTL);
00344         CalcRot ((double)cExtentW, 0, (double)lf.lfEscapement/10.0, &xTR, &yTR);
00345         CalcRot (0, (double)cExtentH, (double)lf.lfEscapement/10.0, &xBL, &yBL);
00346         CalcRot ((double)cExtentW, (double)cExtentH, (double)lf.lfEscapement/10.0, &xBR, &yBR);
00347         CalcRot (0, (double)tm.tmAscent, (double)lf.lfEscapement/10.0, &xML, &yML);
00348         CalcRot ((double)cExtentW, (double)tm.tmAscent, (double)lf.lfEscapement/10.0, &xMR, &yMR);
00349
00350         fxOff = min(xTL, min(xTR, min(xBL, xBR)));
00351         fyOff = min(yTL, min(yTR, min(yBL, yBR)));
00352
00353 // Draw a rectangle around the drawing limits of the character.
00354     MoveToEx (hdc, (int)((xTL-fxOff)*(double)unit), (int)((yTL-fyOff)*(double)unit), NULL);
00355     LineTo (hdc, (int)((xTR-fxOff)*(double)unit), (int)((yTR-fyOff)*(double)unit));
00356     LineTo (hdc, (int)((xBR-fxOff)*(double)unit), (int)((yBR-fyOff)*(double)unit));
00357     LineTo (hdc, (int)((xBL-fxOff)*(double)unit), (int)((yBL-fyOff)*(double)unit));
00358     LineTo (hdc, (int)((xTL-fxOff)*(double)unit), (int)((yTL-fyOff)*(double)unit));
00359
00360 // Draw the baseline, which indicates the advance width of the character
00361     MoveToEx (hdc, (int)((xML-fxOff)*(double)unit), (int)((yML-fyOff)*(double)unit), NULL);
00362     LineTo (hdc, (int)((xMR-fxOff)*(double)unit), (int)((yMR-fyOff)*(double)unit));
00363
00364     hdcMem = CreateCompatibleDC (hdc);
00365     if (hdcMem) {
00366         hbitmap = CreateCompatibleBitmap (hdc, (int)(fWidth), (int)(fHeight));
00367         if (hbitmap) {
00368             hbitmapOld = SelectObject (hdcMem, hbitmap);
00369             BitBlt (hdcMem, 0, 0, (int)(fWidth), (int)(fHeight), NULL, 0, 0, WHITENESS);
00370             hfontOld = SelectObject (hdcMem, hfont);
00371
00372             SetTextAlign (hdcMem, TA_LEFT | TA_BASELINE);
00373             if (TextOut (hdcMem, (int)(xML-fxOff), (int)(yML-fyOff), (LPSTR)&glyph, 1)) {
00374
00375
00376                                 /*
00377                 // Just for debugging, lets mark some special pixels
00378                         SetPixel (hdcMem, (int)(xML-fxOff), (int)(yML-fyOff), 0x808080); // Base Lft
00379                         SetPixel (hdcMem, (int)(xTL-fxOff), (int)(yTL-fyOff), 0x808080); // Top Left
00380                         SetPixel (hdcMem, (int)(xTR-fxOff), (int)(yTR-fyOff), 0x808080); // Top Right
00381                         SetPixel (hdcMem, (int)(xBL-fxOff), (int)(yBL-fyOff), 0x808080); // Btm Left
00382                         SetPixel (hdcMem, (int)(xBR-fxOff), (int)(yBR-fyOff), 0x808080); // Btm Right
00383                         SetPixel (hdcMem, (int)(xML-fxOff), (int)(yML-fyOff), 0x808080); // Base Lft
00384                         SetPixel (hdcMem, (int)(xMR-fxOff), (int)(yMR-fyOff), 0x808080); // Base Rt
00385                 */
00386
00387                 CircleBlt(hdc, margin, margin,
00388                     rectChar.right-rectChar.left, rectChar.bottom-rectChar.top,
00389                     hdcMem, 0, 0, (int)(fWidth), (int)(fHeight), SRCPAINT);
00390
00391             } else {
00392                 MessageBox (GetFocus(),
00393                         "Unable to perform TextOut", "DisplayGlyph", MB_OK);
00394             }
00395             SelectObject (hdcMem, hbitmapOld);
00396             SelectObject (hdcMem, hfontOld);
00397             DeleteObject (hbitmap);
00398         } else {
00399             MessageBox (GetFocus(), "Unable To create Bitmap", "DisplayGlyph", MB_OK);
00400         }
00401         DeleteDC (hdcMem);
00402     } else {
00403         MessageBox (GetFocus(), "Unable to create DC", "DisplayGlyph", MB_OK);
00404     }
00405
00406     hfontTmp = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH | FF_SWISS, "");
00407
00408     if (hfontTmp) {
00409         hfontOld = SelectObject (hdc, hfontTmp);
00410         x = rect.right + 10;
00411         GetTextMetrics (hdc, &tm);
00412
00413         y = tm.tmHeight + tm.tmExternalLeading;
00414
00415         y += tm.tmHeight + tm.tmExternalLeading;
00416         _snprintf (szText, sizeof(szText) - 1, "Character = '%c' %u (0x%X)", (char)glyph, (int)glyph, (int)glyph);
00417         szText[sizeof(szText) - 1] = '\0';
00418         TextOut (hdc, x, y, szText, lstrlen(szText));
00419
00420         y += tm.tmHeight + tm.tmExternalLeading;
00421         _snprintf (szText, sizeof(szText) - 1, "CharWidth = %i", cWidth);
00422         szText[sizeof(szText) - 1] = '\0';
00423         TextOut (hdc, x, y, szText, lstrlen(szText));
00424
00425                 // ABC Width - Eventually, I want to 'draw' this into the character
00426                 // cell, but for now, this at least makes the information easily
00427                 // available:
00428 #if defined (TT_AVAILABLE)
00429         y += tm.tmHeight + tm.tmExternalLeading;
00430         _snprintf (szText, sizeof(szText) - 1, "A|B|C = %i | %u | %i", abc.abcA, abc.abcB, abc.abcC);
00431         szText[sizeof(szText) - 1] = '\0';
00432         TextOut (hdc, x, y, szText, lstrlen(szText));
00433 #endif
00434
00435         y += tm.tmHeight + tm.tmExternalLeading;
00436         _snprintf (szText, sizeof(szText) - 1, "CharExtentW = %i", cExtentW);
00437         szText[sizeof(szText) - 1] = '\0';
00438         TextOut (hdc, x, y, szText, lstrlen(szText));
00439
00440         y += tm.tmHeight + tm.tmExternalLeading;
00441         _snprintf (szText, sizeof(szText) - 1, "CharExtentH = %i", cExtentH);
00442         szText[sizeof(szText) - 1] = '\0';
00443         TextOut (hdc, x, y, szText, lstrlen(szText));
00444
00445                 // These are for some values I was using to debug the character
00446                 // cell rotation calculation:
00447
00448         //y += tm.tmHeight + tm.tmExternalLeading;
00449         //wsprintf (szText, "(%i,%i) : (%i,%i) [%i]", (int)xTL, (int)yTL, (int)xTR, (int)yTR,(int)(((double)lf.lfEscapement/10.0)*10));
00450         //TextOut (hdc, x, y, szText, lstrlen(szText));
00451
00452         //y += tm.tmHeight + tm.tmExternalLeading;
00453         //wsprintf (szText, "(%i,%i) : (%i,%i)", (int)xML, (int)yML, (int)xMR, (int)yMR);
00454         //TextOut (hdc, x, y, szText, lstrlen(szText));
00455
00456         //y += tm.tmHeight + tm.tmExternalLeading;
00457         //wsprintf (szText, "(%i,%i) : (%i,%i)", (int)xBL, (int)yBL, (int)xBR, (int)yBR);
00458         //TextOut (hdc, x, y, szText, lstrlen(szText));
00459
00460         //y += tm.tmHeight + tm.tmExternalLeading;
00461         //wsprintf (szText, "fAng = %i", (int)(fAng));
00462         //TextOut (hdc, x, y, szText, lstrlen(szText));
00463
00464         //y += tm.tmHeight + tm.tmExternalLeading;
00465         //wsprintf (szText, "fHa = %i", (int)(fHa));
00466         //TextOut (hdc, x, y, szText, lstrlen(szText));
00467
00468         //y += tm.tmHeight + tm.tmExternalLeading;
00469         //wsprintf (szText, "fHb = %i", (int)(fHb));
00470         //TextOut (hdc, x, y, szText, lstrlen(szText));
00471
00472         //y += tm.tmHeight + tm.tmExternalLeading;
00473         //wsprintf (szText, "fWa = %i", (int)(fWa));
00474         //TextOut (hdc, x, y, szText, lstrlen(szText));
00475
00476         //y += tm.tmHeight + tm.tmExternalLeading;
00477         //wsprintf (szText, "fWb = %i", (int)(fWb));
00478         //TextOut (hdc, x, y, szText, lstrlen(szText));
00479
00480         //y += tm.tmHeight + tm.tmExternalLeading;
00481         //wsprintf (szText, "fWd = %i", (int)(fWd));
00482         //TextOut (hdc, x, y, szText, lstrlen(szText));
00483
00484         //y += tm.tmHeight + tm.tmExternalLeading;
00485         //wsprintf (szText, "fHd = %i", (int)(fHd));
00486         //TextOut (hdc, x, y, szText, lstrlen(szText));
00487
00488         //y += tm.tmHeight + tm.tmExternalLeading;
00489         //wsprintf (szText, "fHeight = %i", (int)(fHeight));
00490         //TextOut (hdc, x, y, szText, lstrlen(szText));
00491
00492         //y += tm.tmHeight + tm.tmExternalLeading;
00493         //wsprintf (szText, "fWidth = %i", (int)(fWidth));
00494         //TextOut (hdc, x, y, szText, lstrlen(szText));
00495
00496         SelectObject (hdc, hfontOld);
00497         DeleteObject (hfontTmp);
00498     }
00499 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CComboBoxEx Member List

This is the complete list of members for CComboBoxEx, including all inherited members.
AddString(WCHAR *pwszString) | CComboBoxEx | [inline, virtual]
AddString(WCHAR *pwszString, LPARAM lParam) | CComboBoxEx | [inline, virtual]
CComboBoxEx(HWND hWndParent=NULL, UINT nID=0) | CComboBoxEx |
CComboBoxLite(HWND hWndParent=NULL, UINT nID=0) | CComboBoxLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DeleteString(INDEX nIndex) | CComboBoxLite | [inline, virtual]
DestroyWindow() | CWndLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
FindString(WCHAR *pwszString, INDEX nStartIndex=-1) | CComboBoxEx | [inline, virtual]
FindStringExact(WCHAR *pwszString, INDEX nStartIndex=-1) | CComboBoxLite | [inline, virtual]
GetCount() | CComboBoxLite | [inline, virtual]
GetCurSel() const | CComboBoxLite | [inline, virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetItemParam(INDEX nIndex) const | CComboBoxLite | [inline, virtual]
GetSelText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CComboBoxLite | [virtual]
GetSelValue() | CComboBoxLite | [virtual]
GetText(INDEX nIndex, WCHAR *pwszBuffer) | CComboBoxLite | [inline, virtual]
GetTextLength(INDEX nIndex) | CComboBoxLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
InsertItem(INDEX iItem, WCHAR *pwszName, LPARAM lParam=PARAM_NONE, INT iIndent=PARAM_NONE, INT iImage=IMAGE_NONE, UINT iSelectedImage=IMAGE_NONE) | CComboBoxEx |
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iSavedSel | CComboBoxLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropDown(INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CComboBoxEx | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSelChange(INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
Populate(ULONG cItems, const WIDENAMEMAP *rgItems) | CComboBoxLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
ResetContent() | CComboBoxLite | [inline, virtual]
RestoreSelection() | CComboBoxLite | [inline, virtual]
SaveSelection() | CComboBoxLite | [inline, virtual]
SetCurSel(WPARAM nSelect) | CComboBoxLite | [inline, virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetItemParam(INDEX nIndex, LPARAM lParam) | CComboBoxLite | [inline, virtual]
SetSelText(WCHAR *pwszBuffer, BOOL fAddItem=FALSE) | CComboBoxLite | [virtual]
SetSelValue(LPARAM lParam) | CComboBoxLite | [virtual]
SetUnicodeFormat(BOOL fUnicode=TRUE) | CComboBoxEx | [inline, virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CComboBoxEx() | CComboBoxEx | [virtual]
~CComboBoxLite() | CComboBoxLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:55:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ConnectOptionEnum Member List

This is the complete list of members for msado15::ConnectOptionEnum, including all inherited members.
adAsyncConnect | msado15::ConnectOptionEnum | [static]
adConnectUnspecified | msado15::ConnectOptionEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/palette/Mypal.h Source File

  • Multimedia
  • Gdi
  • palette

Mypal.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 // Porting macros
00013
00014 #ifdef WIN32
00015 typedef POINTS  MPOINT;
00016 #define LONG2POINT(l, pt)  ((pt).x = (SHORT)LOWORD(l), (pt).y = (SHORT)HIWORD(l))
00017 #else
00018 typedef POINT   MPOINT;
00019 #define LONG2POINT(l, pt)  ((pt).x = (INT)LOWORD(l), (pt).y = (INT)HIWORD(l))
00020 #endif
00021
00022
00023 #define PALETTESIZE     256    /* Number of entries in the system palette     */
00024
00025 typedef struct tagRGPT {       /* Values for setting Min Max info             */
00026     INT iInfo[10];
00027 } RGPT;
00028 typedef RGPT FAR *LPRGPT;
00029
00030 extern VOID ShowColor(HWND, HDC);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/EdCommands.cpp Source File

  • Web
  • Browser
  • EditFeatures

EdCommands.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2000 Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // EdCommands.cpp : Implementation of WinMain
00006
00007 // Note: Proxy/Stub Information
00008 // To build a separate proxy/stub DLL,
00009 // run nmake -f EdCommandsps.mk in the project directory.
00010
00011 #include "stdafx.h"
00012 #include "resource.h"
00013 #include <initguid.h>
00014 #include "EdCommands.h"
00015
00016 #include "EdCommands_i.c"
00017 #include "BrowserHost.h"
00018
00019 const DWORD dwTimeOut = 5000; // time for EXE to be idle before shutting down
00020 const DWORD dwPause = 1000; // time to wait for threads to finish up
00021
00022 // Passed to CreateThread to monitor the shutdown event
00023 static DWORD WINAPI MonitorProc(void* pv)
00024 {
00025   CExeModule* p = (CExeModule*)pv;
00026   p->MonitorShutdown();
00027   return 0;
00028 }
00029
00030 LONG CExeModule::Unlock()
00031 {
00032   LONG l = CComModule::Unlock();
00033   if (l == 0)
00034   {
00035     bActivity = true;
00036     SetEvent(hEventShutdown); // tell monitor that we transitioned to zero
00037   }
00038   return l;
00039 }
00040
00041 //Monitors the shutdown event
00042 void CExeModule::MonitorShutdown()
00043 {
00044   while (1)
00045   {
00046     WaitForSingleObject(hEventShutdown, INFINITE);
00047     DWORD dwWait=0;
00048     do
00049     {
00050       bActivity = false;
00051       dwWait = WaitForSingleObject(hEventShutdown, dwTimeOut);
00052     } while (dwWait == WAIT_OBJECT_0);
00053
00054     // timed out
00055     if (!bActivity && m_nLockCnt == 0) // if no activity let's really bail
00056     {
00057 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
00058       CoSuspendClassObjects();
00059       if (!bActivity && m_nLockCnt == 0)
00060 #endif
00061         break;
00062     }
00063   }
00064
00065   CloseHandle(hEventShutdown);
00066   PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
00067 }
00068
00069 bool CExeModule::StartMonitor()
00070 {
00071   // CODE REVIEW: Add following security comment.
00072   /* The following use of CreateEvent is simplified for illustrative
00073   purposes. This simplified use in production code can expose a
00074   security risk in some situations. The first parameter might require
00075   specific security attributes. */
00076   hEventShutdown = CreateEvent(NULL, false, false, NULL);
00077   if (hEventShutdown == NULL)
00078     return false;
00079   DWORD dwThreadID;
00080   HANDLE h = CreateThread(NULL, 0, MonitorProc, this, 0, &dwThreadID);
00081   return (h != NULL);
00082 }
00083
00084 CExeModule _Module;
00085
00086 BEGIN_OBJECT_MAP(ObjectMap)
00087   OBJECT_ENTRY(CLSID_BrowserHost, CBrowserHost)
00088 END_OBJECT_MAP()
00089
00090
00091 LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)
00092 {
00093   while (p1 != NULL && *p1 != NULL)
00094   {
00095     LPCTSTR p = p2;
00096     while (p != NULL && *p != NULL)
00097     {
00098       if (*p1 == *p)
00099         return CharNext(p1);
00100
00101       p = CharNext(p);
00102     }
00103
00104     p1 = CharNext(p1);
00105   }
00106   return NULL;
00107 }
00108
00109 /////////////////////////////////////////////////////////////////////////////
00110 //
00111 extern "C" int WINAPI _tWinMain(HINSTANCE hInstance,
00112                 HINSTANCE /*hPrevInstance*/,
00113                 LPTSTR lpCmdLine,
00114                 int /*nShowCmd*/)
00115 {
00116   lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
00117
00118 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
00119   HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00120 #else
00121   HRESULT hRes = CoInitialize(NULL);
00122 #endif
00123
00124   _ASSERTE(SUCCEEDED(hRes));
00125   _Module.Init(ObjectMap, hInstance, &LIBID_EDCOMMANDSLib);
00126   _Module.dwThreadID = GetCurrentThreadId();
00127   TCHAR szTokens[] = _T("-/");
00128
00129   HRESULT hr = E_FAIL;
00130   BOOL bRun = TRUE;
00131   LPCTSTR lpszToken = FindOneOf(lpCmdLine, szTokens);
00132   while (lpszToken != NULL)
00133   {
00134     if (lstrcmpi(lpszToken, _T("UnregServer"))==0)
00135     {
00136       _Module.UpdateRegistryFromResource(IDR_EdCommands, FALSE);
00137       hr = _Module.UnregisterServer(TRUE);
00138       bRun = FALSE;
00139       //if (SUCCEEDED(hr)) MessageBox(NULL, _T("Unregistration Successful"), NULL, NULL);
00140       break;
00141     }
00142
00143     if (lstrcmpi(lpszToken, _T("RegServer"))==0)
00144     {
00145       _Module.UpdateRegistryFromResource(IDR_EdCommands, TRUE);
00146       hr = _Module.RegisterServer(TRUE);
00147       bRun = FALSE;
00148       //if (SUCCEEDED(hr)) MessageBox(NULL, _T("Registration Successful"), NULL, NULL);
00149       break;
00150     }
00151
00152     lpszToken = FindOneOf(lpszToken, szTokens);
00153   }
00154
00155   if (bRun)
00156   {
00157     _Module.StartMonitor();
00158
00159 #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
00160     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
00161                       REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
00162     _ASSERTE(SUCCEEDED(hRes));
00163     hRes = CoResumeClassObjects();
00164 #else
00165     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,
00166                       REGCLS_MULTIPLEUSE);
00167 #endif
00168
00169     _ASSERTE(SUCCEEDED(hRes));
00170
00171     // Create the Browser Window
00172     CComPtr<IBrowserHost> pApp;
00173     CoCreateInstance(CLSID_BrowserHost,
00174              NULL,
00175              CLSCTX_INPROC_SERVER,
00176              IID_IBrowserHost,
00177              (void**)&pApp);
00178     if (pApp)
00179     {
00180       pApp->Run();
00181
00182       long hwnd;
00183       HWND hwndApp;
00184       pApp->GetHwnd(&hwnd);
00185       hwndApp = (HWND)hwnd;
00186
00187       MSG msg;
00188       while (GetMessage(&msg, 0, 0, 0))
00189       {
00190         // Avoid the beep when in the combo box
00191         if (msg.wParam != VK_RETURN && msg.wParam != VK_TAB)
00192           TranslateMessage(&msg);
00193
00194         // If we get a keydown message, we must send the message
00195         // to the container window so that the message can be routed to
00196         // the correct window.  This is necessary so that the container
00197         // window can call TranslateAccelerator on the in-place active
00198         // object and so that VK_RETURN and VK_TAB messages received from
00199         // the combobox in the toolbar will be processed correctly.
00200         if (msg.message == WM_KEYDOWN)
00201           SendMessage(hwndApp, msg.message, msg.wParam, msg.lParam);
00202
00203         DispatchMessage(&msg);
00204       }
00205
00206       _Module.RevokeClassObjects();
00207       Sleep(dwPause); //wait for any threads to finish
00208     }
00209   }
00210
00211   _Module.Term();
00212   CoUninitialize();
00213   return hr;
00214 }
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsSuscriber/NewsSubscriber.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsSuscriber

NewsSubscriber.java

Go to the documentation of this file.
00001 import com.ms.wfc.app.*;
00002 import com.ms.wfc.core.*;
00003 import com.ms.wfc.ui.*;
00004 import com.ms.wfc.html.*;
00005 import com.ms.com.Variant;
00006
00007 /**
00008  * This class can take a variable number of parameters on the command
00009  * line. Program execution begins with the main() method. The class
00010  * constructor is not invoked unless an object of type 'Form1' is
00011  * created in the main() method.
00012  */
00013 public class NewsSubscriber extends Form
00014 {
00015   comadmin.ICOMAdminCatalog admin     = null;
00016   String            cascadeAppName  = null;
00017
00018   public NewsSubscriber()
00019   {
00020     // Required for Visual J++ Form Designer support
00021     initForm();
00022     dllPathTF.setText(helper.sampleConstants.CASCADE_EVENT_DLL);
00023     initAdminCatlog();
00024   }
00025
00026   /**
00027    * Form1 overrides dispose so it can clean up the
00028    * component list.
00029    */
00030   public void dispose()
00031   {
00032     super.dispose();
00033     uninstallCascadeEvent();
00034     components.dispose();
00035
00036   }
00037
00038   /**
00039      * Handle transient subscription processing
00040      *
00041      * @param   ---
00042      * @return      ---
00043      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00044      **/
00045
00046   private void subscribeTransButton_click(Object source, Event e)
00047   {
00048     comadmin.ICatalogCollection   subCollec = null;
00049     String              eventCLSID  = null;
00050
00051     subCollec = (comadmin.ICatalogCollection)(admin.GetCollection("TransientSubscriptions"));
00052     // If cascade radio button is checked then register the transient subscription fot cascade event class
00053     if(cascadeTransRB.getChecked())
00054     {
00055       eventCLSID  = helper.sampleConstants.CASCADE_EVENT_CLSID;
00056       directTransRB.setEnabled(false);
00057     }
00058     // If direct radio button is checked then register the transient subscription fot news event class
00059     else if(directTransRB.getChecked())
00060     {
00061       eventCLSID  = helper.sampleConstants.EVENT_CLSID;
00062       cascadeTransRB.setEnabled(false);
00063     }
00064     if((subscribeTransButton.getText()).equals("Subscribe"))
00065     {
00066       //Register the subscription.
00067       updateSubscription(subCollec,helper.sampleConstants.TRANSIENT_NAME,eventCLSID,helper.sampleConstants.SUBSCRIBE_FLAG);
00068       subscribeTransButton.setText("Unsubscribe");
00069     }
00070     else
00071     {
00072       //Unsubscribe the subscription.
00073       updateSubscription(subCollec,helper.sampleConstants.TRANSIENT_NAME,eventCLSID,helper.sampleConstants.UNSUBSCRIBE_FLAG);
00074       subscribeTransButton.setText("Subscribe");
00075       if(!((installCascadeButton.getText()).equals("Install")))
00076       {
00077         cascadeTransRB.setEnabled(true);
00078       }
00079       directTransRB.setEnabled(true);
00080     }
00081   }
00082
00083   private void clearButton_click(Object source, Event e)
00084   {
00085     eventList.removeAll();
00086   }
00087
00088   /**
00089      * Handle persistent subscription processing
00090      *
00091      * @param   ---
00092      * @return      ---
00093      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00094      **/
00095   private void subscribePersisButton_click(Object source, Event e)
00096   {
00097     comadmin.ICatalogCollection   appCollec = null;
00098     String              eventCLSID  = null;
00099
00100
00101     appCollec = (comadmin.ICatalogCollection)(admin.GetCollection("Applications"));
00102     // If cascade radio button is checked then register the persistent subscription fot cascade event class
00103     if(cascadePersisRB.getChecked())
00104     {
00105       eventCLSID  = helper.sampleConstants.CASCADE_EVENT_CLSID;
00106       directPersisRB.setEnabled(false);
00107     }
00108     // If direct radio button is checked then register the persistent subscription fot news event class
00109     else if(directPersisRB.getChecked())
00110     {
00111       eventCLSID  = helper.sampleConstants.EVENT_CLSID;
00112       cascadePersisRB.setEnabled(false);
00113     }
00114     if((subscribePersisButton.getText()).equals("Subscribe"))
00115     {
00116       // Register the subscription.
00117       checkForApplication(appCollec, helper.sampleConstants.INSTALL_FLAG,helper.sampleConstants.SUBSCRIBER_NAME , helper.sampleConstants.PERSIS_EVENT_NAME ,helper.sampleConstants.PERSIS_NAME, eventCLSID , helper.sampleConstants.SUBSCRIBE_FLAG );
00118       subscribePersisButton.setText("Unsubscribe");
00119       if(queuedPersisCB.getChecked())
00120       {
00121         queuedPersisCB.setEnabled(false);
00122       }
00123     }
00124     else // Unsubscribe Persistent subscription.
00125     {
00126       checkForApplication(appCollec, helper.sampleConstants.INSTALL_FLAG,helper.sampleConstants.SUBSCRIBER_NAME , helper.sampleConstants.PERSIS_EVENT_NAME ,helper.sampleConstants.PERSIS_NAME, eventCLSID , helper.sampleConstants.UNSUBSCRIBE_FLAG );
00127       subscribePersisButton.setText("Subscribe");
00128       queuedPersisCB.setEnabled(true);
00129       if(!((installCascadeButton.getText()).equals("Install")))
00130       {
00131         cascadePersisRB.setEnabled(true);
00132       }
00133       directPersisRB.setEnabled(true);
00134
00135     }
00136
00137
00138
00139   }
00140
00141   /**
00142      * Install Cascade event class on the local machine and also makes it persistent
00143      * subscriber for news event.
00144      *
00145      * @param   ---
00146      * @return      ---
00147      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00148      **/
00149
00150   private void installCascadeButton_click(Object source, Event e)
00151   {
00152     comadmin.ICatalogCollection   appCollec = null;
00153     //Get the application collection
00154     appCollec = (comadmin.ICatalogCollection)(admin.GetCollection("Applications"));
00155     if((installCascadeButton.getText()).equals("Install"))
00156     {
00157       // Check if the application is already present.
00158       checkForAppAlreadyInstalled(appCollec ,appNameTF.getText());
00159       //Create new application for the cascade event class.
00160       addCatalog(appCollec,appNameTF.getText());
00161       //Install cascade event class.
00162       cascadeAppName = appNameTF.getText();
00163       admin.InstallEventClass(appNameTF.getText(),dllPathTF.getText(),"" , "");
00164       //Create persistent subscription to news event class.
00165       checkForApplication(appCollec, helper.sampleConstants.INSTALL_FLAG,appNameTF.getText() , helper.sampleConstants.CASCADE_EVENT_NAME ,helper.sampleConstants.CASCADE_NAME, helper.sampleConstants.EVENT_CLSID,helper.sampleConstants.SUBSCRIBE_FLAG );
00166       cascadePersisRB.setEnabled(true);
00167       cascadeTransRB.setEnabled(true);
00168       installCascadeButton.setText("Uninstall");
00169     }
00170     else
00171     {
00172       uninstallCascadeEvent();
00173     }
00174   }
00175
00176   /**
00177      * Uninstall Cascade Event.
00178      *
00179      * @param   ---
00180      * @return      ---
00181      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00182      **/
00183   private void uninstallCascadeEvent()
00184   {
00185     comadmin.ICatalogCollection   appCollec = null;
00186     if(cascadeAppName != null)
00187     {
00188       //Get the application collection
00189       appCollec = (comadmin.ICatalogCollection)(admin.GetCollection("Applications"));
00190
00191       // Uninstall the cascade event class.
00192       checkForApplication(appCollec, helper.sampleConstants.UNINSTALL_FLAG ,cascadeAppName,"", "","" ,helper.sampleConstants.SUBSCRIBE_FLAG);
00193       cascadePersisRB.setEnabled(false);
00194       cascadeTransRB.setEnabled(false);
00195       installCascadeButton.setText("Install");
00196     }
00197   }
00198
00199   /**
00200      * Check for whether the given application name is present or not.
00201      *
00202      * @param       appCollec   Collection of Applications
00203      * @param   processFlag   The flag specify whether the object in the collection is required to be added or removed.
00204      * @param   appName     Name of the application to look for in the collection.
00205      * @param   compName    Name of the component to look for if application is present in the collection.
00206      * @param   subName     The name of subscription
00207      * @param   eventCLSID    Event class id for subscription processing.
00208      * @param   subProcessFlag  Whether to subscribe to the event or to remove the subscription.
00209      * @return      ---
00210      * @see     ComAdmin.IComAdminCatalog , ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00211      **/
00212   private void checkForApplication(comadmin.ICatalogCollection appCollec,boolean appProcessFlag, String appName , String compName, String subName, String eventCLSID , boolean subProcessFlag)
00213   {
00214     int               index   = 0;
00215     comadmin.ICatalogCollection   compCollec  = null;
00216
00217     appCollec.Populate();
00218     for(index = 0; index < appCollec.getCount(); index++)
00219     {
00220       String str = (((comadmin.ICatalogObject)(appCollec.getItem(index))).getName()).toString();
00221       //Checking if application is present in the collection.
00222       if(((((comadmin.ICatalogObject)(appCollec.getItem(index))).getName()).toString()).equals(appName))
00223       {
00224         if(appProcessFlag == helper.sampleConstants.INSTALL_FLAG)
00225         {
00226           // Get Components collection.
00227           compCollec  =(comadmin.ICatalogCollection)(appCollec.GetCollection("Components",((comadmin.ICatalogObject)(appCollec.getItem(index))).getKey()));
00228           compCollec.Populate();
00229           checkForComponent(compCollec , compName , subName , eventCLSID, subProcessFlag);
00230
00231         }
00232         else // Uninstall the application.
00233         {
00234           appCollec.Remove(index);
00235           appCollec.SaveChanges();
00236         }
00237         break;
00238       }
00239     }
00240   }
00241
00242   /**
00243      * Check for whether the given component name is present or not in application.
00244      *
00245      * @param       compCollec    Collection of Components in Application
00246      * @param   compName    Name of the component to look for.
00247      * @param   subName     The name of subscription
00248      * @param   eventCLSID    Event class id for subscription processing.
00249      * @param   subProcessFlag  Whether to subscribe to the event or to remove the subscription.
00250      * @return      ---
00251      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00252      **/
00253   private void checkForComponent(comadmin.ICatalogCollection compCollec,  String compName, String subName, String eventCLSID, boolean subProcessFlag)
00254   {
00255     int               index   = 0;
00256     comadmin.ICatalogCollection   subCollec = null;
00257
00258     for(index = 0 ;index < compCollec.getCount(); index++)
00259     {
00260       //Checking if given component is present in the collection.
00261       if(((((comadmin.ICatalogObject)(compCollec.getItem(index))).getName()).toString()).equals(compName))
00262       {
00263         // Get the subscriptions associated with the component.
00264         subCollec =(comadmin.ICatalogCollection)(compCollec.GetCollection("SubscriptionsForComponent",((comadmin.ICatalogObject)(compCollec.getItem(index))).getKey()));
00265         subCollec.Populate();
00266         updateSubscription(subCollec , subName , eventCLSID, subProcessFlag);
00267         break;
00268
00269       }
00270     }
00271   }
00272   /**
00273      * Handle Subscriptions processing
00274      *
00275      * @param       subCollec   Collection of Subscriptions.
00276      * @param   subName     The name of subscription
00277      * @param   eventCLSID    Event class id.
00278      * @param   subProcessFlag  Whether to subscribe to the event or to remove the subscription.
00279      * @return      ---
00280      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00281      **/
00282   private comadmin.ICatalogCollection updateSubscription(comadmin.ICatalogCollection  subCollec , String subName , String eventCLSID, boolean subProcessFlag)
00283   {
00284     comadmin.ICatalogObject subCatalogObj = null;
00285     if(subProcessFlag)
00286     {
00287       // Add a subscription.
00288       subCatalogObj = (comadmin.ICatalogObject)(subCollec.Add());
00289       subCatalogObj.setValue("EventCLSID",new Variant(eventCLSID));
00290       subCatalogObj.setValue("Name" , new Variant(subName));
00291       if(subName.equals(helper.sampleConstants.PERSIS_NAME))
00292       {
00293         if(queuedPersisCB.getChecked())
00294         {
00295           subCatalogObj.setValue("Queued" , new Variant(true));
00296         }
00297       }
00298       else if (subName.equals(helper.sampleConstants.TRANSIENT_NAME))
00299       {
00300         subCatalogObj.setValue("SubscriberInterface" , new Variant(this));
00301       }
00302       subCollec.SaveChanges();
00303     }
00304     else
00305     {
00306       removeSubscription(subCollec , subName);
00307     }
00308     return subCollec;
00309   }
00310   /**
00311      * Removing Subscription from the collection
00312      *
00313      * @param       subCollec   Collection of Subscriptions.
00314      * @param   subName     The name of subscription to be removed.
00315      * @return      ---
00316      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00317      **/
00318   private void removeSubscription(comadmin.ICatalogCollection subCollec , String subName)
00319   {
00320     int   index = 0;
00321
00322     for(index = 0 ; index < subCollec.getCount() ; index++)
00323     {
00324       // Checking if given subscription is present in the collection.
00325       if(((((comadmin.ICatalogObject)(subCollec.getItem(index))).getName()).toString()).equals(subName))
00326       {
00327         subCollec.Remove(index);
00328         subCollec.SaveChanges();
00329         break;
00330       }
00331     }
00332   }
00333
00334   /**
00335      * Initialize the admin catalog
00336      *
00337      * @param       ---
00338      * @return      ---
00339      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00340      **/
00341   private void initAdminCatlog()
00342   {
00343     comadmin.ICatalogCollection appCollec = null;
00344
00345     try
00346     {
00347       admin   = (comadmin.ICOMAdminCatalog)new comadmin.COMAdminCatalog();
00348       appCollec = (comadmin.ICatalogCollection)(admin.GetCollection("Applications"));
00349       checkForAppAlreadyInstalled(appCollec , helper.sampleConstants.SUBSCRIBER_NAME);
00350       addCatalog(appCollec, helper.sampleConstants.SUBSCRIBER_NAME);
00351       //Install persistent subscriber component.
00352       admin.InstallComponent(helper.sampleConstants.SUBSCRIBER_NAME,helper.sampleConstants.PERSIST_EVENT_DLL,"","");
00353
00354
00355     }
00356     catch(Exception exp)
00357     {
00358       System.out.println(exp);
00359     }
00360
00361
00362   }
00363
00364   /**
00365      * Setting application properties
00366      *
00367      * @param       appCollec   Collection of  Applications.
00368      * @param   appName     Application Name to be checked for.
00369      * @return      ---
00370      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00371      **/
00372   private void addCatalog(comadmin.ICatalogCollection appCollec , String appName)
00373   {
00374     comadmin.ICatalogObject   catalogObj  = null;
00375
00376     catalogObj  = (comadmin.ICatalogObject)(appCollec.Add());
00377
00378     catalogObj.setValue("Name" , new Variant(appName));
00379     catalogObj.setValue("Activation" , new Variant(1));
00380     //catalogObj.setValue("QueuingEnabled" ,new  Variant(true));
00381     //catalogObj.setValue("QueueListenerEnabled",new Variant(true));
00382     appCollec.SaveChanges();
00383   }
00384
00385   /**
00386      * Check if application is already present.
00387      *
00388      * @param       appCollec   Collection of  Applications.
00389      * @param   appName     Application Name to be checked for.
00390      * @return      ---
00391      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00392      **/
00393   private void checkForAppAlreadyInstalled(comadmin.ICatalogCollection appCollec , String appName)
00394   {
00395
00396     int     index   = 0;
00397
00398     appCollec.Populate();
00399     for(index = 0; index < appCollec.getCount(); index++)
00400     {
00401       if(((((comadmin.ICatalogObject)(appCollec.getItem(index))).getName()).toString()).equals(appName))
00402       {
00403         // If application already present then remove the application from the catalog.
00404         appCollec.Remove(index);
00405         appCollec.SaveChanges();
00406       }
00407     }
00408
00409   }
00410
00411   /************* Event Handlers **********/
00412   public void LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate)
00413   {
00414   }
00415   public void ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow)
00416   {
00417   }
00418   public void NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL)
00419   {
00420     eventList.addItem( Symbol +" : " + Headline);
00421   }
00422
00423
00424   /**
00425    * NOTE: The following code is required by the Visual J++ form
00426    * designer.  It can be modified using the form editor.  Do not
00427    * modify it using the code editor.
00428    */
00429   Container components = new Container();
00430   GroupBox transientHeading = new GroupBox();
00431   GroupBox persistentHeading = new GroupBox();
00432   GroupBox cascadeHeading = new GroupBox();
00433   Button subscribeTransButton = new Button();
00434   ListBox eventList = new ListBox();
00435   RadioButton directTransRB = new RadioButton();
00436   RadioButton cascadeTransRB = new RadioButton();
00437   Button clearButton = new Button();
00438   Button subscribePersisButton = new Button();
00439   RadioButton directPersisRB = new RadioButton();
00440   RadioButton cascadePersisRB = new RadioButton();
00441   CheckBox queuedPersisCB = new CheckBox();
00442   Button installCascadeButton = new Button();
00443   Label appNameLB = new Label();
00444   Label dllPathLB = new Label();
00445   CheckBox queuedCascadeCB = new CheckBox();
00446   Edit appNameTF = new Edit();
00447   Edit dllPathTF = new Edit();
00448
00449   private void initForm()
00450   {
00451     this.setText("News Subscriber");
00452     this.setAutoScaleBaseSize(new Point(5, 13));
00453     this.setClientSize(new Point(515, 455));
00454
00455     transientHeading.setLocation(new Point(16, 8));
00456     transientHeading.setSize(new Point(480, 256));
00457     transientHeading.setTabIndex(0);
00458     transientHeading.setTabStop(false);
00459     transientHeading.setText("Transient Subscriber");
00460
00461     persistentHeading.setLocation(new Point(16, 272));
00462     persistentHeading.setSize(new Point(480, 64));
00463     persistentHeading.setTabIndex(1);
00464     persistentHeading.setTabStop(false);
00465     persistentHeading.setText("Persistent Subscriber");
00466
00467     cascadeHeading.setLocation(new Point(16, 344));
00468     cascadeHeading.setSize(new Point(480, 104));
00469     cascadeHeading.setTabIndex(2);
00470     cascadeHeading.setTabStop(false);
00471     cascadeHeading.setText("Cascade Event Class");
00472
00473     subscribeTransButton.setLocation(new Point(24, 24));
00474     subscribeTransButton.setSize(new Point(104, 32));
00475     subscribeTransButton.setTabIndex(0);
00476     subscribeTransButton.setText("Subscribe");
00477     subscribeTransButton.addOnClick(new EventHandler(this.subscribeTransButton_click));
00478
00479     eventList.setLocation(new Point(24, 64));
00480     eventList.setSize(new Point(432, 147));
00481     eventList.setTabIndex(1);
00482     eventList.setText("listBox1");
00483     eventList.setUseTabStops(true);
00484
00485     directTransRB.setLocation(new Point(200, 32));
00486     directTransRB.setSize(new Point(96, 16));
00487     directTransRB.setTabIndex(2);
00488     directTransRB.setTabStop(true);
00489     directTransRB.setText("Direct");
00490     directTransRB.setChecked(true);
00491
00492     cascadeTransRB.setEnabled(false);
00493     cascadeTransRB.setLocation(new Point(352, 32));
00494     cascadeTransRB.setSize(new Point(96, 16));
00495     cascadeTransRB.setTabIndex(3);
00496     cascadeTransRB.setText("Cascade");
00497
00498     clearButton.setLocation(new Point(344, 224));
00499     clearButton.setSize(new Point(112, 24));
00500     clearButton.setTabIndex(4);
00501     clearButton.setText("Clear");
00502     clearButton.addOnClick(new EventHandler(this.clearButton_click));
00503
00504     subscribePersisButton.setLocation(new Point(24, 24));
00505     subscribePersisButton.setSize(new Point(96, 24));
00506     subscribePersisButton.setTabIndex(0);
00507     subscribePersisButton.setText("Subscribe");
00508     subscribePersisButton.addOnClick(new EventHandler(this.subscribePersisButton_click));
00509
00510     directPersisRB.setLocation(new Point(152, 24));
00511     directPersisRB.setSize(new Point(88, 24));
00512     directPersisRB.setTabIndex(1);
00513     directPersisRB.setTabStop(true);
00514     directPersisRB.setText("Direct");
00515     directPersisRB.setChecked(true);
00516
00517     cascadePersisRB.setEnabled(false);
00518     cascadePersisRB.setLocation(new Point(256, 24));
00519     cascadePersisRB.setSize(new Point(88, 24));
00520     cascadePersisRB.setTabIndex(2);
00521     cascadePersisRB.setText("Cascade");
00522
00523     queuedPersisCB.setLocation(new Point(376, 24));
00524     queuedPersisCB.setSize(new Point(96, 24));
00525     queuedPersisCB.setTabIndex(3);
00526     queuedPersisCB.setText("Queued");
00527
00528     installCascadeButton.setLocation(new Point(24, 24));
00529     installCascadeButton.setSize(new Point(96, 24));
00530     installCascadeButton.setTabIndex(0);
00531     installCascadeButton.setText("Install");
00532     installCascadeButton.addOnClick(new EventHandler(this.installCascadeButton_click));
00533
00534     appNameLB.setLocation(new Point(168, 24));
00535     appNameLB.setSize(new Point(96, 16));
00536     appNameLB.setTabIndex(1);
00537     appNameLB.setTabStop(false);
00538     appNameLB.setText("App Name");
00539
00540     dllPathLB.setLocation(new Point(168, 56));
00541     dllPathLB.setSize(new Point(96, 16));
00542     dllPathLB.setTabIndex(2);
00543     dllPathLB.setTabStop(false);
00544     dllPathLB.setText("DLL Path");
00545
00546     queuedCascadeCB.setLocation(new Point(168, 80));
00547     queuedCascadeCB.setSize(new Point(96, 16));
00548     queuedCascadeCB.setTabIndex(3);
00549     queuedCascadeCB.setText("Queued");
00550
00551     appNameTF.setLocation(new Point(272, 24));
00552     appNameTF.setSize(new Point(200, 20));
00553     appNameTF.setTabIndex(4);
00554     appNameTF.setText("");
00555
00556     dllPathTF.setLocation(new Point(272, 56));
00557     dllPathTF.setSize(new Point(200, 20));
00558     dllPathTF.setTabIndex(5);
00559     dllPathTF.setText("");
00560
00561     this.setNewControls(new Control[] {
00562               cascadeHeading,
00563               persistentHeading,
00564               transientHeading});
00565     transientHeading.setNewControls(new Control[] {
00566                     clearButton,
00567                     cascadeTransRB,
00568                     directTransRB,
00569                     eventList,
00570                     subscribeTransButton});
00571     persistentHeading.setNewControls(new Control[] {
00572                      queuedPersisCB,
00573                      cascadePersisRB,
00574                      directPersisRB,
00575                      subscribePersisButton});
00576     cascadeHeading.setNewControls(new Control[] {
00577                     dllPathTF,
00578                     appNameTF,
00579                     queuedCascadeCB,
00580                     dllPathLB,
00581                     appNameLB,
00582                     installCascadeButton});
00583   }
00584
00585   /**
00586    * The main entry point for the application.
00587    *
00588    * @param args Array of parameters passed to the application
00589    * via the command line.
00590    */
00591   public static void main(String args[])
00592   {
00593     Application.run(new NewsSubscriber());
00594   }
00595 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSite Member List

This is the complete list of members for CSite, including all inherited members.
Activate(LONG) | CSite |
CImpIAdviseSink | CSite | [private]
CImpIOleClientSite | CSite | [private]
CImpIOleDocumentSite | CSite | [private]
CImpIOleInPlaceSite | CSite | [private]
Close(BOOL) | CSite |
Create(LPTSTR, IStorage *) | CSite |
CreateStorage(IStorage *) | CSite |
CSite(DWORD, HWND, CFrame *) | CSite |
Destroy(IStorage *) | CSite |
m_cRef | CSite | [private]
m_dwID | CSite | [private]
m_fDocObj | CSite | [private]
m_fInitialized | CSite | [private]
m_hWnd | CSite | [private]
m_pFR | CSite | [private]
m_pImpIAdviseSink | CSite | [private]
m_pImpIOleClientSite | CSite | [private]
m_pImpIOleDocumentSite | CSite | [private]
m_pImpIOleIPSite | CSite | [private]
m_pIOleDocView | CSite | [private]
m_pIOleIPObject | CSite | [private]
m_pIOleObject | CSite | [private]
m_pIStorage | CSite | [private]
m_pIStream | CSite | [private]
m_pObj | CSite | [private]
ObjectInitialize(LPUNKNOWN) | CSite | [protected]
QueryInterface(REFIID, void **) | CSite |
STDMETHODIMP_(ULONG) AddRef(void) | CSite |
STDMETHODIMP_(ULONG) Release(void) | CSite |
Update(void) | CSite |
UpdateObjectRects(void) | CSite |
~CSite(void) | CSite |
Generated on Wed Nov 13 2024 16:57:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStdDbOutput Member List

This is the complete list of members for CStdDbOutput, including all inherited members.
Create() | CStdDbOutput | [static]
CStdDbOutput() | CStdDbOutput | [inline]
m_refs | CStdDbOutput | [private]
m_rgch | CStdDbOutput | [private]
operator delete(void FAR *pv) | CStdDbOutput | [inline]
operator new(size_t cb) | CStdDbOutput | [inline]
Printf(char FAR *szFmt,...) | CStdDbOutput | [virtual]
QueryInterface(REFIID riid, void FAR *FAR *ppv) | CStdDbOutput |
STDMETHOD_(ULONG, AddRef)(void) | CStdDbOutput |
STDMETHOD_(ULONG, Release)(void) | CStdDbOutput |
STDMETHOD_(void, Assertion)(BOOL cond | CStdDbOutput |
szExpr | CStdDbOutput |
szFile | CStdDbOutput |
szMsg | CStdDbOutput |
uLine | CStdDbOutput |
~CStdDbOutput() | CStdDbOutput | [inline]
Generated on Wed Nov 13 2024 16:57:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/IconHdlr.Cpp Source File

  • WinUI
  • Shell
  • ShellExt

IconHdlr.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Modudule: ICONHDLR.CPP
00009 //
00010 // Purpose:  Implements the IExtractIcon and IPersistFile member
00011 //           functions necessary to support the icon handler portion
00012 //           of this shell extension.
00013 //
00014
00015 #include "priv.h"
00016 #include "shellext.h"
00017
00018 extern HINSTANCE g_hmodThisDll; // Handle to this DLL itself.
00019
00020 // *********************** IExtractIcon Implementation *************************
00021
00022 STDMETHODIMP CShellExt::GetIconLocation(UINT   uFlags,
00023                                         LPSTR  szIconFile,
00024                                         UINT   cchMax,
00025                                         int   *piIndex,
00026                                         UINT  *pwFlags)
00027 {
00028     ODS("CShellExt::GetIconLocation()\r\n");
00029
00030     GetModuleFileName(g_hmodThisDll, szIconFile, cchMax);
00031
00032     *piIndex = (int)GetPrivateProfileInt("IconImage",
00033                                          "Index",
00034                                          0,
00035                                          m_szFileUserClickedOn);
00036
00037     return S_OK;
00038 }
00039
00040
00041 STDMETHODIMP CShellExt::Extract(LPCSTR pszFile,
00042                                 UINT   nIconIndex,
00043                                 HICON  *phiconLarge,
00044                                 HICON  *phiconSmall,
00045                                 UINT   nIconSize)
00046 {
00047     ODS("CShellExt::Extract()\r\n");
00048
00049     return S_FALSE;
00050 }
00051
00052
00053 // *********************** IPersistFile Implementation ******************
00054
00055 STDMETHODIMP CShellExt::GetClassID(LPCLSID lpClassID)
00056 {
00057     ODS("CShellExt::GetClassID()\r\n");
00058
00059     return E_FAIL;
00060 }
00061
00062 STDMETHODIMP CShellExt::IsDirty()
00063 {
00064     ODS("CShellExt::IsDirty()\r\n");
00065
00066     return S_FALSE;
00067 }
00068
00069 STDMETHODIMP CShellExt::Load(LPCOLESTR lpszFileName, DWORD grfMode)
00070 {
00071     ODS("CShellExt::Load()\r\n");
00072
00073     WideCharToMultiByte(CP_ACP,                // CodePage
00074                         0,                    // dwFlags
00075                         lpszFileName,          // lpWideCharStr
00076                         -1,                    // cchWideChar
00077                         m_szFileUserClickedOn, // lpMultiByteStr
00078                         sizeof(m_szFileUserClickedOn),  // cchMultiByte,
00079                         NULL,                  // lpDefaultChar,
00080                         NULL);                 // lpUsedDefaultChar
00081
00082     return NOERROR;
00083 }
00084
00085 STDMETHODIMP CShellExt::Save(LPCOLESTR lpszFileName, BOOL fRemember)
00086 {
00087     ODS("CShellExt::Save()\r\n");
00088
00089     return E_FAIL;
00090 }
00091
00092 STDMETHODIMP CShellExt::SaveCompleted(LPCOLESTR lpszFileName)
00093 {
00094     ODS("CShellExt::SaveCompleted()\r\n");
00095
00096     return E_FAIL;
00097 }
00098
00099 STDMETHODIMP CShellExt::GetCurFile(LPOLESTR FAR* lplpszFileName)
00100 {
00101     ODS("CShellExt::GetCurFile()\r\n");
00102
00103     return E_FAIL;
00104 }
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CInitStringBox Member List

This is the complete list of members for CInitStringBox, including all inherited members.
Append(LPCWSTR pwszString, bool bCanUndo=TRUE, DWORD dwMask=0, DWORD dwColor=0) | CRichEditLite | [virtual]
CanPaste() | CEditBoxLite | [inline]
CConsole() | CConsole | [inline]
CEditBoxLite(HWND hWndParent=NULL, UINT nID=0) | CEditBoxLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Copy() | CEditBoxLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CRichEditLite(HWND hWndParent=NULL, UINT nID=0) | CRichEditLite |
CSplitterLite(HWND hWndParent=NULL, UINT nID=0) | CSplitterLite |
Cut() | CEditBoxLite | [inline]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient) | CSplitterLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
FindNext(DWORD dwFindFlags, WCHAR *pwszText) | CRichEditLite | [virtual]
FindText(DWORD dwFindFlags, FINDTEXTEXW *pFINDTEXT) | CRichEditLite | [virtual]
GetConsole() | CConsole | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetLine(INDEX iLine, CHAR *pszBuffer, ULONG ulMaxSize) | CEditBoxLite |
GetLineCount() | CEditBoxLite | [inline]
GetSel(INDEX *piMin, INDEX *piMax) | CRichEditLite | [inline, virtual]
GetSel(CHARRANGE *pcr) | CRichEditLite | [inline, virtual]
CEditBoxLite::GetSel(INDEX *piMin, INDEX *piMax) | CEditBoxLite | [inline, virtual]
CEditBoxLite::GetSel(CHARRANGE *pcr) | CEditBoxLite | [inline, virtual]
GetSelectedText(BOOL fEntireLine=TRUE) | CRichEditLite |
GetTextRange(CHARRANGE &cr, WCHAR *pwszBuffer) | CEditBoxLite |
GetTextRange(CHARRANGE &cr, CHAR *pszBuffer) | CEditBoxLite |
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
LineFromChar(INDEX nIndex) | CRichEditLite | [inline]
LineIndex(INDEX nLine) | CEditBoxLite | [inline]
LineLength(INDEX nStartChar) | CEditBoxLite | [inline]
LineScroll(INDEX nLines, INDEX nChars=0) | CEditBoxLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hCursorOld | CSplitterLite |
m_hCursorRight | CSplitterLite |
m_hCursorTop | CSplitterLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iBorderCX | CSplitterLite |
m_iBorderCY | CSplitterLite |
m_nID | CWndLite |
m_pCWndBottom | CSplitterLite |
m_pCWndLeft | CSplitterLite |
m_pCWndRight | CSplitterLite |
m_pCWndTop | CSplitterLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_pwszNewLine | CConsole | [protected]
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnBorder(REFPOINTS pts, INT iBorder) | CSplitterLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CRichEditLite | [virtual]
CEditBoxLite::OnCreate(CREATESTRUCT *pCREATESTRUCT) | CEditBoxLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CInitStringBox | [inline, virtual]
CRichEditLite::OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLink(INT idCtrl, ENLINK *pEnLink) | CRichEditLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CRichEditLite | [virtual]
CEditBoxLite::OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
operator<<(LPCWSTR pwsz) | CConsole | [inline, virtual]
operator<<(COLORREF refColor) | CConsole | [inline, virtual]
operator<<(COLORA attColor) | CConsole | [inline, virtual]
Paste() | CEditBoxLite | [inline]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
ReplaceAll(LPCWSTR pwszString, bool bReplaceAll=FALSE, bool fHighlight=FALSE) | CEditBoxLite | [virtual]
ReplaceSel(LPCWSTR pwszString, bool bCanUndo) | CRichEditLite | [inline, virtual]
ReplaceSel(LPCWSTR pwszString, bool bCanUndo, DWORD dwMask, DWORD dwColor) | CRichEditLite | [virtual]
CEditBoxLite::ReplaceSel(LPCWSTR pwszString, bool bCanUndo) | CEditBoxLite | [inline, virtual]
Save(LPCWSTR pwszFileName) | CEditBoxLite |
ScrollCaret() | CEditBoxLite | [inline]
SetCharFormat(DWORD dwMask, CHARFORMATW &charFormatW) | CRichEditLite |
SetColor(COLORREF refColor) | CRichEditLite | [inline, virtual]
SetColorAttrib(COLORA attColor, BOOL fEnable=TRUE) | CRichEditLite | [inline, virtual]
SetDefaultFont() | CRichEditLite |
SetEffects(DWORD dwMask, DWORD dwEffects, COLORREF crTextColor) | CRichEditLite |
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetOptions(UINT dwOptions, UINT fOperation=ECOOP_OR) | CEditBoxLite | [inline]
SetReadOnly(bool bReadOnly) | CEditBoxLite | [inline]
SetSel(INDEX iMin, INDEX iMax) | CRichEditLite | [inline, virtual]
CEditBoxLite::SetSel(INDEX iMin, INDEX iMax) | CEditBoxLite | [inline, virtual]
SetSplitter(CSplitterLite *pCWndTop, CSplitterLite *pCWndBottom=NULL, CSplitterLite *pCWndLeft=NULL, CSplitterLite *pCWndRight=NULL) | CSplitterLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
SetWordWrap(BOOL fWordWrap) | CRichEditLite | [virtual]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT *pPoint) | CSplitterLite | [virtual]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
Write(LPCWSTR pwszText) | CRichEditLite | [inline, virtual]
WriteLine(LPCWSTR pwsz=NULL) | CConsole | [inline, virtual]
~CConsole() | CConsole | [inline, virtual]
~CEditBoxLite() | CEditBoxLite | [virtual]
~CRichEditLite() | CRichEditLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Wsubs.c Source File

  • WinUI
  • Input
  • Ime
  • IMEApps

Wsubs.c

Go to the documentation of this file.
00001 #include <windows.h>
00002
00003 #ifdef USEWAPI
00004 int WINAPI MylstrcmpW(LPWSTR lp0, LPWSTR lp1)
00005 {
00006
00007     while(*lp0)
00008     {
00009         if (*lp0 != *lp1)
00010         {
00011             return (-1);
00012         }
00013         lp0++;
00014         lp1++;
00015
00016     }
00017
00018     if (!*lp1)
00019     {
00020         return 0;
00021     }
00022
00023     return 1;
00024 }
00025
00026 int WINAPI MylstrcpyW(LPWSTR lp0, LPWSTR lp1)
00027 {
00028     int n = 0;
00029
00030     while(*lp1)
00031     {
00032         *lp0 = *lp1;
00033         lp0++;
00034         lp1++;
00035         n++;
00036     }
00037     *lp0 = *lp1;
00038     return n;
00039 }
00040
00041 int WINAPI MylstrcatW(LPWSTR lp0, LPWSTR lp1)
00042 {
00043     int n = 0;
00044
00045     while(*lp0)
00046     {
00047         lp0++;
00048     }
00049
00050     return MylstrcpyW(lp0, lp1);
00051 }
00052
00053 LPWSTR WINAPI MyCharPrevW(LPWSTR lpStart, LPWSTR lpCur)
00054 {
00055     LPWSTR lpRet = lpStart;
00056     if (lpCur > lpStart)
00057     {
00058         lpRet = lpCur - 1;
00059     }
00060
00061     return lpRet;
00062 }
00063
00064 LPWSTR WINAPI MyCharNextW(LPWSTR lp)
00065 {
00066     return lp++;
00067 }
00068 #endif
00069
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/InstProv/InstProv.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • InstProv

InstProv.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  INSTPRO.CPP
00006
00007 //
00008
00009 //  Module: WMI Instance provider sample code
00010
00011 //
00012
00013 //  Purpose: Defines the CInstPro class.  An object of this class is
00014
00015 //           created by the class factory for each connection.
00016
00017 //
00018
00019 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00020 //
00021 //***************************************************************************
00022 #define _WIN32_WINNT 0x0500
00023
00024
00025 #include <objbase.h>
00026 #include "sample.h"
00027 #include <process.h>
00028 #include <strsafe.h>
00029 #include <sddl.h>
00030
00031 InstDef MyDefs[] = {{L"a", 1}, {L"b", 2}, {L"c", 3}};
00032
00033 long glNumInst = sizeof(MyDefs)/sizeof(InstDef);
00034
00035 //***************************************************************************
00036 //
00037 // CInstPro::CInstPro
00038 // CInstPro::~CInstPro
00039 //
00040 //***************************************************************************
00041
00042 CInstPro::CInstPro(BSTR ObjectPath, BSTR User, BSTR Password, IWbemContext * pCtx)
00043 {
00044     m_pNamespace = NULL;
00045     m_cRef=0;
00046     InterlockedIncrement(&g_cObj);
00047     return;
00048 }
00049
00050 CInstPro::~CInstPro(void)
00051 {
00052     if(m_pNamespace)
00053         m_pNamespace->Release();
00054     InterlockedDecrement(&g_cObj);
00055     return;
00056 }
00057
00058 //***************************************************************************
00059 //
00060 // CInstPro::QueryInterface
00061 // CInstPro::AddRef
00062 // CInstPro::Release
00063 //
00064 // Purpose: IUnknown members for CInstPro object.
00065 //***************************************************************************
00066
00067
00068 STDMETHODIMP CInstPro::QueryInterface(REFIID riid, PPVOID ppv)
00069 {
00070     *ppv=NULL;
00071
00072     // Since we have dual inheritance, it is necessary to cast the return type
00073
00074     if(riid== IID_IWbemServices)
00075        *ppv=(IWbemServices*)this;
00076
00077     if(IID_IUnknown==riid || riid== IID_IWbemProviderInit)
00078        *ppv=(IWbemProviderInit*)this;
00079
00080
00081     if (NULL!=*ppv) {
00082         AddRef();
00083         return NOERROR;
00084         }
00085     else
00086         return E_NOINTERFACE;
00087
00088 }
00089
00090
00091 STDMETHODIMP_(ULONG) CInstPro::AddRef(void)
00092 {
00093     return ++m_cRef;
00094 }
00095
00096 STDMETHODIMP_(ULONG) CInstPro::Release(void)
00097 {
00098     ULONG nNewCount = InterlockedDecrement((long *)&m_cRef);
00099     if (0L == nNewCount)
00100         delete this;
00101
00102     return nNewCount;
00103 }
00104
00105 /***********************************************************************
00106 *                                                                      *
00107 *   CInstPro::Initialize                                                *
00108 *                                                                      *
00109 *   Purpose: This is the implementation of IWbemProviderInit. The method  *
00110 *   is need to initialize with CIMOM.                                    *
00111 *                                                                      *
00112 ***********************************************************************/
00113
00114 STDMETHODIMP CInstPro::Initialize(LPWSTR pszUser, LONG lFlags,
00115                                     LPWSTR pszNamespace, LPWSTR pszLocale,
00116                                     IWbemServices *pNamespace,
00117                                     IWbemContext *pCtx,
00118                                     IWbemProviderInitSink *pInitSink)
00119 {
00120
00121   if(! pNamespace)
00122   {
00123       pInitSink->SetStatus(WBEM_E_FAILED , 0);
00124   }
00125   else
00126   {
00127     m_pNamespace = pNamespace;
00128       m_pNamespace->AddRef();
00129     pInitSink->SetStatus(WBEM_S_INITIALIZED, 0);
00130   }
00131
00132
00133     return WBEM_S_NO_ERROR;
00134 }
00135
00136 //***************************************************************************
00137 //
00138 // CInstPro::CreateInstanceEnumAsync
00139 //
00140 // Purpose: Asynchronously enumerates the instances.
00141 //
00142 //***************************************************************************
00143
00144 SCODE CInstPro::CreateInstanceEnumAsync( const BSTR RefStr, long lFlags, IWbemContext *pCtx,
00145        IWbemObjectSink FAR* pHandler)
00146 {
00147
00148   //Impersonate the client
00149   HRESULT hr = CoImpersonateClient () ;
00150
00151   if ( FAILED ( hr ) )
00152   {
00153     pHandler->SetStatus ( 0 , hr , NULL , NULL ) ;
00154     return hr ;
00155   }
00156
00157   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
00158   //  the provider will not be able to impersonate the client to access the protected resources.
00159
00160   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
00161   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
00162   {
00163     //  Revert before we perform any operations
00164     CoRevertToSelf () ;
00165
00166     hr = WBEM_E_ACCESS_DENIED;
00167     pHandler->SetStatus ( 0 , hr , NULL , NULL ) ;
00168     return hr ;
00169   }
00170
00171     SCODE sc;
00172     int iCnt;
00173     IWbemClassObject FAR* pNewInst;
00174
00175     // Do a check of arguments and make sure we have pointer to Namespace
00176
00177     if(pHandler == NULL || m_pNamespace == NULL)
00178         return WBEM_E_INVALID_PARAMETER;
00179
00180     for(iCnt=0; iCnt < glNumInst; iCnt++)
00181     {
00182         sc = CreateInst(m_pNamespace,MyDefs[iCnt].pwcKey,
00183                     MyDefs[iCnt].lValue, &pNewInst, RefStr, pCtx);
00184
00185         if(sc != S_OK)
00186             break;
00187
00188         // Send the object to the caller
00189
00190         pHandler->Indicate(1,&pNewInst);
00191         pNewInst->Release();
00192     }
00193
00194     // Set status
00195
00196     pHandler->SetStatus(0,sc,NULL, NULL);
00197
00198     return sc;
00199 }
00200
00201
00202 //***************************************************************************
00203 //
00204 // CInstPro::GetObjectByPath
00205 // CInstPro::GetObjectByPathAsync
00206 //
00207 // Purpose: Creates an instance given a particular path value.
00208 //
00209 //***************************************************************************
00210
00211
00212
00213 SCODE CInstPro::GetObjectAsync(const BSTR ObjectPath, long lFlags,IWbemContext  *pCtx,
00214                     IWbemObjectSink FAR* pHandler)
00215 {
00216
00217   //Impersonate the client
00218   HRESULT hr = CoImpersonateClient () ;
00219
00220   if ( FAILED ( hr ) )
00221   {
00222     pHandler->SetStatus ( 0 , hr , NULL , NULL ) ;
00223     return hr ;
00224   }
00225
00226   //  Check to see if call is at the RPC_C_IMP_LEVEL_IDENTIFY level. If that's the case,
00227   //  the provider will not be able to impersonate the client to access the protected resources.
00228   if ( GetCurrentImpersonationLevel () == RPC_C_IMP_LEVEL_IDENTIFY )
00229   {
00230       hr = WBEM_E_ACCESS_DENIED;
00231       pHandler->SetStatus ( 0 , hr , NULL , NULL ) ;
00232       return hr ;
00233   }
00234
00235     SCODE sc;
00236     IWbemClassObject FAR* pObj;
00237     BOOL bOK = FALSE;
00238
00239     // Do a check of arguments and make sure we have pointer to Namespace
00240
00241     if(ObjectPath == NULL || pHandler == NULL || m_pNamespace == NULL)
00242         return WBEM_E_INVALID_PARAMETER;
00243
00244     // do the get, pass the object on to the notify
00245
00246     sc = GetByPath(ObjectPath,&pObj, pCtx);
00247     if(sc == S_OK)
00248     {
00249         pHandler->Indicate(1,&pObj);
00250         pObj->Release();
00251         bOK = TRUE;
00252     }
00253
00254     sc = (bOK) ? S_OK : WBEM_E_NOT_FOUND;
00255
00256     // Set Status
00257
00258     pHandler->SetStatus(0,sc, NULL, NULL);
00259
00260     return sc;
00261 }
00262
00263 //***************************************************************************
00264 //
00265 // CInstPro::GetByPath
00266 //
00267 // Purpose: Creates an instance given a particular Path value.
00268 //
00269 //***************************************************************************
00270
00271 SCODE CInstPro::GetByPath(BSTR ObjectPath, IWbemClassObject FAR* FAR* ppObj, IWbemContext  *pCtx)
00272 {
00273     SCODE sc = S_OK;
00274
00275     int iCnt;
00276
00277     // do a simple path parse.  The path will look something like
00278     // InstProvSamp.MyKey="a"
00279     // Create a test string with just the part between quotes.
00280
00281     WCHAR wcTest[MAX_PATH+1];
00282   memset(wcTest, NULL, sizeof(wcTest));
00283   StringCbCopyW(wcTest, sizeof(wcTest), ObjectPath);
00284
00285     WCHAR * pwcTest, * pwcCompare = NULL;
00286     int iNumQuotes = 0;
00287     for(pwcTest = wcTest; *pwcTest; pwcTest++)
00288         if(*pwcTest == L'\"')
00289         {
00290             iNumQuotes++;
00291             if(iNumQuotes == 1)
00292             {
00293                 pwcCompare = pwcTest+1;
00294             }
00295             else if(iNumQuotes == 2)
00296             {
00297                 *pwcTest = NULL;
00298                 break;
00299             }
00300         }
00301         else if(*pwcTest == L'.')
00302             *pwcTest = NULL;    // issolate the class name.
00303     if(iNumQuotes != 2)
00304         return WBEM_E_FAILED;
00305
00306     // check the instance list for a match.
00307
00308     for(iCnt = 0; iCnt < glNumInst; iCnt++)
00309     {
00310         if(!_wcsicmp(MyDefs[iCnt].pwcKey, pwcCompare))
00311         {
00312             sc = CreateInst(m_pNamespace,MyDefs[iCnt].pwcKey,
00313                     MyDefs[iCnt].lValue, ppObj, wcTest, pCtx);
00314             return sc;
00315         }
00316     }
00317
00318     return WBEM_E_NOT_FOUND;
00319 }
00320
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COptionsAccessor Member List

This is the complete list of members for COptionsAccessor, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
COptionsAccessor() | COptionsAccessor |
CPropPageLite(UINT uIDD, TCHAR *ptszTitle=NULL) | CPropPageLite |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetParent() | CPropPageLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_comboBindingTypes | COptionsAccessor | [protected]
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pCPropSheet | CPropPageLite |
m_psPage | CPropPageLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnApply() | COptionsAccessor | [virtual]
OnCancel() | CPropPageLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | COptionsAccessor | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnKillActive() | CPropPageLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CPropPageLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnReset() | CPropPageLite | [virtual]
OnSetActive() | CPropPageLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
PropPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [static]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetParent(CPropSheetLite *pCPropSheetLite) | CPropPageLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CPropPageLite() | CPropPageLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/comp.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

comp.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "Comp.h"
00017 #include "CompData.h"
00018 #include "DataObj.h"
00019 #include "Resource.h"
00020 #include "StaticNode.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CComponent")
00026
00027
00028 //---------------------------------------------------------------------------
00029 //  Our default constuctor provides a pointer to the parent CComponentData
00030 //  class which we cache for use in later samples.
00031 //
00032 CComponent::CComponent
00033 (
00034   CComponentData*  pParent   //[in] Points to parent object
00035 )
00036 {
00037   _ASSERT( NULL != pParent );
00038
00039   m_cRef           = 0;
00040   m_pComponentData = pParent;
00041
00042 }
00043
00044 //---------------------------------------------------------------------------
00045 CComponent::~CComponent()
00046 {
00047 }
00048
00049 /////////////////////////////////////////////////////////////////////////////
00050 //  Implementation of IUnknown
00051
00052 //---------------------------------------------------------------------------
00053 STDMETHODIMP CComponent::QueryInterface
00054 (
00055   REFIID   riid,       //[in] Identifier of the requested interface
00056   LPVOID   *ppv        //[out] Address of requested interface
00057 )
00058 {
00059   if( !ppv )
00060     return E_FAIL;
00061
00062   *ppv = NULL;
00063
00064   if( IsEqualIID(riid, IID_IUnknown) )
00065     *ppv = static_cast<IComponent*>(this);
00066   else if( IsEqualIID(riid, IID_IComponent) )
00067     *ppv = static_cast<IComponent*>(this);
00068   else if( IsEqualIID(riid, IID_IComponent2) )
00069     *ppv = static_cast<IComponent2*>(this);
00070
00071
00072   if( *ppv )
00073   {
00074     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00075     return S_OK;
00076   }
00077
00078   return E_NOINTERFACE;
00079 }
00080
00081 //---------------------------------------------------------------------------
00082 STDMETHODIMP_(ULONG) CComponent::AddRef()
00083 {
00084   return InterlockedIncrement((LONG*)&m_cRef);
00085 }
00086
00087 //---------------------------------------------------------------------------
00088 STDMETHODIMP_(ULONG) CComponent::Release()
00089 {
00090   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00091   {
00092     delete this;
00093     return 0;
00094   }
00095   return m_cRef;
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // Implementation of IComponent
00100
00101 //---------------------------------------------------------------------------
00102 STDMETHODIMP CComponent::Initialize
00103 (
00104   LPCONSOLE ipConsole    //[in] Points to the console's IUnknown
00105 )
00106 {
00107   // Have to return S_OK here or we will get the dreaded message
00108   // "The selected snap-in did not initialize properly"
00109
00110   HRESULT hResult = S_OK;
00111   return hResult;
00112 }
00113
00114
00115 //---------------------------------------------------------------------------
00116 STDMETHODIMP CComponent::Notify
00117 (
00118   LPDATAOBJECT     ipDataObject,   //[in] Points to the selected data object
00119   MMC_NOTIFY_TYPE  MmcEvent,       //[in] Identifies action taken by user
00120   LONG             nArg,           //[in] Depends on the notification type
00121   LONG             nParam          //[in] Depends on the notification type
00122 )
00123 {
00124   HRESULT hResult = S_FALSE;       // Return this for unhandled notifications
00125   TRACE_EVENT( _T("Notify"), MmcEvent );
00126   return hResult;
00127 }
00128
00129 //---------------------------------------------------------------------------
00130 STDMETHODIMP CComponent::Destroy
00131 (
00132   MMC_COOKIE nCookie   //[in] Not used
00133 )
00134 {
00135   return S_OK;
00136 }
00137
00138 //---------------------------------------------------------------------------
00139 STDMETHODIMP CComponent::QueryDataObject
00140 (
00141   MMC_COOKIE              nCookie,     //[in]  Indentifier of the selected node
00142   DATA_OBJECT_TYPES       nEnumType,   //[in]  Context in which this object was created
00143   LPDATAOBJECT __RPC_FAR* ppDataObject //[out] Points to data object we create
00144 )
00145 {
00146   TRACE_HRESULT( _T("QueryDataObject"), E_NOTIMPL );
00147   return E_NOTIMPL;
00148 }
00149
00150 //---------------------------------------------------------------------------
00151 //  This method is obsolete with MMC20
00152 //
00153 STDMETHODIMP CComponent::GetResultViewType
00154 (
00155   MMC_COOKIE          nCookie,     //[in]  Indentifier of selected node
00156   LPOLESTR __RPC_FAR* ppViewType,  //[out] Points to view type string
00157   long __RPC_FAR*     pViewOptions //[out] Points to MMC_VIEW_OPTIONS enumeration
00158 )
00159 {
00160   _ASSERT( FALSE );
00161   return E_NOTIMPL;
00162 }
00163
00164
00165 //---------------------------------------------------------------------------
00166 STDMETHODIMP CComponent::GetDisplayInfo
00167 (
00168   RESULTDATAITEM __RPC_FAR* pResultDataItem  //[in][out] Result item struct
00169 )
00170 {
00171   HRESULT hResult = S_FALSE;
00172
00173   // This never gets called in this sample
00174
00175   TRACE_HRESULT( _T("GetDisplayInfo"), hResult );
00176   return hResult;
00177 }
00178
00179 //---------------------------------------------------------------------------
00180 STDMETHODIMP CComponent::CompareObjects
00181 (
00182   LPDATAOBJECT ipDataObjectA,    //[in] First data object to compare
00183   LPDATAOBJECT ipDataObjectB     //[in] Second data object to compare
00184 )
00185 {
00186   return E_NOTIMPL;
00187 }
00188
00189 //---------------------------------------------------------------------------
00190 HRESULT CComponent::QueryDispatch
00191 (
00192   MMC_COOKIE         nCookie,    //[in]  Item for which IDispatch is requested
00193   DATA_OBJECT_TYPES  eType,      //[in]  Context of item
00194   LPDISPATCH*        pipDispatch //[out] IDispatch pointer
00195 )
00196 {
00197   return E_NOTIMPL;
00198 }
00199
00200 //---------------------------------------------------------------------------
00201 //  NOTE:  Failure to correctly implement this method will result in
00202 //         the error:  "Snap-in failed to initialize"
00203 //
00204 HRESULT CComponent::GetResultViewType2
00205 (
00206   MMC_COOKIE             nCookie,  //[in] Identifier of object
00207   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00208 )
00209 {
00210   HRESULT hResult = S_FALSE;
00211
00212   if( NULL == nCookie )
00213   {
00214     CStaticNode* pNode = m_pComponentData->GetStaticNode();
00215     hResult = pNode->GetResultViewType2( nCookie, pRVTinfo );
00216   }
00217   else
00218   {
00219     _ASSERT( FALSE );
00220   }
00221
00222   TRACE_HRESULT(_T("GetResultViewType2"), hResult );
00223   return hResult;
00224 }
00225
00226
00227 //---------------------------------------------------------------------------
00228 HRESULT CComponent::RestoreResultView
00229 (
00230   MMC_COOKIE             nCookie,  //[in] Identifier of object
00231   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00232 )
00233 {
00234   return E_NOTIMPL;
00235 }
00236
00237
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_PROPSETLIST Member List

This is the complete list of members for _PROPSETLIST, including all inherited members.
byteOffset | _PROPSETLIST
formatID | _PROPSETLIST
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/atl/resource.h Source File

  • SysMgmt
  • MMC
  • ActiveX
  • atl

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ATLControl.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDB_MMCCONTROL                  101
00007 #define IDR_MMCCONTROL                  102
00008 #define IDD_MMCCONTROL                  103
00009 #define IDC_ANIMATE                     201
00010 #define IDC_ANIMATIONSTATE              202
00011
00012 // Next default values for new objects
00013 //
00014 #ifdef APSTUDIO_INVOKED
00015 #ifndef APSTUDIO_READONLY_SYMBOLS
00016 #define _APS_NEXT_RESOURCE_VALUE        201
00017 #define _APS_NEXT_COMMAND_VALUE         32768
00018 #define _APS_NEXT_CONTROL_VALUE         203
00019 #define _APS_NEXT_SYMED_VALUE           104
00020 #endif
00021 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/plugtransport.idl Source File

  • Web
  • NetMeeting
  • PlugTransport

plugtransport.idl

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     PLUGTRANSPORT.EXE
00003 //  File:       PLUGTRANSPORT.IDL
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016
00017 #include "imsconf3.idl"
00018 #include "iplgxprt.idl"
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/resultset.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

resultset.h

Go to the documentation of this file.
00001 // Resultset.h : Declaration of the CResultset
00002
00003 #ifndef __RESULTSET_H_
00004 #define __RESULTSET_H_
00005
00006 #include "resource.h"       // main symbols
00007
00008 /////////////////////////////////////////////////////////////////////////////
00009 // CResultset
00010 class ATL_NO_VTABLE CResultset :
00011   public CComObjectRootEx<CComMultiThreadModel>,
00012   public CComCoClass<CResultset, &CLSID_Resultset>,
00013   public IMarshal,
00014   public IPersistStream,
00015   public IPersistStreamInit,
00016   public ISupportErrorInfo,
00017   public IDispatchImpl<IResultset, &IID_IResultset, &LIBID_DataServices>
00018 {
00019
00020 public:
00021   void Clear(bool bDelete)
00022   {
00023
00024     if (bDelete && m_pVar != NULL)
00025     {
00026       delete [] m_pVar;
00027     }
00028
00029     for (int n = 0; n < m_nCount; n++)
00030     {
00031       m_pEntity[n]->Release();
00032     }
00033
00034     m_pVar = NULL;
00035     m_nCount = 0;
00036     m_nAlloc = 0;
00037   }
00038
00039   CResultset()
00040   {
00041     m_pVar = NULL;
00042     m_nCount = 0;
00043     m_nAlloc = 0;
00044     Clear(false);
00045   }
00046
00047   ~CResultset()
00048   {
00049     Clear(true);
00050   }
00051
00052 DECLARE_REGISTRY_RESOURCEID(IDR_RESULTSET)
00053
00054 DECLARE_PROTECT_FINAL_CONSTRUCT()
00055
00056 BEGIN_COM_MAP(CResultset)
00057   COM_INTERFACE_ENTRY(IResultset)
00058   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00059   COM_INTERFACE_ENTRY2(IDispatch, IResultset)
00060   COM_INTERFACE_ENTRY(IMarshal)
00061   COM_INTERFACE_ENTRY(IPersistStreamInit)
00062   COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
00063   COM_INTERFACE_ENTRY(IPersistStream)
00064 END_COM_MAP()
00065
00066 // IMarshal (Actually we delegate to IPersistStream's implementation here)
00067   STDMETHOD(GetUnmarshalClass) (REFIID riid, void * pv, DWORD dwDestContext, void * pvDestContext, DWORD mshlFlags, CLSID* pCid )
00068   {
00069     *pCid = GetObjectCLSID();
00070     return S_OK;
00071   }
00072
00073   STDMETHOD(GetMarshalSizeMax) (REFIID riid, void * pv, DWORD dwDestContext, void * pvDestContext, DWORD mshlFlags, ULONG* pSize )
00074   {
00075     _ULARGE_INTEGER ul;
00076     HRESULT hr;
00077
00078     ul.LowPart = 0;
00079     ul.HighPart = 0;
00080     hr = GetSizeMax(&ul);
00081
00082     if (SUCCEEDED(hr))
00083       *pSize = ul.LowPart;
00084
00085     return hr;
00086   }
00087
00088   STDMETHOD(MarshalInterface)  (IStream* pStm, REFIID riid, void *pv, DWORD dwDestContext, void * pvDestContext, DWORD mshlFlags)
00089   {
00090     return Save(pStm, FALSE);
00091   }
00092
00093   STDMETHOD(UnmarshalInterface)(IStream* pStm, REFIID riid, void ** ppv )
00094   {
00095     HRESULT hr = Load(pStm);
00096
00097     if (SUCCEEDED(hr))
00098     {
00099       hr = QueryInterface(riid, ppv);
00100     }
00101     return hr;
00102   }
00103
00104   STDMETHOD (ReleaseMarshalData)(IStream *pStm)
00105   {
00106     return E_NOTIMPL;
00107   }
00108
00109     STDMETHOD (DisconnectObject)( DWORD dwReserved)
00110   {
00111     // Proxy and Object are not connected -- nothing to do
00112     return E_NOTIMPL;
00113   }
00114
00115 // IPersistStreamInit
00116 // IPersistStream
00117 // IPersist
00118   STDMETHOD(GetClassID)(GUID * pClassID)
00119   {
00120     if (pClassID == NULL)
00121       return E_POINTER;
00122
00123     *pClassID = GetObjectCLSID();
00124
00125     return S_OK;
00126   }
00127
00128   STDMETHOD(IsDirty)()
00129   {
00130     HRESULT hr = S_OK;
00131
00132     return hr;
00133   }
00134
00135   STDMETHOD(Load)(IStream * pStm)
00136   {
00137     long nSize = 0, nVer = 0, nCount;
00138     HRESULT hr = S_OK;
00139     CStaticEntity * spFirstEntity;
00140
00141     *pStm >> (long)nVer; // version
00142
00143     if (nVer < COLLECTION_VERSION)
00144       return STG_E_OLDFORMAT;
00145
00146     *pStm >> nCount; // count
00147     *pStm >> m_nAlloc; // count
00148
00149     *pStm >> m_wszUpdateStoredProc;
00150     *pStm >> m_wszReadStoredProc;
00151     *pStm >> m_wszDeleteStoredProc;
00152     *pStm >> m_wszInsertStoredProc;
00153     *pStm >> m_wszKeyField;
00154
00155     if (nCount > 0)
00156       spFirstEntity = GetEntity(0);
00157
00158     for (int n = 0; n < nCount && SUCCEEDED(hr); n++)
00159     {
00160       CStaticEntity * spEntity = GetEntity(n);
00161       hr = spEntity->LoadFromStream(pStm, (bool)(n==0));
00162
00163       // Since we only copy one set of metadata for the whole resultset
00164       // copy that one set into each entity.
00165       if (n > 0)
00166       {
00167         long nFields, nField;
00168
00169         hr = spFirstEntity->Count(&nFields);
00170
00171         if (SUCCEEDED(hr))
00172         {
00173           for (nField = 0; nField < nFields; nField++)
00174           {
00175             spEntity->m_keyMap.m_aKey[nField] = spFirstEntity->m_keyMap.m_aKey[nField];
00176           }
00177           spEntity->m_wszUpdateStoredProc = m_wszUpdateStoredProc;
00178           spEntity->m_wszReadStoredProc = m_wszReadStoredProc;
00179           spEntity->m_wszDeleteStoredProc = m_wszDeleteStoredProc;
00180           spEntity->m_wszInsertStoredProc = m_wszInsertStoredProc;
00181           spEntity->m_wszKeyField = m_wszKeyField;
00182         }
00183       }
00184     }
00185
00186     return hr;
00187   }
00188
00189   STDMETHOD(Save)(IStream * pStm, int fClearDirty)
00190   {
00191     long nSize = 0;
00192     HRESULT hr = S_OK;
00193
00194     *pStm << (long)COLLECTION_VERSION; // version
00195     *pStm << m_nCount; // count
00196     *pStm << m_nAlloc; // count
00197
00198     *pStm << (LPCWSTR)m_wszUpdateStoredProc;
00199     *pStm << (LPCWSTR)m_wszReadStoredProc;
00200     *pStm << (LPCWSTR)m_wszDeleteStoredProc;
00201     *pStm << (LPCWSTR)m_wszInsertStoredProc;
00202     *pStm << (LPCWSTR)m_wszKeyField;
00203
00204     for (int n = 0; (n < m_nCount && SUCCEEDED(hr)); n++)
00205     {
00206       CStaticEntity * spEntity = GetEntity(n);
00207       hr = spEntity->SaveToStream(pStm, FALSE, (bool)(n==0));
00208     }
00209     return hr;
00210   }
00211
00212   STDMETHOD(GetSizeMax)(_ULARGE_INTEGER * pCbSize)
00213   {
00214     if (pCbSize == NULL)
00215       return E_POINTER;
00216
00217     HRESULT hr = S_OK;
00218     unsigned long nSize = 0;
00219     unsigned long nMarshalSize = 0;
00220
00221     nSize += sizeof((long)COLLECTION_VERSION); // version
00222     nSize += sizeof(m_nCount); // count
00223     nSize += sizeof(m_nAlloc); // count
00224
00225     CFastVariant update((LPCWSTR)m_wszUpdateStoredProc);
00226     CFastVariant read((LPCWSTR)m_wszReadStoredProc);
00227     CFastVariant insert((LPCWSTR)m_wszInsertStoredProc);
00228     CFastVariant deletesp((LPCWSTR)m_wszDeleteStoredProc);
00229     CFastVariant key((LPCWSTR)m_wszKeyField);
00230
00231     nSize += GetVariantSize(update);
00232     nSize += GetVariantSize(insert);
00233     nSize += GetVariantSize(deletesp);
00234     nSize += GetVariantSize(read);
00235     nSize += GetVariantSize(key);
00236
00237     for (int n = 0; (n < m_nCount && SUCCEEDED(hr)); n++)
00238     {
00239       CStaticEntity * spEntity = GetEntity(n);
00240       nSize += spEntity->GetPersistSize((bool)(n==0));
00241     }
00242     pCbSize->LowPart = nSize;
00243     return hr;
00244   }
00245
00246   STDMETHOD(InitNew)()
00247   {
00248     Clear(true);
00249
00250     return S_OK;
00251   }
00252
00253 public:
00254 // Data
00255   CStaticEntity *m_pEntity[ENTITY_BANKS * ENTITY_PER_BANK];
00256   CFastVariant *m_pVar;
00257   long m_nCount;
00258   long m_nAlloc;
00259
00260   CString m_wszReadStoredProc;
00261   CString m_wszUpdateStoredProc;
00262   CString m_wszDeleteStoredProc;
00263   CString m_wszInsertStoredProc;
00264   CString m_wszKeyField;
00265
00266 // Implementation
00267   CStaticEntity *GetEntity(long nIndex);
00268
00269 // ISupportsErrorInfo
00270   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00271
00272 // IResultset
00273 public:
00274   void SetCount(long nCount);
00275   void DeleteEntity(long nIndex);
00276   HRESULT Initialise(long nRows);
00277   STDMETHOD(get_Record)(long nIndex, /*[out, retval]*/ IEntityData* *pVal);
00278   STDMETHOD(Count)(long* pi4);
00279   STDMETHOD(_NewEnum)(IUnknown** ppunk);
00280 };
00281
00282 class CDynamicResultset : public CComObject<CResultset>
00283 {
00284 public:
00285   STDMETHOD_(ULONG, Release)()
00286   {
00287     ULONG l = InternalRelease();
00288     if (l == 0)
00289       delete this;
00290     return 1;
00291   }
00292 };
00293
00294 #endif //__RESULTSET_H_
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/Misc.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

Misc.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   misc.c
00009 //
00010 //  PURPOSE:  Contains all helper functions "global" to the application.
00011 //
00012 //  FUNCTIONS:
00013 //    CenterWindow - Center one window over another.
00014 //    CmdStub      - Handles unimplemented commands.
00015 //                   Demonstrates the statusbar updating.
00016 //
00017 //  COMMENTS:
00018 //
00019
00020 #include <windows.h>            // required for all Windows applications
00021 #include <windowsx.h>
00022 #include "globals.h"            // prototypes specific to this application
00023 #include "statbar.h"
00024
00025
00026 //
00027 //  FUNCTION: CenterWindow(HWND, HWND)
00028 //
00029 //  PURPOSE:  Center one window over another.
00030 //
00031 //  PARAMETERS:
00032 //    hwndChild - The handle of the window to be centered.
00033 //    hwndParent- The handle of the window to center on.
00034 //
00035 //  RETURN VALUE:
00036 //
00037 //    TRUE  - Success
00038 //    FALSE - Failure
00039 //
00040 //  COMMENTS:
00041 //
00042 //    Dialog boxes take on the screen position that they were designed
00043 //    at, which is not always appropriate. Centering the dialog over a
00044 //    particular window usually results in a better position.
00045 //
00046
00047 BOOL CenterWindow(HWND hwndChild, HWND hwndParent)
00048 {
00049     RECT    rcChild, rcParent;
00050     int     cxChild, cyChild, cxParent, cyParent;
00051     int     cxScreen, cyScreen, xNew, yNew;
00052     HDC     hdc;
00053
00054     // Get the Height and Width of the child window
00055     GetWindowRect(hwndChild, &rcChild);
00056     cxChild = rcChild.right - rcChild.left;
00057     cyChild = rcChild.bottom - rcChild.top;
00058
00059     // Get the Height and Width of the parent window
00060     GetWindowRect(hwndParent, &rcParent);
00061     cxParent = rcParent.right - rcParent.left;
00062     cyParent = rcParent.bottom - rcParent.top;
00063
00064     // Get the display limits
00065     hdc = GetDC(hwndChild);
00066     cxScreen = GetDeviceCaps(hdc, HORZRES);
00067     cyScreen = GetDeviceCaps(hdc, VERTRES);
00068     ReleaseDC(hwndChild, hdc);
00069
00070     // Calculate new X position, then adjust for screen
00071     xNew = rcParent.left + ((cxParent - cxChild) / 2);
00072     if (xNew < 0)
00073     {
00074         xNew = 0;
00075     }
00076     else if ((xNew + cxChild) > cxScreen)
00077     {
00078         xNew = cxScreen - cxChild;
00079     }
00080
00081     // Calculate new Y position, then adjust for screen
00082     yNew = rcParent.top  + ((cyParent - cyChild) / 2);
00083     if (yNew < 0)
00084     {
00085         yNew = 0;
00086     }
00087     else if ((yNew + cyChild) > cyScreen)
00088     {
00089         yNew = cyScreen - cyChild;
00090     }
00091
00092     // Set it, and return
00093     return SetWindowPos(hwndChild,
00094                         NULL,
00095                         xNew, yNew,
00096                         0, 0,
00097                         SWP_NOSIZE | SWP_NOZORDER);
00098 }
00099
00100
00101 //
00102 //  FUNCTION: CmdStub(HWND, WORD, WORD, HWND)
00103 //
00104 //  PURPOSE:  Display statusbar updates by calling UpdateStatusBar
00105 //
00106 //  PARAMETERS:
00107 //    hwnd     - The window.
00108 //    wCommand - Menu command ID
00109 //    wNotify  - Notification number (unused)
00110 //    hwndCtrl - NULL (unused)
00111 //
00112 //  RETURN VALUE:
00113 //    Always returns 0 - command handled.
00114 //
00115 //  COMMENTS:
00116 //    Assumes there is a resource string describing this command with the
00117 //    same ID as the command ID.  Loads the string and calls UpdateStatusBar
00118 //    to put the string into main pane of the status bar.
00119 //
00120
00121 LRESULT CmdStub(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00122 {
00123     char szBuffer[50];
00124     int  cbWritten = 0;
00125
00126     cbWritten = LoadString(hInst, wCommand, szBuffer, sizeof(szBuffer));
00127     if(cbWritten == 0)
00128     {
00129         strncpy(szBuffer, "Unknown Command", 49);
00130     szBuffer[49] = '\0';
00131         UpdateStatusBar(szBuffer, 0, 0);
00132     }
00133     else
00134     {
00135         UpdateStatusBar(szBuffer, 0, 0);
00136         MessageBox (hwnd,
00137                     "Command Not Implemented:\r\n Demonstration Purposes Only",
00138                     "TAPICOMM",
00139                     MB_OK | MB_ICONEXCLAMATION);
00140     }
00141      /*
00142       * Once the command is executed, set the statusbar text to
00143       * original text.
00144       */
00145     UpdateStatusBar(SZDESCRIPTION, 0, 0);
00146
00147     return 0;
00148 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/tscroll.cpp Source File

  • Begin
  • sdkdiff

tscroll.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * tscroll.cpp
00013  *
00014  * standard table class.
00015  *
00016  * scrolling and selection routines
00017  *
00018  * see table.h for interface description
00019  *
00020  * This implementation currently only supports TM_SINGLE, not TM_MANY
00021  * modes of selection.
00022  */
00023
00024 #include "precomp.h"
00025
00026 #include "table.h"
00027 #include "tpriv.h"
00028
00029
00030 VOID
00031 gtab_extendsel(
00032     HWND hwnd,
00033     lpTable ptab,
00034     long startrow,
00035     long startcell,
00036     BOOL bNotify
00037 );
00038
00039
00040 /* handle a vscroll message */
00041 void
00042 gtab_msg_vscroll(HWND hwnd, lpTable ptab, int opcode, int pos)
00043 {
00044     long change;
00045
00046     switch(opcode) {
00047     case SB_THUMBPOSITION:
00048     case SB_THUMBTRACK:
00049         change = (pos * ptab->scrollscale) - ptab->toprow;
00050         break;
00051
00052     case SB_LINEUP:
00053         change = -1;
00054         break;
00055
00056     case SB_LINEDOWN:
00057         change = 1;
00058         break;
00059
00060     case SB_PAGEUP:
00061         change = - (ptab->nlines - 3);
00062         if (change>=0)
00063             change = -1;    // consider nlines <=3!
00064         break;
00065
00066     case SB_PAGEDOWN:
00067         change = (ptab->nlines - 3);
00068         if (change<=0)
00069             change = 1;     // consider nlines <=3!
00070         break;
00071
00072     default:
00073         return;
00074     }
00075     gtab_dovscroll(hwnd, ptab, change);
00076 }
00077
00078 /* handle a hscroll message */
00079 void
00080 gtab_msg_hscroll(HWND hwnd, lpTable ptab, int opcode, int pos)
00081 {
00082     int change;
00083
00084     switch(opcode) {
00085     case SB_THUMBPOSITION:
00086     case SB_THUMBTRACK:
00087         change = pos - ptab->scroll_dx;
00088         break;
00089
00090     case SB_LINEUP:
00091         change = -(ptab->avewidth);
00092         break;
00093
00094     case SB_LINEDOWN:
00095         change = ptab->avewidth;
00096         break;
00097
00098     case SB_PAGEUP:
00099         change = - (ptab->winwidth * 2 / 3);
00100         break;
00101
00102     case SB_PAGEDOWN:
00103         change = (ptab->winwidth * 2 / 3);
00104         break;
00105
00106     default:
00107         return;
00108     }
00109     gtab_dohscroll(hwnd, ptab, change);
00110 }
00111
00112
00113
00114 /*
00115  * set new vertical scroll pos,
00116  * adjust linedata array
00117  * set line win-relative start posns & clip top/bottom posns
00118  * revise display.
00119  */
00120 void
00121 gtab_dovscroll(HWND hwnd, lpTable ptab, long change)
00122 {
00123     int cury, i;
00124     long ncopy;
00125     lpCellPos cp;
00126     LineData ldtemp;
00127     RECT rc, rcpaint;
00128     long range;
00129     long newtop;
00130     int newpos;
00131     BOOL fWasVisible = FALSE;
00132
00133     if (ptab->selvisible)
00134     {
00135         fWasVisible = TRUE;
00136         ptab->selvisible = FALSE;
00137         gtab_invertsel(hwnd, ptab, NULL);
00138     }
00139
00140     range = ptab->hdr.nrows - (ptab->nlines - 1);
00141     newtop = ptab->toprow + change;
00142     if (range < 0) {
00143         range = 0;
00144     }
00145     if (newtop > range) {
00146         change = range - ptab->toprow;
00147     } else if (newtop < 0) {
00148         change = -(ptab->toprow);
00149     }
00150     ptab->toprow += change;
00151
00152     newpos = (int) (newtop / ptab->scrollscale);
00153     SetScrollPos(hwnd, SB_VERT, newpos, TRUE);
00154
00155     if (ptab->hdr.sendscroll) {
00156         gtab_sendtq(hwnd, TQ_SCROLL, ptab->toprow);
00157     }
00158
00159     /* adjust data ptrs rather than invalidate, to retain the
00160      * data we know is still valid
00161      */
00162     if (abs(change) >= ptab->nlines) {
00163         gtab_invallines(hwnd, ptab, ptab->hdr.fixedrows,
00164             ptab->nlines - ptab->hdr.fixedrows);
00165         InvalidateRect(hwnd, NULL, FALSE);
00166         change = 0;
00167     } else if (change < 0) {
00168         /* copy data down */
00169         ncopy = (ptab->nlines - ptab->hdr.fixedrows) - abs(change);
00170         for (i =  ptab->nlines - 1;
00171                 i >= (ptab->hdr.fixedrows + abs(change)); i--) {
00172             ldtemp = ptab->pdata[i - abs(change)];
00173             ptab->pdata[i - abs(change)] = ptab->pdata[i];
00174             ptab->pdata[i] = ldtemp;
00175         }
00176         gtab_invallines(hwnd, ptab,
00177                 ptab->hdr.fixedrows, (int) abs(change));
00178     } else if (change > 0) {
00179         ncopy = (ptab->nlines - ptab->hdr.fixedrows) - change;
00180         for (i = ptab->hdr.fixedrows;
00181                 i < (ncopy + ptab->hdr.fixedrows); i++) {
00182             ldtemp = ptab->pdata[i + change];
00183             ptab->pdata[i + change] = ptab->pdata[i];
00184             ptab->pdata[i] = ldtemp;
00185         }
00186         gtab_invallines(hwnd, ptab,
00187             (int) ncopy + ptab->hdr.fixedrows, (int) change);
00188     }
00189
00190     /* scroll window */
00191     GetClientRect(hwnd, &rc);
00192     rcpaint = rc;
00193     if (change > 0) {
00194         rc.top += (int) (change + ptab->hdr.fixedrows) * ptab->rowheight;
00195         rcpaint.top = (ptab->hdr.fixedrows * ptab->rowheight);
00196         rcpaint.top += rc.bottom - rc.top;
00197     } else if (change < 0) {
00198         rc.top += (ptab->hdr.fixedrows * ptab->rowheight);
00199         rc.bottom += (int) (change * ptab->rowheight);
00200         rcpaint.bottom -= rc.bottom - rc.top;
00201     }
00202
00203     /* loop through each line setting relative posn and clipping */
00204
00205     /* set up all rows  - the fixed/moveable difference for
00206      * rows is made at fetch-time during painting, when we remember
00207      * which absolute row nr to ask for, for a given screen line
00208      */
00209     cury = 0;
00210     for (i = 0; i < ptab->nlines; i++) {
00211         cp = &ptab->pdata[i].linepos;
00212         cp->start = cury;
00213         cp->clipstart = cury;
00214         cp->clipend = cury + cp->size;
00215         cury += cp->size;
00216     }
00217
00218     /* now move and repaint the window */
00219     if (change != 0) {
00220         if (rc.top < rc.bottom) {
00221             ScrollWindow(hwnd, 0, (int) -(change * ptab->rowheight),
00222                 &rc, NULL);
00223         }
00224
00225         // don't repaint the fixed rows
00226         rc.top = 0;
00227         rc.bottom = ptab->hdr.fixedrows * ptab->rowheight;
00228         ValidateRect(hwnd, &rc);
00229
00230         /* force repaint now, not just post message for later,
00231          * since we want to repaint that line before the next
00232          * scroll down occurs
00233          */
00234         ValidateRect(hwnd, &rcpaint);
00235         RedrawWindow(hwnd, &rcpaint, NULL,
00236                 RDW_NOERASE | RDW_INVALIDATE | RDW_INTERNALPAINT);
00237
00238     }
00239
00240     if (fWasVisible)
00241     {
00242         gtab_invertsel(hwnd, ptab, NULL);
00243         ptab->selvisible = TRUE;
00244     }
00245 }
00246
00247 /*
00248  * set new horizontal scroll pos,
00249  * set col win-relative start posns & clip left/right posns
00250  * revise display.
00251  */
00252 void
00253 gtab_dohscroll(HWND hwnd, lpTable ptab, long change)
00254 {
00255     int curx, i;
00256     int moveable;
00257     lpCellPos cp;
00258     int newdx, range;
00259
00260
00261     /* check that the new scroll pos is still within the valid range */
00262     range = ptab->rowwidth - ptab->winwidth;
00263     newdx = ptab->scroll_dx + (int) change;
00264     if (range < 0) {
00265         range = 0;
00266     }
00267     if (newdx > range) {
00268         change = range - ptab->scroll_dx;
00269     } else if (newdx < 0) {
00270         change = -(ptab->scroll_dx);
00271     }
00272     ptab->scroll_dx += (int) change;
00273
00274     SetScrollPos(hwnd, SB_HORZ, ptab->scroll_dx, TRUE);
00275     if (ptab->hdr.fixedcols > 0) {
00276         RECT rc;
00277         GetClientRect(hwnd, &rc);
00278         rc.left = ptab->pcellpos[ptab->hdr.fixedcols - 1].clipend;
00279         InvalidateRect(hwnd, &rc, FALSE);
00280     } else {
00281         InvalidateRect(hwnd, NULL, FALSE);
00282     }
00283
00284     /* loop through each col setting relative posn and clipping */
00285     /* clip off 1 pixel left and right (we added 2 on to size for this) */
00286
00287     /* first set up fixed columns */
00288     curx = 0;
00289     for (i = 0; i < ptab->hdr.fixedcols; i++) {
00290         cp = &ptab->pcellpos[i];
00291         cp->start = curx + 1;
00292         cp->clipstart = cp->start;
00293         cp->clipend = cp->start + cp->size - 2;
00294         curx += cp->size;
00295     }
00296
00297     /* now moveable columns. remember start of moveable cols */
00298     moveable = curx;
00299     curx = - ptab->scroll_dx;       /* rel. pos of col */
00300     for (i = ptab->hdr.fixedcols; i < ptab->hdr.ncols; i++) {
00301         cp = &ptab->pcellpos[i];
00302         cp->start = curx + moveable + 1;
00303         cp->clipstart = max(moveable+1, cp->start);
00304         cp->clipend = cp->start + cp->size - 2;
00305         curx += cp->size;
00306     }
00307 }
00308
00309 /*
00310  * convert screen line nr to table row nr
00311  */
00312 long
00313 gtab_linetorow(HWND hwnd, lpTable ptab, int line)
00314 {
00315     if (line < ptab->hdr.fixedrows) {
00316         return(line);
00317     }
00318
00319     return (line + ptab->toprow);
00320 }
00321
00322 /*
00323  * convert table row nr to screen line nr or -1 if not on screen
00324  */
00325 int
00326 gtab_rowtoline(HWND hwnd, lpTable ptab, long row)
00327 {
00328     if (row < ptab->hdr.fixedrows) {
00329         return( (int) row);
00330     }
00331
00332     row -= ptab->toprow;
00333     if ((row >= ptab->hdr.fixedrows) && (row < ptab->nlines)) {
00334         return ( (int) row);
00335     }
00336     return(-1);
00337 }
00338
00339
00340 /*
00341  * check if a given location is within the current selection.
00342  * Returns true if it is inside the current selection, or false if
00343  * either there is no selection, or the row, cell passed is outside it.
00344  */
00345 BOOL
00346 gtab_insideselection(
00347     lpTable ptab,
00348     long row,
00349     long cell)
00350 {
00351     long startrow, endrow;
00352     long startcell, endcell;
00353
00354     if (0 == ptab->select.nrows) {
00355         // no selection
00356         return FALSE;
00357     }
00358
00359     // selection maintains anchor point as startrow,
00360     // so the selection can extend forwards or backwards from there.
00361     // need to convert to forward only for comparison
00362     startrow = ptab->select.startrow;
00363     if (ptab->select.nrows < 0) {
00364         endrow = startrow;
00365         startrow += ptab->select.nrows + 1;
00366     } else {
00367         endrow = startrow + ptab->select.nrows - 1;
00368     }
00369     if ((row < startrow) || (row > endrow)) {
00370         return FALSE;
00371     }
00372
00373     // if we are in row-select mode, then that's it - its inside
00374     if (ptab->hdr.selectmode & TM_ROW) {
00375         return TRUE;
00376     }
00377
00378     // same calculation for cells
00379     startcell = ptab->select.startcell;
00380     if (ptab->select.ncells < 0) {
00381         endcell = startcell;
00382         startcell += ptab->select.ncells + 1;
00383     } else {
00384         endcell = startcell + ptab->select.ncells - 1;
00385     }
00386     if ((cell < startcell) || (cell > endcell)) {
00387         return FALSE;
00388     }
00389
00390     return TRUE;
00391 }
00392
00393
00394
00395 /*
00396  * replace old selection with new. Notify owner if bNotify. Change
00397  * display to reflect new display.
00398  */
00399 void
00400 gtab_select(
00401         HWND hwnd,
00402         lpTable ptab,
00403         long row,
00404         long col,
00405         long nrows,
00406         long ncells,
00407         BOOL bNotify)
00408 {
00409
00410     /* if in ROW mode, force col and ncells to reflect the entire row. */
00411     if (ptab->hdr.selectmode & TM_ROW) {
00412         col = 0;
00413         ncells = ptab->hdr.ncols;
00414     }
00415
00416     /* clear existing sel if valid and visible */
00417     if ((ptab->select.nrows != 0) && (ptab->selvisible == TRUE)) {
00418
00419         /* only clear sel if it is different from the new one */
00420         if ((ptab->select.startrow != row) ||
00421                 (ptab->select.startcell != col) ||
00422                 (ptab->select.nrows != nrows) ||
00423                 (ptab->select.ncells != ncells)) {
00424
00425             gtab_invertsel(hwnd, ptab, NULL);
00426             ptab->selvisible = FALSE;
00427         }
00428     }
00429
00430     /* set select fields and send TQ_SELECT */
00431     if (row < ptab->hdr.nrows) {
00432         ptab->select.startrow = row;
00433         ptab->select.startcell = col;
00434         ptab->select.nrows = nrows;
00435         ptab->select.ncells = ncells;
00436     } else {
00437         ptab->select.nrows = 0;
00438         ptab->select.startrow = 0;
00439         ptab->select.startcell = 0;
00440         ptab->select.ncells = 0;
00441     }
00442
00443     if (bNotify) {
00444         gtab_sendtq(hwnd, TQ_SELECT, (LPARAM) &ptab->select);
00445     }
00446
00447     /* paint in selection */
00448     if (nrows != 0) {
00449         if (!ptab->selvisible) {
00450             gtab_invertsel(hwnd, ptab, NULL);
00451             ptab->selvisible = TRUE;
00452         }
00453     } else {
00454         if (ptab->selvisible) {
00455             gtab_invertsel(hwnd, ptab, NULL);
00456             ptab->selvisible = FALSE;
00457         }
00458         ptab->selvisible = FALSE;
00459     }
00460 }
00461
00462 /*
00463  * convert window y co-ord to a line nr
00464  */
00465 int
00466 gtab_ytoline(HWND hwnd, lpTable ptab, int y)
00467 {
00468     return(y / ptab->rowheight);
00469 }
00470
00471 /*
00472  * convert window x co-ord to a cell nr
00473  */
00474 int
00475 gtab_xtocol(HWND hwnd, lpTable ptab, int x)
00476 {
00477     int i;
00478     lpCellPos ppos;
00479
00480     for (i = 0; i < ptab->hdr.ncols; i++) {
00481         ppos = &ptab->pcellpos[i];
00482         if (ppos->clipstart < ppos->clipend) {
00483             if ( (x >= ppos->clipstart) && (x < ppos->clipend)) {
00484                 return(i);
00485             }
00486         }
00487     }
00488     return(-1);
00489 }
00490
00491
00492 /*
00493  * check if x co-ord is 'near' (+- 2 pixels) the right border of given cell
00494  */
00495 BOOL
00496 gtab_isborder(HWND hwnd, lpTable ptab, long x, long col)
00497 {
00498
00499     if (abs(ptab->pcellpos[col].clipend - x) < 2) {
00500         return(TRUE);
00501     } else {
00502         return(FALSE);
00503     }
00504 }
00505
00506
00507 /*
00508  * set selection and send 'TQ_ENTER' event to owner
00509  */
00510 void
00511 gtab_enter(HWND hwnd, lpTable ptab, long row, long col, long nrows,
00512         long ncells)
00513 {
00514     /* clear existing sel if valid and visible */
00515     if ((ptab->select.nrows != 0) && (ptab->selvisible == TRUE)) {
00516
00517         /* only clear sel if it is different from the new one */
00518         if ((ptab->select.startrow != row) ||
00519                 (ptab->select.startcell != col) ||
00520                 (ptab->select.nrows != nrows) ||
00521                 (ptab->select.ncells != ncells)) {
00522             gtab_invertsel(hwnd, ptab, NULL);
00523             ptab->selvisible = FALSE;
00524         }
00525     }
00526
00527     /* set select fields and send TQ_ENTER */
00528     if (row < ptab->hdr.nrows) {
00529         ptab->select.startrow = row;
00530         ptab->select.startcell = col;
00531         ptab->select.nrows = nrows;
00532         ptab->select.ncells = ncells;
00533     } else {
00534         ptab->select.nrows = 0;
00535         ptab->select.startrow = 0;
00536         ptab->select.startcell = 0;
00537         ptab->select.ncells = 0;
00538     }
00539
00540     /* paint in selection */
00541     if (nrows != 0) {
00542         if (!ptab->selvisible) {
00543             gtab_invertsel(hwnd, ptab, NULL);
00544             ptab->selvisible = TRUE;
00545         }
00546         /* do this at end because it could cause a layout-change */
00547         gtab_sendtq(hwnd, TQ_ENTER, (LPARAM) &ptab->select);
00548     } else {
00549         if (ptab->selvisible) {
00550             gtab_invertsel(hwnd, ptab, NULL);
00551         }
00552         ptab->selvisible = FALSE;
00553     }
00554 }
00555
00556
00557 /*
00558  * start re-sizing a column
00559  */
00560 void
00561 gtab_trackcol(HWND hwnd, lpTable ptab, long col, long x)
00562 {
00563
00564     /* ensure we see the mouse-up */
00565     SetCapture(hwnd);
00566     ptab->trackmode = TRACK_COLUMN;
00567 #ifdef WIN32
00568     ptab->tracknr = col;
00569     ptab->trackline1 = x;
00570 #else
00571     // maximum 32767 columns is a reasonable limit!
00572     ptab->tracknr = (int) (col & 0x7fff);
00573     ptab->trackline1 = (int) (x & 0x7fff);
00574 #endif
00575
00576     /* if line at other side of cell is visible, draw that too */
00577     if (ptab->pcellpos[col].start >= ptab->pcellpos[col].clipstart) {
00578         ptab->trackline2 = ptab->pcellpos[col].start;
00579     } else {
00580         ptab->trackline2 = -1;
00581     }
00582     gtab_drawvertline(hwnd, ptab);
00583 }
00584
00585
00586 /*
00587  * called on right-click events. Select the cell clicked on, and if
00588  * valid, send on to owner for any context-menu type operation
00589  */
00590 void
00591 gtab_rightclick(HWND hwnd, lpTable ptab, int x, int y)
00592 {
00593     long cell, ncells;
00594     long row;
00595     HWND hOwner;
00596
00597     /* find which col, row he selected */
00598     cell = gtab_xtocol(hwnd, ptab, x);
00599     if (cell == -1) {
00600         return;
00601     }
00602     row = gtab_linetorow(hwnd, ptab, gtab_ytoline(hwnd, ptab, y));
00603
00604     /* is he selecting a disabled fixed area ? */
00605     if ( (row < ptab->hdr.fixedrows) || (cell < ptab->hdr.fixedcols)) {
00606         if (ptab->hdr.fixedselectable == FALSE) {
00607             return;
00608         }
00609     }
00610
00611     // ignore if beyond data
00612     if ((row >= ptab->hdr.nrows) ||
00613             (cell >= ptab->hdr.ncols)) {
00614         return;
00615     }
00616
00617     /* is this within the already-selected area? */
00618     if (!gtab_insideselection(ptab, row, cell)) {
00619         // no selection, or clicked outside the selection - make new selection
00620         // before sending the right-click
00621
00622         // if shift is down, extend selection
00623         if (GetKeyState(VK_SHIFT) & 0x8000) {
00624             gtab_extendsel(hwnd, ptab, row, cell, TRUE);
00625         } else {
00626             /* record and paint new selection */
00627
00628             if (ptab->hdr.selectmode & TM_ROW) {
00629                 cell = 0;
00630                 ncells = ptab->hdr.ncols;
00631             } else {
00632                 ncells = 1;
00633             }
00634             gtab_select(hwnd, ptab, row, cell, 1, ncells, TRUE);
00635         }
00636     }
00637
00638     // now we have sent the selection, pass the message onto him
00639     hOwner = (HWND) GetWindowLongPtr(hwnd, WW_OWNER);
00640     SendMessage(hOwner, WM_RBUTTONDOWN, 0, MAKELONG( (short)x, (short)y));
00641 }
00642
00643
00644 /*
00645  * called on mouse-down events. decide what to start tracking.
00646  */
00647 void
00648 gtab_press(HWND hwnd, lpTable ptab, int x, int y)
00649 {
00650     long cell, ncells;
00651     long row;
00652
00653     if (ptab->trackmode != TRACK_NONE) {
00654         return;
00655     }
00656
00657     /* has he grabbed a cell-edge to resize ? */
00658     cell = gtab_xtocol(hwnd, ptab, x);
00659     if (cell == -1) {
00660         return;
00661     }
00662     if (gtab_isborder(hwnd, ptab, x, cell)) {
00663         gtab_trackcol(hwnd, ptab, cell, x);
00664         return;
00665     }
00666     if ( (cell > 0) && gtab_isborder(hwnd, ptab, x, cell-1)) {
00667         gtab_trackcol(hwnd, ptab, cell, x);
00668         return;
00669     }
00670
00671     /* find which line he selected */
00672     row = gtab_linetorow(hwnd, ptab, gtab_ytoline(hwnd, ptab, y));
00673
00674     /* is he selecting a disabled fixed area ? */
00675     if ( (row < ptab->hdr.fixedrows) || (cell < ptab->hdr.fixedcols)) {
00676         if (ptab->hdr.fixedselectable == FALSE) {
00677             return;
00678         }
00679     }
00680
00681     // ignore if beyond data
00682     if ((row >= ptab->hdr.nrows) ||
00683             (cell >= ptab->hdr.ncols)) {
00684         return;
00685     }
00686
00687
00688     /* ok, start cell selection */
00689     ptab->trackmode = TRACK_CELL;
00690     SetCapture(hwnd);
00691
00692     /* record and paint new selection */
00693
00694     if (ptab->hdr.selectmode & TM_ROW) {
00695         cell = 0;
00696         ncells = ptab->hdr.ncols;
00697     } else {
00698         ncells = 1;
00699     }
00700
00701     /*
00702      * if the shift key is down, then extend the selection to this
00703      * new anchor point, rather than create a new selection
00704      */
00705     if (GetKeyState(VK_SHIFT) & 0x8000) {
00706         gtab_extendsel(hwnd, ptab, row, cell, FALSE);
00707     } else {
00708         gtab_select(hwnd, ptab, row, cell, 1, ncells, FALSE);
00709     }
00710     return;
00711 }
00712
00713 /*
00714  * called on mouse-up. complete any tracking that was happening
00715  */
00716 void
00717 gtab_release(HWND hwnd, lpTable ptab, int x, int y)
00718 {
00719     lpCellPos ppos;
00720     lpProps pprop;
00721     long row, cell;
00722     int cx;
00723
00724     switch(ptab->trackmode) {
00725
00726     case TRACK_NONE:
00727         return;
00728
00729     case TRACK_COLUMN:
00730         /* erase marker lines */
00731         gtab_drawvertline(hwnd, ptab);
00732         ReleaseCapture();
00733         ptab->trackmode = TRACK_NONE;
00734
00735         /* adjust cell width */
00736         ppos = &ptab->pcellpos[ptab->tracknr];
00737         cx = ptab->trackline1 - ppos->start;
00738         pprop = &ptab->pcolhdr[ptab->tracknr].props;
00739         pprop->valid |= P_WIDTH;
00740         pprop->width = cx;
00741         gtab_calcwidths(hwnd, ptab);
00742         gtab_setsize(hwnd, ptab);
00743         InvalidateRect(hwnd, NULL, FALSE);
00744         return;
00745
00746     case TRACK_CELL:
00747         row = gtab_linetorow(hwnd, ptab, gtab_ytoline(hwnd, ptab, y));
00748         cell = gtab_xtocol(hwnd, ptab, x);
00749
00750         ReleaseCapture();
00751         ptab->trackmode = TRACK_NONE;
00752
00753         // ignore if before or beyond data
00754         if ( (row < ptab->hdr.fixedrows) ||
00755              (cell < ptab->hdr.fixedcols)) {
00756             if (ptab->hdr.fixedselectable == FALSE) {
00757                 gtab_select(
00758                     hwnd,
00759                     ptab,
00760                     ptab->select.startrow,
00761                     ptab->select.startcell,
00762                     ptab->select.nrows,
00763                     ptab->select.ncells,
00764                     TRUE);
00765
00766                 return;
00767             }
00768         }
00769
00770         if ((row >= ptab->hdr.nrows) ||
00771                 (cell >= ptab->hdr.ncols)) {
00772             gtab_select(
00773                     hwnd,
00774                     ptab,
00775                     ptab->select.startrow,
00776                     ptab->select.startcell,
00777                     ptab->select.nrows,
00778                     ptab->select.ncells,
00779                     TRUE);
00780             return;
00781         }
00782
00783         /*
00784          * Extend to this new selection end point
00785          * we used to only do this if shift key pressed, but that
00786          * is not a good UI.
00787          */
00788         gtab_extendsel(hwnd, ptab, row, cell, TRUE);
00789         return;
00790     }
00791 }
00792
00793
00794 /* called on mouse-move. if tracking - adjust position, if not,
00795  * set correct cursor
00796  */
00797 void
00798 gtab_move(HWND hwnd, lpTable ptab, int x, int y)
00799 {
00800     BOOL fOK;
00801     int line;
00802     long row;
00803     int col;
00804     lpCellPos ppos;
00805
00806     switch(ptab->trackmode) {
00807
00808     case TRACK_NONE:
00809         col = gtab_xtocol(hwnd, ptab, x);
00810         if (col == -1) {
00811             SetCursor((HCURSOR)hNormCurs);
00812             return;
00813         }
00814         if (gtab_isborder(hwnd, ptab, x, col)) {
00815             SetCursor((HCURSOR)hVertCurs);
00816             return;
00817         }
00818         if ( (col > 0) && gtab_isborder(hwnd, ptab, x, col-1)) {
00819             SetCursor((HCURSOR)hVertCurs);
00820             return;
00821         }
00822         SetCursor((HCURSOR)hNormCurs);
00823         return;
00824
00825     case TRACK_CELL:
00826         line = gtab_ytoline(hwnd, ptab, y);
00827
00828         // we used to only allow drag to extend
00829         // the selection if the shift key was down.
00830         // this doesn't seem to work as a UI - you expect
00831         // to drag and extend.
00832
00833         /* if extending selection then
00834          * allow scrolling by dragging off window
00835          */
00836         if (line < 0) {
00837             gtab_dovscroll(hwnd, ptab, -1);
00838             line = gtab_ytoline(hwnd, ptab, y);
00839         } else if (line >=  ptab->nlines) {
00840             gtab_dovscroll(hwnd, ptab, 1);
00841             line = gtab_ytoline(hwnd, ptab, y);
00842         }
00843
00844
00845         row = gtab_linetorow(hwnd, ptab, line);
00846         col = gtab_xtocol(hwnd, ptab, x);
00847
00848         // ignore if before or beyond data
00849         if ( (row < ptab->hdr.fixedrows) || (col < ptab->hdr.fixedcols)) {
00850             if (ptab->hdr.fixedselectable == FALSE) {
00851                 return;
00852             }
00853         }
00854
00855         if ((row >= ptab->hdr.nrows) ||
00856             (col >= ptab->hdr.ncols)) {
00857             return;
00858         }
00859
00860         /*
00861          * extend to this new selection end point
00862          */
00863         gtab_extendsel(hwnd, ptab, row, col, FALSE);
00864         return;
00865
00866     case TRACK_COLUMN:
00867         /* check that new x is still visible/valid */
00868         ppos = &ptab->pcellpos[ptab->tracknr];
00869         fOK = FALSE;
00870
00871         if (ptab->tracknr < ptab->hdr.fixedcols)  {
00872             if ((x > ppos->start) && (x < ptab->winwidth)) {
00873                 fOK = TRUE;
00874             }
00875         } else {
00876             if ((x > ppos->clipstart) && (x < ptab->winwidth)) {
00877                 fOK = TRUE;
00878             }
00879         }
00880         if (fOK == TRUE) {
00881             gtab_drawvertline(hwnd, ptab);
00882             ptab->trackline1 = x;
00883             gtab_drawvertline(hwnd, ptab);
00884         }
00885         return;
00886     }
00887 }
00888
00889 /* dbl-click - send an TQ_ENTER event to the owner (if valid) */
00890 void
00891 gtab_dblclick(HWND hwnd, lpTable ptab, int x, int y)
00892 {
00893     int cell, line;
00894     long row;
00895
00896     line = gtab_ytoline(hwnd, ptab, y);
00897     cell = gtab_xtocol(hwnd, ptab, x);
00898     if ( (line < ptab->hdr.fixedrows) || (cell < ptab->hdr.fixedcols) ) {
00899         if (!ptab->hdr.fixedselectable) {
00900             return;
00901         }
00902     }
00903     row = gtab_linetorow(hwnd, ptab, line);
00904
00905     if (ptab->hdr.selectmode & TM_ROW) {
00906         gtab_enter(hwnd, ptab, row, 0, 1, ptab->hdr.ncols);
00907     } else {
00908         gtab_enter(hwnd, ptab, row, cell, 1, 1);
00909     }
00910 }
00911
00912 /*
00913  * move selection area to visible part of window. argument bToBottom
00914  * indicates whether to move the line onto the bottom or the top of the
00915  * window if not visible - this affects the smoothness of scrolling
00916  * line-by-line.
00917  */
00918 void
00919 gtab_showsel(HWND hwnd, lpTable ptab, BOOL bToBottom)
00920 {
00921     int line;
00922     long change;
00923
00924     line = gtab_rowtoline(hwnd, ptab, ptab->select.startrow);
00925
00926     /* move up if last line or not at all visible */
00927     if ( (line < 0) || line == (ptab->nlines - 1)) {
00928         change = ptab->select.startrow - ptab->toprow;
00929         if (bToBottom) {
00930             /* change to bottom of window. subtract 2 not 1
00931              * since nlines includes one line that is only
00932              * partly visible
00933              */
00934             change -= (ptab->nlines - 2);
00935         }
00936         change -= ptab->hdr.fixedrows;
00937         gtab_dovscroll(hwnd, ptab, change);
00938     }
00939     /* add support for TM_CELL here! */
00940 }
00941
00942 /*
00943  * scroll the window so that if possible, the selected row is in the
00944  * middle 60% of the screen so that context around it is visible.
00945  */
00946 void
00947 gtab_showsel_middle(HWND hwnd, lpTable ptab, long dyRowsFromTop)
00948 {
00949     int line = ptab->select.startrow;
00950     long change = 0;
00951     int mid_top, mid_end;
00952     BOOL fScroll = FALSE;
00953
00954     if (dyRowsFromTop >= 0)
00955     {
00956         fScroll = TRUE;
00957         change = (ptab->select.startrow - dyRowsFromTop) - ptab->toprow;
00958         change -= ptab->hdr.fixedrows;
00959     }
00960
00961     /* is this within the middle 60 % ?  */
00962     mid_top = ptab->toprow + (ptab->nlines * 20 / 100);
00963     mid_end = ptab->toprow + (ptab->nlines * 80 / 100);
00964     if ((line < mid_top + change) || (line > mid_end + change))
00965     {
00966         /* no - scroll so that selected line is at
00967          * the 20% mark
00968          */
00969         fScroll = TRUE;
00970         change = (ptab->select.startrow - mid_top);
00971         change -= ptab->hdr.fixedrows;
00972     }
00973
00974     if (fScroll)
00975     {
00976         gtab_dovscroll(hwnd, ptab, change);
00977     }
00978
00979     /* again - need code here for TM_CELL mode to ensure that
00980      * active cell is horizontally scrolled correctly
00981      */
00982 }
00983
00984
00985 /*
00986  * extend the selection to set the new anchor point as startrow, startcell.
00987  *
00988  * nrows and ncells will then be set to include the end row of the previous
00989  * selection. nrows, ncells < 0 indicate left and up. -1 and +1 both indicate
00990  * just one cell or row selected.
00991  */
00992 VOID
00993 gtab_extendsel(
00994     HWND hwnd,
00995     lpTable ptab,
00996     long startrow,
00997     long startcell,
00998     BOOL bNotify
00999 )
01000 {
01001     long endrow, endcell, nrows, ncells;
01002
01003     /*
01004      * if no current selection, then just select the new anchor point
01005      */
01006     if (ptab->select.nrows == 0) {
01007         gtab_select(hwnd, ptab, startrow, startcell, 1,
01008             (ptab->hdr.selectmode & TM_ROW) ? ptab->hdr.ncols:1,
01009             bNotify);
01010         return;
01011     }
01012
01013     if (startrow >= ptab->hdr.nrows) {
01014         startrow = ptab->hdr.nrows -1;
01015     } else if (startrow < 0) {
01016         startrow = 0;
01017     }
01018     if (startcell >= ptab->hdr.ncols) {
01019         startcell = ptab->hdr.ncols-1;
01020     } else if (startcell < 0) {
01021         startcell = 0;
01022     }
01023
01024
01025
01026     /* calculate the row just beyond the selection
01027      * this is one above for upwards sels, and one below for
01028      * downard-extending sels. Then adjust down or up one
01029      * to be the actual (inclusive) last row.
01030      */
01031     endrow = ptab->select.startrow + ptab->select.nrows;
01032     if (ptab->select.nrows < 0) {
01033         endrow++;
01034     } else {
01035         endrow--;
01036     }
01037
01038     if (endrow >= ptab->hdr.nrows) {
01039         endrow = ptab->hdr.nrows-1;
01040     }
01041     nrows = endrow - startrow;
01042
01043     if (nrows >= 0) {
01044         // convert from exclusive to inclusive
01045         nrows++;
01046     } else {
01047         // convert from exclusive to inclusive
01048         nrows--;
01049     }
01050
01051     /* same calculation for cells */
01052     endcell = ptab->select.startcell + ptab->select.ncells;
01053     if (ptab->select.ncells < 0) {
01054         endcell++;
01055     } else {
01056         endcell--;
01057     }
01058     ncells = endcell - startcell;
01059     if (ncells >= 0) {
01060         ncells++;
01061     } else {
01062         ncells--;
01063     }
01064     gtab_select(hwnd, ptab, startrow, startcell, nrows, ncells, bNotify);
01065 }
01066
01067
01068
01069 /* move the selection a specified nr of rows or cells
01070  * if no selection, select first visible unit
01071  *
01072  * if bExtend is true and there is a current selection, then extend it rather than
01073  * replace it. Note that (startrow, startcell) will always be set to the newly
01074  * selected position - this is the anchor point. nrows or ncells may be negative
01075  * if the selection extends upwards above the anchor. nrows == -1 is the same
01076  * as nrows == 1, meaning only the current row is visible. Similarly
01077  * (in TM_CELL mode), ncells may be negative.
01078  *
01079  * Move the selection (ie anchor point) to make it visible. bToBottom
01080  * indicates whether it should be moved to the bottom or the top
01081  * of the window.
01082  */
01083 VOID
01084 gtab_changesel(
01085     HWND hwnd,
01086     lpTable ptab,
01087     long rowincr,
01088     int cellincr,
01089     BOOL bToBottom,
01090     BOOL bExtend
01091 )
01092 {
01093     long row, col, ncols;
01094
01095     /* is there a selection ? */
01096     if (ptab->select.nrows == 0) {
01097
01098         /* no selection - force a selection
01099          * at the first visible unit
01100          */
01101         if (ptab->hdr.fixedselectable) {
01102             row = 0;
01103             col = 0;
01104         } else {
01105             row = gtab_linetorow(hwnd, ptab, ptab->hdr.fixedrows);
01106             /* should really check for first visible cell */
01107             col = ptab->hdr.fixedcols;
01108         }
01109         ncols = 1;
01110         if (ptab->hdr.selectmode & TM_ROW) {
01111             col = 0;
01112             ncols = ptab->hdr.ncols;
01113         }
01114         gtab_select(hwnd, ptab, row, col, 1, ncols, TRUE);
01115
01116     } else {
01117         /* move the anchor point by rowincr, cellincr */
01118         row = ptab->select.startrow + rowincr;
01119         col = ptab->select.startcell + cellincr;
01120
01121
01122         /*
01123          * ensure that new anchor point is in a valid position
01124          */
01125
01126         while (col >= ptab->hdr.ncols) {
01127             col -= ptab->hdr.ncols;
01128             row++;
01129         }
01130         while (col < 0) {
01131             col += ptab->hdr.ncols;
01132             row--;
01133         }
01134         if (row < 0) {
01135             row = 0;
01136         }
01137         if (row >= ptab->hdr.nrows) {
01138             row = ptab->hdr.nrows-1;
01139         }
01140         /* check we haven't moved into non-selectable region */
01141         if ((row < ptab->hdr.fixedrows) &&
01142             (!ptab->hdr.fixedselectable)) {
01143                     row = ptab->hdr.fixedrows;
01144         }
01145
01146         if (bExtend) {
01147             gtab_extendsel(hwnd, ptab, row, col, TRUE);
01148         } else {
01149             gtab_select(
01150                 hwnd,
01151                 ptab,
01152                 row,
01153                 col,
01154                 1,
01155                 (ptab->hdr.selectmode & TM_ROW) ? ptab->hdr.ncols : 1,
01156                 TRUE);
01157         }
01158     }
01159
01160     /* ensure selection visible */
01161     gtab_showsel(hwnd, ptab, bToBottom);
01162 }
01163
01164 /*
01165  * set the topmost selectable unit in window as the selection
01166  *
01167  * if bExtend is TRUE, then extend the selection to include this, rather
01168  * than replacing the existing selection. Note that (startrow, startcell)
01169  * is always the anchor point - ie most recently selected end, and the
01170  * (nrows, ncells) can be + or - to extend the selection downwards or upwards.
01171  */
01172 void
01173 gtab_selhome(HWND hwnd, lpTable ptab, BOOL bExtend)
01174 {
01175     long startrow, startcell, ncells;
01176
01177     if (ptab->hdr.selectmode & TM_ROW) {
01178         ncells = ptab->hdr.ncols;
01179     } else {
01180         ncells = 1;
01181     }
01182     startcell = 0;
01183
01184
01185     if (ptab->hdr.fixedselectable) {
01186         startrow = gtab_linetorow(hwnd, ptab, 0);
01187     } else {
01188         startrow = gtab_linetorow(hwnd, ptab, ptab->hdr.fixedrows);
01189         if (!(ptab->hdr.selectmode & TM_ROW)) {
01190             startcell = ptab->hdr.fixedcols;
01191         }
01192     }
01193
01194     if (bExtend) {
01195         gtab_extendsel(hwnd, ptab, startrow, startcell, TRUE);
01196     } else {
01197         gtab_select(hwnd, ptab, startrow, startcell, 1, ncells, TRUE);
01198     }
01199 }
01200
01201
01202 /* handle key-down events - scroll windows and/or move selection */
01203 int
01204 gtab_key(HWND hwnd, lpTable ptab, int vkey)
01205 {
01206     long startrow, ncells, startcell;
01207     BOOL bControl = FALSE;
01208     BOOL bShift = FALSE;
01209
01210     if (GetKeyState(VK_CONTROL) & 0x8000) {
01211         bControl = TRUE;
01212     }
01213     if (GetKeyState(VK_SHIFT) & 0x8000) {
01214         /* ignore shift key here if TM_MANY -multiple selection flag- is
01215          * not selected
01216          */
01217         if (ptab->hdr.selectmode & TM_MANY) {
01218             bShift = TRUE;
01219         }
01220     }
01221
01222     switch(vkey) {
01223
01224     case VK_UP:
01225         if (bControl) {
01226             /* control-uparrow scrolls window without selection.
01227              * the selection is de-selected (to avoid surprises
01228              * moving back to it).
01229              */
01230             gtab_select(hwnd, ptab, 0, 0, 0, 0, TRUE);
01231             gtab_dovscroll(hwnd, ptab, -1);
01232         } else {
01233             /* uparrow moves selection up one line */
01234             gtab_changesel(hwnd, ptab, -1, 0, FALSE, bShift);
01235         }
01236         return(0);
01237
01238     case VK_DOWN:
01239         if (bControl) {
01240             /* control downarrow scrolls window without
01241              * a selection.
01242              */
01243             gtab_select(hwnd, ptab, 0, 0, 0, 0, TRUE);
01244             gtab_dovscroll(hwnd, ptab, 1);
01245         } else {
01246             /* the normal gtab_changesel behaviour is
01247              * that if the selected line is not visible now,
01248              * we scroll it to the top of the window. This is fine
01249              * in most cases but causes unacceptable jumps when
01250              * repeatedly scrolling down with the down key.
01251              *
01252              * Thus we now have an argument to changesel to say
01253              * that in this case, if you need to move the line onto
01254              * the window, move it to the bottom and not the top
01255              */
01256             gtab_changesel(hwnd, ptab, 1, 0, TRUE, bShift);
01257         }
01258         return(0);
01259
01260     case VK_LEFT:
01261         /* if cell-selection mode, move left one cell.
01262          * otherwise the whole row is selected - scroll
01263          * the line left a little
01264          */
01265
01266         if (ptab->hdr.selectmode & TM_ROW) {
01267             if (bControl) {
01268                 /* ctrl-left moves to start of line */
01269                 gtab_dohscroll(hwnd, ptab, -(ptab->scroll_dx));
01270             } else {
01271                 gtab_dohscroll(hwnd, ptab, -(ptab->avewidth));
01272             }
01273         } else {
01274             gtab_changesel(hwnd, ptab, 0, -1, FALSE, bShift);
01275         }
01276         return(0);
01277
01278     case VK_RIGHT:
01279         /* if cell-selection mode, move right one cell.
01280          * otherwise the whole row is selected - scroll
01281          * the line right a little
01282          */
01283         if (ptab->hdr.selectmode & TM_ROW) {
01284             if (bControl) {
01285                 /* control-right moves to right end of line */
01286                 gtab_dohscroll(hwnd, ptab, ptab->rowwidth -
01287                                 ptab->winwidth);
01288             } else {
01289                 gtab_dohscroll(hwnd, ptab, ptab->avewidth);
01290             }
01291         } else {
01292             gtab_changesel(hwnd, ptab, 0, 1, TRUE, bShift);
01293         }
01294         return(0);
01295
01296     case VK_HOME:
01297         if (bControl) {
01298             /* control-home == top of file */
01299             gtab_dovscroll(hwnd, ptab, -(ptab->toprow));
01300         }
01301         /* top of window */
01302         gtab_selhome(hwnd, ptab, bShift);
01303         gtab_showsel(hwnd, ptab, FALSE);
01304
01305         return(0);
01306
01307     case VK_END:
01308         if (bControl) {
01309             /* control-end -> end of file */
01310             startrow = ptab->hdr.nrows-1;
01311         } else {
01312             startrow = gtab_linetorow(hwnd, ptab, ptab->nlines - 1);
01313             if (startrow >= ptab->hdr.nrows) {
01314                 startrow = ptab->hdr.nrows-1;
01315             }
01316         }
01317
01318         startcell = 0;
01319         ncells = ptab->hdr.ncols;
01320         if (!(ptab->hdr.selectmode & TM_ROW)) {
01321             startcell = ptab->hdr.ncols-1;
01322             ncells = 1;
01323         }
01324
01325         if (bShift) {
01326             gtab_extendsel(hwnd, ptab, startrow, startcell, TRUE);
01327         } else {
01328             gtab_select(hwnd, ptab, startrow, startcell, 1, ncells, TRUE);
01329         }
01330
01331         /* we have selected the bottom line. We don't want to
01332          * move it up into the window, since the intended
01333          * effect is to select the lowest line. This doesn't
01334          * apply to the ctrl-end behaviour (move to bottom of
01335          * buffer.
01336          */
01337         if (bControl) {
01338             /* move the selection to make it visible - but move it
01339              * to the bottom and not to the top of the window
01340              */
01341             gtab_showsel(hwnd, ptab, TRUE);
01342         }
01343         return(0);
01344
01345     case VK_RETURN:
01346         if (ptab->select.nrows != 0) {
01347             gtab_showsel(hwnd, ptab, FALSE);
01348             gtab_enter(hwnd, ptab, ptab->select.startrow,
01349                     ptab->select.startcell,
01350                     ptab->select.nrows, ptab->select.ncells);
01351         }
01352         return(0);
01353
01354     case VK_SPACE:
01355         /* toggle the selection */
01356         if (ptab->select.nrows == 0) {
01357                 /* no selection - make one */
01358                 gtab_changesel(hwnd, ptab, 0, 0, TRUE, FALSE);
01359         } else {
01360                 /* there is a selection - deselect it */
01361                 gtab_select(hwnd, ptab, 0, 0, 0, 0, TRUE);
01362         }
01363         return(0);
01364
01365     case VK_PRIOR:          /* page up */
01366
01367         if (ptab->nlines > 3) {
01368             gtab_dovscroll(hwnd, ptab, -(ptab->nlines - 3));
01369         }
01370         gtab_selhome(hwnd, ptab, bShift);
01371         return(0);
01372
01373     case VK_NEXT:           /* page down */
01374
01375         /* scroll down one page */
01376         if (ptab->nlines > 3) {
01377             gtab_dovscroll(hwnd, ptab, (ptab->nlines - 3));
01378         }
01379
01380         /* select new bottom line */
01381         startrow = gtab_linetorow(hwnd, ptab, ptab->nlines - 1);
01382         if (startrow >= ptab->hdr.nrows) {
01383             startrow = ptab->hdr.nrows-1;
01384         }
01385         startcell = 0;
01386         ncells = ptab->hdr.ncols;
01387         if (!(ptab->hdr.selectmode & TM_ROW)) {
01388             startcell = ptab->hdr.ncols-1;
01389             ncells = 1;
01390         }
01391
01392         /* select bottom line, but don't call showsel
01393          * since we don't want to adjust it's position - we
01394          * want it to remain at the bottom of the window
01395          */
01396         if (bShift) {
01397             gtab_extendsel(hwnd, ptab, startrow, startcell, TRUE);
01398         } else {
01399             gtab_select(hwnd, ptab, startrow, startcell, 1, ncells, TRUE);
01400         }
01401         return(0);
01402
01403     default:
01404         return(1);
01405     }
01406 }
01407
01408 int gtab_mousewheel(HWND hwnd, lpTable ptab, DWORD fwKeys, int zDelta)
01409 {
01410     static ULONG uScrollLines = 0;
01411
01412     if (fwKeys & MK_MBUTTON) {
01413         return 1;
01414     }
01415
01416     if (uScrollLines == 0) {
01417         SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &uScrollLines, FALSE);
01418         if (uScrollLines == 0) {
01419             uScrollLines = 3;
01420         }
01421     }
01422
01423     zDelta /= -WHEEL_DELTA;
01424
01425     if (fwKeys & MK_CONTROL) {
01426         //
01427         // Left-Right scroll
01428         //
01429         if (ptab->hdr.selectmode & TM_ROW) {
01430             if (fwKeys & MK_SHIFT) {
01431                 zDelta = (zDelta > 0) ? ptab->rowwidth : -ptab->rowwidth;
01432             }
01433             gtab_dohscroll(hwnd, ptab, ptab->avewidth * zDelta);
01434             return 0;
01435         }
01436         return 1;
01437     }
01438
01439     if (fwKeys & MK_SHIFT) {
01440         //
01441         // Page scroll
01442         //
01443         if (ptab->nlines > 3) {
01444             zDelta *= ptab->nlines - 3;
01445         }
01446     }
01447     else {
01448         if (uScrollLines) {
01449             zDelta *= uScrollLines;
01450             zDelta = min(zDelta, ptab->nlines - 3);
01451         }
01452     }
01453
01454     gtab_dovscroll(hwnd, ptab, zDelta);
01455
01456     return 0;
01457 }
01458
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcNotify/Notify.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcNotify

Notify.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc24F.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCNotify.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcnotify;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017 import com.ms.wfc.data.*;
00018 import java.util.*;
00019
00020 /** @com.register(clsid=6DD1E6F0-28C1-11D2-B5B6-00C04FC340EE, typelib=6DD1E6DC-28C1-11D2-B5B6-00C04FC340EE, version="1.0", description="Notify Class")*/
00021 public class Notify implements IUnknown,com.ms.com.NoAutoScripting,qcnotify.INotifyDefault
00022 {
00023   private int   customerID    = 0;
00024   private int   orderID     = 0;
00025   private Vector  itemVect    = null;
00026   private Vector  quantityVect  = null;
00027   private Vector  shipStatusVect  = null;
00028
00029   public Notify()
00030   {
00031     itemVect    = new Vector();
00032     quantityVect  = new Vector();
00033     shipStatusVect  = new Vector();
00034   }
00035
00036   /**
00037      * property put for CustomerId property
00038      *
00039      * @param       customerID        A customer identifier
00040      * @return      ---
00041      *
00042      **/
00043   public void setCustomerId(int customerID)
00044   {
00045     this.customerID = customerID;
00046   }
00047
00048   /**
00049      * property put for OrderId property
00050      *
00051      * @param       orderID        An order identifier
00052      * @return      ---
00053      *
00054      **/
00055   public void setOrderId(int orderID)
00056   {
00057     this.orderID = orderID;
00058   }
00059
00060   /**
00061      * Adds a single item to an order
00062      *
00063      * @param       itemID        An item identifier
00064      * @param   quantity    Quantity of the item ordered
00065      * @param   shipStatus    Shipping status value.
00066      * @return      ---
00067      *
00068      **/
00069   public void LineItem(int itemID, int quantity, int shipStatus)
00070   {
00071     if((itemVect != null) && (quantityVect != null) &&(shipStatusVect != null))
00072     {
00073       itemVect.addElement(new Integer(itemID));
00074       quantityVect.addElement(new Integer(quantity));
00075       shipStatusVect.addElement(new Integer(shipStatus));
00076     }
00077   }
00078
00079   /**
00080      * Updates order entry database with shipping status strings.
00081      *
00082      * @param       lFlags        option flags
00083      * @return      ---
00084      *
00085      **/
00086   public void Process(int lFlags)
00087   {
00088     boolean dataInsertFlag    = false;
00089
00090     dataInsertFlag  = WriteDB();
00091     com.ms.mtx.IObjectContext ctxObj = com.ms.mtx.Context.getObjectContext();
00092     if(ctxObj != null)
00093      {
00094       if(dataInsertFlag)
00095       {
00096         ctxObj.SetComplete();
00097       }
00098       else
00099       {
00100         ctxObj.SetAbort();
00101       }
00102      }
00103   }
00104
00105   /**
00106      * Updates order entry database with shipping status strings.
00107      *
00108      * @param       ---
00109      * @return      boolean     True if successful else return false
00110      * @see     com.ms.wfc.data.Connection
00111      **/
00112   private boolean WriteDB()
00113   {
00114     int     result    = 0;
00115     Connection  con     = null;
00116     String    conDetail = null;
00117     boolean   returnValue = false;
00118     conDetail = "Data Source=" + helper.DatabaseSettings.DSN + ";" + "User Id=" + helper.DatabaseSettings.User + ";" + "Password=" + helper.DatabaseSettings.Pass + ";";
00119     con     = new Connection();
00120     con.open(conDetail);
00121     for(int index = 0;index < itemVect.size(); index++)
00122     {
00123       StringBuffer sql = new StringBuffer("");
00124       sql.append("Update QCSampleOrder set ship_status = '");
00125       sql.append(getShipStatusString((Integer)shipStatusVect.elementAt(index)));
00126       sql.append("' ");
00127       sql.append("Where (cust_id = ");
00128       sql.append(String.valueOf(customerID) + ") And");
00129       sql.append("( order_id = ");
00130       sql.append(String.valueOf(orderID) + ") And");
00131       sql.append("( line_no = ");
00132       sql.append(String.valueOf(index) + ") And");
00133       sql.append("( item_id = ");
00134       sql.append(((Integer)(itemVect.elementAt(index))).toString() + ") And");
00135       sql.append("( quantity = ");
00136       sql.append(((Integer)(quantityVect.elementAt(index))).toString() + ")");
00137       result  = con.executeUpdate(sql.toString());
00138       if(result > 0)
00139       {
00140         returnValue = true;
00141       }
00142       else
00143       {
00144         returnValue = false;
00145         break;
00146       }
00147       System.out.println(result);
00148     }
00149     con.close();
00150     return returnValue;
00151
00152   }
00153
00154   /**
00155      * Determines shipping status string based on shipping status value
00156      *
00157      * @param       ---
00158      * @return      String      Shipping status string
00159      **/
00160   private String getShipStatusString(Integer statusVal)
00161   {
00162     String  result  = null;
00163     int   value = statusVal.intValue();
00164
00165     switch(value)
00166     {
00167       case _ShipStatus.ssShipped :
00168       {
00169         result = "ssShipped";
00170         break;
00171       }
00172       case _ShipStatus.ssBackOrdered :
00173       {
00174         result = "ssBackOrdered";
00175         break;
00176       }
00177       case _ShipStatus.ssNotStocked :
00178       {
00179         result = "ssNotStocked";
00180         break;
00181       }
00182       default :
00183       {
00184         result = "ssUnrecognizedItem";
00185       }
00186     }
00187     return result;
00188   }
00189
00190 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/RPCsvc/Service.C Source File

  • NetDS
  • RPC
  • RPCsvc

Service.C

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   service.c
00009 //
00010 //  PURPOSE:  Implements functions required by all services
00011 //            windows.
00012 //
00013 //  FUNCTIONS:
00014 //    main(int argc, char **argv);
00015 //    service_ctrl(DWORD dwCtrlCode);
00016 //    service_main(DWORD dwArgc, LPTSTR *lpszArgv);
00017 //    CmdInstallService();
00018 //    CmdRemoveService();
00019 //    CmdDebugService(int argc, char **argv);
00020 //    ControlHandler ( DWORD dwCtrlType );
00021 //    GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
00022 //
00023 //  COMMENTS:
00024 //
00025 //  AUTHOR: Craig Link - Microsoft Developer Support
00026 //
00027
00028
00029 #include <windows.h>
00030 #include <stdio.h>
00031 #include <stdlib.h>
00032 #include <process.h>
00033 #include <tchar.h>
00034
00035 #include "service.h"
00036
00037
00038
00039 // internal variables
00040 SERVICE_STATUS          ssStatus;       // current status of the service
00041 SERVICE_STATUS_HANDLE   sshStatusHandle;
00042 DWORD                   dwErr = 0;
00043 BOOL                    bDebug = FALSE;
00044 TCHAR                   szErr[256];
00045
00046 // internal function prototypes
00047 VOID WINAPI service_ctrl(DWORD dwCtrlCode);
00048 VOID WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv);
00049 VOID CmdInstallService();
00050 VOID CmdRemoveService();
00051 VOID CmdDebugService(int argc, char **argv);
00052 BOOL WINAPI ControlHandler ( DWORD dwCtrlType );
00053 LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
00054
00055 //
00056 //  FUNCTION: main
00057 //
00058 //  PURPOSE: entrypoint for service
00059 //
00060 //  PARAMETERS:
00061 //    argc - number of command line arguments
00062 //    argv - array of command line arguments
00063 //
00064 //  RETURN VALUE:
00065 //    none
00066 //
00067 //  COMMENTS:
00068 //    main() either performs the command line task, or
00069 //    call StartServiceCtrlDispatcher to register the
00070 //    main service thread.  When the this call returns,
00071 //    the service has stopped, so exit.
00072 //
00073 void main(int argc, char **argv)
00074 {
00075     SERVICE_TABLE_ENTRY dispatchTable[] =
00076     {
00077         { TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main },
00078         { NULL, NULL }
00079     };
00080
00081     if ( (argc > 1) &&
00082          ((*argv[1] == '-') || (*argv[1] == '/')) )
00083     {
00084         if ( _stricmp( "install", argv[1]+1 ) == 0 )
00085         {
00086             CmdInstallService();
00087         }
00088         else if ( _stricmp( "remove", argv[1]+1 ) == 0 )
00089         {
00090             CmdRemoveService();
00091         }
00092         else if ( _stricmp( "debug", argv[1]+1 ) == 0 )
00093         {
00094             bDebug = TRUE;
00095             CmdDebugService(argc, argv);
00096         }
00097         else
00098         {
00099             goto dispatch;
00100         }
00101         exit(0);
00102     }
00103
00104     // if it doesn't match any of the above parameters
00105     // the service control manager may be starting the service
00106     // so we must call StartServiceCtrlDispatcher
00107     dispatch:
00108         // this is just to be friendly
00109         printf( "%s -install          to install the service\n", SZAPPNAME );
00110         printf( "%s -remove           to remove the service\n", SZAPPNAME );
00111         printf( "%s -debug <params>   to run as a console app for debugging\n", SZAPPNAME );
00112         printf( "\nStartServiceCtrlDispatcher being called.\n" );
00113         printf( "This may take several seconds.  Please wait.\n" );
00114
00115         if (!StartServiceCtrlDispatcher(dispatchTable))
00116             AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
00117 }
00118
00119
00120
00121 //
00122 //  FUNCTION: service_main
00123 //
00124 //  PURPOSE: To perform actual initialization of the service
00125 //
00126 //  PARAMETERS:
00127 //    dwArgc   - number of command line arguments
00128 //    lpszArgv - array of command line arguments
00129 //
00130 //  RETURN VALUE:
00131 //    none
00132 //
00133 //  COMMENTS:
00134 //    This routine performs the service initialization and then calls
00135 //    the user defined ServiceStart() routine to perform majority
00136 //    of the work.
00137 //
00138 void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
00139 {
00140
00141     // register our service control handler:
00142     //
00143     sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SZSERVICENAME), service_ctrl);
00144
00145     if (!sshStatusHandle)
00146         goto cleanup;
00147
00148     // SERVICE_STATUS members that don't change in example
00149     //
00150     ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
00151     ssStatus.dwServiceSpecificExitCode = 0;
00152
00153
00154     // report the status to the service control manager.
00155     //
00156     if (!ReportStatusToSCMgr(
00157         SERVICE_START_PENDING, // service state
00158         NO_ERROR,              // exit code
00159         3000))                 // wait hint
00160         goto cleanup;
00161
00162
00163     ServiceStart( dwArgc, lpszArgv );
00164
00165 cleanup:
00166
00167     // try to report the stopped status to the service control manager.
00168     //
00169     if (sshStatusHandle)
00170         (VOID)ReportStatusToSCMgr(
00171                             SERVICE_STOPPED,
00172                             dwErr,
00173                             0);
00174
00175     return;
00176 }
00177
00178
00179
00180 //
00181 //  FUNCTION: service_ctrl
00182 //
00183 //  PURPOSE: This function is called by the SCM whenever
00184 //           ControlService() is called on this service.
00185 //
00186 //  PARAMETERS:
00187 //    dwCtrlCode - type of control requested
00188 //
00189 //  RETURN VALUE:
00190 //    none
00191 //
00192 //  COMMENTS:
00193 //
00194 VOID WINAPI service_ctrl(DWORD dwCtrlCode)
00195 {
00196     // Handle the requested control code.
00197     //
00198     switch(dwCtrlCode)
00199     {
00200         // Stop the service.
00201         //
00202         case SERVICE_CONTROL_STOP:
00203             ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 0);
00204             ServiceStop();
00205             return;
00206
00207         // Update the service status.
00208         //
00209         case SERVICE_CONTROL_INTERROGATE:
00210             break;
00211
00212         // invalid control code
00213         //
00214         default:
00215             break;
00216
00217     }
00218
00219     ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0);
00220
00221 }
00222
00223
00224
00225 //
00226 //  FUNCTION: ReportStatusToSCMgr()
00227 //
00228 //  PURPOSE: Sets the current status of the service and
00229 //           reports it to the Service Control Manager
00230 //
00231 //  PARAMETERS:
00232 //    dwCurrentState - the state of the service
00233 //    dwWin32ExitCode - error code to report
00234 //    dwWaitHint - worst case estimate to next checkpoint
00235 //
00236 //  RETURN VALUE:
00237 //    TRUE  - success
00238 //    FALSE - failure
00239 //
00240 //  COMMENTS:
00241 //
00242 BOOL ReportStatusToSCMgr(DWORD dwCurrentState,
00243                          DWORD dwWin32ExitCode,
00244                          DWORD dwWaitHint)
00245 {
00246     static DWORD dwCheckPoint = 1;
00247     BOOL fResult = TRUE;
00248
00249
00250     if ( !bDebug ) // when debugging we don't report to the SCM
00251     {
00252         if (dwCurrentState == SERVICE_START_PENDING)
00253             ssStatus.dwControlsAccepted = 0;
00254         else
00255             ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
00256
00257         ssStatus.dwCurrentState = dwCurrentState;
00258         ssStatus.dwWin32ExitCode = dwWin32ExitCode;
00259         ssStatus.dwWaitHint = dwWaitHint;
00260
00261         if ( ( dwCurrentState == SERVICE_RUNNING ) ||
00262              ( dwCurrentState == SERVICE_STOPPED ) )
00263             ssStatus.dwCheckPoint = 0;
00264         else
00265             ssStatus.dwCheckPoint = dwCheckPoint++;
00266
00267
00268         // Report the status of the service to the service control manager.
00269         //
00270         if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus))) {
00271             AddToMessageLog(TEXT("SetServiceStatus"));
00272         }
00273     }
00274     return fResult;
00275 }
00276
00277
00278
00279 //
00280 //  FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
00281 //
00282 //  PURPOSE: Allows any thread to log an error message
00283 //
00284 //  PARAMETERS:
00285 //    lpszMsg - text for message
00286 //
00287 //  RETURN VALUE:
00288 //    none
00289 //
00290 //  COMMENTS:
00291 //
00292 VOID AddToMessageLog(LPTSTR lpszMsg)
00293 {
00294     TCHAR   szMsg[256];
00295     HANDLE  hEventSource;
00296     LPTSTR  lpszStrings[2];
00297
00298
00299     if ( !bDebug )
00300     {
00301         dwErr = GetLastError();
00302
00303         // Use event logging to log the error.
00304         //
00305         hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
00306
00307         _stprintf(szMsg, TEXT("%s error: %d"), TEXT(SZSERVICENAME), dwErr);
00308         lpszStrings[0] = szMsg;
00309         lpszStrings[1] = lpszMsg;
00310
00311         if (hEventSource != NULL) {
00312             ReportEvent(hEventSource, // handle of event source
00313                 EVENTLOG_ERROR_TYPE,  // event type
00314                 0,                    // event category
00315                 0,                    // event ID
00316                 NULL,                 // current user's SID
00317                 2,                    // strings in lpszStrings
00318                 0,                    // no bytes of raw data
00319                 lpszStrings,          // array of error strings
00320                 NULL);                // no raw data
00321
00322             (VOID) DeregisterEventSource(hEventSource);
00323         }
00324     }
00325 }
00326
00327
00328
00329
00330 ///////////////////////////////////////////////////////////////////
00331 //
00332 //  The following code handles service installation and removal
00333 //
00334
00335
00336 //
00337 //  FUNCTION: CmdInstallService()
00338 //
00339 //  PURPOSE: Installs the service
00340 //
00341 //  PARAMETERS:
00342 //    none
00343 //
00344 //  RETURN VALUE:
00345 //    none
00346 //
00347 //  COMMENTS:
00348 //
00349 void CmdInstallService()
00350 {
00351     SC_HANDLE   schService;
00352     SC_HANDLE   schSCManager;
00353
00354     TCHAR szPath[512];
00355
00356     if ( GetModuleFileName( NULL, szPath, 512 ) == 0 )
00357     {
00358         _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(SZSERVICEDISPLAYNAME), GetLastErrorText(szErr, 256));
00359         return;
00360     }
00361
00362     schSCManager = OpenSCManager(
00363                         NULL,                   // machine (NULL == local)
00364                         NULL,                   // database (NULL == default)
00365                         SC_MANAGER_ALL_ACCESS   // access required
00366                         );
00367     if ( schSCManager )
00368     {
00369         schService = CreateService(
00370             schSCManager,               // SCManager database
00371             TEXT(SZSERVICENAME),        // name of service
00372             TEXT(SZSERVICEDISPLAYNAME), // name to display
00373             SERVICE_ALL_ACCESS,         // desired access
00374             SERVICE_WIN32_OWN_PROCESS,  // service type
00375             SERVICE_DEMAND_START,       // start type
00376             SERVICE_ERROR_NORMAL,       // error control type
00377             szPath,                     // service's binary
00378             NULL,                       // no load ordering group
00379             NULL,                       // no tag identifier
00380             TEXT(SZDEPENDENCIES),       // dependencies
00381             NULL,                       // LocalSystem account
00382             NULL);                      // no password
00383
00384         if ( schService )
00385         {
00386             _tprintf(TEXT("%s installed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
00387             CloseServiceHandle(schService);
00388         }
00389         else
00390         {
00391             _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(szErr, 256));
00392         }
00393
00394         CloseServiceHandle(schSCManager);
00395     }
00396     else
00397         _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
00398 }
00399
00400
00401
00402 //
00403 //  FUNCTION: CmdRemoveService()
00404 //
00405 //  PURPOSE: Stops and removes the service
00406 //
00407 //  PARAMETERS:
00408 //    none
00409 //
00410 //  RETURN VALUE:
00411 //    none
00412 //
00413 //  COMMENTS:
00414 //
00415 void CmdRemoveService()
00416 {
00417     SC_HANDLE   schService;
00418     SC_HANDLE   schSCManager;
00419
00420     schSCManager = OpenSCManager(
00421                         NULL,                   // machine (NULL == local)
00422                         NULL,                   // database (NULL == default)
00423                         SC_MANAGER_ALL_ACCESS   // access required
00424                         );
00425     if ( schSCManager )
00426     {
00427         schService = OpenService(schSCManager, TEXT(SZSERVICENAME), SERVICE_ALL_ACCESS);
00428
00429         if (schService)
00430         {
00431             // try to stop the service
00432             if ( ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus ) )
00433             {
00434                 _tprintf(TEXT("Stopping %s."), TEXT(SZSERVICEDISPLAYNAME));
00435                 Sleep( 1000 );
00436
00437                 while( QueryServiceStatus( schService, &ssStatus ) )
00438                 {
00439                     if ( ssStatus.dwCurrentState == SERVICE_STOP_PENDING )
00440                     {
00441                         _tprintf(TEXT("."));
00442                         Sleep( 1000 );
00443                     }
00444                     else
00445                         break;
00446                 }
00447
00448                 if ( ssStatus.dwCurrentState == SERVICE_STOPPED )
00449                     _tprintf(TEXT("\n%s stopped.\n"), TEXT(SZSERVICEDISPLAYNAME) );
00450                 else
00451                     _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(SZSERVICEDISPLAYNAME) );
00452
00453             }
00454
00455             // now remove the service
00456             if( DeleteService(schService) )
00457                 _tprintf(TEXT("%s removed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
00458             else
00459                 _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(szErr,256));
00460
00461
00462             CloseServiceHandle(schService);
00463         }
00464         else
00465             _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));
00466
00467         CloseServiceHandle(schSCManager);
00468     }
00469     else
00470         _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
00471 }
00472
00473
00474
00475
00476 ///////////////////////////////////////////////////////////////////
00477 //
00478 //  The following code is for running the service as a console app
00479 //
00480
00481
00482 //
00483 //  FUNCTION: CmdDebugService(int argc, char ** argv)
00484 //
00485 //  PURPOSE: Runs the service as a console application
00486 //
00487 //  PARAMETERS:
00488 //    argc - number of command line arguments
00489 //    argv - array of command line arguments
00490 //
00491 //  RETURN VALUE:
00492 //    none
00493 //
00494 //  COMMENTS:
00495 //
00496 void CmdDebugService(int argc, char ** argv)
00497 {
00498     DWORD dwArgc;
00499     LPTSTR *lpszArgv;
00500
00501 #ifdef UNICODE
00502     lpszArgv = CommandLineToArgvW(GetCommandLineW(), &(dwArgc) );
00503 #else
00504     dwArgc   = (DWORD) argc;
00505     lpszArgv = argv;
00506 #endif
00507
00508     _tprintf(TEXT("Debugging %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
00509
00510     SetConsoleCtrlHandler( ControlHandler, TRUE );
00511
00512     ServiceStart( dwArgc, lpszArgv );
00513 }
00514
00515
00516 //
00517 //  FUNCTION: ControlHandler ( DWORD dwCtrlType )
00518 //
00519 //  PURPOSE: Handled console control events
00520 //
00521 //  PARAMETERS:
00522 //    dwCtrlType - type of control event
00523 //
00524 //  RETURN VALUE:
00525 //    True - handled
00526 //    False - unhandled
00527 //
00528 //  COMMENTS:
00529 //
00530 BOOL WINAPI ControlHandler ( DWORD dwCtrlType )
00531 {
00532     switch( dwCtrlType )
00533     {
00534         case CTRL_BREAK_EVENT:  // use Ctrl+C or Ctrl+Break to simulate
00535         case CTRL_C_EVENT:      // SERVICE_CONTROL_STOP in debug mode
00536             _tprintf(TEXT("Stopping %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
00537             ServiceStop();
00538             return TRUE;
00539             break;
00540
00541     }
00542     return FALSE;
00543 }
00544
00545 //
00546 //  FUNCTION: GetLastErrorText
00547 //
00548 //  PURPOSE: copies error message text to string
00549 //
00550 //  PARAMETERS:
00551 //    lpszBuf - destination buffer
00552 //    dwSize - size of buffer
00553 //
00554 //  RETURN VALUE:
00555 //    destination buffer
00556 //
00557 //  COMMENTS:
00558 //
00559 LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize )
00560 {
00561     DWORD dwRet;
00562     LPTSTR lpszTemp = NULL;
00563
00564     dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
00565                            NULL,
00566                            GetLastError(),
00567                            LANG_NEUTRAL,
00568                            (LPTSTR)&lpszTemp,
00569                            0,
00570                            NULL );
00571
00572     // supplied buffer is not long enough
00573     if ( !dwRet || ( (long)dwSize < (long)dwRet+14 ) )
00574         lpszBuf[0] = TEXT('\0');
00575     else
00576     {
00577         lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0');  //remove cr and newline character
00578         _stprintf( lpszBuf, TEXT("%s (0x%x)"), lpszTemp, GetLastError() );
00579     }
00580
00581     if ( lpszTemp )
00582         LocalFree((HLOCAL) lpszTemp );
00583
00584     return lpszBuf;
00585 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

THREADINFO Member List

This is the complete list of members for THREADINFO, including all inherited members.
hThread | THREADINFO
sd | THREADINFO
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/prsample/prsample.h Source File

  • Dataaccess
  • oledb
  • prsample

prsample.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 // Microsoft OLE DB Programmer's Reference Sample
00003 // Copyright (C) 1998 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module PRSAMPLE.H
00008 //
00009 //---------------------------------------------------------------------------
00010
00011
00012 /////////////////////////////////////////////////////////////////
00013 // Includes
00014 //
00015 /////////////////////////////////////////////////////////////////
00016 #ifndef __PRSAMPLE_H__
00017 #define __PRSAMPLE_H__
00018
00019 #include "oledb.h"      // OLE DB Header
00020 #include "oledberr.h"   // OLE DB Errors
00021
00022 #include "msdasc.h"     // OLE DB Service Component header
00023 #include "msdaguid.h"   // OLE DB Root Enumerator
00024 #include "msdasql.h"    // MSDASQL - Default provider
00025
00026 #include <stdio.h>      // input and output functions
00027 #include <conio.h>      // getch, putch
00028 #include <locale.h>     // setlocale
00029
00030 /////////////////////////////////////////////////////////////////
00031 // Globals
00032 //
00033 /////////////////////////////////////////////////////////////////
00034 extern DWORD g_dwFlags;
00035
00036
00037 /////////////////////////////////////////////////////////////////
00038 // Defines
00039 //
00040 /////////////////////////////////////////////////////////////////
00041 #define __LONGSTRING(string) L##string
00042 #define LONGSTRING(string) __LONGSTRING(string)
00043
00044 //Goes to CLEANUP on Failure
00045 #define CHECK_HR(hr)      \
00046   if(FAILED(hr))        \
00047     goto CLEANUP
00048
00049 //Goes to CLEANUP on Failure, and displays any ErrorInfo
00050 #define XCHECK_HR(hr)                       \
00051 {                                 \
00052   if( g_dwFlags & DISPLAY_METHODCALLS )             \
00053     fwprintf(stderr, LONGSTRING(#hr) L"\n");          \
00054   if(FAILED(myHandleResult(hr, LONGSTRING(__FILE__), __LINE__)))  \
00055     goto CLEANUP;                       \
00056 }
00057 #define CHECK_MEMORY(hr, pv)  \
00058 {               \
00059   if(!pv)           \
00060   {             \
00061     hr = E_OUTOFMEMORY;   \
00062     CHECK_HR(hr);     \
00063   }             \
00064 }
00065
00066
00067 #define MAX_COL_SIZE        5000
00068 #define MAX_NAME_LEN        256
00069
00070 #define MAX_ROWS        10
00071 #define MAX_DISPLAY_SIZE    20
00072 #define MIN_DISPLAY_SIZE     3
00073
00074 //ROUNDUP on all platforms pointers must be aligned properly
00075 #define ROUNDUP_AMOUNT  8
00076 #define ROUNDUP_(size,amount) (((ULONG)(size)+((amount)-1))&~((amount)-1))
00077 #define ROUNDUP(size)     ROUNDUP_(size, ROUNDUP_AMOUNT)
00078
00079 enum
00080 {
00081   //Connecting
00082   USE_PROMPTDATASOURCE    = 0x0001,
00083   USE_ENUMERATOR        = 0x0002,
00084
00085   //Rowset
00086   USE_COMMAND         = 0x0010,
00087
00088   //Storage Objects
00089   USE_ISEQSTREAM        = 0x0100,
00090
00091   // Display options
00092   DISPLAY_METHODCALLS     = 0x1000,
00093   DISPLAY_INSTRUCTIONS    = 0x2000,
00094 };
00095
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // Function Prototypes
00099 //
00100 /////////////////////////////////////////////////////////////////////////////
00101 //Main
00102 BOOL  myParseCommandLine();
00103 void  myDisplayInstructions();
00104 BOOL  myGetInputFromUser(LPWSTR pwszInput, LPCWSTR pwszFmt, ...);
00105 CHAR  myGetChar();
00106
00107 //Enumerator
00108 HRESULT myCreateEnumerator(REFCLSID clsidEnumerator, CLSID* pCLSID);
00109
00110 //DataSource
00111 HRESULT myCreateDataSource(IUnknown** ppUnkDataSource);
00112 HRESULT myDoInitialization(IUnknown* pIUnknown);
00113 HRESULT myGetProperty(IUnknown* pIUnknown, REFIID riid, DBPROPID dwPropertyID, REFGUID guidPropertySet, BOOL* pbValue);
00114 void  myAddProperty(DBPROP* pProp, DBPROPID dwPropertyID, VARTYPE vtType = VT_BOOL, LONG lValue = VARIANT_TRUE, DBPROPOPTIONS dwOptions = DBPROPOPTIONS_OPTIONAL);
00115
00116 //Session
00117 HRESULT myCreateSession(IUnknown* pUnkDataSource, IUnknown** ppUnkSession);
00118 HRESULT myCreateSchemaRowset(GUID guidSchema, IUnknown* pUnkSession, ULONG cchBuffer, LPWSTR pwszBuffer);
00119
00120 //Command
00121 HRESULT myCreateCommand(IUnknown* pUnkSession, IUnknown** ppUnkCommand);
00122 HRESULT myExecuteCommand(IUnknown* pUnkCommand, WCHAR* pwszCommandText, ULONG cPropSets, DBPROPSET* rgPropSets, IUnknown** ppUnkRowset);
00123
00124 //Rowset
00125 HRESULT myCreateRowset(IUnknown* pUnkSession, IUnknown** ppUnkRowset);
00126 HRESULT mySetupBindings(IUnknown* pUnkRowset, ULONG* pcBindings, DBBINDING** prgBindings, ULONG* pcbRowSize);
00127 HRESULT myCreateAccessor(IUnknown* pUnkRowset, HACCESSOR* phAccessor, ULONG* pcBindings, DBBINDING** prgBindings, ULONG* pcbRowSize);
00128
00129 HRESULT myDisplayRowset(IUnknown* pUnkRowset, LPCWSTR pwszColToReturn, ULONG cchBuffer, LPWSTR pwszBuffer);
00130 HRESULT myDisplayColumnNames(IUnknown* pUnkRowset, ULONG* rgDispSize);
00131 HRESULT myDisplayRow(ULONG iRow, ULONG cBindings, DBBINDING* rgBindings, void* pData, ULONG * rgDispSize);
00132
00133 HRESULT myInteractWithRowset(IRowset* pIRowset, LONG* pcRows, ULONG cRowsObtained, BOOL fCanFetchBackwards, void* pData, ULONG cbRowSize, DBBINDING* pBinding, ULONG cchBuffer, LPWSTR pwszBuffer);
00134 HRESULT myFindColumn(IUnknown * pUnkRowset, LPCWSTR pwszName, LONG* plIndex);
00135 HRESULT myUpdateDisplaySize(ULONG cBindings, DBBINDING* rgBindings, void* pData, ULONG* rgDispSize);
00136 void  myFreeBindings(ULONG cBindings, DBBINDING* rgBindings);
00137 void  myAddRowsetProperties(DBPROPSET* pPropSet, ULONG cProperties, DBPROP* rgProperties);
00138
00139 //Error
00140 HRESULT myHandleResult(HRESULT hrReturned, LPCWSTR pwszFile, ULONG ulLine);
00141 HRESULT myDisplayErrorRecord(HRESULT hrReturned, ULONG iRecord, IErrorRecords* pIErrorRecords, LPCWSTR pwszFile, ULONG ulLine);
00142 HRESULT myDisplayErrorInfo(HRESULT hrReturned, IErrorInfo* pIErrorInfo, LPCWSTR pwszFile, ULONG ulLine);
00143 HRESULT myGetSqlErrorInfo(ULONG iRecord, IErrorRecords* pIErrorRecords, BSTR* pBstr, LONG* plNativeError);
00144
00145
00146 #endif  //__PRSAMPLE_H__
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/PlgBlt/PlgBlt.h Source File

  • Multimedia
  • Gdi
  • WinNT
  • PlgBlt

PlgBlt.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1992 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /* plgblt.h - header file for the PlgBlt() demonstration program. */
00013
00014
00015 /* function prototypes for the window procedures. */
00016 LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
00017 LRESULT CALLBACK DlgProc    (HWND, UINT, WPARAM, LPARAM);
00018 LRESULT CALLBACK About      (HWND, UINT, WPARAM, LPARAM);
00019
00020
00021 VOID DrawGrids (HDC, int, int);
00022 LPTSTR  GetStringRes (int);
00023
00024 /* Top dialog item IDs */
00025 #define  DID_P1X       101
00026 #define  DID_P1Y       102
00027 #define  DID_P2X       103
00028 #define  DID_P2Y       104
00029 #define  DID_P3X       105
00030 #define  DID_P3Y       106
00031 #define  DID_XSRC      110
00032 #define  DID_YSRC      111
00033 #define  DID_WIDTH     112
00034 #define  DID_HEIGHT    113
00035 #define  DID_XMASK     114
00036 #define  DID_YMASK     115
00037 #define  DID_NEWSRC    160
00038 #define  DID_NEWMASK   161
00039
00040 #define  DID_DRAW    200
00041
00042 #define IDM_COPY            300
00043 #define IDM_PASTE           301
00044 #define IDM_BOTH            302
00045 #define IDM_SPINOFF         310
00046 #define IDM_FLIPONCE        311
00047 #define IDM_SPIN5           312
00048 #define IDM_SPIN10          313
00049 #define IDM_SPIN30          314
00050 #define IDM_SPIN60          315
00051 #define IDM_SPIN90          316
00052 #define IDM_SPINTOPLEFT     317
00053 #define IDM_SPINCENTER      318
00054 #define IDM_MODE_BLACKONWHITE    320
00055 #define IDM_MODE_COLORONCOLOR    321
00056 #define IDM_MODE_WHITEONBLACK    322
00057 #define IDM_MODE_HALFTONE        323
00058 #define IDM_ABOUT           330
00059
00060 /* string table ids's */
00061 #define IDS_NTONLY        16
00062 #define IDS_WINDOWTITLE   17
00063 #define IDS_INVALID       18
00064 #define IDS_MONOCHROME    19
00065
00066
00067 /* Misc. defines for size, color, and appearance of drawing. */
00068 #define GRIDCOLOR  (COLORREF) 0x01000006
00069 #define DIALOGHEIGHT  90
00070 #define SEPARATORWIDTH 4
00071 #define MAXCHARS      32
00072 #define INC            5
00073
00074
00075
00076
00077 /* other user messages sent to the main window or the dialog */
00078 #define WM_PUTUPLPOINTS  WM_USER+20
00079 #define WM_PUTUPSRCRECT  WM_USER+21
00080 #define WM_PUTUPMASKPT   WM_USER+22
00081 #define WM_PLGBLT        WM_USER+23
00082 #define WM_SPIN          WM_USER+24
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/WinNT/RasHost/RasHost.Cpp Source File

  • NetDS
  • Ras
  • WinNT
  • RasHost

RasHost.Cpp

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  File Name
00004 //      RASHOST.CPP
00005 //
00006 //  Description
00007 //      This file contains the initialization functions for the DLL library
00008 //      and for the Security Host protocol. The NT RAS manager will call into
00009 //      our DLL when a dialing user needs to be validated.
00010 //
00011 //
00012 //
00013 // Written for Microsoft Developer Support
00014 // Copyright (c) 1995 - 2002 Microsoft Corporation. All rights reserved.
00015 //
00016 #include "RASHOST.H"
00017 #include <stdio.h>
00018 #include "Shlwapi.h" // Platform SDK wasn't including this .h file so it's part of this project
00019
00020 // Macro for counting maximum characters that will fit into a buffer
00021 #define CELEMS(x) ((sizeof(x))/(sizeof(x[0])))
00022
00023 HINSTANCE                       ghLibHandle = NULL;
00024 RASSECURITYDIALOGSENDPROC       gpfnSendProc = NULL;
00025 RASSECURITYDIALOGRECEIVEPROC    gpfnReceiveProc = NULL;
00026
00027 ///////////////////////////////////////////////////////////////////////////////
00028 //    DllMain()
00029 //
00030 //    Parameters
00031 //      { Refer to the Win32 SDK documentation for DLL entry points }
00032 //
00033 //    Purpose
00034 //      Entry point of this DLL
00035 //
00036 //    Return Value
00037 //      TRUE if the DLL should proceed with the dwReason case, FALSE otherwise.
00038 //
00039 BOOL APIENTRY DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved)
00040 {
00041     if (DLL_PROCESS_DETACH == dwReason && ghLibHandle)
00042     {
00043         FreeLibrary (ghLibHandle);
00044     }
00045     return TRUE;
00046 }
00047
00048 ///////////////////////////////////////////////////////////////////////////////
00049 //    RasSecurityDialogBegin()
00050 //
00051 //    Parameters
00052 //      hPort       Handle to the COM port where the user is logging in
00053 //                  (A RAS handle, not a standard handle)
00054 //      pSendBuf    Pointer to a buffer where we can copy stuff to be sent
00055 //                  over the wire
00056 //      SendBufSize Size of the outgoing buffer
00057 //      pRecvBuf    Pointer a buffer where stuff is received from the
00058 //                  remote client machine
00059 //      RecvBufSize Size of the incoming buffer
00060 //      RasSecurityDialogComplete   Pointer to a callback function we must
00061 //                  call after we have completed our validation, indicating
00062 //                  the RAS manager weather or not we granted access to the
00063 //                  caller.
00064 //
00065 //    Purpose
00066 //      This is the entry point for our security DLL. When the RAS manager
00067 //      receives a call from a user, after it does its user validation, it
00068 //      will call into us at this entry point to allow us to do extra
00069 //      validation.
00070 //      NOTE: It is very important that this function does not BLOCK. If
00071 //            it does, the RAS manager will be block and no other calls
00072 //            will be accepted. That is why we copy the incoming
00073 //            parameters into a private structure and then spawn a thread
00074 //            to do the actual validation work.
00075 //            The passed parameters will be valid until we call the
00076 //            ending function.
00077 //
00078 //    Return Value
00079 //      ERROR_SUCCESS is we were able to start the validation. Otherwise
00080 //      return and error from WINERROR.H or RASERROR.H
00081 //
00082 DWORD WINAPI RasSecurityDialogBegin (HPORT hPort,
00083                                      PBYTE pSendBuf,
00084                                      DWORD SendBufSize,
00085                                      PBYTE pRecvBuf,
00086                                      DWORD RecvBufSize,
00087                                      VOID  (WINAPI *RasSecurityDialogComplete)(SECURITY_MESSAGE*))
00088 {
00089     if (!pSendBuf || !pRecvBuf || !RasSecurityDialogComplete)
00090     {
00091         OutputDebugString("RasSecurityDialogBegin - ERROR_INVALID_PARAMETER\n");
00092         return ERROR_INVALID_PARAMETER;
00093     }
00094
00095     // Initialize the global pointer to the entry points in the RAS manager
00096     // DLL. I use these entry points to send and receive data to the remote
00097     // client machine. These functions will send and receive RAW buffers of
00098     // data to the other machine just before PPP-framing starts.
00099     // These functions have not been exported in any publish import library
00100     // so we must do a dynamic binding to them.
00101     if (NULL == ghLibHandle)
00102     {
00103         ghLibHandle = LoadLibrary ("RASMAN.DLL");
00104         if (NULL == ghLibHandle)
00105         {
00106             return ERROR_DLL_NOT_FOUND;
00107         }
00108     }
00109
00110     // Obtain the send and received entry points from the RAS manager DLL.
00111     if (NULL == gpfnSendProc)
00112     {
00113         gpfnSendProc = (RASSECURITYDIALOGSENDPROC)GetProcAddress (ghLibHandle, TEXT("RasSecurityDialogSend"));
00114         if (NULL == gpfnSendProc)
00115         {
00116             return ERROR_PROC_NOT_FOUND;
00117         }
00118     }
00119
00120     if (NULL == gpfnReceiveProc)
00121     {
00122         gpfnReceiveProc = (RASSECURITYDIALOGRECEIVEPROC)GetProcAddress (ghLibHandle, TEXT("RasSecurityDialogReceive"));
00123         if (NULL == gpfnReceiveProc)
00124         {
00125             return ERROR_PROC_NOT_FOUND;
00126         }
00127     }
00128
00129
00130     // Save the parameters passed and give them to the working thread
00131     // that will handle the authentication of the caller. The thread
00132     // should release this memory.
00133     // The parameters passed to use should be valid until we call the
00134     // dialog end function or until we get call in the termination
00135     // dialog entry point by the RAS system supervisor (the RAS manager)
00136     PWORK_THREAD_DATA pCallData = (PWORK_THREAD_DATA)HeapAlloc (GetProcessHeap(),
00137                                                                 HEAP_ZERO_MEMORY,
00138                                                                 sizeof(WORK_THREAD_DATA));
00139     if (NULL == pCallData)
00140     {
00141         return ERROR_OUTOFMEMORY;
00142     }
00143
00144     // Initialize the members.
00145     pCallData->hPort = hPort;
00146     pCallData->pSendBuf = pSendBuf;
00147     pCallData->SendBufSize = SendBufSize;
00148     pCallData->pRecvBuf = pRecvBuf;
00149     pCallData->RecvBufSize = RecvBufSize;
00150     pCallData->pfnSecurityDialogEnd = RasSecurityDialogComplete;
00151
00152     // For each call, spawn a working thread that will make the neccesary
00153     // authentication of the dial-up caller. We should never block the call
00154     // to RasSecurityDialogBegin(). If we do so, RAS will also block and no
00155     // more call would be accepted.
00156     DWORD dwThreadID = 0;
00157     HANDLE hThread = CreateThread (NULL,
00158                                    0,
00159                                    (LPTHREAD_START_ROUTINE)CallWorkerThread,
00160                                    (LPVOID)pCallData,
00161                                    0,
00162                                    &dwThreadID);
00163     if (NULL == hThread)
00164     {
00165         // Call GetLastError() before calling HeapFree().
00166         DWORD dwError = GetLastError();
00167         HeapFree (GetProcessHeap(), 0, pCallData);
00168         return dwError;
00169     }
00170
00171     OutputDebugString("Returning ERROR_SUCCESS from RasSecurityDialogBegin\n");
00172     return ERROR_SUCCESS;
00173 }
00174
00175 ///////////////////////////////////////////////////////////////////////////////
00176 //    RasSecurityDialogEnd()
00177 //
00178 //    Parameters
00179 //      hPort   Handle to the COM port (A RAS handle, not a standard handle)
00180 //
00181 //    Purpose
00182 //      Stub function. Need to export this by the security DLL even if
00183 //      not needed. We need to return non-zero to indicate RAS we are no
00184 //      longer responsible for the port connection. It will take care
00185 //      of the rest.
00186 //
00187 //    Return Value
00188 //      ERROR_PORT_DISCONNECTED always
00189 //
00190 DWORD WINAPI RasSecurityDialogEnd (HPORT hPort)
00191 {
00192     OutputDebugString("RasSecurityDialogEnd\n");
00193     return ERROR_PORT_DISCONNECTED;
00194 }
00195
00196 ///////////////////////////////////////////////////////////////////////////////
00197 //    CallWorkerThread()
00198 //
00199 //    Parameters
00200 //      pCallData   Pointer to the data structure with the data for the
00201 //                  instance we are handling.
00202 //
00203 //    Purpose
00204 //      This is the function for the thread that interacts with a dialing RAS
00205 //      user. Here we query the user for its identity and based on it we
00206 //      compute a challenge to for it. Once the response from the client
00207 //      is received, we validate it and decide wether or not we allow access.
00208 //
00209 //    Return Value
00210 //      None
00211 //
00212 void WINAPI CallWorkerThread (PWORK_THREAD_DATA pCallData)
00213 {
00214     // Initialize the appropiate structures
00215     CHAR                szTemp [256] = {0};       // Needed for OutputDebugString only
00216     DWORD               dwError = 0;
00217     BOOL                fAccessGranted = FALSE;
00218     SECURITY_MESSAGE    smResult = {0};
00219     RASHOST_DATA        HostData = {0};
00220     DWORD               dwErrSend = 0;
00221
00222     OutputDebugString("CallWorkerThread.\n");
00223
00224     if (NULL == pCallData ||
00225         NULL == pCallData->pRecvBuf ||
00226         NULL == pCallData->pfnSecurityDialogEnd ||
00227         NULL == pCallData->pSendBuf)
00228     {
00229         OutputDebugString("CallWorkerThread - Invalid parameter.\n");
00230         return;
00231     }
00232
00233     smResult.hPort = pCallData->hPort;
00234     smResult.dwError =  0;
00235
00236     // Set UserName to something which will fail validation in case they don't
00237     // enter anything at all.
00238     lstrcpyn(smResult.UserName, TEXT("(RASHOST - Unknown)"), CELEMS(smResult.UserName));
00239
00240     ZeroMemory (pCallData->pRecvBuf, pCallData->RecvBufSize);
00241
00242     // Set size value
00243     HostData.dwSize = sizeof(RASHOST_DATA);
00244
00245     // Create an event to wait for client responses
00246     if ( !(hEvent = CreateEvent (NULL, FALSE, FALSE, NULL)))
00247     {
00248         wnsprintf (szTemp, CELEMS(szTemp), "CreateEvent failed: %d\n", GetLastError());
00249         OutputDebugString (szTemp);
00250         return;
00251     }
00252     else {
00253         wnsprintf(szTemp, CELEMS(szTemp), "Event %d created.\n", (DWORD)hEvent);
00254         OutputDebugString (szTemp);
00255     }
00256
00257
00258     //
00259     // Get username
00260     //
00261
00262     // Get size for memcpy
00263     pCallData->SendBufSize = sizeof("Username: ");
00264
00265     // Set prompt which will be sent to the user's terminal window
00266     CopyMemory (pCallData->pSendBuf, "Username: ", pCallData->SendBufSize);
00267
00268     // Send the prompt to the user
00269     dwErrSend =  gpfnSendProc (pCallData->hPort,
00270                                pCallData->pSendBuf,
00271                                (WORD)pCallData->SendBufSize);
00272
00273     if (dwErrSend != 0) {
00274         wnsprintf(szTemp, CELEMS(szTemp), "RASPORT SEND RETURNED %d \n", dwErrSend);
00275         OutputDebugString (szTemp);
00276     }
00277
00278
00279     // Fetch the user's input.  Return will be non-zero if the user enters a string.
00280     pCallData->RecvBufSize = GetClientResponse(pCallData->hPort, pCallData->pRecvBuf);
00281
00282     if(pCallData->RecvBufSize > 0) {
00283         // Copy the client data from the incoming buffer to the data structure
00284         CopyMemory (HostData.szUserName, pCallData->pRecvBuf, min(pCallData->RecvBufSize, CELEMS(HostData.szUserName)));
00285         lstrcpyn(smResult.UserName, HostData.szUserName, CELEMS(smResult.UserName));
00286     }
00287     else {
00288         // This will cause the RAS server to fail the authentication.
00289         lstrcpyn(smResult.UserName, TEXT("(RASHOST - Unknown)"), CELEMS(smResult.UserName));
00290     }
00291
00292     //
00293     // Get the domain name
00294     //
00295
00296     // Get size for memcpy
00297     pCallData->SendBufSize = sizeof("\r\nDomain: ");
00298
00299     // Set prompt which will be sent to the user's terminal window
00300     CopyMemory (pCallData->pSendBuf, "\r\nDomain: ", pCallData->SendBufSize);
00301
00302     // Send the prompt to the user
00303     gpfnSendProc (pCallData->hPort, pCallData->pSendBuf, (WORD)pCallData->SendBufSize);
00304
00305     if (dwErrSend != 0) {
00306         wnsprintf(szTemp, CELEMS(szTemp), "RASPORT SEND RETURNED %d \n", dwErrSend);
00307         OutputDebugString (szTemp);
00308     }
00309
00310     // Fetch the user's input.  Return will be non-zero if the user enters a string.
00311     pCallData->RecvBufSize = GetClientResponse(pCallData->hPort, pCallData->pRecvBuf);
00312
00313     if(pCallData->RecvBufSize > 0) {
00314         // Copy the client data from the incoming buffer to the data structure
00315         CopyMemory (HostData.szUserDomain, pCallData->pRecvBuf, min(pCallData->RecvBufSize, CELEMS(HostData.szUserDomain)));
00316         lstrcpyn(smResult.Domain, HostData.szUserDomain, CELEMS(smResult.Domain));
00317     }
00318     else {
00319         // This will cause the RAS server to fail the authentication.
00320         lstrcpyn(smResult.Domain, TEXT("(RASHOST - Unknown)"), CELEMS(smResult.Domain));
00321     }
00322
00323     // Dump the info we've received to debugger
00324     OutputDebugString("\nUserName: ");
00325     OutputDebugString(smResult.UserName);
00326     OutputDebugString("\n");
00327
00328     OutputDebugString("\nDomainName: ");
00329     OutputDebugString(smResult.Domain);
00330     OutputDebugString("\n");
00331
00332
00333     // With the received client response, validate the access for the client
00334     dwError = ValidateCallingUser (&HostData, &fAccessGranted);
00335
00336     if (dwError)
00337     {
00338         // There was an error, deny access.
00339         if (ERROR_SMM_TIMEOUT == dwError)
00340         {
00341             smResult.dwMsgId = SECURITYMSG_FAILURE;
00342             OutputDebugString("ERROR_SMM_TIMEOUT\n");
00343         }
00344         else
00345         {
00346             smResult.dwMsgId = SECURITYMSG_ERROR;
00347             smResult.dwError = dwError;
00348             OutputDebugString("Other error.\n");
00349         }
00350     }
00351     else if (fAccessGranted)
00352     {
00353         // Access has been granted
00354         smResult.dwMsgId = SECURITYMSG_SUCCESS;
00355         OutputDebugString("Access granted.\n");
00356     }
00357     else
00358     {
00359         // The caller did not respond correctly
00360         smResult.dwMsgId = SECURITYMSG_FAILURE;
00361         OutputDebugString("Access denied.\n");
00362     }
00363
00364     // Release the synchronization objects
00365     CloseHandle (hEvent);
00366
00367     // Tell the RAS manager we are finished by calling the END dialog funcition.
00368     pCallData->pfnSecurityDialogEnd (&smResult);
00369
00370     // Free the memory of this call instance before exiting the thread
00371     HeapFree (GetProcessHeap(), 0, pCallData);
00372 }
00373
00374
00375
00376
00377
00378 ///////////////////////////////////////////////////////////////////////////////
00379 //    ValidateCallingUser()
00380 //
00381 //    Parameters
00382 //      pData               Pointer to the host data structure
00383 //      pfAccessGranted     We return TRUE here is access is granted.
00384 //                          FALSE otherwise.
00385 //
00386 //    Purpose
00387 //      Here we validate the answer to the challenge sent to the client.
00388 //
00389 //    Return Value
00390 //      ERROR_SUCCESS if successful. Otherwiser an error code from WINERROR.H
00391 //      or RASERROR.H
00392 //
00393 DWORD WINAPI ValidateCallingUser (PRASHOST_DATA       pData,
00394                                   BOOL *              pfAccessGranted)
00395 {
00396     DWORD dwResult = ERROR_SUCCESS;
00397
00398     if (!pData || !pfAccessGranted)
00399     {
00400         return ERROR_INVALID_PARAMETER;
00401     }
00402
00403     *pfAccessGranted = FALSE;
00404
00405
00406     // Do stuff here
00407
00408     // Increased security wouldn't hurt.  Currently, if username starts with 'e',
00409     // they get in.  Wouldn't be too hard to read from a file or registry to validate
00410     // users.
00411     if(pData->szUserName[0] == 'e') {
00412         *pfAccessGranted = TRUE;
00413     }
00414
00415     return dwResult;
00416 }
00417
00418
00419 //
00420 //  Common code to handle fetching user input.  We need to have the reponse return from
00421 //  the terminal window every byte, since we don't know exactly how long the input
00422 //  will be.  With each character returned, check for a '\n' to see if the user is
00423 //  finished.  If they are, get a count of the total number of characters entered and
00424 //  return that, after setting Buffer.  If we don't read a '\n', add the character to
00425 //  the end of the buffer we're building up.
00426 //
00427 //  gpfnReceiveProc has issues on certain platforms. The third parameter (&dwBytes) doesn't
00428 //  get modified when the function returns. This causes issues where the user doesn't know
00429 //  how much data will be received. A workaround is to read the buffer byte by byte in a
00430 //  loop looking for a predetermined (between the client and server) terminator value.
00431 //  In this case '#' has been chosen.
00432 //
00433 DWORD GetClientResponse(HPORT hPort, PBYTE Buffer)
00434 {
00435     static int     iChar = 0;               // Count of characters in user's entry.
00436     static DWORD   dwBytes = 0;
00437     static DWORD   dwWait = 0;
00438     static DWORD   dwError = 0;
00439     static char    szTemp[256] = {0};       // Used for OutputDebugString only
00440     static char    szHoldBuffer[256] = {0}; // Holds the user input string as it's built up.
00441
00442
00443     if (NULL == Buffer)
00444     {
00445         return ERROR_INVALID_PARAMETER;
00446     }
00447
00448     if (NULL == gpfnReceiveProc)
00449     {
00450         return ERROR_INVALID_FUNCTION;
00451     }
00452
00453     iChar = 0;
00454     szHoldBuffer[0] = '\0';
00455
00456     do {
00457         // Reset dwBytes so we only get 1 byte back
00458         dwBytes = 1;
00459
00460         // Wait for an answer from the client responder
00461         dwError = gpfnReceiveProc (hPort,
00462                                    Buffer,
00463                                    (WORD *)&dwBytes,
00464                                    0,
00465                                    hEvent);
00466
00467         wnsprintf(szTemp, CELEMS(szTemp), "gpfnReceiveProc returned: %d\n", dwError);
00468         OutputDebugString(szTemp);
00469
00470         OutputDebugString("Calling WaitForSingleObject.\n");
00471         dwWait = WaitForSingleObject (hEvent, INFINITE);
00472
00473         switch (dwWait) {
00474             case WAIT_FAILED:
00475                 wnsprintf (szTemp, CELEMS(szTemp), "WaitForSingleObject failed: %d\n", GetLastError());
00476                 OutputDebugString (szTemp);
00477                 return 0;
00478
00479             case WAIT_TIMEOUT:
00480                 dwError = ERROR_SMM_TIMEOUT;
00481                 OutputDebugString ( "Wait timed out \n");
00482                 return 0;
00483
00484             case WAIT_ABANDONED:
00485                 OutputDebugString("WAIT_ABANDONED\n");
00486                 return 0;
00487
00488             case WAIT_OBJECT_0:
00489                 OutputDebugString("The state of the object is signaled.\n");
00490                 break;
00491         }
00492
00493         // Save this character if it's not \n or \r character
00494         if(Buffer[0] != 13 && Buffer[0] != 10) {
00495
00496             // Make sure there is enough space in our buffer
00497             if (CELEMS(szHoldBuffer) > iChar)
00498             {
00499                 // Save this character and increment character count
00500                 szHoldBuffer[iChar++] = Buffer[0];
00501             }
00502             else
00503             {
00504                 break;
00505             }
00506         }
00507
00508         wnsprintf(szTemp, CELEMS(szTemp), "Buffer= %c\n", Buffer[0]);
00509         OutputDebugString(szTemp);
00510
00511     } while(Buffer[0] != 13);
00512
00513     // Null terminate the string
00514     szHoldBuffer[iChar] = '\0';
00515
00516     // Now copy the string back into the buffer
00517     CopyMemory (Buffer, &szHoldBuffer, iChar);
00518
00519     wnsprintf(szTemp, CELEMS(szTemp), "Returning Buffer: %s\n", Buffer);
00520     OutputDebugString(szTemp);
00521
00522     wnsprintf(szTemp, CELEMS(szTemp), "Returning size: %d\n", iChar);
00523     OutputDebugString(szTemp);
00524
00525     return iChar;
00526
00527 }   /* End of 'GetClientResponse' */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/CapMFC.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

CapMFC.h

Go to the documentation of this file.
00001 // CapMFC.h : main header file for the CAPMFC application
00002 //
00003
00004 #if !defined(AFX_CAPMFC_H__AB8FEB98_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00005 #define AFX_CAPMFC_H__AB8FEB98_3841_11D2_8512_00C04FA34A14__INCLUDED_
00006
00007 #if _MSC_VER > 1000
00008 #pragma once
00009 #endif // _MSC_VER > 1000
00010
00011 #ifndef __AFXWIN_H__
00012   #error include 'stdafx.h' before including this file for PCH
00013 #endif
00014
00015 #include "resource.h"   // main symbols
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CCapMFCApp:
00019 // See CapMFC.cpp for the implementation of this class
00020 //
00021
00022 class CCapMFCApp : public CWinApp
00023 {
00024 public:
00025   CCapMFCApp();
00026
00027 // Overrides
00028   // ClassWizard generated virtual function overrides
00029   //{{AFX_VIRTUAL(CCapMFCApp)
00030   public:
00031   virtual BOOL InitInstance();
00032   //}}AFX_VIRTUAL
00033
00034 // Implementation
00035
00036   //{{AFX_MSG(CCapMFCApp)
00037   //}}AFX_MSG
00038   DECLARE_MESSAGE_MAP()
00039 };
00040
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043
00044 //{{AFX_INSERT_LOCATION}}
00045 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00046
00047 #endif // !defined(AFX_CAPMFC_H__AB8FEB98_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CQueryBox Member List

This is the complete list of members for CQueryBox, including all inherited members.
Append(LPCWSTR pwszString, bool bCanUndo=TRUE, DWORD dwMask=0, DWORD dwColor=0) | CRichEditLite | [virtual]
CanPaste() | CEditBoxLite | [inline]
CConsole() | CConsole | [inline]
CEditBoxLite(HWND hWndParent=NULL, UINT nID=0) | CEditBoxLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Copy() | CEditBoxLite | [inline]
CQueryBox(CMDIChild *pCMDIChild) | CQueryBox |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CRichEditLite(HWND hWndParent=NULL, UINT nID=0) | CRichEditLite |
CSplitterLite(HWND hWndParent=NULL, UINT nID=0) | CSplitterLite |
Cut() | CEditBoxLite | [inline]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient) | CSplitterLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
FindNext(DWORD dwFindFlags, WCHAR *pwszText) | CRichEditLite | [virtual]
FindText(DWORD dwFindFlags, FINDTEXTEXW *pFINDTEXT) | CRichEditLite | [virtual]
GetConsole() | CConsole | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetLine(INDEX iLine, CHAR *pszBuffer, ULONG ulMaxSize) | CEditBoxLite |
GetLineCount() | CEditBoxLite | [inline]
GetSel(INDEX *piMin, INDEX *piMax) | CRichEditLite | [inline, virtual]
GetSel(CHARRANGE *pcr) | CRichEditLite | [inline, virtual]
CEditBoxLite::GetSel(INDEX *piMin, INDEX *piMax) | CEditBoxLite | [inline, virtual]
CEditBoxLite::GetSel(CHARRANGE *pcr) | CEditBoxLite | [inline, virtual]
GetSelectedText(BOOL fEntireLine=TRUE) | CRichEditLite |
GetTextRange(CHARRANGE &cr, WCHAR *pwszBuffer) | CEditBoxLite |
GetTextRange(CHARRANGE &cr, CHAR *pszBuffer) | CEditBoxLite |
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
LineFromChar(INDEX nIndex) | CRichEditLite | [inline]
LineIndex(INDEX nLine) | CEditBoxLite | [inline]
LineLength(INDEX nStartChar) | CEditBoxLite | [inline]
LineScroll(INDEX nLines, INDEX nChars=0) | CEditBoxLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hCursorOld | CSplitterLite |
m_hCursorRight | CSplitterLite |
m_hCursorTop | CSplitterLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iBorderCX | CSplitterLite |
m_iBorderCY | CSplitterLite |
m_nID | CWndLite |
m_pCMDIChild | CQueryBox |
m_pCWndBottom | CSplitterLite |
m_pCWndLeft | CSplitterLite |
m_pCWndRight | CSplitterLite |
m_pCWndTop | CSplitterLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_pwszNewLine | CConsole | [protected]
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnBorder(REFPOINTS pts, INT iBorder) | CSplitterLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CQueryBox | [virtual]
CRichEditLite::OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CRichEditLite | [virtual]
CEditBoxLite::OnCreate(CREATESTRUCT *pCREATESTRUCT) | CEditBoxLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CQueryBox | [virtual]
CRichEditLite::OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLink(INT idCtrl, ENLINK *pEnLink) | CRichEditLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CRichEditLite | [virtual]
CEditBoxLite::OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CQueryBox | [virtual]
CRichEditLite::OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
operator<<(LPCWSTR pwsz) | CConsole | [inline, virtual]
operator<<(COLORREF refColor) | CConsole | [inline, virtual]
operator<<(COLORA attColor) | CConsole | [inline, virtual]
Paste() | CEditBoxLite | [inline]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
ReplaceAll(LPCWSTR pwszString, bool bReplaceAll=FALSE, bool fHighlight=FALSE) | CEditBoxLite | [virtual]
ReplaceSel(LPCWSTR pwszString, bool bCanUndo) | CRichEditLite | [inline, virtual]
ReplaceSel(LPCWSTR pwszString, bool bCanUndo, DWORD dwMask, DWORD dwColor) | CRichEditLite | [virtual]
CEditBoxLite::ReplaceSel(LPCWSTR pwszString, bool bCanUndo) | CEditBoxLite | [inline, virtual]
Save(LPCWSTR pwszFileName) | CEditBoxLite |
ScrollCaret() | CEditBoxLite | [inline]
SetCharFormat(DWORD dwMask, CHARFORMATW &charFormatW) | CRichEditLite |
SetColor(COLORREF refColor) | CRichEditLite | [inline, virtual]
SetColorAttrib(COLORA attColor, BOOL fEnable=TRUE) | CRichEditLite | [inline, virtual]
SetDefaultFont() | CRichEditLite |
SetEffects(DWORD dwMask, DWORD dwEffects, COLORREF crTextColor) | CRichEditLite |
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetOptions(UINT dwOptions, UINT fOperation=ECOOP_OR) | CEditBoxLite | [inline]
SetReadOnly(bool bReadOnly) | CEditBoxLite | [inline]
SetSel(INDEX iMin, INDEX iMax) | CRichEditLite | [inline, virtual]
CEditBoxLite::SetSel(INDEX iMin, INDEX iMax) | CEditBoxLite | [inline, virtual]
SetSplitter(CSplitterLite *pCWndTop, CSplitterLite *pCWndBottom=NULL, CSplitterLite *pCWndLeft=NULL, CSplitterLite *pCWndRight=NULL) | CSplitterLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
SetWordWrap(BOOL fWordWrap) | CRichEditLite | [virtual]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT *pPoint) | CSplitterLite | [virtual]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
Write(LPCWSTR pwszText) | CRichEditLite | [inline, virtual]
WriteLine(LPCWSTR pwsz=NULL) | CConsole | [inline, virtual]
~CConsole() | CConsole | [inline, virtual]
~CEditBoxLite() | CEditBoxLite | [virtual]
~CQueryBox() | CQueryBox | [virtual]
~CRichEditLite() | CRichEditLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_TRANSMITFILEARGS Member List

This is the complete list of members for _TRANSMITFILEARGS, including all inherited members.
dwFlags | _TRANSMITFILEARGS
hFile | _TRANSMITFILEARGS
lpTransmitBuffers | _TRANSMITFILEARGS
nNumberOfBytesPerSend | _TRANSMITFILEARGS
nNumberOfBytesToWrite | _TRANSMITFILEARGS
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FieldsVtbl Member List

This is the complete list of members for FieldsVtbl, including all inherited members.
c | FieldsVtbl
cNames | FieldsVtbl
dispIdMember | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ADOFields __RPC_FAR *This | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ADOFields __RPC_FAR *This | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ADOFields __RPC_FAR *This | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ADOFields __RPC_FAR *This | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ADOFields __RPC_FAR *This | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Count)(ADOFields __RPC_FAR *This | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *_NewEnum)(ADOFields __RPC_FAR *This | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Refresh)(ADOFields __RPC_FAR *This) | FieldsVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Item)(ADOFields __RPC_FAR *This | FieldsVtbl
Index | FieldsVtbl
iTInfo | FieldsVtbl
lcid | FieldsVtbl
lcid | FieldsVtbl
lcid | FieldsVtbl
pctinfo | FieldsVtbl
pDispParams | FieldsVtbl
pExcepInfo | FieldsVtbl
ppTInfo | FieldsVtbl
ppvObject | FieldsVtbl
ppvObject | FieldsVtbl
ppvObject | FieldsVtbl
puArgErr | FieldsVtbl
pVarResult | FieldsVtbl
rgDispId | FieldsVtbl
rgszNames | FieldsVtbl
riid | FieldsVtbl
riid | FieldsVtbl
riid | FieldsVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ADOFields __RPC_FAR *This) | FieldsVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ADOFields __RPC_FAR *This) | FieldsVtbl
wFlags | FieldsVtbl
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/resource.h Source File

  • Web
  • Browser
  • EditGlyphs

resource.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 //{{NO_DEPENDENCIES}}
00006 // Microsoft Developer Studio generated include file.
00007 // Used by EdGlyphs.rc
00008 //
00009 #define IDS_PROJNAME                    100
00010 #define IDR_EdGlyphs                    100
00011 #define IDR_BROWSERHOST                   101
00012 #define IDS_PBEG_GLYPHSTRING            101
00013 #define IDS_PEND_GLYPHSTRING            102
00014 #define IDS_T_GLYPHSTRING               103
00015 #define IDS_BR_GLYPHSTRING              104
00016 #define IDS_SCRIPT_GLYPHSTRING          105
00017 #define IDS_COMMENT_GLYPHSTRING         106
00018 #define IDS_STYLE_GLYPHSTRING           107
00019 #define IDS_H3BGN_GLYPHSTRING           108
00020 #define IDS_H3END_GLYPHSTRING           109
00021 #define IDS_H3ABS_GLYPHSTRING           110
00022 #define IDS_H4_GLYPHSTRING              111
00023 #define IDR_TOOLBAR1                    201
00024 #define IDR_BR_GIF                      205
00025 #define IDI_PBGN_GIF                    206
00026 #define IDR_GIFS1                       209
00027 #define IDR_GIFS2                       229
00028 #define IDR_GIFS3                       230
00029 #define IDR_GIFS4                       231
00030 #define IDR_GIFS5                       232
00031 #define IDR_GIFS6                       233
00032 #define IDR_GIFS7                       234
00033 #define IDR_GIFS8                       235
00034 #define IDR_GIFS9                       236
00035 #define IDR_GIFS10                      237
00036 #define IDR_GIFS11                      238
00037 #define IDR_GIFS12                      239
00038 #define IDR_GIFS13                      240
00039 #define IDR_GIFS14                      241
00040 #define IDR_GIFS15                      242
00041 #define IDR_GIFS16                      243
00042 #define IDR_GIFS17                      244
00043 #define IDR_GIFS18                      245
00044 #define IDR_GIFS19                      246
00045 #define ID_BUTTON1                      32768
00046 #define ID_BUTTON2                      32769
00047 #define ID_BUTTON3                      32770
00048 #define ID_BUTTON4                      32772
00049 #define ID_TOOLBARWND                   32773
00050 #define ID_URLBOX                       32774
00051
00052 // Next default values for new objects
00053 //
00054 #ifdef APSTUDIO_INVOKED
00055 #ifndef APSTUDIO_READONLY_SYMBOLS
00056 #define _APS_NEXT_RESOURCE_VALUE        249
00057 #define _APS_NEXT_COMMAND_VALUE         32773
00058 #define _APS_NEXT_CONTROL_VALUE         201
00059 #define _APS_NEXT_SYMED_VALUE           104
00060 #endif
00061 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/ExtObjData.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

ExtObjData.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ExtObjData.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the context menu functions and functions for
00010 //      returning the property sheet and wizard pages.
00011 //
00012 //  Author:
00013 //      <name> (<e-mail name>) Mmmm DD, 2003
00014 //
00015 //  Revision History:
00016 //
00017 //  Notes:
00018 //
00019 /////////////////////////////////////////////////////////////////////////////
00020
00021 #include "stdafx.h"
00022 #include "File Share SampleEx.h"
00023 #include "ExtObjData.h"
00024 #include "resprop.h"
00025
00026 #include "resource.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Constant Definitions
00036 /////////////////////////////////////////////////////////////////////////////
00037
00038 #define CLUSTER_MENU_BASE_ID        0
00039 #define CLUSTER_MENU_ID_1           (CLUSTER_MENU_BASE_ID + 1)
00040
00041 #define NODE_MENU_BASE_ID           10
00042 #define NODE_MENU_ID_1              (NODE_MENU_BASE_ID + 1)
00043
00044 #define GROUP_MENU_BASE_ID          20
00045 #define GROUP_MENU_ID_1             (GROUP_MENU_BASE_ID + 1)
00046
00047 #define RESOURCE_MENU_BASE_ID       30
00048 #define RESOURCE_MENU_ID_1          (RESOURCE_MENU_BASE_ID + 1)
00049
00050 #define ALL_RESOURCES_MENU_BASE_ID  40
00051 #define ALL_RESOURCES_MENU_ID_1     (ALL_RESOURCES_MENU_BASE_ID + 1)
00052
00053 #define RESTYPE_MENU_BASE_ID        50
00054 #define RESTYPE_MENU_ID_1           (RESTYPE_MENU_BASE_ID + 1)
00055
00056 #define ALL_RESTYPES_MENU_BASE_ID   60
00057 #define ALL_RESTYPES_MENU_ID_1      (ALL_RESTYPES_MENU_BASE_ID + 1)
00058
00059 #define NETWORK_MENU_BASE_ID        70
00060 #define NETWORK_MENU_ID_1           (NETWORK_MENU_BASE_ID + 1)
00061
00062 #define NETINTERFACE_MENU_BASE_ID   80
00063 #define NETINTERFACE_MENU_ID_1      (NETINTERFACE_MENU_BASE_ID + 1)
00064
00065 /////////////////////////////////////////////////////////////////////////////
00066 // CObjData implementation
00067 /////////////////////////////////////////////////////////////////////////////
00068
00069 /////////////////////////////////////////////////////////////////////////////
00070 //++
00071 //
00072 //  CObjData::S_HrCreateObject
00073 //
00074 //  Description:
00075 //      Create a CObjData-derived object based on the requesting object type.
00076 //
00077 //  Arguments:
00078 //
00079 //  Return Value:
00080 //
00081 //--
00082 /////////////////////////////////////////////////////////////////////////////
00083 HRESULT
00084 CObjData::S_HrCreateObject(
00085       IUnknown *    piDataIn
00086     , CObjData **   ppodOut
00087     )
00088 {
00089     HRESULT                 hr = S_OK;
00090     CObjData *              podData = NULL;
00091     CLUADMEX_OBJECT_TYPE    cot;
00092     IGetClusterObjectInfo * piObjInfo = NULL;
00093
00094     ASSERT( piDataIn != NULL );
00095     ASSERT( ppodOut != NULL );
00096
00097     hr = piDataIn->QueryInterface( IID_IGetClusterObjectInfo, reinterpret_cast< LPVOID * >( &piObjInfo ) );
00098     if ( FAILED( hr ) )
00099     {
00100         goto Cleanup;
00101     } // if: error querying for interface
00102
00103     cot = piObjInfo->GetObjectType( 0 );
00104     piObjInfo->Release();
00105     piObjInfo = NULL;
00106
00107     switch ( cot )
00108     {
00109         case CLUADMEX_OT_RESOURCE:
00110             podData = new CResData();
00111             break;
00112
00113         case CLUADMEX_OT_RESOURCETYPE:
00114             podData = new CResTypeData();
00115             break;
00116
00117         default:
00118             hr = E_NOTIMPL;
00119             goto Cleanup;
00120             break;
00121     } // switch: object type
00122
00123     if ( podData == NULL )
00124     {
00125         hr = E_OUTOFMEMORY;
00126         goto Cleanup;
00127     } // if: error allocating the object
00128
00129     hr = podData->HrInitialize( piDataIn );
00130     if ( FAILED( hr ) )
00131     {
00132         goto Cleanup;
00133     } // if: error initializing the object
00134
00135     *ppodOut = podData;
00136     podData = NULL;         // We gave away ownership.
00137
00138 Cleanup:
00139
00140     if ( piObjInfo != NULL )
00141     {
00142         piObjInfo->Release();
00143     } // if:
00144
00145     delete podData;
00146
00147     return hr;
00148
00149 } //*** CObjData::S_HrCreateObject
00150
00151 /////////////////////////////////////////////////////////////////////////////
00152 //++
00153 //
00154 //  CObjData::AddContextMenuItem
00155 //
00156 //  Description:
00157 //      Add a context menu item.
00158 //
00159 //  Arguments:
00160 //      piCallbackIn
00161 //          Pointer to an IWCContextMenuCallback interface for adding menu
00162 //          items to the context menu.
00163 //
00164 //  Return Value:
00165 //      S_OK
00166 //          Menu items added successfully.
00167 //
00168 //      hr
00169 //          Any errors returned by IWCContextMenuCallback
00170 //          ::AddExtensionMenuItem().
00171 //
00172 //--
00173 /////////////////////////////////////////////////////////////////////////////
00174 HRESULT
00175 CObjData::AddContextMenuItem(
00176       IWCContextMenuCallback *  piCallbackIn
00177     , UINT                      nMenuItem
00178     , UINT                      nMenuItemDesc
00179     , UINT                      nBaseID
00180     , ULONG                     uFlags
00181     )
00182 {
00183     HRESULT hr = S_OK;
00184     CString strMenuItem;
00185     CString strStatusBarText;
00186     LPWSTR  pwszMenuItem = NULL;
00187     LPWSTR  pwszStatusBarText = NULL;
00188
00189     ASSERT( piCallbackIn != NULL );
00190
00191     //
00192     //  Get strings.
00193     //
00194
00195     strMenuItem.LoadString( nMenuItem );
00196     strStatusBarText.LoadString( nMenuItemDesc );
00197     pwszMenuItem = strMenuItem.GetBuffer( 1 );
00198     pwszStatusBarText = strStatusBarText.GetBuffer( 1 );
00199
00200     //
00201     //  Add item to the context menu.
00202     //
00203
00204     hr = piCallbackIn->AddExtensionMenuItem(
00205                               pwszMenuItem            // lpszName
00206                             , pwszStatusBarText       // lpszStatusBarText
00207                             , nBaseID                 // lCommandID
00208                             , 0                       // lSubCommandID - reserved, must be 0
00209                             , uFlags                  // uFlags
00210                             );
00211
00212     //
00213     //  Release strings.
00214     //
00215
00216     strMenuItem.ReleaseBuffer();
00217     strStatusBarText.ReleaseBuffer();
00218
00219     return hr;
00220
00221 } //*** CObjData::AddContextMenuItem
00222
00223 /////////////////////////////////////////////////////////////////////////////
00224 //++
00225 //
00226 //  CObjData::HrInitialize
00227 //
00228 //  Description:
00229 //      Initializes the object.
00230 //
00231 //  Description:
00232 //
00233 //  Arguments:
00234 //
00235 //  Return Value:
00236 //
00237 //--
00238 /////////////////////////////////////////////////////////////////////////////
00239 HRESULT
00240 CObjData::HrInitialize(
00241       IUnknown *    piDataIn
00242     )
00243 {
00244     HRESULT                 hr = S_OK;
00245     BSTR                    bstrName = NULL;
00246     LONG                    cchName = 0;
00247     IGetClusterObjectInfo * piObjInfo = NULL;
00248
00249     ASSERT( piDataIn != NULL );
00250
00251     //
00252     // Get an interface pointer to IGetClusterObjectInfo.
00253     //
00254
00255     hr = piDataIn->QueryInterface( IID_IGetClusterObjectInfo, reinterpret_cast< LPVOID * >( &piObjInfo ) );
00256     if ( FAILED( hr ) )
00257     {
00258         goto Cleanup;
00259     } // if: error querying for interface
00260
00261     //
00262     // Allocate a buffer for the object name.
00263     //
00264
00265     hr = piObjInfo->GetObjectName( 0, NULL, &cchName );
00266     if ( FAILED( hr ) )
00267     {
00268         goto Cleanup;
00269     } // if: error getting the name length
00270
00271     bstrName = SysAllocStringLen( NULL, cchName );
00272     if ( bstrName == NULL )
00273     {
00274         hr = E_OUTOFMEMORY;
00275         goto Cleanup;
00276     } // if: error allocating a string
00277
00278     //
00279     // Retrieve the object name.
00280     //
00281
00282     hr = piObjInfo->GetObjectName( 0, bstrName, &cchName );
00283     if ( FAILED( hr ) )
00284     {
00285         goto Cleanup;
00286     } // if: error getting the name
00287
00288     //
00289     // The CString assignment operator makes a copy.
00290     //
00291
00292     m_strName = bstrName;
00293
00294 Cleanup:
00295
00296     SysFreeString( bstrName );
00297
00298     if ( piObjInfo != NULL )
00299     {
00300         piObjInfo->Release();
00301     } // if:
00302
00303     return hr;
00304
00305 } //*** CObjData::HrInitialize
00306
00307 /////////////////////////////////////////////////////////////////////////////
00308 // CClusterData implementation
00309 /////////////////////////////////////////////////////////////////////////////
00310
00311 /////////////////////////////////////////////////////////////////////////////
00312 //++
00313 //
00314 //  CClusterData::HrInitialize
00315 //
00316 //  Description:
00317 //      Initializes the object.
00318 //
00319 //  Arguments:
00320 //
00321 //  Return Value:
00322 //
00323 //--
00324 /////////////////////////////////////////////////////////////////////////////
00325 HRESULT
00326 CClusterData::HrInitialize(
00327     IUnknown * piDataIn
00328     )
00329 {
00330     HRESULT                 hr = S_OK;
00331     IGetClusterDataInfo *   piClusInfo = NULL;
00332     LONG                    cchClusterName = 0;
00333     BSTR                    bstrClusterName = NULL;
00334
00335     ASSERT( piDataIn != NULL );
00336
00337     //
00338     // Initialize the base class.
00339     //
00340
00341     hr = CObjData::HrInitialize( piDataIn );
00342     if ( FAILED( hr ) )
00343     {
00344         goto Cleanup;
00345     } // if: error initializing the base class
00346
00347     //
00348     // Initialize member variables to default values.
00349     //
00350
00351     m_hCluster = NULL;
00352
00353     //
00354     // Set the object type.
00355     //
00356
00357     m_cot = CLUADMEX_OT_CLUSTER;
00358
00359     //
00360     // Get an interface pointer to IGetClusterDataInfo.
00361     //
00362
00363     hr = piDataIn->QueryInterface( IID_IGetClusterDataInfo, reinterpret_cast< LPVOID * >( &piClusInfo ) );
00364     if ( FAILED( hr ) )
00365     {
00366         goto Cleanup;
00367     } // if: error querying for interface
00368
00369     //
00370     // Get a copy of the handle.  Don't free this handle - it's just a copy.
00371     //
00372
00373     m_hCluster = piClusInfo->GetClusterHandle();
00374     ASSERT( m_hCluster != NULL );
00375     if ( m_hCluster == NULL )
00376     {
00377         hr = E_HANDLE;
00378         goto Cleanup;
00379     } // if: error querying for interface
00380
00381     //
00382     // Allocate a buffer for and retrieve the name.
00383     //
00384
00385     hr = piClusInfo->GetClusterName( NULL, &cchClusterName );
00386     if ( FAILED( hr ) )
00387     {
00388         goto Cleanup;
00389     } // if: error getting the name length
00390
00391     bstrClusterName = SysAllocStringLen( NULL, cchClusterName );
00392     if ( bstrClusterName == NULL )
00393     {
00394         hr = E_OUTOFMEMORY;
00395         goto Cleanup;
00396     } // if: error allocating a string
00397
00398     hr = piClusInfo->GetClusterName( bstrClusterName, &cchClusterName );
00399     if ( FAILED( hr ) )
00400     {
00401         goto Cleanup;
00402     } // if: error getting the name
00403
00404     //
00405     // The CString assignment operator makes a copy.
00406     //
00407
00408     m_strClusterName = bstrClusterName;
00409
00410 Cleanup:
00411
00412     if ( piClusInfo != NULL )
00413     {
00414         piClusInfo->Release();
00415     } // if:
00416
00417     SysFreeString( bstrClusterName );
00418
00419     return hr;
00420
00421 } //*** CClusterData::HrInitialize
00422
00423 /////////////////////////////////////////////////////////////////////////////
00424 //++
00425 //
00426 //  CClusterData::AddContextMenuItems
00427 //
00428 //  Description:
00429 //      Add menu items to the cluster object context menu.
00430 //
00431 //  Arguments:
00432 //      piCallbackIn
00433 //          Pointer to an IWCContextMenuCallback interface for adding menu
00434 //          items to the context menu.
00435 //
00436 //  Return Value:
00437 //      S_OK
00438 //          Menu items added successfully.
00439 //
00440 //      hr
00441 //          Any errors returned by IWCContextMenuCallback
00442 //          ::AddExtensionMenuItem().
00443 //
00444 //--
00445 /////////////////////////////////////////////////////////////////////////////
00446 HRESULT
00447 CClusterData::AddContextMenuItems(
00448       IWCContextMenuCallback * piCallbackIn
00449     )
00450 {
00451     HRESULT hr = S_OK;
00452
00453     ASSERT( piCallbackIn != NULL );
00454
00455     hr = AddContextMenuItem(
00456                   piCallbackIn
00457                 , IDS_CLUSTER_MENU_ITEM_1
00458                 , IDS_CLUSTER_MENU_ITEM_1_DESC
00459                 , CLUSTER_MENU_ID_1
00460                 , MF_ENABLED
00461                 );
00462
00463     return hr;
00464
00465 } //*** CClusterData::AddContextMenuItems
00466
00467 /////////////////////////////////////////////////////////////////////////////
00468 //++
00469 //
00470 //  CClusterData::InvokeCommand
00471 //
00472 //  Description:
00473 //      Invoke a command we added to a context menu.
00474 //
00475 //  Arguments:
00476 //      nCommandIDIn
00477 //          ID of the menu item to execute.  This is the same ID passed to the
00478 //          IWCContextMenuCallback::AddExtensionMenuItem() method.
00479 //
00480 //  Return Value:
00481 //      HRESULT
00482 //
00483 //--
00484 /////////////////////////////////////////////////////////////////////////////
00485 HRESULT
00486 CClusterData::InvokeCommand(
00487     ULONG nCommandIDIn
00488     )
00489 {
00490     HRESULT hr = S_OK;
00491
00492     switch ( nCommandIDIn )
00493     {
00494         case CLUSTER_MENU_ID_1:
00495
00496             //
00497             //  TODO:  Implement your menu item here.
00498             //
00499
00500             hr = S_OK;
00501             break;
00502
00503         default:
00504             hr = E_NOTIMPL;
00505             break;
00506     } // switch: nCommandIDIn
00507
00508     return hr;
00509
00510 } //*** CClusterData::InvokeCommand
00511
00512 /////////////////////////////////////////////////////////////////////////////
00513 // CNodeData implementation
00514 /////////////////////////////////////////////////////////////////////////////
00515
00516 /////////////////////////////////////////////////////////////////////////////
00517 //++
00518 //
00519 //  CNodeData::HrInitialize
00520 //
00521 //  Description:
00522 //      Initializes the object.
00523 //
00524 //  Arguments:
00525 //
00526 //  Return Value:
00527 //
00528 //--
00529 /////////////////////////////////////////////////////////////////////////////
00530 HRESULT
00531 CNodeData::HrInitialize(
00532     IUnknown * piDataIn
00533     )
00534 {
00535     HRESULT                 hr = S_OK;
00536     IGetClusterNodeInfo *   piNodeInfo = NULL;
00537
00538     ASSERT( piDataIn != NULL );
00539
00540     //
00541     // Initialize the base class.
00542     //
00543
00544     hr = CObjData::HrInitialize( piDataIn );
00545     if ( FAILED( hr ) )
00546     {
00547         goto Cleanup;
00548     } // if: error initializing the base class
00549
00550     //
00551     // Initialize member variables to default values.
00552     //
00553
00554     m_hNode = NULL;
00555
00556     //
00557     // Set the object type.
00558     //
00559
00560     m_cot = CLUADMEX_OT_NODE;
00561
00562     //
00563     // Get an interface pointer to IGetClusterNodeInfo.
00564     //
00565
00566     hr = piDataIn->QueryInterface( IID_IGetClusterNodeInfo, reinterpret_cast< LPVOID * >( &piNodeInfo ) );
00567     if ( FAILED( hr ) )
00568     {
00569         goto Cleanup;
00570     } // if: error querying for interface
00571
00572     //
00573     // Get a copy of the handle.  Don't free this handle - it's just a copy.
00574     //
00575
00576     m_hNode = piNodeInfo->GetNodeHandle( 0 );
00577     ASSERT( m_hNode != NULL );
00578     if ( m_hNode == NULL )
00579     {
00580         hr = E_HANDLE;
00581         goto Cleanup;
00582     } // if: error getting the node handle
00583
00584 Cleanup:
00585
00586     if ( piNodeInfo != NULL )
00587     {
00588         piNodeInfo->Release();
00589     } // if:
00590
00591     return hr;
00592
00593 } //*** CNodeData::HrInitialize
00594
00595 /////////////////////////////////////////////////////////////////////////////
00596 //++
00597 //
00598 //  CNodeData::AddContextMenuItems
00599 //
00600 //  Description:
00601 //      Add menu items to the node object context menu.
00602 //
00603 //  Arguments:
00604 //      piCallbackIn
00605 //          Pointer to an IWCContextMenuCallback interface for adding menu
00606 //          items to the context menu.
00607 //
00608 //  Return Value:
00609 //      S_OK
00610 //          Menu items added successfully.
00611 //
00612 //      hr
00613 //          Any errors returned by IWCContextMenuCallback
00614 //          ::AddExtensionMenuItem().
00615 //
00616 //--
00617 /////////////////////////////////////////////////////////////////////////////
00618 HRESULT
00619 CNodeData::AddContextMenuItems(
00620     IWCContextMenuCallback * piCallbackIn
00621     )
00622 {
00623     HRESULT hr = S_OK;
00624
00625     ASSERT( piCallbackIn != NULL );
00626
00627     hr = AddContextMenuItem(
00628               piCallbackIn
00629             , IDS_NODE_MENU_ITEM_1
00630             , IDS_NODE_MENU_ITEM_1_DESC
00631             , NODE_MENU_ID_1
00632             , MF_ENABLED
00633             );
00634
00635     return hr;
00636
00637 } //*** CNodeData::AddContextMenuItems
00638
00639 /////////////////////////////////////////////////////////////////////////////
00640 //++
00641 //
00642 //  CNodeData::InvokeCommand
00643 //
00644 //  Description:
00645 //      Invoke a command we added to a context menu.
00646 //
00647 //  Arguments:
00648 //      nCommandIDIn
00649 //          ID of the menu item to execute.  This is the same ID passed to the
00650 //          IWCContextMenuCallback::AddExtensionMenuItem() method.
00651 //
00652 //  Return Value:
00653 //      S_OK        Command invoked successfully.
00654 //      E_NOTIMPL   Command ID not recognized.
00655 //
00656 //--
00657 /////////////////////////////////////////////////////////////////////////////
00658 HRESULT
00659 CNodeData::InvokeCommand(
00660     ULONG nCommandIDIn
00661     )
00662 {
00663     HRESULT hr = S_OK;
00664
00665     switch ( nCommandIDIn )
00666     {
00667         case NODE_MENU_ID_1:
00668
00669             //
00670             //  TODO:  Implement your menu item here
00671             //
00672
00673             hr = S_OK;
00674             break;
00675
00676         default:
00677             hr = E_NOTIMPL;
00678             break;
00679     } // switch: nCommandIDIn
00680
00681     return hr;
00682
00683 } //*** CNodeData::InvokeCommand
00684
00685 /////////////////////////////////////////////////////////////////////////////
00686 // CGroupData implementation
00687 /////////////////////////////////////////////////////////////////////////////
00688
00689 /////////////////////////////////////////////////////////////////////////////
00690 //++
00691 //
00692 //  CGroupData::HrInitialize
00693 //
00694 //  Description:
00695 //      Initializes the object.
00696 //
00697 //  Arguments:
00698 //
00699 //  Return Value:
00700 //
00701 //--
00702 /////////////////////////////////////////////////////////////////////////////
00703 HRESULT
00704 CGroupData::HrInitialize(
00705     IUnknown * piDataIn
00706     )
00707 {
00708     HRESULT                 hr = S_OK;
00709     IGetClusterGroupInfo *  piGroupInfo = NULL;
00710
00711     ASSERT( piDataIn != NULL );
00712
00713     //
00714     // Initialize the base class.
00715     //
00716
00717     hr = CObjData::HrInitialize( piDataIn );
00718     if ( FAILED( hr ) )
00719     {
00720         goto Cleanup;
00721     } // if: error initializing the base class
00722
00723     //
00724     // Initialize member variables to default values.
00725     //
00726
00727     m_hGroup = NULL;
00728
00729     //
00730     // Set the object type.
00731     //
00732
00733     m_cot = CLUADMEX_OT_GROUP;
00734
00735     //
00736     // Get an interface pointer to IGetClusterGroupInfo.
00737     //
00738
00739     hr = piDataIn->QueryInterface( IID_IGetClusterGroupInfo, reinterpret_cast< LPVOID * >( &piGroupInfo ) );
00740     if ( FAILED( hr ) )
00741     {
00742         goto Cleanup;
00743     } // if: error querying for interface
00744
00745     //
00746     // Get a copy of the handle.  Don't free this handle - it's just a copy.
00747     //
00748
00749     m_hGroup = piGroupInfo->GetGroupHandle( 0 );
00750     ASSERT( m_hGroup != NULL );
00751     if ( m_hGroup == NULL )
00752     {
00753         hr = E_HANDLE;
00754         goto Cleanup;
00755     } // if: error getting the group handle
00756
00757 Cleanup:
00758
00759     if ( piGroupInfo != NULL )
00760     {
00761         piGroupInfo->Release();
00762     } // if:
00763
00764     return hr;
00765
00766 } //*** CGroupData::HrInitialize
00767
00768 /////////////////////////////////////////////////////////////////////////////
00769 //++
00770 //
00771 //  CGroupData::AddContextMenuItems
00772 //
00773 //  Description:
00774 //      Add menu items to the group object context menu.
00775 //
00776 //  Arguments:
00777 //      piCallbackIn
00778 //          Pointer to an IWCContextMenuCallback interface for adding menu
00779 //          items to the context menu.
00780 //
00781 //  Return Value:
00782 //      S_OK
00783 //          Menu items added successfully.
00784 //
00785 //      hr
00786 //          Any errors returned by IWCContextMenuCallback
00787 //          ::AddExtensionMenuItem().
00788 //
00789 //--
00790 /////////////////////////////////////////////////////////////////////////////
00791 HRESULT CGroupData::AddContextMenuItems(
00792       IWCContextMenuCallback * piCallbackIn
00793       )
00794 {
00795     HRESULT hr = S_OK;
00796
00797     ASSERT( piCallbackIn != NULL );
00798
00799     hr = AddContextMenuItem(
00800               piCallbackIn
00801             , IDS_GROUP_MENU_ITEM_1
00802             , IDS_GROUP_MENU_ITEM_1_DESC
00803             , GROUP_MENU_ID_1
00804             , MF_ENABLED
00805             );
00806
00807     return hr;
00808
00809 } //*** CGroupData::AddContextMenuItems
00810
00811 /////////////////////////////////////////////////////////////////////////////
00812 //++
00813 //
00814 //  CGroupData::InvokeCommand
00815 //
00816 //  Description:
00817 //      Invoke a command we added to a context menu.
00818 //
00819 //  Arguments:
00820 //      nCommandIDIn
00821 //          ID of the menu item to execute.  This is the same ID passed to the
00822 //          IWCContextMenuCallback::AddExtensionMenuItem() method.
00823 //
00824 //  Return Value:
00825 //      S_OK        Command invoked successfully.
00826 //      E_NOTIMPL   Command ID not recognized.
00827 //
00828 //--
00829 /////////////////////////////////////////////////////////////////////////////
00830 HRESULT CGroupData::InvokeCommand( ULONG nCommandIDIn )
00831 {
00832     HRESULT hr = S_OK;
00833
00834     switch ( nCommandIDIn )
00835     {
00836         case GROUP_MENU_ID_1:
00837
00838             //
00839             //  TODO:  Implement your menu item here
00840             //
00841
00842             hr = S_OK;
00843             break;
00844
00845         default:
00846             hr = E_NOTIMPL;
00847             break;
00848     } // switch: nCommandIDIn
00849
00850     return hr;
00851
00852 } //*** CGroupData::InvokeCommand
00853
00854 /////////////////////////////////////////////////////////////////////////////
00855 // CResData implementation
00856 /////////////////////////////////////////////////////////////////////////////
00857
00858 static CRuntimeClass * g_rgprtcResPSPages[] = {
00859     RUNTIME_CLASS( CFileShareSampleParamsPage ),
00860     NULL
00861     };
00862
00863 /////////////////////////////////////////////////////////////////////////////
00864 //++
00865 //
00866 //  CResData::HrInitialize
00867 //
00868 //  Description:
00869 //      Initializes the object.
00870 //
00871 //  Arguments:
00872 //
00873 //  Return Value:
00874 //
00875 //--
00876 /////////////////////////////////////////////////////////////////////////////
00877 HRESULT
00878 CResData::HrInitialize(
00879     IUnknown * piDataIn
00880     )
00881 {
00882     HRESULT                     hr = S_OK;
00883     IGetClusterResourceInfo *   piResInfo = NULL;
00884     LONG                        cchTypeName = 0;
00885     BSTR                        bstrTypeName = NULL;
00886     LPCWSTR                     pwszResTypes = g_wszResourceTypeNames;
00887
00888     ASSERT( piDataIn != NULL );
00889
00890     //
00891     // Initialize the base class.
00892     //
00893
00894     hr = CObjData::HrInitialize( piDataIn );
00895     if ( FAILED( hr ) )
00896     {
00897         goto Cleanup;
00898     } // if: error initializing the base class
00899
00900     //
00901     // Initialize member variables to default values.
00902     //
00903
00904     m_hResource = NULL;
00905     m_fSupportedType = FALSE;
00906
00907     //
00908     // Set the object type.
00909     //
00910
00911     m_cot = CLUADMEX_OT_RESOURCE;
00912
00913     //
00914     // Set the pointers to our resource property sheet and wizard pages.
00915     //
00916
00917     m_rgprtcPSPages = g_rgprtcResPSPages;
00918     m_rgprtcWizPages = g_rgprtcResPSPages;
00919
00920     //
00921     // Get an interface pointer to IGetClusterResourceInfo.
00922     //
00923
00924     hr = piDataIn->QueryInterface( IID_IGetClusterResourceInfo, reinterpret_cast< LPVOID * >( &piResInfo ) );
00925     if ( FAILED( hr ) )
00926     {
00927         goto Cleanup;
00928     } // if: error querying for interface
00929
00930     //
00931     // Get a copy of the handle.  Don't free this handle, it's just a copy.
00932     //
00933
00934     m_hResource = piResInfo->GetResourceHandle( 0 );
00935     ASSERT( m_hResource != NULL );
00936     if ( m_hResource == NULL )
00937     {
00938         hr = E_HANDLE;
00939         goto Cleanup;
00940     } // if: error querying for interface
00941
00942     //
00943     // Allocate a buffer for and retrieve the resource type name.
00944     //
00945
00946     hr = piResInfo->GetResourceTypeName( 0, NULL, &cchTypeName );
00947     if ( FAILED( hr ) )
00948     {
00949         goto Cleanup;
00950     } // if:
00951
00952     bstrTypeName = SysAllocStringLen( NULL, cchTypeName );
00953     if ( bstrTypeName == NULL )
00954     {
00955         hr = E_OUTOFMEMORY;
00956         goto Cleanup;
00957     } // if:
00958
00959     hr = piResInfo->GetResourceTypeName( 0, bstrTypeName, &cchTypeName );
00960     if ( FAILED( hr ) )
00961     {
00962         goto Cleanup;
00963     } // if:
00964
00965     //
00966     // The CString assignment operator makes a copy.
00967     //
00968
00969     m_strResTypeName = bstrTypeName;
00970
00971     //
00972     // Determine whether this is a supported type.
00973     //
00974
00975     m_fSupportedType = FALSE;
00976     while ( *pwszResTypes != L'\0' )
00977     {
00978         if ( m_strResTypeName.CompareNoCase( pwszResTypes ) == 0 )
00979         {
00980             m_fSupportedType = TRUE;
00981             break;
00982         } // if:
00983
00984         pwszResTypes += lstrlenW( pwszResTypes ) + 1;
00985     }  // while:  more resource types
00986
00987 Cleanup:
00988
00989     if ( piResInfo != NULL )
00990     {
00991         piResInfo->Release();
00992     } // if:
00993
00994     SysFreeString( bstrTypeName );
00995
00996     return hr;
00997
00998 } //*** CResData::HrInitialize
00999
01000 /////////////////////////////////////////////////////////////////////////////
01001 //++
01002 //
01003 //  CResData::AddContextMenuItems
01004 //
01005 //  Description:
01006 //      Add menu items to the resource object context menu.
01007 //
01008 //  Arguments:
01009 //      piCallbackIn
01010 //          Pointer to an IWCContextMenuCallback interface for adding menu
01011 //          items to the context menu.
01012 //
01013 //  Return Value:
01014 //      S_OK
01015 //          Menu items added successfully.
01016 //
01017 //      hr
01018 //          Any errors returned by IWCContextMenuCallback
01019 //          ::AddExtensionMenuItem().
01020 //
01021 //--
01022 /////////////////////////////////////////////////////////////////////////////
01023 HRESULT
01024 CResData::AddContextMenuItems(
01025     IWCContextMenuCallback * piCallbackIn
01026     )
01027 {
01028     HRESULT hr = S_OK;
01029     CLUSTER_RESOURCE_STATE  crs = ClusterResourceStateUnknown;
01030     ULONG                   uFlags = MF_GRAYED;
01031
01032     crs = GetClusterResourceState( m_hResource, NULL, NULL, NULL, NULL );
01033
01034     if ( crs == ClusterResourceOnline )
01035     {
01036         uFlags = MF_ENABLED;
01037     } // if:
01038
01039     hr = AddContextMenuItem(
01040               piCallbackIn
01041             , IDS_RESOURCE_MENU_ITEM_CALL_ISALIVE
01042             , IDS_RESOURCE_MENU_ITEM_CALL_ISALIVE_DESC
01043             , RESOURCE_MENU_ID_1
01044             , uFlags
01045             );
01046
01047     return hr;
01048
01049 } //*** CResData::AddContextMenuItems
01050
01051 /////////////////////////////////////////////////////////////////////////////
01052 //++
01053 //
01054 //  CResData::InvokeCommand
01055 //
01056 //  Description:
01057 //      Invoke a command we added to a context menu.
01058 //
01059 //  Arguments:
01060 //      nCommandIDIn
01061 //          ID of the menu item to execute.  This is the same ID passed to the
01062 //          IWCContextMenuCallback::AddExtensionMenuItem() method.
01063 //
01064 //  Return Value:
01065 //      S_OK        Command invoked successfully.
01066 //      E_NOTIMPL   Command ID not recognized.
01067 //
01068 //--
01069 /////////////////////////////////////////////////////////////////////////////
01070 HRESULT
01071 CResData::InvokeCommand(
01072     ULONG nCommandIDIn
01073     )
01074 {
01075     HRESULT hr = S_OK;
01076     DWORD   sc = ERROR_SUCCESS;
01077     CString str;
01078
01079     switch ( nCommandIDIn )
01080     {
01081         case RESOURCE_MENU_ID_1:
01082             sc = ClusterResourceControl(
01083                       m_hResource
01084                     , NULL
01085                     , CLUSCTL_RESOURCE_FILESHARESAMPLE_CALL_ISALIVE
01086                     , NULL
01087                     , 0
01088                     , NULL
01089                     , 0
01090                     , NULL
01091                     );
01092             if ( sc == ERROR_SUCCESS )
01093             {
01094                 AfxMessageBox( L"Success", MB_OK );
01095             } // if: success
01096             else
01097             {
01098                 if ( sc == ERROR_RESOURCE_FAILED )
01099                 {
01100                     str.Format( L"The health check detected a failure!" );
01101                     AfxMessageBox( str, MB_ICONEXCLAMATION );
01102                 } // if:
01103                 else if ( sc == ERROR_CLUSTER_INVALID_REQUEST )
01104                 {
01105                     str.Format( L"Invalid request - the resource is not online." );
01106                     AfxMessageBox( str, MB_ICONEXCLAMATION );
01107                 } // else if: ERROR_CLUSTER_INVALID_REQUEST
01108                 else
01109                 {
01110                     str.Format( L"Unknown return value: %d", sc );
01111                     AfxMessageBox( str, MB_ICONEXCLAMATION );
01112                 }
01113             } // else: failure
01114
01115             hr = S_OK;
01116             break;
01117
01118         case ALL_RESOURCES_MENU_ID_1:
01119             hr = S_OK;
01120             break;
01121
01122         default:
01123             hr = E_NOTIMPL;
01124             break;
01125     } // switch: nCommandIDIn
01126
01127     return hr;
01128
01129 } //*** CResData::InvokeCommand
01130
01131 /////////////////////////////////////////////////////////////////////////////
01132 //++
01133 //
01134 //  CResData::GetPropertySheetPages
01135 //
01136 //  Description:
01137 //
01138 //  Arguments:
01139 //
01140 //  Return Value:
01141 //      S_OK        Success.
01142 //      E_NOTIMPL   No property sheet pages for this resource.
01143 //
01144 //--
01145 /////////////////////////////////////////////////////////////////////////////
01146 HRESULT
01147 CResData::GetPropertySheetPages(
01148     CRuntimeClass *** ppaPropSheetsOut
01149     )
01150 {
01151     HRESULT hr = E_NOTIMPL;
01152
01153     ASSERT( ppaPropSheetsOut != NULL );
01154
01155     //
01156     // This class only extends File Share Sample resources.
01157     //
01158
01159     if ( m_fSupportedType == FALSE )
01160     {
01161         goto Cleanup;
01162     } // if:
01163
01164     if ( m_rgprtcPSPages != NULL )
01165     {
01166         hr = S_OK;
01167         *ppaPropSheetsOut = m_rgprtcPSPages;
01168     } // if:
01169
01170 Cleanup:
01171
01172     return hr;
01173
01174 } //*** CResData::GetPropertySheetPages
01175
01176 /////////////////////////////////////////////////////////////////////////////
01177 //++
01178 //
01179 //  CResData::GetWizardPages
01180 //
01181 //  Description:
01182 //
01183 //  Arguments:
01184 //
01185 //  Return Value:
01186 //      S_OK        Success.
01187 //      E_NOTIMPL   No property sheet pages for this resource.
01188 //
01189 //--
01190 /////////////////////////////////////////////////////////////////////////////
01191 HRESULT
01192 CResData::GetWizardPages(
01193     CRuntimeClass *** ppaWizardPagesOut
01194     )
01195 {
01196     HRESULT hr = E_NOTIMPL;
01197
01198     ASSERT( ppaWizardPagesOut != NULL );
01199
01200     //
01201     // This class only extends File Share Sample resources.
01202     //
01203
01204     if ( m_fSupportedType == FALSE )
01205     {
01206         goto Cleanup;
01207     } // if:
01208
01209     if ( m_rgprtcWizPages != NULL )
01210     {
01211         hr = S_OK;
01212         *ppaWizardPagesOut = m_rgprtcWizPages;
01213     } // if:
01214
01215 Cleanup:
01216
01217     return hr;
01218
01219 } //*** CResData::GetWizardPages
01220
01221 /////////////////////////////////////////////////////////////////////////////
01222 // CResTypeData implementation
01223 /////////////////////////////////////////////////////////////////////////////
01224
01225 /////////////////////////////////////////////////////////////////////////////
01226 //++
01227 //
01228 //  CResTypeData::HrInitialize
01229 //
01230 //  Description:
01231 //      Initializes the object.
01232 //
01233 //  Arguments:
01234 //
01235 //  Return Value:
01236 //
01237 //--
01238 /////////////////////////////////////////////////////////////////////////////
01239 HRESULT
01240 CResTypeData::HrInitialize(
01241     IUnknown * piDataIn
01242     )
01243 {
01244     HRESULT hr = S_OK;
01245     LPCWSTR pwszResTypes = g_wszResourceTypeNames;
01246
01247     ASSERT( piDataIn != NULL );
01248
01249     //
01250     // Initialize the base class.
01251     //
01252
01253     hr = CObjData::HrInitialize( piDataIn );
01254     if ( FAILED( hr ) )
01255     {
01256         goto Cleanup;
01257     } // if: error initializing the base class
01258
01259     //
01260     // Set the object type.
01261     //
01262
01263     m_cot = CLUADMEX_OT_RESOURCETYPE;
01264
01265     m_fSupportedType = FALSE;
01266     while ( *pwszResTypes != L'\0' )
01267     {
01268         if ( StrName().CompareNoCase( pwszResTypes ) == 0 )
01269         {
01270             m_fSupportedType = TRUE;
01271             break;
01272         } // if:
01273
01274         pwszResTypes += lstrlenW( pwszResTypes ) + 1;
01275     }  // while:  more resource types
01276
01277 Cleanup:
01278
01279     return hr;
01280
01281 } //*** CResTypeData::HrInitialize
01282
01283 /////////////////////////////////////////////////////////////////////////////
01284 //++
01285 //
01286 //  CResTypeData::AddContextMenuItems
01287 //
01288 //  Description:
01289 //      Add menu items to the resource type object context menu.
01290 //
01291 //  Arguments:
01292 //      piCallbackIn
01293 //          Pointer to an IWCContextMenuCallback interface for adding menu
01294 //          items to the context menu.
01295 //
01296 //  Return Value:
01297 //      S_OK
01298 //          Menu items added successfully.
01299 //
01300 //      hr
01301 //          Any errors returned by IWCContextMenuCallback
01302 //          ::AddExtensionMenuItem().
01303 //
01304 //--
01305 /////////////////////////////////////////////////////////////////////////////
01306 HRESULT
01307 CResTypeData::AddContextMenuItems(
01308     IWCContextMenuCallback * piCallbackIn
01309     )
01310 {
01311     HRESULT hr = S_OK;
01312
01313     UNREFERENCED_PARAMETER( piCallbackIn );
01314
01315     return hr;
01316
01317 } //*** CResTypeData::AddContextMenuItems
01318
01319 /////////////////////////////////////////////////////////////////////////////
01320 //++
01321 //
01322 //  CResTypeData::InvokeCommand
01323 //
01324 //  Description:
01325 //      Invoke a command we added to a context menu.
01326 //
01327 //  Arguments:
01328 //      nCommandIDIn
01329 //          ID of the menu item to execute.  This is the same ID passed to the
01330 //          IWCContextMenuCallback::AddExtensionMenuItem() method.
01331 //
01332 //  Return Value:
01333 //      S_OK        Command invoked successfully.
01334 //      E_NOTIMPL   Command ID not recognized.
01335 //
01336 //--
01337 /////////////////////////////////////////////////////////////////////////////
01338 HRESULT
01339 CResTypeData::InvokeCommand(
01340     ULONG nCommandIDIn
01341     )
01342 {
01343     HRESULT hr = S_OK;
01344
01345     switch ( nCommandIDIn )
01346     {
01347         case RESTYPE_MENU_ID_1:
01348
01349             //
01350             //  TODO:  Implement your menu item here
01351             //
01352
01353             hr = S_OK;
01354             break;
01355
01356         case ALL_RESTYPES_MENU_ID_1:
01357             hr = S_OK;
01358             break;
01359
01360         default:
01361             hr = E_NOTIMPL;
01362             break;
01363     } // switch: nCommandIDIn
01364
01365     return hr;
01366
01367 } //*** CResTypeData::InvokeCommand
01368
01369 /////////////////////////////////////////////////////////////////////////////
01370 // CNetworkData implementation
01371 /////////////////////////////////////////////////////////////////////////////
01372
01373 /////////////////////////////////////////////////////////////////////////////
01374 //++
01375 //
01376 //  CNetworkData::HrInitialize
01377 //
01378 //  Description:
01379 //      Initializes the object.
01380 //
01381 //  Arguments:
01382 //
01383 //  Return Value:
01384 //
01385 //--
01386 /////////////////////////////////////////////////////////////////////////////
01387 HRESULT
01388 CNetworkData::HrInitialize(
01389     IUnknown * piDataIn
01390     )
01391 {
01392     HRESULT                     hr = S_OK;
01393     IGetClusterNetworkInfo *    piNetInfo = NULL;
01394
01395     ASSERT( piDataIn != NULL );
01396
01397     //
01398     // Initialize the base class.
01399     //
01400
01401     hr = CObjData::HrInitialize( piDataIn );
01402     if ( FAILED( hr ) )
01403     {
01404         goto Cleanup;
01405     } // if: error initializing the base class
01406
01407     //
01408     // Initialize member variables to default values.
01409     //
01410
01411     m_hNetwork = NULL;
01412
01413     //
01414     // Set the object type.
01415     //
01416
01417     m_cot = CLUADMEX_OT_NETWORK;
01418
01419     //
01420     // Get an interface pointer to IGetClusterNetworkInfo.
01421     //
01422
01423     hr = piDataIn->QueryInterface( IID_IGetClusterNetworkInfo, reinterpret_cast< LPVOID * >( &piNetInfo ) );
01424     if ( FAILED( hr ) )
01425     {
01426         goto Cleanup;
01427     } // if: error querying for interface
01428
01429     //
01430     // Get a copy of the handle.  Don't free this handle - it's just a copy.
01431     //
01432
01433     m_hNetwork = piNetInfo->GetNetworkHandle( 0 );
01434     ASSERT( m_hNetwork != NULL );
01435     if ( m_hNetwork == NULL )
01436     {
01437         hr = E_HANDLE;
01438         goto Cleanup;
01439     } // if: error getting the network handle
01440
01441 Cleanup:
01442
01443     if ( piNetInfo != NULL )
01444     {
01445         piNetInfo->Release();
01446     } // if:
01447
01448     return hr;
01449
01450 } //*** CNetworkData::HrInitialize
01451
01452 /////////////////////////////////////////////////////////////////////////////
01453 //++
01454 //
01455 //  CNetworkData::AddContextMenuItems
01456 //
01457 //  Description:
01458 //      Add menu items to the network object context menu.
01459 //
01460 //  Arguments:
01461 //      piCallbackIn
01462 //          Pointer to an IWCContextMenuCallback interface for adding menu
01463 //          items to the context menu.
01464 //
01465 //  Return Value:
01466 //      S_OK
01467 //          Menu items added successfully.
01468 //
01469 //      hr
01470 //          Any errors returned by IWCContextMenuCallback
01471 //          ::AddExtensionMenuItem().
01472 //
01473 //--
01474 /////////////////////////////////////////////////////////////////////////////
01475 HRESULT CNetworkData::AddContextMenuItems(
01476       IWCContextMenuCallback * piCallbackIn
01477     )
01478 {
01479     HRESULT     hr = S_OK;
01480
01481     ASSERT( piCallbackIn != NULL );
01482
01483     hr = AddContextMenuItem(
01484               piCallbackIn
01485             , IDS_NETWORK_MENU_ITEM_1
01486             , IDS_NETWORK_MENU_ITEM_1_DESC
01487             , NETWORK_MENU_ID_1
01488             , MF_ENABLED
01489             );
01490
01491     return hr;
01492
01493 } //*** CNetworkData::AddContextMenuItems
01494
01495 /////////////////////////////////////////////////////////////////////////////
01496 //++
01497 //
01498 //  CNetworkData::InvokeCommand
01499 //
01500 //  Description:
01501 //      Invoke a command we added to a context menu.
01502 //
01503 //  Arguments:
01504 //      nCommandIDIn
01505 //          ID of the menu item to execute.  This is the same ID passed to the
01506 //          IWCContextMenuCallback::AddExtensionMenuItem() method.
01507 //
01508 //  Return Value:
01509 //      S_OK        Command invoked successfully.
01510 //      E_NOTIMPL   Command ID not recognized.
01511 //
01512 //--
01513 /////////////////////////////////////////////////////////////////////////////
01514 HRESULT
01515 CNetworkData::InvokeCommand(
01516     ULONG nCommandIDIn
01517     )
01518 {
01519     HRESULT hr = S_OK;
01520
01521     switch ( nCommandIDIn )
01522     {
01523         case NETWORK_MENU_ID_1:
01524
01525             //
01526             //  TODO:  Implement your menu item here
01527             //
01528
01529             hr = S_OK;
01530             break;
01531
01532         default:
01533             hr = E_NOTIMPL;
01534             break;
01535     } // switch: nCommandIDIn
01536
01537     return hr;
01538
01539 } //*** CNetworkData::InvokeCommand
01540
01541 /////////////////////////////////////////////////////////////////////////////
01542 // CNetInterfaceData implementation
01543 /////////////////////////////////////////////////////////////////////////////
01544
01545 /////////////////////////////////////////////////////////////////////////////
01546 //++
01547 //
01548 //  CNetInterfaceData::HrInitialize
01549 //
01550 //  Description:
01551 //      Initializes the object.
01552 //
01553 //  Arguments:
01554 //
01555 //  Return Value:
01556 //
01557 //--
01558 /////////////////////////////////////////////////////////////////////////////
01559 HRESULT
01560 CNetInterfaceData::HrInitialize(
01561     IUnknown * piDataIn
01562     )
01563 {
01564     HRESULT                         hr = S_OK;
01565     IGetClusterNetInterfaceInfo *   piNetInterfaceInfo = NULL;
01566
01567     ASSERT( piDataIn != NULL );
01568
01569     //
01570     // Initialize the base class.
01571     //
01572
01573     hr = CObjData::HrInitialize( piDataIn );
01574     if ( FAILED( hr ) )
01575     {
01576         goto Cleanup;
01577     } // if: error initializing the base class
01578
01579     //
01580     // Initialize member variables to default values.
01581     //
01582
01583     m_hNetInterface = NULL;
01584
01585     //
01586     // Set the object type.
01587     //
01588
01589     m_cot = CLUADMEX_OT_NETINTERFACE;
01590
01591     //
01592     // Get an interface pointer to IGetClusterNetInterfaceInfo.
01593     //
01594
01595     hr = piDataIn->QueryInterface( IID_IGetClusterNetInterfaceInfo, reinterpret_cast< LPVOID * >( &piNetInterfaceInfo ) );
01596     if ( FAILED( hr ) )
01597     {
01598         goto Cleanup;
01599     } // if: error querying for interface
01600
01601     //
01602     // Get a copy of the handle.  Don't free this handle - it's just a copy.
01603     //
01604
01605     m_hNetInterface = piNetInterfaceInfo->GetNetInterfaceHandle( 0 );
01606     ASSERT( m_hNetInterface != NULL );
01607     if ( m_hNetInterface == NULL )
01608     {
01609         hr = E_HANDLE;
01610         goto Cleanup;
01611     } // if: error getting the netinterface handle
01612
01613 Cleanup:
01614
01615     if ( piNetInterfaceInfo != NULL )
01616     {
01617         piNetInterfaceInfo->Release();
01618     } // if:
01619
01620     return hr;
01621
01622 } //*** CNetInterfaceData::HrInitialize
01623
01624 /////////////////////////////////////////////////////////////////////////////
01625 //++
01626 //
01627 //  CNetInterfaceData::AddContextMenuItems
01628 //
01629 //  Description:
01630 //      Add menu items to the network interface object context menu.
01631 //
01632 //  Arguments:
01633 //      piCallbackIn
01634 //          Pointer to an IWCContextMenuCallback interface for adding menu
01635 //          items to the context menu.
01636 //
01637 //  Return Value:
01638 //      S_OK
01639 //          Menu items added successfully.
01640 //
01641 //      hr
01642 //          Any errors returned by IWCContextMenuCallback
01643 //          ::AddExtensionMenuItem().
01644 //
01645 //--
01646 /////////////////////////////////////////////////////////////////////////////
01647 HRESULT
01648 CNetInterfaceData::AddContextMenuItems(
01649     IWCContextMenuCallback * piCallbackIn
01650     )
01651 {
01652     HRESULT hr = S_OK;
01653
01654     ASSERT( piCallbackIn != NULL );
01655
01656     hr = AddContextMenuItem(
01657               piCallbackIn
01658             , IDS_NETINTERFACE_MENU_ITEM_1
01659             , IDS_NETINTERFACE_MENU_ITEM_1_DESC
01660             , NETINTERFACE_MENU_ID_1
01661             , MF_ENABLED
01662             );
01663
01664     return hr;
01665
01666 } //*** CNetInterfaceData::AddContextMenuItems
01667
01668 /////////////////////////////////////////////////////////////////////////////
01669 //++
01670 //
01671 //  CNetInterfaceData::InvokeCommand
01672 //
01673 //  Description:
01674 //      Invoke a command we added to a context menu.
01675 //
01676 //  Arguments:
01677 //      nCommandIDIn
01678 //          ID of the menu item to execute.  This is the same ID passed to the
01679 //          IWCContextMenuCallback::AddExtensionMenuItem() method.
01680 //
01681 //  Return Value:
01682 //      S_OK        Command invoked successfully.
01683 //      E_NOTIMPL   Command ID not recognized.
01684 //
01685 //--
01686 /////////////////////////////////////////////////////////////////////////////
01687 HRESULT
01688 CNetInterfaceData::InvokeCommand(
01689     ULONG nCommandIDIn
01690     )
01691 {
01692     HRESULT hr = S_OK;
01693
01694     switch ( nCommandIDIn )
01695     {
01696         case NETINTERFACE_MENU_ID_1:
01697
01698             //
01699             //  TODO:  Implement your menu item here
01700             //
01701
01702             hr = S_OK;
01703             break;
01704
01705         default:
01706             hr = E_NOTIMPL;
01707             break;
01708     } // switch: nCommandIDIn
01709
01710     return hr;
01711
01712 } //*** CNetInterfaceData::InvokeCommand
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IISSearch/AdoVbs.Inc Source File

  • WinBase
  • Indexing
  • IISSearch

AdoVbs.Inc

Go to the documentation of this file.
00001 <%
00002 '--------------------------------------------------------------------
00003 ' Microsoft ADO
00004 '
00005 ' (c) 1996 Microsoft Corporation.  All Rights Reserved.
00006 '
00007 '
00008 '
00009 ' ADO constants include file for VBScript
00010 '
00011 '--------------------------------------------------------------------
00012
00013 '---- CursorTypeEnum Values ----
00014 Const adOpenForwardOnly = 0
00015 Const adOpenKeyset = 1
00016 Const adOpenDynamic = 2
00017 Const adOpenStatic = 3
00018
00019 '---- CursorOptionEnum Values ----
00020 Const adHoldRecords = &H00000100
00021 Const adMovePrevious = &H00000200
00022 Const adAddNew = &H01000400
00023 Const adDelete = &H01000800
00024 Const adUpdate = &H01008000
00025 Const adBookmark = &H00002000
00026 Const adApproxPosition = &H00004000
00027 Const adUpdateBatch = &H00010000
00028 Const adResync = &H00020000
00029 Const adNotify = &H00040000
00030
00031 '---- LockTypeEnum Values ----
00032 Const adLockReadOnly = 1
00033 Const adLockPessimistic = 2
00034 Const adLockOptimistic = 3
00035 Const adLockBatchOptimistic = 4
00036
00037 '---- ExecuteOptionEnum Values ----
00038 Const adRunAsync = &H00000010
00039
00040 '---- ObjectStateEnum Values ----
00041 Const adStateClosed = &H00000000
00042 Const adStateOpen = &H00000001
00043 Const adStateConnecting = &H00000002
00044 Const adStateExecuting = &H00000004
00045
00046 '---- CursorLocationEnum Values ----
00047 Const adUseNone = 1
00048 Const adUseServer = 2
00049 Const adUseClient = 3
00050 Const adUseClientBatch = 3
00051
00052 '---- DataTypeEnum Values ----
00053 Const adEmpty = 0
00054 Const adTinyInt = 16
00055 Const adSmallInt = 2
00056 Const adInteger = 3
00057 Const adBigInt = 20
00058 Const adUnsignedTinyInt = 17
00059 Const adUnsignedSmallInt = 18
00060 Const adUnsignedInt = 19
00061 Const adUnsignedBigInt = 21
00062 Const adSingle = 4
00063 Const adDouble = 5
00064 Const adCurrency = 6
00065 Const adDecimal = 14
00066 Const adNumeric = 131
00067 Const adBoolean = 11
00068 Const adError = 10
00069 Const adUserDefined = 132
00070 Const adVariant = 12
00071 Const adIDispatch = 9
00072 Const adIUnknown = 13
00073 Const adGUID = 72
00074 Const adDate = 7
00075 Const adDBDate = 133
00076 Const adDBTime = 134
00077 Const adDBTimeStamp = 135
00078 Const adBSTR = 8
00079 Const adChar = 129
00080 Const adVarChar = 200
00081 Const adLongVarChar = 201
00082 Const adWChar = 130
00083 Const adVarWChar = 202
00084 Const adLongVarWChar = 203
00085 Const adBinary = 128
00086 Const adVarBinary = 204
00087 Const adLongVarBinary = 205
00088
00089 '---- FieldAttributeEnum Values ----
00090 Const adFldMayDefer = &H00000002
00091 Const adFldUpdatable = &H00000004
00092 Const adFldUnknownUpdatable = &H00000008
00093 Const adFldFixed = &H00000010
00094 Const adFldIsNullable = &H00000020
00095 Const adFldMayBeNull = &H00000040
00096 Const adFldLong = &H00000080
00097 Const adFldRowID = &H00000100
00098 Const adFldRowVersion = &H00000200
00099 Const adFldCacheDeferred = &H00001000
00100
00101 '---- EditModeEnum Values ----
00102 Const adEditNone = &H0000
00103 Const adEditInProgress = &H0001
00104 Const adEditAdd = &H0002
00105
00106 '---- RecordStatusEnum Values ----
00107 Const adRecOK = &H0000000
00108 Const adRecNew = &H0000001
00109 Const adRecModified = &H0000002
00110 Const adRecDeleted = &H0000004
00111 Const adRecUnmodified = &H0000008
00112 Const adRecInvalid = &H0000010
00113 Const adRecMultipleChanges = &H0000040
00114 Const adRecPendingChanges = &H0000080
00115 Const adRecCanceled = &H0000100
00116 Const adRecCantRelease = &H0000400
00117 Const adRecConcurrencyViolation = &H0000800
00118 Const adRecIntegrityViolation = &H0001000
00119 Const adRecMaxChangesExceeded = &H0002000
00120 Const adRecObjectOpen = &H0004000
00121 Const adRecOutOfMemory = &H0008000
00122 Const adRecPermissionDenied = &H0010000
00123 Const adRecSchemaViolation = &H0020000
00124 Const adRecDBDeleted = &H0040000
00125
00126 '---- GetRowsOptionEnum Values ----
00127 Const adGetRowsRest = -1
00128
00129 '---- PositionEnum Values ----
00130 Const adPosUnknown = -1
00131 Const adPosBOF = -2
00132 Const adPosEOF = -3
00133
00134 '---- enum Values ----
00135 Const adBookmarkCurrent = 0
00136 Const adBookmarkFirst = 1
00137 Const adBookmarkLast = 2
00138
00139 '---- MarshalOptionsEnum Values ----
00140 Const adMarshalAll = 0
00141 Const adMarshalModifiedOnly = 1
00142
00143 '---- AffectEnum Values ----
00144 Const adAffectCurrent = 1
00145 Const adAffectGroup = 2
00146 Const adAffectAll = 3
00147
00148 '---- FilterGroupEnum Values ----
00149 Const adFilterNone = 0
00150 Const adFilterPendingRecords = 1
00151 Const adFilterAffectedRecords = 2
00152 Const adFilterFetchedRecords = 3
00153 Const adFilterPredicate = 4
00154
00155 '---- SearchDirection Values ----
00156 Const adSearchForward = 0
00157 Const adSearchBackward = 1
00158
00159 '---- ConnectPromptEnum Values ----
00160 Const adPromptAlways = 1
00161 Const adPromptComplete = 2
00162 Const adPromptCompleteRequired = 3
00163 Const adPromptNever = 4
00164
00165 '---- ConnectModeEnum Values ----
00166 Const adModeUnknown = 0
00167 Const adModeRead = 1
00168 Const adModeWrite = 2
00169 Const adModeReadWrite = 3
00170 Const adModeShareDenyRead = 4
00171 Const adModeShareDenyWrite = 8
00172 Const adModeShareExclusive = &Hc
00173 Const adModeShareDenyNone = &H10
00174
00175 '---- IsolationLevelEnum Values ----
00176 Const adXactUnspecified = &Hffffffff
00177 Const adXactChaos = &H00000010
00178 Const adXactReadUncommitted = &H00000100
00179 Const adXactBrowse = &H00000100
00180 Const adXactCursorStability = &H00001000
00181 Const adXactReadCommitted = &H00001000
00182 Const adXactRepeatableRead = &H00010000
00183 Const adXactSerializable = &H00100000
00184 Const adXactIsolated = &H00100000
00185
00186 '---- XactAttributeEnum Values ----
00187 Const adXactCommitRetaining = &H00020000
00188 Const adXactAbortRetaining = &H00040000
00189
00190 '---- PropertyAttributesEnum Values ----
00191 Const adPropNotSupported = &H0000
00192 Const adPropRequired = &H0001
00193 Const adPropOptional = &H0002
00194 Const adPropRead = &H0200
00195 Const adPropWrite = &H0400
00196
00197 '---- ErrorValueEnum Values ----
00198 Const adErrInvalidArgument = &Hbb9
00199 Const adErrNoCurrentRecord = &Hbcd
00200 Const adErrIllegalOperation = &Hc93
00201 Const adErrInTransaction = &Hcae
00202 Const adErrFeatureNotAvailable = &Hcb3
00203 Const adErrItemNotFound = &Hcc1
00204 Const adErrObjectInCollection = &Hd27
00205 Const adErrObjectNotSet = &Hd5c
00206 Const adErrDataConversion = &Hd5d
00207 Const adErrObjectClosed = &He78
00208 Const adErrObjectOpen = &He79
00209 Const adErrProviderNotFound = &He7a
00210 Const adErrBoundToCommand = &He7b
00211 Const adErrInvalidParamInfo = &He7c
00212 Const adErrInvalidConnection = &He7d
00213 Const adErrStillExecuting = &He7f
00214 Const adErrStillConnecting = &He81
00215
00216 '---- ParameterAttributesEnum Values ----
00217 Const adParamSigned = &H0010
00218 Const adParamNullable = &H0040
00219 Const adParamLong = &H0080
00220
00221 '---- ParameterDirectionEnum Values ----
00222 Const adParamUnknown = &H0000
00223 Const adParamInput = &H0001
00224 Const adParamOutput = &H0002
00225 Const adParamInputOutput = &H0003
00226 Const adParamReturnValue = &H0004
00227
00228 '---- CommandTypeEnum Values ----
00229 Const adCmdUnknown = &H0008
00230 Const adCmdText = &H0001
00231 Const adCmdTable = &H0002
00232 Const adCmdStoredProc = &H0004
00233
00234 '---- SchemaEnum Values ----
00235 Const adSchemaProviderSpecific = -1
00236 Const adSchemaAsserts = 0
00237 Const adSchemaCatalogs = 1
00238 Const adSchemaCharacterSets = 2
00239 Const adSchemaCollations = 3
00240 Const adSchemaColumns = 4
00241 Const adSchemaCheckConstraints = 5
00242 Const adSchemaConstraintColumnUsage = 6
00243 Const adSchemaConstraintTableUsage = 7
00244 Const adSchemaKeyColumnUsage = 8
00245 Const adSchemaReferentialContraints = 9
00246 Const adSchemaTableConstraints = 10
00247 Const adSchemaColumnsDomainUsage = 11
00248 Const adSchemaIndexes = 12
00249 Const adSchemaColumnPrivileges = 13
00250 Const adSchemaTablePrivileges = 14
00251 Const adSchemaUsagePrivileges = 15
00252 Const adSchemaProcedures = 16
00253 Const adSchemaSchemata = 17
00254 Const adSchemaSQLLanguages = 18
00255 Const adSchemaStatistics = 19
00256 Const adSchemaTables = 20
00257 Const adSchemaTranslations = 21
00258 Const adSchemaProviderTypes = 22
00259 Const adSchemaViews = 23
00260 Const adSchemaViewColumnUsage = 24
00261 Const adSchemaViewTableUsage = 25
00262 Const adSchemaProcedureParameters = 26
00263 Const adSchemaForeignKeys = 27
00264 Const adSchemaPrimaryKeys = 28
00265 Const adSchemaProcedureColumns = 29
00266 %>
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/basesnap.Cpp Source File

  • SysMgmt
  • MMC
  • CMenuExt

basesnap.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <olectl.h>
00021 #include <initguid.h>
00022 #include "globals.h"
00023 #include "resource.h"
00024 #include "guids.h"
00025 #include "basesnap.h"
00026 #include "CMenuExt.h"
00027 #include "About.h"
00028 #include "Registry.h"
00029 #include "Extend.h"
00030
00031 // our globals
00032 HINSTANCE g_hinst;
00033
00034
00035 BOOL WINAPI DllMain(HINSTANCE hinstDLL,
00036                     DWORD fdwReason,
00037                     void* lpvReserved)
00038 {
00039
00040     if (fdwReason == DLL_PROCESS_ATTACH) {
00041         g_hinst = hinstDLL;
00042     }
00043
00044     return TRUE;
00045 }
00046
00047
00048 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
00049 {
00050     if ((rclsid != CLSID_CContextMenuExtension) && (rclsid != CLSID_CSnapinAbout))
00051         return CLASS_E_CLASSNOTAVAILABLE;
00052
00053
00054     if (!ppvObj)
00055         return E_FAIL;
00056
00057     *ppvObj = NULL;
00058
00059     // We can only hand out IUnknown and IClassFactory pointers.  Fail
00060     // if they ask for anything else.
00061     if (!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00062         return E_NOINTERFACE;
00063
00064     CClassFactory *pFactory = NULL;
00065
00066     // make the factory passing in the creation function for the type of object they want
00067     if (rclsid == CLSID_CContextMenuExtension)
00068         pFactory = new CClassFactory(CClassFactory::CONTEXTEXTENSION);
00069     else if (rclsid == CLSID_CSnapinAbout)
00070         pFactory = new CClassFactory(CClassFactory::ABOUT);
00071
00072     if (NULL == pFactory)
00073         return E_OUTOFMEMORY;
00074
00075     HRESULT hr = pFactory->QueryInterface(riid, ppvObj);
00076
00077     return hr;
00078 }
00079
00080 STDAPI DllCanUnloadNow(void)
00081 {
00082     if (g_uObjects == 0 && g_uSrvLock == 0)
00083         return S_OK;
00084     else
00085         return S_FALSE;
00086 }
00087
00088
00089 CClassFactory::CClassFactory(FACTORY_TYPE factoryType)
00090 : m_cref(0), m_factoryType(factoryType)
00091 {
00092     OBJECT_CREATED
00093 }
00094
00095 CClassFactory::~CClassFactory()
00096 {
00097     OBJECT_DESTROYED
00098 }
00099
00100 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv)
00101 {
00102     if (!ppv)
00103         return E_FAIL;
00104
00105     *ppv = NULL;
00106
00107     if (IsEqualIID(riid, IID_IUnknown))
00108         *ppv = static_cast<IClassFactory *>(this);
00109     else
00110         if (IsEqualIID(riid, IID_IClassFactory))
00111             *ppv = static_cast<IClassFactory *>(this);
00112
00113         if (*ppv)
00114         {
00115             reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00116             return S_OK;
00117         }
00118
00119         return E_NOINTERFACE;
00120 }
00121
00122 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00123 {
00124     return InterlockedIncrement((LONG *)&m_cref);
00125 }
00126
00127 STDMETHODIMP_(ULONG) CClassFactory::Release()
00128 {
00129     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00130     {
00131         delete this;
00132         return 0;
00133     }
00134     return m_cref;
00135 }
00136
00137 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj)
00138 {
00139     HRESULT  hr;
00140     void* pObj;
00141
00142     if (!ppvObj)
00143         return E_FAIL;
00144
00145     *ppvObj = NULL;
00146
00147     // Our object does does not support aggregation, so we need to
00148     // fail if they ask us to do aggregation.
00149     if (pUnkOuter)
00150         return CLASS_E_NOAGGREGATION;
00151
00152     if (CONTEXTEXTENSION == m_factoryType) {
00153         pObj = new CContextMenuExtension();
00154     } else {
00155         pObj = new CSnapinAbout();
00156     }
00157
00158     if (!pObj)
00159         return E_OUTOFMEMORY;
00160
00161     // QueryInterface will do the AddRef() for us, so we do not
00162     // do it in this function
00163     hr = ((LPUNKNOWN)pObj)->QueryInterface(riid, ppvObj);
00164
00165     if (FAILED(hr))
00166         delete pObj;
00167
00168     return hr;
00169 }
00170
00171 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00172 {
00173     if (fLock)
00174         InterlockedIncrement((LONG *)&g_uSrvLock);
00175     else
00176         InterlockedDecrement((LONG *)&g_uSrvLock);
00177
00178     return S_OK;
00179 }
00180
00181 //////////////////////////////////////////////////////////
00182 //
00183 // Exported functions
00184 //
00185
00186
00187 //
00188 // Server registration
00189 //
00190 STDAPI DllRegisterServer()
00191 {
00192     HRESULT hr = SELFREG_E_CLASS;
00193
00194     _TCHAR szName[256];
00195     _TCHAR szSnapInName[256];
00196
00197     LoadString(g_hinst, IDS_NAME, szName, (sizeof szName)/(sizeof szName[0]));
00198     LoadString(g_hinst, IDS_SNAPINNAME, szSnapInName, (sizeof szSnapInName)/(sizeof szSnapInName[0]));
00199
00200     _TCHAR szAboutName[256];
00201
00202     LoadString(g_hinst, IDS_ABOUTNAME, szAboutName, (sizeof szAboutName)/(sizeof szAboutName[0]));
00203
00204
00205     // register our CoClasses
00206     hr = RegisterServer(g_hinst,
00207         CLSID_CContextMenuExtension,
00208         szName);
00209
00210     if SUCCEEDED(hr)
00211         hr = RegisterServer(g_hinst,
00212         CLSID_CSnapinAbout,
00213         szAboutName);
00214
00215     // place the registry information for SnapIns
00216     if SUCCEEDED(hr)
00217         hr = RegisterSnapin(CLSID_CContextMenuExtension, szSnapInName, CLSID_CSnapinAbout);
00218
00219     return hr;
00220 }
00221
00222
00223 STDAPI DllUnregisterServer()
00224 {
00225     if (UnregisterServer(CLSID_CContextMenuExtension) == S_OK)
00226         return UnregisterSnapin(CLSID_CContextMenuExtension);
00227     else
00228         return E_FAIL;
00229 }
00230
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/PerfUtil.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen

PerfUtil.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 Copyright 1995 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     perfutil.h
00008
00009 Abstract:
00010
00011     This file supports routines used to parse and
00012     create Performance Monitor Data Structures.
00013     It actually supports Performance Object types with
00014     multiple instances
00015
00016 Author:
00017
00018     Bob Watson  28-Jul-1995
00019
00020 Revision History:
00021
00022
00023 --*/
00024 #ifndef _PERFUTIL_H_
00025 #define _PERFUTIL_H_
00026
00027 // enable this define to log process heap data to the event log
00028 #ifdef PROBE_HEAP_USAGE
00029 #undef PROBE_HEAP_USAGE
00030 #endif
00031 //
00032 //  Utility macro.  This is used to reserve a DWORD multiple of
00033 //  bytes for Unicode strings embedded in the definitional data,
00034 //  viz., object instance names.
00035 //
00036 #define DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))
00037
00038 //    (assumes dword is 4 bytes long and pointer is a dword in size)
00039 #define ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))
00040
00041 extern WCHAR  GLOBAL_STRING[];      // Global command (get all local ctrs)
00042 extern WCHAR  FOREIGN_STRING[];           // get data from foreign computers
00043 extern WCHAR  COSTLY_STRING[];
00044 extern WCHAR  NULL_STRING[];
00045
00046 #define QUERY_GLOBAL    1
00047 #define QUERY_ITEMS     2
00048 #define QUERY_FOREIGN   3
00049 #define QUERY_COSTLY    4
00050
00051 //
00052 // The definition of the only routine of perfutil.c, It builds part of a
00053 // performance data instance (PERF_INSTANCE_DEFINITION) as described in
00054 // winperf.h
00055 //
00056
00057 HANDLE MonOpenEventLog ();
00058 VOID MonCloseEventLog ();
00059 DWORD GetQueryType (IN LPWSTR);
00060 BOOL IsNumberInUnicodeList (DWORD, LPWSTR);
00061
00062 BOOL
00063 MonBuildInstanceDefinition(
00064     PERF_INSTANCE_DEFINITION *pBuffer,
00065     PVOID *pBufferNext,
00066     DWORD ParentObjectTitleIndex,
00067     DWORD ParentObjectInstance,
00068     DWORD UniqueID,
00069     LPWSTR Name
00070     );
00071
00072 typedef struct _LOCAL_HEAP_INFO_BLOCK {
00073     DWORD   AllocatedEntries;
00074     DWORD   AllocatedBytes;
00075     DWORD   FreeEntries;
00076     DWORD   FreeBytes;
00077 } LOCAL_HEAP_INFO, *PLOCAL_HEAP_INFO;
00078
00079
00080 //
00081 //  Memory Probe macro
00082 //
00083 #ifdef PROBE_HEAP_USAGE
00084
00085 #define HEAP_PROBE()    { \
00086     DWORD   dwHeapStatus[5]; \
00087     NTSTATUS CallStatus; \
00088     dwHeapStatus[4] = __LINE__; \
00089     if (!(CallStatus = memprobe (dwHeapStatus, 16L, NULL))) { \
00090         REPORT_INFORMATION_DATA (TCP_HEAP_STATUS, LOG_DEBUG,    \
00091             &dwHeapStatus, sizeof(dwHeapStatus));  \
00092     } else {  \
00093         REPORT_ERROR_DATA (TCP_HEAP_STATUS_ERROR, LOG_DEBUG, \
00094             &CallStatus, sizeof (DWORD)); \
00095     } \
00096 }
00097
00098 #else
00099
00100 #define HEAP_PROBE()    ;
00101
00102 #endif
00103
00104 #endif  //_PERFUTIL_H_
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EdAnnotator/AnnotatorProject/EDAnnotator.idl Source File

  • Web
  • Browser
  • EdAnnotator
  • AnnotatorProject

EDAnnotator.idl

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // EDAnnotator.idl : IDL source for EDAnnotator.dll
00006 //
00007
00008 // This file will be processed by the MIDL tool to
00009 // produce the type library (EDAnnotator.tlb) and marshalling code.
00010
00011 import "oaidl.idl";
00012 import "ocidl.idl";
00013 import "mshtml.idl";
00014 #include "olectl.h"
00015
00016
00017     [
00018         object,
00019         uuid(FB422822-6FA5-4B38-9E17-F28AFFEB6E10),
00020         dual,
00021         helpstring("IAnnotator Interface"),
00022         pointer_default(unique)
00023     ]
00024     interface IAnnotator : IDispatch
00025     {
00026         [id(1), helpstring("method AttachAnnotator")] HRESULT AttachAnnotator(IHTMLDocument2* pDoc);
00027         [id(2), helpstring("method DetachAnnotator")] HRESULT DetachAnnotator();
00028         [id(3), helpstring("method ShowCommentGlyphs")] HRESULT ShowCommentGlyphs(BOOL bShow);
00029     [id(4), helpstring("method AddComment")] HRESULT AddComment();
00030     };
00031
00032 [
00033     uuid(2486B506-7D8E-4D43-A94B-CDF663E8F5FC),
00034     version(1.0),
00035     helpstring("EDAnnotator 1.0 Type Library")
00036 ]
00037 library EDANNOTATORLib
00038 {
00039     importlib("stdole32.tlb");
00040     importlib("stdole2.tlb");
00041
00042     [
00043         uuid(9790C4C2-7BFF-49C1-9439-068EE3B8DC22),
00044         helpstring("Annotator Class")
00045     ]
00046     coclass Annotator
00047     {
00048         [default] interface IAnnotator;
00049     };
00050 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/resource.h Source File

  • SysMgmt
  • MMC
  • Nodes

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDB_SMOPEN                      111
00012 #define IDB_SMBMP                       112
00013 #define IDB_LGBMP                       113
00014 #define IDR_SMICONS                     120
00015 #define IDR_LGICONS                     121
00016 #define IDB_ROCKET                      40004
00017 #define IDB_CAR                         40005
00018 #define IDB_PLANE                       40006
00019 #define IDB_BIKE                        40007
00020 #define IDB_ROCKET2                     40008
00021 #define IDB_CAR2                        40009
00022 #define IDB_PLANE2                      40010
00023 #define IDB_BIKE2                       40011
00024 #define IDB_CLOSED2                     40012
00025 #define IDB_OPEN2                       40013
00026 #define IDB_CLOSED                      40014
00027 #define IDB_OPEN                        40015
00028
00029 // Next default values for new objects
00030 //
00031 #ifdef APSTUDIO_INVOKED
00032 #ifndef APSTUDIO_READONLY_SYMBOLS
00033 #define _APS_NEXT_RESOURCE_VALUE        114
00034 #define _APS_NEXT_COMMAND_VALUE         40016
00035 #define _APS_NEXT_CONTROL_VALUE         1000
00036 #define _APS_NEXT_SYMED_VALUE           101
00037 #endif
00038 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/stdafx.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

stdafx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #define INITGUID
00008
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HTTP_REQUEST_RANGE Member List

This is the complete list of members for HTTP_REQUEST_RANGE, including all inherited members.
dwOffset | HTTP_REQUEST_RANGE
dwSize | HTTP_REQUEST_RANGE
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/printjob.h Source File

  • Multimedia
  • Gdi
  • PrintJob

printjob.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 *  PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   PrintJob.H
00010 *
00011 *   PURPOSE:    Declares exported functions and exported callbacks
00012 *             See PrintJob.C for general comments
00013 *
00014 ******************************************************************************/
00015
00016
00017
00018 /* windows callbacks */
00019
00020 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00021
00022
00023 /* window management */
00024
00025 BOOL    CenterWindow (HWND hwndChild, HWND hwndParent);
00026
00027
00028 /* end of header file PrintJob.H */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Sockdup/Sockdups.c Source File

  • NetDS
  • WinSock
  • Sockdup

Sockdups.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1993 - 2000  Microsoft Corporation.
00007 // All Rights Reserved.
00008 //
00009 // Abstract:
00010 //
00011 //    The SOCKDUP sample demonstrates the basics of shared socket
00012 //    programming in Winsock 2 using WSADuplicateSocket and WSASocket.
00013 //    The parent and child processes use memory mapped files to exchange
00014 //    the socket protocol information (WSAPROTOCOL_INFO) needed
00015 //    to duplicate the socket in the child process.
00016 //
00017 //    The server application can function as either the parent
00018 //    or a child.  The parent accepts each client connection request
00019 //    and dispatches a child process to handle the actual I/O for
00020 //    the connection.  After a child process is successfully created,
00021 //    the parent is free to handle other client connection requests.
00022 //
00023 // Written By:    Mike Liu
00024 //
00025
00026 #ifdef _IA64_
00027   #pragma warning(disable:4127 4706 4267)
00028 #endif
00029
00030 #ifndef WIN32_LEAN_AND_MEAN
00031 #define WIN32_LEAN_AND_MEAN
00032 #endif
00033
00034 #include <winsock2.h>
00035 #include <ws2tcpip.h>
00036 #include <wspiapi.h>
00037 #include <stdio.h>
00038 #include <stdlib.h>
00039 #include <conio.h>
00040
00041 char *DEFAULT_PORT                  = "8765";
00042 const char FILE_MAPPING_BASE_NAME[] = "/MAPPED_FILE/WSADuplicateSocket";
00043 const char PARENT[]                 = "parent";
00044 const char CHILD[]                  = "child";
00045 static int nChildProcCount          = 0;
00046 SOCKET gsListen                     = INVALID_SOCKET;
00047 SOCKET gsAccept                     = INVALID_SOCKET;
00048 HANDLE ghParentFileMappingEvent     = NULL;
00049 HANDLE ghChildFileMappingEvent      = NULL;
00050 HANDLE ghMMFileMap                  = NULL;;
00051
00052 void Usage(char *szProgramName)
00053 {
00054    fprintf(stderr, "Usage: %s [-e Endpoint] [-i IPAddress]\n\n", szProgramName);
00055    fprintf(stderr, "   Endpoint:  port to listen on (default %s)\n", DEFAULT_PORT);
00056    fprintf(stderr, "   IPAddress: IP address to bind to (default INADDR_ANY)\n");
00057 }
00058
00059 /*
00060     Prints the given socket address in a printable string format.
00061 */
00062 void PrintAddressString(LPSOCKADDR pSockAddr, DWORD dwSockAddrLen)
00063 {
00064     // INET6_ADDRSTRLEN is the maximum size of a valid IPv6 address
00065     // including port,colons,NULL,etc.
00066     char buf[INET6_ADDRSTRLEN];
00067     DWORD dwBufSize = 0;
00068
00069     memset(buf,0,sizeof(buf));
00070     dwBufSize = sizeof(buf);
00071
00072     // This function converts the pSockAddr to a printable format into buf.
00073     if (WSAAddressToString(pSockAddr,
00074                            dwSockAddrLen,
00075                            NULL,
00076                            buf,
00077                            &dwBufSize) == SOCKET_ERROR)
00078     {
00079         printf("ERROR: WSAAddressToString failed %d \n", WSAGetLastError());
00080         goto CLEANUP;
00081     }
00082
00083     printf("%s\n", buf);
00084
00085 CLEANUP:
00086     return;
00087 }
00088
00089 BOOL ConsoleCtrlHandler(DWORD dwEvent);
00090 void DoCleanup(void);
00091 void DoParent(char *pszIPAdress, char *szPort, char *pszChildProcName);
00092 void DoChild(char *pszChildFileMappingObj);
00093 BOOL DispatchChild(SOCKET ClientSock, char *ChildProcName);
00094 SOCKET GetSocket(char *szFileMappingObj);
00095 BOOL DoGracefulShutdown(SOCKET sock);
00096
00097 int __cdecl main(int argc, char **argv)
00098 {
00099    char *pszIPAdress = NULL;
00100    char *pszPort = DEFAULT_PORT;
00101    char *pszChildFileMappingObj = NULL;
00102    WSADATA wsaData;
00103    BOOL bParent = TRUE;
00104    int nStatus;
00105
00106    if (argc > 1)
00107    {
00108       int i;
00109
00110       for(i = 1; i < argc; i++)
00111       {
00112          if ((argv[i][0] == '-') || (argv[i][0] == '/'))
00113          {
00114             switch(tolower(argv[i][1]))
00115             {
00116                case 'c':
00117                   bParent = FALSE;
00118                   if (i + 1 < argc)
00119                     pszChildFileMappingObj = argv[++i];
00120                   break;
00121                case 'i':
00122                   if (i + 1 < argc)
00123                     pszIPAdress = argv[++i];
00124                   break;
00125                case 'e':
00126                   if (i + 1 < argc)
00127                     pszPort = argv[++i];
00128                   break;
00129                default:
00130                   Usage(argv[0]);
00131                   exit(1);
00132             }
00133          }
00134          else
00135          {
00136             Usage(argv[0]);
00137             exit(1);
00138          }
00139       }
00140    }
00141
00142    if ((nStatus = WSAStartup(0x202,&wsaData)) != 0)
00143    {
00144       fprintf(stderr, "\nWinsock 2 DLL initialization failed: %d\n", nStatus);
00145       WSACleanup();
00146       exit(-1);
00147    }
00148
00149    if (bParent) // Run as parent
00150       DoParent(pszIPAdress, pszPort, argv[0]);
00151    else    // Run as child
00152       DoChild(pszChildFileMappingObj);
00153
00154    WSACleanup();
00155
00156    return 0;
00157 }
00158
00159
00160 void DoParent(char *pszIPAddress, char *pszPort, char *pszChildProcName)
00161 {
00162    int nFromLen;
00163    SOCKADDR_STORAGE saFrom;
00164    DWORD dwProcID;
00165    struct addrinfo hints;
00166    struct addrinfo *res;
00167    struct addrinfo *pAddr;
00168    int i;
00169
00170    // Install the CTRL+BREAK and CTRL+C Handler
00171    if (SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleCtrlHandler,
00172                              TRUE)
00173                             == FALSE)
00174         fprintf(stderr,"SetConsoleCtrlHandler failed: %d", GetLastError());
00175
00176    dwProcID = GetCurrentProcessId();
00177
00178    printf("Parent process %lu started ...\n", dwProcID);
00179
00180    // prepare the hints for the type of socket we are interested in.
00181    memset(&hints, 0, sizeof(hints));
00182    hints.ai_family = AF_UNSPEC;
00183    hints.ai_protocol = IPPROTO_TCP;
00184    hints.ai_socktype = SOCK_STREAM;
00185    hints.ai_flags = AI_PASSIVE; // since we're going to bind on this socket.
00186
00187    // getaddrinfo is the protocol independent version of GetHostByName.
00188    // the res contains the result.
00189    if (getaddrinfo(pszIPAddress,
00190                    pszPort,
00191                    &hints,
00192                    &res) != NO_ERROR)
00193    {
00194        fprintf(stderr,"getaddrinfo failed. Error = %d\n", WSAGetLastError());
00195        goto CLEANUP;
00196    }
00197
00198    printf("getaddrinfo successful.Enumerating the returned addresses ...\n\n");
00199
00200    // for each returned interface, create a listening socket.
00201    gsListen = INVALID_SOCKET;
00202    for (pAddr = res, i = 1; pAddr != NULL; pAddr = pAddr->ai_next, i++)
00203    {
00204        printf("Trying Address : %d from getaddrinfo\n", i);
00205        PrintAddressString(pAddr->ai_addr, pAddr->ai_addrlen);
00206        // create a suitable socket for this interface.
00207        gsListen = WSASocket(pAddr->ai_family,
00208                             pAddr->ai_socktype,
00209                             pAddr->ai_protocol,
00210                             NULL,
00211                             0,
00212                             0);
00213        if (gsListen != INVALID_SOCKET)
00214             break;
00215
00216        fprintf(stderr,"WSASocket failed. Error = %d\n", WSAGetLastError());
00217        fprintf(stderr,"Ignoring this address and continuing with the next. \n\n");
00218    }
00219
00220    if (pAddr == NULL)
00221    {
00222         fprintf(stderr, "Couldn't find any suitable socket\n");
00223         goto CLEANUP;
00224    }
00225
00226    gsListen = WSASocket(pAddr->ai_family,
00227                         pAddr->ai_socktype,
00228                         pAddr->ai_protocol,
00229                         (LPWSAPROTOCOL_INFO) NULL,
00230                         0,
00231                         WSA_FLAG_OVERLAPPED);
00232
00233    if (gsListen == INVALID_SOCKET)
00234    {
00235       fprintf(stderr, "\nWSASocket() failed to obtain the listen socket: %d\n",
00236               WSAGetLastError());
00237       goto CLEANUP;
00238    }
00239
00240    // bind() associates a local address and port
00241    // combination with the socket just created.
00242    if (bind(gsListen, (struct sockaddr*)pAddr->ai_addr, pAddr->ai_addrlen)
00243             == SOCKET_ERROR)
00244    {
00245       fprintf(stderr, "\nbind() failed: %d\n",
00246               WSAGetLastError());
00247       closesocket(gsListen);
00248       gsListen = INVALID_SOCKET;
00249       goto CLEANUP;
00250    }
00251
00252    // start listening on the socket for incoming connections
00253    if (listen(gsListen,5) == SOCKET_ERROR)
00254    {
00255       fprintf(stderr, "\nlisten() failed: %d\n",
00256               WSAGetLastError());
00257       closesocket(gsListen);
00258       gsListen = INVALID_SOCKET;
00259       goto CLEANUP;
00260    }
00261
00262    nFromLen = sizeof(saFrom);
00263
00264    printf("Listening on %s:%s\n", pszIPAddress? pszIPAddress : "localhost", pszPort);
00265
00266    while(TRUE)
00267    {
00268       printf("Waiting for new connection (Type CTRL+C to exit) ...\n\n");
00269
00270       gsAccept = WSAAccept(gsListen,
00271                            (struct sockaddr*)&saFrom,
00272                            &nFromLen,
00273                            (LPCONDITIONPROC)NULL,
00274                            0);
00275
00276       if(gsAccept == INVALID_SOCKET)
00277       {
00278          fprintf(stderr, "\nWSAAccept() failed: %d\n",
00279                  WSAGetLastError());
00280          break;
00281       }
00282
00283       // Spawn a child process to handle the I/O.
00284       DispatchChild(gsAccept, pszChildProcName);
00285
00286       // Doing a hard shutdown here is a no-no because it
00287       // will also reset the duplicated child socket.
00288       /*
00289       LINGER lingerStruct;
00290
00291       lingerStruct.l_onoff = 1;
00292       lingerStruct.l_linger = 0;
00293       setsockopt(gsAccept, SOL_SOCKET, SO_LINGER,
00294                  (char *)&lingerStruct, sizeof(lingerStruct));
00295       */
00296
00297       closesocket(gsAccept);
00298       gsAccept = INVALID_SOCKET;
00299    }
00300
00301 CLEANUP:
00302
00303    if (gsListen != INVALID_SOCKET)
00304    {
00305        closesocket(gsListen);
00306        gsListen = INVALID_SOCKET;
00307    }
00308
00309    if (res != NULL)
00310    {
00311         freeaddrinfo(res);
00312         res = NULL;
00313    }
00314 }
00315
00316
00317 void DoChild(char *pszChildFileMappingObj)
00318 {
00319    SOCKET sockDuplicated = INVALID_SOCKET;
00320    DWORD dwProcID;
00321    char szBuf[MAX_PATH+1];
00322    WSABUF wsaBuf;
00323    DWORD dwReceived = 0;
00324    DWORD dwFlags = 0;
00325    int nStatus;
00326
00327    dwProcID = GetCurrentProcessId();
00328
00329    printf("Child process %lu started ...\n", dwProcID);
00330
00331    if ((sockDuplicated = GetSocket(pszChildFileMappingObj))
00332          != INVALID_SOCKET)
00333    {
00334       while(TRUE)
00335       {
00336          szBuf[0] = '\0';
00337          wsaBuf.len = MAX_PATH;
00338          wsaBuf.buf = (char *)szBuf;
00339
00340          // Receive the data sent by the other side.
00341          nStatus = WSARecv(sockDuplicated,
00342                            &wsaBuf,
00343                            1,
00344                            &dwReceived,
00345                            &dwFlags,
00346                            (LPWSAOVERLAPPED) NULL,
00347                            0);
00348
00349          if (nStatus == 0) // success
00350          {
00351             if (dwReceived == 0) // Client closed connection
00352             {
00353                fprintf(stderr, "Client closed connection\n");
00354                break;
00355             }
00356             else
00357             {
00358                // Print whatever is received
00359                szBuf[dwReceived] = '\0';
00360                printf("%s", szBuf);
00361             }
00362          }
00363          else // SOCKET_ERROR
00364          {
00365             fprintf(stderr, "WSARecv() failed: %d\n", WSAGetLastError());
00366             break;
00367          }
00368       }
00369
00370       DoGracefulShutdown(sockDuplicated);
00371       sockDuplicated = INVALID_SOCKET;
00372    }
00373    else
00374       fprintf(stderr, "\nChild socket cannot be obtained: %d\n",
00375               WSAGetLastError());
00376
00377    printf("\nChild process %lu has finished!!!\n", dwProcID);
00378
00379    printf("Press any key to continue ...");
00380    getchar();
00381 }
00382
00383
00384 // The server and client have to rely on
00385 // certain interprocess communication schemes
00386 // to exchange the WSAPROTOCOL_INFO needed for
00387 // duplicating the socket.  In this sample,
00388 // we use momory mapped files.
00389 BOOL DispatchChild(SOCKET ClientSock, char *pszChildProcName)
00390 {
00391    char szChildComandLineBuf[MAX_PATH];
00392    char szFileMappingObj[MAX_PATH];
00393    BOOL bResult = TRUE;
00394    STARTUPINFO siParent;
00395    PROCESS_INFORMATION piChild;
00396    char szParentEventName[MAX_PATH];
00397    char szChildEventName[MAX_PATH];
00398
00399    ZeroMemory(&siParent, sizeof(siParent));
00400    siParent.cb = sizeof(siParent);
00401    siParent.dwFlags = STARTF_USECOUNTCHARS;
00402    siParent.dwXCountChars = 10 * MAX_PATH;
00403    siParent.dwYCountChars = MAX_PATH;
00404
00405    // Compose a name for the memory mappled file.
00406    sprintf(szFileMappingObj,
00407            "%s%i",
00408            FILE_MAPPING_BASE_NAME,
00409            nChildProcCount++);
00410
00411    sprintf(szParentEventName, "%s%s", szFileMappingObj, PARENT);
00412    sprintf(szChildEventName, "%s%s", szFileMappingObj, CHILD);
00413
00414    // Create an event to signal the child
00415    // that the protocol info is set
00416    if ((ghParentFileMappingEvent = CreateEvent(NULL, TRUE, FALSE, szParentEventName)) == NULL)
00417    {
00418       fprintf(stderr, "\nCreateEvent() failed: %d\n", GetLastError());
00419       return FALSE;
00420    }
00421
00422    // Create an event to for the child to signal the
00423    // parent that the protocol info can be released
00424    if ((ghChildFileMappingEvent = CreateEvent(NULL, TRUE, FALSE, szChildEventName)) == NULL)
00425    {
00426       fprintf(stderr, "\nCreateEvent() failed: %d\n", GetLastError());
00427       CloseHandle(ghParentFileMappingEvent);
00428       ghParentFileMappingEvent = NULL;
00429       return FALSE;
00430    }
00431
00432    // Set up the child process command line options.
00433    // The memory mapped file name is passed in as
00434    // one of the options.
00435    sprintf(szChildComandLineBuf,
00436            "%s /c %s",
00437            pszChildProcName,
00438            szFileMappingObj);
00439
00440    if (CreateProcess(NULL,
00441                      szChildComandLineBuf,
00442                      NULL,
00443                      NULL,
00444                      FALSE,
00445                      CREATE_NEW_CONSOLE,
00446                      NULL,
00447                      NULL,
00448                      &siParent,
00449                      &piChild))
00450    {
00451       WSAPROTOCOL_INFO ProtocolInfo;
00452       int nError;
00453       int nWaitCount = 0;
00454       LPVOID lpView;
00455       int nStructLen = sizeof(WSAPROTOCOL_INFO);
00456
00457       // Get the protocol information
00458       // to be used to duplicate the socket
00459       if (WSADuplicateSocket(ClientSock,
00460                          piChild.dwProcessId,
00461                          &ProtocolInfo) == SOCKET_ERROR)
00462       {
00463             fprintf(stderr, "WSADuplicateSocket(): failed. Error = %d\n", WSAGetLastError());
00464             DoCleanup();
00465             exit(1);
00466       }
00467
00468       // Set the protocol information in a
00469       // memory mapped file for the child to use
00470       ghMMFileMap = CreateFileMapping(INVALID_HANDLE_VALUE,
00471                                       NULL,
00472                                       PAGE_READWRITE,
00473                                       0,
00474                                       nStructLen,
00475                                       szFileMappingObj);
00476
00477       if (ghMMFileMap != NULL)
00478       {
00479          if ((nError = GetLastError()) == ERROR_ALREADY_EXISTS)
00480             fprintf(stderr, "CreateFileMapping(): mappping file already exists\n");
00481          else
00482          {
00483             lpView = MapViewOfFile(ghMMFileMap,
00484                                    FILE_MAP_READ | FILE_MAP_WRITE,
00485                                    0, 0, 0);
00486
00487             if (lpView != NULL)
00488             {
00489                memcpy(lpView, &ProtocolInfo, nStructLen);
00490                UnmapViewOfFile(lpView);
00491
00492                // Signal the child the protocol infomation is set
00493                SetEvent(ghParentFileMappingEvent);
00494                // Wait the child to signal that the protocol
00495                // infomation can be released now
00496                if (WaitForSingleObject(ghChildFileMappingEvent, 2000) == WAIT_OBJECT_0)
00497                {
00498                   fprintf(stderr, "WaitForSingleObject() failed: %d\n", GetLastError());
00499                   DoCleanup();
00500                   exit(1);
00501                }
00502             }
00503             else
00504             {
00505                fprintf(stderr, "MapViewOfFile() failed: %d\n", GetLastError());
00506                bResult = FALSE;
00507             }
00508          }
00509
00510          CloseHandle(ghMMFileMap);
00511          ghMMFileMap = NULL;
00512       }
00513       else
00514       {
00515          fprintf(stderr, "CreateFileMapping() failed: %d\n", GetLastError());
00516          bResult = FALSE;
00517       }
00518
00519       CloseHandle(piChild.hThread);
00520       CloseHandle(piChild.hProcess);
00521    }
00522    else
00523    {
00524       printf("\nCreate child process failed!!!\n");
00525       bResult = FALSE;
00526    }
00527
00528    if (ghParentFileMappingEvent != NULL)
00529    {
00530       CloseHandle(ghParentFileMappingEvent);
00531       ghParentFileMappingEvent = NULL;
00532    }
00533
00534    if (ghChildFileMappingEvent != NULL)
00535    {
00536       CloseHandle(ghChildFileMappingEvent);
00537       ghChildFileMappingEvent = NULL;
00538    }
00539
00540    return bResult;
00541 }
00542
00543
00544 // Once the protocol information is set by the
00545 // parent in the memory mapped file, the child
00546 // is ready to use it to duplicate the socket.
00547 SOCKET GetSocket(char *szFileMappingObj)
00548 {
00549    WSAPROTOCOL_INFO ProtocolInfo;
00550    SOCKET sockDuplicated = INVALID_SOCKET;
00551    char szParentEventName[MAX_PATH];
00552    char szChildEventName[MAX_PATH];
00553
00554    sprintf(szParentEventName, "%s%s", szFileMappingObj, PARENT);
00555    sprintf(szChildEventName, "%s%s", szFileMappingObj, CHILD);
00556
00557    // Open the events
00558    if ((ghParentFileMappingEvent = OpenEvent(SYNCHRONIZE, FALSE, szParentEventName)) == 0)
00559    {
00560       fprintf(stderr, "OpenEvent() failed: %d\n", GetLastError());
00561       return INVALID_SOCKET;
00562    }
00563
00564    if ((ghChildFileMappingEvent = OpenEvent(SYNCHRONIZE, FALSE, szChildEventName)) == 0)
00565    {
00566       fprintf(stderr, "OpenEvent() failed: %d\n", GetLastError());
00567       CloseHandle(ghParentFileMappingEvent);
00568       ghParentFileMappingEvent = NULL;
00569       return INVALID_SOCKET;
00570    }
00571
00572    // Wait for the parent to signal that the protocol info
00573    // is ready to be accessed
00574    if (WaitForSingleObject(ghParentFileMappingEvent, 2000) == WAIT_FAILED)
00575    {
00576       fprintf(stderr, "WaitForSingleObject() failed: %d\n", GetLastError());
00577       DoCleanup();
00578       exit(1);
00579    }
00580
00581    ghMMFileMap = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE,
00582                                  FALSE,
00583                                  szFileMappingObj);
00584
00585    if (ghMMFileMap != NULL)
00586    {
00587       LPVOID lpView = MapViewOfFile(ghMMFileMap,
00588                                     FILE_MAP_READ | FILE_MAP_WRITE,
00589                                     0, 0, 0);
00590
00591       if ((BYTE*) lpView != NULL)
00592       {
00593          int nStructLen = sizeof(WSAPROTOCOL_INFO);
00594
00595          memcpy(&ProtocolInfo, lpView, nStructLen);
00596          UnmapViewOfFile(lpView);
00597
00598          // Duplicate the socket based on the protocol
00599          // information stored in the memory mapped file.
00600          sockDuplicated = WSASocket(FROM_PROTOCOL_INFO,
00601                                     FROM_PROTOCOL_INFO,
00602                                     FROM_PROTOCOL_INFO,
00603                                     &ProtocolInfo,
00604                                     0,
00605                                     0);
00606
00607          // Signal the parent the we are done
00608          // with the mapped file
00609          SetEvent(ghChildFileMappingEvent);
00610       }
00611       else
00612          fprintf(stderr, "MapViewOfFile() failed: %d\n", GetLastError());
00613    }
00614    else
00615       fprintf(stderr, "CreateFileMapping() failed: %d\n", GetLastError());
00616
00617    if (ghParentFileMappingEvent != NULL)
00618    {
00619       CloseHandle(ghParentFileMappingEvent);
00620       ghParentFileMappingEvent = NULL;
00621    }
00622
00623    if (ghChildFileMappingEvent != NULL)
00624    {
00625       CloseHandle(ghChildFileMappingEvent);
00626       ghChildFileMappingEvent = NULL;
00627    }
00628
00629    if (ghMMFileMap != NULL)
00630    {
00631       CloseHandle(ghMMFileMap);
00632       ghMMFileMap = NULL;
00633    }
00634
00635    return sockDuplicated;
00636 }
00637
00638
00639 // Handle CTRL+BREAK or CTRL+C events
00640 BOOL ConsoleCtrlHandler(DWORD dwEvent)
00641 {
00642    DoCleanup();
00643    printf("Server terminated. Bye!\n");
00644
00645    return FALSE;
00646 }
00647
00648
00649 void DoCleanup(void)
00650 {
00651    // Do a best effort cleanup
00652    if (ghParentFileMappingEvent != NULL)
00653    {
00654       CloseHandle(ghParentFileMappingEvent);
00655       ghParentFileMappingEvent = NULL;
00656    }
00657    if (ghChildFileMappingEvent != NULL)
00658    {
00659       CloseHandle(ghChildFileMappingEvent);
00660       ghChildFileMappingEvent = NULL;
00661    }
00662    if (ghMMFileMap != NULL)
00663    {
00664       CloseHandle(ghMMFileMap);
00665       ghMMFileMap = NULL;
00666    }
00667    if (gsListen != INVALID_SOCKET)
00668    {
00669       closesocket(gsListen);
00670       gsListen = INVALID_SOCKET;
00671    }
00672    if (gsAccept != INVALID_SOCKET)
00673    {
00674       closesocket(gsAccept);
00675       gsAccept = INVALID_SOCKET;
00676    }
00677
00678    WSACleanup();
00679 }
00680
00681 // Do a graceful shutdown of a the given socket sock.
00682 BOOL DoGracefulShutdown(SOCKET sock)
00683 {
00684     BOOL bRetVal = FALSE;
00685     WSAEVENT hEvent = WSA_INVALID_EVENT;
00686     long lNetworkEvents = 0;
00687     int status = 0;
00688
00689     hEvent = WSACreateEvent();
00690     if (hEvent == WSA_INVALID_EVENT)
00691     {
00692         fprintf(stderr, "DoGracefulShutdown: WSACreateEvent failed: %d\n",
00693                 WSAGetLastError());
00694         goto CLEANUP;
00695     }
00696
00697     lNetworkEvents = FD_CLOSE;
00698     if (WSAEventSelect(sock, hEvent, lNetworkEvents) != 0)
00699     {
00700         fprintf(stderr, "DoGracefulShutdown: WSAEventSelect failed: %d\n",
00701                 WSAGetLastError());
00702         goto CLEANUP;
00703     }
00704
00705     if (shutdown(sock, SD_SEND) != 0)
00706     {
00707         fprintf(stderr, "DoGracefulShutdown: shutdown failed: %d\n",
00708                 WSAGetLastError());
00709         goto CLEANUP;
00710     }
00711
00712     if (WaitForSingleObject(hEvent, INFINITE) != WAIT_OBJECT_0)
00713     {
00714         fprintf(stderr, "DoGracefulShutdown: WaitForSingleObject failed: %d\n",
00715                 WSAGetLastError());
00716         goto CLEANUP;
00717     }
00718
00719     do
00720     {
00721         char buf[128];
00722
00723         status = recv(sock, buf, sizeof(buf), 0);
00724     } while (!(status == 0 || status == SOCKET_ERROR));
00725
00726     if (closesocket(sock) != 0)
00727     {
00728         fprintf(stderr, "DoGracefulShutdown: closesocket failed: %d\n",
00729                 WSAGetLastError());
00730         goto CLEANUP;
00731     }
00732
00733     printf("Socket %d has been closed gracefully\n", sock);
00734     sock = INVALID_SOCKET;
00735     bRetVal = TRUE;
00736
00737 CLEANUP:
00738
00739     if (hEvent != WSA_INVALID_EVENT)
00740     {
00741         WSACloseEvent(hEvent);
00742         hEvent = WSA_INVALID_EVENT;
00743     }
00744
00745     if (sock != INVALID_SOCKET)
00746     {
00747         fprintf(stderr, "DoGracefulShutdown: Can't close socket gracefully. "
00748                         "So, closing it anyway ... \n");
00749         closesocket(sock);
00750         sock = INVALID_SOCKET;
00751     }
00752
00753     return bRetVal;
00754 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletSessionKey Member List

This is the complete list of members for tagAppletSessionKey, including all inherited members.
AppletProtocolKey | tagAppletSessionKey
nSessionID | tagAppletSessionKey
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Client/Resource.h Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Client

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by client.rc
00004 //
00005 #define IDSTART                         2
00006 #define IDD_CLIENT_DIALOG               102
00007 #define IDR_MAINFRAME                   128
00008 #define IDC_LASTVALUE                   1000
00009 #define IDC_GOOD                        1001
00010 #define IDC_WARNING                     1002
00011 #define IDC_BAD                         1003
00012 #define IDC_USEPING                     1004
00013 #define IDC_TRIES                       1005
00014 #define IDC_TIMEOUTS                    1006
00015 #define IDC_PINGS                       1007
00016 #define IDC_RSN                         1008
00017 #define IDC_PINGFAILS                   1009
00018 #define IDC_FAILS                       1010
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        129
00025 #define _APS_NEXT_COMMAND_VALUE         32771
00026 #define _APS_NEXT_CONTROL_VALUE         1006
00027 #define _APS_NEXT_SYMED_VALUE           101
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Inc/ICARS.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • Inc

ICARS.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      ICARS.H
00003
00004   Summary:   This is the common include file for the Car-related COM
00005              Interfaces.  The Interface abstract base classes are
00006              declared.
00007
00008              This file is global to all the Tutorial Code Samples (kept in
00009              the ..\INC directory).  It is a good practice to factor out
00010              Interface and GUID specifications to reduce the possibility
00011              of GUID or interface conflicts.
00012
00013   Classes:   ICar, IUtilityCar, ICruiseCar, ISample.
00014
00015   Functions: none
00016
00017   Origin:    10-7-95: atrent - Factored out of COMOBJ and DLLSERVE.
00018
00019 ----------------------------------------------------------------------------
00020   This file is part of the Microsoft COM Tutorial Code Samples.
00021
00022   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00023
00024   This source code is intended only as a supplement to Microsoft
00025   Development Tools and/or on-line documentation.  See these other
00026   materials for detailed information regarding Microsoft code samples.
00027
00028   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00029   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00030   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00031   PARTICULAR PURPOSE.
00032 ==========================================================================+*/
00033
00034 #if !defined(ICARS_H)
00035 #define ICARS_H
00036
00037 #if !defined(RC_INCLUDE)
00038
00039
00040 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00041   Interface: ICar
00042
00043   Summary:   Basic Interface that can add propulsion, steering, etc, for
00044              Car-like COM Objects.
00045
00046   Methods:   Shift
00047                Shift the main transmission gears.
00048              Clutch
00049                Engage/disengage the clutch.
00050              Speed
00051                Accelerate/brake the car to a specified speed.
00052              Steer
00053                Steer the car.
00054 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00055 DECLARE_INTERFACE_(ICar, IUnknown)
00056 {
00057   // IUnknown methods.
00058   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
00059   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
00060   STDMETHOD_(ULONG,Release) (THIS) PURE;
00061
00062   // ICar methods.
00063   STDMETHOD(Shift)   (THIS_ short) PURE;
00064   STDMETHOD(Clutch)  (THIS_ short) PURE;
00065   STDMETHOD(Speed)   (THIS_ short) PURE;
00066   STDMETHOD(Steer)   (THIS_ short) PURE;
00067 };
00068
00069
00070 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00071   Interface: IUtility
00072
00073   Summary:   Interface that can add sport-utility offroad systems features
00074              for Car-like COM Objects.
00075
00076   Methods:   Offroad
00077                Shift the transfer case for specified 4-wheel drive mode.
00078              Winch
00079                Turn front-mounted Winch on/off.
00080 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00081 DECLARE_INTERFACE_(IUtility, IUnknown)
00082 {
00083   // IUnknown methods.
00084   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
00085   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
00086   STDMETHOD_(ULONG,Release) (THIS) PURE;
00087
00088   // IUtility methods.
00089   STDMETHOD(Offroad)   (THIS_ short) PURE;
00090   STDMETHOD(Winch)     (THIS_ short) PURE;
00091 };
00092
00093
00094 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00095   Interface: ICruise
00096
00097   Summary:   Interface that can add cruise control features for
00098              Car-like COM Objects.
00099
00100   Methods:   Engage
00101                Turns the cruise control system on/off.
00102              Adjust
00103                Adjusts the cruise speed up or down by 3 Mph increments.
00104 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00105 DECLARE_INTERFACE_(ICruise, IUnknown)
00106 {
00107   // IUnknown methods.
00108   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
00109   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
00110   STDMETHOD_(ULONG,Release) (THIS) PURE;
00111
00112   // ICruise methods.
00113   STDMETHOD(Engage) (THIS_ BOOL) PURE;
00114   STDMETHOD(Adjust) (THIS_ BOOL) PURE;
00115 };
00116
00117
00118 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00119   Interface: ISample
00120
00121   Summary:   Utility Interface for Code Sample servers.
00122
00123   Methods:   Init
00124                Initializes the Server as a code sample (eg, to log server
00125                activity to the Client's trace log facility).
00126              AboutBox
00127                Commands Server to show it's about box dialog.
00128 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00129 DECLARE_INTERFACE_(ISample, IUnknown)
00130 {
00131   // IUnknown methods.
00132   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
00133   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
00134   STDMETHOD_(ULONG,Release) (THIS) PURE;
00135
00136   // ISample methods.
00137   STDMETHOD(Init)     (THIS_ HWND, PVOID) PURE;
00138   STDMETHOD(AboutBox) (THIS_ HWND) PURE;
00139 };
00140
00141
00142 #endif // RC_INCLUDE
00143
00144 #endif // ICARS_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropertiesDlg Member List

This is the complete list of members for CPropertiesDlg, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
CPropertiesDlg(CMainWindow *pCMainWindow) | CPropertiesDlg |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CRowsetViewerDlg(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CRowsetViewerDlg |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DisplayProperties(ULONG cPropertyIDSets, DBPROPIDSET *rgPropertyIDSets) | CPropertiesDlg |
DisplayProperty(INDEX iItem, DBPROP *pProp, DBPROPINFO *pPropInfo, REFGUID guidPropertySet, LPARAM lParam=0) | CPropertiesDlg |
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetOptions() | CRowsetViewerDlg | [virtual]
GetProperties(HWND hWndParent, const GUID *pGuidPropertySet, REFIID riidProp, IUnknown *pIUnkProperties, IDBProperties *pIDBPropertyInfo, CPropSets *pCPropSets=NULL, IDBDataSourceAdmin *pIDBDataSourceAdmin=NULL) | CPropertiesDlg |
GetProperties(ULONG cPropertyIDSets, DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropSets, DBPROPSET **prgPropSets) | CPropertiesDlg |
GetPropertyInfo(HWND hWndParent, const GUID *pGuidPropertySet, REFIID riidProp, IDBProperties *pIDBPropertyInfo, IDBDataSourceAdmin *pIDBDataSourceAdmin=NULL) | CPropertiesDlg |
GetPropertyInfo(ULONG cPropertyIDSets, DBPROPIDSET *rgPropertyIDSets, ULONG *pcPropInfoSets, DBPROPINFOSET **prgPropInfoSets, WCHAR **ppStringBuffer) | CPropertiesDlg |
GetSelPropInfo(INDEX iSelRow, DBPROPINFOSET **ppPropInfoSet=NULL) | CPropertiesDlg |
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bClearAll | CPropertiesDlg |
m_bUnicodeMsg | CWndLite |
m_comboOptions | CPropertiesDlg |
m_comboPropSet | CPropertiesDlg |
m_comboType | CPropertiesDlg |
m_comboValue | CPropertiesDlg |
m_cPropInfoSets | CPropertiesDlg |
m_editDesc | CPropertiesDlg |
m_eMethodType | CPropertiesDlg |
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iidProp | CPropertiesDlg |
m_listviewProps | CPropertiesDlg |
m_nID | CWndLite |
m_pCMainWindow | CRowsetViewerDlg |
m_pCMDIChild | CRowsetViewerDlg |
m_pCPropSets | CPropertiesDlg |
m_pGuidPropertySet | CPropertiesDlg |
m_pIDBDataSourceAdmin | CPropertiesDlg |
m_pIDBPropertyInfo | CPropertiesDlg |
m_pIUnkProperties | CPropertiesDlg |
m_pStringBuffer | CPropertiesDlg |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_rgPropInfoSets | CPropertiesDlg |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
METHOD_GETPROPERTIES enum value | CPropertiesDlg |
METHOD_GETPROPERTYINFO enum value | CPropertiesDlg |
METHOD_SETPROPERTIES enum value | CPropertiesDlg |
METHOD_TYPE enum name | CPropertiesDlg |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnAddDefinedProperties() | CPropertiesDlg | [virtual]
OnCancel() | CPropertiesDlg | [virtual]
CDialogLite::OnCancel() | CDialogLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClearAll() | CPropertiesDlg | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CPropertiesDlg | [virtual]
CDialogLite::OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CPropertiesDlg | [virtual]
CDialogLite::OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | CPropertiesDlg | [virtual]
CDialogLite::OnInitDialog() | CDialogLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CPropertiesDlg | [virtual]
CDialogLite::OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CPropertiesDlg | [virtual]
CDialogLite::OnOK() | CDialogLite | [virtual]
OnPropOptionsChange() | CPropertiesDlg | [virtual]
OnPropSetChange() | CPropertiesDlg | [virtual]
OnPropTypeChange() | CPropertiesDlg | [virtual]
OnPropValueChange() | CPropertiesDlg | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSelChange(INT iID, HWND hWndCtrl) | CPropertiesDlg | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetProperties(HWND hWndParent, const GUID *pGuidPropertySet, REFIID riidProp, IUnknown *pIUnkProperties, IDBProperties *pIDBPropertyInfo, CPropSets *pCPropSets=NULL, IDBDataSourceAdmin *pIDBDataSourceAdmin=NULL) | CPropertiesDlg |
SetProperties(ULONG cPropSets, DBPROPSET *rgPropSets) | CPropertiesDlg |
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CPropertiesDlg() | CPropertiesDlg | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminServiceStatusOptions Member List

This is the complete list of members for comadmin::COMAdminServiceStatusOptions, including all inherited members.
COMAdminServiceContinuePending | comadmin::COMAdminServiceStatusOptions | [static]
COMAdminServicePaused | comadmin::COMAdminServiceStatusOptions | [static]
COMAdminServicePausePending | comadmin::COMAdminServiceStatusOptions | [static]
COMAdminServiceRunning | comadmin::COMAdminServiceStatusOptions | [static]
COMAdminServiceStartPending | comadmin::COMAdminServiceStatusOptions | [static]
COMAdminServiceStopped | comadmin::COMAdminServiceStatusOptions | [static]
COMAdminServiceStopPending | comadmin::COMAdminServiceStatusOptions | [static]
COMAdminServiceUnknownState | comadmin::COMAdminServiceStatusOptions | [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/about.h Source File

  • SysMgmt
  • MMC
  • Tbarext

about.h

Go to the documentation of this file.
00001
00002 //==============================================================;
00003 //
00004 //  This source code is only intended as a supplement to existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SAMPABOUT_H_
00021 #define _SAMPABOUT_H_
00022
00023 #include <tchar.h>
00024 #include <mmc.h>
00025
00026 class CSnapinAbout : public ISnapinAbout
00027 {
00028 private:
00029     ULONG       m_cref;
00030     HBITMAP       m_hSmallImage;
00031     HBITMAP       m_hLargeImage;
00032     HBITMAP       m_hSmallImageOpen;
00033     HICON       m_hAppIcon;
00034
00035 public:
00036     CSnapinAbout();
00037     ~CSnapinAbout();
00038
00039     ///////////////////////////////
00040     // Interface IUnknown
00041     ///////////////////////////////
00042     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00043     STDMETHODIMP_(ULONG) AddRef();
00044     STDMETHODIMP_(ULONG) Release();
00045
00046     ///////////////////////////////
00047     // Interface ISnapinAbout
00048     ///////////////////////////////
00049     STDMETHODIMP GetSnapinDescription(
00050         /* [out] */ LPOLESTR *lpDescription);
00051
00052         STDMETHODIMP GetProvider(
00053         /* [out] */ LPOLESTR *lpName);
00054
00055         STDMETHODIMP GetSnapinVersion(
00056         /* [out] */ LPOLESTR *lpVersion);
00057
00058         STDMETHODIMP GetSnapinImage(
00059         /* [out] */ HICON *hAppIcon);
00060
00061         STDMETHODIMP GetStaticFolderImage(
00062         /* [out] */ HBITMAP *hSmallImage,
00063         /* [out] */ HBITMAP *hSmallImageOpen,
00064         /* [out] */ HBITMAP *hLargeImage,
00065         /* [out] */ COLORREF *cMask);
00066
00067         ///////////////////////////////
00068         // Private Interface
00069         ///////////////////////////////
00070 private:
00071     HRESULT CSnapinAbout::AllocOleStr(
00072         LPOLESTR *lpDest,
00073         _TCHAR *szBuffer);
00074 };
00075
00076 #endif _SAMPABOUT_H_
00077
00078
00079
00080
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/strmvwr.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

strmvwr.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       strmvwr.h
00007 //
00008 //  Contents:   Stream viewer window class definition.
00009 //
00010 //  Classes:    CStreamView
00011 //
00012 //  Functions:
00013 //
00014 //  History:    6-27-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #ifndef __STRMVWR_H__
00019 #define __STRMVWR_H__
00020 #include <cwindow.h>
00021 #include "dfv.h"
00022 #include "mwclass.h"
00023
00024 #ifdef __cplusplus
00025
00026 //+---------------------------------------------------------------------------
00027 //
00028 //  Class:      CStreamView
00029 //
00030 //  Purpose:    implements a stream viewer window
00031 //
00032 //  Interface:  CStreamView  -- constructor
00033 //              InitInstance -- instantiates an instance of the viewer
00034 //
00035 //  History:    6-27-94   stevebl   Created
00036 //
00037 //  Notes:      only the public interface is described by this comment
00038 //
00039 //----------------------------------------------------------------------------
00040
00041 class CStreamView: public CHlprWindow
00042 {
00043 public:
00044     CStreamView(HWND hlb, LISTBOXELEMENT * ple);
00045     BOOL InitInstance(HINSTANCE hInst, int nCmdShow);
00046 protected:
00047     ~CStreamView();
00048     LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00049 private:
00050     HWND _hlbParent;
00051     HWND _hlb;
00052     LONG _lIndex;
00053     LISTBOXELEMENT * _ple;
00054     COLORREF _crTextHigh;
00055     COLORREF _crBkHigh;
00056     COLORREF _crTextNorm;
00057     COLORREF _crBkNorm;
00058     WORD _wWidth;
00059     DWORD _cbSize;
00060     TEXTMETRIC _tm;
00061     HFONT _hfListBox;
00062 };
00063
00064 #endif // __cplusplus
00065 #endif // __STRMVWR_H__
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/asyncdemotutorial/resource.h Source File

  • Web
  • winhttp
  • asyncdemotutorial

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by AsyncDemo.rc
00004 //
00005 #define IDD_DIALOG1                     101
00006 #define IDC_CBLIST                      1000
00007 #define IDC_DOWNLOAD                    1001
00008 #define IDC_EXIT                        1002
00009 #define IDC_URL1                        1003
00010 #define IDC_HEADER1                     1004
00011 #define IDC_RESOURCE1                   1005
00012 #define IDC_URL2                        1006
00013 #define IDC_HEADER2                     1007
00014 #define IDC_RESOURCE2                   1008
00015
00016 // Next default values for new objects
00017 //
00018 #ifdef APSTUDIO_INVOKED
00019 #ifndef APSTUDIO_READONLY_SYMBOLS
00020 #define _APS_NEXT_RESOURCE_VALUE        102
00021 #define _APS_NEXT_COMMAND_VALUE         40001
00022 #define _APS_NEXT_CONTROL_VALUE         1006
00023 #define _APS_NEXT_SYMED_VALUE           101
00024 #endif
00025 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasDial/c/RasDial.c Source File

  • NetDS
  • Ras
  • RasDial
  • c

RasDial.c

Go to the documentation of this file.
00001 //
00002 //       This is a part of the Microsoft Source Code Samples.
00003 //       Copyright 1993 - 2002 Microsoft Corporation.
00004 //       All rights reserved.
00005 //       This source code is only intended as a supplement to
00006 //       Microsoft Development Tools and/or WinHelp documentation.
00007 //       See these sources for detailed information regarding the
00008 //       Microsoft samples programs.
00009 //
00010
00011 //
00012 //    RasDial.c
00013 //
00014 //    Usage:
00015 //    RasDial -e [entry name] -p [phone number] -u [username]
00016 //        -z [password] -d [domain]
00017 //
00018 //    RAS API's used:
00019 //      RasDial
00020 //      RasHangUp
00021 //      RasGetConnectStatus
00022 //      RasGetProjectionInfo
00023 //
00024 #ifndef _WIN32_WINNT
00025 #define _WIN32_WINNT 0x500
00026 #endif
00027
00028 #ifdef UNICODE
00029 #undef UNICODE
00030 #endif
00031
00032 #define WIN32_LEAN_AND_MEAN
00033
00034 #include <stdio.h>
00035 #include <windows.h>
00036 #include <ras.h>
00037 #include <raserror.h>
00038 #include <string.h>
00039 #include <stdlib.h>
00040 #include <time.h>
00041 #include <tchar.h>
00042
00043 // Macro for counting maximum characters that will fit into a buffer
00044 #define CELEMS(x) ((sizeof(x))/(sizeof(x[0])))
00045
00046 // Usage
00047 void Usage(char *pszProgName)
00048 {
00049     TCHAR szTempBuf[256] = {0};
00050
00051     if (pszProgName)
00052     {
00053         _snprintf(szTempBuf,
00054                   CELEMS(szTempBuf) - 1,
00055                   "Usage\n%s \t-e entry_name -p [phone_number] \n\t\t-u [username] -z [password] -d [domain]\n",
00056                   pszProgName);
00057
00058         printf(szTempBuf);
00059     }
00060
00061     return;
00062 }
00063
00064
00065 int main(int argc, char **argv)
00066 {
00067     LPRASDIALPARAMS     lpRasDialParams = NULL;
00068     HRASCONN            hRasConn = NULL;
00069     LPRASCONNSTATUS     lpRasConnStatus = NULL;
00070     RASPPPIP            *lpProjection = NULL;
00071     int                 i = 0;
00072     int                 j = 0;
00073     DWORD               dwRet = 0;
00074     DWORD               cb = sizeof(RASDIALPARAMS);
00075     DWORD               dwMaxTickCount = 0;
00076     BOOL                fRequired = FALSE;
00077     BOOL                fSuccess = FALSE;
00078     TCHAR               szTempBuf[256] = {0};
00079
00080     lpRasDialParams = (LPRASDIALPARAMS)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
00081     if (NULL == lpRasDialParams)
00082     {
00083         printf("HeapAlloc failed\n");
00084         return ERROR_OUTOFMEMORY;
00085     }
00086
00087     lpRasDialParams->dwSize = sizeof(RASDIALPARAMS);
00088
00089     // Copy command line arguments into the RASDIALPARAMS structure
00090     if (argc > 1)
00091     {
00092         for(i = 1; i < (argc - 1); i++)
00093         {
00094             if (argv[i] && ((argv[i][0] == '-') || (argv[i][0] == '/')))
00095           {
00096                 switch(tolower(argv[i][1]))
00097               {
00098                     case 'e': // Entry name
00099                         j = ++i;
00100                         if (argv[j])
00101                         {
00102                             lstrcpyn(lpRasDialParams->szEntryName, argv[j], CELEMS(lpRasDialParams->szEntryName));
00103                             fRequired = TRUE;
00104                         }
00105                         break;
00106                     case 'p': // Phone number
00107                         j = ++i;
00108                         if (argv[j])
00109                         {
00110                             lstrcpyn(lpRasDialParams->szPhoneNumber, argv[j], CELEMS(lpRasDialParams->szPhoneNumber));
00111                         }
00112                         break;
00113                     case 'u': // User name
00114                         j = ++i;
00115                         if (argv[j])
00116                         {
00117                             lstrcpyn(lpRasDialParams->szUserName, argv[j], CELEMS(lpRasDialParams->szUserName));
00118                         }
00119                         break;
00120                     case 'z': // Password
00121                         j = ++i;
00122                         if (argv[j])
00123                         {
00124                             lstrcpyn(lpRasDialParams->szPassword, argv[j], CELEMS(lpRasDialParams->szPassword));
00125                         }
00126                         break;
00127                     case 'd': // Domain name
00128                         j = ++i;
00129                         if (argv[j])
00130                         {
00131                             lstrcpyn(lpRasDialParams->szDomain, argv[j], CELEMS(lpRasDialParams->szDomain));
00132                         }
00133                         break;
00134                     default:
00135                         Usage(argv[0]);
00136                         dwRet = ERROR_INVALID_PARAMETER;
00137                         break;
00138               }
00139           }
00140             else
00141             {
00142                 Usage(argv[0]);
00143                 dwRet = ERROR_INVALID_PARAMETER;
00144                 goto done;
00145             }
00146         }
00147     }
00148     else
00149     {
00150         Usage(argv[0]);
00151         dwRet = ERROR_INVALID_PARAMETER;
00152         goto done;
00153     }
00154
00155     // Check if we got at least required entry name
00156     if (FALSE == fRequired)
00157     {
00158         Usage(argv[0]);
00159         dwRet = ERROR_INVALID_PARAMETER;
00160         goto done;
00161     }
00162
00163     printf("Dialing...\n");
00164
00165     // Calling RasDial synchronously
00166     dwRet = RasDial(NULL, NULL, lpRasDialParams, 0, 0L, &hRasConn);
00167     if (dwRet)
00168     {
00169         printf("RasDial failed: Error = %d\n", dwRet);
00170         goto done;
00171     }
00172
00173     lpRasConnStatus = (LPRASCONNSTATUS)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RASCONNSTATUS));
00174     if (NULL == lpRasConnStatus)
00175     {
00176         printf("HeapAlloc failed.\n");
00177         goto disconnect;
00178     }
00179
00180     // Set the appropriate size
00181     lpRasConnStatus->dwSize = sizeof(RASCONNSTATUS);
00182
00183     // Checking connection status using RasGetConnectStatus
00184     dwRet = RasGetConnectStatus(hRasConn, lpRasConnStatus);
00185     if (ERROR_SUCCESS != dwRet)
00186     {
00187         printf("RasGetConnectStatus failed: Error = %d\n", dwRet);
00188         goto disconnect;
00189     }
00190     else
00191     {
00192         // Since the call succeeded, let's see what ras connection state we are in
00193         // by using the RASCONNSTATUS structure.
00194         if (lpRasConnStatus->rasconnstate == RASCS_Connected)
00195         {
00196             ZeroMemory((LPVOID)szTempBuf, sizeof(szTempBuf));
00197             _snprintf(szTempBuf, CELEMS(szTempBuf) - 1, "Connection estabilished using %s\n", lpRasConnStatus->szDeviceName);
00198             printf(szTempBuf);
00199         }
00200         else
00201         {
00202             // We don't seem to be connected. Just try to terminate the connection by
00203             // hanging up.
00204             printf("lpRasConnStatus->rasconnstate = %d\n", lpRasConnStatus->rasconnstate);
00205             goto disconnect;
00206         }
00207     }
00208
00209     lpProjection = (RASPPPIP *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RASPPPIP));
00210     if (NULL == lpProjection)
00211     {
00212         printf("HeapAlloc failed.\n");
00213         dwRet = ERROR_OUTOFMEMORY;
00214         goto disconnect;
00215     }
00216
00217     cb = sizeof(RASPPPIP);
00218     lpProjection->dwSize = cb;
00219
00220    // Getting the Ras client and server IP address using RasGetProjectionInfo
00221    dwRet = RasGetProjectionInfo(hRasConn, RASP_PppIp, lpProjection, &cb);
00222
00223     switch (dwRet)
00224     {
00225     case ERROR_BUFFER_TOO_SMALL:
00226         if (HeapFree(GetProcessHeap(), 0, (LPVOID)lpProjection))
00227         {
00228
00229             lpProjection = (RASPPPIP *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
00230             if (NULL == lpProjection)
00231             {
00232                 printf("HeapAlloc failed.\n");
00233                 goto disconnect;
00234             }
00235
00236             dwRet = RasGetProjectionInfo(hRasConn, RASP_PppIp, lpProjection, &cb);
00237             if (ERROR_SUCCESS == dwRet)
00238             {
00239                 fSuccess = TRUE;
00240             }
00241             else
00242             {
00243                 printf("RasGetProjectionInfo failed: Error %d", dwRet);
00244                 goto disconnect;
00245             }
00246         }
00247         else
00248         {
00249             printf("HeapFree failed.\n");
00250             goto disconnect;
00251         }
00252         break;
00253
00254    case ERROR_SUCCESS:
00255         fSuccess = TRUE;
00256         break;
00257
00258    default:
00259          printf("RasGetProjectionInfo failed: Error %d", dwRet);
00260      goto disconnect;
00261
00262         break;
00263     }
00264
00265     if (fSuccess)
00266     {
00267         // Print out the IP addresses
00268         ZeroMemory((LPVOID)szTempBuf, sizeof(szTempBuf));
00269         _snprintf(szTempBuf, CELEMS(szTempBuf) - 1, "\nRas Client IP address: %s\n", lpProjection->szIpAddress);
00270         printf(szTempBuf);
00271
00272         ZeroMemory((LPVOID)szTempBuf, sizeof(szTempBuf));
00273         _snprintf(szTempBuf, CELEMS(szTempBuf) - 1, "Ras Server IP address: %s\n\n", lpProjection->szServerIpAddress);
00274         printf(szTempBuf);
00275     }
00276
00277     printf("Pausing for 5 seconds before disconnecting...\n");
00278     Sleep(5000);
00279
00280 disconnect:
00281
00282     // Terminating the connection using RasHangUp
00283     dwRet = RasHangUp(hRasConn);
00284     if (ERROR_SUCCESS != dwRet)
00285     {
00286       printf("RasHangUp failed: Error = %d", dwRet);
00287       goto done;
00288     }
00289
00290     // Keep checking  for 10 seconds and make sure we are really disconnected.
00291     // Once the connection is disconnected, RasGetConnectStatus returns ERROR_INVALID_HANDLE.
00292     // or our timeout is reached we exit the while loop.
00293     // This gives the RAS API time to make sure the modem hangs up before we exit this process.
00294     // If a process exits with a connected RAS connection, the port could be stranded.
00295     dwMaxTickCount = GetTickCount() + 10000;
00296
00297     while((RasGetConnectStatus(hRasConn, lpRasConnStatus) != ERROR_INVALID_HANDLE) && (dwMaxTickCount > GetTickCount()))
00298     {
00299       Sleep(50);
00300     }
00301
00302     printf("Diconnected\n");
00303
00304     dwRet = ERROR_SUCCESS;
00305
00306 done:
00307     if (lpProjection)
00308     {
00309         HeapFree(GetProcessHeap(), 0, (LPVOID)lpProjection);
00310     }
00311
00312     if (lpRasDialParams)
00313     {
00314         HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasDialParams);
00315     }
00316
00317     if (lpRasConnStatus)
00318     {
00319         HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasConnStatus);
00320     }
00321
00322    return (int)dwRet;
00323 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/delebase.h Source File

  • SysMgmt
  • MMC
  • CMenu

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CDelegationBase {
00030 public:
00031     CDelegationBase();
00032     virtual ~CDelegationBase();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00035     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00036
00037     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00038     virtual const int GetBitmapIndex() = 0;
00039
00040     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00041
00042 public:
00043     // virtual functions go here (for MMCN_*)
00044     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
00045     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
00046     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00047     virtual HRESULT OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) { return S_FALSE; }
00048     virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) { return S_FALSE; }
00049     virtual HRESULT OnMenuCommand(IConsole *pConsole, long lCommandID) { return S_FALSE; }
00050
00051 public:
00052     static HBITMAP m_pBMapSm;
00053     static HBITMAP m_pBMapLg;
00054
00055 protected:
00056     static void LoadBitmaps() {
00057         m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
00058         m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
00059     }
00060
00061     BOOL bExpanded;
00062
00063 private:
00064     // {2974380B-4C4B-11d2-89D8-000021473128}
00065     static const GUID thisGuid;
00066 };
00067
00068 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/sky.Cpp Source File

  • SysMgmt
  • MMC
  • CMenu

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
00029 HRESULT CSkyBasedVehicle::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed)
00030 {
00031     HRESULT hr = S_OK;
00032     CONTEXTMENUITEM menuItemsNew[] =
00033     {
00034         {
00035             L"Sky based", L"Add a new sky based vehicle",
00036                 IDM_NEW_SKY, CCM_INSERTIONPOINTID_PRIMARY_NEW, 0, CCM_SPECIAL_DEFAULT_ITEM
00037         },
00038         { NULL, NULL, 0, 0, 0 }
00039     };
00040
00041     // Loop through and add each of the menu items
00042     if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_NEW)
00043     {
00044         for (LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++)
00045         {
00046             hr = pContextMenuCallback->AddItem(m);
00047
00048             if (FAILED(hr))
00049                 break;
00050         }
00051     }
00052
00053     return hr;
00054 }
00055
00056 HRESULT CSkyBasedVehicle::OnMenuCommand(IConsole *pConsole, long lCommandID)
00057 {
00058     switch (lCommandID)
00059     {
00060     case IDM_NEW_SKY:
00061         pConsole->MessageBox(L"This sample does not create a new item\nSee Complete sample for a demonstration", L"Menu Command", MB_OK|MB_ICONINFORMATION, NULL);
00062         break;
00063     }
00064
00065     return S_OK;
00066 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/staticnode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

staticnode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CStaticNode class.
00014 //
00015
00016 #include "StaticNode.h"
00017 #include "DeviceNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "AddDeviceDlg.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CStaticNode")
00026
00027
00028 // Initialize our static GUID just once.  We use the GUID for
00029 // CComponentData because this node handles events for the
00030 // Snap-in's namespace
00031 GUID CStaticNode::m_thisGUID = CLSID_CComponentData;
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Construction/Destruction
00036
00037 //---------------------------------------------------------------------------
00038 CStaticNode::CStaticNode()
00039 {
00040   m_SDI.mask        = DEFAULT_SDI_MASK;
00041   m_SDI.displayname = MMC_CALLBACK;
00042   m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00043   m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00044   m_SDI.cChildren   = 1;              // Determines if the '+' is displayed
00045   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00046
00047   m_hStaticNode     = NULL;
00048   m_pCompData       = NULL;
00049   m_hAddDeviceDlg   = NULL;
00050 }
00051
00052 //---------------------------------------------------------------------------
00053 CStaticNode::~CStaticNode()
00054 {
00055   if( NULL != m_hMessageWnd )
00056     DestroyWindow( m_hMessageWnd );
00057 }
00058
00059 //---------------------------------------------------------------------------
00060 HRESULT CStaticNode::Initialize( NODE_PROPERTIES* pNodeProps )
00061 {
00062   _ASSERT( NULL != pNodeProps );
00063   _ASSERT( NULL != pNodeProps->pComponentData );
00064
00065   HRESULT hResult = S_FALSE;
00066
00067   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00068   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00069   wcscpy( pszTmp, pNodeProps->szNodeName );
00070   if( NULL != m_pwszNodeName )
00071     CoTaskMemFree( m_pwszNodeName );
00072
00073   m_pwszNodeName = pszTmp;
00074   m_pCompData = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00075
00076   hResult = RefreshNodeList();         // Initialize scope nodes
00077
00078   // We create a hidden window to allow us to communicate with modeless
00079   // dialogs and other things which run in a seperate thread.
00080
00081   WNDCLASS wc;
00082   ZeroMemory (&wc, sizeof(WNDCLASS));
00083   wc.cbWndExtra    = sizeof(this);
00084   wc.lpfnWndProc   = StaticNodeWndProc;
00085   wc.hInstance     = g_hInst;
00086   wc.lpszClassName = _T("StaticNodeMessageWindow");
00087
00088   RegisterClass( &wc );
00089   m_hMessageWnd = CreateWindow( _T("StaticNodeMessageWindow"), NULL,
00090                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00091
00092   if( NULL == m_hMessageWnd )
00093     hResult = S_FALSE;
00094
00095   return hResult;
00096 }
00097
00098
00099 //---------------------------------------------------------------------------
00100 //  This is our hidden window which is just used for handling messages.  We
00101 //  go to all this trouble so that we don't ever pass interface pointers or
00102 //  other objects across threads.
00103 //
00104 LRESULT CALLBACK CStaticNode::StaticNodeWndProc
00105 (
00106   HWND   hWnd,     //[in] Handle to window
00107   UINT   uMsg,     //[in] Message identifier
00108   WPARAM wParam,   //[in] First message parameter
00109   LPARAM lParam    //[in] Second message parameter
00110 )
00111 {
00112   switch( uMsg )
00113   {
00114     // Since we registered the WndClass in Initialize, our WndProc will be
00115     // called with WM_CREATE right away.  Store our 'hWnd' pointer in the
00116     // CREATESTRUCT so we can retreive it later to get back to the specific
00117     // instance of CComponentData
00118     //
00119     case WM_CREATE:
00120     {
00121       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00122       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00123       break;
00124     }
00125
00126     // This is our custom message which could have been sent from a worker
00127     // thread, or in this case a modeless dialog.  We retrieve our 'this'
00128     // pointer from the WndClass and cast it to a CComponentData pointer.
00129     // WPARAM is cast to a NODE_PROPERTIES struct which can be used to
00130     // call AddDeviceNode()
00131     //
00132     case WM_ADDNEW_NODE:
00133     {
00134       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00135       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00136       pThisNode->AddDeviceNode( pProps );
00137       break;
00138     }
00139
00140     // This message is sent by the AddDeviceDlg to let us know it's
00141     // being terminated.  Set our member handle to NULL so the item
00142     // will be show on the context menu
00143     //
00144     case WM_DIALOG_CLOSED:
00145     {
00146       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00147       pThisNode->m_hAddDeviceDlg = NULL;
00148       break;
00149     }
00150     default:
00151       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00152   }
00153   return 0;
00154 }
00155
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Implementation of virtual methods
00159
00160
00161 //---------------------------------------------------------------------------
00162 HRESULT CStaticNode::GetResultViewType2
00163 (
00164   MMC_COOKIE             nCookie,  //[in] Identifier of object
00165   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00166 )
00167 {
00168   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+sizeof(WCHAR) );
00169   if( NULL == pszDescStr )
00170     return E_OUTOFMEMORY;
00171
00172   wcscpy( pszDescStr, L"DefaultListView" );
00173   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00174
00175   return S_OK;
00176 }
00177
00178 //---------------------------------------------------------------------------
00179 HRESULT CStaticNode::GetDisplayInfo
00180 (
00181   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00182 )
00183 {
00184   _ASSERT( NULL != pSDI );
00185   pSDI->displayname = m_pwszNodeName;
00186
00187   return S_OK;
00188 }
00189
00190 //---------------------------------------------------------------------------
00191 HRESULT CStaticNode::GetDisplayInfo
00192 (
00193   RESULTDATAITEM* pRDI
00194 )
00195 {
00196   // This method will not get called since the static node is never
00197   // displayed in the result pane
00198   return S_FALSE;
00199 }
00200
00201 /////////////////////////////////////////////////////////////////////////////
00202 // Implementation of notification handlers
00203
00204 //---------------------------------------------------------------------------
00205 HRESULT CStaticNode::OnShow
00206 (
00207   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00208   LPARAM        nArg,          //[in] TRUE if node was selcted
00209   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00210   LONG_PTR      pComponent     //[in] Points to calling IComponent
00211 )
00212 {
00213   HRESULT  hResult = S_FALSE;
00214
00215   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00216
00217   LPHEADERCTRL2  ipHeaderCtrl = NULL;
00218   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL, (LONG_PTR*)&ipHeaderCtrl );
00219   if( S_OK != hResult )
00220    return hResult;
00221
00222   LPRESULTDATA  ipResultData = NULL;
00223   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00224   if( S_OK != hResult )
00225    return hResult;
00226
00227
00228   if( TRUE == nArg )  // Selecting a scope node
00229   {
00230     do
00231     {
00232       hResult = ipHeaderCtrl->InsertColumn( 0, L"Device Name", 0, 150 );
00233       BREAK_ON_ERROR( hResult );
00234
00235       hResult = ipHeaderCtrl->InsertColumn( 1, L"Status", 0, 150 );
00236       BREAK_ON_ERROR( hResult );
00237
00238       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00239       BREAK_ON_ERROR( hResult );
00240
00241     }while(0);
00242   }
00243   else // not handling deselect notifications
00244   {
00245   }
00246
00247   //TRACE_HRESULT(_T("OnShow"), hResult );
00248   return hResult;
00249 }
00250
00251
00252 //---------------------------------------------------------------------------
00253 HRESULT CStaticNode::OnSelect
00254 (
00255   LPDATAOBJECT   ipDataObject,   //[in] Points to the selected data object
00256   LPARAM         nArg,           //[in] Status of selected item
00257   LPARAM         nParam,         //[in] Not used
00258   LONG_PTR       pComponent      //[in] Pointer to parent CComponent
00259 )
00260 {
00261   BOOL    fScopePane = LOWORD(nArg);
00262   BOOL    fSelected  = HIWORD(nArg);
00263   HRESULT hResult    = S_FALSE;
00264
00265   if( NULL == ipDataObject )           // Can get this when closing the SnapIn
00266     return hResult;
00267
00268   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00269   LPCONSOLEVERB  ipConsoleVerb = NULL;
00270   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00271   if( S_OK != hResult )
00272     return hResult;
00273
00274
00275   if( TRUE == fScopePane && TRUE == fSelected )
00276   {
00277     // This is where we will set verbs in later versions
00278   }
00279
00280   TRACE_HRESULT(_T("OnSelect"), hResult );
00281   return hResult;
00282
00283 }
00284
00285 //---------------------------------------------------------------------------
00286 //  The static node is a special case.  The CComponentData pointer is also
00287 //  our parent so we don't need to use the pCompData parameter
00288 //
00289 HRESULT CStaticNode::OnExpand
00290 (
00291   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00292   LPARAM         nArg,         //[in] TRUE if node was selcted
00293   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00294   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00295 )
00296 {
00297   HRESULT hResult = S_FALSE;
00298
00299   if( NULL == m_hStaticNode )          // Cache the root node handle
00300     m_hStaticNode = (HSCOPEITEM)nParam;
00301
00302   if( NULL == m_pCompData )
00303     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00304
00305   // Request an IConsoleNameSpace2 pointer from CComponentData
00306   // The static node is a unique case since it's parent is also IComponentData
00307   //
00308   LPCONSOLENAMESPACE2 ipCNS = NULL;
00309   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00310   if( S_OK != hResult )
00311     return hResult;
00312
00313
00314   hResult = DeleteScopeItems( ipCNS );
00315   hResult = InsertScopeItems( ipCNS );
00316
00317   return hResult;
00318 }
00319
00320
00321 //---------------------------------------------------------------------------
00322 HRESULT CStaticNode::OnRemoveChildren
00323 (
00324   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00325   LPARAM         nArg,         //[in] TRUE if node was selcted
00326   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00327   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00328 )
00329 {
00330   HRESULT hResult = S_OK;
00331
00332   if( NULL == m_pCompData )
00333     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00334
00335
00336   POSITION   Pos   = m_NodeList.GetHeadPosition();
00337   LPBASENODE pNode = NULL;
00338   while( Pos )                         // Delete everything...
00339   {
00340     pNode = m_NodeList.GetNext( Pos );
00341     pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00342     delete pNode;
00343   }
00344
00345   m_NodeList.RemoveAll();              // Cleanup the list
00346
00347   //TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00348   return hResult;
00349 }
00350
00351 /////////////////////////////////////////////////////////////////////////////
00352 // Private helper methods
00353
00354
00355 //---------------------------------------------------------------------------
00356 //  Initializes the node list.
00357 //
00358 HRESULT CStaticNode::RefreshNodeList()
00359 {
00360   NODE_PROPERTIES NodeProps;
00361   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00362
00363   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00364   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00365
00366   WCHAR  szNames[2][32];
00367   wcscpy( szNames[0], L"RamDisk 0" );
00368   wcscpy( szNames[1], L"Archive 0" );
00369
00370   RemoveNodes();                       // Clean the node list
00371
00372   CDeviceNode* pNode = NULL;
00373   for( DWORD i = 0; i < 2; i++ )
00374   {
00375     wcscpy( NodeProps.szNodeName, szNames[i] );
00376     pNode = new CDeviceNode;
00377     pNode->Initialize( &NodeProps );
00378     m_NodeList.AddTail( pNode );
00379
00380     // Kind of a hack, make the second device a backup device
00381     NodeProps.dwAttributes |= ATTRIBUTE_BACKUP_DEVICE;
00382   }
00383
00384   return S_OK;
00385 }
00386
00387
00388 //---------------------------------------------------------------------------
00389 //  For these first level nodes the parent is always the static or root
00390 //  node.
00391 //
00392 HRESULT CStaticNode::InsertScopeItems
00393 (
00394   LPCONSOLENAMESPACE2 ipCNS    //[in] Needed to insert items
00395 )
00396 {
00397   _ASSERT( NULL != ipCNS );
00398   _ASSERT( NULL != m_hStaticNode );
00399
00400   HRESULT      hResult = S_FALSE;
00401   POSITION     Pos     = m_NodeList.GetHeadPosition();
00402   CDeviceNode* pNode   = NULL;
00403
00404   while( Pos )
00405   {
00406     pNode   = m_NodeList.GetNext( Pos );
00407     pNode->m_SDI.relativeID = m_hStaticNode;
00408     hResult = ipCNS->InsertItem( &pNode->m_SDI );
00409   }
00410
00411   return hResult;
00412 }
00413
00414
00415 //---------------------------------------------------------------------------
00416 //  Delete the HSCOPEITEMS only, we leave the list of nodes untouched
00417 //
00418 HRESULT CStaticNode::DeleteScopeItems
00419 (
00420   LPCONSOLENAMESPACE2 ipCNS    //[in] Needed to delete items
00421 )
00422 {
00423   _ASSERT( NULL != ipCNS );
00424
00425   POSITION    Pos     = m_NodeList.GetHeadPosition();
00426   HSCOPEITEM  hItem   = NULL;
00427   LPBASENODE  pNode   = NULL;
00428   HRESULT     hResult = S_FALSE;
00429
00430   while( Pos )                         // Delete everything...
00431   {
00432     pNode = m_NodeList.GetNext( Pos );
00433     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00434     if( 0 != hItem )
00435       hResult = ipCNS->DeleteItem( hItem, TRUE );
00436   }
00437
00438   return hResult;
00439
00440 }
00441
00442 //---------------------------------------------------------------------------
00443 //  We do this instead of just calling RemoveAll() because our list contains
00444 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00445 //  the derived class object.
00446 //
00447 VOID CStaticNode::RemoveNodes()
00448 {
00449   LPBASENODE pNode = NULL;
00450   POSITION   Pos   = m_NodeList.GetHeadPosition();
00451   while( Pos )
00452   {
00453     pNode = m_NodeList.GetNext( Pos );
00454     delete pNode;
00455   }
00456   m_NodeList.RemoveAll();              // Clean the list
00457 }
00458
00459 //---------------------------------------------------------------------------
00460 HRESULT CStaticNode::AddDeviceNode
00461 (
00462   NODE_PROPERTIES*    pProps   //[in] Properties for the new node
00463 )
00464 {
00465   _ASSERT( NULL != pProps );
00466
00467   CDeviceNode* pNode   = NULL;
00468   HRESULT      hResult = S_FALSE;
00469
00470   // In this case we always have the same parent
00471   pProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00472   pProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00473
00474   pNode = new CDeviceNode;         // Create and initialize the new
00475   pNode->Initialize( pProps );     // node, then add to our linked
00476   m_NodeList.AddTail( pNode );     // list, then insert the node
00477
00478   pNode->m_SDI.relativeID = m_hStaticNode;
00479
00480   LPCONSOLENAMESPACE2 ipCNS = NULL;
00481   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00482   if( S_OK != hResult )
00483     return hResult;
00484
00485   hResult = ipCNS->InsertItem( &pNode->m_SDI );
00486
00487   return hResult;
00488 }
00489
00490 //---------------------------------------------------------------------------
00491 //  Get the selected node and call it's ToggleStatus method
00492 //
00493 VOID CStaticNode::ToggleStatus
00494 (
00495   LPDATAOBJECT ipDataObject
00496 )
00497 {
00498   CDeviceNode* pNode = (CDeviceNode*)ExtractBaseNodePtr( ipDataObject );
00499   if( NULL != pNode )
00500     pNode->ToggleStatus();
00501
00502 }
00503
00504
00505 /////////////////////////////////////////////////////////////////////////////
00506 //  Support for Context Menus
00507
00508 //---------------------------------------------------------------------------
00509 //  NOTE:  Don't AddRef ipCallback.  Check docs.
00510 //
00511 HRESULT CStaticNode::AddMenuItems
00512 (
00513   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00514   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00515 )
00516 {
00517   _ASSERT( NULL != ipCallback );
00518   HRESULT hResult = S_FALSE;
00519
00520   static CONTEXTMENUITEM ctxMenu;
00521     ctxMenu.lCommandID        = IDM_NEW_DEVICE;
00522     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00523     ctxMenu.fSpecialFlags     = 0;
00524     ctxMenu.strName           = L"New Device...";
00525     ctxMenu.strStatusBarText  = L"Add a new device";
00526
00527
00528   if( NULL == m_hAddDeviceDlg )    // If the AddDevice dialog is running
00529     ctxMenu.fFlags = 0;            // gray the menu selection
00530   else
00531     ctxMenu.fFlags = MF_GRAYED;
00532
00533
00534   // Add the 'New Device' option to the New menu if allowed...
00535   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00536   {
00537     hResult = ipCallback->AddItem( &ctxMenu );
00538   }
00539
00540   return hResult;
00541 }
00542
00543
00544 //---------------------------------------------------------------------------
00545 HRESULT CStaticNode::Command
00546 (
00547   long lCommandID          //[in] Indentifier for menu ID
00548 )
00549 {
00550   HRESULT hResult = S_OK;
00551
00552   switch( lCommandID )
00553   {
00554     case IDM_NEW_DEVICE:
00555     {
00556       CAddDeviceDlg* pDlg = new CAddDeviceDlg( IDD_ADDDEVICE_DLG, m_hMessageWnd );
00557       m_hAddDeviceDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00558       break;
00559     }
00560     default:
00561     {
00562       hResult = S_FALSE;
00563       break;
00564     }
00565   }
00566   return hResult;
00567 }
00568
00569
00570 /////////////////////////////////////////////////////////////////////////////
00571 //  Toolbar methods
00572
00573 //---------------------------------------------------------------------------
00574 HRESULT CStaticNode::ControlbarNotify
00575 (
00576   LPARAM     nArg,         //[in] Selection status
00577   LPARAM     lParam,       //[in] Not used
00578   LONG_PTR   pComp         //[in] Points to CComponent
00579 )
00580 {
00581   HRESULT hResult = S_FALSE;
00582   BOOL bScope  = (BOOL)LOWORD(nArg);
00583   BOOL bSelect = (BOOL)HIWORD(nArg);
00584
00585   CComponent* pComponent = reinterpret_cast<CComponent*>(pComp);
00586
00587   IControlbar* ipControlbar = NULL;
00588   hResult = pComponent->GetInterface( REQUEST_ICONTROLBAR, (LONG_PTR*)&ipControlbar );
00589   if( S_OK != hResult )
00590     return hResult;
00591
00592   IToolbar* ipToolbar = NULL;
00593   hResult = pComponent->GetInterface( REQUEST_ISTATICTOOLBAR, (LONG_PTR*)&ipToolbar );
00594   if( S_OK != hResult )
00595     return hResult;
00596
00597   if( TRUE == bSelect )
00598   {
00599     hResult = ipControlbar->Attach(TOOLBAR, (LPUNKNOWN)ipToolbar);
00600     hResult = ipToolbar->SetButtonState( IDM_NEW_DEVICE, ENABLED, TRUE );
00601   }
00602   else
00603   {
00604     hResult = ipControlbar->Detach( (LPUNKNOWN)ipToolbar );
00605   }
00606
00607   return hResult;
00608 }
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/PerfUtil.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll

PerfUtil.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1992 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 Module Name:
00011
00012     perfutil.h
00013
00014 Abstract:
00015
00016     This file supports routines used to parse and
00017     create Performance Monitor Data Structures.
00018     It actually supports Performance Object types with
00019     multiple instances
00020
00021 Revision History:
00022
00023
00024 --*/
00025 #ifndef _PERFUTIL_H_
00026 #define _PERFUTIL_H_
00027
00028 //  Utility macro.  This is used to reserve a DWORD multiple of
00029 //  bytes for Unicode strings embedded in the definitional data,
00030 //  viz., object instance names.
00031 //
00032 #define DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))
00033
00034 //    (assumes dword is 4 bytes long and pointer is a dword in size)
00035 #define ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))
00036
00037 extern WCHAR  GLOBAL_STRING[];      // Global command (get all local ctrs)
00038 extern WCHAR  FOREIGN_STRING[];           // get data from foreign computers
00039 extern WCHAR  COSTLY_STRING[];
00040 extern WCHAR  NULL_STRING[];
00041
00042 #define QUERY_GLOBAL    1
00043 #define QUERY_ITEMS     2
00044 #define QUERY_FOREIGN   3
00045 #define QUERY_COSTLY    4
00046
00047 //
00048 // The definition of the only routine of perfutil.c, It builds part of a
00049 // performance data instance (PERF_INSTANCE_DEFINITION) as described in
00050 // winperf.h
00051 //
00052
00053 // from PerfUtil.C
00054
00055 HANDLE MonOpenEventLog ();
00056 VOID MonCloseEventLog ();
00057 DWORD GetQueryType (IN LPWSTR);
00058 BOOL IsNumberInUnicodeList (DWORD, LPWSTR);
00059 BOOL MonBuildInstanceDefinition(
00060                                PERF_INSTANCE_DEFINITION *pBuffer,
00061                                PVOID *pBufferNext,
00062                                DWORD ParentObjectTitleIndex,
00063                                DWORD ParentObjectInstance,
00064                                DWORD UniqueID,
00065                                LPWSTR  Name
00066                                );
00067
00068 #endif  //_PERFUTIL_H_
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tallmenu/tallmenu.c Source File

  • WinUI
  • tallmenu

tallmenu.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  *  TallMenu.c
00004  *
00005  *  Copyright (c) 1997-2002 Microsoft Corporation.
00006  *
00007  *  All rights reserved.
00008  *
00009  *       This source code is only intended as a supplement to
00010  *       Development Tools and/or SDK documentation.
00011  *       See these sources for detailed information regarding the
00012  *       Microsoft samples programs.
00013  *
00014  *   THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00015  *   ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00016  *   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017  *   PARTICULAR PURPOSE.
00018  *
00019  *  Abstract:
00020  *
00021  *      Sample program to demonstrate how a program can display a
00022  *      tall menu without the menu going off the top or bottom of
00023  *      the work area.
00024  *
00025  *****************************************************************************/
00026
00027 #include "tallmenu.h"
00028
00029 /*****************************************************************************
00030  *
00031  *      Overview
00032  *
00033  *      To split a tall menu into multiple columns, add the
00034  *      MF_MENUBREAK attribute on each item that should start
00035  *      in a new column.
00036  *
00037  *      To apply this dynamically to a menu, walk through the items
00038  *      on the menu, tallying their cumulative heights.  When the
00039  *      height exceeds the height of the screen, place the next
00040  *      item in a new column.
00041  *
00042  *****************************************************************************/
00043
00044 #define COMPILE_MULTIMON_STUBS
00045 #include <multimon.h>
00046
00047 /*****************************************************************************
00048  *
00049  *      GetWorkArea
00050  *
00051  *      This function takes a window handle and returns the dimensions
00052  *      of the work area associated with that window.
00053  *
00054  *      Ask the system which monitor the window is on and use the
00055  *      work area of that monitor.
00056  *
00057  *****************************************************************************/
00058
00059 void
00060 GetWorkArea(HWND hwnd, LPRECT prcWork)
00061 {
00062     HMONITOR hmon;
00063     MONITORINFO moni;
00064
00065     hmon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);
00066
00067     moni.cbSize = sizeof(moni);
00068     GetMonitorInfo(hmon, &moni);
00069
00070     *prcWork = moni.rcWork;
00071 }
00072
00073 /*****************************************************************************
00074  *
00075  *      AdjustTallMenu
00076  *
00077  *      The function takes a tall menu and adds/removes MF_MENUBREAK
00078  *      attributes so that the menu is not taller than the screen.
00079  *
00080  *      The job is made trickier by multiple monitor support.  Each
00081  *      monitor may have a different height, and we must make sure
00082  *      to use the height appropriate to the monitor associated with
00083  *      the menu.
00084  *
00085  *      hwnd - The window associated with the menu
00086  *      hmenuPopup - The popup menu to adjust
00087  *
00088  *****************************************************************************/
00089
00090 void
00091 AdjustTallMenu(HWND hwnd, HMENU hmenuPopup)
00092 {
00093     int cyScreen, cyItem, cy;
00094     int iItem, cItem;
00095     RECT rc;
00096
00097     /*
00098      *  Early-out: If the menu is empty, then there is nothing to adjust.
00099      *  This saves us from boundary conditions in the rest of the code.
00100      */
00101     cItem = GetMenuItemCount(hmenuPopup);
00102     if (cItem == 0) return;
00103
00104     GetWorkArea(hwnd, &rc);
00105
00106     /*
00107      *  Convert rectangle boundaries to height.
00108      */
00109     cyScreen = rc.bottom - rc.top;
00110
00111     /*
00112      *  Subtract off some extra to account for the border around the menu.
00113      *  Note that this doesn't need to be exact, since this entire process
00114      *  of adjusting a tall menu is a heuristic anyway.
00115      */
00116
00117     cyScreen -= 2 * 3 * GetSystemMetrics(SM_CYEDGE);
00118
00119     /*
00120      *  Warning!  We assume that the menu is not owner-draw!
00121      *
00122      *  Extending this code to support owner-draw menu items is left
00123      *  as an exercise for the reader.  (Hint: WM_MEASUREITEM is your
00124      *  friend.)
00125      */
00126     GetMenuItemRect(hwnd, hmenuPopup, 0, &rc);
00127     cyItem = rc.bottom - rc.top;
00128
00129     /*
00130      *  cyItem is zero if the menu item has never been shown, in which
00131      *  case we cheat and use the menu bar height, which is a reasonable
00132      *  approximation to the menu item height.
00133      */
00134     if (cyItem == 0) {
00135         cyItem = GetSystemMetrics(SM_CYMENU);
00136     }
00137
00138     /*
00139      *  Now walk through the menu tallying up the height of each item.
00140      *  When it gets too tall, insert a break.
00141      *
00142      *  An annoying feature of SetMenuItemInfo is that you can't change
00143      *  the MFT_MENUBARBREAK flag without resetting the text, so we
00144      *  have to get the text, flip the flag, and set the text back
00145      *  with the new flag.
00146      */
00147
00148     cy = 0;
00149     for (iItem = 0; iItem < cItem; iItem++) {
00150         MENUITEMINFO mii;
00151         TCHAR buf[80];
00152
00153         mii.cbSize = sizeof(mii);
00154         mii.fMask = MIIM_TYPE | MIIM_DATA;
00155         mii.dwTypeData = buf;
00156         mii.cch = 80;
00157
00158         if (GetMenuItemInfo(hmenuPopup, iItem, MF_BYPOSITION, &mii)) {
00159             if (cy > cyScreen) {
00160                 cy = 0;
00161                 mii.fType |= MFT_MENUBARBREAK;
00162             } else {
00163                 mii.fType &= ~MFT_MENUBARBREAK;
00164             }
00165
00166             SetMenuItemInfo(hmenuPopup, iItem, MF_BYPOSITION, &mii);
00167         }
00168         cy += cyItem;
00169     }
00170
00171 }
00172
00173 /*****************************************************************************
00174  *
00175  *  TallMenu_WndProc
00176  *
00177  *      Window procedure for tall menu demo.
00178  *
00179  *****************************************************************************/
00180
00181 LRESULT CALLBACK
00182 TallMenu_WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
00183 {
00184     switch (uiMsg) {
00185
00186     /*
00187      *  If a popup menu is about to be displayed, first make sure
00188      *  it isn't too tall for the screen.
00189      */
00190     case WM_INITMENUPOPUP:
00191         AdjustTallMenu(hwnd, (HMENU)wParam);
00192         break;
00193
00194     /*
00195      *  The app exits when this window is destroyed.
00196      */
00197     case WM_DESTROY:
00198         PostQuitMessage(0);
00199         break;
00200     }
00201
00202     return DefWindowProc(hwnd, uiMsg, wParam, lParam);
00203 }
00204
00205 /*****************************************************************************
00206  *
00207  *  WinMain
00208  *
00209  *      Program entry point.
00210  *
00211  *      Demonstrate tall menus and how to prevent them from going off
00212  *      the screen.
00213  *
00214  *****************************************************************************/
00215
00216 int WINAPI
00217 WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
00218 {
00219     WNDCLASS wc;
00220     MSG msg;
00221     HWND hwnd;
00222
00223     wc.style = 0;
00224     wc.lpfnWndProc = TallMenu_WndProc;
00225     wc.cbClsExtra = 0;
00226     wc.cbWndExtra = 0;
00227     wc.hInstance = hinst;
00228     wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
00229     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00230     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
00231     wc.lpszMenuName = "TallMenu";
00232     wc.lpszClassName = "TallMenu";
00233
00234     RegisterClass(&wc);
00235
00236     hwnd = CreateWindow(
00237         "TallMenu",                     /* Class Name */
00238         "Tall Menu Sample",             /* Title */
00239         WS_OVERLAPPEDWINDOW,            /* Style */
00240         CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
00241         CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
00242         NULL,                           /* Parent */
00243         NULL,                           /* Use class menu */
00244         hinst,                          /* Instance */
00245         0);                             /* No special parameters */
00246
00247     ShowWindow(hwnd, nCmdShow);
00248
00249     while (GetMessage(&msg, NULL, 0, 0)) {
00250         TranslateMessage(&msg);
00251         DispatchMessage(&msg);
00252     }
00253
00254     return 0;
00255 }
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/AppInstallDlg.h Source File

  • Com
  • Administration
  • Explore.VC

AppInstallDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019
00020 #if !defined(AFX_APPINSTALLDLG_H__0B7BB73A_B53B_11D2_86A8_000000000000__INCLUDED_)
00021 #define AFX_APPINSTALLDLG_H__0B7BB73A_B53B_11D2_86A8_000000000000__INCLUDED_
00022
00023 #if _MSC_VER > 1000
00024 #pragma once
00025 #endif // _MSC_VER > 1000
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CAppInstallDlg dialog
00029
00030 class CAppInstallDlg : public CDialog
00031 {
00032 // Construction
00033 public:
00034   void set_Catalog(ICOMAdminCatalog* pCatalog);
00035   CAppInstallDlg(CWnd* pParent = NULL);   // standard constructor
00036
00037 // Dialog Data
00038   //{{AFX_DATA(CAppInstallDlg)
00039   enum { IDD = IDD_INSTALL_APPLICATION };
00040   CEdit m_edtUID;
00041   CEdit m_edtPWD;
00042   CEdit m_edtRemoteServerName;
00043   CEdit m_edtInstallDir;
00044   CEdit m_edtAppFile;
00045   //}}AFX_DATA
00046
00047
00048 // Overrides
00049   // ClassWizard generated virtual function overrides
00050   //{{AFX_VIRTUAL(CAppInstallDlg)
00051   protected:
00052   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00053   //}}AFX_VIRTUAL
00054
00055 // Implementation
00056 protected:
00057   HICON m_hIcon;
00058
00059   // Generated message map functions
00060   //{{AFX_MSG(CAppInstallDlg)
00061   afx_msg void OnClose();
00062   virtual void OnOK();
00063   afx_msg void OnAppFileSearch();
00064   afx_msg void OnInstallDirSearch();
00065   virtual BOOL OnInitDialog();
00066   afx_msg void OnInstallWithUsers();
00067   afx_msg void OnInstallWithoutUsers();
00068   afx_msg void OnOverwriteFiles();
00069   afx_msg void OnRemoteServerInstall();
00070   //}}AFX_MSG
00071   DECLARE_MESSAGE_MAP()
00072 private:
00073   void ToggleRemoteServerState(bool Flag);
00074   bool m_bRemoteInstall;
00075   bool m_bOverwriteFiles;
00076   int m_nInstallType;
00077   void ReleaseCatalog();
00078   ICOMAdminCatalog* m_pCatalog;
00079 };
00080
00081 //{{AFX_INSERT_LOCATION}}
00082 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00083
00084 #endif // !defined(AFX_APPINSTALLDLG_H__0B7BB73A_B53B_11D2_86A8_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/Registry.Cpp Source File

  • SysMgmt
  • MMC
  • Help

Registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091   _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123   MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124   _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,   // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154   MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/sky.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_ADODynaCollectionVtbl Member List

This is the complete list of members for _ADODynaCollectionVtbl, including all inherited members.
c | _ADODynaCollectionVtbl
cNames | _ADODynaCollectionVtbl
dispIdMember | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Count)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *_NewEnum)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Refresh)(_ADODynaCollection __RPC_FAR *This) | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Append)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Delete)(_ADODynaCollection __RPC_FAR *This | _ADODynaCollectionVtbl
Index | _ADODynaCollectionVtbl
iTInfo | _ADODynaCollectionVtbl
lcid | _ADODynaCollectionVtbl
lcid | _ADODynaCollectionVtbl
lcid | _ADODynaCollectionVtbl
Object | _ADODynaCollectionVtbl
pctinfo | _ADODynaCollectionVtbl
pDispParams | _ADODynaCollectionVtbl
pExcepInfo | _ADODynaCollectionVtbl
ppTInfo | _ADODynaCollectionVtbl
ppvObject | _ADODynaCollectionVtbl
ppvObject | _ADODynaCollectionVtbl
puArgErr | _ADODynaCollectionVtbl
pVarResult | _ADODynaCollectionVtbl
rgDispId | _ADODynaCollectionVtbl
rgszNames | _ADODynaCollectionVtbl
riid | _ADODynaCollectionVtbl
riid | _ADODynaCollectionVtbl
riid | _ADODynaCollectionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(_ADODynaCollection __RPC_FAR *This) | _ADODynaCollectionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(_ADODynaCollection __RPC_FAR *This) | _ADODynaCollectionVtbl
wFlags | _ADODynaCollectionVtbl
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/InstCodc/Resource.h Source File

  • Web
  • NetMeeting
  • InstCodc

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by instcodc.rc
00004 //
00005 #define IDS_GETIAUDIO                   2
00006 #define IDS_RAFMT                       13
00007 #define IDS_AAFMT                       14
00008 #define IDS_IAFMT                       16
00009 #define IDS_UAFMT                       17
00010 #define IDD_MAINUI                      101
00011 #define IDD_REORDER                     106
00012 #define IDI_INSTCODC                    108
00013 #define IDC_OK                          1002
00014 #define IDC_CANCEL                      1003
00015 #define IDC_INSTALL                     1004
00016 #define IDC_DOWN                        1005
00017 #define IDC_UNINSTALL                   1006
00018 #define IDC_REORDER                     1020
00019 #define IDC_UP                          1025
00020 #define IDC_LBINSTALLEDCODECS           1043
00021
00022 // Next default values for new objects
00023 //
00024 #ifdef APSTUDIO_INVOKED
00025 #ifndef APSTUDIO_READONLY_SYMBOLS
00026 #define _APS_NEXT_RESOURCE_VALUE        109
00027 #define _APS_NEXT_COMMAND_VALUE         40017
00028 #define _APS_NEXT_CONTROL_VALUE         1045
00029 #define _APS_NEXT_SYMED_VALUE           101
00030 #endif
00031 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • Simple

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CStaticNode implementation
00027 //
00028 //
00029 CStaticNode::CStaticNode()
00030 {
00031 }
00032
00033 CStaticNode::~CStaticNode()
00034 {
00035
00036 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/idl/comspyctl.idl Source File

  • Com
  • Administration
  • Spy
  • idl

comspyctl.idl

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include <olectl.h>
00018
00019 // This file will be processed by the MIDL tool to
00020 // produce the type library (ComSpyCtl.tlb) and marshalling code.
00021 cpp_quote ("#define DISPID_LOGFILE    5")
00022 cpp_quote ("#define DISPID_GRIDLINES  6")
00023 cpp_quote ("#define DISPID_COLWIDTH   8")
00024 cpp_quote ("#define DISPID_AUDIT    17")
00025
00026 typedef enum
00027 {
00028   Application = 0,
00029   Thread,
00030   Instance,
00031   Transaction,
00032   Method,
00033   Object,
00034   Resource,
00035   User,
00036   Security,
00037   ObjectPool,
00038   ObjectPool2,
00039   ObjectConstruction,
00040   Activity,
00041   Identity,
00042   QC,
00043   Exception,
00044   CRM,
00045   //System Events
00046   EventStore,
00047   LoadBalancing,
00048 } EventEnum;
00049
00050
00051 import "oaidl.idl";
00052 import "ocidl.idl";
00053
00054
00055   [
00056     object,
00057     uuid(A9B39080-AAD0-11D0-B183-00AA00BA3258),
00058     dual,
00059     helpstring("IComSpy Interface"),
00060     pointer_default(unique)
00061   ]
00062   interface IComSpy : IDispatch
00063   {
00064     [propget, id(DISPID_HWND)]
00065     HRESULT Window([out, retval]LONG_PTR * phwnd);
00066     [propputref, id(DISPID_FONT)]
00067     HRESULT Font([in]IFontDisp* pFont);
00068     [propput, id(DISPID_FONT)]
00069     HRESULT Font([in]IFontDisp* pFont);
00070     [propget, id(DISPID_FONT)]
00071     HRESULT Font([out, retval]IFontDisp** ppFont);
00072     [propget, id(5), helpstring("property LogFile")] HRESULT LogFile([out, retval] BSTR *pVal);
00073     [propput, id(5), helpstring("property LogFile")] HRESULT LogFile([in] BSTR newVal);
00074     [propget, id(6), helpstring("property ShowGridLines")] HRESULT ShowGridLines([out, retval] BOOL *pVal);
00075     [propput, id(6), helpstring("property ShowGridLines")] HRESULT ShowGridLines([in] BOOL newVal);
00076     [propget, id(8), helpstring("property ColWidth")] HRESULT ColWidth(short nColumn, [out, retval] long *pVal);
00077     [propput, id(8), helpstring("property ColWidth")] HRESULT ColWidth(short nColumn, [in] long newVal);
00078     [id(9), helpstring("method SelectApplications")] HRESULT SelectApplications();
00079     [id(10), helpstring("method SaveToFile")] HRESULT SaveToFile();
00080     [id(11), helpstring("method ClearAllEvents")] HRESULT ClearAllEvents();
00081     [id(12), helpstring("method About")] HRESULT About();
00082     [propget, id(13), helpstring("property LogToFile")] HRESULT LogToFile([out, retval] BOOL *pVal);
00083     [propput, id(13), helpstring("property LogToFile")] HRESULT LogToFile([in] BOOL newVal);
00084     [id(14), helpstring("method ChooseFont")] HRESULT ChooseFont();
00085     [propget, id(15), helpstring("property ShowOnScreen")] HRESULT ShowOnScreen([out, retval] BOOL *pVal);
00086     [propput, id(15), helpstring("property ShowOnScreen")] HRESULT ShowOnScreen([in] BOOL newVal);
00087     [id(16), helpstring("method ChooseLogFile")] HRESULT ChooseLogFile([out] BSTR * sLogFileName, [out] BOOL * bCanceled);
00088     [propget, id(17), helpstring("property Audit")] HRESULT Audit([out, retval] BOOL *pVal);
00089     [propput, id(17), helpstring("property Audit")] HRESULT Audit([in] BOOL newVal);
00090
00091   };
00092   [
00093
00094     uuid(0243D433-3849-11d2-89BB-00C04F99140F),
00095
00096     helpstring("ICOMSysLCE Interface"),
00097     pointer_default(unique)
00098   ]
00099   interface ICOMSysLCE : IUnknown
00100   {
00101     [helpstring("method GetEventType")] HRESULT GetEventType([out] EventEnum * e);
00102     [helpstring("method GetEventClass")] HRESULT GetEventClass([out] LPGUID guid);
00103     [helpstring("method Install")] HRESULT Install([in] BSTR* PropertyName, [in] VARIANT PropertyValue);
00104     [helpstring("method Uninstall")] HRESULT Uninstall();
00105   };
00106 [
00107   uuid(A9B39071-AAD0-11D0-B183-00AA00BA3258),
00108   version(1.0),
00109   helpstring("COMSpyCtl 1.0 Type Library")
00110 ]
00111 library COMSPYCTLLib
00112 {
00113   importlib("stdole2.tlb");
00114
00115   [
00116     uuid(A9B39081-AAD0-11D0-B183-00AA00BA3258),
00117     helpstring("COM Spy ActiveX Control")
00118   ]
00119   coclass ComSpy
00120   {
00121     [default] interface ICOMSpy;
00122   };
00123
00124
00125   [
00126     uuid(AAF6270D-AC5E-11D0-B185-00AA00BA3258),
00127     helpstring("COMSpyPropPage Class")
00128   ]
00129   coclass ComSpyPropPage
00130   {
00131     interface IUnknown;
00132   };
00133 };
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/Imp_Dlg.h Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

Imp_Dlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // Imp_DrawDlg.h : header file
00013 //
00014
00015 #import <mqoa.tlb> no_namespace
00016
00017 #include "EvHandle.h"
00018 #include "drawarea.h"
00019
00020 #if !defined(AFX_IMP_DRAWDLG_H__02EE0038_FC6D_11D0_A14D_00C04FB9D5DF__INCLUDED_)
00021 #define AFX_IMP_DRAWDLG_H__02EE0038_FC6D_11D0_A14D_00C04FB9D5DF__INCLUDED_
00022
00023 #if _MSC_VER >= 1000
00024 #pragma once
00025 #endif // _MSC_VER >= 1000
00026
00027 #define MAXNUMLEN 7
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // CImp_DrawDlg dialog
00031
00032 class CImp_DrawDlg : public CDialog
00033 {
00034 // Construction
00035 public:
00036   void initializeUI(BOOL fConnectedToDS);
00037   BOOL IsDsEnabledLocaly();
00038   CImp_DrawDlg(CWnd* pParent = NULL); // standard constructor
00039   ~CImp_DrawDlg();
00040
00041 // Dialog Data
00042   //{{AFX_DATA(CImp_DrawDlg)
00043   enum { IDD = IDD_IMP_DRAW_DIALOG };
00044   CDrawArea m_drawScribble;
00045   CString m_csFriendName;
00046   int   m_iRadio;
00047   CStatic m_cComputerLabel;
00048   CButton m_CancelButton;
00049   CStatic m_cQueueLabel;
00050   CButton m_cMessageFrame;
00051   CButton m_cDsFrame;
00052   CButton m_cRadioExpress;
00053   CButton m_cRadioDS;
00054   CEdit m_cComputerInput;
00055   CEdit m_cQueueInput;
00056   CButton m_cContinueButton;
00057   CButton m_btnAttach;
00058   int   m_iRadioDS;
00059   CString m_strRemoteComputerName;
00060     CButton m_cRadioWorkgroup;
00061     CButton m_cRadioRecoverable;
00062     //}}AFX_DATA
00063
00064
00065
00066
00067   struct Line
00068   {
00069     long X1;
00070     long Y1;
00071     long X2;
00072     long Y2;
00073   };
00074
00075   _variant_t      m_vtLogin;
00076   _variant_t      m_vtFriendName;
00077   _variant_t      m_vtguidDraw;
00078
00079   long  m_lLastX;
00080   long  m_lLastY;
00081
00082   int     m_cLines;
00083   int     m_iArraySize;
00084   CString   m_csScreenText;
00085   int     m_iWasText;
00086   CString   m_csLogin;
00087
00088   IMSMQQueuePtr   m_queue;
00089   IMSMQEventPtr   m_qevent;
00090   IMSMQQueuePtr   m_qFriend;
00091   IMSMQMessagePtr   m_msgOut;
00092
00093   void SendMouseMovement(LINE line);
00094   void SendKeystroke(UINT uChar);
00095
00096   void Arrived( /*[in]*/ IDispatch* pdispQueue,
00097           /*[in]*/ long lErrorCode,
00098           /*[in]*/ long lCursor);
00099
00100   void HandleErrors(_com_error &comerr);
00101   // ClassWizard generated virtual function overrides
00102   //{{AFX_VIRTUAL(CImp_DrawDlg)
00103   protected:
00104   virtual void DoDataExchange(CDataExchange* pDX);  // DDX/DDV support
00105   //}}AFX_VIRTUAL
00106
00107 // Implementation
00108 protected:
00109   BOOL OpenPrivateReceiveQueue();
00110   BOOL OpenReceiveQueue();
00111   BOOL m_fDsEnabledLocaly;
00112   HICON m_hIcon;
00113
00114   CString GetUserName();
00115   CString GetComputerName();
00116   CString LoginPrompt(CString DefaultName);
00117
00118   CMSMQEventHandler*  m_pHandler;
00119   // Generated message map functions
00120   //{{AFX_MSG(CImp_DrawDlg)
00121   virtual BOOL OnInitDialog();
00122   afx_msg void OnPaint();
00123   afx_msg HCURSOR OnQueryDragIcon();
00124   afx_msg void OnButtonAttach();
00125   afx_msg void OnConnect();
00126   //}}AFX_MSG
00127   DECLARE_MESSAGE_MAP()
00128
00129
00130 };
00131
00132 //{{AFX_INSERT_LOCATION}}
00133 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00134
00135 #endif // !defined(AFX_IMP_DRAWDLG_H__02EE0038_FC6D_11D0_A14D_00C04FB9D5DF__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CReceiveMessageDialog Member List

This is the complete list of members for CReceiveMessageDialog, including all inherited members.
CReceiveMessageDialog(CArray< ARRAYQ *, ARRAYQ * > *, CWnd *pParent=NULL) | CReceiveMessageDialog |
DoDataExchange(CDataExchange *pDX) | CReceiveMessageDialog | [protected, virtual]
GetBodySize() | CReceiveMessageDialog | [inline]
GetPathName(TCHAR szPathName[BUFFERSIZE]) | CReceiveMessageDialog | [inline]
GetTimeout() | CReceiveMessageDialog | [inline]
IDD enum value | CReceiveMessageDialog |
m_dwBodySize | CReceiveMessageDialog |
m_iTimeout | CReceiveMessageDialog |
m_PathNameCB | CReceiveMessageDialog |
m_pStrArray | CReceiveMessageDialog |
m_szPathName | CReceiveMessageDialog |
OnInitDialog() | CReceiveMessageDialog | [protected, virtual]
Generated on Wed Nov 13 2024 16:57:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/resource.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ContextMenuEx.rc
00004 //
00005 #define IDD_VFILE_PPAGE0                111
00006 #define IDD_PPAGE0                      111
00007 #define IDC_ATTR_COMPRESSED             1010
00008 #define IDC_ATTR_ENCRYPTED              1011
00009
00010 // Next default values for new objects
00011 //
00012 #ifdef APSTUDIO_INVOKED
00013 #ifndef APSTUDIO_READONLY_SYMBOLS
00014 #define _APS_NEXT_RESOURCE_VALUE        113
00015 #define _APS_NEXT_COMMAND_VALUE         40001
00016 #define _APS_NEXT_CONTROL_VALUE         1011
00017 #define _APS_NEXT_SYMED_VALUE           101
00018 #endif
00019 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkCollectorEvents Member List

This is the complete list of members for InkCollectorEvents, including all inherited members.
AddRef() | InkCollectorEvents | [inline, virtual]
AdviseInkCollector(IInkCollector *pIInkCollector) | InkCollectorEvents | [inline]
CursorButtonDown(IInkCursor *Cursor, IInkCursorButton *Button) | InkCollectorEvents | [inline, virtual]
CursorButtonUp(IInkCursor *Cursor, IInkCursorButton *Button) | InkCollectorEvents | [inline, virtual]
CursorDown(IInkCursor *Cursor, IInkStrokeDisp *Stroke) | InkCollectorEvents | [inline, virtual]
CursorInRange(IInkCursor *Cursor, VARIANT_BOOL NewCursor, VARIANT ButtonsState) | InkCollectorEvents | [inline, virtual]
CursorOutOfRange(IInkCursor *Cursor) | InkCollectorEvents | [inline, virtual]
DblClick(VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
Gesture(IInkCursor *Cursor, IInkStrokes *Strokes, VARIANT Gestures, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid) | InkCollectorEvents | [inline]
GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo) | InkCollectorEvents | [inline]
GetTypeInfoCount(UINT *pctinfo) | InkCollectorEvents | [inline]
Init() | InkCollectorEvents | [inline]
InkCollectorEvents() | InkCollectorEvents | [inline]
Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD, DISPPARAMS *pdispparams, VARIANT *pvarResult, EXCEPINFO *, UINT *) | InkCollectorEvents | [inline]
m_dwCookie | InkCollectorEvents | [private]
m_pIConnectionPoint | InkCollectorEvents | [private]
m_punkFTM | InkCollectorEvents | [private]
MouseDown(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long pX, long pY, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
MouseMove(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long pX, long pY, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
MouseUp(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long pX, long pY, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
MouseWheel(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long Delta, long X, long Y, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
NewInAirPackets(IInkCursor *Cursor, long lPacketCount, VARIANT *PacketData) | InkCollectorEvents | [inline, virtual]
NewPackets(IInkCursor *Cursor, IInkStrokeDisp *Stroke, long PacketCount, VARIANT *PacketData) | InkCollectorEvents | [inline, virtual]
QueryInterface(REFIID riid, void **ppvObject) | InkCollectorEvents | [inline]
Release() | InkCollectorEvents | [inline, virtual]
Stroke(IInkCursor *Cursor, IInkStrokeDisp *Stroke, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
SystemGesture(IInkCursor *Cursor, InkSystemGesture Id, long X, long Y, long Modifier, BSTR Character, long CursorMode) | InkCollectorEvents | [inline, virtual]
TabletAdded(IInkTablet *Tablet) | InkCollectorEvents | [inline, virtual]
TabletRemoved(long TabletId) | InkCollectorEvents | [inline, virtual]
UnadviseInkCollector() | InkCollectorEvents | [inline]
~InkCollectorEvents() | InkCollectorEvents | [inline]
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CS1Dialog Member List

This is the complete list of members for CS1Dialog, including all inherited members.
CDialogBase(HWND hWnd, HINSTANCE hInst) | CDialogBase |
ChangeTableName(LONG iIndex) | CS1Dialog | [virtual]
CreateTableNode(TREEINFO *rgTreeInfo, ULONG ulNameOffset, LONG iParam=0, LONG iImage=0, LONG iSelectedImage=0) | CS1Dialog | [virtual]
CS1Dialog(HWND hWnd, HINSTANCE hInst, CTableCopy *pTableCopy) | CS1Dialog |
Destroy() | CDialogBase | [virtual]
Display() | CS1Dialog | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CS1Dialog | [static]
GetTableColInfo(HWND hWndCol) | CS1Dialog | [virtual]
InitControls() | CS1Dialog | [virtual]
m_cTables | CS1Dialog |
m_fEditing | CS1Dialog |
m_hInst | CDialogBase |
m_hWnd | CDialogBase |
m_pCTableCopy | CS1Dialog |
m_rgTableInfo | CS1Dialog |
RefreshControls() | CS1Dialog | [virtual]
ResetColInfo(HWND hWndCol) | CS1Dialog | [virtual]
ResetTableList(HWND hWndTable, HWND hWndCol) | CS1Dialog | [virtual]
~CDialogBase() | CDialogBase | [virtual]
~CS1Dialog() | CS1Dialog | [virtual]
Generated on Wed Nov 13 2024 16:57:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/Client/Resource.h Source File

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • Client

Resource.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define IDD_CANCEL_DIALOG               101
00018 #define IDC_INPROC_STA2MTA              1019
00019 #define IDC_OUTPROC_STA2STA             1020
00020 #define IDC_INPROC_MTA2STA              1021
00021 #define IDC_INPROC_STA2MTA_CANCELACT    1022
00022 #define IDC_INPROC_STA2MTA_CANCELCALL   1023
00023 #define IDC_INPROC_MTA2STA_CANCELACT    1024
00024 #define IDC_INPROC_MTA2STA_CANCELCALL   1025
00025 #define IDC_OUTPROC_STA2MTA             1026
00026 #define IDC_OUTPROC_STA2STA_CANCELACT   1027
00027 #define IDC_OUTPROC_STA2STA_CANCELCALL  1028
00028 #define IDC_OUTPROC_STA2MTA_CANCELACT   1029
00029 #define IDC_OUTPROC_STA2MTA_CANCELCALL  1030
00030 #define IDC_OUTPROC_MTA2STA             1031
00031 #define IDC_OUTPROC_MTA2MTA             1032
00032 #define IDC_OUTPROC_MTA2STA_CANCELACT   1033
00033 #define IDC_OUTPROC_MTA2STA_CANCELCALL  1034
00034 #define IDC_OUTPROC_MTA2MTA_CANCELACT   1035
00035 #define IDC_OUTPROC_MTA2MTA_CANCELCALL  1036
00036 #define IDC_MACHINE                     1037
00037 #define IDC_INPROC_STA2STA              1038
00038 #define IDC_INPROC_STA2STA_CANCELACT    1039
00039 #define IDC_INPROC_STA2STA_CANCELCALL   1040
00040
00041 // Next default values for new objects
00042 //
00043 #ifdef APSTUDIO_INVOKED
00044 #ifndef APSTUDIO_READONLY_SYMBOLS
00045 #define _APS_NEXT_RESOURCE_VALUE        102
00046 #define _APS_NEXT_COMMAND_VALUE         40001
00047 #define _APS_NEXT_CONTROL_VALUE         1038
00048 #define _APS_NEXT_SYMED_VALUE           101
00049 #endif
00050 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/cMemb.h Source File

  • Web
  • NetMeeting
  • NMChat

cMemb.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       CMEMB.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 typedef struct tagUser {
00017   INmMember * pMember;
00018   LPTSTR pszName;
00019   ULONG  uVersion;
00020   BOOL   fLocal;
00021   BOOL   fMcu;
00022   BOOL   fTop;
00023 } USER;
00024 typedef USER * PUSER;
00025
00026 extern COBLIST * g_pListUser;
00027 extern INmMember * g_pMemberLocal;
00028
00029 // from cMemb.cpp
00030 VOID AddMember(INmMember * pMember);
00031 VOID RemoveMember(INmMember * pMember);
00032 VOID FreeAllUsers(void);
00033 VOID FreeUser(PUSER pUser);
00034 PUSER PUserFromINmMember(INmMember * pMember);
00035 INmMember * GetSelectedMember(void);
00036
00037
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/Cleanup.h Source File

  • WinUI
  • Shell
  • DiskCleanupHandler

Cleanup.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  Cleanup.h
00011 //
00012 //////////////////////////////////////////////////////////////////////
00013
00014 #ifndef _CLEANUP_H_INCLUDED
00015 #define _CLEANUP_H_INCLUDED
00016
00017 #if _MSC_VER > 1000
00018 #pragma once
00019 #endif // _MSC_VER > 1000
00020
00021 #include <windows.h>
00022 #include <olectl.h>
00023 #include <shellapi.h>
00024 #include <shlwapi.h>
00025 #include <shlobj.h>
00026 #include <emptyvc.h>
00027
00028 #define MAX_DISPLAY_LEN     100
00029 #define MAX_DESCRIPTION_LEN 500
00030 #define MAX_BUTTONTEXT_LEN  25
00031
00032 #define MAKEDWORDLONG(high,low) ((DWORDLONG)(((high) << 32) | (low)))
00033 #define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
00034
00035 extern HINSTANCE hDllInstance;
00036 extern ULONG nDllRefCount;
00037
00038 //
00039 //  GetStringByteSize
00040 //
00041 //      Returns the number of bytes for a string, including the
00042 //      terminating NULL character
00043 //
00044 inline UINT GetStringByteSize (LPTSTR pszString) {return ((lstrlen(pszString) + 1) * sizeof(TCHAR));}
00045
00046 //
00047 //  GetStringByteSizeUnicode
00048 //
00049 //      Returns the number of bytes required to convert an ANSI
00050 //      string to UNICODE. Used in the sample when allocating
00051 //      memory for ANSI->UNICODE conversions
00052 //
00053 inline UINT GetStringByteSizeUnicode (LPCSTR pszString) {return ((lstrlen(pszString) + 1) * sizeof(WCHAR));}
00054
00055 #endif // _VCCLEANUP_H_INCLUDED
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/Resource.h Source File

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by PermEvents.rc
00004 //
00005 #define IDM_ABOUTBOX                    0x0010
00006 #define IDD_ABOUTBOX                    100
00007 #define IDS_ABOUTBOX                    101
00008 #define IDD_WBEMPERMEVENTS_DIALOG       102
00009 #define IDD_PERMEVENTS_DIALOG           102
00010 #define IDR_MAINFRAME                   128
00011 #define IDC_OUTPUTLIST                  1000
00012
00013 // Next default values for new objects
00014 //
00015 #ifdef APSTUDIO_INVOKED
00016 #ifndef APSTUDIO_READONLY_SYMBOLS
00017 #define _APS_NEXT_RESOURCE_VALUE        129
00018 #define _APS_NEXT_COMMAND_VALUE         32771
00019 #define _APS_NEXT_CONTROL_VALUE         1001
00020 #define _APS_NEXT_SYMED_VALUE           101
00021 #endif
00022 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerDraw/Connect.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerDraw

Connect.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CONNECT.H
00003
00004   Summary:   Include file declaring COM object classes and constants for
00005              managing the connection points (and their connections)
00006              exposed by the connectable objects in the PERDRAW server.
00007
00008              For a comprehensive tutorial code tour of this module's
00009              contents and offerings see the tutorial PERDRAW.HTM
00010              file. For more specific technical details on the internal
00011              workings see the comments dispersed throughout the module's
00012              source code.
00013
00014   Functions: .
00015
00016   Classes:   COEnumConnectionPoints, COConnectionPoint, and
00017              COEnumConnections.
00018
00019   Origin:    5-20-97: atrent - Editor inheritance from the STOSERVE COM
00020              Tutorial Code Sample. Very little change was required.
00021
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037 #if !defined(CONNECT_H)
00038 #define CONNECT_H
00039
00040 #ifdef __cplusplus
00041
00042
00043 // An enumeration giving symbol names for the connection
00044 // points offered by the DrawPage component in this server.
00045 enum
00046 {
00047   CONNPOINT_DRAWPAGESINK = 0
00048 };
00049
00050 enum
00051 {
00052   // The maximum number of connection points offered by the DrawPage
00053   // component in this PERDRAW server.  The number of items in the
00054   // connection point enumeration above.
00055   MAX_CONNECTION_POINTS = 1,
00056
00057   // A constant for the number of connections to add to the allocation
00058   // of the dynamic connection array.
00059   ALLOC_CONNECTIONS = 8,
00060
00061   // The start value for the connection key (cookie) counter.
00062   COOKIE_START_VALUE = 500
00063 };
00064
00065
00066 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00067   ObjectClass: COEnumConnectionPoints
00068
00069   Summary:     COM object class for enumerating the Connection Points
00070                offered by a connectable object.
00071
00072   Interfaces:  IUnknown
00073                  Standard interface providing COM object features.
00074                IEnumConnectionPoints
00075                  Interface for connection point enumeration.
00076
00077   Aggregation: COEnumConnectionPoints COM Objects are not aggregatable.
00078 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00079 class COEnumConnectionPoints : public IEnumConnectionPoints
00080 {
00081   public:
00082     // Main Object Constructor & Destructor.
00083     COEnumConnectionPoints(IUnknown* pHostObj);
00084     ~COEnumConnectionPoints(void);
00085
00086     // A general method for initializing this newly created object.
00087     // Creates any subordinate arrays, structures, or objects.
00088     HRESULT Init(
00089               ULONG cConnPts,
00090               IConnectionPoint** paConnPts,
00091               ULONG iEnumIndex);
00092
00093     // IUnknown methods. Main object, non-delegating.
00094     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00095     STDMETHODIMP_(ULONG) AddRef(void);
00096     STDMETHODIMP_(ULONG) Release(void);
00097
00098     // IEnumConnectionPoints methods.
00099     STDMETHODIMP         Next(ULONG, IConnectionPoint**, ULONG*);
00100     STDMETHODIMP         Skip(ULONG);
00101     STDMETHODIMP         Reset(void);
00102     STDMETHODIMP         Clone(IEnumConnectionPoints**);
00103
00104   private:
00105     // Private data of COEnumConnectionPoints COM objects.
00106
00107     // Main Object reference count.
00108     ULONG              m_cRefs;
00109
00110     // IUnknown pointer to host COM object being enumerated.
00111     IUnknown*          m_pHostObj;
00112
00113     // Connection Point index variable.
00114     ULONG              m_iEnumIndex;
00115
00116     // Number of Connection Points being enumerated.
00117     ULONG              m_cConnPts;
00118
00119     // Allocated array of Connection Point interface pointers.
00120     IConnectionPoint** m_paConnPts;
00121 };
00122
00123
00124 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00125   ObjectClass: COConnectionPoint
00126
00127   Summary:     Connection Point COM object class. Implements a native
00128                IConnectionPoint interface.
00129
00130   Interfaces:  IUnknown
00131                  Standard interface providing COM object features.
00132                IConnectionPoint
00133                  Interface for connection point features.
00134
00135   Aggregation: COConnectionPoint COM Objects are not aggregatable.
00136 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00137 class COConnectionPoint : public IConnectionPoint
00138 {
00139   public:
00140     // Main Object Constructor & Destructor.
00141     COConnectionPoint(IUnknown* pHostObj);
00142     ~COConnectionPoint(void);
00143
00144     // A general method for initializing this newly created object.
00145     // Creates any subordinate arrays, structures, or objects.
00146     HRESULT Init(REFIID riid);
00147
00148     // IUnknown methods. Main object, non-delegating.
00149     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00150     STDMETHODIMP_(ULONG) AddRef(void);
00151     STDMETHODIMP_(ULONG) Release(void);
00152
00153     // IConnectionPoint methods.
00154     STDMETHODIMP GetConnectionInterface(IID*);
00155     STDMETHODIMP GetConnectionPointContainer(IConnectionPointContainer**);
00156     STDMETHODIMP Advise(IUnknown*, DWORD*);
00157     STDMETHODIMP Unadvise(DWORD);
00158     STDMETHODIMP EnumConnections(IEnumConnections**);
00159
00160   private:
00161     // Private utility methods of COConnectionPoint.
00162     HRESULT GetSlot(UINT* puiFreeSlot);
00163     HRESULT FindSlot(DWORD dwCookie, UINT* puiSlot);
00164
00165     // Private data of COConnectionPoint COM objects.
00166
00167     // Main Object reference count.
00168     ULONG          m_cRefs;
00169
00170     // IUnknown pointer to host COM object offering this connection point.
00171     IUnknown*      m_pHostObj;
00172
00173     // The IID of the sink interface associated with this connection point.
00174     IID            m_iidSink;
00175
00176     // The current connection cookie (key) counter.
00177     DWORD          m_dwNextCookie;
00178
00179     // The current number of live sink connections to this connection point.
00180     UINT           m_cConnections;
00181
00182     // The current maximum index into the dynamic connection array.
00183     UINT           m_uiMaxIndex;
00184
00185     // The dynamic array of sink connections to this connection point.
00186     CONNECTDATA*   m_paConnections;
00187 };
00188
00189 typedef COConnectionPoint* PCOConnectionPoint;
00190
00191
00192 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00193   ObjectClass: COEnumConnections
00194
00195   Summary:     COM object class for enumerating the connections of a
00196                connection point of a connectable object.
00197
00198   Interfaces:  IUnknown
00199                  Standard interface providing COM object features.
00200                IEnumConnections
00201                  Interface for connection enumeration features.
00202
00203   Aggregation: COEnumConnections COM Objects are not aggregatable.
00204 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00205 class COEnumConnections : public IEnumConnections
00206 {
00207   public:
00208     // Main Object Constructor & Destructor.
00209     COEnumConnections(IUnknown* pHostObj);
00210     ~COEnumConnections(void);
00211
00212     // A general method for initializing this newly created object.
00213     // Creates any subordinate arrays, structures, or objects.
00214     HRESULT Init(
00215               ULONG cConnections,
00216               CONNECTDATA* paConnections,
00217               ULONG iEnumIndex);
00218
00219     // IUnknown methods. Main object, non-delegating.
00220     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00221     STDMETHODIMP_(ULONG) AddRef(void);
00222     STDMETHODIMP_(ULONG) Release(void);
00223
00224     // IEnumConnections methods.
00225     STDMETHODIMP         Next(ULONG, CONNECTDATA*, ULONG*);
00226     STDMETHODIMP         Skip(ULONG);
00227     STDMETHODIMP         Reset(void);
00228     STDMETHODIMP         Clone(IEnumConnections**);
00229
00230   private:
00231     // Private data of COEnumConnections COM objects.
00232
00233     // Main Object reference count.
00234     ULONG            m_cRefs;
00235
00236     // IUnknown pointer to host connection point COM object being
00237     // enumerated.
00238     IUnknown*        m_pHostObj;
00239
00240     // Connection index variable.
00241     ULONG            m_iEnumIndex;
00242
00243     // Number of Connections being enumerated.
00244     ULONG            m_cConnections;
00245
00246     // Allocated array of live Connections only.
00247     CONNECTDATA*     m_paConnections;
00248 };
00249
00250
00251 #endif // __cplusplus
00252
00253
00254 #endif // CONNECT_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/wave.h Source File

  • Multimedia
  • Audio
  • multichan

wave.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 /*
00006  *  preprocessor section
00007  */
00008 #ifndef __WAVE_H__
00009 #define __WAVE_H__
00010
00011 #include "DlgSrc.h"
00012
00013 /*
00014  *  constants
00015  */
00016 #define WAVE_TOGGLE_DESTINATION 0
00017 #define WAVE_TOGGLE_DISABLE   0
00018 #define WAVE_TOGGLE_ALLOW   1
00019
00020 /*
00021  *  functions
00022  */
00023
00024 //
00025 //  open a wave file, validate format and extract parameters
00026 //
00027 HANDLE  WaveOpenFile( LPCSTR, WAVEFORMATEX**, PULONG );
00028
00029 //
00030 //  write the mixed wave file
00031 //
00032 BOOL    WaveSaveFile( LPCSTR, WAVEFORMATEX*, PVOID, ULONG );
00033
00034 //
00035 //  callback function for waveOut calls
00036 //
00037 void CALLBACK   WavePlayFileCB( HWAVEOUT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR );
00038
00039 //
00040 //  toggle every dialog's playable state
00041 //
00042 void WaveTogglePlayback( CDlgSrc *, const BOOL );
00043
00044 //
00045 //  traps an error code
00046 //
00047 BOOL TrapMMError( MMRESULT, LPCSTR );
00048
00049 /*
00050  *  globals
00051  */
00052
00053 extern HWAVEOUT     g_hwo;
00054
00055
00056 #endif  //  __WAVE_H__
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/SyncRead/readcli.c Source File

  • Web
  • iis
  • extensions
  • io
  • SyncRead

readcli.c

Go to the documentation of this file.
00001 /* Copyright (c) 1997-2002  Microsoft Corporation
00002
00003   Module Name:
00004
00005     readcli.c
00006
00007   Abstract:
00008
00009     This module absorbs input from the client, and then returns
00010     it to the client.
00011 */
00012
00013 #define WIN32_LEAN_AND_MEAN
00014 #include <windows.h>
00015 #include <httpext.h>
00016 #include <stdio.h>
00017 #include <stdlib.h>
00018
00019 #define BUFFER_LENGTH 4096
00020 #define STRING_LENGTH 80
00021
00022 /* Prototypes */
00023
00024 BOOL SendErrorToClient(LPEXTENSION_CONTROL_BLOCK pec, CHAR *szErrorText);
00025
00026 /*
00027   Description:
00028
00029     Sets the ISAPI extension version information.
00030
00031   Arguments:
00032
00033     Version     pointer to HSE_VERSION_INFO structure
00034
00035   Return Value:
00036
00037     TRUE
00038 */
00039
00040 BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer)
00041 {
00042   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00043
00044   lstrcpyn((LPSTR) pVer->lpszExtensionDesc, "ReadClient Extension", HSE_MAX_EXT_DLL_NAME_LEN);
00045
00046   return TRUE;
00047 }
00048
00049 /*
00050   Description:
00051
00052     This is the main routine for any ISAPI application.  We read in all
00053     the data from the client, using the ReadClient function, and then
00054     spit it all back out to the client using WriteClient.
00055
00056   Arguments:
00057
00058     pec - pointer to ECB containing parameters related to the request.
00059
00060   Returns:
00061
00062     Either HSE_STATUS_SUCCESS or HSE_STATUS_ERROR
00063 */
00064
00065 DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK pec)
00066 {
00067   BOOL bResult;
00068   CHAR *szBuffer;
00069   CHAR szTemp[BUFFER_LENGTH];
00070   CHAR szTmpBuf[BUFFER_LENGTH];
00071   DWORD dwBytesRead;
00072   DWORD dwBytesWritten;
00073   DWORD dwTotalRead;
00074   DWORD dwTotalWritten;
00075   DWORD dwContentLength;
00076   DWORD dwBufferSize;
00077   HSE_SEND_HEADER_EX_INFO SendHeaderExInfo;
00078
00079   /* Determine the amount of data available from the Content-Length header */
00080
00081   dwBufferSize = sizeof(szTmpBuf) - 1;
00082
00083   bResult = pec->GetServerVariable(pec->ConnID, "CONTENT_LENGTH", szTmpBuf, &dwBufferSize);
00084
00085   if (!bResult) {
00086
00087     bResult = SendErrorToClient(pec, "Content-Length header not found");
00088
00089     if (!bResult)
00090       return HSE_STATUS_ERROR;
00091
00092     return HSE_STATUS_SUCCESS;
00093   }
00094
00095   dwContentLength = atol(szTmpBuf);
00096
00097   /* Allocate the buffer based on the Content-Length */
00098
00099   szBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwContentLength + 5);
00100
00101   if (NULL == szBuffer) {
00102
00103     sprintf(szTemp, "Unable to allocate %ld bytes of memory for buffer", dwContentLength + 5);
00104
00105     bResult = SendErrorToClient(pec, szTemp);
00106
00107     if (!bResult)
00108       return HSE_STATUS_ERROR;
00109
00110     return HSE_STATUS_SUCCESS;
00111   }
00112
00113   /* If the client didn't post anything, return and create a nice form for them */
00114
00115   if (0 == pec->cbAvailable) {
00116
00117     bResult = SendErrorToClient(pec, "Your request did not contain any data");
00118
00119     if (!bResult)
00120       return HSE_STATUS_ERROR;
00121
00122     return HSE_STATUS_SUCCESS;
00123   }
00124
00125   /* Initialize variables before reading in the data */
00126
00127   dwTotalWritten = 0;
00128   dwTotalRead = pec->cbAvailable;
00129
00130   /* Copy the first chunk of the data into the buffer */
00131
00132   strncpy(szBuffer, pec->lpbData, dwTotalRead);
00133
00134   szBuffer[dwTotalRead] = 0;
00135
00136   /* Loop to read in the rest of the data from the client */
00137
00138   while (dwTotalRead < pec->cbTotalBytes) {
00139
00140     /* Set the size of our temporary buffer */
00141
00142     dwBytesRead = sizeof(szTmpBuf) - 1;
00143
00144     if ((dwTotalRead + dwBytesRead) > pec->cbTotalBytes)
00145       dwBytesRead = pec->cbTotalBytes - dwTotalRead;
00146
00147     /* Read the data into the temporary buffer */
00148
00149     bResult = pec->ReadClient(pec->ConnID, szTmpBuf, &dwBytesRead);
00150
00151     if (!bResult) {
00152
00153         HeapFree(GetProcessHeap(), 0, szBuffer);
00154
00155         return HSE_STATUS_ERROR;
00156     }
00157
00158     /* NULL-Terminate the temporary buffer */
00159
00160     szTmpBuf[dwBytesRead] = 0;
00161
00162     /* Append the temporary buffer to the real buffer */
00163
00164     if (0 != dwBytesRead)
00165       strcat(szBuffer + dwTotalRead, szTmpBuf);
00166
00167     dwTotalRead += dwBytesRead;
00168   }
00169
00170   /* All the data has been read in and stored in our buffer. Now send the data back to the client */
00171
00172   SendHeaderExInfo.pszStatus = "200 OK";
00173   SendHeaderExInfo.pszHeader = "Content-Type: text/html\r\n\r\n";
00174   SendHeaderExInfo.cchStatus = lstrlen(SendHeaderExInfo.pszStatus);
00175   SendHeaderExInfo.cchHeader = lstrlen(SendHeaderExInfo.pszHeader);
00176   SendHeaderExInfo.fKeepConn = FALSE;
00177
00178   bResult = pec->ServerSupportFunction(pec->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SendHeaderExInfo, NULL, NULL);
00179
00180   if (!bResult) {
00181
00182     HeapFree(GetProcessHeap(), 0, szBuffer);
00183
00184     return HSE_STATUS_ERROR;
00185   }
00186
00187   dwBytesWritten = dwTotalRead;
00188
00189   bResult = pec->WriteClient(pec->ConnID, szBuffer, &dwBytesWritten, 0);
00190
00191   if (!bResult) {
00192
00193     HeapFree(GetProcessHeap(), 0, szBuffer);
00194
00195     return HSE_STATUS_ERROR;
00196   }
00197
00198   HeapFree(GetProcessHeap(), 0, szBuffer);
00199
00200   return HSE_STATUS_SUCCESS;
00201 }
00202
00203 /*
00204   Description:
00205
00206     This function is called when the WWW service is shutdown
00207
00208   Arguments:
00209
00210     dwFlags - HSE_TERM_ADVISORY_UNLOAD or HSE_TERM_MUST_UNLOAD
00211
00212   Returns:
00213
00214     TRUE if extension is ready to be unloaded, FALSE otherwise
00215 */
00216
00217 BOOL WINAPI TerminateExtension(DWORD dwFlags)
00218 {
00219   return TRUE;
00220 }
00221
00222 /*
00223   Routine Description:
00224
00225     This function sends any error messages and usage information
00226     to the client.  It also creates a nice little form which can
00227     be used to post data.
00228
00229   Arguments:
00230
00231     pec - pointer to ECB containing parameters related to the request
00232     szErrorText - Helpful error text to send to the client
00233
00234   Return Value:
00235
00236     TRUE or FALSE, depending on the success of WriteClient
00237 */
00238
00239 BOOL SendErrorToClient( LPEXTENSION_CONTROL_BLOCK pec, CHAR *szErrorText )
00240 {
00241   BOOL bResult;
00242   CHAR szTemp[BUFFER_LENGTH];
00243   DWORD dwBytesWritten;
00244   HSE_SEND_HEADER_EX_INFO SendHeaderExInfo;
00245
00246   SendHeaderExInfo.pszStatus = "200 OK";
00247   SendHeaderExInfo.pszHeader = "Content-Type: text/html\r\n\r\n";
00248   SendHeaderExInfo.cchStatus = lstrlen(SendHeaderExInfo.pszStatus);
00249   SendHeaderExInfo.cchHeader = lstrlen(SendHeaderExInfo.pszHeader);
00250   SendHeaderExInfo.fKeepConn = FALSE;
00251
00252   bResult = pec->ServerSupportFunction(pec->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SendHeaderExInfo, NULL, NULL);
00253
00254   if (!bResult)
00255     return FALSE;
00256
00257   dwBytesWritten = sprintf(
00258       szTemp,
00259       "<h3>Error: %s</h3><p>\r\n\r\n"
00260       "Usage: readcli.dll<p>\r\n\r\n"
00261       "Request must be a POST request, with extra data<p>\r\n"
00262       "<h2>Sample Form</h2>\r\n"
00263       "Enter data below:<br>\r\n"
00264       "<form method=POST action=\"readcli.dll\">\r\n"
00265       "<input type=text name=test size=80><br>\r\n"
00266       "<input type=submit>\r\n",
00267       szErrorText);
00268
00269   bResult = pec->WriteClient(pec->ConnID, szTemp, &dwBytesWritten, 0);
00270
00271   return bResult;
00272 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComUser/UTCRUCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • ComUser

UTCRUCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COUtilityCruiseCar
00005              COM object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and
00009              IUtility interfaces.  This is done through Aggregation reuse
00010              of COCruiseCar's ICar and ICruise interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial COMUSER.HTM
00014              file.  For more specific technical details on the internal
00015              workings see the comments dispersed throughout the
00016              module's source code.
00017
00018   Classes:   COUtilityCruiseCar
00019
00020   Functions: CreateUtilityCruiseCar.
00021
00022   Origin:    8-29-95: atrent - Editor inheritance from NUKESUB.CPP.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will make calls to the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include COMOBJ.H because it has the function prototypes and interface
00048     declarations for the COM objects supplied by COMOBJ.DLL.
00049   We include UTCRUCAR.H because it has the COUtilityCruiseCar declarations.
00050 ---------------------------------------------------------------------------*/
00051 #include <windows.h>
00052 #include <ole2.h>
00053 #include <apputil.h>
00054 #include <icars.h>
00055 #include <carguids.h>
00056 #include <comobj.h>
00057 #include "comuser.h"
00058 #include "utcrucar.h"
00059
00060
00061 /*---------------------------------------------------------------------------
00062   COUtilityCruiseCar's implementation of its main COM object class including
00063   Constructor, Destructor, QueryInterface, AddRef, and Release.
00064 ---------------------------------------------------------------------------*/
00065
00066 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00067   Method:   COUtilityCruiseCar::COUtilityCruiseCar
00068
00069   Summary:  COUtilityCruiseCar Constructor. Note the member initializer:
00070             "m_ImpIUtility(this, pUnkOuter)" which is used to pass the 'this'
00071             and pUnkOuter pointers of this constructor function to the
00072             constructor in the instantiation of the implementation of
00073             the CImpIUtility interface (which is nested inside this present
00074             COUtilityCruiseCar Object Class).
00075
00076   Args:     IUnknown* pUnkOuter)
00077               Pointer to the the outer Unknown.  NULL means this COM Object
00078               is not being Aggregated.  Non NULL means it is being created
00079               on behalf of an outside COM object that is reusing it via
00080               aggregation.
00081
00082   Modifies: m_cRefs, m_pUnkOuter, m_pUnkCruiseCar.
00083
00084   Returns:  void
00085 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00086 COUtilityCruiseCar::COUtilityCruiseCar(
00087   IUnknown* pUnkOuter) :
00088   m_ImpIUtility(this, pUnkOuter)
00089 {
00090   // Zero the COM object's reference count.
00091   m_cRefs = 0;
00092
00093   // No AddRef necessary if non-NULL, as this COM object's lifetime
00094   // is totally coupled with the controlling Outer object's lifetime.
00095   m_pUnkOuter = pUnkOuter;
00096
00097   // Zero the pointer to the aggregated COCruiseCar object's IUnknown
00098   // interface (for delegation of IUnknown calls to it).
00099   m_pUnkCruiseCar = NULL;
00100
00101   LOGF1("E: COUtilityCruiseCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00102
00103   return;
00104 }
00105
00106
00107 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00108   Method:   COUtilityCruiseCar::~COUtilityCruiseCar
00109
00110   Summary:  COUtilityCruiseCar Destructor.
00111
00112   Args:     void
00113
00114   Modifies: .
00115
00116   Returns:  void
00117 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00118 COUtilityCruiseCar::~COUtilityCruiseCar(void)
00119 {
00120   LOG("E: COUtilityCruiseCar::Destructor.");
00121
00122   RELEASE_INTERFACE(m_pUnkCruiseCar);
00123
00124   return;
00125 }
00126
00127
00128 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00129   Method:   COUtilityCruiseCar::Init
00130
00131   Summary:  COUtilityCruiseCar Initialization method.
00132
00133   Args:     void
00134
00135   Modifies: m_pUnkCruiseCar, m_pICar, m_pICruise, m_cRefs.
00136
00137   Returns:  HRESULT
00138               Standard result code. NOERROR for success.
00139 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00140 HRESULT COUtilityCruiseCar::Init(void)
00141 {
00142   HRESULT hr;
00143
00144   // Set up the right pIUnknown for delegation.  If we are being
00145   // aggregated then we pass the pUnkOuter in turn to any COM objects
00146   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00147   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00148
00149   LOG("E: COUtilityCruiseCar::Init.");
00150
00151   // We create an instance of the COCruiseCar object and do this via the
00152   // Aggregation reuse technique.  Note we pass pUnkOuter as the
00153   // Aggregation pointer.  It is the 'this' pointer to this present
00154   // COUtilityCruiseCar object if we are not being aggregated; otherwise it
00155   // is the pointer to the outermost object's controlling IUnknown.
00156   // Following the rules of Aggregation we ask CreateCruiseCar for an
00157   // IID_IUnknown interface.  We cache this pointer to the IUnknown of
00158   // the new COCruiseCar COM object for later use in delegating
00159   // IUnknown calls.
00160   hr = CreateCruiseCar(pUnkOuter, IID_IUnknown, (PPVOID)&m_pUnkCruiseCar);
00161
00162   return (hr);
00163 }
00164
00165
00166 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00167   Method:   COUtilityCruiseCar::QueryInterface
00168
00169   Summary:  QueryInterface of the COUtilityCruiseCar non-delegating
00170             IUnknown implementation.
00171
00172   Args:     REFIID riid,
00173               [in] GUID of the Interface being requested.
00174             PPVOID ppv)
00175               [out] Address of the caller's pointer variable that will
00176               receive the requested interface pointer.
00177
00178   Modifies: .
00179
00180   Returns:  HRESULT
00181 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00182 STDMETHODIMP COUtilityCruiseCar::QueryInterface(
00183                REFIID riid,
00184                PPVOID ppv)
00185 {
00186   HRESULT hr = E_NOINTERFACE;
00187   *ppv = NULL;
00188
00189   if (IID_IUnknown == riid)
00190   {
00191     *ppv = this;
00192     LOG("E: COUtilityCruiseCar::QueryInterface. 'this' pIUnknown returned.");
00193   }
00194   else if (IID_IUtility == riid)
00195   {
00196     // This IUtility interface is implemented in this COUtilityCruiseCar
00197     // object as a native interface of COUtilityCruiseCar.
00198     *ppv = &m_ImpIUtility;
00199     LOG("E: COUtilityCruiseCar::QueryInterface. pIUtility returned.");
00200   }
00201
00202   if (NULL != *ppv)
00203   {
00204     // We've handed out a pointer to an interface so obey the COM rules
00205     //   and AddRef its reference count.
00206     ((LPUNKNOWN)*ppv)->AddRef();
00207     hr = NOERROR;
00208   }
00209   else if (IID_ICar == riid)
00210   {
00211     LOG("E: COUtilityCruiseCar::QueryInterface. ICar delegating.");
00212     // We didn't implement the ICar interface in this COUtilityCruiseCar
00213     // object.  The aggregated inner object (CruiseCar) is contributing
00214     // the ICar interface to this present composite or aggregating
00215     // UtilityCruiseCar object.  So, to satisfy a QI request for the ICar
00216     // interface, we delegate the QueryInterface to the inner
00217     // object's IUnknown.
00218     hr = m_pUnkCruiseCar->QueryInterface(riid, ppv);
00219   }
00220   else if (IID_ICruise == riid)
00221   {
00222     LOG("E: COUtilityCruiseCar::QueryInterface. ICruise delegating.");
00223     // We didn't implement the ICruise interface in this COUtilityCruiseCar
00224     // object.  The aggregated inner object (CruiseCar) is contributing
00225     // the ICruise interface to this present composite or aggregating
00226     // UtilityCruiseCar object.  As above we delegate this QI to the
00227     // aggregated object's IUnknown.
00228     hr = m_pUnkCruiseCar->QueryInterface(riid, ppv);
00229   }
00230
00231   return (hr);
00232 }
00233
00234
00235 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00236   Method:   COUtilityCruiseCar::AddRef
00237
00238   Summary:  AddRef of the COUtilityCruiseCar non-delegating
00239             IUnknown implementation.
00240
00241   Args:     void
00242
00243   Modifies: m_cRefs.
00244
00245   Returns:  ULONG
00246               New value of m_cRefs (COM object's reference count).
00247 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00248 STDMETHODIMP_(ULONG) COUtilityCruiseCar::AddRef(void)
00249 {
00250   m_cRefs++;
00251
00252   LOGF1("E: COUtilityCruiseCar::AddRef. New cRefs=%i.", m_cRefs);
00253
00254   return m_cRefs;
00255 }
00256
00257
00258 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00259   Method:   COUtilityCruiseCar::Release
00260
00261   Summary:  Release of the COUtilityCruiseCar non-delegating IUnknown
00262             implementation.
00263
00264   Args:     void
00265
00266   Modifies: m_cRefs.
00267
00268   Returns:  ULONG
00269               New value of m_cRefs (COM object's reference count).
00270 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00271 STDMETHODIMP_(ULONG) COUtilityCruiseCar::Release(void)
00272 {
00273   ULONG ulCount = --m_cRefs;
00274
00275   LOGF1("E: COUtilityCruiseCar::Release. New cRefs=%i.", m_cRefs);
00276
00277   if (0 == m_cRefs)
00278   {
00279     // We artificially bump the main ref count.  Thie fulfills one of
00280     // the rules of aggregated objects and ensures that an indirect
00281     // recursive call to this release won't occur because of other
00282     // delegating releases that might happen in our own destructor.
00283     m_cRefs++;
00284     delete this;
00285   }
00286
00287   return ulCount;
00288 }
00289
00290
00291 /*---------------------------------------------------------------------------
00292   COUtilityCruiseCar's nested implementation of the IUtility interface
00293   including methods: Constructor, Destructor, QueryInterface, AddRef,
00294   Release, Offroad, and Winch.
00295 ---------------------------------------------------------------------------*/
00296
00297 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00298   Method:   COUtilityCruiseCar::CImpIUtility::CImpIUtility
00299
00300   Summary:  Constructor for the CImpIUtility interface instantiation.
00301
00302   Args:     COUtilityCruiseCar* pBackObj,
00303               Back pointer to the parent outer object.
00304             IUnknown* pUnkOuter)
00305               Pointer to the outer Unknown.  For delegation.
00306
00307   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00308
00309   Returns:  void
00310 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00311 COUtilityCruiseCar::CImpIUtility::CImpIUtility(
00312   COUtilityCruiseCar* pBackObj,
00313   IUnknown* pUnkOuter)
00314 {
00315   // Init the Interface Ref Count (used for debugging only).
00316   m_cRefI = 0;
00317
00318   // Init the Back Object Pointer to point to the outer object.
00319   m_pBackObj = pBackObj;
00320
00321   // Init the CImpIUtility interface's delegating IUnknown pointer.  We use
00322   // the Back Object pointer for IUnknown delegation here if we are not
00323   // being aggregated.  If we are being aggregated we use the supplied
00324   // pUnkOuter for IUnknown delegation.  In either case the pointer
00325   // assignment requires no AddRef because the CImpIUtility lifetime is
00326   // quaranteed by the lifetime of the parent object in which
00327   // CImpIUtility is nested.
00328   if (NULL == pUnkOuter)
00329   {
00330     m_pUnkOuter = pBackObj;
00331     LOG("E: COUtilityCruiseCar::CImpIUtility Constructor. Non-Aggregating.");
00332   }
00333   else
00334   {
00335     m_pUnkOuter = pUnkOuter;
00336     LOG("E: COUtilityCruiseCar::CImpIUtility Constructor. Aggregating.");
00337   }
00338
00339   return;
00340 }
00341
00342
00343 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00344   Method:   COUtilityCruiseCar::CImpIUtility::~CImpIUtility
00345
00346   Summary:  Destructor for the CImpIUtility interface instantiation.
00347
00348   Args:     void
00349
00350   Modifies: .
00351
00352   Returns:  void
00353 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00354 COUtilityCruiseCar::CImpIUtility::~CImpIUtility(void)
00355 {
00356   LOG("E: COUtilityCruiseCar::CImpIUtility Destructor.");
00357
00358   return;
00359 }
00360
00361
00362 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00363   Method:   COUtilityCruiseCar::CImpIUtility::QueryInterface
00364
00365   Summary:  The QueryInterface IUnknown member of this IUtility interface
00366             implementation that delegates to m_pUnkOuter, whatever it is.
00367
00368   Args:     REFIID riid,
00369               [in] GUID of the Interface being requested.
00370             PPVOID ppv)
00371               [out] Address of the caller's pointer variable that will
00372               receive the requested interface pointer.
00373
00374   Modifies: .
00375
00376   Returns:  HRESULT
00377               Returned by the delegated outer QueryInterface call.
00378 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00379 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::QueryInterface(
00380                REFIID riid,
00381                PPVOID ppv)
00382 {
00383   LOG("E: COUtilityCruiseCar::CImpIUtility::QueryInterface. Delegating.");
00384
00385   // Delegate this call to the outer object's QueryInterface.
00386   return m_pUnkOuter->QueryInterface(riid, ppv);
00387 }
00388
00389
00390 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00391   Method:   COUtilityCruiseCar::CImpIUtility::AddRef
00392
00393   Summary:  The AddRef IUnknown member of this IUtility interface
00394             implementation that delegates to m_pUnkOuter, whatever it is.
00395
00396   Args:     void
00397
00398   Modifies: m_cRefI.
00399
00400   Returns:  ULONG
00401               Returned by the delegated outer AddRef call.
00402 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00403 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::AddRef(void)
00404 {
00405   // Increment the Interface Reference Count.
00406   ++m_cRefI;
00407
00408   LOGF1("E: COUtilityCruiseCar::CImpIUtility::Addref. Delegating. New cI=%i.", m_cRefI);
00409
00410   // Delegate this call to the outer object's AddRef.
00411   return m_pUnkOuter->AddRef();
00412 }
00413
00414
00415 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00416   Method:   COUtilityCruiseCar::CImpIUtility::Release
00417
00418   Summary:  The Release IUnknown member of this IUtility interface
00419             implementation that delegates to m_pUnkOuter, whatever it is.
00420
00421   Args:     void
00422
00423   Modifies: .
00424
00425   Returns:  ULONG
00426               Returned by the delegated outer Release call.
00427 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00428 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::Release(void)
00429 {
00430   // Decrement the Interface Reference Count.
00431   --m_cRefI;
00432
00433   LOGF1("E: COUtilityCruiseCar::CImpIUtility::Release. Delegating. New cI=%i.", m_cRefI);
00434
00435   // Delegate this call to the outer object's Release.
00436   return m_pUnkOuter->Release();
00437 }
00438
00439
00440 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00441   Method:   COUtilityCruiseCar::CImpIUtility::Offroad
00442
00443   Summary:  The Offroad member method of this IUtility interface
00444             implementation.  A simple empty method on a COUtilityCruiseCar
00445             COM object for tutorial purposes.  Presumably if this
00446             UtilityCruise Car object were modeling a real Car then the
00447             Offroad method would function the 4-wheel drive transfer case
00448             and shift it to the specified 4-wheel drive mode.
00449
00450   Args:     short nGear
00451               0 = 2H or regular 2-wheel drive;
00452               1 = 4H or 4-wheel drive high speed;
00453               2 = neutral; and
00454               3 = 4L or 4-wheel drive low speed).
00455
00456   Modifies: .
00457
00458   Returns:  HRESULT
00459               NOERROR
00460 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00461 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Offroad(
00462                short nGear)
00463 {
00464   HRESULT hr;
00465   ICar* pICar = NULL;
00466
00467   // In our fantasy Sport-Utility Car world we may need to stop the car
00468   // before switching to 4-Wheel drive low (nGear == 3 for 4L). Let's
00469   // assume so because it's a convenient excuse to show this aggregating
00470   // COUtilityCruiseCar outer object using one of the interfaces (ICar)
00471   // of its aggregated COCruiseCar inner object.  COMUSER gracefully
00472   // cooperates in this by invoking this Offroad method from the
00473   // UtilityCruiseCar menu with nGear == 3.
00474   if (3 == nGear)
00475   {
00476     hr = m_pBackObj->m_pUnkCruiseCar->QueryInterface(
00477                                         IID_ICar,
00478                                         (PPVOID)&pICar);
00479     if (SUCCEEDED(hr))
00480     {
00481       m_pUnkOuter->Release();
00482       pICar->Speed(0);
00483       m_pUnkOuter->AddRef();
00484       pICar->Release();
00485     }
00486   }
00487
00488   LOGF1("E: COUtilityCruiseCar::CImpIUtility::Offroad. Called. nGear=%i.",nGear);
00489
00490   return NOERROR;
00491 }
00492
00493
00494 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00495   Method:   COUtilityCruiseCar::CImpIUtility::Winch
00496
00497   Summary:  The Adjust member method of this IUtility interface
00498             implementation.  A simple empty method on a COUtilityCruiseCar
00499             COM object for tutorial purposes.  Presumably if this
00500             UtilityCruiseCar object were modeling a real Car then the
00501             Winch method would turn on/off the front-mounted Winch to the
00502             specified RPMs.
00503
00504   Args:     short nRpm
00505               0 = off; 1 - 50 RPM.
00506
00507   Modifies: .
00508
00509   Returns:  HRESULT
00510               NOERROR
00511 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00512 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Winch(
00513                short nRpm)
00514 {
00515   LOGF1("E: COUtilityCruiseCar::CImpIUtility::Winch. Called. nRpm=%i.",nRpm);
00516
00517   return NOERROR;
00518 }
00519
00520
00521 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00522   Function: CreateUtilityCruiseCar
00523
00524   Summary:  Creates an instance of the COUtilityCruiseCar COM object class
00525             returning a requested interface pointer. COUtilityCruiseCar
00526             uses the Aggregation reuse technique to incorporate
00527             COCruiseCar features (ie, ICar and ICruise implementations)
00528             into its Interface offerings (ie, IUnknown, and IUtility).
00529             With this aggregation, the ICar and ICruise interfaces are
00530             not implemented in COUtilityCruiseCar.  They are instead
00531             solely implemented in a COCruiseCar object that
00532             CreateUtilityCruiseCar instantiates.  That COCruiseCar's ICar
00533             and ICruise implementations are used directly in this
00534             aggregation.  COCruiseCar is provided by the outside COMOBJ.DLL.
00535
00536   Args:     IUnknown* pUnkOuter,
00537               Pointer the outer Unknown interface.  Non NULL implies
00538               that the new COM object is being created via an
00539               aggregation with an Outer object.  NULL implies that the
00540               object is not being created via aggregation.
00541             REFIID riid,
00542               The GUID of the interface requested on the new COM Object.
00543             PPVOID ppv)
00544               Address of the caller's pointer variable that will
00545               receive the requested interface pointer.
00546
00547   Returns:  HRESULT
00548               NOERROR if successful, CLASS_E_NOAGREGATION if IUnknown is
00549               not requested with non-NULL pUnkOuter, or other errors as
00550               appropriate.
00551 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00552 HRESULT CreateUtilityCruiseCar(
00553           IUnknown* pUnkOuter,
00554           REFIID riid,
00555           PPVOID ppv)
00556 {
00557   HRESULT hr;
00558   COUtilityCruiseCar* pCob;
00559
00560   LOGF1("E: CreateUtilityCruiseCar. pUnkOuter=0x%X.",pUnkOuter);
00561
00562   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00563   // the COM rules state the IUnknown interface MUST also be concomitantly
00564   // requested.  If it is not so requested ( riid != IID_IUnknown) then
00565   // an error must be returned indicating that no aggregate creation of
00566   // the COUtilityCruiseCar COM Object can be performed using anything
00567   // other than a controlling IUnknown interface.
00568   if (NULL != pUnkOuter && riid != IID_IUnknown)
00569     hr = CLASS_E_NOAGGREGATION;
00570   else
00571   {
00572     // Instantiate a COUtilityCruiseCar COM Object.
00573     pCob = new COUtilityCruiseCar(pUnkOuter);
00574     if (NULL != pCob)
00575     {
00576       // If we have succeeded in instantiating the COUtilityCruiseCar object
00577       // we initialize it to offer it's interfaces.
00578       hr = pCob->Init();
00579       if (SUCCEEDED(hr))
00580       {
00581         // We QueryInterface this new COM Object not only to deposit the
00582         // main interface pointer to the caller's pointer variable, but to
00583         // also automatically bump the Reference Count on the new COM
00584         // Object after handing out this *ppv reference to it.
00585         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
00586       }
00587     }
00588     else
00589       hr = E_OUTOFMEMORY;
00590   }
00591
00592   if (SUCCEEDED(hr))
00593     LOGF1("E: CreateUtilityCruiseCar Succeeded. *ppv=0x%X.",*ppv);
00594
00595   return hr;
00596 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerServe/Server.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerServe

Server.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.H
00003
00004   Summary:   Internal include file for the PERSERVE.DLL server code
00005              sample.  Contains class declarations, resource IDs and string
00006              macros for internal use in constructing this DLL as a COM
00007              component server housing.  Declares the CServer server
00008              control object class. The CThreaded OwnThis mechanism is used
00009              to ensure mutually exclusive access to this CServer object by
00010              multiple threads.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial PERSERVE.HTM
00014              file. For more specific technical details on the internal
00015              workings see the comments dispersed throughout the module's
00016              source code.
00017
00018   Classes:   CServer.
00019
00020   Functions: .
00021
00022   Origin:    5-8-97: atrent - Editor-inheritance from SERVER.H in
00023                the STOSERVE Tutorial Code Sample. [Revised]
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040
00041 #if !defined(SERVER_H)
00042 #define SERVER_H
00043
00044
00045 #ifdef __cplusplus
00046
00047 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00048   Class:    CServer
00049
00050   Summary:  Class to encapsulate control of this COM server (eg, handle
00051             Lock and Object counting, encapsulate otherwise global data).
00052
00053   Methods:  none
00054 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00055 class CServer : public CThreaded
00056 {
00057   public:
00058     CServer(void);
00059     ~CServer(void);
00060
00061     // Methods for server lifetime control: object counts and lock counts.
00062     void Lock(void);
00063     void Unlock(void);
00064     void ObjectsUp(void);
00065     void ObjectsDown(void);
00066     HRESULT CanUnloadNow(void);
00067
00068     // A place to store the handle to loaded instance of this DLL module.
00069     HINSTANCE m_hDllInst;
00070
00071     // A place to store a client's parent window.
00072     HWND m_hWndParent;
00073
00074     // Global DLL Server living Object count.
00075     LONG m_cObjects;
00076
00077     // Global DLL Server Client Lock count.
00078     LONG m_cLocks;
00079 };
00080
00081 #endif // __cplusplus
00082
00083 // Allow other internal PERSERVE modules to get at the globals.
00084 extern CServer* g_pServer;
00085
00086
00087 #endif // SERVER_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/service.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

service.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     System Service Procedures
00006
00007     FILE: Service.c
00008
00009     PURPOSE: Provides file replication service function definitions.
00010
00011     FUNCTIONS:
00012         IsLocalSystem - Checks whether the service is running as
00013       local system.
00014         ReportStatusToSCMgr - Changes the service's status and
00015             registers change with SCM.
00016         AddToMessageLog - Adds a string to the system message log.
00017
00018     COMMENTS: These funtions may be used by the main service routines
00019         as well as by the client and server file replication RPC routines.
00020
00021 */
00022
00023 #include <windows.h>
00024 #include <stdio.h>
00025 #include <tchar.h>
00026
00027 #include "common.h"
00028
00029 #include "Service.h"
00030
00031 /*
00032     FUNCTION: ReportStatusToSCMgr()
00033
00034     PURPOSE: Sets the current status of the service and
00035              reports it to the Service Control Manager
00036
00037     PARAMETERS:
00038         dwCurrentState - the state of the service
00039         dwWin32ExitCode - error code to report
00040         dwWaitHint - worst case estimate to next checkpoint
00041
00042     RETURN VALUE:
00043         TRUE - success
00044         FALSE - failure
00045
00046     COMMENTS:
00047
00048 */
00049 BOOL ReportStatusToSCMgr(SERVICE_STATUS_HANDLE *sshStatusHandle,
00050        SERVICE_STATUS *ssStatus,
00051        DWORD dwCurrentState,
00052        DWORD dwWin32ExitCode,
00053        DWORD dwWaitHint){
00054
00055     static DWORD dwCheckPoint = 1;
00056     BOOL fResult = TRUE;
00057
00058     if (dwCurrentState == SERVICE_START_PENDING)
00059         ssStatus->dwControlsAccepted = 0;
00060     else
00061         ssStatus->dwControlsAccepted = SERVICE_ACCEPT_STOP;
00062
00063     ssStatus->dwCurrentState = dwCurrentState;
00064     ssStatus->dwWin32ExitCode = dwWin32ExitCode;
00065     ssStatus->dwWaitHint = dwWaitHint;
00066
00067     if ( ( dwCurrentState == SERVICE_RUNNING ) || ( dwCurrentState == SERVICE_STOPPED ) ) {
00068         ssStatus->dwCheckPoint = 0;
00069     }
00070     else {
00071         ssStatus->dwCheckPoint = dwCheckPoint++;
00072     }
00073
00074     // Report the status of the service to the service control manager.
00075     if (!(fResult = SetServiceStatus(*sshStatusHandle, ssStatus))) {
00076         AddToMessageLog(TEXT("SetServiceStatus failed"));
00077     }
00078     return fResult;
00079 }
00080
00081 /*
00082     FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
00083
00084     PURPOSE: Allows any thread to log an error message
00085
00086     PARAMETERS:
00087         lpszMsg - text for message
00088
00089     RETURN VALUE:
00090         none
00091
00092     COMMENTS:
00093
00094 */
00095 VOID AddToMessageLog(LPTSTR lpszMsg){
00096     TCHAR szMsg[256];
00097     HANDLE hEventSource;
00098     LPTSTR lpszStrings[2];
00099     DWORD dwErr = 0;
00100
00101     dwErr = GetLastError();
00102
00103     // Use event logging to log the error.
00104     hEventSource = RegisterEventSource(NULL, SERVICENAME);
00105
00106     _stprintf(szMsg, TEXT("%s error: %d"), SERVICENAME, dwErr);
00107     lpszStrings[0] = szMsg;
00108     lpszStrings[1] = lpszMsg;
00109
00110     if (hEventSource != NULL) {
00111         ReportEvent(hEventSource, // handle of event source
00112         EVENTLOG_ERROR_TYPE, // event type
00113         0, // event category
00114         0, // event ID
00115         NULL, // current user's SID
00116         2, // strings in lpszStrings
00117         0, // no bytes of raw data
00118         (LPCTSTR *) lpszStrings, // array of error strings
00119         NULL); // no raw data
00120
00121         (VOID) DeregisterEventSource(hEventSource);
00122     }
00123 }
00124
00125 // Heap for use by midl_user_allocate and midl_user_free.
00126 HANDLE RpcHeap;
00127
00128 /*
00129     MIDL allocate() and free()
00130 */
00131
00132 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
00133     return(HeapAlloc(RpcHeap, 0, len));
00134 }
00135
00136 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
00137     if(ptr != NULL) {
00138         HeapFree(RpcHeap, 0, ptr);
00139     }
00140 }
00141
00142 // end Service.c
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMSOmniProvCommand Member List

This is the complete list of members for CMSOmniProvCommand, including all inherited members.
Execute(IUnknown *pUnkOuter, REFIID riid, DBPARAMS *pParams, LONG *pcRowsAffected, IUnknown **ppRowset) | CMSOmniProvCommand |
FinalConstruct() | CMSOmniProvCommand | [inline]
FinalRelease() | CMSOmniProvCommand | [inline]
GetColumnInfo(CMSOmniProvCommand *pv, ULONG *pcInfo) | CMSOmniProvCommand | [static]
Generated on Wed Nov 13 2024 16:56:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpISpecifyPropertyPages Member List

This is the complete list of members for CImpISpecifyPropertyPages, including all inherited members.
CImpISpecifyPropertyPages() | CImpISpecifyPropertyPages | [inline]
GetPages(CAUUID *pPages) | CImpISpecifyPropertyPages | [inline]
m_cRef | CImpISpecifyPropertyPages | [private]
QueryInterface(REFIID riid, LPVOID *ppv) | CImpISpecifyPropertyPages | [inline]
~CImpISpecifyPropertyPages() | CImpISpecifyPropertyPages | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/LoadProtocol/loadprotocol.c Source File

  • NetDS
  • RRas
  • LoadProtocol

loadprotocol.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \******************************************************************************/
00010
00011 #define UNICODE
00012
00013 #include <windows.h>
00014 #include <winbase.h>
00015 #include <mprapi.h>
00016 #include <rtinfo.h>
00017
00018 #include "ipsamplerm.h" // This include file is shipped with the Sample Routing protocol
00019
00020 // Define the Protocol relevant information here
00021 IPSAMPLE_GLOBAL_CONFIG    igc = {0};
00022 #define YOUR_PROTOCOL_INFO_BLOCK_DATA    (&igc)
00023 #define YOUR_PROTOCOL_ID                        0x00c8
00024 #define YOUR_PROTOCOL_BLOCK_SIZE            0x0004
00025
00026
00027
00028 HRESULT AddProtocolToServer(LPCWSTR pswzServerName)
00029 {
00030     HRESULT     hr = S_OK;
00031     DWORD       dwErr = ERROR_SUCCESS;
00032     DWORD       dwErrT = ERROR_SUCCESS;
00033     MPR_SERVER_HANDLE   hMprServer = NULL;
00034     HANDLE   hMprConfig = NULL;
00035     LPBYTE      pByte = NULL;
00036     LPVOID        pHeader = NULL;
00037     LPVOID        pNewHeader = NULL;
00038     DWORD       dwSize = 0;
00039     HANDLE      hTransport = NULL;
00040
00041
00042     // Connect to the server
00043     // ----------------------------------------------------------------
00044     dwErr = MprAdminServerConnect((LPWSTR) pswzServerName, &hMprServer);
00045     if (dwErr == ERROR_SUCCESS)
00046     {
00047         // Ok, get the infobase from the server
00048         // ------------------------------------------------------------
00049         dwErr = MprAdminTransportGetInfo(hMprServer,
00050                                          PID_IP,
00051                                          &pByte,
00052                                          &dwSize,
00053                                          NULL,
00054                                          NULL);
00055
00056         if (dwErr == ERROR_SUCCESS)
00057         {
00058             // Call MprInfoDuplicate to create a duplicate of
00059             // the infoblock
00060             // --------------------------------------------------------
00061             MprInfoDuplicate(pByte, &pHeader);
00062             MprAdminBufferFree(pByte);
00063             pByte = NULL;
00064             dwSize = 0;
00065         }
00066     }
00067
00068     // We also have to open the hMprConfig, but we can ignore the error
00069     // ----------------------------------------------------------------
00070     dwErrT = MprConfigServerConnect((LPWSTR) pswzServerName, &hMprConfig);
00071     if (dwErrT == ERROR_SUCCESS)
00072     {
00073         dwErrT = MprConfigTransportGetHandle(hMprConfig, PID_IP, &hTransport);
00074     }
00075
00076     if (dwErr != ERROR_SUCCESS)
00077     {
00078         // Ok, try to use the MprConfig calls.
00079         // ------------------------------------------------------------
00080         MprConfigTransportGetInfo(hMprConfig,
00081                                   hTransport,
00082                                   &pByte,
00083                                   &dwSize,
00084                                   NULL,
00085                                   NULL,
00086                                   NULL);
00087
00088         // Call MprInfoDuplicate to create a duplicate of
00089         // the infoblock
00090         // ------------------------------------------------------------
00091         MprInfoDuplicate(pByte, &pHeader);
00092         MprConfigBufferFree(pByte);
00093         pByte = NULL;
00094         dwSize = 0;
00095     }
00096
00097     // Call MprInfoBlockRemove to remove the old protocol block
00098     MprInfoBlockRemove(pHeader, YOUR_PROTOCOL_ID, &pNewHeader);
00099
00100     // Did we remove the block?
00101     if (pNewHeader != NULL)
00102     {
00103         // The block was found and removed, so use the new header.
00104         MprInfoDelete(pHeader);
00105         pHeader = pNewHeader;
00106         pNewHeader = NULL;
00107     }
00108
00109     // Add protocol to the infoblock here!
00110     MprInfoBlockAdd(pHeader,
00111                     YOUR_PROTOCOL_ID,
00112                     YOUR_PROTOCOL_BLOCK_SIZE,
00113                     1,
00114                     (LPBYTE) YOUR_PROTOCOL_INFO_BLOCK_DATA,
00115                     &pNewHeader);
00116     MprInfoDelete(pHeader);
00117     pHeader = NULL;
00118
00119
00120     if (hMprServer)
00121     {
00122
00123         MprAdminTransportSetInfo(hMprServer,
00124                                  PID_IP,
00125                                  (BYTE*)pNewHeader,
00126                                  MprInfoBlockQuerySize(pNewHeader),
00127                                  NULL,
00128                                  0);
00129     }
00130
00131     if (hMprConfig && hTransport)
00132     {
00133
00134         MprConfigTransportSetInfo(hMprConfig,
00135                                   hTransport,
00136                                   (BYTE*)pNewHeader,
00137                                   MprInfoBlockQuerySize(pNewHeader),
00138                                   NULL,
00139                                   0,
00140                                   NULL);
00141     }
00142
00143
00144     if (pHeader)
00145         MprInfoDelete(pHeader);
00146
00147     if (pNewHeader)
00148         MprInfoDelete(pNewHeader);
00149
00150     if (hMprConfig)
00151         MprConfigServerDisconnect(hMprConfig);
00152
00153     if (hMprServer)
00154         MprAdminServerDisconnect(hMprServer);
00155
00156     return hr;
00157 }
00158
00159 void main()
00160 {
00161     //The first parameter is the name of the server. to execute on the local machine pass in NULL
00162     // as shown
00163     AddProtocolToServer(NULL);
00164 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/StdAfx.Cpp Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

StdAfx.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 // stdafx.cpp : source file that includes just the standard includes
00013 //  stdafx.pch will be the pre-compiled header
00014 //  stdafx.obj will contain the pre-compiled type information
00015
00016 #include "stdafx.h"
00017
00018 #ifdef _ATL_STATIC_REGISTRY
00019 #include <statreg.h>
00020 #include <statreg.cpp>
00021 #endif
00022
00023 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/clistener.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

clistener.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CLISTENER.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 //////////////////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 //////////////////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 //////////////////////////////////////////////////////////////////
00019 // CListener
00020 //
00021 //////////////////////////////////////////////////////////////////
00022 CListener::CListener()
00023 {
00024   m_cRef = 1;
00025   m_hrReturn = S_OK;
00026 }
00027
00028 //////////////////////////////////////////////////////////////////
00029 // ~CListener
00030 //
00031 //////////////////////////////////////////////////////////////////
00032 CListener::~CListener()
00033 {
00034 }
00035
00036 //////////////////////////////////////////////////////////////////
00037 // CListener::SetReturnValue
00038 //
00039 //////////////////////////////////////////////////////////////////
00040 HRESULT CListener::SetReturnValue(HRESULT hrReturn)
00041 {
00042   m_hrReturn = hrReturn;
00043   return S_OK;
00044 }
00045
00046 //////////////////////////////////////////////////////////////////
00047 // CListener::GetReturnValue
00048 //
00049 //////////////////////////////////////////////////////////////////
00050 HRESULT CListener::GetReturnValue()
00051 {
00052   return m_hrReturn;
00053 }
00054
00055 //////////////////////////////////////////////////////////////////
00056 // CListener::Advise
00057 //
00058 //////////////////////////////////////////////////////////////////
00059 HRESULT CListener::Advise(CContainerBase* pCPoint, REFIID riid, DWORD* pdwCookie)
00060 {
00061   HRESULT hr = S_OK;
00062   ASSERT(pCPoint);
00063   CComPtr<IConnectionPoint> spCP;
00064
00065   if(pCPoint->m_pIConnectionPointContainer)
00066   {
00067     //Obtain the connection point
00068     hr = pCPoint->FindConnectionPoint(riid, &spCP);
00069     if(SUCCEEDED(hr))
00070     {
00071       //Delegate
00072       TESTC(hr = Advise(spCP, pdwCookie));
00073     }
00074   }
00075
00076 CLEANUP:
00077   return hr;
00078 }
00079
00080
00081 //////////////////////////////////////////////////////////////////
00082 // CListener::Advise
00083 //
00084 //////////////////////////////////////////////////////////////////
00085 HRESULT CListener::Advise(IConnectionPoint* pIConnectionPoint, DWORD* pdwCookie)
00086 {
00087   HRESULT hr = S_OK;
00088
00089   if(pIConnectionPoint)
00090   {
00091     //Now we can advise the connection
00092     //TODO64: Note COM has not changed the Advise output cookie, so we still display it as 0x%08x instead of 0x%p
00093     XTEST(hr = pIConnectionPoint->Advise((IRowsetNotify*)this, pdwCookie));
00094     TESTC(TRACE_METHOD(hr, L"IConnectionPoint::Advise(0x%p, &0x%08x)", this, pdwCookie ? *pdwCookie : 0));
00095   }
00096
00097 CLEANUP:
00098   return hr;
00099 }
00100
00101
00102 //////////////////////////////////////////////////////////////////
00103 // CListener::Unadvise
00104 //
00105 //////////////////////////////////////////////////////////////////
00106 HRESULT CListener::Unadvise(CContainerBase* pCCPointBase, REFIID riid, DWORD* pdwCookie)
00107 {
00108   HRESULT hr = S_OK;
00109   ASSERT(pCCPointBase);
00110   ASSERT(pdwCookie);
00111   CComPtr<IConnectionPoint> spCP;
00112
00113   if(*pdwCookie && pCCPointBase->m_pIConnectionPointContainer)
00114   {
00115     //Obtain the connection point
00116     hr = pCCPointBase->FindConnectionPoint(riid, &spCP);
00117     if(SUCCEEDED(hr))
00118     {
00119       //Delegate
00120       TESTC(hr = Unadvise(spCP, pdwCookie));
00121     }
00122   }
00123
00124 CLEANUP:
00125   return hr;
00126 }
00127
00128
00129 //////////////////////////////////////////////////////////////////
00130 // CListener::Unadvise
00131 //
00132 //////////////////////////////////////////////////////////////////
00133 HRESULT CListener::Unadvise(IConnectionPoint* pIConnectionPoint, DWORD* pdwCookie)
00134 {
00135   HRESULT hr = S_OK;
00136   ASSERT(pdwCookie);
00137
00138   if(pIConnectionPoint)
00139   {
00140     //Now we can Unadvise the connection
00141     XTEST(hr = pIConnectionPoint->Unadvise(*pdwCookie));
00142     TESTC(TRACE_METHOD(hr, L"IConnectionPoint::Unadvise(0x%08x)", *pdwCookie));
00143     *pdwCookie = 0;
00144   }
00145
00146 CLEANUP:
00147   return hr;
00148 }
00149
00150
00151 //////////////////////////////////////////////////////////////////
00152 // CListener::AddRef
00153 //
00154 //////////////////////////////////////////////////////////////////
00155 STDMETHODIMP_(ULONG)  CListener::AddRef()
00156 {
00157   return ++m_cRef;
00158 }
00159
00160 //////////////////////////////////////////////////////////////////
00161 // CListener::Release
00162 //
00163 //////////////////////////////////////////////////////////////////
00164 STDMETHODIMP_(ULONG)  CListener::Release()
00165 {
00166   ASSERT(m_cRef);
00167   if(--m_cRef)
00168     return m_cRef;
00169
00170   delete this;
00171   return 0;
00172 }
00173
00174 //////////////////////////////////////////////////////////////////
00175 // CListener::QueryInterface
00176 //
00177 //////////////////////////////////////////////////////////////////
00178 STDMETHODIMP CListener::QueryInterface(REFIID riid, LPVOID* ppv)
00179 {
00180   if(!ppv)
00181     return E_INVALIDARG;
00182   *ppv = NULL;
00183
00184   if(riid == IID_IUnknown)
00185     *ppv = (IUnknown*)(IRowsetNotify*)this;
00186   else if(riid == IID_IRowsetNotify)
00187     *ppv = (IRowsetNotify*)this;
00188   else if(riid == IID_IDBAsynchNotify)
00189     *ppv = (IDBAsynchNotify*)this;
00190   else if(riid == IID_IRowPositionChange)
00191     *ppv = (IRowPositionChange*)this;
00192
00193   if(*ppv)
00194   {
00195     ((IUnknown*)*ppv)->AddRef();
00196     return S_OK;
00197   }
00198   else
00199   {
00200     return E_NOINTERFACE;
00201   }
00202
00203 }
00204
00205
00206 //////////////////////////////////////////////////////////////////
00207 // CListener::OnFieldChange
00208 //
00209 //////////////////////////////////////////////////////////////////
00210 STDMETHODIMP CListener::OnFieldChange
00211 (
00212     /* [in] */ IRowset __RPC_FAR* pIRowset,
00213     /* [in] */ HROW hRow,
00214     /* [in] */ DBORDINAL cColumns,
00215     /* [size_is][in] */ DBORDINAL __RPC_FAR rgColumns[  ],
00216     /* [in] */ DBREASON eReason,
00217     /* [in] */ DBEVENTPHASE ePhase,
00218     /* [in] */ BOOL fCantDeny
00219 )
00220 {
00221   //Format the column list...
00222   CComWSTR cstrList;
00223   cstrList += L"[";
00224   for(DBORDINAL i=0; i<cColumns; i++)
00225     cstrList += StackFormat(L"%d%s", rgColumns[i], (i+1<cColumns) ? L"," : L"");
00226   cstrList += L"]";
00227
00228   //Output Notification
00229   return TRACE_NOTIFICATION(NOTIFY_IROWSETNOTIFY, m_hrReturn, L"IRowsetNotify", L"OnFieldChange", L"(%s, %s, 0x%p, 0x%p, %lu, %s, %s)", GetReasonName(eReason), GetPhaseName(ePhase), pIRowset, hRow, cColumns, (WCHAR*)cstrList, fCantDeny ? L"TRUE" : L"FALSE");
00230 }
00231
00232 //////////////////////////////////////////////////////////////////
00233 // CListener::OnRowChange
00234 //
00235 //////////////////////////////////////////////////////////////////
00236 STDMETHODIMP CListener::OnRowChange
00237 (
00238     /* [in] */ IRowset __RPC_FAR* pIRowset,
00239     /* [in] */ DBCOUNTITEM cRows,
00240     /* [size_is][in] */ const HROW __RPC_FAR rghRows[  ],
00241     /* [in] */ DBREASON eReason,
00242     /* [in] */ DBEVENTPHASE ePhase,
00243     /* [in] */ BOOL fCantDeny
00244 )
00245 {
00246   //Format the row handle list...
00247   CComWSTR cstrList;
00248   cstrList += L"[";
00249   for(DBCOUNTITEM i=0; i<cRows; i++)
00250     cstrList += StackFormat(L"%d%s", rghRows[i], (i+1<cRows) ? L"," : L"");
00251   cstrList += L"]";
00252
00253   //Output Notification
00254   return TRACE_NOTIFICATION(NOTIFY_IROWSETNOTIFY, m_hrReturn, L"IRowsetNotify", L"OnRowChange", L"(%s, %s, 0x%p, %lu, %s, %s)", GetReasonName(eReason), GetPhaseName(ePhase), pIRowset, cRows, (WCHAR*)cstrList, fCantDeny ? L"TRUE" : L"FALSE");
00255 }
00256
00257 //////////////////////////////////////////////////////////////////
00258 // CListener::OnRowsetChange
00259 //
00260 //////////////////////////////////////////////////////////////////
00261 STDMETHODIMP CListener::OnRowsetChange
00262 (
00263     /* [in] */ IRowset __RPC_FAR* pIRowset,
00264     /* [in] */ DBREASON eReason,
00265     /* [in] */ DBEVENTPHASE ePhase,
00266     /* [in] */ BOOL fCantDeny)
00267 {
00268   //Output Notification
00269   return TRACE_NOTIFICATION(NOTIFY_IROWSETNOTIFY, m_hrReturn, L"IRowsetNotify", L"OnRowsetChange", L"(%s, %s, 0x%p, %s)", GetReasonName(eReason), GetPhaseName(ePhase), pIRowset, fCantDeny ? L"TRUE" : L"FALSE");
00270 }
00271
00272
00273 //////////////////////////////////////////////////////////////////
00274 // CListener::OnLowResource
00275 //
00276 //////////////////////////////////////////////////////////////////
00277 STDMETHODIMP CListener::OnLowResource
00278 (
00279   DB_DWRESERVE dwReserved
00280 )
00281 {
00282   //Output Notification
00283   return TRACE_NOTIFICATION(NOTIFY_IDBASYNCHNOTIFY, m_hrReturn, L"IDBAsynchNotify", L"OnLowResource", L"(0x%p)", dwReserved);
00284 }
00285
00286 //////////////////////////////////////////////////////////////////
00287 // CListener::OnProgress
00288 //
00289 //////////////////////////////////////////////////////////////////
00290 STDMETHODIMP CListener::OnProgress
00291     (
00292             HCHAPTER    hChapter,
00293             DBASYNCHOP    eOperation,
00294             DBCOUNTITEM   ulProgress,
00295             DBCOUNTITEM   ulProgressMax,
00296             DBASYNCHPHASE eAsynchPhase,
00297             LPOLESTR    pwszStatusText
00298     )
00299 {
00300   //Output Notification
00301   return TRACE_NOTIFICATION(NOTIFY_IDBASYNCHNOTIFY, m_hrReturn, L"IDBAsynchNotify", L"OnProgress", L"(0x%p, %s, %lu, %lu, %s, %s)", hChapter, GetAsynchReason(eOperation), ulProgress, ulProgressMax, GetAsynchPhase(eAsynchPhase), pwszStatusText);
00302 }
00303
00304 //////////////////////////////////////////////////////////////////
00305 // CListener::OnStop
00306 //
00307 //////////////////////////////////////////////////////////////////
00308 STDMETHODIMP CListener::OnStop
00309     (
00310             HCHAPTER hChapter,
00311             ULONG    ulOperation,
00312             HRESULT  hrStatus,
00313             LPOLESTR pwszStatusText
00314     )
00315 {
00316   //Output Notification
00317   return TRACE_NOTIFICATION(NOTIFY_IDBASYNCHNOTIFY, m_hrReturn, L"IDBAsynchNotify", L"OnStop", L"(0x%p, %s, %S, %s)", hChapter, GetAsynchReason(ulOperation), GetErrorName(hrStatus), pwszStatusText);
00318 }
00319
00320
00321 //////////////////////////////////////////////////////////////////
00322 // CListener::OnRowPositionChange
00323 //
00324 //////////////////////////////////////////////////////////////////
00325 STDMETHODIMP CListener::OnRowPositionChange(
00326     DBREASON    eReason,
00327     DBEVENTPHASE  ePhase,
00328     BOOL      fCantDeny)
00329 {
00330   //Output Notification
00331   return TRACE_NOTIFICATION(NOTIFY_IROWPOSITIONCHANGE, m_hrReturn, L"IRowPositionChange", L"OnRowPositionChange", L"(%s, %s, %s)", GetReasonName(eReason), GetPhaseName(ePhase), fCantDeny ? L"TRUE" : L"FALSE");
00332 }
00333
00334
Generated on Wed Nov 13 2024 16:52:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/WinUtils.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList

WinUtils.c

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1996 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // PROGRAM: WINUTILS.c
00009 //
00010 // PURPOSE: general purpose MS-Windows utility functions
00011 //
00012 // PLATFORMS:  Windows NT (only)
00013 //
00014 // FUNCTIONS:
00015 //    CenterWindow() -  Centers one window over another
00016 //    GetStringRes() -  retrieves a string resource
00017 //
00018 // SPECIAL INSTRUCTIONS: N/A
00019 //
00020
00021 //  system include files
00022 #define WIN32_LEAN_AND_MEAN 1
00023 #include <windows.h>
00024
00025 // local include files
00026 #include "winutils.h"
00027
00028 //
00029 //   FUNCTION: CenterWindow(HWND, HWND)
00030 //
00031 //   PURPOSE: Centers one window over another.
00032 //
00033 //   COMMENTS:
00034 //
00035 //        In this function, we save the instance handle in a global variable and
00036 //        create and display the main program window.
00037 //
00038 //       This functionwill center one window over another ensuring that
00039 //    the placement of the window is within the 'working area', meaning
00040 //    that it is both within the display limits of the screen, and not
00041 //    obscured by the tray or other framing elements of the desktop.
00042 BOOL CenterWindow (HWND hwndChild, HWND hwndParent)
00043 {
00044    RECT    rChild, rParent, rWorkArea;
00045    int     wChild, hChild, wParent, hParent;
00046    int     xNew, yNew;
00047    BOOL  bResult;
00048
00049    // Get the Height and Width of the child window
00050    GetWindowRect (hwndChild, &rChild);
00051    wChild = rChild.right - rChild.left;
00052    hChild = rChild.bottom - rChild.top;
00053
00054    // Get the Height and Width of the parent window
00055    GetWindowRect (hwndParent, &rParent);
00056    wParent = rParent.right - rParent.left;
00057    hParent = rParent.bottom - rParent.top;
00058
00059    // Get the limits of the 'workarea'
00060    bResult = SystemParametersInfo(
00061       SPI_GETWORKAREA,  // system parameter to query or set
00062       sizeof(RECT),
00063       &rWorkArea,
00064       0);
00065    if (!bResult) {
00066       rWorkArea.left = rWorkArea.top = 0;
00067       rWorkArea.right = GetSystemMetrics(SM_CXSCREEN);
00068       rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
00069    }
00070
00071    // Calculate new X position, then adjust for workarea
00072    xNew = rParent.left + ((wParent - wChild) /2);
00073    if (xNew < rWorkArea.left) {
00074       xNew = rWorkArea.left;
00075    } else if ((xNew+wChild) > rWorkArea.right) {
00076       xNew = rWorkArea.right - wChild;
00077    }
00078
00079    // Calculate new Y position, then adjust for workarea
00080    yNew = rParent.top  + ((hParent - hChild) /2);
00081    if (yNew < rWorkArea.top) {
00082       yNew = rWorkArea.top;
00083    } else if ((yNew+hChild) > rWorkArea.bottom) {
00084       yNew = rWorkArea.bottom - hChild;
00085    }
00086
00087    // Set it, and return
00088    return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
00089 }
00090
00091
00092 //---------------------------------------------------------------------------
00093 //
00094 // FUNCTION:    GetStringRes (int id INPUT ONLY)
00095 //
00096 // COMMENTS:    Load the resource string with the ID given, and return a
00097 //              pointer to it.  Notice that the buffer is common memory so
00098 //              the string must be used before this call is made a second time.
00099 //
00100 //---------------------------------------------------------------------------
00101
00102 LPTSTR   GetStringRes (int id)
00103 {
00104   static TCHAR buffer[MAX_PATH];
00105
00106   buffer[0]=0;
00107   LoadString (GetModuleHandle (NULL), id, buffer, MAX_PATH);
00108   return buffer;
00109 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagSHOWERRORMSG Member List

This is the complete list of members for _tagSHOWERRORMSG, including all inherited members.
ErrorID | _tagSHOWERRORMSG
hWndParent | _tagSHOWERRORMSG
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/list.cpp Source File

  • Begin
  • sdkdiff

list.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010 /* Storage allocation scheme customised */
00011
00012 #include "precomp.h"
00013 #include "list.h"
00014 #include "..\sdkdiff\errorout.h"
00015
00016 // use the standard Trace_Error function, but we have no
00017 // parent window to pass for these errors.
00018 #define TRACE_ERROR(a, b) Trace_Error(NULL, a, b)
00019
00020
00021 char msg[80];  /* a temp for building up StringCchPrintf messages in */
00022
00023 #define BLOCKSIZE 25000
00024 typedef struct blockTag {
00025     struct blockTag * PrevBlock; /* backward link (NULL terminated doubly linked chain of blocks) */
00026     struct blockTag * NextBlock; /* forward link (pCurrent points to last in chain) */
00027     HANDLE hMem;     /* memory handle for this block */
00028     int iInUse;      /* number of allocations taken out of it.  0 => free it */
00029     SIZE_T iNext;       /* next byte to use */
00030     char chData[BLOCKSIZE];
00031 } BLOCK, *PBLOCK;
00032
00033 CRITICAL_SECTION CritSec;  /* to protect pCurrent */
00034
00035 PBLOCK pCurrent = NULL;  /* block currently in use */
00036 /* must always be either NULL or valid */
00037
00038 /* Allocate storage for List elements.  n.b. after a call to this
00039    you MUST record the value of pCurrent as you need to hand that in
00040    to Free.  You don't hand in the value of the actual storage.
00041    See screed above.
00042    This function Enters the critical section.  The caller must Leave it.
00043 */
00044 LPVOID
00045 list_Alloc(
00046           SIZE_T size
00047           )
00048 {
00049     LPVOID pRet;
00050     PBLOCK pb;
00051     EnterCriticalSection(&CritSec);
00052     if ((pCurrent==NULL)||(pCurrent->iNext+size>BLOCKSIZE+1)) {
00053     pb = pCurrent;
00054         pCurrent = (struct blockTag*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY ,(sizeof(BLOCK)));
00055         if (pCurrent==NULL) {
00056             OutputDebugString("HeapAlloc failed!!\n");
00057             return NULL;
00058         }
00059
00060         pCurrent->PrevBlock = pb;
00061         pCurrent->NextBlock = NULL;
00062         pCurrent->hMem = pCurrent;
00063         pCurrent->iInUse = 0;
00064         pCurrent->iNext = 0;
00065         if (pb==NULL)
00066             ;
00067         else
00068             pb->NextBlock = pCurrent;
00069     }
00070     pRet = &(pCurrent->chData[pCurrent->iNext]);
00071     ++(pCurrent->iInUse);
00072     pCurrent->iNext += size;
00073
00074     /* for MIPS we must also ensure that the data is aligned 4 byte*/
00075     pCurrent->iNext = ((pCurrent->iNext + (sizeof(void *)-1)) & ~(sizeof(void *) - 1));
00076
00077     return pRet;
00078 }
00079
00080 void
00081 list_Free(
00082          PBLOCK pBlock,
00083          LPVOID p
00084          )
00085 {
00086     HANDLE hMem;
00087   HRESULT hr;
00088
00089     EnterCriticalSection(&CritSec);
00090     --pBlock->iInUse;
00091     if (pBlock->iInUse<=0) {if (pBlock->iInUse<0) {
00092       hr = StringCchPrintf(msg, sizeof(msg),"List block allocation negative (%d)", pBlock->iInUse);
00093       if (FAILED(hr))
00094         OutputError(hr, IDS_SAFE_PRINTF);
00095             TRACE_ERROR(msg, FALSE);
00096         }
00097         if (pCurrent==pBlock) pCurrent = pBlock->PrevBlock; /* defend the invariant */
00098         /* loop it out of the chain */
00099         if (pBlock->PrevBlock!=NULL) pBlock->PrevBlock->NextBlock = pBlock->NextBlock;
00100         if (pBlock->NextBlock!=NULL) pBlock->NextBlock->PrevBlock = pBlock->PrevBlock;
00101         hMem = pBlock->hMem;
00102         HeapFree(GetProcessHeap(), NULL, hMem);
00103     }
00104     LeaveCriticalSection(&CritSec);
00105 }
00106
00107
00108
00109 /* The following definition tells the truth about what an ITEM is.  The
00110 |  header file says only that there's a structure with the tag item_tag and
00111 |  that a LIST is a pointer to one.  Here we spell out what that structure
00112 |  is (and a LIST is still a pointer to one).  A PLIST is defined as a
00113 |  pointer to one of those, but is only really used because the C
00114 |  parameter mechanism demands an extra level of indirection for a
00115 |  parameter that can be updated.  (Modula-2 VAR parameter).
00116 */
00117 typedef struct item_tag {
00118     struct item_tag *pitNext;    /* to next in circular list */
00119     struct item_tag *pitPrev;    /* to prev in circular list */
00120     PBLOCK pBlock;               /* to memory block */
00121     BOOL bAnchor;                /* TRUE iff an anchor block */
00122     BOOL bOK;                    /* true unless a list op has failed */
00123     int iLen;                    /* length of data only */
00124     char *Data[1];               /* the caller's data.  The '1' is a lie */
00125 } ITEM;
00126
00127 /* For an anchor block, only the fields pitNext thru bAnchor are allocated.
00128 |  For a normal list element, Data may well be longer than 1 byte.
00129 |  The bOK flag is to support a style of programming where several
00130 |  successive operations can be done without having to check the return
00131 |  code at each stage.  At the end, the list can be examined to see if
00132 |  the data in it is valid or if it has been made invalid by the failure
00133 |  of any of the previous operations.  Certain operations may result in
00134 |  having no list at all if they fail (e.g. create) and for these, you'd
00135 |  better check the result at once!
00136 */
00137
00138 static SIZE_T iAnchorSize;      /* Size of anchor block (no data, no dummy) */
00139 static SIZE_T iHeaderSize;      /* Size of data block not counting Data
00140                                 and offset from cursor back to item.
00141                              */
00142 static BOOL bInited = FALSE; /* TRUE <=> iAnchorSize and iHeaderSize are OK*/
00143
00144 #define MOVEBACK(Curs)                                               \
00145    { Curs = ((char *)Curs-iHeaderSize); } /*move from Data to pitNext*/
00146
00147 /*==================================================================
00148 || Lists are circular, doubly linked with an anchor block which holds
00149 || pointers to both ends.  Every block has a flag which shows whether
00150 || it's an anchor or not.
00151 ||
00152 || Empty list:
00153 ||
00154 ||      -------------
00155 ||     |             |
00156 ||     |   Anchor    |
00157 ||     v   -------   |
00158 ||  Ul--->| Next--+--|
00159 ||        |-------|  |
00160 ||        | Prev--+--
00161 ||         -------
00162 ||
00163 || One entry list:
00164 ||
00165 ||      ------------------------------------
00166 ||     |                                    |
00167 ||     |   Anchor                           |
00168 ||     v   -------                ------    |
00169 ||  Ul--->| Next--+------------->| Next-+---|
00170 ||        |-------|    |         |------|   |
00171 ||        | Prev--+----          | Prev-+---
00172 ||         -------               |------|
00173 ||                               | Len  |
00174 ||                               |------|
00175 ||                               | Data |
00176 ||                                ------
00177 || Two entry list:
00178 ||
00179 ||      -------------------------------------------------
00180 ||     | ---------------    ---------------              |
00181 ||     ||               |  |               |             |
00182 ||     ||  Anchor       |  |               |             |
00183 ||     vv  --------     |  v    ------     |    ------   |
00184 ||  Ul--->| Next--+-----+----->| Next-+----+-->| Next-+--
00185 ||        |-------|     |      |------|  | |   |------|
00186 ||        | Prev--+--    ------+-Prev |  |  ---+-Prev |
00187 ||         -------   |         |------|  |     |------|
00188 ||                   |         | Len  |  |     | Len  |
00189 ||                   |         |------|  |     |------|<----Cursor
00190 ||                   |         | Data |  |     | Data |
00191 ||                   |          ------   |      ------
00192 ||                   |                   |
00193 ||                    -------------------
00194 ||
00195 || etc.
00196 ||
00197 || Note that an external cursor (i.e one which is seen by the caller)
00198 || points to the Data field, not to the start of the structure.
00199 || This allows easy access to the data by the user at the cost of a
00200 || slightly slower traverse.
00201 || Within this module, we may sometimes traverse a list with  a cursor
00202 || that points to the start of an item.  This is called an item cursor.
00203 È===================================================================*/
00204
00205 /*------------------------------------------------------------------
00206 | Set iAnchorSize and iHeaderSize.  Implementation independent!
00207  -------------------------------------------------------------------*/
00208 void
00209 APIENTRY
00210 List_Init(
00211          void
00212          )
00213 {
00214     LIST P;
00215     P = (LIST)&P;                  /* really any old address will do */
00216     iAnchorSize = (char *)&(P->iLen) - (char *)&(P->pitNext);
00217     iHeaderSize = (char *)&(P->Data) - (char *)&(P->pitNext);
00218     InitializeCriticalSection(&CritSec);
00219     bInited = TRUE;
00220     /* assumes layout in storage is linear */
00221 }
00222
00223
00224 void
00225 APIENTRY
00226 List_Term(
00227          void
00228          )
00229 {
00230     if (pCurrent!=NULL)
00231         TRACE_ERROR("List storage not cleared out properly", FALSE);
00232 }
00233
00234
00235
00236 /* Dump the internals to the debugger. */
00237 void
00238 APIENTRY
00239 List_Dump(
00240          LPSTR Header,
00241          LIST lst
00242          )
00243 {
00244     LIST pit;
00245   HRESULT hr;
00246     char X_msg[250] = {0};
00247
00248     OutputDebugString(Header);  OutputDebugString("\n");
00249     pit = lst;
00250     do {
00251         hr = StringCchPrintf(X_msg, sizeof(X_msg)-1, "%8p %8p %8p %ld %s "
00252                  , pit, pit->pitNext, pit->pitPrev, pit->iLen
00253                  , (pit->bAnchor ? "Anchor" : "Data")
00254                 );
00255     if (FAILED(hr))
00256       OutputError(hr, IDS_SAFE_PRINTF);
00257         OutputDebugString(X_msg);
00258         if (pit->pitNext->pitPrev != pit)
00259             OutputDebugString(" Next Prev error!!");
00260         if (pit->pitPrev->pitNext != pit)
00261             OutputDebugString(" Prev Next error!!");
00262         OutputDebugString("\n");
00263         pit = pit->pitNext;
00264     } while (pit!=lst);
00265     OutputDebugString("End of list dump\n");
00266 }
00267
00268 /* Dump hex representation of handle to debugger */
00269 void
00270 APIENTRY
00271 List_Show(
00272          LIST lst
00273          )
00274 {
00275     char X_msg[50] = {0};
00276   HRESULT hr = StringCchPrintf(X_msg, sizeof(X_msg)-1, "%p", lst);
00277   if (FAILED(hr))
00278     OutputError(hr, IDS_SAFE_PRINTF);
00279     OutputDebugString(X_msg);
00280 }
00281
00282 /*------------------------------------------------------------------
00283 | Create a list.  It will be initially empty
00284  -------------------------------------------------------------------*/
00285 LIST
00286 APIENTRY
00287 List_Create(
00288            void
00289            )
00290 {
00291     LIST lst;
00292     if (!bInited) {
00293         List_Init();            /* prevent some strange errors */
00294     }
00295     lst = (LIST)list_Alloc(iAnchorSize);
00296
00297     if (lst==NULL) {
00298         return NULL;
00299     }
00300     lst->pBlock = pCurrent;
00301     LeaveCriticalSection(&CritSec);
00302     lst->bOK = TRUE;
00303     lst->pitNext = lst;
00304     lst->pitPrev = lst;
00305     lst->bAnchor = TRUE;
00306     /* no length field set in an anchor block */
00307     return lst;
00308 }
00309
00310 /*------------------------------------------------------------------
00311 | Destroy *plst.  It does not need to be empty first
00312  -------------------------------------------------------------------*/
00313 void
00314 APIENTRY
00315 List_Destroy(
00316             PLIST plst
00317             )
00318 {
00319     LIST pitP;    /* item cursor on * plst */
00320     LIST pitQ;    /* item cursor runs one step ahead of pitQ */
00321
00322     if (plst==NULL) {
00323         TRACE_ERROR("Bug:Attempt to destroy NULL list.  Continuing...", FALSE);
00324         return;
00325     }
00326
00327     /* There is at least an anchor block to destroy */
00328     pitP = *plst;
00329     do {
00330         pitQ = pitP->pitNext;
00331         list_Free(pitP->pBlock, pitP);
00332         pitP = pitQ;
00333     }while (pitP != *plst);
00334     *plst = NULL;
00335 }
00336
00337 /*------------------------------------------------------------------
00338 | Add an item holding Object to the beginning of * plst
00339  -------------------------------------------------------------------*/
00340 void
00341 APIENTRY
00342 List_AddFirst(
00343              LIST lst,
00344              LPVOID pObject,
00345              UINT uLen
00346              )
00347 {
00348     LIST pit;      /* newly allocated item */
00349
00350     if (lst==NULL) {
00351         TRACE_ERROR("Bug: List_AddFirst to bogus list.  Continuing...", FALSE);
00352         return;
00353     }
00354     pit = (LIST)list_Alloc(iHeaderSize+uLen);
00355     if (pit==NULL) {
00356         lst->bOK = FALSE;
00357         return;
00358     }
00359     pit->pBlock = pCurrent;
00360     LeaveCriticalSection(&CritSec);
00361     pit->iLen = uLen;
00362     pit->pitPrev = lst;
00363     pit->pitNext = lst->pitNext;
00364     lst->pitNext->pitPrev = pit; /* for empty list that set lst->pitPrev */
00365     lst->pitNext = pit;
00366     pit->bAnchor = FALSE;
00367     memcpy( &(pit->Data), pObject, uLen );
00368 }
00369
00370 /*------------------------------------------------------------------
00371 | Return the address of the place for Len bytes of data in a new
00372 | item at the start of lst
00373  -------------------------------------------------------------------*/
00374 LPVOID
00375 APIENTRY
00376 List_NewFirst(
00377              LIST lst,
00378              UINT uLen
00379              )
00380 {
00381     LIST pit;
00382
00383     if (lst==NULL) {
00384         TRACE_ERROR("Bug: List_NewFirst to bogus list.  Continuing...", FALSE);
00385         return NULL;
00386     }
00387     pit = (LIST)list_Alloc(iHeaderSize+uLen);
00388     if (pit==NULL) {
00389         lst->bOK = FALSE;
00390         return NULL;
00391     }
00392     pit->pBlock = pCurrent;
00393     LeaveCriticalSection(&CritSec);
00394     pit->iLen = uLen;
00395     pit->pitPrev = lst;
00396     pit->pitNext = lst->pitNext;
00397     lst->pitNext->pitPrev = pit; /* for empty list that set lst->pitPrev */
00398     lst->pitNext = pit;
00399     pit->bAnchor = FALSE;
00400     return (char *)&(pit->Data);
00401 }
00402
00403 /*------------------------------------------------------------------
00404 | Delete the first item in lst.  Error if lst is empty
00405  -------------------------------------------------------------------*/
00406 void
00407 APIENTRY
00408 List_DeleteFirst(
00409                 LIST lst
00410                 )
00411 {
00412     LIST pit;
00413
00414     if (lst==NULL) {TRACE_ERROR("Bug: List_DeleteFirst from bogus list.  Continuing...", FALSE);
00415         return;
00416     }
00417     /* attempting to delete the anchor block! */
00418     if (lst->pitNext==lst) {
00419         lst->bOK = FALSE;
00420     } else {
00421         pit = lst->pitNext;
00422         pit->pitNext->pitPrev = pit->pitPrev;
00423         pit->pitPrev->pitNext = pit->pitNext;
00424         list_Free(pit->pBlock, pit);
00425     }
00426 }
00427
00428 /*------------------------------------------------------------------
00429 | Add an item holding Object to the end of lst
00430  -------------------------------------------------------------------*/
00431 void
00432 APIENTRY
00433 List_AddLast(
00434             LIST lst,
00435             LPVOID pObject,
00436             UINT uLen
00437             )
00438 {
00439     LIST pit;
00440
00441     if (lst==NULL) {
00442         TRACE_ERROR("Bug: List_AddLast to bogus list. Continuing...", FALSE);
00443         return;
00444     }
00445     pit = (LIST)list_Alloc(iHeaderSize+uLen);
00446     if (pit==NULL) {
00447         lst->bOK = FALSE;
00448         return;
00449     }
00450     pit->pBlock = pCurrent;
00451     LeaveCriticalSection(&CritSec);
00452     pit->iLen = uLen;
00453     pit->pitNext = lst;
00454     pit->pitPrev = lst->pitPrev;
00455     lst->pitPrev->pitNext = pit; /* for empty list that set lst->pitNext */
00456     lst->pitPrev = pit;
00457     pit->bAnchor = FALSE;
00458     memcpy( &(pit->Data), pObject, uLen );
00459 }
00460
00461 /*------------------------------------------------------------------
00462 | Return the address of the place for uLen bytes of data in a new
00463 |  item at the end of lst
00464  -------------------------------------------------------------------*/
00465 LPVOID
00466 APIENTRY
00467 List_NewLast(
00468             LIST lst,
00469             UINT uLen
00470             )
00471 {
00472     LIST pit;
00473
00474     if (lst==NULL) {
00475         TRACE_ERROR("Bug: List_NewLast in bogus list.  Continuing...", FALSE);
00476         return NULL;
00477     }
00478     pit = (LIST)list_Alloc(iHeaderSize+uLen);
00479     if (pit==NULL) {
00480         lst->bOK = FALSE;
00481         return NULL;
00482     }
00483     pit->pBlock = pCurrent;
00484     LeaveCriticalSection(&CritSec);
00485     pit->iLen = uLen;
00486     pit->pitNext = lst;
00487     pit->pitPrev = lst->pitPrev;
00488     lst->pitPrev->pitNext = pit; /* for empty list that set lst->pitNext */
00489     lst->pitPrev = pit;
00490     pit->bAnchor = FALSE;
00491     return (char *)&(pit->Data);
00492 }
00493
00494 /*------------------------------------------------------------------
00495 | Delete the last item in lst.  Error if lst is empty
00496  -------------------------------------------------------------------*/
00497 void
00498 APIENTRY
00499 List_DeleteLast(
00500                LIST lst
00501                )
00502 {
00503     LIST pit;
00504
00505     if (lst==NULL) {
00506         TRACE_ERROR("Bug: List_DeleteLast from bogus list.  Continuing...", FALSE);
00507         return;
00508     }
00509     /* attempting to delete the anchor block! */
00510     if (lst->pitNext==lst) {
00511         lst->bOK = FALSE;
00512     } else {
00513         pit = lst->pitPrev;
00514         pit->pitNext->pitPrev = pit->pitPrev;
00515         pit->pitPrev->pitNext = pit->pitNext;
00516         list_Free(pit->pBlock, pit);
00517     }
00518 }
00519
00520 /*--------------------------------------------------------------------
00521 | Add an item holding * pObject to lst immediately after Curs.
00522 | List_AddAfter(lst,NULL,pObject,Len) adds it to the start of the lst
00523  ---------------------------------------------------------------------*/
00524 void
00525 APIENTRY
00526 List_AddAfter(
00527              LIST lst,
00528              LPVOID Curs,
00529              LPVOID pObject,
00530              UINT uLen
00531              )
00532 {
00533     LIST pitNew;
00534     LIST pitAfter;
00535
00536     if (lst==NULL) {
00537         TRACE_ERROR("Bug: List_AddAfter in bogus list.  Continuing...", FALSE);
00538         return;
00539     }
00540     if (Curs==NULL) {
00541         List_AddFirst(lst, pObject, uLen);
00542     } else {
00543         MOVEBACK(Curs);
00544         pitAfter = (LIST)Curs;
00545         pitNew = (LIST)list_Alloc(iHeaderSize+uLen);
00546         if (pitNew==NULL) {
00547             lst->bOK = FALSE;
00548             return;
00549         }
00550         pitNew->pBlock = pCurrent;
00551         LeaveCriticalSection(&CritSec);
00552         pitNew->iLen = uLen;
00553         pitNew->pitPrev = pitAfter;
00554         pitNew->pitNext = pitAfter->pitNext;
00555         pitAfter->pitNext->pitPrev = pitNew;
00556         pitAfter->pitNext = pitNew;
00557         pitNew->bAnchor = FALSE;
00558         memcpy( &(pitNew->Data), pObject, uLen );
00559     }
00560 }
00561
00562 /*--------------------------------------------------------------------
00563 | Return the address of the place for uLen bytes of data in a new
00564 | item immediately after Curs.
00565 | List_NewAfter(Lst,NULL,uLen) returns a pointer
00566 | to space for uLen bytes in a new first element.
00567  ---------------------------------------------------------------------*/
00568 LPVOID
00569 APIENTRY
00570 List_NewAfter(
00571               LIST lst,
00572               LPVOID Curs,
00573               UINT uLen
00574               )
00575 {
00576     LIST pitNew;
00577     LIST pitAfter;
00578
00579     if (lst==NULL) {
00580         TRACE_ERROR("Bug: List_NewAfter in bogus list. Continuing...", FALSE);
00581         return NULL;
00582     }
00583     if (Curs==NULL) {
00584         return List_NewFirst(lst, uLen);
00585     } else {
00586         MOVEBACK(Curs);
00587         pitAfter = (LIST)Curs;
00588         pitNew = (LIST)list_Alloc(iHeaderSize+uLen);
00589         if (pitNew==NULL) {
00590             lst->bOK = FALSE;
00591             return NULL;
00592         }
00593         pitNew->pBlock = pCurrent;
00594         LeaveCriticalSection(&CritSec);
00595         pitNew->iLen = uLen;
00596         pitNew->pitPrev = pitAfter;
00597         pitNew->pitNext = pitAfter->pitNext;
00598         pitAfter->pitNext->pitPrev = pitNew;
00599         pitAfter->pitNext = pitNew;
00600         pitNew->bAnchor = FALSE;
00601         return (char *)&(pitNew->Data);
00602     }
00603 }
00604
00605 /*--------------------------------------------------------------------
00606 | Add an item holding Object to lst immediately before Curs.
00607 | List_AddBefore(Lst,NULL,Object,uLen) adds it to the end of the list
00608  ---------------------------------------------------------------------*/
00609 void
00610 APIENTRY
00611 List_AddBefore(
00612                LIST lst,
00613                LPVOID Curs,
00614                LPVOID pObject,
00615                UINT uLen
00616                             )
00617 {
00618     LIST pitNew;
00619     LIST pitBefore;
00620
00621     if (lst==NULL) {
00622         TRACE_ERROR("Bug: List_AddBefore in bogus list.  Continuing...", FALSE);
00623         return;
00624     }
00625     if (Curs==NULL) {
00626         List_AddLast(lst, pObject, uLen);
00627     } else {
00628         MOVEBACK(Curs);
00629         pitBefore = (LIST)Curs;
00630         pitNew = (LIST)list_Alloc(iHeaderSize+uLen);
00631         if (pitNew==NULL) {
00632             lst->bOK = FALSE;
00633             return;
00634         }
00635         pitNew->pBlock = pCurrent;
00636         LeaveCriticalSection(&CritSec);
00637         pitNew->iLen = uLen;
00638         pitNew->pitNext = pitBefore;
00639         pitNew->pitPrev = pitBefore->pitPrev;
00640         pitBefore->pitPrev->pitNext = pitNew;
00641         pitBefore->pitPrev = pitNew;
00642         pitNew->bAnchor = FALSE;
00643         memcpy( &(pitNew->Data), pObject, uLen );
00644     }
00645 }
00646
00647 /*--------------------------------------------------------------------
00648 | Return the address of the place for uLen bytes of data in a new
00649 | item immediately before Curs.
00650 | List_NewBefore(Lst,NULL,uLen) returns a pointer
00651 | to space for uLen bytes in a new last element.
00652  ---------------------------------------------------------------------*/
00653 LPVOID
00654 APIENTRY
00655 List_NewBefore(
00656                LIST lst,
00657                LPVOID Curs,
00658                UINT uLen
00659                )
00660 {
00661     LIST pitNew;
00662     LIST pitBefore;
00663
00664     if (lst==NULL) {
00665         TRACE_ERROR("Bug: List_NewBefore in bogus list.  Continuing...", FALSE);
00666         return NULL;
00667     }
00668     if (Curs==NULL) {
00669         return List_NewLast(lst, uLen);
00670     } else {
00671         MOVEBACK(Curs);
00672         pitBefore = (LIST)Curs;
00673         pitNew = (LIST)list_Alloc(iHeaderSize+uLen);
00674         if (pitNew==NULL) {
00675             lst->bOK = FALSE;
00676             return NULL;
00677         }
00678         pitNew->pBlock = pCurrent;
00679         LeaveCriticalSection(&CritSec);
00680         pitNew->iLen = uLen;
00681         pitNew->pitNext = pitBefore;
00682         pitNew->pitPrev = pitBefore->pitPrev;
00683         pitBefore->pitPrev->pitNext = pitNew;
00684         pitBefore->pitPrev = pitNew;
00685         pitNew->bAnchor = FALSE;
00686         return (char *) &(pitNew->Data);
00687     }
00688 }
00689
00690 /*------------------------------------------------------------------
00691 | Delete the item that Curs identifies.
00692 | This will be only a few (maybe as little as 3) machine instructions
00693 | quicker than DeleteForwards or DeleteBackwards but leaves Curs dangling.
00694 | It is therefore NOT usually to be preferred.
00695 | It may be useful when you have a function which returns an LPVOID
00696 | since the argument does not need to be a variable.
00697 |     Trivial example: List_Delete(List_First(L));
00698  -------------------------------------------------------------------*/
00699 void
00700 APIENTRY
00701 List_Delete(
00702             LPVOID Curs
00703             )
00704 {
00705     LIST pit;
00706     if (Curs==NULL) {
00707         TRACE_ERROR("Bug: List_Delete NULL item", FALSE);
00708         return;
00709     }
00710     MOVEBACK(Curs)
00711     pit = (LIST)Curs;
00712     pit->pitNext->pitPrev = pit->pitPrev;
00713     pit->pitPrev->pitNext = pit->pitNext;
00714     list_Free(pit->pBlock, pit);
00715 }
00716
00717 /*-----------------------------------------------------------------------
00718 | Delete the item that Curs identifies and return a cursor that
00719 | identifies the next item (NULL if already on last)
00720  ------------------------------------------------------------------------*/
00721 LPVOID
00722 APIENTRY
00723 List_DeleteForwards(
00724                     LPVOID Curs
00725                     )
00726 {
00727     LIST pitDel;  /* the item to delete */
00728     LIST pitN;    /* the item after (could be anchor) */
00729     if (Curs==NULL) {
00730         TRACE_ERROR("Bug: List_DeleteForwards NULL cursor. Continuing...", FALSE);
00731         return NULL;
00732     }
00733     MOVEBACK(Curs)
00734     pitDel = (LIST)Curs;
00735     pitN = pitDel->pitNext;
00736
00737     pitN->pitPrev = pitDel->pitPrev;
00738     pitDel->pitPrev->pitNext = pitN;
00739     list_Free(pitDel->pBlock, pitDel);
00740     if (pitN->bAnchor)
00741         return NULL;
00742     else
00743         return (char *)&(pitN->Data);
00744 }
00745
00746 /*-----------------------------------------------------------------------
00747 | Delete the item that Curs identifies and return a cursor that
00748 | identifies the previous item (NULL if already on first)
00749  ------------------------------------------------------------------------*/
00750 LPVOID
00751 APIENTRY
00752 List_DeleteBackwards(
00753                      LPVOID Curs
00754                      )
00755 {
00756     LIST pitDel;  /* the one to delete */
00757     LIST pitB;    /* the one before */
00758
00759     if (Curs==NULL) {
00760         TRACE_ERROR("List_DeleteBackwards NULL cursor.  Continuing...", FALSE);
00761         return NULL;
00762     }
00763     MOVEBACK(Curs)
00764     pitDel = (LIST)Curs;
00765     pitB = pitDel->pitPrev;
00766     pitDel->pitNext->pitPrev = pitB;
00767     pitB->pitNext = pitDel->pitNext;
00768     list_Free(pitDel->pBlock, pitDel);
00769     if (pitB->bAnchor)
00770         return NULL;
00771     else
00772         return (char *)&(pitB->Data);
00773 }
00774
00775 /*-------------------------------------------------------------------
00776 | Return the length of the object identified by the cursor Curs
00777  -------------------------------------------------------------------*/
00778 int
00779 APIENTRY
00780 List_ItemLength(
00781                 LPVOID Curs
00782                 )
00783 {
00784     LIST pit;
00785     if (Curs==NULL) {
00786         TRACE_ERROR("Bug: List_ItemLength NULL cursor.  Continuing...", FALSE);
00787         return 0;
00788     }
00789     MOVEBACK(Curs)
00790     pit = (LIST)Curs;
00791     return pit->iLen;
00792 }
00793
00794 /*------------------------------------------------------------------
00795 | Return the address of the first object in lst
00796 |  If lst is empty then Return NULL.
00797  -------------------------------------------------------------------*/
00798 LPVOID
00799 APIENTRY
00800 List_First(
00801            LIST lst
00802            )
00803 {
00804     if (lst==NULL) {
00805         TRACE_ERROR("Bug: List_First of bogus list.  Continuing...", FALSE);
00806         return NULL;
00807     }
00808     if (lst->pitNext==lst) {
00809         return NULL;
00810     }
00811     return &(lst->pitNext->Data);
00812 }
00813
00814 /*------------------------------------------------------------------
00815 | Return the address of the last object in lst
00816 | If lst is empty then return NULL.
00817  -------------------------------------------------------------------*/
00818 LPVOID
00819 APIENTRY
00820 List_Last(
00821           LIST lst
00822           )
00823 {
00824     if (lst==NULL) {
00825         TRACE_ERROR("Bug: List_Last of bogus list.  Continuing...", FALSE);
00826         return NULL;
00827     }
00828     if (lst->pitNext==lst) {
00829         return NULL;
00830     }
00831     return &(lst->pitPrev->Data);
00832 }
00833
00834 /*------------------------------------------------------------------
00835 | Return the address of the object after Curs^.
00836 | List_Next(List_Last(lst)) == NULL;  List_Next(NULL) is an error.
00837  -------------------------------------------------------------------*/
00838 LPVOID
00839 APIENTRY
00840 List_Next(
00841           LPVOID Curs
00842           )
00843 {
00844     LIST pit;
00845
00846     if (Curs==NULL) {
00847         TRACE_ERROR("Bug: List_Next of NULL cursor.  Continuing...", FALSE);
00848         return NULL;
00849     }
00850     MOVEBACK(Curs)
00851     pit = (LIST)Curs;
00852     pit = pit->pitNext;
00853     if (pit->bAnchor) {
00854         return NULL;
00855     } else {
00856         return &(pit->Data);
00857     }
00858 }
00859
00860 /*------------------------------------------------------------------
00861 | Return the address of the object after Curs^.
00862 | List_Prev(List_First(L)) == NULL;  List_Prev(NULL) is an error.
00863  -------------------------------------------------------------------*/
00864 LPVOID
00865 APIENTRY
00866 List_Prev(
00867           LPVOID Curs
00868           )
00869 {
00870     LIST pit;
00871
00872     if (Curs==NULL) {
00873         TRACE_ERROR("Bug: List_Prev of NULL cursor.  Continuing...", FALSE);
00874         return NULL;
00875     }
00876     MOVEBACK(Curs)
00877     pit = (LIST)Curs;
00878     pit = pit->pitPrev;
00879     if (pit->bAnchor) {
00880         return NULL;
00881     } else {
00882         return &(pit->Data);
00883     }
00884 }
00885
00886 /*-------------------------------------------------------------------
00887 | Arrange that lst is empty after this call
00888  --------------------------------------------------------------------*/
00889 void
00890 APIENTRY
00891 List_Clear(
00892            LIST lst
00893            )
00894 {
00895     LIST pitP;   /* item cursor on List, points to element starts */
00896     LIST pitQ;   /* runs one step ahead of pitP                   */
00897
00898     if (lst==NULL) {
00899         TRACE_ERROR("Bug: List_Clear of bogus list.  Continuing...", FALSE);
00900         return;
00901     }
00902     pitP = lst->pitNext;   /* first element of list proper */
00903     while (pitP!=lst) {      /* while not wrapped onto anchor */pitQ = pitP->pitNext;
00904         list_Free(pitP->pBlock, pitP);
00905         pitP = pitQ;
00906     }
00907     lst->bOK = TRUE;
00908     lst->pitNext = lst;
00909     lst->pitPrev = lst;
00910 }
00911
00912 /*---------------------------------------------------------------------
00913 | Return TRUE if and only if lst is empty
00914  ----------------------------------------------------------------------*/
00915 BOOL
00916 APIENTRY
00917 List_IsEmpty(
00918              LIST lst
00919              )
00920 {  if (lst==NULL) {TRACE_ERROR("Bug: List_IsEmpty of bogus list.  Continuing...", FALSE);
00921         return TRUE;   /* well it's sort of true isn't it? */
00922     }
00923     return lst->pitNext ==lst;
00924 } /* List_IsEmpty */
00925
00926 /*------------------------------------------------------------------
00927 | l1 had better be empty.  l1 then acquires all the elements from l2
00928  -------------------------------------------------------------------*/
00929 void
00930 APIENTRY
00931 SwitchLists(
00932             LIST l1,
00933             LIST l2
00934             )
00935 {
00936     /* connect l1 to l2's elements, l1 had better be initially empty */
00937     l1->pitPrev = l2->pitPrev;
00938     l1->pitNext = l2->pitNext;
00939     /* connect the elements to l1 anchor block. */
00940     l1->pitPrev->pitNext = l1;
00941     l1->pitNext->pitPrev = l1;
00942     /* make l2 empty */
00943     l2->pitPrev = l2;
00944     l2->pitNext = l2;
00945 }
00946
00947 /*-----------------------------------------------------------------------
00948 | l1 := l1||l2; l2 := empty
00949 | The elements themselves are not moved, so pointers to them remain valid.
00950 |
00951 | l1 gets all the elements of l1 in their original order followed by
00952 | all the elements of l2 in the order they were in in l2.
00953 | l2 becomes empty.
00954  ------------------------------------------------------------------------*/
00955 void
00956 APIENTRY
00957 List_Join(
00958           LIST l1,
00959           LIST l2
00960           )
00961 {
00962     if ((l1==NULL)||(l2==NULL)) {
00963         TRACE_ERROR("Bug: List_Join of bogus list.  Continuing...", FALSE);
00964         return;
00965     }
00966     l1->bOK = l1->bOK &&l2->bOK;  /* result OK if both inputs OK */
00967     l2->bOK = TRUE;               /* as l2 always becomes empty */
00968     if (l2->pitNext==l2) {
00969         /* no elements need moving */
00970     } else if (l2->pitNext==l2) {
00971         SwitchLists(l1,l2);
00972         return;
00973     } else {
00974         l2->pitNext->pitPrev = l1->pitPrev;
00975         l1->pitPrev->pitNext = l2->pitNext;
00976         l1->pitPrev = l2->pitPrev;
00977         l1->pitPrev->pitNext = l1;
00978         l2->pitNext = l2;
00979         l2->pitPrev = l2;
00980     }
00981 }
00982
00983 /*-----------------------------------------------------------------------
00984 | Let L1 be *pl1 and L2 be *pl2
00985 | L1 := L1[...Curs] || L2 || L1[Curs+1...]; L2 := empty
00986 | Curs=NULL means insert L2 at the start of L1
00987 | The elements themselves are not moved, so pointers to them remain valid.
00988 |
00989 | L1 gets the elements of L1 from the start up to and including the element
00990 | that Curs points at, in their original order,
00991 | followed by all the elements that were in L2, in their original order,
00992 | followed by the rest of L1
00993  ------------------------------------------------------------------------*/
00994 void
00995 APIENTRY
00996 List_InsertListAfter(
00997                      LIST l1,
00998                      LIST l2,
00999                      LPVOID Curs
01000                      )
01001 {
01002     LIST pitA;     /* The element after Curs, could be anchor */
01003     LIST pit;      /* The start of the element that Curs points at
01004                    |  or the anchor block if Curs==NULL
01005                    */
01006
01007     if ( (l1==NULL) || (l2==NULL)) {
01008         TRACE_ERROR("Bug: List_InsertListAfter with bogus list.  Continuing...", FALSE);
01009         return;
01010     }
01011     l1->bOK = l1->bOK && l2->bOK;
01012     l2->bOK = TRUE;
01013     if (l2->pitNext==l2) {
01014         /* no elements need moving */
01015     } else if ( l1->pitNext==l1) {
01016         /* the easy way to code this would be simply to switch the two
01017         |  pointers l1 and l2, but they are value parameters and we don't
01018         |  want to change that.
01019         */
01020         SwitchLists(l1,l2);
01021         return;
01022     } else {
01023         if (Curs==NULL) {
01024             pit = l1;
01025         } else {
01026             MOVEBACK(Curs)
01027             pit = (LIST)Curs;
01028         }
01029         /* pit points to a block to insert after, could be anchor */
01030         pitA = pit->pitNext;           /* Cannot be same as P, already checked */
01031         l2->pitNext->pitPrev = pit;    /*  P<-- elems-of-l2    A */
01032         l2->pitPrev->pitNext = pitA;   /*  P<-- elems-of-l2 -->A */
01033         pit->pitNext = l2->pitNext;    /*  P<-->elems-of-l2 -->A */
01034         pitA->pitPrev = l2->pitPrev;   /*  P<-->elems-of-l2<-->A */
01035
01036         l2->pitNext = l2;
01037         l2->pitPrev = l2;
01038     }
01039 }
01040
01041
01042 /*-----------------------------------------------------------------------
01043 | l1 := l1[...Curs-1] || l2 || l1[Curs...]; l2 := empty
01044 | Curs=NULL means insert l2 at the end of l1
01045 | The elements themselves are not moved, so pointers to them remain valid.
01046 |
01047 | l1 gets the elements of l1 from the start up to but not including the
01048 | element that Curs points at, in their original order,
01049 | followed by all the elements that were in l2, in their original order,
01050 | followed by the rest of l1.
01051  ------------------------------------------------------------------------*/
01052 void
01053 APIENTRY
01054 List_InsertListBefore(
01055                       LIST l1,
01056                       LIST l2,
01057                       LPVOID Curs
01058                       )
01059 {
01060     LIST pitB;     /* The element before Curs, could be anchor */
01061     LIST pit;      /* The start of the element that Curs points at
01062                     |  or the anchor block if Curs==NULL
01063                     */
01064
01065     if ((l1==NULL) || (l2==NULL)) {
01066         TRACE_ERROR("Bug: List_InsertListBefore with bogus list.  Continuing...", FALSE);
01067         return;
01068     }
01069     l1->bOK = l1->bOK && l2->bOK;
01070     l2 ->bOK = TRUE;
01071     if (l1->pitNext==l1) {
01072         /* the easy way to code this would be simply to switch the two
01073         |  pointers l1 and l2, but they are value parameters and we don't
01074         |  want to change that.
01075         */
01076         SwitchLists(l1,l2);
01077         return;
01078     } else {
01079         if (Curs==NULL) {
01080             pit = l1;
01081         } else {
01082             MOVEBACK(Curs)
01083             pit = (LIST)Curs;
01084         }
01085
01086         /* P points to a block to insert before, could be anchor */
01087         pitB = pit->pitPrev;       /* Cannot be same as P, already checked */
01088         l2->pitNext->pitPrev = pitB; /*  B<-- elems-of-L2    P */
01089         l2->pitPrev->pitNext = pit;  /*  B<-- elems-of-L2 -->P */
01090         pitB->pitNext = l2->pitNext; /*  B<-->elems-of-L2 -->P */
01091         pit->pitPrev = l2->pitPrev;  /*  B<-->elems-of-L2<-->P */
01092         l2->pitNext = l2;
01093         l2->pitPrev = l2;
01094     }
01095 }
01096
01097
01098 /*-----------------------------------------------------------------------
01099 | Let l1 be l1 and l2 be l2
01100 | Split l2 off from the front of l1:    final l2,l1 = original l1
01101 |
01102 | Split l1 into l2: objects of l1 up to and including Curs object
01103 |               l1: objects of l1 after Curs
01104 | Any original contents of l2 are freed.
01105 | List_Spilt(l1, l2, NULL) splits l1 before the first object so l1 gets all.
01106 | The elements themselves are not moved.
01107  ------------------------------------------------------------------------*/
01108 void
01109 APIENTRY
01110 List_SplitAfter(
01111                 LIST l1,
01112                 LIST l2,
01113                 LPVOID Curs
01114                 )
01115 {
01116     LIST pit;
01117
01118     if ((l1==NULL) || (l2==NULL)) {
01119         TRACE_ERROR("Bug: List_SplitAfter bogus list.  Continuing...", FALSE);
01120         return;
01121     }
01122     if (l2->pitNext!=l2) {
01123         List_Clear(l2);
01124     };
01125     if (Curs!=NULL) {
01126         MOVEBACK(Curs)
01127         pit = (LIST)Curs;
01128         /* Curs had better be an item in l1! l2 had better be created! */
01129         if (pit==l1) {
01130             l1->bOK = FALSE;
01131             l2->bOK = FALSE;
01132             return;
01133         }
01134         if (pit->pitNext==l1) {
01135             /* transfer whole of l2 to l1 */
01136             SwitchLists(l2,l1);
01137             return;
01138         }
01139         l2->pitPrev = pit;
01140         l2->pitNext = l1->pitNext;
01141         l1->pitNext = pit->pitNext;
01142         pit->pitNext = l2;
01143         l2->pitNext->pitPrev = l2;
01144         l1->pitNext->pitPrev = l1;
01145     }
01146 }
01147
01148 /*----------------------------------------------------------------------
01149 | Split l2 off from the back of l1:  final l1,l2 = original l1
01150 |
01151 | Split l1 into l1: objects of l1 up to but not including Curs object
01152 |               l2: objects of l1 from Curs onwards
01153 | Any original contants of l2 are freed.
01154 | List_Spilt(l1, l2, NULL) splits l1 after the last object so l1 gets all.
01155 | The elements themselves are not moved.
01156  -----------------------------------------------------------------------*/
01157 void
01158 APIENTRY
01159 List_SplitBefore(
01160                  LIST l1,
01161                  LIST l2,
01162                  LPVOID Curs
01163                  )
01164 {
01165     LIST pit;
01166
01167     if ((l1==NULL) || (l2==NULL)) {
01168         TRACE_ERROR("Bug: List_SplitBefore bogus list.  Continuing...", FALSE);
01169         return;
01170     }
01171     if (l2->pitNext!=l2) {
01172         List_Clear(l2);
01173     }
01174     if (Curs!=NULL) {
01175         MOVEBACK(Curs)
01176         pit = (LIST)Curs;
01177         /* Curs had better be an item in L1! L2 had better be created! */
01178         if (pit==l1) {
01179             l1->bOK = FALSE;
01180             l2->bOK = FALSE;
01181             return;
01182         }
01183         if (pit->pitPrev==l1) {
01184             SwitchLists(l2,l1);
01185             return;
01186         }
01187         l2->pitNext = pit;
01188         l2->pitPrev = l1->pitPrev;
01189         l1->pitPrev = pit->pitPrev;
01190         pit->pitPrev = l2;
01191         l2->pitPrev->pitNext = l2;
01192         l1->pitPrev->pitNext = l1;
01193     }
01194 }
01195
01196 /*------------------------------------------------------------------
01197 | Return the number of items in L
01198  -------------------------------------------------------------------*/
01199 int
01200 APIENTRY
01201 List_Card(
01202           LIST lst
01203           )
01204 {
01205     LIST pit;     /* item cursor on lst */
01206     int cit;
01207
01208     if (lst==NULL) {
01209         TRACE_ERROR("Bug: List_Card of bogus list.  Continuing...", FALSE);
01210         return 0;    /* well it is sort of 0 */
01211     }
01212     pit = lst->pitNext;
01213     cit = 0;
01214     while (pit!=lst) {
01215         cit++;
01216         pit = pit->pitNext;
01217     }
01218     return cit;
01219 }
01220
01221 /*------------------------------------------------------------------
01222 | Check return code
01223  -------------------------------------------------------------------*/
01224 BOOL
01225 APIENTRY
01226 List_IsOK(
01227           LIST lst
01228           )
01229 {
01230     if (lst==NULL) {
01231         TRACE_ERROR("Bug: List_IsOK of bogus list.  Continuing...", FALSE);
01232         return FALSE;       /* well it is sick ain't it! */
01233     }
01234     return lst->bOK;
01235 }
01236
01237 /*------------------------------------------------------------------
01238 | Set return code to good
01239  -------------------------------------------------------------------*/
01240 void
01241 APIENTRY
01242 List_MakeOK(
01243             LIST lst
01244             )
01245 {
01246     if (lst==NULL) {
01247         TRACE_ERROR("Bug: List_MakeOK of bogus list.  Continuing...", FALSE);
01248         return;
01249     }
01250     lst->bOK = TRUE;
01251 }
01252
01253 BOOL
01254 APIENTRY
01255 List_Check(
01256            LIST lst
01257            )
01258 {
01259     LIST pel;
01260     BOOL bOK;
01261     /*-----------------------------------------------------------------
01262     | Check the anchor block has the Anchor flag set.
01263     | Run through the LIST using the Anchor flag (which should be FALSE)
01264     | to mark where we have been (to test for loops in the chain)
01265     | and carry on until we see the Anchor flag again.  Check that this
01266     | is the anchor block that we started from.  Now do another pass
01267     | turning the Anchor flags off again and checking the Prev pointers.
01268      -------------------------------------------------------------------*/
01269     if (lst==NULL)
01270         return FALSE;
01271     bOK = lst->bAnchor;
01272     pel = lst->pitNext;
01273     while (! pel->bAnchor) {
01274         pel->bAnchor = TRUE;
01275         pel = pel->pitNext;
01276     }
01277     bOK = bOK && (pel==lst);
01278     if (bOK) {
01279         /* Turn all the bAnchor flags off */
01280         pel = lst;
01281         do {pel->bAnchor = FALSE;
01282             bOK = bOK & (pel->pitNext->pitPrev==pel);
01283             pel = pel->pitNext;
01284         } while (pel!=lst);
01285         lst->bAnchor = TRUE;  /* except the real one */
01286     } else { /* just turn off those that we set on */
01287         pel = lst->pitNext;
01288         while (pel->bAnchor) {
01289             pel->bAnchor = FALSE;
01290             pel = pel->pitNext;
01291         }
01292         lst->bAnchor = TRUE;
01293     }
01294     return bOK;
01295 }
01296
01297
01298 void
01299 APIENTRY
01300 List_Recover(
01301              PLIST plst
01302              )
01303 {
01304     LIST Last, P,Q;
01305     BOOL OK;
01306     /* For no particular reason we presume that the forward chain
01307        is good and reconstruct the back chain from it.  A better
01308        algorithm would do the kind of things that List_Check does
01309        to figure out where the problems lie.  This just steps along
01310        until it sees either an address that it has already seen or
01311        else the anchor block.  (It's an n-squared algorithm).
01312        It links the last good block found back to the anchor and
01313        fixes all the Anchor flags.
01314     */
01315     if (plst==NULL)
01316         return;
01317     if (*plst==NULL) {
01318         *plst = List_Create();
01319         return;
01320     }
01321     (*plst)->bAnchor = TRUE;
01322     P = (*plst)->pitNext;
01323     Last = *plst;
01324     for (; ; ) {if (P==*plst) break;
01325         Last = P;
01326         if (P->pitNext!=*plst) {OK = TRUE;
01327             Q = *plst;
01328             for (; ; ) {
01329                 OK &= (P->pitNext!=Q);
01330                 if (Q==P) break;
01331                 Q = Q->pitNext;
01332             }
01333             if (!OK) break;
01334         }
01335         P = P->pitNext;
01336     }
01337     P = *plst;
01338     while (P!=Last) {P->pitNext->pitPrev = P;
01339         P->bAnchor = FALSE;
01340         P = P->pitNext;
01341     }
01342     Last->pitNext = *plst;
01343     (*plst)->pitPrev = Last;
01344     (*plst)->bAnchor = TRUE;
01345     (*plst)->bOK = TRUE;
01346 }
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::StreamWriteEnum Member List

This is the complete list of members for msado15::StreamWriteEnum, including all inherited members.
adWriteChar | msado15::StreamWriteEnum | [static]
adWriteLine | msado15::StreamWriteEnum | [static]
stWriteChar | msado15::StreamWriteEnum | [static]
stWriteLine | msado15::StreamWriteEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/common/rcusync.cpp Source File

  • NetDS
  • RRas
  • rqs
  • common

rcusync.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RcuSync.cpp
00004 //
00005 //      Synopsis:   Sychronization objects.
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011 #include "rasutil.h"
00012
00013 //+----------------------------------------------------------------------------
00014 //
00015 // Synopsis: Critical Section constructor
00016 //
00017 //-----------------------------------------------------------------------------
00018 RcuCritSec::RcuCritSec() : m_fInitialized(FALSE)
00019 {
00020 }
00021
00022 //+----------------------------------------------------------------------------
00023 //
00024 // Synopsis: Critical Section destructor
00025 //
00026 //-----------------------------------------------------------------------------
00027 RcuCritSec::~RcuCritSec()
00028 {
00029     if (m_fInitialized)
00030     {
00031         DeleteCriticalSection(&m_CritSec);
00032     }
00033 }
00034
00035 //+----------------------------------------------------------------------------
00036 //
00037 // Synopsis: Initializes a critical section
00038 //
00039 //-----------------------------------------------------------------------------
00040 HRESULT
00041 RcuCritSec::Initialize()
00042 {
00043     HRESULT hr = S_OK;
00044
00045     m_fInitialized = TRUE;
00046
00047     // Critical section initialization must take place within an SEH __try
00048     // block since it can throw the STATUS_NO_MEMORY exception.
00049     //
00050     __try
00051     {
00052         InitializeCriticalSection(&m_CritSec);
00053     }
00054     __except (EXCEPTION_EXECUTE_HANDLER)
00055     {
00056         hr = HRESULT_FROM_WIN32(GetExceptionCode());
00057         m_fInitialized = FALSE;
00058     }
00059
00060     return hr;
00061 }
00062
00063 //+----------------------------------------------------------------------------
00064 //
00065 // Synopsis: Enter a critical section.
00066 //
00067 //-----------------------------------------------------------------------------
00068 HRESULT
00069 RcuCritSec::Enter()
00070 {
00071     if (! m_fInitialized)
00072     {
00073         return E_FAIL;
00074     }
00075
00076     EnterCriticalSection(&m_CritSec);
00077     return S_OK;
00078 }
00079
00080 //+----------------------------------------------------------------------------
00081 //
00082 // Synopsis: Leave a critical section.
00083 //
00084 //-----------------------------------------------------------------------------
00085 VOID
00086 RcuCritSec::Leave()
00087 {
00088     LeaveCriticalSection(&m_CritSec);
00089 }
00090
00091
00092 //+----------------------------------------------------------------------------
00093 //
00094 // Synopsis: Create an event.
00095 //
00096 //-----------------------------------------------------------------------------
00097 RcuEvent::RcuEvent() : m_hEvent(NULL)
00098 {
00099 }
00100
00101 //+----------------------------------------------------------------------------
00102 //
00103 // Synopsis: Destroy an event.
00104 //
00105 //-----------------------------------------------------------------------------
00106 RcuEvent::~RcuEvent()
00107 {
00108     if (m_hEvent)
00109     {
00110         CloseHandle(m_hEvent);
00111     }
00112 }
00113
00114 //+----------------------------------------------------------------------------
00115 //
00116 // Synopsis: Initialize an event.
00117 //
00118 //-----------------------------------------------------------------------------
00119 HRESULT
00120 RcuEvent::Initialize(
00121     IN RcuEventState esInitialState,
00122     IN BOOL fManualReset,
00123     IN BOOL fInherit,
00124     IN RcuSecurityDescriptor* pSD)
00125 {
00126     SECURITY_ATTRIBUTES saEvent, *pSa = NULL;
00127
00128     if ((TRUE == fInherit) || (pSD))
00129     {
00130         ZeroMemory(&saEvent, sizeof(saEvent));
00131         pSa = &saEvent;
00132         saEvent.bInheritHandle = fInherit;
00133
00134         if (pSD)
00135         {
00136             // TODO: Add code to deal with security descriptor
00137         }
00138     }
00139
00140     m_hEvent = CreateEvent(
00141                     pSa,
00142                     fManualReset,
00143                     (SIGNALED == esInitialState),
00144                     NULL);
00145     if (m_hEvent == NULL)
00146     {
00147         return HRESULT_FROM_WIN32(GetLastError());
00148     }
00149
00150     return S_OK;
00151 }
00152
00153 //+----------------------------------------------------------------------------
00154 //
00155 // Synopsis: Set the state of an event to SIGNALED.
00156 //
00157 //-----------------------------------------------------------------------------
00158 HRESULT
00159 RcuEvent::Set()
00160 {
00161     if (! SetEvent(m_hEvent))
00162     {
00163         return HRESULT_FROM_WIN32(GetLastError());
00164     }
00165
00166     return S_OK;
00167 }
00168
00169 //+----------------------------------------------------------------------------
00170 //
00171 // Synopsis: Sets the state of an event to NONSIGNALED
00172 //
00173 //-----------------------------------------------------------------------------
00174 HRESULT
00175 RcuEvent::Reset()
00176 {
00177     if (! ResetEvent(m_hEvent))
00178     {
00179         return HRESULT_FROM_WIN32(GetLastError());
00180     }
00181
00182     return S_OK;
00183 }
00184
00185 //+----------------------------------------------------------------------------
00186 //
00187 // Synopsis: Pulse an event
00188 //
00189 //-----------------------------------------------------------------------------
00190 HRESULT
00191 RcuEvent::Pulse()
00192 {
00193     if (! PulseEvent(m_hEvent))
00194     {
00195         return HRESULT_FROM_WIN32(GetLastError());
00196     }
00197
00198     return S_OK;
00199 }
00200
00201 //+----------------------------------------------------------------------------
00202 //
00203 // Synopsis: Create an RW lock.
00204 //
00205 //      args:
00206 //        m_pcsLock:     used to protect the counter
00207 //        m_peNoReaders: an event that is signaled when there are no readers
00208 //        m_lCounter:    0= not active,
00209 //                       positive= # of readers,
00210 //                       negative= # times the same writer aquired this lock
00211 //
00212 //-----------------------------------------------------------------------------
00213 RcuRwLock::RcuRwLock() : m_pcsLock(NULL), m_peNoReaders(NULL), m_lCounter(0)
00214 {
00215 }
00216
00217 //+----------------------------------------------------------------------------
00218 //
00219 // Synopsis: Cleanup an RW Lock
00220 //
00221 //-----------------------------------------------------------------------------
00222 RcuRwLock::~RcuRwLock()
00223 {
00224     if (m_pcsLock)
00225     {
00226         delete m_pcsLock;
00227     }
00228     if (m_peNoReaders)
00229     {
00230         delete m_peNoReaders;
00231     }
00232 }
00233
00234 //+----------------------------------------------------------------------------
00235 //
00236 // Synopsis: Initialize an RW lock.
00237 //
00238 //-----------------------------------------------------------------------------
00239 HRESULT
00240 RcuRwLock::Initialize()
00241 {
00242     HRESULT hr = S_OK;
00243
00244     m_pcsLock = new RcuCritSec;
00245     m_peNoReaders = new RcuEvent;
00246     if ((NULL == m_pcsLock) || (NULL == m_peNoReaders))
00247     {
00248         return E_OUTOFMEMORY;
00249     }
00250
00251     hr = m_pcsLock->Initialize();
00252     if (FAILED(hr))
00253     {
00254         return hr;
00255     }
00256
00257     hr = m_peNoReaders->Initialize(SIGNALED, TRUE);
00258     if (FAILED(hr))
00259     {
00260         return hr;
00261     }
00262
00263     return hr;
00264 }
00265
00266 //+----------------------------------------------------------------------------
00267 //
00268 // Synopsis: Aquires a RW lock.
00269 //
00270 //-----------------------------------------------------------------------------
00271 HRESULT
00272 RcuRwLock::Lock(
00273         IN RcuRwLockRole Role)
00274 {
00275     HRESULT hr = S_OK;
00276
00277     // Both readers and writers enter the critical section to
00278     // update the event and counter
00279     //
00280     hr = m_pcsLock->Enter();
00281     if (FAILED(hr))
00282     {
00283         return hr;
00284     }
00285
00286     if (READER == Role)
00287     {
00288         // Because we made it into the critical section, we know that there
00289         // are no writers currently active.  There can't be any writers
00290         // waiting on the event yet, either.
00291         //
00292
00293         // Update the counter and record that readers are active
00294         // if we're the first reader to enter.
00295         //
00296         if (InterlockedIncrement(&m_lCounter) == 1)
00297         {
00298             hr = m_peNoReaders->SetState(NONSIGNALED);
00299         }
00300
00301         // Allow other readers to enter...
00302         //
00303         m_pcsLock->Leave();
00304     }
00305     else
00306     {
00307         // Because we made it into the critical section, we know that we
00308         // are the only writer.  There may, however, be several readers
00309         // that are still busy.
00310         //
00311
00312         // Update the counter, waiting for any readers to
00313         // finish
00314         //
00315         if (InterlockedDecrement(&m_lCounter) >= 0)
00316         {
00317             WaitForSingleObject(m_peNoReaders->GetHandle(), INFINITE);
00318         }
00319
00320         // The writer doesn't leave the critical section until the caller
00321         // requests to leave the RW lock itself.  This causes all subsequent
00322         // readers and writers to stay queued up on the critical section
00323         // until this writer finishes its work.
00324         //
00325     }
00326
00327     return hr;
00328 }
00329
00330 //+----------------------------------------------------------------------------
00331 //
00332 // Synopsis: Releases an RW lock.
00333 //
00334 //-----------------------------------------------------------------------------
00335 HRESULT
00336 RcuRwLock::Unlock(
00337         IN RcuRwLockRole Role)
00338 {
00339     HRESULT hr = S_OK;
00340
00341     if (READER == Role)
00342     {
00343         // Update the counter.  If we're the last reader to leave, then update
00344         // the event accordingly.
00345         //
00346         if (InterlockedDecrement(&m_lCounter) <= 0)
00347         {
00348             hr = m_peNoReaders->SetState(SIGNALED);
00349         }
00350     }
00351     else
00352     {
00353         // Update the counter and leave the critical section
00354         //
00355         if (InterlockedIncrement(&m_lCounter) == 0)
00356         {
00357             m_pcsLock->Leave();
00358         }
00359     }
00360
00361     return hr;
00362 }
00363
00364
00365
00366
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAgentCtlCharacterEx Member List

This is the complete list of members for CAgentCtlCharacterEx, including all inherited members.
Activate(const VARIANT &State) | CAgentCtlCharacterEx |
CAgentCtlCharacterEx() | CAgentCtlCharacterEx | [inline]
CAgentCtlCharacterEx(LPDISPATCH pDispatch) | CAgentCtlCharacterEx | [inline]
CAgentCtlCharacterEx(const CAgentCtlCharacterEx &dispatchSrc) | CAgentCtlCharacterEx | [inline]
GestureAt(short x, short y) | CAgentCtlCharacterEx |
Get(LPCTSTR Type, LPCTSTR Name, const VARIANT &Queue) | CAgentCtlCharacterEx |
GetActive() | CAgentCtlCharacterEx |
GetAnimationNames() | CAgentCtlCharacterEx |
GetAutoPopupMenu() | CAgentCtlCharacterEx |
GetBalloon() | CAgentCtlCharacterEx |
GetCommands() | CAgentCtlCharacterEx |
GetDescription() | CAgentCtlCharacterEx |
GetExtraData() | CAgentCtlCharacterEx |
GetGuid() | CAgentCtlCharacterEx |
GetHasOtherClients() | CAgentCtlCharacterEx |
GetHeight() | CAgentCtlCharacterEx |
GetHelpContextID() | CAgentCtlCharacterEx |
GetHelpFile() | CAgentCtlCharacterEx |
GetHelpModeOn() | CAgentCtlCharacterEx |
GetIdleOn() | CAgentCtlCharacterEx |
GetLanguageID() | CAgentCtlCharacterEx |
GetLeft() | CAgentCtlCharacterEx |
GetMoveCause() | CAgentCtlCharacterEx |
GetName() | CAgentCtlCharacterEx |
GetOriginalHeight() | CAgentCtlCharacterEx |
GetOriginalWidth() | CAgentCtlCharacterEx |
GetPitch() | CAgentCtlCharacterEx |
GetSoundEffectsOn() | CAgentCtlCharacterEx |
GetSpeed() | CAgentCtlCharacterEx |
GetSRModeID() | CAgentCtlCharacterEx |
GetSRStatus() | CAgentCtlCharacterEx |
GetTop() | CAgentCtlCharacterEx |
GetTTSModeID() | CAgentCtlCharacterEx |
GetVersion() | CAgentCtlCharacterEx |
GetVisibilityCause() | CAgentCtlCharacterEx |
GetVisible() | CAgentCtlCharacterEx |
GetWidth() | CAgentCtlCharacterEx |
Hide(const VARIANT &Fast) | CAgentCtlCharacterEx |
Interrupt(LPDISPATCH InterruptRequest) | CAgentCtlCharacterEx |
Listen(BOOL Listen) | CAgentCtlCharacterEx |
MoveTo(short x, short y, const VARIANT &Speed) | CAgentCtlCharacterEx |
Play(LPCTSTR Animation) | CAgentCtlCharacterEx |
SetAutoPopupMenu(BOOL bNewValue) | CAgentCtlCharacterEx |
SetDescription(LPCTSTR lpszNewValue) | CAgentCtlCharacterEx |
SetHeight(short nNewValue) | CAgentCtlCharacterEx |
SetHelpContextID(long nNewValue) | CAgentCtlCharacterEx |
SetHelpFile(LPCTSTR lpszNewValue) | CAgentCtlCharacterEx |
SetHelpModeOn(BOOL bNewValue) | CAgentCtlCharacterEx |
SetIdleOn(BOOL bNewValue) | CAgentCtlCharacterEx |
SetLanguageID(long nNewValue) | CAgentCtlCharacterEx |
SetLeft(short nNewValue) | CAgentCtlCharacterEx |
SetName(LPCTSTR lpszNewValue) | CAgentCtlCharacterEx |
SetSoundEffectsOn(BOOL bNewValue) | CAgentCtlCharacterEx |
SetSRModeID(LPCTSTR lpszNewValue) | CAgentCtlCharacterEx |
SetTop(short nNewValue) | CAgentCtlCharacterEx |
SetTTSModeID(LPCTSTR lpszNewValue) | CAgentCtlCharacterEx |
SetWidth(short nNewValue) | CAgentCtlCharacterEx |
Show(const VARIANT &Fast) | CAgentCtlCharacterEx |
ShowPopupMenu(short x, short y) | CAgentCtlCharacterEx |
Speak(const VARIANT &Text, const VARIANT &Url) | CAgentCtlCharacterEx |
Stop(const VARIANT &Request) | CAgentCtlCharacterEx |
StopAll(const VARIANT &Types) | CAgentCtlCharacterEx |
Think(LPCTSTR Text) | CAgentCtlCharacterEx |
Wait(LPDISPATCH WaitForRequest) | CAgentCtlCharacterEx |
Generated on Wed Nov 13 2024 16:55:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/clUtil.h Source File

  • Web
  • NetMeeting
  • NMChat

clUtil.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       CLUTIL.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef _CL_UTIL_H_
00016 #define _CL_UTIL_H_
00017
00018
00019 //****************************************************************************
00020 //
00021 // CLASS RefCount
00022 //
00023 //****************************************************************************
00024
00025 class RefCount
00026 {
00027 private:
00028    LONG m_cRef;
00029
00030 public:
00031    RefCount();
00032    // Virtual destructor defers to destructor of derived class.
00033    virtual ~RefCount();
00034
00035    // IUnknown methods
00036
00037    ULONG STDMETHODCALLTYPE AddRef(void);
00038    ULONG STDMETHODCALLTYPE Release(void);
00039 };
00040
00041
00042 //****************************************************************************
00043 //
00044 // CLASS CNotify
00045 //
00046 // Notification sink
00047 //
00048 //****************************************************************************
00049
00050 class CNotify
00051 {
00052 private:
00053     DWORD  m_dwCookie;
00054   IUnknown * m_pUnk;
00055     IConnectionPoint           * m_pcnp;
00056     IConnectionPointContainer  * m_pcnpcnt;
00057 public:
00058     CNotify(void);
00059     ~CNotify();
00060
00061     HRESULT Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN);
00062     HRESULT Disconnect(void);
00063
00064     IUnknown * GetPunk() {return m_pUnk;}
00065 };
00066
00067
00068 //****************************************************************************
00069 //
00070 // CLASS COBLIST
00071 //
00072 //****************************************************************************
00073
00074 #define POSITION COBNODE*
00075
00076 struct COBNODE
00077 {
00078   POSITION  pNext;
00079   void*   pItem;
00080 };
00081
00082 class COBLIST
00083 {
00084 protected:
00085   POSITION m_pHead;
00086   POSITION m_pTail;
00087   int      m_cItem;
00088     virtual BOOL Compare(void* pItemToCompare, void* pComparator)
00089                        { return(pItemToCompare == pComparator); }
00090 public:
00091   COBLIST() : m_pHead(NULL), m_pTail(NULL), m_cItem(0) { }
00092     virtual         ~COBLIST();
00093
00094   virtual void *  RemoveAt(POSITION rPos);
00095     void            EmptyList();
00096   POSITION      AddTail(void* pItem);
00097   void *        GetNext(POSITION& rPos);
00098     void *          SafeGetFromPosition(POSITION rPos);
00099     POSITION        GetPosition(void* pItem);
00100     POSITION        Lookup(void* pComparator);
00101   POSITION      GetHeadPosition()  { return (m_pHead); }
00102   POSITION      GetTailPosition()  { return (m_pTail); }
00103   BOOL        IsEmpty()          { return (!m_pHead); }
00104   int             GetItemCount()     { return (m_cItem); }
00105 #ifdef DEBUG
00106   void *        GetHead();
00107   void *        GetTail();
00108   void *        RemoveHead();
00109   void *          RemoveTail();
00110   void *        GetFromPosition(POSITION rPos);
00111 #else
00112   void *        GetHead()          { return GetFromPosition(GetHeadPosition());}
00113   void *          GetTail()          { return m_pTail->pItem;}
00114   void *        RemoveHead()       { return RemoveAt(m_pHead); }
00115   void *          RemoveTail()       { return RemoveAt(m_pTail); }
00116   void *        GetFromPosition(POSITION rPos){return(rPos->pItem);}
00117 #endif
00118 };
00119
00120
00121 //****************************************************************************
00122 //
00123 // Utility Functions
00124 //
00125 //****************************************************************************
00126
00127 POSITION AddNode(PVOID pv, COBLIST ** ppList);
00128 PVOID RemoveNode(POSITION * pPos, COBLIST *pList);
00129
00130
00131 //****************************************************************************
00132 //
00133 // CLASS BSTRING
00134 //
00135 //****************************************************************************
00136
00137 class BSTRING
00138 {
00139 private:
00140   BSTR   m_bstr;
00141
00142 public:
00143   // Constructors
00144   BSTRING() {m_bstr = NULL;}
00145
00146   inline BSTRING(LPCWSTR lpcwString);
00147
00148 #if !defined(UNICODE)
00149   // We don't support construction from an ANSI string in the Unicode build.
00150   BSTRING(LPCSTR lpcString);
00151 #endif // !defined(UNICODE)
00152
00153   // Destructor
00154   inline ~BSTRING();
00155
00156   // Cast to BSTR
00157   operator BSTR() {return m_bstr;}
00158   inline LPBSTR GetLPBSTR(void);
00159 };
00160
00161
00162 BSTRING::BSTRING(LPCWSTR lpcwString)
00163 {
00164   if (NULL != lpcwString)
00165   {
00166     m_bstr = SysAllocString(lpcwString);
00167     ASSERT(NULL != m_bstr);
00168   }
00169   else
00170   {
00171     m_bstr = NULL;
00172   }
00173 }
00174
00175 BSTRING::~BSTRING()
00176 {
00177   if (NULL != m_bstr)
00178   {
00179     SysFreeString(m_bstr);
00180   }
00181 }
00182
00183 inline LPBSTR BSTRING::GetLPBSTR(void)
00184 {
00185   ASSERT(NULL == m_bstr);
00186
00187 // DO I NEED A CHECK HERE AS WELL?
00188
00189   return &m_bstr;
00190 }
00191
00192
00193 //****************************************************************************
00194 //
00195 // CLASS BTSTR
00196 //
00197 //****************************************************************************
00198
00199 class BTSTR
00200 {
00201 private:
00202   LPTSTR m_psz;
00203
00204 public:
00205   BTSTR(BSTR bstr);
00206   ~BTSTR();
00207
00208   // Cast to BSTR
00209   operator LPTSTR() {return (NULL == m_psz) ? TEXT("<null>") : m_psz;}
00210 };
00211
00212 LPTSTR PszFromBstr(BSTR bst);
00213
00214
00215 #endif  // _CL_UTIL_H_
00216
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDlgDest Member List

This is the complete list of members for CDlgDest, including all inherited members.
CDlgDest(CWnd *pParent=NULL) | CDlgDest |
Create(void) | CDlgDest |
DoDataExchange(CDataExchange *pDX) | CDlgDest | [protected, virtual]
IDD enum value | CDlgDest |
m_butPlay | CDlgDest |
m_butStop | CDlgDest |
m_cAveBitsPerSec | CDlgDest |
m_cbData | CDlgDest |
m_cChannelMask | CDlgDest |
m_cChannels | CDlgDest |
m_comboBitDepth | CDlgDest |
m_comboFormat | CDlgDest |
m_comboSampleRate | CDlgDest |
m_cOutput | CDlgDest |
m_cRemix | CDlgDest |
m_cValidBits | CDlgDest |
m_fDragging | CDlgDest |
m_fPlayable | CDlgDest |
m_lpwhdr | CDlgDest |
m_pbData | CDlgDest |
m_ptPosInCaption | CDlgDest |
m_pwndParent | CDlgDest |
m_strChannelMask | CDlgDest |
m_wfExt | CDlgDest |
m_wValidBitsPerSample | CDlgDest |
OnCancel() | CDlgDest | [virtual]
OnComboBitdepth() | CDlgDest |
OnComboSamplerate() | CDlgDest |
OnComboWaveformat() | CDlgDest |
OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor) | CDlgDest |
OnEditValidbits() | CDlgDest |
OnInitDialog() | CDlgDest | [virtual]
OnLButtonDown(UINT nFlags, CPoint point) | CDlgDest |
OnLButtonUp(UINT nFlags, CPoint point) | CDlgDest |
OnMouseMove(UINT nFlags, CPoint point) | CDlgDest |
OnOK() | CDlgDest | [virtual]
OnPlay() | CDlgDest |
OnRemix() | CDlgDest |
OnStop() | CDlgDest |
RecalcDependantVariables(void) | CDlgDest |
Update(void) | CDlgDest |
WindowProc(UINT, WPARAM, LPARAM) | CDlgDest | [virtual]
~CDlgDest(void) | CDlgDest |
Generated on Wed Nov 13 2024 16:56:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CListener Member List

This is the complete list of members for CListener, including all inherited members.
Advise(CContainerBase *pCCPointBase, REFIID riid, DWORD *pdwCookie) | CListener | [virtual]
Advise(IConnectionPoint *pIConnectionPoint, DWORD *pdwCookie) | CListener | [virtual]
CListener() | CListener |
GetReturnValue() | CListener | [virtual]
m_cRef | CListener | [protected]
m_hrReturn | CListener | [protected]
OnFieldChange(IRowset *pIRowset, HROW hRow, DBORDINAL cColumns, DBORDINAL rgColumns[], DBREASON eReason, DBEVENTPHASE ePhase, BOOL fCantDeny) | CListener |
OnLowResource(DB_DWRESERVE dwReserved) | CListener |
OnProgress(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM ulProgress, DBCOUNTITEM ulProgressMax, DBASYNCHPHASE eAsynchPhase, LPOLESTR pwszStatusText) | CListener |
OnRowChange(IRowset *pIRowset, DBCOUNTITEM cRows, const HROW rghRows[], DBREASON eReason, DBEVENTPHASE ePhase, BOOL fCantDeny) | CListener |
OnRowPositionChange(DBREASON eReason, DBEVENTPHASE ePhase, BOOL fCantDeny) | CListener |
OnRowsetChange(IRowset *pIRowset, DBREASON eReason, DBEVENTPHASE ePhase, BOOL fCantDeny) | CListener |
OnStop(HCHAPTER hChapter, DBASYNCHOP eOperation, HRESULT hrStatus, LPOLESTR pwszStatusText) | CListener |
QueryInterface(REFIID riid, LPVOID *ppv) | CListener |
SetReturnValue(HRESULT hrReturn) | CListener | [virtual]
STDMETHODIMP_(ULONG) AddRef(void) | CListener |
STDMETHODIMP_(ULONG) Release(void) | CListener |
Unadvise(CContainerBase *pCCPointBase, REFIID riid, DWORD *pdwCookie) | CListener | [virtual]
Unadvise(IConnectionPoint *pIConnectionPoint, DWORD *pdwCookie) | CListener | [virtual]
~CListener() | CListener | [virtual]
Generated on Wed Nov 13 2024 16:56:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FaxDlg Member List

This is the complete list of members for FaxDlg, including all inherited members.
DoDataExchange(CDataExchange *pDX) | FaxDlg | [protected, virtual]
FaxDlg(CWnd *pParent=NULL) | FaxDlg |
IDD enum value | FaxDlg |
m_FaxNumber | FaxDlg |
m_RecipientName | FaxDlg |
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tReq Member List

This is the complete list of members for tReq, including all inherited members.
Async | tReq
bAllPullsDone | tReq
bAsyncCallFailureReceived | tReq
bBuf | tReq
bCallCancelled | tReq
bCallComplete | tReq
bCallMade | tReq
bDataAvailable | tReq
bFailureFromPull | tReq
bFailureFromWrite | tReq
bImpersonating | tReq
bPullOutstanding | tReq
bRpcImpersonating | tReq
CurrentExtendedSize | tReq
FileOl | tReq
FileWritePos | tReq
hFileRepClient | tReq
hFileRepServer | tReq
hLocalFile | tReq
hTokenHandle | tReq
LocalFileName | tReq
Lock | tReq
nBytesOutstanding | tReq
nWritesOutstanding | tReq
OutPipe | tReq
pbBuf | tReq
phContext | tReq
Pri | tReq
pSID | tReq
RemoteFileName | tReq
ServerName | tReq
State | tReq
Status | tReq
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/DComPerm/ListAcl.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • DComPerm

ListAcl.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <conio.h>
00021 #include <tchar.h>
00022 #include "ntsecapi.h"
00023 #include "dcomperm.h"
00024
00025
00026 /*---------------------------------------------------------------------------*\
00027  * NAME:
00028  * --------------------------------------------------------------------------*
00029  * DESCRIPTION:
00030 \*---------------------------------------------------------------------------*/
00031 void WarnIfGlobalPolicySet()
00032 {
00033
00034     HKEY  hregPolicy    = NULL;
00035     DWORD dwType        = 0;
00036     DWORD cbData        = 0;
00037     BYTE  bArray[512]   = {0};
00038     DWORD dwReturnValue = ERROR_SUCCESS;
00039
00040     if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00041                     _T("SOFTWARE\\Policies\\Microsoft\\Windows NT\\DCOM"),
00042                     0,
00043                     KEY_READ,
00044                     &hregPolicy) == ERROR_SUCCESS)
00045     {
00046         cbData = sizeof(bArray);
00047
00048         dwReturnValue = RegQueryValueEx(hregPolicy,
00049                                         _T("MachineAccessRestriction"),
00050                                         0,
00051                                         &dwType,
00052                                         bArray,
00053                                         &cbData);
00054
00055         if(dwReturnValue != ERROR_FILE_NOT_FOUND)
00056         {
00057
00058             _tprintf (_T("WARNING: Machine-wide Access ")
00059                       _T("Group Policy may override these settings! \n"));
00060
00061         }
00062
00063         cbData = sizeof(bArray);
00064
00065         dwReturnValue = RegQueryValueEx(hregPolicy, _T("MachineLaunchRestriction"), 0, &dwType, bArray, &cbData);
00066         if(dwReturnValue != ERROR_FILE_NOT_FOUND)
00067         {
00068
00069             _tprintf (_T("WARNING: Machine-wide Launch/Activate ")
00070                       _T("Group Policy may override these settings! \n"));
00071
00072         }
00073
00074         RegCloseKey(hregPolicy);
00075     }
00076 }
00077
00078
00079 /*---------------------------------------------------------------------------*\
00080  * NAME: DisplayAccess                                                       *
00081  * --------------------------------------------------------------------------*
00082  * DESCRIPTION:
00083 \*---------------------------------------------------------------------------*/
00084 void DisplayAccess(
00085     DWORD dwAccessMask,
00086     DWORD dwSDType,
00087     LPCTSTR tszAccessType,
00088     LPCTSTR tszUser,
00089     LPCTSTR tszDomain
00090     )
00091 {
00092
00093     BOOL fLegacy = IsLegacySecurityModel();
00094
00095     if(!fLegacy)
00096     {
00097         WarnIfGlobalPolicySet();
00098     }
00099
00100     if(dwSDType & SDTYPE_ACCESS)
00101     {
00102         BOOL fLocalAccess = (dwAccessMask & COM_RIGHTS_EXECUTE_LOCAL  ) ||
00103                              ((dwAccessMask & COM_RIGHTS_EXECUTE) &&
00104                               !(dwAccessMask & COM_RIGHTS_EXECUTE_REMOTE));
00105
00106         BOOL fRemoteAccess = (dwAccessMask & COM_RIGHTS_EXECUTE_REMOTE  ) ||
00107                              ((dwAccessMask & COM_RIGHTS_EXECUTE) &&
00108                               !(dwAccessMask & COM_RIGHTS_EXECUTE_LOCAL));
00109
00110         if(fLegacy && dwAccessMask & COM_RIGHTS_EXECUTE)
00111         {
00112             _tprintf (_T("Access %s to %s\\%s.\n"),
00113                       tszAccessType,
00114                       tszDomain, tszUser);
00115
00116         }
00117         else if(!fLegacy && (fLocalAccess || fRemoteAccess))
00118         {
00119
00120             _tprintf (_T("%s access %s to %s\\%s.\n"),
00121                       fLocalAccess ?
00122                       fRemoteAccess ?
00123                       _T("Remote and Local") : _T("Local") : _T("Remote") ,
00124                       tszAccessType,
00125                       tszDomain, tszUser);
00126          }
00127     }
00128     else
00129     {
00130
00131         BOOL fLocalLaunchAccess = (dwAccessMask & COM_RIGHTS_EXECUTE_LOCAL  ) ||
00132                              ((dwAccessMask & COM_RIGHTS_EXECUTE) &&
00133                              !(dwAccessMask & (COM_RIGHTS_EXECUTE_REMOTE  |
00134                                                COM_RIGHTS_ACTIVATE_REMOTE |
00135                                                COM_RIGHTS_ACTIVATE_LOCAL)));
00136
00137         BOOL fRemoteLaunchAccess = (dwAccessMask & COM_RIGHTS_EXECUTE_REMOTE  ) ||
00138                              ((dwAccessMask & COM_RIGHTS_EXECUTE) &&
00139                              !(dwAccessMask & (COM_RIGHTS_EXECUTE_LOCAL   |
00140                                                COM_RIGHTS_ACTIVATE_REMOTE |
00141                                                COM_RIGHTS_ACTIVATE_LOCAL)));
00142
00143         BOOL fLocalActivateAccess = (dwAccessMask & COM_RIGHTS_ACTIVATE_LOCAL) ||
00144                              ((dwAccessMask & COM_RIGHTS_EXECUTE) &&
00145                              !(dwAccessMask & (COM_RIGHTS_EXECUTE_LOCAL  |
00146                                                COM_RIGHTS_EXECUTE_REMOTE |
00147                                                COM_RIGHTS_ACTIVATE_REMOTE)));
00148
00149         BOOL fRemoteActivateAccess = (dwAccessMask & COM_RIGHTS_ACTIVATE_REMOTE) ||
00150                              ((dwAccessMask & COM_RIGHTS_EXECUTE) &&
00151                              !(dwAccessMask & (COM_RIGHTS_EXECUTE_LOCAL  |
00152                                                COM_RIGHTS_EXECUTE_REMOTE |
00153                                                COM_RIGHTS_ACTIVATE_LOCAL)));
00154
00155         if(fLegacy && dwAccessMask & COM_RIGHTS_EXECUTE)
00156         {
00157             _tprintf (_T("Launch %s to %s\\%s.\n"),
00158                       tszAccessType,
00159                       tszDomain, tszUser);
00160
00161         }
00162         else
00163         {
00164             if(!fLegacy && (fLocalLaunchAccess || fRemoteLaunchAccess))
00165             {
00166
00167                 _tprintf (_T("%s launch %s to %s\\%s.\n"),
00168                           fLocalLaunchAccess ?
00169                           fRemoteLaunchAccess ?
00170                           _T("Remote and Local") : _T("Local") : _T("Remote") ,
00171                           tszAccessType,
00172                           tszDomain, tszUser);
00173              }
00174              if(!fLegacy && (fLocalActivateAccess || fRemoteActivateAccess))
00175              {
00176
00177                 _tprintf (_T("%s activation %s to %s\\%s.\n"),
00178                           fLocalActivateAccess ?
00179                           fRemoteActivateAccess ?
00180                           _T("Remote and Local") : _T("Local") : _T("Remote"),
00181                           tszAccessType,
00182                           tszDomain, tszUser);
00183              }
00184
00185          }
00186
00187     }
00188
00189 }
00190
00191 /*---------------------------------------------------------------------------*\
00192  * NAME: ListACL                                                             *
00193  * --------------------------------------------------------------------------*
00194  * DESCRIPTION:
00195 \*---------------------------------------------------------------------------*/
00196 void ListACL (
00197     PACL Acl,
00198     DWORD dwSDType
00199     )
00200 {
00201     ACL_SIZE_INFORMATION     aclSizeInfo                      = {0};
00202     ACL_REVISION_INFORMATION aclRevInfo                       = {0};
00203     ULONG                    i;
00204     LPVOID                   pvAce                            = NULL;
00205     ACE_HEADER               *pAceHeader                      = NULL;
00206     ACCESS_ALLOWED_ACE       *pAccessAllowedAce               = NULL;
00207     ACCESS_DENIED_ACE        *pAccessDeniedAce                = NULL;
00208     TCHAR                    tszDomainName [SIZE_NAME_BUFFER] = {0};
00209     TCHAR                    tszUserName [SIZE_NAME_BUFFER]   = {0};
00210     DWORD                    cchName = 0;
00211     SID_NAME_USE             snu;
00212
00213     if (!GetAclInformation (Acl,
00214                             &aclSizeInfo,
00215                             sizeof (ACL_SIZE_INFORMATION),
00216                             AclSizeInformation))
00217     {
00218         _tprintf (_T("Could not get AclSizeInformation"));
00219         return;
00220     }
00221
00222     if (!GetAclInformation (Acl,
00223                             &aclRevInfo,
00224                             sizeof (ACL_REVISION_INFORMATION),
00225                             AclRevisionInformation))
00226     {
00227         _tprintf (_T("Could not get AclRevisionInformation"));
00228         return;
00229     }
00230
00231     for (i = 0; i < aclSizeInfo.AceCount; i++)
00232     {
00233         if (!GetAce (Acl, i, &pvAce))
00234             return;
00235
00236         pAceHeader = (ACE_HEADER *) pvAce;
00237
00238         if (pAceHeader->AceType == ACCESS_ALLOWED_ACE_TYPE)
00239         {
00240             pAccessAllowedAce = (ACCESS_ALLOWED_ACE *) pvAce;
00241             cchName = SIZE_NAME_BUFFER-1;
00242             LookupAccountSid (NULL,
00243                               &pAccessAllowedAce->SidStart,
00244                               tszUserName,
00245                               &cchName,
00246                               tszDomainName,
00247                               &cchName,
00248                               &snu);
00249
00250
00251             DisplayAccess(pAccessAllowedAce->Mask,
00252                           dwSDType,
00253                           _T("permitted"),
00254                           tszUserName,
00255                           tszDomainName);
00256
00257         }
00258         else if (pAceHeader->AceType == ACCESS_DENIED_ACE_TYPE)
00259         {
00260             pAccessDeniedAce = (ACCESS_DENIED_ACE *) pvAce;
00261             cchName = SIZE_NAME_BUFFER-1;
00262             LookupAccountSid (NULL,
00263                               &pAccessDeniedAce->SidStart,
00264                               tszUserName,
00265                               &cchName,
00266                               tszDomainName,
00267                               &cchName,
00268                               &snu);
00269
00270             DisplayAccess(pAccessDeniedAce->Mask,
00271                           dwSDType,
00272                           _T("denied"),
00273                           tszUserName,
00274                           tszDomainName);
00275
00276         }
00277    }
00278 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/serviceconfig/url.c Source File

  • NetDS
  • http
  • serviceconfig

url.c

Go to the documentation of this file.
00001 /*++
00002  Copyright (c) 2002 - 2002 Microsoft Corporation.  All Rights Reserved.
00003
00004  THIS CODE AND INFORMATION IS PROVIDED "AS-IS" WITHOUT WARRANTY OF
00005  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007  PARTICULAR PURPOSE.
00008
00009  THIS CODE IS NOT SUPPORTED BY MICROSOFT.
00010
00011 --*/
00012
00013 #include "precomp.h"
00014 #pragma hdrstop
00015
00016 //
00017 // Private functions.
00018 //
00019
00020 /***************************************************************************++
00021
00022 Routine Description:
00023     Prints a record in the URL ACL store.
00024
00025 Arguments:
00026     pOutput - A pointer to HTTP_SERVICE_CONFIG_URLACL_SET
00027
00028 Return Value:
00029     None.
00030
00031 --***************************************************************************/
00032 void
00033 PrintUrlAclRecord(
00034     IN PUCHAR pOutput
00035     )
00036 {
00037     PHTTP_SERVICE_CONFIG_URLACL_SET pSetParam;
00038
00039     pSetParam = (PHTTP_SERVICE_CONFIG_URLACL_SET) pOutput;
00040
00041     NlsPutMsg(
00042         HTTPCFG_URLACL_URL,
00043         pSetParam->KeyDesc.pUrlPrefix
00044         );
00045
00046     NlsPutMsg(
00047               HTTPCFG_URLACL_ACL,
00048               pSetParam->ParamDesc.pStringSecurityDescriptor
00049               );
00050
00051     NlsPutMsg(
00052             HTTPCFG_RECORD_SEPARATOR
00053             );
00054 }
00055
00056 /***************************************************************************++
00057
00058 Routine Description:
00059     Sets an URL ACL entry.
00060
00061 Arguments:
00062     pUrl - The URL
00063     pAcl - The ACL specified as a SDDL string.
00064
00065 Return Value:
00066     Success/Failure.
00067
00068 --***************************************************************************/
00069 int
00070 DoUrlAclSet(
00071     IN PWSTR pUrl,
00072     IN PWSTR pAcl
00073     )
00074 {
00075     HTTP_SERVICE_CONFIG_URLACL_SET SetParam;
00076     DWORD                          Status;
00077
00078     ZeroMemory(&SetParam, sizeof(SetParam));
00079
00080     SetParam.KeyDesc.pUrlPrefix                  = pUrl;
00081     SetParam.ParamDesc.pStringSecurityDescriptor = pAcl;
00082
00083     Status = HttpSetServiceConfiguration(
00084                 NULL,
00085                 HttpServiceConfigUrlAclInfo,
00086                 &SetParam,
00087                 sizeof(SetParam),
00088                 NULL
00089                 );
00090
00091     NlsPutMsg(HTTPCFG_SETSERVICE_STATUS, Status);
00092
00093     return Status;
00094 }
00095
00096
00097 /***************************************************************************++
00098
00099 Routine Description:
00100     Queries for a URL ACL entry.
00101
00102 Arguments:
00103     pUrl - The URL (if NULL, then enumerate the store).
00104
00105 Return Value:
00106     Success/Failure.
00107
00108 --***************************************************************************/
00109 int DoUrlAclQuery(
00110     IN PWSTR pUrl
00111     )
00112 {
00113     DWORD                             Status;
00114     PUCHAR                            pOutput = NULL;
00115     DWORD                             OutputLength = 0;
00116     DWORD                             ReturnLength = 0;
00117     HTTP_SERVICE_CONFIG_URLACL_QUERY  QueryParam;
00118
00119     ZeroMemory(&QueryParam, sizeof(QueryParam));
00120
00121     if(pUrl)
00122     {
00123         // If a URL is specified, we'll Query for an exact entry.
00124         //
00125         QueryParam.QueryDesc = HttpServiceConfigQueryExact;
00126         QueryParam.KeyDesc.pUrlPrefix = pUrl;
00127     }
00128     else
00129     {
00130         //
00131         // No URL is specified, so enumerate the entire store.
00132         //
00133         QueryParam.QueryDesc = HttpServiceConfigQueryNext;
00134     }
00135
00136     for(;;)
00137     {
00138         //
00139         // First, compute bytes required for querying the first entry.
00140         //
00141         Status = HttpQueryServiceConfiguration(
00142                     NULL,
00143                     HttpServiceConfigUrlAclInfo,
00144                     &QueryParam,
00145                     sizeof(QueryParam),
00146                     pOutput,
00147                     OutputLength,
00148                     &ReturnLength,
00149                     NULL
00150                     );
00151
00152         if(Status == ERROR_INSUFFICIENT_BUFFER)
00153         {
00154             // If the API completes with ERROR_INSUFFICIENT_BUFFER, we'll
00155             // allocate memory for it & continue with the loop where we'll
00156             // call it again.
00157
00158             if(pOutput)
00159             {
00160                 // If there was an existing buffer, free it.
00161                 LocalFree(pOutput);
00162             }
00163
00164             // Allocate a new buffer
00165             pOutput = LocalAlloc(LMEM_FIXED, ReturnLength);
00166             if(!pOutput)
00167             {
00168                 return ERROR_NOT_ENOUGH_MEMORY;
00169             }
00170
00171             OutputLength = ReturnLength;
00172         }
00173         else if(Status == NO_ERROR)
00174         {
00175
00176             // The query succeeded! We'll print the record that we just
00177             // queried.
00178
00179             PrintUrlAclRecord(pOutput);
00180
00181             if(pUrl)
00182             {
00183                 //
00184                 // If we are not enumerating, we are done.
00185                 //
00186                 break;
00187             }
00188             else
00189             {
00190                 //
00191                 // Since we are enumerating, we'll move on to the next
00192                 // record. This is done by incrementing the cursor, till
00193                 // we get ERROR_NO_MORE_ITEMS.
00194                 //
00195                 QueryParam.dwToken ++;
00196             }
00197         }
00198         else if(ERROR_NO_MORE_ITEMS == Status && pUrl == NULL)
00199         {
00200             // We are enumerating and we have reached the end. This is
00201             // indicated by a ERROR_NO_MORE_ITEMS error code.
00202
00203             // This is not a real error, since it is used to indicate that
00204             // we've finished enumeration.
00205
00206             Status = NO_ERROR;
00207             break;
00208         }
00209         else
00210         {
00211             //
00212             // Some other error, so we are done
00213             //
00214             NlsPutMsg(HTTPCFG_QUERYSERVICE_STATUS, Status);
00215             break;
00216         }
00217     }
00218
00219     if(pOutput)
00220     {
00221         LocalFree(pOutput);
00222     }
00223
00224     return Status;
00225 }
00226
00227 /***************************************************************************++
00228
00229 Routine Description:
00230     Deletes an URL ACL entry.
00231
00232 Arguments:
00233     pUrl - The URL
00234
00235 Return Value:
00236     Success/Failure.
00237
00238 --***************************************************************************/
00239 int DoUrlAclDelete(
00240     IN PWSTR pUrl
00241     )
00242 {
00243     HTTP_SERVICE_CONFIG_URLACL_SET SetParam;
00244     DWORD                          Status;
00245
00246     SetParam.KeyDesc.pUrlPrefix = pUrl;
00247     Status = HttpDeleteServiceConfiguration(
00248                 NULL,
00249                 HttpServiceConfigUrlAclInfo,
00250                 &SetParam,
00251                 sizeof(SetParam),
00252                 NULL
00253                 );
00254
00255     NlsPutMsg(HTTPCFG_DELETESERVICE_STATUS, Status);
00256     return Status;
00257 }
00258
00259 //
00260 // Public function.
00261 //
00262
00263 /***************************************************************************++
00264
00265 Routine Description:
00266     The function that parses parameters specific to URL ACL &
00267     calls Set, Query or Delete.
00268
00269 Arguments:
00270     argc - Count of arguments.
00271     argv - Pointer to command line arguments.
00272     Type - Type of operation to be performed.
00273
00274 Return Value:
00275     Success/Failure.
00276
00277 --***************************************************************************/
00278 int
00279 DoUrlAcl(
00280     int          argc,
00281     WCHAR      **argv,
00282     HTTPCFG_TYPE Type
00283     )
00284 {
00285     PWCHAR   pUrl             = NULL;
00286     PWCHAR   pAcl             = NULL;
00287
00288     while(argc>=2 && (argv[0][0] == '-' || argv[0][0]== '/'))
00289     {
00290         switch(toupper(argv[0][1]))
00291         {
00292             case 'U':
00293                 pUrl = argv[1];
00294                 break;
00295
00296             case 'A':
00297                 pAcl = argv[1];
00298                 break;
00299
00300             default:
00301                 NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00302                 return ERROR_INVALID_PARAMETER;
00303         }
00304
00305         argc -=2;
00306         argv +=2;
00307     }
00308
00309     switch(Type)
00310     {
00311         case HttpCfgTypeSet:
00312             return DoUrlAclSet(pUrl, pAcl);
00313
00314         case HttpCfgTypeQuery:
00315             return DoUrlAclQuery(pUrl);
00316
00317         case HttpCfgTypeDelete:
00318             return DoUrlAclDelete(pUrl);
00319
00320         default:
00321             NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00322             return ERROR_INVALID_PARAMETER;
00323     }
00324 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Resource.h Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Resource.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 //{{NO_DEPENDENCIES}}
00006 // Microsoft Developer Studio generated include file.
00007 // Used by Render.rc
00008 //
00009 #define IDS_PROJNAME                    100
00010 #define IDR_FACTORY                     101
00011 #define IDR_BEHAVIOR                    102
00012 #define IDR_EVENTSINK                   103
00013
00014 // Next default values for new objects
00015 //
00016 #ifdef APSTUDIO_INVOKED
00017 #ifndef APSTUDIO_READONLY_SYMBOLS
00018 #define _APS_NEXT_RESOURCE_VALUE        201
00019 #define _APS_NEXT_COMMAND_VALUE         32768
00020 #define _APS_NEXT_CONTROL_VALUE         201
00021 #define _APS_NEXT_SYMED_VALUE           104
00022 #endif
00023 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Recordset.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Recordset.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=00000535-0000-0010-8000-00AA006D2EA4,DynamicCasts)
00019     @com.interface(iid=00000556-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public class Recordset implements IUnknown,com.ms.com.NoAutoScripting,msado15._Recordset
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public native msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1000, type=PROPGET, name="AbsolutePosition", name2="getAbsolutePosition", addFlagsVtable=4)
00027       @com.parameters([type=I4] return) */
00028   public native int getAbsolutePosition();
00029
00030   /** @com.method(vtoffset=6, dispid=1000, type=PROPPUT, name="AbsolutePosition", name2="putAbsolutePosition", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] pl) */
00032   public native void setAbsolutePosition(int pl);
00033
00034   /** @com.method(vtoffset=7, dispid=1001, type=PROPPUTREF, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00035       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] pvar) */
00036   public native void setActiveConnection(Object pvar);
00037
00038   /** @com.method(vtoffset=8, dispid=1001, type=PROPPUT, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00039       @com.parameters([in,type=VARIANT] pvar) */
00040   public native void setActiveConnection(Variant pvar);
00041
00042   /** @com.method(vtoffset=9, dispid=1001, type=PROPGET, name="ActiveConnection", name2="getActiveConnection", addFlagsVtable=4)
00043       @com.parameters([type=VARIANT] return) */
00044   public native Variant getActiveConnection();
00045
00046   /** @com.method(vtoffset=10, dispid=1002, type=PROPGET, name="BOF", name2="getBOF", addFlagsVtable=4)
00047       @com.parameters([type=BOOLEAN] return) */
00048   public native boolean getBOF();
00049
00050   /** @com.method(vtoffset=11, dispid=1003, type=PROPGET, name="Bookmark", name2="getBookmark", addFlagsVtable=4)
00051       @com.parameters([type=VARIANT] return) */
00052   public native Variant getBookmark();
00053
00054   /** @com.method(vtoffset=12, dispid=1003, type=PROPPUT, name="Bookmark", name2="putBookmark", addFlagsVtable=4)
00055       @com.parameters([in,type=VARIANT] pvBookmark) */
00056   public native void setBookmark(Variant pvBookmark);
00057
00058   /** @com.method(vtoffset=13, dispid=1004, type=PROPGET, name="CacheSize", name2="getCacheSize", addFlagsVtable=4)
00059       @com.parameters([type=I4] return) */
00060   public native int getCacheSize();
00061
00062   /** @com.method(vtoffset=14, dispid=1004, type=PROPPUT, name="CacheSize", name2="putCacheSize", addFlagsVtable=4)
00063       @com.parameters([in,type=I4] pl) */
00064   public native void setCacheSize(int pl);
00065
00066   /** @com.method(vtoffset=15, dispid=1005, type=PROPGET, name="CursorType", name2="getCursorType", addFlagsVtable=4)
00067       @com.parameters([type=I4] return) */
00068   public native int getCursorType();
00069
00070   /** @com.method(vtoffset=16, dispid=1005, type=PROPPUT, name="CursorType", name2="putCursorType", addFlagsVtable=4)
00071       @com.parameters([in,type=I4] plCursorType) */
00072   public native void setCursorType(int plCursorType);
00073
00074   /** @com.method(vtoffset=17, dispid=1006, type=PROPGET, name="EOF", name2="getEOF", addFlagsVtable=4)
00075       @com.parameters([type=BOOLEAN] return) */
00076   public native boolean getEOF();
00077
00078   /** @com.method(vtoffset=18, dispid=0, type=PROPGET, name="Fields", name2="getFields", addFlagsVtable=4)
00079       @com.parameters([iid=00000564-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00080   public native msado15.Fields getFields();
00081
00082   /** @com.method(vtoffset=19, dispid=1008, type=PROPGET, name="LockType", name2="getLockType", addFlagsVtable=4)
00083       @com.parameters([type=I4] return) */
00084   public native int getLockType();
00085
00086   /** @com.method(vtoffset=20, dispid=1008, type=PROPPUT, name="LockType", name2="putLockType", addFlagsVtable=4)
00087       @com.parameters([in,type=I4] plLockType) */
00088   public native void setLockType(int plLockType);
00089
00090   /** @com.method(vtoffset=21, dispid=1009, type=PROPGET, name="MaxRecords", name2="getMaxRecords", addFlagsVtable=4)
00091       @com.parameters([type=I4] return) */
00092   public native int getMaxRecords();
00093
00094   /** @com.method(vtoffset=22, dispid=1009, type=PROPPUT, name="MaxRecords", name2="putMaxRecords", addFlagsVtable=4)
00095       @com.parameters([in,type=I4] plMaxRecords) */
00096   public native void setMaxRecords(int plMaxRecords);
00097
00098   /** @com.method(vtoffset=23, dispid=1010, type=PROPGET, name="RecordCount", name2="getRecordCount", addFlagsVtable=4)
00099       @com.parameters([type=I4] return) */
00100   public native int getRecordCount();
00101
00102   /** @com.method(vtoffset=24, dispid=1011, type=PROPPUTREF, name="Source", name2="putSource", addFlagsVtable=4)
00103       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] pvSource) */
00104   public native void setSource(Object pvSource);
00105
00106   /** @com.method(vtoffset=25, dispid=1011, type=PROPPUT, name="Source", name2="putSource", addFlagsVtable=4)
00107       @com.parameters([in,type=STRING] pvSource) */
00108   public native void setSource(String pvSource);
00109
00110   /** @com.method(vtoffset=26, dispid=1011, type=PROPGET, name="Source", name2="getSource", addFlagsVtable=4)
00111       @com.parameters([type=VARIANT] return) */
00112   public native Variant getSource();
00113
00114   /** @com.method(vtoffset=27, dispid=1012, type=METHOD, name="AddNew", addFlagsVtable=4)
00115       @com.parameters([in,type=VARIANT] FieldList, [in,type=VARIANT] Values) */
00116   public native void AddNew(Variant FieldList, Variant Values);
00117
00118   /** @com.method(vtoffset=28, dispid=1013, type=METHOD, name="CancelUpdate", addFlagsVtable=4)
00119       @com.parameters() */
00120   public native void CancelUpdate();
00121
00122   /** @com.method(vtoffset=29, dispid=1014, type=METHOD, name="Close", addFlagsVtable=4)
00123       @com.parameters() */
00124   public native void Close();
00125
00126   /** @com.method(vtoffset=30, dispid=1015, type=METHOD, name="Delete", addFlagsVtable=4)
00127       @com.parameters([in,type=I4] AffectRecords) */
00128   public native void Delete(int AffectRecords);
00129
00130   /** @com.method(vtoffset=31, dispid=1016, type=METHOD, name="GetRows", addFlagsVtable=4)
00131       @com.parameters([in,type=I4] Rows, [in,type=VARIANT] Start, [in,type=VARIANT] Fields, [type=VARIANT] return) */
00132   public native Variant GetRows(int Rows, Variant Start, Variant Fields);
00133
00134   /** @com.method(vtoffset=32, dispid=1017, type=METHOD, name="Move", addFlagsVtable=4)
00135       @com.parameters([in,type=I4] NumRecords, [in,type=VARIANT] Start) */
00136   public native void Move(int NumRecords, Variant Start);
00137
00138   /** @com.method(vtoffset=33, dispid=1018, type=METHOD, name="MoveNext", addFlagsVtable=4)
00139       @com.parameters() */
00140   public native void MoveNext();
00141
00142   /** @com.method(vtoffset=34, dispid=1019, type=METHOD, name="MovePrevious", addFlagsVtable=4)
00143       @com.parameters() */
00144   public native void MovePrevious();
00145
00146   /** @com.method(vtoffset=35, dispid=1020, type=METHOD, name="MoveFirst", addFlagsVtable=4)
00147       @com.parameters() */
00148   public native void MoveFirst();
00149
00150   /** @com.method(vtoffset=36, dispid=1021, type=METHOD, name="MoveLast", addFlagsVtable=4)
00151       @com.parameters() */
00152   public native void MoveLast();
00153
00154   /** @com.method(vtoffset=37, dispid=1022, type=METHOD, name="Open", addFlagsVtable=4)
00155       @com.parameters([in,type=VARIANT] Source, [in,type=VARIANT] ActiveConnection, [in,type=I4] CursorType, [in,type=I4] LockType, [in,type=I4] Options) */
00156   public native void Open(Variant Source, Variant ActiveConnection, int CursorType, int LockType, int Options);
00157
00158   /** @com.method(vtoffset=38, dispid=1023, type=METHOD, name="Requery", addFlagsVtable=4)
00159       @com.parameters([in,type=I4] Options) */
00160   public native void Requery(int Options);
00161
00162   /** @com.method(vtoffset=39, dispid=1610809378, type=METHOD, name="_xResync", addFlagsVtable=4)
00163       @com.parameters([in,type=I4] AffectRecords)
00164       @hidden */
00165   public native void _xResync(int AffectRecords);
00166
00167   /** @com.method(vtoffset=40, dispid=1025, type=METHOD, name="Update", addFlagsVtable=4)
00168       @com.parameters([in,type=VARIANT] Fields, [in,type=VARIANT] Values) */
00169   public native void Update(Variant Fields, Variant Values);
00170
00171   /** @com.method(vtoffset=41, dispid=1047, type=PROPGET, name="AbsolutePage", name2="getAbsolutePage", addFlagsVtable=4)
00172       @com.parameters([type=I4] return) */
00173   public native int getAbsolutePage();
00174
00175   /** @com.method(vtoffset=42, dispid=1047, type=PROPPUT, name="AbsolutePage", name2="putAbsolutePage", addFlagsVtable=4)
00176       @com.parameters([in,type=I4] pl) */
00177   public native void setAbsolutePage(int pl);
00178
00179   /** @com.method(vtoffset=43, dispid=1026, type=PROPGET, name="EditMode", name2="getEditMode", addFlagsVtable=4)
00180       @com.parameters([type=I4] return) */
00181   public native int getEditMode();
00182
00183   /** @com.method(vtoffset=44, dispid=1030, type=PROPGET, name="Filter", name2="getFilter", addFlagsVtable=4)
00184       @com.parameters([type=VARIANT] return) */
00185   public native Variant getFilter();
00186
00187   /** @com.method(vtoffset=45, dispid=1030, type=PROPPUT, name="Filter", name2="putFilter", addFlagsVtable=4)
00188       @com.parameters([in,type=VARIANT] Criteria) */
00189   public native void setFilter(Variant Criteria);
00190
00191   /** @com.method(vtoffset=46, dispid=1050, type=PROPGET, name="PageCount", name2="getPageCount", addFlagsVtable=4)
00192       @com.parameters([type=I4] return) */
00193   public native int getPageCount();
00194
00195   /** @com.method(vtoffset=47, dispid=1048, type=PROPGET, name="PageSize", name2="getPageSize", addFlagsVtable=4)
00196       @com.parameters([type=I4] return) */
00197   public native int getPageSize();
00198
00199   /** @com.method(vtoffset=48, dispid=1048, type=PROPPUT, name="PageSize", name2="putPageSize", addFlagsVtable=4)
00200       @com.parameters([in,type=I4] pl) */
00201   public native void setPageSize(int pl);
00202
00203   /** @com.method(vtoffset=49, dispid=1031, type=PROPGET, name="Sort", name2="getSort", addFlagsVtable=4)
00204       @com.parameters([type=STRING] return) */
00205   public native String getSort();
00206
00207   /** @com.method(vtoffset=50, dispid=1031, type=PROPPUT, name="Sort", name2="putSort", addFlagsVtable=4)
00208       @com.parameters([in,type=STRING] Criteria) */
00209   public native void setSort(String Criteria);
00210
00211   /** @com.method(vtoffset=51, dispid=1029, type=PROPGET, name="Status", name2="getStatus", addFlagsVtable=4)
00212       @com.parameters([type=I4] return) */
00213   public native int getStatus();
00214
00215   /** @com.method(vtoffset=52, dispid=1054, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00216       @com.parameters([type=I4] return) */
00217   public native int getState();
00218
00219   /** @com.method(vtoffset=53, dispid=1610809392, type=METHOD, name="_xClone", addFlagsVtable=4)
00220       @com.parameters([iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return)
00221       @hidden */
00222   public native msado15._Recordset _xClone();
00223
00224   /** @com.method(vtoffset=54, dispid=1035, type=METHOD, name="UpdateBatch", addFlagsVtable=4)
00225       @com.parameters([in,type=I4] AffectRecords) */
00226   public native void UpdateBatch(int AffectRecords);
00227
00228   /** @com.method(vtoffset=55, dispid=1049, type=METHOD, name="CancelBatch", addFlagsVtable=4)
00229       @com.parameters([in,type=I4] AffectRecords) */
00230   public native void CancelBatch(int AffectRecords);
00231
00232   /** @com.method(vtoffset=56, dispid=1051, type=PROPGET, name="CursorLocation", name2="getCursorLocation", addFlagsVtable=4)
00233       @com.parameters([type=I4] return) */
00234   public native int getCursorLocation();
00235
00236   /** @com.method(vtoffset=57, dispid=1051, type=PROPPUT, name="CursorLocation", name2="putCursorLocation", addFlagsVtable=4)
00237       @com.parameters([in,type=I4] plCursorLoc) */
00238   public native void setCursorLocation(int plCursorLoc);
00239
00240   /** @com.method(vtoffset=58, dispid=1052, type=METHOD, name="NextRecordset", addFlagsVtable=4)
00241       @com.parameters([out,elementType=VARIANT,type=PTR] RecordsAffected, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00242   public native msado15._Recordset NextRecordset(Variant RecordsAffected);
00243
00244   /** @com.method(vtoffset=59, dispid=1036, type=METHOD, name="Supports", addFlagsVtable=4)
00245       @com.parameters([in,type=I4] CursorOptions, [type=BOOLEAN] return) */
00246   public native boolean Supports(int CursorOptions);
00247
00248   /** @com.method(vtoffset=60, dispid=4294967288, type=PROPGET, name="Collect", name2="getCollect", addFlagsVtable=4)
00249       @com.parameters([in,type=VARIANT] Index, [type=VARIANT] return)
00250       @hidden */
00251   public native Variant getCollect(Variant Index);
00252
00253   /** @com.method(vtoffset=61, dispid=4294967288, type=PROPPUT, name="Collect", name2="putCollect", addFlagsVtable=4)
00254       @com.parameters([in,type=VARIANT] Index, [in,type=VARIANT] pvar)
00255       @hidden */
00256   public native void setCollect(Variant Index, Variant pvar);
00257
00258   /** @com.method(vtoffset=62, dispid=1053, type=PROPGET, name="MarshalOptions", name2="getMarshalOptions", addFlagsVtable=4)
00259       @com.parameters([type=I4] return) */
00260   public native int getMarshalOptions();
00261
00262   /** @com.method(vtoffset=63, dispid=1053, type=PROPPUT, name="MarshalOptions", name2="putMarshalOptions", addFlagsVtable=4)
00263       @com.parameters([in,type=I4] peMarshal) */
00264   public native void setMarshalOptions(int peMarshal);
00265
00266   /** @com.method(vtoffset=64, dispid=1058, type=METHOD, name="Find", addFlagsVtable=4)
00267       @com.parameters([in,type=STRING] Criteria, [in,type=I4] SkipRecords, [in,type=I4] SearchDirection, [in,type=VARIANT] Start) */
00268   public native void Find(String Criteria, int SkipRecords, int SearchDirection, Variant Start);
00269
00270   /** @com.method(vtoffset=65, dispid=1055, type=METHOD, name="Cancel", addFlagsVtable=4)
00271       @com.parameters() */
00272   public native void Cancel();
00273
00274   /** @com.method(vtoffset=66, dispid=1056, type=PROPGET, name="DataSource", name2="getDataSource", addFlagsVtable=4)
00275       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00276   public native IUnknown getDataSource();
00277
00278   /** @com.method(vtoffset=67, dispid=1056, type=PROPPUTREF, name="DataSource", name2="putDataSource", addFlagsVtable=4)
00279       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] ppunkDataSource) */
00280   public native void setDataSource(IUnknown ppunkDataSource);
00281
00282   /** @com.method(vtoffset=68, dispid=1610874883, type=METHOD, name="_xSave", addFlagsVtable=4)
00283       @com.parameters([in,type=STRING] FileName, [in,type=I4] PersistFormat)
00284       @hidden */
00285   public native void _xSave(String FileName, int PersistFormat);
00286
00287   /** @com.method(vtoffset=69, dispid=1061, type=PROPGET, name="ActiveCommand", name2="getActiveCommand", addFlagsVtable=4)
00288       @com.parameters([iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00289   public native Object getActiveCommand();
00290
00291   /** @com.method(vtoffset=70, dispid=1063, type=PROPPUT, name="StayInSync", name2="putStayInSync", addFlagsVtable=4)
00292       @com.parameters([in,type=BOOLEAN] pbStayInSync) */
00293   public native void setStayInSync(boolean pbStayInSync);
00294
00295   /** @com.method(vtoffset=71, dispid=1063, type=PROPGET, name="StayInSync", name2="getStayInSync", addFlagsVtable=4)
00296       @com.parameters([type=BOOLEAN] return) */
00297   public native boolean getStayInSync();
00298
00299   /** @com.method(vtoffset=72, dispid=1062, type=METHOD, name="GetString", addFlagsVtable=4)
00300       @com.parameters([in,type=I4] StringFormat, [in,type=I4] NumRows, [in,type=STRING] ColumnDelimeter, [in,type=STRING] RowDelimeter, [in,type=STRING] NullExpr, [type=STRING] return) */
00301   public native String GetString(int StringFormat, int NumRows, String ColumnDelimeter, String RowDelimeter, String NullExpr);
00302
00303   /** @com.method(vtoffset=73, dispid=1064, type=PROPGET, name="DataMember", name2="getDataMember", addFlagsVtable=4)
00304       @com.parameters([type=STRING] return) */
00305   public native String getDataMember();
00306
00307   /** @com.method(vtoffset=74, dispid=1064, type=PROPPUT, name="DataMember", name2="putDataMember", addFlagsVtable=4)
00308       @com.parameters([in,type=STRING] pbstrDataMember) */
00309   public native void setDataMember(String pbstrDataMember);
00310
00311   /** @com.method(vtoffset=75, dispid=1065, type=METHOD, name="CompareBookmarks", addFlagsVtable=4)
00312       @com.parameters([in,type=VARIANT] Bookmark1, [in,type=VARIANT] Bookmark2, [type=I4] return) */
00313   public native int CompareBookmarks(Variant Bookmark1, Variant Bookmark2);
00314
00315   /** @com.method(vtoffset=76, dispid=1034, type=METHOD, name="Clone", addFlagsVtable=4)
00316       @com.parameters([in,type=I4] LockType, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00317   public native msado15._Recordset Clone(int LockType);
00318
00319   /** @com.method(vtoffset=77, dispid=1024, type=METHOD, name="Resync", addFlagsVtable=4)
00320       @com.parameters([in,type=I4] AffectRecords, [in,type=I4] ResyncValues) */
00321   public native void Resync(int AffectRecords, int ResyncValues);
00322
00323   /** @com.method(vtoffset=78, dispid=1066, type=METHOD, name="Seek", addFlagsVtable=4)
00324       @com.parameters([in,type=VARIANT] KeyValues, [in,type=I4] SeekOption) */
00325   public native void Seek(Variant KeyValues, int SeekOption);
00326
00327   /** @com.method(vtoffset=79, dispid=1067, type=PROPPUT, name="Index", name2="putIndex", addFlagsVtable=4)
00328       @com.parameters([in,type=STRING] pbstrIndex) */
00329   public native void setIndex(String pbstrIndex);
00330
00331   /** @com.method(vtoffset=80, dispid=1067, type=PROPGET, name="Index", name2="getIndex", addFlagsVtable=4)
00332       @com.parameters([type=STRING] return) */
00333   public native String getIndex();
00334
00335   /** @com.method(vtoffset=81, dispid=1057, type=METHOD, name="Save", addFlagsVtable=4)
00336       @com.parameters([in,type=VARIANT] Destination, [in,type=I4] PersistFormat) */
00337   public native void Save(Variant Destination, int PersistFormat);
00338
00339
00340   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x556, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00341
00342   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0x535, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00343 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AUTH_DATA Member List

This is the complete list of members for AUTH_DATA, including all inherited members.
bstrOldURI | AUTH_DATA
szAccount | AUTH_DATA
szPassword | AUTH_DATA
szUserURI | AUTH_DATA
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/HttpAuth/Const.H Source File

  • Security
  • SSPI
  • HttpAuth

Const.H

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1995 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009
00010 Module Name:
00011
00012     const.h
00013
00014 Abstract:
00015     Constants
00016
00017 Environment:
00018     Internet
00019
00020 --*/
00021
00022 #define VERBOSE 1
00023
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/Mount/UnMount.Cpp Source File

  • WinBase
  • IO
  • Mount

UnMount.Cpp

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 unmount.c
00010
00011 This file implements a command-line utility that removes mount points on
00012 drives on Windows 2000 and later.
00013
00014 Command-line syntax:
00015    unmount <directory>
00016 ----------------------------------------------------------------------------*/
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020
00021 static void PrintHelp (void);
00022
00023 int main (int argc, char **argv)
00024 {
00025    char *pszMountToDelete;
00026    char *pszDirName = NULL;
00027    int   cchDirLen;
00028
00029
00030    // Make sure user suppled proper command-line arguments.
00031    if (argc != 2)
00032    {
00033       PrintHelp();
00034       return (-1);
00035    }
00036
00037    /*
00038       Make sure there are enough command-line arguments before
00039       dereferencing argv[1].
00040    */
00041    pszMountToDelete = argv[1];
00042
00043    /*
00044       Add trailing backslashes to the mount point directory name
00045       because volume mount point APIs require them.
00046
00047       If the directory name doesn't already have a trailing backslash, we
00048       just copy it to a new buffer and add the trailing backslash.
00049    */
00050    cchDirLen = lstrlen(pszMountToDelete);
00051    if (pszMountToDelete[cchDirLen - 1] != '\\')
00052    {
00053       pszDirName = new char[cchDirLen + 2]; // +2 for backslash and NULL
00054       lstrcpy (pszDirName, pszMountToDelete);
00055       pszDirName[cchDirLen] = '\\';
00056       pszDirName[cchDirLen+1] = '\0';
00057    }
00058    else
00059       pszDirName = (char *)pszMountToDelete;  // Cast away const
00060
00061    // Delete the mount point here.
00062    if (DeleteVolumeMountPoint (pszDirName))
00063       printf("unmounted %s\n", pszMountToDelete);
00064    else
00065       printf("couldn't unmount %s\n", pszMountToDelete);
00066
00067
00068    // Free pszDirName if it was allocated from free store
00069    if (pszDirName != pszMountToDelete)
00070       delete[] pszDirName;
00071
00072
00073    return (0);
00074 }
00075
00076
00077 /*-----------------------------------------------------------------------------
00078 PrintHelp( )
00079
00080 Notes
00081    Prints usage notes for the command line syntax.  Called if the user doesn't
00082    specify the command line correctly.
00083 -----------------------------------------------------------------------------*/
00084 void PrintHelp (void)
00085 {
00086    printf ("usage: unmount <directory>\n");
00087 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPluggableTransport Member List

This is the complete list of members for CPluggableTransport, including all inherited members.
AcceptConnection(HWND hWnd) | CPluggableTransport |
AcceptConnection(LPTSTR pszComPort) | CPluggableTransport |
CloseConnection(PLUGXPRT_FRAMING eFraming) | CPluggableTransport |
CPluggableTransport(void) | CPluggableTransport |
CreateConnection() | CPluggableTransport |
CreateConnection(LPTSTR pszComPort) | CPluggableTransport |
DisableWinsock() | CPluggableTransport |
EnableWinsock() | CPluggableTransport |
GetCloseEventHandle() | CPluggableTransport |
GetConnectionID() | CPluggableTransport |
GetReadEventHandle() | CPluggableTransport |
GetWriteEventHandle() | CPluggableTransport |
InConnection() | CPluggableTransport |
Initialize(INmManager *pINmManager) | CPluggableTransport |
m_bInConnection | CPluggableTransport | [private]
m_hEvtClose | CPluggableTransport | [private]
m_hEvtRead | CPluggableTransport | [private]
m_hEvtWrite | CPluggableTransport | [private]
m_pIPlugTrans | CPluggableTransport | [private]
m_pPSTN | CPluggableTransport |
m_pX224 | CPluggableTransport |
m_szConnID | CPluggableTransport | [private]
Uninitialize() | CPluggableTransport |
~CPluggableTransport(void) | CPluggableTransport |
Generated on Wed Nov 13 2024 16:57:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/SampleMSP/SampCall.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • SampleMSP

SampCall.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sampcall.h
00008
00009 Abstract:
00010
00011     Declaration of the CSampleMSPCall
00012
00013 --*/
00014
00015 #ifndef __SAMPCALL_H_
00016 #define __SAMPCALL_H_
00017
00018 #if _MSC_VER >= 1000
00019 #pragma once
00020 #endif // _MSC_VER >= 1000
00021
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // CSampleMSPCall
00025 /////////////////////////////////////////////////////////////////////////////
00026
00027 class CSampleMSPCall : public CMSPCallMultiGraph
00028     //  if you want to allow your object to be used in scripting apps
00029     //  it has to expose IObjectSafety interface. if your object is safe for
00030     //  scripting on all of its interfaces, you can use the implementation
00031     //  of IObjectSafety from MSPUtils.h
00032     //, public CMSPObjectSafetyImpl
00033
00034 {
00035 public:
00036 // DECLARE_POLY_AGGREGATABLE(CSampleMSP)
00037
00038 // To add extra interfaces to this class, use the following:
00039 // BEGIN_COM_MAP(CSampleMSPCall)
00040 //     COM_INTERFACE_ENTRY( YOUR_INTERFACE_HERE )
00041 //     // if you want to allow your object to be used in scripting apps
00042 //     // it has to expose IObjectSafety interface
00043 //     // COM_INTERFACE_ENTRY( IObjectSafety )
00044 //     COM_INTERFACE_ENTRY_CHAIN(CMSPCallMultiGraph)
00045 // END_COM_MAP()
00046
00047 public:
00048     CSampleMSPCall();
00049     virtual ~CSampleMSPCall();
00050     virtual ULONG MSPCallAddRef(void);
00051     virtual ULONG MSPCallRelease(void);
00052
00053     virtual HRESULT Init(
00054         IN      CMSPAddress *       pMSPAddress,
00055         IN      MSP_HANDLE          htCall,
00056         IN      DWORD               dwReserved,
00057         IN      DWORD               dwMediaType
00058         );
00059
00060     virtual HRESULT CreateStreamObject(
00061         IN      DWORD               dwMediaType,
00062         IN      TERMINAL_DIRECTION  Direction,
00063         IN      IMediaEvent *       pGraph,
00064         IN      ITStream **         ppStream
00065         );
00066
00067     virtual HRESULT ReceiveTSPCallData(
00068         IN      PBYTE               pBuffer,
00069         IN      DWORD               dwSize
00070         );
00071
00072     //
00073     // We override these to make sure the number of
00074     // streams we have is constant.
00075     //
00076
00077     STDMETHOD (CreateStream) (
00078         IN      DWORD               dwMediaType,
00079         IN      TERMINAL_DIRECTION  Direction,
00080         IN OUT  ITStream **         ppStream
00081         );
00082
00083     STDMETHOD (RemoveStream) (
00084         IN      ITStream *          pStream
00085         );
00086
00087 protected:
00088     //
00089     // Protected data members.
00090     //
00091
00092     CSampleMSPStream * m_pRenderStream;
00093     CSampleMSPStream * m_pCaptureStream;
00094 };
00095
00096 #endif //__SAMPCALL_H_
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/rqsclient.h Source File

  • NetDS
  • RRas
  • rqs
  • server

rqsclient.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RqsClient.h
00004 //
00005 //      Synopsis:   Object representing a client to the Quarantine engine
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011 #pragma once
00012
00013 class RqsEngine;
00014
00015 #define RQS_MESSAGE_LENGH_SIZE 4                             // "Size"
00016 #define RQS_MESSAGE_PREFIX_SIZE (3 + RQS_MESSAGE_LENGH_SIZE) // "Size:1:"
00017 #define RQS_MESSAGE_SIZE  (1024 + RQS_MESSAGE_PREFIX_SIZE)   // "Size:1:String"
00018
00019 //+--------------------------------------------------------------------------
00020 //
00021 // Synopsis: Defines the states a client goes through
00022 //
00023 //      Reading:            In the process of reading the client's message
00024 //      ReceiveComplete:    Full client message received
00025 //      Responding:         In the process of repsonding to the client
00026 //      RespondComplete:    Completed a response to the client
00027 //
00028 //+--------------------------------------------------------------------------
00029 enum RqsClientState
00030 {
00031     Receiving,
00032     ReceiveComplete,
00033     Responding,
00034     RespondComplete,
00035     ClientError
00036 };
00037
00038 //+--------------------------------------------------------------------------
00039 //
00040 // Synopsis: Client control block
00041 //
00042 //+--------------------------------------------------------------------------
00043 class RqsClient
00044 {
00045 public:
00046     RqsClient();
00047     ~RqsClient();
00048
00049     VOID SetEngine(IN RqsEngine* pEngine) {m_pEngine = pEngine;}
00050     VOID AssignSocket(IN RuSocket* pSocket);
00051
00052     HRESULT ReceiveMessage();
00053     HRESULT SendResponse(IN BOOL fOk);
00054
00055     RqsClientState GetState() {return m_State;}
00056     CHAR* GetString() {return m_pszString;}
00057     CONST CHAR* GetUsername();
00058
00059     DWORD GetAddressN();
00060     DWORD GetAddressH();
00061     CONST CHAR* GetAddressPsz();
00062
00063 private:
00064     RuSocket* m_pSocket;
00065     RqsEngine* m_pEngine;
00066     CHAR m_pszBuffer[RQS_MESSAGE_SIZE];
00067     CHAR m_pszAddress[32];
00068     UINT m_uiBytesRead;
00069     UINT m_uiMessageSize;
00070     CHAR* m_pszString;
00071     CHAR* m_pszUsername;
00072     RqsClientState m_State;
00073     DWORD m_dwAddressH;
00074
00075
00076 };
00077
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCanvas Member List

This is the complete list of members for CCanvas, including all inherited members.
_hdc | CCanvas | [protected]
CCanvas() | CCanvas | [inline]
Char(int x, int y, TCHAR ch) | CCanvas | [inline]
Circle(int x, int y, int r) | CCanvas | [inline]
Clear(RECT &rect) | CCanvas | [inline]
DPtoLP(LPPOINT lppt) | CCanvas | [inline]
Init(HDC hdc) | CCanvas | [inline, protected]
Line(COORD x1, COORD y1, COORD x2, COORD y2) | CCanvas | [inline]
LPtoDP(LPPOINT lppt) | CCanvas | [inline]
operator HDC() | CCanvas | [inline]
RCText(LPRECT lprc, LPTSTR buf, int cBuf) | CCanvas | [inline]
Scale(UINT iScale) | CCanvas | [inline]
Scroll(int dx, int dy) | CCanvas | [inline]
Text(int x, int y, LPTSTR buf, int cBuf) | CCanvas | [inline]
TextAlign(WORD aligntype) | CCanvas | [inline]
Generated on Wed Nov 13 2024 16:55:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • Complete

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030         static TCHAR error[64];
00031
00032         switch (verb) {
00033     case MMC_VERB_NONE:
00034                 return _T("NONE");
00035     case MMC_VERB_OPEN:
00036                 return _T("OPEN");
00037     case MMC_VERB_COPY:
00038                 return _T("COPY");
00039     case MMC_VERB_PASTE:
00040                 return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042                 return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044                 return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046                 return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048                 return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050                 return _T("PRINT");
00051     case MMC_VERB_CUT:
00052                 return _T("CUT");
00053         default:
00054                 wsprintf(error, _T("Unknown verb id %d"), verb);
00055                 return error;
00056         }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061                                 IComponentData *pCompData,
00062                                 IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064                                 LPARAM arg,
00065                                 LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069         TCHAR message[cchMessage] = {0};
00070
00071         if (bComponentData == TRUE)
00072                 OutputDebugString(_T("IComponentData::Notify( "));
00073         else
00074                 OutputDebugString(_T("IComponent::Notify( "));
00075
00076         wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077         OutputDebugString(message);
00078
00079     switch (event)      {
00080                 case MMCN_ACTIVATE:
00081                         wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082                         break;
00083
00084                 case MMCN_ADD_IMAGES:
00085                         wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086                         break;
00087
00088                 case MMCN_BTN_CLICK:
00089                         wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090                         break;
00091
00092                 case MMCN_COLUMN_CLICK:
00093                         wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,       param);
00094                         break;
00095
00096                 case MMCN_COLUMNS_CHANGED:
00097                         wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098                         break;
00099
00100                 case MMCN_CONTEXTHELP:
00101                         wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102                         break;
00103
00104                 case MMCN_CONTEXTMENU:
00105                         wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106                         break;
00107
00108                 case MMCN_CUTORMOVE:
00109                         wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110                         break;
00111
00112                 case MMCN_DBLCLICK:
00113                         wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114                         break;
00115
00116                 case MMCN_DELETE:
00117                         wsprintf(message, _T("MMCN_DELETE\n"));
00118                         break;
00119
00120                 case MMCN_DESELECT_ALL:
00121                         wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122                         break;
00123
00124                 case MMCN_EXPAND:
00125                         wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126                         break;
00127
00128                 case MMCN_EXPANDSYNC:
00129                         wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130                         break;
00131
00132                 case MMCN_FILTERBTN_CLICK:
00133                         wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134                         break;
00135
00136                 case MMCN_FILTER_CHANGE:
00137                         wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138                         break;
00139
00140                 case MMCN_HELP:
00141                         wsprintf(message, _T("MMCN_HELP\n"));
00142                         break;
00143
00144                 case MMCN_INITOCX:
00145                         wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146                         break;
00147
00148                 case MMCN_LISTPAD:
00149                         wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150                         break;
00151
00152                 case MMCN_MENU_BTNCLICK:
00153                         wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154                         break;
00155
00156                 case MMCN_MINIMIZED:
00157                         wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158                         break;
00159
00160                 case MMCN_PASTE:
00161                         wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162                         break;
00163
00164                 case MMCN_PRELOAD:
00165                         wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166                         break;
00167
00168                 case MMCN_PRINT:
00169                         wsprintf(message, _T("MMCN_PRINT\n"));
00170                         break;
00171
00172                 case MMCN_PROPERTY_CHANGE:
00173                         wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174                         break;
00175
00176                 case MMCN_QUERY_PASTE:
00177                         wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178                         break;
00179
00180                 case MMCN_REFRESH:
00181                         wsprintf(message, _T("MMCN_REFRESH\n"));
00182                         break;
00183
00184                 case MMCN_REMOVE_CHILDREN:
00185                         wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186                         break;
00187
00188                 case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192                         StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193                         break;
00194
00195                 case MMCN_RESTORE_VIEW:
00196                         wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197                         break;
00198
00199                 case MMCN_SELECT:
00200                         wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201                         break;
00202
00203                 case MMCN_SHOW:
00204                         wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205                         break;
00206
00207                 case MMCN_SNAPINHELP:
00208                         wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209                         break;
00210
00211                 case MMCN_VIEW_CHANGE:
00212                         wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213                         break;
00214         }
00215
00216         if (message[0] != 0)
00217                 OutputDebugString(message);
00218         else
00219                 OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222         return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagCrmFilesDeleteFileLogRecord Member List

This is the complete list of members for tagCrmFilesDeleteFileLogRecord, including all inherited members.
CommandType | tagCrmFilesDeleteFileLogRecord
dwSourceSize | tagCrmFilesDeleteFileLogRecord
dwTempSize | tagCrmFilesDeleteFileLogRecord
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/registry.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

registry.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef __Registry_H__
00015 #define __Registry_H__
00016
00017 #include <tchar.h>
00018
00019 // This function will register a component in the Registry.
00020 // The component calls this function from its DllRegisterServer function.
00021 HRESULT RegisterServer( HMODULE hModule,
00022                         const CLSID& clsid,
00023                         const TCHAR* szFriendlyName) ;
00024
00025 // This function will unregister a component.  Components
00026 // call this function from their DllUnregisterServer function.
00027 HRESULT UnregisterServer( const CLSID& clsid ) ;
00028
00029
00030 // This function will register a Snap-In component.  Components
00031 // call this function from their DllRegisterServer function.
00032 HRESULT RegisterSnapin( const CLSID& clsid,            // Class ID
00033                         const TCHAR* szNameString,     // NameString
00034                         const CLSID& clsidAbout,       // Class Id for About Class
00035                         const BOOL fSupportExtensions = FALSE
00036                       );
00037
00038 HRESULT UnregisterSnapin( const CLSID& clsid );        // Class ID
00039
00040 #endif //__Registry_H__
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NODE_STRUCT Member List

This is the complete list of members for NODE_STRUCT, including all inherited members.
pLeftLink | NODE_STRUCT
pNodeData | NODE_STRUCT
pRightLink | NODE_STRUCT
Generated on Wed Nov 13 2024 16:57:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/foldernode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

foldernode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CFolderNode class.  This node is a child of
00014 //                CDeviceNode.  It represents a Virtual Storage folder
00015 //
00016 //
00017
00018
00019 #ifndef _CLASS_CFOLDERNODE_
00020 #define _CLASS_CFOLDERNODE_
00021
00022 #include "Globals.h"
00023 #include "BaseNode.h"
00024 #include "VirtualFile.h"     // Result item children of this node
00025 #include "LListImpl.h"       // Linked list class
00026
00027
00028 class CComponentData;        // References
00029 class CDeviceNode;
00030
00031 //---------------------------------------------------------------------------
00032 class CFolderNode : public CBaseNode
00033 {
00034   public:
00035     CFolderNode();
00036     virtual ~CFolderNode();
00037
00038     HRESULT Initialize( LPNODEPROPS pNodeProps );
00039
00040   ///////////////////////////////////////////////////////////////////////////
00041   // Virtual methods
00042   public:
00043     ULONG   GetNodeType() { return NODETYPE_FOLDER; }
00044     GUID&   GetNodeGUID() { return m_thisGUID; }
00045
00046     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00047     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00048     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00049
00050   ///////////////////////////////////////////////////////////////////////////
00051   //  Notification handlers
00052   //
00053   public:
00054     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00055     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00056     HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00057     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00058     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00059     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00060
00061
00062   ///////////////////////////////////////////////////////////////////////////
00063   //  Context Menu methods
00064   //
00065   public:
00066     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00067     HRESULT Command( long lCommandID );
00068
00069   /////////////////////////////////////////////////////////////////////////
00070   //  ToolBar methods
00071   //
00072   public:
00073     HRESULT ControlbarNotify( LPARAM nArg, LPARAM lParam, LONG_PTR pComp );
00074
00075
00076   ///////////////////////////////////////////////////////////////////////////
00077   // Private helpers
00078   private:
00079     HRESULT InitDefaultVFile();
00080     VOID    RemoveNodes();
00081     HRESULT EnumerateResultItems( LPRESULTDATA ipResultData );
00082     HRESULT AddVirtualFile( NODE_PROPERTIES* pProps = NULL );
00083
00084   private:
00085     static GUID  m_thisGUID;
00086     DWORD        m_dwAttributes;
00087
00088     CLListImpl<CVirtualFile*,CVirtualFile*>  m_NodeList;
00089     CComponentData* m_pCompData;
00090     HWND            m_hMessageWnd;     // Our message handler
00091     CDeviceNode*    m_pParentNode;
00092
00093   public:
00094     HWND   m_hAddVFileDlg;             // Instance of AddDeviceDlg
00095
00096     static LRESULT CALLBACK FolderNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00097
00098     VOID RemoveChildNode( LONG_PTR pChildNode );
00099
00100 };
00101
00102 #endif //_CLASS_CFOLDERNODE_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminErrorCodes Member List

This is the complete list of members for comadmin::COMAdminErrorCodes, including all inherited members.
COMAdminErrAlreadyInstalled | comadmin::COMAdminErrorCodes | [static]
COMAdminErrAppDirNotFound | comadmin::COMAdminErrorCodes | [static]
COMAdminErrAppFileReadFail | comadmin::COMAdminErrorCodes | [static]
COMAdminErrAppFileVersion | comadmin::COMAdminErrorCodes | [static]
COMAdminErrAppFileWriteFail | comadmin::COMAdminErrorCodes | [static]
COMAdminErrApplicationExists | comadmin::COMAdminErrorCodes | [static]
COMAdminErrApplidMatchesClsid | comadmin::COMAdminErrorCodes | [static]
COMAdminErrAuthenticationLevel | comadmin::COMAdminErrorCodes | [static]
COMAdminErrBadPath | comadmin::COMAdminErrorCodes | [static]
COMAdminErrBadRegistryLibID | comadmin::COMAdminErrorCodes | [static]
COMAdminErrBadRegistryProgID | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCanNotExportAppProxy | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCanNotExportSystemApp | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCanNotStartApp | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCanNotSubscribeToComponent | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCantCopyFile | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCLSIDOrIIDMismatch | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompFileBadTLB | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompFileClassNotAvail | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompFileDoesNotExist | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompFileGetClassObj | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompFileLoadDLLFail | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompFileNoRegistrar | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompFileNotInstallable | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompMoveBadDest | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCompMoveLocked | comadmin::COMAdminErrorCodes | [static]
COMAdminErrCoReqCompInstalled | comadmin::COMAdminErrorCodes | [static]
COMAdminErrDllLoadFailed | comadmin::COMAdminErrorCodes | [static]
COMAdminErrDllRegisterServer | comadmin::COMAdminErrorCodes | [static]
COMAdminErrInvalidUserids | comadmin::COMAdminErrorCodes | [static]
COMAdminErrKeyMissing | comadmin::COMAdminErrorCodes | [static]
COMAdminErrNoRegistryCLSID | comadmin::COMAdminErrorCodes | [static]
COMAdminErrNoServerShare | comadmin::COMAdminErrorCodes | [static]
COMAdminErrNotChangeable | comadmin::COMAdminErrorCodes | [static]
COMAdminErrNotDeletable | comadmin::COMAdminErrorCodes | [static]
COMAdminErrNotInRegistry | comadmin::COMAdminErrorCodes | [static]
COMAdminErrNoUser | comadmin::COMAdminErrorCodes | [static]
COMAdminErrObjectDoesNotExist | comadmin::COMAdminErrorCodes | [static]
COMAdminErrObjectErrors | comadmin::COMAdminErrorCodes | [static]
COMAdminErrObjectExists | comadmin::COMAdminErrorCodes | [static]
COMAdminErrObjectInvalid | comadmin::COMAdminErrorCodes | [static]
COMAdminErrObjectNotPoolable | comadmin::COMAdminErrorCodes | [static]
COMAdminErrObjectParentMissing | comadmin::COMAdminErrorCodes | [static]
COMAdminErrPropertyOverflow | comadmin::COMAdminErrorCodes | [static]
COMAdminErrPropertySaveFailed | comadmin::COMAdminErrorCodes | [static]
COMAdminErrQueuingServiceNotAvailable | comadmin::COMAdminErrorCodes | [static]
COMAdminErrRegFileCorrupt | comadmin::COMAdminErrorCodes | [static]
COMAdminErrRegisterTLB | comadmin::COMAdminErrorCodes | [static]
COMAdminErrRegistrarFailed | comadmin::COMAdminErrorCodes | [static]
COMAdminErrRemoteInterface | comadmin::COMAdminErrorCodes | [static]
COMAdminErrRequiresDifferentPlatform | comadmin::COMAdminErrorCodes | [static]
COMAdminErrRoleDoesNotExist | comadmin::COMAdminErrorCodes | [static]
COMAdminErrRoleExists | comadmin::COMAdminErrorCodes | [static]
COMAdminErrServiceNotInstalled | comadmin::COMAdminErrorCodes | [static]
COMAdminErrSession | comadmin::COMAdminErrorCodes | [static]
COMAdminErrStartAppNeedsComponents | comadmin::COMAdminErrorCodes | [static]
COMAdminErrSystemApp | comadmin::COMAdminErrorCodes | [static]
COMAdminErrUserPasswdNotValid | comadmin::COMAdminErrorCodes | [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

EventID Member List

This is the complete list of members for EventID, including all inherited members.
cEventID | EventID
EventIDs | EventID
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/SeekEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

SeekEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: SeekEnum
00019
00020 public class SeekEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adSeekFirstEQ = 1;
00023   public static final short adSeekLastEQ = 2;
00024   public static final short adSeekAfterEQ = 4;
00025   public static final short adSeekAfter = 8;
00026   public static final short adSeekBeforeEQ = 16;
00027   public static final short adSeekBefore = 32;
00028 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cbinder.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cbinder.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CBINDER.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 /////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 /////////////////////////////////////////////////////////////////
00019 // CBinder::CBinder
00020 //
00021 /////////////////////////////////////////////////////////////////
00022 CBinder::CBinder(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00023   : CBase(eCBinder, pCMainWindow, pCMDIChild)
00024 {
00025   //OLE DB Interfaces
00026   m_pIBindResource    = NULL;   //Binder interface
00027   m_pICreateRow     = NULL;   //Binder interface
00028   m_pIDBProperties    = NULL;   //Binder interface
00029   m_pIDBBinderProperties  = NULL;   //Binder interface
00030
00031   m_pIRegisterProvider  = NULL;   //Binder interface
00032
00033   //Data
00034   m_pwszURL       = NULL;
00035 }
00036
00037
00038 /////////////////////////////////////////////////////////////////
00039 // CBinder::~CBinder
00040 //
00041 /////////////////////////////////////////////////////////////////
00042 CBinder::~CBinder()
00043 {
00044   ReleaseObject(0);
00045
00046   //Save Recent URL into the Registry
00047   if(m_pwszURL)
00048   {
00049     DelRegEntry(HKEY_ROWSETVIEWER, wszRECENTURL_KEY);
00050     SetRegEntry(HKEY_ROWSETVIEWER, wszRECENTURL_KEY, m_pwszURL, L"");
00051     SAFE_FREE(m_pwszURL);
00052   }
00053 }
00054
00055
00056 /////////////////////////////////////////////////////////////////
00057 // IUnknown** CBinder::GetInterfaceAddress
00058 //
00059 /////////////////////////////////////////////////////////////////
00060 IUnknown** CBinder::GetInterfaceAddress(REFIID riid)
00061 {
00062   HANDLE_GETINTERFACE(IBindResource);
00063   HANDLE_GETINTERFACE(ICreateRow);
00064   HANDLE_GETINTERFACE(IDBBinderProperties);
00065   HANDLE_GETINTERFACE(IDBProperties);
00066   HANDLE_GETINTERFACE(IRegisterProvider);
00067
00068   //Otherwise delegate
00069   return CBase::GetInterfaceAddress(riid);
00070 }
00071
00072
00073 /////////////////////////////////////////////////////////////////
00074 // HRESULT CBinder::AutoRelease
00075 //
00076 /////////////////////////////////////////////////////////////////
00077 HRESULT CBinder::AutoRelease()
00078 {
00079   RELEASE_INTERFACE(IBindResource);
00080   RELEASE_INTERFACE(ICreateRow);
00081   RELEASE_INTERFACE(IDBProperties);
00082   RELEASE_INTERFACE(IDBBinderProperties);
00083   RELEASE_INTERFACE(IRegisterProvider);
00084
00085   //Delegate
00086   return CBase::AutoRelease();
00087 }
00088
00089
00090 /////////////////////////////////////////////////////////////////
00091 // HRESULT CBinder::AutoQI
00092 //
00093 /////////////////////////////////////////////////////////////////
00094 HRESULT CBinder::AutoQI(DWORD dwCreateOpts)
00095 {
00096   //Delegate First so we have base interfaces
00097   CBase::AutoQI(dwCreateOpts);
00098
00099   //[MANDATORY] Obtain [mandatory] interfaces
00100   if(dwCreateOpts & CREATE_QI_MANDATORY)
00101   {
00102     OBTAIN_INTERFACE(IBindResource);
00103     OBTAIN_INTERFACE(IDBProperties);
00104   }
00105
00106   //[OPTIONAL]
00107   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00108   {
00109     OBTAIN_INTERFACE(ICreateRow);
00110     OBTAIN_INTERFACE(IDBBinderProperties);
00111     OBTAIN_INTERFACE(IRegisterProvider);
00112   }
00113
00114   //Get the Recent Saved URL
00115   if(!m_pwszURL)
00116     GetRegEnumValue(HKEY_ROWSETVIEWER, wszRECENTURL_KEY, 0, &m_pwszURL);
00117   if(!m_pwszURL)
00118     m_pwszURL = wcsDuplicate(L"http://");
00119
00120   return S_OK;
00121 }
00122
00123
00124 /////////////////////////////////////////////////////////////////////////////
00125 // CBinder::GetObjectDesc
00126 //
00127 /////////////////////////////////////////////////////////////////////////////
00128 WCHAR* CBinder::GetObjectDesc()
00129 {
00130   if(!m_strObjectDesc && m_guidSource != GUID_NULL)
00131   {
00132     if(m_guidSource == CLSID_RootBinder)
00133       m_strObjectDesc.CopyFrom(L"Root Binder");
00134     else
00135       m_strObjectDesc.CopyFrom(GetProgID(m_guidSource));
00136   }
00137
00138   return m_strObjectDesc;
00139 }
00140
00141
00142
00143 ////////////////////////////////////////////////////////////////
00144 // CBinder::OnDefOperation
00145 //
00146 /////////////////////////////////////////////////////////////////
00147 void  CBinder::OnDefOperation()
00148 {
00149   //Display the Bind Dialog (by default)
00150   if(m_pIBindResource)
00151     m_pCMainWindow->DisplayDialog(IDD_BINDRESOURCE, GetFocus(), CMainWindow::BindResourceProc, this, IDM_IBINDRESOURCE_BIND);
00152 }
00153
00154
00155 /////////////////////////////////////////////////////////////////
00156 // HRESULT CBinder::CreateBinder
00157 //
00158 /////////////////////////////////////////////////////////////////
00159 HRESULT CBinder::CreateBinder(REFCLSID clsid)
00160 {
00161   HRESULT hr = S_OK;
00162   CComPtr<IBindResource>  spBindResource;
00163
00164   //Create the Binder object (optional object)...
00165   XTESTC(hr = m_pCMainWindow->m_pCRootEnumerator->CreateInstance(NULL, clsid, CLSCTX_ALL, IID_IBindResource, (IUnknown**)&spBindResource));
00166
00167   //Delegate
00168   m_guidSource = clsid;
00169   TESTC(hr = CreateObject(NULL, IID_IBindResource, spBindResource));
00170
00171 CLEANUP:
00172   return hr;
00173 }
00174
00175
00176 /////////////////////////////////////////////////////////////////
00177 // HRESULT CBinder::SetProperties
00178 //
00179 /////////////////////////////////////////////////////////////////
00180 HRESULT CBinder::SetProperties(ULONG cPropSets, DBPROPSET* rgPropSets)
00181 {
00182   HRESULT hr = S_OK;
00183
00184   if(m_pIDBProperties && cPropSets)
00185   {
00186     //SetProperties
00187     XTEST_(hr = m_pIDBProperties->SetProperties(cPropSets, rgPropSets),S_OK);
00188     TRACE_METHOD(hr, L"IDBProperties::SetProperties(%d, 0x%p)", cPropSets, rgPropSets);
00189
00190     //Display any property errors...
00191     TESTC(hr = DisplayPropErrors(hr, cPropSets, rgPropSets));
00192   }
00193
00194 CLEANUP:
00195   return hr;
00196 }
00197
00198
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CClassFactoryWrapper Member List

This is the complete list of members for CClassFactoryWrapper, including all inherited members.
CClassFactoryWrapper(REFCLSID rclsid) | CClassFactoryWrapper |
CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppv) | CClassFactoryWrapper |
CSurrogate class | CClassFactoryWrapper | [friend]
DisconnectObject(DWORD dwReserved) | CClassFactoryWrapper |
GetMarshalSizeMax(REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, DWORD *pSize) | CClassFactoryWrapper |
GetUnmarshalClass(REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *pCid) | CClassFactoryWrapper |
LockServer(BOOL fLock) | CClassFactoryWrapper |
m_clsid | CClassFactoryWrapper | [private]
m_cRef | CClassFactoryWrapper | [private]
m_dwReg | CClassFactoryWrapper | [private]
MarshalInterface(IStream *pStm, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags) | CClassFactoryWrapper |
QueryInterface(REFIID iid, LPVOID *ppv) | CClassFactoryWrapper |
ReleaseMarshalData(IStream *pStm) | CClassFactoryWrapper |
STDMETHOD_(ULONG, AddRef)() | CClassFactoryWrapper |
STDMETHOD_(ULONG, Release)() | CClassFactoryWrapper |
UnmarshalInterface(IStream *pStm, REFIID riid, void **ppv) | CClassFactoryWrapper |
~CClassFactoryWrapper() | CClassFactoryWrapper | [virtual]
Generated on Wed Nov 13 2024 16:55:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqTrans/MqTrans.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqTrans

MqTrans.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012             ////////////////////////////////////
00013             //                                //
00014             // Transaction Sample Application //
00015             //                                //
00016             ////////////////////////////////////
00017
00018
00019 #define UNICODE                     // For all MSMQ applications
00020
00021 #include <stdio.h>
00022
00023
00024 //------------------------------------------------------------------------------
00025 // Include MS DTC-specific header files.
00026
00027 //------------------------------------------------------------------------------
00028 #define INITGUID
00029 #include <transact.h>
00030
00031 // Because we are compiling in UNICODE, there is a problem with DTC.
00032 //#include <xolehlp.h>
00033 extern HRESULT DtcGetTransactionManager(
00034                                     LPSTR  pszHost,
00035                                     LPSTR   pszTmName,
00036                                     REFIID rid,
00037                                     DWORD   dwReserved1,
00038                                     WORD    wcbReserved2,
00039                                     void FAR * pvReserved2,
00040                                     void** ppvObject )  ;
00041
00042 //------------------------------------------------------------------------------
00043 // Include the ODBC-specific header file.
00044 //------------------------------------------------------------------------------
00045 #ifndef DBNTWIN32
00046 #define DBNTWIN32
00047
00048 #include <SQLEXT.h>
00049
00050 // from  <odbcss.h>
00051 #define SQL_COPT_SS_BASE               1200
00052 #define SQL_COPT_SS_ENLIST_IN_DTC      (SQL_COPT_SS_BASE+7) // Enlist in a Viper transaction
00053
00054 // Define constant for use with SQL_ENLIST_IN_DTC.
00055 #define SQL_DTC_DONE 0L       // Delimits end of Viper transaction
00056
00057 #endif
00058
00059 //--------------------------------------------------------------------------
00060 //  Enable Ansi ODBC on VC5.
00061 //--------------------------------------------------------------------------
00062
00063 #ifdef  SQLExecDirect
00064 #undef  SQLExecDirect
00065 #define SQLExecDirect SQLExecDirectA
00066 #endif
00067
00068 #ifdef  SQLSetConnectOption
00069 #undef  SQLSetConnectOption
00070 #define SQLSetConnectOption  SQLSetConnectOptionA
00071 #endif
00072
00073 #ifdef  SQLError
00074 #undef  SQLError
00075 #define SQLError  SQLErrorA
00076 #endif
00077
00078 #ifdef  SQLConnect
00079 #undef  SQLConnect
00080 #define SQLConnect  SQLConnectA
00081 #endif
00082
00083 //------------------------------------------------------------------------------
00084 // Include the MSMQ-specific header file.
00085 //------------------------------------------------------------------------------
00086 #include "mq.h"
00087
00088 //------------------------------------------------------------------------------
00089 // Define constants
00090 //------------------------------------------------------------------------------
00091 #define STR_LEN      40
00092 #define MAX_VAR      20
00093 #define MAX_FORMAT  100
00094
00095
00096 //------------------------------------------------------------------------------
00097 // Define datatypes
00098 //------------------------------------------------------------------------------
00099 typedef struct DBCONN
00100 {
00101    char  pszSrv [STR_LEN];    // Data source name, configured through control panel
00102    char  pszUser [STR_LEN];   // Logon user name
00103    char  pszPasswd[STR_LEN];  // Logon user password
00104    HDBC  hdbc;                // Handle to an ODBC database connection
00105    HSTMT hstmt;               // ODBC statement handle, for use with SQLExecDirect
00106
00107 }  DBCONN;
00108
00109
00110 //------------------------------------------------------------------------------
00111 // Define globals
00112 //------------------------------------------------------------------------------
00113
00114 // Global DB connection structure for the server
00115 static DBCONN  gSrv =
00116    {  "MSMQDemo",
00117       "sa",
00118       "",
00119       SQL_NULL_HDBC,
00120       SQL_NULL_HSTMT
00121    };
00122
00123
00124 // Service type GUID type for MQTransTest queues
00125 static CLSID guidMQTransTestType =
00126 { 0xb856ab1, 0x16b6, 0x11d0, { 0x80, 0x48, 0x0, 0xa0, 0x24, 0x53, 0xc1, 0x6f } };
00127
00128
00129 // Handle to ODBC environment
00130 HENV  g_hEnv = SQL_NULL_HENV ;
00131
00132
00133 // Buffer for computer name
00134 WCHAR g_wszMachineName[ MAX_COMPUTERNAME_LENGTH + 1 ];
00135
00136
00137 //--------------------------------------------------------------------------
00138 // Forward declaration of routines used.
00139 //--------------------------------------------------------------------------
00140
00141 void LogonToDB(DBCONN *ptr);
00142 void ExecuteStatement(DBCONN *ptr, char* pszBuf, BOOL ProcessFlag);
00143 BOOL ProcessRetCode(char*   pszFuncName,
00144                     DBCONN  *ptr,
00145                     RETCODE retcode,
00146                     BOOL    fExit = TRUE);
00147 void DoSQLError(DBCONN *ptr);
00148 void FreeODBCHandles(DBCONN *ptr);
00149 void Error(char *s, HRESULT hr);
00150 void Syntax();
00151 void LocateTargetQueue(CLSID *pGuidType, WCHAR wsFormat[MAX_FORMAT]);
00152 void PrepareSendMessageProperties(MSGPROPID     amPropId[MAX_VAR],
00153                           MQPROPVARIANT aPropVar[MAX_VAR],
00154                           MQMSGPROPS    &msgprops,
00155                           DWORD        &TransferSum);
00156 void CreateQueue(CLSID *pGuidType, WCHAR wsFormat[]);
00157 void GetMachineName();
00158 void DisplayDollars (DBCONN *ptr, char *psAccount);
00159
00160
00161 //------------------------------------------------------------------------------
00162 // Sender Mode:
00163 //
00164 // The sender side does the following:
00165 //   1. Creates the "SenderAccount" database.
00166 //   2. Locates an MSMQ queue of type MQTransTest and opens it.
00167 //       (NOTE: For simplicity, this sample assumes that there is only one queue of this type.)
00168 //   3. In a loop:
00169 //            Prompts the user to enter TransferSum.
00170 //            Creates a transaction using MS DTC.
00171 //            Within the transaction:
00172 //                 Updates the "SenderAccount" database (subtracts TransferSum).
00173 //                 Sends a message to the receiver side.
00174 //            Commits the transaction.
00175 //
00176 //    4. Cleans up.
00177 //
00178 //
00179 //
00180 // The transaction in Sender mode includes two operations:
00181 // (1) Updating the "SenderAccount" database (subtracting TransferSum).
00182 // (2) Sending a message to the receiver side.
00183 //------------------------------------------------------------------------------
00184
00185 void Sender()
00186 {
00187
00188    ITransactionDispenser   *pTransactionDispenser;
00189    ITransaction            *pTransaction;
00190    BOOL                    fTransactionCommitFlag;
00191                             // Used to decide whether to commit or abort
00192
00193    HRESULT              hr;
00194    RETCODE              retcode;
00195    DWORD                dwTransferSum;              // Set by the user
00196    char                 sUserString[ STR_LEN ];
00197    char                 sSQLStatement[ STR_LEN*2 ];
00198
00199    MQMSGPROPS           msgprops;
00200    MQPROPVARIANT        aPropVar[MAX_VAR];
00201    MSGPROPID            amPropId[MAX_VAR];
00202    WCHAR                wsFormat[MAX_FORMAT];
00203    QUEUEHANDLE          aqh;
00204
00205
00206     printf("\nSender Side.\n\n");
00207
00208    //---------------------------------------------------------------------
00209    // Build the "SenderAccount" database (with the sum of $1000)
00210    //---------------------------------------------------------------------
00211
00212    printf ("Building SenderAccount with the sum of $1000...\n");
00213
00214    // Get the ODBC environment handle.
00215    retcode = SQLAllocEnv(&g_hEnv);
00216
00217    ProcessRetCode("SQLAllocEnv",0, retcode);
00218
00219    // Establish a connection to the database.
00220    LogonToDB(&gSrv);
00221
00222    // Clear the database from the previous run.
00223    ExecuteStatement(&gSrv,"DROP TABLE SenderAccount",FALSE);
00224
00225    // Create a new table in the database.
00226    ExecuteStatement(&gSrv,
00227     "CREATE TABLE SenderAccount (Rate INTEGER CONSTRAINT c1 CHECK (Rate>=0))",TRUE);
00228
00229    // Insert new data into the database.
00230    ExecuteStatement(&gSrv,"INSERT INTO SenderAccount   VALUES(1000)",TRUE);
00231
00232    printf ("OK.\n\n");
00233
00234    //-----------------------------------------------------------------------
00235    // Locate the destination queue and open it for sending messages.
00236    //-----------------------------------------------------------------------
00237
00238    printf ("Searching for the receiver queue...\n");
00239
00240    // Locate the destination queue.
00241    LocateTargetQueue (&guidMQTransTestType, wsFormat);
00242
00243    // Open the destination queue.
00244    hr = MQOpenQueue(wsFormat, MQ_SEND_ACCESS, 0, &aqh);
00245
00246    if (FAILED(hr))
00247    {
00248       Error ("MQOpenQueue failed", hr);
00249    }
00250
00251    //--------------------------------------------------------------------------
00252    // Get the transaction dispenser.
00253    //--------------------------------------------------------------------------
00254
00255    // Obtain an interface pointer from the MS DTC proxy.
00256    hr = DtcGetTransactionManager(
00257                NULL,                        // pszHost
00258                NULL,                        // pszTmName
00259                IID_ITransactionDispenser,   // IID of interface
00260                0,                           // Reserved -- must be NULL
00261                0,                           // Reserved -- must be NULL
00262                0,                           // Reserved -- must be NULL
00263                (void **)&pTransactionDispenser  // Pointer to pointer to requested interface
00264                                  );
00265
00266    if (FAILED(hr))
00267    {
00268       Error ("DTCGetTransactionManager failed", hr);
00269    }
00270
00271    //--------------------------------------------------------------------
00272    // Sender's main loop
00273    //--------------------------------------------------------------------
00274    while (TRUE)
00275    {
00276
00277     // Prompt user to enter a value for TransferSum.
00278     printf ("\n\nPlease enter the sum of dollars to transfer, or '0' to quit  ==> ");
00279
00280     // Read the user input.
00281
00282     if (fgets (sUserString, STR_LEN - 1, stdin) == NULL)
00283     {
00284       printf("\nInvalid input was entered. Exiting...\n");
00285       exit(1);
00286     }
00287
00288     sUserString[STR_LEN - 1] = '\0';
00289
00290     //
00291     // Remove the final new-line character introduced by fgets.
00292     //
00293     if(sUserString[strlen(sUserString) - 1] == '\n')
00294     {
00295       sUserString[strlen(sUserString) - 1] = '\0';
00296     }
00297
00298       // Convert the user string to a DWORD
00299       dwTransferSum = atoi(sUserString);
00300
00301       // Prepare message properties to sending a message.
00302       PrepareSendMessageProperties (amPropId,
00303                                     aPropVar,
00304                                     msgprops,
00305                                     dwTransferSum);
00306
00307       //---------------------------------------------------------------------
00308       // Create a transaction (within the sender's main loop).
00309       //---------------------------------------------------------------------
00310
00311       printf ("\nStarting a transaction...\n\n");
00312
00313       // Initiate an MS DTC transaction.
00314       hr = pTransactionDispenser->BeginTransaction (
00315             0,                         // Must be null
00316             ISOLATIONLEVEL_ISOLATED,   // Isolation level
00317             ISOFLAG_RETAIN_DONTCARE,   // Isolation flags
00318             0,                         // Pointer to transaction options object
00319             &pTransaction);            // Pointer to pointer to transaction object
00320
00321       if (FAILED(hr))
00322       {
00323          Error ("BeginTransaction failed",hr);
00324       }
00325
00326       // The default is to commit the transaction.
00327       fTransactionCommitFlag = TRUE;
00328
00329       //
00330       // SQL is a resource manager in the transaction.
00331       // It must be enlisted.
00332       //
00333
00334       // Enlist the database in the transaction.
00335       retcode = SQLSetConnectOption (gSrv.hdbc,
00336                                      SQL_COPT_SS_ENLIST_IN_DTC,
00337                                      (UDWORD)pTransaction);
00338
00339       if (retcode != SQL_SUCCESS)
00340       {
00341          ProcessRetCode("SQLSetConnection", &gSrv, retcode, FALSE);
00342          fTransactionCommitFlag = FALSE;
00343       }
00344
00345
00346       // Prepare an SQL statement for updating SenderAccount.
00347       sprintf (sSQLStatement,
00348                "UPDATE SenderAccount  SET Rate = Rate - %lu", dwTransferSum) ;
00349
00350       // Allocate a statement handle for use with SQLExecDirect.
00351       retcode = SQLAllocStmt(gSrv.hdbc, &gSrv.hstmt);
00352
00353       if (retcode != SQL_SUCCESS)
00354       {
00355          ProcessRetCode("SQLAllocStmt", &gSrv, retcode, FALSE);
00356          fTransactionCommitFlag = FALSE;
00357       }
00358
00359       // Update the database (subtract TransferSum from SenderAccount).
00360       retcode = SQLExecDirect (gSrv.hstmt,(UCHAR *) sSQLStatement, SQL_NTS);
00361
00362       if (retcode != SQL_SUCCESS)
00363       {
00364          ProcessRetCode("SQLExecDirect", &gSrv, retcode, FALSE);
00365          fTransactionCommitFlag = FALSE;
00366       }
00367
00368       // Free the statement handle.
00369       retcode = SQLFreeStmt(gSrv.hstmt, SQL_DROP);
00370
00371       gSrv.hstmt = SQL_NULL_HSTMT;
00372
00373       //
00374       // MSMQ is another resource manager in the transaction.
00375       // Its enlistment is implicit.
00376       //
00377
00378       // Within the transaction, send a message to the receiver side.
00379       hr = MQSendMessage(aqh,              // Handle to destination queue
00380                          &msgprops,        // pointer to MQMSGPROPS structure
00381                          pTransaction);    // pointer to Transaction Object
00382
00383
00384       if (FAILED(hr))
00385       {
00386          printf("\nMQSendMessage() failed. Error code: %lxh\n", (DWORD) hr);
00387          fTransactionCommitFlag = FALSE;
00388       }
00389
00390
00391       // Commit the transaction.
00392       if (fTransactionCommitFlag)
00393       {
00394          printf ("Committing the transaction...\n");
00395
00396          hr = pTransaction->Commit(0, 0, 0);
00397
00398          if (FAILED(hr))
00399             printf ("The transaction was aborted.\n\n");
00400          else
00401             printf ("The transaction was committed successfully.\n\n");
00402
00403       }
00404       else
00405       {
00406          printf ("Aborting the transaction...\n");
00407
00408          hr = pTransaction->Abort(0, 0, 0);
00409
00410          if (FAILED(hr))
00411             Error("The transaction was aborted", hr);
00412          else
00413             printf ("The transaction was aborted.\n\n");
00414       }
00415
00416       // Release the transaction.
00417       pTransaction->Release();
00418
00419       // End enlistment of the database.
00420       retcode = SQLSetConnectOption (gSrv.hdbc, SQL_COPT_SS_ENLIST_IN_DTC, SQL_DTC_DONE);
00421
00422       ProcessRetCode ("SQLSetConnectOption", &gSrv, retcode);
00423
00424       // Display the sum of dollars in SenderAccount.
00425       DisplayDollars (&gSrv, "SenderAccount");
00426
00427       // Quit the loop when nothing was transferred.
00428       if (dwTransferSum == 0)
00429          break;
00430    }
00431
00432    //--------------------------------------------------------------------------
00433    // Cleanup
00434    //--------------------------------------------------------------------------
00435
00436    // Release the transaction dispenser.
00437    pTransactionDispenser->Release();
00438
00439
00440    // Free the database.
00441    ExecuteStatement(&gSrv,"DROP TABLE SenderAccount",TRUE);
00442
00443
00444    // Free the ODBC handle.
00445    FreeODBCHandles(&gSrv);
00446
00447
00448    // Free the ODBC environment handle.
00449    retcode = SQLFreeEnv(g_hEnv);
00450
00451    if (retcode == SQL_ERROR)
00452       Error ("SQL FreeEnv ",0);
00453
00454
00455    // Free the MSMQ queue handle.
00456    MQCloseQueue(aqh);
00457
00458
00459    printf ("\n\nThe sender side completed.\n\n");
00460
00461 }
00462
00463
00464
00465
00466 //------------------------------------------------------------------------------
00467 // Receiver Mode:
00468 //
00469 // The receiver side does the following:
00470 //    1. Creates the "ReceiverAccount" database.
00471 //    2. Creates an MSMQ transactional public queue of type
00472 //       MQTransTest locally and opens it.
00473 //    3. In a loop:
00474 //            Creates a transaction using MS DTC.
00475 //            Within the transaction:
00476 //                 Receives a message from the queue (containing the value of TransferSum).
00477 //                 Updates the "ReceiverAccount" database (adds TransferSum).
00478 //            Commits the transaction.
00479 //    4. Cleans up.
00480 //
00481 //
00482 //
00483 // The transaction in the receiver mode includes two operations:
00484 // (1) Receiving a message (sent by the sender side) from the queue.
00485 // (2) Updating the "ReceiverAccount" database  (adding TransferSum).
00486 //------------------------------------------------------------------------------
00487
00488 void Receiver()
00489 {
00490    MSGPROPID            amPropId[MAX_VAR];
00491    MQMSGPROPS           msgprops;
00492    MQPROPVARIANT        aPropVar[MAX_VAR];
00493    DWORD             cProps;
00494    HRESULT              hr;
00495    WCHAR             wsFormat[MAX_FORMAT];
00496    QUEUEHANDLE          aqh;
00497
00498    ITransactionDispenser   *pTransactionDispenser;
00499    ITransaction         *pTransaction;
00500    BOOL              TransactionCommitFlag;  // Used to decide whether to commit or abort
00501
00502    RETCODE              retcode;
00503    DWORD             TransferSum;
00504
00505    DWORD             MessageBuffer;       // Message body containing TransferSum
00506    char              sSQLStatement[STR_LEN*2];
00507
00508
00509
00510
00511
00512    printf ("\nReceiver Side.\n\n");
00513
00514    //-----------------------------------------------------------------------
00515    // Build a "ReceiverAccount" database (with the sum of $500).
00516    //-----------------------------------------------------------------------
00517
00518    printf ("Building a ReceiverAccount with a sum of $500...\n");
00519
00520    // Get ODBC environment handle.
00521    retcode = SQLAllocEnv(&g_hEnv);
00522
00523    ProcessRetCode("SQLAllocEnv",0, retcode);
00524
00525    // Establish a connection to the database.
00526    LogonToDB(&gSrv);
00527
00528    // Clear the table from the previous run.
00529    ExecuteStatement(&gSrv,"DROP TABLE ReceiverAccount",FALSE);
00530
00531    // Create a new table.
00532    ExecuteStatement(&gSrv,"CREATE TABLE ReceiverAccount (Rate INTEGER CONSTRAINT c2 CHECK (Rate>0))",TRUE);
00533
00534    // Insert new data into the table.
00535    ExecuteStatement(&gSrv,"INSERT INTO ReceiverAccount  VALUES(500)",TRUE);
00536
00537    printf ("OK.\n\n");
00538
00539    //-----------------------------------------------------------------------
00540    // Create queue and open it for receiving messages.
00541    //-----------------------------------------------------------------------
00542
00543    printf ("Creating a receiver queue...\n");
00544
00545    // Create the queue.
00546    CreateQueue (&guidMQTransTestType, wsFormat);
00547
00548    // Prepare message properties for reading messages.
00549    cProps = 0;
00550
00551    amPropId[cProps] =             PROPID_M_BODY;
00552
00553    aPropVar[cProps].vt =          VT_UI1 | VT_VECTOR;
00554    aPropVar[cProps].caub.cElems =  sizeof(MessageBuffer);
00555    aPropVar[cProps].caub.pElems =  (unsigned char *)&MessageBuffer;
00556    cProps++;
00557
00558    // Create a MSGPROPS structure.
00559    msgprops.cProp =    cProps;
00560    msgprops.aPropID =  amPropId;
00561    msgprops.aPropVar = aPropVar;
00562    msgprops.aStatus =  0;
00563
00564    // Open the queue.
00565    hr = MQOpenQueue(wsFormat, MQ_RECEIVE_ACCESS, 0, &aqh);
00566
00567    //
00568    // Things are a little bit tricky. MQCreateQueue succeeded, but in the
00569    // case of a public queue, this does not mean that MQOpenQueue
00570    // will succeed, because replication delays are possible. The queue is
00571    // registered in the DS, but it might take a replication interval
00572    // until the replica reaches the server that I am connected to.
00573    // To overcome this, open the queue in a loop.
00574    //
00575    if (hr == MQ_ERROR_QUEUE_NOT_FOUND)
00576    {
00577        int iCount = 0 ;
00578        while((hr == MQ_ERROR_QUEUE_NOT_FOUND) && (iCount < 120))
00579        {
00580           printf(".");
00581
00582           // Wait a bit.
00583           iCount++ ;
00584           Sleep(500);
00585
00586           // Retry.
00587           hr = MQOpenQueue(wsFormat, MQ_RECEIVE_ACCESS, 0, &aqh);
00588        }
00589    }
00590
00591    if (FAILED(hr))
00592    {
00593       Error ("MQOpenQueue failed", hr);
00594    }
00595
00596    printf("OK.");
00597
00598
00599    //--------------------------------------------------------------------------
00600    // Get the transaction dispenser.
00601    //--------------------------------------------------------------------------
00602
00603    // Obtain an interface pointer from the MS DTC proxy.
00604    hr = DtcGetTransactionManager(
00605          NULL, NULL, // pszHost, pszTmName
00606          IID_ITransactionDispenser,         // IID of the requested interface
00607          0,0,0,                             // Reserved -- must be NULL
00608          (void **)&pTransactionDispenser);  // Pointer to pointer to the requested interface
00609
00610
00611    if (FAILED(hr))
00612       Error ("DTCGetTransactionManager failed", hr);
00613
00614
00615    //--------------------------------------------------------------------------
00616    // Receiver Main Loop
00617    //--------------------------------------------------------------------------
00618    while (TRUE)
00619    {
00620
00621       printf ("\n\nWaiting for a message to come...\n");
00622
00623       // Peek outside the transaction to avoid database lock
00624       // for a long/infinite period.
00625       //
00626       //dwSize = sizeof(wsResponse);
00627       hr = MQReceiveMessage(
00628                     aqh,                     // Handle to queue
00629                     INFINITE,                // Time-out
00630                     MQ_ACTION_PEEK_CURRENT,  // Peek action
00631                     &msgprops,               // Message properties
00632                     NULL,                    // No OVERLAPPED structure
00633                     NULL,                    // No callback function
00634                     NULL,                    // No cursor
00635                     NULL                     // No transaction yet
00636                            );
00637
00638       if (FAILED(hr))
00639          Error("MQReceiveMessage (PEEKING) failed", hr);
00640
00641
00642
00643       //--------------------------------------------------------------------------
00644       // Create a transaction.
00645       //--------------------------------------------------------------------------
00646       printf ("\n\nStarting a transaction...\n\n");
00647
00648
00649       // Initiate an MS DTC transaction.
00650       hr = pTransactionDispenser->BeginTransaction (
00651             0,                               // Must be NULL
00652             ISOLATIONLEVEL_ISOLATED,         // Isolation level
00653             ISOFLAG_RETAIN_DONTCARE,         // Isolation flags
00654             0,                               // Pointer to transaction options object
00655             &pTransaction);                  // Pointer to pointer to transaction object
00656
00657       if (FAILED(hr))
00658          Error ("BeginTransaction failed", hr);
00659
00660
00661       // The default is to commit the transaction.
00662       TransactionCommitFlag = TRUE;
00663
00664       //
00665       // SQL is a resource manager in the transaction.
00666       // It must be enlisted.
00667       //
00668
00669       // Enlist the database in the transaction.
00670       retcode = SQLSetConnectOption (gSrv.hdbc, SQL_COPT_SS_ENLIST_IN_DTC, (UDWORD)pTransaction);
00671
00672       if (retcode != SQL_SUCCESS)
00673          TransactionCommitFlag = FALSE;
00674
00675
00676
00677       // Receive a message from the queue
00678       //dwSize = sizeof(wsResponse);
00679       hr = MQReceiveMessage(
00680             aqh,                              // Handle to queue
00681             INFINITE,                         // Time-out interval
00682             MQ_ACTION_RECEIVE,                // Receive action
00683             &msgprops,                        // Message properties
00684             NULL,NULL,NULL,                   // No OVERLAPPED structure, callback function, or cursor
00685             pTransaction);                    // Pointer to transaction object
00686
00687       if (FAILED(hr))
00688          TransactionCommitFlag = FALSE;
00689
00690
00691       // The message buffer holds TransferSum.
00692       TransferSum = (DWORD)MessageBuffer;
00693
00694
00695       // Prepare an SQL statement to update ReceiverAccount.
00696       sprintf (sSQLStatement, "UPDATE ReceiverAccount   SET Rate = Rate + %i", TransferSum);
00697
00698
00699       // Allocate a statement handle for use with SQLExecDirect.
00700       retcode = SQLAllocStmt(gSrv.hdbc,&gSrv.hstmt);
00701
00702       if (retcode != SQL_SUCCESS)
00703          TransactionCommitFlag = FALSE;
00704
00705
00706       // Update the database (add TransferSum to ReceiverAccount).
00707       retcode = SQLExecDirect (gSrv.hstmt,(UCHAR *) sSQLStatement, SQL_NTS);
00708
00709       if (retcode != SQL_SUCCESS)
00710          TransactionCommitFlag = FALSE;
00711
00712
00713       // Free the statement handle.
00714       retcode = SQLFreeStmt(gSrv.hstmt, SQL_DROP);
00715
00716       gSrv.hstmt = SQL_NULL_HSTMT;
00717
00718
00719
00720       // Commit the transaction.
00721       if (TransactionCommitFlag)
00722       {
00723          printf ("Committing the transaction...   ");
00724
00725          hr = pTransaction->Commit(0, 0, 0);
00726
00727          if (FAILED(hr))
00728             printf ("Failed... The transaction was aborted.\n\n");
00729          else
00730             printf ("The transaction was committed successfully.\n\n");
00731
00732       }
00733
00734
00735       // Abort the transaction.
00736       else
00737       {
00738          printf ("Aborting the transaction...\n");
00739
00740          hr = pTransaction->Abort(0, 0, 0);
00741
00742          if (FAILED(hr))
00743             Error("The transaction was aborted", hr);
00744          else
00745             printf ("The transaction was aborted.\n\n");
00746
00747       }
00748
00749
00750
00751       // Release the transaction.
00752       pTransaction->Release();
00753
00754
00755       // End the enlistment of the database.
00756       retcode = SQLSetConnectOption (gSrv.hdbc, SQL_COPT_SS_ENLIST_IN_DTC, SQL_DTC_DONE);
00757
00758       ProcessRetCode ("SQLSetConnectOption", &gSrv, retcode);
00759
00760
00761       // Display the number of dollars in ReceiverAccount.
00762       DisplayDollars (&gSrv, "ReceiverAccount");
00763
00764
00765       // Decide whether to continue the loop.
00766       if (TransferSum == 0)
00767          break;
00768
00769
00770    }
00771
00772
00773    //--------------------------------------------------------------------------
00774    // Cleanup
00775    //--------------------------------------------------------------------------
00776
00777    // Release the transaction dispenser.
00778    pTransactionDispenser->Release();
00779
00780
00781    // Free the database.
00782    ExecuteStatement(&gSrv,"DROP TABLE ReceiverAccount",TRUE);
00783
00784
00785    // Free the ODBC handle.
00786    FreeODBCHandles(&gSrv);
00787
00788
00789    // Free the ODBC environment handle.
00790    retcode = SQLFreeEnv(g_hEnv);
00791
00792    if (retcode == SQL_ERROR)
00793       Error ("SQL FreeEnv ",0);
00794
00795
00796    // Free the queue handle.
00797     MQCloseQueue(aqh);
00798
00799
00800    // Delete the queue from the directory service.
00801    MQDeleteQueue(wsFormat);
00802
00803
00804    printf ("\n\nReceiver side completed.\n\n");
00805 }
00806
00807 /*
00808 //-----------------------------------------------------
00809 // Check if teh local computer is enabled to access the
00810 // directory service (DS-enabled).
00811 //-----------------------------------------------------
00812 bool DetectDsConnection(void)
00813 {
00814
00815     MQPRIVATEPROPS PrivateProps;
00816     QMPROPID       aPropId[MAX_VAR];
00817     MQPROPVARIANT  aPropVar[MAX_VAR];
00818     HRESULT        aStatus[MAX_VAR];
00819     DWORD          cProp;
00820
00821     HRESULT        hr;
00822
00823     //
00824     // Specify the PROPID_PC_DS_ENABLED property, which
00825   // indicates whether the local computer can access the DS.
00826   //
00827     cProp = 0;
00828
00829     aPropId[cProp] = PROPID_PC_DS_ENABLED;
00830     aPropVar[cProp].vt = VT_NULL;
00831     ++cProp;
00832
00833     // Create a PRIVATEPROPS structure.
00834     PrivateProps.cProp = cProp;
00835   PrivateProps.aPropID = aPropId;
00836   PrivateProps.aPropVar = aPropVar;
00837     PrivateProps.aStatus = aStatus;
00838
00839     //
00840     // Retrieve the information.
00841     //
00842   hr = MQGetPrivateComputerInformation(
00843              NULL,
00844            &PrivateProps);
00845   if(FAILED(hr))
00846         Error("A DS connection cannot be detected", hr);
00847
00848     return PrivateProps.aPropVar[0].boolVal;
00849 }
00850 */
00851 BOOL IsDsEnabledLocaly()
00852 /*++
00853
00854 Routine Description:
00855
00856       The routine checks whether the local computer operates in
00857       domain (DS-enabled) mode or in workgroup (DS-disabled) mode.
00858
00859 Arguments:
00860
00861       None
00862
00863 Return Value:
00864
00865       TRUE     -  domain (DS-enabled) mode.
00866       FALSE    -  workgroup (DS-disabled) mode.
00867
00868 --*/
00869
00870 {
00871
00872     MQPRIVATEPROPS PrivateProps;
00873     QMPROPID       aPropId[MAX_VAR];
00874     MQPROPVARIANT  aPropVar[MAX_VAR];
00875     DWORD          cProp;
00876     HRESULT        hr;
00877     //
00878     // Specify the PROPID_PC_DS_ENABLED property, which
00879   // indicates whether the local computer can access the DS.
00880     //
00881     cProp = 0;
00882
00883     aPropId[cProp] = PROPID_PC_DS_ENABLED;
00884     aPropVar[cProp].vt = VT_NULL;
00885     ++cProp;
00886     //
00887     // Create a PRIVATEPROPS structure.
00888     //
00889     PrivateProps.cProp = cProp;
00890   PrivateProps.aPropID = aPropId;
00891   PrivateProps.aPropVar = aPropVar;
00892     PrivateProps.aStatus = NULL;
00893
00894     //
00895     // Retrieve the information.
00896     //
00897
00898
00899     //
00900     // This code is used to detect a DS connection.
00901     // This code is designed to allow compilation both on
00902     // Windows NT 4.0 and on Windows 2000 and later.
00903     //
00904     HINSTANCE hMqrtLibrary = GetModuleHandle(TEXT("mqrt.dll"));
00905   if(hMqrtLibrary == NULL)
00906   {
00907     printf("An incomplete installation of MSMQ was detected. Exiting...\n");
00908     exit(1);
00909   }
00910
00911     typedef HRESULT (APIENTRY *MQGetPrivateComputerInformation_ROUTINE)(LPCWSTR , MQPRIVATEPROPS*);
00912     MQGetPrivateComputerInformation_ROUTINE pfMQGetPrivateComputerInformation =
00913           (MQGetPrivateComputerInformation_ROUTINE)GetProcAddress(hMqrtLibrary,
00914                            "MQGetPrivateComputerInformation");
00915     if(pfMQGetPrivateComputerInformation == NULL)
00916     {
00917         //
00918         // There is no entry point in the DLL that matches this routine.
00919         // It must be an old version of mqrt.dll (MSMQ 1.0).
00920         // It will be OK to handle this case as the case of DS-enabled computer.
00921         //
00922         return TRUE;
00923     }
00924
00925   hr = pfMQGetPrivateComputerInformation(
00926              NULL,
00927            &PrivateProps);
00928   if(FAILED(hr))
00929   {
00930         //
00931         // We were not able to determine whether the computer is DS-enabled or DS-disabled.
00932         // Notify the user and assume the worst case (i.e., the computer is DS-disasbled).
00933         //
00934         Error("No DS connection could be detected", hr);
00935         return FALSE;
00936     }
00937
00938
00939     if(PrivateProps.aPropVar[0].boolVal == 0)
00940     {
00941         //
00942         // DS-disabled.
00943         //
00944         return FALSE;
00945     }
00946
00947     return TRUE;
00948
00949 }
00950
00951
00952
00953 //------------------------------------------------------------------------------
00954 //  MAIN
00955 //------------------------------------------------------------------------------
00956 main(int argc, char *argv[])
00957 {
00958    DWORD dwSize;
00959
00960     if(argc != 2)
00961         Syntax();
00962
00963     // Fail if the local computer is DS-disabled.
00964     if(!IsDsEnabledLocaly())
00965     {
00966         printf("We cannot work on a DS-disabled computer.\nExiting...");
00967         exit(1);
00968     }
00969
00970
00971     // Retrieve computer name.
00972     dwSize = MAX_COMPUTERNAME_LENGTH;
00973   if(!GetComputerName(g_wszMachineName, &dwSize))
00974   {
00975     printf("The computer name cannot be retrieved.\nExiting...");
00976         exit(1);
00977   }
00978
00979     if(strcmp(argv[1], "-s") == 0)
00980         Sender();
00981
00982     else if(strcmp(argv[1], "-r") == 0)
00983         Receiver();
00984
00985     else
00986         Syntax();
00987
00988     return(1);
00989
00990 }
00991
00992
00993
00994 //------------------------------------------------------------------------------
00995 // Subroutines
00996 //------------------------------------------------------------------------------
00997
00998 void Error(char *s, HRESULT hr)
00999 {
01000
01001     printf("\n\n%s (0x%X). Exiting...\n", s, hr);
01002     exit(1);
01003 }
01004
01005 //------------------------------------------------------------------------------
01006
01007 void Syntax()
01008 {
01009     printf("\n");
01010     printf("Syntax: msmqtrans -s | -r\n");
01011     printf("\t-s - Sender Side\n");
01012     printf("\t-r - Receiver Side\n");
01013     exit(1);
01014
01015 }
01016
01017 //------------------------------------------------------------------------------
01018
01019 void LocateTargetQueue (CLSID *pGuidType, WCHAR wsFormat[MAX_FORMAT])
01020 {
01021
01022    DWORD      dwSize;
01023    DWORD      i;
01024
01025    DWORD      cQueue;
01026    DWORD      cProps;
01027    HRESULT       hr;
01028    MQPROPERTYRESTRICTION   aPropRestriction[MAX_VAR];
01029    MQRESTRICTION        Restriction;
01030    MQCOLUMNSET          Column;
01031    QUEUEPROPID          aqPropId[MAX_VAR];
01032    HANDLE               hEnum;
01033    MQPROPVARIANT        aPropVar[MAX_VAR];
01034
01035     //
01036     // Prepare parameters for locating queues.
01037     //
01038     //
01039     // 1. Restriction: Queues with PROPID_Q_TYPE = MSMQTransTest service type GUIID
01040     //
01041     cProps = 0;
01042
01043     aPropRestriction[cProps].rel = PREQ;
01044     aPropRestriction[cProps].prop = PROPID_Q_TYPE;
01045     aPropRestriction[cProps].prval.vt = VT_CLSID;
01046     aPropRestriction[cProps].prval.puuid = pGuidType;
01047     cProps++;
01048
01049     Restriction.cRes = cProps;
01050     Restriction.paPropRes = aPropRestriction;
01051
01052     //
01053     // 2. Columnset (the queue properties to retrieve) = queue GUID
01054     //
01055     cProps = 0;
01056     aqPropId[cProps] = PROPID_Q_INSTANCE;
01057     cProps++;
01058
01059     Column.cCol = cProps;
01060     Column.aCol = aqPropId;
01061
01062     //
01063     // Issue the query to locate the queues.
01064     //
01065     hr = MQLocateBegin(NULL, &Restriction, &Column, NULL, &hEnum);
01066
01067    if (FAILED(hr))
01068       Error ("MQLocateBegin failed", hr);
01069
01070
01071     //
01072     // Get the results.
01073     //
01074     cQueue = MAX_VAR;
01075     hr = MQLocateNext(hEnum, &cQueue, aPropVar);
01076
01077    if (FAILED(hr))
01078       Error ("MQLocateNext failed", hr);
01079
01080     hr = MQLocateEnd(hEnum);
01081
01082     if(cQueue == 0)
01083     {
01084         // No queue could be found, so exit
01085         printf("No queue was found. Exiting...\n\n");
01086         exit(0);
01087     }
01088
01089
01090     printf("FOUND %d.\n", cQueue);
01091
01092     dwSize = sizeof(WCHAR)*MAX_FORMAT;
01093
01094    // Transform the queue GUID into a format name.
01095    hr = MQInstanceToFormatName(aPropVar[0].puuid, wsFormat, &dwSize);
01096
01097    if (FAILED(hr))
01098       Error ("MQInstancetoFormatName failed", hr);
01099
01100
01101    // Free the memory that was allocated for the queue GUID during the query.
01102     for(i = 0; i < cQueue; i++)
01103       MQFreeMemory(aPropVar[i].puuid);
01104
01105
01106 }
01107
01108
01109 //------------------------------------------------------------------------------
01110
01111 void PrepareSendMessageProperties (MSGPROPID     amPropId[MAX_VAR],
01112                            MQPROPVARIANT aPropVar[MAX_VAR],
01113                            MQMSGPROPS    &msgprops,
01114                            DWORD     &TransferSum)
01115 {
01116
01117    DWORD      cProps;
01118
01119     cProps = 0;
01120     amPropId[cProps] =             PROPID_M_BODY;
01121     aPropVar[cProps].vt =          VT_UI1 | VT_VECTOR;
01122     aPropVar[cProps].caub.cElems =  sizeof(TransferSum);
01123     aPropVar[cProps].caub.pElems =  (unsigned char *)&TransferSum;
01124     cProps++;
01125
01126     // Create a MSGPROPS structure.
01127     msgprops.cProp =    cProps;
01128     msgprops.aPropID =  amPropId;
01129     msgprops.aPropVar = aPropVar;
01130     msgprops.aStatus =  0;
01131
01132 }
01133
01134 //--------------------------------------------------------------------------
01135
01136 void  CreateQueue (CLSID *pGuidType, WCHAR wsFormat[])
01137 {
01138    QUEUEPROPID       aqPropId[MAX_VAR];
01139    WCHAR             wsPathName[1000];  // Long path name
01140    MQPROPVARIANT     aPropVar[MAX_VAR];
01141    DWORD             cProps;
01142    MQQUEUEPROPS      qprops;
01143    DWORD             dwSize;
01144    HRESULT           hr;
01145
01146    //---------------------------------------------------------------------
01147    // Prepare properties to create a queue on the local computer.
01148    //---------------------------------------------------------------------
01149    cProps = 0;
01150
01151    // Set the path name property.
01152    aqPropId[cProps] =          PROPID_Q_PATHNAME;
01153
01154    wsprintf(wsPathName, TEXT("%s\\MSMQDemo"), g_wszMachineName);
01155    aPropVar[cProps].vt =       VT_LPWSTR;
01156    aPropVar[cProps].pwszVal =  wsPathName;
01157    cProps++;
01158
01159    // Set the transactional level of the queue to transactional.
01160    aqPropId[cProps] =        PROPID_Q_TRANSACTION;
01161
01162    aPropVar[cProps].vt =     VT_UI1;
01163    aPropVar[cProps].bVal =   MQ_TRANSACTIONAL;
01164    cProps++;
01165
01166    // Set the service type GUID of the queue (used to locate queues in a query).
01167    aqPropId[cProps] =        PROPID_Q_TYPE;
01168
01169    aPropVar[cProps].vt =     VT_CLSID;
01170    aPropVar[cProps].puuid =  pGuidType;
01171    cProps++;
01172
01173    // Create a QUEUEPROPS structure.
01174    qprops.cProp =    cProps;
01175    qprops.aPropID =  aqPropId;
01176    qprops.aPropVar = aPropVar;
01177    qprops.aStatus =  0;
01178
01179    //-----------------------------------------------------------------------
01180    // Create the queue.
01181    //-----------------------------------------------------------------------
01182    dwSize = sizeof(WCHAR)*MAX_FORMAT;
01183    hr = MQCreateQueue(NULL, &qprops, wsFormat, &dwSize);
01184
01185    if(FAILED(hr))
01186    {
01187       // The API failed, but not because the queue exists.
01188       if(hr != MQ_ERROR_QUEUE_EXISTS)
01189             Error("MQCreateQueue failed", hr);
01190
01191       // The queue exists, so get its format name.
01192       // Note: Because the queue already exists, this sample assumes
01193       // that it was created earlier by this program, so we do not
01194       // check whether the queue is transactional. If at this point the
01195       // queue is not transactional, the transactions will abort later.
01196       //
01197       hr = MQPathNameToFormatName(wsPathName, wsFormat, &dwSize);
01198
01199       if (FAILED(hr))
01200          Error ("The format name cannot be retrieved", hr);
01201    }
01202 }
01203
01204 //-------------------------------------------------------------------------------
01205
01206 void LogonToDB(DBCONN *ptr)
01207 {
01208    RETCODE retcode = 0;
01209
01210    retcode = SQLAllocConnect(g_hEnv, &(ptr->hdbc) );
01211
01212    if (ProcessRetCode("SQLAllocConnect",ptr,retcode))
01213    {
01214       retcode = SQLConnect(ptr->hdbc,
01215                   (UCHAR *)(ptr->pszSrv),
01216                   SQL_NTS,
01217                   (UCHAR *)(ptr->pszUser),
01218                   SQL_NTS,
01219                   (UCHAR *)(ptr->pszPasswd),
01220                   SQL_NTS
01221                   );
01222
01223       ProcessRetCode("SQLConnect",ptr,retcode);
01224    }
01225 }
01226
01227 //------------------------------------------------------------------------------
01228
01229 void ExecuteStatement(DBCONN *ptr, char* pszBuf,BOOL ProcessFlag)
01230 {
01231    RETCODE retcode = 0;
01232
01233    // Allocate a statement handle for use with SQLExecDirect.
01234    retcode = SQLAllocStmt(ptr->hdbc,&(ptr->hstmt));
01235
01236    if (ProcessFlag)
01237       ProcessRetCode("SQLAllocStmt",ptr,retcode);
01238
01239    // Execute the string passed as a SQL statement.
01240     retcode = SQLExecDirect (ptr->hstmt,(UCHAR *) pszBuf,SQL_NTS);
01241
01242    if (ProcessFlag)
01243       ProcessRetCode("SQLExecDirect",ptr,retcode);
01244
01245    // Free the statement handle.
01246    retcode = SQLFreeStmt(ptr->hstmt, SQL_DROP);
01247    ptr->hstmt = SQL_NULL_HSTMT;
01248
01249    if (ProcessFlag)
01250       ProcessRetCode("SQLFreeStmt",ptr,retcode);
01251
01252 }
01253
01254 // ---------------------------------------------------------------------------
01255
01256 void DisplayDollars (DBCONN *ptr, char *psAccount)
01257 {
01258
01259    DWORD             DollarsSum;                  // IN SQL database
01260    SDWORD               cbValue;                  // OUT argument for SQL query
01261    char              sSQLStatement[STR_LEN*2];
01262    RETCODE              retcode;
01263
01264
01265
01266
01267    // Allocate a statement handle for use with SQLExecDirect.
01268    retcode = SQLAllocStmt(ptr->hdbc,&(ptr->hstmt));
01269
01270    ProcessRetCode("SQLAllocStmt",ptr,retcode);
01271
01272
01273    // Prepare SQL statement for issuing a query.
01274    int n = _snprintf(sSQLStatement, STR_LEN*2 -1, "SELECT * FROM %s", psAccount);
01275    if(n < 0)
01276    {
01277     printf("The string is too long for the buffer specified. Exiting...\n");
01278     exit(1);
01279    }
01280    sSQLStatement[n] = L'\0';
01281
01282
01283
01284    // Issue the SQL query.
01285    retcode = SQLExecDirect (ptr->hstmt,(UCHAR *)sSQLStatement,SQL_NTS);
01286
01287    ProcessRetCode ("SQLExecDirect",ptr,retcode);
01288
01289
01290    // Prepare a data structure for retrieving the query results.
01291    retcode = SQLBindCol(ptr->hstmt,1,SQL_C_ULONG,&DollarsSum,0,(SQLLEN *)&cbValue);
01292
01293    ProcessRetCode ("SQLBindCol",ptr,retcode);
01294
01295
01296    // Retrieve the query results.
01297    retcode = SQLFetch (ptr->hstmt);
01298
01299    ProcessRetCode ("SQLFetch",ptr,retcode);
01300
01301
01302    // Display the query results.
01303    printf ("Sum of dollars in %s is %d .\n\n",psAccount,DollarsSum);
01304
01305
01306    // Free the statement handle.
01307    retcode = SQLFreeStmt(ptr->hstmt, SQL_DROP);
01308    ptr->hstmt = SQL_NULL_HSTMT;
01309
01310    ProcessRetCode("SQLFreeStmt",ptr,retcode);
01311
01312 }
01313
01314 // ---------------------------------------------------------------------------
01315
01316 void FreeODBCHandles(DBCONN *ptr)
01317 {
01318    SQLDisconnect(ptr->hdbc);
01319
01320    SQLFreeConnect(ptr->hdbc);
01321
01322    ptr->hdbc   = SQL_NULL_HDBC;
01323    ptr->hstmt  = SQL_NULL_HSTMT;
01324 }
01325
01326
01327 // ---------------------------------------------------------------------------
01328
01329 BOOL ProcessRetCode(char*   pszFuncName,
01330                     DBCONN  *ptr,
01331                     RETCODE retcode,
01332                     BOOL    fExit)
01333 {
01334    BOOL state = TRUE ;
01335    BOOL fExitP = fExit ;
01336
01337    switch (retcode)
01338    {
01339
01340    case SQL_SUCCESS:
01341          fExitP = FALSE ;
01342          break;
01343
01344    case SQL_SUCCESS_WITH_INFO:
01345          fExitP = FALSE ;
01346          break;
01347
01348    case SQL_ERROR:
01349          printf("%s failed - see more info\n",pszFuncName);
01350          DoSQLError(ptr);
01351          state = FALSE;
01352          break;
01353
01354    case SQL_INVALID_HANDLE:
01355          printf("%s failed - SQL_INVALID_HANDLE\n",pszFuncName);
01356          state = FALSE;
01357          break;
01358
01359    case SQL_NO_DATA_FOUND:
01360          printf("%s failed - SQL_NO_DATA_FOUND\n",pszFuncName);
01361          fExitP = FALSE ;
01362          state = FALSE;
01363          break;
01364
01365    case SQL_STILL_EXECUTING:
01366          printf("%s failed - SQL_STILL_EXECUTING\n",pszFuncName);
01367          fExitP = FALSE ;
01368          state = FALSE;
01369          break;
01370
01371    case SQL_NEED_DATA:
01372          printf("%s failed - SQL_NEED_DATA\n",pszFuncName);
01373          fExitP = FALSE ;
01374          state = FALSE;
01375          break;
01376
01377    default:
01378          printf("%s failed - unexpected error, retcode = %x\n",pszFuncName,retcode);
01379          DoSQLError(ptr);
01380          state = FALSE;
01381          break;
01382    }
01383
01384    if (fExitP)
01385    {
01386       exit(-1) ;
01387    }
01388    return state ;
01389 }
01390
01391 // ---------------------------------------------------------------------------
01392
01393 void DoSQLError(DBCONN *ptr)
01394 {
01395    UCHAR                szSqlState[6];
01396    UCHAR             szErrorMsg[SQL_MAX_MESSAGE_LENGTH];
01397
01398    SQLINTEGER  fNativeError   = 0;
01399    SWORD    cbErrorMsg = 0;
01400    RETCODE     retcode;
01401
01402    retcode = SQLError(g_hEnv,
01403               ptr ? ptr->hdbc : 0,
01404               ptr ? ptr->hstmt :0,
01405               szSqlState,
01406               &fNativeError,
01407               szErrorMsg,
01408               sizeof(szErrorMsg),
01409               &cbErrorMsg
01410               );
01411
01412    if (retcode != SQL_NO_DATA_FOUND && retcode != SQL_ERROR)
01413    {
01414       if (fNativeError != 0x1645)   // ignore change database to master context message
01415       {
01416          printf("SQLError info:\n");
01417          printf("SqlState: %s, fNativeError: %x\n",szSqlState,fNativeError);
01418          printf("Error Message: %s\n\n",szErrorMsg);
01419       }
01420    }
01421    else
01422    {
01423       printf("SQLError() failed: %x, NO_DATA_FOUND OR SQL_ERROR\n",retcode);
01424    }
01425
01426 }
01427 // ---------------------------------------------------------------------------
01428
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/about.Cpp Source File

  • SysMgmt
  • MMC
  • Toolbar

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163         MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164         *lpDest = wszStr;
00165
00166
00167     return S_OK;
00168 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057
00058     if (*ppv)
00059     {
00060         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00061         return S_OK;
00062     }
00063
00064     return E_NOINTERFACE;
00065 }
00066
00067 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00068 {
00069     return InterlockedIncrement((LONG *)&m_cref);
00070 }
00071
00072 STDMETHODIMP_(ULONG) CComponentData::Release()
00073 {
00074     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00075     {
00076         // we need to decrement our object count in the DLL
00077         delete this;
00078         return 0;
00079     }
00080
00081     return m_cref;
00082 }
00083
00084 ///////////////////////////////
00085 // Interface IComponentData
00086 ///////////////////////////////
00087 HRESULT CComponentData::Initialize(
00088                                    /* [in] */ LPUNKNOWN pUnknown)
00089 {
00090     HRESULT      hr;
00091
00092     //
00093     // Get pointer to name space interface
00094     //
00095     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00096     _ASSERT( S_OK == hr );
00097
00098     //
00099     // Get pointer to console interface
00100     //
00101     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00102     _ASSERT( S_OK == hr );
00103
00104     IImageList *pImageList;
00105     m_ipConsole->QueryScopeImageList(&pImageList);
00106     _ASSERT( S_OK == hr );
00107
00108     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00109         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00110         0, // index of the first image in the strip
00111         RGB(0, 128, 128)  // color of the icon mask
00112         );
00113
00114     pImageList->Release();
00115
00116     return S_OK;
00117 }
00118
00119 HRESULT CComponentData::CreateComponent(
00120                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00121 {
00122     *ppComponent = NULL;
00123
00124     CComponent *pComponent = new CComponent(this);
00125
00126     if (NULL == pComponent)
00127         return E_OUTOFMEMORY;
00128
00129     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00130 }
00131
00132 HRESULT CComponentData::Notify(
00133                                /* [in] */ LPDATAOBJECT lpDataObject,
00134                                /* [in] */ MMC_NOTIFY_TYPE event,
00135                                /* [in] */ LPARAM arg,
00136                                /* [in] */ LPARAM param)
00137 {
00138     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00139
00140     HRESULT hr = S_FALSE;
00141
00142   //Get our data object. If it is NULL, we return with S_FALSE.
00143   //See implementation of GetOurDataObject() to see how to
00144   //handle special data objects.
00145   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00146   if (NULL == pDataObject)
00147     return S_FALSE;
00148
00149   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00150
00151     switch (event)
00152     {
00153     case MMCN_EXPAND:
00154         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00155         break;
00156
00157     case MMCN_ADD_IMAGES:
00158         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00159         break;
00160     }
00161
00162     return hr;
00163 }
00164
00165 HRESULT CComponentData::Destroy( void)
00166 {
00167     // Free interfaces
00168     if (m_ipConsoleNameSpace) {
00169         m_ipConsoleNameSpace->Release();
00170         m_ipConsoleNameSpace = NULL;
00171     }
00172
00173     if (m_ipConsole) {
00174         m_ipConsole->Release();
00175         m_ipConsole = NULL;
00176     }
00177
00178     return S_OK;
00179 }
00180
00181 HRESULT CComponentData::QueryDataObject(
00182                                         /* [in] */ MMC_COOKIE cookie,
00183                                         /* [in] */ DATA_OBJECT_TYPES type,
00184                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00185 {
00186     CDataObject *pObj = NULL;
00187
00188     if (cookie == 0)
00189         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00190     else
00191         pObj = new CDataObject(cookie, type);
00192
00193     if (!pObj)
00194         return E_OUTOFMEMORY;
00195
00196     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00197
00198     return S_OK;
00199 }
00200
00201 HRESULT CComponentData::GetDisplayInfo(
00202                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00203 {
00204     HRESULT hr = S_FALSE;
00205
00206     // if they are asking for the SDI_STR we have one of those to give
00207     if (pScopeDataItem->lParam) {
00208         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00209         if (pScopeDataItem->mask & SDI_STR) {
00210                         LPCTSTR pszT = base->GetDisplayName();
00211                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00212             pScopeDataItem->displayname = pszW;
00213         }
00214
00215         if (pScopeDataItem->mask & SDI_IMAGE) {
00216             pScopeDataItem->nImage = base->GetBitmapIndex();
00217         }
00218     }
00219
00220     return hr;
00221 }
00222
00223 HRESULT CComponentData::CompareObjects(
00224                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00225                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00226 {
00227     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00228     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00229
00230     // compare the object pointers
00231     if (baseA->GetCookie() == baseB->GetCookie())
00232         return S_OK;
00233
00234     return S_FALSE;
00235 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_ADOCollectionVtbl Member List

This is the complete list of members for _ADOCollectionVtbl, including all inherited members.
c | _ADOCollectionVtbl
cNames | _ADOCollectionVtbl
dispIdMember | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(_ADOCollection __RPC_FAR *This | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(_ADOCollection __RPC_FAR *This | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(_ADOCollection __RPC_FAR *This | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(_ADOCollection __RPC_FAR *This | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(_ADOCollection __RPC_FAR *This | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Count)(_ADOCollection __RPC_FAR *This | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *_NewEnum)(_ADOCollection __RPC_FAR *This | _ADOCollectionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Refresh)(_ADOCollection __RPC_FAR *This) | _ADOCollectionVtbl
iTInfo | _ADOCollectionVtbl
lcid | _ADOCollectionVtbl
lcid | _ADOCollectionVtbl
lcid | _ADOCollectionVtbl
pctinfo | _ADOCollectionVtbl
pDispParams | _ADOCollectionVtbl
pExcepInfo | _ADOCollectionVtbl
ppTInfo | _ADOCollectionVtbl
ppvObject | _ADOCollectionVtbl
ppvObject | _ADOCollectionVtbl
puArgErr | _ADOCollectionVtbl
pVarResult | _ADOCollectionVtbl
rgDispId | _ADOCollectionVtbl
rgszNames | _ADOCollectionVtbl
riid | _ADOCollectionVtbl
riid | _ADOCollectionVtbl
riid | _ADOCollectionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(_ADOCollection __RPC_FAR *This) | _ADOCollectionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(_ADOCollection __RPC_FAR *This) | _ADOCollectionVtbl
wFlags | _ADOCollectionVtbl
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextAdmin.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification

ContextAdmin.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       ContextAdmin.cpp
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011 #include "StdAfx.h"
00012 #include "ContextDll.h"
00013 #include "ContextAdmin.h"
00014 #include <comdef.h>
00015 /////////////////////////////////////////////////////////////////////////////
00016 // CContextAdmin
00017
00018 STDMETHODIMP CContextAdmin::InterfaceSupportsErrorInfo(REFIID riid)
00019 {
00020     static const IID* arr[] =
00021     {
00022         &IID_IWMSContextAdmin
00023     };
00024     for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
00025     {
00026         if ( IsEqualGUID( *arr[ i ], riid ) )
00027         {
00028             return S_OK;
00029         }
00030     }
00031
00032     return( S_FALSE );
00033 }
00034
00035 STDMETHODIMP CContextAdmin::Initialize( CContextPlugin *pPlugin )
00036 {
00037     HRESULT hr = S_OK;
00038
00039     if( NULL == pPlugin )
00040     {
00041         return E_INVALIDARG;
00042     }
00043
00044     m_pContextPlugin = pPlugin;
00045
00046     return( hr );
00047 }
00048
00049 STDMETHODIMP CContextAdmin::put_OutputPath( BSTR bstrOutputPath )
00050 {
00051     HRESULT hr = S_OK;
00052     if( NULL == m_pContextPlugin )
00053     {
00054         return( E_UNEXPECTED );
00055     }
00056
00057     // The parameters should be validated in SetOutputPath
00058     hr = m_pContextPlugin->SetOutputPath( bstrOutputPath );
00059
00060     return( hr );
00061 }
00062
00063
00064 STDMETHODIMP CContextAdmin::get_OutputPath( BSTR *pbstrOutputPath )
00065 {
00066     HRESULT hr = S_OK;
00067     if( NULL == m_pContextPlugin )
00068     {
00069         return( E_UNEXPECTED );
00070     }
00071
00072     // The parameters should be validated in GetOutputPath
00073     hr = m_pContextPlugin->GetOutputPath( pbstrOutputPath );
00074
00075     return( hr );
00076 }
00077
00078
00079 STDMETHODIMP CContextAdmin::put_ContextTypes( WMS_CONTEXT_PLUGIN_CONTEXT_TYPE wmsContextTypes )
00080 {
00081     HRESULT hr = S_OK;
00082     if( NULL == m_pContextPlugin )
00083     {
00084         return( E_UNEXPECTED );
00085     }
00086
00087     // The parameters should be validated in SetContextTypes
00088     hr = m_pContextPlugin->SetContextTypes( wmsContextTypes );
00089
00090     return( hr );
00091 }
00092
00093
00094 STDMETHODIMP CContextAdmin::get_ContextTypes( WMS_CONTEXT_PLUGIN_CONTEXT_TYPE *pwmsContextTypes )
00095 {
00096     HRESULT hr = S_OK;
00097     if( NULL == m_pContextPlugin )
00098     {
00099         return( E_UNEXPECTED );
00100     }
00101
00102     // The parameters should be validated in GetContextTypes
00103     hr = m_pContextPlugin->GetContextTypes( pwmsContextTypes );
00104
00105     return( hr );
00106 }
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/statnode.h Source File

  • SysMgmt
  • MMC
  • Taskpads

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038
00039 public:
00040     // virtual functions go here (for MMCN_*)
00041     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00042
00043 private:
00044     enum { NUMBER_OF_CHILDREN = 4 };
00045     CDelegationBase *children[NUMBER_OF_CHILDREN];
00046
00047     // {2974380C-4C4B-11d2-89D8-000021473128}
00048     static const GUID thisGuid;
00049 };
00050
00051
00052
00053 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/DspFormt.Cpp Source File

  • WinUI
  • GlobalDev
  • CSSamp

DspFormt.Cpp

Go to the documentation of this file.
00001 ////    DspFormt - Display formatted text and handle caret placement
00002 //
00003 //      Demonstrates use of the formatted string APIs
00004 //
00005 //      ScriptItemize           - Break string on script and direction boundaries
00006 //      ScriptLayout            - Bidi embedding level interpreter
00007 //      ScriptShape             - Unicode to glyph translation
00008 //      ScriptPlace             - Width and position generation
00009 //      ScriptTextOut           - Render to device
00010 //      ScriptXtoCP             - Pixel position to character index
00011 //      ScriptCPtoX             - Character index to pixel position
00012 //      ScriptGetLogicalWidths  - Generate widths in character order
00013 //      ScriptBreak             - Get line breaking flags
00014
00015 #include "precomp.hxx"
00016 #include "global.h"
00017
00018 ////    Since this is a sample application we can use fixed size buffers
00019 //
00020 const int MAXITEM   = 200;     // Maximum item supported in a paragraph
00021 const int MAXRUN    = 200;     // Maximum runs supported in a line
00022 const int MAXCHARS  = 200;     // Maximum codepoints in a single run
00023 const int MAXGLYPHS = 200;     // Maximum glyphs in a single run
00024
00025 //      A real application would normally allocate buffers dynamically.
00026 //
00027 //      A glyph buffer 1.5 times as large as the character buffer is
00028 //      currently sufficient for all known scripts and fonts, however you
00029 //      should be prepared to allocate larger buffers dynamically if you
00030 //      receive E_OUT_OF_MEMORY errors, since future fonts could
00031 //      generate more glyphs for some characters.
00032 //
00033 //      One such possibility is a font whose glyphs are individual pen
00034 //      strokes. Such a font might commonly generate 2 or 3 glyphs per
00035 //      character.
00036 //
00037 //      The worst case requirement for the item buffer is one item per
00038 //      character plus a sentinel item. You may be be surprised how often
00039 //      you come across a line composed of alternating characters from
00040 //      different scripts - it can look pretty.
00041 //
00042 //      Since these buffers are allocated dynamically and kept only while
00043 //      the line is being processed, it is recommended to allocate the
00044 //      worst case lengths - it takes no longer to allocate a large buffer
00045 //      than a small one.
00046 //
00047 //      On the other hand, if your design keeps shaping and placement
00048 //      output buffers cached it would usually be worthwhile copying to
00049 //      buffers allocated to the right lengths once the shape/place
00050 //      operations are complete.
00051
00052
00053
00054 ////    BuildParaRunList - Builds runs in this paragraph with analysis from ScriptItemize
00055 //
00056 //      Calls ScriptItemize to break this paragraph into runs by script and bidi direction
00057 //
00058 //      Merges the result with the global style run list
00059 //
00060 //      Returns merged runs for paragraph such that each run has a single script, style
00061 //      and direction.
00062 void BuildParaRunList(
00063     int    iFirst,            // In    First character of paragraph
00064     int    iLen,              // In    Length of paragraph
00065     RUN  **ppFirstParaRun,    // Out   Receives head of paragraph run list
00066     int   *pcRuns) {          // Out   Number of runs generated
00067
00068     SCRIPT_ITEM      Items[MAXITEM];
00069     int              cItems          = 0;      // Number of items returned by ScriptItemize
00070     RUN             *pFormatRunRider = NULL;   // Rides main formatting run list
00071     RUN             *pNewRun         = NULL;
00072     RUN            **ppLastNext      = NULL;   // Pointer to be updated with new run address
00073     int              iFormatRunStart = 0;      // Character offset of current formatting run
00074     int              iParaRunStart   = 0;
00075     int              iItem           = 0 ;
00076     SCRIPT_CONTROL   ScriptControl   = {0};
00077     SCRIPT_STATE     ScriptState     = {0};
00078     HRESULT          hr              = NULL;
00079     int              cRuns           = 0;
00080
00081     // Itemize the paragraph by script and bidi direction
00082     ScriptControl = g_ScriptControl;
00083     ScriptState   = g_ScriptState;
00084
00085     hr = ScriptItemize(
00086         g_wcBuf+iFirst,
00087         iLen,
00088         MAXITEM,
00089         g_fNullState   ? NULL : &ScriptControl,
00090         g_fNullState   ? NULL : &ScriptState,
00091         Items,
00092        &cItems);
00093
00094     if (FAILED(hr))
00095     {
00096         return;
00097     }
00098
00099     /// Build a Paragraph run list by merging itemization with formatting styles.
00100     //
00101     //  Generate a linked list of runs specific to this paragraph, such that
00102     //  each run has a single formatting style and a single item analysis.
00103
00104     // Find first run for this para
00105     pFormatRunRider = g_pFirstFormatRun;
00106     iFormatRunStart = 0;
00107     while (iFormatRunStart + pFormatRunRider->iLen <= iFirst)
00108     {
00109         iFormatRunStart += pFormatRunRider->iLen;
00110         pFormatRunRider = pFormatRunRider->pNext;
00111     }
00112
00113     // Create a paragraph run for every change of item or formatting
00114     ppLastNext = ppFirstParaRun;
00115     iItem = 0;
00116     iParaRunStart = iFirst;
00117     cRuns = 0;
00118
00119     while (iItem < cItems  &&  iFormatRunStart < iFirst + iLen)
00120     {
00121         // Create a run up to the next change of item or formatting
00122         // style, whichever comes first.
00123         pNewRun = new RUN;
00124         pNewRun->iStyle   = pFormatRunRider->iStyle;
00125         pNewRun->analysis = Items[iItem].a;
00126         pNewRun->pNext    = NULL;
00127         *ppLastNext       = pNewRun;
00128         ppLastNext        = &pNewRun->pNext;
00129         cRuns++;
00130
00131         if (iFirst + Items[iItem+1].iCharPos  <=  iFormatRunStart + pFormatRunRider->iLen)
00132         {
00133             // No change of style during the current item
00134             pNewRun->iLen = iFirst + Items[iItem+1].iCharPos - iParaRunStart;  // Item length
00135
00136         }
00137         else
00138         {
00139             // Style changes before end of current item
00140             pNewRun->iLen = iFormatRunStart + pFormatRunRider->iLen - iParaRunStart;
00141         }
00142
00143         iParaRunStart += pNewRun->iLen;
00144
00145         if (iParaRunStart >= iFirst + Items[iItem+1].iCharPos)
00146         {
00147             iItem++;  // Advance to next item
00148         }
00149
00150         if (iParaRunStart >= iFormatRunStart + pFormatRunRider->iLen)
00151         {
00152             iFormatRunStart += pFormatRunRider->iLen;   // Advance to next run
00153             pFormatRunRider = pFormatRunRider->pNext;
00154         }
00155     }
00156
00157     *pcRuns = cRuns;
00158 }
00159
00160 ///     BuildVisualDisplayOrder
00161 //
00162 //      Collects bidi levels for a line into an array and passes
00163 //      them to ScriptLayout to construct an array of visual
00164 //      positions for each logical run. Uses that array to
00165 //      construct arrays of run pointers and logical character
00166 //      offsets in visual order.
00167
00168 void BuildVisualDisplayOrder(
00169     RUN   *pFirstLogicalRun,  // In   Some or all of the paragraph run list
00170     int    cRuns,             // In   Number of runs to process
00171     RUN  **ppVisualOrder,     // Out  Array of run pointers in visual order
00172     int   *piPos)            // Out  Array of text indices for runs
00173 {
00174     BYTE   BidiLevel[MAXRUN];
00175     int    iLogicalToVisual[MAXRUN];
00176     int    iRun  = 0;
00177     RUN   *pRun  = NULL ;
00178     int    iPos  = 0;
00179
00180     // Extract bidi levels for the line into an array
00181     iRun = 0;
00182     pRun = pFirstLogicalRun;
00183     while (pRun != NULL  &&  iRun < cRuns  &&  iRun < MAXRUN)
00184     {
00185         BidiLevel[iRun] = (BYTE)pRun->analysis.s.uBidiLevel;
00186         iRun++;
00187         pRun = pRun->pNext;
00188     }
00189
00190     // Obtain logical to visual order run index mapping
00191     ScriptLayout(cRuns, BidiLevel, NULL, iLogicalToVisual);
00192
00193     // Fill in array of run pointers in visual order
00194     pRun = pFirstLogicalRun;
00195     iRun = 0;
00196     iPos = 0;
00197     while(iRun < cRuns)
00198     {
00199         ppVisualOrder[iLogicalToVisual[iRun]] = pRun;
00200         piPos[iLogicalToVisual[iRun]] = iPos;
00201         iPos += pRun->iLen;
00202         pRun = pRun->pNext;
00203         iRun++;
00204     }
00205 }
00206
00207 ////    CaretHandling - process mouse hits and caret positioning in this run
00208 //
00209 //      When displaying the caret, this code always displays it on the leading
00210 //      edge of g_iCurChar, which is conventionally the logical character before
00211 //      which a new character would be inserted.
00212 //
00213 //      A high quality editing application will distinguish the leading edge
00214 //      of g_iCurChar from the trailing edge of g_iCurChar-1 since for bidi
00215 //      text these may be at very different visual positions.
00216 //
00217 //      A simple rule to follow is to display at the trailing edge of g_iCurChar-1
00218 //      when the cursor is being advanced by typing or by pressing the forward arrow
00219 //      key, and to display on the leading edge of g_iCurChar at all other times.
00220 void CaretHandling(
00221     int                     iX,             // In  Run x position
00222     int                     iDx,            // In  Run width
00223     int                     iY,             // In  Run top
00224     int                     iDy,            // In  Run height
00225     int                     iFirst,         // In  First character of run
00226     int                     cChars,         // In  Character count
00227     int                     cGlyphs,        // In  Glyph count
00228     const SCRIPT_ANALYSIS  *psa,
00229     WORD                   *pwLogClust,
00230     const SCRIPT_VISATTR   *psva,
00231     const int              *piAdvance)
00232 {
00233     int  iCp        = 0;
00234     int  iTrailing  = 0;
00235     int  iCpx       = 0;
00236     int  iFrom      = 0;
00237     int  iTo        = 0;
00238
00239     // Check whether mouse clicks in this item are waiting to be processed
00240     if (    g_fMouseDown
00241         &&  g_iMouseDownY >= iY
00242         &&  g_iMouseDownY <  iY + iDy
00243         &&  g_iMouseDownX >= iX
00244         &&  g_iMouseDownX <  iX + iDx)
00245     {
00246         // Record position at mouse button down
00247         ScriptXtoCP(
00248             g_iMouseDownX - iX,
00249             cChars,
00250             cGlyphs,
00251             pwLogClust,
00252             psva,
00253             piAdvance,
00254             psa,
00255            &iCp,
00256            &iTrailing);
00257
00258         g_iFrom = iCp + iTrailing + iFirst;
00259         g_fMouseDown = FALSE;
00260     }
00261
00262     if (    g_fMouseUp
00263         &&  g_iMouseUpY >= iY
00264         &&  g_iMouseUpY <  iY + iDy
00265         &&  g_iMouseUpX >= iX
00266         &&  g_iMouseUpX <  iX + iDx)
00267     {
00268         // Process mouse up
00269         ScriptXtoCP(
00270             g_iMouseUpX - iX,
00271             cChars,
00272             cGlyphs,
00273             pwLogClust,
00274             psva,
00275             piAdvance,
00276             psa,
00277            &iCp,
00278            &iTrailing);
00279
00280         g_iTo = iCp + iTrailing + iFirst;
00281         g_fMouseUp = FALSE;
00282
00283         // Request caret move to this position
00284         g_iCurChar      = g_iTo;
00285         g_fUpdateCaret  = TRUE;
00286         g_iCaretSection = CARET_SECTION_FORMATTED;
00287     }
00288
00289     // Check for caret positioning to this run
00290     if (    g_fUpdateCaret
00291         &&  g_iCaretSection == CARET_SECTION_FORMATTED
00292         &&  g_iCurChar >= iFirst
00293         &&  g_iCurChar <  iFirst+cChars)
00294     {
00295         // Display caret at coordinate corresponding to g_iCurChar
00296         g_fUpdateCaret = FALSE;
00297         ScriptCPtoX(
00298             g_iCurChar - iFirst,
00299             FALSE,          // Always display on leading edge
00300             cChars,
00301             cGlyphs,
00302             pwLogClust,
00303             psva,
00304             piAdvance,
00305             psa,
00306            &iCpx);
00307
00308         ResetCaret(iX+iCpx, iY, iDy);
00309     }
00310
00311     // If anypart of this run is selected, redisplay that part with a blue
00312     // background.
00313     if (g_iFrom != g_iTo)
00314     {
00315         if (g_iFrom <= g_iTo)
00316         {
00317             iFrom = g_iFrom - iFirst;
00318             iTo   = g_iTo   - iFirst;
00319         }
00320         else
00321         {
00322             iFrom = g_iTo   - iFirst;
00323             iTo   = g_iFrom - iFirst;
00324         }
00325     }
00326 }
00327
00328 ////    ShapePlaceRun - uses ScriptShape and ScriptPlace to create glyphs and widths for a run
00329 //
00330 //      This sample implementation includes a simple form of font association.
00331 //
00332 //      High quality formatting apps need to measure and render text at different resolutions.
00333 //      Such an app might call ScriptShape once to generate glyphs, then ScriptPlace at
00334 //      screen resolution, printer resulution and/or 'ideal device' resolution.
00335 //      For this sample we are only concerned with screen resolution.
00336 HRESULT ShapePlaceRun(
00337     HDC              hdc,         // InOut  Device context
00338     int             *piCurStyle,  // InOut  Current style - helps optimise unnecessary SelectObject calls
00339     int              iStyle,      // In     Desired style
00340     SCRIPT_ANALYSIS *psa,         // In     Analysis from paragraph itemization
00341     int              iPos,        // In     First character of logical item
00342     int              iLen,        // In     Length in codepoints
00343     int             *pcGlyphs,    // Out    Glyph count
00344     WORD            *pGlyphs,     // Out    Glyph indices
00345     WORD            *pClusters,   // Out    Cluster positions
00346     SCRIPT_VISATTR  *pVisattrs,   // Out    Visual attributes
00347     int             *piAdvances,  // Out    Glyph advance widths
00348     GOFFSET         *pGoffsets,   // Out    Glyph 2D offsets
00349     int             *piDx)        // Out    Run advance width
00350 {
00351     ABC             abc = {0};          // Run combined ABC
00352     HRESULT         hr  = NULL;
00353
00354     // Obey global settings for logical order and NoGlyphIndex
00355     if (g_fLogicalOrder)
00356     {
00357         psa->fLogicalOrder = TRUE;
00358     }
00359
00360     if (g_fNoGlyphIndex)
00361     {
00362         psa->fNoGlyphIndex = TRUE;
00363     }
00364
00365     // Select desired style
00366     if (iStyle != *piCurStyle)
00367     {
00368         *piCurStyle = iStyle;
00369         SelectObject(hdc, g_style[iStyle].hf);
00370     }
00371
00372     // Shape (generate glyphs) with desired style
00373     hr = ScriptShape(
00374         hdc,
00375        &g_style[*piCurStyle].sc,
00376         g_wcBuf + iPos,
00377         iLen,
00378         MAXGLYPHS,
00379         psa,
00380         pGlyphs,
00381         pClusters,
00382         pVisattrs,
00383         pcGlyphs);
00384
00385     if (hr == USP_E_SCRIPT_NOT_IN_FONT)
00386     {
00387         // The desired style does not support the script of this run.
00388         // Implement font association here.
00389
00390         // In this sample we simply try style 1. A better application may keep a
00391         // list of standard fonts to try.
00392         SelectObject(hdc, g_style[1].hf);
00393         *piCurStyle = 1;
00394
00395         // Shape with style 1
00396         hr = ScriptShape(
00397             hdc,
00398            &g_style[*piCurStyle].sc,
00399             g_wcBuf + iPos,
00400             iLen,
00401             MAXGLYPHS,
00402             psa,
00403             pGlyphs,
00404             pClusters,
00405             pVisattrs,
00406             pcGlyphs);
00407     }
00408
00409     if (hr == USP_E_SCRIPT_NOT_IN_FONT)
00410     {
00411         // Neither the users selected style nor style 1 support the
00412         // script of this run, so force the script to 'SCRIPT_UNDEFINED'
00413         // This will display the characters directly through the fonts
00414         // CMAP table, probably showing the text as square boxes (the
00415         // missing glyph)
00416         psa->eScript = SCRIPT_UNDEFINED;
00417
00418         // Restore original desired style
00419         if (iStyle != *piCurStyle)
00420         {
00421             *piCurStyle = iStyle;
00422             SelectObject(hdc, g_style[iStyle].hf);
00423         }
00424
00425         // Shape with SCRIPT_UNDEFINED
00426         hr = ScriptShape(
00427             hdc,
00428            &g_style[*piCurStyle].sc,
00429             g_wcBuf + iPos,
00430             iLen,
00431             MAXGLYPHS,
00432             psa,
00433             pGlyphs,
00434             pClusters,
00435             pVisattrs,
00436             pcGlyphs);
00437     }
00438
00439     // Having generated glyphs, now generate advance widths and combining
00440     // offsets.
00441     // A real formatting app would probably use ScriptPlace at more than one
00442     // resolution, for example at a high 'ideal' resolution for page layout,
00443     // then again at screen and/or printer resolution for displaying and
00444     // printing.
00445     // This sample applet considers only screen resolution.
00446
00447     if (SUCCEEDED(hr))
00448     {
00449         hr = ScriptPlace(
00450             hdc,
00451            &g_style[*piCurStyle].sc,
00452             pGlyphs,
00453            *pcGlyphs,
00454             pVisattrs,
00455             psa,
00456             piAdvances,
00457             pGoffsets,
00458            &abc);
00459
00460         *piDx = abc.abcA + abc.abcB + abc.abcC;
00461     }
00462
00463     return hr;
00464 }
00465
00466 ////    PaintFormattedRun
00467 //
00468 //
00469 void PaintFormattedRun(
00470     HDC              hdc,        // InOut
00471     int              iY,         // In     Vertical poition to write at
00472     int              iLineHeight,// In
00473     int             *piX,        // InOut  Horizontal position to start at, updated by length of run
00474     int             *piCurStyle, // InOut  Current style - helps optimise unnecessary SelectObject calls
00475     int              iStyle,     // In     Desired style
00476     SCRIPT_ANALYSIS *psa,        // In     Analysis from paragraph itemization
00477     int              iPos,       // In     First character of logical item
00478     int              iLen) {     // In     Length of logical item
00479
00480
00481     WORD            glyphs[MAXGLYPHS];
00482     WORD            clusters[MAXGLYPHS];
00483     SCRIPT_VISATTR  visattrs[MAXGLYPHS];
00484     int             advances[MAXGLYPHS];    // Glyph advance widths
00485     GOFFSET         goffsets[MAXGLYPHS];    // Glyph 2D offsets
00486     int             cGlyphs = 0;
00487     int             iWidth  = 0;            // Run width
00488     HRESULT         hr      = NULL;
00489
00490     // ShapePlaceRun calls ScriptShape and ScriptPlace to generate glyphs and
00491     // advance widths, and also performs limited font association.
00492     hr = ShapePlaceRun(
00493         hdc,
00494         piCurStyle,
00495         iStyle,
00496         psa,
00497         iPos,
00498         iLen,
00499        &cGlyphs,
00500         glyphs,
00501         clusters,
00502         visattrs,
00503         advances,
00504         goffsets,
00505        &iWidth);
00506
00507     if (SUCCEEDED(hr))
00508     {
00509         // Set text color to represent any font association applied
00510         if (*piCurStyle != iStyle)
00511         {
00512             SetTextColor(hdc, 0x00ff0000);  // Show we did font association by marking text blue
00513         }
00514         else if (psa->eScript == SCRIPT_UNDEFINED)
00515         {
00516             SetTextColor(hdc, 0x000000ff);  // Show we forced SCRIPT_UNDEFINED by marking text red
00517         }
00518         else
00519         {
00520             SetTextColor(hdc, 0);           // Show text black when no font association required
00521         }
00522
00523         hr = ScriptTextOut(
00524             hdc,
00525            &g_style[*piCurStyle].sc,
00526            *piX,
00527             iY,
00528             0,
00529             NULL,
00530             psa,
00531             NULL,
00532             0,
00533             glyphs,
00534             cGlyphs,
00535             advances,
00536             NULL,
00537             goffsets);
00538
00539         // Handle mouse hits in this run and/or caret repositioning in this run
00540         CaretHandling(
00541            *piX,            // Run position
00542             iWidth,         // Width in pixels
00543             iY,             // Run top
00544             iLineHeight,    // Run height
00545             iPos,           // First character
00546             iLen,           // Character count
00547             cGlyphs,        // Glyph count
00548             psa,            // Script analysis
00549             clusters,       // Clusters
00550             visattrs,       // Visual attributes
00551             advances);      // Advance widths
00552
00553         // Advance x coordinate to right edge of run
00554         if (SUCCEEDED(hr))
00555         {
00556             *piX += iWidth;     // Advance x position over this run
00557         }
00558
00559         // Restore black text (we may have changed color to mark font association)
00560         SetTextColor(hdc, 0);
00561     }
00562 }
00563
00564 ////    PaintFormattedTextLine - Process and display a line of formatted text
00565 //
00566 //
00567 void PaintFormattedTextLine(
00568     HDC      hdc,               // InOut  Device
00569     int     *piCurStyle,        // InOut  Current style - helps optimise unnecessary SelectObject calls
00570     int     *piY,               // In     Y position
00571     RECT    *prc,               // In     Clipping rectange
00572     int      iFirst,            // In     First character of line
00573     int      iLen,              // In     Length in characters
00574     RUN     *pFirstRun,         // In     First run of this line
00575     int      cRuns,             // In     Run count
00576     int      iLineHeight)       // In     Height to advance per line, in pixels
00577 {
00578
00579     RUN     *pVisualOrder[MAXRUN];  // Array of run pointers in visual order
00580     int      iPos[MAXRUN];          // Offset to first logical character of each run
00581     int      iRun    = 0;
00582     int      iX      = 0;
00583     RECT     rcClear = {0};
00584
00585     // Clear each line before displaying it
00586     rcClear        = *prc;
00587     rcClear.top    = *piY;
00588     rcClear.bottom = *piY + iLineHeight;
00589     FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));
00590
00591     // Construct array of run pointers in visual order
00592     BuildVisualDisplayOrder(pFirstRun, cRuns, pVisualOrder, iPos);
00593
00594     // Display runs in visual order
00595     iX = prc->left;
00596
00597     for (iRun = 0; iRun < cRuns; iRun++)
00598     {
00599         PaintFormattedRun(
00600             hdc,
00601            *piY,
00602             iLineHeight,
00603            &iX,                                         // Horizontal position (will be updated)
00604             piCurStyle,                                 // Current style (will be updated)
00605             pVisualOrder[iRun]->iStyle,                 // Desired style
00606            &pVisualOrder[iRun]->analysis,               // Analysis from ScriptItemize
00607             iFirst+iPos[iRun],
00608             pVisualOrder[iRun]->iLen);
00609     }
00610
00611     // A pending caret position set may not have been handled in the previous loop
00612     if (    g_fUpdateCaret
00613         &&  g_iCaretSection == CARET_SECTION_FORMATTED
00614         &&  g_iCurChar >= iFirst
00615         &&  g_iCurChar <= iFirst + iLen)
00616     {
00617         if (g_iCurChar == iFirst + iLen)
00618         {
00619             // Caret is at the end of the line
00620             g_fUpdateCaret = FALSE;
00621             ResetCaret(iX, *piY, iLineHeight);
00622         }
00623         else
00624         {
00625             // If the caret position was changed by a mouse click at one end of a
00626             // formatted run that requires it to be displayed at the corresponding
00627             // end of another run, and if that other run happened to have been displayed
00628             // earlier, we may still have a mouse update pending. In that case,
00629             // rerun the fancy text display algorithm until the caret has been placed.
00630
00631             iX = prc->left;
00632             for (iRun = 0;  g_fUpdateCaret && iRun < cRuns;  iRun++)
00633             {
00634                 PaintFormattedRun(
00635                     hdc,
00636                    *piY,
00637                     iLineHeight,
00638                    &iX,                             // Horizontal position (will be updated)
00639                     piCurStyle,                     // Current style (will be updated)
00640                     pVisualOrder[iRun]->iStyle,     // Desired style
00641                    &pVisualOrder[iRun]->analysis,   // Analysis from ScriptItemize
00642                     iFirst+iPos[iRun],
00643                     pVisualOrder[iRun]->iLen);
00644             }
00645         }
00646     }
00647
00648     *piY += iLineHeight;
00649 }
00650
00651 ////    BreakRun - Split run at word boundary before given width
00652 //
00653 //      Returns width up to wordbreak
00654 int BreakRun(
00655     RUN             *pRun,                  // In     Run to break
00656     int              cGlyphs,
00657     int             *piAdvances,
00658     WORD            *pClusters,
00659     SCRIPT_VISATTR  *pVisattrs,
00660     int              iMaxWidth,             // In     Width to meet
00661     int              iPos,                  // In     Position in character buffer
00662     BOOL             fNeedCluster)          // In     If must return at least one cluster
00663 {
00664
00665     SCRIPT_LOGATTR   logattrs[MAXCHARS];    // Logical (codepoint) atributes
00666     int              logwidths[MAXCHARS];   // Codepoint widths
00667     int              iWidth  = 0;           // Width in pixels
00668     int              iChars  = 0;           // Width in codepoints
00669     RUN             *pNewRun = NULL;        // New run for text following wordbreak
00670     HRESULT          hr      = NULL;
00671
00672     // Convert the glyph widths to logical widths: in the
00673     // same order and quantity as the origial codepoints.
00674
00675     hr = ScriptGetLogicalWidths(
00676        &pRun->analysis,
00677         pRun->iLen,
00678         cGlyphs,
00679         piAdvances,
00680         pClusters,
00681         pVisattrs,
00682         logwidths);
00683
00684     if (FAILED(hr))
00685     {
00686         iWidth = 0;
00687         goto RETURN;
00688     }
00689
00690
00691     // Calculate how many codepoints will fit iMaxWidth
00692     // ignoring word boundaries.
00693     iChars = 0;
00694     iWidth = 0;
00695
00696     while (    iChars < pRun->iLen
00697         &&  iWidth + logwidths[iChars] < iMaxWidth)
00698     {
00699         iWidth += logwidths[iChars];
00700         iChars++;
00701     }
00702
00703     // Obtain logical attributes including whitespace and
00704     // wordstart flags.
00705     hr = ScriptBreak(
00706         g_wcBuf + iPos,
00707         pRun->iLen,
00708        &pRun->analysis,
00709         logattrs);
00710
00711     if (FAILED(hr))
00712     {
00713         iWidth = 0;
00714         goto RETURN;
00715     }
00716
00717     // Back up to a wordbreak
00718     while(    iChars > 0
00719           &&  iChars < pRun->iLen
00720           &&  !logattrs[iChars].fWhiteSpace
00721           &&  !logattrs[iChars].fSoftBreak)
00722     {
00723         iChars--;
00724         iWidth -= logwidths[iChars];
00725     }
00726
00727     if (fNeedCluster  &&  iChars == 0)
00728     {
00729         // Ensure at least one cluster is returned
00730         iWidth = piAdvances[pClusters[0]];
00731         iChars = 1;
00732
00733         while (    iChars < pRun->iLen
00734                &&  pClusters[iChars] == pClusters[0])
00735         {
00736             iWidth += piAdvances[pClusters[iChars]];
00737             iChars++;
00738         }
00739     }
00740
00741     // Include any subsequent whitespace characters
00742     while (    iChars < pRun->iLen
00743            &&  logattrs[iChars].fWhiteSpace)
00744     {
00745         iWidth += logwidths[iChars];
00746         iChars++;
00747     }
00748
00749     // Split current run at this point
00750     if (iChars < pRun->iLen)
00751     {
00752         pNewRun        = new RUN;
00753         *pNewRun       = *pRun;
00754         pRun->pNext    = pNewRun;
00755         pRun->iLen     = iChars;
00756         pNewRun->iLen -= iChars;
00757     }
00758
00759 RETURN:
00760     return iWidth;
00761 }
00762
00763 ////    PaintFormattedTextPara - Break a paragraph into lines and display each line
00764 //
00765 //      Builds a list of runs in the paragraph, then measures each run length in
00766 //      logical order filling and displaying lines one at a time.
00767
00768 void PaintFormattedTextPara(
00769     HDC      hdc,               // In   Device
00770     int     *piY,               // In   Y position
00771     RECT    *prc,               // In   Clipping rectange
00772     int      iFirst,            // In   First character of line
00773     int      iLen,
00774     int      iLineHeight)       // In   Height to advance per line, in pixels
00775 {
00776     WORD            glyphs[MAXGLYPHS];
00777     WORD            clusters[MAXGLYPHS];
00778     SCRIPT_VISATTR  visattrs[MAXGLYPHS];
00779     int             advances[MAXGLYPHS];    // Glyph advance widths
00780     GOFFSET         goffsets[MAXGLYPHS];    // Glyph 2D offsets
00781     int             cGlyphs       = 0;
00782     HRESULT         hr            = NULL;
00783     RUN            *pFirstParaRun = NULL;
00784     RUN            *pLineStartRun = NULL;
00785     RUN            *pLineEndRun   = NULL;
00786     RUN            *pDelRun       = NULL;
00787     int             nRuns         = 0;
00788     int             iLineWidth    = 0;      // Width measured so far
00789     int             iRunWidth     = 0;      // Width of an individual run
00790     int             iMaxWidth     = 0;      // Line width
00791     int             iLineLen      = 0;      // Length in codepoints
00792     int             iCurStyle     = 0;
00793
00794     iCurStyle = -1;             // Force style selection on first run
00795     iMaxWidth = prc->right - prc->left;
00796
00797     if (iLen > 0  &&  iMaxWidth > 0)
00798     {
00799         // Itemize paragraph and merge items with style runs
00800         BuildParaRunList(iFirst, iLen, &pFirstParaRun, &nRuns);
00801
00802         if (!g_fFillLines)
00803         {
00804             // Display whole para as one line
00805             PaintFormattedTextLine(
00806                 hdc,
00807                &iCurStyle,
00808                 piY,
00809                 prc,
00810                 iFirst,
00811                 iLen,
00812                 pFirstParaRun,
00813                 nRuns,
00814                 iLineHeight);
00815
00816             // Free para run list
00817             while (pFirstParaRun != NULL)
00818             {
00819                 pDelRun = pFirstParaRun;
00820                 pFirstParaRun = pFirstParaRun->pNext;
00821                 delete pDelRun;
00822                 pDelRun = NULL;
00823             }
00824
00825         }
00826         else
00827         {
00828             // Display paragraph in filled lines
00829             // Measure runs to fit
00830             pLineStartRun = pFirstParaRun;
00831
00832             while (pLineStartRun)
00833             {
00834                 pLineEndRun = pLineStartRun;
00835                 iLineWidth  = 0;
00836                 nRuns       = 0;
00837                 iLineLen    = 0;
00838
00839                 hr = ShapePlaceRun(
00840                     hdc,
00841                    &iCurStyle,
00842                     pLineEndRun->iStyle,
00843                    &pLineEndRun->analysis,
00844                     iFirst + iLineLen,
00845                     pLineEndRun->iLen,
00846                   &cGlyphs,
00847                     glyphs,
00848                     clusters,
00849                     visattrs,
00850                     advances,
00851                     goffsets,
00852                    &iRunWidth);
00853
00854                 if (FAILED(hr))
00855                 {
00856                     return;
00857                 }
00858
00859                 while (pLineEndRun  &&  iLineWidth + iRunWidth <= iMaxWidth)
00860                 {
00861                     iLineWidth += iRunWidth;
00862                     iLineLen   += pLineEndRun->iLen;
00863                     pLineEndRun = pLineEndRun->pNext;
00864                     nRuns++;
00865
00866                     if (pLineEndRun)
00867                     {
00868                         hr = ShapePlaceRun(
00869                             hdc,
00870                            &iCurStyle,
00871                             pLineEndRun->iStyle,
00872                            &pLineEndRun->analysis,
00873                             iFirst + iLineLen,
00874                             pLineEndRun->iLen,
00875                           &cGlyphs,
00876                             glyphs,
00877                             clusters,
00878                             visattrs,
00879                             advances,
00880                             goffsets,
00881                            &iRunWidth);
00882
00883                         if (FAILED(hr))
00884                         {
00885                             return;
00886                         }
00887                     }
00888                 }
00889
00890                 // Having filled the line with as many whole runs as possible, now
00891                 // break the next run on a word boundary if possible, or between
00892                 // clusters if not.
00893
00894                 if (pLineEndRun  &&  iLineWidth < iMaxWidth)
00895                 {
00896
00897                     iRunWidth   = BreakRun(
00898                         pLineEndRun,
00899                         cGlyphs,
00900                         advances,
00901                         clusters,
00902                         visattrs,
00903                         iMaxWidth - iLineWidth,
00904                         iFirst + iLineLen,
00905                         iLineLen == 0);             // Ensure at least one cluster is broken
00906
00907
00908                     iLineWidth += iRunWidth;
00909                     iLineLen   += pLineEndRun->iLen;
00910                     pLineEndRun = pLineEndRun->pNext;
00911                     nRuns++;
00912                 }
00913
00914                 PaintFormattedTextLine(
00915                     hdc,
00916                    &iCurStyle,
00917                     piY,
00918                     prc,
00919                     iFirst,
00920                     iLineLen,
00921                     pLineStartRun,
00922                     nRuns,
00923                     iLineHeight);
00924
00925
00926                 // Advance to next line
00927                 iFirst += iLineLen;
00928                 while (pLineStartRun != pLineEndRun)
00929                 {
00930                     pDelRun = pLineStartRun;
00931                     pLineStartRun = pLineStartRun->pNext;
00932                     delete pDelRun;
00933                     pDelRun = NULL;
00934                 }
00935             }
00936         }
00937     }
00938     else
00939     {
00940         // Empty paragraph
00941         RECT     rcClear = {0};
00942         rcClear        = *prc;
00943         rcClear.top    = *piY;
00944         rcClear.bottom = *piY + iLineHeight;
00945         FillRect(hdc, &rcClear, (HBRUSH) GetStockObject(WHITE_BRUSH));
00946         *piY += iLineHeight;
00947     }
00948 }
00949
00950 ////    PaintFormattedText - Demonstrate Itemize/Shape/Place/Out APIs
00951 //
00952 //
00953 void PaintFormattedText(
00954     HDC   hdc,
00955     int  *piY,
00956     RECT *prc,
00957     int   iLineHeight) {
00958
00959     int   icpParaStart;     // First character of line
00960     int   icpParaEnd;       // End of para (end of buffer or index of CR character)
00961
00962
00963     // Since we'll output each run independantly, we can't paint the character background
00964     // lest it erase an overhanging part of a glyph at the end of the previous output run.
00965     // (This is common - for example most of the Arabic glyphs in Arial overhang a few
00966     // pixels beyond their advance width)
00967     SetBkMode(hdc, TRANSPARENT);    // Allow runs to overlap
00968     icpParaStart = 0;
00969
00970     // Display line by line
00971     while (icpParaStart < g_iTextLen)
00972     {
00973         // Find end of para or end of buffer
00974         icpParaEnd = icpParaStart;
00975         while (icpParaEnd < g_iTextLen  &&  g_wcBuf[icpParaEnd] != 0x0D)
00976         {
00977             icpParaEnd++;
00978         }
00979
00980         PaintFormattedTextPara(
00981             hdc,
00982             piY,
00983             prc,
00984             icpParaStart,
00985             icpParaEnd-icpParaStart,
00986             iLineHeight);
00987
00988         // Advance to next line
00989         if (icpParaEnd < g_iTextLen)
00990         {
00991             icpParaEnd++;
00992         }
00993         if (icpParaEnd < g_iTextLen  &&  g_wcBuf[icpParaEnd] == 0x0A)
00994         {
00995             icpParaEnd++;
00996         }
00997
00998         icpParaStart = icpParaEnd;
00999     }
01000 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/rmapi.c Source File

  • NetDS
  • RRas
  • ip

rmapi.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\rmapi.c
00008
00009 Abstract:
00010
00011     The file contains IP router manager API implementations.
00012
00013 --*/
00014
00015 #include "pchsample.h"
00016 #pragma hdrstop
00017
00018
00019 DWORD
00020 WINAPI
00021 StartProtocol (
00022     IN HANDLE               NotificationEvent,
00023     IN PSUPPORT_FUNCTIONS   SupportFunctions,
00024     IN LPVOID               GlobalInfo,
00025     IN ULONG                StructureVersion,
00026     IN ULONG                StructureSize,
00027     IN ULONG                StructureCount
00028     )
00029 /*++
00030
00031 Routine Description
00032     After the protocol has been registered, the IP Router Manager calls
00033     this function to tell the protocol to start.  Most of the startup code
00034     is executed here.
00035
00036 Arguments
00037     NotificationEvent   Event to Set if the IP Router Manager needs to
00038                             be notified to take any action on our behalf
00039     SupportFunctions    Some functions exported by IP Router Manager
00040     GlobalInfo          Our global configuration which was setup by our
00041                             setup/admin DLL
00042
00043 Return Value
00044     NO_ERROR            Success
00045     Error Code          o/w
00046
00047 --*/
00048 {
00049     DWORD dwErr = NO_ERROR;
00050
00051     TRACE3(ENTER, "Entering StartProtocol 0x%08x 0x%08x 0x%08x",
00052            NotificationEvent, SupportFunctions, GlobalInfo);
00053
00054     do                          // breakout loop
00055     {
00056         // validate parameters
00057         if (!NotificationEvent or
00058             !SupportFunctions  or
00059             !GlobalInfo)
00060         {
00061             dwErr = ERROR_INVALID_PARAMETER;
00062             break;
00063         }
00064
00065         dwErr = CM_StartProtocol(NotificationEvent,
00066                                  SupportFunctions,
00067                                  GlobalInfo);
00068     } while(FALSE);
00069
00070     TRACE1(LEAVE, "Leaving  StartProtocol: %u", dwErr);
00071
00072     return dwErr;
00073 }
00074
00075 DWORD
00076 WINAPI
00077 StartComplete (
00078     VOID
00079     )
00080 {
00081     TRACE0(ENTER, "Entering StartComplete");
00082     TRACE0(LEAVE, "Leaving  StartComplete");
00083
00084     return NO_ERROR;
00085 }
00086
00087
00088 DWORD
00089 WINAPI
00090 StopProtocol (
00091     VOID
00092     )
00093 /*++
00094
00095 Routine Description
00096     This function is called by the IP Router Manager to tell the protocol
00097     to stop.  We set the protocol state to IPSAMPLE_STATUS_STOPPING to
00098     prevent us from servicing any more requests and wait for all pending
00099     threads to finish.  Meanwhile we return PENDING to the IP Router
00100     Manager.
00101
00102 Arguments
00103     None
00104
00105 Return Value
00106    ERROR_PROTOCOL_STOP_PENDING      Success
00107    Error Code                       o/w
00108
00109 --*/
00110 {
00111     DWORD dwErr = NO_ERROR;
00112
00113     TRACE0(ENTER, "Entering StopProtocol");
00114
00115     dwErr = CM_StopProtocol();
00116
00117     TRACE1(LEAVE, "Leaving  StopProtocol: %u", dwErr);
00118
00119     return dwErr;
00120 }
00121
00122
00123
00124 DWORD
00125 WINAPI
00126 GetGlobalInfo (
00127     IN     PVOID  GlobalInfo,
00128     IN OUT PULONG   BufferSize,
00129     OUT    PULONG StructureVersion,
00130     OUT    PULONG   StructureSize,
00131     OUT    PULONG   StructureCount
00132     )
00133 /*++
00134
00135 Routine Description
00136     The function is called by the IP Router Manager, usually because of a
00137     query by the admin utility.  We see if we have space enough to return
00138     our global config. If we do, we return it, otherwise we return the size
00139     needed.
00140
00141 Arguments
00142     GlobalInfo      Pointer to allocated buffer to store our config
00143     BufferSize      Size of config.
00144
00145 Return Value
00146     NO_ERROR                    Success
00147     ERROR_INSUFFICIENT_BUFFER   If the size of the buffer is too small
00148     Error Code                  o/w
00149
00150 --*/
00151 {
00152     DWORD dwErr = NO_ERROR;
00153
00154     TRACE2(ENTER, "Entering GetGlobalInfo: 0x%08x 0x%08x",
00155            GlobalInfo, BufferSize);
00156
00157     do                          // breakout loop
00158     {
00159         // validate parameters
00160         if (!BufferSize)
00161         {
00162             dwErr = ERROR_INVALID_PARAMETER;
00163             break;
00164         }
00165
00166         dwErr = CM_GetGlobalInfo(GlobalInfo,
00167                                  BufferSize,
00168                                  StructureVersion,
00169                                  StructureSize,
00170                                  StructureCount);
00171     } while(FALSE);
00172
00173     TRACE1(LEAVE, "Leaving  GetGlobalInfo: %u", dwErr);
00174
00175     return dwErr;
00176 }
00177
00178
00179
00180 DWORD
00181 WINAPI
00182 SetGlobalInfo (
00183     IN  PVOID   GlobalInfo,
00184     IN  ULONG StructureVersion,
00185     IN  ULONG   StructureSize,
00186     IN  ULONG   StructureCount
00187     )
00188 /*++
00189
00190 Routine Description
00191     Called by the IP Router Manager usually in response to an admin utility
00192     changing the global config.  We verify the info and set it.
00193
00194 Arguments
00195     GlobalInfo                  Our globals configuration
00196
00197 Return Value
00198     NO_ERROR                    Success
00199     Error Code                  o/w
00200
00201 --*/
00202 {
00203     DWORD dwErr = NO_ERROR;
00204
00205     TRACE1(ENTER, "Entering SetGlobalInfo: 0x%08x", GlobalInfo);
00206
00207     do                          // breakout loop
00208     {
00209         // validate parameters
00210         if (!GlobalInfo)
00211         {
00212             dwErr = ERROR_INVALID_PARAMETER;
00213             break;
00214         }
00215
00216         dwErr = CM_SetGlobalInfo(GlobalInfo);
00217
00218     } while(FALSE);
00219
00220     TRACE1(LEAVE, "Leaving  SetGlobalInfo: %u", dwErr);
00221
00222     return NO_ERROR;
00223 }
00224
00225
00226
00227
00228
00229
00230 DWORD
00231 WINAPI
00232 AddInterface (
00233     IN LPWSTR               InterfaceName,
00234     IN ULONG              InterfaceIndex,
00235     IN NET_INTERFACE_TYPE   InterfaceType,
00236     IN DWORD                MediaType,
00237     IN WORD                 AccessType,
00238     IN WORD                 ConnectionType,
00239     IN PVOID              InterfaceInfo,
00240     IN ULONG                StructureVersion,
00241     IN ULONG                StructureSize,
00242     IN ULONG                StructureCount
00243     )
00244 /*++
00245
00246 Routine Description
00247     Called by the ip router manager to add an interface when it finds our
00248     information block within the interface's configuration.  We verify the
00249     information and create an entry for the interface in our interface
00250     table.  Then we see all the configured addresses for the interface and
00251     create a binding structure for each address The interface comes up as
00252     UNBOUND-DISABLED (INACTIVE).
00253
00254 Arguments
00255     InterfaceName   The name of the interface, used for logging.
00256     InterfaceIndex  The positive integer used to refer to this interface.
00257     AccessType      Access type of the interface
00258     InterfaceInfo   Our config for this interface
00259
00260 Return Value
00261     NO_ERROR        Success
00262     Error Code      o/w
00263
00264 --*/
00265 {
00266     DWORD dwErr = NO_ERROR;
00267
00268     TRACE4(ENTER, "Entering AddInterface: %S %u %u 0x%08x",
00269            InterfaceName, InterfaceIndex, AccessType, InterfaceInfo);
00270
00271     // interface properties unused for now
00272     UNREFERENCED_PARAMETER(InterfaceType);
00273     UNREFERENCED_PARAMETER(MediaType);
00274     UNREFERENCED_PARAMETER(ConnectionType);
00275
00276     if (AccessType != IF_ACCESS_POINTTOPOINT)
00277         AccessType = IF_ACCESS_BROADCAST;
00278
00279     do                          // breakout loop
00280     {
00281         // validate parameters
00282         if ((wcslen(InterfaceName) is 0) or
00283             !((AccessType is IF_ACCESS_BROADCAST) or
00284               (AccessType is IF_ACCESS_POINTTOPOINT)) or
00285             !InterfaceInfo)
00286         {
00287             dwErr = ERROR_INVALID_PARAMETER;
00288             break;
00289         }
00290
00291         dwErr = NM_AddInterface(InterfaceName,
00292                                 InterfaceIndex,
00293                                 AccessType,
00294                                 InterfaceInfo);
00295     } while(FALSE);
00296
00297     TRACE1(LEAVE, "Leaving  AddInterface: %u", dwErr);
00298
00299     return dwErr;
00300 }
00301
00302
00303
00304 DWORD
00305 WINAPI
00306 DeleteInterface (
00307     IN ULONG  InterfaceIndex
00308     )
00309 /*++
00310
00311 Routine Description
00312     Called by the ip router manager to delete an interface and free its
00313     resources. If the interface is ACTIVE we shut it down.
00314
00315 Arguments
00316     InterfaceIndex  The index of the interface to be deleted
00317
00318 Return Value
00319     NO_ERROR        Success
00320     Error Code      o/w
00321
00322 --*/
00323 {
00324     DWORD dwErr = NO_ERROR;
00325
00326     TRACE1(ENTER, "Entering DeleteInterface: %u", InterfaceIndex);
00327
00328     dwErr = NM_DeleteInterface(InterfaceIndex);
00329
00330     TRACE1(LEAVE, "Leaving  DeleteInterface: %u", dwErr);
00331
00332     return dwErr;
00333 }
00334
00335
00336
00337 DWORD
00338 WINAPI
00339 InterfaceStatus (
00340     IN ULONG  InterfaceIndex,
00341     IN BOOL     InterfaceActive,
00342     IN DWORD    StatusType,
00343     IN PVOID  StatusInfo
00344     )
00345 /*++
00346
00347 Routine Description
00348
00349     Called by ip router manager to bind/unbind/activate/deactivate interfaces.
00350
00351     BIND      (
00352                (StatusType is RIS_INTERFACE_ADDRESS_CHANGE) and
00353                (((PIP_ADAPTER_BINDING_INFO) StatusInfo)->AddressCount > 0)
00354               )
00355
00356     Called by the ip router manager once it learns the address(es) on an
00357     interface.  This may happen as soon as the router starts (after the
00358     interface is added, of course) when the interface has a static address
00359     or may happen when an interface acquires a DHCP address or may happen
00360     when IPCP acquires the address for a dial up link.  The binding may
00361     consist of one or more addresses.
00362
00363     UNBIND    (
00364                (StatusType is RIS_INTERFACE_ADDRESS_CHANGE) and
00365                (((PIP_ADAPTER_BINDING_INFO) StatusInfo)->AddressCount is 0)
00366               )
00367
00368     Called when the interface loses its ip Address(es). This may happen
00369     when the interface is shutting down. It may be because an admin
00370     disabled IP on the interface (as opposed to just disabling the protocol
00371     on the interface). It can happen when the admin releases a DHCP
00372     acquired interface or when a dial up link disconnects.
00373
00374     ENABLED   (RIS_INTERFACE_ENABLED)
00375
00376     Called to enable the interface after it has been added or when the
00377     interface is being reenabled after being disabled by the admin.  The
00378     bindings on an interface are kept across Enable-Disable.
00379
00380     DISABLED  (RIS_INTERFACE_DISABLED)
00381
00382     Called to disable an interface.  This is usually in response to an
00383     admin setting the AdminStatus in IP to DOWN.  This is different from an
00384     admin trying to disable an interface by setting a flag in our interface
00385     config because that is opaque to IP. That is a routing protocol
00386     specific disable and is conveyed to us via SetInterfaceConfig() calls.
00387     THIS IS AN IMPORTANT DISTINCTION. A ROUTING PROTOCOL NEEDS TO MANTAIN
00388     TWO STATES - AN NT STATE AND A PROTOCOL SPECIFIC STATE.
00389
00390     INTERFACE ACTIVE
00391
00392     This flag is used to activate the protocol over the interface
00393     independent of whether the interface has been bound or enabled.
00394     An unnumbered interface will not have a binding even when activated.
00395
00396 Arguments
00397     InterfaceIndex  The index of the interface in question
00398     InterfaceActive Whether the interface can send and receive data
00399     StatusType      RIS_INTERFACE_[ADDRESS_CHANGED|ENABLED|DISABLED]
00400     SattusInfo      Pointer to IP_ADAPTER_BINDING_INFO containing info
00401                     about the addresses on the interface
00402
00403 Return Value
00404     NO_ERROR        Success
00405     Error Code      o/w
00406
00407 --*/
00408 {
00409     DWORD dwErr = NO_ERROR;
00410
00411     TRACE4(ENTER, "Entering InterfaceStatus: %u %u %u 0x%08x",
00412            InterfaceIndex, InterfaceActive, StatusType, StatusInfo);
00413
00414     do                          // breakout loop
00415     {
00416         dwErr = NM_InterfaceStatus(InterfaceIndex,
00417                                    InterfaceActive,
00418                                    StatusType,
00419                                    StatusInfo);
00420     } while(FALSE);
00421
00422     TRACE1(LEAVE, "Leaving  InterfaceStatus: %u", dwErr);
00423
00424     return dwErr;
00425 }
00426
00427
00428
00429 DWORD
00430 WINAPI
00431 GetInterfaceConfigInfo (
00432     IN      ULONG InterfaceIndex,
00433     IN      PVOID   InterfaceInfo,
00434     IN  OUT PULONG  BufferSize,
00435     OUT     PULONG  StructureVersion,
00436     OUT     PULONG  StructureSize,
00437     OUT     PULONG  StructureCount
00438     )
00439 /*++
00440
00441 Routine Description
00442     Called by the IP Router Manager to retrieve an interface's
00443     configuration.  Usually this is because an admin utility is displaying
00444     this information.  The Router Manager calls us with a NULL config and
00445     ZERO size. We return the required size to it.  It then allocates the
00446     needed memory and calls us a second time with a valid buffer.  We
00447     validate parameters each time and copy out our config if we can.
00448
00449 Arguments
00450     InterfaceIndex      Index of the interface being queried
00451     InterfaceInfo       Pointer to buffer to store the config
00452     BufferSize          Size of the buffer
00453
00454 Return Value
00455     NO_ERROR        Success
00456     Error Code      o/w
00457
00458 --*/
00459 {
00460     DWORD dwErr = NO_ERROR;
00461
00462     TRACE3(ENTER, "Entering GetInterfaceConfigInfo: %u 0x%08x 0x%08x",
00463            InterfaceIndex, InterfaceInfo, BufferSize);
00464
00465     do                          // breakout loop
00466     {
00467         // validate parameters
00468         if(BufferSize is NULL)
00469         {
00470             dwErr = ERROR_INVALID_PARAMETER;
00471             break;
00472         }
00473
00474         dwErr = NM_GetInterfaceInfo(InterfaceIndex,
00475                                     InterfaceInfo,
00476                                     BufferSize,
00477                                     StructureVersion,
00478                                     StructureSize,
00479                                     StructureCount);
00480     } while(FALSE);
00481
00482     TRACE1(LEAVE, "Leaving  GetInterfaceConfigInfo: %u",
00483            dwErr);
00484
00485     return dwErr;
00486 }
00487
00488
00489
00490 DWORD
00491 WINAPI
00492 SetInterfaceConfigInfo (
00493     IN ULONG  InterfaceIndex,
00494     IN PVOID  InterfaceInfo,
00495     IN ULONG    StructureVersion,
00496     IN ULONG    StructureSize,
00497     IN ULONG    StructureCount
00498     )
00499 /*++
00500
00501 Routine Description
00502     Called by the IP Router Manager to set an interface's configuration.
00503     Usually this is because an admin utility modified this information.
00504     After validating parameters we update our config if we can.
00505
00506 Arguments
00507     InterfaceIndex      Index of the interface being updated
00508     InterfaceInfo       Buffer with our updated configuration
00509
00510 Return Value
00511     NO_ERROR        Success
00512     Error Code      o/w
00513
00514 --*/
00515 {
00516     DWORD dwErr = NO_ERROR;
00517
00518     TRACE2(ENTER, "Entering SetInterfaceConfigInfo: %u 0x%08x",
00519            InterfaceIndex, InterfaceInfo);
00520
00521     do                          // breakout loop
00522     {
00523         // validate parameters
00524         if(InterfaceInfo is NULL)
00525         {
00526             dwErr = ERROR_INVALID_PARAMETER;
00527             break;
00528         }
00529
00530         dwErr = NM_SetInterfaceInfo(InterfaceIndex, InterfaceInfo);
00531     } while(FALSE);
00532
00533     TRACE1(LEAVE, "Leaving  SetInterfaceConfigInfo: %u", dwErr);
00534
00535     return dwErr;
00536 }
00537
00538
00539
00540
00541
00542
00543 DWORD
00544 WINAPI
00545 GetEventMessage (
00546     OUT ROUTING_PROTOCOL_EVENTS  *Event,
00547     OUT MESSAGE                  *Result
00548     )
00549 /*++
00550
00551 Routine Description
00552     This is called by the IP Router Manager if we indicate that we have a
00553     message in our queue to be delivered to it (by setting the
00554     g_ce.hMgrNotificationEvent)
00555
00556 Arguments
00557     Event               Routing Protocol Event Type
00558     Result              Message associated with the event
00559
00560 Return Value
00561     NO_ERROR            Success
00562     Error Code          o/w
00563
00564 --*/
00565 {
00566     DWORD dwErr = NO_ERROR;
00567
00568     TRACE2(ENTER, "Entering GetEventMessage: 0x%08x 0x%08x",
00569            Event, Result);
00570
00571     do                          // breakout loop
00572     {
00573         // validate parameters
00574         if (!Event or !Result)
00575         {
00576             dwErr = ERROR_INVALID_PARAMETER;
00577             break;
00578         }
00579
00580         dwErr = CM_GetEventMessage(Event, Result);
00581
00582     } while(FALSE);
00583
00584     TRACE1(LEAVE, "Leaving  GetEventMessage: %u", dwErr);
00585
00586     return dwErr;
00587 }
00588
00589
00590
00591 DWORD
00592 WINAPI
00593 DoUpdateRoutes (
00594     IN ULONG  InterfaceIndex
00595     )
00596 /*++
00597
00598 Routine Description
00599     This function is called by the IP Router Manger to ask us to update
00600     routes over a Demand Dial link.  The link has already been brought up
00601     so should be in ENABLED-BOUND state.  After we are done we need to set
00602     the g_ce.hMgrNotificationEvent to inform the Router Manager that we
00603     have a message in our queue to be delivered to it.  The Router Manager
00604     will call our GetEventMessage() function in which we will inform it
00605     that we are done with update routes (and the routes have been stored in
00606     RTMv2). The Router Manager will "freeze" these routes by converting
00607     them to AUTOSTATIC.
00608
00609 Arguments
00610     InterfaceIndex      Interface index on which to do the update
00611
00612 Return Value
00613     NO_ERROR            Success
00614     Error Code          o/w
00615
00616 --*/
00617 {
00618     DWORD dwErr = NO_ERROR;
00619
00620     TRACE1(ENTER, "Entering DoUpdateRoutes: %u", InterfaceIndex);
00621
00622     dwErr = NM_DoUpdateRoutes(InterfaceIndex);
00623
00624     TRACE1(LEAVE, "Leaving  DoUpdateRoutes: %u", dwErr);
00625
00626     return dwErr;
00627 }
00628
00629
00630
00631
00632
00633
00634 DWORD
00635 WINAPI
00636 MibCreate (
00637     IN ULONG  InputDataSize,
00638     IN PVOID  InputData
00639     )
00640 /*++
00641
00642 Routine Description
00643     This function does nothing, since IPSAMPLE does not support creation of
00644     interface objects via SNMP.  However, this could be implemented as a
00645     sequence of calls to NM_AddInterface(), IE_BindInterface() and
00646     IE_EnableInterface.  The input data would then have to contain the
00647     interface's index, configuration, and binding.
00648
00649 Arguments
00650     InputData           Relevant input, some struct defined in ipsamplerm.h
00651     InputDataSize       Size of the input
00652
00653 Return Value
00654     ERROR_CAN_NOT_COMPLETE      for now
00655
00656 --*/
00657 {
00658     DWORD dwErr = ERROR_CAN_NOT_COMPLETE;
00659
00660     TRACE2(ENTER, "Entering MibCreate: %u 0x%08x",
00661            InputDataSize, InputData);
00662
00663     TRACE1(LEAVE, "Leaving  MibCreate: %u", dwErr);
00664
00665     return dwErr;
00666 }
00667
00668
00669
00670 DWORD
00671 WINAPI
00672 MibDelete (
00673     IN ULONG  InputDataSize,
00674     IN PVOID  InputData
00675     )
00676 /*++
00677
00678 Routine Description
00679     This function does nothing, since IPSAMPLE does not support deletion of
00680     interface objects via SNMP.  However, this could be implemented as a
00681     call to NM_DeleteInterface().  The input data would then have to
00682     contain the interface's index.
00683
00684 Arguments
00685     InputData           Relevant input, some struct defined in ipsamplerm.h
00686     InputDataSize       Size of the input
00687
00688 Return Value
00689     ERROR_CAN_NOT_COMPLETE      for now
00690
00691 --*/
00692 {
00693     DWORD dwErr = ERROR_CAN_NOT_COMPLETE;
00694
00695     TRACE2(ENTER, "Entering MibDelete: %u 0x%08x",
00696            InputDataSize, InputData);
00697
00698     TRACE1(LEAVE, "Leaving  MibDelete: %u", dwErr);
00699
00700     return dwErr;
00701 }
00702
00703
00704
00705 DWORD
00706 WINAPI
00707 MibSet (
00708     IN ULONG  InputDataSize,
00709     IN PVOID  InputData
00710     )
00711 /*++
00712
00713 Routine Description
00714     This function sets IPSAMPLE's global or interface configuration.
00715
00716 Arguments
00717     InputData           Relevant input, struct IPSAMPLE_MIB_SET_INPUT_DATA
00718     InputDataSize       Size of the input
00719
00720 Return Value
00721     NO_ERROR            success
00722     Error Code          o/w
00723
00724 --*/
00725 {
00726     DWORD dwErr = NO_ERROR;
00727
00728     TRACE2(ENTER, "Entering MibSet: %u 0x%08x",
00729            InputDataSize, InputData);
00730
00731     do                          // breakout loop
00732     {
00733         // validate parameters
00734         if ((!InputData) or
00735             (InputDataSize < sizeof(IPSAMPLE_MIB_SET_INPUT_DATA)))
00736         {
00737             dwErr = ERROR_INVALID_PARAMETER;
00738             break;
00739         }
00740
00741         dwErr = MM_MibSet((PIPSAMPLE_MIB_SET_INPUT_DATA) InputData);
00742
00743     } while(FALSE);
00744
00745     TRACE1(LEAVE, "Leaving  MibSet: %u", dwErr);
00746
00747     return dwErr;
00748 }
00749
00750
00751
00752 DWORD
00753 WINAPI
00754 MibGet (
00755     IN      ULONG InputDataSize,
00756     IN      PVOID InputData,
00757     IN OUT  PULONG  OutputDataSize,
00758     OUT     PVOID OutputData
00759     )
00760 /*++
00761
00762 Routine Description
00763     This function retrieves one of...
00764     . global configuration
00765     . interface configuration
00766     . global stats
00767     . interface stats
00768     . interface binding
00769
00770     Called by an admin (SNMP) utility.  It actually passes through the IP
00771     Router Manager, but all that does is demux the call to the desired
00772     routing protocol.
00773
00774 Arguments
00775     InputData           Relevant input, struct IPSAMPLE_MIB_GET_INPUT_DATA
00776     InputDataSize       Size of the input
00777     OutputData          Buffer for struct IPSAMPLE_MIB_GET_OUTPUT_DATA
00778     OutputDataSize      IN  size of output buffer received
00779                         OUT size of output buffer required
00780
00781 Return Value
00782     NO_ERROR            success
00783     Error Code          o/w
00784
00785 --*/
00786 {
00787     DWORD dwErr = NO_ERROR;
00788
00789     TRACE4(ENTER, "Entering MibGet: %u 0x%08x 0x%08x 0x%08x",
00790            InputDataSize, InputData, OutputDataSize, OutputData);
00791
00792     do                          // breakout loop
00793     {
00794         // validate parameters
00795         if ((!InputData) or
00796             (InputDataSize < sizeof(IPSAMPLE_MIB_GET_INPUT_DATA)) or
00797             (!OutputDataSize))
00798         {
00799             dwErr = ERROR_INVALID_PARAMETER;
00800             break;
00801         }
00802
00803         dwErr = MM_MibGet((PIPSAMPLE_MIB_GET_INPUT_DATA) InputData,
00804                           (PIPSAMPLE_MIB_GET_OUTPUT_DATA) OutputData,
00805                           OutputDataSize,
00806                           GET_EXACT);
00807
00808     } while(FALSE);
00809
00810     TRACE1(LEAVE, "Leaving  MibGet: %u", dwErr);
00811
00812     return dwErr;
00813 }
00814
00815
00816
00817 DWORD
00818 WINAPI
00819 MibGetFirst (
00820     IN      ULONG InputDataSize,
00821     IN      PVOID InputData,
00822     IN OUT  PULONG  OutputDataSize,
00823     OUT     PVOID   OutputData
00824     )
00825 /*++
00826
00827 Routine Description
00828     This function retrieves one of...
00829     . global configuration
00830     . interface configuration
00831     . global stats
00832     . interface stats
00833     . interface binding
00834
00835     It differs from MibGet() in that it always returns the FIRST entry in
00836     whichever table is being queried.  There is only one entry in the
00837     global configuration and global stats tables, but the interface
00838     configuration, interface stats, and interface binding tables are sorted
00839     by IP address; this function returns the first entry from these.
00840
00841 Arguments
00842     InputData           Relevant input, struct IPSAMPLE_MIB_GET_INPUT_DATA
00843     InputDataSize       Size of the input
00844     OutputData          Buffer for struct IPSAMPLE_MIB_GET_OUTPUT_DATA
00845     OutputDataSize      IN  size of output buffer received
00846                         OUT size of output buffer required
00847
00848 Return Value
00849     NO_ERROR            success
00850     Error Code          o/w
00851
00852 --*/
00853 {
00854     DWORD dwErr = NO_ERROR;
00855
00856     TRACE4(ENTER, "Entering MibGetFirst: %u 0x%08x 0x%08x 0x%08x",
00857            InputDataSize, InputData, OutputDataSize, OutputData);
00858
00859     do                          // breakout loop
00860     {
00861         // validate parameters
00862         if ((!InputData) or
00863             (InputDataSize < sizeof(IPSAMPLE_MIB_GET_INPUT_DATA)) or
00864             (!OutputDataSize))
00865         {
00866             dwErr = ERROR_INVALID_PARAMETER;
00867             break;
00868         }
00869
00870         dwErr = MM_MibGet((PIPSAMPLE_MIB_GET_INPUT_DATA) InputData,
00871                           (PIPSAMPLE_MIB_GET_OUTPUT_DATA) OutputData,
00872                           OutputDataSize,
00873                           GET_FIRST);
00874
00875     } while(FALSE);
00876
00877     TRACE1(LEAVE, "Leaving  MibGetFirst: %u", dwErr);
00878
00879     return dwErr;
00880 }
00881
00882
00883
00884 DWORD
00885 WINAPI
00886 MibGetNext (
00887     IN      ULONG   InputDataSize,
00888     IN      PVOID InputData,
00889     IN OUT  PULONG  OutputDataSize,
00890     OUT     PVOID OutputData
00891     )
00892 /*++
00893
00894 Routine Description
00895     This function retrieves one of...
00896     . global configuration
00897     . interface configuration
00898     . global stats
00899     . interface stats
00900     . interface binding
00901
00902     It differs from both MibGet() and MibGetFirst() in that it returns the
00903     entry AFTER the one specified in the indicated table.  Thus, in the
00904     interface configuration, interface stats, and interface binding tables,
00905     this function supplies the entry after the one with the input address.
00906
00907     If there are no more entries in the table being queried we return
00908     ERROR_NO_MORE_ITEMS.  Unlike SNMP we don't walk to the next table.
00909     This does not take away any functionality since the NT SNMP agent
00910     will try the next variable (having ID one greater than the ID passed
00911     in) automatically on getting this error.
00912
00913 Arguments
00914     InputData           Relevant input, struct IPSAMPLE_MIB_GET_INPUT_DATA
00915     InputDataSize       Size of the input
00916     OutputData          Buffer for struct IPSAMPLE_MIB_GET_OUTPUT_DATA
00917     OutputDataSize      IN  size of output buffer received
00918                         OUT size of output buffer required
00919
00920 Return Value
00921     NO_ERROR            success
00922     Error Code          o/w
00923
00924 --*/
00925 {
00926     DWORD                           dwErr   = NO_ERROR;
00927
00928     TRACE4(ENTER, "Entering MibGetFirst: %u 0x%08x 0x%08x 0x%08x",
00929            InputDataSize, InputData, OutputDataSize, OutputData);
00930
00931     do                          // breakout loop
00932     {
00933         // validate parameters
00934         if ((!InputData) or
00935             (InputDataSize < sizeof(IPSAMPLE_MIB_GET_INPUT_DATA)) or
00936             (!OutputDataSize))
00937         {
00938             dwErr = ERROR_INVALID_PARAMETER;
00939             break;
00940         }
00941
00942         dwErr = MM_MibGet((PIPSAMPLE_MIB_GET_INPUT_DATA) InputData,
00943                           (PIPSAMPLE_MIB_GET_OUTPUT_DATA) OutputData,
00944                           OutputDataSize,
00945                           GET_NEXT);
00946
00947     } while(FALSE);
00948
00949     TRACE1(LEAVE, "Leaving  MibGetNext: %u", dwErr);
00950
00951     return dwErr;
00952 }
00953
00954
00955
00956 DWORD
00957 WINAPI
00958 MibSetTrapInfo (
00959     IN  HANDLE  Event,
00960     IN  ULONG   InputDataSize,
00961     IN  PVOID InputData,
00962     OUT PULONG  OutputDataSize,
00963     OUT PVOID OutputData
00964     )
00965 /*++
00966
00967 Routine Description
00968     This function does nothing at the moment...
00969
00970 Return Value
00971     ERROR_CAN_NOT_COMPLETE      for now
00972
00973 --*/
00974 {
00975     DWORD dwErr = ERROR_CAN_NOT_COMPLETE;
00976
00977     TRACE0(ENTER, "Entering MibSetTrapInfo");
00978     TRACE1(LEAVE, "Leaving  MibSetTrapInfo: %u", dwErr);
00979
00980     return dwErr;
00981 }
00982
00983
00984
00985 DWORD
00986 WINAPI
00987 MibGetTrapInfo (
00988     IN  ULONG InputDataSize,
00989     IN  PVOID InputData,
00990     OUT PULONG  OutputDataSize,
00991     OUT PVOID OutputData
00992     )
00993 /*++
00994
00995 Routine Description
00996     This function does nothing at the moment...
00997
00998 Return Value
00999     ERROR_CAN_NOT_COMPLETE      for now
01000
01001 --*/
01002 {
01003     DWORD dwErr = ERROR_CAN_NOT_COMPLETE;
01004
01005     TRACE0(ENTER, "Entering MibGetTrapInfo");
01006     TRACE1(LEAVE, "Leaving  MibGetTrapInfo: %u", dwErr);
01007
01008     return dwErr;
01009 }
01010
01011
01012
01013 //----------------------------------------------------------------------------
01014 // Function:    RegisterProtocol
01015 //
01016 // Returns protocol ID and functionality for IPRIP
01017 //----------------------------------------------------------------------------
01018
01019 DWORD
01020 APIENTRY
01021 RegisterProtocol(
01022     IN OUT PMPR_ROUTING_CHARACTERISTICS pRoutingChar,
01023     IN OUT PMPR_SERVICE_CHARACTERISTICS pServiceChar
01024     )
01025 /*++
01026
01027 Routine Description
01028     This is the first function called by the IP Router Manager.  The Router
01029     Manager tells the routing protocol its version and capabilities.  It
01030     also tells our DLL, the ID of the protocol it expects us to register.
01031     This allows one DLL to support multiple routing protocols.  We return
01032     the functionality we support and a pointer to our functions.
01033
01034 Arguments
01035     pRoutingChar    The routing characteristics
01036     pServiceChar    The service characteristics (IPX 'thingy')
01037
01038 Return Value
01039     NO_ERROR                success
01040     ERROR_NOT_SUPPORTED     o/w
01041
01042 --*/
01043 {
01044     DWORD   dwErr = NO_ERROR;
01045
01046     TRACE0(ENTER, "Entering RegisterProtocol");
01047
01048     do                          // breakout loop
01049     {
01050         if(pRoutingChar->dwProtocolId != MS_IP_SAMPLE)
01051         {
01052             dwErr = ERROR_NOT_SUPPORTED;
01053             break;
01054         }
01055
01056         if  ((pRoutingChar->fSupportedFunctionality
01057               & (RF_ROUTING|RF_DEMAND_UPDATE_ROUTES)) !=
01058              (RF_ROUTING|RF_DEMAND_UPDATE_ROUTES))
01059         {
01060             dwErr = ERROR_NOT_SUPPORTED;
01061             break;
01062         }
01063
01064         pRoutingChar->fSupportedFunctionality =
01065             (RF_ROUTING | RF_DEMAND_UPDATE_ROUTES);
01066
01067         // Since we are not a service advertiser (and IPX thing)
01068         pServiceChar->fSupportedFunctionality = 0;
01069
01070         pRoutingChar->pfnStartProtocol      = StartProtocol;
01071         pRoutingChar->pfnStartComplete      = StartComplete;
01072         pRoutingChar->pfnStopProtocol       = StopProtocol;
01073         pRoutingChar->pfnGetGlobalInfo      = GetGlobalInfo;
01074         pRoutingChar->pfnSetGlobalInfo      = SetGlobalInfo;
01075         pRoutingChar->pfnQueryPower         = NULL;
01076         pRoutingChar->pfnSetPower           = NULL;
01077
01078         pRoutingChar->pfnAddInterface       = AddInterface;
01079         pRoutingChar->pfnDeleteInterface    = DeleteInterface;
01080         pRoutingChar->pfnInterfaceStatus    = InterfaceStatus;
01081         pRoutingChar->pfnGetInterfaceInfo   = GetInterfaceConfigInfo;
01082         pRoutingChar->pfnSetInterfaceInfo   = SetInterfaceConfigInfo;
01083
01084         pRoutingChar->pfnGetEventMessage    = GetEventMessage;
01085
01086         pRoutingChar->pfnUpdateRoutes       = DoUpdateRoutes;
01087
01088         pRoutingChar->pfnConnectClient      = NULL;
01089         pRoutingChar->pfnDisconnectClient   = NULL;
01090
01091         pRoutingChar->pfnGetNeighbors       = NULL;
01092         pRoutingChar->pfnGetMfeStatus       = NULL;
01093
01094         pRoutingChar->pfnMibCreateEntry     = MibCreate;
01095         pRoutingChar->pfnMibDeleteEntry     = MibDelete;
01096         pRoutingChar->pfnMibGetEntry        = MibGet;
01097         pRoutingChar->pfnMibSetEntry        = MibSet;
01098         pRoutingChar->pfnMibGetFirstEntry   = MibGetFirst;
01099         pRoutingChar->pfnMibGetNextEntry    = MibGetNext;
01100         pRoutingChar->pfnMibSetTrapInfo     = MibSetTrapInfo;
01101         pRoutingChar->pfnMibGetTrapInfo     = MibGetTrapInfo;
01102     } while (FALSE);
01103
01104     TRACE1(LEAVE, "Leaving RegisterProtocol: %u", dwErr);
01105
01106     return dwErr;
01107 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagLINE_INFO Member List

This is the complete list of members for tagLINE_INFO, including all inherited members.
connInfo | tagLINE_INFO
eCallState | tagLINE_INFO
fCaller | tagLINE_INFO
hCommLink | tagLINE_INFO
hevtCall | tagLINE_INFO
pstnHandle | tagLINE_INFO
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/Policy.h Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

Policy.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 2000
00006 //
00007 //  File:       policy.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "certpsam.h"
00012 #include "resource.h"
00013
00014 #define wszCLASS_CERTPOLICYSAMPLEPREFIX TEXT("CertAuthority_Sample")
00015
00016 #define wszCLASS_CERTPOLICYSAMPLE wszCLASS_CERTPOLICYSAMPLEPREFIX  wszCERTPOLICYMODULE_POSTFIX
00017
00018 #define wszCLASS_CERTMANAGESAMPLE wszCLASS_CERTPOLICYSAMPLEPREFIX wszCERTMANAGEPOLICY_POSTFIX
00019
00020 #define wsz_SAMPLE_NAME           L"CertXPol.dll"
00021 #define wsz_SAMPLE_DESCRIPTION    L"Sample Policy Module"
00022 #define wsz_SAMPLE_COPYRIGHT      L"(c)1999-2000 Microsoft"
00023 #define wsz_SAMPLE_FILEVER        L"v 1.0"
00024 #define wsz_SAMPLE_PRODUCTVER     L"v 5.00"
00025
00026 #ifndef wszATTREMAIL1
00027 # define wszATTREMAIL1      TEXT("E")
00028 # define wszATTREMAIL2      TEXT("EMail")
00029 #endif
00030
00031 HRESULT GetServerCallbackInterface(ICertServerPolicy** ppServer, LONG Context);
00032
00033
00034 //
00035 // Class CCertPolicySample
00036 //
00037 // Actual policy module for a CA Policy
00038 //
00039 //
00040
00041 class CCertPolicySample:
00042     public CComDualImpl<ICertPolicy, &IID_ICertPolicy, &LIBID_CERTPOLICYSAMPLELib>,
00043     public ISupportErrorInfo,
00044     public CComObjectRoot,
00045     public CComCoClass<CCertPolicySample, &CLSID_CCertPolicySample>
00046 {
00047 public:
00048     CCertPolicySample()
00049     {
00050         m_bstrDescription = NULL;
00051
00052         // RevocationExtension variables:
00053
00054   m_dwRevocationFlags = 0;
00055   m_cCDPRevocationURL = 0;
00056   m_apstrCDPRevocationURL = NULL;
00057   m_wszASPRevocationURL = NULL;
00058
00059         m_dwDispositionFlags = 0;
00060         m_dwEditFlags = 0;
00061
00062   // CertTypeExtension variables:
00063
00064   m_astrSubjectAltNameProp[0] = NULL;
00065   m_astrSubjectAltNameProp[1] = NULL;
00066   m_astrSubjectAltNameObjectId[0] = NULL;
00067   m_astrSubjectAltNameObjectId[1] = NULL;
00068
00069   // AuthorityInfoAccessExtension variables:
00070
00071         m_dwIssuerCertURLFlags = 0;
00072         m_cIssuerCertURL = 0;
00073   m_apstrIssuerCertURL = NULL;
00074
00075   m_cEnableRequestExtensions = 0;
00076   m_apstrEnableRequestExtensions = NULL;
00077
00078   m_cDisableExtensions = 0;
00079   m_apstrDisableExtensions = NULL;
00080
00081   // CA Name
00082         m_wszRegStorageLoc = NULL;
00083
00084   m_bstrCAName = NULL;
00085         m_bstrCASanitizedName = NULL;
00086         m_bstrCASanitizedDSName = NULL;
00087         m_bstrMachineDNSName = NULL;
00088
00089         InitializeCriticalSection(&m_PolicyCriticalSection);
00090
00091         // CA and cert type info
00092
00093         m_CAType = ENUM_UNKNOWN_CA;
00094
00095         m_hrLastUpdateResult = S_OK;
00096         m_pCert = NULL;
00097         m_iCRL = 0;
00098
00099     }
00100     ~CCertPolicySample();
00101
00102 BEGIN_COM_MAP(CCertPolicySample)
00103     COM_INTERFACE_ENTRY(IDispatch)
00104     COM_INTERFACE_ENTRY(ICertPolicy)
00105     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00106 END_COM_MAP()
00107
00108 DECLARE_NOT_AGGREGATABLE(CCertPolicySample)
00109 // Remove the comment from the line above if you don't want your object to
00110 // support aggregation.  The default is to support it
00111
00112 DECLARE_REGISTRY(
00113     CCertPolicySample,
00114     wszCLASS_CERTPOLICYSAMPLE TEXT(".1"),
00115     wszCLASS_CERTPOLICYSAMPLE,
00116     IDS_CERTPOLICY_DESC,
00117     THREADFLAGS_BOTH)
00118
00119 // ISupportsErrorInfo
00120     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00121
00122 // ICertPolicy
00123 public:
00124
00125     STDMETHOD(Initialize)(
00126       /* [in] */ BSTR const strConfig);
00127
00128     STDMETHOD(VerifyRequest)(
00129       /* [in] */ BSTR const strConfig,
00130       /* [in] */ LONG Context,
00131       /* [in] */ LONG bNewRequest,
00132       /* [in] */ LONG Flags,
00133       /* [out, retval] */ LONG __RPC_FAR *pDisposition);
00134
00135     STDMETHOD(GetDescription)(
00136       /* [out, retval] */ BSTR __RPC_FAR *pstrDescription);
00137
00138     STDMETHOD(ShutDown)();
00139
00140     HRESULT AddBasicConstraintsCommon(
00141     IN ICertServerPolicy *pServer,
00142     IN CERT_EXTENSION const *pExtension,
00143         IN BOOL fCA,
00144     IN BOOL fEnableExtension);
00145
00146
00147 protected:
00148
00149     CERT_CONTEXT const *_GetIssuer(
00150     IN ICertServerPolicy *pServer);
00151
00152     HRESULT _EnumerateExtensions(
00153     IN ICertServerPolicy *pServer,
00154     IN LONG bNewRequest,
00155     OPTIONAL OUT BOOL *pfCA);
00156
00157 #if DBG_CERTSRV
00158     VOID _DumpStringArray(
00159     IN char const *pszType,
00160     IN DWORD count,
00161     IN BSTR const *apstr);
00162 #else
00163     #define _DumpStringArray(pszType, count, apstr)
00164 #endif
00165
00166     VOID _FreeStringArray(
00167     IN OUT DWORD *pcString,
00168     IN OUT LPWSTR **papstr);
00169
00170     VOID _Cleanup();
00171
00172
00173     HRESULT _AddStringArray(
00174     IN WCHAR const *pwszzValue,
00175     IN BOOL fURL,
00176     IN OUT DWORD *pcStrings,
00177     IN OUT LPWSTR **papstrRegValues);
00178
00179     HRESULT _ReadRegistryString(
00180     IN HKEY hkey,
00181     IN BOOL fURL,
00182     IN WCHAR const *pwszRegName,
00183     IN WCHAR const *pwszSuffix,
00184     OUT LPWSTR *pwszRegValue);
00185
00186     HRESULT _ReadRegistryStringArray(
00187     IN HKEY hkey,
00188     IN BOOL fURL,
00189     IN DWORD dwFlags,
00190     IN DWORD cRegNames,
00191     IN DWORD *aFlags,
00192     IN WCHAR const * const *apwszRegNames,
00193     IN OUT DWORD *pcStrings,
00194     IN OUT LPWSTR **papstrRegValues);
00195
00196     VOID _InitRevocationExtension(
00197     IN HKEY hkey);
00198
00199     VOID _InitSubjectAltNameExtension(
00200     IN HKEY hkey,
00201     IN WCHAR const *pwszRegName,
00202     IN WCHAR const *pwszObjectId,
00203     IN DWORD iAltName);
00204
00205     VOID _InitAuthorityInfoAccessExtension(
00206     IN HKEY hkey);
00207
00208     VOID _InitRequestExtensionList(
00209     IN HKEY hkey);
00210
00211     VOID _InitDisableExtensionList(
00212     IN HKEY hkey);
00213
00214     HRESULT _AddRevocationExtension(
00215     IN ICertServerPolicy *pServer);
00216
00217     HRESULT _AddCertTypeExtension(
00218     IN ICertServerPolicy *pServer,
00219     IN BOOL fCA);
00220
00221     HRESULT _AddSubjectAltNameExtension(
00222     IN ICertServerPolicy *pServer,
00223     IN DWORD iAltName);
00224
00225     HRESULT _AddAuthorityInfoAccessExtension(
00226     IN ICertServerPolicy *pServer);
00227
00228     HRESULT _AddAuthorityKeyId(
00229     IN ICertServerPolicy *pServer);
00230
00231     HRESULT _AddDefaultKeyUsageExtension(
00232     IN ICertServerPolicy *pServer,
00233     IN BOOL fCA);
00234
00235     HRESULT _AddDefaultBasicConstraintsExtension(
00236     IN ICertServerPolicy *pServer,
00237     IN BOOL fCA);
00238
00239     HRESULT _SetValidityPeriod(
00240     IN ICertServerPolicy *pServer);
00241
00242
00243     // RevocationExtension variables:
00244
00245     PCCERT_CONTEXT m_pCert;
00246
00247     BSTR  m_bstrDescription;
00248
00249     DWORD m_dwRevocationFlags;
00250     DWORD m_cCDPRevocationURL;
00251     LPWSTR *m_apstrCDPRevocationURL;
00252     LPWSTR m_wszASPRevocationURL;
00253
00254     DWORD m_dwDispositionFlags;
00255     DWORD m_dwEditFlags;
00256     DWORD m_CAPathLength;
00257
00258     // AuthorityInfoAccessExtension variables:
00259
00260     DWORD m_dwIssuerCertURLFlags;
00261     DWORD m_cIssuerCertURL;
00262     LPWSTR *m_apstrIssuerCertURL;
00263
00264     DWORD m_cEnableRequestExtensions;
00265     LPWSTR *m_apstrEnableRequestExtensions;
00266
00267     DWORD m_cDisableExtensions;
00268     LPWSTR *m_apstrDisableExtensions;
00269
00270     // SubjectAltNameExtension variables:
00271
00272     BSTR m_astrSubjectAltNameProp[2];
00273     BSTR m_astrSubjectAltNameObjectId[2];
00274
00275     // CertTypeExtension variables:
00276
00277     DWORD m_CertType;
00278
00279     LPWSTR m_wszRegStorageLoc;
00280     BSTR m_bstrCAName;
00281
00282     BSTR m_bstrCASanitizedName;
00283     BSTR m_bstrCASanitizedDSName;
00284
00285     BSTR m_bstrMachineDNSName;
00286
00287     CRITICAL_SECTION m_PolicyCriticalSection;
00288
00289     // CA and cert type info
00290
00291     ENUM_CATYPES m_CAType;
00292
00293     DWORD m_hrLastUpdateResult;
00294
00295     DWORD m_iCert;
00296     DWORD m_iCRL;
00297
00298     //+--------------------------------------
00299     //+--------------------------------------
00300
00301 private:
00302 };
00303
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/obscure/Obscure.c Source File

  • WinUI
  • obscure

Obscure.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  *  Obscure.c
00004  *
00005  *  Copyright (c) 1997 Microsoft Corporation.
00006  *
00007  *  <blah blah standard SDK sample copyright>
00008  *
00009  *  Abstract:
00010  *
00011  *      Sample program to demonstrate how a program can detect
00012  *      whether its client area is totally obscured.
00013  *
00014  *      A program may wish to do this in order to suppress
00015  *      computationally expensive graphics operations when
00016  *      there is no way for the user to see the output.
00017  *
00018  *  Details:
00019  *
00020  *      This program displays the time in its client area.
00021  *      When the client area is completely obscured, there is no
00022  *      point in drawing the time (since the user can't see it),
00023  *      so the application goes to sleep until the client area
00024  *      is again visible.
00025  *
00026  *      To see this program in action, run this application and
00027  *      Notepad simultaneously.  Drag the Notepad window so that
00028  *      it covers this sample program.  Observe that the title
00029  *      changes to "Covered".  Move the Notepad window away, and
00030  *      observe that the title changes to "Uncovered" or "Partially
00031  *      Covered", as appropriate.
00032  *
00033  *****************************************************************************/
00034
00035 #define STRICT
00036 #include <windows.h>
00037
00038 /*****************************************************************************
00039  *
00040  *      Overview
00041  *
00042  *      To determine whether the client area is obscured, determine
00043  *      whether it has an empty clip region.
00044  *
00045  *      To be notified when the client area is again unobscured,
00046  *      invalidate the entire client rectangle and wait for
00047  *      Windows to send a WM_PAINT message.  (Explicit invalidation
00048  *      is required, for if you were obscured by a menu or a window
00049  *      with the CS_SAVEBITS class style, Windows will restore your
00050  *      client area automatically instead of sending a WM_PAINT message.)
00051  *
00052  *      So that you can see the behavior of the application, we will
00053  *      put information in the title of the window.  Watch the taskbar
00054  *      to see the application change its state.
00055  *
00056  *****************************************************************************/
00057
00058 BOOL g_fTimerActive = FALSE;
00059
00060 /*****************************************************************************
00061  *
00062  *      GetClientObscuredness
00063  *
00064  *      Returns one of the OBS_* values.
00065  *
00066  *****************************************************************************/
00067
00068 #define OBS_COMPLETELYCOVERED       0
00069 #define OBS_PARTIALLYVISIBLE        1
00070 #define OBS_COMPLETELYVISIBLE       2
00071
00072 int
00073 GetClientObscuredness(HWND hwnd)
00074 {
00075     HDC hdc;
00076     RECT rc, rcClient;
00077     int iType;
00078
00079     hdc = GetDC(hwnd);
00080     iType = GetClipBox(hdc, &rc);
00081
00082     ReleaseDC(hwnd, hdc);
00083
00084     if (iType == NULLREGION)
00085         return OBS_COMPLETELYCOVERED;
00086     if (iType == COMPLEXREGION)
00087         return OBS_PARTIALLYVISIBLE;
00088
00089     GetClientRect(hwnd, &rcClient);
00090     if (EqualRect(&rc, &rcClient))
00091         return OBS_COMPLETELYVISIBLE;
00092
00093     return OBS_PARTIALLYVISIBLE;
00094 }
00095
00096 /*****************************************************************************
00097  *
00098  *  Obscure_EnsureTimerStopped
00099  *
00100  *      If the timer that causes us to do work is running, then stop it.
00101  *
00102  *****************************************************************************/
00103
00104 void
00105 Obscure_EnsureTimerStopped(HWND hwnd)
00106 {
00107     if (g_fTimerActive) {
00108         KillTimer(hwnd, 1);
00109         g_fTimerActive = FALSE;
00110         InvalidateRect(hwnd, NULL, FALSE);
00111         SetWindowText(hwnd, "Covered (Paused)");
00112     }
00113 }
00114
00115 /*****************************************************************************
00116  *
00117  *  Obscure_TimerProc
00118  *
00119  *      If we have become obscured, then stop the timer.
00120  *
00121  *      Otherwise, invalidate our rectangle so we will redraw with
00122  *      the new time.
00123  *
00124  *****************************************************************************/
00125
00126 void CALLBACK
00127 Obscure_TimerProc(HWND hwnd, UINT uiMsg, UINT_PTR idTimer, DWORD tm)
00128 {
00129     /*
00130      *  If the client area is totally obscured, then stop the timer
00131      *  so we don't waste any more CPU.
00132      */
00133     int iState = GetClientObscuredness(hwnd);
00134     if (iState == OBS_COMPLETELYCOVERED) {
00135         Obscure_EnsureTimerStopped(hwnd);
00136     } else {
00137         InvalidateRect(hwnd, NULL, FALSE);
00138         if (iState == OBS_PARTIALLYVISIBLE) {
00139             SetWindowText(hwnd, "Partially Visible");
00140         } else if (iState == OBS_COMPLETELYVISIBLE) {
00141             SetWindowText(hwnd, "Completely Visible");
00142         }
00143     }
00144 }
00145
00146 /*****************************************************************************
00147  *
00148  *  Obscure_EnsureTimerRunning
00149  *
00150  *      If the timer that causes us to do work is not running, then start it.
00151  *
00152  *****************************************************************************/
00153
00154 void
00155 Obscure_EnsureTimerRunning(HWND hwnd)
00156 {
00157     if (!g_fTimerActive) {
00158         SetTimer(hwnd, 1, 100, Obscure_TimerProc);
00159         g_fTimerActive = TRUE;
00160     }
00161 }
00162
00163 /*****************************************************************************
00164  *
00165  *  Obscure_OnPaint
00166  *
00167  *      Draw the current time and restart the timer if needed.
00168  *
00169  *****************************************************************************/
00170
00171 void
00172 Obscure_OnPaint(HWND hwnd)
00173 {
00174     PAINTSTRUCT ps;
00175     HDC hdc;
00176
00177     hdc = BeginPaint(hwnd, &ps);
00178     if (hdc) {
00179         char sz[64];
00180         RECT rc;
00181         HFONT hfOld;
00182         COLORREF crTextOld, crBkOld;
00183         int cch;
00184
00185         if (IsRectEmpty(&ps.rcPaint)) {
00186             /*
00187              *  Nothing to do.  Don't wake up either.
00188              */
00189         } else {
00190             hfOld = SelectObject(hdc, GetStockObject(ANSI_FIXED_FONT));
00191             crTextOld = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
00192             crBkOld = SetBkColor(hdc, GetSysColor(COLOR_WINDOW));
00193
00194             GetClientRect(hwnd, &rc);
00195             cch = wsprintf(sz, "%u", GetTickCount());
00196             ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rc, sz, cch, NULL);
00197
00198             SetBkColor(hdc, crBkOld);
00199             SetTextColor(hdc, crTextOld);
00200             SelectObject(hdc, hfOld);
00201
00202             Obscure_EnsureTimerRunning(hwnd);
00203         }
00204
00205         EndPaint(hwnd, &ps);
00206     }
00207 }
00208
00209 /*****************************************************************************
00210  *
00211  *  Obscure_WndProc
00212  *
00213  *      Window procedure for obscured window demo.
00214  *
00215  *****************************************************************************/
00216
00217 LRESULT CALLBACK
00218 Obscure_WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
00219 {
00220     switch (uiMsg) {
00221
00222     case WM_CREATE:
00223         Obscure_EnsureTimerRunning(hwnd);
00224         break;
00225
00226     case WM_PAINT:
00227         Obscure_OnPaint(hwnd);
00228         break;
00229
00230     /*
00231      *  The app exits when this window is destroyed.
00232      */
00233     case WM_DESTROY:
00234         Obscure_EnsureTimerStopped(hwnd);
00235         PostQuitMessage(0);
00236         break;
00237     }
00238
00239     return DefWindowProc(hwnd, uiMsg, wParam, lParam);
00240 }
00241
00242 /*****************************************************************************
00243  *
00244  *  WinMain
00245  *
00246  *      Program entry point.
00247  *
00248  *****************************************************************************/
00249
00250 int WINAPI
00251 WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
00252 {
00253     WNDCLASS wc;
00254     MSG msg;
00255     HWND hwnd;
00256
00257     wc.style = 0;
00258     wc.lpfnWndProc = Obscure_WndProc;
00259     wc.cbClsExtra = 0;
00260     wc.cbWndExtra = 0;
00261     wc.hInstance = hinst;
00262     wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
00263     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00264     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
00265     wc.lpszMenuName = NULL;
00266     wc.lpszClassName = "Obscure";
00267
00268     RegisterClass(&wc);
00269
00270     hwnd = CreateWindow(
00271         "Obscure",                      /* Class Name */
00272         "Obscure",                      /* Title */
00273         WS_OVERLAPPEDWINDOW,            /* Style */
00274         CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
00275         CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
00276         NULL,                           /* Parent */
00277         NULL,                           /* Use class menu */
00278         hinst,                          /* Instance */
00279         0);                             /* No special parameters */
00280
00281     ShowWindow(hwnd, nCmdShow);
00282
00283     while (GetMessage(&msg, NULL, 0, 0)) {
00284         TranslateMessage(&msg);
00285         DispatchMessage(&msg);
00286     }
00287
00288     return 0;
00289 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/globals.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

globals.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "BaseNode.h"
00016
00017 //---------------------------------------------------------------------------
00018 // MMC's requiered clipboard formats
00019
00020 UINT g_cfDisplayName = 0;      // DisplayName for our SnapIn node
00021 UINT g_cfNodeType    = 0;      // GUID of the selected node
00022 UINT g_cfszNodeType  = 0;      // String representation of namespace GUID
00023 UINT g_cfSnapinClsid = 0;      // Class ID of this SnapIn
00024
00025 //---------------------------------------------------------------------------
00026 //  Custom clipboard formats
00027
00028 UINT g_cfBaseNodePtr = 0;
00029 UINT g_cfDataObjPtr  = 0;
00030
00031
00032 // Global variables
00033
00034 HINSTANCE g_hInst = NULL;      // Our global instance handle
00035 ULONG g_uObjectCount = 0;      // Global object count
00036 ULONG g_uServerLocks = 0;      // Global lock count
00037
00038
00039 //---------------------------------------------------------------------------
00040 //  This is the fast, simple way to convert unicode to ansi.  It does NOT
00041 //  handle multibyte ansi strings and is not localized.  But it should be
00042 //  fine for registry entries
00043 //  NOTE:  The caller is responsible for freeing the memory.
00044 //
00045 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide )
00046 {
00047   LONG nLen = wcslen( szWide ) +1;
00048   *pszAnsi = (char*)CoTaskMemAlloc( nLen );
00049   char* pCounter = *pszAnsi;
00050
00051   while( *szWide )
00052   {
00053     *pCounter = LOBYTE(*szWide);
00054     pCounter++;
00055     szWide++;
00056   }
00057   *pCounter = NULL;
00058 }
00059
00060 //---------------------------------------------------------------------------
00061 //  copies a string ( like strncpy )
00062 //  in non-unicode version coverts ansi-to-unicode first.
00063 //
00064 void _fastcall CopyT2W( LPWSTR strDest, LPCTSTR strSource, size_t count)
00065 {
00066 #ifndef _UNICODE
00067
00068   MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, strSource, -1, strDest, count );
00069
00070 #else
00071
00072   wcsncpy( strDest, strSource, count );
00073
00074 #endif
00075
00076   if ( count > 0 )
00077     strDest[ count - 1 ] = 0;
00078 }
00079
00080 //---------------------------------------------------------------------------
00081 //
00082 void InitClipboardFormats()
00083 {
00084   g_cfDisplayName  = RegisterClipboardFormat( T_CCF_DISPLAY_NAME );
00085   g_cfNodeType     = RegisterClipboardFormat( T_CCF_NODETYPE );
00086   g_cfszNodeType   = RegisterClipboardFormat( T_CCF_SZNODETYPE );
00087   g_cfSnapinClsid  = RegisterClipboardFormat( T_CCF_SNAPIN_CLASSID );
00088
00089   g_cfBaseNodePtr  = RegisterClipboardFormat( T_CCF_BASENODE_PTR );
00090   g_cfDataObjPtr   = RegisterClipboardFormat( T_CCF_DATAOBJ_PTR );
00091
00092 }
00093
00094 //---------------------------------------------------------------------------
00095 //  Extracts data based on the passed-in clipboard format
00096 //
00097 HRESULT ExtractFromDataObject
00098 (
00099   LPDATAOBJECT ipDataObject,   // [in]  Points to data object
00100   UINT         cfClipFormat,   // [in]  Clipboard format to use
00101   ULONG        nByteCount,     // [in]  Number of bytes to allocate
00102   HGLOBAL      *phGlobal       // [out] Points to the data we want
00103 )
00104 {
00105   _ASSERT( NULL != ipDataObject );
00106
00107             *phGlobal = NULL;
00108   HRESULT   hResult   = S_FALSE;
00109   STGMEDIUM StgMedium = { TYMED_HGLOBAL,  NULL  };
00110   FORMATETC FormatEtc = { cfClipFormat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00111
00112   do
00113   {
00114     // Allocate memory for the stream
00115     StgMedium.hGlobal = ::GlobalAlloc( GMEM_SHARE, nByteCount );
00116
00117     if( NULL == StgMedium.hGlobal )
00118     {
00119       hResult = E_OUTOFMEMORY;
00120       break;
00121     }
00122
00123     // Attempt to get data from the object
00124     hResult = ipDataObject->GetDataHere( &FormatEtc, &StgMedium );
00125     if( FAILED(hResult) )
00126     {
00127       break;
00128     }
00129     // StgMedium now has the data we need
00130     *phGlobal = StgMedium.hGlobal;
00131     StgMedium.hGlobal = NULL;
00132
00133   } while (0);
00134
00135   if( FAILED(hResult) && StgMedium.hGlobal )
00136   {
00137     HGLOBAL hRetVal = ::GlobalFree(StgMedium.hGlobal);
00138     _ASSERT( NULL == hRetVal );         // Must return NULL
00139   }
00140   return hResult;
00141
00142 }
00143
00144
00145 //---------------------------------------------------------------------------
00146 //  This helper returns the current BaseNode object on the custom
00147 //  g_cfBaseNodePtr clipboard format
00148 //
00149 CBaseNode* ExtractBaseNodePtr
00150 (
00151   LPDATAOBJECT ipDataObject      // [in] IComponent pointer
00152 )
00153 {
00154   LPBASENODE  pNode   = NULL;
00155   HGLOBAL     hGlobal = NULL;
00156   HRESULT     hResult = S_FALSE;
00157
00158   hResult = ExtractFromDataObject( ipDataObject,
00159                                    g_cfBaseNodePtr,
00160                                    sizeof(LPBASENODE),
00161                                    &hGlobal
00162                                  );
00163   if( SUCCEEDED(hResult) )
00164   {
00165     pNode = *(LPBASENODE*)(hGlobal);
00166     HGLOBAL hRetVal = GlobalFree(hGlobal);
00167     _ASSERT( NULL == hRetVal );        // Must return NULL
00168   }
00169
00170   return pNode;
00171
00172 }
00173
00174 //---------------------------------------------------------------------------
00175 //  Converts an IDataObject pointer to a CDataObject pointer by
00176 //  retrieving a "this" pointer using a custom clipboard format.
00177 //
00178 CDataObject* ExtractDataObjPtr
00179 (
00180   LPDATAOBJECT ipDataObject      //[in] IDataObject pointer
00181 )
00182 {
00183   _ASSERT( 0 != g_cfDataObjPtr );
00184
00185   HGLOBAL      hGlobal = NULL;
00186   HRESULT      hResult = S_OK;
00187   CDataObject* pDO     = NULL;
00188
00189   hResult = ExtractFromDataObject( ipDataObject,
00190                                    g_cfDataObjPtr,
00191                                    sizeof(CDataObject **),
00192                                    &hGlobal
00193                                  );
00194
00195   if( SUCCEEDED(hResult) )
00196   {
00197     pDO = *(CDataObject **)(hGlobal);
00198     _ASSERT( NULL != pDO );
00199
00200     HGLOBAL hRetVal = GlobalFree(hGlobal);
00201     _ASSERT( NULL == hRetVal );       // Must return NULL
00202   }
00203
00204   return pDO;
00205
00206 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/tree.cpp Source File

  • Begin
  • sdkdiff

tree.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * tree.cpp
00013  *
00014  * data type providing a map between a KEY and a VALUE. The KEY is a
00015  * 32-bit DWORD, and the VALUE is any arbitrary area of storage.
00016  *
00017  * memory is allocated using HeapAlloc.
00018  *
00019  * currently implemented as a unbalanced binary tree.
00020  *
00021  */
00022
00023 #include "precomp.h"
00024
00025 #include "tree.h"
00026
00027
00028 /* -- data types ----------------------------------------------- */
00029
00030 /* on creating a tree, we return a TREE handle. This is in fact a pointer
00031  * to a struct tree, defined here.
00032  */
00033 struct tree {
00034     TREEITEM first;
00035 };
00036
00037 /* each element in the tree is stored in a TREEITEM. a TREEITEM handle
00038  * is a pointer to a struct treeitem, defined here
00039  */
00040 struct treeitem {
00041     TREE root;
00042     TREEKEY key;
00043     TREEITEM left, right;
00044     UINT length;        /* length of the user's data */
00045     LPVOID data;        /* pointer to our copy of the users data */
00046 };
00047
00048 /* -- internal functions ---------------------------------------------*/
00049
00050 /* free up an element of the tree. recursively calls itself to
00051  * free left and right children
00052  */
00053 void
00054 tree_delitem(TREEITEM item)
00055 {
00056     if (item == NULL) {
00057         return;
00058     }
00059     if (item->left != NULL) {
00060         tree_delitem(item->left);
00061     }
00062     if (item->right != NULL) {
00063         tree_delitem(item->right);
00064     }
00065     if (item->data != NULL) {
00066         HeapFree(GetProcessHeap(), NULL, item->data);
00067     }
00068
00069     HeapFree(GetProcessHeap(), NULL, item);
00070 }
00071
00072 /* create a new treeitem, with a data block of length bytes.
00073  * if the value pointer is not NULL, initialise the data block with
00074  * the contents of value.
00075  */
00076 TREEITEM
00077 tree_newitem(TREE root, TREEKEY key, LPVOID value, UINT length)
00078 {
00079     TREEITEM item;
00080
00081     item = (TREEITEM) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct treeitem));
00082   if (item == NULL)
00083     return NULL;
00084
00085     item->root = root;
00086     item->key = key;
00087     item->left = NULL;
00088     item->right = NULL;
00089     item->length = length;
00090     item->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, length);
00091     if (item->data == NULL)
00092     return NULL;
00093
00094   if (value != NULL) {
00095         memcpy(item->data, value, length);
00096     }
00097
00098     return(item);
00099 }
00100
00101
00102 /* find the item with the given key. if it does not exist, return
00103  * the parent item to which it would be attached. returns NULL if
00104  * no items in the tree
00105  */
00106 TREEITEM
00107 tree_getitem(TREE tree, TREEKEY key)
00108 {
00109     TREEITEM item, prev;
00110
00111
00112     prev = NULL;
00113     for (item = tree->first; item != NULL; ) {
00114
00115         if (item->key == key) {
00116             return(item);
00117         }
00118
00119         /* not this item - go on to the correct child item.
00120          * remember this item as if the child is NULL, this item
00121          * will be the correct insertion point for the new item
00122          */
00123         prev = item;
00124
00125         if (key < item->key) {
00126             item = item->left;
00127         } else {
00128             item = item->right;
00129         }
00130     }
00131     /* prev is the parent - or null if nothing in tree */
00132     return(prev);
00133 }
00134
00135 /* --- external functions ------------------------------------------ */
00136
00137 /*
00138  * create an empty tree.
00139  */
00140 TREE APIENTRY
00141 tree_create()
00142 {
00143     TREE tree;
00144
00145     tree = (TREE) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct tree));
00146     if (tree == NULL)
00147     return NULL;
00148
00149   tree->first = NULL;
00150     return(tree);
00151 }
00152
00153
00154 /*
00155  * delete an entire tree, including all the user data
00156  */
00157 void APIENTRY
00158 tree_delete(TREE tree)
00159 {
00160
00161     tree_delitem(tree->first);
00162
00163     HeapFree(GetProcessHeap(), NULL, tree);
00164 }
00165
00166 /*
00167  * add a new element to the tree, mapping the key given to the value given.
00168  * The value is a block of storage: a copy of this is inserted into the tree.
00169  * we return a pointer to the copy of the data in the tree.
00170  *
00171  * the value pointer can be NULL: in this case, we insert a block of
00172  * length bytes, but don't initialise it. you get a pointer to it and
00173  * can initialise it yourself.
00174  *
00175  * if the key already exists, the value will be replaced with the new data.
00176  */
00177 LPVOID APIENTRY
00178 tree_update(TREE tree, TREEKEY key, LPVOID value, UINT length)
00179 {
00180     TREEITEM item;
00181
00182     /* find the place in the tree for this key to go */
00183     item = tree_getitem(tree, key);
00184
00185     if (item == NULL) {
00186         /* there is nothing in the tree: this item should
00187          * go at the top
00188          */
00189         tree->first = tree_newitem(tree, key, value, length);
00190         return(tree->first->data);
00191     }
00192
00193   /* is this the same key? */
00194     if (item->key == key) {
00195
00196         /* this key already inserted. re-alloc the data */
00197         if (length != item->length) {
00198             HeapFree(GetProcessHeap(), NULL, item->data);
00199             item->data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, length);
00200       if (item->data == NULL)
00201         return NULL;
00202     }
00203         /* don't initialise block if no pointer passed */
00204         if (value != NULL) {
00205             memcpy(item->data, value, length);
00206         }
00207         return(item->data);
00208     }
00209
00210     /* not the same key - getitem returned the parent for
00211      * the new tree. insert it as a child of item.
00212      */
00213     return(tree_addafter(tree, &item, key, value, length));
00214 }
00215
00216 /*
00217  * return a pointer to the value (data block) for a given key. returns
00218  * null if not found.
00219  */
00220 LPVOID APIENTRY
00221 tree_find(TREE tree, TREEKEY key)
00222 {
00223     TREEITEM item;
00224
00225     /* find the correct place in the tree */
00226     item = tree_getitem(tree, key);
00227
00228     if (item == NULL) {
00229         /* nothing in the tree */
00230         return(NULL);
00231     }
00232
00233     if (item->key != key) {
00234         /* this key not in. getitem has returned parent */
00235         return(NULL);
00236     }
00237
00238     /* found the right element - return pointer to the
00239      * data block
00240      */
00241     return(item->data);
00242 }
00243
00244 /*
00245  * next two routines are an optimisation for a common tree operation. in
00246  * this case, the user will want to insert a new element only if
00247  * the key is not there. if it is there, he will want to modify the
00248  * existing value (increment a reference count, for example).
00249  *
00250  * if tree_search fails to find the key, it will return a TREEITEM handle
00251  * for the parent. This can be passed to tree_addafter to insert the
00252  * new element without re-searching the tree.
00253  */
00254
00255 /*
00256  * find an element. if not, find it's correct parent item
00257  */
00258 LPVOID APIENTRY
00259 tree_search(TREE tree, TREEKEY key, PTREEITEM pplace)
00260 {
00261     TREEITEM item;
00262
00263     item = tree_getitem(tree, key);
00264
00265     if (item == NULL) {
00266         /* no items in tree. set placeholder to NULL to
00267          * indicate insert at top of tree
00268          */
00269         *pplace = NULL;
00270
00271         /* return NULL to indicate key not found */
00272         return(NULL);
00273     }
00274
00275     if (item->key == key) {
00276         /* found the key already there -
00277          * set pplace to null just for safety
00278          */
00279         *pplace = NULL;
00280
00281         /* give the user a pointer to his data */
00282         return(item->data);
00283     }
00284
00285
00286     /* key was not found - getitem has returned the parent
00287      * - set this as the place for new insertions
00288      */
00289     *pplace = item;
00290
00291     /* return NULL to indicate that the key was not found */
00292     return(NULL);
00293 }
00294
00295 /*
00296  * insert a key in the position already found by tree_search.
00297  *
00298  * return a pointer to the user's data in the tree. if the value
00299  * pointer passed in is null, then we allocate the block, but don't
00300  * initialise it to anything.
00301  */
00302 LPVOID APIENTRY
00303 tree_addafter(TREE tree, PTREEITEM place, TREEKEY key, LPVOID value, UINT length)
00304 {
00305     TREEITEM item, child;
00306
00307     item = *place;
00308     if (item == NULL) {
00309         tree->first = tree_newitem(tree, key, value, length);
00310         return (tree->first->data);
00311     }
00312
00313     child = tree_newitem(tree, key, value, length);
00314     if (child->key < item->key ) {
00315         /* should go on left leg */
00316         if (item->left != NULL) {
00317             Trace_Error(NULL, "TREE: left leaf leg not free", FALSE);
00318
00319         }
00320         item->left = child;
00321     } else {
00322         if (item->right != NULL) {
00323             Trace_Error(NULL, "TREE: right leaf leg not free", FALSE);
00324         }
00325         item->right = child;
00326     }
00327     return(child->data);
00328 }
00329
00330
00331 /* --- ctree ------------------------------------------------------*/
00332
00333 /*
00334  * ctree is a class of tree built on top of the tree interface. a
00335  * ctree keeps count of the number of insertions of identical keys.
00336  *
00337  * we do this be adding a long counter to the beginning of the user
00338  * data before inserting into the tree. if the key is not found, we set
00339  * this to one. If the key was already there, we *do not* insert the
00340  * data (data is always from the first insertion) - we simply increment
00341  * the count.
00342  */
00343
00344 /*
00345  * create a tree for use by CTREE - same as an ordinary tree
00346  */
00347 TREE APIENTRY
00348 ctree_create()
00349 {
00350     return(tree_create());
00351 }
00352
00353 /*
00354  * delete a ctree - same as for TREE
00355  */
00356 void APIENTRY
00357 ctree_delete(TREE tree)
00358 {
00359     tree_delete(tree);
00360 }
00361
00362
00363 /* insert an element in the tree. if the element is not there,
00364  * insert the data and set the reference count for this key to 1.
00365  * if the key was there already, don't change the data, just increment
00366  * the reference count
00367  *
00368  * if the value pointer is not null, we initialise the value block
00369  * in the tree to contain this.
00370  *
00371  * we return a pointer to the users data in the tree
00372  */
00373 LPVOID APIENTRY
00374 ctree_update(TREE tree, TREEKEY key, LPVOID value, UINT length)
00375 {
00376     TREEITEM item;
00377     LONG_PTR FAR * pcounter;
00378     LPVOID datacopy;
00379
00380     pcounter = (LONG_PTR *)tree_search(tree, key, &item);
00381
00382     if (pcounter == NULL) {
00383         /* element not found - insert a new one
00384          * the data block for this element should be
00385          * the user's block with our reference count at
00386          * the beginning
00387          */
00388         pcounter = (LONG_PTR *)tree_addafter(tree, &item, key, NULL,
00389                                  length + sizeof(LONG_PTR));
00390         *pcounter = 1;
00391         /* add on size of one long to get the start of the user
00392          * data
00393          */
00394         datacopy = pcounter + 1;
00395         if (value != NULL) {
00396             memcpy(datacopy, value, length);
00397         }
00398         return(datacopy);
00399     }
00400
00401     /* key was already there - increment reference count and
00402      * return pointer to data
00403      */
00404
00405     (*pcounter)++;
00406
00407     /* add on size of one long to get the start of the user
00408      * data
00409      */
00410     datacopy = pcounter + 1;
00411     return(datacopy);
00412 }
00413
00414 /* return the reference count for this key */
00415 long APIENTRY
00416 ctree_getcount(TREE tree, TREEKEY key)
00417 {
00418     LONG_PTR FAR * pcounter;
00419
00420     pcounter = (LONG_PTR *)tree_find(tree, key);
00421     if (pcounter == NULL) {
00422         return(0);
00423     }
00424     return((long)*pcounter);
00425 }
00426
00427 /* return a pointer to the user's data block for this key,
00428  * or NULL if key not present
00429  */
00430 LPVOID APIENTRY
00431 ctree_find(TREE tree, TREEKEY key)
00432 {
00433     LONG_PTR FAR * pcounter;
00434
00435
00436     pcounter = (LONG_PTR *)tree_find(tree, key);
00437     if (pcounter == NULL) {
00438         return(0);
00439     }
00440
00441     /* increment pointer by size of 1 long to point to
00442      * user's datablock
00443      */
00444     return(pcounter+1);
00445 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/onconnect.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

onconnect.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  OnConnect.cpp
00006 //
00007 // Description:
00008 //  This file implements the OnConnect() routine which
00009 //    demonstrates how to connect to CIMOM and one if
00010 //    its namespaces.
00011 //
00012 // History:
00013 //
00014 // **************************************************************************
00015
00016 #include "stdafx.h"
00017 #include "AdvClientDlg.h"
00018
00019 // **************************************************************************
00020 //
00021 //  CAdvClientDlg::OnConnect()
00022 //
00023 // Description:
00024 //    Connects to the namespace specified in the edit box.
00025 //
00026 // Parameters:
00027 //    None.
00028 //
00029 // Returns:
00030 //    Nothing.
00031 //
00032 // Globals accessed:
00033 //    None.
00034 //
00035 // Globals modified:
00036 //    None.
00037 //
00038 //===========================================================================
00039 void CAdvClientDlg::OnConnect()
00040 {
00041   IWbemLocator *pIWbemLocator = NULL;
00042
00043   UpdateData();
00044   //------------------------
00045    // Create an instance of the WbemLocator interface.
00046    if(CoCreateInstance(CLSID_WbemLocator,
00047             NULL,
00048             CLSCTX_INPROC_SERVER,
00049             IID_IWbemLocator,
00050             (LPVOID *) &pIWbemLocator) == S_OK)
00051    {
00052     //------------------------
00053     // Use the pointer returned in step two to connect to
00054     //     the server using the passed in namespace.
00055     BSTR pNamespace = m_namespace.AllocSysString();
00056     if (!pNamespace)
00057     {
00058       m_outputList.AddString(_T("Out of memory"));
00059       pIWbemLocator->Release();
00060       return;
00061     }
00062     HRESULT hr = S_OK;
00063
00064     if((hr = pIWbemLocator->ConnectServer(pNamespace,
00065                 NULL,   //using current account for simplicity
00066                 NULL, //using current password for simplicity
00067                 0L,   // locale
00068                 0L,   // securityFlags
00069                 NULL, // authority (domain for NTLM)
00070                 NULL, // context
00071                 &m_pIWbemServices)) == S_OK)
00072     {
00073       // indicate success.
00074       m_outputList.ResetContent();
00075       m_outputList.AddString(_T("Connected To Namespace"));
00076
00077       // its safe the hit the other buttons now.
00078       m_enumServices.EnableWindow(TRUE);
00079       m_enumServicesAsync.EnableWindow(TRUE);
00080       m_enumDisks.EnableWindow(TRUE);
00081       m_diskDetails.EnableWindow(TRUE);
00082       m_connect.EnableWindow(TRUE);
00083       m_addEquipment.EnableWindow(TRUE);
00084       m_diskDescriptions.EnableWindow(TRUE);
00085
00086       // dont allow reconnection.
00087       m_connect.EnableWindow(FALSE);
00088
00089       // since these guys register for the non-standard
00090       // root/default/office namespace, dont enable them unless
00091       // that namespace exists.
00092       if(CheckOfficeNamespace())
00093       {
00094         m_perm.EnableWindow(TRUE);
00095         m_temp.EnableWindow(TRUE);
00096       }
00097
00098       // initialize the Register Perm button.
00099       if(PermRegistered())
00100       {
00101         // init for UNregistering.
00102         m_regPerm = FALSE;
00103         m_perm.SetWindowText(_T("Unregister &Perm"));
00104       }
00105       else // its not registered...
00106       {
00107         // init for registering.
00108         m_regPerm = TRUE;
00109         m_perm.SetWindowText(_T("Register &Perm"));
00110       }
00111     }
00112     else
00113     {
00114       // failed ConnectServer()
00115       AfxMessageBox(_T("Bad namespace"));
00116     }
00117
00118     // done with pNamespace.
00119     if(pNamespace)
00120     {
00121       SysFreeString(pNamespace);
00122     }
00123
00124     //------------------------
00125     // done with pIWbemLocator.
00126     if (pIWbemLocator)
00127     {
00128       pIWbemLocator->Release();
00129       pIWbemLocator = NULL;
00130     }
00131   }
00132   else // failed CoCreateInstance()
00133   {
00134     AfxMessageBox(_T("Failed to create IWbemLocator object"));
00135
00136   } // endif CoCreateInstance()
00137
00138 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COShip2 Member List

This is the complete list of members for COShip2, including all inherited members.
COShip2() | COShip2 | [inline]
InvokeNotifyIDispatch(IUnknown *punk, long lFlags) | COShip2 | [private]
InvokeNotifyVtable(IUnknown *punk, long lFlags) | COShip2 | [private]
LineItem(long lItemId, long lQuantity) | COShip2 |
m_lCustomerId | COShip2 | [private]
m_lOrderId | COShip2 | [private]
m_veclItemId | COShip2 | [private]
m_veclQuantity | COShip2 | [private]
m_vecShipStatus | COShip2 | [private]
NotifyRequestor(long lFlags, IUnknown *punkNotify) | COShip2 | [private]
Process(long lFlags, IUnknown *punk) | COShip2 |
put_CustomerId(long lCustomerId) | COShip2 |
put_OrderId(long lOrderId) | COShip2 |
RandomShipStatus() | COShip2 | [private]
WriteShipDB() | COShip2 | [private]
Generated on Wed Nov 13 2024 16:57:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/SetDisp/Resource.h Source File

  • Multimedia
  • Gdi
  • SetDisp

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by SetDisp.rc
00004 //
00005 #define IDI_SETDISP                     102
00006 #define IDD_SETDISP                     103
00007 #define IDI_STATE11                     105
00008 #define IDI_STATE12                     106
00009 #define IDI_STATE21                     107
00010 #define IDI_STATE22                     108
00011 #define IDI_STATE31                     109
00012 #define IDR_HELP                        109
00013 #define IDI_STATE32                     110
00014 #define IDD_VERIFYRES                   111
00015 #define IDR_RESOLUTIONS                 112
00016 #define IDR_MENU1                       113
00017 #define IDM_ABOUT                       113
00018 #define IDR_MENU                        116
00019 #define IDR_MENU2                       117
00020 #define IDR_ACCELERATOR1                119
00021 #define IDR_ACCELERATOR2                120
00022 #define IDR_ACCELERATOR3                121
00023 #define IDR_ACCELERATOR4                122
00024 #define IDR_ACCELERATOR5                124
00025 #define IDD_ABOUT                       125
00026 #define IDC_NOTIFY1                     1006
00027 #define IDC_NOTIFY2                     1007
00028 #define IDC_NOTIFY3                     1008
00029 #define IDC_STATE11                     1009
00030 #define IDC_STATE12                     1010
00031 #define IDC_STATE21                     1011
00032 #define IDC_STATE22                     1012
00033 #define IDC_STATE31                     1013
00034 #define IDC_STATE32                     1014
00035 #define IDC_DELAY1                      1017
00036 #define IDC_TIP11                       1018
00037 #define IDC_TIP12                       1019
00038 #define IDC_DELAY2                      1020
00039 #define IDC_TIP21                       1021
00040 #define IDC_TIP22                       1022
00041 #define IDC_DELAY3                      1023
00042 #define IDC_TIP31                       1024
00043 #define IDC_TIP32                       1025
00044 #define IDC_STATIC                      -1
00045
00046 // Next default values for new objects
00047 //
00048 #ifdef APSTUDIO_INVOKED
00049 #ifndef APSTUDIO_READONLY_SYMBOLS
00050 #define _APS_NEXT_RESOURCE_VALUE        127
00051 #define _APS_NEXT_COMMAND_VALUE         114
00052 #define _APS_NEXT_CONTROL_VALUE         1021
00053 #define _APS_NEXT_SYMED_VALUE           101
00054 #endif
00055 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/message.Cxx Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

message.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       message.cxx
00007 //
00008 //  Contents:   Helper functions for popup message boxes.
00009 //
00010 //  Classes:
00011 //
00012 //  Functions:  MessageBoxFromSringIds
00013 //
00014 //  History:    6-24-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include "message.h"
00020
00021 //+---------------------------------------------------------------------------
00022 //
00023 //  Function:   MessageBoxFromStringIds
00024 //
00025 //  Synopsis:   Displays a simple message box taking its text from a string
00026 //              table instead of from user allocated strings.
00027 //
00028 //  Arguments:  [hwndOwner]      - window handle for the message box's owner
00029 //              [hinst]          - instance associated with the string table
00030 //              [idText]         - string id for the box's text string
00031 //              [idTitle]        - string id for the box's title string
00032 //              [fuStyle]        - style of message box
00033 //                                 (see Windows function MessageBox for styles)
00034 //
00035 //  Returns:    result from MessageBox
00036 //
00037 //  History:    6-24-94   stevebl   Created
00038 //
00039 //  Notes:      Each string is limited to MAX_STRING_LENGTH characters.
00040 //
00041 //----------------------------------------------------------------------------
00042
00043 int MessageBoxFromStringIds(
00044     const HWND hwndOwner,
00045     const HINSTANCE hinst,
00046     const UINT idText,
00047     const UINT idTitle,
00048     const UINT fuStyle)
00049 {
00050     int iReturn = 0;
00051     TCHAR szTitle[MAX_STRING_LENGTH];
00052     TCHAR szText[MAX_STRING_LENGTH];
00053     if (LoadString(hinst, idTitle, szTitle, MAX_STRING_LENGTH))
00054     {
00055         if (LoadString(hinst, idText, szText, MAX_STRING_LENGTH))
00056         {
00057             iReturn = MessageBox(
00058                 hwndOwner,
00059                 szText,
00060                 szTitle,
00061                 fuStyle);
00062         }
00063     }
00064     return(iReturn);
00065 }
00066
00067 //+---------------------------------------------------------------------------
00068 //
00069 //  Function:   MessageBoxFromStringIdsAndArgs
00070 //
00071 //  Synopsis:   Creates a message box from a pair of string IDs similar
00072 //              to MessageBoxFromStringIds.  The principle difference
00073 //              is that idFormat is an ID for a string which is a printf
00074 //              format string suitable for passing to wsprintf.
00075 //              The variable argument list is combined with the format
00076 //              string to create the text of the message box.
00077 //
00078 //  Arguments:  [hwndOwner] - window handle for the message box's owner
00079 //              [hinst]     - instance associated with the string table
00080 //              [idFormat]  - string id for the format of the box's text
00081 //              [idTitle]   - string id for the box's title string
00082 //              [fuStyle]   - style of the dialog box
00083 //              [...]       - argument list for text format string
00084 //
00085 //  Returns:    result from MessageBox
00086 //
00087 //  History:    6-24-94   stevebl   Created
00088 //
00089 //  Notes:      Neither the composed text string nor the title must be
00090 //              longer than MAX_STRING_LENGTH characters.
00091 //
00092 //----------------------------------------------------------------------------
00093
00094 int MessageBoxFromStringIdsAndArgs(
00095     const HWND hwndOwner,
00096     const HINSTANCE hinst,
00097     const UINT idFormat,
00098     const UINT idTitle,
00099     const UINT fuStyle, ...)
00100 {
00101     int iReturn = 0;
00102     va_list arglist;
00103     va_start(arglist, fuStyle);
00104     TCHAR szTitle[MAX_STRING_LENGTH];
00105     TCHAR szText[MAX_STRING_LENGTH];
00106     TCHAR szFormat[MAX_STRING_LENGTH];
00107     if (LoadString(hinst, idTitle, szTitle, MAX_STRING_LENGTH))
00108     {
00109         if (LoadString(hinst, idFormat, szFormat, MAX_STRING_LENGTH))
00110         {
00111             wvsprintf(szText, szFormat, arglist);
00112             iReturn = MessageBox(
00113                 hwndOwner,
00114                 szText,
00115                 szTitle,
00116                 fuStyle);
00117         }
00118     }
00119     return(iReturn);
00120 }
00121
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceDmp/tracedmp.h Source File

  • WinBase
  • EventTrace
  • TraceDmp

tracedmp.h

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <stdio.h>
00003 #include <windows.h>
00004 #include <wbemidl.h>
00005 #include <shellapi.h>
00006 #include <tchar.h>
00007 #include <wmistr.h>
00008 #include <objbase.h>
00009 #include <initguid.h>
00010 #include <evntrace.h>
00011 #include <objidl.h>
00012
00013 #define MAXLOGFILES         16
00014 #define MAXSTR              1024
00015 #define MOFWSTR             1024
00016 #define MOFSTR              2048
00017 #define MAXTYPE             256
00018 #define UC(x)               ( (UINT)((x) & 0xFF) )
00019 #define NTOHS(x)            ( (UC(x) * 256) + UC((x) >> 8) )
00020 // Maximum number of properties per WBEM class object: may need to be changed
00021 #define MAXPROPS            256
00022
00023 #define DUMP_FILE_NAME          _T("DumpFile.csv")
00024 #define SUMMARY_FILE_NAME       _T("Summary.txt")
00025
00026 #define DEFAULT_NAMESPACE       _T("root\\wmi")
00027
00028 #define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
00029
00030 // List mamangement macros
00031 #define InitializeListHead(ListHead) (\
00032     (ListHead)->Flink = (ListHead)->Blink = (ListHead))
00033
00034 #define InsertTailList(ListHead,Entry) {\
00035     PLIST_ENTRY _EX_Blink;\
00036     PLIST_ENTRY _EX_ListHead;\
00037     _EX_ListHead = (ListHead);\
00038     _EX_Blink = _EX_ListHead->Blink;\
00039     (Entry)->Flink = _EX_ListHead;\
00040     (Entry)->Blink = _EX_Blink;\
00041     _EX_Blink->Flink = (Entry);\
00042     _EX_ListHead->Blink = (Entry);\
00043     }
00044
00045 #define RemoveEntryList(Entry) {\
00046     PLIST_ENTRY _EX_Blink;\
00047     PLIST_ENTRY _EX_Flink;\
00048     _EX_Flink = (Entry)->Flink;\
00049     _EX_Blink = (Entry)->Blink;\
00050     _EX_Blink->Flink = _EX_Flink;\
00051     _EX_Flink->Blink = _EX_Blink;\
00052     }
00053
00054 // Default strings and values.
00055 #define GUID_TYPE_EVENTTRACE            _T("EventTrace")
00056 #define GUID_TYPE_HEADER                _T("Header")
00057 #define GUID_TYPE_UNKNOWN               _T("Unknown")
00058 #define GUID_TYPE_DEFAULT               _T("Default")
00059
00060 #define EVENT_TYPE_DEFAULT              (-1)
00061 #define EVENT_LEVEL_DEFAULT             (-1)
00062 #define EVENT_VERSION_DEFAULT           (-1)
00063
00064 // Strings and enumeration for Data item types that we want to decode.
00065 // Refer to DumpEvent() for more detail on each item.
00066 #define STR_ItemChar                    _T("ItemChar")
00067 #define STR_ItemWChar                   _T("ItemWChar")
00068 #define STR_ItemUChar                   _T("ItemUChar")
00069 #define STR_ItemCharShort               _T("ItemCharShort")
00070 #define STR_ItemShort                   _T("ItemShort")
00071 #define STR_ItemUShort                  _T("ItemUShort")
00072 #define STR_ItemLong                    _T("ItemLong")
00073 #define STR_ItemULong                   _T("ItemULong")
00074 #define STR_ItemULongX                  _T("ItemULongX")
00075 #define STR_ItemLongLong                _T("ItemLongLong")
00076 #define STR_ItemULongLong               _T("ItemULongLong")
00077 #define STR_ItemFloat                   _T("ItemFloat");
00078 #define STR_ItemDouble                  _T("ItemDouble");
00079 #define STR_ItemString                  _T("ItemString")
00080 #define STR_ItemWString                 _T("ItemWString")
00081 #define STR_ItemPString                 _T("ItemPString")
00082 #define STR_ItemPWString                _T("ItemPWString")
00083 #define STR_ItemDSString                _T("ItemDSString")
00084 #define STR_ItemDSWString               _T("ItemDSWString")
00085 #define STR_ItemMLString                _T("ItemMLString")
00086 #define STR_ItemSid                     _T("ItemSid")
00087 #define STR_ItemIPAddr                  _T("ItemIPAddr")
00088 #define STR_ItemPort                    _T("ItemPort")
00089 #define STR_ItemNWString                _T("ItemNWString")
00090 #define STR_ItemPtr                     _T("ItemPtr")
00091 #define STR_ItemGuid                    _T("ItemGuid")
00092 #define STR_ItemBool                    _T("ItemBool")
00093
00094 typedef enum _ITEM_TYPE {
00095     ItemChar,
00096     ItemWChar,
00097     ItemUChar,
00098     ItemCharShort,
00099     ItemShort,
00100     ItemUShort,
00101     ItemLong,
00102     ItemULong,
00103     ItemULongX,
00104     ItemLongLong,
00105     ItemULongLong,
00106     ItemFloat,
00107     ItemDouble,
00108     ItemString,
00109     ItemWString,
00110     ItemPString,
00111     ItemPWString,
00112     ItemDSString,
00113     ItemDSWString,
00114     ItemSid,
00115     ItemIPAddr,
00116     ItemPort,
00117     ItemMLString,
00118     ItemNWString,
00119     ItemPtr,
00120     ItemGuid,
00121     ItemBool,
00122     ItemUnknown
00123 } ITEM_TYPE;
00124
00125 // Construct that represents an event layout.
00126 typedef struct _MOF_INFO {
00127     LIST_ENTRY   Entry;
00128     LPTSTR       strDescription;        // Class Name
00129     ULONG        EventCount;
00130     GUID         Guid;
00131     PLIST_ENTRY  ItemHeader;
00132     LPTSTR       strType;               // Type Name
00133     SHORT        TypeIndex;
00134     SHORT        Version;
00135     CHAR         Level;
00136 }  MOF_INFO, *PMOF_INFO;
00137
00138 // Construct that represents one data item.
00139 typedef struct _ITEM_DESC {
00140     LIST_ENTRY  Entry;
00141     LPTSTR      strDescription;
00142     ULONG       DataSize;
00143     ITEM_TYPE   ItemType;
00144     UINT        ArraySize;
00145 } ITEM_DESC, *PITEM_DESC;
00146
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/Resource.h Source File

  • Com
  • Fundamentals
  • SimpSvr

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // App Studio generated include file.
00003 // Used by SIMPSVR.RC
00004 //
00005 #define IDM_OPEN                        102
00006 #define IDM_SAVE                        103
00007 #define IDM_SAVEAS                      104
00008 #define IDM_PRINT                       105
00009 #define IDM_EXIT                        106
00010 #define IDM_UNDO                        107
00011 #define IDM_CUT                         108
00012 #define IDM_COPY                        109
00013 #define IDM_PASTE                       110
00014 #define ID_EDIT_INSERTOBJECT            111
00015 #define IDM_INSERTOBJECT                111
00016 #define IDM_NEW                         112
00017 #define IDM_RED                         113
00018 #define IDM_GREEN                       114
00019 #define IDM_BLUE                        115
00020 #define IDM_ROTATE                      116
00021
00022 // Next default values for new objects
00023 //
00024 #ifdef APSTUDIO_INVOKED
00025 #ifndef APSTUDIO_READONLY_SYMBOLS
00026
00027 #define _APS_NEXT_RESOURCE_VALUE        102
00028 #define _APS_NEXT_COMMAND_VALUE         117
00029 #define _APS_NEXT_CONTROL_VALUE         1000
00030 #define _APS_NEXT_SYMED_VALUE           101
00031 #endif
00032 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/MSPBase/mspthrd.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • MSPBase

mspthrd.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1998-1999 Microsoft Corporation
00004
00005 Module Name:
00006
00007     mspthrd.cpp
00008
00009 Abstract:
00010
00011     Implementation for MSP thread management classes.
00012
00013 --*/
00014
00015 #include "precomp.h"
00016 #pragma hdrstop
00017
00018 #include <dbt.h>
00019
00020
00021 CMSPThread g_Thread;
00022
00023 extern "C" DWORD WINAPI gfThreadProc(LPVOID p)
00024 {
00025     return ((CMSPThread *)p)->ThreadProc();
00026 }
00027
00028 HRESULT CMSPThread::Start()
00029 /*++
00030
00031 Routine Description:
00032
00033     Create the thread if it has not already been created. Otherwise, just
00034     keep track of how many times the thread start was performed so that
00035     we only stop the thread when all of these have been paired with a stop.
00036
00037 Arguments:
00038
00039 Return Value:
00040
00041     HRESULT.
00042
00043 --*/
00044 {
00045     LOG((MSP_TRACE, "CMSPThread::Start - enter"));
00046
00047     CLock Lock(m_CountLock);
00048
00049     if ( m_iStartCount == 0 )
00050     {
00051
00052         _ASSERTE(m_hCommandEvent == NULL);
00053         _ASSERTE(m_hThread == NULL);
00054
00055
00056         TCHAR *ptczEventName = NULL;
00057
00058 #if DBG
00059
00060         //
00061         // in debug build, use named events
00062         //
00063
00064         TCHAR tszEventName[MAX_PATH];
00065
00066         _stprintf(tszEventName,
00067             _T("CMSPThread_CommandEvent_pid[0x%lx]CMSPThread[%p]"),
00068             GetCurrentProcessId(), this);
00069
00070         LOG((MSP_TRACE, "CMSPThread::Start - creating event[%S]", tszEventName));
00071
00072         ptczEventName = &tszEventName[0];
00073
00074 #endif
00075
00076
00077         if ((m_hCommandEvent = ::CreateEvent(
00078             NULL,
00079             FALSE,          // flag for manual-reset event
00080             FALSE,          // initial state is not set.
00081             ptczEventName   // No name in release builds, named in debug builds
00082             )) == NULL)
00083         {
00084             LOG((MSP_ERROR, "Can't create the command event"));
00085             return E_FAIL;
00086         }
00087
00088         DWORD dwThreadID;
00089         m_hThread = ::CreateThread(NULL, 0, gfThreadProc, this, 0, &dwThreadID);
00090
00091         if (m_hThread == NULL)
00092         {
00093             LOG((MSP_ERROR, "Can't create thread.  %ld", GetLastError()));
00094             return E_FAIL;
00095         }
00096     }
00097
00098     m_iStartCount++;
00099
00100     LOG((MSP_TRACE, "CMSPThread::Start - exit S_OK"));
00101     return S_OK;
00102 }
00103
00104 HRESULT CMSPThread::Stop()
00105 /*++
00106
00107 Routine Description:
00108
00109     Stop the thread.
00110
00111 Arguments:
00112
00113 Return Value:
00114
00115     HRESULT.
00116
00117 --*/
00118 {
00119     LOG((MSP_TRACE, "CMSPThread::Stop - enter"));
00120
00121     CLock Lock(m_CountLock);
00122
00123     //
00124     // Complain if we get more Stops than Starts.
00125     //
00126
00127     if ( m_iStartCount == 0 )
00128     {
00129         LOG((MSP_ERROR, "CMSPThread::Stop - thread already stopped - "
00130             "exit E_FAIL"));
00131         return E_FAIL;
00132     }
00133
00134     //
00135     // Decrement the start count. Due to the above check we should
00136     // never go below zero.
00137     //
00138
00139     m_iStartCount--;
00140
00141     _ASSERTE( m_iStartCount >= 0 );
00142
00143     //
00144     // If there have now been just as many stops as starts, it's time to stop
00145     // the thread.
00146     //
00147
00148     if ( m_iStartCount == 0 )
00149     {
00150         //
00151         // Our state should be cleaned up from before.
00152         //
00153
00154         _ASSERTE(m_hCommandEvent != NULL);
00155         _ASSERTE(m_hThread != NULL);
00156
00157         //
00158         // Allocate a command queue item which we will pass to the thread.
00159         //
00160
00161         COMMAND_QUEUE_ITEM * pItem = new COMMAND_QUEUE_ITEM;
00162
00163         if ( ! pItem )
00164         {
00165             LOG((MSP_ERROR, "CMSPThread::Stop - allocate new queue item"));
00166
00167             return E_OUTOFMEMORY;
00168         }
00169
00170         pItem->node.cmd = STOP;
00171
00172         //
00173         // Put the command queue item in the command queue.
00174         //
00175
00176         m_QueueLock.Lock();
00177         InsertTailList(&m_CommandQueue, &(pItem->link));
00178         m_QueueLock.Unlock();
00179
00180         //
00181         // Signal thread to process this stop command.
00182         //
00183
00184         if (SignalThreadProc() == 0)
00185         {
00186             LOG((MSP_ERROR, "CMSPThread::Stop - can't signal the thread - "
00187                 "exit E_FAIL"));
00188
00189             return E_FAIL;
00190         }
00191
00192         //
00193         // Wait until the thread stops
00194         //
00195
00196         if (::WaitForSingleObject(m_hThread, INFINITE) != WAIT_OBJECT_0)
00197         {
00198             LOG((MSP_ERROR, "CMSPThread::Stop - timeout while waiting for the "
00199                 "thread to stop"));
00200         }
00201
00202         //
00203         // Clean up our state.
00204         //
00205
00206         ::CloseHandle(m_hCommandEvent);
00207         ::CloseHandle(m_hThread);
00208
00209         m_hCommandEvent     = NULL;
00210         m_hThread           = NULL;
00211
00212     }
00213
00214     LOG((MSP_TRACE, "CMSPThread::Stop - exit S_OK"));
00215     return S_OK;
00216 }
00217
00218 HRESULT CMSPThread::Shutdown()
00219 /*++
00220
00221 Routine Description:
00222
00223     Unconditionally shutdown the thread. MSPs should by default use Stop()
00224     instead of Shutdwon(), unless they cannot do matched Start() / Stop()
00225     calls because of some other issue.
00226
00227 Arguments:
00228
00229 Return Value:
00230
00231     HRESULT.
00232
00233 --*/
00234 {
00235     LOG((MSP_TRACE, "CMSPThread::Shutdown - enter"));
00236
00237     CLock Lock(m_CountLock);
00238
00239     //
00240     // Ignore if we are not started.
00241     //
00242
00243     if ( m_iStartCount == 0 )
00244     {
00245         LOG((MSP_ERROR, "CMSPThread::Shutdown - thread already stopped - "
00246             "exit S_OK"));
00247
00248         return S_OK;
00249     }
00250
00251     //
00252     // We are started, so stop now, irrespective of the outstanding start
00253     // count.
00254     //
00255
00256     m_iStartCount = 1;
00257
00258     HRESULT hr = Stop();
00259
00260     LOG((MSP_(hr), "CMSPThread::Shutodwn - exit 0x%08x", hr));
00261
00262     return hr;
00263 }
00264
00265 HRESULT CMSPThread::ThreadProc()
00266 /*++
00267
00268 Routine Description:
00269
00270     the main loop of this thread.
00271
00272 Arguments:
00273
00274 Return Value:
00275
00276     HRESULT.
00277
00278 --*/
00279 {
00280
00281     LOG((MSP_TRACE, "CMSPThread::ThreadProc - started"));
00282
00283
00284     BOOL bExitFlag = FALSE;
00285
00286     m_hDevNotifyVideo = NULL;
00287     m_hDevNotifyAudio = NULL;
00288     m_hWndNotif = NULL;
00289
00290
00291     HRESULT hr = E_FAIL;
00292
00293     if (FAILED(hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED)))
00294     {
00295         LOG((MSP_ERROR, "CMSPThread::ThreadProc - ConinitialzeEx failed:%x",
00296             hr));
00297
00298         return hr;
00299     }
00300
00301
00302     //
00303     // Create a window to receive PNP device notifications.
00304     //
00305     // since this is a base class that is used by more than one msp, we want
00306     // to make sure that each msp registers a window class with a unique name
00307     //
00308     // for this reason window class name is derived from threadid.
00309     //
00310
00311     DWORD dwThreadID = GetCurrentThreadId();
00312
00313
00314     //
00315     // the string needs to be big enough to hold max dword number in hex +
00316     // terminating zero. 20 is more than enough.
00317     //
00318
00319     TCHAR szWindowClassName[20];
00320
00321     _stprintf(szWindowClassName, _T("%lx"), dwThreadID);
00322
00323
00324     //
00325     // configure window class structure for RegisterClass
00326     //
00327
00328     WNDCLASS wc;
00329
00330     ZeroMemory(&wc, sizeof(wc));
00331
00332     wc.lpfnWndProc = NotifWndProc;
00333     wc.lpszClassName = szWindowClassName;
00334
00335
00336     //
00337     // perform the actual registration
00338     //
00339
00340     ATOM atomClassRegistration = 0;
00341
00342     atomClassRegistration = RegisterClass(&wc);
00343
00344     if (0 == atomClassRegistration)
00345     {
00346         LOG((MSP_ERROR,
00347             "CMSPThread::ThreadProc - RegisterClass failed, last error %ld",
00348             GetLastError()));
00349
00350         hr = E_FAIL;
00351         goto exit;
00352     }
00353
00354
00355     //
00356     // create window that will receive pnp notifications
00357     //
00358
00359     m_hWndNotif = CreateWindow(szWindowClassName, _T("MSP PNP Notification Window"), 0,
00360             CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, this);
00361
00362     if (m_hWndNotif == NULL)
00363     {
00364         LOG((MSP_ERROR, "CMSPThread::ThreadProc - can't create notification window"));
00365         hr = E_FAIL;
00366         goto exit;
00367     }
00368
00369
00370     //
00371     // success
00372     //
00373
00374     LOG((MSP_TRACE, "CMSPThread::ThreadProc - created notification window"));
00375
00376
00377     //
00378     // Register to receive PNP device notifications
00379     //
00380     DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
00381
00382     ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
00383     NotificationFilter.dbcc_size =
00384         sizeof(DEV_BROADCAST_DEVICEINTERFACE);
00385     NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
00386     NotificationFilter.dbcc_classguid = AM_KSCATEGORY_VIDEO;
00387
00388     if ((m_hDevNotifyVideo = RegisterDeviceNotification( m_hWndNotif,
00389         &NotificationFilter,
00390         DEVICE_NOTIFY_WINDOW_HANDLE
00391         )) == NULL)
00392     {
00393         LOG((MSP_ERROR, "CMSPThread::ThreadProc - can't register for video device notification"));
00394         hr = E_FAIL;
00395         goto exit;
00396     }
00397
00398     NotificationFilter.dbcc_classguid = AM_KSCATEGORY_AUDIO;
00399
00400     if ((m_hDevNotifyAudio = RegisterDeviceNotification( m_hWndNotif,
00401         &NotificationFilter,
00402         DEVICE_NOTIFY_WINDOW_HANDLE
00403         )) == NULL)
00404     {
00405         LOG((MSP_ERROR, "CMSPThread::ThreadProc - can't register for audio device notification"));
00406         hr = E_FAIL;
00407         goto exit;
00408     }
00409
00410     LOG((MSP_TRACE, "CMSPThread::ThreadProc - registered for PNP device notifications"));
00411
00412     while (!bExitFlag)
00413     {
00414         //
00415         // Msg:      Grab window messages.
00416         // Multiple: We only use 1, but Msg and Ex only exist with Multiple.
00417         // Ex:       Allow flags, so we can pass in MWMO_ALERTABLE.
00418         //
00419
00420         DWORD dwResult = ::MsgWaitForMultipleObjectsEx(
00421             1,                // wait for one event
00422             &m_hCommandEvent, // array of events to wait for
00423             INFINITE,         // wait forever
00424             QS_ALLINPUT,      // get all window messages
00425             MWMO_ALERTABLE    // get APC requests (in case this MSP uses them)
00426             );
00427
00428         if ( ( dwResult == WAIT_OBJECT_0 ) || ( dwResult == WAIT_OBJECT_0 + 1 ) )
00429         {
00430             LOG((MSP_TRACE, "thread is signaled"));
00431
00432             m_QueueLock.Lock();
00433
00434             while ( ! IsListEmpty(&m_CommandQueue) )
00435             {
00436
00437                 LIST_ENTRY * links = RemoveHeadList( &m_CommandQueue );
00438
00439                 m_QueueLock.Unlock();
00440
00441                 COMMAND_QUEUE_ITEM * pItem =
00442                     CONTAINING_RECORD(links,
00443                                       COMMAND_QUEUE_ITEM,
00444                                       link);
00445
00446                 COMMAND_NODE * pNode = &(pItem->node);
00447
00448                 switch (pNode->cmd)
00449                 {
00450
00451                 case WORK_ITEM:
00452
00453                     LOG((MSP_TRACE, "CMSPThread::ThreadProc - "
00454                         "got command WORK_ITEM"));
00455
00456                     pNode->pfn( pNode->pContext );
00457
00458                     if ( pNode->hEvent != NULL )
00459                     {
00460                         if ( SetEvent( pNode->hEvent ) == 0 )
00461                         {
00462                             LOG((MSP_ERROR, "CMSPThread::ThreadProc - "
00463                                 "can't signal event for synchronous work "
00464                                 "item"));
00465                         }
00466                     }
00467                     break;
00468
00469                 case STOP:
00470
00471                     LOG((MSP_TRACE, "CMSPThread::ThreadProc - "
00472                         "thread is exiting"));
00473
00474                     bExitFlag = TRUE;
00475                     break;
00476                 }
00477
00478                 delete pItem;
00479
00480                 m_QueueLock.Lock();
00481
00482             }
00483             m_QueueLock.Unlock();
00484
00485
00486             //
00487             // We have processed all commands and unblocked everyone
00488             // who is waiting for us. Now check for window messages.
00489             //
00490
00491             MSG msg;
00492
00493             // Retrieve the next item in the message queue.
00494
00495             while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
00496             {
00497                 TranslateMessage(&msg);
00498                 DispatchMessage(&msg);
00499             }
00500         }
00501         else if ( dwResult == WAIT_IO_COMPLETION )
00502         {
00503             // FEATUREFEATURE: The base MSP does not do anything with APC /
00504             // async I/O. If the derived MSP does something with it, they must
00505             // implement this to take appropriate action. Question is, how
00506             // best to expose this to the derived MSP? We could have a method
00507             // to override, but then how would the derived thread class get
00508             // instantiated? Instead, we'll have to have a method to set
00509             // an async I/O completion callback function pointer.
00510         }
00511         else
00512         {
00513             LOG((MSP_ERROR, "CMSPThread::ThreadProc - "
00514                 "WaitForMultipleObjects failed  %ld", GetLastError()));
00515
00516             break;
00517         }
00518     }
00519
00520     hr = S_OK;
00521
00522 exit:
00523
00524
00525
00526     //
00527     //  cleanup:
00528     //
00529     //  Unregister from PNP device notifications
00530     //  destroy window
00531     //  unregister window class
00532     //  couninitialize
00533     //
00534
00535
00536     //
00537     // unregister from video pnp events if needed
00538     //
00539
00540     if ( NULL != m_hDevNotifyVideo )
00541     {
00542         HRESULT hr2 = UnregisterDeviceNotification(m_hDevNotifyVideo);
00543
00544         if (FAILED(hr2))
00545         {
00546
00547             LOG((MSP_ERROR,
00548                 "CMSPThread::ThreadProc - UnregisterDeviceNotification failed for video events. "
00549                 "hr = %lx", hr2));
00550         }
00551     }
00552
00553
00554     //
00555     // unregister from audio pnp events if needed
00556     //
00557
00558     if ( NULL != m_hDevNotifyAudio )
00559     {
00560
00561         HRESULT hr2 = UnregisterDeviceNotification(m_hDevNotifyAudio);
00562
00563         if (FAILED(hr2))
00564         {
00565
00566             LOG((MSP_ERROR,
00567                 "CMSPThread::ThreadProc - UnregisterDeviceNotification failed for audio events. "
00568                 "hr = %lx", hr2));
00569         }
00570     }
00571
00572
00573     //
00574     // destroy window if needed
00575     //
00576
00577     if ( NULL != m_hWndNotif )
00578     {
00579
00580         BOOL bDestroyWindowSuccess = DestroyWindow(m_hWndNotif);
00581
00582         if ( ! bDestroyWindowSuccess )
00583         {
00584             LOG((MSP_ERROR,
00585                 "CMSPThread::ThreadProc - DestroyWindow failed. LastError = %ld",
00586                 GetLastError()));
00587         }
00588     }
00589
00590
00591     //
00592     // unregister window class
00593     //
00594
00595     if (0 != atomClassRegistration)
00596     {
00597
00598         BOOL bUnregisterSuccess = UnregisterClass( (LPCTSTR)atomClassRegistration, ::GetModuleHandle(NULL) );
00599
00600         if ( ! bUnregisterSuccess )
00601         {
00602             LOG((MSP_ERROR,
00603                 "CMSPThread::ThreadProc - UnregisterClass failed. LastError = %ld",
00604                 GetLastError()));
00605         }
00606     }
00607
00608
00609     ::CoUninitialize();
00610
00611     LOG((MSP_(hr), "CMSPThread::ThreadProc - exit. hr = 0x%lx", hr));
00612
00613     return hr;
00614 }
00615
00616 HRESULT CMSPThread::QueueWorkItem(
00617     LPTHREAD_START_ROUTINE Function,
00618     PVOID Context,
00619     BOOL  fSynchronous
00620     )
00621 {
00622     LOG((MSP_TRACE, "CMSPThread::QueueWorkItem - enter"));
00623
00624
00625     //
00626     // Create a command block for this.
00627     //
00628
00629     COMMAND_QUEUE_ITEM * pItem = new COMMAND_QUEUE_ITEM;
00630
00631     if ( ! pItem )
00632     {
00633         LOG((MSP_ERROR, "CMSPThread::QueueWorkItem - "
00634             "can't allocate new queue item - exit E_OUTOFMEMORY"));
00635
00636         return E_OUTOFMEMORY;
00637     }
00638
00639
00640     //
00641     // Create an event to wait on if this is a synchronous work item.
00642     // Otherwise the thread proc gets a NULL event handle and it knows not to
00643     // signal it since it's an asynchronous work item.
00644     //
00645
00646     TCHAR *ptczEventName = NULL;
00647
00648 #if DBG
00649
00650     static LONG lSequenceNumber = 0;
00651
00652
00653     //
00654     // in debug build, use named events
00655     //
00656
00657     TCHAR tszEventName[MAX_PATH];
00658
00659     InterlockedIncrement(&lSequenceNumber);
00660
00661
00662     //
00663     // identify events by the address of the correspoding queue item, and by
00664     // the sequence number
00665     //
00666
00667     _stprintf(tszEventName,
00668         _T("CMSPThread_QueueWorkitemEvent_pid[0x%lx]_CMSPThread[%p]_Event[%p]_eventNumber[%lu]"),
00669         GetCurrentProcessId(), this, pItem, lSequenceNumber);
00670
00671     LOG((MSP_TRACE, "CMSPThread::QueueWorkItem - creating event[%S]", tszEventName));
00672
00673     ptczEventName = &tszEventName[0];
00674
00675 #endif
00676
00677
00678     HANDLE hEvent = NULL;
00679
00680     if (fSynchronous)
00681     {
00682         hEvent = ::CreateEvent(NULL,
00683                                FALSE,           // flag for manual-reset event
00684                                FALSE,           // initial state is not set.
00685                                ptczEventName);  // No name in release, named in debug
00686
00687         if ( hEvent == NULL )
00688         {
00689             LOG((MSP_ERROR, "CMSPThread::QueueWorkItem - "
00690                 "Can't create the Job Done event"));
00691
00692             delete pItem;
00693             pItem = NULL;
00694
00695             return E_FAIL;
00696         }
00697     }
00698
00699
00700     //
00701     // we already have the q item, now initialize it.
00702     //
00703
00704     pItem->node.cmd        = WORK_ITEM;
00705     pItem->node.pfn        = Function;
00706     pItem->node.pContext   = Context;
00707     pItem->node.hEvent     = hEvent;
00708
00709
00710     //
00711     // Put the command block on the queue. The queue is protected by a
00712     // critical section.
00713     //
00714
00715     m_QueueLock.Lock();
00716     InsertTailList(&m_CommandQueue, &(pItem->link));
00717
00718
00719     //
00720     // Signal the thread to process the command.
00721     //
00722
00723     if (SignalThreadProc() == 0)
00724     {
00725
00726         //
00727         // failed to signal processing thread
00728         // cleanup and return error
00729         //
00730
00731
00732         //
00733         // remove the queue entry we have submitted
00734         //
00735
00736         RemoveTailList(&m_CommandQueue);
00737
00738
00739         //
00740         // unlock the queue so other threads can use it
00741         //
00742
00743         m_QueueLock.Unlock();
00744
00745
00746         //
00747         // close handle and delete pItem that we have created --
00748         // no one else is going to do this for us
00749         //
00750
00751         if (NULL != hEvent)
00752         {
00753             ::CloseHandle(hEvent);
00754             hEvent = NULL;
00755         }
00756
00757         delete pItem;
00758         pItem = NULL;
00759
00760
00761         LOG((MSP_ERROR, "CMSPThread::QueueWorkItem - "
00762             "can't signal the thread"));
00763
00764         return E_FAIL;
00765     }
00766
00767
00768     //
00769     // unlock the event queue, so it can be used by processing and other
00770     // threads
00771     //
00772
00773     m_QueueLock.Unlock();
00774
00775
00776     //
00777     // If this is a sychronous work item, wait for it to complete and
00778     // then close the event handle.
00779     //
00780     // FEATUREFEATURE: Rather than creating and deleting an event for each
00781     // work item, have a cache of events that can be reused.
00782     //
00783
00784     if (fSynchronous)
00785     {
00786         LOG((MSP_TRACE, "CMSPThread::QueueWorkItem - "
00787             "blocked waiting for synchronous work item to complete"));
00788
00789         // Wait for the synchronous work item to complete.
00790
00791         HANDLE hEvents[2];
00792         DWORD dwEvent;
00793
00794         hEvents[0] = hEvent;
00795         hEvents[1] = m_hThread;
00796
00797         dwEvent = WaitForMultipleObjects(
00798             2,
00799             hEvents,
00800             FALSE,
00801             INFINITE);
00802
00803         switch (dwEvent)
00804         {
00805         case WAIT_OBJECT_0 + 0:
00806             break;
00807
00808         case WAIT_OBJECT_0 + 1:
00809             LOG((MSP_ERROR, "CMSPThread::QueueWorkItem - "
00810                 "thread exited"));
00811
00812             //
00813             // if the item is still in the queue, remove it (since the thread
00814             // won't)
00815             //
00816
00817             m_QueueLock.Lock();
00818
00819             if (IsNodeOnList(&m_CommandQueue, &(pItem->link)))
00820             {
00821                 RemoveEntryList(&(pItem->link));
00822                 delete pItem;
00823             }
00824
00825             m_QueueLock.Unlock();
00826
00827
00828             //
00829             // time to close event and fail
00830             //
00831
00832             ::CloseHandle(hEvent);
00833
00834             return E_FAIL;
00835
00836         default:
00837             LOG((MSP_ERROR, "CMSPThread::QueueWorkItem - "
00838                 "WaitForSingleObject failed"));
00839         }
00840
00841         ::CloseHandle(hEvent);
00842     }
00843
00844     LOG((MSP_TRACE, "CMSPThread::QueueWorkItem - exit S_OK"));
00845
00846     return S_OK;
00847 }
00848
00849 LRESULT CALLBACK CMSPThread::NotifWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00850 {
00851     PNOTIF_LIST pnl;
00852
00853     if (uMsg == WM_CREATE)
00854     {
00855         SetLastError(0);
00856         if (!SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)(((LPCREATESTRUCT)lParam)->lpCreateParams)))
00857         {
00858             if (GetLastError())  // It isn't really an error unless get last error says so
00859             {
00860                 LOG((MSP_ERROR, "CMSPThread::NotifWndProc - SetWindowLongPtr failed %ld", GetLastError()));
00861                 _ASSERTE(FALSE);
00862                 return -1;
00863             }
00864         }
00865     }
00866     else
00867     {
00868         CMSPThread *me = (CMSPThread*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
00869
00870         switch (uMsg)
00871         {
00872             case WM_DEVICECHANGE:
00873                 switch(wParam)
00874                 {
00875                 case DBT_DEVICEARRIVAL:
00876                     LOG((MSP_TRACE, "CMSPThread::NotifWndProc - DBT_DEVICEARRIVAL"));
00877
00878                     me->m_NotifLock.Lock();
00879
00880                     pnl = me->m_NotifList;
00881                     while (pnl != NULL)
00882                     {
00883                         pnl->addr->PnpNotifHandler(TRUE);
00884                         pnl = pnl->next;
00885                     }
00886
00887                     me->m_NotifLock.Unlock();
00888                     break;
00889
00890                 case DBT_DEVICEREMOVECOMPLETE:
00891                     LOG((MSP_TRACE, "CMSPThread::NotifWndProc - DBT_DEVICEREMOVECOMPLETE"));
00892
00893                     me->m_NotifLock.Lock();
00894
00895                     pnl = me->m_NotifList;
00896                     while (pnl != NULL)
00897                     {
00898                         pnl->addr->PnpNotifHandler(FALSE);
00899                         pnl = pnl->next;
00900                     }
00901
00902                     me->m_NotifLock.Unlock();
00903                     break;
00904                 }
00905
00906                 return 0;
00907
00908             case WM_DESTROY:
00909                 return 0;
00910
00911             default:
00912                 return DefWindowProc(hwnd, uMsg, wParam, lParam);
00913         }
00914     }
00915     return 0;
00916 }
00917
00918 HRESULT CMSPThread::RegisterPnpNotification(CMSPAddress *pCMSPAddress)
00919 {
00920     PNOTIF_LIST pnl;
00921     HRESULT hr;
00922
00923     if (IsBadReadPtr(pCMSPAddress, sizeof(CMSPAddress)))
00924     {
00925         LOG((MSP_ERROR, "CMSPThread::RegisterPnpNotification - bad address pointer"));
00926         return E_POINTER;
00927     }
00928
00929     m_NotifLock.Lock();
00930
00931     // Add a new node to the list
00932     pnl = new NOTIF_LIST;
00933
00934     if (pnl == NULL)
00935     {
00936         LOG((MSP_ERROR, "CMSPThread::RegisterPnpNotification - out of memory"));
00937         hr = E_OUTOFMEMORY;
00938     }
00939     else
00940     {
00941
00942
00943         //
00944         // note that we don't keep addref the address -- it is the
00945         // caller's responsibility to ensure we are notified through
00946         // UnregisterPnpNotification when the address is going away
00947         //
00948
00949         pnl->next = m_NotifList;
00950         pnl->addr = pCMSPAddress;
00951         m_NotifList = pnl;
00952         hr = S_OK;
00953     }
00954
00955     m_NotifLock.Unlock();
00956     return hr;
00957 }
00958
00959 HRESULT CMSPThread::UnregisterPnpNotification(CMSPAddress *pCMSPAddress)
00960 {
00961     PNOTIF_LIST pnl, pnlLast;
00962     HRESULT hr = E_FAIL;
00963
00964     if (IsBadReadPtr(pCMSPAddress, sizeof(CMSPAddress)))
00965     {
00966         LOG((MSP_ERROR, "CMSPThread::UnregisterPnpNotification - bad address pointer"));
00967         return E_POINTER;
00968     }
00969
00970     m_NotifLock.Lock();
00971
00972     pnl = m_NotifList;
00973
00974     if ((pnl != NULL) && (pnl->addr == pCMSPAddress))
00975     {
00976         // It is fist in the list, remove it
00977         m_NotifList = pnl->next;
00978         delete pnl;
00979
00980         hr = S_OK;
00981     }
00982     else while (pnl != NULL)
00983     {
00984         pnlLast = pnl;
00985         pnl = pnl->next;
00986
00987         if ((pnl != NULL) && (pnl->addr == pCMSPAddress))
00988         {
00989             // Found it in the list, remove it
00990             pnlLast->next = pnl->next;
00991             delete pnl;
00992
00993             hr = S_OK;
00994
00995             break;
00996         }
00997     }
00998
00999     if (pnl == NULL)
01000     {
01001         LOG(( MSP_WARN, "CMSPThread::UnregisterPnpNotification - address pointer not found in notification list." ));
01002         hr = E_FAIL;
01003     }
01004
01005     m_NotifLock.Unlock();
01006     return hr;
01007 }
01008
01009 // eof
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/space.h Source File

  • SysMgmt
  • MMC
  • CutCopy

space.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SPACE_H
00021 #define _SPACE_H
00022
00023 #include "DeleBase.h"
00024 #include "CompData.h"
00025
00026 class CSpaceStation;
00027 class CComponentData;
00028
00029 class CRocket : public CDelegationBase {
00030 public:
00031     CRocket(CSpaceStation *pSpaceStation, _TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload);
00032     virtual ~CRocket();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00035     virtual const GUID & getNodeType() { return thisGuid; }
00036     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00037   BOOL getDeletedStatus() { return isDeleted; }
00038   void setDeletedStatus(BOOL status) { isDeleted = status; }
00039
00040 public:
00041     // virtual functions go here (for MMCN_*)
00042     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00043   virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype);
00044   virtual HRESULT OnDelete(IConsole *pConsole);
00045   virtual HRESULT OnRefresh(IConsole *pConsole);
00046     virtual HRESULT OnRename(LPOLESTR pszNewName);
00047
00048 private:
00049     // {29743810-4C4B-11d2-89D8-000021473128}
00050     static const GUID thisGuid;
00051
00052     _TCHAR *szName;
00053     LONG   lWeight;
00054     LONG   lHeight;
00055     LONG   lPayload;
00056     int    nId;
00057
00058   friend CSpaceStation;
00059   CSpaceStation *m_pSpaceStation;
00060
00061     enum ROCKET_STATUS {RUNNING, PAUSED, STOPPED} iStatus;
00062
00063   BOOL isDeleted;
00064 };
00065
00066 class CSpaceStation : public CDelegationBase {
00067 public:
00068     CSpaceStation();
00069     virtual ~CSpaceStation();
00070
00071     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Space Station"); }
00072     virtual const GUID & getNodeType() { return thisGuid; }
00073     virtual const int GetBitmapIndex() { return INDEX_STATION; }
00074
00075 public:
00076   virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00077     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions);
00078     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00079
00080   virtual HRESULT OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted);
00081   virtual HRESULT OnQueryPaste(CDelegationBase *pPasted);
00082   virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype);
00083   virtual HRESULT OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace);
00084
00085
00086 private:
00087     // {29743810-4C4B-11d2-89D8-000021473128}
00088     static const GUID thisGuid;
00089   HRESULT Expand(IConsoleNameSpace *pConsoleNameSpace);
00090
00091
00092 private:
00093   enum { NUMBER_OF_CHILDREN = 9, MAX_CHILDREN = 20 };
00094     CRocket *children[MAX_CHILDREN];
00095   CComponentData *m_pComponentData;
00096   int m_cChildSpaceStations;
00097
00098 public:
00099   int GetCountChildSpaceStations() { return m_cChildSpaceStations; }
00100   void DecrementCountChildSpaceStations() { m_cChildSpaceStations--; }
00101 };
00102
00103 class CSpaceFolder : public CDelegationBase {
00104 public:
00105     CSpaceFolder();
00106
00107     virtual ~CSpaceFolder();
00108
00109     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Space Vehicles"); }
00110     virtual const GUID & getNodeType() { return thisGuid; }
00111     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00112
00113 public:
00114     // virtual functions go here (for MMCN_*)
00115     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00116
00117 private:
00118     enum { IDM_NEW_SPACE = 4 };
00119
00120     // {29743810-4C4B-11d2-89D8-000021473128}
00121     static const GUID thisGuid;
00122
00123 private:
00124     enum { NUMBER_OF_CHILDREN = 4 };
00125     CSpaceStation *children[NUMBER_OF_CHILDREN];
00126 };
00127
00128 #endif // _SPACE_H
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Keep-Alive/KeepAlive.c Source File

  • Web
  • iis
  • extensions
  • Keep-Alive

KeepAlive.c

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1997-2002  Microsoft Corporation
00003
00004   Module Name:
00005
00006     KeepAlive.c
00007
00008   Abstract:
00009
00010      Sample ISAPI Extension demonstrating Keep-Alive.
00011 */
00012
00013 #define WIN32_LEAN_AND_MEAN
00014 #include <windows.h>
00015 #include <httpext.h>
00016 #include <stdio.h>
00017
00018 /*
00019   Description:
00020
00021     This is required ISAPI Extension DLL entry point.
00022
00023   Arguments:
00024
00025     pVer - poins to extension version info structure
00026
00027   Returns:
00028
00029     always returns TRUE
00030 */
00031
00032 BOOL WINAPI GetExtensionVersion(OUT HSE_VERSION_INFO *pVer)
00033 {
00034   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00035
00036   strncpy(pVer->lpszExtensionDesc, "ISAPI Keep-Alive Extension Sample", HSE_MAX_EXT_DLL_NAME_LEN);
00037
00038   return TRUE;
00039 }
00040
00041 /*
00042   Description:
00043
00044     Demonstrate persistent connection from ISAPI extension DLL.
00045
00046   Arguments:
00047
00048     pECB - pointer to the extenstion control block
00049
00050   Returns:
00051
00052     HSE_STATUS_SUCCESS_AND_KEEP_CONN
00053 */
00054
00055 DWORD WINAPI HttpExtensionProc(IN EXTENSION_CONTROL_BLOCK *pECB)
00056 {
00057   /*
00058     Use the "Connection: Keep-Alive" header to keep the connection open;
00059     also, the "Content-Length:" header is required, so that the client knows when
00060     the server has finished.
00061   */
00062
00063   char szHeader[] =
00064       "Connection: Keep-Alive\r\n"
00065       "Content-Length: %lu\r\n"
00066       "Content-type: text/html\r\n\r\n";
00067
00068   char szContent[] =
00069       "<html> <form method=get action=\\scripts\\KeepAlive.dll>"
00070       "<h1>Keep-Alive Sample</h1><hr>"
00071       "<input type=submit value=\"Send Request\"></form></html>";
00072
00073   char szBuffer[4096];
00074   DWORD dwSize;
00075   HSE_SEND_HEADER_EX_INFO HeaderExInfo;
00076
00077   /* Send outgoing header with exact content length */
00078
00079   sprintf(szBuffer, szHeader, strlen(szContent));
00080
00081   HeaderExInfo.pszHeader = szBuffer;
00082   HeaderExInfo.cchHeader = strlen(szBuffer);
00083   HeaderExInfo.pszStatus = "200 OK";
00084   HeaderExInfo.cchStatus = strlen(HeaderExInfo.pszStatus);
00085   HeaderExInfo.fKeepConn = TRUE;
00086
00087   pECB->ServerSupportFunction(pECB, HSE_REQ_SEND_RESPONSE_HEADER_EX, &HeaderExInfo, NULL, NULL);
00088
00089   /* Send content */
00090
00091   dwSize = strlen(szContent);
00092
00093   pECB->WriteClient(pECB, szContent, &dwSize, HSE_IO_SYNC);
00094
00095   /* This return code tells IIS not to close the socket connection. */
00096
00097   return HSE_STATUS_SUCCESS_AND_KEEP_CONN;
00098 }
00099
00100 /*
00101   Description:
00102
00103     This is optional ISAPI extension DLL entry point. If present, it will be
00104     called before unloading the DLL, giving it a chance to perform any
00105     shutdown procedures.
00106
00107   Arguments:
00108
00109     dwFlags - HSE_TERM_ADVISORY_UNLOAD or HSE_TERM_MUST_UNLOAD
00110
00111   Return Value:
00112
00113     TRUE if extension is ready to be unloaded,
00114     FALSE otherwise
00115 */
00116
00117 BOOL WINAPI TerminateExtension(IN DWORD dwFlags)
00118 {
00119     return TRUE;
00120 }
00121
00122
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/conf.cpp Source File

  • Web
  • NetMeeting
  • NMChat2

conf.cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       CONF.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1999-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016 #include "imsconf2.c"
00017
00018 //****************************************************************************
00019 //
00020 // Global Varaiables
00021 //
00022 //****************************************************************************
00023
00024 //
00025 // The Conference Manager
00026 //
00027 INmManager     *g_pMgr  = NULL;
00028
00029 //
00030 // Notifications for the Manager
00031 //
00032 CMgrNotify     *g_pMgrNotify = NULL;
00033
00034 //
00035 // The Current Conference
00036 //
00037 INmConference  *g_pConference = NULL;
00038
00039 //
00040 // Notifications for the Conference
00041 //
00042 CConfNotify    *g_pConferenceNotify = NULL;
00043
00044 //
00045 // TRUE when the conference is active
00046 //
00047 BOOL            g_fActiveConference = FALSE;
00048
00049
00050 //****************************************************************************
00051 //
00052 // CLASS CMgrNotify
00053 //
00054 //****************************************************************************
00055
00056 //****************************************************************************
00057 //
00058 // Constructor
00059 //
00060 //****************************************************************************
00061
00062 CMgrNotify::CMgrNotify()
00063 :
00064     CRefCount(),
00065     CNotify()
00066 {
00067 }
00068
00069
00070 //****************************************************************************
00071 //
00072 // Destructor
00073 //
00074 //****************************************************************************
00075
00076 CMgrNotify::~CMgrNotify()
00077 {
00078 }
00079
00080
00081 //****************************************************************************
00082 //
00083 // Methods from IUnknown
00084 //
00085 //****************************************************************************
00086
00087 ULONG STDMETHODCALLTYPE
00088 CMgrNotify::AddRef(void)
00089 {
00090     return CRefCount::AddRef();
00091 }
00092
00093
00094 ULONG STDMETHODCALLTYPE
00095 CMgrNotify::Release(void)
00096 {
00097     return CRefCount::Release();
00098 }
00099
00100 HRESULT STDMETHODCALLTYPE
00101 CMgrNotify::QueryInterface(REFIID riid, void * *ppvObject)
00102 {
00103     if(NULL == ppvObject)
00104   {
00105     return E_POINTER;
00106   }
00107
00108   HRESULT hr = NO_ERROR;
00109
00110     if (riid == IID_IUnknown)
00111     {
00112         *ppvObject = (IUnknown *)this;
00113     }
00114     else if (riid == IID_INmManagerNotify)
00115     {
00116         *ppvObject = (INmManagerNotify *)this;
00117     }
00118     else
00119     {
00120         hr = E_NOINTERFACE;
00121         *ppvObject = NULL;
00122     }
00123
00124     if (S_OK == hr)
00125     {
00126         AddRef();
00127     }
00128
00129     return hr;
00130 }
00131
00132
00133 //****************************************************************************
00134 //
00135 // HRESULT InitConfMgr(void)
00136 //
00137 //****************************************************************************
00138
00139 HRESULT InitConfMgr(void)
00140 {
00141     HRESULT hr      = NO_ERROR;
00142     LPCLASSFACTORY pcf  = NULL;
00143
00144     //
00145     // Notify the system we want to use the conferencing services
00146     // by creating a conference manager object
00147     //
00148     hr = CoGetClassObject(CLSID_NmManager,
00149                           CLSCTX_INPROC,
00150                           NULL,
00151                           IID_IClassFactory,
00152                           (void**)&pcf);
00153     if (SUCCEEDED(hr))
00154     {
00155         //
00156         // Get the conference manager object
00157         //
00158         hr = pcf->CreateInstance(NULL, IID_INmManager, (void**)&g_pMgr);
00159         if (SUCCEEDED(hr))
00160         {
00161             //
00162             // Connect to the conference manager object
00163             //
00164             g_pMgrNotify = new CMgrNotify();
00165             if (NULL != g_pMgrNotify)
00166             {
00167                 hr = g_pMgrNotify->Connect(g_pMgr);
00168                 if (SUCCEEDED(hr))
00169                 {
00170                     ULONG uchCaps = NMCH_ALL;
00171                     ULONG uOptions = 0;
00172                     hr = g_pMgr->Initialize(&uOptions, &uchCaps);
00173           if (SUCCEEDED (hr))
00174           {
00175             INmSysInfo* spSysInfo=NULL;
00176
00177             hr=g_pMgr->GetSysInfo(&spSysInfo);
00178
00179             if (SUCCEEDED(hr))
00180             {
00181               BSTR bstrVer = NULL;
00182               hr = spSysInfo->GetProperty(NM_SYSPROP_BUILD_VER, &bstrVer);
00183               ::SysFreeString(bstrVer);
00184               if (hr != S_OK)
00185               {
00186                 MessageBox(NULL,"This sample needs Windows Netmeeting3.0","Wrong Version",MB_OK);
00187                 return E_FAIL;
00188               }
00189             }
00190           }
00191                 }
00192             }
00193         }
00194
00195         pcf->Release();
00196     }
00197
00198     return hr;
00199 }
00200
00201
00202 //****************************************************************************
00203 //
00204 // void FreeConfMgr(void)
00205 //
00206 //****************************************************************************
00207
00208 void FreeConfMgr(void)
00209 {
00210     //
00211     // Release conference manager notify
00212     //
00213     if (NULL != g_pMgrNotify)
00214     {
00215         g_pMgrNotify->Disconnect();
00216         g_pMgrNotify->Release();
00217         g_pMgrNotify = NULL;
00218     }
00219
00220     //
00221     // Release conference manager
00222     //
00223     if (NULL != g_pMgr)
00224     {
00225         g_pMgr->Release();
00226         g_pMgr = NULL;
00227     }
00228 }
00229
00230
00231 //****************************************************************************
00232 //
00233 // void FreeConference(void)
00234 //
00235 //****************************************************************************
00236
00237 void FreeConference(void)
00238 {
00239     if (NULL != g_pConferenceNotify)
00240     {
00241         g_pConferenceNotify->Disconnect();
00242         g_pConferenceNotify->Release();
00243         g_pConferenceNotify = NULL;
00244     }
00245
00246     if (NULL != g_pConference)
00247     {
00248         g_pConference->Release();
00249         g_pConference = NULL;
00250     }
00251 }
00252
00253
00254 //****************************************************************************
00255 //
00256 // Methods from ICNotify
00257 //
00258 //****************************************************************************
00259
00260 HRESULT STDMETHODCALLTYPE
00261 CMgrNotify::Connect(IUnknown *pUnk)
00262 {
00263     return CNotify::Connect(pUnk, IID_INmManagerNotify, (IUnknown *)this);
00264 }
00265
00266 HRESULT STDMETHODCALLTYPE
00267 CMgrNotify::Disconnect(void)
00268 {
00269     return CNotify::Disconnect();
00270 }
00271
00272
00273 //****************************************************************************
00274 //
00275 // Methods from INmManagerNotify
00276 //
00277 //****************************************************************************
00278
00279 HRESULT STDMETHODCALLTYPE
00280 CMgrNotify::NmUI(CONFN confn)
00281 {
00282     return S_OK;
00283 }
00284
00285 HRESULT STDMETHODCALLTYPE
00286 CMgrNotify::CallCreated(INmCall *pCall)
00287 {
00288     return S_OK;
00289 }
00290
00291 HRESULT STDMETHODCALLTYPE
00292 CMgrNotify::ConferenceCreated(INmConference *pConference)
00293 {
00294     ASSERT(NULL != pConference);
00295     if(NULL == pConference)
00296   {
00297     return E_POINTER;
00298   }
00299
00300   pConference->AddRef();
00301
00302     ASSERT(NULL == g_pConference);
00303   if(NULL != g_pConference)
00304   {
00305     return E_POINTER;
00306   }
00307
00308     g_pConference = pConference;
00309
00310     //
00311     // Connect to the conference object
00312     //
00313     ASSERT(NULL == g_pConferenceNotify)
00314     g_pConferenceNotify = new CConfNotify();
00315     if (NULL != g_pConferenceNotify)
00316     {
00317         HRESULT hr = g_pConferenceNotify->Connect(pConference);
00318         if (FAILED(hr))
00319         {
00320             g_pConferenceNotify->Release();
00321             g_pConferenceNotify = NULL;
00322         }
00323     }
00324
00325     return S_OK;
00326 }
00327
00328
00329 //****************************************************************************
00330 //
00331 // CLASS CConfNotify
00332 //
00333 //****************************************************************************
00334
00335 //****************************************************************************
00336 //
00337 // Constructor
00338 //
00339 //****************************************************************************
00340
00341 CConfNotify::CConfNotify()
00342 :
00343     CRefCount(),
00344     CNotify()
00345 {
00346     m_cIMembers = 0;
00347     ::ZeroMemory(m_apIMembers, sizeof(m_apIMembers));
00348 }
00349
00350
00351 //****************************************************************************
00352 //
00353 // Destructor
00354 //
00355 //****************************************************************************
00356
00357 CConfNotify::~CConfNotify()
00358 {
00359     ReleaseIMemberArray();
00360 }
00361
00362
00363 //****************************************************************************
00364 //
00365 // Methods from IUnknown
00366 //
00367 //****************************************************************************
00368
00369 ULONG STDMETHODCALLTYPE
00370 CConfNotify::AddRef(void)
00371 {
00372     return CRefCount::AddRef();
00373 }
00374
00375
00376 ULONG STDMETHODCALLTYPE
00377 CConfNotify::Release(void)
00378 {
00379     return CRefCount::Release();
00380 }
00381
00382 HRESULT STDMETHODCALLTYPE
00383 CConfNotify::QueryInterface(REFIID riid, void * *ppvObject)
00384 {
00385     if(NULL == ppvObject)
00386   {
00387     return E_POINTER;
00388   }
00389
00390   HRESULT hr = NO_ERROR;
00391
00392     if (riid == IID_IUnknown)
00393     {
00394         *ppvObject = (IUnknown *)this;
00395     }
00396     else if (riid == IID_INmConferenceNotify)
00397     {
00398         *ppvObject = (INmConferenceNotify *)this;
00399     }
00400     else
00401     {
00402         hr = E_NOINTERFACE;
00403         *ppvObject = NULL;
00404     }
00405
00406     if (S_OK == hr)
00407     {
00408         AddRef();
00409     }
00410
00411     return hr;
00412 }
00413
00414
00415 //****************************************************************************
00416 //
00417 // Methods from ICNotify
00418 //
00419 //****************************************************************************
00420
00421 HRESULT STDMETHODCALLTYPE
00422 CConfNotify::Connect(IUnknown *pUnk)
00423 {
00424     return CNotify::Connect(pUnk, IID_INmConferenceNotify, (IUnknown *)this);
00425 }
00426
00427 HRESULT STDMETHODCALLTYPE
00428 CConfNotify::Disconnect(void)
00429 {
00430     return CNotify::Disconnect();
00431 }
00432
00433
00434 //****************************************************************************
00435 //
00436 // Methods from IConfNotify
00437 //
00438 //****************************************************************************
00439
00440 HRESULT STDMETHODCALLTYPE
00441 CConfNotify::NmUI(CONFN uNotify)
00442 {
00443     return S_OK;
00444 }
00445
00446 HRESULT STDMETHODCALLTYPE
00447 CConfNotify::StateChanged(NM_CONFERENCE_STATE uState)
00448 {
00449     if (NULL == g_pConference)
00450   {
00451         return S_OK;
00452   }
00453
00454     switch (uState)
00455     {
00456     case NM_CONFERENCE_ACTIVE:
00457     {
00458       g_fActiveConference = TRUE;
00459       break;
00460     }
00461     case NM_CONFERENCE_INITIALIZING:
00462     {
00463       break; // can't do anything just yet
00464     }
00465     case NM_CONFERENCE_WAITING:
00466     {
00467 			::UiDisplaySysMsg(TEXT("Waiting in Host Mode"));
00468       g_fActiveConference = FALSE;
00469       break;
00470     }
00471     case NM_CONFERENCE_IDLE:
00472     {
00473 			::UiDisplaySysMsg(TEXT("No conference"));
00474       g_fActiveConference = FALSE;
00475 			::FreeConference();
00476       break;
00477     }
00478     }
00479
00480     return S_OK;
00481 }
00482
00483 HRESULT STDMETHODCALLTYPE
00484 CConfNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pIMember)
00485 {
00486     if(NULL == pIMember)
00487   {
00488     return E_POINTER;
00489   }
00490
00491   switch (uNotify)
00492     {
00493     case NM_MEMBER_ADDED:
00494     case NM_MEMBER_UPDATED:
00495     {
00496       //
00497       // We do not need to remember myself.
00498       //
00499       if (S_OK != pIMember->IsSelf())
00500       {
00501         //
00502         // Make sure the data conference is available now.
00503         //
00504         ULONG nCaps = 0;
00505         HRESULT hr = pIMember->GetNmchCaps(&nCaps);
00506         ASSERT(S_OK == hr);
00507
00508         if (nCaps & NMCH_DATA)
00509         {
00510           //
00511           // If we have not create the applet seesion, then
00512           // we need to remember these member pointers.
00513           //
00514           if (NULL != g_pSession)
00515           {
00516             //
00517             // Notify the session object of this member.
00518             //
00519             g_pSession->SetMember(pIMember);
00520           }
00521           else
00522           {
00523             //
00524             // Remember the member pointer. However, it is possible
00525             // the member already exists in the array. Need to check
00526             // for duplicate.
00527             //
00528             BOOL fFound = FALSE;
00529             for (ULONG i = 0; i < m_cIMembers; i++)
00530             {
00531               if (pIMember == m_apIMembers[m_cIMembers++])
00532               {
00533                 fFound = TRUE;
00534                 break;
00535               }
00536             }
00537             if (! fFound)
00538             {
00539               //
00540               // Remember this member...
00541               //
00542               pIMember->AddRef();
00543               m_apIMembers[m_cIMembers++] = pIMember;
00544             }
00545           }
00546         }
00547       }
00548       break;
00549     }
00550     case NM_MEMBER_REMOVED:
00551     {
00552       //
00553       // We do not need to remember myself.
00554       //
00555       if (S_OK != pIMember->IsSelf())
00556       {
00557         //
00558         // It is possible that the session is already gone.
00559         //
00560         if (NULL != g_pSession)
00561         {
00562           //
00563           // Notify the session object of this leaving member.
00564           //
00565           g_pSession->RemoveMember(pIMember);
00566         }
00567       }
00568       break;
00569     }
00570     default:
00571     {
00572       break;
00573     }
00574   }
00575
00576     return S_OK;
00577 }
00578
00579 HRESULT STDMETHODCALLTYPE
00580 CConfNotify::ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel)
00581 {
00582     return S_OK;
00583 }
00584
00585
00586 void CConfNotify::ReleaseIMemberArray(void)
00587 {
00588     //
00589     // Clean up the cached member array, which is created before
00590     // the session object is created.
00591     //
00592     for (ULONG i = 0; i < m_cIMembers; i++)
00593     {
00594         ASSERT(NULL != m_apIMembers[i]);
00595         m_apIMembers[i]->Release();
00596         m_apIMembers[i] = NULL;
00597     }
00598     m_cIMembers = 0;
00599 }
00600
00601
00602
00603
00604 //****************************************************************************
00605 //
00606 // CLASS CRefCount
00607 //
00608 //****************************************************************************
00609
00610
00611 //****************************************************************************
00612 //
00613 // Constructor
00614 //
00615 //****************************************************************************
00616
00617 CRefCount::CRefCount(void)
00618 {
00619     m_cRef = 1;
00620 }
00621
00622
00623 //****************************************************************************
00624 //
00625 // Destructor
00626 //
00627 //****************************************************************************
00628
00629 CRefCount::~CRefCount(void)
00630 {
00631 }
00632
00633
00634 //****************************************************************************
00635 //
00636 // Methods from IUnknown
00637 //
00638 //****************************************************************************
00639
00640 ULONG STDMETHODCALLTYPE
00641 CRefCount::AddRef(void)
00642 {
00643    ASSERT(m_cRef >= 0);
00644
00645    ::InterlockedIncrement(&m_cRef);
00646
00647    return (ULONG) m_cRef;
00648 }
00649
00650
00651 ULONG STDMETHODCALLTYPE
00652 CRefCount::Release(void)
00653 {
00654     if (0 == ::InterlockedDecrement(&m_cRef))
00655     {
00656         delete this;
00657         return 0;
00658     }
00659
00660     ASSERT(m_cRef > 0);
00661     return (ULONG) m_cRef;
00662 }
00663
00664
00665 //****************************************************************************
00666 //
00667 // CLASS CNotify
00668 //
00669 //****************************************************************************
00670
00671
00672 //****************************************************************************
00673 //
00674 // Constructor
00675 //
00676 //****************************************************************************
00677
00678 CNotify::CNotify()
00679 :
00680     m_pcnpcnt(NULL),
00681     m_pcnp(NULL),
00682     m_dwCookie(0),
00683     m_pUnk(NULL)
00684 {
00685 }
00686
00687
00688 //****************************************************************************
00689 //
00690 // Destructor
00691 //
00692 //****************************************************************************
00693
00694 CNotify::~CNotify()
00695 {
00696     Disconnect(); // Make sure we're disconnected
00697 }
00698
00699
00700 //****************************************************************************
00701 //
00702 // HRESULT CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN)
00703 //
00704 //****************************************************************************
00705
00706 HRESULT CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN)
00707 {
00708     if(NULL == pUnk || NULL == pUnkN)
00709   {
00710     return E_POINTER;
00711   }
00712
00713   ASSERT(0 == m_dwCookie);
00714   if(m_dwCookie != 0)
00715   {
00716     return HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED);
00717   }
00718
00719     //
00720     // Get the connection container
00721     //
00722     HRESULT hr = pUnk->QueryInterface(IID_IConnectionPointContainer,
00723                                       (void **)&m_pcnpcnt);
00724     if (SUCCEEDED(hr))
00725     {
00726         //
00727         // Find an appropriate connection point
00728         //
00729         hr = m_pcnpcnt->FindConnectionPoint(riid, &m_pcnp);
00730         if (SUCCEEDED(hr))
00731         {
00732             ASSERT(NULL != m_pcnp);
00733             //
00734             // Connect the sink object
00735             //
00736             hr = m_pcnp->Advise((IUnknown *)pUnkN, &m_dwCookie);
00737         }
00738     }
00739
00740     if (FAILED(hr))
00741     {
00742         m_dwCookie = 0;
00743     }
00744     else
00745     {
00746         //
00747         // Keep around for caller
00748         //
00749         m_pUnk = pUnk;
00750     }
00751
00752     return hr;
00753 }
00754
00755
00756 //****************************************************************************
00757 //
00758 // HRESULT CNotify::Disconnect (void)
00759 //
00760 //****************************************************************************
00761
00762 HRESULT CNotify::Disconnect (void)
00763 {
00764     if (0 != m_dwCookie)
00765     {
00766         //
00767         // Disconnect the sink object
00768         //
00769         m_pcnp->Unadvise(m_dwCookie);
00770         m_dwCookie = 0;
00771
00772         m_pcnp->Release();
00773         m_pcnp = NULL;
00774
00775         m_pcnpcnt->Release();
00776         m_pcnpcnt = NULL;
00777
00778         m_pUnk = NULL;
00779     }
00780
00781     return S_OK;
00782 }
00783
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/filerep.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

filerep.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     File Replication Client Utility
00006
00007     FILE: FileRep.cpp
00008
00009     USAGE:
00010         FileRep [server name] [remote file] [local file] <options...>
00011
00012     OPTIONS:
00013         -n network_address
00014         -p protocol_sequence
00015         -e endpoint
00016         -d print messages
00017
00018     PURPOSE: Client utility for the file replication application
00019
00020     FUNCTIONS: main() - binds to replication server and requests
00021         file replication.
00022
00023     COMMENTS:
00024 */
00025
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <process.h>
00029 #include <tchar.h>
00030 #include <rpc.h>
00031
00032 #include "common.h"
00033
00034 // header file generated by MIDL compiler
00035 #include "FileRepClient.h"
00036
00037 /*
00038     FUNCTION: PrintUsage()
00039
00040     PURPOSE: Prints help information.
00041
00042     PARAMETERS:
00043         ProgName - name of the executable
00044
00045     RETURN VALUE:
00046         none
00047
00048     COMMENTS:
00049 */
00050 void PrintUsage(TCHAR *ProgName) {
00051     _tprintf(TEXT("%s - File Replication Client Utility\n\n"), ProgName);
00052     _tprintf(TEXT("Usage: %s [server name] [remote file] [local file] <options...> \n\n"), ProgName);
00053     _tprintf(TEXT("Options:\n"));
00054     _tprintf(TEXT(" -p protocol_sequence\n"));
00055     _tprintf(TEXT(" -n network_address\n"));
00056     _tprintf(TEXT(" -e endpoint\n"));
00057     _tprintf(TEXT(" -d print messages\n"));
00058 }
00059
00060 /*
00061     FUNCTION: main()
00062
00063     PURPOSE: Main funciton for the utility.  It binds to the local server
00064         and requests file replication.
00065
00066     PARAMETERS:
00067         dwArgc - number of command line arguments
00068         lpszArgv - array of command line arguments
00069
00070     RETURN VALUE:
00071         none
00072
00073     COMMENTS:
00074
00075 */
00076 INT _cdecl main(int argc, char **argv) {
00077
00078     INT i;
00079     RPC_STATUS rpcstatus;
00080
00081     // Controlls printing out of messages.
00082     BOOL bDebug = FALSE;
00083
00084     // Explicit binding handle to the client system service.
00085     handle_t hFileRepClient = NULL;
00086
00087     // These are the default values for extablishing connections.
00088     // Default connection is to a local server over local rpc.
00089     LPTSTR pszProtocolSequence = TEXT("ncalrpc");
00090     LPTSTR pszNetworkAddress = NULL;
00091
00092     // An empty endpoint string is used, since we are going to
00093     // connect to the endpoint dynamically generated by the
00094     // RPC run-time library.  Server calls RpcServerUseProtseq to
00095     // obtain a binding hadnle and a dynamic endpoint.
00096     LPTSTR pszEndpoint = TEXT("");
00097
00098     LPTSTR pszUuid = NULL;
00099     LPTSTR pszOptions = NULL;
00100     LPTSTR pszStringBinding = NULL;
00101
00102     LPTSTR ServerName = NULL;
00103     LPTSTR RemoteFileName = NULL;
00104     LPTSTR LocalFileName = NULL;
00105
00106     INT nNumArgs;
00107
00108     // Get a common handle on the command line arguments for both
00109     // UNICODE and ASCII
00110 #ifdef _UNICODE
00111     LPWSTR *szArgList = CommandLineToArgvW(GetCommandLine(), &nNumArgs);
00112     if (NULL == szArgList) {
00113         _tprintf(TEXT("FileRep main: CommandLineToArgW failed"));
00114         exit(EXIT_FAILURE);
00115     }
00116 #else
00117     char **szArgList = argv;
00118     nNumArgs = argc;
00119 #endif
00120
00121     // Check that the correct number of arguments is given.
00122     if(nNumArgs<4){
00123         PrintUsage(szArgList[0]);
00124         exit(EXIT_FAILURE);
00125     }
00126
00127     // Extract the required arguments.
00128     ServerName = szArgList[1];
00129     RemoteFileName = szArgList[2];
00130     LocalFileName = szArgList[3];
00131
00132     // Allow the user to override settings with command line switches.
00133     for (i = 4; i < nNumArgs; i++) {
00134         // Well-formed argument switches start with '/' or '-' and are
00135         // two characters long.
00136         if (((*szArgList[i] == TEXT('-')) || (*szArgList[i] == TEXT('/'))) && _tcsclen(szArgList[i]) == 2) {
00137
00138             switch (_totlower(*(szArgList[i]+1))) {
00139
00140                 case TEXT('p'):
00141
00142               // Override protocol sequence.
00143
00144               // Check that the next argument exists and is not a
00145               // switch.
00146                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00147                   pszProtocolSequence = szArgList[++i];
00148                     }
00149               // Otherwise we have an empty protocol sequence.
00150               else {
00151             // We do not allow an empty protocol sequence.
00152             _tprintf(TEXT("Protocol sequence can't be \"\".\n"));
00153                         exit(EXIT_FAILURE);
00154               }
00155
00156         break;
00157
00158                 case TEXT('n'):
00159
00160         // Override the network address.
00161         if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00162       pszNetworkAddress = szArgList[++i];
00163         }
00164         else {
00165       pszNetworkAddress = TEXT("");
00166         }
00167
00168         break;
00169
00170           case TEXT('e'):
00171
00172         // Override the endpoint.
00173         if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00174       pszEndpoint = szArgList[++i];
00175         }
00176         else {
00177       pszEndpoint = TEXT("");
00178         }
00179
00180         break;
00181
00182                 case TEXT('d'):
00183         // Turn on debugging.
00184         bDebug = TRUE;
00185         break;
00186
00187                 case TEXT('h'):
00188                 case TEXT('?'):
00189                 default:
00190         PrintUsage(szArgList[0]);
00191         exit(EXIT_SUCCESS);
00192             }
00193         }
00194         else {
00195             PrintUsage(szArgList[0]);
00196             exit(EXIT_FAILURE);
00197         }
00198     }
00199
00200     // Concatenate the elements of
00201     // the string binding into the proper sequence.
00202     rpcstatus = RpcStringBindingCompose(pszUuid,
00203              pszProtocolSequence,
00204              pszNetworkAddress,
00205              pszEndpoint,
00206              pszOptions,
00207              &pszStringBinding);
00208     if(bDebug){
00209         _tprintf(TEXT("RpcStringBindingCompose returned 0x%x\n"), rpcstatus);
00210         _tprintf(TEXT("pszStringBinding = %s\n"), pszStringBinding);
00211     }
00212     EXIT_IF_FAIL(rpcstatus, "RpcStringBindingCompose");
00213
00214     // Set the binding handle that will be used to bind to the server.
00215     rpcstatus = RpcBindingFromStringBinding(pszStringBinding, &hFileRepClient);
00216     if(bDebug) _tprintf(TEXT("RpcBindingFromStringBinding returned 0x%x\n"), rpcstatus);
00217     EXIT_IF_FAIL(rpcstatus, "RpcBindingFromStringBinding");
00218
00219     // Free the binding string.
00220     rpcstatus = RpcStringFree(&pszStringBinding);
00221     ASSERTE(rpcstatus == RPC_S_OK);
00222
00223     // Make the RPC to request file replication.
00224     RpcTryExcept {
00225         if(bDebug) _tprintf(TEXT("Calling the remote procedure RequestFile(hFileRepClient, %s, %s, %s)\n"), ServerName, RemoteFileName, LocalFileName);
00226         RequestFile(hFileRepClient, ServerName, RemoteFileName, LocalFileName);
00227
00228         if(bDebug) _tprintf(TEXT("RequestFile() finished\n"));
00229     }
00230     // Return "non-fatal" errors.  Catching fatal errors
00231     // makes it harder to debug.
00232     RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00233       (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00234       (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00235       (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00236       (RpcExceptionCode() != STATUS_BREAKPOINT))
00237       ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00238
00239         _tprintf(TEXT("Exception: RequestFile failed with code %d\n"), GetExceptionCode());
00240         exit(EXIT_FAILURE);
00241     }
00242     RpcEndExcept;
00243
00244     // Free the binding.
00245     rpcstatus = RpcBindingFree((VOID **)&hFileRepClient);
00246     ASSERTE(rpcstatus == RPC_S_OK);
00247
00248     if(bDebug) _tprintf(TEXT("Success!\n"));
00249
00250     return(EXIT_SUCCESS);
00251
00252 } // end main()
00253
00254 /*
00255     MIDL allocate() and free()
00256 */
00257
00258 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
00259     return(AutoHeapAlloc(len));
00260 }
00261
00262 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
00263     if(ptr != NULL) {
00264         AutoHeapFree(ptr);
00265     }
00266 }
00267
00268 // end FileRep.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRecoOutputWnd Member List

This is the complete list of members for CRecoOutputWnd, including all inherited members.
AddString(COLORREF clr, BSTR bstr) | CRecoOutputWnd
Create(HWND hwndParent, UINT nID) | CRecoOutputWnd
CRecoOutputWnd() | CRecoOutputWnd
CRecoOutputWnd() | CRecoOutputWnd
GetBestHeight() | CRecoOutputWnd
m_bNewGesture | CRecoOutputWnd
m_bstrResults | CRecoOutputWnd
m_hFont | CRecoOutputWnd
m_hRichEdit | CRecoOutputWnd
m_iFontName | CRecoOutputWnd
m_iSelStart | CRecoOutputWnd
m_nGesture | CRecoOutputWnd
mc_iFontHeight enum value | CRecoOutputWnd
mc_iMarginX enum value | CRecoOutputWnd
mc_iMarginY enum value | CRecoOutputWnd
mc_iNumResults enum value | CRecoOutputWnd
OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CRecoOutputWnd
ResetResults() | CRecoOutputWnd
ResetResults() | CRecoOutputWnd
SetGestureName(UINT nGesture) | CRecoOutputWnd
UpdateFont(LANGID wLangId) | CRecoOutputWnd
UpdateString(BSTR bstr) | CRecoOutputWnd
~CRecoOutputWnd() | CRecoOutputWnd
~CRecoOutputWnd() | CRecoOutputWnd
Generated on Wed Nov 13 2024 16:57:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Connection.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Connection.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=00000514-0000-0010-8000-00AA006D2EA4,DynamicCasts)
00019     @com.interface(iid=00000550-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public class Connection implements IUnknown,com.ms.com.NoAutoScripting,msado15._Connection
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public native msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=0, type=PROPGET, name="ConnectionString", name2="getConnectionString", addFlagsVtable=4)
00027       @com.parameters([type=STRING] return) */
00028   public native String getConnectionString();
00029
00030   /** @com.method(vtoffset=6, dispid=0, type=PROPPUT, name="ConnectionString", name2="putConnectionString", addFlagsVtable=4)
00031       @com.parameters([in,type=STRING] pbstr) */
00032   public native void setConnectionString(String pbstr);
00033
00034   /** @com.method(vtoffset=7, dispid=2, type=PROPGET, name="CommandTimeout", name2="getCommandTimeout", addFlagsVtable=4)
00035       @com.parameters([type=I4] return) */
00036   public native int getCommandTimeout();
00037
00038   /** @com.method(vtoffset=8, dispid=2, type=PROPPUT, name="CommandTimeout", name2="putCommandTimeout", addFlagsVtable=4)
00039       @com.parameters([in,type=I4] plTimeout) */
00040   public native void setCommandTimeout(int plTimeout);
00041
00042   /** @com.method(vtoffset=9, dispid=3, type=PROPGET, name="ConnectionTimeout", name2="getConnectionTimeout", addFlagsVtable=4)
00043       @com.parameters([type=I4] return) */
00044   public native int getConnectionTimeout();
00045
00046   /** @com.method(vtoffset=10, dispid=3, type=PROPPUT, name="ConnectionTimeout", name2="putConnectionTimeout", addFlagsVtable=4)
00047       @com.parameters([in,type=I4] plTimeout) */
00048   public native void setConnectionTimeout(int plTimeout);
00049
00050   /** @com.method(vtoffset=11, dispid=4, type=PROPGET, name="Version", name2="getVersion", addFlagsVtable=4)
00051       @com.parameters([type=STRING] return) */
00052   public native String getVersion();
00053
00054   /** @com.method(vtoffset=12, dispid=5, type=METHOD, name="Close", addFlagsVtable=4)
00055       @com.parameters() */
00056   public native void Close();
00057
00058   /** @com.method(vtoffset=13, dispid=6, type=METHOD, name="Execute", addFlagsVtable=4)
00059       @com.parameters([in,type=STRING] CommandText, [out,elementType=VARIANT,type=PTR] RecordsAffected, [in,type=I4] Options, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00060   public native msado15._Recordset Execute(String CommandText, Variant RecordsAffected, int Options);
00061
00062   /** @com.method(vtoffset=14, dispid=7, type=METHOD, name="BeginTrans", addFlagsVtable=4)
00063       @com.parameters([type=I4] return) */
00064   public native int BeginTrans();
00065
00066   /** @com.method(vtoffset=15, dispid=8, type=METHOD, name="CommitTrans", addFlagsVtable=4)
00067       @com.parameters() */
00068   public native void CommitTrans();
00069
00070   /** @com.method(vtoffset=16, dispid=9, type=METHOD, name="RollbackTrans", addFlagsVtable=4)
00071       @com.parameters() */
00072   public native void RollbackTrans();
00073
00074   /** @com.method(vtoffset=17, dispid=10, type=METHOD, name="Open", addFlagsVtable=4)
00075       @com.parameters([in,type=STRING] ConnectionString, [in,type=STRING] UserID, [in,type=STRING] Password, [in,type=I4] Options) */
00076   public native void Open(String ConnectionString, String UserID, String Password, int Options);
00077
00078   /** @com.method(vtoffset=18, dispid=11, type=PROPGET, name="Errors", name2="getErrors", addFlagsVtable=4)
00079       @com.parameters([iid=00000501-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00080   public native msado15.Errors getErrors();
00081
00082   /** @com.method(vtoffset=19, dispid=12, type=PROPGET, name="DefaultDatabase", name2="getDefaultDatabase", addFlagsVtable=4)
00083       @com.parameters([type=STRING] return) */
00084   public native String getDefaultDatabase();
00085
00086   /** @com.method(vtoffset=20, dispid=12, type=PROPPUT, name="DefaultDatabase", name2="putDefaultDatabase", addFlagsVtable=4)
00087       @com.parameters([in,type=STRING] pbstr) */
00088   public native void setDefaultDatabase(String pbstr);
00089
00090   /** @com.method(vtoffset=21, dispid=13, type=PROPGET, name="IsolationLevel", name2="getIsolationLevel", addFlagsVtable=4)
00091       @com.parameters([type=I4] return) */
00092   public native int getIsolationLevel();
00093
00094   /** @com.method(vtoffset=22, dispid=13, type=PROPPUT, name="IsolationLevel", name2="putIsolationLevel", addFlagsVtable=4)
00095       @com.parameters([in,type=I4] Level) */
00096   public native void setIsolationLevel(int Level);
00097
00098   /** @com.method(vtoffset=23, dispid=14, type=PROPGET, name="Attributes", name2="getAttributes", addFlagsVtable=4)
00099       @com.parameters([type=I4] return) */
00100   public native int getAttributes();
00101
00102   /** @com.method(vtoffset=24, dispid=14, type=PROPPUT, name="Attributes", name2="putAttributes", addFlagsVtable=4)
00103       @com.parameters([in,type=I4] plAttr) */
00104   public native void setAttributes(int plAttr);
00105
00106   /** @com.method(vtoffset=25, dispid=15, type=PROPGET, name="CursorLocation", name2="getCursorLocation", addFlagsVtable=4)
00107       @com.parameters([type=I4] return) */
00108   public native int getCursorLocation();
00109
00110   /** @com.method(vtoffset=26, dispid=15, type=PROPPUT, name="CursorLocation", name2="putCursorLocation", addFlagsVtable=4)
00111       @com.parameters([in,type=I4] plCursorLoc) */
00112   public native void setCursorLocation(int plCursorLoc);
00113
00114   /** @com.method(vtoffset=27, dispid=16, type=PROPGET, name="Mode", name2="getMode", addFlagsVtable=4)
00115       @com.parameters([type=I4] return) */
00116   public native int getMode();
00117
00118   /** @com.method(vtoffset=28, dispid=16, type=PROPPUT, name="Mode", name2="putMode", addFlagsVtable=4)
00119       @com.parameters([in,type=I4] plMode) */
00120   public native void setMode(int plMode);
00121
00122   /** @com.method(vtoffset=29, dispid=17, type=PROPGET, name="Provider", name2="getProvider", addFlagsVtable=4)
00123       @com.parameters([type=STRING] return) */
00124   public native String getProvider();
00125
00126   /** @com.method(vtoffset=30, dispid=17, type=PROPPUT, name="Provider", name2="putProvider", addFlagsVtable=4)
00127       @com.parameters([in,type=STRING] pbstr) */
00128   public native void setProvider(String pbstr);
00129
00130   /** @com.method(vtoffset=31, dispid=18, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00131       @com.parameters([type=I4] return) */
00132   public native int getState();
00133
00134   /** @com.method(vtoffset=32, dispid=19, type=METHOD, name="OpenSchema", addFlagsVtable=4)
00135       @com.parameters([in,type=I4] Schema, [in,type=VARIANT] Restrictions, [in,type=VARIANT] SchemaID, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00136   public native msado15._Recordset OpenSchema(int Schema, Variant Restrictions, Variant SchemaID);
00137
00138   /** @com.method(vtoffset=33, dispid=21, type=METHOD, name="Cancel", addFlagsVtable=4)
00139       @com.parameters() */
00140   public native void Cancel();
00141
00142
00143   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x550, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00144
00145   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0x514, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00146 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/llistimpl.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

llistimpl.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //  This is a part of the MMC SDK.
00003 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the MMC SDK
00007 //  Reference and related electronic documentation provided with the
00008 //  library. See these sources for detailed information regarding the
00009 //  MMC Library product.
00010 //
00011 //  LListImple.h:  Definition and implementation of CLListImpl.  This is a
00012 //                 generic linked list class which emulates CList from MFC.
00013 //
00014
00015
00016 #ifndef __CLASS_CLLISTIMPL__
00017 #define __CLASS_CLLISTIMPL__
00018
00019 #if _MSC_VER > 1000
00020 #pragma once
00021 #endif // _MSC_VER > 1000
00022
00023 #include <CrtDbg.h>
00024 #include <Windows.h>
00025 #include <new.h>
00026
00027
00028 // Abstract iteration position
00029 struct  __POSITION { };
00030 typedef __POSITION*  POSITION;
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 //  CPlex stuff for allocating nodes
00034 //
00035
00036 //---------------------------------------------------------------------------
00037 struct CPlex     // warning variable length structure
00038 {
00039   CPlex* pNext;
00040 //#if (_AFX_PACKING >= 8)
00041   DWORD dwReserved[1];    // align on 8 byte boundary
00042 //#endif
00043
00044   // BYTE data[maxNum*elementSize];
00045
00046   void* data() { return this+1; }
00047
00048   static CPlex* PASCAL Create(CPlex*& head, UINT nMax, UINT cbElement);
00049       // like 'calloc' but no zero fill
00050       // may throw memory exceptions
00051
00052   void FreeDataChain();       // free this one and links
00053 };
00054
00055
00056 /////////////////////////////////////////////////////////////////////////////
00057 //  Helpers
00058 //
00059
00060 BOOL IsValidAddress( const void*  lp, UINT nBytes, BOOL bReadWrite = TRUE );
00061
00062
00063 /////////////////////////////////////////////////////////////////////////////
00064 // CLListImpl<TYPE, ARG_TYPE>
00065
00066 template<class TYPE, class ARG_TYPE>
00067 class CLListImpl
00068 {
00069   public:
00070     CLListImpl( int nBlockSize = 10 );
00071     ~CLListImpl();
00072
00073   protected:
00074     struct CNode
00075     {
00076       CNode* pNext;
00077       CNode* pPrev;
00078       TYPE   data;
00079     };
00080
00081   public:
00082                                          // Attributes (head and tail)
00083    int       GetCount() const;
00084    BOOL      IsEmpty() const;
00085
00086    TYPE&     GetHead();                  // Peek at head and tail
00087    TYPE      GetHead() const;
00088    TYPE&     GetTail();
00089    TYPE      GetTail() const;
00090                                          // Operations
00091    TYPE      RemoveHead();
00092    TYPE      RemoveTail();
00093                                          // Add before head or after tail
00094    POSITION  AddHead( ARG_TYPE NewElement );
00095    POSITION  AddTail( ARG_TYPE NewElement );
00096
00097    void      AddHead(CLListImpl* pNewList);  // Add another list
00098    void      AddTail(CLListImpl* pNewList);
00099
00100    void      RemoveAll();                // Remove all elements
00101
00102    POSITION  GetHeadPosition() const;
00103    POSITION  GetTailPosition() const;
00104    TYPE&     GetNext(POSITION& rPosition);       // return *Position++
00105    TYPE      GetNext(POSITION& rPosition) const; // return *Position++
00106    TYPE&     GetPrev(POSITION& rPosition);       // return *Position--
00107    TYPE      GetPrev(POSITION& rPosition) const; // return *Position--
00108
00109    // Getting/modifying an element at a given position
00110    TYPE&     GetAt(POSITION Position);
00111    TYPE      GetAt(POSITION Position) const;
00112    void      SetAt(POSITION Pos, ARG_TYPE NewElement);
00113    void      RemoveAt(POSITION Position);
00114
00115    // inserting before or after a given position
00116    POSITION InsertBefore(POSITION position, ARG_TYPE newElement);
00117    POSITION InsertAfter(POSITION position, ARG_TYPE newElement);
00118
00119    // Helper functions (note: O(n) speed)
00120
00121    // Defaults to starting at the HEAD, return NULL if not found
00122    POSITION Find(ARG_TYPE SearchValue, POSITION StartAfter = NULL) const;
00123
00124    // Get the 'nIndex'th element (may return NULL)
00125    POSITION FindIndex(int nIndex) const;
00126
00127   // Implementation
00128   protected:
00129     CNode*   m_pNodeHead;
00130     CNode*   m_pNodeTail;
00131     int      m_nCount;
00132     CNode*   m_pNodeFree;
00133     struct   CPlex* m_pBlocks;
00134     int m_nBlockSize;
00135
00136     CNode*   NewNode(CNode*, CNode*);
00137     void     FreeNode(CNode*);
00138
00139 #ifdef _DEBUG
00140
00141   void AssertValid() const;
00142
00143 #endif //_DEBUG
00144
00145 }; //end class CLListImpl
00146
00147 /////////////////////////////////////////////////////////////////////////////
00148 // CLListImpl<TYPE, ARG_TYPE> inline functions
00149
00150 template<class TYPE, class ARG_TYPE>
00151 inline int CLListImpl<TYPE, ARG_TYPE>::GetCount() const
00152   { return m_nCount; }
00153
00154 template<class TYPE, class ARG_TYPE>
00155 inline BOOL CLListImpl<TYPE, ARG_TYPE>::IsEmpty() const
00156   { return m_nCount == 0; }
00157
00158 template<class TYPE, class ARG_TYPE>
00159 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetHead()
00160   {
00161     _ASSERT( NULL != m_pNodeHead );
00162     return m_pNodeHead->data;
00163   }
00164
00165 template<class TYPE, class ARG_TYPE>
00166 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetHead() const
00167   {
00168     _ASSERT( NULL != m_pNodeHead );
00169     return m_pNodeHead->data;
00170   }
00171
00172 template<class TYPE, class ARG_TYPE>
00173 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetTail()
00174   {
00175     _ASSERT( NULL != m_pNodeTail );
00176     return m_pNodeTail->data;
00177   }
00178
00179 template<class TYPE, class ARG_TYPE>
00180 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetTail() const
00181   {
00182     _ASSERT( NULL != m_pNodeTail );
00183     return m_pNodeTail->data;
00184   }
00185
00186 template<class TYPE, class ARG_TYPE>
00187 inline POSITION CLListImpl<TYPE, ARG_TYPE>::GetHeadPosition() const
00188   { return (POSITION)m_pNodeHead; }
00189
00190 template<class TYPE, class ARG_TYPE>
00191 inline POSITION CLListImpl<TYPE, ARG_TYPE>::GetTailPosition() const
00192   { return (POSITION)m_pNodeTail; }
00193
00194 template<class TYPE, class ARG_TYPE>
00195 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetNext(POSITION& rPosition) // return *Position++
00196   {
00197     CNode* pNode = (CNode*) rPosition;
00198     _ASSERT(IsValidAddress(pNode, sizeof(CNode)));
00199     rPosition = (POSITION) pNode->pNext;
00200     return pNode->data;
00201   }
00202
00203 template<class TYPE, class ARG_TYPE>
00204 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetNext(POSITION& rPosition) const // return *Position++
00205   {
00206     CNode* pNode = (CNode*) rPosition;
00207     _ASSERT(IsValidAddress(pNode, sizeof(CNode)));
00208     rPosition = (POSITION) pNode->pNext;
00209     return pNode->data;
00210   }
00211
00212 template<class TYPE, class ARG_TYPE>
00213 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetPrev(POSITION& rPosition) // return *Position--
00214   {
00215     CNode* pNode = (CNode*) rPosition;
00216     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00217     rPosition = (POSITION) pNode->pPrev;
00218     return pNode->data;
00219   }
00220
00221 template<class TYPE, class ARG_TYPE>
00222 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetPrev(POSITION& rPosition) const // return *Position--
00223   {
00224     CNode* pNode = (CNode*) rPosition;
00225     ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00226     rPosition = (POSITION) pNode->pPrev;
00227     return pNode->data;
00228   }
00229
00230 template<class TYPE, class ARG_TYPE>
00231 inline TYPE& CLListImpl<TYPE, ARG_TYPE>::GetAt(POSITION Position)
00232   {
00233     CNode* pNode = (CNode*)Position;
00234     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00235     return pNode->data;
00236   }
00237
00238 template<class TYPE, class ARG_TYPE>
00239 inline TYPE CLListImpl<TYPE, ARG_TYPE>::GetAt(POSITION Position) const
00240   {
00241     CNode* pNode = (CNode*) Position;
00242     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00243     return pNode->data;
00244   }
00245
00246 template<class TYPE, class ARG_TYPE>
00247 inline void CLListImpl<TYPE, ARG_TYPE>::SetAt(POSITION Pos, ARG_TYPE NewElement)
00248   {
00249     CNode* pNode = (CNode*)Pos;
00250     _ASSERT( IsValidAddress(pNode, sizeof(CNode)) );
00251     pNode->data = newElement;
00252   }
00253
00254
00255 template<class TYPE, class ARG_TYPE>
00256 CLListImpl<TYPE, ARG_TYPE>::CLListImpl( int nBlockSize )
00257 {
00258   _ASSERT( nBlockSize > 0 );
00259
00260   m_nCount     = 0;
00261   m_pNodeHead  = m_pNodeTail = m_pNodeFree = NULL;
00262   m_pBlocks    = NULL;
00263   m_nBlockSize = nBlockSize;
00264 }
00265
00266 template<class TYPE, class ARG_TYPE>
00267 void CLListImpl<TYPE, ARG_TYPE>::RemoveAll()
00268 {
00269   // destroy elements
00270   CNode* pNode;
00271   for( pNode = m_pNodeHead; pNode != NULL; pNode = pNode->pNext )
00272     (pNode->data).~TYPE();
00273
00274   m_nCount = 0;
00275   m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL;
00276   m_pBlocks->FreeDataChain();
00277   m_pBlocks = NULL;
00278 }
00279
00280 template<class TYPE, class ARG_TYPE>
00281 CLListImpl<TYPE, ARG_TYPE>::~CLListImpl()
00282 {
00283   RemoveAll();
00284   _ASSERT(m_nCount == 0);
00285 }
00286
00287
00288 /////////////////////////////////////////////////////////////////////////////
00289 // Node helpers
00290 //
00291 //  Implementation note: CNode's are stored in CPlex blocks and
00292 //  chained together. Free blocks are maintained in a singly linked list
00293 //  using the 'pNext' member of CNode with 'm_pNodeFree' as the head.
00294 //  Used blocks are maintained in a doubly linked list using both 'pNext'
00295 //  and 'pPrev' as links and 'm_pNodeHead' and 'm_pNodeTail'
00296 //  as the head/tail.
00297 //
00298 //  We never free a CPlex block unless the List is destroyed or RemoveAll()
00299 //  is used - so the total number of CPlex blocks may grow large depending
00300 //  on the maximum past size of the list.
00301 //
00302
00303
00304 template<class TYPE, class ARG_TYPE>
00305 CLListImpl<TYPE, ARG_TYPE>::CNode*
00306 CLListImpl<TYPE, ARG_TYPE>::NewNode(CLListImpl::CNode* pPrev, CLListImpl::CNode* pNext)
00307 {
00308   if( NULL == m_pNodeFree )
00309   {
00310     // add another block
00311     CPlex* pNewBlock = CPlex::Create( m_pBlocks, m_nBlockSize, sizeof(CNode) );
00312
00313     // chain them into free list
00314     CNode* pNode = (CNode*) pNewBlock->data();
00315     // free in reverse order to make it easier to debug
00316     pNode += m_nBlockSize - 1;
00317     for( int i = m_nBlockSize-1; i >= 0; i--, pNode-- )
00318     {
00319       pNode->pNext = m_pNodeFree;
00320       m_pNodeFree = pNode;
00321     }
00322   }
00323   _ASSERT( NULL != m_pNodeFree );  // we must have something
00324
00325   CLListImpl::CNode* pNode = m_pNodeFree;
00326   m_pNodeFree = m_pNodeFree->pNext;
00327   pNode->pPrev = pPrev;
00328   pNode->pNext = pNext;
00329   m_nCount++;
00330   _ASSERT(m_nCount > 0);  // make sure we don't overflow
00331
00332   new (&pNode->data) TYPE; // Placement new
00333
00334   return pNode;
00335 }
00336
00337
00338 template<class TYPE, class ARG_TYPE>
00339 void CLListImpl<TYPE, ARG_TYPE>::FreeNode(CLListImpl::CNode* pNode)
00340 {
00341   (pNode->data).~TYPE();
00342   pNode->pNext = m_pNodeFree;
00343   m_pNodeFree = pNode;
00344   m_nCount--;
00345   _ASSERT(m_nCount >= 0);  // make sure we don't underflow
00346
00347   // if no more elements, cleanup completely
00348   if( 0 == m_nCount )
00349     RemoveAll();
00350 }
00351
00352 template<class TYPE, class ARG_TYPE>
00353 POSITION CLListImpl<TYPE, ARG_TYPE>::AddHead( ARG_TYPE NewElement )
00354 {
00355   _ASSERT( NULL != NewElement );
00356
00357   CNode* pNewNode = NewNode( NULL, m_pNodeHead );
00358   pNewNode->data = NewElement;
00359   if( NULL != m_pNodeHead )
00360     m_pNodeHead->pPrev = pNewNode;
00361   else
00362     m_pNodeTail = pNewNode;
00363
00364   m_pNodeHead = pNewNode;
00365   return (POSITION)pNewNode;
00366 }
00367
00368
00369 template<class TYPE, class ARG_TYPE>
00370 POSITION CLListImpl<TYPE, ARG_TYPE>::AddTail(ARG_TYPE NewElement)
00371 {
00372   _ASSERT( NULL != NewElement );
00373
00374   CNode* pNewNode = NewNode( m_pNodeTail, NULL );
00375   pNewNode->data = NewElement;
00376   if( NULL != m_pNodeTail )
00377     m_pNodeTail->pNext = pNewNode;
00378   else
00379     m_pNodeHead = pNewNode;
00380
00381   m_pNodeTail = pNewNode;
00382   return (POSITION)pNewNode;
00383 }
00384
00385
00386 template<class TYPE, class ARG_TYPE>
00387 void CLListImpl<TYPE, ARG_TYPE>::AddHead( CLListImpl* pNewList )
00388 {
00389   _ASSERT( NULL != pNewList );
00390
00391   // Add a list of same elements to head (maintain order)
00392   POSITION Pos = pNewList->GetTailPosition();
00393   while( NULL != Pos )
00394     AddHead(pNewList->GetPrev( Pos ));
00395 }
00396
00397
00398 template<class TYPE, class ARG_TYPE>
00399 void CLListImpl<TYPE, ARG_TYPE>::AddTail(CLListImpl* pNewList)
00400 {
00401   _ASSERT( NULL != pNewList );
00402
00403   // Add a list of same elements
00404   POSITION Pos = pNewList->GetHeadPosition();
00405   while( NULL != Pos )
00406     AddTail(pNewList->GetNext( Pos ));
00407 }
00408
00409
00410 template<class TYPE, class ARG_TYPE>
00411 TYPE CLListImpl<TYPE, ARG_TYPE>::RemoveHead()
00412 {
00413   _ASSERT( NULL != m_pNodeHead );  // don't call on empty list !!!
00414   _ASSERT( IsValidAddress( m_pNodeHead, sizeof(CNode)) );
00415
00416   CNode* pOldNode = m_pNodeHead;
00417   TYPE returnValue = pOldNode->data;
00418
00419   m_pNodeHead = pOldNode->pNext;
00420   if( NULL != m_pNodeHead )
00421     m_pNodeHead->pPrev = NULL;
00422   else
00423     m_pNodeTail = NULL;
00424
00425   FreeNode(pOldNode);
00426   return returnValue;
00427 }
00428
00429
00430 template<class TYPE, class ARG_TYPE>
00431 TYPE CLListImpl<TYPE, ARG_TYPE>::RemoveTail()
00432 {
00433   _ASSERT( NULL != m_pNodeTail );  // don't call on empty list !!!
00434   _ASSERT( IsValidAddress( m_pNodeTail, sizeof(CNode)) );
00435
00436   CNode* pOldNode = m_pNodeTail;
00437   TYPE returnValue = pOldNode->data;
00438
00439   m_pNodeTail = pOldNode->pPrev;
00440   if( NULL != m_pNodeTail )
00441     m_pNodeTail->pNext = NULL;
00442   else
00443     m_pNodeHead = NULL;
00444
00445   FreeNode(pOldNode);
00446   return returnValue;
00447 }
00448
00449
00450 template<class TYPE, class ARG_TYPE>
00451 POSITION CLListImpl<TYPE, ARG_TYPE>::InsertBefore(POSITION Position, ARG_TYPE NewElement)
00452 {
00453   _ASSERT( NULL != NewElement );
00454
00455   if( NULL == Position )
00456     return AddHead( NewElement ); // insert before nothing -> head of the list
00457
00458   // Insert it before position
00459   CNode* pOldNode = (CNode*)Position;
00460   CNode* pNewNode = NewNode( pOldNode->pPrev, pOldNode );
00461   pNewNode->data  = NewElement;
00462
00463   if( NULL != pOldNode->pPrev )
00464   {
00465     _ASSERT( IsValidAddress( pOldNode->pPrev, sizeof(CNode)) );
00466     pOldNode->pPrev->pNext = pNewNode;
00467   }
00468   else
00469   {
00470     _ASSERT( pOldNode == m_pNodeHead );
00471     m_pNodeHead = pNewNode;
00472   }
00473   pOldNode->pPrev = pNewNode;
00474   return (POSITION)pNewNode;
00475 }
00476
00477
00478 template<class TYPE, class ARG_TYPE>
00479 POSITION CLListImpl<TYPE, ARG_TYPE>::InsertAfter(POSITION Position, ARG_TYPE NewElement)
00480 {
00481   ASSERT( NULL != NewElement );
00482
00483   if( NULL == Position )
00484     return AddTail( NewElement ); // insert after nothing -> tail of the list
00485
00486   // Insert it before position
00487   CNode* pOldNode = (CNode*)Position;
00488   _ASSERT( IsValidAddress( pOldNode, sizeof(CNode) ) );
00489   CNode* pNewNode = NewNode( pOldNode, pOldNode->pNext );
00490   pNewNode->data = NewElement;
00491
00492   if( NULL != pOldNode->pNext )
00493   {
00494     _ASSERT( IsValidAddress( pOldNode->pNext, sizeof(CNode)) );
00495     pOldNode->pNext->pPrev = pNewNode;
00496   }
00497   else
00498   {
00499     _ASSERT( pOldNode == m_pNodeTail );
00500     m_pNodeTail = pNewNode;
00501   }
00502   pOldNode->pNext = pNewNode;
00503   return (POSITION)pNewNode;
00504 }
00505
00506
00507 template<class TYPE, class ARG_TYPE>
00508 void CLListImpl<TYPE, ARG_TYPE>::RemoveAt( POSITION Position )
00509 {
00510   _ASSERT( NULL != Position );
00511
00512   CNode* pOldNode = (CNode*)Position;
00513   _ASSERT( IsValidAddress( pOldNode, sizeof(CNode)) );
00514
00515   // Remove pOldNode from list
00516   if( pOldNode == m_pNodeHead )
00517   {
00518     m_pNodeHead = pOldNode->pNext;
00519   }
00520   else
00521   {
00522     _ASSERT( IsValidAddress( pOldNode->pPrev, sizeof(CNode)) );
00523     pOldNode->pPrev->pNext = pOldNode->pNext;
00524   }
00525   if( pOldNode == m_pNodeTail )
00526   {
00527     m_pNodeTail = pOldNode->pPrev;
00528   }
00529   else
00530   {
00531     _ASSERT( IsValidAddress( pOldNode->pNext, sizeof(CNode)) );
00532     pOldNode->pNext->pPrev = pOldNode->pPrev;
00533   }
00534   FreeNode( pOldNode );
00535 }
00536
00537
00538 template<class TYPE, class ARG_TYPE>
00539 POSITION CLListImpl<TYPE, ARG_TYPE>::FindIndex(int nIndex) const
00540 {
00541   if( nIndex >= m_nCount || nIndex < 0 )
00542     return NULL;  // went too far
00543
00544   CNode* pNode = m_pNodeHead;
00545   while (nIndex--)
00546   {
00547     _ASSERT( IsValidAddress( pNode, sizeof(CNode)) );
00548     pNode = pNode->pNext;
00549   }
00550   return (POSITION)pNode;
00551 }
00552
00553
00554 template<class TYPE, class ARG_TYPE>
00555 POSITION CLListImpl<TYPE, ARG_TYPE>::Find(ARG_TYPE SearchValue, POSITION StartAfter) const
00556 {
00557   _ASSERT( NULL != SearchValue );
00558
00559   CNode* pNode = (CNode*)StartAfter;
00560   if( NULL == pNode )
00561   {
00562     pNode = m_pNodeHead;  // start at head
00563   }
00564   else
00565   {
00566     _ASSERT( IsValidAddress( pNode, sizeof(CNode)) );
00567     pNode = pNode->pNext;  // start after the one specified
00568   }
00569
00570   for (; pNode != NULL; pNode = pNode->pNext)
00571     if (CompareElements<TYPE>(&pNode->data, &searchValue))
00572       return (POSITION)pNode;
00573
00574   return NULL;
00575 }
00576
00577 #ifdef _DEBUG
00578
00579 template<class TYPE, class ARG_TYPE>
00580 void CLListImpl<TYPE, ARG_TYPE>::AssertValid() const
00581 {
00582   if( 0 == m_nCount )
00583   {
00584     // empty list
00585     _ASSERT( NULL == m_pNodeHead );
00586     _ASSERT( NULL == m_pNodeTail );
00587   }
00588   else
00589   {
00590     // non-empty list
00591     _ASSERT( IsValidAddress(m_pNodeHead, sizeof(CNode)) );
00592     _ASSERT( IsValidAddress(m_pNodeTail, sizeof(CNode)) );
00593   }
00594 }
00595 #endif //_DEBUG
00596
00597 #endif //__CLASS_CLLISTIMPL__
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerDraw/PerDraw.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerDraw

PerDraw.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PERDRAW.CPP
00003
00004   Summary:   Main implementation file for a DLL COM Component server
00005              providing the DrawPage COM Component. Access to Class
00006              Factories is provided in this module.  This module also
00007              supports self registration and unregistration for the
00008              components housed in the server.
00009
00010              For a comprehensive tutorial code tour of PERDRAW's contents
00011              and offerings see the tutorial PERDRAW.HTM file. For more
00012              specific technical details on the internal workings see the
00013              comments dispersed throughout the PERDRAW source code. For
00014              more details on how the PERDRAW server works with the
00015              PERCLIEN client see PERCLIEN.HTM in the main tutorial
00016              directory.
00017
00018   Classes:   none.
00019
00020   Functions: DllMain, DllGetClassObject, DllCanUnloadNow, DllRegisterServer,
00021              DllUnregisterServer.
00022
00023   Origin:    5-20-97: atrent - Editor-inheritance from STOSERVE.CPP in
00024                the STOSERVE Tutorial Code Sample.
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 /*---------------------------------------------------------------------------
00042   We include WINDOWS.H for all Win32 applications.
00043   We include OLE2.H because we will be calling the COM/OLE Libraries.
00044   We include INITGUID.H only once (here) in the entire DLL because we
00045     will be defining GUIDs and want them as constants in the data segment.
00046   We include APPUTIL.H because we will be building this DLL using
00047     the convenient Virtual Window and Dialog classes and other
00048     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00049   We include IPAGES.H and PAGEGUID.H for the common DrawPage-related
00050     Interface class, GUID, and CLSID specifications.
00051   We include PERDRAW.H because it has the _DLLEXPORT_ controlled import
00052     and export specifications.
00053   We include SERVER.H because it has internal class declarations for
00054     the server's control object.
00055   We include FACTORY.H because it has the necessary internal class factory
00056     declarations for this DLL component server.
00057 ---------------------------------------------------------------------------*/
00058 #include <windows.h>
00059 #include <ole2.h>
00060 #include <initguid.h>
00061 #include <apputil.h>
00062 #include <ipages.h>
00063 #include <pageguid.h>
00064 #define _DLLEXPORT_
00065 #include "perdraw.h"
00066 #include "server.h"
00067 #include "factory.h"
00068
00069
00070 // Global variable definitions. Some Initialized in DllMain() below.
00071
00072 // We encapsulate the control of this COM server (eg, lock and object
00073 // counting) in a server control C++ object. Here is it's global pointer.
00074 CServer* g_pServer = NULL;
00075
00076
00077 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00078   Function: UnicodeOk
00079
00080   Summary:  Checks if the platform will handle unicode versions of
00081             Win32 string API calls.
00082
00083   Args:     void
00084
00085   Returns:  BOOL
00086               TRUE if unicode support; FALSE if not.
00087 ------------------------------------------------------------------------F-F*/
00088 BOOL UnicodeOk(void)
00089 {
00090   BOOL bOk = TRUE;
00091   TCHAR szUserName[MAX_STRING_LENGTH];
00092   DWORD dwSize = MAX_STRING_LENGTH;
00093
00094   if (!GetUserName(szUserName, &dwSize))
00095     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00096
00097   return bOk;
00098 }
00099
00100
00101 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00102   Function: DllMain
00103
00104   Summary:  Just as WinMain is for an EXE application, this DllMain
00105             function is the main entry point for this DLL.  It is called
00106             when the DLL is loaded by a process, and when new threads are
00107             created by a process that has already loaded this DLL.
00108             DllMain is also called when threads of a process that has
00109             loaded the DLL exit cleanly and when the process itself
00110             unloads the DLL.
00111
00112             If you want to use C runtime libraries, keep this function
00113             named "DllMain" and you won't have to do anything special to
00114             initialize the runtime libraries.
00115
00116             When fdwReason == DLL_PROCESS_ATTACH, the return value is used
00117             to determine if the DLL should remain loaded, or should be
00118             immediately unloaded depending upon whether the DLL could be
00119             initialized properly.  For all other values of fdwReason, the
00120             return value is ignored.
00121
00122   Args:     HINSTANCE hDLLInst,
00123               Instance handle of the DLL.
00124             DWORD fdwReason,
00125               Process attach/detach or thread attach/detach.
00126               Reason for calling.
00127             LPVOID lpvReserved)
00128               Reserved and not used.
00129
00130   Returns:  BOOL,
00131               Return value is used only when fdwReason == DLL_PROCESS_ATTACH.
00132               TRUE  -  Used to signify that the DLL should remain loaded.
00133               FALSE -  Used to signify that the DLL should be
00134                 immediately unloaded.
00135 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00136 BOOL WINAPI DllMain(
00137               HINSTANCE hDllInst,
00138               DWORD fdwReason,
00139               LPVOID lpvReserved)
00140 {
00141   BOOL bResult = TRUE;
00142
00143   // Dispatch this main call based on the reason it was called.
00144   switch (fdwReason)
00145   {
00146     case DLL_PROCESS_ATTACH:
00147       // The DLL is being loaded for the first time by a given process.
00148       // Perform per-process initialization here.  If the initialization
00149       // is successful, return TRUE; if unsuccessful, return FALSE.
00150       bResult = FALSE;
00151       if (UnicodeOk())
00152       {
00153         // Instantiate the CServer utility class.
00154         g_pServer = new CServer;
00155         if (NULL != g_pServer)
00156         {
00157           // Remember the DLL Instance handle.
00158           g_pServer->m_hDllInst = hDllInst;
00159           bResult = TRUE;
00160         }
00161       }
00162       break;
00163
00164     case DLL_PROCESS_DETACH:
00165       // The DLL is being unloaded by a given process.  Do any
00166       // per-process clean up here, such as undoing what was done in
00167       // DLL_PROCESS_ATTACH.  The return value is ignored.
00168       DELETE_POINTER(g_pServer);
00169       break;
00170
00171     case DLL_THREAD_ATTACH:
00172       // A thread is being created in a process that has already loaded
00173       // this DLL.  Perform any per-thread initialization here.  The
00174       // return value is ignored.
00175       break;
00176
00177     case DLL_THREAD_DETACH:
00178       // A thread is exiting cleanly in a process that has already
00179       // loaded this DLL.  Perform any per-thread clean up here.  The
00180       // return value is ignored.
00181       break;
00182
00183     default:
00184       break;
00185   }
00186
00187   return (bResult);
00188 }
00189
00190
00191 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00192   Function: DllGetClassObject
00193
00194   Summary:  The standard exported function that the COM service library
00195             uses to obtain an object class of the class factory for a
00196             specified component provided by this server DLL.
00197
00198   Args:     REFCLSID rclsid,
00199               [in] The CLSID of the requested Component.
00200             REFIID riid,
00201               [in] GUID of the requested interface on the Class Factory.
00202             PPVOID ppv)
00203               [out] Address of the caller's pointer variable that will
00204               receive the requested interface pointer.
00205
00206   Returns:  HRESULT
00207               E_FAIL if requested component isn't supported.
00208               E_OUTOFMEMORY if out of memory.
00209               Error code out of the QueryInterface.
00210 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00211 STDAPI DllGetClassObject(
00212          REFCLSID rclsid,
00213          REFIID riid,
00214          PPVOID ppv)
00215 {
00216   HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
00217   IUnknown* pCO = NULL;
00218
00219   if (CLSID_DrawPage == rclsid)
00220   {
00221     hr = E_OUTOFMEMORY;
00222     pCO = new CFDrawPage(NULL, g_pServer);
00223   }
00224
00225   if (NULL != pCO)
00226   {
00227     g_pServer->ObjectsUp();
00228     hr = pCO->QueryInterface(riid, ppv);
00229     if (FAILED(hr))
00230     {
00231       g_pServer->ObjectsDown();
00232       DELETE_POINTER(pCO);
00233     }
00234   }
00235
00236   return hr;
00237 }
00238
00239
00240 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00241   Function: DllCanUnloadNow
00242
00243   Summary:  The standard exported function that the COM service library
00244             uses to determine if this server DLL can be unloaded.
00245
00246   Args:     void.
00247
00248   Returns:  HRESULT
00249               S_OK if this DLL server can be unloaded.
00250               S_FALSE if this DLL can not be unloaded.
00251 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00252 STDAPI DllCanUnloadNow(void)
00253 {
00254   HRESULT hr;
00255
00256   // We return S_OK if there are no longer any living objects AND
00257   // there are no outstanding client locks on this server.
00258   hr = g_pServer->CanUnloadNow();
00259
00260   return hr;
00261 }
00262
00263
00264 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00265   Function: DllRegisterServer
00266
00267   Summary:  The standard exported function that can be called to command
00268             this DLL server to register itself in the system registry.
00269
00270   Args:     void.
00271
00272   Returns:  HRESULT
00273               NOERROR
00274 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00275 STDAPI DllRegisterServer(void)
00276 {
00277   HRESULT  hr = NOERROR;
00278   TCHAR    szID[GUID_SIZE+1];
00279   TCHAR    szCLSID[GUID_SIZE+32];
00280   TCHAR    szModulePath[MAX_PATH];
00281
00282   // Obtain the path to this module's executable file for later use.
00283   GetModuleFileName(
00284     g_pServer->m_hDllInst,
00285     szModulePath,
00286     sizeof(szModulePath)/sizeof(TCHAR));
00287
00288   /*-------------------------------------------------------------------------
00289     Create registry entries for the DrawPage Component.
00290   -------------------------------------------------------------------------*/
00291   // Create some base key strings.
00292   StringFromGUID2(CLSID_DrawPage, szID, GUID_SIZE);
00293   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00294   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00295
00296   // Create ProgID keys.
00297   SetRegKeyValue(
00298     TEXT("CTS.DrawPage.1"),
00299     NULL,
00300     TEXT("DrawPage Component - PERDRAW Code Sample"));
00301   SetRegKeyValue(
00302     TEXT("CTS.DrawPage.1"),
00303     TEXT("CLSID"),
00304     szID);
00305
00306   // Create VersionIndependentProgID keys.
00307   SetRegKeyValue(
00308     TEXT("CTS.DrawPage"),
00309     NULL,
00310     TEXT("DrawPage Component - PERDRAW Code Sample"));
00311   SetRegKeyValue(
00312     TEXT("CTS.DrawPage"),
00313     TEXT("CurVer"),
00314     TEXT("CTS.DrawPage.1"));
00315   SetRegKeyValue(
00316     TEXT("CTS.DrawPage"),
00317     TEXT("CLSID"),
00318     szID);
00319
00320   // Create entries under CLSID.
00321   SetRegKeyValue(
00322     szCLSID,
00323     NULL,
00324     TEXT("DrawPage Component - PERDRAW Code Sample"));
00325   SetRegKeyValue(
00326     szCLSID,
00327     TEXT("ProgID"),
00328     TEXT("CTS.DrawPage.1"));
00329   SetRegKeyValue(
00330     szCLSID,
00331     TEXT("VersionIndependentProgID"),
00332     TEXT("CTS.DrawPage"));
00333   SetRegKeyValue(
00334     szCLSID,
00335     TEXT("NotInsertable"),
00336     NULL);
00337   SetRegKeyValue(
00338     szCLSID,
00339     TEXT("InprocServer32"),
00340     szModulePath);
00341   AddRegNamedValue(
00342     szCLSID,
00343     TEXT("InprocServer32"),
00344     TEXT("ThreadingModel"),
00345     TEXT("Apartment"));
00346
00347   return hr;
00348 }
00349
00350
00351 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00352   Function: DllUnregisterServer
00353
00354   Summary:  The standard exported function that can be called to command
00355             this DLL server to unregister itself from the system Registry.
00356
00357   Args:     void.
00358
00359   Returns:  HRESULT
00360               NOERROR
00361 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00362 STDAPI DllUnregisterServer(void)
00363 {
00364   HRESULT  hr = NOERROR;
00365   TCHAR    szID[GUID_SIZE+1];
00366   TCHAR    szCLSID[GUID_SIZE+32];
00367   TCHAR    szTemp[MAX_PATH+GUID_SIZE];
00368
00369   /*-------------------------------------------------------------------------
00370     Delete registry entries for the DrawPage Component.
00371   -------------------------------------------------------------------------*/
00372   //Create some base key strings.
00373   StringFromGUID2(CLSID_DrawPage, szID, GUID_SIZE);
00374   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00375   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00376
00377   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DrawPage\\CurVer"));
00378   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DrawPage\\CLSID"));
00379   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DrawPage"));
00380
00381   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DrawPage.1\\CLSID"));
00382   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.DrawPage.1"));
00383
00384   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00385   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00386
00387   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00388   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00389
00390   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00391   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00392
00393   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("InprocServer32"));
00394   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00395
00396   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00397
00398   return hr;
00399 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ConnectionEventsVt.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ConnectionEventsVt.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ConnectionEventsVt
00019 /** @com.interface(iid=00000402-0000-0010-8000-00AA006D2EA4, thread=AUTO) */
00020 public interface ConnectionEventsVt extends IUnknown
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00024   public void InfoMessage(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00025
00026   /** @com.method(vtoffset=1, addFlagsVtable=4)
00027       @com.parameters([in,type=I4] TransactionLevel, [in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00028   public void BeginTransComplete(int TransactionLevel, msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00029
00030   /** @com.method(vtoffset=2, addFlagsVtable=4)
00031       @com.parameters([in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00032   public void CommitTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00033
00034   /** @com.method(vtoffset=3, addFlagsVtable=4)
00035       @com.parameters([in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00036   public void RollbackTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00037
00038   /** @com.method(vtoffset=4, addFlagsVtable=4)
00039       @com.parameters([in,out,size=1,type=ARRAY] Source, [in,out,type=PTR] CursorType, [in,out,type=PTR] LockType, [in,out,size=1,type=ARRAY] Options, [in,out,type=PTR] adStatus, [in,iid=0000054E-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pCommand, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00040   public void WillExecute(String[] Source, int[] CursorType, int[] LockType, int[] Options, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection);
00041
00042   /** @com.method(vtoffset=5, addFlagsVtable=4)
00043       @com.parameters([in,type=I4] RecordsAffected, [in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=0000054E-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pCommand, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00044   public void ExecuteComplete(int RecordsAffected, msado15.Error pError, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection);
00045
00046   /** @com.method(vtoffset=6, addFlagsVtable=4)
00047       @com.parameters([in,out,size=1,type=ARRAY] ConnectionString, [in,out,size=1,type=ARRAY] UserID, [in,out,size=1,type=ARRAY] Password, [in,out,size=1,type=ARRAY] Options, [in,out,type=PTR] adStatus, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00048   public void WillConnect(String[] ConnectionString, String[] UserID, String[] Password, int[] Options, int[] adStatus, msado15._Connection pConnection);
00049
00050   /** @com.method(vtoffset=7, addFlagsVtable=4)
00051       @com.parameters([in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00052   public void ConnectComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00053
00054   /** @com.method(vtoffset=8, addFlagsVtable=4)
00055       @com.parameters([in,out,type=PTR] adStatus, [in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pConnection) */
00056   public void Disconnect(int[] adStatus, msado15._Connection pConnection);
00057
00058
00059   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x402, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00060 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Provider/Include/Resource.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Provider
  • Include

Resource.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   Resource.h
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 //{{NO_DEPENDENCIES}}
00017 // Microsoft Developer Studio generated include file.
00018 // Used by propprov.rc
00019 //
00020
00021 // Next default values for new objects
00022 //
00023 #ifdef APSTUDIO_INVOKED
00024 #ifndef APSTUDIO_READONLY_SYMBOLS
00025 #define _APS_NO_MFC                     1
00026 #define _APS_NEXT_RESOURCE_VALUE        101
00027 #define _APS_NEXT_COMMAND_VALUE         40001
00028 #define _APS_NEXT_CONTROL_VALUE         1000
00029 #define _APS_NEXT_SYMED_VALUE           101
00030 #endif
00031 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031
00032     TCHAR tmpHelpFile[MAX_PATH];
00033
00034     GetWindowsDirectory(tmpHelpFile, (sizeof tmpHelpFile)/(sizeof tmpHelpFile[0]));
00035     _tcscat(tmpHelpFile, _T("\\HELP\\"));
00036     LoadString(g_hinst, IDS_HELPFILE, &tmpHelpFile[_tcslen(tmpHelpFile)], MAX_PATH - _tcslen(tmpHelpFile));
00037
00038   MAKE_WIDEPTR_FROMTSTR(wszHelpFile, tmpHelpFile);
00039   wcscpy(m_HelpFile, wszHelpFile);
00040 }
00041
00042 CComponentData::~CComponentData()
00043 {
00044     if (m_pStaticNode) {
00045         delete m_pStaticNode;
00046     }
00047
00048     OBJECT_DESTROYED
00049 }
00050
00051 ///////////////////////
00052 // IUnknown implementation
00053 ///////////////////////
00054
00055 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00056 {
00057     if (!ppv)
00058         return E_FAIL;
00059
00060     *ppv = NULL;
00061
00062     if (IsEqualIID(riid, IID_IUnknown))
00063         *ppv = static_cast<IComponentData *>(this);
00064     else if (IsEqualIID(riid, IID_IComponentData))
00065         *ppv = static_cast<IComponentData *>(this);
00066     else if (IsEqualIID(riid, IID_ISnapinHelp))
00067         *ppv = static_cast<ISnapinHelp*>(this);
00068
00069     if (*ppv)
00070     {
00071         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00072         return S_OK;
00073     }
00074
00075     return E_NOINTERFACE;
00076 }
00077
00078 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00079 {
00080     return InterlockedIncrement((LONG *)&m_cref);
00081 }
00082
00083 STDMETHODIMP_(ULONG) CComponentData::Release()
00084 {
00085     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00086     {
00087         // we need to decrement our object count in the DLL
00088         delete this;
00089         return 0;
00090     }
00091
00092     return m_cref;
00093 }
00094
00095 ///////////////////////////////
00096 // Interface IComponentData
00097 ///////////////////////////////
00098 HRESULT CComponentData::Initialize(
00099                                    /* [in] */ LPUNKNOWN pUnknown)
00100 {
00101     HRESULT      hr;
00102
00103     //
00104     // Get pointer to name space interface
00105     //
00106     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00107     _ASSERT( S_OK == hr );
00108
00109     //
00110     // Get pointer to console interface
00111     //
00112     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00113     _ASSERT( S_OK == hr );
00114
00115     IImageList *pImageList;
00116     m_ipConsole->QueryScopeImageList(&pImageList);
00117     _ASSERT( S_OK == hr );
00118
00119     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00120         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00121         0, // index of the first image in the strip
00122         RGB(0, 128, 128)  // color of the icon mask
00123         );
00124
00125     pImageList->Release();
00126
00127     return S_OK;
00128 }
00129
00130 HRESULT CComponentData::CreateComponent(
00131                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00132 {
00133     *ppComponent = NULL;
00134
00135     CComponent *pComponent = new CComponent(this);
00136
00137     if (NULL == pComponent)
00138         return E_OUTOFMEMORY;
00139
00140     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00141 }
00142
00143 HRESULT CComponentData::Notify(
00144                                /* [in] */ LPDATAOBJECT lpDataObject,
00145                                /* [in] */ MMC_NOTIFY_TYPE event,
00146                                /* [in] */ LPARAM arg,
00147                                /* [in] */ LPARAM param)
00148 {
00149   MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00150
00151     HRESULT hr = S_FALSE;
00152
00153   //Get our data object. If it is NULL, we return with S_FALSE.
00154   //See implementation of GetOurDataObject() to see how to
00155   //handle special data objects.
00156   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00157   if (NULL == pDataObject)
00158     return S_FALSE;
00159
00160   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00161
00162     switch (event)
00163     {
00164     case MMCN_EXPAND:
00165         hr = base->Expand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00166         break;
00167
00168     case MMCN_INITOCX:
00169         hr = base->InitOCX(reinterpret_cast<IUnknown *>(param));
00170         break;
00171     }
00172
00173     return hr;
00174 }
00175
00176 HRESULT CComponentData::Destroy( void)
00177 {
00178     // Free interfaces
00179     if (m_ipConsoleNameSpace) {
00180         m_ipConsoleNameSpace->Release();
00181         m_ipConsoleNameSpace = NULL;
00182     }
00183
00184     if (m_ipConsole) {
00185         m_ipConsole->Release();
00186         m_ipConsole = NULL;
00187     }
00188
00189     return S_OK;
00190 }
00191
00192 HRESULT CComponentData::QueryDataObject(
00193                                         /* [in] */ MMC_COOKIE cookie,
00194                                         /* [in] */ DATA_OBJECT_TYPES type,
00195                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00196 {
00197     CDataObject *pObj = NULL;
00198
00199     if (cookie == 0)
00200         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00201     else
00202         pObj = new CDataObject(cookie, type);
00203
00204     if (!pObj)
00205         return E_OUTOFMEMORY;
00206
00207     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00208
00209     return S_OK;
00210 }
00211
00212 HRESULT CComponentData::GetDisplayInfo(
00213                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00214 {
00215     HRESULT hr = S_FALSE;
00216
00217     // if they are asking for the SDI_STR we have one of those to give
00218     if (pScopeDataItem->lParam) {
00219         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00220         if (pScopeDataItem->mask & SDI_STR) {
00221                         LPCTSTR pszT = base->GetDisplayName();
00222                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00223             pScopeDataItem->displayname = pszW;
00224         }
00225
00226         if (pScopeDataItem->mask & SDI_IMAGE) {
00227             pScopeDataItem->nImage = base->GetBitmapIndex();
00228         }
00229     }
00230
00231     return hr;
00232 }
00233
00234 HRESULT CComponentData::CompareObjects(
00235                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00236                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00237 {
00238     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00239     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00240
00241     // compare the object pointers
00242     if (baseA->GetCookie() == baseB->GetCookie())
00243         return S_OK;
00244
00245     return S_FALSE;
00246 }
00247
00248 ///////////////////////////////
00249 // Interface ISnapinHelp
00250 ///////////////////////////////
00251 HRESULT CComponentData::GetHelpTopic(
00252                                      /* [out] */ LPOLESTR *lpCompiledHelpFile)
00253 {
00254     *lpCompiledHelpFile = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(m_HelpFile) + 1) * sizeof(WCHAR)));
00255
00256     wcscpy(*lpCompiledHelpFile, m_HelpFile);
00257
00258     return S_OK;
00259 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/msomniprovrs.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

msomniprovrs.h

Go to the documentation of this file.
00001 // Start of file MSOmniProvRS.h
00002 // File: MSOmniProvRS.h
00003 //
00004 //  This file contains the Declaration of the CMSOmniProvRowset and CMSOmniProvCommand
00005 //
00006 //  The following functions have been customized or added for the provider to function:
00007 //
00008 //    CMSOmniProvRowset :: GetData -  Retrieves data from the rowset's copy of the row...
00009 //    CMSOmniProvRowset :: SetSchemaInfo - Creates the rowset column info structure...
00010 //    CMSOmniProvRowset :: GetNextRows - Releases rows...
00011 //    CMSOmniProvRowset :: GetNextRows - Fetches rows, sequentially, remembering the previous position...
00012 //
00013
00014 #ifndef __CMSOmniProvRowset_H_
00015 #define __CMSOmniProvRowset_H_
00016
00017 #include "resource.h"       // main symbols
00018 #include "IRowsetScroll.h" // IRowsetScroll
00019 #include "IRowsetChange.h" // IRowsetChange
00020 #include "RNCP.h"  // The ConnectionPoint and IRowsetNotify Proxy class
00021 #include "CDBFile.h"
00022
00023 class CMSOmniProvCommand ;
00024 class CMSOmniProvRowset ;
00025
00026 // CMSOmniProvCommand
00027
00028 class ATL_NO_VTABLE CMSOmniProvCommand :
00029   public CComObjectRootEx<CComSingleThreadModel>,   // Single Threaded for the present...
00030   public IAccessorImpl<CMSOmniProvCommand>,
00031   public ICommandTextImpl<CMSOmniProvCommand>,
00032   public ICommandPropertiesImpl<CMSOmniProvCommand>,
00033   public IObjectWithSiteImpl<CMSOmniProvCommand>,
00034   public IConvertTypeImpl<CMSOmniProvCommand>,
00035   public IColumnsInfoImpl<CMSOmniProvCommand>
00036 {
00037 public:
00038 BEGIN_COM_MAP(CMSOmniProvCommand)
00039   COM_INTERFACE_ENTRY(ICommand)
00040   COM_INTERFACE_ENTRY(IObjectWithSite)
00041   COM_INTERFACE_ENTRY(IAccessor)
00042   COM_INTERFACE_ENTRY(ICommandProperties)
00043   COM_INTERFACE_ENTRY2(ICommandText, ICommand)
00044   COM_INTERFACE_ENTRY(IColumnsInfo)
00045   COM_INTERFACE_ENTRY(IConvertType)
00046 END_COM_MAP()
00047 // ICommand
00048 public:
00049   static ATLCOLUMNINFO* GetColumnInfo(CMSOmniProvCommand* pv, ULONG* pcInfo);
00050
00051   HRESULT FinalConstruct()
00052   {
00053     HRESULT hr = CConvertHelper::FinalConstruct();
00054     if (FAILED (hr))
00055       return hr;
00056     hr = IAccessorImpl<CMSOmniProvCommand>::FinalConstruct();
00057     if (FAILED(hr))
00058       return hr;
00059     return CUtlProps<CMSOmniProvCommand>::FInit();
00060   }
00061   void FinalRelease()
00062   {
00063     IAccessorImpl<CMSOmniProvCommand>::FinalRelease();
00064   }
00065   HRESULT WINAPI Execute(IUnknown * pUnkOuter, REFIID riid, DBPARAMS * pParams,
00066               LONG * pcRowsAffected, IUnknown ** ppRowset);
00067
00068 BEGIN_PROPSET_MAP(CMSOmniProvCommand)
00069   BEGIN_PROPERTY_SET(DBPROPSET_ROWSET)
00070     PROPERTY_INFO_ENTRY_EX(IAccessor,VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00071     PROPERTY_INFO_ENTRY_EX(IColumnsInfo, VT_BOOL,   DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00072     PROPERTY_INFO_ENTRY_EX(IConvertType, VT_BOOL,   DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00073     PROPERTY_INFO_ENTRY_EX(IRowset, VT_BOOL,    DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00074     PROPERTY_INFO_ENTRY_EX(IRowsetIdentity,VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00075     PROPERTY_INFO_ENTRY_EX(IRowsetInfo, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00076     PROPERTY_INFO_ENTRY_EX(IRowsetChange, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00077     PROPERTY_INFO_ENTRY_EX(UPDATABILITY, VT_I4, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_DELETE | DBPROPVAL_UP_INSERT, 0)
00078     PROPERTY_INFO_ENTRY_EX(OWNINSERT, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00079     PROPERTY_INFO_ENTRY_EX(OWNUPDATEDELETE, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00080     PROPERTY_INFO_ENTRY_EX(REMOVEDELETED, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00081     PROPERTY_INFO_ENTRY_EX(IRowsetScroll, VT_BOOL,DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00082     PROPERTY_INFO_ENTRY_EX(CANFETCHBACKWARDS,VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00083     PROPERTY_INFO_ENTRY_EX(CANHOLDROWS, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00084     PROPERTY_INFO_ENTRY_EX(CANSCROLLBACKWARDS, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00085       PROPERTY_INFO_ENTRY_EX(IRowsetLocate, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00086     PROPERTY_INFO_ENTRY_EX(BOOKMARKS,  VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE , VARIANT_TRUE, 0)
00087     PROPERTY_INFO_ENTRY_EX(BOOKMARKSKIPPED,VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, VARIANT_TRUE, 0)
00088     PROPERTY_INFO_ENTRY_EX(BOOKMARKTYPE,  VT_I4, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ, DBPROPVAL_BMK_NUMERIC, 0)
00089     PROPERTY_INFO_ENTRY_EX(LITERALBOOKMARKS, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00090     PROPERTY_INFO_ENTRY_EX(ORDEREDBOOKMARKS, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE, VARIANT_TRUE, 0)
00091     PROPERTY_INFO_ENTRY_VALUE(LITERALIDENTITY,VARIANT_TRUE)
00092     PROPERTY_INFO_ENTRY_VALUE(STRONGIDENTITY,VARIANT_TRUE)
00093     PROPERTY_INFO_ENTRY_VALUE(NOTIFICATIONPHASES, DBPROPVAL_NP_OKTODO | DBPROPVAL_NP_ABOUTTODO | DBPROPVAL_NP_SYNCHAFTER |DBPROPVAL_NP_FAILEDTODO | DBPROPVAL_NP_DIDEVENT)
00094     PROPERTY_INFO_ENTRY_EX(NOTIFYROWDELETE, VT_I4, DBPROPVAL_NP_OKTODO | DBPROPVAL_NP_ABOUTTODO | DBPROPVAL_NP_SYNCHAFTER | DBPROPVAL_NP_FAILEDTODO | DBPROPVAL_NP_DIDEVENT, VARIANT_TRUE, 0)
00095     PROPERTY_INFO_ENTRY_EX(NOTIFYROWINSERT, VT_I4, DBPROPVAL_NP_OKTODO | DBPROPVAL_NP_ABOUTTODO | DBPROPVAL_NP_SYNCHAFTER | DBPROPVAL_NP_FAILEDTODO | DBPROPVAL_NP_DIDEVENT, VARIANT_TRUE, 0)
00096     PROPERTY_INFO_ENTRY_EX(NOTIFYCOLUMNSET, VT_I4, DBPROPVAL_NP_OKTODO | DBPROPVAL_NP_ABOUTTODO | DBPROPVAL_NP_SYNCHAFTER | DBPROPVAL_NP_FAILEDTODO | DBPROPVAL_NP_DIDEVENT, VARIANT_TRUE, 0)
00097     PROPERTY_INFO_ENTRY_EX(NOTIFYROWSETFETCHPOSITIONCHANGE, VT_I4, DBPROPVAL_NP_OKTODO | DBPROPVAL_NP_ABOUTTODO | DBPROPVAL_NP_SYNCHAFTER | DBPROPVAL_NP_FAILEDTODO | DBPROPVAL_NP_DIDEVENT, VARIANT_TRUE, 0)
00098     PROPERTY_INFO_ENTRY_EX(SERVERCURSOR, VT_BOOL, DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ , VARIANT_TRUE, 0)
00099   END_PROPERTY_SET(DBPROPSET_ROWSET)
00100 END_PROPSET_MAP()
00101 };
00102
00103 typedef CDBFile dummyStore;
00104
00105 class ATL_NO_VTABLE  CMSOmniProvRowset :
00106   public CRowsetImpl <CMSOmniProvRowset, dummyStore, CMSOmniProvCommand, CSimpleArray<dummyStore>, CSimpleRow, IRowsetScrollImpl<CMSOmniProvRowset> > ,
00107   public IRowsetChangeImpl<CMSOmniProvRowset, dummyStore>,
00108   public CProxyIRowsetNotify< CMSOmniProvRowset >,
00109   public IConnectionPointContainerImpl<CMSOmniProvRowset>
00110 {
00111 public:
00112   typedef CRowsetImpl <CMSOmniProvRowset, dummyStore, CMSOmniProvCommand, CSimpleArray<dummyStore>, CSimpleRow, IRowsetScrollImpl<CMSOmniProvRowset> >  _OmniProvBaseClass;
00113
00114   BEGIN_COM_MAP(CMSOmniProvRowset)
00115     COM_INTERFACE_ENTRY(IRowsetLocate)
00116     COM_INTERFACE_ENTRY(IRowsetScroll)
00117     COM_INTERFACE_ENTRY(IRowsetChange)
00118     COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
00119     COM_INTERFACE_ENTRY_CHAIN(_OmniProvBaseClass)
00120   END_COM_MAP()
00121
00122
00123   BEGIN_CONNECTION_POINT_MAP(CMSOmniProvRowset)
00124     CONNECTION_POINT_ENTRY(IID_IRowsetNotify)
00125   END_CONNECTION_POINT_MAP()
00126
00127 public:
00128   static ATLCOLUMNINFO* GetColumnInfo(CMSOmniProvRowset* pv, ULONG* pNumCols);
00129   BOOL CheckTable(TCHAR* szTblName);
00130   HRESULT Execute(DBPARAMS * pParams, LONG* pcRowsAffected);
00131   void CreateColInfo();
00132   void AllocateProxyBuffers();
00133   HRESULT GetDataSource(_bstr_t &m_bstrLoc);
00134   ATLCOLUMNINFO * GetSchemaInfo(ULONG * pNumCols);
00135
00136   // All the member variables
00137   int m_cCols;              // Number of columns represented in m_prgColInfo
00138   CDBFile m_DBFile;    // The Storage class
00139   ATLCOLUMNINFO * m_prgColInfo;  // Each rowset will have its set of column infos with or without bookmarks
00140
00141   // The Constructor
00142   CMSOmniProvRowset()
00143   {
00144     m_prgColInfo = NULL;
00145   }
00146
00147   // The Destructor
00148   ~CMSOmniProvRowset()
00149   {
00150     if(m_prgColInfo)
00151       delete m_prgColInfo;
00152   }
00153
00154   // CMSOmniProvRowset :: SetSchemaInfo
00155   // This function copies the final column info to the rowset class
00156   // Usually called from the Execute method as that is when the columns will be known
00157   // (bookmark + columns selected)
00158   void SetSchemaInfo(ATLCOLUMNINFO * prgColInfo, int cCols)
00159   {
00160     m_cCols = cCols;
00161     m_prgColInfo = new ATLCOLUMNINFO[cCols];
00162     // Copy the information from the columninfo passed in. This is possible because
00163     // we know that there are no pointers in the structure.
00164     for (int i = 0; i < cCols; i++)
00165       m_prgColInfo[i] = prgColInfo[i];
00166   }
00167
00168   // CMSOmniProvRowset :: Getdata
00169   // Retrieves data from the rowset's copy of the row.
00170   STDMETHOD(GetData)(HROW hRow,
00171              HACCESSOR hAccessor,
00172              void *pDstData)
00173   {
00174     ATLTRACE2(atlTraceDBProvider, 0, "IRowsetImpl::GetData\n");
00175     if (pDstData == NULL)
00176       return E_INVALIDARG;
00177     HRESULT hr = S_OK;
00178     //CSimpleRow* pHRow = (CSimpleRow*)hRow;
00179     // 2.0
00180     CSimpleRow* pHRow = NULL;
00181     if (hRow == NULL || (pHRow = (m_rgRowHandles.Lookup(hRow)) ) == NULL)
00182       return DB_E_BADROWHANDLE;
00183     _BindType* pBinding;
00184     void* pSrcData;
00185     ULONG cCols;
00186     ATLCOLUMNINFO* pColInfo;
00187     ATLASSERT(pBinding != NULL);
00188     pBinding = m_rgBindings.Lookup((int)hAccessor);
00189     if (pBinding == NULL)
00190       return DB_E_BADACCESSORHANDLE;
00191     pColInfo = GetColumnInfo(this, &cCols);
00192     CRow *pDataRow = NULL;
00193     // When Client perform a GetData without performing a GetNextRows( )
00194     if(pHRow->m_iRowset >= m_DBFile.m_Rows.m_nSize)
00195       return DB_E_DELETEDROW;
00196     pDataRow = m_DBFile.m_Rows[pHRow->m_iRowset];
00197     // Fetch data in the proxy buffer if it hasn't already been fetched
00198     pDataRow->GetProxyData(pColInfo, cCols);
00199     // assign source buffer to the proxy buffer
00200     pSrcData = pDataRow->m_pbProxyData;
00201     for (ULONG iBind =0; iBind < pBinding->cBindings; iBind++)
00202     {
00203       DBBINDING* pBindCur = &(pBinding->pBindings[iBind]);
00204       for (ULONG iColInfo = 0;
00205          iColInfo < cCols && pBindCur->iOrdinal != pColInfo[iColInfo].iOrdinal;
00206          iColInfo++);
00207       if (iColInfo == cCols)
00208         return DB_E_BADORDINAL;
00209       ATLCOLUMNINFO* pColCur = &(pColInfo[iColInfo]);
00210       // Ordinal found at iColInfo
00211       BOOL bProvOwn = pBindCur->dwMemOwner == DBMEMOWNER_PROVIDEROWNED;
00212       bProvOwn;
00213
00214       DBSTATUS dbStat = DBSTATUS_S_OK;
00215       // If the provider's field is NULL, we can optimize this situation,
00216       // set the fields to 0 and continue.
00217       if (dbStat == DBSTATUS_S_ISNULL)
00218       {
00219         if (pBindCur->dwPart & DBPART_STATUS)
00220           *((DBSTATUS*)((BYTE*)(pDstData) + pBindCur->obStatus)) = dbStat;
00221
00222         if (pBindCur->dwPart & DBPART_LENGTH)
00223           *((ULONG*)((BYTE*)(pDstData) + pBindCur->obLength)) = 0;
00224
00225         if (pBindCur->dwPart & DBPART_VALUE)
00226           *((BYTE*)(pDstData) + pBindCur->obValue) = NULL;
00227         continue;
00228       }
00229       ULONG cbDst = pBindCur->cbMaxLen;
00230       ULONG cbCol;
00231       BYTE* pSrcTemp;
00232       void *pvData = NULL;
00233       void * pvTmpData = NULL;
00234
00235       if (bProvOwn && pColCur->wType == pBindCur->wType)
00236       {
00237         pSrcTemp = ((BYTE*)(pSrcData) + pColCur->cbOffset);
00238       }
00239       else
00240       {
00241         BYTE* pDstTemp = (BYTE*)pDstData + pBindCur->obValue;
00242         switch (pColCur->wType)
00243         {
00244         case DBTYPE_STR:
00245           cbCol = lstrlenA((LPSTR)(((BYTE*)pSrcData) + pColCur->cbOffset));
00246           break;
00247         case DBTYPE_WSTR:
00248         case DBTYPE_BSTR:
00249           cbCol = lstrlenW((LPWSTR)(((BYTE*)pSrcData) + pColCur->cbOffset)) * sizeof(WCHAR);
00250           break;
00251         // The char ptr case
00252         case DBTYPE_STR | DBTYPE_BYREF:
00253           pvData = (((BYTE*)pSrcData) + pColCur->cbOffset);
00254           cbCol =lstrlenA(*(char**)pvData);
00255           break;
00256         default:
00257           cbCol = pColCur->ulColumnSize;
00258           break;
00259         }
00260         if (pBindCur->dwPart & DBPART_VALUE)
00261         {
00262           hr = m_spConvert->DataConvert(pColCur->wType, pBindCur->wType,
00263                       cbCol, &cbDst, (BYTE*)(pSrcData) + pColCur->cbOffset,
00264                       pDstTemp, pBindCur->cbMaxLen, dbStat, &dbStat,
00265                       pBindCur->bPrecision, pBindCur->bScale,0);
00266         }
00267       }
00268       if (pBindCur->dwPart & DBPART_LENGTH)
00269         *((ULONG*)((BYTE*)(pDstData) + pBindCur->obLength)) = cbDst;
00270       if (pBindCur->dwPart & DBPART_STATUS)
00271         *((DBSTATUS*)((BYTE*)(pDstData) + pBindCur->obStatus)) = dbStat;
00272       if (FAILED(hr))
00273         return hr;
00274     }
00275     return hr;
00276   }
00277
00278   // CMSOmniProvRowset :: ReleaseRows
00279   // Releases rows.
00280   STDMETHOD(ReleaseRows)(ULONG cRows,
00281                const HROW rghRows[],
00282                DBROWOPTIONS rgRowOptions[],
00283                ULONG rgRefCounts[],
00284                DBROWSTATUS rgRowStatus[])
00285   {
00286     HRESULT hr = _OmniProvBaseClass::ReleaseRows(
00287               cRows,
00288                rghRows,
00289                rgRowOptions,
00290                rgRefCounts,
00291                rgRowStatus);
00292     if(FAILED(Fire_OnRowChange(this, cRows, rghRows, DBREASON_ROW_RELEASE, DBEVENTPHASE_DIDEVENT, TRUE)))
00293       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_RELEASE in DBEVENTPHASE_DIDEVENT phase\n");
00294     return hr;
00295   }
00296
00297   // CMSOmniProvRowset :: GetNextRows
00298   // Fetches rows, sequentially, remembering the previous position...
00299   STDMETHOD(GetNextRows)(HCHAPTER /*hReserved*/,
00300                LONG lRowsOffset,
00301                LONG cRows,
00302                ULONG *pcRowsObtained,
00303                HROW **prghRows)
00304   {
00305     LONG lTmpRows = lRowsOffset;
00306     ATLTRACE2(atlTraceDBProvider, 0, "IRowsetImpl::GetNextRows\n");
00307     HRESULT hrEvent;
00308     CMSOmniProvRowset* pT = (CMSOmniProvRowset*) this;
00309     CMSOmniProvRowset::ObjectLock cab(pT);
00310       if(FAILED(hrEvent = Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_OKTODO, TRUE)))
00311     {
00312       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_OKTODO phase\n");
00313       if(hrEvent==S_FALSE)
00314         return DB_E_CANCELED;
00315     }
00316     if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_ABOUTTODO, TRUE)))
00317       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_ABOUTTODO phase\n");
00318     if (pcRowsObtained != NULL)
00319       *pcRowsObtained = 0;
00320     if (prghRows == NULL || pcRowsObtained == NULL)\
00321     {
00322       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00323         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_FAILEDTODO phase\n");
00324       return E_INVALIDARG;
00325     }
00326     if (cRows == 0)
00327     {
00328       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_SYNCHAFTER, TRUE)))
00329         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_SYNCHAFTER phase\n");
00330       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_DIDEVENT, TRUE)))
00331         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_DIDEVENT phase\n");
00332       return S_OK;
00333     }
00334     HRESULT hr = S_OK;
00335     if (lRowsOffset < 0 && !m_bCanScrollBack)
00336     {
00337       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00338         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_FAILEDTODO phase\n");
00339       return DB_E_CANTSCROLLBACKWARDS;
00340     }
00341     if (cRows < 0  && !m_bCanFetchBack)
00342     {
00343       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00344         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_FAILEDTODO phase\n");
00345       return DB_E_CANTFETCHBACKWARDS;
00346     }
00347     // Calculate # of rows in set and the base fetch position.  If the rowset
00348     // is at its head position, then lRowOffset < 0 means moving from the BACK
00349     // of the rowset and not the front.
00350     LONG cRowsInSet = pT->m_DBFile.m_Rows.GetSize();
00351     if (((lRowsOffset == LONG_MIN) && (cRowsInSet != LONG_MIN))
00352       || (abs(lRowsOffset)) > cRowsInSet ||
00353       (abs(lRowsOffset) == cRowsInSet && lRowsOffset < 0 && cRows < 0) ||
00354       (abs(lRowsOffset) == cRowsInSet && lRowsOffset > 0 && cRows > 0))
00355     {
00356       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00357         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_FAILEDTODO phase\n");
00358       return DB_S_ENDOFROWSET;
00359     }
00360
00361     // In the case where the user is moving backwards after moving forwards,
00362     // we do not wrap around to the end of the rowset.
00363     if ((m_iRowset == 0 && !m_bReset && cRows < 0) ||
00364       (((LONG)m_iRowset + lRowsOffset) > cRowsInSet) ||
00365       (m_iRowset == (DWORD)cRowsInSet && lRowsOffset >= 0 && cRows > 0))
00366     {
00367       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00368         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_FAILEDTODO phase\n");
00369       return DB_S_ENDOFROWSET;
00370     }
00371
00372     // Note, if m_bReset, m_iRowset must be 0
00373     if (lRowsOffset < 0 && m_bReset)
00374     {
00375       ATLASSERT(m_iRowset == 0);
00376       m_iRowset = cRowsInSet;
00377     }
00378
00379     int iStepSize = cRows >= 0 ? 1 : -1;
00380
00381     // If cRows == LONG_MIN, we can't use ABS on it.  Therefore, we reset it
00382     // to a value just greater than cRowsInSet
00383     if (cRows == LONG_MIN && cRowsInSet != LONG_MIN)
00384       cRows = cRowsInSet + 2; // set the value to something we can deal with
00385     else
00386       cRows = abs(cRows);
00387
00388     if (iStepSize < 0 && m_iRowset == 0 && m_bReset && lRowsOffset <= 0)
00389       m_iRowset = cRowsInSet;
00390
00391     lRowsOffset += m_iRowset;
00392
00393     *pcRowsObtained = 0;
00394     CAutoMemRelease<HROW, CComFree< HROW > > amr;
00395     if (*prghRows == NULL)
00396     {
00397       int cHandlesToAlloc = (cRows > cRowsInSet) ? cRowsInSet : cRows;
00398       if (iStepSize == 1 && (cRowsInSet - lRowsOffset) < cHandlesToAlloc)
00399         cHandlesToAlloc = cRowsInSet - lRowsOffset;
00400       if (iStepSize == -1 && lRowsOffset < cHandlesToAlloc)
00401         cHandlesToAlloc = lRowsOffset;
00402       *prghRows = (HROW*)CoTaskMemAlloc((cHandlesToAlloc) * sizeof(HROW*));
00403       amr.Attach(*prghRows);
00404     }
00405     if (*prghRows == NULL)
00406     {
00407       if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00408         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_FAILEDTODO phase\n");
00409       return E_OUTOFMEMORY;
00410     }
00411     while ((lRowsOffset >= 0 && cRows != 0) &&
00412       ((lRowsOffset < cRowsInSet) || (lRowsOffset <= cRowsInSet && iStepSize < 0)))
00413     {
00414       // cRows > cRowsInSet && iStepSize < 0
00415       if (lRowsOffset == 0 && cRows > 0 && iStepSize < 0)
00416         break;
00417
00418       // in the case where we have iStepSize < 0, move the row back
00419       // further because we want the previous row
00420       LONG lRow = lRowsOffset;
00421       if ((lRowsOffset == 0) && (lTmpRows == 0) && (iStepSize < 0))
00422         lRow = cRowsInSet;
00423
00424       if (iStepSize < 0)
00425         lRow += iStepSize;
00426
00427       hr = pT->CreateRow(lRow, *pcRowsObtained, *prghRows);
00428       if (FAILED(hr))
00429       {
00430         RefRows(*pcRowsObtained, *prghRows, NULL, NULL, FALSE);
00431         for (ULONG iRowDel = 0; iRowDel < *pcRowsObtained; iRowDel++)
00432           *prghRows[iRowDel] = NULL;
00433         *pcRowsObtained = 0;
00434         if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00435           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_FAILEDTODO phase\n");
00436         return hr;
00437       }
00438       cRows--;
00439       lRowsOffset += iStepSize;
00440     }
00441
00442     if ((lRowsOffset >= cRowsInSet && cRows) || (lRowsOffset < 0 && cRows)  ||
00443       (lRowsOffset == 0 && cRows > 0 && iStepSize < 0))
00444       hr = DB_S_ENDOFROWSET;
00445     m_iRowset = lRowsOffset;
00446     if (SUCCEEDED(hr))
00447       amr.Detach();
00448     if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_SYNCHAFTER, TRUE)))
00449       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_SYNCHAFTER phase\n");
00450     if(FAILED(Fire_OnRowsetChange(this, DBREASON_ROWSET_FETCHPOSITIONCHANGE, DBEVENTPHASE_DIDEVENT, TRUE)))
00451       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROWSET_FETCHPOSITIONCHANGE in DBEVENTPHASE_DIDEVENT phase\n");
00452     if(FAILED(Fire_OnRowChange(this, cRows, *prghRows, DBREASON_ROW_ACTIVATE, DBEVENTPHASE_DIDEVENT, TRUE)))
00453       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_ACTIVATE in DBEVENTPHASE_DIDEVENT phase\n");
00454     return hr;
00455   }
00456
00457 };
00458
00459 #endif //__CMSOmniProvRowset_H_
00460
00461 // End of file MSOmniProvRS.h
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/statnode.h Source File

  • SysMgmt
  • MMC
  • Toolbar

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode(CComponentData *pComponentData = NULL);
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038
00039 public:
00040     // virtual functions go here (for MMCN_*)
00041     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00042
00043 private:
00044     enum { NUMBER_OF_CHILDREN = 4 };
00045     CDelegationBase *children[NUMBER_OF_CHILDREN];
00046
00047     // {2974380C-4C4B-11d2-89D8-000021473128}
00048     static const GUID thisGuid;
00049 };
00050
00051 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminTransactionOptions Member List

This is the complete list of members for comadmin::COMAdminTransactionOptions, including all inherited members.
COMAdminTransactionIgnored | comadmin::COMAdminTransactionOptions | [static]
COMAdminTransactionNone | comadmin::COMAdminTransactionOptions | [static]
COMAdminTransactionRequired | comadmin::COMAdminTransactionOptions | [static]
COMAdminTransactionRequiresNew | comadmin::COMAdminTransactionOptions | [static]
COMAdminTransactionSupported | comadmin::COMAdminTransactionOptions | [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/CascadeEvent/Cascadeec/INewsEventDefault.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • CascadeEvent
  • Cascadeec

INewsEventDefault.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc11E.tmp" /nologo /d "D:\ComPlusSamples\Source\LCE\CascadeEvent" "D:\ComPlusSamples\Source\LCE\CascadeEvent\CascadeEC.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package cascadeec;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface INewsEventDefault
00019 /** @com.interface(iid=00020400-0000-0000-C000-000000000046, thread=AUTO, type=DUAL) */
00020 public interface INewsEventDefault extends cascadeec.INewsEvent
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=METHOD, name="NewsFlash", addFlagsVtable=4)
00023       @com.parameters([in,type=DATE] dtTimeStamp, [in,type=STRING] Symbol, [in,type=STRING] Headline, [in,type=STRING] URL) */
00024   public void NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=METHOD, name="ShortQuote", addFlagsVtable=4)
00027       @com.parameters([in,type=STRING] Symbol, [in,type=R8] BidPrice, [in,type=R8] AskPrice, [in,type=DATE] LastTradeTime, [in,type=R8] LastTradePrice, [in,type=R8] NetChange, [in,type=R8] DailyHigh, [in,type=R8] DailyLow) */
00028   public void ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LongQuote", addFlagsVtable=4)
00031       @com.parameters([in,type=STRING] Symbol, [in,type=R8] BidPrice, [in,type=R8] AskPrice, [in,type=STRING] LastTradeTime, [in,type=R8] LastTradePrice, [in,type=R8] NetChange, [in,type=R8] DailyHigh, [in,type=R8] DailyLow, [in,type=I4] AskSize, [in,type=I4] BidSize, [in,type=R8] OpenPrice, [in,type=R8] ClosePrice, [in,type=STRING] CloseDate) */
00032   public void LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate);
00033
00034
00035   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x20400, (short)0x0, (short)0x0, (byte)0xc0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x46);
00036 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcsession.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcsession.cpp

Go to the documentation of this file.
00001 // rtcsession.cpp
00002 //
00003
00004 #include "stdafx.h"
00005
00006 /////////////////////////////////////////////
00007 //
00008 // CRTCSession::CRTCSession
00009 //
00010
00011 CRTCSession::CRTCSession()
00012 {
00013     m_hWnd = NULL;
00014     m_pSession = NULL;
00015     m_pWin = NULL;
00016     m_enState = RTCSS_IDLE;
00017 }
00018
00019 /////////////////////////////////////////////
00020 //
00021 // CRTCSession::~CRTCSession
00022 //
00023
00024 CRTCSession::~CRTCSession()
00025 {
00026 }
00027
00028 /////////////////////////////////////////////
00029 //
00030 // CRTCSession::ShowMessageBox
00031 //
00032
00033 void CRTCSession::ShowMessageBox(PWSTR szText)
00034 {
00035     MessageBoxW(m_hWnd, szText, APP_TITLE, MB_OK);
00036 }
00037
00038 /////////////////////////////////////////////
00039 //
00040 // CRTCSession::SetStatusText
00041 //
00042
00043 void CRTCSession::SetStatusText(PWSTR szText)
00044 {
00045     SetWindowTextW(m_hStatusBar, szText);
00046     InvalidateRect(m_hStatusBar, NULL, FALSE);
00047 }
00048
00049 /////////////////////////////////////////////
00050 //
00051 // CRTCSession::OnCreate
00052 //
00053
00054 LRESULT CRTCSession::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam)
00055 {
00056     // Create the status bar
00057     m_hStatusBar = CreateStatusWindow(
00058         WS_CHILD | WS_VISIBLE,
00059         NULL,
00060         m_hWnd,
00061         IDC_STATUSBAR
00062         );
00063
00064     if ( !m_hStatusBar )
00065     {
00066         // CreateStatusWindow failed
00067         return -1;
00068     }
00069
00070     return 0;
00071 }
00072
00073 /////////////////////////////////////////////
00074 //
00075 // CRTCSession::OnDestroy
00076 //
00077
00078 LRESULT CRTCSession::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam)
00079 {
00080     if (m_pSession)
00081     {
00082         // Terminate and release the session
00083         m_pSession->Terminate(RTCTR_NORMAL);
00084
00085         SAFE_RELEASE(m_pSession);
00086     }
00087
00088     if (m_pWin)
00089     {
00090         // Remove the session from the session list
00091         m_pWin->RemoveSession(this);
00092     }
00093
00094     return 0;
00095 }
00096
00097 /////////////////////////////////////////////
00098 //
00099 // CRTCSession::OnClose
00100 //
00101
00102 LRESULT CRTCSession::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam)
00103 {
00104     DestroyWindow(m_hWnd);
00105
00106     return 0;
00107 }
00108
00109 /////////////////////////////////////////////
00110 //
00111 // CRTCSession::OnSize
00112 //
00113
00114 LRESULT CRTCSession::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam)
00115 {
00116     // Resize the status bar
00117     SendMessage(m_hStatusBar, uMsg, wParam, lParam);
00118
00119     return 0;
00120 }
00121
00122 /////////////////////////////////////////////
00123 //
00124 // CRTCSession::DeliverSessionState
00125 //
00126
00127 HRESULT CRTCSession::DeliverSessionState(RTC_SESSION_STATE enState)
00128 {
00129     m_enState = enState;
00130
00131     // Display the session state in the status bar
00132     switch(m_enState)
00133     {
00134     case RTCSS_IDLE:
00135         SetStatusText(L"Idle");
00136         break;
00137
00138     case RTCSS_INCOMING:
00139         SetStatusText(L"Incoming");
00140         break;
00141
00142     case RTCSS_ANSWERING:
00143         SetStatusText(L"Answering");
00144         break;
00145
00146     case RTCSS_INPROGRESS:
00147         SetStatusText(L"Inprogress");
00148         break;
00149
00150     case RTCSS_CONNECTED:
00151         SetStatusText(L"Connected");
00152         break;
00153
00154     case RTCSS_DISCONNECTED:
00155         SetStatusText(L"Disconnected");
00156         break;
00157     }
00158
00159     return S_OK;
00160 }
00161
00162 /////////////////////////////////////////////
00163 //
00164 // CRTCSession::DeliverParticipantState
00165 //
00166
00167 HRESULT CRTCSession::DeliverParticipantState(IRTCParticipant * pParticipant, RTC_PARTICIPANT_STATE enState)
00168 {
00169     return S_OK;
00170 }
00171
00172 /////////////////////////////////////////////
00173 //
00174 // CRTCSession::DeliverMessage
00175 //
00176
00177 HRESULT CRTCSession::DeliverMessage(IRTCParticipant * pParticipant, BSTR bstrContentType, BSTR bstrMessage)
00178 {
00179     return S_OK;
00180 }
00181
00182 /////////////////////////////////////////////
00183 //
00184 // CRTCSession::DeliverUserStatus
00185 //
00186
00187 HRESULT CRTCSession::DeliverUserStatus(IRTCParticipant * pParticipant, RTC_MESSAGING_USER_STATUS enStatus)
00188 {
00189     return S_OK;
00190 }
00191
00192 /////////////////////////////////////////////
00193 //
00194 // CRTCSession::DeliverMedia
00195 //
00196
00197 HRESULT CRTCSession::DeliverMedia(long lMediaType, RTC_MEDIA_EVENT_TYPE enType, RTC_MEDIA_EVENT_REASON enReason)
00198 {
00199     return S_OK;
00200 }
00201
00202 /////////////////////////////////////////////
00203 //
00204 // CRTCSession::DeliverIntensity
00205 //
00206
00207 HRESULT CRTCSession::DeliverIntensity(RTC_AUDIO_DEVICE enDevice, long lLevel)
00208 {
00209     return S_OK;
00210 }
00211
00212 /////////////////////////////////////////////
00213 //
00214 // CRTCSession::DeliverClient
00215 //
00216
00217 HRESULT CRTCSession::DeliverClient(RTC_CLIENT_EVENT_TYPE enEventType)
00218 {
00219     return S_OK;
00220 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTestApp Member List

This is the complete list of members for CTestApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CTestApp() | CTestApp |
CWinApp() | CWinApp |
ExitInstance() | CWinApp | [virtual]
InitInstance() | CTestApp | [virtual]
IsDsEnabledLocaly() | CTestApp | [protected]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
OnAppAbout() | CTestApp |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:57:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagOLESTDMESSAGEFILTER Member List

This is the complete list of members for tagOLESTDMESSAGEFILTER, including all inherited members.
m_bUnblocking | tagOLESTDMESSAGEFILTER
m_cRef | tagOLESTDMESSAGEFILTER
m_dwInComingCallStatus | tagOLESTDMESSAGEFILTER
m_fEnableBusyDialog | tagOLESTDMESSAGEFILTER
m_fEnableNotRespondingDialog | tagOLESTDMESSAGEFILTER
m_hWndBusyDialog | tagOLESTDMESSAGEFILTER
m_hWndParent | tagOLESTDMESSAGEFILTER
m_lpfnBusyDialogHookCallback | tagOLESTDMESSAGEFILTER
m_lpfnHandleInComingCallback | tagOLESTDMESSAGEFILTER
m_lpfnMessagePendingCallback | tagOLESTDMESSAGEFILTER
m_lpszAppName | tagOLESTDMESSAGEFILTER
m_lpVtbl | tagOLESTDMESSAGEFILTER
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyAudit/Resource.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyAudit

Resource.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define IDS_PROJNAME                    100
00018 #define IDR_COMSPYSQLAUDIT                 101
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        201
00025 #define _APS_NEXT_COMMAND_VALUE         32768
00026 #define _APS_NEXT_CONTROL_VALUE         201
00027 #define _APS_NEXT_SYMED_VALUE           103
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleSend/Resource.h Source File

  • NetDS
  • fax
  • SampleSend

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by simple.rc
00004 //
00005
00006 // Next default values for new objects
00007 //
00008 #ifdef APSTUDIO_INVOKED
00009 #ifndef APSTUDIO_READONLY_SYMBOLS
00010 #define _APS_NO_MFC                     1
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/OleImp/Client.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • OleImp

Client.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 // %%Includes: ---------------------------------------------------------------
00019 #define INC_OLE2
00020 #include <stdio.h>
00021 #include <windows.h>
00022 #include <initguid.h>
00023 #include <tchar.h>
00024 #include <conio.h>
00025
00026 // %%GUIDs: ------------------------------------------------------------------
00027 DEFINE_GUID(CLSID_CObject, 0x35b79d1, 0xd6d3, 0x11cf, 0xb9, 0xd4, 0x0, 0xaa, 0x0, 0xa2, 0x16, 0xe0);
00028
00029 // ---------------------------------------------------------------------------
00030 // %%Function: Message
00031 //
00032 //  Formats and displays a message to the console.
00033 // ---------------------------------------------------------------------------
00034  void
00035 Message(LPTSTR szPrefix, HRESULT hr)
00036 {
00037     LPTSTR   szMessage;
00038
00039     if (hr == S_OK)
00040         {
00041         _tprintf(szPrefix);
00042         _tprintf(TEXT("\n"));
00043         return;
00044         }
00045
00046     if (HRESULT_FACILITY(hr) == FACILITY_WINDOWS)
00047         hr = HRESULT_CODE(hr);
00048
00049     FormatMessage(
00050         FORMAT_MESSAGE_ALLOCATE_BUFFER |
00051         FORMAT_MESSAGE_FROM_SYSTEM,
00052         NULL,
00053         hr,
00054         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00055         (LPTSTR)&szMessage,
00056         0,
00057         NULL );
00058
00059     _tprintf (TEXT("%s: %s(%lx)\n"), szPrefix, szMessage, hr);
00060
00061     LocalFree(szMessage);
00062 }  // Message
00063
00064 // ---------------------------------------------------------------------------
00065 // %%Function: main
00066 // ---------------------------------------------------------------------------
00067  void __cdecl
00068 main(int argc, CHAR **argv)
00069 {
00070     HRESULT hr;
00071     COSERVERINFO csi, *pcsi=NULL;
00072     WCHAR wsz [MAX_PATH];
00073   LPCLASSFACTORY pcf = NULL;
00074
00075     // initialize COM for free-threaded use
00076     hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00077     if (FAILED(hr))
00078         {
00079         Message(TEXT("Client: CoInitializeEx"), hr);
00080         exit(hr);
00081         }
00082
00083   // initialize the security layer
00084   hr = CoInitializeSecurity (
00085           NULL,
00086           -1,
00087           NULL,
00088           NULL,
00089           RPC_C_AUTHN_LEVEL_CONNECT,
00090           RPC_C_IMP_LEVEL_IMPERSONATE,
00091           NULL,
00092           0,
00093           NULL);
00094   if (FAILED(hr))
00095     {
00096     Message(TEXT("Client: CoInitializeSecurity"), hr);
00097     exit(hr);
00098     }
00099
00100     // allow a machine-name as the command-line argument
00101     if (argc > 1)
00102         {
00103         MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, argv[1], -1,
00104             wsz, MAX_PATH);
00105     memset (&csi, 0, sizeof (csi));
00106         csi.pwszName = wsz;
00107         pcsi = &csi;
00108         }
00109
00110   // get the class factory for CObject on the argv[1] machine
00111   hr = CoGetClassObject (CLSID_CObject, CLSCTX_SERVER, pcsi,
00112               IID_IClassFactory, (LPVOID*)&pcf);
00113   if (FAILED(hr))
00114     Message(TEXT("Client: CoGetClassObject"), hr);
00115   else
00116     {
00117         LPUNKNOWN   punk = NULL;
00118
00119       // create a remote instance of the object
00120       Message(TEXT("Client: Creating Instance..."), S_OK);
00121       hr = pcf->CreateInstance(NULL, IID_IUnknown, (LPVOID*)&punk);
00122       if (FAILED(hr))
00123           Message(TEXT("Client: CoCreateInstanceEx"), hr);
00124       else
00125           {
00126       // wait until the user wants us to release the object
00127       Message(TEXT("Client: Press any key to release object..."), S_OK);
00128       getch();
00129
00130           // let go of the object
00131           punk->Release();
00132           }
00133     pcf->Release();
00134     }
00135     CoUninitialize();
00136     Message(TEXT("Client: Done"), S_OK);
00137 }  // main
00138
00139 // EOF =======================================================================
00140
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/SearchDirectionEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

SearchDirectionEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: SearchDirectionEnum
00019
00020 public class SearchDirectionEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adSearchForward = 1;
00023   public static final short adSearchBackward = -1;
00024 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/StructuredStorage/Propsets/stgcreatepropsetstg.cpp Source File

  • Com
  • StructuredStorage
  • Propsets

stgcreatepropsetstg.cpp

Go to the documentation of this file.
00001
00002 //+============================================================================
00003 //
00004 //  StgCreatePropSetStg.cpp
00005 //
00006 //  This sample shows how the StgCreatePropSetStg API can be used
00007 //  to create an IPropertySetStorage on top of any given IStorage.
00008 //  This API is new to Windows 2000 Professional.
00009 //
00010 //  To Build:   cl /GX StgCreatePropSetStg.cpp
00011 //
00012 //+============================================================================
00013
00014
00015 #define UNICODE
00016 #define _UNICODE
00017 #define WIN32_LEAN_AND_MEAN
00018
00019 #include <stdio.h>
00020 #include <windows.h>
00021 #include <ole2.h>
00022
00023 #pragma comment( lib, "ole32.lib" )
00024
00025 IPropertyStorage*
00026 CreatePropertySetInStorage( IStorage *pStg, const FMTID &fmtid )
00027 {
00028     HRESULT hr = S_OK;
00029     IPropertySetStorage *pPropSetStg = NULL;
00030     IPropertyStorage *pPropStg = NULL;
00031
00032     try
00033     {
00034         hr = StgCreatePropSetStg( pStg, 0 /*reserved*/, &pPropSetStg );
00035         if( FAILED(hr) ) throw L"Failed StgCreatePropSetStg (%08x)";
00036
00037         hr = pPropSetStg->Create( fmtid, NULL,
00038             PROPSETFLAG_DEFAULT,
00039             STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
00040             &pPropStg );
00041         if( FAILED(hr) ) throw L"Failed IPropertySetStorage::Create (%08x)";
00042
00043         // Success.  The caller must now call Release on pPropStg
00044     }
00045     catch( const WCHAR *pwszError )
00046     {
00047         wprintf( L"Error: %s (%08x)\n", pwszError, hr );
00048     }
00049
00050     if( NULL != pPropSetStg )
00051         pPropSetStg->Release();
00052
00053     return( pPropStg );
00054 }
00055
00056
00057 extern "C" void wmain()
00058 {
00059     HRESULT hr = S_OK;
00060     IStorage *pStg = NULL;
00061     IPropertyStorage *pPropStg = NULL;
00062
00063     try
00064     {
00065         // Create an object with an IStorage interface.  It is not necessary
00066         // that it be a system-provided storage, such as what is obtained by
00067         // this call.  Any object implementing IStorage will do.
00068
00069         hr = StgCreateStorageEx( NULL,  // Just create a temporary storage
00070                                  STGM_CREATE
00071                                     | STGM_READWRITE
00072                                     | STGM_SHARE_EXCLUSIVE,
00073                                  STGFMT_STORAGE,
00074                                  0, NULL, NULL,
00075                                  IID_IStorage,
00076                                  reinterpret_cast<void**>(&pStg) );
00077         if( FAILED(hr) ) throw L"Failed StgCreateStorageEx";
00078
00079         // Now get and use an IPropertySetStorage representing this IStorage.
00080
00081         pPropStg = CreatePropertySetInStorage( pStg, FMTID_SummaryInformation );
00082         if( NULL == pPropStg ) throw L"Failed CreatePropertySetInStorage";
00083
00084         //-----
00085         // Here we could call IPropertyStorage methods such as WriteMultiple and
00086         // ReadMultiple using the pPropStg pointer.
00087         //-----
00088
00089         printf( "Success\n" );
00090     }
00091     catch( const WCHAR *pwszError )
00092     {
00093         wprintf( L"Error: %s (%08x)\n", pwszError, hr );
00094     }
00095
00096     if( NULL != pPropStg )
00097         pPropStg->Release();
00098     if( NULL != pStg )
00099         pStg->Release();
00100
00101 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SIndexedDisk Member List

This is the complete list of members for SIndexedDisk, including all inherited members.
HrInit(IUnknown *punkDiskIn) | SIndexedDisk |
idxDisk | SIndexedDisk |
punkDisk | SIndexedDisk |
SIndexedDisk(void) | SIndexedDisk | [inline]
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/Local/Sta/SServer.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • Local
  • Sta

SServer.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define _WIN32_WINNT 0x0400
00018 #include <stdio.h>
00019 #include <tchar.h>
00020 #include <windows.h>
00021 #include <WindowsX.h>
00022
00023 #include <initguid.h>
00024
00025
00026 // {37824811-ADBA-11d1-B6FB-00A024A85A1F}
00027 DEFINE_GUID(CLSID_STACancelObject, 0x37824811, 0xadba, 0x11d1, 0xb6, 0xfb, 0x0, 0xa0, 0x24, 0xa8, 0x5a, 0x1f);
00028
00029
00030 typedef struct tagCONSOLEDATA
00031 {
00032   int x;
00033   int y;
00034 } CONSOLEDATA;
00035
00036 CONSOLEDATA g_ConsoleData;
00037
00038 // %%Classes: ----------------------------------------------------------------
00039
00040 // simple class-factory: only knows how to create CSimpleObject instances
00041 class CClassFactory : public IClassFactory
00042 {
00043   public:
00044     // IUnknown
00045     STDMETHODIMP    QueryInterface (REFIID riid, void** ppv);
00046     STDMETHODIMP_(ULONG) AddRef(void)  { return 2; };
00047     STDMETHODIMP_(ULONG) Release(void) { return 1; }
00048
00049     // IClassFactory
00050     STDMETHODIMP    CreateInstance (LPUNKNOWN punkOuter, REFIID iid, void **ppv);
00051     STDMETHODIMP    LockServer (BOOL fLock) {
00052     if (fLock)
00053       CoAddRefServerProcess();
00054     else
00055     {
00056       if (!CoReleaseServerProcess())
00057       {
00058         PostThreadMessage(GetCurrentThreadId(), WM_QUIT, 0, 0);
00059       }
00060     }
00061     return S_OK;
00062   }
00063
00064     CClassFactory()  { }
00065
00066   private:
00067     };
00068
00069 class CSimpleObject : public IPersist
00070 {
00071   public:
00072     // IUnknown
00073     STDMETHODIMP    QueryInterface (REFIID iid, void **ppv);
00074     STDMETHODIMP_(ULONG) AddRef(void)  {InterlockedIncrement(&m_cRef);return m_cRef;}
00075     STDMETHODIMP_(ULONG) Release(void) {
00076     if (InterlockedDecrement(&m_cRef) == 0)
00077     { delete this; return 0;}
00078     else
00079       return m_cRef;
00080   }
00081
00082     // IPersist
00083     STDMETHODIMP    GetClassID(CLSID *pClsID);
00084
00085     // constructors/destructors
00086     CSimpleObject()     {
00087     m_cRef = 1; xy.X = 0; xy.Y = (short)g_ConsoleData.y;
00088     hConsole = CreateFile(TEXT("CONOUT$"), GENERIC_READ|GENERIC_WRITE,
00089       FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
00090     if (INVALID_HANDLE_VALUE == hConsole)
00091       hConsole = 0;
00092     CoAddRefServerProcess();
00093   }
00094     ~CSimpleObject()    { if (hConsole) CloseHandle(hConsole);
00095       if (!CoReleaseServerProcess())
00096       {
00097         PostThreadMessage(GetCurrentThreadId(), WM_QUIT, 0, 0);
00098       }
00099   }
00100     STDMETHODIMP    WasteTime(TCHAR *szMessage);
00101
00102   private:
00103     LONG        m_cRef;
00104   COORD       xy;
00105   HANDLE hConsole;
00106
00107     };
00108
00109 // %%Globals: ----------------------------------------------------------------
00110
00111 CClassFactory   g_ClassFactory;
00112
00113 // ---------------------------------------------------------------------------
00114 // %%Function: Message
00115 //
00116 //  Formats and displays a message to the console.
00117 // ---------------------------------------------------------------------------
00118 void
00119 Message(LPTSTR szPrefix, HRESULT hr)
00120 {
00121     LPTSTR   szMessage;
00122   TCHAR szDisplay[1000];
00123
00124     if (hr == S_OK)
00125         {
00126     _stprintf(szDisplay, TEXT("%s"), szPrefix);
00127     MessageBox(0, szDisplay, TEXT("Msg"),MB_SERVICE_NOTIFICATION);
00128         return;
00129         }
00130
00131     if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
00132         hr = HRESULT_CODE(hr);
00133
00134     FormatMessage(
00135         FORMAT_MESSAGE_ALLOCATE_BUFFER |
00136         FORMAT_MESSAGE_FROM_SYSTEM,
00137         NULL,
00138         hr,
00139         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00140         (LPTSTR)&szMessage,
00141         0,
00142         NULL );
00143
00144     _stprintf(szDisplay, TEXT("%s: %s(%lx)"), szPrefix, szMessage, hr);
00145   MessageBox(0, szDisplay, TEXT("Service:Msg"),MB_SERVICE_NOTIFICATION);
00146     LocalFree(szMessage);
00147 }  // Message
00148
00149
00150 // ---------------------------------------------------------------------------
00151 // %%Function: CSimpleObject::QueryInterface
00152 // ---------------------------------------------------------------------------
00153  STDMETHODIMP
00154 CSimpleObject::QueryInterface(REFIID riid, void** ppv)
00155 {
00156     if (ppv == NULL)
00157         return E_INVALIDARG;
00158     *ppv = NULL;
00159     if (riid == IID_IUnknown || riid == IID_IPersist)
00160     {
00161         *ppv =  this;
00162         ((IUnknown*)*ppv)->AddRef();
00163         return S_OK;
00164   }
00165
00166     return E_NOINTERFACE;
00167 }  // CSimpleObject::QueryInterface
00168
00169 STDMETHODIMP Busy(HANDLE hConsole, COORD& xy, int nIter)
00170 {
00171   HRESULT hr = S_OK;
00172   SetConsoleCursorPosition(hConsole, xy);
00173   TCHAR *szMessage = TEXT("!!!Call cancelled!!!");
00174   TCHAR *szBuf[4]={TEXT("|"), TEXT("/"), TEXT("-"), TEXT("\\")};
00175   for (int i = 0; i < nIter; i++)
00176   {
00177     Sleep(5);
00178     WriteConsole(hConsole, szBuf[0], 1, NULL, NULL);
00179     SetConsoleCursorPosition(hConsole, xy);
00180     WriteConsole(hConsole, szBuf[1], 1, NULL, NULL);
00181     SetConsoleCursorPosition(hConsole, xy);
00182     WriteConsole(hConsole, szBuf[2], 1, NULL, NULL);
00183     SetConsoleCursorPosition(hConsole, xy);
00184     WriteConsole(hConsole, szBuf[3], 1, NULL, NULL);
00185     SetConsoleCursorPosition(hConsole, xy);
00186     if (RPC_E_CALL_CANCELED == CoTestCancel())
00187     {
00188       hr = RPC_E_CALL_CANCELED;
00189       WriteConsole(hConsole, szMessage, lstrlen(szMessage), NULL, NULL);
00190       break;
00191     }
00192   }
00193   return hr;
00194 }
00195
00196 STDMETHODIMP
00197 CSimpleObject::WasteTime(TCHAR *szMessage)
00198 {
00199   if (hConsole)
00200   {
00201     SetConsoleCursorPosition(hConsole, xy);
00202     WriteConsole(hConsole, szMessage, lstrlen(szMessage), NULL, NULL);
00203     xy.X += 50;
00204     return Busy(hConsole, xy, 5000);
00205   }
00206   return S_OK;
00207 }
00208
00209
00210 STDMETHODIMP
00211 CSimpleObject::GetClassID(CLSID *pClsID)
00212 {
00213   UNREFERENCED_PARAMETER(pClsID);
00214   MessageBeep(0);
00215   xy.X = 0;
00216   return WasteTime(TEXT("In Call                               "));
00217 }
00218
00219 // ---------------------------------------------------------------------------
00220 // %%Function: CClassFactory::QueryInterface
00221 // ---------------------------------------------------------------------------
00222  STDMETHODIMP
00223 CClassFactory::QueryInterface(REFIID riid, void** ppv)
00224 {
00225     if (ppv == NULL)
00226         return E_INVALIDARG;
00227     if (riid == IID_IClassFactory || riid == IID_IUnknown)
00228         {
00229         *ppv = (IClassFactory *) this;
00230         AddRef();
00231         return S_OK;
00232         }
00233     *ppv = NULL;
00234     return E_NOINTERFACE;
00235 }  // CClassFactory::QueryInterface
00236
00237 // ---------------------------------------------------------------------------
00238 // %%Function: CClassFactory::CreateInstance
00239 // ---------------------------------------------------------------------------
00240
00241  STDMETHODIMP
00242 CClassFactory::CreateInstance(LPUNKNOWN punkOuter, REFIID riid, void** ppv)
00243 {
00244   HRESULT hr=S_OK;
00245     *ppv = NULL;
00246   CSimpleObject *p;
00247
00248     if (punkOuter != NULL)
00249         return CLASS_E_NOAGGREGATION;
00250   g_ConsoleData.y++;
00251   p = new CSimpleObject;
00252     if (p == NULL)
00253         return E_OUTOFMEMORY;
00254   if (RPC_E_CALL_CANCELED == p->WasteTime(TEXT("Creating Object")))
00255   {
00256     p->Release();
00257     return hr;
00258   }
00259     hr = p->QueryInterface(riid, ppv);
00260   p->Release();
00261   return hr;
00262 }  // CClassFactory::CreateInstance
00263
00264
00265
00266 void main()
00267 {
00268     HRESULT hr;
00269     DWORD   dwRegister;
00270
00271     // initialize COM for free-threading
00272     hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00273   if (FAILED(hr))
00274     {
00275         Message(TEXT("Server: CoInitializeEx Error"), hr);
00276         exit(-1);
00277     }
00278
00279   hr = CoInitializeSecurity(
00280       NULL,
00281       -1,
00282       NULL,
00283       NULL,
00284       RPC_C_AUTHN_LEVEL_NONE,
00285       RPC_C_IMP_LEVEL_IMPERSONATE,
00286       NULL,
00287       EOAC_NONE,
00288       NULL);
00289     if (FAILED(hr))
00290         {
00291     CoUninitialize();
00292         Message(TEXT("Client: CoInitializeSecurity Error"), hr);
00293         exit(hr);
00294         }
00295   // register the class-object with OLE
00296     hr = CoRegisterClassObject(CLSID_STACancelObject, &g_ClassFactory,
00297         CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &dwRegister);
00298
00299   if (FAILED(hr))
00300     {
00301     CoUninitialize();
00302         Message(TEXT("Server: CoRegisterClassObject Error"), hr);
00303         exit(-1);
00304     }
00305
00306   MSG msg;
00307   while (GetMessage(&msg, NULL, NULL, 0))
00308   {
00309     TranslateMessage(&msg);
00310     DispatchMessage(&msg);
00311   }
00312   hr = CoRevokeClassObject(dwRegister);
00313   if (FAILED(hr))
00314     {
00315     CoUninitialize();
00316         Message(TEXT("Server: CoRevokeClassObject Error"), hr);
00317         exit(-1);
00318     }
00319     CoUninitialize();
00320     _tprintf(TEXT("Server: Done"));
00321 }  // main
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptServe/Factory.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptServe

Factory.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.H
00003
00004   Summary:   Include file for the class factory COM objects: CFCar,
00005              CFUtilityCar, and CFCruiseCar. These constitute the APTSERVE
00006              server's Class Factories for those COM components.
00007
00008              The multiple interface COM Object Classes are achieved via
00009              the technique of nested classes: the implementation of the
00010              IClassFactory interfaces are nested inside of the class
00011              factory COM object classes.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial APTSERVE.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the module's source code.
00017
00018   Classes:   CFCar, CFUtilityCar, CFCruiseCar.
00019
00020   Functions: .
00021
00022   Origin:    3-20-96: atrent - Editor-inheritance from FACTORY.H in
00023                the LOCSERVE Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 #if !defined(FACTORY_H)
00041 #define FACTORY_H
00042
00043 #ifdef __cplusplus
00044
00045 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00046   ObjectClass: CFCar
00047
00048   Summary:     Class Factory COM Object Class for Car COM components.
00049                Used to manufacture COCar COM objects.  The mulitple
00050                interfaces on this COM object class are constructed via
00051                the nested interface classes technique.
00052
00053   Interfaces:  IUnknown
00054                  Standard interface providing COM object features.
00055                IClassFactory
00056                  Standard interface providing COM Class Factory features.
00057
00058   Aggregation: Yes, CFCar COM objects are aggregatable by
00059                passing a non-NULL pUnkOuter IUnknown pointer into the
00060                constructor.
00061 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00062 class CFCar : public IUnknown
00063 {
00064   public:
00065     // Main Object Constructor & Destructor.
00066     CFCar(IUnknown* pUnkOuter, CServer* pServer);
00067     ~CFCar(void);
00068
00069     // IUnknown methods. Main object, non-delegating.
00070     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00071     STDMETHODIMP_(ULONG) AddRef(void);
00072     STDMETHODIMP_(ULONG) Release(void);
00073
00074   private:
00075     // We declare nested class interface implementations here.
00076
00077     // We implement the IClassFactory interface (ofcourse) in this class
00078     // factory COM object class.
00079     class CImpIClassFactory : public IClassFactory
00080     {
00081       public:
00082         // Interface Implementation Constructor & Destructor.
00083         CImpIClassFactory(
00084           CFCar* pBackObj,
00085           IUnknown* pUnkOuter,
00086           CServer* pServer);
00087         ~CImpIClassFactory(void);
00088
00089         // IUnknown methods.
00090         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00091         STDMETHODIMP_(ULONG) AddRef(void);
00092         STDMETHODIMP_(ULONG) Release(void);
00093
00094         // IClassFactory methods.
00095         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00096         STDMETHODIMP         LockServer(BOOL);
00097
00098       private:
00099         // Data private to this interface implementation of IClassFactory.
00100         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00101         CFCar*        m_pBackObj;    // Parent Object back pointer.
00102         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00103         CServer*      m_pServer;     // Server's control object.
00104     };
00105
00106     // Make the otherwise private and nested IClassFactory interface
00107     // implementation a friend to COM object instantiations of this
00108     // selfsame CFCar COM object class.
00109     friend CImpIClassFactory;
00110
00111     // Private data of CFCar COM objects.
00112
00113     // Nested IClassFactory implementation instantiation.
00114     CImpIClassFactory m_ImpIClassFactory;
00115
00116     // Main Object reference count.
00117     ULONG             m_cRefs;
00118
00119     // Outer unknown (aggregation & delegation). Used when this
00120     // CFCar object is being aggregated.  Otherwise it is used
00121     // for delegation if this object is reused via containment.
00122     IUnknown*         m_pUnkOuter;
00123
00124     // Pointer to this component server's control object.
00125     CServer*          m_pServer;
00126 };
00127
00128 typedef CFCar* PCFCar;
00129
00130
00131 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00132   ObjectClass: CFUtilityCar
00133
00134   Summary:     Class Factory COM Object Class for UtilityCar COM
00135                components.  Used to manufacture COUtilityCar COM
00136                objects.  The mulitple interfaces on this COM object
00137                class are constructed via the nested interface
00138                classes technique.
00139
00140   Interfaces:  IUnknown
00141                  Standard interface providing COM object features.
00142                IClassFactory
00143                  Standard interface providing COM Class Factory features.
00144
00145   Aggregation: Yes, CFUtilityCar COM objects are aggregatable by
00146                passing a non-NULL pUnkOuter IUnknown pointer into the
00147                constructor.
00148 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00149 class CFUtilityCar : public IUnknown
00150 {
00151   public:
00152     // Main Object Constructor & Destructor.
00153     CFUtilityCar(IUnknown* pUnkOuter, CServer* pServer);
00154     ~CFUtilityCar(void);
00155
00156     // A general method for initializing a newly created CFUtilityCar.
00157     HRESULT Init(void);
00158
00159     // IUnknown methods. Main object, non-delegating.
00160     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00161     STDMETHODIMP_(ULONG) AddRef(void);
00162     STDMETHODIMP_(ULONG) Release(void);
00163
00164   private:
00165     // We declare nested class interface implementations here.
00166
00167     // We implement the IClassFactory interface (ofcourse) in this class
00168     // factory COM object class.
00169     class CImpIClassFactory : public IClassFactory
00170     {
00171       public:
00172         // Interface Implementation Constructor & Destructor.
00173         CImpIClassFactory(
00174           CFUtilityCar* pBackObj,
00175           IUnknown* pUnkOuter,
00176           CServer* pServer);
00177         ~CImpIClassFactory(void);
00178
00179         // IUnknown methods.
00180         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00181         STDMETHODIMP_(ULONG) AddRef(void);
00182         STDMETHODIMP_(ULONG) Release(void);
00183
00184         // IClassFactory methods.
00185         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00186         STDMETHODIMP         LockServer(BOOL);
00187
00188       private:
00189         // Data private to this interface implementation of IClassFactory.
00190         ULONG            m_cRefI;       // Interface Ref Count (debugging).
00191         CFUtilityCar*    m_pBackObj;    // Parent Object back pointer.
00192         IUnknown*        m_pUnkOuter;   // Outer unknown for Delegation.
00193         CServer*         m_pServer;     // Server Control Object.
00194     };
00195
00196     // Make the otherwise private and nested IClassFactory interface
00197     // implementation a friend to COM object instantiations of this
00198     // selfsame CFUtilityCar COM object class.
00199     friend CImpIClassFactory;
00200
00201     // Private data of CFUtilityCar COM objects.
00202
00203     // Nested IClassFactory implementation instantiation.
00204     CImpIClassFactory m_ImpIClassFactory;
00205
00206     // Main Object reference count.
00207     ULONG             m_cRefs;
00208
00209     // Outer unknown (aggregation & delegation). Used when this
00210     // CFUtilityCar object is being aggregated.  Otherwise it is used
00211     // for delegation if this object is reused via containment.
00212     IUnknown*         m_pUnkOuter;
00213
00214     // Pointer to this component server's control object.
00215     CServer*          m_pServer;
00216 };
00217
00218 typedef CFUtilityCar* PCFUtilityCar;
00219
00220
00221 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00222   ObjectClass: CFCruiseCar
00223
00224   Summary:     Class Factory COM Object Class for CruiseCar COM
00225                components.  Used to manufacture COCruiseCar COM objects.
00226                The mulitple interfaces on this COM object class are
00227                constructed via the nested interface classes technique.
00228
00229   Interfaces:  IUnknown
00230                  Standard interface providing COM object features.
00231                IClassFactory
00232                  Standard interface providing COM Class Factory features.
00233
00234   Aggregation: Yes, CFCruiseCar COM objects are aggregatable by
00235                passing a non-NULL pUnkOuter IUnknown pointer into the
00236                constructor.
00237 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00238 class CFCruiseCar : public IUnknown
00239 {
00240   public:
00241     // Main Object Constructor & Destructor.
00242     CFCruiseCar(IUnknown* pUnkOuter, CServer* pServer);
00243     ~CFCruiseCar(void);
00244
00245     // A general method for initializing a newly created CFCruiseCar.
00246     HRESULT Init(void);
00247
00248     // IUnknown methods. Main object, non-delegating.
00249     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00250     STDMETHODIMP_(ULONG) AddRef(void);
00251     STDMETHODIMP_(ULONG) Release(void);
00252
00253   private:
00254     // We declare nested class interface implementations here.
00255
00256     // We implement the IClassFactory interface (ofcourse) in this class
00257     // factory COM object class.
00258     class CImpIClassFactory : public IClassFactory
00259     {
00260       public:
00261         // Interface Implementation Constructor & Destructor.
00262         CImpIClassFactory(
00263           CFCruiseCar* pBackObj,
00264           IUnknown* pUnkOuter,
00265           CServer* pServer);
00266         ~CImpIClassFactory(void);
00267
00268         // IUnknown methods.
00269         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00270         STDMETHODIMP_(ULONG) AddRef(void);
00271         STDMETHODIMP_(ULONG) Release(void);
00272
00273         // IClassFactory methods.
00274         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00275         STDMETHODIMP         LockServer(BOOL);
00276
00277       private:
00278         // Data private to this interface implementation of IClassFactory.
00279         ULONG            m_cRefI;       // Interface Ref Count (debugging).
00280         CFCruiseCar*     m_pBackObj;    // Parent Object back pointer.
00281         IUnknown*        m_pUnkOuter;   // Outer unknown for Delegation.
00282         CServer*         m_pServer;     // Server Control Object.
00283     };
00284
00285     // Make the otherwise private and nested IClassFactory interface
00286     // implementation a friend to COM object instantiations of this
00287     // selfsame CFCruiseCar COM object class.
00288     friend CImpIClassFactory;
00289
00290     // Private data of CFCruiseCar COM objects.
00291
00292     // Nested IClassFactory implementation instantiation.
00293     CImpIClassFactory m_ImpIClassFactory;
00294
00295     // Main Object reference count.
00296     ULONG             m_cRefs;
00297
00298     // Outer unknown (aggregation & delegation). Used when this
00299     // CFCruiseCar object is being aggregated.  Otherwise it is used
00300     // for delegation if this object is reused via containment.
00301     IUnknown*         m_pUnkOuter;
00302
00303     // Pointer to this component server's control object.
00304     CServer*          m_pServer;
00305 };
00306
00307 typedef CFCruiseCar* PCFCruiseCar;
00308
00309 #endif // __cplusplus
00310
00311
00312 #endif // FACTORY_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConServe/Factory.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ConServe

Factory.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.H
00003
00004   Summary:   Include file for the class factory COM object: CFBall. This
00005              constitutes the CONSERVE server's class factory for this COM
00006              component.
00007
00008              The multiple interface COM Object Classe is achieved via
00009              the technique of nested classes: the implementation of the
00010              IClassFactory interface is nested inside of the class
00011              factory COM object class.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial CONSERVE.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the module's source code.
00017
00018   Classes:   CFBall.
00019
00020   Functions: .
00021
00022   Origin:    5-30-96: atrent - Editor-inheritance from FACTORY.H in
00023                the FRESERVE Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 #if !defined(FACTORY_H)
00041 #define FACTORY_H
00042
00043 #ifdef __cplusplus
00044
00045 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00046   ObjectClass: CFBall
00047
00048   Summary:     Class Factory COM Object Class for DllSndBall COM
00049                components. Used to manufacture COBall COM objects.  The
00050                mulitple interfaces on this COM object class are
00051                constructed via the nested interface classes technique.
00052
00053   Interfaces:  IUnknown
00054                  Standard interface providing COM object features.
00055                IClassFactory
00056                  Standard interface providing COM Class Factory features.
00057
00058   Aggregation: Yes, CFBall COM objects are aggregatable by
00059                passing a non-NULL pUnkOuter IUnknown pointer into the
00060                constructor.
00061 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00062 class CFBall : public IUnknown, public CThreaded
00063 {
00064   public:
00065     // Main Object Constructor & Destructor.
00066     CFBall(IUnknown* pUnkOuter, CServer* pServer);
00067     ~CFBall(void);
00068
00069     // IUnknown methods. Main object, non-delegating.
00070     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00071     STDMETHODIMP_(ULONG) AddRef(void);
00072     STDMETHODIMP_(ULONG) Release(void);
00073
00074     // We declare nested class interface implementations here.
00075
00076     // We implement the IClassFactory interface (ofcourse) in this class
00077     // factory COM object class.
00078     class CImpIClassFactory : public IClassFactory, public CThreaded
00079     {
00080       public:
00081         // Interface Implementation Constructor & Destructor.
00082         CImpIClassFactory(
00083           CFBall* pBackObj,
00084           IUnknown* pUnkOuter,
00085           CServer* pServer);
00086         ~CImpIClassFactory(void);
00087
00088         // IUnknown methods.
00089         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00090         STDMETHODIMP_(ULONG) AddRef(void);
00091         STDMETHODIMP_(ULONG) Release(void);
00092
00093         // IClassFactory methods.
00094         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00095         STDMETHODIMP         LockServer(BOOL);
00096
00097       private:
00098         // Data private to this interface implementation of IClassFactory.
00099         CFBall*       m_pBackObj;    // Parent Object back pointer.
00100         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00101         CServer*      m_pServer;     // Server's control object.
00102     };
00103
00104     // Make the otherwise private and nested IClassFactory interface
00105     // implementation a friend to COM object instantiations of this
00106     // selfsame CFBall COM object class.
00107     friend CImpIClassFactory;
00108
00109   private:
00110     // Private data of CFBall COM objects.
00111
00112     // Nested IClassFactory implementation instantiation.
00113     CImpIClassFactory m_ImpIClassFactory;
00114
00115     // Main Object reference count.
00116     ULONG             m_cRefs;
00117
00118     // Outer unknown (aggregation & delegation). Used when this
00119     // CFBall object is being aggregated.  Otherwise it is used
00120     // for delegation if this object is reused via containment.
00121     IUnknown*         m_pUnkOuter;
00122
00123     // Pointer to this component server's control object.
00124     CServer*          m_pServer;
00125 };
00126
00127 typedef CFBall* PCFBall;
00128
00129
00130 #endif // __cplusplus
00131
00132
00133 #endif // FACTORY_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/ComSpyproppage.Cpp Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

ComSpyproppage.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "stdafx.h"
00018 #include "ComSpyCtl.h"
00019 #include "ComSpyAudit.h"
00020 #include "CComSpy.h"
00021 #include "ComSpyPropPage.h"
00022 #include "comsvcs.h"
00023 #include "AppInfo.h"
00024
00025 TCHAR * szColNames[] =
00026 {
00027   _T("Count"),
00028   _T("Event"),
00029   _T("TickCount"),
00030   _T("Application"),
00031   _T("Parameter"),
00032   _T("Value")
00033 };
00034 /////////////////////////////////////////////////////////////////////////////
00035 // CComSpyPropPage
00036
00037 LRESULT CComSpyPropPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00038 {
00039
00040   bHandled = FALSE;
00041
00042   m_ppUnk[0]->QueryInterface(IID_IComSpy, (void**)&m_pSpy);
00043   _ASSERTE(m_pSpy);
00044   CComBSTR bstr;
00045   m_pSpy -> get_LogFile(&bstr);
00046   SetDlgItemText(IDC_LOG_FILE, bstr);
00047
00048   // grid lines
00049   BOOL bVal;
00050   m_pSpy -> get_ShowGridLines(&bVal);
00051   SendDlgItemMessage(IDC_SHOW_GRID_LINES, BM_SETCHECK,  (bVal) ? BST_CHECKED : BST_UNCHECKED);
00052
00053   // show on screen
00054   m_pSpy -> get_ShowOnScreen(&bVal);
00055   SendDlgItemMessage(IDC_SHOW_ON_SCREEN, BM_SETCHECK,  (bVal) ? BST_CHECKED : BST_UNCHECKED);
00056
00057   // log to file
00058   m_pSpy -> get_LogToFile(&bVal);
00059   SendDlgItemMessage(IDC_LOG_TO_FILE, BM_SETCHECK,  (bVal) ? BST_CHECKED : BST_UNCHECKED);
00060
00061   int i;
00062   for (i=0;i<sizeof(szColNames)/sizeof(szColNames[0]);i++)
00063     SendDlgItemMessage(IDC_COLUMN_NAMES, CB_ADDSTRING, 0, (LPARAM)(LPTSTR)szColNames[i]);
00064
00065
00066   SendDlgItemMessage(IDC_COLUMN_NAMES, CB_SETCURSEL, 0, 0);
00067   BOOL bH;
00068   OnSelectColumn(CBN_SELCHANGE, 0,0, bH);
00069   return 0;
00070 }
00071
00072 LRESULT CComSpyPropPage::OnSelectColumn(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00073 {
00074   if (wNotifyCode == CBN_SELCHANGE)
00075   {
00076     int nSel = SendDlgItemMessage(IDC_COLUMN_NAMES, CB_GETCURSEL, 0, 0L);
00077     if (nSel != CB_ERR)
00078     {
00079       // get the width
00080
00081       long lWidth;
00082       _ASSERTE(m_pSpy);
00083       m_pSpy -> get_ColWidth(nSel, &lWidth);
00084       SetDlgItemInt(IDC_WIDTH, lWidth);
00085     }
00086
00087   }
00088
00089   return 0;
00090 }
00091
00092
00093 STDMETHODIMP CComSpyPropPage::Apply()
00094 {
00095   ATLTRACE(_T("CComSpyPropPage::Apply\n"));
00096   for (UINT i = 0; i < m_nObjects; i++)
00097   {
00098
00099     CComQIPtr<IComSpy, &IID_IComSpy> pSpy(m_ppUnk[i]);
00100     BSTR bstr;
00101     GetDlgItemText(IDC_LOG_FILE, bstr);
00102     pSpy -> put_LogFile(bstr);
00103     ::SysFreeString(bstr);
00104     // grid lines
00105     BOOL bVal = (SendDlgItemMessage(IDC_SHOW_GRID_LINES, BM_GETCHECK) == BST_CHECKED);
00106     pSpy -> put_ShowGridLines(bVal);
00107
00108     // log to file
00109     bVal = (SendDlgItemMessage(IDC_LOG_TO_FILE, BM_GETCHECK) == BST_CHECKED);
00110     pSpy -> put_LogToFile(bVal);
00111
00112     // show on screen
00113     bVal = (SendDlgItemMessage(IDC_SHOW_ON_SCREEN, BM_GETCHECK) == BST_CHECKED);
00114     pSpy -> put_ShowOnScreen(bVal);
00115
00116     int j;
00117     UINT nWidth;
00118     for (j=0;j<sizeof(szColNames)/sizeof(szColNames[0]);j++)
00119     {
00120
00121       nWidth = SendDlgItemMessage(IDC_COLUMN_NAMES, CB_GETITEMDATA, j) ;
00122       if (nWidth)
00123       {
00124         pSpy -> put_ColWidth(j,nWidth);
00125         SendDlgItemMessage(IDC_COLUMN_NAMES, CB_SETITEMDATA, j, 0);
00126       }
00127     }
00128
00129   }
00130   SetDirty(FALSE);
00131   m_bDirty = FALSE;
00132   return S_OK;
00133 }
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditCommands/EdCommands_p.c Source File

  • Web
  • Browser
  • EditCommands

EdCommands_p.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /* this ALWAYS GENERATED file contains the proxy stub code */
00006
00007
00008 /* File created by MIDL compiler version 5.01.0164 */
00009 /* at Thu Mar 09 14:21:17 2000
00010  */
00011 /* Compiler settings for C:\workshop\samples\browser\Copy of EditCommands\EdCommands.idl:
00012     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00013     error checks: allocation ref bounds_check enum stub_data
00014 */
00015 //@@MIDL_FILE_HEADING(  )
00016
00017 #define USE_STUBLESS_PROXY
00018
00019
00020 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00021 #ifndef __REDQ_RPCPROXY_H_VERSION__
00022 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00023 #endif
00024
00025
00026 #include "rpcproxy.h"
00027 #ifndef __RPCPROXY_H_VERSION__
00028 #error this stub requires an updated version of <rpcproxy.h>
00029 #endif // __RPCPROXY_H_VERSION__
00030
00031
00032 #include "EdCommands.h"
00033
00034 #define TYPE_FORMAT_STRING_SIZE   3
00035 #define PROC_FORMAT_STRING_SIZE   45
00036
00037 typedef struct _MIDL_TYPE_FORMAT_STRING
00038     {
00039     short          Pad;
00040     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00041     } MIDL_TYPE_FORMAT_STRING;
00042
00043 typedef struct _MIDL_PROC_FORMAT_STRING
00044     {
00045     short          Pad;
00046     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00047     } MIDL_PROC_FORMAT_STRING;
00048
00049
00050 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00051 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00052
00053
00054 /* Object interface: IUnknown, ver. 0.0,
00055    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IDispatch, ver. 0.0,
00059    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00060
00061
00062 /* Object interface: IBrowserHost, ver. 0.0,
00063    GUID={0xCED48A59,0xF923,0x43E7,{0xBB,0xF0,0x96,0x95,0x2F,0x45,0x52,0x36}} */
00064
00065
00066 extern const MIDL_STUB_DESC Object_StubDesc;
00067
00068
00069 extern const MIDL_SERVER_INFO IBrowserHost_ServerInfo;
00070
00071 #pragma code_seg(".orpc")
00072
00073 static const MIDL_STUB_DESC Object_StubDesc =
00074     {
00075     0,
00076     NdrOleAllocate,
00077     NdrOleFree,
00078     0,
00079     0,
00080     0,
00081     0,
00082     0,
00083     __MIDL_TypeFormatString.Format,
00084     1, /* -error bounds_check flag */
00085     0x20000, /* Ndr library version */
00086     0,
00087     0x50100a4, /* MIDL Version 5.1.164 */
00088     0,
00089     0,
00090     0,  /* notify & notify_flag routine table */
00091     1,  /* Flags */
00092     0,  /* Reserved3 */
00093     0,  /* Reserved4 */
00094     0   /* Reserved5 */
00095     };
00096
00097 static const unsigned short IBrowserHost_FormatStringOffsetTable[] =
00098     {
00099     (unsigned short) -1,
00100     (unsigned short) -1,
00101     (unsigned short) -1,
00102     (unsigned short) -1,
00103     0,
00104     22
00105     };
00106
00107 static const MIDL_SERVER_INFO IBrowserHost_ServerInfo =
00108     {
00109     &Object_StubDesc,
00110     0,
00111     __MIDL_ProcFormatString.Format,
00112     &IBrowserHost_FormatStringOffsetTable[-3],
00113     0,
00114     0,
00115     0,
00116     0
00117     };
00118
00119 static const MIDL_STUBLESS_PROXY_INFO IBrowserHost_ProxyInfo =
00120     {
00121     &Object_StubDesc,
00122     __MIDL_ProcFormatString.Format,
00123     &IBrowserHost_FormatStringOffsetTable[-3],
00124     0,
00125     0,
00126     0
00127     };
00128
00129 CINTERFACE_PROXY_VTABLE(9) _IBrowserHostProxyVtbl =
00130 {
00131     &IBrowserHost_ProxyInfo,
00132     &IID_IBrowserHost,
00133     IUnknown_QueryInterface_Proxy,
00134     IUnknown_AddRef_Proxy,
00135     IUnknown_Release_Proxy ,
00136     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00137     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00138     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00139     0 /* IDispatch_Invoke_Proxy */ ,
00140     (void *)-1 /* IBrowserHost::Run */ ,
00141     (void *)-1 /* IBrowserHost::Stop */
00142 };
00143
00144
00145 static const PRPC_STUB_FUNCTION IBrowserHost_table[] =
00146 {
00147     STUB_FORWARDING_FUNCTION,
00148     STUB_FORWARDING_FUNCTION,
00149     STUB_FORWARDING_FUNCTION,
00150     STUB_FORWARDING_FUNCTION,
00151     NdrStubCall2,
00152     NdrStubCall2
00153 };
00154
00155 CInterfaceStubVtbl _IBrowserHostStubVtbl =
00156 {
00157     &IID_IBrowserHost,
00158     &IBrowserHost_ServerInfo,
00159     9,
00160     &IBrowserHost_table[-3],
00161     CStdStubBuffer_DELEGATING_METHODS
00162 };
00163
00164 #pragma data_seg(".rdata")
00165
00166 #if !defined(__RPC_WIN32__)
00167 #error  Invalid build platform for this stub.
00168 #endif
00169
00170 #if !(TARGET_IS_NT40_OR_LATER)
00171 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00172 #error   -Oif or -Oicf, more than 32 methods in the interface.
00173 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00174 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00175 #endif
00176
00177
00178 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00179     {
00180         0,
00181         {
00182
00183   /* Procedure Run */
00184
00185       0x33,   /* FC_AUTO_HANDLE */
00186       0x6c,   /* Old Flags:  object, Oi2 */
00187 /*  2 */  NdrFcLong( 0x0 ), /* 0 */
00188 /*  6 */  NdrFcShort( 0x7 ),  /* 7 */
00189 #ifndef _ALPHA_
00190 /*  8 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00191 #else
00192       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00193 #endif
00194 /* 10 */  NdrFcShort( 0x0 ),  /* 0 */
00195 /* 12 */  NdrFcShort( 0x8 ),  /* 8 */
00196 /* 14 */  0x4,    /* Oi2 Flags:  has return, */
00197       0x1,    /* 1 */
00198
00199   /* Return value */
00200
00201 /* 16 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00202 #ifndef _ALPHA_
00203 /* 18 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00204 #else
00205       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00206 #endif
00207 /* 20 */  0x8,    /* FC_LONG */
00208       0x0,    /* 0 */
00209
00210   /* Procedure Stop */
00211
00212 /* 22 */  0x33,   /* FC_AUTO_HANDLE */
00213       0x6c,   /* Old Flags:  object, Oi2 */
00214 /* 24 */  NdrFcLong( 0x0 ), /* 0 */
00215 /* 28 */  NdrFcShort( 0x8 ),  /* 8 */
00216 #ifndef _ALPHA_
00217 /* 30 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00218 #else
00219       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00220 #endif
00221 /* 32 */  NdrFcShort( 0x0 ),  /* 0 */
00222 /* 34 */  NdrFcShort( 0x8 ),  /* 8 */
00223 /* 36 */  0x4,    /* Oi2 Flags:  has return, */
00224       0x1,    /* 1 */
00225
00226   /* Return value */
00227
00228 /* 38 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00229 #ifndef _ALPHA_
00230 /* 40 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00231 #else
00232       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00233 #endif
00234 /* 42 */  0x8,    /* FC_LONG */
00235       0x0,    /* 0 */
00236
00237       0x0
00238         }
00239     };
00240
00241 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00242     {
00243         0,
00244         {
00245       NdrFcShort( 0x0 ),  /* 0 */
00246
00247       0x0
00248         }
00249     };
00250
00251 const CInterfaceProxyVtbl * _EdCommands_ProxyVtblList[] =
00252 {
00253     ( CInterfaceProxyVtbl *) &_IBrowserHostProxyVtbl,
00254     0
00255 };
00256
00257 const CInterfaceStubVtbl * _EdCommands_StubVtblList[] =
00258 {
00259     ( CInterfaceStubVtbl *) &_IBrowserHostStubVtbl,
00260     0
00261 };
00262
00263 PCInterfaceName const _EdCommands_InterfaceNamesList[] =
00264 {
00265     "IBrowserHost",
00266     0
00267 };
00268
00269 const IID *  _EdCommands_BaseIIDList[] =
00270 {
00271     &IID_IDispatch,
00272     0
00273 };
00274
00275
00276 #define _EdCommands_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _EdCommands, pIID, n)
00277
00278 int __stdcall _EdCommands_IID_Lookup( const IID * pIID, int * pIndex )
00279 {
00280
00281     if(!_EdCommands_CHECK_IID(0))
00282         {
00283         *pIndex = 0;
00284         return 1;
00285         }
00286
00287     return 0;
00288 }
00289
00290 const ExtendedProxyFileInfo EdCommands_ProxyFileInfo =
00291 {
00292     (PCInterfaceProxyVtblList *) & _EdCommands_ProxyVtblList,
00293     (PCInterfaceStubVtblList *) & _EdCommands_StubVtblList,
00294     (const PCInterfaceName * ) & _EdCommands_InterfaceNamesList,
00295     (const IID ** ) & _EdCommands_BaseIIDList,
00296     & _EdCommands_IID_Lookup,
00297     1,
00298     2,
00299     0, /* table of [async_uuid] interfaces */
00300     0, /* Filler1 */
00301     0, /* Filler2 */
00302     0  /* Filler3 */
00303 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/suminfo.h Source File

  • Com
  • Fundamentals
  • OleStd

suminfo.h

Go to the documentation of this file.
00001 /*************************************************************************
00002 **
00003 **    OLE 2.0 Property Set Utilities
00004 **
00005 **    suminfo.h
00006 **
00007 **    This file contains file contains data structure defintions,
00008 **    function prototypes, constants, etc. for OLE 2.0 Property Set
00009 **    utilities used to manage the Summary Info property set.
00010 **
00011 **    (c) Copyright Microsoft Corp. 1990 - 2000 All Rights Reserved
00012 **
00013 *************************************************************************/
00014
00015 #ifndef SUMINFO_H
00016 #define SUMINFO_H
00017
00018 #include <ole2.h>
00019 #include <oleauto.h>
00020
00021 /* A SUMINFO variable is an instance of an abstract data type.  Thus,
00022 **    there can be an arbitrary number of SummaryInfo streams open
00023 **    simultaneously (subject to available memory).  Each variable must
00024 **    be initialized prior to use by calling Init and freed after its
00025 **    last use by calling Free.  The param argument to Init is reserved
00026 **    for future expansion and should be zero initially. Once a SUMINFO
00027 **    variable is allocated (by Init), the user can call the Set
00028 **    procedures to initialize fields.  A copy of the arguments is made
00029 **    in every case except SetThumbnail where control of the storage
00030 **    occupied by the METAFILEPICT is merely transferred.  When the
00031 **    Free routine is called, all storage will be deallocated including
00032 **    that of the thumbnail.  The arguments to SetThumbNail and the
00033 **    return values from GetThumbNail correspond to the OLE2.0 spec.
00034 **    Note that on input, the thumbnail is read on demand but all the
00035 **    other properties are pre-loaded.  The thumbnail is manipulated as
00036 **    a windows handle to a METAFILEPICT structure, which in turn
00037 **    contains a handle to the METAFILE.  The transferClip argument on
00038 **    GetThumbNail, when set to true, transfers responsibility for
00039 **    storage management of the thumbnail to the caller; that is, after
00040 **    Free has been called, the handle is still valid. Clear can be
00041 **    used to free storage for all the properties but then you must
00042 **    call Read to load them again.  All the code is based on FAR
00043 **    pointers.
00044 **    CoInitialize MUST be called PRIOR to calling OleStdInitSummaryInfo.
00045 **    Memory is allocated using the currently active IMalloc*
00046 **    allocator (as is returned by call CoGetMalloc(MEMCTX_TASK) ).
00047 **
00048 ** Common scenarios:
00049 **    Read SummaryInfo
00050 **    ----------------
00051 **      OleStdInitSummaryInfo()
00052 **      OleStdReadSummaryInfo()
00053 **      . . . . .
00054 **      call different Get routines
00055 **      . . . . .
00056 **      OleStdFreeSummaryInfo()
00057 **
00058 **    Create SummaryInfo
00059 **    ------------------
00060 **      OleStdInitSummaryInfo()
00061 **      call different Set routines
00062 **      OleStdWriteSummaryInfo()
00063 **      OleStdFreeSummaryInfo()
00064 **
00065 **    Update SummaryInfo
00066 **    ------------------
00067 **      OleStdInitSummaryInfo()
00068 **      OleStdReadSummaryInfo()
00069 **      OleStdGetThumbNailProperty(necessary only if no SetThumb)
00070 **      call different Set routines
00071 **      OleStdWriteSummaryInfo()
00072 **      OleStdFreeSummaryInfo()
00073 */
00074
00075 #define WORDMAX 256     //current string max for APPS; 255 + null terminator
00076
00077 typedef     union {
00078      short    iVal;             /* VT_I2                */
00079      long     lVal;             /* VT_I4                */
00080      float    fltVal;           /* VT_R4                */
00081      double       dblVal;       /* VT_R8                */
00082      DWORD bool;                /* VT_BOOL              */
00083      SCODE    scodeVal;         /* VT_ERROR             */
00084      DWORD    systimeVal;       /* VT_SYSTIME           */
00085      unsigned char bstrVal[WORDMAX]; /* VT_BSTR              */
00086    } VTUNION;
00087
00088 typedef struct _PROPSETLIST
00089    {
00090    FMTID formatID;
00091    DWORD byteOffset;
00092    } PROPSETLIST;
00093
00094 typedef struct _PROPIDLIST
00095    {
00096    DWORD propertyID;
00097    DWORD byteOffset;
00098    } PROPIDLIST;
00099
00100 typedef struct _PROPVALUE
00101    {
00102    DWORD vtType;
00103    VTUNION vtValue;
00104    } PROPVALUE;
00105
00106 typedef struct _SECTION
00107    {
00108    DWORD cBytes;
00109    DWORD cProperties;
00110    PROPIDLIST rgPropId[1/*cProperties*/];  //variable-length array
00111    PROPVALUE rgPropValue[1];      //CANNOT BE ACCESSED BY NAME; ONLY BY POINTER
00112    } SECTION;
00113
00114 typedef struct _SUMMARYINFO
00115    {
00116    WORD byteOrder;
00117    WORD formatVersion;
00118    WORD getOSVersion;
00119    WORD osVersion;
00120    CLSID classId;  //from compobj.h
00121    DWORD cSections;
00122    PROPSETLIST rgPropSet[1/*cSections*/]; //variable-length array
00123    SECTION rgSections[1/*cSections*/];    //CANNOT BE ACCESSED BY NAME; ONLY BY POINTER
00124    } SUMMARYINFO;
00125
00126 #define osWinOnDos 0
00127 #define osMac 1
00128 #define osWinNT 2
00129
00130 #define cPIDSI_STANDARD (PIDSI_DOC_SECURITY+1-2)
00131
00132 #ifndef WIN32
00133 #define MAXWORD 256         //maximum string size for APPS at present
00134 #endif
00135
00136 typedef struct _STDZ
00137    {
00138    DWORD vtType;
00139    union {
00140    DWORD vtByteCount;
00141    OLECHAR fill[4];  //use last byte as byte count for stz requests
00142    };
00143    OLECHAR rgchars[MAXWORD];
00144    } STDZ;
00145 #define VTCB fill[3]    //used to set/get the count byte when in memory
00146
00147 typedef struct _THUMB
00148    {
00149    DWORD vtType;
00150    DWORD cBytes;       //clip size in memory
00151    DWORD selector;     //on disk -1,win clip no.  -2,mac clip no. -3,ole FMTID  0,bytes  nameLength, format name
00152    DWORD clipFormat;
00153    LPOLESTR lpstzName;
00154    LPOLESTR lpByte;
00155    } THUMB;
00156
00157 #define VT_CF_BYTES 0
00158 #define VT_CF_WIN (-1)
00159 #define VT_CF_MAC (-2)
00160 #define VT_CF_FMTID (-3)
00161 #define VT_CF_NAME (-4)
00162 #define VT_CF_EMPTY (-5)
00163 #define VT_CF_OOM (-6)      // Out of memory
00164 typedef THUMB FAR *LPTHUMB;
00165
00166 typedef STDZ FAR *LPSTDZ;
00167
00168 typedef struct _TIME
00169    {
00170    DWORD vtType;
00171    FILETIME time;
00172    } TIME;
00173
00174 typedef struct _INTS
00175    {
00176    DWORD vtType;
00177    DWORD value;
00178    } INTS;
00179
00180 #define MAXTIME (PIDSI_LASTSAVE_DTM-PIDSI_EDITTIME+1)
00181 #define MAXINTS (PIDSI_CHARCOUNT-PIDSI_PAGECOUNT+1+1)
00182 #define MAXSTDZ (PIDSI_REVNUMBER-PIDSI_TITLE+1+1)
00183
00184 typedef struct _STANDARDSECINMEM
00185    {
00186    DWORD cBytes;
00187    DWORD cProperties;
00188    PROPIDLIST rgPropId[cPIDSI_STANDARD/*cProperties*/];  //variable-length array
00189    TIME rgTime[MAXTIME];
00190    INTS rgInts[MAXINTS];
00191    LPSTDZ rglpsz[MAXSTDZ];
00192    THUMB thumb;
00193    } STANDARDSECINMEM;
00194
00195
00196 #define OFFSET_NIL 0X00000000
00197
00198 #define AllSecurityFlagsEqNone 0
00199 #define fSecurityPassworded 1
00200 #define fSecurityRORecommended 2
00201 #define fSecurityRO 4
00202 #define fSecurityLockedForAnnotations 8
00203
00204 #define PropStreamNamePrefixByte '\005'
00205 #define PropStreamName "\005SummaryInformation"
00206 #define cbNewSummaryInfo(nSection) (sizeof(SUMMARYINFO)-sizeof(SECTION)+sizeof(PROPSETLIST)*((nSection)-1))
00207 #define cbNewSection(nPropIds) (sizeof(SECTION)-sizeof(PROPVALUE)+sizeof(PROPIDLIST)*((nPropIds)-1))
00208
00209 #define FIntelOrder(prop) ((prop)->byteOrder==0xfffe)
00210 #define SetOs(prop, os) {(prop)->osVersion=os; (prop)->getOSVersion=LOWORD(GetVersion());}
00211 #define SetSumInfFMTID(fmtId) {(fmtId)->Data1=0XF29F85E0; *(long FAR *)&(fmtId)->Data2=0X10684FF9;\
00212             *(long FAR *)&(fmtId)->Data4[0]=0X000891AB; *(long FAR *)&(fmtId)->Data4[4]=0XD9B3272B;}
00213 #define FEqSumInfFMTID(fmtId) ((fmtId)->dword==0XF29F85E0&&*((long FAR *)&(fmtId)->words)==0X10684FF9&&\
00214             *((long FAR *)&(fmtId)->bytes[0])==0X000891AB&&*((long FAR *)&(fmtId)->bytes[4])==0XD9B3272B)
00215 #define FSzEqPropStreamName(sz) _fstricmp(sz, PropStreamName)
00216 #define ClearSumInf(lpsuminf, cb) {_fmemset(lpsuminf,0,cb); (lpsuminf)->byteOrder=0xfffe;\
00217             SetOs(lpsuminf, osWinOnDos);}
00218
00219 typedef void FAR *LPSUMINFO;
00220 typedef LPSTR LPSTZR;
00221 typedef void FAR *THUMBNAIL;  //for VT_CF_WIN this is an unlocked global handle
00222 #define API __far __pascal
00223
00224
00225 /*************************************************************************
00226 ** Public Summary Info Property Set Management API
00227 *************************************************************************/
00228
00229 extern "C" {
00230 STDAPI_(LPSUMINFO) OleStdInitSummaryInfo(int reserved);
00231 STDAPI_(void) OleStdFreeSummaryInfo(LPSUMINFO FAR *lplp);
00232 STDAPI_(void) OleStdClearSummaryInfo(LPSUMINFO lp);
00233 STDAPI_(int) OleStdReadSummaryInfo(LPSTREAM lpStream, LPSUMINFO lp);
00234 STDAPI_(int) OleStdWriteSummaryInfo(LPSTREAM lpStream, LPSUMINFO lp);
00235 STDAPI_(DWORD) OleStdGetSecurityProperty(LPSUMINFO lp);
00236 STDAPI_(int) OleStdSetSecurityProperty(LPSUMINFO lp, DWORD security);
00237 STDAPI_(LPSTR) OleStdGetStringProperty(LPSUMINFO lp, DWORD pid);
00238 STDAPI_(int) OleStdSetStringProperty(LPSUMINFO lp, DWORD pid, LPOLESTR lpsz);
00239 STDAPI_(LPSTZR) OleStdGetStringZProperty(LPSUMINFO lp, DWORD pid);
00240 STDAPI_(void) OleStdGetDocProperty(
00241       LPSUMINFO       lp,
00242       DWORD FAR*      nPage,
00243       DWORD FAR*      nWords,
00244       DWORD FAR*      nChars
00245 );
00246 STDAPI_(int) OleStdSetDocProperty(
00247       LPSUMINFO       lp,
00248       DWORD           nPage,
00249       DWORD           nWords,
00250       DWORD           nChars
00251 );
00252 STDAPI_(int) OleStdGetThumbNailProperty(
00253       LPSTREAM        lps,
00254       LPSUMINFO       lp,
00255       DWORD FAR*      clipFormatNo,
00256       LPOLESTR FAR*   lpszName,
00257       THUMBNAIL FAR*  clip,
00258       DWORD FAR*      byteCount,
00259       BOOL            transferClip
00260 );
00261 STDAPI_(int) OleStdSetThumbNailProperty(
00262       LPSTREAM        lps,
00263       LPSUMINFO       lp,
00264       int             vtcfNo,
00265       DWORD           clipFormatNo,
00266       LPOLESTR        lpszName,
00267       THUMBNAIL       clip,
00268       DWORD           byteCount
00269 );
00270 STDAPI_(void) OleStdGetDateProperty(
00271       LPSUMINFO       lp,
00272       DWORD           pid,
00273       int FAR*        yr,
00274       int FAR*        mo,
00275       int FAR*        dy,
00276       DWORD FAR*      sc
00277 );
00278 STDAPI_(int) OleStdSetDateProperty(
00279       LPSUMINFO       lp,
00280       DWORD           pid,
00281       int             yr,
00282       int             mo,
00283       int             dy,
00284       int             hr,
00285       int             mn,
00286       int             sc
00287 );
00288
00289 } //END C
00290
00291 /*************************************************************************
00292 ** DEBUG ASSERTION ROUTINES
00293 *************************************************************************/
00294
00295 #if DBG
00296 #include <assert.h>
00297 #define FnAssert(lpstrExpr, lpstrMsg, lpstrFileName, iLine)     \
00298         (_assert(lpstrMsg ? lpstrMsg : lpstrExpr,               \
00299                  lpstrFileName,                                 \
00300                  iLine), NOERROR)
00301 #endif //DBG
00302
00303 #endif  // SUMINFO_H
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CADsSearch Member List

This is the complete list of members for CADsSearch, including all inherited members.
AddColumn(LPCTSTR pszColumn) | CADsSearch |
AddSearchPref(PADS_SEARCHPREF_INFO pSearchPrefs, DWORD dwNumPref=1) | CADsSearch |
CADsSearch(IADs *pADs) | CADsSearch |
CADsSearch() | CADsSearch |
Execute(LPCTSTR pszFilter) | CADsSearch |
FindSearchPrefence(ADS_SEARCHPREF pref) | CADsSearch |
FormatColumn(PADS_SEARCH_COLUMN pColumn, CStringList &sList) | CADsSearch |
FreeColumn(PADS_SEARCH_COLUMN pCol) | CADsSearch |
GetColumn(LPCTSTR pszCol, PADS_SEARCH_COLUMN pCol) | CADsSearch |
GetColumn(CString &s, CStringList &sList) | CADsSearch |
GetColumn(UINT nIndex, CStringList &sList) | CADsSearch |
GetNextRow() | CADsSearch |
GetSearchIf() | CADsSearch | [inline]
m_dwPrefCount | CADsSearch | [protected]
m_hSearch | CADsSearch | [protected]
m_pSearch | CADsSearch | [protected]
m_sColumnList | CADsSearch | [protected]
m_srchInfo | CADsSearch | [protected]
ResetSearchPref() | CADsSearch | [inline]
SetAttribOnly(BOOL bAttribOnly=TRUE) | CADsSearch |
SetInterface(IUnknown *pUnk) | CADsSearch |
SetPageSize(UINT nPageSize) | CADsSearch |
SetScope(ADS_SCOPEENUM flag) | CADsSearch |
SetSearchLevel(int flag) | CADsSearch |
~CADsSearch() | CADsSearch | [virtual]
Generated on Wed Nov 13 2024 16:55:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLineGrid Member List

This is the complete list of members for CLineGrid, including all inherited members.
_cCol | CGrid | [protected]
_cRow | CGrid | [protected]
_iStyle | CLineGrid | [protected]
_nWeight | CLineGrid | [protected]
_size | CGrid | [protected]
CGrid() | CGrid | [inline]
CLineGrid(UINT cCol, UINT cRow, SIZE size) | CLineGrid |
Detach() | CGrid |
Draw(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject) | CGrid |
FindBehavior(BSTR bstrBehavior, BSTR bstrBehaviorUrl, IElementBehaviorSite *pSite, IElementBehavior **ppBehavior) | CGrid |
get_GridSize(long *pVal) | CGrid |
GetPainterInfo(HTML_PAINTER_INFO *pInfo) | CGrid |
GridSize([out, retval] long *pVal) | IGrid |
GridSize([in] long newVal) | IGrid |
HitTestPoint(POINT pt, BOOL *pbHit, LONG *plPartID) | CGrid |
Init(IElementBehaviorSite *pBehaviorSite) | CGrid |
m_lClientLeft | CGrid |
m_lClientTop | CGrid |
m_lGridSize | CGrid |
m_spPaintSite | CGrid |
m_spSite | CGrid |
Notify(LONG lEvent, VARIANT *pVar) | CGrid |
OnResize(SIZE size) | CGrid |
Paint(CCanvas &canvas, RECT rc, POINT pt) | CLineGrid | [virtual]
put_GridSize(long newVal) | CGrid |
SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) | CGrid |
SetStyle(int iStyle=PS_DOT) | CLineGrid |
SetWeight(int nWeight=1) | CLineGrid |
Trace(WCHAR *message) | CGrid | [inline]
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/resource.h Source File

  • SysMgmt
  • MMC
  • Menubtn

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDR_MENUBUTTON                  111
00012 #define IDR_STATE_MENU                  111
00013 #define IDB_SMOPEN                      114
00014 #define IDB_SMBMP                       115
00015 #define IDB_LGBMP                       116
00016 #define IDR_SMICONS                     120
00017 #define IDR_LGICONS                     121
00018 #define IDB_ROCKET                      40004
00019 #define IDB_CAR                         40005
00020 #define IDB_PLANE                       40006
00021 #define IDB_BIKE                        40007
00022 #define IDB_ROCKET2                     40008
00023 #define IDB_CAR2                        40009
00024 #define IDB_PLANE2                      40010
00025 #define IDB_BIKE2                       40011
00026 #define IDB_CLOSED2                     40012
00027 #define IDB_OPEN2                       40013
00028 #define IDB_CLOSED                      40014
00029 #define IDB_OPEN                        40015
00030 #define ID_COMMAND_START                40016
00031 #define ID_COMMAND_PAUSE                40017
00032 #define ID_COMMAND_STOP                 40018
00033
00034 // Next default values for new objects
00035 //
00036 #ifdef APSTUDIO_INVOKED
00037 #ifndef APSTUDIO_READONLY_SYMBOLS
00038 #define _APS_NEXT_RESOURCE_VALUE        117
00039 #define _APS_NEXT_COMMAND_VALUE         40021
00040 #define _APS_NEXT_CONTROL_VALUE         1000
00041 #define _APS_NEXT_SYMED_VALUE           101
00042 #endif
00043 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/dialogs.h Source File

  • Multimedia
  • Gdi
  • PrintJob

dialogs.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 *  PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   Dialogs.c
00010 *
00011 *   PURPOSE:    Declares Dialog functions and exported callbacks
00012 *
00013 *   FUNCTIONS:
00014 *       GetPrinterPath () - Asks user to type in the name of a printer.
00015 *       GetPrinterDlgProc () - Dialog Procedure for the GetPrinterPath Dialog.
00016 *       About () - Dialog Procedure for the About Dialog.
00017 *
00018 ******************************************************************************/
00019
00020
00021 BOOL    GetPrinterPath(
00022                 HWND hWnd,          /* window handle of application window */
00023                 char *pszPrinter,   /* pointer to buffer for the printer name */
00024                 short cchStrSize);  /* size of pszPrinter in characters */
00025
00026 LRESULT CALLBACK GetPrinterDlgProc(
00027                 HWND hDlg,           /* window handle of the dialog box */
00028                 UINT message,        /* type of message */
00029                 WPARAM uParam,       /* message-specific information */
00030                 LPARAM lParam);      /* "       "          " */
00031
00032 LRESULT CALLBACK About  (HWND, UINT, WPARAM, LPARAM);
00033
00034 /* end of header file Dialogs.h */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/BitStr.h Source File

  • Security
  • CertServices
  • Encode

BitStr.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 2000
00006 //
00007 //  File:       bitstr.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // bitstr.h: Declaration of the CCertEncodeBitString
00012
00013
00014 #include "resource.h"       // main symbols
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // certenc
00018
00019 #define wszCLASS_CERTENCODEBITSTRING wszCLASS_CERTENCODE TEXT("BitString")
00020
00021 class CCertEncodeBitString:
00022     public IDispatchImpl<ICertEncodeBitString, &IID_ICertEncodeBitString, &LIBID_CERTENCODELib>,
00023     public ISupportErrorInfoImpl<&IID_ICertEncodeBitString>,
00024     public CComObjectRoot,
00025     public CComCoClass<CCertEncodeBitString, &CLSID_CCertEncodeBitString>
00026 {
00027 public:
00028     CCertEncodeBitString()
00029     {
00030   m_DecodeInfo = NULL;
00031     }
00032     ~CCertEncodeBitString();
00033
00034 BEGIN_COM_MAP(CCertEncodeBitString)
00035     COM_INTERFACE_ENTRY(IDispatch)
00036     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00037     COM_INTERFACE_ENTRY(ICertEncodeBitString)
00038 END_COM_MAP()
00039
00040 DECLARE_NOT_AGGREGATABLE(CCertEncodeBitString)
00041 // Remove the comment from the line above if you don't want your object to
00042 // support aggregation.  The default is to support it
00043
00044 DECLARE_REGISTRY(
00045     CCertEncodeBitString,
00046     wszCLASS_CERTENCODEBITSTRING TEXT(".1"),
00047     wszCLASS_CERTENCODEBITSTRING,
00048     IDS_CERTENCODEBITSTRING_DESC,
00049     THREADFLAGS_BOTH)
00050
00051 // ICertEncodeBitString
00052 public:
00053     STDMETHOD(Decode)(
00054     /* [in] */ BSTR const strBinary);
00055
00056     STDMETHOD(GetBitCount)(
00057     /* [out, retval] */ LONG __RPC_FAR *pBitCount);
00058
00059     STDMETHOD(GetBitString)(
00060     /* [out, retval] */ BSTR __RPC_FAR *pstrBitString);
00061
00062     STDMETHOD(Encode)(
00063     /* [in] */ LONG BitCount,
00064     /* [in] */ BSTR strBitString,
00065     /* [out, retval] */ BSTR *pstrBinary);
00066 private:
00067     VOID _Cleanup(VOID);
00068
00069     HRESULT _SetErrorInfo(
00070     IN HRESULT hrError,
00071     IN WCHAR const *pwszDescription);
00072
00073     LONG     m_cBits;
00074     CRYPT_BIT_BLOB  *m_DecodeInfo;
00075 };
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDynamic Member List

This is the complete list of members for CDynamic, including all inherited members.
_NewEnum(IUnknown **ppunk) | CDynamic |
Add(VARIANT *pItem, VARIANT *pKey=&vtMissing, VARIANT *pBefore=&vtMissing, VARIANT *pAfter=&vtMissing) | CDynamic |
CDynamic() | CDynamic | [inline]
Clear() | CDynamic | [private]
Count(long *pVal) | CDynamic |
DisconnectObject(DWORD dwReserved) | CDynamic | [inline]
GetClassID(GUID *pClassID) | CDynamic | [inline]
GetMarshalSizeMax(REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags, ULONG *pSize) | CDynamic | [inline]
GetSizeMax(_ULARGE_INTEGER *pCbSize) | CDynamic | [inline]
GetUnmarshalClass(REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags, CLSID *pCid) | CDynamic | [inline]
InitNew() | CDynamic | [inline]
InterfaceSupportsErrorInfo(REFIID riid) | CDynamic |
IsDirty() | CDynamic | [inline]
Item(VARIANT *pIndex, VARIANT *pVal) | CDynamic |
Load(IStream *pStm) | CDynamic | [inline]
m_bRequiresSave | CDynamic | [private]
m_IndexMap | CDynamic | [private]
m_MapIndex | CDynamic | [private]
m_nGrow | CDynamic | [private]
m_nReserve | CDynamic | [private]
m_VarVect | CDynamic | [private]
MarshalInterface(IStream *pStm, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags) | CDynamic | [inline]
ReleaseMarshalData(IStream *pStm) | CDynamic | [inline]
Remove(VARIANT *pIndex) | CDynamic |
Save(IStream *pStm, int fClearDirty) | CDynamic | [inline]
UnmarshalInterface(IStream *pStm, REFIID riid, void **ppv) | CDynamic | [inline]
~CDynamic() | CDynamic | [inline]
Generated on Wed Nov 13 2024 16:56:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/DirectorySearch.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

DirectorySearch.h

Go to the documentation of this file.
00001 #if !defined(AFX_DIRECTORYSEARCH_H__8F1F13D1_0728_11D2_A3E8_0080C7D071BF__INCLUDED_)
00002 #define AFX_DIRECTORYSEARCH_H__8F1F13D1_0728_11D2_A3E8_0080C7D071BF__INCLUDED_
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007 // DirectorySearch.h : header file
00008 //
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CDlgIDirectorySearch dialog
00012
00013 class CDlgIDirectorySearch : public CDialog
00014 {
00015 // Construction
00016 public:
00017   CDlgIDirectorySearch(LPUNKNOWN pUnk, CWnd* pParent = NULL);   // standard constructor
00018   ~CDlgIDirectorySearch();
00019 // Dialog Data
00020   //{{AFX_DATA(CDlgIDirectorySearch)
00021   enum { IDD = IDD_IDIRECTORYSEARCH };
00022   CEdit m_cAttrList;
00023   CListCtrl m_cListView;
00024   CComboBox m_cChaseReferrals;
00025   CButton m_cCacheResult;
00026   CComboBox m_CADsSearchScope;
00027   CButton m_cEnableFilter;
00028   CButton m_cExecute;
00029   CEdit m_cFilter;
00030   CString m_sFilter;
00031   BOOL  m_bEnableFilter;
00032   UINT  m_nTimeOut;
00033   BOOL  m_bCacheResult;
00034   UINT  m_nPageSize;
00035   CString m_sSortOn;
00036   UINT  m_nTimeLimit;
00037   UINT  m_nSizeLimit;
00038   BOOL  m_bAsynch;
00039   BOOL  m_bAttrib;
00040   int   m_nDeref;
00041   //}}AFX_DATA
00042
00043
00044 // Overrides
00045   // ClassWizard generated virtual function overrides
00046   //{{AFX_VIRTUAL(CDlgIDirectorySearch)
00047   protected:
00048   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00049   //}}AFX_VIRTUAL
00050
00051 // Implementation
00052 protected:
00053   IDirectorySearch *m_pSearch;
00054   // Generated message map functions
00055   //{{AFX_MSG(CDlgIDirectorySearch)
00056   afx_msg void OnExecute();
00057   afx_msg void OnChangeFilter();
00058   virtual BOOL OnInitDialog();
00059   afx_msg void OnEnabled();
00060   virtual void OnOK();
00061   afx_msg void OnDblClickListView(NMHDR* pNMHDR, LRESULT* pResult);
00062   //}}AFX_MSG
00063   DECLARE_MESSAGE_MAP()
00064 };
00065
00066 //{{AFX_INSERT_LOCATION}}
00067 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00068
00069
00070
00071 class CADsSearch
00072 {
00073 #define MAX_SEARCH_PREF  12
00074 public:
00075   CADsSearch( IADs *pADs );
00076   CADsSearch();
00077   virtual ~CADsSearch();
00078
00079
00080   HRESULT GetColumn( LPCTSTR pszCol, PADS_SEARCH_COLUMN pCol );
00081   HRESULT GetColumn( CString &s, CStringList &sList );
00082   HRESULT GetColumn( UINT nIndex, CStringList &sList );
00083   HRESULT FreeColumn( PADS_SEARCH_COLUMN pCol );
00084   HRESULT FormatColumn( PADS_SEARCH_COLUMN pColumn, CStringList &sList );
00085   HRESULT SetInterface( IUnknown *pUnk );
00086   PADS_SEARCHPREF_INFO FindSearchPrefence( ADS_SEARCHPREF pref );
00087
00088
00089   void AddColumn( LPCTSTR pszColumn );
00090   HRESULT Execute(LPCTSTR pszFilter );
00091   HRESULT GetNextRow();
00092   HRESULT SetSearchLevel( int flag );
00093   HRESULT SetPageSize( UINT nPageSize );
00094   HRESULT SetAttribOnly( BOOL bAttribOnly = TRUE);
00095   HRESULT SetScope( ADS_SCOPEENUM flag );
00096   void ResetSearchPref() { m_dwPrefCount=0; }
00097
00098   HRESULT AddSearchPref( PADS_SEARCHPREF_INFO pSearchPrefs, DWORD dwNumPref = 1);
00099   IDirectorySearch *GetSearchIf() { m_pSearch->AddRef(); return m_pSearch; }
00100
00101
00102
00103 protected:
00104     IDirectorySearch  *m_pSearch;
00105   ADS_SEARCH_HANDLE  m_hSearch;
00106   ADS_SEARCHPREF_INFO  m_srchInfo[MAX_SEARCH_PREF];
00107   DWORD          m_dwPrefCount;
00108   CStringList      m_sColumnList;
00109 };
00110
00111
00112
00113
00114 #endif // !defined(AFX_DIRECTORYSEARCH_H__8F1F13D1_0728_11D2_A3E8_0080C7D071BF__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/CompInstallDlg.Cpp Source File

  • Com
  • Administration
  • Explore.VC

CompInstallDlg.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 #include "stdafx.h"
00020 #include "VCExplore.h"
00021 #include "CompInstallDlg.h"
00022
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // CCompInstallDlg dialog
00033
00034
00035 CCompInstallDlg::CCompInstallDlg(CWnd* pParent /*=NULL*/)
00036   : CDialog(CCompInstallDlg::IDD, pParent)
00037 {
00038   //{{AFX_DATA_INIT(CCompInstallDlg)
00039     // NOTE: the ClassWizard will add member initialization here
00040   //}}AFX_DATA_INIT
00041
00042   // Load the dialog's icon resource
00043   m_hIcon = AfxGetApp()->LoadIcon(IDI_INSTALL);
00044
00045   // Initialize the members
00046   m_pCatalog = NULL;
00047 }
00048
00049
00050 void CCompInstallDlg::DoDataExchange(CDataExchange* pDX)
00051 {
00052   CDialog::DoDataExchange(pDX);
00053   //{{AFX_DATA_MAP(CCompInstallDlg)
00054   DDX_Control(pDX, IDC_COMBO_APPLICATION, m_cboApplications);
00055   DDX_Control(pDX, IDC_EDIT_TYPE_LIBRARY, m_edtTypeLib);
00056   DDX_Control(pDX, IDC_EDIT_PROXY_STUB_DLL, m_edtProxyStub);
00057   DDX_Control(pDX, IDC_EDIT_COMPONENT, m_edtComponent);
00058   //}}AFX_DATA_MAP
00059 }
00060
00061
00062 BEGIN_MESSAGE_MAP(CCompInstallDlg, CDialog)
00063   //{{AFX_MSG_MAP(CCompInstallDlg)
00064   ON_WM_CLOSE()
00065   ON_BN_CLICKED(IDC_BUTTON_COMPONENT_SEARCH, OnComponentSearch)
00066   ON_BN_CLICKED(IDC_BUTTON_TYPE_LIBRARY, OnTypeLibrary)
00067   ON_BN_CLICKED(IDC_BUTTON_PROXY_STUB_DLL, OnProxyStubDll)
00068   //}}AFX_MSG_MAP
00069 END_MESSAGE_MAP()
00070
00071 /////////////////////////////////////////////////////////////////////////////
00072 // CCompInstallDlg message handlers
00073
00074 void CCompInstallDlg::set_Catalog(ICOMAdminCatalog *pCatalog)
00075 {
00076   // Only can have one Catalog object reference... release all prior references before assignment
00077   ReleaseCatalog();
00078
00079   // Assign the new Catalog reference
00080   m_pCatalog = pCatalog;
00081 }
00082
00083 void CCompInstallDlg::OnClose()
00084 {
00085   // Release the reference to the Catalog object if needed
00086   ReleaseCatalog();
00087
00088   CDialog::OnClose();
00089 }
00090
00091 void CCompInstallDlg::OnComponentSearch()
00092 {
00093   OPENFILENAME ofn;
00094   char pFilePath[256];
00095   char pFileTitle[256];
00096
00097   // Setup of OPENFILENAME structure
00098   ofn.lStructSize = sizeof(OPENFILENAME);
00099     ofn.hwndOwner = m_hWnd;
00100     ofn.hInstance = NULL;
00101     ofn.lpstrFilter = "All Files (*.*)\0*.*\0\0";
00102     ofn.lpstrCustomFilter = (LPSTR) NULL;
00103     ofn.nMaxCustFilter = 0;
00104     ofn.nFilterIndex = 1;
00105     pFilePath[0] = '\0';
00106     ofn.lpstrFile = pFilePath;
00107     ofn.nMaxFile = sizeof(pFilePath);
00108     ofn.lpstrFileTitle = pFileTitle;
00109     ofn.nMaxFileTitle = sizeof(pFileTitle);
00110     ofn.lpstrInitialDir = NULL;
00111     ofn.lpstrTitle = "Select Component To Install";
00112     ofn.Flags = (OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST);
00113     ofn.lpstrDefExt = "DLL";
00114     ofn.nFileOffset = 0;
00115     ofn.nFileExtension = 0;
00116     ofn.lCustData = 0;
00117
00118   // Invoke the file open common dialog
00119   GetOpenFileName(&ofn);
00120
00121   // Update the value in the control
00122   m_edtComponent.SetWindowText(ofn.lpstrFile);
00123 }
00124
00125 void CCompInstallDlg::OnTypeLibrary()
00126 {
00127   OPENFILENAME ofn;
00128   char pFilePath[256];
00129   char pFileTitle[256];
00130
00131   // Setup of OPENFILENAME structure
00132   ofn.lStructSize = sizeof(OPENFILENAME);
00133     ofn.hwndOwner = m_hWnd;
00134     ofn.hInstance = NULL;
00135     ofn.lpstrFilter = "All Files (*.*)\0*.*\0\0";
00136     ofn.lpstrCustomFilter = (LPSTR) NULL;
00137     ofn.nMaxCustFilter = 0;
00138     ofn.nFilterIndex = 1;
00139     pFilePath[0] = '\0';
00140     ofn.lpstrFile = pFilePath;
00141     ofn.nMaxFile = sizeof(pFilePath);
00142     ofn.lpstrFileTitle = pFileTitle;
00143     ofn.nMaxFileTitle = sizeof(pFileTitle);
00144     ofn.lpstrInitialDir = NULL;
00145     ofn.lpstrTitle = "Select TypeLib To Install";
00146     ofn.Flags = (OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST);
00147     ofn.lpstrDefExt = "DLL";
00148     ofn.nFileOffset = 0;
00149     ofn.nFileExtension = 0;
00150     ofn.lCustData = 0;
00151
00152   // Invoke the file open common dialog
00153   GetOpenFileName(&ofn);
00154
00155   // Update the value in the control
00156   m_edtTypeLib.SetWindowText(ofn.lpstrFile);
00157 }
00158
00159 void CCompInstallDlg::OnProxyStubDll()
00160 {
00161   OPENFILENAME ofn;
00162   char pFilePath[256];
00163   char pFileTitle[256];
00164
00165   // Setup of OPENFILENAME structure
00166   ofn.lStructSize = sizeof(OPENFILENAME);
00167     ofn.hwndOwner = m_hWnd;
00168     ofn.hInstance = NULL;
00169     ofn.lpstrFilter = "All Files (*.*)\0*.*\0\0";
00170     ofn.lpstrCustomFilter = (LPSTR) NULL;
00171     ofn.nMaxCustFilter = 0;
00172     ofn.nFilterIndex = 1;
00173     pFilePath[0] = '\0';
00174     ofn.lpstrFile = pFilePath;
00175     ofn.nMaxFile = sizeof(pFilePath);
00176     ofn.lpstrFileTitle = pFileTitle;
00177     ofn.nMaxFileTitle = sizeof(pFileTitle);
00178     ofn.lpstrInitialDir = NULL;
00179     ofn.lpstrTitle = "Select Proxy/Stub To Install";
00180     ofn.Flags = (OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST);
00181     ofn.lpstrDefExt = "DLL";
00182     ofn.nFileOffset = 0;
00183     ofn.nFileExtension = 0;
00184     ofn.lCustData = 0;
00185
00186   // Invoke the file open common dialog
00187   GetOpenFileName(&ofn);
00188
00189   // Update the value in the control
00190   m_edtProxyStub.SetWindowText(ofn.lpstrFile);
00191 }
00192
00193 void CCompInstallDlg::LoadAppCombo()
00194 {
00195   // Continue only if we have a valid Catalog pointer
00196   if (NULL == m_pCatalog)
00197   {
00198     MessageBox("Invalid Catalog reference.\n\nNo processing will be performed.\n\nPress OK to continue.",
00199           "Error",
00200           (MB_OK | MB_ICONERROR));
00201     return;
00202   }
00203
00204   _bstr_t       bstrAppCollection = "Applications";
00205   ICatalogCollection* pAppCollection = NULL;
00206
00207   // Attempt to get a reference to the Catalog's "Application" collection
00208   HRESULT hr = m_pCatalog->GetCollection(bstrAppCollection,
00209                       (IDispatch**) &pAppCollection);
00210   if SUCCEEDED(hr)
00211   {
00212     // Attempt to populate the collection
00213     hr = pAppCollection->Populate();
00214     if SUCCEEDED(hr)
00215     {
00216       // Determine the number of items in the current collection
00217       long lCount = 0;
00218       hr = pAppCollection->get_Count(&lCount);
00219       if SUCCEEDED(hr)
00220       {
00221         _variant_t    vtItemName;
00222         ICatalogObject* pCatalogObject = NULL;
00223
00224         // Enumerate through the objects in the current collection and
00225         //  populate the combo box
00226         for (long lIndex = 0; lIndex < lCount; lIndex++)
00227         {
00228           hr = pAppCollection->get_Item(lIndex,
00229                           (IDispatch**) &pCatalogObject);
00230           if SUCCEEDED(hr)
00231           {
00232             hr = pCatalogObject->get_Name(&vtItemName);
00233             if SUCCEEDED(hr)
00234               m_cboApplications.AddString(_bstr_t(vtItemName));
00235
00236             pCatalogObject->Release();
00237           }
00238           else
00239             MessageBox("Error when attempting to get the current items name.\n\nPress OK to continue.",
00240                   "Error",
00241                   (MB_OK | MB_ICONERROR));
00242         }
00243       }
00244       else
00245         MessageBox("Failed to successfully determine the number of items in the Applications collection.\n\nNo processing will be performed.\n\nPress OK to continue.",
00246               "Error",
00247               (MB_OK | MB_ICONERROR));
00248     }
00249     else
00250       MessageBox("Failed to successfully populate the Applications collection.\n\nNo processing will be performed.\n\nPress OK to continue.",
00251             "Error",
00252             (MB_OK | MB_ICONERROR));
00253   }
00254   else
00255     MessageBox("Failed to get a reference to the Applications collection.\n\nNo processing will be performed.\n\nPress OK to continue.",
00256           "Error",
00257           (MB_OK | MB_ICONERROR));
00258 }
00259
00260 BOOL CCompInstallDlg::OnInitDialog()
00261 {
00262   CDialog::OnInitDialog();
00263
00264   // Set the dialog's icon resource
00265   SetIcon(m_hIcon, true);     // 32x32 icon
00266   SetIcon(m_hIcon, false);    // 16x16 icon
00267
00268   // Load the application combo box
00269   LoadAppCombo();
00270
00271   return TRUE;  // return TRUE unless you set the focus to a control
00272                 // EXCEPTION: OCX Property Pages should return FALSE
00273 }
00274
00275 void CCompInstallDlg::OnOK()
00276 {
00277   // Continue only if we have a valid Catalog pointer
00278   if (NULL != m_pCatalog)
00279   {
00280     // Extract the method parameters from the UI
00281     int nAppNameSize = m_cboApplications.GetWindowTextLength() + 1;
00282     char* pAppNameBuf = new char[nAppNameSize];
00283     m_cboApplications.GetWindowText(pAppNameBuf, nAppNameSize);
00284     _bstr_t bstrAppName = pAppNameBuf;
00285     delete [] pAppNameBuf;
00286
00287     int nComponentNameSize = m_edtComponent.GetWindowTextLength() + 1;
00288     char* pComponentNameBuf = new char[nComponentNameSize];
00289     m_edtComponent.GetWindowText(pComponentNameBuf, nComponentNameSize);
00290     _bstr_t bstrComponentName = pComponentNameBuf;
00291     delete [] pComponentNameBuf;
00292
00293     int nTLBNameSize = m_edtTypeLib.GetWindowTextLength() + 1;
00294     char* pTLBNameBuf = new char[nTLBNameSize];
00295     m_edtTypeLib.GetWindowText(pTLBNameBuf, nTLBNameSize);
00296     _bstr_t bstrTLB = pTLBNameBuf;
00297     delete [] pTLBNameBuf;
00298
00299     int nProxyStubNameSize = m_edtProxyStub.GetWindowTextLength() + 1;
00300     char* pProxyStubNameBuf = new char[nProxyStubNameSize];
00301     m_edtProxyStub.GetWindowText(pProxyStubNameBuf, nProxyStubNameSize);
00302     _bstr_t bstrProxyStub = pProxyStubNameBuf;
00303     delete [] pProxyStubNameBuf;
00304
00305     // Invoke the method
00306     HRESULT hr = m_pCatalog->InstallComponent(bstrAppName,
00307                           bstrComponentName,
00308                           bstrTLB,
00309                           bstrProxyStub);
00310     // Report errors, if any
00311     if FAILED(hr)
00312       MessageBox("Failed to install the specified component.\n\nPress OK to continue.",
00313             "Error",
00314             (MB_OK | MB_ICONERROR));
00315   }
00316   else
00317     MessageBox("Invalid Catalog reference.\n\nNo processing will be performed.\n\nPress OK to continue.",
00318           "Error",
00319           (MB_OK | MB_ICONERROR));
00320
00321   // Release the Catalog reference
00322   ReleaseCatalog();
00323
00324   CDialog::OnOK();
00325 }
00326
00327 void CCompInstallDlg::ReleaseCatalog()
00328 {
00329   // Release the reference to the Catalog object if needed
00330   if (NULL != m_pCatalog)
00331     m_pCatalog->Release();
00332 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Child/vc/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Child
  • vc

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  Child.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/TestVIEW.h Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

TestVIEW.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // testView.h : interface of the CTestView class
00013 //
00014 /////////////////////////////////////////////////////////////////////////////
00015
00016 class CTestView : public CEditView
00017 {
00018 protected: // create from serialization only
00019   CTestView();
00020   DECLARE_DYNCREATE(CTestView)
00021
00022 // Attributes
00023 public:
00024   CTestDoc* GetDocument();
00025
00026 // Operations
00027 public:
00028
00029 // Overrides
00030   // ClassWizard generated virtual function overrides
00031   //{{AFX_VIRTUAL(CTestView)
00032   public:
00033   virtual void OnDraw(CDC* pDC);  // overridden to draw this view
00034   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00035   protected:
00036   //}}AFX_VIRTUAL
00037
00038 // Implementation
00039 public:
00040   virtual ~CTestView();
00041 #ifdef _DEBUG
00042   virtual void AssertValid() const;
00043   virtual void Dump(CDumpContext& dc) const;
00044 #endif
00045
00046 protected:
00047
00048 // Generated message map functions
00049 protected:
00050   //{{AFX_MSG(CTestView)
00051   afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00052   //}}AFX_MSG
00053   DECLARE_MESSAGE_MAP()
00054 };
00055
00056 #ifndef _DEBUG  // debug version in testView.cpp
00057 inline CTestDoc* CTestView::GetDocument()
00058    { return (CTestDoc*)m_pDocument; }
00059 #endif
00060
00061
00062 /////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/inc/rumem.h Source File

  • NetDS
  • RRas
  • rqs
  • inc

rumem.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RuMem.h
00004 //
00005 //      Synopsis:   Memory allocation api's
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011 #ifndef _RAS_RUMEM_H
00012 #define _RAS_RUMEM_H
00013
00014 #include "RasUtil.h"
00015
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019
00020 BOOL RuFree(IN PVOID pvMem);
00021
00022 PVOID RuAlloc(
00023     IN DWORD dwSize,    // how many bytes of memory to allocate
00024     IN BOOL fZero       // If the allocated memory should be Initialized to 0
00025     );
00026
00027 #ifdef __cplusplus
00028 }
00029 #endif
00030
00031 #endif
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Enum.h Source File

  • NetDS
  • SyncMgr
  • SyncDir

Enum.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 // header file for handler specific items
00013
00014 #ifndef _ENUMERATOR_CLASS_
00015 #define _ENUMERATOR_CLASS_
00016
00017 // structure for keeping track of items as a whole
00018
00019 typedef struct  _tagGENERICITEM
00020 {
00021     DWORD cbSize;   // total size of item (this structure + whatever caller needs for data)
00022     _tagGENERICITEM *pNextGenericItem;
00023
00024 }  GENERICITEM;
00025
00026 typedef GENERICITEM *LPGENERICITEM;
00027
00028 typedef struct  _tagGENERICITEMLIST
00029 {
00030     DWORD _cRefs;               // reference count on this structure
00031     DWORD dwNumItems;           // number of items in  array.
00032     LPGENERICITEM pFirstGenericItem;       // ptr to first Item in linked list
00033 } GENERICITEMLIST;
00034
00035 typedef GENERICITEMLIST *LPGENERICITEMLIST;
00036
00037
00038 class CGenericEnum
00039 {
00040 public:
00041     DWORD m_cRef;
00042     DWORD m_cOffset;
00043     LPGENERICITEMLIST m_pGenericItemList; // array of items
00044     LPGENERICITEM m_pNextItem;
00045
00046 public:
00047     CGenericEnum(LPGENERICITEMLIST  pGenericItemList,DWORD cOffset);
00048     ~CGenericEnum();
00049         virtual void DeleteThisObject()  = 0;
00050
00051     //IUnknown members
00052     STDMETHODIMP            QueryInterface(REFIID, LPVOID FAR *);
00053     STDMETHODIMP_(ULONG)    AddRef();
00054     STDMETHODIMP_(ULONG)    Release();
00055
00056         STDMETHODIMP Next(ULONG celt,LPGENERICITEM rgelt,ULONG *pceltFetched);
00057         STDMETHODIMP Clone(CGenericEnum **ppenum);
00058
00059         STDMETHODIMP Skip(ULONG celt);
00060         STDMETHODIMP Reset();
00061 };
00062
00063
00064 // helper functions for managing list.
00065 DWORD AddRef_ItemList(LPGENERICITEMLIST pGenericItemList);
00066 DWORD Release_ItemList(LPGENERICITEMLIST pGenericItemList);
00067 LPGENERICITEMLIST CreateItemList();
00068 LPGENERICITEMLIST DuplicateItemList(LPGENERICITEMLIST pItemList);
00069 LPGENERICITEM AddNewItemToList(LPGENERICITEMLIST lpGenericList,ULONG cbSize);
00070 BOOL AddItemToList(LPGENERICITEMLIST lpGenericList,LPGENERICITEM pGenericItem);
00071 BOOL DeleteItemFromList(LPGENERICITEMLIST lpGenericList,LPGENERICITEM pGenericItem);
00072 LPGENERICITEM CreateNewListItem(ULONG cbSize);
00073
00074
00075 #endif // #define _ENUMERATOR_CLASS_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VTUNION Member List

This is the complete list of members for VTUNION, including all inherited members.
bool | VTUNION
bstrVal | VTUNION
dblVal | VTUNION
fltVal | VTUNION
iVal | VTUNION
lVal | VTUNION
scodeVal | VTUNION
systimeVal | VTUNION
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFilesTest/CrmFilesTest.Idl Source File

  • Com
  • Services
  • Crm
  • CrmFilesTest

CrmFilesTest.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: CrmFilesTest.idl
00004
00005
00006 ----------------------------------------------------------------------------
00007
00008 This file is part of the Microsoft COM+ Samples.
00009
00010
00011
00012 Copyright (C) 1995-1998 Microsoft Corporation. All rights reserved.
00013
00014
00015
00016 This source code is intended only as a supplement to Microsoft
00017
00018 Development Tools and/or on-line documentation. See these other
00019
00020 materials for detailed information regarding Microsoft code samples.
00021
00022
00023
00024 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00025
00026 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00027
00028 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00029
00030 PARTICULAR PURPOSE.
00031
00032 ==========================================================================+*/
00033 // CrmFilesTest.idl : IDL source for CrmFilesTest.dll
00034 //
00035
00036 // This file will be processed by the MIDL tool to
00037 // produce the type library (CrmFilesTest.tlb) and marshalling code.
00038
00039 import "oaidl.idl";
00040 import "ocidl.idl";
00041
00042 #include "mtxattr.h"
00043
00044   [
00045     object,
00046     uuid(963680E1-FCB4-11D1-83D0-00A0C91EEDE9),
00047     dual,
00048     helpstring("ICrmFilesTest Interface"),
00049     pointer_default(unique)
00050   ]
00051   interface ICrmFilesTest : IDispatch
00052   {
00053     [propput, id(1), helpstring("property FileName")] HRESULT FileName([in] BSTR newVal);
00054     [id(2), helpstring("method CreateFile")] HRESULT CreateFile();
00055     [id(3), helpstring("method DeleteFile")] HRESULT DeleteFile();
00056     [id(4), helpstring("method Commit")] HRESULT Commit();
00057     [id(5), helpstring("method Abort")] HRESULT Abort();
00058     [propput, id(6), helpstring("property Language")] HRESULT Language([in] long newVal);
00059   };
00060 [
00061   uuid(963680D1-FCB4-11D1-83D0-00A0C91EEDE9),
00062   version(1.0),
00063   helpstring("CrmFilesTest 1.0 Type Library")
00064 ]
00065 library CRMFILESTESTLib
00066 {
00067   importlib("stdole32.tlb");
00068   importlib("stdole2.tlb");
00069
00070   [
00071     uuid(963680E2-FCB4-11D1-83D0-00A0C91EEDE9),
00072     helpstring("CrmFilesTest Class"),
00073     TRANSACTION_REQUIRED
00074   ]
00075   coclass CrmFilesTest
00076   {
00077     [default] interface ICrmFilesTest;
00078   };
00079 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDialogLite Member List

This is the complete list of members for CDialogLite, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnCancel() | CDialogLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | CDialogLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CDialogLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 #include "People.h"
00023 #include "Sky.h"
00024 #include "Land.h"
00025 #include "Space.h"
00026
00027 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00028
00029 //==============================================================
00030 //
00031 // CStaticNode implementation
00032 //
00033 //
00034 CStaticNode::CStaticNode()
00035 {
00036     children[0] = new CPeoplePoweredVehicle;
00037     children[1] = new CLandBasedVehicle;
00038     children[2] = new CSkyBasedVehicle;
00039     children[3] = new CSpaceVehicle;
00040 }
00041
00042 CStaticNode::~CStaticNode()
00043 {
00044     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00045         if (children[n]) {
00046             delete children[n];
00047         }
00048 }
00049
00050 HRESULT CStaticNode::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00051 {
00052     SCOPEDATAITEM sdi;
00053
00054     if (!bExpanded) {
00055         // create the child nodes, then expand them
00056         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00057             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00058             sdi.mask = SDI_STR       |   // Displayname is valid
00059                 SDI_PARAM     |   // lParam is valid
00060                 SDI_IMAGE     |   // nImage is valid
00061                 SDI_OPENIMAGE |   // nOpenImage is valid
00062                 SDI_PARENT    |
00063                 SDI_CHILDREN;
00064
00065             sdi.relativeID  = (HSCOPEITEM)parent;
00066             sdi.nImage      = children[n]->GetBitmapIndex();
00067             sdi.nOpenImage  = INDEX_OPENFOLDER;
00068             sdi.displayname = MMC_CALLBACK;
00069             sdi.lParam      = (LPARAM)children[n];       // The cookie
00070             sdi.cChildren   = (n == 0); // only the first child has children
00071
00072             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00073
00074             _ASSERT( SUCCEEDED(hr) );
00075         }
00076     }
00077
00078     return S_OK;
00079 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPWizModule Member List

This is the complete list of members for CSCPWizModule, including all inherited members.
UpdateRegistryCLSID(const CLSID &clsid, BOOL bRegister) CSCPWizModule
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SESSION_DATA Member List

This is the complete list of members for SESSION_DATA, including all inherited members.
bstrName | SESSION_DATA
bstrURI | SESSION_DATA
fAccept | SESSION_DATA
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDisdrawDlg Member List

This is the complete list of members for CDisdrawDlg, including all inherited members.
CDisdrawDlg(CWnd *pParent=NULL) | CDisdrawDlg |
CDisdrawDlg(CWnd *pParent=NULL) | CDisdrawDlg |
DoDataExchange(CDataExchange *pDX) | CDisdrawDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CDisdrawDlg | [protected, virtual]
IDD enum value | CDisdrawDlg |
initializeUi(BOOL fConnectedToDS) | CDisdrawDlg | [protected]
IsDsEnabledLocaly() | CDisdrawDlg | [protected]
m_btnAddQueue | CDisdrawDlg |
m_btnAttach | CDisdrawDlg |
m_CancelButton | CDisdrawDlg |
m_cComputerInput | CDisdrawDlg |
m_cComputerLabel | CDisdrawDlg |
m_cConnectionMode | CDisdrawDlg |
m_cContinueButton | CDisdrawDlg |
m_cDsFrame | CDisdrawDlg |
m_cFriendFrame | CDisdrawDlg |
m_cMessageFrame | CDisdrawDlg |
m_cQueueFrame | CDisdrawDlg |
m_cQueueInput | CDisdrawDlg |
m_cQueueLabel | CDisdrawDlg |
m_cRadioDS | CDisdrawDlg |
m_cRadioExpress | CDisdrawDlg |
m_cRadioPrivate | CDisdrawDlg |
m_cRadioPublic | CDisdrawDlg |
m_cRadioRecoverable | CDisdrawDlg |
m_cRadioWorkgroup | CDisdrawDlg |
m_drawScribble | CDisdrawDlg |
m_fDsEnabledLocaly | CDisdrawDlg | [private]
m_hIcon | CDisdrawDlg | [protected]
m_hqIncoming | CDisdrawDlg |
m_hqOutgoing | CDisdrawDlg |
m_iDelivery | CDisdrawDlg |
m_iFormatNameList | CDisdrawDlg |
m_iRadioDS | CDisdrawDlg |
m_iType | CDisdrawDlg |
m_strFriend | CDisdrawDlg |
m_strLogin | CDisdrawDlg |
m_strRemoteComputerName | CDisdrawDlg |
m_wcsFormatNameList | CDisdrawDlg |
OnButtonAddQueue() | CDisdrawDlg | [protected]
OnButtonAttach() | CDisdrawDlg | [protected]
OnButtonAttach() | CDisdrawDlg | [protected]
OnChangeEditFriend() | CDisdrawDlg | [protected]
OnChangeEditFriendComputer() | CDisdrawDlg | [protected]
OnClose() | CDisdrawDlg | [protected]
OnClose() | CDisdrawDlg | [protected]
OnConnect() | CDisdrawDlg | [protected]
OnInitDialog() | CDisdrawDlg | [protected, virtual]
OnInitDialog() | CDisdrawDlg | [protected, virtual]
OnPaint() | CDisdrawDlg | [protected]
OnPaint() | CDisdrawDlg | [protected]
OnQueryDragIcon() | CDisdrawDlg | [protected]
OnQueryDragIcon() | CDisdrawDlg | [protected]
OnRadioPrivatequeue() | CDisdrawDlg | [protected]
OnRadioPublicqueue() | CDisdrawDlg | [protected]
OpenPrivateReceiveQueue() | CDisdrawDlg | [protected]
OpenPrivateReceiveQueue() | CDisdrawDlg | [protected]
OpenReceiveQueue() | CDisdrawDlg | [protected]
OpenReceiveQueue() | CDisdrawDlg | [protected]
SendKeystroke(UINT uChar) | CDisdrawDlg |
SendKeystroke(UINT uChar) | CDisdrawDlg |
SendMouseMovement(LINE lineNew) | CDisdrawDlg |
SendMouseMovement(LINE lineNew) | CDisdrawDlg |
startReceiveUpdateThread() | CDisdrawDlg | [protected]
startReceiveUpdateThread() | CDisdrawDlg | [protected]
Generated on Wed Nov 13 2024 16:56:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPSTN Member List

This is the complete list of members for CPSTN, including all inherited members.
CloseComPort() | CPSTN |
CPSTN(void) | CPSTN |
CreateComPort(UINT nTransportID, LPTSTR pszComPort) | CPSTN |
GetCommLink(void) | CPSTN |
m_pNullModem | CPSTN | [private]
m_szComPortName | CPSTN | [private]
~CPSTN(void) | CPSTN |
Generated on Wed Nov 13 2024 16:57:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/setup.exe/setupui.cpp Source File

  • SysMgmt
  • Msi
  • setup.exe

setupui.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       setupui.cpp
00006 //
00007 //  Implementation of CDownloadUI class
00008 //--------------------------------------------------------------------------
00009
00010 #define WIN // scope W32 API
00011 #define COMCTL32 // scope COMCTRL32
00012
00013 #include "resource.h"
00014 #include "setupui.h"
00015 #include <commctrl.h>
00016
00017 //{B506A5D1-9716-4F35-8ED5-9ECB0E9A55F8}
00018 const GUID IID_IDownloadBindStatusCallback = {0xB506A5D1L,0x9716,0x4F35,{0x8E,0xD5,0x9E,0xCB,0x0E,0x9A,0x55,0xF8}};
00019 //{00000000-9716-4F35-8ED5-9ECB0E9A55F8}
00020 const GUID IID_IUnknown = {0x00000000L,0x9716,0x4F35,{0x8E,0xD5,0x9E,0xCB,0x0E,0x9A,0x55,0xF8}};
00021
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // CDownloadUI::CDownloadUI constructor
00025 //
00026
00027 CDownloadUI::CDownloadUI() : m_hwndProgress(0), m_hwndParent(0), m_hInst(0),
00028                             m_fInitialized(false), m_fUserCancel(false),
00029                             m_ulProgressMax(0), m_ulProgressSoFar(0)
00030 {
00031     lstrcpy(m_szCaption, "");
00032 }
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // CDownloadUI::~CDownloadUI destructor
00036 //
00037
00038 CDownloadUI::~CDownloadUI()
00039 {
00040 }
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // ProgressProc - callback routine for IDD_PROGRESS dialog
00044 //
00045
00046 BOOL CALLBACK ProgressProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
00047 {
00048     if (uiMsg == WM_INITDIALOG)
00049     {
00050         return TRUE;
00051     }
00052     else if (uiMsg == WM_COMMAND && wParam == IDCANCEL)
00053     {
00054         ((CDownloadUI*)lParam)->SetUserCancel();
00055         return TRUE;
00056     }
00057     else if (uiMsg == WM_SETCURSOR)
00058     {
00059         // always display WAIT cursor if mouse not over Cancel button
00060         if ( (HWND)wParam != WIN::GetDlgItem(hDlg, IDC_DOWNLOAD_CANCEL))
00061         {
00062             WIN::SetCursor(WIN::LoadCursor(0, MAKEINTRESOURCE(IDC_WAIT)));
00063             return TRUE;
00064         }
00065     }
00066     else if (uiMsg == WM_CLOSE)
00067     {
00068
00069     }
00070
00071     return FALSE;
00072 }
00073
00074 /////////////////////////////////////////////////////////////////////////////
00075 // GetScreenCenterCoord
00076 //
00077
00078 bool GetScreenCenterCoord(HWND hDlg, int& iDialogLeft, int& iDialogTop, int& iDialogWidth, int& iDialogHeight)
00079 {
00080     RECT rcDialog;
00081     if (!WIN::GetWindowRect(hDlg, &rcDialog))
00082         return false;
00083
00084     RECT rcScreen;
00085     if (!WIN::SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen, 0))
00086     {
00087         rcScreen.left = 0;
00088         rcScreen.top = 0;
00089         rcScreen.right = WIN::GetSystemMetrics(SM_CXSCREEN);
00090         rcScreen.bottom = WIN::GetSystemMetrics(SM_CYSCREEN);
00091     }
00092     iDialogWidth = rcDialog.right - rcDialog.left;
00093     iDialogHeight = rcDialog.bottom - rcDialog.top;
00094     iDialogLeft = rcScreen.left + (rcScreen.right - rcScreen.left - iDialogWidth)/2;
00095     iDialogTop = rcScreen.top + (rcScreen.bottom - rcScreen.top - iDialogHeight)/2;
00096
00097     return true;
00098 }
00099
00100 /////////////////////////////////////////////////////////////////////////////
00101 // CDownloadUI::Initialize
00102 //
00103
00104 bool CDownloadUI::Initialize(HINSTANCE hInst, HWND hwndParent, LPCSTR szCaption)
00105 {
00106     INITCOMMONCONTROLSEX iccData = {sizeof(INITCOMMONCONTROLSEX), ICC_PROGRESS_CLASS};
00107     COMCTL32::InitCommonControlsEx(&iccData);
00108
00109     char szText[MAX_STR_CAPTION] = {0};
00110
00111     // set member variables
00112     m_hwndParent = hwndParent;
00113     m_hInst = hInst;
00114
00115     if (MAX_STR_CAPTION < lstrlen(szCaption))
00116     {
00117         lstrcpyn(m_szCaption, szCaption, MAX_STR_CAPTION);
00118     }
00119     else
00120     {
00121         lstrcpy(m_szCaption, szCaption);
00122     }
00123
00124     if (!m_hwndProgress)
00125     {
00126         // create Progress Dialog
00127         m_hwndProgress = WIN::CreateDialogParam(m_hInst, MAKEINTRESOURCE(IDD_PROGRESS), m_hwndParent, ProgressProc, (LPARAM)this);
00128         if (!m_hwndProgress)
00129             return false;
00130
00131         // set window caption
00132         WIN::SetWindowText(m_hwndProgress, m_szCaption);
00133
00134         // center dialog on screen
00135         int iDialogLeft, iDialogTop, iDialogWidth, iDialogHeight;
00136         ::GetScreenCenterCoord(m_hwndProgress, iDialogLeft, iDialogTop, iDialogWidth, iDialogHeight);
00137         WIN::MoveWindow(m_hwndProgress, iDialogLeft, iDialogTop, iDialogWidth, iDialogHeight, TRUE);
00138
00139         // set CANCEL button text
00140         WIN::LoadString(m_hInst, IDS_CANCEL, szText, MAX_STR_CAPTION);
00141         WIN::SetDlgItemText(m_hwndProgress, IDC_DOWNLOAD_CANCEL, szText);
00142
00143         // set to foreground and make visible all controls
00144         WIN::SetFocus(WIN::GetDlgItem(m_hwndProgress, IDC_DOWNLOAD_PROGRESSBAR));
00145         WIN::ShowWindow(WIN::GetDlgItem(m_hwndProgress, IDC_DOWNLOAD_CANCEL), SW_SHOW);
00146         WIN::SetForegroundWindow(m_hwndProgress);
00147         WIN::ShowWindow(WIN::GetDlgItem(m_hwndProgress, IDC_DOWNLOAD_PROGRESSBAR), SW_SHOW);
00148
00149         // set icon
00150         HICON hIcon = (HICON) WIN::LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_INSTALLER));
00151         if (hIcon)
00152             WIN::SendMessage(m_hwndProgress, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
00153
00154         // make window visible
00155         WIN::ShowWindow(m_hwndProgress, SW_SHOW);
00156     }
00157
00158     // message pump
00159     MSG msg;
00160     while (WIN::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
00161     {
00162         if (!WIN::IsDialogMessage(m_hwndProgress, &msg))
00163         {
00164             WIN::TranslateMessage(&msg);
00165             WIN::DispatchMessage(&msg);
00166         }
00167     }
00168
00169     m_fInitialized = true;
00170
00171     return true;
00172 }
00173
00174 /////////////////////////////////////////////////////////////////////////////
00175 // CDownloadUI::Terminate
00176 //
00177
00178 bool CDownloadUI::Terminate()
00179 {
00180     if (m_hwndProgress)
00181     {
00182         // destroy the progress window
00183         WIN::DestroyWindow(m_hwndProgress);
00184         m_hwndProgress = 0;
00185     }
00186
00187     m_hInst                 = 0;
00188     m_hwndParent            = 0;
00189     m_fInitialized          = false;
00190     m_fUserCancel           = false;
00191     m_ulProgressMax         = 0;
00192     m_ulProgressSoFar       = 0;
00193
00194     return true;
00195 }
00196
00197 /////////////////////////////////////////////////////////////////////////////
00198 // CDownloadUI::GetCurrentWindow
00199 //
00200
00201 HWND CDownloadUI::GetCurrentWindow()
00202 {
00203     return (m_hwndProgress) ? m_hwndProgress : m_hwndParent;
00204 }
00205
00206 /////////////////////////////////////////////////////////////////////////////
00207 // CDownloadUI::SetUserCancel
00208 //
00209
00210 void CDownloadUI::SetUserCancel()
00211 {
00212     m_fUserCancel = true;
00213 }
00214
00215 /////////////////////////////////////////////////////////////////////////////
00216 // CDownloadUI::HasUserCanceled
00217 //
00218
00219 bool CDownloadUI::HasUserCanceled()
00220 {
00221     return (m_fUserCancel);
00222 }
00223
00224 /////////////////////////////////////////////////////////////////////////////
00225 // CDownloadUI::SetBannerText
00226 //
00227
00228 irmProgress CDownloadUI::SetBannerText(LPCSTR szBanner)
00229 {
00230     if (!m_fInitialized)
00231         return irmNotInitialized;
00232
00233     if (m_fUserCancel)
00234         return irmCancel;
00235
00236     WIN::SetDlgItemText(m_hwndProgress, IDC_DOWNLOAD_BANNER, szBanner);
00237
00238     return irmOK;
00239 }
00240
00241 /////////////////////////////////////////////////////////////////////////////
00242 // CDownloadUI::SetActionText
00243 //
00244
00245 irmProgress CDownloadUI::SetActionText(LPCSTR szAction)
00246 {
00247     if (!m_fInitialized)
00248         return irmNotInitialized;
00249
00250     if (m_fUserCancel)
00251         return irmCancel;
00252
00253     WIN::SetDlgItemText(m_hwndProgress, IDC_DOWNLOAD_ACTIONTEXT, szAction);
00254
00255     return irmOK;
00256 }
00257
00258 /////////////////////////////////////////////////////////////////////////////
00259 // CDownloadUI::InitProgressBar
00260 //
00261
00262 void CDownloadUI::InitProgressBar(ULONG ulProgressMax)
00263 {
00264     // init progress bar values
00265     m_ulProgressMax         = ulProgressMax;
00266     m_ulProgressSoFar       = 0;
00267
00268     // set range on progress bar of [0, ulProgressMax]
00269     HWND hwndProgBar = WIN::GetDlgItem(m_hwndProgress, IDC_DOWNLOAD_PROGRESSBAR);
00270     WIN::SendMessage(hwndProgBar, PBM_SETRANGE32, /* WPARAM = */ 0, /* LPARAM = */ m_ulProgressMax);
00271
00272     // initialize the position of the progress bar -- forward direction, so set at 0
00273     WIN::SendMessage(hwndProgBar, PBM_SETPOS, /* WPARAM = */ (WPARAM)0, /* LPARAM = */ 0);
00274
00275     // message pump
00276     MSG msg;
00277     while (WIN::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
00278     {
00279         if (!WIN::IsDialogMessage(m_hwndProgress, &msg))
00280         {
00281             WIN::TranslateMessage(&msg);
00282             WIN::DispatchMessage(&msg);
00283         }
00284     }
00285 }
00286
00287 /////////////////////////////////////////////////////////////////////////////
00288 // CDownloadUI::IncrementProgressBar
00289 //
00290
00291 void CDownloadUI::IncrementProgressBar(ULONG ulProgress)
00292 {
00293     // increment progress bar
00294
00295     HWND hwndProgBar = WIN::GetDlgItem(m_hwndProgress, IDC_DOWNLOAD_PROGRESSBAR);
00296     WIN::SendMessage(hwndProgBar, PBM_DELTAPOS, /* WPARAM = */ (WPARAM) (ulProgress), /* LPARAM = */ 0);
00297
00298     m_ulProgressSoFar += ulProgress;
00299
00300     // message pump
00301     MSG msg;
00302     while (WIN::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
00303     {
00304         if (!WIN::IsDialogMessage(m_hwndProgress, &msg))
00305         {
00306             WIN::TranslateMessage(&msg);
00307             WIN::DispatchMessage(&msg);
00308         }
00309     }
00310 }
00311
00312 /////////////////////////////////////////////////////////////////////////////
00313 // CDownloadBindStatusCallback::CDownloadBindStatusCallback constructor
00314 //
00315
00316 CDownloadBindStatusCallback::CDownloadBindStatusCallback(CDownloadUI* pDownloadUI) : m_pDownloadUI(pDownloadUI), m_iRefCnt(1), m_ulProgressSoFar(0)
00317 {
00318 }
00319
00320 /////////////////////////////////////////////////////////////////////////////
00321 // CDownloadBindStatusCallback::~CDownloadBindStatusCallback destructor
00322 //
00323
00324 CDownloadBindStatusCallback::~CDownloadBindStatusCallback()
00325 {
00326 }
00327
00328 /////////////////////////////////////////////////////////////////////////////
00329 // CDownloadBindStatusCallback::QueryInterface
00330 //
00331
00332 HRESULT CDownloadBindStatusCallback::QueryInterface(const IID& riid, void** ppvObj)
00333 {
00334     if (!ppvObj)
00335         return E_INVALIDARG;
00336
00337     if (riid == IID_IUnknown || riid == IID_IDownloadBindStatusCallback)
00338     {
00339         *ppvObj = this;
00340         AddRef();
00341         return NOERROR;
00342     }
00343     *ppvObj = 0;
00344     return E_NOINTERFACE;
00345 }
00346
00347 /////////////////////////////////////////////////////////////////////////////
00348 // CDownloadBindStatusCallback::AddRef
00349 //
00350
00351 unsigned long CDownloadBindStatusCallback::AddRef()
00352 {
00353     return ++m_iRefCnt;
00354 }
00355
00356 /////////////////////////////////////////////////////////////////////////////
00357 // CDownloadBindStatusCallback::Release
00358 //
00359
00360 unsigned long CDownloadBindStatusCallback::Release()
00361 {
00362     if (--m_iRefCnt != 0)
00363         return m_iRefCnt;
00364     delete this;
00365     return 0;
00366 }
00367
00368 /////////////////////////////////////////////////////////////////////////////
00369 // CDownloadBindStatusCallback::OnProgress
00370 //
00371
00372 HRESULT CDownloadBindStatusCallback::OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR /*szStatusText*/)
00373 {
00374     switch (ulStatusCode)
00375     {
00376     case BINDSTATUS_BEGINDOWNLOADDATA:
00377         {
00378             // initialize progress bar with max # of ticks
00379             m_pDownloadUI->InitProgressBar(ulProgressMax);
00380
00381             // init progress so far
00382             m_ulProgressSoFar = 0;
00383
00384             // check for cancel
00385             if (m_pDownloadUI->HasUserCanceled())
00386                 return E_ABORT;
00387
00388             // fall through
00389         }
00390     case BINDSTATUS_DOWNLOADINGDATA:
00391         {
00392             // calculate how far we have moved since the last time
00393             ULONG ulProgIncrement = ulProgress - m_ulProgressSoFar;
00394
00395             // set progress so far to current value
00396             m_ulProgressSoFar = ulProgress;
00397
00398             // send progress message (if we have progressed)
00399             if (ulProgIncrement > 0)
00400                 m_pDownloadUI->IncrementProgressBar(ulProgIncrement);
00401
00402             // check for cancel
00403             if(m_pDownloadUI->HasUserCanceled())
00404                 return E_ABORT;
00405
00406             break;
00407         }
00408     case BINDSTATUS_ENDDOWNLOADDATA:
00409         {
00410             // send any remaining progress to complete download portion of progress bar
00411             ULONG ulProgIncrement = ulProgressMax - m_ulProgressSoFar;
00412             if (ulProgIncrement > 0)
00413                 m_pDownloadUI->IncrementProgressBar(ulProgIncrement);
00414
00415             // check for cancel
00416             if(m_pDownloadUI->HasUserCanceled())
00417                 return E_ABORT;
00418
00419             break;
00420         }
00421     }
00422
00423     return S_OK;
00424 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/ExtObj.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

ExtObj.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ExtObj.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the CExtObject class, which implements the
00010 //      extension interfaces required by a Microsoft Windows NT Cluster
00011 //      Administrator Extension DLL.
00012 //
00013 //  Author:
00014 //      <name> (<e-mail name>) Mmmm DD, 2003
00015 //
00016 //  Revision History:
00017 //
00018 //  Notes:
00019 //
00020 /////////////////////////////////////////////////////////////////////////////
00021
00022 #include "stdafx.h"
00023 #include "ClipBook ServerEx.h"
00024 #include "ExtObj.h"
00025 #include "ExtObjData.h"
00026 #include "ResProp.h"
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CExtObject
00030 /////////////////////////////////////////////////////////////////////////////
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 //++
00034 //
00035 //  CExtObject::CExtObject
00036 //
00037 //  Description:
00038 //      Default constructor.
00039 //
00040 //  Arguments:
00041 //      None.
00042 //
00043 //  Return Value:
00044 //      None.
00045 //
00046 //--
00047 /////////////////////////////////////////////////////////////////////////////
00048 CExtObject::CExtObject( void )
00049 {
00050     m_piData = NULL;
00051     m_piWizardCallback = NULL;
00052     m_bWizard = FALSE;
00053
00054     m_lcid = NULL;
00055     m_hfont = NULL;
00056     m_hicon = NULL;
00057     m_hCluster = NULL;
00058     m_cobj = 0;
00059     m_podObjData = NULL;
00060
00061 } //*** CExtObject::CExtObject
00062
00063 /////////////////////////////////////////////////////////////////////////////
00064 //++
00065 //
00066 //  CExtObject::~CExtObject
00067 //
00068 //  Description:
00069 //      Destructor.
00070 //
00071 //  Arguments:
00072 //      None.
00073 //
00074 //  Return Value:
00075 //      None.
00076 //
00077 //--
00078 /////////////////////////////////////////////////////////////////////////////
00079 CExtObject::~CExtObject( void )
00080 {
00081     POSITION    pos = NULL;
00082
00083     //
00084     // Release the data interface.
00085     //
00086
00087     if ( m_piData != NULL )
00088     {
00089         m_piData->Release();
00090         m_piData = NULL;
00091     } // if:  we have a data interface pointer
00092
00093     //
00094     // Release the wizard callback interface.
00095     //
00096
00097     if ( m_piWizardCallback != NULL )
00098     {
00099         m_piWizardCallback->Release();
00100         m_piWizardCallback = NULL;
00101     } // if:  we have a wizard callback interface pointer
00102
00103     //
00104     // Delete the pages.
00105     //
00106
00107     pos = m_lpg.GetHeadPosition();
00108     while ( pos != NULL )
00109     {
00110         delete m_lpg.GetNext(pos);
00111     } // while:  more pages in the list
00112
00113     //
00114     // Delete the object.
00115     //
00116
00117     delete m_podObjData;
00118     m_podObjData = NULL;
00119
00120 } //*** CExtObject::~CExtObject
00121
00122 /////////////////////////////////////////////////////////////////////////////
00123 // ISupportErrorInfo Implementation
00124 /////////////////////////////////////////////////////////////////////////////
00125
00126 /////////////////////////////////////////////////////////////////////////////
00127 //++
00128 //
00129 //  CExtObject::InterfaceSupportsErrorInfo (ISupportErrorInfo)
00130 //
00131 //  Routine Description:
00132 //      Indicates whether an interface suportes the IErrorInfo interface.
00133 //      This interface is provided by ATL.
00134 //
00135 //  Arguments:
00136 //      riid        Interface ID.
00137 //
00138 //  Return Value:
00139 //      S_OK        Interface supports IErrorInfo.
00140 //      S_FALSE     Interface does not support IErrorInfo.
00141 //
00142 //--
00143 /////////////////////////////////////////////////////////////////////////////
00144 STDMETHODIMP
00145 CExtObject::InterfaceSupportsErrorInfo(
00146     REFIID riid
00147     )
00148 {
00149     HRESULT hr = S_FALSE;
00150     int iiid = 0;
00151     static const IID * rgiid[] =
00152     {
00153           &IID_IWEExtendPropertySheet
00154         , &IID_IWEExtendWizard
00155     };
00156
00157     for ( iiid = 0 ; iiid < sizeof( rgiid ) / sizeof( rgiid[ 0 ] ) ; iiid++ )
00158     {
00159         if ( ::InlineIsEqualGUID( *rgiid[ iiid ], riid ) )
00160         {
00161             hr = S_OK;
00162             goto Cleanup;
00163         } // if: found a matching IID
00164     } // for: each interface we support
00165
00166 Cleanup:
00167
00168     return hr;
00169
00170 } //*** CExtObject::InterfaceSupportsErrorInfo
00171
00172 /////////////////////////////////////////////////////////////////////////////
00173 // IWEExtendPropertySheet Implementation
00174 /////////////////////////////////////////////////////////////////////////////
00175
00176 /////////////////////////////////////////////////////////////////////////////
00177 //++
00178 //
00179 //  CExtObject::CreatePropertySheetPages (IWEExtendPropertySheet)
00180 //
00181 //  Description:
00182 //      Create property sheet pages and add them to the sheet.
00183 //
00184 //  Arguments:
00185 //      piDataIn
00186 //          IUnkown pointer from which to obtain interfaces for obtaining data
00187 //          describing the object for which the sheet is being displayed.
00188 //
00189 //      piCallbackIn
00190 //          Pointer to an IWCPropertySheetCallback interface for adding pages
00191 //          to the sheet.
00192 //
00193 //  Return Value:
00194 //      S_OK         Pages added successfully.
00195 //      E_INVALIDARG    Invalid arguments to the function.
00196 //      E_OUTOFMEMORY   Error allocating memory.
00197 //      E_FAIL          Error creating a page.
00198 //      E_NOTIMPL       Not implemented for this type of data.
00199 //      hr             Any error codes from HrGetUIInfo() or HrSaveData().
00200 //
00201 //--
00202 /////////////////////////////////////////////////////////////////////////////
00203 STDMETHODIMP
00204 CExtObject::CreatePropertySheetPages(
00205       IUnknown *                   piDataIn
00206     , IWCPropertySheetCallback *   piCallbackIn
00207     )
00208 {
00209     HRESULT             hr = S_OK;
00210     CRuntimeClass **    pprtc = NULL;
00211     int                 irtc = 0;
00212     CBasePropertyPage * ppage = NULL;
00213     POSITION            pos = NULL;
00214
00215     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00216
00217     //
00218     // Validate the parameters.
00219     //
00220
00221     if ( (piDataIn == NULL) || (piCallbackIn == NULL) )
00222     {
00223         hr = E_INVALIDARG;
00224         goto Cleanup;
00225     } // if:  all interfaces not specified
00226
00227     //
00228     //  Since the MFC collection classes can throw exceptions a minimal try
00229     //  catch block is needed.
00230     //
00231
00232     try
00233     {
00234         //
00235         // Get info about displaying UI.
00236         //
00237
00238         hr = HrGetUIInfo( piDataIn );
00239         if ( FAILED( hr ) )
00240         {
00241             goto Cleanup;
00242         } // if:  error getting UI info
00243
00244         //
00245         // Save the data.
00246         //
00247
00248         hr = HrSaveData( piDataIn );
00249         if ( FAILED( hr ) )
00250         {
00251             goto Cleanup;
00252         } // if:  error saving data from host
00253
00254         //
00255         // Delete any previous pages.
00256         //
00257
00258         pos = m_lpg.GetHeadPosition();
00259         while ( pos != NULL )
00260         {
00261             delete m_lpg.GetNext( pos );
00262         } // while:  more pages in the list
00263
00264         m_lpg.RemoveAll();
00265
00266         //
00267         // Create property pages.
00268         //
00269
00270         ASSERT( m_podObjData != NULL );
00271         hr = m_podObjData->GetPropertySheetPages( &pprtc );
00272         if ( FAILED( hr ) )
00273         {
00274             goto Cleanup;
00275         } // if: failed to get the property sheet pages.
00276
00277         //
00278         // Create each page.
00279         //
00280
00281         for ( irtc = 0 ; pprtc[ irtc ] != NULL ; irtc++ )
00282         {
00283             //
00284             // Create the page.
00285             //
00286
00287             ppage = static_cast< CBasePropertyPage * >( pprtc[ irtc ]->CreateObject() );
00288             ASSERT( ppage->IsKindOf( pprtc[ irtc ] ) );
00289
00290             //
00291             // Add it to the list.
00292             //
00293
00294             m_lpg.AddTail( ppage );
00295
00296             //
00297             // Initialize the property page.
00298             //
00299
00300             hr = ppage->HrInit( this );
00301             if ( FAILED( hr ) )
00302             {
00303                 goto Cleanup;
00304             } // if:  error initializing the page
00305
00306             //
00307             // Create the page.
00308             //
00309
00310             hr = ppage->HrCreatePage();
00311             if ( FAILED( hr ) )
00312             {
00313                 goto Cleanup;
00314             } // if:  error creating the page
00315
00316             //
00317             // Add it to the property sheet.
00318             //
00319
00320             hr = piCallbackIn->AddPropertySheetPage( reinterpret_cast< LONG * >( ppage->Hpage() ) );
00321             if ( FAILED( hr ) )
00322             {
00323                 goto Cleanup;
00324             } // if:  error adding the page to the sheet
00325         } // for:  each page in the list
00326     } // try:
00327     catch ( CMemoryException * pme )
00328     {
00329         //
00330         //  An MFC memory exception occurred.
00331         //
00332
00333         TRACE( _T("CExtObject::CreatePropetySheetPages() - Failed to add property page\n") );
00334
00335         pme->Delete();
00336         hr = E_OUTOFMEMORY;
00337     } // catch:  MFC memory exception.
00338     catch( ... )
00339     {
00340         //
00341         //  An unknown exception occurred.
00342         //
00343
00344         hr = E_UNEXPECTED;
00345     } // catch: anything.
00346
00347 Cleanup:
00348
00349     //
00350     //  Contractually obligated to release these interfaces. Cluadmin did
00351     //  an AddRef on them before we were called.
00352     //
00353
00354     piDataIn->Release();
00355     piCallbackIn->Release();
00356
00357     return hr;
00358
00359 } //*** CExtObject::CreatePropertySheetPages
00360
00361 /////////////////////////////////////////////////////////////////////////////
00362 // IWEExtendWizard Implementation
00363 /////////////////////////////////////////////////////////////////////////////
00364
00365 /////////////////////////////////////////////////////////////////////////////
00366 //++
00367 //
00368 //  CExtObject::CreateWizardPages (IWEExtendWizard)
00369 //
00370 //  Description:
00371 //      Create property sheet pages and add them to the wizard.
00372 //
00373 //  Arguments:
00374 //      piDataIn
00375 //          IUnkown pointer from which to obtain interfaces for obtaining data
00376 //          describing the object for which the wizard is being displayed.
00377 //
00378 //      piCallbackIn
00379 //          Pointer to an IWCPropertySheetCallback interface for adding pages
00380 //          to the sheet.
00381 //
00382 //  Return Value:
00383 //      S_OK         Pages added successfully.
00384 //      E_INVALIDARG    Invalid arguments to the function.
00385 //      E_OUTOFMEMORY   Error allocating memory.
00386 //      E_FAIL          Error creating a page.
00387 //      E_NOTIMPL       Not implemented for this type of data.
00388 //      hr             Any error codes from HrGetUIInfo() or HrSaveData().
00389 //
00390 //--
00391 /////////////////////////////////////////////////////////////////////////////
00392 STDMETHODIMP
00393 CExtObject::CreateWizardPages(
00394       IUnknown *           piDataIn
00395     , IWCWizardCallback *  piCallbackIn
00396     )
00397 {
00398     HRESULT             hr = S_OK;
00399     CRuntimeClass **    pprtc = NULL;
00400     int                 irtc = 0;
00401     CBasePropertyPage * ppage = NULL;
00402     POSITION            pos = NULL;
00403
00404     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00405
00406     //
00407     // Validate the parameters.
00408     //
00409
00410     if ( (piDataIn == NULL) || (piCallbackIn == NULL) )
00411     {
00412         hr = E_INVALIDARG;
00413         goto Cleanup;
00414     } // if:  all interfaces not specified
00415
00416     //
00417     //  Since the MFC collection classes can throw exceptions a minimal try
00418     //  catch block is needed.
00419     //
00420
00421     try
00422     {
00423         //
00424         // Get info about displaying UI.
00425         //
00426
00427         hr = HrGetUIInfo( piDataIn );
00428         if ( FAILED( hr ) )
00429         {
00430             goto Cleanup;
00431         } // if:  error getting UI info
00432
00433         //
00434         // Save the data.
00435         //
00436
00437         hr = HrSaveData( piDataIn );
00438         if ( FAILED( hr ) )
00439         {
00440             goto Cleanup;
00441         } // if:  error saving data from host
00442
00443         //
00444         // Delete any previous pages.
00445         //
00446
00447         pos = m_lpg.GetHeadPosition();
00448         while ( pos != NULL )
00449         {
00450             delete m_lpg.GetNext( pos );
00451         } // while:  more pages in the list
00452
00453         m_lpg.RemoveAll();
00454
00455         //
00456         // Update our callback pointer.
00457         //
00458
00459         piCallbackIn->AddRef();
00460         m_piWizardCallback = piCallbackIn;
00461
00462         m_bWizard = TRUE;
00463
00464         //
00465         // Create property pages.
00466         //
00467
00468         ASSERT( m_podObjData != NULL );
00469         hr = m_podObjData->GetWizardPages( &pprtc );
00470         if ( FAILED( hr ) )
00471         {
00472             goto Cleanup;
00473         } // if: failed to get the wizard pages.
00474
00475         //
00476         // Create each page.
00477         //
00478
00479         for ( irtc = 0 ; pprtc[ irtc ] != NULL ; irtc++ )
00480         {
00481             //
00482             // Create the page.
00483             //
00484
00485             ppage = static_cast< CBasePropertyPage * >( pprtc[ irtc ]->CreateObject() );
00486             ASSERT( ppage->IsKindOf( pprtc[ irtc ] ) );
00487
00488             //
00489             // Add it to the list.
00490             //
00491
00492             m_lpg.AddTail( ppage );
00493
00494             //
00495             // Initialize the property page.
00496             //
00497
00498             hr = ppage->HrInit( this );
00499             if ( FAILED( hr ) )
00500             {
00501                 goto Cleanup;
00502             } // if:  error initializing the page
00503
00504             //
00505             // Create the page.
00506             //
00507
00508             hr = ppage->HrCreatePage();
00509             if ( FAILED( hr ) )
00510             {
00511                 goto Cleanup;
00512             } // if:  error creating the page
00513
00514             //
00515             // Add it to the property sheet.
00516             //
00517
00518             hr = piCallbackIn->AddWizardPage( reinterpret_cast< LONG * >( ppage->Hpage() ) );
00519             if ( FAILED( hr ) )
00520             {
00521                 goto Cleanup;
00522             } // if:  error adding the page to the sheet
00523         } // for:  each page in the list
00524     } // try:
00525     catch ( CMemoryException * pme )
00526     {
00527         //
00528         //  An MFC memory exception occurred.
00529         //
00530
00531         TRACE( _T("CExtObject::CreateWizardPages() - Failed to add wizard page\n") );
00532
00533         pme->Delete();
00534         hr = E_OUTOFMEMORY;
00535     } // catch: MFC memory exception.
00536     catch( ... )
00537     {
00538         //
00539         //  An unknown exception occurred.
00540         //
00541
00542         hr = E_UNEXPECTED;
00543     } // catch: anything.
00544
00545 Cleanup:
00546
00547     //
00548     //  If we failed for any reason then we need to cleanup up the wizard
00549     //  callback interface if we saved it off.
00550     //
00551
00552     if ( FAILED( hr ) )
00553     {
00554         if ( m_piWizardCallback == piCallbackIn )
00555         {
00556             m_piWizardCallback->Release();
00557             m_piWizardCallback = NULL;
00558         } // if: already saved interface pointer
00559     } // if:  error occurred
00560
00561     //
00562     //  Contractually obligated to release these interfaces. Cluadmin did
00563     //  an AddRef on them before we were called.
00564     //
00565
00566     piDataIn->Release();
00567     piCallbackIn->Release();
00568
00569     return hr;
00570
00571 } //*** CExtObject::CreateWizardPages
00572
00573 /////////////////////////////////////////////////////////////////////////////
00574 //++
00575 //
00576 //  CExtObject::HrGetUIInfo
00577 //
00578 //  Description:
00579 //      Get info about displaying UI.
00580 //
00581 //  Arguments:
00582 //      piDataIn
00583 //          IUnkown pointer from which to obtain interfaces for obtaining data
00584 //          describing the object.
00585 //
00586 //  Return Value:
00587 //      S_OK
00588 //          Data saved successfully.
00589 //
00590 //      E_NOTIMPL
00591 //          Not implemented for this type of data.
00592 //
00593 //      hr
00594 //          Any error codes from IUnknown::QueryInterface(),
00595 //          HrGetObjectName(), or HrGetResourceName().
00596 //
00597 //--
00598 /////////////////////////////////////////////////////////////////////////////
00599 HRESULT
00600 CExtObject::HrGetUIInfo(
00601     IUnknown * piDataIn
00602     )
00603 {
00604     ASSERT( piDataIn != NULL );
00605
00606     HRESULT             hr = S_OK;
00607     IGetClusterUIInfo * pi = NULL;
00608
00609     //
00610     // Save info about all types of objects.
00611     //
00612
00613     hr = piDataIn->QueryInterface( IID_IGetClusterUIInfo, reinterpret_cast< LPVOID * >( &pi ) );
00614     if ( FAILED( hr ) )
00615     {
00616         goto Cleanup;
00617     } // if:  error querying for interface
00618
00619     m_lcid = pi->GetLocale();
00620     m_hfont = pi->GetFont();
00621     m_hicon = pi->GetIcon();
00622
00623 Cleanup:
00624
00625     if ( pi != NULL )
00626     {
00627         pi->Release();
00628     } // if:
00629
00630     return hr;
00631
00632 } //*** CExtObject::HrGetUIInfo
00633
00634 /////////////////////////////////////////////////////////////////////////////
00635 //++
00636 //
00637 //  CExtObject::HrSaveData
00638 //
00639 //  Routine Description:
00640 //      Save data from the object so that it can be used for the life
00641 //      of the object.
00642 //
00643 //  Arguments:
00644 //      piDataIn
00645 //          IUnkown pointer from which to obtain interfaces for obtaining data
00646 //          describing the object.
00647 //
00648 //  Return Value:
00649 //      S_OK
00650 //          Data saved successfully.
00651 //
00652 //      E_NOTIMPL
00653 //          Not implemented for this type of data.
00654 //
00655 //      hr
00656 //          Any error codes from IUnknown::QueryInterface(),
00657 //          HrGetObjectName(), or HrGetResourceName().
00658 //
00659 //--
00660 /////////////////////////////////////////////////////////////////////////////
00661 HRESULT
00662 CExtObject::HrSaveData(
00663     IUnknown * piDataIn
00664     )
00665 {
00666     ASSERT( piDataIn != NULL );
00667
00668     HRESULT                 hr = S_OK;
00669     IGetClusterDataInfo *   pi = NULL;
00670
00671     //
00672     //  Save the new piData interface.
00673     //
00674
00675     if ( piDataIn != m_piData )
00676     {
00677         if ( m_piData != NULL )
00678         {
00679             m_piData->Release();
00680         } // if:  interface queried for previously
00681
00682         piDataIn->AddRef();
00683         m_piData = piDataIn;
00684     } // if:  different data interface pointer
00685
00686     //
00687     // Save info about all types of objects.
00688     //
00689
00690     hr = piDataIn->QueryInterface( IID_IGetClusterDataInfo, reinterpret_cast< LPVOID * >( &pi ) );
00691     if ( FAILED( hr ) )
00692     {
00693         goto Cleanup;
00694     } // if:  error querying for interface
00695
00696     m_hCluster = pi->GetClusterHandle();
00697
00698     m_cobj = pi->GetObjectCount();
00699     if ( m_cobj != 1 )  // We only have support for one selected object.
00700     {
00701         hr = E_NOTIMPL;
00702         goto Cleanup;
00703     } // if:  too many objects for us to handle
00704
00705     //
00706     // Save info about this object.
00707     //
00708
00709     hr = HrGetObjectInfo();
00710     if ( FAILED( hr ) )
00711     {
00712         goto Cleanup;
00713     } // if:
00714
00715 Cleanup:
00716
00717     if ( pi != NULL )
00718     {
00719         pi->Release();
00720     } // if:
00721
00722     return hr;
00723
00724 } //*** CExtObject::HrSaveData
00725
00726 /////////////////////////////////////////////////////////////////////////////
00727 //++
00728 //
00729 //  CExtObject::HrGetObjectInfo
00730 //
00731 //  Description:
00732 //      Get information about the object.
00733 //
00734 //  Arguments:
00735 //      None.
00736 //
00737 //  Return Value:
00738 //      S_OK
00739 //          Data saved successfully.
00740 //
00741 //      E_OUTOFMEMORY
00742 //         Error allocating memory.
00743 //
00744 //      E_NOTIMPL
00745 //          Not implemented for this type of data.
00746 //
00747 //      hr
00748 //          Any error codes from IUnknown::QueryInterface(),
00749 //          HrGetObjectName(), or HrGetResourceTypeName().
00750 //
00751 //--
00752 /////////////////////////////////////////////////////////////////////////////
00753 HRESULT
00754 CExtObject::HrGetObjectInfo( void )
00755 {
00756     HRESULT hr = S_OK;
00757
00758     //
00759     // Delete the old object and create a new one.
00760     //
00761
00762     delete m_podObjData;
00763     m_podObjData = NULL;
00764
00765     hr = CObjData::S_HrCreateObject( m_piData, &m_podObjData );
00766
00767     return hr;
00768
00769 } //*** CExtObject::HrGetObjectInfo
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/AString.h Source File

  • Security
  • CertServices
  • Encode

AString.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1995 - 2000
00006 //
00007 //  File:       astring.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // astring.h: Declaration of the CCertEncodeStringArray
00012
00013
00014 #include "resource.h"       // main symbols
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // certenc
00018
00019 #define wszCLASS_CERTENCODESTRINGARRAY wszCLASS_CERTENCODE TEXT("StringArray")
00020
00021 class CCertEncodeStringArray:
00022     public IDispatchImpl<ICertEncodeStringArray, &IID_ICertEncodeStringArray, &LIBID_CERTENCODELib>,
00023     public ISupportErrorInfoImpl<&IID_ICertEncodeStringArray>,
00024     public CComObjectRoot,
00025     public CComCoClass<CCertEncodeStringArray, &CLSID_CCertEncodeStringArray>
00026 {
00027 public:
00028     CCertEncodeStringArray()
00029     {
00030   m_aValue = NULL;
00031   m_fConstructing = FALSE;
00032     }
00033     ~CCertEncodeStringArray();
00034
00035 BEGIN_COM_MAP(CCertEncodeStringArray)
00036     COM_INTERFACE_ENTRY(IDispatch)
00037     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00038     COM_INTERFACE_ENTRY(ICertEncodeStringArray)
00039 END_COM_MAP()
00040
00041 DECLARE_NOT_AGGREGATABLE(CCertEncodeStringArray)
00042 // Remove the comment from the line above if you don't want your object to
00043 // support aggregation.  The default is to support it
00044
00045 DECLARE_REGISTRY(
00046     CCertEncodeStringArray,
00047     wszCLASS_CERTENCODESTRINGARRAY TEXT(".1"),
00048     wszCLASS_CERTENCODESTRINGARRAY,
00049     IDS_CERTENCODESTRINGARRAY_DESC,
00050     THREADFLAGS_BOTH)
00051
00052 // ICertEncodeStringArray
00053 public:
00054     STDMETHOD(Decode)(
00055     /* [in] */ BSTR const strBinary);
00056
00057     STDMETHOD(GetStringType)(
00058     /* [out, retval] */ LONG __RPC_FAR *pStringType);
00059
00060     STDMETHOD(GetCount)(
00061     /* [out, retval] */ LONG __RPC_FAR *pCount);
00062
00063     STDMETHOD(GetValue)(
00064     /* [in] */ LONG Index,
00065     /* [out, retval] */ BSTR __RPC_FAR *pstr);
00066
00067     STDMETHOD(Reset)(
00068     /* [in] */ LONG Count,
00069     /* [in] */ LONG StringType);
00070
00071     STDMETHOD(SetValue)(
00072     /* [in] */ LONG Index,
00073     /* [in] */ BSTR const str);
00074
00075     STDMETHOD(Encode)(
00076     /* [out, retval] */ BSTR *pstrBinary);
00077 private:
00078     VOID _Cleanup(VOID);
00079
00080     HRESULT _SetErrorInfo(
00081     IN HRESULT hrError,
00082     IN WCHAR const *pwszDescription);
00083
00084     CERT_NAME_VALUE **m_aValue;
00085     LONG        m_cValue;
00086     LONG        m_cValuesSet;
00087     BOOL        m_fConstructing;
00088     LONG        m_StringType;
00089 };
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStaticMap Member List

This is the complete list of members for CStaticMap, including all inherited members.
Add(LPCWSTR key, long len, long val) | CStaticMap | [inline]
AddNoLen(LPCWSTR key, long val) | CStaticMap | [inline]
ClearArray() | CStaticMap | [inline]
CStaticMap() | CStaticMap | [inline]
FindKey(LPCWSTR key) const | CStaticMap | [inline]
GetSize() const | CStaticMap | [inline]
Initialize(long Size) | CStaticMap | [inline]
Lookup(LPCWSTR key) const | CStaticMap | [inline]
m_aKey | CStaticMap | [mutable]
m_nSize | CStaticMap |
RemoveAll() | CStaticMap | [inline]
SetAtIndex(int nIndex, LPCWSTR key, long len) | CStaticMap | [inline]
SetAtIndexNoLen(int nIndex, LPCWSTR key) | CStaticMap | [inline]
SetKey(long val, WCHAR *key) const | CStaticMap | [inline]
~CStaticMap() | CStaticMap | [inline]
Generated on Wed Nov 13 2024 16:57:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/cMemb.Cpp Source File

  • Web
  • NetMeeting
  • NMShare

cMemb.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       CMEMB.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 COBLIST * g_pListUser = (COBLIST *) NULL;
00018
00019
00020 //****************************************************************************
00021 //
00022 // PUSER PUserFromINmMember(INmMember * pMember)
00023 //
00024 //****************************************************************************
00025
00026 PUSER PUserFromINmMember(INmMember * pMember)
00027 {
00028   if (NULL != g_pListUser)
00029   {
00030     POSITION pos = g_pListUser->GetHeadPosition();
00031     while (NULL != pos)
00032     {
00033       PUSER pUser = (PUSER) g_pListUser->GetNext(pos);
00034       if (pMember == pUser->pMember)
00035       {
00036         ASSERT(pMember == pUser->pMember);
00037         return pUser;
00038       }
00039     }
00040   }
00041
00042   return NULL;
00043 }
00044
00045
00046 //****************************************************************************
00047 //
00048 // int ItemFromPUser(PUSER pUser)
00049 //
00050 //****************************************************************************
00051
00052 int ItemFromPUser(PUSER pUser)
00053 {
00054   if (NULL == ghwndUser)
00055     return -1;
00056
00057   LV_FINDINFO findInfo;
00058   ClearStruct(&findInfo);
00059   findInfo.flags = LVFI_PARAM;
00060     findInfo.lParam = (LPARAM) pUser;
00061     return ListView_FindItem(ghwndUser, -1, &findInfo);
00062 }
00063
00064
00065 //****************************************************************************
00066 //
00067 // PUSER AllocUser(INmMember * pMember)
00068 //
00069 //****************************************************************************
00070
00071 PUSER AllocUser(INmMember * pMember)
00072 {
00073   HRESULT hr = S_OK;
00074   BSTR bstr;
00075
00076   if (NULL == pMember)
00077   {
00078     return NULL;
00079   }
00080
00081   PUSER pUser = new USER;
00082   if (NULL == pUser)
00083   {
00084     return NULL;
00085   }
00086   ClearStruct(pUser);
00087
00088   pUser->pMember = pMember;
00089   pMember->AddRef();
00090
00091   hr = pMember->GetName(&bstr);
00092   if (SUCCEEDED(hr))
00093   {
00094     pUser->pszName = PszFromBstr(bstr);
00095     SysFreeString(bstr);
00096   }
00097   //*** What happens if GetName fails? ***
00098
00099   return pUser;
00100 }
00101
00102
00103 //****************************************************************************
00104 //
00105 // VOID FreeUser(PUSER pUser)
00106 //
00107 //****************************************************************************
00108
00109 VOID FreeUser(PUSER pUser)
00110 {
00111   ASSERT(NULL != pUser);
00112
00113   if (NULL != pUser)
00114   {
00115     FreePlpv(&pUser->pszName);
00116
00117     if (NULL != pUser->pMember)
00118     {
00119       pUser->pMember->Release();
00120     }
00121   }
00122 }
00123
00124 VOID FreeAllUsers(void)
00125 {
00126   if (NULL != g_pListUser)
00127   {
00128     while (!g_pListUser->IsEmpty())
00129     {
00130       RemoveMember(((PUSER) g_pListUser->GetHead())->pMember);
00131     }
00132   }
00133 }
00134
00135
00136 //****************************************************************************
00137 //
00138 // VOID AddMember(INmMember * pMember)
00139 //
00140 //****************************************************************************
00141
00142 VOID AddMember(INmMember * pMember)
00143 {
00144   if (NULL == pMember)
00145   {
00146     return;
00147   }
00148
00149   PUSER pUser = AllocUser(pMember);
00150
00151   if (NULL == pUser)
00152   {
00153     return;
00154   }
00155
00156   AddNode(pUser, &g_pListUser);
00157
00158   LV_ITEM  lvItem;
00159   ClearStruct(&lvItem);
00160   lvItem.iItem = g_pListUser->GetItemCount();
00161   lvItem.mask = LVIF_PARAM | LVIF_TEXT;
00162   lvItem.pszText = pUser->pszName;
00163   lvItem.cchTextMax = lstrlen(pUser->pszName);
00164   lvItem.lParam = (LPARAM) pUser;
00165   ListView_InsertItem(ghwndUser, &lvItem);
00166
00167   TCHAR szMsg[MAX_PATH + 1];
00168   ZeroMemory(szMsg,(MAX_PATH + 1) * sizeof(TCHAR));
00169   _sntprintf(szMsg,MAX_PATH,TEXT("%s joined"), pUser->pszName);
00170
00171   DisplayMsg(szMsg);
00172
00173 }
00174
00175
00176 //****************************************************************************
00177 //
00178 // VOID RemoveMember(INmMember * pMember)
00179 //
00180 //****************************************************************************
00181
00182 VOID RemoveMember(INmMember * pMember)
00183 {
00184   if (NULL == g_pListUser)
00185     return;
00186
00187   if (NULL == pMember)
00188     return;
00189
00190   POSITION pos = g_pListUser->GetHeadPosition();
00191   while (NULL != pos)
00192   {
00193     POSITION posSav = pos;
00194     PUSER pUser = (PUSER) g_pListUser->GetNext(pos);
00195     if (pMember == pUser->pMember)
00196     {
00197       TCHAR szMsg[MAX_PATH + 1];
00198       ZeroMemory(szMsg,(MAX_PATH + 1) * sizeof(TCHAR));
00199       _sntprintf(szMsg,MAX_PATH,TEXT("%s left"), pUser->pszName);
00200
00201       DisplayMsg(szMsg);
00202
00203       ListView_DeleteItem(ghwndUser, ItemFromPUser(pUser));
00204       FreeUser(pUser);
00205       g_pListUser->RemoveAt(posSav);
00206       return;
00207     }
00208   }
00209 }
00210
00211
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Utility.h Source File

  • WinUI
  • Shell
  • SampView

Utility.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Utility.h
00013
00014    Description:   Utility definitions.
00015
00016 **************************************************************************/
00017
00018 #ifndef UTILITY_H
00019 #define UTILITY_H
00020
00021 /**************************************************************************
00022    #include statements
00023 **************************************************************************/
00024
00025 #include <windows.h>
00026 #include <windowsx.h>
00027 #include <shlobj.h>
00028 #include <Regstr.h>
00029
00030 #ifndef SFGAO_BROWSABLE
00031 #define SFGAO_BROWSABLE (0)
00032 #endif
00033
00034 #ifndef SHGDN_INCLUDE_NONFILESYS
00035 #define SHGDN_INCLUDE_NONFILESYS (0)
00036 #endif
00037
00038 #ifdef _cplusplus
00039 extern "C" {
00040 #endif   //_cplusplus
00041
00042 typedef struct {
00043     BOOL fCut;
00044     UINT cidl;
00045     UINT aoffset[1];
00046    }PRIVCLIPDATA, FAR *LPPRIVCLIPDATA;
00047
00048 /**************************************************************************
00049    global variables
00050 **************************************************************************/
00051
00052 #define TITLE_SIZE   64
00053
00054 #define FILTER_ATTRIBUTES  (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN)
00055
00056 #define INITIAL_COLUMN_SIZE    100
00057
00058 #define CFSTR_SAMPVIEWDATA TEXT("SampleViewDataFormat")
00059
00060 #define NS_CLASS_NAME   (TEXT("SampleViewNSClass"))
00061
00062 #define VIEW_POINTER_OFFSET   GWLP_USERDATA
00063
00064 extern HINSTANCE     g_hInst;
00065 extern UINT          g_DllRefCount;
00066 extern HIMAGELIST    g_himlLarge;
00067 extern HIMAGELIST    g_himlSmall;
00068 extern TCHAR         g_szStoragePath[];
00069 extern TCHAR         g_szExtTitle[];
00070 extern const TCHAR   c_szDataFile[];
00071 extern const TCHAR   c_szSection[];
00072 extern int           g_nColumn;
00073
00074 /**************************************************************************
00075    function prototypes
00076 **************************************************************************/
00077
00078 //utility functions
00079 int CALLBACK CompareItems(LPARAM, LPARAM, LPARAM);
00080 BOOL SaveGlobalSettings(VOID);
00081 VOID GetGlobalSettings(VOID);
00082 VOID CreateImageLists(VOID);
00083 VOID DestroyImageLists(VOID);
00084 int WideCharToLocal(LPTSTR, LPCWSTR, DWORD);
00085 int LocalToWideChar(LPWSTR, LPCTSTR, DWORD);
00086 int LocalToAnsi(LPSTR, LPCTSTR, DWORD);
00087 VOID SmartAppendBackslash(LPTSTR, DWORD);
00088 int BuildDataFileName(LPTSTR, LPCTSTR, DWORD);
00089 BOOL GetTextFromSTRRET(IMalloc*, LPSTRRET, LPCITEMIDLIST, LPTSTR, DWORD);
00090 BOOL IsViewWindow(HWND);
00091 BOOL DeleteDirectory(LPCTSTR);
00092 HGLOBAL CreatePrivateClipboardData(LPITEMIDLIST, LPITEMIDLIST*, UINT, BOOL);
00093 HGLOBAL CreateShellIDList(LPITEMIDLIST, LPITEMIDLIST*, UINT);
00094 BOOL CALLBACK ItemDataDlgProc(HWND, UINT, WPARAM, LPARAM);
00095 LPVOID GetViewInterface(HWND);
00096 UINT AddViewMenuItems(HMENU, UINT, UINT, BOOL);
00097 UINT AddFileMenuItems(HMENU, UINT, UINT, BOOL);
00098
00099 #ifdef _cplusplus
00100 }
00101 #endif   //_cplusplus
00102
00103 #define ARRAYSIZE(a)    (sizeof(a)/sizeof(a[0]))
00104
00105 #endif   //UTILITY_H
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/OPBank/bankdlg.Cpp Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • OPBank

bankdlg.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      bankdlg.cpp
00003   Summary:   Implementation of Bank client
00004   Classes:   CBankDlg
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #ifndef DBNTWIN32
00024 #define DBNTWIN32
00025 #include <SQL.h>
00026 #include <SQLEXT.h>
00027 #endif
00028
00029 #include "BankDlg.h"
00030 #include "..\account.vc\Account.h"
00031 #define IID_DEFINED
00032 #include "..\account.vc\Account_i.c"
00033 #include "stdio.h"
00034
00035 #include <fstream.h>
00036
00037 #include "commctrl.h"
00038 #include "stdlib.h"
00039 #define NUMBER_OF_COLUMNS 4 // number of columns in our listview
00040 #define FILE_VERSION  18
00041 #define ERROR_COLUMN  2
00042
00043
00044 //
00045 // globals go here
00046 //
00047
00048 HWND g_hWndResults = NULL;
00049 HWND g_hWndSubmit = NULL;
00050 HWND g_hWndStop = NULL;
00051 HWND g_hDlg = NULL;
00052 BOOL g_bStop = FALSE;
00053 BOOL g_bAssertOnErrors = FALSE;
00054 BOOL g_bStopOnODBCErrors = FALSE;
00055 BOOL g_bRetry = FALSE;
00056 long g_nRows = 500;
00057 HANDLE * g_pHandles = NULL;
00058 int g_nThreadsRunning = 0;
00059 HACCEL  g_hAccel = NULL;
00060 extern LARGE_INTEGER g_PerfFreq;
00061
00062 extern void ShowResults(BSTR sString, BOOL bError);
00063 extern HRESULT GetRowCount(HSTMT hstmt, long * pRowCount);
00064 extern DWORD WINAPI CreateRowsThread( LPVOID v);
00065 extern DWORD WINAPI CreateSchemaThread( LPVOID v);
00066 extern HRESULT VerifySchema(HSTMT hstmt);
00067 extern HRESULT CreateSchema(HSTMT hstmt);
00068 extern HRESULT CreateRows(long nRows, HSTMT hstmt);
00069 extern DWORD WINAPI MoveMoneyThread( LPVOID v);
00070 extern DWORD WINAPI AccountThread( LPVOID v);
00071
00072 extern DWORD WINAPI CreateRowsThread( LPVOID v);
00073 extern HRESULT GetConnection(HENV  * phEnv, HDBC * phdbc, HSTMT * phstmt);
00074 extern HRESULT FreeConnection(HENV henv, HDBC hdbc, HSTMT hstmt);
00075 extern BOOL g_bUnattended;
00076 extern WCHAR  * g_szLogFile;
00077
00078
00079 THREADDATA g_pSuite[] =
00080 {
00081
00082 //  Test    eCoInit   iters random  chatty  from  to  trantype  amount  threads bCreatePerIteration, Language,
00083   MOVEMONEY,  CoInitMTA,      5,    TRUE, TRUE, 1,    2,  TRANSFER, 5,    5,    FALSE,        VC,
00084   MOVEMONEY,  CoInitSTA,      5,    TRUE, TRUE, 1,    2,  TRANSFER, 5,    1,    TRUE,       VC,
00085   ACCOUNT,  CoInitMTA,      5,    TRUE, TRUE, 1,    2,  DEBIT,    5,    1,    FALSE,        VC,
00086   ACCOUNT,  CoInitRandom,   5,    TRUE, TRUE, 1,    2,  CREDIT,   5,    5,    FALSE,        VC
00087
00088 };
00089
00090
00091
00092 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00093   Function: CBankDlg::CBankDlg
00094   Summary:  CBankDlg constructor
00095 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00096 CBankDlg::CBankDlg()
00097 {
00098
00099
00100   m_nSuiteIndex = -1;
00101   m_nTotalTests = sizeof(g_pSuite)/ sizeof(g_pSuite[0]);
00102   m_hCreateThread = NULL;
00103   m_cd.bDone = TRUE; // the create data thread is not running
00104   m_hMenu = NULL;
00105   QueryPerformanceFrequency ( &g_PerfFreq);
00106   m_nMaxRowLength = 0;
00107   m_hFile = NULL;
00108   m_nMsgs = 0;
00109
00110 }
00111
00112
00113 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00114   Function: CBankDlg::CBankDlg
00115   Summary:  CBankDlg destructor
00116 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00117 CBankDlg::~CBankDlg()
00118 {
00119
00120
00121   if (m_hFile)
00122   {
00123     CloseHandle(m_hFile);
00124     m_hFile = NULL;
00125   }
00126
00127   SaveAll();
00128
00129 }
00130
00131
00132 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00133   Function: CBankDlg::OnInitDialog
00134   Summary:  Initialize dialog
00135   Args:     UINT uMsg
00136       WPARAM wParam
00137       LPARAM lParam
00138       BOOL bHandled
00139   Returns:  LRESULT
00140 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00141 LRESULT CBankDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00142 {
00143   //
00144   // set global Variables
00145   //
00146
00147
00148   g_hWndResults = GetDlgItem(IDC_RESULTS);
00149   g_hWndSubmit = GetDlgItem(IDC_SUBMIT);
00150   g_hWndStop = GetDlgItem(IDC_STOP);
00151   g_hDlg = m_hWnd;
00152
00153   //
00154   //  we always want the list to be Full Row Select --
00155   //  note: this only works if the user has IE 3.0 installed
00156   //
00157   DWORD dwStyle = ListView_GetExtendedListViewStyle(g_hWndResults);
00158   dwStyle |= LVS_EX_FULLROWSELECT;
00159   ListView_SetExtendedListViewStyle(g_hWndResults, dwStyle);
00160
00161
00162   m_cd.nRows = GetDlgItemInt(IDC_ROWS);
00163   m_cd.hWndResults = GetDlgItem(IDC_RESULTS);
00164   m_cd.hWndStopButton = GetDlgItem(IDC_CREATE_ROWS);
00165
00166
00167   //
00168   //  create the columns in our list
00169   //
00170
00171   LV_COLUMN col;
00172   memset(&col,NULL, sizeof(col));
00173   col.mask = LVCF_TEXT|LVCF_WIDTH;
00174   col.fmt = LVCFMT_LEFT;
00175   col.cx = 40;
00176   col.pszText = L"Count";
00177   col.cchTextMax  = lstrlen(col.pszText);
00178   ListView_InsertColumn(m_cd.hWndResults, 0, &col);
00179
00180
00181   memset(&col,NULL, sizeof(col));
00182   col.mask = LVCF_TEXT|LVCF_WIDTH;
00183   col.fmt = LVCFMT_LEFT;
00184   col.cx = 60;
00185   col.pszText = L"ThreadId";
00186   col.cchTextMax  = lstrlen(col.pszText);
00187   ListView_InsertColumn(m_cd.hWndResults, 1, &col);
00188
00189   memset(&col,NULL, sizeof(col));
00190   col.mask = LVCF_TEXT|LVCF_WIDTH;
00191   col.fmt = LVCFMT_LEFT;
00192   col.cx = 60;
00193   col.pszText = L"Error?";
00194   col.cchTextMax  = lstrlen(col.pszText);
00195   ListView_InsertColumn(m_cd.hWndResults, 2, &col);
00196
00197   memset(&col,NULL, sizeof(col));
00198   col.mask = LVCF_TEXT|LVCF_WIDTH;
00199   col.fmt = LVCFMT_LEFT;
00200   col.cx = 600;
00201   col.pszText = L"Result";
00202   col.cchTextMax  = lstrlen(col.pszText);
00203   ListView_InsertColumn(m_cd.hWndResults, 3, &col);
00204
00205   LoadAll();
00206   m_pCurrentThreadData = (CThreadData *)m_list.First();
00207   m_nSuiteIndex = 0 ;
00208   UpdateStatus(m_pCurrentThreadData, m_nSuiteIndex);
00209   bHandled=TRUE;
00210   SetDlgItemInt(IDC_ROWS, g_nRows);
00211   m_hMenu = LoadMenu(_Module.m_hInst, MAKEINTRESOURCE(IDR_MENU));
00212
00213   if (g_bUnattended)
00214   {
00215     m_hFile = CreateFile(g_szLogFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
00216   }
00217
00218
00219   return 1;  // Let the system set the focus
00220 }
00221
00222
00223 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00224   Function: CBankDlg::OnOK
00225 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00226 LRESULT CBankDlg::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00227 {
00228   return OnClose(WM_CLOSE, 0, 0L, bHandled);
00229 }
00230
00231
00232 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00233   Function: CBankDlg::OnRandom
00234 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00235 LRESULT CBankDlg::OnRandom(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00236 {
00237   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00238   pTd -> bRandom = 1 - pTd -> bRandom;
00239   ::EnableWindow(GetDlgItem(IDC_FROM), !pTd -> bRandom);
00240   ::EnableWindow(GetDlgItem(IDC_TO), !pTd -> bRandom);
00241   SetDescription(pTd);
00242   bHandled = TRUE;
00243   return 0;
00244 }
00245
00246
00247 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00248   Function: CBankDlg::OnKillThreads
00249 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00250 LRESULT CBankDlg::OnKillThreads(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00251 {
00252
00253   g_bStop = TRUE;
00254   for (int i = 0; i< g_nThreadsRunning; i++)
00255   {
00256     TerminateThread(g_pHandles[i] ,666);
00257   }
00258   return 0;
00259 }
00260
00261
00262 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00263   Function: CBankDlg::OnSelectMoveMoney
00264 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00265 LRESULT CBankDlg::OnSelectMoveMoney(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00266 {
00267   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00268   pTd -> nTestType = MOVEMONEY;
00269   switch (wID)
00270   {
00271   case ID_MM_CREDIT:
00272     pTd -> nTranType = CREDIT;
00273     break;
00274   case ID_MM_DEBIT:
00275     pTd -> nTranType = DEBIT;
00276     break;
00277   case ID_MM_TRANSFER:
00278     pTd -> nTranType = TRANSFER;
00279     break;
00280   default:
00281     _ASSERTE(0);
00282   }
00283
00284   SetDescription(pTd);
00285
00286   return 0;
00287 }
00288
00289
00290 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00291   Function: CBankDlg::OnSelectAccount
00292 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00293 LRESULT CBankDlg::OnSelectAccount(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00294 {
00295   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00296   pTd -> nTestType = ACCOUNT;
00297   switch (wID)
00298   {
00299   case ID_AC_DEBIT:
00300     pTd -> nTranType = DEBIT;
00301     break;
00302   case ID_AC_CREDIT:
00303     pTd -> nTranType = CREDIT;
00304     break;
00305   default:
00306     _ASSERTE(0);
00307   }
00308
00309   SetDescription(pTd);
00310   return 0;
00311
00312 }
00313
00314
00315 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00316   Function: CBankDlg::OnSelectLanguage
00317 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00318 LRESULT CBankDlg::OnSelectLanguage(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00319 {
00320   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00321   switch (wID)
00322   {
00323   case ID_LANG_C:
00324     pTd -> eLang = VC;
00325     break;
00326   case ID_LANG_VB:
00327     pTd -> eLang = VB;
00328     break;
00329   case ID_LANG_JAVA:
00330     pTd -> eLang = Java;
00331     break;
00332   // (04.26.00 mdl) Include support for Delphi.
00333   case ID_LANG_DELPHI:
00334     pTd -> eLang = Delphi;
00335     break;
00336   default:
00337     _ASSERTE(0);
00338   }
00339
00340   SetDescription(pTd);
00341   return 0;
00342
00343 }
00344
00345
00346 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00347   Function: CBankDlg::OnSelectCreatePerIteration
00348 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00349 LRESULT CBankDlg::OnSelectCreatePerIteration(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00350 {
00351   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00352   pTd -> bCreatePerIteration = 1 - pTd -> bCreatePerIteration;
00353   bHandled = TRUE;
00354   SetDescription(pTd);
00355   return 0;
00356 }
00357
00358
00359 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00360   Function: CBankDlg::OnSelectChattyDisplay
00361 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00362 LRESULT CBankDlg::OnSelectChattyDisplay(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00363 {
00364   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00365   pTd -> bChatty = 1 - pTd -> bChatty;
00366   bHandled = TRUE;
00367   SetDescription(pTd);
00368   return 0;
00369 }
00370
00371
00372 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00373   Function: CBankDlg::OnRetryOnErrors
00374 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00375 LRESULT CBankDlg::OnRetryOnErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00376 {
00377   bHandled = TRUE;
00378   g_bRetry = 1 - g_bRetry;
00379   return 0;
00380
00381 }
00382
00383
00384 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00385   Function: CBankDlg::OnSelectCoInit
00386 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00387 LRESULT CBankDlg::OnSelectCoInit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00388 {
00389   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00390   pTd -> nTestType = MOVEMONEY;
00391   switch (wID)
00392   {
00393   case ID_COINIT_MTA:
00394     pTd -> eCoInit = CoInitMTA;
00395     break;
00396   case ID_COINIT_STA:
00397     pTd -> eCoInit = CoInitSTA;
00398     break;
00399   case ID_COINIT_RANDOM:
00400     pTd -> eCoInit = CoInitRandom;
00401     break;
00402   default:
00403     _ASSERTE(0);
00404   }
00405
00406   SetDescription(pTd);
00407
00408   return 0;
00409 }
00410
00411
00412 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00413   Function: CBankDlg::OnAssertOnErrors
00414 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00415 LRESULT CBankDlg::OnAssertOnErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00416 {
00417   g_bAssertOnErrors = 1 - g_bAssertOnErrors;
00418   SetDescription(m_pCurrentThreadData -> GetThreadData());
00419   return 0;
00420 }
00421
00422
00423 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00424   Function: CBankDlg::OnStopOnODBCErrors
00425 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00426 LRESULT CBankDlg::OnStopOnODBCErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00427 {
00428   g_bStopOnODBCErrors =   1 - g_bStopOnODBCErrors;
00429   SetDescription(m_pCurrentThreadData -> GetThreadData());
00430   return 0;
00431 }
00432
00433
00434
00435 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00436   Function: CBankDlg::OnRunSuite
00437   Summary:  Run through several scenarios:
00438       1.  Account Debit in STA
00439       2.  MoveMoney in STA
00440       3.  Account Debit in MTA
00441       4.  MoveMoney in MTA
00442 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00443 LRESULT CBankDlg::OnRunSuite(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00444 {
00445
00446   //
00447   //  save current settings
00448   //
00449   GetThreadData(m_pCurrentThreadData -> GetThreadData());
00450
00451   ::EnableWindow(GetDlgItem(IDC_SUBMIT), FALSE);
00452   ::EnableWindow(GetDlgItem(IDC_STOP), TRUE);
00453   ::EnableWindow(GetDlgItem(IDC_RUN_SUITE), FALSE);
00454   ListView_DeleteAllItems(g_hWndResults);
00455   SaveAll();
00456   CThreadData * pThreadData = (CThreadData *)m_list.First();
00457   int index = 0;
00458   WCHAR sz[64];
00459
00460   // (03.22.00 mdl) Add overall timing information for test suite.
00461   DWORD liStartTime = GetTickCount();
00462
00463   while ( pThreadData != (CThreadData *)&m_list)
00464   {
00465
00466     UpdateStatus(pThreadData, index);
00467     index++;
00468     wsprintf(sz, L"Running Suite Test %d", index);
00469     ShowResults(SysAllocString(sz), FALSE);
00470     // Perform test based on selected language.
00471     DoWork(pThreadData, pThreadData -> GetThreadData() -> nTestType);
00472     if (g_bStop)
00473       break;
00474
00475     pThreadData = ( CThreadData * )pThreadData -> Next();
00476   }
00477
00478   // (03.22.00 mdl) Report total time for test.
00479   float t = (GetTickCount() - (float)liStartTime)  / 1000;
00480   swprintf(sz, L"Test suite complete.  Elapsed time: %2.4f seconds", t);
00481   ShowResults(SysAllocString(sz), FALSE);
00482
00483
00484   UpdateStatus(m_pCurrentThreadData, m_nSuiteIndex);
00485
00486   ::EnableWindow(GetDlgItem(IDC_RUN_SUITE), TRUE);
00487   ::EnableWindow(GetDlgItem(IDC_SUBMIT), TRUE);
00488   ::EnableWindow(GetDlgItem(IDC_STOP), FALSE);
00489
00490   ShowResults(SysAllocString(L"Finished Running Test Suite."), FALSE);
00491   return 0;
00492 }
00493
00494
00495 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00496   Function: CBankDlg::ConsumeAllMessages
00497 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00498 void CBankDlg::ConsumeAllMessages()
00499 {
00500   MSG msg;
00501
00502   while ( PeekMessage( &msg, m_hWnd, 0, 0, PM_REMOVE ) )
00503   {
00504     if (!TranslateAccelerator(m_hWnd, g_hAccel, &msg))
00505     {
00506       if (!::IsDialogMessage(m_hWnd, &msg))
00507       {
00508         TranslateMessage(&msg);
00509         DispatchMessage(&msg);
00510       }
00511     }
00512
00513   }
00514
00515 }
00516
00517
00518 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00519   Function: CBankDlg::OnClose
00520 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00521 LRESULT CBankDlg::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00522 {
00523   g_bStop = TRUE;
00524
00525   for (int i = 0; i< g_nThreadsRunning; i++)
00526   {
00527     TerminateThread(g_pHandles[i] ,666);
00528   }
00529   PostQuitMessage(0);
00530   EndDialog(0);
00531   return 0;
00532 }
00533
00534
00535 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00536   Function: CBankDlg::DoWork
00537   Summary:  Start doing the actual work here...
00538 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00539 void CBankDlg::DoWork(CThreadData * pData, int nTestType)
00540 {
00541
00542   POINT pt;
00543   ::SetClassLong(m_hWnd, GCL_HCURSOR, (long)LoadCursor(NULL, IDC_APPSTARTING));
00544   GetCursorPos(&pt);
00545   SetCursorPos(pt.x, pt.y);
00546
00547   g_bStop = FALSE;
00548
00549
00550   DWORD dwThreadId;
00551   _ASSERTE(g_hWndResults);
00552   switch (nTestType)
00553   {
00554
00555     case MOVEMONEY:
00556     {
00557       g_nThreadsRunning = (pData -> GetThreadData()) -> nThreads;
00558       g_pHandles = new HANDLE[g_nThreadsRunning];
00559       for (int i=0; i<g_nThreadsRunning; i++)
00560       {
00561         g_pHandles[i] = CreateThread( NULL, 0, MoveMoneyThread, (void *)pData -> GetThreadData(), NULL, &dwThreadId);
00562       }
00563       break;
00564     }
00565     case ACCOUNT:
00566     {
00567       g_nThreadsRunning = (pData -> GetThreadData()) -> nThreads;
00568       g_pHandles = new HANDLE[g_nThreadsRunning];
00569       for (int i=0; i<g_nThreadsRunning; i++)
00570       {
00571         g_pHandles[i] = CreateThread( NULL, 0, AccountThread, (void *)pData -> GetThreadData(), NULL, &dwThreadId);
00572       }
00573       break;
00574     }
00575     case VERIFY_SCHEMA:
00576       g_nThreadsRunning = 1;
00577       g_pHandles = new HANDLE[g_nThreadsRunning];
00578       *g_pHandles = CreateThread( NULL, 0, CreateSchemaThread, (void *)NULL, NULL, &dwThreadId);
00579       break;
00580     case CREATEROWS:
00581       g_nThreadsRunning = 1;
00582       g_pHandles = new HANDLE[g_nThreadsRunning];
00583       g_nRows = GetDlgItemInt(IDC_ROWS);
00584       *g_pHandles = CreateThread( NULL, 0, CreateRowsThread, (void *)g_nRows, NULL, &dwThreadId);
00585       break;
00586
00587     default:
00588       _ASSERTE(0);
00589   }
00590
00591   DWORD dwRet;
00592   int nFinishedThead = 0;
00593   while (nFinishedThead <  g_nThreadsRunning)
00594   {
00595     //
00596     //  we wait until all threads are signaled, but we wait for them one at a time
00597     //  (a thread is signaled when it exits, and stays that way)...here we wait
00598     //  for the first thread to exit, and then wait on the second. if it has already
00599     //  exited, MsgWaitForMultipleObjects emmediately returns, and we wait for the next thread
00600     //  and so on
00601     //
00602     dwRet = MsgWaitForMultipleObjects(1, g_pHandles + nFinishedThead, FALSE, INFINITE, QS_ALLINPUT);
00603     if (dwRet == WAIT_OBJECT_0)
00604     {
00605       //
00606       //   a thread finished
00607       //
00608       nFinishedThead++;
00609     }
00610     else
00611     {
00612       ConsumeAllMessages();
00613     }
00614   }
00615
00616   ConsumeAllMessages();       // there may be messages in the Q that haven't been processed since the last thread exited
00617   g_nThreadsRunning = 0;
00618   delete [] g_pHandles;
00619
00620   g_pHandles = NULL;
00621   HCURSOR hCur = LoadCursor(NULL, IDC_ARROW);
00622   SetClassLong(m_hWnd, GCL_HCURSOR, (long)hCur);
00623   SetCursor(hCur);
00624   GetCursorPos(&pt);
00625   SetCursorPos(pt.x, pt.y);
00626
00627
00628 }
00629
00630
00631 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00632   Function: CBankDlg::OnStop
00633 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00634 LRESULT CBankDlg::OnStop(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00635 {
00636   g_bStop = TRUE;
00637   ::EnableWindow(GetDlgItem(IDC_STOP), FALSE);
00638   return 0;
00639 }
00640
00641
00642 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00643   Function: CBankDlg::OnGo
00644 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00645 LRESULT CBankDlg::OnGo(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00646 {
00647
00648   SaveAll();
00649
00650   //
00651   //  save current settings
00652   //
00653   GetThreadData(m_pCurrentThreadData -> GetThreadData());
00654
00655
00656   ListView_DeleteAllItems(g_hWndResults);
00657   ::EnableWindow(GetDlgItem(IDC_SUBMIT), FALSE);
00658   ::EnableWindow(GetDlgItem(IDC_STOP), TRUE);
00659   ::EnableWindow(GetDlgItem(IDC_RUN_SUITE), FALSE);
00660
00661   DoWork(m_pCurrentThreadData, m_pCurrentThreadData -> GetThreadData() -> nTestType);
00662
00663   ::EnableWindow(GetDlgItem(IDC_SUBMIT), TRUE);
00664   ::EnableWindow(GetDlgItem(IDC_STOP), FALSE);
00665   ::EnableWindow(GetDlgItem(IDC_RUN_SUITE), TRUE);
00666   return 0;
00667 }
00668
00669
00670 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00671   Function: CBankDlg::OnDestroy
00672 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00673 LRESULT CBankDlg::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00674 {
00675   bHandled = FALSE; // continue processing
00676   return 0;
00677
00678 }
00679
00680
00681 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00682   Function: CBankDlg::OnCreateRows
00683 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00684 LRESULT CBankDlg::OnCreateRows(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00685 {
00686   SaveAll();
00687
00688   //
00689   //  save current settings
00690   //
00691   GetThreadData(m_pCurrentThreadData -> GetThreadData());
00692
00693
00694   ListView_DeleteAllItems(g_hWndResults);
00695   ::EnableWindow(GetDlgItem(IDC_SUBMIT), FALSE);
00696   ::EnableWindow(GetDlgItem(IDC_STOP), TRUE);
00697   ::EnableWindow(GetDlgItem(IDC_RUN_SUITE), FALSE);
00698
00699   DoWork(m_pCurrentThreadData, CREATEROWS);
00700
00701   ::EnableWindow(GetDlgItem(IDC_SUBMIT), TRUE);
00702   ::EnableWindow(GetDlgItem(IDC_STOP), FALSE);
00703   ::EnableWindow(GetDlgItem(IDC_RUN_SUITE), TRUE);
00704
00705   return 0;
00706 }
00707
00708
00709 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00710   Function: CBankDlg::GetThreadData
00711 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00712 void CBankDlg::GetThreadData(THREADDATA * pTd)
00713 {
00714   if (!pTd)
00715   {
00716     _ASSERTE(0);
00717     return;
00718   }
00719
00720   //
00721   //  get all settings from current settings except for the new UI elements
00722   //
00723
00724   if (pTd != m_pCurrentThreadData -> GetThreadData())
00725   {
00726     memcpy(pTd, m_pCurrentThreadData -> GetThreadData(), sizeof *pTd);
00727   }
00728   pTd -> nFrom = GetDlgItemInt(IDC_FROM);
00729   pTd -> nTo = GetDlgItemInt(IDC_TO);
00730   pTd -> nIters = GetDlgItemInt(IDC_ITERS);
00731   pTd -> nAmount = GetDlgItemInt(IDC_AMOUNT);
00732   pTd -> nThreads = GetDlgItemInt(IDC_THREADS);
00733
00734
00735 }
00736
00737
00738 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00739   Function: CBankDlg::SetThreadData
00740 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00741 void CBankDlg::SetThreadData(THREADDATA * pTd)
00742 {
00743
00744   if (!pTd)
00745   {
00746     _ASSERTE(0);
00747     return;
00748   }
00749
00750   SetDlgItemInt(IDC_FROM, pTd -> nFrom );
00751   SetDlgItemInt(IDC_TO, pTd -> nTo);
00752   SetDlgItemInt(IDC_ITERS, pTd -> nIters);
00753   SetDlgItemInt(IDC_AMOUNT, pTd -> nAmount);
00754   SetDlgItemInt(IDC_THREADS, pTd -> nThreads);
00755
00756   ::EnableWindow(GetDlgItem(IDC_FROM), !pTd -> bRandom);
00757   ::EnableWindow(GetDlgItem(IDC_TO), !pTd -> bRandom);
00758
00759 }
00760
00761
00762 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00763   Function: CBankDlg::OnInitMenu
00764   Summary:  Allows us to update the UI in the menus
00765 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00766 LRESULT CBankDlg::OnInitMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00767 {
00768   HMENU hMenu = (HMENU)wParam;
00769
00770   THREADDATA * pTd = m_pCurrentThreadData -> GetThreadData();
00771
00772   CheckMenuItem(hMenu, ID_MM_TRANSFER,
00773           (pTd -> nTestType == MOVEMONEY &&  pTd -> nTranType == TRANSFER) ?
00774           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00775
00776   CheckMenuItem(hMenu, ID_MM_DEBIT,
00777           (pTd -> nTestType == MOVEMONEY &&  pTd -> nTranType == DEBIT) ?
00778           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00779
00780   CheckMenuItem(hMenu, ID_MM_CREDIT,
00781           (pTd -> nTestType == MOVEMONEY &&  pTd -> nTranType == CREDIT) ?
00782           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00783
00784   CheckMenuItem(hMenu, ID_AC_DEBIT,
00785           (pTd -> nTestType == ACCOUNT &&  pTd -> nTranType == DEBIT) ?
00786           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00787
00788   CheckMenuItem(hMenu, IDM_RETRY,
00789           (g_bRetry == TRUE) ?
00790           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00791
00792   CheckMenuItem(hMenu, ID_AC_CREDIT,
00793           (pTd -> nTestType == ACCOUNT &&  pTd -> nTranType == CREDIT) ?
00794           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00795
00796   CheckMenuItem(hMenu, ID_COINIT_MTA,  (pTd -> eCoInit == CoInitMTA) ?
00797           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00798
00799   CheckMenuItem(hMenu, ID_COINIT_STA,  (pTd -> eCoInit == CoInitSTA) ?
00800           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00801
00802   CheckMenuItem(hMenu, ID_COINIT_RANDOM,  (pTd -> eCoInit == CoInitRandom) ?
00803           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00804
00805   CheckMenuItem(hMenu, ID_LANG_C,  (pTd -> eLang == VC) ?
00806           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00807
00808   CheckMenuItem(hMenu, ID_LANG_VB,  (pTd -> eLang == VB) ?
00809           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00810
00811   CheckMenuItem(hMenu, ID_LANG_JAVA,  (pTd -> eLang == Java) ?
00812           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00813
00814   // (04.26.00 mdl) Include support for Delphi.
00815   CheckMenuItem(hMenu, ID_LANG_DELPHI,  (pTd -> eLang == Delphi) ?
00816           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00817
00818   CheckMenuItem(hMenu, ID_ASSERT_ON_ERRORS, g_bAssertOnErrors ?
00819             MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00820
00821   CheckMenuItem(hMenu, IDM_OPTION_ODBC_STOP, g_bStopOnODBCErrors ?
00822           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00823
00824   CheckMenuItem(hMenu, IDM_OPTION_CHATTY,  pTd -> bChatty ?
00825           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00826
00827   CheckMenuItem(hMenu, IDM_OPTION_CREATE_ITERATION, pTd -> bCreatePerIteration ?
00828           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00829
00830   CheckMenuItem(hMenu, IDM_RANDOM,    pTd -> bRandom ?
00831           MF_BYCOMMAND|MF_CHECKED : MF_BYCOMMAND|MF_UNCHECKED);
00832
00833   EnableMenuItem(hMenu, IDM_KILL_THREADS,  g_nThreadsRunning ?
00834           MF_BYCOMMAND | MF_ENABLED  : MF_BYCOMMAND | MF_GRAYED);
00835   bHandled = TRUE;
00836   return 0;
00837 }
00838
00839
00840 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00841   Function: CBankDlg::OnSize
00842 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00843 LRESULT CBankDlg::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00844 {
00845
00846   int fwSizeType = wParam;      // resizing flag
00847   int nWidth = LOWORD(lParam);  // width of client area
00848   int nHeight = HIWORD(lParam); // height of client area
00849   bHandled = FALSE;
00850
00851   RECT rect;
00852   ::GetWindowRect(g_hWndResults, &rect);
00853
00854   ScreenToClient(&rect);
00855
00856 	::MoveWindow(g_hWndResults, 0, rect.top , nWidth, nHeight - rect.top, TRUE);
00857   return 0;
00858
00859 }
00860
00861
00862 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00863   Function: CBankDlg::OnShowResults
00864 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00865 LRESULT CBankDlg::OnShowResults(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00866 {
00867   bHandled = TRUE;
00868
00869   if (m_hFile)
00870   {
00871     USES_CONVERSION;
00872     WCHAR buf[1024];
00873     ZeroMemory(buf, 1024 * sizeof(WCHAR));
00874     wsprintf(buf, L"%d\t%ld\t\t%s\r\n", m_nMsgs++, (long)wParam, (BSTR)lParam);
00875     DWORD dwWritten=0;
00876     DWORD dwSize = lstrlen(buf);
00877     WriteFile(m_hFile, buf, dwSize*sizeof(WCHAR), &dwWritten, NULL);
00878   }
00879   int nCount = ListView_GetItemCount(g_hWndResults);
00880   LV_ITEM item;
00881   WCHAR sz[8];
00882
00883   wsprintf(sz, L"%ld", nCount);
00884   memset(&item, NULL, sizeof(item));
00885   item.mask = LVIF_TEXT;
00886   item.iItem = nCount;
00887   item.pszText = sz;
00888   item.cchTextMax = lstrlen(sz);
00889
00890   ListView_InsertItem(g_hWndResults, &item);
00891   wsprintf(sz,L"%ld", (DWORD)wParam);
00892   ListView_SetItemText(g_hWndResults, nCount, 1, sz);
00893   BSTR sString = (BSTR)lParam;
00894   int nLen = SysStringLen(sString);
00895   if (nLen > m_nMaxRowLength)
00896     m_nMaxRowLength = nLen;
00897   ListView_SetItemText(g_hWndResults, nCount, 3, sString);
00898   ListView_EnsureVisible(g_hWndResults, nCount, FALSE);
00899   SysFreeString(sString);
00900   return 0;
00901
00902 }
00903
00904
00905 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00906   Function: CBankDlg::OnShowError
00907 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00908 LRESULT CBankDlg::OnShowError(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00909 {
00910   bHandled = TRUE;
00911
00912   if (m_hFile)
00913   {
00914     USES_CONVERSION;
00915     WCHAR buf[1024];
00916     ZeroMemory(buf, 1024 * sizeof(WCHAR));
00917     wsprintf(buf, L"%d\t%ld\tY\t%s\r\n", m_nMsgs++, (long)wParam, (BSTR)lParam);
00918     DWORD dwWritten=0;
00919     DWORD dwSize = lstrlen(buf);
00920     WriteFile(m_hFile, buf, dwSize*sizeof(WCHAR), &dwWritten, NULL);
00921   }
00922
00923   int nCount = ListView_GetItemCount(g_hWndResults);
00924   LV_ITEM item;
00925   WCHAR sz[8];
00926
00927   wsprintf(sz, L"%ld", nCount);
00928   memset(&item, NULL, sizeof(item));
00929   item.mask = LVIF_TEXT;
00930   item.iItem = nCount;
00931   item.pszText = sz;
00932   item.cchTextMax = lstrlen(sz);
00933
00934   ListView_InsertItem(g_hWndResults, &item);
00935   wsprintf(sz,L"%ld", (DWORD)wParam);
00936   ListView_SetItemText(g_hWndResults, nCount, 1, sz);
00937   ListView_SetItemText(g_hWndResults, nCount, 2, L"Y");
00938   BSTR sString = (BSTR)lParam;
00939   int nLen = SysStringLen(sString);
00940   if (nLen > m_nMaxRowLength)
00941     m_nMaxRowLength = nLen;
00942   ListView_SetItemText(g_hWndResults, nCount, 3, sString);
00943   ListView_EnsureVisible(g_hWndResults, nCount, FALSE);
00944   SysFreeString(sString);
00945   return 0;
00946
00947 }
00948
00949
00950 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00951   Function: CBankDlg::OnViewNext
00952 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00953 LRESULT CBankDlg::OnViewNext(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00954 {
00955
00956   //
00957   //  save current settings
00958   //
00959   GetThreadData(m_pCurrentThreadData -> GetThreadData());
00960
00961   if (m_nSuiteIndex < m_nTotalTests - 1)
00962   {
00963     m_nSuiteIndex++;
00964     m_pCurrentThreadData = (CThreadData *)m_pCurrentThreadData -> Next();
00965     UpdateStatus(m_pCurrentThreadData, m_nSuiteIndex);
00966   }
00967   else
00968   {
00969     MessageBeep(0);
00970   }
00971
00972   bHandled = TRUE;
00973   return 0;
00974 }
00975
00976
00977 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00978   Function: CBankDlg::OnViewPrev
00979 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00980 LRESULT CBankDlg::OnViewPrev(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00981 {
00982
00983   //
00984   //  save current settings
00985   //
00986   GetThreadData(m_pCurrentThreadData -> GetThreadData());
00987
00988   if (m_nSuiteIndex > 0)
00989   {
00990     m_nSuiteIndex--;
00991     m_pCurrentThreadData = (CThreadData *)m_pCurrentThreadData -> Previous();
00992     UpdateStatus(m_pCurrentThreadData, m_nSuiteIndex);
00993   }
00994   else
00995   {
00996     MessageBeep(0);
00997   }
00998   bHandled = TRUE;
00999   return 0;
01000
01001 }
01002
01003
01004 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01005   Function: CBankDlg::SaveAll
01006 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01007 BOOL CBankDlg::SaveAll()
01008 {
01009
01010   g_nRows = GetDlgItemInt(IDC_ROWS);
01011
01012   char szDir[MAX_PATH];
01013   ZeroMemory(szDir, MAX_PATH * sizeof(char));
01014   GetWindowsDirectoryA(szDir, MAX_PATH);
01015   strncat(szDir, "\\vcbank.dat", sizeof("\\vcbank.dat"));
01016   ofstream of( szDir, ios::out | ios::binary , filebuf::sh_none    );
01017
01018   int version = FILE_VERSION;
01019   of.write((BYTE*)&version, sizeof(version));
01020   of.write((BYTE*)&m_nTotalTests, sizeof(m_nTotalTests));
01021   of.write((BYTE*)&g_bAssertOnErrors, sizeof(g_bAssertOnErrors));
01022   of.write((BYTE*)&g_bStopOnODBCErrors, sizeof(g_bStopOnODBCErrors));
01023   of.write((BYTE*)&g_nRows, sizeof(g_nRows));
01024   of.write((BYTE*)&g_bRetry, sizeof(g_bRetry));
01025
01026   int nWidth = 0;
01027   for (int i=0;i<NUMBER_OF_COLUMNS; i++)
01028   {
01029     nWidth = ListView_GetColumnWidth(g_hWndResults, i);
01030     of.write((BYTE*)&nWidth, sizeof(int));
01031   }
01032
01033
01034   WINDOWPLACEMENT wp;
01035   ZeroMemory(&wp, sizeof wp);
01036   wp.length = sizeof(wp);
01037   GetWindowPlacement(&wp);
01038
01039   of.write((BYTE *)&wp, sizeof wp);
01040
01041   CThreadData * pThreadData = NULL;
01042   CLinkable* pLinkable  = m_list.First();
01043   while ( pLinkable != &m_list)
01044   {
01045     pThreadData = ( CThreadData * )pLinkable;
01046     of.write((BYTE *)pThreadData -> GetThreadData(), sizeof(THREADDATA));
01047     pLinkable = pLinkable -> Next();
01048   }
01049
01050   return TRUE;
01051
01052 }
01053
01054
01055 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01056   Function: CBankDlg::LoadAll
01057 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01058 BOOL CBankDlg::LoadAll()
01059 {
01060
01061   char szDir[MAX_PATH];
01062   ZeroMemory(szDir, MAX_PATH * sizeof(char));
01063   GetWindowsDirectoryA(szDir, MAX_PATH);
01064   strncat(szDir, "\\vcbank.dat", sizeof("\\vcbank.dat"));
01065   ifstream ifs( szDir, ios::in | ios::binary , filebuf::sh_none    );
01066
01067   int version = 0;
01068
01069   ifs.read((BYTE *)&version, sizeof(version));
01070
01071   CThreadData * pData = NULL;
01072   if (version != FILE_VERSION)
01073   {
01074     // use defaults
01075
01076     g_nRows = 0;
01077
01078     int i;
01079     for (i=0; i<m_nTotalTests; i++)
01080     {
01081       pData = new CThreadData(&g_pSuite[i]);
01082       m_list.InsertLast(pData);
01083     }
01084
01085   ShowWindow(SW_SHOWNORMAL);
01086   SetDlgItemInt(IDC_ROWS, 100);
01087   DoWork(pData, VERIFY_SCHEMA);
01088   DoWork(pData, CREATEROWS);
01089
01090     return TRUE;
01091   }
01092
01093
01094   ifs.read((BYTE *)&m_nTotalTests, sizeof(m_nTotalTests));
01095   ifs.read((BYTE *)&g_bAssertOnErrors, sizeof(g_bAssertOnErrors));
01096   ifs.read((BYTE *)&g_bStopOnODBCErrors, sizeof(g_bStopOnODBCErrors));
01097   ifs.read((BYTE *)&g_nRows, sizeof(g_nRows));
01098   ifs.read((BYTE *)&g_bRetry, sizeof(BOOL));
01099
01100   int nWidth;
01101   int i;
01102
01103   for (i=0;i<NUMBER_OF_COLUMNS; i++)
01104   {
01105     ifs.read((BYTE*)&nWidth, sizeof(int));
01106     ListView_SetColumnWidth(g_hWndResults, i, nWidth);
01107   }
01108
01109   WINDOWPLACEMENT wp;
01110   ZeroMemory(&wp, sizeof wp);
01111   wp.length = sizeof(wp);
01112   ifs.read((BYTE *)&wp, sizeof wp);
01113   SetWindowPlacement(&wp);
01114
01115   THREADDATA td;
01116
01117   for (i=0; i< (int)m_nTotalTests; i++)
01118   {
01119     ifs.read((char *)&td, sizeof(THREADDATA));
01120     pData = new CThreadData(&td);
01121     m_list.InsertLast(pData);
01122   }
01123
01124   return TRUE;
01125
01126 }
01127
01128
01129 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01130   Function: CBankDlg::OnSave
01131 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01132 LRESULT CBankDlg::OnSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
01133 {
01134   SaveAll();
01135
01136   return 0;
01137 }
01138
01139
01140 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01141   Function: CBankDlg::OnAdd
01142 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01143 LRESULT CBankDlg::OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
01144 {
01145
01146   CThreadData * pData = new CThreadData();
01147   GetThreadData(pData -> GetThreadData());
01148   m_list.InsertLast(pData);
01149   m_pCurrentThreadData = pData;
01150   m_nTotalTests++;
01151   m_nSuiteIndex = m_nTotalTests - 1;
01152   UpdateStatus(m_pCurrentThreadData, m_nSuiteIndex);
01153   return 0;
01154 }
01155
01156
01157 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01158   Function: CBankDlg::UpdateStatus
01159 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01160 void CBankDlg::UpdateStatus(CThreadData * pData, int nCurItem)
01161 {
01162   if (m_nTotalTests != 0)
01163   {
01164     SetThreadData(pData -> GetThreadData());
01165     WCHAR sz[32];
01166     wsprintf(sz, L"Test %d of %d", nCurItem+1, m_nTotalTests);
01167     SetDlgItemText(IDC_SUITE_STATUS, sz);
01168     SetDescription(pData -> GetThreadData());
01169   }
01170   else
01171   {
01172     THREADDATA td;
01173     ZeroMemory(&td, sizeof(td));
01174     SetThreadData(&td);
01175     SetDlgItemText(IDC_SUITE_STATUS, L"Test 0 of 0");
01176     SetDescription(NULL);
01177   }
01178 }
01179
01180
01181 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01182   Function: CBankDlg::OnRemove
01183 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01184 LRESULT CBankDlg::OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
01185 {
01186   bHandled = TRUE;
01187
01188   if (m_nTotalTests == 0)
01189   {
01190     MessageBeep(0);
01191     return 0;
01192   }
01193   if (m_nSuiteIndex != m_nTotalTests - 1) // not removing the last one
01194   {
01195     CThreadData * pData = (CThreadData * )m_pCurrentThreadData -> Next();
01196     m_pCurrentThreadData -> Remove();
01197     m_pCurrentThreadData = pData;
01198   }
01199   else // removing the last one
01200   {
01201     CThreadData * pData = (CThreadData * )m_pCurrentThreadData -> Previous();
01202     m_pCurrentThreadData -> Remove();
01203     m_pCurrentThreadData = pData;
01204     m_nSuiteIndex--;
01205   }
01206
01207   m_nTotalTests--;
01208   UpdateStatus(m_pCurrentThreadData, m_nSuiteIndex);
01209   return 0;
01210 }
01211
01212
01213 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01214   Function: CBankDlg::OnCreateTables
01215 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01216 LRESULT CBankDlg::OnCreateTables(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
01217 {
01218   return 0;
01219 }
01220
01221
01222 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01223   Function: CBankDlg::SetDescription
01224   Summary:  Builds a textual description of a test and displays it
01225 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01226 void CBankDlg::SetDescription(THREADDATA *pData)
01227 {
01228   if (!pData)
01229   {
01230     SetDlgItemText(IDC_DESCRIPTION, L"");
01231     return;
01232   }
01233
01234   WCHAR sz[1024];
01235   ZeroMemory(sz, 1024*sizeof WCHAR);
01236
01237   switch (pData -> eLang)
01238   {
01239   case VC:
01240     _tcsncat(sz, L"C++ ", sizeof(L"C++ "));
01241     break;
01242   case VB:
01243     _tcsncat(sz, L"VB ", sizeof(L"VB "));
01244     break;
01245   case Java:
01246     _tcsncat(sz, L"Java ", sizeof(L"Java "));
01247     break;
01248   // (04.26.00 mdl) Include support for Delphi.
01249   case Delphi:
01250     _tcsncat(sz, L"Delphi ", sizeof(L"Delphi "));
01251     break;
01252   default:
01253     _ASSERTE(0);
01254   }
01255
01256   BOOL bMoveMoney = FALSE;
01257   switch (pData -> nTestType)
01258   {
01259   case MOVEMONEY:
01260     _tcsncat(sz, L"MoveMoney ", sizeof(L"MoveMoney "));
01261     bMoveMoney = TRUE;
01262     break;
01263   case ACCOUNT:
01264     _tcsncat(sz, L"Account ", sizeof(L"Account "));
01265     break;
01266   }
01267
01268   switch (pData -> nTranType)
01269   {
01270   case DEBIT:
01271     _tcsncat(sz, L"Debit ", sizeof(L"Debit "));
01272     break;
01273   case CREDIT:
01274     _tcsncat(sz, L"Credit ", sizeof(L"Credit "));
01275     break;
01276   case TRANSFER:
01277     _tcsncat(sz, L"Transfer ", sizeof(L"Transfer "));
01278     break;
01279   default:
01280     _ASSERTE(0);
01281   }
01282
01283   switch (pData -> eCoInit)
01284   {
01285   case CoInitMTA:
01286     _tcsncat(sz, L"in the MTA", sizeof(L"in the MTA"));
01287     break;
01288   case CoInitSTA:
01289     _tcsncat(sz, L"in the STA", sizeof(L"in the STA"));
01290     break;
01291   case CoInitRandom:
01292     _tcsncat(sz, L"in Random Apartments ", sizeof(L"in Random Apartments "));
01293     break;
01294   default:
01295     _ASSERTE(0);
01296
01297   }
01298
01299   _tcsncat(sz, L".  ", sizeof(L".  "));
01300   if (pData -> bChatty)
01301     _tcsncat(sz, L"Chatty Mode ", sizeof(L"Chatty Mode "));
01302   else
01303     _tcsncat(sz, L"Quiet Mode ", sizeof(L"Quiet Mode "));
01304
01305   if (pData -> bCreatePerIteration)
01306     _tcsncat(sz, L"doing a CCI Per iteration ", sizeof(L"doing a CCI Per iteration "));
01307   else
01308     _tcsncat(sz, L"Using JIT ", sizeof(L"Using JIT "));
01309
01310   if (pData -> bRandom)
01311     _tcsncat(sz, L"with Random Account Numbers", sizeof(L"with Random Account Numbers"));
01312   else
01313     _tcsncat(sz, L"with Accounts numbers specified ", sizeof(L"with Accounts numbers specified "));
01314
01315
01316
01317   SetDlgItemText(IDC_DESCRIPTION, sz);
01318
01319 }
01320
01321
01322 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01323   Function: CBankDlg::OnCopy
01324 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01325 LRESULT CBankDlg::OnCopy(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
01326 {
01327   UINT nSel = ListView_GetSelectedCount( g_hWndResults);
01328
01329   int nChars = (nSel + 1)* (m_nMaxRowLength + 32);
01330
01331
01332   HANDLE hMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE , sizeof(WCHAR) * nChars);
01333   WCHAR * buf = (WCHAR *)GlobalLock(hMem);
01334   ZeroMemory(buf, nChars * sizeof(WCHAR));
01335   WCHAR * p = buf;
01336   int nItem = -1;
01337   int nCol;
01338   int nLen = 0;
01339
01340   for (nCol=0;nCol<NUMBER_OF_COLUMNS; nCol++)
01341   {
01342
01343
01344   }
01345
01346   for (;;)
01347   {
01348     nItem = ListView_GetNextItem(g_hWndResults, nItem, LVNI_ALL | LVNI_SELECTED);
01349     if (nItem == -1)
01350       break;
01351     for (nCol=0;nCol<NUMBER_OF_COLUMNS; nCol++)
01352     {
01353       ListView_GetItemText( g_hWndResults, nItem, nCol, p, nChars);
01354       nLen = lstrlen(p);
01355       nChars -= nLen;
01356       _ASSERTE(nChars > 0);
01357       p += nLen;
01358       *p++ = '\t';
01359       nChars--;
01360     }
01361
01362     *p++ = '\r';
01363     *p++ = '\n';
01364     nChars -= 2;
01365     _ASSERTE(nChars>0);
01366
01367   }
01368
01369   BOOL bRet = ::OpenClipboard(NULL);
01370   if (bRet)
01371   {
01372     GlobalUnlock(hMem);
01373     SetClipboardData(CF_UNICODETEXT, hMem);
01374     CloseClipboard();
01375   }
01376
01377   return 0;
01378 }
01379
01380
01381 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01382   Function: CBankDlg::OnCopyAll
01383 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01384 LRESULT CBankDlg::OnCopyAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
01385 {
01386   UINT nCount = ListView_GetItemCount( g_hWndResults);
01387
01388   int nChars = nCount * (m_nMaxRowLength + 32);
01389   HANDLE hMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE , sizeof(WCHAR) * nChars);
01390   WCHAR * buf = (WCHAR *)GlobalLock(hMem);
01391   ZeroMemory(buf, nChars * sizeof(WCHAR));
01392   WCHAR * p = buf;
01393   UINT nItem = -1;
01394   int nCol;
01395   UINT nLen = 0;
01396   for (nItem = 0; nItem < nCount; nItem++)
01397   {
01398     for (nCol=0;nCol<NUMBER_OF_COLUMNS; nCol++)
01399     {
01400       ListView_GetItemText( g_hWndResults, nItem, nCol, p, nChars);
01401       nLen = lstrlen(p);
01402       nChars -= nLen;
01403       _ASSERTE(nChars > 0);
01404       p += nLen;
01405       *p++ = '\t';
01406       nChars--;
01407     }
01408
01409     *p++ = '\r';
01410     *p++ = '\n';
01411     nChars -= 2;
01412     _ASSERTE(nChars>0);
01413
01414   }
01415
01416   BOOL bRet = ::OpenClipboard(NULL);
01417   if (bRet)
01418   {
01419     GlobalUnlock(hMem);
01420     SetClipboardData(CF_UNICODETEXT, hMem);
01421     CloseClipboard();
01422   }
01423
01424   return 0;
01425 }
01426
01427
01428 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01429   Function: CBankDlg::OnCopyErrors
01430 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01431 LRESULT CBankDlg::OnCopyErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
01432 {
01433   UINT nCount = ListView_GetItemCount( g_hWndResults);
01434   int nChars = nCount * (m_nMaxRowLength + 32);
01435   HANDLE hMem = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE , sizeof(WCHAR) * nChars);
01436   WCHAR * buf = (WCHAR *)GlobalLock(hMem);
01437   ZeroMemory(buf, nChars * sizeof(WCHAR));
01438   WCHAR * p = buf;
01439   UINT nItem = -1;
01440   int nCol;
01441   UINT nLen = 0;
01442   int nErrors = 0;
01443   for (nItem = 0; nItem < nCount; nItem++)
01444   {
01445     ListView_GetItemText( g_hWndResults, nItem, ERROR_COLUMN, p, nChars);
01446     if (*p)
01447     {
01448       *p = NULL;
01449       nErrors++;
01450       for (nCol=0;nCol<NUMBER_OF_COLUMNS; nCol++)
01451       {
01452         ListView_GetItemText( g_hWndResults, nItem, nCol, p, nChars);
01453         nLen = lstrlen(p);
01454         nChars -= nLen;
01455         _ASSERTE(nChars > 0);
01456         p += nLen;
01457         *p++ = '\t';
01458         nChars--;
01459       }
01460
01461       *p++ = '\r';
01462       *p++ = '\n';
01463       nChars -= 2;
01464       _ASSERTE(nChars>0);
01465     }
01466
01467   }
01468
01469
01470   GlobalUnlock(hMem);
01471   if (nErrors == 0)
01472   {
01473     GlobalFree(hMem);
01474   }
01475   else
01476   {
01477
01478     BOOL bRet = ::OpenClipboard(NULL);
01479     if (bRet)
01480     {
01481       SetClipboardData(CF_UNICODETEXT, hMem);
01482       CloseClipboard();
01483     }
01484   }
01485
01486   return 0;
01487 }
01488
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Rename/vc/Rename.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Rename
  • vc

Rename.cpp

Go to the documentation of this file.
00001 // Rename.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "stdio.h"
00006 #include "activeds.h"
00007
00008 int main(int argc, char* argv[])
00009 {
00010 HRESULT hr;
00011 IADsContainer *pCont=NULL;
00012 IDispatch *pDisp=NULL;
00013
00014 CoInitialize(NULL);
00015
00016 hr = ADsGetObject(L"LDAP://CN=Users,DC=Microsoft,DC=COM", IID_IADsContainer, (void**) &pCont);
00017 if (FAILED(hr) )
00018 {
00019   return 0;
00020 }
00021
00022 hr = pCont->MoveHere(L"LDAP://CN=Jeff Smith,CN=Users,DC=Microsoft,DC=COM",L"CN=Jeffrey Smith", &pDisp );
00023 if ( SUCCEEDED(hr) )
00024 {
00025   pDisp->Release();
00026 }
00027
00028 CoUninitialize();
00029
00030 return 0;
00031 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IPartitionProperties Member List

This is the complete list of members for IPartitionProperties, including all inherited members.
HrGetFriendlyName(BSTR *pbstrNameOut) | IPartitionProperties
HrIsNTFS(void) | IPartitionProperties
HrIsThisLogicalDisk(WCHAR cLogicalDiskIn) | IPartitionProperties
HrSetDeviceID(BSTR bstDeviceIDIn) | IPartitionProperties
Generated on Wed Nov 13 2024 16:57:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/filerepserverproc.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

filerepserverproc.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: FileRepServerProc.c
00008
00009     PURPOSE: Remote procedures for server system service
00010
00011     FUNCTIONS:
00012         RemoteOpen() - Open the file.  It also gets some
00013     some data from the file, and closes the file if all data
00014     has been read at once.  This enhances performance.
00015         RemoteRead() - Read a buffer's worth of the file.  It
00016     closes the file if EOF has been reached.
00017
00018     COMMENTS:
00019
00020 */
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <string.h>
00025
00026 #include "common.h"
00027
00028 // header file generated by MIDL compiler
00029 #include "FileRepServer.h"
00030
00031 // Declarations for service routines.
00032 #include "Service.h"
00033
00034 typedef struct {
00035     HANDLE hFile;
00036     // We use this byte to check if EOF has been
00037     // reached on read.  The byte is put into
00038     // the first position of the next buffer read if EOF
00039     // has not been reached.
00040     BYTE EOFCheck;
00041 } FILE_CONTEXT_TYPE;
00042
00043 /*
00044   This is a procedure that actually reads file data.
00045   It performs the reading tasks common to RemoteOpen and RemoteRead.
00046   Notice that nToRead is the number of bytes to read.
00047 */
00048 VOID ReadData(HANDLE hFile, VOID *pbBuf, unsigned long nToRead, unsigned long *cbRead, BOOL *bEOF, BYTE *EOFCheck) {
00049
00050     if(!ReadFile(hFile, pbBuf, nToRead+1, cbRead, NULL)) {
00051
00052   // We want to raise an exception but leave the context intact
00053   // so that subsequent reads may be attempted.
00054
00055   RpcRaiseException(GetLastError());
00056         return;
00057     }
00058
00059     // Check for EOF.
00060     *bEOF = FALSE;
00061     // If we read in the whole buffer, save the last byte.
00062     if(*cbRead == nToRead+1) {
00063   *EOFCheck = ((BYTE *)pbBuf)[(nToRead+1)-1];
00064
00065   // return at most nToRead read bytes.
00066   *cbRead = nToRead;
00067     }
00068     // If we did not read the whole buffer then we reached the EOF.
00069     else{
00070   *bEOF = TRUE;
00071     }
00072 }
00073
00074 /*
00075     FUNCTION: s_RemoteOpen
00076
00077     PURPOSE: Opens a file on the server and returns some file data.
00078
00079     PARAMETERS:
00080         hFileRepServer - RPC binding
00081         pphContext - the context handle associated with the open file
00082         pszFileName -  file to open
00083   pbBuf - buffer to read into
00084   cbRead - number of bytes read into the buffer
00085
00086     RETURN VALUE:
00087         none
00088
00089     COMMENTS:
00090 */
00091 VOID s_RemoteOpen(handle_t hFileRepServer,
00092       PCONTEXT_HANDLE_TYPE *pphContext,
00093       LPTSTR pszFileName,
00094       BYTE *pbBuf,
00095       unsigned long *cbRead)
00096 {
00097     HANDLE hFile;
00098     FILE_CONTEXT_TYPE *pFileContext;
00099     BOOL bEOF = FALSE;
00100     BYTE EOFCheck;
00101     INT status;
00102
00103     if ((hFile = CreateFile(pszFileName,
00104           GENERIC_READ,
00105           FILE_SHARE_READ,
00106           NULL,
00107           OPEN_EXISTING,
00108           FILE_ATTRIBUTE_NORMAL,
00109           NULL)) == INVALID_HANDLE_VALUE) {
00110
00111   RpcRaiseException(GetLastError());
00112
00113         return;
00114     }
00115
00116     // Read data from file into the buffer.
00117     // This function may throw exceptions, but we would want
00118     // those to propagate out.
00119     ReadData(hFile, (VOID *)pbBuf, OPEN_BUFSIZE, cbRead, &bEOF, &EOFCheck);
00120
00121     // Check if EOF has been reached.
00122     if(bEOF) {
00123   // If it has, we can simply return.
00124
00125   // Since all of the read has completed, the [out] context handle
00126   // pointer is NULL.
00127   pFileContext = NULL;
00128   *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00129
00130   status = CloseHandle(hFile);
00131   ASSERTE(status != 0);
00132
00133   return;
00134     }
00135     else {
00136   // Otherwise we need to allocate, initialize, and return the
00137   // context handle.  Actually, we do not have to explicitly
00138   // allocate it if we do not want to.
00139   if((pFileContext = (FILE_CONTEXT_TYPE *) midl_user_allocate(sizeof(FILE_CONTEXT_TYPE))) == NULL) {
00140
00141       status = CloseHandle(hFile);
00142       ASSERTE(status != 0);
00143       RpcRaiseException(ERROR_OUTOFMEMORY);
00144       return;
00145   }
00146
00147   // Initialize the context handle fields.
00148   pFileContext->hFile = hFile;
00149
00150   pFileContext->EOFCheck = EOFCheck;
00151
00152   *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00153
00154   return;
00155     }
00156 }
00157
00158 /*
00159     FUNCTION: s_RemoteRead
00160
00161     PURPOSE: Opens a file on the server and returns some file data.
00162
00163     PARAMETERS:
00164         hFileRepServer - RPC binding
00165         pphContext - the context handle associated with the open file
00166   pbBuf - buffer to read into
00167   cbRead - number of bytes read into the buffer
00168
00169     RETURN VALUE:
00170         none
00171
00172     COMMENTS:
00173 */
00174 VOID s_RemoteRead(handle_t hFileRepServer,
00175       PCONTEXT_HANDLE_TYPE *pphContext,
00176       BYTE *pbBuf,
00177       unsigned long *cbRead)
00178 {
00179     FILE_CONTEXT_TYPE *pFileContext;
00180     BOOL bEOF = FALSE;
00181     BYTE EOFCheck;
00182     INT status;
00183
00184     // Make sure that the provided context handle is not NULL.
00185     if(*pphContext == NULL) {
00186
00187   RpcRaiseException(RPC_X_SS_IN_NULL_CONTEXT);
00188         return;
00189     }
00190
00191     pFileContext = (FILE_CONTEXT_TYPE *) *pphContext;
00192
00193     // Remember that we have a byte left over from RemoteOpen EOF check.
00194     pbBuf[0] = pFileContext->EOFCheck;
00195
00196     // Read the following bytes from file, but remember that we now only
00197     // have space for READ_BUFSIZE-1 bytes and we write starting
00198     // from the 1st index.  We will let possible exceptions propagate out.
00199     ReadData(pFileContext->hFile, (VOID *)&(pbBuf[1]), READ_BUFSIZE-1, cbRead, &bEOF, &EOFCheck);
00200
00201     // Since we had the first byte left over from the previous read, pretend
00202     // that we read it.
00203     (*cbRead)++;
00204
00205     if(bEOF){
00206         // If it has, we can destroy the context handle, close
00207         // the file and return.
00208   status = CloseHandle(pFileContext->hFile);
00209         ASSERTE(status != 0);
00210
00211   midl_user_free(*pphContext);
00212
00213   // Return NULL context handle to signify that the file has
00214   // been completely read.
00215   pFileContext = NULL;
00216   *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00217
00218   return;
00219     }
00220
00221     // Memorize the last byte read for the next read.
00222     pFileContext->EOFCheck = EOFCheck;
00223
00224     // Otherwise we just return the number of symbols read in cbRead.
00225     return;
00226 }
00227
00228 // The rundown routine is associated with the context handle type.
00229 // When a connection breaks, the server stub and the run-time
00230 // library will call this routine.
00231 void __RPC_USER PCONTEXT_HANDLE_TYPE_rundown(PCONTEXT_HANDLE_TYPE phContext) {
00232     FILE_CONTEXT_TYPE *pFileContext;
00233     INT status;
00234
00235     // We need to try and close the file associated with the
00236     // context handle...
00237
00238     // Context handle can not be NULL in this section, so we can
00239     // go ahead and try closing the file.
00240     pFileContext = (FILE_CONTEXT_TYPE *) phContext;
00241
00242     // Also, we do not need to worry about pFileContext->hFile's being
00243     // null since we checked for it when we opened the file.
00244     status = CloseHandle(pFileContext->hFile);
00245     ASSERTE(status != 0);
00246
00247     // And then free the memory taken up by it.
00248     midl_user_free(phContext);
00249 }
00250
00251 // end FileRepServerProc.c
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CComboBoxString Member List

This is the complete list of members for CComboBoxString, including all inherited members.
AddString(WCHAR *pwszString) | CComboBoxLite | [inline, virtual]
AddString(WCHAR *pwszString, LPARAM lParam) | CComboBoxLite | [virtual]
CComboBoxLite(HWND hWndParent=NULL, UINT nID=0) | CComboBoxLite |
CComboBoxString() | CComboBoxString |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DeleteString(INDEX nIndex) | CComboBoxLite | [inline, virtual]
DestroyWindow() | CWndLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
FindString(WCHAR *pwszString, INDEX nStartIndex=-1) | CComboBoxLite | [inline, virtual]
FindStringExact(WCHAR *pwszString, INDEX nStartIndex=-1) | CComboBoxLite | [inline, virtual]
GetCount() | CComboBoxLite | [inline, virtual]
GetCurSel() const | CComboBoxLite | [inline, virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetItemParam(INDEX nIndex) const | CComboBoxLite | [inline, virtual]
GetSelText() | CComboBoxString | [virtual]
CComboBoxLite::GetSelText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CComboBoxLite | [virtual]
GetSelValue() | CComboBoxLite | [virtual]
GetText(INDEX nIndex, WCHAR *pwszBuffer) | CComboBoxLite | [inline, virtual]
GetTextLength(INDEX nIndex) | CComboBoxLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iSavedSel | CComboBoxLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropDown(INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CComboBoxString | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSelChange(INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
Populate(ULONG cItems, const WIDENAMEMAP *rgItems) | CComboBoxLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
ResetContent() | CComboBoxLite | [inline, virtual]
RestoreSelection() | CComboBoxLite | [inline, virtual]
SaveSelection() | CComboBoxLite | [inline, virtual]
SetCurSel(WPARAM nSelect) | CComboBoxLite | [inline, virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetItemParam(INDEX nIndex, LPARAM lParam) | CComboBoxLite | [inline, virtual]
SetSelText(WCHAR *pwszBuffer, BOOL fAddItem=FALSE) | CComboBoxLite | [virtual]
SetSelValue(LPARAM lParam) | CComboBoxLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CComboBoxLite() | CComboBoxLite | [virtual]
~CComboBoxString() | CComboBoxString | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:55:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Intermediate/Context.h Source File

  • Web
  • iis
  • Components
  • Cpp
  • Intermediate

Context.h

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c)    1997    Microsoft Corporation
00004
00005   Module  Name :
00006
00007     context.h
00008
00009   Abstract:
00010     A class to retrieve and release ASP intrinsics.  This class encapsulates the new way
00011     of getting access to ASP instinsic objects.  It does away with the need for OnStartPage
00012     and OnEndPage methods, and, by doing so, gives Application scope objects access to the
00013     intrinsics.  The intrincis should never be retained across calls, as the context may
00014     change between calls.
00015
00016   Author:
00017
00018     Neil Allain      August-1997
00019
00020   Revision History:
00021
00022 --*/
00023 #pragma once
00024 #ifndef _CONTEXT_H_
00025 #define _CONTEXT_H_
00026
00027 class CContext
00028 {
00029 public:
00030   enum {
00031     get_Server    = 0x0001,
00032     get_Response  = 0x0002,
00033     get_Request   = 0x0004,
00034     get_Session   = 0x0008,
00035     get_Application = 0x0010,
00036         get_All         = 0xFFFF
00037   };
00038
00039   HRESULT             Init( DWORD );
00040
00041   IRequest*     Request(){ _ASSERT(m_piRequest!=NULL); return m_piRequest; }
00042   IResponse*      Response(){ _ASSERT(m_piResponse!=NULL); return m_piResponse; }
00043   ISessionObject*   Session(){ _ASSERT(m_piSession!=NULL); return m_piSession; }
00044   IServer*      Server(){ _ASSERT(m_piServer!=NULL); return m_piServer; }
00045   IApplicationObject* Application(){ _ASSERT(m_piApplication!=NULL); return m_piApplication; }
00046
00047   static HRESULT    GetServerObject( IGetContextProperties*, BSTR, const IID&, void** );
00048
00049 private:
00050   CComPtr<IRequest>     m_piRequest;      //Request Object
00051   CComPtr<IResponse>      m_piResponse;     //Response Object
00052   CComPtr<ISessionObject>   m_piSession;      //Session Object
00053   CComPtr<IServer>      m_piServer;       //Server Object
00054   CComPtr<IApplicationObject> m_piApplication;    //Application Object
00055 };
00056
00057
00058 #endif  // !_CONTEXT_H_
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/StdAfx.h Source File

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

StdAfx.h

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 // stdafx.h : include file for standard system include files,
00003 //  or project specific include files that are used frequently, but
00004 //      are changed infrequently
00005 //
00006
00007 #if !defined(AFX_STDAFX_H__E868569C_0774_11D1_AD85_00AA00B8E05A__INCLUDED_)
00008 #define AFX_STDAFX_H__E868569C_0774_11D1_AD85_00AA00B8E05A__INCLUDED_
00009
00010 #if _MSC_VER >= 1000
00011 #pragma once
00012 #endif // _MSC_VER >= 1000
00013
00014 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00015
00016 #include <afxwin.h>         // MFC core and standard components
00017 #include <afxext.h>         // MFC extensions
00018 #ifndef _AFX_NO_AFXCMN_SUPPORT
00019 #include <afxcmn.h>     // MFC support for Windows Common Controls
00020 #endif // _AFX_NO_AFXCMN_SUPPORT
00021
00022
00023 //{{AFX_INSERT_LOCATION}}
00024 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00025
00026 #endif // !defined(AFX_STDAFX_H__E868569C_0774_11D1_AD85_00AA00B8E05A__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/ADOVCGEN/advcgen.h Source File

  • Dataaccess
  • ADO
  • ADOVCGEN

advcgen.h

Go to the documentation of this file.
00001 // ADVCGEN.h : main header file for the ADVCGEN application
00002 //
00003
00004 #if !defined(AFX_ADVCGEN_H__745DF779_D2F6_4E0E_97A8_EE39AF8C2117__INCLUDED_)
00005 #define AFX_ADVCGEN_H__745DF779_D2F6_4E0E_97A8_EE39AF8C2117__INCLUDED_
00006
00007 #if _MSC_VER > 1000
00008 #pragma once
00009 #endif // _MSC_VER > 1000
00010
00011 #ifndef __AFXWIN_H__
00012   #error include 'stdafx.h' before including this file for PCH
00013 #endif
00014
00015 #include "resource.h"   // main symbols
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CADVCGENApp:
00019 // See ADVCGEN.cpp for the implementation of this class
00020 //
00021
00022 class CADVCGENApp : public CWinApp
00023 {
00024 public:
00025   CADVCGENApp();
00026
00027 // Overrides
00028   // ClassWizard generated virtual function overrides
00029   //{{AFX_VIRTUAL(CADVCGENApp)
00030   public:
00031   virtual BOOL InitInstance();
00032   //}}AFX_VIRTUAL
00033
00034 // Implementation
00035
00036   //{{AFX_MSG(CADVCGENApp)
00037     // NOTE - the ClassWizard will add and remove member functions here.
00038     //    DO NOT EDIT what you see in these blocks of generated code !
00039   //}}AFX_MSG
00040   DECLARE_MESSAGE_MAP()
00041 };
00042
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045
00046 //{{AFX_INSERT_LOCATION}}
00047 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00048
00049 #endif // !defined(AFX_ADVCGEN_H__745DF779_D2F6_4E0E_97A8_EE39AF8C2117__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/msomniprovds.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

msomniprovds.h

Go to the documentation of this file.
00001 // Start of file MSOmniProvSource.h
00002 // File: MSOmniProvDS.h
00003 // This file contains the implementation for the CMSOmniProvSource class the data source...
00004 //
00005
00006 #ifndef __CMSOmniProvSource_H_
00007 #define __CMSOmniProvSource_H_
00008 #include "resource.h"       // main symbols
00009 #include "MSOmniProvRS.h"
00010
00011
00012 // CMSOmniProvSource
00013 class ATL_NO_VTABLE CMSOmniProvSource :
00014   public CComObjectRootEx<CComSingleThreadModel>,
00015   public CComCoClass<CMSOmniProvSource, &CLSID_MSOmniProv>,
00016   public IDBCreateSessionImpl<CMSOmniProvSource, CMSOmniProvSession>,
00017   public IDBInitializeImpl<CMSOmniProvSource>,
00018   public IDBPropertiesImpl<CMSOmniProvSource>,
00019   public IPersistImpl<CMSOmniProvSource>,
00020   public IInternalConnectionImpl<CMSOmniProvSource>
00021 {
00022 public:
00023   HRESULT FinalConstruct()
00024   {
00025     return FInit();
00026   }
00027 DECLARE_REGISTRY_RESOURCEID(IDR_MSOMNIPROV)
00028 BEGIN_PROPSET_MAP(CMSOmniProvSource)
00029   BEGIN_PROPERTY_SET(DBPROPSET_DATASOURCEINFO)
00030     PROPERTY_INFO_ENTRY(ACTIVESESSIONS)
00031     PROPERTY_INFO_ENTRY_VALUE(BYREFACCESSORS, VARIANT_TRUE)
00032     PROPERTY_INFO_ENTRY_VALUE(DATASOURCEREADONLY, VARIANT_FALSE)
00033     PROPERTY_INFO_ENTRY_VALUE(DSOTHREADMODEL,DBPROPVAL_RT_FREETHREAD)
00034     PROPERTY_INFO_ENTRY_VALUE(OUTPUTPARAMETERAVAILABILITY, DBPROPVAL_OA_NOTSUPPORTED)
00035     PROPERTY_INFO_ENTRY_VALUE(PROVIDEROLEDBVER, OLESTR("1.00"))
00036     PROPERTY_INFO_ENTRY_VALUE(PROVIDERVER, OLESTR("1.00"))
00037     PROPERTY_INFO_ENTRY_VALUE(SUPPORTEDTXNISOLEVELS,DBPROPVAL_TR_NONE)
00038     PROPERTY_INFO_ENTRY_VALUE(SQLSUPPORT,DBPROPVAL_SQL_NONE)  // Build-up SQL Support does not matter...
00039     PROPERTY_INFO_ENTRY_VALUE(USERNAME,OLESTR("Guest"))
00040   END_PROPERTY_SET(DBPROPSET_DATASOURCEINFO)
00041   BEGIN_PROPERTY_SET(DBPROPSET_DBINIT)
00042     PROPERTY_INFO_ENTRY_VALUE(AUTH_PASSWORD,OLESTR(""))
00043     PROPERTY_INFO_ENTRY_VALUE(AUTH_PERSIST_SENSITIVE_AUTHINFO,VARIANT_FALSE)
00044     PROPERTY_INFO_ENTRY_VALUE(AUTH_USERID,OLESTR("Guest"))
00045     PROPERTY_INFO_ENTRY_VALUE(INIT_DATASOURCE,OLESTR("Local"))
00046     PROPERTY_INFO_ENTRY(INIT_HWND)
00047     PROPERTY_INFO_ENTRY(INIT_LCID)
00048     PROPERTY_INFO_ENTRY_EX(INIT_OLEDBSERVICES,VT_I4,DBPROPFLAGS_DBINIT | DBPROPFLAGS_REQUIRED,  DBPROPVAL_OS_ENABLEALL,0)
00049     PROPERTY_INFO_ENTRY_VALUE(INIT_LOCATION,OLESTR(".\\"))
00050     PROPERTY_INFO_ENTRY_VALUE(INIT_MODE, DB_MODE_READWRITE)
00051     PROPERTY_INFO_ENTRY_VALUE(INIT_PROMPT,DBPROMPT_NOPROMPT)
00052     PROPERTY_INFO_ENTRY_VALUE(INIT_PROVIDERSTRING,OLESTR(""))
00053     PROPERTY_INFO_ENTRY(INIT_TIMEOUT)
00054   END_PROPERTY_SET(DBPROPSET_DBINIT)
00055   CHAIN_PROPERTY_SET(CMSOmniProvCommand)
00056 END_PROPSET_MAP()
00057 BEGIN_COM_MAP(CMSOmniProvSource)
00058   COM_INTERFACE_ENTRY(IDBCreateSession)
00059   COM_INTERFACE_ENTRY(IDBInitialize)
00060   COM_INTERFACE_ENTRY(IDBProperties)
00061   COM_INTERFACE_ENTRY(IPersist)
00062   COM_INTERFACE_ENTRY(IInternalConnection)
00063 END_COM_MAP()
00064 public:
00065 };
00066 #endif //__CMSOmniProvSource_H_
00067
00068 // End of file MSOmniProvSource.h
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/PAPER.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

PAPER.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PAPER.H
00003
00004   Summary:   Include file for the connectable COPaper COM object class.
00005
00006              COPaper offers a main standard IUnknown interface (basic COM
00007              object features), an implementation of the standard
00008              IConnectionPointContainer interface (connectable object
00009              features), and an implementation of the custom ISharePaper
00010              interface (shared drawing Paper-related features). This
00011              multiple interface COM Object Class is achieved via the
00012              technique of nested classes.  The implementation of the
00013              IConnectionPointContainer and ISharePaper interfaces are
00014              nested inside of the COPaper Class.
00015
00016              APPUTIL's CThreaded OwnThis technology is used in COPaper to
00017              ensure mutually exclusive access by contending multiple
00018              client threads.
00019
00020              For a comprehensive tutorial code tour of this module's
00021              contents and offerings see the tutorial DCDSERVE.HTM file.
00022              For more specific technical details on the internal workings
00023              see the comments dispersed throughout the module's source code.
00024
00025   Functions: .
00026
00027   Classes:   COPaper.
00028
00029   Origin:    8-23-97: atrent - Editor-inheritance from BALL.H in
00030              the CONSERVE Tutorial Code Sample. [Revised]
00031
00032 ----------------------------------------------------------------------------
00033   This file is part of the Microsoft COM Tutorial Code Samples.
00034
00035   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00036
00037   This source code is intended only as a supplement to Microsoft
00038   Development Tools and/or on-line documentation.  See these other
00039   materials for detailed information regarding Microsoft code samples.
00040
00041   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00042   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00043   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00044   PARTICULAR PURPOSE.
00045 ==========================================================================+*/
00046
00047 #if !defined(PAPER_H)
00048 #define PAPER_H
00049
00050 #ifdef __cplusplus
00051
00052
00053 // Current format version of Ink Data is 1.0. Thus, the format version
00054 // is a compile-time constant.
00055 #define INKDATA_VERSION10 MAKELONG(0,1)
00056
00057 // InkData allocation sizes for the Dynamic InkData array.
00058 enum
00059 {
00060   INKDATA_ALLOC_INIT = 3200,
00061   INKDATA_ALLOC = 800
00062 };
00063
00064 // The Ink Data structure.
00065 typedef struct _INKDATA
00066 {
00067   SHORT nType;            // Ink Type.
00068   SHORT nX;               // X-coordinate of ink point.
00069   SHORT nY;               // Y-coordinate of ink point.
00070   SHORT nWidth;           // Ink line width.
00071   COLORREF crColor;       // Ink color.
00072 } INKDATA;
00073
00074
00075 // Properties of our electronic paper.
00076 #define PAPER_TITLE_SIZE 64
00077 typedef struct _PAPER_PROPERTIES
00078 {
00079   LONG lInkDataVersion;
00080   LONG lInkArraySize;
00081   COLORREF crWinColor;
00082   RECT WinRect;
00083   WCHAR wszTitle[PAPER_TITLE_SIZE];
00084   WCHAR wszAuthor[PAPER_TITLE_SIZE];
00085   WCHAR wszReserved1[PAPER_TITLE_SIZE];
00086   WCHAR wszReserved2[PAPER_TITLE_SIZE];
00087 } PAPER_PROPERTIES;
00088
00089
00090 // Drawing Paper event constants.
00091 enum PAPER_EVENT
00092 {
00093   PAPER_EVENT_NONE = 0,
00094   PAPER_EVENT_LOCKED,
00095   PAPER_EVENT_UNLOCKED,
00096   PAPER_EVENT_LOADED,
00097   PAPER_EVENT_SAVED,
00098   PAPER_EVENT_INKSTART,
00099   PAPER_EVENT_INKDRAW,
00100   PAPER_EVENT_INKSTOP,
00101   PAPER_EVENT_ERASED,
00102   PAPER_EVENT_RESIZED
00103 };
00104
00105 // Some strings used in file storage.
00106 #define STREAM_PAPERDATA_USTR L"PAPERDATA"
00107 #define CLIPBDFMT_STR "CTS.SharePaper.1"
00108 #define PAP_FILE_EXT ".PAP"
00109
00110
00111 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00112   ObjectClass: COPaper
00113
00114   Summary:     COM object class for COPaper COM objects.  COM objects of
00115                this class offer custom ISharePaper interface features,
00116                InitPaper, Lock, InkStart, InkDraw, InkStop, GetInk, Erase,
00117                Resize. To make COPaper objects connectable, the standard
00118                IConnectionPointContainer interface features,
00119                FindConnectionPoint and EnumConnectionPoints are also
00120                implemented. The mulitple interfaces on this COM object are
00121                constructed via the nested interface classes technique.
00122                COPaper is also derived from APPUTIL's CThreaded to provide
00123                the OwnThis thread safety mechanism.
00124
00125   Interfaces:  IUnknown
00126                  Standard interface providing COM object features.
00127                IConnectionPointContainer
00128                  Standard Connection Point container features rendering
00129                  COPaper objects connectable objects.
00130                ISharePaper
00131                  Custom interface providing basic electronic drawing paper
00132                  features for a shared drawing.
00133
00134   Aggregation: Yes, COPaper COM Objects are aggregatable by passing
00135                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00136 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00137 class COPaper : public IUnknown, public CThreaded
00138 {
00139   public:
00140     // Main Object Constructor & Destructor.
00141     COPaper(IUnknown* pUnkOuter, CServer* pServer);
00142     ~COPaper(void);
00143
00144     // A general method for initializing this newly created object.
00145     // Creates any subordinate arrays, structures, or objects.
00146     HRESULT Init(void);
00147
00148     // IUnknown methods. Main object, non-delegating.
00149     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00150     STDMETHODIMP_(ULONG) AddRef(void);
00151     STDMETHODIMP_(ULONG) Release(void);
00152
00153   private:
00154     // We declare nested class interface implementations here.
00155
00156     class CImpIConnectionPointContainer : public IConnectionPointContainer,
00157                                           public CThreaded
00158     {
00159       public:
00160         // Interface Implementation Constructor & Destructor.
00161         CImpIConnectionPointContainer(COPaper* pCO, IUnknown* pUnkOuter);
00162         ~CImpIConnectionPointContainer(void);
00163
00164         // IUnknown methods.
00165         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00166         STDMETHODIMP_(ULONG) AddRef(void);
00167         STDMETHODIMP_(ULONG) Release(void);
00168
00169         // IConnectionPointContainer methods.
00170         STDMETHODIMP         FindConnectionPoint(REFIID, IConnectionPoint**);
00171         STDMETHODIMP         EnumConnectionPoints(IEnumConnectionPoints**);
00172
00173       private:
00174         // Data private to this interface implementation.
00175         COPaper*      m_pCO;          // Parent Object back pointer.
00176         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00177     };
00178
00179     class CImpISharePaper : public ISharePaper, public CThreaded
00180     {
00181       public:
00182         // Interface Implementation Constructor & Destructor.
00183         CImpISharePaper(COPaper* pCO, IUnknown* pUnkOuter);
00184         ~CImpISharePaper(void);
00185
00186         // IUnknown methods.
00187         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00188         STDMETHODIMP_(ULONG) AddRef(void);
00189         STDMETHODIMP_(ULONG) Release(void);
00190
00191         // ISharePaper methods.
00192         STDMETHODIMP         InitPaper(RECT* pWinRect, BOOL* pbFirst);
00193         STDMETHODIMP         Lock(BOOL bLock);
00194         STDMETHODIMP         Load(RECT* pWinRect);
00195         STDMETHODIMP         Save(void);
00196         STDMETHODIMP         InkStart(
00197                                SHORT nX,
00198                                SHORT nY,
00199                                SHORT nWidth,
00200                                COLORREF crInkColor);
00201         STDMETHODIMP         InkDraw(SHORT nX, SHORT nY);
00202         STDMETHODIMP         InkStop(SHORT nX, SHORT nY);
00203         STDMETHODIMP         GetInk(
00204                                LONG lIndex,
00205                                SHORT* pnInkType,
00206                                SHORT* pnX,
00207                                SHORT* pnY,
00208                                SHORT* pnInkWidth,
00209                                COLORREF* pcrInkColor);
00210         STDMETHODIMP         Erase(void);
00211         STDMETHODIMP         Resize(
00212                                LONG lWidth,
00213                                LONG lHeight);
00214
00215       private:
00216         // Data private to this interface implementation of ISharePaper.
00217         COPaper*      m_pCO;          // Parent Object back pointer.
00218         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00219
00220         // The following private data and methods constitute the working
00221         // heart of COPaper as an actual application object.
00222         PAPER_PROPERTIES m_PaperProperties; // For file storage.
00223         UINT          m_ClipBdFmt;    // ClipBoard Format.
00224         BOOL          m_bLocked;      // Paper lock state.
00225         RECT          m_WinRect;      // Current Window rectangle.
00226         COLORREF      m_crWinColor;   // Current window background color.
00227         COLORREF      m_crInkColor;   // Current ink color.
00228         SHORT         m_nInkWidth;    // Current ink width.
00229         LONG          m_lInkDataEnd;  // Current end of the ink data.
00230         LONG          m_lInkDataMax;  // Current end of the ink data array.
00231         INKDATA*      m_paInkData;    // Dynamic Ink data array pointer.
00232
00233         // Private utility methods of this interface implementation.
00234         HRESULT NextSlot(void);
00235     };
00236
00237     // Make the otherwise private and nested ISharePaper and
00238     // IConnectionPointContainer interface implementations a friend to
00239     // COM object instantiations of this COPaper COM object class.
00240     friend CImpIConnectionPointContainer;
00241     friend CImpISharePaper;
00242
00243     // Private method of main connectable COPaper COM object to broadcast
00244     // event notifications to all connected listening sinks.
00245     HRESULT NotifySinks(
00246               PAPER_EVENT PaperEvent,
00247               SHORT nX,
00248               SHORT nY,
00249               SHORT nInkWidth,
00250               COLORREF crInkColor);
00251
00252     // Private data of COPaper COM objects.
00253
00254     // Nested ISharePaper implementation instantiation. This interface
00255     // is instantiated inside this COPaper object as a native interface.
00256     CImpISharePaper   m_ImpISharePaper;
00257
00258     // Nested IConnectionPointContainer implementation instantiation.
00259     CImpIConnectionPointContainer m_ImpIConnectionPointContainer;
00260
00261     // Main Object reference count.
00262     ULONG             m_cRefs;
00263
00264     // Outer unknown (aggregation & delegation).
00265     IUnknown*         m_pUnkOuter;
00266
00267     // Pointer to this component server's control object.
00268     CServer*          m_pServer;
00269
00270     // The file path name for the paper file containing the shared drawing.
00271     TCHAR             m_szPapFile[MAX_PATH];
00272
00273     // The array of connection points for this connectable COM object.
00274     IConnectionPoint* m_aConnectionPoints[MAX_CONNECTION_POINTS];
00275 };
00276
00277 #endif // __cplusplus
00278
00279
00280 #endif // PAPER_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/Main.c Source File

  • WinUI
  • Shell
  • AppBar

Main.c

Go to the documentation of this file.
00001 //
00002 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 // PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 1993 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 //
00009 //  MODULE:     main.c
00010 //
00011 //  PURPOSE:    Startup functions and error handling
00012 //
00013 //  PLATFORMS:  Windows 95, Windows 98, Windows 2000, Windows NT 4.0
00014 //
00015 //  FUNCTIONS:
00016 //      WinMain()           - Entry point function
00017 //      DoMain()            - Main message loop
00018 //      InitApplication()   - Register window classes
00019 //      InitInstance()      - Create and display main windows
00020 //      ErrorHandlerEx()    - Generic error handler code
00021 //      DebugMsg()          - Prints formatted output to the debugger
00022 //
00023 //  COMMENTS:
00024 //
00025 //
00026
00027 #include <windows.h>
00028 #include <stdio.h>
00029 #include "globals.h"
00030 #include "resource.h"
00031
00032
00033 //////////////////////////////////////////////////////////////////////////////
00034 // Prototypes
00035
00036 int DoMain(void);
00037 VERSION DetermineVersion(void);
00038
00039 //////////////////////////////////////////////////////////////////////////////
00040 // Global Variables
00041
00042 VERSION version;
00043 HINSTANCE g_hInstance = NULL;
00044
00045
00046 //
00047 //  FUNCTION:   WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
00048 //
00049 //  PURPOSE:    Entry point function, initializes the application, instance,
00050 //              and then launches the message loop.
00051 //
00052 //  PARAMETERS:
00053 //      hInstance     - handle that uniquely identifies this instance of the
00054 //                      application
00055 //      hPrevInstance - always zero in Win32
00056 //      lpszCmdLine   - any command line arguements pass to the program
00057 //      nCmdShow      - the state which the application shows itself on
00058 //                      startup
00059 //
00060 //  RETURN VALUE:
00061 //      (int) Returns the value from PostQuitMessage().
00062 //
00063 //  COMMENTS:
00064 //
00065
00066 int PASCAL WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine,
00067                      int nCmdShow)
00068 {
00069     int iResult;
00070
00071     // Find out what OS we're running on in case we have to call any platform
00072     // specific code.
00073     version = DetermineVersion();
00074
00075     if (InitApplication(hInstance))
00076        if (InitInstance(hInstance, SW_SHOWDEFAULT))
00077            iResult = DoMain();
00078
00079     return iResult;
00080 }
00081
00082
00083 //
00084 //  FUNCTION:   DoMain(void)
00085 //
00086 //  PURPOSE:    This is the main message loop for the application.  It
00087 //              retrieves messages from the application's message queue and
00088 //              dispatches the messages to the appropriate window procedure.
00089 //
00090 //  PARAMETERS:
00091 //      none
00092 //
00093 //  RETURN VALUE:
00094 //      (int) Returns the value passed to PostQuitMessage().
00095 //
00096 //  COMMENTS:
00097 //
00098
00099 int DoMain( void )
00100 {
00101     MSG msg;
00102
00103     while (GetMessage(&msg, NULL, 0, 0))
00104     {
00105         TranslateMessage(&msg);   // Translates virtual key codes
00106         DispatchMessage(&msg);    // Dispatches message to window procedure
00107     }
00108
00109     return ((int) msg.wParam);
00110 }
00111
00112
00113 //
00114 //  FUNCTION:   InitApplication(HINSTANCE)
00115 //
00116 //  PURPOSE:    Registers the application's window class(es).
00117 //
00118 //  PARAMETERS:
00119 //      hInstance   - handle that uniquely identifies this application instance
00120 //
00121 //  RETURN VALUE:
00122 //      (BOOL) Returns TRUE if the window classes are registered successfully
00123 //             Returns FALSE otherwise
00124 //
00125 //  COMMENTS:
00126 //
00127
00128 #define DEFBKGDCOLOR (COLOR_WINDOW + 1)
00129 BOOL InitApplication(HINSTANCE hInstance)
00130 {
00131     WNDCLASSEX  wcx;
00132
00133     // The window class is not registered yet, so we have to fill a
00134     // window class structure with parameters that describe the
00135     // window class.
00136     wcx.cbSize        = sizeof(WNDCLASSEX);
00137     wcx.style         = 0;
00138     wcx.lpfnWndProc   = MainWndProc;
00139     wcx.cbClsExtra    = 0;
00140     wcx.cbWndExtra    = sizeof(LPVOID);
00141     wcx.hInstance     = hInstance;
00142     wcx.hIcon         = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON));
00143     wcx.hCursor       = LoadCursor(NULL, IDC_ARROW);
00144     wcx.hbrBackground = (HBRUSH)DEFBKGDCOLOR;
00145     wcx.lpszMenuName  = NULL;
00146     wcx.lpszClassName = TEXT("MSSampleAppbar");
00147     wcx.hIconSm       = LoadImage(hInstance,
00148                                   MAKEINTRESOURCE(IDI_APPICON),
00149                                   IMAGE_ICON,
00150                                   16, 16,
00151                                   0);
00152
00153     // Attempt to register the class first with the WNDCLASSEX structure
00154     // and if that doesn't work try just the WNDCLASS for NT and Win32s.
00155     if (!RegisterClassEx(&wcx))
00156     {
00157         if (!RegisterClass((LPWNDCLASS)&wcx.style))
00158         {
00159             ErrorHandler();
00160             return (FALSE);
00161         }
00162     }
00163
00164     return (TRUE);
00165 }
00166
00167
00168 //
00169 //  FUNCTION:   InitInstance(HINSTANCE, int)
00170 //
00171 //  PURPOSE:    Creates and displays the application's initial window(s).
00172 //
00173 //  PARAMETERS:
00174 //      hInstance   - handle which uniquely identifies this instance
00175 //      nCmdShow    - determines the state which the window should be initially
00176 //                    shown in
00177 //
00178 //  RETURN VALUE:
00179 //      (BOOL) Returns TRUE if the window(s) are created successfully.
00180 //             Returns FALSE otherwise.
00181 //
00182 //  COMMENTS:
00183 //
00184
00185 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
00186 {
00187     HWND hwnd;                       // temporary window handle
00188     BOOL bStatus = FALSE;            // holds return status for function
00189
00190     // Save the instance handle in global variable, which will be used in
00191     // many subsequent calls from this application to Windows
00192     g_hInstance = hInstance;
00193
00194     // Create a main window for this application instance
00195     hwnd = CreateWindowEx(WS_EX_CLIENTEDGE | WS_EX_TOOLWINDOW,
00196                           TEXT("MSSampleAppbar"),
00197                           TEXT("Win32 Sample AppBar"),
00198                           WS_POPUP | WS_THICKFRAME | WS_CLIPCHILDREN,
00199                           CW_USEDEFAULT,
00200                           CW_USEDEFAULT,
00201                           400,
00202                           200,
00203                           NULL,
00204                           NULL,
00205                           hInstance,
00206                           NULL
00207                          );
00208
00209     // If the window was successfully created, make the window visible,
00210     // update its client area, and return "success".  If the window
00211     // was not created, return "failure"
00212     if (hwnd)
00213     {
00214         ShowWindow(hwnd, nCmdShow); // Set to visible & paint non-client area
00215         UpdateWindow(hwnd);         // Tell window to paint client area
00216
00217         bStatus = TRUE;             // Indicate success, default is failure
00218     }
00219     else
00220     {
00221         ErrorHandler();
00222     }
00223
00224     return bStatus;                  // Return status code
00225 }
00226
00227
00228 //
00229 //  FUNCTION:   ErrorHandlerEx(WORD, LPSTR)
00230 //
00231 //  PURPOSE:    Calls GetLastError() and uses FormatMessage() to display the
00232 //              textual information of the error code along with the file
00233 //              and line number.
00234 //
00235 //  PARAMETERS:
00236 //      wLine    - line number where the error occured
00237 //      lpszFile - file where the error occured
00238 //
00239 //  RETURN VALUE:
00240 //      none
00241 //
00242 //  COMMENTS:
00243 //      This function has a macro ErrorHandler() which handles filling in
00244 //      the line number and file name where the error occured.  ErrorHandler()
00245 //      is always used instead of calling this function directly.
00246 //
00247
00248 void ErrorHandlerEx( INT wLine, LPSTR lpszFile )
00249 {
00250     LPVOID lpvMessage;
00251     DWORD  dwError;
00252     TCHAR  szBuffer[256];
00253
00254     // The the text of the error message
00255     dwError = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
00256                             FORMAT_MESSAGE_FROM_SYSTEM,
00257                             NULL,
00258                             GetLastError(),
00259                             MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
00260                             (LPTSTR)&lpvMessage,
00261                             0,
00262                             NULL);
00263
00264     // Check to see if an error occured calling FormatMessage()
00265     if (0 == dwError)
00266     {
00267         wsprintf(szBuffer, TEXT("An error occured calling FormatMessage().")
00268                  TEXT("Error Code %d"), GetLastError());
00269         MessageBox(NULL, szBuffer, TEXT("Generic"), MB_ICONSTOP |
00270                    MB_ICONEXCLAMATION);
00271         return;
00272     }
00273
00274     // Display the error message
00275     wsprintf(szBuffer, TEXT("Generic, Line=%d, File=%s"), wLine, lpszFile);
00276     MessageBox(NULL, lpvMessage, szBuffer, MB_ICONEXCLAMATION | MB_OK);
00277
00278     return;
00279 }
00280
00281
00282
00283 //
00284 //  FUNCTION:   DetermineVersion()
00285 //
00286 //  PURPOSE:    Returns whether the program is running on WinNT, Win32s,
00287 //              or Win95.
00288 //
00289 //  PARAMETERS:
00290 //      none
00291 //
00292 //  RETURN VALUE:
00293 //      (VERSION) Returns WINNT, WIN32S, or WIN95
00294 //
00295 //  COMMENTS:
00296 //
00297
00298 VERSION DetermineVersion(void)
00299 {
00300     DWORD dwVersion;
00301
00302     dwVersion = GetVersion();
00303     if (dwVersion < 0x80000000)
00304         return (WINNT);
00305     else
00306         if (LOBYTE(LOWORD(dwVersion)) < 4)
00307             return (WIN32S);
00308         else
00309             return (WIN95);
00310 }
00311
00312
00313 //
00314 //  FUNCTION:   DebugMsg(const TCHAR, ...)
00315 //
00316 //  PURPOSE:    Prints formatted output to the debugger ala printf.
00317 //
00318 //  PARAMETERS:
00319 //      *pFmt   - string with the necessary formatting codes
00320 //      ...     - arguments being embedded in the pFmt string.
00321 //
00322 //  RETURN VALUE:
00323 //      Returns number of bytes written or -1 if buffer is too small
00324 //
00325 //  COMMENTS:
00326 //      Calling this function should be just like calling printf.  The only
00327 //      difference is this function outputs to the debugger instead of STDOUT.
00328 //
00329
00330 int DebugMsg( const TCHAR *pFmt, ...)
00331 {
00332     int i;
00333     const int iMsgSize = 512;
00334     va_list pArgs;
00335     char szMsg[512];
00336
00337     // outputs formatted string to debugger
00338     // returns count of bytes written or -1 if buffer size is too small
00339
00340     va_start( pArgs, pFmt );
00341
00342     #ifdef UNICODE
00343         i = _vsnwprintf(szMsg, iMsgSize+1, pFmt, pArgs);
00344     #else
00345         i = _vsnprintf(szMsg, iMsgSize+1, pFmt, pArgs);
00346     #endif
00347
00348     va_end( pArgs );
00349
00350     OutputDebugString( szMsg );
00351
00352     return( i );
00353 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/sky.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
00029 HRESULT CSkyBasedVehicle::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00030 {
00031   HRESULT hr;
00032   IUnknown *pUnk = NULL;
00033   IMessageView *pMessageView = NULL;
00034
00035   hr = pConsole->QueryResultView(&pUnk);
00036
00037   if (SUCCEEDED(hr)) {
00038     hr = pUnk->QueryInterface(IID_IMessageView, (void **)&pMessageView);
00039
00040     if (SUCCEEDED(hr)) {
00041       pMessageView->SetIcon(Icon_Information);
00042       pMessageView->SetTitleText(L"Sky-based vehicles");
00043       pMessageView->SetBodyText(L"Sky-based vehicles have no child nodes.");
00044
00045       pMessageView->Release();
00046     }
00047
00048     pUnk->Release();
00049   }
00050
00051   return S_FALSE;
00052 }
00053
00054 HRESULT CSkyBasedVehicle::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00055 {
00056     // error message control
00057   LPOLESTR lpOleStr = NULL;
00058   HRESULT hr = StringFromCLSID(CLSID_MessageView, &lpOleStr);
00059     *ppViewType = lpOleStr;
00060
00061   return hr;
00062 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/proppageuserui.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

proppageuserui.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       proppageuserui.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "ProppageUserUI.h"
00013 #include "util.h"
00014 #include "adsprop.h"
00015
00016 ///////////////////////////////////////////////////////////////
00017
00018
00019
00020
00021
00022
00023 ///////////////////////////////////////////////////////////////
00024
00025 BEGIN_MESSAGE_MAP(CProppageUserUI, CPropertyPage)
00026   ON_BN_CLICKED(IDC_BUTTON_CHANGE_PICTURE, OnChangePicture)
00027   ON_BN_CLICKED(IDC_BUTTON_CLEAR_PICTURE, OnClearPicture)
00028   ON_EN_CHANGE(IDC_EDIT_EMPLOYEE_ID, OnEmployeeIDChange)
00029   ON_WM_DESTROY()
00030 END_MESSAGE_MAP()
00031
00032
00033 BOOL CProppageUserUI::OnInitDialog()
00034 {
00035   //
00036   // Verify that this page is only coming up for users
00037   //
00038   ASSERT(m_szClass == _T("user"));
00039
00040   BOOL bRes = CPropertyPage::OnInitDialog();
00041
00042
00043   m_thumbNailPhotoHolder.Initialize(GetPathEdit()->m_hWnd, GetPicture()->m_hWnd);
00044
00045
00046   //
00047   // Display data in UI
00048   //
00049   SetUIData();
00050   return bRes;
00051 }
00052
00053 HRESULT CProppageUserUI::Init(PWSTR pszPath, PWSTR pszClass)
00054 {
00055   //
00056   // Store local versions of the path and class
00057   //
00058   m_szPath = pszPath;
00059   m_szClass = pszClass;
00060
00061   //
00062   // Get the property page initialization parameters from the notify window
00063   //
00064   ADSPROPINITPARAMS InitParams = {0};
00065   InitParams.dwSize = sizeof(ADSPROPINITPARAMS);
00066   if (!ADsPropGetInitInfo(m_hNotifyObj, &InitParams))
00067   {
00068     return E_FAIL;
00069   }
00070
00071   if (FAILED(InitParams.hr))
00072   {
00073     return InitParams.hr;
00074   }
00075
00076   //
00077   // Store local versions of the IDirectoryObject interface pointer
00078   // and the writable attributes
00079   //
00080   m_spDsObj = InitParams.pDsObj;
00081   m_pWritableAttrs = InitParams.pWritableAttrs;
00082
00083   return S_OK;
00084 }
00085
00086 void CProppageUserUI::SetUIData()
00087 {
00088   //
00089   // Prime the controls with the data from the object
00090   //
00091   SetUIEmployeeID();
00092   SetUIPhoto();
00093 }
00094
00095 void CProppageUserUI::SetUIPhoto()
00096 {
00097   //
00098   // Get the thumbnailPhoto information from the object
00099   //
00100   m_thumbNailPhotoHolder.Read(m_spDsObj);
00101
00102   //
00103   // Disable the Change/Clear buttons if the user does not
00104   // have write permissions for the thumbnailPhoto attribute
00105   //
00106   if (!ADsPropCheckIfWritable(_T("thumbnailPhoto"), m_pWritableAttrs))
00107   {
00108     GetChangePictureButton()->EnableWindow(FALSE);
00109     GetClearPictureButton()->EnableWindow(FALSE);
00110   }
00111
00112 }
00113
00114
00115 void CProppageUserUI::OnChangePicture()
00116 {
00117   if (m_thumbNailPhotoHolder.Change(m_hWnd))
00118   {
00119     //
00120     // Enable the Apply button
00121     //
00122     SetModified(TRUE);
00123   }
00124 }
00125
00126 void CProppageUserUI::OnClearPicture()
00127 {
00128   if(m_thumbNailPhotoHolder.Clear())
00129   {
00130     //
00131     // Enable the Apply button
00132     //
00133     SetModified(TRUE);
00134   }
00135 }
00136
00137
00138
00139 void CProppageUserUI::SetUIEmployeeID()
00140 {
00141   LPWSTR lpszAttrArray[] = { _T("employeeID") };
00142   PADS_ATTR_INFO pAttrInfo;
00143   DWORD dwReturned = 0;
00144
00145   //
00146   // Get the employee ID
00147   //
00148   HRESULT hr = m_spDsObj->GetObjectAttributes(lpszAttrArray, 1, &pAttrInfo, &dwReturned);
00149   if (FAILED(hr))
00150   {
00151     CString szMsg;
00152     szMsg.Format(_T("Failed to read Employee ID attribute, with hr = 0x%x\n"), hr);
00153     AfxMessageBox(szMsg);
00154     return;
00155   }
00156
00157
00158   //
00159   // Retrieve the employee ID from the attribute
00160   // information and set it in the edit box
00161   //
00162   if (dwReturned == 1)
00163   {
00164     ASSERT(pAttrInfo != NULL);
00165
00166     LPCWSTR lpszText = NULL;
00167     if (pAttrInfo->dwNumValues > 0)
00168     {
00169       lpszText = pAttrInfo->pADsValues->CaseIgnoreString;
00170     }
00171
00172     //
00173     // write data to the edit control
00174     GetIDEdit()->SetWindowText(lpszText);
00175
00176     //
00177     // Free the attribute memory
00178     //
00179     FreeADsMem(pAttrInfo);
00180   }
00181
00182   //
00183   // Disable the ID edit box if user does not have write permissions on the attribute
00184   //
00185   if (!ADsPropCheckIfWritable(_T("employeeID"), m_pWritableAttrs))
00186   {
00187     GetIDEdit()->EnableWindow(FALSE);
00188   }
00189
00190 }
00191
00192 void CProppageUserUI::OnEmployeeIDChange()
00193 {
00194   //
00195   // Enable the apply button, it's dirty
00196   //
00197   SetModified(TRUE);
00198 }
00199
00200 BOOL CProppageUserUI::OnApply()
00201 {
00202   ASSERT(m_spDsObj != NULL);
00203
00204   //
00205   // update the two attributes
00206   //
00207   HRESULT hr = m_thumbNailPhotoHolder.Write(m_spDsObj);
00208
00209
00210   hr = WriteEmployeeID();
00211   if (FAILED(hr))
00212   {
00213     CString szMsg;
00214     szMsg.Format(_T("Failed to write Employee ID, with hr = 0x%x\n"), hr);
00215     AfxMessageBox(szMsg);
00216     return FALSE;
00217   }
00218
00219
00220   // Signal the change notification. Note that the notify-apply
00221   // message must be sent even if the page is not dirty so that
00222   // the notify ref-counting will properly decrement.
00223   ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_APPLY, TRUE, 0);
00224
00225   return TRUE;
00226 }
00227
00228 void CProppageUserUI::OnDestroy()
00229 {
00230   if (::IsWindow(m_hNotifyObj))
00231   {
00232     ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_EXIT, 0, 0);
00233   }
00234   CPropertyPage::OnDestroy();
00235   delete this;
00236 }
00237
00238
00239
00240 HRESULT CProppageUserUI::WriteEmployeeID()
00241 {
00242   ADS_ATTR_INFO attrInfo[1];
00243   PWSTR rgpwzAttrNames[] = {_T("employeeID") };
00244   ADSVALUE Value[1];
00245
00246   //
00247   // Set the update/clear value
00248   //
00249
00250   CString szEmployeeID;
00251   GetIDEdit()->GetWindowText(szEmployeeID);
00252   BOOL bUpdate = !szEmployeeID.IsEmpty();
00253
00254   attrInfo[0].dwADsType = ADSTYPE_CASE_IGNORE_STRING;
00255   attrInfo[0].pszAttrName = rgpwzAttrNames[0];
00256
00257   Value[0].dwType = ADSTYPE_CASE_IGNORE_STRING;
00258   Value[0].CaseIgnoreString  = bUpdate ? (LPWSTR)(LPCWSTR)szEmployeeID : NULL;
00259
00260   attrInfo[0].pADsValues = &Value[0];
00261   attrInfo[0].dwNumValues = 1;
00262   attrInfo[0].dwControlCode = bUpdate ? ADS_ATTR_UPDATE : ADS_ATTR_CLEAR;
00263
00264   //
00265   // Write the changes to the object
00266   //
00267   DWORD dwModified = 0;
00268   return m_spDsObj->SetObjectAttributes(attrInfo, 1, &dwModified);
00269 }
00270
00271
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030         static TCHAR error[64];
00031
00032         switch (verb) {
00033     case MMC_VERB_NONE:
00034                 return _T("NONE");
00035     case MMC_VERB_OPEN:
00036                 return _T("OPEN");
00037     case MMC_VERB_COPY:
00038                 return _T("COPY");
00039     case MMC_VERB_PASTE:
00040                 return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042                 return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044                 return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046                 return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048                 return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050                 return _T("PRINT");
00051     case MMC_VERB_CUT:
00052                 return _T("CUT");
00053         default:
00054                 wsprintf(error, _T("Unknown verb id %d"), verb);
00055                 return error;
00056         }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061                                 IComponentData *pCompData,
00062                                 IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064                                 LPARAM arg,
00065                                 LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069         TCHAR message[cchMessage] = {0};
00070
00071         if (bComponentData == TRUE)
00072                 OutputDebugString(_T("IComponentData::Notify( "));
00073         else
00074                 OutputDebugString(_T("IComponent::Notify( "));
00075
00076         wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077         OutputDebugString(message);
00078
00079     switch (event)      {
00080                 case MMCN_ACTIVATE:
00081                         wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082                         break;
00083
00084                 case MMCN_ADD_IMAGES:
00085                         wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086                         break;
00087
00088                 case MMCN_BTN_CLICK:
00089                         wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090                         break;
00091
00092                 case MMCN_COLUMN_CLICK:
00093                         wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,       param);
00094                         break;
00095
00096                 case MMCN_COLUMNS_CHANGED:
00097                         wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098                         break;
00099
00100                 case MMCN_CONTEXTHELP:
00101                         wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102                         break;
00103
00104                 case MMCN_CONTEXTMENU:
00105                         wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106                         break;
00107
00108                 case MMCN_CUTORMOVE:
00109                         wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110                         break;
00111
00112                 case MMCN_DBLCLICK:
00113                         wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114                         break;
00115
00116                 case MMCN_DELETE:
00117                         wsprintf(message, _T("MMCN_DELETE\n"));
00118                         break;
00119
00120                 case MMCN_DESELECT_ALL:
00121                         wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122                         break;
00123
00124                 case MMCN_EXPAND:
00125                         wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126                         break;
00127
00128                 case MMCN_EXPANDSYNC:
00129                         wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130                         break;
00131
00132                 case MMCN_FILTERBTN_CLICK:
00133                         wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134                         break;
00135
00136                 case MMCN_FILTER_CHANGE:
00137                         wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138                         break;
00139
00140                 case MMCN_HELP:
00141                         wsprintf(message, _T("MMCN_HELP\n"));
00142                         break;
00143
00144                 case MMCN_INITOCX:
00145                         wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146                         break;
00147
00148                 case MMCN_LISTPAD:
00149                         wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150                         break;
00151
00152                 case MMCN_MENU_BTNCLICK:
00153                         wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154                         break;
00155
00156                 case MMCN_MINIMIZED:
00157                         wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158                         break;
00159
00160                 case MMCN_PASTE:
00161                         wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162                         break;
00163
00164                 case MMCN_PRELOAD:
00165                         wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166                         break;
00167
00168                 case MMCN_PRINT:
00169                         wsprintf(message, _T("MMCN_PRINT\n"));
00170                         break;
00171
00172                 case MMCN_PROPERTY_CHANGE:
00173                         wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174                         break;
00175
00176                 case MMCN_QUERY_PASTE:
00177                         wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178                         break;
00179
00180                 case MMCN_REFRESH:
00181                         wsprintf(message, _T("MMCN_REFRESH\n"));
00182                         break;
00183
00184                 case MMCN_REMOVE_CHILDREN:
00185                         wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186                         break;
00187
00188                 case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192                         StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193                         break;
00194
00195                 case MMCN_RESTORE_VIEW:
00196                         wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197                         break;
00198
00199                 case MMCN_SELECT:
00200                         wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201                         break;
00202
00203                 case MMCN_SHOW:
00204                         wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205                         break;
00206
00207                 case MMCN_SNAPINHELP:
00208                         wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209                         break;
00210
00211                 case MMCN_VIEW_CHANGE:
00212                         wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213                         break;
00214         }
00215
00216         if (message[0] != 0)
00217                 OutputDebugString(message);
00218         else
00219                 OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222         return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CREATEDATA Member List

This is the complete list of members for CREATEDATA, including all inherited members.
bChatty | CREATEDATA
bDone | CREATEDATA
bStop | CREATEDATA
hWndResults | CREATEDATA
hWndStopButton | CREATEDATA
nRows | CREATEDATA
nTotalRows | CREATEDATA
Generated on Wed Nov 13 2024 16:57:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/StdAfx.h Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__4B14B751_FDBC_11D2_A10D_0080C71F306F__INCLUDED_)
00006 #define AFX_STDAFX_H__4B14B751_FDBC_11D2_A10D_0080C71F306F__INCLUDED_
00007
00008 // we only work in UNICODE
00009 #ifndef _UNICODE
00010 #error This module must be build in UNICODE
00011 #endif
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017 #define STRICT
00018 #ifndef _WIN32_WINNT
00019 #define _WIN32_WINNT 0x0500
00020 #endif
00021 #define _ATL_APARTMENT_THREADED
00022
00023 #include <atlbase.h>
00024 extern CComModule _Module;
00025
00026 #include <atlcom.h>
00027 #include <atlwin.h>
00028 #include <comdef.h>
00029
00030 //{{AFX_INSERT_LOCATION}}
00031 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00032
00033 #endif // !defined(AFX_STDAFX_H__4B14B751_FDBC_11D2_A10D_0080C71F306F__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/BrowserHost.cpp Source File

  • Web
  • Browser
  • EditFeatures

BrowserHost.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2000 Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // BrowserHost.cpp : Implementation of CBrowserHost
00006 #include "stdafx.h"
00007 #include "EdCommands.h"
00008 #include "BrowserHost.h"
00009 #include "exdispid.h"
00010 #include "mshtmdid.h"
00011 #include "mshtmhst.h"
00012 #include "mshtmcid.h"
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CBrowserHost
00016
00017 CBrowserHost::CBrowserHost() :
00018   m_bEnableCtxMenus(TRUE),
00019   m_dwDLControl(DLCTL_DLIMAGES|DLCTL_VIDEOS|DLCTL_BGSOUNDS),
00020   m_dwCookie((DWORD)0),
00021   m_dwDocHostUIFlags((DWORD)0),
00022   m_dwDocHostUIDblClk((DWORD)0),
00023   m_bInPlaceActive(FALSE),
00024   m_bAtlBrowserHelp(TRUE),
00025   m_wndUrlCombo(_T("ComboBox"), this, 1),
00026   m_bButton2Down(FALSE),
00027   m_bButton3Down(FALSE),
00028   m_bButton4Down(FALSE),
00029   m_bButton5Down(FALSE),
00030   m_bButton6Down(FALSE),
00031   m_bButton7Down(TRUE),
00032   m_bButton8Down(FALSE),
00033   m_bButton9Down(FALSE),
00034   m_bButton10Down(FALSE),
00035   m_lCSSlevel(0)
00036 {
00037 }
00038
00039 LRESULT CBrowserHost::OnCreate(UINT, WPARAM, LPARAM, BOOL&) {return 0;}
00040
00041 LRESULT CBrowserHost::OnNCDestroy(UINT, WPARAM, LPARAM, BOOL&)
00042 {
00043   Stop();
00044   return 0;
00045 }
00046
00047 LRESULT CBrowserHost::OnKeydown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00048 {
00049   if (wParam == VK_RETURN)
00050   {
00051     // Stop any previous navigations
00052     m_spWebBrowser->Stop();
00053
00054     USES_CONVERSION;
00055     CComBSTR bstrURL;
00056     CComVariant vtEmpty;
00057
00058     // CODE REVIEW: Add following security comment.
00059     /* The following use of GetWindowText is simplified for illustrative
00060     purposes. This simplified use in production code can expose a
00061     security risk in some situations. In production code you might want
00062     to ensure that the receiving buffer size isn't exceeded by the size
00063     of the source string. */
00064     m_wndUrlCombo.GetWindowText((BSTR&)bstrURL);
00065
00066     if (bstrURL)
00067       m_spWebBrowser->Navigate(bstrURL, &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);
00068
00069     bHandled = TRUE;
00070     return S_OK;
00071   }
00072
00073   MSG msg;
00074   msg.message = uMsg;
00075   msg.wParam = wParam;
00076   msg.lParam = lParam;
00077
00078
00079   // UIActivate the WebBrowser control when the tab key
00080   // is pressed so that focus will be changed to the next
00081   // control in the tabbing order.  If this is not done,
00082   // the WebBrowser control never gets the focus.
00083   if ((uMsg == WM_KEYDOWN || uMsg == WM_KEYUP) && wParam == VK_TAB)
00084   {
00085     CComQIPtr<IOleObject, &IID_IOleObject> spOleObject(m_spWebBrowser);
00086
00087     RECT rect;
00088     GetClientRect(&rect);
00089     spOleObject->DoVerb(OLEIVERB_UIACTIVATE, NULL, this, 0, m_hWnd, &rect);
00090   }
00091
00092   // Call TranslateAccelerator on the in-place active
00093   // object for the delete key so that the accelerator will be passed to the
00094   // hosted WebBrowser control.  This forces the delete key to
00095   // work correctly in design mode.
00096   if (wParam == VK_DELETE)
00097   {
00098     CComQIPtr<IOleInPlaceActiveObject,
00099          &IID_IOleInPlaceActiveObject> spInPlaceActiveObject(m_spWebBrowser);
00100
00101     spInPlaceActiveObject->TranslateAccelerator(&msg);
00102   }
00103
00104   bHandled = TRUE;
00105
00106   return S_FALSE;
00107 }
00108
00109 LRESULT CBrowserHost::OnButton1(WORD, WORD, HWND, BOOL&)
00110 {
00111   _ASSERT(m_spWebBrowser);
00112
00113   if (!m_spDoc)
00114   {
00115      MessageBox(_T("Document object no available."));
00116      return 0;
00117   }
00118
00119   USES_CONVERSION; // Needed for the OLE2A conversion macro
00120   BSTR bstrMode;
00121
00122   m_spDoc->get_designMode(&bstrMode);
00123   char* cMode = OLE2A(bstrMode);
00124
00125   if (strcmp(cMode, "On"))
00126   {
00127     m_spDoc->put_designMode(L"On");
00128
00129     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON1, MAKELONG(TRUE, 0));
00130     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON7, MAKELONG(TRUE, 0));
00131     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON2, MAKELONG(TRUE, 0));
00132     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON3, MAKELONG(TRUE, 0));
00133     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON4, MAKELONG(TRUE, 0));
00134     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON5, MAKELONG(TRUE, 0));
00135
00136     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON7, MAKELONG(TRUE, 0));
00137     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON8, MAKELONG(TRUE, 0));
00138     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON9, MAKELONG(TRUE, 0));
00139     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON10, MAKELONG(TRUE, 0));
00140     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON6, MAKELONG(FALSE, 0));
00141     m_bButton6Down = FALSE;
00142   }
00143   else
00144   {
00145     m_spDoc->put_designMode(L"Off");
00146     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON1, MAKELONG(FALSE, 0));
00147     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00148     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00149     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON4, MAKELONG(FALSE, 0));
00150     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON5, MAKELONG(FALSE, 0));
00151     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON6, MAKELONG(FALSE, 0));
00152     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON7, MAKELONG(FALSE, 0));
00153     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON8, MAKELONG(FALSE, 0));
00154     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON9, MAKELONG(FALSE, 0));
00155     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON10, MAKELONG(FALSE, 0));
00156     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00157     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00158     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON4, MAKELONG(FALSE, 0));
00159     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON5, MAKELONG(FALSE, 0));
00160
00161     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON7, MAKELONG(FALSE, 0));
00162     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON8, MAKELONG(FALSE, 0));
00163     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON9, MAKELONG(FALSE, 0));
00164     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON10, MAKELONG(FALSE, 0));
00165     m_bButton2Down = FALSE;
00166     m_bButton3Down = FALSE;
00167     m_bButton4Down = FALSE;
00168     m_bButton5Down = FALSE;
00169     m_bButton6Down = FALSE;
00170     m_bButton7Down = TRUE;
00171     m_bButton8Down = FALSE;
00172     m_bButton9Down = FALSE;
00173     m_bButton10Down = FALSE;
00174   }
00175
00176   return 1;
00177 }
00178
00179 LRESULT CBrowserHost::OnButton2(WORD, WORD, HWND, BOOL&)
00180 {
00181   USES_CONVERSION;
00182
00183   HRESULT hr ;
00184     VARIANT var;
00185
00186   // Turn button on or off
00187   if (m_bButton2Down)
00188     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00189   else
00190     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON2, MAKELONG(TRUE, 0));
00191
00192   m_bButton2Down = !m_bButton2Down;
00193
00194   V_VT(&var) = VT_BOOL;
00195   V_BOOL(&var) = VARIANT_TRUE;
00196
00197   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00198                 IDM_MULTIPLESELECTION,
00199                 MSOCMDEXECOPT_DODEFAULT,
00200                 &var,
00201                 NULL);
00202
00203   return 0;
00204 }
00205
00206 LRESULT CBrowserHost::OnButton3(WORD, WORD, HWND, BOOL&)
00207 {
00208   HRESULT hr ;
00209     VARIANT var;
00210
00211   // Turn button on or off
00212   if (m_bButton3Down)
00213     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00214   else
00215     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON3, MAKELONG(TRUE, 0));
00216
00217   m_bButton3Down = !m_bButton3Down;
00218
00219   V_VT(&var) = VT_BOOL;
00220   V_BOOL(&var) = m_bButton3Down ? VARIANT_TRUE : VARIANT_FALSE;
00221
00222   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00223                 IDM_2D_POSITION,
00224                 MSOCMDEXECOPT_DODEFAULT,
00225                 &var,
00226                 NULL);
00227
00228   return 0;
00229 }
00230
00231 LRESULT CBrowserHost::OnButton4(WORD, WORD, HWND, BOOL&)
00232 {
00233   HRESULT hr ;
00234     VARIANT var;
00235
00236   // Turn button on or off
00237   if (m_bButton4Down)
00238     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON4, MAKELONG(FALSE, 0));
00239   else
00240     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON4, MAKELONG(TRUE, 0));
00241
00242   m_bButton4Down = !m_bButton4Down;
00243
00244   V_VT(&var) = VT_BOOL;
00245   V_BOOL(&var) = m_bButton4Down ? VARIANT_TRUE : VARIANT_FALSE;
00246
00247   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00248                 IDM_LIVERESIZE,
00249                 MSOCMDEXECOPT_DODEFAULT,
00250                 &var,
00251                 NULL);
00252
00253   return 0;
00254 }
00255
00256 LRESULT CBrowserHost::OnButton5(WORD, WORD, HWND, BOOL&)
00257 {
00258   HRESULT hr ;
00259     VARIANT var;
00260
00261   // Turn button on or off
00262   if (m_bButton5Down)
00263     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON5, MAKELONG(FALSE, 0));
00264   else
00265     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON5, MAKELONG(TRUE, 0));
00266
00267   m_bButton5Down = !m_bButton5Down;
00268
00269   V_VT(&var) = VT_BOOL;
00270   V_BOOL(&var) = m_bButton5Down ? VARIANT_TRUE : VARIANT_FALSE;
00271
00272   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00273                 IDM_DISABLE_EDITFOCUS_UI,
00274                 // Note: IDM_DISABLE_EDITFOCUS_UI will change
00275                 // after Beta 3 to IDM_DISABLE_EDITFOCUSHANDLES
00276                 MSOCMDEXECOPT_DODEFAULT,
00277                 &var,
00278                 NULL);
00279
00280   return 0;
00281 }
00282
00283 LRESULT CBrowserHost::OnButton6(WORD, WORD, HWND, BOOL&)
00284 {
00285   HRESULT hr ;
00286     VARIANT var;
00287
00288   // Turn button on or off
00289   if (m_bButton6Down)
00290     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON6, MAKELONG(FALSE, 0));
00291   else
00292     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON6, MAKELONG(TRUE, 0));
00293
00294   m_bButton6Down = !m_bButton6Down;
00295
00296   V_VT(&var) = VT_BOOL;
00297   V_BOOL(&var) = m_bButton6Down ? VARIANT_TRUE : VARIANT_FALSE;
00298
00299   //m_spDoc->put_designMode(L"Off");
00300
00301   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00302                 IDM_ATOMICSELECTION,
00303                 MSOCMDEXECOPT_DODEFAULT,
00304                 &var,
00305                 NULL);
00306   //m_spDoc->put_designMode(L"On");
00307
00308   return 0;
00309 }
00310
00311 LRESULT CBrowserHost::OnButton7(WORD, WORD, HWND, BOOL&)
00312 {
00313   HRESULT hr ;
00314     VARIANT var;
00315
00316   // Turn button on or off
00317   if (m_bButton7Down)
00318     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON7, MAKELONG(FALSE, 0));
00319   else
00320     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON7, MAKELONG(TRUE, 0));
00321
00322   m_bButton7Down = !m_bButton7Down;
00323
00324   V_VT(&var) = VT_BOOL;
00325   V_BOOL(&var) = m_bButton7Down ? VARIANT_TRUE : VARIANT_FALSE;
00326
00327   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00328                 IDM_AUTOURLDETECT_MODE,
00329                 MSOCMDEXECOPT_DODEFAULT,
00330                 &var,
00331                 NULL);
00332
00333   return 0;
00334 }
00335
00336 LRESULT CBrowserHost::OnButton8(WORD, WORD, HWND, BOOL&)
00337 {
00338   HRESULT hr ;
00339     VARIANT var;
00340
00341   // Turn button on or off
00342   if (m_bButton8Down)
00343     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON8, MAKELONG(FALSE, 0));
00344   else
00345     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON8, MAKELONG(TRUE, 0));
00346
00347   m_bButton8Down = !m_bButton8Down;
00348
00349   V_VT(&var) = VT_BOOL;
00350   V_BOOL(&var) = m_bButton8Down ? VARIANT_TRUE : VARIANT_FALSE;
00351
00352   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00353                 IDM_RESPECTVISIBILITY_INDESIGN,
00354                 MSOCMDEXECOPT_DODEFAULT,
00355                 &var,
00356                 NULL);
00357
00358   return 0;
00359 }
00360
00361 LRESULT CBrowserHost::OnButton9(WORD, WORD, HWND, BOOL&)
00362 {
00363   HRESULT hr ;
00364     VARIANT var;
00365
00366   // Turn button on or off
00367   if (m_bButton9Down)
00368     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON9, MAKELONG(FALSE, 0));
00369   else
00370     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON9, MAKELONG(TRUE, 0));
00371
00372   m_bButton9Down = !m_bButton9Down;
00373
00374   V_VT(&var) = VT_BOOL;
00375   V_BOOL(&var) = m_bButton9Down ? VARIANT_TRUE : VARIANT_FALSE;
00376
00377   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00378                 IDM_OVERRIDE_CURSOR,
00379                 MSOCMDEXECOPT_DODEFAULT,
00380                 &var,
00381                 NULL);
00382
00383   return 0;
00384 }
00385
00386 LRESULT CBrowserHost::OnButton10(WORD, WORD, HWND, BOOL&)
00387 {
00388   HRESULT hr ;
00389     VARIANT var;
00390
00391   V_VT(&var) = VT_I4;
00392
00393   TCHAR textLevel = NULL;
00394
00395   _itot(m_lCSSlevel, &textLevel, 10);
00396
00397   V_I4(&var) = m_lCSSlevel++;
00398
00399   if (m_lCSSlevel > 2) m_lCSSlevel = 0;
00400
00401   MessageBox(&textLevel, _T("CSS Level"), NULL);
00402
00403   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00404                 IDM_CSSEDITING_LEVEL,
00405                 MSOCMDEXECOPT_DODEFAULT,
00406                 &var,
00407                 NULL);
00408
00409
00410
00411   return 0;
00412 }
00413
00414 STDMETHODIMP CBrowserHost::Run()
00415 {
00416   // Create and show the window
00417   RECT rcClient = { CW_USEDEFAULT, 0, 0, 0 };
00418
00419   Create(GetDesktopWindow(), rcClient, _T("Editing Glyph Sample App"), WS_VISIBLE | WS_OVERLAPPEDWINDOW,
00420        0, NULL);
00421   ShowWindow(SW_SHOWNORMAL);
00422
00423   // Create the toolbar
00424   CreateToolbar();
00425
00426   // Create the status bar
00427   m_wndStatusBar.Attach(CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | CCS_BOTTOM,
00428                               _T("Ready"), m_hWnd, 2));
00429   _ASSERT(m_wndStatusBar);
00430
00431   // Create the WebBrowser control
00432   CComPtr<IOleObject> spOleObject;
00433   HRESULT hr = CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IOleObject,
00434                       (void**)&spOleObject);
00435   if (hr != S_OK)
00436   {
00437     MessageBox(_T("CoCreateInstance failed"));
00438     return E_FAIL;
00439   }
00440
00441   if (spOleObject->SetClientSite(this) != S_OK)
00442   {
00443     MessageBox(_T("SetClientSite failed"));
00444     return E_FAIL;
00445   }
00446
00447   // In-place activate the WebBrower control
00448   MSG msg;
00449   GetClientRect(&rcClient);
00450
00451   hr = spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, &msg, this, 0, m_hWnd, &rcClient);
00452   if (hr != S_OK)
00453   {
00454     MessageBox(_T("DoVerb failed"));
00455     return E_FAIL;
00456   }
00457
00458   // Get the pointer to the WebBrowser control.  Note that setting a CComQIPtr
00459   // equal to a pointer of another type causes CComQIPtr to call QueryInterface.
00460   m_spWebBrowser = spOleObject;
00461   _ASSERT(m_spWebBrowser);
00462
00463   if (!m_spWebBrowser)
00464     return E_FAIL;
00465
00466   // Set up the connection to the WebBrowser control to receive events
00467   hr = AtlAdvise(m_spWebBrowser, GetUnknown(), DIID_DWebBrowserEvents2, &m_dwCookie);
00468   if (FAILED(hr))
00469     ATLTRACE(_T("Failed to Advise\n"));
00470
00471   // Get the size of the status bar
00472   RECT rcWindow;
00473   m_wndStatusBar.GetWindowRect(&rcWindow);
00474
00475   // Resize the control to accomodate the status bar and toolbar
00476   rcClient.bottom -= (rcWindow.bottom - rcWindow.top);
00477
00478   m_wndToolBar.GetWindowRect(&rcWindow);
00479   rcClient.top += (rcWindow.bottom - rcWindow.top);
00480
00481   // QI for the in-place object to set the size
00482   m_spInPlaceObject = m_spWebBrowser;
00483   _ASSERT(m_spInPlaceObject);
00484
00485   if (m_spInPlaceObject)
00486     m_spInPlaceObject->SetObjectRects(&rcClient, &rcClient);
00487
00488   // QI for the IOleCommandTarget interface that will be used later
00489   m_spOleCmdTarg = m_spWebBrowser;
00490   _ASSERT(m_spOleCmdTarg);
00491
00492   // Load Test Page
00493   m_spWebBrowser->Navigate(L"res://edcommands.exe/test", NULL, NULL, NULL, NULL);
00494
00495   return S_OK;
00496 }
00497
00498 STDMETHODIMP CBrowserHost::Stop()
00499 {
00500   _ASSERT(m_spWebBrowser);
00501
00502   HRESULT hr = AtlUnadvise(m_spWebBrowser, DIID_DWebBrowserEvents2, m_dwCookie);
00503
00504   if (FAILED(hr))
00505     ATLTRACE("Failed to Unadvise\n");
00506
00507   PostQuitMessage(0);
00508
00509   return S_OK;
00510 }
00511
00512 LRESULT CBrowserHost::OnSize(UINT, WPARAM, LPARAM lParam, BOOL&)
00513 {
00514   RECT rcWindow;
00515
00516   // Resize the status bar
00517   if (m_wndStatusBar)
00518   {
00519     int cxParent = LOWORD(lParam);
00520     int cyParent = HIWORD(lParam);
00521     int x = 0, y, cx, cy;
00522
00523     // Keep the status bar height the same.
00524     m_wndStatusBar.GetWindowRect(&rcWindow);
00525     cy = rcWindow.bottom - rcWindow.top;
00526
00527     y = cyParent - cy;
00528     cx = cxParent;
00529     m_wndStatusBar.MoveWindow(x, y, cx, cy, TRUE);
00530   }
00531
00532   // Tell the toolbar to resize itself
00533   if (m_wndToolBar)
00534     m_wndToolBar.SendMessage(TB_AUTOSIZE, 0, 0L);
00535
00536   // Resize the control
00537   if (m_spWebBrowser && m_bInPlaceActive)
00538   {
00539     RECT rcClient;
00540     GetClientRect(&rcClient);
00541
00542     // Resize the control to accomodate the status bar and toolbar
00543     rcClient.bottom -= (rcWindow.bottom - rcWindow.top);
00544
00545     m_wndToolBar.GetWindowRect(&rcWindow);
00546     rcClient.top += (rcWindow.bottom - rcWindow.top);
00547
00548     if (m_spInPlaceObject)
00549       m_spInPlaceObject->SetObjectRects(&rcClient, &rcClient);
00550   }
00551
00552   return 0;
00553 }
00554
00555 // IDispatch Methods
00556 STDMETHODIMP CBrowserHost::Invoke(DISPID dispidMember, REFIID riid,
00557                      LCID lcid, WORD wFlags,
00558                      DISPPARAMS* pDispParams,
00559                      VARIANT* pvarResult, EXCEPINFO*  pExcepInfo,
00560                      UINT* puArgErr)
00561 {
00562   USES_CONVERSION;
00563
00564   switch (dispidMember)
00565   {
00566     case DISPID_DOCUMENTCOMPLETE:
00567       {
00568       IDispatch* pDisp;
00569       m_spDoc = (IHTMLDocument2*)NULL;
00570       m_spWebBrowser->get_Document(&pDisp);
00571       pDisp->QueryInterface(IID_IHTMLDocument2, (void**)&m_spDoc);
00572
00573       pDisp->Release();
00574       break;
00575       }
00576
00577     case DISPID_DOWNLOADCOMPLETE:
00578       // Set the text of the combobox to the current URL
00579       BSTR bstrURL;
00580
00581       m_spWebBrowser->get_LocationURL(&bstrURL);
00582       m_wndUrlCombo.SetWindowText(OLE2T(bstrURL));
00583
00584       break;
00585
00586     // The parameters for this DISPID:
00587     // [0]: New status bar text - VT_BSTR
00588     case DISPID_STATUSTEXTCHANGE:
00589       m_wndStatusBar.SetWindowText(OLE2T(pDispParams->rgvarg[0].bstrVal));
00590       break;
00591
00592     default:
00593       return DISP_E_MEMBERNOTFOUND;
00594   }
00595
00596   return S_OK;
00597 }
00598
00599 void CBrowserHost::CreateToolbar()
00600 {
00601   TBBUTTON tbb[] =
00602   {
00603     // Add separators to make room for the combo box.
00604     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00605     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00606     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00607     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00608     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00609     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00610     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00611     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00612     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00613     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00614     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00615     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00616     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00617     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00618     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00619     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00620     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00621     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00622     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00623     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00624     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00625     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00626     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00627     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00628     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00629     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00630     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00631     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00632     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00633     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00634     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00635     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00636     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00637     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00638     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00639     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00640     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00641     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00642     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00643     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00644
00645     0, ID_BUTTON1, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00646     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00647     1, ID_BUTTON2, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00648     2, ID_BUTTON3, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00649     3, ID_BUTTON4, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00650     4, ID_BUTTON5, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00651     5, ID_BUTTON6, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00652     6, ID_BUTTON7, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00653     7, ID_BUTTON8, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00654     8, ID_BUTTON9, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00655     9, ID_BUTTON10, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00656   };
00657
00658   HWND toolbar = CreateToolbarEx(m_hWnd,
00659                    WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | CCS_TOP | TBSTYLE_WRAPABLE | TBSTYLE_TOOLTIPS,
00660                    ID_TOOLBARWND,
00661                    4,
00662                    _Module.GetResourceInstance(),
00663                    IDR_TOOLBAR1,
00664                    tbb, 51,
00665                    0, 0,
00666                    55, 30,
00667                    sizeof(TBBUTTON));
00668
00669   m_wndToolBar.Attach(toolbar);
00670   _ASSERT(m_wndToolBar);
00671
00672   // Tell the toolbar to resize itself
00673   m_wndToolBar.SendMessage(TB_AUTOSIZE, 0, 0L);
00674   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00675   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00676   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON4, MAKELONG(FALSE, 0));
00677   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON5, MAKELONG(FALSE, 0));
00678
00679   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON7, MAKELONG(FALSE, 0));
00680   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON8, MAKELONG(FALSE, 0));
00681   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON9, MAKELONG(FALSE, 0));
00682   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON10, MAKELONG(FALSE, 0));
00683
00684   // Create the combo box on the toolbar
00685   RECT rc, rc2;
00686
00687   // Calculate the coordinates for the combo box.
00688   m_wndToolBar.SendMessage(TB_GETITEMRECT, (WPARAM)0, (LPARAM)(LPRECT)&rc);
00689   m_wndToolBar.SendMessage(TB_GETITEMRECT, (WPARAM)38, (LPARAM)(LPRECT)&rc2);
00690
00691   rc.right = rc2.right;
00692   rc.bottom = 100;
00693   m_wndUrlCombo.Create(m_wndToolBar, rc, NULL, WS_CHILD|WS_VISIBLE|CBS_DROPDOWN|CBS_AUTOHSCROLL,
00694                 0, ID_URLBOX);
00695 }
00696
00697
00698 STDMETHODIMP CBrowserHost::GetHwnd(long* phwnd)
00699 {
00700   *phwnd = (long)m_hWnd;
00701    return S_OK;
00702 }
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/Hello3/Hello3J.java Source File

  • Web
  • MSAgent
  • Java
  • Hello3

Hello3J.java

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright (C) 1997-1998 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011 //
00012 // This sample demonstrates loading and showing 2 Microsoft Agent characters
00013 // and synchronizing their actions.  It also demonstrates the use of the
00014 // RequestComplete notification and an Agent notify sink.
00015 //
00016 //==========================================================================
00017
00018 // Standard java imports
00019
00020 import java.applet.*;
00021 import java.awt.*;
00022
00023 // COM and Microsoft Agent imports
00024
00025 import com.ms.com.Variant;
00026 import agentsvr.AgentServer;
00027 import agentsvr.IAgentEx;
00028 import agentsvr.IAgentCharacter;
00029 import agentsvr.IAgentCharacterEx;
00030
00031 // The Hello3J class (Single threaded)
00032
00033 public class Hello3J extends Applet
00034 {
00035   // Private members necessary for Agent instantiation.  Change the
00036   // location of the characters to where they are stored on your system.
00037
00038   private IAgentEx      m_AgentEx = null;
00039   private int         m_WaitID[] = {-1};
00040   private int         m_RequestID[] = {0};
00041   private IAgentCharacterEx m_Merlin[] = {null};
00042   private int         m_MerlinID[] = {-1};
00043   private IAgentCharacterEx m_Genie[] = {null};
00044   private int         m_GenieID[] = {-1};
00045   private final String    m_MerlinFilename = "merlin.acs";
00046   private final String    m_GenieFilename = "genie.acs";
00047   private final String    m_OldPath = "\\program files\\microsoft agent\\characters\\";
00048
00049   // Declare an Agent Notify Sink so that we can get
00050   // notification callbacks from the Agent server.
00051
00052   private Notify      m_Sink = null;
00053   private int       m_SinkID[] = {-1};
00054
00055   private final int   FALSE = 0;
00056   private final int   TRUE = 1;
00057
00058
00059   public Hello3J()
00060   {
00061     // Constructor left intentionally blank
00062   }
00063
00064   public String getAppletInfo()
00065   {
00066     return "Name: Hello3J\r\n" +
00067            "Author: anonymous\r\n" +
00068            "Created with Microsoft Visual J++ Version 1.1";
00069   }
00070
00071   public void init()
00072   {
00073       resize(0, 0);
00074   }
00075
00076   public void destroy()
00077   {
00078   }
00079
00080   public void paint(Graphics g)
00081   {
00082   }
00083
00084   private boolean LoadCharacter(String filename,
00085                   int[] characterID,
00086                   IAgentCharacterEx[] character)
00087   {
00088     try
00089     {
00090       // First, try to load using just the filename. This is
00091       // a new feature for Agent 2.0. Agent will look in the
00092       // %windows%\msagent\chars directory.
00093
00094       m_AgentEx.Load(new Variant(filename), characterID, m_RequestID);
00095
00096     }
00097     catch(com.ms.com.ComException e)
00098     {
00099       // Couldn't load it. Construct a path using the directory
00100       // most common to Agent 1.5 applications and try to load
00101       // from there.
00102
00103       try
00104       {
00105
00106         m_AgentEx.Load(new Variant(m_OldPath + filename), characterID, m_RequestID);
00107
00108       }
00109       catch(com.ms.com.ComException e2)
00110       {
00111         return false;
00112       }
00113     }
00114
00115     try
00116     {
00117       // Get the IAgentCharacter interface.
00118       // NOTE NOTE NOTE!!! If you are using Visual J++ or
00119       // other Java environments that can correctly handle
00120       // derived COM types (e.g. IAgentCharacterEx) then you
00121       // can retrieve the character interface with a single
00122       // call to GetCharacterEx.
00123       //
00124       //    m_AgentEx.GetCharacterEx(characterID[0], character);
00125       //
00126       // Some environments (e.g. Visual J++ 1.1) do not correctly
00127       // handle derived COM types. So retrieving the IAgentCharacterEx
00128       // interface is a 2 step process. First get the IAgentCharacter
00129       // interface.
00130
00131       IAgentCharacter char15[] = {null};
00132       m_AgentEx.GetCharacter(characterID[0], char15);
00133
00134       // Then get the IAgentCharacterEx interface and release
00135       // the IAgentCharacter interface.
00136
00137       character[0] = (IAgentCharacterEx)char15[0];
00138       char15 = null;
00139
00140     }
00141     catch(com.ms.com.ComException e3)
00142     {
00143       return false;
00144     }
00145
00146     return true;
00147   }
00148
00149   public void start()
00150   {
00151     // Start the Microsoft Agent Server
00152
00153     m_AgentEx = (IAgentEx) new AgentServer();
00154
00155     // Create and register a notify sink
00156
00157     m_Sink = new Notify(this);
00158
00159     try
00160     {
00161       // And register it with Microsoft Agent so that we
00162       // can receive notifications.
00163
00164       m_AgentEx.Register(m_Sink, m_SinkID);
00165
00166     }
00167     catch(com.ms.com.ComException eSink)
00168     {
00169       stop();
00170       return;
00171     }
00172
00173     // Load the characters
00174
00175     if (!LoadCharacter(m_MerlinFilename, m_MerlinID, m_Merlin) ||
00176       !LoadCharacter(m_GenieFilename, m_GenieID, m_Genie))
00177     {
00178       stop();
00179       return;
00180     }
00181
00182     try {
00183
00184       // Set their language
00185
00186       m_Genie[0].SetLanguageID(0x0409);
00187       m_Merlin[0].SetLanguageID(0x0409);
00188
00189       // Position the characters
00190
00191       m_Genie[0].MoveTo((short)0, (short)100, 0, m_RequestID);
00192       m_Merlin[0].MoveTo((short)200, (short)100, 0, m_RequestID);
00193
00194       // Show them
00195
00196       m_Genie[0].Show(FALSE, m_RequestID);
00197       m_Merlin[0].Show(FALSE, m_RequestID);
00198
00199       // Have Genie gesture towards Merlin
00200
00201       m_Genie[0].GestureAt((short)150, (short)100, m_RequestID);
00202
00203       // And have Genie say hello to Merlin
00204
00205       m_Genie[0].Speak("Hi there Merlin.", null, m_WaitID);
00206
00207       // Make Merlin wait for Genie to finish speaking
00208
00209       m_Merlin[0].Wait(m_WaitID[0], m_RequestID);
00210
00211       // Have Merlin gesture towards Genie
00212
00213       m_Merlin[0].GestureAt((short)0, (short)100, m_RequestID);
00214
00215       // And then speak back to Genie.  Use a request id owned by the
00216       // sink object.  When we get a request complete notification, the
00217       // sink will call back into the applet.
00218
00219       m_Merlin[0].Speak("Hi Genie.  See you later", null, m_Sink.m_DoneID);
00220
00221     }
00222     catch(com.ms.com.ComException e)
00223     {
00224       stop();
00225     }
00226   }
00227
00228   public void stop()
00229   {
00230     // Unload the characters
00231
00232     if (m_MerlinID[0] > 0)
00233     {
00234       m_Merlin[0] = null;
00235       m_AgentEx.Unload(m_MerlinID[0]);
00236       m_MerlinID[0] = -1;
00237     }
00238
00239     if (m_GenieID[0] > 0)
00240     {
00241       m_Genie[0] = null;
00242       m_AgentEx.Unload(m_GenieID[0]);
00243       m_GenieID[0] = -1;
00244     }
00245
00246     // Unregister the notify sink, we're done with the
00247     // Agent server.
00248
00249     if (m_SinkID[0] > 0)
00250     {
00251       m_AgentEx.Unregister(m_SinkID[0]);
00252       m_SinkID[0] = -1;
00253     }
00254
00255     m_Sink = null;
00256     m_AgentEx = null;
00257   }
00258
00259   public void HideCharacters()
00260   {
00261     // This method is called by the notification sink when the
00262     // last Agent request has completed.  We'll just hide the
00263     // characters.
00264
00265     m_Merlin[0].Hide(FALSE, m_RequestID);
00266     m_Genie[0].Hide(FALSE, m_RequestID);
00267   }
00268 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/AppBar/WndProc.c Source File

  • WinUI
  • Shell
  • AppBar

WndProc.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1993 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:     wndproc.c
00009 //
00010 //  PURPOSE:    Contains window procedure and message handlers for the
00011 //              main appbar window.
00012 //
00013 //  PLATFORMS:  Windows 95, Windows 98, Windows 2000, Windows NT 4.0
00014 //
00015 //  FUNCTIONS:
00016 //      MainWndProc()       - Message handler for the main application window
00017 //      Main_OnCreate()     - Handles window initialization
00018 //      Main_OnActivate()   - Handles autohide showing and hiding
00019 //      Main_OnWindowPosChanged - Notifies the system of the window change
00020 //      Main_OnCommand()    - Processes WM_COMMAND messages
00021 //      Main_OnSize()       - Notifies the system of the size change
00022 //      Main_OnMove()       - Notifies the system the window moved
00023 //      Main_OnRButtonDown()- Shows a context menu with appbar options
00024 //      Main_OnDestroy()    - Handles the WM_DESTROY message
00025 //      Main_OnTimer()      - Does autohide stuff
00026 //      Main_OnNCHitTest()  - Prevents sizing in unacceptable directions
00027 //      Main_OnPaint()      - Draws instructions into the window
00028 //      AboutDlgProc()      - Message handler for the application's about
00029 //                            dialog.
00030 //
00031
00032
00033
00034 #include <windows.h>
00035 #include <windowsx.h>
00036 #include <commctrl.h>
00037 #include "resource.h"
00038 #include "globals.h"
00039 #include "appbar.h"
00040
00041
00042
00043 //////////////////////////////////////////////////////////////////////////////
00044 // Local prototypes
00045
00046 BOOL Main_OnCreate(HWND, LPCREATESTRUCT);
00047 void Main_OnActivate(HWND, UINT, HWND, BOOL);
00048 void Main_OnWindowPosChanged(HWND, const LPWINDOWPOS);
00049 void Main_OnCommand(HWND, int, HWND, UINT);
00050 void Main_OnSize(HWND, UINT, int, int);
00051 void Main_OnMove(HWND, int, int);
00052 void Main_OnRButtonDown(HWND, BOOL, int, int, UINT);
00053 void Main_OnDestroy(HWND);
00054 void Main_OnTimer(HWND, UINT);
00055 UINT Main_OnNCHitTest(HWND, int, int);
00056 void Main_OnPaint(HWND);
00057 void Main_OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags);
00058 void Main_OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags);
00059 void Main_OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags);
00060
00061
00062 LRESULT CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM);
00063
00064
00065 //////////////////////////////////////////////////////////////////////////////
00066 // Global Variables
00067
00068 static HFONT g_hFontTop, g_hFontBottom, g_hFontLeft, g_hFontRight;
00069 static BOOL g_fMoving = FALSE;
00070 static RECT g_rcDrag;
00071
00072
00073 //
00074 //  FUNCTION:   MainWndProc(HWND, UINT, WPARAM, LPARAM)
00075 //
00076 //  PURPOSE:    Processes messages for the main application window.
00077 //
00078 //  PARAMETERS:
00079 //      hwnd        - handle the the window receiving the message
00080 //      uMsg        - identifier of the message
00081 //      wParam      - additional info associated with the message
00082 //      lParam      - additional info associated with the message
00083 //
00084 //  RETURN VALUE:
00085 //      (LRESULT) Returns 0 by default if the message is handled by this
00086 //                procedure.
00087 //
00088
00089 LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam,
00090                              LPARAM lParam)
00091 {
00092     switch(uMsg)
00093     {
00094         HANDLE_MSG(hwnd, WM_CREATE,           Main_OnCreate);
00095         HANDLE_MSG(hwnd, WM_ACTIVATE,         Main_OnActivate);
00096         HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGED, Main_OnWindowPosChanged);
00097         HANDLE_MSG(hwnd, WM_COMMAND,          Main_OnCommand);
00098         HANDLE_MSG(hwnd, WM_SIZE,             Main_OnSize);
00099         HANDLE_MSG(hwnd, WM_MOVE,             Main_OnMove);
00100         HANDLE_MSG(hwnd, WM_RBUTTONDOWN,      Main_OnRButtonDown);
00101         HANDLE_MSG(hwnd, WM_DESTROY,          Main_OnDestroy);
00102         HANDLE_MSG(hwnd, WM_TIMER,            Main_OnTimer);
00103         HANDLE_MSG(hwnd, WM_NCHITTEST,        Main_OnNCHitTest);
00104         HANDLE_MSG(hwnd, WM_PAINT,            Main_OnPaint);
00105         HANDLE_MSG(hwnd, WM_LBUTTONDOWN,      Main_OnLButtonDown);
00106         HANDLE_MSG(hwnd, WM_MOUSEMOVE,        Main_OnMouseMove);
00107         HANDLE_MSG(hwnd, WM_LBUTTONUP,        Main_OnLButtonUp);
00108
00109         case APPBAR_CALLBACK:
00110             AppBar_Callback(hwnd, uMsg, wParam, lParam);
00111             return (0);
00112
00113         default:                // Pass message on for default proccessing
00114             return DefWindowProc( hwnd, uMsg, wParam, lParam );
00115     }
00116
00117     // If we performed non-default processing on the message, return FALSE
00118     return FALSE;
00119 }
00120
00121
00122 //
00123 //  FUNCTION:   Main_OnCreate(HWND, LPCREATESTRUCT)
00124 //
00125 //  PURPOSE:    Handles any window initialization for this window class.
00126 //
00127 //  PARAMETERS:
00128 //      hwnd           - Handle of the window being created.
00129 //      lpCreateStruct - Pointer to the data used to create this window.
00130 //
00131 //  RETURN VALUE:
00132 //      Returns TRUE to allow the window to be created, FALSE otherwise.
00133 //
00134
00135 BOOL Main_OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
00136 {
00137     POPTIONS pOptions;
00138     LOGFONT lf;
00139
00140     // Initialize the common control DLL
00141     InitCommonControls();
00142
00143     // Allocate an OPTIONS struct and attach to the appbar
00144     pOptions = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OPTIONS));
00145     if (pOptions)
00146         SetWindowLongPtr(hwnd, 0,(LONG_PTR)pOptions);
00147     else
00148         return (FALSE);
00149
00150     pOptions->fAutoHide = FALSE;
00151     pOptions->fOnTop = FALSE;
00152     pOptions->uSide = ABE_TOP;
00153     pOptions->cxWidth = CX_DEFWIDTH;
00154     pOptions->cyHeight = CY_DEFHEIGHT;
00155
00156     // Register the appbar and attach it to the top by default
00157     AppBar_Register(hwnd);
00158     AppBar_SetSide(hwnd, ABE_TOP);
00159
00160     // Create the fonts for drawing in the client area
00161     ZeroMemory(&lf,sizeof(LOGFONT));
00162     lf.lfHeight = 45;
00163     lf.lfEscapement = 2700;
00164     lf.lfOrientation = 0;
00165     lstrcpyn(lf.lfFaceName, TEXT("Arial"), sizeof(lf.lfFaceName)/sizeof(lf.lfFaceName[0]));
00166     g_hFontLeft = CreateFontIndirect(&lf);
00167
00168     lf.lfEscapement = 0;
00169     g_hFontTop = CreateFontIndirect(&lf);
00170
00171
00172     return (TRUE);
00173 }
00174
00175
00176 //
00177 //  FUNCTION:   Main_OnActivate(HWND, UINT, HWND, BOOL)
00178 //
00179 //  PURPOSE:    Handles hiding and showing of the appbar if it has the autohide
00180 //              state set.
00181 //
00182 //  PARAMETERS:
00183 //      hwnd         - Handle of the window receiving the message.
00184 //      state        - Specifies whether the winodw is being activated or
00185 //                     deactivated.
00186 //      hwndActDeact - Identifies the window being activated or deactivated,
00187 //                     depending on the state parameter.
00188 //      fMinimized   - A nonzero value indicates the window is minmized.
00189 //
00190
00191 void Main_OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
00192 {
00193     APPBARDATA abd;
00194
00195     // Always send the activate message to the system
00196     abd.cbSize = sizeof(APPBARDATA);
00197     abd.hWnd = hwnd;
00198     abd.lParam = 0;
00199     SHAppBarMessage(ABM_ACTIVATE, &abd);
00200
00201     // Now determine if we're getting or losing activation
00202     switch (state)
00203     {
00204         case WA_ACTIVE:
00205         case WA_CLICKACTIVE:
00206             // If we're gaining activation, make sure we're visible
00207             AppBar_UnHide(hwnd);
00208             KillTimer(hwnd, IDT_AUTOHIDE);
00209             break;
00210
00211         case WA_INACTIVE:
00212             // If we're losing activation, check to see if we need to autohide.
00213             AppBar_Hide(hwnd);
00214             break;
00215     }
00216 }
00217
00218
00219 //
00220 //  FUNCTION:   Main_OnWindowPosChanged(HWND, const LPWINDOWPOS)
00221 //
00222 //  PURPOSE:    Notifies the system that the appbar has changed position.
00223 //
00224 //  PARAMETERS:
00225 //      hwnd    - Handle of the appbar window receiving the message
00226 //      lpwpos  - Pointer to a WINDOWPOS struct containing information about
00227 //                the new window position.
00228 //
00229
00230 void Main_OnWindowPosChanged(HWND hwnd, const LPWINDOWPOS lpwpos)
00231 {
00232     APPBARDATA abd;
00233
00234     abd.cbSize = sizeof(APPBARDATA);
00235     abd.hWnd = hwnd;
00236     abd.lParam = 0;
00237
00238     SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd);
00239
00240     // DefWindowProc needs this to generate the WM_SIZE message.
00241     FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, DefWindowProc);
00242 }
00243
00244
00245 //
00246 //  FUNCTION:   Main_OnCommand(HWND, int, HWND, UINT)
00247 //
00248 //  PURPOSE:    Handles the WM_COMMAND messages for the Win32Generic window
00249 //              class
00250 //
00251 //  PARAMETERS:
00252 //      hwnd        - handle of the window receiving the message
00253 //      id          - identifier of the command
00254 //      hwndCtl     - handle of the control sending the message)
00255 //      codeNotify  - specifies the notification code if the message is from
00256 //                    a control
00257 //
00258 //  RETURN VALUE:
00259 //      none
00260 //
00261 //  COMMENTS:
00262 //      codeNotify is 1 if from an accelerator, 0 if from a menu.
00263 //      If the message is not from a control hwndCtl is NULL.
00264 //
00265
00266 void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
00267 {
00268     switch (id)
00269     {
00270         case ID_FILE_EXIT:
00271             // The user wants to exit, so send our window a close message
00272             SendMessage(hwnd, WM_CLOSE, 0, 0L);
00273             break;
00274
00275         case ID_HELP_ABOUT:
00276             // Display the "About" dialog
00277             DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwnd,
00278                       AboutDlgProc);
00279             break;
00280
00281         case ID_PROPERTIES:
00282             ShowOptions(hwnd);
00283             break;
00284
00285         case ID_APPBAR_REGISTER:
00286             AppBar_Register(hwnd);
00287             break;
00288
00289         case ID_APPBAR_UNREGISTER:
00290             AppBar_UnRegister(hwnd);
00291             break;
00292
00293         case ID_APPBAR_AUTOHIDE:
00294             AppBar_SetAutoHide(hwnd, TRUE);
00295             break;
00296
00297         case ID_APPBAR_NOAUTOHIDE:
00298             AppBar_SetAutoHide(hwnd, FALSE);
00299             break;
00300
00301         case ID_APPBAR_TOP:
00302             AppBar_SetSide(hwnd, ABE_TOP);
00303             break;
00304
00305         case ID_APPBAR_BOTTOM:
00306             AppBar_SetSide(hwnd, ABE_BOTTOM);
00307             break;
00308
00309         case ID_APPBAR_LEFT:
00310             AppBar_SetSide(hwnd, ABE_LEFT);
00311             break;
00312
00313         case ID_APPBAR_RIGHT:
00314             AppBar_SetSide(hwnd, ABE_RIGHT);
00315             break;
00316     }
00317 }
00318
00319
00320 //
00321 //  FUNCTION:   Main_OnSize(HWND, UINT, int, int)
00322 //
00323 //  PURPOSE:    Notifies the system the appbar size has changed and updates the
00324 //              width and height stored in the OPTIONS struct.
00325 //
00326 //  PARAMETERS:
00327 //      hwnd    - Handle of the appbar window receiving the message.
00328 //      state   - Determines the type of sizing that occured.
00329 //      cx      - New width of the client area.
00330 //      cy      - New height of the client area.
00331 //
00332 //  COMMENTS:
00333 //      TODO: If the client rect size is zero and the bar is on the top or
00334 //      right, then the user will not be able to resize the window
00335
00336 void Main_OnSize(HWND hwnd, UINT state, int cx, int cy)
00337 {
00338     POPTIONS pOpt = GetAppbarData(hwnd);
00339     RECT rcWindow;
00340
00341     if (g_fMoving || pOpt->fAutoHide)
00342         return;
00343
00344     // If the client width or height is zero, spew out a warning.
00345     if (!pOpt->fHiding && ((cx == 0) || (cy == 0)))
00346         DebugMsg(TEXT("Client area has a zero dimension!\r\n"));
00347
00348     // Let the system know the appbar size has changed
00349     AppBar_Size(hwnd);
00350
00351     // Update the stored height and widths if the appbar is not hidden
00352     if (!pOpt->fHiding)
00353     {
00354         GetWindowRect(hwnd, &rcWindow);
00355
00356         if (pOpt->uSide == ABE_TOP || pOpt->uSide == ABE_BOTTOM)
00357             pOpt->cyHeight = rcWindow.bottom - rcWindow.top;
00358         else
00359             pOpt->cxWidth = rcWindow.right - rcWindow.left;
00360
00361         DebugMsg(TEXT("Main_OnSize: cxWidth = %d, cyHeight = %d\r\n"),
00362                  pOpt->cxWidth, pOpt->cyHeight);
00363     }
00364 }
00365
00366
00367 //
00368 //  FUNCTION:   Main_OnMove(HWND, int, int)
00369 //
00370 //  PURPOSE:    Notifies the system the appbar has moved.
00371 //
00372 //  PARAMETERS:
00373 //      hwnd    - Handle of the appbar window receiving the message.
00374 //      x       - New x-coordinate of the upper left corner of the client area
00375 //      y       - New y-coordinate of the upper left corner of the client area
00376 //
00377
00378 void Main_OnMove(HWND hwnd, int x, int y)
00379 {
00380     POPTIONS pOpt = GetAppbarData(hwnd);
00381
00382     if (g_fMoving || pOpt->fAutoHide)
00383         return;
00384     AppBar_Size(hwnd);
00385 }
00386
00387
00388 //
00389 //  FUNCTION:   Main_OnRButtonDown(HWND, BOOL, int, int, UINT)
00390 //
00391 //  PURPOSE:    Displays the context menu for the appbar.
00392 //
00393 //  PARAMETERS:
00394 //      hwnd     - Handle of the window receiving this message.
00395 //      x, y     - Position of the mouse in client coordinates.
00396 //      keyFlags - State of the keyboard when the mouse button was pressed.
00397 //
00398 //
00399
00400 void Main_OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y,
00401                         UINT keyFlags)
00402 {
00403     HMENU hMenu, hSubMenu;
00404     POINT pt = {x, y};
00405     MENUITEMINFO mii;
00406     POPTIONS pOptions = GetAppbarData(hwnd);
00407     UINT uItem;
00408     TCHAR szMenu[64];
00409
00410     // Bring up the context menu
00411     hMenu = LoadMenu(g_hInstance, MAKEINTRESOURCE(IDR_CONTEXTMENU));
00412     hSubMenu = GetSubMenu(hMenu, 0);
00413
00414     // Convert the mouse position to screen coordinates
00415     ClientToScreen(hwnd, &pt);
00416
00417     // Set the default menu item
00418     mii.cbSize = sizeof(MENUITEMINFO);
00419     mii.fMask = MIIM_STATE;
00420     mii.fState = MFS_DEFAULT;
00421
00422     SetMenuItemInfo(hSubMenu, ID_PROPERTIES, FALSE, &mii);
00423
00424     // Set the radio button to the side we're on
00425     if (ABE_TOP == pOptions->uSide)
00426         uItem = ID_APPBAR_TOP;
00427     else if (ABE_BOTTOM == pOptions->uSide)
00428         uItem = ID_APPBAR_BOTTOM;
00429     else if (ABE_LEFT == pOptions->uSide)
00430         uItem = ID_APPBAR_LEFT;
00431     else
00432         uItem = ID_APPBAR_RIGHT;
00433
00434     mii.fMask = MIIM_TYPE | MIIM_STATE;
00435     (LPTSTR) mii.dwTypeData = szMenu;
00436     mii.cch = sizeof(szMenu);
00437
00438     GetMenuItemInfo(hSubMenu, uItem, FALSE, &mii);
00439
00440     mii.fType |= MFT_RADIOCHECK;
00441     mii.fState = MFS_CHECKED;
00442
00443     SetMenuItemInfo(hSubMenu, uItem, FALSE, &mii);
00444
00445     // Display the menu
00446     TrackPopupMenu(hSubMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
00447 }
00448
00449
00450 //
00451 //  FUNCTION:   Main_OnDestroy(HWND)
00452 //
00453 //  PURPOSE:    Handle any clean up and post the quit message to exit the
00454 //              message loop.
00455 //
00456 //  PARAMETERS:
00457 //      hwnd    - handle of the window receiving this message
00458 //
00459
00460 void Main_OnDestroy(HWND hwnd)
00461 {
00462     POPTIONS pOptions = GetAppbarData(hwnd);
00463
00464     // Make sure the appbar is unregistered
00465     if (g_fAppRegistered)
00466     {
00467         SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(ID_APPBAR_UNREGISTER, 0), 0L);
00468     }
00469
00470     // Free the OPTIONS struct associated with the appbar
00471     HeapFree(GetProcessHeap(), 0, pOptions);
00472
00473     // Clean up the GDI objects we allocated
00474     DeleteObject(g_hFontTop);
00475     DeleteObject(g_hFontLeft);
00476
00477     // Indicate that the message loop should exit since the main window
00478     // is being destroyed.
00479     PostQuitMessage(0);
00480 }
00481
00482
00483 //
00484 //  FUNCTION:   Main_OnTimer(HWND, UINT)
00485 //
00486 //  PURPOSE:    Handles timer messages to either delay the showing or hiding
00487 //              of an appbar with the autohide state set.
00488 //
00489 //  PARAMETERS:
00490 //      hwnd    - Handle of the window receiving the timer.
00491 //      id      - ID of the timer message.
00492 //
00493
00494 void Main_OnTimer(HWND hwnd, UINT id)
00495 {
00496     POPTIONS pOpt = GetAppbarData(hwnd);
00497     POINT pt;
00498     RECT rc;
00499     HWND hwndActive;
00500
00501     switch (id)
00502     {
00503         // The AUTOHIDE timer has fired.  Check to see if the mouse is over our
00504         // window and if not hide the appbar.
00505         case IDT_AUTOHIDE:
00506             if ((pOpt->fAutoHide) && (!pOpt->fHiding))
00507             {
00508                 // Get the mouse position, the window position, and active
00509                 // window
00510                 GetCursorPos(&pt);
00511                 GetWindowRect(hwnd, &rc);
00512                 hwndActive = GetForegroundWindow();
00513
00514                 // If the mouse is outside of our window, or we are not active,
00515                 // or at least one window is active, or we are not the parent
00516                 // of an active window, the hide the appbar window.
00517                 if ((!PtInRect(&rc, pt)) && (hwndActive != hwnd) &&
00518                     (hwndActive != NULL) && (GetWindowOwner(hwndActive) != hwnd))
00519                 {
00520                     KillTimer(hwnd, id);
00521                     AppBar_Hide(hwnd);
00522                 }
00523             }
00524             break;
00525
00526         // The period between the time the user has entered our window and the
00527         // time we should show the window has expired.
00528         case IDT_AUTOUNHIDE:
00529             // Kill the timer, we only need it to fire once.
00530             KillTimer(hwnd, id);
00531
00532             GetWindowRect(hwnd, &rc);
00533             if ((pOpt->fAutoHide) && (pOpt->fHiding))
00534             {
00535                 // Check to see if the cursor is still in the appbar.  If so,
00536                 // the unhide the window.
00537                 GetCursorPos(&pt);
00538                 if (PtInRect(&rc, pt))
00539                     AppBar_UnHide(hwnd);
00540             }
00541             break;
00542     }
00543 }
00544
00545
00546 //
00547 //  FUNCTION:   Main_OnNCHitTest(HWND, int, int)
00548 //
00549 //  PURPOSE:    Determines if we're over an edge that is resizable and also
00550 //              starts the window unhiding process.
00551 //
00552 //  PARAMETERS:
00553 //      hwnd    - Handle of the window receiving this message.
00554 //      x, y    - Position of the mouse in screen coordinates.
00555 //
00556 //  RETURN VALUE:
00557 //      Returns a constant denoting what part of the window the mouse is over.
00558 //      If the mouse is over a resizing border that is not on the inside of the
00559 //      screen, the function returns HTCLIENT to prevent the user from being
00560 //      able to resize the window in this direction.
00561 //
00562
00563 UINT Main_OnNCHitTest(HWND hwnd, int x, int y)
00564 {
00565     POPTIONS pOpt = GetAppbarData(hwnd);
00566     LRESULT  lHitTest;
00567
00568     // Take care of the autohide stuff if needed
00569     AppBar_SetAutoUnhideTimer(hwnd);
00570
00571     // Let DefWindowProc() tell us where the mouse is
00572     lHitTest = FORWARD_WM_NCHITTEST(hwnd, x, y, DefWindowProc);
00573
00574     // We want to disable sizing in all directions except the inside edge.
00575     if ((pOpt->uSide == ABE_TOP) && (lHitTest == HTBOTTOM))
00576         return HTBOTTOM;
00577
00578     if ((pOpt->uSide == ABE_BOTTOM) && (lHitTest == HTTOP))
00579         return HTTOP;
00580
00581     if ((pOpt->uSide == ABE_LEFT) && (lHitTest == HTRIGHT))
00582         return HTRIGHT;
00583
00584     if ((pOpt->uSide == ABE_RIGHT) && (lHitTest == HTLEFT))
00585         return HTLEFT;
00586
00587
00588     return HTCLIENT;
00589 }
00590
00591
00592 //
00593 //  FUNCTION:   Main_OnPaint
00594 //
00595 //  PURPOSE:    Displays a message in the AppBar client area
00596 //
00597 //  PARAMETERS:
00598 //      hwnd - Handle of the window receiving the message.
00599 //
00600
00601 void Main_OnPaint(HWND hwnd)
00602 {
00603     POPTIONS pOpt = GetAppbarData(hwnd);
00604     HDC hdc;
00605     PAINTSTRUCT ps;
00606     RECT rc;
00607     HFONT hfont;
00608     int x,y;
00609
00610     // Get the client rect
00611     GetClientRect(hwnd, &rc);
00612     InvalidateRect(hwnd, NULL, TRUE);
00613
00614     hdc = BeginPaint(hwnd, &ps);
00615
00616     // Figure out which side we're on so we can adjust the text accordingly
00617     switch (pOpt->uSide)
00618     {
00619         case ABE_TOP:
00620         case ABE_BOTTOM:
00621             hfont = SelectObject(hdc, g_hFontTop);
00622             x = 2;
00623             y = 2;
00624             break;
00625
00626         case ABE_LEFT:
00627         case ABE_RIGHT:
00628             hfont = SelectObject(hdc, g_hFontLeft);
00629             x = rc.right - 2;
00630             y = 2;
00631             break;
00632     }
00633
00634     // Draw the text and clean up
00635     ExtTextOut(hdc, x, y, ETO_OPAQUE, NULL, TEXT("Right Click for Options"),
00636                lstrlen(TEXT("Right Click for Options")), NULL);
00637
00638     SelectObject(hdc, hfont);
00639     EndPaint(hwnd, &ps);
00640
00641 }
00642
00643
00644 //
00645 //  FUNCTION:   Main_OnLButtonDown
00646 //
00647 //  PURPOSE:    This handler is called when the user is beginning to drag the
00648 //              appbar around the screen.
00649 //
00650 //  PARAMETERS:
00651 //      hwnd         - Handle of the appbar window being dragged.
00652 //      fDoubleClick - TRUE if this is a double click.
00653 //      x, y         - Position of the mouse in client coordinates when then
00654 //                     button was pressed.
00655 //      keyFlags     - Keyboard state flags.
00656 //
00657
00658
00659 void Main_OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
00660 {
00661     POPTIONS pOpt = GetAppbarData(hwnd);
00662
00663     g_fMoving = TRUE;
00664     SetCapture(hwnd);
00665 }
00666
00667 //
00668 //  FUNCTION:   Main_OnMouseMove
00669 //
00670 //  PURPOSE:    We need to keep track of the mouse position, and update the
00671 //              appbar position when the mouse is in the appropriate quadrent
00672 //              of the screen.
00673 //
00674 //  PARAMETERS:
00675 //      hwnd     - Handle of the AppBar window.
00676 //      x, y     - Position of the mouse in screen coordinates
00677 //      keyFlags - Keyboard state flags.  Not used.
00678 //
00679
00680 void Main_OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags)
00681 {
00682     POINT ptCursor = {x, y};
00683     LONG cxScreen, cyScreen;
00684     DWORD dx, dy;
00685     WORD horiz, vert;
00686     POPTIONS pOpt = GetAppbarData(hwnd);
00687     APPBARDATA abd;
00688
00689     // If we're not currently in the middle of moving the appbar window,
00690     // there's nothing to do.
00691     if (!g_fMoving)
00692         return;
00693
00694     // Convert the mouse position to screen coordinates
00695     ClientToScreen(hwnd, &ptCursor);
00696
00697     // Find out which edge of the screen we're closest to
00698     cxScreen = GetSystemMetrics(SM_CXSCREEN);
00699     cyScreen = GetSystemMetrics(SM_CYSCREEN);
00700
00701     if (ptCursor.x < (cxScreen / 2))
00702     {
00703         dx = ptCursor.x;
00704         horiz = ABE_LEFT;
00705     }
00706     else
00707     {
00708         dx = cxScreen - ptCursor.x;
00709         horiz = ABE_RIGHT;
00710     }
00711
00712     if (ptCursor.y < (cyScreen / 2))
00713     {
00714         dy = ptCursor.y;
00715         vert = ABE_TOP;
00716     }
00717     else
00718     {
00719         dy = cyScreen - ptCursor.y;
00720         vert = ABE_BOTTOM;
00721     }
00722
00723     // Build a drag rectangle based on the edge of the screen that we're
00724     // closest to.
00725     if ((cxScreen * dy) > (cyScreen * dx))
00726     {
00727         g_rcDrag.top = 0;
00728         g_rcDrag.bottom = cyScreen;
00729         if (horiz == ABE_LEFT)
00730         {
00731             g_rcDrag.left = 0;
00732             g_rcDrag.right = g_rcDrag.left + pOpt->cxWidth;
00733             pOpt->uSide = ABE_LEFT;
00734         }
00735         else
00736         {
00737             g_rcDrag.right = cxScreen;
00738             g_rcDrag.left = g_rcDrag.right - pOpt->cxWidth;
00739             pOpt->uSide = ABE_RIGHT;
00740         }
00741     }
00742     else
00743     {
00744         g_rcDrag.left = 0;
00745         g_rcDrag.right = cxScreen;
00746         if (vert == ABE_TOP)
00747         {
00748             g_rcDrag.top = 0;
00749             g_rcDrag.bottom = g_rcDrag.top + pOpt->cyHeight;
00750             pOpt->uSide = ABE_TOP;
00751         }
00752         else
00753         {
00754             g_rcDrag.bottom = cyScreen;
00755             g_rcDrag.top = g_rcDrag.bottom - pOpt->cyHeight;
00756             pOpt->uSide = ABE_BOTTOM;
00757         }
00758     }
00759
00760     // Finally, make sure this is an OK position with the system and move
00761     // the window.
00762     abd.cbSize = sizeof(APPBARDATA);
00763     abd.hWnd = hwnd;
00764
00765     AppBar_QueryPos(hwnd, &g_rcDrag);
00766     MoveWindow(hwnd, g_rcDrag.left, g_rcDrag.top,
00767                g_rcDrag.right - g_rcDrag.left,
00768                g_rcDrag.bottom - g_rcDrag.top,
00769                TRUE);
00770 }
00771
00772
00773 //
00774 //  FUNCTION:   Main_OnLButtonUp
00775 //
00776 //  PURPOSE:    The user is done dragging the window around, so we need to
00777 //              let the system know we have a new space to occupy.
00778 //
00779 //  PARAMETERS:
00780 //      hwnd     - Handle of the AppBar window.
00781 //      x, y     - Position of the mouse in client coordinates.
00782 //      keyFlags - Keyboard state flags.  Not used.
00783 //
00784
00785 void Main_OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags)
00786 {
00787     APPBARDATA abd;
00788     POPTIONS pOpt = GetAppbarData(hwnd);
00789
00790     if (!g_fMoving)
00791         return;
00792
00793     // Update the global appbar rect used when we're autohiding.  This is
00794     // sloppy but it works for now.  It would be better to maintain two rects,
00795     // one for the hidden state and one for the unhidden state.
00796     g_rcAppBar = g_rcDrag;
00797
00798     // Clean up the drag state info.
00799     ReleaseCapture();
00800
00801     // Calculate the hidden rect if we need to and then tell the system about
00802     // our new area.
00803     abd.cbSize = sizeof(APPBARDATA);
00804     abd.hWnd = hwnd;
00805
00806     if (pOpt->fAutoHide)
00807     {
00808         switch (pOpt->uSide)
00809         {
00810             case ABE_TOP:
00811                 g_rcDrag.bottom = g_rcDrag.top + 2;
00812                 break;
00813             case ABE_BOTTOM:
00814                 g_rcDrag.top = g_rcDrag.bottom - 2;
00815                 break;
00816             case ABE_LEFT:
00817                 g_rcDrag.right = g_rcDrag.left + 2;
00818                 break;
00819             case ABE_RIGHT:
00820                 g_rcDrag.left = g_rcDrag.right - 2;
00821                 break;
00822         }
00823     }
00824
00825     AppBar_QuerySetPos(pOpt->uSide, &g_rcDrag, &abd, FALSE);
00826
00827     g_fMoving = FALSE;
00828 }
00829
00830
00831 //
00832 //  FUNCTION:   AboutDlgProc(HWND, UINT, WPARAM, LPARAM)
00833 //
00834 //  PURPOSE:    Processes messages for the About dialog box
00835 //
00836 //  PARAMETERS:
00837 //      hwnd    - window handle of the dialog box
00838 //      uMsg    - identifier of the message being handled
00839 //      wParam  - additional info associated with the message
00840 //      lParam  - additional info associated with the message
00841 //
00842 //  RETURN VALUE:
00843 //      Except in response to the WM_INITDIALOG message, the dialog box
00844 //      procedure should return nonzero if it processes the message, and zero
00845 //      if it does not.
00846 //
00847
00848 LRESULT CALLBACK AboutDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam,
00849                               LPARAM lParam)
00850 {
00851     switch(uMsg)
00852     {
00853         case WM_INITDIALOG:
00854             // Should return nonzero to set focus to the first control in the
00855             // dialog, or zero if this routine sets the focus manually.
00856             return (TRUE);
00857
00858         case WM_COMMAND:
00859             switch (LOWORD(wParam))
00860             {
00861                 case IDOK:
00862                     EndDialog(hwnd, 0);
00863                     break;
00864             }
00865             return (TRUE);
00866     }
00867     return (FALSE);
00868 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpISessionProperties Member List

This is the complete list of members for CImpISessionProperties, including all inherited members.
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDBSession, CImpISessionProperties) | CImpISessionProperties
GetProperties(ULONG cPropertySets, const DBPROPIDSET rgPropertySets[], ULONG *pcProperties, DBPROPSET **prgProperties) | CImpISessionProperties
SetProperties(ULONG cPropertySets, DBPROPSET rgPropertySets[]) | CImpISessionProperties
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COBLIST Member List

This is the complete list of members for COBLIST, including all inherited members.
AddTail(void *pItem) | COBLIST |
AddTail(void *pItem) | COBLIST |
AddTail(void *pItem) | COBLIST |
AddTail(void *pItem) | COBLIST |
COBLIST() | COBLIST | [inline]
COBLIST() | COBLIST | [inline]
COBLIST() | COBLIST | [inline]
COBLIST() | COBLIST | [inline]
Compare(void *pItemToCompare, void *pComparator) | COBLIST | [inline, protected, virtual]
Compare(void *pItemToCompare, void *pComparator) | COBLIST | [inline, protected, virtual]
Compare(void *pItemToCompare, void *pComparator) | COBLIST | [inline, protected, virtual]
Compare(void *pItemToCompare, void *pComparator) | COBLIST | [inline, protected, virtual]
EmptyList() | COBLIST |
EmptyList() | COBLIST |
EmptyList() | COBLIST |
EmptyList() | COBLIST |
GetFromPosition(POSITION rPos) | COBLIST | [inline]
GetFromPosition(POSITION rPos) | COBLIST | [inline]
GetFromPosition(POSITION rPos) | COBLIST | [inline]
GetFromPosition(POSITION rPos) | COBLIST | [inline]
GetHead() | COBLIST | [inline]
GetHead() | COBLIST | [inline]
GetHead() | COBLIST | [inline]
GetHead() | COBLIST | [inline]
GetHeadPosition() | COBLIST | [inline]
GetHeadPosition() | COBLIST | [inline]
GetHeadPosition() | COBLIST | [inline]
GetHeadPosition() | COBLIST | [inline]
GetItemCount() | COBLIST | [inline]
GetItemCount() | COBLIST | [inline]
GetItemCount() | COBLIST | [inline]
GetNext(POSITION &rPos) | COBLIST |
GetNext(POSITION &rPos) | COBLIST |
GetNext(POSITION &rPos) | COBLIST |
GetNext(POSITION &rPos) | COBLIST |
GetPosition(void *pItem) | COBLIST |
GetPosition(void *pItem) | COBLIST |
GetPosition(void *pItem) | COBLIST |
GetPosition(void *pItem) | COBLIST |
GetTail() | COBLIST | [inline]
GetTail() | COBLIST | [inline]
GetTail() | COBLIST | [inline]
GetTail() | COBLIST |
GetTailPosition() | COBLIST | [inline]
GetTailPosition() | COBLIST | [inline]
GetTailPosition() | COBLIST | [inline]
GetTailPosition() | COBLIST | [inline]
IsEmpty() | COBLIST | [inline]
IsEmpty() | COBLIST | [inline]
IsEmpty() | COBLIST | [inline]
IsEmpty() | COBLIST | [inline]
Lookup(void *pComparator) | COBLIST |
Lookup(void *pComparator) | COBLIST |
Lookup(void *pComparator) | COBLIST |
Lookup(void *pComparator) | COBLIST |
m_cItem | COBLIST | [protected]
m_pHead | COBLIST | [protected]
m_pTail | COBLIST | [protected]
RemoveAt(POSITION rPos) | COBLIST | [virtual]
RemoveAt(POSITION rPos) | COBLIST | [virtual]
RemoveAt(POSITION rPos) | COBLIST | [virtual]
RemoveAt(POSITION rPos) | COBLIST | [virtual]
RemoveHead() | COBLIST | [inline]
RemoveHead() | COBLIST | [inline]
RemoveHead() | COBLIST | [inline]
RemoveHead() | COBLIST | [inline]
RemoveTail() | COBLIST | [inline]
RemoveTail() | COBLIST | [inline]
RemoveTail() | COBLIST | [inline]
RemoveTail() | COBLIST | [inline]
SafeGetFromPosition(POSITION rPos) | COBLIST |
SafeGetFromPosition(POSITION rPos) | COBLIST |
SafeGetFromPosition(POSITION rPos) | COBLIST |
SafeGetFromPosition(POSITION rPos) | COBLIST |
~COBLIST() | COBLIST | [virtual]
~COBLIST() | COBLIST | [virtual]
~COBLIST() | COBLIST | [virtual]
~COBLIST() | COBLIST | [virtual]
Generated on Wed Nov 13 2024 16:56:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/SCPUI.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

SCPUI.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       SCPUI.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "SCPUI.h"
00013 #include "util.h"
00014 #include "adsprop.h"
00015
00016 //
00017 // General Page
00018 //
00019
00020 BEGIN_MESSAGE_MAP(CSCPUIGeneral, CPropertyPage)
00021   ON_EN_CHANGE(IDC_DNS_NAME_EDIT, OnPropertyChange)
00022   ON_EN_CHANGE(IDC_DNS_NAME_TYPE_EDIT, OnPropertyChange)
00023   ON_EN_CHANGE(IDC_SERVICE_CLASS_EDIT, OnPropertyChange)
00024   ON_EN_CHANGE(IDC_DESCRIPTION_EDIT, OnPropertyChange)
00025   ON_WM_DESTROY()
00026 END_MESSAGE_MAP()
00027
00028 IMPLEMENT_DYNCREATE(CSCPUIGeneral, CPropertyPage)
00029
00030 BOOL CSCPUIGeneral::OnInitDialog()
00031 {
00032   BOOL bRes = CPropertyPage::OnInitDialog();
00033
00034   //
00035   // Verify that this page is only coming up for users
00036   //
00037   ASSERT(m_szClass == _T("serviceConnectionPoint"));
00038
00039   //
00040   // Display data in UI
00041   //
00042   SetUIData();
00043
00044   //
00045   // The page may have become dirty due to the SetWindowText() in SetUIData(),
00046   // so clear the dirty flag.
00047   //
00048   m_bDirty = FALSE;
00049   return bRes;
00050 }
00051
00052 HRESULT CSCPUIGeneral::Init(PWSTR pszPath, PWSTR pszClass)
00053 {
00054   //
00055   // Store local versions of the path and class
00056   //
00057   m_szPath = pszPath;
00058   m_szClass = pszClass;
00059
00060   //
00061   // Get the property page initialization parameters from the notify window
00062   //
00063   ADSPROPINITPARAMS InitParams = {0};
00064   InitParams.dwSize = sizeof(ADSPROPINITPARAMS);
00065   if (!ADsPropGetInitInfo(m_hNotifyObj, &InitParams))
00066   {
00067     return E_FAIL;
00068   }
00069
00070   if (FAILED(InitParams.hr))
00071   {
00072     return InitParams.hr;
00073   }
00074
00075   //
00076   // Store local versions of the IDirectoryObject interface pointer
00077   // and the writable attributes
00078   //
00079   m_spDsObj = InitParams.pDsObj;
00080   m_pWritableAttrs = InitParams.pWritableAttrs;
00081
00082   return S_OK;
00083 }
00084
00085 void CSCPUIGeneral::SetUIData()
00086 {
00087   //
00088   // Prime the controls with the data from the object
00089   //
00090   LPWSTR ppszAttrNames[] = { _T("adminDescription"),
00091                              _T("serviceDnsName"),
00092                              _T("serviceDnsNameType"),
00093                              _T("serviceClassName") };
00094   PADS_ATTR_INFO pAttrInfo = NULL;
00095   DWORD dwReturned = 0;
00096
00097   //
00098   // Retrieve the data
00099   //
00100   HRESULT hr = m_spDsObj->GetObjectAttributes(ppszAttrNames, 4, &pAttrInfo, &dwReturned);
00101   if (FAILED(hr))
00102   {
00103     AfxMessageBox(_T("Failed to retrieve data for this object."));
00104     return;
00105   }
00106
00107   //
00108   // Put the data in the appropriate control
00109   //
00110   for (DWORD idx = 0; idx < dwReturned; idx++)
00111   {
00112     ASSERT(pAttrInfo != NULL);
00113     if (_wcsicmp(pAttrInfo[idx].pszAttrName, L"adminDescription") == 0)
00114     {
00115       m_szDescription = pAttrInfo[idx].pADsValues->CaseIgnoreString;
00116       GetDlgItem(IDC_DESCRIPTION_EDIT)->SetWindowText(m_szDescription);
00117     }
00118     else if (_wcsicmp(pAttrInfo[idx].pszAttrName, L"serviceDnsName") == 0)
00119     {
00120       m_szServiceDNSName = pAttrInfo[idx].pADsValues->CaseIgnoreString;
00121       GetDlgItem(IDC_DNS_NAME_EDIT)->SetWindowText(m_szServiceDNSName);
00122     }
00123     else if (_wcsicmp(pAttrInfo[idx].pszAttrName, L"serviceDnsNameType") == 0)
00124     {
00125       m_szServiceDNSNameType = pAttrInfo[idx].pADsValues->CaseIgnoreString;
00126       GetDlgItem(IDC_DNS_NAME_TYPE_EDIT)->SetWindowText(m_szServiceDNSNameType);
00127     }
00128     else if (_wcsicmp(pAttrInfo[idx].pszAttrName, L"serviceClassName") == 0)
00129     {
00130       m_szServiceClassName = pAttrInfo[idx].pADsValues->CaseIgnoreString;
00131       GetDlgItem(IDC_SERVICE_CLASS_EDIT)->SetWindowText(m_szServiceClassName);
00132     }
00133   }
00134
00135   //
00136   // Free the memory allocated by GetObjectAttributes()
00137   //
00138   FreeADsMem(pAttrInfo);
00139 }
00140
00141
00142
00143 void CSCPUIGeneral::GetUIData()
00144 {
00145   //
00146   // Retrieve the data from the controls
00147   //
00148   GetDlgItem(IDC_DESCRIPTION_EDIT)->GetWindowText(m_szDescription);
00149   GetDlgItem(IDC_DNS_NAME_EDIT)->GetWindowText(m_szServiceDNSName);
00150   GetDlgItem(IDC_SERVICE_CLASS_EDIT)->GetWindowText(m_szServiceClassName);
00151   GetDlgItem(IDC_DNS_NAME_TYPE_EDIT)->GetWindowText(m_szServiceDNSNameType);
00152 }
00153
00154 BOOL CSCPUIGeneral::OnApply()
00155 {
00156   if (!m_bDirty)
00157   {
00158     //
00159     // Signal the change notification. Note that the notify-apply
00160     // message must be sent even if the page is not dirty so that
00161     // the notify ref-counting will properly decrement.
00162     //
00163     ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_APPLY, TRUE, 0);
00164
00165     return TRUE;
00166   }
00167
00168   ASSERT(m_spDsObj != NULL);
00169
00170   //
00171   // Retrieve the data from the UI
00172   //
00173   GetUIData();
00174
00175   HRESULT hr = S_OK;
00176   ADS_ATTR_INFO attrInfo[4];
00177   PWSTR rgpwzAttrNames[] = { _T("adminDescription"),
00178                              _T("serviceDNSName"),
00179                              _T("serviceDNSNameType"),
00180                              _T("serviceClassName") };
00181   ADSVALUE Value[4];
00182
00183   //
00184   // Set the update values for adminDescription
00185   //
00186   attrInfo[0].dwADsType = ADSTYPE_OCTET_STRING;
00187   attrInfo[0].pszAttrName = rgpwzAttrNames[0];
00188
00189   Value[0].dwType = ADSTYPE_CASE_IGNORE_STRING;
00190   Value[0].CaseIgnoreString = (LPWSTR)(LPCWSTR)m_szDescription;
00191
00192   attrInfo[0].pADsValues = &Value[0];
00193   attrInfo[0].dwNumValues = 1;
00194   attrInfo[0].dwControlCode = ADS_ATTR_UPDATE;
00195
00196   //
00197   // Set the update values for serviceDNSName
00198   //
00199   attrInfo[1].dwADsType = ADSTYPE_CASE_IGNORE_STRING;
00200   attrInfo[1].pszAttrName = rgpwzAttrNames[1];
00201
00202   Value[1].dwType = ADSTYPE_CASE_IGNORE_STRING;
00203   Value[1].CaseIgnoreString  = (LPWSTR)(LPCWSTR)m_szServiceDNSName;
00204
00205   attrInfo[1].pADsValues = &Value[1];
00206   attrInfo[1].dwNumValues = 1;
00207   attrInfo[1].dwControlCode = ADS_ATTR_UPDATE;
00208
00209   //
00210   // Set the update values for serviceDNSNameType
00211   //
00212   attrInfo[2].dwADsType = ADSTYPE_CASE_IGNORE_STRING;
00213   attrInfo[2].pszAttrName = rgpwzAttrNames[2];
00214
00215   Value[2].dwType = ADSTYPE_CASE_IGNORE_STRING;
00216   Value[2].CaseIgnoreString  = (LPWSTR)(LPCWSTR)m_szServiceDNSNameType;
00217
00218   attrInfo[2].pADsValues = &Value[2];
00219   attrInfo[2].dwNumValues = 1;
00220   attrInfo[2].dwControlCode = ADS_ATTR_UPDATE;
00221
00222   //
00223   // Set the update values for serviceClassName
00224   //
00225   attrInfo[3].dwADsType = ADSTYPE_CASE_IGNORE_STRING;
00226   attrInfo[3].pszAttrName = rgpwzAttrNames[3];
00227
00228   Value[3].dwType = ADSTYPE_CASE_IGNORE_STRING;
00229   Value[3].CaseIgnoreString = (LPWSTR)(LPCWSTR)m_szServiceClassName;
00230
00231   attrInfo[3].pADsValues = &Value[3];
00232   attrInfo[3].dwNumValues = 1;
00233   attrInfo[3].dwControlCode = ADS_ATTR_UPDATE;
00234
00235   //
00236   // Set the new values in Active Directory
00237   //
00238   DWORD dwReturned = 0;
00239   hr = m_spDsObj->SetObjectAttributes(attrInfo, 4, &dwReturned);
00240   if (FAILED(hr))
00241   {
00242     AfxMessageBox(_T("Failed to set values for object."));
00243     return FALSE;
00244   }
00245
00246   if (dwReturned < 4)
00247   {
00248     AfxMessageBox(_T("Failed to set values for object."));
00249     return FALSE;
00250   }
00251
00252   //
00253   // Signal the change notification. Note that the notify-apply
00254   // message must be sent even if the page is not dirty so that
00255   // the notify ref-counting will properly decrement.
00256   //
00257   ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_APPLY, TRUE, 0);
00258
00259   return TRUE;
00260 }
00261
00262 void CSCPUIGeneral::OnPropertyChange()
00263 {
00264   m_bDirty = TRUE;
00265
00266   //
00267   // Enable the apply button
00268   //
00269   SetModified(TRUE);
00270 }
00271
00272 void CSCPUIGeneral::OnDestroy()
00273 {
00274   CPropertyPage::OnDestroy();
00275
00276   //
00277   // Tell the notification object to shut down
00278   //
00279   ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_EXIT, 0, 0);
00280
00281   delete this;
00282 }
00283
00284
00285 //
00286 // Binding Information page
00287 //
00288
00289 BEGIN_MESSAGE_MAP(CSCPUIBindingInfo, CPropertyPage)
00290   ON_BN_CLICKED(IDC_ADD_BUTTON, OnPropertyChange)
00291   ON_BN_CLICKED(IDC_DELETE_BUTTON, OnPropertyChange)
00292   ON_WM_DESTROY()
00293 END_MESSAGE_MAP()
00294
00295 IMPLEMENT_DYNCREATE(CSCPUIBindingInfo, CPropertyPage)
00296
00297 BOOL CSCPUIBindingInfo::OnInitDialog()
00298 {
00299   BOOL bRes = CPropertyPage::OnInitDialog();
00300
00301   //
00302   // Verify that this page is only coming up for users
00303   //
00304   ASSERT(m_szClass == _T("serviceConnectionPoint"));
00305
00306   //
00307   // Display data in UI
00308   //
00309   SetUIData();
00310
00311   //
00312   // Create and initialize the multi-valued attribute editor
00313   //
00314   m_pAttributeEditor = new CMultiValuedAttributeEditor(m_szValueList);
00315   m_pAttributeEditor->Initialize(IDC_KEYWORD_EDIT,
00316                                   IDC_KEYWORD_LIST,
00317                                   IDC_ADD_BUTTON,
00318                                   IDC_DELETE_BUTTON,
00319                                   this);
00320
00321   //
00322   // The page may have been marked dirty due to the SetWindowText() in SetUIData(),
00323   // so clear the dirty flag.
00324   //
00325   m_bDirty = FALSE;
00326   return bRes;
00327 }
00328
00329 HRESULT CSCPUIBindingInfo::Init(PWSTR pszPath, PWSTR pszClass)
00330 {
00331   //
00332   // Store local versions of the path and class
00333   //
00334   m_szPath = pszPath;
00335   m_szClass = pszClass;
00336
00337   //
00338   // Get the property page initialization parameters from the notify window
00339   //
00340   ADSPROPINITPARAMS InitParams = {0};
00341   InitParams.dwSize = sizeof(ADSPROPINITPARAMS);
00342   if (!ADsPropGetInitInfo(m_hNotifyObj, &InitParams))
00343   {
00344     return E_FAIL;
00345   }
00346
00347   if (FAILED(InitParams.hr))
00348   {
00349     return InitParams.hr;
00350   }
00351
00352   //
00353   // Store local versions of the IDirectoryObject interface pointer
00354   // and the writable attributes
00355   //
00356   m_spDsObj = InitParams.pDsObj;
00357   m_pWritableAttrs = InitParams.pWritableAttrs;
00358
00359   return S_OK;
00360 }
00361
00362 void CSCPUIBindingInfo::SetUIData()
00363 {
00364   //
00365   // Prime the controls with the data from the object
00366   //
00367   LPWSTR ppszAttrNames[] = { _T("serviceBindingInformation") };
00368   PADS_ATTR_INFO pAttrInfo = NULL;
00369   DWORD dwReturned = 0;
00370
00371   //
00372   // Retrieve the data from Active Directory
00373   //
00374   HRESULT hr = m_spDsObj->GetObjectAttributes(ppszAttrNames, 1, &pAttrInfo, &dwReturned);
00375   if (FAILED(hr))
00376   {
00377     AfxMessageBox(_T("Failed to retrieve data for this object."));
00378     return;
00379   }
00380
00381   if (dwReturned < 1)
00382   {
00383     AfxMessageBox(_T("Failed to retrieve data for this object."));
00384     return;
00385   }
00386
00387   ASSERT(pAttrInfo != NULL);
00388
00389   //
00390   // Store the data locally
00391   //
00392   for (DWORD idx = 0; idx < dwReturned; idx++)
00393   {
00394     for (UINT nCount = 0; nCount < pAttrInfo->dwNumValues; nCount++)
00395     {
00396       m_szValueList.AddTail(pAttrInfo->pADsValues[nCount].CaseIgnoreString);
00397     }
00398   }
00399
00400   //
00401   // Free the memory allocated by GetObjectAttributes()
00402   FreeADsMem(pAttrInfo);
00403 }
00404
00405 BOOL CSCPUIBindingInfo::OnApply()
00406 {
00407   if (!m_bDirty)
00408   {
00409     //
00410     // Signal the change notification. Note that the notify-apply
00411     // message must be sent even if the page is not dirty so that
00412     // the notify ref-counting will properly decrement.
00413     //
00414     ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_APPLY, TRUE, 0);
00415
00416     return TRUE;
00417   }
00418
00419   ASSERT(m_spDsObj != NULL);
00420
00421   HRESULT hr = S_OK;
00422   ADS_ATTR_INFO attrInfo[1];
00423   PWSTR rgpwzAttrNames[] = { _T("serviceBindingInformation") };
00424   ADSVALUE* pValue = new ADSVALUE[m_szValueList.GetCount()];
00425   ASSERT(pValue != NULL);
00426   if (pValue == NULL)
00427     return FALSE;
00428
00429   //
00430   // Set the update values for adminDescription
00431   //
00432   attrInfo[0].dwADsType = ADSTYPE_CASE_IGNORE_STRING;
00433   attrInfo[0].pszAttrName = rgpwzAttrNames[0];
00434
00435   POSITION pos = m_szValueList.GetHeadPosition();
00436   for (int idx = 0; idx < m_szValueList.GetCount(); idx++)
00437   {
00438     CString szValue = m_szValueList.GetNext(pos);
00439     pValue[idx].dwType = ADSTYPE_CASE_IGNORE_STRING;
00440     pValue[idx].CaseIgnoreString = (LPWSTR)(LPCWSTR)szValue;
00441
00442     if (pos == NULL)
00443     {
00444       break;
00445     }
00446   }
00447
00448   attrInfo[0].pADsValues = pValue;
00449   attrInfo[0].dwNumValues = m_szValueList.GetCount();
00450   attrInfo[0].dwControlCode = ADS_ATTR_UPDATE;
00451
00452   //
00453   // Update the data in Active Directory
00454   //
00455   DWORD dwReturned = 0;
00456   hr = m_spDsObj->SetObjectAttributes(attrInfo, 1, &dwReturned);
00457   if (FAILED(hr))
00458   {
00459     delete[] pValue;
00460     AfxMessageBox(_T("Failed to set values for object."));
00461     return FALSE;
00462   }
00463   //
00464   // Free the memory used to set the values
00465   //
00466   delete[] pValue;
00467
00468   if (dwReturned < 1)
00469   {
00470     AfxMessageBox(_T("Failed to set values for object."));
00471     return FALSE;
00472   }
00473   //
00474   // Signal the change notification. Note that the notify-apply
00475   // message must be sent even if the page is not dirty so that
00476   // the notify ref-counting will properly decrement.
00477   //
00478   ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_APPLY, TRUE, 0);
00479
00480   return TRUE;
00481 }
00482
00483 void CSCPUIBindingInfo::OnPropertyChange()
00484 {
00485   m_bDirty = TRUE;
00486
00487   //
00488   // Enable the apply button
00489   //
00490   SetModified(TRUE);
00491 }
00492
00493 void CSCPUIBindingInfo::OnDestroy()
00494 {
00495   CPropertyPage::OnDestroy();
00496
00497   //
00498   // Tell the notification object to shut down
00499   //
00500   ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_EXIT, 0, 0);
00501
00502   delete this;
00503 }
00504
00505
00506 //
00507 // Keywords Page
00508 //
00509
00510 BEGIN_MESSAGE_MAP(CSCPUIKeywords, CPropertyPage)
00511   ON_BN_CLICKED(IDC_ADD_BUTTON, OnPropertyChange)
00512   ON_BN_CLICKED(IDC_DELETE_BUTTON, OnPropertyChange)
00513   ON_WM_DESTROY()
00514 END_MESSAGE_MAP()
00515
00516 IMPLEMENT_DYNCREATE(CSCPUIKeywords, CPropertyPage)
00517
00518 BOOL CSCPUIKeywords::OnInitDialog()
00519 {
00520   BOOL bRes = CPropertyPage::OnInitDialog();
00521
00522   //
00523   // Verify that this page is only coming up for users
00524   //
00525   ASSERT(m_szClass == _T("serviceConnectionPoint"));
00526
00527   //
00528   // Display data in UI
00529   //
00530   SetUIData();
00531
00532   //
00533   // Create and initialize the multi-valued attribute editor
00534   //
00535   m_pAttributeEditor = new CMultiValuedAttributeEditor(m_szValueList);
00536   m_pAttributeEditor->Initialize(IDC_KEYWORD_EDIT,
00537                                   IDC_KEYWORD_LIST,
00538                                   IDC_ADD_BUTTON,
00539                                   IDC_DELETE_BUTTON,
00540                                   this);
00541
00542   //
00543   // The page may have been marked dirty due to the SetWindowText() in SetUIData(),
00544   // so clear the dirty flag.
00545   //
00546   m_bDirty = FALSE;
00547   return bRes;
00548 }
00549
00550 HRESULT CSCPUIKeywords::Init(PWSTR pszPath, PWSTR pszClass)
00551 {
00552   //
00553   // Store local versions of the path and class
00554   //
00555   m_szPath = pszPath;
00556   m_szClass = pszClass;
00557
00558   //
00559   // Get the property page initialization parameters from the notify window
00560   //
00561   ADSPROPINITPARAMS InitParams = {0};
00562   InitParams.dwSize = sizeof(ADSPROPINITPARAMS);
00563   if (!ADsPropGetInitInfo(m_hNotifyObj, &InitParams))
00564   {
00565     return E_FAIL;
00566   }
00567
00568   if (FAILED(InitParams.hr))
00569   {
00570     return InitParams.hr;
00571   }
00572
00573   //
00574   // Store local versions of the IDirectoryObject interface pointer
00575   // and the writable attributes
00576   //
00577   m_spDsObj = InitParams.pDsObj;
00578   m_pWritableAttrs = InitParams.pWritableAttrs;
00579
00580   return S_OK;
00581 }
00582
00583 void CSCPUIKeywords::SetUIData()
00584 {
00585   //
00586   // Prime the controls with the data from the object
00587   //
00588   LPWSTR ppszAttrNames[] = {  _T("keywords") };
00589   PADS_ATTR_INFO pAttrInfo = NULL;
00590   DWORD dwReturned = 0;
00591
00592   //
00593   // Retrieve the data from Active Directory
00594   //
00595   HRESULT hr = m_spDsObj->GetObjectAttributes(ppszAttrNames, 1, &pAttrInfo, &dwReturned);
00596   if (FAILED(hr))
00597   {
00598     AfxMessageBox(_T("Failed to retrieve data for this object."));
00599     return;
00600   }
00601
00602   if (dwReturned < 1)
00603   {
00604     AfxMessageBox(_T("Failed to retrieve data for this object."));
00605     return;
00606   }
00607
00608   ASSERT(pAttrInfo != NULL);
00609
00610   //
00611   // Store the data locally
00612   //
00613   for (DWORD idx = 0; idx < dwReturned; idx++)
00614   {
00615     for (UINT nCount = 0; nCount < pAttrInfo->dwNumValues; nCount++)
00616     {
00617       m_szValueList.AddTail(pAttrInfo->pADsValues[nCount].CaseIgnoreString);
00618     }
00619   }
00620
00621   //
00622   // Free the memory allocated by GetObjectAttributes()
00623   //
00624   FreeADsMem(pAttrInfo);
00625 }
00626
00627 BOOL CSCPUIKeywords::OnApply()
00628 {
00629   if (!m_bDirty)
00630   {
00631     //
00632     // Signal the change notification. Note that the notify-apply
00633     // message must be sent even if the page is not dirty so that
00634     // the notify ref-counting will properly decrement.
00635     //
00636     ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_APPLY, TRUE, 0);
00637
00638     return TRUE;
00639   }
00640
00641   ASSERT(m_spDsObj != NULL);
00642
00643   HRESULT hr = S_OK;
00644   ADS_ATTR_INFO attrInfo[1];
00645   PWSTR rgpwzAttrNames[] = { _T("keywords") };
00646   ADSVALUE* pValue = new ADSVALUE[m_szValueList.GetCount()];
00647   ASSERT(pValue != NULL);
00648   if (pValue == NULL)
00649     return FALSE;
00650
00651   //
00652   // Set the update values for adminDescription
00653   //
00654   attrInfo[0].dwADsType = ADSTYPE_CASE_IGNORE_STRING;
00655   attrInfo[0].pszAttrName = rgpwzAttrNames[0];
00656
00657   POSITION pos = m_szValueList.GetHeadPosition();
00658   for (int idx = 0; idx < m_szValueList.GetCount(); idx++)
00659   {
00660     CString szValue = m_szValueList.GetNext(pos);
00661     pValue[idx].dwType = ADSTYPE_CASE_IGNORE_STRING;
00662     pValue[idx].CaseIgnoreString = (LPWSTR)(LPCWSTR)szValue;
00663
00664     if (pos == NULL)
00665     {
00666       break;
00667     }
00668   }
00669
00670   attrInfo[0].pADsValues = pValue;
00671   attrInfo[0].dwNumValues = m_szValueList.GetCount();
00672   attrInfo[0].dwControlCode = ADS_ATTR_UPDATE;
00673
00674   //
00675   // Update the data in Active Directory
00676   //
00677   DWORD dwReturned = 0;
00678   hr = m_spDsObj->SetObjectAttributes(attrInfo, 1, &dwReturned);
00679   if (FAILED(hr))
00680   {
00681     delete[] pValue;
00682     AfxMessageBox(_T("Failed to set values for object."));
00683     return FALSE;
00684   }
00685   //
00686   // Free the memory used for SetObjectAttributes()
00687   //
00688   delete[] pValue;
00689
00690   if (dwReturned < 1)
00691   {
00692     AfxMessageBox(_T("Failed to set values for object."));
00693     return FALSE;
00694   }
00695
00696
00697   //
00698   // Signal the change notification. Note that the notify-apply
00699   // message must be sent even if the page is not dirty so that
00700   // the notify ref-counting will properly decrement.
00701   //
00702   ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_APPLY, TRUE, 0);
00703
00704   return TRUE;
00705 }
00706
00707 void CSCPUIKeywords::OnPropertyChange()
00708 {
00709   m_bDirty = TRUE;
00710
00711   //
00712   // Enable the apply button
00713   //
00714   SetModified(TRUE);
00715 }
00716
00717 void CSCPUIKeywords::OnDestroy()
00718 {
00719   CPropertyPage::OnDestroy();
00720
00721   //
00722   // Tell the notification object to shut down
00723   //
00724   ::SendMessage(m_hNotifyObj, WM_ADSPROP_NOTIFY_EXIT, 0, 0);
00725
00726   delete this;
00727 }
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBitArray Member List

This is the complete list of members for CBitArray, including all inherited members.
ArrayEmpty(void) | CBitArray |
CBitArray(void) | CBitArray |
FindSet(ULONG islotStart, ULONG islotLimit, ULONG *pislot) | CBitArray |
FInit(ULONG cslotMax, ULONG cbPage) | CBitArray |
IsSlotSet(ULONG islot) | CBitArray |
m_cbPage | CBitArray | [private]
m_cPageCurrent | CBitArray | [private]
m_cPageMax | CBitArray | [private]
m_cslotCurrent | CBitArray | [private]
m_rgbBit | CBitArray | [private]
m_rgbBitMask | CBitArray | [private]
ResetSlots(ULONG islotFirst, ULONG islotLast) | CBitArray |
SetSlots(ULONG islotFirst, ULONG islotLast) | CBitArray |
~CBitArray(void) | CBitArray |
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CResourceSub Member List

This is the complete list of members for CResourceSub, including all inherited members.
CResourceSub(CComSpy *pSpy) | CResourceSub | [inline]
CResourceSub() | CResourceSub | [inline]
CSysLCESub() | CSysLCESub | [inline]
GetEventClass(LPGUID guid) | CResourceSub | [inline, virtual]
GetEventType(EventEnum *e) | CResourceSub | [inline, virtual]
GetInterface(IID *iid) | CResourceSub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
OnResourceAllocate(COMSVCSEVENTINFO *pInfo, ULONG64 ObjectID, LPCOLESTR pszType, ULONG64 resId, BOOL enlisted, DWORD NumRated, DWORD Rating) | CResourceSub |
OnResourceCreate(COMSVCSEVENTINFO *pInfo, ULONG64 ObjectID, LPCOLESTR pszType, ULONG64 resId, BOOL enlisted) | CResourceSub |
OnResourceDestroy(COMSVCSEVENTINFO *pInfo, ULONG64 ObjectID, HRESULT hr, LPCOLESTR pszType, ULONG64 resId) | CResourceSub |
OnResourceRecycle(COMSVCSEVENTINFO *pInfo, ULONG64 ObjectID, LPCOLESTR pszType, ULONG64 resId) | CResourceSub |
OnResourceTrack(COMSVCSEVENTINFO *pInfo, ULONG64 ObjectID, LPCOLESTR pszType, ULONG64 resId, BOOL enlisted) | CResourceSub |
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:57:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/CConnectionPT.h Source File

  • Com
  • async
  • server

CConnectionPT.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #if !defined(__CCONNECTIONPOINT__)
00018 #define __CCONNECTIONPOINT__
00019
00020 #include <objidl.h>
00021 #include <ocidl.h>
00022
00023 typedef struct EventID {
00024   DWORD cEventID;
00025   const IID*  EventIDs;
00026 } *LPEVENTID;
00027
00028 class CConnectionPoint;
00029
00030 class CConnectionPointContainer : public IConnectionPointContainer
00031 {
00032 protected:
00033   CConnectionPointContainer();
00034   virtual ~CConnectionPointContainer();
00035 private:
00036   // IConnectionPointContainer
00037   virtual HRESULT __stdcall EnumConnectionPoints(LPENUMCONNECTIONPOINTS *ppenum);
00038   virtual HRESULT __stdcall FindConnectionPoint(REFIID id, LPCONNECTIONPOINT *ppCP);
00039
00040 public:
00041   CConnectionPoint* __stdcall GetConnectionPoint(REFIID iid);
00042   bool __stdcall Init(EventID& events);
00043 private:
00044   // state variables
00045   DWORD m_cookie;
00046   DWORD m_cCP;
00047   CConnectionPoint** m_prgCP;
00048   IID* m_prgEventIID;
00049 };
00050
00051 class CConnectionPoint : public IConnectionPoint
00052 {
00053 public:
00054   CConnectionPoint(CConnectionPointContainer *pCPC, IID iid);
00055   virtual ~CConnectionPoint();
00056
00057
00058   // IUnknown
00059   virtual HRESULT __stdcall QueryInterface(REFIID iid, PVOID *ppv);
00060     virtual ULONG __stdcall AddRef();
00061   virtual ULONG __stdcall Release();
00062   virtual void __stdcall FinalRelease();
00063
00064 private:
00065   virtual HRESULT __stdcall GetConnectionInterface(IID *pIID);
00066   virtual HRESULT __stdcall GetConnectionPointContainer(LPCONNECTIONPOINTCONTAINER *ppCPC);
00067   virtual HRESULT __stdcall Advise(LPUNKNOWN lpUnk, LPDWORD pdwCookie);
00068   virtual HRESULT __stdcall Unadvise(DWORD dwCookie);
00069   virtual HRESULT __stdcall EnumConnections(LPENUMCONNECTIONS *ppenum);
00070
00071 public:
00072   bool __stdcall SignalEvent(DISPID dispid, DISPPARAMS *params);
00073   bool __stdcall SignalEvent();
00074 private:
00075   // state variables
00076   ULONG  m_cRef;
00077   DWORD  m_cookie;
00078   IID m_iid;
00079   const DWORD m_Adviselimit;
00080 /*
00081  * hackhack: I currently only let two sinks attach to this connectionpoint.
00082  * I need to set up some type of list to hold an arbritary # of sinks
00083  */
00084
00085 //  LPDISPATCH m_lpEventSink[2];
00086   AppEvents* m_lpEventSink[2]; //hackhack
00087
00088   CConnectionPointContainer* m_pCPC;
00089 };
00090 #endif // __CCONNECTIONPOINT__
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/PersistSubs/Persistatl/INewsEventDefault.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • PersistSubs
  • Persistatl

INewsEventDefault.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc2.tmp" /nologo /d "D:\ComPlusSamples\Source\LCE\PersistSubs" "D:\ComPlusSamples\Source\LCE\PersistSubs\PersistATL.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package persistatl;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface INewsEventDefault
00019 /** @com.interface(iid=00020400-0000-0000-C000-000000000046, thread=AUTO, type=DUAL) */
00020 public interface INewsEventDefault extends persistatl.INewsEvent
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=METHOD, name="NewsFlash", addFlagsVtable=4)
00023       @com.parameters([in,type=DATE] dtTimeStamp, [in,type=STRING] Symbol, [in,type=STRING] Headline, [in,type=STRING] URL) */
00024   public void NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=METHOD, name="ShortQuote", addFlagsVtable=4)
00027       @com.parameters([in,type=STRING] Symbol, [in,type=R8] BidPrice, [in,type=R8] AskPrice, [in,type=DATE] LastTradeTime, [in,type=R8] LastTradePrice, [in,type=R8] NetChange, [in,type=R8] DailyHigh, [in,type=R8] DailyLow) */
00028   public void ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LongQuote", addFlagsVtable=4)
00031       @com.parameters([in,type=STRING] Symbol, [in,type=R8] BidPrice, [in,type=R8] AskPrice, [in,type=STRING] LastTradeTime, [in,type=R8] LastTradePrice, [in,type=R8] NetChange, [in,type=R8] DailyHigh, [in,type=R8] DailyLow, [in,type=I4] AskSize, [in,type=I4] BidSize, [in,type=R8] OpenPrice, [in,type=R8] ClosePrice, [in,type=STRING] CloseDate) */
00032   public void LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate);
00033
00034
00035   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x20400, (short)0x0, (short)0x0, (byte)0xc0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x46);
00036 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IAS/MapName/multisz.h Source File

  • NetDS
  • IAS
  • MapName

multisz.h

Go to the documentation of this file.
00001 /* Copyright (c) Microsoft Corporation. All rights reserved. */
00002
00003 #ifndef MULTISZ_H
00004 #define MULTISZ_H
00005 #pragma once
00006
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010
00011 /* Struct representing a REG_MULTI_SZ data type. 'nChar' is the length in
00012  * characters including the two trailing nulls. */
00013 typedef struct tagMULTI_SZ
00014 {
00015    wchar_t* pwszValue;
00016    DWORD nChar;
00017 } MULTI_SZ, *PMULTI_SZ;
00018
00019 /* Initialize an empty MULTI_SZ. */
00020 VOID
00021 WINAPI
00022 MultiSzInit(
00023     PMULTI_SZ pMultiSz
00024     );
00025
00026 /* Free any memory associated with a MULTI_SZ. */
00027 VOID
00028 WINAPI
00029 MultiSzFree(
00030     PMULTI_SZ pMultiSz
00031     );
00032
00033 /* Append a string to a MULTI_SZ. */
00034 LONG
00035 WINAPI
00036 MultiSzAppend(
00037     PMULTI_SZ pMultiSz,
00038     LPCWSTR pwszString
00039     );
00040
00041 /* Erase a string from within a MULTI_SZ. */
00042 VOID
00043 WINAPI
00044 MultiSzErase(
00045     PMULTI_SZ pMultiSz,
00046     LPWSTR pwszString
00047     );
00048
00049 /* Find a string within a MULTI_SZ. Returns NULL if the string isn't found. */
00050 LPWSTR
00051 WINAPI
00052 MultiSzFind(
00053     PMULTI_SZ pMultiSz,
00054     LPCWSTR pwszString
00055     );
00056
00057 /* Read a MULTI_SZ from the registry. */
00058 LONG
00059 WINAPI
00060 MultiSzQuery(
00061     PMULTI_SZ pMultiSz,
00062     HKEY hKey,
00063     LPCWSTR pwszValueName
00064     );
00065
00066 /* Write a MULTI_SZ to the registry. */
00067 LONG
00068 WINAPI
00069 MultiSzSet(
00070     PMULTI_SZ pMultiSz,
00071     HKEY hKey,
00072     LPCWSTR pwszValueName
00073     );
00074
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078 #endif /* MULTISZ_H */
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/usrdef/Usrdefc.c Source File

  • NetDS
  • RPC
  • Handles
  • usrdef

Usrdefc.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                         usrdef Example
00005
00006     FILE:       usrdefc.c
00007
00008     USAGE:      usrdefc  -n network_address
00009                          -p protocol_sequence
00010                          -e endpoint
00011                          -o options
00012
00013     PURPOSE:    Client side of RPC distributed application
00014
00015     FUNCTIONS:  main() - binds to server and calls remote procedure
00016
00017     COMMENTS:   This distributed application uses a user-defined handle.
00018
00019 ****************************************************************************/
00020
00021 #include <stdlib.h>
00022 #include <stdio.h>
00023 #include <ctype.h>
00024 #include "usrdef.h"    // header file generated by MIDL compiler
00025
00026 void Usage(char * pszProgramName)
00027 {
00028     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00029     fprintf(stderr, " -p protocol_sequence\n");
00030     fprintf(stderr, " -n network_address\n");
00031     fprintf(stderr, " -e endpoint\n");
00032     fprintf(stderr, " -o options\n");
00033     fprintf(stderr, " -s string\n");
00034     exit(1);
00035 }
00036
00037 void __cdecl main(int argc, char **argv)
00038 {
00039     int i;
00040     DATA_HANDLE_TYPE dhBinding;
00041     unsigned char * pszString = "hello, world";
00042
00043     dhBinding = (DATA_HANDLE_TYPE) midl_user_allocate(sizeof(DATA_TYPE));
00044     dhBinding->pszProtocolSequence = "ncacn_np";
00045     dhBinding->pszUuid             = NULL;
00046     dhBinding->pszEndpoint         = "\\pipe\\usrdef";
00047     dhBinding->pszNetworkAddress   = NULL;
00048     dhBinding->pszOptions          = NULL;
00049
00050     /* allow the user to override settings with command line switches */
00051     for (i = 1; i < argc; i++) {
00052         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00053             switch (tolower(*(argv[i]+1))) {
00054             case 'p':  // protocol sequence
00055                 dhBinding->pszProtocolSequence = argv[++i];
00056                 break;
00057             case 'n':  // network address
00058                 dhBinding->pszNetworkAddress = argv[++i];
00059                 break;
00060             case 'e':
00061                 dhBinding->pszEndpoint = argv[++i];
00062                 break;
00063             case 'o':
00064                 dhBinding->pszOptions = argv[++i];
00065                 break;
00066             case 's':
00067                 pszString = argv[++i];
00068                 break;
00069             case 'h':
00070             case '?':
00071             default:
00072                 Usage(argv[0]);
00073             }
00074         }
00075         else
00076             Usage(argv[0]);
00077     }
00078
00079     printf("Calling the remote procedure 'UsrdefProc'\n");
00080     UsrdefProc(dhBinding, pszString);  // call the remote procedure
00081
00082     printf("Calling the remote procedure 'Shutdown'\n");
00083     Shutdown(dhBinding);  // shut down the server side
00084
00085     exit(0);
00086
00087 }  // end main()
00088
00089 /* This _bind routine is called by the client stub immediately */
00090 /* before each remote procedure call.                          */
00091 RPC_BINDING_HANDLE __RPC_USER DATA_HANDLE_TYPE_bind(DATA_HANDLE_TYPE dh1)
00092 {
00093     RPC_STATUS status;    // returned by RPC API functions
00094     RPC_BINDING_HANDLE hBinding;
00095     unsigned char * pszStringBinding;
00096
00097     printf("Within DATA_HANDLE_TYPE_bind function:\n");
00098     status = RpcStringBindingCompose(dh1->pszUuid,
00099                                      dh1->pszProtocolSequence,
00100                                      dh1->pszNetworkAddress,
00101                                      dh1->pszEndpoint,
00102                                      dh1->pszOptions,
00103                                      &pszStringBinding);
00104     printf("RpcStringBindingCompose returned 0x%x\n", status);
00105     printf("pszStringBinding = %s\n", pszStringBinding);
00106     if (status) {
00107         exit(status);
00108     }
00109
00110     status = RpcBindingFromStringBinding(pszStringBinding,
00111                                          &hBinding);
00112     printf("RpcBindingFromStringBinding returned 0x%x\n", status);
00113     if (status) {
00114         exit(status);
00115     }
00116
00117     status = RpcStringFree(&pszStringBinding);  // unbind
00118     printf("RpcStringFree returned 0x%x\n", status);
00119     if (status) {
00120         exit(status);
00121     }
00122
00123     return(hBinding);
00124 }
00125
00126 /* This _unbind routine is called by the client stub immediately */
00127 /* after each remote procedure call.                             */
00128 void __RPC_USER DATA_HANDLE_TYPE_unbind(DATA_HANDLE_TYPE dh1,
00129                                        RPC_BINDING_HANDLE h1)
00130 {
00131      RPC_STATUS status;    // returned by RPC API functions
00132
00133      printf("Within DATA_HANDLE_TYPE_unbind function:\n");
00134      printf("Unbinding handle for %s\n", dh1->pszEndpoint);
00135
00136      status = RpcBindingFree(&h1);  // unbind
00137      printf("RpcBindingFree returned 0x%x\n", status);
00138 }
00139
00140 /*********************************************************************/
00141 /*                 MIDL allocate and free                            */
00142 /*********************************************************************/
00143
00144 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00145 {
00146     return(malloc(len));
00147 }
00148
00149 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00150 {
00151     free(ptr);
00152 }
00153
00154 /* end file usrdefc.c */
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/basesnap.Cpp Source File

  • SysMgmt
  • MMC
  • CMenu

basesnap.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <olectl.h>
00021 #include <initguid.h>
00022 #include "guids.h"
00023 #include "basesnap.h"
00024 #include "Comp.h"
00025 #include "CompData.h"
00026 #include "About.h"
00027 #include "Registry.h"
00028
00029 // our globals
00030 HINSTANCE g_hinst;
00031
00032 BOOL WINAPI DllMain(HINSTANCE hinstDLL,
00033                     DWORD fdwReason,
00034                     void* lpvReserved)
00035 {
00036
00037     if (fdwReason == DLL_PROCESS_ATTACH) {
00038         g_hinst = hinstDLL;
00039     }
00040
00041     return TRUE;
00042 }
00043
00044
00045 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
00046 {
00047     if ((rclsid != CLSID_CComponentData) && (rclsid != CLSID_CSnapinAbout))
00048         return CLASS_E_CLASSNOTAVAILABLE;
00049
00050
00051     if (!ppvObj)
00052         return E_FAIL;
00053
00054     *ppvObj = NULL;
00055
00056     // We can only hand out IUnknown and IClassFactory pointers.  Fail
00057     // if they ask for anything else.
00058     if (!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00059         return E_NOINTERFACE;
00060
00061     CClassFactory *pFactory = NULL;
00062
00063     // make the factory passing in the creation function for the type of object they want
00064     if (rclsid == CLSID_CComponentData)
00065         pFactory = new CClassFactory(CClassFactory::COMPONENT);
00066     else if (rclsid == CLSID_CSnapinAbout)
00067         pFactory = new CClassFactory(CClassFactory::ABOUT);
00068
00069     if (NULL == pFactory)
00070         return E_OUTOFMEMORY;
00071
00072     HRESULT hr = pFactory->QueryInterface(riid, ppvObj);
00073
00074     return hr;
00075 }
00076
00077 STDAPI DllCanUnloadNow(void)
00078 {
00079     if (g_uObjects == 0 && g_uSrvLock == 0)
00080         return S_OK;
00081     else
00082         return S_FALSE;
00083 }
00084
00085
00086 CClassFactory::CClassFactory(FACTORY_TYPE factoryType)
00087 : m_cref(0), m_factoryType(factoryType)
00088 {
00089     OBJECT_CREATED
00090 }
00091
00092 CClassFactory::~CClassFactory()
00093 {
00094     OBJECT_DESTROYED
00095 }
00096
00097 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv)
00098 {
00099     if (!ppv)
00100         return E_FAIL;
00101
00102     *ppv = NULL;
00103
00104     if (IsEqualIID(riid, IID_IUnknown))
00105         *ppv = static_cast<IClassFactory *>(this);
00106     else
00107         if (IsEqualIID(riid, IID_IClassFactory))
00108             *ppv = static_cast<IClassFactory *>(this);
00109
00110         if (*ppv)
00111         {
00112             reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00113             return S_OK;
00114         }
00115
00116         return E_NOINTERFACE;
00117 }
00118
00119 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00120 {
00121     return InterlockedIncrement((LONG *)&m_cref);
00122 }
00123
00124 STDMETHODIMP_(ULONG) CClassFactory::Release()
00125 {
00126     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00127     {
00128         delete this;
00129         return 0;
00130     }
00131     return m_cref;
00132 }
00133
00134 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj)
00135 {
00136     HRESULT  hr;
00137     void* pObj;
00138
00139     if (!ppvObj)
00140         return E_FAIL;
00141
00142     *ppvObj = NULL;
00143
00144     // Our object does does not support aggregation, so we need to
00145     // fail if they ask us to do aggregation.
00146     if (pUnkOuter)
00147         return CLASS_E_NOAGGREGATION;
00148
00149     if (COMPONENT == m_factoryType) {
00150         pObj = new CComponentData();
00151     } else {
00152         pObj = new CSnapinAbout();
00153     }
00154
00155     if (!pObj)
00156         return E_OUTOFMEMORY;
00157
00158     // QueryInterface will do the AddRef() for us, so we do not
00159     // do it in this function
00160     hr = ((LPUNKNOWN)pObj)->QueryInterface(riid, ppvObj);
00161
00162     if (FAILED(hr))
00163         delete pObj;
00164
00165     return hr;
00166 }
00167
00168 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00169 {
00170     if (fLock)
00171         InterlockedIncrement((LONG *)&g_uSrvLock);
00172     else
00173         InterlockedDecrement((LONG *)&g_uSrvLock);
00174
00175     return S_OK;
00176 }
00177
00178 //////////////////////////////////////////////////////////
00179 //
00180 // Exported functions
00181 //
00182
00183
00184 //
00185 // Server registration
00186 //
00187 STDAPI DllRegisterServer()
00188 {
00189     HRESULT hr = SELFREG_E_CLASS;
00190     _TCHAR szName[256];
00191     _TCHAR szSnapInName[256];
00192
00193     LoadString(g_hinst, IDS_NAME, szName, (sizeof szName)/(sizeof szName[0]));
00194     LoadString(g_hinst, IDS_SNAPINNAME, szSnapInName, (sizeof szSnapInName)/(sizeof szSnapInName[0]));
00195
00196     _TCHAR szAboutName[256];
00197
00198     LoadString(g_hinst, IDS_ABOUTNAME, szAboutName, (sizeof szAboutName)/(sizeof szAboutName[0]));
00199
00200     // register our CoClasses
00201     hr = RegisterServer(g_hinst,
00202         CLSID_CComponentData,
00203         szName);
00204
00205     if SUCCEEDED(hr)
00206         hr = RegisterServer(g_hinst,
00207         CLSID_CSnapinAbout,
00208         szAboutName);
00209
00210     // place the registry information for SnapIns
00211     if SUCCEEDED(hr)
00212         hr = RegisterSnapin(CLSID_CComponentData, szSnapInName, CLSID_CSnapinAbout, FALSE);
00213
00214     return hr;
00215 }
00216
00217
00218 STDAPI DllUnregisterServer()
00219 {
00220     if (UnregisterServer(CLSID_CComponentData) == S_OK)
00221         return UnregisterSnapin(CLSID_CComponentData);
00222     else
00223         return E_FAIL;
00224 }
00225
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/remove.dll/Remove.cpp Source File

  • SysMgmt
  • Msi
  • remove.dll

Remove.cpp

Go to the documentation of this file.
00001 #if 0  // makefile definitions
00002 DESCRIPTION = RemoveUserAccount from Local Machine
00003 MODULENAME = remove
00004 FILEVERSION = Msi
00005 ENTRY = RemoveUserAccount
00006 UNICODE=1
00007 LINKLIBS = netapi32.lib
00008 !include "..\TOOLS\MsiTool.mak"
00009 !if 0  #nmake skips the rest of this file
00010 #endif // end of makefile definitions
00011
00012 // Required headers
00013 #define WINDOWS_LEAN_AND_MEAN  // faster compile
00014 #include <windows.h>
00015 #ifndef RC_INVOKED    // start of source code
00016
00017 #include "msiquery.h"
00018 #include "msidefs.h"
00019 #include <windows.h>
00020 #include <basetsd.h>
00021 #include <lm.h>
00022
00023 #define UNICODE 1
00024
00025 //+-------------------------------------------------------------------------
00026 //
00027 //  Microsoft Windows
00028 //
00029 //  Copyright (C) Microsoft Corporation, all rights reserved.
00030 //
00031 //  File: remove.cpp
00032 //
00033 //  Notes: DLL custom action, must be used in conjunction with the DLL
00034 //         custom actions included in process.cpp and create.cpp
00035 //--------------------------------------------------------------------------
00036
00037 //-----------------------------------------------------------------------------------------
00038 //
00039 // BUILD Instructions
00040 //
00041 // notes:
00042 //  - SDK represents the full path to the install location of the
00043 //     Windows Installer SDK
00044 //
00045 // Using NMake:
00046 //      %vcbin%\nmake -f remove.cpp include="%include;SDK\Include" lib="%lib%;SDK\Lib"
00047 //
00048 // Using MsDev:
00049 //      1. Create a new Win32 DLL project
00050 //      2. Add remove.cpp to the project
00051 //      3. Add SDK\Include and SDK\Lib directories on the Tools\Options Directories tab
00052 //      4. Add msi.lib and netapi32.lib to the library list in the Project Settings dialog
00053 //          (in addition to the standard libs included by MsDev)
00054 //      5. Add /DUNICODE to the project options in the Project Settings dialog
00055 //
00056 //------------------------------------------------------------------------------------------
00057
00058 //////////////////////////////////////////////////////////////////////////////
00059 // RemoveUserAccount
00060 //
00061 //     Attempts to remove a user account on the local machine according
00062 //       to the "instructions" provided in the CustomActionData property
00063 //
00064 //     As a deferred custom action, you do not have access to the database.
00065 //       The only source of information comes from a property that an immediate
00066 //       custom action can set to provide the information you need.  This
00067 //       property is written into the script
00068 //
00069 UINT __stdcall RemoveUserAccount(MSIHANDLE hInstall)
00070 {
00071   // determine mode in which we are called
00072   BOOL bRollback = MsiGetMode(hInstall, MSIRUNMODE_ROLLBACK); // true for rollback, else regular deferred version (for uninstall)
00073
00074   BOOL fSuccess = FALSE;
00075
00076   // id's for error and warning messages
00077   const int iRemoveError = 25003;
00078   const int iRemoveWarning = 25004;
00079
00080   // Grab the CustomActionData property
00081   DWORD cchCAData = 0;
00082
00083   if (ERROR_MORE_DATA == MsiGetPropertyW(hInstall, IPROPNAME_CUSTOMACTIONDATA, L"", &cchCAData))
00084   {
00085     WCHAR* wszCAData = new WCHAR[++cchCAData]; // add 1 for null-terminator which is not included in size on return
00086     if (wszCAData)
00087     {
00088       if (ERROR_SUCCESS == MsiGetPropertyW(hInstall, IPROPNAME_CUSTOMACTIONDATA, wszCAData, &cchCAData))
00089       {
00090         // send ActionData message (template in ActionText table)
00091         // send ActionData message (template in ActionText table)
00092         PMSIHANDLE hRec = MsiCreateRecord(1);
00093         if (!hRec
00094           || ERROR_SUCCESS != MsiRecordSetStringW(hRec, 1, wszCAData))
00095         {
00096           delete [] wszCAData;
00097           return ERROR_INSTALL_FAILURE;
00098         }
00099
00100         int iRet = MsiProcessMessage(hInstall, INSTALLMESSAGE_ACTIONDATA, hRec);
00101         if (IDCANCEL == iRet || IDABORT == iRet)
00102         {
00103           delete [] wszCAData;
00104           return ERROR_INSTALL_USEREXIT;
00105         }
00106
00107         //
00108         // Call the NetUserDel function,
00109         //
00110         NET_API_STATUS nStatus = NetUserDel(NULL /*local machine*/, wszCAData /*user name*/);
00111
00112         if (NERR_Success != nStatus)
00113         {
00114           PMSIHANDLE hRecErr = MsiCreateRecord(3);
00115           if ( !hRecErr
00116             || ERROR_SUCCESS != MsiRecordSetStringW(hRecErr, 2, wszCAData))
00117           {
00118             delete [] wszCAData;
00119             return ERROR_INSTALL_FAILURE;
00120           }
00121
00122           // In rollback mode, NERR_UserNotFound means cancel button depressed in middle of deferred CA trying to create this account
00123           if (bRollback && NERR_UserNotFound == nStatus)
00124           {
00125             fSuccess = TRUE;
00126           }
00127           else if (NERR_UserNotFound == nStatus)
00128           {
00129             // treat this as a warning, but success since we are attempting to delete and it is not present
00130             if (ERROR_SUCCESS != MsiRecordSetInteger(hRecErr, 1, iRemoveWarning))
00131             {
00132               delete [] wszCAData;
00133               return ERROR_INSTALL_FAILURE;
00134             }
00135
00136             // just pop up an OK button
00137             // OPTIONALLY, could specify multiple buttons and cancel
00138             // install based on user selection by handling the return value
00139             // from MsiProcessMessage, but here we are ignoring the MsiProcessMessage return
00140             MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_WARNING|MB_ICONWARNING|MB_OK), hRecErr);
00141             fSuccess = TRUE;
00142           }
00143           else
00144           {
00145             if (ERROR_SUCCESS == MsiRecordSetInteger(hRecErr, 1, iRemoveError)
00146               && ERROR_SUCCESS == MsiRecordSetInteger(hRecErr, 3, nStatus))
00147             {
00148               // returning failure anyway, so ignoring MsiProcessMessage return
00149               MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecErr);
00150             }
00151           }
00152         }
00153         else // NERR_Success
00154         {
00155           fSuccess = TRUE;
00156         }
00157       }
00158
00159       delete [] wszCAData;
00160     }
00161   }
00162
00163   return fSuccess ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
00164 }
00165
00166
00167 #else // RC_INVOKED, end of source code, start of resources
00168 // resource definition go here
00169
00170 #endif // RC_INVOKED
00171 #if 0
00172 !endif // makefile terminator
00173 #endif
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/registry.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

registry.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include <ObjBase.h>
00016 #include "Registry.h"
00017 #include "Globals.h"
00018
00019
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("Registry")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Internal helper functions prototypes
00027
00028
00029 // Set the given key and its value.
00030 HRESULT SetKeyAndValue( const TCHAR* pszPath, const TCHAR* szSubkey, const TCHAR* szValue);
00031
00032 // Set the given key and its value in the MMC Snapin location
00033 HRESULT SetSnapInKeyAndValue( const TCHAR* szKey, const TCHAR* szSubkey, const TCHAR* szName, const TCHAR* szValue );
00034
00035 // Set the given valuename under the key to value
00036 HRESULT SetValue( const TCHAR* szKey, const TCHAR* szValueName, const TCHAR* szValue);
00037
00038 // Delete szKeyChild and all of its descendents.
00039 HRESULT RecursiveDeleteKey( HKEY hKeyParent, const TCHAR* szKeyChild );
00040
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // Public function implementation
00044
00045
00046 //---------------------------------------------------------------------------
00047 //  Register the component in the registry.  This is the minimalist way
00048 //  to register a component, you may want to add keys for ProgID.
00049 //
00050 HRESULT RegisterServer
00051 (
00052   HMODULE        hModule,          //[in] DLL module handle
00053   const CLSID&   clsid,            //[in] Class ID
00054   const TCHAR*   szFriendlyName    //[in] Name string
00055 )
00056 {
00057   // Get server location.
00058   TCHAR    szModule[512] ;
00059   TCHAR*   pszCLSID = NULL;
00060   LPOLESTR wszCLSID = NULL ;
00061   HRESULT  hResult  = S_FALSE;
00062
00063   DWORD dwResult = ::GetModuleFileName( hModule,
00064                                         szModule,
00065                                         sizeof(szModule)/sizeof(TCHAR)
00066                                       );
00067   if( 0 == dwResult ) return HRESULT_FROM_WIN32( dwResult );
00068
00069   do                         // Fail unless we complete everything
00070   {
00071     // Get CLSID string in wide char
00072     hResult = StringFromCLSID( clsid, &wszCLSID ) ;
00073     if( S_OK != hResult )
00074     {
00075       CoTaskMemFree( wszCLSID );
00076       BREAK_ON_ERROR( hResult );
00077     }
00078
00079     W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00080     CoTaskMemFree( wszCLSID );           // Through with wide version
00081
00082     TCHAR szKey[64];                     // Build the CLSID key string CLSID\\{...}
00083     _tcscpy( szKey, _T("CLSID\\") );
00084     _tcscat( szKey, pszCLSID );
00085
00086     // Add the CLSID to the registry.
00087     hResult = SetKeyAndValue( szKey, NULL, szFriendlyName );
00088     BREAK_ON_ERROR( hResult );
00089
00090     // Add the server filename subkey under the CLSID key.
00091     hResult = SetKeyAndValue( szKey, _T("InprocServer32"), szModule );
00092     BREAK_ON_ERROR( hResult );
00093
00094     // Set the threading model
00095     _tcscat( szKey, _T("\\InprocServer32") );
00096     hResult = SetValue( szKey, _T("ThreadingModel"), _T("Apartment") );
00097     BREAK_ON_ERROR( hResult );
00098
00099   }while( 0 );
00100
00101   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00102
00103   return hResult;
00104 }
00105
00106
00107 //---------------------------------------------------------------------------
00108 // Remove the component from the registry.
00109 //
00110 LONG UnregisterServer
00111 (
00112   const CLSID& clsid         //[in] Class ID of component to remove
00113 )
00114 {
00115   HRESULT hResult = S_OK;
00116
00117   // Allocate the CLSID string
00118   LPOLESTR wszCLSID = NULL ;
00119   hResult = StringFromCLSID( clsid, &wszCLSID );
00120   if( S_OK != hResult )
00121   {
00122     CoTaskMemFree( wszCLSID );
00123     return hResult;
00124   }
00125
00126   // Build the key CLSID\\{...}
00127   TCHAR szKey[64];
00128   _tcscpy( szKey, _T("CLSID\\") );
00129
00130   TCHAR* pszCLSID = NULL;
00131   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00132   CoTaskMemFree( wszCLSID );           // Through with wide version
00133
00134   _tcscat( szKey, pszCLSID );
00135   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00136
00137   // Delete the CLSID Key - CLSID\{...}
00138   LONG lResult = RecursiveDeleteKey( HKEY_CLASSES_ROOT, szKey );
00139   if( ERROR_SUCCESS != lResult )
00140     hResult = HRESULT_FROM_WIN32( lResult );
00141
00142   return hResult;
00143 }
00144
00145 //---------------------------------------------------------------------------
00146 // Register the snap-in in the registry.
00147 //
00148 HRESULT RegisterSnapin
00149 (
00150   const  CLSID&  clsid,              //[in] Class ID
00151   const  TCHAR*  szNameString,       //[in] NameString
00152   const  CLSID&  clsidAbout,         //[in] Class Id for About Class
00153   const  BOOL    bSupportExtensions  //[in] TRUE if we support extensions
00154 )
00155 {
00156   HRESULT hResult = S_FALSE;
00157   TCHAR*  pszSnapCLSID = NULL;         // Needed for TCHAR version of the ClassID
00158
00159   // If any part of this process fails, jump out of the loop and return
00160   // the error code
00161   do
00162   {
00163     // Allocate the CLSID string
00164     LPOLESTR wszSnapCLSID  = NULL ;
00165     hResult = StringFromCLSID( clsid, &wszSnapCLSID ) ;
00166     if( S_OK != hResult )
00167     {
00168        CoTaskMemFree( wszSnapCLSID );
00169        continue;
00170     }
00171
00172     W2T( &pszSnapCLSID, wszSnapCLSID );  // W2T is defined in Globals.h
00173     CoTaskMemFree( wszSnapCLSID );       // Through with wide version
00174
00175     // Add the Snap-in's CLSID to the registry
00176     hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("NameString"), szNameString );
00177     BREAK_ON_ERROR( hResult );
00178
00179     hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("StandAlone"), NULL, NULL );
00180     BREAK_ON_ERROR( hResult );
00181
00182     // Add registry information for ISnapinAbout if we support it
00183     LPOLESTR wszAboutCLSID = NULL;
00184     TCHAR*   pszAboutCLSID = NULL;
00185     if( IID_NULL != clsidAbout )
00186     {
00187       hResult = StringFromCLSID( clsidAbout, &wszAboutCLSID );
00188       if( S_OK != hResult )
00189       {
00190         CoTaskMemFree( wszAboutCLSID ); // Free this memory before exiting
00191         continue;
00192       }
00193
00194       W2T( &pszAboutCLSID, wszAboutCLSID );
00195       hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("About"), pszAboutCLSID );
00196       CoTaskMemFree( wszAboutCLSID );
00197       CoTaskMemFree( pszAboutCLSID );
00198       BREAK_ON_ERROR( hResult );
00199     }
00200
00201     if( TRUE == bSupportExtensions )     // Build the NodeTypesKey
00202     {
00203       hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("NodeTypes"), NULL, NULL );
00204       BREAK_ON_ERROR( hResult );
00205       TCHAR szKey[64];
00206       _tcscpy( szKey, pszSnapCLSID );
00207       _tcscat(szKey, _T("\\NodeTypes"));
00208       hResult = SetSnapInKeyAndValue( szKey, pszSnapCLSID, NULL, NULL );
00209       BREAK_ON_ERROR( hResult );
00210     }
00211   }while( 0 );
00212
00213   CoTaskMemFree( pszSnapCLSID);
00214   return hResult;
00215 }
00216
00217
00218 //---------------------------------------------------------------------------
00219 // Unregister the snap-in in the registry.
00220 //
00221 HRESULT UnregisterSnapin
00222 (
00223   const CLSID& clsid         //[in] Class ID of object to unregister
00224 )
00225 {
00226   HRESULT hResult = S_OK;
00227
00228   TCHAR    szKeyBuf[1024];
00229   LPOLESTR wszCLSID = NULL;
00230   TCHAR*   pszCLSID = NULL;        // Needed for TCHAR version of the ClassID
00231
00232   // Get CLSID as a wide string
00233   hResult = StringFromCLSID( clsid, &wszCLSID );
00234   if( S_OK != hResult )
00235   {
00236     CoTaskMemFree( wszCLSID );
00237     return hResult;
00238   }
00239
00240   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00241   CoTaskMemFree( wszCLSID );           // Through with wide version
00242
00243   // Load the buffer with the Snap-In Location
00244   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00245
00246   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00247   _tcscat( szKeyBuf, pszCLSID );
00248
00249   // Delete the CLSID Key - CLSID\{...}
00250   LONG lResult = RecursiveDeleteKey( HKEY_LOCAL_MACHINE, szKeyBuf );
00251   if( ERROR_SUCCESS != lResult )
00252     hResult = HRESULT_FROM_WIN32( lResult );
00253
00254   CoTaskMemFree( pszCLSID );
00255   return hResult;
00256 }
00257
00258 //---------------------------------------------------------------------------
00259 // Delete a key and all of its descendents.
00260 //
00261 HRESULT RecursiveDeleteKey
00262 (
00263   HKEY          hKeyParent,    //[in] Parent of key to delete
00264   const TCHAR*  lpszKeyChild   //[in] Key to delete
00265 )
00266 {
00267   // Open the child.
00268   HKEY hKeyChild = NULL;
00269   LONG lResult   = ERROR_SUCCESS;
00270
00271   do                     // We go to all this trouble to prevent any
00272   {                      // possibility of exiting while leaving a key open
00273
00274     lResult = RegOpenKeyEx( hKeyParent,
00275                             lpszKeyChild,
00276                             0,
00277                             KEY_ALL_ACCESS,
00278                             &hKeyChild
00279                           );
00280     if( ERROR_SUCCESS != lResult )
00281       continue;
00282
00283     // Enumerate all of the decendents of this child.
00284     FILETIME time;
00285     _TCHAR szBuffer[256];
00286     DWORD dwSize = 256;
00287     while( S_OK == RegEnumKeyEx(hKeyChild,0,szBuffer,&dwSize,NULL,NULL,NULL,&time) )
00288     {
00289       // Delete the decendents of this child.
00290       lResult = RecursiveDeleteKey( hKeyChild, szBuffer );
00291       if( ERROR_SUCCESS != lResult )
00292       {
00293         continue;
00294       }
00295       dwSize = 256;
00296     }
00297   }while( 0 );
00298
00299   RegCloseKey( hKeyChild );            // Always try to close the child
00300                                        // then delete this child.
00301   return RegDeleteKey( hKeyParent, lpszKeyChild );
00302 }
00303
00304 //---------------------------------------------------------------------------
00305 // Create a Registry Key and set its value.
00306 //   - This helper function was borrowed and modifed from
00307 //     Kraig Brockschmidt's book Inside OLE.
00308 //
00309 HRESULT SetKeyAndValue
00310 (
00311   const TCHAR*  szKey,       //[in] Parent key
00312   const TCHAR*  szSubkey,    //[in] Child key
00313   const TCHAR*  szValue      //[in] Value to set
00314 )
00315 {
00316   HKEY hKey = NULL;
00317   HRESULT hResult = S_FALSE;
00318   TCHAR szKeyBuf[1024];
00319
00320   // Copy keyname into buffer.
00321   _tcscpy( szKeyBuf, szKey );
00322
00323   // Add subkey name to buffer.
00324   if( NULL != szSubkey )
00325   {
00326     _tcscat( szKeyBuf, _T("\\") );
00327     _tcscat( szKeyBuf, szSubkey );
00328   }
00329
00330   do                     // We go to all this trouble to prevent any
00331   {                      // possibility of exiting while leaving a key open
00332
00333     // Create and open key and subkey.
00334     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT,
00335                                    szKeyBuf,
00336                                    0,
00337                                    NULL,
00338                                    REG_OPTION_NON_VOLATILE,
00339                                    KEY_ALL_ACCESS,
00340                                    NULL,
00341                                    &hKey,
00342                                    NULL
00343                                  );
00344     if( ERROR_SUCCESS != lResult )
00345     {
00346       hResult = HRESULT_FROM_WIN32( lResult );
00347       continue;
00348     }
00349
00350     if( NULL != szValue )    // Now set the value
00351     {
00352       hResult = RegSetValueEx( hKey,
00353                                NULL,
00354                                0,
00355                                REG_SZ,
00356                                (BYTE*)szValue,
00357                                BYTE_SIZE( szValue )    // BYTE_SIZE is in Globals.h
00358                              );
00359       BREAK_ON_ERROR( hResult );
00360     }
00361   }while( 0 );
00362
00363   RegCloseKey( hKey );       // Always try to close the key
00364   return hResult;
00365 }
00366
00367
00368 //---------------------------------------------------------------------------
00369 // Open a key value and set it
00370 //
00371 HRESULT SetValue
00372 (
00373   const TCHAR*  szKey,         //[in] Parent key
00374   const TCHAR*  szValueName,   //[in] Name of value
00375   const TCHAR*  szValue        //[in] Value in string format
00376 )
00377 {
00378   HKEY    hKey = NULL;
00379   HRESULT hResult = S_FALSE;
00380   TCHAR szKeyBuf[1024];
00381
00382   // Copy keyname into buffer.
00383   _tcscpy( szKeyBuf, szKey );
00384
00385   do                     // We go to all this trouble to prevent any
00386   {                      // possibility of exiting while leaving a key open
00387
00388     // Create and open key and subkey.
00389     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT ,
00390                                    szKeyBuf,
00391                                    0,
00392                                    NULL,
00393                                    REG_OPTION_NON_VOLATILE,
00394                                    KEY_ALL_ACCESS,
00395                                    NULL,
00396                                    &hKey,
00397                                    NULL
00398                                  );
00399     if( ERROR_SUCCESS != lResult )
00400     {
00401       hResult = HRESULT_FROM_WIN32( lResult );
00402       continue;
00403     }
00404
00405     if( NULL != szValue )    // Now set the value
00406     {
00407       hResult = RegSetValueEx( hKey,
00408                                szValueName,
00409                                0,
00410                                REG_SZ,
00411                                (BYTE*)szValue,
00412                                BYTE_SIZE( szValue )
00413                              );
00414       BREAK_ON_ERROR( hResult );
00415     }
00416   }while( 0 );
00417
00418   RegCloseKey( hKey );       //Always attempt to close the key
00419   return hResult;
00420 }
00421
00422
00423 //---------------------------------------------------------------------------
00424 // Create a key and set its value.
00425 //   - This helper function was borrowed and modifed from
00426 //     Kraig Brockschmidt's book Inside OLE.
00427 //
00428 HRESULT SetSnapInKeyAndValue
00429 (
00430   const TCHAR*  szKey,       //[in] Parent key
00431   const TCHAR*  szSubkey,    //[in] Child key
00432   const TCHAR*  szName,      //[in] Value name
00433   const TCHAR*  szValue      //[in] Value in string format
00434 )
00435 {
00436   HKEY    hKey = NULL;
00437   HRESULT hResult = S_FALSE;
00438   TCHAR   szKeyBuf[1024];
00439
00440   // Load the buffer with the Snap-In Location
00441   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00442
00443   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00444   _tcscat( szKeyBuf, szKey );
00445
00446   if( NULL != szSubkey )               // Add subkey name to buffer.
00447   {
00448     _tcscat( szKeyBuf, _T("\\") );
00449     _tcscat( szKeyBuf, szSubkey );
00450   }
00451
00452   do                     // We go to all this trouble to prevent any
00453   {                      // possibility of exiting while leaving a key open
00454
00455     // Create and open key and subkey.
00456     long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00457                                    szKeyBuf,
00458                                    0,
00459                                    NULL,
00460                                    REG_OPTION_NON_VOLATILE,
00461                                    KEY_ALL_ACCESS,
00462                                    NULL,
00463                                    &hKey,
00464                                    NULL
00465                                  );
00466     if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00467       continue;
00468
00469     // Set the Value.
00470     if( szValue != NULL )
00471     {
00472       hResult = RegSetValueEx( hKey,
00473                                szName,
00474                                0,
00475                                REG_SZ,
00476                                (BYTE*)szValue,
00477                                BYTE_SIZE(szValue)
00478                              );
00479       BREAK_ON_ERROR( hResult );
00480     }
00481     else
00482     {                        // Got this far so everything is OK.
00483       hResult = S_OK;
00484     }
00485   }while( 0 );
00486
00487   RegCloseKey( hKey );       //Always attempt to close the key
00488   return hResult;
00489 }
00490
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Marshal2/Marshal2.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • Marshal2

Marshal2.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      MARSHAL2.CPP
00003
00004   Summary:   Main implementation file for MARSHAL2.DLL, a COM marshaling
00005              server for the ICar, IUtility, and ICruise interfaces. This
00006              module provides the main Win32 DLL framework including
00007              explicit definitions for the DllMain, DllRegisterServer, and
00008              DllUnregisterServer exported functions.
00009
00010              For a comprehensive tutorial code tour of MARSHAL2's contents
00011              and offerings see the tutorial MARSHAL2.HTM file. For more
00012              specific technical details on the internal workings see the
00013              comments dispersed throughout the MARSHAL2 source code.
00014
00015   Classes:   none.
00016
00017   Functions: DllMain, DllRegisterServer, DllUnregisterServer.
00018
00019   Origin:    5-5-97: atrent - Editor-inheritance from DLLSERVE.CPP in
00020                the DLLSERVE Tutorial Code Sample.
00021
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037 /*---------------------------------------------------------------------------
00038   We include WINDOWS.H for all Win32 applications.
00039   We include OLE2.H because we will be calling the COM/OLE Libraries.
00040   We include APPUTIL.H because we will be building this DLL using
00041     the convenient Virtual Window and Dialog classes and other
00042   We include MICARS.H for the interface declarations that were produced
00043     by the MIDL comilation.  In particular this module needs the
00044     interface IID declarations.
00045 ---------------------------------------------------------------------------*/
00046 #include <windows.h>
00047 #include <ole2.h>
00048 #include <apputil.h>
00049 #include "micars.h"
00050
00051
00052 // Global save variable for this module's instance handle.
00053 HINSTANCE g_hDllInst = NULL;
00054
00055
00056 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00057   Function: UnicodeOk
00058
00059   Summary:  Checks if the platform will handle unicode versions of
00060             Win32 string API calls.
00061
00062   Args:     void
00063
00064   Returns:  BOOL
00065               TRUE if unicode support; FALSE if not.
00066 ------------------------------------------------------------------------F-F*/
00067 BOOL UnicodeOk(void)
00068 {
00069   BOOL bOk = TRUE;
00070   TCHAR szUserName[MAX_STRING_LENGTH];
00071   DWORD dwSize = MAX_STRING_LENGTH;
00072
00073   if (!GetUserName(szUserName, &dwSize))
00074     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00075
00076   return bOk;
00077 }
00078
00079
00080 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00081   Function: DllMain
00082
00083   Summary:  Like WinMain is for an EXE application, this DllMain function
00084             is the main entry point for this DLL.  It is called when the
00085             DLL is loaded by a process, and when new threads are created
00086             by a process that has already loaded this DLL.  DllMain is also
00087             called when threads of a process that has loaded the DLL exit
00088             cleanly and when the process itself unloads the DLL.
00089
00090             If you want to use C runtime libraries, keep this function
00091             named "DllMain" and you won't have to do anything special to
00092             initialize the runtime libraries.
00093
00094             When fdwReason == DLL_PROCESS_ATTACH, the return value is used
00095             to determine if the DLL should remain loaded, or should be
00096             immediately unloaded depending upon whether the DLL could be
00097             initialized properly.  For all other values of fdwReason,
00098             the return value is ignored.
00099
00100   Args:     HINSTANCE hDLLInst,
00101               Instance handle of the DLL.
00102             DWORD fdwReason,
00103               Process attach/detach or thread attach/detach.
00104               Reason for calling.
00105             LPVOID lpvReserved)
00106               Reserved and not used.
00107
00108   Returns:  BOOL,
00109               Return value is used only when fdwReason == DLL_PROCESS_ATTACH.
00110               TRUE  -  Used to signify that the DLL should remain loaded.
00111               FALSE -  Used to signify that the DLL should be
00112                 immediately unloaded.
00113 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00114 BOOL WINAPI DllMain(
00115               HINSTANCE hDllInst,
00116               DWORD fdwReason,
00117               LPVOID lpvReserved)
00118 {
00119   BOOL bResult = TRUE;
00120
00121   // Dispatch this main call based on the reason it was called.
00122   switch (fdwReason)
00123   {
00124     case DLL_PROCESS_ATTACH:
00125       // The DLL is being loaded for the first time by a given process.
00126       // Perform per-process initialization here.  If the initialization
00127       // is successful, return TRUE; if unsuccessful, return FALSE.
00128       g_hDllInst = hDllInst;
00129       bResult = UnicodeOk();
00130       break;
00131
00132     case DLL_PROCESS_DETACH:
00133       // The DLL is being unloaded by a given process.  Do any
00134       // per-process clean up here, such as undoing what was done in
00135       // DLL_PROCESS_ATTACH.  The return value is ignored.
00136       break;
00137
00138     case DLL_THREAD_ATTACH:
00139       // A thread is being created in a process that has already loaded
00140       // this DLL.  Perform any per-thread initialization here.  The
00141       // return value is ignored.
00142       break;
00143
00144     case DLL_THREAD_DETACH:
00145       // A thread is exiting cleanly in a process that has already
00146       // loaded this DLL.  Perform any per-thread clean up here.  The
00147       // return value is ignored.
00148       break;
00149
00150     default:
00151       break;
00152   }
00153
00154   return (bResult);
00155 }
00156
00157
00158 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00159   Function: DllRegisterServer
00160
00161   Summary:  The standard exported function that can be called to command
00162             this DLL server to register itself in the system registry.
00163
00164   Args:     void.
00165
00166   Returns:  HRESULT
00167               NOERROR
00168 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00169 STDAPI DllRegisterServer(void)
00170 {
00171   HRESULT  hr = NOERROR;
00172   TCHAR    szID[GUID_SIZE+1];
00173   TCHAR    szIFace[GUID_SIZE+32];
00174   TCHAR    szCLSID[GUID_SIZE+32];
00175   TCHAR    szModulePath[MAX_PATH];
00176
00177   // Obtain the path to this module's executable file for later use.
00178   GetModuleFileName(
00179     g_hDllInst,
00180     szModulePath,
00181     sizeof(szModulePath)/sizeof(TCHAR));
00182
00183   /*-------------------------------------------------------------------------
00184     Create registry entries for the ICar Interface.
00185   -------------------------------------------------------------------------*/
00186   // Create some base key strings.
00187   StringFromGUID2(IID_ICar, szID, GUID_SIZE);
00188   lstrcpyn(szIFace, TEXT("Interface\\"), sizeof(szIFace)/sizeof(TCHAR));
00189   lstrncat(szIFace, szID, sizeof(szIFace)/sizeof(TCHAR) - lstrlen(szIFace));
00190   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00191   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00192
00193   // Create the HKEY_CLASSES_ROOT\Interface entries.
00194   SetRegKeyValue(
00195     szIFace,
00196     NULL,
00197     TEXT("ICar"));
00198   SetRegKeyValue(
00199     szIFace,
00200     TEXT("ProxyStubClsid32"),
00201     szID);
00202   SetRegKeyValue(
00203     szIFace,
00204     TEXT("NumMethods"),
00205     TEXT("7"));
00206
00207   // Create the HKEY_CLASSES_ROOT\CLSID entries.
00208   SetRegKeyValue(
00209     szCLSID,
00210     NULL,
00211     TEXT("ICar Proxy/Stub Factory"));
00212   SetRegKeyValue(
00213     szCLSID,
00214     TEXT("InprocServer32"),
00215     szModulePath);
00216
00217   /*-------------------------------------------------------------------------
00218     Create registry entries for the IUtility Interface.
00219   -------------------------------------------------------------------------*/
00220   // Create some base key strings.
00221   StringFromGUID2(IID_IUtility, szID, GUID_SIZE);
00222   lstrcpyn(szIFace, TEXT("Interface\\"), sizeof(szIFace)/sizeof(TCHAR));
00223   lstrncat(szIFace, szID, sizeof(szIFace)/sizeof(TCHAR) - lstrlen(szIFace));
00224   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00225   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00226
00227   // Create the HKEY_CLASSES_ROOT\Interface entries.
00228   SetRegKeyValue(
00229     szIFace,
00230     NULL,
00231     TEXT("IUtility"));
00232   SetRegKeyValue(
00233     szIFace,
00234     TEXT("ProxyStubClsid32"),
00235     szID);
00236   SetRegKeyValue(
00237     szIFace,
00238     TEXT("NumMethods"),
00239     TEXT("5"));
00240
00241   // Create the HKEY_CLASSES_ROOT\CLSID entries.
00242   SetRegKeyValue(
00243     szCLSID,
00244     NULL,
00245     TEXT("IUtility Proxy/Stub Factory"));
00246   SetRegKeyValue(
00247     szCLSID,
00248     TEXT("InprocServer32"),
00249     szModulePath);
00250
00251   /*-------------------------------------------------------------------------
00252     Create registry entries for the ICruise Interface.
00253   -------------------------------------------------------------------------*/
00254   // Create some base key strings.
00255   StringFromGUID2(IID_ICruise, szID, GUID_SIZE);
00256   lstrcpyn(szIFace, TEXT("Interface\\"), sizeof(szIFace)/sizeof(TCHAR));
00257   lstrncat(szIFace, szID, sizeof(szIFace)/sizeof(TCHAR) - lstrlen(szIFace));
00258   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00259   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00260
00261   // Create the HKEY_CLASSES_ROOT\Interface entries.
00262   SetRegKeyValue(
00263     szIFace,
00264     NULL,
00265     TEXT("ICruise"));
00266   SetRegKeyValue(
00267     szIFace,
00268     TEXT("ProxyStubClsid32"),
00269     szID);
00270   SetRegKeyValue(
00271     szIFace,
00272     TEXT("NumMethods"),
00273     TEXT("5"));
00274
00275   // Create the HKEY_CLASSES_ROOT\CLSID entries.
00276   SetRegKeyValue(
00277     szCLSID,
00278     NULL,
00279     TEXT("ICruise Proxy/Stub Factory"));
00280   SetRegKeyValue(
00281     szCLSID,
00282     TEXT("InprocServer32"),
00283     szModulePath);
00284
00285   return hr;
00286 }
00287
00288
00289 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00290   Function: DllUnregisterServer
00291
00292   Summary:  The standard exported function that can be called to command
00293             this DLL server to unregister itself from the system Registry.
00294
00295   Args:     void.
00296
00297   Returns:  HRESULT
00298               NOERROR
00299 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00300 STDAPI DllUnregisterServer(void)
00301 {
00302   HRESULT  hr = NOERROR;
00303   TCHAR    szID[GUID_SIZE+1];
00304   TCHAR    szIFace[GUID_SIZE+32];
00305   TCHAR    szCLSID[GUID_SIZE+32];
00306   TCHAR    szTemp[MAX_PATH+GUID_SIZE];
00307
00308   /*-------------------------------------------------------------------------
00309     Delete registry entries for the ICar Interface.
00310   -------------------------------------------------------------------------*/
00311   //Create some base key strings.
00312   StringFromGUID2(IID_ICar, szID, GUID_SIZE);
00313   lstrcpyn(szIFace, TEXT("Interface\\"), sizeof(szIFace)/sizeof(TCHAR));
00314   lstrncat(szIFace, szID, sizeof(szIFace)/sizeof(TCHAR) - lstrlen(szIFace));
00315   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00316   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00317
00318   lstrcpyn(szTemp, szCLSID, sizeof(szTemp)/sizeof(TCHAR));
00319   lstrncat(szTemp, TEXT("\\InprocServer32"), sizeof(szTemp)/sizeof(TCHAR) -
00320     lstrlen(szTemp));
00321   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00322
00323   lstrcpyn(szTemp, szIFace, sizeof(szTemp)/sizeof(TCHAR));
00324   lstrncat(szTemp, TEXT("\\ProxyStubClsid32"), sizeof(szTemp)/sizeof(TCHAR) -
00325     lstrlen(szTemp));
00326   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00327
00328   lstrcpyn(szTemp, szIFace, sizeof(szTemp)/sizeof(TCHAR));
00329   lstrncat(szTemp, TEXT("\\NumMethods"), sizeof(szTemp)/sizeof(TCHAR) -
00330     lstrlen(szTemp));
00331   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00332
00333   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00334   RegDeleteKey(HKEY_CLASSES_ROOT, szIFace);
00335
00336   /*-------------------------------------------------------------------------
00337     Delete registry entries for the IUtility Interface.
00338   -------------------------------------------------------------------------*/
00339   //Create some base key strings.
00340   StringFromGUID2(IID_IUtility, szID, GUID_SIZE);
00341   lstrcpyn(szIFace, TEXT("Interface\\"), sizeof(szIFace)/sizeof(TCHAR));
00342   lstrncat(szIFace, szID, sizeof(szIFace)/sizeof(TCHAR) - lstrlen(szIFace));
00343   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00344   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00345
00346   lstrcpyn(szTemp, szCLSID, sizeof(szTemp)/sizeof(TCHAR));
00347   lstrncat(szTemp, TEXT("\\InprocServer32"), sizeof(szTemp)/sizeof(TCHAR) -
00348     lstrlen(szTemp));
00349   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00350
00351   lstrcpyn(szTemp, szIFace, sizeof(szTemp)/sizeof(TCHAR));
00352   lstrncat(szTemp, TEXT("\\ProxyStubClsid32"), sizeof(szTemp)/sizeof(TCHAR) -
00353     lstrlen(szTemp));
00354   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00355
00356   lstrcpyn(szTemp, szIFace, sizeof(szTemp)/sizeof(TCHAR));
00357   lstrncat(szTemp, TEXT("\\NumMethods"), sizeof(szTemp)/sizeof(TCHAR) -
00358     lstrlen(szTemp));
00359   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00360
00361   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00362   RegDeleteKey(HKEY_CLASSES_ROOT, szIFace);
00363
00364   /*-------------------------------------------------------------------------
00365     Delete registry entries for the ICruise Interface.
00366   -------------------------------------------------------------------------*/
00367   //Create some base key strings.
00368   StringFromGUID2(IID_ICruise, szID, GUID_SIZE);
00369   lstrcpyn(szIFace, TEXT("Interface\\"), sizeof(szIFace)/sizeof(TCHAR));
00370   lstrncat(szIFace, szID, sizeof(szIFace)/sizeof(TCHAR) - lstrlen(szIFace));
00371   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00372   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00373
00374   lstrcpyn(szTemp, szCLSID, sizeof(szTemp)/sizeof(TCHAR));
00375   lstrncat(szTemp, TEXT("\\InprocServer32"), sizeof(szTemp)/sizeof(TCHAR) -
00376     lstrlen(szTemp));
00377   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00378
00379   lstrcpyn(szTemp, szIFace, sizeof(szTemp)/sizeof(TCHAR));
00380   lstrncat(szTemp, TEXT("\\ProxyStubClsid32"), sizeof(szTemp)/sizeof(TCHAR) -
00381     lstrlen(szTemp));
00382   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00383
00384   lstrcpyn(szTemp, szIFace, sizeof(szTemp)/sizeof(TCHAR));
00385   lstrncat(szTemp, TEXT("\\NumMethods"), sizeof(szTemp)/sizeof(TCHAR) -
00386     lstrlen(szTemp));
00387   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00388
00389   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00390   RegDeleteKey(HKEY_CLASSES_ROOT, szIFace);
00391
00392   return hr;
00393 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DataObj.Cpp Source File

  • WinUI
  • Shell
  • SampView

DataObj.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DataObj.cpp
00013
00014    Description:   CDataObject implementation.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "DataObj.h"
00023
00024 /**************************************************************************
00025    global variables
00026 **************************************************************************/
00027
00028 /**************************************************************************
00029
00030    CDataObject::CDataObject()
00031
00032 **************************************************************************/
00033
00034 CDataObject::CDataObject(CShellFolder *psfParent, LPCITEMIDLIST *aPidls, UINT uItemCount)
00035 {
00036 g_DllRefCount++;
00037
00038 m_uItemCount = 0;
00039
00040 m_psfParent = psfParent;
00041 if(m_psfParent)
00042    m_psfParent->AddRef();
00043
00044 m_ObjRefCount = 1;
00045
00046 m_aPidls = NULL;
00047 SHGetMalloc(&m_pMalloc);
00048 if(!m_pMalloc)
00049    {
00050    delete this;
00051    return;
00052    }
00053
00054 m_pPidlMgr = new CPidlMgr();
00055
00056 m_uItemCount = uItemCount;
00057
00058 AllocPidlTable(uItemCount);
00059 if(m_aPidls)
00060    {
00061    FillPidlTable(aPidls, uItemCount);
00062    }
00063
00064 m_cfPrivateData = RegisterClipboardFormat(CFSTR_SAMPVIEWDATA);
00065 m_cfShellIDList = RegisterClipboardFormat(CFSTR_SHELLIDLIST);
00066
00067 m_cFormatEtc = 2;
00068 m_pFormatEtc = new FORMATETC[m_cFormatEtc];
00069 SETDefFormatEtc(m_pFormatEtc[0], m_cfPrivateData, TYMED_HGLOBAL);
00070 SETDefFormatEtc(m_pFormatEtc[1], m_cfShellIDList, TYMED_HGLOBAL);
00071
00072 m_iCurrent = 0;
00073 }
00074
00075 /**************************************************************************
00076
00077    CDataObject::~CDataObject()
00078
00079 **************************************************************************/
00080
00081 CDataObject::~CDataObject()
00082 {
00083 if(m_psfParent)
00084    m_psfParent->Release();
00085
00086 g_DllRefCount--;
00087
00088 //make sure the pidls are freed
00089 if(m_aPidls && m_pMalloc)
00090    {
00091    FreePidlTable();
00092    }
00093
00094 if(m_pPidlMgr)
00095    delete m_pPidlMgr;
00096
00097 if(m_pMalloc)
00098    m_pMalloc->Release();
00099
00100 //delete [] m_pFormatEtc;
00101 delete m_pFormatEtc;
00102 }
00103
00104 ///////////////////////////////////////////////////////////////////////////
00105 //
00106 // IUnknown Implementation
00107 //
00108
00109 /**************************************************************************
00110
00111    CDataObject::QueryInterface
00112
00113 **************************************************************************/
00114
00115 STDMETHODIMP CDataObject::QueryInterface(   REFIID riid,
00116                                             LPVOID *ppReturn)
00117 {
00118 *ppReturn = NULL;
00119
00120 if(IsEqualIID(riid, IID_IUnknown))
00121    {
00122    *ppReturn = (LPUNKNOWN)(LPCONTEXTMENU)this;
00123    }
00124 else if(IsEqualIID(riid, IID_IDataObject))
00125    {
00126    *ppReturn = (LPDATAOBJECT)this;
00127    }
00128 else if(IsEqualIID(riid, IID_IEnumFORMATETC))
00129    {
00130    *ppReturn = (LPENUMFORMATETC)this;
00131    }
00132
00133 if(*ppReturn)
00134    {
00135    (*(LPUNKNOWN*)ppReturn)->AddRef();
00136    return S_OK;
00137    }
00138
00139 return E_NOINTERFACE;
00140 }
00141
00142 /**************************************************************************
00143
00144    CDataObject::AddRef
00145
00146 **************************************************************************/
00147
00148 STDMETHODIMP_(DWORD) CDataObject::AddRef()
00149 {
00150 return ++m_ObjRefCount;
00151 }
00152
00153
00154 /**************************************************************************
00155
00156    CDataObject::Release
00157
00158 **************************************************************************/
00159
00160 STDMETHODIMP_(DWORD) CDataObject::Release()
00161 {
00162   if(--m_ObjRefCount == 0)
00163   {
00164       delete this;
00165     return 0;
00166   }
00167     return m_ObjRefCount;
00168
00169 }
00170
00171 ///////////////////////////////////////////////////////////////////////////
00172 //
00173 // IDataObject Implementation
00174 //
00175
00176 /**************************************************************************
00177
00178    CDataObject::GetData()
00179
00180 **************************************************************************/
00181
00182 STDMETHODIMP CDataObject::GetData(LPFORMATETC pFE, LPSTGMEDIUM pStgMedium)
00183 {
00184 if(pFE->cfFormat == m_cfPrivateData)
00185    {
00186    LPITEMIDLIST   pidlParent;
00187
00188    pidlParent = m_psfParent->CreateFQPidl(NULL);
00189
00190    if(pidlParent)
00191       {
00192       pStgMedium->hGlobal = CreatePrivateClipboardData(pidlParent, m_aPidls, m_uItemCount, FALSE);
00193
00194       m_pPidlMgr->Delete(pidlParent);
00195
00196       if(pStgMedium->hGlobal)
00197          {
00198          pStgMedium->tymed = TYMED_HGLOBAL;
00199          return S_OK;
00200          }
00201       }
00202
00203    return E_OUTOFMEMORY;
00204    }
00205
00206 else if(pFE->cfFormat == m_cfShellIDList)
00207    {
00208    LPITEMIDLIST   pidlParent;
00209
00210    pidlParent = m_psfParent->CreateFQPidl(NULL);
00211
00212    if(pidlParent)
00213       {
00214       pStgMedium->hGlobal = CreateShellIDList(pidlParent, m_aPidls, m_uItemCount);
00215
00216       m_pPidlMgr->Delete(pidlParent);
00217
00218       if(pStgMedium->hGlobal)
00219          {
00220          pStgMedium->tymed = TYMED_HGLOBAL;
00221          return S_OK;
00222          }
00223       }
00224
00225    return E_OUTOFMEMORY;
00226    }
00227
00228 return E_INVALIDARG;
00229 }
00230
00231 /**************************************************************************
00232
00233    CDataObject::GetDataHere()
00234
00235 **************************************************************************/
00236
00237 STDMETHODIMP CDataObject::GetDataHere (LPFORMATETC pFE, LPSTGMEDIUM pStgMedium)
00238 {
00239 return E_NOTIMPL;
00240 }
00241
00242 /**************************************************************************
00243
00244    CDataObject::QueryGetData()
00245
00246 **************************************************************************/
00247
00248 STDMETHODIMP CDataObject::QueryGetData(LPFORMATETC pFE)
00249 {
00250 BOOL fReturn = FALSE;
00251
00252 /*
00253 Check the aspects we support. Implementations of this object will only
00254 support DVASPECT_CONTENT.
00255 */
00256 if(!(DVASPECT_CONTENT & pFE->dwAspect))
00257    return DV_E_DVASPECT;
00258
00259 if(pFE->cfFormat == m_cfPrivateData)
00260    {
00261    //
00262    // Now check for an appropriate TYMED.
00263    //
00264    for(UINT i = 0; i < m_cFormatEtc; i++)
00265       {
00266       fReturn |= m_pFormatEtc[i].tymed & pFE->tymed;
00267       }
00268    }
00269
00270 if(pFE->cfFormat == m_cfShellIDList)
00271    {
00272    //
00273    // Now check for an appropriate TYMED.
00274    //
00275    for(UINT i = 0; i < m_cFormatEtc; i++)
00276       {
00277       fReturn |= m_pFormatEtc[i].tymed & pFE->tymed;
00278       }
00279    }
00280
00281 return (fReturn ? S_OK : DV_E_TYMED);
00282 }
00283
00284 /**************************************************************************
00285
00286    CDataObject::GetCanonicalFormatEtc()
00287
00288 **************************************************************************/
00289
00290 STDMETHODIMP CDataObject::GetCanonicalFormatEtc(LPFORMATETC pFEIn, LPFORMATETC pFEOut)
00291 {
00292 if(NULL == pFEOut)
00293    return E_INVALIDARG;
00294
00295 pFEOut->ptd = NULL;
00296
00297 return DATA_S_SAMEFORMATETC;
00298 }
00299
00300 /**************************************************************************
00301
00302    CDataObject::EnumFormatEtc()
00303
00304 **************************************************************************/
00305
00306 STDMETHODIMP CDataObject::EnumFormatEtc(  DWORD dwDirection,
00307                                           IEnumFORMATETC** ppEFE)
00308 {
00309 *ppEFE = NULL;
00310
00311 if(DATADIR_GET == dwDirection)
00312    {
00313    return this->QueryInterface(IID_IEnumFORMATETC, (LPVOID*)ppEFE);
00314    }
00315
00316 return E_NOTIMPL;
00317 }
00318
00319 /**************************************************************************
00320
00321    CDataObject::SetData()
00322
00323 **************************************************************************/
00324
00325 STDMETHODIMP CDataObject::SetData(  LPFORMATETC pFE,
00326                                     LPSTGMEDIUM pStgMedium,
00327                                     BOOL fRelease)
00328 {
00329 return E_NOTIMPL;
00330 }
00331
00332 /**************************************************************************
00333
00334    CDataObject::DAdvise()
00335
00336 **************************************************************************/
00337
00338 STDMETHODIMP CDataObject::DAdvise(  LPFORMATETC pFE,
00339                                     DWORD advf,
00340                                     IAdviseSink *ppAdviseSink,
00341                                     LPDWORD pdwConnection)
00342 {
00343 return E_NOTIMPL;
00344 }
00345
00346 /**************************************************************************
00347
00348    CDataObject::DUnadvise()
00349
00350 **************************************************************************/
00351
00352 STDMETHODIMP CDataObject::DUnadvise(DWORD dwConnection)
00353 {
00354 return E_NOTIMPL;
00355 }
00356
00357 /**************************************************************************
00358
00359    CDataObject::EnumDAdvise()
00360
00361 **************************************************************************/
00362
00363 STDMETHODIMP CDataObject::EnumDAdvise(IEnumSTATDATA** ppEnumAdvise)
00364 {
00365 return E_NOTIMPL;
00366 }
00367
00368 ///////////////////////////////////////////////////////////////////////////
00369 //
00370 // IEnumFORMATETC Implementation
00371 //
00372
00373 STDMETHODIMP CDataObject::Next(ULONG uRequested, LPFORMATETC pFormatEtc, ULONG* pulFetched)
00374 {
00375 if(NULL == m_pFormatEtc)
00376    return S_FALSE;
00377
00378 if(NULL != pulFetched)
00379    *pulFetched = 0L;
00380
00381 if(NULL == pFormatEtc)
00382    return E_INVALIDARG;
00383
00384 ULONG uFetched;
00385 for(uFetched = 0; m_iCurrent < m_cFormatEtc && uRequested > uFetched; uFetched++)
00386    {
00387    *pFormatEtc++ = m_pFormatEtc[m_iCurrent++];
00388    }
00389
00390 if(NULL != pulFetched)
00391    *pulFetched = uFetched;
00392
00393 return ((uFetched == uRequested) ? S_OK : S_FALSE);
00394 }
00395
00396 /**************************************************************************
00397
00398    CDataObject::Skip()
00399
00400 **************************************************************************/
00401
00402 STDMETHODIMP CDataObject::Skip(ULONG cSkip)
00403 {
00404 if((m_iCurrent + cSkip) >= m_cFormatEtc)
00405    return S_FALSE;
00406
00407 m_iCurrent += cSkip;
00408
00409 return S_OK;
00410 }
00411
00412
00413 /**************************************************************************
00414
00415    CDataObject::Reset()
00416
00417 **************************************************************************/
00418
00419 STDMETHODIMP CDataObject::Reset(void)
00420 {
00421 m_iCurrent = 0;
00422 return S_OK;
00423 }
00424
00425 /**************************************************************************
00426
00427    CDataObject::Clone()
00428
00429 **************************************************************************/
00430
00431 STDMETHODIMP CDataObject::Clone(LPENUMFORMATETC* ppEnum)
00432 {
00433 CDataObject* pNew;
00434
00435 *ppEnum = NULL;
00436
00437 // Create the clone.
00438 pNew = new CDataObject(m_psfParent, (LPCITEMIDLIST*)m_aPidls, m_uItemCount);
00439 if (NULL == pNew)
00440    return E_OUTOFMEMORY;
00441
00442 pNew->m_iCurrent = m_iCurrent;
00443
00444 *ppEnum = pNew;
00445
00446 return S_OK;
00447 }
00448
00449 ///////////////////////////////////////////////////////////////////////////
00450 //
00451 // private and utility methods
00452 //
00453
00454 /**************************************************************************
00455
00456    CDataObject::AllocPidlTable()
00457
00458 **************************************************************************/
00459
00460 BOOL CDataObject::AllocPidlTable(DWORD dwEntries)
00461 {
00462 m_aPidls = (LPITEMIDLIST*)m_pMalloc->Alloc(dwEntries * sizeof(LPITEMIDLIST));
00463
00464 if(m_aPidls)
00465    {
00466    //set all of the entries to NULL
00467    ZeroMemory(m_aPidls, dwEntries * sizeof(LPITEMIDLIST));
00468    }
00469
00470 return (m_aPidls != NULL);
00471 }
00472
00473 /**************************************************************************
00474
00475    CDataObject::FreePidlTable()
00476
00477 **************************************************************************/
00478
00479 VOID CDataObject::FreePidlTable(VOID)
00480 {
00481 if(m_aPidls && m_pPidlMgr)
00482    {
00483    UINT  i;
00484    for(i = 0; i < m_uItemCount; i++)
00485       m_pPidlMgr->Delete(m_aPidls[i]);
00486
00487    m_pMalloc->Free(m_aPidls);
00488
00489    m_aPidls = NULL;
00490    }
00491 }
00492
00493 /**************************************************************************
00494
00495    CDataObject::FillPidlTable()
00496
00497 **************************************************************************/
00498
00499 BOOL CDataObject::FillPidlTable(LPCITEMIDLIST *aPidls, UINT uItemCount)
00500 {
00501 if(m_aPidls)
00502    {
00503    if(m_pPidlMgr)
00504       {
00505       UINT  i;
00506       for(i = 0; i < uItemCount; i++)
00507          {
00508          m_aPidls[i] = m_pPidlMgr->Copy(aPidls[i]);
00509          }
00510       return TRUE;
00511       }
00512    }
00513
00514 return FALSE;
00515 }
00516
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTAPIEventNotification Member List

This is the complete list of members for CTAPIEventNotification, including all inherited members.
AddRef() | CTAPIEventNotification | [inline]
AddRef() | CTAPIEventNotification | [inline]
AddRef() | CTAPIEventNotification | [inline]
CTAPIEventNotification() | CTAPIEventNotification | [inline]
CTAPIEventNotification() | CTAPIEventNotification | [inline]
CTAPIEventNotification() | CTAPIEventNotification | [inline]
Event(IN TAPI_EVENT TapiEvent, IN IDispatch *pEvent) | CTAPIEventNotification |
Event(TAPI_EVENT TapiEvent, IDispatch *pEvent) | CTAPIEventNotification |
Event(IN TAPI_EVENT TapiEvent, IN IDispatch *pEvent) | CTAPIEventNotification |
m_dwRefCount | CTAPIEventNotification | [private]
QueryInterface(REFIID iid, void **ppvObject) | CTAPIEventNotification | [inline]
QueryInterface(REFIID iid, void **ppvObject) | CTAPIEventNotification | [inline]
QueryInterface(IN REFIID iid, OUT void **ppvObject) | CTAPIEventNotification | [inline]
Release() | CTAPIEventNotification | [inline]
Release() | CTAPIEventNotification | [inline]
Release() | CTAPIEventNotification | [inline]
~CTAPIEventNotification() | CTAPIEventNotification | [inline]
~CTAPIEventNotification() | CTAPIEventNotification | [inline, private]
Generated on Wed Nov 13 2024 16:57:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/ClRes.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

ClRes.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ClRes.cpp
00007 //
00008 //  Description:
00009 //      Entry point module for resource type DLL.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 //////////////////////////////////////////////////////////////////////////////
00021 // Include Files
00022 //////////////////////////////////////////////////////////////////////////////
00023
00024 #include "ClRes.h"
00025 #include "CMgdResType.h"
00026
00027 //
00028 // Main ATL COM module
00029 //
00030 CComModule _Module;
00031
00032 //
00033 // List of all COM classes supported by this DLL
00034 //
00035 BEGIN_OBJECT_MAP( ObjectMap )
00036     OBJECT_ENTRY( CLSID_ClipBookServer, CMgdResType )
00037 END_OBJECT_MAP()
00038
00039 //
00040 // Global data.
00041 //
00042
00043 // Event Logging routine.
00044 PLOG_EVENT_ROUTINE g_pfnLogEvent = NULL;
00045
00046 // Resource Status routine for pending Online and Offline calls.
00047 PSET_RESOURCE_STATUS_ROUTINE g_pfnSetResourceStatus = NULL;
00048
00049 // Handle to Service Control Manager set by the first Open resource call.
00050 SC_HANDLE g_schSCMHandle = NULL;
00051
00052 //
00053 // Function prototypes.
00054 //
00055
00056 BOOL WINAPI DllMain(
00057       HINSTANCE hInstanceIn
00058     , DWORD     nReasonIn
00059     , LPVOID    ReservedIn
00060     );
00061
00062 STDAPI
00063 DllCanUnloadNow( void );
00064
00065 STDAPI
00066 DllGetClassObject(
00067       REFCLSID  rclsidIn
00068     , REFIID    riidIn
00069     , LPVOID *  ppvOut
00070     );
00071
00072 STDAPI
00073 DllRegisterServer( void );
00074
00075 STDAPI
00076 DllUnregisterServer( void );
00077
00078 DWORD WINAPI Startup(
00079       LPCWSTR                       pwszResourceTypeIn
00080     , DWORD                         nMinVersionSupportedIn
00081     , DWORD                         nMaxVersionSupportedIn
00082     , PSET_RESOURCE_STATUS_ROUTINE  pfnSetResourceStatusIn
00083     , PLOG_EVENT_ROUTINE            pfnLogEventIn
00084     , PCLRES_FUNCTION_TABLE *       pFunctionTableOut
00085     );
00086
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 //++
00090 //
00091 //  DllMain
00092 //
00093 //  Description:
00094 //      Main DLL entry point.
00095 //
00096 //  Arguments:
00097 //      hInstanceIn
00098 //          DLL instance handle.
00099 //
00100 //      nReasonIn
00101 //          Reason for being called.
00102 //
00103 //      ReservedIn
00104 //          Reserved argument.
00105 //
00106 //  Return Value:
00107 //      TRUE
00108 //          Success.
00109 //
00110 //      FALSE
00111 //          Failure.
00112 //
00113 //--
00114 /////////////////////////////////////////////////////////////////////////////
00115 BOOL WINAPI
00116 DllMain(
00117       HINSTANCE   hInstanceIn
00118     , DWORD       nReasonIn
00119     , LPVOID      ReservedIn
00120     )
00121 {
00122     BOOL    fSuccess = TRUE;
00123
00124     //
00125     // Perform global initialization.
00126     //
00127
00128     switch ( nReasonIn )
00129     {
00130         case DLL_PROCESS_ATTACH:
00131             _Module.Init( ObjectMap, hInstanceIn );
00132             DisableThreadLibraryCalls( hInstanceIn );
00133             break;
00134
00135         case DLL_PROCESS_DETACH:
00136             _Module.Term();
00137             break;
00138
00139     } // switch: nReason
00140
00141     //
00142     // Pass this request off to the resource type-specific routines.
00143     //
00144
00145     fSuccess = ClipBookServerDllMain( hInstanceIn, nReasonIn, ReservedIn );
00146
00147     return fSuccess;
00148
00149 } //*** DllMain
00150
00151
00152 //////////////////////////////////////////////////////////////////////////////
00153 //++
00154 //
00155 //  DllCanUnloadNow
00156 //
00157 //  Description:
00158 //      Used to determine whether or not this DLL can be unloaded
00159 //
00160 //  Arguments:
00161 //      None.
00162 //
00163 //  Return Value:
00164 //      S_OK
00165 //          Yes.
00166 //
00167 //      S_FALSE
00168 //          No.
00169 //
00170 //--
00171 //////////////////////////////////////////////////////////////////////////////
00172 STDAPI
00173 DllCanUnloadNow( void )
00174 {
00175     return ( _Module.GetLockCount() == 0 ) ? S_OK : S_FALSE;
00176
00177 } //*** DllCanUnloadNow
00178
00179
00180 //////////////////////////////////////////////////////////////////////////////
00181 //++
00182 //
00183 //  DllGetClassObject
00184 //
00185 //  Description:
00186 //      Returns a class factory to create an object of the requested type
00187 //
00188 //  Arguments:
00189 //      rclsidIn
00190 //      riidIn
00191 //      ppvOut
00192 //
00193 //  Return Value:
00194 //      S_OK
00195 //          Success.
00196 //
00197 //      Other HRESULTs
00198 //          Failure.
00199 //
00200 //--
00201 //////////////////////////////////////////////////////////////////////////////
00202 STDAPI
00203 DllGetClassObject(
00204       REFCLSID    rclsidIn
00205     , REFIID      riidIn
00206     , LPVOID *    ppvOut
00207     )
00208 {
00209     return _Module.GetClassObject( rclsidIn, riidIn, ppvOut );
00210
00211 } //*** DllGetClassObject
00212
00213
00214 //////////////////////////////////////////////////////////////////////////////
00215 //++
00216 //
00217 //  DllRegisterServer
00218 //
00219 //  Description:
00220 //      Adds entries to the system registry
00221 //
00222 //  Arguments:
00223 //      None.
00224 //
00225 //  Return Value:
00226 //      S_OK
00227 //          Success.
00228 //
00229 //      Other HRESULTs
00230 //          Failure.
00231 //
00232 //--
00233 //////////////////////////////////////////////////////////////////////////////
00234 STDAPI
00235 DllRegisterServer( void )
00236 {
00237     //
00238     //  registers object, typelib and all interfaces in typelib
00239     //
00240
00241     return _Module.RegisterServer( TRUE );
00242
00243 } //*** DllRegisterServer
00244
00245
00246 //////////////////////////////////////////////////////////////////////////////
00247 //++
00248 //
00249 //  DllUnRegisterServer
00250 //
00251 //  Description:
00252 //      Removes entries to the system registry
00253 //
00254 //  Arguments:
00255 //      None.
00256 //
00257 //  Return Value:
00258 //      S_OK
00259 //          Success.
00260 //
00261 //      Other HRESULTs
00262 //          Failure.
00263 //
00264 //--
00265 //////////////////////////////////////////////////////////////////////////////
00266 STDAPI
00267 DllUnregisterServer( void )
00268 {
00269     return _Module.UnregisterServer( TRUE );
00270
00271 } //*** DllUnregisterServer
00272
00273
00274 /////////////////////////////////////////////////////////////////////////////
00275 //++
00276 //
00277 //  Startup
00278 //
00279 //  Description:
00280 //      Startup the resource DLL. This routine verifies that at least one
00281 //      currently supported version of the resource DLL is between
00282 //      nMinVersionSupported and nMaxVersionSupported. If not, then the
00283 //      resource DLL should return ERROR_REVISION_MISMATCH.
00284 //
00285 //      If more than one version of the resource DLL interface is supported
00286 //      by the resource DLL, then the highest version (up to
00287 //      nMaxVersionSupported) should be returned as the resource DLL's
00288 //      interface. If the returned version is not within range, then startup
00289 //      fails.
00290 //
00291 //      The Resource Type is passed in so that if the resource DLL supports
00292 //      more than one Resource Type, it can pass back the correct function
00293 //      table associated with the Resource Type.
00294 //
00295 //  Arguments:
00296 //      pwszResourceTypeIn
00297 //          Type of resource requesting a function table.
00298 //
00299 //      nMinVersionSupportedIn
00300 //          Minimum resource DLL interface version supported by the cluster
00301 //          software.
00302 //
00303 //      nMaxVersionSupportedIn
00304 //          Maximum resource DLL interface version supported by the cluster
00305 //          software.
00306 //
00307 //      pfnSetResourceStatusIn
00308 //          Pointer to a routine that the resource DLL should call to update
00309 //          the state of a resource after the Online or Offline routine
00310 //          have returned a status of ERROR_IO_PENDING.
00311 //
00312 //      pfnLogEventIn
00313 //          Pointer to a routine that handles the reporting of events from
00314 //          the resource DLL.
00315 //
00316 //      pFunctionTableOut
00317 //          Returns a pointer to the function table defined for the version
00318 //          of the resource DLL interface returned by the resource DLL.
00319 //
00320 //  Return Value:
00321 //      ERROR_SUCCESS
00322 //          The operation was successful.
00323 //
00324 //      ERROR_CLUSTER_RESNAME_NOT_FOUND
00325 //          The resource type name is unknown by this DLL.
00326 //
00327 //      ERROR_REVISION_MISMATCH
00328 //          The version of the cluster service doesn't match the version of
00329 //          the DLL.
00330 //
00331 //      Win32 error code
00332 //          The operation failed.
00333 //
00334 //--
00335 /////////////////////////////////////////////////////////////////////////////
00336 DWORD WINAPI
00337 Startup(
00338       LPCWSTR                         pwszResourceTypeIn
00339     , DWORD                           nMinVersionSupportedIn
00340     , DWORD                           nMaxVersionSupportedIn
00341     , PSET_RESOURCE_STATUS_ROUTINE    pfnSetResourceStatusIn
00342     , PLOG_EVENT_ROUTINE              pfnLogEventIn
00343     , PCLRES_FUNCTION_TABLE *         pFunctionTableOut
00344     )
00345 {
00346     DWORD   sc = ERROR_CLUSTER_RESNAME_NOT_FOUND;
00347
00348     //
00349     // Save the function pointers if they haven't been saved yet.
00350     //
00351
00352     if ( g_pfnLogEvent == NULL )
00353     {
00354         g_pfnLogEvent = pfnLogEventIn;
00355         g_pfnSetResourceStatus = pfnSetResourceStatusIn;
00356     } // if: function pointers specified
00357
00358     //
00359     // Call the resource type-specific Startup routine.
00360     //
00361
00362     if ( NIStringCompareW( pwszResourceTypeIn, RESTYPE_NAME, RTL_NUMBER_OF( RESTYPE_NAME ) ) == 0 )
00363     {
00364         sc = ClipBookServerStartup(
00365                   pwszResourceTypeIn
00366                 , nMinVersionSupportedIn
00367                 , nMaxVersionSupportedIn
00368                 , pfnSetResourceStatusIn
00369                 , pfnLogEventIn
00370                 , pFunctionTableOut
00371                 );
00372     } // if: ClipBook Server resource type
00373
00374     return sc;
00375
00376 } //*** Startup
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcADO/adocomponent.Cpp Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcADO

adocomponent.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: ADOComponent.cpp
00003 //
00004 // Description: Implementation of CADOComponent
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021 #include "stdafx.h"
00022 #include "ADOKB.h"
00023 #include "ADOComponent.h"
00024
00025 //Add the directory that contains msado20.tlb to the include path
00026
00027 #import "D:\Program Files\Common Files\System\ado\msado20.tlb" no_namespace rename("EOF", "adoEOF" )
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CADOComponent
00030
00031 HRESULT CADOComponent::Activate()
00032 {
00033   HRESULT hr = CoGetObjectContext(IID_IObjectContext, (void**)&m_spObjectContext);
00034   if (SUCCEEDED(hr))
00035     return S_OK;
00036   return hr;
00037 }
00038
00039 BOOL CADOComponent::CanBePooled()
00040 {
00041   return TRUE;
00042 }
00043
00044 void CADOComponent::Deactivate()
00045 {
00046   m_spObjectContext.Release();
00047 }
00048
00049
00050 STDMETHODIMP CADOComponent::SimpleQuery(VARIANT * returnval)
00051 {
00052    _RecordsetPtr adoRs;
00053
00054    _bstr_t Source("select au_fname from authors where au_lname = 'White'");
00055    //NOTE: Secure database installations should never have a blank password
00056    // Trusted security is recommended for production systems - this avoids
00057    // having to store the password in the code
00058    _bstr_t Connect("DSN=pubs;Uid=sa;Pwd=;Database=pubs");
00059
00060    try
00061    {
00062       _variant_t InVar;
00063
00064       adoRs.CreateInstance(__uuidof(Recordset));
00065       adoRs->Open( Source,
00066                 Connect,
00067                 adOpenForwardOnly,
00068         adLockReadOnly,
00069         adCmdText);
00070       InVar = adoRs->Fields->GetItem("au_fname")->Value;
00071       VariantClear(returnval);
00072       VariantCopy(returnval, &(InVar.Detach()));
00073
00074       adoRs->Close();
00075    }
00076
00077    catch(_com_error z)
00078    {
00079       if(adoRs)
00080     {
00081          adoRs->Close();
00082          adoRs = NULL;
00083     }
00084
00085     if (m_spObjectContext)
00086       m_spObjectContext->SetAbort();
00087     return z.Error();
00088   }
00089
00090    if (m_spObjectContext)
00091    {
00092     m_spObjectContext->SetComplete();
00093    }
00094
00095    adoRs = NULL;
00096    return S_OK;
00097 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/guids.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

guids.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Note that the GUIDs for CComponentData and CSnapinAbout are different
00014 //  from the ScopeNode project.  The Node GUIDs can stay the same since
00015 //  they are not really COM objects.
00016
00017
00018 #ifndef _PROPPAGE_PROJECT_GUIDS_
00019 #define _PROPPAGE_PROJECT_GUIDS_
00020
00021 // {0cadd2fc-5463-47bc-9187-b40ae2dc14f7}
00022 DEFINE_GUID( CLSID_CComponentData,
00023              0x0cadd2fc, 0x5463, 0x47bc, 0x91, 0x87, 0xb4, 0x0a, 0xe2, 0xdc, 0x14, 0xf7);
00024
00025 // {e72383ab-ae80-43c5-8f83-f85864a4f6ea}
00026 DEFINE_GUID( CLSID_CSnapinAbout,
00027              0xe72383ab, 0xae80, 0x43c5, 0x8f, 0x83, 0xf8, 0x58, 0x64, 0xa4, 0xf6, 0xea);
00028
00029 // {520F23F9-775D-4015-B437-98A24B9D085E}
00030 DEFINE_GUID( CLSID_DeviceNode,
00031              0x520F23f9, 0x775D, 0x4015, 0xB4, 0x37, 0x98, 0xA2, 0x4B, 0x9D, 0x8, 0x5E);
00032
00033 // {520F23FA-775D-4015-B437-98A24B9D085E}
00034 DEFINE_GUID( CLSID_CFolderNode,
00035              0x520F23fA, 0x775D, 0x4015, 0xb4, 0x37, 0x98, 0xA2, 0x4B, 0x9D, 0x8, 0x5E);
00036
00037 // {f0091c49-c869-4941-a81c-c719ad8174cc}
00038 DEFINE_GUID( CLSID_CVirtualFile,
00039              0xf0091c49, 0xc869, 0x4941, 0xa8, 0x1c, 0xc7, 0x19, 0xad, 0x81, 0x74, 0xcc);
00040
00041
00042
00043 #endif //_PROPPAGE_PROJECT_GUIDS_
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/ProgressDlg.cpp Source File

  • Multimedia
  • wia
  • GetImage

ProgressDlg.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #include "stdafx.h"
00008 #include "resource.h"
00009
00010 #include "ProgressDlg.h"
00011
00012 namespace WiaWrap
00013 {
00014
00015 //////////////////////////////////////////////////////////////////////////
00016 //
00017 // CProgressDlg::CProgressDlg
00018 //
00019
00020 CProgressDlg::CProgressDlg(HWND hWndParent)
00021 {
00022     m_cRef = 0;
00023
00024   m_hDlg       = NULL;
00025   m_hWndParent = hWndParent;
00026   m_bCancelled = FALSE;
00027
00028     m_hInitDlg = CreateEvent(NULL, FALSE, FALSE, NULL);
00029
00030     if (m_hInitDlg != NULL)
00031     {
00032         // Create the progress dialog in a separate thread so that it
00033         // remains responsive
00034
00035       DWORD dwThreadId;
00036
00037       HANDLE hThread = CreateThread(
00038         NULL,
00039         0,
00040         ThreadProc,
00041         this,
00042         0,
00043         &dwThreadId
00044       );
00045
00046         // Wait until the progress dialog is created and ready to process
00047         // messages. During creation, the new thread will send window messages
00048         // to this thread, and this will cause a deadlock if we use
00049         // WaitForSingleObject instead of MsgWaitForMultipleObjects
00050
00051         if (hThread != NULL)
00052         {
00053             while (MsgWaitForMultipleObjects(1, &m_hInitDlg, FALSE, INFINITE, QS_ALLINPUT | QS_ALLPOSTMESSAGE) == WAIT_OBJECT_0 + 1)
00054             {
00055                 MSG msg;
00056
00057                 while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
00058                 {
00059                     TranslateMessage(&msg);
00060                     DispatchMessage(&msg);
00061                 }
00062             }
00063
00064             CloseHandle(hThread);
00065         }
00066
00067         CloseHandle(m_hInitDlg);
00068     }
00069 }
00070
00071 //////////////////////////////////////////////////////////////////////////
00072 //
00073 // ~CProgressDlg::CProgressDlg
00074 //
00075
00076 CProgressDlg::~CProgressDlg()
00077 {
00078     EndDialog(m_hDlg, IDCLOSE);
00079 }
00080
00081 //////////////////////////////////////////////////////////////////////////
00082 //
00083 // CProgressDlg::QueryInterface
00084 //
00085
00086 STDMETHODIMP CProgressDlg::QueryInterface(REFIID iid, LPVOID *ppvObj)
00087 {
00088     if (ppvObj == NULL)
00089     {
00090       return E_POINTER;
00091     }
00092
00093     if (iid == IID_IUnknown)
00094     {
00095       *ppvObj = (IUnknown *) this;
00096     }
00097     else
00098     {
00099         *ppvObj = NULL;
00100         return E_NOINTERFACE;
00101     }
00102
00103   AddRef();
00104     return S_OK;
00105 }
00106
00107 //////////////////////////////////////////////////////////////////////////
00108 //
00109 // CProgressDlg::AddRef
00110 //
00111
00112 STDMETHODIMP_(ULONG) CProgressDlg::AddRef()
00113 {
00114     return InterlockedIncrement(&m_cRef);
00115 }
00116
00117 //////////////////////////////////////////////////////////////////////////
00118 //
00119 // CProgressDlg::Release
00120 //
00121
00122 STDMETHODIMP_(ULONG) CProgressDlg::Release()
00123 {
00124     LONG cRef = InterlockedDecrement(&m_cRef);
00125
00126     if (cRef == 0)
00127     {
00128         delete this;
00129     }
00130
00131     return cRef;
00132 }
00133
00134 //////////////////////////////////////////////////////////////////////////
00135 //
00136 // CProgressDlg::Cancelled
00137 //
00138
00139 BOOL CProgressDlg::Cancelled() const
00140 {
00141     return m_bCancelled;
00142 }
00143
00144 //////////////////////////////////////////////////////////////////////////
00145 //
00146 // CProgressDlg::SetTitle
00147 //
00148
00149 VOID CProgressDlg::SetTitle(PCTSTR pszTitle)
00150 {
00151   SetWindowText(m_hDlg, pszTitle);
00152 }
00153
00154 //////////////////////////////////////////////////////////////////////////
00155 //
00156 // CProgressDlg::SetMessage
00157 //
00158
00159 VOID CProgressDlg::SetMessage(PCTSTR pszMessage)
00160 {
00161     SetDlgItemText(m_hDlg, IDC_MESSAGE, pszMessage);
00162 }
00163
00164 //////////////////////////////////////////////////////////////////////////
00165 //
00166 // CProgressDlg::SetPercent
00167 //
00168
00169 VOID CProgressDlg::SetPercent(UINT nPercent)
00170 {
00171   SendDlgItemMessage(m_hDlg, IDC_PROGRESS_BAR, PBM_SETPOS, (WPARAM) nPercent, 0);
00172 }
00173
00174 //////////////////////////////////////////////////////////////////////////
00175 //
00176 // CProgressDlg::ThreadProc
00177 //
00178
00179 DWORD WINAPI CProgressDlg::ThreadProc(PVOID pParameter)
00180 {
00181     CProgressDlg *that = (CProgressDlg *) pParameter;
00182
00183     INT_PTR nResult = DialogBoxParam(
00184         g_hInstance,
00185         MAKEINTRESOURCE(IDD_PROGRESS),
00186         that->m_hWndParent,
00187         DialogProc,
00188         (LPARAM) that
00189     );
00190
00191     return (DWORD) nResult;
00192 }
00193
00194 //////////////////////////////////////////////////////////////////////////
00195 //
00196 // CProgressDlg::DialogProc
00197 //
00198
00199 INT_PTR
00200 CALLBACK
00201 CProgressDlg::DialogProc(
00202     HWND   hDlg,
00203     UINT   uMsg,
00204     WPARAM wParam,
00205     LPARAM lParam
00206 )
00207 {
00208     switch (uMsg)
00209     {
00210     case WM_INITDIALOG:
00211     {
00212             // Retrieve and store the "this" pointer
00213
00214       CProgressDlg *that = (CProgressDlg *) lParam;
00215
00216       SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR) that);
00217
00218       that->m_hDlg = hDlg;
00219
00220             // Initialize progress bar to the range 0 to 100
00221
00222       SendDlgItemMessage(hDlg, IDC_PROGRESS_BAR, PBM_SETRANGE32, (WPARAM) 0, (LPARAM) 100);
00223
00224             // Signal the main thread that we are ready
00225
00226             SetEvent(that->m_hInitDlg);
00227
00228       return TRUE;
00229     }
00230
00231     case WM_COMMAND:
00232     {
00233       switch (LOWORD(wParam))
00234       {
00235         case IDCANCEL:
00236         {
00237                     // If the user presses the cancel button, set the m_bCancelled flag.
00238
00239           CProgressDlg *that = (CProgressDlg *) GetWindowLongPtr(hDlg, DWLP_USER);
00240
00241           InterlockedIncrement(&that->m_bCancelled);
00242
00243                     // The cancel operation will probably take some time, so
00244                     // change the cancel button text to "wait...", so that
00245                     // the user will see the cancel command is received and
00246                     // is being processed
00247
00248           TCHAR szWait[DEFAULT_STRING_SIZE] = _T("...");
00249
00250           LoadString(g_hInstance, IDS_WAIT, szWait, COUNTOF(szWait));
00251
00252             SetDlgItemText(hDlg, IDCANCEL, szWait);
00253
00254           return TRUE;
00255         }
00256       }
00257
00258       break;
00259     }
00260     }
00261
00262     return FALSE;
00263 }
00264
00265 }; // namespace WiaWrap
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/FileRepAsyncPipe/FileRepClient.idl Source File

  • NetDS
  • RPC
  • FileRep
  • FileRepAsyncPipe

FileRepClient.idl

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005
00006     FILE: FileRepClient.idl
00007
00008     PURPOSE:  Defines the interface for the client system service.
00009
00010 */
00011
00012 [
00013     uuid(fe7f2eda-5da1-4041-928c-d2534d3fa129),
00014     pointer_default(ref),
00015     version(1.0)
00016 ]
00017
00018 interface FileRepClient {
00019
00020 // Declare the string data type. This should work for UNICODE.
00021 #ifdef _UNICODE
00022     typedef wchar_t * STR;
00023 #else
00024     typedef unsigned char * STR;
00025 #endif
00026
00027     /*
00028         A replication request is made by making this RPC.  With ServerName
00029   specifying the source machine for replication, RemoteFileName
00030   specifying the source file for replication, and LocalFileName
00031   the name for the file on the local machine.  A thread is forked
00032   to handle the actual file replication and an error encountered by
00033   the thread will not produce the error return status.
00034     */
00035     void RequestFile([in] handle_t hFileRepClient,
00036          [in, ref, string] STR ServerName,
00037          [in, ref, string] STR RemoteFileName,
00038          [in, ref, string] STR LocalFileName);
00039 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vc/myclassfactory.cpp Source File

  • Dataaccess
  • osp
  • vc

myclassfactory.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample OLEDB Simple Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation.  All Rights Reserved.
00004 //
00005 // module MyClassFactory.cpp | The module contains the DLL Entry and Exit
00006 // points, plus the OLE ClassFactory class.
00007 //
00008 //
00009
00010
00011 ////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 ////////////////////////////////////////////////////////
00015 #include "Common.h"
00016 #include "MyClassFactory.h"
00017
00018
00019 // Added GUID constant for the sample object:
00020 const GUID CLSID_ospsampc = {0x1e79b2c1,0x77b,0x11d1,{0xb3,0xae,0x0,0xaa,0x0,0xc1,0xa9,0x24}};
00021
00022 ////////////////////////////////////////////////////////
00023 // Globals
00024 //
00025 ////////////////////////////////////////////////////////
00026 LONG g_cObj = 0L;           // # of outstanding objects
00027 LONG g_cLock = 0L;            // # of explicit locks set
00028 DWORD g_cAttachedProcesses = 0L;    // # of attached processes
00029 HINSTANCE g_hInstance = NULL;
00030
00031
00032 REGENTRY rgRegInfo[] =
00033 {
00034   //SampleOSProvider
00035     { HKEY_CLASSES_ROOT, "ospsampc",      NULL, "Microsoft Sample OLE DB Simple Provider DLL (C++)"             },
00036
00037   //CLSID
00038     { HKEY_CLASSES_ROOT, "ospsampc\\Clsid",   NULL, "{1E79B2C1-077B-11d1-B3AE-00AA00C1A924}"                  },
00039     { HKEY_CLASSES_ROOT, "CLSID\\{1E79B2C1-077B-11d1-B3AE-00AA00C1A924}",             NULL,       "ospsampc"  },
00040     { HKEY_CLASSES_ROOT, "CLSID\\{1E79B2C1-077B-11d1-B3AE-00AA00C1A924}\\ProgID",         NULL,       "ospsampc"  },
00041     { HKEY_CLASSES_ROOT, "CLSID\\{1E79B2C1-077B-11d1-B3AE-00AA00C1A924}\\VersionIndependentProgID", NULL,       "ospsampc"  },
00042     { HKEY_CLASSES_ROOT, "CLSID\\{1E79B2C1-077B-11d1-B3AE-00AA00C1A924}\\InprocServer32",     "ThreadingModel", "Both"    },
00043     { HKEY_CLASSES_ROOT, "CLSID\\{1E79B2C1-077B-11d1-B3AE-00AA00C1A924}\\InprocServer32",     NULL,       "%s"    },
00044 };
00045
00046
00047 ////////////////////////////////////////////////////////
00048 // MyClassFactory
00049 //
00050 ////////////////////////////////////////////////////////
00051 MyClassFactory::MyClassFactory()
00052 {
00053     m_cRef = 0;
00054   InterlockedIncrement(&g_cObj);
00055 }
00056
00057 MyClassFactory::~MyClassFactory()
00058 {
00059   InterlockedDecrement(&g_cObj);
00060 }
00061
00062
00063 STDMETHODIMP MyClassFactory::QueryInterface(REFIID  riid, void** ppv)
00064 {
00065     if(ppv == NULL)
00066         return E_INVALIDARG;
00067
00068     // Do we support this interface?
00069     if (riid == IID_IUnknown ||
00070         riid == IID_IClassFactory)
00071     {
00072     *ppv = this;
00073   }
00074     else
00075   {
00076     *ppv = NULL;
00077         return E_NOINTERFACE;
00078   }
00079
00080     if ((IUnknown*)*ppv)
00081   {
00082     ((IUnknown*)*ppv)->AddRef();
00083   }
00084     return S_OK;
00085 }
00086
00087
00088 STDMETHODIMP MyClassFactory::CreateInstance(IUnknown* pUnkOuter, REFIID riid, void** ppv)
00089 {
00090   HRESULT hr = S_OK;
00091   MyDataSource* pMyDataSource = NULL;
00092
00093     if(ppv == NULL)
00094         return E_INVALIDARG;
00095
00096     // In case we fail, we need to zero output arguments
00097     *ppv = NULL;
00098
00099     // If we're given a controlling IUnknown, it must ask for IUnknown.
00100     // Otherwise, the caller will end up getting a pointer to their pUnkOuter
00101     // instead of to the new object we create and will have no way of getting
00102     // back to this new object, so they won't be able to free it.  Bad!
00103     if (pUnkOuter && riid != IID_IUnknown)
00104         return E_NOINTERFACE;
00105
00106     //Create a MyDataSource object
00107    if(!(pMyDataSource = new MyDataSource()))
00108     {
00109     hr = E_OUTOFMEMORY;
00110     goto CLEANUP;
00111   }
00112
00113     // Initialize it
00114   pMyDataSource->AddRef();
00115   if(FAILED(hr = pMyDataSource->Init()))
00116     goto CLEANUP;
00117
00118   //Obtain correct riid
00119   hr = pMyDataSource->QueryInterface(riid, ppv);
00120
00121 CLEANUP:
00122   if((pMyDataSource)) { (pMyDataSource)->Release(); (pMyDataSource) = NULL; }
00123   return hr;
00124 }
00125
00126
00127 STDMETHODIMP MyClassFactory::LockServer(BOOL fLock)
00128 {
00129     if (fLock)
00130         InterlockedIncrement( &g_cLock );
00131     else
00132         InterlockedDecrement( &g_cLock );
00133
00134     return NOERROR;
00135 }
00136
00137
00138
00139 ////////////////////////////////////////////////////////
00140 // DllMain
00141 //
00142 ////////////////////////////////////////////////////////
00143 BOOL WINAPI DllMain
00144     (
00145     HINSTANCE   hInstDLL,   //@parm IN | Application Instance Handle
00146     DWORD       fdwReason,  //@parm IN | Indicated Process or Thread activity
00147     LPVOID      lpvReserved //@parm IN | Reserved...
00148     )
00149 {
00150     BOOL  fRetVal = FALSE;
00151
00152     switch(fdwReason)
00153     {
00154     case DLL_PROCESS_ATTACH:
00155
00156       // Assume successfully initialized
00157       fRetVal = TRUE;
00158
00159       // Do one-time initialization when first process attaches
00160       if (!g_cAttachedProcesses)
00161       {
00162         g_hInstance = hInstDLL;
00163       }
00164
00165       // Do per-process initialization here...
00166
00167       // Remember that another process successfully attached
00168       g_cAttachedProcesses++;
00169       break;
00170
00171     case DLL_PROCESS_DETACH:
00172       // Clean up when the last process is going away
00173       if (g_cAttachedProcesses == 1)
00174       {
00175       }
00176
00177       // Do per-process clean up here...
00178
00179       // Remember that a process has detached
00180       g_cAttachedProcesses--;
00181       break;
00182
00183     case DLL_THREAD_ATTACH:
00184       break;
00185
00186     case DLL_THREAD_DETACH:
00187       break;
00188     }
00189
00190     return fRetVal;
00191 }
00192
00193
00194
00195 ////////////////////////////////////////////////////////
00196 // DllGetClassObject
00197 //
00198 ////////////////////////////////////////////////////////
00199 HRESULT CALLBACK DllGetClassObject
00200     (
00201     REFCLSID    rclsid, //@parm IN | CLSID of the object class to be loaded
00202     REFIID      riid,   //@parm IN | Interface on object to be instantiated
00203     LPVOID *    ppvObj  //@parm OUT | Pointer to interface that was instantiated
00204     )
00205 {
00206     MyClassFactory * pClassFactory;
00207   HRESULT         hr;
00208
00209     // Check for valid ppvObj pointer
00210     if (!ppvObj)
00211         return E_INVALIDARG;
00212
00213     // In case we fail, we need to zero output arguments
00214     *ppvObj = NULL;
00215
00216     // We only service CLSID_SampleOSProvider
00217     if (rclsid != CLSID_ospsampc)
00218         return CLASS_E_CLASSNOTAVAILABLE;
00219
00220     // We only support the IUnknown and IClassFactory interfaces
00221     if (riid != IID_IUnknown &&
00222         riid != IID_IClassFactory)
00223         return E_NOINTERFACE;
00224
00225     // Create our ClassFactory object
00226     if(!(pClassFactory = new MyClassFactory()))
00227         return E_OUTOFMEMORY;
00228
00229     // Get the desired interface on this object
00230     hr = pClassFactory->QueryInterface( riid, ppvObj );
00231     if(FAILED(hr))
00232         delete pClassFactory;
00233
00234   return hr;
00235 }
00236
00237
00238 ////////////////////////////////////////////////////////
00239 // DllCanUnloadNow
00240 //
00241 ////////////////////////////////////////////////////////
00242 STDAPI DllCanUnloadNow( void )
00243 {
00244     if (!g_cObj && !g_cLock)
00245         return S_OK;
00246     else
00247         return S_FALSE;
00248 }
00249
00250
00251
00252 ////////////////////////////////////////////////////////
00253 // DllUnregisterServer
00254 //
00255 ////////////////////////////////////////////////////////
00256 STDAPI DllUnregisterServer()
00257 {
00258     int     iNumErrors = 0;
00259
00260     // Delete all table entries.  Loop in reverse order, since they
00261     // are entered in a basic-to-complex order.
00262     // We cannot delete a key that has subkeys.
00263     // Ignore errors.
00264     for (int i=NUMELEM(rgRegInfo)-1; i>=0; i--)
00265     {
00266     if(FAILED(DelRegEntry(&rgRegInfo[i])))
00267       iNumErrors++;
00268   }
00269
00270     return iNumErrors ? E_FAIL : S_OK;
00271 }
00272
00273
00274 ////////////////////////////////////////////////////////
00275 // DllRegisterServer
00276 //
00277 ////////////////////////////////////////////////////////
00278 STDAPI DllRegisterServer()
00279 {
00280   HRESULT   hr;
00281     HMODULE     hModule;
00282     CHAR    szBuffer[MAX_NAME_LEN];
00283   CHAR    szFullFileName[MAX_PATH+1];
00284
00285     // Get the full path name for this DLL.
00286     if (NULL == (hModule = GetModuleHandle( "ospsampc" )))
00287         return E_FAIL;
00288     if (0 == GetModuleFileName( hModule, szFullFileName, MAX_PATH+1))
00289         return E_FAIL;
00290
00291     // Make a clean start
00292     DllUnregisterServer();
00293
00294     // Loop through s_rgRegInfo, and put everything in it.
00295     // Every entry is based on HKEY_CLASSES_ROOT.
00296     for (int i=0; i<NUMELEM(rgRegInfo); i++)
00297     {
00298         // Fill in any "%s" arguments with the name of this DLL.
00299         wsprintf(szBuffer, rgRegInfo[i].szValue, szFullFileName );
00300     rgRegInfo[i].szValue = szBuffer;
00301
00302     //Set the Registry Entry for this Key
00303         if(FAILED(hr = SetRegEntry(&rgRegInfo[i])))
00304       goto CLEANUP;
00305   }
00306
00307 CLEANUP:
00308     return hr;
00309 }
00310
00311
00312
00313
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/MainFrm.Cpp Source File

  • NetDS
  • fax
  • PrintSdi

MainFrm.Cpp

Go to the documentation of this file.
00001 // MainFrm.cpp : implementation of the CMainFrame class
00002 //
00003
00004 #include "stdafx.h"
00005 #include "PrintSDI.h"
00006
00007 #include "MainFrm.h"
00008
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014
00015 /////////////////////////////////////////////////////////////////////////////
00016 // CMainFrame
00017
00018 IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
00019
00020 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
00021   //{{AFX_MSG_MAP(CMainFrame)
00022     // NOTE - the ClassWizard will add and remove mapping macros here.
00023     //    DO NOT EDIT what you see in these blocks of generated code !
00024   //}}AFX_MSG_MAP
00025 END_MESSAGE_MAP()
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CMainFrame construction/destruction
00029
00030 CMainFrame::CMainFrame()
00031 {
00032   // TODO: add member initialization code here
00033
00034 }
00035
00036 CMainFrame::~CMainFrame()
00037 {
00038 }
00039
00040 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
00041 {
00042   // TODO: Modify the Window class or styles here by modifying
00043   //  the CREATESTRUCT cs
00044
00045   return CFrameWnd::PreCreateWindow(cs);
00046 }
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049 // CMainFrame diagnostics
00050
00051 #ifdef _DEBUG
00052 void CMainFrame::AssertValid() const
00053 {
00054   CFrameWnd::AssertValid();
00055 }
00056
00057 void CMainFrame::Dump(CDumpContext& dc) const
00058 {
00059   CFrameWnd::Dump(dc);
00060 }
00061
00062 #endif //_DEBUG
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // CMainFrame message handlers
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/HalfIME/HalfIME.h Source File

  • WinUI
  • Input
  • Ime
  • HalfIME

HalfIME.h

Go to the documentation of this file.
00001 #define MAXROW          12
00002 #define MAXCOL          60
00003 #define FIRSTROW         0
00004 #define FIRSTCOL         0
00005 #define LASTROW         (MAXROW-1)
00006 #define LASTCOL         (MAXCOL-1)
00007 #define TABSTOP          4
00008
00009 #define ID_ICON         1
00010 #define ID_MENU         1
00011 #define IDS_CLASS       1
00012 #define IDS_TITLE       2
00013
00014 #define IDC_CLEAR               1
00015 #define IDC_ANSIFILL            2
00016 #define IDC_DBCSFILL            3
00017 #define IDC_DEFAULT_POS         4
00018 #define IDC_NEARCARET_POS       5
00019 #define IDC_PREFER_POS          6
00020 #define IDC_OPENIME             7
00021 #define IDC_CLOSEIME            8
00022
00023
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/xmldsig/CertGetKey.c Source File

  • Security
  • capicom
  • c_sharp
  • xmldsig

CertGetKey.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <windows.h>
00003 #include <wincrypt.h>
00004
00005 typedef struct  {
00006     BLOBHEADER    blob;
00007     RSAPUBKEY     rsa;
00008 } KEY_HEADER;
00009
00010 void memrev(LPBYTE pb, DWORD cb)
00011 {
00012     BYTE    b;
00013     DWORD   i;
00014     LPBYTE  pbEnd = pb+cb-1;
00015
00016     for (i=0; i<cb/2; i++, pb++, pbEnd--) {
00017         b = *pb;
00018         *pb = *pbEnd;
00019         *pbEnd = b;
00020     }
00021 }
00022
00023 // Free the allocated blob array
00024 __declspec( dllexport )
00025 void UnmanagedArrayFree (BYTE * ppbKeyBlob) // [in] memory address to free
00026 {
00027   free(ppbKeyBlob);
00028 }
00029
00030 // Export public-key information given a certificate file
00031 __declspec( dllexport )
00032 BOOL PublicKeyBlobFromCertificateRawData (BYTE * rgbRawData,
00033                      // [in] parameter holding the raw data array size
00034                      int cbRawData,
00035                      // [out] parameter holding the blob byte array
00036                      BYTE ** ppbKeyBlob,
00037                      // [out] parameter holding the blob array size
00038                      UINT * pKeyBlobSize)
00039 {
00040   PCCERT_CONTEXT     pCert = NULL;
00041     DWORD              dwEncodingType = X509_ASN_ENCODING|PKCS_7_ASN_ENCODING;
00042
00043   HCRYPTPROV hCryptProv = 0;
00044   HCRYPTKEY hKey = 0;
00045
00046   DWORD dwBufferLen = 0;
00047     DWORD               dwBlobLen = 0;
00048
00049   BOOL retValue = TRUE;
00050
00051     // Create certificate context
00052     pCert = CertCreateCertificateContext(
00053                             dwEncodingType,
00054               (unsigned const char *) rgbRawData,
00055               cbRawData);
00056
00057   if (pCert == NULL) {
00058     retValue = FALSE;
00059     goto Cleanup;
00060   }
00061
00062   // Acquire a cryptographic context
00063   if (!CryptAcquireContext(&hCryptProv,
00064         NULL,
00065         NULL,
00066         PROV_RSA_FULL,
00067         0)) {
00068     if (!CryptAcquireContext(&hCryptProv,
00069         NULL,
00070         NULL,
00071         PROV_RSA_FULL,
00072         CRYPT_NEWKEYSET)) {
00073       retValue = FALSE;
00074       goto Cleanup;
00075     }
00076   }
00077
00078   // Verify the date validity
00079   if (CertVerifyTimeValidity(
00080       NULL,
00081       pCert->pCertInfo) != 0) {
00082     retValue = FALSE;
00083     goto Cleanup;
00084   }
00085
00086   // Maybe should have some validation of the certificate in case we can do it ...
00087
00088   // Import the public key information
00089   if (!CryptImportPublicKeyInfoEx(
00090       hCryptProv,
00091       dwEncodingType,
00092       &(pCert->pCertInfo->SubjectPublicKeyInfo),
00093       0,
00094       0,
00095       NULL,
00096       &hKey)) {
00097     HRESULT hr = GetLastError();
00098     retValue = FALSE;
00099     goto Cleanup;
00100   }
00101
00102   // Export the key into a key blob
00103   if (!CryptExportKey(
00104       hKey,
00105       0,
00106       PUBLICKEYBLOB,
00107       0,
00108       NULL,
00109       &dwBlobLen)) {
00110     retValue = FALSE;
00111     goto Cleanup;
00112     }
00113
00114   *pKeyBlobSize = dwBlobLen;
00115     *ppbKeyBlob = (LPBYTE) malloc(dwBlobLen * sizeof(BYTE));
00116     if (*ppbKeyBlob == NULL) {
00117     retValue = FALSE;
00118     goto Cleanup;
00119     }
00120
00121     if (!CryptExportKey(
00122       hKey,
00123       0,
00124       PUBLICKEYBLOB,
00125       0,
00126       *ppbKeyBlob,
00127       &dwBlobLen)) {
00128     retValue = FALSE;
00129     goto Cleanup;
00130     }
00131
00132 Cleanup:
00133   if (hKey)
00134     CryptDestroyKey(hKey);
00135
00136   if (pCert)
00137     CertFreeCertificateContext(pCert);
00138
00139   if (hCryptProv)
00140     CryptReleaseContext(hCryptProv, 0);
00141
00142   return retValue;
00143 }
00144
00145 // Export public-key information given a certificate file
00146 __declspec( dllexport )
00147 void ImportPublicKeyBlob (
00148              // [in] parameter holding the blob byte array
00149              BYTE * pbKeyBlob,
00150              // [in] parameter holding the blob array size
00151              int KeyBlobSize,
00152              // [out] parameter holding the exponent array size
00153              UINT * pExponent,
00154                // [out] parameter holding the modulus byte array
00155              BYTE ** ppbModulus,
00156              // [out] parameter holding the modulus array size
00157              UINT * pModulusSize)
00158 {
00159     KEY_HEADER * pKeyInfo = (KEY_HEADER *) pbKeyBlob;
00160     DWORD cb = (pKeyInfo->rsa.bitlen/8);
00161     LPBYTE pbX = pbKeyBlob + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY);
00162
00163     //  Exponent
00164     *pExponent = pKeyInfo->rsa.pubexp;
00165
00166     // Modulus
00167   *pModulusSize = cb;
00168   *ppbModulus = (LPBYTE) malloc(cb * sizeof(BYTE));
00169     memcpy(*ppbModulus, pbX, cb);
00170   // We need to go back to big endian
00171   memrev(*ppbModulus, cb);
00172 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/mfc_tree/XMLTreeDlg.cpp Source File

  • Web
  • xml
  • mfc_tree

XMLTreeDlg.cpp

Go to the documentation of this file.
00001 //=--------------------------------------------------------------------------=
00002 //  (C) Copyright 1996 - 2000 Microsoft Corporation. All Rights Reserved.
00003 //=--------------------------------------------------------------------------=
00004 // XMLTreeDlg.cpp : implementation file
00005 //
00006
00007 #include "stdafx.h"
00008 #include "XMLTree.h"
00009 #include "XMLTreeDlg.h"
00010
00011 #ifdef _DEBUG
00012 #define new DEBUG_NEW
00013 #undef THIS_FILE
00014 static char THIS_FILE[] = __FILE__;
00015 #endif
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CAboutDlg dialog used for App About
00019
00020 class CAboutDlg : public CDialog
00021 {
00022 public:
00023   CAboutDlg();
00024
00025 // Dialog Data
00026   //{{AFX_DATA(CAboutDlg)
00027   enum { IDD = IDD_ABOUTBOX };
00028   //}}AFX_DATA
00029
00030   // ClassWizard generated virtual function overrides
00031   //{{AFX_VIRTUAL(CAboutDlg)
00032   protected:
00033   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00034   //}}AFX_VIRTUAL
00035
00036 // Implementation
00037 protected:
00038   //{{AFX_MSG(CAboutDlg)
00039   //}}AFX_MSG
00040   DECLARE_MESSAGE_MAP()
00041 };
00042
00043 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00044 {
00045   //{{AFX_DATA_INIT(CAboutDlg)
00046   //}}AFX_DATA_INIT
00047 }
00048
00049 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00050 {
00051   CDialog::DoDataExchange(pDX);
00052   //{{AFX_DATA_MAP(CAboutDlg)
00053   //}}AFX_DATA_MAP
00054 }
00055
00056 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00057   //{{AFX_MSG_MAP(CAboutDlg)
00058     // No message handlers
00059   //}}AFX_MSG_MAP
00060 END_MESSAGE_MAP()
00061
00062 /////////////////////////////////////////////////////////////////////////////
00063 // CXMLTreeDlg dialog
00064
00065 CXMLTreeDlg::CXMLTreeDlg(CWnd* pParent /*=NULL*/)
00066   : CDialog(CXMLTreeDlg::IDD, pParent)
00067 {
00068   //{{AFX_DATA_INIT(CXMLTreeDlg)
00069   m_filename = _T("");
00070   m_debug = _T("Enter a URL to load or click the open button to find an XML file to open.");
00071   //}}AFX_DATA_INIT
00072   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
00073   m_hIcon = AfxGetApp()->LoadIcon(IDR_XMLTREE);
00074 }
00075
00076 void CXMLTreeDlg::DoDataExchange(CDataExchange* pDX)
00077 {
00078   CDialog::DoDataExchange(pDX);
00079   //{{AFX_DATA_MAP(CXMLTreeDlg)
00080   DDX_Control(pDX, IDC_TREE, m_tree);
00081   DDX_Text(pDX, IDC_FILENAME, m_filename);
00082   DDX_Text(pDX, IDC_DEBUG, m_debug);
00083   //}}AFX_DATA_MAP
00084 }
00085
00086 BEGIN_MESSAGE_MAP(CXMLTreeDlg, CDialog)
00087   //{{AFX_MSG_MAP(CXMLTreeDlg)
00088   ON_WM_SYSCOMMAND()
00089   ON_WM_PAINT()
00090   ON_WM_QUERYDRAGICON()
00091   ON_BN_CLICKED(IDC_LOAD, OnLoad)
00092   ON_EN_CHANGE(IDC_FILENAME, OnChangeFilename)
00093   ON_BN_CLICKED(IDC_OPEN, OnOpen)
00094   //}}AFX_MSG_MAP
00095 END_MESSAGE_MAP()
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // CXMLTreeDlg message handlers
00099
00100 BOOL CXMLTreeDlg::OnInitDialog()
00101 {
00102   CDialog::OnInitDialog();
00103
00104   // Add "About..." menu item to system menu.
00105
00106   // IDM_ABOUTBOX must be in the system command range.
00107   ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
00108   ASSERT(IDM_ABOUTBOX < 0xF000);
00109
00110   CMenu* pSysMenu = GetSystemMenu(FALSE);
00111   if (pSysMenu != NULL)
00112   {
00113     CString strAboutMenu;
00114     strAboutMenu.LoadString(IDS_ABOUTBOX);
00115     if (!strAboutMenu.IsEmpty())
00116     {
00117       pSysMenu->AppendMenu(MF_SEPARATOR);
00118       pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
00119     }
00120   }
00121
00122   // Set the icon for this dialog.  The framework does this automatically
00123   //  when the application's main window is not a dialog
00124   SetIcon(m_hIcon, TRUE);     // Set big icon
00125   SetIcon(m_hIcon, FALSE);    // Set small icon
00126
00127   // TODO: Add extra initialization here
00128
00129   m_imageList.Create(IDB_TREEICON, 16, 4, RGB( 255, 255, 255 ));
00130   m_tree.SetImageList( &m_imageList, TVSIL_NORMAL );
00131
00132   return TRUE;  // return TRUE  unless you set the focus to a control
00133 }
00134
00135 void CXMLTreeDlg::OnSysCommand(UINT nID, LPARAM lParam)
00136 {
00137   if ((nID & 0xFFF0) == IDM_ABOUTBOX)
00138   {
00139     CAboutDlg dlgAbout;
00140     dlgAbout.DoModal();
00141   }
00142   else
00143   {
00144     CDialog::OnSysCommand(nID, lParam);
00145   }
00146 }
00147
00148 // If you add a minimize button to your dialog, you will need the code below
00149 //  to draw the icon.  For MFC applications using the document/view model,
00150 //  this is automatically done for you by the framework.
00151
00152 void CXMLTreeDlg::OnPaint()
00153 {
00154   if (IsIconic())
00155   {
00156     CPaintDC dc(this); // device context for painting
00157
00158     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00159
00160     // Center icon in client rectangle
00161     int cxIcon = GetSystemMetrics(SM_CXICON);
00162     int cyIcon = GetSystemMetrics(SM_CYICON);
00163     CRect rect;
00164     GetClientRect(&rect);
00165     int x = (rect.Width() - cxIcon + 1) / 2;
00166     int y = (rect.Height() - cyIcon + 1) / 2;
00167
00168     // Draw the icon
00169     dc.DrawIcon(x, y, m_hIcon);
00170   }
00171   else
00172   {
00173     CDialog::OnPaint();
00174   }
00175 }
00176
00177 // The system calls this to obtain the cursor to display while the user drags
00178 //  the minimized window.
00179 HCURSOR CXMLTreeDlg::OnQueryDragIcon()
00180 {
00181   return (HCURSOR) m_hIcon;
00182 }
00183
00184 void CXMLTreeDlg::OnLoad()
00185 {
00186     GetDlgItemText(IDC_FILENAME, m_filename);
00187     if (0 == m_filename.GetLength())
00188     {
00189         OnOpen();
00190     }
00191     else
00192     {
00193         LoadXML(m_filename);
00194     }
00195 }
00196
00197 int CXMLTreeDlg::LoadXML(CString filename)
00198 {
00199   MSXML::IXMLDOMDocument    *pDoc        = NULL;
00200   MSXML::IXMLDOMParseError  *pParsingErr = NULL;
00201   MSXML::IXMLDOMElement   *element     = NULL;
00202   MSXML::IXMLDOMNodeList    *childs      = NULL;
00203   MSXML::IXMLDOMNode      *node        = NULL;
00204   HTREEITEM ht;
00205
00206   BSTR  bstr = NULL;
00207   HRESULT hr;
00208     int     rc = 0;
00209   char msg[500];
00210
00211   m_tree.DeleteAllItems();
00212
00213   m_debug = "Loading " + filename;
00214   UpdateData(FALSE);
00215     UpdateWindow();
00216
00217   hr = CoInitialize(NULL);
00218   if(!SUCCEEDED(hr))
00219     return 0;
00220
00221   hr = CoCreateInstance (MSXML::CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
00222               MSXML::IID_IXMLDOMDocument, (LPVOID *)&pDoc);
00223   if(!pDoc)
00224     {
00225         m_debug = "Error co-creating IXMLDOMDocument";
00226         goto cleanup;
00227     }
00228
00229     pDoc->put_async(VARIANT_FALSE);
00230     bstr = filename.AllocSysString();
00231   hr = pDoc->load (bstr);
00232     SysFreeString(bstr);
00233
00234   if(!hr)
00235   {
00236     long line, linePos;
00237     BSTR reason = NULL;
00238
00239     pDoc->get_parseError(&pParsingErr);
00240
00241       pParsingErr->get_line(&line);
00242     pParsingErr->get_linepos(&linePos);
00243     pParsingErr->get_reason(&reason);
00244     pParsingErr->get_errorCode(&hr);
00245
00246     sprintf(msg, "Error 0x%.8X on line %d, position %d\r\n", hr, line, linePos);
00247
00248     m_debug = reason;
00249     m_debug += CString(msg);
00250
00251         SysFreeString(reason);
00252   }
00253     else
00254     {
00255         m_debug = "Building Tree View...";
00256       UpdateData(FALSE);
00257         UpdateWindow();
00258
00259       pDoc->get_documentElement(&element);
00260
00261       ht = m_tree.InsertItem("#document",0,0,TVI_ROOT,TVI_LAST);
00262
00263       int count = MakeTree(element,ht);
00264
00265       m_tree.Expand(ht,TVE_EXPAND);
00266       ht = m_tree.GetChildItem( ht );
00267       m_tree.Expand(ht,TVE_EXPAND);
00268         rc = 1;
00269
00270     sprintf(msg, "Loaded %d XML nodes.", count);
00271         m_debug = msg;
00272       UpdateData(FALSE);
00273         UpdateWindow();
00274     }
00275
00276 cleanup:
00277     UpdateData(FALSE);
00278   return rc;
00279 }
00280
00281
00282 int CXMLTreeDlg::MakeTree(MSXML::IXMLDOMElement *node, HTREEITEM ht)
00283 {
00284   MSXML::IXMLDOMNodeList  *childs    = NULL;
00285   MSXML::IXMLDOMNode    *childnode = NULL;
00286
00287   BSTR        s = NULL;
00288   long        i;
00289   HTREEITEM ht2;
00290
00291     // Note this builds the entire tree view.  It would
00292     // be much more efficient to build only the visible
00293     // part of the tree and expand the child elements on demand.
00294     // But that is left as an exercise for the reader.
00295
00296   node->get_nodeTypeString(&s);
00297
00298     int result = 1;
00299
00300     if(!wcscmp(s,L"element"))
00301   {
00302     node->get_nodeName(&s);
00303     ht2 = m_tree.InsertItem(CString(s),1,1,ht,TVI_LAST);
00304   } else if(!wcscmp(s,L"text")){
00305     node->get_text(&s);
00306     ht2 = m_tree.InsertItem(CString(s),2,2,ht,TVI_LAST);
00307   } else {
00308         // Note: There are more node types than this.
00309         // Correctly displaying all nodes types is left
00310         // as an exercise for the reader.
00311     node->get_nodeName(&s);
00312     ht2 = m_tree.InsertItem(CString(s),3,3,ht,TVI_LAST);
00313   }
00314
00315   if(node->hasChildNodes())
00316   {
00317     node->get_childNodes(&childs);
00318     for(i=0;i<childs->Getlength();i++)
00319     {
00320       childs->get_item(i,&childnode);
00321       result += MakeTree((MSXML::IXMLDOMElement *)childnode,ht2);
00322     }
00323   }
00324     return result;
00325 }
00326
00327 void CXMLTreeDlg::OnOK()
00328 {
00329     OnLoad();
00330 }
00331
00332 void CXMLTreeDlg::OnChangeFilename()
00333 {
00334   // TODO: If this is a RICHEDIT control, the control will not
00335   // send this notification unless you override the CDialog::OnInitDialog()
00336   // function and call CRichEditCtrl().SetEventMask()
00337   // with the ENM_CHANGE flag ORed into the mask.
00338
00339   // TODO: Add your control notification handler code here
00340 }
00341
00342 void CXMLTreeDlg::OnOpen()
00343 {
00344   // TODO: Add your control notification handler code here
00345   CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
00346     "XML Files (*.xml)|*.xml|All Files (*.*)|*.*||",this);
00347
00348   if (IDOK == dlg.DoModal())
00349     {
00350       m_filename = dlg.GetPathName();
00351       UpdateData(FALSE);
00352         LoadXML(m_filename);
00353     }
00354 }
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/server/precomp.h Source File

  • NetDS
  • http
  • server

precomp.h

Go to the documentation of this file.
00001 /*++
00002  Copyright (c) 2002 - 2002 Microsoft Corporation.  All Rights Reserved.
00003
00004  THIS CODE AND INFORMATION IS PROVIDED "AS-IS" WITHOUT WARRANTY OF
00005  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007  PARTICULAR PURPOSE.
00008
00009  THIS CODE IS NOT SUPPORTED BY MICROSOFT.
00010
00011 --*/
00012
00013 #ifndef _PRECOMP_H_
00014 #define _PRECOMP_H_
00015
00016 #pragma warning(disable:4115)   // named type definition in parentheses
00017 #pragma warning(disable:4201)   // nameless struct/union
00018 #pragma warning(disable:4214)   // bit field types other than int
00019 #pragma warning(disable:4127)   // condition expression is constant
00020
00021 #include    <windows.h>
00022 #include    <stdio.h>
00023 #include    "http.h"
00024
00025
00026 #endif  // _PRECOMP_H_
00027
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Properties.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Properties.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface Properties
00019 /** @com.interface(iid=00000504-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface Properties extends msado15._Collection
00021 {
00022   /** @com.method(vtoffset=4, dispid=1610743808, type=PROPGET, name="Count", name2="getCount", addFlagsVtable=4)
00023       @com.parameters([type=I4] return) */
00024   public int getCount();
00025
00026   /** @com.method(vtoffset=5, dispid=4294967292, type=METHOD, name="_NewEnum", addFlagsVtable=4)
00027       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00028   public IUnknown _NewEnum();
00029
00030   /** @com.method(vtoffset=6, dispid=1610743810, type=METHOD, name="Refresh", addFlagsVtable=4)
00031       @com.parameters() */
00032   public void Refresh();
00033
00034   /** @com.method(vtoffset=7, dispid=0, type=PROPGET, name="Item", name2="getItem", addFlagsVtable=4)
00035       @com.parameters([in,type=VARIANT] Index, [iid=00000503-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00036   public msado15.Property getItem(Variant Index);
00037
00038
00039   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x504, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00040 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_XFORMDATA Member List

This is the complete list of members for _XFORMDATA, including all inherited members.
nObject | _XFORMDATA
pObject | _XFORMDATA
xForm | _XFORMDATA
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFilesTest/DllDatax.c Source File

  • Com
  • Services
  • Crm
  • CrmFilesTest

DllDatax.c

Go to the documentation of this file.
00001 // wrapper for dlldata.c
00002
00003 #ifdef _MERGE_PROXYSTUB // merge proxy stub DLL
00004
00005 #define REGISTER_PROXY_DLL //DllRegisterServer, etc.
00006
00007 #if !defined(_WIN32_WINNT)
00008 #define _WIN32_WINNT 0x0500
00009 #endif // !defined(_WIN32_WINNT)
00010 #define USE_STUBLESS_PROXY  //defined only with MIDL switch /Oicf
00011
00012 #pragma comment(lib, "rpcndr.lib")
00013 #pragma comment(lib, "rpcns4.lib")
00014 #pragma comment(lib, "rpcrt4.lib")
00015
00016 #define DllMain       PrxDllMain
00017 #define DllRegisterServer PrxDllRegisterServer
00018 #define DllUnregisterServer PrxDllUnregisterServer
00019 #define DllGetClassObject   PrxDllGetClassObject
00020 #define DllCanUnloadNow     PrxDllCanUnloadNow
00021
00022 #include "dlldata.c"
00023 #include "CrmFilesTest_p.c"
00024
00025 #ifdef _NOPROXY //no midl generated dlldata.c
00026
00027 #define STRICT 1
00028 #include <ole2.h>
00029
00030 BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00031 {return TRUE;}
00032
00033 STDAPI PrxDllCanUnloadNow(void){return S_OK;}
00034
00035 STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00036 {return CLASS_E_CLASSNOTAVAILABLE;}
00037
00038 STDAPI PrxDllRegisterServer(void){return S_OK;}
00039
00040 STDAPI PrxDllUnregisterServer(void){return S_OK;}
00041
00042 #endif //!PROXY_DELEGATION
00043
00044 #endif //_MERGE_PROXYSTUB
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/serviceconfig/main.c Source File

  • NetDS
  • http
  • serviceconfig

main.c

Go to the documentation of this file.
00001 /*++
00002  Copyright (c) 2002 - 2002 Microsoft Corporation.  All Rights Reserved.
00003
00004  THIS CODE AND INFORMATION IS PROVIDED "AS-IS" WITHOUT WARRANTY OF
00005  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007  PARTICULAR PURPOSE.
00008
00009  THIS CODE IS NOT SUPPORTED BY MICROSOFT.
00010
00011 --*/
00012
00013 #include "precomp.h"
00014 #pragma hdrstop
00015
00016 /***************************************************************************++
00017
00018 Routine Description:
00019     main routine.
00020
00021 Arguments:
00022     argc - # of command line arguments.
00023     argv - Arguments.
00024
00025 Return Value:
00026     Success/Failure.
00027
00028 --***************************************************************************/
00029 int _cdecl wmain(int argc, LPWSTR argv[])
00030 {
00031     DWORD           Status = NO_ERROR;
00032     HTTPCFG_TYPE    Type;
00033     HTTPAPI_VERSION HttpApiVersion = HTTPAPI_VERSION_1;
00034     WORD            wVersionRequested;
00035     WSADATA         wsaData;
00036
00037     // Parse command line parameters.
00038
00039     if(argc < 3)
00040     {
00041         NlsPutMsg(HTTPCFG_USAGE, argv[0]);
00042         return 0;
00043     }
00044
00045     argv++; argc --;
00046
00047     //
00048     // First parse the type of operation.
00049     //
00050
00051     if(_wcsicmp(argv[0], L"set") == 0)
00052     {
00053         Type = HttpCfgTypeSet;
00054     }
00055     else if(_wcsicmp(argv[0], L"query") == 0)
00056     {
00057         Type = HttpCfgTypeQuery;
00058     }
00059     else if(_wcsicmp(argv[0], L"delete") == 0)
00060     {
00061         Type = HttpCfgTypeDelete;
00062     }
00063     else if(_wcsicmp(argv[0], L"?") == 0)
00064     {
00065         NlsPutMsg(HTTPCFG_USAGE, argv[0]);
00066         return 0;
00067     }
00068     else
00069     {
00070         NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00071         return ERROR_INVALID_PARAMETER;
00072     }
00073     argv++; argc--;
00074
00075     //
00076     // Call HttpInitialize.
00077     //
00078
00079     if((Status = HttpInitialize(
00080                     HttpApiVersion,
00081                     HTTP_INITIALIZE_CONFIG,
00082                     NULL)) != NO_ERROR)
00083     {
00084         NlsPutMsg(HTTPCFG_HTTPINITIALIZE, Status);
00085         return Status;
00086     }
00087
00088     //
00089     // Call WSAStartup as we are using some winsock functions.
00090     //
00091     wVersionRequested = MAKEWORD( 2, 2 );
00092
00093     if(WSAStartup( wVersionRequested, &wsaData ) != 0)
00094     {
00095         HttpTerminate(HTTP_INITIALIZE_CONFIG, NULL);
00096         return GetLastError();
00097     }
00098
00099     //
00100     // Call the corresponding API.
00101     //
00102
00103     if(_wcsicmp(argv[0], L"ssl") == 0)
00104     {
00105         argv++; argc--;
00106         Status = DoSsl(argc, argv, Type);
00107     }
00108     else if(_wcsicmp(argv[0], L"urlacl") == 0)
00109     {
00110         argv++; argc--;
00111         Status = DoUrlAcl(argc, argv, Type);
00112     }
00113     else if(_wcsicmp(argv[0], L"iplisten") == 0)
00114     {
00115         argv++; argc--;
00116         Status = DoIpListen(argc, argv, Type);
00117     }
00118     else
00119     {
00120         NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00121         Status = ERROR_INVALID_PARAMETER;
00122     }
00123
00124     WSACleanup();
00125     HttpTerminate(HTTP_INITIALIZE_CONFIG, NULL);
00126
00127     return Status;
00128 }
00129
00130 /***************************************************************************++
00131
00132 Routine Description:
00133     Write output
00134
00135 Arguments:
00136     Handle    - Handle to write to.
00137     MsgNumber - The message number.
00138     ...       - Optional arguments.
00139
00140 Return Value:
00141     Success/Failure.
00142
00143 --***************************************************************************/
00144 UINT
00145 NlsPutMsg (
00146     IN UINT MsgNumber,
00147     IN ...
00148     )
00149 {
00150     UINT    msglen;
00151     VOID    *vp;
00152     va_list arglist;
00153
00154     va_start(arglist, MsgNumber);
00155
00156     msglen = FormatMessage(
00157                 FORMAT_MESSAGE_FROM_HMODULE |
00158                 FORMAT_MESSAGE_ALLOCATE_BUFFER,   // dwFlags.
00159                 NULL,                             // lpSource.
00160                 MsgNumber,                        // dwMessageId.
00161                 0L,                               // dwLanguageId (default)
00162                 (LPWSTR)&vp,
00163                 0,
00164                 &arglist
00165                 );
00166
00167     if(!msglen)
00168     {
00169         return 0;
00170     }
00171
00172     wprintf(L"%ws", vp);
00173
00174     LocalFree(vp);
00175
00176     return msglen;
00177 }
00178
00179 /***************************************************************************++
00180
00181 Routine Description:
00182     Given a WCHAR IP, this routine converts it to a SOCKADDR.
00183
00184 Arguments:
00185     pIp     - IP address to covert.
00186     pBuffer - Buffer, must be == sizeof(SOCKADDR_STORAGE)
00187     Length  - Length of buffer
00188
00189 Return Value:
00190     Success/Failure.
00191
00192 --***************************************************************************/
00193 DWORD
00194 GetAddress(
00195     PWCHAR  pIp,
00196     PVOID   pBuffer,
00197     ULONG   Length
00198     )
00199 {
00200     DWORD Status;
00201     DWORD TempStatus;
00202
00203     if(pIp == NULL)
00204     {
00205         return ERROR_INVALID_PARAMETER;
00206     }
00207
00208     //
00209     // The address could be a v4 or a v6 address. First, let's try v4.
00210     //
00211
00212     Status = WSAStringToAddress(
00213                 pIp,
00214                 AF_INET,
00215                 NULL,
00216                 pBuffer,
00217                 (LPINT)&Length
00218                 );
00219
00220     if(Status != NO_ERROR)
00221     {
00222         //
00223         // Now, try v6
00224         //
00225
00226         Status = WSAGetLastError();
00227
00228         TempStatus = WSAStringToAddress(
00229                         pIp,
00230                         AF_INET6,
00231                         NULL,
00232                         pBuffer,
00233                         (LPINT)&Length
00234                         );
00235
00236         //
00237         // If IPv6 also fails, then we want to return the original
00238         // error.
00239         //
00240         // If it succeeds, we want to return NO_ERROR.
00241         //
00242
00243         if(TempStatus == NO_ERROR)
00244         {
00245             Status = NO_ERROR;
00246         }
00247     }
00248
00249     return Status;
00250 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/netshell/nshsamp.cpp Source File

  • NetDS
  • netshell

nshsamp.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft Netsh Sample.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define UNICODE
00018 #include "nshsamp.h"
00019
00020 //
00021 // Global variables.
00022 //
00023 extern SAMPLE_HELPER_DATA g_OnlineData = {0, 0, 0, 0, FALSE, 0, LOW};
00024 extern SAMPLE_HELPER_DATA g_OfflineData = {0, 0, 0, 0, FALSE, 0, LOW};
00025 extern PSAMPLE_HELPER_DATA g_CurrentData = &g_OnlineData;
00026 extern HANDLE g_hModule = 0;
00027
00028 //
00029 // Declare the command structs.  You need to declare the
00030 // structs based on how you will be grouping them.  So,
00031 // for example, the three 'show' commands should be in
00032 // the same struct so you can put them in a single group.
00033 //
00034 CMD_ENTRY g_TopLevelCommands[] =
00035 {
00036     CREATE_CMD_ENTRY(SHOW_OBJECT, HandleShowObjectCommand),
00037     // Online, so this command won't be available in offline mode.
00038     CREATE_CMD_ENTRY_EX_VER(ADD_OBJECT, HandleAddObjectCommand, CMD_FLAG_ONLINE, CheckRunningOnWhistler),
00039     // Interactive, so this command can't be used from the command line (see SDK).
00040     CREATE_CMD_ENTRY_EX(SET_OBJECT, HandleSetObjectCommand, CMD_FLAG_INTERACTIVE)
00041 };
00042
00043 //
00044 // One nice thing about a grouped command like is that you can specify a different function
00045 // for each command, and when that function is entered, two tokens have already been parsed
00046 // for you.  In this example, if the user types "reset widgets", netsh will call
00047 // HandleResetWidgetCommand, and since there are no other arguments to parse, we can just
00048 // reset the widget count.  Compare this to a top level command, where only the first token
00049 // parsed for you.  In that case, you have to parse the rest of the command line to determine
00050 // what to do, as in HandleShowObjectCommand or HandleAddObjectCommand.  On the other hand,
00051 // now you need three functions whereas before you only needed one.
00052 //
00053 CMD_ENTRY g_ResetObjects[] =
00054 {
00055     CREATE_CMD_ENTRY(RESET_OBJECT_WIDGETS,      HandleResetWidgetCommand),
00056     CREATE_CMD_ENTRY(RESET_OBJECT_SPROCKETS,    HandleResetSprocketCommand),
00057     CREATE_CMD_ENTRY(RESET_OBJECT_ALL,          HandleResetAllCommand)
00058 };
00059
00060 CMD_ENTRY g_ShowError[] =
00061 {
00062     CREATE_CMD_ENTRY(SHOWERROR,                 HandleShowErrorCommand)
00063 };
00064
00065 CMD_ENTRY g_RandomCommands[] =
00066 {
00067     CREATE_CMD_ENTRY(SET_INTERFACE,             HandleSetInterfaceCommand),
00068     CREATE_CMD_ENTRY(SET_GATEWAY,               HandleSetGatewayCommand)
00069 };
00070
00071 CMD_ENTRY g_TopLevelSubInterfaceCommands[] =
00072 {
00073     CREATE_CMD_ENTRY(SHOW_RANDOM,               HandleShowRandomSettingsCommand)
00074 };
00075
00076 //
00077 // Declare the group structs.
00078 //
00079 CMD_GROUP_ENTRY     g_Sample_Commands[] =
00080 {
00081     // Local, so this group isn't valid for remote machines.
00082     CREATE_CMD_GROUP_ENTRY_EX(RESET_OBJECT, g_ResetObjects, CMD_FLAG_LOCAL)
00083 };
00084
00085 CMD_GROUP_ENTRY     g_SampleInterface_Commands[] =
00086 {
00087     //
00088     // We'll specify our version callback function for this group.  Netsh calls
00089     // this function with parameters indicating what type of operating system
00090     // this command is to be executed on.  The callback, CheckRunningOnWhistler
00091     // in this case, should return TRUE if it finds that the operating system
00092     // is of acceptable type.  Otherwise, the callback should return FALSE
00093     // to indicate that this group is not valid for the indicated operating
00094     // system.  See the SDK for the explanation of the values passed to the
00095     // version callback function.  Note that we chose not to specify any flags
00096     // for this group (thus the 0) but we could have.
00097     //
00098     CREATE_CMD_GROUP_ENTRY_EX_VER(SET_RANDOM_STUFF, g_RandomCommands, 0, CheckRunningOnWhistler)
00099 };
00100
00101
00102 DWORD WINAPI
00103 GenericStopHelper(
00104 IN      DWORD   dwReserved)
00105 {
00106     //
00107     // Here we would perform any work that needs to be done
00108     // when netsh exits and helpers are stopped.  This would
00109     // include things like closing open handles, freeing
00110     // allocated memory, etc.  Note that you can have
00111     // a different StopHelper function for each helper
00112     // you register. (The NS_HELPER_ATTRIBUTES.pfnStop param
00113     // of the call to RegisterHelper in InitHelper below.)
00114     //
00115     return NO_ERROR;
00116 }
00117
00118 DWORD WINAPI
00119 CommitFn(
00120 IN      DWORD   dwAction)
00121 {
00122     //
00123     // The handling of this action is admittedly simple in this example.
00124     // We simply have two copies of the data that we persist and consider
00125     // one the "online" set of data and one the "offline" set of data.
00126     // However, since neither the offline nor online sets of data need to
00127     // be "applied" to anything, it makes the distinction between them
00128     // somewhat meaningless.  The scheme used to support online/offline modes
00129     // is generally left up to the developer.
00130     //
00131     switch (dwAction)
00132     {
00133         case NETSH_COMMIT:
00134             //
00135             // Change to commit mode, otherwise known as online.
00136             //
00137             g_CurrentData = &g_OnlineData;
00138             break;
00139
00140         case NETSH_UNCOMMIT:
00141             //
00142             // Change to uncommit mode, meaning all our data goes
00143             // to our offlinedata buffer.
00144             //
00145             g_CurrentData = &g_OfflineData;
00146             break;
00147
00148         case NETSH_FLUSH:
00149             //
00150             // Flush all uncommitted changes.  We'll do this by
00151             // overwriting whatever data is in g_OfflineData with
00152             // what is in g_OnlineData.
00153             //
00154             CopyMemory(&g_OfflineData, &g_OnlineData, sizeof(SAMPLE_HELPER_DATA));
00155             break;
00156
00157         case NETSH_SAVE:
00158             //
00159             // Copy the memory from our offline struct to our
00160             // online one, then "apply" it.
00161             //
00162             CopyMemory(&g_OnlineData, &g_OfflineData, sizeof(SAMPLE_HELPER_DATA));
00163             g_CurrentData = &g_OnlineData;
00164
00165             // SomeFunctionToApplyOurData(g_OnlineData);
00166
00167             break;
00168
00169         default:
00170             break;
00171     }
00172     return NO_ERROR;
00173 }
00174
00175 DWORD WINAPI
00176 ConnectFn(
00177 IN  LPCWSTR  pwszMachine)
00178 {
00179     //
00180     // This function is called whenever the machine name changes.
00181     // If the context this was called for (you can specify a connect
00182     // function on a per context basis, see RegisterContext) is
00183     // supposed to be remotable, then the helper should verify
00184     // connectivity to the machine specified by pwszMachine and
00185     // return an error if unable to reach the machine.
00186     //
00187
00188     //
00189     // This is also where the helper might want to call RegisterContext
00190     // again on a context to remove or add commands at will.  This allows
00191     // the commands in your context to be dynamic, that is, commands
00192     // may be added and removed at will.  However, the versioning
00193     // functions tend to make a dynamic context unnecessary, as most
00194     // dynamic command changes are needed because of differing OS's the
00195     // commands are used on.  Note that NULL for pwszMachine indicates
00196     // that the machine to be connected to is the local machine.  When
00197     // and if the connect function returns an error code, the command
00198     // that was going to be executed (whether a context command or
00199     // entering a context) will fail.
00200     //
00201
00202     //
00203     // Uncomment this line to see how often the Connect function is called
00204     // and what gets passed to it.
00205     //
00206     //PrintMessageFromModule(g_hModule, GEN_CONNECT_SHOWSTRING, pwszMachine);
00207
00208     return NO_ERROR;
00209 }
00210
00211 BOOL WINAPI
00212 CheckRunningOnWhistler(
00213 IN  UINT     CIMOSType,
00214 IN  UINT     CIMOSProductSuite,
00215 IN  LPCWSTR  CIMOSVersion,
00216 IN  LPCWSTR  CIMOSBuildNumber,
00217 IN  LPCWSTR  CIMServicePackMajorVersion,
00218 IN  LPCWSTR  CIMServicePackMinorVersion,
00219 IN  UINT     CIMProcessorArchitecture,
00220 IN  DWORD    dwReserved
00221 )
00222 {
00223     //
00224     // Leave this code in here so it can be uncommented and recompiled.
00225     // Its output can be kind of distracting if on by default, so it
00226     // was turned off.
00227     //
00228     /*
00229     PrintMessage(L"\n"
00230                  L"Entered CheckRunningOnWhistler.  Received arguments of \n"
00231                  L"Type %1!lu!\n"
00232                  L"ProductSuite %2!lu!\n"
00233                  L"Version %3!s!\n"
00234                  L"BuildNumber %4!s!\n"
00235                  L"ServicePackMajorVersion %5!s!\n"
00236                  L"ServicePackMinorVersion %6!s!\n"
00237                  L"ProcessorArchitecture %7!lu!\n",
00238                  CIMOSType,
00239                  CIMOSProductSuite,
00240                  CIMOSVersion,
00241                  CIMOSBuildNumber,
00242                  CIMServicePackMajorVersion,
00243                  CIMServicePackMinorVersion,
00244                  CIMProcessorArchitecture);
00245     */
00246
00247     return TRUE;
00248 }
00249
00250 DWORD WINAPI
00251 InitHelperDll(
00252 IN  DWORD   dwNetshVersion,
00253 OUT PVOID pReserved)
00254 {
00255     DWORD                   dwRet;
00256     NS_HELPER_ATTRIBUTES    MyAttributes;
00257
00258     //
00259     // We could also implement a DllMain to get
00260     // this handle.
00261     //
00262     g_hModule = GetModuleHandle(L"nshsamp.dll");
00263
00264     ZeroMemory(&MyAttributes, sizeof(MyAttributes));
00265     MyAttributes.dwVersion      = SAMPLE_HELPER_VERSION;
00266
00267     //
00268     // This specifies the function netsh should call to
00269     // initialize the contexts for this helper.  We'll
00270     // use the same function for all the helpers, because
00271     // we can tell based on the pguidParent arg passed
00272     // to StartHelpers() which helper we need to register
00273     // contexts for.  If necessary, use a different start
00274     // function for each helper.  Just set the
00275     // MyAttributes.pfnStart parameter before each call
00276     // to RegisterHelper.
00277     //
00278     MyAttributes.pfnStart       = StartHelpers;
00279
00280     //
00281     // We'll use a generic stop function for all helpers,
00282     // rather than one for each for simplicity.  One for
00283     // each is allowed, of course.
00284     //
00285     MyAttributes.pfnStop        = GenericStopHelper;
00286
00287     //
00288     // Set the GUID of our helper.
00289     //
00290     MyAttributes.guidHelper     = g_ObjectGuid;
00291
00292     //
00293     // Specify g_RootGuid as the parent helper to indicate
00294     // that any contexts registered by this helper will be top
00295     // level contexts.  Note that NULL as the parent GUID means
00296     // the same thing.
00297     //
00298     dwRet = RegisterHelper(&g_RootGuid, &MyAttributes);
00299     if (NO_ERROR == dwRet)
00300     {
00301         //
00302         // Set the GUID of our helper.
00303         //
00304         MyAttributes.guidHelper = g_SubContext;
00305
00306         //
00307         // We want this helper's contexts to show up as children of
00308         // g_ObjectGuid's context(s), so we specify it as the parent
00309         // helper istead of g_RootGuid.
00310         //
00311         dwRet = RegisterHelper(&g_ObjectGuid, &MyAttributes);
00312         if (NO_ERROR == dwRet)
00313         {
00314             //
00315             // Set the GUID of our helper.
00316             //
00317             MyAttributes.guidHelper = g_SampleInterface;
00318
00319             //
00320             // Again, we want this helper's contexts to show up as children of
00321             // ifmon.dll's 'interface' context, so we specify it here.  To
00322             // see a list of all helpers, contexts, and their associated
00323             // GUID's, type 'show helper' within netsh.
00324             //
00325             dwRet = RegisterHelper(&g_Interface, &MyAttributes);
00326         }
00327     }
00328     return dwRet;
00329 }
00330
00331 DWORD WINAPI
00332 StartHelpers(
00333 IN CONST GUID * pguidParent,
00334 IN DWORD        dwVersion)
00335 {
00336     BOOL                    bFoundMatch = TRUE;
00337     DWORD                   dwRet = ERROR_INVALID_PARAMETER;
00338     NS_CONTEXT_ATTRIBUTES   ContextAttributes;
00339
00340     ZeroMemory(&ContextAttributes, sizeof(ContextAttributes));
00341
00342     ContextAttributes.dwVersion         = SAMPLE_HELPER_VERSION;
00343
00344     if (IsEqualGUID(*pguidParent, g_RootGuid))
00345     {
00346         //
00347         // The parent is the netsh root GUID, and the only
00348         // helper we have that registers root contexts is
00349         // the 'object' helper, so set the relevant info.
00350         //
00351         ContextAttributes.dwFlags           = 0;
00352         //
00353         // This is the default, but we are specifying for clarity.
00354         //
00355         ContextAttributes.ulPriority        = DEFAULT_CONTEXT_PRIORITY;
00356         ContextAttributes.pwszContext       = TOKEN_SAMPLE;
00357         ContextAttributes.guidHelper        = g_ObjectGuid;
00358         ContextAttributes.ulNumTopCmds      = sizeof(g_TopLevelCommands)/sizeof(CMD_ENTRY);
00359         ContextAttributes.pTopCmds          = (CMD_ENTRY (*)[])g_TopLevelCommands;
00360         ContextAttributes.ulNumGroups       = sizeof(g_Sample_Commands)/sizeof(CMD_GROUP_ENTRY);
00361         ContextAttributes.pCmdGroups        = (CMD_GROUP_ENTRY (*)[])g_Sample_Commands;
00362         ContextAttributes.pfnCommitFn       = CommitFn;
00363         ContextAttributes.pfnConnectFn      = ConnectFn;
00364         ContextAttributes.pfnDumpFn         = DumpSample;
00365         //
00366         // Just like commands or groups, you can specify a version
00367         // checking function for contexts.
00368         //
00369         ContextAttributes.pfnOsVersionCheck = CheckRunningOnWhistler;
00370     }
00371     else if (IsEqualGUID(*pguidParent, g_ObjectGuid))
00372     {
00373         //
00374         // The only helper we have that registers under
00375         // g_ObjectGuid is the 'subcontext' helper.
00376         //
00377         ContextAttributes.dwFlags           = 0;
00378
00379         //
00380         // This is the default, but we are specifying for clarity.
00381         //
00382         ContextAttributes.ulPriority        = DEFAULT_CONTEXT_PRIORITY;
00383
00384         ContextAttributes.pwszContext       = TOKEN_SUBCONTEXT;
00385         ContextAttributes.guidHelper        = g_SubContext;
00386         ContextAttributes.ulNumTopCmds      = sizeof(g_ShowError)/sizeof(CMD_ENTRY);
00387         ContextAttributes.pTopCmds          = (CMD_ENTRY (*)[])g_ShowError;
00388         ContextAttributes.ulNumGroups       = 0;
00389         ContextAttributes.pCmdGroups        = NULL;
00390         ContextAttributes.pfnCommitFn       = CommitFn;
00391         ContextAttributes.pfnConnectFn      = ConnectFn;
00392         ContextAttributes.pfnOsVersionCheck = NULL;
00393
00394         //
00395         // We're choosing to have no dump function.
00396         // (There isn't really anything to dump for a
00397         // function that just outputs error strings.)
00398         //
00399         ContextAttributes.pfnDumpFn         = NULL;
00400     }
00401     else if (IsEqualGUID(*pguidParent, g_Interface))
00402     {
00403         //
00404         // The only helper we have that registers under
00405         // g_Interface is the 'sampleinterface' helper.
00406         //
00407
00408         //
00409         // Specifies that ulPriority should be paid attention.
00410         //
00411         ContextAttributes.dwFlags           = (DWORD)CMD_FLAG_PRIORITY;
00412
00413         //
00414         // We change the priority of this so that its dump
00415         // function will be called before other dump functions.
00416         // UlPriority of 0 is the highest priority.  This can
00417         // be useful if some contexts require information
00418         // enumerated by a different context - for example
00419         // the 'interface' context has a ulPriority of 10 so
00420         // that other contexts can use the friendly names it
00421         // generates.  Those friendly names would otherwise
00422         // be inaccessible.  Note that the ulPriority of
00423         // this DumpFn is 0, so if you do a dump in the 'interface'
00424         // context, you would see this contexts dump info before
00425         // interface's dump information, even though this context
00426         // is located in a subhelper to 'interface'.
00427         //
00428         ContextAttributes.ulPriority        = 0;
00429         ContextAttributes.pwszContext       = TOKEN_SAMPLEINTERFACE;
00430         ContextAttributes.guidHelper        = g_SampleInterface;
00431         ContextAttributes.ulNumTopCmds      = sizeof(g_TopLevelSubInterfaceCommands)/sizeof(CMD_ENTRY);
00432         ContextAttributes.pTopCmds          = (CMD_ENTRY (*)[])g_TopLevelSubInterfaceCommands;
00433         ContextAttributes.ulNumGroups       = sizeof(g_SampleInterface_Commands)/sizeof(CMD_GROUP_ENTRY);
00434         ContextAttributes.pCmdGroups        = (CMD_GROUP_ENTRY (*)[])g_SampleInterface_Commands;
00435         ContextAttributes.pfnCommitFn       = CommitFn;
00436         ContextAttributes.pfnConnectFn      = ConnectFn;
00437         ContextAttributes.pfnDumpFn         = DumpSampleInterface;
00438         ContextAttributes.pfnOsVersionCheck = NULL;
00439     }
00440     else
00441     {
00442         //
00443         // If netsh passed us some parent guid that we
00444         // haven't heard of, error out.
00445         //
00446         bFoundMatch = FALSE;
00447     }
00448
00449     if (bFoundMatch)
00450     {
00451         dwRet = RegisterContext(&ContextAttributes);
00452     }
00453
00454     return dwRet;
00455 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::CEResyncEnum Member List

This is the complete list of members for msado15::CEResyncEnum, including all inherited members.
adResyncAll | msado15::CEResyncEnum | [static]
adResyncAutoIncrement | msado15::CEResyncEnum | [static]
adResyncConflicts | msado15::CEResyncEnum | [static]
adResyncInserts | msado15::CEResyncEnum | [static]
adResyncNone | msado15::CEResyncEnum | [static]
adResyncUpdates | msado15::CEResyncEnum | [static]
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/PermEvents.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

PermEvents.Cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  PermEvents.cpp
00006 //
00007 // Description:
00008 //    Defines the class behaviors for the application.
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include "stdafx.h"
00015 #include "PermEvents.h"
00016 #include "PermEventsDlg.h"
00017 #include <objbase.h>
00018 #include <strsafe.h>
00019
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CPermEventsApp
00029
00030 BEGIN_MESSAGE_MAP(CPermEventsApp, CWinApp)
00031   //{{AFX_MSG_MAP(CPermEventsApp)
00032     // NOTE - the ClassWizard will add and remove mapping macros here.
00033     //    DO NOT EDIT what you see in these blocks of generated code!
00034   //}}AFX_MSG
00035   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00036 END_MESSAGE_MAP()
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CPermEventsApp construction
00040
00041 CPermEventsApp::CPermEventsApp()
00042 {
00043   // TODO: add construction code here,
00044   // Place all significant initialization in InitInstance
00045   m_clsReg = 0;
00046 }
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049 // The one and only CPermEventsApp object
00050
00051 CPermEventsApp theApp;
00052
00053 // {1E069401-087E-11d1-AD85-00AA00B8E05A}
00054 static const GUID CLSID_WBEMSampleConsumer =
00055 { 0x1e069401, 0x87e, 0x11d1, { 0xad, 0x85, 0x0, 0xaa, 0x0, 0xb8, 0xe0, 0x5a } };
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // CPermEventsApp initialization
00059
00060 BOOL CPermEventsApp::InitInstance()
00061 {
00062   HRESULT hRes;
00063   BOOL regEmpty = FALSE; // did a self-unregister happen?
00064
00065   // OLE initialization. This is 'lighter' than OleInitialize()
00066   //  which also setups DnD, etc.
00067   if(SUCCEEDED(CoInitialize(NULL)))
00068   {
00069
00070     //  NOTE:
00071     //  When using asynchronous WMI API's remotely in an environment where the "Local System" account
00072     //  has no network identity (such as non-Kerberos domains), the authentication level of
00073     //  RPC_C_AUTHN_LEVEL_NONE is needed. However, lowering the authentication level to
00074     //  RPC_C_AUTHN_LEVEL_NONE makes your application less secure. It is wise to
00075     //  use semi-synchronous API's for accessing WMI data and events instead of the asynchronous ones.
00076
00077     hRes = CoInitializeSecurity( NULL, -1, NULL, NULL,
00078                       RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
00079                       RPC_C_IMP_LEVEL_IMPERSONATE,
00080                       NULL,
00081                       EOAC_SECURE_REFS, //change to EOAC_NONE if you change dwAuthnLevel to RPC_C_AUTHN_LEVEL_NONE
00082                       NULL );
00083     if (FAILED(hRes))
00084     {
00085       AfxMessageBox(_T("CoInitializeSecurity Failed"));
00086       return FALSE;
00087     }
00088   }
00089   else // didnt CoInitialize()
00090   {
00091     AfxMessageBox(_T("CoInitialize Failed"));
00092     return FALSE;
00093   } // endif OleInitialize()
00094
00095   // NOTE: To advertise that we can self-register, put 'OLESelfRegister'
00096   // in the version resource.
00097
00098   // see if this is a self-Unregister call.
00099   TCHAR temp[128];
00100   TCHAR seps[] = _T(" ");
00101   TCHAR *token = NULL;
00102
00103   StringCbCopy(temp, sizeof(temp), (LPCTSTR)m_lpCmdLine);
00104   token = _tcstok( temp, seps );
00105   while( token != NULL )
00106   {
00107     /* While there are tokens in "string" */
00108     if(_tcsicmp(token, _T("/UNREGSERVER")) == 0)
00109     {
00110       UnregisterServer();
00111       return FALSE;   // no use doing any more.
00112     }
00113     /* Get next token: */
00114     token = _tcstok( NULL, seps );
00115   }
00116
00117   // if we got here, the unregister didn't return out and we should
00118   // make sure we're registered now.
00119   RegisterServer();
00120
00121   // creating the dlg earlier than usual so the class factory
00122   //  can pass m_outputList.
00123   CPermEventsDlg dlg;
00124
00125   m_factory = new CProviderFactory(&(dlg.m_outputList));
00126   if (m_factory == NULL)
00127   {
00128     TRACE(_T("Out of memory\n"));
00129     return FALSE;
00130   }
00131
00132   if((hRes = CoRegisterClassObject(CLSID_WBEMSampleConsumer,
00133               (IUnknown *)m_factory,
00134               CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
00135               REGCLS_MULTIPLEUSE,
00136               &m_clsReg)) == S_OK)
00137   {
00138     TRACE(_T("registered\n"));
00139   }
00140   else
00141   {
00142     TRACE(_T("not registered\n"));
00143   }
00144
00145 #ifdef _AFXDLL
00146   Enable3dControls();     // Call this when using MFC in a shared DLL
00147 #else
00148   Enable3dControlsStatic(); // Call this when linking to MFC statically
00149 #endif
00150
00151   m_pMainWnd = &dlg;
00152   INT_PTR nResponse = dlg.DoModal();
00153   if (nResponse == IDOK)
00154   {
00155     // TODO: Place code here to handle when the dialog is
00156     //  dismissed with OK
00157   }
00158   else if (nResponse == IDCANCEL)
00159   {
00160     // TODO: Place code here to handle when the dialog is
00161     //  dismissed with Cancel
00162   }
00163
00164   // Since the dialog has been closed, return FALSE so that we exit the
00165   //  application, rather than start the application's message pump.
00166   return FALSE;
00167 }
00168
00169 int CPermEventsApp::ExitInstance()
00170 {
00171   if(m_clsReg)
00172   {
00173     HRESULT hres = CoRevokeClassObject(m_clsReg);
00174
00175     CoUninitialize();
00176   }
00177
00178   return CWinApp::ExitInstance();
00179 }
00180
00181 #define TCHAR_LEN_IN_BYTES(str)  (unsigned long)(_tcslen(str)*sizeof(TCHAR)+sizeof(TCHAR))
00182
00183 //***************************************************************************
00184 //
00185 // DllRegisterServer
00186 //
00187 // Purpose: Called during setup or by regsvr32.
00188 //
00189 // Return:  NOERROR if registration successful, error otherwise.
00190 // Note: Key setups are:
00191 //    HKCR\CLSID\[guid]= friendly name
00192 //    HKCR\CLSID\[guid]\LocalServer32 = exe's path.
00193 //    HKCR\CLSID\AppID = [guid]
00194 //    HKCR\AppID\[guid] = friendly name
00195 //    HKCR\AppID\[guid] = 'RunAs' = "Interactive User"
00196 //      'RunAs' is a value name; not a subkey.
00197 //***************************************************************************
00198 void CPermEventsApp::RegisterServer(void)
00199 {
00200   HKEY hKey1, hKey2;
00201
00202   TCHAR       wcConsID[] = _T("{1E069401-087E-11d1-AD85-00AA00B8E05A}");
00203     TCHAR       wcCLSID[] = _T("CLSID\\{1E069401-087E-11d1-AD85-00AA00B8E05A}");
00204     TCHAR       wcAppID[] = _T("AppID\\{1E069401-087E-11d1-AD85-00AA00B8E05A}");
00205     TCHAR      wcModule[MAX_PATH + 1];  // this will hold the exe's path.
00206   TCHAR ConsumerTextForm[] = _T("WMI Sample Permanent Consumer Object");
00207
00208   // this will allow the server to display its windows on the active desktop instead
00209   // of the hidden desktop where services run.
00210   TCHAR Interactive[] = _T("Interactive User");
00211
00212   memset(&wcModule, NULL, sizeof(wcModule));
00213   GetModuleFileName(NULL, wcModule,  sizeof(wcModule)/sizeof(TCHAR) - 1);
00214
00215
00216   //Set the "default" text under CLSID
00217   //==========================
00218   RegCreateKeyEx( HKEY_CLASSES_ROOT, wcCLSID, 0, NULL,
00219                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00220                     &hKey1, NULL );
00221   RegSetValueEx(hKey1, NULL, 0, REG_SZ,
00222           (LPBYTE)ConsumerTextForm,
00223           TCHAR_LEN_IN_BYTES(ConsumerTextForm));
00224
00225   // create the LocalServer32 key so the server can be found.
00226   RegCreateKeyEx( hKey1, _T("LocalServer32"), 0, NULL,
00227                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00228                     &hKey2, NULL );
00229   RegSetValueEx(hKey2, NULL, 0, REG_SZ, (LPBYTE)wcModule, TCHAR_LEN_IN_BYTES(wcModule));
00230   RegSetValueEx(hKey1, _T("AppID"), 0, REG_SZ, (LPBYTE)wcConsID, TCHAR_LEN_IN_BYTES(wcConsID));
00231
00232   RegCloseKey(hKey2);
00233   RegCloseKey(hKey1);
00234
00235   // now do the AppID keys.
00236   RegCreateKeyEx( HKEY_CLASSES_ROOT, wcAppID, 0, NULL,
00237                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00238                     &hKey1, NULL );
00239   RegSetValueEx(hKey1, NULL, 0, REG_SZ,
00240           (LPBYTE)ConsumerTextForm,
00241           TCHAR_LEN_IN_BYTES(ConsumerTextForm));
00242
00243   // this makes the local server run on the active desktop (the one you're seeing)
00244   // instead of the hidden desktop that services run on (which doesn't have UI)
00245   RegSetValueEx(hKey1, _T("RunAs"), 0, REG_SZ, (LPBYTE)Interactive, TCHAR_LEN_IN_BYTES(Interactive));
00246   RegCloseKey(hKey1);
00247 }
00248
00249
00250 //***************************************************************************
00251 //
00252 // DllUnregisterServer
00253 //
00254 // Purpose: Called when it is time to remove the registry entries.
00255 //
00256 // Return:  NOERROR if registration successful, error otherwise.
00257 //***************************************************************************
00258 void CPermEventsApp::UnregisterServer(void)
00259 {
00260
00261   TCHAR       wcConsID[] = _T("{1E069401-087E-11d1-AD85-00AA00B8E05A}");
00262     TCHAR       wcCLSID[] = _T("CLSID\\{1E069401-087E-11d1-AD85-00AA00B8E05A}");
00263     TCHAR       wcAppID[] = _T("AppID\\{1E069401-087E-11d1-AD85-00AA00B8E05A}");
00264     HKEY hKey1;
00265   DWORD dwRet;
00266
00267   // delete the keys under CLSID\[guid]
00268     dwRet = RegOpenKeyEx(HKEY_CLASSES_ROOT, wcCLSID, 0, KEY_WRITE, &hKey1);
00269     if(dwRet == NOERROR)
00270     {
00271         RegDeleteKey(hKey1, _T("LocalServer32"));
00272         RegCloseKey(hKey1);
00273     }
00274
00275   // delete CLSID\[guid] <default>
00276     dwRet = RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("CLSID"), 0, KEY_WRITE, &hKey1);
00277     if(dwRet == NOERROR)
00278     {
00279         RegDeleteKey(hKey1,wcConsID);
00280         RegCloseKey(hKey1);
00281     }
00282
00283   // delete AppID\[guid] <default>
00284     dwRet = RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("AppID"), 0, KEY_WRITE, &hKey1);
00285     if(dwRet == NOERROR)
00286     {
00287         RegDeleteKey(hKey1, wcConsID);
00288         RegCloseKey(hKey1);
00289     }
00290 }
00291
00292
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/dxtrans/dxsurf3/resource.h Source File

  • Web
  • dxtrans
  • dxsurf3

resource.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001 Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 //{{NO_DEPENDENCIES}}
00006 // Microsoft Developer Studio generated include file.
00007 // Used by dxsurf3.rc
00008 //
00009 #define IDI_DXS3                        101
00010 #define IDR_DXSURFMENU                  103
00011 #define ID_FILE_EXIT                    40001
00012 #define ID_FILE_ABOUT                   40004
00013
00014 // Next default values for new objects
00015 //
00016 #ifdef APSTUDIO_INVOKED
00017 #ifndef APSTUDIO_READONLY_SYMBOLS
00018 #define _APS_NEXT_RESOURCE_VALUE        104
00019 #define _APS_NEXT_COMMAND_VALUE         40005
00020 #define _APS_NEXT_CONTROL_VALUE         1000
00021 #define _APS_NEXT_SYMED_VALUE           101
00022 #endif
00023 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/tracemacro.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

tracemacro.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  TraceMacro.h : Defines custom tracing helpers.
00014 //
00015
00016
00017 #ifndef _TRACE_MACRO_HEADER_
00018 #define _TRACE_MACRO_HEADER_
00019
00020 //---------------------------------------------------------------------------
00021 //  Function prototypes
00022 //
00023 VOID Trace_Start( LPCTSTR pszClass, LPCTSTR pszFunction );
00024 VOID Trace_HR( LPCTSTR pszClass, LPCTSTR pszFunction, HRESULT hr );
00025 VOID Trace_Value( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszValueName, LONG nValue );
00026 VOID Trace_Pointer( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszAction, ULONG ulValue );
00027 VOID Trace_Event( LPCTSTR pszClass, LPCTSTR pszFunction, LONG nEvent );
00028 VOID MapEvent( LONG Event, LPTSTR szEventStr );
00029
00030
00031 // Alternate version provides complete path to the file
00032 // #define TRACE_HRESULT(str,hr)  Trace_HR( _T(__FILE__), (str), (hr) )
00033
00034 #ifdef _DEBUG
00035
00036 #undef  TRACE_HRESULT
00037 #define TRACE_HRESULT(s1,hr) Trace_HR( (MODULESTRING),(s1),(hr) )
00038
00039 #undef  TRACE_VAL
00040 #define TRACE_VAL(s1,s2,val) Trace_Value( (MODULESTRING),(s1),(s2),(val) )
00041
00042 #undef  TRACE_PTR
00043 #define TRACE_PTR(s1,s2,val) Trace_Pointer( (MODULESTRING),(s1),(s2),(val) )
00044
00045 #undef  TRACE_EVENT
00046 #define TRACE_EVENT(s1,val)  Trace_Event( (MODULESTRING),(s1),(val) )
00047
00048 #undef  TRACE_START
00049 #define TRACE_START( s1 )    Trace_Start( (MODULESTRING),(s1) )
00050
00051
00052 #else
00053
00054 #undef  TRACE_HRESULT
00055 #define TRACE_HRESULT
00056
00057 #undef  TRACE_VAL
00058 #define TRACE_VAL
00059
00060 #undef  TRACE_PTR
00061 #define TRACE_PTR
00062
00063 #undef  TRACE_EVENT
00064 #define TRACE_EVENT
00065
00066 #undef  TRACE_START
00067 #define TRACE_START
00068
00069 #endif //_DEBUG
00070
00071
00072 #endif //_TRACE_MACRO_HEADER_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CComSpyPropPage Member List

This is the complete list of members for CComSpyPropPage, including all inherited members.
Apply(void) | CComSpyPropPage |
CComSpyPropPage() | CComSpyPropPage | [inline]
IDD enum value | CComSpyPropPage |
m_pSpy | CComSpyPropPage |
OnCheckBoxClick(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CComSpyPropPage | [inline]
OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CComSpyPropPage |
OnLogFileChange(WORD wNotify, WORD wID, HWND hWnd, BOOL &bHandled) | CComSpyPropPage | [inline]
OnSelectColumn(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CComSpyPropPage |
OnWidthChange(WORD wNotify, WORD wID, HWND hWnd, BOOL &bHandled) | CComSpyPropPage | [inline]
Generated on Wed Nov 13 2024 16:55:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/StdAfx.cpp Source File

  • Web
  • Browser
  • EditGlyphs

StdAfx.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // stdafx.cpp : source file that includes just the standard includes
00006 //  stdafx.pch will be the pre-compiled header
00007 //  stdafx.obj will contain the pre-compiled type information
00008
00009 #include "stdafx.h"
00010
00011 #ifdef _ATL_STATIC_REGISTRY
00012 #include <statreg.h>
00013 #include <statreg.cpp>
00014 #endif
00015
00016 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStaticNode Member List

This is the complete list of members for CStaticNode, including all inherited members.
AddDeviceNode(NODE_PROPERTIES *pProperties) | CStaticNode |
AddDeviceNode(NODE_PROPERTIES *pProperties) | CStaticNode |
AddDeviceNode(NODE_PROPERTIES *pProperties) | CStaticNode |
AddDeviceNode(NODE_PROPERTIES *pProperties) | CStaticNode |
AddDeviceNode(NODE_PROPERTIES *pProperties) | CStaticNode |
AddDeviceNode(NODE_PROPERTIES *pProperties) | CStaticNode |
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CStaticNode |
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CStaticNode |
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CStaticNode |
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CStaticNode |
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CStaticNode |
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CStaticNode |
CBaseNode::AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed)=0 | CBaseNode | [pure virtual]
bExpanded | CDelegationBase | [protected]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
children | CStaticNode | [private]
clearDirty() | CStaticNode | [inline]
clearDirty() | CStaticNode | [inline]
Command(long lCommandID) | CStaticNode |
Command(long lCommandID) | CStaticNode |
Command(long lCommandID) | CStaticNode |
Command(long lCommandID) | CStaticNode |
Command(long lCommandID) | CStaticNode |
Command(long lCommandID) | CStaticNode |
CBaseNode::Command(long lCommandID)=0 | CBaseNode | [pure virtual]
ControlbarNotify(LPARAM nArg, LPARAM lParam, LONG_PTR pCompData) | CStaticNode |
CBaseNode::ControlbarNotify(LPARAM nArg, LPARAM lParam, LONG_PTR pComp)=0 | CBaseNode | [pure virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle) | CStaticNode | [inline]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle) | CStaticNode | [inline]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CStaticNode | [virtual]
CBaseNode::CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle)=0 | CBaseNode | [pure virtual]
CStaticNode() | CStaticNode |
CStaticNode(CComponentData *pComponentData=NULL) | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode() | CStaticNode |
CStaticNode(CComponentData *pComponentData=NULL) | CStaticNode |
CStaticNode() | CStaticNode |
DeleteScopeItems(LPCONSOLENAMESPACE2 ipCNS2) | CStaticNode | [private]
DeleteScopeItems(LPCONSOLENAMESPACE2 ipCNS) | CStaticNode | [private]
DeleteScopeItems(LPCONSOLENAMESPACE2 ipCNS2) | CStaticNode | [private]
DeleteScopeItems(LPCONSOLENAMESPACE2 ipCNS) | CStaticNode | [private]
DeleteScopeItems(LPCONSOLENAMESPACE2 ipCNS2) | CStaticNode | [private]
DeleteScopeItems(LPCONSOLENAMESPACE2 ipCNS) | CStaticNode | [private]
DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CStaticNode | [private, static]
Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
GetAttributes() | CStaticNode | [inline]
CBaseNode::GetAttributes()=0 | CBaseNode | [pure virtual]
GetAttributeString() | CStaticNode | [inline]
CBaseNode::GetAttributeString()=0 | CBaseNode | [pure virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetBitmapIndex() | CStaticNode | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
getData() | CStaticNode | [inline]
getData() | CStaticNode | [inline]
getDataSize() | CStaticNode | [inline]
getDataSize() | CStaticNode | [inline]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CStaticNode |
GetDisplayInfo(RESULTDATAITEM *pRDI) | CStaticNode |
CBaseNode::GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
CBaseNode::GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetDisplayName(int nCol=0) | CStaticNode | [inline, virtual]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
getHost() | CStaticNode | [inline]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CDelegationBase | [inline, virtual]
GetMessageWnd() | CStaticNode | [inline]
GetMessageWnd() | CStaticNode | [inline]
GetMessageWnd() | CStaticNode | [inline]
GetMessageWnd() | CStaticNode | [inline]
GetMessageWnd() | CStaticNode | [inline]
GetMessageWnd() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
GetNodeGUID() | CStaticNode | [inline]
CBaseNode::GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeType() | CStaticNode | [inline]
GetNodeType() | CStaticNode | [inline]
GetNodeType() | CStaticNode | [inline]
GetNodeType() | CStaticNode | [inline]
GetNodeType() | CStaticNode | [inline]
GetNodeType() | CStaticNode | [inline]
GetNodeType() | CStaticNode | [inline]
GetNodeType() | CStaticNode | [inline]
CBaseNode::GetNodeType()=0 | CBaseNode | [pure virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
getNodeType() | CStaticNode | [inline, virtual]
GetObjectPath() | CStaticNode | [inline]
CBaseNode::GetObjectPath()=0 | CBaseNode | [pure virtual]
GetParentScopeItem() | CStaticNode | [inline, virtual]
GetProperties(LPNODEPROPS *ppNodeProps) | CStaticNode |
CBaseNode::GetProperties(LPNODEPROPS *ppNodeProps)=0 | CBaseNode | [pure virtual]
GetProperty(BSTR bstrPropertyName, PBSTR pbstrProperty) | CStaticNode | [inline]
CBaseNode::GetProperty(BSTR szPropertyName, PBSTR pbstrProperty)=0 | CBaseNode | [pure virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CStaticNode |
CBaseNode::GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CDelegationBase | [inline, virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CDelegationBase | [inline, virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CDelegationBase | [inline, virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CStaticNode | [inline]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CStaticNode | [inline]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CStaticNode | [virtual]
CBaseNode::GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch)=0 | CBaseNode | [pure virtual]
HasPropertySheets() | CStaticNode | [virtual]
InitDefaultDevices() | CStaticNode | [private]
Initialize(NODE_PROPERTIES *pNodeProps) | CStaticNode |
Initialize(NODE_PROPERTIES *pNodeProps) | CStaticNode |
Initialize(LPNODEPROPS pNodeProps) | CStaticNode |
Initialize(NODE_PROPERTIES *pNodeProps) | CStaticNode |
Initialize(NODE_PROPERTIES *pNodeProps) | CStaticNode |
Initialize(NODE_PROPERTIES *pNodeProps) | CStaticNode |
Initialize(NODE_PROPERTIES *pNodeProps) | CStaticNode |
Initialize(NODE_PROPERTIES *pNodeProps) | CStaticNode |
CBaseNode::Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
CBaseNode::Initialize(LPNODEPROPS pNodeProps)=0 | CBaseNode | [pure virtual]
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
InsertScopeItems(LPCONSOLENAMESPACE2 ipCNS2) | CStaticNode | [private]
InsertScopeItems(LPCONSOLENAMESPACE2 ipCNS) | CStaticNode | [private]
InsertScopeItems(LPCONSOLENAMESPACE2 ipCNS2) | CStaticNode | [private]
InsertScopeItems(LPCONSOLENAMESPACE2 ipCNS) | CStaticNode | [private]
InsertScopeItems(LPCONSOLENAMESPACE2 ipCNS2) | CStaticNode | [private]
InsertScopeItems(LPCONSOLENAMESPACE2 ipCNS) | CStaticNode | [private]
IsAttributeSet(DWORD dwAttribute) | CStaticNode | [inline]
CBaseNode::IsAttributeSet(DWORD dwAttribute)=0 | CBaseNode | [pure virtual]
isDirty() | CStaticNode | [inline]
isDirty() | CStaticNode | [inline]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
m_dwAttributes | CBaseNode |
m_hAddDeviceDlg | CStaticNode |
m_hMessageWnd | CStaticNode | [private]
m_hParentHScopeItem | CStaticNode | [private]
m_hStaticNode | CStaticNode | [private]
m_NodeList | CStaticNode | [private]
m_nPropPageCount | CBaseNode | [protected]
m_pAttributeStr | CBaseNode |
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pCompData | CStaticNode | [private]
m_pComponentData | CDelegationBase |
m_pwszNodeName | CBaseNode | [protected]
m_RDI | CBaseNode |
m_SDI | CBaseNode |
m_thisGUID | CStaticNode | [private, static]
NUMBER_OF_CHILDREN enum value | CStaticNode | [private]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnContextHelp(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
CBaseNode::OnContextHelp(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnCutOrMove(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
CBaseNode::OnCutOrMove(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnDelete(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
CDelegationBase::OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
CBaseNode::OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
CBaseNode::OnDelete(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CStaticNode |
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CStaticNode |
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CStaticNode | [virtual]
CBaseNode::OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
CBaseNode::OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CDelegationBase | [inline, virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
CDelegationBase::OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
CBaseNode::OnPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
CDelegationBase::OnQueryPaste(CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
CBaseNode::OnQueryPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CStaticNode |
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CStaticNode |
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CStaticNode |
CBaseNode::OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
CBaseNode::OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
CDelegationBase::OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
CBaseNode::OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode |
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode |
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
CDelegationBase::OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
CDelegationBase::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
CDelegationBase::OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
CBaseNode::OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
CBaseNode::OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode |
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode |
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode |
CDelegationBase::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
CBaseNode::OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
CBaseNode::OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CStaticNode | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CStaticNode | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CStaticNode | [inline]
CBaseNode::OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CBaseNode | [inline, virtual]
CBaseNode::OnViewChange(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CBaseNode | [inline, virtual]
QueryForPropertyPage() | CStaticNode | [inline]
QueryForPropertyPage() | CStaticNode | [inline]
CBaseNode::QueryForPropertyPage()=0 | CBaseNode | [pure virtual]
RefreshNodeList() | CStaticNode | [private]
RefreshNodeList() | CStaticNode | [private]
RefreshNodeList() | CStaticNode | [private]
RefreshNodeList() | CStaticNode | [private]
RefreshNodeList() | CStaticNode | [private]
RemoveAttribute(DWORD dwAttribute) | CStaticNode | [inline]
CBaseNode::RemoveAttribute(DWORD dwAttribute)=0 | CBaseNode | [pure virtual]
RemoveChildNodes() | CStaticNode | [private]
RemoveNodes() | CStaticNode | [private]
RemoveNodes() | CStaticNode | [private]
RemoveNodes() | CStaticNode | [private]
RemoveNodes() | CStaticNode | [private]
RemoveNodes() | CStaticNode | [private]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetAttribute(DWORD dwAttribute) | CStaticNode | [inline]
CBaseNode::SetAttribute(DWORD dwAttribute)=0 | CBaseNode | [pure virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CStaticNode | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
snapInData | CStaticNode | [private]
StaticNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CStaticNode | [static]
StaticNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CStaticNode | [static]
StaticNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CStaticNode | [static]
StaticNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CStaticNode | [static]
StaticNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CStaticNode | [static]
StaticNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CStaticNode | [static]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CDelegationBase | [inline, virtual]
thisGUID | CStaticNode | [private, static]
thisGuid | CStaticNode | [private, static]
ToggleStatus(LPDATAOBJECT ipDataObject) | CStaticNode |
ToggleStatus(LPDATAOBJECT ipDataObject) | CStaticNode |
ToggleStatus(LPDATAOBJECT ipDataObject) | CStaticNode |
ToggleStatus(LPDATAOBJECT ipDataObject) | CStaticNode |
ToggleStatus(LPDATAOBJECT ipDataObject) | CStaticNode |
ToggleStatus(LPDATAOBJECT ipDataObject) | CStaticNode |
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
~CStaticNode() | CStaticNode | [virtual]
Generated on Wed Nov 13 2024 16:57:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Helper.Cpp Source File

  • NetDS
  • SyncMgr
  • SyncDir

Helper.Cpp

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 // just some stuff to help out.
00013
00014 #include "precomp.h"
00015
00016 //+---------------------------------------------------------------------------
00017 //
00018 //  Function:   CalcListViewWidth, public
00019 //
00020 //  Synopsis:   Given a ListView determines width of client size
00021 //              subtracting off the scrollbar.
00022 //
00023 //  Arguments:
00024 //
00025 //  Returns:
00026 //
00027 //  Modifies:
00028 //
00029 //----------------------------------------------------------------------------
00030
00031 int CalcListViewWidth(HWND hwndList,int iDefault)
00032 {
00033 NONCLIENTMETRICSA metrics;
00034 RECT rcClientRect;
00035
00036
00037     metrics.cbSize = sizeof(metrics);
00038
00039     // explicitly ask for ANSI version of SystemParametersInfo since we just
00040     // care about the ScrollWidth and don't want to conver the LOGFONT info.
00041     if (GetClientRect(hwndList,&rcClientRect)
00042         && SystemParametersInfoA(SPI_GETNONCLIENTMETRICS,sizeof(metrics),(PVOID) &metrics,0))
00043     {
00044         // subtract off scroll bar distance
00045         rcClientRect.right -= (metrics.iScrollWidth);
00046     }
00047     else
00048     {
00049         rcClientRect.right = iDefault;  // if fail, use default
00050     }
00051
00052
00053     return rcClientRect.right;
00054 }
00055
00056
00057 //+---------------------------------------------------------------------------
00058 //
00059 //  Function:   IsValidDir, public
00060 //
00061 //  Synopsis:   Determines pDirName is a valid fullpath to a directory.
00062 //
00063 //  Arguments:
00064 //
00065 //  Returns:
00066 //
00067 //  Modifies:
00068 //
00069 //----------------------------------------------------------------------------
00070
00071 BOOL IsValidDir(TCHAR *pDirName)
00072 {
00073 BOOL fReturn = FALSE;
00074 HANDLE hFind;
00075 WIN32_FIND_DATA finddata;
00076
00077     hFind = FindFirstFile(pDirName, &finddata);
00078
00079     if (hFind != (HANDLE) -1)
00080     {
00081
00082        fReturn = (finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? TRUE : FALSE;
00083        FindClose(hFind);
00084     }
00085
00086     return fReturn;
00087 }
00088
00089 //+---------------------------------------------------------------------------
00090 //
00091 //  Function:   FormatDateTime, public
00092 //
00093 //  Synopsis:   Formats the filetime into a string.
00094 //
00095 //  Arguments:
00096 //
00097 //  Returns:
00098 //
00099 //  Modifies:
00100 //
00101 //----------------------------------------------------------------------------
00102
00103 TCHAR *FormatDateTime(FILETIME *pft,TCHAR *pszDatetimeBuf,DWORD cbBufSize)
00104 {
00105 TCHAR * pDateTime = pszDatetimeBuf;
00106 int cchWritten;
00107 SYSTEMTIME sysTime;
00108 FILETIME ftLocal;
00109
00110   FileTimeToLocalFileTime(pft,&ftLocal);
00111   FileTimeToSystemTime(&ftLocal,&sysTime);
00112
00113     // insert date in form of date<space>hour
00114     *pDateTime = NULL;
00115
00116     // want to insert the date
00117     if (cchWritten = GetDateFormat(NULL,DATE_SHORTDATE,&sysTime,NULL,pDateTime,cbBufSize))
00118     {
00119         pDateTime += (cchWritten -1); // move number of characters written. (cchWritten includes the NULL)
00120         *pDateTime = TEXT(' '); // pDateTime is now ponting at the NULL character.
00121         ++pDateTime;
00122
00123         // no try to get the hours if fails we make sure that the last char is NULL;
00124         if (!GetTimeFormat(NULL,TIME_NOSECONDS,&sysTime,NULL,pDateTime,cbBufSize - cchWritten))
00125         {
00126             *pDateTime = NULL;
00127         }
00128     }
00129
00130
00131     return pszDatetimeBuf;
00132 }
00133
00134
00135
00136 //+---------------------------------------------------------------------------
00137 //
00138 //  Function:   lstrcpyX, public
00139 //
00140 //  Synopsis:   Implements WideChar strcpy so can use on Win9x
00141 //
00142 //  Arguments:
00143 //
00144 //  Returns:
00145 //
00146 //  Modifies:
00147 //
00148 //----------------------------------------------------------------------------
00149
00150 LPWSTR lstrcpyX(
00151     LPWSTR lpString1,
00152     LPCWSTR lpString2
00153     )
00154 {
00155     LPWSTR lpDest = lpString1;
00156
00157     Assert(lpString1);
00158     Assert(lpString2);
00159
00160     while( *lpDest++ = *lpString2++ )
00161         ;
00162     return lpString1;
00163 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/enumdesk.h Source File

  • WinUI
  • Shell
  • EnumDesk

enumdesk.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          EnumDesk.h
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include <windows.h>
00023
00024 typedef struct
00025    {
00026    LPSHELLFOLDER  pParentFolder;
00027    LPITEMIDLIST   pidlFQ;
00028    LPITEMIDLIST   pidlRel;
00029    }ITEMINFO, FAR *LPITEMINFO;
00030
00031 /**************************************************************************
00032    function prototypes
00033 **************************************************************************/
00034
00035 LPITEMIDLIST Pidl_Concatenate(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
00036 LPITEMIDLIST Pidl_Copy(LPCITEMIDLIST pidlSource);
00037 void Pidl_Free(LPITEMIDLIST);
00038
00039 /**************************************************************************
00040    global variables and definitions
00041 **************************************************************************/
00042
00043 extern HINSTANCE     g_hInst;
00044 extern LPMALLOC      g_pMalloc;
00045 extern IContextMenu2 *g_pcm2;
00046
00047 #define IDC_TREEVIEW 2000
00048 #define IDC_LISTVIEW 2001
00049
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/comp.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

comp.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "Comp.h"
00017 #include "CompData.h"
00018 #include "DataObj.h"
00019 #include "Resource.h"
00020 #include "StaticNode.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CComponent")
00026
00027
00028 //---------------------------------------------------------------------------
00029 //  Our default constuctor provides a pointer to the parent CComponentData
00030 //  class which we cache for use in later samples.
00031 //
00032 CComponent::CComponent
00033 (
00034   CComponentData*  pParent   //[in] Points to parent object
00035 )
00036 {
00037   _ASSERT( NULL != pParent );
00038
00039   m_cRef           = 0;
00040   m_hImageStrip16  = NULL;
00041   m_hImageStrip32  = NULL;
00042   m_ipConsole      = NULL;
00043   m_ipConsoleVerb  = NULL;
00044   m_ipResultData   = NULL;
00045   m_ipHeaderCtrl2  = NULL;
00046   m_pComponentData = pParent;
00047
00048
00049 }
00050
00051 //---------------------------------------------------------------------------
00052 CComponent::~CComponent()
00053 {
00054 }
00055
00056 /////////////////////////////////////////////////////////////////////////////
00057 //  Implementation of IUnknown
00058
00059 //---------------------------------------------------------------------------
00060 STDMETHODIMP CComponent::QueryInterface
00061 (
00062   REFIID   riid,       //[in] Identifier of the requested interface
00063   LPVOID   *ppv        //[out] Address of requested interface
00064 )
00065 {
00066   if( !ppv )
00067     return E_FAIL;
00068
00069   *ppv = NULL;
00070
00071   if( IsEqualIID(riid, IID_IUnknown) )
00072     *ppv = static_cast<IComponent*>(this);
00073   else if( IsEqualIID(riid, IID_IComponent) )
00074     *ppv = static_cast<IComponent*>(this);
00075   else if( IsEqualIID(riid, IID_IComponent2) )
00076     *ppv = static_cast<IComponent2*>(this);
00077
00078   if( *ppv )
00079   {
00080     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00081     return S_OK;
00082   }
00083
00084   return E_NOINTERFACE;
00085 }
00086
00087 //---------------------------------------------------------------------------
00088 STDMETHODIMP_(ULONG) CComponent::AddRef()
00089 {
00090   return InterlockedIncrement((LONG*)&m_cRef);
00091 }
00092
00093 //---------------------------------------------------------------------------
00094 STDMETHODIMP_(ULONG) CComponent::Release()
00095 {
00096   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00097   {
00098     delete this;
00099     return 0;
00100   }
00101   return m_cRef;
00102 }
00103
00104 /////////////////////////////////////////////////////////////////////////////
00105 // Implementation of IComponent
00106
00107 //---------------------------------------------------------------------------
00108 STDMETHODIMP CComponent::Initialize
00109 (
00110   LPCONSOLE ipConsole    //[in] Points to the console's IUnknown
00111 )
00112 {
00113   HRESULT hResult = S_FALSE;
00114
00115   do
00116   {
00117     hResult = ipConsole->QueryInterface( IID_IConsole3,(VOID**)&m_ipConsole );
00118     BREAK_ON_ERROR( hResult );
00119
00120     hResult = m_ipConsole->QueryConsoleVerb( &m_ipConsoleVerb );
00121     BREAK_ON_ERROR( hResult );
00122
00123     hResult = m_ipConsole->QueryInterface( IID_IResultData2,(VOID**)&m_ipResultData );
00124     BREAK_ON_ERROR( hResult );
00125
00126     hResult = m_ipConsole->QueryInterface( IID_IHeaderCtrl2,(VOID**)&m_ipHeaderCtrl2 );
00127     BREAK_ON_ERROR( hResult );
00128
00129     // Load the bitmaps from the dll for the results pane
00130     m_hImageStrip16 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_16));
00131     if( NULL == m_hImageStrip16 )
00132     {
00133       hResult = S_FALSE;
00134       continue;
00135     }
00136
00137     m_hImageStrip32 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_32));
00138     if( NULL == m_hImageStrip32 )
00139     {
00140       hResult = S_FALSE;
00141       continue;
00142     }
00143
00144   }while( 0 );
00145
00146   TRACE_HRESULT(_T("Initialize"), hResult );
00147   return hResult;
00148 }
00149
00150
00151 //---------------------------------------------------------------------------
00152 STDMETHODIMP CComponent::Notify
00153 (
00154   LPDATAOBJECT     ipDataObject,   //[in] Points to the selected data object
00155   MMC_NOTIFY_TYPE  MmcEvent,       //[in] Identifies action taken by user
00156   LONG             nArg,           //[in] Depends on the notification type
00157   LONG             nParam          //[in] Depends on the notification type
00158 )
00159 {
00160   HRESULT hResult = S_FALSE;       // Return this for unhandled notifications
00161   TRACE_EVENT( _T("Notify"), MmcEvent );
00162
00163   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00164   if( NULL == pNode )
00165     return E_FAIL;
00166
00167
00168   switch( MmcEvent )
00169   {
00170     case MMCN_ADD_IMAGES:
00171       hResult = OnAddImages( ipDataObject, nArg, nParam );
00172       break;
00173
00174     case MMCN_SELECT:
00175       hResult = pNode->OnSelect( ipDataObject, nArg, nParam, (LONG_PTR)this );
00176       break;
00177
00178     case MMCN_SHOW:
00179       hResult = pNode->OnShow( ipDataObject, nArg, nParam, (LONG_PTR)this );
00180       break;
00181
00182     default:
00183       break;
00184
00185   }
00186   return hResult;
00187 }
00188
00189 //---------------------------------------------------------------------------
00190 STDMETHODIMP CComponent::Destroy
00191 (
00192   MMC_COOKIE nCookie   //[in] Not used
00193 )
00194 {
00195   SAFE_RELEASE( m_ipConsole     );
00196   SAFE_RELEASE( m_ipHeaderCtrl2 );
00197   SAFE_RELEASE( m_ipResultData  );
00198   SAFE_RELEASE( m_ipConsoleVerb );
00199
00200   SAFE_FREE_BITMAP( m_hImageStrip16 );
00201   SAFE_FREE_BITMAP( m_hImageStrip32 );
00202
00203   return S_OK;
00204 }
00205
00206 //---------------------------------------------------------------------------
00207 STDMETHODIMP CComponent::QueryDataObject
00208 (
00209   MMC_COOKIE              nCookie,     //[in]  Indentifier of the selected node
00210   DATA_OBJECT_TYPES       nEnumType,   //[in]  Context in which this object was created
00211   LPDATAOBJECT __RPC_FAR* ppDataObject //[out] Points to data object we create
00212 )
00213 {
00214   TRACE_HRESULT( _T("QueryDataObject"), E_NOTIMPL );
00215   return E_NOTIMPL;
00216 }
00217
00218 //---------------------------------------------------------------------------
00219 //  This method not used when the Console's QI for IComponent2 is successful
00220 //
00221 STDMETHODIMP CComponent::GetResultViewType
00222 (
00223   MMC_COOKIE          nCookie,     //[in]  Indentifier of selected node
00224   LPOLESTR __RPC_FAR* ppViewType,  //[out] Points to view type string
00225   long __RPC_FAR*     pViewOptions //[out] Points to MMC_VIEW_OPTIONS enumeration
00226 )
00227 {
00228   return E_NOTIMPL;
00229 }
00230
00231
00232 //---------------------------------------------------------------------------
00233 STDMETHODIMP CComponent::GetDisplayInfo
00234 (
00235   RESULTDATAITEM __RPC_FAR* pResultDataItem  //[in][out] Result item struct
00236 )
00237 {
00238   _ASSERT( NULL != pResultDataItem );
00239
00240   HRESULT  hResult = S_FALSE;
00241
00242   if( TRUE == pResultDataItem->bScopeItem )       // This is a scope item...
00243   {
00244     LPBASENODE pNode = reinterpret_cast<LPBASENODE>(pResultDataItem->lParam);
00245     hResult = pNode->GetDisplayInfo( pResultDataItem );
00246   }
00247   else
00248   {
00249     _ASSERT( FALSE );        // No result items in this project
00250   }
00251
00252   return hResult;
00253
00254   TRACE_HRESULT( _T("GetDisplayInfo"), hResult );
00255   return hResult;
00256 }
00257
00258 //---------------------------------------------------------------------------
00259 STDMETHODIMP CComponent::CompareObjects
00260 (
00261   LPDATAOBJECT ipDataObjectA,    //[in] First data object to compare
00262   LPDATAOBJECT ipDataObjectB     //[in] Second data object to compare
00263 )
00264 {
00265   return E_NOTIMPL;
00266 }
00267
00268 //---------------------------------------------------------------------------
00269 HRESULT CComponent::QueryDispatch
00270 (
00271   MMC_COOKIE         nCookie,    //[in]  Item for which IDispatch is requested
00272   DATA_OBJECT_TYPES  eType,      //[in]  Context of item
00273   LPDISPATCH*        pipDispatch //[out] IDispatch pointer
00274 )
00275 {
00276   return E_NOTIMPL;
00277 }
00278
00279
00280 //---------------------------------------------------------------------------
00281 //  This method is called to retrieve Result View information when the
00282 //  Snap-in supports IComponent2.  Incomplete implementation could
00283 //  result in the error:  "Snap-in failed to initialize"
00284 //
00285 HRESULT CComponent::GetResultViewType2
00286 (
00287   MMC_COOKIE             nCookie,  //[in] Identifier of object
00288   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00289 )
00290 {
00291   HRESULT hResult = S_FALSE;
00292
00293   if( NULL == nCookie )
00294   {
00295     CStaticNode* pNode = m_pComponentData->GetStaticNode();
00296     hResult = pNode->GetResultViewType2( nCookie, pRVTinfo );
00297   }
00298   else
00299   {
00300     CBaseNode* pNode = reinterpret_cast<CBaseNode*>(nCookie);
00301     hResult = pNode->GetResultViewType2( nCookie, pRVTinfo );
00302   }
00303
00304   TRACE_HRESULT(_T("GetResultViewType2"), hResult );
00305   return hResult;
00306 }
00307
00308
00309 //---------------------------------------------------------------------------
00310 HRESULT CComponent::RestoreResultView
00311 (
00312   MMC_COOKIE             nCookie,  //[in] Identifier of object
00313   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00314 )
00315 {
00316   return E_NOTIMPL;
00317 }
00318
00319
00320 /////////////////////////////////////////////////////////////////////////////
00321 //  Notification handlers
00322
00323
00324 //---------------------------------------------------------------------------
00325 HRESULT CComponent::OnAddImages
00326 (
00327   LPDATAOBJECT   ipDataObject, //[in] Points to the selected data object
00328   LONG           nArg,         //[in] Pointer to IImageList
00329   LONG           nParam        //[in] HSCOPEITEM of selected/deselected item
00330
00331 )
00332 {
00333   HRESULT hResult = S_FALSE;
00334
00335   if( NULL != nArg )           // May get this when shutting down
00336   {
00337     IImageList* ipImageList = reinterpret_cast<IImageList*>(nArg);
00338     hResult = ipImageList->ImageListSetStrip( (LONG*)m_hImageStrip16,
00339                                               (LONG*)m_hImageStrip32,
00340                                               0,
00341                                               RGB(0,255,0)
00342                                             );
00343   }
00344   TRACE_HRESULT(_T("OnAddImages"), hResult );
00345   return hResult;
00346
00347 }
00348
00349 /////////////////////////////////////////////////////////////////////////////
00350 //  Public helper methods
00351
00352 //---------------------------------------------------------------------------
00353 //  Supplies interfaces to node objects.
00354 //
00355 HRESULT CComponent::GetInterface
00356 (
00357   DWORD dwRequestedInterface,  //[in] Request flag
00358   LONG_PTR* ppInterface        //[in-out] Interface pointer to return
00359 )
00360 {
00361   _ASSERT( NULL != ppInterface );
00362   HRESULT hResult = S_OK;
00363
00364   switch( dwRequestedInterface )
00365   {
00366     case REQUEST_ICONSOLE:
00367       _ASSERT( NULL != m_ipConsole );
00368       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsole);
00369       break;
00370
00371     case REQUEST_ICONSOLEVERB:
00372       _ASSERT( NULL != m_ipConsoleVerb );
00373       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsoleVerb);
00374       break;
00375
00376     case REQUEST_IRESULTDATA:
00377       _ASSERT( NULL != m_ipResultData );
00378       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipResultData);
00379       break;
00380
00381     case REQUEST_IHEADERCTRL2:
00382       _ASSERT( NULL != m_ipHeaderCtrl2 );
00383       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipHeaderCtrl2);
00384       break;
00385
00386     default:
00387       hResult = S_FALSE;
00388       *ppInterface = NULL;
00389       break;
00390   }
00391   return hResult;
00392 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHtmlElementBag Member List

This is the complete list of members for CHtmlElementBag, including all inherited members.
_aBagEntry | CHtmlElementBag | [private]
_uCurSize | CHtmlElementBag | [private]
_uMaxSize | CHtmlElementBag | [private]
AddElement(HtmlTokenType eTokType, CHtmlElement *pHtmlElement) | CHtmlElementBag |
CHtmlElementBag(unsigned cElems) | CHtmlElementBag |
QueryElement(HtmlTokenType eTokType) | CHtmlElementBag |
~CHtmlElementBag() | CHtmlElementBag |
Generated on Wed Nov 13 2024 16:56:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/iphdrinc/rawudp.c Source File

  • NetDS
  • WinSock
  • iphdrinc

rawudp.c

Go to the documentation of this file.
00001 //
00002 // Sample: Raw IPv4/IPv6 UDP with IP_HDRINCL option
00003 //
00004 // Files:
00005 //      rawudp.c      - this file
00006 //      iphdr.h       - IPv4, IPv6, and UDP structure definitions
00007 //      resolve.c     - common name resolution routines
00008 //      resolve.h     - header file for common name resolution routines
00009 //
00010 //
00011 // Description:
00012 //    This is a simple app that demonstrates the usage of the
00013 //    IP_HDRINCL socket option. A raw socket is created of the
00014 //    UDP protocol where we will build our own IP and UDP header
00015 //    that we submit to sendto().
00016 //
00017 //    For IPv4 this is fairly simple. Create a raw socket, set the
00018 //    IP_HDRINCL option, build the IPv4 and UDP headers, and do a
00019 //    sendto. The IPv4 stack will fragment the data as necessary and
00020 //    generally leaves the packet unmodified -- it performs fragmentation
00021 //    and sets the IPv4 ID field.
00022 //
00023 //    For IPv6 its a bit more involved as it does not perform any
00024 //    fragmentation, you have to do it and build the headers yourself.
00025 //
00026 //    The IP_HDRINCL option only works on Windows 2000 or greater.
00027 //
00028 // NOTE:
00029 //    From Network Programming for Microsoft Windows, Second Edition
00030 //    by Anthony Jones and James Ohlund.  Copyright 2002.
00031 //    Reproduced by permission of Microsoft Press.  All rights reserved.
00032 //
00033 #ifndef WIN32_LEAN_AND_MEAN
00034 #define WIN32_LEAN_AND_MEAN
00035 #endif
00036
00037 #pragma warning(push)
00038 #pragma warning(disable: 4127)
00039
00040 #include <winsock2.h>
00041 #include <ws2tcpip.h>
00042
00043 #include <stdio.h>
00044 #include <stdlib.h>
00045
00046 #include "resolve.h"
00047
00048 #include "iphdr.h"
00049
00050 //
00051 // Setup some default values
00052 //
00053 #define DEFAULT_MTU           1496          // default MTU size
00054 #define DEFAULT_TTL           8             // default TTL value
00055
00056 #define MAX_PACKET           (0xFFFF + sizeof(IPV6_HDR))  // maximum datagram size
00057 #define MAX_PACKET_FRAGMENTS  100
00058
00059 #define DEFAULT_PORT          5150          // default port to send to
00060 #define DEFAULT_COUNT         5             // default number of messages to send
00061 #define DEFAULT_MESSAGE       "This is a test"  // default message
00062
00063 #define DEFAULT_SEND_COUNT    10
00064
00065 #define FRAGMENT_HEADER_PROTOCOL    44      // protocol value for IPv6 fragmentation header
00066
00067 //
00068 // Global variables
00069 //
00070 char     *gSrcAddress=NULL,          // IP address to send from
00071          *gDestAddress=NULL,         // IP address to send to
00072          *gSrcPort=NULL,             // port to send from
00073          *gDestPort=NULL,            // port to send to
00074          *gMessage=NULL;             // Message to send as UDP payload
00075 int       gAddressFamily=AF_UNSPEC,
00076           gSocketType=SOCK_DGRAM,    // Socket type to pass to name resolution routines
00077           gProtocol=IPPROTO_UDP,     // Protocol value that we're sending
00078           gSendSize=0,               // Data size of message to send
00079           gMtuSize=DEFAULT_MTU;      // Maximum transmission unit to use
00080 DWORD     gSendCount=DEFAULT_SEND_COUNT; // number of times to send
00081 BOOL      gSender=TRUE,              // sending or receiving data
00082           gReadRaw=TRUE;             // Use raw sockets when reading
00083
00084 //
00085 // Function: usage:
00086 //
00087 // Description:
00088 //    Print usage information and exit.
00089 //
00090 void usage(char *progname)
00091 {
00092     printf("usage: %s [-sp int] [-sa str] [-dp int] [-da str] [-n int] [-m str] ...\n"
00093            "    -a  4|6    Address family\n"
00094            "    -sa addr   From (sender) port number\n"
00095            "    -sp int    From (sender) IP address\n"
00096            "    -da addr   To (recipient) port number\n"
00097            "    -dp int    To (recipient) IP address\n"
00098            "    -n  int    Number of times to read message\n"
00099            "    -m  str    String message to fill packet data with\n"
00100            "    -p  proto  Protocol value\n"
00101            "    -r  port   Receive raw (SOCK_RAW) datagrams on the given port\n"
00102            "    -rd port   Receive datagram (SOCK_DGRAM) on the given port\n"
00103            "    -t  mtu    MTU size (required for fragmentation)\n"
00104            "    -z  int    Size of message to send\n",
00105            progname
00106            );
00107     ExitProcess(1);
00108 }
00109
00110 //
00111 // Function: ValidateArgs
00112 //
00113 // Description:
00114 //    Parse the command line arguments and set some global flags to
00115 //    indicate what actions to perform.
00116 //
00117 void ValidateArgs(int argc, char **argv)
00118 {
00119     int                i;
00120
00121     gMessage = DEFAULT_MESSAGE;
00122     for(i=1; i < argc ;i++)
00123     {
00124         if ((argv[i][0] == '-') || (argv[i][0] == '/'))
00125         {
00126             switch (tolower(argv[i][1]))
00127             {
00128                 case 'a':                   // Address family
00129                     if (i+1 > argc)
00130                         usage(argv[0]);
00131                     if (argv[i+1][0] == '4')
00132                         gAddressFamily = AF_INET;
00133                     else if (argv[i+1][0] == '6')
00134                         gAddressFamily = AF_INET6;
00135                     else
00136                         usage(argv[0]);
00137                     i++;
00138                     break;
00139                 case 's':                   // source address
00140                     if (i+1 > argc)
00141                         usage(argv[0]);
00142                     if (tolower(argv[i][2]) == 'a')
00143                     {
00144                         gSrcAddress = argv[++i];
00145                     }
00146                     else if (tolower(argv[i][2]) == 'p')
00147                     {
00148                         gSrcPort = argv[++i];
00149                     }
00150                     else
00151                     {
00152                         usage(argv[0]);
00153                         break;
00154                     }
00155                     break;
00156                 case 'd':                   // destination address
00157                     if (i+1 > argc)
00158                         usage(argv[0]);
00159                     if (tolower(argv[i][2]) == 'a')
00160                     {
00161                         gDestAddress = argv[++i];
00162                     }
00163                     else if (tolower(argv[i][2]) == 'p')
00164                     {
00165                         gDestPort = argv[++i];
00166                     }
00167                     else
00168                     {
00169                         usage(argv[0]);
00170                         break;
00171                     }
00172                     break;
00173                 case 'n':                   // number of times to send message
00174                     if (i+1 >= argc)
00175                         usage(argv[0]);
00176                     gSendCount = atol(argv[++i]);
00177                     break;
00178                 case 'm':                   // String message to copy into payload
00179                     if (i+1 >= argc)
00180                         usage(argv[0]);
00181                     gMessage = argv[++i];
00182                     break;
00183                 case 'p':                   // Protocol value
00184                     if (i+1 >= argc)
00185                         usage(argv[0]);
00186                     gProtocol = atoi(argv[++i]);
00187                     break;
00188                 case 'r':                   // Port to receive data on
00189                     if (i+1 >= argc)
00190                         usage(argv[0]);
00191                     if (strlen(argv[i]) == 3)
00192                         gReadRaw = FALSE;
00193                     gSrcPort = argv[++i];
00194                     gSender = FALSE;
00195                     break;
00196                 case 't':                   // MTU size
00197                     if (i+1 >= argc)
00198                         usage(argv[0]);
00199                     gMtuSize = atoi(argv[++i]);
00200                     break;
00201                 case 'z':                   // Send size
00202                     if (i+1 >= argc)
00203                         usage(argv[0]);
00204                     gSendSize = atoi(argv[++i]);
00205                     break;
00206                 default:
00207                     usage(argv[0]);
00208                     break;
00209             }
00210         }
00211     }
00212
00213     // If no data size was given, initialize it to the message supplied
00214     if (gSendSize == 0)
00215     {
00216         gSendSize = (int) strlen(gMessage);
00217     }
00218
00219     // Do some simple validation of input
00220     if (gSender)
00221     {
00222         if ((gSrcAddress == NULL) || (gDestAddress == NULL))
00223         {
00224             fprintf(stderr, "\nSource and destination addresses must be specified!\n\n");
00225             usage(argv[0]);
00226         }
00227     }
00228     else
00229     {
00230         if (gSrcAddress == NULL)
00231         {
00232             fprintf(stderr, "\nSource address must be specified!\n\n");
00233             usage(argv[0]);
00234         }
00235     }
00236
00237     return;
00238 }
00239
00240 //
00241 // Function: checksum
00242 //
00243 // Description:
00244 //    This function calculates the 16-bit one's complement sum
00245 //    for the supplied buffer.
00246 //
00247 USHORT checksum(USHORT *buffer, int size)
00248 {
00249     unsigned long cksum=0;
00250
00251     while (size > 1)
00252     {
00253         cksum += *buffer++;
00254         size  -= sizeof(USHORT);
00255     }
00256     // If the buffer was not a multiple of 16-bits, add the last byte
00257     if (size)
00258     {
00259         cksum += *(UCHAR*)buffer;
00260     }
00261     // Add the low order 16-bits to the high order 16-bits
00262     cksum = (cksum >> 16) + (cksum & 0xffff);
00263     cksum += (cksum >>16);
00264
00265     // Take the 1's complement
00266     return (USHORT)(~cksum);
00267 }
00268
00269 //
00270 // Function: InitIpv4Header
00271 //
00272 // Description:
00273 //    Initialize the IPv4 header with the version, header length,
00274 //    total length, ttl, protocol value, and source and destination
00275 //    addresses.
00276 //
00277 int InitIpv4Header(
00278     char *buf,
00279     SOCKADDR *src,
00280     SOCKADDR *dest,
00281     int ttl,
00282     int proto,
00283     int payloadlen
00284     )
00285 {
00286     IPV4_HDR    *v4hdr=NULL;
00287
00288     v4hdr = (IPV4_HDR *)buf;
00289
00290     v4hdr->ip_verlen      = (4 << 4) | (sizeof(IPV4_HDR) / sizeof(unsigned long));
00291     v4hdr->ip_tos         = 0;
00292     v4hdr->ip_totallength = htons(sizeof(IPV4_HDR) + (USHORT) payloadlen);
00293     v4hdr->ip_id          = 0;
00294     v4hdr->ip_offset      = 0;
00295     v4hdr->ip_ttl         = (unsigned char)ttl;
00296     v4hdr->ip_protocol    = (unsigned char)proto;
00297     v4hdr->ip_checksum    = 0;
00298     v4hdr->ip_srcaddr     = ((SOCKADDR_IN *)src)->sin_addr.s_addr;
00299     v4hdr->ip_destaddr    = ((SOCKADDR_IN *)dest)->sin_addr.s_addr;
00300
00301     v4hdr->ip_checksum    = checksum((unsigned short *)v4hdr, sizeof(IPV4_HDR));
00302
00303     return sizeof(IPV4_HDR);
00304 }
00305
00306 //
00307 // Function: InitIpv6Header
00308 //
00309 // Description:
00310 //    Initialize the IPv6 header with the version, payload length, next
00311 //    hop protocol, TTL, and source and destination addresses.
00312 //
00313 int InitIpv6Header(
00314     char *buf,
00315     SOCKADDR *src,
00316     SOCKADDR *dest,
00317     int ttl,
00318     int proto,
00319     int payloadlen
00320     )
00321 {
00322     IPV6_HDR    *v6hdr=NULL;
00323
00324   v6hdr = (IPV6_HDR *)buf;
00325
00326     // We don't explicitly set the traffic class or flow label fields
00327     v6hdr->ipv6_vertcflow    = htonl(6 << 28);
00328     v6hdr->ipv6_payloadlen   = htons((unsigned short)payloadlen);
00329     v6hdr->ipv6_nexthdr      = (unsigned char)proto;
00330     v6hdr->ipv6_hoplimit     = (unsigned char)ttl;
00331     v6hdr->ipv6_srcaddr      = ((SOCKADDR_IN6 *)src)->sin6_addr;
00332     v6hdr->ipv6_destaddr     = ((SOCKADDR_IN6 *)dest)->sin6_addr;
00333
00334     return sizeof(IPV6_HDR);
00335 }
00336
00337 //
00338 // Function: InitIpv6FragmentHeader
00339 //
00340 // Description:
00341 //    Initialize the IPv6 fragmentation header. The offset is the offset
00342 //    from the start of the IPv6 total payload (which includes the UDP
00343 //    header along with the data) which is why we add the length of
00344 //    the UDP header if this fragment is not the first fragment. Also,
00345 //    the lastfragment parameter is a boolean value (0 == not the last
00346 //    fragment while 1 == this is the last fragment) which is the opposite
00347 //    value thats supposed to be indicated in the header (i.e. 0 indicates
00348 //    that this fragment is the last fragment).
00349 //
00350 int InitIpv6FragmentHeader(
00351     char *buf,
00352     unsigned long offset,
00353     int nextproto,
00354     int id,
00355     int lastfragment
00356     )
00357 {
00358     IPV6_FRAGMENT_HDR *frag=NULL;
00359
00360     frag = (IPV6_FRAGMENT_HDR *)buf;
00361
00362     // Swap the value of this field
00363     lastfragment = (lastfragment ? 0 : 1);
00364
00365     // Account for the size of the UDP header
00366     if (offset != 0)
00367         offset += sizeof(UDP_HDR);
00368
00369     frag->ipv6_frag_nexthdr = (unsigned char)nextproto;
00370     frag->ipv6_frag_offset  = htons( (unsigned short)(((offset/8) << 3) | lastfragment));
00371     frag->ipv6_frag_id      = htonl(id);
00372
00373     return sizeof(IPV6_FRAGMENT_HDR);
00374 }
00375
00376 //
00377 // Function: InitUdpHeader
00378 //
00379 // Description:
00380 //    Setup the UDP header which is fairly simple. Grab the ports and
00381 //    stick in the total payload length.
00382 //
00383 int InitUdpHeader(
00384     char *buf,
00385     SOCKADDR *src,
00386     SOCKADDR *dest,
00387     int       payloadlen
00388     )
00389 {
00390     UDP_HDR *udphdr=NULL;
00391
00392     udphdr = (UDP_HDR *)buf;
00393
00394     // Port numbers are already in network byte order
00395     if (src->sa_family == AF_INET)
00396     {
00397         udphdr->src_portno = ((SOCKADDR_IN *)src)->sin_port;
00398         udphdr->dst_portno = ((SOCKADDR_IN *)dest)->sin_port;
00399     }
00400     else if (src->sa_family == AF_INET6)
00401     {
00402         udphdr->src_portno = ((SOCKADDR_IN6 *)src)->sin6_port;
00403         udphdr->dst_portno = ((SOCKADDR_IN6 *)dest)->sin6_port;
00404     }
00405     udphdr->udp_length = htons(sizeof(UDP_HDR) + (USHORT)payloadlen);
00406
00407     return sizeof(UDP_HDR);
00408 }
00409
00410 //
00411 // Function: ComputeUdpPseudoHeaderChecksumV4
00412 //
00413 // Description:
00414 //    Compute the UDP pseudo header checksum. The UDP checksum is based
00415 //    on the following fields:
00416 //       o source IP address
00417 //       o destination IP address
00418 //       o 8-bit zero field
00419 //       o 8-bit protocol field
00420 //       o 16-bit UDP length
00421 //       o 16-bit source port
00422 //       o 16-bit destination port
00423 //       o 16-bit UDP packet length
00424 //       o 16-bit UDP checksum (zero)
00425 //       o UDP payload (padded to the next 16-bit boundary)
00426 //
00427 //    This routine uses a temporary buffer passed into the function (pseudobuf)
00428 //    for computing the pseudo-checksum. It is assumed this buffer is large enough.
00429 //
00430 void ComputeUdpPseudoHeaderChecksumV4(
00431     char    *pseudobuf,
00432     void    *iphdr,
00433     UDP_HDR *udphdr,
00434     char    *payload,
00435     int      payloadlen
00436     )
00437 {
00438     IPV4_HDR     *v4hdr=NULL;
00439     unsigned long zero=0;
00440     char         *ptr=NULL;
00441     int           chksumlen=0,
00442                   i;
00443
00444     ptr = pseudobuf;
00445
00446     v4hdr = (IPV4_HDR *)iphdr;
00447
00448     // Include the source and destination IP addresses
00449     memcpy(ptr, &v4hdr->ip_srcaddr,  sizeof(v4hdr->ip_srcaddr));
00450     ptr += sizeof(v4hdr->ip_srcaddr);
00451     chksumlen += sizeof(v4hdr->ip_srcaddr);
00452
00453     memcpy(ptr, &v4hdr->ip_destaddr, sizeof(v4hdr->ip_destaddr));
00454     ptr += sizeof(v4hdr->ip_destaddr);
00455     chksumlen += sizeof(v4hdr->ip_destaddr);
00456
00457     // Include the 8 bit zero field
00458     memcpy(ptr, &zero, 1);
00459     ptr++;
00460     chksumlen += 1;
00461
00462     // Protocol
00463     memcpy(ptr, &v4hdr->ip_protocol, sizeof(v4hdr->ip_protocol));
00464     ptr += sizeof(v4hdr->ip_protocol);
00465     chksumlen += sizeof(v4hdr->ip_protocol);
00466
00467     // UDP length
00468     memcpy(ptr, &udphdr->udp_length, sizeof(udphdr->udp_length));
00469     ptr += sizeof(udphdr->udp_length);
00470     chksumlen += sizeof(udphdr->udp_length);
00471
00472     // UDP source port
00473     memcpy(ptr, &udphdr->src_portno, sizeof(udphdr->src_portno));
00474     ptr += sizeof(udphdr->src_portno);
00475     chksumlen += sizeof(udphdr->src_portno);
00476
00477     // UDP destination port
00478     memcpy(ptr, &udphdr->dst_portno, sizeof(udphdr->dst_portno));
00479     ptr += sizeof(udphdr->dst_portno);
00480     chksumlen += sizeof(udphdr->dst_portno);
00481
00482     // UDP length again
00483     memcpy(ptr, &udphdr->udp_length, sizeof(udphdr->udp_length));
00484     ptr += sizeof(udphdr->udp_length);
00485     chksumlen += sizeof(udphdr->udp_length);
00486
00487     // 16-bit UDP checksum, zero
00488     memcpy(ptr, &zero, sizeof(unsigned short));
00489     ptr += sizeof(unsigned short);
00490     chksumlen += sizeof(unsigned short);
00491
00492     // payload
00493     memcpy(ptr, payload, payloadlen);
00494     ptr += payloadlen;
00495     chksumlen += payloadlen;
00496
00497     // pad to next 16-bit boundary
00498     for(i=0 ; i < payloadlen%2 ; i++, ptr++)
00499     {
00500         printf("pad one byte\n");
00501         *ptr = 0;
00502         ptr++;
00503         chksumlen++;
00504     }
00505
00506     // Compute the checksum and put it in the UDP header
00507     udphdr->udp_checksum = checksum((USHORT *)pseudobuf, chksumlen);
00508
00509     return;
00510 }
00511
00512 //
00513 // Function: CompouteUdpPsuedoHeaderChecksumV6
00514 //
00515 // Description:
00516 //    Compute the pseudo header checksum for IPv6. The required fields for
00517 //    computing the psuedo checksum are:
00518 //
00519 //       o 128-bit source address
00520 //       o 128-bit destination address
00521 //       o 4-byte payload length
00522 //       o 3-byte zero pad
00523 //       o 1-byte protocol value
00524 //       o 2-byte source port
00525 //       o 2-byte destination port
00526 //       o 2-byte UDP length
00527 //       o 2-byte UDP checksum (zero)
00528 //       o UDP payload (padded to the next 16-bit boundary)
00529 //
00530 //    This routine uses a temporary buffer passed into the function (pseudobuf)
00531 //    for computing the pseudo-checksum. It is assumed this buffer is large enough.
00532 //
00533 void ComputeUdpPseudoHeaderChecksumV6(
00534     char    *pseudobuf,
00535     void    *iphdr,
00536     UDP_HDR *udphdr,
00537     char    *payload,
00538     int      payloadlen
00539     )
00540 {
00541     IPV6_HDR     *v6hdr=NULL;
00542     unsigned long length=0;
00543     char          proto,
00544                  *ptr=NULL;
00545     int           chksumlen=0,
00546                   i;
00547
00548     ptr = pseudobuf;
00549
00550     v6hdr = (IPV6_HDR *)iphdr;
00551
00552     // 128-bit source address
00553     memcpy(ptr, &v6hdr->ipv6_srcaddr,  sizeof(v6hdr->ipv6_srcaddr));
00554     ptr += sizeof(v6hdr->ipv6_srcaddr);
00555     chksumlen += sizeof(v6hdr->ipv6_srcaddr);
00556
00557     // 128-bit destination address
00558     memcpy(ptr, &v6hdr->ipv6_destaddr,  sizeof(v6hdr->ipv6_destaddr));
00559     ptr += sizeof(v6hdr->ipv6_destaddr);
00560     chksumlen += sizeof(v6hdr->ipv6_destaddr);
00561
00562     // Compute payload length in IPv6 header
00563     length = htonl(payloadlen + sizeof(UDP_HDR));
00564
00565     // 4 byte length
00566     memcpy(ptr, &length, sizeof(length));
00567     ptr += sizeof(length);
00568     chksumlen += sizeof(length);
00569
00570     // 3 bytes of zero
00571     memset(ptr, 0, 3);
00572     ptr += 3;
00573     chksumlen +=3;
00574
00575     proto = IPPROTO_UDP;
00576
00577     // 1 byte protocol value
00578     memcpy(ptr, &proto, sizeof(proto));
00579     ptr += sizeof(proto);
00580     chksumlen += sizeof(proto);
00581
00582     // UDP source port
00583     memcpy(ptr, &udphdr->src_portno, sizeof(udphdr->src_portno));
00584     ptr += sizeof(udphdr->src_portno);
00585     chksumlen += sizeof(udphdr->src_portno);
00586
00587     // UDP destination port
00588     memcpy(ptr, &udphdr->dst_portno, sizeof(udphdr->dst_portno));
00589     ptr += sizeof(udphdr->dst_portno);
00590     chksumlen += sizeof(udphdr->dst_portno);
00591
00592     // UDP length again
00593     memcpy(ptr, &udphdr->udp_length, sizeof(udphdr->udp_length));
00594     ptr += sizeof(udphdr->udp_length);
00595     chksumlen += sizeof(udphdr->udp_length);
00596
00597     // 16-bit UDP checksum, zero
00598     memset(ptr, 0, sizeof(unsigned short));
00599     ptr += sizeof(unsigned short);
00600     chksumlen += sizeof(unsigned short);
00601
00602     // payload
00603     memcpy(ptr, payload, payloadlen);
00604     ptr += payloadlen;
00605     chksumlen += payloadlen;
00606
00607     // pad to next 16-bit boundary
00608     for(i=0 ; i < payloadlen%2 ; i++, ptr++)
00609     {
00610         printf("pad one byte\n");
00611         *ptr = 0;
00612         ptr++;
00613         chksumlen++;
00614     }
00615
00616     // Compute the checksum and put it in the UDP header
00617     udphdr->udp_checksum = checksum((USHORT *)pseudobuf, chksumlen);
00618
00619     return;
00620 }
00621
00622 //
00623 // Function: memfill
00624 //
00625 // Description:
00626 //    Fills a block of memory with a given string pattern.
00627 //
00628 void memfill(
00629     char *dest,
00630     int   destlen,
00631     char *data,
00632     int   datalen
00633     )
00634 {
00635     char *ptr=NULL;
00636     int   copylen;
00637
00638     ptr = dest;
00639     while (destlen > 0)
00640     {
00641         copylen = ((destlen > datalen) ? datalen : destlen);
00642         memcpy(ptr, data, copylen);
00643
00644         destlen -= copylen;
00645         ptr += copylen;
00646     }
00647     return;
00648 }
00649
00650 //
00651 // Function: PacketizeIpv4
00652 //
00653 // Description:
00654 //    This routine takes the data buffer and packetizes it for IPv4.
00655 //    Since the IPv4 stack takes care of fragmentation for us, this
00656 //    routine simply initializes the IPv4 and UDP headers. The data
00657 //    is returned in an array of WSABUF structures.
00658 //
00659 int
00660 PacketizeIpv4(
00661     WSABUF *Packets,
00662     int    *PacketCount,
00663     char   *PseudoBuffer,
00664     struct addrinfo *src,
00665     struct addrinfo *dest,
00666     char   *payload,
00667     int    payloadlen
00668     )
00669 {
00670     int           iphdrlen,
00671                   udphdrlen;
00672
00673     // Check the parameters
00674     if ((Packets == NULL) || (PacketCount == NULL) || (src == NULL) ||
00675         (dest == NULL) || (payload == NULL) || (*PacketCount < 1))
00676     {
00677         WSASetLastError(WSAEINVAL);
00678         return SOCKET_ERROR;
00679     }
00680
00681     // Allocate memory for the packet
00682     Packets[0].buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IPV4_HDR) + sizeof(UDP_HDR) + payloadlen);
00683     if (Packets[0].buf == NULL)
00684     {
00685         fprintf(stderr, "PacetizeV4: HeapAlloc failed: %d\n", GetLastError());
00686         WSASetLastError(WSAENOBUFS);
00687         return NO_ERROR;
00688     }
00689     Packets[0].len = sizeof(IPV4_HDR) + sizeof(UDP_HDR) + payloadlen;
00690
00691     // Initialize the v4 header
00692     iphdrlen = InitIpv4Header(
00693             Packets[0].buf,
00694             src->ai_addr,
00695             dest->ai_addr,
00696             DEFAULT_TTL,
00697             gProtocol,
00698             sizeof(UDP_HDR) + payloadlen
00699             );
00700
00701     // Initialize the UDP header
00702     udphdrlen = InitUdpHeader(
00703            &Packets[0].buf[iphdrlen],
00704             src->ai_addr,
00705             dest->ai_addr,
00706             payloadlen
00707             );
00708
00709     // Compute the UDP checksum
00710     ComputeUdpPseudoHeaderChecksumV4(
00711             PseudoBuffer,
00712             Packets[0].buf,
00713             (UDP_HDR *)&Packets[0].buf[iphdrlen],
00714             payload,
00715             payloadlen
00716             );
00717
00718     // Copy the payload to the end of the header
00719     memcpy(&Packets[0].buf[iphdrlen + udphdrlen], payload, payloadlen);
00720
00721     *PacketCount = 1;
00722
00723     return NO_ERROR;
00724 }
00725
00726 //
00727 // Function: PacketizeIpv6
00728 //
00729 // Description:
00730 //    This routine fragments data payload with the appropriate IPv6
00731 //    headers. The individual fragments are returned via an array of
00732 //    WSABUF structures. Each structure is a separate fragment of the
00733 //    whole message. The end of the fragments is indicated by a WSABUF
00734 //    entry with a NULL buffer pointer.
00735 //
00736 int
00737 PacketizeIpv6(
00738     WSABUF *Packets,
00739     int    *PacketCount,
00740     char   *PseudoBuffer,
00741     struct addrinfo *src,
00742     struct addrinfo *dest,
00743     char   *payload,
00744     int    payloadlen
00745     )
00746 {
00747     static ULONG  fragid=1;
00748     int           offset=0,        // offset into payload
00749                   datalen,         // length of the payload
00750                   hdrlen,          // length of the header(s)
00751                   fragment,        // is this a fragment?
00752                   lastfragment,    // is this the last fragment?
00753                   iphdrlen,        // length of ip header
00754                   udphdrlen,       // length of the udp header
00755                   plushdrs,        // IPv6 length field includes encapsulated headers
00756                   numpackets=0,    // number of fragments
00757                   originalpayload;
00758
00759     // Check the parameters
00760     if ((Packets == NULL) || (PacketCount == NULL) || (src == NULL) ||
00761         (dest == NULL) || (payload == NULL))
00762         return SOCKET_ERROR;
00763
00764     originalpayload = payloadlen;
00765     do
00766     {
00767         if (numpackets >= *PacketCount)
00768         {
00769             fprintf(stderr, "PacketizeIpv6: Fragment count exceeded limit of %d\n",
00770                     *PacketCount);
00771             WSASetLastError(WSAEFAULT);
00772             return SOCKET_ERROR;
00773         }
00774
00775         // Compute the size of this fragment
00776         lastfragment = 0;
00777         fragment = 0;
00778         if ((payloadlen > gMtuSize) && (numpackets == 0))
00779         {
00780             // Data needs to be fragmented, this is the first packet
00781             hdrlen  = sizeof(IPV6_HDR) + sizeof(UDP_HDR) + sizeof(IPV6_FRAGMENT_HDR);
00782             datalen = gMtuSize - hdrlen;
00783             plushdrs = sizeof(UDP_HDR) + sizeof(IPV6_FRAGMENT_HDR);
00784             fragment = 1;
00785
00786             printf("Require fragmentation: FIRST packet\n");
00787         }
00788         else if ((payloadlen > gMtuSize) && (numpackets > 0))
00789         {
00790             // Data needs to be fragmented, this is packet number > 0
00791             hdrlen = sizeof(IPV6_HDR) + sizeof(IPV6_FRAGMENT_HDR);
00792             datalen = gMtuSize - hdrlen;
00793             fragment = 1;
00794             plushdrs = sizeof(IPV6_FRAGMENT_HDR);
00795
00796             printf("Require fragmentation: packet number > 0\n");
00797         }
00798         else if (numpackets == 0)
00799         {
00800             // Data doesn't need to be fragmented
00801             hdrlen = sizeof(IPV6_HDR) + sizeof(UDP_HDR);
00802             datalen = payloadlen;
00803             fragment = 0;
00804             plushdrs = sizeof(UDP_HDR);
00805
00806             printf("No fragmentation required\n");
00807         }
00808         else
00809         {
00810             // This is the last fragment
00811             hdrlen = sizeof(IPV6_HDR) + sizeof(IPV6_FRAGMENT_HDR);
00812             datalen = payloadlen;
00813             fragment = 1;
00814             plushdrs = sizeof(IPV6_FRAGMENT_HDR);
00815             lastfragment = 1;
00816
00817             printf("Require fragmentation: Last packet\n");
00818         }
00819
00820         // Build packet
00821
00822         // Allocate buffer for this fragment
00823         printf("numpackets = %d; hdrlen = %d; datlen = %d\n", numpackets, hdrlen, datalen);
00824         Packets[numpackets].buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, hdrlen + datalen);
00825         if (Packets[numpackets].buf == NULL)
00826         {
00827             fprintf(stderr, "PacketizeV6: HeapAlloc failed: %d\n", GetLastError());
00828             WSASetLastError(WSAENOBUFS);
00829             return SOCKET_ERROR;
00830         }
00831         Packets[numpackets].len = hdrlen + datalen;
00832
00833         printf("[%02d] .buf = 0x%p .len = %d\n", numpackets, Packets[numpackets].buf, Packets[numpackets].len);
00834
00835         // Initialize the V6 header, if we have to fragment the next header field of
00836         //    the v6 header is that of the fragmentation header. Also the payload
00837         //    length includes the headers (UDP + fragmentation) and the payload itself.
00838         iphdrlen = InitIpv6Header(
00839                 Packets[numpackets].buf,
00840                 src->ai_addr,
00841                 dest->ai_addr,
00842                 DEFAULT_TTL,
00843                 (fragment ? FRAGMENT_HEADER_PROTOCOL : gProtocol),
00844                 datalen + plushdrs
00845                 );
00846
00847         // Build the fragmentation header if necessary
00848         if (fragment)
00849         {
00850             iphdrlen += InitIpv6FragmentHeader(
00851                    &Packets[numpackets].buf[iphdrlen],
00852                     offset,         // offset from start of packet
00853                     gProtocol,
00854                     fragid,
00855                     lastfragment
00856                     );
00857         }
00858
00859         // The first fragment includes the UDP header, subsequent fragments don't
00860         if (numpackets == 0)
00861         {
00862             udphdrlen = InitUdpHeader(
00863                    &Packets[numpackets].buf[iphdrlen],
00864                     src->ai_addr,
00865                     dest->ai_addr,
00866                     originalpayload //payloadlen
00867                     );
00868
00869             // Compute the checksum
00870             ComputeUdpPseudoHeaderChecksumV6(
00871                     PseudoBuffer,
00872                     Packets[numpackets].buf,
00873                     (UDP_HDR *)&Packets[numpackets].buf[iphdrlen],
00874                     payload,
00875                     payloadlen);
00876         }
00877         else
00878         {
00879             udphdrlen = 0;
00880         }
00881
00882         // Copy the payload into this fragment
00883         memcpy(&Packets[numpackets].buf[iphdrlen + udphdrlen], &payload[offset], datalen);
00884
00885         // Adjust our counters
00886         payloadlen = payloadlen - datalen;
00887         offset += datalen;
00888         numpackets++;
00889
00890     } while (payloadlen > 0);
00891
00892     fragid++;
00893
00894     // Update the count to indicate how many fragments were generated
00895     *PacketCount = numpackets;
00896
00897     return NO_ERROR;
00898 }
00899
00900 //
00901 // Function: main
00902 //
00903 // Description:
00904 //    First, parse command line arguments and load Winsock. Then
00905 //    create the raw socket and then set the IP_HDRINCL option.
00906 //    Following this assemble the IP and UDP packet headers by
00907 //    assigning the correct values and calculating the checksums.
00908 //    Then fill in the data and send to its destination.
00909 //
00910 int _cdecl main(int argc, char **argv)
00911 {
00912     WSADATA            wsd;
00913     SOCKET             s=INVALID_SOCKET;
00914     DWORD              bytes;
00915     WSABUF            *fragments=NULL;
00916     int                fragmentcount=0;
00917     char              *buffer=NULL,     // Used as receive buffer or
00918                                         // to compute pseudo header
00919                       *payload=NULL;    // Buffer containing payload
00920     struct addrinfo   *ressrc=NULL,
00921                       *resdest=NULL;
00922     int                rc,
00923                        i, j;
00924
00925     // Parse command line arguments and print them out
00926     ValidateArgs(argc, argv);
00927
00928     srand(GetTickCount());
00929
00930     if ((rc = WSAStartup(MAKEWORD(2,2), &wsd)) != 0)
00931     {
00932         printf("WSAStartup() failed: %d\n", rc);
00933         return -1;
00934     }
00935
00936     // Convert the source and destination addresses/ports
00937     ressrc = ResolveAddress(gSrcAddress, gSrcPort, gAddressFamily, gSocketType, gProtocol);
00938     if (ressrc == NULL)
00939     {
00940         fprintf(stderr, "Unable to resolve address '%s' and port '%s'\n",
00941                 gSrcAddress, gSrcPort);
00942         goto cleanup;
00943     }
00944
00945     printf("Source Address     : ");
00946     PrintAddress(ressrc->ai_addr, (int)ressrc->ai_addrlen);
00947     printf("\n");
00948
00949     // Resolve the destination address if necessary and print some parameters
00950     if (gSender)
00951     {
00952         resdest = ResolveAddress(gDestAddress, gDestPort, ressrc->ai_family, ressrc->ai_socktype, ressrc->ai_protocol);
00953         if (resdest == NULL)
00954         {
00955             fprintf(stderr, "Unable to resolve address '%s' and port '%s'\n",
00956                     gDestAddress, gDestPort);
00957             goto cleanup;
00958         }
00959
00960         printf("Destination Address: ");
00961         PrintAddress(resdest->ai_addr, (int) resdest->ai_addrlen);
00962         printf("\n");
00963
00964         printf("Message Size       : %d\n", gSendSize);
00965         printf("Message Count      : %lu\n", gSendCount);
00966         printf("MTU Size           : %d\n", gMtuSize);
00967     }
00968     else
00969     {
00970         printf("Socket Type        : %s\n", (gReadRaw ? "SOCK_RAW" : "SOCK_DGRAM"));
00971     }
00972
00973
00974     //  Creating a raw socket
00975
00976     //  BUG - For IPv6 if we create the raw socket with IPPROTO_UDP then the Ipv6
00977     //  stack will thow away our IPv6 and UDP headers and put "valid" ones in their
00978     //  place. As a workaround, create the socket with a protocol value of an
00979     //  unhandled protocol. Of course the IPv6 header should still indicate that
00980     //  the encapsulated protocol is UDP.
00981
00982     if (gSender)
00983         s = socket(ressrc->ai_family, SOCK_RAW, ((ressrc->ai_family == AF_INET6) ? 3 : ressrc->ai_protocol));
00984     else if (!gSender && gReadRaw)
00985         s = socket(ressrc->ai_family, SOCK_RAW, ressrc->ai_protocol);
00986     else
00987         s = socket(ressrc->ai_family, SOCK_DGRAM, ressrc->ai_protocol);
00988     if (s == INVALID_SOCKET)
00989     {
00990         fprintf(stderr, "socket failed: %d\n", WSAGetLastError());
00991         goto cleanup;
00992     }
00993
00994     // Allocate a buffer for computing the pseudo header checksum
00995     buffer = (char *)HeapAlloc(GetProcessHeap(), 0, MAX_PACKET);
00996     if (buffer == NULL)
00997     {
00998         fprintf(stderr, "HeapAlloc failed: %d\n", GetLastError());
00999         goto cleanup;
01000     }
01001
01002     if (gSender)
01003     {
01004         int     optlevel,
01005                 option,
01006                 optval;
01007
01008         // Allocate the payload
01009         payload = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, gSendSize);
01010         if (payload == NULL)
01011         {
01012             fprintf(stderr, "HeapAlloc failed: %d\n", GetLastError());
01013             goto cleanup;
01014         }
01015         memfill(payload, gSendSize, gMessage, (int)strlen(gMessage));
01016
01017         // Allocate storage for the fragments
01018         fragmentcount = MAX_PACKET_FRAGMENTS;
01019         fragments = (WSABUF *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, fragmentcount * sizeof(WSABUF));
01020         if (fragments == NULL)
01021         {
01022             fprintf(stderr, "HeapAlloc failed: %d\n", GetLastError());
01023             goto cleanup;
01024         }
01025
01026         // Enable the IP header include option
01027         optval = 1;
01028         if (ressrc->ai_family == AF_INET)
01029         {
01030             optlevel = IPPROTO_IP;
01031             option   = IP_HDRINCL;
01032         }
01033         else if (ressrc->ai_family == AF_INET6)
01034         {
01035             optlevel = IPPROTO_IPV6;
01036             option   = IPV6_HDRINCL;
01037         }
01038         else
01039         {
01040             fprintf(stderr, "Address family returned is unsupported: %d\n",
01041                     ressrc->ai_family);
01042             goto cleanup;
01043         }
01044
01045         rc = setsockopt(s, optlevel, option, (char *)&optval, sizeof(optval));
01046         if (rc == SOCKET_ERROR)
01047         {
01048             fprintf(stderr, "setsockopt: IP_HDRINCL failed: %d\n", WSAGetLastError());
01049             goto cleanup;
01050         }
01051
01052         // Packetize and/or perform necessary fragmentation on data
01053         if (ressrc->ai_family == AF_INET)
01054         {
01055             rc = PacketizeIpv4(
01056                 fragments,
01057                &fragmentcount,
01058                 buffer,
01059                 ressrc,
01060                 resdest,
01061                 payload,
01062                 gSendSize
01063                 );
01064         }
01065         else if (ressrc->ai_family == AF_INET6)
01066         {
01067             rc = PacketizeIpv6(
01068                 fragments,
01069                &fragmentcount,
01070                 buffer,
01071                 ressrc,
01072                 resdest,
01073                 payload,
01074                 gSendSize
01075                 );
01076         }
01077
01078         // Verify packetization succeeded
01079         if (rc == SOCKET_ERROR)
01080         {
01081             fprintf(stderr, "Packetizing failed\n");
01082             goto cleanup;
01083         }
01084
01085         printf("%d fragments required\n", fragmentcount);
01086
01087         // Apparently, this SOCKADDR_IN structure makes no difference.
01088         // Whatever we put as the destination IP addr in the IP
01089         // header is what goes. Specifying a different dest in remote
01090         // will be ignored.
01091         for(i=0; i < (int)gSendCount ;i++)
01092         {
01093             for(j=0; j < fragmentcount ;j++)
01094             {
01095                 rc = sendto(
01096                         s,
01097                         fragments[j].buf,
01098                         fragments[j].len,
01099                         0,
01100                         resdest->ai_addr,
01101                         (int) resdest->ai_addrlen
01102                         );
01103                 bytes = rc;
01104                 if (rc == SOCKET_ERROR)
01105                 {
01106                     printf("sendto() failed: %d\n", WSAGetLastError());
01107                     break;
01108                 }
01109                 else
01110                 {
01111                     printf("sent %d bytes\n", rc);
01112                 }
01113             }
01114         }
01115
01116     }
01117     else
01118     {
01119         SOCKADDR_STORAGE    safrom;
01120         WSAEVENT            hEvent;
01121         int                 fromlen;
01122
01123         // Bind the socket to the receiving address
01124         rc = bind(
01125                 s,
01126                 ressrc->ai_addr,
01127                 (int) ressrc->ai_addrlen
01128                 );
01129         if (rc == SOCKET_ERROR)
01130         {
01131             fprintf(stderr, "bind failed: %d\n", WSAGetLastError());
01132             goto cleanup;
01133         }
01134
01135         printf("binding to: ");
01136         PrintAddress(ressrc->ai_addr, (int)ressrc->ai_addrlen);
01137         printf("\n");
01138
01139         // The IPv6 stack currently doesn't allow receiving raw UDP packets so
01140         //    print a warning.
01141         if (gReadRaw && (ressrc->ai_family == AF_INET6))
01142             printf("\nNOTE: The IPv6 stack currently does not allow reading raw UDP packets\n\n");
01143
01144         hEvent = WSACreateEvent();
01145         if (hEvent == NULL)
01146         {
01147             fprintf(stderr, "WSACreateEvent failed: %d\n", WSAGetLastError());
01148             goto cleanup;
01149         }
01150
01151 #ifdef WSAEVENTSELECT
01152         rc = WSAEventSelect(s, hEvent, FD_READ);
01153         if (rc == SOCKET_ERROR)
01154         {
01155             fprintf(stderr, "WSAEventSelect failed: %d\n", WSAGetLastError());
01156             goto cleanup;
01157         }
01158 #endif
01159
01160         // Receive the data
01161         while (1)
01162         {
01163 #ifdef WSAEVENTSELECT
01164             rc = WaitForSingleObject(hEvent, INFINITE);
01165             if ( (rc == WAIT_FAILED) || (rc == WAIT_TIMEOUT) )
01166             {
01167                 fprintf(stderr, "WaitForSingleObject failed: %d\n", GetLastError());
01168                 goto cleanup;
01169             }
01170 #endif
01171
01172             fromlen = sizeof(safrom);
01173             rc = recvfrom(
01174                     s,
01175                     buffer,
01176                     MAX_PACKET,
01177                     0,
01178                     (SOCKADDR *)&safrom,
01179                    &fromlen
01180                    );
01181             if (rc == SOCKET_ERROR)
01182             {
01183                 fprintf(stderr, "recvfrom failed: %d\n", WSAGetLastError());
01184                 break;
01185             }
01186             printf("Read %d bytes from ", rc);
01187             PrintAddress((SOCKADDR *)&safrom, fromlen);
01188             printf("\n");
01189
01190             WSAResetEvent(hEvent);
01191         }
01192     }
01193
01194 cleanup:
01195
01196     //
01197     // Cleanup allocations and sockets
01198     //
01199
01200     if (ressrc)
01201         freeaddrinfo(ressrc);
01202
01203     if (resdest)
01204         freeaddrinfo(resdest);
01205
01206     if (buffer)
01207         HeapFree(GetProcessHeap(), 0, buffer);
01208
01209     if (payload)
01210         HeapFree(GetProcessHeap(), 0, payload);
01211
01212     // Free the packet buffers
01213     if (fragments)
01214     {
01215         for(i=0; i < fragmentcount ;i++)
01216         {
01217             if (fragments[i].buf != NULL)
01218             {
01219                 HeapFree(GetProcessHeap(), 0, fragments[i].buf);
01220                 fragments[i].buf = NULL;
01221             }
01222         }
01223         HeapFree(GetProcessHeap(), 0, fragments);
01224     }
01225
01226     if (s != INVALID_SOCKET)
01227         closesocket(s);
01228
01229     WSACleanup();
01230
01231     return 0;
01232 }
01233
01234 #pragma warning(pop)
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/people.h Source File

  • SysMgmt
  • MMC
  • CMenu

people.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _PEOPLE_H
00021 #define _PEOPLE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CBicycle : public CDelegationBase {
00026 public:
00027     CBicycle(int i) : id(i) { }
00028     virtual ~CBicycle() {}
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00033
00034 private:
00035     // {2974380D-4C4B-11d2-89D8-000021473128}
00036     static const GUID thisGuid;
00037
00038     int id;
00039 };
00040
00041 class CBicycleFolder : public CDelegationBase {
00042 public:
00043     CBicycleFolder();
00044     virtual ~CBicycleFolder();
00045
00046     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Bicycles"); }
00047     virtual const GUID & getNodeType() { return thisGuid; }
00048     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00049
00050 public:
00051     // virtual functions go here (for MMCN_*)
00052     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00053
00054 private:
00055     // {2974380D-4C4B-11d2-89D8-000021473128}
00056     static const GUID thisGuid;
00057
00058     enum { NUMBER_OF_CHILDREN = 20 };
00059     CDelegationBase *children[NUMBER_OF_CHILDREN];
00060 };
00061
00062 class CSkateboard : public CDelegationBase {
00063 public:
00064     CSkateboard(int i) : id(i) { }
00065     virtual ~CSkateboard() {}
00066
00067     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00068     virtual const GUID & getNodeType() { return thisGuid; }
00069     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00070
00071 private:
00072     // {2974380D-4C4B-11d2-89D8-000021473128}
00073     static const GUID thisGuid;
00074
00075     int id;
00076 };
00077
00078 class CSkateboardFolder : public CDelegationBase {
00079 public:
00080     CSkateboardFolder();
00081     virtual ~CSkateboardFolder();
00082
00083     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Skateboards"); }
00084     virtual const GUID & getNodeType() { return thisGuid; }
00085     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00086
00087 public:
00088     // virtual functions go here (for MMCN_*)
00089     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00090
00091 private:
00092     // {2974380D-4C4B-11d2-89D8-000021473128}
00093     static const GUID thisGuid;
00094
00095     enum { NUMBER_OF_CHILDREN = 20 };
00096     CDelegationBase *children[NUMBER_OF_CHILDREN];
00097 };
00098
00099 class CIceSkate : public CDelegationBase {
00100 public:
00101     CIceSkate(int i) : id(i) { }
00102     virtual ~CIceSkate() {}
00103
00104     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00105     virtual const GUID & getNodeType() { return thisGuid; }
00106     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00107
00108 private:
00109     // {2974380D-4C4B-11d2-89D8-000021473128}
00110     static const GUID thisGuid;
00111
00112     int id;
00113 };
00114
00115 class CIceSkateFolder : public CDelegationBase {
00116 public:
00117     CIceSkateFolder();
00118     virtual ~CIceSkateFolder();
00119
00120     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Ice Skates"); }
00121     virtual const GUID & getNodeType() { return thisGuid; }
00122     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00123
00124 public:
00125     // virtual functions go here (for MMCN_*)
00126     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00127
00128 private:
00129     // {2974380D-4C4B-11d2-89D8-000021473128}
00130     static const GUID thisGuid;
00131
00132     enum { NUMBER_OF_CHILDREN = 20 };
00133     CDelegationBase *children[NUMBER_OF_CHILDREN];
00134 };
00135
00136 class CPeoplePoweredVehicle : public CDelegationBase {
00137 public:
00138     CPeoplePoweredVehicle();
00139     virtual ~CPeoplePoweredVehicle();
00140
00141     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("People-powered Vehicles"); }
00142     virtual const GUID & getNodeType() { return thisGuid; }
00143     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00144
00145     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00146
00147 private:
00148     enum { IDM_NEW_PEOPLE = 1 };
00149
00150     // {2974380D-4C4B-11d2-89D8-000021473128}
00151     static const GUID thisGuid;
00152
00153     enum { NUMBER_OF_CHILDREN = 3 };
00154     CDelegationBase *children[3];
00155 };
00156
00157 #endif // _PEOPLE_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/CDTest.c Source File

  • WinUI
  • CommDlg
  • CDTest

CDTest.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 /************************************************************************
00007
00008   File: cdtest.c
00009
00010   Purpose:  Contains the functions which handle the main window's functionality --
00011             creating the main window, handling menu commands, exiting the program.
00012
00013   Functions:
00014
00015            WinMain()           - Program's entry point
00016
00017            InitApplication()   - Registers class and some user defined messages
00018
00019            InitInstance()      - Creates main window
00020
00021            MainWndProc()       - Window procedure for main window
00022
00023            HandleTheCommand()  - Processes all WM_COMMAND messages
00024
00025            InitGlobals()       - Initializes all global variables that need to
00026                                  be initialized at startup
00027
00028            MyAtol()            - Converts an ASCII string in either hexi-
00029                                  decimal or decimal notation to a LONG.
00030
00031            AboutProc()         - Callback function for CDTEST's about box.
00032
00033 ************************************************************************/
00034
00035
00036
00037 #include <windows.h>
00038 #include <commdlg.h>
00039 #include <winnls.h>
00040 #include "cdtest.h"
00041 #include "colors.h"
00042 #include "save.h"
00043 #include "print.h"
00044 #include "title.h"
00045 #include "replace.h"
00046 #include "open.h"
00047 #include "font.h"
00048 #include "find.h"
00049
00050
00051
00052
00053
00054 /* Some defines, global variables, and function declarations */
00055
00056 #define szClass TEXT("cdtestclass")
00057 #define szIcon  TEXT("theicon")
00058 #define szMenu  TEXT("themenu")
00059
00060 #ifdef UNICODE
00061   #define szTitle TEXT("Common Dialog Test App - Unicode Version")
00062 #else
00063   #define szTitle TEXT("Common Dialog Test App - ANSI Version")
00064 #endif
00065
00066
00067 void InitGlobals(void) ;
00068
00069 UINT_PTR uMode = IDM_HEXMODE ;
00070
00071
00072
00073
00074
00075
00076
00077 /************************************************************************
00078
00079
00080   Function: WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
00081
00082   Purpose:
00083
00084     - Contains standard windows entry point
00085
00086     - Initializes the application
00087
00088     - Contains the main message loop
00089
00090   Returns: Final msg.wParam
00091
00092   Comments:
00093
00094 ************************************************************************/
00095
00096
00097 int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
00098 {
00099
00100   MSG msg;
00101
00102
00103   UNREFERENCED_PARAMETER( lpCmdLine );
00104
00105
00106   if (!hPrevInstance)
00107     if (!InitApplication(hInstance))
00108         return (FALSE);
00109
00110   if (!InitInstance(hInstance, nCmdShow))
00111     return (FALSE);
00112
00113   while (GetMessage(&msg, 0, 0, 0))
00114   {
00115     TranslateMessage(&msg);
00116     DispatchMessage(&msg);
00117   }
00118
00119
00120   return (int)(msg.wParam);
00121 }
00122
00123
00124
00125
00126
00127
00128
00129 /************************************************************************
00130
00131
00132   Function: InitApplication(HANDLE)
00133
00134
00135   Purpose:
00136
00137     - Fills in the WNDCLASS structure
00138
00139     - Registers messages needed to communicate with the common dialogs
00140
00141     - Registers the window class
00142
00143   Returns: The return value of RegisterClass().  If this fails then the
00144            whole program fails.
00145
00146   Comments:
00147
00148
00149 ************************************************************************/
00150
00151
00152 BOOL InitApplication(HINSTANCE hInstance)
00153 {
00154   WNDCLASS  wc;
00155
00156   wc.style = 0;
00157   wc.lpfnWndProc = (WNDPROC)MainWndProc;
00158   wc.cbClsExtra = 0;
00159   wc.cbWndExtra = 0;
00160   wc.hInstance = hInstance;
00161   wc.hIcon = LoadIcon(hInstance, szIcon) ;
00162   wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00163   wc.hbrBackground = GetStockObject(WHITE_BRUSH);
00164   wc.lpszMenuName = szMenu ;
00165   wc.lpszClassName = szClass ;
00166
00167
00168   InitGlobals() ;
00169
00170
00171   /* Register any messages that the common dialogs will need to
00172      communicate with this app. */
00173
00174   nFindMsg       = RegisterWindowMessage((LPTSTR) FINDMSGSTRING) ;
00175   nOpenShareVMsg = RegisterWindowMessage((LPTSTR) SHAREVISTRING) ;
00176   nHelpMessage   = RegisterWindowMessage((LPTSTR) HELPMSGSTRING) ;
00177
00178
00179   return (RegisterClass(&wc));
00180 }
00181
00182
00183
00184
00185
00186
00187
00188
00189 /************************************************************************
00190
00191
00192  Function: InitInstance(HANDLE, int)
00193
00194
00195  Purpose:
00196
00197    - Creates the main window
00198
00199    - Shows the main window
00200
00201  Returns: FALSE if it cannot create the window, TRUE if it can.
00202
00203
00204  Comments:
00205
00206
00207 ************************************************************************/
00208
00209
00210 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
00211 {
00212     HWND hWnd;
00213     DWORD dwFlags = WS_OVERLAPPED | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU ;
00214
00215
00216     /* save the instance handle in a global variable */
00217
00218     hInst = hInstance;
00219
00220
00221     /* Create the main window */
00222
00223     hWnd = CreateWindow(szClass, szTitle, dwFlags,
00224                         10, 10, 400, 200, NULL, NULL, hInstance, NULL) ;
00225
00226     if (!hWnd)
00227         return (FALSE);
00228
00229     ShowWindow(hWnd, SW_SHOWNORMAL) ;
00230     UpdateWindow(hWnd);
00231
00232     return (TRUE);
00233 }
00234
00235
00236
00237
00238
00239
00240
00241
00242 /************************************************************************
00243
00244
00245   Function: MainWndProc(HWND, UINT, WPARAM, LPARAM)
00246
00247   Purpose:
00248
00249     - Is the callback function that handles all messages for the main window
00250
00251   Returns:
00252
00253     - Returns DefWindowProc() for any message it does not explicitly
00254       respond to.
00255
00256   Comments:
00257
00258
00259 ************************************************************************/
00260
00261
00262 LRESULT APIENTRY MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00263 {
00264     switch (message)
00265     {
00266       case WM_CREATE:
00267         CheckMenuItem(GetMenu(hWnd), IDM_HEXMODE, MF_CHECKED) ;
00268         break ;
00269
00270       case WM_COMMAND:
00271         HandleTheCommand(hWnd, wParam, lParam) ;
00272         break ;
00273
00274       case WM_DESTROY:
00275           PostQuitMessage(0);
00276           break;
00277
00278       default:
00279           return (DefWindowProc(hWnd, message, wParam, lParam));
00280           break ;
00281     }
00282     return (0L);
00283 }
00284
00285
00286
00287
00288
00289
00290 /************************************************************************
00291
00292
00293   Function: HandleTheCommand(HWND, WPARAM, LPARAM)
00294
00295   Purpose:
00296
00297     - Handles all WM_COMMAND messages passed to the MainWndProc().  The
00298       menu or control ID value for Win32 WM_COMMAND messages is contained
00299       in the low word of the wParam parameter.
00300
00301   Returns: Nothing.
00302
00303   Comments:
00304
00305
00306 ************************************************************************/
00307
00308
00309 void HandleTheCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
00310 {
00311
00312   switch (LOWORD(wParam))
00313   {
00314     case IDM_COLOR:                //For any of the dialog creation
00315       DoColorsDialog(hWnd) ;       //commands, call the appropriate
00316       break ;                      //function.  The function will
00317                                    //create the dialog...
00318     case IDM_FONT:
00319       DoFontDialog(hWnd) ;
00320       break ;
00321
00322     case IDM_TITLE:
00323       DoTitleDialog(hWnd) ;
00324       break ;
00325
00326     case IDM_FIND:
00327       DoFindDialog(hWnd) ;
00328       break ;
00329
00330     case IDM_OPEN:
00331       DoOpenDialog(hWnd) ;
00332       break ;
00333
00334     case IDM_SAVE:
00335       DoSaveDialog(hWnd) ;
00336       break ;
00337
00338     case IDM_PRINT:
00339       DoPrintDialog(hWnd) ;
00340       break ;
00341
00342     case IDM_REPLACE:
00343       DoReplaceDialog(hWnd) ;
00344       break ;
00345
00346     case IDM_EXIT:
00347       PostQuitMessage(0) ;
00348       break ;
00349
00350     case IDM_HEXMODE:
00351     case IDM_DECIMALMODE:
00352
00353       /* We need to maintain a global variable that will indicate what
00354          kind of number processing we have to do.  First, check the
00355          menu item corresponding to the new mode... */
00356
00357       CheckMenuItem(GetMenu(hWnd), (UINT)uMode, MF_UNCHECKED) ;
00358       uMode = wParam ;
00359       CheckMenuItem(GetMenu(hWnd), (UINT)uMode, MF_CHECKED) ;
00360
00361
00362       /* and then create an appropriate filter for wsprintf() type
00363          functions */
00364
00365       if (uMode == IDM_HEXMODE)
00366       {
00367         lstrcpyn(szShortFilter, TEXT("%x"), ARRAYSIZE(szShortFilter)) ;
00368         lstrcpyn(szLongFilter, TEXT("%lx"), ARRAYSIZE(szLongFilter)) ;
00369         lstrcpyn(szPointerFilter, TEXT("%p"), ARRAYSIZE(szPointerFilter)) ;
00370       }
00371       if (uMode == IDM_DECIMALMODE)
00372       {
00373         lstrcpyn(szShortFilter, TEXT("%d"), ARRAYSIZE(szShortFilter)) ;
00374         lstrcpyn(szLongFilter, TEXT("%ld"), ARRAYSIZE(szLongFilter)) ;
00375         lstrcpyn(szPointerFilter, TEXT("%Id"), ARRAYSIZE(szPointerFilter)) ;
00376       }
00377
00378       break ;
00379
00380
00381     case IDM_ABOUT:
00382        DialogBox(hInst, TEXT("about"), hWnd, AboutProc) ;
00383        break ;
00384
00385
00386     default: break ;
00387   }
00388
00389   return ;
00390 }
00391
00392
00393
00394
00395
00396
00397
00398
00399 /************************************************************************
00400
00401
00402   Function: InitGlobals(void)
00403
00404   Purpose:
00405
00406     - Any global variables can be initialized here since this function is
00407       called on app startup.
00408
00409   Returns: Nothing
00410
00411   Comments:
00412
00413
00414 ************************************************************************/
00415
00416
00417 void InitGlobals(void)
00418 {
00419
00420   /* not really too much to do here.  Create a hex wsprintf() filter since
00421      the app starts off in Hex mode. */
00422
00423   lstrcpyn(szShortFilter, TEXT("%x"), ARRAYSIZE(szShortFilter)) ;
00424   lstrcpyn(szLongFilter, TEXT("%lx"), ARRAYSIZE(szLongFilter)) ;
00425   lstrcpyn(szPointerFilter, TEXT("%p"), ARRAYSIZE(szPointerFilter)) ;
00426
00427 }
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437 /************************************************************************
00438
00439
00440   Function: MyAtol(LPTSTR, BOOL, LPBOOL)
00441
00442   Purpose:
00443
00444     - This function will convert an ascii string to a LONG.
00445
00446   Returns:
00447
00448     - If it receives an invalid ascii character, it will return 0 and
00449       set the LPBOOL variable to false...
00450
00451   Comments:
00452
00453       Since the function may need to deal with either a hex number or a decimal
00454       number, it should use a variable as a multiplier.
00455
00456
00457 ************************************************************************/
00458
00459
00460 LONG_PTR MyAtol(LPTSTR szString, BOOL bHex, LPBOOL bSuccess)
00461 {
00462   LPTSTR p ;
00463   LONG l ;
00464   LONG lMultiplier ;
00465   BOOL bDigit ;
00466
00467   if (bHex)
00468     lMultiplier = 16 ;
00469   else
00470     lMultiplier = 10 ;
00471
00472   p = szString ;
00473   l = 0 ;
00474
00475   while (*p)      //while chars
00476   {
00477      bDigit = FALSE ;  //set to false for each char that we look at
00478
00479      if (*p >= (TCHAR) '0' && *p <= (TCHAR) '9')  //is it an ascii char ?
00480      {
00481        bDigit = TRUE ;
00482        l+=(*p - (TCHAR) '0') ;
00483      }
00484
00485      if (bHex)
00486      {
00487        if (*p >= (TCHAR) 'A' && *p <= (TCHAR) 'F')  //or hex?
00488        {
00489          l+=(*p - (TCHAR) 'A' + 10) ;
00490          bDigit = TRUE ;
00491        }
00492
00493        if (*p >= (TCHAR) 'a' && *p <= (TCHAR) 'f')
00494        {
00495          l+=(*p - (TCHAR) 'a' + 10) ;
00496          bDigit = TRUE ;
00497        }
00498
00499      }
00500
00501      if (bDigit == FALSE)
00502      {
00503        *bSuccess = FALSE ;
00504        return 0 ;
00505      }
00506
00507      p++ ;               //get next char
00508
00509      if (*p)             //if there is going to be at least one more char
00510        l*=lMultiplier ;  //then multiply what we have by the multiplier...
00511   }
00512
00513   *bSuccess = TRUE ;
00514
00515   return l ;             //success! return the value.
00516 }
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526 /************************************************************************
00527
00528
00529   Function: AboutProc(HWND, UINT, WPARAM, LPARAM)
00530
00531   Purpose:  Callback function for the about dialog box.
00532
00533
00534   Returns:  BOOL - FALSE ...
00535
00536
00537   Comments:
00538
00539 ************************************************************************/
00540
00541
00542 INT_PTR APIENTRY AboutProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00543 {
00544
00545   if (msg == WM_INITDIALOG)
00546     return TRUE;
00547
00548   if (
00549        (msg == WM_COMMAND) &&
00550        (LOWORD(wParam) == IDCANCEL)
00551      )
00552   {
00553
00554      return EndDialog(hwnd, FALSE) ;
00555   }
00556
00557   else
00558     return FALSE ;
00559 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagSEG Member List

This is the complete list of members for tagSEG, including all inherited members.
dwPos | tagSEG
lpPoints | tagSEG
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CallbackIUnknownLib::ServiceCallBackInterface Member List

This is the complete list of members for CallbackIUnknownLib::ServiceCallBackInterface, including all inherited members.
CallbackFunction([in] VARIANT pszCallbackType,[in] VARIANT svcObject,[in] VARIANT pszStateVarName,[in] VARIANT varValue) CallbackIUnknownLib::ServiceCallBackInterface
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CServiceComp Member List

This is the complete list of members for CServiceComp, including all inherited members.
AutoQI(DWORD dwCreateOpts) | CServiceComp | [virtual]
AutoRelease() | CServiceComp | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
ConnectFromFile(WCHAR *pwszInitString) | CServiceComp | [virtual]
Create(CBase *pCSource, DWORD dwCSLCTX=CLSCTX_INPROC_SERVER, WCHAR *pwszRemoteServer=NULL) | CServiceComp | [virtual]
CreateDBInstance(REFCLSID clsid, CAggregate *pCAggregate, DWORD dwCLSCTX, REFIID riid, IUnknown **ppIUnknown) | CServiceComp | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CServiceComp(CMainWindow *pCMainWindow) | CServiceComp |
DisplayObject() | CBase | [virtual]
GetBaseType() | CBase | [inline]
GetDataSource(CAggregate *pCAggregate, DWORD dwCLSCTX, WCHAR *pwszInitString, REFIID riid, IUnknown **ppIUnknown) | CServiceComp | [virtual]
GetDefaultInterface() | CServiceComp | [inline, virtual]
GetInitString(IUnknown *pIUnknown, boolean fIncludePassword, WCHAR **ppwszInitString) | CServiceComp | [virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CServiceComp | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CServiceComp | [inline, virtual]
GetObjectMenu() | CServiceComp | [inline, virtual]
GetObjectName() | CServiceComp | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
LoadInitString(WCHAR *pwszFileName, WCHAR **pwszInitString=NULL) | CServiceComp | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIDataInitialize | CServiceComp |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_pwszInitString | CServiceComp |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CServiceComp | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SaveInitString(WCHAR *pwszFileName, WCHAR *pwszInitString, DWORD dwCreateOpts=CREATE_ALWAYS) | CServiceComp | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
~CBase() | CBase | [virtual]
~CServiceComp() | CServiceComp | [virtual]
Generated on Wed Nov 13 2024 16:57:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/StrOut/Remote.c Source File

  • NetDS
  • RPC
  • StrOut

Remote.c

Go to the documentation of this file.
00001 /*************************************************************************
00002                     Copyright Microsoft Corp. 1992 - 2000
00003                         Remote Machine strout sample
00004
00005   FILE      :   remote.c
00006
00007   PURPOSE   :   The remote procedures that will be called from the client.
00008
00009   COMMENTS  :   These procedures will be linked into the server side of
00010                 the application.
00011
00012 *************************************************************************/
00013 #include "strout.h"                 //Generated by the MIDL compiler
00014 #include "common.h"                 //Common definitions for all files
00015
00016 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00017 /*  Procedure   :   void GetRemoteEnv(unsigned long, str **)            */
00018 /*  Desc.       :   This procedure get the environment variables from   */
00019 /*                  the server and reuturns a pointer to an array of    */
00020 /*                  pointer to the environment strings                  */
00021 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00022 void GetRemoteEnv(unsigned long *nNumLines, str **psEnvironmentBlock)
00023 {
00024     int nIdx = 0;       // Loop counter
00025     TCHAR
00026         *pcTemp,        // Temporary pointer to the environment block
00027         *pcEnv;         // Pointer to the environment block
00028
00029
00030     // Get pointer to environment block
00031     pcEnv = (TCHAR *) GetEnvironmentStrings();
00032
00033     // First count how many lines, must know how much memory to allocate
00034     *nNumLines  = 0;            // Initialize number of lines to 0
00035     pcTemp = pcEnv;             // Set tempptr equal to envptr
00036     while (*pcTemp != NULL_CHAR)
00037     {
00038         // Don't count the lines that starts with IGNORE_CHAR
00039         if(*pcTemp != IGNORE_CHAR)
00040         {
00041             (*nNumLines)++;     // Increase the number of lines
00042         }
00043
00044         // Increment the string pointer. Each line ends in \0, and
00045         // \0\0 means end of block
00046         pcTemp += (_tcslen(pcTemp) + 1);
00047     }
00048
00049     // Allocate the memory needed for the line pointer
00050     if(NULL == (*psEnvironmentBlock = (str *)
00051         midl_user_allocate((*nNumLines) * sizeof(str))))
00052     {
00053         _tprintf(TEXT("REMOTE.C : Memory allocation error\n"));
00054         return;
00055     }
00056
00057     // Iterate through all the environment strings, allocate memory,
00058     // and copy them
00059     while (*pcEnv != NULL_CHAR)
00060     {
00061         // Don't count the lines that starts with IGNORE_CHAR
00062         if(*pcEnv != IGNORE_CHAR)
00063         {
00064             // Allocate the space needed for the strings
00065             (*psEnvironmentBlock)[nIdx] = (str) midl_user_allocate(
00066                 sizeof(TCHAR) * (_tcslen(pcEnv) + 1));
00067
00068             // Copy the environment string to the allocated memory
00069             _tcscpy((*psEnvironmentBlock)[nIdx++], pcEnv);
00070         }
00071
00072         // Increment the string pointer. Each line ends in \0, and
00073         // \0\0 means end of block
00074         pcEnv += (_tcslen(pcEnv) + 1);
00075     }
00076 }
00077
00078
00079 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00080 /* Procedure    :   void ShutDown(void);                                */
00081 /* Desc.        :   This procedure send a message to the server that it */
00082 /*                  can stop listening for remote procedure calls       */
00083 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00084 void ShutDown(void)
00085 {
00086     RPC_STATUS nStatus;
00087
00088     // Tell the server to stop listening for remote procedure calls
00089     _tprintf(TEXT("Shutting down the server\n"));
00090     nStatus = RpcMgmtStopServerListening(NULL);
00091     EXIT_IF_FAIL(nStatus, "RpcMgmtStopServerListening");
00092 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/InstProv/MainDll.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • InstProv

MainDll.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  MAINDLL.CPP
00006
00007 //
00008
00009 //  Module: WMI Instance provider sample code
00010
00011 //
00012
00013 //  Purpose: Contains DLL entry points.  Also has code that controls
00014
00015 //           when the DLL can be unloaded by tracking the number of
00016
00017 //           objects and locks as well as routines that support
00018
00019 //           self registration.
00020
00021 //
00022
00023 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00024 //
00025 //***************************************************************************
00026
00027 #include <objbase.h>
00028 #include <initguid.h>
00029 #include <strsafe.h>
00030
00031 #include "sample.h"
00032
00033 HMODULE ghModule;
00034
00035 // TODO, GuidGen should be used to generate a unique number for any
00036 // providers that are going to be used for anything more extensive
00037 // than just testing.
00038
00039 DEFINE_GUID(CLSID_instprovider,0x22cb8761, 0x914a, 0x11cf, 0xb7, 0x5, 0x0, 0xaa, 0x0, 0x62, 0xcb, 0xb7);
00040 // {22CB8761-914A-11cf-B705-00AA0062CBB7}
00041
00042 //Count number of objects and number of locks.
00043
00044 long       g_cObj=0;
00045 long       g_cLock=0;
00046
00047 //***************************************************************************
00048 //
00049 // LibMain32
00050 //
00051 // Purpose: Entry point for DLL.
00052 //
00053 // Return: TRUE if OK.
00054 //
00055 //***************************************************************************
00056
00057
00058 BOOL WINAPI LibMain32(HINSTANCE hInstance, ULONG ulReason
00059     , LPVOID pvReserved)
00060 {
00061     if (DLL_PROCESS_ATTACH==ulReason)
00062         ghModule = hInstance;
00063     return TRUE;
00064 }
00065
00066 //***************************************************************************
00067 //
00068 //  DllGetClassObject
00069 //
00070 //  Purpose: Called by Ole when some client wants a class factory.  Return
00071 //           one only if it is the sort of class this DLL supports.
00072 //
00073 //***************************************************************************
00074
00075
00076 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, PPVOID ppv)
00077 {
00078     HRESULT hr;
00079     CProvFactory *pObj;
00080
00081     if (CLSID_instprovider!=rclsid)
00082         return E_FAIL;
00083
00084     pObj=new CProvFactory();
00085
00086     if (NULL==pObj)
00087         return E_OUTOFMEMORY;
00088
00089     hr=pObj->QueryInterface(riid, ppv);
00090
00091     if (FAILED(hr))
00092         delete pObj;
00093
00094     return hr;
00095 }
00096
00097 //***************************************************************************
00098 //
00099 // DllCanUnloadNow
00100 //
00101 // Purpose: Called periodically by Ole in order to determine if the
00102 //          DLL can be freed.
00103 //
00104 // Return:  S_OK if there are no objects in use and the class factory
00105 //          isn't locked.
00106 //
00107 //***************************************************************************
00108
00109 STDAPI DllCanUnloadNow(void)
00110 {
00111     SCODE   sc;
00112
00113     //It is OK to unload if there are no objects or locks on the
00114     // class factory.
00115
00116     sc=(0L==g_cObj && 0L==g_cLock) ? S_OK : S_FALSE;
00117     return sc;
00118 }
00119
00120 //***************************************************************************
00121 //
00122 // DllRegisterServer
00123 //
00124 // Purpose: Called during setup or by regsvr32.
00125 //
00126 // Return:  NOERROR if registration successful, error otherwise.
00127 //***************************************************************************
00128
00129 STDAPI DllRegisterServer(void)
00130 {
00131     char       szID[128];
00132   WCHAR   wcID[128];
00133     char       szCLSID[128];
00134     TCHAR       szModule[MAX_PATH + 1];
00135     const char * pName = "WMI Sample Instance Provider";
00136     const char * pModel = "Both";
00137     HKEY hKey1, hKey2;
00138
00139
00140     // Create the path.
00141
00142   memset(wcID, NULL, sizeof(wcID));
00143   memset(szID, NULL, sizeof(szID));
00144     StringFromGUID2(CLSID_instprovider, wcID, sizeof(wcID)/sizeof(WCHAR));
00145   wcstombs(szID, wcID, sizeof(szID));
00146   StringCbCopy(szCLSID, sizeof(szCLSID), "Software\\classes\\CLSID\\");
00147   StringCbCat(szCLSID, sizeof(szCLSID), (LPCTSTR)szID);
00148
00149     // Create entries under CLSID
00150
00151   LONG lRet = RegCreateKeyEx( HKEY_LOCAL_MACHINE, szCLSID, 0, NULL,
00152                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00153                     &hKey1, NULL );
00154   if (lRet != ERROR_SUCCESS)
00155   {
00156     return E_FAIL;
00157   }
00158
00159
00160     lRet = RegSetValueEx(hKey1, NULL, 0, REG_SZ, (BYTE *)pName, strlen(pName)+1);
00161   if (lRet != ERROR_SUCCESS)
00162   {
00163     RegCloseKey(hKey1);
00164     return E_FAIL;
00165   }
00166
00167   lRet = RegCreateKeyEx( hKey1, "InprocServer32", 0, NULL,
00168                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00169                     &hKey2, NULL );
00170   if (lRet != ERROR_SUCCESS)
00171   {
00172     RegCloseKey(hKey1);
00173     return E_FAIL;
00174   }
00175
00176   memset(&szModule, NULL, sizeof(szModule));
00177   GetModuleFileName(ghModule, szModule, sizeof(szModule)/sizeof(TCHAR) - 1);
00178
00179     lRet = RegSetValueEx(hKey2, NULL, 0, REG_SZ, (BYTE *)szModule,
00180                                         strlen(szModule)+1);
00181   if (lRet != ERROR_SUCCESS)
00182   {
00183       RegCloseKey(hKey2);
00184     RegCloseKey(hKey1);
00185     return E_FAIL;
00186   }
00187
00188   lRet = RegSetValueEx(hKey2, "ThreadingModel", 0, REG_SZ,
00189                                         (BYTE *)pModel, strlen(pModel)+1);
00190   if (lRet != ERROR_SUCCESS)
00191   {
00192       RegCloseKey(hKey2);
00193     RegCloseKey(hKey1);
00194     return E_FAIL;
00195   }
00196     RegCloseKey(hKey1);
00197     RegCloseKey(hKey2);
00198     return NOERROR;
00199 }
00200
00201 //***************************************************************************
00202 //
00203 // DllUnregisterServer
00204 //
00205 // Purpose: Called when it is time to remove the registry entries.
00206 //
00207 // Return:  NOERROR if registration successful, error otherwise.
00208 //***************************************************************************
00209
00210 STDAPI DllUnregisterServer(void)
00211 {
00212     TCHAR szID[128];
00213   WCHAR wcID[128];
00214     TCHAR szCLSID[128];
00215     HKEY  hKey;
00216
00217     // Create the path using the CLSID
00218
00219   memset(wcID, NULL, sizeof(wcID));
00220   memset(szID, NULL, sizeof(szID));
00221     StringFromGUID2(CLSID_instprovider, wcID, sizeof(wcID)/sizeof(WCHAR));
00222   wcstombs(szID, wcID, sizeof(szID));
00223   StringCbCopy(szCLSID, sizeof(szCLSID), "Software\\classes\\CLSID\\");
00224   StringCbCat(szCLSID, sizeof(szCLSID), (LPCTSTR)szID);
00225
00226
00227     // First delete the InProcServer subkey.
00228
00229     DWORD dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szCLSID, 0, KEY_WRITE, &hKey);
00230     if(dwRet == NO_ERROR)
00231     {
00232         RegDeleteKey(hKey, "InProcServer32");
00233         RegCloseKey(hKey);
00234     }
00235
00236     dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\classes\\CLSID", 0, KEY_WRITE, &hKey);
00237     if(dwRet == NO_ERROR)
00238     {
00239         RegDeleteKey(hKey,szID);
00240         RegCloseKey(hKey);
00241     }
00242
00243     return NOERROR;
00244 }
00245
00246
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDlgIADsContainer Member List

This is the complete list of members for CDlgIADsContainer, including all inherited members.
CDlgIADsContainer(LPUNKNOWN pUnk, CWnd *pParent=NULL) | CDlgIADsContainer |
DoDataExchange(CDataExchange *pDX) | CDlgIADsContainer | [protected, virtual]
EnumerateChildren() | CDlgIADsContainer | [protected]
GetClassAndName(CString &sClass, CString &sName) | CDlgIADsContainer | [private]
IDD enum value | CDlgIADsContainer |
m_cChildList | CDlgIADsContainer |
m_pCont | CDlgIADsContainer | [protected]
m_sClassList | CDlgIADsContainer | [protected]
m_sFilter | CDlgIADsContainer |
OnDblClkChildrenList() | CDlgIADsContainer | [protected]
OnDelete() | CDlgIADsContainer | [protected]
OnInitDialog() | CDlgIADsContainer | [protected, virtual]
OnMove() | CDlgIADsContainer | [protected]
OnOK() | CDlgIADsContainer | [protected, virtual]
OnRename() | CDlgIADsContainer | [protected]
OnSet() | CDlgIADsContainer | [protected]
OnView() | CDlgIADsContainer | [protected]
~CDlgIADsContainer() | CDlgIADsContainer |
Generated on Wed Nov 13 2024 16:56:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/Resource.h Source File

  • Com
  • Fundamentals
  • SimpDnd

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // App Studio generated include file.
00003 // Used by SIMPDND.RC
00004 //
00005 #define IDM_OPEN                        102
00006 #define IDC_DRAGPENDING                 102
00007 #define IDM_SAVE                        103
00008 #define IDM_SAVEAS                      104
00009 #define IDM_PRINT                       105
00010 #define IDM_EXIT                        106
00011 #define IDM_UNDO                        107
00012 #define IDM_CUT                         108
00013 #define IDM_COPY                        109
00014 #define IDM_PASTE                       110
00015 #define ID_EDIT_INSERTOBJECT            111
00016 #define IDM_INSERTOBJECT                111
00017 #define IDM_NEW                         112
00018
00019 // Next default values for new objects
00020 //
00021 #ifdef APSTUDIO_INVOKED
00022 #ifndef APSTUDIO_READONLY_SYMBOLS
00023
00024 #define _APS_NEXT_RESOURCE_VALUE        103
00025 #define _APS_NEXT_COMMAND_VALUE         113
00026 #define _APS_NEXT_CONTROL_VALUE         1000
00027 #define _APS_NEXT_SYMED_VALUE           101
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CMallSpy/CMallSpy.Cxx Source File

  • Com
  • Fundamentals
  • CMallSpy

CMallSpy.Cxx

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 //+---------------------------------------------------------------------
00019 //
00020 //  File:       cmallspy.cxx
00021 //
00022 //  Contents:   Sample implementation of IMallocSpy.  The implementation here
00023 //              is pretty simple.  It assumes that all we want to do is keep
00024 //              a header on the front of all allocations so we can note
00025 //              interesting information.
00026 //
00027 //  Classes:    CMallocSpy
00028 //
00029 //----------------------------------------------------------------------
00030
00031
00032 #include <ole2.h>
00033 #include "cmallspy.hxx"
00034
00035
00036
00037 const ULONG HEADERSIZE = 128;
00038
00039
00040
00041 //+---------------------------------------------------------------------
00042 //
00043 //  Member:     CMallocSpy::CMallocSpy
00044 //
00045 //  Synopsis:   Constructor
00046 //
00047 //  Returns:
00048 //
00049 //  History:    24-Oct-94   Created.
00050 //
00051 //  Notes:
00052 //
00053 //----------------------------------------------------------------------
00054 CMallocSpy::CMallocSpy(void)
00055 {
00056     m_cRef = 0;
00057 }
00058
00059
00060
00061
00062 //+---------------------------------------------------------------------
00063 //
00064 //  Member:     CMallocSpy::~CMallocSpy
00065 //
00066 //  Synopsis:   Destructor
00067 //
00068 //  Returns:
00069 //
00070 //  History:    24-Oct-94   Created.
00071 //
00072 //  Notes:
00073 //
00074 //----------------------------------------------------------------------
00075 CMallocSpy::~CMallocSpy(void)
00076 {
00077     // Nothing to do here
00078 }
00079
00080
00081
00082
00083 //+---------------------------------------------------------------------
00084 //
00085 //  Member:     CMallocSpy::QueryInterface
00086 //
00087 //  Synopsis:   Only IUnknown and IMallocSpy are meaningful
00088 //
00089 //  Arguments:  [riid] --
00090 //              [ppUnk] --
00091 //
00092 //  Returns:    S_OK or E_NOINTERFACE
00093 //
00094 //  History:    24-Oct-94   Created.
00095 //
00096 //  Notes:
00097 //
00098 //----------------------------------------------------------------------
00099 HRESULT CMallocSpy::QueryInterface(REFIID riid, LPVOID *ppUnk)
00100 {
00101     HRESULT hr = S_OK;
00102
00103     if (IsEqualIID(riid, IID_IUnknown))
00104     {
00105         *ppUnk = (IUnknown *) this;
00106     }
00107     else if (IsEqualIID(riid, IID_IMallocSpy))
00108     {
00109         *ppUnk =  (IMalloc *) this;
00110     }
00111     else
00112     {
00113         *ppUnk = NULL;
00114         hr =  E_NOINTERFACE;
00115     }
00116     AddRef();
00117     return hr;
00118 }
00119
00120
00121
00122
00123
00124 //+---------------------------------------------------------------------
00125 //
00126 //  Member:     CMallocSpy::AddRef
00127 //
00128 //  Synopsis:   Add a reference
00129 //
00130 //  Returns:    New reference count
00131 //
00132 //  History:    24-Oct-94   Created.
00133 //
00134 //  Notes:
00135 //
00136 //----------------------------------------------------------------------
00137 ULONG CMallocSpy::AddRef(void)
00138 {
00139     return ++m_cRef;
00140 }
00141
00142
00143
00144
00145
00146 //+---------------------------------------------------------------------
00147 //
00148 //  Member:     CMallocSpy::Release
00149 //
00150 //  Synopsis:   Remove a reference
00151 //
00152 //  Returns:    The new reference count
00153 //
00154 //  History:    24-Oct-94   Created.
00155 //
00156 //  Notes:
00157 //
00158 //----------------------------------------------------------------------
00159 ULONG CMallocSpy::Release(void)
00160 {
00161     ULONG cRef;
00162
00163     cRef = --m_cRef;
00164     if (cRef == 0)
00165     {
00166         delete this;
00167     }
00168     return cRef;
00169 }
00170
00171
00172
00173
00174
00175 //+---------------------------------------------------------------------
00176 //
00177 //  Member:     CMallocSpy::PreAlloc
00178 //
00179 //  Synopsis:   Called prior to OLE calling IMalloc::Alloc
00180 //
00181 //  Arguments:  [cbRequest] -- The number of bytes the caller of
00182 //                             is requesting IMalloc::Alloc
00183 //
00184 //  Returns:    The count of bytes to actuallay allocate
00185 //
00186 //  History:    24-Oct-94   Created.
00187 //
00188 //  Notes:
00189 //
00190 //----------------------------------------------------------------------
00191 SIZE_T CMallocSpy::PreAlloc(SIZE_T cbRequest)
00192 {
00193     m_cbRequest = cbRequest;
00194     return cbRequest + HEADERSIZE;
00195 }
00196
00197
00198
00199
00200 //+---------------------------------------------------------------------
00201 //
00202 //  Member:     CMallocSpy::PostAlloc
00203 //
00204 //  Synopsis:   Called after OLE calls IMalloc::Alloc
00205 //
00206 //  Arguments:  [pActual] -- The allocation returned by IMalloc::Alloc
00207 //
00208 //  Returns:    The allocation pointer to return to the caller of
00209 //              IMalloc::Alloc
00210 //
00211 //  History:    24-Oct-94   Created.
00212 //
00213 //  Notes:
00214 //
00215 //----------------------------------------------------------------------
00216 void *CMallocSpy::PostAlloc(void *pActual)
00217 {
00218     // Store interesting information in the first HEADERSIZE bytes
00219     // of the allcation
00220     // ...
00221
00222     // Return the allocation plus offset
00223     return (void *) (((BYTE *) pActual) + HEADERSIZE);
00224 }
00225
00226
00227
00228
00229
00230 //+---------------------------------------------------------------------
00231 //
00232 //  Member:     CMallocSpy::PreFree
00233 //
00234 //  Synopsis:   Called prior to OLE calling IMalloc::Free
00235 //
00236 //  Arguments:  [pRequest] -- The allocation to be freed
00237 //              [fSpyed]   -- Whether it was allocated with a spy active
00238 //
00239 //  Returns:
00240 //
00241 //  History:    24-Oct-94   Created.
00242 //
00243 //  Notes:
00244 //
00245 //----------------------------------------------------------------------
00246 void *CMallocSpy::PreFree(void *pRequest, BOOL fSpyed)
00247 {
00248     // Use the stored information
00249     // ...
00250
00251     // Check for NULL
00252     if (pRequest == NULL)
00253     {
00254         return NULL;
00255     }
00256
00257     // Undo the offset
00258     if (fSpyed)
00259     {
00260         return (void *) (((BYTE *) pRequest) - HEADERSIZE);
00261     }
00262     else
00263     {
00264         return pRequest;
00265     }
00266 }
00267
00268
00269
00270
00271
00272 //+---------------------------------------------------------------------
00273 //
00274 //  Member:     CMallocSpy::PostFree
00275 //
00276 //  Synopsis:   Called after OLE calls IMalloc::Free
00277 //
00278 //  Arguments:  [fSpyed]   -- Whether it was allocated with a spy active
00279 //
00280 //  Returns:
00281 //
00282 //  History:    24-Oct-94   Created.
00283 //
00284 //  Notes:
00285 //
00286 //----------------------------------------------------------------------
00287 void CMallocSpy::PostFree(BOOL fSpyed)
00288 {
00289     // Note the free or whatever
00290
00291     return;
00292 }
00293
00294
00295
00296
00297
00298 //+---------------------------------------------------------------------
00299 //
00300 //  Member:     CMallocSpy::PreRealloc
00301 //
00302 //  Synopsis:   Called prior to OLE calling IMalloc::Realloc
00303 //
00304 //  Arguments:  [pRequest]     -- The buffer to be reallocated
00305 //              [cbRequest]    -- The requested new size of the buffer
00306 //              [ppNewRequest] -- Where to store the new buffer pointer
00307 //                                to be reallocated
00308 //              [fSpyed]       -- Whether it was allocated with a spy active
00309 //
00310 //  Returns:    The new size to actually be allocated
00311 //
00312 //  History:    24-Oct-94   Created.
00313 //
00314 //  Notes:
00315 //
00316 //----------------------------------------------------------------------
00317 SIZE_T CMallocSpy::PreRealloc(void *pRequest, SIZE_T cbRequest,
00318                              void **ppNewRequest, BOOL fSpyed)
00319 {
00320     // Typically we don't need to extend/distend the header
00321     if (fSpyed)
00322     {
00323         *ppNewRequest = (void *) (((BYTE *) pRequest) - HEADERSIZE);
00324         return cbRequest + HEADERSIZE;
00325     }
00326     else
00327     {
00328         *ppNewRequest = pRequest;
00329         return cbRequest;
00330     }
00331 }
00332
00333
00334
00335
00336
00337 //+---------------------------------------------------------------------
00338 //
00339 //  Member:     CMallocSpy::PostRealloc
00340 //
00341 //  Synopsis:   Called after OLE calls IMalloc::Realloc
00342 //
00343 //  Arguments:  [pActual] -- Pointer to the reallocated buffer
00344 //              [fSpyed]  -- Whether it was allocated with a spy active
00345 //
00346 //  Returns:    The buffer pointer to return
00347 //
00348 //  History:    24-Oct-94   Created.
00349 //
00350 //  Notes:
00351 //
00352 //----------------------------------------------------------------------
00353 void *CMallocSpy::PostRealloc(void *pActual, BOOL fSpyed)
00354 {
00355     // Return the buffer with the header offset
00356     if (fSpyed)
00357     {
00358         return (void *) (((BYTE *) pActual) + HEADERSIZE);
00359     }
00360     else
00361     {
00362         return pActual;
00363     }
00364
00365     // If we extend/distend the header for a reallocation, then we'd
00366     // have to do some more work here
00367 }
00368
00369
00370
00371
00372
00373 //+---------------------------------------------------------------------
00374 //
00375 //  Member:     CMallocSpy::PreGetSize
00376 //
00377 //  Synopsis:   Called prior to OLE calling IMalloc::GetSize
00378 //
00379 //  Arguments:  [pRequest] -- The buffer whose size is to be returned
00380 //              [fSpyed]   -- Whether it was allocated with a spy active
00381 //
00382 //  Returns:    The actual buffer with which to call IMalloc::GetSize
00383 //
00384 //  History:    24-Oct-94   Created.
00385 //
00386 //  Notes:
00387 //
00388 //----------------------------------------------------------------------
00389 void *CMallocSpy::PreGetSize(void *pRequest, BOOL fSpyed)
00390 {
00391     if (fSpyed)
00392     {
00393         return (void *) (((BYTE *) pRequest) - HEADERSIZE);
00394     }else
00395     {
00396         return pRequest;
00397     }
00398 }
00399
00400
00401
00402
00403
00404 //+---------------------------------------------------------------------
00405 //
00406 //  Member:     CMallocSpy::PostGetSize
00407 //
00408 //  Synopsis:   Called after OLE calls IMalloc::GetSize
00409 //
00410 //  Arguments:  [cbActual] -- The result of IMalloc::GetSize
00411 //              [fSpyed]   -- Whether it was allocated with a spy active
00412 //
00413 //  Returns:    The size to return to the IMalloc::GetSize caller
00414 //
00415 //  History:    24-Oct-94   Created.
00416 //
00417 //  Notes:
00418 //
00419 //----------------------------------------------------------------------
00420 SIZE_T CMallocSpy::PostGetSize(SIZE_T cbActual, BOOL fSpyed)
00421 {
00422     if (fSpyed)
00423     {
00424         return cbActual - HEADERSIZE;
00425     }
00426     else
00427     {
00428         return cbActual;
00429     }
00430 }
00431
00432
00433
00434
00435
00436 //+---------------------------------------------------------------------
00437 //
00438 //  Member:     CMallocSpy::PreDidAlloc
00439 //
00440 //  Synopsis:   Called prior to OLE calling IMalloc::DidAlloc
00441 //
00442 //  Arguments:  [pRequest] -- The buffer whose allocation is being tested
00443 //              [fSpyed]   -- Whether it was allocated with a spy active
00444 //
00445 //  Returns:    The buffer whose allocation is actually to be tested
00446 //
00447 //  History:    24-Oct-94   Created.
00448 //
00449 //  Notes:
00450 //
00451 //----------------------------------------------------------------------
00452 void *CMallocSpy::PreDidAlloc(void *pRequest, BOOL fSpyed)
00453 {
00454     if (fSpyed)
00455     {
00456         return (void *) (((BYTE *) pRequest) - HEADERSIZE);
00457     }
00458     else
00459     {
00460         return pRequest;
00461     }
00462 }
00463
00464
00465
00466
00467
00468 //+---------------------------------------------------------------------
00469 //
00470 //  Function:   PostDidAlloc
00471 //
00472 //  Synopsis:   Called after OLE calls the IMalloc::DidAlloc
00473 //
00474 //  Arguments:  [pRequest] -- The passed allocation
00475 //              [fSpyed]   -- Whether it was allocated with a spy active
00476 //              [fActual]  -- The result of IMalloc::DidAlloc
00477 //
00478 //  Returns:    The result of IMalloc::DidAlloc
00479 //
00480 //  History:    24-Oct-94   Created.
00481 //
00482 //  Notes:
00483 //
00484 //----------------------------------------------------------------------
00485 BOOL CMallocSpy::PostDidAlloc(void *pRequest, BOOL fSpyed, BOOL fActual)
00486 {
00487     return fActual;
00488 }
00489
00490
00491
00492
00493
00494 //+---------------------------------------------------------------------
00495 //
00496 //  Member:     CMallocSpy::PreHeapMinimize
00497 //
00498 //  Synopsis:   Called prior to OLE calling the IMalloc::HeapMinimize
00499 //
00500 //  Returns:
00501 //
00502 //  History:    24-Oct-94   Created.
00503 //
00504 //  Notes:
00505 //
00506 //----------------------------------------------------------------------
00507 void CMallocSpy::PreHeapMinimize(void)
00508 {
00509     // We don't do anything here
00510     return;
00511 }
00512
00513
00514
00515
00516
00517 //+---------------------------------------------------------------------
00518 //
00519 //  Member:     CMallocSpy::PostHeapMinimize
00520 //
00521 //  Synopsis:   Called after OLE calls the IMalloc::HeapMinimize
00522 //
00523 //  Returns:
00524 //
00525 //  History:    24-Oct-94   Created.
00526 //
00527 //  Notes:
00528 //
00529 //----------------------------------------------------------------------
00530 void CMallocSpy::PostHeapMinimize(void)
00531 {
00532     // We don't do anything here
00533     return;
00534 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCharGrid Member List

This is the complete list of members for CCharGrid, including all inherited members.
_cCol | CGrid | [protected]
_cRow | CGrid | [protected]
_font | CTextGrid | [protected]
_iEltOffset | CTextGrid | [protected]
_pCharUsed | CTextGrid | [protected]
_ptOrg | CTextGrid | [protected]
_size | CGrid | [protected]
CCharGrid(UINT cCol, UINT cRow, SIZE size, UINT iEltOffset=0) | CCharGrid |
CGrid() | CGrid | [inline]
CTextGrid() | CTextGrid | [inline]
Detach() | CGrid |
Draw(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject) | CGrid |
DrawElement(CCanvas &canvas, COORD x, COORD y, UINT i, UINT j) | CCharGrid | [virtual]
FindBehavior(BSTR bstrBehavior, BSTR bstrBehaviorUrl, IElementBehaviorSite *pSite, IElementBehavior **ppBehavior) | CGrid |
get_GridSize(long *pVal) | CGrid |
GetPainterInfo(HTML_PAINTER_INFO *pInfo) | CGrid |
GridSize([out, retval] long *pVal) | IGrid |
GridSize([in] long newVal) | IGrid |
Hittest(POINT pt, POINT ptTest) | CTextGrid |
HitTestPoint(POINT pt, BOOL *pbHit, LONG *plPartID) | CGrid |
Init(IElementBehaviorSite *pBehaviorSite) | CGrid |
m_lClientLeft | CGrid |
m_lClientTop | CGrid |
m_lGridSize | CGrid |
m_spPaintSite | CGrid |
m_spSite | CGrid |
Notify(LONG lEvent, VARIANT *pVar) | CGrid |
OnResize(SIZE size) | CGrid |
Paint(CCanvas &canvas, RECT rc, POINT pt) | CTextGrid | [virtual]
put_GridSize(long newVal) | CGrid |
SetCharTable() | CTextGrid |
SetFont(HFONT hfont) | CTextGrid |
SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) | CGrid |
SetTextOrg() | CTextGrid | [inline]
SetTextOrg(COORD x, COORD y) | CTextGrid | [inline]
Trace(WCHAR *message) | CGrid | [inline]
~CTextGrid() | CTextGrid | [inline]
Generated on Wed Nov 13 2024 16:55:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DEB_THREAD_NODE_INFO_STRUCT Member List

This is the complete list of members for DEB_THREAD_NODE_INFO_STRUCT, including all inherited members.
dwProcessId | DEB_THREAD_NODE_INFO_STRUCT
dwThreadId | DEB_THREAD_NODE_INFO_STRUCT
ThreadDebugInfo | DEB_THREAD_NODE_INFO_STRUCT
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/LoadProtocol/ipsamplerm.h Source File

  • NetDS
  • RRas
  • LoadProtocol

ipsamplerm.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     ipsamplerm.h
00008
00009 Abstract:
00010
00011     The file contains type definitions and declarations for SAMPLE, the
00012     sample ip protocol, used by the IP Router Manager.
00013
00014 --*/
00015
00016 #ifndef _IPSAMPLERM_H_
00017 #define _IPSAMPLERM_H_
00018
00019
00020 // useful for variable sized structs
00021 #undef  ANY_SIZE
00022 #define ANY_SIZE 0
00023
00024
00025
00026 //----------------------------------------------------------------------------
00027 // CONSTANT AND MACRO DECLARATIONS
00028 //----------------------------------------------------------------------------
00029
00030 #define PROTO_IP_SAMPLE 200
00031 #define MS_IP_SAMPLE    \
00032 PROTOCOL_ID(PROTO_TYPE_UCAST, PROTO_VENDOR_MS0, PROTO_IP_SAMPLE)
00033
00034 #define SAMPLE_PROTOCOL_MULTICAST_GROUP ((DWORD)0x640000E0) // 224.0.0.100
00035
00036
00037 //----------------------------------------------------------------------------
00038 // constants identifying IPSAMPLE's MIB tables
00039 //----------------------------------------------------------------------------
00040
00041 #define IPSAMPLE_GLOBAL_STATS_ID        0
00042 #define IPSAMPLE_GLOBAL_CONFIG_ID       1
00043 #define IPSAMPLE_IF_STATS_ID            2
00044 #define IPSAMPLE_IF_CONFIG_ID           3
00045 #define IPSAMPLE_IF_BINDING_ID          4
00046
00047
00048 //----------------------------------------------------------------------------
00049 // constants used for the field IPSAMPLE_GLOBAL_CONFIG::dwLoggingLevel
00050 //----------------------------------------------------------------------------
00051
00052 #define IPSAMPLE_LOGGING_NONE           0
00053 #define IPSAMPLE_LOGGING_ERROR          1
00054 #define IPSAMPLE_LOGGING_WARN           2
00055 #define IPSAMPLE_LOGGING_INFO           3
00056
00057
00058
00059 //----------------------------------------------------------------------------
00060 // constants used for the field IPSAMPLE_IF_CONFIG::ulMetric
00061 //----------------------------------------------------------------------------
00062
00063 #define IPSAMPLE_METRIC_INFINITE        16
00064
00065
00066
00067 //----------------------------------------------------------------------------
00068 // constants used to construct the field IPSAMPLE_IF_BINDING::dwState
00069 //----------------------------------------------------------------------------
00070
00071 #define IPSAMPLE_STATE_ACTIVE           0x00000001
00072 #define IPSAMPLE_STATE_BOUND            0x00000002
00073
00074
00075
00076 //----------------------------------------------------------------------------
00077 // STRUCTURE DEFINITIONS
00078 //----------------------------------------------------------------------------
00079
00080
00081
00082 //----------------------------------------------------------------------------
00083 // struct:      IPSAMPLE_GLOBAL_STATS
00084 //
00085 // This MIB entry stores global statistics for IPSAMPLE;
00086 // There is only one instance, so this entry has no index.
00087 //
00088 // This structure is read-only.
00089 //----------------------------------------------------------------------------
00090
00091 typedef struct _IPSAMPLE_GLOBAL_STATS
00092 {
00093     ULONG       ulNumInterfaces; // # interfaces added
00094 } IPSAMPLE_GLOBAL_STATS, *PIPSAMPLE_GLOBAL_STATS;
00095
00096
00097
00098 //----------------------------------------------------------------------------
00099 // struct:      IPSAMPLE_GLOBAL_CONFIG
00100 //
00101 // This MIB entry stores global configuration for IPSAMPLE
00102 // There is only one instance, so this entry has no index.
00103 //----------------------------------------------------------------------------
00104
00105 typedef struct _IPSAMPLE_GLOBAL_CONFIG
00106 {
00107     DWORD       dwLoggingLevel;
00108 } IPSAMPLE_GLOBAL_CONFIG, *PIPSAMPLE_GLOBAL_CONFIG;
00109
00110
00111
00112 //----------------------------------------------------------------------------
00113 // struct:      IPSAMPLE_IF_STATS
00114 //
00115 // This MIB entry stores per-interface statistics for IPSAMPLE.
00116 //
00117 // This structure is read-only.
00118 //----------------------------------------------------------------------------
00119
00120 typedef struct _IPSAMPLE_IF_STATS
00121 {
00122     ULONG       ulNumPackets;   // # packets sent out this interface
00123 } IPSAMPLE_IF_STATS, *PIPSAMPLE_IF_STATS;
00124
00125
00126
00127 //----------------------------------------------------------------------------
00128 // struct:      IPSAMPLE_IF_CONFIG
00129 //
00130 // This MIB entry describes per-interface configuration.
00131 // All IP address fields must be in network order.
00132 //----------------------------------------------------------------------------
00133
00134 typedef struct _IPSAMPLE_IF_CONFIG
00135 {
00136     ULONG       ulMetric;
00137 } IPSAMPLE_IF_CONFIG, *PIPSAMPLE_IF_CONFIG;
00138
00139
00140
00141 //----------------------------------------------------------------------------
00142 // struct:      IPSAMPLE_IF_BINDING
00143 //
00144 // This MIB entry contains the table of IP addresses to which each
00145 // interface is bound.  All IP addresses are in network order.
00146 //
00147 // THIS STRUCTURE IS VARIABLE LENGTH:
00148 //
00149 //  The base structure contains of the field ulCount, which gives the
00150 //  number of IP addresses to which the indexed interface is bound.  The
00151 //  IP addresses themselves follow the base structure, and are given as
00152 //  IPSAMPLE_IP_ADDRESS structures.
00153 //
00154 // This MIB entry is read-only.
00155 //----------------------------------------------------------------------------
00156
00157 typedef struct _IPSAMPLE_IF_BINDING
00158 {
00159     DWORD       dwState;
00160     ULONG       ulCount;
00161 } IPSAMPLE_IF_BINDING, *PIPSAMPLE_IF_BINDING;
00162
00163
00164
00165
00166 //----------------------------------------------------------------------------
00167 // struct:      IPSAMPLE_IP_ADDRESS
00168 //
00169 // This structure is used for storing interface bindings.  A series of
00170 // structures of this type follows the IPSAMPLE_IF_BINDING structure
00171 // (described above).
00172 //
00173 // Both fields are IP address fields in network-order.
00174 //----------------------------------------------------------------------------
00175
00176 typedef struct _IPSAMPLE_IP_ADDRESS
00177 {
00178     DWORD       dwAddress;
00179     DWORD       dwMask;
00180 } IPSAMPLE_IP_ADDRESS, *PIPSAMPLE_IP_ADDRESS;
00181
00182
00183
00184 //----------------------------------------------------------------------------
00185 // macros for manipulating the variable-length IPSAMPLE_IF_BINDING structure
00186 //
00187 // IPSAMPLE_IF_BINDING_SIZE computes the size of a binding structure.
00188 //
00189 // IPSAMPLE_IF_ADDRESS_TABLE computes the starting address in a binding
00190 //      struct of the series of IPSAMPLE_IP_ADDRESS structures which are
00191 //      the bindings for the interface in question.
00192 //
00193 // e.g.
00194 //      PIPSAMPLE_IF_BINDING piibSource, piibDest;
00195 //
00196 //      piibDest = malloc(IPSAMPLE_IF_BINDING_SIZE(piibSource));
00197 //      memcpy(piibDest, piibSource, IPSAMPLE_IF_BINDING_SIZE(piibSource));
00198 //
00199 // e.g.
00200 //      ULONG                   i;
00201 //      PIPSAMPLE_IF_BINDING    piib;
00202 //      PIPSAMPLE_IP_ADDRESS    *piia;
00203 //
00204 //      piia = IPSAMPLE_IF_ADDRESS_TABLE(piib);
00205 //      for (i = 0; i < piib->ulCount; i++)
00206 //      {
00207 //          printf("%s-", inet_ntoa(*(struct in_addr *)&piia->dwAddress));
00208 //          printf("%s\n", inet_ntoa(*(struct in_addr *)&piia->dwMask));
00209 //      }
00210 //----------------------------------------------------------------------------
00211
00212 #define IPSAMPLE_IF_BINDING_SIZE(bind)                          \
00213     (sizeof(IPSAMPLE_IF_BINDING) +                              \
00214      (bind)->ulCount * sizeof(IPSAMPLE_IP_ADDRESS))
00215
00216 #define IPSAMPLE_IF_ADDRESS_TABLE(bind)                         \
00217     ((PIPSAMPLE_IP_ADDRESS)((bind) + 1))
00218
00219
00220
00221 //----------------------------------------------------------------------------
00222 // The following structures are used to query the MIB and get back a
00223 // response.  The TypeID field is one of the IDs #defined above.  The
00224 // IfIndex is used to reference an interface table entry .  For sample
00225 // it corresponds to an ip address, and hence is a single DWORD for now.
00226 // In general the index could be a variable size array of DWORDs.
00227 //----------------------------------------------------------------------------
00228
00229
00230
00231 //----------------------------------------------------------------------------
00232 // struct:      IPSAMPLE_MIB_SET_INPUT_DATA
00233 //
00234 // This is passed as input data for MibSet.
00235 // Note that only global config and interface config can be set.
00236 //----------------------------------------------------------------------------
00237
00238 typedef struct _IPSAMPLE_MIB_SET_INPUT_DATA
00239 {
00240     DWORD       IMSID_TypeID;
00241     DWORD       IMSID_IfIndex;
00242     DWORD       IMSID_BufferSize;
00243     BYTE        IMSID_Buffer[ANY_SIZE];
00244 } IPSAMPLE_MIB_SET_INPUT_DATA, *PIPSAMPLE_MIB_SET_INPUT_DATA;
00245
00246
00247
00248 //----------------------------------------------------------------------------
00249 // struct:      IPSAMPLE_MIB_GET_INPUT_DATA
00250 //
00251 // This is passed as input data for MibGet, MibGetFirst, MibGetNext.  All
00252 // tables are readable.  All IP addresses must be in network order.
00253 //----------------------------------------------------------------------------
00254
00255 typedef struct _IPSAMPLE_MIB_GET_INPUT_DATA
00256 {
00257     DWORD   IMGID_TypeID;
00258     DWORD   IMGID_IfIndex;
00259 } IPSAMPLE_MIB_GET_INPUT_DATA, *PIPSAMPLE_MIB_GET_INPUT_DATA;
00260
00261
00262
00263 //----------------------------------------------------------------------------
00264 // struct:      IPSAMPLE_MIB_GET_OUTPUT_DATA
00265 //
00266 // This is written into the output data by MibGet, MibGetFirst, MibGetNext.
00267 //----------------------------------------------------------------------------
00268
00269 typedef struct _IPSAMPLE_MIB_GET_OUTPUT_DATA
00270 {
00271     DWORD   IMGOD_TypeID;
00272     DWORD   IMGOD_IfIndex;
00273
00274     BYTE    IMGOD_Buffer[ANY_SIZE];
00275 } IPSAMPLE_MIB_GET_OUTPUT_DATA, *PIPSAMPLE_MIB_GET_OUTPUT_DATA;
00276
00277 #endif // _IPSAMPLERM_H_
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/proxy.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

proxy.h

Go to the documentation of this file.
00001 // Proxy.h : Declaration of the CProxy
00002
00003 #ifndef __PROXY_H_
00004 #define __PROXY_H_
00005
00006 #include "resource.h"       // main symbols
00007 #include <mtx.h>
00008
00009 /////////////////////////////////////////////////////////////////////////////
00010 // CProxy
00011 class ATL_NO_VTABLE CProxy :
00012   public CComObjectRootEx<CComSingleThreadModel>,
00013   public CComCoClass<CProxy, &CLSID_Proxy>,
00014   public IObjectControl,
00015   public IObjectConstruct,
00016   public ISupportErrorInfo,
00017   public IDispatchImpl<IDataProxy, &IID_IDataProxy, &LIBID_DataServices>,
00018   public CODBCData
00019 {
00020
00021 public:
00022   CProxy()
00023   {
00024     m_nCount = -1;
00025     vtNull.vt = VT_NULL;
00026     m_nRows = 0;
00027     m_MetaData = NULL;
00028   }
00029
00030   ~CProxy()
00031   {
00032     ClearArray();
00033   }
00034
00035   void ClearArray()
00036   {
00037     if (m_MetaData != NULL)
00038     {
00039       delete [] m_MetaData;
00040       m_MetaData = NULL;
00041     }
00042   }
00043
00044 DECLARE_REGISTRY_RESOURCEID(IDR_PROXY)
00045
00046 DECLARE_GET_CONTROLLING_UNKNOWN()
00047
00048 DECLARE_PROTECT_FINAL_CONSTRUCT()
00049
00050 BEGIN_COM_MAP(CProxy)
00051   COM_INTERFACE_ENTRY(IDataProxy)
00052   COM_INTERFACE_ENTRY(IObjectControl)
00053   COM_INTERFACE_ENTRY(IDispatch)
00054   COM_INTERFACE_ENTRY(IObjectConstruct)
00055   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00056   COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
00057 END_COM_MAP()
00058
00059
00060   HRESULT FinalConstruct()
00061   {
00062     return CoCreateFreeThreadedMarshaler(
00063       GetControllingUnknown(), &m_pUnkMarshaler.p);
00064   }
00065
00066   void FinalRelease()
00067   {
00068     m_pUnkMarshaler.Release();
00069   }
00070
00071   CComPtr<IUnknown> m_pUnkMarshaler;
00072 // ISupportsErrorInfo
00073   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00074
00075 // IObjectControl
00076 public:
00077     virtual HRESULT STDMETHODCALLTYPE Activate(void);
00078     virtual void STDMETHODCALLTYPE Deactivate(void);
00079     virtual BOOL STDMETHODCALLTYPE CanBePooled(void);
00080
00081 //IObjectConstruct
00082   STDMETHODIMP Construct(IDispatch * pUnk);
00083
00084 // IDataProxy
00085 public:
00086   _ConnectionPtr m_spConnection;
00087   STDMETHOD(EntityInsert)(IEntityData *Entity, /*[out, retval]*/ long *Result);
00088   STDMETHOD(EntityDelete)(/*[in]*/ IEntityData *Entity, /*[out, retval]*/ long *Result);
00089   STDMETHOD(LookupFree)();
00090   STDMETHOD(NextEntity)(/*[out, retval]*/ IEntityData **ppEntity);
00091   STDMETHOD(EntityLookup)(BSTR SQLString, long *Result, BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField, IEntityData **ppEntity);
00092   STDMETHOD(EntityRead)(IEntityData *pEntity, long *Results);
00093   STDMETHOD(EntityUpdate)(IEntityData *pEntity, long *Result);
00094   STDMETHOD(ManualConstruct)( BSTR ConstructString);
00095   STDMETHOD(Execute)(BSTR SQLString, long *Result);
00096   STDMETHOD(EntityLoad)(BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField, VARIANT KeyValue, long *Result, IEntityData **ppEntity);
00097   STDMETHOD(RSUpdate)(_Recordset *rs);
00098   STDMETHOD(RSQueryRW)(BSTR QueryText, VARIANT *Result, _Recordset **rs);
00099   STDMETHOD(RSQuery)(BSTR QueryText, VARIANT *Result, _Recordset ** Recordset);
00100   STDMETHOD(EntityQuery)(BSTR SQLString, long *Result, BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField, IResultset **ppResults);
00101   STDMETHOD(NextResultset)(long *Result, IResultset **Results);
00102   STDMETHOD(NextLookup)(long *Result, IEntityData **ppEntity);
00103
00104   FieldMetaData *m_MetaData;
00105   short m_nCount;
00106   long m_nRows;
00107
00108 private:
00109   HRESULT InternalNextEntity(CStaticEntity *spEntity);
00110   HRESULT InternalLookup(BSTR SQLString, long *Result, BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField);
00111   HRESULT InternalBindLookup(CStaticEntity *spEntity);
00112   HRESULT BindStaticEntity(FieldMetaData *MetaData, short nCount, CStaticEntity* spEntity);
00113   HRESULT PopulateStaticEntity(FieldMetaData *MetaData, IEntityData *pEntity);
00114   HRESULT CollectResultRows(IResultset **ppResults);
00115
00116   CFastVariant vtNull;
00117
00118   CString m_wszReadStoredProc;
00119   CString m_wszUpdateStoredProc;
00120   CString m_wszDeleteStoredProc;
00121   CString m_wszInsertStoredProc;
00122   CString m_wszKeyField;
00123 };
00124
00125 #endif //__PROXY_H_
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsCmd/enum.cxx Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsCmd

enum.cxx

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       enum.cxx
00008 //
00009 //  Contents:   Active Drectory container enumeration
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #include "main.hxx"
00015
00016
00017 //
00018 // Private defines
00019 //
00020
00021 #define MAX_ADS_FILTERS   10
00022 #define MAX_ADS_ENUM      100     // number of entries to read each time
00023
00024
00025 //
00026 // Local functions
00027 //
00028
00029
00030 HRESULT
00031 PrintLongFormat(
00032     IADs * pObject
00033     );
00034
00035 //
00036 //  List contents of a container identified by the ADsPath
00037 //
00038
00039 int
00040 DoList(char * AnsiADsPath)
00041 {
00042     HRESULT hr;
00043     int i = 0 ;
00044     LPWSTR pszADsPath, apszTypes[MAX_ADS_FILTERS] ;
00045
00046     if (!(pszADsPath = AllocateUnicodeString(AnsiADsPath))) {
00047
00048         return(1) ;
00049     }
00050
00051     apszTypes[0] = NULL ;
00052
00053     //
00054     //  Filter may be set as follows. For example, to get users and group:
00055     //
00056     //  apszTypes[0] = L"User" ;
00057     //  apszTypes[1] = L"Group" ;
00058     //  apszTypes[2] = NULL ;
00059     //
00060
00061     hr = EnumObject(
00062              pszADsPath,
00063              apszTypes,
00064              i
00065              );
00066
00067     FreeUnicodeString(pszADsPath);
00068
00069     return (FAILED(hr) ? 1 : 0) ;
00070 }
00071
00072 //
00073 // Enumerates the contents of a container object.
00074 //
00075
00076 HRESULT
00077 EnumObject(
00078     LPWSTR pszADsPath,
00079     LPWSTR * lppClassNames,
00080     DWORD dwClassNames
00081     )
00082 {
00083     ULONG cElementFetched = 0L;
00084     IEnumVARIANT * pEnumVariant = NULL;
00085     VARIANT VarFilter, VariantArray[MAX_ADS_ENUM];
00086
00087     HRESULT hr;
00088     IADsContainer * pADsContainer =  NULL;
00089     DWORD dwObjects = 0, dwEnumCount = 0, i = 0;
00090     BOOL  fContinue = TRUE;
00091
00092
00093     VariantInit(&VarFilter);
00094
00095     hr = ADsGetObject(
00096                 pszADsPath,
00097                 IID_IADsContainer,
00098                 (void **)&pADsContainer
00099                 );
00100
00101     BAIL_ON_FAILURE(hr, L"Failed to bind to container object");
00102
00103     hr = ADsBuildVarArrayStr(
00104                 lppClassNames,
00105                 dwClassNames,
00106                 &VarFilter
00107                 );
00108     BAIL_ON_FAILURE(hr, L"Failed while executing ADsBuildVarArrayStr");
00109
00110
00111     hr = pADsContainer->put_Filter(VarFilter);
00112     BAIL_ON_FAILURE(hr, L"Failed to put_Filter on container object");
00113
00114     hr = ADsBuildEnumerator(
00115             pADsContainer,
00116             &pEnumVariant
00117             );
00118     BAIL_ON_FAILURE(hr, L"Failed while executing ADsBuildEnumerator");
00119
00120
00121
00122     while (fContinue) {
00123
00124         IADs *pObject ;
00125
00126         hr = ADsEnumerateNext(
00127                     pEnumVariant,
00128                     MAX_ADS_ENUM,
00129                     VariantArray,
00130                     &cElementFetched
00131                     );
00132
00133         if (hr == S_FALSE) {
00134             fContinue = FALSE;
00135         }
00136
00137         dwEnumCount++;
00138
00139         for (i = 0; i < cElementFetched; i++ ) {
00140
00141             IDispatch *pDispatch = NULL;
00142
00143             pDispatch = VariantArray[i].pdispVal;
00144
00145             hr = pDispatch->QueryInterface(IID_IADs,
00146                                            (VOID **) &pObject) ;
00147             BAIL_ON_FAILURE(hr, L"Failed to QI the enumerate varDisp to IADs interface");
00148
00149             PrintLongFormat(pObject);
00150
00151             pObject->Release();
00152             pDispatch->Release();
00153         }
00154
00155         memset(VariantArray, 0, sizeof(VARIANT)*MAX_ADS_ENUM);
00156
00157         dwObjects += cElementFetched;
00158
00159     }
00160
00161     printf("Total Number of Objects enumerated is %d\n", dwObjects);
00162
00163     ADsFreeEnumerator( pEnumVariant ); // You don't need to Release if you call ADsFreeEnumerator
00164
00165
00166     if (pADsContainer) {
00167         pADsContainer->Release();
00168     }
00169
00170     VariantClear(&VarFilter);
00171
00172     return(S_OK);
00173
00174 error:
00175     if (FAILED(hr)) {
00176
00177         wprintf(L"Unable to list contents of: %s\n", pszADsPath) ;
00178     }
00179
00180 //exitpoint:
00181
00182     if (pEnumVariant) {
00183         pEnumVariant->Release();
00184     }
00185
00186     VariantClear(&VarFilter);
00187
00188
00189     if (pADsContainer) {
00190         pADsContainer->Release();
00191     }
00192
00193     return(hr);
00194 }
00195
00196 HRESULT
00197 PrintLongFormat(IADs * pObject)
00198 {
00199
00200     HRESULT hr = S_OK;
00201     BSTR bstrName = NULL;
00202     BSTR bstrClass = NULL;
00203     BSTR bstrSchema = NULL;
00204
00205     hr = pObject->get_Name(&bstrName) ;
00206     BAIL_ON_FAILURE(hr, L"Failed to get the name of the object");
00207
00208     hr = pObject->get_Class(&bstrClass);
00209     BAIL_ON_FAILURE(hr, L"Failed to get the class of the object");
00210
00211     // hr = pObject->get_Schema(&bstrSchema);
00212
00213     wprintf(L"  %s(%s)\n", bstrName, bstrClass) ;
00214
00215 error:
00216     if (bstrClass) {
00217         SysFreeString(bstrClass);
00218     }
00219     if (bstrName) {
00220         SysFreeString(bstrName);
00221     }
00222     if (bstrSchema) {
00223         SysFreeString(bstrSchema);
00224     }
00225     return(hr);
00226 }
00227
00228
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AdvReco/ChildWnds.h Source File

  • TabletPC
  • AdvReco

ChildWnds.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 // Module:
00012 //      ChildWnds.h
00013 //
00014 // Description:
00015 //      This file contains the definitions of the classes CInkInputWnd
00016 //      and CRecoOutputWnd, which are derived from the ATL's CWindowImpl
00017 //      and used for creating the sample's child windows.
00018 //    The methods of the classes are defined in the ChildWnds.cpp file.
00019 //--------------------------------------------------------------------------
00020
00021 #pragma once
00022
00023 /////////////////////////////////////////////////////////
00024 //
00025 // class CInkInputWnd
00026 //
00027 // The CInkInputWnd class allows to create a simple window, that
00028 // may draw itself with lined or boxed guides or with no guides at all.
00029 //
00030 // An object of the class is used in the CAdvRecoApp for pen input.
00031 //
00032 /////////////////////////////////////////////////////////
00033
00034 class CInkInputWnd :
00035     public CWindowImpl<CInkInputWnd>
00036 {
00037   // Data members
00038   POINT   m_ptGridLT;     // the left-top corner of the guide grid
00039     SIZE    m_szWritingBox;   // the size of the guide's writing box
00040     RECT    m_rcDrawnBox;   // the guide's draw box rectangle relative to the writing box
00041     int     m_cRows;      // the number of rows in the guide
00042     int     m_cColumns;     // the number of columns in the guide
00043     int     m_iMidline;     // the position of the midline the writing box
00044
00045 public:
00046
00047   // Constructor
00048     CInkInputWnd();
00049
00050     // Data members access methods
00051     void SetGuide(const _InkRecoGuide& irg);
00052     void SetRowsCols(int iRows, int iColumns);
00053
00054 // Declare the objects' window class with NULL background (-1) to avoid flicking
00055 // that happens because of delays between WM_ERASEBKGND and WM_PAINT messages
00056 // sent to the window. The background will be painted in the WM_PAINT handler.
00057 DECLARE_WND_CLASS_EX(NULL, 0, -1)
00058
00059 // ATL macro's to declare which commands/messages the class is interested in
00060 BEGIN_MSG_MAP(CInkInputWnd)
00061     MESSAGE_HANDLER(WM_PAINT, OnPaint)
00062 END_MSG_MAP()
00063
00064     // WM_PAINT message handler
00065   LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00066
00067 };  // class CInkInputWnd
00068
00069
00070
00071 /////////////////////////////////////////////////////////
00072 //
00073 // class CRecoOutputWnd
00074 //
00075 // The CRecoOutputWnd class allows to create a window, that draws
00076 // a few lines of text in it.
00077 //
00078 // An object of the class is used in the CAdvRecoApp to output
00079 // results of the recognition.
00080 //
00081 /////////////////////////////////////////////////////////
00082
00083 class CRecoOutputWnd :
00084     public CWindowImpl<CRecoOutputWnd>
00085 {
00086 public:
00087
00088 // Data members
00089
00090     // Declare the class-wide constants
00091     enum {
00092         mc_iNumResults = 5,   // the maximum number of result strings
00093         mc_iMarginX = 10,   // left offset for text output
00094         mc_iMarginY = 10,     // top offset for text output
00095         mc_iFontHeight = 20   // height of the fonts for text output
00096     };
00097
00098     // Array of strings to draw out
00099     CComBSTR    m_bstrResults[mc_iNumResults];
00100
00101     // The current font object to draw text with
00102     HFONT   m_hFont;
00103     int     m_iFontName;
00104     UINT    m_nGesture;
00105     bool    m_bNewGesture;
00106
00107 // Constructor and destructor
00108
00109   CRecoOutputWnd();
00110     ~CRecoOutputWnd();
00111
00112 // Helper methods
00113
00114     void ResetResults();
00115     int GetBestHeight();
00116     bool UpdateFont(LANGID wLangId);
00117     void SetGestureName(UINT nGesture);
00118
00119 // Declare the class objects' window class with NULL background to avoid flicking.
00120 DECLARE_WND_CLASS_EX(NULL, 0, -1)
00121
00122 // ATL macro's to declare which commands/messages the class is interested in.
00123 BEGIN_MSG_MAP(CRecoOutputWnd)
00124     MESSAGE_HANDLER(WM_PAINT, OnPaint)
00125 END_MSG_MAP()
00126
00127   // WM_PAINT message handler
00128     LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00129
00130 };  // class CRecoOutputWnd
00131
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/guids.h Source File

  • SysMgmt
  • MMC
  • Complete

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // {CF03AC2A-6BE6-11d3-9156-00C04F65B3F9}
00020 DEFINE_GUID(CLSID_CComponentData,
00021 0xcf03ac2a, 0x6be6, 0x11d3, 0x91, 0x56, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9);
00022
00023
00024 // {D740704B-6BE6-11d3-9156-00C04F65B3F9}
00025 DEFINE_GUID(CLSID_CSnapinAbout,
00026 0xd740704b, 0x6be6, 0x11d3, 0x91, 0x56, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStartupListener/MyStartupListener.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStartupListener

MyStartupListener.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      MyStartupListener.cpp
00005 //
00006 //  Description:
00007 //      Implementation of CMyStartupListener class.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 #include "stdafx.h"
00012 #include "MyStartupListener.h"
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 //++
00016 //
00017 //  CMyStartupListener::CMyStartupListener
00018 //
00019 //  Description:
00020 //      Constructor of the CMyStartupListener class.
00021 //
00022 //  Arguments:
00023 //      None.
00024 //
00025 //  Return Value:
00026 //      None.
00027 //
00028 //--
00029 //////////////////////////////////////////////////////////////////////////////
00030 CMyStartupListener::CMyStartupListener( void )
00031     : m_lcid( LOCALE_NEUTRAL )
00032     , m_piccCallback( NULL )
00033 {
00034 } //*** CMyStartupListener::CMyStartupListener
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 //++
00038 //
00039 //  CMyStartupListener::~CMyStartupListener
00040 //
00041 //  Description:
00042 //      Destructor of the CMyStartupListener class.
00043 //
00044 //  Arguments:
00045 //      None.
00046 //
00047 //  Return Value:
00048 //      None.
00049 //
00050 //--
00051 //////////////////////////////////////////////////////////////////////////////
00052 CMyStartupListener::~CMyStartupListener( void )
00053 {
00054     // Release the callback interface
00055     if ( m_piccCallback != NULL )
00056     {
00057         m_piccCallback->Release();
00058     } // if: the callback interface pointer is not NULL
00059
00060 } //*** CMyStartupListener::~CMyStartupListener
00061
00062
00063 //***************************************************************************
00064 //
00065 //  IClusCfgStartupListener interface
00066 //
00067 //***************************************************************************
00068
00069 //////////////////////////////////////////////////////////////////////////////
00070 //++
00071 //
00072 //  [IClusCfgStartupListener]
00073 //  CMyStartupListener::Notify
00074 //
00075 //  Description:
00076 //      This function gets called just after the cluster service has started.
00077 //
00078 //  Arguments:
00079 //      punkIn
00080 //          Pointer to a COM object that implements
00081 //          IClusCfgResourceTypeCreate.
00082 //
00083 //  Return Value:
00084 //      S_OK
00085 //          Operation completed successfully.
00086 //
00087 //      Other HRESULTs
00088 //          An error occurred.
00089 //
00090 //--
00091 //////////////////////////////////////////////////////////////////////////////
00092 STDMETHODIMP
00093 CMyStartupListener::Notify( IUnknown * punkIn )
00094 {
00095     //
00096     // TODO: Modify this code to perform your tasks.
00097     //
00098
00099     HRESULT         hr = S_OK;
00100     WCHAR           szMessage[] = L"MyStartupListener Message: The Cluster Service has started successfully.";
00101
00102     UNREFERENCED_PARAMETER( punkIn );
00103
00104     if ( m_piccCallback != NULL )
00105     {
00106         //
00107         // Log a message to client and server log file informing that the
00108         // cluster service has started on this machine.
00109         //
00110         hr = m_piccCallback->SendStatusReport(
00111                   NULL      // pcszNodeNameIn - Filled in by cluster config server.
00112                 , TASKID_Major_Client_And_Server_Log
00113                 , IID_NULL
00114                 , 0         // ulMinIn
00115                 , 1         // ulMaxIn
00116                 , 1         // ulCurrentIn
00117                 , hr
00118                 , szMessage
00119                 , NULL      // pftTimeIn - Filled in by cluster config server.
00120                 , NULL      // bstrReferenceIn
00121                 );
00122
00123         if ( FAILED( hr ) )
00124         {
00125             goto Cleanup;
00126         } // if:
00127     } //if: the callback interface pointer is not NULL
00128
00129 Cleanup:
00130
00131    return hr;
00132
00133 } //*** CMyStartupListener::Notify
00134
00135
00136 //***************************************************************************
00137 //
00138 //  IClusCfgInitialize interface
00139 //
00140 //***************************************************************************
00141
00142 //////////////////////////////////////////////////////////////////////////////
00143 //++
00144 //
00145 //  CMyStartupListener::Initialize
00146 //
00147 //  Description:
00148 //      Initialize this component.
00149 //
00150 //  Arguments:
00151 //      punkCallbackIn
00152 //          Pointer to the IUnknown interface of a component that implements
00153 //          the IClusCfgCallback interface.
00154 //
00155 //      lcidIn
00156 //          Locale id for this component.
00157 //
00158 //  Return Value:
00159 //      S_OK
00160 //          If the call succeeded.
00161 //
00162 //      E_POINTER
00163 //          The punkCallbackIn param is NULL.
00164 //
00165 //      Other HRESULTs
00166 //          An error occurred.
00167 //
00168 //--
00169 //////////////////////////////////////////////////////////////////////////////
00170 STDMETHODIMP
00171 CMyStartupListener::Initialize(
00172       IUnknown *   punkCallbackIn
00173     , LCID         lcidIn
00174     )
00175 {
00176     HRESULT hr = S_OK;
00177
00178     m_lcid = lcidIn;
00179
00180     if ( m_piccCallback != NULL )
00181     {
00182         //
00183         // Release the callback interface
00184         //
00185         m_piccCallback->Release();
00186         m_piccCallback = NULL;
00187     } // if: the callback interface pointer is not NULL
00188
00189     if ( punkCallbackIn != NULL )
00190     {
00191         //
00192         // Query for the IClusCfgCallback interface.
00193         //
00194         hr = punkCallbackIn->QueryInterface( __uuidof( IClusCfgCallback ), reinterpret_cast< void ** > ( &m_piccCallback ) );
00195     } // if: the callback punk is not NULL.
00196     else
00197     {
00198         hr = E_POINTER;
00199     } // else: the callback punk is NULL.
00200
00201     return hr;
00202
00203 } //*** CMyStartupListener::Initialize
00204
00205
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ADORecordConstruction.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ADORecordConstruction.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ADORecordConstruction
00019 /** @com.interface(iid=00000567-0000-0010-8000-00AA006D2EA4, thread=AUTO) */
00020 public interface ADORecordConstruction extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, addFlagsVtable=4)
00023       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00024   public IUnknown getRow();
00025
00026   /** @com.method(vtoffset=5, addFlagsVtable=4)
00027       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] ppRow) */
00028   public void setRow(IUnknown ppRow);
00029
00030   /** @com.method(vtoffset=6, addFlagsVtable=4)
00031       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] _jcomparam_0) */
00032   public void setParentRow(IUnknown _jcomparam_0);
00033
00034
00035   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x567, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00036 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_chunkhdr Member List

This is the complete list of members for tag_chunkhdr, including all inherited members.
dwLength | tag_chunkhdr
fourccType | tag_chunkhdr
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/crmsub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

crmsub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __CRMSUB_H__
00018 #define __CRMSUB_H__
00019
00020 #include "resource.h"       // main symbols
00021
00022 CComBSTR GuidToBstr(REFGUID guid);
00023
00024 class CComSpy;
00025
00026 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00027 Class:   CCRMSub
00028 Summary: CRM Event Subscriber
00029 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00030 class ATL_NO_VTABLE CCRMSub :
00031   public CSysLCESub,
00032   public IComCRMEvents
00033 {
00034 public:
00035
00036   CCRMSub(CComSpy * pSpy)
00037   {
00038     m_pSpy = pSpy;
00039   }
00040   CCRMSub()
00041   {
00042     m_pSpy = NULL;
00043   }
00044
00045 DECLARE_NOT_AGGREGATABLE(CCRMSub)
00046 DECLARE_GET_CONTROLLING_UNKNOWN()
00047
00048 BEGIN_COM_MAP(CCRMSub)
00049   COM_INTERFACE_ENTRY(IComCRMEvents)
00050   COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00051 END_COM_MAP()
00052
00053 STDMETHODIMP GetEventType(EventEnum * e){*e = CRM;return S_OK;}
00054 STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00055 STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComCRMEvents;return S_OK;}
00056
00057
00058 ///// IComCRMEvents
00059
00060
00061   STDMETHOD(OnCRMRecoveryStart)(
00062         COMSVCSEVENTINFO * pInfo,
00063         GUID guidApp);
00064
00065   STDMETHOD(OnCRMRecoveryDone)(
00066         COMSVCSEVENTINFO * pInfo,
00067         GUID guidApp);
00068
00069   STDMETHOD(OnCRMCheckpoint)(
00070         COMSVCSEVENTINFO * pInfo,
00071         GUID guidApp);
00072
00073   STDMETHOD(OnCRMBegin)(
00074         COMSVCSEVENTINFO * pInfo,
00075         GUID guidClerkCLSID,
00076         GUID guidActivity,
00077         GUID guidTx,
00078         WCHAR szProgIdCompensator[64],      // NOTE: hardcoded
00079         WCHAR szDescription[64]);       // NOTE: hardcoded
00080
00081   STDMETHOD(OnCRMPrepare)(
00082         COMSVCSEVENTINFO * pInfo,
00083         GUID guidClerkCLSID);
00084
00085   STDMETHOD(OnCRMCommit)(
00086         COMSVCSEVENTINFO * pInfo,
00087         GUID guidClerkCLSID);
00088
00089   STDMETHOD(OnCRMAbort)(
00090         COMSVCSEVENTINFO * pInfo,
00091         GUID guidClerkCLSID);
00092
00093   STDMETHOD(OnCRMIndoubt)(
00094         COMSVCSEVENTINFO * pInfo,
00095         GUID guidClerkCLSID);
00096
00097   STDMETHOD(OnCRMDone)(
00098         COMSVCSEVENTINFO * pInfo,
00099         GUID guidClerkCLSID);
00100
00101   STDMETHOD(OnCRMRelease)(
00102         COMSVCSEVENTINFO * pInfo,
00103         GUID guidClerkCLSID);
00104
00105   STDMETHOD(OnCRMAnalyze)(
00106         COMSVCSEVENTINFO * pInfo,
00107         GUID guidClerkCLSID,
00108         DWORD dwCrmRecordType,
00109         DWORD dwRecordSize);
00110
00111   STDMETHOD(OnCRMWrite)(
00112         COMSVCSEVENTINFO * pInfo,
00113         GUID guidClerkCLSID,
00114         BOOL bVariants,
00115         DWORD dwRecordSize);
00116
00117   STDMETHOD(OnCRMForget)(
00118         COMSVCSEVENTINFO * pInfo,
00119         GUID guidClerkCLSID);
00120
00121   STDMETHOD(OnCRMForce)(
00122         COMSVCSEVENTINFO * pInfo,
00123         GUID guidClerkCLSID);
00124
00125   STDMETHOD(OnCRMDeliver)(
00126         COMSVCSEVENTINFO * pInfo,
00127         GUID guidClerkCLSID,
00128         BOOL bVariants,
00129         DWORD dwRecordSize);
00130
00131 };
00132 #endif //__CRMSUB_H__
00133
00134
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_DISCONNECTEXARGS Member List

This is the complete list of members for _DISCONNECTEXARGS, including all inherited members.
dwFlags | _DISCONNECTEXARGS
dwReserved | _DISCONNECTEXARGS
s | _DISCONNECTEXARGS
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows2000/CeDebug.Cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows2000

CeDebug.Cpp

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 //  File:   cedebug.cpp
00007 //
00008 //  Contents: Debug support
00009 //
00010 //----------------------------------------------------------------------------
00011
00012 #include <pch.cpp>
00013
00014 #pragma hdrstop
00015
00016 #include <stdio.h>
00017 #include <stdarg.h>
00018
00019
00020 //+-------------------------------------------------------------------------
00021 //
00022 //  Function:  ceDbgPrintf
00023 //
00024 //  Synopsis:  outputs debug info to stdout and debugger
00025 //
00026 //  Returns:   number of chars output
00027 //
00028 //--------------------------------------------------------------------------
00029
00030 int WINAPIV
00031 ceDbgPrintf(
00032     IN BOOL fDebug,
00033     IN LPCSTR lpFmt,
00034     ...)
00035 {
00036     va_list arglist;
00037     CHAR ach[4096];
00038     int cch = 0;
00039     HANDLE hStdOut;
00040     DWORD dwErr;
00041
00042     dwErr = GetLastError();
00043     if (fDebug)
00044     {
00045   _try
00046   {
00047       va_start(arglist, lpFmt);
00048       cch = _vsnprintf(ach, sizeof(ach), lpFmt, arglist);
00049       va_end(arglist);
00050
00051       if (0 > cch)
00052       {
00053     strcpy(&ach[sizeof(ach) - 5], "...\n");
00054       }
00055
00056       if (!IsDebuggerPresent())
00057       {
00058     hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
00059     if (hStdOut != INVALID_HANDLE_VALUE)
00060     {
00061         fputs(ach, stdout);
00062         fflush(stdout);
00063     }
00064       }
00065       OutputDebugStringA(ach);
00066   }
00067   _except(EXCEPTION_EXECUTE_HANDLER)
00068   {
00069       // return failure
00070       cch = 0;
00071   }
00072     }
00073     SetLastError(dwErr);
00074     return(cch);
00075 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COleDocument Member List

This is the complete list of members for COleDocument, including all inherited members.
CDataObject class | COleDocument | [friend]
COleDocument() | COleDocument |
COleDocumentView class | COleDocument | [friend]
COleInPlaceActiveObject class | COleDocument | [friend]
COleInPlaceObject class | COleDocument | [friend]
COleObject class | COleDocument | [friend]
ColorHookProc(HWND, UINT, WPARAM, LPARAM) | COleDocument | [friend]
CPersistStorage class | COleDocument | [friend]
CreateFile(HWND) | COleDocument |
CreateFile(LPTSTR) | COleDocument |
CreateView(IOleInPlaceSite *, IStream *, DWORD, IOleDocumentView **) | COleDocument |
DeactivateInPlace() | COleDocument | [private]
DeactivateUI() | COleDocument | [private]
EnumViews(IEnumOleDocumentViews **, IOleDocumentView **) | COleDocument |
GetDocMiscStatus(DWORD *) | COleDocument |
GetWindow(HWND *) | COleDocument | [private]
m_Color | COleDocument | [private]
m_dwRegister | COleDocument | [private]
m_fCreated | COleDocument | [private]
m_fDirty | COleDocument | [private]
m_fNoScribbleMode | COleDocument | [private]
m_ObjRefCount | COleDocument | [private]
m_pDataObject | COleDocument | [private]
m_pOleAdviseHolder | COleDocument | [private]
m_pOleClientSite | COleDocument | [private]
m_pOleDocView | COleDocument | [private]
m_pOleInPlaceActiveObject | COleDocument | [private]
m_pOleInPlaceObject | COleDocument | [private]
m_pOleObject | COleDocument | [private]
m_pPersistFile | COleDocument | [private]
m_pPersistStorage | COleDocument | [private]
QueryInterface(REFIID, LPVOID *) | COleDocument |
RegisterServer(void) | COleDocument |
STDMETHODIMP_(DWORD) AddRef() | COleDocument |
STDMETHODIMP_(DWORD) Release() | COleDocument |
~COleDocument() | COleDocument |
Generated on Wed Nov 13 2024 16:56:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/quiktest/quiktest.c Source File

  • Dataaccess
  • odbc
  • quiktest

quiktest.c

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------------------
00002 //
00003 // PROGRAM: quiktest.c
00004 //        This code is furnished on an as-is basis as part of the ODBC SDK and is
00005 //        intended for example purposes only.
00006 //
00007 //  PURPOSE: This is a Quick Test of the basic functionality of an ODBC driver.
00008 //
00009 //  FUNCTIONS:
00010 //           QuickTest() - performs the quick test focusing on basic functionalities.
00011 //
00012 //--------------------------------------------------------------------------------------------
00013 #pragma warning (disable : 4703)
00014
00015 #define QUIKTEST
00016
00017
00018 #include "autotest.h"
00019 #include <stdio.h>
00020 #include <string.h>
00021 #include <malloc.h>
00022 #include <wchar.h>
00023 #include <tchar.h>
00024 #include <time.h>
00025 #include <math.h>
00026 // #include <crtdbg.h>
00027 #include "sql.h"
00028 #include "sqlext.h"
00029 #include "quiktest.h"
00030
00031
00032 //--------------------------------------------------------------------------------------
00033 //        static
00034 //--------------------------------------------------------------------------------------
00035 static TCHAR  vszFile[]                         = TEXT(__FILE__);
00036
00037 static LPTSTR sz07009                                   = TEXT("07009");
00038 static LPTSTR szIM001                                   = TEXT("IM001");
00039 static LPTSTR szHYC00                                   = TEXT("HYC00");
00040 static LPTSTR szHY009                                   = TEXT("HY009");
00041 static LPTSTR szHY091                                   = TEXT("HY091");
00042 static LPTSTR szHY092                                   = TEXT("HY092");
00043 static LPTSTR szISO                                             = TEXT("ISO 9075");
00044 static LPTSTR szODBC30                                  = TEXT("ODBC 3.0");
00045 static LPTSTR szNotSupported                    = TEXT("did not return Not supported message");
00046 static LPTSTR szBrowseNotSupported                    = TEXT("Browse Connect is not supported with Connection Pooling on");
00047 static LPTSTR szSQLSETCONNECTATTR       = TEXT("SQLSetConnectAttr");
00048 static LPTSTR szSQLGETCONNECTATTR       = TEXT("SQLGetConnecTAttr");
00049 static LPTSTR szSQLGETINFO                              = TEXT("SQLGetInfo");
00050 static LPTSTR szSQLGETTYPEINFO          = TEXT("SQLGetTypeInfo");
00051 static LPTSTR szSQLALLOCHANDLE          = TEXT("SQLAllocHandle");
00052 static LPTSTR szSQLALLOCSTMT                    = TEXT("SQLAllocStmt");
00053 static LPTSTR szSQLALLOCCONNECT         = TEXT("SQLAllocConnect");
00054 static LPTSTR szSQLALLOCENV                     = TEXT("SQLAllocEnv");
00055 static LPTSTR szSQLSETSTMTATTR          = TEXT("SQLSetStmtAttr");
00056 static LPTSTR szSQLGETSTMTATTR          = TEXT("SQLGetStmtAttr");
00057 static LPTSTR szSQLSETSTMTOPTION                = TEXT("SQLSetStmtOption");
00058 static LPTSTR szSQLGETSTMTOPTION                = TEXT("SQLGetStmtOption");
00059 static LPTSTR szSQLSETCONNECTOPTION     = TEXT("SQLSetConnectOption");
00060 static LPTSTR szSQLGETCONNECTOPTION     = TEXT("SQLGetConnectOption");
00061 static LPTSTR szSQLFETCH                                = TEXT("SQLFetch");
00062 static LPTSTR szSQLBINDCOL                              = TEXT("SQLBindCol");
00063 static LPTSTR szSQLFOREIGNKEYS          = TEXT("SQLForeignkeys");
00064 static LPTSTR szSQLFREEHANDLE                   = TEXT("SQLFreeHandle");
00065 static LPTSTR szSQLFREECONNECT          = TEXT("SQLFreeConnect");
00066 static LPTSTR szSQLFREEENV                              = TEXT("SQLFreeEnv");
00067 static LPTSTR szSQLGETDESCREC                   = TEXT("SQLGetDescRec");
00068 static LPTSTR szSQLSETDESCREC                   = TEXT("SQLSetDescRec");
00069 static LPTSTR szSQLGETDESCFIELD         = TEXT("SQLGetDescField");
00070 static LPTSTR szSQLSETDESCFIELD         = TEXT("SQLSetDescField");
00071 static LPTSTR szSQLCOPYDESC                     = TEXT("SQLCopyDesc");
00072 static LPTSTR szSQLSETENVATTR                   = TEXT("SQLSetEnvAttr");
00073 static LPTSTR szSQLGETENVATTR                   = TEXT("SQLGetEnvAttr");
00074 static LPTSTR szSQLFREESTMT                     = TEXT("SQLFreeStmt");
00075 static LPTSTR szSQLENDTRAN                              = TEXT("SQLEndTran");
00076 static LPTSTR szSQLGETCURSORNAME                = TEXT("SQLGetCursorName");
00077 static LPTSTR szSQLEXECDIRECT                   = TEXT("SQLExecDirect");
00078 static LPTSTR szSQLPUTDATA                              = TEXT("SQLPutData");
00079 static LPTSTR szSQLPARAMDATA                    = TEXT("SQLParamData");
00080 static LPTSTR szSQLROWCOUNT                     = TEXT("SQLRowCount");
00081 static LPTSTR szSQLSETPARAM                     = TEXT("SQLSetParam");
00082 static LPTSTR szSQLBINDPARAMETER                = TEXT("SQLBindParameter");
00083 static LPTSTR szSQLBINDPARAM                    = TEXT("SQLBindParam");
00084 static LPTSTR szSQLPREPARE                              = TEXT("SQLPrepare");
00085 static LPTSTR szSQLEXECUTE                              = TEXT("SQLExecute");
00086 static LPTSTR szSQLCOLATTRIBUTES                = TEXT("SQLColAttributes");
00087 static LPTSTR szSQLGETDATA                              = TEXT("SQLGetData");
00088 static LPTSTR szSQLCOLUMNS                              = TEXT("SQLColumns");
00089 static LPTSTR szSQLGETFUNCTIONS         = TEXT("SQLGetFunctions");
00090 static LPTSTR szSQLDRIVERCONNECT                = TEXT("SQLDriverConnect");
00091 static LPTSTR szSQLDISCONNECT                   = TEXT("SQLDisconnect");
00092 static LPTSTR szSQLCONNECT                              = TEXT("SQLConnect");
00093 static LPTSTR szSQLCANCEL                               = TEXT("SQLCancel");
00094 static LPTSTR szSQLDESCRIBECOL          = TEXT("SQLDescribeCol");
00095 static LPTSTR szSQLTABLES                               = TEXT("SQLTables");
00096 static LPTSTR szSQLSPECIALCOLUMNS       = TEXT("SQLSpecialColumns");
00097 static LPTSTR szSQLDESCRIBEPARAM                = TEXT("SQLDescribeParam");
00098 static LPTSTR szSQLNUMPARAMS                    = TEXT("SQLNumParams");
00099 static LPTSTR szSQLPARAMOPTIONS         = TEXT("SQLParamOptions");
00100 static LPTSTR szSQLPRIMARYKEYS          = TEXT("SQLPrimaryKeys");
00101 static LPTSTR szSQLEXTENDEDFETCH                = TEXT("SQLExtendedFetch");
00102 static LPTSTR szSELECTSTAR                              = TEXT("select * from %s");
00103 static LPTSTR szQUICKREBIND                     = TEXT("Quick Rebind");
00104 static LPTSTR szSQLBROWSECONNECT                = TEXT("SQLBrowseConnect");
00105 static LPTSTR szBLANKLINE                               = TEXT(" ");
00106 static LPTSTR szTAB                                             = TEXT("\t");
00107 static LPTSTR szSQLNUMRESULTCOLS                = TEXT("SQLNumResultCols");
00108 static LPTSTR szSQLSETSCROLLOPTIONS     = TEXT("SQLSetScrollOptions");
00109 static LPTSTR szSQLFETCHSCROLL          = TEXT("SQLFetchScroll");
00110 static LPTSTR szSQLSTATISTICS                   = TEXT("SQLStatistics");
00111 static LPTSTR szSQLCLOSECURSOR          = TEXT("SQLCloseCursor");
00112 static LPTSTR szSQLGETDIAGREC                   = TEXT("SQLGetDiagRec");
00113 static LPTSTR szSQLGETDIAGFIELD         = TEXT("SQLGetDiagField");
00114 static LPTSTR szRETDATA                                 = TEXT("returned data");
00115 static LPTSTR szINCORRECTOUTLEN         = TEXT("incorrect outlen");
00116 static LPTSTR szSQLNATIVESQL                    = TEXT("SQLNativeSql");
00117 static LPTSTR szSQLNATIVESQLW                   = TEXT("SQLNativeSqlW");
00118 static LPTSTR szSQLCONNECTW                     = TEXT("SQLConnectW");
00119 static LPTSTR szSQLTABLESA                              = TEXT("SQLTablesA");
00120 static LPTSTR szSQLTABLESW                              = TEXT("SQLTablesW");
00121 static LPTSTR szSQLCOLUMNSA                     = TEXT("SQLColumnsA");
00122 static LPTSTR szSQLCOLUMNSW                     = TEXT("SQLColumnsW");
00123 static LPTSTR szSQLEXECDIRECTA          = TEXT("SQLExecDirectA");
00124 static LPTSTR szSQLEXECDIRECTW          = TEXT("SQLExecDirectW");
00125
00126 LPTSTR iTestNames[]={
00127   TEXT("Test Connection Options"),
00128   TEXT("Test Statement Options"),
00129   TEXT("Test SQLGetCursorName"),
00130   TEXT("Test Data"),
00131   TEXT("Test SQLNumResultCols"),
00132   TEXT("Test Meta-Data"),
00133   TEXT("Test Searched Query"),
00134   TEXT("Test Large Query"),
00135   TEXT("Test SQLTables"),
00136   TEXT("Test SQLStatistics"),
00137   TEXT("Test SQLSpecialColumns"),
00138   TEXT("Test 'Like' Query"),
00139   TEXT("Test SQLForeignKeys"),
00140   TEXT("Test SQLBrowseConnect"),
00141   TEXT("Test SQLDataSources"),
00142   TEXT("Test SQLDrivers"),
00143   TEXT("Test SQLMoreResults"),
00144   TEXT("Test SQLNativeSQL"),
00145   TEXT("Test SQLDescribeParam"),
00146   TEXT("Test SQLNumParams"),
00147   TEXT("Test SQLParamOptions"),
00148   TEXT("Test SQLPrimaryKeys"),
00149   TEXT("Test SQLProcedures"),
00150   TEXT("Test SQLTablePrivileges"),
00151   TEXT("Test SQLColumnPrivileges"),
00152   TEXT("Test SQLSetScrollOptions"),
00153   TEXT("Test SQLExtendedFetch"),
00154   TEXT("Test SQL_OJ_CAPABILITIES"),
00155   TEXT("Test SQLSetConnectAttr"),
00156   TEXT("Test SQLSetStmtAttr"),
00157   TEXT("Test Threading"),
00158   TEXT("Test GetDescField"),
00159   TEXT("Test SetDescField"),
00160   TEXT("Test GetDescRec"),
00161   TEXT("Test SetDescRec"),
00162   TEXT("Test CopyDesc"),
00163   TEXT("Test Descriptor Defaults"),
00164   TEXT("Test Usage of Descriptor"),
00165   TEXT("Test Environment Attributes"),
00166   TEXT("Test SQLEndTran"),
00167   TEXT("Test SQLBindParam"),
00168   TEXT("Test Quick Rebind"),
00169   TEXT("Test SQLFetchScroll"),
00170   TEXT("Test GetDiagRec"),
00171   TEXT("Test GetDiagField"),
00172   TEXT("Test MixedAnsiUnicode")
00173 };
00174
00175
00176 typedef struct tagHANDLES
00177 {
00178   SWORD                   fHandleType;
00179   SQLHANDLE       hHandle;
00180
00181 } HANDLES, *lpHANDLES;
00182
00183 SUPPORTOPTINFO OptionList[] = {SQL_SO_FORWARD_ONLY, SQL_SCROLL_FORWARD_ONLY,
00184                   SQL_SO_KEYSET_DRIVEN, SQL_SCROLL_KEYSET_DRIVEN,
00185                   SQL_SO_DYNAMIC, SQL_SCROLL_DYNAMIC};
00186
00187 SUPPORTCONCURINFO ConcurList[] = {SQL_SCCO_READ_ONLY, SQL_CONCUR_READ_ONLY,
00188                   SQL_SCCO_LOCK, SQL_CONCUR_LOCK,
00189                   SQL_SCCO_OPT_TIMESTAMP, SQL_CONCUR_TIMESTAMP,
00190                   SQL_SCCO_OPT_VALUES, SQL_CONCUR_VALUES};
00191
00192
00193 /*--------------------------------------------------------------------------------------*/
00194 /*       globals                                                                                                                                                                                                                 */
00195 /*--------------------------------------------------------------------------------------*/
00196 lpSERVERINFO    lpSI= NULL;
00197 UWORD                           fBindParameter=FALSE,
00198           fDiagRecSupported=FALSE,
00199           fDiagFieldSupported=FALSE,
00200           uDriverODBCVer=0;
00201 UWORD                           guwRowCount=0;  // Count of rows in the automaketable
00202
00203 /* these are globals so that the error functions can access them without
00204     needing to have them passed to every error check */
00205 static HENV            henv=SQL_NULL_HENV;
00206 static HDBC            hdbc=SQL_NULL_HDBC;
00207 static HSTMT           hstmt=SQL_NULL_HSTMT;
00208 static SQLHDESC        hdesc=SQL_NULL_HDESC;
00209
00210
00211
00212 //globals for test descriptors
00213 TIMESTAMP_STRUCT tsval= {1955, 12, 31, 23, 59, 59, 999};
00214 SQLINTEGER cbtsval=sizeof(TIMESTAMP_STRUCT);
00215 SQLINTEGER cbValueMax, cbValue, swBindOffset=128;
00216 SQLUINTEGER RowsProcessed;
00217 SQLSMALLINT DescBuf[MAX_DESC_BUF];
00218 SQLUSMALLINT StatusArray[STATUS_ARRAY_SIZE];
00219 SQLTCHAR buf[MAX_STRING_SIZE];
00220 SQLTCHAR szParamName[MAX_STRING_SIZE]=TEXT("Parameter Name");
00221
00222 struct tagDescType {
00223   SQLUSMALLINT    uwDescType;
00224   SQLUSMALLINT    uwTypeMask;
00225   TCHAR szDescName[4];
00226 } DescTypes[] = {
00227   SQL_ATTR_APP_ROW_DESC,          DESC_ARD,       TEXT("ARD"),
00228   SQL_ATTR_APP_PARAM_DESC,        DESC_APD,       TEXT("APD"),
00229   SQL_ATTR_IMP_ROW_DESC,          DESC_IRD,       TEXT("IRD"),
00230   SQL_ATTR_IMP_PARAM_DESC,        DESC_IPD,       TEXT("IPD")
00231 };
00232
00233 struct tagDescInfo {
00234   SQLSMALLINT uwDescField;
00235   LPTSTR szDescFieldName;
00236   BOOL fHeader;
00237   SQLSMALLINT fGettable;  // Can be retrieved for given descriptor types
00238   SQLSMALLINT fSettable;  // Can be set for given descriptor types
00239   SQLSMALLINT fDefault;   // Has a default value for the descriptor types
00240   SQLINTEGER NewValue;
00241   SQLINTEGER DefaultVal;
00242   SQLSMALLINT cbValue;
00243   SQLINTEGER size;
00244 } rgDescInfo[] =        {
00245   // Test expects all header fields to be listed first.  The TYPE field must be the first record field listed.
00246   // size should be set to 0 for string fields, since we don't know up front what to set it to
00247   // Field ID                                                             Field Name                                                                                      Header  Gettable                        Settable                fDefault                New Value                                                       Default Value                   Data Size                                       Data Type
00248
00249   //Header fields
00250   SQL_DESC_COUNT,                                         TEXT("SQL_DESC_COUNT"),                                         TRUE,   DESC_ALL,               DESC_MOST,      DESC_MOST,      1,                                                              0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00251   SQL_DESC_ALLOC_TYPE,                            TEXT("SQL_DESC_ALLOC_TYPE"),                            TRUE,   DESC_ALL,               DESC_NONE,      DESC_ALL,       0,                                                              SQL_DESC_ALLOC_AUTO,    sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00252   SQL_DESC_ARRAY_SIZE,                            TEXT("SQL_DESC_ARRAY_SIZE"),                            TRUE,   DESC_AD,                DESC_AD,        DESC_AD,        STATUS_ARRAY_SIZE,                              1,                                              sizeof(SQLUINTEGER),    SQL_IS_UINTEGER,
00253   SQL_DESC_ARRAY_STATUS_PTR,                      TEXT("SQL_DESC_ARRAY_STATUS_PTR"),                      TRUE,   DESC_ALL,               DESC_ALL,       DESC_ALL,       (SQLINTEGER)(StatusArray),              (SQLINTEGER)NULL,               sizeof(SQLPOINTER),             SQL_IS_POINTER,
00254   SQL_DESC_BIND_OFFSET_PTR,                       TEXT("SQL_DESC_BIND_OFFSET_PTR"),                       TRUE,   DESC_AD,                DESC_AD,        DESC_AD,        (SQLINTEGER)(&swBindOffset),    (SQLINTEGER)NULL,               sizeof(SQLPOINTER),             SQL_IS_POINTER,
00255   SQL_DESC_BIND_TYPE,                                     TEXT("SQL_DESC_BIND_TYPE"),                                     TRUE,   DESC_AD,                DESC_AD,        DESC_AD,        BIND_SIZE,                                              0,                                              sizeof(SQLINTEGER),             SQL_IS_INTEGER,
00256 //      SQL_DESC_OUT_OF_LINE_HEAP,                      TEXT("SQL_DESC_OUT_OF_LINE_HEAP"),                      TRUE,   DESC_AD,                DESC_AD,                                (SQLINTEGER)(StatusArray),      sizeof(SQLINTEGER),     SQL_IS_POINTER,
00257 //      SQL_DESC_OUT_OF_LINE_HEAP_OCTET_LENGTH, TEXT("SQL_DESC_OUT_OF_LINE_HEAP_OCTET_LENGTH"), TRUE, DESC_AD,  DESC_AD,                                                                                                                                sizeof(StatusArray),                                    sizeof(SQLINTEGER),     SQL_IS_NOT_POINTER,
00258   SQL_DESC_ROWS_PROCESSED_PTR,            TEXT("SQL_DESC_ROWS_PROCESSED_PTR"),            TRUE,   DESC_ID,                DESC_ID,        DESC_ID,        (SQLINTEGER)(&RowsProcessed),   (SQLINTEGER)NULL,               sizeof(SQLPOINTER),             SQL_IS_POINTER,
00259
00260   // Record fields
00261
00262   SQL_DESC_DATETIME_INTERVAL_CODE,        TEXT("SQL_DESC_DATETIME_INTERVAL_CODE"),        FALSE,  DESC_ALL,               DESC_MOST,      DESC_NONE,      SQL_CODE_TIMESTAMP,                             0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00263   SQL_DESC_TYPE,                                          TEXT("SQL_DESC_TYPE"),                                          FALSE,  DESC_ALL,               DESC_MOST,      DESC_AD,        SQL_DATETIME,                                   SQL_C_DEFAULT,                  sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00264   SQL_DESC_CONCISE_TYPE,                          TEXT("SQL_DESC_CONCISE_TYPE"),                          FALSE,  DESC_ALL,               DESC_MOST,      DESC_AD,        SQL_TYPE_TIMESTAMP,                             SQL_C_DEFAULT,                  sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00265   SQL_DESC_AUTO_UNIQUE_VALUE,                     TEXT("SQL_DESC_AUTO_UNIQUE_VALUE"),                     FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLINTEGER),             SQL_IS_INTEGER,
00266 //      SQL_DESC_BIND_OUT_OF_LINE,                      TEXT("SQL_DESC_BIND_OUT_OF_LINE"),                      FALSE,  DESC_AD,                DESC_AD,                                SQL_TRUE,                                                                                               sizeof(SQLSMALLINT),    SQL_IS_NOT_POINTER,
00267   SQL_DESC_BASE_COLUMN_NAME,                      TEXT("SQL_DESC_BASE_COLUMN_NAME"),                      FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00268   SQL_DESC_CASE_SENSITIVE,                        TEXT("SQL_DESC_CASE_SENSITIVE"),                        FALSE,  DESC_ID,                DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLINTEGER),             SQL_IS_INTEGER,
00269   SQL_DESC_CATALOG_NAME,                          TEXT("SQL_DESC_CATALOG_NAME"),                          FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00270   SQL_DESC_DATETIME_INTERVAL_PRECISION, TEXT("SQL_DESC_DATETIME_INTERVAL_PRECISION"),     FALSE, DESC_ALL,DESC_MOST,      DESC_NONE,      3,                                                                      0,                                              sizeof(SQLINTEGER),             SQL_IS_INTEGER,
00271   SQL_DESC_DISPLAY_SIZE,                          TEXT("SQL_DESC_DISPLAY_SIZE"),                          FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLINTEGER),             SQL_IS_INTEGER,
00272   SQL_DESC_FIXED_PREC_SCALE,                      TEXT("SQL_DESC_FIXED_PREC_SCALE"),                      FALSE,  DESC_ID,                DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00273   SQL_DESC_LABEL,                                         TEXT("SQL_DESC_LABEL"),                                         FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00274   SQL_DESC_LENGTH,                                        TEXT("SQL_DESC_LENGTH"),                                        FALSE,  DESC_ALL,               DESC_MOST,      DESC_NONE,      23,                                                             0,                                              sizeof(SQLUINTEGER),    SQL_IS_UINTEGER,
00275   SQL_DESC_LITERAL_PREFIX,                        TEXT("SQL_DESC_LITERAL_PREFIX"),                        FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00276   SQL_DESC_LITERAL_SUFFIX,                        TEXT("SQL_DESC_LITERAL_SUFFIX"),                        FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00277   SQL_DESC_LOCAL_TYPE_NAME,                       TEXT("SQL_DESC_LOCAL_TYPE_NAME"),                       FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00278   SQL_DESC_NAME,                                          TEXT("SQL_DESC_NAME"),                                          FALSE,  DESC_ID,                DESC_IPD,       DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00279   SQL_DESC_NULLABLE,                                      TEXT("SQL_DESC_NULLABLE"),                                      FALSE,  DESC_ID,                DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00280   SQL_DESC_OCTET_LENGTH,                          TEXT("SQL_DESC_OCTET_LENGTH"),                          FALSE,  DESC_ALL,               DESC_MOST,      DESC_NONE,      sizeof(tsval),                                  0,                                              sizeof(SQLINTEGER),             SQL_IS_INTEGER,
00281   SQL_DESC_OCTET_LENGTH_PTR,                      TEXT("SQL_DESC_OCTET_LENGTH_PTR"),                      FALSE,  DESC_AD,                DESC_AD,        DESC_AD,        (SQLINTEGER)(&cbtsval),                 (SQLINTEGER)NULL,               sizeof(SQLINTEGER),             SQL_IS_POINTER,
00282   SQL_DESC_PARAMETER_TYPE,                        TEXT("SQL_DESC_PARAMETER_TYPE"),                        FALSE,  DESC_IPD,               DESC_IPD,       DESC_IPD,       SQL_PARAM_OUTPUT,                               SQL_PARAM_INPUT,                sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00283   SQL_DESC_PRECISION,                                     TEXT("SQL_DESC_PRECISION"),                                     FALSE,  DESC_ALL,               DESC_MOST,      DESC_NONE,      23,                                                             0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00284   SQL_DESC_SCALE,                                         TEXT("SQL_DESC_SCALE"),                                         FALSE,  DESC_ALL,               DESC_MOST,      DESC_NONE,      3,                                                              0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00285   SQL_DESC_SCHEMA_NAME,                           TEXT("SQL_DESC_SCHEMA_NAME"),                           FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00286   SQL_DESC_SEARCHABLE,                            TEXT("SQL_DESC_SEARCHABLE"),                            FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00287   SQL_DESC_TABLE_NAME,                            TEXT("SQL_DESC_TABLE_NAME"),                            FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00288   SQL_DESC_TYPE_NAME,                                     TEXT("SQL_DESC_TYPE_NAME"),                                     FALSE,  DESC_ID,                DESC_NONE,      DESC_NONE,      (SQLINTEGER)szParamName,                0,                                              sizeof(SQLCHAR),                0,
00289   SQL_DESC_UNSIGNED,                                      TEXT("SQL_DESC_UNSIGNED"),                                      FALSE,  DESC_ID,                DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00290   SQL_DESC_UPDATABLE,                                     TEXT("SQL_DESC_UPDATABLE"),                                     FALSE,  DESC_IRD,               DESC_NONE,      DESC_NONE,      0,                                                              0,                                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00291   SQL_DESC_INDICATOR_PTR,                         TEXT("SQL_DESC_INDICATOR_PTR"),                         FALSE,  DESC_AD,                DESC_AD,        DESC_AD,        SQL_NULL_DATA,                                  (SQLINTEGER)NULL,               sizeof(SQLPOINTER),             SQL_IS_POINTER,
00292   SQL_DESC_UNNAMED,                                       TEXT("SQL_DESC_UNNAMED"),                                       FALSE,  DESC_ID,                DESC_IPD,       DESC_NONE,      SQL_UNNAMED,                                    SQL_NAMED,                              sizeof(SQLSMALLINT),    SQL_IS_SMALLINT,
00293   SQL_DESC_DATA_PTR,                                      TEXT("SQL_DESC_DATA_PTR"),                                      FALSE,  DESC_AD,                DESC_MOST,      DESC_AD,        (SQLINTEGER)&tsval,                             (SQLINTEGER)NULL,               sizeof(SQLPOINTER),             SQL_IS_POINTER
00294  };
00295
00296 struct tagDIAGINFO {
00297   SQLSMALLINT uwDescField;
00298   LPTSTR szDescFieldName;
00299   SWORD irecRecNumber;
00300 } rgDiagInfo[] =        {
00301 //      SQL_DIAG_CURSOR_ROW_COUNT,                      TEXT("SQL_DIAG_CURSOR_ROW_COUNT"),                      0,
00302 //      SQL_DIAG_DYNAMIC_FUNCTION,                      TEXT("SQL_DIAG_DYNAMIC_FUNCTION"),                      0,
00303 //      SQL_DIAG_DYNAMIC_FUNCTION_CODE, TEXT("SQL_DIAG_DYNAMIC_FUNCTION_CODE"), 0,
00304   SQL_DIAG_NUMBER,                                                TEXT("SQL_DIAG_NUMBER"),                                                0,
00305   SQL_DIAG_RETURNCODE,                                    TEXT("SQL_DIAG_RETURNCODE"),                                    0,
00306 //      SQL_DIAG_ROW_NUMBER,                                    TEXT("SQL_DIAG_ROW_NUMBER"),                                    0,
00307 //      SQL_DIAG_COLUMN_NUMBER,                         TEXT("SQL_DIAG_COLUMN_NUMBER"),                         1,
00308 //      SQL_DIAG_ROW_COUNT,                                     TEXT("SQL_DIAG_ROW_COUNT"),                                     0,
00309   SQL_DIAG_SQLSTATE,                                      TEXT("SQL_DIAG_SQLSTATE"),                                              1,
00310   SQL_DIAG_NATIVE,                                                TEXT("SQL_DIAG_NATIVE"),                                                1,
00311   SQL_DIAG_MESSAGE_TEXT,                          TEXT("SQL_DIAG_MESSAGE_TEXT"),                          1,
00312   SQL_DIAG_CLASS_ORIGIN,                          TEXT("SQL_DIAG_CLASS_ORIGIN"),                          1,
00313   SQL_DIAG_SUBCLASS_ORIGIN,                       TEXT("SQL_DIAG_SUBCLASS_ORIGIN"),                       1,
00314 //      SQL_DIAG_CONNECTION_NAME,                       TEXT("SQL_DIAG_CONNECTION_NAME"),                       1,
00315   SQL_DIAG_SERVER_NAME,                           TEXT("SQL_DIAG_SERVER_NAME"),                                   1,
00316 };
00317
00318 BOOL    g_f3XDriver=FALSE;
00319
00320 //the insert statement buffer   to hold the insert statement
00321 TCHAR szInsertStmt[MAX_STRING_SIZE];
00322
00323 //-----------------------------------------------------------------------
00324 //      Function:               Supported
00325 //-----------------------------------------------------------------------
00326
00327 _inline UWORD  PASCAL Supported(UWORD uwSQLFunc)
00328 {
00329   UWORD           fLevel2=FALSE;
00330   RETCODE rc=SQL_SUCCESS;
00331
00332   rc = SQLGetFunctions(hdbc, uwSQLFunc,&fLevel2);
00333   RETCHECK(SQL_SUCCESS, rc,szSQLGETFUNCTIONS);
00334
00335   return(fLevel2);
00336
00337 } //Supported()
00338
00339
00340 /*------------------------------------------------------------------------------
00341  *      Function:       CheckDataResults - To check data returned by Fetch calls
00342  *      Checks data at (row, col) in result set against (row, col) in table
00343  * ----------------------------------------------------------------------------*/
00344 BOOL CheckDataResults(SWORD row, SWORD iTableCol, FIELDINFO*  pField, DSTRUCT* pDataStr,
00345                SDWORD cbValue, TCHAR* rgbValue)
00346 {
00347   if((pField ->nullable)&& (cbValue<1))
00348   {
00349     if(cbValue == SQL_NULL_DATA && pDataStr[iTableCol].cb == SQL_NULL_DATA)
00350       return TRUE;
00351     return FALSE;
00352   }
00353
00354   return CmpODBCtoCHAR(pDataStr, rgbValue, pField->wSQLType, iTableCol);
00355 }
00356
00357
00358 /*------------------------------------------------------------------------------
00359 /       Function:       BinToHex
00360 /       Purpose:        Render a buffer contents as a hexidecimal string.
00361 /*----------------------------------------------------------------------------*/
00362
00363 void PASCAL BinToHex(PTR rgbValue, SWORD cbValue, LPTSTR szHexString)
00364 {
00365   UWORD ib;
00366   LPTSTR pch;
00367   TCHAR rgchDigits[] = TEXT("0123456789ABCDEF");
00368
00369   _tcscpy(szHexString, TEXT("0x"));
00370   if(cbValue > (MAX_STRING_SIZE - 3)/2 || cbValue < 0)
00371     cbValue = (MAX_STRING_SIZE - 3)/2;
00372
00373   pch = &szHexString[_tcslen(szHexString)];
00374   for(ib=0; ib < cbValue; ib++)
00375     {
00376     *pch++ = rgchDigits[((LPBYTE)rgbValue)[ib] >> 4];
00377     *pch++ = rgchDigits[((LPBYTE)rgbValue)[ib] & 0xF];
00378     }
00379   *pch = TEXT('\0');
00380
00381 } /* BinToHex() */
00382
00383
00384
00385 /*-----------------------------------------------------------------------*/
00386 /*      Function:               SearchForError                           */
00387 /*-----------------------------------------------------------------------*/
00388
00389 _inline int PASCAL SearchForError(HENV henv, HDBC hdbc,HSTMT hstmt,LPTSTR szFindState)
00390 {
00391   TCHAR buf[MAX_STRING_SIZE];
00392   RETCODE rc;
00393   TCHAR szState[6];
00394   int found = FALSE;
00395
00396   for(rc = SQLError(henv, hdbc, hstmt, szState, NULL, buf, MAX_STRING_SIZE, NULL)
00397     ; !found && (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
00398     ; rc = SQLError(henv, NULL, NULL, szState, NULL, buf, MAX_STRING_SIZE, NULL))
00399   {
00400     found = _tcscmp(szState, szFindState) == 0;
00401   }
00402
00403   return(found);
00404
00405 } /* SearchForError() */
00406
00407
00408 /*-----------------------------------------------------------------------*/
00409 /*      Function:               szWrite                                  */
00410 /*-----------------------------------------------------------------------*/
00411
00412 _inline VOID WINAPI szWrite(LPTSTR szStr, BOOL fNewLine)
00413 {
00414   szLogPrintf(lpSI, FALSE, szStr);
00415   if(fNewLine)
00416     szLogPrintf(lpSI, FALSE, TEXT("\r\n"));
00417 }
00418
00419 /*-----------------------------------------------------------------------*/
00420 /*      Function:               GetErrors                                                */
00421 /*-----------------------------------------------------------------------*/
00422
00423 VOID PASCAL GetErrors(HENV henv,HDBC hdbc,HSTMT hstmt)
00424 {
00425   TCHAR buf[MAX_ERROR_SIZE];
00426   TCHAR largebuf[COMBINED_SIZE];
00427   TCHAR szState[100];
00428   RETCODE rc=SQL_SUCCESS;
00429
00430   for(rc = SQLError(henv, hdbc, hstmt, szState, NULL, buf, MAX_ERROR_SIZE, NULL)
00431     ; RC_SUCCESSFUL(rc)
00432     ; rc = SQLError(henv, NULL, NULL, szState, NULL, buf, MAX_ERROR_SIZE, NULL))
00433   {
00434     wsprintf(largebuf,TEXT("\t\t\tState: %s"), szState);
00435     szWrite(largebuf, TRUE);
00436     wsprintf(largebuf,TEXT("\t\t\tError: %s"), buf);
00437     szWrite(largebuf, TRUE);
00438   }
00439
00440 } /* GetErrors() */
00441
00442
00443 /*-----------------------------------------------------------------------*/
00444 /*      Function:               GetDiagRecs                                      */
00445 /*-----------------------------------------------------------------------*/
00446
00447 VOID PASCAL GetDiagRecs(SWORD fHandleType,SQLHANDLE hHandle)
00448 {
00449   TCHAR           szMessageText[XLARGEBUFF]=TEXT(""),
00450         szBuff[XLARGEBUFF]=TEXT("");
00451   TCHAR           szSQLState[100]=TEXT("");
00452   RETCODE rc=SQL_SUCCESS;
00453   SWORD           irecRecNumber=0;
00454   SDWORD  fNativeError=0;
00455   SWORD           cchBufferLength=sizeof(szMessageText)/sizeof(TCHAR),
00456         cbTextLength=0;
00457   SDWORD  sdNumRecs=0;
00458
00459   if (fDiagFieldSupported)
00460   {
00461     /* Get number of diag, records */
00462     rc = SQLGetDiagField(fHandleType, hHandle,0,SQL_DIAG_NUMBER,
00463       &sdNumRecs,sizeof(sdNumRecs),NULL);
00464   }
00465
00466
00467   for(irecRecNumber=1;(irecRecNumber <= sdNumRecs) && RC_SUCCESSFUL(rc);irecRecNumber++)
00468   {
00469     rc = SQLGetDiagRec(fHandleType, hHandle, irecRecNumber,szSQLState,&fNativeError,
00470       szMessageText,cchBufferLength,&cbTextLength);
00471
00472     if (RC_SUCCESSFUL(rc))
00473     {
00474       wsprintf(szBuff,TEXT("\t\t\tState: %s"), szSQLState);
00475       szWrite(szBuff, TRUE);
00476       wsprintf(szBuff,TEXT("\t\t\tError: %s"), szMessageText);
00477       szWrite(szBuff, TRUE);
00478     }
00479
00480   }
00481
00482
00483 } /* GetErrors() */
00484
00485
00486
00487 /*-----------------------------------------------------------------------*/
00488 /*      Function:               DisplayAllErrors                         */
00489 /*-----------------------------------------------------------------------*/
00490
00491 void  PASCAL DisplayAllErrors()
00492 {
00493   if (!fDiagRecSupported)
00494   {
00495     GetErrors(henv,NULL,NULL);
00496     GetErrors(NULL,hdbc,NULL);
00497     GetErrors(NULL,NULL,hstmt);
00498   }
00499   else
00500   {
00501     GetDiagRecs(SQL_HANDLE_ENV,henv);
00502     GetDiagRecs(SQL_HANDLE_DBC,hdbc);
00503     GetDiagRecs(SQL_HANDLE_STMT,hstmt);
00504     GetDiagRecs(SQL_HANDLE_DESC,hdesc);
00505   }
00506
00507 } /* DisplayAllErrors() */
00508
00509
00510 /*-----------------------------------------------------------------------*/
00511 /*      Function:               RetcodeToTCHAR                            */
00512 /*-----------------------------------------------------------------------*/
00513
00514 LPTSTR  PASCAL RetcodeToTCHAR(RETCODE retcode, LPTSTR buf)
00515 {
00516   switch (retcode)
00517     {
00518     case SQL_SUCCESS:
00519       _tcscpy (buf,TEXT("SQL_SUCCESS"));
00520       break;
00521     case SQL_ERROR:
00522       _tcscpy (buf,TEXT("SQL_ERROR"));
00523       break;
00524     case SQL_SUCCESS_WITH_INFO:
00525       _tcscpy (buf,TEXT("SQL_SUCCESS_WITH_INFO"));
00526       break;
00527     case SQL_NO_DATA_FOUND:
00528       _tcscpy (buf,TEXT("SQL_NO_DATA_FOUND"));
00529       break;
00530     case SQL_NEED_DATA:
00531       _tcscpy (buf,TEXT("SQL_NEED_DATA"));
00532       break;
00533     case SQL_INVALID_HANDLE:
00534       _tcscpy (buf,TEXT("SQL_INVALID_HANDLE"));
00535       break;
00536     case SQL_STILL_EXECUTING:
00537       _tcscpy (buf,TEXT("SQL_STILL_EXECUTING"));
00538       break;
00539     default:
00540       _tcscpy(buf,TEXT("UNKNOWN rc"));
00541     }
00542
00543   return buf;
00544 }
00545
00546
00547
00548 //-----------------------------------------------------------------------
00549 //      Function:               ReturnCheck
00550 //-----------------------------------------------------------------------
00551
00552 int  PASCAL ReturnCheck(RETCODE retExpected, RETCODE retReceived, LPTSTR szFunction,
00553                 LPTSTR szFile, int iLine,BOOL fDiag)
00554 {
00555   TCHAR buf[MAX_STRING_SIZE];
00556
00557   if(retExpected == retReceived)
00558     return TRUE;
00559
00560   szWrite(TEXT(""), TRUE);
00561
00562   szWrite(TEXT("\t\t\t"), FALSE);
00563   szWrite(szFunction, TRUE);
00564
00565   szWrite(TEXT("\t\t\tExpected: "), FALSE);
00566   szWrite(RetcodeToTCHAR(retExpected, buf), TRUE);
00567
00568   szWrite(TEXT("\t\t\tReceived: "), FALSE);
00569   szWrite(RetcodeToTCHAR(retReceived, buf), TRUE);
00570
00571   if (!fDiag)
00572     DisplayAllErrors();
00573
00574   wsprintf(buf,TEXT("\t\t\t%s: %d"), szFile, iLine);
00575   szWrite(buf, TRUE);
00576
00577   szWrite(TEXT("\t\t\t --------  "), TRUE);
00578
00579   lpSI->failed++;
00580
00581   return FALSE;
00582 }
00583
00584 //-----------------------------------------------------------------------
00585 //      Function:               ErrsHandle
00586 //-----------------------------------------------------------------------
00587
00588 int  PASCAL ErrsHandle(SWORD fHandleType,SQLHANDLE hHandle, RETCODE retExpected,
00589   RETCODE retReceived, LPTSTR szFunction, LPTSTR szFile, int iLine,BOOL fDiag)
00590 {
00591   TCHAR buf[MAX_STRING_SIZE];
00592
00593   if(retExpected == retReceived)
00594     return TRUE;
00595
00596   szWrite(TEXT(""), TRUE);
00597
00598   szWrite(TEXT("\t\t\t"), FALSE);
00599   szWrite(szFunction, TRUE);
00600
00601   szWrite(TEXT("\t\t\tExpected: "), FALSE);
00602   szWrite(RetcodeToTCHAR(retExpected, buf), TRUE);
00603
00604   szWrite(TEXT("\t\t\tReceived: "), FALSE);
00605   szWrite(RetcodeToTCHAR(retReceived, buf), TRUE);
00606
00607   if (!fDiag)
00608     GetDiagRecs(fHandleType,hHandle);
00609
00610   wsprintf(buf,TEXT("\t\t\t%s: %d"), szFile, iLine);
00611   szWrite(buf, TRUE);
00612
00613   szWrite(TEXT("\t\t\t --------  "), TRUE);
00614
00615   lpSI->failed++;
00616
00617   return FALSE;
00618 }
00619
00620 /*------------------------------------------------------------------------------
00621 /       Function:       FindError
00622 /       Purpose:        Find the expected error message. Display a failure if not found.
00623 /*----------------------------------------------------------------------------*/
00624
00625 BOOL PASCAL FindError(SWORD fHandleType, LPTSTR szFindState)
00626 {
00627   SQLHANDLE handle = SQL_NULL_HANDLE;
00628   SWORD irec;
00629   TCHAR szErrorMsg[SQL_MAX_MESSAGE_LENGTH];
00630   RETCODE rc;
00631   TCHAR szState[6];
00632
00633   switch(fHandleType)
00634   {
00635     case SQL_HANDLE_ENV:
00636       handle = henv;
00637       break;
00638
00639     case SQL_HANDLE_DBC:
00640       handle = hdbc;
00641       break;
00642
00643     case SQL_HANDLE_STMT:
00644       handle = hstmt;
00645       break;
00646
00647     case SQL_HANDLE_DESC:
00648       if(!Supported(SQL_API_SQLGETDIAGREC))
00649         return TRUE;
00650
00651       handle = hdesc;
00652       break;
00653
00654     default:
00655       DISPLAYERROR(TEXT("FindError"), TEXT("invalid fHandleType"));
00656       return FALSE;
00657   }
00658
00659   for(irec = 1
00660     ; rc = SQLGetDiagRec(fHandleType, handle, irec, szState, NULL, szErrorMsg, SQL_MAX_MESSAGE_LENGTH, NULL)
00661     , RC_SUCCESSFUL(rc)
00662     ; irec++)
00663   {
00664     if(_tcscmp(szState, szFindState) == 0)
00665       return TRUE;
00666   }
00667   return FALSE;
00668
00669 } /* FindError() */
00670
00671 /*------------------------------------------------------------------------------
00672  *      Function:       CompareWithExpected
00673  *      Checks data in rgbValue against expected value given row, col, and rgFields.
00674  *      Posts an error if mismatch
00675  * ----------------------------------------------------------------------------*/
00676 void CompareWithExpected(PTR rgbValue, SDWORD * pcbValue, UWORD row, UWORD icol, FIELDINFO  *rgFields)
00677 {
00678   LPTSTR   pch=NULL;
00679   TCHAR szExpBuf[MAX_STRING_SIZE]=TEXT("");
00680   TCHAR * stopstr;
00681
00682   pch = qtMakeData(row-1, icol-1, &rgFields[icol-1], szExpBuf);
00683
00684   // Field is not READ ONLY, compare the value we inserted
00685   if(pch)
00686   {
00687     // Where row and column match and field is nullable, a NULL exists
00688     if (icol-1 == row-1 && rgFields[icol-1].nullable)
00689     {
00690       // Post an error if not SQL_NULL_DATA
00691       if (*pcbValue != SQL_NULL_DATA)
00692         DISPLAYERROR(TEXT("Simulate BindCol"),TEXT("Didn't return SQL_NULL_DATA"));
00693     }
00694     else
00695     {
00696       BOOL bCompare;
00697       TCHAR * pstr=szExpBuf;  // Pointer to start of expected string
00698
00699       switch(rgFields[icol-1].wSQLType)
00700       {
00701         case SQL_BIT:
00702         case SQL_TINYINT:
00703         case SQL_SMALLINT:
00704         case SQL_INTEGER:
00705           // Compare the data values as long // tcsncmp
00706           bCompare=(_ttol(rgbValue) == _ttol(pstr));
00707           break;
00708         case SQL_NUMERIC:
00709         case SQL_DECIMAL:
00710         case SQL_REAL:
00711           bCompare=(fabs(_tcstod(rgbValue, &stopstr) - _tcstod(pstr, &stopstr)) <= fabs((1/pow(10,7))*_tcstod(rgbValue, &stopstr)));
00712           break;
00713         case SQL_FLOAT:
00714         case SQL_DOUBLE:
00715           // Compare the data values as doubles strtod
00716           bCompare=(_tcstod(rgbValue, &stopstr) == _tcstod(pstr, &stopstr));
00717           break;
00718         case SQL_DATE:
00719         case SQL_TIME:
00720         case SQL_TIMESTAMP:
00721         case SQL_TYPE_DATE:
00722         case SQL_TYPE_TIME:
00723         case SQL_TYPE_TIMESTAMP:
00724           pstr=szExpBuf+_tcslen(TEXT("{ts '"));
00725           // Replace second ' with '\0'                                                                   '
00726           _tcstok(pstr, TEXT("'"));
00727           if (_tcslen(rgbValue) > _tcslen(TEXT("1994-10-10 10:00:00")))
00728             _tcscat(pstr, TEXT(".000"));
00729           bCompare=(!_tcsncmp(rgbValue, pstr, rgFields[icol-1].precision));
00730           break;
00731         default:
00732           bCompare=(!_tcsncmp(rgbValue, pstr, _tcslen(pstr)));
00733       }
00734
00735       // Compare the data values as char
00736       if (!bCompare)
00737       {
00738         DISPLAYERROR(TEXT("Simulate BindCol"),TEXT("Returned data didn't match"));
00739         szWrite(TEXT("\t\t\tExpected: "), FALSE);
00740         szWrite(pstr, TRUE);
00741         szWrite(TEXT("\t\t\tReceived: "), FALSE);
00742         szWrite(rgbValue, TRUE);
00743       }
00744     }
00745   }
00746 } //CompareWithExpected
00747
00748 //-----------------------------------------------------------------------
00749 //      Function:               ResetHstmt
00750 //-----------------------------------------------------------------------
00751 void ResetHstmt(SQLHSTMT * phstmt)
00752 {
00753   SQLRETURN rc;
00754
00755   // Free and reallocate stmt handle to clean up
00756   rc=SQLFreeHandle(SQL_HANDLE_STMT, *phstmt);
00757   ERRSHANDLE(SQL_HANDLE_STMT, *phstmt, SQL_SUCCESS, rc, szSQLFREESTMT);
00758   rc=SQLAllocHandle(SQL_HANDLE_STMT, hdbc, phstmt);
00759   RETCHECK(SQL_SUCCESS, rc,szSQLALLOCHANDLE);
00760   hdesc=NULL;     // Global hdesc needs to be NULL or attempt to read freed mem
00761 }
00762
00763 /*-----------------------------------------------------------------------*/
00764 /*      Function:               GetSomeData                              */
00765 /*-----------------------------------------------------------------------*/
00766
00767 VOID PASCAL GetSomeData(HSTMT lhstmt, LPTSTR szTableName,BOOL fBindCol,
00768                 FIELDINFO  rgField)
00769 {
00770   RETCODE rc=SQL_SUCCESS;
00771   SDWORD  cbValue=0;
00772   TCHAR           szQuery[XLARGEBUFF]=TEXT(""),
00773         szBuff[XLARGEBUFF]=TEXT("");
00774   TCHAR           szErrMsg[MAX_STRING_SIZE]=TEXT(""),
00775         szDataItem[XLARGEBUFF]=TEXT("");
00776   LPTSTR   pch=NULL;
00777
00778   pch = qtMakeData(0, 0,&rgField, szDataItem);
00779
00780   wsprintf(szQuery,szSELECTSTAR,szTableName);
00781   rc=SQLExecDirect(lhstmt,szQuery,SQL_NTS);
00782 //      RETCHECK(SQL_SUCCESS,rc,szSQLEXECDIRECT);
00783
00784   if (fBindCol)
00785   {
00786     rc = SQLBindCol(lhstmt, 1, SQL_C_TCHAR, szBuff, sizeof(szBuff),&cbValue);
00787 //              RETCHECK(SQL_SUCCESS, rc, szSQLBINDCOL);
00788   }
00789
00790   rc = SQLFetch(lhstmt);
00791 //      RETCHECK(SQL_SUCCESS, rc,szSQLFETCH);
00792
00793   if (!fBindCol)
00794   {
00795     rc = SQLGetData(lhstmt,1, SQL_C_TCHAR,szBuff, sizeof(szBuff), NULL);
00796 //              RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
00797   }
00798
00799   _tcscmp(szDataItem,szBuff);
00800
00801 } /* GetSomeData() */
00802
00803
00804
00805 /*-----------------------------------------------------------------------*/
00806 /*      Function:               SelectFromTable                          */
00807 /*-----------------------------------------------------------------------*/
00808
00809 _inline RETCODE PASCAL SelectFromTable(QTSTRUCT *lpqt)
00810 {
00811   RETCODE rc=SQL_SUCCESS;
00812   TCHAR           szQuery[LARGEBUFF];
00813
00814   wsprintf(szQuery,TEXT("select %s from %s"),
00815   //wsprintf(szQuery,TEXT("select %s from %s order by %s"),
00816     lpqt->szColNames, lpqt->szTableName/*, lpqt->szColNames*/);
00817
00818   rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
00819   RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
00820
00821   return(rc);
00822
00823 } /* SelectFromTable() */
00824
00825 /*-----------------------------------------------------------------------*/
00826 /*      Function:               SelectFromTableFetch                     */
00827 /*-----------------------------------------------------------------------*/
00828
00829 _inline RETCODE PASCAL SelectFromTableFetch(QTSTRUCT *lpqt, TCHAR* szColName)
00830 {
00831   RETCODE rc=SQL_SUCCESS;
00832   TCHAR           szQuery[LARGEBUFF];
00833
00834   wsprintf(szQuery,TEXT("select %s from %s order by %s"),
00835     lpqt->szColNames, lpqt->szTableName, szColName);
00836
00837   rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
00838   if((SQL_SUCCESS!=rc) && (SQL_SUCCESS_WITH_INFO!=rc)){
00839     RETCHECK(SQL_SUCCESS_WITH_INFO, rc,szSQLEXECDIRECT);
00840     return SQL_NO_DATA;
00841   }
00842
00843   return SQL_SUCCESS;
00844 } /* SelectFromTableFetch() */
00845
00846 //-----------------------------------------------------------------------
00847 //      Function:               AllocHstmt
00848 //-----------------------------------------------------------------------
00849
00850 _inline BOOL PASCAL AllocHstmt()
00851 {
00852   BOOL            fFailed=FALSE;
00853   RETCODE rc=SQL_SUCCESS;
00854
00855   if (Supported(SQL_API_SQLALLOCHANDLE))
00856   {
00857     rc = SQLAllocHandle(SQL_HANDLE_STMT,hdbc, &hstmt);
00858     if(!RETCHECK(SQL_SUCCESS, rc, szSQLALLOCHANDLE))
00859       fFailed=TRUE;
00860   }
00861   else
00862   {
00863     rc = SQLAllocStmt(hdbc, &hstmt);
00864     if(!RETCHECK(SQL_SUCCESS, rc, szSQLALLOCSTMT))
00865       fFailed=TRUE;
00866   }
00867
00868
00869   return(fFailed);
00870
00871 } //AllocHstmt()
00872
00873
00874
00875 //-----------------------------------------------------------------------
00876 //      Function:               AllocHdbc
00877 //-----------------------------------------------------------------------
00878
00879 _inline BOOL PASCAL AllocHdbc(HDBC *phdbc)
00880 {
00881   BOOL            fFailed=FALSE;
00882   RETCODE rc=SQL_SUCCESS;
00883
00884   if (Supported(SQL_API_SQLALLOCHANDLE))
00885   {
00886     rc = SQLAllocHandle(SQL_HANDLE_DBC,henv, phdbc);
00887     if(!RETCHECK(SQL_SUCCESS, rc, szSQLALLOCHANDLE))
00888       fFailed=TRUE;
00889   }
00890   else
00891   {
00892     rc = SQLAllocConnect(henv, phdbc);
00893     if(!RETCHECK(SQL_SUCCESS, rc, szSQLALLOCCONNECT))
00894       fFailed=TRUE;
00895   }
00896
00897
00898   return(fFailed);
00899
00900 } //AllocHdbc()
00901
00902
00903 //-----------------------------------------------------------------------
00904 //      Function:                                       AllocHenv
00905 //-----------------------------------------------------------------------
00906
00907 _inline BOOL PASCAL PASCAL AllocHenv()
00908 {
00909   BOOL            fFailed=FALSE;
00910   RETCODE rc=SQL_SUCCESS;
00911
00912   rc = SQLAllocEnv(&henv);
00913   if (!RETCHECK(SQL_SUCCESS, rc,szSQLALLOCENV))
00914     fFailed=TRUE;
00915
00916   return(fFailed);
00917
00918 } //AllocHenv()
00919
00920 //-----------------------------------------------------------------------
00921 //      Function:               SetStatementAttributes
00922 //-----------------------------------------------------------------------
00923
00924 _inline BOOL PASCAL SetStatementAttributes(UWORD fAttr, PTR rgbValue)
00925 {
00926   RETCODE rc=SQL_SUCCESS;
00927   TCHAR           szAPI[MEDBUFF];
00928   BOOL            fFailed=FALSE;
00929
00930   if (Supported(SQL_API_SQLSETSTMTATTR))
00931   {
00932     rc = SQLSetStmtAttr(hstmt,(SDWORD)fAttr,rgbValue,sizeof(UDWORD));
00933     _tcscpy(szAPI,szSQLSETSTMTATTR);
00934   }
00935   else
00936   {
00937     rc = SQLSetStmtOption(hstmt,fAttr,(UDWORD)rgbValue);
00938     _tcscpy(szAPI,szSQLSETSTMTOPTION);
00939   }
00940
00941   if (rc != SQL_SUCCESS)
00942   {
00943     if(!FindError(SQL_HANDLE_STMT,szHYC00))
00944       RETCHECK(SQL_SUCCESS, rc,szAPI);
00945
00946     fFailed=TRUE;
00947   }
00948
00949   return(fFailed);
00950
00951 } //SetStatementAttributes()
00952
00953
00954
00955 //-----------------------------------------------------------------------
00956 //      Function:               SetConnectionAttributes
00957 //-----------------------------------------------------------------------
00958
00959 _inline BOOL PASCAL SetConnectionAttributes(HDBC lhdbc,UWORD fAttr, UDWORD rgbValue)
00960 {
00961   RETCODE rc=SQL_SUCCESS;
00962   TCHAR           szAPI[MEDBUFF];
00963   BOOL            fFailed=FALSE;
00964
00965   if (Supported(SQL_API_SQLSETCONNECTATTR))
00966   {
00967     rc = SQLSetConnectAttr(lhdbc,(SDWORD)fAttr,(PTR)rgbValue,sizeof(UDWORD));
00968     _tcscpy(szAPI,szSQLSETCONNECTATTR);
00969   }
00970   else
00971   {
00972     rc = SQLSetConnectOption(lhdbc,fAttr,rgbValue);
00973     _tcscpy(szAPI,szSQLSETCONNECTOPTION);
00974   }
00975
00976   if (rc != SQL_SUCCESS)
00977   {
00978     if(!FindError(SQL_HANDLE_DBC,szHYC00))
00979       RETCHECK(SQL_SUCCESS, rc,szAPI);
00980
00981     fFailed=TRUE;
00982   }
00983
00984   return(fFailed);
00985
00986 } //SetConnectionAttributes()
00987
00988
00989
00990 //-----------------------------------------------------------------------
00991 //      Function:               FreeStmt
00992 //-----------------------------------------------------------------------
00993
00994 _inline BOOL PASCAL FreeStmt(UWORD fOption)
00995 {
00996   RETCODE rc=SQL_SUCCESS;
00997
00998   if (Supported(SQL_API_SQLFREEHANDLE) && (fOption == SQL_DROP))
00999   {
01000     rc = SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
01001     RETCHECK(SQL_SUCCESS, rc,szSQLFREEHANDLE);
01002   }
01003   else
01004   {
01005     rc = SQLFreeStmt(hstmt, fOption);
01006     RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
01007   }
01008
01009   return(RC_NOTSUCCESSFUL(rc));
01010
01011 } //FreeStmt()
01012
01013 //-----------------------------------------------------------------------
01014 //      Function:               DropHdbc
01015 //-----------------------------------------------------------------------
01016
01017 VOID PASCAL DropHdbc(HDBC hdbc)
01018 {
01019   RETCODE rc=SQL_SUCCESS;
01020
01021   if (Supported(SQL_API_SQLFREEHANDLE))
01022   {
01023     rc = SQLFreeHandle(SQL_HANDLE_DBC,hdbc);
01024     RETCHECK(SQL_SUCCESS, rc,szSQLFREEHANDLE);
01025   }
01026   else
01027   {
01028     rc = SQLFreeConnect(hdbc);
01029     RETCHECK(SQL_SUCCESS, rc,szSQLFREECONNECT);
01030   }
01031
01032 } //DropHdbc()
01033
01034
01035
01036 //-----------------------------------------------------------------------
01037 //      Function:               DropHenv
01038 //-----------------------------------------------------------------------
01039
01040 _inline VOID PASCAL DropHenv()
01041 {
01042   RETCODE rc=SQL_SUCCESS;
01043
01044   if (Supported(SQL_API_SQLFREEHANDLE))
01045   {
01046     rc = SQLFreeHandle(SQL_HANDLE_ENV,henv);
01047     RETCHECK(SQL_SUCCESS, rc,szSQLFREEHANDLE);
01048   }
01049   else
01050   {
01051     rc = SQLFreeEnv(henv);
01052     RETCHECK(SQL_SUCCESS, rc,szSQLFREEENV);
01053   }
01054
01055 } //DropHenv()
01056
01057
01058 //-----------------------------------------------------------------------
01059 //      Function:               ClearErrorQueue
01060 //-----------------------------------------------------------------------
01061
01062 VOID PASCAL ClearErrorQueue()
01063 {
01064   TCHAR szErrMsg[MAX_STRING_SIZE];
01065   TCHAR szState[6];
01066
01067   /* Eat up the SQL_SUCCESS_WITH_INFO error record */
01068   while (RC_SUCCESSFUL(SQLError(NULL, hdbc,NULL, szState, NULL,
01069     szErrMsg, sizeof(szErrMsg)/sizeof(TCHAR), NULL)))
01070       ;
01071 }
01072
01073
01074 //-----------------------------------------------------------------------
01075 //      Function:               Is3XDriver
01076 //-----------------------------------------------------------------------
01077
01078 BOOL PASCAL Is3XDriver(HDBC hdbc,QTSTRUCT *lpqt)
01079 {
01080   RETCODE         rc=SQL_SUCCESS;
01081   LPTSTR          pch=NULL;
01082   BOOL                    f3XDriver=FALSE;
01083
01084   rc = SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER,
01085     lpqt->buf, sizeof(lpqt->buf), NULL);
01086   if(RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO))
01087   {
01088     pch = _tcstok(lpqt->buf,TEXT("."));
01089
01090     if (!_tcsnccmp(pch,TEXT("02"), 2))
01091     {
01092       pch = _tcstok(NULL,TEXT("."));
01093
01094       if(!_tcsnccmp(pch,TEXT("00"), 2))
01095         DISPLAYERROR(szSQLGETINFO,TEXT("Driver returned ODBC version 2.00 which is no longer supported.  Please upgrade to 2.01"));
01096
01097     }
01098     else if (!_tcsnccmp(pch,TEXT("03"), 2))
01099       f3XDriver=TRUE;
01100   }
01101
01102   uDriverODBCVer=_ttoi(lpqt->buf);
01103
01104   return(f3XDriver);
01105
01106 } //Is3XDriver()
01107
01108
01109 //-----------------------------------------------------------------------
01110 //      Function:               Connect
01111 //-----------------------------------------------------------------------
01112
01113 BOOL  PASCAL Connect(lpSERVERINFO lpSI,QTSTRUCT  *lpqt)
01114 {
01115   RETCODE rc=SQL_SUCCESS;
01116   SDWORD sdwAppVer;
01117
01118 /* The signal for test to use it's
01119   own allocated handles, is if the a server name is passed in.  If it
01120   is not, the test should use the hdbc passed in */
01121
01122   /* ****************** Allocate Env ************************* */
01123   if (AllocHenv())
01124     goto ConnectErrorRet;
01125
01126   /* ****************** Set Application Version ************************* */
01127
01128   rc = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3,
01129     SQL_IS_UINTEGER);
01130   if(!RETCHECK(SQL_SUCCESS, rc, szSQLSETENVATTR))
01131     goto ConnectErrorRet;
01132
01133   /* ****************** Allocate Connection ************************* */
01134
01135   rc = SQLAllocConnect(henv, &hdbc);
01136   if(!RETCHECK(SQL_SUCCESS, rc, szSQLALLOCCONNECT))
01137     goto ConnectErrorRet;
01138
01139   /* ****************** Set Connection Attributes ************************* */
01140   rc = SQLSetConnectOption(hdbc,SQL_ODBC_CURSORS,lpSI->vCursorLib);
01141
01142   if(!FindError(SQL_HANDLE_DBC,szHYC00))
01143     if (!RETCHECK(SQL_SUCCESS, rc,szSQLSETCONNECTOPTION))
01144     goto ConnectErrorRet;
01145
01146   /* create a DriverConnect string */
01147   wsprintf(lpqt->sz, TEXT("dsn=%s;uid=%s;pwd=%s;"),
01148     lpSI->szValidServer0,
01149     lpSI->szValidLogin0,
01150     lpSI->szValidPassword0);
01151
01152   /* since SQL_DRIVER_COMPLETE is used, it is possible that the
01153   driver will bring up a dialog asking for more information. */
01154   rc = SQLDriverConnect(hdbc, lpSI->hwnd, lpqt->sz,
01155     SQL_NTS, lpqt->buf, MAX_STRING_SIZE, NULL, SQL_DRIVER_NOPROMPT);
01156
01157   if (RC_NOTSUCCESSFUL(rc))
01158   {
01159     if (!RETCHECK(SQL_SUCCESS, rc,szSQLDRIVERCONNECT))
01160       goto ConnectErrorRet;
01161   }
01162   else
01163     ClearErrorQueue();
01164
01165
01166   rc = SQLDisconnect(hdbc);
01167   RETCHECK(SQL_SUCCESS, rc,szSQLDISCONNECT);
01168
01169   rc = SQLConnect(hdbc, lpSI->szValidServer0, SQL_NTS,
01170             lpSI->szValidLogin0, SQL_NTS,
01171             lpSI->szValidPassword0, SQL_NTS);
01172
01173   if (RC_SUCCESSFUL(rc))
01174     ClearErrorQueue();
01175   else if (!RETCHECK(SQL_SUCCESS, rc,szSQLCONNECT))
01176     goto ConnectErrorRet;
01177
01178   // Set the global 3.0 driver flag
01179   g_f3XDriver=Is3XDriver(hdbc,lpqt);
01180
01181   // We're now connected, check application version and adjust expected error
01182   // states appropriately.
01183   rc = SQLGetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, &sdwAppVer, SQL_IS_UINTEGER, NULL);
01184   RETCHECK(SQL_SUCCESS, rc,szSQLGETENVATTR);
01185
01186   if (RC_SUCCESSFUL(rc) && (SQL_OV_ODBC2 == sdwAppVer))
01187   {
01188     _tcscpy(szHY009, TEXT("S1009"));
01189     _tcscpy(szHYC00, TEXT("S1C00"));
01190   }
01191
01192   return(FALSE);
01193
01194 ConnectErrorRet:
01195
01196   return(TRUE);
01197
01198 } //Connect()
01199
01200
01201 //-----------------------------------------------------------------------
01202 //      Function:               IgnoreType
01203 //-----------------------------------------------------------------------
01204
01205 BOOL  PASCAL IgnoreType(LPTSTR szType,SWORD wSQLType)
01206 {
01207   BOOL fIgnore=FALSE;
01208
01209 /* If a line below is compiled in, that type will not be used in creating
01210  the table.  (useful for when one specific type is causing problems in
01211  a particular test, this way the test can be run for all other types)
01212 */
01213
01214   if (!_tcscmp(szType,TEXT("LONG RAW")) ||
01215      !_tcscmp(szType,TEXT("LONG VARTCHAR")) ||
01216      !_tcscmp(szType,TEXT("LONG VARTCHAR FOR BIT DATA")))
01217     {
01218     fIgnore=TRUE;
01219     }
01220
01221   //if (wSQLType != SQL_CHAR)
01222   //      fIgnore=TRUE;
01223
01224   return(fIgnore);
01225
01226 } //IgnoreType()
01227
01228
01229 //-----------------------------------------------------------------------
01230 //      Function:               CheckConformanceLevel
01231 //-----------------------------------------------------------------------
01232
01233 UWORD  PASCAL CheckConformanceLevel()
01234 {
01235   RETCODE         rc=SQL_SUCCESS;
01236   UWORD           fIndex=0;
01237   SWORD           cb=0;
01238
01239   rc = SQLGetInfo(hdbc, SQL_ODBC_SQL_CONFORMANCE, &fIndex,
01240     sizeof (fIndex), &cb);
01241   RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
01242
01243   if(fIndex != 0 && fIndex != 1 && fIndex != 2) {
01244     /* one of these two values should always be returned */
01245     DISPLAYERROR(szSQLGETINFO,TEXT("SQL_ODBC_API_CONFORMANCE - invalid value"));
01246   }
01247
01248   return(fIndex);
01249
01250 } //CheckConformanceLevel()
01251
01252 /*-----------------------------------------------------------------------*/
01253 /*      Function:               TestConnectionOptions                                                    */
01254 /*-----------------------------------------------------------------------*/
01255
01256 void  PASCAL TestConnectionOptions()
01257 {
01258   RETCODE rc=SQL_SUCCESS;
01259   SDWORD  sdw,
01260         cbValue=0;
01261   BOOL            fConnectOption=TRUE;
01262   TCHAR           szAPI[MEDBUFF];
01263   HDBC            lhdbc=NULL;
01264
01265
01266   rc=SQLAllocConnect(henv,&lhdbc);
01267   RETCHECK(SQL_SUCCESS, rc,szSQLALLOCCONNECT);
01268
01269   SetConnectionAttributes(lhdbc,SQL_ACCESS_MODE,SQL_MODE_READ_WRITE);
01270
01271   SetConnectionAttributes(lhdbc,SQL_AUTOCOMMIT,TRUE);
01272
01273   if (SetConnectionAttributes(lhdbc,SQL_LOGIN_TIMEOUT,TEST_CONNECT_OPTION))
01274     fConnectOption = FALSE;
01275
01276   if (Supported(SQL_API_SQLGETCONNECTATTR))
01277   {
01278     rc = SQLGetConnectAttr(lhdbc, SQL_LOGIN_TIMEOUT, (PTR)&sdw,0,&cbValue);
01279     _tcscpy(szAPI,szSQLGETCONNECTATTR);
01280   }
01281   else
01282   {
01283     rc = SQLGetConnectOption(lhdbc, SQL_LOGIN_TIMEOUT, &sdw);
01284     _tcscpy(szAPI,szSQLSETCONNECTOPTION);
01285   }
01286
01287
01288   if(rc != SQL_SUCCESS)
01289   {
01290     if(!FindError(SQL_HANDLE_DBC,szHYC00))
01291       RETCHECK(SQL_SUCCESS, rc,szAPI);
01292   }
01293   else
01294   {
01295     if(sdw != TEST_CONNECT_OPTION && fConnectOption)
01296       DISPLAYERROR(szAPI,TEXT("SQL_LOGIN_TIMEOUT returned incorrect value"));
01297   }
01298
01299   rc=SQLFreeConnect(lhdbc);
01300   RETCHECK(SQL_SUCCESS, rc,szSQLFREECONNECT);
01301
01302 } //TestConnectionOptions()
01303
01304
01305
01306 /*-----------------------------------------------------------------------*/
01307 /*      Function:            CanAllocHdesc                                                                       */
01308 /*-----------------------------------------------------------------------*/
01309
01310 BOOL PASCAL CanAllocHdesc()
01311 {
01312   BOOL fSupported=FALSE;
01313
01314   /* Allocate an hdesc: */
01315   if(Supported(SQL_API_SQLALLOCHANDLE))
01316     fSupported = RC_SUCCESSFUL(SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc));
01317
01318   return(fSupported);
01319
01320 }
01321
01322
01323 /*-----------------------------------------------------------------------*/
01324 /*      Function:            SetErrorCondition                                                                   */
01325 /*-----------------------------------------------------------------------*/
01326
01327 VOID PASCAL SetErrorCondition(SWORD fHandleType)
01328 {
01329   RETCODE rc=SQL_SUCCESS;
01330
01331   /* The following are used to produce "(S1)HY009" SQL State */
01332   switch (fHandleType)
01333   {
01334     case SQL_HANDLE_ENV:
01335       rc = SQLAllocConnect(henv, NULL);
01336       break;
01337     case SQL_HANDLE_DBC:
01338       rc = SQLAllocStmt(hdbc, NULL);
01339       break;
01340     case SQL_HANDLE_STMT:
01341       rc = SQLExecDirect(hstmt, NULL, SQL_NTS);               // Produces a DM error
01342       break;
01343     case SQL_HANDLE_DESC:
01344       rc = SQLGetDescField(hdesc, 0, SQL_DESC_AUTO_UNIQUE_VALUE, NULL, 0, NULL);
01345       break;
01346   }
01347
01348 } //SetErrorCondition()
01349
01350
01351
01352 VOID PASCAL CheckData(SWORD fHandleType,UWORD uwDescField, PTR rgbValue,LPTSTR szDataSourceName)
01353 {
01354   TCHAR                   szBuff[MEDBUFF]=TEXT("");
01355   LPTSTR          pszExpState=szHY009;
01356
01357   if (fHandleType == SQL_HANDLE_DESC)
01358     pszExpState=szHY091;
01359
01360   switch(uwDescField)
01361   {
01362     case SQL_DIAG_RETURNCODE:
01363       {
01364         RETCODE rcRec=*(RETCODE *)rgbValue;
01365
01366         if (rcRec!= SQL_ERROR)
01367         {
01368           wsprintf(szBuff,TEXT("\t\t\tSQL_DIAG_RETURN_CODE\tReceived: %d\tExpected: %d"),rcRec,-1);
01369         }
01370       }
01371       break;
01372
01373     case SQL_DIAG_SQLSTATE:
01374       {
01375         if (_tcscmp((LPTSTR)rgbValue,pszExpState))
01376         {
01377           wsprintf(szBuff,TEXT("\t\t\tSQL_DIAG_SQLSTATE\tReceived: %s\tExpected: %s"),(LPTSTR)rgbValue,pszExpState);
01378         }
01379       }
01380       break;
01381     case SQL_DIAG_CLASS_ORIGIN:
01382       {
01383         if (_tcscmp((LPTSTR)rgbValue,szISO))
01384           wsprintf(szBuff,TEXT("\t\t\tSQL_DIAG_CLASS_ORIGIN\tReceived: %s\tExpected: %s"),(LPTSTR)rgbValue,szISO);
01385       }
01386       break;
01387     case SQL_DIAG_SUBCLASS_ORIGIN:
01388       {
01389         if (_tcscmp((LPTSTR)rgbValue,szISO))
01390           wsprintf(szBuff,TEXT("\t\t\tSQL_DIAG_CLASS_ORIGIN\tReceived: %s\tExpected: %s"),(LPTSTR)rgbValue,szISO);
01391       }
01392       break;
01393     case SQL_DIAG_NUMBER:
01394       {
01395         SDWORD cRecs=*(SDWORD *)rgbValue;
01396         if (cRecs != 1)
01397           wsprintf(szBuff,TEXT("\t\t\tSQL_DIAG_NUMBER\tReceived: %d\tExpected: %d"),cRecs,1);
01398       }
01399       break;
01400     case SQL_DIAG_SERVER_NAME:
01401       {
01402         switch(fHandleType)
01403         {
01404         case SQL_HANDLE_DBC:
01405         case SQL_HANDLE_STMT:
01406           if (_tcscmp((LPTSTR)rgbValue,szDataSourceName))
01407             wsprintf(szBuff,TEXT("\t\t\tSQL_DIAG_SERVER_NAME\tReceived: %s\tExpected: %s"),(LPTSTR)rgbValue,szDataSourceName);
01408           break;
01409         }
01410       }
01411       break;
01412     default:
01413       break;
01414
01415   }
01416
01417   if (*szBuff)
01418     DISPLAYERROR(szSQLGETDIAGFIELD,szBuff);
01419
01420 } /* CheckData() */
01421
01422
01423 /*------------------------------------------------------------------------------
01424 /       Function:       TestDiagRec
01425 /       Purpose:        For each type of handle, generate an error. If SQLGetDiagField
01426 /                               is not supported, verify the appropriate DM error is returned.
01427 /                               Otherwise, verify SQLGetDiagField returns the expected error
01428 /                               information. If SQLGetDiagRec is not supported, verify the
01429 /                               appropriate DM error is returned. Otherwise, verify
01430 /                               SQLGetDiagField returns the expected error information. If
01431 /                               SQLGetDiagRec is supported, compare its output with that of
01432 /                               SQLGetDiagField.
01433 /*----------------------------------------------------------------------------*/
01434
01435 void PASCAL TestDiagRec()
01436 {
01437   SQLRETURN       rcFunction,
01438           rc=SQL_SUCCESS;
01439   SWORD                   cbErrorMsg;
01440   SDWORD          fNativeError;
01441   UWORD                   iHandle=0,
01442           iField=0,
01443           cHandles;
01444
01445   SDWORD          *pfNativeError = NULL;
01446   LPTSTR          pchMessageText = NULL;
01447
01448   TCHAR                   szDataSourceName[MAX_STRING_SIZE] = TEXT("");
01449   TCHAR                   szState[SQL_SQLSTATE_SIZE+1];
01450   TCHAR                   szErrorMsg[SQL_MAX_MESSAGE_LENGTH];
01451   TCHAR                   szAPI[MEDBUFF]=TEXT("");
01452   TCHAR                   szBuff[MEDBUFF]=TEXT("");
01453
01454   LPTSTR          pszExpState=szHY009;
01455   RETCODE         rcExp=SQL_SUCCESS;
01456
01457   HANDLES rgHandles[] =
01458   {
01459     SQL_HANDLE_ENV, henv,
01460     SQL_HANDLE_DBC, hdbc,
01461     SQL_HANDLE_STMT, hstmt,
01462     SQL_HANDLE_DESC, hdesc,
01463   };
01464
01465   cHandles=sizeof(rgHandles)/sizeof(HANDLES);
01466
01467   /* Call SQLGetInfo to get values to compare: */
01468   rcFunction = SQLGetInfo(hdbc, SQL_DATA_SOURCE_NAME,
01469     szDataSourceName, sizeof(szDataSourceName), NULL);
01470   RETCHECK(SQL_SUCCESS, rcFunction, szSQLGETINFO);
01471
01472   /* Allocate an hdesc: */
01473   if(Supported(SQL_API_SQLALLOCHANDLE) && g_f3XDriver)
01474   {
01475     rcFunction = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc);
01476     RETCHECK(SQL_SUCCESS, rcFunction, szSQLALLOCHANDLE);
01477
01478     // Update the array entry for the hdesc
01479     rgHandles[3].hHandle=hdesc;
01480
01481   }
01482   else
01483     cHandles--;
01484
01485   for (iHandle=0; iHandle < cHandles; iHandle++)
01486   {
01487
01488     SetErrorCondition(rgHandles[iHandle].fHandleType);
01489
01490     rc = SQLGetDiagRec(rgHandles[iHandle].fHandleType, rgHandles[iHandle].hHandle,
01491           1,szState,&fNativeError, szErrorMsg,
01492           SQL_MAX_MESSAGE_LENGTH, &cbErrorMsg);
01493
01494     if (rgHandles[iHandle].fHandleType == SQL_HANDLE_DESC)
01495       pszExpState=szHY091;
01496
01497     rcExp=SQL_SUCCESS;
01498
01499     if(fDiagRecSupported)
01500     {
01501
01502       DIAGRETCHECK(rcExp, rc, szSQLGETDIAGREC);
01503       if (RC_SUCCESSFUL(rc) && _tcscmp(szState,pszExpState))
01504       {
01505         wsprintf(szBuff,TEXT("\t\t\tReceived: %s\tExpected: %s"),szState,       pszExpState);
01506         DISPLAYERROR(szSQLGETDIAGREC,szBuff);
01507       }
01508     }
01509     else
01510     {
01511       if(!FindError(rgHandles[iHandle].fHandleType, szIM001))
01512         DISPLAYERROR(szSQLGETDIAGREC, szNotSupported);
01513     }
01514
01515   }
01516
01517
01518   /* Free the hdesc: */
01519   if (hdesc)
01520   {
01521     rcFunction = SQLFreeHandle(SQL_HANDLE_DESC, hdesc);
01522     RETCHECK(rcExp, rcFunction, szSQLFREEHANDLE);
01523     hdesc = SQL_NULL_HDESC;
01524   }
01525
01526 //ExitTestDiagRec
01527
01528   FreeStmt(SQL_CLOSE);
01529
01530 } /* TestDiagRec() */
01531
01532
01533 /*------------------------------------------------------------------------------
01534 /       Function:       TestDiagField
01535 /       Purpose:        For each type of handle, generate an error. If SQLGetDiagField
01536 /                               is not supported, verify the appropriate DM error is returned.
01537 /                               Otherwise, verify SQLGetDiagField returns the expected error
01538 /                               information. If SQLGetDiagRec is not supported, verify the
01539 /                               appropriate DM error is returned. Otherwise, verify
01540 /                               SQLGetDiagField returns the expected error information. If
01541 /                               SQLGetDiagRec is supported, compare its output with that of
01542 /                               SQLGetDiagField.
01543 /*----------------------------------------------------------------------------*/
01544
01545 void PASCAL TestDiagField()
01546 {
01547   SQLRETURN       rcFunction,
01548           rc=SQL_SUCCESS;
01549   SWORD                   cbValue=0;
01550   UWORD                   iHandle=0,
01551           iField=0,
01552           cHandles;
01553
01554   TCHAR                   szDataSourceName[MAX_STRING_SIZE] = TEXT("");
01555   TCHAR                   rgbValue[SQL_MAX_MESSAGE_LENGTH];
01556   TCHAR                   szAPI[MEDBUFF]=TEXT("");
01557   TCHAR                   szBuff[MEDBUFF]=TEXT("");
01558   RETCODE         rcExp=SQL_SUCCESS;
01559
01560   HANDLES rgHandles[] =
01561   {
01562     SQL_HANDLE_ENV, henv,
01563     SQL_HANDLE_DBC, hdbc,
01564     SQL_HANDLE_STMT, hstmt,
01565     SQL_HANDLE_DESC, hdesc,
01566   };
01567
01568   cHandles=sizeof(rgHandles)/sizeof(HANDLES);
01569
01570   /* Call SQLGetInfo to get values to compare: */
01571   rcFunction = SQLGetInfo(hdbc, SQL_DATA_SOURCE_NAME,
01572     szDataSourceName, sizeof(szDataSourceName), NULL);
01573   RETCHECK(SQL_SUCCESS, rcFunction, szSQLGETINFO);
01574
01575   hdesc = SQL_NULL_HDESC;
01576
01577   /* Allocate an hdesc: */
01578   if(Supported(SQL_API_SQLALLOCHANDLE) && g_f3XDriver)
01579   {
01580     rcFunction = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc);
01581     RETCHECK(SQL_SUCCESS, rcFunction, szSQLALLOCHANDLE);
01582
01583     // Update the array entry for the hdesc
01584     rgHandles[3].hHandle=hdesc;
01585
01586   }
01587   else
01588     cHandles--;
01589
01590   for (iHandle=0; iHandle < cHandles; iHandle++)
01591   {
01592
01593     SetErrorCondition(rgHandles[iHandle].fHandleType);
01594
01595     if(fDiagFieldSupported)
01596     {
01597       for (iField=0;iField < sizeof(rgDiagInfo)/sizeof(struct tagDIAGINFO);iField++)
01598       {
01599         rc = SQLGetDiagField(rgHandles[iHandle].fHandleType, rgHandles[iHandle].hHandle,
01600               rgDiagInfo[iField].irecRecNumber, rgDiagInfo[iField].uwDescField,
01601               rgbValue, SQL_MAX_MESSAGE_LENGTH, &cbValue);
01602
01603         DIAGRETCHECK(rcExp, rc, szSQLGETDIAGFIELD);
01604
01605         if (RC_SUCCESSFUL(rc))
01606           CheckData(rgHandles[iHandle].fHandleType,rgDiagInfo[iField].uwDescField,
01607             rgbValue,szDataSourceName);
01608       }
01609
01610     }
01611     else
01612     {
01613       rc = SQLGetDiagField(SQL_HANDLE_ENV, henv, 0, SQL_DIAG_RETURNCODE, rgbValue,SQL_MAX_MESSAGE_LENGTH, &cbValue);
01614
01615       if(!FindError(rgHandles[iHandle].fHandleType, szIM001))
01616         DISPLAYERROR(szAPI, szNotSupported);
01617
01618     }
01619
01620   }
01621
01622
01623   /* Free the hdesc: */
01624   if (hdesc)
01625   {
01626     rcFunction = SQLFreeHandle(SQL_HANDLE_DESC, hdesc);
01627     RETCHECK(rcExp, rcFunction, szSQLFREEHANDLE);
01628     hdesc = SQL_NULL_HDESC;
01629   }
01630
01631 //ExitTestDiagField
01632
01633   FreeStmt(SQL_CLOSE);
01634
01635 } /* TestDiagField() */
01636
01637 //------------------------------------------------------------------------------
01638 //      Function:       CompareAnsiToUnicode
01639 //              Compares an ANSI string to a Unicode string
01640 //------------------------------------------------------------------------------
01641 BOOL CompareAnsiToUnicode(SQLCHAR * aszBuf, SQLINTEGER cbA, SQLWCHAR * wszBuf,
01642   SQLINTEGER cbW, SQLTCHAR * szAPI)
01643 {
01644   SQLWCHAR wszConvBuf[MAX_STRING_SIZE];
01645   SQLTCHAR tszAval[MAX_STRING_SIZE], tszWval[MAX_STRING_SIZE];
01646   SQLINTEGER cbT;
01647   BOOL bCompare=TRUE;
01648
01649   // Check ANSI count of bytes returned
01650   if ((cbA != SQL_NULL_DATA) && (SQLINTEGER)strlen(aszBuf) != cbA)
01651   {
01652     wsprintf(buf, TEXT("ANSI count of bytes returned incorrect.")\
01653       TEXT(" Expected: %d, received: %d"),
01654       strlen(aszBuf), cbA);
01655     DISPLAYERROR(szAPI, buf);
01656     bCompare=FALSE;
01657   }
01658
01659   // Compare ANSI count of bytes with Unicode count
01660   cbT = (cbA > 0) ? (SQLINTEGER)(cbA * sizeof(SQLWCHAR)) : cbA;
01661   if (cbW != cbT)
01662   {
01663     wsprintf(buf, TEXT("Unicode count of bytes returned incorrect.")\
01664       TEXT(" Expected: %d, received: %d"), cbT, cbW);
01665     DISPLAYERROR(szAPI, buf);
01666     bCompare=FALSE;
01667   }
01668
01669   // Compare strings if not NULL DATA
01670   if (cbA != SQL_NULL_DATA)
01671   {
01672     // Compare ANSI and Unicode strings returned
01673     (void)(MultiByteToWideChar(CP_ACP, 0, aszBuf, strlen(aszBuf), wszConvBuf,
01674       MAX_STRING_SIZE));
01675     wszConvBuf[strlen(aszBuf)]=L'\0';
01676
01677     if (wcscmp(wszConvBuf, wszBuf))
01678     {
01679
01680 #ifdef UNICODE
01681       wcscpy(tszAval,wszConvBuf);
01682       wcscpy(tszWval,wszBuf);
01683 #else
01684       WideCharToMultiByte(CP_ACP, 0, wszConvBuf, wcslen(wszConvBuf), tszAval,
01685         MAX_STRING_SIZE, NULL, NULL);
01686       tszAval[wcslen(wszConvBuf)] = '\0';
01687
01688       WideCharToMultiByte(CP_ACP, 0, wszBuf, wcslen(wszBuf), tszWval,
01689         MAX_STRING_SIZE, NULL, NULL);
01690       tszAval[wcslen(wszBuf)] = '\0';
01691
01692 #endif
01693
01694       _stprintf(buf, TEXT("Unicode string did not match ANSI string.\r\n")\
01695         TEXT("\t\t\tUnicode: '%s', ANSI: '%s'"), tszWval, tszAval);
01696       DISPLAYERROR(szAPI, buf);
01697       bCompare=FALSE;
01698     }
01699   }
01700
01701   return bCompare;
01702 }
01703
01704 //------------------------------------------------------------------------------
01705 //      Function:       CompareAnsiUnicodeResults
01706 //              Compares an ANSI result set to a Unicode result set
01707 //------------------------------------------------------------------------------
01708 void CompareAnsiUnicodeResults(SQLHSTMT hstmtA, SQLHSTMT hstmtW, SQLTCHAR * szAPI)
01709 {
01710   SQLCHAR aszBuf[MAX_STRING_SIZE];
01711   SQLWCHAR wszBuf[MAX_STRING_SIZE];
01712   SQLINTEGER cbANSI, cbUnicode;
01713   SQLUSMALLINT    uwCol;
01714   SQLSMALLINT             swColCountA, swColCountW;
01715   SQLRETURN rc, rcA, rcW;
01716
01717   // Check width of result sets
01718   rc=SQLNumResultCols(hstmtA, &swColCountA);
01719   ERRSHANDLE(SQL_HANDLE_STMT, hstmtA, SQL_SUCCESS, rc, szSQLNUMRESULTCOLS);
01720   rc=SQLNumResultCols(hstmtW, &swColCountW);
01721   ERRSHANDLE(SQL_HANDLE_STMT, hstmtW, SQL_SUCCESS, rc, szSQLNUMRESULTCOLS);
01722   if (swColCountA != swColCountW)
01723     DISPLAYERROR(szAPI,TEXT("ANSI and Unicode result sets different widths."));
01724
01725   uwCol=1;
01726   do {
01727     rc=SQLBindCol(hstmtA, uwCol, SQL_C_CHAR, aszBuf, sizeof(aszBuf), &cbANSI);
01728     ERRSHANDLE(SQL_HANDLE_STMT, hstmtA, SQL_SUCCESS, rc, szSQLBINDCOL);
01729     rc=SQLBindCol(hstmtW, uwCol, SQL_C_WCHAR, wszBuf, sizeof(wszBuf), &cbUnicode);
01730     ERRSHANDLE(SQL_HANDLE_STMT, hstmtW, SQL_SUCCESS, rc, szSQLBINDCOL);
01731
01732     // Copy something into the buffers so we can tell if they were modified
01733     strcpy(aszBuf, "Untouched");
01734     wcscpy(wszBuf, L"Untouched");
01735
01736     // Fetch into the buffers
01737     rcA=SQLFetch(hstmtA);
01738     rcW=SQLFetch(hstmtW);
01739
01740
01741     if (RC_SUCCESSFUL(rcA) && RC_SUCCESSFUL(rcW))
01742     {
01743       if (!CompareAnsiToUnicode(aszBuf, cbANSI, wszBuf, cbUnicode, szSQLFETCH))
01744       {
01745         rcW=SQL_NO_DATA;        // Abort the loop w/o generating failure
01746         rcA=SQL_NO_DATA;
01747       }
01748     }
01749
01750     // Unbind the column bound above on each statement
01751     rc=SQLFreeStmt(hstmtA, SQL_UNBIND);
01752     ERRSHANDLE(SQL_HANDLE_STMT, hstmtA, SQL_SUCCESS, rc, szSQLFREESTMT);
01753     rc=SQLFreeStmt(hstmtW, SQL_UNBIND);
01754     ERRSHANDLE(SQL_HANDLE_STMT, hstmtW, SQL_SUCCESS, rc, szSQLFREESTMT);
01755
01756     // Don't exceed the total number of columns in result set
01757     uwCol++;
01758     if (uwCol > (SQLUSMALLINT)swColCountA)
01759       uwCol=1;
01760   }
01761   while (RC_SUCCESSFUL(rcA) && RC_SUCCESSFUL(rcW));
01762
01763   // Make sure the result sets were the same size
01764   if (rcW != SQL_NO_DATA)
01765     ERRSHANDLE(SQL_HANDLE_STMT, hstmtW, SQL_NO_DATA, rc, szSQLFETCH);
01766
01767   // Make sure the result sets were the same size
01768   if (rcA != rcW)
01769     DISPLAYERROR(szAPI,TEXT("ANSI and Unicode result sets not the same length."));
01770
01771   rc=SQLFreeStmt(hstmtA, SQL_CLOSE);
01772   ERRSHANDLE(SQL_HANDLE_STMT, hstmtA, SQL_SUCCESS, rc, szSQLFREESTMT);
01773   rc=SQLFreeStmt(hstmtW, SQL_CLOSE);
01774   ERRSHANDLE(SQL_HANDLE_STMT, hstmtW, SQL_SUCCESS, rc, szSQLFREESTMT);
01775
01776 }
01777
01778
01779 /*------------------------------------------------------------------------------
01780 /       Function:       TestMixedAnsiUnicode
01781 /       Purpose:        Call several of the Unicode functions mixed with ANSI functions
01782 /                               to verify functions succeed in the mixed case.
01783 /*----------------------------------------------------------------------------*/
01784 void PASCAL TestMixedAnsiUnicode(QTSTRUCT * lpqt)
01785 {
01786   HDBC    hdbcANSI, hdbcUnicode;
01787   HSTMT hstmtANSIA, hstmtANSIW, hstmtUA, hstmtUW, hstmtW;
01788   SQLINTEGER cbANSI, cchUnicode;
01789   SQLWCHAR wszServer[MAX_STRING_SIZE], wszLogin[MAX_STRING_SIZE],
01790     wszPassword[MAX_STRING_SIZE], wszQuery[MAX_STRING_SIZE],
01791     wszBuf[MAX_STRING_SIZE], wszTable[MAX_STRING_SIZE];
01792   SQLCHAR aszServer[MAX_STRING_SIZE], aszLogin[MAX_STRING_SIZE],
01793     aszPassword[MAX_STRING_SIZE], aszQuery[MAX_STRING_SIZE],
01794     aszBuf[MAX_STRING_SIZE], aszTable[MAX_STRING_SIZE];
01795   SQLUSMALLINT fStmts;
01796   SQLRETURN rc, rcA=SQL_SUCCESS, rcW=SQL_SUCCESS;
01797
01798   // We've already set the environment attribute to 3.0 by this point
01799
01800 #ifdef UNICODE
01801   // Copy the unicode strings
01802   _tcscpy(wszServer, lpSI->szValidServer0);
01803   _tcscpy(wszLogin, lpSI->szValidLogin0);
01804   _tcscpy(wszPassword, lpSI->szValidPassword0);
01805   _tcscpy(wszTable, lpqt->szTableName);
01806   wsprintf(wszQuery,szSELECTSTAR,lpqt->szTableName);
01807
01808   // Convert and copy to ANSI strings
01809   /*
01810   int WideCharToMultiByte(
01811      UINT  CodePage,        // code page
01812      DWORD  dwFlags,        // performance and mapping flags
01813      LPCWSTR  lpWideCharStr,        // address of wide-character string
01814      int  cchWideChar,      // number of characters in string
01815      LPSTR  lpMultiByteStr, // address of buffer for new string
01816      int  cchMultiByte,     // size of buffer
01817      LPCSTR  lpDefaultChar, // address of default for unmappable characters
01818      LPBOOL  lpUsedDefaultChar      // address of flag set when default char. used
01819     );
01820   */
01821   // Server
01822   (void)(WideCharToMultiByte(CP_ACP,
01823               0,
01824               lpSI->szValidServer0,
01825               _tcslen(lpSI->szValidServer0),
01826               aszServer,
01827               sizeof(aszServer),
01828               NULL,
01829               NULL));
01830   aszServer[_tcslen(lpSI->szValidServer0)]=TEXT('\0');
01831
01832   // UID
01833   (void)(WideCharToMultiByte(CP_ACP,
01834               0,
01835               lpSI->szValidLogin0,
01836               _tcslen(lpSI->szValidLogin0),
01837               aszLogin,
01838               sizeof(aszLogin),
01839               NULL,
01840               NULL));
01841   aszLogin[_tcslen(lpSI->szValidLogin0)]=TEXT('\0');
01842
01843   // PWD
01844   (void)(WideCharToMultiByte(CP_ACP,
01845               0,
01846               lpSI->szValidPassword0,
01847               _tcslen(lpSI->szValidPassword0),
01848               aszPassword,
01849               sizeof(aszPassword),
01850               NULL,
01851               NULL));
01852   aszPassword[_tcslen(lpSI->szValidPassword0)]=TEXT('\0');
01853
01854   // Select stmt
01855   (void)(WideCharToMultiByte(CP_ACP,
01856               0,
01857               wszQuery,
01858               _tcslen(wszQuery),
01859               aszQuery,
01860               sizeof(aszQuery),
01861               NULL,
01862               NULL));
01863   aszQuery[_tcslen(wszQuery)]=TEXT('\0');
01864
01865   // Table name
01866   (void)(WideCharToMultiByte(CP_ACP,
01867               0,
01868               wszTable,
01869               _tcslen(wszTable),
01870               aszTable,
01871               sizeof(aszTable),
01872               NULL,
01873               NULL));
01874   aszTable[_tcslen(wszTable)]=TEXT('\0');
01875
01876 #else
01877   // Copy the ANSI strings
01878   _tcscpy(aszServer, lpSI->szValidServer0);
01879   _tcscpy(aszLogin, lpSI->szValidLogin0);
01880   _tcscpy(aszPassword, lpSI->szValidPassword0);
01881   _tcscpy(aszTable, lpqt->szTableName);
01882   sprintf(aszQuery,szSELECTSTAR,lpqt->szTableName);
01883
01884   // Convert and copy to Unicode strings
01885   /*
01886   int MultiByteToWideChar(
01887      UINT  CodePage,        // code page
01888      DWORD  dwFlags,        // character-type options
01889      LPCSTR  lpMultiByteStr,        // address of string to map
01890      int  cchMultiByte,     // number of characters in string
01891      LPWSTR  lpWideCharStr, // address of wide-character buffer
01892      int  cchWideChar       // size of buffer
01893     );
01894   */
01895
01896   // Server
01897   (void) MultiByteToWideChar(CP_ACP,
01898                   0,
01899                   lpSI->szValidServer0,
01900                   _tcslen(lpSI->szValidServer0),
01901                   wszServer,
01902                   sizeof(wszServer)/sizeof(WCHAR)
01903                   );
01904   wszServer[_tcslen(lpSI->szValidServer0)]=TEXT('\0');
01905
01906   // UID
01907   (void) MultiByteToWideChar(CP_ACP,
01908                   0,
01909                   lpSI->szValidLogin0,
01910                   _tcslen(lpSI->szValidLogin0),
01911                   wszLogin,
01912                   sizeof(wszLogin)/sizeof(WCHAR)
01913                   );
01914   wszLogin[_tcslen(lpSI->szValidLogin0)]=TEXT('\0');
01915
01916   // PWD
01917   (void) MultiByteToWideChar(CP_ACP,
01918                   0,
01919                   lpSI->szValidPassword0,
01920                   _tcslen(lpSI->szValidPassword0),
01921                   wszPassword,
01922                   sizeof(wszPassword)/sizeof(WCHAR)
01923                   );
01924   wszPassword[_tcslen(lpSI->szValidPassword0)]=TEXT('\0');
01925
01926   // Select stmt
01927   (void) MultiByteToWideChar(CP_ACP,
01928                   0,
01929                   aszQuery,
01930                   _tcslen(aszQuery),
01931                   wszQuery,
01932                   sizeof(wszQuery)/sizeof(WCHAR)
01933                   );
01934   wszQuery[_tcslen(aszQuery)]=TEXT('\0');
01935
01936   // Table name
01937   (void) MultiByteToWideChar(CP_ACP,
01938                   0,
01939                   aszTable,
01940                   _tcslen(aszTable),
01941                   wszTable,
01942                   sizeof(wszTable)/sizeof(WCHAR)
01943                   );
01944   wszTable[_tcslen(aszTable)]=TEXT('\0');
01945
01946 #endif
01947
01948   // Allocate connection for ANSI
01949   rc = SQLAllocConnect(henv, &hdbcANSI);
01950   RETCHECK(SQL_SUCCESS, rc, szSQLALLOCCONNECT);
01951
01952   // Allocate connection for Unicode
01953   rc = SQLAllocConnect(henv, &hdbcUnicode);
01954   RETCHECK(SQL_SUCCESS, rc, szSQLALLOCCONNECT);
01955
01956   // If Unicode is defined, then strings need to be converted to ANSI
01957   // before calling SQLConnectA
01958   rc = SQLConnectA(hdbcANSI, (LPSTR)aszServer, SQL_NTS,
01959             (LPSTR)aszLogin, SQL_NTS,
01960             (LPSTR)aszPassword, SQL_NTS);
01961   if (!RC_SUCCESSFUL(rc))
01962     ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc,szSQLCONNECT);
01963
01964   rc = SQLConnectW(hdbcUnicode, (LPWSTR)wszServer, SQL_NTS,
01965             (LPWSTR)wszLogin, SQL_NTS,
01966             (LPWSTR)wszPassword, SQL_NTS);
01967   if (!RC_SUCCESSFUL(rc))
01968     ERRSHANDLE(SQL_HANDLE_DBC, hdbcUnicode, SQL_SUCCESS, rc,szSQLCONNECTW);
01969
01970   // Test mixed SQLNativeSQL calls        on the ANSI connection
01971   rc=SQLNativeSqlA(hdbcANSI, aszQuery, strlen(aszQuery), aszBuf,
01972     sizeof(aszBuf), &cbANSI);
01973   ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc,szSQLNATIVESQL);
01974   rc=SQLNativeSqlW(hdbcANSI, wszQuery, wcslen(wszQuery), wszBuf,
01975     sizeof(wszBuf)/sizeof(WCHAR), &cchUnicode);
01976   ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc,szSQLNATIVESQL);
01977
01978   CompareAnsiToUnicode(aszBuf, cbANSI, wszBuf, cchUnicode*sizeof(WCHAR), szSQLNATIVESQLW);
01979
01980   // Allocate stmt handles for ANSI connection
01981   rc = SQLAllocStmt(hdbcANSI, &hstmtANSIA);       // Handle for ANSI calls
01982   ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc,szSQLALLOCSTMT);
01983   rc = SQLAllocStmt(hdbcANSI, &hstmtANSIW);       // Handle for Unicode calls
01984   ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc,szSQLALLOCSTMT);
01985
01986   // Allocate stmt handles for Unicode connection
01987   rc = SQLAllocStmt(hdbcUnicode, &hstmtUA); // Handle for ANSI calls
01988   ERRSHANDLE(SQL_HANDLE_DBC, hdbcUnicode, SQL_SUCCESS, rc,szSQLALLOCSTMT);
01989   rc = SQLAllocStmt(hdbcUnicode, &hstmtUW); // Handle for Unicode calls
01990   ERRSHANDLE(SQL_HANDLE_DBC, hdbcUnicode, SQL_SUCCESS, rc,szSQLALLOCSTMT);
01991
01992   // Call SQLTablesA&W on two different hdbcs
01993   strcpy(aszBuf,"%");
01994   wcscpy(wszBuf,L"%");
01995   rc = SQLTablesA(hstmtANSIA, NULL, 0, NULL, 0, aszBuf, SQL_NTS, NULL, 0);
01996   ERRSHANDLE(SQL_HANDLE_STMT, hstmtANSIA, SQL_SUCCESS, rc, szSQLTABLESA);
01997   rc = SQLTablesW(hstmtUW, NULL, 0, NULL, 0, wszBuf, SQL_NTS, NULL, 0);
01998   ERRSHANDLE(SQL_HANDLE_STMT, hstmtUW, SQL_SUCCESS, rc, szSQLTABLESW);
01999
02000   // Compare the two result sets
02001   CompareAnsiUnicodeResults(hstmtANSIA, hstmtUW, szSQLTABLESW);
02002
02003   // See if the driver supports multiple active stmts
02004   if (uDriverODBCVer >= 3)
02005     rc = SQLGetInfo(hdbcANSI, SQL_ACTIVE_STATEMENTS, &fStmts, 0, NULL);
02006   else
02007     rc = SQLGetInfo(hdbcANSI, SQL_ACTIVE_STATEMENTS, &fStmts, sizeof(fStmts), NULL);
02008   ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc, szSQLGETINFO);
02009
02010   // Create a search string for ANSI
02011   aszBuf[0]=aszTable[0];
02012   aszBuf[1]=TEXT('\0');
02013   strcat(aszBuf,"%");
02014
02015   // Create a search string for Unicode
02016   wszBuf[0]=wszTable[0];
02017   wszBuf[1]=TEXT('\0');
02018   wcscat(wszBuf,L"%");
02019
02020   // If the allowed active statements is > 1, then use the same connection
02021   // otherwise use the other connection
02022   if (fStmts > 1)
02023     hstmtW=hstmtUW;
02024   else
02025     hstmtW=hstmtANSIW;
02026
02027   // Call SQLColumnsA&W on two different hstmts (same connection if allowed)
02028   // Call for only the given table to limit compare errors at this time
02029   rc = SQLColumnsA(hstmtUA, NULL, 0, NULL, 0, aszTable, SQL_NTS, NULL, 0);
02030   ERRSHANDLE(SQL_HANDLE_STMT, hstmtANSIA, SQL_SUCCESS, rc, szSQLCOLUMNSA);
02031
02032   // Call for only the given table to limit compare errors at this time
02033   rc = SQLColumnsW(hstmtW, NULL, 0, NULL, 0, wszTable, SQL_NTS, NULL, 0);
02034   ERRSHANDLE(SQL_HANDLE_STMT, hstmtW, SQL_SUCCESS, rc, szSQLCOLUMNSW);
02035
02036   CompareAnsiUnicodeResults(hstmtUA, hstmtW, szSQLCOLUMNSW);
02037
02038   rc = SQLExecDirectA(hstmtUA, aszQuery, SQL_NTS);
02039   ERRSHANDLE(SQL_HANDLE_STMT, hstmtUA, SQL_SUCCESS, rc, szSQLEXECDIRECTA);
02040
02041   // Call for only the given table to limit compare errors at this time
02042   rc = SQLExecDirectW(hstmtW, wszQuery, SQL_NTS);
02043   ERRSHANDLE(SQL_HANDLE_STMT, hstmtW, SQL_SUCCESS, rc, szSQLEXECDIRECTW);
02044
02045   CompareAnsiUnicodeResults(hstmtUA, hstmtW, szSQLEXECDIRECTW);
02046
02047   // Disconnect and free ANSI handles
02048   rc=SQLFreeStmt(hstmtANSIA, SQL_DROP);
02049   ERRSHANDLE(SQL_HANDLE_STMT, hstmtANSIA, SQL_SUCCESS, rc,szSQLFREESTMT);
02050   rc=SQLFreeStmt(hstmtANSIW, SQL_DROP);
02051   ERRSHANDLE(SQL_HANDLE_STMT, hstmtANSIW, SQL_SUCCESS, rc,szSQLFREESTMT);
02052   rc=SQLDisconnect(hdbcANSI);
02053   ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc,szSQLCONNECT);
02054   rc=SQLFreeConnect(hdbcANSI);
02055   ERRSHANDLE(SQL_HANDLE_DBC, hdbcANSI, SQL_SUCCESS, rc,szSQLCONNECT);
02056   // Disconnect and free Unicode handles
02057   rc=SQLFreeStmt(hstmtUA, SQL_DROP);
02058   ERRSHANDLE(SQL_HANDLE_STMT, hstmtUA, SQL_SUCCESS, rc,szSQLFREESTMT);
02059   rc=SQLFreeStmt(hstmtUW, SQL_DROP);
02060   ERRSHANDLE(SQL_HANDLE_STMT, hstmtUW, SQL_SUCCESS, rc,szSQLFREESTMT);
02061   rc=SQLDisconnect(hdbcUnicode);
02062   ERRSHANDLE(SQL_HANDLE_DBC, hdbcUnicode, SQL_SUCCESS, rc,szSQLCONNECT);
02063   rc=SQLFreeConnect(hdbcUnicode);
02064   ERRSHANDLE(SQL_HANDLE_DBC, hdbcUnicode, SQL_SUCCESS, rc,szSQLCONNECT);
02065
02066 } /* TestMixedAnsiUnicode() */
02067
02068 //-----------------------------------------------------------------------
02069 //      Function:               TestStmtOptions
02070 //-----------------------------------------------------------------------
02071
02072 void  PASCAL TestStmtOptions()
02073 {
02074   UDWORD  dwLen,
02075         udw;
02076   BOOL            fConnectOption;
02077   RETCODE rc=SQL_SUCCESS;
02078   TCHAR           szAPI[MEDBUFF];
02079   SDWORD  cbValue=0;
02080
02081   SetStatementAttributes(SQL_MAX_LENGTH,(PTR)&udw);
02082
02083   if (SetStatementAttributes(SQL_MAX_LENGTH, (PTR)TEST_STMT_OPTION))
02084     fConnectOption = TRUE;
02085
02086   if (Supported(SQL_API_SQLGETSTMTATTR))
02087   {
02088     rc = SQLGetStmtAttr(hstmt, SQL_MAX_LENGTH, (PTR)&dwLen,sizeof(dwLen),&cbValue);
02089     _tcscpy(szAPI,szSQLGETSTMTATTR);
02090   }
02091   else
02092   {
02093     rc = SQLGetStmtOption(hstmt, SQL_MAX_LENGTH, &dwLen);
02094     _tcscpy(szAPI,szSQLGETSTMTOPTION);
02095   }
02096
02097   if(rc != SQL_SUCCESS)
02098   {
02099     if(!FindError(SQL_HANDLE_STMT,szHYC00))
02100       RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTOPTION);
02101   }
02102   else
02103   {
02104     if(dwLen != TEST_STMT_OPTION && rc == SQL_SUCCESS && fConnectOption)
02105       DISPLAYERROR(szSQLGETSTMTOPTION,TEXT("incorrect SQL_MAX_LENGTH value returned"));
02106   }
02107
02108   //Reset the MAX_LENGTH
02109   if(fConnectOption)
02110     SetStatementAttributes(SQL_MAX_LENGTH, (PTR)0);
02111
02112 } //TestStmtOptions()
02113
02114
02115 //-----------------------------------------------------------------------
02116 //      Function:               SetTableName
02117 //-----------------------------------------------------------------------
02118
02119 void  PASCAL SetTableName(QTSTRUCT  *lpqt)
02120 {
02121   RETCODE rc=SQL_SUCCESS;
02122   UWORD           cTableName;
02123   TCHAR           szTime[MEDBUFF]=TEXT(""),
02124         szTmpBuff[MEDBUFF],
02125         *pTime=NULL;
02126
02127   _tstrtime(szTmpBuff);
02128
02129   /* Remove colons */
02130   pTime=_tcstok(szTmpBuff, TEXT(":"));
02131   while (pTime)
02132   {
02133     _tcscat(szTime,pTime);
02134     pTime=_tcstok(NULL, TEXT(":"));
02135   }
02136
02137   rc = SQLGetInfo(hdbc, SQL_MAX_TABLE_NAME_LEN, &cTableName,
02138     sizeof (cTableName), NULL);
02139   if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
02140     RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
02141
02142   rc = SQLGetInfo(hdbc, SQL_QUALIFIER_NAME_SEPARATOR,
02143     lpqt->buf, sizeof(lpqt->buf), NULL);
02144   if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
02145     RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
02146
02147   if(!(_tcscmp(TEXT("\\"), lpqt->buf)))
02148     cTableName -= 4;
02149
02150   _sntprintf(lpqt->szTableName, min(cTableName, MAX_TABLE_NAME-1),
02151         TEXT("q%s"), szTime);
02152
02153 } //SetTableName()
02154
02155
02156 //-----------------------------------------------------------------------
02157 //      Function:               AllowedType
02158 //
02159 //              If swNumTypes > 0, limits SQL types to those in array
02160 //-----------------------------------------------------------------------
02161 BOOL AllowedType(SWORD fType)
02162 {
02163   SWORD i, swNumTypes=0;
02164   BOOL bAllowed=TRUE;
02165   SWORD rgAllowedTypes[MAX_TYPES_SUPPORTED]={
02166     SQL_CHAR,
02167     SQL_BINARY
02168 //              SQL_BIT
02169 /*
02170     SQL_TINYINT
02171     SQL_NUMERIC,
02172     SQL_INTEGER,
02173     SQL_SMALLINT,
02174     SQL_FLOAT,
02175     SQL_REAL,
02176     SQL_TYPE_TIMESTAMP,
02177     SQL_LONGVARBINARY,
02178     SQL_LONGVARCHAR
02179 */
02180   };
02181
02182   if (swNumTypes > 0)
02183   {
02184     bAllowed=FALSE;
02185
02186     for (i=0; i < swNumTypes; i++)
02187     {
02188       if (fType == rgAllowedTypes[i])
02189         bAllowed=TRUE;
02190     }
02191   }
02192
02193   return bAllowed;
02194 }
02195
02196 //-----------------------------------------------------------------------
02197 //      Function:               GetTypeInfo
02198 //-----------------------------------------------------------------------
02199
02200 UWORD  PASCAL GetTypeInfo(FIELDINFO  *rgFields,QTSTRUCT  *lpqt)
02201 {
02202   RETCODE         rc=SQL_SUCCESS;
02203   UWORD       cFieldName;
02204   SDWORD      cMaxTypeSize, cMaxRowSize;
02205   UWORD       i,
02206           cTypes=0;
02207   SDWORD      sdw;
02208   LPTSTR       pch=NULL;
02209   BOOL                    fAutoInc=0;
02210
02211   /* Get the type information to use in a create statement for a table */
02212
02213   rc = SQLGetInfo(hdbc, SQL_MAX_COLUMN_NAME_LEN, &cFieldName,
02214     sizeof cFieldName, NULL);
02215   RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
02216
02217   rc = SQLGetInfo(hdbc, SQL_MAX_ROW_SIZE, &cMaxRowSize,
02218     sizeof cMaxRowSize, NULL);
02219   /* don't check for SQL_SUCCES here, it's a 2.0 function.  If it's successful
02220     That's great, if not then no maximum is assumed. */
02221
02222   cMaxTypeSize = cMaxRowSize / MAX_TYPES_SUPPORTED;
02223
02224 /* TO DO: add checks in here for dos file types GetInfo SQL_QUALIFIER_NAME_SEPARATER */
02225
02226   if(cFieldName > MAX_FIELD - 1)
02227     cFieldName = MAX_FIELD - 1;
02228
02229   if(cFieldName < PREFIX_SIZE)
02230   {
02231     DISPLAYERROR(szSQLGETINFO,TEXT("MAX_COLUMN_NAME_LEN is too small for autotest to run"));
02232     goto TypeErrorRet;
02233   }
02234
02235   rc = SQLGetTypeInfo(hstmt, SQL_ALL_TYPES);
02236   RETCHECK(SQL_SUCCESS, rc,szSQLGETTYPEINFO);
02237
02238   for(i = 0; i < MAX_TYPES_SUPPORTED; i++)
02239   {
02240
02241     rc = SQLFetch(hstmt);
02242     if(rc != SQL_SUCCESS && rc !=SQL_SUCCESS_WITH_INFO)
02243       break;
02244
02245     *rgFields[i].szType = *rgFields[i].szLength = *rgFields[i].szParams = TEXT('\0');
02246
02247     /* get type name */
02248     rc = SQLGetData(hstmt, 1, SQL_C_TCHAR,
02249       rgFields[i].szType, sizeof(rgFields[i].szType), &sdw);
02250
02251     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02252       goto TypeErrorRet;
02253
02254     wsprintf(rgFields[i].szFieldName,TEXT("c%02u"), i+COLNAME_START);
02255     /* copy first portion of type name for easy reference */
02256     _tcsnccat(rgFields[i].szFieldName, rgFields[i].szType, TYPE_PORTION);
02257
02258
02259     /* change spaces in field name to '_' */
02260     while((pch = (LPTSTR)_tcschr(rgFields[i].szFieldName, TEXT(' '))) != NULL)
02261       *pch = TEXT('_');
02262
02263     /* get the SQLType */
02264     rc = SQLGetData(hstmt, 2, SQL_C_DEFAULT,
02265       (SWORD  *)&rgFields[i].wSQLType, IGNORED,
02266       &sdw);
02267     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02268       goto TypeErrorRet;
02269
02270     /* Max length */
02271     rc = SQLGetData(hstmt, 3, SQL_C_TCHAR,
02272       rgFields[i].szLength, sizeof(rgFields[i].szLength), &sdw);
02273     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02274       goto TypeErrorRet;
02275
02276     /* limit the row size for those drivers that don't support a long
02277       enough row length for all the fields to be at the max length */
02278     switch(rgFields[i].wSQLType)
02279     {
02280       case SQL_CHAR:
02281       case SQL_WCHAR:
02282       case SQL_VARCHAR:
02283       case SQL_WVARCHAR:
02284       case SQL_VARBINARY:
02285       case SQL_BINARY:
02286       case SQL_LONGVARCHAR:
02287       case SQL_LONGVARBINARY:
02288       case SQL_WLONGVARCHAR:
02289
02290         if(cMaxTypeSize)
02291         {
02292           if(_ttol (rgFields[i].szLength) > cMaxTypeSize)
02293             _ltot(cMaxTypeSize, rgFields[i].szLength, 10);
02294         }
02295     }
02296
02297     /* prefix */
02298     rc = SQLGetData(hstmt, 4, SQL_C_TCHAR,
02299       rgFields[i].szPrefix, sizeof(rgFields[i].szPrefix), &sdw);
02300     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02301       goto TypeErrorRet;
02302
02303     /* suffix */
02304     rc = SQLGetData(hstmt, 5, SQL_C_TCHAR,
02305       rgFields[i].szSuffix, sizeof(rgFields[i].szSuffix), &sdw);
02306     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02307       goto TypeErrorRet;
02308
02309     /* create params */
02310     rc = SQLGetData(hstmt, 6, SQL_C_TCHAR,
02311       rgFields[i].szParams, sizeof(rgFields[i].szParams), &sdw);
02312     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02313       goto TypeErrorRet;
02314
02315     /* nullable */
02316     rc = SQLGetData(hstmt, 7, SQL_C_SHORT, &rgFields[i].nullable, IGNORED,
02317       &sdw);
02318     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02319       goto TypeErrorRet;
02320
02321     /* searchable */
02322     rc = SQLGetData(hstmt, 9, SQL_C_SHORT, &rgFields[i].fSearchable, IGNORED,
02323       &sdw);
02324     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02325       goto TypeErrorRet;
02326
02327     /* autoincrement */
02328     rc = SQLGetData(hstmt, 12, SQL_C_SHORT, &rgFields[i].autoinc, IGNORED,
02329       &sdw);
02330     if(!RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA))
02331       goto TypeErrorRet;
02332
02333     // Since some data types will have NULL for autoincrement, we need to set to FALSE
02334     if (SQL_NULL_DATA == sdw)
02335       rgFields[i].autoinc=FALSE;
02336
02337     if (IgnoreType(rgFields[i].szType,rgFields[i].wSQLType))
02338     {
02339       i--;
02340       continue;
02341     }
02342
02343     /* The following code only allows the first autoincrement column to
02344       be placed in the table.  Many DBMS's do not allow more than one per table. */
02345     if(rgFields[i].autoinc == TRUE)
02346     {
02347       if(fAutoInc)
02348       {
02349         i--;
02350         continue;
02351       }
02352       else
02353         fAutoInc = TRUE;
02354     }
02355
02356     // Limit data types to those desired (use for debugging)
02357     if (!AllowedType(rgFields[i].wSQLType))
02358     {
02359       i--;
02360       continue;
02361     }
02362   }
02363
02364   cTypes = i;
02365
02366   /* if the type name contains spaces, replace them with _ because
02367     most servers don't allow spaces in field names */
02368
02369   RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
02370
02371   rc = SQLFreeStmt(hstmt, SQL_CLOSE);
02372   RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
02373
02374   SetTableName(lpqt);
02375
02376   return(cTypes);
02377
02378 TypeErrorRet:
02379
02380   return(0);
02381
02382 } //GetTypeInfo()
02383
02384
02385
02386
02387 //-----------------------------------------------------------------------
02388 //      Function:               BuildCreateStmt
02389 //-----------------------------------------------------------------------
02390
02391 BOOL  PASCAL BuildCreateStmt(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes)
02392 {
02393   RETCODE         rc=SQL_SUCCESS;
02394   TCHAR        szNum[MAX_NUM_BUFFER];   /* used with _ttoi and itoa conversions */
02395   SWORD       wNum;
02396   UWORD       i;
02397   SDWORD      sdw;
02398   LPTSTR       pch=NULL;
02399
02400
02401   /* the column names will be ctypname (where typename is the
02402     type name returned by the source in SQLGetTypeInfo) */
02403
02404   *lpqt->sz = TEXT('\0');
02405   _tcscpy(lpqt->sz,TEXT("Create Table "));
02406   _tcscat(lpqt->sz, lpqt->szTableName);
02407   _tcscat(lpqt->sz,TEXT(" ("));
02408   for(i = 0; i < cTypes; i++) {
02409       TCHAR szParamType[50];
02410       TCHAR szNotNull[10];
02411       *lpqt->szParam = TEXT('\0');
02412
02413     /* if SQLGetTypeInfo returned params they need to be used in
02414       the create statement */
02415
02416     if(rgFields[i].szParams == NULL || _tcslen(rgFields[i].szParams) == 0)
02417       *lpqt->szParam = TEXT('\0');
02418     else if(_tcschr(rgFields[i].szParams, TEXT(',')) == NULL)
02419       wsprintf(lpqt->szParam,TEXT("(%s)"), rgFields[i].szLength);
02420     else
02421       {
02422       _tcscpy(szNum, rgFields[i].szLength);
02423       wsprintf(lpqt->szParam,TEXT("(%s, %d)"), rgFields[i].szLength,
02424         _ttoi(szNum) - SCALEDIFF);
02425       }
02426
02427     _tcscpy(szParamType, rgFields[i].szType);
02428     if(pch = _tcschr((LPTSTR)szParamType, TEXT('(')))
02429       {
02430       *pch = TEXT('\0');
02431       _tcscat(szParamType, lpqt->szParam);
02432       _tcscat(szParamType, (LPTSTR)_tcschr(rgFields[i].szType, TEXT(')')) + 1);
02433       }
02434     else
02435       {
02436       _tcscat(szParamType, lpqt->szParam);
02437       }
02438
02439     /* If the field is not nullable, we need to create the table that way */
02440     rc = SQLGetInfo(hdbc, SQL_NON_NULLABLE_COLUMNS, &wNum,
02441       sizeof (SWORD), NULL);
02442     if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
02443       RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
02444
02445     if((rgFields[i].nullable == SQL_NO_NULLS) && (wNum != SQL_NNC_NULL))
02446       _tcscpy(szNotNull,TEXT("NOT NULL"));
02447     else
02448       szNotNull[0] = TEXT('\0');
02449
02450     wsprintf(&lpqt->sz[_tcslen(lpqt->sz)],TEXT(" %s %s %s ,"),
02451       rgFields[i].szFieldName, (LPTSTR)szParamType, (LPTSTR)szNotNull);
02452   }
02453
02454   /* remove the last comma and space */
02455   lpqt->sz[_tcslen(lpqt->sz) - 2] = TEXT('\0');
02456   _tcscat(lpqt->sz,TEXT(")"));
02457
02458   rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
02459   if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
02460     if(!RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT))
02461       goto BuildErrorRet;
02462
02463   /* now that table was created, call SQLColumns.  Both as
02464     a test and to get necessary information to insert data */
02465
02466   rc = SQLColumns(hstmt, NULL, SQL_NTS, NULL, SQL_NTS,
02467     lpqt->szTableName, SQL_NTS, NULL, SQL_NTS);
02468   RETCHECK(SQL_SUCCESS, rc,szSQLCOLUMNS);
02469
02470   for(i = 0; i < cTypes; i++) {
02471     rc = SQLFetch(hstmt);
02472     RETCHECK(SQL_SUCCESS, rc,szSQLFETCH);
02473
02474     /* precision */
02475     rc = SQLGetData(hstmt, 7, SQL_C_LONG, &rgFields[i].precision, IGNORED,
02476       &sdw);
02477     RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
02478
02479     /* length */
02480     if((rgFields[i].precision == 0) || (sdw == SQL_NO_TOTAL)){
02481       rc = SQLGetData(hstmt, 8, SQL_C_LONG, &rgFields[i].precision, IGNORED,
02482         &sdw);
02483       RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
02484       if(sdw == SQL_NO_TOTAL)         /* precision & length were undetermined */
02485         rgFields[i].precision = 1000;   /* so set it to an arbitary value */
02486     }
02487
02488     /* numeric scale */
02489     rc = SQLGetData(hstmt, 9, SQL_C_SHORT, &rgFields[i].scale, IGNORED,
02490       &sdw);
02491     RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
02492     if(sdw == SQL_NO_TOTAL)
02493       rgFields[i].scale = 0;
02494   }
02495
02496   rc = SQLFreeStmt(hstmt, SQL_CLOSE);
02497   RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
02498
02499   /* look for columns the test should not try to update by running
02500     a select * query and calling ColAttributes on the result fields */
02501   /* select * does not return the fields in a defined order, so field order
02502     must be specified */
02503
02504   _tcscpy(lpqt->sz,TEXT("select "));
02505   for(i = 0; i < cTypes; i ++) {
02506     if(i)
02507       _tcscat(lpqt->sz,TEXT(","));
02508     _tcscat(lpqt->sz, rgFields[i].szFieldName);
02509   }
02510
02511   _tcscat(lpqt->sz,TEXT(" from "));
02512   _tcscat(lpqt->sz, lpqt->szTableName);
02513
02514   rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
02515   RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
02516
02517   for(i = 1; i <= cTypes; i++) {
02518
02519     rc = SQLColAttributes(hstmt, i, SQL_COLUMN_UPDATABLE, NULL,
02520       0, NULL, &sdw);
02521     RETCHECK(SQL_SUCCESS, rc,szSQLCOLATTRIBUTES);
02522
02523     rgFields[i - 1].fAutoUpdate = sdw == SQL_ATTR_READONLY;
02524
02525     rc = SQLColAttributes(hstmt, i, SQL_COLUMN_UNSIGNED, NULL,
02526       0, NULL, &sdw);
02527     RETCHECK(SQL_SUCCESS, rc,szSQLCOLATTRIBUTES);
02528
02529     rgFields[i - 1].fUnsigned = sdw;
02530   }
02531
02532   rc = SQLFreeStmt(hstmt, SQL_CLOSE);
02533   RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
02534
02535   return(FALSE);
02536
02537 BuildErrorRet:
02538
02539   return(TRUE);
02540
02541 } //BuildCreateStmt()
02542
02543
02544
02545 //-----------------------------------------------------------------------
02546 //      Function:               BuildInsertStmt
02547 //-----------------------------------------------------------------------
02548
02549 BOOL  PASCAL BuildInsertStmt(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes,
02550   DSTRUCT  *lpd,SDWORD  *cColsSelected,BOOL fBindParameter)
02551 {
02552   RETCODE         rc;
02553   UWORD           w;
02554   UWORD           i;
02555   PTR                     ptr;
02556   UWORD           ind;
02557   SDWORD          sdw;
02558   LPTSTR          pch=NULL;
02559   BOOL                    fColNames=TRUE,
02560           fLongData=FALSE;
02561   SDWORD                  *sdwArray = (SDWORD  *)AllocateMemory(sizeof(SDWORD) * MAX_TYPES_SUPPORTED);
02562
02563   _tcscpy(lpqt->szColNames,TEXT("\0"));
02564   _tcscpy(lpqt->szValues,TEXT("\0"));
02565
02566   for(i = 0; i < cTypes; i++) {
02567
02568     for(ind = 0, w = 0; ind < cTypes; ind++) {
02569
02570       pch = qtMakeData(i, ind,&rgFields[ind], lpqt->szDataItem);
02571
02572       if(!pch) /* current type is READ_ONLY) */
02573         continue;
02574
02575       /* for every nullable type, that field will be set to    */
02576       /* null when the row number corresponds with the field */
02577       /* number */
02578
02579       if(*pch)
02580         {
02581         _tcscpy(lpd[w].data, pch);
02582         lpd[w].cb = SQL_NTS;
02583         }
02584       else
02585         {
02586         _tcscpy(lpd[w].data,TEXT(""));
02587         lpd[w].cb = SQL_NULL_DATA;
02588         }
02589
02590       if(fColNames)
02591         {
02592         /* the first time throught, the insert */
02593         /* statement itself is created         */
02594         _tcscat(lpqt->szColNames, rgFields[ind].szFieldName);
02595         _tcscat(lpqt->szColNames,TEXT(", "));
02596         _tcscat(lpqt->szValues,TEXT(" ?, "));
02597
02598         /* and parameters are set                                                                               */
02599         /* set all the parameters using pointers to buffers in*/
02600         /* the param struct.                                                                                    */
02601         if(!fBindParameter)
02602           {
02603           rc = SQLSetParam(hstmt, (UWORD)(w+1),
02604             SQL_C_TCHAR, rgFields[ind].wSQLType,
02605             rgFields[ind].precision, rgFields[ind].scale,
02606             &lpd[w].data,
02607             &lpd[w].cb);
02608           RETCHECK(SQL_SUCCESS, rc,szSQLSETPARAM);
02609           }
02610         else
02611           {
02612           rc = SQLBindParameter(hstmt, (UWORD)(w+1),
02613             SQL_PARAM_INPUT,
02614             SQL_C_TCHAR, rgFields[ind].wSQLType,
02615             rgFields[ind].precision, rgFields[ind].scale,
02616             &lpd[w].data, MAX_STRING_SIZE,
02617             &lpd[w].cb);
02618           RETCHECK(SQL_SUCCESS, rc,szSQLBINDPARAMETER);
02619           }
02620       }
02621       w++;
02622       cNumResSetCols=w;
02623     }
02624
02625     if(fColNames)
02626       {
02627       /* the first time through, the insert                   */
02628       /* statement needs to be SQLPrepare'd                   */
02629       /* remove the "," at the end of the string      */
02630       lpqt->szColNames[_tcslen(lpqt->szColNames) - 2] = TEXT('\0');
02631       lpqt->szValues[_tcslen(lpqt->szValues) - 2] = TEXT('\0');
02632
02633       wsprintf(lpqt->sz,TEXT("insert into %s (%s) VALUES(%s)"),
02634         lpqt->szTableName, lpqt->szColNames, lpqt->szValues);
02635
02636       //copy the insert statement, with the column names.
02637       //_ASSERTE(_tcslen(lpqt->sz) < MAX_STRING_SIZE);
02638       _tcscpy(szInsertStmt,lpqt->sz);
02639
02640       //prepare the statement
02641       rc = SQLPrepare(hstmt, lpqt->sz, SQL_NTS);
02642       if(!RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE))
02643         goto InsertErrorRet;
02644
02645       fColNames = FALSE; /* no more first times through */
02646       }
02647
02648     rc = SQLExecute(hstmt); /* insert a row */
02649
02650     if(!RETCHECK(SQL_SUCCESS, rc,szSQLEXECUTE))
02651     {
02652       if (SQL_SUCCESS_WITH_INFO != rc)                // BANDAID, normally would fail on S.W.I
02653         goto InsertErrorRet;
02654     }
02655
02656     rc = SQLRowCount(hstmt, &sdw);
02657     RETCHECK(SQL_SUCCESS, rc,szSQLROWCOUNT);
02658
02659     if(sdw != 1) /* the execute inserted 1 row */
02660       DISPLAYERROR(szSQLROWCOUNT,TEXT("Insert single row"));
02661
02662     /* FreeStmt SQL_CLOSE */
02663     rc = SQLFreeStmt(hstmt, SQL_CLOSE);
02664     RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
02665   }
02666
02667   /* for the last row use SQLParamData and SQLPutData */
02668
02669   /* First check to see if the SQL_LEN_DATA_AT_EXEC macro is supported */
02670   rc = SQLGetInfo(hdbc, SQL_NEED_LONG_DATA_LEN,
02671     lpqt->buf, (SWORD)sizeof(lpqt->buf), NULL);
02672   if(rc == SQL_SUCCESS)
02673     if(lpqt->buf[0] == TEXT('Y'))
02674       fLongData = TRUE;
02675
02676   for(ind = 0, w = 0; ind < cTypes; ind++)
02677     {
02678
02679     /* set all the params */
02680
02681     if(rgFields[ind].fAutoUpdate)
02682       continue;
02683
02684     if(fLongData && ((rgFields[ind].wSQLType == SQL_LONGVARBINARY) ||
02685       (rgFields[ind].wSQLType == SQL_LONGVARCHAR))){
02686       /* Make sure we don't exceed the max negative SDWORD value */
02687       if(rgFields[ind].precision > (MAXSDWORD + SQL_LEN_DATA_AT_EXEC_OFFSET))
02688         sdwArray[ind] = MINSDWORD - SQL_LEN_DATA_AT_EXEC_OFFSET;
02689       else
02690         sdwArray[ind] = SQL_LEN_DATA_AT_EXEC(rgFields[ind].precision);
02691       }
02692     else
02693       sdwArray[ind] = SQL_DATA_AT_EXEC;
02694
02695     w++;
02696     if(!fBindParameter){
02697       rc = SQLSetParam(hstmt, w,
02698         SQL_C_TCHAR, rgFields[ind].wSQLType,
02699         rgFields[ind].precision, rgFields[ind].scale,
02700         (LPTSTR)(UDWORD)ind, &sdwArray[ind]);
02701       RETCHECK(SQL_SUCCESS, rc,szSQLSETPARAM);
02702       }
02703     else{
02704       rc = SQLBindParameter(hstmt, w, SQL_PARAM_INPUT,
02705         SQL_C_TCHAR, rgFields[ind].wSQLType,
02706         rgFields[ind].precision, rgFields[ind].scale,
02707         (LPTSTR)(((UDWORD)ind)+BIND_PARM_OFFSET), 0, &sdwArray[ind]);
02708       RETCHECK(SQL_SUCCESS, rc,szSQLBINDPARAMETER);
02709       }
02710   }
02711
02712   *cColsSelected = w;
02713
02714   rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
02715   if (!RETCHECK(SQL_NEED_DATA, rc,szSQLEXECDIRECT))
02716     goto InsertErrorRet;
02717
02718
02719   for(ind = 0; ind <= cTypes; ind++)
02720     {
02721     rc = SQLParamData(hstmt, &ptr);
02722     if(rc != SQL_NEED_DATA)
02723       break;
02724
02725     pch = qtMakeData(cTypes, ind, &rgFields[(unsigned long)ptr-BIND_PARM_OFFSET],
02726       lpqt->szDataItem);
02727
02728     if(*pch) {
02729       rc = SQLPutData(hstmt, pch, SQL_NTS);
02730       RETCHECK(SQL_SUCCESS, rc,szSQLPUTDATA);
02731     } else {
02732       rc = SQLPutData(hstmt, (LPTSTR)IGNORED, SQL_NULL_DATA);
02733       RETCHECK(SQL_SUCCESS, rc,szSQLPUTDATA);
02734     }
02735   }
02736
02737   RETCHECK(SQL_SUCCESS, rc,szSQLPARAMDATA);
02738
02739   rc = SQLRowCount(hstmt, &sdw);
02740   RETCHECK(SQL_SUCCESS, rc,szSQLROWCOUNT);
02741
02742   if(sdw != 1)
02743     DISPLAYERROR(szSQLROWCOUNT,TEXT("Insert single row"));
02744
02745   rc = SQLFreeStmt(hstmt, SQL_RESET_PARAMS);
02746   RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
02747
02748
02749
02750   ReleaseMemory(sdwArray);
02751
02752   return(FALSE);
02753
02754 InsertErrorRet:
02755
02756   SQLFreeStmt(hstmt, SQL_RESET_PARAMS);
02757
02758   ReleaseMemory(sdwArray);
02759
02760   return(TRUE);
02761
02762 } //BuildInsertStmt()
02763
02764
02765 //-----------------------------------------------------------------------
02766 //      Function:               FullDisconnect
02767 //-----------------------------------------------------------------------
02768
02769 void  PASCAL FullDisconnect()
02770 {
02771   RETCODE rc=SQL_SUCCESS;
02772
02773   /* SQLCancel has the same functionality as SQLFreeStmt w/ SQL_CLOSE     */
02774   /*      in a non-asynchronous environment                                                                                       */
02775
02776   rc = SQLCancel(hstmt);
02777   RETCHECK(SQL_SUCCESS, rc,szSQLCANCEL);
02778
02779   FreeStmt(SQL_DROP);
02780
02781   /* if the connection was made in the                                            */
02782   /*      test, it should be disconnected                                                 */
02783   /* in the test, otherwise it should be left connected */
02784
02785   rc = SQLDisconnect(hdbc);
02786   RETCHECK(SQL_SUCCESS, rc,szSQLDISCONNECT);
02787
02788   rc = SQLFreeConnect(hdbc);
02789   RETCHECK(SQL_SUCCESS, rc,szSQLFREECONNECT);
02790
02791   rc = SQLFreeEnv(henv);
02792   RETCHECK(SQL_SUCCESS, rc,szSQLFREEENV);
02793
02794
02795 } //FullDisconnect()
02796
02797
02798
02799 //-----------------------------------------------------------------------
02800 //      Function:               DropTable
02801 //-----------------------------------------------------------------------
02802
02803 void  PASCAL DropTable(LPTSTR szTableName, BOOL fSilent)
02804 {
02805   TCHAR           szBuff[100];
02806   RETCODE rc=SQL_ERROR;
02807
02808   _tcscpy(szBuff,TEXT("drop table "));
02809   _tcscat(szBuff, szTableName);
02810
02811   rc = SQLExecDirect(hstmt, szBuff, SQL_NTS);
02812
02813   if (!fSilent)
02814     {
02815     if(!RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT))
02816       szWrite(TEXT("Unable to drop table"), TRUE);
02817     }
02818
02819 } //DropTable()
02820
02821
02822
02823 //-----------------------------------------------------------------------
02824 //    Function: CleanUp
02825 //              Purpose:                To drop the table,disconnect from data source and
02826 //                                              release memory.
02827 //-----------------------------------------------------------------------
02828
02829 void  PASCAL CleanUp(DSTRUCT  *lpd,QTSTRUCT  *lpqt,FIELDINFO  *rgFields,
02830   LPTSTR szTableName,BOOL fSilent,LPTSTR szValidServer)
02831 {
02832
02833   DropTable(szTableName, fSilent);
02834
02835   if(szValidServer)
02836     FullDisconnect();
02837
02838   ReleaseMemory(lpd);
02839   ReleaseMemory(lpqt);
02840   ReleaseMemory(rgFields);
02841
02842 } //CleanUp()
02843
02844
02845 //-----------------------------------------------------------------------
02846 //      Function:               BindAllColumns
02847 //-----------------------------------------------------------------------
02848
02849 BOOL  PASCAL BindAllColumns(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes,
02850   DSTRUCT  *lpd)
02851 {
02852 //-----------------------------------------------------------------------
02853 //      Function:               BindAllColumns
02854   UWORD           i,
02855         w;
02856   RETCODE rc=SQL_SUCCESS;
02857
02858   for(i = 0, w = 0; i < cTypes; i++)
02859     {
02860
02861     if(!qtMakeData(1, i,&rgFields[i],lpqt->szDataItem))
02862       continue;
02863
02864     w++;
02865
02866     switch(rgFields[i].wSQLType)
02867       {
02868       case SQL_INTEGER:
02869         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02870               &lpd[i].sdword, IGNORED, &lpd[i].cb);
02871         break;
02872       case SQL_SMALLINT:
02873         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02874               &lpd[i].sword, IGNORED, &lpd[i].cb);
02875         break;
02876       case SQL_FLOAT:
02877       case SQL_DOUBLE:
02878         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02879               &lpd[i].sdouble, IGNORED, &lpd[i].cb);
02880         break;
02881       case SQL_REAL:
02882         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02883               &lpd[i].sfloat, IGNORED, &lpd[i].cb);
02884         break;
02885       case SQL_DATE:
02886       case SQL_TYPE_DATE:
02887         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02888               &lpd[i].date, IGNORED, &lpd[i].cb);
02889         break;
02890       case SQL_TIME:
02891       case SQL_TYPE_TIME:
02892         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02893               &lpd[i].time, IGNORED, &lpd[i].cb);
02894         break;
02895       case SQL_TIMESTAMP:
02896       case SQL_TYPE_TIMESTAMP:
02897         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02898               &lpd[i].timestamp, IGNORED, &lpd[i].cb);
02899         break;
02900       case SQL_CHAR:
02901       case SQL_WCHAR:
02902       case SQL_VARCHAR:
02903       case SQL_WVARCHAR:
02904       case SQL_LONGVARCHAR:
02905       case SQL_WLONGVARCHAR:
02906       case SQL_NUMERIC:
02907       case SQL_DECIMAL:
02908         rc = SQLBindCol(hstmt, w, SQL_C_TCHAR,
02909               lpd[i].data, MAX_STRING_SIZE*sizeof(SQLTCHAR), &lpd[i].cb);
02910         break;
02911       default:
02912         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02913               lpd[i].data, MAX_STRING_SIZE, &lpd[i].cb);
02914         break;
02915       }
02916
02917     if(!RETCHECK(SQL_SUCCESS, rc, szSQLBINDCOL))
02918       return(FALSE);
02919     }
02920
02921   return(TRUE);
02922
02923 } //BindAllColumns()
02924
02925 /*-----------------------------------------------------------------------
02926  *      Function:               BindFetchColumns
02927  *  Used for Checking data in Result sets from fetch calls.
02928  *  Binds Binary data types as SQL_C_TCHAR
02929  *----------------------------------------------------------------------- */
02930
02931 BOOL  PASCAL BindFetchColumns(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes,
02932   DSTRUCT  *lpdFetch)
02933 {
02934   UWORD           i,
02935         w;
02936   RETCODE rc=SQL_SUCCESS;
02937
02938   for(i = 0, w = 0; i < cTypes; i++)
02939     {
02940
02941     if(!qtMakeData(0, i,&rgFields[i],lpqt->szDataItem))
02942       continue;
02943
02944     w++;
02945
02946     switch(rgFields[i].wSQLType)
02947       {
02948       case SQL_BIGINT:
02949       case SQL_INTEGER:
02950         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02951               &lpdFetch[i].sdword, IGNORED, &lpdFetch[i].cb);
02952         break;
02953       case SQL_TINYINT:
02954       case SQL_SMALLINT:
02955         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02956               &lpdFetch[i].sword, IGNORED, &lpdFetch[i].cb);
02957         break;
02958       case SQL_FLOAT:
02959       case SQL_DOUBLE:
02960         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02961               &lpdFetch[i].sdouble, IGNORED, &lpdFetch[i].cb);
02962         break;
02963       case SQL_REAL:
02964         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02965               &lpdFetch[i].sfloat, IGNORED, &lpdFetch[i].cb);
02966         break;
02967       case SQL_DATE:
02968       case SQL_TYPE_DATE:
02969         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02970               &lpdFetch[i].date, IGNORED, &lpdFetch[i].cb);
02971         break;
02972       case SQL_TIME:
02973       case SQL_TYPE_TIME:
02974         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02975               &lpdFetch[i].time, IGNORED, &lpdFetch[i].cb);
02976         break;
02977       case SQL_TIMESTAMP:
02978       case SQL_TYPE_TIMESTAMP:
02979         rc = SQLBindCol(hstmt, w, SQL_C_DEFAULT,
02980               &lpdFetch[i].timestamp, IGNORED, &lpdFetch[i].cb);
02981         break;
02982       case SQL_BIT:
02983       case SQL_BINARY:
02984       case SQL_VARBINARY:
02985       case SQL_LONGVARBINARY:
02986         rc = SQLBindCol(hstmt, w, SQL_C_TCHAR,
02987               lpdFetch[i].data, sizeof(lpdFetch[i].data), &lpdFetch[i].cb);
02988         break;
02989       case SQL_CHAR:
02990       case SQL_WCHAR:
02991       case SQL_VARCHAR:
02992       case SQL_WVARCHAR:
02993       case SQL_LONGVARCHAR:
02994       case SQL_WLONGVARCHAR:
02995       case SQL_NUMERIC:
02996       case SQL_DECIMAL:
02997       default:
02998         rc = SQLBindCol(hstmt, w, SQL_C_TCHAR,
02999               lpdFetch[i].data, sizeof(lpdFetch[i].data), &lpdFetch[i].cb);
03000         break;
03001       }
03002
03003     if(!RETCHECK(SQL_SUCCESS, rc, szSQLBINDCOL))
03004       return(FALSE);
03005     }
03006
03007   return(TRUE);
03008
03009 } /*BindFetchColumns() */
03010
03011 //-----------------------------------------------------------------------
03012 //      Function:               TestMetaData
03013 //-----------------------------------------------------------------------
03014
03015 void  PASCAL TestMetaData(lpSERVERINFO lpSI, QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes)
03016 {
03017   SWORD    wNum;
03018   UWORD    w;
03019   UWORD    i;
03020   UDWORD   dwLen;
03021   RETCODE rc=SQL_SUCCESS;
03022   SWORD           wType;
03023   SWORD           wNull;
03024
03025   SelectFromTable(lpqt);
03026
03027   for(i = 0, w = 0; i < cTypes; i++)
03028     {
03029     dwLen = 0;
03030     wNum = 0;
03031     wNull = 0;
03032
03033     /* information returned by SQLDescribeCol should match info */
03034     /*      used to create table */
03035
03036     if(!qtMakeData(1, i,&rgFields[i],lpqt->szDataItem))
03037       continue;
03038
03039     w++;
03040     rc = SQLDescribeCol(hstmt, w, lpqt->buf,
03041       sizeof(lpqt->buf)/sizeof(TCHAR), NULL, &wType, &dwLen, &wNum, &wNull);
03042     RETCHECK(SQL_SUCCESS, rc,szSQLDESCRIBECOL);
03043
03044     /* verify that column name returned is column name created */
03045
03046     if(0 != _tcsicmp(rgFields[i].szFieldName, lpqt->buf))
03047       DISPLAYERROR(szSQLDESCRIBECOL,TEXT("incorrect column name"));
03048
03049     if(wType != rgFields[i].wSQLType)
03050     {
03051       // For a 2.x driver, SQLGetTypeInfo result will be SQL_DATE, etc,
03052       // but 3.0 DM will convert SQLDescribeCol values to TYPE_DATE, ETC.
03053       if ((uDriverODBCVer < 3) &&
03054         ((SQL_TYPE_DATE == wType && SQL_DATE == rgFields[i].wSQLType) ||
03055         (SQL_TYPE_TIME == wType && SQL_TIME == rgFields[i].wSQLType) ||
03056         (SQL_TYPE_TIMESTAMP == wType && SQL_TIMESTAMP == rgFields[i].wSQLType)))
03057         NULL;
03058       else
03059         DISPLAYERROR(szSQLDESCRIBECOL,TEXT("incorrect SQLType"));
03060     }
03061
03062     if(dwLen != (UDWORD)rgFields[i].precision)
03063       DISPLAYERROR(szSQLDESCRIBECOL,TEXT("incorrect precision"));
03064
03065     if(wNum != rgFields[i].scale)
03066       DISPLAYERROR(szSQLDESCRIBECOL,TEXT("incorrect scale"));
03067
03068     if(wNull != rgFields[i].nullable && wNull != SQL_NULLABLE_UNKNOWN &&
03069       rgFields[i].nullable != SQL_NULLABLE_UNKNOWN)
03070       {
03071       DISPLAYERROR(szSQLDESCRIBECOL,TEXT("incorrect nullable"));
03072       }
03073     }
03074
03075   FreeStmt(SQL_CLOSE);
03076
03077 } //TestMetaData()
03078
03079
03080 //-----------------------------------------------------------------------
03081 //      Function:               RetrieveData
03082 //-----------------------------------------------------------------------
03083
03084 void PASCAL RetrieveData(QTSTRUCT *lpqt,FIELDINFO *rgFields,
03085   UWORD cTypes,DSTRUCT *lpd)
03086 {
03087   RETCODE rc=SQL_SUCCESS;
03088   UWORD           ind,
03089         i;
03090   SDWORD          nSame;
03091   LPTSTR  pch=NULL;
03092   TCHAR           szNum[MAX_NUM_BUFFER];   /* used with _ttoi and itoa conversions */
03093   TCHAR           *stopstring=NULL;
03094   double  Num=0,
03095         Num2=0;
03096
03097   for(ind = 0; ;ind++)
03098     {
03099
03100     /* Get the data back */
03101     rc = SQLFetch(hstmt);
03102     if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
03103       break;
03104
03105     for(i = 0; i < cTypes; i++)
03106       {
03107       /* make sure it's original data placed */
03108       /* in that field/row location                   */
03109       pch = qtMakeData(ind, i,&rgFields[i], lpqt->szDataItem);
03110
03111       if(!pch)
03112         continue;
03113
03114       if(!*pch) {
03115         if(lpd[i].cb != SQL_NULL_DATA)
03116           DISPLAYERROR(szRETDATA, TEXT("should have been NULL"));
03117         continue;
03118       }
03119       switch(rgFields[i].wSQLType)
03120         {
03121         /* check the outlen and data    */
03122         /* returned for each type.      */
03123         case SQL_INTEGER:
03124           if(lpd[i].cb != sizeof(SDWORD))
03125             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03126
03127           _tcscpy(szNum, pch);
03128           nSame = _ttol(szNum) == lpd[i].sdword;
03129           break;
03130         case SQL_SMALLINT:
03131           if(lpd[i].cb != sizeof(SWORD))
03132             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03133
03134           _tcscpy(szNum, pch);
03135           nSame = _ttoi(szNum) == lpd[i].sword;
03136           break;
03137
03138         case SQL_FLOAT:
03139         case SQL_DOUBLE:
03140           if(lpd[i].cb != sizeof(SDOUBLE))
03141             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03142
03143           _tcscpy(szNum, pch);
03144           Num=_tcstod(szNum, &stopstring);
03145           nSame = Num - lpd[i].sdouble < 0.001 && Num - lpd[i].sdouble > -0.001;
03146
03147           break;
03148
03149         case SQL_REAL:
03150           if(lpd[i].cb != sizeof(SFLOAT))
03151             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03152
03153           _tcscpy(szNum, pch);
03154           Num=_tcstod(szNum, &stopstring);
03155
03156           nSame = Num - lpd[i].sfloat < 0.001 && Num - lpd[i].sfloat > -0.001;
03157           break;
03158
03159         case SQL_TINYINT:
03160           if(lpd[i].cb != sizeof(SCHAR))
03161             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03162
03163           _tcscpy(szNum, pch);
03164           nSame = (SCHAR)_ttoi(szNum) == (SCHAR)lpd[i].data[0];
03165           break;
03166
03167         case SQL_DECIMAL:
03168         case SQL_NUMERIC:
03169           if(lpd[i].cb > MAX_STRING_SIZE*sizeof(TCHAR))
03170             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03171
03172           // Chg _tcslen to strlen below pending spec decision
03173           if((lpd[i].cb / sizeof(TCHAR)) > (UDWORD)_tcslen(lpd[i].data))
03174             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03175
03176           {
03177           TCHAR szNum2[MAX_NUM_BUFFER];
03178
03179           _tcscpy(szNum, pch);
03180           _tcscpy(szNum2, pch);
03181           Num=_tcstod(szNum, &stopstring);
03182           Num2=_tcstod(szNum2, &stopstring);
03183
03184           nSame = Num - Num2 < 0.001 &&   Num - Num2 > -0.001;
03185           }
03186
03187           break;
03188
03189
03190         case SQL_VARCHAR:
03191         case SQL_WVARCHAR:
03192         case SQL_LONGVARCHAR:
03193         case SQL_WLONGVARCHAR:
03194           if(lpd[i].cb > MAX_STRING_SIZE*sizeof(TCHAR))
03195             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03196
03197           if(lpd[i].cb / sizeof(SQLTCHAR) > _tcslen(lpd[i].data))
03198             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03199           nSame = (SDWORD)_tcsstr(lpd[i].data, pch);
03200
03201           break;
03202
03203         case SQL_VARBINARY:
03204         case SQL_LONGVARBINARY:
03205           if(lpd[i].cb > MAX_STRING_SIZE)
03206             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03207
03208           if(lpd[i].cb * 2 != (SWORD)_tcslen(pch))
03209             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03210
03211           nSame = TRUE; /* not checking returned data for binary */
03212
03213           break;
03214
03215         case SQL_CHAR:
03216         case SQL_WCHAR:
03217           if(lpd[i].cb > MAX_STRING_SIZE*sizeof(TCHAR) && rc == SQL_SUCCESS)
03218             DISPLAYERROR(szRETDATA,TEXT("incorrect return code for outlen"));
03219
03220           if(((lpd[i].cb / sizeof(TCHAR)) != (UDWORD)rgFields[i].precision) && rc == SQL_SUCCESS)
03221             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03222
03223           nSame = !_tcsnccmp(lpd[i].data, pch, _tcslen(pch));
03224
03225           break;
03226         case SQL_BINARY:
03227         default:
03228           if(lpd[i].cb > MAX_STRING_SIZE && rc == SQL_SUCCESS)
03229             DISPLAYERROR(szRETDATA,szINCORRECTOUTLEN);
03230           nSame = TRUE; /* not checking returned data for binary */
03231         }
03232
03233     if(!nSame)
03234       DISPLAYERROR(szRETDATA, TEXT("invalid data"));
03235     }
03236   }
03237
03238   RETCHECK(SQL_NO_DATA_FOUND, rc, szSQLFETCH);
03239
03240   if(ind != cTypes + 1)
03241     DISPLAYERROR(szSQLFETCH, TEXT("Incorrect number of result rows"));
03242
03243   rc = SQLFreeStmt(hstmt, SQL_CLOSE);
03244   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03245
03246   rc = SQLFreeStmt(hstmt, SQL_UNBIND);
03247   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03248
03249   rc = SQLFreeStmt(hstmt, SQL_RESET_PARAMS);
03250   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03251
03252 } // RetrieveData()
03253
03254
03255
03256 //-----------------------------------------------------------------------
03257 //      Function:               TestData
03258 //-----------------------------------------------------------------------
03259
03260 void  PASCAL TestData(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,
03261   UWORD cTypes,DSTRUCT  *lpd)
03262 {
03263
03264   /* bind all fields to a variable of the correct type for retreiving data */
03265   if (!BindAllColumns(lpqt,rgFields,cTypes,lpd))
03266     return;
03267
03268   SelectFromTable(lpqt);
03269
03270   RetrieveData(lpqt,rgFields,cTypes,lpd);
03271
03272 } // TestData()
03273
03274
03275 //-----------------------------------------------------------------------
03276 //      Function:               CreateParamQuery
03277 //-----------------------------------------------------------------------
03278
03279 void  PASCAL CreateParamQuery(QTSTRUCT *lpqt, FIELDINFO *rgFields,UWORD cTypes)
03280 {
03281   RETCODE rc=SQL_SUCCESS;
03282   UWORD           i;
03283   LPTSTR  pch=NULL;
03284   TCHAR           szQuery[MAX_QUERY_SIZE];
03285   static SDWORD  sdw = SQL_DATA_AT_EXEC;
03286   UWORD           w,
03287         ind;
03288
03289
03290   wsprintf(szQuery,TEXT("select %s from %s where "), lpqt->szColNames,lpqt->szTableName);
03291
03292
03293   for(i = 0, w = 0,ind=0; i < cTypes; i++)
03294     {
03295     pch = qtMakeData(ind, i,&rgFields[i], lpqt->szDataItem);
03296
03297     if ((rgFields[i].fSearchable == SQL_SEARCHABLE ||
03298       rgFields[i].fSearchable == SQL_ALL_EXCEPT_LIKE) &&
03299       pch && *pch)
03300     {
03301       w++;
03302
03303       switch(rgFields[i].wSQLType)
03304       {
03305         case SQL_REAL:
03306         case SQL_FLOAT:
03307         case SQL_DOUBLE:
03308           wsprintf(&szQuery[_tcslen(szQuery)],TEXT("%s < ? + 1 and "),
03309             rgFields[i].szFieldName);
03310           break;
03311         default:
03312           wsprintf(&szQuery[_tcslen(szQuery)],TEXT("%s = ? and "),
03313             rgFields[i].szFieldName);
03314       }
03315
03316       if(!fBindParameter)
03317       {
03318         rc = SQLSetParam(hstmt, w,
03319           SQL_C_TCHAR, rgFields[i].wSQLType,
03320           rgFields[i].precision, rgFields[i].scale,
03321           (LPTSTR)(UDWORD)i, &sdw);
03322         RETCHECK(SQL_SUCCESS, rc,szSQLSETPARAM);
03323       }
03324       else
03325       {
03326         rc = SQLBindParameter(hstmt, w, SQL_PARAM_INPUT,
03327           SQL_C_TCHAR, rgFields[i].wSQLType,
03328           rgFields[i].precision, rgFields[i].scale,
03329           (LPTSTR)((UDWORD)i+BIND_PARM_OFFSET), 0, &sdw);
03330         RETCHECK(SQL_SUCCESS, rc,szSQLBINDPARAMETER);
03331       }
03332
03333       ind++;
03334     }
03335   }
03336
03337   if (_tcsstr(szQuery,TEXT("and")))
03338   {
03339     /* remove the final "and " */
03340     szQuery[_tcslen(szQuery) - 5] = TEXT('\0');
03341   }
03342
03343   _tcscpy(lpqt->szParamQuery, szQuery);
03344
03345 }
03346
03347 //-----------------------------------------------------------------------
03348 //      Function:               TestSearchedQuery
03349 //-----------------------------------------------------------------------
03350
03351 void  PASCAL TestSearchedQuery(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,
03352   UWORD cTypes,DSTRUCT  *lpd,BOOL fBindParameter)
03353 {
03354   RETCODE rc=SQL_SUCCESS;
03355   UWORD           i;
03356   LPTSTR          pch=NULL;
03357   SDWORD  sdw;
03358   UWORD           w;
03359   UDWORD  udw;
03360   UWORD           ind;
03361
03362
03363   wsprintf(lpqt->sz, TEXT("select %s from %s where "), lpqt->szColNames,
03364     lpqt->szTableName);
03365
03366     sdw = SQL_DATA_AT_EXEC;
03367
03368   for(i = 0, w = 0,ind=0; i < cTypes; i++)
03369     {
03370     pch = qtMakeData(ind, i,&rgFields[i], lpqt->szDataItem);
03371
03372     if ((rgFields[i].fSearchable == SQL_SEARCHABLE ||
03373       rgFields[i].fSearchable == SQL_ALL_EXCEPT_LIKE) &&
03374       pch && *pch) {
03375       w++;
03376       switch(rgFields[i].wSQLType) {
03377         case SQL_REAL:
03378         case SQL_FLOAT:
03379         case SQL_DOUBLE:
03380           wsprintf(&lpqt->sz[_tcslen(lpqt->sz)], TEXT("%s < ? + 1 and "),
03381             rgFields[i].szFieldName);
03382           break;
03383         default:
03384           wsprintf(&lpqt->sz[_tcslen(lpqt->sz)], TEXT("%s = ? and "),
03385           rgFields[i].szFieldName);
03386       }
03387
03388       if(!fBindParameter){
03389         rc = SQLSetParam(hstmt, w,
03390           SQL_C_TCHAR, rgFields[i].wSQLType,
03391           rgFields[i].precision, rgFields[i].scale,
03392           (LPTSTR)(UDWORD)i, &sdw);
03393         RETCHECK(SQL_SUCCESS, rc, szSQLSETPARAM);
03394         }
03395       else{
03396         rc = SQLBindParameter(hstmt, w, SQL_PARAM_INPUT,
03397           SQL_C_TCHAR, rgFields[i].wSQLType,
03398           rgFields[i].precision, rgFields[i].scale,
03399           (LPTSTR)((UDWORD)i+BIND_PARM_OFFSET), 0, &sdw);
03400         RETCHECK(SQL_SUCCESS, rc, szSQLBINDPARAMETER);
03401         }
03402
03403       ind++;
03404     }
03405   }
03406   /* remove the final "and " */
03407   lpqt->sz[_tcslen(lpqt->sz) - 5] = TEXT('\0');
03408   _tcscpy(lpqt->szParamQuery, lpqt->sz);
03409
03410   rc = SQLPrepare(hstmt, lpqt->sz, SQL_NTS);
03411   RETCHECK(SQL_SUCCESS, rc, szSQLPREPARE);
03412
03413   rc = SQLExecute(hstmt);
03414   RETCHECK(SQL_NEED_DATA, rc, szSQLEXECUTE);
03415
03416   udw = cTypes;
03417
03418   for(i = 0; ; i++)
03419     {
03420     rc = SQLParamData(hstmt, (PTR *)&udw);
03421     if(rc != SQL_NEED_DATA)
03422       break;
03423
03424     if(udw-BIND_PARM_OFFSET < cTypes)
03425       pch = qtMakeData(cTypes, i,&rgFields[udw-BIND_PARM_OFFSET], lpqt->szDataItem);
03426     else
03427       DISPLAYERROR(szSQLPARAMDATA, TEXT("invalid rgbValue"));
03428
03429     if(*pch)
03430       {
03431       udw = _tcslen(pch);
03432       rc = SQLPutData(hstmt, pch, (SDWORD)_tcslen(pch)*sizeof(SQLTCHAR));
03433       RETCHECK(SQL_SUCCESS, rc, szSQLPUTDATA);
03434       }
03435     else
03436       {
03437       rc = SQLPutData(hstmt, (LPTSTR)IGNORED, SQL_NULL_DATA);
03438       RETCHECK(SQL_SUCCESS, rc, szSQLPUTDATA);
03439       }
03440     }
03441
03442   RETCHECK(SQL_SUCCESS, rc, szSQLPARAMDATA);
03443
03444   for(i = 0;; i++)
03445     {
03446     rc = SQLFetch(hstmt);
03447
03448     if(rc != SQL_SUCCESS)
03449       break;
03450     }
03451
03452   RETCHECK(SQL_NO_DATA_FOUND, rc, szSQLFETCH);
03453
03454   /* should have gotten 1 row back */
03455
03456   if(i != 1)
03457     DISPLAYERROR(TEXT("Param/PutData"), TEXT("incorrect number of rows returned"));
03458
03459   FreeStmt(SQL_CLOSE);
03460   FreeStmt(SQL_RESET_PARAMS);
03461
03462 } //TestSearchedQuery()
03463
03464
03465
03466 //-----------------------------------------------------------------------
03467 //      Function:               TestLargeQuery
03468 //-----------------------------------------------------------------------
03469
03470 void  PASCAL TestLargeQuery(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,
03471   UWORD cTypes,DSTRUCT  *lpd)
03472 {
03473   RETCODE rc=SQL_SUCCESS;
03474   UWORD           ind=0,
03475         i;
03476   LPTSTR  pch=NULL;
03477   TCHAR           szQuery[2048];
03478
03479
03480   /* > 1K query */
03481   wsprintf(szQuery,TEXT("select %s from %s where "), lpqt->szColNames,
03482     lpqt->szTableName);
03483
03484   for(i = 0; i < cTypes; i++)
03485     {
03486     if (rgFields[i].fSearchable == SQL_SEARCHABLE ||
03487       rgFields[i].fSearchable == SQL_ALL_EXCEPT_LIKE)
03488       break;
03489     }
03490
03491   pch = qtMakeData(cTypes, 1, &rgFields[i], lpqt->szDataItem);
03492   while(_tcslen(szQuery) < 1024L)
03493     {
03494     int li=_tcslen(szQuery);
03495     switch(rgFields[i].wSQLType)
03496       {
03497       case SQL_REAL:
03498       case SQL_FLOAT:
03499       case SQL_DOUBLE:
03500         wsprintf(&szQuery[_tcslen(szQuery)],TEXT("%s < %s + 1 and "),
03501           rgFields[i].szFieldName, pch);
03502         break;
03503       default:
03504         wsprintf(&szQuery[_tcslen(szQuery)],TEXT("%s = %s%s%s and "),
03505         rgFields[i].szFieldName, rgFields[i].szPrefix, pch, rgFields[i].szSuffix);
03506         break;
03507       }
03508     }
03509
03510   /* remove the final "and " */
03511   szQuery[_tcslen(szQuery) - 5] = TEXT('\0');
03512
03513   rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
03514   RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
03515
03516   if (RC_SUCCESSFUL(rc))
03517     {
03518     for(i = 0;; i++)
03519       {
03520       rc = SQLFetch(hstmt);
03521
03522       if(rc != SQL_SUCCESS)
03523         break;
03524       }
03525
03526     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
03527
03528     /* should have gotten at least 1 row back */
03529
03530     if(i < 1)
03531       DISPLAYERROR(TEXT("> 1K query"),TEXT("incorrect number of rows returned"));
03532
03533     }
03534
03535   /* SQLFreeStmt with SQL_CLOSE to re-use the hstmt */
03536
03537   FreeStmt(SQL_CLOSE);
03538
03539 } //TestLargeQuery()
03540
03541
03542
03543 //-----------------------------------------------------------------------
03544 //      Function:               TestSQLTables
03545 //-----------------------------------------------------------------------
03546
03547 void  PASCAL TestSQLTables(QTSTRUCT  *lpqt)
03548 {
03549   RETCODE rc=SQL_SUCCESS;
03550   BOOL            fFoundTable=FALSE;
03551   UWORD           i;
03552
03553   /* this call may return many tables, as  */
03554   /* long as the one created earlier shows */
03555   /* up it will pass. */
03556
03557   rc = SQLTables(hstmt, NULL, 0, NULL, 0,TEXT("q%"),SQL_NTS,TEXT("'TABLE'"), SQL_NTS);
03558
03559   RETCHECK(SQL_SUCCESS, rc,szSQLTABLES);
03560
03561   for(i = 0;; i++)
03562     {
03563     rc = SQLFetch(hstmt);
03564     if(rc != SQL_SUCCESS)
03565       break;
03566
03567     /* column 3 is tablename */
03568     rc = SQLGetData(hstmt, 3, SQL_C_TCHAR, lpqt->sz, sizeof(lpqt->sz), NULL);
03569     RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA); /* should not overflow
03570       and return SQL_SUCCESS_WITH_INFO because the buffer is larger than the
03571       table name */
03572     fFoundTable += 0 == _tcsicmp(lpqt->sz, lpqt->szTableName);
03573     }
03574
03575   RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
03576
03577   if(1 != fFoundTable) {
03578     DISPLAYERROR(szSQLTABLES,TEXT("table not found"));
03579   }
03580
03581   FreeStmt(SQL_CLOSE);
03582
03583 } //TestSQLTables()
03584
03585
03586 //-----------------------------------------------------------------------
03587 //      Function:               TestSQLSpecialCols
03588 //-----------------------------------------------------------------------
03589
03590 void  PASCAL TestSQLSpecialCols(QTSTRUCT  *lpqt)
03591 {
03592   RETCODE rc=SQL_SUCCESS;
03593   UWORD           i;
03594
03595   rc = SQLSpecialColumns(hstmt, SQL_BEST_ROWID, NULL, 0, NULL, 0,
03596     lpqt->szTableName, (SWORD)(_tcslen(lpqt->szTableName)), SQL_SCOPE_TRANSACTION,
03597     SQL_NULLABLE);
03598   RETCHECK(SQL_SUCCESS, rc,szSQLSPECIALCOLUMNS);
03599
03600   for(i = 0;; i++)
03601     {
03602     rc = SQLFetch(hstmt);
03603     if(rc != SQL_SUCCESS)
03604       break;
03605     }
03606
03607   RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
03608
03609   FreeStmt(SQL_CLOSE);
03610
03611 } //TestSQLSpecialCols()
03612
03613
03614
03615
03616 //-----------------------------------------------------------------------
03617 //      Function:               VerifyIndex
03618 //-----------------------------------------------------------------------
03619
03620 void  PASCAL VerifyIndex(QTSTRUCT  *lpqt,UWORD fIndex)
03621 {
03622   RETCODE rc=SQL_SUCCESS;
03623   BOOL            fFoundTable=FALSE;
03624   UWORD           i;
03625   SDWORD  sdw;
03626
03627   rc = SQLStatistics(hstmt, NULL, 0, NULL, 0, lpqt->szTableName,
03628   SQL_NTS, SQL_INDEX_ALL, SQL_ENSURE);
03629   RETCHECK(SQL_SUCCESS, rc,TEXT("SQLStatistics"));
03630
03631   fFoundTable = 0;
03632   for(i = 0;; i++)
03633     {
03634     rc = SQLFetch(hstmt);
03635     if(rc != SQL_SUCCESS)
03636       break;
03637
03638     rc = SQLGetData(hstmt, 3, SQL_C_TCHAR, lpqt->sz, sizeof(lpqt->sz),
03639       &sdw);
03640     RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
03641     if (_tcsicmp(lpqt->sz, lpqt->szTableName) == 0)
03642       {
03643       rc = SQLGetData(hstmt, 6, SQL_C_TCHAR, lpqt->sz, sizeof(lpqt->sz),
03644         &sdw);
03645       RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
03646       fFoundTable += 0 == _tcsicmp(lpqt->sz, lpqt->szDataItem);
03647       }
03648     }
03649
03650   RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
03651
03652   if(1 != fFoundTable && fIndex)
03653     DISPLAYERROR(TEXT("SQLStatistics"),TEXT("index not returned"));
03654
03655   /* one row represents original table, the */
03656   /* other represents the index                           */
03657   if(i > 2 || i < 1)
03658     DISPLAYERROR(TEXT("SQLStatistics"),TEXT("too many rows"));
03659
03660   FreeStmt(SQL_CLOSE);
03661
03662 } //VerifyIndex()
03663
03664 //-----------------------------------------------------------------------
03665 //      Function:               TestSQLStatistics
03666 //-----------------------------------------------------------------------
03667
03668 BOOL  PASCAL TestSQLStatistics(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,
03669   UWORD cTypes,DSTRUCT  *lpd,UWORD fIndex)
03670 {
03671   RETCODE rc=SQL_SUCCESS;
03672   UWORD           i;
03673
03674   _tcscpy(lpqt->szDataItem, lpqt->szTableName);
03675   lpqt->szDataItem[0] = TEXT('i');
03676   for(i = 1; i < cTypes; i++)
03677     if(rgFields[i].wSQLType == SQL_INTEGER ||
03678       rgFields[i].wSQLType == SQL_SMALLINT)
03679       break;
03680   if(i == cTypes)
03681     i = 0;
03682
03683   _tcscpy(lpqt->buf, rgFields[i].szFieldName);
03684   wsprintf(lpqt->sz,TEXT("create unique index %s on %s (%s)"),
03685     lpqt->szDataItem, lpqt->szTableName, lpqt->buf);
03686
03687   rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
03688   if(fIndex < 1)
03689     /* if this is minimal grammar, don't count on indexes being available */
03690     fIndex = rc == SQL_SUCCESS;
03691   else
03692     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
03693
03694   VerifyIndex(lpqt,fIndex);
03695
03696   return(fIndex);
03697
03698 } //TestSQLStatistics()
03699
03700
03701 //----------------------------------------------------------------------
03702 //      Function:               TestLikeQuery
03703 //-----------------------------------------------------------------------
03704
03705 void  PASCAL TestLikeQuery(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,
03706   UWORD cTypes,DSTRUCT  *lpd)
03707 {
03708   RETCODE rc=SQL_SUCCESS;
03709   UWORD   i;
03710   SDWORD  cbValue=0;
03711
03712   for(i = 0; i < cTypes; i++)
03713     {
03714     if(rgFields[i].fSearchable == SQL_LIKE_ONLY ||
03715       rgFields[i].fSearchable == SQL_SEARCHABLE)
03716       {
03717       _tcscpy(lpqt->buf, rgFields[i].szFieldName);
03718       break;
03719       }
03720   }
03721
03722   if(i < cTypes)
03723     {
03724
03725     /* execute a query using like.  This query should return all records */
03726     /* this query should return all rows in the table                                                       */
03727
03728     wsprintf(lpqt->sz,TEXT("select * from %s where %s not like 'a'"), lpqt->szTableName,
03729       lpqt->buf, lpqt->buf);
03730     rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
03731     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
03732
03733     for(i = 0;; i++)
03734       {
03735       rc = SQLFetch(hstmt);
03736       if(rc != SQL_SUCCESS)
03737         break;
03738
03739       rc = SQLGetData(hstmt, 1, SQL_C_TCHAR, lpqt->sz, sizeof(lpqt->sz),
03740         &cbValue);
03741       if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
03742         RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
03743       }
03744
03745     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
03746
03747     if(i != cTypes)
03748       DISPLAYERROR(TEXT("'LIKE' query"),TEXT("incorrect number of result rows"));
03749
03750     }
03751
03752   FreeStmt(SQL_CLOSE);
03753
03754 } //TestLikeQuery()
03755
03756
03757 //-----------------------------------------------------------------------
03758 //      Function:               TestLikeQuery
03759 //-----------------------------------------------------------------------
03760
03761 void  PASCAL TestOJCap(QTSTRUCT  *lpqt)
03762 {
03763   RETCODE rc=SQL_SUCCESS;
03764   UDWORD  udw;
03765
03766   rc = SQLGetInfo(hdbc, (UWORD)SQL_OJ_CAPABILITIES, &udw, (SWORD)(sizeof(udw)), NULL);
03767   if(RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO))
03768   {
03769     udw &= ~(SQL_OJ_LEFT | SQL_OJ_RIGHT | SQL_OJ_FULL | SQL_OJ_NESTED       |
03770           SQL_OJ_NOT_ORDERED | SQL_OJ_INNER | SQL_OJ_ALL_COMPARISON_OPS);
03771     if(udw)
03772     {
03773       wsprintf(lpqt->buf,TEXT("Undefined flags return from SQLGetInfo(...SQL_OJ_CAPABILITIES...) = %lX"), udw);
03774       DISPLAYERROR(szSQLGETINFO, lpqt->buf);
03775     }
03776   }
03777
03778   rc = SQLGetInfo(hdbc, SQL_OUTER_JOINS, lpqt->buf, sizeof(lpqt->buf), NULL);
03779   if(RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO)){
03780     *lpqt->buf = toupper(*lpqt->buf);
03781     if((!_tcsnccmp(lpqt->buf,TEXT("Y"), 1)) && (!_tcsnccmp(lpqt->buf,TEXT("N"), 1)))
03782       DISPLAYERROR(szSQLGETINFO,TEXT("Driver returned an invalid value for SQLGetInfo(...SQL_OUTER_JOINS...).  The only valid values are \"Y\" and \"N\"."));
03783     }
03784
03785 } //TestOJCap()
03786
03787
03788 /*-----------------------------------------------------------------------
03789  *      Function:               TestExtendedFetch
03790  *-----------------------------------------------------------------------*/
03791
03792 void  PASCAL TestExtendedFetch(QTSTRUCT  *lpqt, FIELDINFO  *rgFields, UWORD cTypes)
03793 {
03794   RETCODE rc=SQL_SUCCESS;
03795   WORD            fLevel2 = FALSE;
03796   DWORD           dwLen=0;
03797   SWORD           fSqlType;
03798   SDWORD  cbValue=0;
03799   UWORD           iTableCol,row,iCol,uwRowSetSize;
03800   TCHAR           szQuery[MAX_STRING_SIZE], szColName[SMALLBUFF];
03801   TCHAR*  rgbValue;
03802   DSTRUCT*        rgData;
03803   DSTRUCT*        pDataBuf;
03804   BOOL            fCol0Bound=TRUE;
03805
03806   uwRowSetSize=5; /* Cinco seems like a good rowset size */
03807
03808   /* Only col which might not be bound but might not be AutoUpdateable is col 0 */
03809   if(!qtMakeData(0, 0, &rgFields[0], szQuery))
03810     fCol0Bound = FALSE;
03811
03812   SelectFromTable(lpqt);
03813
03814   rc = SQLBindCol(hstmt, 1, SQL_C_BINARY, lpqt->sz, MAX_BIND_ARRAY_ELEMENT,
03815     &cbValue);
03816   RETCHECK(SQL_SUCCESS, rc,szSQLBINDCOL);
03817
03818   if (!Supported(SQL_API_SQLEXTENDEDFETCH))
03819   {
03820     rc = SQLExtendedFetch(hstmt, SQL_FETCH_FIRST, IGNORED, NULL, NULL);
03821     if(!FindError(SQL_HANDLE_STMT,szIM001))
03822       DISPLAYERROR(szSQLEXTENDEDFETCH, szNotSupported);
03823     RETCHECK(SQL_ERROR, rc,szSQLEXTENDEDFETCH);
03824
03825     FreeStmt(SQL_CLOSE);
03826     return;
03827   }
03828
03829   rc = SQLGetStmtOption(hstmt,SQL_CURSOR_TYPE,&dwLen);
03830   RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTOPTION);
03831
03832   if(dwLen != SQL_CURSOR_FORWARD_ONLY)
03833     {
03834     rc = SQLExtendedFetch(hstmt, SQL_FETCH_FIRST, IGNORED, NULL, NULL);
03835     RETCHECK(SQL_SUCCESS, rc,szSQLEXTENDEDFETCH);
03836     }
03837   else
03838     {
03839     rc = SQLExtendedFetch(hstmt, SQL_FETCH_FIRST, IGNORED, NULL, NULL);
03840     RETCHECK(SQL_ERROR, rc,szSQLEXTENDEDFETCH);
03841     }
03842
03843   rc = SQLFreeStmt(hstmt, SQL_CLOSE);
03844   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03845
03846   rc = SQLFreeStmt(hstmt, SQL_UNBIND);
03847   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03848
03849   rc = SQLFreeStmt(hstmt, SQL_RESET_PARAMS);
03850   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03851
03852   /* Allocate an area for ExtendedFetch to take place */
03853   if (!(rgData = AllocateMemory(sizeof(DSTRUCT)*cTypes*uwRowSetSize))){
03854     DISPLAYERROR(szSQLEXTENDEDFETCH,TEXT("Insufficient Memory Available"));
03855     return;
03856   }
03857
03858   /* Allocate an area for test data */
03859   if (!(rgbValue = AllocateMemory(MAX_STRING_SIZE*sizeof(TCHAR)))){
03860     DISPLAYERROR(szSQLEXTENDEDFETCH,TEXT("Insufficient Memory Available"));
03861     ReleaseMemory(rgData);
03862     return;
03863   }
03864
03865   /* Get column for "order by" clause: */
03866   wsprintf(szQuery,TEXT("select %s from %s"),lpqt->szColNames, lpqt->szTableName);
03867   rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
03868   if((SQL_SUCCESS!=rc) && (SQL_SUCCESS_WITH_INFO!=rc)){
03869     RETCHECK(SQL_SUCCESS_WITH_INFO, rc, szSQLEXECDIRECT);
03870     goto abortxfetch;
03871   }
03872   iCol=0;
03873   do      {
03874     iCol++;
03875     rc=SQLDescribeCol(hstmt, iCol, szColName, SMALLBUFF,
03876       NULL, &fSqlType, NULL, NULL, NULL);
03877     RETCHECK(SQL_SUCCESS, rc,szSQLDESCRIBECOL);
03878   } while(fSqlType!=SQL_CHAR && iCol<=cTypes);
03879
03880   FreeStmt(SQL_CLOSE);
03881   if(iCol>cTypes){
03882     DISPLAYERROR(szSQLEXTENDEDFETCH, TEXT("\t\t\tSelect-order by  Failed"));
03883     goto abortxfetch;
03884   }
03885
03886   /* Set rowset size and set to row-wise binding:  */
03887   rc = SQLSetStmtOption(hstmt, SQL_ROWSET_SIZE, (UDWORD)uwRowSetSize);
03888   if (SQL_SUCCESS != rc){
03889     DISPLAYERROR(TEXT("ExtendedFetch...SQLSetStmtOption(Rowset_Size)"),
03890       TEXT("SQLSetStmtOption Failed"));
03891     GetErrors(henv, hdbc,hstmt);
03892   }
03893   rc = SQLSetStmtOption(hstmt, SQL_BIND_TYPE, (sizeof(DSTRUCT)*cTypes));
03894   if (SQL_SUCCESS != rc){
03895     DISPLAYERROR(TEXT("ExtendedFetch...SQLSetStmtOption(Bind_Type)"),
03896       TEXT("SQLSetStmtOption Failed"));
03897     GetErrors(henv, hdbc,hstmt);
03898   }
03899
03900   if(SQL_SUCCESS != SelectFromTableFetch(lpqt, szColName)){
03901     DISPLAYERROR(szSQLEXTENDEDFETCH, TEXT("\t\t\tSelect-order by  Failed"));
03902     goto abortxfetch;
03903   }
03904   if (!BindFetchColumns(lpqt, rgFields, cTypes, rgData)){
03905     DISPLAYERROR(szSQLEXTENDEDFETCH, szSQLBINDCOL);
03906     goto abortxfetch;
03907   }
03908   /* Fetch into allocated area rowset to be tested */
03909   rc = SQLExtendedFetch(hstmt, SQL_FETCH_NEXT, 1, NULL, NULL);
03910   if (SQL_SUCCESS != rc){
03911     RETCHECK(SQL_SUCCESS, rc,szSQLEXTENDEDFETCH);
03912     DISPLAYERROR(szSQLEXTENDEDFETCH, TEXT("Fetch Failed"));
03913     goto abortxfetch;
03914   }
03915
03916   rc = SQLFreeStmt(hstmt, SQL_CLOSE);
03917   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03918
03919   rc = SQLFreeStmt(hstmt, SQL_UNBIND);
03920   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
03921
03922   /* Set rowset size to "1" to test each row of rowset independently:  */
03923   rc = SQLSetStmtOption(hstmt, SQL_ROWSET_SIZE, (UDWORD)(1));
03924   if (SQL_SUCCESS != rc){
03925     DISPLAYERROR(TEXT("ExtendedFetch...SQLSetStmtOption(Rowset_Size)"),
03926       TEXT("SQLSetStmtOption Failed"));
03927     GetErrors(henv, hdbc,hstmt);
03928   }
03929
03930   /* Check data in all rows of rowset */
03931   if(SQL_SUCCESS != SelectFromTableFetch(lpqt, szColName)){
03932     DISPLAYERROR(szSQLEXTENDEDFETCH, TEXT("\t\t\tSelect-order by  Failed"));
03933     goto abortxfetch;
03934   }
03935
03936   // Need to change this loop if number of rows in table < uwRowSetSize
03937   for (row=0; row<uwRowSetSize; row++)
03938   {
03939     SWORD iResultSetCol=0;
03940     if (SQL_SUCCESS != (rc = SQLFetch(hstmt))){
03941       RETCHECK(SQL_SUCCESS, rc, szSQLFETCH);
03942       DISPLAYERROR(szSQLEXTENDEDFETCH, TEXT("Fetch Failed"));
03943       goto abortxfetch;
03944     }
03945
03946     pDataBuf=rgData+row*cTypes;
03947     for (iTableCol=0; iTableCol<cTypes; iTableCol++)
03948     {
03949       /* Ignore columns which aren't bound as they aren't in the result set */
03950       if((!iTableCol && !fCol0Bound) || rgFields[iTableCol].fAutoUpdate)
03951         continue;
03952
03953       iResultSetCol++;
03954       rc = SQLGetData(hstmt, iResultSetCol, SQL_C_TCHAR, rgbValue, MAX_STRING_SIZE*sizeof(TCHAR),
03955         &cbValue);
03956       if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
03957         RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
03958
03959       if(!CheckDataResults(row, iTableCol, &rgFields[iTableCol], pDataBuf,cbValue,rgbValue))
03960       {
03961         wsprintf(lpqt->buf, TEXT("Data Check Failed, Row %d, Table Col %d, DataType %d (%s)"),
03962           row, iTableCol, rgFields[iTableCol].wSQLType, rgFields[iTableCol].szFieldName) ;
03963         szWrite(lpqt->buf,FALSE);
03964         rgbValue[MAX_STRING_SIZE-1]=TEXT('\0');
03965         wsprintf(lpqt->buf, TEXT("Returned Data: (%s)"), rgbValue);
03966         DISPLAYERROR(TEXT("ExtendedFetch"),lpqt->buf);
03967         // goto abortxfetch;
03968       }
03969     }
03970   }
03971
03972 abortxfetch:
03973   FreeStmt(SQL_CLOSE);
03974   FreeStmt(SQL_UNBIND);
03975   ReleaseMemory(rgData);
03976   ReleaseMemory(rgbValue);
03977 } /* TestExtendedFetch() */
03978
03979
03980
03981
03982 /*------------------------------------------------------------------------------
03983  *      Function:       TestQuickRebind Feature
03984  *      Purpose:        To test this specific feature, not the function(s) using it.
03985  *      Synopsis:
03986  *      An area large enough for 12 rows of QRDSTRUCTs will be created. There will
03987  * be two rows of the result set per Rowset. Rowset 1 should be duplicated
03988  * in rows 0,1 and 3,4, while Rowset 2 should be duplicated in rows 6,7 and 9,10.
03989  * Thus, rows 0 and 3 will contain the first row of the result set, rows 1 and
03990  * 4 will contain the second row of the result set, etc.  Rows 2, 5, 8, and
03991  * 11 should have their preset condition of all zeroes remain unchanged.
03992  * ----------------------------------------------------------------------------*/
03993
03994 void  PASCAL TestQuickRebind(QTSTRUCT * lpqt, FIELDINFO  *rgFields, UWORD cTypes,
03995                     DSTRUCT  *lpd)
03996 {
03997   RETCODE rc;
03998   UWORD           row,iCol,iRowset,uwRowsetSize,iRowsetRow,iTableCol;
03999   UDWORD  udwRowSize;
04000   SWORD           fSqlType;
04001   SDWORD  sdwOffset;
04002   DSTRUCT *rgData, *pZeroRow;
04003   DSTRUCT *pCurrentRowData;
04004   TCHAR           szQuery[MAX_STRING_SIZE], szColName[SMALLBUFF];
04005   SDWORD  cbValue;
04006   TCHAR*  rgbValue=NULL;
04007   BOOL            fCol0Bound=TRUE;
04008
04009   udwRowSize = sizeof(DSTRUCT)*cTypes;
04010             /* cNumResSetCols is set in BuildInsertStmt() */
04011   uwRowsetSize = 5;/* uwRowsetSize rows per Rowset */
04012
04013   /* Only col which might not be bound but might not be AutoUpdateable is col 0 */
04014   if(!qtMakeData(0, 0, &rgFields[0], szQuery))
04015     fCol0Bound = FALSE;
04016
04017   /* Allocate an area for QuickRebind to take place */
04018   if (!(rgData = AllocateMemory(NUM_QUIKREBIND_ROWSETS*(uwRowsetSize+1)*udwRowSize) )){
04019     DISPLAYERROR(szQUICKREBIND,TEXT("\t\t\tInsufficient Memory Available"));
04020     return;
04021   }
04022
04023   /* Allocate an area for a row of zeroes to place between each Rowset. */
04024   if (!(pZeroRow = AllocateMemory(udwRowSize) )){
04025     DISPLAYERROR(szQUICKREBIND,TEXT("\t\t\tInsufficient Memory Available"));
04026     goto abortQuikRebind;
04027   }
04028
04029   /* Allocate an area for test data */
04030   if (!(rgbValue = AllocateMemory(MAX_STRING_SIZE * sizeof(SQLTCHAR)))){
04031     DISPLAYERROR(szSQLEXTENDEDFETCH,TEXT("Insufficient Memory Available"));
04032     goto abortQuikRebind;
04033   }
04034
04035   ResetHstmt(&hstmt);
04036
04037   /* Get column for "order by" clause: */
04038   wsprintf(szQuery,TEXT("select %s from %s"),lpqt->szColNames, lpqt->szTableName);
04039   rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
04040   if((SQL_SUCCESS!=rc) && (SQL_SUCCESS_WITH_INFO!=rc)){
04041     RETCHECK(SQL_SUCCESS_WITH_INFO, rc, szSQLEXECDIRECT);
04042     goto abortQuikRebind;
04043   }
04044   iCol=0;
04045   do      {
04046     iCol++;
04047     rc=SQLDescribeCol(hstmt, iCol, szColName, SMALLBUFF,
04048       NULL, &fSqlType, NULL, NULL, NULL);
04049     RETCHECK(SQL_SUCCESS, rc,szSQLDESCRIBECOL);
04050   } while(fSqlType!=SQL_CHAR && iCol<=cTypes);
04051
04052   FreeStmt(SQL_CLOSE);
04053   if(iCol>=cTypes){
04054     DISPLAYERROR(szQUICKREBIND, TEXT("\t\t\tSelect-order by  Failed"));
04055     goto abortQuikRebind;
04056   }
04057
04058   /* Set to row-wise binding and set Rowset size to uwRowsetSize:  */
04059   rc = SQLSetStmtAttr(hstmt,SQL_ATTR_ROW_BIND_TYPE,(PTR)udwRowSize,SQL_IS_INTEGER);
04060   if (SQL_SUCCESS != rc){
04061     _tcscpy(lpqt->buf,TEXT("\t\t\tQuick Rebind FAILED...SQLSetDescField(Bind_Type)"));
04062     szWrite(lpqt->buf, TRUE);
04063     goto abortQuikRebind;
04064   }
04065   rc = SQLSetStmtAttr(hstmt,SQL_ATTR_ROW_ARRAY_SIZE,(PTR)uwRowsetSize,SQL_IS_INTEGER);
04066   if (SQL_SUCCESS != rc){
04067       DISPLAYERROR(szQUICKREBIND,TEXT("\t\t\tSetStmtAttr(Rowset Size)"));
04068     goto abortQuikRebind;
04069   }
04070
04071   /* Define area storing Quikrebind offset value: */
04072   rc = SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_BIND_OFFSET_PTR, &sdwOffset, SQL_IS_POINTER);
04073   if (SQL_SUCCESS != rc){
04074     if(FindError(SQL_HANDLE_STMT,szHYC00)){
04075       _tcscpy(lpqt->buf,TEXT("\t\t\tQuickRebind Not Supported"));
04076       szWrite(lpqt->buf, TRUE);
04077       goto abortQuikRebind;
04078     }
04079     _tcscpy(lpqt->buf,TEXT("\t\t\tQuick Rebind FAILED...QuickRebind Not Functional"));
04080     szWrite(lpqt->buf, TRUE);
04081     goto abortQuikRebind;
04082   }
04083
04084   if(SQL_SUCCESS != SelectFromTableFetch(lpqt, szColName)){
04085     DISPLAYERROR(szQUICKREBIND, TEXT("\t\t\tSelect-order by  Failed"));
04086     goto abortQuikRebind;
04087   }
04088
04089   if (!BindFetchColumns(lpqt, rgFields, cTypes, rgData)){
04090     DISPLAYERROR(szQUICKREBIND,szSQLBINDCOL);
04091     goto abortQuikRebind;
04092   }
04093
04094   /* Test quick rebind feature with two pairs of Rowsets, all *
04095    * rowsets separated by a row of zeroes:                    */
04096   for (iRowset=0; iRowset<=1; iRowset++)
04097   {
04098     if(iRowset)
04099       if(SQL_SUCCESS != SelectFromTableFetch(lpqt, szColName)){
04100         DISPLAYERROR(szQUICKREBIND, TEXT("\t\t\tSelect-order by  Failed"));
04101         goto abortQuikRebind;
04102       }
04103
04104     /* Set offset value (to 0 or 1  * uwRowsetSize * udwRowSize) for 1st rowset */
04105     sdwOffset = iRowset*((1+uwRowsetSize)*udwRowSize);
04106
04107     /* Fetch rowset into desired area */
04108     rc = SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 1);
04109     if (SQL_SUCCESS != rc){
04110       ERRSHANDLE(SQL_HANDLE_STMT, hstmt, SQL_SUCCESS, rc, szSQLFETCHSCROLL);
04111       DISPLAYERROR(szQUICKREBIND,TEXT("Fetch Failed"));
04112       goto abortQuikRebind;
04113     }
04114
04115     /* Set offset value (to 2 or 3 * uwRowsetSize * udwRowSize) for 2nd rowset */
04116     sdwOffset = (iRowset+2)*(1+uwRowsetSize)*udwRowSize;
04117
04118     rc = SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 1);
04119     if (SQL_SUCCESS != rc){
04120       ERRSHANDLE(SQL_HANDLE_STMT, hstmt, SQL_SUCCESS, rc, szSQLFETCHSCROLL);
04121       DISPLAYERROR(szQUICKREBIND,TEXT("Fetch Failed"));
04122       goto abortQuikRebind;
04123     }
04124     FreeStmt(SQL_CLOSE);
04125   }
04126
04127   rc = SQLFreeStmt(hstmt, SQL_UNBIND);
04128   RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
04129
04130   rc = SQLSetStmtAttr(hstmt,SQL_ATTR_ROW_ARRAY_SIZE,(PTR)1,SQL_IS_INTEGER);
04131   if (SQL_SUCCESS != rc){
04132       DISPLAYERROR(szQUICKREBIND,TEXT("\t\t\tSetStmtAttr(Rowset Size)"));
04133     goto abortQuikRebind;
04134   }
04135
04136   /* Check stored values: */
04137   for (iRowset=0; iRowset<=1; iRowset++)
04138   {
04139     if(SQL_SUCCESS != SelectFromTableFetch(lpqt, szColName)){
04140       DISPLAYERROR(szQUICKREBIND, TEXT("\t\t\tSelect-order by  Failed"));
04141       goto abortQuikRebind;
04142     }
04143
04144     /* First Rowset starts either in Allocated Row 0 or 3 */
04145     iRowsetRow= iRowset*(1+uwRowsetSize);
04146     //for (row=0; row<NUM_QUIKREBIND_ROWSETS  ;row++,iRowsetRow++)
04147     for (row=0; row<(uwRowsetSize*2)  ;row++,iRowsetRow++)
04148     {
04149       UWORD iResultSetCol=0;
04150       if(row==uwRowsetSize)
04151         iRowsetRow+= 2+uwRowsetSize; /* Jump to 2nd Rowset */
04152
04153       /* Don't check data in "zero" row,      *
04154        * the spacer row between rowsets:      */
04155       if(iRowsetRow%(1+uwRowsetSize) == uwRowsetSize)
04156         continue;
04157
04158       /* Fetch next rowset */
04159       rc = SQLFetch(hstmt);
04160       if (SQL_SUCCESS != rc){
04161         ERRSHANDLE(SQL_HANDLE_STMT, hstmt, SQL_SUCCESS, rc, szSQLFETCH);
04162         DISPLAYERROR(szQUICKREBIND,TEXT("Fetch Failed"));
04163         goto abortQuikRebind;
04164       }
04165
04166       pCurrentRowData = rgData+iRowsetRow*cTypes;
04167       for(iTableCol=0; iTableCol<cTypes; iTableCol++)
04168       {
04169         /* Ignore columns which aren't bound as they aren't in the result set */
04170         if((!iTableCol && !fCol0Bound) || rgFields[iTableCol].fAutoUpdate)
04171           continue;
04172
04173         iResultSetCol++;
04174         rc = SQLGetData(hstmt, iResultSetCol, SQL_C_TCHAR, rgbValue, MAX_STRING_SIZE * sizeof(SQLTCHAR),
04175           &cbValue);
04176         if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
04177           RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
04178
04179         if(!CheckDataResults(row, iTableCol, &rgFields[iTableCol], pCurrentRowData,cbValue,rgbValue))
04180         {
04181           wsprintf(lpqt->buf, TEXT("Data Check Failed, Row %d, Table Col %d, DataType %d (%s)"),
04182             row, iTableCol, rgFields[iTableCol].wSQLType, rgFields[iTableCol].szFieldName) ;
04183           szWrite(lpqt->buf,FALSE);
04184           rgbValue[MAX_STRING_SIZE-1]=TEXT('\0');
04185           wsprintf(lpqt->buf, TEXT("Returned Data: (%s)"), rgbValue);
04186           DISPLAYERROR(szQUICKREBIND,lpqt->buf);
04187           goto abortQuikRebind;
04188         }
04189       }/* end for(iTableCol) */
04190     } /* end for(row)                         */
04191     FreeStmt(SQL_CLOSE);
04192   } /* end for (iRowset)  */
04193
04194   /* Check Unused memory areas:    */
04195   for (iRowsetRow=uwRowsetSize; iRowsetRow<NUM_QUIKREBIND_ROWSETS*(uwRowsetSize+1);  )
04196   {
04197     pCurrentRowData = rgData+iRowsetRow*cTypes;
04198     if(memcmp(pCurrentRowData, pZeroRow, udwRowSize))
04199       DISPLAYERROR(szQUICKREBIND,
04200           TEXT("Unused memory areas altered after Quick Rebind."));
04201     iRowsetRow+=(uwRowsetSize+1);
04202   }
04203
04204
04205 abortQuikRebind:
04206   ResetHstmt(&hstmt);
04207   if (rgbValue)
04208     ReleaseMemory(rgbValue);
04209   if (pZeroRow)
04210     ReleaseMemory(pZeroRow);
04211   ReleaseMemory(rgData);
04212
04213 } /* TestQuickRebind() */
04214
04215 //-----------------------------------------------------------------------
04216 //      Function:               TestSQLForeignKeys
04217 //-----------------------------------------------------------------------
04218
04219 void  PASCAL TestSQLForeignKeys(QTSTRUCT  *lpqt)
04220 {
04221   RETCODE rc=SQL_SUCCESS;
04222
04223   if (!Supported(SQL_API_SQLFOREIGNKEYS))
04224     {
04225     rc = SQLForeignKeys(hstmt, NULL, 0, NULL, 0, lpqt->szTableName,
04226       SQL_NTS, NULL, 0, NULL, 0, NULL, 0);
04227
04228     if(!FindError(SQL_HANDLE_STMT,szIM001))
04229       DISPLAYERROR(szSQLFOREIGNKEYS, szNotSupported);
04230     RETCHECK(SQL_ERROR, rc,szSQLFOREIGNKEYS);
04231     }
04232   else
04233     {
04234     rc = SQLForeignKeys(hstmt, NULL, 0, NULL, 0, lpqt->szTableName,
04235       SQL_NTS, NULL, 0, NULL, 0, NULL, 0);
04236
04237     RETCHECK(SQL_SUCCESS, rc,szSQLFOREIGNKEYS);
04238
04239     while(rc == SQL_SUCCESS)
04240       rc = SQLFetch(hstmt);
04241
04242     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
04243
04244     FreeStmt(SQL_CLOSE);
04245
04246     }
04247
04248 } //TestSQLForeignKeys()
04249
04250
04251 //-----------------------------------------------------------------------
04252 //      Function:               TestSQLBrowseConnect
04253 //-----------------------------------------------------------------------
04254
04255 void  PASCAL TestSQLBrowseConnect(lpSERVERINFO lpSI)
04256 {
04257   RETCODE rc=SQL_SUCCESS;
04258   UWORD           cMaxConnections=0;
04259   TCHAR           szBCString[40];
04260   TCHAR           szDSN[40];
04261   HDBC            hdbcb=NULL;
04262   SQLINTEGER    sdwCP;
04263
04264   AllocHdbc(&hdbcb);
04265
04266   rc = SQLGetInfo(hdbc, SQL_ACTIVE_CONNECTIONS, &cMaxConnections, sizeof(cMaxConnections), NULL);
04267   RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
04268
04269   rc = SQLGetEnvAttr(henv, SQL_ATTR_CONNECTION_POOLING, &sdwCP, SQL_IS_INTEGER, NULL);
04270   RETCHECK(SQL_SUCCESS, rc,szSQLGETENVATTR);
04271   if ( SQL_CP_OFF != sdwCP)
04272     {
04273       DISPLAYERROR(szSQLBROWSECONNECT, szBrowseNotSupported);
04274       return;
04275     }
04276
04277   if(cMaxConnections != 1)
04278     {
04279     _tcscpy(szBCString,TEXT("DSN="));
04280     _tcscat(szBCString, lpSI->szValidServer0);
04281
04282     if(lpSI->szValidServer0[0] == 0)
04283       {
04284       rc = SQLGetInfo(hdbc, SQL_DATA_SOURCE_NAME, szDSN, sizeof(szDSN), NULL);
04285       _tcscat(szBCString, szDSN);
04286       }
04287
04288     if(!Supported(SQL_API_SQLBROWSECONNECT))
04289       {
04290       HDBC thdbc=NULL;
04291
04292       rc = SQLBrowseConnect(hdbcb, szBCString, SQL_NTS, NULL, 0, NULL);
04293       thdbc = hdbc;
04294       hdbc = hdbcb;
04295       if(!FindError(SQL_HANDLE_DBC,szIM001))
04296         DISPLAYERROR(szSQLBROWSECONNECT, szNotSupported);
04297       RETCHECK(SQL_ERROR, rc,szSQLBROWSECONNECT);
04298       hdbc = thdbc;
04299
04300       rc = SQLFreeConnect(hdbcb);
04301       RETCHECK(SQL_SUCCESS, rc,szSQLFREECONNECT);
04302
04303       }
04304     else
04305       {
04306       rc = SQLBrowseConnect(hdbcb, szBCString, SQL_NTS, NULL, 0, NULL);
04307       RETCHECK(SQL_NEED_DATA, rc,szSQLBROWSECONNECT);
04308
04309       rc = SQLDisconnect(hdbcb);
04310       RETCHECK(SQL_SUCCESS, rc,szSQLDISCONNECT);
04311       rc = SQLFreeConnect(hdbcb);
04312       RETCHECK(SQL_SUCCESS, rc,szSQLFREECONNECT);
04313       }
04314     }
04315
04316 } //TestSQLBrowseConnect()
04317
04318
04319 //-----------------------------------------------------------------------
04320 //      Function:               TestSQLDataSources
04321 //-----------------------------------------------------------------------
04322
04323 void  PASCAL TestSQLDataSources()
04324 {
04325   RETCODE rc=SQL_SUCCESS;
04326
04327   if (!Supported( SQL_API_SQLDATASOURCES))
04328     {
04329     rc = SQLDataSources(henv, SQL_FETCH_FIRST, NULL, 0, NULL, NULL, 0, NULL);
04330
04331     if(!FindError(SQL_HANDLE_ENV,szIM001))
04332       DISPLAYERROR(TEXT("SQLDataSources"), szNotSupported);
04333
04334     RETCHECK(SQL_ERROR, rc,TEXT("SQLDataSources"));
04335     }
04336   else
04337     {
04338     rc = SQLDataSources(henv, SQL_FETCH_FIRST, NULL, 0, NULL, NULL, 0, NULL);
04339     RETCHECK(SQL_SUCCESS, rc,TEXT("SQLDataSources"));
04340     }
04341
04342 } //TestSQLDataSources()
04343
04344
04345 //-----------------------------------------------------------------------
04346 //      Function:               TestSQLDataSources
04347 //-----------------------------------------------------------------------
04348
04349 void  PASCAL TestSQLDrivers()
04350 {
04351   RETCODE rc=SQL_SUCCESS;
04352
04353   if(!Supported( SQL_API_SQLDRIVERS))
04354     {
04355     rc = SQLDrivers(henv, SQL_FETCH_FIRST, NULL, 0, NULL, NULL, 0, NULL);
04356     if(!FindError(SQL_HANDLE_ENV,szIM001))
04357       DISPLAYERROR(TEXT("SQLDrivers"), szNotSupported);
04358     RETCHECK(SQL_ERROR, rc,TEXT("SQLDataSources"));
04359     }
04360   else
04361     {
04362     rc = SQLDrivers(henv, SQL_FETCH_FIRST, NULL, 0, NULL, NULL, 0, NULL);
04363     if(rc != SQL_SUCCESS)
04364       RETCHECK(SQL_SUCCESS_WITH_INFO, rc,TEXT("SQLDrivers"));
04365     }
04366
04367 } //TestSQLDrivers()
04368
04369
04370 //-----------------------------------------------------------------------
04371 //      Function:               TestSQLMoreResults
04372 //-----------------------------------------------------------------------
04373
04374 void  PASCAL TestSQLMoreResults(QTSTRUCT  *lpqt)
04375 {
04376   RETCODE rc=SQL_SUCCESS;
04377
04378   if(!Supported( SQL_API_SQLMORERESULTS))
04379     {
04380     SelectFromTable(lpqt);
04381
04382     rc = SQLMoreResults(hstmt);
04383     if(!FindError(SQL_HANDLE_STMT,szIM001))
04384       DISPLAYERROR(TEXT("SQLMoreResults"), szNotSupported);
04385     RETCHECK(SQL_ERROR, rc,TEXT("SQLMoreResults"));
04386     }
04387   else
04388     {
04389     SelectFromTable(lpqt);
04390
04391     rc = SQLMoreResults(hstmt);
04392     RETCHECK(SQL_NO_DATA_FOUND, rc,TEXT("SQLMoreResults"));
04393     }
04394
04395   FreeStmt(SQL_CLOSE);
04396
04397 } //TestSQLMoreResults()
04398
04399
04400 //-----------------------------------------------------------------------
04401 //      Function:               TestSQLMoreResults
04402 //-----------------------------------------------------------------------
04403
04404 void  PASCAL TestSQLNativeSQL(QTSTRUCT  *lpqt)
04405 {
04406   RETCODE rc=SQL_SUCCESS;
04407   TCHAR           szQuery[XLARGEBUFF];
04408
04409   wsprintf(szQuery,TEXT("select * from %s were 0 > 1"),lpqt->szTableName);
04410
04411   if(!Supported( SQL_API_SQLNATIVESQL))
04412     {
04413     rc = SQLNativeSql(hdbc, szQuery, SQL_NTS, NULL, 0, NULL);
04414     if(!FindError(SQL_HANDLE_DBC,szIM001))
04415       DISPLAYERROR(TEXT("SQLNativeSql"), szNotSupported);
04416     RETCHECK(SQL_ERROR, rc,TEXT("SQLNativeSql"));
04417     }
04418   else
04419     {
04420     rc = SQLNativeSql(hdbc, szQuery, SQL_NTS, NULL, 0, NULL);
04421     RETCHECK(SQL_SUCCESS, rc,TEXT("SQLNativeSql"));
04422     }
04423
04424   FreeStmt(SQL_CLOSE);
04425
04426 } //TestSQLNativeSQL()
04427
04428
04429 //-----------------------------------------------------------------------
04430 //      Function:               TestSQLDescribeParam
04431 //-----------------------------------------------------------------------
04432
04433 void  PASCAL TestSQLDescribeParam(QTSTRUCT  *lpqt)
04434 {
04435   RETCODE rc=SQL_SUCCESS;
04436
04437   rc = SQLPrepare(hstmt, lpqt->szParamQuery, SQL_NTS);
04438   RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE);
04439
04440   if(!Supported( SQL_API_SQLDESCRIBEPARAM))
04441     {
04442     rc = SQLPrepare(hstmt, lpqt->szParamQuery, SQL_NTS);
04443     RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE);
04444     rc = SQLDescribeParam(hstmt, 1, NULL, NULL, NULL, NULL);
04445     if(!FindError(SQL_HANDLE_STMT,szIM001))
04446       DISPLAYERROR(szSQLDESCRIBEPARAM, szNotSupported);
04447     RETCHECK(SQL_ERROR, rc,szSQLDESCRIBEPARAM);
04448     }
04449   else
04450     {
04451     rc = SQLPrepare(hstmt, lpqt->szParamQuery, SQL_NTS);
04452     RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE);
04453     rc = SQLDescribeParam(hstmt, 1, NULL, NULL, NULL, NULL);
04454     RETCHECK(SQL_SUCCESS, rc,szSQLDESCRIBEPARAM);
04455     }
04456
04457     FreeStmt(SQL_CLOSE);
04458
04459 } //TestSQLDescribeParam()
04460
04461
04462
04463 //-----------------------------------------------------------------------
04464 //      Function:               TestSQLNumParams
04465 //-----------------------------------------------------------------------
04466
04467 void  PASCAL TestSQLNumParams(QTSTRUCT  *lpqt)
04468 {
04469   RETCODE rc=SQL_SUCCESS;
04470
04471   rc = SQLPrepare(hstmt, lpqt->szParamQuery, SQL_NTS);
04472   RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE);
04473
04474   if(!Supported( SQL_API_SQLNUMPARAMS))
04475     {
04476     rc = SQLNumParams(hstmt, NULL);
04477     if(!FindError(SQL_HANDLE_STMT,szIM001))
04478       DISPLAYERROR(szSQLNUMPARAMS, szNotSupported);
04479     RETCHECK(SQL_ERROR, rc,szSQLNUMPARAMS);
04480     }
04481   else
04482     {
04483     rc = SQLNumParams(hstmt, NULL);
04484     RETCHECK(SQL_SUCCESS, rc,szSQLNUMPARAMS);
04485     }
04486
04487   FreeStmt(SQL_CLOSE);
04488
04489 } //TestSQLNumParams()
04490
04491
04492
04493
04494
04495 //-----------------------------------------------------------------------
04496 //      Function:               TestSQLParamOptions
04497 //-----------------------------------------------------------------------
04498
04499 void  PASCAL TestSQLParamOptions(QTSTRUCT *lpqt)
04500 {
04501   RETCODE rc=SQL_SUCCESS;
04502
04503   rc = SQLPrepare(hstmt, lpqt->szParamQuery, SQL_NTS);
04504   RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE);
04505
04506   if(!Supported( SQL_API_SQLPARAMOPTIONS))
04507     {
04508     rc = SQLParamOptions(hstmt, 1, NULL);
04509     if(!FindError(SQL_HANDLE_STMT,szIM001))
04510       DISPLAYERROR(szSQLPARAMOPTIONS, szNotSupported);
04511     RETCHECK(SQL_ERROR, rc,szSQLPARAMOPTIONS);
04512     }
04513   else
04514     {
04515     rc = SQLParamOptions(hstmt, 1, NULL);
04516     RETCHECK(SQL_SUCCESS, rc,szSQLPARAMOPTIONS);
04517     }
04518
04519   FreeStmt(SQL_CLOSE);
04520
04521 } //TestSQLParamOptions()
04522
04523
04524
04525
04526 //-----------------------------------------------------------------------
04527 //      Function:               TestSQLPrimaryKeys
04528 //-----------------------------------------------------------------------
04529
04530 void  PASCAL TestSQLPrimaryKeys(QTSTRUCT *lpqt)
04531 {
04532   RETCODE rc=SQL_SUCCESS;
04533
04534   if (!Supported( SQL_API_SQLPRIMARYKEYS))
04535     {
04536     rc = SQLPrimaryKeys(hstmt, NULL, 0, NULL, 0, lpqt->szTableName, SQL_NTS);
04537     if(!FindError(SQL_HANDLE_STMT,szIM001))
04538       DISPLAYERROR(szSQLPRIMARYKEYS, szNotSupported);
04539     RETCHECK(SQL_ERROR, rc,szSQLPRIMARYKEYS);
04540     }
04541   else
04542     {
04543     rc = SQLPrimaryKeys(hstmt, NULL, 0, NULL, 0, lpqt->szTableName, SQL_NTS);
04544     RETCHECK(SQL_SUCCESS, rc,szSQLPRIMARYKEYS);
04545     while(rc == SQL_SUCCESS)
04546       rc = SQLFetch(hstmt);
04547
04548     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
04549
04550     FreeStmt(SQL_CLOSE);
04551
04552     }
04553
04554 } //TestSQLPrimaryKeys()
04555
04556
04557
04558 //-----------------------------------------------------------------------
04559 //      Function:               TestSQLProcedureColumns
04560 //-----------------------------------------------------------------------
04561
04562 void  PASCAL TestSQLProcedureColumns(QTSTRUCT  *lpqt)
04563 {
04564   RETCODE rc=SQL_SUCCESS;
04565
04566   if(!Supported( SQL_API_SQLPROCEDURECOLUMNS))
04567     {
04568     rc = SQLProcedureColumns(hstmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0);
04569     if(!FindError(SQL_HANDLE_STMT,szIM001))
04570       DISPLAYERROR(TEXT("SQLProcedureColumns"), szNotSupported);
04571     RETCHECK(SQL_ERROR, rc,TEXT("SQLProcedureColumns"));
04572     }
04573   else
04574     {
04575     rc = SQLProcedureColumns(hstmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0);
04576     RETCHECK(SQL_SUCCESS, rc,TEXT("SQLProcedureColumns"));
04577     while(rc == SQL_SUCCESS)
04578       rc = SQLFetch(hstmt);
04579
04580     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
04581
04582     FreeStmt(SQL_CLOSE);
04583     }
04584
04585 } //TestSQLProcedureColumns()
04586
04587
04588
04589 //-----------------------------------------------------------------------
04590 //      Function:               TestSQLProcedures
04591 //-----------------------------------------------------------------------
04592
04593 void  PASCAL TestSQLProcedures()
04594 {
04595   RETCODE rc=SQL_SUCCESS;
04596
04597   if(!Supported( SQL_API_SQLPROCEDURES))
04598     {
04599     rc = SQLProcedures(hstmt, NULL, 0, NULL, 0, NULL, 0);
04600     if(!FindError(SQL_HANDLE_STMT,szIM001))
04601       DISPLAYERROR(TEXT("SQLProcedures"), szNotSupported);
04602     RETCHECK(SQL_ERROR, rc,TEXT("SQLProcedures"));
04603     }
04604   else
04605     {
04606     rc = SQLProcedures(hstmt, NULL, 0, NULL, 0, NULL, 0);
04607     RETCHECK(SQL_SUCCESS, rc,TEXT("SQLProcedures"));
04608     while(rc == SQL_SUCCESS)
04609       rc = SQLFetch(hstmt);
04610     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
04611
04612     FreeStmt(SQL_CLOSE);
04613     }
04614
04615 } //TestSQLProcedures()
04616
04617
04618 //-----------------------------------------------------------------------
04619 //      Function:               TestSQLTablePrivileges
04620 //-----------------------------------------------------------------------
04621
04622 void  PASCAL TestSQLTablePrivileges()
04623 {
04624   RETCODE rc=SQL_SUCCESS;
04625
04626   if(!Supported( SQL_API_SQLTABLEPRIVILEGES))
04627     {
04628     rc = SQLTablePrivileges(hstmt, NULL, 0, NULL, 0, NULL, 0);
04629     if(!FindError(SQL_HANDLE_STMT,szIM001))
04630       DISPLAYERROR(TEXT("SQLTablePrivileges"), szNotSupported);
04631     RETCHECK(SQL_ERROR, rc,TEXT("SQLTablePrivileges"));
04632     }
04633   else
04634     {
04635     rc = SQLTablePrivileges(hstmt, NULL, 0, NULL, 0, NULL, 0);
04636     RETCHECK(SQL_SUCCESS, rc,TEXT("SQLTablePrivileges"));
04637     while(rc == SQL_SUCCESS)
04638       rc = SQLFetch(hstmt);
04639
04640     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
04641
04642     FreeStmt(SQL_CLOSE);
04643     }
04644
04645 } //TestSQLTablePrivileges()
04646
04647
04648
04649 //-----------------------------------------------------------------------
04650 //      Function:               TestSQLColumnPrivileges
04651 //-----------------------------------------------------------------------
04652
04653 void  PASCAL TestSQLColumnPrivileges(QTSTRUCT  *lpqt)
04654 {
04655   RETCODE rc=SQL_SUCCESS;
04656
04657   if(!Supported( SQL_API_SQLCOLUMNPRIVILEGES))
04658     {
04659     rc = SQLColumnPrivileges(hstmt, NULL, 0, NULL, 0, lpqt->szTableName, SQL_NTS,
04660       NULL, 0);
04661     if(!FindError(SQL_HANDLE_STMT,szIM001))
04662       DISPLAYERROR(TEXT("SQLColummPrivileges"), szNotSupported);
04663     RETCHECK(SQL_ERROR, rc,TEXT("SQLColumnPrivileges"));
04664     }
04665   else
04666     {
04667     rc = SQLColumnPrivileges(hstmt, NULL, 0, NULL, 0, lpqt->szTableName, SQL_NTS,
04668       NULL, 0);
04669     RETCHECK(SQL_SUCCESS, rc,TEXT("SQLColumnPrivileges"));
04670     while(rc == SQL_SUCCESS)
04671       rc = SQLFetch(hstmt);
04672
04673     RETCHECK(SQL_NO_DATA_FOUND, rc,szSQLFETCH);
04674
04675     FreeStmt(SQL_CLOSE);
04676     }
04677
04678 } // TestSQLColumnPrivileges()
04679
04680
04681 //-----------------------------------------------------------------------
04682 //      Function:               TestSQLSetScrollOptions
04683 //-----------------------------------------------------------------------
04684
04685 void  PASCAL TestSQLSetScrollOptions()
04686 {
04687   RETCODE rc=SQL_SUCCESS;
04688   UWORD           i,
04689         j;
04690   UDWORD  fSupportedOpt;
04691   UDWORD  fSupportedCon;
04692   TCHAR           szState[100]=TEXT(""),
04693         szErrMsg[XLARGEBUFF]=TEXT("");
04694
04695   FreeStmt(SQL_CLOSE);
04696
04697   if(!Supported( SQL_API_SQLSETSCROLLOPTIONS))
04698     {
04699     rc = SQLSetScrollOptions(hstmt, SQL_CONCUR_READ_ONLY, SQL_SCROLL_FORWARD_ONLY,
04700       1);
04701     if(!FindError(SQL_HANDLE_STMT,szIM001))
04702       DISPLAYERROR(szSQLSETSCROLLOPTIONS, szNotSupported);
04703     RETCHECK(SQL_ERROR, rc,szSQLSETSCROLLOPTIONS);
04704     }
04705   else
04706     {
04707     rc = SQLGetInfo(hdbc, SQL_SCROLL_CONCURRENCY, &fSupportedCon, 4, NULL);
04708     RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
04709     rc = SQLGetInfo(hdbc, SQL_SCROLL_OPTIONS, &fSupportedOpt, 4, NULL);
04710     RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
04711
04712     for(i = 0; i < sizeof(OptionList) / sizeof(SUPPORTOPTINFO); i ++)
04713       {
04714       for(j = 0; j < sizeof(ConcurList) / sizeof(SUPPORTCONCURINFO); j++)
04715         {
04716         if(fSupportedOpt & OptionList[i].Support && fSupportedCon & ConcurList[j].Support)
04717           {
04718           if(!((ConcurList[j].Option == SQL_CONCUR_VALUES) && ((lpSI->vCursorLib ==
04719               SQL_CUR_USE_IF_NEEDED) || (lpSI->vCursorLib == SQL_CUR_USE_ODBC))))
04720             {
04721             rc = SQLSetScrollOptions(hstmt, ConcurList[j].Option,OptionList[i].Option, 1);
04722             RETCHECK(SQL_SUCCESS, rc,szSQLSETSCROLLOPTIONS);
04723             }
04724
04725           }
04726         }
04727       }
04728     }
04729
04730   FreeStmt(SQL_CLOSE);
04731
04732   // Set the Cursor back to READ_ONLY, FORWARD_ONLY, 1
04733   rc = SQLSetScrollOptions(hstmt,SQL_CONCUR_READ_ONLY,SQL_SCROLL_FORWARD_ONLY,1);
04734
04735 } //TestSQLSetScrollOptions()
04736
04737
04738 //-----------------------------------------------------------------------------
04739 //      Function:  TestConnectAttr
04740 //-----------------------------------------------------------------------------
04741
04742 VOID PASCAL TestConnectAttr(HDBC hdbc,SDWORD fAttribute, UDWORD rgbValue,LPTSTR lpAttr,BOOL fReadOnlyAttr)
04743 {
04744   RETCODE rc=SQL_SUCCESS;
04745   TCHAR           szBuff[LARGEBUFF]=TEXT("");
04746   UDWORD  pvParam=0;
04747   RETCODE rcExp=fReadOnlyAttr ? SQL_ERROR : SQL_SUCCESS;
04748
04749   rc = SQLSetConnectAttr(hdbc,fAttribute,(PTR)rgbValue,sizeof(rgbValue));
04750
04751   if(!FindError(SQL_HANDLE_DBC,szHYC00))
04752   {
04753
04754     RETCHECK(rcExp,rc,szSQLSETCONNECTATTR);
04755
04756     rc = SQLGetConnectAttr(hdbc,fAttribute,&pvParam,sizeof(pvParam),NULL);
04757
04758     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04759     {
04760       RETCHECK(SQL_SUCCESS,rc,szSQLGETCONNECTATTR);
04761
04762       if(!fReadOnlyAttr && (pvParam != rgbValue))
04763       {
04764         wsprintf(szBuff,TEXT("%s returned incorrect value"),lpAttr);
04765         DISPLAYERROR(szSQLGETCONNECTATTR,szBuff);
04766       }
04767     }
04768     else
04769       RETCHECK(SQL_ERROR,rc,szSQLGETCONNECTATTR);
04770   }
04771   else
04772     RETCHECK(SQL_ERROR,rc,szSQLSETCONNECTATTR);
04773
04774 } //TestConnectAttr()
04775
04776
04777 //-----------------------------------------------------------------------------
04778 //      Function:  TestSQLSetConnectAttr
04779 //                 This function tests both SQLSetConnectAttr and SQLGetConnectAttr
04780 //-----------------------------------------------------------------------------
04781
04782 void  PASCAL TestSQLSetConnectAttr()
04783 {
04784   RETCODE rc = SQL_SUCCESS;
04785   UDWORD  pvParam;
04786   UWORD   rgbValue;
04787   BOOL    fSupportSetConnectAttr = TRUE;
04788   BOOL    fSupportGetConnectAttr = TRUE;
04789
04790   //make sure these APIs are supported before testing
04791   if(!Supported(SQL_API_SQLSETCONNECTATTR))
04792     {
04793     rgbValue = SQL_MODE_READ_WRITE;
04794     fSupportSetConnectAttr = FALSE;
04795     rc = SQLSetConnectAttr(hdbc,SQL_ACCESS_MODE,&rgbValue,sizeof(rgbValue));
04796     if(!FindError(SQL_HANDLE_DBC,szIM001))
04797       DISPLAYERROR(szSQLSETCONNECTATTR,TEXT("did not return Not supported message"));
04798     RETCHECK(SQL_ERROR,rc,szSQLSETCONNECTATTR);
04799     }
04800
04801   if(!Supported(SQL_API_SQLGETCONNECTATTR))
04802     {
04803     fSupportGetConnectAttr = FALSE;
04804     rc = SQLGetConnectAttr(hdbc,SQL_ACCESS_MODE,&pvParam,sizeof(pvParam),NULL);
04805     if(!FindError(SQL_HANDLE_DBC,szIM001))
04806       DISPLAYERROR(szSQLGETCONNECTATTR,TEXT("did not return Not supported message"));
04807     RETCHECK(SQL_ERROR,rc,szSQLGETCONNECTATTR);
04808     }
04809
04810   if(fSupportSetConnectAttr && (!fSupportGetConnectAttr))
04811     {
04812     //test SQL_ACCESS_MODE
04813     rgbValue = SQL_MODE_READ_WRITE;
04814     rc = SQLSetConnectAttr(hdbc,SQL_ACCESS_MODE,&rgbValue,sizeof(rgbValue));
04815     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04816       RETCHECK(SQL_SUCCESS,rc,szSQLSETCONNECTATTR);
04817     else
04818       RETCHECK(SQL_ERROR,rc,szSQLSETCONNECTATTR);
04819     //test SQL_AUTOCOMMIT
04820     rgbValue = SQL_AUTOCOMMIT_ON;
04821     rc = SQLSetConnectAttr(hdbc,SQL_AUTOCOMMIT,&rgbValue,sizeof(rgbValue));
04822     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04823       RETCHECK(SQL_SUCCESS,rc,szSQLSETCONNECTATTR);
04824     else
04825       RETCHECK(SQL_ERROR,rc,szSQLSETCONNECTATTR);
04826     //test SQL_LOGIN_TIMEOUT
04827     //the choice of 15 seconds for timeout is arbitrary
04828     rgbValue = 15;
04829     rc = SQLSetConnectAttr(hdbc,SQL_LOGIN_TIMEOUT,&rgbValue,sizeof(rgbValue));
04830     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04831       RETCHECK(SQL_SUCCESS,rc,szSQLSETCONNECTATTR);
04832     else
04833       RETCHECK(SQL_ERROR,rc,szSQLSETCONNECTATTR);
04834     }
04835
04836   if((!fSupportSetConnectAttr) && fSupportGetConnectAttr)
04837   {
04838     //test SQL_ACCESS_MODE
04839     rc = SQLGetConnectAttr(hdbc,SQL_ACCESS_MODE,&pvParam,sizeof(pvParam),NULL);
04840     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04841       RETCHECK(SQL_SUCCESS,rc,szSQLGETCONNECTATTR);
04842     else
04843       RETCHECK(SQL_ERROR,rc,szSQLGETCONNECTATTR);
04844     //test SQL_AUTOCOMMIT
04845     rc = SQLGetConnectAttr(hdbc,SQL_AUTOCOMMIT,&pvParam,sizeof(pvParam),NULL);
04846     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04847       RETCHECK(SQL_SUCCESS,rc,szSQLGETCONNECTATTR);
04848     else
04849       RETCHECK(SQL_ERROR,rc,szSQLGETCONNECTATTR);
04850     //test SQL_LOGIN_TIMEOUT
04851     rc = SQLGetConnectAttr(hdbc,SQL_LOGIN_TIMEOUT,&pvParam,sizeof(pvParam),NULL);
04852     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04853       RETCHECK(SQL_SUCCESS,rc,szSQLGETCONNECTATTR);
04854     else
04855       RETCHECK(SQL_ERROR,rc,szSQLGETCONNECTATTR);
04856     //SQL_ATTR_AUTO_IPD is a read-only attribute
04857     rc = SQLGetConnectAttr(hdbc,SQL_ATTR_AUTO_IPD,&pvParam,sizeof(pvParam),NULL);
04858     if(!FindError(SQL_HANDLE_DBC,szHYC00))
04859       RETCHECK(SQL_SUCCESS,rc,szSQLGETCONNECTATTR);
04860     else
04861       RETCHECK(SQL_ERROR,rc,szSQLGETCONNECTATTR);
04862   }
04863
04864   if(fSupportSetConnectAttr && fSupportGetConnectAttr)
04865   {
04866
04867     //test SQL_ACCESS_MODE
04868     TestConnectAttr(hdbc,SQL_ACCESS_MODE,SQL_MODE_READ_WRITE,TEXT("SQL_ACCESS_MODE"),FALSE);
04869
04870     //test SQL_AUTOCOMMIT
04871     TestConnectAttr(hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_ON,TEXT("SQL_AUTOCOMMIT"),FALSE);
04872
04873     //test SQL_LOGIN_TIMEOUT
04874     //the choice of 15 seconds for timeout is arbitrary
04875     TestConnectAttr(hdbc,SQL_LOGIN_TIMEOUT,15,TEXT("SQL_LOGIN_TIMEOUT"),FALSE);
04876
04877     //SQL_ATTR_AUTO_IPD is a read-only attribute
04878     TestConnectAttr(hdbc,SQL_ATTR_AUTO_IPD,15,TEXT("SQL_ATTR_AUTO_IPD"),TRUE);
04879   }
04880
04881 } //TestSQLSetConnectAttr()
04882
04883
04884
04885 //-----------------------------------------------------------------------------
04886 //      Function:  TestSQLSetStmtAttr
04887 //                 This function tests both SQLSetStmtAttr and SQLGetStmtAttr
04888 //-----------------------------------------------------------------------------
04889
04890 void  PASCAL TestSQLSetStmtAttr()
04891 {
04892   RETCODE rc = SQL_SUCCESS, rc2= SQL_SUCCESS;
04893   UDWORD  pvParam;
04894   UWORD   rgbValue;
04895   BOOL    fSupportSetStmtAttr = TRUE;
04896   BOOL    fSupportGetStmtAttr = TRUE;
04897
04898   //make sure these APIs are supported before testing
04899   if(!Supported(SQL_API_SQLSETSTMTATTR))
04900     {
04901     //the choice of 300 for SQL_MAX_LENGTH is arbitrary
04902     rgbValue = 300;
04903     fSupportSetStmtAttr = FALSE;
04904     rc = SQLSetStmtAttr(hstmt,SQL_MAX_LENGTH,&rgbValue,sizeof(rgbValue));
04905     if(!FindError(SQL_HANDLE_STMT,szIM001))
04906       DISPLAYERROR(szSQLSETSTMTATTR,TEXT("did not return Not supported message"));
04907     RETCHECK(SQL_ERROR,rc,szSQLSETSTMTATTR);
04908     }
04909
04910   if(!Supported(SQL_API_SQLGETSTMTATTR))
04911     {
04912     fSupportGetStmtAttr = FALSE;
04913     rc = SQLGetStmtAttr(hstmt,SQL_MAX_LENGTH,&pvParam,sizeof(pvParam),NULL);
04914     if(!FindError(SQL_HANDLE_STMT,szIM001))
04915       DISPLAYERROR(szSQLGETSTMTATTR,TEXT("did not return Not supported message"));
04916     RETCHECK(SQL_ERROR,rc,szSQLGETSTMTATTR);
04917     }
04918
04919   if(fSupportSetStmtAttr && (!fSupportGetStmtAttr))
04920     {
04921     //test SQL_MAX_LENGTH
04922     rgbValue = 300;
04923     rc = SQLSetStmtAttr(hstmt,SQL_MAX_LENGTH,&rgbValue,sizeof(rgbValue));
04924     if(!FindError(SQL_HANDLE_STMT,szHYC00))
04925       RETCHECK(SQL_SUCCESS,rc,szSQLSETSTMTATTR);
04926     else
04927       RETCHECK(SQL_ERROR,rc,szSQLSETSTMTATTR);
04928     //test SQL_ATTR_METADATA_ID -- new in 3.0
04929     rgbValue = SQL_FALSE;
04930     rc = SQLSetStmtAttr(hstmt,SQL_ATTR_METADATA_ID,&rgbValue,sizeof(rgbValue));
04931     if(!FindError(SQL_HANDLE_STMT,szHYC00))
04932       RETCHECK(SQL_SUCCESS,rc,szSQLSETSTMTATTR);
04933     else
04934       RETCHECK(SQL_ERROR,rc,szSQLSETSTMTATTR);
04935     }
04936
04937   if((!fSupportSetStmtAttr) && fSupportGetStmtAttr)
04938     {
04939     //test SQL_MAX_LENGTH
04940     rc = SQLGetStmtAttr(hstmt,SQL_MAX_LENGTH,&pvParam,sizeof(pvParam),NULL);
04941     if(!FindError(SQL_HANDLE_STMT,szHYC00))
04942       RETCHECK(SQL_SUCCESS,rc,szSQLGETSTMTATTR);
04943     else
04944       RETCHECK(SQL_ERROR,rc,szSQLGETSTMTATTR);
04945     //test SQL_ATTR_METADATA_ID -- new in 3.0
04946     rc = SQLGetStmtAttr(hstmt,SQL_ATTR_METADATA_ID,&pvParam,sizeof(pvParam),NULL);
04947     if(!FindError(SQL_HANDLE_STMT,szHYC00))
04948       RETCHECK(SQL_SUCCESS,rc,szSQLGETSTMTATTR);
04949     else
04950       RETCHECK(SQL_ERROR,rc,szSQLGETSTMTATTR);
04951     }
04952
04953   if(fSupportSetStmtAttr && fSupportGetStmtAttr)
04954     {
04955
04956     //test SQL_MAX_LENGTH
04957     rgbValue = 8000;
04958     rc = SQLSetStmtAttr(hstmt,SQL_MAX_LENGTH,(PTR)rgbValue,sizeof(rgbValue));
04959     if(!FindError(SQL_HANDLE_STMT,szHYC00))
04960       {
04961       RETCHECK(SQL_SUCCESS,rc,szSQLSETSTMTATTR);
04962       rc = SQLGetStmtAttr(hstmt,SQL_MAX_LENGTH,&pvParam,sizeof(pvParam),NULL);
04963       if(!FindError(SQL_HANDLE_STMT,szHYC00))
04964         {
04965         RETCHECK(SQL_SUCCESS,rc,szSQLGETSTMTATTR);
04966         if(pvParam != 8000)
04967           DISPLAYERROR(szSQLGETSTMTATTR,TEXT("SQL_MAX_LENGTH returned incorrect value"));
04968         }
04969       else
04970         RETCHECK(SQL_ERROR,rc,szSQLGETSTMTATTR);
04971       }
04972     else
04973       RETCHECK(SQL_ERROR,rc,szSQLSETSTMTATTR);
04974
04975
04976     //test SQL_ATTR_METADATA_ID -- new in 3.0
04977     rgbValue = SQL_FALSE;
04978     rc = SQLSetStmtAttr(hstmt,SQL_ATTR_METADATA_ID,(PTR)rgbValue,sizeof(rgbValue));
04979     if (!FindError(SQL_HANDLE_STMT,szHYC00) && !FindError(SQL_HANDLE_STMT,szHY092))
04980       RETCHECK(SQL_SUCCESS,rc,szSQLSETSTMTATTR);
04981
04982     rc2 = SQLGetStmtAttr(hstmt,SQL_ATTR_METADATA_ID,&pvParam,sizeof(pvParam),NULL);
04983     if (!FindError(SQL_HANDLE_STMT,szHYC00) && !FindError(SQL_HANDLE_STMT,szHY092))
04984       RETCHECK(SQL_SUCCESS,rc,szSQLGETSTMTATTR);
04985
04986     if (RC_SUCCESSFUL(rc) && RC_SUCCESSFUL(rc2) && pvParam != SQL_FALSE)
04987       DISPLAYERROR(szSQLGETSTMTATTR,TEXT("SQL_ATTR_METADATA_ID returned incorrect value"));
04988
04989     //Reset SQL_MAX_LENGTH
04990     rgbValue = 0;
04991     rc = SQLSetStmtAttr(hstmt,SQL_MAX_LENGTH,(PTR)rgbValue,sizeof(rgbValue));
04992     if(!FindError(SQL_HANDLE_STMT,szHYC00))
04993       {
04994       RETCHECK(SQL_SUCCESS,rc,szSQLSETSTMTATTR);
04995       rc = SQLGetStmtAttr(hstmt,SQL_MAX_LENGTH,&pvParam,sizeof(pvParam),NULL);
04996       if(!FindError(SQL_HANDLE_STMT,szHYC00))
04997         {
04998         RETCHECK(SQL_SUCCESS,rc,szSQLGETSTMTATTR);
04999         if(pvParam != 0)
05000           DISPLAYERROR(szSQLGETSTMTATTR,TEXT("SQL_MAX_LENGTH returned incorrect value"));
05001         }
05002       else
05003         RETCHECK(SQL_ERROR,rc,szSQLGETSTMTATTR);
05004       }
05005     else
05006       RETCHECK(SQL_ERROR,rc,szSQLSETSTMTATTR);
05007   }
05008
05009 } //TestSQLSetStmtAttr()
05010
05011 //--------------------------------------------------------------------------------
05012 // FUNCTION:    TestOneThread
05013 // PURPOSE:             This function allocates the statement handle, performs simple
05014 //                              queries and deallocates the statement handle.  This function is called
05015 //                              by testthreading.
05016 //--------------------------------------------------------------------------------
05017 static int TestOneThread(THREAD_STRUCT *ptArg)
05018 {
05019   HENV            henv0 = ptArg->henv;
05020   HDBC            hdbc0 = ptArg->hdbc;
05021   HSTMT           hstmt0 = NULL;
05022   //RETCODE       rc=SQL_SUCCESS;
05023
05024   /* allocate new statment handle */
05025   if (RC_NOTSUCCESSFUL(SQLAllocHandle(SQL_HANDLE_STMT,hdbc0, &hstmt0)))
05026     return(FALSE);
05027
05028   /* perform some simple catalog functions */
05029   if (RC_NOTSUCCESSFUL(SQLStatistics(hstmt0,NULL,SQL_NTS,NULL,SQL_NTS,NULL,SQL_NTS,SQL_INDEX_ALL,SQL_QUICK)))
05030     return(FALSE);
05031
05032   if (RC_NOTSUCCESSFUL(SQLCloseCursor(hstmt0)))
05033     return(FALSE);
05034
05035   /* Get some data */
05036   GetSomeData(hstmt0, ptArg->szTableName, TRUE,ptArg->rgFieldInfo);
05037
05038   if (RC_NOTSUCCESSFUL(SQLGetTypeInfo(hstmt0,SQL_CHAR)))
05039     return(FALSE);
05040
05041   // Cleanup
05042   if (RC_NOTSUCCESSFUL(SQLFreeHandle(SQL_HANDLE_STMT,hstmt0)))
05043     return(FALSE);
05044
05045   return(TRUE);
05046
05047 } //end of TestOneThread
05048
05049 //--------------------------------------------------------------------------------
05050 // FUNCTION:    ThreadLoop
05051 // PURPOSE:             This is the main loop for the threads, and it's called by
05052 //                              CreateThread() API.
05053 //--------------------------------------------------------------------------------
05054 DWORD WINAPI ThreadLoop(void *pArg)
05055 {
05056
05057   THREAD_STRUCT *ptArg = (THREAD_STRUCT *)pArg;
05058   int i;
05059   RETCODE rc;
05060
05061   for(i=0; i< NUM_THREAD; i++)
05062     TestOneThread(ptArg);
05063
05064   // free connection handle for each thread
05065   rc=SQLDisconnect(ptArg->hdbc);
05066     RETCHECK(SQL_SUCCESS,rc,szSQLDISCONNECT);
05067   rc=SQLFreeHandle(SQL_HANDLE_DBC,ptArg->hdbc);
05068   RETCHECK(SQL_SUCCESS,rc,szSQLFREEHANDLE);
05069
05070   return(0);
05071 } //end of ThreadLoop
05072
05073
05074 //-------------------------------------------------------------------------------
05075 // FUNCTION:    TestThreading
05076 // PURPOSE:             This function tests the multi-threading capabilities of the
05077 //                              driver by creating multiple threads that connect to the same data
05078 //                              source.  Once connected, each thread performs simple queries to
05079 //                              test that the driver handles these queries successfully.
05080 //                              This function is to be called inside AutoTestFunc() in QuikTest.
05081 //--------------------------------------------------------------------------------
05082 void TestThreading(lpSERVERINFO lpSI,QTSTRUCT  *lpqt,FIELDINFO *rgFieldInfo)
05083 {
05084   RETCODE rc=SQL_SUCCESS;
05085    THREAD_STRUCT *pArg;
05086    HANDLE hThread[NUM_THREAD];
05087   DWORD dwThreadId;
05088   UWORD i;
05089   HENV    henv1;
05090   HDBC    hdbc1;
05091
05092
05093   // allocate memory for the threads
05094   pArg = (THREAD_STRUCT *)AllocateMemory((NUM_THREAD) * sizeof(THREAD_STRUCT));
05095
05096   if(!pArg)
05097   {
05098     szWrite(TEXT("\t\t\tMultiThreading Test interrupted due to error in memory allocation"), TRUE);
05099     return;
05100   }
05101
05102   // only one environment handle will be needed for all threads
05103   rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv1);
05104   RETCHECK(SQL_SUCCESS, rc,szSQLALLOCHANDLE);
05105
05106
05107   // Set environment attribute, or we can't allocate connection
05108   rc = SQLSetEnvAttr(henv1, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3,
05109     SQL_IS_UINTEGER);
05110   RETCHECK(SQL_SUCCESS, rc,szSQLSETENVATTR);
05111
05112
05113   for (i=0; i < NUM_THREAD; i++ )
05114   {
05115     // allocate connection handle for each thread
05116     rc=SQLAllocHandle(SQL_HANDLE_DBC,henv1, &hdbc1);
05117     RETCHECK(SQL_SUCCESS, rc,szSQLALLOCHANDLE);
05118
05119     // create string to be used in connecting
05120     wsprintf(lpqt->sz,TEXT("dsn=%s;uid=%s;pwd=%s;"),
05121     lpSI->szValidServer0,
05122     lpSI->szValidLogin0,
05123     lpSI->szValidPassword0);
05124
05125     rc=SQLDriverConnect(hdbc1, lpSI->hwnd, lpqt->sz,
05126        SQL_NTS, lpqt->buf, MAX_STRING_SIZE, NULL, SQL_DRIVER_NOPROMPT);
05127
05128     if (!RC_SUCCESSFUL(rc))
05129       DISPLAYERROR(TEXT("TestThread failed:"),TEXT("SQLDriverConnect failed"));
05130
05131     // initialize thread structure
05132     pArg[i].henv = henv1;
05133     pArg[i].hdbc = hdbc1;
05134     _tcscpy(pArg[i].szTableName, lpqt->szTableName);
05135     pArg[i].rgFieldInfo=rgFieldInfo[0];
05136
05137     // start thread
05138     hThread[i]= CreateThread(NULL,
05139               0,
05140               ThreadLoop,
05141               &pArg[i],
05142               0,
05143               &dwThreadId);
05144
05145     if(hThread[i]==0)
05146     {
05147       DISPLAYERROR(TEXT("TestThread failed:"),TEXT("cannot create thread"));
05148       break;
05149     }
05150   }
05151
05152   // wait for thread completion
05153   WaitForMultipleObjects(NUM_THREAD,hThread,TRUE,INFINITE);
05154
05155   for(i=0; i<NUM_THREAD; i++ )
05156   CloseHandle(hThread[i]);
05157
05158   SQLFreeHandle(SQL_HANDLE_ENV,henv1);
05159   if (pArg)
05160     ReleaseMemory(pArg);
05161 }       //end of TestThreading()
05162
05163
05164 //-----------------------------------------------------------------------
05165 //      Function:               CreateDescRecord
05166 //-----------------------------------------------------------------------
05167 SWORD CreateDescRecord(SQLHDESC hdesc, SQLHSTMT hstmt, UWORD uwDescType)
05168 {
05169   UDWORD cbColDef;
05170   SWORD swColCount;
05171   SQLRETURN rc;
05172   SWORD fType, fSQLType;
05173   SWORD ibScale;
05174   TCHAR rgBuf[100];
05175
05176   switch(uwDescType) {
05177     case SQL_ATTR_APP_ROW_DESC:
05178       rc = SQLSetDescField(hdesc, 1, SQL_DESC_TYPE, (SQLPOINTER)SQL_C_DEFAULT,
05179         SQL_IS_SMALLINT);
05180       ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc,szSQLSETDESCFIELD);
05181
05182       if (SQL_SUCCEEDED(rc))
05183         return 1;
05184
05185       rc=SQLBindCol(hstmt, 1, SQL_C_TCHAR, rgBuf, sizeof(rgBuf), NULL);
05186       RETCHECK(SQL_SUCCESS, rc,szSQLBINDCOL);
05187       if (SQL_SUCCEEDED(rc))
05188         return 1;
05189       break;
05190     case SQL_ATTR_IMP_PARAM_DESC:
05191     case SQL_ATTR_APP_PARAM_DESC:
05192       // Select statement has already been done by this time
05193       rc=SQLDescribeCol(hstmt, 1, NULL, 0, NULL, &fSQLType, &cbColDef,
05194         &ibScale, NULL);
05195       RETCHECK(SQL_SUCCESS, rc,szSQLDESCRIBECOL);
05196       if (!SQL_SUCCEEDED(rc))
05197         return 0;
05198
05199       if (SQL_ATTR_APP_PARAM_DESC == uwDescType)
05200         fType=SQL_C_TCHAR;
05201       else
05202         fType=fSQLType;
05203
05204       rc = SQLSetDescField(hdesc, 1, SQL_DESC_TYPE, (SQLPOINTER)fType,
05205         SQL_IS_SMALLINT);
05206       ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc,szSQLSETDESCFIELD);
05207
05208       if (SQL_SUCCEEDED(rc))
05209         return 1;
05210
05211       rc=SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_TCHAR,
05212         fSQLType, cbColDef, ibScale, rgBuf, sizeof(rgBuf), NULL);
05213       RETCHECK(SQL_SUCCESS, rc,szSQLDESCRIBECOL);
05214       if (SQL_SUCCEEDED(rc))
05215         return 1;
05216       break;
05217     case SQL_ATTR_IMP_ROW_DESC:
05218       // Quiktest has already done the select for us
05219       // Need to find out how many cols in result set
05220       rc=SQLNumResultCols(hstmt, &swColCount);
05221       if (SQL_SUCCEEDED(rc))
05222         return(swColCount);
05223       break;
05224   }
05225   return 0;
05226 }       //CreateDescRecord
05227
05228 //-----------------------------------------------------------------------
05229 //      Function:               CheckDescOp
05230 //-----------------------------------------------------------------------
05231 void CheckDescOp(SQLHDESC hdesc, SQLRETURN rc, SQLUSMALLINT uwDescIndex,
05232   SQLSMALLINT swDescRecCount, SQLSMALLINT swDescRec, SQLUSMALLINT iDescField,
05233   SQLINTEGER swUpdateMode)
05234 {
05235   TCHAR * pszAPI, szOp[10];
05236   SQLSMALLINT fValidOp;   // Descriptor types operation is valid for
05237
05238   if (DESC_UPDATE_MODE_READ == swUpdateMode)
05239   {
05240     pszAPI=szSQLGETDESCFIELD;
05241     _tcscpy(szOp, TEXT("read"));
05242     fValidOp=rgDescInfo[iDescField].fGettable;
05243   }
05244   else
05245   {
05246     pszAPI=szSQLSETDESCFIELD;
05247     _tcscpy(szOp, TEXT("write"));
05248     fValidOp=rgDescInfo[iDescField].fSettable;
05249   }
05250
05251   // If we're reading beyond the last record, expect SQL_NO_DATA.
05252   if (swDescRec > swDescRecCount && DESC_UPDATE_MODE_READ == swUpdateMode)
05253   {
05254     wsprintf(buf,TEXT("%s: Able to %s descriptor field %s in the %s beyond last record."),
05255         pszAPI, szOp, rgDescInfo[iDescField].szDescFieldName, DescTypes[uwDescIndex].szDescName);
05256     ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_NO_DATA, rc, buf);
05257   }
05258   else
05259   {
05260     if (fValidOp & DescTypes[uwDescIndex].uwTypeMask)
05261     {
05262       wsprintf(buf,TEXT("%s: Unable to %s descriptor field %s in the %s"),
05263           pszAPI, szOp, rgDescInfo[iDescField].szDescFieldName, DescTypes[uwDescIndex].szDescName);
05264       ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, buf);
05265     }
05266     else
05267     {
05268       wsprintf(buf,TEXT("%s: Able to %s descriptor field %s in the %s"),
05269           pszAPI, szOp, rgDescInfo[iDescField].szDescFieldName, DescTypes[uwDescIndex].szDescName);
05270       ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_ERROR, rc, buf);
05271     }
05272   }
05273 }
05274
05275 //-----------------------------------------------------------------------
05276 //
05277 // Function: CompareDescField
05278 //
05279 // Compares two fields from the given descriptor, or to rgDescInfo if hdesc2
05280 // is NULL.  uwDescField contains the entry in rgDescInfo for the desired field
05281 //-----------------------------------------------------------------------
05282
05283 void CompareDescField(SQLHDESC hdesc1, SQLHDESC hdesc2, SQLUSMALLINT uwDescIndex,
05284   SQLSMALLINT swDescRec, SQLSMALLINT swDescRecCount, SQLUSMALLINT uwDescField,
05285   TCHAR * pszAPI)
05286 {
05287   SQLRETURN rc;
05288   SQLTCHAR DescBuf2[MAX_DESC_BUF];
05289   SQLINTEGER cbValue2;
05290
05291   // Make sure we've got a valid descriptor handle for hdesc1
05292   // (hdesc2 is allowed to be NULL)
05293   if (SQL_NULL_HDESC == hdesc1) {
05294     wsprintf(buf,TEXT("\t\tCompareDescriptor: hdesc1 handle was null!"));
05295     DISPLAYERROR(pszAPI, buf);
05296     return;
05297   }
05298
05299   // Read the value from hdesc1
05300   rc = SQLGetDescField(hdesc1, swDescRec, rgDescInfo[uwDescField].uwDescField,
05301     &DescBuf, sizeof(DescBuf), &cbValue);
05302
05303   CheckDescOp(hdesc1, rc, uwDescIndex, swDescRecCount, swDescRec, uwDescField, DESC_UPDATE_MODE_READ);
05304
05305   cbValue2=rgDescInfo[uwDescField].cbValue;
05306
05307   // Get the value to compare to
05308   if (SQL_NULL_HDESC == hdesc2) {
05309
05310     // Compare to rgDescInfo if it's settable
05311     if (rgDescInfo[uwDescField].fSettable & DescTypes[uwDescIndex].uwTypeMask) {
05312
05313       // Copy the set value into DescBuf2.  For char fields size is 0
05314       // (unknown), and the new value is actually the pointer to the start
05315       // of the string.
05316       SQLPOINTER pNewvalue = &(rgDescInfo[uwDescField].NewValue);
05317
05318       if (!rgDescInfo[uwDescField].size)
05319       {
05320         pNewvalue = (SQLPOINTER)rgDescInfo[uwDescField].NewValue;
05321         cbValue2        = (_tcslen(pNewvalue)+1) * sizeof(TCHAR);
05322       }
05323
05324       memcpy(&DescBuf2, pNewvalue, cbValue2);
05325     }
05326   }
05327   else {
05328
05329     // Compare to hdesc2
05330     rc = SQLGetDescField(hdesc2, swDescRec, rgDescInfo[uwDescField].uwDescField,
05331       &DescBuf2, sizeof(DescBuf2), &cbValue);
05332
05333     // Since hdesc2 is an unassociated hdesc, treat it as an ARD
05334     // (uwDescIndex=0)
05335     CheckDescOp(hdesc2, rc, 0, swDescRecCount, swDescRec, uwDescField, DESC_UPDATE_MODE_READ);
05336   }
05337
05338   // Perform the compare if settable in source desc and settable in
05339   // target desc (application descriptors) when using hdesc2
05340   if (rgDescInfo[uwDescField].fSettable & DescTypes[uwDescIndex].uwTypeMask)
05341   {
05342     if (!hdesc2 || (rgDescInfo[uwDescField].fSettable & DESC_ARD))
05343     {
05344       // IPD field SQL_DESC_TYPE is settable for consitency check, but set
05345       // value can't be retrieved, so skip compare in this case
05346       if (SQL_ATTR_IMP_PARAM_DESC != DescTypes[uwDescIndex].uwDescType ||
05347         SQL_DESC_DATA_PTR != rgDescInfo[uwDescField].uwDescField)
05348       {
05349         if (memcmp(DescBuf, DescBuf2, cbValue2)) {
05350           // Compare error, print message
05351           wsprintf(buf,TEXT("Compare error in %s field %s"),
05352             DescTypes[uwDescIndex].szDescName,rgDescInfo[uwDescField].szDescFieldName);
05353           DISPLAYERROR(pszAPI, buf);
05354         }
05355       }
05356     }
05357   }
05358 }
05359
05360
05361 //-----------------------------------------------------------------------
05362 //
05363 // Function:  CheckDescriptor
05364 //
05365 // Checks all fields in all records of given descriptor.  If swUpdateMode is
05366 // DESC_UPDATE_MODE_READ then all fields are read, otherwise all updatable
05367 // fields are written.
05368 //-----------------------------------------------------------------------
05369 void CheckDescriptor(SQLHDESC hdesc, SQLINTEGER swUpdateMode, SQLHSTMT hstmt, UWORD uwDescIndex)
05370 {
05371   SQLINTEGER cbValue2;
05372   SQLSMALLINT swDescRec=0, swDescRecCount, swAdditionalRecs=0;
05373   SQLUSMALLINT iDescField, iStartField=0;
05374   SQLRETURN rc;
05375
05376   // Get the descriptor record count.
05377   rc = SQLGetDescField(hdesc, 0, SQL_DESC_COUNT, &swDescRecCount,
05378     sizeof(swDescRecCount), &cbValue);
05379
05380   if (SQL_SUCCESS == rc) {
05381
05382     // In read mode, try to read one past last record
05383     if (swUpdateMode == DESC_UPDATE_MODE_READ)
05384       swAdditionalRecs=1;
05385
05386     // Check all records, including header
05387     for (swDescRec=0; swDescRec <= swDescRecCount+swAdditionalRecs; swDescRec++) {
05388
05389       // Check all fields
05390       for (iDescField=iStartField; iDescField < sizeof(rgDescInfo)/sizeof(rgDescInfo[0]); iDescField++) {
05391
05392         // If we've gone past the header fields, then break out of loop to check record fields
05393         if (0 == swDescRec && !rgDescInfo[iDescField].fHeader) {
05394           iStartField=iDescField;
05395           break;
05396         }
05397
05398         if (DESC_UPDATE_MODE_READ == swUpdateMode)
05399         {
05400           // Read from the field
05401           rc = SQLGetDescField(hdesc, swDescRec, rgDescInfo[iDescField].uwDescField,
05402             &DescBuf, sizeof(DescBuf), &cbValue);
05403
05404           CheckDescOp(hdesc, rc, uwDescIndex, swDescRecCount, swDescRec, iDescField, swUpdateMode);
05405
05406           if (RC_SUCCESSFUL(rc))
05407           {
05408             // Compare cbValue with expected
05409             cbValue2=rgDescInfo[iDescField].cbValue; // For most fields
05410
05411             if (!rgDescInfo[iDescField].size)
05412               cbValue2 = _tcslen((LPTSTR)DescBuf) * sizeof(SQLTCHAR);  // For string fields
05413
05414             // Make sure cbValue and cbValue2 agree
05415             if (cbValue != cbValue2)
05416             {
05417               wsprintf(buf,TEXT("Compare error in %s field %s, expected")\
05418                 TEXT(" StringLength %d, received %d"), DescTypes[uwDescIndex].szDescName,
05419                 rgDescInfo[iDescField].szDescFieldName, cbValue2, cbValue);
05420               DISPLAYERROR(szSQLGETDESCFIELD, buf);
05421             }
05422           }
05423         }
05424         else
05425         {
05426           // Write to the field.  For char fields size is 0 (unknown),
05427           // so compute the length of the string
05428           rc = SQLSetDescField(hdesc, swDescRec, rgDescInfo[iDescField].uwDescField,
05429             (SQLPOINTER)rgDescInfo[iDescField].NewValue,
05430             (rgDescInfo[iDescField].size) ? rgDescInfo[iDescField].size :
05431             _tcslen((LPTSTR)rgDescInfo[iDescField].NewValue)*sizeof(TCHAR));
05432
05433           CheckDescOp(hdesc, rc, uwDescIndex, swDescRecCount, swDescRec, iDescField, swUpdateMode);
05434
05435           if (RC_SUCCESSFUL(rc))
05436             CompareDescField(hdesc, NULL, uwDescIndex, swDescRec, swDescRecCount,iDescField, szSQLSETDESCFIELD);
05437         }
05438       }
05439     }
05440   }
05441   else {
05442     // Unable to read record count from descriptor header, can't proceed
05443     wsprintf(buf,TEXT("\t\tUnable to read record count from descriptor header."));
05444     ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, buf);
05445   }
05446 }
05447
05448 //-----------------------------------------------------------------------
05449 //
05450 // Function:  CompareDescriptor
05451 //
05452 // Compares two descriptors, or if hdesc2 is NULL compares hdesc1 to rgDescInfo
05453 // updatable columns
05454 //-----------------------------------------------------------------------
05455
05456 void CompareDescriptor(SQLHDESC hdesc1, SQLHDESC hdesc2, UWORD uwDescIndex, TCHAR * pszAPI)
05457 {
05458   SQLSMALLINT swDescRec, swDescRecCount;
05459   SQLUSMALLINT iDescField, iStartField=0;
05460   SQLRETURN rc;
05461
05462   // Make sure we've got a valid descriptor handle for hdesc1
05463   // (hdesc2 is allowed to be NULL)
05464   if (SQL_NULL_HDESC == hdesc1) {
05465     wsprintf(buf,TEXT("\t\thCompareDescriptor: hdesc1 handle was null!"));
05466     DISPLAYERROR(szSQLGETDESCFIELD, buf);
05467     return;
05468   }
05469
05470   // Get the descriptor record count.
05471   rc = SQLGetDescField(hdesc1, 0, SQL_DESC_COUNT, &swDescRecCount,
05472     sizeof(swDescRecCount), &cbValue);
05473
05474   if (SQL_SUCCESS == rc) {
05475
05476     // Check all records, including header
05477     for (swDescRec=0; swDescRec <= swDescRecCount; swDescRec++) {
05478
05479       // Check all fields
05480       for (iDescField=iStartField; iDescField < sizeof(rgDescInfo)/sizeof(rgDescInfo[0]); iDescField++) {
05481
05482         // If we've gone past the header fields, then break out of loop to check record fields
05483         if (0 == swDescRec && !rgDescInfo[iDescField].fHeader) {
05484           iStartField=iDescField;
05485           break;
05486         }
05487
05488         CompareDescField(hdesc1, hdesc2, uwDescIndex, swDescRec, swDescRecCount, iDescField, pszAPI);
05489       }
05490     }
05491   }
05492   else {
05493     // Unable to read record count from descriptor header, can't proceed
05494     wsprintf(buf,TEXT("\t\tUnable to read record count from descriptor header."));
05495     ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_SUCCESS, rc, buf);
05496   }
05497 }
05498
05499
05500 void CheckDescRecord(SQLHDESC hdesc, SQLSMALLINT swDescRec, SQLSMALLINT fType,
05501      SQLSMALLINT fSubType, SQLINTEGER cbLength, SQLSMALLINT ibPrecision, SQLSMALLINT ibScale,
05502      SQLPOINTER pData, SQLINTEGER *pcbValue, SQLINTEGER *pIndicator, SQLUSMALLINT iDescType)
05503 {
05504   SQLINTEGER Length, * pIndicator2;
05505   PTR pDescPtr;
05506   SQLRETURN rc;
05507   SQLSMALLINT fType2, fSubType2, cbName, Precision, Scale, Nullable;
05508   TCHAR   szName[MAX_DESC_BUF]=TEXT("");
05509
05510   // Write the record
05511   rc = SQLSetDescRec(hdesc, swDescRec, fType, fSubType, cbLength, ibPrecision,
05512     ibScale, pData, pcbValue, pIndicator);
05513
05514   // Can't set IRD, so it should error
05515   if (SQL_ATTR_IMP_ROW_DESC == DescTypes[iDescType].uwDescType)
05516     ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_ERROR, rc, szSQLSETDESCREC);
05517   else
05518   {
05519     wsprintf(buf,TEXT("%s: Unable to write record %d in %s"),
05520       szSQLSETDESCREC, swDescRec, DescTypes[iDescType].szDescName);
05521     ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, buf);
05522   }
05523
05524   if (RC_SUCCESSFUL(rc))
05525   {
05526     // Read it again
05527     rc = SQLGetDescRec(hdesc, swDescRec, szName, sizeof(szName)/sizeof(TCHAR),
05528       &cbName, &fType2, &fSubType2, &Length, &Precision, &Scale, &Nullable);
05529
05530     wsprintf(buf,TEXT("%s: Unable to read record %d in %s"),
05531       szSQLGETDESCREC, swDescRec, DescTypes[iDescType].szDescName);
05532     ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, buf);
05533
05534     if (RC_SUCCESSFUL(rc))
05535     {
05536       // Compare values
05537       if (fType2 != fType)
05538         DISPLAYERROR(szSQLSETDESCREC,TEXT("fType not set correctly"));
05539
05540       if (Precision != ibPrecision)
05541         DISPLAYERROR(szSQLSETDESCREC,TEXT("ibPrecision not set correctly"));
05542
05543       switch(fType)
05544       {
05545         case SQL_DECIMAL:
05546         case SQL_NUMERIC:
05547         case SQL_C_DOUBLE:
05548         case SQL_C_FLOAT:
05549           // Scale is only defined for NUMERIC or DECIMAL types
05550           if (Scale != ibScale)
05551             DISPLAYERROR(szSQLSETDESCREC,TEXT("ibScale not set correctly"));
05552           break;
05553         case SQL_DATETIME:
05554         case SQL_INTEGER:
05555           // Subtype is only valid for DATETIME or INTERVAL types
05556           if (fSubType2 != fSubType)
05557             DISPLAYERROR(szSQLSETDESCREC,TEXT("fSubType not set correctly"));
05558           break;
05559       }
05560
05561       // For application descriptors, compare the Length and get the
05562       // data ptr value to check for accuracy
05563       switch(DescTypes[iDescType].uwDescType)
05564       {
05565         case SQL_ATTR_APP_ROW_DESC:
05566         case SQL_ATTR_APP_PARAM_DESC:
05567
05568           if (Length != cbLength)
05569             DISPLAYERROR(szSQLSETDESCREC,TEXT("cbLength not set correctly"));
05570
05571           rc = SQLGetDescField(hdesc, swDescRec, SQL_DESC_DATA_PTR,
05572             &pDescPtr, sizeof(PTR), &cbValue);
05573           ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, szSQLGETDESCFIELD);
05574
05575           if (pDescPtr != pData)
05576             DISPLAYERROR(szSQLSETDESCREC,TEXT("rgbValue not set correctly"));
05577
05578           // Get the octet length ptr value and check for accuracy
05579           rc = SQLGetDescField(hdesc, swDescRec, SQL_DESC_OCTET_LENGTH_PTR,
05580             &pDescPtr, sizeof(PTR), &cbValue);
05581           ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, szSQLGETDESCFIELD);
05582
05583           if (pDescPtr != pcbValue)
05584             DISPLAYERROR(szSQLSETDESCREC,TEXT("cbValue not set correctly"));
05585
05586           rc = SQLGetDescField(hdesc, swDescRec, SQL_DESC_INDICATOR_PTR,
05587             &pIndicator2, sizeof(PTR), &cbValue);
05588           ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, szSQLGETDESCFIELD);
05589
05590           if (pIndicator2 != pIndicator)
05591             DISPLAYERROR(szSQLSETDESCREC,TEXT("Indicator not set correctly"));
05592
05593           break;
05594         case SQL_ATTR_IMP_ROW_DESC:
05595         case SQL_ATTR_IMP_PARAM_DESC:
05596           break;
05597         default:
05598           DISPLAYERROR(szSQLSETDESCREC,TEXT("Unknown descriptor type."));
05599       }
05600     }
05601   }
05602
05603 }
05604
05605 SQLRETURN DescBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar,
05606     SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType,
05607     SQLUINTEGER cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue,
05608     SQLINTEGER cbValueMax, SQLINTEGER  *pcbValue)
05609 {
05610   SQLHDESC hdescAPD, hdescIPD;
05611   SQLRETURN rc;
05612
05613   rc = SQLGetStmtAttr(hstmt, SQL_ATTR_APP_PARAM_DESC, &hdescAPD, sizeof(hdescAPD), NULL);
05614   if (!RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR))
05615     return rc;
05616
05617   rc = SQLGetStmtAttr(hstmt, SQL_ATTR_IMP_PARAM_DESC, &hdescIPD, sizeof(hdescIPD), NULL);
05618   if (!RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR))
05619     return rc;
05620
05621   // Parameter type
05622   rc = SQLSetDescField(hdescIPD, ipar, SQL_DESC_PARAMETER_TYPE, (SQLPOINTER)fParamType,
05623     SQL_IS_SMALLINT);               // Set ipar and fParamType for IPD
05624   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescIPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05625     return rc;
05626
05627   // C type
05628   rc = SQLSetDescField(hdescAPD, ipar, SQL_DESC_CONCISE_TYPE, (SQLPOINTER)fCType,
05629     SQL_IS_SMALLINT);               // Set ipar and fCType of APD
05630   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescAPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05631     return rc;
05632
05633   // Sql type
05634   rc = SQLSetDescField(hdescIPD, ipar, SQL_DESC_CONCISE_TYPE, (SQLPOINTER)fSqlType,
05635     SQL_IS_SMALLINT);               // Set fSqlType of IPD
05636   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescIPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05637     return rc;
05638
05639   // Column Size (Length or Precision)
05640   if (fSqlType == SQL_CHAR ||
05641     fSqlType == SQL_WCHAR ||
05642     fSqlType == SQL_VARCHAR ||
05643     fSqlType == SQL_WVARCHAR ||
05644     fSqlType == SQL_LONGVARCHAR ||
05645     fSqlType == SQL_WLONGVARCHAR ||
05646     fSqlType == SQL_BINARY ||
05647     fSqlType == SQL_VARBINARY ||
05648     fSqlType == SQL_LONGVARBINARY ||
05649     fSqlType == SQL_TYPE_DATE ||
05650     fSqlType == SQL_TYPE_TIME ||
05651     fSqlType == SQL_TYPE_TIMESTAMP ||
05652     (fSqlType >= SQL_INTERVAL_YEAR &&
05653      fSqlType <= SQL_INTERVAL_MINUTE_TO_SECOND))
05654   {
05655     rc = SQLSetDescField(hdescIPD, ipar, SQL_DESC_LENGTH, (SQLPOINTER)cbColDef,
05656       SQL_IS_UINTEGER);               // Set cbColDef (Length) of IPD
05657     if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescIPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05658       return rc;
05659   }
05660   else if (fSqlType == SQL_DECIMAL ||
05661        fSqlType == SQL_NUMERIC ||
05662        fSqlType == SQL_FLOAT ||
05663        fSqlType == SQL_REAL ||
05664        fSqlType == SQL_DOUBLE)
05665   {
05666     rc = SQLSetDescField(hdescIPD, ipar, SQL_DESC_PRECISION, (SQLPOINTER)cbColDef,
05667       SQL_IS_SMALLINT);               // Set cbColDef (Precision) of IPD
05668     if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescIPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05669       return rc;
05670   }
05671
05672   // Scale
05673   if (fSqlType == SQL_TYPE_DATE ||
05674     fSqlType == SQL_TYPE_TIME ||
05675     fSqlType == SQL_TYPE_TIMESTAMP ||
05676     (fSqlType >= SQL_INTERVAL_YEAR &&
05677      fSqlType <= SQL_INTERVAL_MINUTE_TO_SECOND))
05678   {
05679     switch(fSqlType)
05680     {
05681       case SQL_TYPE_TIME:
05682       case SQL_TYPE_TIMESTAMP:
05683       case SQL_INTERVAL_SECOND:
05684       case SQL_INTERVAL_DAY_TO_SECOND:
05685       case SQL_INTERVAL_HOUR_TO_SECOND:
05686       case SQL_INTERVAL_MINUTE_TO_SECOND:
05687         rc = SQLSetDescField(hdescIPD, ipar, SQL_DESC_PRECISION, (SQLPOINTER)ibScale,
05688           SQL_IS_SMALLINT);               // Set scale of IPD
05689         if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescIPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05690           return rc;
05691         break;
05692       default:
05693         rc = SQLSetDescField(hdescIPD, ipar, SQL_DESC_PRECISION, (SQLPOINTER)0,
05694           SQL_IS_SMALLINT);               // Set scale of IPD
05695         if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescIPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05696           return rc;
05697     }
05698   }
05699   else
05700   {
05701     rc = SQLSetDescField(hdescIPD, ipar, SQL_DESC_SCALE, (SQLPOINTER)ibScale,
05702       SQL_IS_SMALLINT);               // Set scale of IPD
05703     if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescIPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05704       return rc;
05705   }
05706
05707   // cbValueMax
05708   rc = SQLSetDescField(hdescAPD, ipar, SQL_DESC_OCTET_LENGTH, (SQLPOINTER)cbValueMax,
05709     SQL_IS_INTEGER);                // Set cbValueMax of APD
05710   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescAPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05711     return rc;
05712
05713   // pcbValue
05714   rc = SQLSetDescField(hdescAPD, ipar, SQL_DESC_OCTET_LENGTH_PTR, (SQLPOINTER)pcbValue,
05715     SQL_IS_POINTER);                // Set pcbValue/octet length
05716   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescAPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05717     return rc;
05718
05719   rc = SQLSetDescField(hdescAPD, ipar, SQL_DESC_INDICATOR_PTR, (SQLPOINTER)pcbValue,
05720     SQL_IS_POINTER);                // Set pcbValue/indicator
05721   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdescAPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05722     return rc;
05723
05724   // Data ptr
05725   rc = SQLSetDescField(hdescAPD, ipar, SQL_DESC_DATA_PTR, (SQLPOINTER)rgbValue,
05726     SQL_IS_POINTER);                // Set rgbValue
05727   ERRSHANDLE(SQL_HANDLE_DESC, hdescAPD, SQL_SUCCESS, rc,szSQLSETDESCFIELD);
05728
05729   return rc;
05730
05731 }
05732
05733 SQLRETURN DescBindCol(SQLHSTMT hstmt, SQLSMALLINT icol,
05734      SQLSMALLINT fCType, SQLPOINTER rgbValue,
05735      SQLINTEGER cbValueMax, SQLINTEGER *pcbValue)
05736 {
05737   SQLHDESC hdesc;
05738   SQLRETURN rc;
05739
05740   rc = SQLGetStmtAttr(hstmt, SQL_ATTR_APP_ROW_DESC, &hdesc, sizeof(hdesc), NULL);
05741   if (!RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR))
05742     return rc;
05743
05744   rc = SQLSetDescField(hdesc, icol, SQL_DESC_CONCISE_TYPE, (SQLPOINTER)fCType,
05745     SQL_IS_SMALLINT);               // Set icol and fCType
05746   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05747     return rc;
05748
05749   rc = SQLSetDescField(hdesc, icol, SQL_DESC_OCTET_LENGTH, (SQLPOINTER)cbValueMax,
05750     SQL_IS_INTEGER);                // Set cbValueMax
05751   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05752     return rc;
05753
05754   rc = SQLSetDescField(hdesc, icol, SQL_DESC_OCTET_LENGTH_PTR, (SQLPOINTER)pcbValue,
05755     SQL_IS_POINTER);                // Set pcbValue/octet length
05756   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05757     return rc;
05758
05759   rc = SQLSetDescField(hdesc, icol, SQL_DESC_INDICATOR_PTR, (SQLPOINTER)pcbValue,
05760     SQL_IS_POINTER);                // Set pcbValue/indicator
05761   if (!ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc,szSQLSETDESCFIELD))
05762     return rc;
05763
05764   rc = SQLSetDescField(hdesc, icol, SQL_DESC_DATA_PTR, (SQLPOINTER)rgbValue,
05765     SQL_IS_POINTER);                // Set rgbValue
05766   ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc,szSQLSETDESCFIELD);
05767
05768   return rc;
05769 }
05770
05771 //-----------------------------------------------------------------------
05772 //      Function:               TestGetDescField
05773 //-----------------------------------------------------------------------
05774
05775 void  PASCAL TestGetDescField(QTSTRUCT * lpqt)
05776 {
05777   SQLRETURN rc=SQL_SUCCESS;
05778   SQLUSMALLINT iDescType;
05779
05780   SQLHDESC hdesc1=NULL, hdesc2=NULL;
05781   PTR rgbValue=NULL;
05782   SQLSMALLINT swDescRecCount, swExpRecCount;
05783   SQLINTEGER cbValue;
05784   TCHAR   szName[MAX_DESC_BUF]=TEXT("");
05785   TCHAR   szQuery[XLARGEBUFF]=TEXT("");
05786
05787   if (!Supported(SQL_API_SQLGETDESCFIELD))
05788   {
05789     // Allocate a default descriptor
05790     rc = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc);
05791
05792     if (RC_SUCCESSFUL(rc))
05793     {
05794       rc = SQLGetDescField(hdesc, 0, SQL_DESC_COUNT, &DescBuf, sizeof(DescBuf),
05795         &cbValue);
05796
05797       if(!FindError(SQL_HANDLE_DESC,szIM001))
05798         DISPLAYERROR(szSQLGETDESCFIELD, szNotSupported);
05799       RETCHECK(SQL_ERROR, rc,szSQLGETDESCFIELD);
05800     }
05801   }
05802   else
05803   {
05804     // Make sure all parameters and columns are unbound
05805     ResetHstmt(&hstmt);
05806
05807     // Perform a select stmt
05808     wsprintf(szQuery,szSELECTSTAR,lpqt->szTableName);
05809     rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
05810     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
05811
05812     // For each descriptor type
05813     for (iDescType=0; iDescType < sizeof(DescTypes)/sizeof(DescTypes[0]); iDescType++)
05814     {
05815
05816       // Get the handle for the automatically allocated descriptor
05817       rc = SQLGetStmtAttr(hstmt, DescTypes[iDescType].uwDescType, &hdesc1, sizeof(hdesc1), &cbValue);
05818       RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR);
05819
05820       // Create a descriptor record so we have something to read besides header
05821       swExpRecCount=CreateDescRecord(hdesc1, hstmt, DescTypes[iDescType].uwDescType);
05822
05823       // Get the count of descriptor records (iRecord ignored for header fields)
05824       rc = SQLGetDescField(hdesc1, 0, SQL_DESC_COUNT, &swDescRecCount,
05825         sizeof(swDescRecCount), &cbValue);
05826
05827       if (SQL_SUCCEEDED(rc))
05828       {
05829         // Check count value for expected
05830         if (swExpRecCount != swDescRecCount)
05831         {
05832           wsprintf(buf,TEXT("Expected record count %d, found %d"),
05833             swExpRecCount, swDescRecCount);
05834           DISPLAYERROR(szSQLGETDESCFIELD, buf);
05835         }
05836
05837         CheckDescriptor(hdesc1, DESC_UPDATE_MODE_READ, hstmt, iDescType);
05838       }
05839       else
05840       {
05841         // Unable to read record count from descriptor header, can't proceed
05842         wsprintf(buf,TEXT("Unable to read record count from descriptor header for descriptor type %d"),
05843           DescTypes[iDescType].szDescName);
05844         ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_SUCCESS, rc, buf);
05845       }
05846     }
05847
05848     rc=SQLCloseCursor(hstmt);
05849     RETCHECK(SQL_SUCCESS, rc,szSQLCLOSECURSOR);
05850   }
05851
05852
05853 } // TestGetDescField()
05854
05855 //-----------------------------------------------------------------------
05856 //      Function:               TestSetDescField
05857 //-----------------------------------------------------------------------
05858
05859 void  PASCAL TestSetDescField(QTSTRUCT * lpqt)
05860 {
05861   SQLRETURN rc=SQL_SUCCESS;
05862   SQLUSMALLINT iDescType;
05863
05864   SQLHDESC hdesc1=NULL, hdesc2=NULL;
05865   PTR rgbValue=NULL;
05866   SQLSMALLINT swDescRecCount, swExpRecCount;
05867   SQLINTEGER cbValue;
05868   TCHAR   szName[MAX_DESC_BUF]=TEXT("");
05869   TCHAR   szQuery[XLARGEBUFF]=TEXT("");
05870
05871
05872   if (!Supported(SQL_API_SQLSETDESCFIELD))
05873   {
05874     // Allocate a default descriptor
05875     rc = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc);
05876
05877     if (RC_SUCCESSFUL(rc))
05878     {
05879       rc = SQLSetDescField(hdesc, 0, SQL_DESC_COUNT, &swDescRecCount,
05880         sizeof(swDescRecCount));
05881
05882       if(!FindError(SQL_HANDLE_DESC,szIM001))
05883         DISPLAYERROR(szSQLSETDESCFIELD, szNotSupported);
05884       RETCHECK(SQL_ERROR, rc,szSQLSETDESCFIELD);
05885     }
05886   }
05887   else
05888   {
05889     // Make sure all parameters and columns are unbound
05890     ResetHstmt(&hstmt);
05891
05892     // Perform a select stmt
05893     wsprintf(szQuery,szSELECTSTAR,lpqt->szTableName);
05894     rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
05895     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
05896
05897     // For each descriptor type
05898     for (iDescType=0; iDescType < sizeof(DescTypes)/sizeof(DescTypes[0]); iDescType++)
05899     {
05900
05901       // Get the handle for the automatically allocated descriptor
05902       rc = SQLGetStmtAttr(hstmt, DescTypes[iDescType].uwDescType, &hdesc1, sizeof(hdesc1), &cbValue);
05903       RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR);
05904
05905       // Create a descriptor record so we have something to read besides header
05906       swExpRecCount=CreateDescRecord(hdesc1, hstmt, DescTypes[iDescType].uwDescType);
05907
05908       // Update all descriptor records to new values
05909       CheckDescriptor(hdesc1, DESC_UPDATE_MODE_WRITE, hstmt, iDescType);
05910
05911       // Compare the descriptor with the update values
05912       // CompareDescriptor(hdesc1, NULL, iDescType, szSQLSETDESCFIELD);
05913     }
05914
05915     ResetHstmt(&hstmt);
05916   }
05917
05918 } //TestSetDescField()
05919
05920 //-----------------------------------------------------------------------
05921 //      Function:               TestGetDescRec
05922 //-----------------------------------------------------------------------
05923
05924 void  PASCAL TestGetDescRec(QTSTRUCT * lpqt)
05925 {
05926   SQLRETURN rc=SQL_SUCCESS;
05927   SQLUSMALLINT iDescType;
05928
05929   SQLHDESC hdesc1=NULL, hdesc2=NULL;
05930   PTR rgbValue=NULL;
05931         SQLSMALLINT swDescRec, swDescRecCount, iRecord=0, cbName, fType, fSubType,
05932     Precision, Scale, Nullable, swExpRecCount;
05933   SQLINTEGER Length, cbValue;
05934   TCHAR   szName[MAX_DESC_BUF]=TEXT("");
05935   TCHAR   szQuery[XLARGEBUFF]=TEXT("");
05936
05937
05938   if (!Supported(SQL_API_SQLGETDESCREC))
05939   {
05940     // Allocate a default descriptor
05941     rc = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc);
05942
05943     if (RC_SUCCESSFUL(rc))
05944     {
05945       rc = SQLGetDescRec(hdesc, iRecord, szName, MAX_DESC_BUF, &cbName, &fType,
05946         &fSubType, &Length, &Precision, &Scale, &Nullable);
05947
05948       if(!FindError(SQL_HANDLE_DESC,szIM001))
05949         DISPLAYERROR(szSQLGETDESCREC, szNotSupported);
05950       RETCHECK(SQL_ERROR, rc,szSQLGETDESCREC);
05951     }
05952   }
05953   else
05954   {
05955     // Make sure all parameters and columns are unbound
05956     ResetHstmt(&hstmt);
05957
05958     // Turn on bookmarks so we can retrieve from record 0 of ARD
05959     rc = SQLSetStmtAttr(hstmt, SQL_ATTR_USE_BOOKMARKS, (SQLPOINTER)SQL_UB_ON, SQL_IS_INTEGER);
05960     RETCHECK(SQL_SUCCESS, rc,szSQLSETSTMTATTR);
05961
05962     // Perform a select stmt
05963     wsprintf(szQuery,szSELECTSTAR,lpqt->szTableName);
05964     rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
05965     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
05966
05967     // For each descriptor type
05968     for (iDescType=0; iDescType < sizeof(DescTypes)/sizeof(DescTypes[0]); iDescType++)
05969     {
05970
05971       // Get the handle for the automatically allocated descriptor
05972       rc = SQLGetStmtAttr(hstmt, DescTypes[iDescType].uwDescType, &hdesc1, sizeof(hdesc1), &cbValue);
05973       RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR);
05974
05975       // Create a descriptor record so we have something to read besides header
05976       swExpRecCount=CreateDescRecord(hdesc1, hstmt, DescTypes[iDescType].uwDescType);
05977
05978       // Get the count of descriptor records
05979       // Count for automatically allocated descriptors is written in
05980       // SetDescField test.
05981       rc = SQLGetDescField(hdesc1, 0, SQL_DESC_COUNT, &swDescRecCount,
05982         sizeof(swDescRecCount), &cbValue);
05983
05984       if (SQL_SUCCESS == rc)
05985       {
05986
05987         // For all descriptor records
05988         for (swDescRec=0; swDescRec <= swDescRecCount+1; swDescRec++)
05989         {
05990             // Read the record
05991             rc = SQLGetDescRec(hdesc1, swDescRec, szName, sizeof(szName), &cbName, &fType,
05992               &fSubType, &Length, &Precision, &Scale, &Nullable);
05993
05994             if (swDescRec <= swDescRecCount)
05995             {
05996               // Retrieving bookmark on IPD is an error
05997               if (SQL_ATTR_IMP_PARAM_DESC == DescTypes[iDescType].uwDescType && 0 == swDescRec)
05998               {
05999                 wsprintf(buf,TEXT("%s: Able to read record %d from %s"),
06000                   szSQLGETDESCREC, swDescRec, DescTypes[iDescType].szDescName);
06001                 ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_ERROR, rc, buf);
06002               }
06003               else
06004               {
06005                 wsprintf(buf,TEXT("%s: Unable to read record %d from %s"),
06006                   szSQLGETDESCREC, swDescRec, DescTypes[iDescType].szDescName);
06007                 ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_SUCCESS, rc, buf);
06008               }
06009             }
06010             else
06011             {
06012               wsprintf(buf,TEXT("%s: Did not receive SQL_NO_DATA reading record %d from %s"),
06013                 szSQLGETDESCREC, swDescRec, DescTypes[iDescType].szDescName);
06014               ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_NO_DATA, rc, buf);
06015             }
06016         }
06017       }
06018       else
06019       {
06020         // Unable to read record count from descriptor header, can't proceed
06021         wsprintf(buf,TEXT("\t\tUnable to read record count from descriptor header for %s"),
06022           DescTypes[iDescType].szDescName);
06023         ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_SUCCESS, rc, buf);
06024       }
06025     }
06026
06027     rc=SQLCloseCursor(hstmt);
06028     RETCHECK(SQL_SUCCESS, rc,szSQLCLOSECURSOR);
06029
06030   }
06031
06032 } //TestGetDescRec()
06033
06034 //-----------------------------------------------------------------------
06035 //      Function:               TestSetDescRec
06036 //-----------------------------------------------------------------------
06037
06038 void  PASCAL TestSetDescRec(QTSTRUCT * lpqt)
06039 {
06040   SQLRETURN rc=SQL_SUCCESS;
06041         SQLINTEGER cbLength=300,cbValue, Indicator;
06042   SQLUSMALLINT iDescType;
06043
06044   SQLHDESC hdesc1=NULL, hdesc2=NULL;
06045   PTR rgbValue=NULL;
06046         SQLSMALLINT swDescRec, swDescRecCount, swStartRec=1, iRecord=0, fType=1, fSubType=1,
06047                 ibPrecision=0, ibScale=0;
06048   SQLSMALLINT swExpRecCount;
06049   TCHAR   szQuery[XLARGEBUFF]=TEXT("");
06050
06051
06052   if (!Supported(SQL_API_SQLSETDESCREC))
06053   {
06054     // Allocate a default descriptor
06055     rc = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc);
06056
06057     if (RC_SUCCESSFUL(rc))
06058     {
06059       rc = SQLSetDescRec(hdesc, iRecord, fType, fSubType, cbLength,
06060         ibPrecision, ibScale, &DescBuf, &cbValue, &Indicator);
06061
06062       if(!FindError(SQL_HANDLE_DESC,szIM001))
06063         DISPLAYERROR(szSQLSETDESCREC, szNotSupported);
06064       RETCHECK(SQL_ERROR, rc,szSQLSETDESCREC);
06065     }
06066   }
06067   else
06068   {
06069     // Make sure all parameters and columns are unbound
06070     ResetHstmt(&hstmt);
06071
06072     // Perform a select stmt
06073     wsprintf(szQuery,szSELECTSTAR,lpqt->szTableName);
06074     rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
06075     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
06076
06077     // If bookmarks are supported, then we want to try to set record 0
06078     rc = SQLSetStmtAttr(hstmt, SQL_ATTR_USE_BOOKMARKS,
06079       (PTR)SQL_UB_VARIABLE, SQL_IS_INTEGER);
06080     if (RC_SUCCESSFUL(rc))
06081       swStartRec=0;
06082
06083     // For each descriptor type
06084     for (iDescType=0; iDescType < sizeof(DescTypes)/sizeof(DescTypes[0]); iDescType++)
06085     {
06086
06087       // Get the handle for the automatically allocated descriptor
06088       rc = SQLGetStmtAttr(hstmt, DescTypes[iDescType].uwDescType, &hdesc1, sizeof(hdesc1), &cbValue);
06089       RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR);
06090
06091       // Create a descriptor record so we have something to read besides header
06092       swExpRecCount=CreateDescRecord(hdesc1, hstmt, DescTypes[iDescType].uwDescType);
06093
06094       // Get the count of descriptor records
06095       rc = SQLGetDescField(hdesc1, 0, SQL_DESC_COUNT, &swDescRecCount,
06096         sizeof(swDescRecCount), &cbValue);
06097
06098       if (SQL_SUCCESS == rc)
06099       {
06100
06101         // For all descriptor records
06102         for (swDescRec=swStartRec; swDescRec <= swDescRecCount; swDescRec++)
06103         {
06104           // Test with a DATETIME record so we can check the subtype field.
06105           SQLINTEGER Indicator=0;
06106           fType=SQL_DATETIME;
06107           fSubType=SQL_CODE_TIMESTAMP;
06108           cbLength=sizeof(TIMESTAMP_STRUCT);
06109           ibPrecision=5;  // For DATETIME, SQL_CODE_DATE data
06110                       // precision defaults to 0, but it implies it can be set otherwise.
06111           ibScale=0;              // Only used for DECIMAL or NUMERIC types, otherwise undefined
06112
06113           CheckDescRecord(hdesc1, swDescRec, fType, fSubType, cbLength, ibPrecision,
06114             ibScale, &tsval, &cbValue, &Indicator, iDescType);
06115
06116           // Test with a numeric record to test scale
06117           Indicator=0;
06118           fType=SQL_NUMERIC;
06119           fSubType=SQL_CODE_TIMESTAMP;
06120           cbLength=sizeof(TIMESTAMP_STRUCT);
06121           ibPrecision=5;  // For DATETIME, SQL_CODE_DATE data
06122                       // precision defaults to 0, but it implies it can be set otherwise.
06123           ibScale=0;              // Only used for DECIMAL or NUMERIC types, otherwise undefined
06124
06125           CheckDescRecord(hdesc1, swDescRec, fType, fSubType, cbLength, ibPrecision,
06126             ibScale, &tsval, &cbValue, &Indicator, iDescType);
06127         }
06128       }
06129       else
06130       {
06131         // Unable to read record count from descriptor header,
06132         // can't proceed
06133         wsprintf(buf,TEXT("\t\tUnable to read record count from descriptor header for  %s"),
06134           DescTypes[iDescType].szDescName);
06135         ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_SUCCESS, rc, buf);
06136       }
06137     }
06138     ResetHstmt(&hstmt);
06139   }
06140
06141 } //TestSetDescRec()
06142
06143 //-----------------------------------------------------------------------
06144 //      Function:               TestCopyDesc
06145 //-----------------------------------------------------------------------
06146
06147 void  PASCAL TestCopyDesc(QTSTRUCT * lpqt)
06148 {
06149   SQLRETURN rc=SQL_SUCCESS;
06150   SQLUSMALLINT iDescType;
06151   SQLSMALLINT swExpRecCount;
06152
06153   SQLHDESC hdesc1=NULL, hdesc2=NULL;
06154   PTR rgbValue=NULL;
06155   TCHAR   szName[MAX_DESC_BUF]=TEXT("");
06156   TCHAR   szQuery[XLARGEBUFF]=TEXT("");
06157
06158   ResetHstmt(&hstmt);
06159
06160   // Allocate a default descriptor
06161   rc = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc);
06162
06163   if (RC_SUCCESSFUL(rc))
06164   {
06165
06166     if (!Supported(SQL_API_SQLCOPYDESC))
06167     {
06168       rc = SQLCopyDesc(hdesc, hdesc1);
06169
06170       if(!FindError(SQL_HANDLE_DESC,szIM001))
06171         DISPLAYERROR(szSQLCOPYDESC, szNotSupported);
06172       RETCHECK(SQL_ERROR, rc,szSQLCOPYDESC);
06173     }
06174     else
06175     {
06176
06177       // Perform a select stmt
06178       wsprintf(szQuery,szSELECTSTAR,lpqt->szTableName);
06179       rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
06180       RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
06181
06182       // For each descriptor type
06183       for (iDescType=0; iDescType < sizeof(DescTypes)/sizeof(DescTypes[0]); iDescType++)
06184       {
06185         // Get the handle for the automatically allocated descriptor
06186         rc = SQLGetStmtAttr(hstmt, DescTypes[iDescType].uwDescType, &hdesc1, sizeof(hdesc1), &cbValue);
06187         RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR);
06188
06189         // Create a descriptor record so we have something to read besides header
06190         swExpRecCount=CreateDescRecord(hdesc1, hstmt, DescTypes[iDescType].uwDescType);
06191
06192         // Update all descriptor records to new values
06193         CheckDescriptor(hdesc1, DESC_UPDATE_MODE_WRITE, hstmt, iDescType);
06194
06195         // Copy the descriptor to the newly allocated descriptor
06196         rc = SQLCopyDesc(hdesc1, hdesc);
06197         ERRSHANDLE(SQL_HANDLE_DESC, hdesc1, SQL_SUCCESS, rc, szSQLCOPYDESC);
06198         ERRSHANDLE(SQL_HANDLE_DESC, hdesc, SQL_SUCCESS, rc, szSQLCOPYDESC);
06199
06200         // Compare each field in the copied descriptor to the original
06201         if (RC_SUCCESSFUL(rc))
06202           CompareDescriptor(hdesc1, hdesc, iDescType, szSQLCOPYDESC);
06203       }
06204
06205     }
06206
06207     // Free descriptor handle
06208     if (hdesc)
06209     {
06210       rc = SQLFreeHandle(SQL_HANDLE_DESC, hdesc);
06211       RETCHECK(SQL_SUCCESS, rc,szSQLFREEHANDLE);
06212     }
06213
06214     ResetHstmt(&hstmt);
06215   }
06216
06217 } //TestCopyDesc()
06218
06219
06220 //-----------------------------------------------------------------------
06221 //      Function:               TestDescDefaults
06222 //-----------------------------------------------------------------------
06223 void  PASCAL TestDescDefaults(QTSTRUCT * lpqt)
06224 {
06225   SQLRETURN rc=SQL_SUCCESS;
06226   SQLINTEGER cbValue;
06227   SQLSMALLINT swDescRec;
06228   SQLUSMALLINT iDescField, iStartField=0, iDescType;
06229
06230   if (Supported(SQL_API_SQLGETDESCFIELD))
06231   {
06232
06233     // Reallocate hstmt to check defaults against
06234     ResetHstmt(&hstmt);
06235
06236     // For each descriptor type
06237     for (iDescType=0; iDescType < sizeof(DescTypes)/sizeof(DescTypes[0]); iDescType++)
06238     {
06239       // Get the handle for the descriptor
06240       rc = SQLGetStmtAttr(hstmt, DescTypes[iDescType].uwDescType, &hdesc, sizeof(hdesc), NULL);
06241       RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR);
06242
06243       swDescRec=0;
06244
06245       // For each descriptor field, read the value
06246       for (iDescField=iStartField; iDescField < sizeof(rgDescInfo)/sizeof(rgDescInfo[0]); iDescField++) {
06247
06248         // If we've gone past the header fields, then create a record and check record fields
06249         if (0 == swDescRec && !rgDescInfo[iDescField].fHeader) {
06250           iStartField=iDescField;
06251           // Make sure we're not on the IRD, 'cause you can't modify an IRD
06252           if (SQL_ATTR_IMP_ROW_DESC != DescTypes[iDescType].uwDescType)
06253           {
06254             // Create a record with all default values
06255             rc = SQLSetDescField(hdesc, 0, SQL_DESC_COUNT, (SQLPOINTER)1,
06256               SQL_IS_SMALLINT);
06257             RETCHECK(SQL_SUCCESS, rc,szSQLSETDESCFIELD);
06258
06259             swDescRec++;
06260           }
06261           continue;
06262         }
06263
06264         // If the field has a default value
06265         if (rgDescInfo[iDescField].fDefault & DescTypes[iDescType].uwTypeMask)
06266         {
06267           // Read from the field
06268           rc = SQLGetDescField(hdesc, swDescRec, rgDescInfo[iDescField].uwDescField,
06269             &DescBuf, sizeof(DescBuf), &cbValue);
06270           RETCHECK(SQL_SUCCESS, rc,szSQLGETDESCFIELD);
06271
06272           if (RC_SUCCESSFUL(rc))
06273           {
06274             // Perform the compare
06275             if (memcmp(DescBuf, &rgDescInfo[iDescField].DefaultVal, cbValue))
06276             {
06277               // Compare error, print message
06278               wsprintf(buf,TEXT("Error in %s field %s default value"),
06279                 DescTypes[iDescType].szDescName,rgDescInfo[iDescField].szDescFieldName);
06280               DISPLAYERROR(szSQLGETDESCFIELD, buf);
06281             }
06282           }
06283         }
06284       }
06285     }
06286   }
06287 } // TestDescDefaults
06288
06289 //-----------------------------------------------------------------------
06290 //      Function:               TestUseDesc
06291 //-----------------------------------------------------------------------
06292 void  PASCAL TestUseDesc(QTSTRUCT * lpqt, FIELDINFO  *rgFields)
06293 {
06294   LPTSTR   pch=NULL;
06295   SDWORD crow=0;
06296   TCHAR   szQuery[XLARGEBUFF]=TEXT("");
06297   SQLRETURN rc;
06298   UWORD   row, icol, paramno;
06299   SWORD   ccol;
06300   TCHAR * rgbMemBuf=NULL, * rgbValue=NULL;
06301   SDWORD * pcbValueBuf=NULL, * pcbValue=NULL;
06302
06303   if (Supported(SQL_API_SQLSETDESCFIELD))
06304   {
06305
06306     // Test descriptor bindcol
06307
06308     // Reallocate hstmt to set to defaults
06309     ResetHstmt(&hstmt);
06310
06311     // Perform a select stmt
06312     wsprintf(szQuery,szSELECTSTAR,lpqt->szTableName);
06313     rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
06314     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
06315
06316     rc=SQLNumResultCols(hstmt, &ccol);
06317     RETCHECK(SQL_SUCCESS, rc, szSQLNUMRESULTCOLS);
06318
06319     rc=SQLFreeStmt(hstmt, SQL_CLOSE); // Close the cursor so we can insert
06320     RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
06321
06322     rgbMemBuf=AllocateMemory(ccol*MAX_STRING_SIZE*sizeof(TCHAR));
06323
06324     if (!rgbMemBuf)
06325     {
06326       DISPLAYERROR(TEXT("Simulate BindCol"),TEXT("Out of memory!"));
06327       goto ExitUseDesc;
06328     }
06329
06330     pcbValueBuf=(SDWORD *)AllocateMemory(ccol*sizeof(SDWORD));
06331
06332     if (!pcbValueBuf)
06333     {
06334       DISPLAYERROR(TEXT("Simulate BindCol"),TEXT("Out of memory!"));
06335       goto ExitUseDesc;
06336     }
06337
06338     // Bind a parameter for each column in the result set using descriptors
06339     paramno=0;
06340     for (icol=1, rgbValue=rgbMemBuf, pcbValue=pcbValueBuf;
06341       icol <= ccol;
06342       icol++, rgbValue+=MAX_STRING_SIZE, pcbValue++)
06343     {
06344       pch = qtMakeData(guwRowCount, icol-1, &rgFields[icol-1], rgbValue);
06345
06346       // Field is not READ ONLY
06347       if(pch)
06348       {
06349         // Where row and column match and field is nullable, make NULL
06350         if (icol == guwRowCount && rgFields[icol-1].nullable)
06351           *pcbValue=SQL_NULL_DATA;
06352         else
06353           *pcbValue=SQL_NTS;
06354
06355         paramno++;
06356 //                              rc=SQLBindParameter(hstmt, paramno, SQL_PARAM_INPUT, SQL_C_TCHAR,
06357         rc=DescBindParameter(hstmt, paramno, SQL_PARAM_INPUT, SQL_C_TCHAR,
06358           rgFields[icol-1].wSQLType, rgFields[icol-1].precision,
06359           rgFields[icol-1].scale, rgbValue, 0, pcbValue);
06360         RETCHECK(SQL_SUCCESS, rc,TEXT("DescBindParameter"));
06361       }
06362     }
06363
06364     // Insert the new row.  Note that the inserted row will be checked
06365     // for accuracy below.
06366     rc = SQLExecDirect(hstmt, szInsertStmt, SQL_NTS);
06367     ERRSHANDLE(SQL_HANDLE_STMT, hstmt, SQL_SUCCESS, rc, szSQLEXECDIRECT);
06368
06369     if (RC_SUCCESSFUL(rc))
06370       guwRowCount++;
06371
06372     // Perform the select stmt again
06373     wsprintf(szQuery,szSELECTSTAR,lpqt->szTableName);
06374     rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
06375     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
06376
06377     // Bind all the columns to char
06378     for (icol=1, rgbValue=rgbMemBuf, pcbValue=pcbValueBuf;
06379       icol <= ccol;
06380       icol++, rgbValue+=MAX_STRING_SIZE, pcbValue++)
06381     {
06382       // Bind to next column
06383       rc = DescBindCol(hstmt, icol, SQL_C_TCHAR, rgbValue, MAX_STRING_SIZE*sizeof(TCHAR), pcbValue);
06384 //                      rc = SQLBindCol(hstmt, icol, SQL_C_TCHAR, rgbValue, MAX_STRING_SIZE*sizeof(TCHAR), pcbValue);
06385       RETCHECK(SQL_SUCCESS, rc, TEXT("DescBindCol"));
06386     }
06387
06388     // Fetch all the rows and check the bound value with MakeAData for
06389     // each column
06390     for (row=1; rc == SQL_SUCCESS; row++)
06391     {
06392       rc=SQLFetch(hstmt); // Will return SQL_NO_DATA after last row
06393
06394       if (SQL_SUCCESS == rc)
06395       {
06396
06397         // Compare all the columns
06398         for (icol=1, rgbValue=rgbMemBuf, pcbValue=pcbValueBuf;
06399           icol <= ccol;
06400           icol++, rgbValue+=MAX_STRING_SIZE, pcbValue++)
06401         {
06402
06403           CompareWithExpected(rgbValue, pcbValue, row, icol, rgFields);
06404         }
06405       }
06406       else
06407         ERRSHANDLE(SQL_HANDLE_STMT, hstmt, SQL_NO_DATA, rc, szSQLFETCH);
06408
06409     }
06410
06411     // Close the cursor and retry using SQLFetchScroll
06412     rc=SQLFreeStmt(hstmt, SQL_CLOSE);
06413     RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
06414
06415     // Make sure we have a rowset size of 1
06416     rc=SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)1, SQL_IS_UINTEGER);
06417     ERRSHANDLE(SQL_HANDLE_STMT, hstmt, SQL_SUCCESS, rc, szSQLSETDESCFIELD);
06418
06419     // Re-execute the query
06420     rc = SQLExecDirect(hstmt, szQuery, SQL_NTS);
06421     RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
06422
06423     // Fetch all the rows and check the bound value with MakeAData for
06424     // each column
06425     for (row=1, rc=SQL_SUCCESS; rc == SQL_SUCCESS; row++)
06426     {
06427       rc=SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 1); // Will return SQL_NO_DATA after last row
06428
06429       if (SQL_SUCCESS == rc)
06430       {
06431
06432         // Compare all the columns
06433         for (icol=1, rgbValue=rgbMemBuf, pcbValue=pcbValueBuf;
06434           icol <= ccol;
06435           icol++, rgbValue+=MAX_STRING_SIZE, pcbValue++)
06436         {
06437
06438           CompareWithExpected(rgbValue, pcbValue, row, icol, rgFields);
06439         }
06440       }
06441       else
06442         ERRSHANDLE(SQL_HANDLE_STMT, hstmt, SQL_NO_DATA, rc, szSQLFETCHSCROLL);
06443
06444     }
06445
06446
06447   }
06448
06449 ExitUseDesc:
06450   rc=SQLFreeStmt(hstmt,SQL_RESET_PARAMS);
06451   rc=SQLFreeStmt(hstmt, SQL_CLOSE);
06452   RETCHECK(SQL_SUCCESS, rc,szSQLFREESTMT);
06453
06454   if (rgbMemBuf)
06455     ReleaseMemory(rgbMemBuf);
06456   if (pcbValueBuf)
06457     ReleaseMemory(pcbValueBuf);
06458
06459
06460 } // TestUseDesc
06461
06462 //-----------------------------------------------------------------------
06463 //      Function:               TestEnvAttr
06464 //
06465 // Note:        Only one environment attribute (SQL_ATTR_OUTPUT_NTS) exists at this
06466 //              time.  The default value is SQL_TRUE.
06467 //
06468 //      For the Environment attributes we assume support if DM version >= 3.00
06469 //-----------------------------------------------------------------------
06470
06471 void  PASCAL TestEnvAttr()
06472 {
06473   SQLINTEGER      sdwEnvAttr;
06474   SQLRETURN       rc;
06475   HENV                    tshenv;
06476   BOOL                    fSetSupported = Supported(SQL_API_SQLSETENVATTR),
06477           fGetSupported = Supported(SQL_API_SQLGETENVATTR);
06478   LONG DEFAULT_ODBC_VERSION;
06479
06480
06481   //allocate an enviroment handle
06482   rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &tshenv);
06483   RETCHECK(SQL_SUCCESS, rc,szSQLALLOCHANDLE);
06484
06485
06486   //-------------------------------
06487   //-------- SQLSetEnvAttr --------
06488   //-------------------------------
06489   // Set to SQL_FALSE
06490   rc = SQLSetEnvAttr(tshenv, SQL_ATTR_ODBC_VERSION, (PTR)SQL_OV_ODBC3,
06491     SQL_IS_UINTEGER);
06492
06493   if(!fSetSupported)
06494   {
06495     if (!FindError(SQL_HANDLE_ENV,szIM001))
06496       DISPLAYERROR(szSQLSETENVATTR, szNotSupported);
06497
06498     RETCHECK(SQL_ERROR, rc,szSQLSETENVATTR);
06499   }
06500   else
06501     RETCHECK(SQL_SUCCESS, rc,szSQLSETENVATTR);
06502
06503   if (RC_SUCCESSFUL(rc))
06504   {
06505     // Read it again
06506     rc = SQLGetEnvAttr(tshenv, SQL_ATTR_ODBC_VERSION, &sdwEnvAttr,
06507       sizeof(sdwEnvAttr), NULL);
06508
06509     if(!fGetSupported)
06510     {
06511       if (!FindError(SQL_HANDLE_ENV,szIM001))
06512         DISPLAYERROR(szSQLGETENVATTR, szNotSupported);
06513
06514       RETCHECK(SQL_ERROR, rc,szSQLGETENVATTR);
06515     }
06516     else
06517       RETCHECK(SQL_SUCCESS, rc,szSQLGETENVATTR);
06518
06519     if (RC_SUCCESSFUL(rc) && (SQL_OV_ODBC3 != sdwEnvAttr))
06520     {
06521       // New value wrong
06522       DISPLAYERROR(szSQLSETENVATTR,TEXT("Unable to set environment attribute SQL_ATTR_ODBC_VERSION to SQL_OV_ODBC3."));
06523     }
06524   }
06525
06526   rc = SQLFreeHandle(SQL_HANDLE_ENV,tshenv);
06527   RETCHECK(SQL_SUCCESS, rc,szSQLFREEHANDLE);
06528
06529   //-------------------------------
06530   //-------- SQLGetEnvAttr --------
06531   //-------------------------------
06532   rc = SQLAllocEnv(&tshenv);
06533   RETCHECK(SQL_SUCCESS, rc,szSQLALLOCENV);
06534
06535   rc = SQLGetEnvAttr(tshenv, SQL_ATTR_ODBC_VERSION, &sdwEnvAttr,
06536     sizeof(sdwEnvAttr), NULL);
06537
06538   if(!fGetSupported)
06539   {
06540     if (!FindError(SQL_HANDLE_ENV,szIM001))
06541       DISPLAYERROR(szSQLGETENVATTR, szNotSupported);
06542
06543     RETCHECK(SQL_ERROR, rc,szSQLGETENVATTR);
06544   }
06545   else
06546     RETCHECK(SQL_SUCCESS, rc,szSQLGETENVATTR);
06547
06548
06549
06550   DEFAULT_ODBC_VERSION = SQL_OV_ODBC2;
06551
06552   if (RC_SUCCESSFUL(rc) && (DEFAULT_ODBC_VERSION != sdwEnvAttr))
06553   {
06554     // Default value wrong
06555     wsprintf(buf, TEXT("Value was not %d!"), DEFAULT_ODBC_VERSION);
06556     DISPLAYERROR(szSQLGETENVATTR,buf);
06557   }
06558
06559
06560   rc = SQLFreeHandle(SQL_HANDLE_ENV,tshenv);
06561   RETCHECK(SQL_SUCCESS, rc,szSQLFREEHANDLE);
06562
06563 } //TestEnvAttr()
06564
06565
06566 //-----------------------------------------------------------------------
06567 //    Function: GetRowCnt
06568 //
06569 //              Get the row count of the table lpqt->szTalbeName
06570 //-----------------------------------------------------------------------
06571 SWORD  PASCAL GetRowCnt(QTSTRUCT  *lpqt)
06572 {
06573   SWORD           sRowCnt;
06574   RETCODE         rc;
06575
06576   // free the statment handle for a fresh start
06577   FreeStmt(SQL_DROP);
06578
06579   AllocHstmt();
06580
06581   //get row count for the table
06582   wsprintf(lpqt->sz,TEXT("select count(*) from %s"), lpqt->szTableName);
06583
06584   rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
06585   RETCHECK(SQL_SUCCESS, rc,szSQLEXECDIRECT);
06586
06587   rc = SQLFetch(hstmt);
06588   RETCHECK(SQL_SUCCESS, rc,szSQLFETCH);
06589
06590   rc = SQLGetData(hstmt,1, SQL_C_SSHORT, &sRowCnt, sizeof(sRowCnt), NULL);
06591   RETCHECK(SQL_SUCCESS, rc,szSQLGETDATA);
06592
06593   FreeStmt(SQL_CLOSE);
06594
06595   return sRowCnt;
06596 }//GetRowCount
06597
06598
06599 //-----------------------------------------------------------------------
06600 //    Function: InsertOneRow
06601 //
06602 //              Insert one row into the table.
06603 //
06604 //                      lpqt:                   temp place to hold data genrated
06605 //                      rgFields:       hold info about each data type in the dbs
06606 //                      cTypes;         the count of data types
06607 //                      lpd:                    buffer used for SQLBindParam
06608 //                      cSeed;          the seed used to generate data
06609 //                      fFreeHsmt:      if the hstmt should be freed
06610 //
06611 //              Return TRUE: the insertion was successful
06612 //                               FALSE: otherwise
06613 //-----------------------------------------------------------------------
06614
06615 BOOL  PASCAL InsertOneRow(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes,
06616                     DSTRUCT  *lpd,UWORD cSeed,BOOL fFreeHstmt)
06617 {
06618   RETCODE                         rc;
06619   UWORD                           w;
06620   UWORD                           ind;
06621   LPTSTR                          pch=NULL;
06622   SQLHDESC                                hdesc;
06623    SQLSMALLINT          fParamType = SQL_PARAM_INPUT;
06624   TCHAR                                   szDataItem[150];
06625
06626
06627   //prepare the insert statement
06628   rc = SQLPrepare(hstmt, szInsertStmt, SQL_NTS);
06629   RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE);
06630
06631   //going through each data type, call SQLBindParam
06632   for(ind = 0, w = 0; ind < cTypes; ind++)
06633   {
06634
06635     //make data according to data type description in rgFields[], cSeed is the seed
06636     pch = qtMakeData(cSeed,ind,&rgFields[ind], szDataItem);
06637
06638     //if the data type is READ_ONLY, skip
06639     if(!pch)
06640       continue;
06641
06642     //populate the NULL data
06643     if(*pch)
06644     {
06645       _tcscpy(lpd[w].data, pch);
06646       lpd[w].cb = SQL_NTS;
06647     }
06648     else
06649     {
06650       _tcscpy(lpd[w].data,TEXT(""));
06651       lpd[w].cb = SQL_NULL_DATA;
06652     }
06653
06654     if (g_f3XDriver && Supported(SQL_API_SQLSETDESCFIELD))
06655 //              if (0)  //DEBUG
06656     {
06657       //bind the data buffer in lpd[] to each column of the table
06658       rc = SQLBindParam(hstmt, (SQLSMALLINT)(w+1),SQL_C_TCHAR, rgFields[ind].wSQLType,
06659                   rgFields[ind].precision, rgFields[ind].scale,
06660                   &lpd[w].data, &lpd[w].cb);
06661       RETCHECK(SQL_SUCCESS, rc,szSQLBINDPARAM);
06662
06663       if(rc!= SQL_SUCCESS)
06664         return FALSE;
06665
06666       //get the driver parameter descriptor handle
06667       rc = SQLGetStmtAttr(hstmt,SQL_ATTR_IMP_PARAM_DESC, &hdesc, sizeof(hdesc),NULL);
06668       RETCHECK(SQL_SUCCESS, rc,szSQLGETSTMTATTR);
06669       if(rc!= SQL_SUCCESS)
06670         return FALSE;
06671
06672       //set the parameter type field in the descriptor
06673       rc = SQLSetDescField(hdesc, (SQLSMALLINT)(w+1), SQL_DESC_PARAMETER_TYPE,
06674                     (PTR)fParamType, sizeof(fParamType));
06675       RETCHECK(SQL_SUCCESS, rc,szSQLSETDESCFIELD);
06676
06677     }
06678     else
06679     {
06680       rc = SQLBindParameter(hstmt, (UWORD)(w+1),SQL_PARAM_INPUT,SQL_C_TCHAR,
06681               rgFields[ind].wSQLType, rgFields[ind].precision,
06682               rgFields[ind].scale,&lpd[w].data, 100, &lpd[w].cb);
06683
06684       RETCHECK(SQL_SUCCESS, rc,szSQLBINDPARAMETER);
06685
06686       if(rc!= SQL_SUCCESS)
06687         return FALSE;
06688     }
06689
06690
06691     //go on to next column
06692     w++;
06693   }
06694
06695   // insert a row
06696   rc = SQLExecute(hstmt);
06697   RETCHECK(SQL_SUCCESS, rc,szSQLEXECUTE);
06698   if(rc!= SQL_SUCCESS)
06699     return FALSE;
06700
06701   //free the hstmt if required
06702   if(fFreeHstmt)
06703   {
06704     if (FreeStmt(SQL_CLOSE))
06705       return FALSE;
06706
06707   }
06708
06709   return TRUE;
06710
06711 }       //InsertOneRow
06712
06713 //-----------------------------------------------------------------------
06714 //    Function: ExecEndTran
06715 //
06716 //              Execute EndTran statement, return the row count of the table
06717 //-----------------------------------------------------------------------
06718 SWORD  PASCAL ExecEndTran(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes,
06719                 DSTRUCT  *lpd,SQLSMALLINT fHandleType, SQLSMALLINT fMode,
06720                 UWORD cSeed)
06721 {
06722     RETCODE rc;
06723
06724     //does not free the hstmt
06725     if(!InsertOneRow(lpqt,rgFields,cTypes,lpd,cSeed, FALSE))
06726         return (INSERT_FAIL);
06727
06728     switch(fHandleType)
06729     {
06730       case SQL_HANDLE_ENV:
06731         rc= SQLEndTran(fHandleType,henv,fMode);
06732         break;
06733       case SQL_HANDLE_DBC:
06734         rc= SQLEndTran(fHandleType,hdbc,fMode);
06735         break;
06736       default:
06737         DISPLAYERROR(TEXT("ExecEndTran"),TEXT("Did not recieve correct handle type"));
06738         break;
06739     }
06740     RETCHECK(SQL_SUCCESS, rc,szSQLENDTRAN);
06741
06742     if (SQL_COMMIT == fMode && SQL_SUCCESS == rc)
06743       guwRowCount++;  // We inserted a row, increment global row count
06744
06745     //free the hstmt handle
06746     FreeStmt(SQL_CLOSE);
06747
06748     return(GetRowCnt(lpqt));
06749 } //ExecEndTran
06750
06751 //-----------------------------------------------------------------------
06752 //    Function: TestEndTran
06753 //
06754 //              Test the SQLEndTran for SDK 3.0
06755 //-----------------------------------------------------------------------
06756 void  PASCAL TestEndTran(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes,
06757                     DSTRUCT  *lpd)
06758 {
06759   SWORD                           i;
06760   RETCODE                         rc;
06761   SWORD                           sTXN;
06762   SWORD                           sRowCnt_Pre;
06763   SWORD                           sRowCnt_Aft;
06764   SQLSMALLINT             fHandleType[]={SQL_HANDLE_ENV, SQL_HANDLE_DBC};
06765   SDWORD                  cbValue=0;
06766
06767   //check if transaction is supported
06768   rc = SQLGetInfo(hdbc, SQL_TXN_CAPABLE, &sTXN, sizeof(sTXN), NULL);
06769   RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
06770
06771   //check both henv and hdbc handle
06772   for(i=0; i<=1; i++)
06773   {
06774
06775     //get the row count of the table
06776     sRowCnt_Pre = GetRowCnt(lpqt);
06777
06778     //check if SQLEndTran is supported
06779     if(Supported(SQL_API_SQLENDTRAN))
06780     {
06781       if(sTXN != SQL_TC_NONE)
06782       {
06783         //set the autocommit to off
06784         SetConnectionAttributes(hdbc,SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
06785
06786         //insert one row, and call SQLEndTran to roll back the transction
06787         sRowCnt_Aft = ExecEndTran(lpqt,rgFields,cTypes,lpd,fHandleType[i],SQL_ROLLBACK,(UWORD)(guwRowCount));
06788
06789         //the row count should be the same
06790         if(sRowCnt_Aft != sRowCnt_Pre)
06791           DISPLAYERROR(szSQLENDTRAN,TEXT("Did not Roll Back the insert transaction"));
06792       }
06793
06794       //insert one row, and call SQLEndTran to commit the transction
06795       sRowCnt_Aft = ExecEndTran(lpqt,rgFields,cTypes,lpd,fHandleType[i],SQL_COMMIT,(UWORD)(guwRowCount));
06796
06797       //the row count should be increased by 1
06798       if(sRowCnt_Aft != (sRowCnt_Pre+1) )
06799         DISPLAYERROR(szSQLENDTRAN,TEXT("Did not commit the insert transaction"));
06800
06801       if( sTXN != SQL_TC_NONE)
06802       {
06803         //set the autocommit to off
06804         SetConnectionAttributes(hdbc,SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
06805       }
06806
06807     }//end of the situation where SQLEndTran is supported
06808     else
06809     {
06810
06811       switch(fHandleType[i])
06812       {
06813         case SQL_HANDLE_ENV:
06814           rc= SQLEndTran(fHandleType[i],henv,SQL_COMMIT);
06815           break;
06816         case SQL_HANDLE_DBC:
06817           rc= SQLEndTran(fHandleType[i],hdbc,SQL_ROLLBACK);
06818           break;
06819       }
06820
06821       //check error msg
06822       if(!FindError(fHandleType[i],szIM001))
06823         DISPLAYERROR(szSQLENDTRAN,TEXT("Did not return not Supported Message"));
06824
06825       RETCHECK(SQL_ERROR, rc,szSQLENDTRAN);
06826
06827       //free the hstmt handle
06828       FreeStmt(SQL_CLOSE);
06829
06830     }//end of error msg checking
06831
06832   }//end of the loop to check both henv and hdbc
06833
06834   // Commit the transaction started in GetRowCnt inside ExecEndTran
06835   rc= SQLEndTran(SQL_HANDLE_ENV,henv,SQL_COMMIT);
06836   RETCHECK(SQL_SUCCESS, rc,szSQLENDTRAN);
06837
06838   SetConnectionAttributes(hdbc,SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);
06839
06840   //free the hstmt handle
06841   FreeStmt(SQL_CLOSE);
06842
06843 } // TestEndTran()
06844
06845
06846 //-----------------------------------------------------------------------
06847 //    Function: TestBindParam
06848 //
06849 //              Test the SQLBindParam for SDK 3.0
06850 //-----------------------------------------------------------------------
06851 void  PASCAL TestBindParam(QTSTRUCT  *lpqt,FIELDINFO  *rgFields,UWORD cTypes,
06852                     DSTRUCT  *lpd)
06853 {
06854   RETCODE                         rc;
06855   SQLINTEGER              cbValue = SQL_NTS;
06856   TCHAR                           szDataItem[150];
06857
06858   if(Supported(SQL_API_SQLBINDPARAM))
06859   {
06860     //test SQLBindParam by inserting one row, do not free the hstmt handle
06861     if (InsertOneRow(lpqt,rgFields,cTypes,lpd,(UWORD)(guwRowCount),FALSE))
06862       guwRowCount++; // We've inserted a row
06863   }
06864   else
06865   {
06866     //prepare the insert statement
06867     rc = SQLPrepare(hstmt, szInsertStmt, SQL_NTS);
06868     RETCHECK(SQL_SUCCESS, rc,szSQLPREPARE);
06869
06870     //make data according to data type description in rgFields[0], cSeed is the seed
06871     qtMakeData(cTypes+1,0,&rgFields[0],szDataItem);
06872
06873     //try to bind lpqt->szDataItem to the first column of the table
06874     rc = SQLBindParam(hstmt,1,SQL_C_TCHAR, rgFields[0].wSQLType, rgFields[0].precision,
06875                 rgFields[0].scale,lpqt->szDataItem, &cbValue);
06876
06877     //check error msg
06878     if(!FindError(SQL_HANDLE_STMT,szIM001))
06879       DISPLAYERROR(szSQLBINDPARAM,TEXT("Did not return Not Supported Message"));
06880
06881     RETCHECK(SQL_ERROR, rc,szSQLBINDPARAM);
06882   }
06883
06884   //free the hstmt handle
06885   FreeStmt(SQL_CLOSE);
06886
06887 } // TestBindParam()
06888
06889
06890
06891
06892
06893
06894 //-----------------------------------------------------------------------
06895 //    Function: TestFetchScroll
06896 //
06897 //              Test the SQLFetchScroll for SDK 3.0
06898 //-----------------------------------------------------------------------
06899
06900 void PASCAL TestFetchScroll(QTSTRUCT *lpqt)
06901 {
06902   RETCODE rc=SQL_SUCCESS;
06903   TCHAR           szSave[MAX_QUERY_SIZE];
06904   DWORD           dwLen=0;
06905   SDWORD  cbValue=0;
06906
06907   /* check if SQLGetFunctions says your API is supported */
06908   if(!Supported( SQL_API_SQLFETCHSCROLL))
06909   {
06910     /* Call your 3.0 API here and verify that the correct state is returned */
06911     rc = SQLFetchScroll(hstmt,SQL_FETCH_FIRST, 0);
06912     if(!FindError(SQL_HANDLE_STMT,szIM001))
06913       DISPLAYERROR(szSQLFETCHSCROLL, szNotSupported);
06914     RETCHECK(SQL_ERROR, rc, szSQLFETCHSCROLL);
06915   }
06916   else
06917   {
06918     ResetHstmt(&hstmt);
06919
06920     /* Valid Testing of SQLFetchScroll */
06921     SelectFromTable(lpqt);
06922
06923     rc = SQLBindCol(hstmt, 1, SQL_C_TCHAR, lpqt->sz, sizeof(lpqt->sz),
06924       &cbValue);
06925     RETCHECK(SQL_SUCCESS, rc, szSQLBINDCOL);
06926
06927     rc = SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 3);
06928     RETCHECK(SQL_SUCCESS, rc, szSQLFETCHSCROLL);
06929     _tcscpy(szSave,lpqt->sz);
06930
06931     rc = SQLFetchScroll(hstmt, SQL_FETCH_PRIOR, 1);
06932     RETCHECK(SQL_ERROR, rc, szSQLFETCHSCROLL);
06933
06934     rc = SQLFetchScroll(hstmt, SQL_FETCH_FIRST, 0);
06935     RETCHECK(SQL_ERROR, rc, szSQLFETCHSCROLL);
06936
06937     rc = SQLFetchScroll(hstmt, SQL_FETCH_LAST, 0);
06938     RETCHECK(SQL_ERROR, rc, szSQLFETCHSCROLL);
06939
06940     rc = SQLFreeStmt(hstmt, SQL_CLOSE);
06941     RETCHECK(SQL_SUCCESS, rc, szSQLFREESTMT);
06942
06943   }
06944
06945   //free the hstmt handle
06946   FreeStmt(SQL_CLOSE);
06947
06948 } // TestFetchScroll()
06949
06950
06951
06952 /*-----------------------------------------------------------------------*/
06953 /*      Function:               qtDisplayError                           */
06954 /*-----------------------------------------------------------------------*/
06955
06956 void  PASCAL qtDisplayError(LPTSTR szFunction, LPTSTR buf, LPTSTR szFile, int iLine)
06957 {
06958   TCHAR szTmp[MAX_STRING_SIZE];
06959
06960   szWrite(TEXT(""), TRUE);
06961   szWrite(TEXT("\t\t\t"), FALSE);
06962   szWrite(szFunction, FALSE);
06963   szWrite(TEXT("  FAILED"), TRUE);
06964   szWrite(TEXT("\t\t\t"), FALSE);
06965   szWrite(buf, TRUE);
06966
06967   wsprintf(szTmp,TEXT("\t\t\t%s: %d"), szFile, iLine);
06968   szWrite(szTmp, TRUE);
06969
06970   szWrite(TEXT("\t\t\t  --------  "), TRUE);
06971
06972   lpSI->failed++;
06973
06974   return;
06975 }
06976
06977
06978 /*-----------------------------------------------------------------------*/
06979 /*      Function:               qtMakeData                               */
06980 /*-----------------------------------------------------------------------*/
06981
06982 LPTSTR  PASCAL qtMakeData(int row, int col,FIELDINFO  *rgField, LPTSTR buf)
06983 {
06984   int i;
06985   TCHAR szColNum[10];
06986   TCHAR tmpbuf[256];
06987
06988   if(rgField->fAutoUpdate)
06989     return NULL;
06990
06991   if(rgField->nullable && (row==col))
06992     {
06993     _tcscpy(buf,TEXT(""));
06994     return buf;
06995     }
06996
06997   switch(rgField->wSQLType) {
06998     case SQL_CHAR:
06999     case SQL_WCHAR:
07000     case SQL_VARCHAR:
07001     case SQL_WVARCHAR:
07002     case SQL_LONGVARCHAR:
07003     case SQL_WLONGVARCHAR:
07004     case SQL_BINARY:
07005     case SQL_VARBINARY:
07006     case SQL_LONGVARBINARY:
07007       if(rgField->precision < (4*sizeof(TCHAR)) )
07008         wsprintf(buf,TEXT("%d"), 1);
07009       else
07010         wsprintf(buf,TEXT("%d%d"), row, row);
07011       break;
07012     case SQL_DECIMAL:
07013     case SQL_NUMERIC:
07014     case SQL_REAL:
07015     case SQL_FLOAT:
07016     case SQL_DOUBLE:
07017       if(row == 2 && !rgField->fUnsigned) /* make the second row negative for variety */
07018         wsprintf(buf,TEXT("-%d.%d"), row, row);
07019       else
07020         wsprintf(buf,TEXT("%d.%d"), row, row);
07021       break;
07022
07023     case SQL_BIT:
07024       if(row > 2)
07025         wsprintf(buf,TEXT("%d"), 1);
07026       else
07027         wsprintf(buf,TEXT("%d"), 0);
07028
07029       break;
07030
07031     case SQL_SMALLINT:
07032     case SQL_INTEGER:
07033     case SQL_TINYINT:
07034     case SQL_BIGINT:
07035       if(row == 2 && !rgField->fUnsigned) /* make the second row negative for variety */
07036         wsprintf(buf,TEXT("-%d"), row);
07037       else
07038         wsprintf(buf,TEXT("%d"), row);
07039       break;
07040
07041     case SQL_TIME:
07042     case SQL_TYPE_TIME:
07043       wsprintf(buf,TEXT("{t '01:%02d:%02d'}"), row % 60, row % 60);
07044       break;
07045     case SQL_DATE:
07046     case SQL_TYPE_DATE:
07047       wsprintf(buf,TEXT("{d '1994-%02d-%02d'}"), (row % 12) + 1, (row % 30) + 1);
07048       break;
07049     case SQL_TIMESTAMP:
07050     case SQL_TYPE_TIMESTAMP:
07051       // precision <= 16 means the timestamp column doesn't have enough precision to hold seconds
07052       if ( rgField->precision > 16 )
07053         wsprintf(buf,TEXT("{ts '1994-%02d-%02d 01:%02d:%02d'}"), (row % 12) + 1, (row % 30) + 1, row % 60, row % 60);
07054       else
07055         wsprintf(buf,TEXT("{ts '1994-%02d-%02d 01:%02d:%02d'}"), (row % 12) + 1, (row % 30) + 1, row % 60, 0);
07056       break;
07057
07058     case SQL_GUID:
07059       _itot(row, szColNum, 10);
07060       _tcscpy(tmpbuf, szColNum);
07061       for (i=0; i<11; i++){
07062         _tcscat(tmpbuf, szColNum);
07063       }
07064       wsprintf(buf, TEXT("%.8s-%.4s-%.4s-%.4s-%.12s"), tmpbuf, tmpbuf, tmpbuf, tmpbuf, tmpbuf);
07065       break;
07066
07067   }
07068   return buf;
07069 }
07070
07071
07072
07073
07074 /*-----------------------------------------------------------------------*/
07075 /*      Function:               TestNumResCols                           */
07076 /*-----------------------------------------------------------------------*/
07077
07078 VOID PASCAL TestNumResCols(SDWORD cColsSelected,QTSTRUCT *lpqt)
07079 {
07080   RETCODE rc=SQL_SUCCESS;
07081   SWORD           wNum;
07082
07083   SelectFromTable(lpqt);
07084
07085   rc = SQLNumResultCols(hstmt, &wNum);
07086   RETCHECK(SQL_SUCCESS, rc,szSQLNUMRESULTCOLS);
07087
07088   if(wNum != cColsSelected)
07089     DISPLAYERROR(szSQLNUMRESULTCOLS,TEXT("incorrect value returned"));
07090
07091   FreeStmt(SQL_CLOSE);
07092
07093 } /* TestNumResCols() */
07094
07095
07096
07097 /*-----------------------------------------------------------------------*/
07098 /*      Function:               TestNumResCols                           */
07099 /*-----------------------------------------------------------------------*/
07100
07101 VOID PASCAL TestCursorName(QTSTRUCT *lpqt)
07102 {
07103   RETCODE rc=SQL_SUCCESS;
07104   TCHAR           szCursorName[MEDBUFF];
07105   SWORD           cb=0;
07106
07107   SelectFromTable(lpqt);
07108
07109   /* the cursor name should be created by the driver since one was        */
07110   /* not specified                                                                                                                                        */
07111
07112   rc = SQLGetCursorName(hstmt, szCursorName, sizeof(szCursorName)/sizeof(TCHAR), &cb);
07113   RETCHECK(SQL_SUCCESS, rc,szSQLGETCURSORNAME);
07114
07115   if(cb > MAX_STRING_SIZE)
07116   {
07117     DISPLAYERROR(szSQLGETCURSORNAME,TEXT("invalid cb"));
07118     cb = MAX_STRING_SIZE;
07119   }
07120
07121   /* don't check the name itself, just make sure that     */
07122   /*      something was returned                                                                          */
07123   if(!*szCursorName)
07124     DISPLAYERROR(szSQLGETCURSORNAME,TEXT("no name returned"));
07125
07126   FreeStmt(SQL_CLOSE);
07127
07128 } /* TestCursorName() */
07129
07130
07131 //-----------------------------------------------------------------------
07132 //      Function:               GetDMVersion
07133 //-----------------------------------------------------------------------
07134
07135 UWORD PASCAL GetDMVersion()
07136 {
07137   RETCODE rc=SQL_SUCCESS;
07138   TCHAR           szNum[MAX_NUM_BUFFER];
07139
07140   rc = SQLGetInfo(hdbc, SQL_ODBC_VER, szNum, sizeof(szNum), NULL);
07141   RETCHECK(SQL_SUCCESS, rc,szSQLGETINFO);
07142
07143   return((UWORD)_ttoi(_tcstok(szNum,TEXT("."))));
07144
07145 } /* GetDMVersion() */
07146
07147
07148 //-----------------------------------------------------------------------
07149 //      Function:               DisplayTestName
07150 //-----------------------------------------------------------------------
07151
07152 VOID PASCAL DisplayTestName(UWORD i)
07153 {
07154   szWrite(szBLANKLINE,TRUE);
07155   szWrite(szTAB,FALSE);
07156   szWrite(iTestNames[i-1], TRUE);
07157
07158 } /* DisplayTestName() */
07159
07160
07161
07162 /***************************  External Interfaces  *************************/
07163 /*  These functions are called by Gator to envoke the tests.               */
07164 /***************************************************************************/
07165
07166 BOOL CALLBACK AutoTestName(LPTSTR szName, UINT  * cbTestCases)
07167 {
07168   static TCHAR szTestName[] = TEXT("Quick Test");
07169
07170   _tcscpy(szName, szTestName);
07171
07172   *cbTestCases = sizeof(iTestNames)/sizeof(LPTSTR);
07173
07174   return TRUE;
07175 }
07176
07177 //-----------------------------------------------------------------------
07178 //      Function:               AutoTestDesc
07179 //      Purpose:                        Provides gator with a list of tests which can be run.
07180 //-----------------------------------------------------------------------
07181 BOOL CALLBACK AutoTestDesc(UWORD iTest, LPTSTR szName, LPTSTR szDesc)
07182 {
07183
07184   UWORD len=0;
07185
07186   if (iTest > (sizeof(iTestNames)/sizeof(LPTSTR)))
07187     return FALSE;
07188
07189   if (szName)
07190   _tcscpy(szName,iTestNames[iTest-1]);
07191
07192   if (szDesc)
07193   _tcscpy(szDesc,TEXT(" "));
07194
07195   return TRUE;
07196
07197 }
07198
07199 //-----------------------------------------------------------------------
07200 //      Function:               AutoTestFunc
07201 //-----------------------------------------------------------------------
07202
07203 void CALLBACK AutoTestFunc(lpSERVERINFO pTestSource)
07204 {
07205
07206   RETCODE                 rc;
07207   UWORD                           cTypes;
07208         UDWORD                  dwLen=0;
07209   UWORD                           fIndex;
07210   SDWORD                  cColsSelected;
07211   FIELDINFO               *rgFields =
07212     (FIELDINFO  *)AllocateMemory(sizeof(FIELDINFO) * MAX_TYPES_SUPPORTED);
07213   QTSTRUCT                        *lpqt =
07214     (QTSTRUCT  *)AllocateMemory(sizeof (QTSTRUCT));
07215   DSTRUCT                 *lpd =
07216     (DSTRUCT  *)AllocateMemory(sizeof (DSTRUCT) * MAX_TYPES_SUPPORTED);
07217   UWORD                           uDMVer;
07218   SDWORD                  cbValue=0;
07219   TCHAR                           szAPI[MEDBUFF];
07220   UWORD                           i;
07221   TCHAR           szState[100]=TEXT(""),
07222         szErrMsg[XLARGEBUFF]=TEXT("");
07223
07224
07225   lpSI = pTestSource;
07226   lpSI->failed = 0;
07227   henv = NULL;
07228   hdbc = NULL;
07229   hstmt = NULL;
07230   hdesc = NULL;
07231
07232   if(lpSI->szValidServer0)
07233   {
07234     if (Connect(lpSI,lpqt))
07235       goto ErrorRet;
07236   }
07237   else
07238   {
07239     henv = lpSI->henv;
07240     hdbc = lpSI->hdbc;
07241
07242     rc = SQLSetConnectOption(hdbc,SQL_ODBC_CURSORS,dwLen);
07243     _tcscpy(szAPI,szSQLSETCONNECTOPTION);
07244
07245     if(RETCHECK(SQL_SUCCESS, rc,szAPI))
07246       lpSI->vCursorLib = dwLen;
07247   }
07248
07249   uDMVer=GetDMVersion();
07250
07251   fIndex=CheckConformanceLevel();
07252
07253   fBindParameter=Supported(SQL_API_SQLBINDPARAMETER);
07254   fDiagRecSupported=Supported(SQL_API_SQLGETDIAGREC);
07255   fDiagFieldSupported=Supported(SQL_API_SQLGETDIAGFIELD);
07256
07257
07258   AllocHstmt();
07259
07260   if (!(cTypes=GetTypeInfo(rgFields,lpqt)))
07261     goto ErrorRet;
07262
07263   guwRowCount=cTypes+1;   // Extra row inserted with DAE.
07264
07265   // cTypes=20;                     //DEBUG
07266
07267   /* build create statement */
07268   if (BuildCreateStmt(lpqt,rgFields,cTypes))
07269     goto ErrorRet;
07270
07271   /* put together the insert statement, and set the parameters   */
07272   /* parameters are only set the first time through, after which */
07273   /* the contents of the pointers is changed                     */
07274   if (BuildInsertStmt(lpqt, rgFields,cTypes,lpd,&cColsSelected,fBindParameter))
07275     goto ErrorRet;
07276
07277   CreateParamQuery(lpqt,rgFields,cTypes);
07278
07279   for(i=1;i <= (sizeof(iTestNames)/sizeof(LPTSTR));i++)
07280   {
07281     lpqt->sz[0] = TEXT('\0');
07282
07283     if(GETBIT(pTestSource->rglMask,i))
07284     {
07285       /* Display current Test */
07286       DisplayTestName(i);
07287
07288       switch(i)
07289       {
07290         case 1:
07291           TestConnectionOptions();
07292           break;
07293         case 2:
07294           TestStmtOptions();
07295           break;
07296         case 3:
07297           TestCursorName(lpqt);
07298           break;
07299         case 4:
07300           TestData(lpqt,rgFields,cTypes,lpd);
07301           break;
07302         case 5:
07303           TestNumResCols(cColsSelected,lpqt);
07304           break;
07305         case 6:
07306           TestMetaData(lpSI,lpqt,rgFields,cTypes);
07307           break;
07308         case 7:
07309           TestSearchedQuery(lpqt,rgFields,cTypes,lpd,fBindParameter);
07310           break;
07311         case 8:
07312           TestLargeQuery(lpqt,rgFields,cTypes,lpd);
07313           break;
07314         case 9:
07315           TestSQLTables(lpqt);
07316           break;
07317         case 10:
07318           TestSQLStatistics(lpqt,rgFields,cTypes,lpd,fIndex);
07319           break;
07320         case 11:
07321           TestSQLSpecialCols(lpqt);
07322           break;
07323         case 12:
07324           TestLikeQuery(lpqt,rgFields,cTypes,lpd);
07325           break;
07326         case 13:
07327           TestSQLForeignKeys(lpqt);
07328           break;
07329         case 14:
07330           TestSQLBrowseConnect(lpSI);
07331           break;
07332         case 15:
07333           TestSQLDataSources();
07334           break;
07335         case 16:
07336           TestSQLDrivers();
07337           break;
07338         case 17:
07339           TestSQLMoreResults(lpqt);
07340           break;
07341         case 18:
07342           TestSQLNativeSQL(lpqt);
07343           break;
07344         case 19:
07345           TestSQLDescribeParam(lpqt);
07346           break;
07347         case 20:
07348           TestSQLNumParams(lpqt);
07349           break;
07350         case 21:
07351           TestSQLParamOptions(lpqt);
07352           break;
07353         case 22:
07354           TestSQLPrimaryKeys(lpqt);
07355           break;
07356         case 23:
07357           TestSQLProcedures();
07358           break;
07359         case 24:
07360           TestSQLTablePrivileges();
07361           break;
07362         case 25:
07363           TestSQLColumnPrivileges(lpqt);
07364           break;
07365         case 26:
07366           TestSQLSetScrollOptions();
07367           break;
07368         case 27:
07369           TestExtendedFetch(lpqt,rgFields,cTypes);
07370           break;
07371         case 28:
07372           TestOJCap(lpqt);
07373           break;
07374         case 29:
07375           TestSQLSetConnectAttr();
07376           break;
07377         case 30:
07378           TestSQLSetStmtAttr();
07379           break;
07380         case 31:
07381           TestThreading(lpSI,lpqt,rgFields);
07382           break;
07383         case 32:
07384           TestGetDescField(lpqt);
07385           break;
07386         case 33:
07387           TestSetDescField(lpqt);
07388           break;
07389         case 34:
07390           TestGetDescRec(lpqt);
07391           break;
07392         case 35:
07393           TestSetDescRec(lpqt);
07394           break;
07395         case 36:
07396           TestCopyDesc(lpqt);
07397           break;
07398         case 37:
07399           TestDescDefaults(lpqt);
07400           break;
07401         case 38:
07402           TestUseDesc(lpqt, rgFields);
07403           break;
07404         case 39:
07405           TestEnvAttr();
07406           break;
07407         case 40:
07408           TestEndTran(lpqt,rgFields,cTypes,lpd);
07409           break;
07410         case 41:
07411           TestBindParam(lpqt,rgFields,cTypes,lpd);
07412           break;
07413         case 42:
07414           TestQuickRebind(lpqt,rgFields,cTypes,lpd);
07415           break;
07416         case 43:
07417           TestFetchScroll(lpqt);
07418           break;
07419         case 44:
07420           TestDiagRec();
07421           break;
07422         case 45:
07423           TestDiagField();
07424           break;
07425         case 46:
07426           TestMixedAnsiUnicode(lpqt);
07427           break;
07428
07429       } /* switch(i) */
07430
07431     } /* if(GETBIT(pTestSource->rglMask,i)) */
07432
07433   }
07434
07435   //the end of test cases for ODBC SDK 3.0
07436
07437   /* finished testing, clean up */
07438   CleanUp(lpd,lpqt,rgFields,lpqt->szTableName,FALSE,lpSI->szValidServer0);
07439
07440   szWrite(szBLANKLINE,TRUE);
07441
07442   lpSI->cErrors = lpSI->failed;
07443
07444   return;
07445
07446 ErrorRet:
07447   /* a failure in an ODBC function that prevents completion of the        */
07448   /* test - for example, connect to the server                                                    */
07449
07450   szWrite(TEXT("\t\t *** Unrecoverable Quick Test FAILURE ***"), TRUE);
07451
07452   /* finished testing, clean up */
07453   CleanUp(lpd,lpqt,rgFields,lpqt->szTableName,FALSE,lpSI->szValidServer0);
07454
07455   lpSI->cErrors = ABORT;
07456
07457   return;
07458 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapirecv/avifilewriter.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapirecv

avifilewriter.h

Go to the documentation of this file.
00001 /*
00002
00003 Copyright (c) 1999 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     AVIFileWriter.h
00008
00009 Abstract:
00010
00011     Declaration for the AVIFileWriter class.
00012
00013 */
00014
00015 #if !defined(AFX_AVIFILEWRITER_H__75ED6641_F059_4EC1_AAB2_867109AA7695__INCLUDED_)
00016 #define AFX_AVIFILEWRITER_H__75ED6641_F059_4EC1_AAB2_867109AA7695__INCLUDED_
00017
00018
00019 //
00020 // an abstraction for a media file open for reading
00021 //
00022
00023 class CAVIFileWriter
00024 {
00025
00026 public:
00027
00028
00029     //
00030     // initialization (including opening file)
00031     //
00032
00033     HRESULT Initialize(IN const CHAR *psFileName,
00034                        IN const WAVEFORMATEX &WaveFormat);
00035
00036
00037     //
00038     // zero data members
00039     //
00040
00041     CAVIFileWriter();
00042
00043
00044     //
00045     // close file
00046     //
00047
00048   virtual ~CAVIFileWriter();
00049
00050
00051     //
00052     // write data
00053     //
00054
00055     HRESULT Write(IN BYTE *pBuffer,
00056                   IN ULONG nBytesToWrite,
00057                   IN OUT ULONG *pnBytesWritten);
00058
00059 private:
00060
00061     //
00062     // file handle
00063     //
00064
00065     PAVIFILE m_pAVIFile;
00066
00067
00068     //
00069     // audio stream
00070     //
00071
00072     PAVISTREAM  m_pAudioStream;
00073
00074
00075     //
00076     // size of one sample
00077     //
00078
00079     LONG m_nSampleSize;
00080
00081
00082 };
00083
00084 #endif // !defined(AFX_AVIFILEWRITER_H__75ED6641_F059_4EC1_AAB2_867109AA7695__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/complist.h Source File

  • Begin
  • sdkdiff

complist.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #ifndef __COMPLIST_H__
00012 #define __COMPLIST_H__
00013
00014 /*
00015  *
00016  * complist -  a list of CompItems
00017  *
00018  * build a list of CompItems from various sources. That is to say, build
00019  * two corresponding lists of filenames (DIRLISTs) and then build a list
00020  * of CompItems, with one CompItem for each pair of files whose names
00021  * match, and one CompItem for each unmatched name.
00022  *
00023  * when building the complist, a view handle can be given. If this is non-null,
00024  * the CompList will register with the view (calling view_setcomplist), and
00025  * will inform the view of each compitem added, during the build
00026  * process (so that the user can be kept up to date during a lengthy scan).
00027  *
00028  * We can return a handle to this list of CompItems on demand.
00029  *
00030  * The CompList owns the DIRLISTs and the list of CompItems. If you delete
00031  * the CompList, you delete all of these.
00032  */
00033
00034
00035 /* view.h includes the term COMPLIST: we need to use the term VIEW.
00036  * Alas MIPS doesn't allow duplicate definitions, even harmless ones,
00037  * so we need to play games.  Whoever declares it first does
00038  * the real declares and the second one gets no-ops.
00039  * We don't care what a VIEW  is. Whatever you give us, we will
00040  * pass to the view_setcomplist function and view_newitem, and that is all.
00041  */
00042 #ifndef INC_VIEW_COMPLIST
00043 #define INC_VIEW_COMPLIST
00044 typedef struct compitem FAR* COMPITEM;          /* handle to a compitem */
00045 typedef struct view FAR * VIEW;                 /* handle to a VIEW     */
00046 typedef struct complist FAR * COMPLIST;         /* handle to a complist */
00047 #endif // INC_VIEW_COMPLIST
00048
00049
00050 /*
00051  * build a complist by putting up two dialogs to allow the user to
00052  * select two files. This will build a Complist with one CompItem (even
00053  * if the names don't match).
00054  */
00055 COMPLIST complist_filedialog(VIEW view);
00056
00057 /*
00058  * build a complist by putting up a dialog in which the user can specify
00059  * two directories. The directories will then be scanned and a CompItem
00060  * added to the list for each pair of names that match, and one for each
00061  * unmatched name
00062  */
00063 COMPLIST complist_dirdialog(VIEW view);
00064
00065
00066 /* build a complist from the two pathnames provided */
00067 COMPLIST complist_args(LPSTR path1, LPSTR path2, VIEW view, BOOL fDeep);
00068
00069
00070 /* build/append a complist from the two pathnames provided (either or both is
00071  * allowed to be null).
00072  */
00073 void complist_append(COMPLIST *pcl, LPCSTR path1, LPCSTR path2, int *psequence);
00074 BOOL complist_appendfinished(COMPLIST *pcl, LPCSTR pszLeft, LPCSTR pszRight, VIEW view);
00075
00076
00077
00078 /* delete a complist and all associated CompItems and DIRLISTs. Note this
00079  * does not delete any VIEW - the VIEW owns the COMPLIST and not the other
00080  * way around.
00081  */
00082 void complist_delete(COMPLIST cl);
00083
00084 /*
00085  * get the handle to the list of COMPITEMs. The list continues to be
00086  * owned by the COMPLIST, so don't delete except by calling complist_delete.
00087  */
00088 LIST complist_getitems(COMPLIST cl);
00089
00090
00091 /* save the list of files as a series of lines to a file. query the user
00092  * for the name of the file to write, and the states of lines to be
00093  * included.
00094  *
00095  * if savename is not null, write the list out to savename using listopts.
00096  * otherwise, prompt by dialog for filename and options.
00097  */
00098 void complist_savelist(COMPLIST cl, LPSTR savename, UINT listopts);
00099
00100
00101 /*
00102  * get the description of this complist - a name in the form %s : %s with
00103  * the dir_getrootdescription() for each side.
00104  */
00105 LPSTR complist_getdescription(COMPLIST cl);
00106
00107 /* free up memory allocated in a call to complist_getdescription() */
00108 void complist_freedescription(COMPLIST cl, LPSTR path);
00109
00110
00111 /*
00112  * copy files to a new directory newroot. if newroot is NULL, query the user
00113  * via a dialog to get the new dir name and options.
00114  *
00115  * options are either COPY_FROMLEFT or COPY_FROMRIGHT (indicating which
00116  * tree is to be the source of the files, plus any or all of
00117  * INCLUDE_SAME, INCLUDE_DIFFER and INCLUDE_LEFT (INCLUDE_LEFT
00118  * and INCLUDE_RIGHT are treated the same here since the COPY_FROM* option
00119  * indicates which side to copy from).
00120  */
00121
00122 /* option flags */
00123 #define COPY_FROMLEFT       0x100           /* copy files from left tree */
00124 #define COPY_FROMRIGHT      0x200           /* copy files from right tree */
00125 #define COPY_HITREADONLY    0x400           /* overwrite read only files */
00126
00127 void complist_copyfiles(COMPLIST cl, LPSTR newroot, UINT options);
00128
00129
00130 /* return time last operation took in milliseconds */
00131 DWORD complist_querytime(void);
00132
00133
00134 /*
00135  * complist_togglemark
00136  *
00137  * each compitem has a BOOL mark state. This function inverts the value of
00138  * this state for each compitem in the list.
00139  */
00140 void complist_togglemark(COMPLIST cl);
00141
00142
00143 /*
00144  * complist_itemcount
00145  *
00146  * return the number of items in the list
00147  */
00148 UINT
00149 complist_itemcount(COMPLIST cl);
00150
00151
00152 /*
00153  * query the user for a pattern to match.
00154  * all compitems with this pattern in their tag string will be
00155  * marked (the mark state will be set to TRUE);
00156  *
00157  * returns TRUE if any states changed
00158  */
00159 BOOL complist_markpattern(COMPLIST cl);
00160 #endif
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::RecordOpenOptionsEnum Member List

This is the complete list of members for msado15::RecordOpenOptionsEnum, including all inherited members.
adDelayFetchFields | msado15::RecordOpenOptionsEnum | [static]
adDelayFetchStream | msado15::RecordOpenOptionsEnum | [static]
adOpenAsync | msado15::RecordOpenOptionsEnum | [static]
adOpenSource | msado15::RecordOpenOptionsEnum | [static]
adOpenURLBind | msado15::RecordOpenOptionsEnum | [static]
Generated on Wed Nov 13 2024 16:58:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/DataSource/stdafx.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • DataSource

stdafx.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            stdafx.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #include "stdafx.h"
00013
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/addgroup/vc/main.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • addgroup
  • vc

main.cpp

Go to the documentation of this file.
00001
00002 #define INC_OLE2
00003 #define UNICODE 1
00004 #define _WIN32_DCOM
00005
00006 #include <windows.h>
00007 #include <winuser.h>
00008
00009 #include <stdio.h>
00010 #include <stdlib.h>
00011 #include <string.h>
00012 #include <malloc.h>
00013 #include <winldap.h>
00014
00015 #include <activeds.h>
00016 #include <assert.h>
00017
00018
00019 ////////////////////////////////////////////////////////////////////////////////////////////////////
00020 // String for usage information
00021 WCHAR * pwszUsage = L"Adds new group under the passed container.\n"
00022                     L"Usage:\n"
00023                     L"AddGroup <Path of container>\n"
00024                     L"              ADsPath of the container for placing the new group\n"
00025                     L"         <Windows2000 Group Name> \n"
00026                     L"              This is the name for the new group\n"
00027                     L"         <Downlevel NT 4 Sam Account name>\n"
00028                     L"              Cannot exceed 20 characters and must be globally unique\n"
00029                     L"         \nOptional:\n"
00030                     L"         <Group Type>\n"
00031                     L"              Possible values: 'global' or 'local' or 'universal'\n"
00032                     L"         <Security >\n"
00033                     L"             Possible values: 'Security' or 'NoSecurity' \n"
00034                     L"             If security is specified, new group will be created with \n"
00035                     L"             ADS_GROUP_TYPE_SECURITY_ENABLED.If parameter is not supplied,\n"
00036                     L"             new group will be created with ADS_GROUP_TYPE_SECURITY_ENABLED\n";
00037
00038
00039 ////////////////////////////////////////////////////////////////////////////////////////////////////
00040 // Module level global variables
00041 BSTR bsADsPathContainer;
00042 BSTR bsNT5GroupName;
00043 BSTR bsSamAcctName;
00044 int iGroupType;
00045
00046 ////////////////////////////////////////////////////////////////////////////////////////////////////
00047 // Forward Declarations
00048 BOOL ParseCommandLine( int argc, wchar_t *argv[ ]);
00049 HRESULT CreateGroup(IDirectoryObject *pDirObject, LPWSTR pwCommonName,LPWSTR pwSamAcctName,
00050                     IDirectoryObject ** ppDirObjRet,int iGroupType);
00051 void PrintIADSObject(IADs * pIADs);
00052 void CheckADHRESULT(HRESULT passedhr,LPOLESTR pwReason);
00053 WCHAR * CrackADError(HRESULT hResult);
00054
00055
00056 ////////////////////////////////////////////////////////////////////////////////////////////////////
00057 // main()
00058
00059 /* Note: Using the UNICODE version of main().
00060    this removes the need for the sample to include
00061    UNICODE-ANSI conversion routines
00062 */
00063 void wmain( int argc, wchar_t *argv[ ])
00064 {
00065
00066     HRESULT hr;
00067     IDirectoryObject * pDirObjectContainer = NULL;
00068     IDirectoryObject * pDirObjRet = NULL;
00069
00070     if (!ParseCommandLine(argc,argv))
00071         goto ret;
00072
00073     // Initialize COM
00074     CoInitialize(0);
00075
00076     // Bind to the container passed
00077     hr = ADsGetObject(  bsADsPathContainer, IID_IDirectoryObject,(void **)&pDirObjectContainer);
00078
00079     if (SUCCEEDED(hr))
00080     {
00081         // Call the helper funtion to create the group
00082         hr = CreateGroup(pDirObjectContainer, bsNT5GroupName,bsSamAcctName,
00083                          &pDirObjRet,iGroupType);
00084
00085         if (SUCCEEDED(hr))
00086         {
00087             _putws(L"\n New Group created with the following properties:");
00088
00089             IADs * pIADsNewGoup = NULL;
00090
00091             // Group succeeded- now get an IADs interface to it
00092             // and print some properties
00093             hr = pDirObjRet->QueryInterface(IID_IADs,(void**)&pIADsNewGoup);
00094
00095             if (SUCCEEDED(hr))
00096             {
00097                 PrintIADSObject(pIADsNewGoup);
00098
00099                 pIADsNewGoup->Release();
00100                 pIADsNewGoup = NULL;
00101             }
00102             else
00103                 CheckADHRESULT(hr,L"QueryInterface() - New group for IADs");
00104             pDirObjRet->Release();
00105             pDirObjRet = NULL;
00106         }
00107         else
00108             CheckADHRESULT(hr,L"CreateGroup()");
00109
00110         pDirObjectContainer->Release();
00111         pDirObjectContainer = NULL;
00112     }
00113     else
00114         CheckADHRESULT(hr,L"ADsGetObject()");
00115
00116     CoUninitialize();
00117     ret:
00118     if(!bsADsPathContainer) SysFreeString(bsADsPathContainer);
00119     if(!bsNT5GroupName) SysFreeString(bsNT5GroupName);
00120     if(!bsSamAcctName) SysFreeString(bsSamAcctName);
00121
00122  }
00123
00124
00125 ////////////////////////////////////////////////////////////////////////////////////////////////////
00126 /*
00127     ParseCommandLine()- Parses command line and sets module level globals
00128
00129     Parameters:
00130
00131         int argc            - Number of Arguments
00132         wchar_t *argv[ ]    - Array of arguments
00133
00134     Returns:
00135         TRUE if Command line was successfully parsed
00136 */
00137
00138 BOOL ParseCommandLine( int argc, wchar_t *argv[ ])
00139 {
00140   if (argc < 4 || argc >6)
00141   {
00142         _putws(pwszUsage);
00143         return FALSE;
00144     }
00145     // if we have at least 3 arguments (the first is the EXE name)
00146     // Save them
00147     if (argc >= 4)
00148     {
00149         bsADsPathContainer  = SysAllocString(argv[1]);
00150         bsNT5GroupName      = SysAllocString(argv[2]);
00151         if(wcslen(bsNT5GroupName)>64) return FALSE;
00152         bsSamAcctName       = SysAllocString(argv[3]);
00153     }
00154
00155     // was the group type passed in?
00156     if (argc >=5)
00157     {
00158         if (_wcsicmp(L"global",argv[4])==0)
00159             iGroupType = ADS_GROUP_TYPE_GLOBAL_GROUP;
00160
00161         else if (_wcsicmp(L"local",argv[4])==0)
00162             iGroupType = ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP;
00163
00164         else if (_wcsicmp(L"universal",argv[4])==0)
00165             iGroupType = ADS_GROUP_TYPE_UNIVERSAL_GROUP;
00166
00167         else
00168       {
00169             _putws(L"!! Incorrect Group Type Parameter !!");
00170             _putws(pwszUsage);
00171             return FALSE;
00172         }
00173     }
00174      else   // Default to Global
00175         iGroupType = ADS_GROUP_TYPE_GLOBAL_GROUP;
00176
00177     // was security enabled passed in?
00178     if (argc ==6)
00179     {
00180         if (_wcsicmp(L"security",argv[5])==0)
00181             iGroupType |= ADS_GROUP_TYPE_SECURITY_ENABLED;
00182
00183         // else if the parameter there is NOT nosecurity- error
00184         else if (!(_wcsicmp(L"nosecurity",argv[5])==0))
00185         {
00186             _putws(L"!! Incorrect security Parameter !!");
00187             _putws(pwszUsage);
00188             return FALSE;
00189         }
00190
00191     }
00192     else    // Default to security
00193         iGroupType |= ADS_GROUP_TYPE_SECURITY_ENABLED;
00194
00195     return TRUE;
00196 }
00197
00198 ////////////////////////////////////////////////////////////////////////////////////////////////////
00199 /*  CreateGroup()   - Function for creating a basic group
00200
00201     Parameters
00202
00203         IDirectoryObject *pDirObject    -   Parent Directory Object for the new group
00204         LPWSTR pwCommonName             -   Common Name for the new group
00205         IDirectoryObject ** ppDirObjRet -   Pointer to the Pointer which will receive the new Group
00206         int iGroupType                  -   Bitflags for new group:
00207                                                                     ADS_GROUP_TYPE_GLOBAL_GROUP,
00208                                                                     ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP,
00209                                                                     ADS_GROUP_TYPE_UNIVERSAL_GROUP,
00210                                                                     ADS_GROUP_TYPE_SECURITY_ENABLED
00211 */
00212 HRESULT CreateGroup(IDirectoryObject *pDirObject, LPWSTR pwCommonName,LPWSTR pwSamAcctName,IDirectoryObject ** ppDirObjRet,int iGroupType)
00213 {
00214     assert(pDirObject);
00215     if (wcslen(pwSamAcctName) >256)
00216     {
00217         MessageBox(NULL,L"SamAccountName CANNOT be bigger than 256 characters",L"Error: CreateSimpleGroup()",MB_ICONSTOP);
00218         assert(0);
00219         return E_FAIL;
00220     }
00221
00222     HRESULT    hr;
00223     ADSVALUE   sAMValue;
00224     ADSVALUE   classValue;
00225     ADSVALUE   groupType;
00226
00227     LPDISPATCH pDisp;
00228     WCHAR       pwCommonNameFull[1024];
00229
00230     ADS_ATTR_INFO  attrInfo[] =
00231     {
00232        { L"objectClass", ADS_ATTR_UPDATE,
00233                            ADSTYPE_CASE_IGNORE_STRING, &classValue, 1 },
00234        {L"sAMAccountName", ADS_ATTR_UPDATE,
00235                            ADSTYPE_CASE_IGNORE_STRING, &sAMValue, 1},
00236        {L"groupType", ADS_ATTR_UPDATE,
00237                            ADSTYPE_INTEGER, &groupType, 1}
00238     };
00239
00240     DWORD dwAttrs = sizeof(attrInfo)/sizeof(ADS_ATTR_INFO);
00241
00242     classValue.dwType = ADSTYPE_CASE_IGNORE_STRING;
00243     classValue.CaseIgnoreString = L"group";
00244
00245     sAMValue.dwType=ADSTYPE_CASE_IGNORE_STRING;
00246     sAMValue.CaseIgnoreString = pwSamAcctName;
00247
00248     groupType.dwType=ADSTYPE_INTEGER;
00249     groupType.Integer =  iGroupType;
00250
00251     wsprintfW(pwCommonNameFull,L"CN=%s",pwCommonName);
00252
00253     hr = pDirObject->CreateDSObject( pwCommonNameFull,  attrInfo,
00254                                 dwAttrs, &pDisp );
00255     if (SUCCEEDED(hr))
00256     {
00257         hr = pDisp->QueryInterface(IID_IDirectoryObject,(void**) ppDirObjRet);
00258
00259         pDisp->Release();
00260         pDisp = NULL;
00261     }
00262     return hr;
00263 }
00264
00265
00266 ////////////////////////////////////////////////////////////////////////////////////////////////////
00267 /*
00268     PrintIADSObject()       -   Calls all the methods on a IADs object
00269                                 and prints them the console window
00270     Parameters
00271
00272         IADs * pIADs        - IADs Interface from which to retrieve attribute values
00273 */
00274 void PrintIADSObject(IADs * pIADs)
00275 {
00276   assert(pIADs);
00277
00278   BSTR bsResult;
00279   HRESULT hr = S_OK;
00280
00281   hr = pIADs->get_Name(&bsResult);
00282   if(FAILED(hr)) {wprintf(L" Failed to get name\n"); return;}
00283   wprintf(L" NAME: %s\n",(LPOLESTR) bsResult);
00284   SysFreeString(bsResult);
00285
00286   hr = pIADs->get_Class(&bsResult);
00287   if(FAILED(hr)) {wprintf(L" Failed to get class\n"); return;}
00288   wprintf(L" CLASS: %s\n",(LPOLESTR) bsResult);
00289   SysFreeString(bsResult);
00290
00291   hr = pIADs->get_GUID(&bsResult);
00292   if(FAILED(hr)) {wprintf(L" Failed to get GUID\n"); return;}
00293   wprintf(L" GUID: %s\n",(LPOLESTR) bsResult);
00294   SysFreeString(bsResult);
00295
00296   hr = pIADs->get_ADsPath(&bsResult);
00297   if(FAILED(hr)) {wprintf(L" Failed to get ADsPath\n"); return;}
00298   wprintf(L" ADSPATH: %s\n",(LPOLESTR) bsResult);
00299   SysFreeString(bsResult);
00300
00301   hr = pIADs->get_Parent(&bsResult);
00302   if(FAILED(hr)) {wprintf(L" Failed to get parent\n"); return;}
00303   wprintf(L" PARENT: %s\n",(LPOLESTR) bsResult);
00304   SysFreeString(bsResult);
00305
00306   hr = pIADs->get_Schema(&bsResult);
00307   if(FAILED(hr)) {wprintf(L" Failed to get schema\n"); return;}
00308   wprintf(L" SCHEMA: %s\n",(LPOLESTR) bsResult);
00309   SysFreeString(bsResult);
00310
00311
00312 }
00313
00314 ////////////////////////////////////////////////////////////////////////////////////////////////////
00315 ////////////////////////////////////////////////////////////////////////////////////////////////////
00316 ////////////////////////////////////////////////////////////////////////////////////////////////////
00317 ////////////////////////////////////////////////////////////////////////////////////////////////////
00318 ////////////////////////////////////////////////////////////////////////////////////////////////////
00319 // Error Handling routines
00320
00321 // Will display ADSI or COM error messages
00322 // when passed a BAD Hresult
00323 void CheckADHRESULT(HRESULT passedhr,LPOLESTR pwReason)
00324 {
00325     if (SUCCEEDED(passedhr))
00326         return;
00327
00328     HRESULT hr;
00329     DWORD lError;
00330     WCHAR pwErrBuff[2048];
00331     WCHAR pwADErrBuff[512];
00332
00333     WCHAR * pADErrCodeStr;
00334
00335     pwErrBuff[0] = NULL;
00336     pADErrCodeStr = CrackADError( passedhr);
00337
00338     // If an ADSI error code was returned, display it
00339     if (pADErrCodeStr[0] != NULL)
00340     {
00341         wcscat(pwErrBuff,L"<*> ADSI Error HRESULT Returns: <*> \n");
00342         wcscat(pwErrBuff,pADErrCodeStr);
00343         wcscat(pwErrBuff,L"\n");
00344     }
00345
00346     // Call ADsGetLastError() to retrieve the error text from ADSI
00347     wcscat(pwErrBuff,L"<*> ADSI Error: <*>\n");
00348
00349     hr = ADsGetLastError(
00350         &lError,
00351         pwADErrBuff,
00352         511,
00353         L"",
00354         0
00355         );
00356
00357
00358     if (FAILED(hr))
00359         wcscat(pwErrBuff,L"<Unable to retrieve ADs Error>");
00360     else
00361         wcscat(pwErrBuff,pwADErrBuff);
00362
00363     wcscat(pwErrBuff,L"\n");
00364
00365     WCHAR sz[1024];
00366
00367     wcscat(pwErrBuff,L"<*> System Error: <*> \n");
00368
00369     // Check the standard system to crack the bad HRESULT into a string
00370     if (!FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, 0, passedhr, 0, sz, 1024, 0))
00371         wcscat(sz, L"Unknown HRESULT error");
00372     else
00373         wcscat(pwErrBuff, sz);
00374
00375     // Display
00376     OutputDebugStringW(pwErrBuff);
00377     OutputDebugStringW(L"\r\n");
00378     _putws(L"\n**********");
00379     wprintf(L"\nERROR on %s\n\n",pwReason);
00380     _putws(pwErrBuff);
00381     _putws(L"\n**********");
00382
00383 }
00384
00385 WCHAR * CrackADError(HRESULT hResult)
00386 {
00387    static WCHAR szwText[ 128 ];
00388    szwText[0] = 0l;
00389
00390    switch( hResult )
00391    {
00392       case  E_ADS_BAD_PATHNAME:
00393          return L"E_ADS_BAD_PATHNAME";
00394          break;
00395
00396       case  E_ADS_INVALID_DOMAIN_OBJECT:
00397          return L"E_ADS_INVALID_DOMAIN_OBJECT";
00398          break;
00399
00400       case  E_ADS_INVALID_USER_OBJECT:
00401          return L"E_ADS_INVALID_USER_OBJECT";
00402          break;
00403
00404       case  E_ADS_INVALID_COMPUTER_OBJECT:
00405          return L"E_ADS_INVALID_COMPUTER_OBJECT";
00406          break;
00407
00408       case  E_ADS_UNKNOWN_OBJECT:
00409          return L"E_ADS_UNKNOWN_OBJECT";
00410          break;
00411
00412       case  E_ADS_PROPERTY_NOT_SET:
00413          return L"E_ADS_PROPERTY_NOT_SET";
00414          break;
00415
00416       case  E_ADS_PROPERTY_NOT_SUPPORTED:
00417          return L"E_ADS_PROPERTY_NOT_SUPPORTED";
00418          break;
00419
00420       case  E_ADS_PROPERTY_INVALID:
00421          return L"E_ADS_PROPERTY_INVALID";
00422          break;
00423
00424       case  E_ADS_BAD_PARAMETER:
00425          return L"E_ADS_BAD_PARAMETER";
00426          break;
00427
00428       case  E_ADS_OBJECT_UNBOUND:
00429          return L"E_ADS_OBJECT_UNBOUND";
00430          break;
00431
00432       case  E_ADS_PROPERTY_NOT_MODIFIED:
00433          return L"E_ADS_PROPERTY_NOT_MODIFIED";
00434          break;
00435
00436       case  E_ADS_PROPERTY_MODIFIED:
00437          return L"E_ADS_PROPERTY_MODIFIED";
00438          break;
00439
00440       case  E_ADS_CANT_CONVERT_DATATYPE:
00441          return L"E_ADS_CANT_CONVERT_DATATYPE";
00442          break;
00443
00444       case  E_ADS_PROPERTY_NOT_FOUND:
00445          return L"E_ADS_PROPERTY_NOTFOUND";
00446          break;
00447
00448       case  E_ADS_OBJECT_EXISTS:
00449          return L"E_ADS_OBJECT_EXISTS";
00450          break;
00451
00452       case  E_ADS_SCHEMA_VIOLATION:
00453          return L"E_ADS_SCHEMA_VIOLATION";
00454          break;
00455
00456       case  E_ADS_COLUMN_NOT_SET:
00457          return L"E_ADS_COLUMN_NOT_SET";
00458          break;
00459
00460       case  E_ADS_INVALID_FILTER:
00461          return L"E_ADS_INVALID_FILTER";
00462          break;
00463
00464       case  HRESULT_FROM_WIN32(ERROR_DS_OPERATIONS_ERROR):
00465          return L"ERROR_DS_OPERATIONS_ERROR";
00466          break;
00467
00468       case  HRESULT_FROM_WIN32(ERROR_DS_PROTOCOL_ERROR):
00469          return L"ERROR_DS_PROTOCOL_ERROR";
00470          break;
00471
00472       case  HRESULT_FROM_WIN32(ERROR_DS_TIMELIMIT_EXCEEDED):
00473          return L"ERROR_DS_TIMELIMIT_EXCEEDED";
00474          break;
00475
00476       case  HRESULT_FROM_WIN32(ERROR_DS_SIZELIMIT_EXCEEDED):
00477          return L"ERROR_DS_SIZELIMIT_EXCEEDED";
00478          break;
00479
00480       case  HRESULT_FROM_WIN32(ERROR_DS_COMPARE_FALSE):
00481          return L"ERROR_DS_COMPARE_FALSE";
00482          break;
00483
00484
00485       case  HRESULT_FROM_WIN32(ERROR_DS_COMPARE_TRUE):
00486          return L"ERROR_DS_COMPARE_TRUE";
00487          break;
00488
00489
00490       case  HRESULT_FROM_WIN32(ERROR_DS_AUTH_METHOD_NOT_SUPPORTED):
00491          return L"ERROR_DS_AUTH_METHOD_NOT_SUPPORTED";
00492          break;
00493
00494
00495       case  HRESULT_FROM_WIN32(ERROR_DS_STRONG_AUTH_REQUIRED):
00496          return L"ERROR_DS_STRONG_AUTH_REQUIRED";
00497          break;
00498
00499
00500       case  HRESULT_FROM_WIN32(ERROR_MORE_DATA):
00501          return L"ERROR_MORE_DATA";
00502          break;
00503
00504       case  HRESULT_FROM_WIN32(ERROR_DS_REFERRAL):
00505          return L"(ERROR_DS_REFERRAL";
00506          break;
00507
00508       case  HRESULT_FROM_WIN32(ERROR_DS_ADMIN_LIMIT_EXCEEDED):
00509          return L"ERROR_DS_ADMIN_LIMIT_EXCEEDED";
00510          break;
00511
00512
00513       case  HRESULT_FROM_WIN32(ERROR_DS_UNAVAILABLE_CRIT_EXTENSION):
00514          return L"(ERROR_DS_UNAVAILABLE_CRIT_EXTENSION";
00515          break;
00516
00517       case  HRESULT_FROM_WIN32(ERROR_DS_CONFIDENTIALITY_REQUIRED):
00518          return L"HRESULT_FROM_WIN32(ERROR_DS_CONFIDENTIALITY_REQUIRED";
00519          break;
00520
00521       case  HRESULT_FROM_WIN32(ERROR_DS_NO_ATTRIBUTE_OR_VALUE):
00522          return L"ERROR_DS_NO_ATTRIBUTE_OR_VALUE";
00523          break;
00524
00525       case  HRESULT_FROM_WIN32(ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED):
00526          return L"(ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED";
00527          break;
00528
00529       case  HRESULT_FROM_WIN32(ERROR_DS_INAPPROPRIATE_MATCHING):
00530          return L"(ERROR_DS_INAPPROPRIATE_MATCHING";
00531          break;
00532
00533       case  HRESULT_FROM_WIN32(ERROR_DS_CONSTRAINT_VIOLATION):
00534          return L"ERROR_DS_CONSTRAINT_VIOLATION";
00535          break;
00536
00537       case  HRESULT_FROM_WIN32(ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS):
00538          return L"ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS";
00539          break;
00540
00541       case  HRESULT_FROM_WIN32(ERROR_DS_INVALID_ATTRIBUTE_SYNTAX):
00542          return L"ERROR_DS_INVALID_ATTRIBUTE_SYNTAX";
00543          break;
00544
00545       case  HRESULT_FROM_WIN32(ERROR_DS_NO_SUCH_OBJECT):
00546          return L"ERROR_DS_NO_SUCH_OBJECT";
00547          break;
00548
00549
00550       case  HRESULT_FROM_WIN32(ERROR_DS_INVALID_DN_SYNTAX):
00551          return L"ERROR_DS_INVALID_DN_SYNTAX";
00552          break;
00553
00554       case  HRESULT_FROM_WIN32(ERROR_DS_IS_LEAF):
00555          return L"ERROR_DS_IS_LEAF";
00556          break;
00557
00558       case  HRESULT_FROM_WIN32(ERROR_DS_ALIAS_DEREF_PROBLEM):
00559          return L"ERROR_DS_ALIAS_DEREF_PROBLEM";
00560          break;
00561
00562       case  HRESULT_FROM_WIN32(ERROR_DS_INAPPROPRIATE_AUTH):
00563          return L"ERROR_DS_INAPPROPRIATE_AUTH";
00564          break;
00565
00566       case  HRESULT_FROM_WIN32(ERROR_INVALID_PASSWORD):
00567          return L"ERROR_INVALID_PASSWORD";
00568          break;
00569
00570       case  HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED):
00571          return L"ERROR_ACCESS_DENIED";
00572          break;
00573
00574       case  HRESULT_FROM_WIN32(ERROR_DS_BUSY):
00575          return L"ERROR_DS_BUSY";
00576          break;
00577
00578       case  HRESULT_FROM_WIN32(ERROR_DS_UNAVAILABLE):
00579          return L"ERROR_DS_UNAVAILABLE";
00580          break;
00581
00582       case  HRESULT_FROM_WIN32(ERROR_DS_UNWILLING_TO_PERFORM):
00583          return L"ERROR_DS_UNWILLING_TO_PERFORM";
00584          break;
00585
00586       case  HRESULT_FROM_WIN32(ERROR_DS_LOOP_DETECT):
00587          return L"ERROR_DS_LOOP_DETECT";
00588          break;
00589
00590       case  HRESULT_FROM_WIN32(ERROR_DS_NAMING_VIOLATION):
00591          return L"ERROR_DS_NAMING_VIOLATION";
00592          break;
00593
00594       case  HRESULT_FROM_WIN32(ERROR_DS_OBJ_CLASS_VIOLATION):
00595          return L"ERROR_DS_OBJ_CLASS_VIOLATION";
00596          break;
00597
00598       case  HRESULT_FROM_WIN32(ERROR_DS_CANT_ON_NON_LEAF):
00599          return L"ERROR_DS_CANT_ON_NONLEAF";
00600          break;
00601
00602       case  HRESULT_FROM_WIN32(ERROR_DS_CANT_ON_RDN):
00603          return L"ERROR_DS_CANT_ON_RDN";
00604          break;
00605
00606       case  HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS):
00607          return L"ERROR_ALREADY_EXISTS";
00608          break;
00609
00610       case  HRESULT_FROM_WIN32(ERROR_DS_CANT_MOD_OBJ_CLASS):
00611          return L"ERROR_DS_CANT_MOD_OBJ_CLASS";
00612          break;
00613
00614       case  HRESULT_FROM_WIN32(ERROR_DS_OBJECT_RESULTS_TOO_LARGE):
00615          return L"ERROR_DS_OBJECT_RESULTS_TOO_LARGE";
00616          break;
00617
00618       case  HRESULT_FROM_WIN32(ERROR_DS_AFFECTS_MULTIPLE_DSAS):
00619          return L"ERROR_DS_AFFECTS_MULTIPLE_DSAS";
00620          break;
00621
00622       case  HRESULT_FROM_WIN32(ERROR_GEN_FAILURE):
00623          return L"(ERROR_GEN_FAILURE";
00624          break;
00625
00626       case  HRESULT_FROM_WIN32(ERROR_DS_SERVER_DOWN):
00627          return L"ERROR_DS_SERVER_DOWN";
00628          break;
00629
00630       case  HRESULT_FROM_WIN32(ERROR_DS_LOCAL_ERROR):
00631          return L"ERROR_DS_LOCAL_ERROR";
00632          break;
00633
00634       case  HRESULT_FROM_WIN32(ERROR_DS_ENCODING_ERROR):
00635          return L"ERROR_DS_ENCODING_ERROR";
00636          break;
00637
00638       case  HRESULT_FROM_WIN32(ERROR_DS_DECODING_ERROR):
00639          return L"(ERROR_DS_DECODING_ERROR";
00640          break;
00641
00642       case  HRESULT_FROM_WIN32(ERROR_TIMEOUT):
00643          return L"(ERROR_TIMEOUT";
00644          break;
00645
00646       case  HRESULT_FROM_WIN32(ERROR_DS_AUTH_UNKNOWN):
00647          return L"ERROR_DS_AUTH_UNKNOWN";
00648          break;
00649
00650       case  HRESULT_FROM_WIN32(ERROR_DS_FILTER_UNKNOWN):
00651          return L"(ERROR_DS_FILTER_UNKNOWN";
00652          break;
00653
00654       case  HRESULT_FROM_WIN32(ERROR_CANCELLED):
00655          return L"(ERROR_CANCELLED";
00656          break;
00657
00658       case  HRESULT_FROM_WIN32(ERROR_DS_PARAM_ERROR):
00659          return L"ERROR_DS_PARAM_ERROR";
00660          break;
00661
00662       case  HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY):
00663          return L"ERROR_NOT_ENOUGH_MEMORY";
00664          break;
00665
00666       case  HRESULT_FROM_WIN32(ERROR_CONNECTION_REFUSED):
00667          return L"ERROR_CONNECTION_REFUSED";
00668          break;
00669
00670       case  HRESULT_FROM_WIN32(ERROR_DS_NOT_SUPPORTED):
00671          return L"ERROR_DS_NOT_SUPPORTED";
00672          break;
00673
00674       case  HRESULT_FROM_WIN32(ERROR_DS_NO_RESULTS_RETURNED):
00675          return L"ERROR_DS_NO_RESULTS_RETURNED";
00676          break;
00677
00678       case  HRESULT_FROM_WIN32(ERROR_DS_CONTROL_NOT_FOUND):
00679          return L"ERROR_DS_CONTROL_NOT_FOUND";
00680          break;
00681
00682       case  HRESULT_FROM_WIN32(ERROR_DS_CLIENT_LOOP):
00683          return L"(ERROR_DS_CLIENT_LOOP";
00684          break;
00685
00686       case  HRESULT_FROM_WIN32(ERROR_DS_REFERRAL_LIMIT_EXCEEDED):
00687          return L"ERROR_DS_REFERRAL_LIMIT_EXCEEDED";
00688          break;
00689
00690       case  E_FAIL:
00691          return L"E_FAIL";
00692          break;
00693
00694       case  E_NOTIMPL:
00695          return L"E_NOIMPL";
00696          break;
00697
00698       case  S_OK:
00699          return L"OK";
00700          break;
00701
00702       case  0x800704b8:
00703       // we have an extended error
00704       {
00705          WCHAR szErrorBuff[ 1024 ];
00706          WCHAR szNameBuff[ 1024 ];
00707          DWORD dwError;
00708
00709          ADsGetLastError( &dwError,
00710                           szErrorBuff,
00711                           1023,
00712                           szNameBuff,
00713                           1023 );
00714
00715          int sizeNameBuff = wcslen(szNameBuff);
00716
00717     if(sizeNameBuff<1024-3)
00718     {
00719           wcsncat( szNameBuff, L" : ",3);
00720     if(1023-sizeNameBuff-3 >=0) //-3 for previous wcsncat
00721           wcsncat( szNameBuff, szErrorBuff,1023-sizeNameBuff-3);
00722     }
00723          wcsncat( szwText,szNameBuff,127);
00724
00725          return szwText;
00726       }
00727
00728    }
00729
00730     return szwText;
00731 }
00732
00733
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminImpersonationLevelOptions Member List

This is the complete list of members for comadmin::COMAdminImpersonationLevelOptions, including all inherited members.
COMAdminImpersonationAnonymous | comadmin::COMAdminImpersonationLevelOptions | [static]
COMAdminImpersonationDelegate | comadmin::COMAdminImpersonationLevelOptions | [static]
COMAdminImpersonationIdentify | comadmin::COMAdminImpersonationLevelOptions | [static]
COMAdminImpersonationImpersonate | comadmin::COMAdminImpersonationLevelOptions | [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LicClien/UTCRUCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LicClien

UTCRUCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCruiseCar COM
00005              object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, IUtility, and
00009              ICruise interfaces.  This is done through Aggregation reuse
00010              of a licensed COLicCruiseCar COM component (specifically
00011              providing its ICar and ICruise interface features).
00012              COUtilityCruiseCar adds its own native implementation of the
00013              IUtility interface.  The aggregated LicCruiseCar object is
00014              implemented and provided as a licensed COM component in an
00015              outside LICSERVE.DLL.
00016
00017              This COUtilityCruiseCar multiple interface COM Object Class
00018              is achieved via the technique of nested classes: the
00019              implementation of the IUtility interface is nested inside of
00020              the COUtilityCruiseCar COM object class.
00021
00022              For a comprehensive tutorial code tour of this module's
00023              contents and offerings see the tutorial LICCLIEN.HTM
00024              file.  For more specific technical details on the internal
00025              workings see the comments dispersed throughout the
00026              module's source code.
00027
00028   Classes:   COUtilityCruiseCar.
00029
00030   Functions: .
00031
00032   Origin:    10-5-95: atrent - Editor inheritance from DLLCLIEN source.
00033
00034 ----------------------------------------------------------------------------
00035   This file is part of the Microsoft COM Tutorial Code Samples.
00036
00037   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00038
00039   This source code is intended only as a supplement to Microsoft
00040   Development Tools and/or on-line documentation.  See these other
00041   materials for detailed information regarding Microsoft code samples.
00042
00043   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00044   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00045   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00046   PARTICULAR PURPOSE.
00047 ==========================================================================+*/
00048
00049 #if !defined(UTCRUCAR_H)
00050 #define UTCRUCAR_H
00051
00052 #ifdef __cplusplus
00053
00054 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00055   ObjectClass: COUtilityCruiseCar
00056
00057   Summary:     COM Object Class for COUtilityCruiseCar COM Objects.
00058                COM objects of this class augment COLicCruiseCar COM objects
00059                with the IUtility interface features of Offroad and Winch.
00060                COLicCruiseCar is reused to offer this COUtilityCruiseCar COM
00061                Object the ICar interface features of Shift, Clutch, Speed,
00062                Steer and the ICruise interface features of Engage and
00063                Adjust.  This COUtilityCruiseCar COM object class is
00064                constructed by aggregation reuse of the COLicCruiseCar COM
00065                object class.  The mulitple interfaces on this COM object
00066                class are constructed via the nested class interfaces
00067                technique.
00068
00069   Interfaces:  IUnknown
00070                  Standard interface providing COM object features.
00071                ICar
00072                  Basic car features.
00073                ICruise
00074                  Cruise control system features.
00075                IUtility
00076                  Sport-utility Car operation features.  Implemented in
00077                  this COM object.
00078
00079   Aggregation: Yes, COUtilityCruiseCar COM objects are aggregatable by
00080                passing a non-NULL pUnkOuter IUnknown pointer into
00081                the constructor.
00082 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00083 class COUtilityCruiseCar : public IUnknown
00084 {
00085   public:
00086     // Main Object Constructor & Destructor.
00087     COUtilityCruiseCar(IUnknown* pUnkOuter);
00088     ~COUtilityCruiseCar(void);
00089
00090     // A general method for initializing a newly created UtilityCruiseCar.
00091     HRESULT Init(BSTR);
00092
00093     // IUnknown members. Main object, non-delegating.
00094     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00095     STDMETHODIMP_(ULONG) AddRef(void);
00096     STDMETHODIMP_(ULONG) Release(void);
00097
00098   private:
00099     // We declare nested class interface implementations here.
00100
00101     // We implement the IUtility interface (of course) in this
00102     // COUtilityCruiseCar COM object class.  This is the native interface
00103     // that we are using as an augmentation to the existing COLicCruiseCar
00104     // COM object class.
00105     class CImpIUtility : public IUtility
00106     {
00107       public:
00108         // Interface Implementation Constructor & Destructor.
00109         CImpIUtility(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00110         ~CImpIUtility(void);
00111
00112         // IUnknown members.
00113         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00114         STDMETHODIMP_(ULONG) AddRef(void);
00115         STDMETHODIMP_(ULONG) Release(void);
00116
00117         // IUtility members.
00118         STDMETHODIMP Offroad(short nGear);
00119         STDMETHODIMP Winch(short nRpm);
00120
00121       private:
00122         // Data private to this interface implementation of IUtility.
00123         ULONG               m_cRefI;     // Interface Ref Count (debugging).
00124         COUtilityCruiseCar* m_pBackObj;  // Parent Object back pointer.
00125         IUnknown*           m_pUnkOuter; // Outer unknown for Delegation.
00126     };
00127
00128     // Make the otherwise private and nested IUtility interface
00129     // implementation a friend to COM object instantiations of this
00130     // selfsame COUtilityCruiseCar COM object class.
00131     friend CImpIUtility;
00132
00133     // Private data of COUtilityCruiseCar COM objects.
00134
00135     // Nested IUtility implementation instantiation.  This IUtility
00136     // interface is instantiated inside this COUtilityCruiseCar object
00137     // as a native interface.
00138     CImpIUtility    m_ImpIUtility;
00139
00140     // Main Object reference count.
00141     ULONG           m_cRefs;
00142
00143     // Outer unknown (aggregation delegation). Used when this
00144     // COUtilityCruiseCar object is being aggregated.
00145     IUnknown*       m_pUnkOuter;
00146
00147     // We need to save the IUnknown interface pointer on the COLicCruiseCar
00148     // object that we aggregate.  We use this when we need to delegate
00149     // IUnknown calls to this aggregated inner object.
00150     IUnknown*       m_pUnkCruiseCar;
00151 };
00152
00153 typedef COUtilityCruiseCar* PCOUtilityCruiseCar;
00154
00155 // Here is a prototpye for the UtilityCruiseCar Creation function.
00156 HRESULT CreateUtilityCruiseCar(
00157           IUnknown* pUnkOuter,
00158           REFIID riid,
00159           BSTR bstrLicKey,
00160           PPVOID ppv);
00161
00162 #endif // __cplusplus
00163
00164
00165 #endif // UTCRUCAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/cpp/isapiCertPolicy/isapiCertPolicy.cpp Source File

  • Security
  • capicom
  • cpp
  • isapiCertPolicy

isapiCertPolicy.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004 //  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005 //  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006 //
00007 //  isapiCertPolicy by Jim Harkins
00008 //
00009 //  This sample code demonstrates how the Capicom Certificate and Chain objects
00010 //  can be used to implement a simple ISAPI filter to enforce additional
00011 //  restrictions on Client Certificates used for an SSL session.
00012 //
00013 //  When using SSL and Client Certificates, IIS supports Certificate Trust
00014 //  Lists to limit the Root Certificates used to authenticate Client
00015 //  Certificates.  In some applications it's desirable to have finer grained
00016 //  control over which Client Certificates are accepted.
00017 //
00018 //  This ISAPI filter uses capicom to simplify the implementation of the
00019 //  following additional Client Certificate checks:
00020 //
00021 //      A set of required Extended Key Usage OIDs are matched in the
00022 //      Client Certificate.  In this example we check for "Smart Card
00023 //      Logon", but the same technique can be used to require any
00024 //      EKU. Following accepted practice for X.509 certs, if no EKUs
00025 //      are present, the certificate is assumed good for all purposes,
00026 //      and this check is passed.
00027 //
00028 //      Issuing Certificate's Thumbprint matches an entry in a short list
00029 //      of accepted Thumbprints.  This is an effective and recommended
00030 //      way to limit accepted Client Certificates to a specific set of
00031 //      Intermediate issuing authorities.
00032 //
00033 //  If no Client Certificate is available, this filter allows the connection.
00034 //  A certificate should be available when IIS is configured to Require Client
00035 //  Certificates.  But even secure sites can allow some public content, for
00036 //  example a start page containing information and instructions.  In this case
00037 //  there may be no requirement for Client Certificates or even SLL, and it's
00038 //  appropriate to bypass the additional checks this filter implements.
00039 //
00040 //  This structure and capicom make it easy to implement additional checks.
00041 //
00042 //  Copyright (C) 2002.  Microsoft Corporation.  All rights reserved.
00043 //
00044 //*****************************************************************************
00045
00046 // ISAPICERTPOLICY.CPP - Implementation file for your Internet Server
00047 //    isapiCertPolicy Filter
00048
00049 #include "stdafx.h"
00050 #include "isapiCertPolicy.h"
00051 #include "ErrorTxt.h"
00052
00053 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a)))
00054
00055 const LPWSTR CAPICOM_SMART_CARD_LOGON_OID_W = L"1.3.6.1.4.1.311.20.2.2";
00056 const LPWSTR CORP_HIGH_ASSUR_OID_W = L"1.3.6.1.4.1.311.42.2.1";
00057
00058 const LPWSTR MS_INTRA_L2_USER_1_THUMBPRINT =
00059     L"15B1691A542A99D7BC3724ABA68FBA7C01B2DEE1";
00060
00061 const LPWSTR MS_INTRA_L2_USER_2_THUMBPRINT =
00062     L"FA744DC332740D6BD34A708453B79026BBD92DC4";
00063
00064 const LPWSTR MS_INTRA_L2_USER_3_THUMBPRINT =
00065     L"528567A45B2D41617BC3EC6BA4D275A1B41B05E0";
00066
00067 const char g_szHttpHeader[] = "HTTP/1.0 200 OK\r\n"
00068     "Content-Type: text/html\r\n"
00069     "\r\n";
00070
00071 // List of Oids we want to match
00072 static WCHAR const *gc_apszMatchOid[] = {
00073     CAPICOM_SMART_CARD_LOGON_OID_W,
00074     CORP_HIGH_ASSUR_OID_W};
00075
00076 static const int gc_iMatchOidCnt = ARRAY_SIZE(gc_apszMatchOid);
00077
00078 // List of acceptable issuer thumbprints
00079 static WCHAR const *gc_apszThumbprint[] = {
00080     MS_INTRA_L2_USER_1_THUMBPRINT,
00081     MS_INTRA_L2_USER_2_THUMBPRINT,
00082     MS_INTRA_L2_USER_3_THUMBPRINT };
00083
00084 static const int gc_iThumbPrintCnt = ARRAY_SIZE(gc_apszThumbprint);
00085
00086
00087 ///////////////////////////////////////////////////////////////////////
00088 // The one and only CWinApp object
00089 // NOTE: You may remove this object if you alter your project to no
00090 // longer use MFC in a DLL.
00091
00092 CWinApp theApp;
00093
00094
00095 ///////////////////////////////////////////////////////////////////////
00096 // The one and only CIsapiCertPolicyFilter object
00097
00098 CIsapiCertPolicyFilter theFilter;
00099
00100
00101 ///////////////////////////////////////////////////////////////////////
00102 // CIsapiCertPolicyFilter implementation
00103
00104 CIsapiCertPolicyFilter::CIsapiCertPolicyFilter()
00105 {
00106 }
00107
00108
00109 CIsapiCertPolicyFilter::~CIsapiCertPolicyFilter()
00110 {
00111 }
00112
00113
00114 BOOL CIsapiCertPolicyFilter::GetFilterVersion(PHTTP_FILTER_VERSION pVer)
00115 {
00116     // DebugBreak() can be useful for debugging startup code
00117     // uncomment these lines as needed for testing
00118
00119 //  #if defined(_DEBUG) || defined(DEBUG) /////////////////////
00120 //      DebugBreak();
00121 //  #endif // defined(_DEBUG) || defined(DEBUG) ///////////////
00122
00123     // Call default implementation for initialization
00124     CHttpFilter::GetFilterVersion(pVer);
00125
00126     // Clear the flags set by base class
00127     pVer->dwFlags &= ~SF_NOTIFY_ORDER_MASK;
00128
00129     // Set the flags we are interested in
00130     //
00131     // Note: Using SF_NOTIFY_AUTHENTICATION and OnAuthentication
00132     // allows early termination of the connecton.  However, if you
00133     // need access to the authenticated user name (for exampe to
00134     // enforce a match with the certificate) then
00135     // SF_NOTIFY_AUTH_COMPLETE can be used with an implementation
00136     // of OnAuthComplete. See the ISAPI Filter documentation in
00137     // the IISSDK for additional information.
00138
00139     pVer->dwFlags |= SF_NOTIFY_SECURE_PORT | SF_NOTIFY_ORDER_DEFAULT |
00140         SF_NOTIFY_AUTHENTICATION;
00141
00142     // Load description string
00143     TCHAR sz[SF_MAX_FILTER_DESC_LEN+1];
00144     ISAPIVERIFY(::LoadString(AfxGetResourceHandle(),
00145             IDS_FILTER, sz, SF_MAX_FILTER_DESC_LEN));
00146     _tcscpy(pVer->lpszFilterDesc, sz);
00147     return TRUE;
00148 }
00149
00150
00151 // Ensure Parent Cert's Thumbprint is on our list
00152
00153 BOOL CIsapiCertPolicyFilter::MatchIssuerThumbprint(
00154     CAPICOM::ICertificate2Ptr Cert)
00155 {
00156     CAPICOM::IChainPtr Chain(__uuidof(CAPICOM::Chain));
00157     CAPICOM::ICertificatesPtr Certs(NULL);
00158
00159     BOOL fOk = Chain->Build(Cert);
00160
00161     if (fOk)
00162     {
00163         Certs = Chain->Certificates;
00164         fOk = (2 <= Certs->Count);
00165     }
00166
00167     if (fOk)
00168     {
00169         CAPICOM::ICertificate2Ptr ParentCert(Certs->Item[2]);
00170         _bstr_t bstrThumbprint(ParentCert->Thumbprint, FALSE);
00171
00172         fOk = !!bstrThumbprint;
00173
00174         if (fOk)
00175         {
00176             BOOL fFound = FALSE;
00177
00178             for (
00179                 int iThumbprint = 0;
00180                 iThumbprint < gc_iThumbPrintCnt && !fFound;
00181                 ++iThumbprint)
00182             {
00183                 fFound = (0 == lstrcmpiW(
00184                     bstrThumbprint,
00185                     gc_apszThumbprint[iThumbprint]));
00186             }
00187             fOk = fOk && fFound;
00188         }
00189     }
00190
00191     return fOk;
00192 }
00193
00194
00195 // Try to find the given EKU on our list of EKU's
00196
00197 BOOL CIsapiCertPolicyFilter::MatchExtendedKeyUsage(
00198     CAPICOM::IEKUPtr EKU, BOOL *pfMatchOid)
00199 {
00200     bool fMatch = FALSE;
00201     _bstr_t bstrOid(EKU->OID, FALSE);
00202
00203     // For each Match Oid, while not matched
00204
00205     for (
00206         int iOid = 0;
00207         iOid < gc_iMatchOidCnt && !fMatch;
00208         ++iOid)
00209     {
00210         // Skips OIDs we've already matched
00211         if (!pfMatchOid[iOid])
00212         {
00213             fMatch = (
00214                 !!bstrOid &&
00215                 0 == lstrcmpW(bstrOid, gc_apszMatchOid[iOid]));
00216
00217             if (fMatch)
00218             {
00219                 // This OID matched, don't check for it any more
00220                 pfMatchOid[iOid] = TRUE;
00221             }
00222         }
00223     }
00224     return fMatch;
00225 }
00226
00227 BOOL CIsapiCertPolicyFilter::MatchExtendedKeyUsage(CAPICOM::ICertificate2Ptr Cert)
00228 {
00229     CAPICOM::IExtendedKeyUsagePtr ExUsage(Cert->ExtendedKeyUsage());
00230     BOOL fMatch = FALSE;
00231     BOOL fOk = TRUE;
00232
00233     // Extended Key Usage represents restrictions if present
00234
00235     if (0 != ExUsage->IsPresent)
00236     {
00237         CAPICOM::IEKUsPtr EKUs(ExUsage->EKUs);
00238         int iEkuCnt = EKUs->Count;
00239         int iMatchCnt = 0;
00240
00241         // If the certificate doesn't have at least as many
00242         // EKUs as we have OIDs to match, then don't even try.
00243
00244         if (gc_iMatchOidCnt <= iEkuCnt)
00245         {
00246             // BOOL array to track our matches,
00247             // start with none matched
00248             BOOL afMatchOid[gc_iMatchOidCnt] = {FALSE};
00249
00250             for (
00251                 int iEku = 1;
00252                 fOk && iEku <= iEkuCnt && iMatchCnt < gc_iMatchOidCnt;
00253                 ++iEku)
00254             {
00255                 // For Each EKU in EKUs, while more OIDs to match
00256
00257                 fMatch = MatchExtendedKeyUsage(EKUs->Item[iEku], afMatchOid);
00258
00259                 if (fMatch)
00260                 {
00261                     // Count this match
00262                     ++iMatchCnt;
00263                 }
00264             }
00265         }
00266         fOk = fOk && (gc_iMatchOidCnt == iMatchCnt);
00267     }
00268
00269     return fOk;
00270 }
00271
00272 BOOL CIsapiCertPolicyFilter::CheckCertPolicy(const _bstr_t &bstrCert)
00273 {
00274     CAPICOM::ICertificate2Ptr Cert(__uuidof(CAPICOM::Certificate));
00275
00276     Cert->Import(bstrCert);
00277
00278     BOOL fOk = MatchIssuerThumbprint(Cert);
00279
00280     if (fOk)
00281     {
00282         fOk =  MatchExtendedKeyUsage(Cert);
00283     }
00284
00285     return fOk;
00286 }
00287
00288
00289 DWORD CIsapiCertPolicyFilter::OnAuthentication(
00290     CHttpFilterContext* pCtxt,
00291     PHTTP_FILTER_AUTHENT pAuthent)
00292 {
00293     DWORD dwRet = SF_STATUS_REQ_FINISHED;
00294
00295     try {
00296         BOOL fOk = TRUE;
00297         BOOL fHaveCert = FALSE;
00298
00299         char CertificateBuf[8192];
00300         CERT_CONTEXT_EX ccex;
00301         ccex.cbAllocated = sizeof(CertificateBuf);
00302         ccex.CertContext.pbCertEncoded = (BYTE*)CertificateBuf;
00303         ccex.dwCertificateFlags = 0;
00304         DWORD dwSize = sizeof(ccex);
00305
00306         fOk = pCtxt->ServerSupportFunction(
00307             (enum SF_REQ_TYPE)HSE_REQ_GET_CERT_INFO_EX,
00308             (LPVOID)&ccex,
00309             &dwSize,
00310             NULL);
00311
00312         if (fOk)
00313         {
00314             // Do we have a cert?
00315             fHaveCert = (1 == (1 & ccex.dwCertificateFlags));
00316         }
00317
00318         if (fHaveCert)
00319         {
00320             // convert ccex's Cert to BSTR
00321
00322             _bstr_t bstrCert(
00323                 SysAllocStringLen(
00324                     (OLECHAR * )ccex.CertContext.pbCertEncoded,
00325                     (ccex.CertContext.cbCertEncoded+1)/2),
00326                 FALSE);
00327
00328             fOk = CheckCertPolicy(bstrCert);
00329         }
00330
00331         if (fOk)
00332         {
00333             // Passed checks
00334             dwRet = SF_STATUS_REQ_NEXT_NOTIFICATION;
00335         }
00336         else
00337         {
00338             // Error or failed to validate show:
00339             // HTTP 403.16 - Forbidden: Client certificate untrusted or invalid
00340
00341             // Write HTTP Header
00342             DWORD dwBytes = sizeof(g_szHttpHeader) - 1;
00343             pCtxt->WriteClient((LPVOID)g_szHttpHeader, &dwBytes, 0);
00344
00345             // Write Error Message
00346
00347             dwBytes = sizeof(g_szHttpError403_16) - 1;
00348             pCtxt->WriteClient((LPVOID)g_szHttpError403_16, &dwBytes, 0);
00349         }
00350     }
00351     catch(...)
00352     {
00353         // Unexpected Exception, show HTTP 500 - Internal server error
00354
00355         // Write HTTP Header
00356         DWORD dwBytes = sizeof(g_szHttpHeader) - 1;
00357         pCtxt->WriteClient((LPVOID)g_szHttpHeader, &dwBytes, 0);
00358
00359         // Write Error Message
00360
00361         dwBytes = sizeof(g_szHttpError500) - 1;
00362         pCtxt->WriteClient((LPVOID)g_szHttpError500, &dwBytes, 0);
00363     }
00364
00365     return dwRet;
00366 }
00367
00368
00369 // Do not edit the following lines, which are needed by ClassWizard.
00370 #if 0
00371 BEGIN_MESSAGE_MAP(CIsapiCertPolicyFilter, CHttpFilter)
00372     //{{AFX_MSG_MAP(CIsapiCertPolicyFilter)
00373     //}}AFX_MSG_MAP
00374 END_MESSAGE_MAP()
00375 #endif  // 0
00376
00377 ///////////////////////////////////////////////////////////////////////
00378 // If your extension will not use MFC, you'll need this code to make
00379 // sure the extension objects can find the resource handle for the
00380 // module.  If you convert your extension to not be dependent on MFC,
00381 // remove the comments arounn the following AfxGetResourceHandle()
00382 // and DllMain() functions, as well as the g_hInstance global.
00383
00384 /****
00385
00386 static HINSTANCE g_hInstance;
00387
00388 HINSTANCE AFXISAPI AfxGetResourceHandle()
00389 {
00390     return g_hInstance;
00391 }
00392
00393 BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason,
00394                     LPVOID lpReserved)
00395 {
00396     if (ulReason == DLL_PROCESS_ATTACH)
00397     {
00398         g_hInstance = hInst;
00399     }
00400
00401     return TRUE;
00402 }
00403
00404 ****/
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/compdata.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

compdata.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Comp.h"
00015 #include "CompData.h"
00016 #include "DataObj.h"
00017 #include "Resource.h"
00018
00019                              // Tracing stuff
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("CComponentData")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Construction/Destruction
00027
00028 CComponentData::CComponentData()
00029               : m_cRef(0), m_ipConsoleNameSpace2(NULL), m_ipConsole2(NULL)
00030 {
00031   // Do not assume only one instance of IComponentData implementation is created.
00032
00033
00034     // Increment this so DllCanUnloadNow works correctly
00035     InterlockedIncrement((long*)&g_uObjectCount);
00036
00037     NODE_PROPERTIES NodeProps;
00038     NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(this);
00039     wcscpy( NodeProps.szNodeName, gwszROOT_NODE_NAME );
00040
00041     m_pStaticNode = new CStaticNode;
00042     m_pStaticNode->Initialize( &NodeProps );
00043
00044     InitClipboardFormats();
00045 }
00046
00047 //---------------------------------------------------------------------------
00048 CComponentData::~CComponentData()
00049 {
00050   if( NULL != m_pStaticNode )
00051   {
00052     delete m_pStaticNode;
00053     m_pStaticNode = NULL;
00054   }
00055
00056   // All done, decrement object count so the dll can be unloaded
00057   InterlockedDecrement((long*)&g_uObjectCount);
00058 }
00059
00060 /////////////////////////////////////////////////////////////////////////////
00061 // IUnknown implementation
00062
00063 //---------------------------------------------------------------------------
00064 STDMETHODIMP CComponentData::QueryInterface
00065 (
00066   REFIID   riid,       //[in] Identifier of the requested interface
00067   LPVOID   *ppv        //[out] Address of requested interface
00068 )
00069 {
00070   if( !ppv )
00071     return E_FAIL;
00072
00073   *ppv = NULL;
00074
00075   if( IsEqualIID(riid, IID_IUnknown) )
00076     *ppv = static_cast<IComponentData*>(this);
00077   else if( IsEqualIID(riid, IID_IComponentData) )
00078     *ppv = static_cast<IComponentData*>(this);
00079   else if( IsEqualIID(riid, IID_IComponentData2) )
00080     *ppv = static_cast<IComponentData2*>(this);
00081
00082
00083   if( *ppv )
00084   {
00085     reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00086     return S_OK;
00087   }
00088
00089   return E_NOINTERFACE;
00090 }
00091
00092 //---------------------------------------------------------------------------
00093 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00094 {
00095   return InterlockedIncrement((LONG*)&m_cRef);
00096 }
00097
00098 //---------------------------------------------------------------------------
00099 STDMETHODIMP_(ULONG) CComponentData::Release()
00100 {
00101   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00102   {
00103     delete this;
00104     return 0;
00105   }
00106
00107   return m_cRef;
00108 }
00109
00110 /////////////////////////////////////////////////////////////////////////////
00111 // Interface IComponentData
00112
00113 //---------------------------------------------------------------------------
00114 //  Called when the user selects the Snap-in from the scope pane.
00115 //  This is where we QI and cache interfaces we will use later.  These
00116 //  interfaces are for future use since they are not used in this sample
00117 //
00118 HRESULT CComponentData::Initialize
00119 (
00120   LPUNKNOWN pUnknown         //[in] Pointer to the console's IUnknown
00121 )
00122 {
00123   HRESULT hResult = S_FALSE;
00124                              // Fail to initialize if we can't get the
00125   do                         // interfaces we need to cache
00126   {
00127     hResult = pUnknown->QueryInterface(IID_IConsoleNameSpace2, (void**)&m_ipConsoleNameSpace2);
00128     BREAK_ON_ERROR( hResult );
00129
00130     hResult = pUnknown->QueryInterface(IID_IConsole2, (void**)&m_ipConsole2);
00131     BREAK_ON_ERROR( hResult );
00132   }
00133   while( 0 );
00134
00135   return hResult;
00136 }
00137
00138 //---------------------------------------------------------------------------
00139 //  Called by the console every time we need to create a new result view.
00140 //  There can be several different result views. Aside from the default one
00141 //  created when the Snap-in initializes, additional ones are created by
00142 //  selecting "New window from here" in MMC's user interface.
00143 //
00144 HRESULT CComponentData::CreateComponent
00145 (
00146   LPCOMPONENT __RPC_FAR* ppComponent   //[out] Points to new IComponent class
00147 )
00148 {
00149   *ppComponent = NULL;
00150
00151   // Pass the new CComponent a pointer to it's parent
00152   CComponent* pComponent = new CComponent( this );
00153
00154   if( NULL == pComponent )
00155     return E_OUTOFMEMORY;
00156
00157   return pComponent->QueryInterface( IID_IComponent, (void**)ppComponent );
00158 }
00159
00160 //---------------------------------------------------------------------------
00161 //  Handles notification events from MMC
00162 //
00163 HRESULT CComponentData::Notify
00164 (
00165   LPDATAOBJECT     ipDataObject,   //[in] Points to the selected data object
00166   MMC_NOTIFY_TYPE  MmcEvent,       //[in] Identifies action taken by user
00167   LPARAM           nArg,           //[in] Depends on the notification type
00168   LPARAM           nParam          //[in] Depends on the notification type
00169 )
00170 {
00171   TRACE_EVENT( _T("Notify"), MmcEvent );  // Provides trace output
00172
00173   return E_NOTIMPL;
00174 }
00175
00176 //---------------------------------------------------------------------------
00177 //  This is where we release any cached interface pointers or any
00178 //  allocated resources.
00179 //
00180 HRESULT CComponentData::Destroy( void)
00181 {
00182
00183   SAFE_RELEASE( m_ipConsoleNameSpace2 );
00184   SAFE_RELEASE( m_ipConsole2          );
00185
00186   return S_OK;
00187 }
00188
00189 //---------------------------------------------------------------------------
00190 //  MMC provides a NULL cookie for the static/root node.  In this sample
00191 //  we don't pass that on, instead we use the pointer to our static node
00192 //  object which handles notifications
00193 //
00194 HRESULT CComponentData::QueryDataObject
00195 (
00196   MMC_COOKIE              nCookie,     //[in]  Indentifier of the selected node
00197   DATA_OBJECT_TYPES       nEnumType,   //[in]  Context in which this object was created
00198   LPDATAOBJECT __RPC_FAR* ppDataObject //[out] Points to data object we create
00199 )
00200 {
00201   HRESULT hResult = S_FALSE;
00202   ULONG_PTR   uCookie = 0;
00203
00204   CDataObject* pNewObject = new CDataObject();
00205   if( NULL == pNewObject )
00206   {
00207     *ppDataObject = NULL;
00208     return E_OUTOFMEMORY;
00209   }
00210
00211   (0 == nCookie) ? uCookie = (ULONG_PTR)m_pStaticNode : uCookie = nCookie;
00212   pNewObject->SetPrivateData( uCookie, (ULONG)nEnumType );
00213
00214   hResult = pNewObject->QueryInterface( IID_IDataObject, (void **)ppDataObject );
00215
00216   return hResult;
00217 }
00218
00219 //---------------------------------------------------------------------------
00220 //
00221 HRESULT CComponentData::GetDisplayInfo
00222 (
00223   SCOPEDATAITEM* pScopeDataItem    //[out][in] Points to a SCOPEDATAITEM struct
00224 )
00225 {
00226   _ASSERT( NULL != pScopeDataItem );
00227   HRESULT hResult = S_OK;
00228
00229   // The console will only ask for the name string
00230   if(  pScopeDataItem->mask & SDI_STR )
00231   {
00232     CBaseNode* pNode = reinterpret_cast<CBaseNode*>(pScopeDataItem->lParam);
00233     hResult = pNode->GetDisplayInfo( pScopeDataItem );
00234   }
00235
00236   return hResult;
00237 }
00238
00239 //---------------------------------------------------------------------------
00240 HRESULT CComponentData::CompareObjects
00241 (
00242   LPDATAOBJECT ipDataObjectA,    //[in] First data object to compare
00243   LPDATAOBJECT ipDataObjectB     //[in] Second data object to compare
00244 )
00245 {
00246   return E_NOTIMPL;
00247 }
00248
00249
00250 //---------------------------------------------------------------------------
00251 HRESULT CComponentData::QueryDispatch
00252 (
00253   MMC_COOKIE         nCookie,    //[in]  Item for which IDispatch is requested
00254   DATA_OBJECT_TYPES  eType,      //[in]  Context of item
00255   LPDISPATCH*        pipDispatch //[out] IDispatch pointer
00256 )
00257 {
00258   return E_NOTIMPL;
00259 }
00260
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PropTag.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

PropTag.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright 1992 - 1998 Microsoft Corporation
00004 //
00005 //  File:       proptag.hxx
00006 //
00007 //  Contents:   Generic parsing algorithm for property tags, such as title and headings
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __PROPTAG_HXX__ )
00012 #define __PROPTAG_HXX__
00013
00014 #include <htmlelem.hxx>
00015 #include <htmlguid.hxx>
00016
00017 const PROP_BUFFER_SLOP = 80;                    // Slop when growing property buffer
00018
00019 enum PropTagState
00020 {
00021     FilteringContent,                           // Filtering the content property
00022     NoMoreContent,                              // Done filtering the content property
00023     FilteringProperty,                          // Filtering the pseudo property
00024     FilteringPropertyButContentNotFiltered,     // Filtering the pseudo and actual property only
00025     NoMoreProperty,                             // Done filtering the pseudo property
00026     FilteringValueProperty,                     // Filtering the real property
00027     NoMoreValueProperty                       // Done filtering the real property
00028 };
00029
00030
00031 //+-------------------------------------------------------------------------
00032 //
00033 //  Class:      CPropertyTag
00034 //
00035 //  Purpose:    Parsing algorithm for property tags in Html
00036 //
00037 //--------------------------------------------------------------------------
00038
00039 class CPropertyTag : public CHtmlElement
00040 {
00041
00042 public:
00043     CPropertyTag( CHtmlIFilter& htmlIFilter,
00044                   CSerialStream& serialStream,
00045                   CFullPropSpec& propSpec,
00046                   HtmlTokenType eTokType );
00047     ~CPropertyTag();
00048
00049     virtual SCODE    GetChunk( STAT_CHUNK *pStat );
00050     virtual SCODE    GetText( ULONG *pcwcOutput, WCHAR *awcBuffer );
00051
00052     virtual void     InitStatChunk( STAT_CHUNK *pStat );
00053
00054 protected:
00055     void             ConcatenateProperty( WCHAR *awcPropSuffix, unsigned uLen );
00056
00057     PropTagState     _eState;                // State of property element
00058     ULONG            _ulIdContentChunk;      // Content chunk from which this chunk is derived
00059     WCHAR *          _pwcPropBuf;            // Copy of property for filtering pseudo-property
00060     unsigned         _uLenPropBuf;           // Length of property buffer
00061     unsigned         _cPropChars;            // # chars in property
00062     unsigned         _cPropCharsFiltered;    // # chars in property already filtered
00063     CFullPropSpec    _propSpec;              // Property spec
00064     HtmlTokenType    _eTokType;              // Token corresponding to this property
00065 };
00066
00067
00068 #endif // __PROPTAG_HXX__
00069
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/CrlDist.h Source File

  • Security
  • CertServices
  • Encode

CrlDist.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 2000
00006 //
00007 //  File:       crldist.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // crldist.h: Declaration of the CCertEncodeCRLDistInfo
00012
00013
00014 #include "resource.h"       // main symbols
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // certenc
00018
00019 #define wszCLASS_CERTENCODECRLDISTINFO wszCLASS_CERTENCODE TEXT("CRLDistInfo")
00020
00021 class CCertEncodeCRLDistInfo:
00022     public IDispatchImpl<ICertEncodeCRLDistInfo, &IID_ICertEncodeCRLDistInfo, &LIBID_CERTENCODELib>,
00023     public ISupportErrorInfoImpl<&IID_ICertEncodeCRLDistInfo>,
00024     public CComObjectRoot,
00025     public CComCoClass<CCertEncodeCRLDistInfo, &CLSID_CCertEncodeCRLDistInfo>
00026 {
00027 public:
00028     CCertEncodeCRLDistInfo()
00029     {
00030   m_aValue = NULL;
00031   m_DecodeInfo = NULL;
00032   m_fConstructing = FALSE;
00033     }
00034     ~CCertEncodeCRLDistInfo();
00035
00036 BEGIN_COM_MAP(CCertEncodeCRLDistInfo)
00037     COM_INTERFACE_ENTRY(IDispatch)
00038     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00039     COM_INTERFACE_ENTRY(ICertEncodeCRLDistInfo)
00040 END_COM_MAP()
00041
00042 DECLARE_NOT_AGGREGATABLE(CCertEncodeCRLDistInfo)
00043 // Remove the comment from the line above if you don't want your object to
00044 // support aggregation.  The default is to support it
00045
00046 DECLARE_REGISTRY(
00047     CCertEncodeCRLDistInfo,
00048     wszCLASS_CERTENCODECRLDISTINFO TEXT(".1"),
00049     wszCLASS_CERTENCODECRLDISTINFO,
00050     IDS_CERTENCODECRLDIST_DESC,
00051     THREADFLAGS_BOTH)
00052
00053 // ICertEncodeCRLDistInfo
00054 public:
00055     STDMETHOD(Decode)(
00056     /* [in] */ BSTR const strBinary);
00057
00058     STDMETHOD(GetDistPointCount)(
00059     /* [out, retval] */ LONG __RPC_FAR *pDistPointCount);
00060
00061     STDMETHOD(GetNameCount)(
00062     /* [in] */ LONG DistPointIndex,
00063     /* [out, retval] */ LONG __RPC_FAR *pNameCount);
00064
00065     STDMETHOD(GetNameChoice)(
00066     /* [in] */ LONG DistPointIndex,
00067     /* [in] */ LONG NameIndex,
00068     /* [out, retval] */ LONG __RPC_FAR *pNameChoice);
00069
00070     STDMETHOD(GetName)(
00071     /* [in] */ LONG DistPointIndex,
00072     /* [in] */ LONG NameIndex,
00073     /* [out, retval] */ BSTR __RPC_FAR *pstrName);
00074
00075     STDMETHOD(Reset)(
00076     /* [in] */ LONG DistPointCount);
00077
00078     STDMETHOD(SetNameCount)(
00079     /* [in] */ LONG DistPointIndex,
00080     /* [in] */ LONG NameCount);
00081
00082     STDMETHOD(SetNameEntry)(
00083     /* [in] */ LONG DistPointIndex,
00084     /* [in] */ LONG NameIndex,
00085     /* [in] */ LONG NameChoice,
00086     /* [in] */ BSTR const strName);
00087
00088     STDMETHOD(Encode)(
00089     /* [out, retval] */ BSTR *pstrBinary);
00090 private:
00091     VOID _Cleanup(VOID);
00092
00093     BOOL _VerifyNames(
00094     IN LONG DistPointIndex);
00095
00096     HRESULT _MapDistPoint(
00097     IN BOOL fEncode,
00098     IN LONG DistPointIndex,
00099     OUT LONG **ppNameCount,
00100     OUT CERT_ALT_NAME_ENTRY ***ppaName);
00101
00102     HRESULT _MapName(
00103     IN BOOL fEncode,
00104     IN LONG DistPointIndex,
00105     IN LONG NameIndex,
00106     OUT CERT_ALT_NAME_ENTRY **ppName);
00107
00108     HRESULT _SetErrorInfo(
00109     IN HRESULT hrError,
00110     IN WCHAR const *pwszDescription);
00111
00112     CRL_DIST_POINT   *m_aValue;
00113     LONG      m_cValue;
00114     CRL_DIST_POINTS_INFO *m_DecodeInfo;
00115     BOOL      m_fConstructing;
00116 };
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCOutgoing/StdAfx.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCOutgoing

StdAfx.cpp

Go to the documentation of this file.
00001 /******************************************************>
00002  * Copyright (c) 2001 Microsoft Corporation.
00003  * All rights reserved.
00004  *
00005  * @Abstract: StdAfx.cpp
00006  * ---------- [ PCH Definition Declaration File]
00007  *
00008  *
00009  ******************************************************/
00010
00011 #include "stdafx.h"
00012
00013
00014
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/AsyncIO/AsyncIO.c Source File

  • WinBase
  • IO
  • AsyncIO

AsyncIO.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1992 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     AsyncIO.c
00012
00013 Abstract:
00014
00015     This is the main source file for the AsyncIO API demonstration
00016     program.  This program demonstrates how to use many of the advanced
00017     operating system features provided by the Win32 API set on Windows/NT.
00018
00019     This file and its corresponding header file, AsyncIO.h, can be found
00020     in the sample programs directory of the Platform SDK.
00021
00022     This program has a real purpose, although the implementation is
00023     somewhat contrived in order to demonstrate the various operating
00024     system features of Windows/NT.
00025
00026     The features that this program demonstrate are:
00027
00028         - Creating multiple threads, using critical sections
00029           and semaphores for synchronization.
00030
00031         - Thread termination.
00032
00033         - Virtual memory, commitment vs reservation.
00034
00035         - Structured exception handling, including finally
00036           clauses and an exception filter procedure.
00037
00038         - Enumeration of directory entries.
00039
00040         - Mapped file I/O
00041
00042         - Asynchronous file I/O via completion routine.
00043
00044         - Synchronous file I/O
00045
00046     AsyncIO is a character mode program for searching the files in a
00047     directory tree for a match against a pattern.  It uses multiple
00048     threads to do its work, with each thread processing a file at a
00049     time, accumulating its matches and outputting them to standard
00050     output contiguously when it is done searching a file.
00051
00052     The command line syntax is:
00053
00054         Usage: AsyncIO [-h] [-v] [-y] [-a | -s | -m] [-t n] SearchString [DirectoryPath]
00055
00056         where:
00057
00058             -h - prints this message.
00059
00060             -v - generates verbose output.
00061
00062             -y - ignores case when doing comparisons.
00063
00064             -a - specifies that the program should use asynchronous file
00065                  I/O to read the files being searched.
00066
00067             -s - specifies that the program should use synchronous file
00068                  I/O to read the files being searched.
00069
00070             -m - specifies that the program should use mapped file I/O
00071                  to read the files being searched.
00072
00073             -t - specifies the number of threads to use when doing the
00074                  search.  Default is 4 * the number of processors. The
00075                  number never exceeds MAXIMUM_WORKER_THREADS, which is
00076                  currently defined to be 128.
00077
00078             SearchString - specifies the text to search for.  Enclose in
00079                            quotes if it contains spaces or punctuation.
00080
00081             DirectoryPath - specifies the root of the tree to begin the
00082                             search at.  Defaults to the current directory.
00083
00084
00085 --*/
00086
00087 #ifdef _IA64_
00088 #pragma warning(disable:4100 4127 4702 4706)
00089 #endif
00090
00091 #include "AsyncIO.h"
00092
00093 int
00094 main(
00095     int argc,
00096     char *argv[]
00097     )
00098
00099 /*++
00100
00101 Routine Description:
00102
00103     This is the main procedure for the AsyncIO program, and is called by
00104     the C Runtime startup code when the program starts.
00105
00106 Arguments:
00107
00108     argc - number of argumments in the argv array.
00109
00110     argv - pointer to an array of null terminated string pointers.
00111
00112 Return Value:
00113
00114     Process exit status.  The value returned by this function will
00115     be used as the exit code parameter passed to ExitProcess.
00116
00117 --*/
00118
00119 {
00120    SYSTEM_INFO SystemInformation;
00121    PWORK_QUEUE WorkQueue;
00122
00123    //
00124    // Query the number of processors from the system and set the default
00125    // number of worker threads to 4 times the number of processors or
00126    // MAXIMUM_WORKER_THREADS, whichever is smaller.
00127    //
00128
00129    GetSystemInfo( &SystemInformation );
00130    NumberOfWorkerThreads = SystemInformation.dwNumberOfProcessors * 4;
00131    if (NumberOfWorkerThreads > MAXIMUM_WORKER_THREADS)
00132    {
00133        NumberOfWorkerThreads = MAXIMUM_WORKER_THREADS;
00134    }
00135
00136    //
00137    // Process the arguments given on the command line.
00138    //
00139
00140    if (!ProcessCommandLineArguments( argc, argv ))
00141    {
00142       exit( 1 );
00143    }
00144
00145    //
00146    // Allocate a thread local storage slot for use by our worker
00147    // thread routine (ProcessRequest).  This call reserves a
00148    // 32-bit slot in the thread local storage array for every
00149    // thread in this process.  Remember the slot index in a global
00150    // variable for use by our worker thread routine.
00151    //
00152
00153    TlsIndex = TlsAlloc();
00154    if (TlsIndex == TLS_OUT_OF_INDEXES)
00155    {
00156       fprintf( stderr, "AsyncIO: Unable to allocated thread local storage.\n" );
00157       exit( 1 );
00158    }
00159
00160    //
00161    // If asynchronous I/O is used, create an event that will be signalled
00162    // when there are no more outstanding I/O requests. The event is a
00163    // manual reset event, that once signalled via SetEvent, will remain
00164    // signalled until ResetEvent is called.
00165    //
00166
00167    if (ASyncIO)
00168    {
00169       IoCompletedEvent = CreateEvent( NULL,   // Not inherited
00170                                       TRUE,   // Manual reset
00171                                       FALSE,  // Initially reset
00172                                       NULL    // No name
00173                                      );
00174       if (IoCompletedEvent == NULL)
00175       {
00176          fprintf( stderr, "AsyncIO: Unable to create the event needed for asynchronous I/O.\n");
00177          exit( 1 );
00178       }
00179    }
00180
00181    //
00182    // Create a work queue and the specified number of threads which will
00183    // process the work items in the queue and the routine which will do
00184    // the processing.
00185    //
00186
00187    WorkQueue = CreateWorkQueue( NumberOfWorkerThreads, ProcessRequest );
00188    if (WorkQueue == NULL)
00189    {
00190       fprintf( stderr, "AsyncIO: Unable to create %u worker threads.\n", NumberOfWorkerThreads );
00191       exit( 1 );
00192    }
00193
00194    //
00195    // Now walk the directory tree, which will call our procedure
00196    // QueueSearchFile for each directory and file in the tree.
00197    //
00198
00199    if (EnumerateDirectoryTree( DirectoryPath,
00200                                QueueSearchFile,
00201                                WorkQueue
00202                              ) == FALSE)
00203    {
00204       //
00205       // The search failed for some reason. Destroy the work queue.
00206       // The system will close the IoCompletedEvent handle when we
00207       // exit.
00208       //
00209
00210       DestroyWorkQueue ( WorkQueue );
00211       exit(1);
00212    }
00213
00214    //
00215    // Done walking the tree.  If asynchronous I/O is used, wait for all
00216    // all the outstanding I/O requests to be completed.
00217    //
00218
00219    if (ASyncIO)
00220    {
00221       //
00222       // We use an alertable wait in a loop. I/O completion will
00223       // terminate the wait, even through the event we are waiting
00224       // on is not signalled.
00225       //
00226
00227       while (WaitForSingleObjectEx( IoCompletedEvent, // Event waited on
00228                                     INFINITE,         // No timeout
00229                                     TRUE              // Alertable
00230                                   ) == WAIT_IO_COMPLETION
00231             )
00232       {
00233          NOTHING;
00234       }
00235    }
00236
00237    //
00238    // All done, destroy the work queue. This function will wait until
00239    // the work queue is empty and all the worker threads have exited
00240    // and then it will destroy the queue.
00241    //
00242
00243    DestroyWorkQueue( WorkQueue );
00244
00245    if (Verbose && MatchedLineCount)
00246    {
00247       fprintf( stderr,
00248                "Found %u lines with matches in %u files, out of %u files searched.\n",
00249                MatchedLineCount,
00250                MatchedFileCount,
00251                SearchedFileCount
00252              );
00253    }
00254
00255    return 0;
00256 }
00257
00258
00259 VOID
00260 QueueSearchFile(
00261                LPSTR Path,
00262                PWIN32_FIND_DATA FindFileData,
00263                PVOID EnumerateParameter
00264                )
00265
00266 /*++
00267
00268 Routine Description:
00269
00270     This is the directory enumeration function.  It is called by the
00271     EnumerateDirectoryTree function once for each file and directory
00272     in the tree.
00273
00274     This function, if it decides it wants to search the file, will
00275     open the file and then, depending upon the I/O method selected via
00276     the command line, will:
00277
00278         - map the file PAGE_READONLY for mapped file I/O,
00279
00280         - read the file into an allocated buffer for synchronous
00281           I/O, or
00282
00283         - for asynchronous I/O, allocate a buffer and start a read
00284           operation to read the entire file into the buffer.  A
00285           completion routine will be invoked when the read completes,
00286           possibly in another thread context.
00287
00288     Finally it will queue a search request to the work queue, with the
00289     relevant information contained in the request.  For asynchronous
00290     I/O, the search request is allocated and initialized here but is
00291     not actually queued to the work queue until the I/O completion
00292     routine has been called.
00293
00294 Arguments:
00295
00296     Path - Supplies a pointer to a null terminated string that contains
00297         the fully qualified path of the file or directory.
00298
00299     FindFileData - Supplies the directory information associated
00300         with the file or directory specified by the Path argument.
00301
00302     EnumerateParameter - Uninterpreted 32-bit value.
00303
00304 Return Value:
00305
00306     None.
00307
00308 --*/
00309
00310 {
00311    PWORK_QUEUE WorkQueue = (PWORK_QUEUE)EnumerateParameter;
00312    PSEARCH_REQUEST SearchRequest;
00313    HANDLE File;
00314    HANDLE Mapping;
00315    LPVOID FileData;
00316    DWORD FileSize;
00317    SIZE_T PathLength;
00318
00319    //
00320    // Ignore directories or zero length files, as there
00321    // is nothing to search in these cases.
00322    //
00323
00324    if ((FindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
00325        !(FileSize = FindFileData->nFileSizeLow)
00326       )
00327    {
00328       return;
00329    }
00330
00331    //
00332    // Open the file using the fully qualified path.  Specify the
00333    // sequential scan hint to the cache manager and GENERIC_READ
00334    // access to the file. If asynchronous I/O is used, specify
00335    // file overlapped flag.
00336    //
00337
00338    File = CreateFile( Path,
00339                       GENERIC_READ,
00340                       FILE_SHARE_READ,
00341                       NULL,
00342                       OPEN_EXISTING,
00343                       FILE_FLAG_SEQUENTIAL_SCAN |
00344                       (ASyncIO ? FILE_FLAG_OVERLAPPED : 0),
00345                       NULL
00346                     );
00347
00348    //
00349    // Since NULL might be a valid file object handle, failure
00350    // is indicated by a special return value.
00351    //
00352
00353    if (File == INVALID_HANDLE_VALUE)
00354    {
00355       fprintf( stderr, "%s(0) : error %u: Unable to open file.\n",
00356                Path,
00357                GetLastError()
00358              );
00359
00360       return;
00361    }
00362
00363    //
00364    // File successfully opened for read access.
00365    //
00366
00367    if (MappedFileIO)
00368    {
00369       //
00370       // If mapped file I/O, create a file mapping object, backed by
00371       // the file we just opened.  Make the default page protection
00372       // for the mapping be read only.
00373       //
00374
00375       Mapping = CreateFileMapping( File,
00376                                    NULL,
00377                                    PAGE_READONLY,
00378                                    0,
00379                                    0,
00380                                    NULL
00381                                  );
00382
00383       //
00384       // Okay to close the file handle now, since the mapping object
00385       // has a reference to the file that will cause the open file
00386       // object to remain until the reference is destroyed. Note that
00387       // any sharing information is lost at this point, so somebody
00388       // could come in and open it for write access.
00389       //
00390
00391       CloseHandle( File );
00392
00393       //
00394       // Here, a null value indicates an error.
00395       //
00396
00397       if (Mapping == NULL)
00398       {
00399          fprintf( stderr, "%s(0) : error %u: Unable to create mapping object.\n",
00400                   Path,
00401                   GetLastError()
00402                 );
00403          return;
00404       }
00405
00406       //
00407       // Finally, map a view of the file, using the mapping object
00408       // just created, into the address space of this process.
00409       // The offset and size are zero, which means to map the
00410       // entire file.
00411       //
00412
00413       FileData = MapViewOfFile( Mapping,
00414                                 FILE_MAP_READ,
00415                                 0,
00416                                 0,
00417                                 0
00418                               );
00419
00420       //
00421       // Okay to close the mapping object handle now, it will remained
00422       // referenced as long as the view remains mapped.
00423       //
00424
00425       CloseHandle( Mapping );
00426
00427       //
00428       // A null value indicates the map operation failed.
00429       //
00430
00431       if (FileData == NULL)
00432       {
00433          fprintf( stderr, "%s(0) : error %u: Unable to map file.\n",
00434                   Path,
00435                   GetLastError()
00436                 );
00437          return;
00438       }
00439
00440       //
00441       // All done mapping the file.  Set the File handle to NULL as
00442       // it has been closed already.  Both the file object and mapping
00443       // objects created above will be freed when the map view is
00444       // unmapped.
00445       //
00446
00447       File = NULL;
00448    }
00449    else
00450    {
00451       //
00452       // Mapped I/O will not be used. So allocate a buffer big enough
00453       // to contain the entire file.
00454       //
00455
00456       FileData = VirtualAlloc( NULL,
00457                                FileSize,
00458                                MEM_COMMIT,
00459                                PAGE_READWRITE
00460                              );
00461       if (FileData == NULL)
00462       {
00463          fprintf( stderr, "%s(0) : error %u: Unable to allocate memory to contain file.\n",
00464                   Path,
00465                   GetLastError()
00466                 );
00467          CloseHandle( File );
00468          return;
00469       }
00470    }
00471
00472    //
00473    // Note that Path points to a null terminated string produced
00474    // by our function EnumerateDirectoryTree. We can find the
00475    // length of the string safely using strlen.
00476    //
00477
00478    PathLength = strlen( Path );
00479
00480    //
00481    // We have successfully opened the file and are ready to go.
00482    // Allocate space for a search request and fill it in with
00483    // the information needed by the ProcessSearchFile function
00484    // when it runs.
00485    //
00486    // The space for SearchRequest->FullNameName[0] is provided
00487    // within SearchRequest. An additional space of PathLength
00488    // characters suffices for Path and null termination.
00489    //
00490
00491    SearchRequest = LocalAlloc( LMEM_ZEROINIT,
00492                                sizeof( *SearchRequest ) + PathLength
00493                              );
00494    if (SearchRequest == NULL)
00495    {
00496       fprintf( stderr, "AsyncIO: Out of memory\n" );
00497       exit( 1 );
00498    }
00499
00500    SearchRequest->WorkItem.Reason = WORK_ITEM;
00501    SearchRequest->File = File;
00502    SearchRequest->FileSize = FileSize;
00503    SearchRequest->FileData = FileData;
00504    strncpy( SearchRequest->FullPathName, Path, PathLength );
00505    SearchRequest->FullPathName[ PathLength ] = '\0';
00506
00507    if (!ASyncIO)
00508    {
00509
00510       //
00511       // Asynchronous I/O is not used. Queue the search
00512       // request to the work queue.
00513       //
00514
00515       QueueWorkItem( WorkQueue, &SearchRequest->WorkItem );
00516    }
00517    else
00518    {
00519       //
00520       // Asynchronous I/O is used. Queue the read operation.
00521       // The file handle must remain open while the read
00522       // operation is pending.
00523       //
00524
00525       if (!ReadFileEx( File,
00526                        FileData,
00527                        FileSize,
00528                        &SearchRequest->OverlappedIO,
00529                        (LPOVERLAPPED_COMPLETION_ROUTINE) ProcessReadFileCompletion
00530                      )
00531          )
00532       {
00533          fprintf( stderr, "%s(0) : error %u: Unable to queue read of file.\n",
00534                   Path,
00535                   GetLastError()
00536                 );
00537
00538          VirtualFree( FileData, 0, MEM_RELEASE );
00539          CloseHandle( File );
00540          LocalFree( SearchRequest );
00541          return;
00542       }
00543
00544       //
00545       // Successfully queued the read operation.  Keep a count
00546       // of outstanding read operations so we know when it is
00547       // okay to terminate.
00548       //
00549
00550       OutstandingIOOperations += 1;
00551    }
00552
00553    //
00554    // Return back to the EnumerateDirectoryTree function so that it
00555    // can call us with the next file or directrry.
00556    //
00557
00558    return;
00559 }
00560
00561
00562 VOID
00563 ProcessRequest(
00564               IN PWORK_QUEUE_ITEM WorkItem
00565               )
00566
00567 /*++
00568
00569 Routine Description:
00570
00571     This function is called whenever a work item is removed from
00572     the work queue by one of the worker threads.  Which worker
00573     thread context this function is called in is arbitrary.
00574
00575     This functions keeps a pointer to state information in
00576     thread local storage.
00577
00578     This function is called once at the beginning with a
00579     special initialization call.  During this call, this
00580     function allocates space for state information and
00581     remembers the pointer to the state information in
00582     a Thread Local Storage (TLS) slot.
00583
00584     This function is called once at the end with a special
00585     termination call.  During this call, this function
00586     frees the state information allocated during the
00587     initialization call.
00588
00589     In between these two calls are zero or more calls to
00590     handle a work item.  The work item is a search request
00591     which is handled by the ProcessSearchFile function.
00592
00593 Arguments:
00594
00595     WorkItem - Supplies a pointer to the work item just removed
00596         from the work queue.  It is the responsibility of this
00597         routine to free the memory used to hold the work item.
00598
00599 Return Value:
00600
00601     None.
00602
00603 --*/
00604
00605 {
00606    DWORD BytesWritten;
00607    PSEARCH_REQUEST_STATE State;
00608    PSEARCH_REQUEST SearchRequest;
00609    CHAR MessageBuffer[ 2 * MAX_PATH ];
00610
00611    if (WorkItem->Reason == WORK_INITIALIZE_ITEM)
00612    {
00613       //
00614       // First time initialization call.  Allocate space for
00615       // state information.
00616       //
00617
00618       State = LocalAlloc( LMEM_ZEROINIT,
00619                           sizeof( *State )
00620                         );
00621
00622       if (State != NULL)
00623       {
00624          //
00625          // Now create a virtual buffer, with an initial commitment
00626          // of zero and a maximum commitment of 128KB.  This buffer
00627          // will be used to accumulate the matched strings output
00628          // during the search of a single file.  This is so the
00629          // output can be written to standard output with a single
00630          // write call, thus insuring that it remains contiguous
00631          // in the output stream, and is not intermingled with the
00632          // output of the other worker threads.
00633          //
00634
00635          if (CreateVirtualBuffer( &State->Buffer, (SIZE_T) 0, (SIZE_T) (2 * 64 * 1024) ))
00636          {
00637             //
00638             // The CurrentOutput field of the state block is
00639             // a pointer to where the next output goes in the
00640             // buffer.  It is initialized here and reset each
00641             // time the buffer is flushed to standard output.
00642             //
00643
00644             State->CurrentOutput = State->Buffer.Base;
00645          }
00646          else
00647          {
00648             LocalFree( State );
00649             State = NULL;
00650          }
00651       }
00652
00653       //
00654       // Remember the pointer to the state information
00655       // thread local storage.
00656       //
00657
00658       TlsSetValue( TlsIndex, State );
00659       return;
00660    }
00661
00662    //
00663    // Here to handle a work item or special terminate call.
00664    // Get the state pointer from thread local storage.
00665    //
00666
00667    State = (PSEARCH_REQUEST_STATE)TlsGetValue( TlsIndex );
00668    if (State == NULL)
00669    {
00670       return;
00671    }
00672
00673    //
00674    // If this is the special terminate work item, free the virtual
00675    // buffer and state block allocated above and set the thread
00676    // local storage value to NULL.  Return to caller.
00677    //
00678
00679    if (WorkItem->Reason == WORK_TERMINATE_ITEM)
00680    {
00681       FreeVirtualBuffer( &State->Buffer );
00682       LocalFree( State );
00683       TlsSetValue( TlsIndex, NULL );
00684       return;
00685    }
00686
00687    //
00688    // If not an initialize or terminate work item, then must be a
00689    // search request.  Calculate the address of the search request
00690    // block, based on the position of the WorkItem field in the
00691    // SEARCH_REQUEST structure.
00692    //
00693
00694    SearchRequest = CONTAINING_RECORD( WorkItem, SEARCH_REQUEST, WorkItem );
00695
00696    //
00697    // Actual search operation is protected by a try ... except
00698    // block so that any attempts to store into the virtual buffer
00699    // will be handled correctly by extending the virtual buffer.
00700    //
00701
00702    _try {
00703       //
00704       // Perform the search against this file.
00705       //
00706
00707       ProcessSearchFile( SearchRequest, State );
00708
00709       //
00710       // Done with this file.  If asynchronous I/O is used, decrement
00711       // the count of outstanding I/O operations. If the count becomes
00712       // zero, signal the IoCompletedEvent as there are no more outstanding
00713       // I/O operations.
00714       //
00715
00716       if (ASyncIO && InterlockedDecrement( &OutstandingIOOperations ) == 0)
00717       {
00718          SetEvent( IoCompletedEvent );
00719       }
00720
00721       //
00722       // If any output was written to the virtual buffer, flush the
00723       // output to standard output.  Trim the virtual buffer back to
00724       // zero committed pages.
00725       //
00726
00727       if (State->CurrentOutput > (LPSTR)State->Buffer.Base)
00728       {
00729          WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ),
00730                     State->Buffer.Base,
00731                     (DWORD)(State->CurrentOutput - (LPSTR)State->Buffer.Base),
00732                     &BytesWritten,
00733                     NULL
00734                   );
00735
00736          TrimVirtualBuffer( &State->Buffer );
00737          State->CurrentOutput = (LPSTR)State->Buffer.Base;
00738       }
00739    }
00740
00741    _except( VirtualBufferExceptionFilter( GetExceptionCode(),
00742                                           GetExceptionInformation(),
00743                                           &State->Buffer
00744                                         )
00745           )
00746    {
00747
00748       //
00749       // We will get here if the exception filter was unable to
00750       // commit the memory.
00751       //
00752       // Note that FullPathName was generated by our function
00753       // QuerySearchFile. It points to a null terminated path
00754       // name.
00755       //
00756
00757       WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ),
00758                  MessageBuffer,
00759                  sprintf( MessageBuffer,
00760                           "%s(0) : error 0: too many matches for file\n",
00761                           SearchRequest->FullPathName
00762                         ),
00763                  &BytesWritten,
00764                  NULL
00765                );
00766    }
00767
00768    //
00769    // Free the storage used by the SearchRequest
00770    //
00771
00772    LocalFree( SearchRequest );
00773
00774    //
00775    // All done with this request.  Return to the worker thread that
00776    // called us.
00777    //
00778
00779    return;
00780 }
00781
00782
00783
00784 VOID
00785 ProcessReadFileCompletion(
00786                          DWORD dwErrorCode,
00787                          DWORD dwNumberOfBytesTransfered,
00788                          LPOVERLAPPED lpOverlapped
00789                          )
00790
00791 /*++
00792
00793 Routine Description:
00794
00795     This function is called whenever an asynchronous read operation,
00796     queued by the function QueueSearchFile, completes. This function
00797     calulates the address of the search request block and then
00798     queue the request to the work queue, now that the data is
00799     in memory.
00800
00801 Arguments:
00802
00803     dwErrorCode - Supplies the error code that the I/O completed with.
00804
00805     dwNumberOfBytesTransfered - Supplies the actual number of bytes
00806         transferred.
00807
00808     lpOverlapped - Supplies a pointer to the structure given to
00809         ReadFileEx when the I/O operation was queued.
00810
00811 Return Value:
00812
00813     None.
00814
00815 --*/
00816
00817 {
00818    PSEARCH_REQUEST SearchRequest;
00819
00820    //
00821    // Since the data we need is now in memory, queue the search
00822    // request to the work queue.
00823    //
00824
00825    SearchRequest = CONTAINING_RECORD( lpOverlapped, SEARCH_REQUEST, OverlappedIO );
00826    QueueWorkItem( SearchRequest->WorkItem.WorkQueue, &SearchRequest->WorkItem );
00827 }
00828
00829
00830
00831 VOID
00832 ProcessSearchFile(
00833                  IN PSEARCH_REQUEST SearchRequest,
00834                  IN PSEARCH_REQUEST_STATE State
00835                  )
00836
00837 /*++
00838
00839 Routine Description:
00840
00841     This function performs the actual search of the contents of the
00842     passed file for the search string given on the command line.
00843     If we are using synchronous I/O, then do the read operation
00844     now.
00845
00846     Search the contents of the file for any matches, and accumulate
00847     the match output in the virtual buffer using sprintf, which is
00848     multi-thread safe, even with the single threaded version of
00849     the libraries.
00850
00851     Note that this function is called within an exception block. Our
00852     function VirtualBufferExceptionFilter will be called if uncommitted
00853     memory is referenced. That function will either commit additional
00854     memory and then repeat the faulting instruction or execute the
00855     caller's exception handler, depending whether additional pages
00856     can be committed. Therefore, sprintf can be safely used here.
00857
00858 Arguments:
00859
00860     SearchRequest - Supplies a pointer to the search request which
00861         contains the relevant information.
00862
00863     State - Supplies a pointer to state information for the current
00864         thread.
00865
00866 Return Value:
00867
00868     None.
00869
00870 --*/
00871
00872 {
00873    LPSTR FileData, s, s1, BegLine, EndLine, EndOfFile;
00874    DWORD LineNumber;
00875    DWORD MatchesFound;
00876    DWORD BytesRead;
00877
00878    // Get a pointer to the beginning of the file data in memory
00879    // and calculate the address of the end of file point in
00880    // memory.
00881    //
00882
00883    FileData = SearchRequest->FileData;
00884    EndOfFile = FileData + SearchRequest->FileSize;
00885
00886    //
00887    // If synchronous I/O is used, then we have not read in the
00888    // file contents yet, so issue the synchronous read to get
00889    // the data into memory.
00890    //
00891
00892    if (SyncIO)
00893    {
00894       if (!ReadFile( SearchRequest->File,
00895                      FileData,
00896                      SearchRequest->FileSize,
00897                      &BytesRead,
00898                      NULL
00899                    ) ||
00900           BytesRead != SearchRequest->FileSize
00901          )
00902       {
00903
00904          State->CurrentOutput += sprintf( State->CurrentOutput,
00905                                           "%s(0) : error %u: Unable to read file contents.\n",
00906                                           SearchRequest->FullPathName,
00907                                           GetLastError()
00908                                         );
00909
00910          CloseHandle( SearchRequest->File );
00911          return;
00912       }
00913    }
00914
00915    //
00916    // Close any open file handle associated with this request.
00917    //
00918
00919    if (SearchRequest->File != NULL)
00920    {
00921       CloseHandle( SearchRequest->File );
00922    }
00923
00924    //
00925    // Search the file contents, keeping track of line breaks
00926    // so we can tell the line number of each match.
00927    //
00928
00929    s = FileData;
00930    LineNumber = 0;
00931    MatchesFound = 0;
00932    while (s < EndOfFile)
00933    {
00934       BegLine = s;
00935       while (s < EndOfFile && *s != '\n')
00936       {
00937          s++;
00938       }
00939
00940       if (*s == '\n')
00941       {
00942          LineNumber += 1;
00943          EndLine = s - 1;
00944          if (EndLine > BegLine && EndLine[ -1 ] == '\r')
00945          {
00946             EndLine -= 1;
00947          }
00948
00949          s1 = BegLine;
00950          while (s1 < (EndLine - SearchStringLength))
00951          {
00952             if (!(SearchFunction)( s1, SearchString, SearchStringLength ))
00953             {
00954                //
00955                // We have a match for this line.  Append the
00956                // output to the virtual buffer and update the
00957                // current output pointer.
00958                //
00959
00960                State->CurrentOutput += sprintf( State->CurrentOutput,
00961                                                 "%s(%u) : %.*s\n",
00962                                                 SearchRequest->FullPathName,
00963                                                 LineNumber,
00964                                                 EndLine - BegLine,
00965                                                 BegLine
00966                                               );
00967                MatchesFound += 1;
00968                break;
00969             }
00970
00971             s1++;
00972          }
00973
00974          s++;
00975       }
00976    }
00977
00978    if (MatchesFound)
00979    {
00980
00981       //
00982       // Increment the global variables that summarize the result
00983       // of the search. Since these variables may be incremented
00984       // by multiple worker threads, use atomic add and increment.
00985       //
00986
00987       InterlockedExchangeAdd( &MatchedLineCount, MatchesFound );
00988       InterlockedIncrement( &MatchedFileCount );
00989    }
00990    InterlockedIncrement( &SearchedFileCount );
00991
00992    //
00993    // All done with the file contents.  Discard it either by
00994    // unmapping the view of the file in the case of mapped file
00995    // I/O or free the virtual memory for other types of I/O
00996    //
00997
00998    if (MappedFileIO)
00999    {
01000       if (!UnmapViewOfFile( FileData ))
01001       {
01002          State->CurrentOutput += sprintf( State->CurrentOutput,
01003                                           "%s(%u) : UnmapViewOfFile( %p ) failed, error == %u\n",
01004                                           SearchRequest->FullPathName,
01005                                           LineNumber,
01006                                           FileData,
01007                                           GetLastError()
01008                                         );
01009       }
01010    }
01011    else
01012    {
01013       VirtualFree( FileData, 0, MEM_RELEASE );
01014    }
01015 }
01016
01017
01018 PWORK_QUEUE
01019 CreateWorkQueue(
01020                IN DWORD NumberOfWorkerThreads,
01021                IN PWORKER_ROUTINE WorkerRoutine
01022                )
01023
01024 /*++
01025
01026 Routine Description:
01027
01028     This function creates a work queue, with the specified number of
01029     threads to service work items placed in the queue.  Work items
01030     are removed from the queue in the same order that they are placed
01031     in the queue.
01032
01033 Arguments:
01034
01035     NumberOfWorkerThreads - Specifies how many threads this function
01036         should create to process work items placed in the queue.
01037         The number must be no greater than MAXIMUM_WORKER_THREAD
01038         and greater than 0.
01039
01040     WorkerRoutine - Specifies the address of a routine to call
01041         for each work item as it is removed from the queue.  The
01042         thread context the routine is called in is undefined.
01043
01044 Return Value:
01045
01046     A pointer to the work queue.  Returns NULL if unable to create
01047     the work queue and its worker threads.  Extended error information
01048     is available from GetLastError()
01049
01050 --*/
01051
01052 {
01053    PWORK_QUEUE WorkQueue;
01054    HANDLE Thread;
01055    DWORD ThreadId;
01056    DWORD i;
01057
01058    //
01059    // Allocate space for the work queue, which includes an
01060    // array of thread handles.
01061    //
01062
01063    WorkQueue = LocalAlloc( LMEM_ZEROINIT,
01064                            sizeof( *WorkQueue ) +
01065                            (NumberOfWorkerThreads * sizeof( HANDLE ))
01066                          );
01067    if (WorkQueue == NULL)
01068    {
01069       return NULL;
01070    }
01071
01072    //
01073    // Mutual exclusion between the worker threads accessing the work
01074    // queue is done with a critical section. Initialize the critical
01075    // section and preallocate the event that will be used later by
01076    // EnterCriticalSection(). Set spin count to 0, so when the critical
01077    // section is unavailable, a calling thread will not spin before wait.
01078    //
01079
01080    if (!InitializeCriticalSectionAndSpinCount( &WorkQueue->CriticalSection, 0))
01081    {
01082       LocalFree( WorkQueue);
01083       return NULL;
01084    }
01085
01086    //
01087    // The work queue is controlled by a counting semaphore that
01088    // is incremented each time a work item is placed in the queue
01089    // and decremented each time a worker thread wakes up to remove
01090    // an item from the queue.
01091    //
01092
01093    if (WorkQueue->Semaphore = CreateSemaphore( NULL, 0, 100000, NULL ))
01094    {
01095
01096       //
01097       // The queue itself is just a doubly linked list, where
01098       // items are placed in the queue at the tail of the list
01099       // and removed from the queue from the head of the list.
01100       //
01101
01102       InitializeListHead( &WorkQueue->Queue );
01103
01104       //
01105       // Capture the address of the supplied worker function in
01106       // the work queue structure.
01107       //
01108
01109       WorkQueue->WorkerRoutine = WorkerRoutine;
01110
01111       //
01112       // Now create the requested number of worker threads. The
01113       // handle to each thread is remembered in an array of thread
01114       // handles in the work queue structure.
01115       //
01116
01117       for (i=0; i<NumberOfWorkerThreads; i++)
01118       {
01119          Thread = CreateThread( NULL,
01120                                 0,
01121                                 (LPTHREAD_START_ROUTINE) WorkerThread,
01122                                 WorkQueue,
01123                                 0,
01124                                 &ThreadId
01125                               );
01126          if (Thread == NULL)
01127          {
01128             break;
01129          }
01130          else
01131          {
01132             WorkQueue->NumberOfWorkerThreads++;
01133             WorkQueue->WorkerThreads[ i ] = Thread;
01134             SetThreadPriority( Thread, THREAD_PRIORITY_ABOVE_NORMAL );
01135          }
01136       }
01137
01138       //
01139       // If we successfully created all of the worker threads
01140       // then return the address of the work queue structure
01141       // to indicate success.
01142       //
01143
01144       if (i == NumberOfWorkerThreads)
01145       {
01146          return WorkQueue;
01147       }
01148    }
01149
01150    //
01151    // Failed for some reason.  Destroy whatever we managed
01152    // to create and return failure to the caller.
01153    //
01154
01155    DestroyWorkQueue( WorkQueue );
01156    return NULL;
01157 }
01158
01159
01160
01161 VOID
01162 DestroyWorkQueue(
01163                 IN OUT PWORK_QUEUE WorkQueue
01164                 )
01165
01166 /*++
01167
01168 Routine Description:
01169
01170     This function first sets the terminating flag of the specified work
01171     queue. It then shuts down the worker threads associated with work
01172     queue cleanly after the threads complete processing all the work
01173     items in the queue and exit. After all the threads have exited, the
01174     function destroys `the work queue.
01175
01176 Arguments:
01177
01178     WorkQueue - Supplies a pointer to the work queue to destroy.
01179
01180 Return Value:
01181
01182     None.
01183
01184 --*/
01185
01186 {
01187    DWORD i;
01188    DWORD rc;
01189
01190    //
01191    // If the semaphore handle field is not NULL, then there
01192    // may be threads to terminate.
01193    //
01194
01195    if (WorkQueue->Semaphore != NULL)
01196    {
01197       //
01198       // Set the terminating flag in the work queue and
01199       // signal the counting semaphore by the number of
01200       // worker threads so they will all wake up and
01201       // notice the terminating flag and exit.
01202       //
01203
01204       EnterCriticalSection( &WorkQueue->CriticalSection );
01205       _try {
01206          WorkQueue->Terminating = TRUE;
01207          ReleaseSemaphore( WorkQueue->Semaphore,
01208                            WorkQueue->NumberOfWorkerThreads,
01209                            NULL
01210                          );
01211          //
01212          // The count of the semaphore at this time is equal to the
01213          // number of work items remaining in the work queue plus
01214          // the number of worker threads. This ensures that all threads
01215          // will be awakened to run.
01216          //
01217       }
01218       _finally {
01219          LeaveCriticalSection( &WorkQueue->CriticalSection );
01220       }
01221
01222       //
01223       // Wait for all worker threads to run, see that the terminating
01224       // flag is set, and then exit when the work queue is empty. This
01225       // will occur eventually unless the system malfunctions. So do
01226       // not timeout.
01227       //
01228
01229       while (TRUE)
01230       {
01231          rc = WaitForMultipleObjectsEx( WorkQueue->NumberOfWorkerThreads,
01232                                         WorkQueue->WorkerThreads,
01233                                         TRUE,
01234                                         INFINITE,    // No timeout
01235                                         TRUE         // Alertable
01236                                       );
01237          if (rc == WAIT_IO_COMPLETION)
01238          {
01239             //
01240             // If we came out of the wait because an I/O
01241             // completion routine was called, reissue the
01242             // wait.
01243             //
01244             continue;
01245          }
01246          else
01247          {
01248             break;
01249          }
01250       }
01251
01252       //
01253       // Now all the worker threads have terminated. Close the thread
01254       // handles so the thread objects will eventually be deleted by
01255       // the object manager.
01256       //
01257
01258       for (i=0; i<WorkQueue->NumberOfWorkerThreads; i++)
01259       {
01260          CloseHandle( WorkQueue->WorkerThreads[ i ] );
01261       }
01262
01263       //
01264       // All threads stopped, all thread handles closed.  Now
01265       // delete the critical section and close the semaphore
01266       // handle.
01267       //
01268
01269       DeleteCriticalSection( &WorkQueue->CriticalSection );
01270       CloseHandle( WorkQueue->Semaphore );
01271    }
01272
01273    //
01274    // Everything is done, now free the memory used by the work queue.
01275    //
01276
01277    LocalFree( WorkQueue );
01278    return;
01279 }
01280
01281
01282
01283 BOOL
01284 QueueWorkItem(
01285              IN OUT PWORK_QUEUE WorkQueue,
01286              IN PWORK_QUEUE_ITEM WorkItem
01287              )
01288
01289 /*++
01290
01291 Routine Description:
01292
01293     This function queues a work item to the passed work queue that is
01294     processed by one of the worker threads associated with the queue.
01295
01296 Arguments:
01297
01298     WorkQueue - Supplies a pointer to the work queue that is to
01299         receive the work item.
01300
01301     WorkItem - Supplies a pointer to the work item to add to the queue.
01302         The work item structure contains a doubly linked list entry, the
01303         address of a routine to call and a parameter to pass to that
01304         routine.  It is the routine's responsibility to reclaim the
01305         storage occupied by the WorkItem structure.
01306
01307 Return Value:
01308
01309     TRUE if operation was successful.  Otherwise returns FALSE and
01310     extended error information is available from GetLastError()
01311
01312 --*/
01313
01314 {
01315    BOOL Result;
01316
01317    //
01318    // Acquire the work queue critical section and insert the work item
01319    // in the queue and release the semaphore if the work item is not
01320    // already in the list.
01321    //
01322
01323    EnterCriticalSection( &WorkQueue->CriticalSection );
01324    Result = TRUE;
01325    _try {
01326       WorkItem->WorkQueue = WorkQueue;
01327       InsertTailList( &WorkQueue->Queue, &WorkItem->List );
01328       Result = ReleaseSemaphore( WorkQueue->Semaphore, 1, NULL );
01329    }
01330    _finally {
01331       LeaveCriticalSection( &WorkQueue->CriticalSection );
01332    }
01333
01334    return Result;
01335 }
01336
01337
01338 VOID
01339 WorkerThread(
01340             LPVOID lpThreadParameter
01341             )
01342
01343 /*++
01344
01345 Routine Description:
01346
01347     This is the routine executed by each worker thread. Upon the
01348     creation of the thread, the routine allocates and initializes
01349     the state information and virtual buffer of the thread. It then
01350     continuously processes work items inserted in the queue whenever
01351     the thread is released to run. Upon termination, the routine
01352     calls ExitThread, which cleanly terminates the thread.
01353
01354 Arguments:
01355
01356     lpThreadParameter - Supplies a pointer to the work queue
01357         associated with this thread.
01358
01359 Return Value:
01360
01361     None
01362
01363 --*/
01364
01365 {
01366    PWORK_QUEUE WorkQueue = (PWORK_QUEUE)lpThreadParameter;
01367    DWORD rc;
01368    WORK_QUEUE_ITEM InitWorkItem;
01369    PWORK_QUEUE_ITEM WorkItem;
01370
01371    //
01372    // Call the worker routine with an initialize work item
01373    // to give it a chance to initialize some per thread
01374    // state that will passed to it for each subsequent
01375    // work item.
01376    //
01377
01378    InitWorkItem.Reason = WORK_INITIALIZE_ITEM;
01379    (WorkQueue->WorkerRoutine)( &InitWorkItem );
01380    while ( TRUE )
01381    {
01382       _try {
01383
01384          //
01385          // Wait until something is put in the queue (semaphore is
01386          // released), remove the item from the queue, mark it not
01387          // inserted, and execute the specified routine.
01388          //
01389
01390          rc = WaitForSingleObjectEx( WorkQueue->Semaphore, INFINITE, TRUE );
01391          if (rc == WAIT_IO_COMPLETION)
01392          {
01393             continue;
01394          }
01395
01396          EnterCriticalSection( &WorkQueue->CriticalSection );
01397          _try {
01398             if (WorkQueue->Terminating && IsListEmpty( &WorkQueue->Queue ))
01399             {
01400                break;
01401             }
01402
01403             WorkItem = (PWORK_QUEUE_ITEM)RemoveHeadList( &WorkQueue->Queue );
01404          }
01405          _finally {
01406             LeaveCriticalSection( &WorkQueue->CriticalSection );
01407          }
01408
01409          //
01410          // Execute the worker routine for this work item.
01411          //
01412
01413          (WorkQueue->WorkerRoutine)( WorkItem );
01414       }
01415       _except( EXCEPTION_EXECUTE_HANDLER )
01416       {
01417          //
01418          // Ignore any exceptions from worker routine.
01419          //
01420
01421       }
01422    }
01423
01424    //
01425    // We reach this point when the terminating flag of the work queue
01426    // is set and work queue is empty. Call the worker routine to free
01427    // the search request state and set the TlsIndex of the thread to
01428    // NULL.
01429    //
01430
01431    InitWorkItem.Reason = WORK_TERMINATE_ITEM;
01432    (WorkQueue->WorkerRoutine)( &InitWorkItem );
01433
01434    //
01435    // Call ExitThread to deallocate its own stack and then terminate.
01436    //
01437
01438    ExitThread( 0 );
01439
01440    //
01441    // The state of this thread becomes signaled.
01442    //
01443 }
01444
01445
01446 BOOL
01447 CreateVirtualBuffer(
01448                    OUT PVIRTUAL_BUFFER Buffer,
01449                    IN SIZE_T CommitSize,
01450                    IN SIZE_T ReserveSize OPTIONAL
01451                    )
01452
01453 /*++
01454
01455 Routine Description:
01456
01457     This function is called to create a virtual buffer.  A virtual
01458     buffer is a contiguous range of virtual memory, where some initial
01459     prefix portion of the memory is committed and the remainder is only
01460     reserved virtual address space.  A routine is provided to extend the
01461     size of the committed region incrementally or to trim the size of
01462     the committed region back to some specified amount.
01463
01464 Arguments:
01465
01466     Buffer - Pointer to the virtual buffer control structure that is
01467         filled in by this function.
01468
01469     CommitSize - Size of the initial committed portion of the buffer.
01470         May be zero.
01471
01472     ReserveSize - Amount of virtual address space to reserve for the
01473         buffer.  May be zero, in which case amount reserved is the
01474         committed size plus one, rounded up to the next 64KB boundary.
01475
01476 Return Value:
01477
01478     TRUE if operation was successful.  Otherwise returns FALSE and
01479     extended error information is available from GetLastError()
01480
01481 --*/
01482
01483 {
01484    SYSTEM_INFO SystemInformation;
01485
01486    //
01487    // Query the page size from the system for rounding
01488    // our memory allocations.
01489    //
01490
01491    GetSystemInfo( &SystemInformation );
01492    Buffer->PageSize = SystemInformation.dwPageSize;
01493
01494    //
01495    // If the reserve size was not specified, default it by
01496    // rounding up the initial committed size to a 64KB
01497    // boundary.  This is because the Win32 Virtual Memory
01498    // API calls always allocate virtual address space on
01499    // 64KB boundaries, so we might well have it available
01500    // for commitment.
01501    //
01502
01503    if (!ARGUMENT_PRESENT( ReserveSize ))
01504    {
01505       ReserveSize = ROUND_UP( CommitSize + 1, 0x10000 );
01506    }
01507
01508    //
01509    // Attempt to reserve the address space.
01510    //
01511
01512    Buffer->Base = VirtualAlloc( NULL,
01513                                 ReserveSize,
01514                                 MEM_RESERVE,
01515                                 PAGE_READWRITE
01516                               );
01517    if (Buffer->Base == NULL)
01518    {
01519       //
01520       // Unable to reserve address space, return failure.
01521       //
01522
01523       return FALSE;
01524    }
01525
01526    //
01527    // Attempt to commit some initial portion of the reserved region.
01528    //
01529    //
01530
01531    CommitSize = ROUND_UP( CommitSize, Buffer->PageSize );
01532    if (CommitSize == 0 ||
01533        VirtualAlloc( Buffer->Base,
01534                      CommitSize,
01535                      MEM_COMMIT,
01536                      PAGE_READWRITE
01537                    ) != NULL
01538       )
01539    {
01540       //
01541       // Either the size of the committed region was zero or the
01542       // commitment succeeded.  In either case calculate the
01543       // address of the first byte after the committed region
01544       // and the address of the first byte after the reserved
01545       // region and return successs.
01546       //
01547
01548       Buffer->CommitLimit = (LPVOID)
01549                             ((char *)Buffer->Base + CommitSize);
01550
01551       Buffer->ReserveLimit = (LPVOID)
01552                              ((char *)Buffer->Base + ReserveSize);
01553
01554       return TRUE;
01555    }
01556
01557    //
01558    // If unable to commit the memory, release the virtual address
01559    // range allocated above and return failure.
01560    //
01561
01562    VirtualFree( Buffer->Base, 0, MEM_RELEASE );
01563    return FALSE;
01564 }
01565
01566
01567
01568 BOOL
01569 ExtendVirtualBuffer(
01570                    IN PVIRTUAL_BUFFER Buffer,
01571                    IN LPVOID Address
01572                    )
01573
01574 /*++
01575
01576 Routine Description:
01577
01578     This function is called to extend the committed portion of a virtual
01579     buffer.
01580
01581 Arguments:
01582
01583     Buffer - Pointer to the virtual buffer control structure.
01584
01585     Address - Byte at this address is committed, along with all memory
01586         from the beginning of the buffer to this address.  If the
01587         address is already within the committed portion of the virtual
01588         buffer, then this routine does nothing.  If the address is
01589         outside the reserved portion of the virtual buffer, then this
01590         routine returns an error.
01591
01592         Otherwise enough pages are committed so that the memory from the
01593         base of the buffer to the passed address is a contiguous region
01594         of committed memory.
01595
01596
01597 Return Value:
01598
01599     TRUE if operation was successful.  Otherwise returns FALSE and
01600     extended error information is available from GetLastError()
01601
01602 --*/
01603
01604 {
01605    SIZE_T NewCommitSize;
01606    LPVOID NewCommitLimit;
01607
01608    //
01609    // See if address is within the buffer.
01610    //
01611
01612    if (Address >= Buffer->Base && Address < Buffer->ReserveLimit)
01613    {
01614       //
01615       // See if the address is within the committed portion of
01616       // the buffer.  If so return success immediately.
01617       //
01618
01619       if (Address < Buffer->CommitLimit)
01620       {
01621          return TRUE;
01622       }
01623
01624       //
01625       // Address is within the reserved portion.  Determine how many
01626       // bytes are between the address and the end of the committed
01627       // portion of the buffer.  Round this size to a multiple of
01628       // the page size and this is the amount we will attempt to
01629       // commit.
01630       //
01631
01632       NewCommitSize =
01633     ROUND_UP( (SIZE_T) Address + 1, Buffer->PageSize ) - (SIZE_T) Buffer->CommitLimit;
01634
01635       //
01636       // Attempt to commit the memory.
01637       //
01638
01639       NewCommitLimit = VirtualAlloc( Buffer->CommitLimit,
01640                                      NewCommitSize,
01641                                      MEM_COMMIT,
01642                                      PAGE_READWRITE
01643                                    );
01644       if (NewCommitLimit != NULL)
01645       {
01646          //
01647          // Successful, so update the upper limit of the committed
01648          // region of the buffer and return success.
01649          //
01650
01651          Buffer->CommitLimit = (LPVOID)
01652                                ((SIZE_T)NewCommitLimit + NewCommitSize);
01653
01654          return TRUE;
01655       }
01656    }
01657
01658    //
01659    // Address is outside of the buffer, return failure.
01660    //
01661
01662    return FALSE;
01663 }
01664
01665
01666 BOOL
01667 TrimVirtualBuffer(
01668                  IN PVIRTUAL_BUFFER Buffer
01669                  )
01670
01671 /*++
01672
01673 Routine Description:
01674
01675     This function is called to decommit any memory that has been
01676     committed for this virtual buffer.
01677
01678 Arguments:
01679
01680     Buffer - Pointer to the virtual buffer control structure.
01681
01682 Return Value:
01683
01684     TRUE if operation was successful.  Otherwise returns FALSE and
01685     extended error information is available from GetLastError()
01686
01687 --*/
01688
01689 {
01690    Buffer->CommitLimit = Buffer->Base;
01691    return VirtualFree( Buffer->Base, 0, MEM_DECOMMIT );
01692 }
01693
01694
01695
01696 BOOL
01697 FreeVirtualBuffer(
01698                  IN PVIRTUAL_BUFFER Buffer
01699                  )
01700 /*++
01701
01702 Routine Description:
01703
01704     This function is called to free all the memory that is associated
01705     with this virtual buffer.
01706
01707 Arguments:
01708
01709     Buffer - Pointer to the virtual buffer control structure.
01710
01711 Return Value:
01712
01713     TRUE if operation was successful.  Otherwise returns FALSE and
01714     extended error information is available from GetLastError()
01715
01716 --*/
01717
01718 {
01719    //
01720    // Decommit and release all virtual memory associated with
01721    // this virtual buffer.
01722    //
01723
01724    return VirtualFree( Buffer->Base, 0, MEM_RELEASE );
01725 }
01726
01727
01728
01729 int
01730 VirtualBufferExceptionFilter(
01731                             IN DWORD ExceptionCode,
01732                             IN PEXCEPTION_POINTERS ExceptionInfo,
01733                             IN OUT PVIRTUAL_BUFFER Buffer
01734                             )
01735
01736 /*++
01737
01738 Routine Description:
01739
01740     This function is an exception filter that handles exceptions that
01741     referenced uncommitted but reserved memory contained in the passed
01742     virtual buffer.  It this filter routine is able to commit the
01743     additional pages needed to allow the memory reference to succeed,
01744     then it will re-execute the faulting instruction.  If it is unable
01745     to commit the pages, it will execute the callers exception handler.
01746
01747     If the exception is not an access violation or is an access
01748     violation but does not reference memory contained in the reserved
01749     portion of the virtual buffer, then this filter passes the exception
01750     on up the exception chain.
01751
01752 Arguments:
01753
01754     ExceptionCode - Reason for the exception.
01755
01756     ExceptionInfo - Information about the exception and the context
01757         that it occurred in.
01758
01759     Buffer - Points to a virtual buffer control structure that defines
01760         the reserved memory region that is to be committed whenever an
01761         attempt is made to access it.
01762
01763 Return Value:
01764
01765     Exception disposition code that tells the exception dispatcher what
01766     to do with this exception.  One of three values is returned:
01767
01768         EXCEPTION_EXECUTE_HANDLER - execute the exception handler
01769             associated with the exception clause that called this filter
01770             procedure.
01771
01772         EXCEPTION_CONTINUE_SEARCH - Continue searching for an exception
01773             handler to handle this exception.
01774
01775         EXCEPTION_CONTINUE_EXECUTION - Dismiss this exception and return
01776             control to the instruction that caused the exception.
01777
01778
01779 --*/
01780
01781 {
01782    LPVOID FaultingAddress;
01783
01784    //
01785    // If this is an access violation touching memory within
01786    // our reserved buffer, but outside of the committed portion
01787    // of the buffer, then we are going to take this exception.
01788    //
01789
01790    if (ExceptionCode == STATUS_ACCESS_VIOLATION)
01791    {
01792       //
01793       // Get the virtual address that caused the access violation
01794       // from the exception record.  Determine if the address
01795       // references memory within the reserved but uncommitted
01796       // portion of the virtual buffer.
01797       //
01798
01799       FaultingAddress = (LPVOID)ExceptionInfo->ExceptionRecord->ExceptionInformation[ 1 ];
01800       if (FaultingAddress >= Buffer->CommitLimit &&
01801           FaultingAddress <= Buffer->ReserveLimit
01802          )
01803       {
01804          //
01805          // This is our exception.  Try to extend the buffer
01806          // to including the faulting address.
01807          //
01808
01809          if (ExtendVirtualBuffer( Buffer, FaultingAddress ))
01810          {
01811             //
01812             // Buffer successfully extended, so re-execute the
01813             // faulting instruction.
01814             //
01815
01816             return EXCEPTION_CONTINUE_EXECUTION;
01817          }
01818          else
01819          {
01820             //
01821             // Unable to extend the buffer.  Stop searching
01822             // for exception handlers and execute the caller's
01823             // handler.
01824             //
01825
01826             return EXCEPTION_EXECUTE_HANDLER;
01827          }
01828       }
01829    }
01830
01831    //
01832    // Not an exception we care about, so pass it up the chain.
01833    //
01834
01835    return EXCEPTION_CONTINUE_SEARCH;
01836 }
01837
01838
01839 BOOL
01840 EnumerateDirectoryTree(
01841                       LPSTR DirectoryPath,
01842                       PDIRECTORY_ENUMERATE_ROUTINE EnumerateRoutine,
01843                       PVOID EnumerateParameter
01844                       )
01845
01846 /*++
01847
01848 Routine Description:
01849
01850     This function walks a directory tree, depth first, calling the
01851     passed enumeration routine for each directory and file found
01852     in the tree.  The enumeration routine is passed the full path
01853     of the file, the directory information associated with the file
01854     and an enumeration parameter that is uninterpreted by this
01855     function.
01856
01857 Arguments:
01858
01859     DirectoryPath - Absolute or relative path to the directory that
01860         is the root of the tree to enumerate.
01861
01862     EnumerateRoutine - Pointer to an enumeration routine to call
01863         for each file and directory found.
01864
01865     EnumerateParameter - Uninterpreted 32-bit value that is passed
01866         to the EnumerationRoutine each time it is called.
01867
01868 Return Value:
01869
01870     TRUE if operation was successful.  Otherwise returns FALSE and
01871     extended error information is available from GetLastError()
01872
01873 --*/
01874
01875 {
01876    BOOL Result;
01877    VIRTUAL_BUFFER Buffer;
01878    PENUMERATE_DIRECTORY_STATE State;
01879    PENUMERATE_DIRECTORY_STACK Stack;
01880    WIN32_FIND_DATA FindFileData;
01881
01882    //
01883    // Create a virtual buffer with an initial committed size of
01884    // our directory state buffer, and a maximum reserved size of
01885    // the longest possible full path based on the maximum depth
01886    // we handle and the maximum length of each path component.
01887    //
01888
01889    if (!CreateVirtualBuffer( &Buffer,
01890                              (SIZE_T)  sizeof( ENUMERATE_DIRECTORY_STATE ),
01891                (SIZE_T)  (sizeof( ENUMERATE_DIRECTORY_STATE ) +
01892                     MAX_DEPTH * MAX_PATH)
01893                            )
01894       )
01895    {
01896       return FALSE;
01897    }
01898
01899    //
01900    // This buffer will be used to maintain a stack of directory
01901    // search handles, as well as accumulate the full path string
01902    // as we descend the directory tree.
01903    //
01904
01905    State = (PENUMERATE_DIRECTORY_STATE)Buffer.Base;
01906    State->Depth = 0;
01907    Stack = &State->Stack[ 0 ];
01908
01909    //
01910    // Enter a try ... finally block so we can insure that we clean
01911    // up after ourselves on exit.
01912    //
01913
01914    _try {
01915       //
01916       // First translate the passed in DirectoryPath into a fully
01917       // qualified path.  This path will be the initial value in
01918       // our path buffer.  The initial allocation of the path buffer
01919       // is big enough for this initial request, so does not need
01920       // to be guarded by a try ... except clause.
01921       //
01922
01923       if (GetFullPathName( DirectoryPath, MAX_PATH, State->Path, &Stack->PathEnd ))
01924       {
01925          //
01926          // Now enter a try ... except block that will be used to
01927          // manage the commitment of space in the path buffer as
01928          // we append subdirectory names and file names to it.
01929          // Using the virtual buffer allows us to handle full
01930          // path names up to 16KB in length, with an initial
01931          // allocation of 4KB.
01932          //
01933
01934          _try {
01935             //
01936             // Walk the directory tree.  The outer loop is executed
01937             // once for each directory in the tree.
01938             //
01939
01940             while (TRUE)
01941             {
01942                startDirectorySearch:
01943                //
01944                // Find the end of the current path, and make sure
01945                // there is a trailing path separator.
01946                //
01947
01948                Stack->PathEnd = strchr( State->Path, '\0' );
01949                if (Stack->PathEnd > State->Path && Stack->PathEnd[ -1 ] != '\\')
01950                {
01951                   *(Stack->PathEnd)++ = '\\';
01952                }
01953
01954                //
01955                // Now append the wild card specification that will
01956                // let us enumerate all the entries in this directory.
01957                // Call FindFirstFile to find the first entry in the
01958                // directory.
01959                //
01960
01961                strcpy( Stack->PathEnd, "*.*" );
01962                Stack->FindHandle = FindFirstFile( State->Path,
01963                                                   &FindFileData
01964                                                 );
01965                if (Stack->FindHandle != INVALID_HANDLE_VALUE)
01966                {
01967                   //
01968                   // Entry found.  Now loop through the entire
01969                   // directory processing each entry found,
01970                   // including the first one.
01971                   //
01972                   do
01973                   {
01974                      //
01975                      // Ignore bogus pseudo-directories that are
01976                      // returned by some file systems (e.g. FAT).
01977                      //
01978
01979                      if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
01980                          (!strcmp( FindFileData.cFileName, "." ) ||
01981                           !strcmp( FindFileData.cFileName, ".." )
01982                          )
01983                         )
01984                      {
01985                         continue;
01986                      }
01987
01988                      //
01989                      // Copy the file name portion from the current
01990                      // directory entry to the last component in the
01991                      // path buffer.
01992                      //
01993                      // We can use strcpy here because we know that
01994                      // the source is a null terminated string.
01995                      //
01996
01997                      strcpy( Stack->PathEnd, FindFileData.cFileName );
01998
01999                      //
02000                      // Call the supplied enumeration routine with the
02001                      // full path we have built up in the path buffer,
02002                      // the directory information for this directory
02003                      // entry and the supplied enumeration parameter.
02004                      //
02005
02006                      (*EnumerateRoutine)( State->Path, &FindFileData, EnumerateParameter );
02007
02008                      //
02009                      // If this entry is a subdirectory, then it is
02010                      // time to recurse.  Do this by incrementing the
02011                      // stack pointer and depth and jumping to the top
02012                      // of the outer loop to process current contents
02013                      // of the path buffer as a fully qualified name of
02014                      // a directory.
02015                      //
02016
02017                      if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
02018                      {
02019                         Stack++;
02020                         State->Depth++;
02021                         goto startDirectorySearch;
02022                         restartDirectorySearch:         ;
02023                      }
02024
02025                      //
02026                      // Here to find the next entry in the current directory.
02027                      //
02028                   }
02029
02030                   while ( FindNextFile( Stack->FindHandle, &FindFileData ) );
02031
02032                   //
02033                   // No more entries in the current directory, so close
02034                   // the search handle and fall into the code that will
02035                   // pop our stack of directory seacrh handles.
02036
02037                   FindClose( Stack->FindHandle );
02038                }
02039
02040                //
02041                // Here when done with a directory.  See if we are pushed
02042                // inside another directory.  If not, then we are done
02043                // enumerating the whole tree, so break out of the loop.
02044                //
02045
02046                if (!State->Depth)
02047                {
02048                   Result = TRUE;
02049                   break;
02050                }
02051
02052                //
02053                // We were pushed within another directory search,
02054                // so pop the stack to restore its search handle
02055                // and path buffer position and resume the search
02056                // within that directory.
02057
02058                State->Depth--;
02059                --Stack;
02060                goto restartDirectorySearch;
02061             }
02062          }
02063
02064          //
02065          // Any of the code that appends to the path buffer within
02066          // the above try ... except clause can cause an access
02067          // violation if the path buffer becomes longer than its
02068          // current committed size.  This exception filter
02069          // will dynamically commit additional pages as needed
02070          // and resume execution.
02071          //
02072
02073          _except( VirtualBufferExceptionFilter( GetExceptionCode(),
02074                                                 GetExceptionInformation(),
02075                                                 &Buffer
02076                                               )
02077                 )
02078          {
02079             //
02080             // We will get here if the exception filter was unable to
02081             // commit the memory.
02082             //
02083
02084             Result = FALSE;
02085          }
02086       }
02087       else
02088       {
02089          //
02090          // Initial GetFullPathName failed, so return a failure.
02091          //
02092
02093          Result = FALSE;
02094       }
02095    }
02096    _finally {
02097       //
02098       // Here on our way out of the outer try ... finally block.
02099       // Make sure all our search handles have been closed and then
02100       // free the virtual buffer.  The only way this code is not
02101       // executed is if code within the try ... finally block
02102       // called ExitThread or ExitProcess, or an external thread
02103       // or process terminated this thread or process.
02104       //
02105       // In the case of process death, this is not a problem, because
02106       // process terminate closes all open handles attached to the process
02107       // and frees all private virtual memory that is part of the address
02108       // space of the process.
02109       //
02110       // In the case ot thread death, the code below is not executed if
02111       // the thread terminates via ExitThread in the context of the
02112       // try .. finally or if an external thread, either in this process
02113       // or another process called TerminateThread on this thread.
02114       //
02115
02116       while (State->Depth--)
02117       {
02118          --Stack;
02119          FindClose( Stack->FindHandle );
02120       }
02121
02122       FreeVirtualBuffer( &Buffer );
02123    }
02124
02125    return Result;
02126 }
02127
02128
02129 BOOL
02130 ProcessCommandLineArguments(
02131                            int argc,
02132                            char *argv[]
02133                            )
02134 {
02135    BOOL Result;
02136    LPSTR s;
02137
02138    Result = FALSE;
02139    _try {
02140       if (argc < 1)
02141       {
02142          return Result;
02143       }
02144
02145       while (--argc)
02146       {
02147          s = *++argv;
02148          if (*s == '-' || *s == '/')
02149          {
02150             while (*++s)
02151             {
02152                switch ( tolower( *s ) )
02153                {
02154                case 'm':
02155                   MappedFileIO = TRUE;
02156                   break;
02157
02158                case 'a':
02159                   ASyncIO = TRUE;
02160                   break;
02161
02162                case 's':
02163                   SyncIO = TRUE;
02164                   break;
02165
02166                case 'v':
02167                   Verbose = TRUE;
02168                   break;
02169
02170                case 'y':
02171                   IgnoreCase = TRUE;
02172                   break;
02173
02174                case 't':
02175                   if (--argc)
02176                   {
02177                      NumberOfWorkerThreads = atoi( *++argv );
02178                      if (NumberOfWorkerThreads > 0)
02179                      {
02180                         if (NumberOfWorkerThreads > MAXIMUM_WORKER_THREADS)
02181                         {
02182                            NumberOfWorkerThreads = MAXIMUM_WORKER_THREADS;
02183                         }
02184                         break;
02185                      }
02186                   }
02187
02188                   // fall through if -t argument missing.
02189
02190                case '?':
02191                case 'h':
02192                default:
02193                   return Result;
02194                }
02195             }
02196          }
02197          else
02198             if (SearchString == NULL)
02199          {
02200             SearchString = s;
02201          }
02202          else
02203             if (DirectoryPath == NULL)
02204          {
02205             DirectoryPath = s;
02206          }
02207          else
02208          {
02209             return Result;
02210          }
02211       }
02212
02213       if (SearchString == NULL)
02214       {
02215          return Result;
02216       }
02217
02218       SearchStringLength = (DWORD)strlen(SearchString);
02219       if (SearchStringLength == 0)
02220       {
02221          return Result;
02222       }
02223
02224       if (IgnoreCase)
02225       {
02226          SearchFunction = _strnicmp;
02227       }
02228       else
02229       {
02230          SearchFunction = strncmp;
02231       }
02232
02233       if (DirectoryPath == NULL)
02234       {
02235          DirectoryPath = ".";
02236       }
02237
02238       //
02239       // If the command line specifies neither asynchronous nor
02240       // synchronous I/O, use mapped file I/O.
02241       //
02242
02243       if (!(ASyncIO || SyncIO))
02244       {
02245          MappedFileIO = TRUE;
02246
02247       } else {
02248
02249          MappedFileIO = FALSE;
02250       }
02251
02252       if (Verbose)
02253       {
02254          fprintf( stderr, "Directory Tree: %s\n", DirectoryPath );
02255          fprintf( stderr, "Search String: '%s'\n", SearchString );
02256          fprintf( stderr, "Case %ssensitive\n", IgnoreCase ? "in" : "" );
02257          fprintf( stderr, "Number of Worker Threads: %u\n", NumberOfWorkerThreads );
02258
02259          if (MappedFileIO)
02260          {
02261             fprintf( stderr, "Using Mapped File I/O\n" );
02262          }
02263          else
02264             if (ASyncIO)
02265          {
02266             fprintf( stderr, "Using ASynchronous File I/O\n" );
02267          }
02268          else
02269             if (SyncIO)
02270          {
02271             fprintf( stderr, "Using Synchronous File I/O\n" );
02272          }
02273       }
02274
02275       Result = TRUE;
02276
02277    }
02278    _finally {
02279       if (!Result)
02280       {
02281          fprintf( stderr, "usage: AsyncIO [-h] [-v] [-y] [-a | -s | -m] [-t n] SearchString [DirectoryPath]\n" );
02282          fprintf( stderr, "Where...\n" );
02283          fprintf( stderr, "    -h - prints this message\n" );
02284          fprintf( stderr, "    -v - generates verbose output\n" );
02285          fprintf( stderr, "    -y - ignores case when doing comparision\n" );
02286          fprintf( stderr, "    -t - specifies the number of threads to use (defaults to 4 * number of processors)\n" );
02287          fprintf( stderr, "    -a - uses asynchronous file I/O\n" );
02288          fprintf( stderr, "    -s - uses synchronous file I/O\n" );
02289          fprintf( stderr, "    -m - uses mapped file I/O (default)\n" );
02290          fprintf( stderr, "    SearchString - specifies the text to search for\n" );
02291          fprintf( stderr, "    DirectoryPath - specifies the directory to start from (defaults to .)\n" );
02292       }
02293    }
02294
02295    return Result;
02296 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Framer/IDocSite.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Framer

IDocSite.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /*
00019  * IDOCSITE.CPP
00020  * IOleDocumentSite for Document Objects CSite class
00021  *
00022  */
00023
00024
00025 #include "framer.h"
00026
00027
00028 /*
00029  * CImpIOleDocumentSite::CImpIOleDocumentSite
00030  * CImpIOleDocumentSite::~CImpIOleDocumentSite
00031  *
00032  * Parameters (Constructor):
00033  *  pSite           PCSite of the site we're in.
00034  *  pUnkOuter       LPUNKNOWN to which we delegate.
00035  */
00036
00037 CImpIOleDocumentSite::CImpIOleDocumentSite(PCSite pSite
00038     , LPUNKNOWN pUnkOuter)
00039     {
00040     m_cRef=0;
00041     m_pSite=pSite;
00042     m_pUnkOuter=pUnkOuter;
00043     return;
00044     }
00045
00046 CImpIOleDocumentSite::~CImpIOleDocumentSite(void)
00047     {
00048     return;
00049     }
00050
00051
00052
00053 /*
00054  * CImpIOleDocumentSite::QueryInterface
00055  * CImpIOleDocumentSite::AddRef
00056  * CImpIOleDocumentSite::Release
00057  *
00058  * Purpose:
00059  *  IUnknown members for CImpIOleDocumentSite object.
00060  */
00061
00062 STDMETHODIMP CImpIOleDocumentSite::QueryInterface(REFIID riid
00063     , void **ppv)
00064     {
00065     return m_pUnkOuter->QueryInterface(riid, ppv);
00066     }
00067
00068
00069 STDMETHODIMP_(ULONG) CImpIOleDocumentSite::AddRef(void)
00070     {
00071     ++m_cRef;
00072     return m_pUnkOuter->AddRef();
00073     }
00074
00075 STDMETHODIMP_(ULONG) CImpIOleDocumentSite::Release(void)
00076     {
00077     --m_cRef;
00078     return m_pUnkOuter->Release();
00079     }
00080
00081
00082
00083
00084 /*
00085  * CImpIOleDocumentsite::ActivateMe
00086  *
00087  * Purpose:
00088  *  Instructs the container to activate the object in this site as
00089  *  a document object.
00090  *
00091  * Parameters:
00092  *  pView           IOleDocumentView * of the object to activate.
00093  *
00094  * Return Value:
00095  *  HRESULT         NOERROR if successful, error code otherwise.
00096  */
00097
00098 STDMETHODIMP CImpIOleDocumentSite::ActivateMe(IOleDocumentView *pView)
00099     {
00100     RECT                rc;
00101     IOleDocument*       pDoc;
00102
00103     /*
00104      * If we're passed a NULL view pointer, then try to get one from
00105      * the document object (the object within us).
00106      */
00107     if (NULL==pView)
00108         {
00109
00110         if (FAILED(m_pSite->m_pObj->QueryInterface(IID_IOleDocument
00111             , (void **)&pDoc)))
00112             return E_FAIL;
00113
00114         if (FAILED(pDoc->CreateView(m_pSite->m_pImpIOleIPSite
00115             , m_pSite->m_pIStream, 0, &pView)))
00116             return E_OUTOFMEMORY;
00117
00118         // Release doc pointer since CreateView is a good com method that addrefs
00119         pDoc->Release();
00120         }
00121     else
00122         {
00123         //Make sure that the view has our client site
00124         pView->SetInPlaceSite(m_pSite->m_pImpIOleIPSite);
00125
00126         //We're holding onto the pointer, so AddRef it.
00127         pView->AddRef();
00128         }
00129
00130
00131     /*
00132      * Activation steps, now that we have a view:
00133      *
00134      *  1.  Call IOleDocumentView::SetInPlaceSite (assume done since
00135      *      either the view already knows, or IOleDocument::CreateView
00136      *      has done it already.
00137      *
00138      *  2.  Call IOleDocumentView::SetRect to give a bunch of space to
00139      *      the view.  In our case this is the whole client area of
00140      *      the CPages window.  (Patron doesn't use SetRectComplex)
00141      *
00142      *  3.  Call IOleDocumentView::Show to make the thing visible.
00143      *
00144      *  4.  Call IOleDocumentView::UIActivate to finish the job.
00145      *
00146      */
00147
00148     m_pSite->m_fDocObj=TRUE;
00149     m_pSite->m_pIOleDocView=pView;
00150
00151     //This sets up toolbars and menus first
00152     pView->UIActivate(TRUE);
00153
00154     //Set the window size sensitive to new toolbars
00155     GetClientRect(m_pSite->m_hWnd, &rc);
00156     pView->SetRect(&rc);
00157
00158   //Makes it all active
00159     pView->Show(TRUE);
00160     return NOERROR;
00161     }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBaseDialog Member List

This is the complete list of members for CBaseDialog, including all inherited members.
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
m_DlgProc | CBaseDialog | [private]
m_dwFlags | CBaseDialog | [private]
m_hWnd | CBaseDialog | [private]
m_nTemplate | CBaseDialog | [private]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | CBaseDialog | [pure virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | CBaseDialog | [pure virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | CBaseDialog | [pure virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | CBaseDialog | [pure virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | CBaseDialog | [pure virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | CBaseDialog | [pure virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
Generated on Wed Nov 13 2024 16:55:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CInkInputWnd Member List

This is the complete list of members for CInkInputWnd, including all inherited members.
CInkInputWnd() | CInkInputWnd |
CInkInputWnd() | CInkInputWnd |
m_cColumns | CInkInputWnd | [private]
m_cRows | CInkInputWnd | [private]
m_iMidline | CInkInputWnd | [private]
m_ptGridLT | CInkInputWnd | [private]
m_rcDrawnBox | CInkInputWnd | [private]
m_szWritingBox | CInkInputWnd | [private]
OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CInkInputWnd |
OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CInkInputWnd |
SetGuide(const _InkRecoGuide &irg) | CInkInputWnd |
SetGuide(const _InkRecoGuide &irg) | CInkInputWnd |
SetRowsCols(int iRows, int iColumns) | CInkInputWnd |
SetRowsCols(int iRows, int iColumns) | CInkInputWnd |
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkErase/C#/AssemblyInfo.cs Source File

  • TabletPC
  • InkErase
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("Ink Erase Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2003 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/applet.cpp Source File

  • Web
  • NetMeeting
  • NMChat2

applet.cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       APPLET.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1999-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016 #include "iapplet.c"
00017
00018 //****************************************************************************
00019 //
00020 // Global Varaiables
00021 //
00022 //****************************************************************************
00023
00024 //
00025 // The Applet object
00026 //
00027 CApplet *g_pApplet = NULL;
00028
00029
00030 //
00031 // Create and initialize the applet object.
00032 //
00033 HRESULT InitApplet(void)
00034 {
00035     //
00036     // Make sure we are clean in the beginning.
00037     //
00038     ASSERT(NULL == g_pApplet);
00039     ASSERT(NULL == g_pSession);
00040
00041   if(NULL != g_pApplet || NULL != g_pSession)
00042   {
00043     return E_POINTER;
00044   }
00045
00046     //
00047     // Create the IApplet interface.
00048     //
00049     IApplet* pIApplet = NULL;
00050     HRESULT hr = ::CoCreateInstance(
00051                         CLSID_NmApplet,
00052                         NULL,
00053                         CLSCTX_LOCAL_SERVER,
00054                         IID_IApplet,
00055                         (void **) &pIApplet);
00056     if (SUCCEEDED(hr))
00057     {
00058         ASSERT(NULL != pIApplet);
00059
00060         //
00061         // Initialize the IApplet interface.
00062         //
00063         hr = pIApplet->Initialize();
00064         if (SUCCEEDED(hr))
00065         {
00066             //
00067             // Create the Applet object, which is a wrapper of the IApplet
00068             // interface, and also implements the IAppletNotify notification
00069             // sink.
00070             //
00071             g_pApplet = new CApplet(pIApplet);
00072             if (NULL != g_pApplet)
00073             {
00074                 //
00075                 // Hook up the notification sink.
00076                 //
00077                 hr = g_pApplet->Advise();
00078                 ASSERT(S_OK == hr);
00079             }
00080             else
00081             {
00082                 hr = E_OUTOFMEMORY;
00083             }
00084         }
00085     }
00086     return hr;
00087 }
00088
00089
00090 //
00091 // Deinitialize and release the applet object.
00092 //
00093 void FreeApplet(void)
00094 {
00095     HRESULT hr = NO_ERROR;
00096     if (NULL != g_pSession)
00097     {
00098         hr = g_pSession->UnAdvise();
00099         ASSERT(S_OK == hr);
00100
00101         g_pSession->Release();
00102         g_pSession = NULL;
00103     }
00104
00105     if (NULL != g_pApplet)
00106     {
00107         hr = g_pApplet->UnAdvise();
00108         ASSERT(S_OK == hr);
00109
00110         g_pApplet->Release();
00111         g_pApplet = NULL;
00112     }
00113 }
00114
00115
00116 //****************************************************************************
00117 //
00118 // CLASS CApplet
00119 //
00120 //****************************************************************************
00121
00122
00123 //****************************************************************************
00124 //
00125 // Constructor
00126 //
00127 //****************************************************************************
00128
00129 CApplet::CApplet(IApplet *pIApplet)
00130 :
00131     CRefCount(),
00132     m_pIApplet(pIApplet),
00133     m_dwCookie(0)
00134 {
00135     ASSERT(NULL != m_pIApplet);
00136 }
00137
00138
00139 //****************************************************************************
00140 //
00141 // Destructor
00142 //
00143 //****************************************************************************
00144
00145 CApplet::~CApplet(void)
00146 {
00147     ASSERT(NULL != m_pIApplet);
00148     m_pIApplet->Release();
00149 }
00150
00151
00152 //****************************************************************************
00153 //
00154 // Methods from IUnknown
00155 //
00156 //****************************************************************************
00157
00158 ULONG STDMETHODCALLTYPE
00159 CApplet::AddRef(void)
00160 {
00161     return CRefCount::AddRef();
00162 }
00163
00164 ULONG STDMETHODCALLTYPE
00165 CApplet::Release(void)
00166 {
00167     return CRefCount::Release();
00168 }
00169
00170 HRESULT STDMETHODCALLTYPE
00171 CApplet::QueryInterface(REFIID riid, void * *ppvObject)
00172 {
00173   if(NULL == ppvObject)
00174   {
00175     return E_POINTER;
00176   }
00177
00178     HRESULT hr = NO_ERROR;
00179
00180     if (riid == IID_IUnknown)
00181     {
00182         *ppvObject = (IUnknown *)this;
00183     }
00184     else if (riid == IID_IAppletNotify)
00185     {
00186         *ppvObject = (IAppletNotify *)this;
00187     }
00188     else
00189     {
00190         hr = E_NOINTERFACE;
00191         *ppvObject = NULL;
00192     }
00193
00194     if (S_OK == hr)
00195     {
00196         AddRef();
00197     }
00198
00199     return hr;
00200 }
00201
00202
00203 //****************************************************************************
00204 //
00205 // Methods from IAppletNotify
00206 //
00207 //****************************************************************************
00208
00209 HRESULT STDMETHODCALLTYPE
00210 CApplet::PermitToJoinSessionIndication
00211 (
00212     AppletConfID        nConfID,
00213     BOOL                fPermissionGranted
00214 )
00215 {
00216     HRESULT hr = NO_ERROR;
00217
00218     if (fPermissionGranted)
00219     {
00220         //
00221         // A new conference just starts.
00222         //
00223
00224         //
00225         // We only support one session per applet for now.
00226         //
00227         ASSERT(NULL == g_pSession);
00228
00229     if(NULL != g_pSession)
00230     {
00231       return E_POINTER;
00232     }
00233         //
00234         // Create the IAppletSession interface.
00235         //
00236         IAppletSession *pISession = NULL;
00237         hr = m_pIApplet->CreateSession(&pISession, nConfID);
00238         if (S_OK == hr)
00239         {
00240             //
00241             // Create the Applet Session object, which is a wrapper of
00242             // the IAppletSession interface, and implements
00243             // the IAppletSessionNotify notification sink.
00244             //
00245             g_pSession = new CAppletSession(this, pISession);
00246             if (NULL != g_pSession)
00247             {
00248                 //
00249                 // Hook up the notification sink.
00250                 //
00251                 hr = g_pSession->Advise();
00252                 ASSERT(S_OK == hr);
00253
00254                 //
00255                 // Join the conference now.
00256                 //
00257                 hr = g_pSession->Join();
00258                 ASSERT(S_OK == hr);
00259             }
00260         }
00261         else
00262         {
00263             ASSERT(S_OK == hr);
00264         }
00265     }
00266     else
00267     {
00268         //
00269         // The conference is exiting.
00270         //
00271
00272         if (NULL != g_pSession)
00273         {
00274             //
00275             // Make sure this is the conference which I am in now.
00276             //
00277             ASSERT(nConfID == g_pSession->GetConfID());
00278
00279             //
00280             // Leave the conference as directed.
00281             //
00282             hr = g_pSession->Leave();
00283             ASSERT(S_OK == hr);
00284
00285             //
00286             // Unhook the notification sink.
00287             //
00288             hr = g_pSession->UnAdvise();
00289             ASSERT(S_OK == hr);
00290
00291             g_pSession->Release();
00292             g_pSession = NULL;
00293         }
00294     }
00295
00296     return S_OK;
00297 }
00298
00299
00300 HRESULT STDMETHODCALLTYPE
00301 CApplet::AutoJoinSessionIndication
00302 (
00303     IAppletSession     *pSession,
00304     HRESULT             hrResult,
00305     AppletUserID        uidMyself,
00306     AppletNodeID        nidMyself,
00307     AppletSessionID     sidMyself,
00308     AppletEntityID      eidMyself,
00309     ULONG               cDynamicChannels,
00310     AppletChannelID     aDynamicChannels[]
00311 )
00312 {
00313     //
00314     // We do not register auto-join; therefore,
00315     // we will not receive this indication.
00316     //
00317
00318     //
00319     // In case of using auto join, the code to handle this notification
00320     // should be very similar to that in CAppletSession::JoinSessionConfirm.
00321     //
00322
00323     return S_OK;
00324 }
00325
00326
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/setup.exe/common.h Source File

  • SysMgmt
  • Msi
  • setup.exe

common.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (C) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       common.h
00006 //
00007 //--------------------------------------------------------------------------
00008
00009 #ifndef __COMMON_H_5F90F583_B9A4_4A8F_91BC_618DE6696231_
00010 #define __COMMON_H_5F90F583_B9A4_4A8F_91BC_618DE6696231_
00011
00012 #include <windows.h>
00013
00014 /*--------------------------------------------------------------------------
00015  *
00016  * Predefined Resource Types
00017  *
00018  --------------------------------------------------------------------------*/
00019 #define RT_INSTALL_PROPERTY  MAKEINTRESOURCE(40)
00020
00021 /*--------------------------------------------------------------------------
00022  *
00023  * Predefined Resource Names
00024  *
00025  --------------------------------------------------------------------------*/
00026 #define ISETUPPROPNAME_BASEURL              TEXT("BASEURL")
00027 #define ISETUPPROPNAME_DATABASE             TEXT("DATABASE")
00028 #define ISETUPPROPNAME_OPERATION            TEXT("OPERATION")
00029 #define ISETUPPROPNAME_MINIMUM_MSI          TEXT("MINIMUM_MSI")
00030 #define ISETUPPROPNAME_UPDATELOCATION       TEXT("UPDATELOCATION")
00031 #define ISETUPPROPNAME_UPDATE               TEXT("UPDATE")
00032 #define ISETUPPROPNAME_PRODUCTNAME          TEXT("PRODUCTNAME")
00033 #define ISETUPPROPNAME_PROPERTIES           TEXT("PROPERTIES")
00034 #define ISETUPPROPNAME_PATCH                TEXT("PATCH")
00035
00036 /*--------------------------------------------------------------------------
00037  *
00038  * Common Prototypes
00039  *
00040  ---------------------------------------------------------------------------*/
00041 UINT LoadResourceString(HINSTANCE hInst, LPCSTR lpType, LPCSTR lpName, LPSTR lpBuf, DWORD *pdwBufSize);
00042 UINT SetupLoadResourceString(HINSTANCE hInst, LPCSTR lpName, LPSTR *lppBuf, DWORD dwBufSize);
00043
00044 #endif //__COMMON_H_5F90F583_B9A4_4A8F_91BC_618DE6696231_
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cdialog.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cdialog.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CDIALOG.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CDIALOG_H_
00012 #define _CDIALOG_H_
00013
00014
00015
00016 /////////////////////////////////////////////////////////////////////
00017 // Forwards
00018 //
00019 /////////////////////////////////////////////////////////////////////
00020 class CMainWindow;
00021 class CEnumerator;
00022 class CRowset;
00023
00024
00025 /////////////////////////////////////////////////////////////////////
00026 // Includes
00027 //
00028 /////////////////////////////////////////////////////////////////////
00029 #include "CDialogLite.h"
00030 #include "Error.h"
00031 #include "CEnum.h"
00032 #include "List.h"
00033 #include "CTrace.h"
00034
00035
00036 /////////////////////////////////////////////////////////////////
00037 // Defines
00038 //
00039 /////////////////////////////////////////////////////////////////
00040 #define MAX_RESTRICTIONS     7
00041 #define MAX_RECENTCONFIGS   10
00042 #define MAX_RECENTFILES     10
00043
00044 typedef struct _SCHEMAINFO
00045 {
00046   //Schema
00047   WCHAR*    pwszSchemaName;
00048   const GUID* pguidSchema;
00049
00050   //Restrictions
00051   ULONG   cRestrictions;
00052   struct
00053   {
00054     ULONG   iNode;
00055     WCHAR*  pwszName;
00056     DBTYPE  wType;
00057   } rgResInfo[MAX_RESTRICTIONS];
00058
00059 } SCHEMAINFO;
00060
00061
00062 /////////////////////////////////////////////////////////////////////
00063 // Globals
00064 //
00065 /////////////////////////////////////////////////////////////////////
00066 WCHAR*    GetSchemaName(REFGUID guidSchema);
00067
00068
00069 /////////////////////////////////////////////////////////////////////
00070 // CComboBoxGuid
00071 //
00072 /////////////////////////////////////////////////////////////////////
00073 class CComboBoxGuid : public CComboBoxLite
00074 {
00075 public:
00076   //constructors
00077   CComboBoxGuid();
00078   virtual ~CComboBoxGuid();
00079
00080   //Overloads
00081   virtual BOOL    Populate(ULONG cGuidMaps, const WIDEGUIDMAP* rgGuidMaps);
00082
00083   //Messages
00084
00085   //Helpers
00086   virtual INDEX   SetGuid(REFIID riid);
00087   virtual REFIID    GetGuid();
00088
00089 //protected:
00090   //data
00091   ULONG       m_cGuidMaps;
00092   const WIDEGUIDMAP*  m_rgGuidMaps;
00093 };
00094
00095
00096
00097 /////////////////////////////////////////////////////////////////////
00098 // CComboBoxString
00099 //
00100 /////////////////////////////////////////////////////////////////////
00101 class CComboBoxString : public CComboBoxLite
00102 {
00103 public:
00104   //constructors
00105   CComboBoxString();
00106   virtual ~CComboBoxString();
00107
00108   //Overloads
00109   virtual BOOL    OnInitialUpdate();
00110   virtual WCHAR*    GetSelText();
00111
00112 //protected:
00113   //data
00114 };
00115
00116
00117 /////////////////////////////////////////////////////////////////////
00118 // CInterfaceDlg
00119 //
00120 /////////////////////////////////////////////////////////////////////
00121 class CInterfaceDlg : public CDialogLite
00122 {
00123 public:
00124   //constructors
00125   CInterfaceDlg(UINT nID, WCHAR* pwszTitle, REFIID riid);
00126   virtual ~CInterfaceDlg();
00127
00128   //Messages
00129   virtual BOOL    OnInitDialog();
00130   virtual BOOL    OnOK();
00131   virtual BOOL    OnCommand(UINT iID, HWND hWndCtrl);
00132   virtual BOOL    OnUpdate();
00133
00134   //Helpers
00135   virtual BOOL    OnAggregation();
00136
00137   //Interface
00138   virtual REFIID    GetSelInterface()       { return m_iid;           }
00139   virtual CAggregate* GetAggregate()          { return m_pCAggregate;       }
00140
00141   //Helpers
00142   virtual IUnknown**  ppUnknown()           {   return m_ppIUnknown;        }
00143   virtual IUnknown* pUnknown()            {   return m_pIUnknown;         }
00144
00145   //Defaults
00146   BOOL        m_fAggregation;
00147   BOOL        m_fOutput;
00148
00149 protected:
00150   //Title
00151   WCHAR*        m_pwszTitle;
00152
00153   //Aggregation
00154   CAggregate*     m_pCAggregate;
00155
00156   //riid
00157   IID         m_iid;
00158
00159   //Output (ppIUnknown)
00160   IUnknown*     m_pIUnknown;
00161   IUnknown**      m_ppIUnknown;
00162
00163   //Controls
00164   CComboBoxGuid   m_CComboInterface;
00165 };
00166
00167
00168
00169 /////////////////////////////////////////////////////////////////////
00170 // CEditValueDlg
00171 //
00172 /////////////////////////////////////////////////////////////////////
00173 class CEditValueDlg : public CDialogLite
00174 {
00175 public:
00176   //constructors
00177   CEditValueDlg(UINT nID, WCHAR* pwszTitle);
00178   virtual ~CEditValueDlg();
00179
00180   //Messages
00181   virtual BOOL    OnInitDialog();
00182   virtual BOOL    OnOK();
00183
00184   //Interface
00185   virtual void    SetValue(WCHAR* pwszValue)  { SAFE_FREE(m_pwszValue); m_pwszValue = wcsDuplicate(pwszValue);  }
00186   virtual WCHAR*    GetValue()          { return m_pwszValue;     }
00187   virtual void    SetReqType(DBTYPE wType)  { m_wReqType = wType;     }
00188
00189   //Conversion Routines
00190   virtual HRESULT   SetVariant(VARIANT* pVariant);
00191   virtual HRESULT   GetVariant(DBTYPE wType, VARIANT* pVariant);
00192
00193 protected:
00194   //Title
00195   WCHAR*        m_pwszTitle;
00196
00197   //String
00198   WCHAR*        m_pwszValue;
00199   DBTYPE        m_wReqType;
00200
00201   //Controls
00202   CRichEditLite   m_editValue;
00203 };
00204
00205
00206
00207 /////////////////////////////////////////////////////////////////////////////
00208 // CRowsetViewerDlg
00209 //
00210 /////////////////////////////////////////////////////////////////////////////
00211 class CRowsetViewerDlg
00212 {
00213 public:
00214   //Constructors
00215   CRowsetViewerDlg(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00216
00217   //Helpers
00218   virtual COptionsSheet*  GetOptions();
00219
00220 //protected:
00221   //Data
00222   CMainWindow*      m_pCMainWindow;
00223   CMDIChild*        m_pCMDIChild;
00224 };
00225
00226
00227 /////////////////////////////////////////////////////////////////////
00228 // CPropertiesDlg
00229 //
00230 /////////////////////////////////////////////////////////////////////
00231 class CPropertiesDlg : public CDialogLite, public CRowsetViewerDlg
00232 {
00233 public:
00234   //constructors
00235   CPropertiesDlg(CMainWindow* pCMainWindow);
00236   virtual ~CPropertiesDlg();
00237
00238   //members
00239   virtual BOOL    OnInitDialog();
00240   virtual BOOL    OnOK();
00241   virtual BOOL    OnCancel();
00242
00243   //messages
00244   virtual BOOL    OnCommand(UINT iID, HWND hWndCtrl);
00245   virtual BOOL    OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl);
00246   virtual BOOL    OnNotify(INT idCtrl, NMHDR* pNMHDR);
00247   virtual BOOL    OnSelChange(INT iID, HWND hWndCtrl);
00248
00249   //overrides
00250   virtual BOOL    OnPropValueChange();
00251   virtual BOOL    OnPropSetChange();
00252   virtual BOOL    OnPropOptionsChange();
00253   virtual BOOL    OnPropTypeChange();
00254
00255   virtual void    OnAddDefinedProperties();
00256   virtual void    OnClearAll();
00257
00258   //Properties
00259   HRESULT       SetProperties(HWND hWndParent,    const GUID* pGuidPropertySet, REFIID riidProp, IUnknown* pIUnkProperties, IDBProperties* pIDBPropertyInfo, CPropSets* pCPropSets = NULL, IDBDataSourceAdmin* pIDBDataSourceAdmin = NULL);
00260   HRESULT       GetProperties(HWND hWndParent,    const GUID* pGuidPropertySet, REFIID riidProp, IUnknown* pIUnkProperties, IDBProperties* pIDBPropertyInfo, CPropSets* pCPropSets = NULL, IDBDataSourceAdmin* pIDBDataSourceAdmin = NULL);
00261   HRESULT       GetPropertyInfo(HWND hWndParent,  const GUID* pGuidPropertySet, REFIID riidProp, IDBProperties* pIDBPropertyInfo, IDBDataSourceAdmin* pIDBDataSourceAdmin = NULL);
00262
00263   //Helpers
00264   DBPROPINFO*     GetSelPropInfo(INDEX iSelRow, DBPROPINFOSET** ppPropInfoSet = NULL);
00265   HRESULT       DisplayProperties(ULONG cPropertyIDSets, DBPROPIDSET* rgPropertyIDSets);
00266   HRESULT       DisplayProperty(INDEX iItem, DBPROP* pProp, DBPROPINFO* pPropInfo, REFGUID guidPropertySet, LPARAM lParam = 0);
00267
00268   //Helpers
00269   HRESULT       SetProperties(ULONG cPropSets, DBPROPSET* rgPropSets);
00270   HRESULT       GetProperties(ULONG cPropertyIDSets, DBPROPIDSET* rgPropertyIDSets, ULONG* pcPropSets, DBPROPSET** prgPropSets);
00271   HRESULT       GetPropertyInfo(ULONG cPropertyIDSets, DBPROPIDSET* rgPropertyIDSets, ULONG* pcPropInfoSets, DBPROPINFOSET** prgPropInfoSets, WCHAR** ppStringBuffer);
00272
00273   //Data
00274   IID         m_iidProp;
00275   const GUID*     m_pGuidPropertySet;
00276
00277   IUnknown*     m_pIUnkProperties;
00278   IDBProperties*    m_pIDBPropertyInfo;
00279   IDBDataSourceAdmin* m_pIDBDataSourceAdmin;
00280
00281   CPropSets*      m_pCPropSets;
00282
00283   //Controls
00284   CListViewLite   m_listviewProps;
00285   CComboBoxLite   m_comboPropSet;
00286   CComboBoxLite   m_comboOptions;
00287   CComboBoxLite   m_comboType;
00288   CComboBoxLite   m_comboValue;
00289   CEditBoxLite    m_editDesc;
00290
00291   //Saved State
00292   ULONG       m_cPropInfoSets;
00293   DBPROPINFOSET*    m_rgPropInfoSets;
00294   WCHAR*        m_pStringBuffer;
00295   BOOL        m_bClearAll;
00296
00297   //Method Type...
00298   enum METHOD_TYPE
00299   {
00300     METHOD_SETPROPERTIES,
00301     METHOD_GETPROPERTIES,
00302     METHOD_GETPROPERTYINFO
00303   };
00304
00305   METHOD_TYPE     m_eMethodType;
00306 };
00307
00308
00309 /////////////////////////////////////////////////////////////////////////////
00310 // CFullConnectProvider
00311 //
00312 /////////////////////////////////////////////////////////////////////////////
00313 class CFullConnectProvider : public CPropPageLite
00314 {
00315 public:
00316   CFullConnectProvider();
00317
00318   //Messages
00319   virtual BOOL  OnInitDialog();
00320   virtual BOOL  OnApply();
00321   virtual BOOL  OnSetActive();
00322   virtual BOOL  OnKillActive();
00323   virtual BOOL  OnCommand(UINT iID, HWND hWndCtrl);
00324   virtual BOOL  OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl);
00325
00326   //Overloads
00327   virtual BOOL  OnSelChange(INT iID, HWND hWndCtrl);
00328   virtual BOOL  OnDropDown(INT iID, HWND hWndCtrl);
00329
00330   //Provider
00331   virtual HRESULT GetProviderName();
00332   virtual BOOL  RefreshProvider();
00333   virtual BOOL  RefreshEnum(BOOL fReconnect = FALSE);
00334   virtual BOOL  UpdateProvider();
00335
00336   //Provider Page
00337   WCHAR     m_wszLocation[MAX_NAME_LEN+1];    // DBPROP_INIT_LOCATION
00338   WCHAR     m_wszDataSource[MAX_NAME_LEN+1];  // DBPROP_INIT_DATASOURCE
00339   WCHAR     m_wszUserID[MAX_NAME_LEN+1];    // DBPROP_AUTH_USERID
00340   WCHAR     m_wszPassword[MAX_NAME_LEN+1];    // DBPROP_AUTH_PASSWORD
00341   LONG      m_dwPromptProp;
00342   HWND      m_hWndProp;
00343
00344   //Controls
00345   CComboBoxLite m_comboConfig;
00346   CComboBoxEx   m_comboProvider;
00347 };
00348
00349
00350 /////////////////////////////////////////////////////////////////////////////
00351 // CFullConnectProperties
00352 //
00353 /////////////////////////////////////////////////////////////////////////////
00354 class CFullConnectProperties : public CPropPageLite
00355 {
00356 public:
00357   CFullConnectProperties();
00358
00359   //Messages
00360   virtual BOOL OnInitDialog();
00361   virtual BOOL OnSetActive();
00362   virtual BOOL OnKillActive();
00363   virtual BOOL OnCommand(UINT iID, HWND hWndCtrl);
00364
00365   //Properties
00366   virtual BOOL RefreshProperties();
00367   virtual BOOL UpdateProperties();
00368
00369   //Properties Page
00370   WCHAR     m_wszProvString[MAX_NAME_LEN+1];  // DBPROP_INIT_PROVIDERSTRING
00371   WCHAR     m_wszCatalog[MAX_NAME_LEN+1];   // DBPROP_INIT_CATALOG
00372   LCID      m_dwlcidProp;
00373   LONG      m_dwAsynchProp;
00374   LONG      m_dwTimeoutProp;
00375   LONG      m_dwModeProp;
00376 };
00377
00378
00379 /////////////////////////////////////////////////////////////////////////////
00380 // CFullConnectSecurity
00381 //
00382 /////////////////////////////////////////////////////////////////////////////
00383 class CFullConnectSecurity : public CPropPageLite
00384 {
00385 public:
00386   CFullConnectSecurity();
00387
00388   //Security
00389   virtual BOOL  RefreshSecurity();
00390   virtual BOOL  UpdateSecurity();
00391
00392   //Messages
00393   virtual BOOL  OnInitDialog();
00394   virtual BOOL  OnSetActive();
00395   virtual BOOL  OnKillActive();
00396   virtual BOOL  OnCommand(UINT iID, HWND hWndCtrl);
00397
00398   //Security Page
00399   LONG      m_dwProtectionProp;
00400   LONG      m_dwImpersonateProp;
00401   VARIANT_BOOL  m_dwMaskPasswordProp;
00402   VARIANT_BOOL  m_dwEncryptPasswordProp;
00403   VARIANT_BOOL  m_dwCacheProp;
00404   VARIANT_BOOL  m_dwPersistProp;
00405   VARIANT_BOOL  m_dwPersistEncryptProp;
00406   WCHAR     m_wszIntegrated[MAX_NAME_LEN+1];  // DBPROP_INIT_INTEGRATED
00407 };
00408
00409
00410 /////////////////////////////////////////////////////////////////////////////
00411 // CFullConnectOptions
00412 //
00413 /////////////////////////////////////////////////////////////////////////////
00414 class CFullConnectOptions : public CPropPageLite
00415 {
00416 public:
00417   CFullConnectOptions();
00418
00419   //Options
00420   virtual BOOL  RefreshOptions();
00421   virtual BOOL  UpdateOptions();
00422
00423   //Messages
00424   virtual BOOL  OnInitDialog();
00425   virtual BOOL  OnSetActive();
00426   virtual BOOL  OnKillActive();
00427   virtual BOOL  OnCommand(UINT iID, HWND hWndCtrl);
00428
00429   //Options Page
00430   DWORD     m_dwCLSCTX;
00431   WCHAR     m_wszRemoteServer[MAX_NAME_LEN+1];
00432   DWORD     m_dwConnectOpts;
00433 };
00434
00435
00436 //////////////////////////////////////////////////////////////////////////
00437 // CFullConnect
00438 //
00439 //////////////////////////////////////////////////////////////////////////
00440 class CFullConnect : public CPropSheetLite, public CRowsetViewerDlg
00441 {
00442 public:
00443   //Constructors
00444   CFullConnect(CMainWindow* pCMainWindow);
00445   virtual ~CFullConnect();
00446
00447   //Helpers
00448   virtual BOOL      LoadDefaults();
00449   virtual BOOL      ResetDefaults();
00450   virtual BOOL      SaveDefaults();
00451   virtual INT_PTR     Display(HWND hWndParent, CEnumerator* pCEnumerator = NULL, ENUMINFO* pEnumInfo = NULL);
00452
00453   //Recent Config
00454   virtual BOOL      LoadRecentConfig(ULONG iRecentConfig);
00455   virtual BOOL      AddRecentConfig(WCHAR* pwszConfigName = NULL);
00456   virtual BOOL      RemoveRecentConfig(WCHAR* pwszConfigName);
00457   CList<WCHAR*, WCHAR*> m_listConfigs;
00458
00459   //Recent Files
00460   virtual BOOL      LoadRecentFile(ULONG iRecentFile);
00461   virtual BOOL      AddRecentFile(WCHAR* pwszFileName);
00462   virtual BOOL      RemoveRecentFile(WCHAR* pwszFileName);
00463   CList<WCHAR*, WCHAR*> m_listFiles;
00464
00465   //Enumerators
00466   virtual HRESULT     DisplayBrowseEnumInfo(HWND hWnd);
00467   static INT_PTR WINAPI BrowseEnumeratorProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
00468
00469   //Connection
00470   virtual HRESULT     InitPropCombo(HWND hWndCombo, ULONG cItems, const WIDENAMEMAP* rgNameMap, LPARAM lParam);
00471   virtual HRESULT     GetAdvProperties();
00472
00473   virtual HRESULT     CreateProviderInstance(REFIID riid, IUnknown** ppIUnknown, CBase** ppCSource = NULL);
00474   virtual HRESULT     GetPropSets();
00475   virtual HRESULT     FullConnect();
00476
00477 //protected:
00478   //Data
00479   CFullConnectProvider  m_CProvider;
00480   CFullConnectProperties  m_CProperties;
00481   CFullConnectSecurity  m_CSecurity;
00482   CFullConnectOptions   m_COptions;
00483   UINT          m_idSource;
00484
00485   //Enum
00486   CEnumerator*      m_pCEnumerator;
00487   ENUMINFO        m_EnumInfo;
00488
00489   //Properties
00490   CPropSets       m_CPropSets;
00491
00492   //Saved Configuration
00493   WCHAR         m_wszConfigName[MAX_NAME_LEN+1];
00494 };
00495
00496
00497
00498 /////////////////////////////////////////////////////////////////////
00499 // CInitStringBox
00500 //
00501 /////////////////////////////////////////////////////////////////////
00502 class CInitStringBox : public CRichEditLite
00503 {
00504 public:
00505   //constructors
00506
00507   //overrides
00508   virtual BOOL OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData)
00509   {
00510     switch(nVirtKey)
00511     {
00512       case VK_TAB:
00513       case VK_DOWN:
00514       {
00515         MSG msg;
00516         PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
00517         SendMessage(m_hWndParent, WM_COMMAND, GET_WM_COMMAND_MPS(IDB_BROWSE_PROVIDER, m_hWndParent, 0));
00518         return TRUE;
00519       }
00520
00521       default:
00522         break;
00523     };
00524
00525     return FALSE;
00526   }
00527 };
00528
00529
00530 /////////////////////////////////////////////////////////////////////
00531 // CDSLContextBox
00532 //
00533 /////////////////////////////////////////////////////////////////////
00534 class CDSLContextBox : public CListBoxLite
00535 {
00536 public:
00537   //constructors
00538
00539   //overrides
00540   virtual BOOL OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData)
00541   {
00542     switch(nVirtKey)
00543     {
00544       case VK_TAB:
00545       {
00546         MSG msg;
00547         PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
00548
00549         //Tab - ends dialog
00550         SendMessage(m_hWndParent, WM_COMMAND, GET_WM_COMMAND_MPS(IDOK, m_hWndParent, 0));
00551         return TRUE;
00552       }
00553
00554       default:
00555         break;
00556     };
00557
00558     return FALSE;
00559   }
00560 };
00561
00562
00563
00564 /////////////////////////////////////////////////////////////////////
00565 // CSchemaDlg
00566 //
00567 /////////////////////////////////////////////////////////////////////
00568 class CSchemaDlg : public CWndLite, public CRowsetViewerDlg
00569 {
00570 public:
00571   //constructors
00572   CSchemaDlg(CMDIChild* pCMDIChild);
00573   virtual ~CSchemaDlg();
00574
00575   //abstract members
00576   virtual INT_PTR     Display();
00577   static INT_PTR WINAPI SchemaRowsetProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
00578   static INT_PTR WINAPI SchemaTreeProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
00579
00580   //Schema
00581   virtual HRESULT   InitSchemas(HWND hWnd);
00582   virtual HRESULT   GetSelectedSchema(SCHEMAINFO** ppSchemaInfo, ULONG* pdwRestrictions = NULL);
00583   virtual HRESULT   GetSelectedRestrictions();
00584   virtual HRESULT   ChangeRestrictions();
00585   virtual HRESULT   InitSchemaCombo(BOOL fShowSupported);
00586
00587   //TreeView
00588   virtual HRESULT   InitTreeView(HWND hWnd);
00589   virtual HRESULT   DisplayTree();
00590   virtual HRESULT   RefreshTreeControls();
00591
00592   //Data
00593   HWND    m_hWndSchemas;
00594   HWND    m_hWndTreeWnd;
00595   HWND    m_hWndTreeView;
00596
00597   //Saved Dialog Values
00598   BOOL    m_fEditing;
00599   BOOL    m_fActive;
00600
00601   ULONG   m_cSchemas;
00602   GUID*   m_rgSchemas;
00603   ULONG*    m_rgRestrictionSupport;
00604
00605   SCHEMAINFO  m_SchemaInfo;
00606   INDEX   m_iSchemaIndex;
00607   INDEX   m_iOldSchemaIndex;
00608   CRowset*  m_pCTreeRowset;
00609
00610   ULONG   m_cRestrictions;
00611   VARIANT   m_rgRestrictions[MAX_RESTRICTIONS];
00612
00613   BOOL    m_fUseRestrictions;
00614   BOOL    m_fUseProperties;
00615   BOOL    m_fShowSupported;
00616
00617   //Properties
00618   CPropSets m_CPropSets;
00619
00620   //Restriction Controls
00621   CWndLite      m_rgResName[MAX_RESTRICTIONS];
00622   CComboBoxLite   m_rgResType[MAX_RESTRICTIONS];
00623   CComboBoxString   m_rgResValue[MAX_RESTRICTIONS];
00624
00625   //Schema Controls
00626   CComboBoxLite   m_comboSchema;
00627 };
00628
00629
00630
00631
00632
00633 /////////////////////////////////////////////////////////////////////
00634 // CMultipleResultsDlg
00635 //
00636 /////////////////////////////////////////////////////////////////////
00637 class CMultipleResultsDlg : public CInterfaceDlg, public CRowsetViewerDlg
00638 {
00639 public:
00640   //constructors
00641   CMultipleResultsDlg(CMDIChild* pCMDIChild);
00642   virtual ~CMultipleResultsDlg();
00643
00644   //Messages
00645   virtual BOOL    OnInitDialog();
00646   virtual BOOL    OnOK();
00647
00648   //Helpers
00649
00650 protected:
00651   //Controls
00652   CComboBoxLite   m_CComboReserved;
00653 };
00654
00655
00656 /////////////////////////////////////////////////////////////////////
00657 // CConstraintDlg
00658 //
00659 /////////////////////////////////////////////////////////////////////
00660 class CConstraintDlg : public CDialogLite, public CRowsetViewerDlg
00661 {
00662 public:
00663   //constructors
00664   CConstraintDlg(CMainWindow* pCMainWindow);
00665   virtual ~CConstraintDlg();
00666
00667   //members
00668   virtual BOOL    OnInitDialog();
00669   virtual BOOL    OnOK();
00670
00671   //messages
00672   virtual BOOL    OnCommand(UINT iID, HWND hWndCtrl);
00673
00674   //Methods that set constraint desc and table name
00675   HRESULT       SetConstraint(HWND hWndParent, DBCONSTRAINTDESC *pConsDesc) {
00676               return SetConstraintAndTable(hWndParent, pConsDesc, NULL);
00677   }
00678   HRESULT       SetConstraintAndTable(
00679               HWND        hWndParent,
00680               DBCONSTRAINTDESC  *pConsDesc,
00681               WCHAR       **ppwszTableName
00682             );
00683
00684   //Helpers
00685
00686   //Data
00687   DBCONSTRAINTDESC  *m_pConsDesc;
00688   WCHAR       **m_ppwszTableName;
00689
00690   //Controls
00691   CComboBoxLite   m_comboConstraintType;
00692   CListBoxLite    m_listDeferrability;
00693   CListBoxLite    m_listColumnList;
00694   CListBoxLite    m_listFKColumnList;
00695   CComboBoxLite   m_comboMatchType;
00696   CComboBoxLite   m_comboUpdateRule;
00697   CComboBoxLite   m_comboDeleteRule;
00698
00699   CEditBoxLite    m_editConstraintName;
00700   CEditBoxLite    m_editBaseTableName;
00701   CEditBoxLite    m_editReferencedTableName;
00702   CEditBoxLite    m_editConstraintText;
00703   CEditBoxLite    m_editColumnName;
00704   CEditBoxLite    m_editFKColumnName;
00705 }; //CConstraintDlg
00706
00707
00708 /////////////////////////////////////////////////////////////////////
00709 // CAlterIndexDlg
00710 //
00711 /////////////////////////////////////////////////////////////////////
00712 class CAlterIndexDlg : public CDialogLite, public CRowsetViewerDlg
00713 {
00714 public:
00715   //constructors
00716   CAlterIndexDlg(CMDIChild *pCMDIChild);
00717   virtual ~CAlterIndexDlg();
00718
00719   //members
00720   virtual BOOL    OnInitDialog();
00721   virtual BOOL    OnOK();
00722
00723   //messages
00724   virtual BOOL    OnCommand(UINT iID, HWND hWndCtrl);
00725
00726   //Methods that set constraint desc and table name
00727   HRESULT       AlterIndex(
00728               HWND        hWndParent,
00729               DBID        **ppTableID,
00730               DBID        **ppIndexID,
00731               DBID        **ppNewIndexID,
00732               BOOL        *pfUseIndexProps
00733             );
00734
00735   //Helpers
00736
00737   //Data
00738   DBID        **m_ppTableID;
00739   DBID        **m_ppIndexID;
00740   DBID        **m_ppNewIndexID;
00741   BOOL        *m_pfUseIndexProps;
00742   //Properties
00743   CPropSets m_CPropSets;
00744
00745   //Controls
00746   CEditBoxLite    m_editTableName;
00747   CEditBoxLite    m_editIndexName;
00748   CEditBoxLite    m_editNewIndexName;
00749 }; //CAlterIndexDlg
00750
00751
00752 /////////////////////////////////////////////////////////////////////
00753 // CAlterTableDlg
00754 //
00755 /////////////////////////////////////////////////////////////////////
00756 class CAlterTableDlg : public CDialogLite, public CRowsetViewerDlg
00757 {
00758   //Controls
00759   CEditBoxLite    m_editTableName;
00760   CEditBoxLite    m_editNewTableName;
00761
00762 public:
00763   //constructors
00764   CAlterTableDlg(CMDIChild *pCMDIChild);
00765   virtual ~CAlterTableDlg();
00766
00767   //members
00768   virtual BOOL    OnInitDialog();
00769   virtual BOOL    OnOK();
00770
00771   //messages
00772   virtual BOOL    OnCommand(UINT iID, HWND hWndCtrl);
00773
00774   //Methods that set constraint desc and table name
00775   HRESULT       AlterTable(HWND hWndParent);
00776
00777   //Helpers
00778
00779   //Data
00780   DBID        *m_pTableID;
00781   DBID        *m_pNewTableID;
00782   BOOL        m_fUseTableProps;
00783   //Properties
00784   CPropSets     m_CPropSets;
00785 }; //CAlterIndexDlg
00786
00787
00788 /////////////////////////////////////////////////////////////////////
00789 // CAlterColumnDlg
00790 //
00791 /////////////////////////////////////////////////////////////////////
00792 class CAlterColumnDlg : public CDialogLite, public CRowsetViewerDlg
00793 {
00794   //Controls
00795   CEditBoxLite    m_editTableName;
00796   CEditBoxLite    m_editColumnName;
00797
00798   CEditBoxLite    m_editNewColumnName;
00799   CEditBoxLite    m_editSize;
00800   CEditBoxLite    m_editPrecision;
00801   CEditBoxLite    m_editScale;
00802
00803   CListBoxLite    m_listColumnDescFlags;
00804
00805   CComboBoxLite   m_comboDBType;
00806   CComboBoxLite   m_comboTypeName;
00807
00808 public:
00809   //constructors
00810   CAlterColumnDlg(CMDIChild *pCMDIChild);
00811   virtual ~CAlterColumnDlg();
00812
00813   //members
00814   virtual BOOL    OnInitDialog();
00815   virtual BOOL    OnOK();
00816
00817   //messages
00818   virtual BOOL    OnCommand(UINT iID, HWND hWndCtrl);
00819   virtual BOOL    OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl);
00820   virtual BOOL    OnSelChange(INT iID, HWND hWndCtrl);
00821
00822   //Methods that set constraint desc and table name
00823   HRESULT       AlterColumn(HWND hWndParent);
00824
00825   //Helpers
00826
00827   //Data
00828   DBID        *m_pTableID;
00829   DBID        *m_pColumnID;
00830   BOOL        m_fUseColProps;
00831   DBCOLUMNDESC    m_ColDesc;
00832   DBCOLUMNDESCFLAGS   m_dwColFlags;
00833   //Properties
00834   CPropSets     m_CPropSets;
00835 }; //CAlterColumnDlg
00836
00837
00838 /////////////////////////////////////////////////////////////////////////////
00839 // CExecuteParamDlg
00840 //
00841 /////////////////////////////////////////////////////////////////////////////
00842 class CExecuteParamDlg : public CDialogLite, public CRowsetViewerDlg
00843 {
00844 public:
00845   //Constructors
00846   CExecuteParamDlg(CMDIChild* pCMDIChild);
00847
00848   //Messages
00849   virtual BOOL OnInitDialog();
00850   virtual BOOL OnOK();
00851   virtual BOOL OnCancel();
00852
00853   //Overloads
00854   virtual BOOL OnCommand(UINT iID, HWND hWndCtrl);
00855   virtual BOOL OnNotify(INT idCtrl, NMHDR* pNMHDR);
00856   virtual BOOL OnContextMenu(HWND hWnd, REFPOINTS pts);
00857
00858   //Helpers
00859   virtual BOOL OnAddParameter();
00860   virtual BOOL OnDelParameter();
00861   virtual BOOL OnAddSet(INDEX iParamSet, BOOL fUseDefaults = TRUE);
00862   virtual BOOL OnDelSet(INDEX iParamSet);
00863   virtual BOOL OnStatusChange(DBSTATUS dbStatus);
00864
00865   //Helpers
00866   CListViewLite*    GetActiveParam();
00867   CListViewLite*    GetActiveValue();
00868
00869 protected:
00870   //data
00871   CTabLite                m_tabParamSets;
00872   CVector<CListViewLite*, ULONG_PTR>    m_vecParams;
00873   CVector<CListViewLite*, ULONG_PTR>    m_vecValues;
00874 };
00875
00876
00877
00878 #endif  //_CDIALOG_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/NoWarn.h Source File

  • NetDS
  • WinSock
  • Dt_Dll

NoWarn.h

Go to the documentation of this file.
00001 /*++
00002
00003     Copyright (c) 1995 Intel Corporation
00004
00005 Module Name:
00006
00007     nowarn.h
00008
00009 Abstract:
00010
00011     This header contains pragmas to turn off compiler warnings that
00012     may be safely ignored.
00013
00014 --*/
00015
00016
00017 /* nonstandard extension 'single line comment' was used */
00018 #pragma warning(disable: 4001)
00019
00020 // argument differs in indirection to slightly different base types
00021 #pragma warning(disable: 4057)
00022
00023 // unreferenced formal parameter
00024 #pragma warning(disable: 4100)
00025
00026 // named type definition in parentheses
00027 #pragma warning(disable: 4115)
00028
00029 // nonstandard extension used : nameless struct/union
00030 #pragma warning(disable: 4201)
00031
00032 // nonstandard extension used : benign typedef redefinition
00033 #pragma warning(disable: 4209)
00034
00035 // nonstandard extension used : bit field types other than int
00036 #pragma warning(disable: 4214)
00037
00038 // unreferenced inline function has been removed
00039 #pragma warning(disable: 4514)
00040
00041 // Note: Creating precompiled header
00042 #pragma warning(disable: 4699)
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSimpleSite Member List

This is the complete list of members for CSimpleSite, including all inherited members.
CloseOleObject(void) | CSimpleSite |
CloseOleObject(void) | CSimpleSite |
Create(CSimpleDoc FAR *lpDoc) | CSimpleSite | [static]
Create(CSimpleDoc FAR *lpDoc) | CSimpleSite | [static]
CSafeRefCount() | CSafeRefCount |
CSimpleSite(CSimpleDoc FAR *lpDoc) | CSimpleSite |
CSimpleSite(CSimpleDoc FAR *lpDoc) | CSimpleSite |
DecrementNestCount() | CSafeRefCount |
GetObjRect(LPRECT lpRect) | CSimpleSite |
GetObjRect(LPRECT lpRect) | CSimpleSite |
IncrementNestCount() | CSafeRefCount |
InitObject(BOOL fCreateNew) | CSimpleSite |
InitObject(BOOL fCreateNew) | CSimpleSite |
m_AdviseSink | CSimpleSite |
m_dwConnection | CSimpleSite |
m_dwDrawAspect | CSimpleSite |
m_fInPlaceActive | CSimpleSite |
m_fObjectOpen | CSimpleSite |
m_hwndIPObj | CSimpleSite |
m_lpDoc | CSimpleSite |
m_lpInPlaceObject | CSimpleSite |
m_lpObjStorage | CSimpleSite |
m_lpOleObject | CSimpleSite |
m_nCount | CSimpleSite |
m_OleClientSite | CSimpleSite |
m_OleInPlaceSite | CSimpleSite |
m_sizel | CSimpleSite |
PaintObj(HDC hDC) | CSimpleSite |
PaintObj(HDC hDC) | CSimpleSite |
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CSimpleSite |
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CSimpleSite |
SafeAddRef() | CSafeRefCount |
SafeRelease() | CSafeRefCount |
STDMETHODIMP_(ULONG) AddRef() | CSimpleSite |
STDMETHODIMP_(ULONG) Release() | CSimpleSite |
STDMETHODIMP_(ULONG) AddRef() | CSimpleSite |
STDMETHODIMP_(ULONG) Release() | CSimpleSite |
UnloadOleObject(void) | CSimpleSite |
UnloadOleObject(void) | CSimpleSite |
~CSafeRefCount() | CSafeRefCount | [virtual]
~CSimpleSite() | CSimpleSite |
~CSimpleSite() | CSimpleSite |
Generated on Wed Nov 13 2024 16:57:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_APPMEM_DATA_HEADER Member List

This is the complete list of members for _APPMEM_DATA_HEADER, including all inherited members.
dwFirstFreeOffset | _APPMEM_DATA_HEADER
dwFirstInUseOffset | _APPMEM_DATA_HEADER
dwInstanceCount | _APPMEM_DATA_HEADER
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMyStartupListener Member List

This is the complete list of members for CMyStartupListener, including all inherited members.
CMyStartupListener(void) | CMyStartupListener | [protected]
Initialize(IUnknown *punkCallbackIn, LCID lcidIn) | CMyStartupListener |
m_lcid | CMyStartupListener | [private]
m_piccCallback | CMyStartupListener | [private]
Notify(IUnknown *punkIn) | CMyStartupListener |
~CMyStartupListener(void) | CMyStartupListener | [protected]
Generated on Wed Nov 13 2024 16:56:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Instance_Provider/Include/Globals.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Instance_Provider
  • Include

Globals.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   Globals.h
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #ifndef _Globals_H
00017 #define _Globals_H
00018
00019 /******************************************************************************
00020  *
00021  *  Name: Provider_Globals
00022  *
00023  *
00024  *  Description:
00025  *
00026  *    class encapsulates global helper functions.
00027  *    Add extra user code here.
00028  *
00029  *****************************************************************************/
00030
00031 class Provider_Globals
00032 {
00033 public:
00034
00035 // Public Static Variables.
00036
00037   static LONG s_LocksInProgress ;
00038   static LONG s_ObjectsInProgress ;
00039
00040 public:
00041
00042 // Public Functions
00043
00044   static HRESULT Global_Startup () ;
00045   static HRESULT Global_Shutdown () ;
00046
00047   static HRESULT CreateInstance (
00048
00049     const CLSID &a_ReferenceClsid ,
00050     LPUNKNOWN a_OuterUnknown ,
00051     const DWORD &a_ClassContext ,
00052     const UUID &a_ReferenceInterfaceId ,
00053     void **a_ObjectInterface
00054   );
00055 } ;
00056
00057 #endif // _Globals_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step1/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step1

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/CodePage.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

CodePage.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:   codepage.hxx
00006 //
00007 //  Contents:   Locale to codepage
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011 #include <pch.cxx>
00012 #pragma hdrstop
00013
00014 #include <osv.hxx>
00015 #include <codepage.hxx>
00016
00017 //+---------------------------------------------------------------------------
00018 //
00019 //  Function:   LocaleToCodepage
00020 //
00021 //  Purpose:    Returns a codepage from a locale
00022 //
00023 //  Arguments:  [lcid]  --  Locale
00024 //
00025 //  History:    08-Jul-96   SitaramR    Created
00026 //
00027 //----------------------------------------------------------------------------
00028
00029 ULONG LocaleToCodepage( LCID lcid )
00030 {
00031     const BUFFER_LENGTH = 10;
00032     WCHAR wcsCodePage[BUFFER_LENGTH];
00033     int cwc;
00034
00035     if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00036     {
00037         cwc = GetLocaleInfoW( lcid, LOCALE_IDEFAULTANSICODEPAGE, wcsCodePage, BUFFER_LENGTH );
00038     }
00039     else // win95
00040     {
00041         char *pszCodePage = new char[BUFFER_LENGTH*2];
00042
00043         if ( pszCodePage == NULL )
00044         {
00045             cwc = 0;
00046             SetLastErrorEx( ERROR_INVALID_PARAMETER, SLE_ERROR );
00047         }
00048         else
00049         {
00050             cwc = GetLocaleInfoA( lcid,
00051                                   LOCALE_IDEFAULTANSICODEPAGE,
00052                                   pszCodePage,
00053                                   BUFFER_LENGTH );
00054
00055             if ( cwc && mbstowcs( wcsCodePage, pszCodePage, cwc ) == -1 )
00056             {
00057                 cwc = 0;
00058                 SetLastErrorEx( ERROR_INVALID_PARAMETER, SLE_ERROR );
00059             }
00060
00061             delete [] pszCodePage;
00062             pszCodePage = NULL;
00063         }
00064     }
00065
00066     //
00067     // If error, return Ansi code page
00068     //
00069     if ( cwc == 0 )
00070     {
00071          htmlDebugOut(( DEB_ERROR, "GetLocaleInfoW for lcid %d returned %d\n", lcid, GetLastError() ));
00072
00073          return CP_ACP;
00074     }
00075
00076     return wcstoul( wcsCodePage, 0 , 10 );
00077 }
00078
00079
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/StreamTypeEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

StreamTypeEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: StreamTypeEnum
00019
00020 public class StreamTypeEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adTypeBinary = 1;
00023   public static final short adTypeText = 2;
00024 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_filehdr Member List

This is the complete list of members for tag_filehdr, including all inherited members.
wDivision | tag_filehdr
wFormat | tag_filehdr
wTracks | tag_filehdr
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Command Member List

This is the complete list of members for msado15::Command, including all inherited members.
Cancel() | msado15::Command |
clsid | msado15::Command | [static]
CreateParameter(String Name, int Type, int Direction, int Size, Variant Value) | msado15::Command |
Execute(Variant RecordsAffected, Variant Parameters, int Options) | msado15::Command |
getActiveConnection() | msado15::Command |
getCommandText() | msado15::Command |
getCommandTimeout() | msado15::Command |
getCommandType() | msado15::Command |
getName() | msado15::Command |
getParameters() | msado15::Command |
getPrepared() | msado15::Command |
getProperties() | msado15::Command |
getState() | msado15::Command |
iid | msado15::Command | [static]
setActiveConnection(msado15._Connection ppvObject) | msado15::Command |
setActiveConnection(Variant ppvObject) | msado15::Command |
setCommandText(String pbstr) | msado15::Command |
setCommandTimeout(int pl) | msado15::Command |
setCommandType(int plCmdType) | msado15::Command |
setName(String pbstrName) | msado15::Command |
setPrepared(boolean pfPrepared) | msado15::Command |
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminActivationOptions.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminActivationOptions.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminActivationOptions
00019
00020 public interface COMAdminActivationOptions
00021 {
00022   public static final int COMAdminActivationInproc = 0;
00023   public static final int COMAdminActivationLocal = 1;
00024 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Client/BYOTTransaction/BYOTtransObj.h Source File

  • Com
  • Services
  • BYOT
  • Client
  • BYOTTransaction

BYOTtransObj.h

Go to the documentation of this file.
00001 // ByotTransObj.h : Declaration of the CByotTransObj
00002
00003 #ifndef __BYOTTRANSOBJ_H_
00004 #define __BYOTTRANSOBJ_H_
00005
00006 #include "resource.h"       // main symbols
00007
00008 extern CRITICAL_SECTION g_cs;
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CByotTransObj
00012 class ATL_NO_VTABLE CByotTransObj :
00013   public CComObjectRootEx<CComMultiThreadModel>,
00014   public CComCoClass<CByotTransObj, &CLSID_ByotTransObj>,
00015   public ISupportErrorInfo,
00016   public IDispatchImpl<IByotTransaction, &IID_IByotTransaction, &LIBID_BYOTTRANSACTIONLib>
00017 {
00018 public:
00019   CByotTransObj()
00020   {
00021   }
00022
00023
00024 DECLARE_REGISTRY_RESOURCEID(IDR_BYOTTRANSOBJ)
00025
00026 DECLARE_PROTECT_FINAL_CONSTRUCT()
00027
00028 BEGIN_COM_MAP(CByotTransObj)
00029   COM_INTERFACE_ENTRY(IByotTransaction)
00030   COM_INTERFACE_ENTRY(IDispatch)
00031   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00032 END_COM_MAP()
00033
00034 // ISupportsErrorInfo
00035   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00036
00037 // IByotTransaction
00038 public:
00039   STDMETHOD(get_TipURL)(/*[out, retval]*/ BSTR *pVal);
00040   STDMETHOD(AbortTransaction)();
00041   STDMETHOD(CommitTransaction)();
00042   STDMETHOD(BeginTransaction)();
00043
00044 protected:
00045
00046 };
00047
00048 #endif //__BYOTTRANSOBJ_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/dlldata.c Source File

  • NetDS
  • upnp
  • StepByStep
  • Step2

dlldata.c

Go to the documentation of this file.
00001 /*********************************************************
00002    DllData file -- generated by MIDL compiler
00003
00004         DO NOT ALTER THIS FILE
00005
00006    This file is regenerated by MIDL on every IDL file compile.
00007
00008    To completely reconstruct this file, delete it and rerun MIDL
00009    on all the IDL files in this DLL, specifying this file for the
00010    /dlldata command line option
00011
00012 *********************************************************/
00013
00014
00015 #include <rpcproxy.h>
00016
00017 #ifdef __cplusplus
00018 extern "C"   {
00019 #endif
00020
00021 EXTERN_PROXY_FILE( upnphost )
00022
00023
00024 PROXYFILE_LIST_START
00025 /* Start of list */
00026   REFERENCE_PROXY_FILE( upnphost ),
00027 /* End of list */
00028 PROXYFILE_LIST_END
00029
00030
00031 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00032
00033 #ifdef __cplusplus
00034 }  /*extern "C" */
00035 #endif
00036
00037 /* end of generated dlldata file */
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/SDKSamplePlaylistPlugin.idl Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

SDKSamplePlaylistPlugin.idl

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            SDKSamplePlaylistPlugin.idl
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 // This file will be processed by the MIDL tool to
00013 // produce the type library (SDKSamplePlaylistPlugin.tlb) and marshalling code.
00014
00015 cpp_quote("//*****************************************************************************")
00016 cpp_quote("//")
00017 cpp_quote("//  Microsoft Windows Media")
00018 cpp_quote("//  Copyright (C) Microsoft Corporation. All rights reserved.")
00019 cpp_quote("//")
00020 cpp_quote("//  Automatically generated by Midl from SDKSamplePlaylistPlugin.idl")
00021 cpp_quote("//")
00022 cpp_quote("//  DO NOT EDIT THIS FILE.")
00023 cpp_quote("//")
00024 cpp_quote("//*****************************************************************************")
00025
00026 import "oaidl.idl";
00027 import "wmsplaylistparser.idl";
00028
00029 [
00030     uuid(F297F477-6FE2-4260-BE52-5F0CD960C780),
00031     version(9.0),
00032     helpstring("SDKSamplePlaylistPlugin 9.0 Type Library")
00033 ]
00034 library SDKSAMPLEPLAYLISTPLUGINLib
00035 {
00036     importlib("stdole32.tlb");
00037     importlib("stdole2.tlb");
00038
00039     [
00040         uuid(15D0B1CE-E2C1-40E0-B705-219FD74F4375),
00041         helpstring("SDKSamplePlaylistParser Class")
00042     ]
00043     coclass SDKSamplePlaylistParser
00044     {
00045         [default] interface IWMSPlaylistParserPlugin;
00046     };
00047 };
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DNS/DNSQuery/DNSQuery.Cpp Source File

  • NetDS
  • DNS
  • DNSQuery

DNSQuery.Cpp

Go to the documentation of this file.
00001 /************************************************************\
00002     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005     PARTICULAR PURPOSE.
00006
00007   Copyright © 2000  Microsoft Corporation.  All Rights Reserved.
00008
00009 /***************************************************************/
00010
00011
00012 /*
00013    FILE:          Dnsquery.cpp
00014    DESCRIPTION:   This sample illustrates the use of DnsQuery() function to send query to
00015                   a DNS server to resolve the host name to an IP address and vice-versa.
00016
00017    PLATFORM:      Windows 2000
00018    WRITTEN BY:    Rashmi Anoop
00019    DATE:          3/22/2000
00020
00021
00022 */
00023
00024 /*
00025   includes
00026 */
00027
00028
00029 #include <windows.h>  //windows
00030 #include <windns.h>   //DNS api's
00031 #include <stdio.h>    //standard i/o
00032 #include <winsock.h>  //winsock
00033
00034 #define BUFFER_LEN 255
00035
00036
00037 //Usage of the program
00038 void Usage(char *progname) {
00039     fprintf(stderr,"Usage\n%s -n [OwnerName] -t [Type]  -s [DnsServerIp]\n",
00040             progname);
00041     fprintf(stderr,"Where:\n\t\"OwnerName\" is name of the owner of the record set being queried\n");
00042     fprintf(stderr,"\t\"Type\" is the type of record set to be queried A or PTR\n");
00043     fprintf(stderr,"\t\"DnsServerIp\"is the IP address of DNS server (in dotted decimal notation)");
00044     fprintf(stderr,"to which the query should be sent\n");
00045     exit(1);
00046 }
00047
00048 //  the main function
00049 void __cdecl main(int argc, char *argv[])
00050
00051 {
00052
00053     DNS_STATUS status;               // return value of  DnsQuery_A() function.
00054     PDNS_RECORD pDnsRecord;          //pointer to DNS_RECORD structure
00055     PIP4_ARRAY pSrvList = NULL;      //pinter to IP4_ARRAY structure
00056     LPTSTR pOwnerName = NULL;        //owner name to be queried
00057     WORD wType;                      //Type of the record to be queried
00058     char DnsServIp[BUFFER_LEN];      //DNS server ip address
00059     DNS_FREE_TYPE freetype ;
00060     freetype =  DnsFreeRecordListDeep;
00061     IN_ADDR ipaddr;
00062
00063
00064     if (argc > 4) {
00065
00066         for (int i = 1; i < argc ; i++) {
00067
00068             if ( (argv[i][0] == '-') || (argv[i][0] == '/') ) {
00069
00070                 switch (tolower(argv[i][1])) {
00071
00072                 case 'n':
00073                     pOwnerName = argv[++i];
00074                     break;
00075
00076                 case 't':
00077                     if (!_stricmp(argv[i+1], "A") )
00078                         wType = DNS_TYPE_A; //Query host records to resolve a name
00079                     else if (!_stricmp(argv[i+1], "PTR") )
00080                         wType = DNS_TYPE_PTR; //Query PTR records to resovle an IP address
00081                     else
00082                         Usage(argv[0]);
00083                     i++;
00084                     break;
00085
00086                 case 's':
00087                     // Allocate memory for IP4_ARRAY structure
00088                     pSrvList = (PIP4_ARRAY) LocalAlloc(LPTR,sizeof(IP4_ARRAY));
00089                     if (!pSrvList) {
00090                         printf("Memory allocation failed \n");
00091                         exit(1);
00092                     }
00093                     if (argv[++i]) {
00094                         strncpy(DnsServIp, argv[i], sizeof(DnsServIp)-1 );
00095                         DnsServIp[sizeof(DnsServIp)-1] = '\0';
00096                         pSrvList->AddrCount = 1;
00097                         pSrvList->AddrArray[0] = inet_addr(DnsServIp); //DNS server IP address
00098                         if ( pSrvList->AddrArray[0] == INADDR_NONE ) {
00099                             printf("Invalid DNS server IP address \n");
00100                             Usage( argv[0] );
00101                         }
00102                         break;
00103                     }
00104
00105                 default:
00106                     Usage(argv[0]);
00107                     break;
00108                 }
00109             }
00110             else
00111                 Usage(argv[0]);
00112         }
00113
00114     }
00115     else
00116         Usage(argv[0]);
00117
00118
00119     // Calling function DnsQuery_A() to query Host or PTR records
00120
00121     status = DnsQuery_A(pOwnerName,                 //pointer to OwnerName
00122                         wType,                      //Type of the record to be queried
00123                         DNS_QUERY_BYPASS_CACHE,     // Bypasses the resolver cache on the lookup.
00124                         pSrvList,                   //contains DNS server IP address
00125                         &pDnsRecord,                //Resource record comprising the response
00126                         NULL);                     //reserved for future use
00127
00128     if (status) {
00129         if (wType == DNS_TYPE_A)
00130             printf("Failed to query the host record for %s and the error is %d \n", pOwnerName, status);
00131         else
00132             printf("Failed to query the PTR record and the error is %d \n", status);
00133     }
00134     else {
00135         if (wType == DNS_TYPE_A) {
00136
00137             //convert the Internet network address into a string
00138             //in Internet standard dotted format.
00139             ipaddr.S_un.S_addr = (pDnsRecord->Data.A.IpAddress);
00140             printf("The IP address of the host %s is %s \n", pOwnerName,inet_ntoa(ipaddr));
00141
00142             // Free memory allocated for DNS records
00143
00144
00145             DnsRecordListFree(pDnsRecord, freetype);
00146         }
00147         else {
00148             printf("The host name is %s  \n",(pDnsRecord->Data.PTR.pNameHost));
00149
00150             // Free memory allocated for DNS records
00151
00152
00153             DnsRecordListFree(pDnsRecord, freetype);
00154         }
00155     }
00156     LocalFree(pSrvList);
00157
00158 }
00159
00160
00161
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/GSS/GssServer.c Source File

  • Security
  • SSPI
  • GSS

GssServer.c

Go to the documentation of this file.
00001 /*
00002  * Copyright 1994 by OpenVision Technologies, Inc.
00003  *
00004  * Permission to use, copy, modify, distribute, and sell this software
00005  * and its documentation for any purpose is hereby granted without fee,
00006  * provided that the above copyright notice appears in all copies and
00007  * that both that copyright notice and this permission notice appear in
00008  * supporting documentation, and that the name of OpenVision not be used
00009  * in advertising or publicity pertaining to distribution of the software
00010  * without specific, written prior permission. OpenVision makes no
00011  * representations about the suitability of this software for any
00012  * purpose.  It is provided "as is" without express or implied warranty.
00013  *
00014  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
00015  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
00016  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
00017  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
00018  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
00019  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00020  * PERFORMANCE OF THIS SOFTWARE.
00021  */
00022
00023
00024 #include "gss-misc.h"
00025
00026
00027 void usage()
00028 {
00029    fprintf(stderr, "Usage: gssserver [-port port] [-verbose]\n");
00030    fprintf(stderr, "       [-logfile file] [service_name] [service_password] [service_realm]\n");
00031    exit(1);
00032 }
00033
00034 FILE *logfile;
00035
00036 int verbose = 0;
00037
00038 /*
00039  * Function: server_acquire_creds
00040  *
00041  * Purpose: imports a service name and acquires credentials for it
00042  *
00043  * Arguments:
00044  *
00045  *      service_name    (r) the ASCII service name
00046  *      server_creds    (w) the GSS-API service credentials
00047  *
00048  * Returns: 0 on success, -1 on failure
00049  *
00050  * Effects:
00051  *
00052  * The service name is imported with gss_import_name, and service
00053  * credentials are acquired with gss_acquire_cred.  If either opertion
00054  * fails, an error message is displayed and -1 is returned; otherwise,
00055  * 0 is returned.
00056  */
00057 int server_acquire_creds(service_name, service_password, service_realm, server_creds)
00058 char *service_name;
00059 char *service_password;
00060 char *service_realm;
00061 CredHandle *server_creds;
00062 {
00063    OM_uint32 maj_stat;
00064    TimeStamp expiry;
00065    wchar_t wide_password[100];
00066    wchar_t wide_realm[100];
00067    SEC_WINNT_AUTH_IDENTITY_W auth_identity;
00068    memset(&auth_identity,0,sizeof(auth_identity));
00069
00070    mbstowcs(wide_password, service_password, sizeof(wide_password) / sizeof(wchar_t));
00071    auth_identity.Password = wide_password;
00072    auth_identity.PasswordLength = (ULONG)wcslen(wide_password);
00073
00074    mbstowcs(wide_realm, service_realm, sizeof(wide_realm) / sizeof(wchar_t));
00075    auth_identity.Domain = wide_realm;
00076    auth_identity.DomainLength = (ULONG)wcslen(wide_realm);
00077    auth_identity.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
00078
00079
00080    maj_stat = AcquireCredentialsHandle(
00081                                       service_name,
00082                                       "Kerberos",
00083                                       SECPKG_CRED_INBOUND,
00084                                       NULL,                       // no logon id
00085                                       &auth_identity,             // no auth data
00086                                       NULL,                       // no get key fn
00087                                       NULL,                       // no get key arg
00088                                       server_creds,
00089                                       &expiry
00090                                       );
00091    if (maj_stat != SEC_E_OK)
00092    {
00093       display_status("acquiring credentials", maj_stat, 0);
00094       return -1;
00095    }
00096
00097
00098    return 0;
00099 }
00100
00101 OM_uint32 global_asc_flags = ASC_REQ_ALLOCATE_MEMORY | ASC_REQ_MUTUAL_AUTH;
00102
00103 /*
00104  * Function: server_establish_context
00105  *
00106  * Purpose: establishses a GSS-API context as a specified service with
00107  * an incoming client, and returns the context handle and associated
00108  * client name
00109  *
00110  * Arguments:
00111  *
00112  *      s               (r) an established TCP connection to the client
00113  *      service_creds   (r) server credentials, from gss_acquire_cred
00114  *      context         (w) the established GSS-API context
00115  *      client_name     (w) the client's ASCII name
00116  *
00117  * Returns: 0 on success, -1 on failure
00118  *
00119  * Effects:
00120  *
00121  * Any valid client request is accepted.  If a context is established,
00122  * its handle is returned in context and the client name is returned
00123  * in client_name and 0 is returned.  If unsuccessful, an error
00124  * message is displayed and -1 is returned.
00125  */
00126 int server_establish_context(s, server_creds, context, ret_flags)
00127 int s;
00128 CredHandle *server_creds;
00129 CtxtHandle *context;
00130 OM_uint32 *ret_flags;
00131 {
00132    SecBufferDesc input_desc;
00133    SecBufferDesc output_desc;
00134    SecBuffer send_tok, recv_tok;
00135    OM_uint32 maj_stat;
00136    TimeStamp expiry;
00137    PCtxtHandle context_handle = NULL;
00138
00139    context->dwUpper = 0;
00140    context->dwLower = 0;
00141
00142    input_desc.cBuffers = 1;
00143    input_desc.ulVersion = SECBUFFER_VERSION;
00144    input_desc.pBuffers = &recv_tok;
00145
00146    output_desc.cBuffers = 1;
00147    output_desc.ulVersion = SECBUFFER_VERSION;
00148    output_desc.pBuffers = &send_tok;
00149
00150    do
00151    {
00152       if (recv_token(s, &recv_tok) < 0)
00153          return -1;
00154
00155       if (verbose && logfile)
00156       {
00157          fprintf(logfile, "Received token (size=%d): \n", recv_tok.cbBuffer);
00158          print_token(&recv_tok);
00159       }
00160
00161       recv_tok.BufferType = SECBUFFER_TOKEN;
00162       send_tok.cbBuffer = 0;
00163       send_tok.pvBuffer = NULL;
00164       send_tok.BufferType = SECBUFFER_TOKEN;
00165       maj_stat = AcceptSecurityContext(
00166                                       server_creds,
00167                                       context_handle,
00168                                       &input_desc,
00169                                       global_asc_flags,
00170                                       SECURITY_NATIVE_DREP,
00171                                       context,
00172                                       &output_desc,
00173                                       ret_flags,
00174                                       &expiry
00175                                       );
00176
00177
00178       if (maj_stat!=SEC_E_OK && maj_stat!=SEC_I_CONTINUE_NEEDED)
00179       {
00180          display_status("accepting context", maj_stat, 0);
00181          (void) free(recv_tok.pvBuffer);
00182          return -1;
00183       }
00184
00185       context_handle = context;
00186       free(recv_tok.pvBuffer);
00187
00188       if (send_tok.cbBuffer != 0)
00189       {
00190          if (verbose && logfile)
00191          {
00192             fprintf(logfile,
00193                     "Sending accept_sec_context token (size=%d):\n",
00194                     send_tok.cbBuffer);
00195             print_token(&send_tok);
00196          }
00197          if (send_token(s, &send_tok) < 0)
00198          {
00199             fprintf(logfile, "failure sending token\n");
00200             return -1;
00201          }
00202
00203          FreeContextBuffer(send_tok.pvBuffer);
00204          send_tok.pvBuffer = NULL;
00205       }
00206
00207       if (verbose && logfile)
00208       {
00209          if (maj_stat == SEC_I_CONTINUE_NEEDED)
00210             fprintf(logfile, "continue needed...\n");
00211          else
00212             fprintf(logfile, "\n");
00213          fflush(logfile);
00214       }
00215
00216    } while (maj_stat == SEC_I_CONTINUE_NEEDED);
00217
00218    /* display the flags */
00219    display_ctx_flags(*ret_flags);
00220
00221    if (verbose && logfile)
00222    {
00223       fprintf(logfile, "Accepted connection using mechanism Kerberos\n");
00224    }
00225
00226    return 0;
00227 }
00228
00229 /*
00230  * Function: create_socket
00231  *
00232  * Purpose: Opens a listening TCP socket.
00233  *
00234  * Arguments:
00235  *
00236  *      port            (r) the port number on which to listen
00237  *
00238  * Returns: the listening socket file descriptor, or -1 on failure
00239  *
00240  * Effects:
00241  *
00242  * A listening socket on the specified port and created and returned.
00243  * On error, an error message is displayed and -1 is returned.
00244  */
00245 int create_socket(port)
00246 u_short port;
00247 {
00248    struct sockaddr_in saddr;
00249    int s;
00250    int on = 1;
00251
00252    saddr.sin_family = AF_INET;
00253    saddr.sin_port = htons(port);
00254    saddr.sin_addr.s_addr = INADDR_ANY;
00255
00256    if ((s = (int)socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
00257    {
00258       fprintf(stderr, "creating socket - %x", GetLastError());
00259       return -1;
00260    }
00261
00262    /* Let the socket be reused right away */
00263    (void) setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on));
00264
00265    if (bind(s, (struct sockaddr *) &saddr, sizeof(saddr)) == SOCKET_ERROR)
00266    {
00267       fprintf(stderr, "binding socket - %x", GetLastError());
00268       (void) closesocket(s);
00269       return -1;
00270    }
00271
00272    if (listen(s, 5) == SOCKET_ERROR)
00273    {
00274       fprintf(stderr, "listening on socket", GetLastError());
00275       (void) closesocket(s);
00276       return -1;
00277    }
00278    return s;
00279 }
00280
00281 /*
00282  * Function: sign_server
00283  *
00284  * Purpose: Performs the "sign" service.
00285  *
00286  * Arguments:
00287  *
00288  *      s               (r) a TCP socket on which a connection has been
00289  *                      accept()ed
00290  *      service_name    (r) the ASCII name of the GSS-API service to
00291  *                      establish a context as
00292  *
00293  * Returns: -1 on error
00294  *
00295  * Effects:
00296  *
00297  * sign_server establishes a context, and performs a single sign request.
00298  *
00299  * A sign request is a single GSS-API sealed token.  The token is
00300  * unsealed and a signature block, produced with gss_sign, is returned
00301  * to the sender.  The context is the destroyed and the connection
00302  * closed.
00303  *
00304  * If any error occurs, -1 is returned.
00305  */
00306 int sign_server(s, server_creds)
00307 int s;
00308 CredHandle *server_creds;
00309 {
00310    SecBuffer xmit_buf, msg_buf;
00311    SecBuffer wrap_bufs[2];
00312    SecBufferDesc wrap_buf_desc;
00313    CtxtHandle context;
00314    OM_uint32 maj_stat;
00315    int ret_flags;
00316    char *cp;
00317    SecPkgContext_Names names;
00318    SecPkgContext_Sizes sizes;
00319    ULONG qop;
00320
00321    /* Establish a context with the client */
00322    if (server_establish_context(s, server_creds, &context,
00323                                 &ret_flags) < 0)
00324       return (-1);
00325
00326    maj_stat = QueryContextAttributes(&context, SECPKG_ATTR_NAMES, &names);
00327    if (maj_stat != SEC_E_OK)
00328    {
00329       display_status("Query context attributes",maj_stat, 0 );
00330       return ( -1 );
00331    }
00332    printf("Accepted connection: \"%s\"\n",
00333           names.sUserName);
00334    (void) FreeContextBuffer(names.sUserName);
00335
00336    maj_stat = QueryContextAttributes(&context, SECPKG_ATTR_SIZES, &sizes);
00337    if (maj_stat != SEC_E_OK)
00338    {
00339       display_status("Query context attributes",maj_stat, 0 );
00340       return ( -1 );
00341    }
00342
00343    /* Receive the sealed message token */
00344    if (recv_token(s, &xmit_buf) < 0)
00345       return (-1);
00346
00347    if (verbose && logfile)
00348    {
00349       fprintf(logfile, "Sealed message token:\n");
00350       print_token(&xmit_buf);
00351    }
00352
00353    wrap_buf_desc.cBuffers = 2;
00354    wrap_buf_desc.pBuffers = wrap_bufs;
00355    wrap_buf_desc.ulVersion = SECBUFFER_VERSION;
00356    wrap_bufs[0].BufferType = SECBUFFER_STREAM;
00357    wrap_bufs[0].pvBuffer = xmit_buf.pvBuffer;
00358    wrap_bufs[0].cbBuffer = xmit_buf.cbBuffer;
00359    wrap_bufs[1].BufferType = SECBUFFER_DATA;
00360    wrap_bufs[1].cbBuffer = 0;
00361    wrap_bufs[1].pvBuffer = NULL;
00362
00363    maj_stat = DecryptMessage(
00364                             &context,
00365                             &wrap_buf_desc,
00366                             0,                  // no sequence number
00367                             &qop
00368                             );
00369    if (maj_stat != SEC_E_OK)
00370    {
00371       display_status("unsealing message", maj_stat, 0);
00372       return (-1);
00373    }
00374
00375    msg_buf = wrap_bufs[1];
00376    fprintf(logfile, "Received message %s: ", (qop == KERB_WRAP_NO_ENCRYPT ? "signed only" : ""));
00377    cp = (char *) msg_buf.pvBuffer;
00378    if (isprint(cp[0]) && isprint(cp[1]))
00379       fprintf(logfile, "\"%s\"\n", cp);
00380    else
00381    {
00382       printf("\n");
00383       print_token(&msg_buf);
00384    }
00385
00386    /* Produce a signature block for the message */
00387
00388    wrap_bufs[0] = msg_buf;
00389
00390    wrap_bufs[1].BufferType = SECBUFFER_TOKEN;
00391    wrap_bufs[1].cbBuffer = sizes.cbMaxSignature;
00392    wrap_bufs[1].pvBuffer = malloc(sizes.cbMaxSignature);
00393
00394    if (wrap_bufs[1].pvBuffer == NULL)
00395    {
00396       fprintf(stderr, "Failed to allocate memory for signature\n");
00397       return (-1);
00398    }
00399
00400    maj_stat = MakeSignature(
00401                            &context,
00402                            0,
00403                            &wrap_buf_desc,
00404                            0
00405                            );
00406    if (maj_stat != SEC_E_OK)
00407    {
00408       display_status("signing message", maj_stat, 0);
00409       return (-1);
00410    }
00411
00412    free(xmit_buf.pvBuffer);
00413    xmit_buf.pvBuffer = NULL;
00414    xmit_buf.cbBuffer = 0;
00415
00416    xmit_buf = wrap_bufs[1];
00417
00418    /* Send the signature block to the client */
00419
00420    if (send_token(s, &xmit_buf) < 0)
00421       return (-1);
00422
00423    free(wrap_bufs[1].pvBuffer);
00424    wrap_bufs[1].pvBuffer = NULL;
00425
00426
00427    /* Delete context */
00428
00429    maj_stat = DeleteSecurityContext( &context );
00430    if (maj_stat != SEC_E_OK)
00431    {
00432       display_status("deleting context", maj_stat, 0);
00433       return (-1);
00434    }
00435
00436    fflush(logfile);
00437
00438    return (0);
00439 }
00440
00441 int _cdecl
00442 main(argc, argv)
00443 int argc;
00444 char **argv;
00445 {
00446    int stmp,err;
00447    WSADATA socket_data;
00448    USHORT version_required = 0x0101;
00449    char *service_name;
00450    char *service_password;
00451    char *service_realm;
00452    CredHandle server_creds;
00453    u_short port = 4444;
00454    int s;
00455    int once = 0;
00456
00457    FLAGMAPPING FlagMappings[] = {
00458 #define DUPE( x ) { "-" #x, ASC_REQ_ ## x }
00459
00460       DUPE( CONFIDENTIALITY ),
00461       DUPE( DELEGATE ),
00462       DUPE( INTEGRITY ),
00463       DUPE( USE_SESSION_KEY ),
00464       DUPE( REPLAY_DETECT ),
00465       DUPE( SEQUENCE_DETECT )
00466    };
00467
00468    logfile = stdout;
00469    display_file = stdout;
00470    argc--; argv++;
00471
00472    while (argc)
00473    {
00474       if (strcmp(*argv, "-port") == 0)
00475       {
00476          argc--; argv++;
00477          if (!argc) usage();
00478          port = (u_short)atoi(*argv);
00479       }
00480       else if (strcmp(*argv, "-verbose") == 0)
00481       {
00482          verbose = 1;
00483       }
00484       else if (strcmp(*argv, "-once") == 0)
00485       {
00486          once = 1;
00487       }
00488       else if (strcmp(*argv, "-logfile") == 0)
00489       {
00490          argc--; argv++;
00491          if (!argc) usage();
00492          logfile = fopen(*argv, "a");
00493          display_file = logfile;
00494          if (!logfile)
00495          {
00496             perror(*argv);
00497             exit(1);
00498          }
00499       }
00500       else
00501       {
00502
00503          int i;
00504          BOOL found = FALSE;
00505
00506
00507          for ( i = 0 ;
00508              i < ( sizeof( FlagMappings ) /
00509                    sizeof( FLAGMAPPING ) ) ;
00510              i ++ )
00511          {
00512
00513             if ( _strcmpi( *argv, FlagMappings[ i ].name ) == 0 )
00514             {
00515
00516                found = TRUE;
00517                global_asc_flags |= FlagMappings[ i ].value ;
00518                break;
00519
00520             }
00521          }
00522
00523          if ( !found )
00524          {
00525             break;
00526          }
00527       }
00528
00529       argc--; argv++;
00530    }
00531    if (argc != 3)
00532       usage();
00533
00534    if ((*argv)[0] == '-')
00535       usage();
00536
00537    service_name = *argv;
00538    argv++;
00539    service_password = *argv;
00540    argv++;
00541    service_realm = *argv;
00542
00543
00544    if (server_acquire_creds(service_name, service_password, service_realm, &server_creds) < 0)
00545       return -1;
00546
00547
00548    err = WSAStartup(version_required, &socket_data);
00549    if (err)
00550    {
00551       fprintf(stderr,"Failed to initailize WSA: %d\n",err);
00552
00553    }
00554    else if ((stmp = create_socket(port)))
00555    {
00556       do
00557       {
00558          /* Accept a TCP connection */
00559          if ((s = (int)accept(stmp, NULL, 0)) == SOCKET_ERROR)
00560          {
00561             fprintf(stderr,"accepting connection: %d\n", GetLastError());
00562          }
00563          else
00564          {
00565             /* this return value is not checked, because there's
00566                not really anything to do if it fails */
00567             sign_server(s, &server_creds);
00568          }
00569       } while (!once);
00570
00571       closesocket(stmp);
00572    }
00573
00574    (void) FreeCredentialsHandle( &server_creds);
00575
00576    /*NOTREACHED*/
00577    (void) closesocket(s);
00578    return 0;
00579 }
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

AppEvents Member List

This is the complete list of members for AppEvents, including all inherited members.
Beep([in] short alert) AppEvents
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerDraw/PerDraw.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerDraw

PerDraw.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PERDRAW.H
00003
00004   Summary:   Main include file for the PERDRAW.DLL dynamic link library.
00005              Intended primarily for external users of this DLL who exploit
00006              it via static linkage to the DllRegisterServer and
00007              DllUnregisterServer exported service calls.
00008
00009              For a comprehensive tutorial code tour of PERDRAW's contents
00010              and offerings see the tutorial PERDRAW.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the PERDRAW source code.
00013
00014   Classes:   none.
00015
00016   Functions: DllRegisterServer, DllUnregisterServer.
00017
00018   Origin:    5-20-97: atrent - Editor-inheritance from STOSERVE.H in
00019                the STOSERVE Tutorial Code Sample. [Revised]
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(PERDRAW_H)
00037 #define PERDRAW_H
00038
00039 #if !defined(RC_INCLUDE)
00040
00041 #if !defined(_DLLEXPORT_)
00042
00043 // If _DLLEXPORT_ is NOT defined then the default is to import.
00044 #if defined(__cplusplus)
00045 #define DLLENTRY extern "C" __declspec(dllimport)
00046 #else
00047 #define DLLENTRY extern __declspec(dllimport)
00048 #endif
00049 #define STDENTRY DLLENTRY HRESULT WINAPI
00050 #define STDENTRY_(type) DLLENTRY type WINAPI
00051
00052 // Here is the list of server APIs offered by the DLL (using the
00053 // appropriate entry API declaration macros just #defined above).
00054
00055 STDENTRY DllRegisterServer(void);
00056
00057 STDENTRY DllUnregisterServer(void);
00058
00059 #else  // _DLLEXPORT_
00060
00061 // Else if _DLLEXPORT_ is indeed defined then we've been told to export.
00062 #if defined(__cplusplus)
00063 #define DLLENTRY extern "C" __declspec(dllexport)
00064 #else
00065 #define DLLENTRY __declspec(dllexport)
00066 #endif
00067 #define STDENTRY DLLENTRY HRESULT WINAPI
00068 #define STDENTRY_(type) DLLENTRY type WINAPI
00069
00070 #endif // _DLLEXPORT_
00071
00072 #endif // RC_INCLUDE
00073
00074 #endif // PERDRAW_H
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/clsfact.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

clsfact.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          ClsFact.cpp
00021
00022   Description:   CClassFactory implementation
00023
00024 **************************************************************************/
00025
00026 /**************************************************************************
00027 #include statements
00028 **************************************************************************/
00029
00030 #include "ClsFact.h"
00031
00032 /**************************************************************************
00033 global variables
00034 **************************************************************************/
00035
00036 extern DWORD   g_DllRefCount;
00037
00038 /**************************************************************************
00039
00040   CClassFactory::CClassFactory
00041
00042 **************************************************************************/
00043
00044 CClassFactory::CClassFactory()
00045 {
00046   OutputDebugString(TEXT("CClassFactory's constructor\n"));
00047
00048   m_ObjRefCount = 0;
00049 }
00050
00051 /**************************************************************************
00052
00053   CClassFactory::~CClassFactory
00054
00055 **************************************************************************/
00056
00057 CClassFactory::~CClassFactory()
00058 {
00059   OutputDebugString(TEXT("CClassFactory's destructor\n"));
00060 }
00061
00062 /**************************************************************************
00063
00064   CClassFactory::QueryInterface
00065
00066 **************************************************************************/
00067
00068 STDMETHODIMP CClassFactory::QueryInterface(  REFIID riid,
00069                        LPVOID *ppReturn)
00070 {
00071   OutputDebugString(TEXT("CClassFactory::QueryInterface\n"));
00072
00073   if(IsEqualIID(riid, IID_IUnknown))
00074   {
00075     *ppReturn = (LPUNKNOWN)(LPCLASSFACTORY)this;
00076     m_ObjRefCount++;
00077     return ResultFromScode(S_OK);
00078   }
00079
00080   if(IsEqualIID(riid, IID_IClassFactory))
00081   {
00082     *ppReturn = (LPCLASSFACTORY)this;
00083     m_ObjRefCount++;
00084     return ResultFromScode(S_OK);
00085   }
00086
00087   *ppReturn = NULL;
00088   return ResultFromScode(E_NOINTERFACE);
00089 }
00090
00091 /**************************************************************************
00092
00093   CClassFactory::AddRef
00094
00095 **************************************************************************/
00096
00097 STDMETHODIMP_(DWORD) CClassFactory::AddRef()
00098 {
00099   OutputDebugString(TEXT("CClassFactory::AddRef\n"));
00100
00101   return ++m_ObjRefCount;
00102 }
00103
00104
00105 /**************************************************************************
00106
00107   CClassFactory::Release
00108
00109 **************************************************************************/
00110
00111 STDMETHODIMP_(DWORD) CClassFactory::Release()
00112 {
00113   TCHAR szText[MAX_PATH];
00114   wsprintf(szText, TEXT("CClassFactory::Release - ref count will be %d\n"), m_ObjRefCount - 1);
00115   OutputDebugString(szText);
00116
00117   if(--m_ObjRefCount == 0)
00118     delete this;
00119
00120   return m_ObjRefCount;
00121 }
00122
00123 /**************************************************************************
00124
00125   CClassFactory::CreateInstance
00126
00127 **************************************************************************/
00128
00129 STDMETHODIMP CClassFactory::CreateInstance(  LPUNKNOWN pUnknown,
00130                        REFIID riid,
00131                        LPVOID *ppObject)
00132 {
00133   OutputDebugString(TEXT("CClassFactory::CreateInstance\n"));
00134
00135   *ppObject = NULL;
00136
00137   if(pUnknown != NULL)
00138     return ResultFromScode(CLASS_E_NOAGGREGATION);
00139
00140   COleDocument *pOleDoc = new COleDocument;
00141   if(NULL == pOleDoc)
00142     return ResultFromScode(E_OUTOFMEMORY);
00143
00144   //get the QueryInterface return for our return value
00145   HRESULT hr = pOleDoc->QueryInterface(riid, ppObject);
00146
00147   //return the result from QueryInterface
00148   return hr;
00149 }
00150
00151 /**************************************************************************
00152
00153   CClassFactory::LockServer
00154
00155 **************************************************************************/
00156
00157 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00158 {
00159   OutputDebugString(TEXT("CClassFactory::LockServer - "));
00160
00161   if(fLock)
00162   {
00163     OutputDebugString(TEXT("Lock\n"));
00164     g_DllRefCount++;
00165   }
00166   else
00167   {
00168     OutputDebugString(TEXT("Unlock\n"));
00169     g_DllRefCount--;
00170   }
00171
00172   return S_OK;
00173 }
00174
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_LSP_ENTRY Member List

This is the complete list of members for _LSP_ENTRY, including all inherited members.
Count | _LSP_ENTRY
DummyEntry | _LSP_ENTRY
LayeredEntries | _LSP_ENTRY
LayeredGuidCount | _LSP_ENTRY
LayeredGuids | _LSP_ENTRY
LspOrder | _LSP_ENTRY
MaxChainLength | _LSP_ENTRY
wszLspDll | _LSP_ENTRY
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CConsole Member List

This is the complete list of members for CConsole, including all inherited members.
CConsole() | CConsole | [inline]
GetConsole() | CConsole | [inline]
m_pwszNewLine | CConsole | [protected]
operator<<(LPCWSTR pwsz) | CConsole | [inline, virtual]
operator<<(COLORREF refColor) | CConsole | [inline, virtual]
operator<<(COLORA attColor) | CConsole | [inline, virtual]
SetColor(COLORREF refColor) | CConsole | [inline, virtual]
SetColorAttrib(COLORA attColor, BOOL fEnable=TRUE) | CConsole | [inline, virtual]
Write(LPCWSTR pwsz)=0 | CConsole | [pure virtual]
WriteLine(LPCWSTR pwsz=NULL) | CConsole | [inline, virtual]
~CConsole() | CConsole | [inline, virtual]
Generated on Wed Nov 13 2024 16:55:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/localres.h Source File

  • SysMgmt
  • MMC
  • Extens

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/FunctionDelegator/cbklib.idl Source File

  • NetDS
  • upnp
  • FunctionDelegator

cbklib.idl

Go to the documentation of this file.
00001 [
00002     uuid(EBC4BD48-A6F5-4802-9254-C0F9E5BFBD9C),
00003     version(1.0),
00004     helpstring("Callback Library")
00005 ]
00006 library CallbackIUnknownLib
00007 {
00008     importlib("stdole2.tlb");
00009 #ifdef __MKTYPLIB__
00010 #ifdef VARIANT_BOOL
00011 #undef VARIANT_BOOL
00012 #endif
00013 #define VARIANT_BOOL boolean
00014 #endif //__MKTYPLIB__
00015
00016     [
00017         odl,
00018         uuid(EBC4BD49-A6F5-4802-9254-C0F9E5BFBD9C),
00019         helpstring("Service Callback Function")
00020     ]
00021     interface ServiceCallBackInterface : IUnknown
00022     {
00023         [id(0)]
00024         HRESULT CallbackFunction([in] VARIANT pszCallbackType, [in] VARIANT svcObject, [in] VARIANT pszStateVarName, [in] VARIANT varValue);
00025     }
00026     [
00027         odl,
00028         uuid(88813aea-9f83-4fbb-9dfd-58be6b59f029),
00029         helpstring("Callback Function")
00030     ]
00031     interface DeviceFinderCallBackInterface : IUnknown
00032     {
00033         [id(0)]
00034         HRESULT CallbackFunction([in] VARIANT device, [in] VARIANT UDN, [in] VARIANT callbackType);
00035     }
00036
00037
00038 };
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IPTLauncher Member List

This is the complete list of members for IPTLauncher, including all inherited members.
LaunchPT() IPTLauncher
Generated on Wed Nov 13 2024 16:57:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/CStorageResource.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

CStorageResource.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      CStorageResource.cpp
00005 //
00006 //  Description:
00007 //      Implementation for the ClusCfg Managed Resource class - this demonstrates how
00008 //      to implement the IClusCfgManagedResourceInfo and
00009 //      IClusCfgManagedResourceCfg interfaces.
00010 //
00011 //////////////////////////////////////////////////////////////////////////////
00012
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 // Include Files
00016 //////////////////////////////////////////////////////////////////////////////
00017
00018 #include "stdafx.h"
00019 #include "WMIHelpers.h"
00020 #include "CStorageResource.h"
00021 #include "CPartitionInfo.h"
00022 #include "proplist.h"
00023
00024 //
00025 // Instead of requiring the DDK to be installed the following information has been
00026 // copied from ntddscsi.h.  If you have the DDK installed uncomment the include.
00027 //
00028
00029 #pragma warning( push )
00030 #include <ntddscsi.h>
00031 #pragma warning( pop )
00032
00033
00034 //////////////////////////////////////////////////////////////////////////////
00035 // CStorageResource class
00036 //////////////////////////////////////////////////////////////////////////////
00037
00038
00039 //////////////////////////////////////////////////////////////////////////////
00040 //++
00041 //
00042 //  CStorageResource::CStorageResource
00043 //
00044 //  Description:
00045 //      Constructor of the CStorageResource class. Initializes all variables.
00046 //
00047 //  Arguments:
00048 //
00049 //  Return Value:
00050 //
00051 //  Remarks:
00052 //      None.
00053 //
00054 //--
00055 //////////////////////////////////////////////////////////////////////////////
00056 CStorageResource::CStorageResource( void )
00057 {
00058     m_bstrName = NULL;
00059     m_bstrDescription = NULL;
00060     m_bstrFriendlyName = NULL;
00061     m_bstrDeviceID = NULL;
00062
00063     m_fIsQuorumCapable = FALSE;
00064     m_fIsQuorumResource = FALSE;
00065     m_fIsMultiNodeCapable = FALSE;
00066     m_fIsManaged = FALSE;
00067     m_fIsManagedByDefault = FALSE;
00068     m_fIsDynamicDisk = FALSE;
00069     m_fIsGPTDisk = FALSE;
00070
00071     m_ulSCSIBus = 0;
00072     m_ulSCSITid = 0;
00073     m_ulSCSIPort = 0;
00074     m_ulSCSILun = 0;
00075
00076     m_idxDevice = 0;
00077     m_idxNextPartition = 0;
00078     m_idxEnumPartitionNext = 0;
00079     m_cPartitions = 0;
00080     m_dwSignature = 0;
00081
00082     m_pIWbemServices = NULL;
00083     m_prgPartitions = NULL;
00084
00085 } //*** CStorageResource::CStorageResource
00086
00087
00088 //////////////////////////////////////////////////////////////////////////////
00089 //++
00090 //
00091 //  CStorageResource::~CStorageResource
00092 //
00093 //  Description:
00094 //      Destructor of the CStorageResource class. Free's all used buffers
00095 //
00096 //  Arguments:
00097 //
00098 //  Return Value:
00099 //
00100 //  Remarks:
00101 //      None.
00102 //
00103 //--
00104 //////////////////////////////////////////////////////////////////////////////
00105 CStorageResource::~CStorageResource( void )
00106 {
00107     ULONG   idx = 0;
00108
00109     SysFreeString( m_bstrName );
00110     SysFreeString( m_bstrDeviceID );
00111     SysFreeString( m_bstrDescription );
00112     SysFreeString( m_bstrFriendlyName );
00113
00114     for ( idx = 0; idx < m_idxNextPartition; idx++ )
00115     {
00116         ((*m_prgPartitions)[ idx ])->Release();
00117     } // for:
00118
00119     HeapFree( GetProcessHeap(), 0, m_prgPartitions );
00120
00121     if ( m_pIWbemServices != NULL )
00122     {
00123         m_pIWbemServices->Release();
00124     } // if:
00125
00126 } //*** CStorageResource::~CStorageResource
00127
00128
00129 //////////////////////////////////////////////////////////////////////////////
00130 // CStorageResource -- IClusCfgManagedResourceInfo interface.
00131 //////////////////////////////////////////////////////////////////////////////
00132
00133
00134 //////////////////////////////////////////////////////////////////////////////
00135 //++
00136 //
00137 //  CStorageResource::GetDriveLetterMappings
00138 //
00139 //  Description:
00140 //      Gets Drive Letter Mappings of this resource.
00141 //
00142 //  Arguments:
00143 //    pdlmDriveLetterMappingsOut - Array to fill in with how drive letters are used.
00144 //
00145 //  Return Value:
00146 //      S_FALSE     - Not supported
00147 //
00148 //--
00149 //////////////////////////////////////////////////////////////////////////////
00150 STDMETHODIMP
00151 CStorageResource::GetDriveLetterMappings(
00152     SDriveLetterMapping * pdlmDriveLetterMappingsOut
00153     )
00154 {
00155     HRESULT                 hr = S_FALSE;
00156     IClusCfgPartitionInfo * piccpi = NULL;
00157     ULONG                   idx;
00158
00159     if ( pdlmDriveLetterMappingsOut == NULL )
00160     {
00161         hr = E_POINTER;
00162         STATUS_REPORT_REF(
00163                   TASKID_Major_Find_Devices
00164                 , TASKID_Minor_GetDriveLetterMappings_StorageResource
00165                 , IDS_ERROR_NULL_POINTER
00166                 , IDS_ERROR_NULL_POINTER_REF
00167                 , hr
00168                 );
00169         goto Cleanup;
00170     } // if:
00171
00172     for ( idx = 0; idx < m_idxNextPartition; idx++ )
00173     {
00174         hr = ( ((*m_prgPartitions)[ idx ])->TypeSafeQI( IClusCfgPartitionInfo, &piccpi ) );
00175         if ( FAILED( hr ) )
00176         {
00177             goto Cleanup;
00178         } // if:
00179
00180         hr = piccpi->GetDriveLetterMappings( pdlmDriveLetterMappingsOut );
00181         if ( FAILED( hr ) )
00182         {
00183             goto Cleanup;
00184         } // if:
00185
00186         piccpi->Release();
00187         piccpi = NULL;
00188     } // for:
00189
00190 Cleanup:
00191
00192     if ( piccpi != NULL )
00193     {
00194         piccpi->Release();
00195     } // if:
00196
00197     return hr;
00198
00199 } //*** CStorageResource::GetDriveLetterMappings
00200
00201
00202 //////////////////////////////////////////////////////////////////////////////
00203 //++
00204 //
00205 //  CStorageResource::SetDriveLetterMappings
00206 //
00207 //  Description:
00208 //      Sets Drive Letter Mappings of this resource. Unsupported
00209 //
00210 //  Arguments:
00211 //    dlmDriveLetterMappingsIn  - Drive letter mappings.
00212 //
00213 //  Return Value:
00214 //      S_FALSE     - Not supported
00215 //
00216 //--
00217 //////////////////////////////////////////////////////////////////////////////
00218 STDMETHODIMP
00219 CStorageResource::SetDriveLetterMappings(
00220     SDriveLetterMapping dlmDriveLetterMappingsIn
00221     )
00222 {
00223     HRESULT hr = E_NOTIMPL;
00224
00225     UNREFERENCED_PARAMETER( dlmDriveLetterMappingsIn );
00226
00227     return hr;
00228
00229 } //*** CStorageResource::SetDriveLetterMappings
00230
00231
00232 //////////////////////////////////////////////////////////////////////////////
00233 //++
00234 //
00235 //  CStorageResource::GetName
00236 //
00237 //  Description:
00238 //      Gets name of this resource.
00239 //
00240 //  Arguments:
00241 //    pbstrNameOut  - Name of resource.
00242 //
00243 //  Return Value:
00244 //      S_OK            - Success
00245 //      E_POINTER       - Expected pointer argument specified as NULL.
00246 //      E_OUTOFMEMORY   - Out of memory.
00247 //
00248 //--
00249 //////////////////////////////////////////////////////////////////////////////
00250 STDMETHODIMP
00251 CStorageResource::GetName(
00252     BSTR * pbstrNameOut
00253     )
00254 {
00255     HRESULT hr = S_OK;
00256
00257     if ( pbstrNameOut == NULL )
00258     {
00259         hr = E_POINTER;
00260         STATUS_REPORT_REF(
00261                   TASKID_Major_Find_Devices
00262                 , TASKID_Minor_GetName_Pointer
00263                 , IDS_ERROR_NULL_POINTER
00264                 , IDS_ERROR_NULL_POINTER_REF
00265                 , hr
00266                 );
00267         goto Cleanup;
00268     } // if:
00269
00270     //
00271     //  Prefer the "friendly" name over the WMI name -- if we have it...
00272     //
00273     if ( m_bstrFriendlyName != NULL )
00274     {
00275         *pbstrNameOut = SysAllocString( m_bstrFriendlyName );
00276     } // if:
00277     else
00278     {
00279         LOG_STATUS_REPORT_STRING2(
00280                   L"There is not a \"friendly name\" for the %1!ws! resource '%2!ws!'."
00281                 , GetResTypeName()
00282                 , m_bstrName
00283                 , hr
00284                 );
00285         *pbstrNameOut = SysAllocString( m_bstrName );
00286     } // else:
00287
00288     if (*pbstrNameOut == NULL )
00289     {
00290         hr = E_OUTOFMEMORY;
00291         STATUS_REPORT(
00292                   TASKID_Major_Find_Devices
00293                 , TASKID_Minor_GetName_Memory
00294                 , IDS_ERROR_OUTOFMEMORY
00295                 , hr
00296                 );
00297     } // if:
00298
00299 Cleanup:
00300
00301     return hr;
00302
00303 } //*** CStorageResource::GetName
00304
00305
00306 //////////////////////////////////////////////////////////////////////////////
00307 //++
00308 //
00309 //  CStorageResource::SetName
00310 //
00311 //  Description:
00312 //      Sets name of this resource.
00313 //
00314 //  Arguments:
00315 //    pwszNameIn    - New name to give to the resource.
00316 //
00317 //  Return Value:
00318 //      S_OK            - Success
00319 //      E_INVALIDARD    - Expected pointer argument specified as NULL.
00320 //      E_OUTOFMEMORY   - Out of memory.
00321 //
00322 //--
00323 //////////////////////////////////////////////////////////////////////////////
00324 STDMETHODIMP
00325 CStorageResource::SetName(
00326     LPCWSTR pwszNameIn
00327     )
00328 {
00329     HRESULT hr = S_OK;
00330     BSTR    bstr = NULL;
00331
00332     if ( pwszNameIn == NULL )
00333     {
00334         hr = E_INVALIDARG;
00335         goto Cleanup;
00336     } // if:
00337
00338     bstr = SysAllocString( pwszNameIn );
00339     if ( bstr == NULL )
00340     {
00341         hr = E_OUTOFMEMORY;
00342         STATUS_REPORT(
00343                   TASKID_Major_Find_Devices
00344                 , TASKID_Minor_SetName_StorageResource
00345                 , IDS_ERROR_OUTOFMEMORY
00346                 , hr
00347                 );
00348         goto Cleanup;
00349     } // if:
00350
00351     SysFreeString( m_bstrName );
00352     m_bstrName = bstr;
00353
00354     //
00355     // Since we got asked from the outside to set a new name, this should actually be reflected in
00356     // the friendly name, too, since that, ultimately, gets preference over the real name
00357     //
00358     hr = HrSetFriendlyName( pwszNameIn );
00359     if ( FAILED( hr ) )
00360     {
00361         goto Cleanup;
00362     } // if:
00363
00364 Cleanup:
00365
00366     return hr;
00367
00368 } //*** CStorageResource::SetName
00369
00370
00371 //////////////////////////////////////////////////////////////////////////////
00372 //++
00373 //
00374 //  CStorageResource::GetUID
00375 //
00376 //  Description:
00377 //      Gets a unique ID for this resource.
00378 //
00379 //  Arguments:
00380 //    pbstrUIDOut   - Unique ID being returned.
00381 //
00382 //  Return Value:
00383 //      S_OK            - Success
00384 //      E_POINTER       - Expected pointer argument specified as NULL.
00385 //      E_OUTOFMEMORY   - Out of memory.
00386 //
00387 //--
00388 //////////////////////////////////////////////////////////////////////////////
00389 STDMETHODIMP
00390 CStorageResource::GetUID(
00391     BSTR * pbstrUIDOut
00392     )
00393 {
00394     HRESULT hr = S_OK;
00395     WCHAR   sz[ 256 ];
00396
00397     if ( pbstrUIDOut == NULL )
00398     {
00399         hr = E_POINTER;
00400         STATUS_REPORT_REF(
00401                   TASKID_Major_Find_Devices
00402                 , TASKID_Minor_StorageResource_GetUID_Pointer
00403                 , IDS_ERROR_NULL_POINTER
00404                 , IDS_ERROR_NULL_POINTER_REF
00405                 , hr
00406                 );
00407         goto Cleanup;
00408     } // if: incoming UID buffer was invalid (NULL)
00409
00410     //
00411     // TODO: Retrieve the unique ID for this resource. If this same resource
00412     //       is going to be detected on other nodes of the cluster make sure
00413     //       that each of those resources have the same UID, otherwise a new
00414     //       resource will be generated for each UID.
00415     //
00416
00417     hr = StringCchPrintfW(
00418               sz
00419             , RTL_NUMBER_OF( sz )
00420             , L"%s SCSI Tid %ld, SCSI Lun %ld"
00421             , GetDisplayName()
00422             , m_ulSCSITid
00423             , m_ulSCSILun
00424             );
00425     if ( FAILED( hr ) )
00426     {
00427         goto Cleanup;
00428     } // if:
00429
00430     *pbstrUIDOut = SysAllocString( sz );
00431     if ( *pbstrUIDOut == NULL )
00432     {
00433         hr = E_OUTOFMEMORY;
00434         STATUS_REPORT(
00435                   TASKID_Major_Find_Devices
00436                 , TASKID_Minor_StorageResource_GetUID_Memory
00437                 , IDS_ERROR_OUTOFMEMORY
00438                 , hr
00439                 );
00440     } // if:
00441
00442 Cleanup:
00443
00444     return hr;
00445
00446 } //*** CStorageResource::GetUID
00447
00448
00449 //////////////////////////////////////////////////////////////////////////////
00450 //++
00451 //
00452 //  CStorageResource::IsManaged
00453 //
00454 //  Description:
00455 //      Queries whether this resource is managed or not.
00456 //
00457 //  Arguments:
00458 //      None.
00459 //
00460 //  Return Value:
00461 //      S_OK    - Resource is managed.
00462 //      S_FALSE - Resource is not managed.
00463 //
00464 //--
00465 //////////////////////////////////////////////////////////////////////////////
00466 STDMETHODIMP
00467 CStorageResource::IsManaged( void )
00468 {
00469     HRESULT hr = S_OK;
00470
00471     if ( m_fIsManaged == FALSE )
00472     {
00473         hr = S_FALSE;
00474     } // if: this resource is not managed
00475
00476     return hr;
00477
00478 } //*** CStorageResource::IsManaged
00479
00480
00481 //////////////////////////////////////////////////////////////////////////////
00482 //++
00483 //
00484 //  CStorageResource::IsManagedByDefault
00485 //
00486 //  Description:
00487 //      Queries whether this resource is managed by default or not.
00488 //
00489 //  Arguments:
00490 //      None.
00491 //
00492 //  Return Value:
00493 //      S_OK    - Resource is managed by default.
00494 //      S_FALSE - Resource is not managed by default.
00495 //
00496 //--
00497 //////////////////////////////////////////////////////////////////////////////
00498 STDMETHODIMP
00499 CStorageResource::IsManagedByDefault( void )
00500 {
00501     HRESULT hr = S_OK;
00502
00503     if ( m_fIsManagedByDefault == FALSE )
00504     {
00505         hr = S_FALSE;
00506     } // if: this resource is not managed by default
00507
00508     return hr;
00509
00510 } //*** CStorageResource::IsManagedByDefault
00511
00512
00513 //////////////////////////////////////////////////////////////////////////////
00514 //++
00515 //
00516 //  CStorageResource::SetManaged
00517 //
00518 //  Description:
00519 //      Sets whether this resource is managed or not.
00520 //
00521 //  Arguments:
00522 //      fIsManagedIn    - TRUE = managed, FALSE = not managed
00523 //
00524 //  Return Value:
00525 //      S_OK    - Success
00526 //
00527 //--
00528 //////////////////////////////////////////////////////////////////////////////
00529 STDMETHODIMP
00530 CStorageResource::SetManaged(
00531     BOOL fIsManagedIn
00532     )
00533 {
00534     HRESULT hr = S_OK;
00535
00536     m_fIsManaged = fIsManagedIn;
00537
00538     LOG_STATUS_REPORT_STRING3(
00539                           L"%1!ws! resource '%2!ws!' '%3!ws!"
00540                         , GetResTypeName()
00541                         , ( m_bstrFriendlyName != NULL ) ? m_bstrFriendlyName : m_bstrName
00542                         , m_fIsManaged ? L"is managed" : L"is not managed"
00543                         , hr
00544                         );
00545     return hr;
00546
00547 } //*** CStorageResource::SetManaged
00548
00549
00550 //////////////////////////////////////////////////////////////////////////////
00551 //++
00552 //
00553 //  CStorageResource::SetManagedByDefault
00554 //
00555 //  Description:
00556 //      Sets whether this resource is managed by default or not.
00557 //
00558 //  Arguments:
00559 //      fIsManagedByDefaultIn   - TRUE = managed, FALSE = not managed
00560 //
00561 //  Return Value:
00562 //      S_OK    - Success
00563 //
00564 //--
00565 //////////////////////////////////////////////////////////////////////////////
00566 STDMETHODIMP
00567 CStorageResource::SetManagedByDefault(
00568     BOOL fIsManagedByDefaultIn
00569     )
00570 {
00571     HRESULT hr = S_OK;
00572
00573     m_fIsManagedByDefault = fIsManagedByDefaultIn;
00574
00575     LOG_STATUS_REPORT_STRING3(
00576                           L"%1!ws! resource '%2!ws!' '%3!ws!"
00577                         , GetResTypeName()
00578                         , ( m_bstrFriendlyName != NULL ) ? m_bstrFriendlyName : m_bstrName
00579                         , fIsManagedByDefaultIn ? L"is manageable" : L"is not manageable"
00580                         , hr
00581                         );
00582
00583     return hr;
00584
00585 } //*** CStorageResource::SetManagedByDefault
00586
00587
00588 //////////////////////////////////////////////////////////////////////////////
00589 //++
00590 //
00591 //  CStorageResource::IsQuorumCapable
00592 //
00593 //  Description:
00594 //      Queries whether this resource is suitable as a quorum resource or not.
00595 //
00596 //  Arguments:
00597 //      None.
00598 //
00599 //  Return Value:
00600 //      S_OK    - Resource can become quorum.
00601 //      S_FALSE - Resource cannot become quorum.
00602 //
00603 //--
00604 //////////////////////////////////////////////////////////////////////////////
00605 STDMETHODIMP
00606 CStorageResource::IsQuorumCapable( void )
00607 {
00608     HRESULT hr = S_OK;
00609
00610     if ( m_fIsQuorumCapable == FALSE )
00611     {
00612         hr = S_FALSE;
00613     } // if:
00614
00615     return hr;
00616
00617 } //*** CStorageResource::IsQuorumCapable
00618
00619
00620 //////////////////////////////////////////////////////////////////////////////
00621 //++
00622 //
00623 //  CStorageResource::SetQuorumCapable
00624 //
00625 //  Description:
00626 //      Sets whether the resource is quorum capable or not.  Unsupported.
00627 //
00628 //  Arguments:
00629 //      fIsQuorumCapableIn      - TRUE = quorum capable, FALSE = not qourum capable
00630 //
00631 //
00632 //  Return Value:
00633 //      S_OK
00634 //          Success
00635 //
00636 //      HRESULT_FROM_WIN32( ERROR_NOT_QUORUM_CAPABLE )
00637 //          Resource cannot become quorum.
00638 //
00639 //--
00640 //////////////////////////////////////////////////////////////////////////////
00641 STDMETHODIMP
00642 CStorageResource::SetQuorumCapable(
00643     BOOL fIsQuorumCapableIn
00644     )
00645 {
00646     HRESULT hr = S_OK;
00647
00648     m_fIsQuorumCapable = fIsQuorumCapableIn;
00649
00650     return hr;
00651
00652 } //*** CStorageResource::IsQuorumCapable
00653
00654
00655 //////////////////////////////////////////////////////////////////////////////
00656 //++
00657 //
00658 //  CStorageResource::IsQuorumResource
00659 //
00660 //  Description:
00661 //      Queries whether this resource is currently the quorum resource or not.
00662 //
00663 //  Arguments:
00664 //      None.
00665 //
00666 //  Return Value:
00667 //      S_OK    - This is the quorum resource.
00668 //      S_FALSE - This is not the quorum resource.
00669 //
00670 //--
00671 //////////////////////////////////////////////////////////////////////////////
00672 STDMETHODIMP
00673 CStorageResource::IsQuorumResource( void )
00674 {
00675     HRESULT hr = S_FALSE;
00676
00677     if ( m_fIsQuorumResource )
00678     {
00679         hr = S_OK;
00680     } // if:
00681
00682     return hr;
00683
00684 } //*** CStorageResource::IsQuorumResource
00685
00686
00687 //////////////////////////////////////////////////////////////////////////////
00688 //++
00689 //
00690 //  CStorageResource::SetQuorumResource
00691 //
00692 //  Description:
00693 //      Sets this resource's quorum status.
00694 //
00695 //  Arguments:
00696 //      fIsQuorumResourceIn
00697 //          TRUE = quorum resource
00698 //          FALSE = not quorum resource.
00699 //
00700 //  Return Value:
00701 //      S_OK
00702 //          Success
00703 //
00704 //      HRESULT_FROM_WIN32( ERROR_NOT_QUORUM_CAPABLE )
00705 //          Resource cannot become quorum.
00706 //
00707 //--
00708 //////////////////////////////////////////////////////////////////////////////
00709 STDMETHODIMP
00710 CStorageResource::SetQuorumResource(
00711     BOOL fIsQuorumResourceIn
00712     )
00713 {
00714     HRESULT hr = S_OK;
00715
00716     //
00717     //  Since no accurate determination can be made about a disk's quorum capability
00718     //  when the node that it's on does not hold the SCSI reservation and have access
00719     //  to the media we must blindly accept the input given...
00720     //
00721
00722     m_fIsQuorumResource = fIsQuorumResourceIn;
00723
00724     LOG_STATUS_REPORT_STRING3(
00725                           L"Setting %1!ws! resource '%2!ws!' '%3!ws!' the quorum device."
00726                         , GetResTypeName()
00727                         , ( m_bstrFriendlyName != NULL ) ? m_bstrFriendlyName : m_bstrDeviceID
00728                         , m_fIsQuorumResource ? L"to be" : L"to not be"
00729                         , hr
00730                         );
00731     return hr;
00732
00733 } //*** CStorageResource::SetQuorumResource
00734
00735
00736 //////////////////////////////////////////////////////////////////////////////
00737 // CStorageResource -- IClusCfgVerifyQuorum interface.
00738 //////////////////////////////////////////////////////////////////////////////
00739
00740
00741 //////////////////////////////////////////////////////////////////////////////
00742 //++
00743 //
00744 //  CStorageResource::IsMultiNodeCapable
00745 //
00746 //  Description:
00747 //      Called to determine if this quorum-capable resource allows other
00748 //      nodes to be added to the cluster to create a multi-node cluster.
00749 //
00750 //  Arguments:
00751 //      None.
00752 //
00753 //  Return Value:
00754 //      S_OK    - Resource can be used by more than one node.
00755 //      S_FALSE - Resource can be used by one node only.
00756 //
00757 //--
00758 //////////////////////////////////////////////////////////////////////////////
00759 STDMETHODIMP
00760 CStorageResource::IsMultiNodeCapable( void )
00761 {
00762     HRESULT hr = S_OK;
00763
00764     if ( m_fIsMultiNodeCapable == FALSE )
00765     {
00766         hr = S_FALSE;
00767     } // if: this resource can be used by one node only
00768
00769     return hr;
00770
00771 } //*** CStorageResource::IsMultiNodeCapable
00772
00773
00774 //////////////////////////////////////////////////////////////////////////////
00775 //++
00776 //
00777 //  CStorageResource::SetMultiNodeCapable
00778 //
00779 //  Description:
00780 //      Sets whether this quorum-capable resource can be used by more than
00781 //      one node.
00782 //
00783 //  Arguments:
00784 //      fMultiNodeCapableIn
00785 //          TRUE = multi-node capable
00786 //          FALSE = only single-node capable
00787 //
00788 //  Return Value:
00789 //      S_OK    - Multi-node capable
00790 //      S_FALSE - Not multi-node capable
00791 //
00792 //--
00793 //////////////////////////////////////////////////////////////////////////////
00794 STDMETHODIMP
00795 CStorageResource::SetMultiNodeCapable(
00796     BOOL fMultiNodeCapableIn
00797     )
00798 {
00799     HRESULT hr = S_FALSE;
00800
00801     UNREFERENCED_PARAMETER( fMultiNodeCapableIn );
00802
00803     return hr;
00804
00805 } //*** CStorageResource::SetMultiNodeCapable
00806
00807
00808 //////////////////////////////////////////////////////////////////////////////
00809 //++
00810 //
00811 //  CStorageResource::PrepareToHostQuorumResource
00812 //
00813 //  Description:
00814 //      This method is called when the implementing managed resource
00815 //      is the quorum resource.  This gives the implementer a chance
00816 //      to do anything required to ensure that this node can
00817 //      indeed host the quorum resource.
00818 //
00819 //      This method will be called after the SetResourcePrivateData()
00820 //      method of the IClusCfgManagedResourceData interface has been
00821 //      called. This allows the implementer to get the latest state data
00822 //      from a running instance of their resource.
00823 //
00824 //  Arguments:
00825 //      None.
00826 //
00827 //  Return Value:
00828 //      S_OK    Success.
00829 //      Other HRESULTs
00830 //
00831 //////////////////////////////////////////////////////////////////////////////
00832 STDMETHODIMP
00833 CStorageResource::PrepareToHostQuorumResource( void )
00834 {
00835     HRESULT hr = S_OK;
00836
00837     return hr;
00838
00839 } //*** CStorageResource::PrepareToHostQuorumResource
00840
00841
00842 //////////////////////////////////////////////////////////////////////////////
00843 //
00844 //  CStorageResource::Cleanup
00845 //
00846 //  Description:
00847 //      This method is called when a cluster configuration task is
00848 //      shutting down.  The reason for the shut down is passed in
00849 //      the cccrReasonIn parameter.
00850 //
00851 //      It is expected that any lingering changes made in
00852 //      PrepareToHostQuorumResource() would be undone when the
00853 //      reason code in not a success code.
00854 //
00855 //  Arguments:
00856 //      cccrReasonIn
00857 //          The reason that this method was called.  See
00858 //          EClusCfgCleanupReason for the complete list of possbile
00859 //          reason codes.
00860 //
00861 //  Return Values:
00862 //      S_OK    - Success.
00863 //      Other HRESULTs
00864 //
00865 //////////////////////////////////////////////////////////////////////////////
00866 STDMETHODIMP
00867 CStorageResource::Cleanup(
00868     EClusCfgCleanupReason cccrReasonIn
00869     )
00870 {
00871     HRESULT hr = S_OK;
00872
00873     UNREFERENCED_PARAMETER( cccrReasonIn );
00874
00875     return hr;
00876
00877 } //*** CStorageResource::Cleanup
00878
00879
00880 //////////////////////////////////////////////////////////////////////////////
00881 // CStorageResource -- IClusCfgManagedResourceCfg interface.
00882 //////////////////////////////////////////////////////////////////////////////
00883
00884
00885 //////////////////////////////////////////////////////////////////////////////
00886 //++
00887 //
00888 //  CStorageResource::PreCreate
00889 //
00890 //  Description:
00891 //      The PreCreate method is called by the post configuration manager to
00892 //      determine the requirements of the resource. Querying the
00893 //      punkServicesIn allows the managed resource to use services provided
00894 //      by the manager.
00895 //
00896 //  Arguments:
00897 //      punkServicesIn
00898 //          Interface used to query back for interfaces that provide cluster
00899 //          configuration services, e.g. IClusCfgResourcePreCreate.
00900 //
00901 //  Return Value:
00902 //      S_OK    - Success
00903 //      Other HRESULTs
00904 //
00905 //--
00906 //////////////////////////////////////////////////////////////////////////////
00907 STDMETHODIMP
00908 CStorageResource::PreCreate(
00909     IUnknown * punkServicesIn
00910     )
00911 {
00912     HRESULT                     hr = S_OK;
00913     IClusCfgResourcePreCreate * piccrpc = NULL;
00914     BSTR                        bstr = m_bstrFriendlyName != NULL ? m_bstrFriendlyName : m_bstrName;
00915     CLSID                       CLSID_Restype = RESTYPE_StorageResource;
00916
00917     //
00918     // First, query for the IClusCfgResourcePreCreate interface which will
00919     // provide all services that we need.
00920     //
00921
00922     hr = punkServicesIn->TypeSafeQI( IClusCfgResourcePreCreate, &piccrpc );
00923     if ( FAILED( hr ) )
00924     {
00925         goto Cleanup;
00926     } // if:
00927
00928     //
00929     // Then, set the resource type of this managed resource.
00930     //
00931     hr = piccrpc->SetType( &CLSID_Restype );
00932     if ( FAILED( hr ) )
00933     {
00934         goto Cleanup;
00935     } // if:
00936
00937     hr = piccrpc->SetClassType( (LPCLSID) &RESCLASSTYPE_StorageDevice );
00938     if ( FAILED( hr ) )
00939     {
00940         goto Cleanup;
00941     } // if:
00942
00943 #if 0 // test code only
00944     hr = piccrpc->SetDependency( (LPCLSID) &IID_NULL, dfSHARED );
00945     if ( FAILED( hr ) )
00946     {
00947         goto Cleanup;
00948     } // if:
00949 #endif // test code only
00950
00951 Cleanup:
00952
00953     if ( piccrpc != NULL )
00954     {
00955         piccrpc->Release();
00956         piccrpc = NULL;
00957     } // if:
00958
00959     STATUS_REPORT_STRING2(
00960               TASKID_Major_Configure_Resources
00961             , TASKID_Minor_StorageResource_PreCreate
00962             , IDS_INFO_DISK_PRECREATE
00963             , GetDisplayName()
00964             , bstr
00965             , hr
00966             );
00967
00968     return hr;
00969
00970 } //*** CStorageResource::PreCreate
00971
00972
00973 //////////////////////////////////////////////////////////////////////////////
00974 //++
00975 //
00976 //  CStorageResource::Create
00977 //
00978 //  Description:
00979 //      Called to have the component create a new resource instance.
00980 //
00981 //  Arguments:
00982 //      punkServicesIn
00983 //          Interface used to query back for interfaces that provide cluster
00984 //          configuration services, e.g. IClusCfgResourceCreate.
00985 //
00986 //  Return Value:
00987 //      S_OK    - Success
00988 //      Other HRESULTs
00989 //
00990 //--
00991 //////////////////////////////////////////////////////////////////////////////
00992 STDMETHODIMP
00993 CStorageResource::Create(
00994     IUnknown * punkServicesIn
00995     )
00996 {
00997     HRESULT hr = S_OK;
00998     IClusCfgResourceCreate *    piccrc = NULL;
00999     BSTR *                      pbstrName = m_bstrFriendlyName != NULL ? &m_bstrFriendlyName : &m_bstrName;
01000     CClusPropList               cpl;
01001     BSTR                        bstrDescription = NULL;
01002
01003     //
01004     // TODO: Add any code here to set default values for resource private
01005     // data.
01006     //
01007
01008     hr = punkServicesIn->TypeSafeQI( IClusCfgResourceCreate, &piccrc );
01009     if ( FAILED( hr ) )
01010     {
01011         goto Cleanup;
01012     } // if:
01013
01014     if ( m_dwSignature != 0 )
01015     {
01016         //
01017         // Set the private signature property on the resource.
01018         //
01019
01020         LOG_STATUS_REPORT_STRING2(
01021                   L"Setting signature to '%1!u!' on resource '%2!ws!'."
01022                 , m_dwSignature
01023                 , *pbstrName
01024                 , hr
01025                 );
01026         hr = piccrc->SetPropertyDWORD( L"Signature", m_dwSignature );
01027         if ( FAILED( hr ) )
01028         {
01029             goto Cleanup;
01030         } // if:
01031     } // if:
01032
01033     //
01034     // Set the description to indicate that this is the code that created the resource.
01035     //
01036
01037     hr = HrFormatStringIntoBSTR(
01038               IDS_RESOURCE_DESCRIPTION
01039             , &bstrDescription
01040             , L"MyStorageResource.dll"
01041             );
01042     if ( FAILED( hr ) )
01043     {
01044         goto Cleanup;
01045     } // if:
01046
01047     cpl.ScAddProp( L"Description", bstrDescription, NULL );
01048     LOG_STATUS_REPORT_STRING2(
01049               L"Setting description '%1!ws!' on resource '%2!ws!'."
01050             , bstrDescription
01051             , *pbstrName
01052             , hr
01053             );
01054     hr = piccrc->SendResourceControl(
01055               CLUSCTL_RESOURCE_SET_COMMON_PROPERTIES
01056             , cpl.Plist()
01057             , cpl.CbPropList()
01058             );
01059     if ( FAILED( hr ) )
01060     {
01061         goto Cleanup;
01062     } // if:
01063
01064 Cleanup:
01065
01066     STATUS_REPORT_STRING2(
01067               TASKID_Major_Configure_Resources
01068             , TASKID_Minor_StorageResource_Create
01069             , IDS_INFO_DISK_CREATE
01070             , GetDisplayName()
01071             , *pbstrName
01072             , hr
01073             );
01074
01075     SysFreeString( bstrDescription );
01076
01077     if ( piccrc != NULL )
01078     {
01079         piccrc->Release();
01080     } // if:
01081
01082     return hr;
01083
01084 } //*** CStorageResource::Create
01085
01086
01087 //////////////////////////////////////////////////////////////////////////////
01088 //++
01089 //
01090 //  CStorageResource::PostCreate
01091 //
01092 //  Description:
01093 //      Called to allow the component to configure a newly-created resource
01094 //      after all resources have been created.
01095 //
01096 //  Arguments:
01097 //    punkServicesIn
01098 //          Interface used to query back for interfaces that provide cluster
01099 //          configuration services, e.g. IClusCfgResourcePostCreate
01100 //
01101 //  Return Value:
01102 //      S_OK    - Success
01103 //      Other HRESULTs
01104 //
01105 //--
01106 //////////////////////////////////////////////////////////////////////////////
01107 STDMETHODIMP
01108 CStorageResource::PostCreate(
01109     IUnknown * punkServicesIn
01110     )
01111 {
01112     HRESULT hr = S_OK;
01113
01114     //
01115     // TODO: Add any code here for any post create actions that may be
01116     // necessary for the managed resource.
01117     //
01118     UNREFERENCED_PARAMETER( punkServicesIn );
01119
01120     return hr;
01121
01122 } //*** CStorageResource::PostCreate
01123
01124 //////////////////////////////////////////////////////////////////////////////
01125 //++
01126 //
01127 //  CStorageResource::Evict
01128 //
01129 //  Description:
01130 //      Called after the node has been evicted from the cluster to allow the
01131 //      component to perform any operations required to cleanup the
01132 //      application's cluster support.
01133 //
01134 //  Arguments:
01135 //      punkServicesIn
01136 //          Interface used to query back for interfaces that provide cluster
01137 //          configuration services.
01138 //
01139 //  Return Value:
01140 //      S_OK    - Success
01141 //      Other HRESULTs
01142 //
01143 //--
01144 //////////////////////////////////////////////////////////////////////////////
01145 STDMETHODIMP
01146 CStorageResource::Evict(
01147     IUnknown * punkServicesIn
01148     )
01149 {
01150     HRESULT hr = S_OK;
01151
01152     //
01153     // TODO: Add any code here that might be necessary on evicting a node
01154     // from a cluster.
01155     //
01156     UNREFERENCED_PARAMETER( punkServicesIn );
01157
01158     return hr;
01159
01160 } //*** CStorageResource::Evict
01161
01162
01163 //////////////////////////////////////////////////////////////////////////////
01164 // CStorageResource -- IClusCfgManagedResourceData interface.
01165 //////////////////////////////////////////////////////////////////////////////
01166
01167
01168 //////////////////////////////////////////////////////////////////////////////
01169 //++
01170 //
01171 //  CStorageResource::GetResourcePrivateData
01172 //
01173 //  Description:
01174 //      Get an already managed resource's private state data.  This
01175 //      data will then be passed to the instances of that resource on all
01176 //      nodes that are being added to the cluster.
01177 //
01178 //  Arguments:
01179 //      pbBufferOut
01180 //          Pointer to a buffer to contain the resource's private state data.
01181 //
01182 //      pcbBufferInout
01183 //          On input it is the size of the buffer.  On output it is the size
01184 //          of the data.
01185 //
01186 //  Return Value:
01187 //      S_OK
01188 //          Success.
01189 //
01190 //      S_FALSE
01191 //          Success, but no data available
01192 //
01193 //      ERROR_MORE_DATA as an HRESULT
01194 //          When the passed in buffer is too small to hold the data.
01195 //          pcbBufferOutIn will contain the size required.
01196 //
01197 //      Other HRESULTs.
01198 //          The call failed.
01199 //--
01200 //////////////////////////////////////////////////////////////////////////////
01201 STDMETHODIMP
01202 CStorageResource::GetResourcePrivateData(
01203       BYTE *    pbBufferOut
01204     , DWORD *   pcbBufferInout
01205     )
01206 {
01207     HRESULT hr = S_FALSE;
01208
01209     pcbBufferInout = 0;
01210     UNREFERENCED_PARAMETER( pbBufferOut );
01211
01212     return hr;
01213
01214 } //*** CStorageResource::GetResourcePrivateData
01215
01216
01217 //////////////////////////////////////////////////////////////////////////////
01218 //++
01219 //
01220 //  CStorageResource::SetResourcePrivateData
01221 //
01222 //  Description:
01223 //      Set the private resource data into this instance of a managed
01224 //      resource.
01225 //
01226 //  Arguments:
01227 //      pcbBufferIn
01228 //          Pointer to a buffer containing the resource's private data.
01229 //
01230 //      cbBufferIn
01231 //          The length in bytes of the data buffer.
01232 //
01233 //  Return Values:
01234 //      S_OK
01235 //          Success.
01236 //
01237 //      Other HRESULTs.
01238 //          The call failed.
01239 //
01240 //--
01241 //////////////////////////////////////////////////////////////////////////////
01242 STDMETHODIMP
01243 CStorageResource::SetResourcePrivateData(
01244       const BYTE *   pcbBufferIn
01245     , DWORD          cbBufferIn
01246     )
01247 {
01248     HRESULT hr = S_OK;
01249
01250     UNREFERENCED_PARAMETER( pcbBufferIn );
01251     UNREFERENCED_PARAMETER( cbBufferIn );
01252
01253     return hr;
01254
01255 } //*** CStorageResource::SetResourcePrivateData
01256
01257
01258 //////////////////////////////////////////////////////////////////////////////
01259 // CStorageResource -- IWMIService interface.
01260 //////////////////////////////////////////////////////////////////////////////
01261
01262
01263 //////////////////////////////////////////////////////////////////////////////
01264 //++
01265 //
01266 //  CStorageResource::SetWbemServices
01267 //
01268 //  Description:
01269 //      Set the WBEM services provider.
01270 //
01271 //  Arguments:
01272 //    IN  IWbemServices  pIWbemServicesIn
01273 //
01274 //  Return Value:
01275 //      S_OK
01276 //          Success
01277 //
01278 //      E_POINTER
01279 //          The pIWbemServicesIn param is NULL.
01280 //
01281 //  Remarks:
01282 //      None.
01283 //
01284 //--
01285 //////////////////////////////////////////////////////////////////////////////
01286 STDMETHODIMP
01287 CStorageResource::SetWbemServices(
01288     IWbemServices * pIWbemServicesIn
01289     )
01290 {
01291     HRESULT hr = S_OK;
01292
01293     if ( pIWbemServicesIn == NULL )
01294     {
01295         hr = E_POINTER;
01296         STATUS_REPORT(
01297                   TASKID_Major_Find_Devices
01298                 , TASKID_Minor_SetWbemServices_StorageResource
01299                 , IDS_ERROR_NULL_POINTER
01300                 , hr
01301                 );
01302         goto Cleanup;
01303     } // if:
01304
01305     m_pIWbemServices = pIWbemServicesIn;
01306     m_pIWbemServices->AddRef();
01307
01308 Cleanup:
01309
01310     return hr;
01311
01312 } //*** CStorageResource::SetWbemServices
01313
01314
01315 //////////////////////////////////////////////////////////////////////////////
01316 // CStorageResource -- IWMIObject interface.
01317 //////////////////////////////////////////////////////////////////////////////
01318
01319
01320 //////////////////////////////////////////////////////////////////////////////
01321 //++
01322 //
01323 //  CStorageResource::SetWbemObject
01324 //
01325 //  Description:
01326 //      Set the disk information information provider.
01327 //
01328 //  Arguments:
01329 //
01330 //  Return Value:
01331 //      S_OK
01332 //          Success
01333 //
01334 //  Remarks:
01335 //      None.
01336 //
01337 //--
01338 //////////////////////////////////////////////////////////////////////////////
01339 STDMETHODIMP
01340 CStorageResource::SetWbemObject(
01341       IWbemClassObject *    pDiskIn
01342     , BOOL *                pfRetainObjectOut
01343     )
01344 {
01345     assert( pDiskIn != NULL );
01346     assert( pfRetainObjectOut != NULL );
01347
01348     HRESULT hr = S_FALSE;
01349     VARIANT var;
01350     CLSID   clsidMinorId;
01351
01352     m_fIsQuorumCapable = TRUE;
01353     m_fIsMultiNodeCapable = TRUE;
01354
01355     VariantInit( &var );
01356
01357     hr = HrGetWMIProperty( pDiskIn, L"Name", VT_BSTR, &var );
01358     if ( FAILED( hr ) )
01359     {
01360         goto Cleanup;
01361     } // if:
01362
01363     hr = HrCreateFriendlyName( var.bstrVal );
01364     if ( FAILED( hr ) )
01365     {
01366         goto Cleanup;
01367     } // if:
01368
01369     VariantClear( &var );
01370
01371     hr = HrGetWMIProperty( pDiskIn, L"DeviceID", VT_BSTR, &var );
01372     if ( FAILED( hr ) )
01373     {
01374         goto Cleanup;
01375     } // if:
01376
01377     m_bstrDeviceID = SysAllocString( var.bstrVal );
01378     if (m_bstrDeviceID == NULL )
01379     {
01380         goto OutOfMemory;
01381     } // if:
01382
01383     VariantClear( &var );
01384
01385     hr = HrGetWMIProperty( pDiskIn, L"Description", VT_BSTR, &var );
01386     if ( FAILED( hr ) )
01387     {
01388         goto Cleanup;
01389     } // if:
01390
01391     m_bstrDescription = SysAllocString( var.bstrVal );
01392     if ( m_bstrDescription == NULL  )
01393     {
01394         goto OutOfMemory;
01395     } // if:
01396
01397     VariantClear( &var );
01398
01399     hr = HrGetWMIProperty( pDiskIn, L"SCSIBus", VT_I4, &var );
01400     if ( FAILED( hr ) )
01401     {
01402         goto Cleanup;
01403     } // if:
01404
01405     m_ulSCSIBus = var.lVal;
01406
01407     VariantClear( &var );
01408
01409     hr = HrGetWMIProperty( pDiskIn, L"SCSITargetId", VT_I4, &var );
01410     if ( FAILED( hr ) )
01411     {
01412         goto Cleanup;
01413     } // if:
01414
01415     m_ulSCSITid = var.lVal;
01416
01417     VariantClear( &var );
01418
01419     hr = HrGetWMIProperty( pDiskIn, L"SCSIPort", VT_I4, &var );
01420     if ( FAILED( hr ) )
01421     {
01422         goto Cleanup;
01423     } // if:
01424
01425     m_ulSCSIPort = var.lVal;
01426
01427     VariantClear( &var );
01428
01429     hr = HrGetWMIProperty( pDiskIn, L"SCSILogicalUnit", VT_I4, &var );
01430     if ( FAILED( hr ) )
01431     {
01432         goto Cleanup;
01433     } // if:
01434
01435     m_ulSCSILun = var.lVal;
01436
01437     VariantClear( &var );
01438
01439     hr = HrGetWMIProperty( pDiskIn, L"Index", VT_I4, &var );
01440     if ( FAILED( hr ) )
01441     {
01442         goto Cleanup;
01443     } // if:
01444
01445     m_idxDevice = var.lVal;
01446
01447     VariantClear( &var );
01448
01449     hr = HrGetWMIProperty( pDiskIn, L"Signature", VT_I4, &var );
01450     if ( hr == WBEM_E_NOT_FOUND )
01451     {
01452         //
01453         //  If the signature is not found then log it and let everything continue.
01454         //
01455
01456         LOG_STATUS_REPORT_STRING2(
01457                   L"%1!ws! resource '%2!ws!' does not have a signature property."
01458                 , GetResTypeName()
01459                 , m_bstrName
01460                 , hr
01461                 );
01462         var.lVal = 0L;
01463         hr = S_OK;
01464     } // if:
01465
01466     if ( FAILED( hr ) )
01467     {
01468         goto Cleanup;
01469     } // if:
01470
01471     //
01472     //  Did we actually get a value?  Could be VT_NULL to indicate that it is empty.
01473     //  We only want VT_I4 values...
01474     //
01475
01476     if ( var.vt == VT_I4 )
01477     {
01478         m_dwSignature = (DWORD) var.lVal;
01479     } // else if:
01480
01481     LOG_STATUS_REPORT_STRING3(
01482               L"%1!ws! resource '%2!ws!' has signature %3!x!."
01483             , GetResTypeName()
01484             , m_bstrName
01485             , m_dwSignature
01486             , hr
01487             );
01488
01489     if ( FAILED( hr ) )
01490     {
01491         STATUS_REPORT_STRING2_REF(
01492                   TASKID_Major_Find_Devices
01493                 , TASKID_Minor_StorageResource_Signature
01494                 , IDS_ERROR_DISK_SIGNATURE
01495                 , GetDisplayName()
01496                 , m_bstrName
01497                 , IDS_ERROR_DISK_SIGNATURE_REF
01498                 , hr
01499                 );
01500         goto Cleanup;
01501     } // if:
01502
01503     VariantClear( &var );
01504
01505     hr = HrGetPartitionInfo( pDiskIn, pfRetainObjectOut );
01506     if ( FAILED( hr ) )
01507     {
01508         goto Cleanup;
01509     } // if:
01510
01511     //
01512     //  HrGetPartitionInfo() returns S_FALSE when it cannot get the partition info for a disk.
01513     //  This is usually caused by the disk already being under ClusDisk control.  This is not
01514     //  an error, it just means we cannot query the partition or logical drive info.
01515     //
01516     if ( hr == S_OK )
01517     {
01518         hr = HrCreateFriendlyName();
01519         if ( FAILED( hr ) )
01520         {
01521             goto Cleanup;
01522         } // if:
01523
01524         //
01525         //  Since we have partition info we also have a signature and need to see if this
01526         //  disk is cluster capable.
01527
01528         hr = HrIsClusterCapable();
01529         if ( FAILED( hr ) )
01530         {
01531             goto Cleanup;
01532         } // if:
01533
01534         //
01535         //  If the disk is not cluster capable then we don't want the enumerator
01536         //  to keep it.
01537         //
01538         if ( hr == S_FALSE )
01539         {
01540             HRESULT hrTemp;
01541
01542             STATUS_REPORT(
01543                       TASKID_Major_Find_Devices
01544                     , TASKID_Minor_StorageResource_Cluster_Capable
01545                     , IDS_INFO_DISK_CLUSTER_CAPABLE
01546                     , hr
01547                     );
01548
01549             hrTemp = CoCreateGuid( &clsidMinorId );
01550             if ( FAILED( hrTemp ) )
01551             {
01552                 LOG_STATUS_REPORT(
01553                           L"Could not create a guid for a not cluster capable disk minor task ID"
01554                         , hrTemp
01555                         );
01556                 clsidMinorId = IID_NULL;
01557             } // if:
01558
01559             *pfRetainObjectOut = FALSE;
01560             STATUS_REPORT_STRING_REF(
01561                       TASKID_Minor_StorageResource_Cluster_Capable
01562                     , clsidMinorId
01563                     , IDS_INFO_DISK_NOT_CLUSTER_CAPABLE
01564                     , m_bstrFriendlyName
01565                     , IDS_INFO_DISK_NOT_CLUSTER_CAPABLE_REF
01566                     , hr
01567                     );
01568             LOG_STATUS_REPORT_STRING2(
01569                       L"The %1!ws! resource '%2!ws!' is not cluster capable"
01570                     , GetResTypeName()
01571                     , m_bstrFriendlyName
01572                     , hr
01573                     );
01574         } // if:
01575     } // if:
01576
01577     goto Cleanup;
01578
01579 OutOfMemory:
01580
01581     hr = E_OUTOFMEMORY;
01582     STATUS_REPORT(
01583               TASKID_Major_Find_Devices
01584             , TASKID_Minor_SetWbemObject_StorageResource
01585             , IDS_ERROR_OUTOFMEMORY
01586             , hr
01587             );
01588
01589 Cleanup:
01590
01591     VariantClear( &var );
01592
01593     return hr;
01594
01595 } //*** CStorageResource::SetWbemObject
01596
01597
01598 //////////////////////////////////////////////////////////////////////////////
01599 // CStorageResource -- IEnumClusCfgPartitions interface.
01600 //////////////////////////////////////////////////////////////////////////////
01601
01602
01603 //////////////////////////////////////////////////////////////////////////////
01604 //++
01605 //
01606 //  CStorageResource::Next
01607 //
01608 //  Description:
01609 //
01610 //
01611 //  Arguments:
01612 //
01613 //  Return Value:
01614 //      S_OK
01615 //          Success
01616 //
01617 //      E_POINTER
01618 //          The rgpPartitionInfoOut param is NULL.
01619 //
01620 //  Remarks:
01621 //      None.
01622 //
01623 //--
01624 //////////////////////////////////////////////////////////////////////////////
01625 STDMETHODIMP
01626 CStorageResource::Next(
01627       ULONG                       cNumberRequestedIn
01628     , IClusCfgPartitionInfo **    rgpPartitionInfoOut
01629     , ULONG *                     pcNumberFetchedOut
01630     )
01631 {
01632     HRESULT                 hr = S_FALSE;
01633     ULONG                   cFetched = 0;
01634     ULONG                   idx;
01635     IClusCfgPartitionInfo * piccpi = NULL;
01636
01637     if ( rgpPartitionInfoOut == NULL )
01638     {
01639         hr = E_POINTER;
01640         STATUS_REPORT_REF(
01641                   TASKID_Major_Find_Devices
01642                 , TASKID_Minor_Next_StorageResource
01643                 , IDS_ERROR_NULL_POINTER
01644                 , IDS_ERROR_NULL_POINTER_REF
01645                 , hr
01646                 );
01647         goto Cleanup;
01648     } // if:
01649
01650     if ( pcNumberFetchedOut != NULL )
01651     {
01652         *pcNumberFetchedOut = 0;
01653     } // if:
01654
01655     if ( m_prgPartitions == NULL )
01656     {
01657         LOG_STATUS_REPORT_MINOR_STRING(
01658                   TASKID_Minor_StorageResource_No_Partitions
01659                 , L"The %1!ws! resource type not have a partitions enumerator"
01660                 , GetDisplayName()
01661                 , hr
01662                 );
01663         goto Cleanup;
01664     } // if:
01665
01666     cFetched = min( cNumberRequestedIn, ( m_idxNextPartition - m_idxEnumPartitionNext ) );
01667
01668     for ( idx = 0; idx < cFetched; idx++, m_idxEnumPartitionNext++ )
01669     {
01670         hr = ((*m_prgPartitions)[ m_idxEnumPartitionNext ])->TypeSafeQI( IClusCfgPartitionInfo, &piccpi );
01671         if ( FAILED( hr ) )
01672         {
01673             LOG_STATUS_REPORT( L"CStorageResource::Next() could not query for IClusCfgPartitionInfo.", hr );
01674             break;
01675         } // if:
01676
01677         rgpPartitionInfoOut[ idx ] = piccpi;
01678     } // for:
01679
01680     if ( FAILED( hr ) )
01681     {
01682         ULONG   idxStop = idx;
01683
01684         m_idxEnumPartitionNext -= idx;
01685
01686         for ( idx = 0; idx < idxStop; idx++ )
01687         {
01688             (rgpPartitionInfoOut[ idx ])->Release();
01689         } // for:
01690
01691         cFetched = 0;
01692         goto Cleanup;
01693     } // if:
01694
01695     if ( pcNumberFetchedOut != NULL )
01696     {
01697         *pcNumberFetchedOut = cFetched;
01698     } // if:
01699
01700     if ( cFetched < cNumberRequestedIn )
01701     {
01702         hr = S_FALSE;
01703     } // if:
01704
01705 Cleanup:
01706
01707     return hr;
01708
01709 } //*** CStorageResource::Next
01710
01711
01712 //////////////////////////////////////////////////////////////////////////////
01713 //++
01714 //
01715 //  CStorageResource::Skip
01716 //
01717 //  Description:
01718 //
01719 //
01720 //  Arguments:
01721 //
01722 //  Return Value:
01723 //      S_OK
01724 //          Success
01725 //
01726 //  Remarks:
01727 //      None.
01728 //
01729 //--
01730 //////////////////////////////////////////////////////////////////////////////
01731 STDMETHODIMP
01732 CStorageResource::Skip(
01733     ULONG cNumberToSkipIn
01734     )
01735 {
01736     HRESULT hr = S_OK;
01737
01738     m_idxEnumPartitionNext += cNumberToSkipIn;
01739     if ( m_idxEnumPartitionNext > m_idxNextPartition )
01740     {
01741         m_idxEnumPartitionNext = m_idxNextPartition;
01742         hr = S_FALSE;
01743     } // if:
01744
01745     return hr;
01746
01747 } //*** CStorageResource::Skip
01748
01749
01750 //////////////////////////////////////////////////////////////////////////////
01751 //++
01752 //
01753 //  CStorageResource::Reset
01754 //
01755 //  Description:
01756 //
01757 //
01758 //  Arguments:
01759 //
01760 //  Return Value:
01761 //      S_OK
01762 //          Success
01763 //
01764 //  Remarks:
01765 //      None.
01766 //
01767 //--
01768 //////////////////////////////////////////////////////////////////////////////
01769 STDMETHODIMP
01770 CStorageResource::Reset( void )
01771 {
01772     HRESULT hr = S_OK;
01773
01774     m_idxEnumPartitionNext = 0;
01775
01776     return hr;
01777
01778 } //*** CStorageResource::Reset
01779
01780
01781 //////////////////////////////////////////////////////////////////////////////
01782 //++
01783 //
01784 //  CStorageResource::Clone
01785 //
01786 //  Description:
01787 //
01788 //
01789 //  Arguments:
01790 //
01791 //  Return Value:
01792 //      S_OK
01793 //          Success
01794 //
01795 //      E_POINTER
01796 //          The ppEnumClusCfgPartitionsOut param is NULL.
01797 //
01798 //  Remarks:
01799 //      None.
01800 //
01801 //--
01802 //////////////////////////////////////////////////////////////////////////////
01803 STDMETHODIMP
01804 CStorageResource::Clone(
01805     IEnumClusCfgPartitions ** ppEnumClusCfgPartitionsOut
01806     )
01807 {
01808     HRESULT hr = S_OK;
01809
01810     if ( ppEnumClusCfgPartitionsOut == NULL )
01811     {
01812         hr = E_POINTER;
01813         STATUS_REPORT_REF(
01814                   TASKID_Major_Find_Devices
01815                 , TASKID_Minor_Clone_StorageResource
01816                 , IDS_ERROR_NULL_POINTER
01817                 , IDS_ERROR_NULL_POINTER_REF
01818                 , hr
01819                 );
01820         goto Cleanup;
01821     } // if:
01822
01823     hr = E_NOTIMPL;
01824
01825 Cleanup:
01826
01827     return hr;
01828
01829 } //*** CStorageResource::Clone
01830
01831
01832 //////////////////////////////////////////////////////////////////////////////
01833 //++
01834 //
01835 //  CStorageResource::Count
01836 //
01837 //  Description:
01838 //
01839 //
01840 //  Arguments:
01841 //
01842 //  Return Value:
01843 //      S_OK
01844 //          Success
01845 //
01846 //      E_POINTER
01847 //          The pnCountOut param is NULL.
01848 //
01849 //  Remarks:
01850 //      None.
01851 //
01852 //--
01853 //////////////////////////////////////////////////////////////////////////////
01854 STDMETHODIMP
01855 CStorageResource::Count(
01856     DWORD * pnCountOut
01857     )
01858 {
01859     HRESULT hr = S_OK;
01860
01861     if ( pnCountOut == NULL )
01862     {
01863         hr = E_POINTER;
01864         goto Cleanup;
01865     } // if:
01866
01867     *pnCountOut = m_cPartitions;
01868
01869 Cleanup:
01870
01871     return hr;
01872
01873 } //*** CStorageResource::Count
01874
01875
01876 //////////////////////////////////////////////////////////////////////////////
01877 // CStorageResource class -- IStorageProperties interface.
01878 //////////////////////////////////////////////////////////////////////////////
01879
01880
01881 //////////////////////////////////////////////////////////////////////////////
01882 //++
01883 //
01884 //  CStorageResource::IsThisLogicalDisk
01885 //
01886 //  Description:
01887 //
01888 //  Arguments:
01889 //      None.
01890 //
01891 //  Return Value:
01892 //
01893 //
01894 //  Remarks:
01895 //      None.
01896 //
01897 //--
01898 //////////////////////////////////////////////////////////////////////////////
01899 STDMETHODIMP
01900 CStorageResource::IsThisLogicalDisk(
01901     WCHAR cLogicalDiskIn
01902     )
01903 {
01904     HRESULT                         hr = S_FALSE;
01905     ULONG                           idx;
01906     IPartitionProperties *          pipp = NULL;
01907
01908     for ( idx = 0; idx < m_idxNextPartition; idx++ )
01909     {
01910         hr = ( ((*m_prgPartitions)[ idx ])->TypeSafeQI( IPartitionProperties, &pipp ) );
01911         if ( FAILED( hr ) )
01912         {
01913             goto Cleanup;
01914         } // if:
01915
01916         hr = pipp->HrIsThisLogicalDisk( cLogicalDiskIn );
01917         if ( FAILED( hr ) )
01918         {
01919             goto Cleanup;
01920         } // if:
01921
01922         if ( hr == S_OK )
01923         {
01924             break;
01925         } // if:
01926
01927         pipp->Release();
01928         pipp = NULL;
01929     } // for:
01930
01931 Cleanup:
01932
01933     if ( pipp != NULL )
01934     {
01935         pipp->Release();
01936     } // if:
01937
01938     return hr;
01939
01940 } //*** CStorageResource::IsThisLogicalDisk
01941
01942
01943 //////////////////////////////////////////////////////////////////////////////
01944 //++
01945 //
01946 //  CStorageResource::HrGetSCSIBus
01947 //
01948 //  Description:
01949 //
01950 //  Arguments:
01951 //      None.
01952 //
01953 //  Return Value:
01954 //
01955 //
01956 //  Remarks:
01957 //      None.
01958 //
01959 //--
01960 //////////////////////////////////////////////////////////////////////////////
01961 STDMETHODIMP
01962 CStorageResource::HrGetSCSIBus(
01963     ULONG * pulSCSIBusOut
01964     )
01965 {
01966     HRESULT hr = S_OK;
01967
01968     if ( pulSCSIBusOut == NULL )
01969     {
01970         hr = E_POINTER;
01971         STATUS_REPORT_REF(
01972                   TASKID_Major_Find_Devices
01973                 , TASKID_Minor_HrGetSCSIBus
01974                 , IDS_ERROR_NULL_POINTER
01975                 , IDS_ERROR_NULL_POINTER_REF
01976                 , hr
01977                 );
01978         goto Cleanup;
01979     } // if:
01980
01981     *pulSCSIBusOut = m_ulSCSIBus;
01982
01983 Cleanup:
01984
01985     return hr;
01986
01987 } //*** CStorageResource::HrGetSCSIBus
01988
01989
01990 //////////////////////////////////////////////////////////////////////////////
01991 //++
01992 //
01993 //  CStorageResource::HrGetSCSIPort
01994 //
01995 //  Description:
01996 //
01997 //  Arguments:
01998 //      None.
01999 //
02000 //  Return Value:
02001 //
02002 //
02003 //  Remarks:
02004 //      None.
02005 //
02006 //--
02007 //////////////////////////////////////////////////////////////////////////////
02008 STDMETHODIMP
02009 CStorageResource::HrGetSCSIPort(
02010     ULONG * pulSCSIPortOut
02011     )
02012 {
02013     HRESULT hr = S_OK;
02014
02015     if ( pulSCSIPortOut == NULL )
02016     {
02017         hr = E_POINTER;
02018         STATUS_REPORT_REF(
02019                   TASKID_Major_Find_Devices
02020                 , TASKID_Minor_HrGetSCSIPort
02021                 , IDS_ERROR_NULL_POINTER
02022                 , IDS_ERROR_NULL_POINTER_REF
02023                 , hr
02024                 );
02025         goto Cleanup;
02026     } // if:
02027
02028     *pulSCSIPortOut = m_ulSCSIPort;
02029
02030 Cleanup:
02031
02032     return hr;
02033
02034 } //*** CStorageResource::HrGetSCSIPort
02035
02036
02037 //////////////////////////////////////////////////////////////////////////////
02038 //++
02039 //
02040 //  CStorageResource::HrGetDeviceID
02041 //
02042 //  Description:
02043 //
02044 //  Arguments:
02045 //      None.
02046 //
02047 //  Return Value:
02048 //
02049 //
02050 //  Remarks:
02051 //      None.
02052 //
02053 //--
02054 //////////////////////////////////////////////////////////////////////////////
02055 STDMETHODIMP
02056 CStorageResource::HrGetDeviceID(
02057     BSTR * pbstrDeviceIDOut
02058     )
02059 {
02060     assert( m_bstrDeviceID != NULL );
02061
02062     HRESULT hr = S_OK;
02063
02064     if ( pbstrDeviceIDOut == NULL )
02065     {
02066         hr = E_POINTER;
02067         STATUS_REPORT_REF(
02068                   TASKID_Major_Find_Devices
02069                 , TASKID_Minor_HrGetDeviceID_Pointer
02070                 , IDS_ERROR_NULL_POINTER
02071                 , IDS_ERROR_NULL_POINTER_REF
02072                 , hr
02073                 );
02074         goto Cleanup;
02075     } // if:
02076
02077     *pbstrDeviceIDOut = SysAllocString( m_bstrDeviceID );
02078     if ( *pbstrDeviceIDOut == NULL )
02079     {
02080         hr = E_OUTOFMEMORY;
02081         STATUS_REPORT_REF(
02082                   TASKID_Major_Find_Devices
02083                 , TASKID_Minor_HrGetDeviceID_Memory
02084                 , IDS_ERROR_OUTOFMEMORY
02085                 , IDS_ERROR_OUTOFMEMORY_REF
02086                 , hr
02087                 );
02088     } // if:
02089
02090 Cleanup:
02091
02092     return hr;
02093
02094 } //*** CStorageResource::HrGetDeviceID
02095
02096
02097 //////////////////////////////////////////////////////////////////////////////
02098 //++
02099 //
02100 //  CStorageResource::HrGetSignature
02101 //
02102 //  Description:
02103 //
02104 //  Arguments:
02105 //      None.
02106 //
02107 //  Return Value:
02108 //
02109 //
02110 //  Remarks:
02111 //      None.
02112 //
02113 //--
02114 //////////////////////////////////////////////////////////////////////////////
02115 STDMETHODIMP
02116 CStorageResource::HrGetSignature(
02117     DWORD * pdwSignatureOut
02118     )
02119 {
02120     assert( m_dwSignature != 0 );
02121
02122     HRESULT hr = S_OK;
02123
02124     if ( pdwSignatureOut == NULL )
02125     {
02126         hr = E_POINTER;
02127         STATUS_REPORT_REF(
02128                   TASKID_Major_Find_Devices
02129                 , TASKID_Minor_HrGetSignature_Pointer
02130                 , IDS_ERROR_NULL_POINTER
02131                 , IDS_ERROR_NULL_POINTER_REF
02132                 , hr
02133                 );
02134         goto Cleanup;
02135     } // if:
02136
02137     *pdwSignatureOut = m_dwSignature;
02138
02139 Cleanup:
02140
02141     return hr;
02142
02143 } //*** CStorageResource::HrGetSignature
02144
02145
02146 //////////////////////////////////////////////////////////////////////////////
02147 //++
02148 //
02149 //  CStorageResource::HrSetFriendlyName
02150 //
02151 //  Description:
02152 //
02153 //  Arguments:
02154 //
02155 //  Return Value:
02156 //
02157 //  Remarks:
02158 //      None.
02159 //
02160 //--
02161 //////////////////////////////////////////////////////////////////////////////
02162 STDMETHODIMP
02163 CStorageResource::HrSetFriendlyName(
02164     LPCWSTR pcszFriendlyNameIn
02165     )
02166 {
02167     HRESULT hr = S_OK;
02168     BSTR    bstr = NULL;
02169
02170     if ( pcszFriendlyNameIn == NULL )
02171     {
02172         hr = E_INVALIDARG;
02173         goto Cleanup;
02174     } // if:
02175
02176     bstr = SysAllocString( pcszFriendlyNameIn );
02177     if ( bstr == NULL )
02178     {
02179         hr = E_OUTOFMEMORY;
02180         STATUS_REPORT(
02181                   TASKID_Major_Find_Devices
02182                 , TASKID_Minor_HrSetFriendlyName_StorageResource
02183                 , IDS_ERROR_OUTOFMEMORY
02184                 , hr
02185                 );
02186         goto Cleanup;
02187     } // if:
02188
02189     SysFreeString( m_bstrFriendlyName );
02190     m_bstrFriendlyName = bstr;
02191
02192     LOG_STATUS_REPORT_STRING2(
02193               L"Setting %1!ws! resource friendly name to '%2!ws!'."
02194             , GetResTypeName()
02195             , m_bstrFriendlyName
02196             , hr
02197             );
02198
02199 Cleanup:
02200
02201     return hr;
02202
02203 } //*** CStorageResource::HrSetFriendlyName
02204
02205
02206 //////////////////////////////////////////////////////////////////////////////
02207 //++
02208 //
02209 //  CStorageResource::HrGetDeviceIndex
02210 //
02211 //  Description:
02212 //
02213 //  Arguments:
02214 //
02215 //  Return Value:
02216 //
02217 //  Remarks:
02218 //      None.
02219 //
02220 //--
02221 //////////////////////////////////////////////////////////////////////////////
02222 STDMETHODIMP
02223 CStorageResource::HrGetDeviceIndex(
02224     DWORD * pidxDeviceOut
02225     )
02226 {
02227     HRESULT hr = S_OK;
02228
02229     if ( pidxDeviceOut == NULL )
02230     {
02231         hr = E_POINTER;
02232         goto Cleanup;
02233     } // if:
02234
02235     *pidxDeviceOut = m_idxDevice;
02236
02237 Cleanup:
02238
02239     return hr;
02240
02241 } //*** CStorageResource::HrGetDeviceIndex
02242
02243
02244 //////////////////////////////////////////////////////////////////////////////
02245 //++
02246 //
02247 //  CStorageResource::CanBeManaged
02248 //
02249 //  Description:
02250 //
02251 //  Arguments:
02252 //
02253 //  Return Value:
02254 //      S_OK
02255 //          The device is managed.
02256 //
02257 //      S_FALSE
02258 //          The device is not managed.
02259 //
02260 //      Win32 error as HRESULT when an error occurs.
02261 //
02262 //  Remarks:
02263 //      None.
02264 //
02265 //--
02266 //////////////////////////////////////////////////////////////////////////////
02267 STDMETHODIMP
02268 CStorageResource::CanBeManaged( void )
02269 {
02270     HRESULT                         hr = S_OK;
02271     ULONG                           idx;
02272     IPartitionProperties *          pipp = NULL;
02273
02274     //
02275     //  Turn off the manageable state because this disk may already be managed by
02276     //  another node, or it may be RAW.
02277     //
02278
02279     m_fIsManagedByDefault = FALSE;
02280
02281     //
02282     //  A disk must have at least one NTFS partition in order to be a quorum
02283     //  resource.
02284     //
02285
02286     m_fIsQuorumCapable = FALSE;
02287     m_fIsMultiNodeCapable = FALSE;
02288
02289     //
02290     //  If this disk has no partitions then it may already be managed by
02291     //  another node, or it may be RAW.
02292     //
02293
02294     if ( m_idxNextPartition == 0 )
02295     {
02296         hr = S_FALSE;
02297         goto Cleanup;
02298     } // if:
02299
02300     //
02301     //  Enum the partitions and set the quorum capable flag if an NTFS
02302     //  partition is found.
02303     //
02304
02305     for ( idx = 0; idx < m_idxNextPartition; idx++ )
02306     {
02307         hr = ( ((*m_prgPartitions)[ idx ])->TypeSafeQI( IPartitionProperties, &pipp ) );
02308         if ( FAILED( hr ) )
02309         {
02310             goto Cleanup;
02311         } // if:
02312
02313         hr = pipp->HrIsNTFS();
02314         if ( hr == S_OK )
02315         {
02316             m_fIsQuorumCapable = TRUE;
02317             m_fIsMultiNodeCapable = TRUE;
02318             m_fIsManagedByDefault = TRUE;
02319             break;
02320         } // if:
02321
02322         pipp->Release();
02323         pipp = NULL;
02324     } // for:
02325
02326 Cleanup:
02327
02328     LOG_STATUS_REPORT_STRING3(
02329           L"%1!ws! resource '%2!ws!' %3!ws! quorum capable."
02330         , GetResTypeName()
02331         , ( ( m_bstrFriendlyName != NULL ) ? m_bstrFriendlyName : m_bstrName )
02332         , ( ( m_fIsQuorumCapable == TRUE ) ? L"is" : L"is NOT" )
02333         , hr
02334         );
02335
02336     if ( FAILED( hr ) )
02337     {
02338         LOG_STATUS_REPORT( L"CStorageResource::CanBeManaged failed.", hr );
02339     } // if:
02340
02341     if ( pipp != NULL )
02342     {
02343         pipp->Release();
02344     } // if:
02345
02346     return hr;
02347
02348 } //*** CStorageResource::CanBeManaged
02349
02350
02351 //////////////////////////////////////////////////////////////////////////////
02352 //++
02353 //
02354 //  CStorageResource::HrIsDynamicDisk
02355 //
02356 //  Description:
02357 //      Is this disk a "dynamic" disk?  Dynamic disks are those disks that
02358 //      contain LDM partitions.
02359 //
02360 //  Arguments:
02361 //      None.
02362 //
02363 //  Return Value:
02364 //      S_OK
02365 //          This is a dynamic disk.
02366 //
02367 //      S_FALSE
02368 //          This is not a dynamic disk.
02369 //
02370 //--
02371 //////////////////////////////////////////////////////////////////////////////
02372 STDMETHODIMP
02373 CStorageResource::HrIsDynamicDisk( void )
02374 {
02375     HRESULT hr = S_OK;
02376
02377     if ( m_fIsDynamicDisk == FALSE )
02378     {
02379         hr = S_FALSE;
02380     } // if:
02381
02382     return hr;
02383
02384 } //*** CStorageResource::HrIsDynamicDisk
02385
02386
02387 //////////////////////////////////////////////////////////////////////////////
02388 //++
02389 //
02390 //  CStorageResource::HrIsGPTDisk
02391 //
02392 //  Description:
02393 //      Is this disk a "GPT" disk?  GPT disks are those disks that
02394 //      contain GPT partitions.
02395 //
02396 //  Arguments:
02397 //      None.
02398 //
02399 //  Return Value:
02400 //      S_OK
02401 //          This is a GPT disk.
02402 //
02403 //      S_FALSE
02404 //          This is not a GPT disk.
02405 //
02406 //--
02407 //////////////////////////////////////////////////////////////////////////////
02408 STDMETHODIMP
02409 CStorageResource::HrIsGPTDisk( void )
02410 {
02411     HRESULT hr = S_OK;
02412
02413     if ( m_fIsGPTDisk == FALSE )
02414     {
02415         hr = S_FALSE;
02416     } // if:
02417
02418     return hr;
02419
02420 } //*** CStorageResource::HrIsGPTDisk
02421
02422
02423 //////////////////////////////////////////////////////////////////////////////
02424 //++
02425 //
02426 //  CStorageResource::HrGetDiskNames
02427 //
02428 //  Description:
02429 //      Get the names of this disk, both its friendly and device names.
02430 //
02431 //  Arguments:
02432 //      pbstrDiskNameOut
02433 //
02434 //      pbstrDeviceNameOut
02435 //
02436 //  Return Value:
02437 //      S_OK
02438 //          Success;
02439 //
02440 //      E_OUTOFMEMORY
02441 //
02442 //      E_POINTER
02443 //
02444 //--
02445 //////////////////////////////////////////////////////////////////////////////
02446 STDMETHODIMP
02447 CStorageResource::HrGetDiskNames(
02448       BSTR * pbstrDiskNameOut
02449     , BSTR * pbstrDeviceNameOut
02450     )
02451 {
02452     assert( m_bstrName != NULL );
02453     assert( m_bstrFriendlyName != NULL );
02454
02455     assert( pbstrDiskNameOut != NULL );
02456     assert( pbstrDeviceNameOut != NULL );
02457
02458     HRESULT hr = S_OK;
02459     BSTR    bstr = NULL;
02460
02461     if ( ( pbstrDiskNameOut == NULL ) || ( pbstrDeviceNameOut == NULL ) )
02462     {
02463         hr = E_POINTER;
02464         goto Cleanup;
02465     } // if:
02466
02467     bstr = SysAllocString( m_bstrFriendlyName );
02468     if ( bstr == NULL )
02469     {
02470         hr = E_OUTOFMEMORY;
02471         goto Cleanup;
02472     } // if:
02473
02474     *pbstrDiskNameOut = bstr;
02475     bstr = NULL;
02476
02477     bstr = SysAllocString( m_bstrName );
02478     if ( bstr == NULL )
02479     {
02480         hr = E_OUTOFMEMORY;
02481         goto Cleanup;
02482     } // if:
02483
02484     *pbstrDeviceNameOut = bstr;
02485     bstr = NULL;
02486
02487 Cleanup:
02488
02489     SysFreeString( bstr );
02490
02491     return hr;
02492
02493 } //*** CStorageResource::HrGetDiskNames
02494
02495
02496 //////////////////////////////////////////////////////////////////////////////
02497 //++
02498 //
02499 //  CStorageResource::HrGetPartitionInfo
02500 //
02501 //  Description:
02502 //      Gather the partition information.
02503 //
02504 //  Arguments:
02505 //      None.
02506 //
02507 //  Return Value:
02508 //
02509 //
02510 //  Remarks:
02511 //      None.
02512 //
02513 //--
02514 //////////////////////////////////////////////////////////////////////////////
02515 HRESULT
02516 CStorageResource::HrGetPartitionInfo(
02517       IWbemClassObject *    pDiskIn
02518     , BOOL *                pfRetainObjectOut
02519     )
02520 {
02521     assert( pDiskIn != NULL );
02522     assert( pfRetainObjectOut != NULL );
02523
02524     HRESULT                 hr;
02525     VARIANT                 var;
02526     VARIANT                 varDiskName;
02527     WCHAR                   szBuf[ 256 ];
02528     IEnumWbemClassObject *  pPartitions = NULL;
02529     IWbemClassObject *      pPartition = NULL;
02530     ULONG                   ulReturned;
02531     BSTR                    bstrQuery = NULL;
02532     BSTR                    bstrWQL = NULL;
02533     DWORD                   cPartitions;
02534
02535     UNREFERENCED_PARAMETER( pfRetainObjectOut );
02536
02537     bstrWQL = SysAllocString( L"WQL" );
02538     if ( bstrWQL == NULL )
02539     {
02540         hr = E_OUTOFMEMORY;
02541         STATUS_REPORT(
02542                   TASKID_Major_Find_Devices
02543                 , TASKID_Minor_HrGetPartitionInfo
02544                 , IDS_ERROR_OUTOFMEMORY
02545                 , hr
02546                 );
02547         goto Cleanup;
02548     } // if:
02549
02550     VariantInit( &var );
02551     VariantInit( &varDiskName );
02552
02553     //
02554     //  Need to enum the partition(s) of this disk to determine if it is booted
02555     //  bootable.
02556     //
02557     hr = HrGetWMIProperty( pDiskIn, L"DeviceID", VT_BSTR, &var );
02558     if ( FAILED( hr ) )
02559     {
02560         goto Cleanup;
02561     } // if:
02562
02563     hr = StringCchPrintfW(
02564                   szBuf
02565                 , RTL_NUMBER_OF( szBuf )
02566                 , L"Associators of {Win32_DiskDrive.DeviceID='%ws'} where AssocClass=Win32_DiskDriveToDiskPartition"
02567                 , var.bstrVal
02568                 );
02569     if ( FAILED( hr ) )
02570     {
02571         goto Cleanup;
02572     } // if:
02573
02574     bstrQuery = SysAllocString( szBuf );
02575     if ( bstrQuery == NULL )
02576     {
02577         hr = E_OUTOFMEMORY;
02578         STATUS_REPORT(
02579                   TASKID_Major_Find_Devices
02580                 , TASKID_Minor_HrGetPartitionInfo
02581                 , IDS_ERROR_OUTOFMEMORY
02582                 , hr
02583                 );
02584         goto Cleanup;
02585     } // if:
02586
02587     hr = m_pIWbemServices->ExecQuery(
02588               bstrWQL
02589             , bstrQuery
02590             , WBEM_FLAG_FORWARD_ONLY
02591             , NULL
02592             , &pPartitions
02593             );
02594     if ( FAILED( hr ) )
02595     {
02596         STATUS_REPORT_STRING_REF(
02597                 TASKID_Major_Find_Devices
02598                 , TASKID_Minor_WMI_DiskDrivePartitions_Qry_Failed
02599                 , IDS_ERROR_WMI_DISKDRIVEPARTITIONS_QRY_FAILED
02600                 , var.bstrVal
02601                 , IDS_ERROR_WMI_DISKDRIVEPARTITIONS_QRY_FAILED_REF
02602                 , hr
02603                 );
02604         goto Cleanup;
02605     } // if:
02606
02607     for ( cPartitions = 0; ; cPartitions++ )
02608     {
02609         hr = pPartitions->Next( WBEM_INFINITE, 1, &pPartition, &ulReturned );
02610         if ( ( hr == S_OK ) && ( ulReturned == 1 ) )
02611         {
02612
02613             hr = HrIsPartitionLDM( pPartition );
02614             if ( FAILED( hr ) )
02615             {
02616                 goto Cleanup;
02617             } // if:
02618
02619             //
02620             //  If the partition is logical disk manager (LDM)  then
02621             //  we cannot accept this disk therefore cannot manage it.
02622             //
02623
02624             if ( hr == S_OK )
02625             {
02626                 m_fIsDynamicDisk = TRUE;
02627             } // if:
02628
02629             hr = HrIsPartitionGPT( pPartition );
02630             if ( FAILED( hr ) )
02631             {
02632                 goto Cleanup;
02633             } // if:
02634
02635             if ( hr == S_OK )
02636             {
02637                 m_fIsGPTDisk = TRUE;
02638             } // if:
02639
02640             hr = HrCreatePartitionInfo( pPartition );
02641             if ( FAILED( hr ) )
02642             {
02643                 goto Cleanup;
02644             } // if:
02645
02646             pPartition->Release();
02647             pPartition = NULL;
02648         } // if:
02649         else if ( ( hr == S_FALSE ) && ( ulReturned == 0 ) )
02650         {
02651             break;
02652         } // else if:
02653         else
02654         {
02655             STATUS_REPORT_STRING_REF(
02656                       TASKID_Major_Find_Devices
02657                     , TASKID_Minor_WQL_Partition_Qry_Next_Failed
02658                     , IDS_ERROR_WQL_QRY_NEXT_FAILED
02659                     , bstrQuery
02660                     , IDS_ERROR_WQL_QRY_NEXT_FAILED_REF
02661                     , hr
02662                     );
02663             goto Cleanup;
02664         } // else:
02665     } // for:
02666
02667     //
02668     //  The enumerator can be empty because we cannot read the partition info from
02669     //  clustered disks.  If the enumerator was empty retain the S_FALSE, otherwise
02670     //  return S_OK if count is greater than 0.
02671     //
02672
02673     if ( cPartitions > 0 )
02674     {
02675         hr = S_OK;
02676     } // if:
02677     else
02678     {
02679         LOG_STATUS_REPORT_STRING2(
02680                   L"The %1!ws! resource '%2!ws!' does not have any partitions and will not be managed."
02681                 , GetResTypeName()
02682                 , var.bstrVal
02683                 , hr
02684                 );
02685         m_fIsManagedByDefault = FALSE;
02686     } // else:
02687
02688 Cleanup:
02689
02690     VariantClear( &var );
02691     VariantClear( &varDiskName );
02692
02693     SysFreeString( bstrQuery );
02694     SysFreeString( bstrWQL );
02695
02696     if ( pPartition != NULL )
02697     {
02698         pPartition->Release();
02699     } // if:
02700
02701     if ( pPartitions != NULL )
02702     {
02703         pPartitions->Release();
02704     } // if:
02705
02706     return hr;
02707
02708 } //*** CStorageResource::HrGetPartitionInfo
02709
02710
02711 //////////////////////////////////////////////////////////////////////////////
02712 //++
02713 //
02714 //  CStorageResource:HrCreatePartitionInfo
02715 //
02716 //  Description:
02717 //      Create a partition info from the passes in WMI partition.
02718 //
02719 //  Arguments:
02720 //
02721 //
02722 //  Return Value:
02723 //      S_OK
02724 //          Success
02725 //
02726 //      S_FALSE
02727 //          The file system was not NTFS.
02728 //
02729 //      E_OUTOFMEMORY
02730 //          Couldn't allocate memeory.
02731 //
02732 //  Remarks:
02733 //      None.
02734 //
02735 //--
02736 //////////////////////////////////////////////////////////////////////////////
02737 HRESULT
02738 CStorageResource::HrCreatePartitionInfo(
02739     IWbemClassObject * pPartitionIn
02740     )
02741 {
02742     assert( m_bstrDeviceID != NULL );
02743
02744     HRESULT                     hr = S_OK;
02745     IUnknown *                  punk = NULL;
02746     IWMIObject *                pimswo = NULL;
02747     IPartitionProperties *      pipp = NULL;
02748     BOOL                        fRetainObject = TRUE;
02749
02750     hr = CoCreateInstance(
02751               CLSID_CPartitionInfo
02752             , NULL
02753             , CLSCTX_INPROC_SERVER
02754             , IID_IUnknown
02755             , reinterpret_cast< void ** >( &punk )
02756             );
02757     if ( FAILED( hr ) )
02758     {
02759         goto Cleanup;
02760     } // if:
02761
02762     hr = punk->TypeSafeQI( IPartitionProperties, &pipp );
02763     if ( FAILED( hr ) )
02764     {
02765         goto Cleanup;
02766     } // if:
02767
02768     hr = pipp->HrSetDeviceID( m_bstrDeviceID );
02769     if ( FAILED( hr ) )
02770     {
02771         goto Cleanup;
02772     } // if:
02773
02774     hr = HrSetInitialize( punk, GetCallback(), GetLCID() );
02775     if ( FAILED( hr ) )
02776     {
02777         goto Cleanup;
02778     } // if:
02779
02780     hr = HrSetWbemServices( punk, m_pIWbemServices );
02781     if ( FAILED( hr ) )
02782     {
02783         goto Cleanup;
02784     } // if:
02785
02786     hr = punk->TypeSafeQI( IWMIObject, &pimswo );
02787     if ( FAILED( hr ) )
02788     {
02789         goto Cleanup;
02790     } // if:
02791
02792     hr = pimswo->SetWbemObject( pPartitionIn, &fRetainObject );
02793     if ( FAILED( hr ) )
02794     {
02795         goto Cleanup;
02796     } // if:
02797
02798     if ( fRetainObject )
02799     {
02800         hr = HrAddPartitionToArray( punk );
02801     } // if:
02802
02803 Cleanup:
02804
02805     if ( pipp != NULL )
02806     {
02807         pipp->Release();
02808     } // if:
02809
02810     if ( pimswo != NULL )
02811     {
02812         pimswo->Release();
02813     } // if:
02814
02815     if ( punk != NULL )
02816     {
02817         punk->Release();
02818     } // if:
02819
02820     return hr;
02821
02822 } //*** CStorageResource::HrCreatePartitionInfo
02823
02824
02825 //////////////////////////////////////////////////////////////////////////////
02826 //++
02827 //
02828 //  CStorageResource:HrAddPartitionToArray
02829 //
02830 //  Description:
02831 //      Add the passed in partition to the array of punks that holds the
02832 //      partitions.
02833 //
02834 //  Arguments:
02835 //
02836 //
02837 //  Return Value:
02838 //      S_OK
02839 //          Success
02840 //
02841 //      E_OUTOFMEMORY
02842 //          Couldn't allocate memeory.
02843 //
02844 //  Remarks:
02845 //      None.
02846 //
02847 //--
02848 //////////////////////////////////////////////////////////////////////////////
02849 HRESULT
02850 CStorageResource::HrAddPartitionToArray(
02851     IUnknown * punkIn
02852     )
02853 {
02854     HRESULT     hr = S_OK;
02855     IUnknown *  ((*prgpunks)[]) = NULL;
02856
02857     prgpunks = (IUnknown *((*)[])) HEAPREALLOC(
02858                       m_prgPartitions
02859                     , sizeof( IUnknown * ) * ( m_idxNextPartition + 1 )
02860                     , HEAP_ZERO_MEMORY
02861                     );
02862     if ( prgpunks == NULL )
02863     {
02864         hr = E_OUTOFMEMORY;
02865         STATUS_REPORT(
02866                   TASKID_Major_Find_Devices
02867                 , TASKID_Minor_HrAddPartitionToArray
02868                 , IDS_ERROR_OUTOFMEMORY
02869                 , hr
02870                 );
02871         goto Cleanup;
02872     } // if:
02873
02874     m_prgPartitions = prgpunks;
02875
02876     (*m_prgPartitions)[ m_idxNextPartition++ ] = punkIn;
02877     punkIn->AddRef();
02878     m_cPartitions += 1;
02879
02880 Cleanup:
02881
02882     return hr;
02883
02884 } //*** CStorageResource::HrAddPartitionToArray
02885
02886
02887 //////////////////////////////////////////////////////////////////////////////
02888 //++
02889 //
02890 //  CStorageResource:HrCreateFriendlyName
02891 //
02892 //  Description:
02893 //      Create a cluster friendly name.
02894 //
02895 //  Arguments:
02896 //
02897 //
02898 //  Return Value:
02899 //      S_OK
02900 //          Success
02901 //
02902 //      S_FALSE
02903 //          Success, but a friendly name could not be created.
02904 //
02905 //      E_OUTOFMEMORY
02906 //          Couldn't allocate memeory.
02907 //
02908 //  Remarks:
02909 //      None.
02910 //
02911 //--
02912 //////////////////////////////////////////////////////////////////////////////
02913 HRESULT
02914 CStorageResource::HrCreateFriendlyName( void )
02915 {
02916     HRESULT                         hr = S_FALSE;
02917     WCHAR *                         pwsz = NULL;
02918     WCHAR *                         pwszTmp = NULL;
02919     DWORD                           cch;
02920     DWORD                           idx;
02921     IPartitionProperties *          pipp = NULL;
02922     BSTR                            bstrName = NULL;
02923     BOOL                            fFoundLogicalDisk = FALSE;
02924     BSTR                            bstr = NULL;
02925     BSTR                            bstrDisk = NULL;
02926
02927     if ( m_idxNextPartition == 0 )
02928     {
02929         goto Cleanup;
02930     } // if:
02931
02932     hr = HrLoadStringIntoBSTR( IDS_DISK, &bstrDisk );
02933     if ( FAILED( hr ) )
02934     {
02935         goto Cleanup;
02936     } // if:
02937
02938     cch = (UINT) wcslen( bstrDisk ) + 1;
02939
02940     pwsz = new WCHAR[ cch ];
02941     if ( pwsz == NULL )
02942     {
02943         goto OutOfMemory;
02944     } // if:
02945
02946     hr = StringCchCopyW( pwsz, cch, bstrDisk );
02947     if ( FAILED( hr ) )
02948     {
02949         goto Cleanup;
02950     } // if:
02951
02952     for ( idx = 0; idx < m_idxNextPartition; idx++ )
02953     {
02954         hr = ((*m_prgPartitions)[ idx ])->TypeSafeQI( IPartitionProperties, &pipp );
02955         if ( FAILED( hr ) )
02956         {
02957             goto Cleanup;
02958         } // if:
02959
02960         hr = pipp->HrGetFriendlyName( &bstrName );
02961         if ( FAILED( hr ) )
02962         {
02963             goto Cleanup;
02964         } // if:
02965
02966         if ( hr == S_FALSE )
02967         {
02968             continue;
02969         } // if:
02970
02971         fFoundLogicalDisk = TRUE;
02972
02973         cch += (UINT) wcslen( bstrName ) + 1;
02974
02975         pwszTmp = new WCHAR[ cch ];
02976         if ( pwszTmp == NULL )
02977         {
02978             goto OutOfMemory;
02979         } // if:
02980
02981         hr = StringCchCopyW( pwszTmp, cch, pwsz );
02982         if ( FAILED( hr ) )
02983         {
02984             goto Cleanup;
02985         } // if:
02986
02987         delete [] pwsz;
02988
02989         pwsz = pwszTmp;
02990         pwszTmp = NULL;
02991
02992         hr = StringCchCatW( pwsz, cch, bstrName );
02993         if ( FAILED( hr ) )
02994         {
02995             goto Cleanup;
02996         } // if:
02997
02998         SysFreeString( bstrName );
02999         bstrName = NULL;
03000
03001         pipp->Release();
03002         pipp = NULL;
03003     } // for:
03004
03005     if ( !fFoundLogicalDisk )
03006     {
03007         // Ensure that that the caller doesn't fail since this is not a fatal error.
03008         hr = S_OK;
03009         goto Cleanup;
03010     } // if:
03011
03012     bstr = SysAllocString( pwsz );
03013     if ( bstr == NULL )
03014     {
03015         goto OutOfMemory;
03016     } // if:
03017
03018     SysFreeString( m_bstrFriendlyName );
03019     m_bstrFriendlyName = bstr;
03020     bstr = NULL;
03021
03022     goto Cleanup;
03023
03024 OutOfMemory:
03025
03026     hr = E_OUTOFMEMORY;
03027     STATUS_REPORT(
03028               TASKID_Major_Find_Devices
03029             , TASKID_Minor_HrCreateFriendlyName_VOID
03030             , IDS_ERROR_OUTOFMEMORY
03031             , hr
03032             );
03033
03034 Cleanup:
03035
03036     if ( pipp != NULL )
03037     {
03038         pipp->Release();
03039     } // if:
03040
03041     delete [] pwsz;
03042     delete [] pwszTmp;
03043
03044     SysFreeString( bstrName );
03045     SysFreeString( bstrDisk );
03046     SysFreeString( bstr );
03047
03048     return hr;
03049
03050 } //*** CStorageResource::HrCreateFriendlyName
03051
03052
03053 //////////////////////////////////////////////////////////////////////////////
03054 //++
03055 //
03056 //  CStorageResource:HrCreateFriendlyName
03057 //
03058 //  Description:
03059 //      Convert the WMI disk name into a more freindly version.
03060 //      Create a cluster friendly name.
03061 //
03062 //  Arguments:
03063 //
03064 //
03065 //  Return Value:
03066 //      S_OK
03067 //          Success
03068 //
03069 //      E_OUTOFMEMORY
03070 //          Couldn't allocate memeory.
03071 //
03072 //  Remarks:
03073 //      None.
03074 //
03075 //--
03076 //////////////////////////////////////////////////////////////////////////////
03077 HRESULT
03078 CStorageResource::HrCreateFriendlyName(
03079     BSTR bstrNameIn
03080     )
03081 {
03082     HRESULT hr = S_OK;
03083     WCHAR * pwsz = NULL;
03084     BSTR    bstr = NULL;
03085
03086     //
03087     //  Disk names in WMI start with "\\.\".  As a better and easy
03088     //  friendly name I am just going to trim these leading chars
03089     //  off.
03090     //
03091     pwsz = bstrNameIn + wcslen( L"\\\\.\\" );
03092
03093     bstr = SysAllocString( pwsz );
03094     if ( bstr == NULL )
03095     {
03096         hr =  E_OUTOFMEMORY;
03097         STATUS_REPORT(
03098                   TASKID_Major_Find_Devices
03099                 , TASKID_Minor_HrCreateFriendlyName_BSTR
03100                 , IDS_ERROR_OUTOFMEMORY
03101                 , hr
03102                 );
03103         goto Cleanup;
03104     } // if:
03105
03106     SysFreeString( m_bstrName );
03107     m_bstrName = bstr;
03108
03109 Cleanup:
03110
03111     return hr;
03112
03113 } //*** CStorageResource::HrCreateFriendlyName
03114
03115
03116 //////////////////////////////////////////////////////////////////////////////
03117 //++
03118 //
03119 //  CStorageResource:HrIsPartitionGPT
03120 //
03121 //  Description:
03122 //      Is the passed in partition a GPT partition.
03123 //
03124 //  Arguments:
03125 //
03126 //
03127 //  Return Value:
03128 //      S_OK
03129 //          The partition is a GPT partition.
03130 //
03131 //      S_FALSE
03132 //          The partition is not GPT.
03133 //
03134 //      E_OUTOFMEMORY
03135 //          Couldn't allocate memeory.
03136 //
03137 //  Remarks:
03138 //      If the type property of a Win32_DiskPartition starts with "GPT"
03139 //      then the whole spindle has GPT partitions.
03140 //
03141 //--
03142 //////////////////////////////////////////////////////////////////////////////
03143 HRESULT
03144 CStorageResource::HrIsPartitionGPT(
03145     IWbemClassObject * pPartitionIn
03146     )
03147 {
03148     HRESULT hr = S_OK;
03149     VARIANT var;
03150     WCHAR   szData[ 4 ];
03151     BSTR    bstrGPT = NULL;
03152
03153     VariantInit( &var );
03154
03155     hr = HrLoadStringIntoBSTR( IDS_GPT, &bstrGPT );
03156     if ( FAILED( hr ) )
03157     {
03158         goto Cleanup;
03159     } // if:
03160
03161     hr = HrGetWMIProperty( pPartitionIn, L"Type", VT_BSTR, &var );
03162     if ( FAILED( hr ) )
03163     {
03164         goto Cleanup;
03165     } // if:
03166
03167     //
03168     //  Get the fist three characters.  When the spindle has GPT partitions then
03169     //  these characters will be "GPT".  I am unsure if this will be localized.
03170     //
03171
03172     hr = StringCchCopyNW( szData, RTL_NUMBER_OF( szData ), var.bstrVal, 3 );
03173     if ( FAILED( hr ) )
03174     {
03175         goto Cleanup;
03176     } // if:
03177
03178     CharUpper( szData );
03179
03180     if ( NStringCompareW( szData, RTL_NUMBER_OF( szData ), bstrGPT, SysStringLen( bstrGPT ) ) != 0 )
03181     {
03182         hr = S_FALSE;
03183     } // if:
03184
03185 Cleanup:
03186
03187     VariantClear( &var );
03188
03189     SysFreeString( bstrGPT );
03190
03191     return hr;
03192
03193 } //*** CStorageResource::HrIsPartitionGPT
03194
03195
03196 //////////////////////////////////////////////////////////////////////////////
03197 //++
03198 //
03199 //  CStorageResource:HrIsPartitionLDM
03200 //
03201 //  Description:
03202 //      Is the passed in partition an LDM partition.
03203 //
03204 //  Arguments:
03205 //
03206 //
03207 //  Return Value:
03208 //      S_OK
03209 //          The partition is an LDM partition.
03210 //
03211 //      S_FALSE
03212 //          The partition is not LDM.
03213 //
03214 //      E_OUTOFMEMORY
03215 //          Couldn't allocate memeory.
03216 //
03217 //  Remarks:
03218 //      If the type property of a Win32_DiskPartition is "logical disk
03219 //      manager" then this disk is an LDM disk.
03220 //
03221 //--
03222 //////////////////////////////////////////////////////////////////////////////
03223 HRESULT
03224 CStorageResource::HrIsPartitionLDM(
03225     IWbemClassObject * pPartitionIn
03226     )
03227 {
03228     HRESULT hr = S_OK;
03229     VARIANT var;
03230     BSTR    bstrLDM = NULL;
03231
03232     VariantInit( &var );
03233
03234     hr = HrLoadStringIntoBSTR( IDS_LDM, &bstrLDM );
03235     if ( FAILED( hr ) )
03236     {
03237         goto Cleanup;
03238     } // if:
03239
03240     hr = HrGetWMIProperty( pPartitionIn, L"Type", VT_BSTR, &var );
03241     if ( FAILED( hr ) )
03242     {
03243         goto Cleanup;
03244     } // if:
03245
03246     CharUpper( var.bstrVal );
03247
03248     if ( NBSTRCompareW( var.bstrVal, bstrLDM ) != 0 )
03249     {
03250         hr = S_FALSE;
03251     } // if:
03252
03253 Cleanup:
03254
03255     VariantClear( &var );
03256
03257     SysFreeString( bstrLDM );
03258
03259     return hr;
03260
03261 } //*** CStorageResource::HrIsPartitionLDM
03262
03263
03264 //////////////////////////////////////////////////////////////////////////////
03265 //++
03266 //
03267 //  CStorageResource:HrIsClusterCapable
03268 //
03269 //  Description:
03270 //      Is this disk cluster capable?
03271 //
03272 //  Arguments:
03273 //      None.
03274 //
03275 //  Return Value:
03276 //      S_OK
03277 //          The disk is cluster capable.
03278 //
03279 //      S_FALSE
03280 //          The disk is not cluster capable.
03281 //
03282 //      E_OUTOFMEMORY
03283 //          Couldn't allocate memeory.
03284 //
03285 //  Remarks:
03286 //
03287 //--
03288 //////////////////////////////////////////////////////////////////////////////
03289 HRESULT
03290 CStorageResource::HrIsClusterCapable( void )
03291 {
03292     //
03293     // TODO: Determine whether this disk is cluster-capable.  You may need to
03294     //       send an IOCTL to the disk/miniport to determine this.
03295     //
03296
03297 //
03298 //  WARNING - this is clusdisk/physical disk specific from ddk\inc\scsi.h
03299 //
03300
03301 #define FILE_DEVICE_SCSI 0x0000001b
03302 #define IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE     ( ( FILE_DEVICE_SCSI << 16 ) + 0x0520 )
03303
03304     HRESULT         hr = S_FALSE;
03305     HANDLE          hSCSIPort = NULL;
03306     DWORD           dwSize;
03307     BOOL            fRet;
03308     WCHAR           szSCSIPort[ 32 ];
03309     SRB_IO_CONTROL  srb;
03310
03311     hr = StringCchPrintfW(
03312               szSCSIPort
03313             , RTL_NUMBER_OF( szSCSIPort )
03314             , L"\\\\.\\Scsi%d:"
03315             , m_ulSCSIPort
03316             );
03317     if ( FAILED( hr ) )
03318     {
03319         goto Cleanup;
03320     } // if:
03321
03322     //
03323     // get handle to disk
03324     //
03325
03326     hSCSIPort = CreateFileW(
03327                           szSCSIPort
03328                         , GENERIC_READ | GENERIC_WRITE
03329                         , FILE_SHARE_READ | FILE_SHARE_WRITE
03330                         , NULL
03331                         , OPEN_EXISTING
03332                         , FILE_ATTRIBUTE_NORMAL
03333                         , NULL
03334                         );
03335     if ( hSCSIPort == INVALID_HANDLE_VALUE )
03336     {
03337         hr = HRESULT_FROM_WIN32( GetLastError() );
03338         LOG_STATUS_REPORT_STRING( L"Failed to open device %1!ws!.", szSCSIPort, hr );
03339         goto Cleanup;
03340     } // if:
03341
03342 #define CLUSDISK_SRB_SIGNATURE "CLUSDISK"
03343
03344     ZeroMemory( &srb, sizeof( srb ) );
03345
03346     srb.HeaderLength = sizeof( srb );
03347
03348     assert( sizeof( srb.Signature ) <= sizeof( CLUSDISK_SRB_SIGNATURE ) );
03349     CopyMemory( srb.Signature, CLUSDISK_SRB_SIGNATURE, sizeof( srb.Signature ) );
03350
03351     srb.ControlCode = IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE;
03352
03353     //
03354     // issue mini port ioctl to determine whether the disk is cluster capable
03355     //
03356
03357     fRet = DeviceIoControl(
03358                           hSCSIPort
03359                         , IOCTL_SCSI_MINIPORT
03360                         , &srb
03361                         , sizeof( srb )
03362                         , NULL
03363                         , 0
03364                         , &dwSize
03365                         , NULL
03366                         );
03367     if ( !fRet )
03368     {
03369         hr = S_OK;
03370     } // if:
03371
03372 Cleanup:
03373
03374     if ( FAILED( hr ) )
03375     {
03376         CLSID   clsidMinorId;
03377         HRESULT hrTemp;
03378
03379         hrTemp = CoCreateGuid( &clsidMinorId );
03380         if ( FAILED( hrTemp ) )
03381         {
03382             LOG_STATUS_REPORT( L"Could not create a guid for a not cluster capable disk minor task ID", hrTemp );
03383             clsidMinorId = IID_NULL;
03384         } // if:
03385
03386         STATUS_REPORT_STRING2_REF(
03387                   TASKID_Minor_StorageResource_Cluster_Capable
03388                 , clsidMinorId
03389                 , IDS_ERROR_DISK_CLUSTER_CAPABLE
03390                 , m_bstrFriendlyName
03391                 , m_ulSCSIPort
03392                 , IDS_ERROR_DISK_CLUSTER_CAPABLE_REF
03393                 , hr
03394                 );
03395     } // if:
03396
03397     if ( hSCSIPort != NULL )
03398     {
03399         CloseHandle( hSCSIPort );
03400     } // if:
03401
03402     return hr;
03403
03404 } //*** CStorageResource::HrIsClusterCapable
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ADOStreamConstruction.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ADOStreamConstruction.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ADOStreamConstruction
00019 /** @com.interface(iid=00000568-0000-0010-8000-00AA006D2EA4, thread=AUTO) */
00020 public interface ADOStreamConstruction extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, addFlagsVtable=4)
00023       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00024   public IUnknown getStream();
00025
00026   /** @com.method(vtoffset=5, addFlagsVtable=4)
00027       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] ppStm) */
00028   public void setStream(IUnknown ppStm);
00029
00030
00031   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x568, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00032 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEditSessionBase Member List

This is the complete list of members for CEditSessionBase, including all inherited members.
_cRef | CEditSessionBase | [private]
_pContext | CEditSessionBase | [protected]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
DoEditSession(TfEditCookie ec)=0 | CEditSessionBase | [pure virtual]
DoEditSession(TfEditCookie ec)=0 | CEditSessionBase | [pure virtual]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/DsSrch/main.hxx Source File

  • NetDS
  • ADSI
  • samples
  • General
  • DsSrch

main.hxx

Go to the documentation of this file.
00001 #ifndef __MAIN_HXX
00002 #define __MAIN_HXX
00003
00004 //
00005 // System Includes
00006 //
00007
00008 #define UNICODE
00009 #define _UNICODE
00010 #define INC_OLE2
00011 #include <windows.h>
00012
00013 //
00014 // CRunTime Includes
00015 //
00016
00017 #include <stdlib.h>
00018 #include <limits.h>
00019 #include <io.h>
00020 #include <stdio.h>
00021 #include <stddef.h>
00022
00023
00024 //
00025 // Public ADs includes
00026 //
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 #include "activeds.h"
00033 #include "oledb.h"
00034 #include "oledberr.h"
00035
00036 #ifdef __cplusplus
00037 }
00038 #endif
00039
00040 #define NULL_TERMINATED 0
00041
00042 //
00043 // *********  Useful macros
00044 //
00045
00046 #define BAIL_ON_NULL(p)       \
00047         if (!(p)) {           \
00048                 goto error;   \
00049         }
00050
00051 #define BAIL_ON_FAILURE(hr)   \
00052         if (FAILED(hr)) {     \
00053                 goto error;   \
00054         }
00055
00056
00057 #define FREE_INTERFACE(pInterface) \
00058         if (pInterface) {          \
00059             pInterface->Release(); \
00060             pInterface=NULL;       \
00061         }
00062
00063
00064 #define ADS_FREE(pMem)     \
00065         if (pMem) {    \
00066             FreeADsMem(pMem); \
00067             pMem = NULL;     \
00068         }
00069
00070
00071 #define FREE_UNICODE_STRING(pMem)     \
00072         if (pMem) {    \
00073             FreeUnicodeString(pMem); \
00074             pMem = NULL;     \
00075         }
00076
00077
00078 void
00079 PrintColumn(
00080     PADS_SEARCH_COLUMN pColumn,
00081     LPWSTR pszColumnName
00082     );
00083
00084 int
00085 AnsiToUnicodeString(
00086     LPSTR pAnsi,
00087     LPWSTR pUnicode,
00088     DWORD StringLength
00089     );
00090
00091 LPWSTR
00092 AllocateUnicodeString(
00093     LPSTR  pAnsiString
00094     );
00095
00096 void
00097 FreeUnicodeString(
00098     LPWSTR  pUnicodeString
00099     );
00100
00101 void
00102 PrintUsage(
00103     void
00104     );
00105
00106
00107 HRESULT
00108 ProcessArgs(
00109     int argc,
00110     char * argv[]
00111     );
00112
00113
00114 LPWSTR
00115 RemoveWhiteSpaces(
00116     LPWSTR pszText
00117     );
00118
00119 #endif  // __MAIN_HXX
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/Eap/Eap.h Source File

  • NetDS
  • RRas
  • Eap

Eap.h

Go to the documentation of this file.
00001 /*
00002
00003 Copyright (c) 1997, Microsoft Corporation, all rights reserved
00004
00005 Description:
00006     Sample Extensible Authentication Protocol header file.
00007
00008 History:
00009
00010 */
00011
00012 #ifndef _EAP_H_
00013 #define _EAP_H_
00014
00015 #define PPP_EAP_PROTOCOL_ID 20  // This protocols Type Id
00016
00017 // Defines states within the this EAP protocol.
00018
00019 typedef enum _MYSTATE
00020 {
00021     MYSTATE_Initial,
00022     MYSTATE_WaitForUserOK,
00023     MYSTATE_WaitForRequest,
00024     MYSTATE_ReqSent,
00025     MYSTATE_WaitForAuthenticationToComplete,
00026     MYSTATE_Done
00027
00028 } MYSTATE;
00029
00030 typedef struct _EAPCB
00031 {
00032     MYSTATE             EapState;
00033     DWORD               fFlags;
00034     BOOL                fAuthenticator;
00035     LPVOID              pWorkBuffer;
00036     CHAR                aszIdentity[ UNLEN + 1 ];
00037     DWORD               dwIdExpected;
00038     CHAR                aszPassword[ PWLEN + 1 ];
00039     DWORD               dwResult;
00040     DWORD               dwInitialPacketId;
00041     BYTE*               pDataFromInteractiveUI;
00042     BYTE                bRecvPacketId;          //Special Id for Wireless case
00043                                                 //because it does not retransmit packets
00044     DWORD               dwSizeOfDataFromInteractiveUI;
00045     PBYTE               pUIContext;
00046     RAS_AUTH_ATTRIBUTE* pUserAttributes;
00047     RAS_AUTH_ATTRIBUTE* pMPPEKeyAttributes;    // MPPE key
00048
00049 } EAPCB;
00050
00051 typedef struct _EAP_NAME_DIALOG
00052 {
00053     WCHAR               awszIdentity[ UNLEN + 1 ];
00054     WCHAR               awszPassword[ PWLEN + 1 ];
00055
00056 } EAP_NAME_DIALOG;
00057
00058 // Globals
00059
00060 #ifdef RASEAPGLOBALS
00061
00062 DWORD        g_dwEapTraceId  = INVALID_TRACEID;
00063 HINSTANCE    g_hInstance     = NULL;
00064
00065 #else
00066
00067 extern DWORD        g_dwEapTraceId;
00068 extern HINSTANCE    g_hInstance;
00069
00070 #endif // RASEAPGLOBALS
00071
00072 // Function Prototypes
00073
00074 VOID
00075 EapTrace(
00076     IN  CHAR*   Format,
00077     ...
00078 );
00079
00080 DWORD APIENTRY
00081 EapBegin(
00082     OUT VOID** ppWorkBuf,
00083     IN  VOID*  pInfo
00084 );
00085
00086 DWORD APIENTRY
00087 EapEnd(
00088     IN VOID* pWorkBuf
00089 );
00090
00091 DWORD APIENTRY
00092 EapMakeMessage(
00093     IN  VOID*               pWorkBuf,
00094     IN  PPP_EAP_PACKET*     pReceiveBuf,
00095     OUT PPP_EAP_PACKET*     pSendBuf,
00096     IN  DWORD               cbSendBuf,
00097     OUT PPP_EAP_OUTPUT*     pResult,
00098     IN  PPP_EAP_INPUT*      pInput
00099 );
00100
00101 DWORD
00102 AuthenticateeMakeMessage(
00103     IN  EAPCB*              pwb,
00104     IN  PPP_EAP_PACKET*     pReceiveBuf,
00105     OUT PPP_EAP_PACKET*     pSendBuf,
00106     IN  DWORD               cbSendBuf,
00107     IN PPP_EAP_INPUT*       pInput,
00108     OUT  PPP_EAP_OUTPUT*    pResult
00109 );
00110
00111 DWORD
00112 AuthenticatorMakeMessage(
00113     IN  EAPCB*              pwb,
00114     IN  PPP_EAP_PACKET*     pReceiveBuf,
00115     OUT PPP_EAP_PACKET*     pSendBuf,
00116     IN  DWORD               cbSendBuf,
00117     IN PPP_EAP_INPUT*       pInput,
00118     OUT  PPP_EAP_OUTPUT*    pResult
00119 );
00120
00121 VOID
00122 MakeResponseMessage(
00123     IN  EAPCB*              pwb,
00124     IN  PPP_EAP_PACKET*     pReceiveBuf,
00125     OUT PPP_EAP_PACKET *    pSendBuf,
00126     IN DWORD                cbSendBuf
00127 );
00128
00129 VOID
00130 MakeResponseMessage1(
00131     IN  EAPCB*              pwb,
00132     OUT PPP_EAP_PACKET *    pSendBuf,
00133     IN DWORD                cbSendBuf
00134 );
00135
00136 VOID
00137 MakeResultMessage(
00138     IN  EAPCB *             pwb,
00139     IN  DWORD               dwError,
00140     OUT PPP_EAP_PACKET*     pSendBuf,
00141     IN  DWORD               cbSendBuf
00142 );
00143
00144 DWORD
00145 GetPasswordFromResponse(
00146     IN  PPP_EAP_PACKET*     pReceiveBuf,
00147     OUT CHAR*               pszUserName
00148 );
00149
00150 DWORD
00151 MakeAuthenticationAttributes(
00152     IN CHAR *   szUserName,
00153     IN CHAR *   szPassword,
00154     IN EAPCB *  pwb
00155 );
00156
00157 DWORD
00158 MakeMPPEKeyAttributes(
00159     IN EAPCB *  pwb
00160 );
00161
00162 DWORD
00163 GetIdentity(
00164     IN  HWND    hwndParent,
00165     IN  BYTE*   pUserDataIn,
00166     IN  DWORD   dwSizeOfUserDataIn,
00167     OUT BYTE**  ppUserDataOut,
00168     OUT DWORD*  pdwSizeOfUserDataOut,
00169     OUT WCHAR** ppwszIdentityOut
00170 );
00171
00172 VOID
00173 GetUsernameAndPassword(
00174     IN  HWND                hwndParent,
00175     IN  EAP_NAME_DIALOG*    pEapNameDialog
00176 );
00177
00178 INT_PTR CALLBACK
00179 UsernameDialogProc(
00180     IN  HWND    hWnd,
00181     IN  UINT    unMsg,
00182     IN  WPARAM  wParam,
00183     IN  LPARAM  lParam
00184 );
00185
00186 BOOL
00187 InitUsernameDialog(
00188     IN  HWND    hWnd,
00189     IN  LPARAM  lParam
00190 );
00191
00192 BOOL
00193 UsernameCommand(
00194     IN  EAP_NAME_DIALOG*    pEapNameDialog,
00195     IN  WORD                wId,
00196     IN  HWND                hWndDlg
00197 );
00198
00199 #endif // _EAP_H_
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Ping/resolve.h Source File

  • NetDS
  • WinSock
  • Ping

resolve.h

Go to the documentation of this file.
00001 // From Network Programming for Microsoft Windows, Second Edition by
00002 // Anthony Jones and James Ohlund.
00003 // Copyright 2002.   Reproduced by permission of Microsoft Press.
00004 // All rights reserved.
00005 //
00006 //
00007 // Common routines for resolving addresses and hostnames
00008 //
00009 // Files:
00010 //      resolve.h       - Header file for common routines
00011 //
00012 // Description:
00013 //      This file contains common name resolution and name printing
00014 //      routines and is used by many of the samples on this CD.
00015 //
00016 // Compile:
00017 //      See ping.cpp
00018 //
00019 // Usage:
00020 //      See ping.cpp
00021 //
00022 #ifndef _RESOLVE_H_
00023 #define _RESOLVE_H_
00024
00025 #ifdef _cplusplus
00026 extern "C" {
00027 #endif
00028
00029 int              PrintAddress(SOCKADDR *sa, int salen);
00030 int              FormatAddress(SOCKADDR *sa, int salen, char *addrbuf, int addrbuflen);
00031 int              ReverseLookup(SOCKADDR *sa, int salen, char *namebuf, int namebuflen);
00032 struct addrinfo *ResolveAddress(char *addr, char *port, int af, int type, int proto);
00033
00034 #ifdef _cplusplus
00035 }
00036 #endif
00037
00038 #endif
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/MainWND.c Source File

  • Multimedia
  • Audio
  • MidiPlyr

MainWND.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 * MainWnd.C
00013 *
00014 * Message handlers and UI for the main window and associated controls
00015 *
00016 *****************************************************************************/
00017
00018 #pragma warning(disable:4756)
00019
00020 #define _INC_SHELLAPI
00021 #include <windows.h>
00022 #undef _INC_SHELLAPI
00023
00024 #include <shellapi.h>
00025 #include <windowsx.h>
00026 #include <mmsystem.h>
00027 #include <commdlg.h>
00028 #include <commctrl.h>
00029 #include <ctype.h>
00030
00031 #include "debug.h"
00032
00033 #include "MIDIPlyr.H"
00034
00035 #define BITMAP_COUNT    6           /* Number of buttons in bitmap */
00036
00037 PRIVATE HWND            ghWndToolbar                    = NULL;
00038 PRIVATE HWND            ghWndStatus                     = NULL;
00039 PRIVATE HWND            ghWndTime                       = NULL;
00040 PRIVATE char            gszAppTitle[80]                 = "";
00041 PRIVATE int             gnSB_TFPaneSize                 = 0;
00042 PRIVATE char            gszOpenName[MAX_FILEPATH]       = "";
00043 PRIVATE char            gszOpenTitle[MAX_FILEPATH]      = "";
00044 PRIVATE char BCODE      gszFilter[]                      =
00045     "MIDI File (*.MID;*.RMI)\0*.MID;*.RMI\0"
00046     "All Files (*.*)\0*.*\0";
00047
00048 PRIVATE char BCODE      gszDefExtension[]               = "MID";
00049 PRIVATE BOOL            gbAutoPlay                      = TRUE;
00050 PRIVATE UINT            guDevice                        = 0;
00051
00052 PRIVATE TBBUTTON gatbButton[] =
00053 {
00054     {0, -1,             TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0,  0, -1},
00055     {0, IDM_OPEN,       TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0,  0, -1},
00056     {0, -1,             TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0,  0, -1},
00057     {2, IDM_PLAY,       0,               TBSTYLE_BUTTON, 0, 0,  0, -1},
00058     {3, IDM_STOP,       0,               TBSTYLE_BUTTON, 0, 0,  0, -1},
00059     {4, IDM_PAUSE,      0,               TBSTYLE_BUTTON, 0, 0,  0, -1},
00060 };
00061
00062 #define BUTTON_COUNT (sizeof(gatbButton)/sizeof(gatbButton[0]))
00063
00064 PRIVATE VOID FNLOCAL InitToolbar(HWND hWnd);
00065 PRIVATE VOID FNLOCAL InitStatusBar(HWND hWnd);
00066 PRIVATE VOID FNLOCAL ResizeStatusBar(HWND hWnd);
00067 PRIVATE VOID FNLOCAL SyncUI(HWND hWnd);
00068 PRIVATE VOID FNLOCAL SetOneAction(HWND hWnd, int nMenuID, BOOL fEnable);
00069 PRIVATE VOID FNLOCAL AttemptFileOpen(HWND hWnd);
00070 PRIVATE BOOL FNLOCAL PrerollAndWait(HWND hWnd);
00071
00072 PRIVATE BOOL FNLOCAL MWnd_OnCreate(HWND hWnd, CREATESTRUCT FAR* lpCreateStruct);
00073 PRIVATE VOID FNLOCAL MWnd_OnGetMinMaxInfo(HWND hWnd, MINMAXINFO FAR* lpMinMaxInfo);
00074 PRIVATE VOID FNLOCAL MWnd_OnSize(HWND hWnd, UINT state, int cx, int cy);
00075 PRIVATE VOID FNLOCAL MWnd_OnPaint(HWND hWnd);
00076 PRIVATE VOID FNLOCAL MWnd_OnDropFiles(HWND hWnd, HDROP hDrop);
00077 PRIVATE VOID FNLOCAL MWnd_OnFileOpen(HWND hWnd);
00078 PRIVATE VOID FNLOCAL MWnd_OnCommandToggleChild(HWND hWnd, UINT id);
00079 PRIVATE VOID FNLOCAL MWnd_OnCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify);
00080 PRIVATE VOID FNLOCAL MWnd_OnDestroy(HWND hWnd);
00081
00082 /*****************************************************************************
00083 *
00084 * InitToolbar
00085 *
00086 * Called to create the toolbar
00087 *
00088 * HWND hWnd                 - Application window which toolbar is a child of
00089 *
00090 * Create and show the toolbar window.
00091 *
00092 *****************************************************************************/
00093 PRIVATE VOID FNLOCAL InitToolbar(
00094     HWND                    hWnd)
00095 {
00096     ghWndToolbar = CreateToolbarEx(hWnd,
00097                                    WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN,
00098                                    IDC_TOOLBAR,
00099                                    BITMAP_COUNT,
00100                                    ghInst,
00101                                    IDB_TOOLBAR,
00102                                    gatbButton,
00103                                    BUTTON_COUNT,
00104                                    0,  0,
00105                                    0,  0,
00106                                    sizeof(TBBUTTON));
00107
00108     if (ghWndToolbar)
00109         ShowWindow(ghWndToolbar, SW_RESTORE);
00110 }
00111
00112 /*****************************************************************************
00113 *
00114 * InitStatusBar
00115 *
00116 * Called to create the status bar
00117 *
00118 * HWND hWnd                 - Application window which status bar is a child of
00119 *
00120 * Create and show the status window.
00121 *
00122 *****************************************************************************/
00123 PRIVATE VOID FNLOCAL InitStatusBar(
00124     HWND                    hWnd)
00125 {
00126     HWND                    hWndDesktop;
00127     HFONT                   hFontStat;
00128     HDC                     hDC;
00129     UINT                    idx;
00130     SIZE                    size;
00131
00132     ghWndStatus = CreateStatusWindow(WS_CHILD|SBARS_SIZEGRIP,
00133                                      "",
00134                                      hWnd,
00135                                      IDC_STATBAR);
00136
00137     if (ghWndStatus)
00138     {
00139         hWndDesktop = GetDesktopWindow();
00140         hFontStat = (HFONT)SendMessage(ghWndStatus, WM_GETFONT, 0, 0L);
00141         hDC = GetDC(hWndDesktop);
00142
00143         if (hFontStat != (HFONT)NULL && hDC != (HDC)NULL)
00144         {
00145             hFontStat = (HFONT)SelectObject(hDC, hFontStat);
00146
00147             gnSB_TFPaneSize = 0;
00148             for (idx = 0; idx < N_TIME_FORMATS; idx++)
00149             {
00150                 GetTextExtentPoint(hDC,
00151                                    grgszTimeFormats[idx],
00152                                    lstrlen(grgszTimeFormats[idx]),
00153                                    &size);
00154
00155                 gnSB_TFPaneSize = max(gnSB_TFPaneSize, size.cx);
00156             }
00157
00158             SelectObject(hDC, hFontStat);
00159
00160             gnSB_TFPaneSize *= 2;
00161         }
00162
00163         if (hDC != (HDC)NULL)
00164             ReleaseDC(hWndDesktop, hDC);
00165
00166         ResizeStatusBar(hWnd);
00167
00168         FORWARD_WM_COMMAND(hWnd, gnTimeFormat, 0, 0, SendMessage);
00169         ShowWindow(ghWndStatus, SW_RESTORE);
00170     }
00171 }
00172
00173 /*****************************************************************************
00174 *
00175 * ResizeStatusBar
00176 *
00177 * Force the status bar to resize to fit in the main window
00178 *
00179 * HWND hWnd                 - Application window which status bar is a child of
00180 *
00181 * Figure out the pane sizes and send a message to the status bar to set them.
00182 *
00183 *****************************************************************************/
00184 PRIVATE VOID FNLOCAL ResizeStatusBar(
00185     HWND                    hWnd)
00186 {
00187     RECT                    rc;
00188     int                     rnPaneEdge[SB_N_PANES];
00189
00190     GetClientRect(hWnd, &rc);
00191
00192     /* SB_SETPARTS expects:
00193     **  wParam == Number of panes in status bar.
00194     **  lParam == Pointer to an array of int's indicating the right-hand
00195     **            coordinate of each pane.
00196     */
00197     rnPaneEdge[SB_PANE_STATE] = rc.right - gnSB_TFPaneSize;
00198     rnPaneEdge[SB_PANE_TFMT]  = -1;
00199
00200     SendMessage(ghWndStatus,
00201                 SB_SETPARTS,
00202                 SB_N_PANES,
00203                 (DWORD)(INT_PTR)(rnPaneEdge));
00204 }
00205
00206 /*****************************************************************************
00207 *
00208 * SyncUI
00209 *
00210 * Bring all UI elements into sync with the state of the sequencer
00211 *
00212 * HWND hWnd                 - Application main window
00213 *
00214 * Build a flag word of the actions which are allowed from the current state.
00215 * Set the menu items and toolbar buttons for each action appropriately.
00216 * Show the current state as a string in the status bar.
00217 * Depress the pause button if the sequencer is paused.
00218 * Cause the time window to update.
00219 *
00220 *****************************************************************************/
00221 #define SUI_F_CANPLAY       0x0001
00222 #define SUI_F_CANPAUSE      0x0002
00223 #define SUI_F_CANSTOP       0x0004
00224 #define SUI_F_CANSELDEVICE  0x0008
00225
00226 PRIVATE VOID FNLOCAL SyncUI(
00227     HWND                    hWnd)
00228 {
00229     WORD                    wActionFlags;
00230     UINT                    uState;
00231     char                    szState[40];
00232     BOOL                    fPress;
00233
00234     wActionFlags = 0;
00235     uState = SEQ_S_NOFILE;
00236
00237     if (gpSeq != NULL)
00238     {
00239         uState = gpSeq->uState;
00240         switch (uState)
00241         {
00242         case SEQ_S_NOFILE:
00243             wActionFlags = SUI_F_CANSELDEVICE;
00244             break;
00245
00246         case SEQ_S_OPENED:
00247         case SEQ_S_PREROLLED:
00248             wActionFlags = SUI_F_CANPLAY|SUI_F_CANSELDEVICE;
00249             break;
00250
00251         case SEQ_S_PAUSED:
00252         case SEQ_S_PLAYING:
00253             wActionFlags = SUI_F_CANPAUSE|SUI_F_CANSTOP;
00254             break;
00255
00256
00257         case SEQ_S_PREROLLING:
00258         case SEQ_S_STOPPING:
00259 //            assert(0);
00260             wActionFlags = 0;
00261             break;
00262         }
00263     }
00264
00265     fPress = (gpSeq->uState == SEQ_S_PAUSED);
00266     SendMessage(ghWndToolbar,
00267                 TB_PRESSBUTTON,
00268                 IDM_PAUSE,
00269                 fPress);
00270
00271     SetOneAction(hWnd, IDM_PLAY,   wActionFlags & SUI_F_CANPLAY);
00272     SetOneAction(hWnd, IDM_PAUSE,  wActionFlags & SUI_F_CANPAUSE);
00273     SetOneAction(hWnd, IDM_STOP,   wActionFlags & SUI_F_CANSTOP);
00274
00275     EnableMenuItem(GetMenu(hWnd),
00276                    POS_PLAYTHRU,
00277                    MF_BYPOSITION|((wActionFlags & SUI_F_CANSELDEVICE) ? MF_ENABLED : MF_DISABLED));
00278
00279     DrawMenuBar(hWnd);
00280
00281     szState[0] = '\0';
00282     LoadString(ghInst, IDS_STATES + uState, szState, sizeof(szState));
00283     SendMessage(ghWndStatus, SB_SETTEXT, SB_PANE_STATE, (LPARAM)(LPSTR)szState);
00284
00285     InvalidateRect(ghWndTime, NULL, TRUE);
00286 }
00287
00288 /*****************************************************************************
00289 *
00290 * SetOneAction
00291 *
00292 * Update the state of one action in both the toolbar and action menu
00293 *
00294 * HWND hWnd                 - Application main window
00295 * int nMenuID               - Menu ID of action
00296 * BOOL fEnable              - Enable or disable this action
00297 *
00298 *****************************************************************************/
00299 PRIVATE VOID FNLOCAL SetOneAction(
00300     HWND                hWnd,
00301     int                 nMenuID,
00302     BOOL                fEnable)
00303 {
00304     EnableMenuItem(GetMenu(hWnd),
00305                    nMenuID,
00306                    MF_BYCOMMAND|(fEnable ? MF_ENABLED : MF_DISABLED));
00307
00308     SendMessage(ghWndToolbar,
00309                 TB_ENABLEBUTTON,
00310                 nMenuID,
00311                 (DWORD)fEnable);
00312 }
00313
00314 /*****************************************************************************
00315 *
00316 * AttemptFileOpen
00317 *
00318 * Try to open the given file in the sequencer.
00319 *
00320 * HWND hWnd                 - Application main window
00321 *
00322 * Stop and close the current file.
00323 * Open the new file.
00324 * Preroll the new file.
00325 * Set the title test for the main window.
00326 * Call SyncUI to update available actions.
00327 *
00328 *****************************************************************************/
00329 PRIVATE VOID FNLOCAL AttemptFileOpen(
00330     HWND                    hWnd)
00331 {
00332     MMRESULT                mmrc;
00333     PSTR                    pStrFile    = gszUntitled;
00334
00335     /* Stop, close, etc. if we're still playing
00336     */
00337     DPF(1, "AttemptFileOpen: Calling seqStop(); state = %u", gpSeq->uState);
00338
00339     mmrc = seqStop(gpSeq);
00340   if (mmrc != MMSYSERR_NOERROR)
00341   {
00342     Error(hWnd, IDS_STOPFAILED, mmrc);
00343     return;
00344   }
00345
00346     DPF(1, "Calling seqCloseFile(); state = %u", gpSeq->uState);
00347     seqCloseFile(gpSeq);
00348
00349     DPF(1, "Calling seqOpenFile(); state = %u", gpSeq->uState);
00350     /* Open new file
00351     */
00352
00353     gpSeq->pstrFile = gszOpenName;
00354     mmrc = seqOpenFile(gpSeq);
00355     if (mmrc != MMSYSERR_NOERROR)
00356     {
00357         Error(hWnd, IDS_OPENFAILED, mmrc);
00358         return;
00359     }
00360
00361     pStrFile = gszOpenTitle;
00362
00363     wsprintf(gszAppTitle, gszAppTitleMask, (LPSTR)pStrFile);
00364     SetWindowText(hWnd, gszAppTitle);
00365
00366     SyncUI(hWnd);
00367 }
00368
00369 /*****************************************************************************
00370 *
00371 * PrerollAndWait
00372 *
00373 * Prerolls the sequencer using the current device ID and file.
00374 *
00375 * HWND hWnd                 - Current window
00376 *
00377 * Just call preroll and loop processing messages until done.
00378 *
00379 *****************************************************************************/
00380 PRIVATE BOOL FNLOCAL PrerollAndWait(
00381     HWND                    hWnd)
00382 {
00383     PREROLL                 preroll;
00384     MMRESULT                mmrc;
00385
00386     preroll.tkBase = 0;
00387     preroll.tkEnd  = gpSeq->tkLength;
00388
00389     gpSeq->uDeviceID = guDevice;
00390
00391     if (MMSYSERR_NOERROR != (mmrc = seqPreroll(gpSeq, &preroll)))
00392   {
00393         Error(hWnd, IDS_PREROLLFAILED, mmrc);
00394         return FALSE;
00395   }
00396
00397   return TRUE;
00398 }
00399
00400 /*****************************************************************************
00401 *
00402 * MWnd_OnCreate
00403 *
00404 * Handle WM_CREATE message to main application window.
00405 *
00406 * HWND hWnd                 - Window handle
00407 * CREATESTRUCT FAR* lpCreateStruct
00408 *                           - Pointer to creation parameters for the window.
00409 *
00410 * Returns TRUE on success. Returning FALSE will cause the window to be
00411 * destroyed and the application will exit.
00412 *
00413 * Set the default time format.
00414 * Create the tool and status bars.
00415 * Create the time window as a child of the main app window and show it.
00416 * Set the main window's title to show no document ('Untitled').
00417 * Accept drag/drop files.
00418 * Call SyncUI to update the enable status of the toolbar and menu items.
00419 *
00420 *****************************************************************************/
00421 PRIVATE BOOL FNLOCAL MWnd_OnCreate(
00422     HWND                    hWnd,
00423     CREATESTRUCT FAR*       lpCreateStruct)
00424 {
00425     HMENU                   hMenu;
00426     HMENU                   hMenuOptions;
00427     HMENU                   hMenuPlayThru;
00428     UINT                    cDevs;
00429     UINT                    idx;
00430     RECT                    rc;
00431     MIDIOUTCAPS             moutCaps;
00432
00433     gnTimeFormat = IDS_TF_FIRST;
00434
00435     InitToolbar(hWnd);
00436     InitStatusBar(hWnd);
00437
00438     hMenu = GetMenu(hWnd);
00439     hMenuOptions = GetSubMenu(hMenu, POS_OPTIONS);
00440     hMenuPlayThru = GetSubMenu(hMenu, POS_PLAYTHRU);
00441
00442     AppendMenu(hMenuOptions, MF_SEPARATOR, 0, NULL);
00443
00444     for (idx = 0; idx < N_TIME_FORMATS; idx++)
00445     {
00446         AppendMenu(hMenuOptions,
00447                    MF_ENABLED|MF_STRING,
00448                    IDS_TF_FIRST + idx,
00449                    grgszTimeFormats[idx]);
00450     }
00451
00452     cDevs = midiOutGetNumDevs();
00453     if (cDevs)
00454         AppendMenu(hMenuPlayThru, MF_SEPARATOR, 0, NULL);
00455
00456     for (idx = 0; idx < cDevs; idx++)
00457     {
00458         if (midiOutGetDevCaps(idx, &moutCaps, sizeof(moutCaps)) == MMSYSERR_NOERROR)
00459         {
00460             AppendMenu(hMenuPlayThru,
00461                        MF_ENABLED|MF_STRING,
00462                        IDM_DEVICES + idx,
00463                        moutCaps.szPname);
00464         }
00465     }
00466
00467     CheckMenuItem(hMenu, IDM_TOOLBAR, MF_BYCOMMAND|MF_CHECKED);
00468     CheckMenuItem(hMenu, IDM_STATUS,  MF_BYCOMMAND|MF_CHECKED);
00469     CheckMenuItem(hMenu, IDM_AUTOPLAY,MF_BYCOMMAND|MF_CHECKED);
00470     CheckMenuItem(hMenu, gnTimeFormat,MF_BYCOMMAND|MF_CHECKED);
00471     CheckMenuItem(hMenu, IDM_DEVICES,  MF_BYCOMMAND|MF_CHECKED);
00472
00473     GetClientRect(hWnd, &rc);
00474
00475     ghWndTime = CreateWindow(
00476         gszTWndClass,
00477         NULL,
00478         WS_CHILD,
00479         rc.left, rc.top,
00480         rc.right-rc.left, rc.bottom-rc.top,
00481         hWnd,
00482         NULL,
00483         lpCreateStruct->hInstance,
00484         NULL);
00485
00486     ShowWindow(ghWndTime, SW_RESTORE);
00487
00488     wsprintf(gszAppTitle, gszAppTitleMask, (LPSTR)gszUntitled);
00489     SetWindowText(hWnd, gszAppTitle);
00490
00491     DragAcceptFiles(hWnd, TRUE);
00492
00493     SyncUI(hWnd);
00494
00495     return TRUE;
00496 }
00497
00498 /*****************************************************************************
00499 *
00500 * MWnd_OnGetMinMaxSize
00501 *
00502 * Handle WM_GETMINMAXSIZE message to main application window.
00503 *
00504 * HWND hWnd                 - Window handle
00505 * MINMAXINFO FAR* lpMinMaxInfo
00506 *                           - Pointer to min/max tracking information
00507 *
00508 * This message is sent to a window before resize tracking begins. The
00509 * lpMinMaxInfo structure contains the minimum and maximum x and y values
00510 * the window can be resized to.
00511 *
00512 * We don't allow resizing small enough to cause the status bar and toolbar
00513 * to overlap so they don't try to draw over each other.
00514 *
00515 *****************************************************************************/
00516 PRIVATE VOID FNLOCAL MWnd_OnGetMinMaxInfo(
00517     HWND                    hWnd,
00518     MINMAXINFO FAR*         lpMinMaxInfo)
00519 {
00520     RECT                    rc;
00521
00522     GetWindowRect(hWnd, &rc);
00523
00524     /* Only go small enough that our client area after children is zero.
00525     */
00526     lpMinMaxInfo->ptMinTrackSize.y =
00527         (rc.bottom - rc.top) -
00528         (grcTWnd.bottom - grcTWnd.top);
00529 }
00530
00531 /*****************************************************************************
00532 *
00533 * MWnd_OnSize
00534 *
00535 * Handle WM_SIZE message to main application window.
00536 *
00537 * HWND hWnd                 - Window handle
00538 * UINT state                - Some SIZE_xxx code indicating what type of
00539 *                             size operation this is.
00540 * int  cx, cy               - New x and y size of the window's client area.
00541 *
00542 * Get the new client area.
00543 * Adjust the client area for the toolbar and status bar if they exist.
00544 * Make sure the client area isn't a negative height and adjust if it is.
00545 * Resize the time window to fit in our new client area.
00546 * Forward the WM_SIZE to the time window so it can resize its font.
00547 *
00548 *****************************************************************************/
00549 PRIVATE VOID FNLOCAL MWnd_OnSize(
00550     HWND                    hWnd,
00551     UINT                    state,
00552     int                     cx,
00553     int                     cy)
00554 {
00555     RECT                    rc;
00556     RECT                    rcClient;
00557
00558     GetClientRect(hWnd, &rcClient);
00559     if (ghWndToolbar != NULL)
00560     {
00561         /* Cause the toolbar to be aware of the size change
00562         */
00563         FORWARD_WM_SIZE(ghWndToolbar, SIZE_RESTORED, 0, 0, SendMessage);
00564
00565         GetWindowRect(ghWndToolbar, &rc);
00566         rcClient.top += (rc.bottom - rc.top);
00567     }
00568
00569     if (ghWndStatus != NULL)
00570     {
00571         ResizeStatusBar(hWnd);
00572
00573         /* Cause the status bar to be aware of the size change
00574         */
00575         FORWARD_WM_SIZE(ghWndStatus, SIZE_RESTORED, 0, 0, SendMessage);
00576
00577         GetWindowRect(ghWndStatus, &rc);
00578         rcClient.bottom -= (rc.bottom - rc.top);
00579     }
00580
00581     /* Do we need to resize entire window so the tool/status bars
00582     ** don't overlap? (The only case where this can happen is
00583     ** on creation of one of the two -- we set minimum tracking so
00584     ** a user can't manually resize the window to cause this
00585     ** condition).
00586     */
00587     if (rcClient.bottom < rcClient.top)
00588     {
00589         GetWindowRect(hWnd, &rc);
00590         SetWindowPos(hWnd,
00591                      (HWND)NULL,
00592                      0, 0,
00593                      rc.right - rc.left + 1,
00594                      rc.bottom - rc.top + 1 - rcClient.top - rcClient.bottom,
00595                      SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER);
00596     }
00597
00598     SetWindowPos(ghWndTime,
00599                  (HWND)NULL,
00600                  rcClient.left,
00601                  rcClient.top,
00602                  rcClient.right - rcClient.left,
00603                  rcClient.bottom - rcClient.top,
00604                  SWP_NOACTIVATE|SWP_NOZORDER);
00605
00606     FORWARD_WM_SIZE(ghWndTime, SIZE_RESTORED, 0, 0, SendMessage);
00607 }
00608
00609 /*****************************************************************************
00610 *
00611 * MWnd_OnPaint
00612 *
00613 * Handle WM_PAINT message to main application window.
00614 *
00615 * HWND hWnd                 - Window handle
00616 *
00617 * Just do a BeginPaint/EndPaint pair so USER will mark the area
00618 *   as valid. All the real work of painting the time is done
00619 *   by the WM_PAINT handler for the time window.
00620 *
00621 *****************************************************************************/
00622 PRIVATE VOID FNLOCAL MWnd_OnPaint(
00623     HWND                    hWnd)
00624 {
00625     PAINTSTRUCT             ps;
00626     HDC                     hDC;
00627
00628     hDC = BeginPaint(hWnd, &ps);
00629     EndPaint(hWnd, &ps);
00630 }
00631
00632 /*****************************************************************************
00633 *
00634 * MWnd_OnDropFiles
00635 *
00636 * Handle WM_DROPFILES message to main application window.
00637 *
00638 * HWND hWnd                 - Window handle
00639 * HDROP hDrop               - Handle to dropped file information
00640 *
00641 * Get the 0th filename and free the drop handle.
00642 * Extract the file title from the full pathname.
00643 * Open the file.
00644 * If we opened successfully, start playback by forwarding a WM_COMMAND
00645 *   of IDM_PLAY to the main window.
00646 *
00647 *****************************************************************************/
00648 PRIVATE VOID FNLOCAL MWnd_OnDropFiles(
00649     HWND                    hWnd,
00650     HDROP                   hDrop)
00651 {
00652     PSTR                    pStr;
00653
00654     /* For multiple selections, we only accept the first file
00655     */
00656     DragQueryFile(hDrop, 0, gszOpenName, sizeof(gszOpenName));
00657     DragFinish(hDrop);
00658
00659     /* We don't get OpenTitle like we do from GetOpenFileName; need to
00660     ** figure this out for ourselves
00661     */
00662     pStr = gszOpenName + lstrlen(gszOpenName) - 1;
00663
00664     while (pStr >= gszOpenName && *pStr != '/' && *pStr != '\\' && *pStr != ':')
00665         pStr--;
00666
00667     pStr++;
00668     lstrcpyn(gszOpenTitle, pStr, MAX_FILEPATH);
00669
00670     AttemptFileOpen(hWnd);
00671
00672     if (gbAutoPlay && gpSeq->uState == SEQ_S_OPENED)
00673         FORWARD_WM_COMMAND(hWnd, IDM_PLAY, (HWND)NULL, 0, SendMessage);
00674 }
00675
00676
00677 /*****************************************************************************
00678 *
00679 * MWnd_OnFileOpen
00680 *
00681 * Handle WM_COMMAND/IDM_OPEN message to main application window.
00682 *
00683 * HWND hWnd                 - Window handle
00684 *
00685 * Fill in the OPENFILENAME struct and call GetOpenFileName.
00686 * If not canceled, try to open the file.
00687 *
00688 *****************************************************************************/
00689 PRIVATE VOID FNLOCAL MWnd_OnFileOpen(
00690     HWND                    hWnd)
00691 {
00692     OPENFILENAME            ofn;
00693
00694     *gszOpenName = '\0';
00695
00696   ofn.lStructSize     = sizeof(OPENFILENAME);
00697   ofn.hwndOwner     = hWnd;
00698   ofn.lpstrFilter     = gszFilter;
00699   ofn.lpstrCustomFilter = (LPSTR)NULL;
00700   ofn.nMaxCustFilter    = 0L;
00701   ofn.nFilterIndex    = 1L;
00702   ofn.lpstrFile     = gszOpenName;
00703   ofn.nMaxFile      = MAX_FILEPATH;
00704   ofn.lpstrFileTitle    = gszOpenTitle;
00705   ofn.nMaxFileTitle   = MAX_FILEPATH;
00706   ofn.lpstrTitle      = (LPSTR)NULL;
00707   ofn.lpstrInitialDir   = (LPSTR)NULL;
00708   ofn.Flags       = OFN_HIDEREADONLY|OFN_FILEMUSTEXIST;
00709   ofn.nFileOffset     = 0;
00710   ofn.nFileExtension    = 0;
00711   ofn.lpstrDefExt     = gszDefExtension;
00712
00713     if (!GetOpenFileName(&ofn))
00714         return;
00715
00716     AttemptFileOpen(hWnd);
00717 }
00718
00719 /*****************************************************************************
00720 *
00721 * MWnd_OnCommandToggleChild
00722 *
00723 * Handle WM_COMMAND message of toggle tool or status bar to main application
00724 * window.
00725 *
00726 * HWND hWnd                 - Window handle
00727 * UINT id                   - Control id of menu selection; either
00728 *                             IDM_TOOLBAR or IDM_STATUS
00729 *
00730 * Get the current menu item check state.
00731 * Destroy or create the child as needed.
00732 * Send a WM_SIZE to the main window so client area will be recalculated.
00733 * Toggle the menu item check state.
00734 *
00735 *****************************************************************************/
00736 PRIVATE VOID FNLOCAL MWnd_OnCommandToggleChild(
00737     HWND                    hWnd,
00738     UINT                    id)
00739 {
00740     HMENU                   hMenu;
00741     UINT                    uState;
00742     HWND*                   phWnd;
00743
00744     phWnd = (id == IDM_TOOLBAR) ? &ghWndToolbar : &ghWndStatus;
00745
00746     hMenu = GetMenu(hWnd);
00747     uState = GetMenuState(hMenu, id, MF_BYCOMMAND);
00748     if (uState & MF_CHECKED)
00749     {
00750         DestroyWindow(*phWnd);
00751         *phWnd = NULL;
00752     }
00753     else
00754     {
00755         if (id == IDM_TOOLBAR)
00756             InitToolbar(hWnd);
00757         else
00758             InitStatusBar(hWnd);
00759     }
00760
00761     SendMessage(hWnd, WM_SIZE, 0, 0L);
00762
00763     uState ^= MF_CHECKED;
00764     uState &= MF_CHECKED;
00765     CheckMenuItem(hMenu, id, MF_BYCOMMAND|uState);
00766
00767     SyncUI(hWnd);
00768 }
00769
00770
00771 /*****************************************************************************
00772 *
00773 * MWnd_OnCommand
00774 *
00775 * Handle WM_COMMAND message to main application window.
00776 *
00777 * HWND hWnd                 - Window handle
00778 * int id                    - id of control or menu causing WM_COMMAND
00779 * HWND hwndCtl              - Window handle of child control, if any
00780 * UINT codeNotify           - Notification code if this message is from a
00781 *                             control.
00782 *
00783 * For a press of the toolbar buttons or their menu equivalents, just load
00784 * a resource string and display it in the status bar.
00785 *
00786 * For an exit request, send ourselves a WM_CLOSE message.
00787 *
00788 *****************************************************************************/
00789 PRIVATE VOID FNLOCAL MWnd_OnCommand(
00790     HWND                    hWnd,
00791     int                     id,
00792     HWND                    hWndCtl,
00793     UINT                    codeNotify)
00794 {
00795     HMENU                   hMenu;
00796     int                     nIdxFormat;
00797     LPSTR                   lpstr;
00798
00799     if (id >= IDS_TF_FIRST && id <= IDS_TF_LAST)
00800     {
00801         if (NULL != ghWndStatus)
00802         {
00803             nIdxFormat = id - IDS_TF_FIRST;
00804
00805             lpstr = (LPSTR)(grgszTimeFormats[nIdxFormat]);
00806
00807             SendMessage(ghWndStatus,
00808                         SB_SETTEXT,
00809                         SB_PANE_TFMT,
00810                         (LPARAM)lpstr);
00811
00812         }
00813
00814         hMenu = GetMenu(hWnd);
00815
00816         CheckMenuItem(hMenu, gnTimeFormat, MF_UNCHECKED|MF_BYCOMMAND);
00817         CheckMenuItem(hMenu, id, MF_CHECKED|MF_BYCOMMAND);
00818
00819         gnTimeFormat = id;
00820
00821         /* Force time window to update font and repaint entire time string
00822          */
00823
00824         if(ghWndTime) // for when WM_COMMAND is called before WM_CREATE
00825           FORWARD_WM_SIZE(ghWndTime, SIZE_RESTORED, 0, 0, SendMessage);
00826     }
00827     else if (id >= IDM_DEVMIN && id <= IDM_DEVMAX)
00828     {
00829         hMenu = GetMenu(hWnd);
00830
00831         CheckMenuItem(hMenu, guDevice + IDM_DEVICES, MF_UNCHECKED|MF_BYCOMMAND);
00832         guDevice = id - IDM_DEVICES;
00833         CheckMenuItem(hMenu, guDevice + IDM_DEVICES, MF_CHECKED|MF_BYCOMMAND);
00834     }
00835     else switch(id)
00836     {
00837         case IDM_OPEN:
00838             MWnd_OnFileOpen(hWnd);
00839             break;
00840
00841         case IDM_TOOLBAR:
00842         case IDM_STATUS:
00843             MWnd_OnCommandToggleChild(hWnd, id);
00844             break;
00845
00846         case IDM_AUTOPLAY:
00847             gbAutoPlay = !gbAutoPlay;
00848             CheckMenuItem(GetMenu(hWnd),
00849                           IDM_AUTOPLAY,
00850                           MF_BYCOMMAND|(gbAutoPlay ? MF_CHECKED : MF_UNCHECKED));
00851             break;
00852
00853         case IDM_PLAY:
00854             FORWARD_WM_COMMAND(ghWndTime, IDM_PLAY, 0, 0, SendMessage);
00855
00856       if (gpSeq->uState != SEQ_S_OPENED)
00857         DPF(1, "IDM_PLAY: State %u", gpSeq->uState);
00858
00859             if (PrerollAndWait(hWnd))
00860               seqStart(gpSeq);
00861
00862             SyncUI(hWnd);
00863             break;
00864
00865         case IDM_STOP:
00866             FORWARD_WM_COMMAND(ghWndTime, IDM_STOP, 0, 0, SendMessage);
00867
00868             seqStop(gpSeq);
00869             SyncUI(hWnd);
00870             break;
00871
00872         case IDM_PAUSE:
00873             if (gpSeq->uState == SEQ_S_PAUSED)
00874             {
00875                 seqRestart(gpSeq);
00876             }
00877             else
00878             {
00879                 seqPause(gpSeq);
00880             }
00881
00882             SyncUI(hWnd);
00883             break;
00884
00885         case IDM_SYNCUI:
00886             SyncUI(hWnd);
00887             break;
00888
00889         case IDM_EXIT:
00890             SendMessage(hWnd, WM_CLOSE, 0, 0L);
00891             break;
00892     }
00893 }
00894
00895 /*****************************************************************************
00896 *
00897 * MWnd_OnDestroy
00898 *
00899 * Handle WM_DESTROY message to main application window.
00900 *
00901 * HWND hWnd                 - Window handle
00902 *
00903 * Our main application window has been closed. PostQuitMessage so the main
00904 * message loop will exit and the app can terminate.
00905 *
00906 *****************************************************************************/
00907 PRIVATE VOID FNLOCAL MWnd_OnDestroy(
00908     HWND                    hWnd)
00909 {
00910     seqStop(gpSeq);
00911     PostQuitMessage(0);
00912 }
00913
00914 /*****************************************************************************
00915 *
00916 * MWnd_WndProc
00917 *
00918 * Window procedure for main application window.
00919 *
00920 * HWND hWnd                 - Window handle
00921 * UINT msg                  - Message code
00922 * WPARAM wParam             - Message specific parameter
00923 * LPARAM lParam             - Message specific parameter
00924 *
00925 * Dispatch messages we care about to the appropriate handler, else just
00926 * call DefWindowProc.
00927 *
00928 * Note this use of message cracker macros from windowsx.h. Using these
00929 * macros will shield you from the differences between Win16 and Win32;
00930 * if your app is cross-compilable, you should use these and save yourself
00931 * some headaches!
00932 *
00933 *****************************************************************************/
00934 LRESULT CALLBACK MWnd_WndProc(
00935     HWND                    hWnd,
00936     UINT                    msg,
00937     WPARAM                  wParam,
00938     LPARAM                  lParam)
00939 {
00940     switch( msg )
00941     {
00942         HANDLE_MSG(hWnd, WM_CREATE,         MWnd_OnCreate);
00943         HANDLE_MSG(hWnd, WM_GETMINMAXINFO,  MWnd_OnGetMinMaxInfo);
00944         HANDLE_MSG(hWnd, WM_SIZE,           MWnd_OnSize);
00945         HANDLE_MSG(hWnd, WM_PAINT,          MWnd_OnPaint);
00946         HANDLE_MSG(hWnd, WM_DROPFILES,      MWnd_OnDropFiles);
00947         HANDLE_MSG(hWnd, WM_COMMAND,        MWnd_OnCommand);
00948         HANDLE_MSG(hWnd, WM_DESTROY,        MWnd_OnDestroy);
00949
00950         case MMSG_DONE:
00951             FORWARD_WM_COMMAND(ghWndTime, IDM_STOP, 0, 0, SendMessage);
00952
00953       if (gpSeq->uState != SEQ_S_OPENED)
00954         DPF(1, "MMSG_DONE and state %u", gpSeq->uState);
00955
00956             SyncUI(hWnd);
00957             break;
00958
00959         default:
00960             return DefWindowProc(hWnd, msg, wParam, lParam);
00961     }
00962
00963     return 0;
00964 }
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/guidbind/vc/main.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • guidbind
  • vc

main.cpp

Go to the documentation of this file.
00001 #define INC_OLE2
00002 #define UNICODE 1
00003 #define _WIN32_DCOM
00004
00005 #include <windows.h>
00006 #include <winuser.h>
00007
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include <string.h>
00011 #include <malloc.h>
00012
00013 #include <winldap.h>
00014 #include <activeds.h>
00015 #include "ADSIhelpers.h"
00016 #include <assert.h>
00017
00018
00019 void main()
00020 {
00021 // Initialize COM
00022 CoInitialize(0);
00023
00024 WCHAR pwszADsPathObject[1024];
00025 WCHAR pwszBindByGuidStr[1024];
00026 HRESULT hr;
00027
00028 IADs * pIADsObject = NULL;
00029 IADs * pIADsObjectByGuid = NULL;
00030
00031 // Ask the user for a ADsPath to start
00032 _putws(L"This code binds to a directory object by ADsPath, retrieves the GUID,\n"
00033        L" then rebinds by GUID. \n\nSpecify the ADsPath of the object to bind to :\n");
00034 _getws(pwszADsPathObject);
00035
00036
00037 if (pwszADsPathObject[0] == NULL)
00038     return;
00039
00040 wprintf(L"\nBinding to %s\n",pwszADsPathObject);
00041
00042 // Bind to initial object
00043 hr = ADsGetObject( pwszADsPathObject,IID_IADs, (void **)& pIADsObject);
00044 if (SUCCEEDED(hr))
00045 {
00046     BSTR bsGuid = NULL;
00047     hr = pIADsObject->get_GUID(&bsGuid);
00048
00049     if (SUCCEEDED(hr))
00050     {
00051         wprintf(L"\n The GUID for\n\n%s\n\nis\n\n%s\n",pwszADsPathObject,bsGuid);
00052
00053         // Build a string for Binding to the object by GUID
00054         wsprintf(pwszBindByGuidStr,L"LDAP://<GUID=%s>",bsGuid);
00055
00056         // Bind BACK to the Same object using the GUID
00057         hr = ADsGetObject( pwszBindByGuidStr,IID_IADs, (void **)& pIADsObjectByGuid);
00058
00059         if (SUCCEEDED(hr))
00060         {
00061             wprintf(L"\nSuccessfully RE bound to\n\n%s\n\nUsing the path:\n\n%s\n", pwszADsPathObject,pwszBindByGuidStr);
00062
00063             // Release bind by GUID Object
00064             pIADsObjectByGuid->Release();
00065             pIADsObjectByGuid = NULL;
00066         }
00067
00068         SysFreeString(bsGuid);
00069     }
00070
00071     pIADsObject->Release();
00072     pIADsObject = NULL;
00073 }
00074
00075 if (FAILED(hr))
00076     _putws(L"Failed");
00077 CoUninitialize();
00078
00079 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumStreams/EnumStreams.c Source File

  • WinBase
  • IO
  • EnumStreams

EnumStreams.c

Go to the documentation of this file.
00001 /*----------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1999 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 enumstreams.c
00010
00011 This file contains code that demonstrates using the FindxxxStream
00012 functions implemented by findstream.c.
00013
00014 ----------------------------------------------------------------*/
00015
00016 #ifdef _IA64_
00017 #pragma warning(disable: 4127)
00018 #endif
00019
00020 #include <windows.h>
00021 #include <tchar.h>
00022 #include <stdio.h>
00023
00024 #include "findstream.h"
00025
00026 int _tmain(int argc, TCHAR *argv[])
00027 {
00028    HANDLE hFindStream;
00029    STREAM_FIND_DATA ffStream;
00030
00031    if (argc < 2)
00032    {
00033       _tprintf(_T("usage: enumstreams file_name\n"));
00034       return 1;
00035    }
00036
00037    hFindStream = FindFirstStream(argv[1], &ffStream);
00038    if (hFindStream == INVALID_HANDLE_VALUE)
00039    {
00040       _tprintf(_T("Cannot get list of streams.  LastError = %d\n"),
00041                GetLastError());
00042       return 2;
00043    }
00044
00045    // Enumerate the streams
00046    while (1)
00047    {
00048       _tprintf(_T("stream '%s' of size %I64u\n"),
00049                ffStream.cStreamName,
00050                ffStream.Size);
00051
00052       if (!FindNextStream(hFindStream, &ffStream))
00053          if (GetLastError() == ERROR_NO_MORE_FILES)
00054             break;
00055          else
00056          {
00057             _tprintf(_T("Error getting next stream data %u\n"),
00058                      GetLastError());
00059             break;
00060          }
00061    }
00062
00063    // Close the handle
00064    FindCloseStream(hFindStream);
00065
00066    return 0;
00067 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/setup.exe/vertrust.cpp Source File

  • SysMgmt
  • Msi
  • setup.exe

vertrust.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved.
00004 //
00005 //  File:       vertrust.cpp
00006 //
00007 //--------------------------------------------------------------------------
00008
00009 #define WIN // scope W32 API
00010 #define MSI // scope MSI API
00011
00012 #include <windows.h>
00013 #include <tchar.h>
00014
00015 #include "setup.h" // for itvEnum
00016 #include "common.h"
00017
00018 // package trust
00019 #include "wintrust.h"
00020 #include "softpub.h"
00021
00022 //--------------------------------------------------------------------------------------
00023 // CRYPTO API -- delay load
00024 //--------------------------------------------------------------------------------------
00025
00026 #define CRYPT32_DLL "crypt32.dll"
00027
00028 #define CRYPTOAPI_CertDuplicateCertificateContext "CertDuplicateCertificateContext"
00029 typedef PCCERT_CONTEXT (WINAPI* PFnCertDuplicateCertificateContext)(PCCERT_CONTEXT pCertContext);
00030
00031 #define CRYPTOAPI_CertCompareCertificate "CertCompareCertificate"
00032 typedef BOOL (WINAPI* PFnCertCompareCertificate)(DWORD dwCertEncodingType, PCERT_INFO pCertId1, PCERT_INFO pCertId2);
00033
00034 #define CRYPTOAPI_CertFreeCertificateContext "CertFreeCertificateContext"
00035 typedef BOOL (WINAPI* PFnCertFreeCertificateContext)(PCCERT_CONTEXT pCertContext);
00036
00037 //--------------------------------------------------------------------------------------
00038 // WINTRUST API -- delay load
00039 //--------------------------------------------------------------------------------------
00040
00041 #define WINTRUST_DLL "wintrust.dll"
00042
00043 #define WINTRUSTAPI_WinVerifyTrust "WinVerifyTrust"
00044 typedef HRESULT (WINAPI *PFnWinVerifyTrust)(HWND hwnd, GUID *pgActionID, WINTRUST_DATA *pWinTrustData);
00045
00046 #define WINTRUSTAPI_WTHelperProvDataFromStateData "WTHelperProvDataFromStateData"
00047 typedef PCRYPT_PROVIDER_DATA (WINAPI *PFnWTHelperProvDataFromStateData)(HANDLE hStateData);
00048
00049 #define WINTRUSTAPI_WTHelperGetProvSignerFromChain "WTHelperGetProvSignerFromChain"
00050 typedef PCRYPT_PROVIDER_SGNR (WINAPI *PFnWTHelperGetProvSignerFromChain)(PCRYPT_PROVIDER_DATA pProvData, DWORD idxSigner, BOOL fCounterSigner, DWORD idxCounterSigner);
00051
00052 #define WINTRUSTAPI_WTHelperGetProvCertFromChain "WTHelperGetProvCertFromChain"
00053 typedef PCRYPT_PROVIDER_CERT (WINAPI* PFnWTHelperGetProvCertFromChain)(PCRYPT_PROVIDER_SGNR pSgnr, DWORD idxCert);
00054
00055 //--------------------------------------------------------------------------------------
00056 // download provider
00057 //--------------------------------------------------------------------------------------
00058
00059 /////////////////////////////////////////////////////////////////////////////
00060 // IsFileTrusted
00061 //
00062 itvEnum IsFileTrusted(LPCWSTR lpwFile, HWND hwndParent, DWORD dwUIChoice, bool *pfIsSigned, PCCERT_CONTEXT *ppcSigner)
00063 {
00064     char szDebugOutput[MAX_STR_LENGTH] = {0};
00065
00066     itvEnum itv = itvUnTrusted;
00067
00068     if (pfIsSigned)
00069         *pfIsSigned = false;
00070     if (ppcSigner)
00071         *ppcSigner  = 0;
00072
00073     GUID guidAction = WINTRUST_ACTION_GENERIC_VERIFY_V2;
00074
00075     WINTRUST_FILE_INFO sWintrustFileInfo;
00076     WINTRUST_DATA      sWintrustData;
00077     HRESULT            hr;
00078
00079     memset((void*)&sWintrustFileInfo, 0x00, sizeof(WINTRUST_FILE_INFO)); // zero out
00080     memset((void*)&sWintrustData, 0x00, sizeof(WINTRUST_DATA)); // zero out
00081
00082     sWintrustFileInfo.cbStruct = sizeof(WINTRUST_FILE_INFO);
00083     sWintrustFileInfo.pcwszFilePath = lpwFile;
00084     sWintrustFileInfo.hFile = NULL;
00085
00086     sWintrustData.cbStruct            = sizeof(WINTRUST_DATA);
00087     sWintrustData.dwUIChoice          = dwUIChoice;
00088     sWintrustData.fdwRevocationChecks = WTD_REVOKE_NONE;
00089     sWintrustData.dwUnionChoice       = WTD_CHOICE_FILE;
00090     sWintrustData.pFile               = &sWintrustFileInfo;
00091     sWintrustData.dwStateAction       = (ppcSigner) ? WTD_STATEACTION_VERIFY : 0;
00092
00093     HMODULE hWinTrust = LoadLibrary(WINTRUST_DLL);
00094     if (!hWinTrust)
00095     {
00096         // WinTrust is unavailable on the machine
00097         return itvWintrustNotOnMachine;
00098     }
00099     PFnWinVerifyTrust pfnWinVerifyTrust = (PFnWinVerifyTrust)GetProcAddress(hWinTrust, WINTRUSTAPI_WinVerifyTrust);
00100     PFnWTHelperProvDataFromStateData pfnWTHelperProvDataFromStateData= (PFnWTHelperProvDataFromStateData)GetProcAddress(hWinTrust, WINTRUSTAPI_WTHelperProvDataFromStateData);
00101     PFnWTHelperGetProvSignerFromChain pfnWTHelperGetProvSignerFromChain = (PFnWTHelperGetProvSignerFromChain)GetProcAddress(hWinTrust, WINTRUSTAPI_WTHelperGetProvSignerFromChain);
00102     PFnWTHelperGetProvCertFromChain pfnWTHelperGetProvCertFromChain = (PFnWTHelperGetProvCertFromChain)GetProcAddress(hWinTrust, WINTRUSTAPI_WTHelperGetProvCertFromChain);
00103     if (!pfnWinVerifyTrust || !pfnWTHelperProvDataFromStateData || !pfnWTHelperGetProvSignerFromChain || !pfnWTHelperGetProvCertFromChain)
00104     {
00105         // WinTrust is unavailable on the machine
00106         FreeLibrary(hWinTrust);
00107         return itvWintrustNotOnMachine;
00108     }
00109
00110     hr = pfnWinVerifyTrust(/* UI Window Handle */ (dwUIChoice == WTD_UI_NONE) ? (HWND)INVALID_HANDLE_VALUE : hwndParent, &guidAction, &sWintrustData);
00111     DebugMsg("[WVT] WVT returned 0x%X\n", hr);
00112
00113     itv = (TRUST_E_PROVIDER_UNKNOWN == hr) ? itvWintrustNotOnMachine : ((S_OK == hr) ? itvTrusted : itvUnTrusted);
00114
00115     if (itvWintrustNotOnMachine == itv)
00116     {
00117         // release state data
00118         sWintrustData.dwUIChoice = WTD_UI_NONE;
00119         sWintrustData.dwStateAction = WTD_STATEACTION_CLOSE;
00120         pfnWinVerifyTrust((HWND)INVALID_HANDLE_VALUE, &guidAction, &sWintrustData);
00121
00122         FreeLibrary(hWinTrust);
00123         return itv; // return immediately
00124     }
00125
00126     if (pfIsSigned)
00127         *pfIsSigned = (TRUST_E_NOSIGNATURE == hr) ? false : true;
00128
00129     if (TRUST_E_NOSIGNATURE == hr)
00130     {
00131         // release state data
00132         sWintrustData.dwUIChoice = WTD_UI_NONE;
00133         sWintrustData.dwStateAction = WTD_STATEACTION_CLOSE;
00134         pfnWinVerifyTrust((HWND)INVALID_HANDLE_VALUE, &guidAction, &sWintrustData);
00135
00136         FreeLibrary(hWinTrust);
00137         return itv;
00138     }
00139
00140     if (ppcSigner)
00141     {
00142         CRYPT_PROVIDER_DATA const *psProvData     = NULL;
00143         CRYPT_PROVIDER_SGNR       *psProvSigner   = NULL;
00144         CRYPT_PROVIDER_CERT       *psProvCert     = NULL;
00145
00146         // grab the provider data
00147         psProvData = pfnWTHelperProvDataFromStateData(sWintrustData.hWVTStateData);
00148         if (psProvData)
00149         {
00150             // grab the signer data from the CRYPT_PROV_DATA
00151             psProvSigner = pfnWTHelperGetProvSignerFromChain((PCRYPT_PROVIDER_DATA)psProvData, 0 /*first signer*/, FALSE /* not a counter signer */, 0);
00152             if (psProvSigner)
00153             {
00154                 // grab the signer cert from CRYPT_PROV_SGNR (pos 0 = signer cert; pos csCertChain-1 = root cert)
00155                 psProvCert = pfnWTHelperGetProvCertFromChain(psProvSigner, 0);
00156             }
00157         }
00158
00159         if (!psProvCert)
00160         {
00161             // some failure in obtaining the signer cert data
00162             *ppcSigner = 0;
00163         }
00164         else
00165         {
00166             // duplicate the cert
00167             HMODULE hCrypt32 = LoadLibrary(CRYPT32_DLL);
00168             if (hCrypt32)
00169             {
00170                 PFnCertDuplicateCertificateContext pfnCertDuplicateCertificateContext = (PFnCertDuplicateCertificateContext)GetProcAddress(hCrypt32, CRYPTOAPI_CertDuplicateCertificateContext);
00171                 if (pfnCertDuplicateCertificateContext)
00172                     *ppcSigner = pfnCertDuplicateCertificateContext(psProvCert->pCert);
00173                 FreeLibrary(hCrypt32);
00174             }
00175         }
00176
00177         // release state data
00178         sWintrustData.dwUIChoice = WTD_UI_NONE;
00179         sWintrustData.dwStateAction = WTD_STATEACTION_CLOSE;
00180         pfnWinVerifyTrust((HWND)INVALID_HANDLE_VALUE, &guidAction, &sWintrustData);
00181     }
00182
00183     FreeLibrary(hWinTrust);
00184     return itv;
00185 }
00186
00187 /////////////////////////////////////////////////////////////////////////////
00188 // IsPackageTrusted
00189 //
00190
00191 itvEnum IsPackageTrusted(LPCSTR szSetupExe, LPCSTR szPackage, HWND hwndParent)
00192 {
00193     WCHAR *szwSetup   = 0;
00194     WCHAR *szwPackage = 0;
00195     int   cchWide     = 0;
00196
00197     bool    fPackageIsTrusted = false;
00198     bool    fSetupExeIsSigned = false;
00199     bool    fPackageIsSigned  = false;
00200     itvEnum itv               = itvUnTrusted;
00201
00202     DWORD dwUILevel = 0;
00203
00204     char szDebugOutput[MAX_STR_LENGTH] = {0};
00205
00206     PCCERT_CONTEXT pcExeSigner = 0;
00207     PCCERT_CONTEXT pcMsiSigner = 0;
00208
00209     HMODULE hCrypt32 = LoadLibrary(CRYPT32_DLL);
00210     if (!hCrypt32)
00211     {
00212         // no crypto on the machine
00213         return itvWintrustNotOnMachine;
00214     }
00215     PFnCertCompareCertificate pfnCertCompareCertificate = (PFnCertCompareCertificate)GetProcAddress(hCrypt32, CRYPTOAPI_CertCompareCertificate);
00216     PFnCertFreeCertificateContext pfnCertFreeCertificateContext = (PFnCertFreeCertificateContext)GetProcAddress(hCrypt32, CRYPTOAPI_CertFreeCertificateContext);
00217     if (!pfnCertCompareCertificate || !pfnCertFreeCertificateContext)
00218     {
00219         // no crypt on the machine
00220         FreeLibrary(hCrypt32);
00221         return itvWintrustNotOnMachine;
00222     }
00223
00224     // convert szSetupExe to WIDE
00225     cchWide = MultiByteToWideChar(CP_ACP, 0, szSetupExe, -1, 0, 0);
00226     szwSetup = new WCHAR[cchWide];
00227     if (!szwSetup)
00228     {
00229         // out of memory
00230         FreeLibrary(hCrypt32);
00231         return itvUnTrusted;
00232     }
00233     if (0 == MultiByteToWideChar(CP_ACP, 0, szSetupExe, -1, szwSetup, cchWide))
00234     {
00235         // failed to convert string
00236         FreeLibrary(hCrypt32);
00237         delete [] szwSetup;
00238         return itvUnTrusted;
00239     }
00240
00241     //
00242     // step 1: silently call WinVerifyTrust on szSetupExe, ignore return value - except for ivtWintrustNotOnMachine
00243     //
00244
00245     DebugMsg("[WVT] step 1: silently call WinVerifyTrust on szSetupExe, ignoring return value\n");
00246
00247     if (itvWintrustNotOnMachine == (itv = IsFileTrusted(szwSetup, hwndParent, WTD_UI_NONE, &fSetupExeIsSigned, &pcExeSigner)))
00248     {
00249         goto CleanUp;
00250     }
00251
00252     DebugMsg("[WVT] fSetupExeIsSigned = %s\n", fSetupExeIsSigned ? "TRUE" : "FALSE");
00253
00254     // convert szPackage to WIDE
00255     cchWide = MultiByteToWideChar(CP_ACP, 0, szPackage, -1, 0, 0);
00256     szwPackage = new WCHAR[cchWide];
00257     if (!szwPackage)
00258     {
00259         // out of memory
00260         FreeLibrary(hCrypt32);
00261         return itvUnTrusted;
00262     }
00263     if (0 == MultiByteToWideChar(CP_ACP, 0, szPackage, -1, szwPackage, cchWide))
00264     {
00265         // failed to convert string
00266         FreeLibrary(hCrypt32);
00267         return itvUnTrusted;
00268     }
00269
00270     //
00271     // step 2: silently call WinVerifyTrust on szPackage, ignore return value - except for ivtWintrustNotOnMachine
00272     //
00273
00274     if (fSetupExeIsSigned)
00275     {
00276         DebugMsg("[WVT] step2: silently call WinVerifyTrust on szPackage, ignoring return value\n");
00277         if (itvWintrustNotOnMachine == (itv = IsFileTrusted(szwPackage, hwndParent, WTD_UI_NONE, &fPackageIsSigned, &pcMsiSigner)))
00278         {
00279             goto CleanUp;
00280         }
00281
00282         DebugMsg("[WVT] fPackageIsSigned = %s\n", fPackageIsSigned ? "TRUE" : "FALSE");
00283     }
00284
00285     //
00286     // step 3: call WinVerifyTrust on szPackage, return value matters; use proper UI-level
00287     //
00288
00289     if ( !fSetupExeIsSigned  // exe is not signed
00290         || !fPackageIsSigned // package is not signed
00291         || !pcExeSigner      // exe signer cert is missing
00292         || !pcMsiSigner      // package signer cert is missing
00293         || !pfnCertCompareCertificate(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, pcExeSigner->pCertInfo, pcMsiSigner->pCertInfo)) // signed by different certs
00294     {
00295         // always show UI
00296         DebugMsg("[WVT] step3: last call to WinVerifyTrust using full UI\n");
00297         dwUILevel = WTD_UI_ALL;
00298     }
00299     else
00300     {
00301         // show UI only if bad
00302         DebugMsg("[WVT] step3: last call to WinVerifyTrust showing UI only if something is wrong\n");
00303         dwUILevel = WTD_UI_NOGOOD;
00304     }
00305
00306     itv = IsFileTrusted(szwPackage, hwndParent, dwUILevel, NULL, NULL);
00307
00308     //
00309     // cleanup
00310     //
00311
00312 CleanUp:
00313     if (szwPackage)
00314         delete [] szwPackage;
00315     if (szwSetup)
00316         delete [] szwSetup;
00317
00318     if (pcExeSigner)
00319         pfnCertFreeCertificateContext(pcExeSigner);
00320     if (pcMsiSigner)
00321         pfnCertFreeCertificateContext(pcMsiSigner);
00322
00323     FreeLibrary(hCrypt32);
00324
00325     return itv;
00326 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDSLContextBox Member List

This is the complete list of members for CDSLContextBox, including all inherited members.
AddString(WCHAR *pwszString) | CListBoxLite | [inline, virtual]
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
CListBoxLite(HWND hWndParent=NULL, UINT nID=0) | CListBoxLite |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DeleteString(WPARAM wParam) | CListBoxLite | [inline, virtual]
DestroyWindow() | CWndLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetCount() | CListBoxLite | [inline, virtual]
GetCurSel() const | CListBoxLite | [inline, virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetItemParam(INDEX nIndex) const | CListBoxLite | [inline, virtual]
GetText(INDEX nIndex, WCHAR *pwszBuffer) | CListBoxLite | [inline, virtual]
GetTextLen(INDEX nIndex) | CListBoxLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CListBoxLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDblClk(INT iID, HWND hWndCtrl) | CListBoxLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CDSLContextBox | [inline, virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetCurSel(WPARAM nSelect) | CListBoxLite | [inline, virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetItemParam(INDEX nIndex, LPARAM lParam) | CListBoxLite | [inline, virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CListBoxLite() | CListBoxLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/Dibdll.h Source File

  • Multimedia
  • Gdi
  • WinCap32

Dibdll.h

Go to the documentation of this file.
00001 /*    PortTool v2.2     dibdll.h          */
00002
00003 /*
00004  *  dibdll.h
00005  *
00006  *  Copyright 1991 - 2000 Microsoft Corporation. All rights reserved
00007  *
00008  *  Header file for dllinit.c, print.c, and dibapi.rc.  It includes
00009  *  the declaration for ghDLLInst, a global variable which stores the
00010  *  DLL's instance handle.  It also defines constants for the DLL's
00011  *  printing dialog.
00012  */
00013
00014 /* Defines for the DLL's printing dialog. */
00015
00016 #define IDC_BOX1                    123
00017 #define IDC_PRINTTEXT1              401
00018 #define IDC_PRINTTEXT2              402
00019 #define IDC_PERCENTAGE              403
00020
00021 #define IDS_PRINTMSG                601
00022 #define IDS_BANDNMBR                602
00023 #define IDS_SENDINGBAND             603
00024 #define IDS_ABORTSTRING             604
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppagex/proppagex.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppagex

proppagex.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "PropPageX.h"
00017 #include "Resource.h"
00018
00019                              // Tracing stuff
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("CExtendPropertySheet2")
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //  Implementation of IUnknown
00026
00027 //---------------------------------------------------------------------------
00028 //  XPROPPAGE:  MMC will only QI for IExtendPropertySheet in an extension.
00029 //
00030 STDMETHODIMP CExtendPropertySheet::QueryInterface
00031 (
00032   REFIID   riid,       //[in] Identifier of the requested interface
00033   LPVOID   *ppv        //[out] Address of requested interface
00034 )
00035 {
00036   if( !ppv )
00037     return E_FAIL;
00038
00039   *ppv = NULL;
00040
00041   if( IsEqualIID(riid, IID_IUnknown) )
00042     *ppv = static_cast<IExtendPropertySheet*>(this);
00043   else if( IsEqualIID(riid, IID_IExtendPropertySheet) )
00044     *ppv = static_cast<IExtendPropertySheet*>(this);
00045
00046
00047   if( *ppv )
00048   {
00049     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00050     return S_OK;
00051   }
00052
00053   return E_NOINTERFACE;
00054 }
00055
00056 //---------------------------------------------------------------------------
00057 STDMETHODIMP_(ULONG) CExtendPropertySheet::AddRef()
00058 {
00059   return InterlockedIncrement((LONG*)&m_cRef);
00060 }
00061
00062 //---------------------------------------------------------------------------
00063 STDMETHODIMP_(ULONG) CExtendPropertySheet::Release()
00064 {
00065   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00066   {
00067     delete this;
00068     return 0;
00069   }
00070   return m_cRef;
00071 }
00072
00073 /////////////////////////////////////////////////////////////////////////////
00074 //  Construction-Destruction
00075
00076 //---------------------------------------------------------------------------
00077 CExtendPropertySheet::CExtendPropertySheet()
00078 {
00079   InterlockedIncrement((long*)&g_uObjectCount);
00080
00081   //XPROPPAGE:  Register the clipformat
00082   g_cfNodeAttrPtr  = RegisterClipboardFormat( T_CCF_ATTRIB_PTR );
00083
00084   m_cRef         = 0;
00085   m_nPageCount   = 1;
00086   m_dwXAttribs   = 0;
00087
00088   TRACE_START(_T("New instance of CExtendPropertySheet") );
00089 }
00090
00091 //---------------------------------------------------------------------------
00092 CExtendPropertySheet::~CExtendPropertySheet()
00093 {
00094   InterlockedDecrement((long*)&g_uObjectCount);
00095 }
00096
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 //  IExtendPropertySheet
00100
00101 //---------------------------------------------------------------------------
00102 //  The console calls this when the primary Snap-in brings up it's Property
00103 //  page.  We get a data object from the primary which should contain the
00104 //  info we need to extend the properties of the node.
00105 //
00106 STDMETHODIMP CExtendPropertySheet::CreatePropertyPages
00107 (
00108   LPPROPERTYSHEETCALLBACK lpCallback,  //[in] Pointer to callback interface
00109   LONG_PTR                Handle,      //[in] NULL for extensions
00110   LPDATAOBJECT            ipDataObject //[in] Pointer to data object
00111 )
00112 {
00113   _ASSERT( NULL != ipDataObject );
00114   HRESULT hResult = S_FALSE;
00115
00116   // Setup the struct we need to retrive the data
00117   STGMEDIUM StgMedium = { TYMED_HGLOBAL,  NULL  };
00118   FORMATETC FormatEtc = { g_cfNodeAttrPtr, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00119
00120   // Ask the data object for a pointer to NODE_ATTRIBS
00121   hResult = ipDataObject->GetData( &FormatEtc, &StgMedium );
00122   NODE_ATTRIBS*  pTmpAttribs = (NODE_ATTRIBS*)GlobalLock( StgMedium.hGlobal );
00123
00124   // Copy the data into a local buffer
00125   wcscpy( m_pNodeAttribs.szObjectPath, pTmpAttribs->szObjectPath );
00126
00127   // Now we can unlock and free hGlobal
00128   GlobalUnlock( StgMedium.hGlobal );
00129   GlobalFree( StgMedium.hGlobal );
00130
00131   HPROPSHEETPAGE hPPage = NULL;
00132   PROPSHEETPAGE  psp;
00133   ZeroMemory( &psp, sizeof(PROPSHEETPAGE) );
00134
00135   psp.dwSize      = sizeof(PROPSHEETPAGE);
00136   psp.dwFlags     = PSP_DEFAULT | PSP_USETITLE;  // | PSP_HASHELP;
00137   psp.hInstance   = g_hInst;
00138   psp.pszTemplate = MAKEINTRESOURCE(IDD_PPAGE0);
00139   psp.pfnDlgProc  = PPageWndProcX;
00140   psp.lParam      = reinterpret_cast<LPARAM>(this);
00141   psp.pszTitle    = _T("Extended");
00142   psp.pfnCallback = NULL;
00143
00144   hPPage  = ::CreatePropertySheetPage( &psp );
00145
00146   hResult = lpCallback->AddPage( hPPage );
00147
00148   return hResult;
00149 }
00150
00151 //---------------------------------------------------------------------------
00152 //  This method is not even called for extensions
00153 //
00154 STDMETHODIMP CExtendPropertySheet::QueryPagesFor
00155 (
00156   LPDATAOBJECT ipDataObject  //[in] Pointer to selected data object
00157 )
00158 {
00159   _ASSERT( NULL != ipDataObject );
00160   return S_OK;
00161 }
00162
00163
00164 /////////////////////////////////////////////////////////////////////////////
00165 //  Private methods
00166
00167
00168 //---------------------------------------------------------------------------
00169 //  Dialog Proc for our PropertySheet
00170 //
00171 BOOL CALLBACK CExtendPropertySheet::PPageWndProcX
00172 (
00173   HWND    hPage,     //[in] Handle to property page
00174   UINT    uMsg,      //[in] Message
00175   WPARAM  wParam,    //[in] First message parameter
00176   LPARAM  lParam     //[in] Second message parameter
00177 )
00178 {
00179   static CExtendPropertySheet* pApp = NULL;
00180          BOOL bReturn = FALSE;
00181
00182   switch( uMsg )                       // Begin message switch
00183   {
00184     case WM_INITDIALOG:
00185     {
00186       // Cache the pointer to the calling instance of CExtendPropertySheet
00187       // and call it's OnInitPropPage method
00188       PROPSHEETPAGE* psp = (PROPSHEETPAGE*)lParam;
00189       pApp = reinterpret_cast<CExtendPropertySheet*>(psp->lParam);
00190       pApp->OnInitPropPage( hPage, wParam, lParam );
00191       break;
00192     }
00193     case WM_HELP:
00194     {
00195       // Not handling WM_HELP in this sample
00196       break;
00197     }
00198     case WM_COMMAND:
00199     {
00200       // Activate the 'Apply' button if the user clicked a button
00201       if( BN_CLICKED == HIWORD(wParam) )
00202         SendMessage(GetParent(hPage), PSM_CHANGED, (WPARAM)hPage, 0);
00203
00204       break;
00205     }
00206     case WM_DESTROY:
00207     {
00208       TRACE_START( _T("WM_DESTROY") );
00209       bReturn = TRUE;
00210     }
00211
00212     case WM_NOTIFY:
00213     {
00214       if( 0 == lParam )  //BUGLIST:  AV if we don't do this
00215         return 0;
00216
00217       switch( (reinterpret_cast<NMHDR*>(lParam))->code )
00218       {
00219         case PSN_APPLY:      // Really the 'OK' button
00220         {
00221           pApp->OnApplyChanges( hPage, wParam, lParam );
00222           return PSNRET_NOERROR;
00223         }
00224         case PSN_HELP:
00225         {
00226           return PSNRET_NOERROR;
00227         }
00228         default:
00229         {
00230           break;
00231         }
00232       } //end lParam->code switch
00233     } // end WM_NOTIFY
00234
00235     default: break;
00236
00237   } // end uMsg switch
00238
00239   return bReturn;
00240
00241 }
00242
00243
00244 //---------------------------------------------------------------------------
00245 BOOL CExtendPropertySheet::OnInitPropPage
00246 (
00247   HWND     hPage,      //[in] Handle to Property Page
00248   WPARAM   wParam,     //[in] First message parameter
00249   LPARAM   lParam      //[in] Second message parameter
00250 )
00251 {
00252   LRESULT lResult = 0;
00253
00254   HWND hCompressCtrl  = GetDlgItem( hPage, IDC_ATTR_COMPRESSED );
00255   HWND hEncryptedCtrl = GetDlgItem( hPage, IDC_ATTR_ENCRYPTED  );
00256
00257
00258   if( TRUE == IsAttributeSet( ATTRIBUTE_DATA_COMPRESSED ) )
00259     lResult = SendMessage( hCompressCtrl,  BM_SETCHECK, BST_CHECKED, 0 );
00260
00261   if( TRUE == IsAttributeSet( ATTRIBUTE_DATA_ENCRYPTED ) )
00262     lResult = SendMessage( hEncryptedCtrl,  BM_SETCHECK, BST_CHECKED, 0 );
00263
00264   return TRUE;
00265 }
00266
00267 //---------------------------------------------------------------------------
00268 BOOL CExtendPropertySheet::OnApplyChanges
00269 (
00270   HWND     hPage,      //[in] Handle to Property Page
00271   WPARAM   wParam,     //[in] First message parameter
00272   LPARAM   lParam      //[in] Second message parameter
00273 )
00274 {
00275   // In this sample we're not saving changes.
00276   return TRUE;
00277 }
00278
00279
00280 //---------------------------------------------------------------------------
00281 BOOL CExtendPropertySheet::IsAttributeSet
00282 (
00283   DWORD dwAttribute           //[in] Attribute to set
00284 )
00285 {
00286   return (m_dwXAttribs & dwAttribute) ? TRUE : FALSE;
00287 }
00288
00289
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/conf.h Source File

  • Web
  • NetMeeting
  • NMChat2

conf.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       CONF.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1999-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef _CONF_H_
00016 #define _CONF_H_
00017
00018 //****************************************************************************
00019 //
00020 // CLASS CRefCount
00021 //
00022 //****************************************************************************
00023
00024 class CRefCount
00025 {
00026 public:
00027
00028    CRefCount();
00029    // Virtual destructor defers to destructor of derived class.
00030    virtual ~CRefCount();
00031
00032    // IUnknown methods
00033
00034    ULONG STDMETHODCALLTYPE AddRef(void);
00035    ULONG STDMETHODCALLTYPE Release(void);
00036
00037 private:
00038
00039     LONG m_cRef;
00040 };
00041
00042
00043 //****************************************************************************
00044 //
00045 // CLASS CNotify
00046 //
00047 // Notification sink
00048 //
00049 //****************************************************************************
00050
00051 class CNotify
00052 {
00053 private:
00054     DWORD  m_dwCookie;
00055     IUnknown * m_pUnk;
00056     IConnectionPoint           * m_pcnp;
00057     IConnectionPointContainer  * m_pcnpcnt;
00058 public:
00059     CNotify(void);
00060     ~CNotify();
00061
00062     HRESULT Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN);
00063     HRESULT Disconnect(void);
00064
00065     IUnknown * GetPunk() {return m_pUnk;}
00066 };
00067
00068
00069 //****************************************************************************
00070 //
00071 // CLASS CMgrNotify
00072 //
00073 //****************************************************************************
00074
00075 class CMgrNotify : public CRefCount, public CNotify, public INmManagerNotify
00076 {
00077 public:
00078     CMgrNotify();
00079     ~CMgrNotify();
00080
00081     // INmManagerNotify
00082     HRESULT STDMETHODCALLTYPE NmUI(CONFN confn);
00083     HRESULT STDMETHODCALLTYPE ConferenceCreated(INmConference *pConference);
00084     HRESULT STDMETHODCALLTYPE CallCreated(INmCall *pCall);
00085
00086     // ICNotify methods
00087     HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00088     HRESULT STDMETHODCALLTYPE Disconnect(void);
00089
00090     // IUnknown methods
00091     ULONG STDMETHODCALLTYPE AddRef(void);
00092     ULONG STDMETHODCALLTYPE Release(void);
00093     HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void * *ppvObj);
00094 };
00095
00096
00097 //****************************************************************************
00098 //
00099 // CLASS CConfNotify
00100 //
00101 //****************************************************************************
00102
00103 class CConfNotify : public CRefCount, public CNotify, public INmConferenceNotify
00104 {
00105 public:
00106     CConfNotify();
00107     ~CConfNotify();
00108
00109     // INmConferenceNotify
00110     HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00111     HRESULT STDMETHODCALLTYPE StateChanged(NM_CONFERENCE_STATE uState);
00112     HRESULT STDMETHODCALLTYPE MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pfMember);
00113     HRESULT STDMETHODCALLTYPE ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel);
00114
00115     // ICNotify methods
00116     HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00117     HRESULT STDMETHODCALLTYPE Disconnect(void);
00118
00119     // IUnknown methods
00120     ULONG STDMETHODCALLTYPE AddRef(void);
00121     ULONG STDMETHODCALLTYPE Release(void);
00122     HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void * *ppvObj);
00123
00124     void ReleaseIMemberArray(void);
00125     ULONG GetIMemberCount(void) { return m_cIMembers; }
00126     INmMember **GetIMemberArray(void) { return &m_apIMembers[0]; }
00127
00128 private:
00129
00130     ULONG           m_cIMembers;
00131     INmMember      *m_apIMembers[MAX_MEMBERS];
00132 };
00133
00134
00135 // Global Variables
00136 extern CConfNotify * g_pConferenceNotify;
00137
00138 // Global Functions
00139 HRESULT InitConfMgr(void);
00140 void FreeConfMgr(void);
00141 void FreeConference(void);
00142
00143 extern CConfNotify * g_pConferenceNotify;
00144
00145 #endif // _CONF_H_
00146
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows.Net/exit.h Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows.Net

exit.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 1999
00005 //
00006 // File:        exit.h
00007 //
00008 // Contents:    CCertExitSample definition
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "certxsam.h"
00013 #include "resource.h"       // main symbols
00014
00015
00016 HRESULT
00017 GetServerCallbackInterface(
00018     OUT ICertServerExit** ppServer,
00019     IN LONG Context);
00020
00021 HRESULT
00022 exitGetProperty(
00023     IN ICertServerExit *pServer,
00024     IN BOOL fRequest,
00025     IN WCHAR const *pwszPropertyName,
00026     IN DWORD PropType,
00027     OUT VARIANT *pvarOut);
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // certexit
00031
00032 class CCertExitSample:
00033     public CComDualImpl<ICertExit2, &IID_ICertExit2, &LIBID_CERTEXITSAMPLELib>,
00034     public ISupportErrorInfo,
00035     public CComObjectRoot,
00036     public CComCoClass<CCertExitSample, &CLSID_CCertExitSample>
00037 {
00038 public:
00039     CCertExitSample()
00040     {
00041         m_strDescription = NULL;
00042         m_strCAName = NULL;
00043         m_pwszRegStorageLoc = NULL;
00044         m_hExitKey = NULL;
00045         m_dwExitPublishFlags = 0;
00046         m_cCACert = 0;
00047     }
00048     ~CCertExitSample();
00049
00050 BEGIN_COM_MAP(CCertExitSample)
00051     COM_INTERFACE_ENTRY(IDispatch)
00052     COM_INTERFACE_ENTRY(ICertExit)
00053     COM_INTERFACE_ENTRY(ICertExit2)
00054     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00055 END_COM_MAP()
00056
00057 DECLARE_NOT_AGGREGATABLE(CCertExitSample)
00058
00059 DECLARE_REGISTRY(
00060     CCertExitSample,
00061     wszCLASS_CERTEXITSAMPLE TEXT(".1"),
00062     wszCLASS_CERTEXITSAMPLE,
00063     IDS_CERTEXIT_DESC,
00064     THREADFLAGS_BOTH)
00065
00066     // ISupportsErrorInfo
00067     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00068
00069     // ICertExit
00070 public:
00071     STDMETHOD(Initialize)(
00072             /* [in] */ BSTR const strConfig,
00073             /* [retval][out] */ LONG __RPC_FAR *pEventMask);
00074
00075     STDMETHOD(Notify)(
00076             /* [in] */ LONG ExitEvent,
00077             /* [in] */ LONG Context);
00078
00079     STDMETHOD(GetDescription)(
00080             /* [retval][out] */ BSTR *pstrDescription);
00081
00082 // ICertExit2
00083 public:
00084     STDMETHOD(GetManageModule)(
00085     /* [out, retval] */ ICertManageModule **ppManageModule);
00086
00087 private:
00088     HRESULT _NotifyNewCert(IN LONG Context);
00089
00090     HRESULT _NotifyCRLIssued(IN LONG Context);
00091
00092     HRESULT _WriteCertToFile(
00093       IN ICertServerExit *pServer,
00094       IN BYTE const *pbCert,
00095       IN DWORD cbCert);
00096
00097     HRESULT _ExpandEnvironmentVariables(
00098       IN WCHAR const *pwszIn,
00099       OUT WCHAR *pwszOut,
00100       IN DWORD cwcOut);
00101
00102     // Member variables & private methods here:
00103     BSTR           m_strDescription;
00104     BSTR           m_strCAName;
00105     LPWSTR         m_pwszRegStorageLoc;
00106     HKEY           m_hExitKey;
00107     DWORD          m_dwExitPublishFlags;
00108     DWORD          m_cCACert;
00109
00110 };
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/tbarext.Cpp Source File

  • SysMgmt
  • MMC
  • Tbarext

tbarext.Cpp

Go to the documentation of this file.
00001
00002 //==============================================================;
00003 //
00004 //  This source code is only intended as a supplement to existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "tbarExt.h"
00021 #include "globals.h"
00022 #include "resource.h"
00023 #include <commctrl.h>        // Needed for button styles...
00024 #include <crtdbg.h>
00025 #include "resource.h"
00026 #include <stdio.h>
00027
00028 #define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
00029
00030
00031 // we need to do this to get around MMC.IDL - it explicitly defines
00032 // the clipboard formats as WCHAR types...
00033 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00034 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00035 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00036
00037 // These are the clipboard formats that we must supply at a minimum.
00038 // mmc.h actually defined these. We can make up our own to use for
00039 // other reasons. We don't need any others at this time.
00040 UINT CToolBarExtension::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00041 UINT CToolBarExtension::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00042 UINT CToolBarExtension::s_cfSnapInCLSID = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00043
00044
00045 CToolBarExtension::CToolBarExtension() : m_cref(0), m_ipControlBar(NULL),
00046                      m_ipToolbar(NULL)
00047 {
00048     OBJECT_CREATED
00049 }
00050
00051 CToolBarExtension::~CToolBarExtension()
00052 {
00053     OBJECT_DESTROYED
00054 }
00055
00056 ///////////////////////
00057 // IUnknown implementation
00058 ///////////////////////
00059
00060 STDMETHODIMP CToolBarExtension::QueryInterface(REFIID riid, LPVOID *ppv)
00061 {
00062     if (!ppv)
00063         return E_FAIL;
00064
00065     *ppv = NULL;
00066
00067     if (IsEqualIID(riid, IID_IUnknown))
00068         *ppv = static_cast<IExtendControlbar *>(this);
00069     else if (IsEqualIID(riid, IID_IExtendControlbar))
00070         *ppv = static_cast<IExtendControlbar *>(this);
00071
00072     if (*ppv)
00073     {
00074         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00075         return S_OK;
00076     }
00077
00078     return E_NOINTERFACE;
00079 }
00080
00081 STDMETHODIMP_(ULONG) CToolBarExtension::AddRef()
00082 {
00083     return InterlockedIncrement((LONG *)&m_cref);
00084 }
00085
00086 STDMETHODIMP_(ULONG) CToolBarExtension::Release()
00087 {
00088     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00089     {
00090         // we need to decrement our object count in the DLL
00091         delete this;
00092         return 0;
00093     }
00094
00095     return m_cref;
00096 }
00097
00098 HRESULT CToolBarExtension::ExtractData( IDataObject* piDataObject,
00099                                            CLIPFORMAT   cfClipFormat,
00100                                            BYTE*        pbData,
00101                                            DWORD        cbData )
00102 {
00103     HRESULT hr = S_OK;
00104
00105     FORMATETC formatetc = {cfClipFormat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00106     STGMEDIUM stgmedium = {TYMED_HGLOBAL, NULL};
00107
00108     stgmedium.hGlobal = ::GlobalAlloc(GPTR, cbData);
00109     do // false loop
00110     {
00111         if (NULL == stgmedium.hGlobal)
00112         {
00113             hr = E_OUTOFMEMORY;
00114             break;
00115         }
00116         hr = piDataObject->GetDataHere( &formatetc, &stgmedium );
00117         if ( FAILED(hr) )
00118         {
00119             break;
00120         }
00121
00122         BYTE* pbNewData = reinterpret_cast<BYTE*>(stgmedium.hGlobal);
00123         if (NULL == pbNewData)
00124         {
00125             hr = E_UNEXPECTED;
00126             break;
00127         }
00128         ::memcpy( pbData, pbNewData, cbData );
00129     } while (FALSE); // false loop
00130
00131     if (NULL != stgmedium.hGlobal)
00132     {
00133         ::GlobalFree(stgmedium.hGlobal);
00134     }
00135     return hr;
00136 } // ExtractData()
00137
00138 HRESULT CToolBarExtension::ExtractString( IDataObject *piDataObject,
00139                                              CLIPFORMAT   cfClipFormat,
00140                                              WCHAR       *pstr,
00141                                              DWORD        cchMaxLength)
00142 {
00143     return ExtractData( piDataObject, cfClipFormat, (PBYTE)pstr, cchMaxLength );
00144 }
00145
00146 HRESULT CToolBarExtension::ExtractSnapInCLSID( IDataObject* piDataObject, CLSID* pclsidSnapin )
00147 {
00148     return ExtractData( piDataObject, s_cfSnapInCLSID, (PBYTE)pclsidSnapin, sizeof(CLSID) );
00149 }
00150
00151 HRESULT CToolBarExtension::ExtractObjectTypeGUID( IDataObject* piDataObject, GUID* pguidObjectType )
00152 {
00153     return ExtractData( piDataObject, s_cfNodeType, (PBYTE)pguidObjectType, sizeof(GUID) );
00154 }
00155
00156 ///////////////////////////////
00157 // Interface IExtendControlBar
00158 ///////////////////////////////
00159 static MMCBUTTON SnapinButtons1[] =
00160 {
00161     { 0, ID_BUTTONSTART, TBSTATE_ENABLED, TBSTYLE_GROUP, L"Extension - Start Vehicle", L"Extension - Start Vehicle" },
00162     { 1, ID_BUTTONPAUSE, TBSTATE_ENABLED, TBSTYLE_GROUP, L"Extension - Pause Vehicle", L"Extension - Pause Vehicle"},
00163     { 2, ID_BUTTONSTOP,  TBSTATE_ENABLED, TBSTYLE_GROUP, L"Extension - Stop Vehicle",  L"Extension - Stop Vehicle" },
00164 };
00165
00166 HRESULT CToolBarExtension::SetControlbar(
00167                                   /* [in] */ LPCONTROLBAR pControlbar)
00168 {
00169     HRESULT hr = S_OK;
00170
00171   //
00172     //  Clean up
00173     //
00174
00175     // if we've got a cached toolbar, release it
00176     if (m_ipToolbar) {
00177         m_ipToolbar->Release();
00178         m_ipToolbar = NULL;
00179     }
00180
00181     // if we've got a cached control bar, release it
00182     if (m_ipControlBar) {
00183         m_ipControlBar->Release();
00184         m_ipControlBar = NULL;
00185     }
00186
00187     //
00188     // Install new pieces if necessary
00189     //
00190
00191     // if a new one came in, cache and AddRef
00192     if (pControlbar) {
00193         m_ipControlBar = pControlbar;
00194         m_ipControlBar->AddRef();
00195
00196         hr = m_ipControlBar->Create(TOOLBAR,  // type of control to be created
00197             dynamic_cast<IExtendControlbar *>(this),
00198             reinterpret_cast<IUnknown **>(&m_ipToolbar));
00199         _ASSERT(SUCCEEDED(hr));
00200
00201         // add the bitmap to the toolbar
00202         HBITMAP hbmp = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_TOOLBAR1));
00203         hr = m_ipToolbar->AddBitmap(3, hbmp, 16, 16, RGB(0, 128, 128)); // NOTE, hardcoded value 3
00204         _ASSERT(SUCCEEDED(hr));
00205
00206         // Add the buttons to the toolbar
00207         hr = m_ipToolbar->AddButtons(ARRAYLEN(SnapinButtons1), SnapinButtons1);
00208         _ASSERT(SUCCEEDED(hr));
00209     }
00210
00211     return hr;
00212 }
00213
00214 HRESULT CToolBarExtension::ControlbarNotify(
00215                                      /* [in] */ MMC_NOTIFY_TYPE event,
00216                                      /* [in] */ LPARAM arg,
00217                                      /* [in] */ LPARAM param)
00218 {
00219
00220     _TCHAR pszMsg[255];
00221
00222   BYTE *pbVehicleStatus = NULL;
00223
00224   HRESULT hr = S_OK;
00225
00226     if (event == MMCN_SELECT) {
00227
00228     BOOL bScope = (BOOL) LOWORD(arg);
00229         BOOL bSelect = (BOOL) HIWORD(arg);
00230
00231     if (bSelect) {
00232
00233       // Always make sure the toolbar is attached
00234       hr = m_ipControlBar->Attach(TOOLBAR, m_ipToolbar);
00235
00236       // Set button states
00237
00238       //fake value to set toolbar button states
00239       iStatus = RUNNING;
00240       SetToolbarButtons(iStatus);
00241
00242     } else {
00243       // Always make sure the toolbar is detached
00244       hr = m_ipControlBar->Detach(m_ipToolbar);
00245     }
00246
00247     } else if (event == MMCN_BTN_CLICK) {
00248     //the arg parameter contains the data object from the primary
00249     //snap-in. Use it to get the display name of the currently selected item
00250         WCHAR pszName[255];
00251     HRESULT hr = ExtractString(reinterpret_cast<IDataObject *>(arg), s_cfDisplayName, pszName, sizeof(pszName));
00252         MAKE_TSTRPTR_FROMWIDE(ptrname, pszName);
00253
00254     switch ((int)param)
00255     {
00256     case ID_BUTTONSTART:
00257       iStatus = RUNNING;
00258       break;
00259
00260     case ID_BUTTONPAUSE:
00261       iStatus = PAUSED;
00262       break;
00263
00264     case ID_BUTTONSTOP:
00265       iStatus = STOPPED;
00266       break;
00267     }
00268
00269
00270     _stprintf(pszMsg, _T("%s selected and extension button %s pressed"), ptrname,
00271       (long)param == ID_BUTTONSTART ? _T("1") :
00272     (long)param == ID_BUTTONPAUSE ? _T("2") :
00273     (long)param == ID_BUTTONSTOP ? _T("3") : _T("!!!unknown command!!!"));
00274
00275
00276         ::MessageBox(NULL, pszMsg, _T("Messagebox from Toolbar Extension"), MB_OK|MB_ICONEXCLAMATION);
00277
00278     //Reset toolbar button states
00279     SetToolbarButtons(iStatus);
00280
00281     }
00282
00283     return hr;
00284 }
00285
00286 HRESULT CToolBarExtension::SetToolbarButtons(STATUS iVehicleStatus)
00287 {
00288
00289   HRESULT hr = S_OK;
00290
00291   switch (iVehicleStatus)
00292   {
00293   case RUNNING:
00294     m_ipToolbar->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, TRUE);
00295     m_ipToolbar->SetButtonState(ID_BUTTONSTART, ENABLED, FALSE);
00296     m_ipToolbar->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00297     m_ipToolbar->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00298     m_ipToolbar->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00299     m_ipToolbar->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00300     break;
00301
00302   case PAUSED:
00303     m_ipToolbar->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00304     m_ipToolbar->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00305     m_ipToolbar->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, TRUE);
00306     m_ipToolbar->SetButtonState(ID_BUTTONPAUSE, ENABLED, FALSE);
00307     m_ipToolbar->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00308     m_ipToolbar->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00309     break;
00310
00311   case STOPPED:
00312     m_ipToolbar->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00313     m_ipToolbar->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00314     m_ipToolbar->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00315     m_ipToolbar->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00316     m_ipToolbar->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, TRUE);
00317     m_ipToolbar->SetButtonState(ID_BUTTONSTOP, ENABLED, FALSE);
00318     break;
00319   }
00320
00321   return hr;
00322 }
00323
00324
00325
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBitmapWnd Member List

This is the complete list of members for CBitmapWnd, including all inherited members.
CBitmapWnd(IStream *pStream) | CBitmapWnd |
CBitmapWnd(PCWSTR pszFileName) | CBitmapWnd |
m_cRef | CBitmapWnd | [private]
m_hBitmap | CBitmapWnd | [private]
m_Image | CBitmapWnd | [private]
OnPaint(HWND hWnd) | CBitmapWnd | [private]
QueryInterface(REFIID iid, LPVOID *ppvObj) | CBitmapWnd |
Register() | CBitmapWnd | [static]
STDMETHOD_(ULONG, AddRef)() | CBitmapWnd |
STDMETHOD_(ULONG, Release)() | CBitmapWnd |
WindowProc(HWND, UINT, WPARAM, LPARAM) | CBitmapWnd | [private, static]
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/LinkList.c Source File

  • WinBase
  • Debug
  • Deb

LinkList.c

Go to the documentation of this file.
00001 /************************************************************************
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 MODULE    : LinkList.C - Ordered Double Linked List Package
00010
00011 PURPOSE   : Provide a general, sorted, double linked list package
00012 FUNCTIONS :
00013   CreateList        - allocate memory for a new list, registers the
00014                       ordering function
00015   CreateNode        - allocate memory fpr a new node that can be put
00016                       into the linked list
00017   InsertNode        - insert a new node into the list
00018   SetCurrentNode    - finds the 1st occurence of a node that matches
00019                       a key(s) according to the match function
00020                       and sets it as the current node
00021   SetCurrentNodeEx  - finds the Nth occurence of a node that matches
00022                       a key(s) according to the match function
00023                       and sets it as the current node
00024   GetCurrentNode    - get the current node
00025   GetFirstNode      - get the first (left-most) node in the list
00026   GetLastNode       - get the last (right-most) node in the list
00027   GetNextNode       - get the next (right) node from the current
00028   GetPrevNode       - get the previous (left) node from the current
00029   DeleteCurrentNode - deletes the current node from the list and
00030                       frees the memory associated with it
00031   DestroyNode       - deallocates the memory associated with a node
00032   DestroyList       - deallocates the memory associated with a list,
00033                       does not delete any of the nodes
00034   GetListError      - gets the current list error
00035
00036 COMMENTS  : The application must serialize access to the linked list
00037
00038   Format of the Ordering and Matching functions is as follows:
00039   -----------------------------------------------------------
00040
00041   int OrderFunc( PNODE pNodeOne, PNODE pNodeTwo )
00042   {
00043     if( (pNodeOne->pNodeData).SortKey <  (pNodeTwo->pNodeData).SortKey )
00044       return( LIST_LEFT_OF  );
00045     if( (pNodeOne->pNodeData).SortKey == (pNodeTwo->pNodeData).SortKey )
00046       return( LIST_MATCH    );
00047     if( (pNodeOne->pNodeData).SortKey  > (pNodeTwo->pNodeData).SortKey )
00048       return( LIST_RIGHT_OF );
00049   }
00050
00051 ************************************************************************/
00052 #include <StdLib.H>     // malloc(), free()
00053 #include "LinkList.H"
00054
00055 //-- 0L pointer dereferencing checking macro
00056 #define CHECK_POINTER( ppNode )                                       \
00057           if( ppNode == 0L ) {                                      \
00058             return( pList->ListError = LIST_ERROR_DEREFERENCE_NULL ); \
00059           }
00060
00061
00062 // ************************************************************************
00063 // FUNCTION : CreateList( PLIST* ppList, int (*)(PNODE, PNODE) ) )
00064 // PURPOSE  : allocate a new list, registers the ordering function
00065 // COMMENTS : sets all pointers to 0L
00066 // ************************************************************************
00067 BOOL
00068 CreateList( PLIST* ppList, int (*OrderFunction)( PNODE pNodeOne, PNODE pNodeTwo ) )
00069 {
00070   *ppList = (PLIST) malloc( sizeof(LIST) );
00071   if( ppList == 0L ) {
00072     (*ppList)->ListError = LIST_NO_ERROR;
00073     return( FALSE );
00074   }
00075
00076   //-- register the link list data ordering function
00077   (*ppList)->OrderFunction = OrderFunction;
00078
00079   //-- initialize the general linked list node pointers to 0L
00080   (*ppList)->pFirstNode   = 0L;
00081   (*ppList)->pCurrentNode = 0L;
00082   (*ppList)->pLastNode    = 0L;
00083
00084   //-- indicate no error
00085   (*ppList)->ListError  = LIST_NO_ERROR;
00086
00087   return( TRUE );
00088 }
00089
00090
00091 // ************************************************************************
00092 // FUNCTION : CreateNode( PNODE* )
00093 // PURPOSE  : create/allocate a new node that can be put into list
00094 // COMMENTS :
00095 // ************************************************************************
00096 BOOL
00097 CreateNode( PNODE* ppNewNode )
00098 {
00099   *ppNewNode = (PNODE) malloc( sizeof(NODE) );
00100   if( *ppNewNode == 0L ) {
00101     return( FALSE );
00102   }
00103
00104   //-- initialize the node pointers to 0L
00105   (*ppNewNode)->pRightLink = 0L;
00106   (*ppNewNode)->pLeftLink  = 0L;
00107
00108   return( TRUE );
00109 }
00110
00111
00112 // ************************************************************************
00113 // FUNCTION : InsertNode( PLIST pList, PNODE )
00114 // PURPOSE  : insert a new node into the list
00115 // COMMENTS :
00116 //   All nodes must have a unique key entry (from order function), if a
00117 //   match is found during an insert then the old node gets replaced with
00118 //   the new node.
00119 //
00120 //  NOTE: changes pList->pCurrentNode
00121 // ************************************************************************
00122 BOOL
00123 InsertNode( PLIST pList, PNODE pNewNode )
00124 {
00125   int Position;
00126   int LastPosition;
00127
00128   //-- if this is the first node in a new list
00129   if( pList->pFirstNode == 0L ) {
00130     pList->pFirstNode   = pNewNode;
00131     pList->pLastNode    = pNewNode;
00132     pList->pCurrentNode = pNewNode;
00133     pList->ListError    = LIST_NO_ERROR;
00134     return( TRUE );
00135   }
00136
00137   Position = (*(pList->OrderFunction))( pNewNode, pList->pCurrentNode );
00138
00139   //-- search for insertion point
00140   while( pList->pCurrentNode != 0L ) {
00141
00142     LastPosition = Position;
00143     Position = (*(pList->OrderFunction))(pNewNode, pList->pCurrentNode);
00144
00145     if( pList->pFirstNode == pList->pLastNode )
00146       break;
00147
00148     if( Position != LastPosition )
00149       break;
00150
00151     if( pList->pCurrentNode == pList->pFirstNode ) {
00152       if( Position == LIST_RIGHT_OF ) {
00153         pList->pCurrentNode = pList->pCurrentNode->pRightLink;
00154         continue;
00155       }
00156       break;
00157     }
00158
00159     if( pList->pCurrentNode == pList->pLastNode ) {
00160       if( Position == LIST_LEFT_OF ) {
00161         pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
00162         continue;
00163       }
00164       break;
00165     }
00166
00167     if( Position == LastPosition ) {
00168       if( Position == LIST_LEFT_OF) {
00169         pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
00170         continue;
00171       }
00172       if( Position == LIST_RIGHT_OF ) {
00173         pList->pCurrentNode = pList->pCurrentNode->pRightLink;
00174         continue;
00175       }
00176       break;
00177     }
00178
00179   }
00180
00181   //-- now, insert the pNewNode
00182   switch( Position ) {
00183
00184     case LIST_LEFT_OF:
00185       pNewNode->pRightLink = pList->pCurrentNode;
00186       pNewNode->pLeftLink  = pList->pCurrentNode->pLeftLink;
00187       if( pList->pCurrentNode == pList->pFirstNode )
00188         pList->pFirstNode = pNewNode;
00189       else
00190         pList->pCurrentNode->pLeftLink->pRightLink = pNewNode;
00191       pList->pCurrentNode->pLeftLink = pNewNode;
00192       break;
00193
00194   #if 1  // replace duplicates with new data
00195
00196     case LIST_MATCH:
00197       pNewNode->pLeftLink  = pList->pCurrentNode->pLeftLink;
00198       pNewNode->pRightLink = pList->pCurrentNode->pRightLink;
00199       if( pList->pCurrentNode == pList->pLastNode )
00200         pList->pLastNode = pNewNode;
00201       else
00202         pList->pCurrentNode->pRightLink->pLeftLink = pNewNode;
00203       if( pList->pCurrentNode == pList->pFirstNode )
00204         pList->pFirstNode = pNewNode;
00205       else
00206         pList->pCurrentNode->pLeftLink->pRightLink = pNewNode;
00207       // note: doesn't destroy extra data associated with the node
00208       DestroyNode( pList->pCurrentNode );
00209       break;
00210
00211   #else // or allow duplicates
00212
00213     case LIST_MATCH:
00214
00215   #endif
00216
00217     case LIST_RIGHT_OF:
00218       pNewNode->pLeftLink  = pList->pCurrentNode;
00219       pNewNode->pRightLink = pList->pCurrentNode->pRightLink;
00220       if( pList->pCurrentNode == pList->pLastNode )
00221         pList->pLastNode = pNewNode;
00222       else
00223         pList->pCurrentNode->pRightLink->pLeftLink = pNewNode;
00224       pList->pCurrentNode->pRightLink = pNewNode;
00225       break;
00226
00227   }
00228   pList->pCurrentNode = pNewNode;
00229   pList->ListError    = LIST_NO_ERROR;
00230
00231   return( TRUE );
00232 }
00233
00234
00235 // ************************************************************************
00236 // FUNCTION : SetCurrentNode( PLIST pList, PNODE, int (*)(PNODE, PNODE) )
00237 // PURPOSE  : finds the first occurence of a node from the list that matches
00238 //            a key(s) according to the match function.
00239 // COMMENTS :
00240 //   May use the ordering function or a new matching function if not
00241 //   searching for a match based on the primary ordering key.
00242 //   NOTE: the matching and ordering functions have the same definition.
00243 //   NOTE: changes pList->pCurrentNode.
00244 // ************************************************************************
00245 BOOL
00246 SetCurrentNode( PLIST pList, PNODE pKeyNode,
00247          int (*MatchFunction)( PNODE pNodeOne, PNODE pNodeTwo ) )
00248 {
00249   return( SetCurrentNodeEx( pList, pKeyNode, MatchFunction, 1 ) );
00250 }
00251
00252
00253 // ************************************************************************
00254 // FUNCTION : SetCurrentNodeEx( PLIST pList, PNODE, int (*)(PNODE, PNODE), int )
00255 // PURPOSE  : finds the Nth occurence of a node from the list that matches
00256 //            a key(s) according to the match function.
00257 // COMMENTS :
00258 //   May use the ordering function or a new matching function if not
00259 //   searching for a match based on the primary ordering key.
00260 //   NOTE: the matching and ordering functions have the same definition.
00261 //   NOTE: changes pList->pCurrentNode.
00262 // ************************************************************************
00263 BOOL
00264 SetCurrentNodeEx( PLIST pList, PNODE pKeyNode,
00265   int (*MatchFunction)( PNODE pNodeOne, PNODE pNodeTwo ),
00266   int Occurence )
00267 {
00268   int Position;
00269
00270   //-- if list is empty, exit
00271   if( pList->pCurrentNode == 0L ) {
00272     pList->ListError = LIST_ERROR_NO_NODE;
00273     return( FALSE );
00274   }
00275
00276   //-- if match and order are same function
00277   if( MatchFunction == (pList->OrderFunction) ) {
00278     int  LastPosition;
00279
00280     LastPosition = Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);
00281
00282     while( Occurence ) {
00283       if( ( Position == LIST_LEFT_OF ) && ( LastPosition == LIST_LEFT_OF )
00284           && ( pList->pCurrentNode != pList->pFirstNode ) )
00285         pList->pCurrentNode = pList->pCurrentNode->pLeftLink;
00286       else if( ( Position == LIST_RIGHT_OF ) && ( LastPosition == LIST_RIGHT_OF )
00287             && ( pList->pCurrentNode != pList->pLastNode ) )
00288         pList->pCurrentNode = pList->pCurrentNode->pRightLink;
00289       else {
00290         Occurence--;
00291         continue;
00292       }
00293       LastPosition = Position;
00294       Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);
00295     }
00296
00297   }
00298   //-- match and order are not the same function, thus start
00299   //   the search at the front of the list
00300   else {
00301     pList->pCurrentNode = pList->pFirstNode;
00302     while( (Occurence > 0) && ( (pList->pCurrentNode) != 0L ) ) {
00303       Position = (*MatchFunction)(pKeyNode, pList->pCurrentNode);
00304       if( Position == LIST_MATCH )
00305         Occurence--;
00306       if( Occurence > 0 )
00307         pList->pCurrentNode = pList->pCurrentNode->pRightLink;
00308     }
00309   }
00310
00311   if( ( Position == LIST_MATCH ) && ( Occurence == 0 ) ) {
00312     pList->ListError = LIST_NO_ERROR;
00313     return( TRUE );
00314   }
00315   pList->ListError = LIST_ERROR_NO_MATCH;
00316
00317   return( FALSE );
00318 }
00319
00320
00321 // ************************************************************************
00322 // FUNCTION : GetCurrentNode( PLIST pList, PNODE* )
00323 // PURPOSE  : gets the current node from the list
00324 // COMMENTS :
00325 //   Does not change pList->pCurrentNode.
00326 //   Changes ppNode, thus do not pass in a ppNode which has additional
00327 //   memory associated with it.
00328 // ************************************************************************
00329 BOOL
00330 GetCurrentNode( PLIST pList, PNODE* ppNode )
00331 {
00332   CHECK_POINTER( ppNode );
00333   if( pList->pCurrentNode == 0L ) {
00334     pList->ListError = LIST_ERROR_NO_NODE;
00335     return( FALSE );
00336   }
00337   *ppNode = pList->pCurrentNode;
00338   pList->ListError = LIST_NO_ERROR;
00339
00340   return( TRUE );
00341 }
00342
00343
00344 // ************************************************************************
00345 // FUNCTION : GetFirstNode( PLIST pList, PNODE* )
00346 // PURPOSE  : gets the first (left-most) node from the list
00347 // COMMENTS :
00348 //   Does not change pList->pCurrentNode.
00349 //   Changes ppNode, thus do not pass in a ppNode which has additional
00350 //   memory associated with it.
00351 // ************************************************************************
00352 BOOL
00353 GetFirstNode( PLIST pList, PNODE* ppNode )
00354 {
00355   CHECK_POINTER( ppNode );
00356   if( pList->pFirstNode == 0L ) {
00357     pList->ListError = LIST_ERROR_NO_NODE;
00358     return( FALSE );
00359   }
00360   *ppNode = pList->pFirstNode;
00361   pList->ListError = LIST_NO_ERROR;
00362
00363   return( TRUE );
00364 }
00365
00366
00367 // ************************************************************************
00368 // FUNCTION : GetLastNode( PLIST pList, PNODE* )
00369 // PURPOSE  : get the last (right-most) node from the List
00370 // COMMENTS :
00371 //   Does not change pList->pCurrentNode.
00372 //   Changes ppNode, thus do not pass in a ppNode which has additional
00373 //   memory associated with it.
00374 // ************************************************************************
00375 BOOL
00376 GetLastNode( PLIST pList, PNODE* ppNode )
00377 {
00378   CHECK_POINTER( ppNode );
00379   if( pList->pLastNode == 0L ) {
00380     pList->ListError = LIST_ERROR_NO_NODE;
00381     return( FALSE );
00382   }
00383   *ppNode = pList->pLastNode;
00384   pList->ListError = LIST_NO_ERROR;
00385
00386   return( TRUE );
00387 }
00388
00389
00390 // ************************************************************************
00391 // FUNCTION : GetNextNode( PLIST pList, PNODE* )
00392 // PURPOSE  : get the next (right) node from the pList->pCurrentNode
00393 // COMMENTS :
00394 //   Does not change pList->pCurrentNode.
00395 //   Changes ppNode, thus do not pass in a ppNode which has additional
00396 //   memory associated with it.
00397 // ************************************************************************
00398 BOOL
00399 GetNextNode( PLIST pList, PNODE* ppNode )
00400 {
00401   CHECK_POINTER( ppNode );
00402   if( (*ppNode)->pRightLink == 0L ) {
00403     pList->ListError = LIST_ERROR_NO_NODE;
00404     return( FALSE );
00405   }
00406   *ppNode = (*ppNode)->pRightLink;
00407   pList->ListError = LIST_NO_ERROR;
00408
00409   return( TRUE );
00410 }
00411
00412
00413 // ************************************************************************
00414 // FUNCTION : GetPrevNode( PLIST pList, PNODE* )
00415 // PURPOSE  : get the previous (left) node from the pList->pCurrentNode
00416 // COMMENTS :
00417 //   Does not change pList->pCurrentNode.
00418 //   Changes ppNode, thus do not pass in a ppNode which has additional
00419 //   memory associated with it.
00420 // ************************************************************************
00421 BOOL
00422 GetPrevNode( PLIST pList, PNODE* ppNode )
00423 {
00424   CHECK_POINTER( ppNode );
00425   if( (*ppNode)->pLeftLink == 0L ) {
00426     pList->ListError = LIST_ERROR_NO_NODE;
00427     return( FALSE );
00428   }
00429   *ppNode = (*ppNode)->pLeftLink;
00430   pList->ListError = LIST_NO_ERROR;
00431
00432   return( TRUE );
00433 }
00434
00435
00436 // ************************************************************************
00437 // FUNCTION : DeleteCurrentNode( PLIST pList )
00438 // PURPOSE  : deletes the current node from the list and frees the memory
00439 //            associated with it
00440 // COMMENTS :
00441 //   Changes pList->pCurrentNode.
00442 //
00443 //   Typically, SetCurrentNode (or SetCurrentNodeEx) is called first to set
00444 //   pList->pCurrentNode.  Also, any addtional memory associated with this
00445 //   node should be freed first before calling this function.
00446 // ************************************************************************
00447 BOOL
00448 DeleteCurrentNode( PLIST pList )
00449 {
00450   PNODE pOldCurrentNode;
00451
00452   if( pList->pCurrentNode != 0L ) {
00453     pOldCurrentNode = pList->pCurrentNode;
00454
00455     if( pOldCurrentNode == pList->pFirstNode ) {
00456       pList->pFirstNode   = pOldCurrentNode->pRightLink;
00457       pList->pCurrentNode = pOldCurrentNode->pRightLink;
00458     }
00459     else {
00460       pOldCurrentNode->pLeftLink->pRightLink = pOldCurrentNode->pRightLink;
00461       pList->pCurrentNode = pOldCurrentNode->pLeftLink;
00462     }
00463
00464     if( pOldCurrentNode == pList->pLastNode )
00465       pList->pLastNode = pOldCurrentNode->pLeftLink;
00466     else
00467       pOldCurrentNode->pRightLink->pLeftLink = pOldCurrentNode->pLeftLink;
00468
00469     DestroyNode( pOldCurrentNode );
00470     pList->ListError = LIST_NO_ERROR;
00471     return( TRUE );
00472   }
00473   pList->ListError = LIST_NO_ERROR;
00474
00475   return( TRUE );
00476 }
00477
00478
00479 // ************************************************************************
00480 // FUNCTION : DestroyNode( PNODE pNode )
00481 // PURPOSE  : deallocates a node
00482 // COMMENTS :
00483 // ************************************************************************
00484 BOOL
00485 DestroyNode( PNODE pNode )
00486 {
00487   free( pNode );
00488
00489   return( TRUE );
00490 }
00491
00492
00493 // ************************************************************************
00494 // FUNCTION : DestroyList( PLIST pList )
00495 // PURPOSE  : deallocates a list, does not free any nodes, if present
00496 // COMMENTS :
00497 // ************************************************************************
00498 BOOL
00499 DestroyList( PLIST pList )
00500 {
00501   free( pList );
00502   pList->ListError = LIST_NO_ERROR;
00503
00504   return( TRUE );
00505 }
00506
00507
00508 // ************************************************************************
00509 // FUNCTION : GetListError( PLIST pList )
00510 // PURPOSE  : get the last linked list error
00511 // COMMENTS :
00512 // ************************************************************************
00513 int
00514 GetListError( PLIST pList )
00515 {
00516   return( pList->ListError );
00517 }
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletSessionRequest Member List

This is the complete list of members for tagAppletSessionRequest, including all inherited members.
aChannelRegistryKeys | tagAppletSessionRequest
apCollapsedCaps | tagAppletSessionRequest
apNonCollapsedCaps | tagAppletSessionRequest
aStaticChannels | tagAppletSessionRequest
cCollapsedCaps | tagAppletSessionRequest
cDynamicChannels | tagAppletSessionRequest
cNonCollapsedCaps | tagAppletSessionRequest
cStaticChannels | tagAppletSessionRequest
nStartupChannelType | tagAppletSessionRequest
SessionKey | tagAppletSessionRequest
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/CAsyncTest.cpp Source File

  • Com
  • async
  • server

CAsyncTest.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "CAsyncTest.h"
00018 #include "CAsyncXXX.h"
00019 #include "Debug.h"
00020
00021 #include "stdio.h"
00022
00023 #include <process.h>
00024
00025 CAsyncTest::CAsyncTest(CAsyncXXX<CServer, ITest, CAsyncTest> *pA)
00026     : m_lpAsyncXXX(pA), m_state(CallNone), m_hResult(S_OK)
00027 {
00028   _ASSERT(m_lpAsyncXXX != NULL);
00029   DEBUGTRACE(_T("CAsyncTest ctor"));
00030 }
00031
00032 CAsyncTest::~CAsyncTest()
00033 {
00034   DEBUGTRACE(_T("CAsyncTest dtor"));
00035 }
00036
00037 bool __stdcall CAsyncTest::Init()
00038 {
00039   return true;
00040 }
00041
00042 CAsyncTest::threadParam* g_pthdParam;
00043
00044
00045
00046 /*
00047  * The following method can be used as a boilerplate for Begin_XXX of the asynchronous interface.
00048  * There are several items to be noted here
00049  *
00050  *  1) You must track the asynchronous inteface state. In particular each call object can only serve one call at a time.
00051  *
00052  *  2) No assuptions can be made on whether the ISynchronize interface is in the signaled or not signaled state.
00053  *
00054  *  3) Any information that is passed in which needs to persist past this call needs to be saved; for example one may pass
00055  *  in an IID requesting a specific interface.
00056  *
00057  *  4) Save the HRESULT that is returned by this method for the case where the caller ignores the return code and calls
00058  *  the Finish_XXX method blindly.
00059  *
00060  * Depending on how quickly you can complete the call you may choose to handle the request synchronous. If this is the case
00061  * after you've done whatever processing required call ISynchronize::Signal() so that COM will know to call your Finish_XXX
00062  * method immediately.
00063  */
00064 HRESULT __stdcall CAsyncTest::Begin_Test1(BSTR bstr)
00065 {
00066   CHECKPOINTER(bstr);
00067   DEBUGTRACE(_T("In AsyncTest::Begin_Test1. string is %S"), bstr);
00068   printf("In AsyncTest::Begin_Test1. string is %S\n", bstr);
00069
00070   // Make certain that the call object is not servicing another call
00071   if (m_state != CallNone)
00072     return (m_hResult = RPC_S_CALLPENDING);
00073
00074
00075   // Save state and set the ISynchronize interface to the non-signaled state
00076   m_state = CallPending;
00077   m_lpAsyncXXX->Reset();
00078
00079 /*
00080  *  Procedure specific implementation. Here I save the BSTR parameter passed in
00081  *  and pass the processing off to a callback function in the case of a STA
00082  *  object or a different thread in the case of a MTA object
00083  */
00084
00085  // TODO test to see if client has called ICancelMethods::Cancel()
00086   g_pthdParam =  new threadParam(10000, this, Test1, SysAllocString(bstr));
00087 #if defined(_APARTMENT_)
00088   g_pthdParam->id = SetTimer(NULL, 0, g_pthdParam->wait, CAsyncTest::TimerProc);
00089 #else
00090   _beginthread((void(__cdecl*)(void*))ThreadProc, 0, g_pthdParam);
00091 #endif
00092
00093   // Save hresult
00094   return (m_hResult = S_OK);
00095 }
00096
00097
00098 /*
00099  * The following method can be used as a boilerplate for Finish_XXX of the asynchronous interface.
00100  * There are several items to be noted here
00101  *
00102  *  1) You must track the asynchronous inteface state. In particular Begin_XXX must have been called and returned
00103  *  a success code.
00104  *
00105  *  2) If the client calls Finish_XXX prior to the completion of the work; you need to call ISynchronize::Wait()
00106  *  and block until the work is done.
00107  */
00108 HRESULT __stdcall CAsyncTest::Finish_Test1(BSTR bstr)
00109 {
00110   CHECKPOINTER(bstr);
00111   DEBUGTRACE(_T("In AsyncTest::Finish_Test1"));
00112
00113   if (m_state == CallNone)
00114     return (m_hResult = RPC_E_CALL_COMPLETE); // Begin_XXX was never called
00115   else if (m_state == CallPending)
00116     m_lpAsyncXXX->Wait(0, INFINITE);      // Call not yet completed. Block till ISynchronize::Signal()
00117   else if (FAILED(m_hResult))
00118     return m_hResult;             // Begin_XXX returned an error
00119
00120   _ASSERT(m_state == CallDone);
00121   HRESULT hr = SysReAllocString(&bstr, g_pthdParam->data);  // Fill in any [out] parameters
00122   _ASSERT(SUCCEEDED(hr));
00123   printf("In AsyncTest::Finish_Test1 string is %S\n", bstr);
00124   m_state = CallNone;               //  Set the state back to free so that it can be reused
00125   return S_OK;
00126 }
00127
00128
00129 HRESULT __stdcall CAsyncTest::Begin_Test2(BSTR bstrIn)
00130 {
00131   CHECKPOINTER(bstrIn);
00132   DEBUGTRACE(_T("In AsyncTest::Begin_Test2. string is %S"), bstrIn);
00133   printf("In AsyncTest::Begin_Test2. string is %S\n", bstrIn);
00134
00135   if (m_state != CallNone)
00136     return RPC_S_CALLPENDING;
00137
00138   m_state = CallPending;
00139   m_lpAsyncXXX->Reset();
00140
00141   g_pthdParam =  new threadParam(10000, this, Test2, SysAllocString(bstrIn));
00142 #if defined(_APARTMENT_)
00143   g_pthdParam->id = SetTimer(NULL, 0, g_pthdParam->wait, CAsyncTest::TimerProc);
00144 #else
00145   _beginthread((void(__cdecl*)(void*))ThreadProc, 0, g_pthdParam);
00146 #endif
00147   return S_OK;
00148 }
00149 HRESULT __stdcall CAsyncTest::Finish_Test2(BSTR *lpbstrOut)
00150 {
00151   CHECKPOINTER(lpbstrOut);
00152   DEBUGTRACE(_T("In AsyncTest::Finish_Test2"));
00153
00154   if (m_state == CallNone)
00155     return RPC_E_CALL_COMPLETE;
00156   else if (m_state == CallPending)
00157     return RPC_S_CALLPENDING;
00158
00159   _ASSERT(m_state == CallDone);
00160   *lpbstrOut = g_pthdParam->data;
00161   printf("In AsyncTest::Finish_Test2 string is %S\n", *lpbstrOut);
00162   m_state = CallNone;
00163   return S_OK;
00164 }
00165
00166
00167
00168 /*
00169  *  This is a simple example of a "worker" thread or callback which a Begin_XXX will call to finish the
00170  *  method asynchronously. Much of this function will be specific to the method that the client calls
00171  *  however there are two items of interest here.
00172  *
00173  *    1) ISynchronize::Signal() needs to be called after the work is completed. This call is only valid
00174  *    to call in the same apartment as the Begin_XXX method. Which means if this is a STA object either
00175  *    the "worker" thread must really be a callback method as I've done below via the Windows API SetTimer()
00176  *    or the thread must use some form of IPC to signal to the same thread that the Begin_XXX method was called
00177  *
00178  *    2) Set the state to "completed" so that Finish_XXX will know the work is done.
00179  *
00180  */
00181 #if defined(_APARTMENT_)
00182 void CALLBACK CAsyncTest::TimerProc(HWND, UINT, UINT_PTR, DWORD)
00183 {
00184   DEBUGTRACE(_T("In CAsyncTest::TimerProc"));
00185   printf("In CAsyncTest::TimerProc\n");
00186
00187   KillTimer(NULL, g_pthdParam->id);
00188   g_pthdParam->func == Test1 ?
00189     g_pthdParam->pA->m_lpAsyncXXX->GetISync()->Test1(g_pthdParam->data) :
00190     g_pthdParam->pA->m_lpAsyncXXX->GetISync()->Test2(NULL, &g_pthdParam->data);
00191   g_pthdParam->pA->m_state = CAsyncTest::CallDone;
00192   g_pthdParam->pA->m_lpAsyncXXX->Signal();
00193
00194   DEBUGTRACE(_T("Leaving CAsyncTest::TimerProc"));
00195   printf("Leaving CAsyncTest::TimerProc\n");
00196 }
00197 #else
00198 void __cdecl CAsyncTest::ThreadProc(threadParam *pthdParam)
00199 {
00200   DEBUGTRACE(_T("In CAsyncTest::ThreadProc"));
00201   printf("In CAsyncTest::ThreadProc\n");
00202
00203   CoInitializeEx(0, COINIT_MULTITHREADED);
00204   Sleep(g_pthdParam->wait);
00205   g_pthdParam->func == Test1 ?
00206     g_pthdParam->pA->m_lpAsyncXXX->GetISync()->Test1(g_pthdParam->data) :
00207     g_pthdParam->pA->m_lpAsyncXXX->GetISync()->Test2(g_pthdParam->data, &g_pthdParam->data);
00208   g_pthdParam->pA->m_state = CAsyncTest::CallDone;
00209   g_pthdParam->pA->m_lpAsyncXXX->SignalEvent();
00210   CoUninitialize();
00211 }
00212 #endif
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/dataobj.h Source File

  • SysMgmt
  • MMC
  • Proppage

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097 BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
00098
00099 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/ResProp.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

ResProp.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ResProp.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the resource extension property page classes.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 #include "stdafx.h"
00021 #include "ClipBook ServerEx.h"
00022 #include "ResProp.h"
00023 #include "ExtObj.h"
00024 #include "DDxDDv.h"
00025
00026 #ifdef _DEBUG
00027 #define new DEBUG_NEW
00028 #undef THIS_FILE
00029 static char THIS_FILE[] = __FILE__;
00030 #endif
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // CClipBookServerParamsPage property page
00034 /////////////////////////////////////////////////////////////////////////////
00035
00036 IMPLEMENT_DYNCREATE( CClipBookServerParamsPage, CBasePropertyPage )
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // Message Maps
00040
00041 BEGIN_MESSAGE_MAP( CClipBookServerParamsPage, CBasePropertyPage )
00042     //{{AFX_MSG_MAP(CClipBookServerParamsPage)
00043     //}}AFX_MSG_MAP
00044
00045     //
00046     //  TODO: Modify the following lines to represent the data displayed on this page.
00047     //
00048
00049 END_MESSAGE_MAP()
00050
00051 /////////////////////////////////////////////////////////////////////////////
00052 //++
00053 //
00054 //  CClipBookServerParamsPage::CClipBookServerParamsPage
00055 //
00056 //  Description:
00057 //      Default constructor.
00058 //
00059 //  Arguments:
00060 //      None.
00061 //
00062 //  Return Value:
00063 //      None.
00064 //
00065 //--
00066 /////////////////////////////////////////////////////////////////////////////
00067 CClipBookServerParamsPage::CClipBookServerParamsPage( void )
00068     : CBasePropertyPage( CClipBookServerParamsPage::IDD )
00069 {
00070     //
00071     //  TODO: Modify the following lines to represent the data displayed on this page.
00072     //
00073
00074     //{{AFX_DATA_INIT(CClipBookServerParamsPage)
00075     //}}AFX_DATA_INIT
00076
00077     // Setup the property array.
00078     {
00079     } // Setup the property array
00080
00081     m_iddPropertyPage = IDD_PP_CLIPBOOKSERVER_PARAMETERS;
00082     m_iddWizardPage = IDD_WIZ_CLIPBOOKSERVER_PARAMETERS;
00083
00084 } //*** CClipBookServerParamsPage::CClipBookServerParamsPage
00085
00086 /////////////////////////////////////////////////////////////////////////////
00087 //++
00088 //
00089 //  CClipBookServerParamsPage::DoDataExchange
00090 //
00091 //  Description:
00092 //      Do data exchange between the dialog and the class.
00093 //
00094 //  Arguments:
00095 //      pDXIn
00096 //          Data exchange object.
00097 //
00098 //  Return Value:
00099 //      None.
00100 //
00101 //--
00102 /////////////////////////////////////////////////////////////////////////////
00103 void
00104 CClipBookServerParamsPage::DoDataExchange(
00105     CDataExchange * pDXIn
00106     )
00107 {
00108     if ( ! pDXIn->m_bSaveAndValidate || ! BSaved() )
00109     {
00110         AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00111
00112         //
00113         //  TODO: Modify the following lines to represent the data displayed on this page.
00114         //
00115
00116         //  {{AFX_DATA_MAP(CClipBookServerParamsPage)
00117         //}}AFX_DATA_MAP
00118
00119         //
00120         //  Handle numeric parameters.
00121         //
00122
00123         if ( ! BBackPressed() )
00124         {
00125         } // if: back button not pressed
00126
00127         //
00128         //  TODO: Add any additional field validation here.
00129         //
00130
00131         if ( pDXIn->m_bSaveAndValidate )
00132         {
00133             //
00134             //  Make sure all required fields are present.
00135             //
00136
00137             if ( ! BBackPressed() )
00138             {
00139             } // if: back button not pressed
00140         } // if: saving data from dialog
00141     } // if: not saving or haven't saved yet
00142
00143     CBasePropertyPage::DoDataExchange( pDXIn );
00144
00145 } //*** CClipBookServerParamsPage::DoDataExchange
00146
00147 /////////////////////////////////////////////////////////////////////////////
00148 //++
00149 //
00150 //  CClipBookServerParamsPage::OnInitDialog
00151 //
00152 //  Description:
00153 //      Handler for the WM_INITDIALOG message.
00154 //
00155 //  Arguments:
00156 //      None.
00157 //
00158 //  Return Value:
00159 //      TRUE
00160 //          We need the focus to be set for us.
00161 //
00162 //      FALSE
00163 //          We already set the focus to the proper control.
00164 //
00165 //--
00166 /////////////////////////////////////////////////////////////////////////////
00167 BOOL
00168 CClipBookServerParamsPage::OnInitDialog( void )
00169 {
00170     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00171
00172     CBasePropertyPage::OnInitDialog();
00173
00174     //
00175     //  TODO: Limit the size of the text that can be entered in edit controls.
00176     //
00177
00178     //
00179     //  Return TRUE unless you set the focus to a control.
00180     //
00181     //  EXCEPTION: OCX Property Pages should return FALSE..
00182     //
00183
00184     return TRUE;
00185
00186 } //*** CClipBookServerParamsPage::OnInitDialog
00187
00188 /////////////////////////////////////////////////////////////////////////////
00189 //++
00190 //
00191 //  CClipBookServerParamsPage::OnSetActive
00192 //
00193 //  Description:
00194 //      Handler for the PSN_SETACTIVE message.
00195 //
00196 //  Arguments:
00197 //      None.
00198 //
00199 //  Return Value:
00200 //      TRUE
00201 //          Page successfully initialized.
00202 //
00203 //      FALSE
00204 //          Page not initialized.
00205 //
00206 //--
00207 /////////////////////////////////////////////////////////////////////////////
00208 BOOL
00209 CClipBookServerParamsPage::OnSetActive( void )
00210 {
00211     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00212
00213     // Enable/disable the Next/Finish button.
00214     if ( BWizard() )
00215     {
00216         EnableNext( BAllRequiredFieldsPresent() );
00217     } // if: displaying a wizard
00218
00219     return CBasePropertyPage::OnSetActive();
00220
00221 } //*** CClipBookServerParamsPage::OnSetActive
00222
00223 /////////////////////////////////////////////////////////////////////////////
00224 //++
00225 //
00226 //  CClipBookServerParamsPage::OnChangeRequiredField
00227 //
00228 //  Description:
00229 //      Handler for the EN_CHANGE message on the Share name or Path edit
00230 //      controls.
00231 //
00232 //  Arguments:
00233 //      None.
00234 //
00235 //  Return Value:
00236 //      None.
00237 //
00238 //--
00239 /////////////////////////////////////////////////////////////////////////////
00240 void
00241 CClipBookServerParamsPage::OnChangeRequiredField( void )
00242 {
00243     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00244
00245     OnChangeCtrl();
00246
00247     if ( BWizard() )
00248     {
00249         EnableNext( BAllRequiredFieldsPresent() );
00250     } // if: displaying a wizard
00251
00252 } //*** CClipBookServerParamsPage::OnChangeRequiredField
00253
00254 /////////////////////////////////////////////////////////////////////////////
00255 //++
00256 //
00257 //  CClipBookServerParamsPage::BAllRequiredFieldsPresent
00258 //
00259 //  Description:
00260 //      Handler for the EN_CHANGE message on the Share name or Path edit
00261 //      controls.
00262 //
00263 //  Arguments:
00264 //      None.
00265 //
00266 //  Return Value:
00267 //      None.
00268 //
00269 //--
00270 /////////////////////////////////////////////////////////////////////////////
00271 BOOL
00272 CClipBookServerParamsPage::BAllRequiredFieldsPresent( void ) const
00273 {
00274     return TRUE;
00275
00276 } //*** CClipBookServerParamsPage::BAllRequiredFieldsPresent
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DropTgt.Cpp Source File

  • WinUI
  • Shell
  • SampView

DropTgt.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DropTgt.cpp
00013
00014    Description:   Implements CDropTarget.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "DropTgt.h"
00023 #include "Utility.h"
00024
00025 /**************************************************************************
00026
00027    CDropTarget::CDropTarget()
00028
00029 **************************************************************************/
00030
00031 CDropTarget::CDropTarget(CShellFolder *psfParent)
00032 {
00033 g_DllRefCount++;
00034
00035 m_psfParent = psfParent;
00036 if(m_psfParent)
00037    m_psfParent->AddRef();
00038 else
00039    {
00040    delete this;
00041    return;
00042    }
00043
00044 m_pPidlMgr = new CPidlMgr();
00045 if(!m_pPidlMgr)
00046    {
00047    delete this;
00048    return;
00049    }
00050
00051 SHGetMalloc(&m_pMalloc);
00052 if(!m_pMalloc)
00053    {
00054    delete this;
00055    return;
00056    }
00057
00058 m_ObjRefCount = 1;
00059
00060 m_fAcceptFmt = FALSE;
00061
00062 m_cfPrivateData = RegisterClipboardFormat(CFSTR_SAMPVIEWDATA);
00063 }
00064
00065 /**************************************************************************
00066
00067    CDropTarget::~CDropTarget()
00068
00069 **************************************************************************/
00070
00071 CDropTarget::~CDropTarget()
00072 {
00073 if(m_psfParent)
00074    m_psfParent->Release();
00075
00076 if(m_pPidlMgr)
00077    delete m_pPidlMgr;
00078
00079 if(m_pMalloc)
00080    m_pMalloc->Release();
00081
00082 g_DllRefCount--;
00083 }
00084
00085 ///////////////////////////////////////////////////////////////////////////
00086 //
00087 // IUnknown Implementation
00088 //
00089
00090 /**************************************************************************
00091
00092    CDropTarget::QueryInterface()
00093
00094 **************************************************************************/
00095
00096 STDMETHODIMP CDropTarget::QueryInterface(REFIID riid, LPVOID *ppReturn)
00097 {
00098 *ppReturn = NULL;
00099
00100 //IUnknown
00101 if(IsEqualIID(riid, IID_IUnknown))
00102    {
00103    *ppReturn = this;
00104    }
00105
00106 //IDropTarget
00107 else if(IsEqualIID(riid, IID_IDropTarget))
00108    {
00109    *ppReturn = (IDropTarget*)this;
00110    }
00111
00112 if(*ppReturn)
00113    {
00114    (*(LPUNKNOWN*)ppReturn)->AddRef();
00115    return S_OK;
00116    }
00117
00118 return E_NOINTERFACE;
00119 }
00120
00121 /**************************************************************************
00122
00123    CDropTarget::AddRef()
00124
00125 **************************************************************************/
00126
00127 STDMETHODIMP_(DWORD) CDropTarget::AddRef(VOID)
00128 {
00129 return ++m_ObjRefCount;
00130 }
00131
00132 /**************************************************************************
00133
00134    CDropTarget::Release()
00135
00136 **************************************************************************/
00137
00138 STDMETHODIMP_(DWORD) CDropTarget::Release(VOID)
00139 {
00140 if(--m_ObjRefCount == 0)
00141    {
00142    delete this;
00143    return 0;
00144    }
00145
00146 return m_ObjRefCount;
00147 }
00148
00149 ///////////////////////////////////////////////////////////////////////////
00150 //
00151 // IDropTarget Implementation
00152 //
00153
00154 /**************************************************************************
00155
00156    CDropTarget::DragEnter()
00157
00158 **************************************************************************/
00159
00160 STDMETHODIMP CDropTarget::DragEnter(   LPDATAOBJECT pDataObj,
00161                                        DWORD dwKeyState,
00162                                        POINTL pt,
00163                                        LPDWORD pdwEffect)
00164 {
00165 FORMATETC   fmtetc;
00166
00167 fmtetc.cfFormat   = (CLIPFORMAT)m_cfPrivateData;
00168 fmtetc.ptd        = NULL;
00169 fmtetc.dwAspect   = DVASPECT_CONTENT;
00170 fmtetc.lindex     = -1;
00171 fmtetc.tymed      = TYMED_HGLOBAL;
00172
00173 //does the drag source provide our data type?
00174 m_fAcceptFmt = (S_OK == pDataObj->QueryGetData(&fmtetc)) ? TRUE : FALSE;
00175
00176 QueryDrop(dwKeyState, pdwEffect);
00177
00178 return S_OK;
00179 }
00180
00181 /**************************************************************************
00182
00183    CDropTarget::DragOver()
00184
00185 **************************************************************************/
00186
00187 STDMETHODIMP CDropTarget::DragOver(DWORD dwKeyState, POINTL pt, LPDWORD pdwEffect)
00188 {
00189 QueryDrop(dwKeyState, pdwEffect);
00190
00191 return S_OK;
00192 }
00193
00194 /**************************************************************************
00195
00196    CDropTarget::DragLeave()
00197
00198 **************************************************************************/
00199
00200 STDMETHODIMP CDropTarget::DragLeave(VOID)
00201 {
00202 m_fAcceptFmt = FALSE;
00203
00204 return S_OK;
00205 }
00206
00207 /**************************************************************************
00208
00209    CDropTarget::Drop()
00210
00211 **************************************************************************/
00212
00213 STDMETHODIMP CDropTarget::Drop(  LPDATAOBJECT pDataObj,
00214                                  DWORD dwKeyState,
00215                                  POINTL pt,
00216                                  LPDWORD pdwEffect)
00217 {
00218 HRESULT  hr = E_FAIL;
00219
00220 if(QueryDrop(dwKeyState, pdwEffect))
00221    {
00222    FORMATETC   fmtetc;
00223    STGMEDIUM   medium;
00224
00225    fmtetc.cfFormat   = (CLIPFORMAT)m_cfPrivateData;
00226    fmtetc.ptd        = NULL;
00227    fmtetc.dwAspect   = DVASPECT_CONTENT;
00228    fmtetc.lindex     = -1;
00229    fmtetc.tymed      = TYMED_HGLOBAL;
00230
00231    //The user has dropped on us. Get the data from the data object.
00232    hr = pDataObj->GetData(&fmtetc, &medium);
00233    if(SUCCEEDED(hr))
00234       {
00235       DoDrop(medium.hGlobal, DROPEFFECT_MOVE == *pdwEffect);
00236
00237       //release the STGMEDIUM
00238       ReleaseStgMedium(&medium);
00239
00240       return S_OK;
00241       }
00242    }
00243
00244 *pdwEffect = DROPEFFECT_NONE;
00245
00246 return hr;
00247 }
00248
00249 /**************************************************************************
00250
00251    CDropTarget::QueryDrop()
00252
00253 **************************************************************************/
00254
00255 BOOL CDropTarget::QueryDrop(DWORD dwKeyState, LPDWORD pdwEffect)
00256 {
00257 DWORD dwOKEffects = *pdwEffect;
00258
00259 *pdwEffect = DROPEFFECT_NONE;
00260
00261 if(m_fAcceptFmt)
00262    {
00263    *pdwEffect = GetDropEffectFromKeyState(dwKeyState);
00264
00265    //we don't accept links
00266    if(DROPEFFECT_LINK == *pdwEffect)
00267       *pdwEffect = DROPEFFECT_NONE;
00268
00269    /*
00270    Check if the drag source application allows the drop effect desired by the
00271    user. The drag source specifies this in DoDragDrop.
00272    */
00273    if(*pdwEffect & dwOKEffects)
00274       return TRUE;
00275    }
00276
00277 return FALSE;
00278 }
00279
00280 /**************************************************************************
00281
00282    CDropTarget::GetDropEffectFromKeyState()
00283
00284 **************************************************************************/
00285
00286 DWORD CDropTarget::GetDropEffectFromKeyState(DWORD dwKeyState)
00287 {
00288 //move is the default
00289 DWORD dwDropEffect = DROPEFFECT_MOVE;
00290
00291 if(dwKeyState & MK_CONTROL)
00292    {
00293    if(dwKeyState & MK_SHIFT)
00294       {
00295       dwDropEffect = DROPEFFECT_LINK;
00296       }
00297    else
00298       {
00299       dwDropEffect = DROPEFFECT_COPY;
00300       }
00301    }
00302
00303 return dwDropEffect;
00304 }
00305
00306 /**************************************************************************
00307
00308    CDropTarget::DoDrop()
00309
00310 **************************************************************************/
00311
00312 BOOL CDropTarget::DoDrop(HGLOBAL hMem, BOOL fCut)
00313 {
00314 BOOL     fSuccess = FALSE;
00315
00316 if(hMem)
00317    {
00318    LPPRIVCLIPDATA pData = (LPPRIVCLIPDATA)GlobalLock(hMem);
00319
00320    if(pData)
00321       {
00322       CShellFolder   *psfFrom = NULL;
00323       IShellFolder   *psfDesktop;
00324       LPITEMIDLIST   pidl;
00325
00326       pidl = (LPITEMIDLIST)((LPBYTE)(pData) + pData->aoffset[0]);
00327       /*
00328       This is a fully qualified PIDL, so use the desktop folder to get the
00329       IShellFolder for this folder.
00330       */
00331       SHGetDesktopFolder(&psfDesktop);
00332       if(psfDesktop)
00333          {
00334          //if the source and the target folders are the same, this is a NOOP
00335          LPITEMIDLIST   pidlThisFolder = m_psfParent->CreateFQPidl(NULL);
00336
00337          if(pidlThisFolder)
00338             {
00339             if(0 != psfDesktop->CompareIDs(0, pidl, pidlThisFolder))
00340                {
00341                psfDesktop->BindToObject(pidl, NULL, IID_IShellFolder, (LPVOID*)&psfFrom);
00342                }
00343
00344             m_pPidlMgr->Delete(pidlThisFolder);
00345             }
00346
00347          psfDesktop->Release();
00348          }
00349
00350       if(psfFrom)
00351          {
00352          LPITEMIDLIST   *aPidls;
00353
00354          //allocate an array of PIDLS
00355          aPidls = AllocPidlTable(pData->cidl - 1);
00356
00357          if(aPidls)
00358             {
00359             UINT  i;
00360
00361             //fill in the PIDL array
00362             for(i = 0; i < pData->cidl - 1; i++)
00363                {
00364                aPidls[i] = m_pPidlMgr->Copy((LPITEMIDLIST)((LPBYTE)(pData) + pData->aoffset[i + 1]));
00365                }
00366
00367             if(SUCCEEDED(m_psfParent->CopyItems(psfFrom, aPidls, pData->cidl - 1)))
00368                {
00369                fSuccess = TRUE;
00370
00371                if(fCut)
00372                   {
00373                   psfFrom->DeleteItems(aPidls, pData->cidl - 1);
00374                   }
00375                }
00376
00377             FreePidlTable(aPidls);
00378             }
00379
00380          psfFrom->Release();
00381          }
00382
00383       GlobalUnlock(hMem);
00384       }
00385    }
00386
00387 return fSuccess;
00388 }
00389
00390 /**************************************************************************
00391
00392    CDropTarget::AllocPidlTable()
00393
00394 **************************************************************************/
00395
00396 LPITEMIDLIST* CDropTarget::AllocPidlTable(DWORD dwEntries)
00397 {
00398 LPITEMIDLIST   *aPidls;
00399
00400 dwEntries++;
00401
00402 aPidls = (LPITEMIDLIST*)m_pMalloc->Alloc(dwEntries * sizeof(LPITEMIDLIST));
00403
00404 if(aPidls)
00405    {
00406    //set all of the entries to NULL
00407    ZeroMemory(aPidls, dwEntries * sizeof(LPITEMIDLIST));
00408    }
00409
00410 return aPidls;
00411 }
00412
00413 /**************************************************************************
00414
00415    CDropTarget::FreePidlTable()
00416
00417 **************************************************************************/
00418
00419 VOID CDropTarget::FreePidlTable(LPITEMIDLIST *aPidls)
00420 {
00421 if(aPidls && m_pPidlMgr)
00422    {
00423    UINT  i;
00424    for(i = 0; aPidls[i]; i++)
00425       m_pPidlMgr->Delete(aPidls[i]);
00426
00427    m_pMalloc->Free(aPidls);
00428    }
00429 }
00430
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/heap.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

heap.h

Go to the documentation of this file.
00001 #ifndef __HEAP_H_
00002 #define __HEAP_H_
00003
00004 // fixalloc.h - declarations for fixed block allocator
00005
00006 struct CPlex     // warning variable length structure
00007 {
00008   CPlex* pNext;
00009   DWORD dwReserved[1];    // align on 8 byte boundary
00010   // BYTE data[maxNum*elementSize];
00011
00012   void* data() { return this+1; }
00013
00014   static CPlex* PASCAL Create(CPlex*& head, UINT nMax, UINT cbElement);
00015       // like 'calloc' but no zero fill
00016       // may throw memory exceptions
00017
00018   void FreeDataChain();       // free this one and links
00019 };
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 // CFixedAlloc
00023
00024 class CFixedAlloc
00025 {
00026 // Constructors
00027 public:
00028   CFixedAlloc(UINT nAllocSize, UINT nBlockSize = 64);
00029
00030 // Attributes
00031   UINT GetAllocSize() { return m_nAllocSize; }
00032
00033 // Operations
00034 public:
00035   inline void* Alloc()// return a chunk of memory of nAllocSize
00036   {
00037     EnterCriticalSection(&m_protect);
00038     if (m_pNodeFree == NULL)
00039     {
00040       CPlex* pNewBlock;
00041       // add another block
00042       pNewBlock = CPlex::Create(m_pBlocks, m_nBlockSize, m_nAllocSize);
00043
00044       // chain them into free list
00045       CNode* pNode = (CNode*)pNewBlock->data();
00046       // free in reverse order to make it easier to debug
00047       (BYTE*&)pNode += (m_nAllocSize * m_nBlockSize) - m_nAllocSize;
00048       for (int i = m_nBlockSize-1; i >= 0; i--, (BYTE*&)pNode -= m_nAllocSize)
00049       {
00050         pNode->pNext = m_pNodeFree;
00051         m_pNodeFree = pNode;
00052       }
00053     }
00054
00055     // remove the first available node from the free list
00056     void* pNode = m_pNodeFree;
00057     m_pNodeFree = m_pNodeFree->pNext;
00058
00059     LeaveCriticalSection(&m_protect);
00060     return pNode;
00061   }
00062
00063   inline void Free(void* p) // free chunk of memory returned from Alloc
00064   {
00065     if (p != NULL)
00066     {
00067       EnterCriticalSection(&m_protect);
00068
00069       // simply return the node to the free list
00070       CNode* pNode = (CNode*)p;
00071       pNode->pNext = m_pNodeFree;
00072       m_pNodeFree = pNode;
00073       LeaveCriticalSection(&m_protect);
00074     }
00075   }
00076   void FreeAll(); // free everything allocated from this allocator
00077
00078 // Implementation
00079 public:
00080   ~CFixedAlloc();
00081
00082 protected:
00083   struct CNode
00084   {
00085     CNode* pNext;   // only valid when in free list
00086   };
00087
00088   UINT m_nAllocSize;  // size of each block from Alloc
00089   UINT m_nBlockSize;  // number of blocks to get at a time
00090   CPlex* m_pBlocks;   // linked list of blocks (is nBlocks*nAllocSize)
00091   CNode* m_pNodeFree; // first free node (NULL if no free nodes)
00092   CRITICAL_SECTION m_protect;
00093 };
00094
00095 // DECLARE_FIXED_ALLOC -- used in class definition
00096 #define DECLARE_FIXED_ALLOC(class_name) \
00097 public: \
00098   void* operator new(size_t size) \
00099   { \
00100     return s_alloc.Alloc(); \
00101   } \
00102   void* operator new(size_t, void* p) \
00103     { return p; } \
00104   void operator delete(void* p) { s_alloc.Free(p); } \
00105   void* operator new(size_t size, LPCSTR, int) \
00106   { \
00107     return s_alloc.Alloc(); \
00108   } \
00109 protected: \
00110   static CFixedAlloc s_alloc \
00111
00112
00113 // IMPLEMENT_FIXED_ALLOC -- used in class implementation file
00114 #define IMPLEMENT_FIXED_ALLOC(class_name, block_size) \
00115 CFixedAlloc class_name::s_alloc(sizeof(class_name), block_size) \
00116
00117
00118 void* __cdecl operator new(size_t nSize);
00119 void __cdecl operator delete(void* p);
00120
00121 #endif
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/Acex.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

Acex.h

Go to the documentation of this file.
00001 #if !defined(AFX_AGENTCTLEX_H__AB8FEBA6_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00002 #define AFX_AGENTCTLEX_H__AB8FEBA6_3841_11D2_8512_00C04FA34A14__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00008
00009 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00010 //  Microsoft Visual C++, your modifications will be overwritten.
00011
00012
00013 // Dispatch interfaces referenced by this interface
00014 class CAgentCtlCharacters;
00015 class CAgentCtlPropertySheet;
00016 class CAgentCtlAudioObject;
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CAgentCtlEx wrapper class
00020
00021 class CAgentCtlEx : public CWnd
00022 {
00023 protected:
00024   DECLARE_DYNCREATE(CAgentCtlEx)
00025 public:
00026   CLSID const& GetClsid()
00027   {
00028     static CLSID const clsid
00029       = { 0xd45fd31b, 0x5c6e, 0x11d1, { 0x9e, 0xc1, 0x0, 0xc0, 0x4f, 0xd7, 0x8, 0x1f } };
00030     return clsid;
00031   }
00032   virtual BOOL Create(LPCTSTR lpszClassName,
00033     LPCTSTR lpszWindowName, DWORD dwStyle,
00034     const RECT& rect,
00035     CWnd* pParentWnd, UINT nID,
00036     CCreateContext* pContext = NULL)
00037   { return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }
00038
00039     BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
00040     const RECT& rect, CWnd* pParentWnd, UINT nID,
00041     CFile* pPersist = NULL, BOOL bStorage = FALSE,
00042     BSTR bstrLicKey = NULL)
00043   { return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
00044     pPersist, bStorage, bstrLicKey); }
00045
00046 // Attributes
00047 public:
00048
00049 // Operations
00050 public:
00051   CAgentCtlCharacters GetCharacters();
00052   CAgentCtlAudioObject GetAudioOutput();
00053   LPDISPATCH GetSpeechInput();
00054   CAgentCtlPropertySheet GetPropertySheet();
00055   LPDISPATCH GetCommandsWindow();
00056   BOOL GetConnected();
00057   void SetConnected(BOOL bNewValue);
00058   BOOL GetSuspended();
00059   void ShowDefaultCharacterProperties(const VARIANT& x, const VARIANT& y);
00060   BOOL GetRaiseRequestErrors();
00061   void SetRaiseRequestErrors(BOOL bNewValue);
00062 };
00063
00064 //{{AFX_INSERT_LOCATION}}
00065 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00066
00067 #endif // !defined(AFX_AGENTCTLEX_H__AB8FEBA6_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/FileRepAsyncPipe/Service.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • FileRepAsyncPipe

Service.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     System Service Procedures
00006
00007     FILE: Service.c
00008
00009     PURPOSE: Provides file replication service function definitions.
00010
00011     FUNCTIONS:
00012         IsLocalSystem - Checks whether the service is running as
00013       local system.
00014         ReportStatusToSCMgr - Changes the service's status and
00015       registers change with SCM.
00016         AddToMessageLog - Adds a string to the system message log.
00017
00018     COMMENTS:
00019
00020         These funtions may be used by the main service routines
00021       as well as by the client and server file replication RPC routines.
00022
00023     IMPORTANT:
00024
00025         Counter and Queueing code provides the necessary functionality for
00026       the service and is strictly a sample.  It does not demonstrate how to queue
00027       user requests properly and write high-performance servers.  The purpose of this
00028       sample is demostration of RPC features and the following code is refined to
00029       the extent it allows us to accomplish that.
00030
00031 */
00032
00033 #include "common.h"
00034
00035 #define SECURITY_WIN32
00036
00037 #include <Ntdsapi.h>
00038 #include <Ntsecapi.h>
00039
00040 #include <Security.h>
00041 #include <Secext.h>
00042 #include <Dsgetdc.h>
00043 #include <Lm.h>
00044
00045 // Generated by the MIDL compiler
00046 #include "FileRepServer.h"
00047 #include "FileRepClient.h"
00048
00049 #include "Service.h"
00050
00051 #ifdef DEBUG2
00052 #include "DbgMsg.h"
00053 #endif
00054
00055 // We support anonymous, regular, and system
00056 // user groups.
00057 const UINT NumPriGroups = 3;
00058
00059 #ifdef LARGE_RES_BOUNDS
00060
00061 // The maximum number of requests
00062 // that can be placed by anonymous, regular,
00063 // and system accounts respectively on the server.
00064 const UINT ServerReqBounds[] =  {1000, 2000, 3000};
00065
00066 // Equivalent bounds on the client.
00067 const UINT ClientReqBounds[] =  {1000, 2000, 3000};
00068
00069 // The maximum number of requests that can be
00070 // simultaneously handled.
00071 const UINT ClientActiveReqBounds[] =  {100, 500, 1000};
00072 const UINT ServerActiveReqBounds[] =  {200, 1000, 2000};
00073
00074 const UINT MaxUserReqs = 1000;
00075
00076 #else
00077
00078 const UINT ServerReqBounds[] =  {10, 20, 30};
00079 const UINT ClientReqBounds[] =  {10, 20, 30};
00080
00081 const UINT ServerActiveReqBounds[] =  {10, 50, 100};
00082 const UINT ClientActiveReqBounds[] =  {1, 5, 10};
00083
00084 const UINT MaxUserReqs = 5;
00085
00086 #endif
00087
00088 Counter *pClientReqCounters[NumPriGroups];
00089 Counter *pClientActiveReqCounters[NumPriGroups];
00090
00091 Counter *pServerReqCounters[NumPriGroups];
00092 Counter *pServerActiveReqCounters[NumPriGroups];
00093
00094 Queue *ClientReqQueues[NumPriGroups];
00095 Queue *ClientActiveReqHashCounters[NumPriGroups];
00096
00097 Queue *ServerReqQueues[NumPriGroups];
00098 Queue *ServerActiveReqHashCounters[NumPriGroups];
00099
00100 #ifdef DEBUG1
00101 // Used for tracking leaked requests
00102 Queue *ClientActiveReqQueue;
00103 Queue *ServerActiveReqQueue;
00104 BOOL fClientActiveReqQueueCreated = FALSE;
00105 BOOL fServerActiveReqQueueCreated = FALSE;
00106 #endif
00107
00108 const UINT RegUsersPri = 1;
00109
00110 /*
00111     Internal variables
00112 */
00113
00114 // status handle of the service
00115 SERVICE_STATUS_HANDLE sshStatusHandle;
00116
00117 // current status of the service
00118 SERVICE_STATUS ssStatus;
00119
00120 BOOL bServerListening = FALSE;
00121
00122 #ifdef PROF
00123 BOOL fProfOpenedLog = FALSE;
00124 #endif
00125
00126 #ifdef DEBUG2
00127 BOOL fDbgMsgOpenedLog = FALSE;
00128 #endif
00129
00130
00131 BOOL fClientReqCountersCreated = FALSE;
00132 BOOL fClientActiveReqCountersCreated = FALSE;
00133
00134 BOOL fClientReqQueuesCreated = FALSE;
00135 BOOL fClientActiveReqHashCountersCreated = FALSE;
00136
00137 BOOL fServerReqCountersCreated = FALSE;
00138 BOOL fServerActiveReqCountersCreated = FALSE;
00139
00140 BOOL fServerReqQueuesCreated = FALSE;
00141 BOOL fServerActiveReqHashCountersCreated = FALSE;
00142
00143 HANDLE ClientCompletionPort;
00144 HANDLE ServerCompletionPort;
00145
00146 LONG nThreadsAtClientCompletionPort;
00147 LONG nThreadsAtServerCompletionPort;
00148
00149 BOOL bNoFileIO = FALSE;
00150
00151 /*
00152     RPC configuration.
00153 */
00154
00155 // The service listens to all the protseqs listed in this array.
00156 // It listens for replication utilities on local RPC and for
00157 // remote requests on TCP/IP
00158 LPTSTR ServerProtocolArray[] = { TEXT("ncacn_ip_tcp"),
00159                                  TEXT("ncalrpc") };
00160 // Used in RpcServerUseProtseq.
00161 // Specifies the maximum number of concurrent remote
00162 // procedure call requests the server wants to handle.
00163 ULONG cMaxCallsListen = 1000; //RPC_C_PROTSEQ_MAX_REQS_DEFAULT;
00164
00165 // Similarly, but for RpcServerListen.
00166 ULONG cMaxCallsExecute = 1000; //RPC_C_LISTEN_MAX_CALLS_DEFAULT;
00167
00168 // Used in RpcServerListen().  The minnimum number of threads listening.
00169 ULONG cMinimumThreads = 2;
00170
00171 RPC_BINDING_VECTOR * pBindingVector = NULL;
00172
00173 // Status variable for the RPC calls.
00174 RPC_STATUS status;
00175
00176 /*
00177
00178     FUNCTION: GetUserSid
00179
00180     PURPOSE: Obtains a pointer to the SID for the current user
00181
00182     PARAMETERS:
00183         none
00184
00185     RETURN VALUE:
00186         Pointer to the SID
00187
00188     COMMENTS:
00189         The SID buffer returned by this function is allocated with
00190         HeapAlloc and should be freed with HeapFree.
00191
00192 */
00193 PSID GetUserSID() {
00194     SID_NAME_USE snuType;
00195     PSID pUserSID = NULL;
00196     DWORD cbUserSID = 0;
00197
00198     LPTSTR szUserName = NULL;
00199     DWORD cbUserName = 0;
00200
00201     LPTSTR szDomainName = NULL;
00202     DWORD cbDomainName = 0;
00203
00204     BOOL fAPISuccess;
00205
00206 #ifdef DEBUG2
00207     TCHAR Msg[MSG_SIZE];
00208
00209     DbgMsgRecord(TEXT("->GetUserSID\n"));
00210 #endif
00211
00212     // Get the logged on user name.  First we determine the size
00213     // of the buffer required and then get the username.
00214
00215     // Get the size of the name.
00216     fAPISuccess = GetUserName(szUserName, &cbUserName);
00217
00218     // API should have failed with insufficient buffer.
00219     ASSERT(!fAPISuccess);
00220
00221     if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
00222         AddToMessageLogProcFailure(TEXT("GetUserSID: GetUserName"), GetLastError());
00223         return NULL;
00224     }
00225
00226 #ifdef DEBUG2
00227     _stprintf(Msg, TEXT("GetUserSID: cbUserName=%d\n"), cbUserName);
00228     DbgMsgRecord(Msg);
00229 #endif
00230
00231     // Allocate buffer for the name.
00232     szUserName = (LPTSTR) AutoHeapAlloc(cbUserName * sizeof(TCHAR));
00233     if (szUserName == NULL) {
00234         AddToMessageLog(TEXT("GetUserSID: AutoHeapAlloc failed"));
00235         return NULL;
00236     }
00237
00238     // Finally get the name.
00239     fAPISuccess = GetUserName(szUserName, &cbUserName);
00240     if (!fAPISuccess) {
00241         AutoHeapFree(szUserName);
00242         AddToMessageLogProcFailure(TEXT("GetUserSID: GetUserName"), GetLastError());
00243         return NULL;
00244     }
00245
00246 #ifdef DEBUG2
00247     _stprintf(Msg, TEXT("GetUserSID: UserName=%s cbUserName=%d\n"), szUserName, cbUserName),
00248     DbgMsgRecord(Msg);
00249 #endif
00250
00251     // Do the same for SID.  First get the size and then allocate the buffer
00252     // and perform the actual call.
00253     fAPISuccess = LookupAccountName(NULL, szUserName,
00254                                     pUserSID, &cbUserSID, szDomainName, &cbDomainName, &snuType);
00255
00256     // API should have failed with insufficient buffer.
00257     ASSERT(!fAPISuccess);
00258
00259     if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
00260         AutoHeapFree(szUserName);
00261         AddToMessageLogProcFailure(TEXT("GetUserSID: LookupAccountName"), GetLastError());
00262         return NULL;
00263     }
00264
00265 #ifdef DEBUG2
00266     _stprintf(Msg, TEXT("GetUserSID: cbUserSID=%d\n"), cbUserSID),
00267     DbgMsgRecord(Msg);
00268 #endif
00269
00270     // Allocate the SID buffer...
00271     pUserSID = AutoHeapAlloc(cbUserSID);
00272     if (pUserSID == NULL) {
00273         AutoHeapFree(szUserName);
00274         AddToMessageLog(TEXT("GetUserSID: AutoHeapAlloc failed"));
00275         return NULL;
00276     }
00277
00278     // And the domain name buffer.
00279     szDomainName = (LPTSTR) AutoHeapAlloc(cbDomainName * sizeof(TCHAR));
00280     if (!szDomainName) {
00281         AutoHeapFree(szUserName);
00282         AutoHeapFree(pUserSID);
00283         AddToMessageLog(TEXT("GetUserSID: AutoHeapAlloc failed"));
00284         return NULL;
00285     }
00286
00287     // Now get the SID.
00288     fAPISuccess = LookupAccountName(NULL, szUserName,
00289                                     pUserSID, &cbUserSID, szDomainName, &cbDomainName, &snuType);
00290     if (!fAPISuccess) {
00291         AutoHeapFree(szUserName);
00292         AutoHeapFree(szDomainName);
00293         AutoHeapFree(pUserSID);
00294         AddToMessageLogProcFailure(TEXT("GetUserSID: LookupAccountName"), GetLastError());
00295         return NULL;
00296     }
00297
00298     AutoHeapFree(szUserName);
00299     AutoHeapFree(szDomainName);
00300
00301 #ifdef DEBUG2
00302     _stprintf(Msg, TEXT("GetUserSID: pUserSID=%p cbUserSID=%d\n"), pUserSID, cbUserSID),
00303     DbgMsgRecord(Msg);
00304 #endif
00305
00306 #ifdef DEBUG2
00307     DbgMsgRecord(TEXT("<-GetUserSID\n"));
00308 #endif
00309
00310     return pUserSID;
00311 }
00312
00313 /*
00314
00315     FUNCTION: GetUserGroups
00316
00317     PURPOSE: Obtains a pointer to the groups that current
00318     token is member of.
00319
00320     PARAMETERS:
00321         none
00322
00323     COMMENTS:
00324         The PTOKEN_GROUPS pointer returned by this function is allocated with
00325         HeapAlloc and should be freed with HeapFree.
00326
00327 */
00328 PTOKEN_GROUPS GetUserGroups(VOID) {
00329     DWORD dwSize;
00330     DWORD dwResult;
00331     HANDLE hToken;
00332     PTOKEN_GROUPS pGroupInfo = NULL;
00333
00334 #ifdef DEBUG2
00335     DbgMsgRecord(TEXT("->GetUserGroups\n"));
00336 #endif
00337
00338     // Open a handle to the access token for the calling thread.
00339     if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &hToken)) {
00340         AddToMessageLogProcFailure(TEXT("GetUserGroups: OpenProcessToken"), GetLastError());
00341         return NULL;
00342     }
00343
00344     // Call GetTokenInformation to get the buffer size.
00345     dwSize = 0;
00346     if(GetTokenInformation(hToken, TokenGroups, NULL, dwSize, &dwSize) == 0) {
00347         dwResult = GetLastError();
00348         if(dwResult != ERROR_INSUFFICIENT_BUFFER ) {
00349             AddToMessageLogProcFailure(TEXT("GetUserGroups: GetTokenInformation"), dwResult);
00350
00351             CloseHandle(hToken);
00352             return NULL;
00353         }
00354     }
00355     else {
00356         // We should have returned with an error above.
00357         ASSERT(TRUE);
00358     }
00359
00360     // Allocate the buffer.
00361     if ((pGroupInfo = (PTOKEN_GROUPS) AutoHeapAlloc(dwSize)) == NULL) {
00362         AddToMessageLog(TEXT("GetUserGroups: AutoHeapAlloc failed"));
00363
00364         CloseHandle(hToken);
00365         return NULL;
00366     }
00367
00368     // Call GetTokenInformation again to get the group information.
00369     if(GetTokenInformation(hToken, TokenGroups, pGroupInfo, dwSize, &dwSize) == 0) {
00370         AddToMessageLogProcFailure(TEXT("GetUserGroups: GetTokenInformation"), GetLastError());
00371
00372         AutoHeapFree(pGroupInfo);
00373         CloseHandle(hToken);
00374         return NULL;
00375     }
00376
00377 #ifdef DEBUG2
00378     DbgMsgRecord(TEXT("<-GetUserGroups\n"));
00379 #endif
00380
00381     CloseHandle(hToken);
00382     return pGroupInfo;
00383 }
00384
00385 /*
00386
00387     FUNCTION: IsGroupMember
00388
00389     PURPOSE: Returns true if a given SID is found in a given group.
00390
00391     PARAMETERS:
00392         pSID - sid to look for.
00393         pGroupInfo - group to look in.
00394
00395 */
00396 BOOL IsGroupMember(PSID pSID, PTOKEN_GROUPS pGroupInfo) {
00397
00398 #ifdef DEBUG2
00399     DbgMsgRecord(TEXT("->IsGroupMember\n"));
00400 #endif
00401
00402     // Loop through the group SIDs looking for the administrator SID.
00403     for(UINT i=0; i<pGroupInfo->GroupCount; i++) {
00404         if (EqualSid(pSID, pGroupInfo->Groups[i].Sid)) {
00405             // Find out if the SID is enabled in the token
00406             if (pGroupInfo->Groups[i].Attributes & SE_GROUP_ENABLED) {
00407
00408 #ifdef DEBUG2
00409                 DbgMsgRecord(TEXT("<-IsGroupMember\n"));
00410 #endif
00411                 return TRUE;
00412             }
00413         }
00414     }
00415
00416 #ifdef DEBUG2
00417     DbgMsgRecord(TEXT("<-IsGroupMember\n"));
00418 #endif
00419
00420     return FALSE;
00421 }
00422
00423 PSID pSystemSID = NULL;
00424 PSID pAdminSID = NULL;
00425 PSID pAnonSID = NULL;
00426
00427 VOID CreateWellKnownSids(VOID) {
00428     SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
00429
00430     // Generate SID for the system if necessary.
00431     if (pSystemSID == NULL) {
00432         if (AllocateAndInitializeSid(&SIDAuth, 1,
00433                                      SECURITY_LOCAL_SYSTEM_RID,
00434                                      0, 0, 0, 0, 0, 0, 0,
00435                                      &pSystemSID) == 0) {
00436             AddToMessageLogProcFailure(TEXT("CreateWellKnownSids: AllocateAndInitializeSid"), GetLastError());
00437         }
00438     }
00439
00440     // Generate SID for the admin group if necessary.
00441     if (pAdminSID == NULL) {
00442         if (AllocateAndInitializeSid(&SIDAuth, 1,
00443                                      DOMAIN_ALIAS_RID_ADMINS,
00444                                      0, 0, 0, 0, 0, 0, 0,
00445                                      &pAdminSID) == 0) {
00446             AddToMessageLogProcFailure(TEXT("CreateWellKnownSids: AllocateAndInitializeSid"), GetLastError());
00447         }
00448     }
00449
00450     // Generate the anonymous SID if necessary.
00451     if (pAnonSID == NULL) {
00452         if (AllocateAndInitializeSid(&SIDAuth, 1,
00453                                      SECURITY_ANONYMOUS_LOGON_RID,
00454                                      0, 0, 0, 0, 0, 0, 0,
00455                                      &pAnonSID) == 0) {
00456             AddToMessageLogProcFailure(TEXT("CreateWellKnownSids: AllocateAndInitializeSid"), GetLastError());
00457         }
00458     }
00459 }
00460
00461 VOID DeleteWellKnownSids(VOID) {
00462     AutoHeapFree(pSystemSID);
00463     pSystemSID = NULL;
00464     AutoHeapFree(pAdminSID);
00465     pAdminSID = NULL;
00466     AutoHeapFree(pAnonSID);
00467     pAnonSID = NULL;
00468 }
00469
00470 /*
00471     FUNCTION: GetCurrentUserPriority()
00472
00473     PURPOSE: Returns the priority of the current user.
00474         Priority is an integer between 0 and 2.
00475         0 - anonymous users
00476         1 - regular users
00477         2 - system
00478
00479     PARAMETERS:
00480         pPri - pointer to the variable that receives the priority.
00481
00482     RETURN VALUE:  True on success, False on error.
00483
00484     COMMENTS:  Returns 0 on errors.
00485
00486 */
00487 UINT GetCurrentUserPriority(VOID) {
00488     PSID pSID;
00489     PTOKEN_GROUPS pUserGroups;
00490
00491     UINT Pri;
00492
00493     // If well-known sids were not allocated, we can't work.
00494     if (pSystemSID == NULL || pAdminSID == NULL || pAnonSID == NULL) {
00495         return 0;
00496     }
00497
00498     // The SID gets dynamically allocated inside GetUserSID(), so
00499     // we need to remember about that.
00500     if ((pSID = GetUserSID()) == NULL) {
00501         return 0;
00502     }
00503
00504     if ((pUserGroups = GetUserGroups()) == NULL) {
00505         AutoHeapFree(pSID);
00506         return 0;
00507     }
00508
00509     // Test if current SID is system SID or it
00510     // is a member of the administrator group.
00511     if (EqualSid(pSID, pSystemSID) || IsGroupMember(pAdminSID, pUserGroups)) {
00512         // Return system priority.
00513         Pri = 2;
00514     }
00515     // Test if current SID is anonyous SID.
00516     else if (EqualSid(pSID, pAnonSID)) {
00517         // Return anonymous priority.
00518         Pri = 0;
00519     }
00520     else {
00521         // We are left with the regular user priority.
00522         Pri = 1;
00523     }
00524
00525     AutoHeapFree(pSID);
00526     AutoHeapFree(pUserGroups);
00527     return Pri;
00528 }
00529
00530 /*
00531     FUNCTION: ReportStatusToSCMgr()
00532
00533     PURPOSE: Sets the current status of the service and
00534              reports it to the Service Control Manager
00535
00536     PARAMETERS:
00537         dwCurrentState - the state of the service
00538         dwWin32ExitCode - error code to report
00539         dwWaitHint - worst case estimate to next checkpoint
00540
00541     RETURN VALUE:
00542         TRUE - success
00543         FALSE - failure
00544
00545     COMMENTS:
00546
00547 */
00548 BOOL ReportStatusToSCMgr(SERVICE_STATUS_HANDLE *sshStatusHandle,
00549                          SERVICE_STATUS *ssStatus,
00550                          DWORD dwCurrentState,
00551                          DWORD dwWin32ExitCode,
00552                          DWORD dwWaitHint){
00553
00554     static DWORD dwCheckPoint = 1;
00555     BOOL fResult = TRUE;
00556
00557     if (dwCurrentState == SERVICE_START_PENDING) {
00558         ssStatus->dwControlsAccepted = 0;
00559     }
00560     else {
00561         ssStatus->dwControlsAccepted = SERVICE_ACCEPT_STOP;
00562     }
00563
00564     ssStatus->dwCurrentState = dwCurrentState;
00565     ssStatus->dwWin32ExitCode = dwWin32ExitCode;
00566     ssStatus->dwWaitHint = dwWaitHint;
00567
00568     if ((dwCurrentState == SERVICE_RUNNING) || (dwCurrentState == SERVICE_STOPPED)) {
00569         ssStatus->dwCheckPoint = 0;
00570     }
00571     else {
00572         ssStatus->dwCheckPoint = dwCheckPoint++;
00573     }
00574
00575     // Report the status of the service to the service control manager.
00576     if (!(fResult = SetServiceStatus(*sshStatusHandle, ssStatus))) {
00577         AddToMessageLog(TEXT("ReportStatusToSCMgr: SetServiceStatus failed"));
00578     }
00579     return fResult;
00580 }
00581
00582 /*
00583     FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
00584
00585     PURPOSE: Allows any thread to log an error message.
00586       Messages are logged in a simplistic manner with some
00587       fields omitted.
00588
00589     PARAMETERS:
00590         lpszMsg - text for message
00591
00592     RETURN VALUE:
00593         none
00594
00595     COMMENTS:
00596
00597 */
00598 VOID AddToMessageLog(LPTSTR szMsg2) {
00599     TCHAR szMsg1[256];
00600     HANDLE hEventSource;
00601     LPTSTR lpszStrings[2];
00602     DWORD dwErr = 0;
00603
00604     dwErr = GetLastError();
00605
00606     // Use event logging to log the error.
00607     hEventSource = RegisterEventSource(NULL, SERVICENAME);
00608
00609     _stprintf(szMsg1, TEXT("%s error: %d"), SERVICENAME, dwErr);
00610     lpszStrings[0] = szMsg1;
00611     lpszStrings[1] = szMsg2;
00612
00613     if (hEventSource != NULL) {
00614         ReportEvent(hEventSource, // handle of event source
00615                     EVENTLOG_ERROR_TYPE, // event type
00616                     0, // event category
00617                     0, // event ID
00618                     NULL, // current user's SID
00619                     2, // strings in lpszStrings
00620                     0, // no bytes of raw data
00621                     (LPCTSTR *) lpszStrings, // array of error strings
00622                     NULL); // no raw data
00623
00624         (VOID) DeregisterEventSource(hEventSource);
00625     }
00626 }
00627
00628 VOID AddToMessageLogProcFailure(LPTSTR ProcName, DWORD ErrCode) {
00629     TCHAR Msg[MSG_SIZE];
00630     _stprintf(Msg, TEXT("%s failed with code %d"), ProcName, ErrCode);
00631     AddToMessageLog(Msg);
00632 }
00633
00634 VOID AddToMessageLogProcFailureEEInfo(LPTSTR ProcName, DWORD ErrCode) {
00635     TCHAR Msg[MSG_SIZE];
00636     UINT MsgSize = 0;
00637
00638     MsgSize += _stprintf(&Msg[MsgSize], TEXT("%s failed with code %d\n"), ProcName, ErrCode);
00639     GetEEInfoText(Msg, MSG_SIZE, &MsgSize);
00640
00641     Msg[MsgSize] = 0;
00642
00643     AddToMessageLog(Msg);
00644 }
00645
00646 VOID AddRpcEEInfo(DWORD Status, LPTSTR Msg) {
00647     RPC_STATUS rpcstatus;
00648
00649     RPC_EXTENDED_ERROR_INFO ErrorInfo;
00650
00651     ErrorInfo.Version = RPC_EEINFO_VERSION;
00652     ErrorInfo.ComputerName = NULL;
00653     ErrorInfo.ProcessID = 0;
00654     ErrorInfo.GeneratingComponent = 0;
00655     ErrorInfo.Status = Status;
00656     ErrorInfo.DetectionLocation = 0;
00657     ErrorInfo.Flags = 0;
00658     ErrorInfo.NumberOfParameters = 1;
00659     ErrorInfo.Parameters[0].ParameterType = eeptUnicodeString;
00660     ErrorInfo.Parameters[0].u.UnicodeString = Msg;
00661
00662     rpcstatus = RpcErrorAddRecord(&ErrorInfo);
00663
00664     RpcRaiseException(Status);
00665 }
00666
00667 VOID AddRpcEEInfoAndRaiseException(DWORD Status, LPTSTR Msg) {
00668     AddRpcEEInfo(Status, Msg);
00669     RpcRaiseException(Status);
00670 }
00671
00672 /*
00673     FUNCTION: RpcServerIfCallback
00674
00675     PURPOSE: Security callback funtion for the server interface
00676
00677     PARAMETERS:
00678         Interface - the UUID and version of the interface.
00679         Context - server binding handle representing the client.
00680
00681     RETURN VALUE:
00682         Returns RPC_S_OK if the client is allowed to call methods in this
00683         interface.  A different return code will cause the client to receive
00684         the exception RPC_S_ACCESS_DENIED.
00685
00686     COMMENTS:
00687
00688         Specifying a security-callback function allows the server application
00689         to restrict access to its interfaces on a per-client basis.
00690
00691         By default the server run time will dispatch unauthenticated calls
00692         even if the server has called RpcServerRegisterAuthInfo. If the
00693         server wants to accept only authenticated clients it must then call
00694         RpcBindingInqAuthClient to retrieve the security level, or attempt
00695         to impersonate the client with RpcImpersonateClient.
00696
00697         When a server application specifies a security-callback function
00698         for an interface, the RPC run time automatically rejects
00699         unauthenticated calls to that interface. In addition, the run-time
00700         records the interfaces that each client has used. When a client
00701         makes an RPC to an interface that it has not used during the
00702         current communication session, the RPC run-time library will
00703         call the interface's security-callback function.
00704
00705         In some cases, the RPC run time may call the security-callback
00706         function more than once per client, per interface.
00707
00708 */
00709 RPC_STATUS __stdcall RpcServerIfCallback (
00710   IN void *Interface,
00711   IN void *Context
00712 ) {
00713     ULONG ulAuthnLevel;
00714     ULONG ulAuthnSvc;
00715
00716     // Get client security info.
00717     if (RpcBindingInqAuthClient(Context,
00718         NULL,
00719         NULL,
00720         &ulAuthnLevel,
00721         &ulAuthnSvc,
00722         NULL) != RPC_S_OK) {
00723
00724         return RPC_S_ACCESS_DENIED;
00725     }
00726
00727     // Make sure the client has adequate security measures and uses the expected
00728     // security provider.
00729     if (ulAuthnLevel != RPC_C_AUTHN_LEVEL_PKT_PRIVACY || ulAuthnSvc != RPC_C_AUTHN_GSS_KERBEROS) {
00730
00731         return RPC_S_ACCESS_DENIED;
00732     }
00733
00734     return RPC_S_OK;
00735 };
00736
00737
00738 BOOL StartFileRepServer (VOID) {
00739   unsigned i;
00740
00741     // Servere initialization
00742
00743     // Register the service interfaces.
00744
00745 #ifndef NO_SEC
00746     // The server interface has a security callback RpcServerIfCallback.
00747     // The RPC run time will automatically reject unauthenticated calls to
00748     // this interface.
00749     status = RpcServerRegisterIfEx(s_FileRepServer_v1_0_s_ifspec,
00750            NULL,
00751            NULL,
00752            RPC_IF_ALLOW_SECURE_ONLY,
00753            RPC_C_LISTEN_MAX_CALLS_DEFAULT,
00754            &RpcServerIfCallback);
00755     if (status != RPC_S_OK){
00756             AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterIfEx"), status);
00757         return false;
00758     }
00759 #else if
00760     status = RpcServerRegisterIf(s_FileRepServer_v1_0_s_ifspec, NULL, NULL);
00761     if (status != RPC_S_OK){
00762             AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, ...)"), status);
00763         return false;
00764     }
00765 #endif
00766
00767     status = RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, NULL, NULL);
00768     if (status != RPC_S_OK){
00769             AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, ...)"), status);
00770         return false;
00771     }
00772
00773     for (i = 0; i < sizeof(ServerProtocolArray)/sizeof(unsigned char *); i++) {
00774
00775         // Use the protocol sequences specified in ProtocolArray
00776         // for receiving RPCs.
00777         status = RpcServerUseProtseq((_TUCHAR *)ServerProtocolArray[i], cMaxCallsListen, NULL);
00778         if (status != RPC_S_OK){
00779             AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerUseProtseq"), status);
00780             return false;
00781         }
00782     }
00783
00784     // Obtain a binding vector for the server.
00785     status = RpcServerInqBindings(&pBindingVector);
00786     if (status != RPC_S_OK) {
00787         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerInqBindings"), status);
00788         return false;
00789     }
00790
00791     // Register the the services in the endpoint map
00792     // of the host computer.
00793     status = RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00794     if (status != RPC_S_OK){
00795         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, ...)"), status);
00796         return false;
00797     }
00798     status = RpcEpRegister(FileRepClient_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00799     if (status != RPC_S_OK){
00800         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcEpRegister(FileRepClient_v1_0_s_ifspec, ...)"), status);
00801         return false;
00802     }
00803
00804     // Message buffer.
00805     TCHAR Msg[MSG_SIZE];
00806
00807 #ifndef NO_SEC
00808     // Array of generated SPNs.
00809     TCHAR **Spn;
00810     // Number of generated SPNs.
00811     ULONG ulSpn = 1;
00812
00813     PDOMAIN_CONTROLLER_INFO pDomainControllerInfo;
00814
00815     HANDLE hDS;
00816
00817     TCHAR lpCompDN[128];
00818     ULONG ulCompDNSize = sizeof(lpCompDN);
00819
00820     //
00821     // Set the security info for the client system service.
00822     //
00823
00824     // Principal name is NULL for local system service.
00825     status = RpcServerRegisterAuthInfo(NULL, RPC_C_AUTHN_WINNT, NULL, NULL);
00826     if (status != RPC_S_OK){
00827         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterAuthInfo"), status);
00828         return false;
00829     }
00830
00831     //
00832     // Set the security info for the server system service.
00833     //
00834
00835     BOOL NoFailure = TRUE;
00836
00837     // Generate the SPN.
00838     status = DsGetSpn(DS_SPN_NB_HOST, // Type of SPN to create.
00839                       SERVICENAME, // Service class
00840                       NULL, // DN of this service.
00841                       0, // Use the default instance port.
00842                       0, // Number of additional instance names.
00843                       NULL, // No additional instance names.
00844                       NULL, // No additional instance ports.
00845                       &ulSpn, // Size of SPN array.
00846                       &Spn); // Returned SPN(s).
00847     if (status != RPC_S_OK){
00848         _stprintf(Msg, TEXT("ServiceStart: DsGetSpn failed with code %d\n"), status);
00849         AddToMessageLog(Msg);
00850         return false;
00851     }
00852
00853     // Get the name of our domain.
00854     if (status = DsGetDcName(NULL,
00855                              NULL,
00856                              NULL,
00857                              NULL,
00858                              DS_RETURN_DNS_NAME,
00859                              &pDomainControllerInfo) != NO_ERROR) {
00860         _stprintf(Msg, TEXT("ServiceStart: DsGetDcName failed with code %d\n"), GetLastError());
00861         AddToMessageLog(Msg);
00862         NoFailure = FALSE;
00863     }
00864
00865     if (NoFailure) {
00866         // Bind to the domain controller for our domain.
00867         if ((status = DsBind(NULL,
00868                              pDomainControllerInfo->DomainName,
00869                              &hDS)) != ERROR_SUCCESS) {
00870             _stprintf(Msg, TEXT("ServiceStart: DsBind failed with code %d\n"), GetLastError());
00871             AddToMessageLog(Msg);
00872             NoFailure = FALSE;
00873         }
00874     }
00875
00876     if (NoFailure) {
00877         if ((status = NetApiBufferFree(pDomainControllerInfo)) != NERR_Success) {
00878             _stprintf(Msg, TEXT("ServiceStart: NetApiBufferFree failed with code %d\n"), status);
00879             AddToMessageLog(Msg);
00880             return false;
00881         }
00882
00883         if (GetComputerObjectName(NameFullyQualifiedDN, lpCompDN, &ulCompDNSize) == 0) {
00884             _stprintf(Msg, TEXT("ServiceStart: GetComputerObjectName failed with code %d\n"), GetLastError());
00885             AddToMessageLog(Msg);
00886             return false;
00887   }
00888
00889         // We could check whether the SPN is already registered for this
00890         // computer's DN, but we don't have to.  Modification is performed
00891         // permissively by this function, so that adding a value that already
00892         // exists does not return an error.  This way we can opt for the internal
00893         // check instead of doing it ourselves.
00894         status = DsWriteAccountSpn(hDS, DS_SPN_ADD_SPN_OP, lpCompDN, ulSpn, (LPCTSTR *)Spn);
00895         if (status != NO_ERROR) {
00896             _stprintf(Msg, TEXT("ServiceStart: DsWriteAccountSpn failed with code %d\n"), status);
00897             return false;
00898         }
00899         DsUnBind(&hDS);
00900     }
00901
00902     // We use Kerberos for authentication on the server.
00903     status = RpcServerRegisterAuthInfo(Spn[0], RPC_C_AUTHN_GSS_KERBEROS, NULL, NULL);
00904     if (status != RPC_S_OK){
00905         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerRegisterAuthInfo"), status);
00906         return false;
00907     }
00908
00909     // Don't forget to deallocate the principal name array.
00910     DsFreeSpnArray(ulSpn, Spn);
00911 #endif
00912
00913     // Create the heap to be used by midl_user_allocate and midl_user_free
00914     RpcHeap = HeapCreate(0, RPC_HEAP_SIZE_INIT, RPC_HEAP_SIZE_MAX);
00915
00916 #ifdef DEBUG2
00917     DbgMsgOpenLog(TEXT("c:\\logs\\FileRepService.dbg"));
00918     fDbgMsgOpenedLog = TRUE;
00919 #endif
00920
00921 #ifdef PROF
00922     ProfOpenLog(TEXT("c:\\logs\\FileRepService.prof"));
00923     fProfOpenedLog = TRUE;
00924 #endif
00925
00926     // Create counters to measure the number of concurrent
00927     // connections to the server system service.
00928     if (CountersCreate(pServerReqCounters, NumPriGroups, (UINT *) ServerReqBounds) == NULL) {
00929         AddToMessageLog(TEXT("ServiceStart: CountersCreate failed\n"));
00930         return false;
00931     }
00932     fServerReqCountersCreated = TRUE;
00933
00934     // Create the counters and queues for client system service
00935     // to store requests and request numbers.
00936     if (CountersCreate(pClientReqCounters, NumPriGroups, (UINT *) ClientReqBounds) == NULL) {
00937         AddToMessageLog(TEXT("ServiceStart: CountersCreate failed\n"));
00938         return false;
00939     }
00940     fClientReqCountersCreated = TRUE;
00941
00942     if (CountersCreate(pServerActiveReqCounters, NumPriGroups, (UINT *) ServerActiveReqBounds) == NULL) {
00943         AddToMessageLog(TEXT("ServiceStart: CountersCreate failed\n"));
00944         return false;
00945     }
00946     fServerActiveReqCountersCreated = TRUE;
00947
00948     if (CountersCreate(pClientActiveReqCounters, NumPriGroups, (UINT *) ClientActiveReqBounds) == NULL) {
00949         AddToMessageLog(TEXT("ServiceStart: CountersCreate failed\n"));
00950         return false;
00951     }
00952     fClientActiveReqCountersCreated = TRUE;
00953
00954     if (QueuesCreate(ServerReqQueues, NumPriGroups, FALSE) == FALSE) {
00955         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00956         return false;
00957     }
00958     fServerReqQueuesCreated = TRUE;
00959
00960     if (QueuesCreate(ClientReqQueues, NumPriGroups, FALSE) == FALSE) {
00961         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00962         return false;
00963     }
00964     fServerReqQueuesCreated = TRUE;
00965
00966 #ifdef DEBUG1
00967     if ((ServerActiveReqQueue = QueueCreate(FALSE)) == NULL) {
00968         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00969         return false;
00970     }
00971     fServerActiveReqQueueCreated = TRUE;
00972
00973     if ((ClientActiveReqQueue = QueueCreate(FALSE)) == NULL) {
00974         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00975         return false;
00976     }
00977     fClientActiveReqQueueCreated = TRUE;
00978 #endif
00979
00980     if (QueuesCreate(ServerActiveReqHashCounters, NumPriGroups, FALSE) == FALSE) {
00981         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00982         return false;
00983     }
00984     fServerActiveReqHashCountersCreated = TRUE;
00985
00986     if (QueuesCreate(ClientActiveReqHashCounters, NumPriGroups, FALSE) == FALSE) {
00987         AddToMessageLog(TEXT("ServiceStart: QueuesCreate failed\n"));
00988         return false;
00989     }
00990     fClientActiveReqHashCountersCreated = TRUE;
00991
00992     CreateWellKnownSids();
00993
00994     if ((ClientCompletionPort = CreateIoCompletionPort (
00995   INVALID_HANDLE_VALUE,
00996   NULL,
00997   0,
00998   0)) == INVALID_HANDLE_VALUE) {
00999         AddToMessageLog(TEXT("ServiceStart: CreateIoCompletionPort failed\n"));
01000         return false;
01001     }
01002
01003     if ((ServerCompletionPort = CreateIoCompletionPort (
01004   INVALID_HANDLE_VALUE,
01005   NULL,
01006   0,
01007   0)) == INVALID_HANDLE_VALUE) {
01008         AddToMessageLog(TEXT("ServiceStart: CreateIoCompletionPort failed\n"));
01009         return false;
01010     }
01011
01012     nThreadsAtClientCompletionPort = 0;
01013     nThreadsAtServerCompletionPort = 0;
01014
01015     // Initialize the LogEvent function.
01016     typedef RPC_STATUS (__stdcall *PF) (PVOID p, BOOL b, ULONG t, ULONG i);
01017
01018     HMODULE rpc = LoadLibrary(TEXT("rpcrt4.dll"));
01019
01020     if (rpc == 0)
01021         {
01022         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: LoadLibrary"), status);
01023         return false;
01024         }
01025
01026
01027     // Start accepting client calls.
01028     // The last argument's being 1 indicates that RpcServerListen
01029     // should return false immediately after completing function processing.
01030     status = RpcServerListen(cMinimumThreads, cMaxCallsExecute, 1);
01031     if (status != RPC_S_OK){
01032         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerListen"), status);
01033         return false;
01034     }
01035
01036     return true;
01037 }
01038
01039
01040 /*
01041     FUNCTION: ServiceStop
01042
01043     PURPOSE: Stops a service
01044
01045     PARAMETERS:
01046         none
01047
01048     RETURN VALUE:
01049         none
01050
01051     COMMENTS:
01052
01053 */
01054 VOID ServerStop() {
01055     RPC_STATUS status;
01056
01057     // Stops the server, wakes up the main thread.
01058     if (bServerListening) {
01059         status = RpcMgmtStopServerListening(NULL);
01060         if(status != RPC_S_OK) {
01061                     AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcMgmtWaitServerListen"), status);
01062         }
01063         bServerListening = FALSE;
01064     }
01065
01066     // Delete the binding vector.
01067     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
01068     if(status != RPC_S_OK){
01069         AddToMessageLogProcFailureEEInfo(TEXT("ServiceStart: RpcServerUnregisterIf"), status);
01070     }
01071
01072     // Tell The SCM that the service is stopped.
01073     if(!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_STOPPED, NO_ERROR, 0)) {
01074         AddToMessageLogProcFailure(TEXT("ServiceStop: ReportStatusToSCMgr"), GetLastError());
01075     }
01076
01077     // Wait for the client threads to finish so
01078     // that we do not deallocate active data structures.
01079     // We can accomplish this by waiting for the counters
01080     // to become zero.  Performing a check in this
01081     // order should prevent race conditions, since
01082     // pClientActiveReqCounters are incremented before
01083     // pClientReqCounters are decremented.
01084     if (fServerReqCountersCreated) {
01085         if (CountersCheckForNonzero(pServerReqCounters, NumPriGroups)) {
01086             Sleep(1000);
01087         }
01088     }
01089     if (fClientReqCountersCreated) {
01090         if (CountersCheckForNonzero(pClientReqCounters, NumPriGroups)) {
01091             Sleep(1000);
01092         }
01093     }
01094     if (fServerActiveReqCountersCreated) {
01095         if (CountersCheckForNonzero(pServerActiveReqCounters, NumPriGroups)) {
01096             Sleep(1000);
01097         }
01098     }
01099     if (fClientActiveReqCountersCreated) {
01100         if (CountersCheckForNonzero(pClientActiveReqCounters, NumPriGroups)) {
01101             Sleep(1000);
01102         }
01103     }
01104
01105     DeleteWellKnownSids();
01106
01107     // Delete queues and counters.
01108     if (fServerReqCountersCreated) {
01109         CountersDelete(pServerReqCounters, NumPriGroups);
01110         fServerReqCountersCreated = FALSE;
01111     }
01112     if (fClientReqCountersCreated) {
01113         CountersDelete(pClientReqCounters, NumPriGroups);
01114         fClientReqCountersCreated = FALSE;
01115     }
01116     if (fServerActiveReqCountersCreated) {
01117         CountersDelete(pServerActiveReqCounters, NumPriGroups);
01118         fServerActiveReqCountersCreated = FALSE;
01119     }
01120     if (fServerReqQueuesCreated) {
01121         QueuesDelete(ServerReqQueues, NumPriGroups);
01122         fServerReqQueuesCreated = FALSE;
01123     }
01124     if (fServerActiveReqHashCountersCreated) {
01125         QueuesDelete(ServerActiveReqHashCounters, NumPriGroups);
01126         fServerActiveReqHashCountersCreated = FALSE;
01127     }
01128     if (fClientActiveReqCountersCreated) {
01129         CountersDelete(pClientActiveReqCounters, NumPriGroups);
01130         fClientActiveReqCountersCreated = FALSE;
01131     }
01132     if (fClientReqQueuesCreated) {
01133         QueuesDelete(ClientReqQueues, NumPriGroups);
01134         fClientReqQueuesCreated = FALSE;
01135     }
01136     if (fClientActiveReqHashCountersCreated) {
01137         QueuesDelete(ClientActiveReqHashCounters, NumPriGroups);
01138         fClientActiveReqHashCountersCreated = FALSE;
01139     }
01140
01141 #ifdef PROF
01142     if (fProfOpenedLog) {
01143         ProfCloseLog();
01144         fProfOpenedLog = FALSE;
01145     }
01146 #endif
01147
01148 #ifdef DEBUG2
01149     if (fDbgMsgOpenedLog) {
01150         DbgMsgCloseLog();
01151         fDbgMsgOpenedLog = FALSE;
01152     }
01153 #endif
01154
01155 }
01156
01157
01158 // Heap for use by midl_user_allocate and midl_user_free.
01159 HANDLE RpcHeap;
01160
01161 /*
01162     MIDL allocate() and free()
01163 */
01164
01165 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
01166     return(HeapAlloc(RpcHeap, 0, len));
01167 }
01168
01169 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
01170     if(ptr != NULL) {
01171         HeapFree(RpcHeap, 0, ptr);
01172     }
01173 }
01174
01175 // end Service.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_USER_EVENT Member List

This is the complete list of members for _USER_EVENT, including all inherited members.
EventInfo | _USER_EVENT
Header | _USER_EVENT
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_CSampleDropExt Member List

This is the complete list of members for _CSampleDropExt, including all inherited members.
_cRef | _CSampleDropExt
_ctm | _CSampleDropExt
_hkeyProgID | _CSampleDropExt
_pdtobj | _CSampleDropExt
_sxi | _CSampleDropExt
_szTargetFolder | _CSampleDropExt
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_DEVICE_INFO Member List

This is the complete list of members for _DEVICE_INFO, including all inherited members.
cs | _DEVICE_INFO
DeviceId | _DEVICE_INFO
Directory | _DEVICE_INFO
ExitEvent | _DEVICE_INFO
pJobInfo | _DEVICE_INFO
pNextDeviceInfo | _DEVICE_INFO
Status | _DEVICE_INFO
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Schema/vc/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Schema
  • vc

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__55F387E0_AFF3_11D2_9A74_0080C7A2DC6B__INCLUDED_)
00007 #define AFX_STDAFX_H__55F387E0_AFF3_11D2_9A74_0080C7A2DC6B__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00013
00014 // TODO: reference additional headers your program requires here
00015
00016 //{{AFX_INSERT_LOCATION}}
00017 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00018
00019 #endif // !defined(AFX_STDAFX_H__55F387E0_AFF3_11D2_9A74_0080C7A2DC6B__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/MSPBase/msputils.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • MSPBase

msputils.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1997-1999 Microsoft Corporation
00004
00005 Module Name:
00006
00007     MSPutils.cpp
00008
00009 Abstract:
00010
00011     data for msputils.h
00012
00013 --*/
00014 #include "precomp.h"
00015 #pragma hdrstop
00016
00017 #include "mspbase.h"
00018 #include "msputils.h"
00019
00020 CMSPCritSection CMSPObjectSafetyImpl::s_CritSection;
00021
00022
00023 BOOL IsNodeOnList(PLIST_ENTRY ListHead, PLIST_ENTRY Entry)
00024 {
00025     PLIST_ENTRY pCurrent = ListHead;
00026     while(pCurrent->Flink != Entry)
00027     {
00028         pCurrent = pCurrent->Flink;
00029         if(pCurrent == 0)
00030         {
00031             return FALSE;
00032         }
00033     }
00034     return TRUE;
00035 }
00036
00037 // eof
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

section Member List

This is the complete list of members for section, including all inherited members.
bDiscard | section
correspond | section
first | section
last | section
leftbase | section
link | section
rightbase | section
state | section
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/StdAfx.h Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

StdAfx.h

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 // stdafx.h : include file for standard system include files,
00003 //  or project specific include files that are used frequently, but
00004 //      are changed infrequently
00005 //
00006
00007 #if !defined(AFX_STDAFX_H__EF85AEBB_6B6C_11D1_ADAD_00AA00B8E05A__INCLUDED_)
00008 #define AFX_STDAFX_H__EF85AEBB_6B6C_11D1_ADAD_00AA00B8E05A__INCLUDED_
00009
00010 #if _MSC_VER >= 1000
00011 #pragma once
00012 #endif // _MSC_VER >= 1000
00013
00014 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00015
00016 #include <afxwin.h>         // MFC core and standard components
00017 #include <afxext.h>         // MFC extensions
00018 #ifndef _AFX_NO_AFXCMN_SUPPORT
00019 #include <afxcmn.h>     // MFC support for Windows Common Controls
00020 #endif // _AFX_NO_AFXCMN_SUPPORT
00021
00022
00023 //{{AFX_INSERT_LOCATION}}
00024 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00025
00026 #endif // !defined(AFX_STDAFX_H__EF85AEBB_6B6C_11D1_ADAD_00AA00B8E05A__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkBlog/C#/AssemblyInfo.cs Source File

  • TabletPC
  • InkBlog
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("InkBlogControls Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2004 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebDebug.h Source File

  • WinBase
  • Debug
  • Deb

DebDebug.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014 \******************************************************************************/
00015
00016 #ifndef DEBDEBUG_H
00017
00018  #define DEBDEBUG_H
00019
00020  #define EXCEPTION_VDM_EVENT ( (LONG) 0x40000005L )
00021
00022  //-- debuggee startup information structure
00023  typedef struct DEB_STARTUP_INFO_STRUCT* PDEB_STARTUP_INFO;
00024  typedef struct DEB_STARTUP_INFO_STRUCT {
00025            BOOL                fActive;
00026            DWORD               dwProcessId;
00027            LPTSTR              lpstrFileName;
00028            LPTSTR              lpstrPathName;
00029            HWND                hWndListBox;
00030            STARTUPINFO         StartupInfo;
00031            PROCESS_INFORMATION ProcessInfo;
00032          } DEB_STARTUP_INFO;
00033
00034  //-- linked list debug list information structures
00035  typedef struct DEB_PROCESS_LIST_INFO_STRUCT* PDEB_PROCESS_LIST_INFO;
00036  typedef struct DEB_PROCESS_LIST_INFO_STRUCT {
00037            DWORD dwActiveProcesses;
00038          } DEB_PROCESS_LIST_INFO;
00039
00040  typedef struct DEB_THREAD_LIST_INFO_STRUCT* PDEB_THREAD_LIST_INFO;
00041  typedef struct DEB_THREAD_LIST_INFO_STRUCT {
00042            DWORD dwActiveThreads;
00043          } DEB_THREAD_LIST_INFO;
00044
00045  typedef struct DEB_DLL_LIST_INFO_STRUCT* PDEB_DLL_LIST_INFO;
00046  typedef struct DEB_DLL_LIST_INFO_STRUCT {
00047            DWORD dwActiveDlls;
00048          } DEB_DLL_LIST_INFO;
00049
00050  //-- linked list debug node information structures
00051  typedef struct DEB_PROCESS_NODE_INFO_STRUCT* PDEB_PROCESS_NODE_INFO;
00052  typedef struct DEB_PROCESS_NODE_INFO_STRUCT {
00053            DWORD                     dwProcessId;  // sort key
00054            DWORD                     dwThreadId;   // first thread
00055            LPTSTR                    lpstrFileName;
00056            LPTSTR                    lpstrPathName;
00057            PLIST                     pThreadList;
00058            PLIST                     pDllList;
00059            CREATE_PROCESS_DEBUG_INFO ProcessDebugInfo;
00060          } DEB_PROCESS_NODE_INFO;
00061
00062  typedef struct DEB_THREAD_NODE_INFO_STRUCT* PDEB_THREAD_NODE_INFO;
00063  typedef struct DEB_THREAD_NODE_INFO_STRUCT {
00064            DWORD                    dwProcessId;
00065            DWORD                    dwThreadId;  // sort key
00066            CREATE_THREAD_DEBUG_INFO ThreadDebugInfo;
00067          } DEB_THREAD_NODE_INFO;
00068
00069  typedef struct DEB_DLL_NODE_INFO_STRUCT* PDEB_DLL_NODE_INFO;
00070  typedef struct DEB_DLL_NODE_INFO_STRUCT {
00071            LPTSTR              lpstrFileName;
00072            LPTSTR              lpstrPathName;
00073            LOAD_DLL_DEBUG_INFO DllDebugInfo; // sort key =  DllDebugInfo.lpBaseOfDll
00074          } DEB_DLL_NODE_INFO;
00075
00076  //-- public function prototypes
00077  DWORD WINAPI DebugEventThread( PDEB_STARTUP_INFO );
00078
00079 #endif // DEBDEBUG_H
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagGENERICITEMLIST Member List

This is the complete list of members for _tagGENERICITEMLIST, including all inherited members.
_cRefs | _tagGENERICITEMLIST
dwNumItems | _tagGENERICITEMLIST
pFirstGenericItem | _tagGENERICITEMLIST
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPUIKeywords Member List

This is the complete list of members for CSCPUIKeywords, including all inherited members.
Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal) | CPropertyPage |
Apply() | CPropertyPage |
CPropertyPage(REFCLSID clsid, INT iDialogID) | CPropertyPage |
CSCPUIKeywords() | CSCPUIKeywords | [inline]
CSCPUIKeywords(HWND hNotifyObj) | CSCPUIKeywords | [inline]
Deactivate() | CPropertyPage |
DEFINE_ADDREF_RELEASE | CPropertyPage |
DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [static]
GetClassID(CLSID __RPC_FAR *pClassID) | CPropertyPage | [inline]
GetPageInfo(PROPPAGEINFO __RPC_FAR *pPageInfo) | CPropertyPage | [inline, virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [virtual]
Help(LPCOLESTR pszHelpDir) | CPropertyPage | [inline]
Init(PWSTR pszPath, PWSTR pszClass) | CSCPUIKeywords | [virtual]
InitNew(void) | CPropertyPage | [inline]
IsPageDirty() | CPropertyPage |
Load(IPropertyBag __RPC_FAR *pPropBag, IErrorLog __RPC_FAR *pErrorLog) | CPropertyPage | [inline]
m_bDirty | CSCPUIKeywords | [private]
m_clsid | CPropertyPage | [protected]
m_cRef | CPropertyPage | [protected]
m_hNotifyObj | CSCPUIKeywords | [private]
m_hWnd | CPropertyPage | [protected]
m_iDialogID | CPropertyPage | [protected]
m_pAttributeEditor | CSCPUIKeywords | [private]
m_pIPropertyPageSite | CPropertyPage | [protected]
m_pWritableAttrs | CSCPUIKeywords | [private]
m_spDsObj | CSCPUIKeywords | [private]
m_szClass | CSCPUIKeywords | [private]
m_szPath | CSCPUIKeywords | [private]
m_szValueList | CSCPUIKeywords | [private]
Move(LPCRECT pRect) | CPropertyPage |
OnApply() | CSCPUIKeywords | [virtual]
OnDestroy() | CSCPUIKeywords | [virtual]
OnInitDialog() | CSCPUIKeywords | [virtual]
OnPropertyChange() | CSCPUIKeywords |
QueryInterface(REFIID riid, LPVOID *ppv) | CPropertyPage |
Save(IPropertyBag __RPC_FAR *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) | CPropertyPage | [inline]
SetObjects(ULONG cObjects, IUnknown __RPC_FAR *__RPC_FAR *ppUnk) | CPropertyPage | [inline]
SetPageSite(IPropertyPageSite *pPageSite) | CPropertyPage |
SetUIData() | CSCPUIKeywords | [virtual]
Show(UINT nCmdShow) | CPropertyPage |
TranslateAccelerator(MSG *pMsg) | CPropertyPage |
~CPropertyPage() | CPropertyPage | [virtual]
~CSCPUIKeywords() | CSCPUIKeywords | [inline]
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/guids.h Source File

  • SysMgmt
  • MMC
  • About

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // {22612902-79B5-11d2-9508-00C04FB92EC2}
00020 DEFINE_GUID(CLSID_CComponentData,
00021             0x22612902, 0x79b5, 0x11d2, 0x95, 0x8, 0x0, 0xc0, 0x4f, 0xb9, 0x2e, 0xc2);
00022
00023 // {22612904-79B5-11d2-9508-00C04FB92EC2}
00024 DEFINE_GUID(CLSID_CSnapinAbout,
00025             0x22612904, 0x79b5, 0x11d2, 0x95, 0x8, 0x0, 0xc0, 0x4f, 0xb9, 0x2e, 0xc2);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/registry.cpp Source File

  • Com
  • async
  • server

registry.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #include <objbase.h>
00019
00020 #include "Registry.h"
00021 #include "CFactory.h"
00022 #include "Debug.h"
00023
00024 extern CLSID g_clsid;
00025 extern LPOLESTR g_progID;
00026
00027 CHAR_CONVERSION;
00028
00029
00030 ////////////////////////////////////////////////////////
00031 //
00032 // Internal helper functions prototypes
00033 //
00034
00035 // Set the given key and its value.
00036 BOOL setKeyAndValue(LPCTSTR szKey,
00037                     LPCTSTR szSubkey,
00038                     LPCTSTR szValue = NULL,
00039           LPCTSTR szName=NULL);
00040
00041 // Convert a CLSID into a char string.
00042 void CLSIDtochar(const CLSID& clsid,
00043                  LPTSTR szCLSID,
00044                  int length);
00045
00046 // Delete szKeyChild and all of its descendents.
00047 LONG recursiveDeleteKey(HKEY hKeyParent, LPCTSTR szKeyChild);
00048
00049 ////////////////////////////////////////////////////////
00050 //
00051 // Constants
00052 //
00053
00054 // Size of a CLSID as a string
00055 const int CLSID_STRING_SIZE = 39;
00056
00057 /////////////////////////////////////////////////////////
00058 //
00059 // Public function implementation
00060 //
00061
00062 //
00063 // Register the component in the registry.
00064 //
00065 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00066              CFactoryData& classData)
00067 {
00068
00069   // Get server location.
00070   HRESULT hr;
00071   char szModule[512];
00072   DWORD dwResult =
00073     ::GetModuleFileName(hModule,
00074                         szModule,
00075                         sizeof(szModule)/sizeof(char));
00076
00077 //checkcheck
00078   g_clsid = *classData.m_pCLSID;
00079   g_progID = const_cast<LPOLESTR>(classData.m_szProgID);
00080
00081   _ASSERT(dwResult != 0);
00082
00083   // Convert the CLSID into a char.
00084   char szCLSID[CLSID_STRING_SIZE];
00085   CLSIDtochar(*classData.m_pCLSID, szCLSID, sizeof(szCLSID));
00086
00087   // Build the key CLSID\\{...}
00088   char szKey[64];
00089   strcpy(szKey, "CLSID\\");
00090   strcat(szKey, szCLSID);
00091
00092   // Add the CLSID to the registry.
00093   setKeyAndValue(szKey, NULL, classData.m_RegistryName);
00094
00095   // Add the server filename subkey under the CLSID key.
00096   switch (classData.server)
00097   {
00098     case REMOTE:
00099     // TODO: add AppID entries
00100     // fall through
00101     case LOCAL:
00102       setKeyAndValue(szKey, "LocalServer32", szModule);
00103       break;
00104     case CONTROL:
00105       // Add "Control" key for Insert Dialog box
00106       setKeyAndValue(szKey, "Control");
00107       // fall through
00108     case INPROC:
00109       setKeyAndValue(szKey, "InprocServer32", szModule);
00110       // Add threading model
00111       setKeyAndValue(szKey, "InprocServer32", classData.threadingModel, "ThreadingModel");
00112       break;
00113   }
00114
00115   // Add the ProgID subkey under the CLSID key.
00116   setKeyAndValue(szKey, "ProgID", W2A(classData.m_szProgID));
00117
00118   // Add the version-independent ProgID subkey under CLSID key.
00119   setKeyAndValue(szKey, "VersionIndependentProgID",
00120                  W2A(classData.m_szVerIndProgID));
00121
00122   // Add the GUID for the typelib
00123   if (classData.m_pLIBID != &CLSID_NULL)
00124   {
00125     char typelib[CLSID_STRING_SIZE];
00126     CLSIDtochar(*classData.m_pLIBID, typelib, sizeof(typelib));
00127     setKeyAndValue(szKey, "TypeLib", typelib);
00128     setKeyAndValue(szKey, "Programmable");
00129     hr = RegisterLibrary(hModule, *classData.m_pLIBID, "Student.tlb");
00130     if (FAILED(hr))
00131       return hr;
00132   }
00133
00134   if (classData.m_fProxy)
00135   {
00136     hr = RegisterProxy(hModule);
00137     if (FAILED(hr))
00138       return hr;
00139   }
00140
00141
00142   // Add "attributes" designating what this object: is, can do, needs
00143   char buffer[80];
00144   HKEY hKey;
00145   long lResult;
00146
00147   if (classData.m_oleMisc != 0)
00148     setKeyAndValue(szKey, "MiscStatus", itoa(classData.m_oleMisc, buffer, 10));
00149
00150   if (classData.m_oleVerbs != 0)
00151   {
00152     strcpy(buffer, szKey);
00153     strcat(szKey, "\\Verb");
00154     lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00155                                 szKey,
00156                                 0, NULL, REG_OPTION_NON_VOLATILE,
00157                                 KEY_ALL_ACCESS, NULL,
00158                                 &hKey, NULL);
00159
00160     if (lResult != ERROR_SUCCESS)
00161       OutputDebugString("Error creating verb\n");
00162     RegCloseKey(hKey);
00163     LPSTR end, begin = const_cast<char*>(classData.m_oleVerbs);
00164     if (begin)
00165       do
00166       {
00167         signed char lVerb = *begin++;
00168         end = strchr(begin, '.');
00169         *end++ = NULL;
00170         char verb[5];
00171         itoa(lVerb, verb, 10);
00172         wsprintf(buffer, "%s,%c,%c",begin, *end, *(end+2));
00173         setKeyAndValue(szKey, verb, buffer);
00174         begin = end+4;
00175       } while (*begin);
00176   }
00177
00178   if (classData.m_szname != 0)
00179   {
00180   // Add names to be displayed in menus, dialogs, ....
00181     strcpy(szKey, "CLSID\\");
00182     strcat(szKey, szCLSID);
00183     strcat(szKey, "\\AuxUserType");
00184     lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00185                            szKey,
00186                            0, NULL, REG_OPTION_NON_VOLATILE,
00187                            KEY_ALL_ACCESS, NULL,
00188                            &hKey, NULL);
00189
00190     RegCloseKey(hKey);
00191     setKeyAndValue(szKey, "2", classData.m_szname);
00192     setKeyAndValue(szKey, "3", classData.m_szAppName);
00193   }
00194   // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT.
00195   setKeyAndValue(W2A(classData.m_szVerIndProgID), NULL, classData.m_RegistryName);
00196   setKeyAndValue(W2A(classData.m_szVerIndProgID), "CLSID", szCLSID);
00197   setKeyAndValue(W2A(classData.m_szVerIndProgID), "CurVer", W2A(classData.m_szProgID));
00198
00199   // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT.
00200   setKeyAndValue(W2A(classData.m_szProgID), NULL, classData.m_RegistryName);
00201   setKeyAndValue(W2A(classData.m_szProgID), "CLSID", szCLSID);
00202
00203   return S_OK ;
00204 }
00205
00206
00207 //
00208 // Remove the component from the registry.
00209 //
00210 HRESULT UnregisterServer(HMODULE hModule,            // DLL module handle
00211              CFactoryData& classData)
00212 {
00213   HRESULT hr;
00214
00215
00216   g_clsid = *classData.m_pCLSID;
00217   g_progID = const_cast<LPOLESTR>(classData.m_szProgID);
00218
00219   // Convert the CLSID into a char.
00220   char szCLSID[CLSID_STRING_SIZE];
00221   CLSIDtochar(*classData.m_pCLSID, szCLSID, sizeof(szCLSID));
00222
00223   // Build the key CLSID\\{...}
00224   char szKey[64];
00225   strcpy(szKey, "CLSID\\");
00226   strcat(szKey, szCLSID);
00227
00228   // Delete the CLSID Key - CLSID\{...}
00229   LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00230   _ASSERT((lResult == ERROR_SUCCESS) ||
00231          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00232
00233   // Delete the version-independent ProgID Key.
00234   lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, W2A(classData.m_szVerIndProgID));
00235   _ASSERT((lResult == ERROR_SUCCESS) ||
00236          (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00237
00238   // Delete the ProgID key.
00239   lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, W2A(classData.m_szProgID));
00240   _ASSERT((lResult == ERROR_SUCCESS) ||
00241          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00242
00243   // Delete the typelibrary
00244   if (classData.m_pLIBID != &CLSID_NULL)
00245   {
00246     DWORD Major = HIWORD(classData.m_LibVersion);
00247     DWORD Minor = LOWORD(classData.m_LibVersion);
00248     LCID  lcid = classData.m_lcid;
00249     hr = UnRegisterTypeLib( *classData.m_pLIBID,
00250           HIWORD(classData.m_LibVersion), LOWORD(classData.m_LibVersion), classData.m_lcid, SYS_WIN32);
00251     if (FAILED(hr))
00252       return hr;
00253   }
00254
00255   // Delete the ProxyStub entry for the custom interface
00256   if (classData.m_fProxy)
00257   {
00258     hr = UnRegisterProxy(hModule);
00259     if (FAILED(hr))
00260       return hr;
00261   }
00262
00263   return S_OK;
00264 }
00265
00266
00267
00268 ///////////////////////////////////////////////////////////
00269 //
00270 // Internal helper functions
00271 //
00272
00273 // Convert a CLSID to a char string.
00274 void CLSIDtochar(const CLSID& clsid,
00275                  LPTSTR szCLSID,
00276                  int length)
00277 {
00278   _ASSERT(length >= CLSID_STRING_SIZE) ;
00279   // Get CLSID
00280   LPOLESTR wszCLSID = NULL ;
00281   HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00282   _ASSERT(SUCCEEDED(hr)) ;
00283
00284   // Covert from wide characters to non-wide.
00285   wcstombs(szCLSID, wszCLSID, length) ;
00286
00287   // Free memory.
00288   CoTaskMemFree(wszCLSID) ;
00289 }
00290
00291 //
00292 // Delete a key and all of its descendents.
00293 //
00294 LONG recursiveDeleteKey(HKEY hKeyParent,        // Parent of key to delete
00295                         LPCTSTR lpszKeyChild) // Key to delete
00296 {
00297   // Open the child.
00298   HKEY hKeyChild ;
00299   LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00300                            KEY_ALL_ACCESS, &hKeyChild) ;
00301   if (lRes != ERROR_SUCCESS)
00302   {
00303     return lRes ;
00304   }
00305
00306   // Enumerate all of the decendents of this child.
00307   FILETIME time ;
00308   char szBuffer[256] ;
00309   DWORD dwSize = 256 ;
00310   while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00311                       NULL, NULL, &time) == S_OK)
00312   {
00313     // Delete the decendents of this child.
00314     lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00315     if (lRes != ERROR_SUCCESS)
00316     {
00317       // Cleanup before exiting.
00318       RegCloseKey(hKeyChild) ;
00319       return lRes;
00320     }
00321     dwSize = 256 ;
00322   }
00323
00324   // Close the child.
00325   RegCloseKey(hKeyChild) ;
00326
00327   // Delete this child.
00328   return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00329 }
00330
00331 //
00332 // Create a key and set its value.
00333 //   - This helper function was borrowed and modifed from
00334 //     Kraig Brockschmidt's book Inside OLE.
00335 //
00336 BOOL setKeyAndValue(LPCTSTR szKey,
00337                     LPCTSTR szSubkey,
00338                     LPCTSTR szValue,
00339           LPCTSTR szName)
00340 {
00341   HKEY hKey;
00342   char szKeyBuf[1024] ;
00343
00344   // Copy keyname into buffer.
00345   strcpy(szKeyBuf, szKey) ;
00346
00347   // Add subkey name to buffer.
00348   if (szSubkey != NULL)
00349   {
00350     strcat(szKeyBuf, "\\") ;
00351     strcat(szKeyBuf, szSubkey ) ;
00352   }
00353
00354   // Create and open key and subkey.
00355   long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00356                                 szKeyBuf,
00357                                 0, NULL, REG_OPTION_NON_VOLATILE,
00358                                 KEY_ALL_ACCESS, NULL,
00359                                 &hKey, NULL) ;
00360   if (lResult != ERROR_SUCCESS)
00361   {
00362     return FALSE ;
00363   }
00364
00365   // Set the Value.
00366   if (szValue != NULL)
00367   {
00368     RegSetValueEx(hKey, szName, 0, REG_SZ,
00369                   (BYTE *)szValue,
00370                   static_cast<DWORD>(strlen(szValue)+1)) ;
00371   }
00372
00373   RegCloseKey(hKey) ;
00374   return TRUE ;
00375 }
00376
00377
00378 HRESULT RegisterLibrary(HMODULE hModule, // Application module handle
00379             const GUID& pLibIID,
00380             LPCSTR  szPath)
00381 {
00382   HRESULT hr = E_FAIL;
00383   LPTYPELIB ptypeLib;
00384   OLECHAR FileName[MAX_PATH];
00385
00386   if (szPath)
00387   {
00388     MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szPath, -1, FileName, (sizeof FileName)/(sizeof FileName[0]));
00389     hr = LoadTypeLibEx(FileName, REGKIND_REGISTER, &ptypeLib);
00390   }
00391
00392 /*
00393  * try and load the typelibrary from the applications' resources
00394  */
00395   if (FAILED(hr))
00396   {
00397     char AppName[MAX_PATH];
00398     GetModuleFileName(hModule, AppName, sizeof(AppName));
00399     MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, AppName, -1, FileName, (sizeof FileName)/(sizeof FileName[0]));
00400     DEBUGTRACE(_T("LoadRegTypeLib failed, loading typelib from filename [%S]\n"), FileName);
00401     hr = LoadTypeLibEx(FileName, REGKIND_REGISTER, &ptypeLib);
00402 /*
00403  * If that fails then resort to loading the typelibrary as a seperate file
00404  * this will only look for a typelibrary with the same name as the application
00405  */
00406     if (FAILED(hr))
00407     {
00408       LPSTR p = NULL;
00409       if((p = strchr(AppName, '.')) == NULL)
00410       {
00411         DEBUGTRACE(_T("Unable to append a TLB extention to app bombing out [%X]\n"), hr);
00412         return hr;
00413       }
00414
00415       *p = NULL;
00416       strcat(AppName, ".tlb");
00417       MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, AppName, -1, FileName, (sizeof FileName)/(sizeof FileName[0]));
00418       DEBUGTRACE(_T("LoadRegTypeLib failed, loading typelib from filename [%S]\n"), FileName);
00419       hr = LoadTypeLibEx(FileName, REGKIND_REGISTER, &ptypeLib);
00420       if (FAILED(hr))
00421       {
00422         DEBUGTRACE(_T("LoadTypeLib failed bombing out [%X]\n"), hr);
00423         return hr;
00424       }
00425     }
00426   }
00427   RELEASEINTERFACE(ptypeLib);
00428   return hr;
00429 }
00430
00431
00432 HRESULT RegisterProxy(HMODULE hModule, // Application module handle
00433             LPCSTR szPath)
00434 {
00435   HRESULT hr = E_FAIL;
00436   HINSTANCE hLib;
00437   HRESULT (__stdcall *DllRegisterServer)(void);
00438
00439   char FileName[MAX_PATH];
00440
00441   if (szPath)
00442     hLib = LoadLibrary(szPath);
00443   else
00444   {
00445     GetModuleFileName(hModule, FileName, sizeof(FileName));
00446     LPSTR p = NULL;
00447     if((p = strrchr(FileName, '\\')) == NULL)
00448     {
00449         DEBUGTRACE(_T("Unable to find path to proxystub bombing out [%X]\n"), hr);
00450         return E_FAIL;
00451     }
00452     *p = NULL;
00453     strcat(FileName, "\\Proxy.Dll");
00454     hLib = LoadLibrary(FileName);
00455   }
00456   if (!hLib)
00457     return HRESULT_FROM_WIN32(GetLastError());
00458   DllRegisterServer = (HRESULT(__stdcall*)())GetProcAddress(hLib, "DllRegisterServer");
00459   if (!DllRegisterServer)
00460     return HRESULT_FROM_WIN32(GetLastError());
00461
00462   hr = (*DllRegisterServer)();
00463   FreeLibrary(hLib);
00464   return hr;
00465 }
00466
00467
00468 HRESULT UnRegisterProxy(HMODULE hModule, // Application module handle
00469             LPCSTR szPath)
00470 {
00471   HRESULT hr = E_FAIL;
00472   HINSTANCE hLib;
00473   HRESULT (__stdcall *DllUnregisterServer)(void);
00474
00475   char FileName[MAX_PATH];
00476
00477   if (szPath)
00478     hLib = LoadLibrary(szPath);
00479   else
00480   {
00481     GetModuleFileName(hModule, FileName, sizeof(FileName));
00482     LPSTR p = NULL;
00483     if((p = strrchr(FileName, '\\')) == NULL)
00484     {
00485         DEBUGTRACE(_T("Unable to find path to proxystub bombing out [%X]\n"), hr);
00486         return E_FAIL;
00487     }
00488     *p = NULL;
00489     strcat(FileName, "\\Proxy.Dll");
00490     hLib = LoadLibrary(FileName);
00491   }
00492   if (!hLib)
00493     return HRESULT_FROM_WIN32(GetLastError());
00494   DllUnregisterServer = (HRESULT(__stdcall*)())GetProcAddress(hLib, "DllUnregisterServer");
00495   if (!DllUnregisterServer)
00496     return HRESULT_FROM_WIN32(GetLastError());
00497
00498   hr = (*DllUnregisterServer)();
00499   FreeLibrary(hLib);
00500   return hr;
00501 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagFieldMetaData Member List

This is the complete list of members for tagFieldMetaData, including all inherited members.
bNull | tagFieldMetaData
DECLARE_FIXED_ALLOC(tagFieldMetaData) | tagFieldMetaData
nDataBindLen | tagFieldMetaData
nDataLen | tagFieldMetaData
nNullable | tagFieldMetaData
nScale | tagFieldMetaData
pData | tagFieldMetaData
sqldatatype | tagFieldMetaData
sqltype | tagFieldMetaData
vt | tagFieldMetaData
wszName | tagFieldMetaData
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/SampleMSP/SampMsp.Idl Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • SampleMSP

SampMsp.Idl

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sampmsp.idl
00008
00009 Abstract:
00010
00011     IDL source for sampmsp.dll
00012
00013 --*/
00014
00015 // This file will be processed by the MIDL tool to
00016 // produce the type library (sampmsp.tlb) and marshalling code.
00017
00018 // import "oaidl.idl";
00019 // import "ocidl.idl";
00020
00021 import "msp.idl";
00022
00023 [
00024   uuid(405AB7D7-BFA7-11d2-B11D-006008B0E5D2),
00025   version(1.0),
00026   helpstring("Sample MSP 1.0 Type Library")
00027 ]
00028 library SampleMSPLib
00029 {
00030   importlib("stdole32.tlb");
00031   importlib("stdole2.tlb");
00032
00033   [
00034     uuid(23F7C678-24E1-48db-AEAC-54A6F2A010A0),
00035     helpstring("Sample MSP Class")
00036   ]
00037   coclass SampleMSP
00038   {
00039     [default] interface ITMSPAddress;
00040   };
00041 };
00042
00043 // eof
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSampleStemmer Member List

This is the complete list of members for CSampleStemmer, including all inherited members.
_cRefs | CSampleStemmer | [private]
AddRef() | CSampleStemmer | [inline]
CSampleStemmer() | CSampleStemmer | [inline]
GenerateWordForms(WCHAR const *pwcInBuf, ULONG cwc, IWordFormSink *pWordFormSink) | CSampleStemmer |
GetLicenseToUse(const WCHAR **ppwcsLicense) | CSampleStemmer | [inline]
Init(ULONG ulMaxTokenSize, BOOL *pfLicense) | CSampleStemmer | [inline]
QueryInterface(REFIID riid, void **ppvObject) | CSampleStemmer | [inline]
Release() | CSampleStemmer | [inline]
~CSampleStemmer() | CSampleStemmer | [inline]
Generated on Wed Nov 13 2024 16:57:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/PrintSdiDoc.h Source File

  • NetDS
  • fax
  • PrintSdi

PrintSdiDoc.h

Go to the documentation of this file.
00001 // PrintSDIDoc.h : interface of the CPrintSDIDoc class
00002 //
00003 /////////////////////////////////////////////////////////////////////////////
00004
00005 #if !defined(AFX_PRINTSDIDOC_H__55689549_8B6C_11D1_B7AE_000000000000__INCLUDED_)
00006 #define AFX_PRINTSDIDOC_H__55689549_8B6C_11D1_B7AE_000000000000__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012
00013 class CPrintSDIDoc : public CDocument
00014 {
00015 protected: // create from serialization only
00016   CPrintSDIDoc();
00017   DECLARE_DYNCREATE(CPrintSDIDoc)
00018
00019 // Attributes
00020 public:
00021
00022 // Operations
00023 public:
00024
00025 // Overrides
00026   // ClassWizard generated virtual function overrides
00027   //{{AFX_VIRTUAL(CPrintSDIDoc)
00028   public:
00029   virtual BOOL OnNewDocument();
00030   virtual void Serialize(CArchive& ar);
00031   //}}AFX_VIRTUAL
00032
00033 // Implementation
00034 public:
00035   int m_polytype;
00036   CString m_szText;
00037   virtual ~CPrintSDIDoc();
00038 #ifdef _DEBUG
00039   virtual void AssertValid() const;
00040   virtual void Dump(CDumpContext& dc) const;
00041 #endif
00042
00043 protected:
00044
00045 // Generated message map functions
00046 protected:
00047   //{{AFX_MSG(CPrintSDIDoc)
00048     // NOTE - the ClassWizard will add and remove member functions here.
00049     //    DO NOT EDIT what you see in these blocks of generated code !
00050   //}}AFX_MSG
00051   DECLARE_MESSAGE_MAP()
00052 };
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055
00056 //{{AFX_INSERT_LOCATION}}
00057 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00058
00059 #endif // !defined(AFX_PRINTSDIDOC_H__55689549_8B6C_11D1_B7AE_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/space.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

space.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "Space.h"
00021 #define STRSAFE_NO_DEPRECATE
00022 #include <strsafe.h>
00023
00024 const GUID CSpaceVehicle::thisGuid = { 0x29743810, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00025 const GUID CRocket::thisGuid = { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00026
00027 //==============================================================
00028 //
00029 // CSpaceVehicle implementation
00030 //
00031 //
00032 CSpaceVehicle::CSpaceVehicle(CComponentData *pComponentData)
00033 {
00034     m_pComponentData = pComponentData;
00035
00036     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00037         children[n] = new CRocket(pComponentData);
00038         children[n]->Initialize(_T("Vehicle"), 500000, 265, 75000);
00039     }
00040 }
00041
00042 CSpaceVehicle::~CSpaceVehicle()
00043 {
00044     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00045         if (children[n]) {
00046             delete children[n];
00047         }
00048 }
00049
00050 HRESULT CSpaceVehicle::Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00051 {
00052     HRESULT      hr = S_OK;
00053
00054     IHeaderCtrl *pHeaderCtrl = NULL;
00055     IResultData *pResultData = NULL;
00056
00057     if (bShow) {
00058         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00059         _ASSERT( SUCCEEDED(hr) );
00060
00061         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00062         _ASSERT( SUCCEEDED(hr) );
00063
00064         // Set the column headers in the results pane
00065         hr = pHeaderCtrl->InsertColumn( 0, L"Rocket Class", 0, MMCLV_AUTO );
00066         _ASSERT( S_OK == hr );
00067         hr = pHeaderCtrl->InsertColumn( 1, L"Rocket Weight", 0, MMCLV_AUTO );
00068         _ASSERT( S_OK == hr );
00069         hr = pHeaderCtrl->InsertColumn( 2, L"Rocket Height", 0, MMCLV_AUTO );
00070         _ASSERT( S_OK == hr );
00071         hr = pHeaderCtrl->InsertColumn( 3, L"Rocket Payload", 0, MMCLV_AUTO );
00072         _ASSERT( S_OK == hr );
00073         hr = pHeaderCtrl->InsertColumn( 4, L"Status", 0, MMCLV_AUTO );
00074         _ASSERT( S_OK == hr );
00075
00076         // insert items here
00077         RESULTDATAITEM rdi;
00078
00079         hr = pResultData->DeleteAllRsltItems();
00080         _ASSERT( SUCCEEDED(hr) );
00081
00082         if (!bExpanded) {
00083             // create the child nodes, then expand them
00084             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00085                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00086                 rdi.mask       = RDI_STR       |   // Displayname is valid
00087                     RDI_IMAGE     |
00088                     RDI_PARAM;        // nImage is valid
00089
00090                 rdi.nImage      = children[n]->GetBitmapIndex();
00091                 rdi.str         = MMC_CALLBACK;
00092                 rdi.nCol        = 0;
00093                 rdi.lParam      = (LPARAM)children[n];
00094
00095                 hr = pResultData->InsertItem( &rdi );
00096
00097                 _ASSERT( SUCCEEDED(hr) );
00098             }
00099         }
00100
00101         pHeaderCtrl->Release();
00102         pResultData->Release();
00103     }
00104
00105     return hr;
00106 }
00107
00108 //==============================================================
00109 //
00110 // CSpaceVehicle::CRocket implementation
00111 //
00112 //
00113 CRocket::CRocket(CComponentData *pComponentData)
00114 : szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED)
00115 {
00116     m_pComponentData = pComponentData;
00117 }
00118
00119 CRocket::~CRocket()
00120 {
00121     if (szName)
00122         delete [] szName;
00123 }
00124
00125 void CRocket::Initialize(_TCHAR *szName, LONG lWeight, LONG lHeight, LONG lPayload)
00126 {
00127     if (szName) {
00128         this->szName = new _TCHAR[_tcslen(szName) + 1];
00129         _tcscpy(this->szName, szName);
00130     }
00131
00132     this->lWeight = lWeight;
00133     this->lHeight = lHeight;
00134     this->lPayload = lPayload;
00135 }
00136
00137 const _TCHAR *CRocket::GetDisplayName(int nCol)
00138 {
00139     const size_t cchBuffer = 128;
00140     static _TCHAR buf[cchBuffer];
00141
00142     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00143     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00144
00145     switch (nCol) {
00146     case 0:
00147         StringCchCopy(buf, cchBuffer, szName ? szName : _T(""));
00148         break;
00149
00150     case 1:
00151         StringCchPrintf(buf, cchBuffer, _T("%ld metric tons"), lWeight);
00152         break;
00153
00154     case 2:
00155         StringCchPrintf(buf, cchBuffer, _T("%ld meters"), lHeight);
00156         break;
00157
00158     case 3:
00159         StringCchPrintf(buf, cchBuffer, _T("%ld kilos"), lPayload);
00160         break;
00161
00162     case 4:
00163         StringCchPrintf(buf, cchBuffer, _T("%s"),
00164             iStatus == RUNNING ? _T("running") :
00165         iStatus == PAUSED ? _T("paused") :
00166         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00167         break;
00168
00169     }
00170
00171     return buf;
00172 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/comp.h Source File

  • SysMgmt
  • MMC
  • Taskpads

comp.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMP_H_
00020 #define _SAMPCOMP_H_
00021
00022 #include <mmc.h>
00023 #include <tchar.h>
00024 #include "EnumTASK.h"
00025 #include "globals.h"
00026
00027 class CComponent : public IComponent,
00028 IExtendTaskPad
00029 {
00030 private:
00031     ULONG       m_cref;
00032
00033     IConsole*   m_ipConsole;
00034     IConsole2*    m_ipConsole2;
00035
00036     //store the view type: standard or taskpad
00037     BOOL m_bTaskpadView;
00038     //store the user's view type preference.
00039     BOOL m_bIsTaskpadPreferred;
00040
00041     class CComponentData *m_pComponentData;
00042
00043     public:
00044         CComponent(CComponentData *parent);
00045         ~CComponent();
00046
00047         ///////////////////////////////
00048         // Interface IUnknown
00049         ///////////////////////////////
00050         STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00051         STDMETHODIMP_(ULONG) AddRef();
00052         STDMETHODIMP_(ULONG) Release();
00053
00054         ///////////////////////////////
00055         // Interface IComponent
00056         ///////////////////////////////
00057         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00058             /* [in] */ LPCONSOLE lpConsole);
00059
00060             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00061             /* [in] */ LPDATAOBJECT lpDataObject,
00062             /* [in] */ MMC_NOTIFY_TYPE event,
00063             /* [in] */ LPARAM arg,
00064             /* [in] */ LPARAM param);
00065
00066             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
00067             /* [in] */ MMC_COOKIE cookie);
00068
00069             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00070             /* [in] */ MMC_COOKIE cookie,
00071             /* [in] */ DATA_OBJECT_TYPES type,
00072             /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00073
00074             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
00075             /* [in] */ MMC_COOKIE cookie,
00076             /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00077             /* [out] */ long __RPC_FAR *pViewOptions);
00078
00079             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00080             /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
00081
00082             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00083             /* [in] */ LPDATAOBJECT lpDataObjectA,
00084             /* [in] */ LPDATAOBJECT lpDataObjectB);
00085
00086             ///////////////////////////////
00087             // Interface IComponent
00088             ///////////////////////////////
00089             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TaskNotify(
00090             /* [in] */ IDataObject __RPC_FAR *pdo,
00091             /* [in] */ VARIANT __RPC_FAR *arg,
00092             /* [in] */ VARIANT __RPC_FAR *param);
00093
00094             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumTasks(
00095             /* [in] */ IDataObject __RPC_FAR *pdo,
00096             /* [string][in] */ LPOLESTR szTaskGroup,
00097             /* [out] */ IEnumTASK __RPC_FAR *__RPC_FAR *ppEnumTASK);
00098
00099             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTitle(
00100             /* [string][in] */ LPOLESTR pszGroup,
00101             /* [string][out] */ LPOLESTR __RPC_FAR *pszTitle);
00102
00103             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDescriptiveText(
00104             /* [string][in] */ LPOLESTR pszGroup,
00105             /* [string][out] */ LPOLESTR __RPC_FAR *pszDescriptiveText);
00106
00107             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetBackground(
00108             /* [string][in] */ LPOLESTR pszGroup,
00109             /* [out] */ MMC_TASK_DISPLAY_OBJECT __RPC_FAR *pTDO);
00110
00111             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetListPadInfo(
00112             /* [string][in] */ LPOLESTR pszGroup,
00113             /* [out] */ MMC_LISTPAD_INFO __RPC_FAR *lpListPadInfo);
00114
00115     private:
00116         LPOLESTR OleDuplicateString(LPOLESTR lpStr) {
00117             LPOLESTR tmp = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(lpStr) + 1)  * sizeof(WCHAR)));
00118             wcscpy(tmp, lpStr);
00119
00120             return tmp;
00121         }
00122 };
00123
00124 #endif _SAMPCOMP_H_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share Sample/ClRes.h Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share Sample

ClRes.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ClRes.h
00007 //
00008 //  Implementation File:
00009 //      ClRes.cpp
00010 //
00011 //  Description:
00012 //      Main header file for the resource DLL for File Share Sample (File Share Sample).
00013 //
00014 //  Author:
00015 //      <name> (<e-mail name>) Mmmm DD, 2003
00016 //
00017 //  Revision History:
00018 //
00019 //  Notes:
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #pragma once
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Include Files
00027 /////////////////////////////////////////////////////////////////////////////
00028
00029 #define UNICODE 1
00030 #define _UNICODE 1
00031 #ifndef _WIN32_WINNT
00032 #define _WIN32_WINNT 0x0502
00033 #endif
00034
00035 #pragma warning( disable : 4127 )   // conditional expression is constant (BEGIN_COM_MAP)
00036 #pragma warning( disable : 4505 )   // unreferenced local function has been removed
00037 #pragma warning( disable : 4511 )   // copy constructor could not be generated
00038 #pragma warning( disable : 4514 )   // unreferenced inline function has been removed
00039 #pragma warning( disable : 4710 )   // function not expanded / function '<x>' not inlined
00040
00041 #pragma warning( push )
00042 #include <windows.h>
00043 #include <clusapi.h>
00044 #include <resapi.h>
00045 #include <stdio.h>
00046 #include <strsafe.h>
00047 #include <assert.h>
00048 #pragma warning( pop )
00049
00050 #include "StringUtils.h"
00051
00052 /////////////////////////////////////////////////////////////////////////////
00053 // File Share Sample Definitions
00054 /////////////////////////////////////////////////////////////////////////////
00055
00056 //
00057 // This is the name of the cluster resource type.
00058 //
00059
00060 #define RESTYPE_NAME        L"File Share Sample"
00061
00062 //
00063 // This is the dll name.
00064 //
00065
00066 #define RESTYPE_DLL_NAME    L"File Share Sample.dll"
00067
00068 //
00069 // This is the name of the service we're dependent upon.
00070 //
00071
00072 #define FILESHARESAMPLE_SVCNAME   L"LanmanServer"
00073
00074 BOOL WINAPI FileShareSampleDllMain(
00075       HINSTANCE hDllHandleIn
00076     , DWORD     nReasonIn
00077     , LPVOID    ReservedIn
00078     );
00079
00080 DWORD WINAPI FileShareSampleStartup(
00081       LPCWSTR                       pwszResourceTypeIn
00082     , DWORD                         nMinVersionSupportedIn
00083     , DWORD                         nMaxVersionSupportedIn
00084     , PSET_RESOURCE_STATUS_ROUTINE  pfnSetResourceStatusIn
00085     , PLOG_EVENT_ROUTINE            pfnLogEventIn
00086     , PCLRES_FUNCTION_TABLE *       pFunctionTableOut
00087     );
00088
00089 /////////////////////////////////////////////////////////////////////////////
00090 // General Definitions
00091 /////////////////////////////////////////////////////////////////////////////
00092
00093 #define DBG_PRINT printf
00094
00095 /////////////////////////////////////////////////////////////////////////////
00096 // Global Variables and Prototypes
00097 /////////////////////////////////////////////////////////////////////////////
00098
00099 extern HINSTANCE g_hInstance;
00100
00101 //
00102 // Event Logging routine.
00103 //
00104
00105 extern PLOG_EVENT_ROUTINE g_pfnLogEvent;
00106
00107 //
00108 // Resource Status routine for pending Online and Offline calls.
00109 //
00110
00111 extern PSET_RESOURCE_STATUS_ROUTINE g_pfnSetResourceStatus;
00112
00113
00114 /////////////////////////////////////////////////////////////////////////////
00115 // Macro Definitions
00116 /////////////////////////////////////////////////////////////////////////////
00117
00118 #ifndef RTL_NUMBER_OF
00119 #define RTL_NUMBER_OF(A) (sizeof(A)/sizeof((A)[0]))
00120 #endif
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CIdentitySub Member List

This is the complete list of members for CIdentitySub, including all inherited members.
CIdentitySub(CComSpy *pSpy) | CIdentitySub | [inline]
CIdentitySub() | CIdentitySub | [inline]
CSysLCESub() | CSysLCESub | [inline]
GetEventClass(LPGUID guid) | CIdentitySub | [inline, virtual]
GetEventType(EventEnum *e) | CIdentitySub | [inline, virtual]
GetInterface(IID *iid) | CIdentitySub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
OnIISRequestInfo(COMSVCSEVENTINFO *pInfo, ULONG64 ObjId, LPCOLESTR pszClientIP, LPCOLESTR pszServerIP, LPCOLESTR pszURL) | CIdentitySub | [inline]
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:56:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/MTXSample/resource.h Source File

  • Web
  • iis
  • Components
  • Cpp
  • MTXSample

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by BankVC.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_ACCOUNT                     101
00007 #define IDR_CREATETABLE                 102
00008 #define IDR_MOVEMONEY                   103
00009
00010 // Next default values for new objects
00011 //
00012 #ifdef APSTUDIO_INVOKED
00013 #ifndef APSTUDIO_READONLY_SYMBOLS
00014 #define _APS_NEXT_RESOURCE_VALUE        201
00015 #define _APS_NEXT_COMMAND_VALUE         32768
00016 #define _APS_NEXT_CONTROL_VALUE         201
00017 #define _APS_NEXT_SYMED_VALUE           104
00018 #endif
00019 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/about.h Source File

  • SysMgmt
  • MMC
  • Openserv

about.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPABOUT_H_
00020 #define _SAMPABOUT_H_
00021
00022 #include <tchar.h>
00023 #include <mmc.h>
00024
00025 class CSnapinAbout : public ISnapinAbout
00026 {
00027 private:
00028     ULONG       m_cref;
00029     HBITMAP       m_hSmallImage;
00030     HBITMAP       m_hLargeImage;
00031     HBITMAP       m_hSmallImageOpen;
00032     HICON       m_hAppIcon;
00033
00034 public:
00035     CSnapinAbout();
00036     ~CSnapinAbout();
00037
00038     ///////////////////////////////
00039     // Interface IUnknown
00040     ///////////////////////////////
00041     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042     STDMETHODIMP_(ULONG) AddRef();
00043     STDMETHODIMP_(ULONG) Release();
00044
00045     ///////////////////////////////
00046     // Interface ISnapinAbout
00047     ///////////////////////////////
00048     STDMETHODIMP GetSnapinDescription(
00049         /* [out] */ LPOLESTR *lpDescription);
00050
00051         STDMETHODIMP GetProvider(
00052         /* [out] */ LPOLESTR *lpName);
00053
00054         STDMETHODIMP GetSnapinVersion(
00055         /* [out] */ LPOLESTR *lpVersion);
00056
00057         STDMETHODIMP GetSnapinImage(
00058         /* [out] */ HICON *hAppIcon);
00059
00060         STDMETHODIMP GetStaticFolderImage(
00061         /* [out] */ HBITMAP *hSmallImage,
00062         /* [out] */ HBITMAP *hSmallImageOpen,
00063         /* [out] */ HBITMAP *hLargeImage,
00064         /* [out] */ COLORREF *cMask);
00065
00066         ///////////////////////////////
00067         // Private Interface
00068         ///////////////////////////////
00069 private:
00070     HRESULT CSnapinAbout::AllocOleStr(
00071         LPOLESTR *lpDest,
00072         _TCHAR *szBuffer);
00073 };
00074
00075 #endif _SAMPABOUT_H_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/BPSamp/DbgCmd.c Source File

  • WinBase
  • Debug
  • BPSamp

DbgCmd.c

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004    TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE
00006
00007    Copyright (C) 1999 - 2000. Microsoft Corporation. All rights reserved.
00008
00009    dbgcmd.c
00010
00011      Contains a simple debugger command parser.
00012      This debugger only supports setting one code breakpoint and
00013      one data watchpoint.  The code is simplified to demonstrate
00014      how to set these type of breakpoint, not be a general purpose
00015      debugger. Use the Windows 2000 debugger tools (NTSD or CDB) for
00016      you debugging needs.
00017
00018 ----------------------------------------------------------------------------*/
00019 #include <windows.h>
00020 #include <stdio.h>
00021 #include <conio.h>
00022 #include "bpsamp.h"
00023
00024
00025
00026 #define BPITEM_WATCHPOINT 1
00027 #define BPITEM_BREAKPOINT 2
00028 typedef struct {
00029    DWORD dwAddress;   // address to set breakpoint at
00030    DWORD dwBPType;    // which breakpoint to clear
00031 } CMD_ARGS, *PCMD_ARGS;
00032
00033 static CMD_ARGS cmd_args;
00034
00035 #define DBGCMD_UNKNOWN      -1
00036 #define DBGCMD_QUIT         1
00037 #define DBGCMD_GO           2
00038 #define DBGCMD_WATCHPOINT   3
00039 #define DBGCMD_BREAKPOINT   4
00040 #define DBGCMD_CLEARBP      5
00041 #define DBGCMD_SHOWHELP     6
00042
00043 BOOL g_fInDbgCmd = FALSE;  // so that we don't create multiple
00044                            // debugger threads
00045 BOOL g_fAtCodeBreakpoint = FALSE;
00046 DWORD g_dwCurrentThreadID = 0;
00047
00048 DWORD parse_command(char *szCmd, PCMD_ARGS pcmd_args);
00049 char szCmd[0x1000];
00050
00051 /*---------------------------------------------------------------------------
00052    do_debug_command
00053
00054   TRUE - means exit the debugger (this program)
00055   FALSE - continue executing program after executing the command
00056
00057   This return interprets the command typed in by the user at the command
00058   prompt (obtained by the gets function call) and executes the command.
00059   The text input is parsed by parse_command and then interpreted by the
00060   switch statement in this routine.
00061
00062   DBGCMD_QUIT          -- quits the debugger
00063   DBGCMD_GO            -- continues executing the debuggee
00064   DBGCMD_WATCHPOINT    -- sets a watchpoint (data access breakpoint)
00065   DBGCMD_BREAKPOINT    -- sets a code breakpoint
00066   DBGCMD_CLEARBP       -- clears a breakpoint
00067   DBGCMD_SHOWHELP      -- displays user help
00068
00069 ---------------------------------------------------------------------------*/
00070
00071 BOOL do_debug_command(void)
00072 {
00073    DWORD dwCmd;
00074
00075
00076
00077    while (TRUE)
00078    {
00079       printf("dbg>");
00080       if (!fgets(szCmd, sizeof(szCmd), stdin))
00081       {
00082           // unable to read input, quit
00083           g_fInDbgCmd = FALSE;
00084           return TRUE;
00085       }
00086
00087       dwCmd = parse_command(szCmd, &cmd_args);
00088
00089       switch(dwCmd)
00090       {
00091       case DBGCMD_QUIT:
00092          g_fInDbgCmd = FALSE;
00093          return TRUE;  // means quit debugger
00094          break;
00095
00096       case DBGCMD_WATCHPOINT:
00097          set_databreakpoint(cmd_args.dwAddress);
00098          break;
00099
00100       case DBGCMD_BREAKPOINT:
00101          set_codebreakpoint(cmd_args.dwAddress);
00102          break;
00103
00104       case DBGCMD_CLEARBP:
00105
00106          if (cmd_args.dwBPType == BPITEM_WATCHPOINT)
00107             clear_databreakpoint();
00108
00109          if (cmd_args.dwBPType == BPITEM_BREAKPOINT)
00110             clear_codebreakpoint();
00111
00112          break;
00113
00114       case DBGCMD_GO:
00115
00116          // in order to continue from a code breakpoint
00117          // we must clear the breakpoint (restore the
00118          // original opcode) before continuing.
00119
00120          // an implementation of "sticky breakpoints"
00121          // is much more complex.
00122
00123          if (g_fAtCodeBreakpoint)
00124          {
00125
00126             clear_codebreakpoint();
00127             set_thread_eip_back(g_dwCurrentThreadID);
00128          }
00129
00130          g_fInDbgCmd = FALSE;
00131          return FALSE; // means do not quit debugger
00132          break;
00133
00134       case DBGCMD_SHOWHELP:
00135          display_help();
00136          break;
00137       case DBGCMD_UNKNOWN:
00138          printf("unknown command\n");
00139          break;
00140
00141       default:
00142          printf("do_debug_command: should never get here\n");
00143          break;
00144
00145       }
00146
00147    }
00148
00149    g_fInDbgCmd = FALSE;
00150    return FALSE;  // should not get here
00151
00152 }
00153
00154
00155
00156 /*---------------------------------------------------------------------------
00157    parse_command
00158
00159   szCmd -- text command typed in by the user at the command prompt
00160   pcmd_args -- packet of arguments interpreted
00161
00162   Returns a code that indicates why type of command was added.
00163   See comments for do_debug_command.
00164
00165   The following commands are supported
00166   ?         displays help
00167   b <addr>  sets a code breakpoint
00168   cb        clears the code breakpoint
00169   cw        clears the data watchpoint
00170   g         continues debuggee execution
00171   q         quits the debugger program
00172   w <addr>  sets the data watchpoint
00173 ---------------------------------------------------------------------------*/
00174
00175 DWORD parse_command(char *szCmd, PCMD_ARGS pcmd_args)
00176 {
00177    char *ptr;
00178
00179    // swallow any leading spaces
00180    ptr = szCmd;
00181    while (' ' == *ptr)
00182       ptr++;
00183
00184    // we found the go command
00185    if (('g' == *ptr) || ('G' == *ptr))
00186       return DBGCMD_GO;
00187
00188    // quit command
00189    if (('q' == *ptr) || ('Q' == *ptr))
00190       return DBGCMD_QUIT;
00191
00192    // set watchpoint
00193    // w XXXXXXXX address
00194    if (('w' == *ptr) || ('W' == *ptr))
00195    {
00196       char *stopstring;
00197
00198       ptr++;
00199       pcmd_args->dwAddress = strtoul( ptr, &stopstring, 16 );
00200
00201       if (pcmd_args->dwAddress == 0)
00202       {
00203          printf("cannot set watchpoint at address 0\n");
00204          return DBGCMD_UNKNOWN;
00205       }
00206
00207
00208       return DBGCMD_WATCHPOINT;
00209    }
00210
00211    // set breakpoint
00212    // b XXXXXXXX address
00213    if (('b' == *ptr) || ('B' == *ptr))
00214    {
00215       char *stopstring;   // for strtoul
00216
00217       ptr++;
00218       pcmd_args->dwAddress = strtoul( ptr, &stopstring, 16 );
00219
00220       if (pcmd_args->dwAddress == 0)
00221       {
00222          printf("cannot set watchpoint at address 0\n");
00223          return DBGCMD_UNKNOWN;
00224       }
00225
00226
00227       return DBGCMD_BREAKPOINT;
00228    }
00229
00230    // clear breakpoints
00231    // either cw or cb
00232    if (('c' == *ptr) || ('C' == *ptr))
00233    {
00234       ptr++;
00235       if (('w' == *ptr) || ('W' == *ptr))
00236       {
00237          pcmd_args->dwBPType = BPITEM_WATCHPOINT;
00238          return DBGCMD_CLEARBP;
00239       }
00240
00241       if (('b' == *ptr) || ('B' == *ptr))
00242       {
00243          pcmd_args->dwBPType = BPITEM_BREAKPOINT;
00244          return DBGCMD_CLEARBP;
00245       }
00246
00247
00248       return DBGCMD_UNKNOWN;
00249    }
00250
00251    // for displaying help
00252    if ('?' == *ptr)
00253    {
00254       return DBGCMD_SHOWHELP;
00255    }
00256
00257
00258    return DBGCMD_UNKNOWN;
00259
00260 }
00261
00262 /*---------------------------------------------------------------------------
00263    display_help
00264
00265
00266   Displays help information.
00267 ---------------------------------------------------------------------------*/
00268
00269 void display_help(void)
00270 {
00271    printf("b <addr>        sets a breakpoint in code at addr\n");
00272    printf("w <addr>        sets a data watchpoint at addr\n");
00273    printf("cb              clears the code breakpoint\n");
00274    printf("cw              clears the data watchpoint\n");
00275    printf("g               go\n");
00276    printf("q               quits the debugger\n");
00277    printf("?               displays this help\n");
00278
00279    printf("\n\n");
00280    printf("To break into the running debuggee, press Ctrl+C\n");
00281    printf("\n");
00282 }
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerText/Server.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerText

Server.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.H
00003
00004   Summary:   Internal include file for the PERTEXT.DLL server code sample.
00005              Contains class declarations, resource IDs and string macros
00006              for internal use in constructing this DLL as a COM component
00007              server.  Declares the CServer server control object class.
00008              The CThreaded OwnThis mechanism is used to ensure mutually
00009              exclusive access to this CServer object by multiple threads.
00010
00011              For a comprehensive tutorial code tour of this module's
00012              contents and offerings see the tutorial PERTEXT.HTM
00013              file. For more specific technical details on the internal
00014              workings see the comments dispersed throughout the module's
00015              source code.
00016
00017   Classes:   CServer.
00018
00019   Functions: .
00020
00021   Origin:    5-20-97: atrent - Editor-inheritance from SERVER.H in
00022                the DLLSERVE Tutorial Code Sample.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039
00040 #if !defined(SERVER_H)
00041 #define SERVER_H
00042
00043
00044 #ifdef __cplusplus
00045
00046 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00047   Class:    CServer
00048
00049   Summary:  Class to encapsulate control of this COM server (eg, handle
00050             Lock and Object counting, encapsulate otherwise global data).
00051
00052   Methods:  none
00053 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00054 class CServer : public CThreaded
00055 {
00056   public:
00057     CServer(void);
00058     ~CServer(void);
00059
00060     // Methods for server lifetime control: object counts and lock counts.
00061     void Lock(void);
00062     void Unlock(void);
00063     void ObjectsUp(void);
00064     void ObjectsDown(void);
00065     HRESULT CanUnloadNow(void);
00066
00067     // A place to store the handle to loaded instance of this DLL module.
00068     HINSTANCE m_hDllInst;
00069
00070     // A place to store a client's parent window.
00071     HWND m_hWndParent;
00072
00073     // Global DLL Server living Object count.
00074     LONG m_cObjects;
00075
00076     // Global DLL Server Client Lock count.
00077     LONG m_cLocks;
00078 };
00079
00080 #endif // __cplusplus
00081
00082 // Allow other internal PERTEXT modules to get at the globals.
00083 extern CServer* g_pServer;
00084
00085
00086 #endif // SERVER_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SSL/WebClient/WebClient.c Source File

  • Security
  • SSPI
  • SSL
  • WebClient

WebClient.c

Go to the documentation of this file.
00001 /*++
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1999 - 2000 Microsoft Corporation.  All rights reserved.
00009
00010 Module Name:
00011
00012     webclient.c
00013
00014 Abstract:
00015
00016     Schannel web client sample application.
00017
00018
00019 --*/
00020
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <windows.h>
00024 #include <winsock.h>
00025 #include <wincrypt.h>
00026 #include <wintrust.h>
00027 #include <schannel.h>
00028
00029 #define SECURITY_WIN32
00030 #include <security.h>
00031 #include <sspi.h>
00032
00033 #define IO_BUFFER_SIZE  0x10000
00034
00035 #define DLL_NAME TEXT("Secur32.dll")
00036 #define NT4_DLL_NAME TEXT("Security.dll")
00037
00038 LPSTR   pszProxyServer  = "proxy";
00039 INT     iProxyPort      = 80;
00040
00041 // User options.
00042 LPSTR   pszServerName   = NULL;
00043 INT     iPortNumber     = 443;
00044 LPSTR   pszFileName     = "default.htm";
00045 BOOL    fVerbose        = FALSE;
00046 BOOL    fUseProxy       = FALSE;
00047 LPSTR   pszUserName     = NULL;
00048 DWORD   dwProtocol      = 0;
00049 ALG_ID  aiKeyExch       = 0;
00050
00051 HCERTSTORE      hMyCertStore = NULL;
00052 SCHANNEL_CRED   SchannelCred;
00053
00054 HMODULE g_hSecurity = NULL;
00055
00056 PSecurityFunctionTable g_pSSPI;
00057
00058 static
00059 SECURITY_STATUS
00060 CreateCredentials(
00061     LPSTR pszUserName,
00062     PCredHandle phCreds);
00063
00064 static INT
00065 ConnectToServer(
00066     LPSTR pszServerName,
00067     INT   iPortNumber,
00068     SOCKET *pSocket);
00069
00070 static
00071 SECURITY_STATUS
00072 PerformClientHandshake(
00073     SOCKET          Socket,
00074     PCredHandle     phCreds,
00075     LPSTR           pszServerName,
00076     CtxtHandle *    phContext,
00077     SecBuffer *     pExtraData);
00078
00079 static
00080 SECURITY_STATUS
00081 ClientHandshakeLoop(
00082     SOCKET          Socket,
00083     PCredHandle     phCreds,
00084     CtxtHandle *    phContext,
00085     BOOL            fDoInitialRead,
00086     SecBuffer *     pExtraData);
00087
00088 static
00089 SECURITY_STATUS
00090 HttpsGetFile(
00091     SOCKET          Socket,
00092     PCredHandle     phCreds,
00093     CtxtHandle *    phContext,
00094     LPSTR           pszFileName);
00095
00096 static
00097 void
00098 DisplayCertChain(
00099     PCCERT_CONTEXT  pServerCert,
00100     BOOL            fLocal);
00101
00102 static
00103 DWORD
00104 VerifyServerCertificate(
00105     PCCERT_CONTEXT  pServerCert,
00106     PSTR            pszServerName,
00107     DWORD           dwCertFlags);
00108
00109 static void
00110 WriteDataToFile(
00111     PSTR  pszFilename,
00112     PBYTE pbData,
00113     DWORD cbData);
00114
00115 static
00116 LONG
00117 DisconnectFromServer(
00118     SOCKET          Socket,
00119     PCredHandle     phCreds,
00120     CtxtHandle *    phContext);
00121
00122 static void
00123 DisplayConnectionInfo(
00124     CtxtHandle *phContext);
00125
00126 static void
00127 GetNewClientCredentials(
00128     CredHandle *phCreds,
00129     CtxtHandle *phContext);
00130
00131 static void PrintHexDump(DWORD length, PBYTE buffer);
00132
00133
00134 /*****************************************************************************/
00135 void Usage(void)
00136 {
00137     printf("\n");
00138     printf("USAGE: webclient -s<server> [ <options> ]\n");
00139     printf("\n");
00140     printf("    -s<server>      DNS name of server.\n");
00141     printf("    -p<port>        Port that server is listing on (default 443).\n");
00142     printf("    -f<file>        Name of file to retrieve (default \"%s\")\n", pszFileName);
00143     printf("    -v              Verbose Mode.\n");
00144     printf("    -x              Connect via the \"%s\" proxy server.\n", pszProxyServer);
00145     printf("\n");
00146     printf("    -P<protocol>    Protocol to use\n");
00147     printf("                        1 = PCT 1.0         3 = SSL 3.0\n");
00148     printf("                        2 = SSL 2.0         4 = TLS 1.0\n");
00149     printf("\n");
00150     printf("    -E<alg>         Key exchange algorithm to use\n");
00151     printf("                        1 = RSA             2 = DH\n");
00152     printf("\n");
00153     printf("  For client auth\n");
00154     printf("    -u<user>        Name of user (in existing client certificate)\n");
00155 }
00156
00157
00158 /*****************************************************************************/
00159 BOOL
00160 LoadSecurityLibrary(void)
00161 {
00162     INIT_SECURITY_INTERFACE         pInitSecurityInterface;
00163     QUERY_CREDENTIALS_ATTRIBUTES_FN pQueryCredentialsAttributes;
00164     OSVERSIONINFO VerInfo;
00165     UCHAR lpszDLL[MAX_PATH];
00166
00167     //
00168     //  Find out which security DLL to use, depending on
00169     //  whether we are on Win2K, NT or Win9x
00170     //
00171
00172     VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
00173     if (!GetVersionEx (&VerInfo))
00174     {
00175         return FALSE;
00176     }
00177
00178     if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT
00179         && VerInfo.dwMajorVersion == 4)
00180     {
00181         strcpy (lpszDLL, NT4_DLL_NAME );
00182     }
00183     else if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ||
00184           VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
00185     {
00186         strcpy (lpszDLL, DLL_NAME );
00187     }
00188     else
00189     {
00190         return FALSE;
00191     }
00192
00193     //
00194     //  Load Security DLL
00195     //
00196
00197     g_hSecurity = LoadLibrary(lpszDLL);
00198     if(g_hSecurity == NULL)
00199     {
00200         printf("Error 0x%x loading %s.\n", GetLastError(), lpszDLL);
00201         return FALSE;
00202     }
00203
00204     pInitSecurityInterface = (INIT_SECURITY_INTERFACE)GetProcAddress(
00205                                     g_hSecurity,
00206                                     "InitSecurityInterfaceA");
00207
00208     if(pInitSecurityInterface == NULL)
00209     {
00210         printf("Error 0x%x reading InitSecurityInterface entry point.\n",
00211                GetLastError());
00212         return FALSE;
00213     }
00214
00215     g_pSSPI = pInitSecurityInterface();
00216
00217     if(g_pSSPI == NULL)
00218     {
00219         printf("Error 0x%x reading security interface.\n",
00220                GetLastError());
00221         return FALSE;
00222     }
00223
00224     return TRUE;
00225 }
00226
00227 /*****************************************************************************/
00228 void
00229 UnloadSecurityLibrary(void)
00230 {
00231     FreeLibrary(g_hSecurity);
00232     g_hSecurity = NULL;
00233 }
00234
00235
00236 /*****************************************************************************/
00237 void _cdecl main(int argc, char *argv[])
00238 {
00239     WSADATA WsaData;
00240     SOCKET  Socket = INVALID_SOCKET;
00241
00242     CredHandle hClientCreds;
00243     CtxtHandle hContext;
00244     BOOL fCredsInitialized = FALSE;
00245     BOOL fContextInitialized = FALSE;
00246
00247     SecBuffer  ExtraData;
00248     SECURITY_STATUS Status;
00249
00250     PCCERT_CONTEXT pRemoteCertContext = NULL;
00251
00252     INT i;
00253     INT iOption;
00254     PCHAR pszOption;
00255
00256     //
00257     // Parse the command line.
00258     //
00259
00260     if(argc <= 1)
00261     {
00262         Usage();
00263         return;
00264     }
00265
00266     for(i = 1; i < argc; i++)
00267     {
00268         if(argv[i][0] == '/') argv[i][0] = '-';
00269
00270         if(argv[i][0] != '-')
00271         {
00272             printf("**** Invalid argument \"%s\"\n", argv[i]);
00273             Usage();
00274             return;
00275         }
00276
00277         iOption = argv[i][1];
00278         pszOption = &argv[i][2];
00279
00280         switch(iOption)
00281         {
00282         case 's':
00283             pszServerName = pszOption;
00284             break;
00285
00286         case 'p':
00287             iPortNumber = atoi(pszOption);
00288             break;
00289
00290         case 'f':
00291             pszFileName = pszOption;
00292             break;
00293
00294         case 'v':
00295             fVerbose = TRUE;
00296             break;
00297
00298         case 'x':
00299             fUseProxy = TRUE;
00300             break;
00301
00302         case 'u':
00303             pszUserName = pszOption;
00304             break;
00305
00306         case 'P':
00307             switch(atoi(pszOption))
00308             {
00309                 case 1:
00310                     dwProtocol = SP_PROT_PCT1;
00311                     break;
00312                 case 2:
00313                     dwProtocol = SP_PROT_SSL2;
00314                     break;
00315                 case 3:
00316                     dwProtocol = SP_PROT_SSL3;
00317                     break;
00318                 case 4:
00319                     dwProtocol = SP_PROT_TLS1;
00320                     break;
00321                 default:
00322                     dwProtocol = 0;
00323                     break;
00324             }
00325             break;
00326
00327         case 'E':
00328             switch(atoi(pszOption))
00329             {
00330                 case 1:
00331                     aiKeyExch = CALG_RSA_KEYX;
00332                     break;
00333                 case 2:
00334                     aiKeyExch = CALG_DH_EPHEM;
00335                     break;
00336                 default:
00337                     aiKeyExch = 0;
00338                     break;
00339             }
00340             break;
00341
00342         default:
00343             printf("**** Invalid option \"%s\"\n", argv[i]);
00344             Usage();
00345             return;
00346         }
00347     }
00348
00349
00350     if(!LoadSecurityLibrary())
00351     {
00352         printf("Error initializing the security library\n");
00353         goto cleanup;
00354     }
00355
00356     //
00357     // Initialize the WinSock subsystem.
00358     //
00359
00360     if(WSAStartup(0x0101, &WsaData) == SOCKET_ERROR)
00361     {
00362         printf("Error %d returned by WSAStartup\n", GetLastError());
00363         goto cleanup;
00364     }
00365
00366     //
00367     // Create credentials.
00368     //
00369
00370     if(CreateCredentials(pszUserName, &hClientCreds))
00371     {
00372         printf("Error creating credentials\n");
00373         goto cleanup;
00374     }
00375     fCredsInitialized = TRUE;
00376
00377
00378     //
00379     // Connect to server.
00380     //
00381
00382     if(ConnectToServer(pszServerName, iPortNumber, &Socket))
00383     {
00384         printf("Error connecting to server\n");
00385         goto cleanup;
00386     }
00387
00388
00389     //
00390     // Perform handshake
00391     //
00392
00393     if(PerformClientHandshake(Socket,
00394                               &hClientCreds,
00395                               pszServerName,
00396                               &hContext,
00397                               &ExtraData))
00398     {
00399         printf("Error performing handshake\n");
00400         goto cleanup;
00401     }
00402     fContextInitialized = TRUE;
00403
00404
00405     //
00406     // Authenticate server's credentials.
00407     //
00408
00409     // Get server's certificate.
00410     Status = g_pSSPI->QueryContextAttributes(&hContext,
00411                                              SECPKG_ATTR_REMOTE_CERT_CONTEXT,
00412                                              (PVOID)&pRemoteCertContext);
00413     if(Status != SEC_E_OK)
00414     {
00415         printf("Error 0x%x querying remote certificate\n", Status);
00416         goto cleanup;
00417     }
00418
00419     // Display server certificate chain.
00420     DisplayCertChain(pRemoteCertContext, FALSE);
00421
00422     // Attempt to validate server certificate.
00423     Status = VerifyServerCertificate(pRemoteCertContext,
00424                                      pszServerName,
00425                                      0);
00426     if(Status)
00427     {
00428         // The server certificate did not validate correctly. At this
00429         // point, we cannot tell if we are connecting to the correct
00430         // server, or if we are connecting to a "man in the middle"
00431         // attack server.
00432
00433         // It is therefore best if we abort the connection.
00434
00435         printf("**** Error 0x%x authenticating server credentials!\n", Status);
00436 //        goto cleanup;
00437     }
00438
00439     // Free the server certificate context.
00440     CertFreeCertificateContext(pRemoteCertContext);
00441     pRemoteCertContext = NULL;
00442
00443
00444     //
00445     // Display connection info.
00446     //
00447
00448     DisplayConnectionInfo(&hContext);
00449
00450
00451     //
00452     // Read file from server.
00453     //
00454
00455     if(HttpsGetFile(Socket,
00456                     &hClientCreds,
00457                     &hContext,
00458                     pszFileName))
00459     {
00460         printf("Error fetching file from server\n");
00461         goto cleanup;
00462     }
00463
00464     //
00465     // Send a close_notify alert to the server and
00466     // close down the connection.
00467     //
00468
00469     if(DisconnectFromServer(Socket, &hClientCreds, &hContext))
00470     {
00471         printf("Error disconnecting from server\n");
00472         goto cleanup;
00473     }
00474     fContextInitialized = FALSE;
00475     Socket = INVALID_SOCKET;
00476
00477
00478 cleanup:
00479
00480     // Free the server certificate context.
00481     if(pRemoteCertContext)
00482     {
00483         CertFreeCertificateContext(pRemoteCertContext);
00484         pRemoteCertContext = NULL;
00485     }
00486
00487     // Free SSPI context handle.
00488     if(fContextInitialized)
00489     {
00490         g_pSSPI->DeleteSecurityContext(&hContext);
00491         fContextInitialized = FALSE;
00492     }
00493
00494     // Free SSPI credentials handle.
00495     if(fCredsInitialized)
00496     {
00497         g_pSSPI->FreeCredentialsHandle(&hClientCreds);
00498         fCredsInitialized = FALSE;
00499     }
00500
00501     // Close socket.
00502     if(Socket != INVALID_SOCKET)
00503     {
00504         closesocket(Socket);
00505     }
00506
00507     // Shutdown WinSock subsystem.
00508     WSACleanup();
00509
00510     // Close "MY" certificate store.
00511     if(hMyCertStore)
00512     {
00513         CertCloseStore(hMyCertStore, 0);
00514     }
00515
00516     UnloadSecurityLibrary();
00517
00518     printf("Done\n");
00519 }
00520
00521 /*****************************************************************************/
00522 static
00523 SECURITY_STATUS
00524 CreateCredentials(
00525     LPSTR pszUserName,              // in
00526     PCredHandle phCreds)            // out
00527 {
00528     TimeStamp       tsExpiry;
00529     SECURITY_STATUS Status;
00530
00531     DWORD           cSupportedAlgs = 0;
00532     ALG_ID          rgbSupportedAlgs[16];
00533
00534     PCCERT_CONTEXT  pCertContext = NULL;
00535
00536     // Open the "MY" certificate store, which is where Internet Explorer
00537     // stores its client certificates.
00538     if(hMyCertStore == NULL)
00539     {
00540         hMyCertStore = CertOpenSystemStore(0, "MY");
00541
00542         if(!hMyCertStore)
00543         {
00544             printf("**** Error 0x%x returned by CertOpenSystemStore\n",
00545                 GetLastError());
00546             return SEC_E_NO_CREDENTIALS;
00547         }
00548     }
00549
00550     //
00551     // If a user name is specified, then attempt to find a client
00552     // certificate. Otherwise, just create a NULL credential.
00553     //
00554
00555     if(pszUserName)
00556     {
00557         // Find client certificate. Note that this sample just searchs for a
00558         // certificate that contains the user name somewhere in the subject name.
00559         // A real application should be a bit less casual.
00560         pCertContext = CertFindCertificateInStore(hMyCertStore,
00561                                                   X509_ASN_ENCODING,
00562                                                   0,
00563                                                   CERT_FIND_SUBJECT_STR_A,
00564                                                   pszUserName,
00565                                                   NULL);
00566         if(pCertContext == NULL)
00567         {
00568             printf("**** Error 0x%x returned by CertFindCertificateInStore\n",
00569                 GetLastError());
00570             return SEC_E_NO_CREDENTIALS;
00571         }
00572     }
00573
00574
00575     //
00576     // Build Schannel credential structure. Currently, this sample only
00577     // specifies the protocol to be used (and optionally the certificate,
00578     // of course). Real applications may wish to specify other parameters
00579     // as well.
00580     //
00581
00582     ZeroMemory(&SchannelCred, sizeof(SchannelCred));
00583
00584     SchannelCred.dwVersion  = SCHANNEL_CRED_VERSION;
00585     if(pCertContext)
00586     {
00587         SchannelCred.cCreds     = 1;
00588         SchannelCred.paCred     = &pCertContext;
00589     }
00590
00591     SchannelCred.grbitEnabledProtocols = dwProtocol;
00592
00593     if(aiKeyExch)
00594     {
00595         rgbSupportedAlgs[cSupportedAlgs++] = aiKeyExch;
00596     }
00597
00598     if(cSupportedAlgs)
00599     {
00600         SchannelCred.cSupportedAlgs    = cSupportedAlgs;
00601         SchannelCred.palgSupportedAlgs = rgbSupportedAlgs;
00602     }
00603
00604     SchannelCred.dwFlags |= SCH_CRED_NO_DEFAULT_CREDS;
00605
00606     // The SCH_CRED_MANUAL_CRED_VALIDATION flag is specified because
00607     // this sample verifies the server certificate manually.
00608     // Applications that expect to run on WinNT, Win9x, or WinME
00609     // should specify this flag and also manually verify the server
00610     // certificate. Applications running on newer versions of Windows can
00611     // leave off this flag, in which case the InitializeSecurityContext
00612     // function will validate the server certificate automatically.
00613     SchannelCred.dwFlags |= SCH_CRED_MANUAL_CRED_VALIDATION;
00614
00615     //
00616     // Create an SSPI credential.
00617     //
00618
00619     Status = g_pSSPI->AcquireCredentialsHandleA(
00620                         NULL,                   // Name of principal
00621                         UNISP_NAME_A,           // Name of package
00622                         SECPKG_CRED_OUTBOUND,   // Flags indicating use
00623                         NULL,                   // Pointer to logon ID
00624                         &SchannelCred,          // Package specific data
00625                         NULL,                   // Pointer to GetKey() func
00626                         NULL,                   // Value to pass to GetKey()
00627                         phCreds,                // (out) Cred Handle
00628                         &tsExpiry);             // (out) Lifetime (optional)
00629     if(Status != SEC_E_OK)
00630     {
00631         printf("**** Error 0x%x returned by AcquireCredentialsHandle\n", Status);
00632         goto cleanup;
00633     }
00634
00635 cleanup:
00636
00637     //
00638     // Free the certificate context. Schannel has already made its own copy.
00639     //
00640
00641     if(pCertContext)
00642     {
00643         CertFreeCertificateContext(pCertContext);
00644     }
00645
00646
00647     return Status;
00648 }
00649
00650 /*****************************************************************************/
00651 static INT
00652 ConnectToServer(
00653     LPSTR    pszServerName, // in
00654     INT      iPortNumber,   // in
00655     SOCKET * pSocket)       // out
00656 {
00657     SOCKET Socket;
00658     struct sockaddr_in sin;
00659     struct hostent *hp;
00660
00661     Socket = socket(PF_INET, SOCK_STREAM, 0);
00662     if(Socket == INVALID_SOCKET)
00663     {
00664         printf("**** Error %d creating socket\n", WSAGetLastError());
00665         return WSAGetLastError();
00666     }
00667
00668     if(fUseProxy)
00669     {
00670         sin.sin_family = AF_INET;
00671         sin.sin_port = ntohs((u_short)iProxyPort);
00672
00673         if((hp = gethostbyname(pszProxyServer)) == NULL)
00674         {
00675             printf("**** Error %d returned by gethostbyname\n", WSAGetLastError());
00676             return WSAGetLastError();
00677         }
00678         else
00679         {
00680             memcpy(&sin.sin_addr, hp->h_addr, 4);
00681         }
00682     }
00683     else
00684     {
00685         sin.sin_family = AF_INET;
00686         sin.sin_port = htons((u_short)iPortNumber);
00687
00688         if((hp = gethostbyname(pszServerName)) == NULL)
00689         {
00690             printf("**** Error %d returned by gethostbyname\n", WSAGetLastError());
00691             return WSAGetLastError();
00692         }
00693         else
00694         {
00695             memcpy(&sin.sin_addr, hp->h_addr, 4);
00696         }
00697     }
00698
00699     if(connect(Socket, (struct sockaddr *)&sin, sizeof(sin)) == SOCKET_ERROR)
00700     {
00701         printf("**** Error %d connecting to \"%s\" (%s)\n",
00702             WSAGetLastError(),
00703             pszServerName,
00704             inet_ntoa(sin.sin_addr));
00705         closesocket(Socket);
00706         return WSAGetLastError();
00707     }
00708
00709     if(fUseProxy)
00710     {
00711         BYTE  pbMessage[200];
00712         DWORD cbMessage;
00713
00714         // Build message for proxy server
00715         strcpy(pbMessage, "CONNECT ");
00716         strcat(pbMessage, pszServerName);
00717         strcat(pbMessage, ":");
00718         _itoa(iPortNumber, pbMessage + strlen(pbMessage), 10);
00719         strcat(pbMessage, " HTTP/1.0\r\nUser-Agent: webclient\r\n\r\n");
00720         cbMessage = (DWORD)strlen(pbMessage);
00721
00722         // Send message to proxy server
00723         if(send(Socket, pbMessage, cbMessage, 0) == SOCKET_ERROR)
00724         {
00725             printf("**** Error %d sending message to proxy!\n", WSAGetLastError());
00726             return WSAGetLastError();
00727         }
00728
00729         // Receive message from proxy server
00730         cbMessage = recv(Socket, pbMessage, 200, 0);
00731         if(cbMessage == SOCKET_ERROR)
00732         {
00733             printf("**** Error %d receiving message from proxy\n", WSAGetLastError());
00734             return WSAGetLastError();
00735         }
00736
00737         // this sample is limited but in normal use it
00738         // should continue to receive until CR LF CR LF is received
00739     }
00740
00741     *pSocket = Socket;
00742
00743     return SEC_E_OK;
00744 }
00745
00746 /*****************************************************************************/
00747 static
00748 LONG
00749 DisconnectFromServer(
00750     SOCKET          Socket,
00751     PCredHandle     phCreds,
00752     CtxtHandle *    phContext)
00753 {
00754     DWORD           dwType;
00755     PBYTE           pbMessage;
00756     DWORD           cbMessage;
00757     DWORD           cbData;
00758
00759     SecBufferDesc   OutBuffer;
00760     SecBuffer       OutBuffers[1];
00761     DWORD           dwSSPIFlags;
00762     DWORD           dwSSPIOutFlags;
00763     TimeStamp       tsExpiry;
00764     DWORD           Status;
00765
00766     //
00767     // Notify schannel that we are about to close the connection.
00768     //
00769
00770     dwType = SCHANNEL_SHUTDOWN;
00771
00772     OutBuffers[0].pvBuffer   = &dwType;
00773     OutBuffers[0].BufferType = SECBUFFER_TOKEN;
00774     OutBuffers[0].cbBuffer   = sizeof(dwType);
00775
00776     OutBuffer.cBuffers  = 1;
00777     OutBuffer.pBuffers  = OutBuffers;
00778     OutBuffer.ulVersion = SECBUFFER_VERSION;
00779
00780     Status = g_pSSPI->ApplyControlToken(phContext, &OutBuffer);
00781
00782     if(FAILED(Status))
00783     {
00784         printf("**** Error 0x%x returned by ApplyControlToken\n", Status);
00785         goto cleanup;
00786     }
00787
00788     //
00789     // Build an SSL close notify message.
00790     //
00791
00792     dwSSPIFlags = ISC_REQ_SEQUENCE_DETECT   |
00793                   ISC_REQ_REPLAY_DETECT     |
00794                   ISC_REQ_CONFIDENTIALITY   |
00795                   ISC_RET_EXTENDED_ERROR    |
00796                   ISC_REQ_ALLOCATE_MEMORY   |
00797                   ISC_REQ_STREAM;
00798
00799     OutBuffers[0].pvBuffer   = NULL;
00800     OutBuffers[0].BufferType = SECBUFFER_TOKEN;
00801     OutBuffers[0].cbBuffer   = 0;
00802
00803     OutBuffer.cBuffers  = 1;
00804     OutBuffer.pBuffers  = OutBuffers;
00805     OutBuffer.ulVersion = SECBUFFER_VERSION;
00806
00807     Status = g_pSSPI->InitializeSecurityContextA(
00808                     phCreds,
00809                     phContext,
00810                     NULL,
00811                     dwSSPIFlags,
00812                     0,
00813                     SECURITY_NATIVE_DREP,
00814                     NULL,
00815                     0,
00816                     phContext,
00817                     &OutBuffer,
00818                     &dwSSPIOutFlags,
00819                     &tsExpiry);
00820
00821     if(FAILED(Status))
00822     {
00823         printf("**** Error 0x%x returned by InitializeSecurityContext\n", Status);
00824         goto cleanup;
00825     }
00826
00827     pbMessage = OutBuffers[0].pvBuffer;
00828     cbMessage = OutBuffers[0].cbBuffer;
00829
00830
00831     //
00832     // Send the close notify message to the server.
00833     //
00834
00835     if(pbMessage != NULL && cbMessage != 0)
00836     {
00837         cbData = send(Socket, pbMessage, cbMessage, 0);
00838         if(cbData == SOCKET_ERROR || cbData == 0)
00839         {
00840             Status = WSAGetLastError();
00841             printf("**** Error %d sending close notify\n", Status);
00842             goto cleanup;
00843         }
00844
00845         printf("Sending Close Notify\n");
00846         printf("%d bytes of handshake data sent\n", cbData);
00847
00848         if(fVerbose)
00849         {
00850             PrintHexDump(cbData, pbMessage);
00851             printf("\n");
00852         }
00853
00854         // Free output buffer.
00855         g_pSSPI->FreeContextBuffer(pbMessage);
00856     }
00857
00858
00859 cleanup:
00860
00861     // Free the security context.
00862     g_pSSPI->DeleteSecurityContext(phContext);
00863
00864     // Close the socket.
00865     closesocket(Socket);
00866
00867     return Status;
00868 }
00869
00870 /*****************************************************************************/
00871 static
00872 SECURITY_STATUS
00873 PerformClientHandshake(
00874     SOCKET          Socket,         // in
00875     PCredHandle     phCreds,        // in
00876     LPSTR           pszServerName,  // in
00877     CtxtHandle *    phContext,      // out
00878     SecBuffer *     pExtraData)     // out
00879 {
00880     SecBufferDesc   OutBuffer;
00881     SecBuffer       OutBuffers[1];
00882     DWORD           dwSSPIFlags;
00883     DWORD           dwSSPIOutFlags;
00884     TimeStamp       tsExpiry;
00885     SECURITY_STATUS scRet;
00886     DWORD           cbData;
00887
00888     dwSSPIFlags = ISC_REQ_SEQUENCE_DETECT   |
00889                   ISC_REQ_REPLAY_DETECT     |
00890                   ISC_REQ_CONFIDENTIALITY   |
00891                   ISC_RET_EXTENDED_ERROR    |
00892                   ISC_REQ_ALLOCATE_MEMORY   |
00893                   ISC_REQ_STREAM;
00894
00895     //
00896     //  Initiate a ClientHello message and generate a token.
00897     //
00898
00899     OutBuffers[0].pvBuffer   = NULL;
00900     OutBuffers[0].BufferType = SECBUFFER_TOKEN;
00901     OutBuffers[0].cbBuffer   = 0;
00902
00903     OutBuffer.cBuffers = 1;
00904     OutBuffer.pBuffers = OutBuffers;
00905     OutBuffer.ulVersion = SECBUFFER_VERSION;
00906
00907     scRet = g_pSSPI->InitializeSecurityContextA(
00908                     phCreds,
00909                     NULL,
00910                     pszServerName,
00911                     dwSSPIFlags,
00912                     0,
00913                     SECURITY_NATIVE_DREP,
00914                     NULL,
00915                     0,
00916                     phContext,
00917                     &OutBuffer,
00918                     &dwSSPIOutFlags,
00919                     &tsExpiry);
00920
00921     if(scRet != SEC_I_CONTINUE_NEEDED)
00922     {
00923         printf("**** Error %d returned by InitializeSecurityContext (1)\n", scRet);
00924         return scRet;
00925     }
00926
00927     // Send response to server if there is one.
00928     if(OutBuffers[0].cbBuffer != 0 && OutBuffers[0].pvBuffer != NULL)
00929     {
00930         cbData = send(Socket,
00931                       OutBuffers[0].pvBuffer,
00932                       OutBuffers[0].cbBuffer,
00933                       0);
00934         if(cbData == SOCKET_ERROR || cbData == 0)
00935         {
00936             printf("**** Error %d sending data to server (1)\n", WSAGetLastError());
00937             g_pSSPI->FreeContextBuffer(OutBuffers[0].pvBuffer);
00938             g_pSSPI->DeleteSecurityContext(phContext);
00939             return SEC_E_INTERNAL_ERROR;
00940         }
00941
00942         printf("%d bytes of handshake data sent\n", cbData);
00943
00944         if(fVerbose)
00945         {
00946             PrintHexDump(cbData, OutBuffers[0].pvBuffer);
00947             printf("\n");
00948         }
00949
00950         // Free output buffer.
00951         g_pSSPI->FreeContextBuffer(OutBuffers[0].pvBuffer);
00952         OutBuffers[0].pvBuffer = NULL;
00953     }
00954
00955
00956     return ClientHandshakeLoop(Socket, phCreds, phContext, TRUE, pExtraData);
00957 }
00958
00959 /*****************************************************************************/
00960 static
00961 SECURITY_STATUS
00962 ClientHandshakeLoop(
00963     SOCKET          Socket,         // in
00964     PCredHandle     phCreds,        // in
00965     CtxtHandle *    phContext,      // in, out
00966     BOOL            fDoInitialRead, // in
00967     SecBuffer *     pExtraData)     // out
00968 {
00969     SecBufferDesc   InBuffer;
00970     SecBuffer       InBuffers[2];
00971     SecBufferDesc   OutBuffer;
00972     SecBuffer       OutBuffers[1];
00973     DWORD           dwSSPIFlags;
00974     DWORD           dwSSPIOutFlags;
00975     TimeStamp       tsExpiry;
00976     SECURITY_STATUS scRet;
00977     DWORD           cbData;
00978
00979     PUCHAR          IoBuffer;
00980     DWORD           cbIoBuffer;
00981     BOOL            fDoRead;
00982
00983
00984     dwSSPIFlags = ISC_REQ_SEQUENCE_DETECT   |
00985                   ISC_REQ_REPLAY_DETECT     |
00986                   ISC_REQ_CONFIDENTIALITY   |
00987                   ISC_RET_EXTENDED_ERROR    |
00988                   ISC_REQ_ALLOCATE_MEMORY   |
00989                   ISC_REQ_STREAM;
00990
00991     //
00992     // Allocate data buffer.
00993     //
00994
00995     IoBuffer = LocalAlloc(LMEM_FIXED, IO_BUFFER_SIZE);
00996     if(IoBuffer == NULL)
00997     {
00998         printf("**** Out of memory (1)\n");
00999         return SEC_E_INTERNAL_ERROR;
01000     }
01001     cbIoBuffer = 0;
01002
01003     fDoRead = fDoInitialRead;
01004
01005
01006     //
01007     // Loop until the handshake is finished or an error occurs.
01008     //
01009
01010     scRet = SEC_I_CONTINUE_NEEDED;
01011
01012     while(scRet == SEC_I_CONTINUE_NEEDED        ||
01013           scRet == SEC_E_INCOMPLETE_MESSAGE     ||
01014           scRet == SEC_I_INCOMPLETE_CREDENTIALS)
01015    {
01016
01017         //
01018         // Read data from server.
01019         //
01020
01021         if(0 == cbIoBuffer || scRet == SEC_E_INCOMPLETE_MESSAGE)
01022         {
01023             if(fDoRead)
01024             {
01025                 cbData = recv(Socket,
01026                               IoBuffer + cbIoBuffer,
01027                               IO_BUFFER_SIZE - cbIoBuffer,
01028                               0);
01029                 if(cbData == SOCKET_ERROR)
01030                 {
01031                     printf("**** Error %d reading data from server\n", WSAGetLastError());
01032                     scRet = SEC_E_INTERNAL_ERROR;
01033                     break;
01034                 }
01035                 else if(cbData == 0)
01036                 {
01037                     printf("**** Server unexpectedly disconnected\n");
01038                     scRet = SEC_E_INTERNAL_ERROR;
01039                     break;
01040                 }
01041
01042                 printf("%d bytes of handshake data received\n", cbData);
01043
01044                 if(fVerbose)
01045                 {
01046                     PrintHexDump(cbData, IoBuffer + cbIoBuffer);
01047                     printf("\n");
01048                 }
01049
01050                 cbIoBuffer += cbData;
01051             }
01052             else
01053             {
01054                 fDoRead = TRUE;
01055             }
01056         }
01057
01058
01059         //
01060         // Set up the input buffers. Buffer 0 is used to pass in data
01061         // received from the server. Schannel will consume some or all
01062         // of this. Leftover data (if any) will be placed in buffer 1 and
01063         // given a buffer type of SECBUFFER_EXTRA.
01064         //
01065
01066         InBuffers[0].pvBuffer   = IoBuffer;
01067         InBuffers[0].cbBuffer   = cbIoBuffer;
01068         InBuffers[0].BufferType = SECBUFFER_TOKEN;
01069
01070         InBuffers[1].pvBuffer   = NULL;
01071         InBuffers[1].cbBuffer   = 0;
01072         InBuffers[1].BufferType = SECBUFFER_EMPTY;
01073
01074         InBuffer.cBuffers       = 2;
01075         InBuffer.pBuffers       = InBuffers;
01076         InBuffer.ulVersion      = SECBUFFER_VERSION;
01077
01078         //
01079         // Set up the output buffers. These are initialized to NULL
01080         // so as to make it less likely we'll attempt to free random
01081         // garbage later.
01082         //
01083
01084         OutBuffers[0].pvBuffer  = NULL;
01085         OutBuffers[0].BufferType= SECBUFFER_TOKEN;
01086         OutBuffers[0].cbBuffer  = 0;
01087
01088         OutBuffer.cBuffers      = 1;
01089         OutBuffer.pBuffers      = OutBuffers;
01090         OutBuffer.ulVersion     = SECBUFFER_VERSION;
01091
01092         //
01093         // Call InitializeSecurityContext.
01094         //
01095
01096         scRet = g_pSSPI->InitializeSecurityContextA(phCreds,
01097                                           phContext,
01098                                           NULL,
01099                                           dwSSPIFlags,
01100                                           0,
01101                                           SECURITY_NATIVE_DREP,
01102                                           &InBuffer,
01103                                           0,
01104                                           NULL,
01105                                           &OutBuffer,
01106                                           &dwSSPIOutFlags,
01107                                           &tsExpiry);
01108
01109         //
01110         // If InitializeSecurityContext was successful (or if the error was
01111         // one of the special extended ones), send the contends of the output
01112         // buffer to the server.
01113         //
01114
01115         if(scRet == SEC_E_OK                ||
01116            scRet == SEC_I_CONTINUE_NEEDED   ||
01117            FAILED(scRet) && (dwSSPIOutFlags & ISC_RET_EXTENDED_ERROR))
01118         {
01119             if(OutBuffers[0].cbBuffer != 0 && OutBuffers[0].pvBuffer != NULL)
01120             {
01121                 cbData = send(Socket,
01122                               OutBuffers[0].pvBuffer,
01123                               OutBuffers[0].cbBuffer,
01124                               0);
01125                 if(cbData == SOCKET_ERROR || cbData == 0)
01126                 {
01127                     printf("**** Error %d sending data to server (2)\n",
01128                         WSAGetLastError());
01129                     g_pSSPI->FreeContextBuffer(OutBuffers[0].pvBuffer);
01130                     g_pSSPI->DeleteSecurityContext(phContext);
01131                     return SEC_E_INTERNAL_ERROR;
01132                 }
01133
01134                 printf("%d bytes of handshake data sent\n", cbData);
01135
01136                 if(fVerbose)
01137                 {
01138                     PrintHexDump(cbData, OutBuffers[0].pvBuffer);
01139                     printf("\n");
01140                 }
01141
01142                 // Free output buffer.
01143                 g_pSSPI->FreeContextBuffer(OutBuffers[0].pvBuffer);
01144                 OutBuffers[0].pvBuffer = NULL;
01145             }
01146         }
01147
01148
01149         //
01150         // If InitializeSecurityContext returned SEC_E_INCOMPLETE_MESSAGE,
01151         // then we need to read more data from the server and try again.
01152         //
01153
01154         if(scRet == SEC_E_INCOMPLETE_MESSAGE)
01155         {
01156             continue;
01157         }
01158
01159
01160         //
01161         // If InitializeSecurityContext returned SEC_E_OK, then the
01162         // handshake completed successfully.
01163         //
01164
01165         if(scRet == SEC_E_OK)
01166         {
01167             //
01168             // If the "extra" buffer contains data, this is encrypted application
01169             // protocol layer stuff. It needs to be saved. The application layer
01170             // will later decrypt it with DecryptMessage.
01171             //
01172
01173             printf("Handshake was successful\n");
01174
01175             if(InBuffers[1].BufferType == SECBUFFER_EXTRA)
01176             {
01177                 pExtraData->pvBuffer = LocalAlloc(LMEM_FIXED,
01178                                                   InBuffers[1].cbBuffer);
01179                 if(pExtraData->pvBuffer == NULL)
01180                 {
01181                     printf("**** Out of memory (2)\n");
01182                     return SEC_E_INTERNAL_ERROR;
01183                 }
01184
01185                 MoveMemory(pExtraData->pvBuffer,
01186                            IoBuffer + (cbIoBuffer - InBuffers[1].cbBuffer),
01187                            InBuffers[1].cbBuffer);
01188
01189                 pExtraData->cbBuffer   = InBuffers[1].cbBuffer;
01190                 pExtraData->BufferType = SECBUFFER_TOKEN;
01191
01192                 printf("%d bytes of app data was bundled with handshake data\n",
01193                     pExtraData->cbBuffer);
01194             }
01195             else
01196             {
01197                 pExtraData->pvBuffer   = NULL;
01198                 pExtraData->cbBuffer   = 0;
01199                 pExtraData->BufferType = SECBUFFER_EMPTY;
01200             }
01201
01202             //
01203             // Bail out to quit
01204             //
01205
01206             break;
01207         }
01208
01209
01210         //
01211         // Check for fatal error.
01212         //
01213
01214         if(FAILED(scRet))
01215         {
01216             printf("**** Error 0x%x returned by InitializeSecurityContext (2)\n", scRet);
01217             break;
01218         }
01219
01220
01221         //
01222         // If InitializeSecurityContext returned SEC_I_INCOMPLETE_CREDENTIALS,
01223         // then the server just requested client authentication.
01224         //
01225
01226         if(scRet == SEC_I_INCOMPLETE_CREDENTIALS)
01227         {
01228             //
01229             // Busted. The server has requested client authentication and
01230             // the credential we supplied didn't contain a client certificate.
01231             //
01232
01233             //
01234             // This function will read the list of trusted certificate
01235             // authorities ("issuers") that was received from the server
01236             // and attempt to find a suitable client certificate that
01237             // was issued by one of these. If this function is successful,
01238             // then we will connect using the new certificate. Otherwise,
01239             // we will attempt to connect anonymously (using our current
01240             // credentials).
01241             //
01242
01243             GetNewClientCredentials(phCreds, phContext);
01244
01245             // Go around again.
01246             fDoRead = FALSE;
01247             scRet = SEC_I_CONTINUE_NEEDED;
01248             continue;
01249         }
01250
01251
01252         //
01253         // Copy any leftover data from the "extra" buffer, and go around
01254         // again.
01255         //
01256
01257         if ( InBuffers[1].BufferType == SECBUFFER_EXTRA )
01258         {
01259             MoveMemory(IoBuffer,
01260                        IoBuffer + (cbIoBuffer - InBuffers[1].cbBuffer),
01261                        InBuffers[1].cbBuffer);
01262
01263             cbIoBuffer = InBuffers[1].cbBuffer;
01264         }
01265         else
01266         {
01267             cbIoBuffer = 0;
01268         }
01269     }
01270
01271     // Delete the security context in the case of a fatal error.
01272     if(FAILED(scRet))
01273     {
01274         g_pSSPI->DeleteSecurityContext(phContext);
01275     }
01276
01277     LocalFree(IoBuffer);
01278
01279     return scRet;
01280 }
01281
01282
01283 /*****************************************************************************/
01284 static
01285 SECURITY_STATUS
01286 HttpsGetFile(
01287     SOCKET          Socket,         // in
01288     PCredHandle     phCreds,        // in
01289     CtxtHandle *    phContext,      // in
01290     LPSTR           pszFileName)    // in
01291 {
01292     SecPkgContext_StreamSizes Sizes;
01293     SECURITY_STATUS scRet;
01294     SecBufferDesc   Message;
01295     SecBuffer       Buffers[4];
01296     SecBuffer *     pDataBuffer;
01297     SecBuffer *     pExtraBuffer;
01298     SecBuffer       ExtraBuffer;
01299
01300     PBYTE pbIoBuffer;
01301     DWORD cbIoBuffer;
01302     DWORD cbIoBufferLength;
01303     PBYTE pbMessage;
01304     DWORD cbMessage;
01305
01306     DWORD cbData;
01307     INT   i;
01308
01309
01310     //
01311     // Read stream encryption properties.
01312     //
01313
01314     scRet = g_pSSPI->QueryContextAttributes(phContext,
01315                                    SECPKG_ATTR_STREAM_SIZES,
01316                                    &Sizes);
01317     if(scRet != SEC_E_OK)
01318     {
01319         printf("**** Error 0x%x reading SECPKG_ATTR_STREAM_SIZES\n", scRet);
01320         return scRet;
01321     }
01322
01323     printf("\nHeader: %d, Trailer: %d, MaxMessage: %d\n",
01324         Sizes.cbHeader,
01325         Sizes.cbTrailer,
01326         Sizes.cbMaximumMessage);
01327
01328     //
01329     // Allocate a working buffer. The plaintext sent to EncryptMessage
01330     // should never be more than 'Sizes.cbMaximumMessage', so a buffer
01331     // size of this plus the header and trailer sizes should be safe enough.
01332     //
01333
01334     cbIoBufferLength = Sizes.cbHeader +
01335                        Sizes.cbMaximumMessage +
01336                        Sizes.cbTrailer;
01337
01338     pbIoBuffer = LocalAlloc(LMEM_FIXED, cbIoBufferLength);
01339     if(pbIoBuffer == NULL)
01340     {
01341         printf("**** Out of memory (2)\n");
01342         return SEC_E_INTERNAL_ERROR;
01343     }
01344
01345
01346     //
01347     // Build an HTTP request to send to the server.
01348     //
01349
01350     // Remove the trailing backslash from the filename, should one exist.
01351     if(pszFileName &&
01352        strlen(pszFileName) > 1 &&
01353        pszFileName[strlen(pszFileName) - 1] == '/')
01354     {
01355         pszFileName[strlen(pszFileName)-1] = 0;
01356     }
01357
01358     // Build the HTTP request offset into the data buffer by "header size"
01359     // bytes. This enables Schannel to perform the encryption in place,
01360     // which is a significant performance win.
01361     pbMessage = pbIoBuffer + Sizes.cbHeader;
01362
01363     // Build HTTP request. Note that I'm assuming that this is less than
01364     // the maximum message size. If it weren't, it would have to be broken up.
01365     sprintf(pbMessage,
01366             "GET /%s HTTP/1.0\r\nUser-Agent: Webclient\r\nAccept:*/*\r\n\r\n",
01367             pszFileName);
01368     printf("\nHTTP request: %s\n", pbMessage);
01369
01370     cbMessage = (DWORD)strlen(pbMessage);
01371
01372     printf("Sending plaintext: %d bytes\n", cbMessage);
01373
01374     if(fVerbose)
01375     {
01376         PrintHexDump(cbMessage, pbMessage);
01377         printf("\n");
01378     }
01379
01380     //
01381     // Encrypt the HTTP request.
01382     //
01383
01384     Buffers[0].pvBuffer     = pbIoBuffer;
01385     Buffers[0].cbBuffer     = Sizes.cbHeader;
01386     Buffers[0].BufferType   = SECBUFFER_STREAM_HEADER;
01387
01388     Buffers[1].pvBuffer     = pbMessage;
01389     Buffers[1].cbBuffer     = cbMessage;
01390     Buffers[1].BufferType   = SECBUFFER_DATA;
01391
01392     Buffers[2].pvBuffer     = pbMessage + cbMessage;
01393     Buffers[2].cbBuffer     = Sizes.cbTrailer;
01394     Buffers[2].BufferType   = SECBUFFER_STREAM_TRAILER;
01395
01396     Buffers[3].BufferType   = SECBUFFER_EMPTY;
01397
01398     Message.ulVersion       = SECBUFFER_VERSION;
01399     Message.cBuffers        = 4;
01400     Message.pBuffers        = Buffers;
01401
01402     scRet = g_pSSPI->EncryptMessage(phContext, 0, &Message, 0);
01403
01404     if(FAILED(scRet))
01405     {
01406         printf("**** Error 0x%x returned by EncryptMessage\n", scRet);
01407         return scRet;
01408     }
01409
01410
01411     //
01412     // Send the encrypted data to the server.
01413     //
01414
01415     cbData = send(Socket,
01416                   pbIoBuffer,
01417                   Buffers[0].cbBuffer + Buffers[1].cbBuffer + Buffers[2].cbBuffer,
01418                   0);
01419     if(cbData == SOCKET_ERROR || cbData == 0)
01420     {
01421         printf("**** Error %d sending data to server (3)\n",
01422             WSAGetLastError());
01423         g_pSSPI->DeleteSecurityContext(phContext);
01424         return SEC_E_INTERNAL_ERROR;
01425     }
01426
01427     printf("%d bytes of application data sent\n", cbData);
01428
01429     if(fVerbose)
01430     {
01431         PrintHexDump(cbData, pbIoBuffer);
01432         printf("\n");
01433     }
01434
01435     //
01436     // Read data from server until done.
01437     //
01438
01439     cbIoBuffer = 0;
01440
01441     while(TRUE)
01442     {
01443         //
01444         // Read some data.
01445         //
01446
01447         if(0 == cbIoBuffer || scRet == SEC_E_INCOMPLETE_MESSAGE)
01448         {
01449             cbData = recv(Socket,
01450                           pbIoBuffer + cbIoBuffer,
01451                           cbIoBufferLength - cbIoBuffer,
01452                           0);
01453             if(cbData == SOCKET_ERROR)
01454             {
01455                 printf("**** Error %d reading data from server\n", WSAGetLastError());
01456                 scRet = SEC_E_INTERNAL_ERROR;
01457                 break;
01458             }
01459             else if(cbData == 0)
01460             {
01461                 // Server disconnected.
01462                 if(cbIoBuffer)
01463                 {
01464                     printf("**** Server unexpectedly disconnected\n");
01465                     scRet = SEC_E_INTERNAL_ERROR;
01466                     return scRet;
01467                 }
01468                 else
01469                 {
01470                     break;
01471                 }
01472             }
01473             else
01474             {
01475                 printf("%d bytes of (encrypted) application data received\n", cbData);
01476
01477                 if(fVerbose)
01478                 {
01479                     PrintHexDump(cbData, pbIoBuffer + cbIoBuffer);
01480                     printf("\n");
01481                 }
01482
01483                 cbIoBuffer += cbData;
01484             }
01485         }
01486
01487         //
01488         // Attempt to decrypt the received data.
01489         //
01490
01491         Buffers[0].pvBuffer     = pbIoBuffer;
01492         Buffers[0].cbBuffer     = cbIoBuffer;
01493         Buffers[0].BufferType   = SECBUFFER_DATA;
01494
01495         Buffers[1].BufferType   = SECBUFFER_EMPTY;
01496         Buffers[2].BufferType   = SECBUFFER_EMPTY;
01497         Buffers[3].BufferType   = SECBUFFER_EMPTY;
01498
01499         Message.ulVersion       = SECBUFFER_VERSION;
01500         Message.cBuffers        = 4;
01501         Message.pBuffers        = Buffers;
01502
01503         scRet = g_pSSPI->DecryptMessage(phContext, &Message, 0, NULL);
01504
01505         if(scRet == SEC_E_INCOMPLETE_MESSAGE)
01506         {
01507             // The input buffer contains only a fragment of an
01508             // encrypted record. Loop around and read some more
01509             // data.
01510             continue;
01511         }
01512
01513         // Server signalled end of session
01514         if(scRet == SEC_I_CONTEXT_EXPIRED)
01515             break;
01516
01517         if( scRet != SEC_E_OK &&
01518             scRet != SEC_I_RENEGOTIATE &&
01519             scRet != SEC_I_CONTEXT_EXPIRED)
01520         {
01521             printf("**** Error 0x%x returned by DecryptMessage\n", scRet);
01522             return scRet;
01523         }
01524
01525         // Locate data and (optional) extra buffers.
01526         pDataBuffer  = NULL;
01527         pExtraBuffer = NULL;
01528         for(i = 1; i < 4; i++)
01529         {
01530
01531             if(pDataBuffer == NULL && Buffers[i].BufferType == SECBUFFER_DATA)
01532             {
01533                 pDataBuffer = &Buffers[i];
01534                 printf("Buffers[%d].BufferType = SECBUFFER_DATA\n",i);
01535             }
01536             if(pExtraBuffer == NULL && Buffers[i].BufferType == SECBUFFER_EXTRA)
01537             {
01538                 pExtraBuffer = &Buffers[i];
01539             }
01540         }
01541
01542         // Display or otherwise process the decrypted data.
01543         if(pDataBuffer)
01544         {
01545             printf("Decrypted data: %d bytes\n", pDataBuffer->cbBuffer);
01546
01547             if(fVerbose)
01548             {
01549                 PrintHexDump(pDataBuffer->cbBuffer, pDataBuffer->pvBuffer);
01550                 printf("\n");
01551             }
01552         }
01553
01554         // Move any "extra" data to the input buffer.
01555         if(pExtraBuffer)
01556         {
01557             MoveMemory(pbIoBuffer, pExtraBuffer->pvBuffer, pExtraBuffer->cbBuffer);
01558             cbIoBuffer = pExtraBuffer->cbBuffer;
01559         }
01560         else
01561         {
01562             cbIoBuffer = 0;
01563         }
01564
01565         if(scRet == SEC_I_RENEGOTIATE)
01566         {
01567             // The server wants to perform another handshake
01568             // sequence.
01569
01570             printf("Server requested renegotiate!\n");
01571
01572             scRet = ClientHandshakeLoop(Socket,
01573                                         phCreds,
01574                                         phContext,
01575                                         FALSE,
01576                                         &ExtraBuffer);
01577             if(scRet != SEC_E_OK)
01578             {
01579                 return scRet;
01580             }
01581
01582             // Move any "extra" data to the input buffer.
01583             if(ExtraBuffer.pvBuffer)
01584             {
01585                 MoveMemory(pbIoBuffer, ExtraBuffer.pvBuffer, ExtraBuffer.cbBuffer);
01586                 cbIoBuffer = ExtraBuffer.cbBuffer;
01587             }
01588         }
01589     }
01590
01591     return SEC_E_OK;
01592 }
01593
01594 /*****************************************************************************/
01595 static
01596 void
01597 DisplayCertChain(
01598     PCCERT_CONTEXT  pServerCert,
01599     BOOL            fLocal)
01600 {
01601     CHAR szName[1000];
01602     PCCERT_CONTEXT pCurrentCert;
01603     PCCERT_CONTEXT pIssuerCert;
01604     DWORD dwVerificationFlags;
01605
01606     printf("\n");
01607
01608     // display leaf name
01609     if(!CertNameToStr(pServerCert->dwCertEncodingType,
01610                       &pServerCert->pCertInfo->Subject,
01611                       CERT_X500_NAME_STR | CERT_NAME_STR_NO_PLUS_FLAG,
01612                       szName, sizeof(szName)))
01613     {
01614         printf("**** Error 0x%x building subject name\n", GetLastError());
01615     }
01616     if(fLocal)
01617     {
01618         printf("Client subject: %s\n", szName);
01619     }
01620     else
01621     {
01622         printf("Server subject: %s\n", szName);
01623     }
01624     if(!CertNameToStr(pServerCert->dwCertEncodingType,
01625                       &pServerCert->pCertInfo->Issuer,
01626                       CERT_X500_NAME_STR | CERT_NAME_STR_NO_PLUS_FLAG,
01627                       szName, sizeof(szName)))
01628     {
01629         printf("**** Error 0x%x building issuer name\n", GetLastError());
01630     }
01631     if(fLocal)
01632     {
01633         printf("Client issuer: %s\n", szName);
01634     }
01635     else
01636     {
01637         printf("Server issuer: %s\n\n", szName);
01638     }
01639
01640
01641     // display certificate chain
01642     pCurrentCert = pServerCert;
01643     while(pCurrentCert != NULL)
01644     {
01645         dwVerificationFlags = 0;
01646         pIssuerCert = CertGetIssuerCertificateFromStore(pServerCert->hCertStore,
01647                                                         pCurrentCert,
01648                                                         NULL,
01649                                                         &dwVerificationFlags);
01650         if(pIssuerCert == NULL)
01651         {
01652             if(pCurrentCert != pServerCert)
01653             {
01654                 CertFreeCertificateContext(pCurrentCert);
01655             }
01656             break;
01657         }
01658
01659         if(!CertNameToStr(pIssuerCert->dwCertEncodingType,
01660                           &pIssuerCert->pCertInfo->Subject,
01661                           CERT_X500_NAME_STR | CERT_NAME_STR_NO_PLUS_FLAG,
01662                           szName, sizeof(szName)))
01663         {
01664             printf("**** Error 0x%x building subject name\n", GetLastError());
01665         }
01666         printf("CA subject: %s\n", szName);
01667         if(!CertNameToStr(pIssuerCert->dwCertEncodingType,
01668                           &pIssuerCert->pCertInfo->Issuer,
01669                           CERT_X500_NAME_STR | CERT_NAME_STR_NO_PLUS_FLAG,
01670                           szName, sizeof(szName)))
01671         {
01672             printf("**** Error 0x%x building issuer name\n", GetLastError());
01673         }
01674         printf("CA issuer: %s\n\n", szName);
01675
01676         if(pCurrentCert != pServerCert)
01677         {
01678             CertFreeCertificateContext(pCurrentCert);
01679         }
01680         pCurrentCert = pIssuerCert;
01681         pIssuerCert = NULL;
01682     }
01683 }
01684
01685
01686 /*****************************************************************************/
01687 static
01688 void
01689 DisplayWinVerifyTrustError(DWORD Status)
01690 {
01691     LPSTR pszName = NULL;
01692
01693     switch(Status)
01694     {
01695     case CERT_E_EXPIRED:                pszName = "CERT_E_EXPIRED";                 break;
01696     case CERT_E_VALIDITYPERIODNESTING:  pszName = "CERT_E_VALIDITYPERIODNESTING";   break;
01697     case CERT_E_ROLE:                   pszName = "CERT_E_ROLE";                    break;
01698     case CERT_E_PATHLENCONST:           pszName = "CERT_E_PATHLENCONST";            break;
01699     case CERT_E_CRITICAL:               pszName = "CERT_E_CRITICAL";                break;
01700     case CERT_E_PURPOSE:                pszName = "CERT_E_PURPOSE";                 break;
01701     case CERT_E_ISSUERCHAINING:         pszName = "CERT_E_ISSUERCHAINING";          break;
01702     case CERT_E_MALFORMED:              pszName = "CERT_E_MALFORMED";               break;
01703     case CERT_E_UNTRUSTEDROOT:          pszName = "CERT_E_UNTRUSTEDROOT";           break;
01704     case CERT_E_CHAINING:               pszName = "CERT_E_CHAINING";                break;
01705     case TRUST_E_FAIL:                  pszName = "TRUST_E_FAIL";                   break;
01706     case CERT_E_REVOKED:                pszName = "CERT_E_REVOKED";                 break;
01707     case CERT_E_UNTRUSTEDTESTROOT:      pszName = "CERT_E_UNTRUSTEDTESTROOT";       break;
01708     case CERT_E_REVOCATION_FAILURE:     pszName = "CERT_E_REVOCATION_FAILURE";      break;
01709     case CERT_E_CN_NO_MATCH:            pszName = "CERT_E_CN_NO_MATCH";             break;
01710     case CERT_E_WRONG_USAGE:            pszName = "CERT_E_WRONG_USAGE";             break;
01711     default:                            pszName = "(unknown)";                      break;
01712     }
01713
01714     printf("Error 0x%x (%s) returned by CertVerifyCertificateChainPolicy!\n",
01715         Status, pszName);
01716 }
01717
01718 /*****************************************************************************/
01719 static
01720 DWORD
01721 VerifyServerCertificate(
01722     PCCERT_CONTEXT  pServerCert,
01723     PSTR            pszServerName,
01724     DWORD           dwCertFlags)
01725 {
01726     HTTPSPolicyCallbackData  polHttps;
01727     CERT_CHAIN_POLICY_PARA   PolicyPara;
01728     CERT_CHAIN_POLICY_STATUS PolicyStatus;
01729     CERT_CHAIN_PARA          ChainPara;
01730     PCCERT_CHAIN_CONTEXT     pChainContext = NULL;
01731
01732     LPSTR rgszUsages[] = {  szOID_PKIX_KP_SERVER_AUTH,
01733                             szOID_SERVER_GATED_CRYPTO,
01734                             szOID_SGC_NETSCAPE };
01735     DWORD cUsages = sizeof(rgszUsages) / sizeof(LPSTR);
01736
01737     PWSTR   pwszServerName = NULL;
01738     DWORD   cchServerName;
01739     DWORD   Status;
01740
01741     if(pServerCert == NULL)
01742     {
01743         Status = SEC_E_WRONG_PRINCIPAL;
01744         goto cleanup;
01745     }
01746
01747
01748     //
01749     // Convert server name to unicode.
01750     //
01751
01752     if(pszServerName == NULL || strlen(pszServerName) == 0)
01753     {
01754         Status = SEC_E_WRONG_PRINCIPAL;
01755         goto cleanup;
01756     }
01757
01758     cchServerName = MultiByteToWideChar(CP_ACP, 0, pszServerName, -1, NULL, 0);
01759     pwszServerName = LocalAlloc(LMEM_FIXED, cchServerName * sizeof(WCHAR));
01760     if(pwszServerName == NULL)
01761     {
01762         Status = SEC_E_INSUFFICIENT_MEMORY;
01763         goto cleanup;
01764     }
01765     cchServerName = MultiByteToWideChar(CP_ACP, 0, pszServerName, -1, pwszServerName, cchServerName);
01766     if(cchServerName == 0)
01767     {
01768         Status = SEC_E_WRONG_PRINCIPAL;
01769         goto cleanup;
01770     }
01771
01772
01773     //
01774     // Build certificate chain.
01775     //
01776
01777     ZeroMemory(&ChainPara, sizeof(ChainPara));
01778     ChainPara.cbSize = sizeof(ChainPara);
01779     ChainPara.RequestedUsage.dwType = USAGE_MATCH_TYPE_OR;
01780     ChainPara.RequestedUsage.Usage.cUsageIdentifier     = cUsages;
01781     ChainPara.RequestedUsage.Usage.rgpszUsageIdentifier = rgszUsages;
01782
01783     if(!CertGetCertificateChain(
01784                             NULL,
01785                             pServerCert,
01786                             NULL,
01787                             pServerCert->hCertStore,
01788                             &ChainPara,
01789                             0,
01790                             NULL,
01791                             &pChainContext))
01792     {
01793         Status = GetLastError();
01794         printf("Error 0x%x returned by CertGetCertificateChain!\n", Status);
01795         goto cleanup;
01796     }
01797
01798
01799     //
01800     // Validate certificate chain.
01801     //
01802
01803     ZeroMemory(&polHttps, sizeof(HTTPSPolicyCallbackData));
01804     polHttps.cbStruct           = sizeof(HTTPSPolicyCallbackData);
01805     polHttps.dwAuthType         = AUTHTYPE_SERVER;
01806     polHttps.fdwChecks          = dwCertFlags;
01807     polHttps.pwszServerName     = pwszServerName;
01808
01809     memset(&PolicyPara, 0, sizeof(PolicyPara));
01810     PolicyPara.cbSize            = sizeof(PolicyPara);
01811     PolicyPara.pvExtraPolicyPara = &polHttps;
01812
01813     memset(&PolicyStatus, 0, sizeof(PolicyStatus));
01814     PolicyStatus.cbSize = sizeof(PolicyStatus);
01815
01816     if(!CertVerifyCertificateChainPolicy(
01817                             CERT_CHAIN_POLICY_SSL,
01818                             pChainContext,
01819                             &PolicyPara,
01820                             &PolicyStatus))
01821     {
01822         Status = GetLastError();
01823         printf("Error 0x%x returned by CertVerifyCertificateChainPolicy!\n", Status);
01824         goto cleanup;
01825     }
01826
01827     if(PolicyStatus.dwError)
01828     {
01829         Status = PolicyStatus.dwError;
01830         DisplayWinVerifyTrustError(Status);
01831         goto cleanup;
01832     }
01833
01834
01835     Status = SEC_E_OK;
01836
01837 cleanup:
01838
01839     if(pChainContext)
01840     {
01841         CertFreeCertificateChain(pChainContext);
01842     }
01843
01844     if(pwszServerName)
01845     {
01846         LocalFree(pwszServerName);
01847     }
01848
01849     return Status;
01850 }
01851
01852
01853 /*****************************************************************************/
01854 static void
01855 WriteDataToFile(
01856     PSTR  pszFilename,
01857     PBYTE pbData,
01858     DWORD cbData)
01859 {
01860     FILE *file;
01861
01862     file = fopen(pszFilename, "wb");
01863     if(file == NULL)
01864     {
01865         printf("**** Error opening file '%s'\n", pszFilename);
01866         return;
01867     }
01868
01869     if(fwrite(pbData, 1, cbData, file) != cbData)
01870     {
01871         printf("**** Error writing to file\n");
01872         return;
01873     }
01874
01875     fclose(file);
01876 }
01877
01878
01879 /*****************************************************************************/
01880 static
01881 void
01882 DisplayConnectionInfo(
01883     CtxtHandle *phContext)
01884 {
01885     SECURITY_STATUS Status;
01886     SecPkgContext_ConnectionInfo ConnectionInfo;
01887
01888     Status = g_pSSPI->QueryContextAttributes(phContext,
01889                                     SECPKG_ATTR_CONNECTION_INFO,
01890                                     (PVOID)&ConnectionInfo);
01891     if(Status != SEC_E_OK)
01892     {
01893         printf("Error 0x%x querying connection info\n", Status);
01894         return;
01895     }
01896
01897     printf("\n");
01898
01899     switch(ConnectionInfo.dwProtocol)
01900     {
01901         case SP_PROT_TLS1_CLIENT:
01902             printf("Protocol: TLS1\n");
01903             break;
01904
01905         case SP_PROT_SSL3_CLIENT:
01906             printf("Protocol: SSL3\n");
01907             break;
01908
01909         case SP_PROT_PCT1_CLIENT:
01910             printf("Protocol: PCT\n");
01911             break;
01912
01913         case SP_PROT_SSL2_CLIENT:
01914             printf("Protocol: SSL2\n");
01915             break;
01916
01917         default:
01918             printf("Protocol: 0x%x\n", ConnectionInfo.dwProtocol);
01919     }
01920
01921     switch(ConnectionInfo.aiCipher)
01922     {
01923         case CALG_RC4:
01924             printf("Cipher: RC4\n");
01925             break;
01926
01927         case CALG_3DES:
01928             printf("Cipher: Triple DES\n");
01929             break;
01930
01931         case CALG_RC2:
01932             printf("Cipher: RC2\n");
01933             break;
01934
01935         case CALG_DES:
01936         case CALG_CYLINK_MEK:
01937             printf("Cipher: DES\n");
01938             break;
01939
01940         case CALG_SKIPJACK:
01941             printf("Cipher: Skipjack\n");
01942             break;
01943
01944         default:
01945             printf("Cipher: 0x%x\n", ConnectionInfo.aiCipher);
01946     }
01947
01948     printf("Cipher strength: %d\n", ConnectionInfo.dwCipherStrength);
01949
01950     switch(ConnectionInfo.aiHash)
01951     {
01952         case CALG_MD5:
01953             printf("Hash: MD5\n");
01954             break;
01955
01956         case CALG_SHA:
01957             printf("Hash: SHA\n");
01958             break;
01959
01960         default:
01961             printf("Hash: 0x%x\n", ConnectionInfo.aiHash);
01962     }
01963
01964     printf("Hash strength: %d\n", ConnectionInfo.dwHashStrength);
01965
01966     switch(ConnectionInfo.aiExch)
01967     {
01968         case CALG_RSA_KEYX:
01969         case CALG_RSA_SIGN:
01970             printf("Key exchange: RSA\n");
01971             break;
01972
01973         case CALG_KEA_KEYX:
01974             printf("Key exchange: KEA\n");
01975             break;
01976
01977         case CALG_DH_EPHEM:
01978             printf("Key exchange: DH Ephemeral\n");
01979             break;
01980
01981         default:
01982             printf("Key exchange: 0x%x\n", ConnectionInfo.aiExch);
01983     }
01984
01985     printf("Key exchange strength: %d\n", ConnectionInfo.dwExchStrength);
01986 }
01987
01988
01989 /*****************************************************************************/
01990 static
01991 void
01992 GetNewClientCredentials(
01993     CredHandle *phCreds,
01994     CtxtHandle *phContext)
01995 {
01996     CredHandle hCreds;
01997     SecPkgContext_IssuerListInfoEx IssuerListInfo;
01998     PCCERT_CHAIN_CONTEXT pChainContext;
01999     CERT_CHAIN_FIND_BY_ISSUER_PARA FindByIssuerPara;
02000     PCCERT_CONTEXT  pCertContext;
02001     TimeStamp       tsExpiry;
02002     SECURITY_STATUS Status;
02003
02004     //
02005     // Read list of trusted issuers from schannel.
02006     //
02007
02008     Status = g_pSSPI->QueryContextAttributes(phContext,
02009                                     SECPKG_ATTR_ISSUER_LIST_EX,
02010                                     (PVOID)&IssuerListInfo);
02011     if(Status != SEC_E_OK)
02012     {
02013         printf("Error 0x%x querying issuer list info\n", Status);
02014         return;
02015     }
02016
02017     //
02018     // Enumerate the client certificates.
02019     //
02020
02021     ZeroMemory(&FindByIssuerPara, sizeof(FindByIssuerPara));
02022
02023     FindByIssuerPara.cbSize = sizeof(FindByIssuerPara);
02024     FindByIssuerPara.pszUsageIdentifier = szOID_PKIX_KP_CLIENT_AUTH;
02025     FindByIssuerPara.dwKeySpec = 0;
02026     FindByIssuerPara.cIssuer   = IssuerListInfo.cIssuers;
02027     FindByIssuerPara.rgIssuer  = IssuerListInfo.aIssuers;
02028
02029     pChainContext = NULL;
02030
02031     while(TRUE)
02032     {
02033         // Find a certificate chain.
02034         pChainContext = CertFindChainInStore(hMyCertStore,
02035                                              X509_ASN_ENCODING,
02036                                              0,
02037                                              CERT_CHAIN_FIND_BY_ISSUER,
02038                                              &FindByIssuerPara,
02039                                              pChainContext);
02040         if(pChainContext == NULL)
02041         {
02042             printf("Error 0x%x finding cert chain\n", GetLastError());
02043             break;
02044         }
02045         printf("\ncertificate chain found\n");
02046
02047         // Get pointer to leaf certificate context.
02048         pCertContext = pChainContext->rgpChain[0]->rgpElement[0]->pCertContext;
02049
02050         // Create schannel credential.
02051         SchannelCred.dwVersion = SCHANNEL_CRED_VERSION;
02052         SchannelCred.cCreds = 1;
02053         SchannelCred.paCred = &pCertContext;
02054
02055         Status = g_pSSPI->AcquireCredentialsHandleA(
02056                             NULL,                   // Name of principal
02057                             UNISP_NAME_A,           // Name of package
02058                             SECPKG_CRED_OUTBOUND,   // Flags indicating use
02059                             NULL,                   // Pointer to logon ID
02060                             &SchannelCred,          // Package specific data
02061                             NULL,                   // Pointer to GetKey() func
02062                             NULL,                   // Value to pass to GetKey()
02063                             &hCreds,                // (out) Cred Handle
02064                             &tsExpiry);             // (out) Lifetime (optional)
02065         if(Status != SEC_E_OK)
02066         {
02067             printf("**** Error 0x%x returned by AcquireCredentialsHandle\n", Status);
02068             continue;
02069         }
02070         printf("\nnew schannel credential created\n");
02071
02072         // Destroy the old credentials.
02073         g_pSSPI->FreeCredentialsHandle(phCreds);
02074
02075         *phCreds = hCreds;
02076
02077         //
02078         // As you can see, this sample code maintains a single credential
02079         // handle, replacing it as necessary. This is a little unusual.
02080         //
02081         // Many applications maintain a global credential handle that's
02082         // anonymous (that is, it doesn't contain a client certificate),
02083         // which is used to connect to all servers. If a particular server
02084         // should require client authentication, then a new credential
02085         // is created for use when connecting to that server. The global
02086         // anonymous credential is retained for future connections to
02087         // other servers.
02088         //
02089         // Maintaining a single anonymous credential that's used whenever
02090         // possible is most efficient, since creating new credentials all
02091         // the time is rather expensive.
02092         //
02093
02094         break;
02095     }
02096 }
02097
02098
02099 /*****************************************************************************/
02100 static void
02101 PrintHexDump(DWORD length, PBYTE buffer)
02102 {
02103     DWORD i,count,index;
02104     CHAR rgbDigits[]="0123456789abcdef";
02105     CHAR rgbLine[100];
02106     char cbLine;
02107
02108     for(index = 0; length; length -= count, buffer += count, index += count)
02109     {
02110         count = (length > 16) ? 16:length;
02111
02112         sprintf(rgbLine, "%4.4x  ",index);
02113         cbLine = 6;
02114
02115         for(i=0;i<count;i++)
02116         {
02117             rgbLine[cbLine++] = rgbDigits[buffer[i] >> 4];
02118             rgbLine[cbLine++] = rgbDigits[buffer[i] & 0x0f];
02119             if(i == 7)
02120             {
02121                 rgbLine[cbLine++] = ':';
02122             }
02123             else
02124             {
02125                 rgbLine[cbLine++] = ' ';
02126             }
02127         }
02128         for(; i < 16; i++)
02129         {
02130             rgbLine[cbLine++] = ' ';
02131             rgbLine[cbLine++] = ' ';
02132             rgbLine[cbLine++] = ' ';
02133         }
02134
02135         rgbLine[cbLine++] = ' ';
02136
02137         for(i = 0; i < count; i++)
02138         {
02139             if(buffer[i] < 32 || buffer[i] > 126 || buffer[i] == '%')
02140             {
02141                 rgbLine[cbLine++] = '.';
02142             }
02143             else
02144             {
02145                 rgbLine[cbLine++] = buffer[i];
02146             }
02147         }
02148
02149         rgbLine[cbLine++] = 0;
02150         printf("%s\n", rgbLine);
02151     }
02152 }
02153
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SOCK_INFO Member List

This is the complete list of members for _SOCK_INFO, including all inherited members.
bClosing | _SOCK_INFO
BytesRecv | _SOCK_INFO
BytesSent | _SOCK_INFO
dwOutstandingAsync | _SOCK_INFO
hIocp | _SOCK_INFO
hWnd | _SOCK_INFO
isFdCloseRecd | _SOCK_INFO
isSocketListening | _SOCK_INFO
LayeredSocket | _SOCK_INFO
next | _SOCK_INFO
nTotalRecd | _SOCK_INFO
nTotalSent | _SOCK_INFO
prev | _SOCK_INFO
Provider | _SOCK_INFO
ProviderSocket | _SOCK_INFO
recdData | _SOCK_INFO
RefCount | _SOCK_INFO
sock | _SOCK_INFO
SockCritSec | _SOCK_INFO
uMsg | _SOCK_INFO
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/file.h Source File

  • Begin
  • sdkdiff

file.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #ifndef __FILE_H__
00012 #define __FILE_H__
00013 /*
00014  * FILEDATA - represents a file name and its contents.
00015  *
00016  * The file name is held in the form of a DIRITEM which is managed
00017  * by SCANDIR (see scandir.h).  A DIRITEM must be supplied to initialise
00018  * a FILEDATA.
00019  *
00020  * On demand, the FILEDATA will return a handle to a list of lines.
00021  * These are the lines in the file in the form of LINE handles (see line.h)
00022  * this list can be discarded by a call to file_discardlines, or file_delete.
00023  */
00024
00025 /* handle to filedata */
00026 typedef struct filedata FAR * FILEDATA;
00027
00028 /*
00029  * make a new FILEDATA, based on a DIRITEM. the filedata will retain
00030  * the diritem handle for use in fetching filenames and handles.
00031  *
00032  * if the bRead is set, the file will be read into memory. If not, this
00033  * will be done during the first call to file_getlines
00034  */
00035 FILEDATA file_new(DIRITEM fiName, BOOL bRead);
00036
00037 /*
00038  * return a handle to the DIRITEM used to create this FILEDATA
00039  */
00040 DIRITEM file_getdiritem(FILEDATA fi);
00041
00042
00043 /* delete a FILEDATA and its associated list of LINEs. note that the
00044  * DIRITEM is NOT deleted.
00045  */
00046 void file_delete(FILEDATA fi);
00047
00048 /*
00049  * return a list of the lines in the file. This is a standard list that can
00050  * be traversed with the list functions. The list should only be deleted
00051  * by calls to file_delete or file_discardlines for the owning FILEDATA.
00052  * The items in the list are LINE handles.
00053  *
00054  * this call will cause the file to be read into memory if necessary (if
00055  * the lines had been discarded using file_discardlines, or if bRead were
00056  * false in the initial call to file_new
00057  */
00058 LIST file_getlinelist(FILEDATA fi);
00059
00060 /*
00061  * free up the line list and any associated memory until it is needed again.
00062  */
00063 void file_discardlines(FILEDATA fi);
00064
00065 /*
00066  * force all lines in the line list to reset their hashcodes and any line
00067  * links. Does not cause the file to be re-read.
00068  */
00069 void file_reset(FILEDATA fi);
00070
00071 /*
00072  * give me a checksum for the file. whether or not actually calculated by
00073  * dir_getchecksum(), it will be the same checksum as if it were.
00074  */
00075 DWORD file_checksum(FILEDATA fi);
00076
00077 /*
00078  * Retrieve the checksum that we have for this file, valid or not.
00079  * Indicate in bValid whether it is actually valid or not.
00080  * Do NOT recalculate it or make any new attempt to read the file!
00081  */
00082 DWORD file_retrievechecksum(FILEDATA fi, BOOL * bValid);
00083
00084 /* returns TRUE if the file is unicode */
00085 BOOL file_IsUnicode(FILEDATA fd);
00086
00087
00088 /* retrieve the filetime for the file */
00089 FILETIME file_GetTime(FILEDATA fd);
00090
00091
00092 #endif
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCShip2/QCShip2.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCShip2

QCShip2.Cpp

Go to the documentation of this file.
00001 // QCShip2.cpp : Implementation of DLL Exports.
00002
00003 #include "stdafx.h"
00004 #include "resource.h"
00005 #include "initguid.h"
00006 #include <adoid.h>    // ADO
00007 #include "..\QCNotify\QCNotify.h"
00008 #include "..\QCNotify\QCNotify_i.c"
00009 #include "QCShip2.h"
00010 #include "QCShip2_i.c"
00011 #include "Ship2.h"
00012
00013
00014 CComModule _Module;
00015
00016 BEGIN_OBJECT_MAP(ObjectMap)
00017   OBJECT_ENTRY(CLSID_Ship2, COShip2)
00018 END_OBJECT_MAP()
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // DLL Entry Point
00022
00023 extern "C"
00024 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00025 {
00026   if (dwReason == DLL_PROCESS_ATTACH)
00027   {
00028     _Module.Init(ObjectMap, hInstance);
00029     DisableThreadLibraryCalls(hInstance);
00030   }
00031   else if (dwReason == DLL_PROCESS_DETACH)
00032     _Module.Term();
00033   return TRUE;    // ok
00034 }
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 // Used to determine whether the DLL can be unloaded by OLE
00038
00039 STDAPI DllCanUnloadNow(void)
00040 {
00041   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00042 }
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045 // Returns a class factory to create an object of the requested type
00046
00047 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00048 {
00049   return _Module.GetClassObject(rclsid, riid, ppv);
00050 }
00051
00052 /////////////////////////////////////////////////////////////////////////////
00053 // DllRegisterServer - Adds entries to the system registry
00054
00055 STDAPI DllRegisterServer(void)
00056 {
00057   // registers object, typelib and all interfaces in typelib
00058   return _Module.RegisterServer(TRUE);
00059 }
00060
00061 /////////////////////////////////////////////////////////////////////////////
00062 // DllUnregisterServer - Removes entries from the system registry
00063
00064 STDAPI DllUnregisterServer(void)
00065 {
00066   _Module.UnregisterServer();
00067   return S_OK;
00068 }
00069
00070
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/cvttype.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

cvttype.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module CVTTYPE.CPP | CImpIConvertType implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012
00013 #include "headers.h"
00014
00015 //----------------------------------------------------------------------------
00016 // CImpIConvertType::CanConvert
00017 //
00018 // @mfunc Used by consumer to determine provider support for a conversion
00019 //
00020 // @rdesc HRESULT indicating the status of the method
00021 //    @flag S_OK | Conversion supported
00022 //    @flag S_FALSE | Conversion unsupported
00023 //    @flag DB_E_BADCONVERTFLAG | dwConvertFlags was invalid
00024 //    @flag DB_E_BADCONVERTFLAG | called on rowset for DBCONVERTFLAG_PARAMETER
00025 //    @flag OTHER | HRESULTS returned from support functions
00026 //
00027 STDMETHODIMP CImpIConvertType::CanConvert
00028 (
00029   DBTYPE      wFromType,    //@parm IN | src type
00030   DBTYPE      wToType,    //@parm IN | dst type
00031   DBCONVERTFLAGS  dwConvertFlags  //@parm IN | conversion flags
00032 )
00033 {
00034   //
00035   // We only support conversions on Rowsets, we only allow DBCONVERTFLAGS_COLUMN
00036   //
00037   if( (dwConvertFlags & ~(DBCONVERTFLAGS_ISLONG |
00038               DBCONVERTFLAGS_ISFIXEDLENGTH |
00039               DBCONVERTFLAGS_FROMVARIANT)) != DBCONVERTFLAGS_COLUMN )
00040     return (DB_E_BADCONVERTFLAG);
00041
00042   //
00043   // Make sure that we check that the type is a variant if they say so
00044   //
00045   if( dwConvertFlags & DBCONVERTFLAGS_FROMVARIANT )
00046   {
00047     DBTYPE  wVtType = wFromType & VT_TYPEMASK;
00048
00049     //
00050     // Take out all of the Valid VT_TYPES (36 is VT_RECORD in VC 6)
00051     //
00052     if( (wVtType > VT_DECIMAL && wVtType < VT_I1) ||
00053       ((wVtType > VT_LPWSTR && wVtType < VT_FILETIME) && wVtType != 36) ||
00054       (wVtType > VT_CLSID) )
00055       return (DB_E_BADTYPE);
00056   }
00057
00058   //
00059   // Don't allow _ISLONG on fixed-length types
00060   //
00061   if( dwConvertFlags & DBCONVERTFLAGS_ISLONG )
00062     switch( wFromType & ~(DBTYPE_RESERVED|DBTYPE_VECTOR|DBTYPE_ARRAY|DBTYPE_BYREF) )
00063     {
00064     case DBTYPE_BYTES:
00065     case DBTYPE_STR:
00066     case DBTYPE_WSTR:
00067     case DBTYPE_VARNUMERIC:
00068       break;
00069
00070     default:
00071       return (DB_E_BADCONVERTFLAG);
00072     }
00073
00074   //
00075   // If the DC is not there, try to create it again
00076   if( !g_pIDataConvert )
00077   {
00078     CoCreateInstance(CLSID_OLEDB_CONVERSIONLIBRARY,
00079                 NULL,
00080                 CLSCTX_INPROC_SERVER,
00081                 IID_IDataConvert,
00082                 (void**)&g_pIDataConvert);
00083
00084     //
00085     // Tell the DC that we are 2.5
00086     //
00087     if( g_pIDataConvert )
00088     {
00089       DCINFO rgInfo[] = {{DCINFOTYPE_VERSION,{VT_UI4, 0, 0, 0, 0x0}}};
00090       IDCInfo *pIDCInfo = NULL;
00091
00092       if( g_pIDataConvert->QueryInterface(IID_IDCInfo, (void **)&pIDCInfo) == S_OK &&
00093         pIDCInfo )
00094       {
00095         // OLE DB Version 02.50
00096         V_UI4(&rgInfo->vData) = 0x250;
00097         pIDCInfo->SetInfo(NUMELEM(rgInfo),rgInfo);
00098         pIDCInfo->Release();
00099       }
00100     }
00101     else
00102       return (S_FALSE);
00103   }
00104
00105   //
00106   // Ask the conversion library for the answer
00107   //
00108   return (g_pIDataConvert->CanConvert(wFromType, wToType));
00109 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COrder Member List

This is the complete list of members for COrder, including all inherited members.
COrder() | COrder | [inline]
COrder() | COrder | [inline]
InvokeShip(long lFlags) | COrder | [private]
InvokeShip(long lFlags) | COrder | [private]
InvokeShipIDispatch(IUnknown *punk, long lFlags) | COrder | [private]
InvokeShipIDispatch(IUnknown *punk, long lFlags) | COrder | [private]
InvokeShipVtable(IUnknown *punk, long lFlags) | COrder | [private]
InvokeShipVtable(IUnknown *punk, long lFlags) | COrder | [private]
LineItem(long lItemId, long lQuantity) | COrder |
LineItem(long lItemId, long lQuantity) | COrder |
m_lCustomerId | COrder | [private]
m_lOrderId | COrder | [private]
m_veclItemId | COrder | [private]
m_veclQuantity | COrder | [private]
Process(long lFlags) | COrder |
Process(long lFlags) | COrder |
put_CustomerId(long lCustomerId) | COrder |
put_CustomerId(long lCustomerId) | COrder |
put_OrderId(long lOrderId) | COrder |
put_OrderId(long lOrderId) | COrder |
WriteOrderDB() | COrder | [private]
WriteOrderDB() | COrder | [private]
Generated on Wed Nov 13 2024 16:57:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/atl/StdAfx.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX
  • atl

StdAfx.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // stdafx.cpp : source file that includes just the standard includes
00020 //  stdafx.pch will be the pre-compiled header
00021 //  stdafx.obj will contain the pre-compiled type information
00022
00023 #include "stdafx.h"
00024
00025 #ifdef _ATL_STATIC_REGISTRY
00026 #include <statreg.h>
00027 #include <statreg.cpp>
00028 #endif
00029
00030 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/SignHash/SignHash.cpp Source File

  • Security
  • CryptoApi
  • SignHash

SignHash.cpp

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1996 - 2002.  Microsoft Corporation.  All rights reserved.
00008 */
00009
00010 #define UNICODE
00011 #define _UNICODE
00012 #define _WIN32_WINNT 0x0400
00013
00014 #include <windows.h>
00015 #include <tchar.h>
00016 #include <stdio.h>
00017 #include <strsafe.h> // for proper buffer handling
00018
00019 #define ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING)
00020
00021 const int BUFFER_SIZE = 4096;
00022
00023 #define CheckAndLocalFree(ptr) \
00024             if (ptr != NULL) \
00025             { \
00026                LocalFree(ptr); \
00027                ptr = NULL; \
00028             }
00029
00030 void __cdecl MyPrintf(LPCTSTR lpszFormat, ...);
00031 void PrintUsage();
00032 BOOL SignVerifyFile(HCRYPTPROV hProv,
00033                     HCRYPTKEY hPubKey,
00034                     DWORD dwKeySpec,
00035                     ALG_ID HashAlgId,
00036                     LPTSTR szFileToSign,
00037                     LPTSTR szSigFile,
00038                     BOOL fSign);
00039 BOOL GetRSAKeyFromCert(PCCERT_CONTEXT pCertContext,
00040                        BOOL fSign,
00041                        HCRYPTPROV *hProv,
00042                        HCRYPTKEY *hPubKey,
00043                        DWORD *dwKeySpec,
00044                        BOOL *fFreeProv);
00045 BOOL GetRSAKeyFromContainer(LPTSTR szContainerName,
00046                             DWORD dwAcquireFlags,
00047                             DWORD dwKeySpec,
00048                             HCRYPTPROV *hProv,
00049                             HCRYPTKEY *hPubKey);
00050 PCCERT_CONTEXT GetCertificateContextFromName(
00051                         LPTSTR lpszCertificateName,
00052                         LPTSTR lpszCertificateStoreName,
00053                         DWORD  dwCertStoreOpenFlags);
00054
00055 void _tmain(int argc, TCHAR *argv[])
00056 {
00057    HCRYPTPROV hProv = NULL;
00058    HCRYPTKEY hPubKey = NULL;
00059    PCCERT_CONTEXT pCertContext = NULL;
00060    LPTSTR szCertificateName = NULL;
00061    LPTSTR szStoreName = NULL;
00062    LPTSTR szContainerName = NULL;
00063    LPTSTR szFileToSign = NULL;
00064    LPTSTR szSigFile = NULL;
00065    DWORD dwOpenFlags = CERT_SYSTEM_STORE_CURRENT_USER;
00066    DWORD dwAcquireFlags = 0;
00067    DWORD dwKeySpec = AT_SIGNATURE;
00068    ALG_ID AlgId;
00069    BOOL fSign = FALSE;
00070    BOOL fResult = FALSE;
00071    BOOL fUseCert = FALSE;
00072    BOOL fFreeProv = FALSE;
00073
00074    if (argc != 9)
00075    {
00076       PrintUsage();
00077       return;
00078    }
00079
00080    __try
00081    {
00082       // Determine hash algorithm
00083       if (lstrcmpi(argv[1], _T("sha1")) == 0)
00084       {
00085          AlgId = CALG_SHA1;
00086       }
00087       else if (lstrcmpi(argv[1], _T("md5")) == 0)
00088       {
00089          AlgId = CALG_MD5;
00090       }
00091       else
00092       {
00093          PrintUsage();
00094          return;
00095       }
00096
00097       /* Check whether the action to be performed is to sign or verify */
00098       if (lstrcmpi(argv[2], _T("/s")) == 0)
00099       {
00100          fSign = TRUE;
00101       }
00102       else if (lstrcmpi(argv[2], _T("/v")) == 0)
00103       {
00104          fSign = FALSE;
00105       }
00106       else
00107       {
00108          PrintUsage();
00109          return;
00110       }
00111
00112       szFileToSign = argv[3];
00113       szSigFile = argv[4];
00114
00115       // check to see if user wants to use a certificate
00116       if (lstrcmpi(argv[5], _T("/cert")) == 0)
00117       {
00118          fUseCert = TRUE;
00119
00120          szCertificateName = argv[6];
00121          szStoreName = argv[7];
00122
00123          // Determine if we have to use user or machine store
00124          if (lstrcmpi(argv[8], _T("u")) == 0)
00125          {
00126             dwOpenFlags = CERT_SYSTEM_STORE_CURRENT_USER;
00127          }
00128          else if (lstrcmpi(argv[8], _T("m")) == 0)
00129          {
00130             dwOpenFlags = CERT_SYSTEM_STORE_LOCAL_MACHINE;
00131          }
00132          else
00133          {
00134             PrintUsage();
00135             return;
00136          }
00137       }
00138       else if (lstrcmpi(argv[5], _T("/key")) == 0)
00139       {
00140          fUseCert = FALSE;
00141
00142          szContainerName = argv[6];
00143
00144          if (lstrcmpi(argv[7], _T("u")) == 0)
00145          {
00146             dwAcquireFlags = 0;
00147          }
00148          else if (lstrcmpi(argv[7], _T("m")) == 0)
00149          {
00150             dwAcquireFlags = CRYPT_MACHINE_KEYSET;
00151          }
00152          else
00153          {
00154             PrintUsage();
00155             return;
00156          }
00157
00158          // Use exchange key or signature key
00159          if (lstrcmpi(argv[8], _T("x")) == 0)
00160          {
00161             dwKeySpec = AT_KEYEXCHANGE;
00162          }
00163          else if (lstrcmpi(argv[8], _T("s")) == 0)
00164          {
00165             dwKeySpec = AT_SIGNATURE;
00166          }
00167          else
00168          {
00169             PrintUsage();
00170             return;
00171          }
00172       }
00173       else
00174       {
00175          PrintUsage();
00176          return;
00177       }
00178
00179       if (fUseCert)
00180       {
00181          pCertContext = GetCertificateContextFromName(szCertificateName,
00182                                                       szStoreName,
00183                                                       dwOpenFlags);
00184          if (!pCertContext) __leave;
00185
00186          fResult = GetRSAKeyFromCert(pCertContext,
00187                                      fSign,
00188                                      &hProv,
00189                                      &hPubKey,
00190                                      &dwKeySpec,
00191                                      &fFreeProv);
00192          if (!fResult) __leave;
00193       }
00194       else
00195       {
00196          fResult = GetRSAKeyFromContainer(szContainerName,
00197                                           dwAcquireFlags,
00198                                           dwKeySpec,
00199                                           &hProv,
00200                                           &hPubKey);
00201          if (!fResult) __leave;
00202
00203          fFreeProv = TRUE;
00204       }
00205
00206       fResult = SignVerifyFile(hProv,
00207                                hPubKey,
00208                                dwKeySpec,
00209                                AlgId,
00210                                szFileToSign,
00211                                szSigFile,
00212                                fSign);
00213       if (!fResult) __leave;
00214
00215       if (fSign)
00216       {
00217          MyPrintf(_T("File %s hashed and signed successfully!\n"), szFileToSign);
00218       }
00219       else
00220       {
00221          MyPrintf(_T("File %s verified successfully!\n"), szSigFile);
00222       }
00223    }
00224    __finally
00225    {
00226       // Clean up
00227       if (hPubKey != NULL) CryptDestroyKey(hPubKey);
00228       if (fFreeProv && (hProv != NULL)) CryptReleaseContext(hProv, 0);
00229       if (pCertContext != NULL) CertFreeCertificateContext(pCertContext);
00230    }
00231 }
00232
00233 BOOL SignVerifyFile(HCRYPTPROV hProv,
00234                     HCRYPTKEY hPubKey,
00235                     DWORD dwKeySpec,
00236                     ALG_ID HashAlgId,
00237                     LPTSTR szFileToSign,
00238                     LPTSTR szSigFile,
00239                     BOOL fSign)
00240 {
00241    HCRYPTHASH hHash = NULL;
00242    HANDLE hDataFile = INVALID_HANDLE_VALUE;
00243    HANDLE hSigFile = INVALID_HANDLE_VALUE;
00244    LPBYTE pbSignature = NULL;
00245    DWORD dwSignature;
00246    BYTE pbBuffer[BUFFER_SIZE];
00247    DWORD dwBytesRead, dwBytesWritten;
00248    BOOL fResult;
00249    BOOL fFinished = FALSE;
00250    BOOL fReturn = FALSE;
00251
00252    __try
00253    {
00254       // Open Data file
00255       hDataFile = CreateFile(szFileToSign,
00256                              GENERIC_READ,
00257                              0,
00258                              NULL,
00259                              OPEN_EXISTING,
00260                              FILE_ATTRIBUTE_NORMAL,
00261                              NULL);
00262       if (hDataFile == INVALID_HANDLE_VALUE)
00263       {
00264          MyPrintf(_T("CreateFile failed with %d\n"), GetLastError());
00265          __leave;
00266       }
00267
00268       // Open/Create signature file
00269       hSigFile = CreateFile(szSigFile,
00270                             GENERIC_READ|GENERIC_WRITE,
00271                             0,
00272                             NULL,
00273                             OPEN_ALWAYS,
00274                             FILE_ATTRIBUTE_NORMAL,
00275                             NULL);
00276       if (hSigFile == INVALID_HANDLE_VALUE)
00277       {
00278          MyPrintf(_T("CreateFile failed with %d\n"), GetLastError());
00279          __leave;
00280       }
00281
00282       // Create Hash
00283       fResult = CryptCreateHash(hProv, HashAlgId, 0, 0, &hHash);
00284       if (!fResult)
00285       {
00286          MyPrintf(_T("CryptCreateHash failed with %x\n"), GetLastError());
00287          __leave;
00288       }
00289
00290       // Loop through file and hash file contents
00291       do
00292       {
00293          dwBytesRead = 0;
00294
00295          fResult = ReadFile(hDataFile, pbBuffer, BUFFER_SIZE, &dwBytesRead, NULL);
00296
00297          if (dwBytesRead == 0) break;
00298
00299          if (!fResult)
00300          {
00301             MyPrintf(_T("ReadFile failed with %d\n"), GetLastError());
00302             __leave;
00303          }
00304
00305          fFinished = (dwBytesRead < BUFFER_SIZE);
00306
00307          fResult = CryptHashData(hHash, pbBuffer, dwBytesRead, 0);
00308          if (!fResult)
00309          {
00310             MyPrintf(_T("CryptHashData failed with %x\n"), GetLastError());
00311             __leave;
00312          }
00313
00314       } while (fFinished == FALSE);
00315
00316       if (fSign)
00317       {
00318          // Get Signature size
00319          fResult = CryptSignHash(hHash, dwKeySpec, NULL, 0, NULL, &dwSignature);
00320          if (!fResult)
00321          {
00322             MyPrintf(_T("CryptSignHash failed with %x\n"), GetLastError());
00323             __leave;
00324          }
00325
00326          // Allocate signature bytes
00327          pbSignature = (LPBYTE)LocalAlloc(LPTR, dwSignature);
00328          if (!pbSignature)
00329          {
00330             MyPrintf(_T("LocalAlloc failed with %d\n"), GetLastError());
00331             __leave;
00332          }
00333
00334          // Sign and get back signature
00335          fResult = CryptSignHash(hHash, dwKeySpec, NULL, 0, pbSignature, &dwSignature);
00336          if (!fResult)
00337          {
00338             MyPrintf(_T("CryptSignHash failed with %x\n"), GetLastError());
00339             __leave;
00340          }
00341
00342          // Write signature to file
00343          fResult = WriteFile(hSigFile, pbSignature, dwSignature, &dwBytesWritten, NULL);
00344          if (!fResult)
00345          {
00346             MyPrintf(_T("WriteFile failed with %d\n"), GetLastError());
00347             __leave;
00348          }
00349       }
00350       else
00351       {
00352          // Get size of signature file
00353          dwSignature = GetFileSize(hSigFile, NULL);
00354          if (dwSignature == INVALID_FILE_SIZE)
00355          {
00356             MyPrintf(_T("GetFileSize failed with %d\n"), GetLastError());
00357             __leave;
00358          }
00359
00360          // Allocate signature bytes
00361          pbSignature = (LPBYTE)LocalAlloc(LPTR, dwSignature);
00362          if (!pbSignature)
00363          {
00364             MyPrintf(_T("LocalAlloc failed with %d\n"), GetLastError());
00365             __leave;
00366          }
00367
00368          // Read Signature
00369          fResult = ReadFile(hSigFile, pbSignature, dwSignature, &dwBytesRead, NULL);
00370          if (!fResult)
00371          {
00372             MyPrintf(_T("ReadFile failed with %d\n"), GetLastError());
00373             __leave;
00374          }
00375
00376          // Verify Signature
00377          fResult = CryptVerifySignature(hHash, pbSignature, dwSignature, hPubKey, NULL, 0);
00378          if (!fResult)
00379          {
00380             MyPrintf(_T("CryptVerifySignature failed with %x\n"), GetLastError());
00381             __leave;
00382          }
00383       }
00384
00385       fReturn = TRUE;
00386    }
00387    __finally
00388    {
00389       // Clean up
00390       if (hHash != NULL) CryptDestroyHash(hHash);
00391       if (hDataFile != INVALID_HANDLE_VALUE) CloseHandle(hDataFile);
00392       if (hSigFile != INVALID_HANDLE_VALUE) CloseHandle(hSigFile);
00393       CheckAndLocalFree(pbSignature);
00394    }
00395
00396    return fReturn;
00397 }
00398
00399 PCCERT_CONTEXT GetCertificateContextFromName(
00400                         LPTSTR lpszCertificateName,
00401                         LPTSTR lpszCertificateStoreName,
00402                         DWORD  dwCertStoreOpenFlags)
00403 {
00404    PCCERT_CONTEXT pCertContext = NULL;
00405    HCERTSTORE hCertStore = NULL;
00406    LPSTR szStoreProvider;
00407    DWORD dwFindType;
00408
00409 #ifdef UNICODE
00410    szStoreProvider = (LPSTR)CERT_STORE_PROV_SYSTEM_W;
00411 #else
00412    szStoreProvider = (LPSTR)CERT_STORE_PROV_SYSTEM_A;
00413 #endif
00414
00415       // Open the specified certificate store
00416    hCertStore = CertOpenStore(szStoreProvider,
00417                               0,
00418                               NULL,
00419                               dwCertStoreOpenFlags|
00420                               CERT_STORE_READONLY_FLAG,
00421                               lpszCertificateStoreName);
00422    if (hCertStore == NULL)
00423    {
00424       MyPrintf(_T("CertOpenStore failed with %X\n"), GetLastError());
00425       return pCertContext;
00426    }
00427
00428 #ifdef UNICODE
00429    dwFindType = CERT_FIND_SUBJECT_STR_W;
00430 #else
00431    dwFindType = CERT_FIND_SUBJECT_STR_A;
00432 #endif
00433
00434    // Find the certificate by CN.
00435    pCertContext = CertFindCertificateInStore(hCertStore,
00436                                              ENCODING,
00437                                              0,
00438                                              dwFindType,
00439                                              lpszCertificateName,
00440                                              NULL);
00441    if (pCertContext == NULL)
00442    {
00443       MyPrintf(_T("CertFindCertificateInStore failed with %X\n"), GetLastError());
00444    }
00445
00446    CertCloseStore(hCertStore, 0);
00447
00448    return pCertContext;
00449 }
00450
00451 BOOL GetRSAKeyFromCert(PCCERT_CONTEXT pCertContext,
00452                        BOOL fSign,
00453                        HCRYPTPROV *hProv,
00454                        HCRYPTKEY *hPubKey,
00455                        DWORD *dwKeySpec,
00456                        BOOL *fFreeProv)
00457 {
00458    BOOL fResult;
00459    BOOL fReturn = FALSE;
00460
00461    __try
00462    {
00463       if (hProv == NULL || hPubKey == NULL ||
00464           dwKeySpec == NULL || fFreeProv == NULL)
00465       {
00466          __leave;
00467       }
00468
00469       *hProv = 0;
00470       *hPubKey = 0;
00471       *fFreeProv = FALSE;
00472
00473       if (fSign)
00474       {
00475          // Acquire the certificate's private key
00476          fResult = CryptAcquireCertificatePrivateKey(pCertContext,
00477                                                      CRYPT_ACQUIRE_USE_PROV_INFO_FLAG|
00478                                                      CRYPT_ACQUIRE_COMPARE_KEY_FLAG,
00479                                                      NULL,
00480                                                      hProv,
00481                                                      dwKeySpec,
00482                                                      fFreeProv);
00483          if (!fResult)
00484          {
00485             MyPrintf(_T("CryptAcquireCertificatePrivateKey failed with %x\n"), GetLastError());
00486             __leave;
00487          }
00488       }
00489       else
00490       {
00491          fResult = CryptAcquireContext(hProv,
00492                                        NULL,
00493                                        MS_DEF_PROV,
00494                                        PROV_RSA_FULL,
00495                                        CRYPT_VERIFYCONTEXT);
00496          if (!fResult)
00497          {
00498             MyPrintf(_T("CryptAcquireContext failed with %x\n"), GetLastError());
00499             __leave;
00500          }
00501
00502          *fFreeProv = TRUE;
00503
00504          // Import the public key from the certificate so we can verify
00505          fResult = CryptImportPublicKeyInfo(*hProv,
00506                                             ENCODING,
00507                                             &(pCertContext->pCertInfo->SubjectPublicKeyInfo),
00508                                             hPubKey);
00509          if (!fResult)
00510          {
00511             MyPrintf(_T("CryptImportPublicKeyInfo failed with %x\n"), GetLastError());
00512             __leave;
00513          }
00514       }
00515
00516       fReturn = TRUE;
00517    }
00518    __finally
00519    {
00520       if (!fReturn)
00521       {
00522          if (*hPubKey != NULL)
00523          {
00524             CryptDestroyKey(*hPubKey);
00525             *hPubKey = NULL;
00526          }
00527
00528          if ((*fFreeProv == TRUE) && (*hProv != NULL))
00529          {
00530             CryptReleaseContext(*hProv, 0);
00531             *hProv = NULL;
00532             *fFreeProv = FALSE;
00533          }
00534       }
00535    }
00536
00537    return fReturn;
00538 }
00539
00540 BOOL GetRSAKeyFromContainer(LPTSTR szContainerName,
00541                             DWORD dwAcquireFlags,
00542                             DWORD dwKeySpec,
00543                             HCRYPTPROV *hProv,
00544                             HCRYPTKEY *hPubKey)
00545 {
00546    BOOL fResult;
00547    BOOL fReturn = FALSE;
00548
00549    __try
00550    {
00551       if (hProv == NULL || hPubKey == NULL)
00552       {
00553          __leave;
00554       }
00555
00556       // acquire crypto context using container name
00557       fResult = CryptAcquireContext(hProv,
00558                                     szContainerName,
00559                                     MS_DEF_PROV,
00560                                     PROV_RSA_FULL,
00561                                     dwAcquireFlags);
00562       if (!fResult)
00563       {
00564          MyPrintf(_T("CryptAcquireContext failed with %x\n"), GetLastError());
00565          __leave;
00566       }
00567
00568       // Get the key handle for verification
00569       fResult = CryptGetUserKey(*hProv, dwKeySpec, hPubKey);
00570       if (!fResult)
00571       {
00572          MyPrintf(_T("CryptGetUserKey failed with %x\n"), GetLastError());
00573          __leave;
00574       }
00575
00576       fReturn = TRUE;
00577    }
00578    __finally
00579    {
00580       if (!fReturn)
00581       {
00582          if (*hPubKey != NULL)
00583          {
00584             CryptDestroyKey(*hPubKey);
00585             *hPubKey = NULL;
00586          }
00587
00588          if (*hProv != NULL)
00589          {
00590             CryptReleaseContext(*hProv, 0);
00591             *hProv = NULL;
00592          }
00593       }
00594    }
00595
00596    return fReturn;
00597 }
00598
00599 void __cdecl MyPrintf(LPCTSTR lpszFormat, ...)
00600 {
00601    TCHAR szOutput[2048];
00602    va_list v1 = NULL;
00603    HRESULT hr = S_OK;
00604
00605    va_start(v1, lpszFormat);
00606    hr = StringCbVPrintf(szOutput, sizeof(szOutput), lpszFormat, v1);
00607    if (SUCCEEDED(hr))
00608    {
00609       OutputDebugString(szOutput);
00610       _tprintf(szOutput);
00611    }
00612    else
00613    {
00614       _tprintf(_T("StringCbVPrintf failed with %X\n"), hr);
00615    }
00616 }
00617
00618 void PrintUsage()
00619 {
00620    MyPrintf(_T("SignHash [md5|sha1] [</s>|</v>] <DataFile> <SigFile> [</cert>|</key>]\n"));
00621    MyPrintf(_T("/s to Sign.\n"));
00622    MyPrintf(_T("/v to Verify.\n"));
00623    MyPrintf(_T("/cert <CertName> <StoreName> [<u>|<m>] - use a certificate.\n"));
00624    MyPrintf(_T("/key <ContainerName> [<u>|<m>] [<x>|<s>] use container with exchange or signature key.\n"));
00625 }
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkHitTest/InkHitTest.cs Source File

  • TabletPC
  • InkHitTest

InkHitTest.cs

Go to the documentation of this file.
00001 //
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 //  File: InkHitTest.cs
00012 //  Ink Hit Test Sample Application
00013 //
00014 //  This sample illustrates two techniques for finding ink given a
00015 //  screen location:
00016 //
00017 //      1. Hit Testing:  The hit testing mode determines whether
00018 //         a collection of strokes is either completely inside or
00019 //         intersected by a circular cursor.  When a hit occurs, the
00020 //         circular cursor changes from black to red.
00021 //
00022 //      2. Nearest Point:  The nearest point mode calculates the
00023 //         the point on a stroke within an Ink object that is
00024 //         nearest to the cursor's location.  The sample displays
00025 //         a red line connecting the cursor to this point.
00026 //
00027 //  The features used are: InkCollector, Ink.HitTest,Ink.NearestPoint.
00028 //
00029 //--------------------------------------------------------------------------
00030
00031 using System;
00032 using System.Drawing;
00033 using System.Windows.Forms;
00034
00035 // The Ink namespace, which contains the Tablet PC Platform API
00036 using Microsoft.Ink;
00037
00038 namespace InkHitTest
00039 {
00040
00041     /// <summary>
00042     /// Enumeration of all possible application modes:
00043     ///
00044     ///   Ink:             The user is drawing new strokes
00045     ///   HitTest:         The user is performing hit testing
00046     ///   NearestPoint:    The app should calculate the nearest point
00047     ///
00048     /// </summary>
00049     public enum ApplicationMode
00050             {
00051                 None = 0,
00052                 Ink = 1,
00053                 HitTest = 2,
00054                 NearestPoint = 3
00055     };
00056
00057     /// <summary>
00058     /// The InkHitTest Sample Application form class
00059     /// </summary>
00060     public class InkHitTest : System.Windows.Forms.Form
00061     {
00062
00063         // --------------- Constants ---------------
00064
00065         // The radius of the circle used for hit testing
00066         // in pixels.
00067         private const int HitSize = 30;
00068
00069         // --------------- Fields ---------------
00070
00071         // The inkcollector is the central object for ink support.
00072         // Through this object, we will collect ink and then get access
00073         // to it via the Ink object.
00074         private InkCollector ic;
00075
00076         // The pen that is currently used for drawing
00077         private Pen     activePen;
00078
00079         // Black and red pens used for drawing
00080         private Pen     blackPen;
00081         private Pen     redPen;
00082
00083         // Stores the current location of the pen
00084         private Point   penPt = Point.Empty;
00085
00086         // Stores the current nearest point (when applicable)
00087         private Point   nearestPt = Point.Empty;
00088
00089         // Stores the region of the screen that needs to be invalidated
00090         private Rectangle invalidateRect;
00091
00092         private ApplicationMode mode;
00093
00094         #region Standard Template Code
00095         private System.Windows.Forms.MainMenu mainMenu1;
00096         private System.Windows.Forms.MenuItem FileItem;
00097         private System.Windows.Forms.MenuItem ModeItem;
00098         private System.Windows.Forms.MenuItem ClearItem;
00099         private System.Windows.Forms.MenuItem InkItem;
00100         private System.Windows.Forms.MenuItem HitTestItem;
00101         private System.Windows.Forms.MenuItem NearestPointItem;
00102         private System.Windows.Forms.MenuItem miExit;
00103
00104         /// <summary>
00105         /// Required designer variable.
00106         /// </summary>
00107         private System.ComponentModel.Container components = null;
00108         #endregion
00109
00110         public InkHitTest()
00111         {
00112             #region Standard Template Code
00113             //
00114             // Required for Windows Form Designer support
00115             //
00116             InitializeComponent();
00117             #endregion
00118         }
00119
00120         # region Standard Template Code
00121         /// <summary>
00122         /// Clean up any resources being used.
00123         /// </summary>
00124         protected override void Dispose( bool disposing )
00125         {
00126             if( disposing )
00127             {
00128                 if (components != null)
00129                 {
00130                     components.Dispose();
00131                 }
00132             }
00133             base.Dispose( disposing );
00134         }
00135         #endregion
00136
00137         #region Windows Form Designer generated code
00138         /// <summary>
00139         /// Required method for Designer support - do not modify
00140         /// the contents of this method with the code editor.
00141         /// </summary>
00142         private void InitializeComponent()
00143         {
00144             this.mainMenu1 = new System.Windows.Forms.MainMenu();
00145             this.FileItem = new System.Windows.Forms.MenuItem();
00146             this.miExit = new System.Windows.Forms.MenuItem();
00147             this.ModeItem = new System.Windows.Forms.MenuItem();
00148             this.InkItem = new System.Windows.Forms.MenuItem();
00149             this.HitTestItem = new System.Windows.Forms.MenuItem();
00150             this.NearestPointItem = new System.Windows.Forms.MenuItem();
00151             this.ClearItem = new System.Windows.Forms.MenuItem();
00152             //
00153             // mainMenu1
00154             //
00155             this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00156                                                                                       this.FileItem,
00157                                                                                       this.ModeItem,
00158                                                                                       this.ClearItem});
00159             //
00160             // FileItem
00161             //
00162             this.FileItem.Index = 0;
00163             this.FileItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00164                                                                                      this.miExit});
00165             this.FileItem.Text = "&File";
00166
00167             //
00168             // miExit
00169             //
00170             this.miExit.Index = 0;
00171             this.miExit.Text = "E&xit";
00172             this.miExit.Click += new System.EventHandler(this.miExit_Click);
00173             //
00174             // ModeItem
00175             //
00176             this.ModeItem.Index = 1;
00177             this.ModeItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00178                                                                                      this.InkItem,
00179                                                                                      this.HitTestItem,
00180                                                                                      this.NearestPointItem});
00181             this.ModeItem.Text = "&Mode";
00182             //
00183             // InkItem
00184             //
00185             this.InkItem.Checked = true;
00186             this.InkItem.Index = 0;
00187             this.InkItem.Text = "&Ink";
00188             this.InkItem.Click += new System.EventHandler(this.enterInkMode);
00189             //
00190             // HitTestItem
00191             //
00192             this.HitTestItem.Index = 1;
00193             this.HitTestItem.Text = "&Hit Test";
00194             this.HitTestItem.Click += new System.EventHandler(this.enterHitTestMode);
00195             //
00196             // NearestPointItem
00197             //
00198             this.NearestPointItem.Index = 2;
00199             this.NearestPointItem.Text = "&Nearest Point";
00200             this.NearestPointItem.Click += new System.EventHandler(this.enterNearestPointMode);
00201             //
00202             // ClearItem
00203             //
00204             this.ClearItem.Index = 2;
00205             this.ClearItem.Text = "&Clear!";
00206             this.ClearItem.Click += new System.EventHandler(this.onClearClick);
00207             //
00208             // InkHitTest
00209             //
00210             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00211             this.ClientSize = new System.Drawing.Size(292, 245);
00212             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
00213             this.MaximizeBox = false;
00214             this.Menu = this.mainMenu1;
00215             this.Name = "InkHitTest";
00216             this.Text = "Tablet PC InkHitTest Sample";
00217             this.Load += new System.EventHandler(this.InkHitTest_Load);
00218             this.Paint += new System.Windows.Forms.PaintEventHandler(this.InkHitTestForm_Paint);
00219             this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.onMouseMove);
00220
00221         }
00222         #endregion
00223
00224         #region Standard Template Code
00225         /// <summary>
00226         /// The main entry point for the application.
00227         /// </summary>
00228         [STAThread]
00229         static void Main()
00230         {
00231             Application.Run(new InkHitTest());
00232         }
00233         #endregion
00234
00235         // --------------- Form Events ---------------
00236
00237         /// <summary>
00238         /// Event Handler from Form Load Event
00239         /// Setup the ink collector for collection
00240         /// </summary>
00241         /// <param name="sender">The control that raised the event.</param>
00242         /// <param name="e">The event arguments.</param>
00243         private void InkHitTest_Load(object sender, System.EventArgs e)
00244         {
00245             //
00246             // Setup some useful objects for drawing
00247             //
00248             activePen = blackPen = new Pen(Color.Black, 3);
00249             redPen = new Pen(Color.Red, 3);
00250             invalidateRect = new Rectangle(0,0,0,0);
00251
00252             //
00253             // Create the InkCollector, and turn it on
00254             //
00255             ic = new InkCollector(Handle);  // attach it to the form's frame window
00256
00257             // default to inking mode
00258             mode = ApplicationMode.Ink;
00259
00260             // turn the collector on
00261             ic.Enabled = true;
00262
00263         }
00264
00265         /// <summary>
00266         /// Event Handler from Form Mouse Move Event
00267         /// Handle Mouse/Pen movement. If we are not in ink mode, then we will
00268         /// be doing either nearest point or hit test computations.
00269         /// </summary>
00270         /// <param name="sender">The control that raised the event.</param>
00271         /// <param name="e">The event arguments.</param>
00272         private void onMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
00273         {
00274             // Update the location of the pen
00275             penPt.X = e.X;
00276             penPt.Y = e.Y;
00277
00278             if ( mode == ApplicationMode.HitTest)
00279             {
00280                 handleHitTest(e);
00281             }
00282             else if (mode == ApplicationMode.NearestPoint)
00283             {
00284                 handleNearestPoint(e);
00285             }
00286         }
00287
00288         /// <summary>
00289         /// Event Handler from Form Paint Event
00290         ///
00291         /// This sample has a very straightforward repaint algorithm.  We "know" at
00292         /// all times how to paint the control.  Since AutoRedraw is on by default,
00293         /// the ink will take care of painting itself.
00294         ///
00295         /// That leaves just repaints of the circle hit test cursor or the nearest point
00296         /// line.  To simplify redraw, we just remember a "bounding box" for the area that
00297         /// we paint in the invalidateRect member variable.  We will invalidate this region
00298         /// each time something new happens.
00299         ///
00300         /// </summary>
00301         /// <param name="sender">The control that raised the event.</param>
00302         /// <param name="e">The event arguments.</param>
00303         private void InkHitTestForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
00304         {
00305             if( mode == ApplicationMode.HitTest)
00306             {
00307                 e.Graphics.DrawEllipse(activePen, penPt.X - HitSize/2, penPt.Y - HitSize/2, HitSize, HitSize);
00308             }
00309             else if( mode == ApplicationMode.NearestPoint )
00310             {
00311                 e.Graphics.DrawLine(redPen, penPt, nearestPt);
00312             }
00313         }
00314
00315         /// <summary>
00316         /// Event Handler from Form Paint Event
00317         /// Clears all of the ink in the form
00318         /// </summary>
00319         /// <param name="sender">The control that raised the event.</param>
00320         /// <param name="e">The event arguments.</param>
00321         private void onClearClick(object sender, System.EventArgs e)
00322         {
00323             // Retrieve all strokes in the ink object
00324             Strokes strokesToDelete = ic.Ink.Strokes;
00325
00326             // Check to ensure that the ink collector isn't currently
00327             // in the middle of a stroke before clearing the ink.
00328             // Deleting a stroke that is currently being collected
00329             // will result in an error condition.
00330             if (!ic.CollectingInk)
00331             {
00332
00333                 // Delete the strokes from the ink object
00334                 ic.Ink.DeleteStrokes(strokesToDelete);
00335
00336                 // Put the application in ink mode
00337                 enterInkMode(sender, e);
00338
00339                 //go ahead and redraw the form, now that it has been cleared.
00340                 Refresh();
00341             }
00342             else
00343             {
00344                 MessageBox.Show("Cannot clear ink while the ink collector is busy");
00345             }
00346         }
00347
00348         /// <summary>
00349         /// Event Handler from Mode->Ink Menu Item
00350         /// Helper function to enter Ink mode.
00351         /// In this mode, the user can draw ink.
00352         /// </summary>
00353         /// <param name="sender">The control that raised the event.</param>
00354         /// <param name="e">The event arguments.</param>
00355         private void enterInkMode(object sender, System.EventArgs e)
00356         {
00357
00358             clearCheck();
00359             mode = ApplicationMode.Ink;
00360             InkItem.Checked = true;
00361             ic.Enabled = true;
00362
00363             Invalidate(invalidateRect);
00364         }
00365
00366         /// <summary>
00367         /// Event Handler from Mode->Hit Test Menu Item
00368         /// Helper function to enter HitTest mode.
00369         /// In this mode, we highlight the cursor when it is over
00370         /// an ink stroke.
00371         /// </summary>
00372         /// <param name="sender">The control that raised the event.</param>
00373         /// <param name="e">The event arguments.</param>
00374         private void enterHitTestMode(object sender, System.EventArgs e)
00375         {
00376             Cursor = System.Windows.Forms.Cursors.Cross;
00377
00378             // Turn off the ink collector and set flags enable the hit
00379             // test code.
00380             clearCheck();
00381             mode = ApplicationMode.HitTest;
00382             HitTestItem.Checked = true;
00383             ic.Enabled = false;
00384
00385             Invalidate(invalidateRect);
00386         }
00387
00388         /// <summary>
00389         /// Event Handler from Mode->Nearest Point Menu Item
00390         /// Helper function to enter NearestPoint mode.
00391         /// In this mode, we draw a line to the nearest point in the ink
00392         /// from the current location of the cursor.
00393         /// </summary>
00394         /// <param name="sender">The control that raised the event.</param>
00395         /// <param name="e">The event arguments.</param>
00396         private void enterNearestPointMode(object sender, System.EventArgs e)
00397         {
00398             Cursor = System.Windows.Forms.Cursors.Default;
00399
00400             // Turn off the ink collector and set flags to enable
00401             // the nearest point code
00402             clearCheck();
00403             mode = ApplicationMode.NearestPoint;
00404             NearestPointItem.Checked = true;
00405             ic.Enabled = false;
00406
00407             Invalidate(invalidateRect);
00408         }
00409
00410         /// <summary>
00411         /// Event Handler from File->Exit Menu Item
00412         /// </summary>
00413         /// <param name="sender">The control that raised the event.</param>
00414         /// <param name="e">The event arguments.</param>
00415         private void miExit_Click(object sender, System.EventArgs e)
00416         {
00417             // Although not required, it is good practice to disable
00418             // ink collection before exiting
00419             ic.Enabled = false;
00420             Application.Exit();
00421         }
00422
00423         // --------------- Helper Methods ---------------
00424
00425         /// <summary>
00426         ///  small helper method to clear the Mode menu
00427         ///  check marks
00428         /// </summary>
00429         private void clearCheck()
00430         {
00431             switch(mode)
00432             {
00433                 case ApplicationMode.Ink:
00434                     InkItem.Checked = false;
00435                     break;
00436                 case ApplicationMode.HitTest:
00437                     HitTestItem.Checked = false;
00438                     break;
00439                 case ApplicationMode.NearestPoint:
00440                     NearestPointItem.Checked = false;
00441                     break;
00442             }
00443
00444             mode = ApplicationMode.None;
00445         }
00446
00447         /// <summary>
00448         ///  Helper method implementing the hit test functionality
00449         /// </summary>
00450         /// <param name="e">The mouse event args from MouseMove</param>
00451         private void handleHitTest(System.Windows.Forms.MouseEventArgs e)
00452         {
00453             // remember two points:
00454             // 1.  the location of the pen
00455             // 2.  the location that is HitSize/2 pixels across from the pen
00456             //     location.  This will be the radius of our hit test area.
00457             Point pt1 = new Point(e.X, e.Y);
00458             Point pt2 = new Point(e.X + HitSize/2, e.Y);
00459
00460             // Convert these points into ink space coordinates.  Recall that ink is
00461             // kept in a high dpi "ink space" by default.  Thus, we need to map
00462             // screen pixel locations to their corresponding locations in ink
00463             // space.  The distance between the X coordinates will be used to compute
00464             // the ink space radius of the hit test circle.  We can make this simplification
00465             // as long as the renderer has a scalar transformation (it wouldn't work if a
00466             // shear or rotation transformation had been applied to the renderer).
00467             //
00468             // For simplicity, we are assuming "square" pixels in this example.  As a result,
00469             // the hit test 'circle' will really be an ellispe on most monitors.  Applications
00470             // wishing to draw true circles, etc. will want to take the screen aspect ratio
00471             // into account for their pixel computations.
00472             Graphics g = CreateGraphics();
00473             ic.Renderer.PixelToInkSpace(g, ref pt1);
00474             ic.Renderer.PixelToInkSpace(g, ref pt2);
00475             g.Dispose();
00476
00477             // Retrieve the strokes (if any) that are either completely inside or
00478             // intersected by the circular region around the pen.
00479             //
00480             // Note that this method takes the stroke's drawing attributes into account
00481             // when it computes the intersection, including the pen width, Bezier smoothing,
00482             // and shape of the pen tip.
00483             Strokes strokes = ic.Ink.HitTest(pt1, (float)(pt2.X - pt1.X));
00484
00485             if( strokes.Count > 0 )
00486             {
00487                 activePen = redPen;
00488             }
00489             else
00490             {
00491                 activePen = blackPen;
00492             }
00493
00494             // Clear out the previous drawing and trigger a draw
00495             Invalidate(invalidateRect);
00496
00497             invalidateRect.X = e.X - HitSize/2;
00498             invalidateRect.Y = e.Y - HitSize/2;
00499             invalidateRect.Width = invalidateRect.Height = HitSize;
00500
00501             // Since the hit test circle has thickness, it is necessary
00502             // to inflate the invalidation area to account for it (the
00503             // invalidation area is the hit test area + the pen width).
00504             invalidateRect.Inflate((int)activePen.Width, (int)activePen.Width);
00505
00506             Invalidate(invalidateRect);
00507         }
00508
00509         /// <summary>
00510         ///  Helper function implementing the nearest point functionality
00511         /// </summary>
00512         /// <param name="e">The mouse event args from MouseMove</param>
00513         private void handleNearestPoint(System.Windows.Forms.MouseEventArgs e)
00514         {
00515             Graphics g = CreateGraphics();
00516
00517             // Remeber pen location
00518             Point inkPenPt = new Point(e.X, e.Y);
00519
00520             // Convert the pen location into a location in ink space
00521             ic.Renderer.PixelToInkSpace(g, ref inkPenPt);
00522
00523             // Get the nearest point.  NearestPoint will return the
00524             // stroke *and* the index of the actual location within
00525             // the stroke.
00526             //
00527             // The location is represented as a floating point value.
00528             // 3.3 for example, would indicate that the nearest point
00529             // is 30% along the vector between point index 3 and point
00530             // index 4 in the stroke.
00531
00532             float fIndex;
00533             Stroke stroke = ic.Ink.NearestPoint(inkPenPt, out fIndex);
00534
00535             // Provided that the stroke isn't null, use the fIndex to
00536             // compute the ink space coordinates of the nearest point.
00537             if( stroke != null )
00538             {
00539
00540                 // If the findex lies directly over one of the stroke's
00541                 // points, retrieve the coordinates of this point.
00542                 if ((int)fIndex == fIndex)
00543                 {
00544                     Point pt = stroke.GetPoint((int)fIndex);
00545
00546                     nearestPt = new Point(pt.X, pt.Y);
00547                 }
00548                     // Otherwise, it is necessary to approximate the coordinates
00549                     // of the stroke using the points on the stroke that bound
00550                     // the nearest point findex
00551                 else
00552                 {
00553
00554                     // Retrieve the two points on the stroke on either side of
00555                     // the nearest point findex.
00556                     Point[] pts = stroke.GetPoints((int)fIndex, 2);
00557
00558                     // Since we already handled the case where the findex was directly
00559                     // over one of the stroke's points, the call above should always
00560                     // return two points.
00561                     if( pts.Length == 2 )
00562                     {
00563
00564                         // To compute the coordinates of the nearest point from
00565                         // the findex:  take the difference between the two points,
00566                         // scale it by the percentage offset, and then add the
00567                         // percentage offset back in.  This yeilds the following formula:
00568                         //
00569                         // X1 * p + X0 * q
00570                         // Y1 * p + Y0 * q
00571                         //
00572                         // Where:
00573                         // p == percentage offset from point 1
00574                         // q == percentage offset from point 2 (p-1)
00575                         //
00576                         float p = fIndex - (int)fIndex;
00577                         float q = 1F - p;
00578                         nearestPt = new Point((int)((float)(pts[1].X) * p + (float)(pts[0].X) * q),
00579                             (int)((float)(pts[1].Y) * p + (float)(pts[0].Y) * q ));
00580
00581                     }
00582                 }
00583             }
00584             else
00585             {
00586                 // if there is no ink on the page, just reference ourselves.
00587                 nearestPt = inkPenPt;
00588             }
00589
00590             // Now that we have the ink space coordinates of the nearest
00591             // point, convert it back into pixel coordinates.  Again, we
00592             // assume perfectly square pixels in this example for simplicity.
00593             ic.Renderer.InkSpaceToPixel(g, ref nearestPt);
00594
00595             // Clear out the previous drawing and trigger a draw
00596             Invalidate(invalidateRect);
00597
00598             invalidateRect.X = Math.Min(e.X, nearestPt.X);
00599             invalidateRect.Y = Math.Min(e.Y, nearestPt.Y);
00600             invalidateRect.Width = Math.Abs(e.X - nearestPt.X);
00601             invalidateRect.Height = Math.Abs(e.Y - nearestPt.Y);
00602
00603             // Since the red nearest point line has thickness, it is
00604             // necessary to inflate the invalidation area to account for it
00605             // (the invalidation area is the rectangle around the nearest point
00606             // line + the pen width).
00607             invalidateRect.Inflate((int)redPen.Width, (int)redPen.Width);
00608
00609             Invalidate(invalidateRect);
00610
00611             g.Dispose();
00612         }
00613     }
00614 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/Perfgen.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen

Perfgen.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1995 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     perfgen.c
00008
00009 Abstract:
00010
00011     This file implements an Extensible Performance Object that displays
00012     generated signals
00013
00014 Created:
00015
00016     Bob Watson  28-Jul-1995
00017
00018 Revision History
00019
00020
00021 --*/
00022
00023 //
00024 //  Include Files
00025 //
00026
00027 #include <windows.h>
00028 #include <string.h>
00029 #include <winperf.h>
00030 #include <math.h>
00031 #include "genctrs.h" // error message definition
00032 #include "perfmsg.h"
00033 #include "perfutil.h"
00034 #include "datagen.h"
00035
00036 //  define constant value counter's value here, any number will do.
00037
00038 #define CONSTANT_VALUE_VALUE    49
00039 //
00040 //  References to constants which initialize the Object type definitions
00041 //
00042
00043 extern SIGGEN_DATA_DEFINITION SigGenDataDefinition;
00044
00045 DWORD  dwOpenCount = 0;        // count of "Open" threads
00046 BOOL   bInitOK     = FALSE;    // true = DLL initialized OK
00047
00048 //
00049 //  Function Prototypes
00050 //
00051 //      these are used to insure that the data collection functions
00052 //      accessed by Perflib will have the correct calling format.
00053 //
00054
00055 PM_OPEN_PROC    OpenSigGenPerformanceData;
00056 PM_COLLECT_PROC CollectSigGenPerformanceData;
00057 PM_CLOSE_PROC   CloseSigGenPerformanceData;
00058
00059 typedef struct _WAVE_DATA {
00060     DWORD   dwPeriod;
00061     DWORD   dwAmplitude;
00062     LPWSTR  szInstanceName;
00063 } WAVE_DATA, * PWAVE_DATA;
00064
00065 static WAVE_DATA wdInstance[]  =
00066 {
00067     {1000,      100, L"  1 Second"},
00068     {10000,     100, L" 10 Second"},
00069     {20000,     100, L" 20 Second"},
00070     {50000,     100, L" 50 Second"},
00071     {100000,    100, L"100 Second"}
00072 };
00073
00074 static const DWORD NUM_INSTANCES = (sizeof(wdInstance) / sizeof(wdInstance[0]));
00075 static double      dPi           = 3.1415926590;
00076 static double      d2Pi          = 2.0 * 3.1415926590;
00077
00078 static
00079 DWORD
00080 GetTimeInMilliSeconds()
00081 {
00082     SYSTEMTIME  st;
00083     DWORD       dwReturn;
00084
00085     GetSystemTime (& st);
00086     dwReturn  = (DWORD) st.wMilliseconds;
00087     dwReturn += (DWORD) st.wSecond *  1000L;
00088     dwReturn += (DWORD) st.wMinute * 60000L;
00089     dwReturn += (DWORD) st.wHour * 3600000L;
00090     dwReturn += (DWORD) st.wDay * 86500000L;
00091
00092     // that's good enough for what it's for
00093
00094     return dwReturn;
00095 }
00096
00097 DWORD APIENTRY
00098 OpenSigGenPerformanceData(
00099     LPWSTR lpDeviceNames
00100 )
00101
00102 /*++
00103
00104 Routine Description:
00105
00106     This routine will initialize the data structures used to pass
00107     data back to the registry
00108
00109 Arguments:
00110
00111     Pointer to object ID of each device to be opened (PerfGen)
00112
00113 Return Value:
00114
00115     None.
00116
00117 --*/
00118
00119 {
00120     LONG  status;
00121     HKEY  hKeyDriverPerf = NULL;
00122     DWORD size;
00123     DWORD type;
00124     DWORD dwFirstCounter;
00125     DWORD dwFirstHelp;
00126
00127     //
00128     //  Since WINLOGON is multi-threaded and will call this routine in
00129     //  order to service remote performance queries, this library
00130     //  must keep track of how many times it has been opened (i.e.
00131     //  how many threads have accessed it). the registry routines will
00132     //  limit access to the initialization routine to only one thread
00133     //  at a time so synchronization (i.e. reentrancy) should not be
00134     //  a problem
00135     //
00136
00137     if (! dwOpenCount) {
00138         // open Eventlog interface
00139
00140         hEventLog = MonOpenEventLog();
00141
00142         // get counter and help index base values from registry
00143         //      Open key to registry entry
00144         //      read First Counter and First Help values
00145         //      update static data strucutures by adding base to
00146         //          offset value in structure.
00147
00148         status = RegOpenKeyEx(
00149                         HKEY_LOCAL_MACHINE,
00150                         "SYSTEM\\CurrentControlSet\\Services\\PerfGen\\Performance",
00151                         0L,
00152                         KEY_READ,
00153                         & hKeyDriverPerf);
00154         if (status != ERROR_SUCCESS) {
00155             REPORT_ERROR_DATA (GENPERF_UNABLE_OPEN_DRIVER_KEY, LOG_USER,
00156                 &status, sizeof(status));
00157             // this is fatal, if we can't get the base values of the
00158             // counter or help names, then the names won't be available
00159             // to the requesting application  so there's not much
00160             // point in continuing.
00161             goto OpenExitPoint;
00162         }
00163
00164         size = sizeof(DWORD);
00165         status = RegQueryValueEx(
00166                         hKeyDriverPerf,
00167                         "First Counter",
00168                         0L,
00169                         & type,
00170                         (LPBYTE) & dwFirstCounter,
00171                         & size);
00172         if (status != ERROR_SUCCESS) {
00173             REPORT_ERROR_DATA (GENPERF_UNABLE_READ_FIRST_COUNTER, LOG_USER,
00174                 &status, sizeof(status));
00175             // this is fatal, if we can't get the base values of the
00176             // counter or help names, then the names won't be available
00177             // to the requesting application  so there's not much
00178             // point in continuing.
00179             goto OpenExitPoint;
00180         }
00181
00182         size = sizeof(DWORD);
00183         status = RegQueryValueEx(
00184                         hKeyDriverPerf,
00185                         "First Help",
00186                         0L,
00187                         & type,
00188                         (LPBYTE) & dwFirstHelp,
00189                         & size);
00190         if (status != ERROR_SUCCESS) {
00191             REPORT_ERROR_DATA (GENPERF_UNABLE_READ_FIRST_HELP, LOG_USER,
00192                 &status, sizeof(status));
00193             // this is fatal, if we can't get the base values of the
00194             // counter or help names, then the names won't be available
00195             // to the requesting application  so there's not much
00196             // point in continuing.
00197             goto OpenExitPoint;
00198         }
00199
00200         //
00201         //  NOTE: the initialization program could also retrieve
00202         //      LastCounter and LastHelp if they wanted to do
00203         //      bounds checking on the new number. e.g.
00204         //
00205         //      counter->CounterNameTitleIndex += dwFirstCounter;
00206         //      if (counter->CounterNameTitleIndex > dwLastCounter) {
00207         //          LogErrorToEventLog (INDEX_OUT_OF_BOUNDS);
00208         //      }
00209
00210         SigGenDataDefinition.SigGenObjectType.ObjectNameTitleIndex  += dwFirstCounter;
00211         SigGenDataDefinition.SigGenObjectType.ObjectHelpTitleIndex  += dwFirstHelp;
00212
00213         // assign index of default counter (Sine Wave)
00214         SigGenDataDefinition.SigGenObjectType.DefaultCounter         = 0;
00215         SigGenDataDefinition.SineWaveDef.CounterNameTitleIndex      += dwFirstCounter;
00216         SigGenDataDefinition.SineWaveDef.CounterHelpTitleIndex      += dwFirstHelp;
00217         SigGenDataDefinition.TriangleWaveDef.CounterNameTitleIndex  += dwFirstCounter;
00218         SigGenDataDefinition.TriangleWaveDef.CounterHelpTitleIndex  += dwFirstHelp;
00219         SigGenDataDefinition.SquareWaveDef.CounterNameTitleIndex    += dwFirstCounter;
00220         SigGenDataDefinition.SquareWaveDef.CounterHelpTitleIndex    += dwFirstHelp;
00221         SigGenDataDefinition.ConstantValueDef.CounterNameTitleIndex += dwFirstCounter;
00222         SigGenDataDefinition.ConstantValueDef.CounterHelpTitleIndex += dwFirstHelp;
00223
00224         bInitOK = TRUE; // ok to use this function
00225     }
00226
00227     dwOpenCount ++;  // increment OPEN counter
00228
00229     status = ERROR_SUCCESS; // for successful exit
00230
00231 OpenExitPoint:
00232     if (hKeyDriverPerf != NULL) RegCloseKey(hKeyDriverPerf);
00233     return status;
00234 }
00235
00236 DWORD APIENTRY
00237 CollectSigGenPerformanceData(
00238     IN      LPWSTR    lpValueName,
00239     IN OUT  LPVOID  * lppData,
00240     IN OUT  LPDWORD   lpcbTotalBytes,
00241     IN OUT  LPDWORD   lpNumObjectTypes
00242 )
00243 /*++
00244
00245 Routine Description:
00246
00247     This routine will return the data for the Signal Generator counters.
00248
00249 Arguments:
00250
00251    IN       LPWSTR   lpValueName
00252          pointer to a wide character string passed by registry.
00253
00254    IN OUT   LPVOID   *lppData
00255          IN: pointer to the address of the buffer to receive the completed
00256             PerfDataBlock and subordinate structures. This routine will
00257             append its data to the buffer starting at the point referenced
00258             by *lppData.
00259          OUT: points to the first byte after the data structure added by this
00260             routine. This routine updated the value at lppdata after appending
00261             its data.
00262
00263    IN OUT   LPDWORD  lpcbTotalBytes
00264          IN: the address of the DWORD that tells the size in bytes of the
00265             buffer referenced by the lppData argument
00266          OUT: the number of bytes added by this routine is writted to the
00267             DWORD pointed to by this argument
00268
00269    IN OUT   LPDWORD  NumObjectTypes
00270          IN: the address of the DWORD to receive the number of objects added
00271             by this routine
00272          OUT: the number of objects added by this routine is writted to the
00273             DWORD pointed to by this argument
00274
00275 Return Value:
00276
00277       ERROR_MORE_DATA if buffer passed is too small to hold data
00278          any error conditions encountered are reported to the event log if
00279          event logging is enabled.
00280
00281       ERROR_SUCCESS  if success or any other error. Errors, however are
00282          also reported to the event log.
00283
00284 --*/
00285 {
00286     //  Variables for reformating the data
00287
00288     PERF_INSTANCE_DEFINITION * pPerfInstanceDefinition;
00289     DWORD   dwThisInstance;
00290     ULONG   SpaceNeeded;
00291     SIGGEN_DATA_DEFINITION   * pSigGenDataDefinition;
00292     DWORD   dwQueryType;
00293     DWORD   dwTime;
00294     DWORD   dwPhase;
00295     double  dPhase, dSin;
00296     LONG    lValue;
00297     PSIGGEN_COUNTER   pSC;
00298
00299     //
00300     // before doing anything else, see if Open went OK
00301     //
00302     if (! bInitOK) {
00303         // unable to continue because open failed.
00304         * lpcbTotalBytes   = (DWORD) 0;
00305         * lpNumObjectTypes = (DWORD) 0;
00306         return ERROR_SUCCESS; // yes, this is a successful exit
00307     }
00308
00309     // see if this is a foreign (i.e. non-NT) computer data request
00310     //
00311     dwQueryType = GetQueryType(lpValueName);
00312
00313     if ((dwQueryType == QUERY_FOREIGN) || (dwQueryType == QUERY_COSTLY)) {
00314         // this routine does not service requests for data from
00315         // Non-NT computers
00316         * lpcbTotalBytes   = (DWORD) 0;
00317         * lpNumObjectTypes = (DWORD) 0;
00318         return ERROR_SUCCESS;
00319     }
00320
00321     if (dwQueryType == QUERY_ITEMS) {
00322     if (! (IsNumberInUnicodeList(SigGenDataDefinition.SigGenObjectType.ObjectNameTitleIndex, lpValueName))) {
00323             // request received for data object not provided by this routine
00324             * lpcbTotalBytes   = (DWORD) 0;
00325             * lpNumObjectTypes = (DWORD) 0;
00326             return ERROR_SUCCESS;
00327         }
00328     }
00329
00330     pSigGenDataDefinition = (SIGGEN_DATA_DEFINITION *) * lppData;
00331
00332     SpaceNeeded = sizeof(SIGGEN_DATA_DEFINITION) +
00333                     (NUM_INSTANCES * (sizeof(PERF_INSTANCE_DEFINITION) +
00334                     (24) +    // size of instance names
00335                     sizeof(SIGGEN_COUNTER)));
00336
00337     if (* lpcbTotalBytes < SpaceNeeded) {
00338         * lpcbTotalBytes   = (DWORD) 0;
00339         * lpNumObjectTypes = (DWORD) 0;
00340         return ERROR_MORE_DATA;
00341     }
00342
00343     // Get current time for this sample
00344     //
00345     dwTime = GetTimeInMilliSeconds();
00346     //
00347     // Copy the (constant, initialized) Object Type and counter definitions
00348     //  to the caller's data buffer
00349     //
00350     memmove(pSigGenDataDefinition, & SigGenDataDefinition, sizeof(SIGGEN_DATA_DEFINITION));
00351     //
00352     //    Create data for return for each instance
00353     //
00354     pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *) & pSigGenDataDefinition[1];
00355
00356     for (dwThisInstance = 0; dwThisInstance < NUM_INSTANCES; dwThisInstance ++) {
00357         MonBuildInstanceDefinition(
00358                         pPerfInstanceDefinition,
00359                         (PVOID *) & pSC,
00360                         0,
00361                         0,
00362                         (DWORD) -1, // use name
00363                         wdInstance[dwThisInstance].szInstanceName);
00364
00365         pSC->CounterBlock.ByteLength = sizeof (SIGGEN_COUNTER);
00366
00367         //**********************************************************
00368         //
00369         // for this particular example, the data is "created" here.
00370         // normally it would be read from the appropriate device or
00371         // application program.
00372         //
00373         //**********************************************************
00374
00375         // comput phase for this instance period
00376         dwPhase = dwTime % wdInstance[dwThisInstance].dwPeriod;
00377         //
00378         // compute sinewave value here
00379         //
00380         dPhase  = (double) dwPhase / (double) wdInstance[dwThisInstance].dwPeriod;
00381         dPhase *= d2Pi;
00382
00383         // the cosine function is used to keep the phase aligned with the
00384         // other wave forms
00385         dSin = -cos(dPhase);
00386         // adjust amplitude and add .5 to round to integer correctly
00387         dSin *= (double)((wdInstance[dwThisInstance].dwAmplitude) / 2.0) + 0.5;
00388
00389         lValue  = (LONG) dSin;
00390         lValue += wdInstance[dwThisInstance].dwAmplitude / 2;   // to move negative values above 0
00391
00392         // save sine value
00393         pSC->dwSineWaveValue = (DWORD) lValue;
00394
00395         // compute triangle wave value here
00396
00397         if (dwPhase < (wdInstance[dwThisInstance].dwPeriod / 2)) {
00398             lValue = (LONG)((dwPhase * wdInstance[dwThisInstance].dwAmplitude) / (wdInstance[dwThisInstance].dwPeriod / 2));
00399         } else {
00400             lValue = (LONG)(((wdInstance[dwThisInstance].dwPeriod - dwPhase) * wdInstance[dwThisInstance].dwAmplitude) /
00401                     (wdInstance[dwThisInstance].dwPeriod / 2));
00402         }
00403         // save triangle value
00404         pSC->dwTriangleWaveValue = (DWORD) lValue;
00405
00406         //
00407         //  compute square wave value
00408         //
00409         if (dwPhase <= (wdInstance[dwThisInstance].dwPeriod / 2)) {
00410             lValue = 0;
00411         } else {
00412             lValue = (LONG)wdInstance[dwThisInstance].dwAmplitude;
00413         }
00414         // save square value
00415         pSC->dwSquareWaveValue = (DWORD) lValue;
00416
00417         // finally the constant value (same fore every instance)
00418         pSC->dwConstantValue = (DWORD)CONSTANT_VALUE_VALUE;
00419
00420         // update instance pointer for next instance
00421         pPerfInstanceDefinition = (PERF_INSTANCE_DEFINITION *)&pSC[1];
00422     }
00423     // update arguments for return
00424
00425     * lppData = (PVOID) pPerfInstanceDefinition;
00426
00427     * lpNumObjectTypes = 1;
00428
00429     pSigGenDataDefinition->SigGenObjectType.TotalByteLength =
00430                     * lpcbTotalBytes = (DWORD) ((PBYTE) pPerfInstanceDefinition - (PBYTE) pSigGenDataDefinition);
00431
00432     // update instance count
00433     pSigGenDataDefinition->SigGenObjectType.NumInstances = NUM_INSTANCES;
00434
00435     return ERROR_SUCCESS;
00436 }
00437
00438 DWORD APIENTRY
00439 CloseSigGenPerformanceData(
00440 )
00441
00442 /*++
00443
00444 Routine Description:
00445
00446     This routine closes the open handles to the Signal Gen counters.
00447
00448 Arguments:
00449
00450     None.
00451
00452
00453 Return Value:
00454
00455     ERROR_SUCCESS
00456
00457 --*/
00458
00459 {
00460     if (! (-- dwOpenCount)) { // when this is the last thread...
00461         MonCloseEventLog();
00462     }
00463     return ERROR_SUCCESS;
00464
00465 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Commands.h Source File

  • WinUI
  • Shell
  • SampView

Commands.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Commands.h
00013
00014    Description:   Defines the private commands for this project.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    global variables and definitions
00020 **************************************************************************/
00021
00022 #define IDM_EXPLORE        1
00023 #define IDM_OPEN           2
00024 #define IDM_NEW            3
00025 #define IDM_NEW_FOLDER     4
00026 #define IDM_NEW_ITEM       5
00027 #define IDM_MODIFY_DATA    6
00028 #define IDM_RENAME         7
00029 #define IDM_DELETE         8
00030 #define IDM_COPY           9
00031 #define IDM_CUT            10
00032 #define IDM_PASTE          11
00033 #define IDM_SEPARATOR      12
00034 #define IDM_VIEW           13
00035 #define IDM_VIEW_LARGE     14
00036 #define IDM_VIEW_SMALL     15
00037 #define IDM_VIEW_LIST      16
00038 #define IDM_VIEW_DETAILS   17
00039
00040 #define IDM_LAST           17
00041
00042 //view menu items
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/StdAfx.h Source File

  • Com
  • Administration
  • Explore.VC

StdAfx.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 // stdafx.h : include file for standard system include files,
00020 //  or project specific include files that are used frequently, but
00021 //      are changed infrequently
00022 //
00023
00024 #if !defined(AFX_STDAFX_H__12723F29_B2F5_11D2_86A1_000000000000__INCLUDED_)
00025 #define AFX_STDAFX_H__12723F29_B2F5_11D2_86A1_000000000000__INCLUDED_
00026
00027 #if _MSC_VER > 1000
00028 #pragma once
00029 #endif // _MSC_VER > 1000
00030
00031 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00032
00033 #include <afxwin.h>         // MFC core and standard components
00034 #include <afxext.h>         // MFC extensions
00035 #include <afxdisp.h>        // MFC Automation classes
00036 #include <afxdtctl.h>   // MFC support for Internet Explorer 4 Common Controls
00037 #ifndef _AFX_NO_AFXCMN_SUPPORT
00038 #include <afxcmn.h>     // MFC support for Windows Common Controls
00039 #endif // _AFX_NO_AFXCMN_SUPPORT
00040
00041
00042 //{{AFX_INSERT_LOCATION}}
00043
00044 #include <commdlg.h>
00045 #include <comdef.h>
00046 #include <comadmin.h>
00047
00048 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00049
00050 #endif // !defined(AFX_STDAFX_H__12723F29_B2F5_11D2_86A1_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Simple/sserver/sserver.cpp Source File

  • Com
  • Fundamentals
  • DCom
  • Simple
  • sserver

sserver.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 // ===========================================================================
00019 // Description:
00020 //
00021 //  This is the server-portion of the SIMPLE Network OLE sample. This
00022 // application implements the CLSID_SimpleObject class as a LocalServer.
00023 // Instances of this class support a limited form of the IStream interface --
00024 // calls to IStream::Read and IStream::Write will "succeed" (they do nothing),
00025 // and calls on any other methods fail with E_NOTIMPL.
00026 //
00027 //  The purpose of this sample is to demonstrate what is minimally required
00028 // to implement an object that can be used by clients (both those on the same
00029 // machine using OLE and those using Network OLE across the network).
00030 //
00031 // Instructions:
00032 //
00033 //  To use this sample:
00034 //   * build it using the NMAKE command. NMAKE will create SSERVER.EXE and
00035 //     SCLIENT.EXE.
00036 //   * edit the SSERVER.REG file to make the LocalServer32 key point to the
00037 //     location of SSERVER.EXE, and run the INSTALL.BAT command (it simply
00038 //     performs REGEDIT SSERVER.REG)
00039 //   * run SSERVER.EXE. it should display the message "Waiting..."
00040 //   * run SCLIENT.EXE on the same machine using no command-line arguments,
00041 //     or from another machine using the machine-name (UNC or DNS) as the sole
00042 //     command-line argument. it will connect to the server, perform some read
00043 //     and write calls, and disconnect. both SSERVER.EXE and SCLIENT.EXE will
00044 //     automatically terminate. both applications will display some status text.
00045 //   * you can also run SCLIENT.EXE from a different machine without having first
00046 //     run SSERVER.EXE on the machine. in this case, SSERVER.EXE will be launched
00047 //     by OLE in the background and you will be able to watch the output of
00048 //     SCLIENT.EXE but the output of SSERVER.EXE will be hidden.
00049 //   * to examine the automatic launch-security features of Network OLE, try
00050 //     using the '...\CLSID\{...}\LaunchPermission = Y' key commented out in
00051 //     the SSERVER.REG file and reinstalling it. by setting different read-access
00052 //     privileges on this key (using the Security/Permissions... dialog in the
00053 //     REGEDT32 registry tool built into the system) you can allow other
00054 //     users to run the SCLIENT.EXE program from their accounts.
00055 //
00056 // Copyright 1996 Microsoft Corporation.  All Rights Reserved.
00057 // ===========================================================================
00058
00059 // %%Includes: ---------------------------------------------------------------
00060 #define INC_OLE2
00061 #define STRICT
00062 #include <stdio.h>
00063 #include <windows.h>
00064 #include <initguid.h>
00065
00066 // %%GUIDs: ------------------------------------------------------------------
00067 DEFINE_GUID(CLSID_SimpleObject, 0x5e9ddec7, 0x5767, 0x11cf, 0xbe, 0xab, 0x0, 0xaa, 0x0, 0x6c, 0x36, 0x6);
00068
00069 // %%Globals: ----------------------------------------------------------------
00070 HANDLE          hevtDone;
00071
00072 // %%Classes: ----------------------------------------------------------------
00073 // simple class-factory: only knows how to create CSimpleObject instances
00074 class CClassFactory : public IClassFactory {
00075   public:
00076     // IUnknown
00077     STDMETHODIMP    QueryInterface (REFIID riid, void** ppv);
00078     STDMETHODIMP_(ULONG) AddRef(void)  { return 1; };
00079     STDMETHODIMP_(ULONG) Release(void) { return 1; }
00080
00081     // IClassFactory
00082     STDMETHODIMP    CreateInstance (LPUNKNOWN punkOuter, REFIID iid, void **ppv);
00083     STDMETHODIMP    LockServer (BOOL fLock) { return E_FAIL; };
00084     };
00085
00086 // simple object supporting a dummy IStream
00087 class CSimpleObject : public IStream {
00088   public:
00089     // IUnknown
00090     STDMETHODIMP    QueryInterface (REFIID iid, void **ppv);
00091     STDMETHODIMP_(ULONG) AddRef(void)  { return InterlockedIncrement(&m_cRef); };
00092     STDMETHODIMP_(ULONG) Release(void) { if (InterlockedDecrement(&m_cRef) == 0) { delete this; return 0; } return 1; }
00093
00094     // IStream
00095     STDMETHODIMP    Read(void *pv, ULONG cb, ULONG *pcbRead);
00096     STDMETHODIMP    Write(VOID const *pv, ULONG cb, ULONG *pcbWritten);
00097     STDMETHODIMP    Seek(LARGE_INTEGER dbMove, DWORD dwOrigin, ULARGE_INTEGER *pbNewPosition)
00098         { return E_FAIL; }
00099     STDMETHODIMP    SetSize(ULARGE_INTEGER cbNewSize)
00100         { return E_FAIL; }
00101     STDMETHODIMP    CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
00102         { return E_FAIL; }
00103     STDMETHODIMP    Commit(DWORD grfCommitFlags)
00104         { return E_FAIL; }
00105     STDMETHODIMP    Revert(void)
00106         { return E_FAIL; }
00107     STDMETHODIMP    LockRegion(ULARGE_INTEGER bOffset, ULARGE_INTEGER cb, DWORD dwLockType)
00108         { return E_FAIL; }
00109     STDMETHODIMP    UnlockRegion(ULARGE_INTEGER bOffset, ULARGE_INTEGER cb, DWORD dwLockType)
00110         { return E_FAIL; }
00111     STDMETHODIMP    Stat(STATSTG *pstatstg, DWORD grfStatFlag)
00112         { return E_FAIL; }
00113     STDMETHODIMP    Clone(IStream **ppstm)
00114         { return E_FAIL; }
00115
00116     // constructors/destructors
00117     CSimpleObject()     { m_cRef = 1; }
00118     ~CSimpleObject()    { SetEvent(hevtDone); }
00119
00120   private:
00121     LONG        m_cRef;
00122     };
00123
00124 // %%Globals: ----------------------------------------------------------------
00125 CClassFactory   g_ClassFactory;
00126
00127 // ---------------------------------------------------------------------------
00128 // %%Function: Message
00129 //
00130 //  Formats and displays a message to the console.
00131 // ---------------------------------------------------------------------------
00132  void
00133 Message(LPTSTR szPrefix, HRESULT hr)
00134 {
00135     LPTSTR   szMessage;
00136
00137     if (hr == S_OK)
00138         {
00139         wprintf(szPrefix);
00140         wprintf(TEXT("\n"));
00141         return;
00142         }
00143
00144     if (HRESULT_FACILITY(hr) == FACILITY_WINDOWS)
00145         hr = HRESULT_CODE(hr);
00146
00147     FormatMessage(
00148         FORMAT_MESSAGE_ALLOCATE_BUFFER |
00149         FORMAT_MESSAGE_FROM_SYSTEM,
00150         NULL,
00151         hr,
00152         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00153         (LPTSTR)&szMessage,
00154         0,
00155         NULL );
00156
00157     wprintf(TEXT("%s: %s(%lx)\n"), szPrefix, szMessage, hr);
00158
00159     LocalFree(szMessage);
00160 }  // Message
00161
00162 // ---------------------------------------------------------------------------
00163 // %%Function: CSimpleObject::QueryInterface
00164 // ---------------------------------------------------------------------------
00165  STDMETHODIMP
00166 CSimpleObject::QueryInterface(REFIID riid, void** ppv)
00167 {
00168     if (ppv == NULL)
00169         return E_INVALIDARG;
00170     if (riid == IID_IUnknown || riid == IID_IStream)
00171         {
00172         *ppv = (IUnknown *) this;
00173         AddRef();
00174         return S_OK;
00175         }
00176     *ppv = NULL;
00177     return E_NOINTERFACE;
00178 }  // CSimpleObject::QueryInterface
00179
00180 // ---------------------------------------------------------------------------
00181 // %%Function: CSimpleObject::Read
00182 // ---------------------------------------------------------------------------
00183  STDMETHODIMP
00184 CSimpleObject::Read(void *pv, ULONG cb, ULONG *pcbRead)
00185 {
00186     Message(TEXT("Server: IStream:Read"), S_OK);
00187     if (!pv && cb != 0)
00188         return E_INVALIDARG;
00189
00190     // fill the buffer with FF's. we could read it from somewhere.
00191     if (cb != 0)
00192         memset(pv, 0xFF, cb);
00193
00194     if (pcbRead)
00195         *pcbRead = cb;
00196     return S_OK;
00197 }  // CSimpleObject::Read
00198
00199 // ---------------------------------------------------------------------------
00200 // %%Function: CSimpleObject::Write
00201 // ---------------------------------------------------------------------------
00202  STDMETHODIMP
00203 CSimpleObject::Write(VOID const *pv, ULONG cb, ULONG *pcbWritten)
00204 {
00205     Message(TEXT("Server: IStream:Write"), S_OK);
00206     if (!pv && cb != 0)
00207         return E_INVALIDARG;
00208     // ignore the data, but we could examine it or put it somewhere
00209     if (pcbWritten)
00210         *pcbWritten = cb;
00211     return S_OK;
00212 }  // CSimpleObject::Write
00213
00214 // ---------------------------------------------------------------------------
00215 // %%Function: CClassFactory::QueryInterface
00216 // ---------------------------------------------------------------------------
00217  STDMETHODIMP
00218 CClassFactory::QueryInterface(REFIID riid, void** ppv)
00219 {
00220     if (ppv == NULL)
00221         return E_INVALIDARG;
00222     if (riid == IID_IClassFactory || riid == IID_IUnknown)
00223         {
00224         *ppv = (IClassFactory *) this;
00225         AddRef();
00226         return S_OK;
00227         }
00228     *ppv = NULL;
00229     return E_NOINTERFACE;
00230 }  // CClassFactory::QueryInterface
00231
00232 // ---------------------------------------------------------------------------
00233 // %%Function: CClassFactory::CreateInstance
00234 // ---------------------------------------------------------------------------
00235  STDMETHODIMP
00236 CClassFactory::CreateInstance(LPUNKNOWN punkOuter, REFIID riid, void** ppv)
00237 {
00238     LPUNKNOWN   punk;
00239     HRESULT     hr;
00240
00241     *ppv = NULL;
00242
00243     if (punkOuter != NULL)
00244         return CLASS_E_NOAGGREGATION;
00245
00246     Message(TEXT("Server: IClassFactory:CreateInstance"), S_OK);
00247
00248     punk = new CSimpleObject;
00249
00250     if (punk == NULL)
00251         return E_OUTOFMEMORY;
00252
00253     hr = punk->QueryInterface(riid, ppv);
00254     punk->Release();
00255     return hr;
00256 }  // CClassFactory::CreateInstance
00257
00258 // ---------------------------------------------------------------------------
00259 // %%Function: main
00260 // ---------------------------------------------------------------------------
00261  void __cdecl
00262 main()
00263 {
00264     HRESULT hr;
00265     DWORD   dwRegister;
00266
00267     // create the thread which is signaled when the instance is deleted
00268     hevtDone = CreateEvent(NULL, FALSE, FALSE, NULL);
00269     if (hevtDone == NULL)
00270         {
00271         hr = HRESULT_FROM_WIN32(GetLastError());
00272         Message(TEXT("Server: CreateEvent"), hr);
00273         exit(hr);
00274         }
00275
00276     // initialize COM for free-threading
00277     hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00278     if (FAILED(hr))
00279         {
00280         Message(TEXT("Server: CoInitializeEx"), hr);
00281         exit(hr);
00282         }
00283
00284     // register the class-object with OLE
00285     hr = CoRegisterClassObject(CLSID_SimpleObject, &g_ClassFactory,
00286         CLSCTX_SERVER, REGCLS_SINGLEUSE, &dwRegister);
00287     if (FAILED(hr))
00288         {
00289         Message(TEXT("Server: CoRegisterClassObject"), hr);
00290         exit(hr);
00291         }
00292
00293     Message(TEXT("Server: Waiting"), S_OK);
00294
00295     // wait until an object is created and deleted.
00296     WaitForSingleObject(hevtDone, INFINITE);
00297
00298     CloseHandle(hevtDone);
00299
00300     CoUninitialize();
00301     Message(TEXT("Server: Done"), S_OK);
00302 }  // main
00303
00304 // EOF =======================================================================
00305
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/GridFont/Box.Cxx Source File

  • Multimedia
  • Gdi
  • Fonts
  • GridFont

Box.Cxx

Go to the documentation of this file.
00001 #include <windows.h>
00002 #include <windowsx.h>
00003 #include "app.h"
00004 #include "box.hxx"
00005
00006 CTextField::CTextField(TCHAR *sz)
00007 {
00008     _sz = sz;
00009 }
00010
00011 void CTextField::Paint(CCanvas &canvas, int x, int y)
00012 {
00013     SetTextAlign(canvas, TA_LEFT | TA_BASELINE );
00014     CFontSelect fs(canvas, _font);
00015     canvas.Text(x, y, _sz, lstrlen(_sz) );
00016 }
00017
00018 void CTextField::GetExtent(CCanvas &canvas, SIZE *pSize)
00019 {
00020     CFontSelect fs(canvas, _font);
00021     GetTextExtentPoint(canvas, _sz, lstrlen(_sz), pSize);
00022 }
00023
00024 void CTextField::SetFont(HFONT hfont)
00025 {
00026     _font = hfont;
00027 }
00028
00029 //-----------------------------------------------
00030 CBoxFormat::CBoxFormat(SIZE sizeChar) :
00031         _fontAlias(TEXT("Arial Narrow"), -10, FALSE),
00032 #ifdef CHARBITS
00033         _fontCtype(TEXT("Arial"), 12, TRUE, FALSE, TRUE)
00034 #else
00035         _fontCtype(TEXT("Arial"), 7, TRUE, FALSE, FALSE)
00036 #endif
00037
00038 {
00039     _size = sizeChar;
00040 }
00041
00042 //-----------------------------------------------
00043 CBox::CBox( CBoxFormat &bxf, UINT iChar, HFONT hfont ) :
00044         _fontBlock( hfont ),
00045         _Block(1, 1, iChar, bxf ),
00046         _bxf(bxf),
00047 #ifdef CHARBITS
00048         _Alias(TEXT("Character Type Bits:")),
00049
00050 #else
00051         _Alias(TEXT("Character Decomposition: ")),
00052 #endif
00053         _fuFormat(HEXADECIMAL)
00054 {
00055
00056     _fontBlock.Update( -40, TRUE);
00057     _Block.SetFont(_fontBlock);
00058
00059     _sizeBox.cx = bxf._size.cx+100; // shadow 100/20 poitns
00060     _sizeBox.cy = bxf._size.cy+100;
00061
00062 #ifdef UNICODE
00063     _sizeBox.cx += INCH4;
00064     _sizeBox.cy += INCH4;
00065 #endif
00066
00067
00068     _Alias.SetFont(bxf._fontAlias);
00069     _iChar = iChar;
00070 }
00071
00072
00073 void CBox::Paint(CCanvas &canvas, POINT pt, RECT rc)
00074 {
00075     int x = pt.x;
00076     int y = pt.y;
00077
00078 #ifdef UNICODE
00079     // adjust to length of header
00080
00081     SIZE size;
00082     _Alias.GetExtent(canvas, &size);
00083     _sizeBox.cx += size.cx;
00084 #endif
00085     // make rc large enough
00086     rc.left = pt.x;
00087     rc.top = pt.y;
00088     rc.right = pt.x+_sizeBox.cx-100;
00089     rc.bottom = pt.y+_sizeBox.cy-100;
00090
00091     OffsetRect( &rc, 100, 100 );
00092     FillRect(canvas, &rc, GetStockBrush(GRAY_BRUSH));
00093     OffsetRect( &rc, -100, -100 );
00094     FillRect(canvas, &rc, GetStockBrush(WHITE_BRUSH));
00095
00096 #ifdef UNICODE
00097     CBlackPen pen(canvas, PS_SOLID, 20);
00098     Rectangle(canvas, rc.left, rc.top, rc.right, rc.bottom);
00099
00100     pt.x += INCH8;
00101     pt.y += INCH8;
00102 #endif
00103
00104     _Block.SetFormat(_fuFormat);
00105     _Block.Paint(canvas, rc, pt);
00106
00107 #ifdef UNICODE
00108     _Alias.Paint(canvas, x+=(INCH1-INCH10), y+= INCH4);
00109     _Alias.GetExtent(canvas, &size);
00110
00111     pt.x = x;
00112     pt.y = y+INCH10;
00113
00114     USHORT uTemp[2]={_iChar, 0};
00115
00116     SetTextColor(canvas, RGB(0,128,0));
00117 #ifdef CHARBITS
00118
00119     USHORT uType[2];
00120
00121     for( int i = 0; i < 3; i++ )
00122     {
00123         pt.y += size.cy;
00124
00125         GetStringTypeW(1<<i, uTemp, 2, uType );
00126         CCodeGrid Ctype(1,1, size, uType[0]);
00127         Ctype.SetFont(_bxf._fontCtype);
00128         Ctype.SetFormat(HEXADECIMAL, 4);
00129         Ctype.Paint(canvas, rc, pt);
00130     }
00131 #else // ifdef DECOMP
00132     int cch =FoldString(MAP_COMPOSITE, (LPCTSTR) &_iChar, 1, NULL, 0);
00133
00134     LPTSTR pch = new TCHAR[cch];
00135     FoldString(MAP_COMPOSITE, (LPCTSTR) &_iChar, 1, pch, cch);
00136     SIZE sizedecomp;
00137     sizedecomp.cx = _bxf._size.cx/2;
00138     sizedecomp.cy = _bxf._size.cy/2;
00139     // pt.y += sizedecomp.cy;
00140
00141     CFont fontDecomp(_fontBlock);
00142     fontDecomp.Update(-20, TRUE);
00143
00144     for(int i=0; i < cch; i++ )
00145     {
00146         CCharGrid Decomp(1,1,sizedecomp, pch[i] );
00147         Decomp.SetCharTable();        // exclude char images not in font
00148         Decomp.SetFont(fontDecomp);
00149         Decomp.Paint(canvas, rc, pt);
00150
00151         CCodeGrid Code(1,1,sizedecomp, pch[i] );
00152                           // but don't exclude their code nums
00153         Code.SetFont(_bxf._fontCtype);
00154         Code.SetTextOrg(sizedecomp.cx/2, 9*sizedecomp.cy/10);
00155         Code.SetFormat(HEXADECIMAL, 4);
00156         Code.Paint(canvas, rc, pt);
00157
00158         pt.x += sizedecomp.cx;
00159     }
00160     delete pch;
00161 #endif
00162     SetTextColor(canvas, RGB(0,0,0));
00163 #endif
00164 }
00165
00166
00167 UINT CBox::Hittest(CCanvas &canvas, POINT pt)
00168 {
00169      return 0x00C5;
00170 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/about.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163         MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164         *lpDest = wszStr;
00165
00166
00167     return S_OK;
00168 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Comp.c Source File

  • WinUI
  • Input
  • Ime
  • IMEApps

Comp.c

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      COMP.C                                                        */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation                */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <imm.h>
00011 #include "resource.h"
00012 #include "imeapps.h"
00013
00014 #define DEBUG 1
00015
00016 LRESULT HandleStartComposition(HWND hWnd, WPARAM wParam, LPARAM lParam)
00017 {
00018     COMPOSITIONFORM cpf = {0};
00019     HIMC hIMC = NULL;
00020
00021 #ifdef DEBUG
00022     OutputDebugString("WM_STARTCOMPOSITIONSTRING!!!\r\n");
00023 #endif
00024
00025     if (fdwProperty & IME_PROP_SPECIAL_UI)
00026     {
00027         // Normally, we need to set the composition window
00028         // position to caret position for a special UI IME
00029     }
00030     else if (fdwProperty & IME_PROP_AT_CARET)
00031     {
00032         // If an application show composition string by itself, we do not
00033         // need to set the position of composition window for an at caret
00034         // IME.
00035
00036         return 1;
00037     }
00038     else
00039     {
00040         // Normally, we need to set the composition window
00041         // position to caret position for a near caret IME
00042     }
00043
00044     hIMC = ImmGetContext(hWnd);
00045
00046     if (!hIMC)
00047     {
00048         return 1;
00049     }
00050
00051     cpf.dwStyle = CFS_POINT;
00052     cpf.ptCurrentPos.x = ptImeUIPos.x;
00053     cpf.ptCurrentPos.y = ptImeUIPos.y;
00054
00055     ImmSetCompositionWindow(hIMC,&cpf);
00056
00057     ImmReleaseContext(hWnd,hIMC);
00058
00059     return 1;
00060 }
00061
00062 LRESULT HandleEndComposition(HWND hWnd, WPARAM wParam, LPARAM lParam)
00063 {
00064 #ifdef DEBUG
00065     OutputDebugString("WM_ENDCOMPOSITIONSTRING!!!\r\n");
00066 #endif
00067     dwCompStrLen      = 0;
00068     dwCompAttrLen     = 0;
00069     dwCompClsLen      = 0;
00070     dwCompReadStrLen  = 0;
00071     dwCompReadAttrLen = 0;
00072     dwCompReadClsLen  = 0;
00073     dwResultStrLen      = 0;
00074     dwResultClsLen      = 0;
00075     dwResultReadStrLen  = 0;
00076     dwResultReadClsLen  = 0;
00077     InvalidateRect(hWnd,NULL,TRUE);
00078
00079     return 1;
00080 }
00081
00082 void MakePaintString(HWND hWnd, LPMYSTR lpStr, DWORD dwStrLen, LPDWORD lpCls, DWORD dwClsLen, LPMYSTR lpPaintStr)
00083 {
00084     LPMYSTR lpPaintStart = lpPaintStr;
00085
00086     lpPaintStr += Mylstrlen(lpPaintStr);
00087
00088     if (dwStrLen)
00089     {
00090         if (dwClsLen)
00091         {
00092             lpCls[127] = 0;
00093
00094             while (*(lpCls+1) && *lpCls < dwStrLen)
00095             {
00096                 DWORD dwTextLen = *(lpCls+1) - *lpCls;
00097                 LPMYSTR lpT = lpStr + *lpCls;
00098
00099                 memcpy(lpPaintStr,lpT,dwTextLen * sizeof(MYCHAR));
00100                 lpPaintStr += dwTextLen;
00101                 *lpPaintStr = MYTEXT(',');
00102                 lpPaintStr++;
00103                 lpCls++;
00104             }
00105             *lpPaintStr = MYTEXT('\0');
00106         }
00107         else
00108         {
00109             Mylstrcpy(lpPaintStr,lpStr);
00110             Mylstrcat(lpPaintStr,MYTEXT(","));
00111         }
00112     }
00113
00114 }
00115
00116 LRESULT HandleComposition(HWND hWnd, WPARAM wParam, LPARAM lParam)
00117 {
00118     HIMC hIMC = NULL;
00119     BOOL fRedraw = FALSE;
00120
00121     hIMC = ImmGetContext(hWnd);
00122
00123     if (lParam & GCS_COMPSTR)
00124     {
00125         dwCompStrLen = MyImmGetCompositionString(hIMC,GCS_COMPSTR,szCompStr,sizeof(szCompStr));
00126         dwCompStrLen /= sizeof(MYCHAR);
00127         szCompStr[dwCompStrLen] = MYTEXT('\0');
00128         fRedraw = TRUE;
00129     }
00130     else
00131     {
00132         dwCompStrLen = 0;
00133         szCompStr[0] = MYTEXT('\0');
00134     }
00135
00136     if (lParam & GCS_COMPATTR)
00137     {
00138         dwCompAttrLen = MyImmGetCompositionString(hIMC,GCS_COMPATTR,bCompAttr,sizeof(bCompAttr));
00139         fRedraw = TRUE;
00140     }
00141     else
00142     {
00143         dwCompAttrLen = 0;
00144         bCompAttr[0] = 0;
00145     }
00146
00147     if (lParam & GCS_COMPCLAUSE)
00148     {
00149         dwCompClsLen = MyImmGetCompositionString(hIMC,GCS_COMPCLAUSE,dwCompCls,sizeof(dwCompCls));
00150         fRedraw = TRUE;
00151     }
00152     else
00153     {
00154         dwCompClsLen = 0;
00155         dwCompCls[0] = 0;
00156         dwCompCls[1] = 0;
00157     }
00158
00159
00160     if (lParam & GCS_COMPREADSTR)
00161     {
00162         dwCompReadStrLen = MyImmGetCompositionString(hIMC,GCS_COMPREADSTR,szCompReadStr,sizeof(szCompReadStr));
00163         dwCompReadStrLen /= sizeof(MYCHAR);
00164         szCompReadStr[dwCompReadStrLen] = MYTEXT('\0');
00165         fRedraw = TRUE;
00166     }
00167     else
00168     {
00169         dwCompReadStrLen = 0;
00170         szCompReadStr[0] = MYTEXT('\0');
00171     }
00172
00173     if (lParam & GCS_COMPREADATTR)
00174     {
00175         dwCompReadAttrLen = MyImmGetCompositionString(hIMC,GCS_COMPREADATTR,bCompReadAttr,sizeof(bCompReadAttr));
00176         fRedraw = TRUE;
00177     }
00178     else
00179     {
00180         dwCompReadAttrLen = 0;
00181         bCompReadAttr[0] = 0;
00182     }
00183
00184     if (lParam & GCS_COMPREADCLAUSE)
00185     {
00186         dwCompReadClsLen = MyImmGetCompositionString(hIMC,GCS_COMPREADCLAUSE,dwCompReadCls,sizeof(dwCompReadCls));
00187         fRedraw = TRUE;
00188     }
00189     else
00190     {
00191         dwCompReadClsLen = 0;
00192         dwCompReadCls[0] = 0;
00193         dwCompReadCls[1] = 0;
00194     }
00195
00196
00197     if (lParam & GCS_RESULTSTR)
00198     {
00199         RECT rc = {0};
00200         HDC hIC = NULL;
00201         SIZE sz0, sz1;
00202         HFONT hOldFont = NULL;
00203
00204         if (lParam & GCS_RESULTCLAUSE)
00205         {
00206             dwResultClsLen = MyImmGetCompositionString(hIMC,GCS_RESULTCLAUSE,dwResultCls,sizeof(dwResultCls));
00207         }
00208         else
00209         {
00210             dwResultClsLen = 0;
00211             dwResultCls[0] = 0;
00212             dwResultCls[1] = 0;
00213         }
00214
00215         dwResultStrLen = MyImmGetCompositionString(hIMC,GCS_RESULTSTR,szResultStr,sizeof(szResultStr));
00216         dwResultStrLen /= sizeof(MYCHAR);
00217         szResultStr[dwResultStrLen] = MYTEXT('\0');
00218
00219
00220         // szPaintResult may overflow..
00221         GetClientRect(hWnd,&rc);
00222         hIC = CreateIC("DISPLAY", NULL, NULL, NULL);
00223         hOldFont = SelectObject(hIC,hFont);
00224 #ifdef USEWAPI
00225         GetTextExtentPointW(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
00226         GetTextExtentPointW(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
00227 #else
00228         GetTextExtentPoint(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
00229         GetTextExtentPoint(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
00230 #endif
00231         if (sz0.cx + sz1.cx >= rc.right)
00232         {
00233             szPaintResult[0] = MYTEXT('\0');
00234             szPaintResultRead[0] = MYTEXT('\0');
00235         }
00236         SelectObject(hIC,hOldFont);
00237         DeleteDC(hIC);
00238
00239         MakePaintString(hWnd,szResultStr,dwResultStrLen,dwResultCls,dwResultClsLen,szPaintResult);
00240
00241         fRedraw = TRUE;
00242     }
00243     else
00244     {
00245         dwResultStrLen = 0;
00246         szResultStr[0] = MYTEXT('\0');
00247         dwResultClsLen = 0;
00248         dwResultCls[0] = 0;
00249         dwResultCls[1] = 0;
00250     }
00251
00252
00253
00254     if (lParam & GCS_RESULTREADSTR)
00255     {
00256         if (lParam & GCS_RESULTREADCLAUSE)
00257         {
00258             dwResultReadClsLen = MyImmGetCompositionString(hIMC,GCS_RESULTREADCLAUSE,dwResultReadCls,sizeof(dwResultReadCls));
00259             fRedraw = TRUE;
00260         }
00261         else
00262         {
00263             dwResultReadClsLen = 0;
00264             dwResultReadCls[0] = 0;
00265             dwResultReadCls[1] = 0;
00266         }
00267         dwResultReadStrLen = MyImmGetCompositionString(hIMC,GCS_RESULTREADSTR,szResultReadStr,sizeof(szResultReadStr));
00268         dwResultReadStrLen /= sizeof(MYCHAR);
00269         szResultReadStr[dwResultReadStrLen] = MYTEXT('\0');
00270         MakePaintString(hWnd,szResultReadStr,dwResultReadStrLen,dwResultReadCls,dwResultReadClsLen,szPaintResultRead);
00271         fRedraw = TRUE;
00272     }
00273     else
00274     {
00275         dwResultReadStrLen = 0;
00276         szResultReadStr[0] = MYTEXT('\0');
00277         dwResultReadClsLen = 0;
00278         dwResultReadCls[0] = 0;
00279         dwResultReadCls[1] = 0;
00280     }
00281
00282
00283
00284     if (fRedraw)
00285     {
00286         InvalidateRect(hWnd,NULL,TRUE);
00287         UpdateWindow(hWnd);
00288     }
00289     return 1;
00290 }
00291
00292
00293 LRESULT HandleChar(HWND hWnd, WPARAM wParam, LPARAM lParam)
00294 {
00295     RECT rc = {0};
00296     HDC hIC = NULL;
00297     SIZE sz0, sz1;
00298     HFONT hOldFont = NULL;
00299     LPMYSTR lp = NULL;
00300     // is the previous received char is a DBCS lead byte char ?
00301     static BOOL fIsPrevLeadByte = FALSE;
00302
00303     GetClientRect(hWnd,&rc);
00304     hIC = CreateIC("DISPLAY", NULL, NULL, NULL);
00305     hOldFont = SelectObject(hIC,hFont);
00306 #ifdef USEWAPI
00307     GetTextExtentPointW(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
00308     GetTextExtentPointW(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
00309 #else
00310     GetTextExtentPoint(hIC,szPaintResult,Mylstrlen(szPaintResult),&sz0);
00311     GetTextExtentPoint(hIC,szResultStr,Mylstrlen(szResultStr),&sz1);
00312 #endif
00313     if (sz0.cx + sz1.cx >= rc.right)
00314     {
00315         szPaintResult[0] = MYTEXT('\0');
00316         szPaintResultRead[0] = MYTEXT('\0');
00317     }
00318     SelectObject(hIC,hOldFont);
00319     DeleteDC(hIC);
00320
00321     lp = szPaintResult + Mylstrlen(szPaintResult);
00322
00323 #ifndef USEWAPI
00324     if (fIsPrevLeadByte)
00325     {
00326         // remove , and append second byte for showing DBCS char
00327         if (*(lp - 1) == ',')
00328         {
00329             lp--;
00330         }
00331     }
00332 #endif
00333
00334     // append second byte
00335     *lp++ = (MYCHAR)(BYTE)wParam;
00336     *lp++ = MYTEXT(',');
00337     *lp++ = MYTEXT('\0');
00338
00339     lp = szPaintResultRead + Mylstrlen(szPaintResultRead);
00340
00341 #ifndef USEWAPI
00342     if (fIsPrevLeadByte)
00343     {
00344         // remove , and append second byte for showing DBCS char
00345         if (*(lp - 1) == ',')
00346         {
00347             lp--;
00348         }
00349
00350         fIsPrevLeadByte = FALSE;
00351     }
00352     else
00353     {
00354         fIsPrevLeadByte = IsDBCSLeadByte((BYTE)wParam);
00355     }
00356 #endif
00357
00358     *lp++ = (BYTE)wParam;
00359     *lp++ = MYTEXT(',');
00360     *lp++ = MYTEXT('\0');
00361
00362     InvalidateRect(hWnd,NULL,TRUE);
00363     UpdateWindow(hWnd);
00364
00365     return 1;
00366 }
00367
00368
00369 LRESULT HandleNotify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00370 {
00371     HIMC hIMC = NULL;
00372     BOOL fOpen = FALSE;
00373     DWORD dwConvMode, dwSentMode;
00374
00375
00376     switch (wParam)
00377     {
00378         case IMN_OPENSTATUSWINDOW: /* fall-through */
00379         case IMN_CLOSESTATUSWINDOW:
00380             break;
00381
00382         case IMN_SETOPENSTATUS:
00383             SetStatusItems(hWnd);
00384
00385             hIMC = ImmGetContext(hWnd);
00386             fOpen = ImmGetOpenStatus(hIMC);
00387             UpdateShowOpenStatusButton(fOpen);
00388
00389             ImmReleaseContext(hWnd,hIMC);
00390             break;
00391
00392         case IMN_SETCONVERSIONMODE:
00393             hIMC = ImmGetContext(hWnd);
00394             fOpen = ImmGetOpenStatus(hIMC);
00395             ImmGetConversionStatus(hIMC,&dwConvMode,&dwSentMode);
00396             if (fOpen)
00397             {
00398                 SetConvModeParts(dwConvMode);
00399                 UpdateModeButton(dwConvMode);
00400             }
00401             else
00402             {
00403                 ClearConvModeParts();
00404             }
00405             ImmReleaseContext(hWnd,hIMC);
00406             break;
00407
00408         case IMN_OPENCANDIDATE:
00409             if (!fShowCand || (lParam != 0x01))
00410             {
00411                 if (fdwProperty & IME_PROP_SPECIAL_UI)
00412                 {
00413                     // Normally, we only need to set the composition window
00414                     // position for a special UI IME
00415                 }
00416                 else if (fdwProperty & IME_PROP_AT_CARET)
00417                 {
00418                     CANDIDATEFORM cdf;
00419                     HIMC          hIMC;
00420
00421                     hIMC = ImmGetContext(hWnd);
00422
00423                     cdf.dwIndex = 0;
00424                     cdf.dwStyle = CFS_CANDIDATEPOS;
00425                     cdf.ptCurrentPos.x = ptImeUIPos.x;
00426                     cdf.ptCurrentPos.y = ptImeUIPos.y;
00427                     ImmSetCandidateWindow(hIMC,&cdf);
00428
00429                     ImmReleaseContext(hWnd,hIMC);
00430                 }
00431                 else
00432                 {
00433                     // Normally, we only need to set the composition window
00434                     // position for a near caret IME
00435                 }
00436
00437                 return (DefWindowProc(hWnd, message, wParam, lParam));
00438             }
00439
00440         case IMN_CHANGECANDIDATE:
00441
00442 #ifdef _DEBUG
00443             {
00444                 char szDev[80];
00445                 DWORD dwSize;
00446                 LPCANDIDATELIST lpC;
00447
00448                 hIMC = ImmGetContext(hWnd);
00449                 if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
00450                 {
00451                     lpC = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);
00452
00453                     ImmGetCandidateList(hIMC,0x0,lpC,dwSize);
00454
00455                     OutputDebugString("DumpCandList!!!\r\n");
00456                     wsprintf((LPSTR)szDev,"dwCount %d\r\n",lpC->dwCount);
00457                     OutputDebugString((LPSTR)szDev);
00458                     wsprintf((LPSTR)szDev,"dwSelection %d\r\n",lpC->dwSelection);
00459                     OutputDebugString((LPSTR)szDev);
00460                     wsprintf((LPSTR)szDev,"dwPageStart %d\r\n",lpC->dwPageStart);
00461                     OutputDebugString((LPSTR)szDev);
00462                     wsprintf((LPSTR)szDev,"dwPageSize %d\r\n",lpC->dwPageSize);
00463                     OutputDebugString((LPSTR)szDev);
00464                     GlobalFree((HANDLE)lpC);
00465                 }
00466             }
00467 #endif
00468             if (fShowCand && (lParam == 0x01))
00469             {
00470                 DWORD dwSize;
00471
00472                 if (!lpCandList)
00473                     lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,sizeof(CANDIDATELIST));
00474
00475                 hIMC = ImmGetContext(hWnd);
00476                 if (dwSize = ImmGetCandidateList(hIMC,0x0,NULL,0))
00477                 {
00478                     GlobalFree((HANDLE)lpCandList);
00479                     lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,dwSize);
00480
00481                     ImmGetCandidateList(hIMC,0x0,lpCandList,dwSize);
00482                 }
00483                 else
00484                 {
00485                     memset(lpCandList, 0, sizeof(CANDIDATELIST));
00486                 }
00487
00488                 InvalidateRect(hWndCandList,NULL,TRUE);
00489                 UpdateWindow(hWndCandList);
00490
00491
00492                 ImmReleaseContext(hWnd,hIMC);
00493             }
00494             else
00495             {
00496                 return (DefWindowProc(hWnd, message, wParam, lParam));
00497             }
00498             break;
00499
00500         case IMN_CLOSECANDIDATE:
00501             if (fShowCand && (lParam == 0x01))
00502             {
00503                 if (!lpCandList)
00504                 {
00505                     lpCandList = (LPCANDIDATELIST)GlobalAlloc(GPTR,sizeof(CANDIDATELIST));
00506                 }
00507
00508                 memset(lpCandList, 0, sizeof(CANDIDATELIST));
00509                 InvalidateRect(hWndCandList,NULL,TRUE);
00510                 UpdateWindow(hWndCandList);
00511             }
00512             else
00513             {
00514                 return (DefWindowProc(hWnd, message, wParam, lParam));
00515             }
00516             break;
00517
00518
00519        default:
00520             return (DefWindowProc(hWnd, message, wParam, lParam));
00521     }
00522
00523     return 0;
00524 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/CStack.h Source File

  • NetDS
  • WinSock
  • Dt_Dll

CStack.h

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c) 1995 Intel Corp
00004
00005   Module Name:
00006
00007     cstack.h
00008
00009   Abstract:
00010
00011     Creates a subclass of Stack_c that can push and pop an integer
00012     counter onto or off a stack.
00013
00014 --*/
00015 #ifndef _CSTACKH_
00016 #define _CSTACKH_
00017
00018 #include "nowarn.h"  /* turn off benign warnings */
00019 #ifndef _WINSOCKAPI_
00020 #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
00021 #endif
00022 #include <windows.h>
00023 #include "nowarn.h"  /* some warnings may have been turned back on */
00024 #include "nideque.h"
00025 #include "stack.h"
00026
00027 class Cstack_c : private Stack_c<int> {
00028
00029 public:
00030     Cstack_c() : Stack_c<int>() { counter = 0; }
00031     ~Cstack_c()                 {}
00032     inline BOOL CPush()         {return Stack_c<int>::Push(counter++);}
00033     inline BOOL CPop(int &Data) {return Stack_c<int>::Pop(Data);}
00034     inline int  CGetCounter()   {return counter;}
00035     inline BOOL IsEmpty()       {return Stack_c<int>::IsEmpty();}
00036
00037 private:
00038     int counter;
00039 };
00040
00041 #endif
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/basesnap.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

basesnap.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  Abstract: This module provides the basic COM and DLL methods to create
00015 //            and load the Snap-in.  IClassFactory::CreateInstance creates
00016 //            an instance of a class whose type is passed in the constructor
00017 //
00018
00019
00020 #ifndef _BASESNAP_H_
00021 #define _BASESNAP_H_
00022
00023 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj);
00024 STDAPI DllCanUnloadNow(void);
00025
00026 //---------------------------------------------------------------------------
00027 class CClassFactory : public IClassFactory
00028 {
00029   public:
00030     enum FACTORY_TYPE {COMPONENTDATA = 0, ABOUT = 1};
00031
00032   public:
00033     CClassFactory(FACTORY_TYPE eFactoryType);
00034     ~CClassFactory();
00035
00036     STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv);
00037     STDMETHODIMP_(ULONG) AddRef();
00038     STDMETHODIMP_(ULONG) Release();
00039
00040     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID*);
00041     STDMETHODIMP LockServer(BOOL);
00042
00043   private:
00044     ULONG         m_cRef;
00045     FACTORY_TYPE  m_FactoryType;
00046
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSDKSamplePlaylistParser Member List

This is the complete list of members for CSDKSamplePlaylistParser, including all inherited members.
CSDKSamplePlaylistParser() | CSDKSamplePlaylistParser |
Initialize(IWMSCommandContext *pCommandContext, IWMSContext *pUserContext, IWMSContext *pPresentationContext, IWMSContext *pServerContext, IWMSNamedValues *pNamedValues, DWORD dwFlags, IWMSClassObject *pClassFactory) | CSDKSamplePlaylistParser |
m_spClassFactory | CSDKSamplePlaylistParser | [protected]
m_spCommandContext | CSDKSamplePlaylistParser | [protected]
m_spNamedValues | CSDKSamplePlaylistParser | [protected]
m_spPresentationContext | CSDKSamplePlaylistParser | [protected]
m_spServerContext | CSDKSamplePlaylistParser | [protected]
m_spUserContext | CSDKSamplePlaylistParser | [protected]
ReadPlaylist(INSSBuffer __RPC_FAR *pBuffer, IXMLDOMDocument __RPC_FAR *pPlayList, IWMSPlaylistParserCallback __RPC_FAR *pCallback, QWORD qwContext) | CSDKSamplePlaylistParser | [virtual]
ReadPlaylistFromDirectory(IWMSDirectory __RPC_FAR *pDirectory, LPWSTR pszwFilePattern, IXMLDOMDocument __RPC_FAR *pPlaylist, IWMSPlaylistParserCallback __RPC_FAR *pCallback, QWORD qwContext) | CSDKSamplePlaylistParser | [virtual]
Shutdown() | CSDKSamplePlaylistParser |
WritePlaylist(IXMLDOMDocument __RPC_FAR *pPlayList, IWMSPlaylistParserCallback __RPC_FAR *pCallback, QWORD qwContext) | CSDKSamplePlaylistParser | [virtual]
~CSDKSamplePlaylistParser() | CSDKSamplePlaylistParser | [virtual]
Generated on Wed Nov 13 2024 16:57:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Secure/secSvr.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • Secure

secSvr.Cpp

Go to the documentation of this file.
00001 // ===========================================================================
00002 // File: S E C S V R . C P P
00003 //
00004 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007 // PARTICULAR PURPOSE.
00008 //
00009 // Description:
00010 //
00011 //  This is the server-portion of the SECURE Network OLE sample. This
00012 // application implements several different server capabilities:
00013 //   * Free-threaded server implemented as a Service. The application
00014 //     implements a "LocalService" (CLSID_SecureObjectService) class.
00015 //   * Free-threaded server implemented as a standard executable. The
00016 //     application implements a "LocalServer32" (CLSID_SecureObject) class
00017 //     and runs without user-interface.
00018 //   * Apartment-threaded server implemented as a standard executable. The
00019 //     application implements a "LocalServer32" (CLSID_SecureObject) class
00020 //     and runs with a dialog-box user-interface showing the status of the
00021 //     objects that it has handed out to clients.
00022 //
00023 //  The purpose of this sample is to demonstrate the different packaging
00024 // options available to server writers, and to demonstrate call-security
00025 // capabilities.
00026 //
00027 // Instructions:
00028 //
00029 //  To use this sample:
00030 //   * build the samples using the NMAKE command. NMAKE will create SECCLNT.EXE,
00031 //     SECSVR.EXE, and PSMYPROP.DLL. PSMYPROP.DLL is the remoting proxies and
00032 //     stubs for the custom interface used between the client and the server.
00033 //   * install the server on the current machine or on a remote machine
00034 //     by running INSTALL.BAT in the same directory with SECSVR.EXE and
00035 //     PSMYPROP.DLL. This program registers the proxy-stub DLL using the
00036 //     REGSVR32 tool (included in the \mstools\bin directory of the SDK) and
00037 //     runs the SECSVR.EXE program with "-AutoRegister" on the command-line,
00038 //     which forces it to install itself.
00039 //   * to run the apartment-threaded server, use "SECSVR -Interactive" to launch
00040 //     the server from the command-line. the application will present UI allowing
00041 //     you to choose how to initialize security for the server process, and
00042 //     to view objects currently being used by clients.
00043 //   * In Section 1, choose the security parameters to CoInitializeSecurity from
00044 //     the two drop-down lists, and press the Initialize button.
00045 //   * next, run SECCLNT.EXE from the same machine or from a remote machine. Follow
00046 //     the instructions listed in SECCLNT.CPP to connect to this instance of the
00047 //     SECSVR.EXE application.
00048 //   * once a client has created an instance of the CLSID_SecureObject class, the
00049 //     object will be listed in the drop-down list in Section 2 of the SECSVR.EXE
00050 //     UI. Select the object to be viewed from this list. The current color and
00051 //     "name" established by the client will be displayed in Section 2.
00052 //   * use the "Lock" button to prevent the client from setting the color or "UserName"
00053 //     of the object. the client will display an "access-denied" message if it
00054 //     fails to set the color or "UserName". in the future this sample will include
00055 //     the ability to establish a security-descriptor on the color and Name, and
00056 //     will demonstrate impersonating the client and performing an AccessCheck()
00057 //     during the PutColor and PutUserName methods.
00058 //   * Push the "Exit" button in Section 1 to shut the server down.
00059 //
00060 // Copyright 1996 - 2000 Microsoft Corporation. All Rights Reserved.
00061 // ===========================================================================
00062
00063 // %%Includes: ---------------------------------------------------------------
00064 #define INC_OLE2
00065 #define STRICT
00066 #define UNICODE
00067 #include <windows.h>
00068 #include <initguid.h>
00069 #include "myprop.h"
00070 #include "secsvr.h"
00071
00072 // %%Macros: -----------------------------------------------------------------
00073 #define ENTRY(sz, val)      { sz, val }
00074 #define RGSIZEOF(rg)        (sizeof(rg)/sizeof((rg)[0]))
00075
00076 // %%Constants: --------------------------------------------------------------
00077 const TCHAR szServiceName[] = TEXT("SecSvr");
00078 const TCHAR szDescription[] = TEXT("Network OLE Security Sample");
00079 #define cAuthnLevelEntries  RGSIZEOF(rgAuthnLevelEntries)
00080 #define cImpLevelEntries    RGSIZEOF(rgImpLevelEntries)
00081
00082 // %%Types: ------------------------------------------------------------------
00083 typedef struct tagENTRY{
00084     TCHAR   *szName;
00085     DWORD   dwVal;
00086 } ENTRY, *PENTRY;
00087
00088 // %%Classes: ----------------------------------------------------------------
00089 class CClassFactory : public IClassFactory
00090     {
00091   // IClassFactory
00092     STDMETHODIMP            QueryInterface(REFIID iid, void **ppv);
00093     STDMETHODIMP_(ULONG)    AddRef(void)    { return 1; }
00094     STDMETHODIMP_(ULONG)    Release(void)   { return 1; }
00095     STDMETHODIMP            CreateInstance(LPUNKNOWN punkOuter, REFIID iid, LPVOID FAR *ppv);
00096     STDMETHODIMP            LockServer(BOOL fLock);
00097     };
00098
00099 class CSecureObject : public IMyProperties
00100     {
00101   // IUnknown
00102     STDMETHODIMP    QueryInterface(REFIID iid, void **ppv);
00103     STDMETHODIMP_(ULONG) AddRef(void)    { return InterlockedIncrement(&m_cRef); }
00104     STDMETHODIMP_(ULONG) Release(void)   { if (InterlockedDecrement(&m_cRef) == 0) { delete this; return 0; } return 1; }
00105
00106   // IMyProperties
00107     STDMETHODIMP    GetColor(COLORREF* pcr);
00108     STDMETHODIMP    PutColor(COLORREF cr);
00109     STDMETHODIMP    GetUserName(WCHAR szUserName[20]);
00110     STDMETHODIMP    PutUserName(WCHAR szUserName[20]);
00111
00112   // data members
00113     LONG        m_cRef;
00114   public:
00115     COLORREF    m_crColor;
00116     BOOL        m_fDenyPutColor;
00117     WCHAR       m_rgchUserName[20];
00118     BOOL        m_fDenyPutUserName;
00119
00120   // constructors/destructors
00121     CSecureObject();
00122     ~CSecureObject();
00123     };
00124
00125 // %%Prototypes: -------------------------------------------------------------
00126 void    MyServiceMain(DWORD cArg, LPTSTR *rgszArg);
00127 void    MyServiceHandler(DWORD dwControl);
00128 void    ErrorMessage(HWND hwnd, LPTSTR szFunction, HRESULT hr);
00129
00130 // %%Globals: ----------------------------------------------------------------
00131 CClassFactory   s_ClassFactory;
00132 struct {
00133     SERVICE_STATUS          Status;
00134     SERVICE_STATUS_HANDLE   hStatus;
00135     DWORD                   dwRegister;
00136     } s_Service;
00137 SERVICE_TABLE_ENTRY     s_rgsteServices[2] = { { (TCHAR*)szServiceName, MyServiceMain },
00138                 { NULL, NULL } };
00139 HWND            s_hwndDlg;
00140 UINT            s_cInstances;
00141 HANDLE          s_hevtDone;
00142 CRITICAL_SECTION s_csDone;
00143 BOOL            s_fDone, s_fServer, s_fService;
00144 ENTRY   rgAuthnLevelEntries[] = {
00145     ENTRY(TEXT("Default    "), RPC_C_AUTHN_DEFAULT),
00146     ENTRY(TEXT("None       "), RPC_C_AUTHN_LEVEL_NONE),
00147     ENTRY(TEXT("Connect    "), RPC_C_AUTHN_LEVEL_CONNECT),
00148     ENTRY(TEXT("Call       "), RPC_C_AUTHN_LEVEL_CALL),
00149     ENTRY(TEXT("Packet     "), RPC_C_AUTHN_LEVEL_PKT),
00150     ENTRY(TEXT("Integrity  "), RPC_C_AUTHN_LEVEL_PKT_INTEGRITY),
00151     ENTRY(TEXT("Privacy    "), RPC_C_AUTHN_LEVEL_PKT_PRIVACY),
00152     };
00153
00154 ENTRY   rgImpLevelEntries[] = {
00155     ENTRY(TEXT("Anonymous  "), RPC_C_IMP_LEVEL_ANONYMOUS),
00156     ENTRY(TEXT("Identify   "), RPC_C_IMP_LEVEL_IDENTIFY),
00157     ENTRY(TEXT("Impersonate"), RPC_C_IMP_LEVEL_IMPERSONATE),
00158     ENTRY(TEXT("Delegate   "), RPC_C_IMP_LEVEL_DELEGATE),
00159     };
00160
00161
00162 // ===========================================================================
00163 //                          C C L A S S F A C T O R Y
00164 // ===========================================================================
00165
00166 // ---------------------------------------------------------------------------
00167 // %%Function: CClassFactory::QueryInterface
00168 // ---------------------------------------------------------------------------
00169  STDMETHODIMP
00170 CClassFactory::QueryInterface(REFIID iid, void **ppv)
00171 {
00172     if (iid == IID_IClassFactory || iid == IID_IUnknown)
00173   {
00174   *ppv = (IClassFactory *)this;
00175   AddRef();
00176   return S_OK;
00177   }
00178     *ppv = NULL;
00179     return E_NOINTERFACE;
00180 }  // CClassFactory::QueryInterface
00181
00182 // ---------------------------------------------------------------------------
00183 // %%Function: CClassFactory::CreateInstance
00184 // ---------------------------------------------------------------------------
00185  STDMETHODIMP
00186 CClassFactory::CreateInstance(LPUNKNOWN punkOuter, REFIID riid, void **ppv)
00187 {
00188     LPUNKNOWN   punk;
00189     HRESULT     hr;
00190
00191     *ppv = NULL;
00192
00193     if (punkOuter != NULL)
00194   return CLASS_E_NOAGGREGATION;
00195
00196     if (s_fServer)
00197   {
00198   EnterCriticalSection(&s_csDone);
00199   if (s_fDone == TRUE)
00200       {
00201       LeaveCriticalSection(&s_csDone);
00202       return E_FAIL;
00203       }
00204   LeaveCriticalSection(&s_csDone);
00205   }
00206
00207     punk = new CSecureObject;
00208     if (punk == NULL)
00209   return E_OUTOFMEMORY;
00210
00211     hr = punk->QueryInterface(riid, ppv);
00212     punk->Release();
00213     return hr;
00214 }  // CClassFactory::CreateInstance
00215
00216 // ---------------------------------------------------------------------------
00217 // %%Function: CClassFactory::LockServer
00218 // ---------------------------------------------------------------------------
00219  STDMETHODIMP
00220 CClassFactory::LockServer(BOOL fLock)
00221 {
00222     // LockServer not supported by the GUI server -- shutdown is
00223     // completely controlled by the UI's Exit command
00224     if (!s_fServer)
00225   return E_FAIL;
00226
00227     // LockServer acts like having an artificial object outstanding:
00228     // this code mimics the lifetime management found in the constructor
00229     // and destructor of CSecureObject
00230     EnterCriticalSection(&s_csDone);
00231     if (fLock)
00232   s_cInstances++;
00233     else
00234   {
00235   if (!--s_cInstances && !s_fService) /* could perform other shutdown management here */
00236       {
00237       s_fDone = TRUE;
00238       SetEvent(s_hevtDone);
00239       }
00240   }
00241     LeaveCriticalSection(&s_csDone);
00242     return S_OK;
00243 }  // CClassFactory::LockServer
00244
00245
00246 // ===========================================================================
00247 //                        C S e c u r e O b j e c t
00248 // ===========================================================================
00249
00250 // ---------------------------------------------------------------------------
00251 // %%Function: CSecureObject::CSecureObject
00252 // ---------------------------------------------------------------------------
00253 CSecureObject::CSecureObject()
00254 {
00255     static int s_ID = 0;
00256
00257     // initialize the object's state
00258     m_cRef = 1;
00259     m_crColor = 0;
00260     m_fDenyPutColor = FALSE;
00261     lstrcpyW(m_rgchUserName, L"Default");
00262     m_fDenyPutUserName = FALSE;
00263
00264     if (!s_fServer)
00265   {
00266   TCHAR   rgchName[20];
00267   HWND    hwnd;
00268   INT_PTR iPos;
00269
00270   // insert the object into the server UI. put our this-pointer into the item
00271   // data field of the entry so that we can remove the entry in our destructor
00272   wsprintf(rgchName, TEXT("Object %d"), s_ID++);
00273   hwnd = GetDlgItem(s_hwndDlg, IDC_OBJECTS);
00274   iPos = SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM)rgchName);
00275   SendMessage(hwnd, CB_SETITEMDATA, iPos, (LPARAM)this);
00276   }
00277     else
00278   {
00279   EnterCriticalSection(&s_csDone);
00280   s_cInstances++;
00281   LeaveCriticalSection(&s_csDone);
00282   }
00283 }  // CSecureObject::CSecureObject
00284
00285 CSecureObject::~CSecureObject()
00286 {
00287     if (!s_fServer)
00288   {
00289   HWND    hwnd;
00290   INT_PTR i, iSel, iMac;
00291
00292
00293   // remove the reference to us from the server UI. our this-pointer is in
00294   // the item-data field of the entry -- find it.
00295   hwnd = GetDlgItem(s_hwndDlg, IDC_OBJECTS);
00296   iSel = SendMessage(hwnd, CB_GETCURSEL, 0, 0);
00297   iMac = SendMessage(hwnd, CB_GETCOUNT, 0, 0);
00298   for (i=0; i<iMac; i++)
00299       {
00300       if ((LRESULT)this == SendMessage(hwnd, CB_GETITEMDATA, i, 0))
00301     {
00302     SendMessage(hwnd, CB_DELETESTRING, i, 0);
00303
00304     // if the item being deleted is the current selection,
00305     // change the selection
00306     if (i == iSel)
00307         {
00308         SendMessage(hwnd, CB_SETCURSEL, 0, 0);
00309         PostMessage(s_hwndDlg, WM_COMMAND, MAKELONG(IDC_OBJECTS, CBN_SELCHANGE),
00310       (LPARAM)hwnd);
00311         }
00312     break;
00313     }
00314       }
00315   }
00316     else
00317   {
00318   EnterCriticalSection(&s_csDone);
00319   if (!--s_cInstances && !s_fService) /* could perform other shutdown management here */
00320       {
00321       s_fDone = TRUE;
00322       SetEvent(s_hevtDone);
00323       }
00324   LeaveCriticalSection(&s_csDone);
00325   }
00326 }  // CSecureObject::~CSecureObject
00327
00328 // ---------------------------------------------------------------------------
00329 // %%Function: CSecureObject::QueryInterface
00330 // ---------------------------------------------------------------------------
00331  STDMETHODIMP
00332 CSecureObject::QueryInterface(REFIID iid, void **ppv)
00333 {
00334     if (iid == IID_IMyProperties || iid == IID_IUnknown)
00335   {
00336   *ppv = (IMyProperties *)this;
00337   AddRef();
00338   return S_OK;
00339   }
00340     *ppv = NULL;
00341     return E_NOINTERFACE;
00342 }  // CSecureObject::QueryInterface
00343
00344 // ---------------------------------------------------------------------------
00345 // %%Function: CSecureObject::GetColor
00346 // ---------------------------------------------------------------------------
00347  STDMETHODIMP
00348 CSecureObject::GetColor(COLORREF* pcr)
00349 {
00350     *pcr = m_crColor;
00351     return S_OK;
00352 }  // CSecureObject::GetColor
00353
00354 // ---------------------------------------------------------------------------
00355 // %%Function: CSecureObject::PutColor
00356 // ---------------------------------------------------------------------------
00357  STDMETHODIMP
00358 CSecureObject::PutColor(COLORREF cr)
00359 {
00360     // a naive security check under control of the local-server's UI
00361     if (m_fDenyPutColor == TRUE)
00362   return E_ACCESSDENIED;
00363
00364     m_crColor = cr;
00365
00366     // update the UI to reflect a valid PutColor occurred
00367     if (!s_fServer)
00368   PostMessage(s_hwndDlg, WM_COMMAND, MAKELONG(IDC_OBJECTS,CBN_SELCHANGE),
00369       (LPARAM)GetDlgItem(s_hwndDlg, IDC_OBJECTS));
00370
00371     return S_OK;
00372 }  // CSecureObject::PutColor
00373
00374 // ---------------------------------------------------------------------------
00375 // %%Function: CSecureObject::GetUserName
00376 // ---------------------------------------------------------------------------
00377  STDMETHODIMP
00378 CSecureObject::GetUserName(WCHAR szUserName[20])
00379 {
00380     lstrcpynW(szUserName, m_rgchUserName, 20);
00381     return S_OK;
00382 }  // CSecureObject::GetUserName
00383
00384 // ---------------------------------------------------------------------------
00385 // %%Function: CSecureObject::PutUserName
00386 // ---------------------------------------------------------------------------
00387  STDMETHODIMP
00388 CSecureObject::PutUserName(WCHAR szUserName[20])
00389 {
00390     // a naive security check under control of the local-server's UI
00391     if (m_fDenyPutUserName == TRUE)
00392   return E_ACCESSDENIED;
00393
00394     lstrcpynW(m_rgchUserName, szUserName, 20);
00395
00396     // update the UI to reflect a valid PutUserName occurred
00397     if (!s_fServer)
00398   PostMessage(s_hwndDlg, WM_COMMAND, MAKELONG(IDC_OBJECTS,CBN_SELCHANGE),
00399       (LPARAM)GetDlgItem(s_hwndDlg, IDC_OBJECTS));
00400
00401     return S_OK;
00402 }  // CSecureObject::PutUserName
00403
00404
00405 // ---------------------------------------------------------------------------
00406 // %%Function: FAutoRegister
00407 // ---------------------------------------------------------------------------
00408  BOOL
00409 FAutoRegister(HINSTANCE hinst)
00410 {
00411     static const TCHAR szCLSIDEntryServer[]     = TEXT("CLSID\\{28f64ee0-4656-11cf-8110-00aa00389b71}");
00412     static const TCHAR szLocalServer32[]        = TEXT("LocalServer32");
00413     static const TCHAR szAllowRemoteActivation[] = TEXT("AllowRemoteActivation");
00414     static const TCHAR szCLSIDEntryService[]    = TEXT("CLSID\\{28f64ee2-4656-11cf-8110-00aa00389b71}");
00415     static const TCHAR szLocalService[]         = TEXT("LocalService");
00416     static const TCHAR szServiceParameters[]    = TEXT("ServiceParameters");
00417     static const TCHAR szParameters[]           = TEXT("-Service");
00418     static const TCHAR szEmpty[]                = TEXT("");
00419     SC_HANDLE   hManager = NULL, hService = NULL;
00420     TCHAR       szPath[MAX_PATH], *szError = TEXT("Registry Manipulation");
00421     HKEY        hkeyT = NULL, hkey2;
00422
00423     // install the CLSID_SecureObject key and get the FQP to this executable
00424     if ((RegSetValue(HKEY_CLASSES_ROOT, szCLSIDEntryServer, REG_SZ, szDescription,
00425       lstrlen(szDescription)) != ERROR_SUCCESS) ||
00426   (RegCreateKey(HKEY_CLASSES_ROOT, szCLSIDEntryServer, &hkeyT) != ERROR_SUCCESS) ||
00427   !GetModuleFileName(hinst, szPath, sizeof(szPath)/sizeof(TCHAR)))
00428   goto LErrExit;
00429
00430     // install the LocalServer32 key and the AllowRemoteActivation key
00431     if ((RegSetValue(hkeyT, szLocalServer32, REG_SZ, szPath, lstrlen(szPath))
00432       != ERROR_SUCCESS) ||
00433   (RegSetValue(hkeyT, szAllowRemoteActivation, REG_SZ, szEmpty, lstrlen(szEmpty))
00434       != ERROR_SUCCESS))
00435   goto LErrExit;
00436     RegCloseKey(hkeyT);
00437     hkeyT = NULL;
00438
00439     // install the CLSID_SecureObjectService key
00440     if ((RegSetValue(HKEY_CLASSES_ROOT, szCLSIDEntryService, REG_SZ, szDescription,
00441       lstrlen(szDescription)) != ERROR_SUCCESS) ||
00442   (RegCreateKey(HKEY_CLASSES_ROOT, szCLSIDEntryService, &hkeyT) != ERROR_SUCCESS))
00443   goto LErrExit;
00444
00445     // install the LocalService key and the ServiceParameters named-value
00446     if ((RegSetValue(hkeyT, szLocalService, REG_SZ, szServiceName, lstrlen(szServiceName))
00447       != ERROR_SUCCESS) ||
00448   (RegOpenKey(hkeyT, szLocalService, &hkey2) != ERROR_SUCCESS))
00449   goto LErrExit;
00450     RegCloseKey(hkeyT);
00451     hkeyT = hkey2;
00452     if (RegSetValueEx(hkeyT, szServiceParameters, 0, REG_SZ, (const BYTE*)szParameters,
00453       (lstrlen(szParameters)+1) * sizeof(TCHAR)) != ERROR_SUCCESS)
00454   goto LErrExit;
00455
00456     RegCloseKey(hkeyT);
00457     hkeyT = NULL;
00458
00459     // install the application to run as a service
00460     hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
00461     if (hManager == NULL)
00462   {
00463   szError = TEXT("OpenSCManager");
00464   goto LErrExit;
00465   }
00466
00467     hService = OpenService(hManager, szServiceName, SERVICE_ALL_ACCESS);
00468     if (hService != NULL)
00469   {
00470   if (!ChangeServiceConfig(hService,
00471       SERVICE_WIN32_OWN_PROCESS,
00472       SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, szPath,
00473       NULL, NULL, NULL, NULL, NULL, szDescription))
00474       {
00475       szError = TEXT("ChangeServiceConfig");
00476       goto LErrExit;
00477       }
00478   return TRUE;
00479   }
00480
00481     hService = CreateService(hManager, szServiceName, szDescription,
00482   SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
00483   SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, szPath,
00484   NULL, NULL, NULL,  NULL, NULL);
00485     if (hService == NULL)
00486   {
00487   szError = TEXT("CreateService");
00488   goto LErrExit;
00489   }
00490
00491     CloseServiceHandle(hService);
00492     CloseServiceHandle(hManager);
00493     return TRUE;
00494
00495 LErrExit:
00496     ErrorMessage(GetDesktopWindow(), szError, GetLastError());
00497     if (hkeyT != NULL)
00498   RegCloseKey(hkeyT);
00499     if (hService != NULL)
00500   CloseServiceHandle(hService);
00501     if (hManager != NULL)
00502   CloseServiceHandle(hManager);
00503     return FALSE;
00504 }  // FAutoRegister
00505
00506 // ---------------------------------------------------------------------------
00507 // %%Function: ErrorMessage
00508 // ---------------------------------------------------------------------------
00509  void
00510 ErrorMessage(HWND hwnd, LPTSTR szFunction, HRESULT hr)
00511 {
00512     LPTSTR   szMessage;
00513
00514     if (HRESULT_FACILITY(hr) == FACILITY_WINDOWS)
00515   hr = HRESULT_CODE(hr);
00516
00517     if (!FormatMessage(
00518   FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
00519   NULL, hr,
00520   MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00521   (LPTSTR)&szMessage, 0, NULL))
00522   return;
00523
00524     if (hwnd == NULL)
00525   {
00526   OutputDebugString(szFunction);
00527   OutputDebugString(TEXT(": "));
00528   OutputDebugString(szMessage);
00529   OutputDebugString(TEXT("\n"));
00530   }
00531     else
00532   MessageBox(hwnd, szMessage, szFunction, MB_OK);
00533
00534     LocalFree(szMessage);
00535 }  // ErrorMessage
00536
00537 // ---------------------------------------------------------------------------
00538 // %%Function: SelectEntry
00539 // ---------------------------------------------------------------------------
00540  void
00541 SelectEntry(HWND hwnd, ENTRY* rgEntries, int cEntries, DWORD dwVal)
00542 {
00543     for (int i=0; i<cEntries; i++)
00544   {
00545   if (rgEntries[i].dwVal == dwVal)
00546       {
00547       SendMessage(hwnd, CB_SETCURSEL, i, 0);
00548       return;
00549       }
00550   }
00551 }  // SelectEntry
00552
00553 // ---------------------------------------------------------------------------
00554 // %%Function: GetField
00555 // ---------------------------------------------------------------------------
00556   DWORD
00557 GetField(HWND hwndDlg, UINT idItem)
00558 {
00559     HWND    hwnd;
00560     INT_PTR iCur;
00561
00562     hwnd = GetDlgItem(hwndDlg, idItem);
00563     iCur = SendMessage(hwnd, CB_GETCURSEL, 0, 0);
00564     return (DWORD) SendMessage(hwnd, CB_GETITEMDATA, iCur, 0);
00565 }  // GetField
00566
00567 // ---------------------------------------------------------------------------
00568 // %%Function: ServerDialogProc
00569 // ---------------------------------------------------------------------------
00570  BOOL CALLBACK
00571 ServerDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
00572 {
00573     static DWORD    s_dwRegister = 0;
00574     static BOOL     s_fInitialized = FALSE;
00575     static CSecureObject* s_pcso = NULL;
00576     static COLORREF s_rgcrCustom[16];
00577     static HBRUSH   s_hbrCurrent = NULL;
00578     HRESULT hr;
00579
00580     switch (message)
00581   {
00582   case WM_INITDIALOG:
00583       {
00584       HWND    hwnd;
00585       int     cxScreen, cyScreen, i;
00586       RECT    rcDlg;
00587
00588       // save the hwndDlg into a global
00589       s_hwndDlg = hwndDlg;
00590
00591       // Center the UI on screen
00592       cxScreen = GetSystemMetrics(SM_CXFULLSCREEN);
00593       cyScreen = GetSystemMetrics(SM_CYFULLSCREEN);
00594       GetWindowRect(hwndDlg, &rcDlg);
00595       OffsetRect(&rcDlg,
00596     (cxScreen - rcDlg.right - rcDlg.left)/2,
00597     (cyScreen - rcDlg.bottom - rcDlg.top)/2);
00598       MoveWindow(hwndDlg, rcDlg.left, rcDlg.top,
00599     rcDlg.right-rcDlg.left, rcDlg.bottom-rcDlg.top, TRUE);
00600
00601       // build the lists of authentication levels. choose None for the
00602       // process default.
00603       hwnd = GetDlgItem(hwndDlg, IDC_SERVER_AUTHNLEVEL);
00604       for (i=0; i<cAuthnLevelEntries; i++)
00605     {
00606     SendMessage(hwnd, CB_INSERTSTRING, i, (LPARAM)rgAuthnLevelEntries[i].szName);
00607     SendMessage(hwnd, CB_SETITEMDATA, i, rgAuthnLevelEntries[i].dwVal);
00608     }
00609       SelectEntry(hwnd, rgAuthnLevelEntries, cAuthnLevelEntries, RPC_C_AUTHN_LEVEL_NONE);
00610
00611       // build the lists of impersonation levels. choose Anonymous for the
00612       // process default.
00613       hwnd = GetDlgItem(hwndDlg, IDC_SERVER_IMPLEVEL);
00614       for (i=0; i<cImpLevelEntries; i++)
00615     {
00616     SendMessage(hwnd, CB_INSERTSTRING, i, (LPARAM)rgImpLevelEntries[i].szName);
00617     SendMessage(hwnd, CB_SETITEMDATA, i, rgImpLevelEntries[i].dwVal);
00618     }
00619       SelectEntry(hwnd, rgImpLevelEntries, cImpLevelEntries, RPC_C_IMP_LEVEL_ANONYMOUS);
00620       return 1;
00621       }
00622
00623   case WM_SYSCOMMAND:
00624       if (wParam == SC_CLOSE)
00625     goto LClose;
00626       break;
00627
00628   case WM_COMMAND:
00629       switch (LOWORD(wParam))
00630     {
00631     case IDCANCEL:
00632 LClose:
00633         if (s_hbrCurrent != NULL)
00634       {
00635       DeleteObject(s_hbrCurrent);
00636       s_hbrCurrent = NULL;
00637       }
00638         if (s_dwRegister != 0)
00639       {
00640       CoRevokeClassObject(s_dwRegister);
00641       s_dwRegister = 0;
00642       }
00643         if (s_fInitialized == TRUE)
00644       {
00645       CoUninitialize();
00646       s_fInitialized = FALSE;
00647       }
00648         EndDialog(hwndDlg, 0);
00649         break;
00650
00651     case IDC_INITIALIZE:
00652         // initialize as apartment-threaded to synchronize the UI
00653         // with calls to the objects
00654         hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00655         if (FAILED(hr))
00656       {
00657       ErrorMessage(hwndDlg, TEXT("CoInitialize"), hr);
00658       break;
00659       }
00660
00661                     // initialize security layer with our choices
00662         hr = CoInitializeSecurity(NULL,
00663                         -1,
00664                         NULL,
00665                         NULL,
00666       GetField(hwndDlg, IDC_SERVER_AUTHNLEVEL),
00667       GetField(hwndDlg, IDC_SERVER_IMPLEVEL),
00668                         NULL,
00669                         0,
00670       NULL);
00671         if (FAILED(hr))
00672       {
00673       ErrorMessage(hwndDlg, TEXT("CoInitializeSecurity"), hr);
00674       break;
00675       }
00676
00677         hr = CoRegisterClassObject(CLSID_SecureObject, &s_ClassFactory,
00678       CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &s_dwRegister);
00679         if (FAILED(hr))
00680       {
00681       ErrorMessage(hwndDlg, TEXT("CoRegisterClassObject"), hr);
00682       CoUninitialize();
00683       break;
00684       }
00685
00686         // Disable Initialization Step (#1)
00687         EnableWindow(GetDlgItem(hwndDlg, IDC_INITIALIZE), FALSE);
00688         EnableWindow(GetDlgItem(hwndDlg, IDC_SERVER_AUTHNLEVEL), FALSE);
00689         EnableWindow(GetDlgItem(hwndDlg, IDC_SERVER_IMPLEVEL), FALSE);
00690
00691         // Enable Object Viewing Steps (#2)
00692         // (choosing a valid object in the list box will enable the
00693         //  other controls)
00694         EnableWindow(GetDlgItem(hwndDlg, IDC_OBJECTS), TRUE);
00695
00696         s_fInitialized = TRUE;
00697         break;
00698
00699     case IDC_OBJECTS:
00700         {
00701         INT_PTR     iCur;
00702
00703         if (HIWORD(wParam) != CBN_SELCHANGE)
00704       break;
00705
00706         // a different object was chosen, or a property has changed.
00707         // retrieve the object's pointer from the item-data of the
00708         // current list-box item and update the UI.
00709         iCur = SendMessage(GetDlgItem(hwndDlg, IDC_OBJECTS),
00710       CB_GETCURSEL, 0, 0);
00711         if (iCur == CB_ERR)
00712       s_pcso = NULL;
00713         else
00714       {
00715       s_pcso = (CSecureObject*)SendMessage(GetDlgItem(hwndDlg, IDC_OBJECTS),
00716           CB_GETITEMDATA, iCur, 0);
00717       if (s_pcso == (LPVOID)CB_ERR)
00718           s_pcso = NULL;
00719       }
00720
00721         if (s_hbrCurrent != NULL)
00722       {
00723       DeleteObject(s_hbrCurrent);
00724       s_hbrCurrent = NULL;
00725       }
00726         SetWindowText(GetDlgItem(hwndDlg, IDC_USERNAME), TEXT(""));
00727         InvalidateRect(GetDlgItem(hwndDlg, IDC_CHOOSECOLOR), NULL, TRUE);
00728         InvalidateRect(GetDlgItem(hwndDlg, IDC_COLOR), NULL, TRUE);
00729         InvalidateRect(GetDlgItem(hwndDlg, IDC_USERNAME), NULL, TRUE);
00730         InvalidateRect(GetDlgItem(hwndDlg, IDC_NOPUTCOLOR), NULL, TRUE);
00731         InvalidateRect(GetDlgItem(hwndDlg, IDC_NOPUTUSERNAME), NULL, TRUE);
00732
00733         if (s_pcso != NULL)
00734       {
00735       SetWindowTextW(GetDlgItem(hwndDlg, IDC_USERNAME), s_pcso->m_rgchUserName);
00736       s_hbrCurrent = CreateSolidBrush(s_pcso->m_crColor);
00737       }
00738
00739         // enable/disable the object-specific windows
00740         EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSECOLOR), s_pcso != NULL);
00741         EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR), s_pcso != NULL);
00742         EnableWindow(GetDlgItem(hwndDlg, IDC_USERNAME), s_pcso != NULL);
00743         EnableWindow(GetDlgItem(hwndDlg, IDC_NOPUTCOLOR), s_pcso != NULL);
00744         EnableWindow(GetDlgItem(hwndDlg, IDC_NOPUTUSERNAME), s_pcso != NULL);
00745         break;
00746         }
00747
00748     case IDC_NOPUTCOLOR:
00749         s_pcso->m_fDenyPutColor = (int) SendMessage(
00750        GetDlgItem(hwndDlg, IDC_NOPUTCOLOR), BM_GETCHECK, 0, 0);
00751         break;
00752
00753     case IDC_NOPUTUSERNAME:
00754         s_pcso->m_fDenyPutUserName = (int) SendMessage(
00755       GetDlgItem(hwndDlg, IDC_NOPUTUSERNAME), BM_GETCHECK, 0, 0);
00756         break;
00757
00758     case IDC_CHOOSECOLOR:
00759         {
00760         CHOOSECOLOR cc;
00761
00762         cc.lStructSize = sizeof(CHOOSECOLOR);
00763         cc.hwndOwner = hwndDlg;
00764         cc.rgbResult = s_pcso->m_crColor;
00765         cc.lpCustColors = s_rgcrCustom;
00766         cc.Flags = CC_RGBINIT | CC_SHOWHELP;
00767
00768         if (ChooseColor(&cc))
00769       {
00770       s_pcso->m_crColor = cc.rgbResult;
00771       if (s_hbrCurrent != NULL)
00772           DeleteObject(s_hbrCurrent);
00773       s_hbrCurrent = CreateSolidBrush(cc.rgbResult);
00774       InvalidateRect((HWND)lParam, NULL, TRUE);
00775       }
00776         break;
00777         }
00778
00779     case IDC_USERNAME:
00780         {
00781         static s_fDirty = FALSE;
00782
00783         if (HIWORD(wParam) == EN_CHANGE)
00784       {
00785       s_fDirty = TRUE;
00786       }
00787         else if (HIWORD(wParam) == EN_KILLFOCUS && s_fDirty)
00788       {
00789       GetWindowTextW(GetDlgItem(hwndDlg, IDC_USERNAME),
00790           s_pcso->m_rgchUserName, 20);
00791       s_fDirty = FALSE;
00792       }
00793         break;
00794         }
00795     }
00796       break;
00797
00798   case WM_DRAWITEM:
00799       {
00800       LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
00801
00802       FillRect(lpdis->hDC, &lpdis->rcItem,
00803     s_hbrCurrent != NULL ? s_hbrCurrent : (HBRUSH)GetStockObject(WHITE_BRUSH));
00804       FrameRect(lpdis->hDC, &lpdis->rcItem, (HBRUSH)GetStockObject(BLACK_BRUSH));
00805       if (lpdis->itemState & ODS_SELECTED)
00806     InvertRect(lpdis->hDC, (LPRECT)&lpdis->rcItem);
00807       if (lpdis->itemState & ODS_FOCUS)
00808     DrawFocusRect(lpdis->hDC, (LPRECT) &lpdis->rcItem);
00809       return TRUE;
00810       }
00811   }
00812     return FALSE;
00813 }  // ServerDialogProc
00814
00815 // ---------------------------------------------------------------------------
00816 // %%Function: MyServiceMain
00817 // ---------------------------------------------------------------------------
00818  void
00819 MyServiceMain(DWORD dwArgc, LPTSTR *pszArgv)
00820 {
00821     HRESULT hr;
00822
00823     s_Service.Status.dwServiceType        = SERVICE_WIN32_OWN_PROCESS;
00824     s_Service.Status.dwCurrentState       = SERVICE_START_PENDING;
00825     s_Service.Status.dwControlsAccepted   = SERVICE_ACCEPT_STOP;
00826     s_Service.Status.dwWin32ExitCode      = 0;
00827     s_Service.Status.dwServiceSpecificExitCode = 0;
00828     s_Service.Status.dwCheckPoint         = 0;
00829     s_Service.Status.dwWaitHint           = 0;
00830
00831     s_Service.hStatus = RegisterServiceCtrlHandler(szServiceName, MyServiceHandler);
00832
00833     if (s_Service.hStatus == NULL)
00834   return;
00835
00836     // used to gaurd the s_fDone variable that prevents new instances
00837     // from being created in IClassFactory::CreateInstance during shutdown
00838     InitializeCriticalSection(&s_csDone);
00839
00840     // event used to signal the service has stopped
00841     s_hevtDone = CreateEvent(NULL, FALSE, FALSE, NULL);
00842     if (s_hevtDone == NULL)
00843   {
00844   ErrorMessage(NULL, TEXT("CreateEvent"), GetLastError());
00845   goto LErrExit;
00846   }
00847
00848     hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00849     if (FAILED(hr))
00850   {
00851   ErrorMessage(NULL, TEXT("CoInitialize"), hr);
00852   goto LErrExit;
00853   }
00854
00855     // the Service CLSID is used here, different from the LocalServer case
00856     hr = CoRegisterClassObject(CLSID_SecureObjectService, &s_ClassFactory,
00857   CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &s_Service.dwRegister);
00858
00859     if (FAILED(hr))
00860   {
00861   ErrorMessage(NULL, TEXT("CoRegisterClassObject"), hr);
00862   CoUninitialize();
00863   goto LErrExit;
00864   }
00865
00866     // Initialization complete - report running status
00867     s_Service.Status.dwCurrentState       = SERVICE_RUNNING;
00868     s_Service.Status.dwCheckPoint         = 0;
00869     s_Service.Status.dwWaitHint           = 0;
00870
00871     // notify the service-manager that the service is running
00872     if (!SetServiceStatus(s_Service.hStatus, &s_Service.Status))
00873   ErrorMessage(NULL, TEXT("SetServiceStatus(SERVICE_RUNNING)"), GetLastError());
00874
00875     // wait for the signal from MyServiceHandler:SERVICE_CONTROL_STOP
00876     WaitForSingleObject(s_hevtDone, INFINITE);
00877
00878     CloseHandle(s_hevtDone);
00879     s_hevtDone = NULL;
00880
00881     CoRevokeClassObject(s_Service.dwRegister);
00882     CoUninitialize();
00883
00884     // notify the service-manager that the service has totally stopped
00885     s_Service.Status.dwCurrentState = SERVICE_STOPPED;
00886     if (!SetServiceStatus(s_Service.hStatus, &s_Service.Status))
00887   ErrorMessage(NULL, TEXT("SetServiceStatus(SERVICE_STOPPED)"), GetLastError());
00888     return;
00889
00890 LErrExit:
00891     if (s_hevtDone != NULL)
00892   {
00893   CloseHandle(s_hevtDone);
00894   s_hevtDone = NULL;
00895   }
00896     s_Service.Status.dwCurrentState       = SERVICE_STOPPED;
00897     s_Service.Status.dwCheckPoint         = 0;
00898     s_Service.Status.dwWaitHint           = 0;
00899     s_Service.Status.dwWin32ExitCode      = hr;
00900     s_Service.Status.dwServiceSpecificExitCode = hr;
00901     SetServiceStatus(s_Service.hStatus, &s_Service.Status);
00902     return;
00903 }  // MyServiceMain
00904
00905 // ---------------------------------------------------------------------------
00906 // %%Function: MyServiceHandler
00907 // ---------------------------------------------------------------------------
00908  void
00909 MyServiceHandler(DWORD dwControl)
00910 {
00911     switch (dwControl)
00912   {
00913   case SERVICE_CONTROL_STOP:
00914       s_Service.Status.dwWin32ExitCode = 0;
00915       s_Service.Status.dwCurrentState  = SERVICE_STOP_PENDING;
00916       s_Service.Status.dwCheckPoint    = 0;
00917       s_Service.Status.dwWaitHint      = 0;
00918       if (!SetServiceStatus (s_Service.hStatus, &s_Service.Status))
00919     ErrorMessage(NULL, TEXT("SetServiceStatus"), GetLastError());
00920
00921       EnterCriticalSection(&s_csDone);
00922
00923       // prevent further instances from being created in IClassFactory::CreateInstance
00924       s_fDone = TRUE;
00925
00926       // restart the waiting MyServiceMain thread and allow it to uninitialize and exit.
00927       SetEvent(s_hevtDone);
00928
00929       LeaveCriticalSection(&s_csDone);
00930       return;
00931
00932   case SERVICE_CONTROL_INTERROGATE:
00933       // fall out and send the current status of s_Service.Status
00934       break;
00935
00936   default:
00937       break;
00938   }
00939
00940     // send current status.
00941     if (!SetServiceStatus(s_Service.hStatus,  &s_Service.Status))
00942   ErrorMessage(NULL, TEXT("SetServiceStatus"), GetLastError());
00943
00944     return;
00945 }  // MyServiceHandler
00946
00947 // ---------------------------------------------------------------------------
00948 // %%Function: WinMain
00949 // ---------------------------------------------------------------------------
00950  int WINAPI
00951 WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int nCmdShow)
00952 {
00953     HRESULT hr;
00954
00955     // DebugBreak();
00956
00957     // parse the command-line
00958     if (szCmdLine)
00959   {
00960   char    *sz = strtok(szCmdLine, " \t");
00961   if (sz)
00962       {
00963       if (!strcmpi(sz, "-Embedding"))
00964     s_fServer = TRUE;
00965
00966       // Auto-register, display success or failure, and exit
00967       else if (!strcmpi(sz, "-AutoRegister"))
00968     {
00969     if (FAutoRegister(hInstance))
00970         MessageBox(GetDesktopWindow(),
00971       TEXT("Registered Successfully!"),
00972       szDescription,
00973       MB_OK);
00974     return S_OK;
00975     }
00976
00977       // any other argument besides interactive causes help to be displayed
00978       else if (strcmpi(sz, "-Interactive"))
00979     {
00980     // MessageBox some help here
00981     }
00982       }
00983   else
00984       {
00985       s_fService = TRUE;
00986       s_fServer = TRUE;
00987       }
00988   }
00989
00990     // when launched without command-line args, run as a service, without any UI
00991     // and running multi-threaded
00992     if (s_fService)
00993   return StartServiceCtrlDispatcher(s_rgsteServices) ? 0 : GetLastError();
00994
00995     // when launched with -Embedding, come up
00996     // without any UI and run multi-threaded
00997     else if (s_fServer)
00998   {
00999   DWORD   dwRegister;
01000
01001   InitializeCriticalSection(&s_csDone);
01002
01003   s_hevtDone = CreateEvent(NULL, FALSE, FALSE, NULL);
01004   if (s_hevtDone == NULL)
01005       return HRESULT_FROM_WIN32(GetLastError());
01006
01007   hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
01008   if (FAILED(hr))
01009       return hr;
01010
01011   hr = CoRegisterClassObject(CLSID_SecureObject, &s_ClassFactory,
01012       CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &dwRegister);
01013   if (FAILED(hr))
01014       goto LServerExit;
01015
01016   // wait for all open connections to the server to go away
01017   WaitForSingleObject(s_hevtDone, INFINITE);
01018
01019   // Destroy the event handle
01020   CloseHandle(s_hevtDone);
01021   s_hevtDone = NULL;
01022
01023   // destroy the critsec used to determine when we're done
01024   DeleteCriticalSection(&s_csDone);
01025
01026   CoRevokeClassObject(dwRegister);
01027
01028 LServerExit:
01029   CoUninitialize();
01030   return hr;
01031   }
01032
01033     // when launched with -Interactive, run with UI.
01034     // this allows the user to adjust the exact security parameters of the
01035     // process and to monitor individual client objects. in this case, we will
01036     // eventually initialize COM (once the user selects security parameters
01037     // and hits the Initialize button) to use the apartment model in order
01038     // to synchronize calls with our UI.
01039     DialogBox(hInstance, MAKEINTRESOURCE(IDD_SECSVR), GetDesktopWindow(),
01040   (DLGPROC)ServerDialogProc);
01041
01042     return 0;
01043 } // WinMain
01044
01045 // EOF =======================================================================
01046
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/Dlgs.C Source File

  • WinUI
  • Input
  • Ime
  • MultiUI

Dlgs.C

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      DLGS.C                                                        */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation                     */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <imm.h>
00011 #include "resource.h"
00012 #include "multiui.h"
00013
00014 /**********************************************************************/
00015 /*                                                                    */
00016 /*    About (HWND, UINT, WPARAM, LPARAM)                              */
00017 /*                                                                    */
00018 /**********************************************************************/
00019 BOOL AboutDlg (
00020     HWND hDlg,
00021     UINT message,
00022     WPARAM wParam,
00023     LPARAM lParam)
00024 {
00025     BOOL bRet = FALSE;
00026
00027     switch (message)
00028     {
00029         case WM_INITDIALOG:
00030             bRet = TRUE;
00031             break;
00032
00033         case WM_COMMAND:
00034             if (wParam == IDOK ||
00035                 wParam == IDCANCEL)
00036             {
00037                 EndDialog(hDlg, TRUE);
00038                 bRet = TRUE;
00039             }
00040             break;
00041     }
00042
00043     return bRet;
00044 }
00045
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/about.h Source File

  • SysMgmt
  • MMC
  • Menubtn

about.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPABOUT_H_
00020 #define _SAMPABOUT_H_
00021
00022 #include <tchar.h>
00023 #include <mmc.h>
00024
00025 class CSnapinAbout : public ISnapinAbout
00026 {
00027 private:
00028     ULONG       m_cref;
00029     HBITMAP       m_hSmallImage;
00030     HBITMAP       m_hLargeImage;
00031     HBITMAP       m_hSmallImageOpen;
00032     HICON       m_hAppIcon;
00033
00034 public:
00035     CSnapinAbout();
00036     ~CSnapinAbout();
00037
00038     ///////////////////////////////
00039     // Interface IUnknown
00040     ///////////////////////////////
00041     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042     STDMETHODIMP_(ULONG) AddRef();
00043     STDMETHODIMP_(ULONG) Release();
00044
00045     ///////////////////////////////
00046     // Interface ISnapinAbout
00047     ///////////////////////////////
00048     STDMETHODIMP GetSnapinDescription(
00049         /* [out] */ LPOLESTR *lpDescription);
00050
00051         STDMETHODIMP GetProvider(
00052         /* [out] */ LPOLESTR *lpName);
00053
00054         STDMETHODIMP GetSnapinVersion(
00055         /* [out] */ LPOLESTR *lpVersion);
00056
00057         STDMETHODIMP GetSnapinImage(
00058         /* [out] */ HICON *hAppIcon);
00059
00060         STDMETHODIMP GetStaticFolderImage(
00061         /* [out] */ HBITMAP *hSmallImage,
00062         /* [out] */ HBITMAP *hSmallImageOpen,
00063         /* [out] */ HBITMAP *hLargeImage,
00064         /* [out] */ COLORREF *cMask);
00065
00066         ///////////////////////////////
00067         // Private Interface
00068         ///////////////////////////////
00069 private:
00070     HRESULT CSnapinAbout::AllocOleStr(
00071         LPOLESTR *lpDest,
00072         _TCHAR *szBuffer);
00073 };
00074
00075 #endif _SAMPABOUT_H_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/AuthFilt/AuthFilt.h Source File

  • Web
  • iis
  • filters
  • AuthFilt

AuthFilt.h

Go to the documentation of this file.
00001 /* Copyright (c) 1996-2002 Microsoft Corporation
00002
00003 Module Name:
00004
00005     authfilt.h
00006
00007 Abstract:
00008
00009     This module contains the common definitions for the authentication filter
00010     sample
00011 */
00012
00013 #ifndef _AUTHFILT_H_
00014 #define _AUTHFILT_H_
00015
00016 // Constants
00017
00018 #define ISWHITE(ch) ((ch) && ((ch) == ' ' || (ch) == '\t' || (ch) == '\n' || (ch) == '\r'))
00019
00020 #if DBG
00021   #define DEST              buff
00022   #define DbgWrite(x)       {                                 \
00023                               char buff[256];                 \
00024                               wsprintf x;                     \
00025                               OutputDebugString( buff );      \
00026                             }
00027 #else
00028   #define DbgWrite(x)      /* nothing */
00029 #endif
00030
00031 // Database routines
00032
00033 BOOL InitializeUserDatabase(VOID);
00034
00035 BOOL ValidateUser(CHAR *pszUserName, CHAR *pszPassword, BOOL *pfValid);
00036
00037 BOOL LookupUserInDb(
00038     IN CHAR *pszUser,
00039     OUT BOOL *pfFound,
00040     OUT CHAR *pszPassword,
00041     OUT CHAR *pszNTUser,
00042     OUT CHAR *pszNTUserPassword
00043     );
00044
00045 VOID TerminateUserDatabase(VOID);
00046
00047 // Cache routines
00048
00049 BOOL InitializeCache(VOID);
00050
00051 BOOL LookupUserInCache(
00052     CHAR *pszUserName,
00053     BOOL *pfFound,
00054     CHAR *pszPassword,
00055     CHAR *pszNTUser,
00056     CHAR *pszNTUserPassword
00057     );
00058
00059 BOOL AddUserToCache(
00060     CHAR *pszUserName,
00061     CHAR *pszPassword,
00062     CHAR *pszNTUser,
00063     CHAR *pszNTUserPassword
00064     );
00065
00066 VOID TerminateCache(VOID);
00067
00068 #endif //_AUTHFILT_H_
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/OPBank/stdafx.h Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • OPBank

stdafx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__7B876BC3_96BC_11D2_84FA_00C04F79E4B5__INCLUDED_)
00006 #define AFX_STDAFX_H__7B876BC3_96BC_11D2_84FA_00C04F79E4B5__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #define STRICT
00013 #ifndef _WIN32_WINNT
00014 #define _WIN32_WINNT 0x0500
00015 #endif
00016 #define _ATL_APARTMENT_THREADED
00017
00018 #include <atlbase.h>
00019 //You may derive a class from CComModule and use it if you want to override
00020 //something, but do not change the name of _Module
00021 class CExeModule : public CComModule
00022 {
00023 public:
00024   LONG Unlock();
00025   DWORD dwThreadID;
00026 //  HANDLE hEventShutdown;
00027 //  void MonitorShutdown();
00028 //  bool StartMonitor();
00029 //  bool bActivity;
00030 };
00031 extern CExeModule _Module;
00032 #include <atlcom.h>
00033 #include <shellapi.h>
00034 #include <atlwin.h>
00035
00036 //#import ".\account\account.tlb"no_namespace
00037 //using namespace ACCOUNT;
00038
00039 //{{AFX_INSERT_LOCATION}}
00040 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00041
00042 #endif // !defined(AFX_STDAFX_H__7B876BC3_96BC_11D2_84FA_00C04F79E4B5__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ClientList::Iterator Member List

This is the complete list of members for ClientList::Iterator, including all inherited members.
AtEnd() const | ClientList::Iterator | [inline]
ClientList | ClientList::Iterator | [private]
GetItem() const | ClientList::Iterator | [inline]
Iterator() | ClientList::Iterator | [inline]
m_pCurrent | ClientList::Iterator | [private]
m_pHead | ClientList::Iterator | [private]
m_pTail | ClientList::Iterator | [private]
Next() | ClientList::Iterator | [inline]
~Iterator() | ClientList::Iterator | [inline]
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Render.cpp Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Render.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Render.cpp : Implementation of DLL Exports.
00006
00007
00008 // Note: Proxy/Stub Information
00009 //    To build a separate proxy/stub DLL,
00010 //    run nmake -f Renderps.mk in the project directory.
00011
00012 #include "stdafx.h"
00013 #include "resource.h"
00014 #include "Render.h"
00015
00016 #include "Render_i.c"
00017 #include "Factory.h"
00018 #include "Behavior.h"
00019 #include "EventSink.h"
00020
00021
00022 CComModule _Module;
00023
00024 BEGIN_OBJECT_MAP(ObjectMap)
00025   OBJECT_ENTRY(CLSID_Factory, CFactory)
00026   OBJECT_ENTRY(CLSID_Behavior, CBehavior)
00027   OBJECT_ENTRY(CLSID_EventSink, CEventSink)
00028 END_OBJECT_MAP()
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 // DLL Entry Point
00032
00033 extern "C"
00034 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00035 {
00036   if (dwReason == DLL_PROCESS_ATTACH)
00037   {
00038     _Module.Init(ObjectMap, hInstance);
00039     DisableThreadLibraryCalls(hInstance);
00040   }
00041   else if (dwReason == DLL_PROCESS_DETACH)
00042     _Module.Term();
00043   return TRUE;    // ok
00044 }
00045
00046 /////////////////////////////////////////////////////////////////////////////
00047 // Used to determine whether the DLL can be unloaded by OLE
00048
00049 STDAPI DllCanUnloadNow(void)
00050 {
00051   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00052 }
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // Returns a class factory to create an object of the requested type
00056
00057 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00058 {
00059   return _Module.GetClassObject(rclsid, riid, ppv);
00060 }
00061
00062 /////////////////////////////////////////////////////////////////////////////
00063 // DllRegisterServer - Adds entries to the system registry
00064
00065 STDAPI DllRegisterServer(void)
00066 {
00067   // Registers object, typelib and all interfaces in typelib
00068   return _Module.RegisterServer(TRUE);
00069 }
00070
00071 /////////////////////////////////////////////////////////////////////////////
00072 // DllUnregisterServer - Removes entries from the system registry
00073
00074 STDAPI DllUnregisterServer(void)
00075 {
00076   _Module.UnregisterServer();
00077   return S_OK;
00078 }
00079
00080
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_POLYDATA Member List

This is the complete list of members for _POLYDATA, including all inherited members.
hBezBuffer | _POLYDATA
nBezCurr | _POLYDATA
nBezTotal | _POLYDATA
nColor | _POLYDATA
pVel | _POLYDATA
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CGrid Member List

This is the complete list of members for CGrid, including all inherited members.
_cCol | CGrid | [protected]
_cRow | CGrid | [protected]
_size | CGrid | [protected]
CGrid() | CGrid | [inline]
Detach() | CGrid |
Draw(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject) | CGrid |
FindBehavior(BSTR bstrBehavior, BSTR bstrBehaviorUrl, IElementBehaviorSite *pSite, IElementBehavior **ppBehavior) | CGrid |
get_GridSize(long *pVal) | CGrid |
GetPainterInfo(HTML_PAINTER_INFO *pInfo) | CGrid |
GridSize([out, retval] long *pVal) | IGrid |
GridSize([in] long newVal) | IGrid |
HitTestPoint(POINT pt, BOOL *pbHit, LONG *plPartID) | CGrid |
Init(IElementBehaviorSite *pBehaviorSite) | CGrid |
m_lClientLeft | CGrid |
m_lClientTop | CGrid |
m_lGridSize | CGrid |
m_spPaintSite | CGrid |
m_spSite | CGrid |
Notify(LONG lEvent, VARIANT *pVar) | CGrid |
OnResize(SIZE size) | CGrid |
Paint(CCanvas &canvas, RECT rc, POINT pt)=0 | CGrid | [pure virtual]
put_GridSize(long newVal) | CGrid |
SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) | CGrid |
Trace(WCHAR *message) | CGrid | [inline]
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00025 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00026
00027
00028 //==============================================================
00029 //
00030 // CDelegationBase implementation
00031 //
00032 //
00033 CDelegationBase::CDelegationBase()
00034 : bExpanded(FALSE)
00035 {
00036     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00037         LoadBitmaps();
00038 }
00039
00040 CDelegationBase::~CDelegationBase()
00041 {
00042 }
00043
00044 // CDelegationBase::AddImages sets up the collection of images to be displayed
00045 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00046 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00047 {
00048     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00049         (long *)m_pBMapLg, // pointer to a handle
00050         0, // index of the first image in the strip
00051         RGB(0, 128, 128)  // color of the icon mask
00052         );
00053 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/threads.h Source File

  • Multimedia
  • Gdi
  • PrintJob

threads.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 *  PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009     FILE:   Threads.H
00010
00011     PURPOSE:    Provides functions for managing the threads which perform
00012         the monitoring of the print queues.
00013
00014     FUNCTIONS:
00015         CreatThreadSyncResources () - Creates mutex's for thread management.
00016         DestroyThreadSyncResources () - Cleans up thread management resources.
00017         StartPolling () - Creates a new polling thread.
00018         PollingUpdate () - Polling thread entry point.
00019         StartNotifications () - Creates a new Printer Change notification thread.
00020         NotificationUpdate () - Printer Change thread entry point.
00021         StopUpdateThread () - Terminates either thread type.
00022         ActiveUpdateThread () - Checks to see if either thread type exists.
00023         TriggerUpdateThreadRefresh () - Forces either thread type to do a refresh.
00024 *
00025 ******************************************************************************/
00026
00027
00028 /* thread management */
00029 BOOL    CreateThreadSyncResources(void);
00030 BOOL    DestroyThreadSyncResources(void);
00031
00032 /* Polling thread functions */
00033 HANDLE  StartPolling(HWND hWnd, HANDLE hPrinter, HANDLE hPrevThread);
00034 unsigned __stdcall PollingUpdate(void *pParameters);
00035
00036 /* Printer Change notification thread functions */
00037 HANDLE  StartNotifications(HWND hWnd, HANDLE hPrinter, HANDLE hPrevThread);
00038 unsigned __stdcall NotificationUpdate(void *pParameters);
00039
00040 /* Update Mechanism independent thread management */
00041 BOOL    StopUpdateThread(HANDLE hThread, BOOL fCloseAppNow);
00042 BOOL    ActiveUpdateThread(void);
00043 BOOL    TriggerUpdateThreadRefresh(void);
00044
00045 /* end of header file Threads.H */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/tsfwnd.cpp Source File

  • WinUI
  • tsfapp

tsfwnd.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          TSFWnd.cpp
00013
00014    Description:   CTSFMainWnd Class Implementation
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "TSFWnd.h"
00023 #include "Globals.h"
00024
00025 /**************************************************************************
00026    local function prototypes
00027 **************************************************************************/
00028
00029 /**************************************************************************
00030    global variables and definitions
00031 **************************************************************************/
00032
00033 TCHAR g_szTSFMainClassName[] = TEXT("TSFMainWndClass");
00034 TCHAR g_szTSFAppTitle[] = TEXT("TSF Test Application");
00035
00036 #define THIS_POINTER_OFFSET   GWLP_USERDATA
00037
00038 /**************************************************************************
00039
00040    CTSFMainWnd::CTSFMainWnd()
00041
00042 **************************************************************************/
00043
00044 CTSFMainWnd::CTSFMainWnd(HINSTANCE hInstance)
00045 {
00046     m_hWnd = NULL;
00047     m_hInst = hInstance;
00048     m_pTSFEditWnd = NULL;
00049     m_tfClientID = 0;
00050 }
00051
00052 /**************************************************************************
00053
00054    CTSFMainWnd::~CTSFMainWnd()
00055
00056 **************************************************************************/
00057
00058 CTSFMainWnd::~CTSFMainWnd()
00059 {
00060     if(m_hWnd)
00061     {
00062         DestroyWindow(m_hWnd);
00063     }
00064
00065     if(g_pThreadMgr)
00066     {
00067         g_pThreadMgr->Deactivate();
00068
00069         g_pThreadMgr->Release();
00070         g_pThreadMgr = NULL;
00071     }
00072 }
00073
00074 /**************************************************************************
00075
00076    CTSFMainWnd::Initialize()
00077
00078 **************************************************************************/
00079
00080 BOOL CTSFMainWnd::Initialize(int nCmdShow)
00081 {
00082     HRESULT hr;
00083 #if 1
00084     hr = CoCreateInstance(  CLSID_TF_ThreadMgr,
00085                             NULL,
00086                             CLSCTX_INPROC_SERVER,
00087                             IID_ITfThreadMgr,
00088                             (void**)&g_pThreadMgr);
00089 #else
00090     hr = TF_CreateThreadMgr(&g_pThreadMgr);
00091 #endif
00092     if(SUCCEEDED(hr))
00093     {
00094         hr = g_pThreadMgr->Activate(&m_tfClientID);
00095
00096         if(SUCCEEDED(hr))
00097         {
00098             WNDCLASS  wc;
00099
00100             ZeroMemory(&wc, sizeof(wc));
00101
00102             wc.style          = CS_HREDRAW | CS_VREDRAW;
00103             wc.lpfnWndProc    = CTSFMainWnd::_WndProc;
00104             wc.cbClsExtra     = 0;
00105             wc.cbWndExtra     = sizeof(CTSFMainWnd*);
00106             wc.hInstance      = m_hInst;
00107             wc.hIcon          = LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_MAIN_ICON));
00108             wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00109             wc.hbrBackground  = (HBRUSH)(COLOR_DESKTOP + 1);
00110             wc.lpszMenuName   = MAKEINTRESOURCE(IDR_MAIN_MENU);
00111             wc.lpszClassName  = g_szTSFMainClassName;
00112
00113             if(0 != RegisterClass(&wc))
00114             {
00115                 //create the main window
00116                 m_hWnd = CreateWindowEx(    0,
00117                                             g_szTSFMainClassName,
00118                                             g_szTSFAppTitle,
00119                                             WS_OVERLAPPEDWINDOW,
00120                                             CW_USEDEFAULT,
00121                                             CW_USEDEFAULT,
00122                                             CW_USEDEFAULT,
00123                                             CW_USEDEFAULT,
00124                                             NULL,
00125                                             NULL,
00126                                             m_hInst,
00127                                             (LPVOID)this);
00128
00129                 if(NULL != m_hWnd)
00130                 {
00131                     ShowWindow(m_hWnd, nCmdShow);
00132                     UpdateWindow(m_hWnd);
00133
00134                     return TRUE;
00135                 }
00136             }
00137         }
00138     }
00139
00140     return FALSE;
00141 }
00142
00143 /**************************************************************************
00144
00145    CTSFMainWnd::_CleanupEditWnd()
00146
00147 **************************************************************************/
00148
00149 void CTSFMainWnd::_CleanupEditWnd(BOOL fNuke)
00150 {
00151     if(NULL != m_pTSFEditWnd)
00152     {
00153         if(fNuke)
00154         {
00155             delete m_pTSFEditWnd;
00156         }
00157
00158         else
00159         {
00160             m_pTSFEditWnd->Release();
00161         }
00162
00163         m_pTSFEditWnd = NULL;
00164     }
00165 }
00166
00167 /**************************************************************************
00168
00169    CTSFMainWnd::_WndProc()
00170
00171 **************************************************************************/
00172
00173 LRESULT CALLBACK CTSFMainWnd::_WndProc( HWND hWnd,
00174                                         UINT uMessage,
00175                                         WPARAM wParam,
00176                                         LPARAM lParam)
00177 {
00178     CTSFMainWnd *pThis = (CTSFMainWnd*)GetWindowLongPtr(hWnd, THIS_POINTER_OFFSET);
00179
00180     if((NULL == pThis) && (uMessage != WM_NCCREATE))
00181     {
00182         return DefWindowProc(hWnd, uMessage, wParam, lParam);
00183     }
00184
00185     switch (uMessage)
00186     {
00187     case WM_NCCREATE:
00188         {
00189             LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00190             pThis = (CTSFMainWnd*)(lpcs->lpCreateParams);
00191             SetWindowLongPtr(hWnd, THIS_POINTER_OFFSET, (LONG_PTR)pThis);
00192
00193             //set the window handle
00194             pThis->m_hWnd = hWnd;
00195         }
00196         break;
00197
00198     case WM_CREATE:
00199         return pThis->_OnCreate();
00200
00201     case WM_SIZE:
00202         return pThis->_OnSize(LOWORD(lParam), HIWORD(lParam));
00203
00204     case WM_DESTROY:
00205         return pThis->_OnDestroy();
00206
00207     case WM_SETFOCUS:
00208         return pThis->_OnSetFocus();
00209
00210     case WM_KILLFOCUS:
00211         return pThis->_OnKillFocus();
00212
00213     case WM_ACTIVATE:
00214         return pThis->_OnActivate(wParam);
00215
00216     case WM_INITMENUPOPUP:
00217         return pThis->_OnInitMenuPopup(wParam, lParam);
00218
00219     case WM_COMMAND:
00220         return pThis->_OnCommand(   GET_WM_COMMAND_ID(wParam, lParam),
00221                                     GET_WM_COMMAND_CMD(wParam, lParam),
00222                                     GET_WM_COMMAND_HWND(wParam, lParam));
00223
00224     case WM_NCDESTROY:
00225         pThis->m_hWnd = NULL;
00226         break;
00227
00228     }
00229
00230     return DefWindowProc(hWnd, uMessage, wParam, lParam);
00231 }
00232
00233 /**************************************************************************
00234
00235    CTSFMainWnd::)OnCreate()
00236
00237 **************************************************************************/
00238
00239 LRESULT CTSFMainWnd::_OnCreate(VOID)
00240 {
00241     m_pTSFEditWnd = new CTSFEditWnd(m_hInst, m_hWnd);
00242
00243     if(!m_pTSFEditWnd)
00244     {
00245         return -1;
00246     }
00247
00248     if(!m_pTSFEditWnd->_Initialize(g_pThreadMgr, m_tfClientID))
00249     {
00250         _CleanupEditWnd(TRUE);
00251
00252         return -1;
00253     }
00254
00255     return 0;
00256 }
00257
00258 /**************************************************************************
00259
00260    CTSFMainWnd::_OnDestroy()
00261
00262 **************************************************************************/
00263
00264 LRESULT CTSFMainWnd::_OnDestroy(VOID)
00265 {
00266     _CleanupEditWnd(FALSE);
00267
00268     PostQuitMessage(0);
00269
00270     return 0;
00271 }
00272
00273 /**************************************************************************
00274
00275    CTSFMainWnd::_OnCommand()
00276
00277 **************************************************************************/
00278
00279 LRESULT CTSFMainWnd::_OnCommand(WORD wID, WORD wCmd, HWND hWnd)
00280 {
00281     switch(wID)
00282     {
00283     case IDM_EXIT:
00284         PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00285         break;
00286
00287     case IDM_ABOUT:
00288         MessageBox(m_hWnd, TEXT(""), g_szTSFAppTitle, MB_OK | MB_ICONINFORMATION);
00289         break;
00290
00291     case IDM_GETPRESERVEDKEY:
00292         m_pTSFEditWnd->_OnGetPreservedKey();
00293         break;
00294
00295     case IDM_GETDISPATTR:
00296         m_pTSFEditWnd->_GetDisplayAttributes();
00297         break;
00298
00299     case IDM_GET_TEXTOWNER:
00300         m_pTSFEditWnd->_GetTextOwner();
00301         break;
00302
00303     case IDM_GET_READING:
00304         m_pTSFEditWnd->_GetReadingText();
00305         break;
00306
00307     case IDM_GET_COMPOSING:
00308         m_pTSFEditWnd->_GetComposing();
00309         break;
00310
00311     case IDM_TERMINATE_COMPOSITION:
00312         m_pTSFEditWnd->_TerminateAllCompositions();
00313         break;
00314
00315     case IDM_RECONVERT:
00316         m_pTSFEditWnd->_Reconvert();
00317         break;
00318
00319     case IDM_PLAYBACK:
00320         m_pTSFEditWnd->_Playback();
00321         break;
00322
00323     case IDM_LOAD:
00324         {
00325             TCHAR   szFile[MAX_PATH];
00326
00327             if(_GetFileName(m_hWnd, szFile, MAX_PATH, TRUE))
00328             {
00329                 m_pTSFEditWnd->_LoadFromFile(szFile);
00330             }
00331         }
00332         break;
00333
00334     case IDM_SAVE:
00335         {
00336             TCHAR   szFile[MAX_PATH];
00337
00338             if(_GetFileName(m_hWnd, szFile, MAX_PATH, FALSE))
00339             {
00340                 m_pTSFEditWnd->_SaveToFile(szFile);
00341             }
00342         }
00343         break;
00344
00345     case IDM_TEST:
00346         m_pTSFEditWnd->_OnTest();
00347         break;
00348     }
00349
00350     return 0;
00351 }
00352
00353 /**************************************************************************
00354
00355    CTSFMainWnd::_OnSetFocus()
00356
00357 **************************************************************************/
00358
00359 LRESULT CTSFMainWnd::_OnSetFocus(VOID)
00360 {
00361     SetFocus(m_pTSFEditWnd->_GetWindow());
00362
00363     return 0;
00364 }
00365
00366 /**************************************************************************
00367
00368    CTSFMainWnd::_OnKillFocus()
00369
00370 **************************************************************************/
00371
00372 LRESULT CTSFMainWnd::_OnKillFocus(VOID)
00373 {
00374     return 0;
00375 }
00376
00377 /**************************************************************************
00378
00379    CTSFMainWnd::_OnNotify()
00380
00381 **************************************************************************/
00382
00383 LRESULT CTSFMainWnd::_OnNotify(UINT, LPNMHDR)
00384 {
00385     return 0;
00386 }
00387
00388 /**************************************************************************
00389
00390    CTSFMainWnd::_OnSize()
00391
00392 **************************************************************************/
00393
00394 LRESULT CTSFMainWnd::_OnSize(WORD wWidth, WORD wHeight)
00395 {
00396     //position the edit window to fill the client area
00397     MoveWindow(m_pTSFEditWnd->_GetWindow(), 0, 0, wWidth, wHeight, TRUE);
00398
00399     return 0;
00400 }
00401
00402 /**************************************************************************
00403
00404    CTSFMainWnd::_OnActivate()
00405
00406 **************************************************************************/
00407
00408 LRESULT CTSFMainWnd::_OnActivate(WPARAM)
00409 {
00410     return 0;
00411 }
00412
00413 /**************************************************************************
00414
00415   CTSFMainWnd::_OnInitMenuPopup()
00416
00417 **************************************************************************/
00418
00419 LRESULT CTSFMainWnd::_OnInitMenuPopup(WPARAM wParam, LPARAM lParam)
00420 {
00421     return m_pTSFEditWnd->_OnInitMenuPopup(wParam, lParam);
00422 }
00423
00424
00425 /**************************************************************************
00426
00427   CTSFMainWnd::GetFileName()
00428
00429 **************************************************************************/
00430
00431 BOOL CTSFMainWnd::_GetFileName(HWND hwndOwner, LPTSTR lpszFile, ULONG uChars, BOOL fOpen)
00432 {
00433     OPENFILENAME    ofn;
00434     BOOL            fReturn = FALSE;
00435
00436     *lpszFile = 0;
00437
00438     ZeroMemory(&ofn, sizeof(ofn));
00439     ofn.lStructSize = sizeof(OPENFILENAME);
00440     ofn.hwndOwner   = hwndOwner;
00441     ofn.lpstrFilter = TEXT("TSFApp Files (*.tsf)\0*.tsf\0");
00442     ofn.lpstrFile   = lpszFile;
00443     ofn.nMaxFile    = uChars;
00444     ofn.Flags       = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
00445     ofn.lpstrDefExt = TEXT("tsf");
00446
00447     if(fOpen)
00448     {
00449         ofn.Flags |= OFN_FILEMUSTEXIST;
00450
00451         fReturn = GetOpenFileName(&ofn);
00452     }
00453     else
00454     {
00455         fReturn = GetSaveFileName(&ofn);
00456     }
00457
00458     return fReturn;
00459 }
00460
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/appDll/DllInit.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • appDll

DllInit.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1995 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     dllinit.c
00012
00013 Abstract:
00014
00015     This module contians the DLL attach/detach event entry point for
00016     the Application memory usage performance DLL.
00017
00018     When the dll is opened by the calling application. The initialization
00019     function (DllProcessAttach) opens or creates the shared memory file
00020     that is used to communicate data from the application to the performance
00021     monitor extensible counter DLL. This shared memory file is used by all
00022     applications that have been compiled to provide the memory statistics.
00023
00024     The shared memory file is formatted by the first application to
00025     create it. The format of the memory is a data header (at the base
00026     of the address space) followed by an array of APPMEM_INSTANCE structures.
00027     The APPMEM_INSTANCE structures are managed as two linked lists: a
00028     Free List and an InUse List. The pointers to the first entry in each
00029     list are maintained in the data header structure. As applications are
00030     started, the first item in the Free list is moved to the InUse List
00031     and as applications finish with the data block, their entries are moved
00032     back to the Head of the Free List. All operations on the data in
00033     this shared memory file are protected by a mutex such that only
00034     one process can read or write to the file at a time.
00035
00036     Note that references are by offset from the base of the memory
00037     block not absolute virtual addresses. This is because the same
00038     shared memory file may be mapped to different addresses in
00039     different processes making a virtual address valid within the
00040     context of a single process only.
00041
00042 --*/
00043
00044 #include <windows.h>
00045 #include "appmema.h"
00046
00047 HANDLE ThisDLLHandle       = NULL;
00048 HANDLE hAppMemSharedMemory = NULL;      // Handle of counter Shared Memory
00049 PAPPMEM_DATA_HEADER pDataHeader = NULL; // pointer to header of shared mem
00050 PAPPMEM_INSTANCE    pAppData    = NULL; // pointer to the app data for this app
00051
00052 static
00053 BOOL
00054 TrimProcessName(
00055     LPCWSTR  wcszLongName,
00056     LPWSTR  wcszShortName
00057 )
00058 /*++
00059
00060 Description:
00061
00062     strips the leading directory path and trailing file extension from the
00063     input path string to return the base filename.
00064
00065 Arguments:
00066
00067     wcszLongName    pointer to a Wide Character string containing the
00068                     process's image file path name
00069
00070     wcszShortName   buffer to receive the "short" version of the image
00071                     file name, i.e. the base file name with no extension or
00072                     directory path.
00073
00074 NOTE: the buffer size is not checked!!! The caller must guarantee sufficient
00075     space for the conversion.
00076
00077 Return Value:
00078
00079     TRUE if name trimmed successfully
00080     FALSE if error
00081
00082 --*/
00083 {
00084    DWORD   dwLength;
00085    LPWSTR  pSlash;
00086    LPWSTR  pPeriod;
00087    LPWSTR  pThisChar;
00088    LPWSTR  pSrc, pDest;
00089    WORD    wThisChar;
00090
00091    // validate the input arguments
00092    if ((wcszLongName == NULL) || (wcszShortName == 0))
00093    {
00094       return FALSE;
00095    }
00096
00097    // get the length of the string passed in
00098    dwLength = lstrlenW(wcszLongName);
00099
00100    if (* wcszLongName > 0)
00101    {   // some name has been passed in
00102       pSlash    =
00103       pPeriod   =
00104       pThisChar = (LPWSTR) wcszLongName;
00105       wThisChar = 0;
00106
00107       //
00108       //  go from beginning to end and find last backslash and
00109       //  last period in name
00110       //
00111
00112       while (* pThisChar != 0)
00113       { // go until null
00114          if (* pThisChar == L'\\')
00115          {
00116             pSlash = pThisChar;
00117          }
00118          else if (* pThisChar == L'.')
00119          {
00120             pPeriod = pThisChar;
00121          }
00122          pThisChar ++;    // point to next char
00123          wThisChar ++;
00124          if ((DWORD) wThisChar >= dwLength)
00125          {
00126             break;
00127          }
00128       }
00129
00130       // if pPeriod is still pointing to the beginning of the
00131       // string, then no period was found
00132
00133       if (pPeriod == (LPWSTR) wcszLongName)
00134       {
00135          pPeriod = pThisChar; // set to end of string;
00136       }
00137       else
00138       {
00139          // if a period was found, then see if the extension is
00140          // .EXE, if so leave it, if not, then use end of string
00141          // (i.e. include extension in name)
00142
00143          if (lstrcmpiW(pPeriod, L".EXE") != 0)
00144          {
00145             pPeriod = pThisChar;
00146          }
00147       }
00148
00149       if (pSlash != wcszLongName)
00150       {
00151          pSlash ++; // point to first char past slash
00152       }
00153
00154       // copy characters between period (or end of string) and
00155       // slash (or start of string) to make image name
00156
00157       pSrc  = pSlash;
00158       pDest = wcszShortName;
00159
00160       while (pSrc < pPeriod)
00161       {
00162          * pDest ++ = * pSrc ++;
00163       }
00164       * pDest = 0;
00165    }
00166    return TRUE;
00167 }
00168
00169 static
00170 BOOL
00171 DllProcessAttach(
00172     IN  HANDLE DllHandle
00173 )
00174 /*++
00175
00176 Description:
00177
00178     Initializes the interface to the performance counters DLL by
00179     opening the Shared Memory file used to communicate statistics
00180     from the application to the counter DLL. If the Shared memory
00181     file does not exist, it is created, formatted and initialized.
00182     If the file has already been created and formatted, then the
00183     next available APPMEM_INSTANCE entry is moved from the free list
00184     to the InUse list and the corresponding pointer is saved for
00185     subsequent use by this application
00186
00187 --*/
00188 {
00189    LONG    status;
00190    TCHAR   szMappedObject[] = SHARED_MEMORY_OBJECT_NAME;
00191    WCHAR   szLongName[MAX_PATH];
00192
00193    // save this DLL handle
00194    ThisDLLHandle = DllHandle;
00195
00196    // disable thread attach & detach calls to save the overhead
00197    // since we don't care about them.
00198    DisableThreadLibraryCalls(DllHandle);
00199
00200    // open & initialize shared memory file
00201    SetLastError(ERROR_SUCCESS);   // just to clear it out
00202
00203    // open/create shared memory used by the application to pass performance values
00204    status = GetSharedMemoryDataHeader(
00205                                      & hAppMemSharedMemory, & pDataHeader,
00206                                      FALSE); // read/write access is required
00207    // here the memory block should be initialized and ready for use
00208    if (status == ERROR_SUCCESS)
00209    {
00210       if (pDataHeader->dwFirstFreeOffset != 0)
00211       {
00212          // then there are blocks left so get the next free
00213          pAppData = FIRST_FREE(pDataHeader);
00214          // update free list to make next item the first in list
00215          pDataHeader->dwFirstFreeOffset  = pAppData->dwOffsetOfNext;
00216
00217          // insert the new item into the head of the in use list
00218          pAppData->dwOffsetOfNext        = pDataHeader->dwFirstInUseOffset;
00219          pDataHeader->dwFirstInUseOffset = (DWORD) ((LPBYTE) pAppData - (LPBYTE) pDataHeader);
00220
00221          // now initialize this instance's data
00222          pAppData->dwProcessId           = GetCurrentProcessId();
00223          pAppData->hProcessHeap          = NULL;
00224          pAppData->dwApplicationBytes    = 0;
00225          pAppData->dwAllocCalls          = 0;
00226          pAppData->dwReAllocCalls        = 0;
00227          pAppData->dwFreeCalls           = 0;
00228          pAppData->dwReserved1           = 0;
00229          pAppData->dwReserved2           = 0;
00230
00231          GetModuleFileNameW(NULL, szLongName, MAX_PATH);
00232          TrimProcessName(szLongName, pAppData->wcszInstanceName);
00233
00234          pDataHeader->dwInstanceCount ++;    // increment count
00235       }
00236       else
00237       {
00238          // no more free slots left
00239       }
00240    }
00241    else
00242    {
00243       // unable to open shared memory file
00244       // even though this is an error we should return true so as to
00245       // not abort the application. No performance data will be
00246       // collected though.
00247    }
00248    return TRUE;
00249 }
00250
00251 static
00252 BOOL
00253 DllProcessDetach(
00254     IN  HANDLE DllHandle
00255 )
00256 {
00257    PAPPMEM_INSTANCE pPrevItem;
00258
00259    // remove instance for this app
00260    if ((pAppData != NULL) && (pDataHeader != NULL))
00261    {
00262       // lock memory block
00263       // zero the fields out first
00264       pAppData->dwProcessId        = 0;
00265       pAppData->hProcessHeap       = NULL;
00266       pAppData->dwApplicationBytes = 0;
00267       pAppData->dwAllocCalls       = 0;
00268       pAppData->dwReAllocCalls     = 0;
00269       pAppData->dwFreeCalls        = 0;
00270       memset(& pAppData->wcszInstanceName[0], 0, (MAX_SIZEOF_INSTANCE_NAME * sizeof (WCHAR)));
00271       pAppData->dwReserved1        = 0;
00272       pAppData->dwReserved2        = 0;
00273       // move from in use (busy) list back to the free list
00274       if ((pDataHeader->dwFirstFreeOffset != 0) && (pDataHeader->dwFirstInUseOffset != 0))
00275       {
00276          // find previous item in busy list
00277          if (FIRST_INUSE(pDataHeader) != pAppData)
00278          {
00279             // not the first so walk down the list
00280             pPrevItem = FIRST_INUSE(pDataHeader);
00281             while (APPMEM_INST(pDataHeader, pPrevItem->dwOffsetOfNext) != pAppData)
00282             {
00283                pPrevItem = APPMEM_INST(pDataHeader, pPrevItem->dwOffsetOfNext);
00284                if (pPrevItem->dwOffsetOfNext == 0) break; // end of list
00285             }
00286             if (APPMEM_INST(pDataHeader, pPrevItem->dwOffsetOfNext) == pAppData)
00287             {
00288                APPMEM_INST(pDataHeader, pPrevItem->dwOffsetOfNext)->dwOffsetOfNext = pAppData->dwOffsetOfNext;
00289             }
00290             else
00291             {
00292                // it was never in the busy list (?!?)
00293             }
00294          }
00295          else
00296          {
00297             // this is the first in the list so update it
00298             pDataHeader->dwFirstInUseOffset = pAppData->dwOffsetOfNext;
00299          }
00300          // here, pAppData has been removed from the InUse list and now
00301          // it must be inserted back at the beginning of the free list
00302          pAppData->dwOffsetOfNext       = pDataHeader->dwFirstFreeOffset;
00303          pDataHeader->dwFirstFreeOffset = (DWORD)((LPBYTE) pAppData - (LPBYTE) pDataHeader);
00304       }
00305    }
00306
00307    // decrement instance counter
00308    pDataHeader->dwInstanceCount --;    // decrement count
00309
00310    // close shared memory file handle
00311
00312    if (hAppMemSharedMemory != NULL) CloseHandle(hAppMemSharedMemory);
00313
00314    // clear pointers
00315    hAppMemSharedMemory = NULL;
00316    pDataHeader = NULL;
00317    pAppData = NULL;
00318
00319    return TRUE;
00320 }
00321
00322 BOOL
00323 __stdcall
00324 DllMain(
00325     IN HANDLE DLLHandle,
00326     IN DWORD  Reason,
00327     IN LPVOID ReservedAndUnused
00328 )
00329 {
00330    ReservedAndUnused;
00331
00332    switch (Reason)
00333    {
00334    case DLL_PROCESS_ATTACH:
00335       return DllProcessAttach(DLLHandle);
00336
00337    case DLL_PROCESS_DETACH:
00338       return DllProcessDetach(DLLHandle);
00339
00340    case DLL_THREAD_ATTACH:
00341    case DLL_THREAD_DETACH:
00342       return TRUE;
00343    }
00344    return TRUE;
00345 }
00346
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/CCall.h Source File

  • Web
  • NetMeeting
  • NMUI

CCall.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CCALL.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 //****************************************************************************
00016 //
00017 // CLASS CCallNotify
00018 //
00019 //****************************************************************************
00020
00021 class CCallNotify : public RefCount, public CNotify, public INmCallNotify
00022 {
00023 public:
00024   CCallNotify();
00025   ~CCallNotify();
00026
00027   // INmCallNotify
00028   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00029   HRESULT STDMETHODCALLTYPE StateChanged(NM_CALL_STATE uState);
00030   HRESULT STDMETHODCALLTYPE Failed(ULONG uError);
00031   HRESULT STDMETHODCALLTYPE Accepted(INmConference *pConference);
00032
00033   // ICNotify methods
00034   HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00035   HRESULT STDMETHODCALLTYPE Disconnect(void);
00036
00037   // IUnknown methods
00038   ULONG STDMETHODCALLTYPE AddRef(void);
00039   ULONG STDMETHODCALLTYPE Release(void);
00040   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
00041 };
00042
00043
00044 //****************************************************************************
00045 //
00046 // Global Variables
00047 //
00048 //****************************************************************************
00049
00050 extern COBLIST * g_pListCall;
00051 extern COBLIST * g_pListCallNotify;
00052
00053
00054 //****************************************************************************
00055 //
00056 // Global Routines
00057 //
00058 //****************************************************************************
00059
00060 HRESULT HookCall(INmCall * pCall);
00061 VOID DoCallCreate(void);
00062 VOID DoCallConference(void);
00063 VOID DoCancelCall(void);
00064 VOID DoHandleCall(BOOL fAccept);
00065 VOID FreeCalls(void);
00066 INmCall * GetCurrentCall(void);
00067
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDlgIADsLargeInteger Member List

This is the complete list of members for CDlgIADsLargeInteger, including all inherited members.
CDlgIADsLargeInteger(LPUNKNOWN, CWnd *pParent=NULL) | CDlgIADsLargeInteger |
DoDataExchange(CDataExchange *pDX) | CDlgIADsLargeInteger | [protected, virtual]
IDD enum value | CDlgIADsLargeInteger |
m_lHiPart | CDlgIADsLargeInteger |
m_lLowPart | CDlgIADsLargeInteger |
m_pLargeInt | CDlgIADsLargeInteger | [protected]
OnInitDialog() | CDlgIADsLargeInteger | [protected, virtual]
OnOK() | CDlgIADsLargeInteger | [protected, virtual]
~CDlgIADsLargeInteger() | CDlgIADsLargeInteger |
Generated on Wed Nov 13 2024 16:56:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pipes/Pipes.c Source File

  • NetDS
  • RPC
  • Pipes

Pipes.c

Go to the documentation of this file.
00001 /*************************************************************************
00002                     Copyright Microsoft Corp. 1992 - 2000
00003                         Remote Machine pipe sample
00004
00005   FILE      :   pipes.c
00006
00007   USAGE     :   server  -p protocol_sequence
00008                         -e endpoint
00009
00010   PURPOSE   :   Server side of the RPC distributed application pipe.
00011
00012   COMMENTS  :   This application uses the implicit binding method.
00013
00014 *************************************************************************/
00015 #include "pipe.h"       // Generated by the MIDL compiler
00016 #include "common.h"     // Common definitions is locataed in  this file
00017
00018 // Local Procedures
00019 void CleanUpServer();   // Unregisters the interface
00020
00021 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00022 /*  Procedure   :   void Usage(_TUCHAR *)                               */
00023 /*  Desc        :   This procedure prints out an error message if the   */
00024 /*                  command line arguments are wrong                    */
00025 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00026 void Usage(_TUCHAR * pszProgramName)
00027 {
00028     _tprintf(TEXT("USAGE : %s [-option]\n"), pszProgramName);
00029     _tprintf(TEXT("Options : -p Protocol Sequence\n"));
00030     _tprintf(TEXT("          -e Endpoint\n"));
00031     exit(EXECUTION_FAILED);
00032 }
00033
00034
00035 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00036 /* The server main program                                              */
00037 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00038 int __cdecl main(int argc, char *argv[])
00039 {
00040     RPC_STATUS      nStatus;        // Error status returned
00041     int             nNumArgs;       // Number of command line arguments
00042     int             nIdx;           // Counter in loops
00043
00044     // Variabels used for selecting the protocol and the endpoint
00045     _TUCHAR *pszProtocolSequence    = PROTOCOL_SEQUENCE;
00046     _TUCHAR *pszEndpoint            = END_POINT;
00047     _TUCHAR *pszSecurity            = NULL;
00048
00049
00050 // Get a common handle on the command line arguments for both UNICODE
00051 // and ASCII
00052 #ifdef _UNICODE
00053     LPWSTR  *szArglist = CommandLineToArgvW(GetCommandLine(), &nNumArgs);
00054     if (NULL == szArglist)
00055     {
00056         _tprintf(TEXT("SERVER.C : CommandLineToArgW failed"));
00057         exit(EXECUTION_FAILED);
00058     }
00059 #else
00060     char **szArglist  = argv;
00061     nNumArgs = argc;
00062 #endif
00063
00064     /* Allow the user to override settings with commandline switches    */
00065     for (nIdx = 1; nIdx < nNumArgs; nIdx++)
00066     {
00067         if((_tcscmp(szArglist[nIdx], TEXT("-p")) == 0) ||
00068            (_tcscmp(szArglist[nIdx], TEXT("-P")) == 0))
00069         {
00070             pszProtocolSequence = szArglist[++nIdx];
00071         }
00072         else if((_tcscmp(szArglist[nIdx], TEXT("-e")) == 0) ||
00073                 (_tcscmp(szArglist[nIdx], TEXT("-e")) == 0))
00074         {
00075             pszEndpoint = szArglist[++nIdx];
00076         }
00077         else
00078         {
00079             Usage(szArglist[0]);
00080         }
00081     }
00082
00083
00084     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00085     /* Register the interface with the RPC run-time library             */
00086     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00087     _tprintf(TEXT("Registering the interface\n"));
00088     nStatus = RpcServerRegisterIf(
00089         pipe_sample_v1_0_s_ifspec,  // Interface specification
00090         NULL,                       // UUID to associate with MgrEnv arg.
00091         NULL);                      // Managers entry point vector. (None)
00092     EXIT_IF_FAIL(nStatus, "RpcServerRegisterIf");
00093
00094
00095     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00096     /* Select Protocal sequence : This sample uses namedpipes as the    */
00097     /* default protocol. The RpcServerUseProtseqEp function tells the   */
00098     /* RPC run-time library to use the specified protocol sequence      */
00099     /* combined with the specified endpoint for receiving remote        */
00100     /* procedure calls                                                  */
00101     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00102     _tprintf(TEXT("Selecting the protocol sequence to use.\t\"%s\"\n"),
00103             pszProtocolSequence);
00104     nStatus = RpcServerUseProtseqEp(
00105         pszProtocolSequence,            // String with the protocol in
00106         RPC_C_PROTSEQ_MAX_REQS_DEFAULT, // Max number of calls
00107         pszEndpoint,                    // Endpoint addres information
00108         pszSecurity);                   // Security
00109     EXIT_IF_FAIL(nStatus, "RpcServerUseProtseqsEp");
00110
00111
00112     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00113     /* Now start listening for remote procedure calls from the client   */
00114     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00115     RpcTryExcept
00116     {
00117         _tprintf(TEXT("Listening for remote calls...\n"));
00118         nStatus = RpcServerListen(
00119             1,                              // The minimum number of calls
00120             RPC_C_LISTEN_MAX_CALLS_DEFAULT, // The maximum number of calls
00121             FALSE);                         // Continue until stopped
00122         EXIT_IF_FAIL(nStatus, "RpcServerListen");
00123     }
00124     RpcExcept(DO_EXCEPTION)
00125     {
00126         // Print out the exception code
00127         _tprintf(TEXT("Run-time exception %u in %s at line %d\n"),
00128                 RpcExceptionCode(), TEXT(__FILE__), __LINE__);
00129         exit(EXECUTION_FAILED);
00130     }
00131     RpcEndExcept
00132
00133     // If no exceptions occured, clean up the server and exit
00134     CleanUpServer();
00135
00136     // Deallocate the memory used for the ARGLIST if using UNICODE
00137 #ifdef _UNICODE
00138     if (NULL != szArglist)
00139         free(szArglist);
00140 #endif
00141
00142     return (EXECUTION_OK);
00143 }
00144
00145
00146 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00147 /* Procedure    : void CleanUpServer(RPC_BINDING_VECTOR);               */
00148 /* Desc.        : This procedure will unregister the interface          */
00149 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00150 void CleanUpServer(void)
00151 {
00152     RPC_STATUS nStatus;          // Error status returned from RPC calls
00153
00154     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00155     /* Unregister the interface from the RPC run-time library           */
00156     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00157     _tprintf(TEXT("Unregistering the Interface"));
00158     nStatus = RpcServerUnregisterIf(
00159         NULL, NULL, // Prevents server from receiving any new remote calls
00160         FALSE);     // Wait until all the active calls are complete
00161     EXIT_IF_FAIL(nStatus, "RpcServerUnRegisterIf");
00162 }
00163
00164
00165
00166 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00167 /* Procedure    :   midl_user_allocate() and midl_user_free()           */
00168 /* Desc.        :   These procedure are declared in the header file     */
00169 /*                  generated by the midl compiler. These procedures    */
00170 /*                  should be used for all memory allocation and        */
00171 /*                  deallocation.                                       */
00172 /*                  These procedures are also called by the stub code to*/
00173 /*                  allocate and free memory.                           */
00174 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00175 void __RPC_FAR * __RPC_API midl_user_allocate(size_t len)
00176 {
00177     return (malloc(len));
00178 }
00179
00180 void __RPC_API midl_user_free(void __RPC_FAR * ptr)
00181 {
00182     if(NULL != ptr)
00183         free (ptr);
00184 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/util.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

util.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       util.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "util.h"
00013
00014 ////////////////////////////////////////////////////////////////////
00015
00016 HRESULT _ClearAttribute(IADs* pIADs, BSTR bstrAttrName, BOOL bPostCommit)
00017 {
00018   ASSERT(pIADs != NULL);
00019   ASSERT(bstrAttrName != NULL);
00020   HRESULT hr = S_OK;
00021
00022   VARIANT varVal;
00023   ::VariantInit(&varVal);
00024
00025   // see if the attribute is there
00026   HRESULT hrFind = pIADs->Get(bstrAttrName, &varVal);
00027   if (SUCCEEDED(hrFind))
00028   {
00029     // found, need to clear the property
00030     if (bPostCommit)
00031     {
00032       // remove from the committed object
00033       hr = pIADs->PutEx(ADS_PROPERTY_CLEAR, bstrAttrName, varVal);
00034     }
00035     else
00036     {
00037       // remove from the cache of the temporary object
00038       IADsPropertyList* pPropList = NULL;
00039       hr = pIADs->QueryInterface(IID_IADsPropertyList, (void**)&pPropList);
00040       ASSERT(pPropList != NULL);
00041       if (SUCCEEDED(hr))
00042       {
00043         VARIANT v;
00044         ::VariantInit(&v);
00045         v.vt = VT_BSTR;
00046         v.bstrVal = ::SysAllocString(bstrAttrName);
00047         hr = pPropList->ResetPropertyItem(v);
00048         ::VariantClear(&v);
00049         pPropList->Release();
00050       }
00051     }
00052   }
00053
00054   ::VariantClear(&varVal);
00055   return hr;
00056 }
00057
00058
00059 ////////////////////////////////////////////////////////////////////
00060
00061 HRESULT SetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, LPCWSTR lpszVal, BOOL bPostCommit)
00062 {
00063   ASSERT(pIADs != NULL);
00064   ASSERT(lpszAttr != NULL);
00065
00066   TRACE(_T("SetStringAttribute() on bPostCommit = %s\n"), bPostCommit ? L"TRUE" : L"FALSE");
00067   TRACE(_T("\t'%s' = <%s>\n"), lpszAttr, lpszVal);
00068
00069   HRESULT hr = S_OK;
00070   BSTR bstrAttr = ::SysAllocString(lpszAttr);
00071   VARIANT varVal;
00072   ::VariantInit(&varVal);
00073   varVal.vt = VT_BSTR;
00074   varVal.bstrVal = ::SysAllocString(lpszVal);
00075
00076   if ( (lpszVal == NULL) || ((lpszVal != NULL) && (lpszVal[0] == NULL)) )
00077   {
00078     hr = _ClearAttribute(pIADs, bstrAttr, bPostCommit);
00079   }
00080   else
00081   {
00082     // set the value
00083     hr = pIADs->Put(bstrAttr, varVal);
00084   }
00085   ::SysFreeString(bstrAttr);
00086   ::VariantClear(&varVal);
00087   return hr;
00088 }
00089
00090 HRESULT GetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, CString& szVal)
00091 {
00092   ASSERT(pIADs != NULL);
00093   VARIANT varVal;
00094   ::VariantInit(&varVal);
00095
00096   BSTR bstrAttr = ::SysAllocString(lpszAttr);
00097
00098   szVal.Empty();
00099   HRESULT hr = pIADs->Get(bstrAttr, &varVal);
00100   if (SUCCEEDED(hr))
00101   {
00102     if (varVal.vt == VT_BSTR)
00103       szVal = varVal.bstrVal;
00104     else
00105       hr = E_INVALIDARG;
00106   }
00107   VariantClear(&varVal);
00108   ::SysFreeString(bstrAttr);
00109
00110   TRACE(_T("GetStringAttribute()lpszAttr = <%s>, (LPCWSTR)szVal = <%s>\n"), lpszAttr, szVal);
00111   return hr;
00112 }
00113
00114
00115
00116 HRESULT SetByteArrayAsOctetString(IADs* pIADs, LPCWSTR lpszAttr, BYTE* pByteArray, DWORD dwSize)
00117 {
00118   if (pByteArray == NULL)
00119   {
00120     CComBSTR bstrAttr = lpszAttr;
00121     return _ClearAttribute(pIADs, bstrAttr, FALSE);
00122   }
00123
00124   HRESULT hr = S_OK;
00125   SAFEARRAYBOUND rgsabound[1];
00126   rgsabound[0].lLbound = 0;
00127   rgsabound[0].cElements = dwSize;
00128
00129   SAFEARRAY* psa = SafeArrayCreate(VT_UI1, 1, rgsabound);
00130   if (psa == NULL)
00131   {
00132     return E_OUTOFMEMORY;
00133   }
00134
00135   CComVariant var;
00136   V_VT(&var) = VT_UI1|VT_ARRAY;
00137   V_ARRAY(&var) = psa;
00138
00139   for (long idx = 0; (DWORD)idx < dwSize; idx++)
00140   {
00141     hr = SafeArrayPutElement(psa, &idx, (void*)&pByteArray[idx]);
00142     if (FAILED(hr))
00143     {
00144       return hr;
00145     }
00146   }
00147
00148   hr = pIADs->Put((LPWSTR)lpszAttr, var);
00149   //SafeArrayDestroy(psa);
00150
00151   return hr;
00152 }
00153
00154 BOOL LoadFileAsByteArray(PWSTR pszPath, LPBYTE* ppByteArray, DWORD* pdwSize)
00155 {
00156   CFile file;
00157   if (!file.Open(pszPath, CFile::modeRead | CFile::shareDenyNone | CFile::typeBinary))
00158   {
00159     AfxMessageBox(_T("Failed to open file."));
00160     return FALSE;
00161   }
00162
00163   *pdwSize = file.GetLength();
00164   *ppByteArray = new BYTE[*pdwSize];
00165   ASSERT(*ppByteArray != NULL);
00166
00167   UINT uiCount = file.Read(*ppByteArray, *pdwSize);
00168   ASSERT(uiCount == *pdwSize);
00169
00170   return TRUE;
00171 }
00172
00173 ///////////////////////////////////////////////////////////////
00174 // CThumbNailPhotoHolder
00175
00176 static LPCWSTR lpszPhotoInDS = _T("<photo stored in Active-Directory>");
00177
00178
00179
00180 HRESULT CThumbNailPhotoHolder::Read(IADs* pIADs)
00181 {
00182   return E_FAIL;
00183 }
00184
00185 HRESULT CThumbNailPhotoHolder::Read(IDirectoryObject* pDirObj)
00186 {
00187   LPWSTR lpszAttrArray[] = { _T("thumbnailPhoto") };
00188   PADS_ATTR_INFO pAttrInfo;
00189   DWORD dwReturned = 0;
00190
00191   //
00192   // Get the thumbnailPhoto information from the object
00193   //
00194   HRESULT hr = pDirObj->GetObjectAttributes(lpszAttrArray, 1, &pAttrInfo, &dwReturned);
00195   if (FAILED(hr))
00196   {
00197     CString szMsg;
00198     szMsg.Format(_T("Failed to read Thumbnail Photo attribute, with hr = 0x%x\n"), hr);
00199     AfxMessageBox(szMsg);
00200     return hr;
00201   }
00202
00203
00204   if (dwReturned > 0)
00205   {
00206     ASSERT(pAttrInfo != NULL);
00207     //
00208     // Create a temporary bmp file in the temp directory
00209     //
00210
00211     WCHAR szTempPath[MAX_PATH];
00212     ::GetTempPath(MAX_PATH, szTempPath);
00213
00214     CString szPicturePath;
00215     ::GetTempFileName(szTempPath, _T("thumbnail"), 0x0, szPicturePath.GetBuffer(MAX_PATH));
00216     szPicturePath.ReleaseBuffer();
00217
00218     CFile tempPhotoFile;
00219     if (!tempPhotoFile.Open(szPicturePath,
00220         CFile::modeCreate | CFile::modeReadWrite |CFile::shareExclusive | CFile::typeBinary))
00221     {
00222       // Failed to open temp file, display error message
00223       AfxMessageBox(_T("Unable to display thumbnail photo."));
00224       return E_FAIL;
00225     }
00226
00227     ASSERT(pAttrInfo->dwADsType == ADSTYPE_OCTET_STRING);
00228
00229     //
00230     // Delete current picture if one exists
00231     //
00232     _Clear();
00233
00234     //
00235     // Create a new byte array to hold the bitmap
00236     //
00237     m_dwPictureSize = pAttrInfo->pADsValues->OctetString.dwLength;
00238     m_pPictureArray = new BYTE[m_dwPictureSize];
00239     memcpy(m_pPictureArray, pAttrInfo->pADsValues->OctetString.lpValue, m_dwPictureSize);
00240     ASSERT(m_pPictureArray != NULL);
00241
00242     //
00243     // Write the byte array to a temp file
00244     //
00245     tempPhotoFile.Write(m_pPictureArray, m_dwPictureSize);
00246     CString szPath = tempPhotoFile.GetFilePath();
00247     tempPhotoFile.Close();
00248
00249     //
00250     // Show the picture path in the read-only edit box
00251     //
00252     ::SetWindowText(m_hWndFileNameEdit, lpszPhotoInDS);
00253
00254     //
00255     // Display the picture in the static control
00256     //
00257     _DisplayPicture(szPath);
00258
00259     //
00260     // Delete temp file after picture is displayed
00261     //
00262     CFile::Remove(szPath);
00263
00264     //
00265     // Free the attribute memory
00266     //
00267     FreeADsMem(pAttrInfo);
00268   }
00269
00270   return S_OK;
00271 }
00272
00273
00274 HRESULT CThumbNailPhotoHolder::Write(IADs* pIADs)
00275 {
00276   //
00277   // Write the changes to the object
00278   //
00279   HRESULT hr = SetByteArrayAsOctetString(pIADs,
00280                                   _T("thumbnailPhoto"),
00281                                   m_pPictureArray,
00282                                   (m_pPictureArray != NULL) ? m_dwPictureSize : 0);
00283
00284   _WriteHelper(hr);
00285
00286   return hr;
00287 }
00288
00289
00290 HRESULT CThumbNailPhotoHolder::Write(IDirectoryObject* pDirObj)
00291 {
00292   ADS_ATTR_INFO attrInfo[1];
00293   PWSTR rgpwzAttrNames[] = { _T("thumbnailPhoto")};
00294   ADSVALUE Value[1];
00295
00296   //
00297   // Set the update/clear value
00298   //
00299
00300   attrInfo[0].dwADsType = ADSTYPE_OCTET_STRING;
00301   attrInfo[0].pszAttrName = rgpwzAttrNames[0];
00302
00303   Value[0].dwType = ADSTYPE_OCTET_STRING;
00304   Value[0].OctetString.dwLength = (m_pPictureArray != NULL) ? m_dwPictureSize : 0;
00305   Value[0].OctetString.lpValue = m_pPictureArray;
00306
00307   attrInfo[0].pADsValues = &Value[0];
00308   attrInfo[0].dwNumValues = 1;
00309   attrInfo[0].dwControlCode = (m_pPictureArray != NULL) ? ADS_ATTR_UPDATE : ADS_ATTR_CLEAR;
00310
00311   //
00312   // Write the changes to the object
00313   //
00314   DWORD dwModified = 0;
00315   HRESULT hr = pDirObj->SetObjectAttributes(attrInfo, 1, &dwModified);
00316
00317   _WriteHelper(hr);
00318
00319   return hr;
00320 }
00321
00322
00323 void CThumbNailPhotoHolder::_WriteHelper(HRESULT hr)
00324 {
00325   if (FAILED(hr))
00326   {
00327     CString szMsg;
00328     szMsg.Format(_T("Failed to write Thumbnail Photo attribute, with hr = 0x%x\n"), hr);
00329     AfxMessageBox(szMsg);
00330   }
00331   else
00332   {
00333     //
00334     // Show the picture path in the read-only edit box
00335     //
00336     ::SetWindowText(m_hWndFileNameEdit, (m_pPictureArray != NULL) ? lpszPhotoInDS : NULL);
00337   }
00338 }
00339
00340
00341 BOOL CThumbNailPhotoHolder::Change(HWND hWndOwner)
00342 {
00343   TCHAR szFileName[MAX_PATH] = _T("\0");
00344   OPENFILENAME OpenFileName;
00345   memset(&OpenFileName, 0, sizeof(OpenFileName));
00346
00347   //
00348   // Fill in the OPENFILENAME structure
00349   //
00350   OpenFileName.lStructSize        = sizeof(OPENFILENAME);
00351   OpenFileName.hwndOwner          = hWndOwner;
00352   OpenFileName.hInstance          = AfxGetInstanceHandle();
00353   OpenFileName.lpstrFile          = szFileName;
00354   OpenFileName.nMaxFile           = sizeof(szFileName);
00355   OpenFileName.lpstrFilter        = _T("Bitmap Files (*.bmp)\0*.bmp");
00356   OpenFileName.lpstrTitle         = _T("Select bitmap file");
00357   OpenFileName.Flags              = OFN_EXPLORER;
00358
00359   //
00360   // Open file browse dialog and retrieve the path and name of the bitmap to use.
00361   //
00362   if (GetOpenFileName(&OpenFileName))
00363   {
00364     //
00365     // Load the picture into a temporary byte array
00366     //
00367     BYTE* pNewPictureArray = NULL;
00368     DWORD dwNewPictureSize = 0x0;
00369
00370     if (!LoadFileAsByteArray(szFileName, &pNewPictureArray, &dwNewPictureSize))
00371     {
00372       CString szMsg;
00373       szMsg.Format(_T("Failed to open file %s."), szFileName);
00374       AfxMessageBox(szMsg);
00375       return FALSE;
00376     }
00377
00378     ASSERT(pNewPictureArray != NULL);
00379
00380     ::SetWindowText(m_hWndFileNameEdit, szFileName);
00381
00382     //
00383     // Display the picture in the static window
00384     //
00385     if (!_DisplayPicture(szFileName))
00386     {
00387       CString szMsg;
00388       szMsg.Format(_T("Failed to load file %s as a bitmap."), szFileName);
00389       AfxMessageBox(szMsg);
00390
00391       if (pNewPictureArray != NULL)
00392         delete pNewPictureArray;
00393       return FALSE;
00394
00395     }
00396
00397     //
00398     // Update any existing picture information
00399     //
00400     _Clear();
00401     m_pPictureArray = pNewPictureArray;
00402     m_dwPictureSize = dwNewPictureSize;
00403
00404     //
00405     // we have a new one
00406     //
00407     return TRUE;
00408   }
00409
00410   //
00411   // no change
00412   //
00413   return FALSE;
00414 }
00415
00416 BOOL CThumbNailPhotoHolder::Clear()
00417 {
00418   if (m_pPictureArray == NULL)
00419     return FALSE;
00420
00421   //
00422   // clear the picture array info
00423   //
00424   _Clear();
00425
00426   //
00427   // clear the path info
00428   //
00429   ::SetWindowText(m_hWndFileNameEdit, NULL);
00430
00431   //
00432   // clear the picture
00433   //
00434   _SetPictureControl(NULL);
00435
00436   return TRUE;
00437 }
00438
00439 BOOL CThumbNailPhotoHolder::_DisplayPicture(LPCWSTR lpszPath)
00440 {
00441   //
00442   // Load and display the picture
00443   //
00444   HBITMAP hPicture = (HBITMAP)::LoadImage(NULL, lpszPath, IMAGE_BITMAP, 0, 0 , LR_LOADFROMFILE);
00445   if (hPicture == NULL)
00446   {
00447     return FALSE;
00448   }
00449   _SetPictureControl(hPicture);
00450   return TRUE;
00451 }
00452
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/space.h Source File

  • SysMgmt
  • MMC
  • Nodes

space.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SPACE_H
00021 #define _SPACE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CRocket : public CDelegationBase {
00026 public:
00027     CRocket(_TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload);
00028     virtual ~CRocket();
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00033
00034 public:
00035     // virtual functions go here (for MMCN_*)
00036     virtual HRESULT OnRename(LPOLESTR pszNewName);
00037     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00038
00039 private:
00040     // {29743810-4C4B-11d2-89D8-000021473128}
00041     static const GUID thisGuid;
00042
00043     _TCHAR *szName;
00044     LONG   lWeight;
00045     LONG   lHeight;
00046     LONG   lPayload;
00047     int    nId;
00048     enum ROCKET_STATUS {RUNNING, PAUSED, STOPPED} iStatus;
00049 };
00050
00051 class CSpaceVehicle : public CDelegationBase {
00052 public:
00053     CSpaceVehicle();
00054
00055     virtual ~CSpaceVehicle();
00056
00057     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Future Vehicles"); }
00058     virtual const GUID & getNodeType() { return thisGuid; }
00059     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00060
00061 public:
00062     // virtual functions go here (for MMCN_*)
00063     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00064
00065 private:
00066     enum { IDM_NEW_SPACE = 4 };
00067
00068     // {29743810-4C4B-11d2-89D8-000021473128}
00069     static const GUID thisGuid;
00070
00071 private:
00072     enum { NUMBER_OF_CHILDREN = 4 };
00073     CRocket *children[NUMBER_OF_CHILDREN];
00074 };
00075
00076 #endif // _SPACE_H
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Consumer/PreComp.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Consumer

PreComp.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   Precomp.h
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #define _WIN32_WINNT 0x0400
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include <string.h>
00022 #include <tchar.h>
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/CSSamp.Cpp Source File

  • WinUI
  • GlobalDev
  • CSSamp

CSSamp.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright  1994 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // PROGRAM:    CSSAMP.cpp
00009 //
00010 // PURPOSE:    Demonstrate and test Uniscribe APIs
00011 //
00012 // PLATFORMS:  Windows 95, 98, NT 4, NT 5.
00013 //
00014
00015 #include "precomp.hxx"
00016
00017 #define GLOBALS_HERE 1
00018 #include "global.h"
00019
00020 ////    Initialise
00021 //
00022 void Initialise()
00023 {
00024     InitStyles();
00025     InitText();
00026 }
00027
00028 ///    _tWinMain - Application entry point and dispatch loop
00029 //
00030 //
00031 int WINAPI WinMain(
00032   HINSTANCE hInstance,
00033   HINSTANCE hPrevInstance,
00034   LPSTR lpszCmdLine,
00035   int nCmdShow
00036 )
00037 {
00038     MSG         msg = {0};
00039     HACCEL      hAccelTable = NULL;
00040     RECT        rc = {0};
00041     RECT        rcMain = {0};
00042     int         iRetValue = 1;
00043     BOOL        bSucess = TRUE;
00044
00045     g_hInstance = hInstance;  // Global hInstance
00046     Initialise();
00047
00048     // Create main text window
00049     g_hTextWnd = CreateTextWindow();
00050
00051     // Add dialog box on leading side
00052     if(NULL == (g_hSettingsDlg = CreateDialog(g_hInstance,TEXT("Settings"),g_hTextWnd,(DLGPROC)SettingsDlgProc)))
00053     {
00054         iRetValue = 0;
00055         goto RETURN;
00056     }
00057
00058     // Establish positon of text surface relative to the dialog
00059     GetWindowRect(g_hSettingsDlg, &rc);
00060     g_iSettingsWidth = rc.right - rc.left;
00061     g_iSettingsHeight = rc.bottom - rc.top;
00062
00063     // Establish offset from main window to settings dialog
00064     GetWindowRect(g_hTextWnd, &rcMain);
00065     g_iMinWidth = rc.right - rcMain.left;
00066     g_iMinHeight = rc.bottom - rcMain.top;
00067
00068     // Size main window to include dialog and text surface
00069     SetWindowPos(
00070         g_hTextWnd,
00071         NULL,
00072         0,0,
00073         g_iMinWidth * 29 / 10, g_iMinHeight,
00074         SWP_NOZORDER | SWP_NOMOVE);
00075
00076     ShowWindow(g_hTextWnd, SW_SHOWNORMAL);
00077     InvalidateText();
00078     UpdateWindow(g_hTextWnd);
00079
00080     // Main message loop
00081     if (g_bUnicodeWnd)
00082     {
00083         hAccelTable = LoadAcceleratorsW(g_hInstance, APPNAMEW);
00084
00085         while (0 != (bSucess = GetMessageW(&msg, (HWND) NULL, 0, 0)))
00086         {
00087             if(bSucess == -1)
00088             {
00089                 iRetValue = 1;
00090                 goto RETURN;
00091             }
00092             if (g_hSettingsDlg == (HWND) NULL ||
00093                 !IsDialogMessageW(g_hSettingsDlg, &msg) &&
00094                 !TranslateAcceleratorW(g_hTextWnd, hAccelTable, &msg))
00095             {
00096
00097                 TranslateMessage(&msg);
00098                 DispatchMessageW(&msg);
00099             }
00100         }
00101     }
00102     else
00103     {
00104         hAccelTable = LoadAcceleratorsA(g_hInstance, APPNAMEA);
00105         while (0 != (bSucess = GetMessageA(&msg, (HWND) NULL, 0, 0)))
00106         {
00107             if(bSucess == -1)
00108             {
00109                 iRetValue = 1;
00110                 goto RETURN;
00111             }
00112             if (g_hSettingsDlg == (HWND) NULL ||
00113                 !IsDialogMessageA(g_hSettingsDlg, &msg) &&
00114                 !TranslateAcceleratorA(g_hTextWnd, hAccelTable, &msg))
00115             {
00116                 TranslateMessage(&msg);
00117                 DispatchMessageA(&msg);
00118             }
00119         }
00120     }
00121
00122     iRetValue = (int)msg.wParam;
00123
00124     RETURN:
00125     FreeStyles();
00126
00127     return iRetValue;
00128 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/EditModeEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

EditModeEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: EditModeEnum
00019
00020 public class EditModeEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adEditNone = 0;
00023   public static final short adEditInProgress = 1;
00024   public static final short adEditAdd = 2;
00025   public static final short adEditDelete = 4;
00026 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRTCIMSession Member List

This is the complete list of members for CRTCIMSession, including all inherited members.
CRTCIMSession() | CRTCIMSession |
CRTCSession() | CRTCSession |
CRTCWin class | CRTCSession | [friend]
DeliverClient(RTC_CLIENT_EVENT_TYPE enEventType) | CRTCSession | [protected, virtual]
DeliverIntensity(RTC_AUDIO_DEVICE enDevice, long lLevel) | CRTCSession | [protected, virtual]
DeliverMedia(long lMediaType, RTC_MEDIA_EVENT_TYPE enType, RTC_MEDIA_EVENT_REASON enReason) | CRTCSession | [protected, virtual]
DeliverMessage(IRTCParticipant *pParticipant, BSTR bstrContentType, BSTR bstrMessage) | CRTCIMSession | [protected, virtual]
DeliverParticipantState(IRTCParticipant *pParticipant, RTC_PARTICIPANT_STATE enState) | CRTCSession | [protected, virtual]
DeliverSessionState(RTC_SESSION_STATE enState) | CRTCSession | [protected, virtual]
DeliverUserStatus(IRTCParticipant *pParticipant, RTC_MESSAGING_USER_STATUS enStatus) | CRTCIMSession | [protected, virtual]
DoDisplayMessage(PWSTR szUser, PWSTR szMessage) | CRTCIMSession | [protected]
DoDisplayTyping(PWSTR szUser, BOOL fTyping) | CRTCIMSession | [protected]
DoSendMessage() | CRTCIMSession | [protected]
DoSendTyping() | CRTCIMSession | [protected]
EditSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCIMSession | [static]
m_enState | CRTCSession | [protected]
m_fTyping | CRTCIMSession | [protected]
m_hDisplay | CRTCIMSession | [protected]
m_hEdit | CRTCIMSession | [protected]
m_hSend | CRTCIMSession | [protected]
m_hStatusBar | CRTCSession | [protected]
m_hWnd | CRTCSession | [protected]
m_pSession | CRTCSession | [protected]
m_pWin | CRTCSession | [protected]
m_wpOrigEditProc | CRTCIMSession | [protected]
OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCSession | [protected, virtual]
OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCIMSession | [protected]
OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCIMSession | [protected, virtual]
OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCIMSession | [protected, virtual]
OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCIMSession | [protected, virtual]
RegisterClass() | CRTCIMSession | [static]
SetStatusText(PWSTR szText) | CRTCSession | [protected]
ShowMessageBox(PWSTR szText) | CRTCSession | [protected]
WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCIMSession | [static]
~CRTCIMSession() | CRTCIMSession |
~CRTCSession() | CRTCSession |
Generated on Wed Nov 13 2024 16:57:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/registry.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091         _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124         _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,         // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154         MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFolderNode Member List

This is the complete list of members for CFolderNode, including all inherited members.
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CFolderNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CFolderNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CFolderNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CFolderNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CFolderNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CFolderNode | [virtual]
AddVirtualFile(NODE_PROPERTIES *pProps=NULL) | CFolderNode | [private]
AddVirtualFile(NODE_PROPERTIES *pProps=NULL) | CFolderNode | [private]
AddVirtualFile(NODE_PROPERTIES *pProps=NULL) | CFolderNode | [private]
AddVirtualFile(NODE_PROPERTIES *pProps=NULL) | CFolderNode | [private]
AddVirtualFile(NODE_PROPERTIES *pProps=NULL) | CFolderNode | [private]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CFolderNode() | CFolderNode |
CFolderNode() | CFolderNode |
CFolderNode() | CFolderNode |
CFolderNode() | CFolderNode |
CFolderNode() | CFolderNode |
CFolderNode() | CFolderNode |
Command(long lCommandID) | CFolderNode | [virtual]
Command(long lCommandID) | CFolderNode | [virtual]
Command(long lCommandID) | CFolderNode | [virtual]
Command(long lCommandID) | CFolderNode | [virtual]
Command(long lCommandID) | CFolderNode | [virtual]
Command(long lCommandID) | CFolderNode | [virtual]
ControlbarNotify(LPARAM nArg, LPARAM lParam, LONG_PTR pComp) | CFolderNode | [virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle) | CFolderNode | [inline, virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle) | CFolderNode | [inline, virtual]
EnumerateResultItems(LPRESULTDATA ipResultData) | CFolderNode | [private]
EnumerateResultItems(LPRESULTDATA ipResultData) | CFolderNode | [private]
EnumerateResultItems(LPRESULTDATA ipResultData) | CFolderNode | [private]
EnumerateResultItems(LPRESULTDATA ipResultData) | CFolderNode | [private]
EnumerateResultItems(LPRESULTDATA ipResultData) | CFolderNode | [private]
FolderNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CFolderNode | [static]
FolderNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CFolderNode | [static]
FolderNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CFolderNode | [static]
FolderNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CFolderNode | [static]
FolderNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CFolderNode | [static]
GetAttributes() | CFolderNode | [inline, virtual]
GetAttributeString() | CFolderNode | [inline, virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CFolderNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CFolderNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CFolderNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CFolderNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CFolderNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CFolderNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CFolderNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CFolderNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CFolderNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CFolderNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CFolderNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CFolderNode | [virtual]
GetNodeGUID() | CFolderNode | [inline, virtual]
GetNodeGUID() | CFolderNode | [inline, virtual]
GetNodeGUID() | CFolderNode | [inline, virtual]
GetNodeGUID() | CFolderNode | [inline, virtual]
GetNodeGUID() | CFolderNode | [inline, virtual]
GetNodeGUID() | CFolderNode | [inline, virtual]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeType() | CFolderNode | [inline, virtual]
GetNodeType() | CFolderNode | [inline, virtual]
GetNodeType() | CFolderNode | [inline, virtual]
GetNodeType() | CFolderNode | [inline, virtual]
GetNodeType() | CFolderNode | [inline, virtual]
GetNodeType() | CFolderNode | [inline, virtual]
GetObjectPath() | CFolderNode | [inline, virtual]
GetProperties(LPNODEPROPS *ppNodeProps) | CFolderNode | [virtual]
GetProperty(BSTR bstrPropertyName, PBSTR pbstrProperty) | CFolderNode | [inline, virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CFolderNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CFolderNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CFolderNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CFolderNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CFolderNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CFolderNode | [virtual]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CFolderNode | [inline, virtual]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CFolderNode | [inline, virtual]
InitDefaultVFile() | CFolderNode | [private]
InitDefaultVFile() | CFolderNode | [private]
Initialize(NODE_PROPERTIES *pNodeProps) | CFolderNode | [virtual]
Initialize(LPNODEPROPS pNodeProps) | CFolderNode | [virtual]
Initialize(NODE_PROPERTIES *pNodeProps) | CFolderNode | [virtual]
Initialize(LPNODEPROPS pNodeProps) | CFolderNode | [virtual]
Initialize(NODE_PROPERTIES *pNodeProps) | CFolderNode | [virtual]
Initialize(NODE_PROPERTIES *pNodeProps) | CFolderNode | [virtual]
IsAttributeSet(DWORD dwAttribute) | CFolderNode | [inline, virtual]
m_dwAttributes | CFolderNode | [private]
m_hAddVFileDlg | CFolderNode |
m_hMessageWnd | CFolderNode | [private]
m_NodeList | CFolderNode | [private]
m_nPropPageCount | CBaseNode | [protected]
m_pAttributeStr | CBaseNode |
m_pCompData | CFolderNode | [private]
m_pParentNode | CFolderNode | [private]
m_pwszNodeName | CBaseNode | [protected]
m_RDI | CBaseNode |
m_SDI | CBaseNode |
m_thisGUID | CFolderNode | [private, static]
OnContextHelp(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnCutOrMove(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [inline, virtual]
OnDelete(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CFolderNode | [inline, virtual]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [inline, virtual]
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnQueryPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CFolderNode | [virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [inline, virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CFolderNode | [virtual]
QueryForPropertyPage() | CFolderNode | [inline, virtual]
QueryForPropertyPage() | CFolderNode | [inline, virtual]
RefreshNodeList() | CFolderNode | [private]
RefreshNodeList() | CFolderNode | [private]
RefreshNodeList() | CFolderNode | [private]
RemoveAttribute(DWORD dwAttribute) | CFolderNode | [inline, virtual]
RemoveChildNode(LONG_PTR pChildNode) | CFolderNode |
RemoveChildNode(LONG_PTR pChildNode) | CFolderNode |
RemoveChildNodes() | CFolderNode | [private]
RemoveNodes() | CFolderNode | [private]
RemoveNodes() | CFolderNode | [private]
RemoveNodes() | CFolderNode | [private]
RemoveNodes() | CFolderNode | [private]
RemoveVirtualFile(CVirtualFile *pDeadNode) | CFolderNode |
RemoveVirtualFile(CVirtualFile *pDeadNode) | CFolderNode |
RemoveVirtualFile(CVirtualFile *pDeadNode) | CFolderNode |
SetAttribute(DWORD dwAttribute) | CFolderNode | [inline, virtual]
thisGUID | CFolderNode | [private, static]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CFolderNode() | CFolderNode | [virtual]
~CFolderNode() | CFolderNode | [virtual]
~CFolderNode() | CFolderNode | [virtual]
~CFolderNode() | CFolderNode | [virtual]
~CFolderNode() | CFolderNode | [virtual]
~CFolderNode() | CFolderNode | [virtual]
Generated on Wed Nov 13 2024 16:56:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/FreeObject/StdAfx.Cpp Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • FreeObject

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/cft.h Source File

  • Web
  • NetMeeting
  • NMUI

cft.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CFT.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 //****************************************************************************
00016 //
00017 // CLASS CFileTransferNotify
00018 //
00019 //****************************************************************************
00020
00021 class CFileTransferNotify : public RefCount, public CNotify, public INmChannelFtNotify
00022 {
00023 public:
00024   CFileTransferNotify();
00025   ~CFileTransferNotify();
00026
00027   // INmChannelNotify
00028   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00029   HRESULT STDMETHODCALLTYPE MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember);
00030   HRESULT STDMETHODCALLTYPE FtUpdate(CONFN uNotify, INmFt *pFt);
00031
00032   // ICNotify methods
00033   HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00034   HRESULT STDMETHODCALLTYPE Disconnect(void);
00035
00036   // IUnknown methods
00037   ULONG STDMETHODCALLTYPE AddRef(void);
00038   ULONG STDMETHODCALLTYPE Release(void);
00039   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
00040 };
00041
00042
00043 //****************************************************************************
00044 //
00045 // Global Routines
00046 //
00047 //****************************************************************************
00048
00049 HRESULT HookFileTransfer(INmChannel * pChannel);
00050
00051 VOID SendFile(INmMember * pMember);
00052 VOID DoFtCancel(void);
00053
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpy/ComSpy.Idl Source File

  • Com
  • Administration
  • Spy
  • ComSpy

ComSpy.Idl

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 import "oaidl.idl";
00018 import "ocidl.idl";
00019
00020   [
00021     object,
00022     uuid(27EF6FD1-AF60-11D0-B188-00AA00BA3258),
00023     helpstring("ISpyCon Interface"),
00024     pointer_default(unique)
00025   ]
00026   interface ISpyCon : IUnknown
00027   {
00028     [id(1), helpstring("method Run")] HRESULT Run();
00029   };
00030 [
00031   uuid(CBFE2577-B030-11D0-B188-00AA00BA3258),
00032   version(1.0),
00033   helpstring("ComSpy 1.0 Type Library")
00034 ]
00035 library COMSPYLib
00036 {
00037   importlib("stdole32.tlb");
00038   importlib("stdole2.tlb");
00039
00040   [
00041     uuid(27EF6FD2-AF60-11D0-B188-00AA00BA3258),
00042     helpstring("SpyCon Class")
00043   ]
00044   coclass SpyCon
00045   {
00046     [default] interface ISpyCon;
00047   };
00048 };
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/comp.Cpp Source File

  • SysMgmt
  • MMC
  • Complete

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "resource.h"
00024 #include "DeleBase.h"
00025 #include "CompData.h"
00026 #include "globals.h"
00027
00028
00029 #define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
00030
00031 CComponent::CComponent(CComponentData *parent)
00032 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL)
00033 {
00034     OBJECT_CREATED
00035     m_ipControlBar  = NULL;
00036     m_ipToolbar     = NULL;
00037 }
00038
00039 CComponent::~CComponent()
00040 {
00041     OBJECT_DESTROYED
00042 }
00043
00044 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00045 {
00046     if (!ppv)
00047         return E_FAIL;
00048
00049     *ppv = NULL;
00050
00051     if (IsEqualIID(riid, IID_IUnknown))
00052         *ppv = static_cast<IComponent *>(this);
00053     else if (IsEqualIID(riid, IID_IComponent))
00054         *ppv = static_cast<IComponent *>(this);
00055
00056     // first things first, make sure that when MMC
00057     // asks if we do property sheets, that we actually
00058     // say "yes"
00059     else if (IsEqualIID(riid, IID_IExtendPropertySheet))
00060         *ppv = static_cast<IExtendPropertySheet2 *>(this);
00061     else if (IsEqualIID(riid, IID_IExtendPropertySheet2))
00062         *ppv = static_cast<IExtendPropertySheet2 *>(this);
00063     else if (IsEqualIID(riid, IID_IExtendControlbar))
00064         *ppv = static_cast<IExtendControlbar *>(this);
00065
00066     if (*ppv)
00067     {
00068         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00069         return S_OK;
00070     }
00071
00072     return E_NOINTERFACE;
00073 }
00074
00075 STDMETHODIMP_(ULONG) CComponent::AddRef()
00076 {
00077     return InterlockedIncrement((LONG *)&m_cref);
00078 }
00079
00080 STDMETHODIMP_(ULONG) CComponent::Release()
00081 {
00082     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00083     {
00084         delete this;
00085         return 0;
00086     }
00087     return m_cref;
00088
00089 }
00090
00091 ///////////////////////////////
00092 // Interface IComponent
00093 ///////////////////////////////
00094 STDMETHODIMP CComponent::Initialize(
00095                                     /* [in] */ LPCONSOLE lpConsole)
00096 {
00097     HRESULT hr = S_OK;
00098
00099     // Save away all the interfaces we'll need.
00100     // Fail if we can't QI the required interfaces.
00101
00102     m_ipConsole = lpConsole;
00103     m_ipConsole->AddRef();
00104
00105     return hr;
00106 }
00107
00108 STDMETHODIMP CComponent::Notify(
00109                                 /* [in] */ LPDATAOBJECT lpDataObject,
00110                                 /* [in] */ MMC_NOTIFY_TYPE event,
00111                                 /* [in] */ LPARAM arg,
00112                                 /* [in] */ LPARAM param)
00113 {
00114     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00115
00116     HRESULT hr = S_FALSE;
00117     CDelegationBase *base = NULL;
00118
00119     // we need to watch for property change and delegate it
00120     // a little differently, we're actually going to send
00121     // the CDelegationBase object pointer in the property page
00122     // PSN_APPLY handler via MMCPropPageNotify()
00123     if (MMCN_PROPERTY_CHANGE != event && MMCN_VIEW_CHANGE != event) {
00124         if (NULL == lpDataObject)
00125             return S_FALSE;
00126
00127         base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00128
00129     } else if (MMCN_PROPERTY_CHANGE == event) {
00130         base = (CDelegationBase *)param;
00131     }
00132
00133
00134   // MMCN_VIEW_CHANGE
00135
00136   static CDelegationBase *pLastPasteQuery = NULL;
00137
00138   if (MMCN_VIEW_CHANGE == event) {
00139
00140     switch (param) {//arg holds the data. For a scope item, this is the
00141             //item's myhscopeitem. For a result item, this is
00142             //the item's nId value, but we don't use it
00143
00144             //param holds the hint passed to IConsole::UpdateAllViews.
00145               //hint is a value of the UPDATE_VIEWS_HINT enumeration
00146
00147     case UPDATE_SCOPEITEM:
00148       hr = m_ipConsole->SelectScopeItem( (HSCOPEITEM)arg );
00149       _ASSERT( S_OK == hr);
00150       break;
00151     case UPDATE_RESULTITEM:
00152       base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00153       hr = base->OnUpdateItem(m_ipConsole, (long)arg, RESULT);
00154       break;
00155     }
00156
00157     return S_OK;
00158   }
00159
00160
00161   //The remaining notifications
00162
00163     switch (event)      {
00164     case MMCN_SHOW:
00165         hr = base->OnShow(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00166         break;
00167
00168     case MMCN_ADD_IMAGES:
00169         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00170         break;
00171
00172     case MMCN_SELECT:
00173         hr = base->OnSelect(this, m_ipConsole, (BOOL)LOWORD(arg), (BOOL)HIWORD(arg));
00174         break;
00175
00176     case MMCN_RENAME:
00177         hr = base->OnRename((LPOLESTR)param);
00178
00179     //Now call IConsole::UpdateAllViews to redraw the item in all views.
00180     hr = m_pComponentData->m_ipConsole->UpdateAllViews(lpDataObject, 0, UPDATE_RESULTITEM);
00181     _ASSERT( S_OK == hr);
00182     break;
00183
00184   case MMCN_REFRESH:
00185     //we pass CComponentData's stored IConsole pointer here,
00186     //so that the IConsole::UpdateAllViews can be called in OnRefresh
00187     hr = base->OnRefresh(m_pComponentData->m_ipConsole);
00188     break;
00189
00190   case MMCN_DELETE: {
00191     //first delete the selected result item
00192     hr = base->OnDelete(m_ipConsole);
00193
00194     //Now call IConsole::UpdateAllViews to redraw all views
00195     //owned by the parent scope item. OnRefresh already does
00196     //this for us, so use it.
00197     hr = base->OnRefresh(m_pComponentData->m_ipConsole);
00198     break;
00199   }
00200
00201     // handle the property change notification if we need to do anything
00202     // special with it
00203     case MMCN_PROPERTY_CHANGE:
00204     //we pass CComponentData's stored IConsole pointer here,
00205     //so that the IConsole::UpdateAllViews can be called in OnPropertyChange
00206         hr = base->OnPropertyChange(m_pComponentData->m_ipConsole, this);
00207         break;
00208     }
00209
00210     return hr;
00211 }
00212
00213 STDMETHODIMP CComponent::Destroy(
00214                                  /* [in] */ MMC_COOKIE cookie)
00215 {
00216     if (m_ipConsole) {
00217         m_ipConsole->Release();
00218         m_ipConsole = NULL;
00219     }
00220
00221     return S_OK;
00222 }
00223
00224
00225 STDMETHODIMP CComponent::QueryDataObject(
00226                                          /* [in] */ MMC_COOKIE cookie,
00227                                          /* [in] */ DATA_OBJECT_TYPES type,
00228                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00229 {
00230     CDataObject *pObj = NULL;
00231
00232     if (cookie == 0)
00233         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00234     else
00235         pObj = new CDataObject(cookie, type);
00236
00237     if (!pObj)
00238         return E_OUTOFMEMORY;
00239
00240     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00241
00242     return S_OK;
00243 }
00244
00245 STDMETHODIMP CComponent::GetResultViewType(
00246                                            /* [in] */ MMC_COOKIE cookie,
00247                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00248                                            /* [out] */ long __RPC_FAR *pViewOptions)
00249 {
00250     CDelegationBase *base = (CDelegationBase *)cookie;
00251
00252     //
00253     // Ask for default listview.
00254     //
00255     if (base == NULL)
00256     {
00257         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00258         *ppViewType = NULL;
00259     }
00260     else
00261         return base->GetResultViewType(ppViewType, pViewOptions);
00262
00263     return S_OK;
00264 }
00265
00266 STDMETHODIMP CComponent::GetDisplayInfo(
00267                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00268 {
00269     HRESULT hr = S_OK;
00270     CDelegationBase *base = NULL;
00271
00272     // if they are asking for the RDI_STR we have one of those to give
00273
00274     if (pResultDataItem->lParam) {
00275         base = (CDelegationBase *)pResultDataItem->lParam;
00276         if (pResultDataItem->mask & RDI_STR) {
00277                         LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00278                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00279             pResultDataItem->str = pszW;
00280         }
00281
00282         if (pResultDataItem->mask & RDI_IMAGE) {
00283             pResultDataItem->nImage = base->GetBitmapIndex();
00284         }
00285     }
00286
00287     return hr;
00288 }
00289
00290
00291 STDMETHODIMP CComponent::CompareObjects(
00292                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00293                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00294 {
00295     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00296     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00297
00298     // compare the object pointers
00299     if (baseA->GetCookie() == baseB->GetCookie())
00300         return S_OK;
00301
00302     return S_FALSE;
00303 }
00304
00305 ///////////////////////////////////
00306 // Interface IExtendPropertySheet2
00307 ///////////////////////////////////
00308 HRESULT CComponent::CreatePropertyPages(
00309                                         /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00310                                         /* [in] */ LONG_PTR handle,
00311                                         /* [in] */ LPDATAOBJECT lpIDataObject)
00312 {
00313     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00314
00315     return base->CreatePropertyPages(lpProvider, handle);
00316 }
00317
00318 HRESULT CComponent::QueryPagesFor(
00319                                   /* [in] */ LPDATAOBJECT lpDataObject)
00320 {
00321     CDelegationBase *base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00322
00323     return base->HasPropertySheets();
00324 }
00325
00326 HRESULT CComponent::GetWatermarks(
00327                                   /* [in] */ LPDATAOBJECT lpIDataObject,
00328                                   /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00329                                   /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00330                                   /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00331                                   /* [out] */ BOOL __RPC_FAR *bStretch)
00332 {
00333     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00334
00335     return base->GetWatermarks(lphWatermark, lphHeader, lphPalette, bStretch);
00336 }
00337
00338 ///////////////////////////////
00339 // Interface IExtendControlBar
00340 ///////////////////////////////
00341 static MMCBUTTON SnapinButtons1[] =
00342 {
00343     { 0, ID_BUTTONSTART, TBSTATE_ENABLED, TBSTYLE_GROUP, L"Start Vehicle", L"Start Vehicle" },
00344     { 1, ID_BUTTONPAUSE, TBSTATE_ENABLED, TBSTYLE_GROUP, L"Pause Vehicle", L"Pause Vehicle"},
00345     { 2, ID_BUTTONSTOP,  TBSTATE_ENABLED, TBSTYLE_GROUP, L"Stop Vehicle",  L"Stop Vehicle" },
00346 };
00347
00348 HRESULT CComponent::SetControlbar(
00349                                   /* [in] */ LPCONTROLBAR pControlbar)
00350 {
00351     HRESULT hr = S_OK;
00352
00353     //
00354     //  Clean up
00355     //
00356
00357     // if we've got a cached toolbar, release it
00358     if (m_ipToolbar) {
00359         m_ipToolbar->Release();
00360         m_ipToolbar = NULL;
00361     }
00362
00363     // if we've got a cached control bar, release it
00364     if (m_ipControlBar) {
00365         m_ipControlBar->Release();
00366         m_ipControlBar = NULL;
00367     }
00368
00369
00370     //
00371     // Install new pieces if necessary
00372     //
00373
00374     // if a new one came in, cache and AddRef
00375     if (pControlbar) {
00376         m_ipControlBar = pControlbar;
00377         m_ipControlBar->AddRef();
00378
00379         hr = m_ipControlBar->Create(TOOLBAR,  // type of control to be created
00380             dynamic_cast<IExtendControlbar *>(this),
00381             reinterpret_cast<IUnknown **>(&m_ipToolbar));
00382         _ASSERT(SUCCEEDED(hr));
00383
00384         // The IControlbar::Create AddRefs the toolbar object it created
00385         // so no need to do any addref on the interface.
00386
00387         // add the bitmap to the toolbar
00388         HBITMAP hbmp = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_TOOLBAR1));
00389         hr = m_ipToolbar->AddBitmap(3, hbmp, 16, 16, RGB(0, 128, 128)); // NOTE, hardcoded value 3
00390         _ASSERT(SUCCEEDED(hr));
00391
00392         // Add the buttons to the toolbar
00393         hr = m_ipToolbar->AddButtons(ARRAYLEN(SnapinButtons1), SnapinButtons1);
00394         _ASSERT(SUCCEEDED(hr));
00395     }
00396
00397     return hr;
00398 }
00399
00400 HRESULT CComponent::ControlbarNotify(
00401                                      /* [in] */ MMC_NOTIFY_TYPE event,
00402                                      /* [in] */ LPARAM arg,
00403                                      /* [in] */ LPARAM param)
00404 {
00405     HRESULT hr = S_OK;
00406
00407     if (event == MMCN_SELECT) {
00408         BOOL bScope = (BOOL) LOWORD(arg);
00409         BOOL bSelect = (BOOL) HIWORD(arg);
00410
00411         CDelegationBase *base = GetOurDataObject(reinterpret_cast<IDataObject *>(param))->GetBaseNodeObject();
00412         hr = base->OnSetToolbar(m_ipControlBar, m_ipToolbar, bScope, bSelect);
00413     }
00414
00415   else if (event == MMCN_BTN_CLICK) {
00416         CDelegationBase *base = GetOurDataObject(reinterpret_cast<IDataObject *>(arg))->GetBaseNodeObject();
00417         hr = base->OnToolbarCommand(m_pComponentData->m_ipConsole, (MMC_CONSOLE_VERB)param, reinterpret_cast<IDataObject *>(arg));
00418     }
00419
00420     return hr;
00421 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/gutils.h Source File

  • Begin
  • sdkdiff

gutils.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /* standard header for gutils.dll library functions
00012  * include after windows.h
00013  */
00014 #ifndef __GUTILS_H__
00015 #define __GUTILS_H__
00016
00017 #define DimensionOf(x) (sizeof(x) / sizeof(x[0]))
00018
00019 /*--------win-16 win-32 porting macros etc ----------------------------*/
00020
00021 /* win32 msg crackers */
00022 #define GET_WM_COMMAND_ID(w, l) (LOWORD(w))
00023 #define GET_WM_COMMAND_CMD(w, l) (HIWORD(w))
00024 #define GET_WM_COMMAND_HWND(w, l) (l)
00025 #define GET_SCROLL_OPCODE(w, l)     (LOWORD(w))
00026 #define GET_SCROLL_POS(w, l)        (HIWORD(w))
00027 #define WINPROCTYPE     WNDPROC
00028
00029 // function for initializing gutils
00030 BOOL WINAPI InitGutils(HANDLE hInstance, DWORD dwReason, LPVOID reserved);
00031
00032
00033
00034 /* ---- file open/save common dialogs ---------------------------*/
00035
00036 /*
00037  * these functions now rely on to calls to the common dialog libraries.
00038  *
00039  * parameters:
00040  *      prompt - user prompt text (eg for dialog title)
00041  *      ext    - default extension (eg ".txt")
00042  *      spec   - default file spec (eg "*.*")
00043  *      pszFull - full filename will be copied here.
00044  *      cchMax - size of pszFull buffer.
00045  *      fn     - last component of file name will be copied here.
00046  * returns - TRUE if user selected a file that could be opened for
00047  *           reading (gfile_open) or created and opened for writing (gfile_new)
00048  *           FALSE if user canceled. if user selects a file that cannot be
00049  *           opened, a message box is put up and the dialog re-shown.
00050  */
00051 BOOL APIENTRY gfile_open(HWND hwnd, LPSTR prompt, LPSTR ext, LPSTR spec,
00052                          LPSTR pszFull, int cchMax, LPSTR fn);
00053 BOOL APIENTRY gfile_new(LPSTR prompt, LPSTR ext, LPSTR spec,
00054                         LPSTR pszFull, int cchMax, LPSTR fn);
00055
00056
00057
00058 /* --- status line window class ---------------------------------- */
00059 /* The status line is a bar across the top or bottom of the window.
00060  * It can hold a number of fields which can be either static text
00061  * or buttons.  The so called "static" text can be changed at any time.
00062  * The fields can be left or right aligned (default is RIGHT).
00063  * If the text is marked as VAR then the screen real estate allocated
00064  * for it will be adjusted whenever the text changes.  VAR fields
00065  * can be given minimum or maximum sizes (but not both).
00066  *
00067  * STATIC text fields can be drawn as raised or lowered rectangles (using
00068  * shades of grey), or (default) without a border. BUTTON fields will
00069  * always be drawn as raised rectangles, and will lower when pressed.
00070  *
00071  * Button fields will send WM_COMMAND messages when clicked including the
00072  * field id and the WM_LBUTTONUP notification code. Note that that this
00073  * is not a full implementation of the button class, and no other messages
00074  * will be sent. In general, none of the fields of a status bar are
00075  * implemented as separate windows, so GetDlgItem() and similar calls will not
00076  * work. Buttons only respond to mouse down events, and there is no handling
00077  * of the focus or of keyboard events.
00078  *
00079  * To use:
00080  *    call StatusAlloc giving the number of items you are going to add to the
00081  *    status bar. This returns a handle to use in subsequent calls.
00082  *
00083  *    Then call StatusAddItem to define each item in turn.
00084  *    Buttons are placed in order of definition along the bar starting from
00085  *    the left (SF_LEFT) and from the right (SF_RIGHT) until the two
00086  *    sides meet.
00087  *
00088  *    Call StatusHeight to find the expected height of this status bar, and
00089  *    set its position within the parent window, then call StatusCreate to
00090  *    create the window.
00091  *
00092  * Having created the window, send SM_SETTEXT messages to set the new
00093  * text of a field (static or button), or SM_NEW with a handle (obtained from
00094  * StatusAlloc) to change the contents of the status line.
00095  */
00096
00097 /* values for type argument to StatusAddItem */
00098 #define SF_BUTTON       1
00099 #define SF_STATIC       2
00100
00101 /* bits in flags argument to StatusAddItem */
00102 #define SF_RAISE        1       /* paint static as raised 3D rectangle */
00103 #define SF_LOWER        2       /* paint static as lowered 3D rectangle */
00104 #define SF_LEFT         4       /* align field on left of status bar */
00105 #define SF_RIGHT        8       /* align field on right (DEFAULT) */
00106 #define SF_VAR          0x10    /* size of field depends on actual text extent*/
00107 #define SF_SZMAX        0x20    /* (with SF_VAR): width argument is maximum */
00108 #define SF_SZMIN        0x40    /* (with SF_VAR) width arg is minimum size */
00109
00110 /* interfaces */
00111 HWND APIENTRY StatusCreate(HANDLE hInst, HWND hParent, INT_PTR id,
00112                            LPRECT rcp, HANDLE hmem);
00113
00114 /* return the recommended height in device units of the given status bar */
00115 int APIENTRY StatusHeight(HANDLE hmem);
00116
00117 /* alloc the status bar data structures and return handle*/
00118 HANDLE APIENTRY StatusAlloc(int nitems);
00119
00120 /* set the attributes of a field.
00121  *
00122  * hmem obtained from StatusAlloc. itemnr must be less than the nitems
00123  * passed to StatusAlloc.
00124  *
00125  * the width argument is the width of the field in characters (average
00126  * character width).
00127  */
00128 BOOL APIENTRY StatusAddItem(HANDLE hmem, int itemnr, int type, int flags,
00129                             int id, int width, LPSTR text);
00130
00131 /* send these window messages to the class */
00132
00133 #define SM_NEW          (WM_USER+1)     /* wParam handle for new status line */
00134 #define SM_SETTEXT      (WM_USER+2)     /* wparam: item id, lparam new label*/
00135
00136 /* --- bit-map freelist management functions -------------------------------*/
00137
00138 /* init a pre-allocated array of longs to map nblks - set all to free
00139    you should allocate 1 DWORD in map for every 32 blocks of storage
00140    you wish to control.
00141 */
00142 void APIENTRY gbit_init(DWORD FAR * map, long nblks);
00143
00144 /* mark a range of nblks starting at blknr to be busy */
00145 BOOL APIENTRY gbit_alloc(DWORD FAR * map, long blknr, long nblks);
00146
00147 /* mark a range of nblks starting at blknr to be free */
00148 BOOL APIENTRY gbit_free(DWORD FAR * map, long blknr, long nblks);
00149
00150 /* find a free section nblks long, or the biggest found in the map if all
00151  * are less than nblks long. returns size of region found as return value,
00152  * and sets blknr to the starting blk of region. Region is *not* marked
00153  * busy
00154  */
00155 long APIENTRY gbit_findfree(DWORD FAR* map, long nblks,
00156                             long mapsize, long FAR * blknr);
00157
00158
00159 /* ----- buffered line input ----------------------------------*/
00160
00161 /*
00162  * functions for reading a file, one line at a time, with some buffering
00163  * to make the operation reasonably efficient.
00164  *
00165  * call readfile_new to initialise the buffer and give it a handle to
00166  * an open file. Call readfile_next to get a pointer to the next line.
00167  * This discards the previous line and gives you a pointer to the line
00168  * IN THE BUFFER. Make your own copy before calling readfile_next again.
00169  *
00170  * call readfile_delete once you have finished with this file. That will close
00171  * the file and free up any memory.
00172  */
00173
00174 // MAX_LINE_LENGTH is the max number of physical characters we allow in a line
00175 #define MAX_LINE_LENGTH         (4096)
00176 // BUFFER_SIZE is expressed in bytes, and is large enough to read in
00177 // MAX_LINE_LENGTH wide chars, and also hold MAX_LINE_LENGTH 5-byte hex code
00178 // representations of the chars.
00179 #define BUFFER_SIZE             (MAX_LINE_LENGTH * 5)
00180
00181 /* handle to a file buffer */
00182 typedef struct filebuffer FAR * FILEBUFFER;
00183
00184 /* initialise the buffering for an open file */
00185 FILEBUFFER APIENTRY readfile_new(HANDLE fh, BOOL *pfUnicode);
00186
00187 /* return a pointer to the next line in this file. line must be shorter than
00188  * buffer size (currently 1024 bytes). Line is not null-terminated: *plen
00189  * is set to the length of the line including the \n. This call will
00190  * discard any previous line, so ensure that you have made a copy of one line
00191  * before you call readfile_next again.
00192  * MUST CALL readfile_setdelims FIRST!
00193  */
00194 LPSTR APIENTRY readfile_next(FILEBUFFER fb, int FAR * plen, LPWSTR *ppwz, int *pcwch);
00195
00196 /* set the delimiters to use to break lines.  MUST call this to initialise */
00197 void APIENTRY readfile_setdelims(LPBYTE str);
00198
00199 /*
00200  * close the file and discard any associated memory and buffers.
00201  */
00202 void APIENTRY readfile_delete(FILEBUFFER fb);
00203
00204
00205 /* ------ hashing and checksums ------------------------------------------- */
00206
00207 /*
00208  * generate a 32-bit hash code for a null-terminated string of ascii text.
00209  *
00210  * if bIgnoreBlanks is TRUE, we ignore spaces and tabs during the
00211  * hashcode calculation.
00212  */
00213
00214 /* hash codes are unsigned longs */
00215
00216 DWORD APIENTRY hash_string(LPSTR string, BOOL bIgnoreBlanks);
00217 void Format(char * a, char * b);
00218
00219 /* return TRUE iff the string is blank.  Blank means the same as
00220  * the characters which are ignored in hash_string when ignore_blanks is set
00221  */
00222 BOOL APIENTRY utils_isblank(LPSTR string);
00223
00224 /*
00225  * Compare two pathnames, and if not equal, decide which should come first.
00226  *
00227  * returns 0 if the same, -1 if left is first, and +1 if right is first.
00228  *
00229  * The comparison is such that all filenames in a directory come before any
00230  * file in a subdirectory of that directory.
00231  *
00232  * To make absolutely certain that you get a canonical sorting, use AnsiLowerBuff
00233  * to convert BOTH to lower case first.  You may get a funny effect if one one
00234  * has been converted to lower case and the other not.
00235  */
00236 int APIENTRY
00237 utils_CompPath(LPSTR left, LPSTR right);
00238 /* given an open file handle open for reading, read the file and
00239  * generate a 32-bit checksum for the file
00240  */
00241
00242 /* checksums are unsigned longs */
00243 typedef DWORD CHECKSUM;
00244
00245 /* Open a file, checksum it and close it again. err !=0 iff it failed. */
00246 CHECKSUM APIENTRY checksum_file(LPCSTR fn, LONG FAR * err);
00247
00248
00249 /* --- error message output ----------------------------------------------*/
00250
00251 /*
00252  * reports error in a dialog, returns TRUE for ok, FALSE for cancel.
00253  * if fCancel is FALSE, only the OK button is shown, otherwise both ok
00254  * and cancel. hwnd is the parent window for the dlg. can be null.
00255  */
00256 BOOL APIENTRY Trace_Error(HWND hwnd, LPSTR msg, BOOL fCancel);
00257
00258 /* Write popups to a file until further notice */
00259 void Trace_Unattended(BOOL bUnattended);
00260
00261 /* --- create/write to trace file ----------------------------------------*/
00262
00263 void APIENTRY Trace_File(LPSTR msg);
00264
00265 /* --- close trace file --------------------------------------------------*/
00266 void APIENTRY Trace_Close(void);
00267
00268 /* --- simple input ------------------------------------------------------*/
00269
00270 /*
00271  * input of a single text string, using a simple dialog.
00272  *
00273  * returns TRUE if ok, or FALSE if error or user canceled. If TRUE,
00274  * puts the string entered into result (up to resultsize characters).
00275  *
00276  *
00277  * prompt is used as the prompt string, caption as the dialog caption and
00278  * def_input as the default input. All of these can be null.
00279  */
00280
00281 int APIENTRY StringInput(LPSTR result, int resultsize, LPSTR prompt,
00282                          LPSTR caption, LPSTR def_input);
00283
00284
00285
00286 /* --- sockets -----------------------------------------------------------*/
00287
00288 #ifdef SOCKETS
00289
00290     #include <winsock.h>
00291
00292 BOOL SocketConnect( LPSTR pstrServerName, u_short TCPPort, SOCKET *pSocket );
00293 BOOL SocketListen( u_short TCPPort, SOCKET *pSocket );
00294
00295 #endif
00296
00297 // These are for both SDKDIFF.EXE and GUTILS.DLL.
00298 PUCHAR My_mbspbrk(PUCHAR, PUCHAR);
00299 LPSTR My_mbschr(LPCSTR, unsigned short);
00300 LPSTR My_mbsncpy(LPSTR, LPCSTR, size_t);
00301
00302 // These are for SDKDIFF.EXE.
00303 LPSTR My_mbsrchr(LPCSTR, unsigned short);
00304 int My_mbsncmp(LPCSTR, LPCSTR, size_t);
00305 LPTSTR APIENTRY LoadRcString(UINT);
00306 #endif
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComObj/ComObjI.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ComObj

ComObjI.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      COMOBJI.H
00003
00004   Summary:   Internal include file for the COMOBJ.DLL skeleton code sample.
00005              Contains class declarations, Resource IDs and string macros for
00006              internal use in constructing this DLL.  Instead of one
00007              COMOBJ.H we split what would be the content of that file
00008              into two files.  One file, COMOBJ.H has only the external
00009              definitions needed for outside use of the DLL.  The other file,
00010              this current COMOBJI.H has definitions not needed by external
00011              users of the DLL but needed for internal use.
00012
00013              For a comprehensive tutorial code tour of COMOBJ's
00014              contents and offerings see the tutorial COMOBJ.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the COMOBJ source code.
00017
00018   Classes:   none
00019
00020   Functions: none
00021
00022   Origin:    8-5-95: atrent - Editor-inheritance from the EXESKEL source.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039
00040 #if !defined(COMOBJI_H)
00041 #define COMOBJI_H
00042
00043 // Allow other internal COMOBJ modules to get at the g_pMsgLog.
00044 extern CMsgLog* g_pMsgLog;
00045
00046
00047 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00048   Class:    CDllData
00049
00050   Summary:  Class to encapsulate global data of a the DLL.
00051
00052   Methods:  none
00053 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00054 class CDllData
00055 {
00056 public:
00057   // A place to store the loaded instance of this DLL module.
00058   HINSTANCE hDllInst;
00059
00060   // A Pointer to a Message Box object.
00061   CMsgBox* pMsgBox;
00062 };
00063
00064 // String Macros.
00065 #define ABOUT_TITLE_STR "COMOBJ: Tutorial Code Sample"
00066
00067 // Dialog IDs.
00068 #define IDD_ABOUTBOX                1000
00069
00070 // Error-related String Identifiers.
00071 #define IDS_ASSERT_FAIL             2200
00072
00073 #endif
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/fontsize/Fontsize.c Source File

  • Multimedia
  • Gdi
  • fontsize

Fontsize.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  *  FontSize.c
00004  *
00005  *  Copyright (c) Microsoft Corporation.
00006  *
00007  *  Abstract:
00008  *
00009  *      Sample program to demonstrate how a program can obtain
00010  *      the current screen "logical pixels for inch" setting,
00011  *      which the end-user can manipulate by choosing "Small fonts",
00012  *      "Large fonts", or "Custom" from the Control Panel Display
00013  *      applet.
00014  *
00015  *****************************************************************************/
00016
00017 #define STRICT
00018 #include <windows.h>
00019 #include <stdio.h>
00020
00021 /*****************************************************************************
00022  *
00023  *      Overview
00024  *
00025  *      The logical pixels per inch determines the relationship
00026  *      between logical dimensions (e.g., points) and pixels.
00027  *
00028  *      This relationship can be queried from any type of device.
00029  *      For example, printing the same bitmap on printers
00030  *      with different DPI will yield different results unless
00031  *      the application takes steps to ensure that the DPI is
00032  *      compensated for by stretching or compressing the bitmap.
00033  *
00034  *      An example of using this information for the display can
00035  *      be seen in the Windows 95 MS-DOS prompt toolbar.  If
00036  *      the logical DPI is less 120 DPI, then the toolbar
00037  *      buttons are 16 pixels square.  But if the logical
00038  *      DPI is 120 DPI or greater, then the toolbar buttons are
00039  *      24 pixels square.
00040  *
00041  *      Applications which are sensitive to the screen DPI can
00042  *      query the display DPI and adjust their pixel-based
00043  *      dimensions accordingly.
00044  *
00045  *      By convention, the value of 96 corresonds to "Small fonts"
00046  *      and the value of 120 corresponds to "Large fonts".  However,
00047  *      applications must be aware that values other than these
00048  *      can be selected by the user.  Do not assume, for example,
00049  *      that anything not equal to 120 must mean "Small fonts".
00050  *
00051  *****************************************************************************/
00052
00053 /*****************************************************************************
00054  *
00055  *  WinMain
00056  *
00057  *      Program entry point.
00058  *
00059  *      Queries the screen logical DPI and displays the result.
00060  *
00061  *****************************************************************************/
00062
00063 int WINAPI
00064 WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
00065 {
00066     HDC hdc;
00067     int iDPI;
00068     char sz[1024];
00069
00070     hdc = GetDC(NULL);                  /* Get DC for screen */
00071     iDPI = GetDeviceCaps(hdc, LOGPIXELSX);
00072     ReleaseDC(NULL, hdc);
00073
00074     if (iDPI < 96)
00075     {
00076         _snprintf(sz, sizeof(sz), "%d DPI - Even smaller than Small fonts", iDPI);
00077     }
00078     else if (iDPI == 96)
00079     {
00080         _snprintf(sz, sizeof(sz), "%d DPI - Small fonts", iDPI);
00081     }
00082     else if (iDPI < 120)
00083     {
00084         _snprintf(sz, sizeof(sz), "%d DPI - Between Small fonts and Large fonts", iDPI);
00085     }
00086     else if (iDPI == 120)
00087     {
00088         _snprintf(sz, sizeof(sz), "%d DPI - Large fonts", iDPI);
00089     }
00090     else
00091     {
00092         _snprintf(sz, sizeof(sz), "%d DPI - Even larger than Large fonts", iDPI);
00093     }
00094
00095     MessageBox(NULL, sz, "FontSize", MB_OK);
00096
00097     return 0;
00098 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFastVariant Member List

This is the complete list of members for CFastVariant, including all inherited members.
Attach(VARIANT *pSrc) | CFastVariant | [inline]
CFastVariant() | CFastVariant | [inline]
CFastVariant(const VARIANT &varSrc) | CFastVariant | [inline]
CFastVariant(const CFastVariant &varSrc) | CFastVariant | [inline]
CFastVariant(BSTR bstrSrc) | CFastVariant | [inline]
CFastVariant(LPCOLESTR lpszSrc) | CFastVariant | [inline]
CFastVariant(LPCSTR lpszSrc) | CFastVariant | [inline]
CFastVariant(bool bSrc) | CFastVariant | [inline]
CFastVariant(int nSrc) | CFastVariant | [inline]
CFastVariant(BYTE nSrc) | CFastVariant | [inline]
CFastVariant(short nSrc) | CFastVariant | [inline]
CFastVariant(long nSrc, VARTYPE vtSrc=VT_I4) | CFastVariant | [inline]
CFastVariant(float fltSrc) | CFastVariant | [inline]
CFastVariant(double dblSrc) | CFastVariant | [inline]
CFastVariant(CY cySrc) | CFastVariant | [inline]
CFastVariant(IDispatch *pSrc) | CFastVariant | [inline]
CFastVariant(IUnknown *pSrc) | CFastVariant | [inline]
ChangeType(VARTYPE vtNew, const VARIANT *pSrc=NULL) | CFastVariant | [inline]
Clear() | CFastVariant | [inline]
Copy(const VARIANT *pSrc) | CFastVariant | [inline]
DECLARE_FIXED_ALLOC(CFastVariant) | CFastVariant | [private]
Detach(VARIANT *pDest) | CFastVariant | [inline]
InternalClear() | CFastVariant | [inline]
InternalCopy(const VARIANT *pSrc) | CFastVariant | [inline]
operator!=(const VARIANT &varSrc) const | CFastVariant | [inline]
operator<(const VARIANT &varSrc) const | CFastVariant | [inline]
operator=(const CFastVariant &varSrc) | CFastVariant | [inline]
operator=(const VARIANT &varSrc) | CFastVariant | [inline]
operator=(BSTR bstrSrc) | CFastVariant | [inline]
operator=(LPCOLESTR lpszSrc) | CFastVariant | [inline]
operator=(LPCSTR lpszSrc) | CFastVariant | [inline]
operator=(bool bSrc) | CFastVariant | [inline]
operator=(int nSrc) | CFastVariant | [inline]
operator=(BYTE nSrc) | CFastVariant | [inline]
operator=(short nSrc) | CFastVariant | [inline]
operator=(long nSrc) | CFastVariant | [inline]
operator=(float fltSrc) | CFastVariant | [inline]
operator=(double dblSrc) | CFastVariant | [inline]
operator=(CY cySrc) | CFastVariant | [inline]
operator=(IDispatch *pSrc) | CFastVariant | [inline]
operator=(IUnknown *pSrc) | CFastVariant | [inline]
operator==(const VARIANT &varSrc) const | CFastVariant | [inline]
operator>(const VARIANT &varSrc) const | CFastVariant | [inline]
ReadFromStream(IStream *pStream) | CFastVariant | [inline]
WriteToStream(IStream *pStream) | CFastVariant | [inline]
~CFastVariant() | CFastVariant | [inline]
Generated on Wed Nov 13 2024 16:56:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • About

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030   static TCHAR error[64];
00031
00032   switch (verb) {
00033     case MMC_VERB_NONE:
00034     return _T("NONE");
00035     case MMC_VERB_OPEN:
00036     return _T("OPEN");
00037     case MMC_VERB_COPY:
00038     return _T("COPY");
00039     case MMC_VERB_PASTE:
00040     return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042     return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044     return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046     return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048     return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050     return _T("PRINT");
00051     case MMC_VERB_CUT:
00052     return _T("CUT");
00053   default:
00054     wsprintf(error, _T("Unknown verb id %d"), verb);
00055     return error;
00056   }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061         IComponentData *pCompData,
00062         IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064         LPARAM arg,
00065         LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069   TCHAR message[cchMessage] = {0};
00070
00071   if (bComponentData == TRUE)
00072     OutputDebugString(_T("IComponentData::Notify( "));
00073   else
00074     OutputDebugString(_T("IComponent::Notify( "));
00075
00076   wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077   OutputDebugString(message);
00078
00079     switch (event)  {
00080     case MMCN_ACTIVATE:
00081       wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082       break;
00083
00084     case MMCN_ADD_IMAGES:
00085       wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086       break;
00087
00088     case MMCN_BTN_CLICK:
00089       wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090       break;
00091
00092     case MMCN_COLUMN_CLICK:
00093       wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,   param);
00094       break;
00095
00096     case MMCN_COLUMNS_CHANGED:
00097       wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098       break;
00099
00100     case MMCN_CONTEXTHELP:
00101       wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102       break;
00103
00104     case MMCN_CONTEXTMENU:
00105       wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106       break;
00107
00108     case MMCN_CUTORMOVE:
00109       wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110       break;
00111
00112     case MMCN_DBLCLICK:
00113       wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114       break;
00115
00116     case MMCN_DELETE:
00117       wsprintf(message, _T("MMCN_DELETE\n"));
00118       break;
00119
00120     case MMCN_DESELECT_ALL:
00121       wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122       break;
00123
00124     case MMCN_EXPAND:
00125       wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126       break;
00127
00128     case MMCN_EXPANDSYNC:
00129       wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130       break;
00131
00132     case MMCN_FILTERBTN_CLICK:
00133       wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134       break;
00135
00136     case MMCN_FILTER_CHANGE:
00137       wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138       break;
00139
00140     case MMCN_HELP:
00141       wsprintf(message, _T("MMCN_HELP\n"));
00142       break;
00143
00144     case MMCN_INITOCX:
00145       wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146       break;
00147
00148     case MMCN_LISTPAD:
00149       wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150       break;
00151
00152     case MMCN_MENU_BTNCLICK:
00153       wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154       break;
00155
00156     case MMCN_MINIMIZED:
00157       wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158       break;
00159
00160     case MMCN_PASTE:
00161       wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162       break;
00163
00164     case MMCN_PRELOAD:
00165       wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166       break;
00167
00168     case MMCN_PRINT:
00169       wsprintf(message, _T("MMCN_PRINT\n"));
00170       break;
00171
00172     case MMCN_PROPERTY_CHANGE:
00173       wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174       break;
00175
00176     case MMCN_QUERY_PASTE:
00177       wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178       break;
00179
00180     case MMCN_REFRESH:
00181       wsprintf(message, _T("MMCN_REFRESH\n"));
00182       break;
00183
00184     case MMCN_REMOVE_CHILDREN:
00185       wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186       break;
00187
00188     case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192       StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193       break;
00194
00195     case MMCN_RESTORE_VIEW:
00196       wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197       break;
00198
00199     case MMCN_SELECT:
00200       wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201       break;
00202
00203     case MMCN_SHOW:
00204       wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205       break;
00206
00207     case MMCN_SNAPINHELP:
00208       wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209       break;
00210
00211     case MMCN_VIEW_CHANGE:
00212       wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213       break;
00214   }
00215
00216   if (message[0] != 0)
00217     OutputDebugString(message);
00218   else
00219     OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222   return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTextGrid Member List

This is the complete list of members for CTextGrid, including all inherited members.
_cCol | CGrid | [protected]
_cRow | CGrid | [protected]
_font | CTextGrid | [protected]
_iEltOffset | CTextGrid | [protected]
_pCharUsed | CTextGrid | [protected]
_ptOrg | CTextGrid | [protected]
_size | CGrid | [protected]
CGrid() | CGrid | [inline]
CTextGrid() | CTextGrid | [inline]
Detach() | CGrid |
Draw(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject) | CGrid |
DrawElement(CCanvas &canvas, COORD x, COORD y, UINT i, UINT j)=0 | CTextGrid | [pure virtual]
FindBehavior(BSTR bstrBehavior, BSTR bstrBehaviorUrl, IElementBehaviorSite *pSite, IElementBehavior **ppBehavior) | CGrid |
get_GridSize(long *pVal) | CGrid |
GetPainterInfo(HTML_PAINTER_INFO *pInfo) | CGrid |
GridSize([out, retval] long *pVal) | IGrid |
GridSize([in] long newVal) | IGrid |
Hittest(POINT pt, POINT ptTest) | CTextGrid |
HitTestPoint(POINT pt, BOOL *pbHit, LONG *plPartID) | CGrid |
Init(IElementBehaviorSite *pBehaviorSite) | CGrid |
m_lClientLeft | CGrid |
m_lClientTop | CGrid |
m_lGridSize | CGrid |
m_spPaintSite | CGrid |
m_spSite | CGrid |
Notify(LONG lEvent, VARIANT *pVar) | CGrid |
OnResize(SIZE size) | CGrid |
Paint(CCanvas &canvas, RECT rc, POINT pt) | CTextGrid | [virtual]
put_GridSize(long newVal) | CGrid |
SetCharTable() | CTextGrid |
SetFont(HFONT hfont) | CTextGrid |
SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) | CGrid |
SetTextOrg() | CTextGrid | [inline]
SetTextOrg(COORD x, COORD y) | CTextGrid | [inline]
Trace(WCHAR *message) | CGrid | [inline]
~CTextGrid() | CTextGrid | [inline]
Generated on Wed Nov 13 2024 16:57:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/dataobj.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

dataobj.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _CLASS_CDATAOBJECT_
00015 #define _CLASS_CDATAOBJECT_
00016
00017 #include "Globals.h"
00018 #include "StaticNode.h"
00019
00020 //---------------------------------------------------------------------------
00021 class CDataObject : public IDataObject
00022 {
00023   private:
00024     ULONG     m_cRef;
00025     ULONG_PTR      m_uCookie;
00026     ULONG          m_uContext;
00027
00028   public:
00029     CDataObject();
00030     ~CDataObject();
00031
00032   public:  // Interface IUnknown
00033     STDMETHODIMP QueryInterface( REFIID riid, LPVOID* ppv );
00034     STDMETHODIMP_(ULONG) AddRef();
00035     STDMETHODIMP_(ULONG) Release();
00036
00037   public:  // IDataObject methods
00038     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00039
00040     // The rest are not implemented
00041     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00042     { return E_NOTIMPL; };
00043
00044     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00045     { return E_NOTIMPL; };
00046
00047     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00048     { return E_NOTIMPL; };
00049
00050     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00051     { return E_NOTIMPL; };
00052
00053     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00054     { return E_NOTIMPL; };
00055
00056     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00057     { return E_NOTIMPL; };
00058
00059     STDMETHODIMP DUnadvise (DWORD dwConnection)
00060     { return E_NOTIMPL; };
00061
00062     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00063     { return E_NOTIMPL; };
00064
00065   ///////////////////////////////////////////////////////////////////////////
00066   // Custom Methods
00067   public:
00068     VOID   SetPrivateData( ULONG_PTR uCookie, ULONG uContext );
00069
00070     // For future use, not used in this sample
00071     ULONG  GetContext() { return m_uContext; }
00072     ULONG_PTR  GetCookie()  { return m_uCookie;  }
00073
00074   ///////////////////////////////////////////////////////////////////////////
00075   // Handlers for required clipboard formats
00076   private:
00077     HRESULT  RetrieveDisplayString( IStream* ipStream );
00078     HRESULT  RetrieveSnapInClassID( IStream* ipStream );
00079     HRESULT  RetrieveNodeTypeGuid( IStream* ipStream );
00080     HRESULT  RetrieveGuidString( IStream* ipStream );
00081     HRESULT  RetrieveBaseNodePtr( IStream* ipStream );
00082     HRESULT  RetrieveDataObjPtr( IStream* ipStream );
00083
00084 };
00085
00086 #endif //_CLASS_CDATAOBJECT_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 #include "Space.h"
00023 #include "Sky.h"
00024 #include "People.h"
00025 #include "Land.h"
00026
00027 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00028
00029 //==============================================================
00030 //
00031 // CStaticNode implementation
00032 //
00033 //
00034 CStaticNode::CStaticNode()
00035 {
00036     children[0] = new CPeoplePoweredVehicle;
00037     children[1] = new CLandBasedVehicle;
00038     children[2] = new CSkyBasedVehicle;
00039     children[3] = new CSpaceVehicle;
00040 }
00041
00042 CStaticNode::~CStaticNode()
00043 {
00044     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00045         if (children[n]) {
00046             delete children[n];
00047         }
00048 }
00049
00050 HRESULT CStaticNode::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00051 {
00052     SCOPEDATAITEM sdi;
00053
00054     if (!bExpanded) {
00055         // create the child nodes, then expand them
00056         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00057             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00058             sdi.mask = SDI_STR       |   // Displayname is valid
00059                 SDI_PARAM     |   // lParam is valid
00060                 SDI_IMAGE     |   // nImage is valid
00061                 SDI_OPENIMAGE |   // nOpenImage is valid
00062                 SDI_PARENT    |
00063                 SDI_CHILDREN;
00064
00065             sdi.relativeID  = (HSCOPEITEM)parent;
00066             sdi.nImage      = children[n]->GetBitmapIndex();
00067             sdi.nOpenImage  = INDEX_OPENFOLDER;
00068             sdi.displayname = MMC_CALLBACK;
00069             sdi.lParam      = (LPARAM)children[n];       // The cookie
00070             sdi.cChildren   = (n == 0); // only the first child has children
00071
00072             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00073
00074             _ASSERT( SUCCEEDED(hr) );
00075         }
00076     }
00077
00078     return S_OK;
00079 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProppageUser Member List

This is the complete list of members for CProppageUser, including all inherited members.
AddPages(LPFNADDPROPSHEETPAGE pAddPageProc, LPARAM lParam) | CProppageUser |
CProppageUser() | CProppageUser | [inline]
DECLARE_REGISTRY_CLSID() | CProppageUser |
Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObject, HKEY hKeyID) | CProppageUser |
m_spDataObj | CProppageUser | [private]
ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam) | CProppageUser |
~CProppageUser() | CProppageUser | [inline]
Generated on Wed Nov 13 2024 16:57:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MyString Member List

This is the complete list of members for MyString, including all inherited members.
Empty() | MyString | [inline]
GetCloneString() | MyString | [inline]
GetString() | MyString | [inline]
MyString() | MyString | [inline]
operator+=(const WCHAR *arg1) | MyString | [inline]
pwszString | MyString | [private]
~MyString() | MyString | [inline]
Generated on Wed Nov 13 2024 16:57:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

cascadeec::INewsEventDefault Member List

This is the complete list of members for cascadeec::INewsEventDefault, including all inherited members.
iid | cascadeec::INewsEventDefault | [static]
LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate) | cascadeec::INewsEventDefault |
NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL) | cascadeec::INewsEventDefault |
ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow) | cascadeec::INewsEventDefault |
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminApplicationExportOptions.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminApplicationExportOptions.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminApplicationExportOptions
00019
00020 public interface COMAdminApplicationExportOptions
00021 {
00022   public static final int COMAdminExportNoUsers = 0;
00023   public static final int COMAdminExportUsers = 1;
00024   public static final int COMAdminExportApplicationProxy = 2;
00025   public static final int COMAdminExportForceOverwriteOfFiles = 4;
00026 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/usrdef/Usrdefs.c Source File

  • NetDS
  • RPC
  • Handles
  • usrdef

Usrdefs.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                        usrdef Example
00005
00006     FILE:       usrdefs.c
00007
00008     USAGE:      usrdefs  -p protocol_sequence
00009                          -e endpoint
00010                          -m max calls
00011                          -n min calls
00012                          -f flag for RpcServerListen
00013
00014     PURPOSE:    Server side of RPC distributed application usrdef
00015
00016     FUNCTIONS:  main() - registers server as RPC server
00017
00018     COMMENTS:   This distributed application uses a user-defined handle.
00019
00020 ****************************************************************************/
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <ctype.h>
00025 #include "usrdef.h"    // header file generated by MIDL compiler
00026
00027 #define PURPOSE \
00028 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00029 the use of user-defined handles. For more information\n\
00030 about the [handle] attribute and RPC API functions, see the\n\
00031 RPC programming guide and reference.\n\n"
00032
00033 void Usage(char * pszProgramName)
00034 {
00035     fprintf(stderr, "%s", PURPOSE);
00036     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00037     fprintf(stderr, " -p protocol_sequence\n");
00038     fprintf(stderr, " -e endpoint\n");
00039     fprintf(stderr, " -m maxcalls\n");
00040     fprintf(stderr, " -n mincalls\n");
00041     fprintf(stderr, " -f flag_wait_op\n");
00042     exit(1);
00043 }
00044
00045 void __cdecl main(int argc, char * argv[])
00046 {
00047     RPC_STATUS status;
00048     unsigned char * pszProtocolSequence = "ncacn_np";
00049     unsigned char * pszSecurity         = NULL;
00050     unsigned char * pszEndpoint         = "\\pipe\\usrdef";
00051     unsigned int    cMinCalls           = 1;
00052     unsigned int    cMaxCalls           = 20;
00053     unsigned int    fDontWait           = FALSE;
00054     int i;
00055
00056     /* allow the user to override settings with command line switches */
00057     for (i = 1; i < argc; i++) {
00058         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00059             switch (tolower(*(argv[i]+1))) {
00060             case 'p':  // protocol sequence
00061                 pszProtocolSequence = argv[++i];
00062                 break;
00063             case 'e':
00064                 pszEndpoint = argv[++i];
00065                 break;
00066             case 'm':
00067                 cMaxCalls = (unsigned int) atoi(argv[++i]);
00068                 break;
00069             case 'n':
00070                 cMinCalls = (unsigned int) atoi(argv[++i]);
00071                 break;
00072             case 'f':
00073                 fDontWait = (unsigned int) atoi(argv[++i]);
00074                 break;
00075             case 'h':
00076             case '?':
00077             default:
00078                 Usage(argv[0]);
00079             }
00080         }
00081         else
00082             Usage(argv[0]);
00083     }
00084
00085     status = RpcServerUseProtseqEp(pszProtocolSequence,
00086                                    cMaxCalls,
00087                                    pszEndpoint,
00088                                    pszSecurity);  // Security descriptor
00089     printf("RpcServerUseProtseqEp returned 0x%x\n", status);
00090     if (status) {
00091         exit(status);
00092     }
00093
00094     status = RpcServerRegisterIf(usrdef_ServerIfHandle, // interface to register
00095                                  NULL,   // MgrTypeUuid
00096                                  NULL);  // MgrEpv; null means use default
00097     printf("RpcServerRegisterIf returned 0x%x\n", status);
00098     if (status) {
00099         exit(status);
00100     }
00101
00102     printf("Calling RpcServerListen\n");
00103     status = RpcServerListen(cMinCalls,
00104                              cMaxCalls,
00105                              fDontWait);
00106     printf("RpcServerListen returned: 0x%x\n", status);
00107     if (status) {
00108         exit(status);
00109     }
00110
00111     if (fDontWait) {
00112         printf("Calling RpcMgmtWaitServerListen\n");
00113         status = RpcMgmtWaitServerListen();  //  wait operation
00114         printf("RpcMgmtWaitServerListen returned: 0x%x\n", status);
00115         if (status) {
00116             exit(status);
00117         }
00118     }
00119
00120 }  // end main()
00121
00122 /*********************************************************************/
00123 /*                 MIDL allocate and free                            */
00124 /*********************************************************************/
00125
00126 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00127 {
00128     return(malloc(len));
00129 }
00130
00131 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00132 {
00133     free(ptr);
00134 }
00135
00136 /* end file usrdefs.c */
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • About

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CStaticNode implementation
00027 //
00028 //
00029 CStaticNode::CStaticNode()
00030 {
00031 }
00032
00033 CStaticNode::~CStaticNode()
00034 {
00035 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Behavior.h Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Behavior.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Behavior.h : Declaration of the CBehavior
00006
00007 #ifndef __BEHAVIOR_H_
00008 #define __BEHAVIOR_H_
00009
00010 #include "resource.h"       // main symbols
00011 #include "EventSink.h"
00012
00013 #define HANDLE_RADIUS 10
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CBehavior
00016 class ATL_NO_VTABLE CBehavior :
00017   public CComObjectRootEx<CComSingleThreadModel>,
00018   public CComCoClass<CBehavior, &CLSID_Behavior>,
00019   public IDispatchImpl<IBehavior, &IID_IBehavior, &LIBID_RENDERLib>,
00020   public IElementBehavior,
00021   public IHTMLPainter
00022 {
00023 public:
00024   CComPtr<IElementBehaviorSite> m_spSite;
00025   CComPtr<IElementBehaviorSiteOM> m_spOMSite;
00026   IHTMLPaintSite*         m_pPaintSite;
00027   CComPtr<IHTMLElement>           m_spElem;
00028   CComPtr<IHTMLElement>           m_spParent;
00029   CComPtr<IHTMLDocument2>     m_spDoc;
00030   CComPtr<IHTMLWindow2>     m_spWin;
00031   CComPtr<IHTMLSelectionObject> m_spSel;
00032   CComObject<CEventSink>*         m_pEventSink;
00033   DWORD                           m_dwCookie;
00034   long              m_lCookie;
00035   RECT              m_rtElemCorners;
00036   POINT             m_ptPolyCorners[4];
00037   long              m_lPartID;
00038
00039   CBehavior() :
00040     m_pEventSink(NULL),
00041     m_dwCookie(0),
00042     m_lPartID(-1)
00043   {
00044   }
00045
00046   DECLARE_REGISTRY_RESOURCEID(IDR_BEHAVIOR)
00047   DECLARE_NOT_AGGREGATABLE(CBehavior)
00048
00049   BEGIN_COM_MAP(CBehavior)
00050     //COM_INTERFACE_ENTRY(IBehavior)
00051     COM_INTERFACE_ENTRY(IDispatch)
00052     COM_INTERFACE_ENTRY(IElementBehavior)
00053     COM_INTERFACE_ENTRY(IHTMLPainter)
00054   END_COM_MAP()
00055
00056 // IElementBehavior
00057 public:
00058   STDMETHOD(Detach)(void);
00059   STDMETHOD(Init)(IElementBehaviorSite* pBehaviorSite);
00060   STDMETHOD(Notify)(LONG lEvent, VARIANT* pVar);
00061
00062 // IHTMLPainter
00063 public:
00064   STDMETHOD(Draw)(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject);
00065   STDMETHOD(GetPainterInfo)(HTML_PAINTER_INFO *pInfo);
00066   STDMETHOD(HitTestPoint)(POINT pt, BOOL *pbHit, LONG *plPartID);
00067   STDMETHOD(OnResize)(SIZE pt);
00068
00069   // Helper functions
00070   double Distance(POINT pt1, POINT pt2);
00071   HRESULT GetEventObject(IHTMLEventObj** event);
00072 };
00073
00074 #endif //__BEHAVIOR_H_
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFlipDocEditSession Member List

This is the complete list of members for CFlipDocEditSession, including all inherited members.
_pContext | CEditSessionBase | [protected]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CFlipDocEditSession(ITfContext *pContext) | CFlipDocEditSession | [inline]
DoEditSession(TfEditCookie ec) | CFlipDocEditSession | [virtual]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMyInkEvents Member List

This is the complete list of members for CMyInkEvents, including all inherited members.
AddRef() | InkCollectorEvents | [inline, virtual]
AdviseInkCollector(IInkCollector *pIInkCollector) | InkCollectorEvents | [inline]
CMyInkEvents() | CMyInkEvents | [inline]
CursorButtonDown(IInkCursor *Cursor, IInkCursorButton *Button) | InkCollectorEvents | [inline, virtual]
CursorButtonUp(IInkCursor *Cursor, IInkCursorButton *Button) | InkCollectorEvents | [inline, virtual]
CursorDown(IInkCursor *Cursor, IInkStrokeDisp *Stroke) | InkCollectorEvents | [inline, virtual]
CursorInRange(IInkCursor *Cursor, VARIANT_BOOL NewCursor, VARIANT ButtonsState) | InkCollectorEvents | [inline, virtual]
CursorOutOfRange(IInkCursor *Cursor) | InkCollectorEvents | [inline, virtual]
DblClick(VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
Gesture(IInkCursor *Cursor, IInkStrokes *Strokes, VARIANT Gestures, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid) | InkCollectorEvents | [inline]
GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo) | InkCollectorEvents | [inline]
GetTypeInfoCount(UINT *pctinfo) | InkCollectorEvents | [inline]
Init(HWND hWnd) | CMyInkEvents | [inline]
InkCollectorEvents::Init() | InkCollectorEvents | [inline]
InkCollectorEvents() | InkCollectorEvents | [inline]
Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD, DISPPARAMS *pdispparams, VARIANT *pvarResult, EXCEPINFO *, UINT *) | InkCollectorEvents | [inline]
m_hWnd | CMyInkEvents |
MouseDown(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long pX, long pY, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
MouseMove(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long pX, long pY, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
MouseUp(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long pX, long pY, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
MouseWheel(InkMouseButton Button, InkShiftKeyModifierFlags Shift, long Delta, long X, long Y, VARIANT_BOOL *Cancel) | InkCollectorEvents | [inline, virtual]
NewInAirPackets(IInkCursor *Cursor, long lPacketCount, VARIANT *PacketData) | InkCollectorEvents | [inline, virtual]
NewPackets(IInkCursor *Cursor, IInkStrokeDisp *Stroke, long PacketCount, VARIANT *PacketData) | InkCollectorEvents | [inline, virtual]
QueryInterface(REFIID riid, void **ppvObject) | InkCollectorEvents | [inline]
Release() | InkCollectorEvents | [inline, virtual]
Stroke(IInkCursor *Cursor, IInkStrokeDisp *Stroke, VARIANT_BOOL *Cancel) | CMyInkEvents | [inline, virtual]
SystemGesture(IInkCursor *Cursor, InkSystemGesture Id, long X, long Y, long Modifier, BSTR Character, long CursorMode) | InkCollectorEvents | [inline, virtual]
TabletAdded(IInkTablet *Tablet) | InkCollectorEvents | [inline, virtual]
TabletRemoved(long TabletId) | InkCollectorEvents | [inline, virtual]
UnadviseInkCollector() | InkCollectorEvents | [inline]
~InkCollectorEvents() | InkCollectorEvents | [inline]
Generated on Wed Nov 13 2024 16:56:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/Eap/Exports.Cpp Source File

  • NetDS
  • RRas
  • Eap

Exports.Cpp

Go to the documentation of this file.
00001 /*
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation, all rights reserved
00004
00005 Description:
00006     Implementation of DLL Exports.
00007
00008 */
00009
00010 #include <windows.h>
00011 #include <lmcons.h>
00012 #include <raseapif.h>
00013 #include <rtutils.h>
00014 #include "ceapcfg.h"
00015 #include <initguid.h>
00016 #include <atlimpl.cpp>
00017
00018 extern "C"
00019 {
00020     extern  DWORD        g_dwEapTraceId;
00021     extern  HINSTANCE    g_hInstance;
00022 }
00023
00024 CComModule  _Module;
00025
00026 const IID IID_IEAPProviderConfig = {
00027     0x66A2DB19,
00028     0xD706,
00029     0x11D0,
00030     {0xA3, 0x7B, 0x00, 0xC0, 0x4F, 0xC9, 0xDA, 0x04}
00031 };
00032
00033 // Define the EAP UI GUIDs here
00034 const CLSID CLSID_EapCfg = { /* 3b9aae60-a032-11d2-95f6-00104b98f3f5 */
00035     0x3b9aae60,
00036     0xa032,
00037     0x11d2,
00038     {0x95, 0xf6, 0x00, 0x10, 0x4b, 0x98, 0xf3, 0xf5}
00039 };
00040
00041 BEGIN_OBJECT_MAP(ObjectMap)
00042     OBJECT_ENTRY(CLSID_EapCfg, CEapCfg)
00043 END_OBJECT_MAP()
00044
00045 /*
00046
00047 Notes:
00048     DLL Entry Point
00049
00050 */
00051
00052 extern "C"
00053 BOOL WINAPI
00054 DllMain(
00055     HINSTANCE   hInstance,
00056     DWORD       dwReason,
00057     LPVOID      /*lpReserved*/
00058 )
00059 {
00060     if (dwReason == DLL_PROCESS_ATTACH)
00061     {
00062         g_hInstance = hInstance;
00063         g_dwEapTraceId = TraceRegister(L"SampleEAP");
00064         _Module.Init(ObjectMap, hInstance);
00065         DisableThreadLibraryCalls(hInstance);
00066     }
00067     else if (dwReason == DLL_PROCESS_DETACH)
00068     {
00069         TraceDeregister(g_dwEapTraceId);
00070         g_dwEapTraceId = INVALID_TRACEID;
00071         _Module.Term();
00072     }
00073
00074     return(TRUE);
00075 }
00076
00077 /*
00078
00079 Notes:
00080     Used to determine whether the DLL can be unloaded by OLE
00081
00082 */
00083
00084 STDAPI
00085 DllCanUnloadNow(
00086     VOID
00087 )
00088 {
00089     if (0 == _Module.GetLockCount())
00090     {
00091         return(S_OK);
00092     }
00093     else
00094     {
00095         return(S_FALSE);
00096     }
00097 }
00098
00099 /*
00100
00101 Notes:
00102     Returns a class factory to create an object of the requested type
00103
00104 */
00105
00106 STDAPI
00107 DllGetClassObject(
00108     REFCLSID    rclsid,
00109     REFIID      riid,
00110     LPVOID*     ppv
00111 )
00112 {
00113     return(_Module.GetClassObject(rclsid, riid, ppv));
00114 }
00115
00116 /*
00117
00118 Notes:
00119     Adds entries to the system registry. Registers object, typelib and all
00120     interfaces in typelib
00121
00122 */
00123
00124 STDAPI
00125 DllRegisterServer(
00126     VOID
00127 )
00128 {
00129     return(_Module.RegisterServer(FALSE /* bRegTypeLib */));
00130 }
00131
00132 /*
00133
00134 Notes:
00135     Removes entries from the system registry
00136
00137 */
00138
00139 STDAPI
00140 DllUnregisterServer(
00141     VOID
00142 )
00143 {
00144     _Module.UnregisterServer();
00145     return(S_OK);
00146 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCallNotify Member List

This is the complete list of members for CCallNotify, including all inherited members.
Accepted(INmConference *pConference) | CCallNotify |
Accepted(INmConference *pConference) | CCallNotify |
AddRef(void) | CCallNotify |
AddRef(void) | CCallNotify |
RefCount::AddRef(void) | RefCount |
CCallNotify() | CCallNotify |
CCallNotify() | CCallNotify | [private]
CCallNotify(Conf *) | CCallNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
CNotify(void) | CNotify |
Connect(IUnknown *pUnk) | CCallNotify |
Connect(IUnknown *pUnkOuter) | CCallNotify |
CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN) | CNotify |
Disconnect(void) | CCallNotify |
Disconnect(void) | CCallNotify |
Failed(ULONG uError) | CCallNotify |
Failed(ULONG uError) | CCallNotify |
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
GetPunk() | CNotify | [inline]
m_pConf | CCallNotify | [private]
NmUI(CONFN uNotify) | CCallNotify |
NmUI(CONFN uNotify) | CCallNotify |
QueryInterface(REFIID riid, PVOID *ppvObj) | CCallNotify |
QueryInterface(REFIID riid, PVOID *ppvObject) | CCallNotify |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
Release(void) | CCallNotify |
Release(void) | CCallNotify |
RefCount::Release(void) | RefCount |
StateChanged(NM_CALL_STATE uState) | CCallNotify |
StateChanged(NM_CALL_STATE uState) | CCallNotify |
~CCallNotify() | CCallNotify |
~CCallNotify() | CCallNotify | [virtual]
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~CNotify() | CNotify |
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Move/vc/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Move
  • vc

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  Move.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/xmldsig/MainWindow.cs Source File

  • Security
  • capicom
  • c_sharp
  • xmldsig

MainWindow.cs

Go to the documentation of this file.
00001 //******************************************************************************
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004 // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005 // WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 1999- 2002.  Microsoft Corporation.  All rights reserved.
00008 //
00009 //******************************************************************************
00010 //
00011 // MainWindow.cs
00012 //
00013 // This is a C# sample that illustrates how to use features introduced in
00014 // CAPICOM's bridging support to interop between CAPI and System.Security.xml.
00015 //
00016 // Note: for simplicity, this code does not handle exceptions.
00017 //
00018 //******************************************************************************
00019
00020 using System;
00021 using System.ComponentModel;
00022 using System.Drawing;
00023 using System.Windows.Forms;
00024 using System.Xml;
00025 using Sample;
00026
00027 namespace Sample.UI
00028 {
00029     internal class MainWindow : Form {
00030         private Container components;
00031
00032         private MenuItem helpMenu;
00033         private MenuItem aboutMenu;
00034         private MenuItem closeMenu;
00035
00036         private MenuItem fileMenu;
00037         private MenuItem openFileMenu;
00038
00039         private StatusBar statusBar;
00040
00041         private TextBox textBoxSign;
00042         private TextBox textBoxVerify;
00043
00044         private Label labelSign;
00045         private Label labelVerify;
00046
00047         private Button buttonSign;
00048         private Button buttonVerify;
00049
00050         private ComboBox keyInfoBox;
00051         private GroupBox signGroupBox;
00052
00053         private MainMenu mainMenu;
00054
00055         public MainWindow () {
00056             InitializeComponent();
00057         }
00058
00059         private void InitializeComponent() {
00060             this.SuspendLayout();
00061
00062             components = new Container();
00063             textBoxSign = new TextBox();
00064             textBoxVerify = new TextBox();
00065             labelSign = new Label();
00066             labelVerify = new Label();
00067             buttonSign = new Button();
00068             buttonVerify = new Button();
00069             keyInfoBox = new ComboBox();
00070             signGroupBox = new GroupBox();
00071             mainMenu = new MainMenu();
00072
00073             this.Menu = this.mainMenu;
00074             this.Icon = new Icon(GetType().Module.Assembly.GetManifestResourceStream("Traffic.ico"));
00075             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00076             this.Text = Messages.DemoTitle;
00077             this.ClientSize = new System.Drawing.Size(440, 520);
00078             this.MaximizeBox = false;
00079             this.FormBorderStyle = FormBorderStyle.FixedDialog;
00080
00081             labelSign.Location = new System.Drawing.Point(15, 5);
00082             labelSign.Text = "XML fragment to sign:";
00083             labelSign.Size = new System.Drawing.Size(250, 20);
00084             labelVerify.TabStop = false;
00085             labelSign.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00086
00087             labelVerify.Location = new System.Drawing.Point(15, 245);
00088             labelVerify.Text = "Signed XML fragment:";
00089             labelVerify.TabStop = false;
00090             labelVerify.Size = new System.Drawing.Size(250, 20);
00091             labelVerify.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00092
00093             textBoxSign.Anchor = (AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
00094             textBoxSign.Location = new System.Drawing.Point(15, 35);
00095             textBoxSign.ReadOnly = false;
00096             textBoxSign.ScrollBars = ScrollBars.Vertical;
00097             textBoxSign.Multiline = true;
00098             textBoxSign.Size = new System.Drawing.Size(300, 200);
00099             textBoxSign.TabIndex = 1;
00100             textBoxSign.Text = "<text>this is some text</text>";
00101             textBoxSign.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00102
00103             textBoxVerify.Anchor = (AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
00104             textBoxVerify.Location = new System.Drawing.Point(15, 275);
00105             textBoxVerify.Text = "";
00106             textBoxVerify.ReadOnly = false;
00107             textBoxVerify.ScrollBars = ScrollBars.Vertical;
00108             textBoxVerify.Multiline = true;
00109             textBoxVerify.TabIndex = 4;
00110             textBoxVerify.Size = new System.Drawing.Size(300, 200);
00111             textBoxVerify.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00112
00113             buttonSign.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
00114             buttonSign.Location = new System.Drawing.Point(15, 55);
00115             buttonSign.Size = new System.Drawing.Size(75, 25);
00116             buttonSign.TabIndex = 2;
00117             buttonSign.Font = new System.Drawing.Font("Arial", 10.5F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00118             buttonSign.Text = "&Sign";
00119             buttonSign.Click += new System.EventHandler(buttonSign_Click);
00120
00121             buttonVerify.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
00122             buttonVerify.Location = new System.Drawing.Point(348, 370);
00123             buttonVerify.Size = new System.Drawing.Size(75, 25);
00124             buttonVerify.TabIndex = 5;
00125             buttonVerify.Font = new System.Drawing.Font("Arial", 10.5F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00126             buttonVerify.Text = "&Verify";
00127             buttonVerify.Click += new System.EventHandler(buttonVerify_Click);
00128
00129             keyInfoBox.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right);
00130             keyInfoBox.DropDownWidth = 100;
00131             keyInfoBox.Items.AddRange(new object[] {"RSAKeyValue", "X509Data"});
00132             keyInfoBox.Location = new System.Drawing.Point(10, 20);
00133             keyInfoBox.Size = new System.Drawing.Size(85, 24);
00134             keyInfoBox.TabIndex = 1;
00135             keyInfoBox.Font = new System.Drawing.Font("Arial", 8.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00136             keyInfoBox.SelectedIndex = 0;
00137             keyInfoBox.Font = new System.Drawing.Font("Arial", 8.5F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00138
00139             signGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right);
00140             signGroupBox.Location = new System.Drawing.Point(330, 85);
00141             signGroupBox.Size = new System.Drawing.Size(105, 90);
00142             signGroupBox.TabIndex = 2;
00143
00144             statusBar = new StatusBar();
00145             statusBar.Text = Messages.CopyrightMessage;
00146             statusBar.Dock = DockStyle.Bottom;
00147             statusBar.Font = new System.Drawing.Font("Arial", 8.5F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00148
00149             fileMenu = new MenuItem();
00150             fileMenu = mainMenu.MenuItems.Add("&File");
00151
00152             helpMenu = new MenuItem();
00153             helpMenu = mainMenu.MenuItems.Add("&Help");
00154
00155             aboutMenu = new MenuItem("&About", new EventHandler(this.AboutBoxHandler), Shortcut.F1);
00156             closeMenu = new MenuItem("&Close", new EventHandler(this.EscapeHandler), Shortcut.AltF4);
00157             helpMenu.MenuItems.Add(aboutMenu);
00158
00159             openFileMenu = new MenuItem("&Open File", new EventHandler(this.OpenFileHandler), Shortcut.CtrlO);
00160             fileMenu.MenuItems.Add(openFileMenu);
00161             fileMenu.MenuItems.Add(closeMenu);
00162
00163             this.Controls.Add(textBoxSign);
00164             this.Controls.Add(textBoxVerify);
00165             this.Controls.Add(labelSign);
00166             this.Controls.Add(labelVerify);
00167             this.Controls.Add(buttonVerify);
00168             signGroupBox.Controls.Add(buttonSign);
00169             signGroupBox.Controls.Add(keyInfoBox);
00170             this.Controls.Add(signGroupBox);
00171             this.Controls.Add(statusBar);
00172
00173             this.ResumeLayout(false);
00174         }
00175
00176         private void AboutBoxHandler(object sender, System.EventArgs e) {
00177             AboutBox aboutBox = new AboutBox();
00178             aboutBox.ShowDialog();
00179         }
00180
00181         private void buttonSign_Click(object sender, System.EventArgs e) {
00182             switch (keyInfoBox.SelectedIndex) {
00183                 case 0:
00184                     textBoxVerify.Text = SignVerify.SignXML(textBoxSign.Text);
00185                     break;
00186                 case 1:
00187                     textBoxVerify.Text = SignVerify.SignXMLX509Data(textBoxSign.Text);
00188                     break;
00189             }
00190         }
00191
00192         private void buttonVerify_Click(object sender, System.EventArgs e) {
00193             bool bVer = SignVerify.VerifyXML(textBoxVerify.Text);
00194             if (bVer)
00195                 MessageBox.Show(Messages.SuccessMessage, Messages.DemoTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
00196             else
00197                 MessageBox.Show(Messages.FailureMessage, Messages.DemoTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00198         }
00199
00200         private void EscapeHandler(object sender, System.EventArgs e) {
00201             this.Close();
00202         }
00203
00204         private void OpenFileHandler(object sender, System.EventArgs e) {
00205             OpenFileDialog openFileDialog = new OpenFileDialog();
00206             openFileDialog.CheckPathExists = true;
00207             openFileDialog.CheckFileExists = true;
00208             openFileDialog.InitialDirectory = "c:\\" ;
00209             openFileDialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*" ;
00210             DialogResult dialogResult = openFileDialog.ShowDialog(this);
00211             if (dialogResult == DialogResult.OK) {
00212                 try {
00213                     // See whether the file is a valid XML document
00214                     XmlDocument xmlDoc = new XmlDocument();
00215                     xmlDoc.PreserveWhitespace = true;
00216                     xmlDoc.Load(openFileDialog.FileName);
00217                     textBoxSign.Text = xmlDoc.OuterXml;
00218                 } catch (Exception exc) {
00219                     MessageBox.Show(exc.ToString(), Messages.ExceptionTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00220                 }
00221             }
00222         }
00223     }
00224 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/compdata.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

compdata.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #ifndef _CLASS_CCOMPONENTDATA_
00016 #define _CLASS_CCOMPONENTDATA_
00017
00018
00019 #include "Globals.h"
00020 #include "BaseNode.h"
00021
00022 class  CStaticNode;           // References
00023
00024 //---------------------------------------------------------------------------
00025 class CComponentData : public IComponentData2,
00026                               IExtendContextMenu
00027 {
00028   private:
00029     ULONG                m_cRef;
00030     LPCONSOLE3           m_ipConsole;
00031     LPCONSOLENAMESPACE2  m_ipConsoleNameSpace;
00032     CStaticNode*         m_pStaticNode;
00033     HSCOPEITEM           m_hStaticNode;
00034
00035   public:
00036     CComponentData();
00037     ~CComponentData();
00038
00039     /////////////////////////////////////////////////////////////////////////
00040     // Interface IUnknown
00041     //
00042     STDMETHODIMP QueryInterface( REFIID riid, LPVOID *ppv );
00043     STDMETHODIMP_(ULONG) AddRef();
00044     STDMETHODIMP_(ULONG) Release();
00045
00046     /////////////////////////////////////////////////////////////////////////
00047     // Interface IComponentData
00048     //
00049     HRESULT STDMETHODCALLTYPE Initialize
00050             ( /*[in]*/ LPUNKNOWN pUnknown );
00051
00052     HRESULT STDMETHODCALLTYPE CreateComponent
00053             ( /*[out]*/ LPCOMPONENT __RPC_FAR* ppComponent);
00054
00055     HRESULT STDMETHODCALLTYPE Notify
00056             ( /*[in]*/ LPDATAOBJECT ipDataObject,
00057               /*[in]*/ MMC_NOTIFY_TYPE MmcEvent,
00058               /*[in]*/ LONG nArg,
00059               /*[in]*/ LONG nParam
00060             );
00061
00062     HRESULT STDMETHODCALLTYPE Destroy( void);
00063
00064     HRESULT STDMETHODCALLTYPE QueryDataObject
00065             ( /*[in]*/  MMC_COOKIE uCookie,
00066               /*[in]*/  DATA_OBJECT_TYPES nEnumType,
00067               /*[out]*/ LPDATAOBJECT __RPC_FAR* ppDataObject
00068             );
00069
00070     HRESULT STDMETHODCALLTYPE GetDisplayInfo
00071             ( /*[out][in]*/ SCOPEDATAITEM __RPC_FAR* pScopeDataItem );
00072
00073     HRESULT STDMETHODCALLTYPE CompareObjects
00074             ( /*[in]*/ LPDATAOBJECT ipDataObjectA,
00075               /*[in]*/ LPDATAOBJECT ipDataObjectB
00076             );
00077
00078     HRESULT STDMETHODCALLTYPE QueryDispatch
00079             ( /*[in] */  MMC_COOKIE  nCookie,
00080               /*[in] */  DATA_OBJECT_TYPES eType,
00081               /*[out]*/  LPDISPATCH* pipDispatch
00082             );
00083
00084     /////////////////////////////////////////////////////////////////////////
00085     // Interface IExtendContextMenu
00086     //
00087     HRESULT STDMETHODCALLTYPE AddMenuItems
00088             ( /*[in]*/ LPDATAOBJECT ipDataObject,
00089               /*[in]*/ LPCONTEXTMENUCALLBACK ipCallback,
00090               /*[out][in]*/ long __RPC_FAR* pInsertionAllowed
00091             );
00092
00093     HRESULT STDMETHODCALLTYPE Command
00094             ( /*[in]*/ long lCommandID,
00095               /*[in]*/ LPDATAOBJECT piDataObject
00096             );
00097
00098   // Pulic helper methods
00099   public:
00100     CStaticNode* GetStaticNode() { return m_pStaticNode; }
00101     HRESULT      GetInterface( DWORD dwRequestedInterface,  LONG_PTR* ppInterface );
00102
00103 };
00104
00105 #endif //_CLASS_CCOMPONENTDATA_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagRowBuff Member List

This is the complete list of members for tagRowBuff, including all inherited members.
cbBmk | tagRowBuff
cdData | tagRowBuff
dwBmk | tagRowBuff
dwBmkStatus | tagRowBuff
irowbuffNext | tagRowBuff
pbBmk | tagRowBuff
ulRefCount | tagRowBuff
wBmkHash | tagRowBuff
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/childview.h Source File

  • Multimedia
  • Audio
  • multichan

childview.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 // ChildView.h : interface of the CChildView class
00006 //
00007 /////////////////////////////////////////////////////////////////////////////
00008
00009 #if !defined(AFX_CHILDVIEW_H__C382F3F2_96AC_11D2_9012_00C04FC2D3B8__INCLUDED_)
00010 #define AFX_CHILDVIEW_H__C382F3F2_96AC_11D2_9012_00C04FC2D3B8__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016 #include "dlgdest.h"
00017 #include "dlgsrc.h"
00018 #include "wave.h"
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // CChildView window
00022
00023 class CChildView : public CWnd
00024 {
00025 // Construction
00026 public:
00027   CChildView();
00028
00029 //  Attributes
00030 public:
00031     SIZE    m_sizeInitPos;
00032     int     m_cChannels;
00033
00034 // Operations
00035 public:
00036     //
00037     BOOL    UpdateDialogs(void);
00038
00039 // Overrides
00040   // ClassWizard generated virtual function overrides
00041   //{{AFX_VIRTUAL(CChildView)
00042   protected:
00043   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00044   virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
00045   //}}AFX_VIRTUAL
00046
00047 // Implementation
00048 public:
00049   virtual ~CChildView();
00050
00051   // Generated message map functions
00052 protected:
00053   //{{AFX_MSG(CChildView)
00054   afx_msg void OnPaint( );
00055   afx_msg void OnMixerMerge( );
00056   afx_msg void OnUpdateMixerMerge( CCmdUI* pCmdUI );
00057   afx_msg void OnMixerPlay( );
00058   afx_msg void OnUpdateMixerPlay( CCmdUI* pCmdUI );
00059     afx_msg void OnMixerStop( );
00060     afx_msg void OnUpdateMixerStop( CCmdUI* pCmdUI );
00061   afx_msg void OnFileSave( );
00062   afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
00063     afx_msg void OnSetfocusEditValidbits( );
00064   afx_msg void OnFileOpen( );
00065   //}}AFX_MSG
00066   DECLARE_MESSAGE_MAP()
00067 };
00068
00069 extern CChildView* g_pChildView;
00070
00071 //
00072 //  define the first non used speaker (currently)
00073 //  SPEAKER_TOP_BACK_RIGHT << 1
00074 //
00075 #define SPEAKER_NOT_SPECIFIED   0x40000
00076 #define SPEAKERS_USED           0x12
00077
00078
00079 //
00080 //  custom messages
00081 //
00082 #define WM_START_PLAYBACK   (WM_APP + 1)
00083 #define WM_STOP_PLAYBACK    (WM_APP + 2)
00084
00085 /////////////////////////////////////////////////////////////////////////////
00086
00087 //{{AFX_INSERT_LOCATION}}
00088 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00089
00090 #endif // !defined(AFX_CHILDVIEW_H__C382F3F2_96AC_11D2_9012_00C04FC2D3B8__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Maze.c Source File

  • Multimedia
  • Gdi
  • GdiDemo

Maze.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /*---------------------------------------------------------------------------*\
00013 | MAZE MODULE
00014 \*---------------------------------------------------------------------------*/
00015
00016 #include <windows.h>
00017 #include "gdidemo.h"
00018 #include  "maze.h"
00019
00020 /*---------------------------------------------------------------------------*\
00021 | CREATE MAZE WINDOW PROCEDURE
00022 \*---------------------------------------------------------------------------*/
00023 HWND FAR CreateMazeWindow(HWND hWndClient, int nItem)
00024 {
00025     HANDLE          hInstance;
00026     MDICREATESTRUCT mcs;
00027     static char buffer[256];
00028
00029
00030     hInstance = GETINSTANCE(hWndClient);
00031     LoadString (hInstance, MAZETITLE, buffer, 256);
00032
00033     /*
00034     ** Initialize the MDI create struct for creation of the
00035     ** test window.
00036     */
00037     mcs.szClass = MAZECLASS;
00038     mcs.szTitle = buffer;
00039     mcs.hOwner  = hInstance;
00040     mcs.x       = CW_USEDEFAULT;
00041     mcs.y       = CW_USEDEFAULT;
00042     mcs.cx      = CW_USEDEFAULT;
00043     mcs.cy      = CW_USEDEFAULT;
00044     mcs.style   = 0l;
00045     mcs.lParam  = (LONG)nItem;
00046
00047     return((HWND)SendMessage(hWndClient,WM_MDICREATE,0,(LPARAM)(LPMDICREATESTRUCT)&mcs));
00048 }
00049
00050
00051 /*---------------------------------------------------------------------------*\
00052 | MAZE WINDOW PROCEDURE
00053 \*---------------------------------------------------------------------------*/
00054 LRESULT CALLBACK MazeProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
00055 {
00056     switch(wMsg)
00057     {
00058         case WM_CREATE:
00059             MazeCreateProc(hWnd);
00060             break;
00061
00062
00063         case WM_COMMAND:
00064             MazeCommandProc(hWnd,wParam,lParam);
00065             break;
00066
00067         case WM_TIMER:
00068             DrawMaze(hWnd);
00069             break;
00070
00071
00072         case WM_PAINT:
00073             MazePaintProc(hWnd);
00074             break;
00075
00076
00077         case WM_DESTROY:
00078             MazeDestroyProc(hWnd);
00079             break;
00080
00081
00082         default:
00083             return(DefMDIChildProc(hWnd,wMsg,wParam,lParam));
00084     }
00085     return(0l);
00086 }
00087
00088
00089 /*---------------------------------------------------------------------------*\
00090 | MAZE CREATE PROCEDURE
00091 \*---------------------------------------------------------------------------*/
00092 BOOL MazeCreateProc(HWND hWnd)
00093 {
00094     PMAZEDATA ppd;
00095
00096
00097     if(AllocWindowInfo(hWnd,sizeof(MAZEDATA)))
00098     {
00099         if(ppd = (PMAZEDATA)LockWindowInfo(hWnd))
00100         {
00101             UnlockWindowInfo(hWnd);
00102             return(TRUE);
00103         }
00104         FreeWindowInfo(hWnd);
00105     }
00106     return(FALSE);
00107 }
00108
00109
00110 /*---------------------------------------------------------------------------*\
00111 | MAZE COMMAND PROCEDURE
00112 \*---------------------------------------------------------------------------*/
00113 BOOL MazeCommandProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
00114 {
00115     hWnd   = hWnd;
00116     wParam = wParam;
00117     lParam = lParam;
00118
00119     return(TRUE);
00120 }
00121
00122
00123 /*---------------------------------------------------------------------------*\
00124 | MAZE PAINT PROCEDURE
00125 \*---------------------------------------------------------------------------*/
00126 VOID MazePaintProc(HWND hWnd)
00127 {
00128     HDC         hDC;
00129     PAINTSTRUCT ps;
00130
00131
00132     if(hDC = BeginPaint(hWnd,&ps))
00133         EndPaint(hWnd,&ps);
00134
00135     return;
00136 }
00137
00138
00139 /*---------------------------------------------------------------------------*\
00140 | MAZE DESTROY PROCEDURE
00141 \*---------------------------------------------------------------------------*/
00142 VOID MazeDestroyProc(HWND hWnd)
00143 {
00144     KillTimer(hWnd,1);
00145     FreeWindowInfo(hWnd);
00146     return;
00147 }
00148
00149
00150 VOID DrawMaze(HWND hWnd)
00151 {
00152     hWnd = hWnd;
00153
00154     return;
00155 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step2/ADsFirstExt.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step2

ADsFirstExt.cpp

Go to the documentation of this file.
00001 // ADsFirstExt.cpp : Implementation of DLL Exports.
00002
00003
00004 // Note: Proxy/Stub Information
00005 //      To build a separate proxy/stub DLL,
00006 //      run nmake -f ADsFirstExtps.mk in the project directory.
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 #include <initguid.h>
00011 #include "ADsFirstExt.h"
00012
00013 #include "ADsFirstExt_i.c"
00014 #include "HelloWorld.h"
00015
00016
00017 CComModule _Module;
00018
00019 BEGIN_OBJECT_MAP(ObjectMap)
00020 OBJECT_ENTRY(CLSID_HelloWorld, HelloWorld)
00021 END_OBJECT_MAP()
00022
00023 class CADsFirstExtApp : public CWinApp
00024 {
00025 public:
00026
00027 // Overrides
00028   // ClassWizard generated virtual function overrides
00029   //{{AFX_VIRTUAL(CADsFirstExtApp)
00030   public:
00031     virtual BOOL InitInstance();
00032     virtual int ExitInstance();
00033   //}}AFX_VIRTUAL
00034
00035   //{{AFX_MSG(CADsFirstExtApp)
00036     // NOTE - the ClassWizard will add and remove member functions here.
00037     //    DO NOT EDIT what you see in these blocks of generated code !
00038   //}}AFX_MSG
00039   DECLARE_MESSAGE_MAP()
00040 };
00041
00042
00043 STDAPI RegisterADsExt(void);
00044 STDAPI UnRegisterADsExt(void);
00045
00046 BEGIN_MESSAGE_MAP(CADsFirstExtApp, CWinApp)
00047   //{{AFX_MSG_MAP(CADsFirstExtApp)
00048     // NOTE - the ClassWizard will add and remove mapping macros here.
00049     //    DO NOT EDIT what you see in these blocks of generated code!
00050   //}}AFX_MSG_MAP
00051 END_MESSAGE_MAP()
00052
00053 CADsFirstExtApp theApp;
00054
00055 BOOL CADsFirstExtApp::InitInstance()
00056 {
00057     _Module.Init(ObjectMap, m_hInstance, &LIBID_ADSFIRSTEXTLib);
00058     return CWinApp::InitInstance();
00059 }
00060
00061 int CADsFirstExtApp::ExitInstance()
00062 {
00063     _Module.Term();
00064     return CWinApp::ExitInstance();
00065 }
00066
00067 /////////////////////////////////////////////////////////////////////////////
00068 // Used to determine whether the DLL can be unloaded by OLE
00069
00070 STDAPI DllCanUnloadNow(void)
00071 {
00072     AFX_MANAGE_STATE(AfxGetStaticModuleState());
00073     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
00074 }
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // Returns a class factory to create an object of the requested type
00078
00079 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00080 {
00081     return _Module.GetClassObject(rclsid, riid, ppv);
00082 }
00083
00084 /////////////////////////////////////////////////////////////////////////////
00085 // DllRegisterServer - Adds entries to the system registry
00086
00087 STDAPI DllRegisterServer(void)
00088 {
00089     // registers object, typelib and all interfaces in typelib
00090   if ( SUCCEEDED(_Module.RegisterServer(TRUE) ) )
00091   {
00092          return RegisterADsExt();
00093   }
00094     return E_FAIL;
00095 }
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // DllUnregisterServer - Removes entries from the system registry
00099
00100 STDAPI DllUnregisterServer(void)
00101 {
00102   UnRegisterADsExt();
00103     return _Module.UnregisterServer(TRUE);
00104 }
00105
00106 STDAPI RegisterADsExt(void)
00107 {
00108   HRESULT hr;
00109   HKEY hKey;
00110   DWORD dwDisposition;
00111
00112
00113   hr = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00114                      _T("SOFTWARE\\Microsoft\\ADs\\Providers\\LDAP\\Extensions\\User\\{E1E3EDF8-48D1-11D2-B22B-0000F87A6B50}"),
00115              0,
00116              NULL,
00117              REG_OPTION_NON_VOLATILE,
00118              KEY_WRITE,
00119              NULL,
00120              &hKey,
00121              &dwDisposition );
00122
00123   if ( !SUCCEEDED(hr) )
00124   {
00125     return hr;
00126   }
00127
00128
00129   ///////////////////////////////////////////
00130   // Interface
00131   ////////////////////////////////////////////
00132   const wchar_t szIf[] = L"{E1E3EDF7-48D1-11D2-B22B-0000F87A6B50}\0\0";
00133
00134
00135   hr = RegSetValueEx( hKey, _T("Interfaces"), 0, REG_BINARY, (const BYTE *) szIf, sizeof(szIf));
00136
00137   RegCloseKey(hKey);
00138
00139   return hr;
00140 }
00141
00142
00143 STDAPI UnRegisterADsExt(void)
00144 {
00145
00146   LONG lResult;
00147   lResult = RegDeleteKey(  HKEY_LOCAL_MACHINE,
00148     _T("SOFTWARE\\Microsoft\\ADs\\Providers\\LDAP\\Extensions\\User\\{E1E3EDF8-48D1-11D2-B22B-0000F87A6B50}") );
00149
00150   if ( lResult == ERROR_SUCCESS )
00151   {
00152     return S_OK;
00153
00154   }
00155
00156     return E_FAIL;
00157 }
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SecurObj/Security.Cpp Source File

  • Security
  • Authorization
  • SecurObj

Security.Cpp

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1997 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009
00010    Module Name:
00011
00012        main.cpp
00013
00014    Description:
00015
00016        This module contains all the security specific functions:
00017
00018          - Creating the private object SDs
00019          - Generating and managing user tokens
00020          - AccessCheck
00021
00022 --*/
00023
00024 #define UNICODE
00025 #define _UNICODE
00026
00027
00028 #include <aclapi.h>
00029 #include "aclui.h"
00030 #include "Main.h"
00031 #include "resource.h"
00032
00033 //
00034 // Global variables for our logon code
00035 //
00036 #define MAX_LOGONS   16
00037 #define MAX_NAME     64
00038 #define MAX_PASSWORD 64
00039
00040 typedef struct _tagLogon {
00041    HANDLE hLogon;
00042    HANDLE hImpToken;
00043    WCHAR   szUsername[MAX_NAME];
00044    WCHAR   szDomain[MAX_NAME];
00045    PSECURITY_DESCRIPTOR psdCreator;
00046 } LOGON,*PLOGON;
00047
00048 LOGON Logons[MAX_LOGONS];
00049
00050 static WORD wLogonId;
00051
00052
00053 //
00054 // define our generic mapping structure for our private objects
00055 //
00056 GENERIC_MAPPING ObjMap =
00057 {
00058     ACCESS_READ,
00059     ACCESS_MODIFY,
00060     0,
00061     ACCESS_ALL
00062 };
00063
00064 #define SD_SIZE (65536 + SECURITY_DESCRIPTOR_MIN_LENGTH)
00065
00066 BOOL CheckAccess( POBJECT pObject, HANDLE hToken )
00067 {
00068    DWORD                dwAccessDesired;
00069    PRIVILEGE_SET        PrivilegeSet;
00070    DWORD                dwPrivSetSize;
00071    DWORD                dwAccessGranted;
00072    BOOL                 fAccessGranted = FALSE;
00073    WCHAR                 buffer[2048];
00074
00075    if( !IsValidSecurityDescriptor( pObject->pSD ) )
00076    {
00077       return( FALSE );
00078    }
00079
00080    //
00081    // Using AccessCheck, there are two different things we could
00082    // do:
00083    //
00084
00085    //
00086    // 1) See if I have some access rights to the object
00087    //
00088    dwAccessDesired = ACCESS_READ;
00089
00090    //
00091    // This only does something if we specify generic access rights
00092    // like GENERIC_ALL. We are not.
00093    //
00094    MapGenericMask( &dwAccessDesired, &ObjMap );
00095
00096    dwPrivSetSize = sizeof( PRIVILEGE_SET );
00097
00098    if( !AccessCheck( pObject->pSD,
00099                      hToken,
00100                      dwAccessDesired,
00101                      &ObjMap,
00102                      &PrivilegeSet,
00103                      &dwPrivSetSize,
00104                      &dwAccessGranted,
00105                      &fAccessGranted ) )
00106
00107       wsprintf( buffer, L"Error in AccessCheck : %lu\n", GetLastError() );
00108    else
00109    {
00110       if( fAccessGranted )
00111          wsprintf( buffer, L"Access Was Granted Using Mask 0x%08lx\n", dwAccessGranted );
00112       else
00113          wsprintf( buffer, L"Access was NOT granted!\n" );
00114    }
00115
00116    MessageBox( NULL, buffer, L"AccessCheck Results (is access granted)", MB_OK );
00117
00118    // 2) See what the maximum rights I have are
00119
00120    dwAccessDesired = MAXIMUM_ALLOWED;
00121
00122    if( !AccessCheck( pObject->pSD,
00123                   hToken,
00124                   dwAccessDesired,
00125                   &ObjMap,
00126                   &PrivilegeSet,
00127                   &dwPrivSetSize,
00128                   &dwAccessGranted,
00129                   &fAccessGranted ) )
00130
00131       wsprintf( buffer, L"Error in AccessCheck : %lu\n", GetLastError() );
00132    else
00133    {
00134       if( fAccessGranted )
00135          wsprintf( buffer, L"Maximum Access Allowed = 0x%08lx\n", dwAccessGranted );
00136    }
00137
00138    MessageBox( NULL, buffer, L"AccessCheck Results (maximum access)", MB_OK );
00139
00140    return( TRUE );
00141
00142 }
00143
00144 //
00145 // Build a default SD for the object creator
00146 //
00147 PSECURITY_DESCRIPTOR GetCreatorSD(WORD wIndex)
00148 {
00149    PSID pAdministratorsSid = NULL;
00150    EXPLICIT_ACCESS   ea;
00151    PACL              pOldAcl=NULL;
00152    PACL              pNewAcl=NULL;
00153    DWORD             dwResult;
00154    PSECURITY_DESCRIPTOR psdNewSD;
00155    SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY;
00156    WCHAR             buffer[1024];
00157
00158
00159    psdNewSD = LocalAlloc(LPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
00160
00161    if (NULL == psdNewSD)
00162    {
00163        return NULL;
00164    }
00165
00166    if(!InitializeSecurityDescriptor(psdNewSD,SECURITY_DESCRIPTOR_REVISION))
00167    {
00168       wsprintf(buffer, L"Error %d:InitializeSecurityDescriptor\n", GetLastError());
00169       OutputDebugString(buffer);
00170    }
00171
00172    ea.grfAccessPermissions = ACCESS_ALL;
00173    ea.grfAccessMode = GRANT_ACCESS;
00174    ea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
00175    ea.Trustee.pMultipleTrustee = NULL;
00176    ea.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
00177    ea.Trustee.TrusteeForm = TRUSTEE_IS_NAME;
00178    ea.Trustee.TrusteeType = TRUSTEE_IS_USER;
00179    GetLogonName(wIndex,buffer);
00180    ea.Trustee.ptstrName = buffer;
00181
00182
00183    dwResult = SetEntriesInAcl( 1,
00184                                &ea,
00185                                pOldAcl,
00186                                &pNewAcl );
00187    if( dwResult != ERROR_SUCCESS )
00188    {
00189       wsprintf( buffer, L"SetEntriesInAcl failed: %lu\n", dwResult );
00190       OutputDebugString( buffer );
00191    }
00192
00193
00194    pOldAcl=pNewAcl;
00195
00196   if(!AllocateAndInitializeSid(
00197         &sia,
00198         2,
00199         SECURITY_BUILTIN_DOMAIN_RID,
00200         DOMAIN_ALIAS_RID_ADMINS,
00201         0, 0, 0, 0, 0, 0,
00202         &pAdministratorsSid
00203         )) {
00204         wsprintf( buffer, L"AllocateAndInitializeSid failed: %lu\n", GetLastError() );
00205         OutputDebugString( buffer );
00206
00207    }
00208
00209    ea.grfAccessPermissions = ACCESS_ALL;
00210    ea.grfAccessMode = GRANT_ACCESS;
00211    ea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
00212    ea.Trustee.pMultipleTrustee = NULL;
00213    ea.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
00214    ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
00215    ea.Trustee.TrusteeType = TRUSTEE_IS_USER;
00216    ea.Trustee.ptstrName = (WCHAR *)pAdministratorsSid;
00217
00218
00219    dwResult = SetEntriesInAcl( 1,
00220                                &ea,
00221                                pOldAcl,
00222                                &pNewAcl );
00223    if( dwResult != ERROR_SUCCESS )
00224    {
00225       wsprintf( buffer, L"SetEntriesInAcl failed: %lu\n", dwResult );
00226       OutputDebugString( buffer );
00227    }
00228
00229
00230
00231    dwResult = SetSecurityDescriptorDacl( psdNewSD,
00232                                          TRUE,
00233                                          pNewAcl,
00234                                          FALSE );
00235    if(!dwResult)
00236    {
00237       wsprintf( buffer, L"SetSecurityDescriptor failed: %lu\n", GetLastError() );
00238       OutputDebugString( buffer );
00239    }
00240
00241
00242 //   LocalFree( pNewAcl ); // Second Acl produced
00243 //   LocalFree( pOldAcl ); // First Acl produced
00244
00245    return( psdNewSD );
00246
00247 }
00248
00249 //
00250 // Build a new object based on the Parent object and Creator
00251 //
00252 POBJECT NewObject( POBJECT pobParent, BOOL fContainer, WORD wIndex )
00253 {
00254
00255    DWORD dwResult;
00256    POBJECT pobNew;
00257
00258    pobNew = (POBJECT)LocalAlloc( LPTR, sizeof( OBJECT ) );
00259
00260    if (NULL == pobNew)
00261    {
00262        return NULL;
00263    }
00264
00265    pobNew->fContainer = fContainer;
00266
00267    //
00268    // Create a new Private Object Security Descriptor
00269    //
00270
00271    dwResult = CreatePrivateObjectSecurity(
00272       pobParent ? pobParent->pSD : NULL, // if there is a parent object, use it's sd
00273       pobParent ? NULL : GetClientDescriptor(wIndex), // if there is no parent, use the base sd
00274       &(pobNew->pSD),
00275       pobNew->fContainer,
00276       GetClientToken(wIndex),
00277       &ObjMap );
00278
00279    if( !dwResult )
00280    {
00281           MessageBox(NULL, L"CreatePrivateObjectSecurity failed!", L"Error",MB_OK);
00282       return( FALSE );
00283    }
00284
00285    return( pobNew );
00286
00287 }
00288
00289 //
00290 // Get a user's token from the list
00291 //
00292 HANDLE GetClientToken( WORD wIndex )
00293 {
00294    return( Logons[wIndex].hLogon );
00295 }
00296
00297 //
00298 // Get the impersonation token instead
00299 //
00300 HANDLE GetClientImpToken( WORD wIndex )
00301 {
00302    return( Logons[wIndex].hImpToken );
00303 }
00304
00305 //
00306 // What is this client's name
00307 //
00308 void GetLogonName( WORD wIndex, WCHAR szUser[] )
00309 {
00310    wsprintf(szUser, L"%s\\%s", Logons[wIndex].szDomain,Logons[wIndex].szUsername);
00311 }
00312
00313 //
00314 // Get a clients Security Descriptor
00315 //
00316 PSECURITY_DESCRIPTOR GetClientDescriptor( WORD wIndex )
00317 {
00318    return( Logons[wIndex].psdCreator );
00319 }
00320
00321 //
00322 // Do a new logon for a new client
00323 //
00324 BOOL NewLogon( HINSTANCE hAppInstance, WORD wCurrentLogons )
00325 {
00326    INT_PTR wResult;
00327
00328    wLogonId = wCurrentLogons;
00329
00330    wResult = DialogBox( hAppInstance,
00331                         MAKEINTRESOURCE(IDD_LOGON),
00332                         NULL,
00333                         (DLGPROC)LogonDlgProc );
00334
00335    if( wLogonId != wCurrentLogons )
00336    {
00337       // we had a successfull logon
00338       return TRUE;
00339    }
00340    else
00341       return FALSE;
00342 }
00343
00344 //
00345 // Our default user is the owner of this process
00346 //
00347 BOOL DefaultUser( )
00348 {
00349    HANDLE hToken;
00350    HANDLE hImpToken;
00351    WCHAR InfoBuffer[1000],szAccountName[MAX_NAME], szDomainName[MAX_NAME];
00352    DWORD dwInfoBufferSize,dwAccountSize = MAX_NAME, dwDomainSize = MAX_NAME;
00353
00354    PTOKEN_USER pTokenUser = (PTOKEN_USER)InfoBuffer;
00355    SID_NAME_USE snu;
00356
00357    // this is our first user
00358    wLogonId = 0;
00359
00360    OpenProcessToken( GetCurrentProcess(),
00361                      TOKEN_ALL_ACCESS,
00362                      &hToken );
00363
00364    GetTokenInformation(hToken,TokenUser,InfoBuffer,
00365       1000, &dwInfoBufferSize);
00366
00367    LookupAccountSid(NULL, pTokenUser->User.Sid, szAccountName,
00368       &dwAccountSize,szDomainName, &dwDomainSize, &snu);
00369
00370    lstrcpy( Logons[wLogonId].szUsername, szAccountName );
00371    lstrcpy( Logons[wLogonId].szDomain, szDomainName );
00372
00373
00374    Logons[wLogonId].hLogon = hToken;
00375
00376    DuplicateToken( hToken, SecurityImpersonation, &hImpToken );
00377
00378    Logons[wLogonId].hImpToken = hImpToken;
00379
00380    Logons[wLogonId].psdCreator = GetCreatorSD(wLogonId);
00381
00382    wLogonId++;
00383
00384    return( TRUE );
00385
00386 }
00387
00388 //////////////////////////////////////////////////////////////////
00389 // Dialog that you use to enter the credentials for
00390 // additional users
00391 //
00392 //////////////////////////////////////////////////////////////////
00393 BOOL CALLBACK LogonDlgProc (HWND hwnd, UINT msg,
00394                      WPARAM wParam,  LPARAM lParam)
00395 {
00396
00397    WCHAR szUsername[MAX_NAME];
00398    WCHAR szDomain[MAX_NAME]=L"";
00399    WCHAR szPassword[MAX_PASSWORD];
00400    HANDLE hToken;
00401    HANDLE hImpToken;
00402    LPTSTR lpDomain=NULL;
00403    DWORD dwError;
00404
00405
00406    switch (msg)
00407    {
00408
00409       case WM_INITDIALOG:
00410          return TRUE ;
00411
00412       case WM_COMMAND:
00413          switch (LOWORD(wParam))
00414          {
00415             case IDOK:
00416                GetDlgItemText(hwnd,IDC_USERNAME,szUsername,MAX_NAME);
00417                GetDlgItemText(hwnd,IDC_PASSWORD,szPassword,MAX_PASSWORD);
00418                if(GetDlgItemText(hwnd,IDC_DOMAIN,szDomain,MAX_NAME))
00419                   lpDomain=szDomain;
00420
00421                if( !LogonUser( szUsername ,
00422                               lpDomain,
00423                               szPassword,
00424                               //LOGON32_LOGON_INTERACTIVE,
00425                               LOGON32_LOGON_NETWORK, // simulates a clients connection
00426                               LOGON32_PROVIDER_DEFAULT,
00427                               &hToken ) )
00428                {
00429                   return(dwError=GetLastError());
00430                   // Error 5 means you need to give yourself "Act as part of OS" privilege
00431                }
00432                else
00433                {
00434                   lstrcpy(Logons[wLogonId].szUsername,szUsername);
00435                   lstrcpy(Logons[wLogonId].szDomain,szDomain);
00436                   Logons[wLogonId].hLogon = hToken;
00437                   DuplicateToken( hToken, SecurityImpersonation, &hImpToken );
00438                   Logons[wLogonId].hImpToken = hImpToken;
00439                   Logons[wLogonId].psdCreator = GetCreatorSD(wLogonId);
00440                   wLogonId++;
00441                }
00442             case IDCANCEL:
00443                DestroyWindow(hwnd);
00444                return TRUE;
00445          }
00446          break;
00447       default:
00448          break;
00449
00450    }
00451    return FALSE;
00452
00453 }
00454
00455
00456
00457
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/resource.h Source File

  • Dataaccess
  • rds
  • handler
  • vc

resource.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File:        Resource.h
00004 //
00005 // Copyright:   Copyright (c) 1997-1999 Microsoft Corporation
00006 //
00007 // Contents:
00008 //
00009 // Comments:    Microsoft Developer Studio generated include file.
00010 //              Used by msdfmap.rc
00011 //
00012 //-----------------------------------------------------------------------------
00013
00014 //{{NO_DEPENDENCIES}}
00015 //
00016 #define IDS_PROJNAME                    100
00017 #define IDS_HANDLER_DESC1               103
00018 #define IDR_Handler1                    104
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        201
00025 #define _APS_NEXT_COMMAND_VALUE         32768
00026 #define _APS_NEXT_CONTROL_VALUE         201
00027 #define _APS_NEXT_SYMED_VALUE           105
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/property.cpp Source File

  • WinUI
  • TSFmark

property.cpp

Go to the documentation of this file.
00001 //
00002 // property.cpp
00003 //
00004 // Property code.
00005 //
00006
00007 #include "globals.h"
00008 #include "mark.h"
00009 #include "editsess.h"
00010 #include "pstore.h"
00011
00012 // callback code for CPropertyEditSession
00013 #define VIEW_CASE_PROPERTY   0
00014 #define SET_CASE_PROPERTY    1
00015 #define VIEW_CUSTOM_PROPERTY 2
00016 #define SET_CUSTOM_PROPERTY  3
00017
00018 const TCHAR c_szWorkerWndClass[] = TEXT("Mark Worker Wnd Class");
00019
00020 class CPropertyEditSession : public CEditSessionBase
00021 {
00022 public:
00023     CPropertyEditSession(CMarkTextService *pMark, ITfContext *pContext, ULONG ulCallback) : CEditSessionBase(pContext)
00024     {
00025         _pMark = pMark;
00026         _pMark->AddRef();
00027         _ulCallback = ulCallback;
00028     }
00029     ~CPropertyEditSession()
00030     {
00031         _pMark->Release();
00032     }
00033
00034     // ITfEditSession
00035     STDMETHODIMP DoEditSession(TfEditCookie ec)
00036     {
00037         switch (_ulCallback)
00038         {
00039             case VIEW_CASE_PROPERTY:
00040                 _pMark->_ViewCaseProperty(ec, _pContext);
00041                 break;
00042             case SET_CASE_PROPERTY:
00043                 _pMark->_SetCaseProperty(ec, _pContext);
00044                 break;
00045             case VIEW_CUSTOM_PROPERTY:
00046                 _pMark->_ViewCustomProperty(ec, _pContext);
00047                 break;
00048             case SET_CUSTOM_PROPERTY:
00049                 _pMark->_SetCustomProperty(ec, _pContext);
00050                 break;
00051         }
00052         return S_OK;
00053     }
00054
00055 private:
00056     CMarkTextService *_pMark;
00057     ULONG _ulCallback;
00058 };
00059
00060 //+---------------------------------------------------------------------------
00061 //
00062 // _RequestEditSession
00063 //
00064 // Helper function.  Schedules an edit session for a particular property
00065 // related callback.
00066 //----------------------------------------------------------------------------
00067
00068 void CMarkTextService::_RequestPropertyEditSession(ULONG ulCallback)
00069 {
00070     ITfDocumentMgr *pFocusDoc;
00071     ITfContext *pContext;
00072     CPropertyEditSession *pPropertyEditSession;
00073     HRESULT hr;
00074
00075     // get the focus document
00076     if (_pThreadMgr->GetFocus(&pFocusDoc) != S_OK)
00077         return;
00078
00079     if (pFocusDoc == NULL)
00080         return; // no focus
00081
00082     // we want the topmost context, since the main doc context could be
00083     // superceded by a modal tip context
00084     if (pFocusDoc->GetTop(&pContext) != S_OK)
00085     {
00086         pContext = NULL;
00087         goto Exit;
00088     }
00089
00090     if (pPropertyEditSession = new CPropertyEditSession(this, pContext, ulCallback))
00091     {
00092         // we need a document write lock
00093         // the CPropertyEditSession will do all the work when the
00094         // CPropertyEditSession::DoEditSession method is called by the context
00095         pContext->RequestEditSession(_tfClientId, pPropertyEditSession, TF_ES_READWRITE | TF_ES_ASYNCDONTCARE, &hr);
00096
00097         pPropertyEditSession->Release();
00098     }
00099
00100 Exit:
00101     SafeRelease(pContext);
00102     pFocusDoc->Release();
00103 }
00104
00105 //+---------------------------------------------------------------------------
00106 //
00107 // _SetCaseProperty
00108 //
00109 //----------------------------------------------------------------------------
00110
00111 void CMarkTextService::_SetCaseProperty(TfEditCookie ec, ITfContext *pContext)
00112 {
00113     TF_SELECTION tfSelection;
00114     ITfProperty *pCaseProperty;
00115     ITfRange *pRangeChar;
00116     WCHAR ch;
00117     ULONG cchRead;
00118     ULONG cFetched;
00119     VARIANT varValue;
00120
00121     // get the case property
00122     if (pContext->GetProperty(c_guidCaseProperty, &pCaseProperty) != S_OK)
00123         return;
00124
00125     // get the selection
00126     if (pContext->GetSelection(ec, TF_DEFAULT_SELECTION, 1, &tfSelection, &cFetched) != S_OK ||
00127         cFetched != 1)
00128     {
00129         // no selection or something went wrong
00130         tfSelection.range = NULL;
00131         goto Exit;
00132     }
00133
00134     // get a helper range ready for the loop
00135     if (tfSelection.range->Clone(&pRangeChar) != S_OK)
00136         goto Exit;
00137
00138     // set the value char-by-char over the selection
00139     while (TRUE)
00140     {
00141         // read one char, the TF_TF_MOVESTART flag will advance the start anchor
00142         if (tfSelection.range->GetText(ec, TF_TF_MOVESTART, &ch, 1, &cchRead) != S_OK)
00143             break;
00144
00145         // any more text to read?
00146         if (cchRead != 1)
00147             break;
00148
00149         // make pRange cover just the one char we read
00150         if (pRangeChar->ShiftEndToRange(ec, tfSelection.range, TF_ANCHOR_START) != S_OK)
00151             break;
00152
00153         // set the value
00154         varValue.vt = VT_I4;
00155         varValue.lVal = (ch >= 'A' && ch <= 'Z');
00156
00157         if (pCaseProperty->SetValue(ec, pRangeChar, &varValue) != S_OK)
00158             break;
00159
00160         // advance pRange for next iteration
00161         if (pRangeChar->Collapse(ec, TF_ANCHOR_END) != S_OK)
00162             break;
00163     }
00164
00165     pRangeChar->Release();
00166
00167 Exit:
00168     SafeRelease(tfSelection.range);
00169     pCaseProperty->Release();
00170 }
00171
00172 //+---------------------------------------------------------------------------
00173 //
00174 // _Menu_OnSetCaseProperty
00175 //
00176 // Callback for the "Set Case Property" menu item.
00177 // Set the value for a private "case" property over the text covered by the
00178 // selection.  The case property is private to this text service, which defines
00179 // it as:
00180 //
00181 //      static compact, per character
00182 //      VT_I4, !0 => character is within 'A' - 'Z', 0 => anything else.
00183 //
00184 //----------------------------------------------------------------------------
00185
00186 /* static */
00187 void CMarkTextService::_Menu_OnSetCaseProperty(CMarkTextService *_this)
00188 {
00189     _this->_RequestPropertyEditSession(SET_CASE_PROPERTY);
00190 }
00191
00192 //+---------------------------------------------------------------------------
00193 //
00194 // _ViewCaseProperty
00195 //
00196 //----------------------------------------------------------------------------
00197
00198 void CMarkTextService::_ViewCaseProperty(TfEditCookie ec, ITfContext *pContext)
00199 {
00200     TF_SELECTION tfSelection;
00201     ITfProperty *pCaseProperty;
00202     ULONG cchRead;
00203     LONG cch;
00204     ULONG cFetched;
00205     ULONG i;
00206     VARIANT varValue;
00207
00208     // get the case property
00209     if (pContext->GetProperty(c_guidCaseProperty, &pCaseProperty) != S_OK)
00210         return;
00211
00212     // get the selection
00213     if (pContext->GetSelection(ec, TF_DEFAULT_SELECTION, 1, &tfSelection, &cFetched) != S_OK ||
00214         cFetched != 1)
00215     {
00216         // no selection or something went wrong
00217         tfSelection.range = NULL;
00218         goto Exit;
00219     }
00220
00221     // grab the text
00222     if (tfSelection.range->GetText(ec, 0, _achDisplayText, ARRAYSIZE(_achDisplayText)-1, &cchRead) != S_OK)
00223         goto Exit;
00224
00225     // prepare for the loop
00226     if (tfSelection.range->Collapse(ec, TF_ANCHOR_START) != S_OK)
00227         goto Exit;
00228
00229     // get the property value char-by-char over the selection
00230     for (i=0; i < cchRead; i++)
00231     {
00232         // advance pRange for next iteration, cover the next char
00233         if (tfSelection.range->ShiftStartToRange(ec, tfSelection.range, TF_ANCHOR_END) != S_OK)
00234             break;
00235         if (tfSelection.range->ShiftEnd(ec, 1, &cch, NULL) != S_OK)
00236             break;
00237         if (cch != 1) // hit a region boundary?
00238             break;
00239
00240         switch (pCaseProperty->GetValue(ec, tfSelection.range, &varValue))
00241         {
00242             case S_OK:
00243                 // the property value has been set, use it
00244                 // 'U' --> uppercase
00245                 // 'L' --> lowercase
00246                 _achDisplayPropertyText[i] = varValue.lVal ? 'U' : 'L';
00247                 break;
00248             case S_FALSE:
00249                 // no property value set, varValue.vt == VT_EMPTY
00250                 // '?' --> no value
00251                 _achDisplayPropertyText[i] = '?';
00252                 break;
00253             default:
00254                 // error
00255                 // '!' --> error
00256                 _achDisplayPropertyText[i] = '!';
00257                 break;
00258         }
00259     }
00260     for (; i<cchRead; i++) // error case
00261     {
00262         _achDisplayPropertyText[i] = '!';
00263     }
00264
00265     _achDisplayPropertyText[cchRead] = '\0';
00266     _achDisplayText[cchRead] = '\0';
00267
00268     // we can't change the focus while holding a lock
00269     // so postpone the UI until we've released our lock
00270     PostMessage(_hWorkerWnd, CMarkTextService::WM_DISPLAY_PROPERTY, 0, 0);
00271
00272 Exit:
00273     SafeRelease(tfSelection.range);
00274     pCaseProperty->Release();
00275 }
00276
00277 //+---------------------------------------------------------------------------
00278 //
00279 // _Menu_OnViewCaseProperty
00280 //
00281 // Menu callback.  Displays a popup with "case" property values over the
00282 // current selection.
00283 //----------------------------------------------------------------------------
00284
00285 /* static */
00286 void CMarkTextService::_Menu_OnViewCaseProperty(CMarkTextService *_this)
00287 {
00288     _this->_RequestPropertyEditSession(VIEW_CASE_PROPERTY);
00289 }
00290
00291 //+---------------------------------------------------------------------------
00292 //
00293 // _ViewCustomProperty
00294 //
00295 // Display the value of this text service's custom property over the text
00296 // covered by the selection.
00297 //----------------------------------------------------------------------------
00298
00299 void CMarkTextService::_ViewCustomProperty(TfEditCookie ec, ITfContext *pContext)
00300 {
00301     TF_SELECTION tfSelection;
00302     ITfProperty *pCustomProperty;
00303     ITfRange *pSelRange;
00304     ITfRange *pPropertySpanRange;
00305     ULONG cchRead;
00306     ULONG cFetched;
00307     LONG cch;
00308     VARIANT varValue;
00309     HRESULT hr;
00310
00311     // get the case property
00312     if (pContext->GetProperty(c_guidCustomProperty, &pCustomProperty) != S_OK)
00313         return;
00314
00315     // get the selection
00316     if (pContext->GetSelection(ec, TF_DEFAULT_SELECTION, 1, &tfSelection, &cFetched) != S_OK ||
00317         cFetched != 1)
00318     {
00319         // no selection or something went wrong
00320         pSelRange = NULL;
00321         goto Exit;
00322     }
00323     // free up tfSelection so we can re-use it below
00324     pSelRange = tfSelection.range;
00325
00326     // the selection may not exactly match a span of text covered by the
00327     // custom property....so we'll return the value over the start anchor of
00328     // the selection.
00329
00330     // we need to collapse the range because GetValue will return VT_EMPTY
00331     // if the query range is not completely covered by the property span
00332     if (pSelRange->Collapse(ec, TF_ANCHOR_START) != S_OK)
00333         goto Exit;
00334     // the query range must also cover at least one char
00335     if (pSelRange->ShiftEnd(ec, 1, &cch, NULL) != S_OK)
00336         goto Exit;
00337
00338     hr = pCustomProperty->GetValue(ec, pSelRange, &varValue);
00339
00340     switch (hr)
00341     {
00342         case S_OK:
00343             // there's a value at the selection start anchor
00344             // let's find out exactly what text is covered
00345             _achDisplayText[0] = '\0';
00346             if (pCustomProperty->FindRange(ec, pSelRange, &pPropertySpanRange, TF_ANCHOR_START) == S_OK)
00347             {
00348                 if (pPropertySpanRange->GetText(ec, 0, _achDisplayText, ARRAYSIZE(_achDisplayText)-1, &cchRead) != S_OK)
00349                 {
00350                     cchRead = 0;
00351                 }
00352                 _achDisplayText[cchRead] = '\0';
00353                 // let's update the selection to give the user feedback
00354                 tfSelection.range = pPropertySpanRange;
00355                 pContext->SetSelection(ec, 1, &tfSelection);
00356                 pPropertySpanRange->Release();
00357             }
00358             // write the value
00359             wsprintfW(_achDisplayPropertyText, L"%i", varValue.lVal);
00360             break;
00361
00362         case S_FALSE:
00363             // the property has no value, varValue.vt == VT_EMPTY
00364             _achDisplayText[0] = '\0';
00365             SafeStringCopy(_achDisplayPropertyText, ARRAYSIZE(_achDisplayPropertyText), L"- No Value -");
00366             break;
00367         default:
00368             goto Exit; // error
00369     }
00370
00371     // we can't change the focus while holding a lock
00372     // so postpone the UI until we've released our lock
00373     PostMessage(_hWorkerWnd, CMarkTextService::WM_DISPLAY_PROPERTY, 0, 0);
00374
00375 Exit:
00376     SafeRelease(pSelRange);
00377     pCustomProperty->Release();
00378 }
00379
00380 //+---------------------------------------------------------------------------
00381 //
00382 // _Menu_OnViewCustomProperty
00383 //
00384 // Menu callback for "View Custom Property".
00385 //----------------------------------------------------------------------------
00386
00387 /* static */
00388 void CMarkTextService::_Menu_OnViewCustomProperty(CMarkTextService *_this)
00389 {
00390     _this->_RequestPropertyEditSession(VIEW_CUSTOM_PROPERTY);
00391 }
00392
00393 //+---------------------------------------------------------------------------
00394 //
00395 // _InitWorkerWnd
00396 //
00397 // Called from Activate.  Create a worker window to receive private windows
00398 // messages.
00399 //----------------------------------------------------------------------------
00400
00401 BOOL CMarkTextService::_InitWorkerWnd()
00402 {
00403     WNDCLASS wc;
00404
00405     memset(&wc, 0, sizeof(wc));
00406     wc.lpfnWndProc = _WorkerWndProc;
00407     wc.hInstance = g_hInst;
00408     wc.lpszClassName = c_szWorkerWndClass;
00409
00410     if (RegisterClass(&wc) == 0)
00411         return FALSE;
00412
00413     _hWorkerWnd = CreateWindow(c_szWorkerWndClass, TEXT("Mark Worker Wnd"),
00414                                0, 0, 0, 0, 0, NULL, NULL, g_hInst, this);
00415
00416     return (_hWorkerWnd != NULL);
00417 }
00418
00419 //+---------------------------------------------------------------------------
00420 //
00421 // _UninitWorkerWnd
00422 //
00423 // Called from Deactivate.  Destroy the worker window.
00424 //----------------------------------------------------------------------------
00425
00426 void CMarkTextService::_UninitWorkerWnd()
00427 {
00428     if (_hWorkerWnd != NULL)
00429     {
00430         DestroyWindow(_hWorkerWnd);
00431         _hWorkerWnd = NULL;
00432     }
00433     UnregisterClass(c_szWorkerWndClass, g_hInst);
00434 }
00435
00436 //+---------------------------------------------------------------------------
00437 //
00438 // _WorkerWndProc
00439 //
00440 //----------------------------------------------------------------------------
00441
00442 /* static */
00443 LRESULT CALLBACK CMarkTextService::_WorkerWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00444 {
00445     CMarkTextService *_this;
00446     int cch;
00447     char achText[128];
00448
00449     switch (uMsg)
00450     {
00451         case WM_CREATE:
00452             // save the this pointer we originally passed into CreateWindow
00453             SetWindowLongPtr(hWnd, GWLP_USERDATA,
00454                              (LONG_PTR)((CREATESTRUCT *)lParam)->lpCreateParams);
00455             return 0;
00456
00457         case WM_DISPLAY_PROPERTY:
00458             _this = (CMarkTextService *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
00459
00460             // bring up a message box with the contents of _achDisplayText
00461
00462             // first, convert from unicode
00463             cch = WideCharToMultiByte(CP_ACP, 0, _this->_achDisplayText, wcslen(_this->_achDisplayText),
00464                                       achText, ARRAYSIZE(achText)-1, NULL, NULL);
00465
00466             if (cch < ARRAYSIZE(achText) - 1)
00467             {
00468                 achText[cch++] = '\n';
00469             }
00470             if (cch < ARRAYSIZE(achText) - 1)
00471             {
00472                 cch += WideCharToMultiByte(CP_ACP, 0, _this->_achDisplayPropertyText, wcslen(_this->_achDisplayPropertyText),
00473                                            achText+cch, ARRAYSIZE(achText)-cch-1, NULL, NULL);
00474             }
00475             achText[cch] = '\0';
00476
00477             // bring up the display
00478             MessageBoxA(NULL, achText, "Property View", MB_OK);
00479
00480             return 0;
00481     }
00482
00483     return DefWindowProc(hWnd, uMsg, wParam, lParam);
00484 }
00485
00486 //+---------------------------------------------------------------------------
00487 //
00488 // _Menu_OnSetCustomProperty
00489 //
00490 // Callback for the "Set Custom Property" menu item.
00491 //----------------------------------------------------------------------------
00492
00493 /* static */
00494 void CMarkTextService::_Menu_OnSetCustomProperty(CMarkTextService *_this)
00495 {
00496     _this->_RequestPropertyEditSession(SET_CUSTOM_PROPERTY);
00497 }
00498
00499 //+---------------------------------------------------------------------------
00500 //
00501 // _SetCustomProperty
00502 //
00503 // Assign a custom property to the text covered by the selection.
00504 //----------------------------------------------------------------------------
00505
00506 void CMarkTextService::_SetCustomProperty(TfEditCookie ec, ITfContext *pContext)
00507 {
00508     TF_SELECTION tfSelection;
00509     ITfProperty *pCustomProperty;
00510     CCustomPropertyStore *pCustomPropertyStore;
00511     ULONG cFetched;
00512
00513     // get the case property
00514     if (pContext->GetProperty(c_guidCustomProperty, &pCustomProperty) != S_OK)
00515         return;
00516
00517     // get the selection
00518     if (pContext->GetSelection(ec, TF_DEFAULT_SELECTION, 1, &tfSelection, &cFetched) != S_OK ||
00519         cFetched != 1)
00520     {
00521         // no selection or something went wrong
00522         tfSelection.range = NULL;
00523         goto Exit;
00524     }
00525
00526     if ((pCustomPropertyStore = new CCustomPropertyStore) == NULL)
00527         goto Exit;
00528
00529     pCustomProperty->SetValueStore(ec, tfSelection.range, pCustomPropertyStore);
00530
00531     // TSF will hold a reference to pCustomPropertyStore is the SetValueStore succeeded
00532     // but we need to release ours
00533     pCustomPropertyStore->Release();
00534
00535 Exit:
00536     pCustomProperty->Release();
00537     SafeRelease(tfSelection.range);
00538 }
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IISSearch/Is2Foot.Inc Source File

  • WinBase
  • Indexing
  • IISSearch

Is2Foot.Inc

Go to the documentation of this file.
00001 <!-- STANDARD MICROSOFT FOOTER FOR QUERY PAGES -->
00002
00003 <hr width=500 align=left>
00004 <p>
00005 <table border="0" cellpadding="0" cellspacing="0" width="500">
00006     <tr>
00007         <!-- IIS GIF -->
00008        <td>
00009             <a href="http://www.microsoft.com/Windows.NetServer"><img src="win2k.gif" alt="Learn more about Microsoft Windows"  border="0"></a>
00010         </td>
00011
00012         <!-- Microsoft Legal Info -->
00013         <td align=center>
00014             <font style="font:arial; font-size: 8pt"> &copy;1997-2002 Microsoft Corporation. All rights reserved.<br></font>
00015             <a href="http://www.microsoft.com/misc/Info/cpyright.htm"><font style="font:arial; font-size: 6pt">Legal Notices.</font></a>
00016        </td>
00017
00018         <!-- Best with IE GIF -->
00019         <td align=right>
00020             <a href="http://www.microsoft.com/ie"><img src="IE.GIF" alt="Download Internet Explorer!"  border="0"></a>
00021         </td>
00022     </tr>
00023 </table>
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/app/stl_write.cpp Source File

  • WinBase
  • IO
  • RSM
  • app

stl_write.cpp

Go to the documentation of this file.
00001 /*
00002  *  This is a part of the Microsoft Source Code Samples.
00003  *
00004  *  This sample code shows the usage of some portions
00005  *  of the RSM API.
00006  *
00007  *  Return codes are, for the most part, not checked in
00008  *  this code. See the Programmer's reference for error
00009  *  return information.
00010  *
00011  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00012  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00013  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014  * PARTICULAR PURPOSE.
00015  *
00016  * Copyright 1997 - 1998 Microsoft Corporation.  All Rights Reserved.
00017  */
00018 #include <windows.h>
00019 #include <iostream.h>
00020 #include <stdio.h>
00021 #include <time.h>
00022 #include <rpc.h>
00023 #include <NtmsMli.h>
00024 #include "..\inc\stl.h"
00025
00026 void GetTapeGUID(wchar_t * MediaID, DWORD dwSize)
00027 {
00028   // A real app would have a way of generating these, or at least
00029   // knowing what one to use
00030   wcsncpy(MediaID, L"{71ebde90-5172-11d2-a0f0-000000000000}", dwSize/sizeof(WCHAR));
00031 }
00032
00033 void writeOmid (HANDLE hDevice, STL_LABEL *LabelBuffer)
00034 {
00035   time_t CurrentTime;
00036   struct tm *GMTime;
00037   BOOL nRetCode, nError;
00038   DWORD nBytesWritten;
00039
00040
00041   // create and fill in the  fields in a STL structure that are used to recognize it as such
00042   // zero out whole buffer, then copy each string up until next to the last char, assuring each
00043   // string is null terminated.
00044   memset(LabelBuffer, 0, sizeof(STL_LABEL));
00045   wcsncpy((wchar_t *)LabelBuffer->LabelType, STL_LABEL_LabelType, (STL_LABEL_LabelTypeSize/sizeof(WCHAR))-1);
00046
00047   wcsncpy((wchar_t *)LabelBuffer->LabelVersion, STL_LABEL_Version, (STL_LABEL_VersionSize/sizeof(WCHAR))-1);
00048
00049   wcsncpy((wchar_t *)LabelBuffer->Vendor, STL_LABEL_Vendor, (STL_LABEL_VendorSize/sizeof(WCHAR))-1);
00050
00051   wcsncpy((wchar_t *)LabelBuffer->Application, STL_LABEL_Application, (STL_LABEL_ApplicationSize/sizeof(WCHAR))-1);
00052
00053
00054   // fill in the other fields
00055   time(&CurrentTime);
00056   GMTime = gmtime(&CurrentTime) ;
00057   wcsftime ((wchar_t *)LabelBuffer->TimeStamp, 10, L"%m/%d/%y%I:%M:%S %p", GMTime);
00058
00059     wcsncpy((wchar_t *)LabelBuffer->TapeName, L"A Tape Written by the RSM Sample APP",
00060     (STL_LABEL_TapeNameSize/sizeof(WCHAR))-1);
00061
00062   GetTapeGUID((wchar_t *)&(LabelBuffer->MediaID), STL_LABEL_MediaIDSize);
00063
00064
00065   // write the label on the tape
00066   nRetCode = WriteFile (hDevice, (void *) LabelBuffer, 512 * ((sizeof(STL_LABEL) / 512) + 1),
00067     &nBytesWritten, NULL) ;
00068   if (nRetCode == FALSE)
00069   {
00070     nError = GetLastError() ;
00071   }
00072
00073
00074   return;
00075 }
00076
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/Simple.c Source File

  • WinBase
  • Service

Simple.c

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.]
00008
00009 MODULE:   simple.c
00010
00011 PURPOSE:  Implements the body of the service.
00012           The default behavior is to open a
00013           named pipe, \\.\pipe\simple, and read
00014           from it.  It then modifies the data and
00015           writes it back to the pipe.
00016
00017 FUNCTIONS:
00018           ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
00019           ServiceStop( );
00020
00021 COMMENTS: The functions implemented in simple.c are
00022           prototyped in service.h
00023 --------------------------------------------------------------------------*/
00024
00025
00026 #include <windows.h>
00027 #include <sddl.h>
00028 #include <stdio.h>
00029 #include <stdlib.h>
00030 #include <process.h>
00031 #include <tchar.h>
00032 #include "service.h"
00033
00034 // this event is signalled when the
00035 // service should end
00036 //
00037 HANDLE  hServerStopEvent = NULL;
00038
00039 // CreateMyDACL
00040 // Creates a security descriptor containing the
00041 // desired DACL. This function uses SDDL to make Deny and Allow ACEs.
00042 //
00043 // Parameter:
00044 //     SECURITY_ATTRIBUTES * pSA
00045 // Address to a SECURITY_ATTRIBUTES structure. It is the caller's
00046 // responsibility to properly initialize the structure, and to free
00047 // the structure's lpSecurityDescriptor member when done (by calling
00048 // the LocalFree function).
00049 //
00050 // Return value:
00051 //    FALSE if the address to the structure is NULL.
00052 //    Otherwise, this function returns the value from the
00053 //    ConvertStringSecurityDescriptorToSecurityDescriptor function.
00054 BOOL CreateMyDACL(SECURITY_ATTRIBUTES * pSA)
00055 {
00056     // Define the SDDL for the DACL. This example sets
00057     // the following access:
00058     //     Built-in guests are denied all access.
00059     //     Anonymous Logon is denied all access.
00060     //     Authenticated Users are allowed read/write/execute access.
00061     //     Administrators are allowed full control.
00062     // Modify these values as needed to generate the proper
00063     // DACL for your application.
00064     TCHAR * szSD = "D:"                   // Discretionary ACL
00065                    "(D;OICI;GA;;;BG)"     // Deny access to Built-in Guests
00066                    "(D;OICI;GA;;;AN)"     // Deny access to Anonymous Logon
00067                    "(A;OICI;GRGWGX;;;AU)" // Allow read/write/execute to Authenticated Users
00068                    "(A;OICI;GA;;;BA)";    // Allow full control to Administrators
00069
00070     if (NULL == pSA)
00071         return FALSE;
00072
00073     return ConvertStringSecurityDescriptorToSecurityDescriptor(
00074                                                               szSD,
00075                                                               SDDL_REVISION_1,
00076                                                               &(pSA->lpSecurityDescriptor),
00077                                                               NULL);
00078 }
00079
00080
00081 //
00082 //  FUNCTION: ServiceStart
00083 //
00084 //  PURPOSE: Actual code of the service that does the work.
00085 //
00086 //  PARAMETERS:
00087 //    dwArgc   - number of command line arguments
00088 //    lpszArgv - array of command line arguments
00089 //
00090 //  RETURN VALUE:
00091 //    none
00092 //
00093 //  COMMENTS:
00094 //    The default behavior is to open a
00095 //    named pipe, \\.\pipe\simple, and read
00096 //    from it.  It the modifies the data and
00097 //    writes it back to the pipe.  The service
00098 //    stops when hServerStopEvent is signalled
00099 //
00100 VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
00101 {
00102    HANDLE                  hPipe = INVALID_HANDLE_VALUE;
00103    HANDLE                  hEvents[2] = {NULL, NULL};
00104    OVERLAPPED              os;
00105    PSECURITY_DESCRIPTOR    pSD = NULL;
00106    SECURITY_ATTRIBUTES     sa;
00107    TCHAR                   szIn[80];
00108    TCHAR                   szOut[ (sizeof(szIn) / sizeof(TCHAR) )  + 100];
00109    LPTSTR                  lpszPipeName = TEXT("\\\\.\\pipe\\simple");
00110    BOOL                    bRet;
00111    DWORD                   cbRead;
00112    DWORD                   cbWritten;
00113    DWORD                   dwWait;
00114    UINT                    ndx;
00115
00116    ///////////////////////////////////////////////////
00117    //
00118    // Service initialization
00119    //
00120
00121    // report the status to the service control manager.
00122    //
00123    if (!ReportStatusToSCMgr(
00124                            SERVICE_START_PENDING, // service state
00125                            NO_ERROR,              // exit code
00126                            3000))                 // wait hint
00127       goto cleanup;
00128
00129    // create the event object. The control handler function signals
00130    // this event when it receives the "stop" control code.
00131    //
00132    hServerStopEvent = CreateEvent(
00133                                  NULL,    // no security attributes
00134                                  TRUE,    // manual reset event
00135                                  FALSE,   // not-signalled
00136                                  NULL);   // no name
00137
00138    if ( hServerStopEvent == NULL)
00139       goto cleanup;
00140
00141    hEvents[0] = hServerStopEvent;
00142
00143    // report the status to the service control manager.
00144    //
00145    if (!ReportStatusToSCMgr(
00146                            SERVICE_START_PENDING, // service state
00147                            NO_ERROR,              // exit code
00148                            3000))                 // wait hint
00149       goto cleanup;
00150
00151    // create the event object object use in overlapped i/o
00152    //
00153    hEvents[1] = CreateEvent(
00154                            NULL,    // no security attributes
00155                            TRUE,    // manual reset event
00156                            FALSE,   // not-signalled
00157                            NULL);   // no name
00158
00159    if ( hEvents[1] == NULL)
00160       goto cleanup;
00161
00162    // report the status to the service control manager.
00163    //
00164    if (!ReportStatusToSCMgr(
00165                            SERVICE_START_PENDING, // service state
00166                            NO_ERROR,              // exit code
00167                            3000))                 // wait hint
00168       goto cleanup;
00169
00170    // create a security descriptor that allows anyone to write to
00171    //  the pipe...
00172    //
00173    pSD = (PSECURITY_DESCRIPTOR) malloc( SECURITY_DESCRIPTOR_MIN_LENGTH );
00174
00175    if (pSD == NULL)
00176       goto cleanup;
00177
00178    if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION))
00179       goto cleanup;
00180
00181    sa.nLength = sizeof(sa);
00182    sa.bInheritHandle = TRUE;
00183    sa.lpSecurityDescriptor = pSD;
00184
00185    if(!CreateMyDACL(&sa) )
00186    {
00187        // DACL creation FAILED!!
00188        return;
00189    }
00190
00191    // report the status to the service control manager.
00192    //
00193    if (!ReportStatusToSCMgr(
00194                            SERVICE_START_PENDING, // service state
00195                            NO_ERROR,              // exit code
00196                            3000))                 // wait hint
00197       goto cleanup;
00198
00199
00200    // allow user tp define pipe name
00201    for ( ndx = 1; ndx < dwArgc-1; ndx++ )
00202    {
00203
00204       if ( ( (*(lpszArgv[ndx]) == TEXT('-')) ||
00205              (*(lpszArgv[ndx]) == TEXT('/')) ) &&
00206            (!_tcsicmp( TEXT("pipe"), lpszArgv[ndx]+1 ) && ((ndx + 1) < dwArgc)) )
00207       {
00208          lpszPipeName = lpszArgv[++ndx];
00209       }
00210
00211    }
00212
00213    // open our named pipe...
00214    //
00215    hPipe = CreateNamedPipe(
00216                           lpszPipeName         ,  // name of pipe
00217                           FILE_FLAG_OVERLAPPED |
00218                           PIPE_ACCESS_DUPLEX,     // pipe open mode
00219                           PIPE_TYPE_MESSAGE |
00220                           PIPE_READMODE_MESSAGE |
00221                           PIPE_WAIT,              // pipe IO type
00222                           1,                      // number of instances
00223                           0,                      // size of outbuf (0 == allocate as necessary)
00224                           0,                      // size of inbuf
00225                           1000,                   // default time-out value
00226                           &sa);                   // security attributes
00227
00228    if (hPipe == INVALID_HANDLE_VALUE)
00229    {
00230       AddToMessageLog(TEXT("Unable to create named pipe"));
00231       goto cleanup;
00232    }
00233
00234
00235    // report the status to the service control manager.
00236    //
00237    if (!ReportStatusToSCMgr(
00238                            SERVICE_RUNNING,       // service state
00239                            NO_ERROR,              // exit code
00240                            0))                    // wait hint
00241       goto cleanup;
00242
00243    //
00244    // End of initialization
00245    //
00246    ////////////////////////////////////////////////////////
00247
00248    ////////////////////////////////////////////////////////
00249    //
00250    // Service is now running, perform work until shutdown
00251    //
00252
00253    while ( 1 )
00254    {
00255       // init the overlapped structure
00256       //
00257       memset( &os, 0, sizeof(OVERLAPPED) );
00258       os.hEvent = hEvents[1];
00259       ResetEvent( hEvents[1] );
00260
00261       // wait for a connection...
00262       //
00263       ConnectNamedPipe(hPipe, &os);
00264
00265       if ( GetLastError() == ERROR_IO_PENDING )
00266       {
00267          dwWait = WaitForMultipleObjects( 2, hEvents, FALSE, INFINITE );
00268          if ( dwWait != WAIT_OBJECT_0+1 )     // not overlapped i/o event - error occurred,
00269             break;                           // or server stop signaled
00270       }
00271
00272       // init the overlapped structure
00273       //
00274       memset( &os, 0, sizeof(OVERLAPPED) );
00275       os.hEvent = hEvents[1];
00276       ResetEvent( hEvents[1] );
00277
00278       // grab whatever's coming through the pipe...
00279       //
00280       bRet = ReadFile(
00281                      hPipe,          // file to read from
00282                      szIn,           // address of input buffer
00283                      sizeof(szIn),   // number of bytes to read
00284                      &cbRead,        // number of bytes read
00285                      &os);           // overlapped stuff, not needed
00286
00287       if ( !bRet && ( GetLastError() == ERROR_IO_PENDING ) )
00288       {
00289          dwWait = WaitForMultipleObjects( 2, hEvents, FALSE, INFINITE );
00290          if ( dwWait != WAIT_OBJECT_0+1 )     // not overlapped i/o event - error occurred,
00291             break;                           // or server stop signaled
00292       }
00293
00294       // munge the string
00295       //
00296       _stprintf(szOut, TEXT("Hello! [%s]"), szIn);
00297
00298       // init the overlapped structure
00299       //
00300       memset( &os, 0, sizeof(OVERLAPPED) );
00301       os.hEvent = hEvents[1];
00302       ResetEvent( hEvents[1] );
00303
00304       // send it back out...
00305       //
00306       bRet = WriteFile(
00307                       hPipe,          // file to write to
00308                       szOut,          // address of output buffer
00309                       sizeof(szOut),  // number of bytes to write
00310                       &cbWritten,     // number of bytes written
00311                       &os);           // overlapped stuff, not needed
00312
00313       if ( !bRet && ( GetLastError() == ERROR_IO_PENDING ) )
00314       {
00315          dwWait = WaitForMultipleObjects( 2, hEvents, FALSE, INFINITE );
00316          if ( dwWait != WAIT_OBJECT_0+1 )     // not overlapped i/o event - error occurred,
00317             break;                           // or server stop signaled
00318       }
00319
00320       // drop the connection...
00321       //
00322       DisconnectNamedPipe(hPipe);
00323    }
00324
00325    cleanup:
00326
00327    if (hPipe != INVALID_HANDLE_VALUE )
00328       CloseHandle(hPipe);
00329
00330    if (hServerStopEvent)
00331       CloseHandle(hServerStopEvent);
00332
00333    if (hEvents[1]) // overlapped i/o event
00334       CloseHandle(hEvents[1]);
00335
00336    if ( pSD )
00337       free( pSD );
00338
00339 }
00340
00341
00342 //
00343 //  FUNCTION: ServiceStop
00344 //
00345 //  PURPOSE: Stops the service
00346 //
00347 //  PARAMETERS:
00348 //    none
00349 //
00350 //  RETURN VALUE:
00351 //    none
00352 //
00353 //  COMMENTS:
00354 //    If a ServiceStop procedure is going to
00355 //    take longer than 3 seconds to execute,
00356 //    it should spawn a thread to execute the
00357 //    stop code, and return.  Otherwise, the
00358 //    ServiceControlManager will believe that
00359 //    the service has stopped responding.
00360 //
00361 VOID ServiceStop()
00362 {
00363    if ( hServerStopEvent )
00364       SetEvent(hServerStopEvent);
00365 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/ConnectDlg.h Source File

  • Com
  • Administration
  • Explore.VC

ConnectDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #include "VCExploreDlg.h"
00019
00020 #if !defined(AFX_CONNECTDLG_H__0B7BB737_B53B_11D2_86A8_000000000000__INCLUDED_)
00021 #define AFX_CONNECTDLG_H__0B7BB737_B53B_11D2_86A8_000000000000__INCLUDED_
00022
00023 #if _MSC_VER > 1000
00024 #pragma once
00025 #endif // _MSC_VER > 1000
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CConnectDlg dialog
00029
00030 class CConnectDlg : public CDialog
00031 {
00032 // Construction
00033 public:
00034   void set_ParentDlg(CVCExploreDlg* pDlg);
00035   void set_Catalog(ICOMAdminCatalog* pCatalog);
00036   CConnectDlg(CWnd* pParent = NULL);   // standard constructor
00037
00038 // Dialog Data
00039   //{{AFX_DATA(CConnectDlg)
00040   enum { IDD = IDD_CONNECT };
00041   CEdit m_edtRemoteComputerName;
00042   //}}AFX_DATA
00043
00044
00045 // Overrides
00046   // ClassWizard generated virtual function overrides
00047   //{{AFX_VIRTUAL(CConnectDlg)
00048   protected:
00049   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00050   //}}AFX_VIRTUAL
00051
00052 // Implementation
00053 protected:
00054   HICON m_hIcon;
00055
00056   // Generated message map functions
00057   //{{AFX_MSG(CConnectDlg)
00058   virtual void OnOK();
00059   afx_msg void OnRemoteComputer();
00060   afx_msg void OnLocalComputer();
00061   virtual BOOL OnInitDialog();
00062   afx_msg void OnClose();
00063   //}}AFX_MSG
00064   DECLARE_MESSAGE_MAP()
00065 private:
00066   void ReleaseCatalog();
00067   CVCExploreDlg* m_pParentDlg;
00068   void ToggleEditControl(bool Flag);
00069   int m_nConnectionType;
00070   ICOMAdminCatalog* m_pCatalog;
00071 };
00072
00073 //{{AFX_INSERT_LOCATION}}
00074 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00075
00076 #endif // !defined(AFX_CONNECTDLG_H__0B7BB737_B53B_11D2_86A8_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcComm.Cpp Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcComm.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 - 2000 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00045
00046 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00047 //  Microsoft Visual C++, your modifications will be overwritten.
00048
00049
00050 #include "stdafx.h"
00051 #include "ACComm.h"
00052
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // CAgentCtlCommandEx properties
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // CAgentCtlCommandEx operations
00059
00060 CString CAgentCtlCommandEx::GetVoice()
00061 {
00062   CString result;
00063   InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00064   return result;
00065 }
00066
00067 void CAgentCtlCommandEx::SetVoice(LPCTSTR lpszNewValue)
00068 {
00069   static BYTE parms[] =
00070     VTS_BSTR;
00071   InvokeHelper(0x1, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00072      lpszNewValue);
00073 }
00074
00075 CString CAgentCtlCommandEx::GetCaption()
00076 {
00077   CString result;
00078   InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00079   return result;
00080 }
00081
00082 void CAgentCtlCommandEx::SetCaption(LPCTSTR lpszNewValue)
00083 {
00084   static BYTE parms[] =
00085     VTS_BSTR;
00086   InvokeHelper(0x2, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00087      lpszNewValue);
00088 }
00089
00090 BOOL CAgentCtlCommandEx::GetEnabled()
00091 {
00092   BOOL result;
00093   InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00094   return result;
00095 }
00096
00097 void CAgentCtlCommandEx::SetEnabled(BOOL bNewValue)
00098 {
00099   static BYTE parms[] =
00100     VTS_BOOL;
00101   InvokeHelper(0x5, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00102      bNewValue);
00103 }
00104
00105 BOOL CAgentCtlCommandEx::GetVisible()
00106 {
00107   BOOL result;
00108   InvokeHelper(0x6, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00109   return result;
00110 }
00111
00112 void CAgentCtlCommandEx::SetVisible(BOOL bNewValue)
00113 {
00114   static BYTE parms[] =
00115     VTS_BOOL;
00116   InvokeHelper(0x6, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00117      bNewValue);
00118 }
00119
00120 long CAgentCtlCommandEx::GetConfidence()
00121 {
00122   long result;
00123   InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00124   return result;
00125 }
00126
00127 void CAgentCtlCommandEx::SetConfidence(long nNewValue)
00128 {
00129   static BYTE parms[] =
00130     VTS_I4;
00131   InvokeHelper(0x3, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00132      nNewValue);
00133 }
00134
00135 CString CAgentCtlCommandEx::GetConfidenceText()
00136 {
00137   CString result;
00138   InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00139   return result;
00140 }
00141
00142 void CAgentCtlCommandEx::SetConfidenceText(LPCTSTR lpszNewValue)
00143 {
00144   static BYTE parms[] =
00145     VTS_BSTR;
00146   InvokeHelper(0x4, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00147      lpszNewValue);
00148 }
00149
00150 void CAgentCtlCommandEx::SetHelpContextID(long nNewValue)
00151 {
00152   static BYTE parms[] =
00153     VTS_I4;
00154   InvokeHelper(0x7, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00155      nNewValue);
00156 }
00157
00158 long CAgentCtlCommandEx::GetHelpContextID()
00159 {
00160   long result;
00161   InvokeHelper(0x7, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00162   return result;
00163 }
00164
00165 void CAgentCtlCommandEx::SetVoiceCaption(LPCTSTR lpszNewValue)
00166 {
00167   static BYTE parms[] =
00168     VTS_BSTR;
00169   InvokeHelper(0x8, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00170      lpszNewValue);
00171 }
00172
00173 CString CAgentCtlCommandEx::GetVoiceCaption()
00174 {
00175   CString result;
00176   InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00177   return result;
00178 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFactoryData Member List

This is the complete list of members for CFactoryData, including all inherited members.
CreateInstance | CFactoryData |
IsClassID(const CLSID &clsid) const | CFactoryData | [inline]
m_fProxy | CFactoryData |
m_lcid | CFactoryData |
m_LibVersion | CFactoryData |
m_oleMisc | CFactoryData |
m_oleVerbs | CFactoryData |
m_pCLSID | CFactoryData |
m_pLIBID | CFactoryData |
m_RegistryName | CFactoryData |
m_szAppName | CFactoryData |
m_szname | CFactoryData |
m_szProgID | CFactoryData |
m_szVerIndProgID | CFactoryData |
server | CFactoryData |
threadingModel | CFactoryData |
version | CFactoryData |
Generated on Wed Nov 13 2024 16:56:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/datasource.h Source File

  • Dataaccess
  • oledb
  • tablecopy

datasource.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1995-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module DATASOURCE.H
00008 //
00009 //-----------------------------------------------------------------------------
00010 #ifndef _DATASOURCE_H_
00011 #define _DATASOURCE_H_
00012
00013
00014 ///////////////////////////////////////////////////////////////
00015 // Includes
00016 //
00017 ///////////////////////////////////////////////////////////////
00018 #include "Property.h"
00019
00020
00021 //PROVIDERINFO
00022 struct PROVIDERINFO
00023 {
00024   WCHAR     wszName[MAX_NAME_LEN];
00025   WCHAR     wszParseName[MAX_NAME_LEN];
00026   WCHAR     wszDescription[MAX_NAME_LEN];
00027   DBTYPE      wType;
00028 };
00029
00030
00031
00032 /////////////////////////////////////////////////////////////////
00033 // CDataSource class
00034 //
00035 /////////////////////////////////////////////////////////////////
00036 class CDataSource
00037 {
00038 public:
00039   //Constructors
00040   CDataSource();
00041   virtual ~CDataSource();
00042
00043   //Members
00044   virtual BOOL IsConnected();
00045   virtual BOOL IsEqual(CDataSource* pCDataSource);
00046   virtual BOOL IsSimilar(CDataSource* pCDataSource);
00047
00048   virtual HRESULT Connect(HWND hWnd, CDataSource* pCDataSource = NULL);
00049   virtual BOOL  Disconnect();
00050
00051   virtual HRESULT GetProviders();
00052   virtual HRESULT GetConnectionProps();
00053
00054   //OLEDB Interfaces
00055   IDBInitialize*    m_pIDBInitialize;   //DataSource interface
00056   IOpenRowset*    m_pIOpenRowset;     //Session interface
00057   IDBSchemaRowset*  m_pIDBSchemaRowset;   //Session interface
00058   ITableDefinition* m_pITableDefinition;  //Session interface
00059   IIndexDefinition* m_pIIndexDefinition;  //Session interface
00060   ICommandText*   m_pICommandText;    //Command interface
00061
00062   IParseDisplayName*  m_pIParseDisplayName; //Enum interface
00063
00064   //Catalog Schema info
00065   WCHAR*        m_pwszCatalog;
00066   WCHAR*        m_pwszCatalogTerm;
00067   WCHAR*        m_pwszCatalogLocation;
00068   WCHAR*        m_pwszSchemaTerm;
00069   WCHAR*        m_pwszTableTerm;
00070
00071   //DataSource info
00072   ULONG       m_ulActiveSessions;
00073   WCHAR*        m_pwszDataSource;
00074   WCHAR*        m_pwszDBMS;
00075   WCHAR*        m_pwszDBMSVer;
00076
00077   //Provider info
00078   WCHAR*        m_pwszProviderName;
00079   WCHAR*        m_pwszProviderParseName;
00080   WCHAR*        m_pwszProviderFileName;
00081   WCHAR*        m_pwszProviderVer;
00082   WCHAR*        m_pwszProviderOLEDBVer;
00083
00084   //Enumerator ProvierInfo
00085   ULONG       m_cProviderInfo;
00086   PROVIDERINFO*   m_rgProviderInfo;
00087
00088   //Properties
00089   BOOL        m_fReadOnly;
00090   BOOL        m_fPrimaryKeysSupported;
00091   BOOL        m_fMultipleParamSets;
00092   BOOL        m_fIRowsetChange;
00093   BOOL        m_fIRowsetUpdate;
00094   ULONG       m_dwStorageObjects;
00095
00096   BOOL        m_fConnected;
00097 };
00098
00099
00100 #endif  //_DATASOURCE_H_
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagPENWIDTHLOOKUP Member List

This is the complete list of members for tagPENWIDTHLOOKUP, including all inherited members.
iPenWidth | tagPENWIDTHLOOKUP
wMenuItem | tagPENWIDTHLOOKUP
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/asserts.h Source File

  • Dataaccess
  • oledb
  • sampprov

asserts.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module ASSERTS.H | Assertion Routines
00008 //
00009 //
00010 #ifndef _ASSERTS_H_
00011 #define _ASSERTS_H_
00012
00013
00014 ///////////////////////////////////////////////////////////////////////////////
00015 // Includes
00016 //
00017 ///////////////////////////////////////////////////////////////////////////////
00018 #include <crtdbg.h>   //_ASSERTE
00019
00020
00021 //-----------------------------------------------------------------------------
00022 // Global function prototypes -- helper stuff
00023 //-----------------------------------------------------------------------------
00024
00025 LRESULT wSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, WCHAR* pwszBuffer);
00026 HRESULT ConvertToMBCS(WCHAR* pwsz, CHAR* psz, ULONG cStrLen);
00027 HRESULT ConvertToWCHAR(CHAR* psz, WCHAR* pwsz, ULONG cStrLen);
00028
00029 HRESULT FreeProperties(ULONG* pcPropSets, DBPROPSET** prgPropSets);
00030 HRESULT FreeProperties(ULONG* pcProperties, DBPROP** prgProperties);
00031
00032
00033 //-----------------------------------------------------------------------------
00034 // Debugging macros
00035 //-----------------------------------------------------------------------------
00036
00037 # define ASSERT     _ASSERTE
00038 # define assert     ASSERT
00039
00040 #ifdef _DEBUG
00041 # define TRACE      OLEDB_Trace
00042 # define DEBUGCODE(p) p
00043 #else //_DEBUG
00044 # define TRACE      OLEDB_Trace
00045   inline void     OLEDB_Trace( const char *format, ... ) { /* do nothing */ }
00046 # define DEBUGCODE(p)
00047 #endif  //_DEBUG
00048
00049 #endif
00050
00051
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::StreamOpenOptionsEnum Member List

This is the complete list of members for msado15::StreamOpenOptionsEnum, including all inherited members.
adOpenStreamAsync | msado15::StreamOpenOptionsEnum | [static]
adOpenStreamFromRecord | msado15::StreamOpenOptionsEnum | [static]
adOpenStreamFromURL | msado15::StreamOpenOptionsEnum | [static]
stOpenAsync | msado15::StreamOpenOptionsEnum | [static]
stOpenFromRecord | msado15::StreamOpenOptionsEnum | [static]
stOpenFromURL | msado15::StreamOpenOptionsEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/registry.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout,   // Class Id for About Class
00040                        const BOOL fSupportExtensions = FALSE);
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventProvider/EvProv.h Source File

  • SysMgmt
  • WMI
  • VC
  • EventProvider

EvProv.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 //
00004
00005 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00006 //
00007 // File:  EVPROV.H
00008 //
00009 // Description:
00010 //        Sample event provider - header file defines event provider class
00011 //
00012 // History:
00013 //
00014 // **************************************************************************
00015
00016 #ifndef _EVPROV_H_
00017 #define _EVPROV_H_
00018
00019 // {3CD5248E-14F9-11d1-AE9C-00C04FB68820}
00020 DEFINE_GUID(CLSID_MyEventProvider,
00021 0x3cd5248e, 0x14f9, 0x11d1, 0xae, 0x9c, 0x0, 0xc0, 0x4f, 0xb6, 0x88, 0x20);
00022
00023 #define EVENTCLASS  L"MyEvent"
00024
00025 #include <NTSECAPI.H>
00026
00027
00028 class CMyEventProvider : public IWbemEventProvider, public IWbemProviderInit, public IWbemEventProviderSecurity
00029 {
00030     ULONG               m_cRef;
00031     IWbemServices       *m_pNs;
00032     IWbemObjectSink     *m_pSink;
00033     IWbemClassObject    *m_pEventClassDef;
00034     int                 m_eStatus;
00035     HANDLE              m_hThread;
00036
00037     static DWORD WINAPI EventThread(LPVOID pArg);
00038     void InstanceThread();
00039
00040   //security helper
00041   HRESULT CheckAccess (SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
00042           DWORD a_Access ,
00043           GENERIC_MAPPING *a_Mapping);
00044
00045
00046 public:
00047     enum { Pending, Running, PendingStop, Stopped };
00048
00049     CMyEventProvider();
00050    ~CMyEventProvider();
00051
00052     //
00053     // IUnknown members
00054     //
00055     STDMETHODIMP         QueryInterface(REFIID, LPVOID *);
00056     STDMETHODIMP_(ULONG) AddRef(void);
00057     STDMETHODIMP_(ULONG) Release(void);
00058
00059     // Inherited from IWbemEventProvider
00060     // =================================
00061
00062     HRESULT STDMETHODCALLTYPE ProvideEvents(
00063             /* [in] */ IWbemObjectSink __RPC_FAR *pSink,
00064             /* [in] */ long lFlags
00065             );
00066
00067     // Inherited from IWbemProviderInit
00068     // ================================
00069
00070     HRESULT STDMETHODCALLTYPE Initialize(
00071             /* [in] */ LPWSTR pszUser,
00072             /* [in] */ LONG lFlags,
00073             /* [in] */ LPWSTR pszNamespace,
00074             /* [in] */ LPWSTR pszLocale,
00075             /* [in] */ IWbemServices __RPC_FAR *pNamespace,
00076             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00077             /* [in] */ IWbemProviderInitSink __RPC_FAR *pInitSink
00078             );
00079
00080
00081    // Inherited from IWbemEventProviderSecurity
00082     // ================================
00083
00084   HRESULT STDMETHODCALLTYPE AccessCheck(
00085       /* [in] */ WBEM_CWSTR wszQueryLanguage,
00086       /* [in] */ WBEM_CWSTR wszQuery,
00087       /* [in] */ long lSidLength,
00088       /* [in, size_is(lSidLength), unique] */ const BYTE* pSid
00089       );
00090 };
00091
00092
00093 #endif
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleFSP/Reg.h Source File

  • NetDS
  • fax
  • SampleFSP

Reg.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1997 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007   reg.h
00008
00009 Abstract:
00010
00011   This module contains the registry definitions
00012
00013 --*/
00014
00015 #ifndef _REG_H
00016 #define _REG_H
00017
00018 // FAX_PROVIDERS_REGKEY is the providers registry key under the fax registry key
00019 #define FAX_PROVIDERS_REGKEY           L"Software\\Microsoft\\Fax\\Device Providers"
00020
00021 // NEWFSP_PROVIDER is the newfsp registry key under the providers registry key
00022 #define NEWFSP_PROVIDER                L"SampleFSP: Sample Windows XP Fax Service Provider"
00023 // NEWFSP_PROVIDER_FRIENDLYNAME is the friendly name of the newfsp service provider
00024 #define NEWFSP_PROVIDER_FRIENDLYNAME   L"SampleFSP: Sample Windows XP Fax Service Provider"
00025 // NEWFSP_PROVIDER_IMAGENAME is the image name of the newfsp service provider
00026 #define NEWFSP_PROVIDER_IMAGENAME      L"%SystemRoot%\\system32\\SampleFSP.dll"
00027 // NEWFSP_PROVIDER_PROVIDERNAME is the provider name of the newfsp service provider
00028 #define NEWFSP_PROVIDER_PROVIDERNAME   L"SampleFSP: Sample Windows XP Fax Service Provider"
00029
00030 // NEWFSP_LOGGING_ENABLED is the registry value indicating if logging is enabled
00031 #define NEWFSP_LOGGING_ENABLED         L"LoggingEnabled"
00032 // NEWFSP_LOGGING_DIRECTORY is the registry value indicating the logging directory
00033 #define NEWFSP_LOGGING_DIRECTORY       L"LoggingDirectory"
00034
00035 // NEWFSP_DEVICES is the virtual fax devices registry key under the newfsp registry key
00036 #define NEWFSP_DEVICES                 L"Devices"
00037
00038 // NEWFSP_DEVICE_DIRECTORY is the registry value indicating the incoming fax directory for the virtual fax device
00039 #define NEWFSP_DEVICE_DIRECTORY        L"IncomingFaxDirectory"
00040
00041 #endif
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Pipes/Include/pipe.cxx Source File

  • Com
  • Fundamentals
  • Pipes
  • Include

pipe.cxx

Go to the documentation of this file.
00001 /* Copyright 1992 - 2000 Microsoft Corporation, All rights reserved.
00002  *
00003  *
00004  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00005  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00006  * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00007 */
00008
00009 #include "pipe.hxx"
00010
00011 /******************************************
00012 * Helper functions for pipes
00013 ******************************************/
00014
00015 STDMETHODIMP GenericPull(IPipeLong *pPipe, LONG *buff, ULONG *pPulled, ULONG lElements)
00016 {
00017    HRESULT hr = S_OK;
00018    ULONG lcount = 0;
00019    ULONG lRemain = 0;
00020    ULONG lTransfer = 0;
00021
00022    if (0 == lElements) { lRemain = 1; }
00023    else { lRemain = lElements; }
00024
00025    do
00026    {
00027       if (1 == lRemain) { lTransfer = OPTIMUM_SIZE; }
00028       else { lTransfer = lRemain; }
00029
00030       lcount=0;
00031       hr = pPipe->Pull(buff, lTransfer, &lcount);
00032       if (FAILED(hr)) { return hr; }
00033
00034       // Verify the data was pulled properly
00035       hr = DrainBuffer(buff, lcount, *pPulled);
00036       if (FAILED(hr)) { return hr; }
00037       *pPulled = *pPulled + lcount;
00038       if ( 1 != lRemain )
00039       { lRemain = lRemain - lcount; }
00040
00041    } while ( lRemain > 0 && lcount > 0);
00042    return S_OK;
00043 }
00044
00045 STDMETHODIMP GenericPush(IPipeLong *pPipe, LONG *buff, ULONG lElements)
00046 {
00047    HRESULT hr = S_OK;
00048    ULONG lTransfer = 0;
00049
00050    lTransfer = lElements;
00051    hr = PopulateBuffer(buff, lTransfer, 0);
00052    if (FAILED(hr)) { return hr; }
00053
00054    hr = pPipe->Push(buff, lTransfer);
00055    if (FAILED(hr)) { return hr; }
00056
00057    return S_OK;
00058 }
00059
00060
00061
00062 STDMETHODIMP PopulateBuffer(long *buff, DWORD dwElementsCount,
00063                           DWORD dwStartIdx)
00064 {
00065    ULONG i;
00066
00067    for(i = dwStartIdx; i < dwElementsCount + dwStartIdx; i++)
00068    {
00069       // Can do something fancy here.
00070       *buff++ = i;
00071    }
00072
00073    return S_OK;
00074 };
00075
00076 STDMETHODIMP DrainBuffer(long *buff,
00077                             DWORD dwElementsCount,
00078                             DWORD dwStartIdx)
00079 {
00080    ULONG i;
00081
00082    for(i = dwStartIdx; i < dwElementsCount + dwStartIdx; i++)
00083    {
00084       // TODO: Need to output data to a file
00085       if( ULONG(*buff) != i )
00086       {
00087          return E_FAIL;
00088       }
00089       buff++;
00090    }
00091    return S_OK;
00092 };
00093
00094
00095
00096 /******************************************
00097 * Class CSamplePipe Implementation
00098 ******************************************/
00099
00100 CSamplePipe::CSamplePipe() :
00101    m_cRef(1), m_nPushSeq(0), m_nPullSeq(0),
00102    m_pBuffer(NULL),
00103    m_dwOutPipeRcvd(0), m_dwInPipeSent(0)
00104 {
00105 };
00106
00107 CSamplePipe::~CSamplePipe()
00108 {
00109    delete m_pBuffer;
00110 };
00111
00112 STDMETHODIMP CSamplePipe::QueryInterface(REFIID riid, void** ppv)
00113 {
00114
00115     *ppv = NULL;
00116
00117     if (IsEqualIID(IID_IPipeLong, riid))
00118     {
00119         *ppv = static_cast<IPipeLong *>(this);
00120     }
00121     else if (IsEqualIID(IID_IUnknown, riid))
00122     {
00123         *ppv = static_cast<IPipeLong *>(this);
00124     }
00125     else
00126     {
00127       return E_NOINTERFACE;
00128     }
00129
00130    reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00131    return S_OK;
00132 };
00133
00134 STDMETHODIMP_(ULONG) CSamplePipe::AddRef()
00135 {
00136     InterlockedIncrement((LONG *)&m_cRef);
00137     return m_cRef;
00138 };
00139
00140 STDMETHODIMP_(ULONG) CSamplePipe::Release()
00141 {
00142     ULONG cLockedRefs = InterlockedDecrement((LONG *)&m_cRef);
00143     if( cLockedRefs == 0 )
00144     {
00145        delete this;
00146     }
00147     return cLockedRefs;
00148 };
00149
00150 STDMETHODIMP CSamplePipe::Pull(long *buf, ULONG cRequest, ULONG *pcReturned)
00151 {
00152    HRESULT     hr=S_OK;
00153    DWORD       dwElementsAvailable = BUF_SIZE; // Should really be a member variable
00154    ULONG        lElements;
00155
00156
00157    //cout << "Pull being called on the pipe" << endl;
00158
00159    *pcReturned = 0;
00160
00161    // Adjust the number of elements we actually return
00162    lElements = dwElementsAvailable - m_dwInPipeSent;
00163    if( lElements < 0 )
00164        lElements = 0;
00165
00166    if( lElements > cRequest )
00167        lElements = cRequest;
00168
00169    // Fill the buffer
00170    hr = PopulateBuffer(buf, (DWORD) lElements, m_dwInPipeSent);
00171    if( FAILED(hr) )
00172    {
00173         //cout << "Populate buffer failed" << endl;
00174   return hr;
00175    }
00176
00177    // Set elements count
00178    *pcReturned = (DWORD) lElements;
00179    m_dwInPipeSent += lElements;
00180
00181    //cout << "cRequested = " << cRequest << " and Returned = " << lElements
00182    //   << endl << endl ;
00183
00184    if ( 0 == lElements)
00185    {
00186       m_dwInPipeSent = 0;
00187       //cout << "!WARNING! The pipe is drained .. Returning 0 count.."
00188       //    << " Pull sequence #" << m_nPullSeq << " is over" << endl << endl;
00189       m_nPullSeq++;
00190    }
00191
00192    return S_OK;
00193 }
00194
00195 STDMETHODIMP CSamplePipe::Push(long *buf, ULONG cSent)
00196 {
00197    HRESULT hr=S_OK;
00198
00199    //cout << "Push being called on the pipe" << endl;
00200    //cout << "cSent = " << cSent << " and Received before this = " << m_dwOutPipeRcvd
00201    //     << endl << endl;
00202
00203    hr = DrainBuffer(buf, cSent, m_dwOutPipeRcvd);
00204    if( FAILED(hr) )
00205    {
00206        //cout << "Unable to push the data received to the buffer !!" << endl;
00207        return hr;
00208    }
00209
00210    if ( 0 == cSent )
00211    {
00212        m_dwOutPipeRcvd = 0;
00213        //cout << "!WARNING! 0 count received at the push side.."
00214        //     << " Push sequence #" << m_nPushSeq << " is over."
00215        //     << endl << endl;
00216        m_nPushSeq++;
00217    }
00218    else
00219    {
00220        // Inc count for number of elems received.
00221        m_dwOutPipeRcvd += cSent;
00222    }
00223
00224    return hr;
00225 }
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcRDO/rdocomponent.Cpp Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcRDO

rdocomponent.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: RDOComponent.cpp
00003 //
00004 // Description: Implementation of CRDOComponent
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022 #include "stdafx.h"
00023 #include "RDOKB.h"
00024 #include "RDOComponent.h"
00025 #import "msrdo20.dll" no_namespace  rename("EOF", "rdoEOF") rename("UserNameA", "rdoUserNameA")
00026 /////////////////////////////////////////////////////////////////////////////
00027 // CRDOComponent
00028
00029 HRESULT CRDOComponent::Activate()
00030 {
00031   HRESULT hr = CoGetObjectContext(IID_IObjectContext, (void**)&m_spObjectContext);
00032   if (SUCCEEDED(hr))
00033     return S_OK;
00034   return hr;
00035 }
00036
00037 BOOL CRDOComponent::CanBePooled()
00038 {
00039   return TRUE;
00040 }
00041
00042 void CRDOComponent::Deactivate()
00043 {
00044   m_spObjectContext.Release();
00045 }
00046
00047
00048 STDMETHODIMP CRDOComponent::SimpleQuery(VARIANT * returnval)
00049 {
00050
00051   _rdoEnginePtr rdoEngine1;
00052   _rdoConnectionPtr rdoCon;
00053   _rdoResultsetPtr rdoRs;
00054   _variant_t InVar;
00055
00056    _bstr_t Source("select au_fname from authors where au_lname = 'White'");
00057    //NOTE: Secure database installations should never have a blank password
00058    // Trusted security is recommended for production systems - this avoids
00059    // having to store the password in the code
00060    _bstr_t Connect("DSN=pubs;Uid=sa;Pwd=;Database=pubs");
00061
00062   HRESULT hr = rdoEngine1.CreateInstance(__uuidof(rdoEngine));
00063    if (FAILED(hr)) return hr;
00064
00065   try
00066   {
00067     rdoEngine1->rdoEnvironments->GetItem(0L)->CursorDriver = rdUseNone;
00068     rdoCon =rdoEngine1->rdoEnvironments->GetItem(0L)->OpenConnection("",
00069       (long)rdDriverNoPrompt, 0L, Connect);
00070
00071     rdoRs = rdoCon->OpenResultset(Source);
00072     InVar = rdoRs->rdoColumns->GetItem("au_fname")->Value;
00073
00074     VariantClear(returnval);
00075     VariantCopy(returnval, &(InVar.Detach()));
00076
00077     rdoRs->Close();
00078     rdoRs=NULL;
00079     rdoCon->Close();
00080     rdoCon = NULL;
00081     rdoEngine1 = NULL;
00082   }
00083
00084   catch(_com_error z)
00085   {
00086     if(rdoRs)
00087     {
00088       rdoRs->Close();
00089       rdoRs = NULL;
00090     }
00091     if(rdoCon)
00092     {
00093       rdoCon->Close();
00094       rdoCon = NULL;
00095     }
00096     if(rdoEngine1)
00097       rdoEngine1 = NULL;
00098
00099     if(m_spObjectContext)
00100       m_spObjectContext->SetAbort();
00101     return z.Error();
00102   }
00103
00104   if (m_spObjectContext)
00105     m_spObjectContext->SetComplete();
00106   return S_OK;
00107 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Recordset15.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Recordset15.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface Recordset15
00019 /** @com.interface(iid=0000050E-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface Recordset15 extends msado15._ADO
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1000, type=PROPGET, name="AbsolutePosition", name2="getAbsolutePosition", addFlagsVtable=4)
00027       @com.parameters([type=I4] return) */
00028   public int getAbsolutePosition();
00029
00030   /** @com.method(vtoffset=6, dispid=1000, type=PROPPUT, name="AbsolutePosition", name2="putAbsolutePosition", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] pl) */
00032   public void setAbsolutePosition(int pl);
00033
00034   /** @com.method(vtoffset=7, dispid=1001, type=PROPPUTREF, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00035       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] pvar) */
00036   public void setActiveConnection(Object pvar);
00037
00038   /** @com.method(vtoffset=8, dispid=1001, type=PROPPUT, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00039       @com.parameters([in,type=VARIANT] pvar) */
00040   public void setActiveConnection(Variant pvar);
00041
00042   /** @com.method(vtoffset=9, dispid=1001, type=PROPGET, name="ActiveConnection", name2="getActiveConnection", addFlagsVtable=4)
00043       @com.parameters([type=VARIANT] return) */
00044   public Variant getActiveConnection();
00045
00046   /** @com.method(vtoffset=10, dispid=1002, type=PROPGET, name="BOF", name2="getBOF", addFlagsVtable=4)
00047       @com.parameters([type=BOOLEAN] return) */
00048   public boolean getBOF();
00049
00050   /** @com.method(vtoffset=11, dispid=1003, type=PROPGET, name="Bookmark", name2="getBookmark", addFlagsVtable=4)
00051       @com.parameters([type=VARIANT] return) */
00052   public Variant getBookmark();
00053
00054   /** @com.method(vtoffset=12, dispid=1003, type=PROPPUT, name="Bookmark", name2="putBookmark", addFlagsVtable=4)
00055       @com.parameters([in,type=VARIANT] pvBookmark) */
00056   public void setBookmark(Variant pvBookmark);
00057
00058   /** @com.method(vtoffset=13, dispid=1004, type=PROPGET, name="CacheSize", name2="getCacheSize", addFlagsVtable=4)
00059       @com.parameters([type=I4] return) */
00060   public int getCacheSize();
00061
00062   /** @com.method(vtoffset=14, dispid=1004, type=PROPPUT, name="CacheSize", name2="putCacheSize", addFlagsVtable=4)
00063       @com.parameters([in,type=I4] pl) */
00064   public void setCacheSize(int pl);
00065
00066   /** @com.method(vtoffset=15, dispid=1005, type=PROPGET, name="CursorType", name2="getCursorType", addFlagsVtable=4)
00067       @com.parameters([type=I4] return) */
00068   public int getCursorType();
00069
00070   /** @com.method(vtoffset=16, dispid=1005, type=PROPPUT, name="CursorType", name2="putCursorType", addFlagsVtable=4)
00071       @com.parameters([in,type=I4] plCursorType) */
00072   public void setCursorType(int plCursorType);
00073
00074   /** @com.method(vtoffset=17, dispid=1006, type=PROPGET, name="EOF", name2="getEOF", addFlagsVtable=4)
00075       @com.parameters([type=BOOLEAN] return) */
00076   public boolean getEOF();
00077
00078   /** @com.method(vtoffset=18, dispid=0, type=PROPGET, name="Fields", name2="getFields", addFlagsVtable=4)
00079       @com.parameters([iid=00000564-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00080   public msado15.Fields getFields();
00081
00082   /** @com.method(vtoffset=19, dispid=1008, type=PROPGET, name="LockType", name2="getLockType", addFlagsVtable=4)
00083       @com.parameters([type=I4] return) */
00084   public int getLockType();
00085
00086   /** @com.method(vtoffset=20, dispid=1008, type=PROPPUT, name="LockType", name2="putLockType", addFlagsVtable=4)
00087       @com.parameters([in,type=I4] plLockType) */
00088   public void setLockType(int plLockType);
00089
00090   /** @com.method(vtoffset=21, dispid=1009, type=PROPGET, name="MaxRecords", name2="getMaxRecords", addFlagsVtable=4)
00091       @com.parameters([type=I4] return) */
00092   public int getMaxRecords();
00093
00094   /** @com.method(vtoffset=22, dispid=1009, type=PROPPUT, name="MaxRecords", name2="putMaxRecords", addFlagsVtable=4)
00095       @com.parameters([in,type=I4] plMaxRecords) */
00096   public void setMaxRecords(int plMaxRecords);
00097
00098   /** @com.method(vtoffset=23, dispid=1010, type=PROPGET, name="RecordCount", name2="getRecordCount", addFlagsVtable=4)
00099       @com.parameters([type=I4] return) */
00100   public int getRecordCount();
00101
00102   /** @com.method(vtoffset=24, dispid=1011, type=PROPPUTREF, name="Source", name2="putSource", addFlagsVtable=4)
00103       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] pvSource) */
00104   public void setSource(Object pvSource);
00105
00106   /** @com.method(vtoffset=25, dispid=1011, type=PROPPUT, name="Source", name2="putSource", addFlagsVtable=4)
00107       @com.parameters([in,type=STRING] pvSource) */
00108   public void setSource(String pvSource);
00109
00110   /** @com.method(vtoffset=26, dispid=1011, type=PROPGET, name="Source", name2="getSource", addFlagsVtable=4)
00111       @com.parameters([type=VARIANT] return) */
00112   public Variant getSource();
00113
00114   /** @com.method(vtoffset=27, dispid=1012, type=METHOD, name="AddNew", addFlagsVtable=4)
00115       @com.parameters([in,type=VARIANT] FieldList, [in,type=VARIANT] Values) */
00116   public void AddNew(Variant FieldList, Variant Values);
00117
00118   /** @com.method(vtoffset=28, dispid=1013, type=METHOD, name="CancelUpdate", addFlagsVtable=4)
00119       @com.parameters() */
00120   public void CancelUpdate();
00121
00122   /** @com.method(vtoffset=29, dispid=1014, type=METHOD, name="Close", addFlagsVtable=4)
00123       @com.parameters() */
00124   public void Close();
00125
00126   /** @com.method(vtoffset=30, dispid=1015, type=METHOD, name="Delete", addFlagsVtable=4)
00127       @com.parameters([in,type=I4] AffectRecords) */
00128   public void Delete(int AffectRecords);
00129
00130   /** @com.method(vtoffset=31, dispid=1016, type=METHOD, name="GetRows", addFlagsVtable=4)
00131       @com.parameters([in,type=I4] Rows, [in,type=VARIANT] Start, [in,type=VARIANT] Fields, [type=VARIANT] return) */
00132   public Variant GetRows(int Rows, Variant Start, Variant Fields);
00133
00134   /** @com.method(vtoffset=32, dispid=1017, type=METHOD, name="Move", addFlagsVtable=4)
00135       @com.parameters([in,type=I4] NumRecords, [in,type=VARIANT] Start) */
00136   public void Move(int NumRecords, Variant Start);
00137
00138   /** @com.method(vtoffset=33, dispid=1018, type=METHOD, name="MoveNext", addFlagsVtable=4)
00139       @com.parameters() */
00140   public void MoveNext();
00141
00142   /** @com.method(vtoffset=34, dispid=1019, type=METHOD, name="MovePrevious", addFlagsVtable=4)
00143       @com.parameters() */
00144   public void MovePrevious();
00145
00146   /** @com.method(vtoffset=35, dispid=1020, type=METHOD, name="MoveFirst", addFlagsVtable=4)
00147       @com.parameters() */
00148   public void MoveFirst();
00149
00150   /** @com.method(vtoffset=36, dispid=1021, type=METHOD, name="MoveLast", addFlagsVtable=4)
00151       @com.parameters() */
00152   public void MoveLast();
00153
00154   /** @com.method(vtoffset=37, dispid=1022, type=METHOD, name="Open", addFlagsVtable=4)
00155       @com.parameters([in,type=VARIANT] Source, [in,type=VARIANT] ActiveConnection, [in,type=I4] CursorType, [in,type=I4] LockType, [in,type=I4] Options) */
00156   public void Open(Variant Source, Variant ActiveConnection, int CursorType, int LockType, int Options);
00157
00158   /** @com.method(vtoffset=38, dispid=1023, type=METHOD, name="Requery", addFlagsVtable=4)
00159       @com.parameters([in,type=I4] Options) */
00160   public void Requery(int Options);
00161
00162   /** @com.method(vtoffset=39, dispid=1610809378, type=METHOD, name="_xResync", addFlagsVtable=4)
00163       @com.parameters([in,type=I4] AffectRecords)
00164       @hidden */
00165   public void _xResync(int AffectRecords);
00166
00167   /** @com.method(vtoffset=40, dispid=1025, type=METHOD, name="Update", addFlagsVtable=4)
00168       @com.parameters([in,type=VARIANT] Fields, [in,type=VARIANT] Values) */
00169   public void Update(Variant Fields, Variant Values);
00170
00171   /** @com.method(vtoffset=41, dispid=1047, type=PROPGET, name="AbsolutePage", name2="getAbsolutePage", addFlagsVtable=4)
00172       @com.parameters([type=I4] return) */
00173   public int getAbsolutePage();
00174
00175   /** @com.method(vtoffset=42, dispid=1047, type=PROPPUT, name="AbsolutePage", name2="putAbsolutePage", addFlagsVtable=4)
00176       @com.parameters([in,type=I4] pl) */
00177   public void setAbsolutePage(int pl);
00178
00179   /** @com.method(vtoffset=43, dispid=1026, type=PROPGET, name="EditMode", name2="getEditMode", addFlagsVtable=4)
00180       @com.parameters([type=I4] return) */
00181   public int getEditMode();
00182
00183   /** @com.method(vtoffset=44, dispid=1030, type=PROPGET, name="Filter", name2="getFilter", addFlagsVtable=4)
00184       @com.parameters([type=VARIANT] return) */
00185   public Variant getFilter();
00186
00187   /** @com.method(vtoffset=45, dispid=1030, type=PROPPUT, name="Filter", name2="putFilter", addFlagsVtable=4)
00188       @com.parameters([in,type=VARIANT] Criteria) */
00189   public void setFilter(Variant Criteria);
00190
00191   /** @com.method(vtoffset=46, dispid=1050, type=PROPGET, name="PageCount", name2="getPageCount", addFlagsVtable=4)
00192       @com.parameters([type=I4] return) */
00193   public int getPageCount();
00194
00195   /** @com.method(vtoffset=47, dispid=1048, type=PROPGET, name="PageSize", name2="getPageSize", addFlagsVtable=4)
00196       @com.parameters([type=I4] return) */
00197   public int getPageSize();
00198
00199   /** @com.method(vtoffset=48, dispid=1048, type=PROPPUT, name="PageSize", name2="putPageSize", addFlagsVtable=4)
00200       @com.parameters([in,type=I4] pl) */
00201   public void setPageSize(int pl);
00202
00203   /** @com.method(vtoffset=49, dispid=1031, type=PROPGET, name="Sort", name2="getSort", addFlagsVtable=4)
00204       @com.parameters([type=STRING] return) */
00205   public String getSort();
00206
00207   /** @com.method(vtoffset=50, dispid=1031, type=PROPPUT, name="Sort", name2="putSort", addFlagsVtable=4)
00208       @com.parameters([in,type=STRING] Criteria) */
00209   public void setSort(String Criteria);
00210
00211   /** @com.method(vtoffset=51, dispid=1029, type=PROPGET, name="Status", name2="getStatus", addFlagsVtable=4)
00212       @com.parameters([type=I4] return) */
00213   public int getStatus();
00214
00215   /** @com.method(vtoffset=52, dispid=1054, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00216       @com.parameters([type=I4] return) */
00217   public int getState();
00218
00219   /** @com.method(vtoffset=53, dispid=1610809392, type=METHOD, name="_xClone", addFlagsVtable=4)
00220       @com.parameters([iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return)
00221       @hidden */
00222   public msado15._Recordset _xClone();
00223
00224   /** @com.method(vtoffset=54, dispid=1035, type=METHOD, name="UpdateBatch", addFlagsVtable=4)
00225       @com.parameters([in,type=I4] AffectRecords) */
00226   public void UpdateBatch(int AffectRecords);
00227
00228   /** @com.method(vtoffset=55, dispid=1049, type=METHOD, name="CancelBatch", addFlagsVtable=4)
00229       @com.parameters([in,type=I4] AffectRecords) */
00230   public void CancelBatch(int AffectRecords);
00231
00232   /** @com.method(vtoffset=56, dispid=1051, type=PROPGET, name="CursorLocation", name2="getCursorLocation", addFlagsVtable=4)
00233       @com.parameters([type=I4] return) */
00234   public int getCursorLocation();
00235
00236   /** @com.method(vtoffset=57, dispid=1051, type=PROPPUT, name="CursorLocation", name2="putCursorLocation", addFlagsVtable=4)
00237       @com.parameters([in,type=I4] plCursorLoc) */
00238   public void setCursorLocation(int plCursorLoc);
00239
00240   /** @com.method(vtoffset=58, dispid=1052, type=METHOD, name="NextRecordset", addFlagsVtable=4)
00241       @com.parameters([out,elementType=VARIANT,type=PTR] RecordsAffected, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00242   public msado15._Recordset NextRecordset(Variant RecordsAffected);
00243
00244   /** @com.method(vtoffset=59, dispid=1036, type=METHOD, name="Supports", addFlagsVtable=4)
00245       @com.parameters([in,type=I4] CursorOptions, [type=BOOLEAN] return) */
00246   public boolean Supports(int CursorOptions);
00247
00248   /** @com.method(vtoffset=60, dispid=4294967288, type=PROPGET, name="Collect", name2="getCollect", addFlagsVtable=4)
00249       @com.parameters([in,type=VARIANT] Index, [type=VARIANT] return)
00250       @hidden */
00251   public Variant getCollect(Variant Index);
00252
00253   /** @com.method(vtoffset=61, dispid=4294967288, type=PROPPUT, name="Collect", name2="putCollect", addFlagsVtable=4)
00254       @com.parameters([in,type=VARIANT] Index, [in,type=VARIANT] pvar)
00255       @hidden */
00256   public void setCollect(Variant Index, Variant pvar);
00257
00258   /** @com.method(vtoffset=62, dispid=1053, type=PROPGET, name="MarshalOptions", name2="getMarshalOptions", addFlagsVtable=4)
00259       @com.parameters([type=I4] return) */
00260   public int getMarshalOptions();
00261
00262   /** @com.method(vtoffset=63, dispid=1053, type=PROPPUT, name="MarshalOptions", name2="putMarshalOptions", addFlagsVtable=4)
00263       @com.parameters([in,type=I4] peMarshal) */
00264   public void setMarshalOptions(int peMarshal);
00265
00266   /** @com.method(vtoffset=64, dispid=1058, type=METHOD, name="Find", addFlagsVtable=4)
00267       @com.parameters([in,type=STRING] Criteria, [in,type=I4] SkipRecords, [in,type=I4] SearchDirection, [in,type=VARIANT] Start) */
00268   public void Find(String Criteria, int SkipRecords, int SearchDirection, Variant Start);
00269
00270
00271   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x50e, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00272 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/GenericUCP/CPP/genericucp.cpp Source File

  • NetDS
  • upnp
  • GenericUCP
  • CPP

genericucp.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation
00004
00005
00006 --*/
00007 // GenericUCP.cpp : Defines the class behaviors for the application.
00008 //
00009
00010 #include "stdafx.h"
00011 #include "GenericUCP.h"
00012 #include "GenericUCPDlg.h"
00013
00014 #ifdef _DEBUG
00015 #define new DEBUG_NEW
00016 #undef THIS_FILE
00017 static char THIS_FILE[] = __FILE__;
00018 #endif
00019
00020
00021
00022 CComModule _Module;
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CGenericUCPApp
00026
00027 BEGIN_MESSAGE_MAP(CGenericUCPApp, CWinApp)
00028   //{{AFX_MSG_MAP(CGenericUCPApp)
00029   //}}AFX_MSG_MAP
00030   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00031 END_MESSAGE_MAP()
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // CGenericUCPApp construction
00035
00036 CGenericUCPApp::CGenericUCPApp()
00037 {
00038 }
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // The one and only CGenericUCPApp object
00042
00043 CGenericUCPApp theApp;
00044
00045 /////////////////////////////////////////////////////////////////////////////
00046 // CGenericUCPApp initialization
00047
00048 BOOL CGenericUCPApp::InitInstance()
00049 {
00050
00051   AfxInitRichEdit();
00052
00053   AfxEnableControlContainer();
00054
00055   CCommandLineInfo cmdInfo;
00056   ParseCommandLine(cmdInfo);
00057
00058   if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
00059   {
00060     return TRUE;
00061   }
00062
00063
00064   if(CoInitialize(NULL)!=S_OK){
00065     TRACE(_T("CoInitialize failed\n"));
00066     return FALSE; // Return if COM initialization failed
00067   }
00068
00069   // Standard initialization
00070
00071 #ifdef _AFXDLL
00072   Enable3dControls();     // Call this when using MFC in a shared DLL
00073 #else
00074   Enable3dControlsStatic(); // Call this when linking to MFC statically
00075 #endif
00076
00077   CGenericUCPDlg dlg;
00078   m_pMainWnd = &dlg;
00079
00080   dlg.DoModal();
00081
00082
00083   // Since the dialog has been closed, return FALSE so that we exit the
00084   //  application, rather than start the application's message pump.
00085   return FALSE;
00086 }
00087
00088
00089 int CGenericUCPApp::ExitInstance()
00090 {
00091   CoUninitialize();// Uninitialize the COM
00092   return 0;
00093 }
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Clipboard/ClipText.c Source File

  • WinUI
  • Clipboard

ClipText.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corp.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /****************************************************************************
00013
00014     PROGRAM: Cliptext.c
00015
00016     PURPOSE: Demonstrates copying text to and from the clipboard
00017
00018     FUNCTIONS:
00019
00020         WinMain() - calls initialization function, processes message loop
00021         InitApplication() - initializes window data and registers window
00022         InitInstance() - saves instance handle and creates main window
00023         MainWndProc() - processes messages
00024         About() - processes messages for "About" dialog box
00025         OutOfMemory() - displays warning message
00026
00027 ****************************************************************************/
00028
00029 #include "cliptext.h"
00030 #include <string.h>
00031
00032 HINSTANCE hInst;
00033 HACCEL hAccTable;
00034 HWND   hwnd;
00035
00036 HANDLE hText = NULL;
00037
00038 TCHAR szInitialClientAreaText[] =
00039    TEXT("This program demonstrates the use of the Edit menu to copy and ")
00040    TEXT("paste text to and from the clipboard.  Try using the Copy command ")
00041    TEXT("to move this text to the clipboard, and the Paste command to replace ")
00042    TEXT("this text with data from another application.  \r\n\r\n")
00043    TEXT("You might want to try running Notepad and Clipbrd alongside this ")
00044    TEXT("application so that you can watch the data exchanges take place.  ");
00045
00046 HANDLE hData;                            /* handles to clip data  */
00047 LPTSTR lpData;                           /* pointers to clip data */
00048
00049 /* functions declared here, because of MIPS lack of passing C_DEFINES*/
00050 BOOL InitApplication(HANDLE);
00051 BOOL InitInstance(HANDLE, INT);
00052 LRESULT APIENTRY MainWndProc(HWND, UINT, WPARAM, LPARAM);
00053 INT_PTR APIENTRY About(HWND, UINT, WPARAM, LPARAM);
00054 VOID OutOfMemory(VOID);
00055
00056 /****************************************************************************
00057
00058     FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
00059
00060     PURPOSE: calls initialization function, processes message loop
00061
00062 ****************************************************************************/
00063 int APIENTRY WinMain(
00064     HINSTANCE hInstance,
00065     HINSTANCE hPrevInstance,
00066     LPSTR lpCmdLine,
00067     int nCmdShow)
00068 {
00069     MSG msg = {0};
00070     BOOL bRet = FALSE;
00071     BOOL bSuccess = TRUE;
00072
00073     if (!InitApplication(hInstance))
00074     {
00075         bSuccess = FALSE;
00076         goto exit_func;
00077     }
00078
00079     if (!InitInstance(hInstance, nCmdShow))
00080     {
00081         bSuccess = FALSE;
00082         goto exit_func;
00083     }
00084
00085
00086     while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
00087     {
00088         if (bRet == -1)
00089         {
00090             bSuccess = FALSE;
00091             goto exit_func;
00092         }
00093         else
00094         {
00095             /* Only translate message if it is not an accelerator message */
00096             if (!TranslateAccelerator(hwnd, hAccTable, &msg))
00097             {
00098                 TranslateMessage(&msg);
00099                 DispatchMessage(&msg);
00100             }
00101         }
00102     }
00103
00104 exit_func:
00105     if (bSuccess)
00106     {
00107         return (int) (msg.wParam);
00108     }
00109     else
00110     {
00111         return 0;
00112     }
00113 }
00114
00115
00116 /****************************************************************************
00117
00118     FUNCTION: InitApplication(HANDLE)
00119
00120     PURPOSE: Initializes window data and registers window class
00121
00122 ****************************************************************************/
00123 BOOL InitApplication(
00124     HANDLE hInstance)
00125 {
00126     WNDCLASS  wc = {0};
00127
00128     wc.lpfnWndProc = (WNDPROC) MainWndProc;
00129     wc.hInstance = hInstance;
00130     wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
00131     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00132     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
00133     wc.lpszMenuName =  TEXT("CliptextMenu");
00134     wc.lpszClassName = TEXT("CliptextWClass");
00135
00136     return (RegisterClass(&wc));
00137 }
00138
00139
00140 /****************************************************************************
00141
00142     FUNCTION:  InitInstance(HANDLE, int)
00143
00144     PURPOSE:  Saves instance handle and creates main window
00145
00146 ****************************************************************************/
00147 BOOL InitInstance(
00148     HINSTANCE hInstance,
00149     INT nCmdShow)
00150 {
00151     LPTSTR lpszText = NULL;
00152     BOOL bSuccess = TRUE;
00153
00154     hInst = hInstance;
00155
00156     hAccTable = LoadAccelerators(hInst, TEXT("ClipTextAcc"));
00157
00158     if (!(hText
00159           = GlobalAlloc(GMEM_MOVEABLE,(DWORD)sizeof(szInitialClientAreaText))))
00160     {
00161         OutOfMemory();
00162         bSuccess = FALSE;
00163         goto exit_func;
00164     }
00165
00166     if (!(lpszText = GlobalLock(hText)))
00167     {
00168         OutOfMemory();
00169         bSuccess = FALSE;
00170         goto exit_func;
00171     }
00172
00173     lstrcpyn(lpszText, szInitialClientAreaText,
00174              sizeof(szInitialClientAreaText)/sizeof(szInitialClientAreaText[0]) - 1);
00175     GlobalUnlock(hText);
00176
00177     hwnd = CreateWindow(
00178         TEXT("CliptextWClass"),
00179         TEXT("Cliptext Sample Application"),
00180         WS_OVERLAPPEDWINDOW,
00181         CW_USEDEFAULT, 0,
00182         CW_USEDEFAULT, 0,
00183         NULL, NULL, hInstance, NULL );
00184
00185     if (!hwnd)
00186     {
00187         bSuccess = FALSE;
00188         goto exit_func;
00189     }
00190
00191     ShowWindow(hwnd, nCmdShow);
00192     bSuccess = UpdateWindow(hwnd);
00193
00194 exit_func:
00195     return bSuccess;
00196 }
00197
00198 /****************************************************************************
00199
00200     FUNCTION: MainWndProc(HWND, unsigned, WORD, LONG)
00201
00202     PURPOSE:  Processes messages
00203
00204     MESSAGES:
00205
00206         WM_COMMAND    - message from menu
00207         WM_INITMENU   - initialize menu
00208         WM_PAINT      - update window
00209         WM_DESTROY    - destroy window
00210
00211     COMMENTS:
00212
00213         WM_INITMENU - when this message is received, the application checks
00214         to see if there is any text data in the clipboard, and enables or
00215         disables the Paste menu item accordingly.
00216
00217         Seclecting the Copy menu item will send the text "Hello Windows" to
00218         the clipboard.
00219
00220         Seclecting the Paste menu item will copy whatever text is in the
00221         clipboard to the application window.
00222
00223 ****************************************************************************/
00224 LRESULT APIENTRY MainWndProc(
00225     HWND hWnd,
00226     UINT message,
00227     WPARAM wParam,
00228     LPARAM lParam)
00229 {
00230     HDC         hDC         = NULL;
00231     PAINTSTRUCT ps          = {0};
00232     RECT        rectClient  = {0};
00233     LPTSTR      lpszText    = NULL;
00234     HANDLE      hClipData   = NULL;  /* handles to clip data  */
00235     LPTSTR      lpClipData  = NULL;  /* pointers to clip data */
00236
00237
00238     switch (message)
00239     {
00240         case WM_INITMENU:
00241             if (wParam == (WPARAM)GetMenu(hWnd))
00242             {
00243           if (OpenClipboard(hWnd))
00244           {
00245 #ifdef UNICODE
00246                     if (IsClipboardFormatAvailable(CF_UNICODETEXT))
00247 #else
00248                     if (IsClipboardFormatAvailable(CF_TEXT) || IsClipboardFormatAvailable(CF_OEMTEXT))
00249 #endif // UNICODE
00250                     {
00251                         EnableMenuItem((HMENU)wParam, IDM_PASTE, MF_ENABLED);
00252                     }
00253               else
00254               {
00255                         EnableMenuItem((HMENU)wParam, IDM_PASTE, MF_GRAYED);
00256               }
00257                     CloseClipboard();
00258                   return (TRUE);
00259                 }
00260                 else                           /* Clipboard is not available */
00261                 {
00262                     return (FALSE);
00263                 }
00264             }
00265             return (TRUE);
00266
00267         case WM_COMMAND:
00268             switch(LOWORD(wParam))
00269             {
00270                 case IDM_ABOUT:
00271                     DialogBox(hInst, TEXT("AboutBox"), hWnd, About);
00272                     break;
00273
00274                     /* file menu commands */
00275
00276                 case IDM_NEW:    /* fall-through */
00277                 case IDM_OPEN:   /* fall-through */
00278                 case IDM_SAVE:   /* fall-through */
00279                 case IDM_SAVEAS: /* fall-through */
00280                 case IDM_PRINT:
00281                     MessageBox (GetFocus (),
00282                                 TEXT("Command not implemented."),
00283                                 TEXT("ClipText Sample Application"),
00284                                 MB_ICONASTERISK | MB_OK );
00285                     break;
00286
00287                 case IDM_EXIT:
00288                     DestroyWindow(hWnd);
00289                     break;
00290
00291                 /* edit menu commands */
00292                 case IDM_UNDO:  /* fall-through */
00293                 case IDM_CLEAR:
00294                     MessageBox (GetFocus (),
00295                                 TEXT("Command not implemented."),
00296                                 TEXT("ClipText Sample Application"),
00297                                 MB_ICONASTERISK | MB_OK);
00298                     break;
00299
00300                 case IDM_CUT:  /* fall-through */
00301                 case IDM_COPY:
00302                     if (hText != NULL)
00303                     {
00304                         /* Allocate memory and copy the string to it */
00305                         if (!(hData
00306                              = GlobalAlloc(GMEM_DDESHARE, GlobalSize (hText))))
00307                         {
00308                             OutOfMemory();
00309                             return (TRUE);
00310                         }
00311                         if (!(lpData = GlobalLock(hData)))
00312                         {
00313                             OutOfMemory();
00314                             return (TRUE);
00315                         }
00316                         if (!(lpszText = GlobalLock (hText)))
00317                         {
00318                             OutOfMemory();
00319                             return (TRUE);
00320                         }
00321                         lstrcpyn(lpData, lpszText, (int)GlobalSize (hText));
00322                         GlobalUnlock(hData);
00323                         GlobalUnlock (hText);
00324
00325                         /* Clear the current contents of the clipboard, and set
00326                          * the data handle to the new string.
00327                          */
00328                         if (OpenClipboard(hWnd))
00329                         {
00330                             EmptyClipboard();
00331 #ifdef UNICODE
00332                             SetClipboardData(CF_UNICODETEXT, hData);
00333 #else
00334                             SetClipboardData(CF_TEXT, hData);
00335 #endif // UNICODE
00336                             CloseClipboard();
00337                         }
00338                         hData = NULL;
00339
00340                         if (LOWORD(wParam) == IDM_CUT)
00341                         {
00342                             GlobalFree (hText);
00343                             hText = NULL;
00344                             EnableMenuItem(GetMenu (hWnd), IDM_CUT, MF_GRAYED);
00345                             EnableMenuItem(GetMenu(hWnd), IDM_COPY, MF_GRAYED);
00346                             InvalidateRect (hWnd, NULL, TRUE);
00347                             UpdateWindow (hWnd);
00348                         }
00349                     }
00350                     return (TRUE);
00351
00352                 case IDM_PASTE:
00353                     if (OpenClipboard(hWnd))
00354                     {
00355                         /* get text from the clipboard */
00356 #ifdef UNICODE
00357                         if (!(hClipData = GetClipboardData(CF_UNICODETEXT)))
00358 #else
00359                         if (!(hClipData = GetClipboardData(CF_TEXT)))
00360 #endif // !UNICODE
00361                         {
00362                             CloseClipboard();
00363                             break;
00364                         }
00365
00366                         if (hText != NULL)
00367                         {
00368                             GlobalFree(hText);
00369                         }
00370
00371                         if (!(hText = GlobalAlloc(GMEM_MOVEABLE, GlobalSize(hClipData))))
00372                         {
00373                             OutOfMemory();
00374                             CloseClipboard();
00375                             break;
00376                         }
00377
00378                         if (!(lpClipData = GlobalLock(hClipData)))
00379                         {
00380                             OutOfMemory();
00381                             CloseClipboard();
00382                             break;
00383                         }
00384
00385                         if (!(lpszText = GlobalLock(hText)))
00386                         {
00387                             OutOfMemory();
00388                             CloseClipboard();
00389                             break;
00390                         }
00391
00392                         lstrcpyn(lpszText, lpClipData, (int)GlobalSize(hClipData));
00393                         GlobalUnlock(hClipData);
00394                         CloseClipboard();
00395                         GlobalUnlock(hText);
00396                         EnableMenuItem(GetMenu(hWnd), IDM_CUT, MF_ENABLED);
00397                         EnableMenuItem(GetMenu(hWnd), IDM_COPY, MF_ENABLED);
00398
00399                         /* copy text to the application window */
00400
00401                         InvalidateRect(hWnd, NULL, TRUE);
00402                         UpdateWindow(hWnd);
00403                         return (TRUE);
00404                     }
00405                     else
00406                     {
00407                         return (FALSE);
00408                     }
00409                 }
00410                 break;
00411
00412             case WM_SIZE:
00413                 InvalidateRect(hWnd, NULL, TRUE);
00414                 break;
00415
00416             case WM_PAINT:
00417                 hDC = BeginPaint (hWnd, &ps);
00418                 if (hText != NULL)
00419                 {
00420                     if (!(lpszText = GlobalLock (hText)))
00421                     {
00422                         OutOfMemory();
00423                     }
00424                     else
00425                     {
00426                         GetClientRect (hWnd, &rectClient);
00427                         DrawText (hDC, lpszText, -1, &rectClient,
00428                                   DT_EXTERNALLEADING | DT_NOPREFIX | DT_WORDBREAK);
00429                         GlobalUnlock (hText);
00430                     }
00431                 }
00432                 EndPaint (hWnd, &ps);
00433                 break;
00434
00435             case WM_DESTROY:
00436                 PostQuitMessage(0);
00437                 break;
00438
00439             default:
00440                 return (DefWindowProc(hWnd, message, wParam, lParam));
00441     }
00442     return (0);
00443 }
00444
00445
00446 /****************************************************************************
00447
00448     FUNCTION: About(HWND, unsigned, WORD, LONG)
00449
00450     PURPOSE:  Processes messages for "About" dialog box
00451
00452     MESSAGES:
00453
00454         WM_INITDIALOG - initialize dialog box
00455         WM_COMMAND    - Input received
00456
00457 ****************************************************************************/
00458 INT_PTR APIENTRY About(
00459     HWND hDlg,
00460     UINT message,
00461     WPARAM wParam,
00462     LPARAM lParam)
00463 {
00464     BOOL bRet = FALSE;
00465
00466     switch (message)
00467     {
00468         case WM_INITDIALOG:
00469             bRet = TRUE;
00470             break;
00471
00472         case WM_COMMAND:
00473             if (LOWORD(wParam) == IDOK ||
00474                 LOWORD(wParam) == IDCANCEL)
00475             {
00476                 EndDialog(hDlg, TRUE);
00477                 bRet = TRUE;
00478             }
00479             break;
00480     }
00481
00482     return (INT_PTR)bRet;
00483 }
00484
00485
00486 /****************************************************************************
00487
00488     FUNCTION: OutOfMemory(void)
00489
00490     PURPOSE:  Displays warning message
00491
00492 ****************************************************************************/
00493 VOID OutOfMemory()
00494 {
00495     MessageBox(
00496         GetFocus(),
00497         TEXT("Out of Memory"),
00498         NULL,
00499         MB_ICONHAND | MB_SYSTEMMODAL);
00500     return;
00501 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComUser/UTCRUCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ComUser

UTCRUCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCruiseCar COM
00005              object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and IUtility
00009              interfaces.  This is done through Aggregation reuse of a
00010              COCruiseCar COM object (specifically providing its ICar and
00011              ICruise interface features).  COUtilityCruiseCar adds its own
00012              native implementation of the IUtility interface.  The
00013              aggregated CruiseCar object is implemented and provided in
00014              an outside COMOBJ.DLL.
00015
00016              This multiple interface COM Object Class is achieved via
00017              the technique of nested classes: the implementation of the
00018              IUtility interface is nested inside of the COUtilityCruiseCar
00019              COM object class.
00020
00021              For a comprehensive tutorial code tour of this module's
00022              contents and offerings see the tutorial COMUSER.HTM
00023              file.  For more specific technical details on the internal
00024              workings see the comments dispersed throughout the
00025              module's source code.
00026
00027   Classes:   COUtilityCruiseCar
00028
00029   Functions: .
00030
00031   Origin:    8-29-95: atrent - Editor inheritance from CRUCAR.H.
00032
00033 ----------------------------------------------------------------------------
00034   This file is part of the Microsoft COM Tutorial Code Samples.
00035
00036   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00037
00038   This source code is intended only as a supplement to Microsoft
00039   Development Tools and/or on-line documentation.  See these other
00040   materials for detailed information regarding Microsoft code samples.
00041
00042   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00043   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00044   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00045   PARTICULAR PURPOSE.
00046 ==========================================================================+*/
00047
00048 #if !defined(UTCRUCAR_H)
00049 #define UTCRUCAR_H
00050
00051 #ifdef __cplusplus
00052
00053 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00054   ObjectClass: COUtilityCruiseCar
00055
00056   Summary:     COM Object Class for COUtilityCruiseCar COM Objects.
00057                COM objects of this class augment COCruiseCar COM objects
00058                with the IUtility interface features of Offroad and Winch.
00059                COCruiseCar is reused to offer this COUtilityCruiseCar COM
00060                Object the ICar interface features of Shift, Clutch, Speed,
00061                Steer and the ICruise interface features of Engage and
00062                Adjust.  This COUtilityCruiseCar COM object class is
00063                constructed by aggregation reuse of the COCruiseCar COM
00064                object class.  The mulitple interfaces on this COM object
00065                class are constructed via the nested class
00066                interfaces technique.
00067
00068   Interfaces:  IUnknown
00069                  Standard interface providing COM object features.
00070                ICar
00071                  Basic car features.
00072                ICruise
00073                  Cruise control system features.
00074                IUtility
00075                  Sport-utility Car operation features.  Implemented in
00076                  this COM object.
00077
00078   Aggregation: Yes, COUtilityCruiseCar COM objects are aggregatable by
00079                passing a non-NULL pUnkOuter IUnknown pointer into
00080                the constructor.
00081 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00082 class COUtilityCruiseCar : public IUnknown
00083 {
00084   public:
00085     // Main Object Constructor & Destructor.
00086     COUtilityCruiseCar(IUnknown* pUnkOuter);
00087     ~COUtilityCruiseCar(void);
00088
00089     // A general method for initializing a newly created UtilityCruiseCar.
00090     HRESULT Init(void);
00091
00092     // IUnknown members. Main object, non-delegating.
00093     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00094     STDMETHODIMP_(ULONG) AddRef(void);
00095     STDMETHODIMP_(ULONG) Release(void);
00096
00097   private:
00098     // We declare nested class interface implementations here.
00099
00100     // We implement the IUtility interface (of course) in this
00101     // COUtilityCruiseCar COM object class.  This is the native interface
00102     // that we are using as an augmentation to the existing COCruiseCar
00103     // COM object class.
00104     class CImpIUtility : public IUtility
00105     {
00106       public:
00107         // Interface Implementation Constructor & Destructor.
00108         CImpIUtility(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00109         ~CImpIUtility(void);
00110
00111         // IUnknown members.
00112         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00113         STDMETHODIMP_(ULONG) AddRef(void);
00114         STDMETHODIMP_(ULONG) Release(void);
00115
00116         // IUtility members.
00117         STDMETHODIMP Offroad(short nGear);
00118         STDMETHODIMP Winch(short nRpm);
00119
00120       private:
00121         // Data private to this interface implementation of IUtility.
00122         ULONG               m_cRefI;     // Interface Ref Count (debugging).
00123         COUtilityCruiseCar* m_pBackObj;  // Parent Object back pointer.
00124         IUnknown*           m_pUnkOuter; // Outer unknown for Delegation.
00125     };
00126
00127     // Make the otherwise private and nested IUtility interface
00128     // implementation a friend to COM object instantiations of this
00129     // selfsame COUtilityCruiseCar COM object class.
00130     friend CImpIUtility;
00131
00132     // Private data of COUtilityCruiseCar COM objects.
00133
00134     // Nested IUtility implementation instantiation.  This IUtility
00135     // interface is instantiated inside this COUtilityCruiseCar object
00136     // as a native interface.
00137     CImpIUtility    m_ImpIUtility;
00138
00139     // Main Object reference count.
00140     ULONG           m_cRefs;
00141
00142     // Outer unknown (aggregation delegation). Used when this
00143     // COUtilityCruiseCar object is being aggregated.
00144     IUnknown*       m_pUnkOuter;
00145
00146     // We need to save the IUnknown interface pointer on the COCruiseCar
00147     // object that we aggregate.  We use this when we need to delegate
00148     // IUnknown calls to this aggregated inner object.
00149     IUnknown*       m_pUnkCruiseCar;
00150 };
00151
00152 typedef COUtilityCruiseCar* PCOUtilityCruiseCar;
00153
00154 // Here is a prototpye for the UtilityCruiseCar Creation function.
00155 HRESULT CreateUtilityCruiseCar(
00156           IUnknown* pUnkOuter,
00157           REFIID riid,
00158           PPVOID ppv);
00159
00160 #endif // __cplusplus
00161
00162
00163 #endif // UTCRUCAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SIMPLE_BROWSER Member List

This is the complete list of members for SIMPLE_BROWSER, including all inherited members.
ASYNC_REQUESTER class | SIMPLE_BROWSER | [friend]
Close(VOID) | SIMPLE_BROWSER |
m_EmbeddedLinks | SIMPLE_BROWSER | [private]
m_fShutdownInProgress | SIMPLE_BROWSER | [private]
m_hSession | SIMPLE_BROWSER | [private]
m_hShutdownEvent | SIMPLE_BROWSER | [private]
m_LinksCritSec | SIMPLE_BROWSER | [private]
m_nID | SIMPLE_BROWSER | [private]
m_nRequesterIDSeed | SIMPLE_BROWSER | [private]
m_pBrowserConfig | SIMPLE_BROWSER | [private]
m_pHomePageRequester | SIMPLE_BROWSER | [private]
OnRequesterClosed(ASYNC_REQUESTER *) | SIMPLE_BROWSER | [private]
OnRequesterStopped(ASYNC_REQUESTER *) | SIMPLE_BROWSER | [private]
Open(P_BROWSER_CONFIG) | SIMPLE_BROWSER |
SIMPLE_BROWSER(UINT nID) | SIMPLE_BROWSER |
~SIMPLE_BROWSER() | SIMPLE_BROWSER |
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/txsub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

txsub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __TXSUB_H_
00018 #define __TXSUB_H_
00019
00020 #include "resource.h"       // main symbols
00021
00022 class CComSpy;
00023
00024 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00025 Class:   CTxSub
00026 Summary: Transaction Events Subscriber
00027 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00028 class ATL_NO_VTABLE CTxSub :
00029   public CSysLCESub,
00030   public IComTransactionEvents
00031 {
00032 public:
00033
00034   CTxSub(CComSpy * pSpy)
00035   {
00036     m_pSpy = pSpy;
00037   }
00038   CTxSub()
00039   {
00040     m_pSpy = NULL;
00041   }
00042
00043   DECLARE_NOT_AGGREGATABLE(CTxSub)
00044   DECLARE_GET_CONTROLLING_UNKNOWN()
00045
00046   BEGIN_COM_MAP(CTxSub)
00047     COM_INTERFACE_ENTRY(IComTransactionEvents)
00048     COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00049   END_COM_MAP()
00050
00051   STDMETHODIMP GetEventType(EventEnum * e){*e = Transaction;return S_OK;}
00052   STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00053   STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComTransactionEvents;return S_OK;}
00054
00055 public:
00056   STDMETHOD (OnTransactionStart)(COMSVCSEVENTINFO * pInfo, REFGUID guidTx, REFGUID tsid, BOOL bRoot);
00057   STDMETHOD (OnTransactionPrepare)(COMSVCSEVENTINFO * pInfo, REFGUID guidTx, BOOL bVoteYes);
00058   STDMETHOD (OnTransactionAbort)(COMSVCSEVENTINFO * pInfo, REFGUID guidTx);
00059   STDMETHOD (OnTransactionCommit)(COMSVCSEVENTINFO * pInfo, REFGUID guidTx);
00060
00061
00062 };
00063
00064 #endif //__TXSUB_H_
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/view.cpp Source File

  • Begin
  • sdkdiff

view.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * view.cpp
00013  *
00014  *       map rows in window to items in COMPLIST
00015  *
00016  *
00017  * A view owns a COMPLIST, and talks to a table window. The table window
00018  * shows 3 columns: line nr, tag and text. We also need to supply a state
00019  * for each row (used to select colour scheme).
00020  *
00021  * The COMPLIST can give us a list of its COMPITEMs. Each of these can give
00022  * us a tag (eg the filenames compared) and the text (usually the compare
00023  * result), and the state. We make the line number from the
00024  * COMPITEM's place in the list.
00025  *
00026  * If we are asked to switch to 'expand' mode, we ask the selected COMPITEM
00027  * for its composite section list. We can then get the state (and thus
00028  * the tag) from each SECTION, and the line nr and text from the LINEs within
00029  * each section.
00030  *
00031  * When moving between expand and outline, and when refreshing the view
00032  * for some option change, we have to be careful to keep the current row
00033  * and the selected row in the table what the user would expect (!)
00034  *
00035  *
00036  * WIN32: Functions in this module can be called from the UI thread (to refresh
00037  * the display) and simultaneously from a worker thread to update the
00038  * view mapping (view_setcomplist, view_newitem). We use a critical section
00039  * to manage the synchronisation. We need to protect all access/modification
00040  * to the view structure elements (particularly bExpand, rows, pLines and
00041  * pItems), BUT we must not hold the critical section over any calls
00042  * to SendMessage.
00043  *
00044  */
00045
00046 #include "precomp.h"
00047 #include "table.h"
00048
00049 #include "state.h"
00050 #include "sdkdiff.h"
00051 #include "wdiffrc.h"
00052
00053 #include "list.h"
00054 #include "line.h"
00055 #include "scandir.h"
00056 #include "file.h"
00057 #include "section.h"
00058 #include "compitem.h"
00059 #include "complist.h"
00060 #include "findgoto.h"
00061
00062 #include "view.h"
00063
00064 /*
00065  * data structures
00066  */
00067 #ifdef WIN32
00068 #define huge
00069 #endif
00070
00071 /* in expand mode, we keep an array of one of these per screen line. */
00072 typedef struct viewline {
00073         LINE line;              /* handle to LINE for this row */
00074         SECTION section;        /* handle to section containing this line */
00075         int nr_left;            /* line nr in left file */
00076         int nr_right;           /* line nr in right file */
00077 } VIEWLINE, FAR * PVIEWLINE;
00078
00079
00080 /*
00081  * The users VIEW handle is in fact a pointer to this structure
00082  */
00083 struct view {
00084
00085         HWND     hwnd;          /* the table window to send notifies to */
00086
00087         COMPLIST cl;            /* the complist that we own */
00088
00089         BOOL     bExpand;       /* true if we are in expand mode */
00090         BOOL     bExpanding;    /* set by view_expandstart, reset by view_expand
00091                                    interrogated in sdkdiff.cpp, causes keystrokes
00092                                    to be ignored.  Protects against mappings being
00093                                    messed up by another thread.
00094                                    (I have doubts about this - Laurie).
00095                                 */
00096         BOOL     bExpandGuard;  /* Protects against two threads both trying to
00097                                    expand the same item.
00098                                 */
00099
00100         COMPITEM ciSelect;      /* selected compitem (in expand mode) */
00101
00102         int      rows;          /* number of rows in this view */
00103
00104         char     nrtext[12];    /* we use this in view_gettext for the line
00105                                  * number column. overwritten on each call
00106                                  */
00107         int      maxtag, maxrest;/* column widths in characters for cols 1, 2 */
00108
00109         /* if we are in outline mode, we map the row number to one entry
00110          * in this array of COMPITEM handles. this pointer will
00111          * be NULL in expand mode
00112          */
00113         COMPITEM FAR * pItems;
00114
00115         /* in expand mode we use this array of line and section handles */
00116         PVIEWLINE pLines;
00117 };
00118
00119 #ifdef WIN32
00120
00121 CRITICAL_SECTION CSView;       /* also known to Sdkdiff.cpp WM_EXIT processing */
00122 static BOOL bDoneInit = FALSE;
00123
00124 #define ViewEnter()     EnterCriticalSection(&CSView);
00125 #define ViewLeave()     LeaveCriticalSection(&CSView);
00126
00127 #else //WIN32
00128
00129 #define ViewEnter()
00130 #define ViewLeave()
00131
00132 #endif //WIN32
00133
00134
00135 extern long selection;
00136 extern long selection_nrows;
00137
00138 /*------- forward declaration of internal functions ----------------*/
00139
00140 void view_outline_opt(VIEW view, BOOL bRedraw, COMPITEM ci, int* prow);
00141 void view_freemappings(VIEW view);
00142 int view_findrow(VIEW view, int number, BOOL bRight);
00143 BOOL view_expand_item(VIEW view, COMPITEM ci);
00144
00145
00146 /* -----  externally-called functions---------------------------*/
00147 /* view_new
00148  *
00149  * create a new view. at this point, we are told the table window handle,
00150  * and nothing else.
00151  *
00152  */
00153 VIEW
00154 view_new(HWND hwndTable)
00155 {
00156         VIEW view;
00157
00158 #ifdef WIN32
00159         if (!bDoneInit) {
00160                 InitializeCriticalSection(&CSView);
00161                 bDoneInit = TRUE;
00162         }
00163 #endif
00164
00165         /* alloc the view using HeapAlloc */
00166         view = (VIEW) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct view));
00167     if (view == NULL)
00168       return NULL;
00169         /* set the default fields */
00170         view->hwnd = hwndTable;
00171         view->cl = NULL;
00172         view->bExpand = FALSE;
00173         view->bExpandGuard = FALSE;
00174         view->ciSelect = NULL;
00175         view->rows = 0;
00176         view->pItems = NULL;
00177         view->pLines = NULL;
00178
00179     // erase the message in the names field - the central box in the status bar
00180     SetNames("");
00181         return(view);
00182 }
00183
00184
00185 /*
00186  * view_setcomplist.
00187  *
00188  * We have to separate view_new and view_setcomplist because we need
00189  * to give the view handle to the complist and the complist handle to the
00190  * view. So do a view_new to create a null view; then complist_new() to
00191  * which you pass a view handle. The complist will then register itself
00192  * with the view by calling this function. During the build of the complist,
00193  * it will also update us by calling view_additem, so that we can refresh
00194  * the display.
00195  *
00196  * Here we should initialise an outline view of the complist.
00197  *
00198  * We also talk to the status bar using SetNames to set the names of
00199  * the two items.
00200  */
00201 BOOL
00202 view_setcomplist(VIEW view, COMPLIST cl)
00203 {
00204         LPSTR both;
00205
00206         if (view == NULL) {
00207                 return(FALSE);
00208         }
00209
00210         /* there can be only one call to this per VIEW */
00211         if (view->cl != NULL) {
00212                 return (FALSE);
00213         }
00214
00215         ViewEnter();
00216
00217         view->cl = cl;
00218
00219         /* set names on status bar to root names of left and right trees */
00220         both = complist_getdescription(cl);
00221         ViewLeave();                      // LKGHACK
00222         SetNames(both);
00223         ViewEnter();                      // LKGHACK
00224         complist_freedescription(cl, both);
00225
00226         ViewLeave();
00227
00228         view_outline(view);
00229         return TRUE;
00230 }
00231
00232
00233 /*
00234  * return a handle to the complist owned by this view
00235  */
00236 COMPLIST
00237 view_getcomplist(VIEW view)
00238 {
00239         if (view == NULL) {
00240                 return(NULL);
00241         }
00242
00243         return(view->cl);
00244 }
00245
00246
00247 /*
00248  * close a view. notify the table window that this view should be
00249  * closed. When the table window has finished with it, it will send
00250  * a TQ_CLOSE notify that should result in view_delete being called
00251  * and the memory being freed.
00252  */
00253 void
00254 view_close(VIEW view)
00255 {
00256         if (view == NULL) {
00257                 return;
00258         }
00259
00260         SendMessage(view->hwnd, TM_NEWID, 0, 0);
00261 }
00262
00263
00264 /*
00265  * delete a view and all associated data.
00266  *
00267  * This function should only be called in response to the table window
00268  * sending a TQ_CLOSE message. To close the view, call view_close and
00269  * wait for the TQ_CLOSE before calling this.
00270  *
00271  * We delete the associated COMPLIST and all its associated structures.
00272  */
00273 void
00274 view_delete(VIEW view)
00275 {
00276         if (view == NULL) {
00277                 return;
00278         }
00279
00280         /* we have two arrays that are used for the mapping - an array
00281          * of compitem handles in outline mode, and an array of
00282          * VIEWLINE structures in expand mode
00283          */
00284
00285         view_freemappings(view);
00286
00287         complist_delete(view->cl);
00288
00289         HeapFree(GetProcessHeap(), NULL, view);
00290 }
00291
00292
00293 /*
00294  * view_outline
00295  *
00296  * build an outline mode mapping where one row represents one COMPITEM in
00297  * the list. check the global option flag outline_include to see which items
00298  * we should include.
00299  *
00300  * If we were in expand mode, then set as the selection the row in outline mode
00301  * that we were expanding. Also remember to free up the expand mode mapping
00302  * array
00303  *
00304  * once we have built the new mapping, notify the table window to
00305  * redraw itself.
00306  */
00307 void
00308 view_outline(VIEW view)
00309 {
00310         if (view == NULL) {
00311                 return;
00312         }
00313
00314         /* all work done by view_outline_opt - this function
00315          * gives us the option of not updating the display
00316          */
00317         view_outline_opt(view, TRUE, NULL, NULL);
00318 }
00319
00320
00321
00322 /*
00323  * switch to expand mode, expanding the given row into a view
00324  * of the differences in that file.
00325  *
00326  * map the given row nr into a compitem handle, and then
00327  * call the internal function with that.
00328  *
00329  * It is legal (and a no-op) if this function is called with
00330  * row==-1.
00331  */
00332 BOOL
00333 view_expand(VIEW view, long row)
00334 {
00335         COMPITEM ci;
00336         BOOL bRet;
00337
00338    if (row<0) return FALSE;
00339
00340         ViewEnter();
00341
00342         if ((view == NULL) || (view->bExpand)) {
00343                 /* no view, or already expanded */
00344                 ViewLeave();
00345                 return(FALSE);
00346         }
00347
00348         if (row >= view->rows) {
00349                 /* no such row */
00350                 ViewLeave();
00351                 return FALSE;
00352         }
00353
00354         /* remember the compitem we are expanding */
00355         ci = view->pItems[row];
00356
00357         bRet = view_expand_item(view, ci);
00358         return(bRet);
00359 }
00360
00361
00362 /*
00363  * return the text associated with a given column of a given row.
00364  * Return a pointer that does not need to be freed after use - ie
00365  * a pointer into our data somewhere, not a copy
00366  */
00367 LPSTR
00368 view_gettext(VIEW view, long row, int col)
00369 {
00370         int line;
00371         int state;
00372         LPSTR pstr;
00373     HRESULT hr;
00374
00375         pstr = NULL;   /* kill spurious diagnostic */
00376         if (view == NULL) {
00377                 return (NULL);
00378         }
00379
00380         ViewEnter();
00381
00382         if (row >= view->rows) {
00383                 ViewLeave();
00384                 return(NULL);
00385         }
00386
00387         if (view->bExpand) {
00388                 /* we are in expand mode */
00389
00390                 state = section_getstate(view->pLines[row].section);
00391
00392                 switch(col) {
00393                 case 0:
00394                         /* row nr */
00395
00396                         /* line numbers can be from either original file
00397                          * this is a menu-selectable option
00398                          */
00399                         line = 0;
00400                         switch(line_numbers) {
00401                         case IDM_NONRS:
00402                                 pstr = NULL;
00403                                 break;
00404
00405                         case IDM_LNRS:
00406                                 line = view->pLines[row].nr_left;
00407                                 if (state == STATE_MOVEDRIGHT
00408                                     || state == STATE_SIMILARRIGHT) {
00409                                         line = -line;
00410                                 }
00411                                 break;
00412
00413                         case IDM_RNRS:
00414                                 line = view->pLines[row].nr_right;
00415                                 if (state == STATE_MOVEDLEFT
00416                                     || state == STATE_SIMILARLEFT) {
00417                                         line = -line;
00418                                 }
00419                                 break;
00420                         }
00421                         if (line == 0) {
00422                                 ViewLeave();
00423                                 return(NULL);
00424                         }
00425
00426                         if (line < 0) {
00427                                 /* lines that are moved appear twice.
00428                                  * show the correct-sequence line nr
00429                                  * for the out-of-seq. copy in brackets.
00430                                  */
00431                                 hr = StringCchPrintf(view->nrtext, 12, "(%d)", abs(line));
00432                 if (FAILED(hr)) {
00433                   OutputError(hr, IDS_SAFE_PRINTF);
00434                   return(NULL);
00435                 }
00436
00437                         } else  {
00438                                 hr = StringCchPrintf(view->nrtext, 12, "%d", line);
00439                 if (FAILED(hr)) {
00440                   OutputError(hr, IDS_SAFE_PRINTF);
00441                   return(NULL);
00442                 }
00443                         }
00444                         pstr = view->nrtext;
00445                         break;
00446
00447                 case 1:
00448                         /* tag text - represents the state of the line */
00449
00450
00451                         switch(state) {
00452                         case STATE_SAME:
00453                                 pstr = "    ";
00454                                 break;
00455
00456                         case STATE_LEFTONLY:
00457                         case STATE_SIMILARLEFT:
00458                                 pstr = " <! ";
00459                                 break;
00460
00461                         case STATE_RIGHTONLY:
00462                         case STATE_SIMILARRIGHT:
00463                                 pstr = " !> ";
00464                                 break;
00465
00466                         case STATE_MOVEDLEFT:
00467                                 pstr = " <- ";
00468                                 break;
00469
00470                         case STATE_MOVEDRIGHT:
00471                                 pstr = " -> ";
00472                                 break;
00473                         }
00474                         break;
00475
00476                 case 2:
00477                         /* main text - line */
00478                         pstr = line_gettext(view->pLines[row].line);
00479                         break;
00480                 }
00481         } else {
00482                 /* outline mode */
00483                 switch(col) {
00484                 case 0:
00485                         /* row number - just the line number */
00486                         hr = StringCchPrintf(view->nrtext, 12, "%d", row+1);
00487             if (FAILED(hr)) {
00488               OutputError(hr, IDS_SAFE_PRINTF);
00489               return(NULL);
00490             }
00491                         pstr = view->nrtext;
00492                         break;
00493
00494                 case 1:
00495                         /* tag */
00496                         pstr = compitem_gettext_tag(view->pItems[row]);
00497                         break;
00498
00499                 case 2:
00500                         /* result text */
00501                         pstr = compitem_gettext_result(view->pItems[row]);
00502                         break;
00503                 }
00504         }
00505         ViewLeave();
00506         return(pstr);
00507 }
00508
00509
00510 /*
00511  * return the text associated with a given column of a given row.
00512  * Return a pointer that does not need to be freed after use - ie
00513  * a pointer into our data somewhere, not a copy
00514  */
00515 LPWSTR
00516 view_gettextW(VIEW view, long row, int col)
00517 {
00518         int state;
00519         LPWSTR pwz;
00520
00521         pwz = NULL;   /* kill spurious diagnostic */
00522         if (view == NULL) {
00523                 return (NULL);
00524         }
00525
00526         ViewEnter();
00527
00528         if (row >= view->rows) {
00529                 ViewLeave();
00530                 return(NULL);
00531         }
00532
00533         if (view->bExpand) {
00534                 /* we are in expand mode */
00535
00536                 state = section_getstate(view->pLines[row].section);
00537
00538                 switch(col) {
00539                 case 2:
00540                         /* main text - line */
00541                         pwz = line_gettextW(view->pLines[row].line);
00542                         break;
00543                 }
00544         }
00545         ViewLeave();
00546         return(pwz);
00547 }
00548
00549 /*
00550  * return the line number that this row had in the original left
00551  * file. 0 if not in expand mode. 0 if this row was not in the left file.
00552  * -(linenr) if this row is a MOVED line, and this is the right file
00553  * copy
00554  */
00555 int
00556 view_getlinenr_left(VIEW view, long row)
00557 {
00558         int state, line;
00559
00560         if ((view == NULL) || (row >= view->rows) || !view->bExpand) {
00561                 return 0;
00562         }
00563
00564         ViewEnter();
00565         state = section_getstate(view->pLines[row].section);
00566         line = view->pLines[row].nr_left;
00567         if (state == STATE_MOVEDRIGHT || state == STATE_SIMILARRIGHT) {
00568                 line = -line;
00569         }
00570         ViewLeave();
00571
00572         return(line);
00573 }
00574
00575 /*
00576  * return the line number that this row had in the original right
00577  * file. 0 if not in expand mode. 0 if this row was not in the right file.
00578  * -(linenr) if this row is a MOVED line, and this is the left file
00579  * copy
00580  */
00581 int
00582 view_getlinenr_right(VIEW view, long row)
00583 {
00584         int state, line;
00585
00586         if ((view == NULL) || (row > view->rows) || !view->bExpand) {
00587                 return 0;
00588         }
00589
00590         ViewEnter();
00591
00592         state = section_getstate(view->pLines[row].section);
00593         line = view->pLines[row].nr_right;
00594         if (state == STATE_MOVEDLEFT || state == STATE_SIMILARLEFT) {
00595                 line = -line;
00596         }
00597         ViewLeave();
00598
00599         return(line);
00600 }
00601
00602
00603
00604 /* find the maximum width in characters for the given column */
00605 int
00606 view_getwidth(VIEW view, int col)
00607 {
00608         if (view == NULL) {
00609                 return(0);
00610         }
00611
00612         switch(col) {
00613         case 0:
00614                 /* line nr column - always 5 characters wide */
00615                 return(5);
00616
00617         case 1:
00618                 /* this is a proportional font field, so add on a margin
00619                  * for error
00620                  */
00621                 return(view->maxtag + (view->maxtag / 20));
00622         case 2:
00623                 /* this now includes the tab expansion allowance */
00624                 return(view->maxrest);
00625         default:
00626                 return(0);
00627         }
00628 }
00629
00630 /* how many rows are there in this view ? */
00631 long
00632 view_getrowcount(VIEW view)
00633 {
00634         if (view == NULL) {
00635                 return(0);
00636         }
00637
00638         return(view->rows);
00639 }
00640
00641 /* return the state for the current row. This is used
00642  * to select the text colour for the row
00643  *
00644  * states for sections are obtained from section_getstate (and apply, and
00645  * to all lines in that section. States for compitems are obtained
00646  * from compitem_getstate.
00647  */
00648 int
00649 view_getstate(VIEW view, long row)
00650 {
00651         int state;
00652
00653         if (view == NULL) {
00654                 return(0);
00655         }
00656
00657         ViewEnter();
00658         if (row >= view->rows) {
00659                 state = 0;
00660         } else if (view->bExpand) {
00661                 /* its a line state that's needed */
00662                 state = section_getstate(view->pLines[row].section);
00663         } else {
00664
00665                 /* its a compitem state */
00666                 state = compitem_getstate(view->pItems[row]);
00667         }
00668         ViewLeave();
00669         return(state);
00670 }
00671
00672 /*
00673  * return the marked state for a given row. Only compitems can be marked,
00674  * so it will be FALSE unless it is a compitem on which view_setmark or
00675  * compitem_setmark have previously set the mark state to TRUE.
00676  */
00677 BOOL
00678 view_getmarkstate(VIEW view, long row)
00679 {
00680     BOOL bMark = FALSE;
00681
00682     if (view != NULL) {
00683    ViewEnter();
00684    if ( (row < view->rows) && (!view->bExpand)) {
00685        bMark = compitem_getmark(view->pItems[row]);
00686    }
00687    ViewLeave();
00688     }
00689     return(bMark);
00690 }
00691
00692 /*
00693  * set the mark state for a given row. This is only possible for compitem rows.
00694  * The mark set can be retrieved by view_getmarkstate or compitem_getmark.
00695  *
00696  * We return FALSE if the state could not be set - eg because the
00697  * row to set is not a compitem row.
00698  */
00699 BOOL
00700 view_setmarkstate(VIEW view, long row, BOOL bMark)
00701 {
00702     BOOL bOK = FALSE;
00703
00704     if (view != NULL) {
00705    ViewEnter();
00706    if ( (row < view->rows) && !view->bExpand) {
00707        compitem_setmark(view->pItems[row], bMark);
00708        bOK = TRUE;
00709    }
00710    ViewLeave();
00711     }
00712     return (bOK);
00713 }
00714
00715
00716 /* return a handle to the current compitem. in expand mode,
00717  * returns the handle to the compitem we are expanding. In outline
00718  * mode, returns the handle to the compitem for the given row, if valid,
00719  * or NULL otherwise. row is only used if not in expand mode.
00720  */
00721 COMPITEM
00722 view_getitem(VIEW view, long row)
00723 {
00724         COMPITEM ci;
00725
00726         if (view == NULL) {
00727                 return(NULL);
00728         }
00729
00730         ViewEnter();
00731
00732         if (!view->bExpand) {
00733                 if ((row >= 0) && (row < view->rows)) {
00734                         ci = view->pItems[row];
00735                 } else {
00736                         ci = NULL;
00737                 }
00738         } else {
00739                 ci = view->ciSelect;
00740         }
00741
00742         ViewLeave();
00743         return(ci);
00744 }
00745
00746 /*
00747  * return TRUE if the current mapping is expanded mode
00748  */
00749 BOOL
00750 view_isexpanded(VIEW view)
00751 {
00752         if (view == NULL) {
00753                 return(FALSE);
00754         }
00755         return(view->bExpand);
00756 }
00757
00758
00759 /*
00760  * return a text string describing the view. This is NULL in outline mode,
00761  * or the tag text for the current compitem in expanded mode
00762  */
00763 LPSTR
00764 view_getcurrenttag(VIEW view)
00765 {
00766         LPSTR str;
00767
00768         if ((view == NULL) || (!view->bExpand)) {
00769                 return(NULL);
00770         } else {
00771                 ViewEnter();
00772
00773                 str = compitem_gettext_tag(view->ciSelect);
00774
00775                 ViewLeave();
00776                 return(str);
00777
00778         }
00779 }
00780
00781
00782 /* notify that CompItems have been added to the complist.
00783  *
00784  * rebuild the view (if in outline mode), and refresh the table. Use
00785  * the table message TM_APPEND if possible (if column widths have not
00786  * change). If we have to do TM_NEWLAYOUT, then ensure we scroll
00787  * back to the right row afterwards.
00788  *
00789  * This causes a Poll() to take place. We return TRUE if an abort is
00790  * pending - in this case, the caller should abandon the scan loop.
00791  *
00792  * WIN32: enter the critical section for this function since this can be
00793  * called from the worker thread while the UI thread is using the
00794  * view that we are about to change.
00795  *
00796  * We cannot ever call SendMessage from the
00797  * worker thread within CSView.  If there is conflict, it will hang.
00798  *
00799  */
00800 BOOL
00801 view_newitem(VIEW view)
00802 {
00803         int maxtag, maxrest;
00804         int rownr;
00805         TableSelection Select;
00806         BOOL bSelect;
00807         COMPITEM ciTop = NULL;
00808         BOOL bRedraw = FALSE;
00809         BOOL bAppend = FALSE;
00810
00811         // get the top row before remapping in case we need it
00812         /* find the row at the top of the window */
00813         rownr = (long) SendMessage(view->hwnd, TM_TOPROW, FALSE, 0);
00814         // also remember the selection
00815         bSelect = (BOOL) SendMessage(view->hwnd, TM_GETSELECTION, 0, (LPARAM) &Select);
00816
00817         // *important*:no critsec over SendMessage
00818         ViewEnter();
00819
00820         if ((view != NULL) &&
00821             !(view->bExpand) &&
00822             !(view->bExpanding)) {
00823
00824             /* save some state about the present mapping */
00825             maxtag = view->maxtag;
00826             maxrest = view->maxrest;
00827
00828
00829             // remember the compitem this corresponds to
00830             if (view->pItems && (rownr >= 0) && (rownr < view->rows)) {
00831                 ciTop = view->pItems[rownr];
00832             }
00833
00834
00835             // re-do the outline mapping, but don't tell the table class.
00836             // ask it to check for the visible row closest to ciTop in case
00837             // we need to refresh the display
00838             //
00839             // since we are holding the critsec, the redraw param
00840             // *must* be false.
00841             view_outline_opt(view, FALSE, ciTop, &rownr);
00842
00843             /* have the column widths changed ? */
00844             if ((maxtag < view->maxtag) || (maxrest < view->maxrest)) {
00845                 /* yes - need complete redraw */
00846                 bRedraw = TRUE;
00847             } else {
00848                 bAppend = TRUE;
00849             }
00850         }
00851
00852         ViewLeave();
00853
00854
00855         if (bRedraw) {
00856
00857             /* switch to new mapping */
00858             SendMessage(view->hwnd, TM_NEWLAYOUT, 0, (LPARAM) view);
00859
00860             // go to the visible row closest to the old top row
00861             if ((rownr >= 0) && (rownr < view->rows)) {
00862                 SendMessage(view->hwnd, TM_TOPROW, TRUE, rownr);
00863             }
00864
00865             // select the old selection too (if the table class allowed
00866             // us to get it)
00867             if (bSelect) {
00868                 SendMessage(view->hwnd, TM_SELECT,0, (LPARAM) &Select);
00869             }
00870
00871         } else if (bAppend) {
00872             /* we can just append */
00873
00874             /*
00875              * in the WIN32 multiple threads case, the mapping may have
00876              * changed since we released the critsec. however we are still
00877              * safe. The table will not allow us to reduce the number of
00878              * rows, so the worst that can happen is that the table will
00879              * think there are too many rows, and the table message handler
00880              * will handle this correctly (return null for the text).
00881              * The only visible effect is therefore that the scrollbar
00882              * position is wrong.
00883              */
00884
00885             SendMessage(view->hwnd, TM_APPEND, view->rows, (LPARAM) view);
00886         }
00887
00888         return(Poll());
00889 }
00890
00891 /*
00892  * the view mapping options (eg outline_include, expand_mode) have changed -
00893  * re-do the mapping and then scroll back to the same position in the window
00894  * if possible.
00895  */
00896 void
00897 view_changeviewoptions(VIEW view)
00898 {
00899         long row;
00900         int state, number;
00901         BOOL bRight;
00902
00903         if (view == NULL) {
00904                 return;
00905         }
00906
00907         /* find what row we are currently on. Do this BEFORE we enter CSView */
00908         row = (long) SendMessage(view->hwnd, TM_TOPROW, FALSE, 0);
00909
00910         ViewEnter();
00911
00912         if (!view->bExpand) {
00913
00914
00915             // view_outline_opt allows us to find the first visible row
00916             // after a given COMPITEM. Do this to look for the old top-row
00917             // compitem, so that even if it is no longer visible, we can
00918             // still go to just after it.
00919
00920             INT newrow = -1;
00921             if (row < view->rows) {
00922
00923                 COMPITEM ciTop = view->pItems[row];
00924
00925                 view_outline_opt(view, TRUE, ciTop, &newrow);
00926             } else {
00927                 view_outline_opt(view, TRUE, NULL, NULL);
00928             }
00929             ViewLeave();
00930
00931             // row now has the visible row that corresponds to
00932             // ciTop or where it would have been
00933             if ((newrow >=0) && (newrow < view->rows)) {
00934                 SendMessage(view->hwnd, TM_TOPROW, TRUE, newrow);
00935             }
00936             return;
00937         }
00938
00939         /* expanded mode */
00940
00941
00942         bRight = FALSE;  /* arbitrarily - avoid strange diagnostic */
00943         /* save the line number on one side (and remember which side) */
00944         if (row >= view->rows) {
00945                 number = -1;
00946         } else {
00947                 state = section_getstate(view->pLines[row].section);
00948                 if ((state == STATE_MOVEDRIGHT) ||
00949                     (state == STATE_RIGHTONLY)) {
00950                             bRight = TRUE;
00951                             number = view->pLines[row].nr_right;
00952                 } else {
00953                         bRight = FALSE;
00954                         number = view->pLines[row].nr_left;
00955                 }
00956         }
00957
00958         /* make the new mapping */
00959         view_expand_item(view, view->ciSelect);
00960
00961         /* things may happen now due to simultaneous scrolling from
00962          * two threads.  At least we won't deadlock.
00963          */
00964         /* find the nearest row in the new view */
00965         if (number >= 0) {
00966
00967                 ViewEnter();
00968                 row = view_findrow(view, number, bRight);
00969                 ViewLeave();
00970
00971                 /* scroll this row to top of window */
00972                 if (row >= 0) {
00973
00974                         /* things may happen now due to simultaneous scrolling from
00975                          * two threads.  At least we won't deadlock.
00976                          */
00977                         SendMessage(view->hwnd, TM_TOPROW, TRUE, row);
00978                         return;
00979                 }
00980         }
00981 }
00982
00983 /* the compare options have changed - re-do the compare completely
00984  * and make the new mapping. Retain current position in the file.
00985  */
00986 void
00987 view_changediffoptions(VIEW view)
00988 {
00989         int state, number;
00990         long row;
00991         BOOL bRight = FALSE;
00992         LIST li;
00993         COMPITEM ci;
00994
00995         number = 0;
00996         if (view == NULL) {
00997                 return;
00998         }
00999
01000         /*
01001          * get current row before entering critsec.
01002          */
01003         row = (long) SendMessage(view->hwnd, TM_TOPROW, FALSE, 0);
01004
01005         ViewEnter();
01006
01007         /* find the current line number so we can go back to it
01008          * (only if we are in expanded mode
01009          */
01010         if (view->bExpand) {
01011
01012                 state = section_getstate(view->pLines[row].section);
01013                 if ((state == STATE_MOVEDRIGHT) ||
01014                     (state == STATE_SIMILARRIGHT) ||
01015                     (state == STATE_RIGHTONLY)) {
01016                             bRight = TRUE;
01017                             number = view->pLines[row].nr_right;
01018                 } else {
01019                         bRight = FALSE;
01020                         number = view->pLines[row].nr_left;
01021                 }
01022         }
01023
01024         /* to force a recompare using the new options, we must
01025          * tell each compitem to discard its current compare result.
01026          * we need to traverse the list of compitems calling this
01027          * for each compare.
01028          */
01029         li = complist_getitems(view->cl);
01030
01031         for (ci = (COMPITEM) List_First(li); ci != NULL; ci = (COMPITEM) List_Next(ci)) {
01032                 compitem_discardsections(ci);
01033         }
01034
01035         if (!view->bExpand) {
01036                 ViewLeave();
01037
01038                 // we are in outline mode. Refreshing the outline view
01039                 // will pick up any tag and tag width changes
01040                 view_outline(view);
01041
01042                 // now scroll to the previous position if still there
01043                 if (row < view->rows) {
01044                     SendMessage(view->hwnd, TM_TOPROW, TRUE, row);
01045                 }
01046
01047                 return;
01048         }
01049
01050         view_expand_item(view, view->ciSelect);
01051
01052         /* find the nearest row in the new view */
01053         ViewEnter();
01054         row = view_findrow(view, number, bRight);
01055         ViewLeave();
01056
01057         /* scroll this row to top of window */
01058         if (row >= 0) {
01059                 SendMessage(view->hwnd, TM_TOPROW, TRUE, row);
01060         }
01061 }
01062
01063
01064 /* find the next changed - ie non-same - row in a given direction.
01065  * for outline mode we find the next STATE_DIFFER. for expand mode, we
01066  * find the next section
01067  */
01068 long
01069 view_findchange(VIEW view, long startrow, BOOL bForward)
01070 {
01071         long i;
01072
01073         if (view == NULL) {
01074                 return(0);
01075         }
01076
01077         if (view->rows <= 0) {
01078             return (-1);
01079         }
01080
01081         ViewEnter();
01082
01083         if (bForward) {
01084
01085                 if (startrow >= view->rows) {
01086                         ViewLeave();
01087                         return(-1);
01088                 }
01089
01090                 if (!view->bExpand) {
01091
01092                         /* look for next compitem with an expandable state*/
01093                         for (i = startrow; i < view->rows; i++) {
01094                                 if (compitem_getstate(view->pItems[i]) == STATE_DIFFER) {
01095                                         ViewLeave();
01096                                         return(i);
01097                                 }
01098                         }
01099                         /* none found */
01100                         ViewLeave();
01101                         return(-1);
01102                 } else {
01103                         /*
01104                          * find the next line that matches, then go on to the
01105                          * next line that does not match
01106                          *
01107                          */
01108                         for (i= startrow; i < view->rows; i++) {
01109                                 if (section_getstate(view->pLines[i].section)
01110                                         == STATE_SAME) {
01111                                                 break;
01112                                 }
01113                         }
01114                         for ( ; i < view->rows; i++) {
01115                                 if (section_getstate(view->pLines[i].section)
01116                                         != STATE_SAME) {
01117                                                 ViewLeave();
01118                                                 return(i);
01119                                 }
01120                         }
01121
01122                         ViewLeave();
01123
01124                         return(-1);
01125                 }
01126         } else {
01127                 /* same search backwards */
01128                 if (startrow < 0) {
01129                         ViewLeave();
01130                         return(-1);
01131                 }
01132                 if (view->bExpand) {
01133                         /* search backwards for first row that is not
01134                          * changed (has state SAME). then carry on for
01135                          * the next changed row.
01136                          */
01137                         for (i = startrow; i >= 0; i--) {
01138                                 if (section_getstate(view->pLines[i].section)
01139                                         == STATE_SAME) {
01140                                                 break;
01141                                 }
01142                         }
01143                         for ( ; i >= 0; i--) {
01144                                 if (section_getstate(view->pLines[i].section)
01145                                         != STATE_SAME) {
01146                                                 ViewLeave();
01147                                                 return(i);
01148                                 }
01149                         }
01150                         ViewLeave();
01151                         return(-1);
01152                 } else {
01153                         for (i = startrow; i >= 0; i--) {
01154                                 if(compitem_getstate(view->pItems[i]) == STATE_DIFFER) {
01155                                         ViewLeave();
01156                                         return(i);
01157                                 }
01158                         }
01159                         ViewLeave();
01160                         return(-1);
01161                 }
01162         }
01163 }
01164
01165
01166 int view_getrowstate(VIEW view, long row)
01167 {
01168         int state;
01169
01170         if (view == NULL) {
01171                 return(0);
01172         }
01173
01174         if (view->rows <= 0 || row >= view->rows) {
01175             return (STATE_SAME);
01176         }
01177
01178         ViewEnter();
01179
01180         state = section_getstate(view->pLines[row].section);
01181
01182         ViewLeave();
01183
01184         return state;
01185 }
01186
01187 /*
01188  * the WIN32 multithread version can try view_expand and view_outline
01189  * (or view_newitem) at the same time. This is not correctly protected by
01190  * the critical section, since there are major restrictions about holding
01191  * critsecs when sending messages from the worker thread.
01192  *
01193  * To avoid contention, we call this function to notify that we are
01194  * starting expanding. view_newitem and ToOutline will return without
01195  * doing anything if this function has been called and view_expand has not
01196  * completed.
01197  */
01198 void
01199 view_expandstart(VIEW view)
01200 {
01201     view->bExpanding = TRUE;
01202 }
01203
01204 // are we in the middle of expansion ?
01205 BOOL
01206 view_expanding(VIEW view)
01207 {
01208     return(view->bExpanding);
01209
01210 }
01211
01212
01213
01214 /* ---- internal functions ------------------------------------------ */
01215
01216
01217 /* find the new row number for the line numbered 'number'
01218  * or the nearest line if possible. if bRight is true, number is
01219  * a right file number; otherwise it is a left file number.
01220  *
01221  * we must be in expand mode
01222  */
01223 int
01224 view_findrow(
01225              VIEW view,
01226              int number,
01227              BOOL bRight
01228              )
01229 {
01230         int i;
01231
01232         if (!view->bExpand) {
01233                 return(0);
01234         }
01235
01236         for (i = 0; i < view->rows; i++) {
01237
01238                 if (bRight) {
01239                         if (view->pLines[i].nr_right == number) {
01240
01241                                 /* found the exact number */
01242                                 return(i);
01243
01244                         } else if (view->pLines[i].nr_right > number) {
01245
01246                                 /* passed our line -stop here */
01247                                 return(i);
01248                         }
01249                 } else {
01250                         if (view->pLines[i].nr_left == number) {
01251
01252                                 /* found the exact number */
01253                                 return(i);
01254
01255                         } else if (view->pLines[i].nr_left > number) {
01256
01257                                 /* passed our line -stop here */
01258                                 return(i);
01259                         }
01260                 }
01261         }
01262         return(-1);
01263 }
01264
01265 /* free memory associated with the expand mode or outline mode mappings
01266  * called whenever we rebuild the mapping, and on deletion
01267  */
01268 void
01269 view_freemappings(
01270                   VIEW view
01271                   )
01272 {
01273
01274         if (view->pLines) {
01275
01276       HeapFree(GetProcessHeap(), NULL, view->pLines);
01277             view->pLines = NULL;
01278         } else if (view->pItems) {
01279
01280                 /* previous outline mapping array is still there - free it
01281                  * before we build a new one
01282                  */
01283
01284                 HeapFree(GetProcessHeap(), NULL, view->pItems);
01285                 view->pItems = NULL;
01286         }
01287         view->rows = 0;
01288 }
01289
01290 /* build a view outline to map one row to a COMPITEM handle by traversing
01291  * the list of COMPITEMs obtained from our complist.
01292  * optionally tell the table class to redraw (if bRedraw), and if so,
01293  * scroll the new table to select the row that represents the
01294  * file we were expanding, if possible
01295  *
01296  * *important*: if you are holding the view critsec when you call this, you
01297  * must pass bRedraw as FALSE or you could deadlock
01298  *
01299  * if a COMPITEM ci is passed in, then return in *prow the row number that
01300  * corresponds to this item in the new view, or if not visible, the first
01301  * visible row after it (to retain current scroll position)
01302  */
01303 void
01304 view_outline_opt(
01305                  VIEW view,
01306                  BOOL bRedraw,
01307                  COMPITEM ciFind,
01308                  int * prow
01309                  )
01310 {
01311         int prev_row = -1;      /* the row nr of the previously-expanded row*/
01312         int i;                  /* nr of includable items */
01313         LIST li;
01314         COMPITEM ci;
01315         int state;
01316         TableSelection select;
01317
01318         /*
01319          * check that view_setcomplist has already been called. if not,
01320          * nothing to do
01321          */
01322         if (view->cl == NULL) {
01323                 return;
01324         }
01325
01326         ViewEnter();
01327
01328         /* clear the mode flag and free up memory associated with expand mode */
01329         view->bExpand = FALSE;
01330         view_freemappings(view);
01331
01332         /* traverse the list of compitems counting up the number of
01333          * includable items
01334          */
01335         li = complist_getitems(view->cl);
01336
01337         ci = (COMPITEM) List_First(li);
01338         for (i = 0; ci != NULL; ci = (COMPITEM) List_Next(ci)) {
01339
01340                 if ((ciFind != NULL) && (prow != NULL)) {
01341                     if (ci == ciFind) {
01342                         // now that we have found the requested item,
01343                         // the next visible row is the one we want,
01344                         // whether it is ci or a later one
01345                         *prow = i;
01346                     }
01347                 }
01348
01349                 state = compitem_getstate(ci);
01350
01351                 if (((outline_include & INCLUDE_SAME) && (state == STATE_SAME)) ||
01352                     ((outline_include & INCLUDE_DIFFER) && (state == STATE_DIFFER)) ||
01353                     ((outline_include & INCLUDE_LEFTONLY) && (state == STATE_FILELEFTONLY)) ||
01354                     ((outline_include & INCLUDE_RIGHTONLY) && (state == STATE_FILERIGHTONLY))) {
01355                     if (!compitem_getmark(ci) || !hide_markedfiles) {
01356                         i++;
01357                     }
01358                 }
01359         }
01360
01361
01362         /* allocate an array big enough for all of these */
01363         { /* DO NOT link in any storage with garbage pointers in it */
01364             COMPITEM FAR * temp;
01365             temp = (COMPITEM FAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, i * sizeof(COMPITEM));
01366             if (temp == NULL)
01367         return;
01368       view->pItems = temp;
01369         }
01370         view->rows = i;
01371
01372         /* keep track of the column widths */
01373         view->maxtag = 0;
01374         view->maxrest = 0;
01375
01376         /* loop through again filling the array, and at the same time looking
01377          * out for the handle of the previously expanded item
01378          */
01379         ci = (COMPITEM) List_First(li);
01380         for (i = 0; ci != NULL; ci = (COMPITEM) List_Next(ci)) {
01381
01382                 state = compitem_getstate(ci);
01383
01384                 if (((outline_include & INCLUDE_SAME) && (state == STATE_SAME)) ||
01385                     ((outline_include & INCLUDE_DIFFER) && (state == STATE_DIFFER)) ||
01386                     ((outline_include & INCLUDE_LEFTONLY) && (state == STATE_FILELEFTONLY)) ||
01387                     ((outline_include & INCLUDE_RIGHTONLY) && (state == STATE_FILERIGHTONLY))) {
01388
01389          if (!compitem_getmark(ci) || !hide_markedfiles) {
01390
01391                             view->pItems[i] = ci;
01392
01393                             if (ci == view->ciSelect) {
01394                                     prev_row = i;
01395                             }
01396
01397                             /* check the column widths in characters */
01398                             view->maxtag = max(view->maxtag,
01399                                                lstrlen(compitem_gettext_tag(ci)));
01400                             view->maxrest = max(view->maxrest,
01401                                                 lstrlen(compitem_gettext_result(ci)));
01402
01403
01404                             i++;
01405          }
01406
01407                 }
01408         }
01409         ViewLeave();
01410
01411         /* inform table of new layout of table - force refresh */
01412         if (bRedraw) {
01413                 SendMessage(view->hwnd, TM_NEWLAYOUT, 0, (LPARAM) view);
01414
01415                 /* scroll to and highlight the row that represents the file
01416                  * we were previously expanding
01417                  */
01418                 if (prev_row != -1) {
01419                         select.startrow = prev_row;
01420                         select.startcell = 0;
01421                         select.nrows = 1;
01422                         select.ncells = 1;
01423                         SendMessage(view->hwnd, TM_SELECT, 0, (LPARAM) &select);
01424                 }
01425         }
01426 }
01427
01428
01429 /* expand a view - given the handle to the compitem to expand.
01430  *
01431  * called from view_expand, and also to re-do an expanded view
01432  * after options change in view_changediffoptions and _changeviewoptions
01433  *
01434  * we get the composite section list from the compitem,
01435  * and pick out all the sections that are includable (according
01436  * to the global option expand_mode: we include all sections, or
01437  * just those in one side left or right). Once we know the count of rows,
01438  * allocate the mapping array: in each element of the array we keep
01439  * a handle to the section for that row (to get the state and hence the
01440  * tag text), and a handle to the line within that section (for the line text).
01441  *
01442  * We no longer insist on only expanding text files that differ - if the
01443  * compitem can give us a composite section list, we will map it.
01444  *
01445  * We need to be able to give a line number for a line, in either of
01446  * the original files according to which option is in force. Each section
01447  * can give us its base line number (number of first line in section) in
01448  * each of the two files or 0 if not present, and we track these here.
01449  *
01450  * MUST BE INSIDE CSView BEFORE CALLING HERE.
01451  */
01452 BOOL
01453 view_expand_item(
01454                  VIEW view,
01455                  COMPITEM ci
01456                  )
01457 {
01458         LIST li;
01459         SECTION sh;
01460         LINE line1, line2;
01461         int i, base_left, base_right, state;
01462
01463         // We could be on a second thread trying to expand while it's
01464         // already going on.  That ain't clever!
01465         if (view->bExpandGuard) {
01466             Trace_Error(NULL, "Expansion in progress.  Please wait.", FALSE);
01467             ViewLeave();
01468             return FALSE;
01469         }
01470
01471         // Ensure that the world knows that we are expanding
01472         // before we leave the critical section.
01473         // This is the only way into getcomposite.
01474         view->bExpandGuard = TRUE;
01475
01476   // the compitem_getcomposite could take a long time
01477   // if the file is large and remote. We need to
01478   // release the critsec during this operation.
01479
01480   ViewLeave();
01481         /* get the composite section list */
01482         li = compitem_getcomposite(ci);
01483         if (li == NULL) {
01484             view->bExpanding = FALSE;
01485             view->bExpandGuard = FALSE;
01486             return FALSE;
01487         }
01488
01489   ViewEnter();
01490
01491         /* remember the compitem we are expanding */
01492         view->ciSelect = ci;
01493
01494         /* switch modes and free the current mapping
01495          *
01496          * NOTE: must do this AFTER the compitem_getcomposite,
01497          * since that can fail: if it fails it could put up a
01498          * message box, and that could cause a queued paint message
01499          * to be processed, which would cause us to use these mappings
01500          * and gpfault if they had been cleared first.
01501          */
01502         view->bExpand = TRUE;
01503         view->bExpanding = FALSE;
01504         view->bExpandGuard = FALSE;
01505         view_freemappings(view);
01506
01507
01508         /* loop through totalling the lines in sections
01509          * that we should include
01510          */
01511         view->rows = 0;
01512         for ( sh = (SECTION) List_First(li); sh != NULL;
01513             sh = (SECTION) List_Next(sh)) {
01514
01515                 state = section_getstate(sh);
01516
01517                 if (expand_mode == IDM_RONLY) {
01518                         if ((state == STATE_LEFTONLY) ||
01519                             (state == STATE_SIMILARLEFT) ||
01520                             (state == STATE_MOVEDLEFT)) {
01521                                     continue;
01522                         }
01523                 } else if (expand_mode == IDM_LONLY) {
01524                         if ((state == STATE_RIGHTONLY) ||
01525                             (state == STATE_SIMILARRIGHT) ||
01526                             (state == STATE_MOVEDRIGHT)) {
01527                                     continue;
01528                         }
01529                 }
01530
01531                 /* include all lines in this section
01532                    if the section meets the include criteria */
01533                 if ( ((state == STATE_SAME)         && (expand_include & INCLUDE_SAME))
01534                   || ((state == STATE_LEFTONLY)     && (expand_include & INCLUDE_LEFTONLY))
01535                   || ((state == STATE_RIGHTONLY)    && (expand_include & INCLUDE_RIGHTONLY))
01536                   || ((state == STATE_MOVEDLEFT)    && (expand_include & INCLUDE_MOVEDLEFT))
01537                   || ((state == STATE_MOVEDRIGHT)   && (expand_include & INCLUDE_MOVEDRIGHT))
01538                   || ((state == STATE_SIMILARLEFT)  && (expand_include & INCLUDE_SIMILARLEFT))
01539                   || ((state == STATE_SIMILARRIGHT) && (expand_include & INCLUDE_SIMILARRIGHT))) {
01540                          view->rows += section_getlinecount(sh);
01541                 }
01542         }
01543 #ifndef WIN32
01544         if ( ((long) view->rows * sizeof(VIEWLINE)) > 65535L) {
01545                 // careful here- putting up a dialog box can
01546                 // cause the view to be redrawn
01547                 view->rows = 0;
01548
01549                 MessageBox(hwndClient,
01550                   "Diff info too large for 16-bit version - truncating",
01551                   "Sdkdiff", MB_ICONSTOP|MB_OK);
01552
01553                 view->rows = (int) (65535L / sizeof(VIEWLINE));
01554         }
01555 #endif
01556
01557         /* allocate the memory for the mapping array */
01558         {    /* DO NOT chain in any storage with garbage pointers in it */
01559             PVIEWLINE temp;
01560       temp = (PVIEWLINE) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, view->rows * sizeof(VIEWLINE));
01561             if (temp == NULL)
01562         return FALSE;
01563       view->pLines = temp;
01564         }
01565
01566         /* loop through the sections again filling in the mapping array */
01567         i = 0;
01568         view->maxtag = 5;
01569         view->maxrest = 0;
01570         for (sh = (SECTION) List_First(li); sh != NULL;
01571             sh = (SECTION) List_Next(sh)) {
01572
01573                 state = section_getstate(sh);
01574
01575                 if (expand_mode == IDM_RONLY) {
01576                         if ((state == STATE_LEFTONLY) ||
01577                             (state == STATE_SIMILARLEFT) ||
01578                             (state == STATE_MOVEDLEFT)) {
01579                                     continue;
01580                         }
01581                 } else if (expand_mode == IDM_LONLY) {
01582                         if ((state == STATE_RIGHTONLY) ||
01583                             (state == STATE_SIMILARRIGHT) ||
01584                             (state == STATE_MOVEDRIGHT)) {
01585                                     continue;
01586                         }
01587                 }
01588
01589                 /* include all lines in this section
01590                    if the section meets the include criteria */
01591                 if ( ((state == STATE_SAME)         && (expand_include & INCLUDE_SAME))
01592                   || ((state == STATE_LEFTONLY)     && (expand_include & INCLUDE_LEFTONLY))
01593                   || ((state == STATE_RIGHTONLY)    && (expand_include & INCLUDE_RIGHTONLY))
01594                   || ((state == STATE_MOVEDLEFT)    && (expand_include & INCLUDE_MOVEDLEFT))
01595                   || ((state == STATE_MOVEDRIGHT)   && (expand_include & INCLUDE_MOVEDRIGHT))
01596                   || ((state == STATE_SIMILARLEFT)  && (expand_include & INCLUDE_SIMILARLEFT))
01597                   || ((state == STATE_SIMILARRIGHT) && (expand_include & INCLUDE_SIMILARRIGHT))) {
01598
01599                         /* find the base line number in each file */
01600                         base_left = section_getleftbasenr(sh);
01601                         base_right = section_getrightbasenr(sh);
01602
01603                         /* add each line in section to the view. section_getfirst()
01604                          * returns us to a handle that is in a list. We can
01605                          * call List_Next and will eventually get to the
01606                          * line returned by section_getlast(). Sections always have
01607                          * at least one line
01608                          */
01609                         line1 = section_getfirstline(sh);
01610                         line2 = section_getlastline(sh);
01611
01612                         for (; line1 != NULL; line1 = (LINE) List_Next(line1)) {
01613
01614                                 view->pLines[i].line = line1;
01615                                 view->pLines[i].section = sh;
01616
01617                                 /* calculate the line number for this line by
01618                                  * incrementing the base nr for this section.
01619                                  * Note SIMILAR_RIGHT (or LEFT) lines DO have
01620                                  * left (or right) numbers, but they are dummies.
01621                                  */
01622
01623                                 view->pLines[i].nr_left = base_left;
01624                                 if (state!=STATE_SIMILARRIGHT && base_left != 0) {
01625                                         base_left++;
01626                                 }
01627
01628                                 view->pLines[i].nr_right = base_right;
01629                                 if (state!=STATE_SIMILARLEFT && base_right != 0) {
01630                                         base_right++;
01631                                 }
01632
01633                                 /* increment index into view */
01634                                 i++;
01635
01636                                 /* check the column widths */
01637                                 view->maxrest = max(view->maxrest,
01638                                                     (line_gettabbedlength(line1, g_tabwidth)));
01639 #ifndef WIN32
01640                                // check for truncation (if VIEWLINE array too large)
01641                                if (i >= view->rows) {
01642                                    break;
01643                                }
01644 #endif
01645
01646                                 /* end of section ? */
01647                                 if (line1 == line2) {
01648                                         break;
01649                                 }
01650                         }
01651 #ifndef WIN32
01652                         // check for truncation (if VIEWLINE array too large)
01653                         if (i >= view->rows) {
01654                             break;
01655                         }
01656 #endif
01657                 }
01658         }
01659
01660         /* We must NOT hold a critical section here as SendMessage may hang */
01661         ViewLeave();
01662
01663         /*inform table window of revised mapping */
01664         SendMessage(view->hwnd, TM_NEWLAYOUT, 0, (LPARAM) view);
01665
01666         return(TRUE);
01667 }
01668
01669
01670 /*
01671  *  view_gethwnd
01672  *
01673  */
01674 HWND
01675 view_gethwnd(VIEW view)
01676 {
01677   return (view) ? view->hwnd : NULL;
01678 }
01679
01680
01681 /*
01682  *  view_gototableline
01683  *
01684  */
01685 void
01686 view_gototableline(VIEW view, LONG iLine)
01687 {
01688   if (view)
01689     {
01690     const LONG cLines = view_getrowcount(view);
01691     if (iLine >= 0 && iLine < cLines)
01692       {
01693       TableSelection select;
01694       memset(&select, 0, sizeof(TableSelection));
01695       select.startrow = iLine;
01696       select.nrows    = 1L;
01697       select.ncells   = 1L;
01698
01699       SendMessage(view_gethwnd(view), TM_SELECT, 0, (LPARAM) &select);
01700       }
01701     }
01702 }
01703
01704
01705 typedef PUCHAR (*STRSUBFUNC)(PUCHAR, PUCHAR, PUCHAR*);
01706 extern PUCHAR My_mbsistr(PUCHAR, PUCHAR, PUCHAR*);
01707 extern PUCHAR My_mbsstr(PUCHAR, PUCHAR, PUCHAR*);
01708
01709 BOOL
01710 view_findstring(VIEW view, LONG iCol, LPCSTR pszFind, BOOL fSearchDown, BOOL fMatchCase, BOOL fWholeWord)
01711 {
01712   const LONG cRows = view_getrowcount(view);
01713   BOOL fFound = FALSE;
01714
01715   if (cRows > 0)
01716     {
01717     STRSUBFUNC pfnSub = (fMatchCase) ? My_mbsstr : My_mbsistr;
01718     const char *pszRow = NULL;
01719     const char *pszFound = NULL;
01720     char *pszEnd = NULL;
01721     LONG iEnd    = 0;
01722     LONG iRow    = 0;
01723     LONG nStep   = 0;
01724     LONG iWrapAt = 0;
01725     LONG iWrapTo = 0;
01726
01727     if (fSearchDown)
01728       {
01729       nStep = 1;
01730       iRow = selection + selection_nrows - 1;
01731       iWrapAt = cRows;
01732       iWrapTo = 0;
01733       }
01734     else
01735       {
01736       nStep = -1;
01737       iRow = selection;
01738       iWrapAt = -1;
01739       iWrapTo = cRows - 1;
01740       }
01741
01742     iRow += nStep;
01743     if (iRow < 0 || iRow >= cRows)
01744       iRow = iWrapTo;
01745
01746     iEnd = iRow;
01747
01748     for (;;)
01749       {
01750       pszRow = view_gettext(view, iRow, iCol);
01751       if (pszRow)
01752         {
01753         pszEnd = NULL;
01754         pszFound = (const char*)pfnSub((PUCHAR)pszRow, (PUCHAR)pszFind, (PUCHAR*)&pszEnd);
01755         if (pszFound)
01756           {
01757           if (!fWholeWord)
01758             {
01759             fFound = TRUE;
01760             }
01761           else
01762             {
01763             /* check end of string */
01764             if (!pszEnd || !*pszEnd || (!IsDBCSLeadByte(*pszEnd) && !isalpha(*pszEnd) && !isdigit(*pszEnd)))
01765               {
01766               /* check beginning of string */
01767               if (pszFound == pszRow)
01768                 {
01769                 fFound = TRUE;
01770                 }
01771               else
01772                 {
01773                 const char *pchT = CharPrev(pszRow, pszFound);
01774                 if (!pchT || !*pchT || (!IsDBCSLeadByte(*pchT) && !isalpha(*pchT) && !isdigit(*pchT)))
01775                   {
01776                   fFound = TRUE;
01777                   }
01778                 }
01779               }
01780             }
01781
01782           if (fFound)
01783             {
01784             view_gototableline(view, iRow);
01785             break;
01786             }
01787           }
01788         }
01789
01790       iRow += nStep;
01791       if (iRow == iWrapAt)
01792         iRow = iWrapTo;
01793
01794       if (iRow == iEnd)
01795         break;
01796       }
01797     }
01798
01799   return fFound;
01800 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFilesTest/StdAfx.Cpp Source File

  • Com
  • Services
  • Crm
  • CrmFilesTest

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/OleImp/OleImp.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • OleImp

OleImp.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 // ===========================================================================
00020 //  The OLEIMP sample demonstrates a method for emulating auto impersonation
00021 // of clients. Normally, objects created on the server will run in the
00022 // context of the server.  An object method must explicitly impersonate the
00023 // client if the method is to run in the context of the client.  This
00024 // sample demonstrates a way to arrange for methods to "automatically" run
00025 // in the context of the client.
00026 //
00027 // This program is based on the oleapt sample.  It uses a set of apartment
00028 // threads that each potentially impersonate a client. All objects created
00029 // for a user run in the same apartment.  The security for the server
00030 // is explicitly set up to allow the world call access.  Launch permission
00031 // will still need to be set using the DCOMCNFG.EXE utility if you want
00032 // other than the default launch permission.
00033 //
00034 // The server registers a class-factory on the main application thread and
00035 // also spawns several worker threads. When requests arrive from clients
00036 // to create instances of the class, the server class-factory picks a
00037 // worker thread for the object in the following manner:
00038 //
00039 //   - If there is a thread currently impersonating that user, use that
00040 //     thread.
00041 //   - Otherwise, if there is a free thread, set that thread up to
00042 //     impersonate the client and use that thread.
00043 //   - Otherwise fail the CreateInstance call.
00044 //
00045 // The server then goes through the process of having the object created
00046 // within the thread and properly marshalled from the worker thread
00047 // back to the class factory where it can be returned to the caller. Note
00048 // that this marshalling to the main thread is fairly transient, it lasts
00049 // for creation only: subsequent calls from the client to the object go
00050 // straight from the client's process into the worker apartment.
00051 //
00052 // To register this server run OLEIMP.EXE with the -AutoRegister command
00053 // line switch.  OLEIMP.EXE registers itself to run as the interactive
00054 // user.  For more information about the activation options for DCOM
00055 // applications see the DCOM document on the Win32 SDK CD in the
00056 // \doc\spec\ole directory.
00057 //
00058 // This sample may be compiled as either UNICODE or ANSI.
00059 //
00060 // ===========================================================================
00061
00062 // %%Includes: ---------------------------------------------------------------
00063 #define INC_OLE2
00064 #define STRICT
00065 #include <windows.h>
00066 #include <initguid.h>
00067 #include <stdio.h>
00068 #include <string.h>
00069 #include <tchar.h>
00070 #include "util.h"
00071
00072 // %%Constants: --------------------------------------------------------------
00073 #define cServerThreads  5
00074 #define szWindowClass   TEXT("OLEIMP_CLASS")
00075 #define szTitleServer   TEXT("SERVER: OLE Apartment Impersonation Sample")
00076 #define szCloseQuery    TEXT("Client references still exist. Are you sure you want to close?")
00077 #define COINIT_APARTMENTTHREADED    2
00078 #define MAX_USER_NAME 50
00079 const LARGE_INTEGER     bZero = {0,0};
00080
00081 // %%Guids: ------------------------------------------------------------------
00082 DEFINE_GUID(CLSID_CObject, 0x35b79d1, 0xd6d3, 0x11cf, 0xb9, 0xd4, 0x0, 0xaa, 0x0, 0xa2, 0x16, 0xe0);
00083
00084 // %%Classes: ----------------------------------------------------------------
00085 // the class-factory object exists in the main application apartment/thread
00086 // and is used to create instances of the worker objects on worker threads.
00087 class CClassFactory : public IClassFactory
00088     {
00089   // IClassFactory
00090     STDMETHODIMP            QueryInterface(REFIID iid, void **ppv);
00091     STDMETHODIMP_(ULONG)    AddRef(void)    { return mcRef++; }
00092     STDMETHODIMP_(ULONG)    Release(void)   { if (--mcRef == 0) { delete this; return 0; } return mcRef; }
00093     STDMETHODIMP            CreateInstance(LPUNKNOWN punkOuter, REFIID iid, LPVOID FAR *ppv);
00094     STDMETHODIMP            LockServer(BOOL fLock);
00095
00096   // data members
00097     ULONG   mcRef;
00098
00099   // constructors/destructors
00100   public:
00101     CClassFactory() { mcRef = 1; }
00102     };
00103
00104 // this worker object is simple: it simply supports IUnknown. more interesting
00105 // interfaces can be readily added here and implemented for the worker.
00106 class CObject : public IUnknown
00107     {
00108   // IUnknown
00109     STDMETHODIMP            QueryInterface(REFIID iid, void **ppv);
00110     STDMETHODIMP_(ULONG)    AddRef(void)    { return mcRef++; }
00111     STDMETHODIMP_(ULONG)    Release(void);
00112
00113   // data members
00114     ULONG   mcRef;
00115
00116   // constructors/destructors
00117   public:
00118     CObject() { mcRef = 1; }
00119     };
00120
00121 // %%Globals: ----------------------------------------------------------------
00122 BOOL        vfServer;                       // is this instance a server or client?
00123 HANDLE      vrghThread[cServerThreads];     // worker thread handles
00124 DWORD       vrgtid[cServerThreads];         // worker thread id's
00125 HANDLE      vrghEvent[cServerThreads];      // creation event for each worker
00126 INT         vrgcObjects[cServerThreads];    // # of objects created on each thread
00127 PSID    vrgpSid[cServerThreads];    // SID of user in each apt.
00128 LPTSTR    vrgpszAptUser[cServerThreads];  // name of each apt. user
00129 HANDLE      vhEventServer;                  // creation-complete event for class-factory
00130 CClassFactory   vclassfactory;
00131 HWND        vhwndMain;
00132 LPSTREAM    vpstmMarshalling;               // scratch stream used for cross-apt marshalling
00133 HRESULT     vhrThreadStatus;                // signals status to class-factory
00134
00135 // %%Prototypes: -------------------------------------------------------------
00136 LRESULT CALLBACK    MainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
00137 LRESULT             ServerThreadProc(LPARAM lParam);
00138 BOOL                FAutoRegister(HINSTANCE hinst);
00139 BOOL        FindSlot(PSID psid, int *piThread);
00140
00141 // ---------------------------------------------------------------------------
00142 // %%Function: MainWndProc
00143 // ---------------------------------------------------------------------------
00144  LRESULT CALLBACK
00145 MainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
00146 {
00147     LRESULT lresult = TRUE;
00148   int i;
00149
00150     switch (message)
00151         {
00152         case WM_PAINT:
00153             {
00154             HDC hdc;
00155             PAINTSTRUCT ps;
00156             int i;
00157
00158             if ((hdc = BeginPaint(hwnd, &ps)) != NULL)
00159                 {
00160                 for (i=0; i<cServerThreads; i++)
00161                     {
00162                     TCHAR    rgch[200];
00163
00164           // if a thread which is impersonating a user no
00165           // longer has any objects, free up the resources
00166           // and stop impersonating
00167           if (0 == vrgcObjects[i] && NULL != vrgpSid[i])
00168             {
00169               UtilFreeMem(vrgpszAptUser[i]);
00170               vrgpszAptUser[i] = NULL;
00171               UtilFreeMem(vrgpSid[i]);
00172               vrgpSid[i] = NULL;
00173               SetThreadToken (&vrghThread[i], NULL);
00174             }
00175
00176                     wsprintf(rgch, TEXT("Thread #%d (%s): %d objects"),
00177                           i,
00178                           (NULL == vrgpszAptUser[i])?
00179                             TEXT("No User") :
00180                             vrgpszAptUser[i],
00181                           vrgcObjects[i]);
00182                     TextOut(hdc, 20, 10+(i*25), rgch, lstrlen(rgch));
00183                     }
00184                 }
00185             EndPaint(hwnd, &ps);
00186             }
00187             break;
00188
00189
00190         case WM_DESTROY:
00191             PostQuitMessage(0);
00192             break;
00193
00194         case WM_CLOSE:
00195             // check for clients and prompt in the UI.
00196             for (i=0; i<cServerThreads; i++)
00197                 {
00198                 if (vrgcObjects[i] > 0)
00199                     {
00200                     if (MessageBox(hwnd, szCloseQuery,
00201                             szTitleServer, MB_YESNO) == IDNO)
00202                         return FALSE;
00203                     else
00204                         break;
00205                     }
00206                 }
00207
00208         default:
00209             return DefWindowProc(hwnd, message, wParam, lParam);
00210         }
00211
00212     return lresult;
00213 }  // MainWndProc
00214
00215 // ---------------------------------------------------------------------------
00216 // %%Function: WinMain
00217 //  Initialization and main message-pump
00218 // ---------------------------------------------------------------------------
00219  int PASCAL
00220 WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR szCmdLine, int nCmdShow)
00221 {
00222    UNREFERENCED_PARAMETER(hinstPrev);
00223     WNDCLASS wndclass;
00224     HRESULT hr;
00225     int     i;
00226     DWORD   dwRegister = 0;
00227     MSG     msg;
00228   PSECURITY_DESCRIPTOR psd = NULL;
00229
00230     // parse the command-line
00231     if (szCmdLine)
00232         {
00233         LPSTR   sz = strtok(szCmdLine, " \t");
00234
00235     if (sz)
00236       {
00237       if (!strcmpi(sz, "-AutoRegister"))
00238         {
00239           if (!FAutoRegister(hinst))
00240               {
00241               hr = GetLastError();
00242               goto LCleanup;
00243               }
00244         else
00245           {
00246           MessageBox (GetDesktopWindow(),
00247             TEXT("Registered Successfully!"),
00248             szTitleServer, MB_OK);
00249           return S_OK;
00250           }
00251         }
00252       else
00253         vfServer = TRUE;
00254       }
00255         }
00256
00257     // initialize COM
00258     hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00259     if (FAILED(hr))
00260         {
00261         ErrorMessage(NULL, TEXT("CoInitializeEx"), hr);
00262         return hr;
00263         }
00264
00265   // psd must remain valid until after we uninit COM
00266   if (!CreateAppSecurityDescriptor(&psd))
00267     {
00268     return E_FAIL;
00269     }
00270
00271   // initialize the security layer
00272   hr = CoInitializeSecurity (
00273           psd,
00274           -1,
00275           NULL,
00276           NULL,
00277           RPC_C_AUTHN_LEVEL_CONNECT,
00278           RPC_C_IMP_LEVEL_IMPERSONATE,
00279           NULL,
00280           0,
00281           NULL);
00282     if (FAILED(hr))
00283         {
00284         ErrorMessage(NULL, TEXT("CoInitializeSecurity"), hr);
00285         return hr;
00286         }
00287
00288     // create the threads and synchronization events
00289     // which the server will need
00290     for (i=0; i<cServerThreads; i++)
00291         {
00292         TCHAR    rgch[32];
00293
00294         // create the thread suspended so its event can be
00295         // created using its thread-id and it will be able to
00296         // use it as soon as it runs
00297         vrghThread[i] = CreateThread(NULL,
00298             0,
00299             (LPTHREAD_START_ROUTINE)&ServerThreadProc,
00300             0,
00301             CREATE_SUSPENDED,
00302             &vrgtid[i]);
00303         if (vrghThread[i] == NULL)
00304             {
00305             hr = GetLastError();
00306             goto LCleanup;
00307             }
00308
00309         // a thread can use its thread-id to OpenEvent this existing
00310         // event at any time. it can also look for its thread-id in
00311         // vrgtid[] to determine its index for use with vrghEvent.
00312         // this event signals to a worker thread to create a new CObject
00313         wsprintf(rgch, TEXT("Thread_%d"), vrgtid[i]);
00314         vrghEvent[i] = CreateEvent(NULL, FALSE, FALSE, rgch);
00315         if (vrghEvent[i] == NULL)
00316             {
00317             hr = GetLastError();
00318             goto LCleanup;
00319             }
00320
00321     // initially no user is associated with a thread
00322     vrgpSid[i] = NULL;
00323     vrgpszAptUser[i] = NULL;
00324
00325         // now that the event is available, let the thread run
00326         ResumeThread(vrghThread[i]);
00327         }
00328
00329     // this signals the status of a worker threads creation after
00330     // receiving its create signal via vrghEvent[i]
00331     vhEventServer = CreateEvent(NULL, FALSE, FALSE, TEXT("Server"));
00332     if (vhEventServer == NULL)
00333         {
00334         hr = GetLastError();
00335         goto LCleanup;
00336         }
00337
00338     // register the class-factory with COM
00339     hr = CoRegisterClassObject(CLSID_CObject,
00340         (IUnknown *)&vclassfactory,
00341         CLSCTX_LOCAL_SERVER,
00342         REGCLS_MULTIPLEUSE,
00343         &dwRegister);
00344     if (FAILED(hr))
00345         goto LCleanup;
00346
00347     // create an IStream to be used for marshalling new objects between
00348     // the worker and the CClassFactory
00349     hr = CreateStreamOnHGlobal(NULL, TRUE, &vpstmMarshalling);
00350     if (FAILED(hr))
00351         goto LCleanup;
00352
00353     // create the server UI
00354     memset(&wndclass, 0, sizeof(wndclass));
00355     wndclass.lpszClassName = szWindowClass;
00356     wndclass.style = CS_HREDRAW | CS_VREDRAW;
00357     wndclass.lpfnWndProc = MainWndProc;
00358     wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
00359     wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
00360     wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
00361     wndclass.hInstance = hinst;
00362
00363     if (!RegisterClass(&wndclass) ||
00364         (vhwndMain = CreateWindow(szWindowClass,
00365             szTitleServer,
00366             WS_OVERLAPPEDWINDOW,
00367             CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
00368             HWND_DESKTOP, NULL, hinst, NULL)) == NULL)
00369         {
00370         hr = GetLastError();
00371         goto LCleanup;
00372         }
00373
00374     ShowWindow(vhwndMain, nCmdShow);
00375
00376     while (GetMessage(&msg, NULL, 0, 0))
00377         {
00378         TranslateMessage(&msg);
00379         DispatchMessage(&msg);
00380         }
00381 #pragma warning(push)
00382 #pragma warning(disable: 4244) // '=' : conversion from 'WPARAM' to 'HRESULT', possible loss of data
00383     hr = static_cast<HRESULT>(msg.wParam);
00384 #pragma warning(pop)
00385
00386 LCleanup:
00387     if (hr != S_OK)
00388         ErrorMessage(NULL, TEXT("CoInitializeEx"), hr);
00389
00390     // we explicitly don't clean up threads and events
00391     if (dwRegister != 0)
00392         CoRevokeClassObject(dwRegister);
00393     if (vpstmMarshalling != NULL)
00394         vpstmMarshalling->Release();
00395
00396     CoUninitialize();
00397
00398   FreeAppSecurityDescriptor (psd);
00399
00400     return hr;
00401 }  // WinMain
00402
00403
00404 // ---------------------------------------------------------------------------
00405 // %%Function: FAutoRegister
00406 //  Registers the CObject class in the registry.
00407 // ---------------------------------------------------------------------------
00408  BOOL
00409 FAutoRegister(HINSTANCE hinst)
00410 {
00411     static const TCHAR szClassDesc[]      = TEXT("Ole Apartment Impersonation Sample");
00412     static const TCHAR szCLSIDEntry[]     = TEXT("CLSID\\{035B79D1-D6D3-11cf-B9D4-00AA00A216E0}");
00413   static const TCHAR szAppIDEntry[]     = TEXT("APPID\\{035B79D1-D6D3-11cf-B9D4-00AA00A216E0}");
00414   static const TCHAR szAppIDString[]      = TEXT("{035B79D1-D6D3-11cf-B9D4-00AA00A216E0}");
00415   static const TCHAR szAppID[]        = TEXT("AppID");
00416   static const TCHAR szLocalServer32[]    = TEXT("LocalServer32");
00417   static const TCHAR szRunAs[]        = TEXT("RunAs");
00418   static const TCHAR szInteractiveUser[]    = TEXT("Interactive User");
00419     TCHAR       szPath[512];
00420   TCHAR   szModuleEntry[512];
00421   LPTSTR    index;
00422     HKEY        hkeyT = NULL;
00423
00424     // install the CLSID key and get the FQP for this executable
00425     if ((RegSetValue(HKEY_CLASSES_ROOT, szCLSIDEntry, REG_SZ, szClassDesc,
00426             lstrlen(szClassDesc)) != ERROR_SUCCESS) ||
00427         (RegCreateKey(HKEY_CLASSES_ROOT, szCLSIDEntry, &hkeyT)
00428             != ERROR_SUCCESS) ||
00429         !GetModuleFileName(hinst, szPath, sizeof(szPath)))
00430         return FALSE;
00431
00432   // install the LocalServer32 value
00433     if (RegSetValue(hkeyT, szLocalServer32, REG_SZ, szPath, lstrlen(szPath))
00434             != ERROR_SUCCESS)
00435         goto LErrExit;
00436
00437   // install a pointer to our App ID
00438     if (RegSetValueEx(hkeyT, szAppID, 0, REG_SZ, (LPBYTE)szAppIDString,
00439         sizeof(szAppIDString)) != ERROR_SUCCESS)
00440         goto LErrExit;
00441
00442     RegCloseKey(hkeyT);
00443
00444   // install the App ID
00445   if ((RegSetValue(HKEY_CLASSES_ROOT, szAppIDEntry, REG_SZ, szClassDesc,
00446       lstrlen(szClassDesc)) != ERROR_SUCCESS) ||
00447     (RegCreateKey(HKEY_CLASSES_ROOT, szAppIDEntry, &hkeyT)
00448       != ERROR_SUCCESS))
00449     goto LErrExit;
00450
00451   // indicate that we should run as the interactive user
00452   if (RegSetValueEx(hkeyT, szRunAs, 0, REG_SZ, (LPBYTE)szInteractiveUser,
00453       sizeof(szInteractiveUser)) != ERROR_SUCCESS)
00454     goto LErrExit;
00455
00456     RegCloseKey(hkeyT);
00457
00458   // get the App ID module entry
00459   index = _tcsrchr (szPath, TEXT('\\'));
00460   if (NULL == index)
00461     index = szPath;
00462   else
00463     index += 1;
00464
00465   _snprintf(szModuleEntry, sizeof(szModuleEntry)/sizeof(TCHAR)-1, "%s%s", TEXT("APPID\\"), index);
00466
00467   // Create the module entry in the APPID tree
00468   if (RegCreateKey(HKEY_CLASSES_ROOT, szModuleEntry, &hkeyT)
00469       != ERROR_SUCCESS)
00470     goto LErrExit;
00471
00472   // associate the App ID with the module
00473   if (RegSetValueEx(hkeyT, szAppID, 0, REG_SZ, (LPBYTE)szAppIDString,
00474       sizeof(szAppIDString)) != ERROR_SUCCESS)
00475     goto LErrExit;
00476
00477     RegCloseKey(hkeyT);
00478
00479     return TRUE;
00480
00481 LErrExit:
00482     RegCloseKey(hkeyT);
00483     return FALSE;
00484 }  // FAutoRegister
00485
00486 // ===========================================================================
00487 //                          C C L A S S F A C T O R Y
00488 // ===========================================================================
00489
00490 // ---------------------------------------------------------------------------
00491 // %%Function: CClassFactory::QueryInterface
00492 //  Returns a new reference of the specified iid-type to a CClassFactory.
00493 // ---------------------------------------------------------------------------
00494  STDMETHODIMP
00495 CClassFactory::QueryInterface(REFIID iid, void **ppv)
00496 {
00497     *ppv = NULL;
00498
00499     if (iid == IID_IClassFactory || iid == IID_IUnknown)
00500         {
00501         *ppv = (IClassFactory *)this;
00502         }
00503     if (*ppv != NULL)
00504         {
00505         AddRef();
00506         return S_OK;
00507         }
00508     return E_NOINTERFACE;
00509 }  // CClassFactory::QueryInterface
00510
00511 // ---------------------------------------------------------------------------
00512 // %%Function: CClassFactory::CreateInstance
00513 //  Creates a new instance of a CObject on a worker thread.
00514 // ---------------------------------------------------------------------------
00515  STDMETHODIMP
00516 CClassFactory::CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv)
00517 {
00518     LPUNKNOWN   punk;
00519     HRESULT     hr;
00520   HANDLE    hToken = NULL, hPrimaryToken = NULL;
00521   PSID    psidUser = NULL;
00522   int     iThread;
00523
00524   // Get the client's token
00525   hr = CoImpersonateClient ();
00526     if (FAILED(hr))
00527       {
00528         ErrorMessage(NULL, TEXT("CoImpersonateClient"), hr);
00529       return hr;
00530     }
00531
00532   if (!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &hToken))
00533     {
00534     hr = GetLastError();
00535     ErrorMessage(NULL, TEXT("OpenThreadToken"), hr);
00536     return hr;
00537     }
00538
00539   CoRevertToSelf ();
00540
00541   __try
00542     {
00543     if (!GetUserSidFromToken (hToken, &psidUser))
00544       {
00545       ErrorMessage(NULL, TEXT("GetUserSidFromToken"), 0);
00546       return(E_FAIL);
00547       }
00548
00549     // find an index for this user
00550     if (!FindSlot(psidUser, &iThread))
00551       return(E_OUTOFMEMORY);  // not enough "resources"
00552
00553     // if this is a previously free slot, set it up
00554     if (NULL == vrgpSid[iThread])
00555       {
00556       // The impersonation token we first get disappears after
00557       // the call completes.  We need to get a more permanent
00558       // token for the worker thread.
00559       if (!DuplicateTokenEx(hToken, TOKEN_ALL_ACCESS, NULL,
00560           SecurityImpersonation, TokenPrimary, &hPrimaryToken))
00561           {
00562         hr = GetLastError ();
00563             ErrorMessage(NULL, TEXT("DuplicateTokenEx"), hr);
00564         return(hr);
00565         }
00566
00567       CloseHandle (hToken);
00568       hToken = NULL;
00569
00570       if (!DuplicateTokenEx(hPrimaryToken, TOKEN_ALL_ACCESS, NULL,
00571           SecurityImpersonation, TokenImpersonation, &hToken))
00572           {
00573         hr = GetLastError ();
00574             ErrorMessage(NULL, TEXT("DuplicateTokenEx"), hr);
00575         return(hr);
00576         }
00577
00578       if (!SetThreadToken (&vrghThread[iThread], hToken))
00579         {
00580         hr = GetLastError ();
00581         ErrorMessage(NULL, TEXT("SetThreadToken"), hr);
00582         return(hr);
00583         }
00584
00585       // store and null out stuff we don't want freed or closed
00586       vrgpSid[iThread] = psidUser;
00587       psidUser = NULL;
00588       }
00589     }
00590   __finally
00591     {
00592     UtilFreeMem(psidUser);
00593     if (NULL != hToken)
00594       CloseHandle (hToken);
00595     if (NULL != hPrimaryToken)
00596       CloseHandle (hPrimaryToken);
00597     }
00598
00599     *ppv = NULL;
00600     if (punkOuter != NULL)
00601         return CLASS_E_NOAGGREGATION;
00602
00603     // trigger the worker thread that we want to create an object
00604     SetEvent(vrghEvent[iThread]);
00605
00606     // now wait for the object to signal its completion
00607     WaitForSingleObject(vhEventServer, INFINITE);
00608
00609     // once the worker thread signals completion, vhrThreadStatus
00610     // lets us know if the creation process was successful, and if
00611     // vpstmMarshalling creates a marshalled interface pointer
00612     if (FAILED(vhrThreadStatus))
00613         return vhrThreadStatus;
00614
00615     // unmarshal an IUnknown from the scratch stream. if unmarshaling
00616     // fails, it takes care of releasing the object inside the marshal-data
00617     hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00618     if (FAILED(hr))
00619         return hr;
00620     hr = CoUnmarshalInterface(vpstmMarshalling, IID_IUnknown, (void **)&punk);
00621     if (FAILED(hr))
00622         return hr;
00623
00624     // get a reference to the interface asked for
00625     hr = punk->QueryInterface(iid, ppv);
00626     punk->Release();
00627
00628     return hr;
00629 }  // CClassFactory::CreateInstance
00630
00631  STDMETHODIMP
00632 CClassFactory::LockServer(BOOL fLock)
00633 {
00634    UNREFERENCED_PARAMETER(fLock);
00635     // there's no need to support this for this sample
00636     return E_FAIL;
00637 }  // CClassFactory::LockServer
00638
00639
00640 // ===========================================================================
00641 //                               C O B J E C T
00642 // ===========================================================================
00643
00644 // ---------------------------------------------------------------------------
00645 // %%Function: ServerThreadProc
00646 //  The worker thread function. Handles messages for objects of its thread/apt
00647 // and creates new objects.
00648 // ---------------------------------------------------------------------------
00649  LRESULT
00650 ServerThreadProc(LPARAM lParam)
00651 {
00652    UNREFERENCED_PARAMETER(lParam);
00653     HRESULT hr;
00654     MSG     msg;
00655     int     iThread;
00656
00657     // figure out which thread this is: it needs its synchronization event
00658     for (iThread=0; iThread<cServerThreads; iThread++)
00659         {
00660         if (vrgtid[iThread] == GetCurrentThreadId())
00661             break;
00662         }
00663     if (iThread==cServerThreads)
00664         return E_UNEXPECTED;
00665
00666     // initialize COM
00667     hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00668     if (FAILED(hr))
00669         {
00670         MessageBeep(0);
00671         return hr;
00672         }
00673
00674     // apartment message/event loop
00675     // (see SDK documentation for MsgWaitForMultipleObjects)
00676     // here worker message loops last forever. in situations without a
00677     // static number of worker threads, the loop could easily be terminated by
00678     // WM_QUITs sent from the main thread which might manage the worker thread
00679     // pool more carefully.
00680 #pragma warning(push)
00681 #pragma warning(disable : 4127) // conditional expression is constant
00682     while (true)
00683 #pragma warning(pop)
00684         {
00685         DWORD dwWaitResult;
00686
00687         // wait for any message sent or posted to this queue
00688         // or for one of the passed handles to become signaled
00689         dwWaitResult = MsgWaitForMultipleObjects(1, &vrghEvent[iThread],
00690             FALSE, INFINITE, QS_ALLINPUT);
00691
00692         // result tells us the type of event we have:
00693         // a message or a signaled handle
00694
00695         // if there are one or more messages in the queue ...
00696         if (dwWaitResult == (WAIT_OBJECT_0 + 1))
00697             {
00698             // dispatch all of the messages in this next loop
00699             // (here is where we'd check for WM_QUITs to end this
00700             // worker thread if we wanted to)
00701             while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
00702                 DispatchMessage(&msg);
00703             }
00704         else
00705             {
00706             // this thread was signaled to create a new object
00707             try
00708                 {
00709                 LPUNKNOWN   punk;
00710
00711         // if the user name isn't set, look it up
00712         // we could do this in the class factory, but this gives
00713         // us a sanity check on the impersonation
00714         if (NULL == vrgpszAptUser[iThread])
00715           {
00716           LPTSTR pszUser;
00717           DWORD cchUser = MAX_USER_NAME;
00718
00719           if (!UtilAllocMem ((PVOID*)&pszUser, cchUser*sizeof(TCHAR)))
00720             throw E_OUTOFMEMORY;
00721
00722           if (!GetUserName (pszUser, &cchUser))
00723             lstrcpy(pszUser, TEXT("Name not found"));
00724
00725           vrgpszAptUser[iThread] = pszUser;
00726           }
00727
00728                 // create a new CObject
00729                 punk = (IUnknown *)new CObject;
00730                 if (punk == NULL)
00731                     throw E_OUTOFMEMORY;
00732
00733                 hr = vpstmMarshalling->Seek(bZero, STREAM_SEEK_SET, NULL);
00734                 if (FAILED(hr))
00735                     throw hr;
00736                 hr = CoMarshalInterface(vpstmMarshalling,
00737                     IID_IUnknown,
00738                     punk,
00739                     MSHCTX_INPROC,
00740                     NULL,
00741                     MSHLFLAGS_NORMAL);
00742                 if (FAILED(hr))
00743                     throw hr;
00744
00745                 // punk is now referenced by its marshal-data in vpstmMarshalling.
00746                 // we release our local reference here so the unmarshaller will
00747                 // have the sole reference. a common mistake is to forget this
00748                 // release and end up with orphaned objects in the server.
00749                 punk->Release();
00750
00751                 // modify the global state -- the # of objects/thread -- which is
00752                 // displayed in the server UI
00753                 vrgcObjects[iThread]++;
00754                 InvalidateRect(vhwndMain, NULL, TRUE);
00755
00756                 vhrThreadStatus = S_OK;
00757                 }
00758             catch (HRESULT hr)
00759                 {
00760                 vhrThreadStatus = hr;
00761                 }
00762             SetEvent(vhEventServer);
00763             }
00764
00765         }
00766
00767     CoUninitialize();
00768     return msg.wParam;
00769 }  // ServerThreadProc
00770
00771 // ---------------------------------------------------------------------------
00772 // %%Function: CObject::QueryInterface
00773 //  Returns a new reference of the specified iid-type to a CObject.
00774 // ---------------------------------------------------------------------------
00775  STDMETHODIMP
00776 CObject::QueryInterface(REFIID iid, void **ppv)
00777 {
00778     *ppv = NULL;
00779
00780     if (iid == IID_IUnknown)
00781         {
00782         *ppv = (IUnknown *)this;
00783         }
00784     if (*ppv != NULL)
00785         {
00786         AddRef();
00787         return S_OK;
00788         }
00789     return E_NOINTERFACE;
00790 }  // CObject::QueryInterface
00791
00792 // ---------------------------------------------------------------------------
00793 // %%Function: CObject::Release
00794 //  Handles releases of references to a CObject. Purpose here is to have code
00795 // which alters the global state which is displayed in the servers UI.
00796 // ---------------------------------------------------------------------------
00797  STDMETHODIMP_(ULONG)
00798 CObject::Release(void)
00799 {
00800     if (--mcRef == 0)
00801         {
00802         // change the global server state -- the # of objects/thread --
00803         // reflected in the server UI
00804         for (int i=0; i<cServerThreads; i++)
00805             {
00806             if (vrgtid[i] == GetCurrentThreadId())
00807                 {
00808         // A sanity check to see if we're still impersonating...
00809         TCHAR szUser[MAX_USER_NAME];
00810         DWORD cchUser = MAX_USER_NAME;
00811
00812         if (!GetUserName (szUser, &cchUser))
00813           ErrorMessage(NULL, TEXT("GetUserName"), GetLastError ());
00814         else
00815           {
00816           if (lstrcmp (szUser, vrgpszAptUser[i]))
00817             ErrorMessage (NULL, TEXT("Impersonation error."), S_OK);
00818           }
00819
00820                 vrgcObjects[i]--;
00821                 InvalidateRect(vhwndMain, NULL, TRUE);
00822                 break;
00823                 }
00824             }
00825
00826         delete this;
00827         return 0;
00828         }
00829     return mcRef;
00830 }  // CObject::Release
00831
00832
00833 // ---------------------------------------------------------------------------
00834 // %%Function: FindSlot
00835 //  Determines what slot in the array of worker threads may be used by the
00836 // user represented by psid.
00837 // ---------------------------------------------------------------------------
00838 BOOL FindSlot(PSID psid, int *piThread)
00839 {
00840   int iThread;
00841
00842   // see if there is already an apartment impersonating this user
00843   for (iThread = 0; iThread < cServerThreads; iThread++)
00844     {
00845     if ((NULL != vrgpSid[iThread]) &&
00846         (EqualSid (psid, vrgpSid[iThread])))
00847       break;
00848     }
00849
00850   // if this user didn't have a thread already, find a free one
00851   if (iThread == cServerThreads)
00852     {
00853     for (iThread = 0; iThread < cServerThreads; iThread++)
00854       {
00855       if (NULL == vrgpSid[iThread])
00856         break;
00857       }
00858
00859     if (iThread == cServerThreads) // no resources available...
00860       return(FALSE);
00861     }
00862
00863   // return the index to use
00864   *piThread = iThread;
00865   return(TRUE);
00866 }
00867
00868 // EOF =======================================================================
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/SessionDlg.h Source File

  • WinBase
  • WtsApi
  • WtsApi

SessionDlg.h

Go to the documentation of this file.
00001 //  Copyright 1995-1999, Citrix Systems Inc.
00002 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00003 #if !defined(AFX_SESSIONDLG_H__1A55D424_30F9_11D1_8310_00C04FBEFCDA__INCLUDED_)
00004 #define AFX_SESSIONDLG_H__1A55D424_30F9_11D1_8310_00C04FBEFCDA__INCLUDED_
00005
00006 #if _MSC_VER >= 1000
00007 #pragma once
00008 #endif // _MSC_VER >= 1000
00009
00010 #include <wtsapi32.h>
00011
00012 // SessionDlg.h : header file
00013 //
00014
00015 /////////////////////////////////////////////////////////////////////////////
00016 // CSessionDlg dialog
00017
00018 class CSessionDlg : public CDialog
00019 {
00020 // Construction
00021 public:
00022   void Refresh();
00023   PWTS_SESSION_INFO pSessionInfo;
00024   CSessionDlg(CWnd* pParent = NULL);   // standard constructor
00025
00026 // Dialog Data
00027   //{{AFX_DATA(CSessionDlg)
00028   enum { IDD = IDD_SESSION };
00029   CListCtrl m_sessionList;
00030   CEdit m_serverName;
00031   //}}AFX_DATA
00032
00033
00034 // Overrides
00035   // ClassWizard generated virtual function overrides
00036   //{{AFX_VIRTUAL(CSessionDlg)
00037   protected:
00038   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00039   //}}AFX_VIRTUAL
00040
00041 // Implementation
00042 protected:
00043   void SetSessionID();
00044
00045   // Generated message map functions
00046   //{{AFX_MSG(CSessionDlg)
00047   afx_msg void OnDisconnectSession();
00048   afx_msg void OnLogoffSession();
00049   afx_msg void OnQuerySession();
00050   virtual BOOL OnInitDialog();
00051   afx_msg void OnVirtualChannel();
00052   afx_msg void OnRefresh();
00053   virtual void OnCancel();
00054   afx_msg void OnSetsession();
00055   //}}AFX_MSG
00056   DECLARE_MESSAGE_MAP()
00057 private:
00058   void GetSessionID();
00059   CString connectState[10];
00060   CString WinStationName;
00061   HANDLE serverHandle;
00062   LPSTR serverName;
00063   DWORD count;
00064   DWORD sessionID;
00065 };
00066
00067 //{{AFX_INSERT_LOCATION}}
00068 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00069
00070 #endif // !defined(AFX_SESSIONDLG_H__1A55D424_30F9_11D1_8310_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSnap Member List

This is the complete list of members for CSnap, including all inherited members.
CSnap() | CSnap | [inline]
get_SnapIncrement(long *pVal) | CSnap |
get_SnapOn(BOOL *pVal) | CSnap |
m_bSnapOn | CSnap |
m_lSnapIncrement | CSnap |
put_SnapIncrement(long newVal) | CSnap |
put_SnapOn(BOOL newVal) | CSnap |
SnapRect(IHTMLElement *pIElement, RECT *prcNew, ELEMENT_CORNER eHandle) | CSnap |
Generated on Wed Nov 13 2024 16:57:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagADSIIF Member List

This is the complete list of members for tagADSIIF, including all inherited members.
pFn | tagADSIIF
pIID | tagADSIIF
szIf | tagADSIIF
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptServe/UtilCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptServe

UtilCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTILCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COUtilityCar COM
00005              object class.
00006
00007              UTILCAR showcases the construction of the COUtilityCar COM
00008              object class with the IUnknown, ICar, and IUtility interfaces.
00009              This is done through Containment reuse of COCar's ICar
00010              interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial APTSERVE.HTM file.
00014              For more specific technical details on the internal workings
00015              see the comments dispersed throughout the module's source code.
00016
00017   Classes:   COUtilityCar.
00018
00019   Functions: none.
00020
00021   Origin:    3-20-96: atrent - Editor-inheritance from UTILCAR.CPP in
00022                the LOCSERVE Tutorial Code Sample.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will make calls to the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include SERVER.H because it has internal class declarations and
00048     resource ID definitions specific for this DLL.
00049   We include CAR.H because it has the class COCar declarations.
00050   We include UTILCAR.H because it has the class COUtilityCar declarations.
00051 ---------------------------------------------------------------------------*/
00052 #include <windows.h>
00053 #include <ole2.h>
00054 #include <apputil.h>
00055 #include <micars.h>
00056 #include <carguids.h>
00057 #include "server.h"
00058 #include "car.h"
00059 #include "utilcar.h"
00060
00061
00062 /*---------------------------------------------------------------------------
00063   COUtilityCar's implementation of its main COM object class including
00064   Constructor, Destructor, QueryInterface, AddRef, and Release.
00065 ---------------------------------------------------------------------------*/
00066
00067 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00068   Method:   COUtilityCar::COUtilityCar
00069
00070   Summary:  COUtilityCar Constructor. Note the member initializers:
00071             "m_ImpICar(this, pUnkOuter)" and "m_ImpIUtility(this,
00072             pUnkOuter)" which are used to pass the 'this' and
00073             pUnkOuter pointers of this constructor function to the
00074             constructors that instantiate the implementations of
00075             the CImpICar and CImpIUtility interfaces (which are both
00076             nested inside this present COUtilityCar Object Class.
00077
00078   Args:     IUnknown* pUnkOuter,
00079               Pointer to the the outer Unknown.  NULL means this COM Object
00080               is not being Aggregated.  Non NULL means it is being created
00081               on behalf of an outside COM object that is reusing it via
00082               aggregation.
00083             CServer* pServer)
00084               Pointer to the server's control object.
00085
00086   Modifies: m_cRefs, m_pUnkOuter.
00087
00088   Returns:  void
00089 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00090 COUtilityCar::COUtilityCar(
00091   IUnknown* pUnkOuter,
00092   CServer* pServer) :
00093   m_ImpICar(this, pUnkOuter),
00094   m_ImpIUtility(this, pUnkOuter)
00095 {
00096   // Zero the COM object's reference count.
00097   m_cRefs = 0;
00098
00099   // No AddRef necessary if non-NULL, as this present COM object's lifetime
00100   // is totally coupled with the controlling Outer object's lifetime.
00101   m_pUnkOuter = pUnkOuter;
00102
00103   // Zero the pointer to the contained COCar object's ICar interface.
00104   m_pICar = NULL;
00105
00106   // Init the pointer to the server's control object.
00107   m_pServer = pServer;
00108
00109   LOGF2("L<%X>: COUtilityCar Constructor. m_pUnkOuter=0x%X.",TID,m_pUnkOuter);
00110
00111   return;
00112 }
00113
00114
00115 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00116   Method:   COUtilityCar::~COUtilityCar
00117
00118   Summary:  COUtilityCar Destructor.
00119
00120   Args:     void
00121
00122   Modifies: .
00123
00124   Returns:  void
00125 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00126 COUtilityCar::~COUtilityCar(void)
00127 {
00128   LOGF1("L<%X>: COUtilityCar::Destructor.",TID);
00129
00130   // Release the contained Car object.
00131   RELEASE_INTERFACE(m_pICar);
00132
00133   return;
00134 }
00135
00136
00137 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00138   Method:   COUtilityCar::Init
00139
00140   Summary:  COUtilityCar Initialization method.
00141
00142   Args:     void
00143
00144   Modifies: m_pUnkCar, m_pICar, m_cRefs.
00145
00146   Returns:  HRESULT
00147               Standard result code. NOERROR for success.
00148 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00149 HRESULT COUtilityCar::Init(void)
00150 {
00151   HRESULT hr;
00152
00153   LOGF1("L<%X>: COUtilityCar::Init.",TID);
00154
00155   // Set up the right pIUnknown for delegation.  If we are being
00156   // aggregated then we pass the pUnkOuter in turn to any COM objects
00157   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00158   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00159
00160   // We create an instance of the COCar object and do this via the
00161   // Containment reuse technique.  We ask for the new COM object's
00162   // ICar interface directly.  We pass NULL for the pUnkOuter
00163   // aggregation pointer because we are not aggregating.  It is here
00164   // that we are reusing the COCar COM Object through the Containment
00165   // technique.  We cache the requested ICar interface pointer in this
00166   // COUtilityCar COM object for later use.  We don't need to AddRef
00167   // this interface because the CoCreateInstance will do this for us.
00168   hr = CoCreateInstance(
00169          CLSID_AptCar,
00170          NULL,
00171          CLSCTX_LOCAL_SERVER,
00172          IID_ICar,
00173          (PPVOID)&m_pICar);
00174
00175   if (SUCCEEDED(hr))
00176   {
00177     LOGF1("L<%X>: COUtilityCar::Init (New Containment of COCar) Succeeded.",TID);
00178   }
00179   else
00180   {
00181     LOGF2("L<%X>: COUtilityCar::Init (New Containment of COCar) Failed. hr=0x%X.",TID,hr);
00182   }
00183
00184   return (hr);
00185 }
00186
00187
00188 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00189   Method:   COUtilityCar::QueryInterface
00190
00191   Summary:  QueryInterface of the COUtilityCar non-delegating
00192             IUnknown implementation.
00193
00194   Args:     REFIID riid,
00195               [in] GUID of the Interface being requested.
00196             PPVOID ppv)
00197               [out] Address of the caller's pointer variable that will
00198               receive the requested interface pointer.
00199
00200   Modifies: *ppv.
00201
00202   Returns:  HRESULT
00203 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00204 STDMETHODIMP COUtilityCar::QueryInterface(
00205                REFIID riid,
00206                PPVOID ppv)
00207 {
00208   HRESULT hr = E_NOINTERFACE;
00209   *ppv = NULL;
00210
00211   if (IID_IUnknown == riid)
00212   {
00213     *ppv = this;
00214     LOGF1("L<%X>: COUtilityCar::QueryInterface. 'this' pIUnknown returned",TID);
00215   }
00216   else if (IID_ICar == riid)
00217   {
00218     *ppv = &m_ImpICar;
00219     LOGF1("L<%X>: COUtilityCar::QueryInterface. pICar returned",TID);
00220   }
00221   else if (IID_IUtility == riid)
00222   {
00223     // This IUtility interface is implemented in this COUtilityCar object
00224     // and might be called a native interface of COCruiseCar.
00225     *ppv = &m_ImpIUtility;
00226     LOGF1("L<%X>: COUtilityCar::QueryInterface. pIUtility returned",TID);
00227   }
00228
00229   if (NULL != *ppv)
00230   {
00231     // We've handed out a pointer to the interface so obey the COM rules
00232     // and AddRef the reference count.
00233     ((LPUNKNOWN)*ppv)->AddRef();
00234     hr = NOERROR;
00235   }
00236
00237   return (hr);
00238 }
00239
00240
00241 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00242   Method:   COUtilityCar::AddRef
00243
00244   Summary:  AddRef of the COUtilityCar non-delegating IUnknown implementation.
00245
00246   Args:     void
00247
00248   Modifies: m_cRefs.
00249
00250   Returns:  ULONG
00251               New value of m_cRefs (COM object's reference count).
00252 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00253 STDMETHODIMP_(ULONG) COUtilityCar::AddRef(void)
00254 {
00255   m_cRefs++;
00256
00257   LOGF2("L<%X>: COUtilityCar::AddRef. New cRefs=%i.",TID,m_cRefs);
00258
00259   return m_cRefs;
00260 }
00261
00262
00263 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00264   Method:   COUtilityCar::Release
00265
00266   Summary:  Release of the COUtilityCar non-delegating IUnknown
00267             implementation.
00268
00269   Args:     void
00270
00271   Modifies: m_cRefs.
00272
00273   Returns:  ULONG
00274               New value of m_cRefs (COM object's reference count).
00275 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00276 STDMETHODIMP_(ULONG) COUtilityCar::Release(void)
00277 {
00278   ULONG ulCount = --m_cRefs;
00279
00280   LOGF2("L<%X>: COUtilityCar::Release. New cRefs=%i.",TID,m_cRefs);
00281
00282   if (0 == m_cRefs)
00283   {
00284     CServer* pServer = m_pServer;
00285
00286     // We artificially bump the main ref count to ensure that an indirect
00287     // recursive call to this release won't occur because of other
00288     // delegating releases that might happen in our own destructor.
00289     m_cRefs++;
00290     delete this;
00291
00292     // We've reached a zero reference count for this COM object.
00293     // So we tell the server housing to decrement its global object
00294     // count so that the server will be unloaded if appropriate.
00295     if (NULL != pServer)
00296       pServer->ObjectsDown();
00297   }
00298
00299   return ulCount;
00300 }
00301
00302
00303 /*---------------------------------------------------------------------------
00304   COUtilityCar's nested implementation of the ICar interface including
00305   Constructor, Destructor, QueryInterface, AddRef, Release,
00306   Shift, Clutch, Speed, and Steer.
00307 ---------------------------------------------------------------------------*/
00308
00309 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00310   Method:   COUtilityCar::CImpICar::CImpICar
00311
00312   Summary:  Constructor for the CImpICar interface instantiation.
00313
00314   Args:     COUtilityCar* pBackObj,
00315               Back pointer to the parent outer object.
00316             IUnknown* pUnkOuter,
00317               Pointer to the outer Unknown.  For delegation.
00318
00319   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00320
00321   Returns:  void
00322 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00323 COUtilityCar::CImpICar::CImpICar(
00324   COUtilityCar* pBackObj,
00325   IUnknown* pUnkOuter)
00326 {
00327   // Init the Interface Ref Count (used for debugging only).
00328   m_cRefI = 0;
00329
00330   // Init the Back Object Pointer to point to the outer object.
00331   m_pBackObj = pBackObj;
00332
00333   // Init the CImpICar interface's delegating Unknown pointer.  We use
00334   // the Back Object pointer for IUnknown delegation here if we are not
00335   // being aggregated.  If we are being aggregated we use the supplied
00336   // pUnkOuter for IUnknown delegation.  In either case the pointer
00337   // assignment requires no AddRef because the CImpICar lifetime is
00338   // quaranteed by the lifetime of the parent object in which
00339   // CImpICar is nested.
00340   if (NULL == pUnkOuter)
00341   {
00342     m_pUnkOuter = pBackObj;
00343     LOGF1("L<%X>: COUtilityCar::CImpICar Constructor. Non-Aggregating",TID);
00344   }
00345   else
00346   {
00347     m_pUnkOuter = pUnkOuter;
00348     LOGF1("L<%X>: COUtilityCar::CImpICar Constructor. Aggregating",TID);
00349   }
00350
00351   return;
00352 }
00353
00354
00355 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00356   Method:   COUtilityCar::CImpICar::~CImpICar
00357
00358   Summary:  Destructor for the CImpICar interface instantiation.
00359
00360   Args:     void
00361
00362   Modifies: .
00363
00364   Returns:  void
00365 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00366 COUtilityCar::CImpICar::~CImpICar(void)
00367 {
00368   LOGF1("L<%X>: COUtilityCar::CImpICar Destructor.",TID);
00369
00370   return;
00371 }
00372
00373
00374 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00375   Method:   COUtilityCar::CImpICar::QueryInterface
00376
00377   Summary:  The QueryInterface IUnknown member of this ICar interface
00378             implementation that delegates to m_pUnkOuter, whatever it is.
00379
00380   Args:     REFIID riid,
00381               [in] GUID of the Interface being requested.
00382             PPVOID ppv)
00383               [out] Address of the caller's pointer variable that will
00384               receive the requested interface pointer.
00385
00386   Modifies: .
00387
00388   Returns:  HRESULT
00389               Returned by the delegated outer QueryInterface call.
00390 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00391 STDMETHODIMP COUtilityCar::CImpICar::QueryInterface(
00392                REFIID riid,
00393                PPVOID ppv)
00394 {
00395   LOGF1("L<%X>: COUtilityCar::CImpICar::QueryInterface. Delegating.",TID);
00396
00397   // Delegate this call to the outer object's QueryInterface.
00398   return m_pUnkOuter->QueryInterface(riid, ppv);
00399 }
00400
00401
00402 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00403   Method:   COUtilityCar::CImpICar::AddRef
00404
00405   Summary:  The AddRef IUnknown member of this ICar interface
00406             implementation that delegates to m_pUnkOuter, whatever it is.
00407
00408   Args:     void
00409
00410   Modifies: m_cRefI.
00411
00412   Returns:  ULONG
00413               Returned by the delegated outer AddRef call.
00414 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00415 STDMETHODIMP_(ULONG) COUtilityCar::CImpICar::AddRef(void)
00416 {
00417   // Increment the Interface Reference Count.
00418   ++m_cRefI;
00419
00420   LOGF2("L<%X>: COUtilityCar::CImpICar::Addref. Delegating. New cI=%i.",TID,m_cRefI);
00421
00422   // Delegate this call to the outer object's AddRef.
00423   return m_pUnkOuter->AddRef();
00424 }
00425
00426
00427 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00428   Method:   COUtilityCar::CImpICar::Release
00429
00430   Summary:  The Release IUnknown member of this ICar interface
00431             implementation that delegates to m_pUnkOuter, whatever it is.
00432
00433   Args:     void
00434
00435   Modifies: m_cRefI.
00436
00437   Returns:  ULONG
00438               Returned by the delegated outer Release call.
00439 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00440 STDMETHODIMP_(ULONG) COUtilityCar::CImpICar::Release(void)
00441 {
00442   // Decrement the Interface Reference Count.
00443   --m_cRefI;
00444
00445   LOGF2("L<%X>: COUtilityCar::CImpICar::Release. Delegating. New cI=%i.",TID,m_cRefI);
00446
00447   // Delegate this call to the outer object's Release.
00448   return m_pUnkOuter->Release();
00449 }
00450
00451
00452 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00453   Method:   COUtilityCar::CImpICar::Shift
00454
00455   Summary:  The Shift member method of this ICar interface implementation.
00456             A simple empty method on a COUtilityCar COM object for tutorial
00457             purposes.  Presumably if this Car object were modeling
00458             a real Car then the Shift method would shift to the specified
00459             gear.
00460
00461   Args:     short nGear
00462               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00463
00464   Modifies: .
00465
00466   Returns:  HRESULT
00467               NOERROR
00468 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00469 STDMETHODIMP COUtilityCar::CImpICar::Shift(
00470                short nGear)
00471 {
00472   LOGF2("L<%X>: COUtilityCar::CImpICar::Shift. Delegating. nGear=%i.",TID,nGear);
00473
00474   // Delegate to the contained object implementation of ICar.
00475   m_pBackObj->m_pICar->Shift(nGear);
00476
00477   return NOERROR;
00478 }
00479
00480
00481 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00482   Method:   COUtilityCar::CImpICar::Clutch
00483
00484   Summary:  The Clutch member method of this ICar interface implementation.
00485             A simple empty method on a COUtilityCar COM object for tutorial
00486             purposes.  Presumably if this Car object were modeling
00487             a real Car then the Clutch method would engage the clutch the
00488             specified amount.
00489
00490   Args:     short nEngaged)
00491               Percent clutch is engaged (0 to 100%).
00492
00493   Modifies: .
00494
00495   Returns:  HRESULT
00496               NOERROR
00497 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00498 STDMETHODIMP COUtilityCar::CImpICar::Clutch(
00499                short nEngaged)
00500 {
00501   LOGF2("L<%X>: COUtilityCar::CImpICar::Clutch. Delegating. nEngaged=%i.",TID,nEngaged);
00502
00503   // Delegate to the contained object implementation of ICar.
00504   m_pBackObj->m_pICar->Clutch(nEngaged);
00505
00506   return NOERROR;
00507 }
00508
00509
00510 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00511   Method:   COUtilityCar::CImpICar::Speed
00512
00513   Summary:  The Propel member method of this ICar interface implementation.
00514             A simple empty method on a COUtilityCar COM object for tutorial
00515             purposes.  Presumably if this Car object were modeling
00516             a real Car then this method would accelerate/brake to bring
00517             the car to the specified speed.
00518
00519   Args:     short nMph
00520               New speed in miles per hour.
00521
00522   Modifies: .
00523
00524   Returns:  HRESULT
00525               NOERROR
00526 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00527 STDMETHODIMP COUtilityCar::CImpICar::Speed(
00528                short nMph)
00529 {
00530   LOGF2("L<%X>: COUtilityCar::CImpICar::Speed. Delegating. nMph=%i.",TID,nMph);
00531
00532   // Delegate to the contained object implementation of ICar.
00533   m_pBackObj->m_pICar->Speed(nMph);
00534
00535   return NOERROR;
00536 }
00537
00538
00539 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00540   Method:   COUtilityCar::CImpICar::Steer
00541
00542   Summary:  The Steer member method of this ICar interface implementation.
00543             A simple empty method on a COUtilityCar COM object for tutorial
00544             purposes.  Presumably if this Car object were modeling
00545             a real Car then the Steer method would set the steering
00546             angle of the Car.
00547
00548   Args:     short nAngle)
00549               0 degrees straight ahead, -45 Full left, +45 Full right.
00550
00551   Modifies: .
00552
00553   Returns:  HRESULT
00554               NOERROR
00555 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00556 STDMETHODIMP COUtilityCar::CImpICar::Steer(
00557                short nAngle)
00558 {
00559   LOGF2("L<%X>: COUtilityCar::CImpICar::Steer. Delegating. nAngle=%i.",TID,nAngle);
00560
00561   // Delegate to the contained object implementation of ICar.
00562   m_pBackObj->m_pICar->Steer(nAngle);
00563
00564   return NOERROR;
00565 }
00566
00567
00568 /*---------------------------------------------------------------------------
00569   COUtilityCar's nested implementation of the IUtility interface including
00570   Constructor, Destructor, QueryInterface, AddRef, Release,
00571   Offroad, and Winch.
00572 ---------------------------------------------------------------------------*/
00573
00574 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00575   Method:   COUtilityCar::CImpIUtility::CImpIUtility
00576
00577   Summary:  Constructor for the CImpIUtility interface instantiation.
00578
00579   Args:     COUtilityCar* pBackObj,
00580               Back pointer to the parent outer object.
00581             IUnknown* pUnkOuter)
00582               Pointer to the outer Unknown.  For delegation.
00583
00584   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00585
00586   Returns:  void
00587 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00588 COUtilityCar::CImpIUtility::CImpIUtility(
00589   COUtilityCar* pBackObj,
00590   IUnknown* pUnkOuter)
00591 {
00592   // Init the Interface Ref Count (used for debugging only).
00593   m_cRefI = 0;
00594
00595   // Init the Back Object Pointer to point to the outer object.
00596   m_pBackObj = pBackObj;
00597
00598   // Init the CImpIUtility interface's delegating Unknown pointer.  We use
00599   // the Back Object pointer for IUnknown delegation here if we are not
00600   // being aggregated.  If we are being aggregated we use the supplied
00601   // pUnkOuter for IUnknown delegation.  In either case the pointer
00602   // assignment requires no AddRef because the CImpIUtility lifetime is
00603   // quaranteed by the lifetime of the parent object in which
00604   // CImpIUtility is nested.
00605   if (NULL == pUnkOuter)
00606   {
00607     m_pUnkOuter = pBackObj;
00608     LOGF1("L<%X>: COUtilityCar::CImpIUtility Constructor. Non-Aggregating.",TID);
00609   }
00610   else
00611   {
00612     m_pUnkOuter = pUnkOuter;
00613     LOGF1("L<%X>: COUtilityCar::CImpIUtility Constructor. Aggregating.",TID);
00614   }
00615
00616   return;
00617 }
00618
00619
00620 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00621   Method:   COUtilityCar::CImpIUtility::~CImpIUtility
00622
00623   Summary:  Destructor for the CImpIUtility interface instantiation.
00624
00625   Args:     void
00626
00627   Modifies: .
00628
00629   Returns:  void
00630 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00631 COUtilityCar::CImpIUtility::~CImpIUtility(void)
00632 {
00633   LOGF1("L<%X>: COUtilityCar::CImpIUtility Destructor.",TID);
00634
00635   return;
00636 }
00637
00638
00639 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00640   Method:   COUtilityCar::CImpIUtility::QueryInterface
00641
00642   Summary:  The QueryInterface IUnknown member of this IUtility interface
00643             implementation that delegates to m_pUnkOuter, whatever it is.
00644
00645   Args:     REFIID riid,
00646               [in] GUID of the Interface being requested.
00647             PPVOID ppv)
00648               [out] Address of the caller's pointer variable that will
00649               receive the requested interface pointer.
00650
00651   Modifies: .
00652
00653   Returns:  HRESULT
00654               Returned by the delegated outer QueryInterface call.
00655 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00656 STDMETHODIMP COUtilityCar::CImpIUtility::QueryInterface(
00657                REFIID riid,
00658                PPVOID ppv)
00659 {
00660   LOGF1("L<%X>: COUtilityCar::CImpIUtility::QueryInterface. Delegating.",TID);
00661
00662   // Delegate this call to the outer object's QueryInterface.
00663   return m_pUnkOuter->QueryInterface(riid, ppv);
00664 }
00665
00666
00667 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00668   Method:   COUtilityCar::CImpIUtility::AddRef
00669
00670   Summary:  The AddRef IUnknown member of this IUtility interface
00671             implementation that delegates to m_pUnkOuter, whatever it is.
00672
00673   Args:     void
00674
00675   Modifies: m_cRefI.
00676
00677   Returns:  ULONG
00678               Returned by the delegated outer AddRef call.
00679 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00680 STDMETHODIMP_(ULONG) COUtilityCar::CImpIUtility::AddRef(void)
00681 {
00682   // Increment the Interface Reference Count.
00683   ++m_cRefI;
00684
00685   LOGF2("L<%X>: COUtilityCar::CImpIUtility::Addref. Delegating. New cI=%i.",TID,m_cRefI);
00686
00687   // Delegate this call to the outer object's AddRef.
00688   return m_pUnkOuter->AddRef();
00689 }
00690
00691
00692 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00693   Method:   COUtilityCar::CImpIUtility::Release
00694
00695   Summary:  The Release IUnknown member of this IUtility interface
00696             implementation that delegates to m_pUnkOuter, whatever it is.
00697
00698   Args:     void
00699
00700   Modifies: m_cRefI.
00701
00702   Returns:  ULONG
00703               Returned by the delegated outer Release call.
00704 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00705 STDMETHODIMP_(ULONG) COUtilityCar::CImpIUtility::Release(void)
00706 {
00707   // Decrement the Interface Reference Count.
00708   --m_cRefI;
00709
00710   LOGF2("L<%X>: COUtilityCar::CImpIUtility::Release. Delegating. New cI=%i.",TID,m_cRefI);
00711
00712   // Delegate this call to the outer object's Release.
00713   return m_pUnkOuter->Release();
00714 }
00715
00716
00717 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00718   Method:   COUtilityCar::CImpIUtility::Offroad
00719
00720   Summary:  The Offroad member method of this IUtility interface
00721             implementation.  A simple empty method on a COUtilityCar
00722             COM object for tutorial purposes.  Presumably if this
00723             UtilityCar object were modeling a real Car then the Offroad
00724             method would function the 4-wheel drive transfer case and
00725             shift it to the specified 4-wheel drive mode.
00726
00727   Args:     short nGear
00728               0 = 2H or regular 2-wheel drive;
00729               1 = 4H or 4-wheel drive high speed;
00730               2 = neutral; and
00731               3 = 4L or 4-wheel drive low speed).
00732
00733   Modifies: .
00734
00735   Returns:  HRESULT
00736               NOERROR
00737 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00738 STDMETHODIMP COUtilityCar::CImpIUtility::Offroad(
00739                short nGear)
00740 {
00741   LOGF2("L<%X>: COUtilityCar::CImpIUtility::Offroad. Called. nGear=%i.",TID,nGear);
00742
00743   return NOERROR;
00744 }
00745
00746
00747 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00748   Method:   COUtilityCar::CImpIUtility::Winch
00749
00750   Summary:  The Winch member method of this IUtility interface
00751             implementation.  A simple empty method on a COUtilityCar COM
00752             object for tutorial purposes.  Presumably if this UtilityCar
00753             object were modeling a real Car then the Winch method would
00754             turn on/off the front-mounted Winch to the specified RPMs.
00755
00756   Args:     short nRpm
00757               0 = off; 1 - 50 RPM.
00758
00759   Modifies: .
00760
00761   Returns:  HRESULT
00762               NOERROR
00763 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00764 STDMETHODIMP COUtilityCar::CImpIUtility::Winch(
00765                short nRpm)
00766 {
00767   LOGF2("L<%X>: COUtilityCar::CImpIUtility::Winch. Called. nRpm=%i.",TID,nRpm);
00768
00769   return NOERROR;
00770 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Parameter.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Parameter.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=0000050B-0000-0010-8000-00AA006D2EA4,DynamicCasts)
00019     @com.interface(iid=0000050C-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public class Parameter implements IUnknown,com.ms.com.NoAutoScripting,msado15._Parameter
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public native msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1610809344, type=PROPGET, name="Name", name2="getName", addFlagsVtable=4)
00027       @com.parameters([type=STRING] return) */
00028   public native String getName();
00029
00030   /** @com.method(vtoffset=6, dispid=1610809344, type=PROPPUT, name="Name", name2="putName", addFlagsVtable=4)
00031       @com.parameters([in,type=STRING] pbstr) */
00032   public native void setName(String pbstr);
00033
00034   /** @com.method(vtoffset=7, dispid=0, type=PROPGET, name="Value", name2="getValue", addFlagsVtable=4)
00035       @com.parameters([type=VARIANT] return) */
00036   public native Variant getValue();
00037
00038   /** @com.method(vtoffset=8, dispid=0, type=PROPPUT, name="Value", name2="putValue", addFlagsVtable=4)
00039       @com.parameters([in,type=VARIANT] pvar) */
00040   public native void setValue(Variant pvar);
00041
00042   /** @com.method(vtoffset=9, dispid=1610809348, type=PROPGET, name="Type", name2="getType", addFlagsVtable=4)
00043       @com.parameters([type=I4] return) */
00044   public native int getType();
00045
00046   /** @com.method(vtoffset=10, dispid=1610809348, type=PROPPUT, name="Type", name2="putType", addFlagsVtable=4)
00047       @com.parameters([in,type=I4] psDataType) */
00048   public native void setType(int psDataType);
00049
00050   /** @com.method(vtoffset=11, dispid=1610809350, type=PROPPUT, name="Direction", name2="putDirection", addFlagsVtable=4)
00051       @com.parameters([in,type=I4] plParmDirection) */
00052   public native void setDirection(int plParmDirection);
00053
00054   /** @com.method(vtoffset=12, dispid=1610809350, type=PROPGET, name="Direction", name2="getDirection", addFlagsVtable=4)
00055       @com.parameters([type=I4] return) */
00056   public native int getDirection();
00057
00058   /** @com.method(vtoffset=13, dispid=1610809352, type=PROPPUT, name="Precision", name2="putPrecision", addFlagsVtable=4)
00059       @com.parameters([in,type=U1] pbPrecision) */
00060   public native void setPrecision(byte pbPrecision);
00061
00062   /** @com.method(vtoffset=14, dispid=1610809352, type=PROPGET, name="Precision", name2="getPrecision", addFlagsVtable=4)
00063       @com.parameters([type=U1] return) */
00064   public native byte getPrecision();
00065
00066   /** @com.method(vtoffset=15, dispid=1610809354, type=PROPPUT, name="NumericScale", name2="putNumericScale", addFlagsVtable=4)
00067       @com.parameters([in,type=U1] pbScale) */
00068   public native void setNumericScale(byte pbScale);
00069
00070   /** @com.method(vtoffset=16, dispid=1610809354, type=PROPGET, name="NumericScale", name2="getNumericScale", addFlagsVtable=4)
00071       @com.parameters([type=U1] return) */
00072   public native byte getNumericScale();
00073
00074   /** @com.method(vtoffset=17, dispid=1610809356, type=PROPPUT, name="Size", name2="putSize", addFlagsVtable=4)
00075       @com.parameters([in,type=I4] pl) */
00076   public native void setSize(int pl);
00077
00078   /** @com.method(vtoffset=18, dispid=1610809356, type=PROPGET, name="Size", name2="getSize", addFlagsVtable=4)
00079       @com.parameters([type=I4] return) */
00080   public native int getSize();
00081
00082   /** @com.method(vtoffset=19, dispid=1610809358, type=METHOD, name="AppendChunk", addFlagsVtable=4)
00083       @com.parameters([in,type=VARIANT] Val) */
00084   public native void AppendChunk(Variant Val);
00085
00086   /** @com.method(vtoffset=20, dispid=1610809359, type=PROPGET, name="Attributes", name2="getAttributes", addFlagsVtable=4)
00087       @com.parameters([type=I4] return) */
00088   public native int getAttributes();
00089
00090   /** @com.method(vtoffset=21, dispid=1610809359, type=PROPPUT, name="Attributes", name2="putAttributes", addFlagsVtable=4)
00091       @com.parameters([in,type=I4] plParmAttribs) */
00092   public native void setAttributes(int plParmAttribs);
00093
00094
00095   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x50c, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00096
00097   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0x50b, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00098 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/resource.h Source File

  • Multimedia
  • Audio
  • multichan

resource.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 //{{NO_DEPENDENCIES}}
00006 // Microsoft Developer Studio generated include file.
00007 // Used by multichan.rc
00008 //
00009 #define IDD_ABOUTBOX                    100
00010 #define IDR_MAINFRAME                   128
00011 #define IDI_CHECK                       129
00012 #define IDR_MULTICTYPE                  130
00013 #define IDM_MIXER_MERGE                 200
00014 #define IDM_MIXER_OPTIONS               201
00015 #define IDD_SRC                         202
00016 #define IDD_DST                         203
00017 #define IDR_WAVEHEAD                    206
00018 #define IDC_COMBO_CHANNEL               1000
00019 #define IDC_COMBO_SPEAKER               1001
00020 #define IDC_USE                         1003
00021 #define IDC_CHANNELS                    1004
00022 #define IDC_BITDEPTH                    1005
00023 #define IDC_EDIT_AVEBITS                1006
00024 #define IDC_VALIDBITS                   1007
00025 #define IDC_EDIT_VALIDBITS              1007
00026 #define IDC_SAMPLERATE                  1008
00027 #define IDC_SPEAKERFLAGS                1009
00028 #define IDC_REMIX                       1010
00029 #define IDC_PLAY                        1011
00030 #define IDC_STOP                        1016
00031 #define IDC_COMBO_WAVEFORMAT            1012
00032 #define IDC_COMBO_GUIDFORMAT            1013
00033 #define IDC_COMBO_BITDEPTH              1014
00034 #define IDC_COMBO_SAMPLERATE            1015
00035 #define IDC_CHANNELNUM                  1015
00036 #define IDC_OUTPUT                      1024
00037 #define IDC_INPUT                       1025
00038 #define IDC_AVEBITS                     1026
00039 #define IDM_MIXER_PLAY                  32773
00040 #define IDM_MIXER_STOP                  32774
00041
00042 // Next default values for new objects
00043 //
00044 #ifdef APSTUDIO_INVOKED
00045 #ifndef APSTUDIO_READONLY_SYMBOLS
00046 #define _APS_3D_CONTROLS                     1
00047 #define _APS_NEXT_RESOURCE_VALUE        209
00048 #define _APS_NEXT_COMMAND_VALUE         32775
00049 #define _APS_NEXT_CONTROL_VALUE         1028
00050 #define _APS_NEXT_SYMED_VALUE           101
00051 #endif
00052 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/people.h Source File

  • SysMgmt
  • MMC
  • WMI

people.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _PEOPLE_H
00021 #define _PEOPLE_H
00022
00023 #include "DeleBase.h"
00024 #include <wbemcli.h>
00025 #include "SimpleArray.h"
00026
00027 class CBicycle;
00028 class CEventSink;
00029
00030 class CBicycleFolder : public CDelegationBase {
00031 public:
00032     CBicycleFolder();
00033     virtual ~CBicycleFolder();
00034
00035     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Bicycles"); }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00038
00039     // virtual functions go here (for MMCN_*)
00040     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00041   HRESULT GetPtr(IWbemServices **ptr);
00042
00043 private:
00044     // {2974380D-4C4B-11d2-89D8-000021473128}
00045     static const GUID thisGuid;
00046
00047   CSimpleArray<CBicycle *> m_children;
00048
00049   bool EnumChildren(IWbemServices *service);
00050   void EmptyChildren(void);
00051   HRESULT DisplayChildren(void);
00052   bool ErrorString(HRESULT hr, TCHAR *errMsg, UINT errSize);
00053
00054   // for the connection thread.
00055     void StopThread();
00056     static LRESULT CALLBACK WindowProc(
00057                 HWND hwnd,      // handle to window
00058                 UINT uMsg,      // message identifier
00059                 WPARAM wParam,  // first message parameter
00060                 LPARAM lParam);   // second message parameter
00061
00062     static DWORD WINAPI ThreadProc(LPVOID lpParameter);
00063   void RegisterEventSink(IWbemServices *service);
00064   IWbemObjectSink *m_pStubSink;
00065   IUnsecuredApartment *m_pUnsecApp;
00066
00067     HWND m_connectHwnd;
00068     DWORD m_threadId;
00069     HANDLE m_thread;
00070
00071   HANDLE m_doWork;    // telling the thread to do something.
00072   int m_threadCmd;    // what command the thread should do.
00073   #define CT_CONNECT 0
00074   #define CT_GET_PTR 1
00075   #define CT_EXIT 2
00076
00077     CRITICAL_SECTION m_critSect;
00078     bool m_running;     // thread is processing a command now.
00079
00080   HANDLE m_ptrReady;    // the thread has done the work.
00081
00082     IResultData *m_pResultData;
00083   IStream *m_pStream;
00084   IWbemServices *m_realWMI;// lives in the background thread. Use marshalling.
00085 };
00086
00087 class CBicycle : public CDelegationBase {
00088 public:
00089     CBicycle(CBicycleFolder *parent, IWbemClassObject *inst);
00090     virtual ~CBicycle()
00091   {
00092     if(m_inst)
00093       m_inst->Release();
00094
00095     m_inst = 0;
00096   }
00097
00098     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00099     virtual const GUID & getNodeType() { return thisGuid; }
00100     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00101
00102 public:
00103     // virtual functions go here (for MMCN_*)
00104     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00105
00106     virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle);
00107     virtual HRESULT HasPropertySheets();
00108     virtual HRESULT GetWatermarks(HBITMAP *lphWatermark,
00109                   HBITMAP *lphHeader,
00110                   HPALETTE *lphPalette,
00111                   BOOL *bStretch);
00112
00113     virtual HRESULT OnPropertyChange();
00114
00115 private:
00116   CBicycleFolder *m_parent;
00117     IWbemClassObject *m_inst;
00118
00119     LONG_PTR m_ppHandle;
00120
00121     static BOOL CALLBACK DialogProc(
00122             HWND hwndDlg,  // handle to dialog box
00123             UINT uMsg,     // message
00124             WPARAM wParam, // first message parameter
00125             LPARAM lParam);// second message parameter
00126
00127     // {2974380D-4C4B-11d2-89D8-000021473128}
00128     static const GUID thisGuid;
00129   bool GetGirls(void);
00130   const TCHAR *ConvertSurfaceValue(BYTE val);
00131   HRESULT PutProperty(LPWSTR propName, LPTSTR str);
00132   HRESULT PutProperty(LPWSTR propName, BYTE val);
00133   HRESULT PutProperty(LPWSTR propName, bool val);
00134   void LoadSurfaces(HWND hwndDlg, BYTE iSurface);
00135   BYTE m_iSurface;
00136 };
00137
00138
00139 class CSkateboard : public CDelegationBase {
00140 public:
00141     CSkateboard(int i) : id(i) { }
00142     virtual ~CSkateboard() {}
00143
00144     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00145     virtual const GUID & getNodeType() { return thisGuid; }
00146     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00147
00148 private:
00149     // {2974380D-4C4B-11d2-89D8-000021473128}
00150     static const GUID thisGuid;
00151
00152     int id;
00153 };
00154
00155 class CSkateboardFolder : public CDelegationBase {
00156 public:
00157     CSkateboardFolder();
00158     virtual ~CSkateboardFolder();
00159
00160     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Skateboards"); }
00161     virtual const GUID & getNodeType() { return thisGuid; }
00162     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00163
00164 public:
00165     // virtual functions go here (for MMCN_*)
00166     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00167
00168 private:
00169     // {2974380D-4C4B-11d2-89D8-000021473128}
00170     static const GUID thisGuid;
00171
00172     enum { NUMBER_OF_CHILDREN = 20 };
00173     CDelegationBase *children[NUMBER_OF_CHILDREN];
00174 };
00175
00176 class CIceSkate : public CDelegationBase {
00177 public:
00178     CIceSkate(int i) : id(i) { }
00179     virtual ~CIceSkate() {}
00180
00181     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00182     virtual const GUID & getNodeType() { return thisGuid; }
00183     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00184
00185 private:
00186     // {2974380D-4C4B-11d2-89D8-000021473128}
00187     static const GUID thisGuid;
00188
00189     int id;
00190 };
00191
00192 class CIceSkateFolder : public CDelegationBase {
00193 public:
00194     CIceSkateFolder();
00195     virtual ~CIceSkateFolder();
00196
00197     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Ice Skates"); }
00198     virtual const GUID & getNodeType() { return thisGuid; }
00199     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00200
00201 public:
00202     // virtual functions go here (for MMCN_*)
00203     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00204
00205 private:
00206     // {2974380D-4C4B-11d2-89D8-000021473128}
00207     static const GUID thisGuid;
00208
00209     enum { NUMBER_OF_CHILDREN = 20 };
00210     CDelegationBase *children[NUMBER_OF_CHILDREN];
00211 };
00212
00213 class CPeoplePoweredVehicle : public CDelegationBase {
00214 public:
00215     CPeoplePoweredVehicle();
00216     virtual ~CPeoplePoweredVehicle();
00217
00218     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("People-powered Vehicles"); }
00219     virtual const GUID & getNodeType() { return thisGuid; }
00220     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00221
00222     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00223
00224 private:
00225     enum { IDM_NEW_PEOPLE = 1 };
00226
00227     // {2974380D-4C4B-11d2-89D8-000021473128}
00228     static const GUID thisGuid;
00229
00230     enum { NUMBER_OF_CHILDREN = 3 };
00231     CDelegationBase *children[3];
00232 };
00233
00234 #endif // _PEOPLE_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ActiveDirectory/PropSheetHost/stdafx.h Source File

  • NetDS
  • ActiveDirectory
  • PropSheetHost

stdafx.h

Go to the documentation of this file.
00001 //***************************************************************************
00002 //    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003 //    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 //    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 //    PARTICULAR PURPOSE.
00006 //
00007 //    Copyright Microsoft Corporation. All Rights Reserved.
00008 //***************************************************************************
00009
00010 //***************************************************************************
00011 //
00012 //    File:          stdafx.h
00013 //
00014 //    Description:   Include file for standard system include files, or
00015 //    project specific include files that are used frequently, but are
00016 //    changed infrequently.
00017 //
00018 //***************************************************************************
00019
00020 #pragma once
00021 #pragma warning(push,3)
00022
00023 #define WIN32_LEAN_AND_MEAN   // Exclude rarely-used stuff from Windows headers
00024 // Windows Header Files:
00025 #include <windows.h>
00026 // C RunTime Header Files
00027 #include <stdlib.h>
00028 #include <malloc.h>
00029 #include <memory.h>
00030 #include <tchar.h>
00031
00032 // TODO: reference additional headers your program requires here
00033 #include <commctrl.h>
00034 #include <ole2.h>
00035 #include <atlbase.h>
00036 #include <shlobj.h>
00037 #include <dsclient.h>
00038 #include <vector>
00039 #include <string>
00040 #include <adsprop.h>
00041 #include "PropSheetHost.h"
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FVText.Cpp Source File

  • WinUI
  • Shell
  • FileView

FVText.Cpp

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //    PROGRAM: FVTEXT.CPP
00009 //
00010 //    PURPOSE:  Sample FileViewer for text files to integrate with the Explorer.  This sample serves as a
00011 //    framework for custom viewers.  Initialization and other low-use functions are in FVMISC.CPP.
00012 //
00013 //    PLATFORMS:    Windows 95
00014 //
00015 //    FUNCTIONS:
00016 //
00017 //
00018 //    SPECIAL INSTRUCTIONS: N/A
00019 //
00020
00021 #include "fileview.h"
00022
00023 //
00024 //   FUNCTION: CFileViewer::CFileViewer
00025 //
00026 //   PURPOSE: Constructor for the CFileViewer class.  Initializes all variables.
00027 //
00028 //   PARAMETERS:
00029 //    pUnkOuter - LPUNKNOWN of a controlling unknown.
00030 //    hInst - HINSTANCE of the module we're in
00031 //    pfnDestroy - LPFNDESTROYED to call when an object is destroyed.
00032 //
00033 CFileViewer::CFileViewer(LPUNKNOWN pUnkOuter, HINSTANCE hInst, PFNDESTROYED pfnDestroy)
00034 {
00035     m_cRef=0;
00036     m_pUnkOuter=pUnkOuter;
00037     m_hInst=hInst;
00038     m_pfnDestroy=pfnDestroy;
00039     m_lpfsi = NULL;
00040
00041     //MODIFY:  Change this CLSID to your own
00042     m_clsID=CLSID_FileViewerText;
00043
00044     m_pszPath=NULL;
00045     m_grfMode=0L;
00046     m_fLoadCalled=FALSE;
00047     m_fShowInit=FALSE;
00048     m_fPostQuitMsg=TRUE;
00049
00050     //NULL any contained interfaces initially.
00051     m_pIPersistFile=NULL;
00052     m_pIFileViewer=NULL;
00053     m_pvsi = NULL;
00054
00055     m_pST=NULL;
00056     m_pSH=NULL;
00057     m_fClassReg=FALSE;
00058
00059     m_hWnd=NULL;
00060     m_hWndOld = NULL;
00061     m_hWndToolbar=NULL;
00062     m_hWndStatus=NULL;
00063     m_hWndViewport=NULL;
00064
00065     //MODIFY:  Initalize viewer-specific values
00066     m_hMemText=NULL;
00067     m_hFont=NULL;
00068     m_xPos=0;
00069     m_yPos=0;
00070     return;
00071 }
00072
00073 //
00074 //   FUNCTION:  CFileViewer::~CFileViewer
00075 //
00076 //   PURPOSE:   Destructor:deletes all the windows, all allocations, cleans up objects, and
00077 //   frees the filename copied in IPersistFile::Load.
00078 //
00079 CFileViewer::~CFileViewer(void)
00080 {
00081     //MODIFY:  m_hMemText and m_hFont are viewer-specific.
00082     if (NULL!=m_hMemText)
00083         GlobalFree(m_hMemText);
00084
00085     if (NULL!=m_hFont)
00086         DeleteObject(m_hFont);
00087
00088     //MODIFY:  Do any other viewer-specific cleanup
00089     //Destroying the parent destroys the children as well
00090     if (NULL!=m_hWnd)
00091     {
00092         m_fPostQuitMsg = FALSE;    // Destroy from here implies not from our loop
00093         DestroyWindow(m_hWnd);
00094     }
00095
00096      // Unregistering the classes is important for DLL's because we
00097      // should not assume that whoever loaded us (the task) is going
00098      // to quit anytime soon and unregister the class.  Normally
00099      // QVStub is going to quit, but a test app like TestFV does not
00100      // which can cause some development headaches.
00101     if (m_fClassReg)
00102         {
00103         UnregisterClass(String(IDS_CLASSFRAME),    m_hInst);
00104         UnregisterClass(String(IDS_CLASSVIEWPORT), m_hInst);
00105         }
00106
00107     if (NULL!=m_pSH)
00108         delete m_pSH;
00109
00110     if (NULL!=m_pST)
00111         delete m_pST;
00112
00113     //Free the pathname string from IPersistFile::Load if we got one
00114     MemFree(m_pszPath);
00115
00116     //Free contained interfaces.
00117     if (NULL!=m_pIPersistFile)
00118         delete m_pIPersistFile;
00119
00120     if (NULL!=m_pIFileViewer)
00121         delete m_pIFileViewer;
00122     if (NULL!=m_lpfsi)
00123         m_lpfsi->Release();
00124
00125     return;
00126 }
00127
00128 //
00129 //   FUNCTION: CFileViewer::FileShowInit
00130 //
00131 //   PURPOSE:Provides the implementation of IFileViewer::ShowInitialize that performs
00132 //   anything subject to failure. This function creates the main window, initializes the toolbar,
00133 //   initializes the status bar controls, sets the initial menu state, creates the viewport window, and
00134 //   loads the accelerators.
00135 //
00136 //   RETURN VALUE:
00137 //
00138 //   HRESULT         NOERROR or an appropriate error code.
00139 //
00140 STDMETHODIMP CFileViewer::FileShowInit(LPFILEVIEWERSITE lpfsi)
00141 {
00142     HRESULT         hr;
00143     HMENU           hMenu;
00144
00145     //MODIFY:  Do pre-show initialization here.
00146     if (m_lpfsi != lpfsi)
00147     {
00148         if (NULL!=m_lpfsi)
00149             m_lpfsi->Release();
00150
00151         m_lpfsi = lpfsi;
00152         lpfsi->AddRef();
00153     }
00154
00155     //Default error code
00156     hr=ResultFromScode(E_OUTOFMEMORY);
00157
00158     //Create the main window passing "this" to it
00159     m_hWndOld = m_hWnd;
00160     m_hWnd=CreateWindow(String(IDS_CLASSFRAME)
00161         , String(IDS_CAPTION), WS_MINIMIZEBOX | WS_OVERLAPPEDWINDOW
00162         | WS_CLIPCHILDREN, CW_USEDEFAULT , CW_USEDEFAULT, 350, 450
00163         , NULL, NULL, m_hInst, (LPVOID)this);
00164
00165     if (NULL==m_hWnd)
00166         {
00167         ODS("CFileViewer::FileShow failed to create main window.");
00168         return hr;
00169         }
00170
00171     // Let us accept files.
00172     DragAcceptFiles(m_hWnd, TRUE);
00173
00174     if (!FInitFrameControls())
00175         {
00176         ODS("CFileViewer::FileShow failed to create frame tools.");
00177         return hr;
00178         }
00179
00180     //Set initial view menu item checks
00181     hMenu=GetMenu(m_hWnd);
00182     CheckMenuItem(hMenu, IDM_VIEWTOOLBAR, MF_BYCOMMAND | MF_CHECKED);
00183     CheckMenuItem(hMenu, IDM_VIEWSTATUSBAR, MF_BYCOMMAND | MF_CHECKED);
00184
00185     m_fToolsVisible=TRUE;
00186     m_fStatusVisible=TRUE;
00187
00188     m_pSH->MessageDisplay(ID_MSGREADY);
00189
00190      // ViewportResize puts the viewport window created here
00191      // in the right location, so we don't have to worry
00192      // about initial position.
00193
00194     m_hWndViewport=CreateWindowEx(WS_EX_CLIENTEDGE
00195         , String(IDS_CLASSVIEWPORT), "Viewport"
00196         , WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL
00197         , 0, 0, 100, 100, m_hWnd, (HMENU)ID_VIEWPORT
00198         , m_hInst, (LPVOID)this);
00199
00200     if (NULL==m_hWndViewport)
00201         {
00202         ODS("CFileViewer::FileShow failed to create viewport.");
00203         return hr;
00204         }
00205
00206     ViewportResize();
00207
00208      // Go load the file.  This means pulling into memory whatever
00209      // is necessary for the initial display.
00210     hr=FileLoad();
00211
00212     if (FAILED(hr))
00213         {
00214         ODS("CFileViewer::FileShow failed to load file.");
00215         return hr;
00216         }
00217
00218     m_hAccel=LoadAccelerators(m_hInst
00219         , MAKEINTRESOURCE(IDR_ACCELERATORS));
00220
00221     //Tell IFileViewer::Show it's OK to call it
00222     m_fShowInit=TRUE;
00223     return NOERROR;
00224 }
00225
00226 //
00227 //   FUNCTION:      CFileViewer::FileShow
00228 //
00229 //   PURPOSE: Displays the viewing window and enters a message loop.  This function must not fail.
00230 //
00231 //   PARAMETERS:
00232 //   pvsi - LPFVSHOWINFO indicates how to initially show the FileViewer window.
00233 //
00234 //   RETURN VALUE:
00235 //    HRESULT  - NOERROR always
00236 //
00237 STDMETHODIMP CFileViewer::FileShow(LPFVSHOWINFO pvsi)
00238 {
00239     MSG             msg;
00240
00241     // We need to handle the case where the ShowInitialize may have
00242     // failed and we set the hwnd to NULL and the hwndOld is not NULL.
00243     // and the FVSIF_NEWFAILED is set.  In this case set the hwnd Back
00244     // to the old hwnd...
00245     if ((pvsi->dwFlags & FVSIF_NEWFAILED) && (m_hWnd == NULL))
00246     {
00247         m_hWnd = m_hWndOld;
00248     }
00249
00250     if (!IsWindow (m_hWnd))
00251             return ResultFromScode(E_UNEXPECTED);
00252
00253     m_pvsi = pvsi;
00254
00255     // If the new failed flag was passed to us we know that we got here
00256     // because we tried to view a file and it failed, so simply go back
00257     // to message loop...
00258     if ((pvsi->dwFlags & FVSIF_NEWFAILED) == 0)
00259     {
00260         if (pvsi->dwFlags & FVSIF_RECT)
00261             SetWindowPos(m_hWnd, NULL, pvsi->rect.left, pvsi->rect.top,
00262                     pvsi->rect.right - pvsi->rect.left, pvsi->rect.bottom - pvsi->rect.top,
00263                     SWP_NOZORDER | SWP_NOACTIVATE);
00264         ShowWindow(m_hWnd, pvsi->iShow);
00265
00266         if (SW_HIDE!=pvsi->iShow)
00267         {
00268             SetForegroundWindow(m_hWnd);
00269             UpdateWindow(m_hWnd);
00270         }
00271
00272         // If there is an Old window destroy it now
00273         // It would be nicer to reuse the window!
00274         if (pvsi->dwFlags & FVSIF_PINNED)
00275         {
00276             m_lpfsi->SetPinnedWindow(NULL);
00277             m_lpfsi->SetPinnedWindow(m_hWnd);
00278
00279             HMENU hMenu=GetMenu(m_hWnd);
00280             CheckMenuItem(hMenu, IDM_VIEWREPLACE, MF_BYCOMMAND|MF_CHECKED);
00281         }
00282
00283         if (SW_HIDE!=pvsi->iShow)
00284             UpdateWindow(m_hWnd);
00285
00286         if ((NULL!=m_hWndOld) && IsWindow(m_hWndOld))
00287         {
00288             ODS("CFileViewer::FileShow Destroy Previous hwnd");
00289             m_fPostQuitMsg = FALSE; // Don't destroy the queue for this one.
00290             DestroyWindow(m_hWndOld);
00291             m_hWndOld = NULL;
00292         }
00293
00294         if (NULL!=pvsi->punkRel)
00295         {
00296             ODSlu("CFileViewer::FileShow Release of previous viewers punkRel(%x)", pvsi->punkRel);
00297             pvsi->punkRel->Release();
00298             pvsi->punkRel = NULL;
00299         }
00300     }
00301
00302     while (GetMessage(&msg, NULL, 0,0 ))
00303         {
00304         if (!TranslateAccelerator(m_hWnd, m_hAccel, &msg))
00305             {
00306             TranslateMessage(&msg);
00307             DispatchMessage(&msg);
00308             }
00309         // If there is a new file bail out now.
00310         if (m_pvsi->dwFlags & FVSIF_NEWFILE)
00311             break;
00312         }
00313
00314     //MODIFY:  Perform cleanup here.
00315     return NOERROR;
00316 }
00317
00318 //
00319 //   FUNCTION:     CFileViewer::PrintTo
00320 //
00321 //   PURPOSE:  Provides the implementation of IFileViewer::PrintTo that
00322 //  prints the file to a given printer driver, suppressing UI
00323 //  if necessary.  This function currently does nothing.
00324 //
00325 //   PARAMETERS:
00326 //    pszDriver - LPSTR with the path of the driver to use.  If NULL, use the default driver.
00327 //    fSuppressUI - BOOL indicating if this function is to show any  UI or not.
00328 //
00329 //   RETURN VALUE:
00330 //   HRESULT - NOERROR on success, error code otherwise.
00331 //
00332 STDMETHODIMP CFileViewer::PrintTo(LPSTR pszDriver, BOOL fSuppressUI)
00333     {
00334     //Printing not implemented in this sample
00335     //MODIFY:  Add your printing code here.
00336     return ResultFromScode(E_NOTIMPL);
00337 }
00338
00339 //
00340 //   FUNCTION:      CFileViewer::FileLoad
00341 //
00342 //   PURPOSE: Loads the file with the path in m_pszPath and places the
00343 //   contents into the m_hWndViewport window.  This function can load
00344 //   a compound file with a "Text" stream or text from a .TXT file.
00345 //
00346 HRESULT CFileViewer::FileLoad(void)
00347 {
00348     HRESULT     hr;
00349     HGLOBAL     hMem=NULL;
00350     LPSTR       psz;
00351     OLECHAR     szwFile[512];
00352
00353     //MODIFY: Load your own file type here.
00354     if (NULL==m_pszPath)
00355         return ResultFromScode(E_UNEXPECTED);
00356
00357      // This FileViewer is registered for a .TXT extension that
00358      // is either in a compound file (single stream called "Text"
00359      // or in a flat text file.  This sample is meant to show
00360      // how to open and work with both types of files.
00361     //Make Unicode copy of filename
00362     mbstowcs(szwFile, m_pszPath, sizeof(szwFile)/sizeof(szwFile[0]));
00363
00364      // CAREFUL:  StgIsStorageFile returns S_FALSE if not--
00365      //           don't use SUCCEEDED to test the return value!
00366     if (NOERROR==StgIsStorageFile(szwFile))
00367         {
00368         LPSTORAGE   pIStorage=NULL;
00369         LPSTREAM    pIStream=NULL;
00370         STATSTG     stat;
00371
00372         //Case for a compound file, open it and the text stream
00373         hr=StgOpenStorage(szwFile, NULL, m_grfMode, NULL, 0
00374             , &pIStorage);
00375
00376         if (FAILED(hr))
00377             {
00378             ODS("CFileViewer::FileLoad failed StgOpenStorage");
00379             return hr;
00380             }
00381
00382         mbstowcs(szwFile, "Text", sizeof(szwFile));
00383
00384         hr=pIStorage->OpenStream(szwFile, 0, STGM_DIRECT | STGM_READ
00385             | STGM_SHARE_EXCLUSIVE, 0, &pIStream);
00386
00387         if (SUCCEEDED(hr))
00388             {
00389             //Determine the amount of text and allocate memory
00390             hr=pIStream->Stat(&stat, STATFLAG_NONAME);
00391
00392             if (SUCCEEDED(hr))
00393                 {
00394                 hMem=GlobalAlloc(GHND, stat.cbSize.LowPart+1);
00395
00396                 if (NULL!=hMem)
00397                     {
00398                      // Now load the text into the controls.
00399                      // GlobalLock will always work because we
00400                      // allocated at least 1 byte.
00401                     psz=(LPSTR)GlobalLock(hMem);
00402                     hr=pIStream->Read((LPVOID)psz
00403                         , stat.cbSize.LowPart, NULL);
00404                     GlobalUnlock(hMem);
00405                     }
00406                 else
00407                     {
00408                     ODS("CFileViewer::FileLoad failed to allocate memory");
00409                     hr=ResultFromScode(E_OUTOFMEMORY);
00410                     }
00411                 }
00412
00413             pIStream->Release();
00414             }
00415         else
00416             {
00417             ODS("CFileViewer::FileLoad failed StgOpenStorage");
00418             }
00419
00420         pIStorage->Release();
00421         }
00422     else
00423         {
00424         int         hFile=NULL;
00425         OFSTRUCT    of;
00426         DWORD       cb, cbRead;
00427
00428          // Case for straight text file, open and read.  In opening
00429          // the file, mask off the upper word or m_grfMode which
00430          // contains the compound file specific flags.  The lower
00431          // word has OpenFile flags (consistent between
00432          // StgOpenStorage and OpenFile).
00433         hFile=OpenFile(m_pszPath, &of
00434             , (UINT)(m_grfMode & 0x0000FFFF));
00435
00436         if (HFILE_ERROR==hFile)
00437             {
00438             ODS("CFileViewer::FileLoad failed OpenFile");
00439             return ResultFromScode(STG_E_FILENOTFOUND);
00440             }
00441
00442         //Scan to end and then back to determine file size.
00443         cb=_llseek(hFile, 0L, 2);
00444         _llseek(hFile, 0L, 0);
00445
00446         hMem=GlobalAlloc(GHND, cb+1);
00447
00448         if (NULL!=hMem)
00449             {
00450              // Now load the text into the controls.  GlobalLock will
00451              // always work because we allocated at least 1 byte
00452             psz=(LPSTR)GlobalLock(hMem);
00453             cbRead=_lread(hFile, psz, (UINT)cb);
00454             GlobalUnlock(hMem);
00455
00456             hr=ResultFromScode((cb==cbRead) ? S_OK : STG_E_READFAULT);
00457             }
00458         else
00459             {
00460             ODS("CFileViewer::FileLoad failed to allocate memory");
00461             hr=ResultFromScode(E_OUTOFMEMORY);
00462             }
00463
00464         _lclose(hFile);
00465         }
00466
00467     //Set edit control to read-only:  no modifications allowed!
00468     if (SUCCEEDED(hr) && NULL!=hMem)
00469         {
00470         if (NULL!=m_hMemText)
00471             GlobalFree(m_hMemText);
00472
00473         //Make the text current and repaint.
00474         m_hMemText=hMem;
00475         InvalidateRect(m_hWndViewport, NULL, TRUE);
00476         UpdateWindow(m_hWndViewport);
00477         }
00478
00479     return hr;
00480 }
00481
00482 //
00483 //   FUNCTION:     CFileViewer::OnCommand
00484 //
00485 //   PURPOSE: WM_COMMAND message handler for a FileViewer window.
00486 //
00487 //   PARAMETERS:
00488 //       wID             WORD ID of the command.
00489 //  wCode           WORD notification code with the command
00490 //  hWndCtl         HWND sending the message (if a control)
00491 //
00492 void CFileViewer::OnCommand(WORD wID, WORD wCode, HWND hWndCtl)
00493 {
00494     //MODIFY:  Do your command processing here.
00495     switch (wID)
00496         {
00497         case IDM_FILEOPENAS:
00498             if (FOpenAs())
00499                 PostMessage(m_hWnd, WM_CLOSE, 0, 0L);
00500             break;
00501
00502         case IDM_FILEPAGESETUP:
00503             //Not implemented in this sample
00504             break;
00505
00506         case IDM_FILEPRINT:
00507             //Not implemented in this sample
00508             break;
00509
00510         case IDM_FILEEXIT:
00511             PostMessage(m_hWnd, WM_CLOSE, 0, 0L);
00512             break;
00513
00514         case IDM_VIEWTOOLBAR:
00515             m_fToolsVisible=!m_fToolsVisible;
00516
00517             CheckMenuItem(GetMenu(m_hWnd), IDM_VIEWTOOLBAR
00518                 , MF_BYCOMMAND | (m_fToolsVisible
00519                 ? MF_CHECKED : MF_UNCHECKED));
00520
00521             ShowWindow(m_hWndToolbar, m_fToolsVisible
00522                 ? SW_SHOW : SW_HIDE);
00523
00524             //Resize the viewport window
00525             ViewportResize();
00526             break;
00527
00528         case IDM_VIEWSTATUSBAR:
00529             m_fStatusVisible=!m_fStatusVisible;
00530
00531             CheckMenuItem(GetMenu(m_hWnd), IDM_VIEWSTATUSBAR
00532                 , MF_BYCOMMAND | (m_fStatusVisible
00533                 ? MF_CHECKED : MF_UNCHECKED));
00534
00535             ShowWindow(m_hWndStatus, m_fStatusVisible
00536                 ? SW_SHOW : SW_HIDE);
00537
00538             //Resize the viewport window
00539             ViewportResize();
00540             break;
00541         case IDM_VIEWREPLACE:
00542             // Switch the Replace mode
00543             ReplaceWindowModeChange();
00544             break;
00545         case IDM_VIEWFONT:
00546             FontChange(VIEWFONT_SELECT);
00547             break;
00548
00549         case IDM_VIEWFONTINCREASE:
00550             FontChange(VIEWFONT_INCREASESIZE);
00551             break;
00552
00553         case IDM_VIEWFONTDECREASE:
00554             FontChange(VIEWFONT_DECREASESIZE);
00555             break;
00556
00557         case IDM_HELPCONTENTS:
00558             MessageBox(m_hWnd, String(IDS_NOHELP)
00559                 , String(IDS_CAPTION), MB_OK);
00560             break;
00561
00562         case IDM_HELPABOUT:
00563             DialogBox(m_hInst, MAKEINTRESOURCE(IDD_ABOUT), m_hWnd
00564                 , (DLGPROC)AboutProc);
00565             break;
00566         }
00567
00568     return;
00569 }
00570
00571 //
00572 //   FUNCTION:  CFileViewer::ChildrenResize
00573 //
00574 //   PURPOSE:    Handles the situation when the FileViewer frame window was
00575 //   resized. The toolbar, status bar and viewport are resized via a call to the
00576 //   the ViewportResize function.
00577 //
00578 //   COMMENTS:
00579 //   Note that the toolbar and status bar are resized even when
00580 //   they are not visible so we can just reshow them again when
00581 //   necessary.
00582 //
00583 void CFileViewer::ChildrenResize(void)
00584 {
00585     RECT        rc;
00586
00587     GetClientRect(m_hWnd, &rc);
00588
00589     //We resize toolbar and status bar regardless of visibility
00590     SetWindowPos(m_hWndToolbar, NULL, 0, 0
00591         , rc.right-rc.left, m_cyTools
00592         , SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
00593
00594     SetWindowPos(m_hWndStatus, NULL, 0, rc.bottom-m_cyStatus
00595         , rc.right-rc.left, m_cyStatus
00596         , SWP_NOZORDER | SWP_NOACTIVATE);
00597
00598     ViewportResize();
00599     return;
00600 }
00601
00602 //
00603 //   FUNCTION: CFileViewer::ViewportResize
00604 //
00605 //   PURPOSE: Updates the size and position of the viewport window
00606 //   depending on visibility of the toolbar and status bar.
00607 //
00608 void CFileViewer::ViewportResize(void)
00609 {
00610     RECT        rc;
00611     UINT        dy1, dy2;
00612
00613     GetClientRect(m_hWnd, &rc);
00614
00615     dy1=m_fToolsVisible  ? m_cyTools  : 0;
00616     dy2=m_fStatusVisible ? m_cyStatus : 0;
00617
00618     //We resize toolbar and status bar regardless of visibility
00619     SetWindowPos(m_hWndViewport, NULL, 0, dy1
00620         , rc.right-rc.left, rc.bottom-rc.top-dy1-dy2
00621         , SWP_NOZORDER | SWP_NOACTIVATE);
00622
00623     ViewportScrollSet();
00624     return;
00625 }
00626
00627 //
00628 //   FUNCTION:     CFileViewer::ViewportScrollSet
00629 //
00630 //   PURPOSE:  Updates the scrollbar ranges in the viewport depending on
00631 //   the current font in use and the size of the window.
00632 //
00633 void CFileViewer::ViewportScrollSet(void)
00634 {
00635     RECT        rc, rcFmt;
00636     LPSTR       psz;
00637     HDC         hDC;
00638     HFONT       hFont;
00639     SCROLLINFO  si;
00640
00641     if (NULL==m_hMemText)
00642         return;
00643
00644     psz=(LPSTR)GlobalLock(m_hMemText);
00645     hDC=GetDC(m_hWndViewport);
00646     hFont=(HFONT)SelectObject(hDC, m_hFont);
00647
00648      // Set initially large formatting rectangle, and let
00649      // DrawText walk all over it.
00650     SetRect(&rcFmt, 0, 0, 32767, 32767);
00651     DrawText(hDC, psz, -1, &rcFmt, DT_LEFT | DT_CALCRECT
00652         | DT_EXPANDTABS);
00653
00654     SelectObject(hDC, hFont);
00655     ReleaseDC(m_hWndViewport, hDC);
00656
00657     GetClientRect(m_hWndViewport, &rc);
00658
00659     //Scroll ranges are draw rect minus visible rect, +1 for buffer
00660     // First set the horizontal scrollbars information...
00661     si.cbSize = sizeof(si);
00662     si.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
00663     si.nMin = 0;
00664     si.nMax = (rcFmt.right-rcFmt.left)+1;
00665     si.nPage = rc.right;
00666     si.nPos = 0;
00667     SetScrollInfo(m_hWndViewport, SB_HORZ, &si, TRUE);
00668     m_xPos=0;
00669
00670     // Now Set the vertical scrollbar
00671     si.nMax = (rcFmt.bottom-rcFmt.top)+1;
00672     si.nPage = rc.bottom;
00673     SetScrollInfo(m_hWndViewport, SB_VERT, &si, TRUE);
00674     m_yPos=0;
00675
00676     GlobalUnlock(m_hMemText);
00677     return;
00678 }
00679
00680 //
00681 //   FUNCTION: CFileViewer::FOpenAs
00682 //
00683 //   PURPOSE:  Attempts to launch an application to open the file for editing.
00684 //
00685 //   RETURN VALUE:
00686 //   BOOL -  TRUE if the application is opened in which case
00687 //                  the FileViewer can shut down.  Otherwise FALSE
00688 //                  meaning launching failed.
00689 //
00690 BOOL CFileViewer::FOpenAs(void)
00691 {
00692     SHELLEXECUTEINFO sei = {sizeof(sei), 0, m_hWnd, "open",
00693             m_pszPath, NULL, NULL, SW_SHOWNORMAL, m_hInst};
00694
00695     return ShellExecuteEx(&sei);
00696 }
00697
00698 //
00699 //   FUNCTION:     CFileViewer::FontChange
00700 //
00701 //   PURPOSE:  Either allows the user to choose a font or increments or
00702 //  decrements the font size depending on uOpt.  This is all
00703 //  handled in one function here because each operation
00704 //  involves obtaining the current viewport font, messing with
00705 //  it in some way, and setting a new font again.
00706 //
00707 //   PARAMETERS:
00708 //     uOpt          VIEWFONTOPTION of the way to change the font:
00709 //                      VIEWFONT_SELECT     Display dialog
00710 //                      VIEWFONT_INCREASE   Increase size by 2pt
00711 //                      VIEWFONT_DECREASE   Decreate size by 2pt
00712 //
00713 void CFileViewer::FontChange(VIEWFONTOPTION uOpt)
00714 {
00715     HFONT       hFont;
00716     LOGFONT     lf;
00717     CHOOSEFONT  cf;
00718     BOOL        fChange=TRUE;
00719     int         z;
00720
00721      // We have a system font from the constructor, so m_hFont
00722      // will never be NULL, but assert it anyway.
00723     D(if (NULL==m_hFont) ODS("Assertion Failed:  m_hFont is NULL"););
00724
00725     GetObject(m_hFont, sizeof(lf), &lf);
00726      // Each option is responsible for manipulating
00727      // the LOGFONT structure in some way.  If there
00728      // is nothing to do, they set fChange to FALSE
00729     switch (uOpt)
00730         {
00731         case VIEWFONT_SELECT:
00732             memset(&cf, 0, sizeof(CHOOSECOLOR));
00733             cf.lStructSize=sizeof(CHOOSECOLOR);
00734             cf.hwndOwner  =m_hWnd;
00735             cf.lpLogFont  =&lf;
00736             cf.nSizeMin   =FONTSIZETHRESHOLDMIN;
00737             cf.nSizeMax   =FONTSIZETHRESHOLDMAX;
00738
00739             cf.Flags=CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT
00740                 | CF_FORCEFONTEXIST;
00741
00742             if (!ChooseFont(&cf))
00743                 {
00744                 D(DWORD dwErr=CommDlgExtendedError();
00745                 ODSlu("FVTEXT.DLL:  ChooseFont failed with %lu", dwErr););
00746
00747                 fChange=FALSE;
00748                 }
00749
00750             break;
00751
00752
00753         case VIEWFONT_INCREASESIZE:
00754             //Convert logical size to point size.
00755             z=MulDiv(-lf.lfHeight, 72, m_cyPPI);
00756
00757             //Vary the size increase depending on point size.
00758             if (z < FONTSIZETHRESHOLDMAX)
00759                 {
00760                 if (z < FONTSIZETHRESHOLDLOW)
00761                     z+=FONTSIZEDELTASMALL;
00762                 else
00763                     {
00764                     if (z < FONTSIZETHRESHOLDMID)
00765                         z+=FONTSIZEDELTAMEDIUM;
00766                     else
00767                         z+=FONTSIZEDELTALARGE;
00768                     }
00769
00770                 //Convert point size to logical size.
00771                 lf.lfHeight=MulDiv(-z, m_cyPPI, 72);
00772                 }
00773             else
00774                 fChange=FALSE;
00775
00776             break;
00777
00778         case VIEWFONT_DECREASESIZE:
00779             //Convert logical size to point size.
00780             z=MulDiv(-lf.lfHeight, 72, m_cyPPI);
00781
00782             //Vary the size decrease depending on point size.
00783             if (z > FONTSIZETHRESHOLDMIN)
00784                 {
00785                 if (z > FONTSIZETHRESHOLDMID)
00786                     z-=FONTSIZEDELTALARGE;
00787                 else
00788                     {
00789                     if (z > FONTSIZETHRESHOLDLOW)
00790                         z-=FONTSIZEDELTAMEDIUM;
00791                     else
00792                         z-=FONTSIZEDELTASMALL;
00793                     }
00794
00795                 //Convert point size to logical size.
00796                 lf.lfHeight=MulDiv(-z, m_cyPPI, 72);
00797                 }
00798             else
00799                 fChange=FALSE;
00800
00801             break;
00802
00803         default:
00804             fChange=FALSE;
00805         }
00806
00807     //Return now if we didn't change anything.
00808     if (!fChange)
00809         return;
00810
00811     //Now switch fonts and update the viewport.
00812     hFont=CreateFontIndirect(&lf);
00813
00814     if (NULL!=hFont)
00815         {
00816         if (NULL!=m_hFont)
00817             DeleteObject(m_hFont);
00818
00819         m_hFont=hFont;
00820
00821         ViewportScrollSet();
00822
00823         //Repaint the viewport
00824         InvalidateRect(m_hWndViewport, NULL, TRUE);
00825         UpdateWindow(m_hWndViewport);
00826         }
00827
00828     return;
00829 }
00830
00831 //
00832 //   FUNCTION:     CFileViewer::ReplaceWindowModeChange
00833 //
00834 //   PURPOSE: Sets the window to be pinned or not to be pinned.  When the
00835 //   window is pinned, the caller of the viewers will attempt
00836 //   to replace the contents of the window instead of creating
00837 //   new windows.
00838 //
00839 void CFileViewer::ReplaceWindowModeChange(void)
00840 {
00841     HWND hwnd;
00842     UINT  uCheck = MF_BYCOMMAND;
00843
00844     if (m_lpfsi)
00845     {
00846         m_lpfsi->GetPinnedWindow(&hwnd);
00847         if ((HWND)NULL==hwnd)
00848         {
00849             m_lpfsi->SetPinnedWindow(m_hWnd);
00850             uCheck = MF_BYCOMMAND | MF_CHECKED;
00851         }
00852         else
00853         {
00854             if (hwnd==m_hWnd)
00855                 m_lpfsi->SetPinnedWindow(NULL);
00856         }
00857
00858     }
00859
00860     HMENU hMenu=GetMenu(m_hWnd);
00861     CheckMenuItem(hMenu, IDM_VIEWREPLACE, uCheck);
00862 }
00863
00864 //
00865 //   FUNCTION: CFileViewer::DropFiles
00866 //
00867 //   PURPOSE:   Processes a drop
00868 //
00869 BOOL    CFileViewer::DropFiles (HDROP hdrop)
00870 {
00871     // We should now proces the files that were dropped on us
00872     char    szPath[MAX_PATH];
00873     int     cb;
00874
00875     // For now only process the first file.
00876     if (DragQueryFile(hdrop, 0, szPath, sizeof(szPath)) > 0)
00877     {
00878         ODSsz("CFileViewer::DropFiles filename=%s", szPath);
00879
00880         // Need to convert the string to ole string...
00881         cb = (lstrlen(szPath)+1) * sizeof(OLECHAR);
00882         mbstowcs(m_pvsi->strNewFile, szPath, cb);
00883
00884         // Now get the window rectangle to use to display this in...
00885         GetWindowRect(m_hWnd, &m_pvsi->rect);
00886         m_pvsi->dwFlags |= (FVSIF_RECT | FVSIF_NEWFILE);
00887
00888         // Should check for failure but now sure what to do with it anyway
00889         QueryInterface(IID_IUnknown, (LPVOID *)&m_pvsi->punkRel);
00890         ODSlu("CFileViewer::DropFiles Query Interface(%x)", m_pvsi->punkRel);
00891     }
00892
00893     DragFinish(hdrop);
00894     return TRUE;
00895 }
00896
00897 //
00898 //   FUNCTION: CFileViewer::PszToolTip
00899 //
00900 //   PURPOSE: Returns a string pointer to a tool tip for the given command
00901 //   ID value.  When asked for a string we also display a similar
00902 //   one in the status bar.
00903 //
00904 //   PARAMETERS:
00905 //   uID - UINT of the toolbar button command.
00906 //
00907 //   RETURN VALUE:
00908 //   LPSTR - Pointer to the string to display.
00909 //
00910 LPSTR CFileViewer::PszToolTip(UINT uID)
00911 {
00912     UINT        iString, iStatusMsg;
00913
00914     switch (uID)
00915         {
00916         case IDM_FILEOPENAS:
00917             iString=IDS_TOOLTIPOPENAS;
00918             iStatusMsg=IDM_FILEOPENAS;
00919             break;
00920
00921         case IDM_VIEWFONTINCREASE:
00922             iString=IDS_TOOLTIPFONTINC;
00923             iStatusMsg=ID_TIPFONTINC;
00924             break;
00925
00926         case IDM_VIEWFONTDECREASE:
00927             iString=IDS_TOOLTIPFONTDEC;
00928             iStatusMsg=ID_TIPFONTDEC;
00929             break;
00930
00931         default:
00932             return NULL;
00933         }
00934
00935     m_pSH->MessageDisplay(iStatusMsg);
00936     return String(iString);
00937 }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLinkable Member List

This is the complete list of members for CLinkable, including all inherited members.
CLinkable() | CLinkable | [inline]
InsertAfter(CLinkable *other) | CLinkable |
InsertBefore(CLinkable *other) | CLinkable |
IsLinked() | CLinkable | [inline]
m_pNext | CLinkable | [private]
m_pPrev | CLinkable | [private]
Next() | CLinkable | [inline]
Previous() | CLinkable | [inline]
Remove() | CLinkable |
~CLinkable() | CLinkable | [inline]
Generated on Wed Nov 13 2024 16:56:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/registry.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

registry.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef __Registry_H__
00015 #define __Registry_H__
00016
00017 #include <tchar.h>
00018
00019 // This function will register a component in the Registry.
00020 // The component calls this function from its DllRegisterServer function.
00021 HRESULT RegisterServer( HMODULE hModule,
00022                         const CLSID& clsid,
00023                         const TCHAR* szFriendlyName) ;
00024
00025 // This function will unregister a component.  Components
00026 // call this function from their DllUnregisterServer function.
00027 HRESULT UnregisterServer( const CLSID& clsid ) ;
00028
00029
00030 // This function will register a Snap-In component.  Components
00031 // call this function from their DllRegisterServer function.
00032 HRESULT RegisterSnapin( const CLSID& clsid,            // Class ID
00033                         const TCHAR* szNameString,     // NameString
00034                         const CLSID& clsidAbout,       // Class Id for About Class
00035                         const BOOL fSupportExtensions = FALSE
00036                       );
00037
00038 HRESULT UnregisterSnapin( const CLSID& clsid );        // Class ID
00039
00040 #endif //__Registry_H__
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/step3.cpp Source File

  • Dataaccess
  • oledb
  • tablecopy

step3.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1995-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module STEP3.CPP
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011
00012
00013 /////////////////////////////////////////////////////////////////////
00014 // Includes
00015 //
00016 /////////////////////////////////////////////////////////////////////
00017 #include "wizard.h"
00018 #include "common.h"
00019 #include "Tablecopy.h"
00020 #include "Table.h"
00021
00022
00023 /////////////////////////////////////////////////////////////////////
00024 // CS3Dialog::CS3Dialog
00025 //
00026 /////////////////////////////////////////////////////////////////////
00027 CS3Dialog::CS3Dialog(HWND hWnd, HINSTANCE hInst, CTableCopy* pCTableCopy)
00028   : CDialogBase(hWnd, hInst)
00029 {
00030   ASSERT(pCTableCopy);
00031   m_pCTableCopy = pCTableCopy;
00032 }
00033
00034
00035 /////////////////////////////////////////////////////////////////////
00036 // CS3Dialog::~CS3Dialog
00037 //
00038 /////////////////////////////////////////////////////////////////////
00039 CS3Dialog::~CS3Dialog()
00040 {
00041 }
00042
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045 // ULONG CS3Dialog::Display
00046 //
00047 /////////////////////////////////////////////////////////////////////////////
00048 ULONG CS3Dialog::Display()
00049 {
00050   //Create a modal dialog box
00051   return DialogBoxParam(m_hInst, MAKEINTRESOURCE(IDD_TO_INFO), NULL, DlgProc, (LPARAM)this);
00052 }
00053
00054
00055 /////////////////////////////////////////////////////////////////////
00056 // CS3Dialog::DlgProc
00057 //
00058 /////////////////////////////////////////////////////////////////////
00059 BOOL WINAPI CS3Dialog::DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
00060 {
00061   static WCHAR  wszBuffer[MAX_NAME_LEN+1];
00062
00063   switch(msg)
00064   {
00065     case WM_INITDIALOG:
00066     {
00067       Busy();
00068       //Store the "this" pointer, since this is a static method
00069       CS3Dialog* pThis = (CS3Dialog*)lParam;
00070       SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00071
00072       //On INIT we know we have a valid hWnd to store
00073       CenterDialog(hWnd);
00074       pThis->m_hWnd = hWnd;
00075
00076       //Init all controls to the default values
00077       pThis->InitControls();
00078
00079       //Limit the length of User Entered TableName
00080       SendDlgItemMessage(hWnd, IDE_TO_TABLE, EM_LIMITTEXT, (WPARAM)MAX_NAME_LEN-1, 0L);
00081
00082       pThis->RefreshControls();
00083       pThis->m_pCTableCopy->m_pCWizard->DestroyPrevStep(WIZ_STEP3);
00084       return HANDLED_MSG;
00085     }
00086
00087     case WM_COMMAND:
00088     {
00089       //Obtain the "this" pointer
00090       CS3Dialog* pThis = (CS3Dialog*)GetWindowLong(hWnd, GWL_USERDATA);
00091
00092       CTable    *pCFromTable    = pThis->m_pCTableCopy->m_pCFromTable;
00093       CTable    *pCToTable      = pThis->m_pCTableCopy->m_pCToTable;
00094       CDataSource *pCToDataSource   = pCToTable->m_pCDataSource;
00095       CDataSource *pCFromDataSource = pCFromTable->m_pCDataSource;
00096
00097       // All buttons are handled the same way
00098       switch(GET_WM_COMMAND_ID(wParam, lParam))
00099       {
00100         case IDB_TO_CONNECT:
00101         {
00102           //kill implicit connection
00103           pCToDataSource->Disconnect();
00104
00105           //on connect get whatever is now listed in the drop down
00106           LONG iSel = 0;
00107           if((iSel = SendMessage(GetDlgItem(pThis->m_hWnd, IDC_PROVIDER_NAME), CB_GETCURSEL, 0, 0L)) != CB_ERR)
00108           {
00109             //Since we have the CBS_SORT turned on, the order in the Combo Box does
00110             //not match our array, so we pass the array index (lParam) as the item data
00111             LONG lParam = SendMessage(GetDlgItem(pThis->m_hWnd, IDC_PROVIDER_NAME), CB_GETITEMDATA, iSel, 0L);
00112             pCFromTable->m_pCDataSource->m_pwszProviderName = pCFromDataSource->m_rgProviderInfo[lParam].wszName;
00113 /*            if((lParam < (LONG)pCToDataSource->m_cProviderInfo) && (wcscmp(pCFromDataSource->m_rgProviderInfo[lParam].wszName, pCFromDataSource->m_pwszProviderName)!=0))
00114             {
00115               //Clear Table/Column List Views
00116               SendMessage(GetDlgItem(hWnd, IDL_TABLES), TVM_DELETEITEM, (WPARAM)0, (LPARAM)TVI_ROOT);
00117               SendMessage(GetDlgItem(hWnd, IDL_COLUMNS), LVM_DELETEALLITEMS, (WPARAM)0, (LPARAM)0);
00118
00119               //Clear Table info
00120               memset(&pCToTable->m_TableInfo, 0, sizeof(TABLEINFO));
00121               pCToTable->m_wszQualTableName[0] = EOL;
00122
00123               //Disconnect from the DataSource and Update controls
00124               pCToTable->m_pCDataSource->Disconnect();
00125             }
00126 */          }
00127           else
00128           {
00129             //The user must have typed in a Provider Name directly
00130             //This may not map to a provider in the list, so assume the name is a ProgID/CLSID
00131             wSendMessage(GetDlgItem(pThis->m_hWnd, IDC_PROVIDER_NAME), WM_GETTEXT, MAX_NAME_LEN, wszBuffer);
00132             pCToTable->m_pCDataSource->m_pwszProviderName = wszBuffer;
00133           }
00134           Busy();
00135           if(pThis->Connect())
00136           {
00137             Busy();
00138             pThis->RefreshControls();
00139             SetFocus(GetDlgItem(hWnd, IDE_TO_TABLE));
00140             SendMessage(GetDlgItem(hWnd, IDE_TO_TABLE), EM_SETSEL, 0, -1); //Highlight TableName
00141           }
00142           return HANDLED_MSG;
00143         }
00144
00145                 case IDOK:
00146         {
00147           //Get the TableName
00148           Busy();
00149           wSendMessage(GetDlgItem(hWnd, IDE_TO_TABLE), WM_GETTEXT, MAX_NAME_LEN-1, pCToTable->m_TableInfo.wszTableName);
00150
00151           //If the TableNames are the same (ignoring case) and the
00152           //DataSource is the same then the copy is worthless (a no-op)
00153           if(_wcsicmp(pCToTable->m_TableInfo.wszTableName, pCFromTable->m_TableInfo.wszTableName)==0 &&
00154             pCToDataSource->IsEqual(pCFromDataSource))
00155           {
00156             //Need to enter a different table name from the source
00157             wMessageBox(hWnd, MB_TASKMODAL | MB_ICONEXCLAMATION | MB_OK,
00158               wsz_ERROR, wsz_SAME_TABLE_NAME, pCToDataSource->m_pwszTableTerm);
00159             SetFocus(GetDlgItem(hWnd, IDE_TO_TABLE));
00160             SendMessage(GetDlgItem(hWnd, IDE_TO_TABLE), EM_SETSEL, 0, -1); //Highlight TableName
00161             return HANDLED_MSG;
00162           }
00163
00164           wcscpy(pCToTable->m_wszQualTableName, pCToTable->m_TableInfo.wszTableName);
00165           pThis->m_pCTableCopy->m_pCWizard->DisplayStep(WIZ_STEP4);
00166           return HANDLED_MSG;
00167         }
00168
00169                 case IDB_PREV:
00170           //Get the TableName
00171           Busy();
00172           wSendMessage(GetDlgItem(hWnd, IDE_TO_TABLE), WM_GETTEXT, MAX_NAME_LEN-1, pCToTable->m_TableInfo.wszTableName);
00173           wcscpy(pCToTable->m_wszQualTableName,pCToTable->m_TableInfo.wszTableName);
00174           pThis->m_pCTableCopy->m_pCWizard->DisplayStep(WIZ_STEP2);
00175                   return HANDLED_MSG;
00176
00177         case IDCANCEL:
00178           Busy();
00179                   EndDialog(hWnd, GET_WM_COMMAND_ID(wParam, lParam));
00180                   return HANDLED_MSG;
00181       }
00182
00183       // Now look for notification messages
00184       switch(GET_WM_COMMAND_CMD(wParam, lParam))
00185       {
00186         case LBN_SELCHANGE:
00187         {
00188 /*          //A Provider Change requires a refresh
00189           if(IDC_PROVIDER_NAME == GET_WM_COMMAND_ID(wParam, lParam))
00190           {
00191             //Get new selection
00192             Busy();
00193             LONG iSel = 0;
00194             if((iSel = SendMessage(GetDlgItem(pThis->m_hWnd, IDC_PROVIDER_NAME), CB_GETCURSEL, 0, 0L)) != CB_ERR)
00195             {
00196               //Since we have the CBS_SORT turned on, the order in the Combo Box does
00197               //not match our array, so we pass the array index (lParam) as the item data
00198               LONG lParam = SendMessage(GetDlgItem(pThis->m_hWnd, IDC_PROVIDER_NAME), CB_GETITEMDATA, iSel, 0L);
00199               if((lParam < (LONG)pCToDataSource->m_cProviderInfo) && (wcscmp(pCToDataSource->m_rgProviderInfo[lParam].wszName, pCToDataSource->m_pwszProviderName)!=0))
00200               {
00201                 pCToDataSource->Disconnect();
00202               }
00203             }
00204           }
00205
00206           pThis->RefreshControls();
00207 */        }
00208
00209         case EN_CHANGE:
00210         {
00211           pThis->EnableTable();
00212           return HANDLED_MSG;
00213         }
00214       }
00215     }
00216   }
00217
00218   return UNHANDLED_MSG;
00219 }
00220
00221
00222
00223
00224 /////////////////////////////////////////////////////////////////////////////
00225 // BOOL CS3Dialog::InitControls
00226 //
00227 /////////////////////////////////////////////////////////////////////////////
00228 BOOL CS3Dialog::InitControls()
00229 {
00230   //Initialize the Provider List (if not done so already)
00231   CDataSource* pCDataSource = m_pCTableCopy->m_pCToTable->m_pCDataSource;
00232   CDataSource* pCFromDataSource = m_pCTableCopy->m_pCFromTable->m_pCDataSource;
00233
00234   if(pCDataSource->m_rgProviderInfo == NULL)
00235     pCDataSource->GetProviders();
00236
00237   WCHAR wszBuffer[MAX_NAME_LEN*2];
00238   HWND hWndProv = GetDlgItem(m_hWnd, IDC_PROVIDER_NAME);
00239
00240   //Fill out the provider name combo box.
00241   for(ULONG i=0; i<pCDataSource->m_cProviderInfo; i++)
00242   {
00243     //Add the name to the list
00244     //Since we have the CBS_SORT turned on, the order in the Combo Box does
00245     //not match our array, so we pass the array index (lParam) as the item data
00246     swprintf(wszBuffer, wsz_PROVIDER_INFO_, pCDataSource->m_rgProviderInfo[i].wszName);
00247     LONG iIndex = wSendMessage(hWndProv, CB_ADDSTRING, (WPARAM)0, wszBuffer);
00248     SendMessage(hWndProv, CB_SETITEMDATA, (WPARAM)iIndex, (LPARAM)i);
00249   }
00250
00251   //By default, it selects the same provider chossen in Step1
00252   if(pCDataSource->m_pwszProviderName == NULL)
00253     pCDataSource->m_pwszProviderName = pCFromDataSource->m_pwszProviderName;
00254
00255   //Try and select the previous selected Provider
00256   if(CB_ERR == wSendMessage(hWndProv, CB_SELECTSTRING, 0, pCDataSource->m_pwszProviderName))
00257   {
00258     //If not found, just select the first one
00259     SendMessage(hWndProv, CB_SETCURSEL, 0, 0);
00260   }
00261
00262   //By default, try and Connect to the same DataSource as in Step1
00263   //if using the same provider as in Step1
00264   if(!m_pCTableCopy->m_pCToTable->IsConnected() && wcscmp(pCDataSource->m_pwszProviderName, pCFromDataSource->m_pwszProviderName)==0)
00265   {
00266     //The Provider must support more than 1 active session as well to do
00267     //this functionality by default...
00268     if(pCFromDataSource->m_ulActiveSessions==0 || pCFromDataSource->m_ulActiveSessions>=2)
00269       Connect(pCFromDataSource);
00270   }
00271
00272   // Enable Connect button only if there are providers installed.
00273   EnableWindow(GetDlgItem(m_hWnd, IDB_FROM_CONNECT), SendMessage(hWndProv, CB_GETCURSEL, 0, 0L) != CB_ERR);
00274
00275   // Set the "Source" info
00276   //CONNECT_STRING
00277   wSetDlgItemText(m_hWnd, IDT_FROM_CONNECT, wsz_CONNECT_STRING_,
00278     pCFromDataSource->m_pwszProviderName,
00279     pCFromDataSource->m_pwszDataSource,
00280     pCFromDataSource->m_pwszDBMS,
00281     pCFromDataSource->m_pwszDBMSVer,
00282     pCFromDataSource->m_pwszProviderFileName,
00283     pCFromDataSource->m_pwszProviderVer);
00284
00285   //TABLE
00286   wSetDlgItemText(m_hWnd, IDE_FROM_TABLE, m_pCTableCopy->m_pCFromTable->m_wszQualTableName);
00287   return TRUE;
00288 }
00289
00290
00291 /////////////////////////////////////////////////////////////////////////////
00292 // BOOL CS3Dialog::RefreshControls
00293 //
00294 /////////////////////////////////////////////////////////////////////////////
00295 BOOL CS3Dialog::RefreshControls()
00296 {
00297   BOOL    fConnected;
00298
00299   CTable* pCToTable = m_pCTableCopy->m_pCToTable;
00300   CTable* pCFromTable = m_pCTableCopy->m_pCFromTable;
00301   CDataSource* pCDataSource = pCToTable->m_pCDataSource;
00302
00303   // Must have a connection to edit other controls
00304   fConnected = pCToTable->IsConnected();
00305
00306   //Enable certain dialog controls, only if connected
00307   EnableWindow(GetDlgItem(m_hWnd, IDE_TO_TABLE),    fConnected);
00308   EnableWindow(GetDlgItem(m_hWnd, IDT_TARGET),    fConnected);
00309   EnableWindow(GetDlgItem(m_hWnd, IDT_TOTABLEHELP), fConnected);
00310
00311   //Store the selected ProviderName and ProviderDesc
00312   LONG iSel = 0;
00313   if((iSel = SendMessage(GetDlgItem(m_hWnd, IDC_PROVIDER_NAME), CB_GETCURSEL, 0, 0L)) != CB_ERR)
00314   {
00315     //Since we have the CBS_SORT turned on, the order in the Combo Box does
00316     //not match our array, so we pass the array index (lParam) as the item data
00317     LONG lParam = SendMessage(GetDlgItem(m_hWnd, IDC_PROVIDER_NAME), CB_GETITEMDATA, iSel, 0L);
00318     ASSERT(lParam < (LONG)pCDataSource->m_cProviderInfo);
00319     pCDataSource->m_pwszProviderName = pCDataSource->m_rgProviderInfo[lParam].wszName;
00320     pCDataSource->m_pwszProviderParseName = pCDataSource->m_rgProviderInfo[lParam].wszParseName;
00321   }
00322
00323   // Show user the connection string, and enable Next that requires connection
00324   if(fConnected)
00325   {
00326     //CONNECTSTATUS
00327     SetDlgItemText(m_hWnd, IDT_CONNECTSTATUS, "");
00328
00329     //CONNECT_STRING
00330     wSetDlgItemText(m_hWnd, IDT_TO_CONNECT, wsz_CONNECT_STRING_,
00331       pCDataSource->m_pwszProviderName,
00332       pCDataSource->m_pwszDataSource,
00333       pCDataSource->m_pwszDBMS,
00334       pCDataSource->m_pwszDBMSVer,
00335       pCDataSource->m_pwszProviderFileName,
00336       pCDataSource->m_pwszProviderVer);
00337
00338     //TABLEHELPMSG
00339     wSetDlgItemText(m_hWnd, IDT_TOTABLEHELP, wsz_TOTABLEHELP_,
00340       pCDataSource->m_pwszTableTerm);
00341   }
00342   else
00343   {
00344     //CONNECTSTATUS
00345     wSetDlgItemText(m_hWnd, IDT_CONNECTSTATUS, wsz_NOT_CONNECTED);
00346
00347     //CONNECT_STRING
00348     wSetDlgItemText(m_hWnd, IDT_TO_CONNECT, L"");
00349   }
00350
00351   // If there is already a Table from previous selections, just use that one
00352   wSetDlgItemText(m_hWnd, IDE_TO_TABLE, pCToTable->m_TableInfo.wszTableName[0] ? pCToTable->m_TableInfo.wszTableName : pCFromTable->m_TableInfo.wszTableName);
00353
00354   // Determine if there is enough information to move on
00355   return EnableTable();
00356 }
00357
00358
00359
00360
00361 /////////////////////////////////////////////////////////////////////////////
00362 // BOOL CS3Dialog::Connect
00363 //
00364 /////////////////////////////////////////////////////////////////////////////
00365 BOOL CS3Dialog::Connect(CDataSource* pCDataSource)
00366 {
00367   CDataSource *pCToDataSource   = m_pCTableCopy->m_pCToTable->m_pCDataSource;
00368   CDataSource *pCFromDataSource = m_pCTableCopy->m_pCFromTable->m_pCDataSource;
00369   BOOL    fReturn       = FALSE;
00370
00371   //Connect to the DataSource
00372   HRESULT hr = m_pCTableCopy->m_pCToTable->Connect(m_hWnd, pCDataSource);
00373
00374   //If Connected
00375   if SUCCEEDED(hr)
00376   {
00377     // Verify we can use this data source
00378     // Just give a warning to the user, since the DataSource may actually
00379     // be updatable, but it is returning the wrong property value.
00380     if(pCToDataSource->m_fReadOnly)
00381     {
00382       wMessageBox(m_hWnd, MB_TASKMODAL | MB_ICONEXCLAMATION | MB_OK,  wsz_WARNING,
00383           wsz_READONLY_DATASOURCE_, pCToDataSource->m_pwszDataSource);
00384     }
00385
00386     //See if this is a similar DSN than the Source
00387     //If DSN's are not similar, then we need to translate
00388     m_pCTableCopy->m_fTranslate = !pCToDataSource->IsSimilar(pCFromDataSource);
00389     fReturn = TRUE;
00390   }
00391
00392   return TRUE;
00393 }
00394
00395
00396 /////////////////////////////////////////////////////////////////////////////
00397 // BOOL CS3Dialog::EnableTable
00398 //
00399 /////////////////////////////////////////////////////////////////////////////
00400 BOOL CS3Dialog::EnableTable()
00401 {
00402   BOOL fConnected = m_pCTableCopy->m_pCToTable->IsConnected();
00403
00404   EnableWindow(GetDlgItem(m_hWnd, IDOK),
00405       fConnected && SendDlgItemMessage(m_hWnd, IDE_TO_TABLE, WM_GETTEXTLENGTH, 0, 0L));
00406
00407   return TRUE;
00408 }
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/RecWDlg.h Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

RecWDlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // RecWDlg.h : header file
00013 //
00014
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // CReceiveWaitDialog dialog
00018
00019 class CReceiveWaitDialog : public CDialog
00020 {
00021 // Construction
00022 public:
00023   CReceiveWaitDialog(CWnd* pParent = NULL);   // standard constructor
00024     void CenterWindow();
00025
00026 // Dialog Data
00027   //{{AFX_DATA(CReceiveWaitDialog)
00028   enum { IDD = IDD_WAIT_DIALOG };
00029     // NOTE: the ClassWizard will add data members here
00030   //}}AFX_DATA
00031
00032
00033 // Overrides
00034   // ClassWizard generated virtual function overrides
00035   //{{AFX_VIRTUAL(CReceiveWaitDialog)
00036   protected:
00037   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00038   //}}AFX_VIRTUAL
00039
00040 // Implementation
00041 protected:
00042
00043   // Generated message map functions
00044   //{{AFX_MSG(CReceiveWaitDialog)
00045     // NOTE: the ClassWizard will add member functions here
00046   //}}AFX_MSG
00047   DECLARE_MESSAGE_MAP()
00048 };
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/compdata.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

compdata.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #ifndef _CLASS_CCOMPONENTDATA_
00016 #define _CLASS_CCOMPONENTDATA_
00017
00018
00019 #include "Globals.h"
00020 #include "BaseNode.h"
00021
00022 class  CStaticNode;           // References
00023
00024 //---------------------------------------------------------------------------
00025 class CComponentData : public IComponentData2,
00026                               IExtendContextMenu
00027 {
00028   private:
00029     ULONG                m_cRef;
00030     LPCONSOLE3           m_ipConsole;
00031     LPCONSOLENAMESPACE2  m_ipConsoleNameSpace;
00032     LPIMAGELIST          m_ipScopeImage;         // Caching the image list
00033     CStaticNode*         m_pStaticNode;
00034     HSCOPEITEM           m_hStaticNode;
00035
00036   public:
00037     CComponentData();
00038     ~CComponentData();
00039
00040     /////////////////////////////////////////////////////////////////////////
00041     // Interface IUnknown
00042     //
00043     STDMETHODIMP QueryInterface( REFIID riid, LPVOID *ppv );
00044     STDMETHODIMP_(ULONG) AddRef();
00045     STDMETHODIMP_(ULONG) Release();
00046
00047     /////////////////////////////////////////////////////////////////////////
00048     // Interface IComponentData2
00049     //
00050     HRESULT STDMETHODCALLTYPE Initialize
00051             ( /*[in]*/ LPUNKNOWN pUnknown );
00052
00053     HRESULT STDMETHODCALLTYPE CreateComponent
00054             ( /*[out]*/ LPCOMPONENT __RPC_FAR* ppComponent);
00055
00056     HRESULT STDMETHODCALLTYPE Notify
00057             ( /*[in]*/ LPDATAOBJECT ipDataObject,
00058               /*[in]*/ MMC_NOTIFY_TYPE MmcEvent,
00059               /*[in]*/ LONG nArg,
00060               /*[in]*/ LONG nParam
00061             );
00062
00063     HRESULT STDMETHODCALLTYPE Destroy( void);
00064
00065     HRESULT STDMETHODCALLTYPE QueryDataObject
00066             ( /*[in]*/  MMC_COOKIE nCookie,
00067               /*[in]*/  DATA_OBJECT_TYPES nEnumType,
00068               /*[out]*/ LPDATAOBJECT __RPC_FAR* ppDataObject
00069             );
00070
00071     HRESULT STDMETHODCALLTYPE GetDisplayInfo
00072             ( /*[out,in]*/ SCOPEDATAITEM __RPC_FAR* pScopeDataItem );
00073
00074     HRESULT STDMETHODCALLTYPE CompareObjects
00075             ( /*[in]*/ LPDATAOBJECT ipDataObjectA,
00076               /*[in]*/ LPDATAOBJECT ipDataObjectB
00077             );
00078
00079     HRESULT STDMETHODCALLTYPE QueryDispatch
00080             ( /*[in] */  MMC_COOKIE  nCookie,
00081               /*[in] */  DATA_OBJECT_TYPES eType,
00082               /*[out]*/  LPDISPATCH* pipDispatch
00083             );
00084
00085
00086     /////////////////////////////////////////////////////////////////////////
00087     // Interface IExtendContextMenu
00088     //
00089     HRESULT STDMETHODCALLTYPE AddMenuItems
00090             ( /*[in]*/ LPDATAOBJECT ipDataObject,
00091               /*[in]*/ LPCONTEXTMENUCALLBACK ipCallback,
00092               /*[out,in]*/ long __RPC_FAR* pInsertionAllowed
00093             );
00094
00095     HRESULT STDMETHODCALLTYPE Command
00096             ( /*[in]*/ long lCommandID,
00097               /*[in]*/ LPDATAOBJECT piDataObject
00098             );
00099
00100
00101   // Pulic helper methods
00102   public:
00103     CStaticNode* GetStaticNode() { return m_pStaticNode; }
00104     HRESULT      GetInterface( DWORD dwRequestedInterface,  LONG_PTR* ppInterface );
00105
00106 };
00107
00108 #endif //_CLASS_CCOMPONENTDATA_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/crow.cpp Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

crow.cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "CRow.h"
00003
00004 // Allocating a buffer to use for storage of the row
00005 // This proxy will be the temporary storage area for values as they are
00006 // passed from file to the consumer and back.
00007 void CRow::AllocProxyBuffer(ATLCOLUMNINFO * prgColInfo, int cNumCols)
00008 {
00009   ULONG ulSize = 0;
00010
00011   for (int i = 0; i < cNumCols; i++)
00012   {
00013     switch(prgColInfo[i].wType)
00014       {
00015       case DBTYPE_I4:
00016         ulSize += 4;
00017         break;
00018       case DBTYPE_STR:
00019         ulSize += prgColInfo[i].ulColumnSize;
00020         break;
00021   #ifdef _DEBUG
00022       default:
00023       // the types in the column info structures should always be correct but
00024       // this is just a precaution
00025         _ASSERTE(0);
00026         return;
00027   #endif
00028       }
00029   }
00030   m_pbProxyData = new BYTE[ulSize];
00031   memset(m_pbProxyData,0,ulSize);
00032 }
00033
00034 // GetProxyData will convert the data in the file into the native data
00035 // specified in the .INI file.
00036 void CRow::GetProxyData(ATLCOLUMNINFO * pColInfo, ULONG cCols)
00037 {
00038 //  if (m_bRetrieved)
00039 //    return;  // already have the data for the row
00040
00041   char * pPos = m_pbStartLoc;
00042   char szColumnString[MAX_COLUMNSIZE];
00043
00044   // pPos will be incremented as data is fetched and can be passed into
00045   // subsequent calls
00046
00047
00048   //TODO: optimize by passing in the proxybuffer  into FetchColumnString for string fields
00049   for (unsigned int i = 0; i < cCols; i++)
00050   {
00051 //    if (!(pColInfo[i].dwFlags &= DBCOLUMNFLAGS_ISBOOKMARK))
00052     if (!(pColInfo[i].dwFlags & DBCOLUMNFLAGS_ISBOOKMARK))
00053     {
00054       int nResult = FetchColumnString(szColumnString, pPos);
00055       if (nResult == BAD_RECORD_FORMAT)
00056         return;  // TODO: handle bad file info
00057       StoreInProxy(i, szColumnString, pColInfo);
00058     }
00059     else
00060       StoreInProxy(i, NULL, pColInfo);
00061
00062   }
00063
00064   m_bRetrieved = true;
00065 }
00066
00067 int CRow::FetchColumnString(char * pszColData, char * &pPos)
00068 {
00069   // TODO: need to parse out white space before and after  column data
00070
00071   if (pPos > m_pbStartLoc + m_cbRowSize - 1)
00072     return BAD_RECORD_FORMAT;
00073   while ((pPos <= (m_pbStartLoc + m_cbRowSize - 1)) && *pPos != ',')
00074   {
00075     *pszColData++ = *pPos;
00076     pPos++;
00077   }
00078   if (*pPos == ',')
00079     pPos++;
00080
00081   *pszColData = '\0';
00082   return 0;
00083 }
00084
00085 void CRow::StoreInProxy(unsigned int iCol, char * szColumnString, ATLCOLUMNINFO * pColInfo)
00086 {
00087   // TODO: Probably need to do something here with bookmarks
00088   // pColInfo is ordered by ordinal so we can do a simple array look-up
00089   // currently only supports DBTYPE_I4
00090   void * pvBuffer = m_pbProxyData + pColInfo[iCol].cbOffset;
00091
00092   switch(pColInfo[iCol].wType)
00093   {
00094     case DBTYPE_I4:
00095       if (pColInfo[iCol].dwFlags & DBCOLUMNFLAGS_ISBOOKMARK)
00096         *((long *)pvBuffer) = m_bmk;
00097       else
00098         *((long *)pvBuffer) = atoi(szColumnString);
00099       break;
00100     case DBTYPE_STR:
00101       _tcscpy((char*) pvBuffer, szColumnString);
00102       break;
00103 #ifdef _DEBUG
00104     default:
00105       // Should never get here if we have all of the types supported and we
00106       // validate the types at the time of reading the schema
00107       _ASSERTE(0);
00108       break;
00109 #endif
00110   }
00111 }
00112
00113
00114 int CRow::CalculateRowData(ATLCOLUMNINFO * prgColInfo, ULONG cNumCols, bool bAddEOL)
00115 {
00116   ULONG nBytesNeeded = 0;
00117
00118
00119   for (ULONG i = 0; i < cNumCols; i++)
00120   {
00121
00122     void * pvBuffer = m_pbProxyData + prgColInfo[i].cbOffset;
00123
00124     switch(prgColInfo[i].wType)
00125     {
00126     case DBTYPE_I4:
00127       if (!(prgColInfo[i].dwFlags & DBCOLUMNFLAGS_ISBOOKMARK))
00128       {
00129         //convert to string
00130         char szTemp[MAX_COLUMNSIZE];
00131         _itoa(*((long*)pvBuffer), szTemp, 10);
00132         nBytesNeeded += _tcslen(szTemp);
00133       }
00134       else
00135         continue;
00136
00137       break;
00138     case DBTYPE_STR:
00139       nBytesNeeded += _tcslen((char*)pvBuffer);
00140       if(_tcslen((char*)pvBuffer)> prgColInfo[i].ulColumnSize)
00141         return -1;
00142       break;
00143 #ifdef _DEBUG
00144     default:
00145     // the types in the column info structures should always be correct but
00146       // this is just a precaution
00147       _ASSERTE(0);
00148       return -1;
00149 #endif
00150
00151     }
00152
00153     nBytesNeeded++; // add one byte for the comma
00154   }
00155
00156   nBytesNeeded--; // subtract the count which was added for the comma
00157
00158   if (bAddEOL)
00159     nBytesNeeded += 2;
00160
00161   return (int)(nBytesNeeded - m_cbRowSize) < 0 ? 0 : (int)(nBytesNeeded - m_cbRowSize);
00162 }
00163
00164 int CRow::CalculateRowDataToDelete(ATLCOLUMNINFO * prgColInfo, ULONG cNumCols, bool bAddEOL)
00165 {
00166   ULONG nBytesNeeded = 0;
00167
00168
00169   for (ULONG i = 0; i < cNumCols; i++)
00170   {
00171
00172     void * pvBuffer = m_pbProxyData + prgColInfo[i].cbOffset;
00173
00174     switch(prgColInfo[i].wType)
00175     {
00176     case DBTYPE_I4:
00177       if (!(prgColInfo[i].dwFlags & DBCOLUMNFLAGS_ISBOOKMARK))
00178       {
00179         //convert to string
00180         char szTemp[MAX_COLUMNSIZE];
00181         _itoa(*((long*)pvBuffer), szTemp, 10);
00182         nBytesNeeded += _tcslen(szTemp);
00183       }
00184       else
00185         continue;
00186
00187       break;
00188     case DBTYPE_STR:
00189       nBytesNeeded += _tcslen((char*)pvBuffer);
00190       if(_tcslen((char*)pvBuffer)> prgColInfo[i].ulColumnSize)
00191         return -1;
00192       break;
00193 #ifdef _DEBUG
00194     default:
00195     // the types in the column info structures should always be correct but
00196       // this is just a precaution
00197       _ASSERTE(0);
00198       return -1;
00199 #endif
00200
00201     }
00202
00203     nBytesNeeded++; // add one byte for the comma
00204   }
00205
00206   nBytesNeeded--; // subtract the count which was added for the comma
00207
00208   if (bAddEOL)
00209     nBytesNeeded += 2;
00210
00211   return (int)(m_cbRowSize - nBytesNeeded);
00212 }
00213
00214 int CRow::Update(ATLCOLUMNINFO * prgColInfo, ULONG cCols)
00215 {
00216   // CDBFile will update the row size
00217   BYTE * pbCurrentPos = (BYTE *)m_pbStartLoc;
00218
00219   int n;
00220   char* pszTemp;
00221
00222   // copy data from proxy to the file
00223   for (ULONG i = 0; i < cCols; i++)
00224   {
00225     void * pvBuffer = m_pbProxyData + prgColInfo[i].cbOffset;
00226     switch(prgColInfo[i].wType)
00227     {
00228         case DBTYPE_I4:
00229           if (prgColInfo[i].dwFlags & DBCOLUMNFLAGS_ISBOOKMARK)
00230             continue;
00231           else
00232           {
00233             //convert to string
00234             char szTemp[MAX_COLUMNSIZE];
00235             _itoa(*((long*)pvBuffer), szTemp, 10);
00236             //copy from buffer to file
00237             for (int n = 0; szTemp[n] != '\0'; n++)
00238               *pbCurrentPos++ = szTemp[n];
00239           }
00240
00241           break;
00242
00243         case DBTYPE_STR:
00244           pszTemp = (char *)pvBuffer;
00245           for (n = 0; *pszTemp != '\0'; n++)
00246               *pbCurrentPos++ = *pszTemp++;
00247           break;
00248       #ifdef _DEBUG
00249         default:
00250         // the types in the column info structures should always be correct but
00251         // this is just a precaution
00252           _ASSERTE(0);
00253           return 0;
00254       #endif
00255     }
00256
00257     if (i != cCols -1) // not the last column
00258       *pbCurrentPos++ = ',';
00259
00260   }
00261
00262 /*  // fill remainder of bytes with spaces
00263   // This can occur because we don't allocate a new row if the updated row will be
00264   // smaller
00265   if ((pbCurrentPos  - (BYTE *)m_pbStartLoc) < m_cbRowSize)
00266   {
00267     int n = m_cbRowSize - (pbCurrentPos - (BYTE *)m_pbStartLoc);
00268     for (;n != 0; n--)
00269       *pbCurrentPos++= ' ';
00270
00271   }*/
00272
00273   m_cbRowSize = (ULONG) (pbCurrentPos - (BYTE *)m_pbStartLoc);
00274
00275
00276   // add seperator
00277 //  *pbCurrentPos++ = '\r';
00278 //  *pbCurrentPos = '\n';
00279
00280   return 0;
00281 }
00282
00283
00284 bool CRow::HasEOL(BYTE * pbEOF)
00285 {
00286   char * pbEOR = m_pbStartLoc + m_cbRowSize;
00287   if (pbEOR <= (char *)pbEOF && pbEOR[0] == '\r' && pbEOR[1] == '\n')
00288     return true;
00289   else
00290     return false;
00291 }
00292
00293 void CRow::AddEOL()
00294 {
00295   //assumes the space has already been allocated to do this
00296   char * pbEOR = m_pbStartLoc + m_cbRowSize;
00297     *pbEOR++ = '\r';
00298   *pbEOR = '\n';
00299
00300 }
00301
00302
00303 int CRow::CreateDefaultRow(ATLCOLUMNINFO *prgColInfo, ULONG cNumCols, bool bAddEOL)
00304 {
00305   USES_CONVERSION;
00306   short nBytesNeeded = 0;
00307   for (ULONG i = 0; i < cNumCols; i++)
00308   {
00309
00310     void * pvBuffer = m_pbProxyData + prgColInfo[i].cbOffset;
00311
00312     switch(prgColInfo[i].wType)
00313     {
00314     case DBTYPE_I4:
00315       if (!(prgColInfo[i].dwFlags & DBCOLUMNFLAGS_ISBOOKMARK))
00316       {
00317         //Store default '0' in the Proxy Buffer
00318         StoreInProxy(i, "0", prgColInfo);
00319         nBytesNeeded ++;
00320       }
00321       else  // Do not store if it is a bookmark
00322         continue;
00323       break;
00324     case DBTYPE_STR:
00325       // Store the name of the field
00326
00327       if (_tcslen(OLE2A(prgColInfo[i].pwszName)) > 0  && _tcslen(OLE2A(prgColInfo[i].pwszName)) < prgColInfo[i].ulColumnSize)
00328       {
00329         StoreInProxy(i, OLE2A(prgColInfo[i].pwszName), prgColInfo);
00330         nBytesNeeded += _tcslen(OLE2A(prgColInfo[i].pwszName));
00331       }
00332       else
00333       {
00334         // Store a '?'
00335         StoreInProxy(i,"?", prgColInfo);
00336         nBytesNeeded ++;
00337       }
00338       break;
00339 #ifdef _DEBUG
00340     default:
00341     // the types in the column info structures should always be correct but
00342       // this is just a precaution
00343       _ASSERTE(0);
00344       return -1;
00345 #endif
00346
00347     }
00348
00349     nBytesNeeded++; // add one byte for the comma
00350   }
00351   nBytesNeeded--; // subtract the count which was added for the comma
00352   if (bAddEOL)
00353     nBytesNeeded += 2;
00354   return (int)(nBytesNeeded - m_cbRowSize) < 0 ? 0 : (int)(nBytesNeeded - m_cbRowSize);
00355 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cdataset.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cdataset.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CDATASET.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CDATASET_H_
00012 #define _CDATASET_H_
00013
00014
00015 //////////////////////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020
00021
00022 /////////////////////////////////////////////////////////////////
00023 // CDataset
00024 //
00025 /////////////////////////////////////////////////////////////////
00026 class CDataset : public CDataAccess
00027 {
00028 public:
00029   //Constructors
00030   CDataset(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00031   ~CDataset();
00032
00033   //IUnknown Helpers
00034   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00035   virtual HRESULT     AutoRelease();
00036   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00037
00038   //Pure Virtual
00039   virtual WCHAR*      GetObjectName()     { return L"Dataset";    }
00040   virtual UINT      GetObjectMenu()     { return IDM_DATASETMENU; }
00041   virtual LONG      GetObjectImage()    { return IMAGE_CUBE;    }
00042   virtual REFIID      GetDefaultInterface() { return IID_IMDDataset;  }
00043
00044   virtual HRESULT     DisplayObject();
00045
00046   // Members
00047   virtual HRESULT     GetAxisInfo(DBCOUNTITEM* pcAxis, MDAXISINFO** prgAxisInfo);
00048   virtual HRESULT     FreeAxisInfo(DBCOUNTITEM* pcAxis, MDAXISINFO** prgAxisInfo);
00049   virtual HRESULT     GetAxisRowset(CAggregate* pCAggregate, DBCOUNTITEM iAxis, REFIID riid, ULONG cPropSets, DBPROPSET* rgPropSets, IUnknown** ppIUnknown);
00050   virtual HRESULT     GetCellData(DBORDINAL ulStartCell, DBORDINAL ulEndCell);
00051
00052   //[MANADATORY]
00053   IMDDataset*       m_pIMDDataset;
00054
00055   //[OPTIONAL]
00056   IMDFind*        m_pIMDFind;
00057   IMDRangeRowset*     m_pIMDRangeRowset;
00058
00059   // Data
00060   DBCOUNTITEM       m_cAxis;
00061   MDAXISINFO*       m_rgAxisInfo;
00062 };
00063
00064
00065
00066
00067 #endif //_CDATASET_H_
Generated on Wed Nov 13 2024 16:52:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step2/ADsFirstExt_i.c Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step2

ADsFirstExt_i.c

Go to the documentation of this file.
00001 /* this file contains the actual definitions of */
00002 /* the IIDs and CLSIDs */
00003
00004 /* link this file in with the server and any clients */
00005
00006
00007 /* File created by MIDL compiler version 5.01.0164 */
00008 /* at Mon Apr 29 12:54:31 2002
00009  */
00010 /* Compiler settings for C:\sdk\sdkpublic\samples\netds\adsi\samples\Extension\tutorial\Step2\ADsFirstExt.idl:
00011     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00012     error checks: allocation ref bounds_check enum stub_data
00013 */
00014 //@@MIDL_FILE_HEADING(  )
00015 #ifdef __cplusplus
00016 extern "C"{
00017 #endif
00018
00019
00020 #ifndef __IID_DEFINED__
00021 #define __IID_DEFINED__
00022
00023 typedef struct _IID
00024 {
00025     unsigned long x;
00026     unsigned short s1;
00027     unsigned short s2;
00028     unsigned char  c[8];
00029 } IID;
00030
00031 #endif // __IID_DEFINED__
00032
00033 #ifndef CLSID_DEFINED
00034 #define CLSID_DEFINED
00035 typedef IID CLSID;
00036 #endif // CLSID_DEFINED
00037
00038 const IID IID_IHelloWorld = {0xE1E3EDF7,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}};
00039
00040
00041 const IID LIBID_ADSFIRSTEXTLib = {0xE1E3EDEA,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}};
00042
00043
00044 const CLSID CLSID_HelloWorld = {0xE1E3EDF8,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}};
00045
00046
00047 #ifdef __cplusplus
00048 }
00049 #endif
00050
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/tree.cpp Source File

  • WinUI
  • Shell
  • EnumDesk

tree.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Tree.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include <windows.h>
00023 #include <windowsx.h>
00024 #include <commctrl.h>
00025 #include <shlobj.h>
00026 #include "EnumDesk.h"
00027 #include "List.h"
00028 #include "resource.h"
00029
00030 /**************************************************************************
00031    function prototypes
00032 **************************************************************************/
00033
00034 BOOL Tree_GetRootItems(HWND);
00035 BOOL Tree_GetChildItems(HWND, HTREEITEM);
00036 void Tree_EnumObjects(HWND, HTREEITEM, LPSHELLFOLDER, LPITEMIDLIST);
00037 int CALLBACK Tree_CompareProc(LPARAM, LPARAM, LPARAM);
00038
00039 /**************************************************************************
00040    global variables and definitions
00041 **************************************************************************/
00042
00043 /******************************************************************************
00044
00045    Tree_Create
00046
00047 ******************************************************************************/
00048
00049 HWND Tree_Create(HINSTANCE hInstance, HWND hwndParent, HIMAGELIST hImageList)
00050 {
00051 DWORD dwStyle;
00052 HWND  hwndTreeView;
00053
00054 dwStyle =   WS_TABSTOP |
00055             WS_CHILD |
00056             WS_VISIBLE |
00057             TVS_HASLINES |
00058             TVS_HASBUTTONS |
00059             TVS_NOTOOLTIPS |
00060             0;
00061
00062 hwndTreeView = CreateWindowEx(   WS_EX_CLIENTEDGE,
00063                                  WC_TREEVIEW,
00064                                  NULL,
00065                                  dwStyle,
00066                                  0,
00067                                  0,
00068                                  0,
00069                                  0,
00070                                  hwndParent,
00071                                  (HMENU)IDC_TREEVIEW,
00072                                  hInstance,
00073                                  NULL);
00074
00075 if(!hwndTreeView)
00076    return NULL;
00077
00078 // attach ImageList to TreeView
00079 if (hImageList)
00080    TreeView_SetImageList(hwndTreeView, hImageList, 0);
00081
00082 return hwndTreeView;
00083 }
00084
00085 /******************************************************************************
00086
00087    Tree_Init
00088
00089 ******************************************************************************/
00090
00091 void Tree_Init(HWND hwndTreeView)
00092 {
00093 //empty the list
00094 TreeView_DeleteAllItems(hwndTreeView);
00095
00096 Tree_GetRootItems(hwndTreeView);
00097
00098 TreeView_SetScrollTime(hwndTreeView, 100);
00099 }
00100
00101 /**************************************************************************
00102
00103    Tree_Notify()
00104
00105 **************************************************************************/
00106
00107 LRESULT Tree_Notify(HWND hWnd, LPARAM lParam)
00108 {
00109 LPNMHDR  lpnmh = (LPNMHDR) lParam;
00110 HWND     hwndTreeView = GetDlgItem(hWnd, IDC_TREEVIEW);
00111
00112 switch(lpnmh->code)
00113    {
00114    case TVN_GETDISPINFO:
00115       {
00116       LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)lParam;
00117       LPITEMINFO     pItem = (LPITEMINFO)lpdi->item.lParam;
00118
00119       //do we need to supply the text?
00120       if(lpdi->item.mask & TVIF_TEXT)
00121          {
00122          SHFILEINFO     sfi;
00123
00124          //get the display name of the item
00125          if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_DISPLAYNAME))
00126             {
00127             lstrcpyn(lpdi->item.pszText, sfi.szDisplayName, lpdi->item.cchTextMax);
00128             }
00129          }
00130
00131       //do we need to supply the unselected image?
00132       if(lpdi->item.mask & TVIF_IMAGE)
00133          {
00134          SHFILEINFO     sfi;
00135
00136          //get the unselected image for this item
00137          if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_LINKOVERLAY))
00138             {
00139             lpdi->item.iImage = sfi.iIcon;
00140             }
00141          }
00142
00143       //do we need to supply the selected image?
00144       if(lpdi->item.mask & TVIF_SELECTEDIMAGE)
00145          {
00146          SHFILEINFO     sfi;
00147
00148          //get the selected image for this item
00149          if(SHGetFileInfo((LPCTSTR)pItem->pidlFQ, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON))
00150             {
00151             lpdi->item.iSelectedImage = sfi.iIcon;
00152             }
00153          }
00154       }
00155       break;
00156
00157    case TVN_ITEMEXPANDING:
00158       {
00159       LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;
00160
00161       switch(pnmtv->action)
00162          {
00163          case TVE_EXPAND:
00164             Tree_GetChildItems(hwndTreeView, pnmtv->itemNew.hItem);
00165             break;
00166
00167          case TVE_COLLAPSE:
00168             //remove all of the items from this node
00169             TreeView_Expand(hwndTreeView, pnmtv->itemNew.hItem, TVE_COLLAPSE | TVE_COLLAPSERESET);
00170             break;
00171          }
00172       }
00173       break;
00174
00175    case TVN_DELETEITEM:
00176       {
00177       LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;
00178       LPITEMINFO     pItem = (LPITEMINFO)pnmtv->itemOld.lParam;
00179       LPMALLOC       pMalloc;
00180
00181       if(SUCCEEDED(SHGetMalloc(&pMalloc)))
00182          {
00183          //free up the pidls that we allocated
00184          Pidl_Free(pItem->pidlFQ);
00185          Pidl_Free(pItem->pidlRel);
00186
00187          pMalloc->Release();
00188          }
00189
00190       //this may be NULL if this is the root item
00191       if(pItem->pParentFolder)
00192          pItem->pParentFolder->Release();
00193
00194       GlobalFree((HGLOBAL)pItem);
00195       }
00196       break;
00197
00198    case TVN_SELCHANGED:
00199       {
00200       LPNMTREEVIEW   pnmtv = (LPNMTREEVIEW)lParam;
00201       LPITEMINFO pItem = (LPITEMINFO)pnmtv->itemNew.lParam;
00202
00203       List_DisplayFolder(GetDlgItem(hWnd, IDC_LISTVIEW), pItem);
00204       }
00205       break;
00206    }
00207
00208 return 0;
00209 }
00210
00211 /**************************************************************************
00212
00213    Tree_GetRootItems
00214
00215 **************************************************************************/
00216
00217 BOOL Tree_GetRootItems(HWND hwndTreeView)
00218 {
00219 LPITEMIDLIST      pidl;
00220
00221 if(SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl)))
00222    {
00223    TV_ITEM           tvItem;
00224    TV_INSERTSTRUCT   tvInsert;
00225    LPSHELLFOLDER     pDesktop;
00226    HTREEITEM         hParentItem;
00227    LPITEMINFO        pItem;
00228
00229    //get the desktop's IShellFolder
00230    if(FAILED(SHGetDesktopFolder(&pDesktop)))
00231       return FALSE;
00232
00233    //fill in the TVITEM structure for this item
00234    tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
00235
00236    //put the private information in the lParam
00237    pItem = (LPITEMINFO)GlobalAlloc(GPTR, sizeof(ITEMINFO));
00238    pItem->pidlRel = pidl;
00239    pItem->pidlFQ = Pidl_Copy(pidl);
00240
00241    //the desktop doesn't have a parent folder, so make this NULL
00242    pItem->pParentFolder = NULL;
00243    tvItem.lParam = (LPARAM)pItem;
00244
00245    //text and images are done on a callback basis
00246    tvItem.pszText = LPSTR_TEXTCALLBACK;
00247    tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
00248
00249    //assume the desktop has children
00250    tvItem.cChildren = TRUE;
00251
00252    //fill in the TV_INSERTSTRUCT structure for this item
00253    tvInsert.item = tvItem;
00254    tvInsert.hInsertAfter = TVI_LAST;
00255    tvInsert.hParent = TVI_ROOT;
00256
00257    //add the item
00258    hParentItem = TreeView_InsertItem(hwndTreeView, &tvInsert);
00259
00260    //go ahead and expand this item
00261    TreeView_Expand(hwndTreeView, hParentItem, TVE_EXPAND);
00262
00263    pDesktop->Release();
00264
00265    return TRUE;
00266    }
00267
00268 return FALSE;
00269 }
00270
00271 /**************************************************************************
00272
00273    Tree_GetChildItems
00274
00275 **************************************************************************/
00276
00277 BOOL Tree_GetChildItems(HWND hwndTreeView, HTREEITEM hParentItem)
00278 {
00279 TVITEM         tvItem;
00280 LPITEMINFO     pItem;
00281 LPSHELLFOLDER  pParentFolder = NULL;
00282 HRESULT        hr;
00283 HCURSOR        hCursor;
00284 TV_SORTCB      tvSort;
00285
00286
00287 //get the parent item's pidl
00288 ZeroMemory(&tvItem, sizeof(tvItem));
00289 tvItem.mask = TVIF_PARAM;
00290 tvItem.hItem = hParentItem;
00291 if(!TreeView_GetItem(hwndTreeView, &tvItem))
00292    return FALSE;
00293
00294 //change the cursor
00295 hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
00296
00297 //turn redawing off in the TreeView. This will speed things up as we add items
00298 SendMessage(hwndTreeView, WM_SETREDRAW, FALSE, 0);
00299
00300 pItem = (LPITEMINFO)tvItem.lParam;
00301
00302 //if the parent folder is NULL, then we are at the root of the namespace, so the parent of this item is the desktop folder
00303 if(!pItem->pParentFolder)
00304    {
00305    hr = SHGetDesktopFolder(&pParentFolder);
00306    }
00307 //otherwise we need to get the IShellFolder for this item
00308 else
00309    {
00310    hr = pItem->pParentFolder->BindToObject(pItem->pidlRel, NULL, IID_IShellFolder, (LPVOID*)&pParentFolder);
00311    }
00312
00313 if(FAILED(hr))
00314    return FALSE;
00315
00316 Tree_EnumObjects(hwndTreeView, hParentItem, pParentFolder, pItem->pidlFQ);
00317
00318 //sort the new items
00319 tvSort.hParent = hParentItem;
00320 tvSort.lpfnCompare = Tree_CompareProc;
00321 tvSort.lParam = 0;
00322 TreeView_SortChildrenCB(hwndTreeView, &tvSort, 0);
00323
00324 //turn redawing back on in the TreeView
00325 SendMessage(hwndTreeView, WM_SETREDRAW, TRUE, 0);
00326 //UpdateWindow(hwndTreeView);
00327
00328 pParentFolder->Release();
00329
00330 SetCursor(hCursor);
00331
00332 return TRUE;
00333 }
00334
00335 /**************************************************************************
00336
00337    Tree_EnumObjects
00338
00339 **************************************************************************/
00340
00341 void Tree_EnumObjects(  HWND hwndTreeView,
00342                         HTREEITEM hParentItem,
00343                         LPSHELLFOLDER pParentFolder,
00344                         LPITEMIDLIST pidlParent)
00345 {
00346 LPENUMIDLIST   pEnum;
00347
00348 if(SUCCEEDED(pParentFolder->EnumObjects(NULL, SHCONTF_FOLDERS, &pEnum)))
00349    {
00350    LPITEMIDLIST   pidlTemp;
00351    DWORD          dwFetched = 1;
00352    LPITEMINFO     pItem;
00353
00354    //enumerate the item's PIDLs
00355    while(S_OK == (pEnum->Next(1, &pidlTemp, &dwFetched)) && dwFetched)
00356       {
00357       TVITEM         tvItem;
00358       TVINSERTSTRUCT tvInsert;
00359       DWORD          dwAttribs;
00360
00361       ZeroMemory(&tvItem, sizeof(tvItem));
00362
00363       //fill in the TV_ITEM structure for this item
00364       tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
00365
00366       //AddRef the parent folder so it's pointer stays valid
00367       pParentFolder->AddRef();
00368
00369       //put the private information in the lParam
00370       pItem = (LPITEMINFO)GlobalAlloc(GPTR, sizeof(ITEMINFO));
00371
00372       pItem->pidlRel = pidlTemp;
00373       pItem->pidlFQ = Pidl_Concatenate(pidlParent, pidlTemp);
00374
00375       pItem->pParentFolder = pParentFolder;
00376       tvItem.lParam = (LPARAM)pItem;
00377
00378       //text and images are done on a callback basis
00379       tvItem.pszText = LPSTR_TEXTCALLBACK;
00380       tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
00381
00382       //determine if the item has children
00383       dwAttribs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_DISPLAYATTRMASK | SFGAO_CANRENAME;
00384       pParentFolder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &dwAttribs);
00385       tvItem.cChildren = (dwAttribs & SFGAO_HASSUBFOLDER);
00386
00387       //determine if the item is shared
00388       if(dwAttribs & SFGAO_SHARE)
00389          {
00390          tvItem.mask |= TVIF_STATE;
00391          tvItem.stateMask |= TVIS_OVERLAYMASK;
00392          tvItem.state |= INDEXTOOVERLAYMASK(1); //1 is the index for the shared overlay image
00393          }
00394
00395       //fill in the TV_INSERTSTRUCT structure for this item
00396       tvInsert.item = tvItem;
00397       tvInsert.hInsertAfter = TVI_LAST;
00398       tvInsert.hParent = hParentItem;
00399
00400       TreeView_InsertItem(hwndTreeView, &tvInsert);
00401
00402       dwFetched = 0;
00403       }
00404
00405    pEnum->Release();
00406    }
00407 }
00408
00409 /**************************************************************************
00410
00411    Tree_CompareProc
00412
00413 **************************************************************************/
00414
00415 int CALLBACK Tree_CompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
00416 {
00417 UNREFERENCED_PARAMETER(lParamSort);
00418
00419 LPITEMINFO  pItem1 = (LPITEMINFO)lParam1;
00420 LPITEMINFO  pItem2 = (LPITEMINFO)lParam2;
00421 HRESULT     hr;
00422
00423 hr = pItem1->pParentFolder->CompareIDs(   0,
00424                                           pItem1->pidlRel,
00425                                           pItem2->pidlRel);
00426
00427 if(FAILED(hr))
00428    return 0;
00429
00430 return (short)SCODE_CODE(GetScode(hr));
00431 }
00432
00433 /**************************************************************************
00434
00435    Tree_DoItemMenu
00436
00437 **************************************************************************/
00438
00439 void Tree_DoItemMenu(HWND hwndTreeView, HTREEITEM hItem, LPPOINT pptScreen)
00440 {
00441 TVITEM   tvItem;
00442
00443 ZeroMemory(&tvItem, sizeof(tvItem));
00444 tvItem.mask = TVIF_PARAM;
00445 tvItem.hItem = hItem;
00446
00447 if(TreeView_GetItem(hwndTreeView, &tvItem))
00448    {
00449    HWND           hwndParent = GetParent(hwndTreeView);
00450    HRESULT        hr;
00451    LPITEMINFO     pInfo = (LPITEMINFO)tvItem.lParam;
00452    IContextMenu   *pcm;
00453    IShellFolder   *psfFolder = pInfo->pParentFolder;
00454
00455    if(!psfFolder)
00456       {
00457       SHGetDesktopFolder(&psfFolder);
00458       }
00459    else
00460       {
00461       psfFolder->AddRef();
00462       }
00463
00464    if(psfFolder)
00465       {
00466       hr = psfFolder->GetUIObjectOf(   hwndParent,
00467                                        1,
00468                                        (LPCITEMIDLIST*)&pInfo->pidlRel,
00469                                        IID_IContextMenu,
00470                                        NULL,
00471                                        (LPVOID*)&pcm);
00472
00473       if(SUCCEEDED(hr))
00474          {
00475          HMENU hPopup;
00476
00477          hPopup = CreatePopupMenu();
00478          if(hPopup)
00479             {
00480             hr = pcm->QueryContextMenu(hPopup, 0, 1, 0x7fff, CMF_NORMAL | CMF_EXPLORE);
00481
00482             if(SUCCEEDED(hr))
00483                {
00484                pcm->QueryInterface(IID_IContextMenu2, (LPVOID*)&g_pcm2);
00485
00486                UINT  idCmd;
00487
00488                idCmd = TrackPopupMenu( hPopup,
00489                                        TPM_LEFTALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
00490                                        pptScreen->x,
00491                                        pptScreen->y,
00492                                        0,
00493                                        hwndParent,
00494                                        NULL);
00495
00496                if(g_pcm2)
00497                   {
00498                   g_pcm2->Release();
00499                   g_pcm2 = NULL;
00500                   }
00501
00502                if(idCmd)
00503                   {
00504                   CMINVOKECOMMANDINFO  cmi;
00505                   cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
00506                   cmi.fMask = 0;
00507                   cmi.hwnd = hwndParent;
00508                   cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - 1);
00509                   cmi.lpParameters = NULL;
00510                   cmi.lpDirectory = NULL;
00511                   cmi.nShow = SW_SHOWNORMAL;
00512                   cmi.dwHotKey = 0;
00513                   cmi.hIcon = NULL;
00514                   hr = pcm->InvokeCommand(&cmi);
00515                   }
00516                }
00517             }
00518
00519          pcm->Release();
00520          }
00521
00522       psfFolder->Release();
00523       }
00524    }
00525 }
00526
00527 /**************************************************************************
00528
00529    Tree_DoContextMenu
00530
00531 **************************************************************************/
00532
00533 void Tree_DoContextMenu(HWND hwndTreeView, LPPOINT pptScreen)
00534 {
00535 TVHITTESTINFO  tvhti;
00536
00537 tvhti.pt = *pptScreen;
00538 ScreenToClient(hwndTreeView, &tvhti.pt);
00539
00540 tvhti.flags = LVHT_NOWHERE;
00541
00542 TreeView_HitTest(hwndTreeView, &tvhti);
00543
00544 if(TVHT_ONITEM & tvhti.flags)
00545    {
00546    Tree_DoItemMenu(hwndTreeView, tvhti.hItem , pptScreen);
00547    }
00548 else
00549    {
00550    //the tree doesn't support background menus
00551    }
00552 }
00553
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/StreamOpenOptionsEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

StreamOpenOptionsEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: StreamOpenOptionsEnum
00019
00020 public class StreamOpenOptionsEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adOpenStreamAsync = 1;
00023   public static final short adOpenStreamFromRecord = 4;
00024   public static final short adOpenStreamFromURL = 8;
00025   public static final short stOpenAsync = 1;
00026   public static final short stOpenFromRecord = 4;
00027   public static final short stOpenFromURL = 8;
00028 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/PerfUtil.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll

PerfUtil.c

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1992 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010
00011 Module Name:
00012
00013     perfutil.c
00014
00015 Abstract:
00016
00017     This file implements the utility routines used to construct the
00018         common parts of a PERF_INSTANCE_DEFINITION (see winperf.h) and
00019     perform event logging functions.
00020
00021 --*/
00022 //
00023 //  include files
00024 //
00025 #include <windows.h>
00026 #include <string.h>
00027 #include <winperf.h>
00028 #include "memctrs.h"     // error message definition
00029 #include "perfmsg.h"
00030 #include "perfutil.h"
00031
00032 #define INITIAL_SIZE     1024L
00033 #define EXTEND_SIZE      1024L
00034
00035 //
00036 // Global data definitions.
00037 //
00038
00039 ULONG  ulInfoBufferSize = 0;
00040 HANDLE hEventLog        = NULL;      // event log handle for reporting events
00041 DWORD  dwLogUsers       = 0;         // count of functions using event log
00042 DWORD  MESSAGE_LEVEL    = 0;
00043 WCHAR  GLOBAL_STRING[]  = L"Global";
00044 WCHAR  FOREIGN_STRING[] = L"Foreign";
00045 WCHAR  COSTLY_STRING[]  = L"Costly";
00046 WCHAR  NULL_STRING[]    = L"\0";     // pointer to null string
00047
00048 // test for delimiter, end of line and non-digit characters
00049 // used by IsNumberInUnicodeList routine
00050 //
00051 #define DIGIT       1
00052 #define DELIMITER   2
00053 #define INVALID     3
00054
00055 #define EvalThisChar(c,d) ( \
00056      (c == d) ? DELIMITER : \
00057      (c == 0) ? DELIMITER : \
00058      (c < (WCHAR)'0') ? INVALID : \
00059      (c > (WCHAR)'9') ? INVALID : \
00060      DIGIT)
00061
00062 BOOL
00063 MonBuildInstanceDefinition(
00064     PERF_INSTANCE_DEFINITION * pBuffer,
00065     PVOID                    * pBufferNext,
00066     DWORD                      ParentObjectTitleIndex,
00067     DWORD                      ParentObjectInstance,
00068     DWORD                      UniqueID,
00069     LPWSTR                     Name
00070 )
00071 /*++
00072
00073     MonBuildInstanceDefinition  -   Build an instance of an object
00074
00075         Inputs:
00076
00077             pBuffer         -   pointer to buffer where instance is to
00078                                 be constructed
00079
00080             pBufferNext     -   pointer to a pointer which will contain
00081                                 next available location, DWORD aligned
00082
00083             ParentObjectTitleIndex
00084                             -   Title Index of parent object type; 0 if
00085                                 no parent object
00086
00087             ParentObjectInstance
00088                             -   Index into instances of parent object
00089                                 type, starting at 0, for this instances
00090                                 parent object instance
00091
00092             UniqueID        -   a unique identifier which should be used
00093                                 instead of the Name for identifying
00094                                 this instance
00095
00096             Name            -   Name of this instance
00097 --*/
00098 {
00099    DWORD NameLength = 0;
00100    WCHAR * pName;
00101
00102    //
00103    //  Include trailing null in name size
00104    //
00105
00106    NameLength = lstrlenW(Name) * sizeof(WCHAR);
00107    if (NameLength > 0)
00108    {
00109       NameLength += sizeof(WCHAR); // to include the terminating NULL
00110    }
00111
00112    pBuffer->ByteLength             = sizeof(PERF_INSTANCE_DEFINITION) + DWORD_MULTIPLE(NameLength);
00113    pBuffer->ParentObjectTitleIndex = ParentObjectTitleIndex;
00114    pBuffer->ParentObjectInstance   = ParentObjectInstance;
00115    pBuffer->UniqueID               = UniqueID;
00116    pBuffer->NameOffset             = sizeof(PERF_INSTANCE_DEFINITION);
00117    pBuffer->NameLength             = NameLength;
00118    pName = (PWCHAR) & pBuffer[1];
00119    lstrcpynW(pName, Name, lstrlenW(Name) + 1);
00120
00121    * pBufferNext = (PVOID) ((PCHAR) pBuffer + pBuffer->ByteLength);
00122    return TRUE;
00123 }
00124
00125 HANDLE
00126 MonOpenEventLog(
00127 )
00128 /*++
00129
00130 Routine Description:
00131
00132     Reads the level of event logging from the registry and opens the
00133         channel to the event logger for subsequent event log entries.
00134
00135 Arguments:
00136
00137       None
00138
00139 Return Value:
00140
00141     Handle to the event log for reporting events.
00142     NULL if open not successful.
00143
00144 --*/
00145 {
00146    HKEY  hAppKey;
00147    CHAR  LogLevelKeyName[]   = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib";
00148    CHAR  LogLevelValueName[] = "EventLogLevel";
00149    LONG  lStatus;
00150    DWORD dwLogLevel;
00151    DWORD dwValueType;
00152    DWORD dwValueSize;
00153
00154    // if global value of the logging level not initialized or is disabled,
00155    //  check the registry to see if it should be updated.
00156
00157    if (! MESSAGE_LEVEL)
00158    {
00159
00160       lStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00161                              LogLevelKeyName,
00162                              0,
00163                              KEY_READ,
00164                              & hAppKey);
00165       if (lStatus == ERROR_SUCCESS)
00166       {
00167          dwValueSize = sizeof(dwLogLevel);
00168          lStatus = RegQueryValueEx(hAppKey,
00169                                    LogLevelValueName,
00170                                    (LPDWORD) NULL,
00171                                    & dwValueType,
00172                                    (LPBYTE) & dwLogLevel,
00173                                    & dwValueSize);
00174          if (lStatus == ERROR_SUCCESS)
00175          {
00176             MESSAGE_LEVEL = dwLogLevel;
00177          }
00178          else
00179          {
00180             MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
00181          }
00182          RegCloseKey(hAppKey);
00183       }
00184       else
00185       {
00186          MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
00187       }
00188    }
00189
00190    if (hEventLog == NULL)
00191    {
00192       hEventLog = RegisterEventSource(
00193                                      (LPTSTR) NULL, // Use Local Machine
00194                                      APP_NAME);     // event log app name to find in registry
00195       if (hEventLog != NULL)
00196       {
00197          REPORT_INFORMATION(UTIL_LOG_OPEN, LOG_DEBUG);
00198       }
00199    }
00200
00201    if (hEventLog != NULL)
00202    {
00203       dwLogUsers ++; // increment count of perfctr log users
00204    }
00205    return (hEventLog);
00206 }
00207
00208 VOID
00209 MonCloseEventLog(
00210 )
00211 /*++
00212
00213 Routine Description:
00214
00215       Closes the handle to the event logger if this is the last caller
00216
00217 Arguments:
00218
00219       None
00220
00221 Return Value:
00222
00223       None
00224
00225 --*/
00226 {
00227    if (hEventLog != NULL)
00228    {
00229       dwLogUsers --;         // decrement usage
00230       if (dwLogUsers <= 0)
00231       {    // and if we're the last, then close up log
00232          REPORT_INFORMATION(UTIL_CLOSING_LOG, LOG_DEBUG);
00233          DeregisterEventSource(hEventLog);
00234       }
00235    }
00236 }
00237
00238 DWORD
00239 GetQueryType(
00240     IN LPWSTR lpValue
00241 )
00242 /*++
00243
00244 GetQueryType
00245
00246     returns the type of query described in the lpValue string so that
00247     the appropriate processing method may be used
00248
00249 Arguments
00250
00251     IN lpValue
00252         string passed to PerfRegQuery Value for processing
00253
00254 Return Value
00255
00256     QUERY_GLOBAL
00257         if lpValue == 0 (null pointer)
00258            lpValue == pointer to Null string
00259            lpValue == pointer to "Global" string
00260
00261     QUERY_FOREIGN
00262         if lpValue == pointer to "Foriegn" string
00263
00264     QUERY_COSTLY
00265         if lpValue == pointer to "Costly" string
00266
00267     otherwise:
00268
00269     QUERY_ITEMS
00270
00271 --*/
00272 {
00273    WCHAR   *pwcArgChar, *pwcTypeChar;
00274    BOOL    bFound;
00275
00276    if (lpValue == 0)
00277    {
00278       return QUERY_GLOBAL;
00279    }
00280    else if (* lpValue == 0)
00281    {
00282       return QUERY_GLOBAL;
00283    }
00284
00285    // check for "Global" request
00286
00287    pwcArgChar  = lpValue;
00288    pwcTypeChar = GLOBAL_STRING;
00289    bFound      = TRUE;  // assume found until contradicted
00290
00291    // check to the length of the shortest string
00292
00293    while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
00294    {
00295       if (* pwcArgChar ++ != * pwcTypeChar ++)
00296       {
00297          bFound = FALSE; // no match
00298          break;          // bail out now
00299       }
00300    }
00301
00302    if (bFound) return QUERY_GLOBAL;
00303
00304    // check for "Foreign" request
00305
00306    pwcArgChar  = lpValue;
00307    pwcTypeChar = FOREIGN_STRING;
00308    bFound      = TRUE;  // assume found until contradicted
00309
00310    // check to the length of the shortest string
00311
00312    while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
00313    {
00314       if (* pwcArgChar ++ != * pwcTypeChar ++)
00315       {
00316          bFound = FALSE; // no match
00317          break;          // bail out now
00318       }
00319    }
00320
00321    if (bFound) return QUERY_FOREIGN;
00322
00323    // check for "Costly" request
00324
00325    pwcArgChar  = lpValue;
00326    pwcTypeChar = COSTLY_STRING;
00327    bFound      = TRUE;  // assume found until contradicted
00328
00329    // check to the length of the shortest string
00330
00331    while ((* pwcArgChar != 0) && (* pwcTypeChar != 0))
00332    {
00333       if (* pwcArgChar ++ != * pwcTypeChar ++)
00334       {
00335          bFound = FALSE; // no match
00336          break;          // bail out now
00337       }
00338    }
00339
00340    if (bFound) return QUERY_COSTLY;
00341
00342    // if not Global and not Foreign and not Costly,
00343    // then it must be an item list
00344
00345    return QUERY_ITEMS;
00346 }
00347
00348 BOOL
00349 IsNumberInUnicodeList(
00350     IN DWORD   dwNumber,
00351     IN LPWSTR  lpwszUnicodeList
00352 )
00353 /*++
00354
00355 IsNumberInUnicodeList
00356
00357 Arguments:
00358
00359     IN dwNumber
00360         DWORD number to find in list
00361
00362     IN lpwszUnicodeList
00363         Null terminated, Space delimited list of decimal numbers
00364
00365 Return Value:
00366
00367     TRUE:
00368             dwNumber was found in the list of unicode number strings
00369
00370     FALSE:
00371             dwNumber was not found in the list.
00372
00373 --*/
00374 {
00375    DWORD   dwThisNumber;
00376    WCHAR * pwcThisChar;
00377    BOOL    bValidNumber;
00378    BOOL    bNewItem;
00379    WCHAR   wcDelimiter;    // could be an argument to be more flexible
00380
00381    if (lpwszUnicodeList == 0) return FALSE;    // null pointer, # not founde
00382
00383    pwcThisChar  = lpwszUnicodeList;
00384    dwThisNumber = 0;
00385    wcDelimiter  = (WCHAR)' ';
00386    bValidNumber = FALSE;
00387    bNewItem     = TRUE;
00388
00389    while (TRUE)
00390    {
00391       switch (EvalThisChar(* pwcThisChar, wcDelimiter))
00392       {
00393       case DIGIT:
00394          // if this is the first digit after a delimiter, then
00395          // set flags to start computing the new number
00396          if (bNewItem)
00397          {
00398             bNewItem     = FALSE;
00399             bValidNumber = TRUE;
00400          }
00401          if (bValidNumber)
00402          {
00403             dwThisNumber *= 10;
00404             dwThisNumber += (* pwcThisChar - (WCHAR) '0');
00405          }
00406          break;
00407
00408       case DELIMITER:
00409          // a delimter is either the delimiter character or the
00410          // end of the string ('\0') if when the delimiter has been
00411          // reached a valid number was found, then compare it to the
00412          // number from the argument list. if this is the end of the
00413          // string and no match was found, then return.
00414          //
00415          if (bValidNumber)
00416          {
00417             if (dwThisNumber == dwNumber) return TRUE;
00418             bValidNumber = FALSE;
00419          }
00420          if (* pwcThisChar == 0)
00421          {
00422             return FALSE;
00423          }
00424          else
00425          {
00426             bNewItem     = TRUE;
00427             dwThisNumber = 0;
00428          }
00429          break;
00430
00431       case INVALID:
00432          // if an invalid character was encountered, ignore all
00433          // characters up to the next delimiter and then start fresh.
00434          // the invalid number is not compared.
00435          bValidNumber = FALSE;
00436          break;
00437
00438       default:
00439          break;
00440
00441       }
00442       pwcThisChar ++;
00443    }
00444 }   // IsNumberInUnicodeList
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCallAs Member List

This is the complete list of members for CCallAs, including all inherited members.
AddRef() | CCallAs |
CCallAs() | CCallAs | [inline]
HelloProc(unsigned char *pszString) | CCallAs |
operator delete(void *pv) | CCallAs | [inline]
operator new(size_t s) | CCallAs | [inline]
QueryInterface(REFIID iid, void **ppv) | CCallAs |
RefCount | CCallAs | [private]
Release() | CCallAs |
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Intermediate/Context.Cpp Source File

  • Web
  • iis
  • Components
  • Cpp
  • Intermediate

Context.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c)    1997    Microsoft Corporation
00004
00005   Module  Name :
00006
00007     context.h
00008
00009   Abstract:
00010     A class to retrieve and release ASP intrinsics
00011
00012   Author:
00013
00014     Neil Allain   ( a-neilal )     August-1997
00015
00016   Revision History:
00017
00018 --*/
00019 #include "stdafx.h"
00020 #include <asptlb.h>
00021 #include "context.h"
00022
00023
00024 //---------------------------------------------------------------------------
00025 //  GetServerObject
00026 //
00027 //  Get an instrinic object from the current Object context
00028 //---------------------------------------------------------------------------
00029 HRESULT
00030 CContext::GetServerObject(
00031   IGetContextProperties*  pProps,
00032   BSTR          bstrObjName,
00033   const IID&        iid,
00034   void**          ppObj
00035 )
00036 {
00037   HRESULT rc = E_FAIL;
00038   _ASSERT( pProps );
00039   _ASSERT( bstrObjName );
00040   _ASSERT( ppObj );
00041   if ( pProps && bstrObjName && ppObj )
00042   {
00043     *ppObj = NULL;
00044     CComVariant vt;
00045     if ( !FAILED( pProps->GetProperty( bstrObjName, &vt ) ) )
00046     {
00047       if ( V_VT(&vt) == VT_DISPATCH )
00048       {
00049         IDispatch* pDispatch = V_DISPATCH(&vt);
00050         if ( pDispatch )
00051         {
00052           rc = pDispatch->QueryInterface( iid, ppObj );
00053         }
00054       }
00055     }
00056   }
00057   return rc;
00058 }
00059
00060
00061 HRESULT
00062 CContext::Init(
00063   DWORD dwFlags // which instrinsics to initialize
00064 )
00065 {
00066   HRESULT rc = E_FAIL;
00067   CComPtr<IObjectContext> pObjContext;
00068
00069   rc = ::GetObjectContext( &pObjContext );
00070   if ( !FAILED( rc ) )
00071   {
00072     CComPtr<IGetContextProperties> pProps;
00073     rc = pObjContext->QueryInterface( IID_IGetContextProperties, (void**)&pProps );
00074     if ( !FAILED( rc ) )
00075     {
00076       CComBSTR bstrObj;
00077       if ( dwFlags & get_Request )
00078       {
00079         bstrObj = "Request";
00080         rc = GetServerObject( pProps, bstrObj, IID_IRequest, (void**)&m_piRequest );
00081       }
00082       if ( !FAILED(rc) && ( dwFlags & get_Response ) )
00083       {
00084         bstrObj = "Response";
00085         rc = GetServerObject( pProps, bstrObj, IID_IResponse, (void**)&m_piResponse );
00086       }
00087
00088       if ( !FAILED(rc) && ( dwFlags & get_Session ) )
00089       {
00090         bstrObj = "Session";
00091         rc = GetServerObject( pProps, bstrObj, IID_ISessionObject, (void**)&m_piSession );
00092       }
00093
00094       if ( !FAILED(rc) && ( dwFlags & get_Server ) )
00095       {
00096         bstrObj = "Server";
00097         rc = GetServerObject( pProps, bstrObj, IID_IServer, (void**)&m_piServer );
00098       }
00099
00100       if ( !FAILED(rc) && ( dwFlags & get_Application ) )
00101       {
00102         bstrObj = "Application";
00103         rc = GetServerObject( pProps, bstrObj, IID_IApplicationObject, (void**)&m_piApplication );
00104       }
00105     }
00106   }
00107   return rc;
00108 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/networkentry.h Source File

  • NetDS
  • RRas
  • ip

networkentry.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\networkentry.h
00008
00009 Abstract:
00010
00011     The file contains definitions for the network entry and associated data
00012     structures.
00013
00014 --*/
00015
00016 #ifndef _NETWORKENTRY_H_
00017 #define _NETWORKENTRY_H_
00018
00019
00020 //
00021 // TYPE DEFINITIONS FOR INTERFACE MANAGEMENT
00022 //
00023
00024 //
00025 // struct:  BINDING_ENTRY
00026 //
00027 // stores interface bindings, ip addresses to which an interface is bound.
00028 // all ip addresses are in network byte order.
00029 //
00030 // protected by the read-write lock NETWORK_ENTRY::rwlLock.
00031 //
00032
00033 typedef struct _BINDING_ENTRY
00034 {
00035     IPADDRESS               ipAddress;
00036     IPADDRESS               ipMask;
00037 } BINDING_ENTRY, *PBINDING_ENTRY;
00038
00039 DWORD
00040 BE_CreateTable (
00041     IN  PIP_ADAPTER_BINDING_INFO    pBinding,
00042     OUT PBINDING_ENTRY              *ppbeBindingTable,
00043     OUT PIPADDRESS                  pipLowestAddress);
00044
00045 DWORD
00046 BE_DestroyTable (
00047     IN  PBINDING_ENTRY              pbeBindingTable);
00048
00049 #ifdef DEBUG
00050 DWORD
00051 BE_DisplayTable (
00052     IN  PBINDING_ENTRY              pbeBindingTable,
00053     IN  ULONG                       ulNumBindings);
00054 #else
00055 #define BE_Display(pbe)
00056 #endif // DEBUG
00057
00058 //
00059 // VOID
00060 // BE_FindTable (
00061 //     IN  PBINDING_ENTRY      pbeBindingTable,
00062 //     IN  ULONG               ulNumBindings,
00063 //     IN  IPADDRESS           ipAddress,
00064 //     IN  IPADDRESS           ipMask,
00065 //     OUT PULONG              pulIndex
00066 //     );
00067 //
00068
00069 #define BE_FindTable(table, num, address, mask, pindex)                 \
00070 {                                                                       \
00071     for (*(pindex) = 0; *(pindex) < (num); (*(pindex))++)               \
00072         if (!IP_COMPARE((table)[*(pindex)].ipAddress, (address)) and    \
00073             !IP_COMPARE((table)[*(pindex)].ipMask, (mask)))             \
00074             break;                                                      \
00075 }
00076
00077
00078
00079 //
00080 // struct:  INTERFACE_ENTRY
00081 //
00082 // stores per-interface information.
00083 //
00084 // protected by the read-write lock NETWORK_ENTRY::rwlLock.
00085 //
00086
00087 // mib get modes
00088
00089 typedef enum { GET_EXACT, GET_FIRST, GET_NEXT } MODE;
00090
00091
00092 typedef struct _INTERFACE_ENTRY
00093 {
00094     // Hash Table Link (primary access structure)
00095     LIST_ENTRY              leInterfaceTableLink;
00096
00097     // Index Sorted List Link (secondary access structure)
00098     LIST_ENTRY              leIndexSortedListLink;
00099
00100     // Interface Name (logging)
00101     PWCHAR                  pwszIfName;
00102
00103     // Interface Index
00104     DWORD                   dwIfIndex;
00105
00106     // Interface Address Bindings
00107     ULONG                   ulNumBindings;
00108     PBINDING_ENTRY          pbeBindingTable;
00109
00110     // Interface Flags ENABLED, BOUND, ACTIVE, MULTIACCESS
00111     DWORD                   dwFlags;
00112
00113     // Interface Address (lowest binding ip address for now) & Socket
00114     IPADDRESS               ipAddress;
00115     SOCKET                  sRawSocket;
00116
00117     // Receive Event and Registered Wait
00118     HANDLE                  hReceiveEvent;
00119     HANDLE                  hReceiveWait;
00120
00121     // Periodic Timer
00122     HANDLE                  hPeriodicTimer;
00123
00124     // Interface Configuration
00125     DWORD                   ulMetric;
00126
00127     // Interface Statistics
00128     IPSAMPLE_IF_STATS       iisStats;
00129 } INTERFACE_ENTRY, *PINTERFACE_ENTRY;
00130
00131 #define IEFLAG_ACTIVE           0x00000001
00132 #define IEFLAG_BOUND            0x00000002
00133 #define IEFLAG_MULTIACCESS      0x00000004
00134
00135
00136
00137 #define INTERFACE_IS_ACTIVE(i)                              \
00138     ((i)->dwFlags & IEFLAG_ACTIVE)
00139
00140 #define INTERFACE_IS_INACTIVE(i)                            \
00141     !INTERFACE_IS_ACTIVE(i)
00142
00143 #define INTERFACE_IS_BOUND(i)                               \
00144     ((i)->dwFlags & IEFLAG_BOUND)
00145
00146 #define INTERFACE_IS_UNBOUND(i)                             \
00147     !INTERFACE_IS_BOUND(i)
00148
00149 #define INTERFACE_IS_MULTIACCESS(i)                         \
00150     ((i)->dwFlags & IEFLAG_MULTIACCESS)
00151
00152 #define INTERFACE_IS_POINTTOPOINT(i)                        \
00153     !INTERFACE_IS_MULTIACCESS(i)
00154
00155
00156
00157 DWORD
00158 IE_Create (
00159     IN  PWCHAR                      pwszIfName,
00160     IN  DWORD                       dwIfIndex,
00161     IN  WORD                        wAccessType,
00162     OUT PINTERFACE_ENTRY            *ppieInterfaceEntry);
00163
00164 DWORD
00165 IE_Destroy (
00166     IN  PINTERFACE_ENTRY            pieInterfaceEntry);
00167
00168 #ifdef DEBUG
00169 DWORD
00170 IE_Display (
00171     IN  PINTERFACE_ENTRY            pieInterfaceEntry);
00172 #else
00173 #define IE_Display(pieInterfaceEntry)
00174 #endif // DEBUG
00175
00176 DWORD
00177 IE_Insert (
00178     IN  PINTERFACE_ENTRY            pieIfEntry);
00179
00180 DWORD
00181 IE_Delete (
00182     IN  DWORD                       dwIfIndex,
00183     OUT PINTERFACE_ENTRY            *ppieIfEntry);
00184
00185 BOOL
00186 IE_IsPresent (
00187     IN  DWORD                       dwIfIndex);
00188
00189 DWORD
00190 IE_Get (
00191     IN  DWORD                       dwIfIndex,
00192     OUT PINTERFACE_ENTRY            *ppieIfEntry);
00193
00194 DWORD
00195 IE_GetIndex (
00196     IN  DWORD                       dwIfIndex,
00197     IN  MODE                        mMode,
00198     OUT PINTERFACE_ENTRY            *ppieIfEntry);
00199
00200 DWORD
00201 IE_BindInterface (
00202     IN  PINTERFACE_ENTRY            pie,
00203     IN  PIP_ADAPTER_BINDING_INFO    pBinding);
00204
00205 DWORD
00206 IE_UnBindInterface (
00207     IN  PINTERFACE_ENTRY            pie);
00208
00209 DWORD
00210 IE_ActivateInterface (
00211     IN  PINTERFACE_ENTRY            pie);
00212
00213 DWORD
00214 IE_DeactivateInterface (
00215     IN  PINTERFACE_ENTRY            pie);
00216
00217
00218
00219
00220 //
00221 // struct:  NETWORK_ENTRY
00222 //
00223 // stores interface table and other network related information.
00224 // the interface table is a hashed on the interface index.
00225 //
00226 // protected by the read-write lock NETWORK_ENTRY::rwlLock.
00227 //
00228 // must be acquired exclusively when entries are being added or deleted
00229 // from the table, and when the states of entries are being changed.
00230 //
00231 // must be acquired non-exclusively on all other acceses.
00232 //
00233
00234 typedef struct _NETWORK_ENTRY
00235 {
00236     // Lock
00237     READ_WRITE_LOCK         rwlLock;
00238
00239     PHASH_TABLE             phtInterfaceTable; // primary access structure
00240     LIST_ENTRY              leIndexSortedList; // secondary access structure
00241 } NETWORK_ENTRY, *PNETWORK_ENTRY;
00242
00243
00244
00245 DWORD
00246 NE_Create (
00247     OUT PNETWORK_ENTRY              *ppneNetworkEntry);
00248
00249 DWORD
00250 NE_Destroy (
00251     IN  PNETWORK_ENTRY              pneNetworkEntry);
00252
00253 #ifdef DEBUG
00254 DWORD
00255 NE_Display (
00256     IN  PNETWORK_ENTRY              pneNetworkEntry);
00257 #else
00258 #define NE_Display(pneNetworkEntry)
00259 #endif // DEBUG
00260
00261 #endif // _NETWORKENTRY_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SFilterEntry Member List

This is the complete list of members for SFilterEntry, including all inherited members.
pwszClassId | SFilterEntry
pwszClassIdDescription | SFilterEntry
pwszDLL | SFilterEntry
pwszThreadingModel | SFilterEntry
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Anchor.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

Anchor.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       anchor.hxx
00006 //
00007 //  Contents:   Parsing algorithm for anchor tags
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __ANCHOR_HXX__ )
00012 #define __ANCHOR_HXX__
00013
00014 #include <htmlelem.hxx>
00015
00016
00017 enum AnchorTagState
00018 {
00019     StartAnchor,            // Start anchor tag
00020     EndAnchor               // End anchor tag
00021 };
00022
00023
00024 //+-------------------------------------------------------------------------
00025 //
00026 //  Class:      CAnchorTag
00027 //
00028 //  Purpose:    Parsing algorithm for anchor tag in Html
00029 //
00030 //--------------------------------------------------------------------------
00031
00032 class CAnchorTag : public CHtmlElement
00033 {
00034
00035 public:
00036     CAnchorTag( CHtmlIFilter& htmlIFilter, CSerialStream& serialStream );
00037     ~CAnchorTag();
00038
00039     virtual SCODE    GetChunk( STAT_CHUNK *pStat );
00040     virtual SCODE    GetText( ULONG *pcwcOutput, WCHAR *awcBuffer );
00041
00042     virtual void     InitStatChunk( STAT_CHUNK *pStat );
00043
00044 private:
00045     AnchorTagState   _eState;                 // State of anchor element
00046     WCHAR *          _pwcHrefBuf;             // Buffer for Href field
00047     unsigned         _uLenHrefBuf;            // Length of Href buffer
00048     unsigned         _cHrefChars;             // # chars in Href buffer
00049     unsigned         _cHrefCharsFiltered;     // # chars in Href buffer already filtered
00050 };
00051
00052
00053 #endif // __ANCHOR_HXX__
00054
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/about.h Source File

  • SysMgmt
  • MMC
  • ActiveX

about.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPABOUT_H_
00020 #define _SAMPABOUT_H_
00021
00022 #include <tchar.h>
00023 #include <mmc.h>
00024
00025 class CSnapinAbout : public ISnapinAbout
00026 {
00027 private:
00028     ULONG       m_cref;
00029     HBITMAP       m_hSmallImage;
00030     HBITMAP       m_hLargeImage;
00031     HBITMAP       m_hSmallImageOpen;
00032     HICON       m_hAppIcon;
00033
00034 public:
00035     CSnapinAbout();
00036     ~CSnapinAbout();
00037
00038     ///////////////////////////////
00039     // Interface IUnknown
00040     ///////////////////////////////
00041     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042     STDMETHODIMP_(ULONG) AddRef();
00043     STDMETHODIMP_(ULONG) Release();
00044
00045     ///////////////////////////////
00046     // Interface ISnapinAbout
00047     ///////////////////////////////
00048     STDMETHODIMP GetSnapinDescription(
00049         /* [out] */ LPOLESTR *lpDescription);
00050
00051         STDMETHODIMP GetProvider(
00052         /* [out] */ LPOLESTR *lpName);
00053
00054         STDMETHODIMP GetSnapinVersion(
00055         /* [out] */ LPOLESTR *lpVersion);
00056
00057         STDMETHODIMP GetSnapinImage(
00058         /* [out] */ HICON *hAppIcon);
00059
00060         STDMETHODIMP GetStaticFolderImage(
00061         /* [out] */ HBITMAP *hSmallImage,
00062         /* [out] */ HBITMAP *hSmallImageOpen,
00063         /* [out] */ HBITMAP *hLargeImage,
00064         /* [out] */ COLORREF *cMask);
00065
00066         ///////////////////////////////
00067         // Private Interface
00068         ///////////////////////////////
00069 private:
00070     HRESULT CSnapinAbout::AllocOleStr(
00071         LPOLESTR *lpDest,
00072         _TCHAR *szBuffer);
00073 };
00074
00075 #endif _SAMPABOUT_H_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Wininfo.c Source File

  • Multimedia
  • Gdi
  • GdiDemo

Wininfo.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /*---------------------------------------------------------------------------*\
00013 | WINDOW INFORMATION MODULE
00014 |   This module contains the routines which deal with obtaining the extra
00015 |   object information associated with a window.  For these to work, the
00016 |   window class must reserve the 0th word of the win-class object to be
00017 |   used to hold global-memory handle.
00018 \*---------------------------------------------------------------------------*/
00019
00020 #include <windows.h>
00021 #include "gdidemo.h"
00022
00023 /*---------------------------------------------------------------------------*\
00024 | ALLOC WINDOW INFO
00025 |   This routine allocates memory out of the application heap for storing
00026 |   extra memory for the window.  It is alway referenced as offset 0.
00027 \*---------------------------------------------------------------------------*/
00028 BOOL FAR AllocWindowInfo(HWND hWnd, WORD wSize)
00029 {
00030     HANDLE hsd;
00031
00032
00033     if(hsd = LocalAlloc(LHND,(WORD)wSize))
00034     {
00035         SetWindowLongPtr(hWnd,0,(LONG_PTR)hsd);
00036         return(TRUE);
00037     }
00038     return(FALSE);
00039 }
00040
00041
00042 /*---------------------------------------------------------------------------*\
00043 | LOCK WINDOW INFO
00044 |   This routine de-references the extra-memory associated with the window.
00045 |   it locks the object and gives the caller a pointer to the memory.
00046 \*---------------------------------------------------------------------------*/
00047 PVOID FAR LockWindowInfo(HWND hWnd)
00048 {
00049     HANDLE hMem;
00050     PVOID  pMem;
00051
00052
00053     pMem = NULL;
00054     if(hMem = (HANDLE)GetWindowLongPtr(hWnd,0))
00055         pMem = (PVOID)LocalLock(hMem);
00056
00057     return(pMem);
00058 }
00059
00060
00061 /*---------------------------------------------------------------------------*\
00062 | UNLOCK WINDOW INFO
00063 |   This routine unlocks the memory the caller has previously locked.
00064 \*---------------------------------------------------------------------------*/
00065 BOOL FAR UnlockWindowInfo(HWND hWnd)
00066 {
00067     HANDLE hMem;
00068
00069
00070     if(hMem = (HANDLE)GetWindowLongPtr(hWnd,0))
00071         if(!LocalUnlock(hMem))
00072             return(TRUE);
00073
00074     return(FALSE);
00075 }
00076
00077
00078 /*---------------------------------------------------------------------------*\
00079 | FREE WINDOW INFO
00080 |   This routine frees the object memory associated with the window.
00081 \*---------------------------------------------------------------------------*/
00082 BOOL FAR FreeWindowInfo(HWND hWnd)
00083 {
00084     LOCALHANDLE hMem;
00085
00086
00087     if(hMem = (HANDLE)GetWindowLongPtr(hWnd,0))
00088         LocalFree(hMem);
00089     return(TRUE);
00090 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Consumer/Events.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Consumer

Events.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   XXXX
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #include "precomp.h"
00017
00018 #include <wbemcli.h>
00019 #include <wbemprov.h>
00020 #include "Globals.h"
00021 #include "Events.h"
00022
00023 /******************************************************************************
00024  *
00025  *  Name: CProvider_IWbemEventConsumerProvider
00026  *
00027  *
00028  *  Description:
00029  *
00030  *    Constructor for object. Initialize variables to NULL. Increment global object count
00031  *
00032  *****************************************************************************/
00033
00034 CProvider_IWbemEventConsumerProvider:: CProvider_IWbemEventConsumerProvider () :
00035
00036   m_ReferenceCount ( 0 ) ,
00037   m_User ( NULL ) ,
00038   m_Locale ( NULL ) ,
00039   m_Namespace ( NULL ) ,
00040   m_CoreService ( NULL )
00041 {
00042   InterlockedIncrement ( & Provider_Globals :: s_ObjectsInProgress ) ;
00043 }
00044
00045 /******************************************************************************
00046  *
00047  *  Name: ~CProvider_IWbemEventConsumerProvider
00048  *
00049  *
00050  *  Description:
00051  *
00052  *    Constructor for object. Uninitialize variables . Decrement global object count
00053  *
00054  *****************************************************************************/
00055
00056 CProvider_IWbemEventConsumerProvider:: ~CProvider_IWbemEventConsumerProvider ()
00057 {
00058   if ( m_User )
00059   {
00060     SysFreeString ( m_User ) ;
00061   }
00062
00063   if ( m_Locale )
00064   {
00065     SysFreeString ( m_Locale ) ;
00066   }
00067
00068   if ( m_Namespace )
00069   {
00070     SysFreeString ( m_Namespace ) ;
00071   }
00072
00073   if ( m_CoreService )
00074   {
00075     m_CoreService->Release () ;
00076   }
00077
00078   InterlockedDecrement ( & Provider_Globals :: s_ObjectsInProgress ) ;
00079 }
00080
00081 /******************************************************************************
00082  *
00083  *  Name:   AddRef
00084  *
00085  *
00086  *  Description:
00087  *
00088  *    Perform Locked increment. Keep com object Alive.
00089  *
00090  *****************************************************************************/
00091
00092 STDMETHODIMP_(ULONG) CProvider_IWbemEventConsumerProvider:: AddRef ( void )
00093 {
00094   return InterlockedIncrement ( & m_ReferenceCount ) ;
00095 }
00096
00097 /******************************************************************************
00098  *
00099  *  Name:
00100  *
00101  *    Release
00102  *
00103  *  Description:
00104  *
00105  *    Perform Locked decrement. Attempt to destroy com object.
00106  *
00107  *****************************************************************************/
00108
00109 STDMETHODIMP_(ULONG) CProvider_IWbemEventConsumerProvider:: Release ( void )
00110 {
00111   LONG t_Reference ;
00112   if ( ( t_Reference = InterlockedDecrement ( & m_ReferenceCount ) ) == 0 )
00113   {
00114 /*
00115  *  No more outstanding references, delete the object.
00116  */
00117
00118     delete this ;
00119   }
00120
00121   return t_Reference ;
00122 }
00123
00124 /******************************************************************************
00125  *
00126  *  Name: QueryInterface
00127  *
00128  *
00129  *  Description:
00130  *
00131  *      Determine interface availabilty for com object.
00132  *
00133  *****************************************************************************/
00134
00135 STDMETHODIMP CProvider_IWbemEventConsumerProvider:: QueryInterface (
00136
00137   REFIID a_Riid ,
00138   LPVOID FAR *a_Void
00139 )
00140 {
00141 /*
00142  *  Just clean up out parameter first.
00143  */
00144
00145   *a_Void = NULL ;
00146
00147   if ( a_Riid == IID_IUnknown )
00148   {
00149     *a_Void = ( LPVOID ) this ;
00150   }
00151   else if ( a_Riid == IID_IWbemEventConsumerProvider )
00152   {
00153 /*
00154  *  Make sure we support event consumer interface IWbemEventConsumerProvider
00155  */
00156
00157     *a_Void = ( LPVOID ) ( IWbemEventConsumerProvider * ) this ;
00158   }
00159   else if ( a_Riid == IID_IWbemProviderInit )
00160   {
00161 /*
00162  *  We support optional interface IWbemProviderInit
00163  */
00164
00165     *a_Void = ( LPVOID ) ( IWbemProviderInit * ) this ;
00166   }
00167   else if ( a_Riid == IID_IWbemShutdown )
00168   {
00169 /*
00170  *  We support optional interface IWbemShutdown
00171  */
00172
00173     *a_Void = ( LPVOID ) ( IWbemShutdown * ) this ;
00174   }
00175
00176 /*
00177  *  Retain a reference on outgoing parameter.
00178  */
00179
00180   if ( *a_Void )
00181   {
00182     ( ( LPUNKNOWN ) *a_Void )->AddRef () ;
00183
00184     return ResultFromScode ( S_OK ) ;
00185   }
00186   else
00187   {
00188     return ResultFromScode ( E_NOINTERFACE ) ;
00189   }
00190 }
00191
00192 /******************************************************************************
00193  *
00194  *  Name: FindConsumer
00195  *
00196  *
00197  *  Description:
00198  *
00199  *      Wmi uses this method to obtain a specific endpoint for
00200  *      an event consumer registration defined by a_LogicalConsumer.
00201  *      Provider returns an implementation of IWbemUnboundObjectSink so that
00202  *      Wmi can deliver the event.
00203  *
00204  *****************************************************************************/
00205
00206 HRESULT CProvider_IWbemEventConsumerProvider:: FindConsumer (
00207
00208   IWbemClassObject *a_LogicalConsumer ,
00209   IWbemUnboundObjectSink **a_Consumer
00210 )
00211 {
00212   HRESULT t_Result = S_OK ;
00213
00214   if ( a_Consumer )
00215   {
00216 /*
00217  *  Cleanup the outgoing parameter
00218  */
00219
00220     *a_Consumer = NULL ;
00221
00222     CProvider_IWbemUnboundObjectSink *t_Sink = new CProvider_IWbemUnboundObjectSink ;
00223     if ( t_Sink )
00224     {
00225 /*
00226  *  AddRef for outgoing parameter ;
00227  */
00228
00229       t_Sink->AddRef () ;
00230
00231       *a_Consumer = t_Sink ;
00232     }
00233     else
00234     {
00235       t_Result = WBEM_E_OUT_OF_MEMORY ;
00236     }
00237   }
00238   else
00239   {
00240     t_Result = WBEM_E_INVALID_PARAMETER ;
00241   }
00242
00243   return t_Result ;
00244 }
00245
00246 /******************************************************************************
00247  *
00248  *  Name:   Initialize
00249  *
00250  *
00251  *  Description:
00252  *
00253  *        Wmi calls this optional interface to inform the provider of
00254  *        configuration information associated within the client, locale
00255  *        and namespace. Provider retains this information for future use.
00256  *
00257  *****************************************************************************/
00258
00259 HRESULT CProvider_IWbemEventConsumerProvider:: Initialize (
00260
00261   LPWSTR a_User,
00262   LONG a_Flags,
00263   LPWSTR a_Namespace,
00264   LPWSTR a_Locale,
00265   IWbemServices *a_CoreService,         // For anybody
00266   IWbemContext *a_Context,
00267   IWbemProviderInitSink *a_Sink     // For init signals
00268 )
00269 {
00270   HRESULT t_Result = S_OK ;
00271
00272   if ( a_CoreService )
00273   {
00274 /*
00275  *  Interface we can call back to retrieve WMI related information, class definitions, etc.
00276  */
00277     m_CoreService = a_CoreService ;
00278     m_CoreService->AddRef () ;
00279   }
00280   else
00281   {
00282     t_Result = WBEM_E_INVALID_PARAMETER ;
00283   }
00284
00285   if ( SUCCEEDED ( t_Result ) )
00286   {
00287     if ( a_User )
00288     {
00289       m_User = SysAllocString ( a_User ) ;
00290       if ( m_User == NULL )
00291       {
00292         t_Result = WBEM_E_OUT_OF_MEMORY ;
00293       }
00294     }
00295   }
00296
00297   if ( SUCCEEDED ( t_Result ) )
00298   {
00299     if ( a_Locale )
00300     {
00301       m_Locale = SysAllocString ( a_Locale ) ;
00302       if ( m_Locale == NULL )
00303       {
00304         t_Result = WBEM_E_OUT_OF_MEMORY ;
00305       }
00306     }
00307   }
00308
00309   if ( SUCCEEDED ( t_Result ) )
00310   {
00311     if ( a_Namespace )
00312     {
00313       m_Namespace = SysAllocString ( a_Namespace ) ;
00314       if ( m_Namespace == NULL )
00315       {
00316         t_Result = WBEM_E_OUT_OF_MEMORY ;
00317       }
00318     }
00319   }
00320
00321 /*
00322  *  Indicate to WMI status of call.
00323  */
00324
00325   a_Sink->SetStatus ( t_Result , 0 ) ;
00326
00327 /*
00328  *  returning failing means that WMI need not check status specified in SetStatus call.
00329  */
00330
00331   return t_Result ;
00332 }
00333
00334 /******************************************************************************
00335  *
00336  *  Name:   Shutdown
00337  *
00338  *
00339  *  Description:
00340  *
00341  *        Optional interface and method that informs provider of object implementation
00342  *        being released by WMI. Shutdown is not guaranteed to be called on system
00343  *        shutdown.
00344  *
00345  *****************************************************************************/
00346
00347 HRESULT CProvider_IWbemEventConsumerProvider:: Shutdown (
00348
00349   LONG a_Flags ,
00350   ULONG a_MaxMilliSeconds ,
00351   IWbemContext *a_Context
00352 )
00353 {
00354   HRESULT t_Result = S_OK ;
00355
00356   return t_Result ;
00357 }
00358
00359 /******************************************************************************
00360  *
00361  *  Name:   CProvider_IWbemUnboundObjectSink
00362  *
00363  *
00364  *  Description:
00365  *
00366  *        Constructor, initializes variables. Increment global object count
00367  *
00368  *****************************************************************************/
00369
00370 CProvider_IWbemUnboundObjectSink:: CProvider_IWbemUnboundObjectSink () :
00371
00372   m_ReferenceCount ( 0 )
00373 {
00374   InterlockedIncrement ( & Provider_Globals :: s_ObjectsInProgress ) ;
00375 }
00376
00377 /******************************************************************************
00378  *
00379  *  Name:   ~CProvider_IWbemUnboundObjectSink
00380  *
00381  *
00382  *  Description:
00383  *
00384  *        Destructor, uninitializes variables. Decrement global object count
00385  *
00386  *****************************************************************************/
00387
00388 CProvider_IWbemUnboundObjectSink:: ~CProvider_IWbemUnboundObjectSink()
00389 {
00390   InterlockedDecrement ( & Provider_Globals :: s_ObjectsInProgress ) ;
00391 }
00392
00393 /******************************************************************************
00394  *
00395  *  Name:   AddRef
00396  *
00397  *
00398  *  Description:
00399  *
00400  *    Perform Locked increment. Keep com object Alive.
00401  *
00402  *****************************************************************************/
00403
00404 STDMETHODIMP_(ULONG) CProvider_IWbemUnboundObjectSink:: AddRef ( void )
00405 {
00406   return InterlockedIncrement ( & m_ReferenceCount ) ;
00407 }
00408
00409 /******************************************************************************
00410  *
00411  *  Name:
00412  *
00413  *
00414  *  Description:
00415  *
00416  *
00417  *****************************************************************************/
00418
00419 STDMETHODIMP_(ULONG) CProvider_IWbemUnboundObjectSink:: Release ( void )
00420 {
00421   LONG t_Reference ;
00422   if ( ( t_Reference = InterlockedDecrement ( & m_ReferenceCount ) ) == 0 )
00423   {
00424 /*
00425  *  No more outstanding references, delete the object.
00426  */
00427
00428     delete this ;
00429   }
00430
00431   return t_Reference ;
00432 }
00433
00434 /******************************************************************************
00435  *
00436  *  Name: QueryInterface
00437  *
00438  *
00439  *  Description:
00440  *
00441  *      Determine interface availabilty for com object.
00442  *
00443  *****************************************************************************/
00444
00445 STDMETHODIMP CProvider_IWbemUnboundObjectSink:: QueryInterface (
00446
00447   REFIID a_Riid ,
00448   LPVOID FAR *a_Void
00449 )
00450 {
00451 /*
00452  *  Just clean up out parameter first.
00453  */
00454
00455   *a_Void = NULL ;
00456
00457   if ( a_Riid == IID_IUnknown )
00458   {
00459     *a_Void = ( LPVOID ) this ;
00460   }
00461   else if ( a_Riid == IID_IWbemUnboundObjectSink )
00462   {
00463 /*
00464  *  Make sure we support event consumer interface IWbemUnboundObjectSink
00465  */
00466
00467     *a_Void = ( LPVOID ) ( IWbemUnboundObjectSink * ) this ;
00468   }
00469
00470 /*
00471  *  Retain a reference on outgoing parameter.
00472  */
00473
00474   if ( *a_Void )
00475   {
00476     ( ( LPUNKNOWN ) *a_Void )->AddRef () ;
00477
00478     return ResultFromScode ( S_OK ) ;
00479   }
00480   else
00481   {
00482     return ResultFromScode ( E_NOINTERFACE ) ;
00483   }
00484 }
00485
00486 /******************************************************************************
00487  *
00488  *  Name: IndicateToConsumer
00489  *
00490  *
00491  *  Description:
00492  *
00493  *      Interface method called by WMI to indicate an event has been generated.
00494  *      User code should be added here to perform some action, we perform a beep.
00495  *
00496  *****************************************************************************/
00497
00498 HRESULT CProvider_IWbemUnboundObjectSink:: IndicateToConsumer (
00499
00500   IWbemClassObject *a_LogicalConsumer ,
00501   long a_ObjectCount ,
00502   IWbemClassObject **a_Objects
00503 )
00504 {
00505   HRESULT t_Result = S_OK ;
00506
00507   MessageBeep ( MB_ICONEXCLAMATION ) ;
00508
00509   return t_Result ;
00510 }
00511
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/globals.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

globals.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "BaseNode.h"
00016
00017 //---------------------------------------------------------------------------
00018 // MMC's requiered clipboard formats
00019
00020 UINT g_cfDisplayName = 0;      // DisplayName for our SnapIn node
00021 UINT g_cfNodeType    = 0;      // GUID of the selected node
00022 UINT g_cfszNodeType  = 0;      // String representation of namespace GUID
00023 UINT g_cfSnapinClsid = 0;      // Class ID of this SnapIn
00024
00025 //---------------------------------------------------------------------------
00026 //  Custom clipboard formats
00027
00028 UINT g_cfBaseNodePtr = 0;
00029 UINT g_cfDataObjPtr  = 0;
00030
00031 //---------------------------------------------------------------------------
00032 //  MultiSelect clipboard formats
00033
00034 UINT g_cfMS_Snapins  = 0;
00035 UINT g_cfMS_Objects  = 0;
00036 UINT g_cfMS_IsMsObj  = 0;
00037 UINT g_cfMS_Cookies  = 0;      // Custom clipformat for getting cookies
00038
00039 //---------------------------------------------------------------------------
00040 // Global variables
00041
00042 HINSTANCE g_hInst = NULL;      // Our global instance handle
00043 ULONG g_uObjectCount = 0;      // Global object count
00044 ULONG g_uServerLocks = 0;      // Global lock count
00045
00046
00047 //---------------------------------------------------------------------------
00048 //  This is the fast, simple way to convert unicode to ansi.  It does NOT
00049 //  handle multibyte ansi strings and is not localized.  But it should be
00050 //  fine for registry entries
00051 //  NOTE:  The caller is responsible for freeing the memory.
00052 //
00053 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide )
00054 {
00055   LONG nLen = wcslen( szWide ) +1;
00056   *pszAnsi = (char*)CoTaskMemAlloc( nLen );
00057   char* pCounter = *pszAnsi;
00058
00059   while( *szWide )
00060   {
00061     *pCounter = LOBYTE(*szWide);
00062     pCounter++;
00063     szWide++;
00064   }
00065   *pCounter = NULL;
00066 }
00067
00068 //---------------------------------------------------------------------------
00069 //  copies a string ( like strncpy )
00070 //  in non-unicode version coverts ansi-to-unicode first.
00071 //
00072 void _fastcall CopyT2W( LPWSTR strDest, LPCTSTR strSource, size_t count)
00073 {
00074 #ifndef _UNICODE
00075
00076   MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, strSource, -1, strDest, count );
00077
00078 #else
00079
00080   wcsncpy( strDest, strSource, count );
00081
00082 #endif
00083
00084   if ( count > 0 )
00085     strDest[ count - 1 ] = 0;
00086 }
00087
00088 //---------------------------------------------------------------------------
00089 //  This helper determines if the data object is a MultiSelect Composite
00090 //  Data Object created by the console.
00091 //
00092 DWORD  IsCompositeDataObject( LPDATAOBJECT ipDataObject )
00093 {
00094   _ASSERT( NULL != ipDataObject );
00095   DWORD      dwIsMSDO = 0;
00096   FORMATETC FormatEtc = { g_cfMS_IsMsObj, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00097   STGMEDIUM StgMedium = { TYMED_HGLOBAL,  NULL };
00098
00099   HRESULT hResult = ipDataObject->GetData( &FormatEtc, &StgMedium );
00100   if( S_OK == hResult )
00101   {
00102     dwIsMSDO = *(DWORD*)StgMedium.hGlobal;
00103     GlobalFree( StgMedium.hGlobal );
00104   }
00105
00106   return dwIsMSDO;
00107 }
00108
00109
00110 //---------------------------------------------------------------------------
00111 //
00112 void InitClipboardFormats()
00113 {
00114   g_cfDisplayName  = RegisterClipboardFormat( T_CCF_DISPLAY_NAME );
00115   g_cfNodeType     = RegisterClipboardFormat( T_CCF_NODETYPE );
00116   g_cfszNodeType   = RegisterClipboardFormat( T_CCF_SZNODETYPE );
00117   g_cfSnapinClsid  = RegisterClipboardFormat( T_CCF_SNAPIN_CLASSID );
00118
00119   g_cfBaseNodePtr  = RegisterClipboardFormat( T_CCF_BASENODE_PTR );
00120   g_cfDataObjPtr   = RegisterClipboardFormat( T_CCF_DATAOBJ_PTR );
00121
00122   // MULTISELECT: Register new clipformats
00123   g_cfMS_Snapins   = RegisterClipboardFormat( T_CCF_MULTI_SELECT_SNAPINS );
00124   g_cfMS_Objects   = RegisterClipboardFormat( T_CCF_OBJECT_TYPES_IN_MULTI_SELECT );
00125   g_cfMS_IsMsObj   = RegisterClipboardFormat( T_CCF_MMC_MULTISELECT_DATAOBJECT );
00126
00127   g_cfMS_Cookies   = RegisterClipboardFormat( T_CCF_MULTISELECT_COOKIES );
00128
00129 }
00130
00131 //---------------------------------------------------------------------------
00132 //  Extracts data based on the passed-in clipboard format
00133 //
00134 HRESULT ExtractFromDataObject
00135 (
00136   LPDATAOBJECT ipDataObject,   // [in]  Points to data object
00137   UINT         cfClipFormat,   // [in]  Clipboard format to use
00138   ULONG        nByteCount,     // [in]  Number of bytes to allocate
00139   HGLOBAL      *phGlobal       // [out] Points to the data we want
00140 )
00141 {
00142   _ASSERT( NULL != ipDataObject );
00143
00144             *phGlobal = NULL;
00145   HRESULT   hResult   = S_FALSE;
00146   STGMEDIUM StgMedium = { TYMED_HGLOBAL,  NULL  };
00147   FORMATETC FormatEtc = { cfClipFormat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00148
00149   do
00150   {
00151     // Allocate memory for the stream
00152     StgMedium.hGlobal = ::GlobalAlloc( GMEM_SHARE, nByteCount );
00153
00154     if( NULL == StgMedium.hGlobal )
00155     {
00156       hResult = E_OUTOFMEMORY;
00157       break;
00158     }
00159
00160     // Attempt to get data from the object
00161     hResult = ipDataObject->GetDataHere( &FormatEtc, &StgMedium );
00162     if( FAILED(hResult) )
00163     {
00164       break;
00165     }
00166     // StgMedium now has the data we need
00167     *phGlobal = StgMedium.hGlobal;
00168     StgMedium.hGlobal = NULL;
00169
00170   } while (0);
00171
00172   if( FAILED(hResult) && StgMedium.hGlobal )
00173   {
00174     HGLOBAL hRetVal = ::GlobalFree(StgMedium.hGlobal);
00175     _ASSERT( NULL == hRetVal );         // Must return NULL
00176   }
00177   return hResult;
00178
00179 }
00180
00181
00182 //---------------------------------------------------------------------------
00183 //  This helper returns the current BaseNode object on the custom
00184 //  g_cfBaseNodePtr clipboard format
00185 //
00186 CBaseNode* ExtractBaseNodePtr
00187 (
00188   LPDATAOBJECT ipDataObject      // [in] IComponent pointer
00189 )
00190 {
00191   LPBASENODE  pNode   = NULL;
00192   HGLOBAL     hGlobal = NULL;
00193   HRESULT     hResult = S_FALSE;
00194
00195   hResult = ExtractFromDataObject( ipDataObject,
00196                                    g_cfBaseNodePtr,
00197                                    sizeof(LPBASENODE),
00198                                    &hGlobal
00199                                  );
00200   if( SUCCEEDED(hResult) )
00201   {
00202     pNode = *(LPBASENODE*)(hGlobal);
00203     HGLOBAL hRetVal = GlobalFree(hGlobal);
00204     _ASSERT( NULL == hRetVal );        // Must return NULL
00205   }
00206
00207   return pNode;
00208
00209 }
00210
00211 //---------------------------------------------------------------------------
00212 //  Converts an IDataObject pointer to a CDataObject pointer by
00213 //  retrieving a "this" pointer using a custom clipboard format.
00214 //
00215 CDataObject* ExtractDataObjPtr
00216 (
00217   LPDATAOBJECT ipDataObject      //[in] IDataObject pointer
00218 )
00219 {
00220   _ASSERT( 0 != g_cfDataObjPtr );
00221
00222   HGLOBAL      hGlobal = NULL;
00223   HRESULT      hResult = S_OK;
00224   CDataObject* pDO     = NULL;
00225
00226   hResult = ExtractFromDataObject( ipDataObject,
00227                                    g_cfDataObjPtr,
00228                                    sizeof(CDataObject **),
00229                                    &hGlobal
00230                                  );
00231
00232   if( SUCCEEDED(hResult) )
00233   {
00234     pDO = *(CDataObject **)(hGlobal);
00235     _ASSERT( NULL != pDO );
00236
00237     HGLOBAL hRetVal = GlobalFree(hGlobal);
00238     _ASSERT( NULL == hRetVal );       // Must return NULL
00239   }
00240
00241   return pDO;
00242
00243 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/PoolWrap/Extension.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • PoolWrap

Extension.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003 Microsoft Corporation
00004
00005 Module Name: Extension.cpp
00006
00007 Abstract:
00008
00009     ISAPI extension to demonstrate the PoolWrap thread pool wrapper.
00010     This could be just about any extension.
00011
00012     Basic functionality is as follows:
00013
00014     - A request with no query string will display the help page
00015     - A request with query string of "statistics" will return a page
00016       listing total request and busy page counts since this extension
00017       was initialized
00018     - A request with a single numeric argument on the query string will
00019       simulate waiting on a blocking call by sleeping for that number
00020       of milliseconds
00021     - A request with two numeric arguments on the query string separated
00022       by a '+' will simulate waiting on a blocking call by sleeping for
00023       a random amount of time between the first number and second number
00024       in milliseconds (if the second number is smaller than the first,
00025       then the help page will be returned)
00026
00027 Author:
00028
00029     ISAPI developer (Microsoft employee), January 2001
00030
00031 --*/
00032
00033 #define _WIN32_WINNT 0x0500
00034
00035 #include <time.h>
00036 #include <stdio.h>
00037 #include <windows.h>
00038 #include <httpext.h>
00039 #include "PoolWrap.h"
00040
00041 #define STRING_BUFFER   1024
00042
00043 //
00044 // Globals
00045 //
00046
00047 SYSTEMTIME  g_StartTime;
00048
00049 //
00050 // Private definitions
00051 //
00052
00053 VOID
00054 CopyStringAndTerminate(
00055     LPSTR   szTarget,
00056     LPSTR   szSource,
00057     DWORD   cbTarget = 0
00058     );
00059
00060 DWORD
00061 SendHelpPage(
00062     EXTENSION_CONTROL_BLOCK *   pecb
00063     );
00064
00065 DWORD
00066 SendStatisticsPage(
00067     EXTENSION_CONTROL_BLOCK *   pecb
00068     );
00069
00070 BOOL
00071 SendHeaders(
00072     EXTENSION_CONTROL_BLOCK *   pecb,
00073     LPSTR                       szStatus,
00074     LPSTR                       szHeaders,
00075     DWORD                       cbContent = 0
00076     );
00077
00078 //
00079 // Implement functions required by PoolWrap.  This includes the 3 well
00080 // known ISAPI entry points, plus the InitThread function.
00081 //
00082
00083 BOOL
00084 InitThread(
00085     VOID
00086     )
00087 {
00088     //
00089     // Don't do any special initialization
00090     //
00091
00092     return TRUE;
00093 }
00094
00095 VOID
00096 UninitThread(
00097     VOID
00098     )
00099 {
00100     //
00101     // Don't do any special uninitialization
00102     //
00103
00104     return;
00105 }
00106
00107 BOOL
00108 WINAPI
00109 GetExtensionVersion(
00110     HSE_VERSION_INFO *pVer
00111     )
00112 /*++
00113
00114 Purpose:
00115
00116     This is a required ISAPI Extension DLL entry point.
00117
00118 Arguments:
00119
00120     pVer - points to extension version info structure
00121
00122 Returns:
00123
00124     TRUE on success, FALSE on failure.  Note that on a FALSE
00125     return, it should ensure that the Win32 last error is set.
00126
00127 --*/
00128 {
00129   //
00130     // Set the extension version
00131     //
00132
00133     pVer->dwExtensionVersion = MAKELONG(
00134         HSE_VERSION_MINOR,
00135         HSE_VERSION_MAJOR
00136         );
00137
00138     //
00139     // Set the extension description
00140     //
00141
00142   lstrcpyn(
00143         pVer->lpszExtensionDesc,
00144         "TestPoolWrap test ISAPI extension",
00145         HSE_MAX_EXT_DLL_NAME_LEN
00146         );
00147
00148     //
00149     // Seed the random number generator and get the
00150     // time at which this extension initialized
00151     //
00152
00153     srand( (unsigned)time( NULL ) );
00154
00155     GetLocalTime( &g_StartTime );
00156
00157   return TRUE;
00158 }
00159
00160 DWORD
00161 WINAPI
00162 HttpExtensionProc(
00163     EXTENSION_CONTROL_BLOCK *   pecb
00164     )
00165 /*++
00166
00167 Purpose:
00168
00169     Entry point for requests to this extension
00170
00171     Note that we assume that the response will fit into our
00172     string buffer, and don't take any action to prevent a
00173     problem with this (since the client can't do anything
00174     to increase the size of the response).
00175
00176 Arguments:
00177
00178     pecb - Pointer to the EXTENSION_CONTROL_BLOCK for this request
00179
00180 Returns:
00181
00182     One of the HSE_STATUS result codes
00183
00184 --*/
00185 {
00186     CHAR    szQuery[STRING_BUFFER+1] = {0};
00187     CHAR    szContent[STRING_BUFFER+1] = {0};
00188     LPSTR   pCursor;
00189     DWORD   dwMinWait;
00190     DWORD   dwMaxWait;
00191     DWORD   dwSleepTime;
00192     DWORD   cbToSend;
00193
00194     //
00195     // Process the query string
00196     //
00197
00198     if ( pecb->lpszQueryString[0] == '\0' )
00199     {
00200         return SendHelpPage( pecb );
00201     }
00202
00203     if ( stricmp( pecb->lpszQueryString, "statistics" ) == NULL )
00204     {
00205         return SendStatisticsPage( pecb );
00206     }
00207
00208     CopyStringAndTerminate( szQuery, pecb->lpszQueryString, STRING_BUFFER );
00209
00210     pCursor = strchr( szQuery, '+' );
00211
00212     if ( pCursor == NULL )
00213     {
00214         dwMinWait = atol( szQuery );
00215         dwMaxWait = dwMinWait;
00216     }
00217     else
00218     {
00219         *pCursor = '\0';
00220
00221         dwMinWait = atol( szQuery );
00222         dwMaxWait = atol( pCursor + 1 );
00223     }
00224
00225     //
00226     // Calculate the sleep time and do it
00227     //
00228
00229     if ( dwMaxWait < dwMinWait )
00230     {
00231         return SendHelpPage( pecb );
00232     }
00233
00234     if ( dwMaxWait > dwMinWait )
00235     {
00236         dwSleepTime = dwMinWait + ( rand() % ( dwMaxWait - dwMinWait ) );
00237     }
00238     else
00239     {
00240         dwSleepTime = dwMinWait;
00241     }
00242
00243     Sleep( dwSleepTime );
00244
00245     //
00246     // Now send the response
00247     //
00248
00249     _snprintf(
00250         szContent,
00251         STRING_BUFFER,
00252         "<html>\r\n"
00253         "<head> <title> %s.dll </title> </head>\r\n"
00254         "<h1> %s.dll </h1>\r\n"
00255         "<hr>\r\n"
00256         "%s.dll has sent this response after simulating a wait "
00257         "for %d milliseconds.",
00258         MODULE_NAME,
00259         MODULE_NAME,
00260         MODULE_NAME,
00261         dwSleepTime
00262         );
00263
00264     cbToSend = strlen( szContent );
00265
00266     SendHeaders(
00267         pecb,
00268         "200 OK",
00269         "Content-Type: text/html\r\n\r\n",
00270         cbToSend
00271         );
00272
00273     pecb->WriteClient(
00274         pecb->ConnID,
00275         szContent,
00276         &cbToSend,
00277         HSE_IO_SYNC | HSE_IO_NODELAY
00278         );
00279
00280     return HSE_STATUS_SUCCESS;
00281 }
00282
00283 BOOL
00284 WINAPI
00285 TerminateExtension(
00286     DWORD dwFlags
00287     )
00288 /*++
00289
00290 Purpose:
00291
00292     This is optional ISAPI extension DLL entry point.
00293     If present, it will be called before unloading the DLL,
00294     giving it a chance to perform any shutdown procedures.
00295
00296 Arguments:
00297
00298     dwFlags - Specifies whether the DLL can refuse to unload or not.  Note
00299               that the case where refusal is allowed is not supported and
00300               should not be expected.
00301
00302 Returns:
00303
00304     TRUE, if the DLL can be unloaded
00305
00306 --*/
00307 {
00308     switch ( dwFlags )
00309     {
00310     case HSE_TERM_ADVISORY_UNLOAD:
00311
00312         //
00313         // Return TRUE if ok to unload or FALSE if not.
00314         //
00315         // This case is not expected to occur
00316         //
00317
00318         return TRUE;
00319
00320     case HSE_TERM_MUST_UNLOAD:
00321
00322         //
00323         // Cannot refuse to unload
00324         //
00325
00326         return TRUE;
00327     }
00328
00329     return TRUE;
00330 }
00331
00332 VOID
00333 CopyStringAndTerminate(
00334     LPSTR   szTarget,
00335     LPSTR   szSource,
00336     DWORD   cbTarget
00337     )
00338 /*++
00339
00340 Purpose:
00341
00342     This function is just a wrapper for strncpy.  If cbTarget is
00343     non-zero, it will NULL terminate the last character in the
00344     buffer.  This will help prevent buffer overruns by ensuring
00345     it's always safe to call string functions on the target.
00346
00347     If you use strncpy without taking this extra step, and
00348     szSource is longer than szTarget, then szTarget will not be
00349     NULL terminated, and string operations can overrun the buffer.
00350
00351 Arguments:
00352
00353     szTarget - The target buffer
00354     szSource - The data to be copied
00355     cbTarget - The size of szTarget
00356
00357 Returns:
00358
00359     None
00360
00361 --*/
00362 {
00363     if ( cbTarget == 0 )
00364     {
00365         strcpy( szTarget, szSource );
00366     }
00367     else
00368     {
00369         strncpy( szTarget, szSource, cbTarget );
00370         szTarget[cbTarget-1] = '\0';
00371     }
00372 }
00373
00374 DWORD
00375 SendHelpPage(
00376     EXTENSION_CONTROL_BLOCK *   pecb
00377     )
00378 /*++
00379
00380 Purpose:
00381
00382     Returns the help page to the client
00383
00384 Arguments:
00385
00386     pecb - The EXTENSION_CONTROL_BLOCK for the request
00387
00388     Note that we assume that the response will fit into our
00389     string buffer, and don't take any action to prevent a
00390     problem with this (since the client can't do anything
00391     to increase the size of the response).
00392
00393 Returns:
00394
00395     HSE_STATUS_SUCCESS
00396
00397 --*/
00398 {
00399     CHAR    szContent[STRING_BUFFER+1] = {0};
00400     DWORD   cbToSend;
00401
00402     _snprintf(
00403         szContent,
00404         STRING_BUFFER,
00405         "<html>\r\n"
00406         "<head> <title> %s.dll </title> </head>\r\n"
00407         "<h1> %s.dll </h1>\r\n"
00408         "A simple extension to demonstrate PoolWrap.cpp."
00409         "<hr>\r\n"
00410         "A request with no query string, or an invalid query "
00411         "string, will return this page.  The following querys "
00412         "will produce the specified results:<br>\r\n"
00413         "<br>\r\n"
00414         "<code>http://server/DemoPoolWrap.dll?statistics</code><br>\r\n"
00415         "Returns some statistics from this extension <br><br>\r\n"
00416         "<code>http://server/DemoPoolWrap.dll?&lttime&gt</code><br>\r\n"
00417         "Returns a page after waiting on a blocking call for the "
00418         "specified number of milliseconds <br><br>\r\n"
00419         "<code>http://server/DemoPoolWrap.dll?&ltmin-time&gt+&ltmax-time&gt</code><br>\r\n"
00420         "Returns a page after waiting on a blocking call for a random "
00421         "interval in the specified range in milliseconds",
00422         MODULE_NAME,
00423         MODULE_NAME
00424         );
00425
00426     cbToSend = strlen( szContent );
00427
00428     SendHeaders(
00429         pecb,
00430         "200 OK",
00431         "Content-Type: text/html\r\n\r\n",
00432         cbToSend
00433         );
00434
00435     pecb->WriteClient(
00436         pecb->ConnID,
00437         szContent,
00438         &cbToSend,
00439         HSE_IO_SYNC | HSE_IO_NODELAY
00440         );
00441
00442     return HSE_STATUS_SUCCESS;
00443 }
00444
00445 DWORD
00446 SendStatisticsPage(
00447     EXTENSION_CONTROL_BLOCK *   pecb
00448     )
00449 /*++
00450
00451 Purpose:
00452
00453     Returns the statistics page to the client.
00454
00455     Note that we assume that the response will fit into our
00456     string buffer, and don't take any action to prevent a
00457     problem with this (since the client can't do anything
00458     to increase the size of the response).
00459
00460 Arguments:
00461
00462     pecb - The EXTENSION_CONTROL_BLOCK for the request
00463
00464 Returns:
00465
00466     HSE_STATUS_SUCCESS
00467
00468 --*/
00469 {
00470     CHAR    szContent[STRING_BUFFER+1];
00471     CHAR    szStartTime[64];
00472     CHAR    szTime[32];
00473     CHAR    szDate[32];
00474     DWORD   cbToSend;
00475
00476     //
00477     // Generate the start time stamp
00478     //
00479
00480     GetLocalTime( &g_StartTime );
00481
00482   GetTimeFormat(
00483         LOCALE_SYSTEM_DEFAULT,
00484         0,
00485         &g_StartTime,
00486         "HH':'mm':'ss",
00487         szTime,
00488         32
00489         );
00490
00491   GetDateFormat(
00492         LOCALE_SYSTEM_DEFAULT,
00493         0,
00494         &g_StartTime,
00495         "ddd',' MMM dd yyyy",
00496         szDate,
00497         32
00498         );
00499
00500     wsprintf( szStartTime, "[%s - %s] ", szDate, szTime );
00501
00502     //
00503     // Generate the response
00504     //
00505
00506     _snprintf(
00507         szContent,
00508         STRING_BUFFER,
00509         "<html>\r\n"
00510         "<head> <title> %s.dll </title> </head>\r\n"
00511         "<h1> %s.dll Statistics:</h1>\r\n"
00512         "<hr>\r\n"
00513         "The extension was started at: %s<br>\r\n\r\n"
00514         "Total Pages Served: %d<br>\r\n"
00515         "Busy Pages Served: %d<br>",
00516         MODULE_NAME,
00517         MODULE_NAME,
00518         szStartTime,
00519         g_TotalRequests,
00520         g_QueueFullPages
00521         );
00522
00523     cbToSend = strlen( szContent );
00524
00525     SendHeaders(
00526         pecb,
00527         "200 OK",
00528         "Content-Type: text/html\r\n\r\n",
00529         cbToSend
00530         );
00531
00532     pecb->WriteClient(
00533         pecb->ConnID,
00534         szContent,
00535         &cbToSend,
00536         HSE_IO_SYNC | HSE_IO_NODELAY
00537         );
00538
00539     return HSE_STATUS_SUCCESS;
00540 }
00541
00542 BOOL
00543 SendHeaders(
00544     EXTENSION_CONTROL_BLOCK *   pecb,
00545     LPSTR                       szStatus,
00546     LPSTR                       szHeaders,
00547     DWORD                       cbContent
00548     )
00549 /*++
00550
00551 Purpose:
00552
00553     A simple HSE_REQ_SEND_RESPONSE_HEADER_EX wrapper that adds
00554     an optional content-length header to the response
00555
00556 Arguments:
00557
00558     pecb      - The EXTENSION_CONTROL_BLOCK for the request
00559     szStatus  - The status (ie. "200 OK") to be sent
00560     szHeaders - The headers (ie. "content-type: text/html\r\n\r\n"
00561                 to be sent
00562     cbContent - If non-zero, will be used to generate a
00563                 content-length header to add to the response
00564
00565 Returns:
00566
00567     None
00568
00569 --*/
00570 {
00571     HSE_SEND_HEADER_EX_INFO HeaderInfo;
00572     CHAR                    szCookedHeaders[STRING_BUFFER+1] = {0};
00573     LPSTR                   pHeaders;
00574
00575     if ( cbContent == 0 )
00576     {
00577         pHeaders = szHeaders;
00578     }
00579     else
00580     {
00581         _snprintf(
00582             szCookedHeaders,
00583             STRING_BUFFER,
00584             "Content-Length: %d\r\n%s",
00585             cbContent,
00586             szHeaders
00587             );
00588
00589         pHeaders = szCookedHeaders;
00590     }
00591
00592     HeaderInfo.pszHeader = pHeaders;
00593     HeaderInfo.pszStatus = szStatus;
00594     HeaderInfo.cchHeader = strlen( HeaderInfo.pszHeader );
00595     HeaderInfo.cchStatus = strlen( HeaderInfo.pszStatus );
00596     HeaderInfo.fKeepConn = cbContent ? TRUE : FALSE;
00597
00598     return pecb->ServerSupportFunction(
00599         pecb->ConnID,
00600         HSE_REQ_SEND_RESPONSE_HEADER_EX,
00601         &HeaderInfo,
00602         NULL,
00603         NULL
00604         );
00605 }
00606
00607
00608
00609
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/staticnode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

staticnode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CStaticNode class.
00014 //
00015
00016 #include "StaticNode.h"
00017 #include "DeviceNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "AddDeviceDlg.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CStaticNode")
00026
00027
00028 // Initialize our static GUID just once.  We use the GUID for
00029 // CComponentData because this node handles events for the
00030 // Snap-in's namespace
00031 GUID CStaticNode::thisGUID = CLSID_CComponentData;
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Construction/Destruction
00036
00037 //---------------------------------------------------------------------------
00038 CStaticNode::CStaticNode()
00039 {
00040   m_SDI.mask        = DEFAULT_SDI_MASK;
00041   m_SDI.displayname = MMC_CALLBACK;
00042   m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00043   m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00044   m_SDI.cChildren   = 1;              // Determines if the '+' is displayed
00045   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00046
00047   m_hStaticNode     = NULL;
00048   m_pCompData       = NULL;
00049   m_hAddDeviceDlg   = NULL;
00050 }
00051
00052 //---------------------------------------------------------------------------
00053 CStaticNode::~CStaticNode()
00054 {
00055   if( NULL != m_hMessageWnd )
00056     DestroyWindow( m_hMessageWnd );
00057 }
00058
00059 //---------------------------------------------------------------------------
00060 HRESULT CStaticNode::Initialize
00061 (
00062   LPNODEPROPS  pNodeProps    //[in] Properties for this node
00063 )
00064 {
00065   _ASSERT( NULL != pNodeProps );
00066   HRESULT hResult = S_FALSE;
00067
00068   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00069   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00070   wcscpy( pszTmp, pNodeProps->szNodeName );
00071   if( NULL != m_pwszNodeName )
00072     CoTaskMemFree( m_pwszNodeName );
00073
00074   m_pwszNodeName = pszTmp;
00075   m_pCompData = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00076
00077   if( INIT_DEFAULT_NODE == pNodeProps->nChildCount )
00078   {
00079     hResult = InitDefaultDevices();        // Initialize static top level scope nodes
00080   }
00081   else
00082   {
00083     // Can't DragDrop device nodes to another static node
00084   }
00085
00086   // We create a hidden window to allow us to communicate with modeless
00087   // dialogs and other things which run in a seperate thread.
00088   //
00089   WNDCLASS wc;
00090   ZeroMemory (&wc, sizeof(WNDCLASS));
00091   wc.cbWndExtra    = sizeof(this);
00092   wc.lpfnWndProc   = StaticNodeWndProc;
00093   wc.hInstance     = g_hInst;
00094   wc.lpszClassName = _T("StaticNodeMessageWindow");
00095
00096   RegisterClass( &wc );
00097   m_hMessageWnd = CreateWindow( _T("StaticNodeMessageWindow"), NULL,
00098                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00099
00100   if( NULL == m_hMessageWnd )
00101     hResult = S_FALSE;
00102
00103   return hResult;
00104 }
00105
00106
00107 //---------------------------------------------------------------------------
00108 //  This is our hidden window which is just used for handling messages.  We
00109 //  go to all this trouble so that we don't ever pass interface pointers or
00110 //  other objects across threads.
00111 //
00112 LRESULT CALLBACK CStaticNode::StaticNodeWndProc
00113 (
00114   HWND   hWnd,     //[in] Handle to window
00115   UINT   uMsg,     //[in] Message identifier
00116   WPARAM wParam,   //[in] First message parameter
00117   LPARAM lParam    //[in] Second message parameter
00118 )
00119 {
00120   switch( uMsg )
00121   {
00122     // Since we registered the WndClass in Initialize, our WndProc will be
00123     // called with WM_CREATE right away.  Store our 'hWnd' pointer in the
00124     // CREATESTRUCT so we can retreive it later to get back to the specific
00125     // instance of CComponentData
00126     //
00127     case WM_CREATE:
00128     {
00129       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00130       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00131       break;
00132     }
00133
00134     // This is our custom message which could have been sent from a worker
00135     // thread, or in this case a modeless dialog.  We retrieve our 'this'
00136     // pointer from the WndClass and cast it to a CComponentData pointer.
00137     // WPARAM is cast to a NODE_PROPERTIES struct which can be used to
00138     // call AddDeviceNode()
00139     //
00140     case WM_ADD_DEVICENODE:
00141     {
00142       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00143       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00144       pThisNode->AddDeviceNode( pProps );
00145       break;
00146     }
00147
00148     // This message is sent by the AddDeviceDlg to let us know it's
00149     // being terminated.  Set our member handle to NULL so the item
00150     // will be show on the context menu
00151     //
00152     case WM_DEVICENODE_CLOSED:
00153     {
00154       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00155       pThisNode->m_hAddDeviceDlg = NULL;
00156       break;
00157     }
00158     default:
00159       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00160   }
00161   return 0;
00162 }
00163
00164
00165 /////////////////////////////////////////////////////////////////////////////
00166 // Implementation of virtual methods
00167
00168 //---------------------------------------------------------------------------
00169 //  Can't copy or move the static node so this is not implemented
00170 //
00171 HRESULT CStaticNode::GetProperties
00172 (
00173   LPNODEPROPS* ppNodeProps   //[out] Properties of this node
00174 )
00175 {
00176   _ASSERT( NULL == *ppNodeProps );
00177   return E_NOTIMPL;
00178 }
00179
00180 //---------------------------------------------------------------------------
00181 //  The minimum implementation of this method is to return the
00182 //  Persistable View Description string.  This string must be allocated
00183 //  with CoTaskMemAlloc.  The console will free the string.
00184 //
00185 HRESULT CStaticNode::GetResultViewType2
00186 (
00187   MMC_COOKIE             nCookie,  //[in] Identifier of object
00188   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00189 )
00190 {
00191   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+1 );
00192   if( NULL == pszDescStr )
00193     return E_OUTOFMEMORY;
00194
00195   wcscpy( pszDescStr, L"DefaultListView" );
00196   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00197
00198   return S_OK;
00199 }
00200
00201 //---------------------------------------------------------------------------
00202 HRESULT CStaticNode::GetDisplayInfo
00203 (
00204   SCOPEDATAITEM* pSDI        //[in,out] Points to SCOPEDATAITEM
00205 )
00206 {
00207   _ASSERT( NULL != pSDI );
00208   pSDI->displayname = m_pwszNodeName;
00209
00210   return S_OK;
00211 }
00212
00213 //---------------------------------------------------------------------------
00214 HRESULT CStaticNode::GetDisplayInfo
00215 (
00216   RESULTDATAITEM* pRDI       //[in,out] Points to RESULTDATAITEM
00217 )
00218 {
00219   // This method will not get called since the static node is never
00220   // displayed in the result pane
00221   return S_FALSE;
00222 }
00223
00224 /////////////////////////////////////////////////////////////////////////////
00225 // Implementation of notification handlers
00226
00227 //---------------------------------------------------------------------------
00228 HRESULT CStaticNode::OnShow
00229 (
00230   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00231   LPARAM        nArg,          //[in] TRUE if node was selcted
00232   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00233   LONG_PTR      pComponent     //[in] Points to calling IComponent
00234 )
00235 {
00236   HRESULT  hResult = S_FALSE;
00237
00238   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00239
00240   LPHEADERCTRL2  ipHeaderCtrl = NULL;
00241   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL, (LONG_PTR*)&ipHeaderCtrl );
00242   if( S_OK != hResult )
00243    return hResult;
00244
00245   LPRESULTDATA  ipResultData = NULL;
00246   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00247   if( S_OK != hResult )
00248    return hResult;
00249
00250   if( TRUE == nArg )  // Selecting a scope node
00251   {
00252     do
00253     {
00254       hResult = ipHeaderCtrl->InsertColumn( 0, L"Device Name", 0, 150 );
00255       BREAK_ON_ERROR( hResult );
00256
00257       hResult = ipHeaderCtrl->InsertColumn( 1, L"Status", 0, 150 );
00258       BREAK_ON_ERROR( hResult );
00259
00260       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00261       BREAK_ON_ERROR( hResult );
00262
00263     }while(0);
00264   }
00265   else // not handling deselect notifications
00266   {
00267   }
00268
00269   //TRACE_HRESULT(_T("OnShow"), hResult );
00270   return hResult;
00271 }
00272
00273
00274 //---------------------------------------------------------------------------
00275 HRESULT CStaticNode::OnSelect
00276 (
00277   LPDATAOBJECT   ipDataObject,   //[in] Points to the selected data object
00278   LPARAM         nArg,           //[in] Status of selected item
00279   LPARAM         nParam,         //[in] Not used
00280   LONG_PTR       pComponent      //[in] Pointer to parent CComponent
00281 )
00282 {
00283   BOOL    fScopePane = LOWORD(nArg);
00284   BOOL    fSelected  = HIWORD(nArg);
00285   HRESULT hResult    = S_FALSE;
00286
00287   if( NULL == ipDataObject )           // Can get this when closing the SnapIn
00288     return hResult;
00289
00290   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00291   LPCONSOLEVERB  ipConsoleVerb = NULL;
00292   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00293   if( S_OK != hResult )
00294     return hResult;
00295
00296   if( TRUE == fScopePane && TRUE == fSelected )
00297   {
00298     // No verbs for the static node
00299   }
00300
00301
00302   //TRACE_HRESULT(_T("OnSelect"), hResult );
00303   return hResult;
00304
00305 }
00306
00307 //---------------------------------------------------------------------------
00308 //  The static node is a special case.  The CComponentData pointer is also
00309 //  our parent so we don't need to use the pCompData parameter
00310 //
00311 HRESULT CStaticNode::OnExpand
00312 (
00313   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00314   LPARAM         nArg,         //[in] TRUE if node was selcted
00315   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00316   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00317 )
00318 {
00319   HRESULT hResult = S_FALSE;
00320
00321   if( NULL == m_hStaticNode )          // Cache the root node handle
00322     m_hStaticNode = static_cast<HSCOPEITEM>(nParam);
00323
00324   if( NULL == m_pCompData )
00325     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00326
00327   // Request an IConsoleNameSpace2 pointer from CComponentData
00328   LPCONSOLENAMESPACE2 ipCNS = NULL;
00329   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00330   if( S_OK != hResult )
00331     return hResult;
00332
00333   hResult = DeleteScopeItems( ipCNS );
00334   hResult = InsertScopeItems( ipCNS );
00335
00336   return hResult;
00337 }
00338
00339
00340 //---------------------------------------------------------------------------
00341 HRESULT CStaticNode::OnRemoveChildren
00342 (
00343   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00344   LPARAM         nArg,         //[in] TRUE if node was selcted
00345   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00346   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00347 )
00348 {
00349   HRESULT hResult = S_FALSE;
00350
00351   if( NULL == m_pCompData )
00352     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00353
00354   LPCONSOLENAMESPACE2 ipCNS = NULL;
00355   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00356   if( S_OK != hResult )
00357     return hResult;
00358
00359   hResult = DeleteScopeItems( ipCNS );
00360
00361   POSITION   Pos   = m_NodeList.GetHeadPosition();
00362   LPBASENODE pNode = NULL;
00363   while( Pos )                         // Delete everything...
00364   {
00365     pNode = m_NodeList.GetNext( Pos );
00366     pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00367     delete pNode;
00368   }
00369
00370   m_NodeList.RemoveAll();              // Cleanup the list
00371
00372   //TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00373   return hResult;
00374 }
00375
00376 /////////////////////////////////////////////////////////////////////////////
00377 // Private helper methods
00378
00379
00380 //---------------------------------------------------------------------------
00381 //  Initializes the node list.
00382 //
00383 HRESULT CStaticNode::InitDefaultDevices()
00384 {
00385   NODEPROPS NodeProps;
00386   ZeroMemory( &NodeProps, sizeof(NODEPROPS) );
00387   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00388   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00389   NodeProps.dwAttributes   = 0;
00390   NodeProps.nChildCount    = INIT_DEFAULT_NODE;
00391
00392   WCHAR  szNames[2][32];
00393   wcscpy( szNames[0], L"RamDisk 0" );
00394   wcscpy( szNames[1], L"Archive 0" );
00395
00396   RemoveNodes();                       // Clean the node list
00397
00398   CDeviceNode* pNode = NULL;
00399   for( DWORD i = 0; i < 2; i++ )
00400   {
00401     wcscpy( NodeProps.szNodeName, szNames[i] );
00402     pNode = new CDeviceNode;
00403     pNode->Initialize( &NodeProps );
00404     m_NodeList.AddTail( pNode );
00405
00406     // Kind of a hack, make the second device a backup device
00407     NodeProps.dwAttributes |= ATTRIBUTE_BACKUP_DEVICE;
00408   }
00409
00410   return S_OK;
00411 }
00412
00413
00414 //---------------------------------------------------------------------------
00415 //  For these first level nodes the parent is always the static or root
00416 //  node.
00417 //
00418 HRESULT CStaticNode::InsertScopeItems
00419 (
00420   LPCONSOLENAMESPACE2 ipCNS    //[in] Needed to insert items
00421 )
00422 {
00423   _ASSERT( NULL != ipCNS );
00424   _ASSERT( NULL != m_hStaticNode );
00425
00426   HRESULT      hResult = S_FALSE;
00427   POSITION     Pos     = m_NodeList.GetHeadPosition();
00428   CDeviceNode* pNode   = NULL;
00429
00430   while( Pos )
00431   {
00432     pNode   = m_NodeList.GetNext( Pos );
00433     pNode->m_SDI.relativeID = m_hStaticNode;
00434     hResult = ipCNS->InsertItem( &pNode->m_SDI );
00435   }
00436
00437   return hResult;
00438 }
00439
00440
00441 //---------------------------------------------------------------------------
00442 //  Delete the HSCOPEITEMS only, we leave the list of nodes untouched
00443 //
00444 HRESULT CStaticNode::DeleteScopeItems
00445 (
00446   LPCONSOLENAMESPACE2 ipCNS    //[in] Needed to delete items
00447 )
00448 {
00449   _ASSERT( NULL != ipCNS );
00450
00451   POSITION    Pos     = m_NodeList.GetHeadPosition();
00452   HSCOPEITEM  hItem   = NULL;
00453   LPBASENODE  pNode   = NULL;
00454   HRESULT     hResult = S_FALSE;
00455
00456   while( Pos )                         // Delete everything...
00457   {
00458     pNode = m_NodeList.GetNext( Pos );
00459     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00460     if( 0 != hItem )
00461       hResult = ipCNS->DeleteItem( hItem, TRUE );
00462   }
00463
00464   return hResult;
00465
00466 }
00467
00468 //---------------------------------------------------------------------------
00469 //  We do this instead of just calling RemoveAll() because our list contains
00470 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00471 //  the derived class object.
00472 //
00473 VOID CStaticNode::RemoveNodes()
00474 {
00475   LPBASENODE pNode = NULL;
00476   POSITION   Pos   = m_NodeList.GetHeadPosition();
00477   while( Pos )
00478   {
00479     pNode = m_NodeList.GetNext( Pos );
00480     delete pNode;
00481   }
00482   m_NodeList.RemoveAll();              // Clean the list
00483 }
00484
00485 //---------------------------------------------------------------------------
00486 HRESULT CStaticNode::AddDeviceNode
00487 (
00488   LPNODEPROPS  pNodeProps    //[in] Properties for the new node
00489 )
00490 {
00491   _ASSERT( NULL != pNodeProps );
00492
00493   CDeviceNode* pNode   = NULL;
00494   HRESULT      hResult = S_FALSE;
00495
00496   pNodeProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00497   pNodeProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00498
00499   pNode = new CDeviceNode;               // Create and initialize the new
00500   pNode->Initialize( pNodeProps );       // node, then add to our linked
00501   m_NodeList.AddTail( pNode );           // list, then insert the node
00502
00503   pNode->m_SDI.relativeID = m_hStaticNode;
00504
00505   LPCONSOLENAMESPACE2 ipCNS = NULL;
00506   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00507   if( S_OK != hResult )
00508     return hResult;
00509
00510   hResult = ipCNS->InsertItem( &pNode->m_SDI );
00511
00512   return hResult;
00513 }
00514
00515 //---------------------------------------------------------------------------
00516 //  Get the selected node and call it's ToggleStatus method
00517 //
00518 VOID CStaticNode::ToggleStatus
00519 (
00520   LPDATAOBJECT ipDataObject        //[in] DataObject for selected node
00521 )
00522 {
00523   CDeviceNode* pNode = (CDeviceNode*)ExtractBaseNodePtr( ipDataObject );
00524   if( NULL != pNode )
00525     pNode->ToggleStatus();
00526
00527 }
00528
00529
00530 /////////////////////////////////////////////////////////////////////////////
00531 //  Support for Context Menus
00532
00533 //---------------------------------------------------------------------------
00534 //  NOTE:  Don't AddRef ipCallback.  Check docs.
00535 //
00536 HRESULT CStaticNode::AddMenuItems
00537 (
00538   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00539   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00540 )
00541 {
00542   _ASSERT( NULL != ipCallback );
00543   HRESULT hResult = S_FALSE;
00544
00545   static CONTEXTMENUITEM ctxMenu;
00546     ctxMenu.lCommandID        = IDM_NEW_DEVICE;
00547     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00548     ctxMenu.fSpecialFlags     = 0;
00549     ctxMenu.strName           = L"New Device...";
00550     ctxMenu.strStatusBarText  = L"Add a new device";
00551
00552
00553   if( NULL == m_hAddDeviceDlg )    // If the AddDevice dialog is running
00554     ctxMenu.fFlags = 0;            // gray the menu selection
00555   else
00556     ctxMenu.fFlags = MF_GRAYED;
00557
00558
00559   // Add the 'New Device' option to the New menu if allowed...
00560   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00561   {
00562     hResult = ipCallback->AddItem( &ctxMenu );
00563   }
00564
00565   return hResult;
00566 }
00567
00568
00569 //---------------------------------------------------------------------------
00570 HRESULT CStaticNode::Command
00571 (
00572   long lCommandID          //[in] Indentifier for menu ID
00573 )
00574 {
00575   HRESULT hResult = S_OK;
00576
00577   switch( lCommandID )
00578   {
00579     case IDM_NEW_DEVICE:
00580     {
00581       CAddDeviceDlg* pDlg = new CAddDeviceDlg( IDD_ADDDEVICE_DLG, m_hMessageWnd );
00582       m_hAddDeviceDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00583       break;
00584     }
00585     default:
00586     {
00587       hResult = S_FALSE;
00588       break;
00589     }
00590   }
00591   return hResult;
00592 }
00593
00594
00595
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Dynept/Dyneptc.c Source File

  • NetDS
  • RPC
  • Dynept

Dyneptc.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                        Dynept Example
00005
00006     FILE:       dyneptc.c
00007
00008     USAGE:      dyneptc  -n network_address
00009                          -p protocol_sequence
00010                          -o options
00011                          -s string_displayed_on_server
00012
00013     PURPOSE:    Client side of RPC distributed application
00014
00015     FUNCTIONS:  main() - binds to server and calls remote procedure
00016
00017     COMMENTS:   This version of the distributed application that
00018                 prints "What a dynamic, world" (or other string) on
00019                 the server features a client that manages its connection
00020                 to the server. It uses the binding handle dynept_IfHandle,
00021                 defined in the file dynept.h.
00022
00023 ****************************************************************************/
00024
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <ctype.h>
00028 #include "dynept.h"    // header file generated by MIDL compiler
00029
00030 void Usage(char * pszProgramName)
00031 {
00032     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00033     fprintf(stderr, " -p protocol_sequence\n");
00034     fprintf(stderr, " -n network_address\n");
00035     fprintf(stderr, " -o options\n");
00036     fprintf(stderr, " -s string\n");
00037     exit(1);
00038 }
00039
00040 void __cdecl main(int argc, char **argv)
00041 {
00042     RPC_STATUS status;
00043     unsigned char * pszUuid             = NULL;
00044     unsigned char * pszProtocolSequence = "ncacn_np";
00045     unsigned char * pszNetworkAddress   = NULL;
00046     unsigned char * pszOptions          = NULL;
00047     unsigned char * pszStringBinding    = NULL;
00048     unsigned char * pszString           = "What a dynamic world";
00049     unsigned long ulCode;
00050     int i;
00051
00052     /* allow the user to override settings with command line switches */
00053     for (i = 1; i < argc; i++) {
00054         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00055             switch (tolower(*(argv[i]+1))) {
00056             case 'p':  // protocol sequence
00057                 pszProtocolSequence = argv[++i];
00058                 break;
00059             case 'n':  // network address
00060                 pszNetworkAddress = argv[++i];
00061                 break;
00062             case 'o':
00063                 pszOptions = argv[++i];
00064                 break;
00065             case 's':
00066                 pszString = argv[++i];
00067                 break;
00068             case 'h':
00069             case '?':
00070             default:
00071                 Usage(argv[0]);
00072             }
00073         }
00074         else
00075             Usage(argv[0]);
00076     }
00077
00078     /* Use a convenience function to concatenate the elements of */
00079     /* the string binding into the proper sequence.              */
00080     status = RpcStringBindingCompose(pszUuid,
00081                                      pszProtocolSequence,
00082                                      pszNetworkAddress,
00083                                      NULL,
00084                                      pszOptions,
00085                                      &pszStringBinding);
00086     printf("RpcStringBindingCompose returned 0x%x\n", status);
00087     printf("pszStringBinding = %s\n", pszStringBinding);
00088     if (status) {
00089         exit(status);
00090     }
00091
00092     /* Set the binding handle that will be used to bind to the server. */
00093     status = RpcBindingFromStringBinding(pszStringBinding,
00094                                          &dynept_IfHandle);
00095     printf("RpcBindingFromStringBinding returned 0x%x\n", status);
00096     if (status) {
00097         exit(status);
00098     }
00099
00100     printf("Calling the remote procedure 'HelloProc'\n");
00101     printf("Print the string '%s' on the server\n", pszString);
00102
00103     RpcTryExcept {
00104         HelloProc(pszString);  // make call with user message
00105         printf("Calling the remote procedure 'Shutdown'\n");
00106         Shutdown();  // shut down the server side
00107     }
00108     RpcExcept(1) {
00109         ulCode = RpcExceptionCode();
00110         printf("Runtime reported exception 0x%lx = %ld\n", ulCode, ulCode);
00111     }
00112     RpcEndExcept
00113
00114     /*  The calls to the remote procedures are complete. */
00115     /*  Free the string and the binding handle           */
00116     status = RpcStringFree(&pszStringBinding);  // remote calls done; unbind
00117     printf("RpcStringFree returned 0x%x\n", status);
00118     if (status) {
00119         exit(status);
00120     }
00121
00122     status = RpcBindingFree(&dynept_IfHandle);  // remote calls done; unbind
00123     printf("RpcBindingFree returned 0x%x\n", status);
00124     if (status) {
00125         exit(status);
00126     }
00127
00128     exit(0);
00129
00130 }  // end main()
00131
00132
00133 /*********************************************************************/
00134 /*                 MIDL allocate and free                            */
00135 /*********************************************************************/
00136
00137 void  __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00138 {
00139     return(malloc(len));
00140 }
00141
00142 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00143 {
00144     free(ptr);
00145 }
00146
00147 /* end file dyneptc.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step2/ADsFirstExt.idl Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step2

ADsFirstExt.idl

Go to the documentation of this file.
00001 // ADsFirstExt.idl : IDL source for ADsFirstExt.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (ADsFirstExt.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010
00011   [
00012     object,
00013     uuid(E1E3EDF7-48D1-11D2-B22B-0000F87A6B50),
00014     dual,
00015     helpstring("IHelloWorld Interface"),
00016     pointer_default(unique)
00017   ]
00018   interface IHelloWorld : IDispatch
00019   {
00020     [id(1), helpstring("method Say")] HRESULT Say();
00021   };
00022
00023 [
00024   uuid(E1E3EDEA-48D1-11D2-B22B-0000F87A6B50),
00025   version(1.0),
00026   helpstring("ADsFirstExt 1.0 Type Library")
00027 ]
00028 library ADSFIRSTEXTLib
00029 {
00030   importlib("stdole32.tlb");
00031   importlib("stdole2.tlb");
00032
00033
00034   [
00035     uuid(E1E3EDF8-48D1-11D2-B22B-0000F87A6B50),
00036     helpstring("HelloWorld Class")
00037   ]
00038   coclass HelloWorld
00039   {
00040     [default] interface IHelloWorld;
00041   };
00042 };
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/LSP/prnpinfo.cpp Source File

  • NetDS
  • WinSock
  • LSP

prnpinfo.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: prnpinfo.cpp
00009 //
00010 // Description:
00011 //
00012 //    This file contains a single routine for printing the contents of a
00013 //    WSAPROTOCOL_INFOW structure.
00014 //
00015 #include <winsock2.h>
00016 #include <windows.h>
00017 #include <objbase.h>
00018 #include <stdio.h>
00019 #include <stdlib.h>
00020
00021 #ifndef _WIN32_WINNT
00022 #define _WIN32_WINNT
00023 #endif
00024
00025 #include <af_irda.h>
00026 #include <wsrm.h>
00027 #include <ws2atm.h>
00028 #include <wsipx.h>
00029 #include <atalkwsh.h>
00030
00031 //
00032 // Function: PrintProtocolInfo
00033 //
00034 // Description:
00035 //    Decode a WSAPROTOCOL_INFO entry and print the member fields
00036 //    in a readable format. There's no secret voodoo here, just
00037 //    interpret all the fields of the structure.
00038 //
00039 void PrintProtocolInfo(WSAPROTOCOL_INFOW *wsapi)
00040 {
00041     WCHAR       szGuidString[MAX_PATH];
00042     int   i;
00043
00044     printf("\nProtocol: %S\n", wsapi->szProtocol);
00045     printf("           Address Family: ");
00046     switch (wsapi->iAddressFamily)
00047     {
00048         case AF_INET:
00049         case AF_INET6:
00050             printf("%s\n", (wsapi->iAddressFamily == AF_INET ? \
00051 "AF_INET" : "AF_INET6"));
00052             printf("                 Protocol: ");
00053             switch (wsapi->iProtocol)
00054             {
00055                 case IPPROTO_IP:
00056                     printf("IPROTO_IP\n");
00057                     break;
00058                 case IPPROTO_ICMP:
00059                     printf("IPROTO_ICMP\n");
00060                     break;
00061                 case IPPROTO_IGMP:
00062                     printf("IPROTO_IGMP\n");
00063                     break;
00064                 case IPPROTO_GGP:
00065                     printf("IPROTO_GGP\n");
00066                     break;
00067                 case IPPROTO_TCP:
00068                     printf("IPROTO_TCP\n");
00069                     break;
00070                 case IPPROTO_PUP:
00071                     printf("IPROTO_PUP\n");
00072                     break;
00073                 case IPPROTO_UDP:
00074                     printf("IPROTO_UDP\n");
00075                     break;
00076                 case IPPROTO_IDP:
00077                     printf("IPROTO_IDP\n");
00078                     break;
00079                 case IPPROTO_ND:
00080                     printf("IPROTO_ND\n");
00081                     break;
00082                 case IPPROTO_RM:
00083                     printf("IPPROTO_RM\n");
00084                     break;
00085                 case IPPROTO_RAW:
00086                     printf("IPROTO_RAW\n");
00087                     break;
00088             }
00089             break;
00090         case AF_UNSPEC:
00091             printf("AF_UNSPEC\n");
00092             printf("                 Protocol: UNKNOWN: %d",
00093                 wsapi->iProtocol);
00094             break;
00095         case AF_UNIX:
00096             printf("AF_UNIX\n");
00097             printf("                 Protocol: UNKNOWN: %d",
00098                 wsapi->iProtocol);
00099             break;
00100         case AF_IMPLINK:
00101             printf("AF_IMPLINK\n");
00102             printf("                 Protocol: UNKNOWN: %d",
00103                 wsapi->iProtocol);
00104             break;
00105         case AF_PUP:
00106             printf("AF_PUP\n");
00107             printf("                 Protocol: UNKNOWN: %d",
00108                 wsapi->iProtocol);
00109             break;
00110         case AF_CHAOS:
00111             printf("AF_CHAOS\n");
00112             printf("                 Protocol: UNKNOWN: %d",
00113                 wsapi->iProtocol);
00114             break;
00115         case AF_NS:
00116             printf("AF_NS or AF_IPX\n");
00117             printf("                 Protocol: ");
00118             switch (wsapi->iProtocol)
00119             {
00120                 case NSPROTO_IPX:
00121                     printf("NSPROTO_IPX\n");
00122                     break;
00123                 case NSPROTO_SPX:
00124                     printf("NSPROTO_SPX\n");
00125                     break;
00126                 case NSPROTO_SPXII:
00127                     printf("NSPROTO_SPXII\n");
00128                     break;
00129             }
00130             break;
00131         case AF_ISO:
00132             printf("AF_ISO or AF_OSI\n");
00133             printf("                 Protocol: UNKNOWN: %d",
00134                 wsapi->iProtocol);
00135             break;
00136         case AF_ECMA:
00137             printf("AF_ECMA\n");
00138             printf("                 Protocol: UNKNOWN: %d",
00139                 wsapi->iProtocol);
00140             break;
00141         case AF_DATAKIT:
00142             printf("AF_DATAKIT\n");
00143             printf("                 Protocol: UNKNOWN: %d",
00144                 wsapi->iProtocol);
00145             break;
00146         case AF_CCITT:
00147             printf("AF_CCITT\n");
00148             printf("                 Protocol: UNKNOWN: %d",
00149                 wsapi->iProtocol);
00150             break;
00151         case AF_SNA:
00152             printf("AF_SNA\n");
00153             printf("                 Protocol: UNKNOWN: %d",
00154                 wsapi->iProtocol);
00155             break;
00156         case AF_DECnet:
00157             printf("AF_DECnet\n");
00158             printf("                 Protocol: UNKNOWN: %d",
00159                 wsapi->iProtocol);
00160             break;
00161         case AF_DLI:
00162             printf("AF_DLI\n");
00163             printf("                 Protocol: UNKNOWN: %d",
00164                 wsapi->iProtocol);
00165             break;
00166         case AF_LAT:
00167             printf("AF_LAT\n");
00168             printf("                 Protocol: UNKNOWN: %d",
00169                 wsapi->iProtocol);
00170             break;
00171         case AF_HYLINK:
00172             printf("AF_HYLINK\n");
00173             printf("                 Protocol: UNKNOWN: %d",
00174                 wsapi->iProtocol);
00175             break;
00176         case AF_APPLETALK:
00177             printf("AF_APPLETALK\n");
00178             printf("                 Protocol: ");
00179             switch (wsapi->iProtocol)
00180             {
00181                 case DDPPROTO_RTMP:
00182                     printf("DDPPROTO_RTMP\n");
00183                     break;
00184                 case DDPPROTO_NBP:
00185                     printf("DDPPROTO_NBP\n");
00186                     break;
00187                 case DDPPROTO_ATP:
00188                     printf("DDPROTO_ATP\n");
00189                     break;
00190                 case DDPPROTO_AEP:
00191                     printf("DDPPROTO_AEP\n");
00192                     break;
00193                 case DDPPROTO_RTMPRQ:
00194                     printf("DDPPROTO_RTMPRQ\n");
00195                     break;
00196                 case DDPPROTO_ZIP:
00197                     printf("DDPPROTO_ZIP\n");
00198                     break;
00199                 case DDPPROTO_ADSP:
00200                     printf("DDPPROTO_ADSP\n");
00201                     break;
00202                 case ATPROTO_ADSP:
00203                     printf("ATPROTO_ADSP\n");
00204                     break;
00205                 case ATPROTO_ATP:
00206                     printf("ATPROTO_ATP\n");
00207                     break;
00208                 case ATPROTO_ASP:
00209                     printf("ATPROTO_ASP\n");
00210                     break;
00211                 case ATPROTO_PAP:
00212                     printf("ATPROTO_PAP\n");
00213                     break;
00214             }
00215             break;
00216         case AF_NETBIOS:
00217             printf("AF_NETBIOS\n");
00218             printf("                 Protocol: ");
00219       printf("NetBIOS LANA %d\n", ((wsapi->iProtocol == 0x80000000) ? 0: abs(wsapi->iProtocol)));
00220             break;
00221         case AF_VOICEVIEW:
00222             printf("AF_VOICEVIEW\n");
00223             printf("                 Protocol: UNKNOWN: %d",
00224                 wsapi->iProtocol);
00225             break;
00226         case AF_FIREFOX:
00227             printf("AF_FIREFOX\n");
00228             printf("                 Protocol: UNKNOWN: %d",
00229                 wsapi->iProtocol);
00230             break;
00231         case AF_UNKNOWN1:
00232             printf("AF_UNKNOWN1\n");
00233             printf("                 Protocol: UNKNOWN: %d",
00234                 wsapi->iProtocol);
00235             break;
00236         case AF_BAN:
00237             printf("AF_BAN\n");
00238             printf("                 Protocol: UNKNOWN: %d",
00239                 wsapi->iProtocol);
00240             break;
00241         case AF_ATM:
00242             printf("AF_ATM\n");
00243             printf("                 Protocol: ");
00244             switch (wsapi->iProtocol)
00245             {
00246                 case ATMPROTO_AALUSER:
00247                     printf("ATMPROTO_AALUSER\n");
00248                     break;
00249                 case ATMPROTO_AAL1:
00250                     printf("ATMPROTO_AAL1\n");
00251                     break;
00252                 case ATMPROTO_AAL2:
00253                     printf("ATMPROTO_AAL2\n");
00254                     break;
00255                 case ATMPROTO_AAL34:
00256                     printf("ATMPROTO_AAL34\n");
00257                     break;
00258                 case ATMPROTO_AAL5:
00259                     printf("ATMPROTO_AAL5\n");
00260                     break;
00261             }
00262             break;
00263         case AF_CLUSTER:
00264             printf("AF_CLUSTER\n");
00265             printf("                 Protocol: UNKNOWN: %d",
00266                 wsapi->iProtocol);
00267             break;
00268         case AF_12844:
00269             printf("AF_12844\n");
00270             printf("                 Protocol: UNKNOWN: %d",
00271                 wsapi->iProtocol);
00272             break;
00273         case AF_IRDA:
00274             printf("AF_IRDA\n");
00275             printf("                 Protocol: ");
00276             switch (wsapi->iProtocol)
00277             {
00278                 case IRDA_PROTO_SOCK_STREAM:
00279                     printf("IRDA_PROTO_SOCK_STREAM\n");
00280                     break;
00281             }
00282             break;
00283         default:
00284             printf("Unknown: %d\n", wsapi->iAddressFamily);
00285     }
00286     printf("              Socket Type: ");
00287     switch (wsapi->iSocketType)
00288     {
00289         case SOCK_STREAM:
00290             printf("SOCK_STREAM\n");
00291             break;
00292         case SOCK_DGRAM:
00293             printf("SOCK_DGRAM\n");
00294             break;
00295         case SOCK_RAW:
00296             printf("SOCK_RAW\n");
00297             break;
00298         case SOCK_RDM:
00299             printf("SOCK_RDM\n");
00300             break;
00301         case SOCK_SEQPACKET:
00302             printf("SOCK_SEQPACKET\n");
00303             break;
00304     }
00305     printf("           Connectionless: ");
00306     if (wsapi->dwServiceFlags1 & XP1_CONNECTIONLESS)
00307         printf("YES\n");
00308     else
00309         printf("NO\n");
00310     printf("      Guaranteed Delivery: ");
00311     if (wsapi->dwServiceFlags1 & XP1_GUARANTEED_DELIVERY)
00312         printf("YES\n");
00313     else
00314         printf("NO\n");
00315     printf("         Guaranteed Order: ");
00316     if (wsapi->dwServiceFlags1 & XP1_GUARANTEED_ORDER)
00317         printf("YES\n");
00318     else
00319         printf("NO\n");
00320     printf("         Message Oriented: ");
00321     if (wsapi->dwServiceFlags1 & XP1_MESSAGE_ORIENTED)
00322         printf("YES\n");
00323     else
00324         printf("NO\n");
00325     printf("            Pseudo Stream: ");
00326     if (wsapi->dwServiceFlags1 & XP1_PSEUDO_STREAM)
00327         printf("YES\n");
00328     else
00329         printf("NO\n");
00330     printf("           Graceful Close: ");
00331     if (wsapi->dwServiceFlags1 & XP1_GRACEFUL_CLOSE)
00332         printf("YES\n");
00333     else
00334         printf("NO\n");
00335     printf("           Expedited Data: ");
00336     if (wsapi->dwServiceFlags1 & XP1_EXPEDITED_DATA)
00337         printf("YES\n");
00338     else
00339         printf("NO\n");
00340     printf("             Connect Data: ");
00341     if (wsapi->dwServiceFlags1 & XP1_CONNECT_DATA)
00342         printf("YES\n");
00343     else
00344         printf("NO\n");
00345     printf("          Disconnect Data: ");
00346     if (wsapi->dwServiceFlags1 & XP1_DISCONNECT_DATA)
00347         printf("YES\n");
00348     else
00349         printf("NO\n");
00350     printf("       Supports Broadcast: ");
00351     if (wsapi->dwServiceFlags1 & XP1_SUPPORT_BROADCAST)
00352         printf("YES\n");
00353     else
00354         printf("NO\n");
00355     printf("      Supports Multipoint: ");
00356     if (wsapi->dwServiceFlags1 & XP1_SUPPORT_MULTIPOINT)
00357         printf("YES\n");
00358     else
00359         printf("NO\n");
00360     printf(" Multipoint Control Plane: ");
00361     if (wsapi->dwServiceFlags1 & XP1_MULTIPOINT_CONTROL_PLANE)
00362         printf("ROOTED\n");
00363     else
00364         printf("NON-ROOTED\n");
00365     printf("    Multipoint Data Plane: ");
00366     if (wsapi->dwServiceFlags1 & XP1_MULTIPOINT_DATA_PLANE)
00367         printf("ROOTED\n");
00368     else
00369         printf("NON-ROOTED\n");
00370     printf("            QoS Supported: ");
00371     if (wsapi->dwServiceFlags1 & XP1_QOS_SUPPORTED)
00372         printf("YES\n");
00373     else
00374         printf("NO\n");
00375     printf("     Unidirectional Sends: ");
00376     if (wsapi->dwServiceFlags1 & XP1_UNI_SEND)
00377         printf("YES\n");
00378     else
00379         printf("NO\n");
00380     printf("    Unidirection Receives: ");
00381     if (wsapi->dwServiceFlags1 & XP1_UNI_RECV)
00382         printf("YES\n");
00383     else
00384         printf("NO\n");
00385     printf("              IFS Handles: ");
00386     if (wsapi->dwServiceFlags1 & XP1_IFS_HANDLES)
00387         printf("YES\n");
00388     else
00389         printf("NO\n");
00390     printf("         Partial Messages: ");
00391     if (wsapi->dwServiceFlags1 & XP1_PARTIAL_MESSAGE)
00392         printf("YES\n");
00393     else
00394         printf("NO\n");
00395     printf("           Provider Flags: ");
00396     if (wsapi->dwProviderFlags & PFL_MULTIPLE_PROTO_ENTRIES)
00397     {
00398         printf("PFL_MULTIPLE_PROTO_ENTRIES ");
00399     }
00400     if (wsapi->dwProviderFlags & PFL_RECOMMENDED_PROTO_ENTRY)
00401     {
00402         printf("PFL_RECOMMENDED_PROT_ENTRY ");
00403     }
00404     if (wsapi->dwProviderFlags & PFL_HIDDEN)
00405     {
00406         printf("PFL_HIDDEN ");
00407     }
00408     if (wsapi->dwProviderFlags & PFL_MATCHES_PROTOCOL_ZERO)
00409     {
00410         printf("PFL_MATCHES_PROTOCOL_ZERO ");
00411     }
00412     if (wsapi->dwProviderFlags == 0)
00413     {
00414         printf("NONE");
00415     }
00416     printf("\n");
00417
00418     StringFromGUID2(wsapi->ProviderId, szGuidString, MAX_PATH-1);
00419     printf("              Provider Id: %S\n", szGuidString);
00420     printf("         Catalog Entry Id: %ld\n", wsapi->dwCatalogEntryId);
00421     printf("  Number of Chain Entries: %d   {",
00422         wsapi->ProtocolChain.ChainLen);
00423     for(i=0; i < wsapi->ProtocolChain.ChainLen ;i++)
00424         printf("%ld ", wsapi->ProtocolChain.ChainEntries[i]);
00425     printf("}\n");
00426     printf("                  Version: %d\n", wsapi->iVersion);
00427     printf("Max Socket Address Length: %d\n", wsapi->iMaxSockAddr);
00428     printf("Min Socket Address Length: %d\n", wsapi->iMinSockAddr);
00429     printf("      Protocol Max Offset: %d\n", wsapi->iProtocolMaxOffset);
00430     printf("       Network Byte Order: ");
00431     if (wsapi->iNetworkByteOrder == 0)
00432         printf("BIG-ENDIAN\n");
00433     else
00434         printf("LITLE-ENDIAN\n");
00435     printf("          Security Scheme: ");
00436     if (wsapi->iSecurityScheme == SECURITY_PROTOCOL_NONE)
00437         printf("NONE\n");
00438     else
00439         printf("%d\n", wsapi->iSecurityScheme);
00440     printf("             Message Size: ");
00441     if (wsapi->dwMessageSize == 0)
00442         printf("N/A (Stream Oriented)\n");
00443     else if (wsapi->dwMessageSize == 1)
00444         printf("Depended on underlying MTU\n");
00445     else if (wsapi->dwMessageSize == 0xFFFFFFFF)
00446         printf("No limit\n");
00447     else
00448         printf("%ld\n", wsapi->dwMessageSize);
00449 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/API.Cpp Source File

  • WinBase
  • WtsApi
  • WtsApi

API.Cpp

Go to the documentation of this file.
00001 // API.cpp : Defines the class behaviors for the application.
00002 //
00003 //  Copyright 1995-1998, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006
00007 #include "stdafx.h"
00008 #include "API.h"
00009 #include <wtsapi32.h>
00010 #include "MainFrm.h"
00011 #include "APIDoc.h"
00012 #include "APIView.h"
00013
00014 #ifdef _DEBUG
00015 #define new DEBUG_NEW
00016 #undef THIS_FILE
00017 static char THIS_FILE[] = __FILE__;
00018 #endif
00019
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 // CAPIApp
00023
00024 BEGIN_MESSAGE_MAP(CAPIApp, CWinApp)
00025   //{{AFX_MSG_MAP(CAPIApp)
00026   ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00027   //}}AFX_MSG_MAP
00028   // Standard file based document commands
00029   ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
00030   ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00031 END_MESSAGE_MAP()
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // CAPIApp construction
00035
00036 CAPIApp::CAPIApp()
00037 {
00038 }
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // The one and only CAPIApp object
00042
00043 CAPIApp theApp;
00044
00045
00046 /////////////////////////////////////////////////////////////////////////////
00047 // CAPIApp initialization
00048
00049 BOOL CAPIApp::InitInstance()
00050 {
00051
00052
00053 #ifdef _AFXDLL
00054   Enable3dControls();     // Call this when using MFC in a shared DLL
00055 #else
00056   Enable3dControlsStatic(); // Call this when linking to MFC statically
00057 #endif
00058
00059   // Change the registry key under which our settings are stored.
00060   // You should modify this string to be something appropriate
00061   // such as the name of your company or organization.
00062   SetRegistryKey(_T("Citrix"));
00063
00064   LoadStdProfileSettings();  // Load standard INI file options (including MRU)
00065
00066   // Register the application's document templates.  Document templates
00067   //  serve as the connection between documents, frame windows and views.
00068
00069   CSingleDocTemplate* pDocTemplate;
00070   pDocTemplate = new CSingleDocTemplate(
00071     IDR_MAINFRAME,
00072     RUNTIME_CLASS(CAPIDoc),
00073     RUNTIME_CLASS(CMainFrame),       // main SDI frame window
00074     RUNTIME_CLASS(CAPIView));
00075   AddDocTemplate(pDocTemplate);
00076
00077   // Parse command line for standard shell commands, DDE, file open
00078   CCommandLineInfo cmdInfo;
00079   ParseCommandLine(cmdInfo);
00080
00081   // Dispatch commands specified on the command line
00082   if (!ProcessShellCommand(cmdInfo))
00083     return FALSE;
00084
00085   // The one and only window has been initialized, so show and update it.
00086   m_pMainWnd->ShowWindow(SW_SHOW);
00087   m_pMainWnd->UpdateWindow();
00088
00089   return TRUE;
00090 }
00091
00092 /////////////////////////////////////////////////////////////////////////////
00093 // CAboutDlg dialog used for App About
00094
00095 class CAboutDlg : public CDialog
00096 {
00097 public:
00098   CAboutDlg();
00099
00100 // Dialog Data
00101   //{{AFX_DATA(CAboutDlg)
00102   enum { IDD = IDD_ABOUTBOX };
00103   //}}AFX_DATA
00104
00105   // ClassWizard generated virtual function overrides
00106   //{{AFX_VIRTUAL(CAboutDlg)
00107   protected:
00108   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00109   //}}AFX_VIRTUAL
00110
00111 // Implementation
00112 protected:
00113   //{{AFX_MSG(CAboutDlg)
00114     // No message handlers
00115   //}}AFX_MSG
00116   DECLARE_MESSAGE_MAP()
00117 };
00118
00119 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00120 {
00121   //{{AFX_DATA_INIT(CAboutDlg)
00122   //}}AFX_DATA_INIT
00123 }
00124
00125 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00126 {
00127   CDialog::DoDataExchange(pDX);
00128   //{{AFX_DATA_MAP(CAboutDlg)
00129   //}}AFX_DATA_MAP
00130 }
00131
00132 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00133   //{{AFX_MSG_MAP(CAboutDlg)
00134     // No message handlers
00135   //}}AFX_MSG_MAP
00136 END_MESSAGE_MAP()
00137
00138 // App command to run the dialog
00139 void CAPIApp::OnAppAbout()
00140 {
00141   CAboutDlg aboutDlg;
00142   aboutDlg.DoModal();
00143 }
00144
00145 /////////////////////////////////////////////////////////////////////////////
00146 // CAPIApp commands
00147
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/MultiReco/ChildWnds.cpp Source File

  • TabletPC
  • MultiReco

ChildWnds.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 // Module:
00012 //      ChildWnds.cpp
00013 //
00014 // Description:
00015 //      The file contains the definitions of the methods of the classes
00016 //      CInkInputWnd and CRecoOutputWnd.
00017 //      See the file ChildWnds.h for the definitions of the classes.
00018 //--------------------------------------------------------------------------
00019
00020 #ifndef _WIN32_WINNT
00021 #define _WIN32_WINNT 0x0500
00022 #endif
00023
00024 // Windows header file
00025 #include <windows.h>
00026 #include <richedit.h>
00027
00028 // ATL header files:
00029 #include <atlbase.h>        // defines CComModule, CComPtr, CComVariant
00030 extern CComModule _Module;
00031 #include <atlwin.h>         // defines CWindowImpl
00032
00033 // Tablet PC Automation interfaces header file
00034 #include <msinkaut.h>
00035
00036 // The application header files
00037 #include "resource.h"       // main symbols, including command ID's
00038 #include "ChildWnds.h"      // contains the CInkInputWnd and CRecoOutputWnd definitions
00039
00040 ////////////////////////////////////////////////////////
00041 // CInkInputWnd methods
00042 ////////////////////////////////////////////////////////
00043
00044 /////////////////////////////////////////////////////////
00045 //
00046 // CInkInputWnd::CInkInputWnd
00047 //
00048 // Constructor.
00049 //
00050 // Parameters:
00051 //      none
00052 //
00053 /////////////////////////////////////////////////////////
00054 CInkInputWnd::CInkInputWnd()
00055     : m_cRows(0), m_cColumns(0), m_iMidline(-1)
00056 {
00057     m_ptGridLT.x = m_ptGridLT.y = 0;
00058     m_szWritingBox.cx = m_szWritingBox.cy = 0;
00059     ::SetRectEmpty(&m_rcDrawnBox);
00060 }
00061
00062 /////////////////////////////////////////////////////////
00063 //
00064 // CInkInputWnd::SetGuide
00065 //
00066 // Data members access method for setting the guide
00067 // drawing parameters.
00068 //
00069 // Parameters:
00070 //      _InkRecoGuide& irg  : see the Tablet PC Automation API
00071 //                            reference for the description
00072 //                            of the structure
00073 //
00074 // Return Values (void):
00075 //      none
00076 //
00077 /////////////////////////////////////////////////////////
00078 void CInkInputWnd::SetGuide(
00079     const _InkRecoGuide& irg
00080     )
00081 {
00082     // Initialize the data members with values from the recognition guide structure
00083     m_ptGridLT.x = irg.rectWritingBox.left;
00084     m_ptGridLT.y = irg.rectWritingBox.top;
00085     m_szWritingBox.cx = irg.rectWritingBox.right - irg.rectWritingBox.left;
00086     m_szWritingBox.cy = irg.rectWritingBox.bottom - irg.rectWritingBox.top;
00087     m_rcDrawnBox = irg.rectDrawnBox;
00088     m_iMidline = irg.midline;
00089     m_cRows = irg.cRows;
00090     m_cColumns = irg.cColumns;
00091
00092     // Update the window
00093     if (IsWindow())
00094     {
00095         Invalidate();
00096     }
00097 }
00098
00099 /////////////////////////////////////////////////////////
00100 //
00101 // CInkInputWnd::SetGuide
00102 //
00103 // Data members access method for setting the number
00104 // of the guide's rows and columns.
00105 //
00106 // Parameters:
00107 //      int iRows       : the number of rows
00108 //      int iColumns    : the number of columns
00109 //
00110 // Return Values (void):
00111 //      none
00112 //
00113 /////////////////////////////////////////////////////////
00114 void CInkInputWnd::SetRowsCols(
00115     int iRows,
00116     int iColumns
00117     )
00118 {
00119     m_cRows = iRows;
00120     m_cColumns = iColumns;
00121
00122     // Update the window
00123     if (IsWindow())
00124     {
00125         Invalidate();
00126     }
00127 }
00128
00129 /////////////////////////////////////////////////////////
00130 //
00131 // CInkInputWnd::OnPaint
00132 //
00133 // The WM_PAINT message handler. The ATL calls this member
00134 // function when Windows or an application makes a request
00135 // to repaint a portion of the CInkInputWnd object's window.
00136 // The method paints the window's background and draws
00137 // the guide if necessary.
00138 //
00139 // Parameters:
00140 //      defined in the ATL's MESSAGE_HANDLER macro,
00141 //      none is used here
00142 //
00143 // Return Value (LRESULT):
00144 //      always 0
00145 //
00146 /////////////////////////////////////////////////////////
00147 LRESULT CInkInputWnd::OnPaint(
00148         UINT /*uMsg*/,
00149         WPARAM /*wParam*/,
00150         LPARAM /*lParam*/,
00151         BOOL& /*bHandled*/
00152         )
00153 {
00154     RECT rcClip;
00155     if (FALSE == GetUpdateRect(&rcClip))
00156         return 0;   // there's no update region, so no painting is needed
00157
00158     PAINTSTRUCT ps;
00159     HDC hdc = BeginPaint(&ps);
00160     if (hdc == NULL)
00161         return 0;
00162
00163     // Get the rectangle to paint.
00164     GetClipBox(hdc, &rcClip);
00165
00166     // Paint the background.
00167     ::FillRect(hdc, &rcClip, (HBRUSH)::GetStockObject(DC_BRUSH));
00168
00169     // Calculate the grid rectangle. Assume that if there are any guides,
00170     // they are either boxes or horizontal lines.
00171     RECT rcGrid = {m_ptGridLT.x, m_ptGridLT.y, 0,
00172                    m_ptGridLT.y + m_szWritingBox.cy * m_cRows};
00173     if (0 == m_cColumns && 0 != m_cRows)
00174     {
00175         rcGrid.right = rcClip.right;
00176     }
00177     else
00178     {
00179         rcGrid.right = m_ptGridLT.x + m_szWritingBox.cx * m_cColumns;
00180     }
00181
00182     // Draw the guide grid, if it's visible and not empty.
00183     RECT rcVisible;
00184     if (FALSE == ::IsRectEmpty(&rcGrid)
00185          && TRUE == ::IntersectRect(&rcVisible, &rcGrid, &rcClip))
00186     {
00187
00188         // Create a thin lightgray pen to draw the guides.
00189         HPEN hPen = ::CreatePen(PS_SOLID, 1, RGB(192, 192, 192));
00190         HGDIOBJ hOldPen = ::SelectObject(hdc, hPen);
00191
00192         if (0 == m_cColumns)
00193         {
00194              // Draw horizontal lines at the bottom side of the guide's DrawnBox
00195             int iY = rcClip.top - ((rcClip.top - m_ptGridLT.y) % m_szWritingBox.cy) + m_rcDrawnBox.bottom;
00196             for (int iRow = (rcClip.top - m_ptGridLT.y) / m_szWritingBox.cy;
00197                  (iRow < m_cRows) && (iY < rcClip.bottom);
00198                  iRow++, iY += m_szWritingBox.cy)
00199             {
00200                 ::MoveToEx(hdc, rcClip.left, iY, NULL);
00201                 ::LineTo(hdc, rcClip.right, iY);
00202             }
00203         }
00204         else
00205         {
00206             // Draw boxes
00207             int iY = rcClip.top - ((rcClip.top - m_ptGridLT.y) % m_szWritingBox.cy);
00208             for (int iRow = (rcClip.top - m_ptGridLT.y) / m_szWritingBox.cy;
00209                  (iRow < m_cRows) && (iY < rcClip.bottom);
00210                  iRow++, iY += m_szWritingBox.cy)
00211             {
00212                 int iX = rcClip.left - ((rcClip.left - m_ptGridLT.x) % m_szWritingBox.cx);
00213                 RECT rcBox = m_rcDrawnBox;
00214                 ::OffsetRect(&rcBox, iX, iY);
00215                 for (int iCol = (rcClip.left - m_ptGridLT.x) / m_szWritingBox.cx;
00216                      (iCol < m_cColumns) && (rcBox.left < rcClip.right);
00217                      iCol++)
00218                 {
00219                     ::Rectangle(hdc, rcBox.left, rcBox.top, rcBox.right, rcBox.bottom);
00220                     ::OffsetRect(&rcBox, m_szWritingBox.cx, 0);
00221                 }
00222             }
00223         }
00224
00225         // Restore the dc and delete the pen
00226         ::SelectObject(hdc, hOldPen);
00227         ::DeleteObject(hPen);
00228     }
00229
00230     EndPaint(&ps);
00231     return 0;
00232 }
00233
00234
00235 ////////////////////////////////////////////////////////
00236 // CRecoOutputWnd methods
00237 ////////////////////////////////////////////////////////
00238
00239 /////////////////////////////////////////////////////////
00240 //
00241 // CRecoOutputWnd::CRecoOutputWnd
00242 //
00243 // Constructor.
00244 //
00245 // Parameters:
00246 //      none
00247 //
00248 /////////////////////////////////////////////////////////
00249 CRecoOutputWnd::CRecoOutputWnd()
00250         : m_hRichEdit(NULL), m_iSelStart(0)
00251 {
00252 }
00253
00254 /////////////////////////////////////////////////////////
00255 //
00256 // CRecoOutputWnd::~CRecoOutputWnd
00257 //
00258 // Destructor.
00259 //
00260 /////////////////////////////////////////////////////////
00261 CRecoOutputWnd::~CRecoOutputWnd()
00262 {
00263     if (NULL != m_hRichEdit)
00264     {
00265         ::FreeLibrary(m_hRichEdit);
00266     }
00267 }
00268
00269 // Helper methods
00270
00271 /////////////////////////////////////////////////////////
00272 //
00273 // CRecoOutputWnd::~CRecoOutputWnd
00274 //
00275 // Destructor.
00276 //
00277 /////////////////////////////////////////////////////////
00278 HWND CRecoOutputWnd::Create(
00279         HWND hwndParent,
00280         UINT nID
00281         )
00282 {
00283     if (NULL == m_hWnd)
00284     {
00285         m_hRichEdit = ::LoadLibraryW(L"Riched20.dll");
00286         if (NULL != m_hRichEdit)
00287         {
00288             // Create a richedit control
00289             HWND hwndREdit = ::CreateWindowW(RICHEDIT_CLASSW,
00290                                              NULL,
00291                                              WS_VISIBLE | WS_CHILD | WS_BORDER
00292                                              | ES_SUNKEN | ES_MULTILINE | ES_READONLY,
00293                                              0, 0, 1, 1,
00294                                              hwndParent,
00295                                              (HMENU)nID,
00296                                              _Module.GetModuleInstance(),
00297                                              NULL
00298                                              );
00299             // Subclass it and attach to this CRecoOutputWnd object
00300             if (NULL != hwndREdit)
00301             {
00302                 SubclassWindow(hwndREdit);
00303             }
00304         }
00305     }
00306     return m_hWnd;
00307 }
00308
00309 /////////////////////////////////////////////////////////
00310 //
00311 // CRecoOutputWnd::ResetResults
00312 //
00313 // Empties the output strings.
00314 //
00315 // Parameters:  none
00316 //
00317 // Return Value (void): none
00318 //
00319 /////////////////////////////////////////////////////////
00320 void CRecoOutputWnd::ResetResults()
00321 {
00322     m_iSelStart = 0;
00323     if (IsWindow())
00324     {
00325         // Reset the text in the RichEdit control
00326         ::SendMessage(m_hWnd, WM_SETTEXT, 0, (LPARAM)L"");
00327     }
00328 }
00329
00330 /////////////////////////////////////////////////////////
00331 //
00332 // CRecoOutputWnd::AddString
00333 //
00334 // Adds a recognition result string to the existing text
00335 // in the RichEdit control
00336 //
00337 // Parameters:
00338 //      COLORREF clr    : [in] output color for the string
00339 //      BSTR bstr       : [in] recognition result of a stroke collection
00340 //
00341 // Return Value (void): none
00342 //
00343 /////////////////////////////////////////////////////////
00344 void CRecoOutputWnd::AddString(
00345         COLORREF clr,
00346         BSTR bstr
00347         )
00348 {
00349     // Set the string start position to the end of the text
00350     m_iSelStart = ::SendMessage(m_hWnd, WM_GETTEXTLENGTH, 0, 0);
00351
00352     // If the string is not first, add a delimiting space character first
00353     if (0 != m_iSelStart)
00354     {
00355         ::SendMessageW(m_hWnd, EM_REPLACESEL, FALSE, (LPARAM)L" ");
00356         m_iSelStart++;
00357     }
00358
00359     // Set the string format
00360     CHARFORMAT2W cf;
00361     cf.cbSize = sizeof(cf);
00362     cf.dwMask = CFM_COLOR;
00363     cf.crTextColor = clr;
00364     cf.dwEffects = 0;
00365     ::SendMessageW(m_hWnd, EM_SETSEL, m_iSelStart, -1);
00366     ::SendMessageW(m_hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
00367
00368     // Add the string to the text
00369     if (NULL != bstr)
00370     {
00371         ::SendMessageW(m_hWnd, EM_REPLACESEL, FALSE, (LPARAM)bstr);
00372     }
00373 }
00374
00375 /////////////////////////////////////////////////////////
00376 //
00377 // CRecoOutputWnd::UpdateString
00378 //
00379 // In the RichEdit control, updates the recognition result string
00380 // of the current stroke collection
00381 //
00382 // Parameters:
00383 //      BSTR bstr   : [in] recognition result string
00384 //
00385 // Return Value (void): none
00386 //
00387 /////////////////////////////////////////////////////////
00388 void CRecoOutputWnd::UpdateString(
00389         BSTR bstr
00390         )
00391 {
00392     // To update the string, select it in the RichEdit control ...
00393     ::SendMessageW(m_hWnd, EM_SETSEL, m_iSelStart, -1);
00394     // ... and replace the selected text
00395     ::SendMessageW(m_hWnd, EM_REPLACESEL, FALSE, (LPARAM)bstr);
00396     // The new text will inherit the format settings
00397 }
00398
00399
00400
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/KeepAliveWithThreads/ThreadPool.c Source File

  • Web
  • iis
  • extensions
  • KeepAliveWithThreads

ThreadPool.c

Go to the documentation of this file.
00001 /* Copyright (c) 1997-2002 Microsoft Corporation
00002
00003   Module Name:
00004
00005     ThreadPool.c
00006
00007   Abstract:
00008
00009     Work queue management functions.
00010 */
00011
00012 #define WIN32_LEAN_AND_MEAN
00013 #include <windows.h>
00014 #include <httpext.h>
00015 #include "threadpool.h"
00016
00017 /* Structure to create simple linked list */
00018
00019 typedef struct {
00020   EXTENSION_CONTROL_BLOCK *pECB;  /* Data for list entry */
00021   DWORD dwNextEntry;              /* Pointer to next entry */
00022 } ECB_QUEUE_ENTRY;
00023
00024 /* Array that is a simple linked list */
00025
00026 ECB_QUEUE_ENTRY ECBqueue[WORK_QUEUE_ENTRIES];
00027
00028 /* Index of next ECBqueue entry to use, and last Entry in use. */
00029
00030 DWORD dwCurrentEntry, dwLastEntry;
00031
00032 /* Flag to indicate that there are no other entries in the ECBqueue */
00033
00034 BOOL fQueueEmpty;
00035
00036 /*
00037   Description:
00038
00039     Initialize our thread pool
00040 */
00041
00042 BOOL InitThreadPool(void)
00043 {
00044   DWORD i;
00045   DWORD dwThreadID;
00046
00047   /* Create Semaphore in nonsignaled state */
00048
00049   if ((hWorkSem = CreateSemaphore(NULL, 0, 0x7fffffff, NULL)) == NULL)
00050     return FALSE;
00051
00052   InitializeCriticalSection(&csQueueLock);
00053
00054   fQueueEmpty = TRUE;
00055
00056   /* Create Pool Threads */
00057
00058   for (i = 0; i < POOL_THREADS; i++)
00059     if (CreateThread(NULL, 0, WorkerFunction, (LPVOID)i, 0, &dwThreadID) == NULL)
00060       return FALSE;
00061
00062   /* Clear work queue */
00063
00064   ZeroMemory(ECBqueue, WORK_QUEUE_ENTRIES * sizeof(ECB_QUEUE_ENTRY));
00065
00066   return TRUE;
00067 }
00068
00069 /*
00070   Description:
00071
00072     Add single work unit to the queue
00073
00074   Arguments:
00075
00076     pECB - pointer to the extension control block
00077
00078   Returns:
00079
00080     TRUE if the unit was successfully queued
00081     FALSE if queue is full
00082 */
00083
00084 BOOL AddWorkQueueEntry(IN EXTENSION_CONTROL_BLOCK *pECB)
00085 {
00086   DWORD i;
00087
00088   for (i = 0; i < WORK_QUEUE_ENTRIES; i++) {
00089
00090     if (ECBqueue[i].pECB == NULL) {
00091
00092       if (fQueueEmpty) {
00093
00094         dwCurrentEntry = i;
00095
00096         fQueueEmpty = FALSE;
00097
00098       } else {
00099
00100         ECBqueue[dwLastEntry].dwNextEntry = i;
00101       }
00102
00103       ECBqueue[i].pECB = pECB;
00104
00105       dwLastEntry = i;
00106
00107       return TRUE;
00108     }
00109   }
00110
00111   /* If no NULL queue entry found, indicate failure */
00112
00113   return FALSE;
00114 }
00115
00116 BOOL GetWorkQueueEntry(OUT EXTENSION_CONTROL_BLOCK **ppECB)
00117 {
00118   if ((*ppECB = ECBqueue[dwCurrentEntry].pECB) == NULL) {
00119
00120     return FALSE;
00121
00122   } else {
00123
00124     ECBqueue[dwCurrentEntry].pECB = NULL;
00125
00126     if (dwCurrentEntry == dwLastEntry)  /* If this is only pending item */
00127       fQueueEmpty = TRUE;
00128     else
00129       dwCurrentEntry = ECBqueue[dwCurrentEntry].dwNextEntry;
00130   }
00131
00132   return TRUE;
00133 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/OnDiskPropsDescriptions.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

OnDiskPropsDescriptions.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  OnDiskPropsDescriptions.cpp
00006 //
00007 // Description:
00008 //  This file implements the OnDiskPropsDescriptions() routine which
00009 //    lists description qualifiers of a class and its properties.
00010 //
00011 // History:
00012 //
00013 // **************************************************************************
00014
00015 #include "stdafx.h"
00016 #include "AdvClientDlg.h"
00017
00018 // **************************************************************************
00019 //
00020 //  CAdvClientDlg::OnDiskPropsDescriptions()
00021 //
00022 // Description:
00023 //    OnDiskPropsDescriptions.cpp lists class description and property descriptions
00024 //    for Win32_LogicalDisk class. Note that description qualifiers can be quite lengthy
00025 //    and are normally not retrieved, unless WBEM_FLAG_USE_AMENDED_QUALIFIERS flag
00026 //    is specified in IWbemServices::GetObject().
00027 //
00028 //    Object qualifiers are retieved by IWbemClassObject::GetQualifierSet().
00029 //    Property qualifiers are retrieved by IWbemClassObject::GetPropertyQualifierSet()
00030 //    - you need to supply property name as a parameter.
00031 //
00032 //    Get() method on the IWbemQualifierSet retrives specific qualifier values -
00033 //    in this case, descriptions.
00034 //
00035 //    Amended qualifiers (such as descriptions) are localizable and
00036 //    will be displayed in the language that corresponds to the current user
00037 //    locale on the client machine, as long as the server is able to provide
00038 //    appropriate localized resources.
00039 //
00040 // Parameters:
00041 //    None.
00042 //
00043 // Returns:
00044 //    Nothing.
00045 //
00046 // Globals accessed:
00047 //    None.
00048 //
00049 // Globals modified:
00050 //    None.
00051 //
00052 //===========================================================================
00053
00054
00055 void CAdvClientDlg::OnDiskPropsDescriptions()
00056 {
00057
00058   HRESULT  hRes;
00059   long lLower, lUpper, lCount;
00060   SAFEARRAY *psaNames = NULL;
00061   VARIANT pVal;
00062   BSTR PropName = NULL;
00063   CString clMyBuff;
00064
00065   VariantInit(&pVal);
00066
00067   IWbemClassObject *pDriveClass = NULL;
00068   IWbemQualifierSet *pQualSet = NULL;
00069
00070   m_outputList.ResetContent();
00071   m_outputList.AddString(_T("working..."));
00072
00073   BSTR driveClassName = SysAllocString(L"Win32_LogicalDisk");
00074   if (!driveClassName)
00075   {
00076     TRACE(_T("SysAllocString failed: not enough memory\n"));
00077     return;
00078   }
00079
00080   BSTR descr = SysAllocString(L"Description");
00081   if (!descr)
00082   {
00083     TRACE(_T("SysAllocString failed: not enough memory\n"));
00084     SysFreeString(driveClassName);
00085     return;
00086   }
00087
00088     if((hRes = m_pIWbemServices->GetObject(driveClassName,
00089                     WBEM_FLAG_USE_AMENDED_QUALIFIERS, // this is necessary to retrieve descriptions
00090                     NULL,
00091                     &pDriveClass,
00092                     NULL)) == S_OK)
00093   {
00094
00095     m_outputList.ResetContent();
00096
00097     //get class description
00098     hRes = pDriveClass->GetQualifierSet(&pQualSet);
00099     if (hRes == S_OK)
00100     {
00101       hRes = pQualSet->Get(descr, 0L, &pVal, NULL);
00102       if (hRes == S_OK)
00103       {
00104          m_outputList.AddString(CString(V_BSTR(&pVal)));
00105       }
00106
00107       VariantClear(&pVal);
00108     }
00109     pQualSet->Release();
00110
00111     //-------------------------------
00112     // Get the property names
00113     if((hRes = pDriveClass->GetNames(NULL,
00114                     WBEM_FLAG_ALWAYS |
00115                     WBEM_FLAG_NONSYSTEM_ONLY,
00116                     NULL,
00117                     &psaNames)) == S_OK)
00118     {
00119       //-------------------------------
00120       // Get the upper and lower bounds of the Names array
00121       if((hRes = SafeArrayGetLBound(psaNames, 1, &lLower)) != S_OK)
00122       {
00123         TRACE(_T("Couldn't get safe array lbound\n"));
00124         SafeArrayDestroy(psaNames);
00125         return;
00126       }
00127
00128       //-------------------------------
00129       if((hRes = SafeArrayGetUBound(psaNames, 1, &lUpper)) != S_OK)
00130       {
00131         TRACE(_T("Couldn't get safe array ubound\n"));
00132         SafeArrayDestroy(psaNames);
00133         return;
00134       }
00135
00136
00137       //-------------------------------
00138       // For all properties...
00139       for (lCount = lLower; lCount <= lUpper; lCount++)
00140       {
00141
00142         //-------------------------------
00143         // get the property name for this element
00144         if((hRes = SafeArrayGetElement(psaNames,
00145                         &lCount,
00146                         &PropName)) == S_OK)
00147         {
00148
00149           // Get pointer to property qualifiers
00150           // this mess is due to the fact that system properties don't have qualifiers
00151           if ((pDriveClass->GetPropertyQualifierSet(PropName, &pQualSet)) == S_OK)
00152           {
00153             // Get and print description
00154             if ((pQualSet->Get(descr, 0L, &pVal, NULL)) == S_OK)
00155             {
00156               m_outputList.AddString(CString(V_BSTR(&pVal)));
00157             }
00158             VariantClear(&pVal);
00159
00160             // done with the qualifierSet.
00161             if (pQualSet)
00162             {
00163               pQualSet->Release();
00164               pQualSet = NULL;
00165             }
00166           }
00167
00168         }
00169         else // SafeArrayGetElement() failed
00170         {
00171           TRACE(_T("Couldn't get safe array element\n"));
00172           break;
00173         } //endif SafeArrayGetElement()
00174
00175       } // endfor
00176
00177       // cleanup.
00178       SysFreeString(PropName);
00179       SysFreeString(descr);
00180       SafeArrayDestroy(psaNames);
00181       VariantClear(&pVal);
00182     }
00183     else // pDriveClass->GetNames() failed
00184     {
00185       TRACE(_T("Couldn't GetNames\n"));
00186     } //endif pDriveClass->GetNames()
00187
00188     // done with drive instance.
00189     if (pDriveClass)
00190     {
00191       pDriveClass->Release();
00192       pDriveClass = NULL;
00193     }
00194   } //endif GetObject()
00195
00196
00197 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/quiktest/custom.c Source File

  • Dataaccess
  • odbc
  • quiktest

custom.c

Go to the documentation of this file.
00001 //*---------------------------------------------------------------------------------
00002 //| Custom Auto Test DLL
00003 //|
00004 //| Title:  CUSTOM.C
00005 //|
00006 //| Purpose:
00007 //| This sample Auto Test DLL shows how an ODBC auto test may be written and
00008 //| subsequently run via the ODBC Test application.  To use this DLL:
00009 //|   1) Compile the source code via the BUILD.EXE program
00010 //|         CUSTOM.C    This shource file with test code
00011 //|         CUSTOM.H    Include files with defines, macros, and prototypes
00012 //|         CUSTOM.RC Resource file for string tables
00013 //|     (Note that .H and .RC files are optional in for an Auto Test)
00014 //|   2) Start the ODBC Test application
00015 //|   3) If you have not done so, choose Tools, Manage Test Sources and define
00016 //|       a test source to run against
00017 //|   4) Choose Tools, Manage Tests and add the CUSTOM.DLL created in step 1
00018 //|       to the list of installed test DLLs
00019 //|   5) Choose Tools, Run Tests and select "Custom Auto Test" and your Test Source
00020 //|       from step #3
00021 //| For more details, please see the SDK documentation.
00022 //*---------------------------------------------------------------------------------
00023 #include "autotest.h"
00024 #include "custom.h"
00025
00026
00027 //----------------------------------------------------------------------------------
00028 //    Defines and macros
00029 //----------------------------------------------------------------------------------
00030 typedef SWORD (FAR PASCAL *TESTCASEFUNC)(HENV FAR *, HDBC FAR *, HSTMT FAR *, lpSERVERINFO);
00031
00032 #define CHECKTEST(lps, exprc, actrc, func)      \
00033 {                                                  \
00034   if(!CheckTest(lps, exprc, actrc, (LPSTR)func))  \
00035     return TEST_ABORTED;                         \
00036 }
00037 #define CHECKERRS(sErr)                   \
00038   if(!sErr) szLogPrintf(lpSrvr, FALSE, "\t\tPassed\r\n\r\n"); \
00039   else szLogPrintf(lpSrvr, FALSE, "\t\t%d errors\r\n\r\n", sErr);
00040
00041
00042
00043 //----------------------------------------------------------------------------------
00044 //    Local function prototypes
00045 //----------------------------------------------------------------------------------
00046 SWORD FAR PASCAL DoHelloWorld(HENV FAR * phenv, HDBC FAR * phdbc,
00047         HSTMT FAR * phstmt, lpSERVERINFO lpSrvr);
00048 SWORD FAR PASCAL DoDisplayInfoDesc(HENV FAR * phenv, HDBC FAR * phdbc,
00049         HSTMT FAR * phstmt, lpSERVERINFO lpSrvr);
00050 SWORD FAR PASCAL DoSimpleConnect(HENV FAR * phenv, HDBC FAR * phdbc,
00051         HSTMT FAR * phstmt, lpSERVERINFO lpSrvr);
00052 BOOL FAR PASCAL CheckTest(lpSERVERINFO lps, RETCODE exprc, RETCODE actrc,
00053         LPSTR szFuncName);
00054
00055
00056 //
00057 // This structure is declared to describe the test cases and descriptions
00058 //    that this auto test supports.  Note that the strings are stored in
00059 //    the resource fork, but could have been hard coded.
00060 //
00061 struct {
00062   UINT          uiName;     // Test case name
00063   UINT          uiDesc;     // Test case description
00064   TESTCASEFUNC    lpTestFunc;   // Pointer to function to implement test
00065   } TestCases[] = {
00066 // szName         szDesc            lpTestFunc
00067 // -------------------- ----------------------- ------------------------
00068   idsHelloWorld,      idsHelloWorldDesc,    DoHelloWorld,
00069   idsDisplayInfo,   idsDisplayInfoDesc,   DoDisplayInfoDesc,
00070   idsSimpleConnect,   idsSimpleConnectDesc, DoSimpleConnect,
00071   };
00072
00073
00074
00075 //**************************************************************************
00076 //***************************  External Interfaces  ************************
00077 //*  These functions are called by ODBC Test to gather run-time information
00078 //**************************************************************************
00079
00080
00081 //*---------------------------------------------------------------------------------
00082 //| AutoTestName:
00083 //| This function is called to give the name of the auto test (which cannot
00084 //| exceed AUTO_MAX_TEST_NAME) as well as the number of test cases which
00085 //| are implemented in this test DLL.
00086 //| Parms:
00087 //| szName          The name to be displayed
00088 //| pcbTestCases      Pointer to count of test cases
00089 //| Returns:
00090 //| TRUE if successful (pcbTestCases set), FALSE for error
00091 //*---------------------------------------------------------------------------------
00092 BOOL EXTFUN AutoTestName(LPSTR szName, UINT FAR * pcbTestCases)
00093 {
00094   GetRCString(hLoadedInst, szName, AUTO_MAX_TEST_NAME, idsTestName);
00095   *pcbTestCases = NumItems(TestCases);
00096
00097    return TRUE;
00098 }
00099
00100
00101 //*---------------------------------------------------------------------------------
00102 //| AutoTestDesc:
00103 //| This function is called by ODBC Test when a description of a specific
00104 //| test case is required.  The returned name must be no larger than
00105 //| AUTO_MAX_TESTCASE_NAME including the NULL terminator.  The returned
00106 //| description must be no larger than AUTO_MAX_TESTDESC_NAME including the
00107 //| NULL.  iTest will be 1-based index of the test required.
00108 //|
00109 //| Note that iTest will start at 1 and will go to the number of
00110 //|   test cases as specified by the AutoTestName function.
00111 //|
00112 //| Parms:
00113 //| iTest           1-based index of test case required
00114 //| szName          The name of the test case
00115 //| szDesc          A description of the test case
00116 //| Returns:
00117 //| TRUE if successful, FALSE for error
00118 //*---------------------------------------------------------------------------------
00119 BOOL EXTFUN AutoTestDesc(UWORD iTest, LPSTR szName, LPSTR szDesc)
00120 {
00121   // Extra protection should AutoTestName return invalid pcbTestCases
00122   if(iTest > NumItems(TestCases))
00123     return FALSE;
00124
00125   // Use GetRCString to retrieve resource string directly into return
00126   //    values
00127   GetRCString(hLoadedInst, szName,
00128           AUTO_MAX_TESTCASE_NAME, TestCases[(iTest-1)].uiName);
00129   GetRCString(hLoadedInst, szDesc,
00130           AUTO_MAX_TESTDESC_NAME, TestCases[(iTest-1)].uiDesc);
00131
00132    return TRUE;
00133 }
00134
00135
00136 //*---------------------------------------------------------------------------------
00137 //| AutoTestFunc:
00138 //| This function is called to execute a test case selected by the user for
00139 //| execution.  The lpSrvr structure contains the information required for
00140 //| connected (as defined in the chosen Test Source), as well as other
00141 //| usefull information.  See the AUTOTEST.H file for the structure
00142 //| declaration.
00143 //|
00144 //| Use the GETBIT macro to determine which test should be executed.
00145 //|
00146 //| Parms:
00147 //| lpSrvr          Information required for running the test
00148 //| Returns:
00149 //| Nothing
00150 //*---------------------------------------------------------------------------------
00151 void EXTFUN AutoTestFunc(lpSERVERINFO lpSrvr)
00152 {
00153   HENV    henv=NULL;
00154   HDBC    hdbc=NULL;
00155   HSTMT   hstmt0=NULL;
00156   int   iDex;
00157   SWORD   cErrCnt;                    // Count errors
00158   char    szName[AUTO_MAX_TESTCASE_NAME+6]; // Room for NULL and \r\n
00159
00160
00161   // Sets the error count to 0
00162   InitTest(lpSrvr);
00163
00164   // Loop through the count of test cases looking for set bits via GETBIT.
00165   //    When a bit is set, that test is to be run.  We've stored the
00166   //    function address which will implement the test, so simply call it.
00167   for(iDex=1;  iDex<=NumItems(TestCases);  iDex++)
00168     if(GETBIT(lpSrvr->rglMask, iDex)) {
00169       // Print out title of test
00170       GetRCString(hLoadedInst, szName,
00171           AUTO_MAX_TESTCASE_NAME, TestCases[(iDex-1)].uiName);
00172       szLogPrintf(lpSrvr, FALSE, "%s:\r\n", (LPSTR)szName);
00173
00174       // Call the test case and add errors
00175       cErrCnt =
00176         (*TestCases[(iDex-1)].lpTestFunc)(&henv, &hdbc, &hstmt0, lpSrvr);
00177       if(cErrCnt != TEST_ABORTED)
00178         lpSrvr->cErrors += cErrCnt;
00179       else
00180         goto abort;
00181       }
00182   return;
00183
00184
00185   // When a test must abort, the test case should call the AbortTest
00186   //    macro which sets lpSrvr->cErrors to TEST_ABORTED.
00187 abort:
00188   return;
00189 }
00190
00191
00192
00193
00194
00195
00196 //**************************************************************************
00197 //*****************************  Test Cases  *******************************
00198 //*  The following functions implement the tests
00199 //**************************************************************************
00200
00201 //*---------------------------------------------------------------------------------
00202 //| DoHelloWord:
00203 //| This is a simple test which uses the szLogPrintf and szMessageBox
00204 //| functions defined in GATORTST.DLL.
00205 //|
00206 //| Note that this test also simulates an error by returning a count
00207 //| of 1.  This value is then totaled by ODBC Test and displayed as
00208 //| part of the grand total.
00209 //|
00210 //| Returns:
00211 //| Number of Errors or TEST_ABORTED
00212 //*---------------------------------------------------------------------------------
00213 SWORD FAR PASCAL DoHelloWorld(HENV FAR * phenv, HDBC FAR * phdbc,
00214         HSTMT FAR * phstmt, lpSERVERINFO lpSrvr)
00215 {
00216   SWORD   sErr=1;           // Pretend there was 1 error
00217
00218   // The szMessageBox function will display a formatted message via the
00219   //    Windows MessageBox function.  This function should not be used
00220   //    for standard testing since a good test will run unattended.
00221   szMessageBox(lpSrvr->hwnd,
00222         MB_ICONINFORMATION | MB_OK,
00223         "Hello World",
00224         "This is a sample message.");
00225
00226   // The szLogPrintf function is preferred for output operations.  It will
00227   //    format your string using wvsprintf (which has a limit of 2000 characters)
00228   //    and log the result both to the output window and to a file per
00229   //    user instructions.
00230   szLogPrintf(lpSrvr, FALSE, "\tHello World!!\r\n");
00231
00232
00233   // check for errors
00234   CHECKERRS(sErr);
00235
00236
00237   return sErr;
00238 }
00239
00240
00241 //*---------------------------------------------------------------------------------
00242 //| DoDisplayInfoDesc:
00243 //| This test case will use the szLogPrintf function to dump the contents
00244 //| of the lpSrvr structure.
00245 //|
00246 //| Returns:
00247 //| Number of Errors or TEST_ABORTED
00248 //*---------------------------------------------------------------------------------
00249 SWORD FAR PASCAL DoDisplayInfoDesc(HENV FAR * phenv, HDBC FAR * phdbc,
00250         HSTMT FAR * phstmt, lpSERVERINFO lpSrvr)
00251 {
00252   SWORD   sErr=0;
00253
00254 #ifndef WIN32
00255 #define szAddress "%04X:%04X\r\n"
00256 #else
00257 #define szAddress "%08X\r\n"
00258 #endif
00259
00260   // The hwnd parameter is the window of style "edit" which is used for output.
00261   //  The szLogFile parameter is used for file logging of output.
00262   szLogPrintf(lpSrvr, FALSE,
00263         "\thwnd:\t\t\t\t\t\t\t%04X\r\n", lpSrvr->hwnd);
00264   szLogPrintf(lpSrvr, FALSE,
00265         "\tszLogFile:\t\t\t\t%s\r\n", (LPSTR)lpSrvr->szLogFile);
00266
00267   // Print out address information.  Note that szAddress is conditionaly compiled
00268   //    to handle 16 and 32-bit.  It will be concatenated to the format string
00269   //    by the compiler to create a file platform correct string.
00270   szLogPrintf(lpSrvr, FALSE,
00271         "\thenv:\t\t\t\t\t\t\t" szAddress,
00272 #ifndef WIN32
00273         HIWORD(lpSrvr->henv), LOWORD(lpSrvr->henv));
00274 #else
00275         lpSrvr->henv);
00276 #endif
00277   szLogPrintf(lpSrvr, FALSE,
00278         "\thdbc:\t\t\t\t\t\t\t" szAddress,
00279 #ifndef WIN32
00280         HIWORD(lpSrvr->hdbc), LOWORD(lpSrvr->hdbc));
00281 #else
00282         lpSrvr->hdbc);
00283 #endif
00284   szLogPrintf(lpSrvr, FALSE,
00285         "\thstmt:\t\t\t\t\t\t\t" szAddress,
00286 #ifndef WIN32
00287         HIWORD(lpSrvr->hstmt), LOWORD(lpSrvr->hstmt));
00288 #else
00289         lpSrvr->hstmt);
00290 #endif
00291
00292
00293   // The following are defined via the Tools, Manage Test Sources dialog in
00294   //    the ODBC Test application.
00295   szLogPrintf(lpSrvr, FALSE,
00296         "\tszSource:\t\t\t\t\t%s\r\n", (LPSTR)lpSrvr->szSource);
00297   szLogPrintf(lpSrvr, FALSE,
00298         "\tszValidServer0:\t\t\t\t\t\t%s\r\n", (LPSTR)lpSrvr->szValidServer0);
00299   szLogPrintf(lpSrvr, FALSE,
00300         "\tszValidLogin0:\t\t\t\t\t\t%s\r\n", (LPSTR)lpSrvr->szValidLogin0);
00301   szLogPrintf(lpSrvr, FALSE,
00302         "\tszValidPassword0:\t\t\t%s\r\n", (LPSTR)lpSrvr->szValidPassword0);
00303   szLogPrintf(lpSrvr, FALSE,
00304         "\tszKeywords:\t\t\t%s\r\n", (LPSTR)lpSrvr->szKeywords);
00305
00306   // The following elements describe the run-time environment
00307   szLogPrintf(lpSrvr, FALSE,
00308         "\tcErrors:\t\t\t\t\t\t%d\r\n", (LPSTR)lpSrvr->cErrors);
00309   szLogPrintf(lpSrvr, FALSE,
00310         "\tfDebug:\t\t\t\t\t\t%d\r\n", (LPSTR)lpSrvr->fDebug);
00311   szLogPrintf(lpSrvr, FALSE,
00312         "\tfScreen:\t\t\t\t\t\t%d\r\n", (LPSTR)lpSrvr->fScreen);
00313   szLogPrintf(lpSrvr, FALSE,
00314         "\tfLog:\t\t\t\t\t\t\t\t%d\r\n", (LPSTR)lpSrvr->fLog);
00315   szLogPrintf(lpSrvr, FALSE,
00316         "\tfIsolate:\t\t\t\t\t\t%d\r\n", (LPSTR)lpSrvr->fIsolate);
00317   szLogPrintf(lpSrvr, FALSE,
00318         "\tvCursorLib:\t\t\t\t%lu\r\n", (LPSTR)lpSrvr->vCursorLib);
00319   szLogPrintf(lpSrvr, FALSE,
00320         "\thLoadedInst:\t\t\t%04X\r\n", (LPSTR)lpSrvr->hLoadedInst);
00321
00322   // check for errors
00323   CHECKERRS(sErr);
00324
00325   return sErr;
00326 }
00327
00328
00329 //*---------------------------------------------------------------------------------
00330 //| DoSimpleConnect:
00331 //| This test case will use the information in SERVERINFO to make a connection
00332 //|   to the chosen test source.
00333 //|
00334 //| Returns:
00335 //| Number of Errors or TEST_ABORTED
00336 //*---------------------------------------------------------------------------------
00337 SWORD FAR PASCAL DoSimpleConnect(HENV FAR * phenv, HDBC FAR * phdbc,
00338         HSTMT FAR * phstmt, lpSERVERINFO lpSrvr)
00339 {
00340   RETCODE     rc;
00341   SWORD       sErr=0;
00342
00343   // This test will assume that the ODBC handles passed in
00344   //    are NULL.  One could have this function do a connection
00345   //    and pass the handles to other test functions.
00346   rc = SQLAllocEnv(phenv);
00347   CHECKTEST(lpSrvr, SQL_SUCCESS, rc, "SQLAllocEnv");
00348
00349   rc = SQLAllocConnect(*phenv, phdbc);
00350   CHECKTEST(lpSrvr, SQL_SUCCESS, rc, "SQLAllocConnect");
00351
00352   rc = SQLConnect(*phdbc, lpSrvr->szValidServer0, SQL_NTS,
00353                   lpSrvr->szValidLogin0, SQL_NTS,
00354                   lpSrvr->szValidPassword0, SQL_NTS);
00355   CHECKTEST(lpSrvr,
00356       (RETCODE)((rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
00357             ? rc : SQL_SUCCESS),
00358       rc, "SQLConnect");
00359
00360   rc = SQLAllocStmt(*phdbc, phstmt);
00361   CHECKTEST(lpSrvr, SQL_SUCCESS, rc, "SQLAllocStmt");
00362
00363   rc = SQLFreeStmt(*phstmt, SQL_DROP);
00364   CHECKTEST(lpSrvr, SQL_SUCCESS, rc, "SQLFreeStmt");
00365
00366   rc = SQLDisconnect(*phdbc);
00367   CHECKTEST(lpSrvr, SQL_SUCCESS, rc, "SQLDisconnect");
00368
00369   rc = SQLFreeConnect(*phdbc);
00370   CHECKTEST(lpSrvr, SQL_SUCCESS, rc, "SQLFreeConnect");
00371
00372   rc = SQLFreeEnv(*phenv);
00373   CHECKTEST(lpSrvr, SQL_SUCCESS, rc, "SQLFreeEnv");
00374
00375
00376   // check for errors
00377   CHECKERRS(sErr);
00378
00379
00380   return sErr;
00381 }
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391 //**************************************************************************
00392 //*************************  Utility Functions  ****************************
00393 //*  This section contains internal utility functions
00394 //**************************************************************************
00395
00396
00397
00398
00399 //*---------------------------------------------------------------------------------
00400 //| CheckTest:
00401 //| This function will do a simple comparison of return codes and issue
00402 //| erros on failure.  Use the CHECKTEST macro to invoke.
00403 //|
00404 //| Returns:
00405 //| TRUE if the codes match, FALSE on error
00406 //*---------------------------------------------------------------------------------
00407 BOOL FAR PASCAL CheckTest(lpSERVERINFO lps, RETCODE exprc, RETCODE actrc,
00408         LPSTR szFuncName)
00409 {
00410   if(exprc != actrc) {
00411     szLogPrintf(lps, FALSE, "\t%s failed:\r\n", (LPSTR)szFuncName);
00412     szLogPrintf(lps, FALSE, "\t\tExpected: %d\r\n", exprc);
00413     szLogPrintf(lps, FALSE, "\t\tActual:   %d\r\n", actrc);
00414     return FALSE;
00415     }
00416   else
00417     return TRUE;
00418 }
00419
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Settings.Cpp Source File

  • WinUI
  • GlobalDev
  • CSSamp

Settings.Cpp

Go to the documentation of this file.
00001 ////    SETTINGS.CPP - Handles settings dialog
00002 //
00003 //
00004 #include "precomp.hxx"
00005 #include "global.h"
00006
00007 ////    HexToInt - convert hex digit string to int value
00008 //
00009 //      Ignores 'x' in the string so accepts input like '0x0100'.
00010 int HexToInt(char szHex[])
00011 {
00012
00013     int i = 0;
00014     int h = 0;
00015     //int d = 0;
00016
00017     while (szHex[i]  &&  szHex[i] != ' ')
00018     {
00019         if (szHex[i] >= '0'  &&  szHex[i] <= '9')
00020         {
00021
00022             h = h*16 + szHex[i] - '0';
00023             //d = d*10 + szHex[i] - '0';
00024
00025         }
00026         else if (szHex[i] >= 'a'  &&  szHex[i] <= 'f')
00027         {
00028             h = h*16 + 10 + szHex[i] - 'a';
00029
00030         }
00031         else if (szHex[i] >= 'A'  &&  szHex[i] <= 'F')
00032         {
00033             h = h*16 + 10 + szHex[i] - 'A';
00034
00035         }
00036         else if (szHex[i] != ' '  &&  szHex[i] != ','  &&  szHex[i] != 'x'  &&  szHex[i] != 'X')
00037         {
00038             h = -1;
00039             break;
00040         }
00041         i++;
00042     }
00043
00044     return h;
00045 }
00046
00047 BOOL ChangeFont(HWND hDlg, int iStyle, int idFont, int idSize, int idBold, int idItalic, int idUnderline)
00048 {
00049     int   iHeight = 0;
00050     char  sFaceName[100];
00051     int   i = 0;
00052     BOOL bSucess = TRUE;
00053
00054     // Get size
00055     i = (int)SendDlgItemMessage(hDlg, idSize, CB_GETCURSEL, 0, 0);
00056     if (SendDlgItemMessage(hDlg, idSize, CB_GETLBTEXT, i, (LPARAM)sFaceName) == CB_ERR)
00057     {
00058         bSucess = FALSE;
00059         goto RETURN;
00060     }
00061     iHeight = -MulDiv(atoi(sFaceName), g_iLogPixelsY, 72);
00062
00063     // Get facename
00064     i = (int)SendDlgItemMessage(hDlg, idFont, CB_GETCURSEL, 0, 0);
00065     if (SendDlgItemMessage(hDlg, idFont, CB_GETLBTEXT, i, (LPARAM)sFaceName) == CB_ERR)
00066     {
00067         bSucess = FALSE;
00068         goto RETURN;
00069     }
00070
00071     SetStyle(
00072         iStyle,
00073         iHeight,
00074         IsDlgButtonChecked(hDlg, idBold)      == BST_CHECKED ? 700 : 400,
00075         IsDlgButtonChecked(hDlg, idItalic)    == BST_CHECKED,
00076         IsDlgButtonChecked(hDlg, idUnderline) == BST_CHECKED,
00077         sFaceName);
00078
00079
00080
00081     InvalidateText();
00082     RETURN:
00083     return bSucess;
00084 }
00085
00086 BOOL Command(HWND hDlg, int iCmd, int iNotify, HWND hItemWnd)
00087 {
00088     char str[100];
00089     WCHAR  wc;
00090     int    i = 0;
00091     char   hex[] = "0123456789abcdef";
00092     BOOL bProcessed = TRUE;
00093
00094     switch(iCmd)
00095     {
00096     case IDC_LANGUAGE:
00097         if (iNotify == CBN_SELCHANGE)
00098         {
00099             i = (int)SendMessage(hItemWnd, CB_GETCURSEL, 0, 0);
00100             if (SendMessage(hItemWnd, CB_GETLBTEXT, i, (LPARAM)str) != CB_ERR)
00101             {
00102                 wc = (WCHAR)HexToInt(str);
00103                 g_ScriptControl.uDefaultLanguage = wc;
00104                 InvalidateText();
00105             }
00106         }
00107         else if (iNotify == CBN_EDITCHANGE)
00108         {
00109             if (SendMessage(hItemWnd, WM_GETTEXT, sizeof(str), (LPARAM)str))
00110             {
00111                 wc = (WCHAR)HexToInt(str);
00112                 g_ScriptControl.uDefaultLanguage = wc;
00113                 InvalidateText();
00114             }
00115         }
00116         break;
00117
00118     case IDC_INSERT_CODEPOINT:
00119         if (GetDlgItemTextA(g_hSettingsDlg, IDC_CODEPOINT, str, sizeof(str)))
00120         {
00121             wc = (WCHAR)HexToInt(str);
00122             if (TextInsert(g_iCurChar, &wc, 1))
00123             {
00124                 g_iCurChar++;
00125                 InvalidateText();
00126             }
00127         }
00128         break;
00129
00130     case IDC_HIGHLIGHT_FROM:  /* fall-through*/
00131     case IDC_HIGHLIGHT_TO:
00132         InvalidateText();
00133         break;
00134
00135     case IDC_LINEFILL:
00136         g_fFillLines = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00137         InvalidateText();
00138         break;
00139
00140     case IDC_LTR:
00141         g_ScriptState.uBidiLevel = 0;
00142         SendDlgItemMessage(hDlg, IDC_LTR, BM_SETSTATE, TRUE, 0);
00143         SendDlgItemMessage(hDlg, IDC_RTL, BM_SETSTATE, FALSE, 0);
00144         InvalidateText();
00145         break;
00146
00147     case IDC_RTL:
00148         g_ScriptState.uBidiLevel = 1;
00149         SendDlgItemMessage(hDlg, IDC_RTL, BM_SETSTATE, TRUE, 0);
00150         SendDlgItemMessage(hDlg, IDC_LTR, BM_SETSTATE, FALSE, 0);
00151         InvalidateText();
00152         break;
00153
00154     case IDC_CONTROL_CONTEXT:
00155         g_ScriptControl.fContextDigits = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00156         InvalidateText();
00157         break;
00158
00159     case IDC_DIGIT_SUBSTITUTE:
00160         g_ScriptState.fDigitSubstitute = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00161         InvalidateText();
00162         break;
00163
00164     case IDC_ARANUMCONTEXT:
00165         g_ScriptState.fArabicNumContext = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00166         InvalidateText();
00167         break;
00168
00169     case IDC_LEGACY_BIDI:
00170         g_ScriptControl.fLegacyBidiClass = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00171         InvalidateText();
00172         break;
00173
00174     case IDC_OVERRIDE:
00175         g_ScriptState.fOverrideDirection = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00176         InvalidateText();
00177         break;
00178
00179     case IDC_CONTROL_CHARS:
00180         g_ScriptState.fDisplayZWG = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00181         InvalidateText();
00182         break;
00183
00184     case IDC_LOGICAL_ORDER:
00185         g_fLogicalOrder = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00186         InvalidateText();
00187         break;
00188
00189     case IDC_NO_GLYPH_INDEX:
00190         g_fNoGlyphIndex = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00191         InvalidateText();
00192         break;
00193
00194     case IDC_LOGICAL:
00195         g_fShowLogical = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00196         InvalidateText();
00197         break;
00198
00199     case IDC_PLAINTEXT:
00200         g_fShowPlainText = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00201         InvalidateText();
00202         break;
00203
00204     case IDC_PLAINTEXT_FIT:
00205         if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
00206         {
00207             g_dwSSAflags |= SSA_FIT;
00208         }
00209         else
00210         {
00211             g_dwSSAflags &= ~SSA_FIT;
00212         }
00213         InvalidateText();
00214         break;
00215
00216     case IDC_PLAINTEXT_CLIP:
00217         if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
00218         {
00219             g_dwSSAflags |= SSA_CLIP;
00220         }
00221         else
00222         {
00223             g_dwSSAflags &= ~SSA_CLIP;
00224         }
00225         InvalidateText();
00226         break;
00227
00228     case IDC_PLAINTEXT_TAB:
00229         if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
00230         {
00231             g_dwSSAflags |= SSA_TAB;
00232         }
00233         else
00234         {
00235             g_dwSSAflags &= ~SSA_TAB;
00236         }
00237         InvalidateText();
00238         break;
00239
00240     case IDC_PLAINTEXT_DX:
00241         g_fOverrideDx = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00242         memset(g_iWidthBuf, 0, sizeof(int)*g_iTextLen+1);
00243         InvalidateText();
00244         break;
00245
00246     case IDC_PLAINTEXT_FALLBACK:
00247         if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
00248         {
00249             g_dwSSAflags |= SSA_FALLBACK;
00250         }
00251         else
00252         {
00253             g_dwSSAflags &= ~SSA_FALLBACK;
00254         }
00255         InvalidateText();
00256         break;
00257
00258     case IDC_PLAINTEXT_LINK:
00259         if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
00260         {
00261             g_dwSSAflags |= SSA_LINK;
00262         }
00263         else
00264         {
00265             g_dwSSAflags &= ~SSA_LINK;
00266         }
00267         InvalidateText();
00268         break;
00269
00270     case IDC_PLAINTEXT_HOTKEY:
00271         if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
00272         {
00273             g_dwSSAflags |= SSA_HOTKEY;
00274         }
00275         else
00276         {
00277             g_dwSSAflags &= ~SSA_HOTKEY;
00278         }
00279         InvalidateText();
00280         break;
00281
00282     case IDC_PLAINTEXT_PASSWORD:
00283         if (IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED)
00284         {
00285             g_dwSSAflags |= SSA_PASSWORD;
00286         }
00287         else
00288         {
00289             g_dwSSAflags &= ~SSA_PASSWORD;
00290         }
00291         InvalidateText();
00292         break;
00293
00294     case IDC_PLAINTEXT_FONT:  /* fall-through */
00295     case IDC_PLAINTEXT_SIZE:
00296         if (iNotify != CBN_SELCHANGE)
00297         {
00298             bProcessed = FALSE;
00299             break;
00300         }
00301
00302     case IDC_PLAINTEXT_BOLD:  /* fall-through */
00303     case IDC_PLAINTEXT_ITALIC:  /* fall-through */
00304     case IDC_PLAINTEXT_UNDERLINE:
00305         ChangeFont(
00306             hDlg,
00307             0,
00308             IDC_PLAINTEXT_FONT,
00309             IDC_PLAINTEXT_SIZE,
00310             IDC_PLAINTEXT_BOLD,
00311             IDC_PLAINTEXT_ITALIC,
00312             IDC_PLAINTEXT_UNDERLINE);
00313         break;
00314
00315     case IDC_FORMATTED:
00316         g_fShowFancyText = IsDlgButtonChecked(hDlg, iCmd) == BST_CHECKED;
00317         InvalidateText();
00318         break;
00319
00320     case IDC_FANCY_FONT1:  /* fall-through */
00321     case IDC_FANCY_SIZE1:
00322         if (iNotify != CBN_SELCHANGE)
00323         {
00324             bProcessed = FALSE;
00325             break;
00326         }
00327     case IDC_FANCY_BOLD1:  /* fall-through */
00328     case IDC_FANCY_ITALIC1:  /* fall-through */
00329     case IDC_FANCY_UNDERLINE1:
00330         ChangeFont(
00331             hDlg,
00332             1,
00333             IDC_FANCY_FONT1,
00334             IDC_FANCY_SIZE1,
00335             IDC_FANCY_BOLD1,
00336             IDC_FANCY_ITALIC1,
00337             IDC_FANCY_UNDERLINE1);
00338         break;
00339
00340     case IDC_FANCY_FONT2:  /* fall-through */
00341     case IDC_FANCY_SIZE2:
00342         if (iNotify != CBN_SELCHANGE)
00343         {
00344             bProcessed = FALSE;
00345             break;
00346         }
00347
00348     case IDC_FANCY_BOLD2:  /* fall-through */
00349     case IDC_FANCY_ITALIC2:  /* fall-through */
00350     case IDC_FANCY_UNDERLINE2:
00351         ChangeFont(
00352             hDlg,
00353             2,
00354             IDC_FANCY_FONT2,
00355             IDC_FANCY_SIZE2,
00356             IDC_FANCY_BOLD2,
00357             IDC_FANCY_ITALIC2,
00358             IDC_FANCY_UNDERLINE2);
00359         break;
00360
00361     case IDC_FANCY_FONT3:  /* fall-through */
00362     case IDC_FANCY_SIZE3:
00363         if (iNotify != CBN_SELCHANGE)
00364         {
00365             bProcessed = FALSE;
00366             break;
00367         }
00368
00369     case IDC_FANCY_BOLD3:  /* fall-through */
00370     case IDC_FANCY_ITALIC3:  /* fall-through */
00371     case IDC_FANCY_UNDERLINE3:
00372         ChangeFont(
00373             hDlg,
00374             3,
00375             IDC_FANCY_FONT3,
00376             IDC_FANCY_SIZE3,
00377             IDC_FANCY_BOLD3,
00378             IDC_FANCY_ITALIC3,
00379             IDC_FANCY_UNDERLINE3);
00380         break;
00381
00382     case IDC_FANCY_FONT4:  /* fall-through */
00383     case IDC_FANCY_SIZE4:
00384         if (iNotify != CBN_SELCHANGE)
00385         {
00386             bProcessed = FALSE;
00387             break;
00388         }
00389
00390     case IDC_FANCY_BOLD4:  /* fall-through */
00391     case IDC_FANCY_ITALIC4:  /* fall-through */
00392     case IDC_FANCY_UNDERLINE4:
00393         ChangeFont(
00394             hDlg,
00395             4,
00396             IDC_FANCY_FONT4,
00397             IDC_FANCY_SIZE4,
00398             IDC_FANCY_BOLD4,
00399             IDC_FANCY_ITALIC4,
00400             IDC_FANCY_UNDERLINE4);
00401         break;
00402
00403     case IDC_FORMAT1:  /* fall-through */
00404     case IDC_FORMAT2:  /* fall-through */
00405     case IDC_FORMAT3:  /* fall-through */
00406     case IDC_FORMAT4:
00407         if (g_iTo < g_iFrom)
00408         {
00409             i=g_iTo;  g_iTo=g_iFrom;  g_iFrom=i;
00410         }
00411
00412         if (    g_iFrom <  g_iTo
00413             &&  g_iFrom <  g_iTextLen
00414             &&  g_iTo   <= g_iTextLen)
00415         {
00416
00417             i=1; // Default
00418             switch(iCmd) {
00419                 case IDC_FORMAT1:  i=1;  break;
00420                 case IDC_FORMAT2:  i=2;  break;
00421                 case IDC_FORMAT3:  i=3;  break;
00422                 case IDC_FORMAT4:  i=4;  break;
00423             }
00424             StyleSetRange(i, g_iFrom, g_iTo-g_iFrom);
00425             ASSERT(StyleCheckRange());
00426             InvalidateText();
00427         }
00428         break;
00429
00430     case IDC_APPLYDIGITSUBST:
00431         ScriptApplyDigitSubstitution(NULL, &g_ScriptControl, &g_ScriptState);
00432
00433         SendDlgItemMessage(hDlg, IDC_DIGIT_SUBSTITUTE,  BM_SETCHECK, g_ScriptState.fDigitSubstitute ? BST_CHECKED : BST_UNCHECKED, 0);
00434         SendDlgItemMessage(hDlg, IDC_CONTROL_CONTEXT,   BM_SETCHECK, g_ScriptControl.fContextDigits ? BST_CHECKED : BST_UNCHECKED, 0);
00435         str[0] = '0';
00436         str[1] = 'x';
00437         str[2] = hex[(g_ScriptControl.uDefaultLanguage & 0xf0) >> 4];
00438         str[3] = hex[ g_ScriptControl.uDefaultLanguage & 0x0f];
00439         str[4] = 0;
00440         SendDlgItemMessage(hDlg, IDC_LANGUAGE,          CB_SELECTSTRING, 0, (LPARAM) str);
00441
00442         InvalidateText();
00443         break;
00444
00445     case IDC_PRESENTATION:
00446         g_fPresentation = TRUE;
00447         ShowWindow(g_hSettingsDlg, SW_HIDE);
00448         SetFocus(g_hTextWnd);
00449         InvalidateText();
00450         break;
00451
00452     case IDC_SHOWLEVELS:
00453         g_fShowLevels = !g_fShowLevels;
00454         if (g_fShowLevels)
00455         {
00456             SetDlgItemTextA(g_hSettingsDlg, IDC_SHOWLEVELS, "Hide levels");
00457         }
00458         else
00459         {
00460             SetDlgItemTextA(g_hSettingsDlg, IDC_SHOWLEVELS, "Show levels");
00461         }
00462         SetFocus(g_hTextWnd);
00463         InvalidateText();
00464         break;
00465     default:
00466         bProcessed = FALSE;
00467
00468     }  // end switch
00469
00470     return bProcessed;
00471 }
00472
00473 int CALLBACK InitOneFace(
00474     const ENUMLOGFONTEXA   *lpelfe,    // pointer to logical-font data
00475     const NEWTEXTMETRICEXA *lpntme,    // pointer to physical-font data
00476     int                     FontType,  // type of font
00477     LPARAM                  lParam)    // application-defined data
00478 {
00479     if (SendDlgItemMessage(
00480             (HWND)lParam,
00481             IDC_PLAINTEXT_FONT,
00482             CB_FINDSTRINGEXACT,
00483             0, (LPARAM)lpelfe->elfLogFont.lfFaceName) == CB_ERR)
00484    {
00485         // It's a new font name
00486         SendDlgItemMessage(
00487             (HWND)lParam,
00488             IDC_PLAINTEXT_FONT,
00489             CB_ADDSTRING,
00490             0, (LPARAM)lpelfe->elfLogFont.lfFaceName);
00491
00492         SendDlgItemMessage(
00493             (HWND)lParam,
00494             IDC_FANCY_FONT1,
00495             CB_ADDSTRING,
00496             0, (LPARAM)lpelfe->elfLogFont.lfFaceName);
00497
00498         SendDlgItemMessage(
00499             (HWND)lParam,
00500             IDC_FANCY_FONT2,
00501             CB_ADDSTRING,
00502             0, (LPARAM)lpelfe->elfLogFont.lfFaceName);
00503
00504         SendDlgItemMessage(
00505             (HWND)lParam,
00506             IDC_FANCY_FONT3,
00507             CB_ADDSTRING,
00508             0, (LPARAM)lpelfe->elfLogFont.lfFaceName);
00509
00510         SendDlgItemMessage(
00511             (HWND)lParam,
00512             IDC_FANCY_FONT4,
00513             CB_ADDSTRING,
00514             0, (LPARAM)lpelfe->elfLogFont.lfFaceName);
00515     }
00516
00517
00518     return 1;   // Continue enumeration
00519 }
00520
00521 void InitOneSize(
00522     HWND   hDlg,
00523     char  *str)
00524 {
00525
00526     SendDlgItemMessage(hDlg, IDC_PLAINTEXT_SIZE, CB_ADDSTRING, 0, (LPARAM)str);
00527     SendDlgItemMessage(hDlg, IDC_FANCY_SIZE1,    CB_ADDSTRING, 0, (LPARAM)str);
00528     SendDlgItemMessage(hDlg, IDC_FANCY_SIZE2,    CB_ADDSTRING, 0, (LPARAM)str);
00529     SendDlgItemMessage(hDlg, IDC_FANCY_SIZE3,    CB_ADDSTRING, 0, (LPARAM)str);
00530     SendDlgItemMessage(hDlg, IDC_FANCY_SIZE4,    CB_ADDSTRING, 0, (LPARAM)str);
00531 }
00532
00533 void InitSelection(HWND hDlg, int idFace, int idSize, char *sFaceName)
00534 {
00535     int i = 0;
00536
00537     i = (int)SendDlgItemMessage(hDlg, idFace, CB_FINDSTRINGEXACT, 0, (LPARAM)sFaceName);
00538     if (i == CB_ERR)
00539     {
00540         SendDlgItemMessage(hDlg, idFace, CB_SETCURSEL, 0, 0);
00541     }
00542     else
00543     {
00544         SendDlgItemMessage(hDlg, idFace, CB_SETCURSEL, i, 0);
00545     }
00546
00547     SendDlgItemMessage(hDlg, idSize, CB_SETCURSEL, 10, 0);   // Selection 10 is 18 point
00548 }
00549
00550 void InitFaceLists(HWND hDlg)
00551 {
00552     HDC      hdc = NULL;
00553     LOGFONTA lf = {0};
00554
00555     SetLogFont(&lf, 0, 0, 0, 0, "");
00556     hdc = GetDC(g_hTextWnd);
00557     EnumFontFamiliesExA(hdc, &lf, (FONTENUMPROCA)InitOneFace, (LPARAM)hDlg, 0);
00558     ReleaseDC(g_hTextWnd, hdc);
00559
00560     // Initialise sizes
00561     InitOneSize(hDlg, "6");
00562     InitOneSize(hDlg, "7");
00563     InitOneSize(hDlg, "8");
00564     InitOneSize(hDlg, "9");
00565     InitOneSize(hDlg, "10");
00566     InitOneSize(hDlg, "11");
00567     InitOneSize(hDlg, "12");
00568     InitOneSize(hDlg, "13");
00569     InitOneSize(hDlg, "14");
00570     InitOneSize(hDlg, "16");
00571     InitOneSize(hDlg, "18");
00572     InitOneSize(hDlg, "20");
00573     InitOneSize(hDlg, "22");
00574     InitOneSize(hDlg, "24");
00575     InitOneSize(hDlg, "28");
00576     InitOneSize(hDlg, "32");
00577     InitOneSize(hDlg, "36");
00578     InitOneSize(hDlg, "48");
00579     InitOneSize(hDlg, "60");
00580     InitOneSize(hDlg, "72");
00581     InitOneSize(hDlg, "90");
00582     InitOneSize(hDlg, "108");
00583     InitOneSize(hDlg, "126");
00584     InitOneSize(hDlg, "144");
00585
00586     // Select standard fonts and sizes
00587     InitSelection(hDlg, IDC_PLAINTEXT_FONT, IDC_PLAINTEXT_SIZE, "Microsoft Sans Serif");
00588
00589     InitSelection(hDlg, IDC_FANCY_FONT1,    IDC_FANCY_SIZE1,    "Microsoft Sans Serif");
00590     InitSelection(hDlg, IDC_FANCY_FONT2,    IDC_FANCY_SIZE2,    "Mangal");
00591     InitSelection(hDlg, IDC_FANCY_FONT3,    IDC_FANCY_SIZE3,    "Latha");
00592     InitSelection(hDlg, IDC_FANCY_FONT4,    IDC_FANCY_SIZE4,    "Arial");
00593
00594     ChangeFont(hDlg, 0, IDC_PLAINTEXT_FONT, IDC_PLAINTEXT_SIZE, IDC_PLAINTEXT_BOLD, IDC_PLAINTEXT_ITALIC, IDC_PLAINTEXT_UNDERLINE);
00595     ChangeFont(hDlg, 1, IDC_FANCY_FONT1, IDC_FANCY_SIZE1, IDC_FANCY_BOLD1, IDC_FANCY_ITALIC1, IDC_FANCY_UNDERLINE1);
00596     ChangeFont(hDlg, 2, IDC_FANCY_FONT2, IDC_FANCY_SIZE2, IDC_FANCY_BOLD2, IDC_FANCY_ITALIC2, IDC_FANCY_UNDERLINE2);
00597     ChangeFont(hDlg, 3, IDC_FANCY_FONT3, IDC_FANCY_SIZE3, IDC_FANCY_BOLD3, IDC_FANCY_ITALIC3, IDC_FANCY_UNDERLINE3);
00598     ChangeFont(hDlg, 4, IDC_FANCY_FONT4, IDC_FANCY_SIZE4, IDC_FANCY_BOLD4, IDC_FANCY_ITALIC4, IDC_FANCY_UNDERLINE4);
00599 }
00600
00601 const char *szUniChar[] = {
00602     "200B ZWSP",
00603     "200C ZWNJ",
00604     "200D ZWJ",
00605     "200E LRM",
00606     "200F RLM",
00607     "202A LRE",
00608     "202B RLE",
00609     "202C PDF",
00610     "202D LRO",
00611     "202E RLO",
00612     "206A ISS",
00613     "206B ASS",
00614     "206E NADS",
00615     "206F NODS",
00616     "0908 Letter Ii",
00617     "0915 Letter Ka",
00618     "093f Vowel I",
00619     "094D Virama",
00620 };
00621
00622 const char *szLanguage[] = {
00623     "0x00  Neutral"   ,
00624     "0x36  Afrikaans" ,
00625     "0x1c  Albanian"  ,
00626     "0x01  Arabic"    ,
00627     "0x2b  Armenian"  ,
00628     "0x4d  Assamese"  ,
00629     "0x2c  Azeri"     ,
00630     "0x2d  Basque"    ,
00631     "0x23  Belarusian",
00632     "0x45  Bengali"   ,
00633     "0x02  Bulgarian" ,
00634 //  "      Burmese"   ,
00635     "0x03  Catalan"   ,
00636     "0x04  Chinese"   ,
00637     "0x1a  Croatian"  ,
00638     "0x05  Czech"     ,
00639     "0x06  Danish"    ,
00640     "0x13  Dutch"     ,
00641     "0x09  English"   ,
00642     "0x25  Estonian"  ,
00643     "0x38  Faeroese"  ,
00644     "0x29  Farsi"     ,
00645     "0x0b  Finnish"   ,
00646     "0x0c  French"    ,
00647     "0x37  Georgian"  ,
00648     "0x07  German"    ,
00649     "0x08  Greek"     ,
00650     "0x47  Gujarati"  ,
00651     "0x0d  Hebrew"    ,
00652     "0x39  Hindi"     ,
00653     "0x0e  Hungarian" ,
00654     "0x0f  Icelandic" ,
00655     "0x21  Indonesian",
00656     "0x10  Italian"   ,
00657     "0x11  Japanese"  ,
00658     "0x4b  Kannada"   ,
00659     "0x60  Kashmiri"  ,
00660     "0x3f  Kazak"     ,
00661 //  "      Khmer"     ,
00662     "0x57  Konkani"   ,
00663     "0x12  Korean"    ,
00664 //  "      Lao"       ,
00665     "0x26  Latvian"   ,
00666     "0x27  Lithuanian",
00667     "0x2f  Macedonian",
00668     "0x3e  Malay"     ,
00669     "0x4c  Malayalam" ,
00670     "0x58  Manipuri"  ,
00671     "0x4e  Marathi"   ,
00672     "0x61  Nepali"    ,
00673 //  "      Mongolian" ,
00674     "0x14  Norwegian" ,
00675     "0x48  Oriya"     ,
00676     "0x15  Polish"    ,
00677     "0x16  Portuguese",
00678     "0x46  Punjabi"   ,
00679     "0x18  Romanian"  ,
00680     "0x19  Russian"   ,
00681     "0x4f  Sanskrit"  ,
00682     "0x1a  Serbian"   ,
00683     "0x59  Sindhi"    ,
00684     "0x1b  Slovak"    ,
00685     "0x24  Slovenian" ,
00686     "0x0a  Spanish"   ,
00687     "0x41  Swahili"   ,
00688     "0x1d  Swedish"   ,
00689     "0x49  Tamil"     ,
00690     "0x44  Tatar"     ,
00691     "0x4a  Telugu"    ,
00692     "0x1e  Thai"      ,
00693 //  "      Tibetan"   ,
00694     "0x1f  Turkish"   ,
00695     "0x22  Ukrainian" ,
00696     "0x20  Urdu"      ,
00697     "0x43  Uzbek"     ,
00698     "0x2a  Vietnamese",
00699 };
00700
00701 INT_PTR CALLBACK SettingsDlgProc(
00702         HWND    hDlg,
00703         UINT    uMsg,
00704         WPARAM  wParam,
00705         LPARAM  lParam)
00706 {
00707         int i = 0;
00708
00709         switch (uMsg)
00710         {
00711         case WM_INITDIALOG:
00712             // Populate the Unicode codepoint combo box
00713             for (i = 0; i < sizeof(szUniChar)/sizeof(szUniChar[0]); ++i)
00714             {
00715                 SendDlgItemMessage(hDlg, IDC_CODEPOINT, CB_ADDSTRING, 0, (LPARAM)szUniChar[i]);
00716             }
00717
00718             for (i = 0; i < sizeof(szLanguage)/sizeof(szLanguage[0]); ++i)
00719             {
00720                 SendDlgItemMessage(hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)szLanguage[i]);
00721             }
00722
00723             SendDlgItemMessage(hDlg, IDC_LANGUAGE, CB_SETCURSEL, 0, 0);
00724             SendDlgItemMessage(hDlg, IDC_LTR,       BM_SETSTATE, TRUE, 0);
00725             SendDlgItemMessage(hDlg, IDC_HORIZ,     BM_SETSTATE, TRUE, 0);
00726             SendDlgItemMessage(hDlg, IDC_LOGICAL,   BM_SETCHECK, BST_CHECKED, 0);
00727             SendDlgItemMessage(hDlg, IDC_PLAINTEXT, BM_SETCHECK, BST_CHECKED, 0);
00728             SendDlgItemMessage(hDlg, IDC_FORMATTED, BM_SETCHECK, BST_CHECKED, 0);
00729             SendDlgItemMessage(hDlg, IDC_LINEFILL,  BM_SETCHECK, BST_CHECKED, 0);
00730             SendDlgItemMessage(hDlg, IDC_PLAINTEXT_FALLBACK, BM_SETCHECK, BST_CHECKED, 0);
00731
00732             InitFaceLists(hDlg);
00733             break;
00734
00735         case WM_COMMAND:
00736             Command(hDlg, LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
00737             break;
00738
00739         }
00740
00741
00742         return FALSE;
00743 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/Pdh/StatList/Resource.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • Pdh
  • StatList

Resource.h

Go to the documentation of this file.
00001 /*
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Microsoft Developer Studio generated include file.
00010
00011 Next default values for new objects
00012 */
00013
00014 #ifdef APSTUDIO_INVOKED
00015 #ifndef APSTUDIO_READONLY_SYMBOLS
00016 #define _APS_NO_MFC                     1
00017 #define _APS_NEXT_RESOURCE_VALUE        101
00018 #define _APS_NEXT_COMMAND_VALUE         40001
00019 #define _APS_NEXT_CONTROL_VALUE         1000
00020 #define _APS_NEXT_SYMED_VALUE           101
00021 #endif
00022 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

INDEXINFO Member List

This is the complete list of members for INDEXINFO, including all inherited members.
dwCollation | INDEXINFO
dwFillFactor | INDEXINFO
dwInitialSize | INDEXINFO
dwNullCollation | INDEXINFO
dwNulls | INDEXINFO
fAutoUpdate | INDEXINFO
fClustered | INDEXINFO
fIsPrimaryKey | INDEXINFO
fSortBookmarks | INDEXINFO
fUnique | INDEXINFO
iOrdinal | INDEXINFO
wszColName | INDEXINFO
wszIndexName | INDEXINFO
wType | INDEXINFO
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/Snd/StdAfx.Cpp Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • Snd

StdAfx.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 #include "stdafx.h"
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDlgIDirectorySearch Member List

This is the complete list of members for CDlgIDirectorySearch, including all inherited members.
CDlgIDirectorySearch(LPUNKNOWN pUnk, CWnd *pParent=NULL) | CDlgIDirectorySearch |
DoDataExchange(CDataExchange *pDX) | CDlgIDirectorySearch | [protected, virtual]
IDD enum value | CDlgIDirectorySearch |
m_bAsynch | CDlgIDirectorySearch |
m_bAttrib | CDlgIDirectorySearch |
m_bCacheResult | CDlgIDirectorySearch |
m_bEnableFilter | CDlgIDirectorySearch |
m_CADsSearchScope | CDlgIDirectorySearch |
m_cAttrList | CDlgIDirectorySearch |
m_cCacheResult | CDlgIDirectorySearch |
m_cChaseReferrals | CDlgIDirectorySearch |
m_cEnableFilter | CDlgIDirectorySearch |
m_cExecute | CDlgIDirectorySearch |
m_cFilter | CDlgIDirectorySearch |
m_cListView | CDlgIDirectorySearch |
m_nDeref | CDlgIDirectorySearch |
m_nPageSize | CDlgIDirectorySearch |
m_nSizeLimit | CDlgIDirectorySearch |
m_nTimeLimit | CDlgIDirectorySearch |
m_nTimeOut | CDlgIDirectorySearch |
m_pSearch | CDlgIDirectorySearch | [protected]
m_sFilter | CDlgIDirectorySearch |
m_sSortOn | CDlgIDirectorySearch |
OnChangeFilter() | CDlgIDirectorySearch | [protected]
OnDblClickListView(NMHDR *pNMHDR, LRESULT *pResult) | CDlgIDirectorySearch | [protected]
OnEnabled() | CDlgIDirectorySearch | [protected]
OnExecute() | CDlgIDirectorySearch | [protected]
OnInitDialog() | CDlgIDirectorySearch | [protected, virtual]
OnOK() | CDlgIDirectorySearch | [protected, virtual]
~CDlgIDirectorySearch() | CDlgIDirectorySearch |
Generated on Wed Nov 13 2024 16:56:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/globals.h Source File

  • SysMgmt
  • MMC
  • Extens

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025   #define IDM_BUTTON1    0x100
00026   #define IDM_BUTTON2    0x101
00027
00028   extern HINSTANCE g_hinst;
00029   extern ULONG g_uObjects;
00030
00031   #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032   #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034   // uncomment the following #define to enable message cracking
00035   // #define MMC_CRACK_MESSAGES
00036   void MMCN_Crack(BOOL bComponentData,
00037           IDataObject *pDataObject,
00038           IComponentData *pCompData,
00039           IComponent *pComp,
00040           MMC_NOTIFY_TYPE event,
00041           LPARAM arg,
00042           LPARAM param);
00043 #endif
00044
00045 //=--------------------------------------------------------------------------=
00046 // allocates a temporary buffer that will disappear when it goes out of scope
00047 // NOTE: be careful of that -- make sure you use the string in the same or
00048 // nested scope in which you created this buffer. people should not use this
00049 // class directly.  use the macro(s) below.
00050 //
00051 class TempBuffer {
00052   public:
00053     TempBuffer(ULONG cBytes) {
00054         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00055         m_fHeapAlloc = (cBytes > 120);
00056     }
00057     ~TempBuffer() {
00058         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00059     }
00060     void *GetBuffer() {
00061         return m_pBuf;
00062     }
00063
00064   private:
00065     void *m_pBuf;
00066     // we'll use this temp buffer for small cases.
00067     //
00068     char  m_szTmpBuf[120];
00069     unsigned m_fHeapAlloc:1;
00070 };
00071
00072 //=--------------------------------------------------------------------------=
00073 // string helpers.
00074 //
00075 // given a _TCHAR, copy it into a wide buffer.
00076 // be careful about scoping when using this macro!
00077 //
00078 // how to use the below two macros:
00079 //
00080 //  ...
00081 //  LPTSTR pszT;
00082 //  pszT = MyGetTStringRoutine();
00083 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00084 //  MyUseWideStringRoutine(pwsz);
00085 //  ...
00086 #ifdef UNICODE
00087 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00088     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00089     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00090     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00091     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00092 #else // ANSI
00093 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00094     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00095     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00096     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00097     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00098     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00099 #endif
00100
00101 #ifdef UNICODE
00102 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00103     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00104     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00105     lstrcpyW((LPWSTR)ptrname, tstr)
00106 #else // ANSI
00107 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00108     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00109     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00110     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00111     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00112 #endif
00113
00114 //
00115 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00116 // have to be declared, and no clean up must be done.
00117 //
00118 // * 2 for DBCS handling in below length computation
00119 //
00120 #ifdef UNICODE
00121 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00122     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00123     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00124     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00125     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00126 #else // ANSI
00127 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00128     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00129     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00130     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00131     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00132 #endif
00133
00134 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/Dt_Dll.h Source File

  • NetDS
  • WinSock
  • Dt_Dll

Dt_Dll.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1995 Intel Corp
00004
00005 File Name:
00006
00007     dt_dll.h
00008
00009 Abstract:
00010
00011     This header describes the interface to the WinSock 2 debug/trace
00012     DLL.  Please see the design spec for more information.
00013
00014 -*/
00015
00016 #ifndef _DT_DLL_H
00017 #define _DT_DLL_H
00018
00019 #include "nowarn.h"
00020 #include <winsock2.h>
00021
00022
00023 //
00024 // This type defines a pointer to the Pre/PostApiNotify functions
00025 //
00026
00027 typedef BOOL (WINAPIV * LPFNWSANOTIFY)(
00028     IN  INT    NotificationCode,
00029     OUT LPVOID ReturnCode,
00030     IN  LPSTR  LibraryName,
00031     ...);
00032
00033 //
00034 // Function prototypes for Pre/PostApiNotify
00035 //
00036
00037 BOOL WINAPIV
00038 WSAPreApiNotify(
00039     IN  INT    NotificationCode,
00040     OUT LPVOID ReturnCode,
00041     IN  LPSTR  LibraryName,
00042     ...);
00043
00044 BOOL WINAPIV
00045 WSAPostApiNotify(
00046     IN  INT    NotificationCode,
00047     OUT LPVOID ReturnCode,
00048     IN  LPSTR  LibraryName,
00049     ...);
00050
00051 //
00052 // Pointer to an exception notification function.
00053 //
00054
00055 typedef
00056 VOID
00057 (WINAPI * LPFNWSAEXCEPTIONNOTIFY)(
00058     IN LPEXCEPTION_POINTERS ExceptionPointers
00059     );
00060
00061 //
00062 // Function prototype for exception notify.
00063 //
00064
00065 VOID
00066 WINAPI
00067 WSAExceptionNotify(
00068     IN LPEXCEPTION_POINTERS ExceptionPointers
00069     );
00070
00071
00072 //
00073 // API function codes for Pre/PostApiNotify functions.  Note:  These must start
00074 // at  1  or more and be fairly densely assigned.  Small gaps can be tolerated.
00075 // Note  that  a  "MAX_DTCODE"  definition  should  be updated if new codes are
00076 // added.
00077 //
00078
00079 #define DTCODE_accept 1
00080 #define DTCODE_bind 2
00081 #define DTCODE_closesocket 3
00082 #define DTCODE_connect 4
00083 #define DTCODE_getpeername 5
00084 #define DTCODE_getsockname 6
00085 #define DTCODE_getsockopt 7
00086 #define DTCODE_htonl 8
00087 #define DTCODE_htons 9
00088 #define DTCODE_ioctlsocket 10
00089 #define DTCODE_listen 11
00090 #define DTCODE_ntohl 12
00091 #define DTCODE_ntohs 13
00092 #define DTCODE_recv 14
00093 #define DTCODE_recvfrom 15
00094 #define DTCODE_select 16
00095 #define DTCODE_send 17
00096 #define DTCODE_sendto 18
00097 #define DTCODE_setsockopt 19
00098 #define DTCODE_shutdown 20
00099 #define DTCODE_socket 21
00100 #define DTCODE_WSAAccept 22
00101 #define DTCODE_WSAAsyncSelect 23
00102 #define DTCODE_WSACancelBlockingCall 24
00103 #define DTCODE_WSACleanup 25
00104 #define DTCODE_WSACloseEvent 26
00105 #define DTCODE_WSAConnect 27
00106 #define DTCODE_WSACreateEvent 28
00107 #define DTCODE_WSADuplicateSocketA 29
00108 #define DTCODE_WSAEnumNetworkEvents 30
00109 #define DTCODE_WSAEnumProtocolsA 31
00110 #define DTCODE_WSAEventSelect 32
00111 #define DTCODE_WSAGetLastError 33
00112 #define DTCODE_WSAGetOverlappedResult 34
00113 #define DTCODE_WSAGetQOSByName 35
00114 #define DTCODE_WSAHtonl 36
00115 #define DTCODE_WSAHtons 37
00116 #define DTCODE_WSAIoctl 38
00117 #define DTCODE_WSAIsBlocking 39
00118 #define DTCODE_WSAJoinLeaf 40
00119 #define DTCODE_WSANtohl 41
00120 #define DTCODE_WSANtohs 42
00121 #define DTCODE_WSARecv 43
00122 #define DTCODE_WSARecvDisconnect 44
00123 #define DTCODE_WSARecvFrom 45
00124 #define DTCODE_WSAResetEvent 46
00125 #define DTCODE_WSASend 47
00126 #define DTCODE_WSASendDisconnect 48
00127 #define DTCODE_WSASendTo 49
00128 #define DTCODE_WSASetBlockingHook 50
00129 #define DTCODE_WSASetEvent 51
00130 #define DTCODE_WSASetLastError 52
00131 #define DTCODE_WSASocketA 53
00132 #define DTCODE_WSAStartup 54
00133 #define DTCODE_WSAUnhookBlockingHook 55
00134 #define DTCODE_WSAWaitForMultipleEvents 56
00135 #define DTCODE_gethostbyaddr 57
00136 #define DTCODE_gethostbyname 58
00137 #define DTCODE_gethostname 59
00138 #define DTCODE_getprotobyname 60
00139 #define DTCODE_getprotobynumber 61
00140 #define DTCODE_getservbyname 62
00141 #define DTCODE_getservbyport 63
00142 #define DTCODE_inet_addr 64
00143 #define DTCODE_inet_ntoa 65
00144 #define DTCODE_WSAAsyncGetHostByAddr 66
00145 #define DTCODE_WSAAsyncGetHostByName 67
00146 #define DTCODE_WSAAsyncGetProtoByName 68
00147 #define DTCODE_WSAAsyncGetProtoByNumber 69
00148 #define DTCODE_WSAAsyncGetServByName 70
00149 #define DTCODE_WSAAsyncGetServByPort 71
00150 #define DTCODE_WSACancelAsyncRequest 72
00151 #define DTCODE_WSPAccept 73
00152 #define DTCODE_WSPAsyncSelect 74
00153 #define DTCODE_WSPBind 75
00154 #define DTCODE_WSPCancelBlockingCall 76
00155 #define DTCODE_WSPCleanup 77
00156 #define DTCODE_WSPCloseSocket 78
00157 #define DTCODE_WSPConnect 79
00158 #define DTCODE_WSPDuplicateSocket 80
00159 #define DTCODE_WSPEnumNetworkEvents 81
00160 #define DTCODE_WSPEventSelect 82
00161 #define DTCODE_WSPGetOverlappedResult 83
00162 #define DTCODE_WSPGetPeerName 84
00163 // The  WSPGetProcTable  function  has  been removed, but the code numbers have
00164 // been kept the same.
00165 // #define DTCODE_WSPGetProcTable 85
00166 #define DTCODE_WSPGetSockName 86
00167 #define DTCODE_WSPGetSockOpt 87
00168 #define DTCODE_WSPGetQOSByName 88
00169 #define DTCODE_WSPIoctl 89
00170 #define DTCODE_WSPJoinLeaf 90
00171 #define DTCODE_WSPListen 91
00172 #define DTCODE_WSPRecv 92
00173 #define DTCODE_WSPRecvDisconnect 93
00174 #define DTCODE_WSPRecvFrom 94
00175 #define DTCODE_WSPSelect 95
00176 #define DTCODE_WSPSend 96
00177 #define DTCODE_WSPSendDisconnect 97
00178 #define DTCODE_WSPSendTo 98
00179 #define DTCODE_WSPSetSockOpt 99
00180 #define DTCODE_WSPShutdown 100
00181 #define DTCODE_WSPSocket 101
00182 #define DTCODE_WSPStartup 102
00183 #define DTCODE_WPUCloseEvent 103
00184 #define DTCODE_WPUCloseSocketHandle 104
00185 #define DTCODE_WPUCreateEvent 105
00186 #define DTCODE_WPUCreateSocketHandle 106
00187 #define DTCODE_WSCDeinstallProvider 107
00188 #define DTCODE_WSCInstallProvider 108
00189 #define DTCODE_WPUModifyIFSHandle 109
00190 #define DTCODE_WPUQueryBlockingCallback 110
00191 #define DTCODE_WPUQuerySocketHandleContext 111
00192 #define DTCODE_WPUQueueApc 112
00193 #define DTCODE_WPUResetEvent 113
00194 #define DTCODE_WPUSetEvent 114
00195 #define DTCODE_WSCEnumProtocols 115
00196 #define DTCODE_WPUGetProviderPath 116
00197 #define DTCODE_WPUPostMessage 117
00198 #define DTCODE_WPUFDIsSet 118
00199 #define DTCODE_WSADuplicateSocketW 119
00200 #define DTCODE_WSAEnumProtocolsW 120
00201 #define DTCODE_WSASocketW 121
00202 #define DTCODE___WSAFDIsSet 122
00203 #define DTCODE_WSAAddressToStringA 123
00204 #define DTCODE_WSAAddressToStringW 124
00205 #define DTCODE_WSAStringToAddressA 125
00206 #define DTCODE_WSAStringToAddressW 126
00207 #define DTCODE_WSALookupServiceBeginA 127
00208 #define DTCODE_WSALookupServiceBeginW 128
00209 #define DTCODE_WSALookupServiceNextA 129
00210 #define DTCODE_WSALookupServiceNextW 130
00211 #define DTCODE_WSALookupServiceEnd 131
00212 //
00213 // WSAGetAddressByName[AW] have been removed.
00214 //
00215 // #define DTCODE_WSAGetAddressByNameA 132
00216 // #define DTCODE_WSAGetAddressByNameW 133
00217 #define DTCODE_WSAInstallServiceClassA 134
00218 #define DTCODE_WSAInstallServiceClassW 135
00219 #define DTCODE_WSASetServiceA 136
00220 #define DTCODE_WSASetServiceW 137
00221 #define DTCODE_WSARemoveServiceClass 138
00222 #define DTCODE_WSAGetServiceClassInfoA 139
00223 #define DTCODE_WSAGetServiceClassInfoW 140
00224 #define DTCODE_WSAEnumNameSpaceProvidersA 141
00225 #define DTCODE_WSAEnumNameSpaceProvidersW 142
00226 #define DTCODE_WSAGetServiceClassNameByClassIdA 143
00227 #define DTCODE_WSAGetServiceClassNameByClassIdW 144
00228 #define DTCODE_NSPAddressToString 145
00229 #define DTCODE_NSPStringToAddress 146
00230 #define DTCODE_NSPLookupServiceBegin 147
00231 #define DTCODE_NSPLookupServiceNext 148
00232 #define DTCODE_NSPLookupServiceEnd 149
00233 #define DTCODE_NSPGetAddressByName 150
00234 #define DTCODE_NSPInstallServiceClass 151
00235 #define DTCODE_NSPSetService 152
00236 #define DTCODE_NSPRemoveServiceClass 153
00237 #define DTCODE_NSPGetServiceClassInfo 154
00238 #define DTCODE_NSPEnumNameSpaceProviders 155
00239 #define DTCODE_NSPGetServiceClassNameByClassId 156
00240 #define DTCODE_WSCGetProviderPath 157
00241 #define DTCODE_WSCInstallNameSpace 158
00242 #define DTCODE_WSCUnInstallNameSpace 159
00243 #define DTCODE_WSCEnableNSProvider 160
00244 #define DTCODE_WSPAddressToString 161
00245 #define DTCODE_WSPStringToAddress 162
00246
00247 #define MAX_DTCODE DTCODE_WSPStringToAddress
00248
00249 #endif
00250
00251 
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/WorkerThread/WorkerThread.c Source File

  • Web
  • iis
  • extensions
  • WorkerThread

WorkerThread.c

Go to the documentation of this file.
00001 /* Copyright (c) 1997-2002  Microsoft Corporation
00002
00003   Module Name:
00004
00005     WorkerThread.c
00006
00007   Abstract:
00008
00009     IIS maintains a pool of threads to handle incoming HTTP requests.  When all of
00010     these threads are in use, new requests will be rejected.  If all the pool threads
00011     are in a wait state (for instance, running ISAPI dlls that are waiting for a query
00012     on a remote database to complete), IIS may reject incoming requests even if there
00013     is plenty of CPU power to handle them.
00014
00015     One way of avoiding this situation is to offload processing of these types of
00016     requests to a worker thread, releasing the IIS thread back to the pool so that it
00017     can be used for another request.  This basic sample demonstrates how to implement
00018     this in an ISAPI dll.
00019 */
00020
00021 #define WIN32_LEAN_AND_MEAN
00022 #include <windows.h>
00023 #include <httpext.h>
00024 #include <stdio.h>
00025
00026 /* global variables */
00027
00028 DWORD g_dwThreadCount = 0;
00029
00030 /* local functions prototypes */
00031
00032 DWORD WINAPI WorkerFunction(LPVOID);
00033
00034 BOOL SendHttpHeaders(EXTENSION_CONTROL_BLOCK *, LPCSTR , LPCSTR, BOOL);
00035
00036 /*
00037   Purpose:
00038
00039     This is required ISAPI Extension DLL entry point.
00040
00041   Arguments:
00042
00043     pVer - poins to extension version info structure
00044
00045   Returns:
00046
00047     always returns TRUE
00048 */
00049
00050 BOOL WINAPI GetExtensionVersion(OUT HSE_VERSION_INFO *pVer)
00051 {
00052   /* tell the server our version number and extension description */
00053
00054   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00055
00056   lstrcpyn(pVer->lpszExtensionDesc, "ISAPI Worker Thread Extension Sample", HSE_MAX_EXT_DLL_NAME_LEN - 1);
00057
00058   return TRUE;
00059 }
00060
00061 /*
00062   Purpose:
00063
00064     Create a thread to handle extended processing. It will be passed
00065     the address of a function ("WorkerFunction") to run, and the address
00066     of the ECB associated with this session.
00067
00068   Arguments:
00069
00070     pECB - pointer to the extenstion control block
00071
00072   Returns:
00073
00074     HSE_STATUS_PENDING to mark this request as pending
00075 */
00076
00077 DWORD WINAPI HttpExtensionProc(IN EXTENSION_CONTROL_BLOCK *pECB)
00078 {
00079   DWORD dwThreadID;
00080
00081   /* NOTE: in production environment you'd probably want to limit the number of threads created */
00082
00083   CreateThread( NULL,              // Pointer to thread security attributes
00084                 0,                 // Initial thread stack size, in bytes
00085                 WorkerFunction,    // Pointer to thread function
00086                 pECB,              // The ECB is the argument for the new thread
00087                 0,                 // Creation flags
00088                 &dwThreadID);      // Pointer to returned thread identifier
00089
00090   /* update global thread count */
00091
00092   InterlockedIncrement(&g_dwThreadCount);
00093
00094   /* Return HSE_STATUS_PENDING to release IIS pool thread without losing connection */
00095
00096   return HSE_STATUS_PENDING;
00097 }
00098
00099 /*
00100   Purpose:
00101
00102     Show how to perform extended processing in ISAPI DLL without tying IIS threads.
00103
00104   Arguments:
00105
00106     vECB - points to current extension control block
00107
00108   Returns:
00109
00110     returns 0
00111 */
00112
00113 DWORD WINAPI WorkerFunction(IN LPVOID vECB)
00114 {
00115   char szHeader[] = "Content-type: text/html\r\n\r\n";
00116   char szContent[] = "<html> <form method=get action=WorkerThread.dll><h1>Worker Thread Sample</h1><hr>"
00117                      "<input type=submit value=\"Send Request\"> </form></html>";
00118
00119   /* Initialize local ECB pointer to void pointer passed to thread */
00120
00121   EXTENSION_CONTROL_BLOCK *pECB = vECB;
00122
00123   DWORD dwSize = strlen(szContent);
00124
00125   /* Send outgoing header */
00126
00127   SendHttpHeaders(pECB, "200 OK", szHeader, FALSE);
00128
00129   /* Simulate extended processing for 5 seconds */
00130
00131   Sleep(5000);
00132
00133   /* Send content */
00134
00135   pECB->WriteClient(pECB->ConnID, szContent, &dwSize, 0);
00136
00137   /* Inform server that the request has been satisfied, and the connection may now be dropped */
00138
00139   pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_DONE_WITH_SESSION, NULL, NULL, NULL);
00140
00141   /* update global thread count */
00142
00143   InterlockedDecrement(&g_dwThreadCount);
00144
00145   return 0;
00146 }
00147
00148 /*
00149   Purpose:
00150
00151     Send specified HTTP status string and any additional header strings
00152     using new ServerSupportFunction() request HSE_SEND_HEADER_EX_INFO
00153
00154   Arguments:
00155
00156     pECB - pointer to the extension control block
00157     pszStatus - HTTP status string (e.g. "200 OK")
00158     pszHeaders - any additional headers, separated by CRLFs and
00159                 terminated by empty line
00160
00161   Returns:
00162
00163     TRUE if headers were successfully sent
00164     FALSE otherwise
00165 */
00166
00167 BOOL SendHttpHeaders(EXTENSION_CONTROL_BLOCK *pECB, LPCSTR pszStatus, LPCSTR pszHeaders, BOOL fKeepConnection)
00168 {
00169   HSE_SEND_HEADER_EX_INFO header_ex_info;
00170
00171   BOOL success;
00172
00173   header_ex_info.pszStatus = pszStatus;
00174   header_ex_info.pszHeader = pszHeaders;
00175   header_ex_info.cchStatus = strlen(pszStatus);
00176   header_ex_info.cchHeader = strlen(pszHeaders);
00177   header_ex_info.fKeepConn = fKeepConnection;
00178
00179   success = pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_ex_info, NULL, NULL);
00180
00181   return success;
00182 }
00183
00184 /*
00185   Routine Description:
00186
00187     This function is called when the WWW service is shutdown.
00188
00189   Arguments:
00190
00191     dwFlags - HSE_TERM_ADVISORY_UNLOAD or HSE_TERM_MUST_UNLOAD
00192
00193   Return Value:
00194
00195     TRUE when extension is ready to be unloaded,
00196 */
00197
00198 BOOL WINAPI TerminateExtension(IN DWORD dwFlags)
00199 {
00200   /* Our threads are deterministic and will complete not much later than 5 seconds from now */
00201
00202   /* wait for all threads to terminate, sleeping for 1 sec */
00203
00204   while (g_dwThreadCount > 0)
00205     SleepEx(1000, FALSE);
00206
00207   /* make sure the last thread indeed exited */
00208
00209   SleepEx(1000, FALSE);
00210
00211   return TRUE;
00212 }
00213
00214
00215
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/cft.cpp Source File

  • Web
  • NetMeeting
  • NMUI

cft.cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CCFT.CPP
00004 //  Content:    INmFt Routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018 INmFt       * g_pFt         = NULL;
00019 INmChannelFt    * g_pChannelFt      = NULL;
00020 CFileTransferNotify * g_pNotifyFileTransfer = NULL;
00021
00022 //****************************************************************************
00023 //
00024 // HRESULT HookFileTransfer(INmChannel * pChannel)
00025 //
00026 // Hook into notification callback for the file transfer channel
00027 //
00028 //****************************************************************************
00029
00030 HRESULT HookFileTransfer(INmChannel * pChannel)
00031 {
00032   HRESULT         hr    = NO_ERROR  ;
00033   CFileTransferNotify * pNotify = NULL    ;
00034
00035   ASSERT(NULL != pChannel);
00036   if  (NULL == pChannel)
00037   {
00038     ERROR_MSG(TEXT("HookFileTransfer passed a Null Pointer"));
00039     return E_POINTER;
00040   }
00041
00042   if  (NULL != g_pChannelFt)
00043   {
00044     ERROR_MSG(TEXT("HookFileTransfer: replacing existing g_pChannelFileTransfer"));
00045   }
00046
00047   hr = pChannel->QueryInterface(IID_INmChannelFt, (void **)&g_pChannelFt);
00048   if  FAILED(hr)
00049   {
00050     ERROR_MSG(TEXT("HookFileTransfer:Unable to get File Transfer channel"));
00051     return hr;
00052   }
00053
00054   if  (NULL == g_pChannelFt)
00055   {
00056     ERROR_MSG(TEXT("HookFileTransfer:QI returned a Null Pointer"));
00057     return E_FAIL;
00058   }
00059
00060   // Connect to the Ft object
00061   pNotify = new CFileTransferNotify();
00062   if(NULL == pNotify)
00063   {
00064     hr = E_OUTOFMEMORY;
00065   }
00066   else
00067   {
00068     hr = pNotify->Connect(g_pChannelFt);
00069     if(FAILED(hr))
00070     {
00071       ERROR_MSG(TEXT("CFileTransferNotify Failed (%s)"), GetHrSz(hr));
00072       pNotify->Release();
00073     }
00074     else
00075     {
00076       OBJECT_MSG(TEXT("FileTransfer Connection point established successfully"));
00077       g_pNotifyFileTransfer = pNotify;
00078     }
00079   }
00080
00081   if(FAILED(hr))
00082   {
00083     g_pChannelFt->Release();
00084     g_pChannelFt = NULL;
00085   }
00086
00087   return hr;
00088 }
00089
00090
00091
00092 //****************************************************************************
00093 //
00094 // CLASS CFileTransferNotify
00095 //
00096 //****************************************************************************
00097
00098 CFileTransferNotify::CFileTransferNotify() : RefCount(), CNotify()
00099 {
00100   OBJECT_MSG(TEXT("CFileTransferNotify created"));
00101 }
00102
00103 CFileTransferNotify::~CFileTransferNotify()
00104 {
00105   OBJECT_MSG(TEXT("CFileTransferNotify destroyed"));
00106 }
00107
00108
00109 //****************************************************************************
00110 //
00111 // Methods from IUnknown
00112 //
00113 //****************************************************************************
00114
00115 ULONG STDMETHODCALLTYPE CFileTransferNotify::AddRef(void)
00116 {
00117   return RefCount::AddRef();
00118 }
00119
00120
00121 ULONG STDMETHODCALLTYPE CFileTransferNotify::Release(void)
00122 {
00123   return RefCount::Release();
00124 }
00125
00126 HRESULT STDMETHODCALLTYPE CFileTransferNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00127 {
00128   if  (NULL == ppvObject)
00129     return E_POINTER;
00130
00131   HRESULT hr = NO_ERROR;
00132
00133   if (riid == IID_IUnknown)
00134   {
00135     *ppvObject = (IUnknown *)this;
00136     OBJECT_MSG(TEXT("CFileTransferNotify::QueryInterface(): Returning IUnknown."));
00137   }
00138   else if (riid == IID_INmChannelFtNotify)
00139   {
00140     *ppvObject = (INmChannelNotify *)this;
00141     OBJECT_MSG(TEXT("CChannelFtNotify::QueryInterface(): Returning INmChannelFtNotify."));
00142   }
00143   else
00144   {
00145     hr = E_NOINTERFACE;
00146     *ppvObject = NULL;
00147     OBJECT_MSG(TEXT("CFileTransferNotify::QueryInterface(): Called on unknown interface."));
00148   }
00149
00150   if SUCCEEDED(hr)
00151   {
00152     AddRef();
00153   }
00154
00155   return hr;
00156 }
00157
00158
00159 //****************************************************************************
00160 //
00161 // Methods from ICNotify
00162 //
00163 //****************************************************************************
00164
00165 HRESULT STDMETHODCALLTYPE CFileTransferNotify::Connect(IUnknown *pUnk)
00166 {
00167   return CNotify::Connect(pUnk, IID_INmChannelFtNotify, (IUnknown *)this);
00168 }
00169
00170 HRESULT STDMETHODCALLTYPE CFileTransferNotify::Disconnect(void)
00171 {
00172   return CNotify::Disconnect();
00173 }
00174
00175
00176 //****************************************************************************
00177 //
00178 // Methods from IConfNotify
00179 //
00180 //****************************************************************************
00181
00182 HRESULT STDMETHODCALLTYPE CFileTransferNotify::NmUI(CONFN uNotify)
00183 {
00184   NOTIFY_MSG(TEXT("CFileTransferNotify::NmUI uNotify=%08X, pChannel=%08X"), uNotify, CNotify::GetPunk());
00185   return S_OK;
00186 }
00187
00188
00189 HRESULT STDMETHODCALLTYPE CFileTransferNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00190 {
00191   NOTIFY_MSG(TEXT("CFileTransferNotify::MemberChanged uNotify=%d pMember=%08X, pChannel=%08X"), uNotify, pMember, CNotify::GetPunk());
00192
00193   return S_OK;
00194 }
00195
00196 HRESULT STDMETHODCALLTYPE CFileTransferNotify::FtUpdate(CONFN uNotify, INmFt *pFt)
00197 {
00198   if  (NULL == pFt)
00199   {
00200     ERROR_MSG(TEXT("FtUpdate: NULL == pFt"));
00201     return E_POINTER;
00202   }
00203
00204   ULONG     ulBytes = 0     ;
00205   INmMember * pMember = NULL    ;
00206   BSTR      bstrName  = NULL    ;
00207   LPTSTR      psz   = NULL    ;
00208   HRESULT     hr    = NO_ERROR  ;
00209
00210   TCHAR sz[MAX_PATH + 1];
00211
00212   hr = pFt->GetBytesTransferred(&ulBytes);
00213   if(FAILED(hr))
00214   {
00215     ERROR_MSG(TEXT("GetBytes Failed hr=%s"), GetHrSz(hr));
00216   }
00217
00218   // get the Member object of the sender
00219   hr = pFt->GetMember(&pMember);
00220   if(FAILED(hr))
00221   {
00222     ERROR_MSG(TEXT("GetMember Failed hr=%s"), GetHrSz(hr));
00223     return hr;
00224   }
00225
00226   NM_FT_STATE uState;
00227   pFt->GetState(&uState);
00228
00229   if(NULL == pMember)
00230   {
00231     ZeroMemory(sz, (MAX_PATH + 1) * sizeof(TCHAR));
00232
00233     // file being sent to all members of the conference
00234     _tcsncpy(sz, TEXT("BROADCAST\0"), MAX_PATH);
00235
00236   NOTIFY_MSG(TEXT("CFileTransferNotify::FtUpdate uNotify=%s, State = %d, pFt=%08X, bytes=%d from %s\0"),
00237       GetConfnSz(uNotify), uState, pFt, ulBytes, sz);
00238
00239   }
00240   else
00241   {
00242     hr = pMember->GetName(&bstrName);
00243     if(FAILED(hr))
00244     {
00245       ERROR_MSG(TEXT("GetName Failed hr=%s"), GetHrSz(hr));
00246     }
00247
00248     psz = PszFromBstr(bstrName);
00249
00250     SysFreeString(bstrName);
00251     pMember->Release();
00252
00253     if  (NULL == psz)
00254     {
00255       ERROR_MSG(TEXT("FtUpdate: NULL == psz"));
00256       return E_FAIL;
00257     }
00258
00259   NOTIFY_MSG(TEXT("CFileTransferNotify::FtUpdate uNotify=%s, State = %d, pFt=%08X, bytes=%d from %s"),
00260       GetConfnSz(uNotify), uState, pFt, ulBytes, psz);
00261
00262     FreePlpv(&psz);
00263
00264   }
00265
00266   return S_OK;
00267 }
00268
00269
00270 //****************************************************************************
00271 //
00272 // VOID DoFtCancel(void)
00273 //
00274 //****************************************************************************
00275
00276 VOID DoFtCancel(void)
00277 {
00278   if (NULL == g_pFt)
00279     return;
00280
00281   HRESULT hr = g_pFt->Cancel();
00282 }
00283
00284
00285 //****************************************************************************
00286 //
00287 // VOID FreeFt(void)
00288 //
00289 //****************************************************************************
00290
00291 VOID FreeFt(void)
00292 {
00293   if (NULL != g_pFt)
00294   {
00295     g_pFt->Release();
00296     g_pFt = NULL;
00297   }
00298 }
00299
00300
00301
00302
00303 //****************************************************************************
00304 //
00305 // VOID SendFile(INmMember * pINmMember)
00306 //
00307 //****************************************************************************
00308
00309 VOID SendFile(INmMember * pINmMember)
00310 {
00311   PUSER pUser = PUserLocal();
00312   if (NULL == pUser)
00313   {
00314     return;
00315   }
00316
00317   if (NULL == pUser->m_pChannelFt)
00318   {
00319     return;
00320   }
00321
00322   BSTRING   bstrFileName(gPref.pszFileName);
00323   if  ((NULL == bstrFileName.GetLPBSTR()) && (NULL != gPref.pszFileName))
00324     return;
00325
00326   INmFt * pFt = NULL;
00327   HRESULT   hr  = pUser->m_pChannelFt->SendFile(&pFt, pINmMember, bstrFileName, 0);
00328
00329   if (SUCCEEDED(hr))
00330   {
00331     if  (NULL == pFt)
00332     {
00333       ERROR_MSG(TEXT("SendFile: NULL == pFt"));
00334       return;
00335     }
00336
00337     INmMember * pMember = NULL;
00338
00339     FreeFt();
00340     g_pFt = pFt;
00341
00342     hr = pFt->GetMember( &pMember );
00343     if(SUCCEEDED(hr))
00344     {
00345       if(NULL == pMember)
00346       {
00347         // file was sent to everyone
00348       }
00349       else
00350       {
00351         BSTR bstrName = NULL;
00352
00353         // file was sent to this user
00354         hr = pMember->GetName(&bstrName);
00355         if  (NULL != bstrName)
00356         {
00357           ::SysFreeString(bstrName);
00358         }
00359
00360         pMember->Release();
00361       }
00362     }
00363   }
00364 }
00365
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SockAuth/Comm.h Source File

  • Security
  • SSPI
  • SockAuth

Comm.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 Module Name:
00006
00007     comm.h
00008
00009 Abstract:
00010
00011     Some common functions for sockets
00012
00013 Revision History:
00014
00015 --*/
00016
00017 BOOL InitWinsock ();
00018 BOOL TermWinsock ();
00019 BOOL SendMsg (SOCKET s, PBYTE pBuf, DWORD cbBuf);
00020 BOOL ReceiveMsg (SOCKET s, PBYTE pBuf, DWORD cbBuf, DWORD *pcbRead);
00021 BOOL SendBytes (SOCKET s, PBYTE pBuf, DWORD cbBuf);
00022 BOOL ReceiveBytes (SOCKET s, PBYTE pBuf, DWORD cbBuf, DWORD *pcbRead);
00023
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyEvictListener/resource.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyEvictListener

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by MyEvictListener.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_MYEVICTLISTENER             101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/RSM/app/app.cpp Source File

  • WinBase
  • IO
  • RSM
  • app

app.cpp

Go to the documentation of this file.
00001 /*
00002  *  This is a part of the Microsoft Source Code Samples.
00003  *  Copyright 1996 - 1998 Microsoft Corporation.
00004  *  All rights reserved.
00005  *
00006  *  This sample code shows the usage of some portions
00007  *  of the RSM API.
00008  *
00009  *  Return codes are, for the most part, not checked in
00010  *  this code. See the Programmer's reference for error
00011  *  return information.
00012  *
00013  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00014  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00015  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00016  * PARTICULAR PURPOSE.
00017  *
00018  * Copyright 1997 - 1998 Microsoft Corporation.  All Rights Reserved. *
00019  */
00020 #define _UNICODE
00021 #define UNICODE
00022 #include <stdio.h>
00023 #include <windows.h>
00024 #include <strsafe.h>
00025 #include <NtmsApi.h>
00026 #include "..\inc\stl.h"
00027
00028 #define NO_CONTAINER  NULL
00029 #define SIZE_FOR_FIRST_TRY  5
00030 #define NULL_PARTID ((LPNTMS_NULLGUID)0)
00031 #define ALLOCATE_WAIT 0
00032 #define MOUNT_WAIT  INFINITE
00033 #define REQUESTING_ONE_MOUNT  1
00034 #define REQUESTING_ONE_DISMOUNT REQUESTING_ONE_MOUNT
00035 #define LABEL_BUFFER_SIZE 1024
00036
00037 #define ADD_ACE_MASK_BITS 1
00038 #define REMOVE_ACE_MASK_BITS 2
00039 #define DELETE_ACE 3
00040
00041 void writeOmid(HANDLE, STL_LABEL *);
00042 void persistPoolID(NTMS_GUID);
00043 NTMS_GUID recallPoolID();
00044 void persistMediaID(NTMS_GUID);
00045 NTMS_GUID recallMediaID();
00046
00047   bool
00048 OpenSessionWithWait(HANDLE &hSession, LPWSTR AppName, DWORD &dwRetCode)
00049 {
00050
00051   for(DWORD i=0; i< 150; ++i)
00052   {
00053     // Start an RSM session
00054     hSession = OpenNtmsSession(L"", AppName, 0);
00055     if(hSession == INVALID_HANDLE_VALUE)
00056     {
00057       // If RSM isn't up yet it will return ERROR_BUSY,
00058       // which is a transient state so retry until either
00059       // a handle is returned, some other error occurs or
00060       // we've waited long enough
00061       dwRetCode = GetLastError();
00062       if(dwRetCode != ERROR_BUSY)
00063         return(false);
00064     }
00065     else
00066       return(true);
00067
00068     Sleep(500);
00069   }
00070
00071   return(false);
00072 }
00073
00074
00075   void
00076 SetNullGuid(NTMS_GUID *g)
00077 {
00078   memset(g, 0, sizeof(NTMS_GUID));
00079 }
00080
00081
00082 // Go through the DACL on the media pool and add or remove  permissions
00083   DWORD
00084 SetPoolDACL(HANDLE hSession, NTMS_GUID &gMediaPool, DWORD dwSubAuthority,
00085       DWORD dwAction, DWORD dwMask)
00086 {
00087   PSID psidAccount;
00088   PSECURITY_DESCRIPTOR psdRePoolSd;
00089   SID_IDENTIFIER_AUTHORITY ntauth = SECURITY_NT_AUTHORITY;
00090   DWORD dwRetCode, dwSizeTry, dwSizeReturned;
00091   PACL paclDis;
00092   BOOL OK;
00093   DWORD i;
00094   ACCESS_ALLOWED_ACE *pAce;
00095   BOOL bDaclPresent, bDaclDefaulted;
00096
00097
00098   // Get a SID for the well known, domain-relative account or group
00099   if(AllocateAndInitializeSid(
00100             &ntauth,
00101             2,
00102             SECURITY_BUILTIN_DOMAIN_RID,
00103             dwSubAuthority,
00104             0,
00105             0,
00106             0,
00107             0,
00108             0,
00109             0,
00110             &psidAccount
00111             ) == 0)
00112     return GetLastError();
00113
00114   // Get the security descriptor for the pool
00115   dwSizeTry = 5;
00116   psdRePoolSd = NULL;
00117   for(;;)
00118   {
00119     if(psdRePoolSd != NULL)
00120       free(psdRePoolSd);
00121     psdRePoolSd = (PSID)malloc(dwSizeTry);
00122
00123     dwRetCode = GetNtmsObjectSecurity(hSession, &gMediaPool, NTMS_MEDIA_POOL, DACL_SECURITY_INFORMATION,
00124       psdRePoolSd, dwSizeTry, &dwSizeReturned);
00125
00126     if(dwRetCode == ERROR_SUCCESS) break;
00127     if(dwRetCode == ERROR_INSUFFICIENT_BUFFER)
00128     {
00129       dwSizeTry = dwSizeReturned;
00130       continue;
00131     }
00132     return ERROR_INVALID_FUNCTION;
00133   }
00134
00135   //Get a pointer to the DACL
00136   OK = GetSecurityDescriptorDacl(psdRePoolSd, &bDaclPresent, &paclDis, &bDaclDefaulted);
00137
00138   // Go through the DACL and change the mask of the ACE with the matching SID
00139   for(i=0; i < paclDis->AceCount; ++i)
00140   {
00141     OK = GetAce(paclDis, i, (LPVOID *)&pAce);
00142     if( EqualSid(psidAccount, &(pAce->SidStart)))
00143       if (dwAction == ADD_ACE_MASK_BITS)
00144         pAce->Mask |= dwMask;
00145       else if (dwAction == REMOVE_ACE_MASK_BITS)
00146         pAce->Mask &= ~dwMask;
00147       else if (dwAction == DELETE_ACE)
00148         DeleteAce(paclDis, i);
00149   }
00150
00151   dwRetCode = SetNtmsObjectSecurity(hSession, &gMediaPool, NTMS_MEDIA_POOL, DACL_SECURITY_INFORMATION,
00152       psdRePoolSd);
00153
00154   free(psdRePoolSd);
00155
00156   FreeSid(psidAccount);
00157
00158   return ERROR_SUCCESS;
00159 }
00160
00161   BOOL
00162 EnumerateObjectType(HANDLE hSession, LPNTMS_GUID gContainer,
00163          DWORD dwType, LPNTMS_GUID &gList, DWORD &dwCount, DWORD &dwRetCode)
00164 {
00165
00166
00167   // Get some memory for the buffer and try the enumerate.
00168   // If it succeeds then return, if the buffer isn't big
00169   // enough then free the memory and try again, if there is
00170   // some error then return.
00171   gList = NULL;
00172   dwCount = SIZE_FOR_FIRST_TRY;
00173   for(;;)
00174   {
00175     gList = (LPNTMS_GUID)malloc(dwCount*sizeof(NTMS_GUID));
00176
00177     dwRetCode = EnumerateNtmsObject(hSession,
00178       gContainer,
00179       gList,
00180       &dwCount,
00181       dwType,
00182       0);
00183
00184     if(dwRetCode == ERROR_SUCCESS)
00185       return TRUE;
00186     else if(dwRetCode == ERROR_INSUFFICIENT_BUFFER)
00187     {
00188       free(gList);
00189       continue;
00190     }
00191     else
00192     {
00193       free(gList);
00194       return FALSE;
00195     }
00196   }
00197 }
00198
00199   bool
00200 GetOfflineLib(HANDLE hSession, NTMS_GUID &gLibID, DWORD &dwRetCode)
00201 {
00202   DWORD dwSize, i;
00203   NTMS_GUID *gLibList = NULL;
00204   NTMS_OBJECTINFORMATION oiLibraryInfo;
00205
00206
00207   SetNullGuid(&gLibID);
00208
00209   // Get a list of the libraries
00210   if(!EnumerateObjectType(hSession, NO_CONTAINER, NTMS_LIBRARY, gLibList, dwSize, dwRetCode))
00211   {
00212     return(false);
00213   }
00214
00215   // Find the offline library
00216   oiLibraryInfo.dwSize = sizeof(oiLibraryInfo);
00217   oiLibraryInfo.dwType = NTMS_LIBRARY;
00218   for(i=0; i < dwSize; ++i)
00219   {
00220     dwRetCode = GetNtmsObjectInformation( hSession,
00221       &(gLibList[i]),
00222       &oiLibraryInfo);
00223     if(dwRetCode != ERROR_SUCCESS)
00224     {
00225       free(gLibList);
00226       return(false);
00227     }
00228     if((oiLibraryInfo.Info.Library.LibraryType == NTMS_LIBRARYTYPE_OFFLINE) &&
00229       (oiLibraryInfo.Info.Library.dwFlags == NTMS_LIBRARYFLAG_FIXEDOFFLINE))
00230     {
00231        gLibID = gLibList[i];
00232        free(gLibList);
00233        return(true);
00234
00235     }
00236   }
00237
00238   free(gLibList);
00239   dwRetCode = ERROR_NOT_FOUND;
00240   return(false);
00241 }
00242
00243
00244 // Find the first online library
00245   bool
00246 findLibrary(HANDLE hSession, NTMS_GUID &gLibID, DWORD &dwRetCode)
00247 {
00248   DWORD dwSize, i;
00249   NTMS_GUID *gLibList = NULL;
00250   NTMS_OBJECTINFORMATION oiLibraryInfo;
00251
00252   SetNullGuid(&gLibID);
00253
00254   // Enumerate the libraries
00255   if(!EnumerateObjectType(hSession, NO_CONTAINER, NTMS_LIBRARY, gLibList, dwSize, dwRetCode))
00256   {
00257     return(false);
00258   }
00259
00260   // Find the first online library
00261   oiLibraryInfo.dwSize = sizeof(oiLibraryInfo);
00262   oiLibraryInfo.dwType = NTMS_LIBRARY;
00263   for(i=0; i < dwSize; ++i)
00264   {
00265     dwRetCode = GetNtmsObjectInformation( hSession,
00266       &(gLibList[i]),
00267       &oiLibraryInfo);
00268     if(dwRetCode != ERROR_SUCCESS)
00269     {
00270       free(gLibList);
00271       return(false);
00272     }
00273     if(oiLibraryInfo.Info.Library.LibraryType == NTMS_LIBRARYTYPE_ONLINE)
00274     {
00275        gLibID = gLibList[i];
00276        free(gLibList);
00277        return(true);
00278     }
00279   }
00280
00281   dwRetCode = ERROR_NOT_FOUND;
00282   free(gLibList);
00283   return(false);
00284 }
00285
00286
00287 // Find the first read/write media type supported by this library
00288   bool
00289 findMediaType(HANDLE hSession, NTMS_GUID &gMediaID, DWORD &dwRetCode)
00290 {
00291   DWORD dwSize, i;
00292   NTMS_GUID *gTypeList = NULL;
00293   NTMS_GUID gLibrary;
00294   NTMS_OBJECTINFORMATION oiMediaTypeInfo;
00295
00296   SetNullGuid(&gMediaID);
00297
00298   // Get the guid for the library
00299   if(!findLibrary(hSession, gLibrary, dwRetCode))
00300   {
00301     return(false);
00302   }
00303
00304   // Get the list of media type guids in the library
00305   if(!EnumerateObjectType(hSession, &gLibrary, NTMS_MEDIA_TYPE, gTypeList, dwSize, dwRetCode))
00306   {
00307     return(false);
00308   }
00309
00310   // Go through the guid list and find a rewritable media type
00311   oiMediaTypeInfo.dwSize = sizeof(oiMediaTypeInfo);
00312   oiMediaTypeInfo.dwType = NTMS_MEDIA_TYPE;
00313   for (i=0; i < dwSize; ++i)
00314   {
00315     dwRetCode = GetNtmsObjectInformation( hSession,
00316       &(gTypeList[i]),
00317       &oiMediaTypeInfo);
00318     if(dwRetCode != ERROR_SUCCESS)
00319     {
00320       free(gTypeList);
00321       return(false);
00322     }
00323     if(oiMediaTypeInfo.Info.MediaType.ReadWriteCharacteristics == NTMS_MEDIARW_REWRITABLE)
00324     {
00325       gMediaID = gTypeList[i];
00326       free(gTypeList);
00327       return (true);
00328     }
00329   }
00330
00331   dwRetCode = ERROR_NOT_FOUND;
00332   free(gTypeList);
00333   return (false);
00334 }
00335
00336
00337 // Find the import media pool
00338   bool
00339 findImportPool(HANDLE hSession, NTMS_GUID &gIpID, DWORD &dwRetCode )
00340 {
00341   DWORD dwSize, i;
00342   NTMS_GUID *gPoolList = NULL, gTlPool, gMediaType, gAppPool;
00343   NTMS_OBJECTINFORMATION oiMediaPoolInfo;
00344
00345
00346   SetNullGuid(&gIpID);
00347   SetNullGuid(&gTlPool);
00348
00349   // Get the list of top level pools
00350   if(!EnumerateObjectType(hSession, NO_CONTAINER, NTMS_MEDIA_POOL, gPoolList, dwSize, dwRetCode))
00351   {
00352     return(false);
00353   }
00354
00355   // Go through the guid list and find the top level import pool
00356   oiMediaPoolInfo.dwSize = sizeof(oiMediaPoolInfo);
00357   oiMediaPoolInfo.dwType = NTMS_MEDIA_POOL;
00358   for (i=0; i < dwSize; ++i)
00359   {
00360     dwRetCode = GetNtmsObjectInformation(hSession,
00361       &(gPoolList[i]),
00362       &oiMediaPoolInfo);
00363     if(dwRetCode != ERROR_SUCCESS)
00364     {
00365       break;
00366     }
00367     if(oiMediaPoolInfo.Info.MediaPool.PoolType == NTMS_POOLTYPE_IMPORT)
00368     {
00369       gTlPool = gPoolList[i];
00370       break;
00371     }
00372   }
00373
00374   free(gPoolList); // done with the list of top level pools
00375
00376   // Did we find the import pool?
00377   if(!NTMS_IS_NULLGUID(gTlPool))
00378   {
00379     // Now we need to find the media-specific pool beneath the top level pool,
00380     // so get the list of pool GUIDS in the top level import pool
00381     if(!EnumerateObjectType(hSession, &gTlPool, NTMS_MEDIA_POOL, gPoolList, dwSize, dwRetCode))
00382       return(false);
00383
00384     // Get the media type of the app pool
00385     gAppPool = recallPoolID();
00386     oiMediaPoolInfo.dwSize = sizeof(oiMediaPoolInfo);
00387     oiMediaPoolInfo.dwType = NTMS_MEDIA_POOL;
00388     dwRetCode = GetNtmsObjectInformation(hSession,
00389       &gAppPool,
00390       &oiMediaPoolInfo);
00391     if(dwRetCode == ERROR_SUCCESS)
00392     {
00393       gMediaType = oiMediaPoolInfo.Info.MediaPool.MediaType;
00394
00395       // Go through the list of import pools and find subpool with proper media type
00396       for(i=0; i < dwSize; ++i)
00397       {
00398         dwRetCode = GetNtmsObjectInformation(hSession,
00399           &(gPoolList[i]),
00400           &oiMediaPoolInfo);
00401         if(dwRetCode != ERROR_SUCCESS)
00402         {
00403           break;
00404         }
00405         if(oiMediaPoolInfo.Info.MediaPool.MediaType == gMediaType)
00406         {
00407           gIpID = gPoolList[i];
00408           break;
00409         }
00410       }
00411     }
00412   }
00413
00414
00415   free(gPoolList); // done with the list of media specific import pools
00416
00417   if(!NTMS_IS_NULLGUID(gIpID))
00418   {
00419     return(true);
00420   }
00421   else
00422   {
00423     if(dwRetCode == ERROR_SUCCESS)
00424     {
00425       dwRetCode = ERROR_NOT_FOUND; // nothing failed, just didn't find the pool
00426     }
00427     return(false);
00428   }
00429 }
00430
00431
00432 /*************************************************************************
00433  *
00434  *       Use Case #1
00435  *
00436  *           Shows:
00437  *
00438  *             - Creating a media pool
00439  *             - Setting properties of a media pool
00440  *
00441  *           Note:
00442  *
00443  *             After creating it the first time, every time an application is
00444  *             subsequently invoked it could enumerate all the RSM pools and
00445  *             find its own pool.  If the app has some persistent data a better
00446  *             way is to remember the pool GUID from invocation to invocation.
00447  *
00448  *************************************************************************/
00449
00450   void
00451 UseCase1()
00452 {
00453   HANDLE hSession;
00454   DWORD dwRetCode;
00455   NTMS_GUID gMediaType;
00456   NTMS_GUID gMediaPool;
00457   NTMS_OBJECTINFORMATION oiInfoBuffer;
00458
00459
00460   // Start an RSM session
00461   if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase1", dwRetCode))
00462     return;
00463
00464
00465   // Get a GUID for a read/write media type
00466   if(!findMediaType(hSession, gMediaType, dwRetCode))
00467   {
00468     CloseNtmsSession(hSession);
00469     return;
00470   }
00471
00472   // Create a pool for this app, returns a GUID
00473   dwRetCode = CreateNtmsMediaPool( hSession,
00474       L"API_Sample_Pool",
00475       &gMediaType,
00476       NTMS_OPEN_ALWAYS,
00477       NULL,
00478       &gMediaPool);
00479
00480   // Set this new pool to automatically draw media from the scratch pool
00481   // when allocating. Do this by first reading the info associated with the
00482   // pool GUID, changing the "allocate from scratch" bit and then setting
00483   // the pool info
00484   oiInfoBuffer.dwSize = sizeof(oiInfoBuffer);
00485   oiInfoBuffer.dwType = NTMS_MEDIA_POOL;
00486   dwRetCode = GetNtmsObjectInformation(hSession,
00487       &gMediaPool,
00488       &oiInfoBuffer);
00489
00490   oiInfoBuffer.Info.MediaPool.AllocationPolicy =
00491      NTMS_ALLOCATE_FROMSCRATCH;
00492
00493   dwRetCode = SetNtmsObjectInformation(hSession,
00494       &gMediaPool,
00495       &oiInfoBuffer);
00496
00497   // Change the permissions on the pool
00498   SetPoolDACL(hSession, gMediaPool, DOMAIN_ALIAS_RID_USERS,
00499     REMOVE_ACE_MASK_BITS, NTMS_MODIFY_ACCESS | NTMS_CONTROL_ACCESS);
00500
00501   // Remember the pool GUID for future use
00502   persistPoolID(gMediaPool);
00503
00504   CloseNtmsSession(hSession);
00505 }
00506
00507
00508 /*************************************************************************
00509  *
00510  *       Use Case #2
00511  *
00512  *           Shows:
00513  *
00514  *             - Allocating media
00515  *             - Mounting media
00516  *             - Writing an OMID
00517  *
00518  *************************************************************************/
00519
00520   void
00521 UseCase2()
00522 {
00523   HANDLE hSession, hDrive;
00524   DWORD dwRetCode, labelBytesWritten = LABEL_BUFFER_SIZE;
00525   NTMS_GUID gPoolID, gMediaID, gDriveID;
00526   NTMS_OBJECTINFORMATION oiDriveInfo;
00527   BYTE *labelBuffer;
00528
00529
00530   // Start an RSM session
00531   if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase2", dwRetCode))
00532     return;
00533
00534   // We need to write some data, but don't have a piece of
00535   // media to write it to yet, so get a piece of media to
00536   // use and remember the guid
00537   gPoolID = recallPoolID();
00538   dwRetCode = AllocateNtmsMedia(hSession,
00539     &gPoolID,
00540     NULL,
00541     &gMediaID,
00542     NTMS_ALLOCATE_NEW,
00543     ALLOCATE_WAIT,
00544     NULL);
00545   persistMediaID(gMediaID);
00546
00547   // Mount the piece of media in a drive, the mount returns a drive GUID
00548   dwRetCode = MountNtmsMedia(hSession,
00549     &gMediaID,
00550     &gDriveID,
00551     REQUESTING_ONE_MOUNT,
00552     NTMS_MOUNT_ERROR_NOT_AVAILABLE,
00553     NTMS_PRIORITY_NORMAL,
00554     MOUNT_WAIT,
00555     NULL);
00556
00557   // Open the drive the media is in by getting the device name associated
00558   // with the drive GUID the mount request returned.
00559   oiDriveInfo.dwSize = sizeof(oiDriveInfo);
00560   oiDriveInfo.dwType = NTMS_DRIVE;
00561   dwRetCode = GetNtmsObjectInformation(hSession,
00562     &gDriveID,
00563     &oiDriveInfo);
00564
00565   hDrive = CreateFile(oiDriveInfo.Info.Drive.szDeviceName,
00566                     GENERIC_READ | GENERIC_WRITE,
00567                     0,
00568                     NULL,
00569                     OPEN_EXISTING,
00570                     FILE_ATTRIBUTE_NORMAL,
00571                     NULL);
00572
00573   // Write the OMID and tell RSM
00574   // Get a buffer that's big enough for the label and is an
00575   // integral number of blocks.
00576   labelBuffer = (BYTE *)malloc(((sizeof(STL_LABEL)/512)+1)*512);
00577   writeOmid(hDrive, (STL_LABEL *)labelBuffer);
00578   dwRetCode = UpdateNtmsOmidInfo(hSession,
00579     &gMediaID,
00580     NTMS_OMID_TYPE_RAW_LABEL,
00581     sizeof(STL_LABEL),
00582     (void *)labelBuffer);
00583   free(labelBuffer);
00584
00585   // Write data via Win32 API calls, close device when done.
00586
00587   // (insert whatever native WWin32 I/O calls here are needed to place
00588   // data on the media)
00589
00590   CloseHandle(hDrive);
00591
00592   // Dismount the media
00593   dwRetCode = DismountNtmsMedia( hSession,
00594     &gMediaID,
00595     REQUESTING_ONE_DISMOUNT,
00596     0);
00597
00598   CloseNtmsSession(hSession);
00599 }
00600
00601
00602 /*************************************************************************
00603  *
00604  *       Use Case #3
00605  *
00606  *           Shows:
00607  *
00608  *             - Mounting already allocated media
00609  *             - Dismounting media
00610  *             - Deallocated media no longer needed
00611  *
00612  *************************************************************************/
00613
00614   void
00615 UseCase3()
00616 {
00617   HANDLE hSession, hDrive;
00618   DWORD dwRetCode, labelBytesWritten = LABEL_BUFFER_SIZE;
00619   NTMS_GUID gMediaID, gDriveID;
00620   NTMS_OBJECTINFORMATION oiDriveInfo;
00621
00622
00623   // Start an RSM session
00624   if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase3", dwRetCode))
00625     return;
00626
00627   // Mount the piece of media in a drive
00628   gMediaID = recallMediaID();
00629   dwRetCode = MountNtmsMedia(hSession,
00630     &gMediaID,
00631     &gDriveID,
00632     REQUESTING_ONE_MOUNT,
00633     NTMS_MOUNT_ERROR_NOT_AVAILABLE,
00634     NTMS_PRIORITY_NORMAL,
00635     MOUNT_WAIT,
00636     NULL);
00637
00638   // Open the drive the media is in
00639   oiDriveInfo.dwSize = sizeof(oiDriveInfo);
00640   oiDriveInfo.dwType = NTMS_DRIVE;
00641   dwRetCode = GetNtmsObjectInformation(hSession,
00642     &gDriveID,
00643     &oiDriveInfo);
00644
00645   hDrive = CreateFile(oiDriveInfo.Info.Drive.szDeviceName,
00646                     GENERIC_READ | GENERIC_WRITE,
00647                     0,
00648                     NULL,
00649                     OPEN_EXISTING,
00650                     FILE_ATTRIBUTE_NORMAL,
00651                     NULL);
00652
00653   // (insert whatever native WWin32 I/O calls here are needed to place
00654   // data on the media)
00655
00656   CloseHandle(hDrive);
00657
00658   // Dismount the media
00659   dwRetCode = DismountNtmsMedia( hSession,
00660     &gMediaID,
00661     REQUESTING_ONE_DISMOUNT,
00662     0);
00663
00664   // We've determined that we no longer need this piece of media and
00665   // the data it contains, so deallocate it.
00666   dwRetCode = DeallocateNtmsMedia( hSession,
00667     &gMediaID,
00668     0);
00669
00670   CloseNtmsSession(hSession);
00671 }
00672
00673
00674 /*************************************************************************
00675  *
00676  *       Use Case #4
00677  *
00678  *           Shows:
00679  *
00680  *             - Traversing nested media pools
00681  *             - Moving media from one pool to another
00682  *
00683  *************************************************************************/
00684
00685   void
00686 UseCase4()
00687 {
00688   HANDLE hSession;
00689   DWORD dwRetCode, i;
00690   NTMS_GUID gIpID, *gSideList = NULL, gPoolID;
00691   DWORD dwSize;
00692   NTMS_OBJECTINFORMATION oiSideInfo;
00693
00694
00695   // Start an RSM session
00696   if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase4", dwRetCode))
00697     return;
00698
00699   // Get the GUID of the media-specific import pool
00700   if(findImportPool(hSession, gIpID, dwRetCode) == false)
00701   {
00702     CloseNtmsSession(hSession);
00703     return;
00704   }
00705
00706   // Enumerate all the sides in the media-specific import pool
00707   if(!EnumerateObjectType(hSession, &gIpID, NTMS_PARTITION, gSideList, dwSize, dwRetCode))
00708   {
00709     CloseNtmsSession(hSession);
00710     return;
00711   }
00712
00713
00714   gPoolID = recallPoolID();
00715
00716   // Look at the label on each piece of media & move it
00717   // to this app's pool if it was written by this
00718   // app.
00719   oiSideInfo.dwSize = sizeof(oiSideInfo);
00720   oiSideInfo.dwType = NTMS_PARTITION;
00721   for (i=0; i < dwSize; ++i)
00722   {
00723     if(GetNtmsObjectInformation( hSession,
00724       &(gSideList[i]),
00725       &oiSideInfo) != ERROR_SUCCESS)
00726     {
00727       CloseNtmsSession(hSession);
00728       free(gSideList);
00729       return;
00730     }
00731     if((wcsncmp(oiSideInfo.Info.Partition.szOmidLabelType,
00732       L"Simple Tape Label (STL)", 23)) == 0)
00733     {
00734       MoveToNtmsMediaPool(hSession,
00735         &(oiSideInfo.Info.Partition.PhysicalMedia), &gPoolID);
00736     }
00737   }
00738
00739   free(gSideList);
00740
00741   CloseNtmsSession(hSession);
00742 }
00743
00744
00745
00746 /*************************************************************************
00747  *
00748  *       Use Case #5
00749  *
00750  *           Shows:
00751  *
00752  *             - Finding the CD-ROM drive
00753  *             - Turning on RSM database update notifications
00754  *             - Turning on media change detection
00755  *             - Handling RSM database update notifications
00756  *
00757  *************************************************************************/
00758
00759   void
00760 UseCase5()
00761 {
00762   HANDLE hSession, hNotificationSession;
00763   DWORD dwRetCode, i;
00764   NTMS_GUID gDriveID, gLibID, *gDriveList = NULL;
00765   DWORD dwSize;
00766   NTMS_OBJECTINFORMATION oiDriveInfo, oiDTypeInfo, oiLibInfo;
00767   NTMS_NOTIFICATIONINFORMATION oiNotificationInfo;
00768
00769
00770   // Start an RSM session
00771   if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase5", dwRetCode))
00772     return;
00773
00774   // Get a list of all the drives
00775   EnumerateObjectType(hSession, NO_CONTAINER, NTMS_DRIVE, gDriveList, dwSize, dwRetCode);
00776
00777   // Find the CD-ROM drive
00778   oiDriveInfo.dwSize = sizeof(oiDriveInfo);
00779   oiDriveInfo.dwType = NTMS_DRIVE;
00780   oiDTypeInfo.dwSize = sizeof(oiDTypeInfo);
00781   oiDTypeInfo.dwType = NTMS_DRIVE_TYPE;
00782   oiLibInfo.dwSize = sizeof(oiLibInfo);
00783   oiLibInfo.dwType = NTMS_LIBRARY;
00784
00785   for(i=0; i < dwSize; ++i)
00786   {
00787
00788     // get the attributes of the drive
00789     dwRetCode = GetNtmsObjectInformation( hSession,
00790       &(gDriveList[i]),
00791       &oiDriveInfo);
00792     // get the attributes of the type of drive
00793     dwRetCode = GetNtmsObjectInformation( hSession,
00794         &(oiDriveInfo.Info.Drive.DriveType),
00795         &oiDTypeInfo);
00796     // get the attributes of the library that holds the drive
00797     dwRetCode = GetNtmsObjectInformation( hSession,
00798         &(oiDriveInfo.Info.Drive.Library),
00799         &oiLibInfo);
00800
00801     // is it a stand-alone CD-ROM drive?
00802     if((oiDTypeInfo.Info.DriveType.DeviceType == FILE_DEVICE_CD_ROM) &&
00803       (oiLibInfo.Info.Library.LibraryType == NTMS_LIBRARYTYPE_STANDALONE))
00804     {
00805       // yes
00806        gDriveID = gDriveList[i];
00807        gLibID = oiDriveInfo.Info.Drive.Library;
00808        break;
00809     }
00810   }
00811
00812   free(gDriveList);
00813
00814   if(i == dwSize)
00815   {
00816     // No stand-alone CD drive
00817     CloseNtmsSession(hSession);
00818     return;
00819   }
00820
00821
00822   // Turn on database notifications so we'll be notified when RSM's
00823   // database is updated
00824   hNotificationSession = OpenNtmsNotification(hSession, NTMS_DRIVE);
00825
00826
00827   // Get the next 5 drive notifications, then quit
00828   for(i=0; i<5; ++i)
00829   {
00830
00831     WaitForNtmsNotification(hNotificationSession,&oiNotificationInfo, INFINITE);
00832
00833     if(!memcmp(&oiNotificationInfo.ObjectId,&gDriveID, sizeof(NTMS_GUID)))
00834     {
00835       switch(oiNotificationInfo.dwOperation)
00836       {
00837       case NTMS_OBJ_INSERT:
00838         break;
00839       case NTMS_OBJ_DELETE:
00840         break;
00841       case NTMS_OBJ_UPDATE:
00842         MessageBox(NULL, L"A drive changed state!", L"RSM API Sample", MB_OK);
00843         break;
00844       }
00845     }
00846   }
00847
00848
00849   CloseNtmsNotification( &hNotificationSession);
00850
00851
00852   CloseNtmsSession(hSession);
00853
00854 }
00855
00856
00857 /*************************************************************************
00858  *
00859  *       Use Case #6
00860  *
00861  *           Shows:
00862  *
00863  *             - Finding offline media
00864  *
00865  *************************************************************************/
00866
00867 #define OUTPUT_BUFFER_WCHAR_SIZE NTMS_OBJECTNAME_LENGTH+5
00868   void
00869 UseCase6()
00870 {
00871   DWORD dwRetCode, i;
00872   NTMS_GUID gLibID, *gMediaList;
00873   DWORD dwSize;
00874   NTMS_OBJECTINFORMATION oiMediaInfo;
00875   HANDLE hSession;
00876
00877
00878   // Start an RSM session
00879   if(!OpenSessionWithWait(hSession, L"RSM Sample: UseCase6", dwRetCode))
00880     return;
00881
00882   // Get the GUID of the offline library
00883   if(!GetOfflineLib(hSession, gLibID, dwRetCode))
00884   {
00885     CloseNtmsSession(hSession);
00886     return;
00887   }
00888
00889   // Get a list of GUIDs for media in offline library
00890   EnumerateObjectType(hSession, &gLibID, NTMS_PHYSICAL_MEDIA, gMediaList, dwSize, dwRetCode);
00891
00892   // Print the name of each physical media
00893   wprintf(L"Media in the offline physical location:\n");
00894   oiMediaInfo.dwSize = sizeof(oiMediaInfo);
00895   oiMediaInfo.dwType = NTMS_PHYSICAL_MEDIA;
00896   for(i=0; i < dwSize; ++i)
00897   {
00898     WCHAR szOutputBuffer[OUTPUT_BUFFER_WCHAR_SIZE];
00899
00900     dwRetCode = GetNtmsObjectInformation( hSession,
00901       &(gMediaList[i]),
00902       &oiMediaInfo);
00903
00904     StringCchCopyW(szOutputBuffer, OUTPUT_BUFFER_WCHAR_SIZE, L"   ");
00905     StringCchCatW(szOutputBuffer, OUTPUT_BUFFER_WCHAR_SIZE, oiMediaInfo.szName);
00906     StringCchCatW(szOutputBuffer, OUTPUT_BUFFER_WCHAR_SIZE, L"\n");
00907     wprintf(szOutputBuffer);
00908   }
00909
00910   free(gMediaList);
00911
00912   CloseNtmsSession(hSession);
00913 }
00914
00915
00916   void
00917 main()
00918 {
00919
00920   /* Each of the following use cases performs a complete set of RSM operations an application
00921      might perform during an application invokation.  A backup application, for example, would
00922      do something like UseCase1 when it is installed, UseCase2 when a backup or restore is
00923      performed, UseCase3 when a user indicates that a backup set is to be discarded and so
00924      on
00925    */
00926
00927   UseCase1(); // Typical app initialization
00928
00929   UseCase2(); // Typical media allocation and use scenario
00930
00931   UseCase3(); // Typical media deallocation scenario
00932
00933   UseCase4(); // Find each piece of media in the import pool that
00934         //    belong to this app and move it to this
00935         //    app's media pool
00936
00937   UseCase5(); // Announce changes to the contents of the CD-ROM drive
00938
00939   UseCase6(); // Print the names of all the media in the off-line library
00940 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/filerepserverproc.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

filerepserverproc.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: FileRepServerProc.cpp
00008
00009     PURPOSE: Remote procedures for server system service
00010
00011     FUNCTIONS:
00012         RemoteOpen() - Open the file.  It also gets some
00013     some data from the file, and closes the file if all data
00014     has been read at once.  This enhances performance.
00015         RemoteRead() - Read a buffer's worth of the file.  It
00016     closes the file if EOF has been reached.
00017
00018     COMMENTS:
00019
00020 */
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <string.h>
00025
00026 #include "common.h"
00027
00028 // header file generated by MIDL compiler
00029 #include "FileRepServer.h"
00030
00031 // Declarations for service routines.
00032 #include "Service.h"
00033
00034 typedef struct {
00035     HANDLE hFile;
00036     // We use this byte to check if EOF has been
00037     // reached on read.  The byte is put into
00038     // the first position of the next buffer read if EOF
00039     // has not been reached.
00040     BYTE EOFCheck;
00041 } FILE_CONTEXT_TYPE;
00042
00043 /*
00044   This is a procedure that actually reads file data.
00045   It performs the reading tasks common to RemoteOpen and RemoteRead.
00046   Notice that nToRead is the number of bytes to read.
00047 */
00048 VOID ReadData(HANDLE hFile, VOID *pbBuf, unsigned long nToRead, unsigned long *cbRead, BOOL *bEOF, BYTE *EOFCheck) {
00049
00050     if(!ReadFile(hFile, pbBuf, nToRead+1, cbRead, NULL)) {
00051
00052   // We want to raise an exception but leave the context intact
00053   // so that subsequent reads may be attempted.  Later versions
00054         // may implement this feature.
00055
00056   RpcRaiseException(GetLastError());
00057         return;
00058     }
00059
00060     // Check for EOF.
00061     *bEOF = FALSE;
00062     // If we read in the whole buffer, save the last byte.
00063     if(*cbRead == nToRead+1) {
00064   *EOFCheck = ((BYTE *)pbBuf)[(nToRead+1)-1];
00065
00066   // return at most nToRead read bytes.
00067   *cbRead = nToRead;
00068     }
00069     // If we did not read the whole buffer then we reached the EOF.
00070     else{
00071   *bEOF = TRUE;
00072     }
00073 }
00074
00075 /*
00076     FUNCTION: s_RemoteOpen
00077
00078     PURPOSE: Opens a file on the server and returns some file data.
00079
00080     PARAMETERS:
00081         hFileRepServer - RPC binding
00082         pphContext - the context handle associated with the open file
00083         pszFileName -  file to open
00084   pbBuf - buffer to read into
00085   cbRead - number of bytes read into the buffer
00086
00087     RETURN VALUE:
00088         none
00089
00090     COMMENTS:
00091 */
00092 VOID s_RemoteOpen(handle_t hFileRepServer,
00093       PCONTEXT_HANDLE_TYPE *pphContext,
00094       LPTSTR pszFileName,
00095       BYTE *pbBuf,
00096       unsigned long *cbRead)
00097 {
00098     HANDLE hFile;
00099     FILE_CONTEXT_TYPE *pFileContext;
00100     BOOL bEOF = FALSE;
00101     BYTE EOFCheck;
00102     INT status;
00103     RPC_STATUS rpcstatus;
00104
00105     BOOL bImpersonating = FALSE;
00106
00107     // We need to impersonate the user that has issued the
00108     // remote call.  If we impersonate here then we make sure that
00109     // the user has adequate permissions to open the file.
00110     if (!bImpersonating) {
00111         if ((rpcstatus = RpcImpersonateClient(hFileRepServer)) != RPC_S_OK) {
00112             RpcRaiseException(rpcstatus);
00113       return;
00114   }
00115   bImpersonating = TRUE;
00116     }
00117
00118     // It is enough to impersonate while opening the file, since this is where all
00119     // the security checks are done.  We can later read from this handle
00120     // while not impersonating.
00121     if ((hFile = CreateFile(pszFileName,
00122           GENERIC_READ,
00123           FILE_SHARE_READ,
00124           NULL,
00125           OPEN_EXISTING,
00126           FILE_ATTRIBUTE_NORMAL,
00127           NULL)) == INVALID_HANDLE_VALUE) {
00128
00129         if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
00130       RpcRaiseException(rpcstatus);
00131       return;
00132   }
00133
00134   RpcRaiseException(GetLastError());
00135         return;
00136     }
00137
00138     // We can now revert to self, since file has been opened while
00139     // impersonating and hence the security requirements have been met.
00140     if (bImpersonating) {
00141         if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
00142             RpcRaiseException(rpcstatus);
00143       return;
00144   }
00145     }
00146
00147     // Read data from file into the buffer.
00148     // This function may throw exceptions, but we would want
00149     // those to propagate out.
00150     ReadData(hFile, (VOID *)pbBuf, OPEN_BUFSIZE, cbRead, &bEOF, &EOFCheck);
00151
00152     // Check if EOF has been reached.
00153     if(bEOF) {
00154   // If it has, we can simply return.
00155
00156   // Since all of the read has completed, the [out] context handle
00157   // pointer is NULL.
00158   pFileContext = NULL;
00159   *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00160
00161   status = CloseHandle(hFile);
00162   ASSERTE(status != 0);
00163
00164   return;
00165     }
00166     else {
00167   // Otherwise we need to allocate, initialize, and return the
00168   // context handle.
00169   if((pFileContext = (FILE_CONTEXT_TYPE *) midl_user_allocate(sizeof(FILE_CONTEXT_TYPE))) == NULL) {
00170
00171       status = CloseHandle(hFile);
00172       ASSERTE(status != 0);
00173       RpcRaiseException(ERROR_OUTOFMEMORY);
00174       return;
00175   }
00176
00177   // Initialize the context handle fields.
00178   pFileContext->hFile = hFile;
00179
00180   pFileContext->EOFCheck = EOFCheck;
00181
00182   *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00183
00184   return;
00185     }
00186 }
00187
00188 /*
00189     FUNCTION: s_RemoteRead
00190
00191     PURPOSE: Opens a file on the server and returns some file data.
00192
00193     PARAMETERS:
00194         hFileRepServer - RPC binding
00195         pphContext - the context handle associated with the open file
00196   pbBuf - buffer to read into
00197   cbRead - number of bytes read into the buffer
00198
00199     RETURN VALUE:
00200         none
00201
00202     COMMENTS:
00203 */
00204 VOID s_RemoteRead(handle_t hFileRepServer,
00205       PCONTEXT_HANDLE_TYPE *pphContext,
00206       BYTE *pbBuf,
00207       unsigned long *cbRead)
00208 {
00209     FILE_CONTEXT_TYPE *pFileContext;
00210     BOOL bEOF = FALSE;
00211     BYTE EOFCheck;
00212     INT status;
00213
00214     // Clients have already been authenticated in RemoteOpen.
00215     // Here we operate on the context handle generated in RemoteOpen,
00216     // hence no additional security precations need to be taken.
00217
00218     // Make sure that the provided context handle is not NULL.
00219     if(*pphContext == NULL) {
00220
00221   RpcRaiseException(RPC_X_SS_IN_NULL_CONTEXT);
00222         return;
00223     }
00224
00225     pFileContext = (FILE_CONTEXT_TYPE *) *pphContext;
00226
00227     // Remember that we have a byte left over from RemoteOpen EOF check.
00228     pbBuf[0] = pFileContext->EOFCheck;
00229
00230     // Read the following bytes from file, but remember that we now only
00231     // have space for READ_BUFSIZE-1 bytes and we write starting
00232     // from the 1st index.  We will let possible exceptions propagate out.
00233     ReadData(pFileContext->hFile, (VOID *)&(pbBuf[1]), READ_BUFSIZE-1, cbRead, &bEOF, &EOFCheck);
00234
00235     // Since we had the first byte left over from the previous read, pretend
00236     // that we read it.
00237     (*cbRead)++;
00238
00239     if(bEOF){
00240         // If it has, we can destroy the context handle, close
00241         // the file and return.
00242   status = CloseHandle(pFileContext->hFile);
00243         ASSERTE(status != 0);
00244
00245   midl_user_free(*pphContext);
00246
00247   // Return NULL context handle to signify that the file has
00248   // been completely read.
00249   pFileContext = NULL;
00250   *pphContext = (PCONTEXT_HANDLE_TYPE) pFileContext;
00251
00252   return;
00253     }
00254
00255     // Memorize the last byte read for the next read.
00256     pFileContext->EOFCheck = EOFCheck;
00257
00258     // Otherwise we just return the number of symbols read in cbRead.
00259     return;
00260 }
00261
00262 // The rundown routine is associated with the context handle type.
00263 // When a connection breaks, the server stub and the run-time
00264 // library will call this routine.
00265 void __RPC_USER PCONTEXT_HANDLE_TYPE_rundown(PCONTEXT_HANDLE_TYPE phContext) {
00266     FILE_CONTEXT_TYPE *pFileContext;
00267     INT status;
00268
00269     // We need to try and close the file associated with the
00270     // context handle...
00271
00272     // Context handle can not be NULL in this section, so we can
00273     // go ahead and try closing the file.
00274     pFileContext = (FILE_CONTEXT_TYPE *) phContext;
00275
00276     // Also, we do not need to worry about pFileContext->hFile's being
00277     // null since we checked for it when we opened the file.
00278     status = CloseHandle(pFileContext->hFile);
00279     ASSERTE(status != 0);
00280
00281     // And then free the memory taken up by it.
00282     midl_user_free(phContext);
00283 }
00284
00285 // end FileRepServerProc.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/spy.cpp Source File

  • Dataaccess
  • oledb
  • tablecopy

spy.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module SPY.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 /////////////////////////////////////////////////////////////////////////////
00015 #include "common.h"
00016 #include "spy.h"
00017
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // Defines
00021 //
00022 /////////////////////////////////////////////////////////////////////////////
00023
00024 // HEADER + BUFFER + FOOTER
00025 // HEADER = HEADSIGNITURE + BUFFERSIZE + BUFFERID
00026 // FOOTER = TAILSIGNITURE
00027
00028 //All the header info must be ULONGs,
00029 //so that the user buffer falls on a word boundary
00030 //The tail must be a byte, since if it was a ULONG it would
00031 //also require a word boundary, but the users buffer could
00032 //be an odd number of bytes, so instead of rounding up, just use BYTE
00033
00034 const ULONG HEADSIZE  = sizeof(ULONG);  //HEADSIGNITURE
00035 const ULONG LENGTHSIZE  = sizeof(ULONG);  //BUFFERSIZE
00036 const ULONG IDSIZE    = sizeof(ULONG);  //BUFFERIF
00037 const ULONG TAILSIZE  = sizeof(BYTE);   //TAILSIGNITURE
00038
00039 const ULONG HEADERSIZE = ROUNDUP(HEADSIZE + LENGTHSIZE + IDSIZE);
00040 const ULONG FOOTERSIZE = TAILSIZE;
00041
00042 const BYTE  HEADSIGN = '{';
00043 const BYTE  TAILSIGN = '}';
00044
00045 const BYTE  ALLOCSIGN = '$';
00046 const BYTE  FREESIGN  = 'Z';
00047
00048 #define HEAD_OFFSET(pActual)    ((BYTE*)pActual)
00049 #define TAIL_OFFSET(pActual)    (USERS_OFFSET(pActual)+BUFFER_LENGTH(pActual))
00050
00051 #define USERS_OFFSET(pActual)   (HEAD_OFFSET(pActual) + HEADERSIZE)
00052 #define HEADER_OFFSET(pRequest)   ((BYTE*)(pRequest) - HEADERSIZE)
00053
00054 #define LENGTH_OFFSET(pActual)    (HEAD_OFFSET(pActual) + HEADSIZE)
00055 #define BUFFER_LENGTH(pActual)    (*(ULONG*)LENGTH_OFFSET(pActual))
00056
00057 #define ID_OFFSET(pActual)      (LENGTH_OFFSET(pActual) + LENGTHSIZE)
00058 #define BUFFER_ID(pActual)      (*(ULONG*)ID_OFFSET(pActual))
00059
00060 #define HEAD_SIGNITURE(pActual)   (*(ULONG*)HEAD_OFFSET(pActual))
00061 #define TAIL_SIGNITURE(pActual)   (*(BYTE*)TAIL_OFFSET(pActual))
00062
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // CMallocSpy::CMallocSpy()
00066 //
00067 /////////////////////////////////////////////////////////////////////////////
00068 CMallocSpy::CMallocSpy()
00069 {
00070     m_cRef = 0;
00071   m_cbRequest = 0;
00072
00073   //Have constructor AddRef, so ref count is init 1
00074   //Release() is required
00075   AddRef();
00076 }
00077
00078 /////////////////////////////////////////////////////////////////////////////
00079 // CMallocSpy::~CMallocSpy()
00080 //
00081 /////////////////////////////////////////////////////////////////////////////
00082 CMallocSpy::~CMallocSpy()
00083 {
00084   //Remove all the elements of the list
00085   CAllocList.RemoveAll();
00086 }
00087
00088
00089 /////////////////////////////////////////////////////////////////////////////
00090 // HRESULT CMallocSpy::AddToList
00091 //
00092 /////////////////////////////////////////////////////////////////////////////
00093 HRESULT CMallocSpy::AddToList(void* pv)
00094 {
00095   ASSERT(pv);
00096
00097   //Add this element to the list
00098   CAllocList.AddTail(pv);
00099   return S_OK;
00100 }
00101
00102
00103 /////////////////////////////////////////////////////////////////////////////
00104 // HRESULT CMallocSpy::RemoveFromList
00105 //
00106 /////////////////////////////////////////////////////////////////////////////
00107 HRESULT CMallocSpy::RemoveFromList(void* pv)
00108 {
00109   ASSERT(pv);
00110
00111   //Remove this element from the list
00112   LISTPOS pos = CAllocList.Find(pv);
00113   if(pos)
00114     CAllocList.RemoveAt(pos);
00115   return S_OK;
00116 }
00117
00118 /////////////////////////////////////////////////////////////////////////////
00119 // HRESULT CMallocSpy::DumpLeaks
00120 //
00121 /////////////////////////////////////////////////////////////////////////////
00122 HRESULT CMallocSpy::DumpLeaks()
00123 {
00124   ULONG ulTotalLeaked = 0;
00125
00126   //Display Leaks to the Output Window
00127   while(!CAllocList.IsEmpty())
00128   {
00129     //Obtain the pointer to the leaked memory
00130     void* pRequest = CAllocList.RemoveHead();
00131     ASSERT(pRequest);
00132
00133     void* pActual = HEADER_OFFSET(pRequest);
00134     ASSERT(pActual);
00135
00136     //Make sure that the head/tail signitures are intact
00137     if(HEAD_SIGNITURE(pActual) != HEADSIGN)
00138       TRACE(L"-- IMallocSpy HeadSigniture Corrupted! - 0x%08x, ID=%08lu, %lu bytes\n", pRequest, BUFFER_ID(pActual), BUFFER_LENGTH(pActual));
00139
00140     if(TAIL_SIGNITURE(pActual) != TAILSIGN)
00141       TRACE(L"-- IMallocSpy TailSigniture Corrupted! - 0x%08x, ID=%08lu, %lu bytes\n", pRequest, BUFFER_ID(pActual), BUFFER_LENGTH(pActual));
00142
00143     ULONG ulSize = BUFFER_LENGTH(pActual);
00144     ULONG ulID   = BUFFER_ID(pActual);
00145
00146     TRACE(L"-- IMallocSpy LEAK! - 0x%08x, ID=%08lu, %lu bytes\n", pRequest, ulID, ulSize);
00147     ulTotalLeaked += ulSize;
00148
00149     //Free the Leak
00150     //You really cant free the leak since the app could be potentially still
00151     //using it.  Or the DLL may still be in use or have attached threads...
00152     //SAFE_FREE(pActual);
00153   }
00154
00155   if(ulTotalLeaked)
00156     TRACE(L"-- IMallocSpy Total LEAKED! - %lu bytes\n", ulTotalLeaked);
00157
00158   return S_OK;
00159 }
00160
00161 /////////////////////////////////////////////////////////////////////////////
00162 // HRESULT CMallocSpy::QueryInterface
00163 //
00164 /////////////////////////////////////////////////////////////////////////////
00165 HRESULT CMallocSpy::QueryInterface(REFIID riid, void** ppIUnknown)
00166 {
00167   if(!ppIUnknown)
00168     return E_INVALIDARG;
00169
00170   *ppIUnknown = NULL;
00171
00172   //IID_IUnknown
00173     if(riid == IID_IUnknown)
00174     *ppIUnknown = this;
00175     //IDD_IMallocSpy
00176   else if(riid == IID_IMallocSpy)
00177          *ppIUnknown =  this;
00178
00179   if(*ppIUnknown)
00180     {
00181         ((IUnknown*)*ppIUnknown)->AddRef();
00182         return S_OK;
00183   }
00184
00185   return E_NOINTERFACE;
00186 }
00187
00188 /////////////////////////////////////////////////////////////////////////////
00189 // ULONG CMallocSpy::AddRef
00190 //
00191 /////////////////////////////////////////////////////////////////////////////
00192 ULONG CMallocSpy::AddRef()
00193 {
00194     return ++m_cRef;
00195 }
00196
00197 /////////////////////////////////////////////////////////////////////////////
00198 // ULONG CMallocSpy::Release
00199 //
00200 /////////////////////////////////////////////////////////////////////////////
00201 ULONG CMallocSpy::Release()
00202 {
00203     if(--m_cRef)
00204       return m_cRef;
00205
00206   TRACE(L"Releasing IMallocSpy\n");
00207
00208     delete this;
00209     return 0;
00210 }
00211
00212
00213 /////////////////////////////////////////////////////////////////////////////
00214 // ULONG CMallocSpy::PreAlloc
00215 //
00216 /////////////////////////////////////////////////////////////////////////////
00217 ULONG CMallocSpy::PreAlloc(ULONG cbRequest)
00218 {
00219   //cbRequest is the orginal number of bytes requested by the user
00220   //Store the users requested size
00221     m_cbRequest = cbRequest;
00222
00223   //Return the total size requested, plus extra for header/footer
00224   return (m_cbRequest + HEADERSIZE + FOOTERSIZE);
00225 }
00226
00227 /////////////////////////////////////////////////////////////////////////////
00228 // void* CMallocSpy::PostAlloc
00229 //
00230 /////////////////////////////////////////////////////////////////////////////
00231 void* CMallocSpy::PostAlloc(void* pActual)
00232 {
00233   //pActual is the pointer to the head of the buffer, including the header
00234   //Add the users pointer to the list
00235   AddToList(USERS_OFFSET(pActual));
00236
00237   //Place the HeadSigniture in the HEADER
00238   HEAD_SIGNITURE(pActual) = HEADSIGN;
00239
00240   //Place the Size in the HEADER
00241   BUFFER_LENGTH(pActual) = m_cbRequest;
00242
00243   //Place the ID in the HEADER
00244   static ULONG ulID = 0;
00245   BUFFER_ID(pActual) = ++ulID;
00246
00247   //Set the UsersBuffer to a known char
00248     memset(USERS_OFFSET(pActual), ALLOCSIGN, m_cbRequest);
00249
00250   //Place the TailSigniture in the HEADER
00251   TAIL_SIGNITURE(pActual) = TAILSIGN;
00252
00253 #ifdef FINDLEAKS
00254   TRACE(L"-- IMallocSpy Alloc - 0x%08x, ID=%08lu, %lu bytes\n", USERS_OFFSET(pActual), ulID, m_cbRequest);
00255 #endif // FINDLEAKS
00256
00257   // Return the actual users buffer
00258     return USERS_OFFSET(pActual);
00259 }
00260
00261 /////////////////////////////////////////////////////////////////////////////
00262 // void* CMallocSpy::PreFree
00263 //
00264 /////////////////////////////////////////////////////////////////////////////
00265 void* CMallocSpy::PreFree(void* pRequest, BOOL fSpyed)
00266 {
00267   //pRequest is the users pointer to thier buffer, not the header
00268
00269   // Check for NULL
00270     if(pRequest == NULL)
00271         return NULL;
00272
00273     //If this memory was alloced under IMallocSpy, need to remove it
00274     if(fSpyed)
00275   {
00276     //Remove this pointer from the list
00277     RemoveFromList(pRequest);
00278
00279     void* pActual = HEADER_OFFSET(pRequest);
00280
00281     //Make sure that the head/tail signitures are intact
00282     if(HEAD_SIGNITURE(pActual) != HEADSIGN)
00283       TRACE(L"-- IMallocSpy HeadSigniture Corrupted! - 0x%08x, ID=%08lu, %lu bytes\n", pRequest, BUFFER_ID(pActual), BUFFER_LENGTH(pActual));
00284
00285     if(TAIL_SIGNITURE(pActual) != TAILSIGN)
00286       TRACE(L"-- IMallocSpy TailSigniture Corrupted! - 0x%08x, ID=%08lu, %lu bytes\n", pRequest, BUFFER_ID(pActual), BUFFER_LENGTH(pActual));
00287
00288     //Set the UsersBuffer to a known char
00289     memset(pRequest, FREESIGN, BUFFER_LENGTH(pActual));
00290
00291     //Need to return the actual header pointer to
00292     //free the entire buffer including the heading
00293     return pActual;
00294   }
00295
00296   //else
00297   return pRequest;
00298 }
00299
00300
00301 /////////////////////////////////////////////////////////////////////////////
00302 // void CMallocSpy::PostFree
00303 //
00304 /////////////////////////////////////////////////////////////////////////////
00305 void CMallocSpy::PostFree(BOOL fSpyed)
00306 {
00307     // Note the free or whatever
00308     return;
00309 }
00310
00311
00312 /////////////////////////////////////////////////////////////////////////////
00313 // ULONG CMallocSpy::PreRealloc
00314 //
00315 /////////////////////////////////////////////////////////////////////////////
00316 ULONG CMallocSpy::PreRealloc(void* pRequest, ULONG cbRequest,
00317                              void** ppNewRequest, BOOL fSpyed)
00318 {
00319   ASSERT(pRequest && ppNewRequest);
00320
00321   //If this was alloced under IMallocSpy we need to adjust
00322   //the size stored in the header
00323     if(fSpyed)
00324     {
00325     //Remove the original pRequest pointer from the list
00326     //Since Realloc could change the original pointer
00327     RemoveFromList(pRequest);
00328
00329         //Find the start
00330     *ppNewRequest = HEADER_OFFSET(pRequest);
00331
00332     //Store the new desired size
00333     m_cbRequest = cbRequest;
00334
00335     //Return the total size, including extra
00336     return (m_cbRequest + HEADERSIZE + FOOTERSIZE);
00337     }
00338
00339   //else
00340   *ppNewRequest = pRequest;
00341     return cbRequest;
00342 }
00343
00344
00345 /////////////////////////////////////////////////////////////////////////////
00346 // void* CMallocSpy::PostRealloc
00347 //
00348 /////////////////////////////////////////////////////////////////////////////
00349 void* CMallocSpy::PostRealloc(void* pActual, BOOL fSpyed)
00350 {
00351     //If this buffer was alloced under IMallocSpy
00352     if(fSpyed)
00353     {
00354     //pActual is the pointer to header
00355     //Add the new pointer to the list
00356     AddToList(USERS_OFFSET(pActual));
00357
00358     //HeadSigniture should still be intact
00359     if(HEAD_SIGNITURE(pActual) != HEADSIGN)
00360       TRACE(L"-- IMallocSpy HeadSigniture Corrupted! - 0x%08x, ID=%08lu, %lu bytes\n", USERS_OFFSET(pActual), BUFFER_ID(pActual), BUFFER_LENGTH(pActual));
00361
00362     //ID should still be intact
00363
00364     //Place the new Size in the HEADER
00365     BUFFER_LENGTH(pActual) = m_cbRequest;
00366
00367         //Need to place the tail signiture again,
00368     //since it will be over written by the realloc
00369     TAIL_SIGNITURE(pActual) = TAILSIGN;
00370
00371 #ifdef FINDLEAKS
00372     TRACE(L"-- IMallocSpy Realloc - 0x%08x, ID=%08lu, %lu bytes\n", USERS_OFFSET(pActual), BUFFER_ID(pActual), m_cbRequest);
00373 #endif // FINDLEAKS
00374
00375     //Return the actual "user" buffer
00376     return USERS_OFFSET(pActual);
00377     }
00378
00379   //else
00380     return pActual;
00381 }
00382
00383
00384 /////////////////////////////////////////////////////////////////////////////
00385 // void* CMallocSpy::PreGetSize
00386 //
00387 /////////////////////////////////////////////////////////////////////////////
00388 void* CMallocSpy::PreGetSize(void* pRequest, BOOL fSpyed)
00389 {
00390     if (fSpyed)
00391         return HEADER_OFFSET(pRequest);
00392
00393     return pRequest;
00394 }
00395
00396
00397
00398 /////////////////////////////////////////////////////////////////////////////
00399 // ULONG CMallocSpy::PostGetSize
00400 //
00401 /////////////////////////////////////////////////////////////////////////////
00402 ULONG CMallocSpy::PostGetSize(ULONG cbActual, BOOL fSpyed)
00403 {
00404     if (fSpyed)
00405         return cbActual - HEADERSIZE - FOOTERSIZE;
00406
00407     return cbActual;
00408 }
00409
00410
00411
00412
00413 /////////////////////////////////////////////////////////////////////////////
00414 // void* CMallocSpy::PreDidAlloc
00415 //
00416 /////////////////////////////////////////////////////////////////////////////
00417 void* CMallocSpy::PreDidAlloc(void* pRequest, BOOL fSpyed)
00418 {
00419     if (fSpyed)
00420         return HEADER_OFFSET(pRequest);
00421
00422   return pRequest;
00423 }
00424
00425
00426 /////////////////////////////////////////////////////////////////////////////
00427 // BOOL CMallocSpy::PostDidAlloc
00428 //
00429 /////////////////////////////////////////////////////////////////////////////
00430 BOOL CMallocSpy::PostDidAlloc(void* pRequest, BOOL fSpyed, BOOL fActual)
00431 {
00432     return fActual;
00433 }
00434
00435
00436
00437 /////////////////////////////////////////////////////////////////////////////
00438 // void CMallocSpy::PreHeapMinimize
00439 //
00440 /////////////////////////////////////////////////////////////////////////////
00441 void CMallocSpy::PreHeapMinimize()
00442 {
00443     // We don't do anything here
00444     return;
00445 }
00446
00447
00448 /////////////////////////////////////////////////////////////////////////////
00449 // void CMallocSpy::PostHeapMinimize
00450 //
00451 /////////////////////////////////////////////////////////////////////////////
00452 void CMallocSpy::PostHeapMinimize()
00453 {
00454     // We don't do anything here
00455     return;
00456 }
00457
00458 /////////////////////////////////////////////////////////////////////////////
00459 // Resgistration
00460 //
00461 /////////////////////////////////////////////////////////////////////////////
00462
00463 #ifdef _DEBUG
00464 HRESULT MallocSpyRegister(CMallocSpy** ppCMallocSpy)
00465 {
00466   ASSERT(ppCMallocSpy);
00467
00468   //Allocate Interface
00469   *ppCMallocSpy = new CMallocSpy(); //Constructor AddRef's
00470
00471   //Regisiter Interface
00472   return CoRegisterMallocSpy(*ppCMallocSpy); // Does an AddRef on Object
00473 }
00474
00475 HRESULT MallocSpyUnRegister(CMallocSpy* pCMallocSpy)
00476 {
00477   ASSERT(pCMallocSpy);
00478     delete pCMallocSpy;
00479   return CoRevokeMallocSpy(); //Does a Release on Object
00480 }
00481
00482 HRESULT MallocSpyDump(CMallocSpy* pCMallocSpy)
00483 {
00484   ASSERT(pCMallocSpy);
00485   return pCMallocSpy->DumpLeaks();
00486 }
00487
00488 #else
00489 HRESULT MallocSpyRegister(CMallocSpy** ppCMallocSpy) {  return S_OK; };
00490 HRESULT MallocSpyUnRegister(CMallocSpy* pCMallocSpy) {  return S_OK; };
00491 HRESULT MallocSpyDump(CMallocSpy* pCMallocSpy)      { return S_OK; };
00492 #endif //DEBUG
00493
00494
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/HiPerfClient/RefClint.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • HiPerfClient

RefClint.Cpp

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 ///////////////////////////////////////////////////////////////////
00003 //
00004 //  RefClint.cpp : Refresher client implementation file
00005 //
00006 //  CRefClient encapsulates the basic functionality of using a
00007 //  WMI high performance refresher.
00008 //
00009 ///////////////////////////////////////////////////////////////////
00010
00011 #include <windows.h>
00012 #include <stdio.h>
00013 #include <strsafe.h>
00014
00015 #include "RefClint.h"
00016 ///////////////////////////////////////////////////////////////////
00017 //
00018 //  Counter data
00019 //
00020 //  These structures are used as a matter of convienience and
00021 //  clarity.  A real client should enumerate the properties
00022 //  of an object in order to determine the number and names
00023 //  of the counter properties.
00024 //
00025 ///////////////////////////////////////////////////////////////////
00026
00027 // The number of counter properties for Win32_BasicHiPerf
00028
00029 enum
00030 {
00031   Ctr1,
00032   Ctr2,
00033   Ctr3,
00034   Ctr4,
00035   Ctr5,
00036   NumCtrs
00037 };
00038
00039 // The names and handles (set by SetHandles()) for a Win32_BasicHiPerf object
00040
00041 struct CCounterData
00042 {
00043   WCHAR m_wcsName[256];
00044   long  m_lHandle;
00045 } g_aCounters[] =
00046 {
00047   L"Counter1", 0,
00048   L"Counter2", 0,
00049   L"Counter3", 0,
00050   L"Counter4", 0,
00051   L"Counter5", 0,
00052 };
00053
00054
00055 ///////////////////////////////////////////////////////////////////
00056 //
00057 //  CRefClient
00058 //
00059 ///////////////////////////////////////////////////////////////////
00060
00061
00062 CRefClient::CRefClient() :
00063   m_pNameSpace(NULL), m_pRefresher(NULL), m_pConfig(NULL)
00064 {
00065 }
00066
00067 CRefClient::~CRefClient()
00068 {
00069   // Release the COM interfaces (if refresher members have not been manually
00070   // removed, the refresher destructor should do so automatically)
00071   // =======================================================================
00072
00073   if (NULL != m_pNameSpace)
00074     m_pNameSpace->Release();
00075
00076   if (NULL != m_pRefresher)
00077     m_pRefresher->Release();
00078
00079   if (NULL != m_pConfig)
00080     m_pConfig->Release();
00081 }
00082
00083 ///////////////////////////////////////////////////////////////////
00084 //
00085 //  Helper methods
00086 //
00087 ///////////////////////////////////////////////////////////////////
00088
00089 HRESULT CRefClient::SetHandles()
00090 ///////////////////////////////////////////////////////////////////
00091 //
00092 //  SetHandles will initialize the IWbemObjectAccess handle values
00093 //  in the counter array.
00094 //
00095 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00096 //  to interpret results.
00097 //
00098 ///////////////////////////////////////////////////////////////////
00099 //ok
00100 {
00101   HRESULT hRes = WBEM_NO_ERROR;
00102   IWbemClassObject* pObj = NULL;
00103   IWbemObjectAccess*  pAccess = NULL;
00104   long lIndex;
00105
00106 // Get an IWbemObjectAccess interface to one of the sample objects
00107 // ===============================================================
00108   // Create a sample object
00109   // ======================
00110   BSTR strObj = SysAllocString( cwcsObjectPath );
00111   if (strObj == NULL)
00112   {
00113     hRes = E_OUTOFMEMORY;
00114     goto cleanup;
00115   }
00116
00117   hRes = m_pNameSpace->GetObject( strObj, 0, NULL, &pObj, NULL );
00118
00119   SysFreeString( strObj );
00120
00121   if ( FAILED( hRes ) )
00122     goto cleanup;
00123
00124   // Get the alternate interface
00125   // ===========================
00126
00127   hRes = pObj->QueryInterface( IID_IWbemObjectAccess, ( LPVOID* )&pAccess );
00128
00129   if ( FAILED( hRes ) )
00130     goto cleanup;
00131
00132 // Set the access handles for all of the counter properties
00133 // ========================================================
00134
00135   for ( lIndex = Ctr1; lIndex < NumCtrs; lIndex++ )
00136   {
00137     long lHandle;
00138
00139     hRes = pAccess->GetPropertyHandle( g_aCounters[lIndex].m_wcsName, NULL, &lHandle );
00140
00141     if ( FAILED( hRes ) )
00142       goto cleanup;
00143
00144     g_aCounters[lIndex].m_lHandle = lHandle;
00145   }
00146 // Cleanup the object pointers
00147 // ===========================
00148
00149 cleanup:
00150   if ( NULL != pObj )
00151   {
00152     pObj->Release();
00153     pObj = NULL;
00154   }
00155
00156   if ( NULL != pAccess )
00157   {
00158     pAccess->Release();
00159     pAccess = NULL;
00160   }
00161
00162   if ( FAILED( hRes ) )
00163   {
00164     printf( "SetHandles() failed, 0x%x\n", hRes );
00165   }
00166
00167   return hRes;
00168 }
00169
00170 ///////////////////////////////////////////////////////////////////
00171 //
00172 //  Class method API
00173 //
00174 ///////////////////////////////////////////////////////////////////
00175
00176 HRESULT CRefClient::Initialize(IWbemServices* pNameSpace)
00177 ///////////////////////////////////////////////////////////////////
00178 //
00179 //  Initialize will create the refresher and configuration manager
00180 //  and set the IWbemObjectAccess handles which are used to access
00181 //  property values of the instances.
00182 //
00183 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00184 //  to interpret results.
00185 //
00186 ///////////////////////////////////////////////////////////////////
00187 {
00188   HRESULT hRes = WBEM_NO_ERROR;
00189
00190   // Copy the namespace pointer
00191   // ==========================
00192
00193   if ( NULL == pNameSpace )
00194     return WBEM_E_INVALID_PARAMETER;
00195
00196   //Cleanup: in case this method nas been called more than once
00197   if (m_pNameSpace != NULL)
00198     m_pNameSpace->Release();
00199   if (m_pRefresher != NULL)
00200     m_pRefresher->Release();
00201   if (m_pConfig != NULL)
00202     m_pConfig->Release();
00203
00204   m_pNameSpace = pNameSpace;
00205   m_pNameSpace->AddRef();
00206
00207   // Create the refresher and refresher manager
00208   // ==========================================
00209
00210   hRes = CoCreateInstance( CLSID_WbemRefresher,
00211                NULL,
00212                CLSCTX_INPROC_SERVER,
00213                IID_IWbemRefresher,
00214                (void**) &m_pRefresher );
00215   if ( FAILED( hRes ) )
00216     return hRes;
00217
00218   hRes = m_pRefresher->QueryInterface( IID_IWbemConfigureRefresher,
00219                      (void**) &m_pConfig );
00220   if ( FAILED( hRes ) )
00221   {
00222     m_pRefresher->Release();
00223     return hRes;
00224   }
00225
00226   // Set the access handles
00227   // ======================
00228
00229   hRes = SetHandles();
00230
00231   return hRes;
00232 }
00233
00234 HRESULT CRefClient::AddObjects()
00235 ///////////////////////////////////////////////////////////////////
00236 //
00237 //  AddObject will add a set of objects to the refresher.  The
00238 //  method will update m_aInstances with the instance data.
00239 //
00240 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00241 //  to interpret results.
00242 //
00243 ///////////////////////////////////////////////////////////////////
00244 //ok
00245 {
00246   HRESULT hRes = WBEM_NO_ERROR;
00247
00248   long  lIndex = 0;
00249   WCHAR wcsObjName[MAX_PATH + 50];
00250
00251 // Loop through all instances of Win32_BasicHiPerf and add them to the refresher
00252 // =============================================================================
00253
00254   for ( lIndex = 0; lIndex < clNumInstances; lIndex++ )
00255   {
00256     IWbemClassObject* pObj = NULL;
00257     IWbemObjectAccess*  pAccess = NULL;
00258     long lID;
00259
00260     // Set the object path (e.g. Win32_BasicHiPerf=1)
00261     // ==============================================
00262
00263     StringCbPrintfW(wcsObjName, sizeof(wcsObjName), L"%s=%i", cwcsObjectPath, lIndex );
00264
00265     // Add the object
00266     // ==============
00267
00268     hRes = m_pConfig->AddObjectByPath( m_pNameSpace, wcsObjName, 0, NULL, &pObj, &lID );
00269
00270     if ( FAILED( hRes ) )
00271     {
00272       printf( "AddObjectByPath() failed, 0x%x\n", hRes );
00273       return hRes;
00274     }
00275
00276     // Save the IWbemObjectAccess interface
00277     // ====================================
00278
00279     hRes = pObj->QueryInterface( IID_IWbemObjectAccess, (void**) &pAccess );
00280
00281     pObj->Release();
00282
00283     m_Instances[lIndex].Set(pAccess, lID);
00284
00285     // Set does it's own AddRef()
00286     // ==========================
00287
00288     pAccess->Release();
00289   }
00290
00291   return hRes;
00292 }
00293
00294 HRESULT CRefClient::RemoveObjects()
00295 ///////////////////////////////////////////////////////////////////
00296 //
00297 //  RemoveObjects calls Remove() on the refresher's configuration
00298 //  manager to remove all of the objects from the refresher.
00299 //
00300 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00301 //  to interpret results.
00302 //
00303 ///////////////////////////////////////////////////////////////////
00304 {
00305   HRESULT hRes = WBEM_NO_ERROR;
00306
00307   long lInstance = 0;
00308
00309   // Remove the instances
00310   // ====================
00311
00312   if (m_pConfig)
00313   {
00314     for ( lInstance = 0; lInstance < clNumInstances; lInstance++ )
00315     {
00316       m_pConfig->Remove( m_Instances[lInstance].GetID(), 0L );
00317       m_Instances[lInstance].Reset();
00318     }
00319   }
00320
00321   return hRes;
00322 }
00323
00324 HRESULT CRefClient::ShowObjectData()
00325 ///////////////////////////////////////////////////////////////////
00326 //
00327 //  ShowInstanceData will output all of the counter data for all
00328 //  of the instances within the refresher.
00329 //
00330 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00331 //  to interpret results.
00332 //
00333 ///////////////////////////////////////////////////////////////////
00334 {
00335   HRESULT hRes = WBEM_NO_ERROR;
00336
00337   long lInstance;
00338   long lCounter;
00339
00340 // Cycle through all of the instances and print all the counter data
00341 // =================================================================
00342
00343   // Instance loop
00344   // =============
00345
00346   for (lInstance = 0; lInstance < clNumInstances; lInstance++)
00347   {
00348     printf("  Instance %i:\n", lInstance);
00349
00350     // Counter loop
00351     // ============
00352
00353     for (lCounter = Ctr1; lCounter < NumCtrs; lCounter++)
00354     {
00355       DWORD dwVal;
00356       IWbemObjectAccess* pAccess = m_Instances[lInstance].GetMember();
00357
00358       // Read the counter property value using the high performance IWbemObjectAccess->ReadDWORD().
00359       // NOTE: Remember to never to this while a refresh is in process!
00360       // ==========================================================================================
00361
00362       hRes = pAccess->ReadDWORD( g_aCounters[lCounter].m_lHandle, &dwVal);
00363       if (FAILED(hRes))
00364       {
00365         pAccess->Release();
00366
00367         printf("ShowInstanceData() failed, 0x%x", hRes);
00368         return hRes;
00369       }
00370
00371       printf("    %i ", dwVal);
00372
00373       pAccess->Release();
00374     }
00375
00376     printf("\n");
00377   }
00378
00379   return hRes;
00380 }
00381
00382 HRESULT CRefClient::AddEnum()
00383 ///////////////////////////////////////////////////////////////////
00384 //
00385 //  AddEnum will add an enumerator to the refresher.  The
00386 //  function will return a status code.  The enumerator class member
00387 //  will updated.
00388 //
00389 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00390 //  to interpret results.
00391 //
00392 ///////////////////////////////////////////////////////////////////
00393 //ok
00394 {
00395   HRESULT hRes = WBEM_NO_ERROR;
00396
00397   IWbemHiPerfEnum*  pEnum = NULL;
00398   long lID;
00399
00400 // Add an enumerator to the refresher
00401 // ==================================
00402
00403   hRes = m_pConfig->AddEnum( m_pNameSpace, cwcsObjectPath, 0, NULL, &pEnum, &lID );
00404
00405   if ( FAILED(hRes))
00406   {
00407     printf( "AddEnum() failed, 0x%x\n", hRes );
00408   }
00409
00410   if (pEnum)
00411   {
00412     m_Enum.Set(pEnum, lID);
00413     // Set does it's own AddRef
00414
00415     pEnum->Release();
00416   }
00417
00418
00419   return hRes;
00420 }
00421
00422 HRESULT CRefClient::RemoveEnum()
00423 ///////////////////////////////////////////////////////////////////
00424 //
00425 //  RemoveEnum calls Remove() on the refresher's configuration
00426 //  manager to remove the enumerator from the refresher.
00427 //
00428 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00429 //  to interpret results.
00430 //
00431 ///////////////////////////////////////////////////////////////////
00432 {
00433   HRESULT hRes = WBEM_NO_ERROR;
00434   // Remove the enumerator
00435   // =====================
00436   if ( m_pConfig)
00437   {
00438     hRes = m_pConfig->Remove( m_Enum.GetID(), 0L );
00439   }
00440   m_Enum.Reset();
00441
00442
00443   return hRes;
00444 }
00445
00446 HRESULT CRefClient::ShowEnumeratorData()
00447 ///////////////////////////////////////////////////////////////////
00448 //
00449 //  ShowEnumeratorData will output the number of instances within
00450 //  an enumerator.  Property values from the instances may obtained
00451 //  using the standard WMI methods.
00452 //
00453 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00454 //  to interpret results.
00455 /////////////////////////////////////////////////////////////////////
00456 {
00457   HRESULT hRes = WBEM_NO_ERROR;
00458
00459   DWORD dwNumReturned = clNumInstances;
00460   DWORD dwNumObjects = 0;
00461
00462   IWbemObjectAccess** apEnumAccess = NULL;
00463
00464   IWbemHiPerfEnum*  pEnum = m_Enum.GetMember();
00465   if (pEnum == NULL)
00466   {
00467         return WBEM_E_FAILED;
00468   }
00469 // Fetch the instances from the enumerator
00470 // =======================================
00471
00472   // Try to get the instances from the enumerator
00473   // ============================================
00474
00475   hRes = pEnum->GetObjects( 0L, dwNumObjects, apEnumAccess, &dwNumReturned );
00476
00477   // Is the buffer too small?
00478   // ========================
00479
00480   if ( WBEM_E_BUFFER_TOO_SMALL == hRes )
00481   {
00482     // Increase the buffer size
00483     // ========================
00484
00485     delete [] apEnumAccess;
00486
00487     apEnumAccess = new IWbemObjectAccess*[dwNumReturned];
00488     dwNumObjects = dwNumReturned;
00489     memset( apEnumAccess, 0, sizeof( apEnumAccess ));
00490
00491     if ( NULL != apEnumAccess )
00492     {
00493       hRes = pEnum->GetObjects( 0L, dwNumObjects, apEnumAccess, &dwNumReturned );
00494     }
00495     else
00496     {
00497       hRes = WBEM_E_OUT_OF_MEMORY;
00498     }
00499
00500   }
00501
00502   // Print the result
00503   // ================
00504
00505   if ( SUCCEEDED( hRes ) )
00506   {
00507     printf( "\tThe enumerator returned %i instances\n", dwNumReturned );
00508   }
00509   else
00510   {
00511     printf( "ShowEnumeratorData failed, 0x%x\n", hRes );
00512   }
00513
00514   // Release the objects from the enumerator's object array
00515   // ======================================================
00516
00517   for ( DWORD nCtr = 0; nCtr < dwNumReturned; nCtr++ )
00518   {
00519     if (NULL != apEnumAccess[nCtr])
00520     {
00521       apEnumAccess[nCtr]->Release();
00522       apEnumAccess[nCtr] = NULL;
00523     }
00524   }
00525
00526   if ( NULL != apEnumAccess )
00527     delete [] apEnumAccess;
00528
00529   pEnum->Release();
00530
00531   return hRes;
00532 }
00533
00534 HRESULT CRefClient::Refresh()
00535 ///////////////////////////////////////////////////////////////////
00536 //
00537 //  Refresh simply calls the IWbemRefresher->Refresh() method to
00538 //  update all members of the refresher.
00539 //
00540 //  Returns a status code. Use the SUCCEEDED() and FAILED() macros
00541 //  to interpret results.
00542 //
00543 ///////////////////////////////////////////////////////////////////
00544 {
00545   return m_pRefresher->Refresh( 0L );
00546 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCustomError Member List

This is the complete list of members for CCustomError, including all inherited members.
AutoQI(DWORD dwCreateOpts) | CCustomError | [virtual]
AutoRelease() | CCustomError | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CCustomError(CMainWindow *pCMainwindow) | CCustomError |
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CCustomError | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CCustomError | [virtual]
GetObjectDesc() | CCustomError | [virtual]
GetObjectImage() | CCustomError | [inline, virtual]
GetObjectMenu() | CCustomError | [inline, virtual]
GetObjectName() | CCustomError | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
GetSQLInfo(BSTR *pbstrSQLState, LONG *plNativeError) | CCustomError | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIService | CBase |
m_pISQLErrorInfo | CCustomError |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
~CBase() | CBase | [virtual]
~CCustomError() | CCustomError | [virtual]
Generated on Wed Nov 13 2024 16:55:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/perfile.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

perfile.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          PerFile.cpp
00021
00022   Description:   CPersistFile implementation.
00023
00024 **************************************************************************/
00025
00026 /**************************************************************************
00027 #include statements
00028 **************************************************************************/
00029
00030 #include "PerFile.h"
00031
00032 /**************************************************************************
00033
00034   CPersistFile::CPersistFile()
00035
00036 **************************************************************************/
00037
00038 CPersistFile::CPersistFile(COleDocument *pOleDoc, CPersistStorage *pPersistStorage)
00039 {
00040   OutputDebugString(TEXT("CPersistFile's constructor\n"));
00041
00042   m_pOleDoc = pOleDoc;
00043
00044   m_pPersistStorage = pPersistStorage;
00045
00046   m_pStorage = NULL;
00047
00048   m_pwszFile = new OLECHAR[MAX_PATH];
00049 }
00050
00051 /**************************************************************************
00052
00053   CPersistFile::~CPersistFile()
00054
00055 **************************************************************************/
00056
00057 CPersistFile::~CPersistFile()
00058 {
00059   OutputDebugString(TEXT("CPersistFile's destructor\n"));
00060
00061   if(m_pStorage)
00062     m_pStorage->Release();
00063
00064   delete m_pwszFile;
00065 }
00066
00067 /**************************************************************************
00068
00069   CPersistFile::QueryInterface()
00070
00071 **************************************************************************/
00072
00073 STDMETHODIMP CPersistFile::QueryInterface(REFIID riid, LPVOID *ppReturn)
00074 {
00075   OutputDebugString(TEXT("CPersistFile::QueryInterface\n"));
00076
00077   return m_pOleDoc->QueryInterface(riid, ppReturn);
00078 }
00079
00080 /**************************************************************************
00081
00082   CPersistFile::AddRef()
00083
00084 **************************************************************************/
00085
00086 STDMETHODIMP_(ULONG) CPersistFile::AddRef()
00087 {
00088   OutputDebugString(TEXT("CPersistFile::AddRef\n"));
00089
00090   return m_pOleDoc->AddRef();
00091 }
00092
00093 /**************************************************************************
00094
00095   CPersistFile::Release()
00096
00097 **************************************************************************/
00098
00099 STDMETHODIMP_(ULONG) CPersistFile::Release()
00100 {
00101   OutputDebugString(TEXT("CPersistFile::Release\n"));
00102
00103   return m_pOleDoc->Release();
00104 }
00105
00106 /**************************************************************************
00107
00108   CPersistFile::GetClassID()
00109
00110 **************************************************************************/
00111
00112 STDMETHODIMP CPersistFile::GetClassID(LPCLSID pClassID)
00113 {
00114   OutputDebugString(TEXT("CPersistFile::GetClassID\n"));
00115
00116   return m_pPersistStorage->GetClassID(pClassID);
00117 }
00118
00119 /**************************************************************************
00120
00121   CPersistFile::Save()
00122
00123 **************************************************************************/
00124
00125 STDMETHODIMP CPersistFile::Save(LPCOLESTR pwszFile, BOOL fRemember)
00126 {
00127   OutputDebugString(TEXT("CPersistFile::Save\n"));
00128
00129   if(!pwszFile)
00130     return E_INVALIDARG;
00131
00132   HRESULT     hr = E_FAIL;  // Assume failure
00133
00134                 /*
00135                 Only create a new storage if we don't already have a storage or the file name
00136                 has changed.
00137   */
00138   if(!m_pStorage || (0 != lstrcmpiW(pwszFile, m_pwszFile)))
00139   {
00140     //if we have a storage, release it
00141     if(m_pStorage)
00142     {
00143       m_pPersistStorage->ReleaseStreamsAndStorage();
00144       m_pStorage->Release();
00145       m_pStorage = NULL;
00146       *m_pwszFile = 0;
00147     }
00148
00149     //open the file as storage
00150     hr = StgCreateDocfile(  pwszFile,
00151       STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
00152       0,
00153       &m_pStorage);
00154
00155   }
00156
00157
00158
00159   if(m_pStorage)
00160   {
00161     hr = m_pPersistStorage->Save(m_pStorage, FALSE);
00162   }
00163
00164
00165   if(fRemember)
00166   {
00167     lstrcpynW(m_pwszFile, pwszFile, MAX_PATH);
00168   }
00169   else
00170   {
00171     m_pPersistStorage->ReleaseStreamsAndStorage();
00172     m_pStorage->Release();
00173     m_pStorage = NULL;
00174     *m_pwszFile = 0;
00175   }
00176
00177   return hr;
00178 }
00179
00180 /**************************************************************************
00181
00182   CPersistFile::SaveCompleted()
00183
00184 **************************************************************************/
00185
00186 STDMETHODIMP CPersistFile::SaveCompleted(LPCOLESTR pwszFile)
00187 {
00188   UNREFERENCED_PARAMETER(pwszFile);
00189   OutputDebugString(TEXT("CPersistFile::SaveCompleted\n"));
00190
00191   return m_pPersistStorage->SaveCompleted(NULL);
00192 }
00193
00194 /**************************************************************************
00195
00196   CPersistFile::Load()
00197
00198 **************************************************************************/
00199
00200 STDMETHODIMP CPersistFile::Load(LPCOLESTR pwszFile, DWORD dwMode)
00201 {
00202   OutputDebugString(TEXT("CPersistFile::Load\n"));
00203
00204   HRESULT     hr;
00205
00206   if(!pwszFile)
00207     return E_INVALIDARG;
00208
00209   //close any existing storage we might have
00210   if(m_pStorage)
00211   {
00212     m_pPersistStorage->ReleaseStreamsAndStorage();
00213     m_pStorage->Release();
00214     m_pStorage = NULL;
00215     *m_pwszFile = 0;
00216   }
00217
00218   //open the file as storage and load it
00219   hr = StgOpenStorage(    pwszFile,
00220     NULL,
00221     dwMode | STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE,
00222     NULL,
00223     0,
00224     &m_pStorage);
00225
00226   if(m_pStorage)
00227   {
00228     hr = m_pPersistStorage->Load(m_pStorage);
00229   }
00230   else
00231   {
00232     hr = E_FAIL;
00233   }
00234
00235   if(SUCCEEDED(hr))
00236     lstrcpynW(m_pwszFile, pwszFile, MAX_PATH);
00237
00238   return hr;
00239 }
00240
00241 /**************************************************************************
00242
00243   CPersistFile::IsDirty()
00244
00245 **************************************************************************/
00246
00247 STDMETHODIMP CPersistFile::IsDirty()
00248 {
00249   OutputDebugString(TEXT("CPersistFile::IsDirty\n"));
00250
00251   return m_pPersistStorage->IsDirty();
00252 }
00253
00254 /**************************************************************************
00255
00256   CPersistFile::GetCurFile()
00257
00258 **************************************************************************/
00259
00260 STDMETHODIMP CPersistFile::GetCurFile(LPOLESTR *ppwszOut)
00261 {
00262   OutputDebugString(TEXT("CPersistFile::GetCurFile\n"));
00263
00264   HRESULT  hr = E_FAIL;
00265
00266   *ppwszOut = NULL;
00267
00268   LPMALLOC pMalloc;
00269   CoGetMalloc(1, &pMalloc);
00270   if(pMalloc)
00271   {
00272     if(*m_pwszFile)
00273     {
00274       *ppwszOut = (LPOLESTR)pMalloc->Alloc(lstrlenW(m_pwszFile) + sizeof(OLECHAR));
00275       if(*ppwszOut)
00276       {
00277         lstrcpynW(*ppwszOut, m_pwszFile, (lstrlenW(m_pwszFile) + sizeof(OLECHAR))/
00278           sizeof(OLECHAR));
00279         hr = S_OK;
00280       }
00281     }
00282     else
00283     {
00284       *ppwszOut = (LPOLESTR)pMalloc->Alloc(lstrlenW(DEFAULT_PROMPT) + sizeof(OLECHAR));
00285       if(*ppwszOut)
00286       {
00287         lstrcpynW(*ppwszOut, DEFAULT_PROMPT, (lstrlenW(DEFAULT_PROMPT) + sizeof(OLECHAR))/
00288           sizeof(OLECHAR));
00289         hr = S_FALSE;
00290       }
00291     }
00292
00293     pMalloc->Release();
00294   }
00295
00296   return hr;
00297 }
00298
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/instancesub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

instancesub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __INSTANCESUB_H__
00018 #define __INSTANCESUB_H__
00019
00020 #include "resource.h"       // main symbols
00021
00022 CComBSTR GuidToBstr(REFGUID guid);
00023
00024 class CComSpy;
00025
00026 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00027 Class:   CInstanceSub
00028 Summary: Instance Events Subscriber
00029 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00030 class ATL_NO_VTABLE CInstanceSub :
00031   public CSysLCESub,
00032   public IComInstanceEvents
00033 {
00034 public:
00035   CInstanceSub(CComSpy * pSpy)
00036   {
00037     m_pSpy = pSpy;
00038   }
00039
00040   CInstanceSub()
00041   {
00042     m_pSpy = NULL;
00043   }
00044
00045   DECLARE_NOT_AGGREGATABLE(CInstanceSub)
00046   DECLARE_GET_CONTROLLING_UNKNOWN()
00047
00048   BEGIN_COM_MAP(CInstanceSub)
00049     COM_INTERFACE_ENTRY(IComInstanceEvents)
00050     COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00051   END_COM_MAP()
00052
00053   STDMETHODIMP GetEventType(EventEnum * e){*e = Instance;return S_OK;}
00054   STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00055   STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComInstanceEvents;return S_OK;}
00056
00057   STDMETHODIMP OnObjectCreate(COMSVCSEVENTINFO * pInfo, REFGUID guidActivity, REFCLSID clsid, REFGUID tsid, ULONG64 CtxtID, ULONG64 ObjectID)
00058   {
00059
00060     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnObjectCreate"), GuidToBstr(pInfo->guidApp));
00061
00062     CComBSTR sGuidActivity = GuidToBstr(guidActivity);
00063     CComBSTR sClsid = GuidToBstr(clsid);
00064     CComBSTR sTsid = GuidToBstr(tsid);
00065
00066     m_pSpy -> AddParamValueToList(L"guidActivity", sGuidActivity);
00067     m_pSpy -> AddParamValueToList(L"clsid", sClsid);
00068     m_pSpy -> AddParamValueToList(L"tsid", sTsid);
00069
00070     WCHAR szCtxtID[32];
00071     wsprintfW(szCtxtID,L"0x%016X", CtxtID);
00072     m_pSpy -> AddParamValueToList(L"CtxtID", szCtxtID);
00073
00074     WCHAR szObjectID[32];
00075     wsprintfW(szObjectID,L"0x%016X", ObjectID);
00076     m_pSpy -> AddParamValueToList(L"ObjectID", szObjectID);
00077
00078
00079
00080     IF_AUDIT_DO(OnObjectCreate)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00081                   sGuidActivity,
00082                   sClsid,
00083                   sTsid,
00084                   szCtxtID,
00085                   szObjectID);
00086
00087     return S_OK;
00088   }
00089
00090   STDMETHODIMP OnObjectDestroy(COMSVCSEVENTINFO * pInfo, ULONG64 CtxtID)
00091   {
00092     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnObjectDestroy"),  GuidToBstr(pInfo->guidApp));
00093
00094     WCHAR szCtxtID[32];
00095     wsprintfW(szCtxtID,L"0x%016X", CtxtID);
00096     m_pSpy -> AddParamValueToList(L"CtxtID", szCtxtID);
00097
00098     IF_AUDIT_DO(OnObjectDestroy)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),
00099                    szCtxtID);
00100
00101     return S_OK;
00102   }
00103
00104 };
00105
00106 #endif //__INSTANCESUB_H__
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/statnode.h Source File

  • SysMgmt
  • MMC
  • WMI

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038
00039 public:
00040     // virtual functions go here (for MMCN_*)
00041     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00042
00043 private:
00044     enum { NUMBER_OF_CHILDREN = 4 };
00045     CDelegationBase *children[NUMBER_OF_CHILDREN];
00046
00047     // {2974380C-4C4B-11d2-89D8-000021473128}
00048     static const GUID thisGuid;
00049 };
00050
00051
00052
00053 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims15/C#/AssemblyInfo.cs Source File

  • TabletPC
  • AutoClaims15
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("Auto Claims Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2003 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/plgtermfilter.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

plgtermfilter.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     PlgTstFilter.h
00008
00009 Abstract:
00010
00011     Declaration of the Plg Filter class (CPlgFilter)
00012
00013 --*/
00014
00015 #ifndef __PLGFILTER__
00016 #define __PLGFILTER__
00017
00018 #if _MSC_VER > 1000
00019 #pragma once
00020 #endif // _MSC_VER > 1000
00021
00022 #include "PlgTermPriv.h"
00023
00024 #include "stdafx.h"
00025 #include <streams.h>        // DShow streams
00026
00027 class CPlgPin;
00028
00029 class CPlgFilter :
00030     public CBaseFilter,
00031     public CCritSec
00032 {
00033
00034 public:
00035
00036     // --- IUnknown ---
00037     DECLARE_IUNKNOWN
00038
00039     // --- CBaseFilter ---
00040     virtual int GetPinCount();
00041     CBasePin * GetPin(int nIndex);
00042
00043     // --- CBaseStreamControl ---
00044     STDMETHODIMP Run(REFERENCE_TIME tStart);
00045     STDMETHODIMP Pause(void);
00046     STDMETHODIMP Stop(void);
00047
00048     STDMETHOD (Initialize)( );
00049
00050 public:
00051
00052     // --- Constructor / Desctructor ---
00053     CPlgFilter();
00054     ~CPlgFilter();
00055
00056     HRESULT InitializePrivate(ITPlgPrivEventSink* pSink );
00057
00058 private:
00059     // --- Helper functions ---
00060
00061     // Create the input pin
00062     HRESULT CreatePin( );
00063
00064     // --- Members ---
00065
00066     // The input pin
00067     CPlgPin  *m_pInputPin;
00068
00069     // The waveformat supported
00070     LPWAVEFORMATEX m_lpWaveFormatEx;
00071
00072   ITPlgPrivEventSink*   m_pPlgEventSink;
00073
00074     friend class CPlgPin;
00075 };
00076
00077 #endif // __PLGFILTER__
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMScBuf.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

MMScBuf.Hxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       mmscbuf.hxx
00006 //
00007 //  Contents:   Memory Mapped Stream buffer for consecutive buffer mapping
00008 //
00009 //  Classes:    CMmStreamConsecBuf
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #if !defined __MMSCBUF_HXX__
00015 #define __MMSCBUF_HXX__
00016
00017 #include <pmmstrm.hxx>
00018
00019 //+---------------------------------------------------------------------------
00020 //
00021 //  Class:      CMmStreamConsecBuf
00022 //
00023 //  Purpose:    Memory Mapped Stream Buffer for consecutive buffer mapping
00024 //
00025 //
00026 //----------------------------------------------------------------------------
00027 class CMmStreamConsecBuf: public CMmStreamBuf
00028 {
00029 public:
00030
00031     CMmStreamConsecBuf();
00032
00033     void Init( PMmStream * pMmStream );
00034
00035     void Map ( ULONG cb );
00036
00037     void Rewind ();
00038
00039     BOOL Eof();
00040
00041 private:
00042
00043     PMmStream *     _pMmStream;
00044     LARGE_INTEGER   _liOffset;
00045 };
00046
00047 #endif
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPStat/IPStat.h Source File

  • NetDS
  • IPHelp
  • IPStat

IPStat.h

Go to the documentation of this file.
00001 #ifndef _IPSTAT_H
00002 #define _IPSTAT_H
00003
00004 #include <windows.h>
00005 #include <winsock.h>
00006 #include <iphlpapi.h>
00007 #include <assert.h>
00008 #include <stdlib.h>
00009 #include <malloc.h>
00010 #include <stdio.h>
00011 #include <string.h>
00012 #include <limits.h>
00013 #include <iptypes.h>
00014
00015
00016
00017 #define MAX_STRLEN        128    /* general max string length */
00018
00019 void DoGetConnTable(char* pszProto);
00020 void DoGetStat(char* pszProto = NULL);
00021
00022 void DumpTcpTable(PMIB_TCPTABLE pTcpTable);
00023 void DumpUdpTable(PMIB_UDPTABLE pUdpTable);
00024
00025 DWORD MyGetTcpTable(PMIB_TCPTABLE& pTcpTable, BOOL fOrder = FALSE);
00026 DWORD MyGetUdpTable(PMIB_UDPTABLE& pUdpTable, BOOL fOrder = FALSE);
00027
00028 DWORD MyGetIpStatistics(PMIB_IPSTATS& pIpStats);
00029 DWORD MyGetIcmpStatistics(PMIB_ICMP& pIcmpStats);
00030 DWORD MyGetTcpStatistics(PMIB_TCPSTATS& pTcpStats);
00031 DWORD MyGetUdpStatistics(PMIB_UDPSTATS& pUdpStats);
00032
00033 void PrintIpStats(PMIB_IPSTATS pStats);
00034 void PrintIcmpStats(MIBICMPINFO *pStats);
00035 void PrintTcpStats(PMIB_TCPSTATS pStats);
00036 void PrintUdpStats(PMIB_UDPSTATS pStats);
00037
00038 #endif // _IPSTAT_H
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/IpxChat/Connect.c Source File

  • NetDS
  • WinSock
  • IpxChat

Connect.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   connect.c
00009 //
00010 //  PURPOSE:   Displays the "Connect" dialog box
00011 //
00012 //  FUNCTIONS:
00013 //    CmdConnect        - Displays the "Connect" dialog box
00014 //    Connect           - Processes messages for "Connect" dialog box.
00015 //    MsgConnectInit    - Initializes edit controls
00016 //    MsgConnectCommand - Process WM_COMMAND message sent to the connect box.
00017 //    CmdConnectDone    - Free the connect box and related data.
00018 //    CmdConnectNow     - Establishes connection to specified address. Kills
00019 //                        dialog if successful.
00020 //
00021 //  COMMENTS:
00022 //
00023 //
00024 #include "globals.h"            // prototypes specific to this application
00025 #include <windows.h>            // required for all Windows applications
00026 #include <windowsx.h>
00027 #include <stdlib.h>
00028 #include <stdio.h>
00029
00030
00031 //   Function Definitions
00032
00033
00034 LRESULT CALLBACK Connect(HWND, UINT, WPARAM, LPARAM);
00035 LRESULT MsgConnectInit(HWND, UINT, WPARAM, LPARAM);
00036 LRESULT MsgConnectCommand(HWND, UINT, WPARAM, LPARAM);
00037 LRESULT CmdConnectNow(HWND, WORD, WORD, HWND);
00038 LRESULT CmdConnectDone(HWND, WORD, WORD, HWND);
00039
00040 // Connect dialog message table definition.
00041 MSD rgmsdConnect[] =
00042 {
00043     {WM_COMMAND,    MsgConnectCommand},
00044     {WM_INITDIALOG, MsgConnectInit}
00045 };
00046
00047 MSDI msdiConnect =
00048 {
00049     sizeof(rgmsdConnect) / sizeof(MSD),
00050     rgmsdConnect,
00051     edwpNone
00052 };
00053
00054 // Connect dialog command table definition.
00055 CMD rgcmdConnect[] =
00056 {
00057     {IDOK,     CmdConnectNow},
00058     {IDCANCEL, CmdConnectDone}
00059 };
00060
00061 CMDI cmdiConnect =
00062 {
00063     sizeof(rgcmdConnect) / sizeof(CMD),
00064     rgcmdConnect,
00065     edwpNone
00066 };
00067
00068 // Module specific "globals"  Used when a variable needs to be
00069 // accessed in more than one handler function.
00070
00071 HFONT hfontDlg;
00072
00073 //
00074 //  FUNCTION: CmdConnect(HWND, WORD, WORD, HWND)
00075 //
00076 //  PURPOSE: Displays the "Connect" dialog box
00077 //
00078 //  PARAMETERS:
00079 //    hwnd      - Window handle
00080 //    wCommand  - IDM_CONNECT (unused)
00081 //    wNotify   - Notification number (unused)
00082 //    hwndCtrl  - NULL (unused)
00083 //
00084 //  RETURN VALUE:
00085 //
00086 //    Always returns 0 - Message handled
00087 //
00088 //  COMMENTS:
00089 //    To process the IDM_CONNECT message, call DialogBox() to display the
00090 //    Connect dialog box.
00091
00092 LRESULT CmdConnect(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00093 {
00094     HMENU hmenu = NULL;
00095
00096     if(FALSE == SetWindowText(hwnd, "IPX Chat Client"))    // Change Window Title
00097         return 1;
00098
00099     // Start dialog box
00100     if(DialogBox(hInst, "ConnectBox", hwnd, (DLGPROC)Connect))
00101     {
00102
00103         // We have a connection!  Set up message notification if
00104         // data ready to be read or if connection is closed on us
00105         if (WSAAsyncSelect(sock,
00106                            hwnd,
00107                            MW_DATAREADY,
00108                            FD_READ | FD_CLOSE) == SOCKET_ERROR)
00109         {
00110             MessageBox(hwnd, "WSAAsyncSelect Failed!", NULL, MB_OK);
00111             CleanUp();
00112             return 0;
00113         }
00114
00115         // Connect has succeeded!  Fix menus
00116         if(NULL == (hmenu = GetMenu(hwnd)))
00117             return 1;
00118         if(FALSE == EnableMenuItem(hmenu, IDM_CONNECT, MF_GRAYED))
00119             return 1;
00120         if(FALSE == EnableMenuItem(hmenu, IDM_LISTEN, MF_GRAYED))
00121             return 1;
00122         if(FALSE == EnableMenuItem(hmenu, IDM_DISCONNECT, MF_ENABLED))
00123             return 1;
00124
00125         return 0;
00126     }
00127
00128     // Connection failed - reset window title
00129     if(FALSE == SetWindowText(hwnd, szTitle))
00130         return 1;
00131
00132     return 0;
00133 }
00134
00135
00136 //
00137 //  FUNCTION: Connect(HWND, UINT, WPARAM, LPARAM)
00138 //
00139 //  PURPOSE:  Processes messages for "Connect" dialog box.
00140 //
00141 //  PARAMETERS:
00142 //    hdlg - window handle of the dialog box
00143 //    wMessage - type of message
00144 //    wparam - message-specific information
00145 //    lparam - message-specific information
00146 //
00147 //  RETURN VALUE:
00148 //    TRUE - message handled
00149 //    FALSE - message not handled
00150 //
00151 //  COMMENTS:
00152 //
00153 //     Gets connection information from user and then establishes a connection.
00154 //
00155 //     Connect when user clicks on the OK button.  Kill Dialog when connection
00156 //     established.
00157 //
00158
00159 LRESULT CALLBACK Connect(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
00160 {
00161     return DispMessage(&msdiConnect, hdlg, uMessage, wparam, lparam);
00162 }
00163
00164
00165 //
00166 //  FUNCTION: MsgConnectInit(HWND, UINT, WPARAM, LPARAM)
00167 //
00168 //  PURPOSE: To center dialog and limit size of edit controls
00169 //
00170 //  PARAMETERS:
00171 //    hdlg - The window handing the message.
00172 //    uMessage - The message number. (unused).
00173 //    wparam - Message specific data (unused).
00174 //    lparam - Message specific data (unused).
00175 //
00176 //  RETURN VALUE:
00177 //    Always returns 0 - message handled.
00178 //
00179 //  COMMENTS:
00180 //    Set size of edit controls for the following
00181 //           Network  8  chars (4 2-digit hex numbers)
00182 //           Node     12 chars (6 2-digit hex numbers)
00183 //           Socket   4  chars (2 2-digit hex numbers)
00184 //
00185
00186 LRESULT MsgConnectInit(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
00187 {
00188
00189     // Create a font to use
00190     if(NULL == (hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00191                           VARIABLE_PITCH | FF_SWISS, "")))
00192         return FALSE;
00193
00194     // Center the dialog over the application window
00195     CenterWindow (hdlg, GetWindow (hdlg, GW_OWNER));
00196
00197     // Limit size of edit controls
00198     SendDlgItemMessage(hdlg, CD_NETWORK, EM_LIMITTEXT, 8, 0);
00199     SendDlgItemMessage(hdlg, CD_NODE, EM_LIMITTEXT, 12, 0);
00200     SendDlgItemMessage(hdlg, CD_SOCKET, EM_LIMITTEXT, 4, 0);
00201
00202     // Initialize Edit Controls
00203     if(FALSE == SetDlgItemText(hdlg, CD_NETWORK, szConnectNetwork))
00204         return FALSE;
00205     if(FALSE == SetDlgItemText(hdlg, CD_NODE, szConnectNode))
00206         return FALSE;
00207     if(FALSE == SetDlgItemText(hdlg, CD_SOCKET, szConnectSocket))
00208         return FALSE;
00209
00210     return TRUE;
00211 }
00212
00213 //
00214 //  FUNCTION: MsgConnectCommand(HWND, UINT, WPARAM, LPARAM)
00215 //
00216 //  PURPOSE: Process WM_COMMAND message sent to the Connect box.
00217 //
00218 //  PARAMETERS:
00219 //    hwnd - The window handing the message.
00220 //    uMessage - The message number. (unused).
00221 //    wparam - Message specific data (unused).
00222 //    lparam - Message specific data (unused).
00223 //
00224 //  RETURN VALUE:
00225 //    Always returns 0 - message handled.
00226 //
00227 //  COMMENTS:
00228 //    Uses this DispCommand function defined in wndproc.c combined
00229 //    with the cmdiConnect structure defined in this file to handle
00230 //    the command messages for the Connect dialog box.
00231 //
00232
00233 LRESULT MsgConnectCommand(HWND   hwnd,
00234                         UINT   uMessage,
00235                         WPARAM wparam,
00236                         LPARAM lparam)
00237 {
00238     return DispCommand(&cmdiConnect, hwnd, wparam, lparam);
00239 }
00240
00241 //
00242 //  FUNCTION: CmdConnectDone(HWND, WORD, HWND)
00243 //
00244 //  PURPOSE: Free the Connect box and related data.
00245 //
00246 //  PARAMETERS:
00247 //    hdlg - The window handling the command.
00248 //    wCommand - The command to be handled (unused).
00249 //    wNotify   - Notification number (unused)
00250 //    hwndCtrl - NULL (unused).
00251 //
00252 //  RETURN VALUE:
00253 //    Always returns TRUE.
00254 //
00255 //  COMMENTS:
00256 //    Cleans up sockets then calls EndDialog to finish the dialog session.
00257 //
00258
00259 LRESULT CmdConnectDone(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00260 {
00261
00262     CleanUp();               // Free any aborted socket resources
00263     EndDialog(hdlg, FALSE);  // Exit Dialog -- rtrn false since no connection
00264     return TRUE;
00265 }
00266
00267 //
00268 //  FUNCTION: CmdConnectNow(HWND, WORD, HWND)
00269 //
00270 //  PURPOSE: Establish the connection
00271 //
00272 //  PARAMETERS:
00273 //    hdlg - The window handling the command.
00274 //    wCommand - The command to be handled (unused).
00275 //    wNotify   - Notification number (unused)
00276 //    hwndCtrl - NULL (unused).
00277 //
00278 //  RETURN VALUE:
00279 //    Always returns TRUE.
00280 //
00281 //  COMMENTS:
00282 //    Makes Connection calls
00283 //
00284
00285 LRESULT CmdConnectNow(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00286 {
00287     char outtext[128];
00288     WORD wVersionRequested;
00289     WSADATA wsaData;
00290
00291
00292     GetDlgItemText(hdlg, CD_NETWORK, szConnectNetwork, 9);        // Get Network Number
00293     AtoH(szConnectNetwork, (char *)&RemAddr.sa_netnum, 4);        // Network order
00294
00295     GetDlgItemText(hdlg, CD_NODE, szConnectNode, 13);             // Get Node Number
00296     AtoH((char *)szConnectNode, (char *)&RemAddr.sa_nodenum, 6);  // Network order
00297
00298     GetDlgItemText(hdlg, CD_SOCKET, szConnectSocket, 5);          // Get Socket Number
00299     AtoH((char *)szConnectSocket, (char *)&RemAddr.sa_socket, 2); // Network order
00300
00301     RemAddr.sa_family = AF_IPX;                                   // IPX Family
00302     wVersionRequested = MAKEWORD(1, 1);
00303
00304     SetDlgItemText(hdlg, CD_STATUS, "Calling WSAStartup");
00305
00306     // Initialize winsock dll
00307     if(WSAStartup(wVersionRequested, &wsaData) != 0)
00308     {
00309         SetDlgItemText(hdlg, CD_STATUS, "WSAStartup failed");
00310         return TRUE;
00311     }
00312
00313     SetDlgItemText(hdlg, CD_STATUS, "WSAStartup Succeeded");
00314
00315     SetDlgItemText(hdlg, CD_STATUS, "Calling socket()");
00316
00317     // get socket handle
00318     sock = socket(AF_IPX,            // IPX family
00319                   SOCK_SEQPACKET,    // Message mode data xfers
00320                   NSPROTO_SPX);      // SPX = Connection Oriented
00321
00322     if(sock == INVALID_SOCKET) {
00323         SetDlgItemText(hdlg, CD_STATUS, "ERROR on socket()");
00324         WSACleanup();
00325         return TRUE;
00326     }
00327
00328     SetDlgItemText(hdlg, CD_STATUS, "socket() Succeeded");
00329
00330     SetDlgItemText(hdlg, CD_STATUS, "Calling connect()");
00331
00332     // Call specified address (we block here since I don't have anything better
00333     // to do).
00334     if(connect(sock, (struct sockaddr *)&RemAddr, sizeof(RemAddr)) == SOCKET_ERROR)
00335     {
00336         // Failed!  Post status and cleanup
00337         StringCchPrintf(outtext,128,"connect() failed, error %u", WSAGetLastError());
00338         SetDlgItemText(hdlg, CD_STATUS, outtext);
00339         closesocket(sock);
00340         WSACleanup();
00341         return TRUE;
00342     }
00343
00344     // We've got a connection!  Kill the dialog
00345     SetDlgItemText(hdlg, CD_STATUS, "connect() succeeded!");
00346
00347     EndDialog(hdlg, TRUE);          // Exit the dialog
00348     DeleteObject (hfontDlg);
00349     return (TRUE);
00350 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SEC_FUNC Member List

This is the complete list of members for _SEC_FUNC, including all inherited members.
pAcquireCredentialsHandle | _SEC_FUNC
pCompleteAuthToken | _SEC_FUNC
pDeleteSecurityContext | _SEC_FUNC
pEnumerateSecurityPackages | _SEC_FUNC
pFreeContextBuffer | _SEC_FUNC
pFreeCredentialsHandle | _SEC_FUNC
pInitializeSecurityContext | _SEC_FUNC
pQuerySecurityPackageInfo | _SEC_FUNC
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/ioipo.h Source File

  • Com
  • Fundamentals
  • SimpSvr

ioipo.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: ioipo.h
00003 //
00004 //      Definition of COleInPlaceObject
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _IOIPO_H_)
00010 #define _IOIPO_H_
00011
00012
00013 #include <ole2.h>
00014 #include "obj.h"
00015
00016 class CSimpSvrObj;
00017
00018 interface COleInPlaceObject : public IOleInPlaceObject
00019 {
00020 private:
00021   CSimpSvrObj FAR * m_lpObj;
00022   int m_nCount;
00023
00024 public:
00025   COleInPlaceObject::COleInPlaceObject(CSimpSvrObj FAR * lpSimpSvrObj)
00026     {
00027     m_lpObj = lpSimpSvrObj;
00028     m_nCount = 0;
00029     };
00030   COleInPlaceObject::~COleInPlaceObject() {};
00031
00032 //  IUnknown Methods
00033   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppvObj);
00034   STDMETHODIMP_(ULONG) AddRef ();
00035   STDMETHODIMP_(ULONG) Release ();
00036
00037   STDMETHODIMP InPlaceDeactivate  ();
00038   STDMETHODIMP UIDeactivate  () ;
00039   STDMETHODIMP SetObjectRects  ( LPCRECT lprcPosRect, LPCRECT lprcClipRect);
00040   STDMETHODIMP GetWindow  ( HWND FAR* lphwnd) ;
00041   STDMETHODIMP ContextSensitiveHelp  ( BOOL fEnterMode);
00042   STDMETHODIMP ReactivateAndUndo  ();
00043 };
00044
00045 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Draw.c Source File

  • Multimedia
  • Gdi
  • GdiDemo

Draw.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \******************************************************************************/
00010
00011 /*---------------------------------------------------------------------------*\
00012 | RANDOM OBJECTS MODULE
00013 \*---------------------------------------------------------------------------*/
00014
00015 #include <windows.h>
00016 #include <stdio.h>
00017 #include "gdidemo.h"
00018 #include "draw.h"
00019
00020 /*---------------------------------------------------------------------------*\
00021 | CREATE DRAW WINDOW PROCEDURE
00022 \*---------------------------------------------------------------------------*/
00023 HWND FAR CreateDrawWindow(HWND hWndClient, int nItem)
00024 {
00025     HANDLE          hInstance;
00026     MDICREATESTRUCT mcs;
00027     static char buffer[256];
00028
00029
00030     hInstance = GETINSTANCE(hWndClient);
00031     LoadString (hInstance, DRAWTITLE, buffer, 256);
00032
00033     /*
00034     ** Initialize the MDI create struct for creation of the
00035     ** test window.
00036     */
00037     mcs.szClass = DRAWCLASS;
00038     mcs.szTitle = buffer;
00039     mcs.hOwner  = hInstance;
00040     mcs.x       = CW_USEDEFAULT;
00041     mcs.y       = CW_USEDEFAULT;
00042     mcs.cx      = CW_USEDEFAULT;
00043     mcs.cy      = CW_USEDEFAULT;
00044     mcs.style   = 0l;
00045     mcs.lParam  = (LONG)nItem;
00046
00047     return((HWND)SendMessage(hWndClient,WM_MDICREATE,0,(LPARAM)(LPMDICREATESTRUCT)&mcs));
00048 }
00049
00050
00051 /*---------------------------------------------------------------------------*\
00052 | DRAW WINDOW PROCEDURE
00053 \*---------------------------------------------------------------------------*/
00054 LRESULT CALLBACK DrawProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
00055 {
00056     switch(wMsg)
00057     {
00058         case WM_CREATE:
00059             DrawCreateProc(hWnd);
00060             break;
00061
00062
00063         case WM_COMMAND:
00064             DrawCommandProc(hWnd,wParam,lParam);
00065             break;
00066
00067
00068         case WM_TIMER:
00069             DrawObject(hWnd);
00070             break;
00071
00072
00073         case WM_PAINT:
00074             DrawPaintProc(hWnd);
00075             break;
00076
00077
00078         case WM_DESTROY:
00079             DrawDestroyProc(hWnd);
00080             break;
00081
00082
00083         default:
00084             return(DefMDIChildProc(hWnd,wMsg,wParam,lParam));
00085     }
00086     return(0l);
00087 }
00088
00089
00090 /*---------------------------------------------------------------------------*\
00091 | DRAW CREATE PROCEDURE
00092 \*---------------------------------------------------------------------------*/
00093 BOOL DrawCreateProc(HWND hWnd)
00094 {
00095     PDRAWDATA pdd;
00096
00097
00098     if(AllocWindowInfo(hWnd,sizeof(DRAWDATA)))
00099     {
00100         if(pdd = (PDRAWDATA)LockWindowInfo(hWnd))
00101         {
00102             pdd->nObject = 0;
00103
00104             UnlockWindowInfo(hWnd);
00105
00106             SetTimer(hWnd,1,50,NULL);
00107             return(TRUE);
00108         }
00109         FreeWindowInfo(hWnd);
00110     }
00111     return(FALSE);
00112 }
00113
00114
00115 /*---------------------------------------------------------------------------*\
00116 | DRAW COMMAND PROCEDURE
00117 \*---------------------------------------------------------------------------*/
00118 BOOL DrawCommandProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
00119 {
00120     hWnd   = hWnd;
00121     wParam = wParam;
00122     lParam = lParam;
00123
00124     return(TRUE);
00125 }
00126
00127
00128 /*---------------------------------------------------------------------------*\
00129 | DRAW PAINT PROCEDURE
00130 \*---------------------------------------------------------------------------*/
00131 VOID DrawPaintProc(HWND hWnd)
00132 {
00133     HDC         hDC;
00134     PAINTSTRUCT ps;
00135
00136
00137     if(hDC = BeginPaint(hWnd,&ps))
00138         EndPaint(hWnd,&ps);
00139
00140     return;
00141 }
00142
00143
00144 /*---------------------------------------------------------------------------*\
00145 | DRAW DESTROY PROCEDURE
00146 \*---------------------------------------------------------------------------*/
00147 VOID DrawDestroyProc(HWND hWnd)
00148 {
00149     KillTimer(hWnd,1);
00150     FreeWindowInfo(hWnd);
00151     return;
00152 }
00153
00154
00155 VOID DrawObject(HWND hWnd)
00156 {
00157     PDRAWDATA pdd;
00158     RECT      rect;
00159     HDC       hDC;
00160     int       x1,y1,x2,y2,x3,y3,x4,y4,r,g,b,nObject;
00161     HBRUSH    hBrush;
00162     char      szDebug[80];
00163
00164
00165     if(pdd = (PDRAWDATA)LockWindowInfo(hWnd))
00166     {
00167         if(hDC = GetDC(hWnd))
00168         {
00169             GetClientRect(hWnd,&rect);
00170
00171             // avoid divide by zero errors when the window is small.
00172             if ( rect.right== 0) rect.right++;
00173             if ( rect.bottom== 0) rect.bottom++;
00174
00175             r = lRandom() % 255;
00176             g = lRandom() % 255;
00177             b = lRandom() % 255;
00178
00179             if(hBrush = SelectObject(hDC,CreateSolidBrush(RGB(r,g,b))))
00180             {
00181                 x1 = lRandom() % rect.right;
00182                 y1 = lRandom() % rect.bottom;
00183                 x2 = lRandom() % rect.right;
00184                 y2 = lRandom() % rect.bottom;
00185                 x3 = lRandom() % rect.right;
00186                 y3 = lRandom() % rect.bottom;
00187                 x4 = lRandom() % rect.right;
00188                 y4 = lRandom() % rect.bottom;
00189
00190
00191                 nObject = lRandom() % 5;
00192
00193                 switch(nObject)
00194                 {
00195                     default:
00196                     case OBJ_RECTANGLE:
00197                         _snprintf(szDebug,sizeof(szDebug)-1,"Rectangle(%d,%d,%d,%d)\n",x1,y1,x2,y2);
00198                         szDebug[sizeof(szDebug)-1] = '\0';
00199
00200                         DEBUGOUT(szDebug);
00201                         Rectangle(hDC,x1,y1,x2,y2);
00202                         break;
00203
00204                     case OBJ_ELLIPSE:
00205                         _snprintf(szDebug,sizeof(szDebug)-1,"Ellipse(%d,%d,%d,%d)\n",x1,y1,x2,y2);
00206                         szDebug[sizeof(szDebug)-1] = '\0';
00207
00208                         DEBUGOUT(szDebug);
00209                         Ellipse(hDC,x1,y1,x2,y2);
00210                         break;
00211
00212
00213
00214                     case OBJ_ROUNDRECT:
00215                         _snprintf(szDebug,sizeof(szDebug)-1,"RoundRect(%d,%d,%d,%d,%d,%d)\n",x1,y1,x2,y2,x3,y3);
00216                         szDebug[sizeof(szDebug)-1] = '\0';
00217
00218                         DEBUGOUT(szDebug);
00219                         RoundRect(hDC,x1,y1,x2,y2,x3,y3);
00220                         break;
00221
00222                     case OBJ_CHORD:
00223                         _snprintf(szDebug,sizeof(szDebug)-1,"Chord(%d,%d,%d,%d,%d,%d,%d,%d)\n",x1,y1,x2,y2,x3,y3,x4,y4);
00224                         szDebug[sizeof(szDebug)-1] = '\0';
00225
00226                         DEBUGOUT(szDebug);
00227                         Chord(hDC,x1,y1,x2,y2,x3,y3,x4,y4);
00228                         break;
00229
00230                     case OBJ_PIE:
00231                         _snprintf(szDebug,sizeof(szDebug)-1,"Pie(%d,%d,%d,%d,%d,%d,%d,%d)\n",x1,y1,x2,y2,x3,y3,x4,y4);
00232                         szDebug[sizeof(szDebug)-1] = '\0';
00233
00234                         DEBUGOUT(szDebug);
00235                         Pie(hDC,x1,y1,x2,y2,x3,y3,x4,y4);
00236                         break;
00237
00238                 }
00239
00240                 DeleteObject(SelectObject(hDC,hBrush));
00241             }
00242             ReleaseDC(hWnd,hDC);
00243         }
00244         UnlockWindowInfo(hWnd);
00245     }
00246     return;
00247 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_WORK_QUEUE Member List

This is the complete list of members for _WORK_QUEUE, including all inherited members.
CriticalSection | _WORK_QUEUE
NumberOfWorkerThreads | _WORK_QUEUE
Queue | _WORK_QUEUE
Semaphore | _WORK_QUEUE
Terminating | _WORK_QUEUE
WorkerRoutine | _WORK_QUEUE
WorkerThreads | _WORK_QUEUE
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMultipleResultsDlg Member List

This is the complete list of members for CMultipleResultsDlg, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
CInterfaceDlg(UINT nID, WCHAR *pwszTitle, REFIID riid) | CInterfaceDlg |
CMultipleResultsDlg(CMDIChild *pCMDIChild) | CMultipleResultsDlg |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CRowsetViewerDlg(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CRowsetViewerDlg |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetAggregate() | CInterfaceDlg | [inline, virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetOptions() | CRowsetViewerDlg | [virtual]
GetSelInterface() | CInterfaceDlg | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_CComboInterface | CInterfaceDlg | [protected]
m_CComboReserved | CMultipleResultsDlg | [protected]
m_fAggregation | CInterfaceDlg |
m_fModal | CDialogLite |
m_fOutput | CInterfaceDlg |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iid | CInterfaceDlg | [protected]
m_nID | CWndLite |
m_pCAggregate | CInterfaceDlg | [protected]
m_pCMainWindow | CRowsetViewerDlg |
m_pCMDIChild | CRowsetViewerDlg |
m_pIUnknown | CInterfaceDlg | [protected]
m_ppIUnknown | CInterfaceDlg | [protected]
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_pwszTitle | CInterfaceDlg | [protected]
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnAggregation() | CInterfaceDlg | [virtual]
OnCancel() | CDialogLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CInterfaceDlg | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | CMultipleResultsDlg | [virtual]
CInterfaceDlg::OnInitDialog() | CInterfaceDlg | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CMultipleResultsDlg | [virtual]
CInterfaceDlg::OnOK() | CInterfaceDlg | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdate() | CInterfaceDlg | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
ppUnknown() | CInterfaceDlg | [inline, virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
pUnknown() | CInterfaceDlg | [inline, virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CInterfaceDlg() | CInterfaceDlg | [virtual]
~CMultipleResultsDlg() | CMultipleResultsDlg | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/common.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

common.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: common.cpp
00008
00009     PURPOSE: Provides common file replication service routine definitions.
00010
00011 */
00012
00013 #include <windows.h>
00014 #include <tchar.h>
00015 #include <stdio.h>
00016 #include <stdlib.h>
00017 #include <crtdbg.h>
00018
00019 #include "common.h"
00020
00021 HANDLE hProcessHeap = NULL;
00022
00023 VOID * AutoHeapAlloc(size_t dwBytes) {
00024     if (hProcessHeap == NULL) {
00025         hProcessHeap = GetProcessHeap();
00026     }
00027     return HeapAlloc(hProcessHeap, 0, dwBytes);
00028 }
00029
00030 VOID AutoHeapFree(VOID * lpMem) {
00031     DWORD status;
00032     ASSERTE(hProcessheap != NULL);
00033     status = HeapFree(hProcessHeap, 0, lpMem);
00034     ASSERTE(status);
00035 }
00036
00037 // end common.cpp
Generated on Wed Nov 13 2024 16:52:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MetaTag.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

MetaTag.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       metatag.cxx
00006 //
00007 //  Contents:   Parsing algorithm for meta tag in Html
00008 //
00009 //  Classes:    CMetaTag
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <metatag.hxx>
00017 #include <htmlguid.hxx>
00018
00019 //+-------------------------------------------------------------------------
00020 //
00021 //  Method:     CMetaTag::CMetaTag
00022 //
00023 //  Synopsis:   Constructor
00024 //
00025 //  Arguments:  [htmlIFilter]    -- Html IFilter
00026 //              [serialStream]   -- Input stream
00027 //              [clsidMetaInfo]  -- Clsid for meta chunk
00028 //
00029 //--------------------------------------------------------------------------
00030
00031 CMetaTag::CMetaTag( CHtmlIFilter& htmlIFilter,
00032                     CSerialStream& serialStream,
00033                     GUID clsidMetaInfo )
00034     : CHtmlElement(htmlIFilter, serialStream),
00035       _clsidMetaInfo(clsidMetaInfo),
00036       _pwcValueBuf(0),
00037       _cValueChars(0),
00038       _eState(FilteringValue)
00039 {
00040 }
00041
00042
00043
00044 //+-------------------------------------------------------------------------
00045 //
00046 //  Method:     CMetaTag::GetChunk
00047 //
00048 //  Synopsis:   Gets the next chunk and returns chunk information in pStat
00049 //
00050 //  Arguments:  [pStat] -- chunk information returned here
00051 //
00052 //--------------------------------------------------------------------------
00053
00054 SCODE CMetaTag::GetChunk( STAT_CHUNK * pStat )
00055 {
00056     SCODE sc = SwitchToNextHtmlElement( pStat );
00057
00058     return sc;
00059 }
00060
00061
00062
00063 //+-------------------------------------------------------------------------
00064 //
00065 //  Method:     CMetaTag::GetText
00066 //
00067 //  Synopsis:   Retrieves text from current chunk
00068 //
00069 //  Arguments:  [pcwcOutput] -- count of UniCode characters in buffer
00070 //              [awcBuffer]  -- buffer for text
00071 //
00072 //--------------------------------------------------------------------------
00073
00074 SCODE CMetaTag::GetText( ULONG *pcwcOutput, WCHAR *awcBuffer )
00075 {
00076     return FILTER_E_NO_TEXT;
00077 }
00078
00079
00080 //+-------------------------------------------------------------------------
00081 //
00082 //  Method:     CMetaTag::GetValue
00083 //
00084 //  Synopsis:   Retrieves value from current chunk
00085 //
00086 //  Arguments:  [ppPropValue] -- Value returned here
00087 //
00088 //--------------------------------------------------------------------------
00089
00090 SCODE CMetaTag::GetValue( PROPVARIANT **ppPropValue )
00091 {
00092     switch ( _eState )
00093     {
00094     case FilteringValue:
00095     {
00096         PROPVARIANT *pPropVar = (PROPVARIANT *) CoTaskMemAlloc( sizeof PROPVARIANT );
00097         if ( pPropVar == 0 )
00098             return E_OUTOFMEMORY;
00099
00100         pPropVar->vt = VT_LPWSTR;
00101         pPropVar->pwszVal = (WCHAR *) CoTaskMemAlloc( ( _cValueChars + 1 ) * sizeof( WCHAR ) );
00102         if ( pPropVar->pwszVal == 0 )
00103         {
00104             CoTaskMemFree( (void *) pPropVar );
00105             return E_OUTOFMEMORY;
00106         }
00107
00108         RtlCopyMemory( pPropVar->pwszVal, _pwcValueBuf, _cValueChars * sizeof(WCHAR) );
00109         pPropVar->pwszVal[_cValueChars] = 0;
00110
00111         *ppPropValue = pPropVar;
00112
00113         _eState = NoMoreValue;
00114         return S_OK;
00115     }
00116
00117     case NoMoreValue:
00118
00119         return FILTER_E_NO_MORE_VALUES;
00120
00121     default:
00122         Win4Assert( !"CMetaTag::GetValue, unknown state" );
00123         return E_FAIL;
00124     }
00125 }
00126
00127
00128 //+-------------------------------------------------------------------------
00129 //
00130 //  Method:     CMetaTag::InitStatChunk
00131 //
00132 //  Synopsis:   Initializes the STAT_CHUNK
00133 //
00134 //  Arguments:  [pStat] -- STAT_CHUNK to initialize
00135 //
00136 //--------------------------------------------------------------------------
00137
00138 void CMetaTag::InitStatChunk( STAT_CHUNK *pStat )
00139 {
00140     WCHAR *pwcName;
00141     unsigned cwcName;
00142
00143     //
00144     // Read the names field
00145     //
00146     _scanner.ReadTagIntoBuffer();
00147     _scanner.ScanTagBuffer( L"name=\"", pwcName, cwcName );
00148
00149     if ( cwcName == 0 )
00150     {
00151         //
00152         // Try to read http-equiv instead
00153         //
00154         _scanner.ScanTagBuffer( L"http-equiv=\"", pwcName, cwcName );
00155     }
00156
00157     if ( cwcName == 0 )
00158     {
00159         //
00160         // Chunk of unknown type
00161         //
00162         _cValueChars = 0;
00163         pStat->attribute.psProperty.ulKind = PRSPEC_PROPID;
00164         pStat->attribute.psProperty.propid = 3;
00165     }
00166     else
00167     {
00168         _scanner.ScanTagBuffer( L"content=\"", _pwcValueBuf, _cValueChars );
00169
00170         pStat->attribute.psProperty.ulKind = PRSPEC_LPWSTR;
00171
00172         if ( cwcName > MAX_PROPSPEC_STRING_LENGTH )
00173             cwcName = MAX_PROPSPEC_STRING_LENGTH;     // Truncate to max length permitted
00174
00175         RtlCopyMemory( _awszPropSpec, pwcName, cwcName * sizeof(WCHAR) );
00176         _awszPropSpec[cwcName] = 0;
00177
00178         pStat->attribute.psProperty.lpwstr = _awszPropSpec;
00179     }
00180
00181     _eState = FilteringValue;
00182
00183     pStat->idChunk = _htmlIFilter.GetNextChunkId();
00184     pStat->flags = CHUNK_VALUE;
00185     pStat->locale = _htmlIFilter.GetLocale();
00186     pStat->attribute.guidPropSet = _clsidMetaInfo;
00187     pStat->breakType = CHUNK_EOS;
00188     pStat->idChunkSource = pStat->idChunk;
00189     pStat->cwcStartSource = 0;
00190     pStat->cwcLenSource = 0;
00191 }
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IPSAMPLE_MIB_GET_OUTPUT_DATA Member List

This is the complete list of members for _IPSAMPLE_MIB_GET_OUTPUT_DATA, including all inherited members.
IMGOD_Buffer | _IPSAMPLE_MIB_GET_OUTPUT_DATA
IMGOD_IfIndex | _IPSAMPLE_MIB_GET_OUTPUT_DATA
IMGOD_TypeID | _IPSAMPLE_MIB_GET_OUTPUT_DATA
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHILD_PROPERTIES Member List

This is the complete list of members for CHILD_PROPERTIES, including all inherited members.
dwAttributes | CHILD_PROPERTIES
szNodeName | CHILD_PROPERTIES
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Marshal2/MICARS.Idl Source File

  • Com
  • Fundamentals
  • TutSamp
  • Marshal2

MICARS.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      MICARS.IDL
00003
00004   Summary:   Interface definition file for use by the MIDL compiler.
00005              Specifies the following custom interfaces: ICar, IUtility,
00006              and ICruise. Part of the MARSHAL and MARSHAL2 code samples
00007              which is used by later code samples in the series (eg, the
00008              LOCSERVE, LOCCLIEN, APTSERVE, APTCLIEN, and REMCLIEN
00009              samples).
00010
00011              Compilation of this file using the MIDL.EXE compiler
00012              generates additional source files MICARS.H, MICARS_I.C,
00013              MICARS_P.C, and DLLDATA.C.  They are in turn compiled in the
00014              Makefile to produce the marshaling server which is used by
00015              later code samples to provide standard marshaling for the
00016              ICar, IUtility, and ICruise custom interfaces.
00017
00018   Origin:    6-9-97: atrent - Revised for MARSHAL and MARSHAL2.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995-1998 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 [uuid(0002da00-0000-0000-c000-000000000046),
00036     object
00037 ]
00038 interface ICar : IUnknown
00039 {
00040   import "unknwn.idl";
00041
00042   HRESULT Shift([in] short nGear);
00043   HRESULT Clutch([in] short nEngaged);
00044   HRESULT Speed([in] short nMph);
00045   HRESULT Steer([in] short nAngle);
00046 }
00047
00048 [uuid(0002da01-0000-0000-c000-000000000046),
00049     object
00050 ]
00051 interface IUtility : IUnknown
00052 {
00053   import "unknwn.idl";
00054
00055   HRESULT Offroad([in] short nGear);
00056   HRESULT Winch([in] short nRpm);
00057 }
00058
00059 [uuid(0002da02-0000-0000-c000-000000000046),
00060     object
00061 ]
00062 interface ICruise : IUnknown
00063 {
00064   import "unknwn.idl";
00065
00066   HRESULT Engage([in] BOOL bOnOff);
00067   HRESULT Adjust([in] BOOL bUpDown);
00068 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/hashtable.c Source File

  • NetDS
  • RRas
  • ip

hashtable.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\hashtable.c
00008
00009 Abstract:
00010
00011     The file contains a hash table implementation.
00012
00013 --*/
00014
00015 #include "pchsample.h"
00016 #pragma hdrstop
00017
00018
00019 DWORD
00020 HT_Create(
00021     IN  HANDLE              hHeap,
00022     IN  ULONG               ulNumBuckets,
00023     IN  PDISPLAY_FUNCTION   pfnDisplay  OPTIONAL,
00024     IN  PFREE_FUNCTION      pfnFree,
00025     IN  PHASH_FUNCTION      pfnHash,
00026     IN  PCOMPARE_FUNCTION   pfnCompare,
00027     OUT PHASH_TABLE         *pphtHashTable)
00028 /*++
00029
00030 Routine Description
00031     Creates a hash table.
00032
00033 Locks
00034     None
00035
00036 Arguments
00037     hHeap               heap to use for allocation
00038     ulNumBuckets        # buckets in the hash table
00039     pfnDisplay          function used to display a hash table entry
00040     pfnFree             function used to free a hash table entry
00041     pfnHash             function used to compute the hash of an entry
00042     pfnCompare          function used to compare two hash table entries
00043     pphtHashTable       pointer to the hash table address
00044
00045 Return Value
00046     NO_ERROR            if success
00047     Failure code        o/w
00048
00049 --*/
00050 {
00051     DWORD       dwErr = NO_ERROR;
00052     ULONG       i = 0, ulSize = 0;
00053     PHASH_TABLE phtTable;
00054
00055     // validate parameters
00056     if (!hHeap or
00057         !ulNumBuckets or
00058         !pfnFree or
00059         !pfnHash or
00060         !pfnCompare or
00061         !pphtHashTable)
00062         return ERROR_INVALID_PARAMETER;
00063
00064     *pphtHashTable = NULL;
00065
00066     do                          // breakout loop
00067     {
00068         // allocate the hash table structure
00069         ulSize = sizeof(HASH_TABLE);
00070         phtTable = HeapAlloc(hHeap, 0, ulSize);
00071         if (phtTable is NULL)
00072         {
00073             dwErr = GetLastError();
00074             break;
00075         }
00076
00077         // allocate the buckets
00078         ulSize = ulNumBuckets * sizeof(LIST_ENTRY);
00079         phtTable->pleBuckets = HeapAlloc(hHeap, 0, ulSize);
00080         if (phtTable->pleBuckets is NULL)
00081         {
00082             HeapFree(hHeap, 0, phtTable); // undo allocation
00083             dwErr = GetLastError();
00084             break;
00085         }
00086
00087         // initialize the buckets
00088         for (i = 0; i < ulNumBuckets; i++)
00089             InitializeListHead(phtTable->pleBuckets + i);
00090
00091         // initialize the hash table structure's members
00092         phtTable->ulNumBuckets  = ulNumBuckets;
00093         phtTable->ulNumEntries  = 0;
00094         phtTable->pfnDisplay    = pfnDisplay;
00095         phtTable->pfnFree       = pfnFree;
00096         phtTable->pfnHash       = pfnHash;
00097         phtTable->pfnCompare    = pfnCompare;
00098
00099         *pphtHashTable = phtTable;
00100     } while (FALSE);
00101
00102     return dwErr;
00103 }
00104
00105
00106
00107 DWORD
00108 HT_Destroy(
00109     IN  HANDLE              hHeap,
00110     IN  PHASH_TABLE         phtHashTable)
00111 /*++
00112
00113 Routine Description
00114     Destroys a hash table.
00115     Frees up memory allocated for hash table entries.
00116
00117 Locks
00118     Assumes the hash table is locked for writing.
00119
00120 Arguments
00121     hHeap               heap to use for deallocation
00122     phtHashTable        pointer to the hash table to be destroyed
00123
00124 Return Value
00125     NO_ERROR            always
00126
00127 --*/
00128 {
00129     ULONG i;
00130     PLIST_ENTRY pleList = NULL;
00131
00132     // validate parameters
00133     if (!hHeap or
00134         !phtHashTable)
00135         return NO_ERROR;
00136
00137     // deallocate the entries
00138     for (i = 0; i < phtHashTable->ulNumBuckets; i++)
00139     {
00140         pleList = phtHashTable->pleBuckets + i;
00141         FreeList(pleList, phtHashTable->pfnFree);
00142     }
00143
00144     // deallocate the buckets
00145     HeapFree(hHeap, 0, phtHashTable->pleBuckets);
00146
00147     // deallocate the hash table structure
00148     HeapFree(hHeap, 0, phtHashTable);
00149
00150     return NO_ERROR;
00151 }
00152
00153
00154
00155 DWORD
00156 HT_Cleanup(
00157     IN  PHASH_TABLE         phtHashTable)
00158 /*++
00159
00160 Routine Description
00161     Cleans up all hash table entries.
00162
00163 Locks
00164     Assumes the hash table is locked for writing.
00165
00166 Arguments
00167     phtHashTable        pointer to the hash table to be cleaned up
00168
00169 Return Value
00170     NO_ERROR            always
00171
00172 --*/
00173 {
00174     ULONG i;
00175     PLIST_ENTRY pleList = NULL;
00176
00177     // validate parameters
00178     if (!phtHashTable)
00179         return NO_ERROR;
00180
00181     // deallocate the entries
00182     for (i = 0; i < phtHashTable->ulNumBuckets; i++)
00183     {
00184         pleList = phtHashTable->pleBuckets + i;
00185         FreeList(pleList, phtHashTable->pfnFree);
00186     }
00187
00188     phtHashTable->ulNumEntries  = 0;
00189
00190     return NO_ERROR;
00191 }
00192
00193
00194
00195 DWORD
00196 HT_InsertEntry(
00197     IN  PHASH_TABLE         phtHashTable,
00198     IN  PLIST_ENTRY         pleEntry)
00199 /*++
00200
00201 Routine Description
00202     Inserts the specified entry in the hash table.
00203     Memory for the entry should already have been allocated.
00204
00205 Locks
00206     Assumes the hash table is locked for writing.
00207
00208 Arguments
00209     phtHashTable        pointer to the hash table to be modified
00210     pleEntry            entry to be inserted
00211
00212 Return Value
00213     NO_ERROR            if success
00214     Error code          o/w (entry exists)
00215
00216 --*/
00217 {
00218     DWORD dwErr = NO_ERROR;
00219     PLIST_ENTRY pleList = NULL;
00220
00221     // validate parameters
00222     if (!phtHashTable or !pleEntry)
00223         return ERROR_INVALID_PARAMETER;
00224
00225     do                          // breakout loop
00226     {
00227         // entry exists, fail
00228         if (HT_IsPresentEntry(phtHashTable, pleEntry))
00229         {
00230             dwErr = ERROR_INVALID_PARAMETER;
00231             break;
00232         }
00233
00234         // insert the entry in the hash table
00235         pleList = phtHashTable->pleBuckets +
00236             (*phtHashTable->pfnHash)(pleEntry);
00237         InsertHeadList(pleList, pleEntry);
00238         phtHashTable->ulNumEntries++;
00239     } while (FALSE);
00240
00241     return dwErr;
00242 }
00243
00244
00245
00246 DWORD
00247 HT_GetEntry(
00248     IN  PHASH_TABLE         phtHashTable,
00249     IN  PLIST_ENTRY         pleKey,
00250     OUT PLIST_ENTRY         *ppleEntry)
00251 /*++
00252
00253 Routine Description
00254     Gets the hash table entry with the given key.
00255
00256 Locks
00257     Assumes the hash table is locked for reading.
00258
00259 Arguments
00260     phtHashTable        pointer to the hash table to be searched
00261     pleKey              key to be searched for
00262     ppleEntry           pointer to matching entry's address
00263
00264 Return Value
00265     NO_ERROR                entry exisits
00266     ERROR_INVALID_PARAMETER o/w (entry does not exist)
00267
00268 --*/
00269 {
00270     DWORD dwErr = NO_ERROR;
00271     PLIST_ENTRY pleList = NULL;
00272
00273     // validate parameters
00274     if (!phtHashTable or !pleKey or !ppleEntry)
00275         return ERROR_INVALID_PARAMETER;
00276
00277     pleList = phtHashTable->pleBuckets +
00278         (*phtHashTable->pfnHash)(pleKey);
00279
00280     FindList(pleList, pleKey, ppleEntry, phtHashTable->pfnCompare);
00281
00282     // entry not found, fail
00283     if (*ppleEntry is NULL)
00284         dwErr = ERROR_INVALID_PARAMETER;
00285
00286     return dwErr;
00287 }
00288
00289
00290 DWORD
00291 HT_DeleteEntry(
00292     IN  PHASH_TABLE         phtHashTable,
00293     IN  PLIST_ENTRY         pleKey,
00294     OUT PLIST_ENTRY         *ppleEntry)
00295 /*++
00296
00297 Routine Description
00298     Deletes the entry with the given key from the hash table.
00299     Memory for the entry is not deleted.
00300
00301 Locks
00302     Assumes the hash table is locked for writing.
00303
00304 Arguments
00305     phtHashTable        pointer to the hash table to be searched
00306     pleKey              key to be deleted
00307     ppleEntry           pointer to matching entry's address
00308
00309 Return Value
00310     NO_ERROR                entry exisits
00311     ERROR_INVALID_PARAMETER o/w (entry does not exist)
00312
00313 --*/
00314 {
00315     DWORD dwErr = NO_ERROR;
00316
00317     // validate parameters
00318     if (!phtHashTable or !pleKey or !ppleEntry)
00319         return ERROR_INVALID_PARAMETER;
00320
00321     do                          // breakout loop
00322     {
00323         dwErr = HT_GetEntry(phtHashTable, pleKey, ppleEntry);
00324
00325         // entry not found, fail
00326         if (dwErr != NO_ERROR)
00327             break;
00328
00329         // entry found, delete from hash table and reset pointers
00330         RemoveEntryList(*ppleEntry);
00331         phtHashTable->ulNumEntries--;
00332     } while (FALSE);
00333
00334     return dwErr;
00335 }
00336
00337
00338
00339 BOOL
00340 HT_IsPresentEntry(
00341     IN  PHASH_TABLE         phtHashTable,
00342     IN  PLIST_ENTRY         pleKey)
00343 /*++
00344
00345 Routine Description
00346     Is key present in the hash table?
00347
00348 Locks
00349     Assumes the hash table is locked for reading.
00350
00351 Arguments
00352     phtHashTable        pointer to the hash table to be searched
00353     pleKey              key to be deleted
00354
00355 Return Value
00356     TRUE                entry exisits
00357     FALSE               o/w
00358
00359 --*/
00360 {
00361     DWORD       dwErr;
00362     PLIST_ENTRY pleEntry = NULL;
00363
00364     // validate parameters
00365     if (!phtHashTable or !pleKey)
00366         return FALSE;
00367
00368     dwErr = HT_GetEntry(phtHashTable, pleKey, &pleEntry);
00369
00370     // entry not found, fail
00371     if (dwErr != NO_ERROR)
00372         return FALSE;
00373
00374     // entry found, delete from hash table
00375     return TRUE;
00376 }
00377
00378
00379
00380 DWORD
00381 HT_MapCar(
00382     IN  PHASH_TABLE         phtHashTable,
00383     IN  PVOID_FUNCTION      pfnVoidFunction
00384     )
00385 /*++
00386
00387 Routine Description
00388     Applies the specified function to all entries in a hash table.
00389
00390 Locks
00391     Assumes the hash table is locked for reading.
00392
00393 Arguments
00394     phtHashTable        pointer to the hash table to be mapcar'ed
00395     pfnVoidFunction     pointer to function to apply to all entries
00396
00397 Return Value
00398     NO_ERROR            always
00399
00400 --*/
00401 {
00402     ULONG i;
00403     PLIST_ENTRY pleList = NULL;
00404
00405     // validate parameters
00406     if (!phtHashTable or !pfnVoidFunction)
00407         return NO_ERROR;
00408
00409     for (i = 0; i < phtHashTable->ulNumBuckets; i++)
00410     {
00411         pleList = phtHashTable->pleBuckets + i;
00412         MapCarList(pleList, pfnVoidFunction);
00413     }
00414
00415     return NO_ERROR;
00416 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/StdAfx.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

StdAfx.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            StdAfx.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #if !defined(AFX_STDAFX_H__8C9CC15C_94B3_4714_B06D_6B3D29637EBB__INCLUDED_)
00013 #define AFX_STDAFX_H__8C9CC15C_94B3_4714_B06D_6B3D29637EBB__INCLUDED_
00014
00015 #if _MSC_VER > 1000
00016 #pragma once
00017 #endif // _MSC_VER > 1000
00018
00019 #define STRICT
00020 #ifndef _WIN32_WINNT
00021 #define _WIN32_WINNT 0x0400
00022 #endif
00023 #define _ATL_APARTMENT_THREADED
00024
00025 #include <atlbase.h>
00026 //You may derive a class from CComModule and use it if you want to override
00027 //something, but do not change the name of _Module
00028 extern CComModule _Module;
00029 #include <atlcom.h>
00030
00031 //{{AFX_INSERT_LOCATION}}
00032 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00033
00034 #endif // !defined(AFX_STDAFX_H__8C9CC15C_94B3_4714_B06D_6B3D29637EBB__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/DcdServe.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

DcdServe.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DCDSERVE.CPP
00003
00004   Summary:   Main implementation file for an out-of-process COM Component
00005              server providing a Paper-related COM Component: SharePaper.
00006              Access to Class Factories is provided in this module.
00007              DCDSERVE and its managed COPaper COM objects are thread-safe.
00008              This application is meant to run hidden as a local COM server
00009              that offers the COPaper component. Though this local server
00010              offers a simple main window and menu system these are not
00011              seen during normal operation.
00012
00013              This local server supports self-registration and this module
00014              recognizes the -RegServer and -UnregServer command line
00015              switches and has the appropriate functions (RegisterServer
00016              and UnregisterServer) to register this local server in the
00017              system Registry.
00018
00019              For a comprehensive tutorial code tour of DCDSERVE's contents
00020              and offerings see the tutorial DCDSERVE.HTM file. For more
00021              specific technical details on the internal workings see the
00022              comments dispersed throughout the DCDSERVE source code. For
00023              more details on how DCDSERVE's components are functioned by
00024              the DCOMDRAW client see DCOMDRAW.HTM in the main tutorial
00025              directory.
00026
00027   Classes:   CMainWindow.
00028
00029   Functions: InitApplication, WinMain.
00030
00031   Origin:    8-23-97: atrent - Editor-inheritance from LOCSERVE.CPP in
00032                the LOCSERVE Tutorial Code Sample. [Revised]
00033
00034 ----------------------------------------------------------------------------
00035   This file is part of the Microsoft COM Tutorial Code Samples.
00036
00037   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00038
00039   This source code is intended only as a supplement to Microsoft
00040   Development Tools and/or on-line documentation.  See these other
00041   materials for detailed information regarding Microsoft code samples.
00042
00043   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00044   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00045   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00046   PARTICULAR PURPOSE.
00047 ==========================================================================+*/
00048
00049 /*---------------------------------------------------------------------------
00050   We include WINDOWS.H for all Win32 applications.
00051   We include OLE2.H because we will be calling the COM/OLE Libraries.
00052   We include INITGUID.H only once (here) in the entire EXE because we
00053     will be defining GUIDs and want them as constants in the data segment.
00054   We include APPUTIL.H because we will be building this EXE using
00055     the convenient Virtual Window and Dialog classes and other
00056     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00057   We include PAPINT.H and PAPRGUID.H for the common Paper-related
00058     Interface class, GUID, and CLSID specifications.
00059   We include DCDSERVE.H because it has class and resource definitions
00060     specific to this application.
00061   We include SERVER.H because it has internal class declarations for
00062     the server's control object.
00063   We include FACTORY.H because it has the necessary internal class factory
00064     declarations for this component server.
00065 ---------------------------------------------------------------------------*/
00066 #include <windows.h>
00067 #include <ole2.h>
00068 #include <initguid.h>
00069 #include <apputil.h>
00070 #include <papint.h>
00071 #include <papguids.h>
00072 #include "dcdserve.h"
00073 #include "server.h"
00074 #include "factory.h"
00075
00076
00077 // Global variable definitions.
00078
00079 // We encapsulate the control of this COM server (eg, lock and object
00080 // counting) in a server control C++ object.  Here is it's pointer.
00081 CServer*  g_pServer = NULL;
00082
00083
00084 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00085   Method:   CMainWindow::CMainWindow
00086
00087   Summary:  CMainWindow Constructor.
00088
00089   Args:     .
00090
00091   Returns:  .
00092 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00093 CMainWindow::CMainWindow()
00094 {
00095   // Ensure these member variable strings are null strings.
00096   m_szFileName[0] = 0;
00097 }
00098
00099
00100 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00101   Method:   CMainWindow::~CMainWindow
00102
00103   Summary:  CMainWindow Destructor.  Destruction of the main window
00104             indicates that the application should quit and thus the
00105             PostQuitMessage API is called.
00106
00107   Args:     .
00108
00109   Returns:  .
00110 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00111 CMainWindow::~CMainWindow()
00112 {
00113   // CMainWindow is derived from CVirWindow which traps the WM_DESTROY
00114   // message and causes a delete of CMainWindow which in turn causes this
00115   // destructor to run. The WM_DESTROY results when the window is destoyed
00116   // after a close of the window. Prior to exiting the main message loop:
00117
00118   // Close down the factories (ie, Revoke and release the Class Factories).
00119   if (NULL != g_pServer)
00120     g_pServer->CloseFactories();
00121
00122   // We delete the the server control object, CServer.
00123   DELETE_POINTER(g_pServer);
00124
00125   // We then post a WM_QUIT message to cause an exit of the main thread's
00126   // message loop and an exit of this instance of the application.
00127   PostQuitMessage(0);
00128 }
00129
00130
00131 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00132   Method:   CMainWindow::RegisterServer
00133
00134   Summary:  Member function used by this server to register itself in the
00135             system registry.
00136
00137   Args:     void.
00138
00139   Returns:  BOOL
00140               TRUE => Success; FALSE => Failed.
00141 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00142 BOOL CMainWindow::RegisterServer(void)
00143 {
00144   BOOL     bOk = TRUE;
00145   TCHAR    szID[GUID_SIZE+1];
00146   TCHAR    szCLSID[GUID_SIZE+32];
00147   TCHAR    szAPPID[GUID_SIZE+32];
00148   TCHAR    szModulePath[MAX_PATH];
00149   TCHAR    szExeName[MAX_PATH];
00150
00151   // Be safe with null strings in these stack-allocated strings.
00152   szID[0] = 0;
00153   szCLSID[0] = 0;
00154   szAPPID[0] = 0;
00155   szModulePath[0] = 0;
00156   szExeName[0] = 0;
00157
00158   // Obtain the path to this module's executable file for later use.
00159   // GetModuleFileName is an APPUTIL convenience function.
00160   GetModuleFileName(
00161     g_pServer->m_hInstServer,
00162     szModulePath,
00163     sizeof(szModulePath)/sizeof(TCHAR));
00164
00165   // Obtain the file name of this module's executable for later use.
00166   // GetExeName is an APPUTIL convenience function.
00167   GetExeName(
00168     g_pServer->m_hInstServer,
00169     szExeName);
00170
00171   /*-------------------------------------------------------------------------
00172     Create registry entries for the SharePaper Component.
00173   -------------------------------------------------------------------------*/
00174   // Create some base key strings.
00175   StringFromGUID2(CLSID_SharePaper, szID, GUID_SIZE);
00176   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00177   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00178   // Use the ClassID of this first component as the AppID
00179   // for all of the server's components.
00180   lstrcpyn(szAPPID, TEXT("AppID\\"), sizeof(szAPPID)/sizeof(TCHAR));
00181   lstrncat(szAPPID, szID, sizeof(szAPPID)/sizeof(TCHAR) - lstrlen(szAPPID));
00182
00183   /*-------------------------------------------------------------------------
00184     Create ProgID keys.
00185   -------------------------------------------------------------------------*/
00186   SetRegKeyValue(
00187     TEXT("CTS.SharePaper.1"),
00188     NULL,
00189     TEXT("SharePaper Component - DCDSERVE Code Sample"));
00190   SetRegKeyValue(
00191     TEXT("CTS.SharePaper.1"),
00192     TEXT("CLSID"),
00193     szID);
00194
00195   /*-------------------------------------------------------------------------
00196     Create VersionIndependentProgID keys.
00197   -------------------------------------------------------------------------*/
00198   SetRegKeyValue(
00199     TEXT("CTS.SharePaper"),
00200     NULL,
00201     TEXT("SharePaper Component - DCDSERVE Code Sample"));
00202   SetRegKeyValue(
00203     TEXT("CTS.SharePaper"),
00204     TEXT("CurVer"),
00205     TEXT("CTS.SharePaper.1"));
00206   SetRegKeyValue(
00207     TEXT("CTS.SharePaper"),
00208     TEXT("CLSID"),
00209     szID);
00210
00211   /*-------------------------------------------------------------------------
00212     Create entries under CLSID.
00213   -------------------------------------------------------------------------*/
00214   SetRegKeyValue(
00215     szCLSID,
00216     NULL,
00217     TEXT("SharePaper Component - DCDSERVE Code Sample"));
00218   SetRegKeyValue(
00219     szCLSID,
00220     TEXT("ProgID"),
00221     TEXT("CTS.SharePaper.1"));
00222   SetRegKeyValue(
00223     szCLSID,
00224     TEXT("VersionIndependentProgID"),
00225     TEXT("CTS.SharePaper"));
00226   SetRegKeyValue(
00227     szCLSID,
00228     TEXT("NotInsertable"),
00229     NULL);
00230   SetRegKeyValue(
00231     szCLSID,
00232     TEXT("LocalServer32"),
00233     szModulePath);
00234   AddRegNamedValue(
00235     szCLSID,
00236     NULL,
00237     TEXT("AppID"),
00238     szID);
00239
00240   /*-------------------------------------------------------------------------
00241     Create Server AppID entries.
00242   -------------------------------------------------------------------------*/
00243   SetRegKeyValue(
00244     szAPPID,
00245     NULL,
00246     TEXT("CTS.SharePaper.1"));
00247   SetRegKeyValue(
00248     TEXT("AppID"),
00249     szExeName,
00250     NULL);
00251   AddRegNamedValue(
00252     TEXT("AppID"),
00253     szExeName,
00254     TEXT("AppID"),
00255     szID);
00256
00257   return bOk;
00258 }
00259
00260
00261 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00262   Method:   CMainWindow::UnregisterServer
00263
00264   Summary:  Member function used by this server to unregister itself from
00265             the system Registry.
00266
00267   Args:     void.
00268
00269   Returns:  BOOL
00270               TRUE => Success; FALSE => Failed.
00271 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00272 BOOL CMainWindow::UnregisterServer(void)
00273 {
00274   BOOL     bOk = TRUE;
00275   TCHAR    szID[GUID_SIZE+1];
00276   TCHAR    szCLSID[GUID_SIZE+32];
00277   TCHAR    szAPPID[GUID_SIZE+32];
00278   TCHAR    szExeName[MAX_PATH];
00279   TCHAR    szTemp[MAX_PATH+GUID_SIZE];
00280
00281   // Obtain the file name of this module's executable for later use.
00282   GetExeName(
00283     g_pServer->m_hInstServer,
00284     szExeName);
00285
00286   /*-------------------------------------------------------------------------
00287     Delete registry entries for the SharePaper Component.
00288   -------------------------------------------------------------------------*/
00289   //Create some base key strings.
00290   StringFromGUID2(CLSID_SharePaper, szID, GUID_SIZE);
00291   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00292   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00293   lstrcpyn(szAPPID, TEXT("AppID\\"), sizeof(szAPPID)/sizeof(TCHAR));
00294   lstrncat(szAPPID, szID, sizeof(szAPPID)/sizeof(TCHAR) - lstrlen(szAPPID));
00295
00296   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.SharePaper\\CurVer"));
00297   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.SharePaper\\CLSID"));
00298   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.SharePaper"));
00299
00300   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.SharePaper.1\\CLSID"));
00301   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.SharePaper.1"));
00302
00303   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00304   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00305
00306   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00307   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00308
00309   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00310   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00311
00312   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("LocalServer32"));
00313   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00314
00315   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00316
00317   wsprintf(szTemp, TEXT("%s\\%s"), TEXT("AppID"), szExeName);
00318   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00319   RegDeleteKey(HKEY_CLASSES_ROOT, szAPPID);
00320
00321   return bOk;
00322 }
00323
00324
00325 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00326   Method:   CMainWindow::DoMenu
00327
00328   Summary:  Dispatch and handle the main menu commands.
00329
00330   Args:     WPARAM wParam,
00331               First message parameter (word sized).
00332             LPARAM lParam)
00333               Second message parameter (long sized).
00334
00335   Returns:  LRESULT
00336               Standard Windows WindowProc return value.
00337 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00338 LRESULT CMainWindow::DoMenu(
00339           WPARAM wParam,
00340           LPARAM lParam)
00341 {
00342   LRESULT lResult = FALSE;
00343   HMENU hMenu  = ::GetMenu(m_hWnd);
00344
00345   switch (LOWORD(wParam))
00346   {
00347     //----------------------------------------------------------------------
00348     // Handle File Menu Commands.
00349     //----------------------------------------------------------------------
00350     case IDM_FILE_EXIT:
00351       // The user commands us to exit this application so we tell the
00352       // Main window to close itself.
00353       ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00354       break;
00355
00356     //----------------------------------------------------------------------
00357     // Handle Help Menu Commands.
00358     //----------------------------------------------------------------------
00359     case IDM_HELP_ABOUT:
00360       {
00361         CAboutBox dlgAboutBox;
00362
00363         // Show the standard About Box dialog for this EXE by telling the
00364         // dialog C++ object to show itself by invoking its ShowDialog
00365         // method.  Pass it this EXE instance and the parent window handle.
00366         // Use a dialog resource ID for the dialog template stored in
00367         // this EXE module's resources.
00368         dlgAboutBox.ShowDialog(
00369           m_hInst,
00370           MAKEINTRESOURCE(IDM_HELP_ABOUT),
00371           m_hWnd);
00372       }
00373       break;
00374
00375     default:
00376       // Defer all messages NOT handled here to the Default Window Proc.
00377       lResult = ::DefWindowProc(m_hWnd, WM_COMMAND, wParam, lParam);
00378       break;
00379   }
00380
00381   return(lResult);
00382 }
00383
00384
00385 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00386   Method:   CMainWindow::InitInstance
00387
00388   Summary:  Instantiates an instance of the main application window.
00389             This method must be called only once, immediately after
00390             window class construction.  We take care to delete 'this'
00391             CMainWindow if we must return the error condition FALSE.
00392
00393   Args:     HINSTANCE hInstance,
00394               Handle of the application instance.
00395             int nShow)
00396               Command to pass to ShowWindow.
00397
00398   Returns:  BOOL.
00399               TRUE if success; FALSE if not.
00400 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00401 BOOL CMainWindow::InitInstance(
00402        HINSTANCE hInstance,
00403        int nShow)
00404 {
00405   BOOL bOk = FALSE;
00406   HWND hWnd;
00407
00408   // Note, the Create method sets the m_hWnd member so we don't
00409   // need to set it explicitly here first.
00410
00411   // Here is the create of this window.  Size the window reasonably.
00412   // Create sets both m_hInst and m_hWnd.
00413   hWnd = Create(
00414            TEXT(MAIN_WINDOW_CLASS_NAME_STR),
00415            TEXT(MAIN_WINDOW_TITLE_STR),
00416            WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
00417              | WS_MAXIMIZEBOX | WS_THICKFRAME,
00418            CW_USEDEFAULT,
00419            CW_USEDEFAULT,
00420            ::GetSystemMetrics(SM_CXSCREEN)*3/5,
00421            ::GetSystemMetrics(SM_CYSCREEN)*3/5,
00422            NULL,
00423            NULL,
00424            hInstance);
00425   if (hWnd)
00426   {
00427     // Assign the server's copy of the main window handle.
00428     g_pServer->m_hWndServer = m_hWnd;
00429
00430     bOk = TRUE;
00431   }
00432
00433   return (bOk);
00434 }
00435
00436
00437 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00438   Method:   CMainWindow::WindowProc
00439
00440   Summary:  Main window procedure for this window object.  See CVirWindow
00441             in the APPUTIL library (APPUTIL.CPP) for details on how this
00442             method gets called by the global WindowProc.
00443
00444   Args:     UINT uMsg,
00445               Windows message that is "sent" to this window.
00446             WPARAM wParam,
00447               First message parameter (word sized).
00448             LPARAM lParam)
00449               Second message parameter (long sized).
00450
00451   Returns:  LRESULT
00452               Standard Windows WindowProc return value.
00453 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00454 LRESULT CMainWindow::WindowProc(
00455           UINT uMsg,
00456           WPARAM wParam,
00457           LPARAM lParam)
00458 {
00459   LRESULT lResult = FALSE;
00460
00461   switch (uMsg)
00462   {
00463     case WM_CREATE:
00464       break;
00465
00466     case WM_COMMAND:
00467       // Dispatch and handle any Menu command messages received.
00468       lResult = DoMenu(wParam, lParam);
00469       break;
00470
00471     case WM_CLOSE:
00472       // The user selected Close on the main window's System menu
00473       // or Exit on the File menu.
00474     case WM_QUIT:
00475       // If the app is being quit then close any associated help windows.
00476     default:
00477       // Defer all messages NOT handled here to the Default Window Proc.
00478       lResult = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
00479       break;
00480   }
00481
00482   return(lResult);
00483 }
00484
00485
00486 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00487   Function: UnicodeOk
00488
00489   Summary:  Checks if the platform will handle unicode versions of
00490             Win32 string API calls.
00491
00492   Args:     void
00493
00494   Returns:  BOOL
00495               TRUE if unicode support; FALSE if not.
00496 ------------------------------------------------------------------------F-F*/
00497 BOOL UnicodeOk(void)
00498 {
00499   BOOL bOk = TRUE;
00500   TCHAR szUserName[MAX_STRING_LENGTH];
00501   DWORD dwSize = MAX_STRING_LENGTH;
00502
00503   if (!GetUserName(szUserName, &dwSize))
00504     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00505
00506   return bOk;
00507 }
00508
00509
00510 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00511   Function: InitApplication
00512
00513   Summary:  Initializes the application and registers its main window
00514             class. InitApplication is called only once (in WinMain).
00515
00516   Args:     HINSTANCE hInstance)
00517               Handle to the first instance of the application.
00518
00519   Returns:  BOOL.
00520               TRUE if success; FALSE if not.
00521 ------------------------------------------------------------------------F-F*/
00522 BOOL InitApplication(
00523        HINSTANCE hInstance)
00524 {
00525   BOOL bOk;
00526   // The window class for all instances of the main frame window.
00527   WNDCLASSEX wcf;
00528
00529   // Assign the appropriate values for this main frame window class.
00530   wcf.cbSize        = sizeof(WNDCLASSEX);
00531   wcf.cbClsExtra    = 0;            // No per-class extra data.
00532   wcf.cbWndExtra    = 0;            // No per-window extra data.
00533   wcf.hInstance     = hInstance;    // Application module instance.
00534   wcf.lpfnWndProc   = &WindowProc;  // Global Window Procedure (defined in
00535                                     // APPUTIL for all CVirWindows).
00536   wcf.hCursor       = LoadCursor(NULL, IDC_ARROW); // Load app cursor.
00537   wcf.hIcon         = (HICON) LoadIcon(            // Load app icon.
00538                                 hInstance,
00539                                 TEXT("AppIcon"));
00540   wcf.hIconSm       = (HICON) LoadImage(           // Load small icon.
00541                                 hInstance,
00542                                 TEXT("AppIcon"),
00543                                 IMAGE_ICON,
00544                                 16, 16,
00545                                 0);
00546   wcf.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);  // Default backgnd color.
00547   wcf.style         = CS_HREDRAW | CS_VREDRAW;     // Class style(s).
00548   wcf.lpszClassName = TEXT(MAIN_WINDOW_CLASS_NAME_STR); // Class name.
00549   wcf.lpszMenuName  = TEXT(MAIN_WINDOW_CLASS_MENU_STR); // Menu name.
00550
00551   // Register the window class and return FALSE if unsuccesful.
00552   bOk = RegisterClassEx(&wcf);
00553
00554   return (bOk);
00555 }
00556
00557
00558 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00559   Function: WinMain
00560
00561   Summary:  The Windows main entry point function for this application.
00562             Initializes the application, the COM Libraries, and starts
00563             the main application message loop.
00564
00565   Args:     HINSTANCE hInstance,
00566               Instance handle; a new one for each invocation of this app.
00567             HINSTANCE hPrevInstance,
00568               Instance handle of the previous instance. NULL in Win32.
00569             LPSTR lpCmdLine,
00570               Windows passes a pointer to the application's
00571               invocation command line.
00572             int nCmdShow)
00573               Bits telling the show state of the application.
00574
00575   Returns:  int
00576               msg.wParam (upon exit of message loop).
00577               FALSE if this instance couldn't initialize and run.
00578 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00579 extern "C" int WINAPI WinMain(
00580                         HINSTANCE hInstance,
00581                         HINSTANCE hPrevInstance,
00582                         LPSTR lpCmdLine,
00583                         int nCmdShow)
00584 {
00585   CMainWindow* pWin = NULL;
00586   HRESULT hr;
00587   int iRun = TRUE;
00588   MSG msg;
00589
00590   // If we were compiled for UNICODE and the platform seems OK with this
00591   // then proceed.  Else we error and exit the app.
00592   if (UnicodeOk())
00593   {
00594     // Ensure that DCOM (Distributed COM) is installed.
00595     if (DComOk())
00596     {
00597       // Call to initialize the COM Library.  Use the SUCCEEDED macro
00598       // to detect success.  If fail then exit app with error message.
00599       if (SUCCEEDED(CoInitialize(NULL)))
00600       {
00601         // Initialize for server security.
00602         hr = CoInitializeSecurity(
00603                NULL,                        //Points to security descriptor
00604                -1,                          //Count of entries in asAuthSvc
00605                NULL,                        //Array of names to register
00606                NULL,                        //Reserved for future use
00607                RPC_C_AUTHN_LEVEL_NONE,      //Default authentication level
00608                                             // for proxies
00609                RPC_C_IMP_LEVEL_IMPERSONATE, //Default impersonation level
00610                                             // for proxies
00611                NULL,                        //Reserved; must be set to NULL
00612                EOAC_NONE,                   //Additional client or
00613                                             // server-side capabilities
00614                NULL);                       //Reserved for future use
00615         if (SUCCEEDED(hr))
00616         {
00617           // If we succeeded in initializing the COM Library we proceed to
00618           // initialize the application.  If we can't init the application
00619           // then we signal shut down with an error message exit.
00620           iRun = InitApplication(hInstance);
00621           if (iRun)
00622           {
00623             // Assume we'll set iRun to TRUE when initialization is done.
00624             iRun = FALSE;
00625
00626             // We are still go for running so we try to create a nifty new
00627             // CMainWindow object for this app instance.
00628             pWin = new CMainWindow;
00629             if (NULL != pWin)
00630             {
00631               // Setup the server control object.
00632               g_pServer = new CServer;
00633               if (NULL != g_pServer)
00634               {
00635                 // Assign the server's instance handle.
00636                 g_pServer->m_hInstServer = hInstance;
00637
00638                 // Check command line for switches to register or unregister
00639                 // this server's managed components.   iRun will be set to 2
00640                 // to signal an immediate and quiet exit of this application
00641                 // if such registration or unregistration is requested.
00642                 if (0 == lstrcmpiA(lpCmdLine, "-RegServer")
00643                     || 0 == lstrcmpiA(lpCmdLine, "/RegServer"))
00644                 {
00645                   if (pWin->RegisterServer())
00646                     iRun = 2;
00647                 }
00648                 else if (0 == lstrcmpiA(lpCmdLine, "-UnregServer")
00649                          || 0 == lstrcmpiA(lpCmdLine, "/UnregServer"))
00650                 {
00651                   if (pWin->UnregisterServer())
00652                     iRun = 2;
00653                 }
00654
00655                 if (FALSE == iRun)
00656                 {
00657                   // If we did not process a command line switch that
00658                   // requires immediate exit, then initialize an instance
00659                   // of the new CMainWindow. This entails creating the main
00660                   // window.
00661                   if (pWin->InitInstance(hInstance, nCmdShow))
00662                   {
00663                     // Create and register the Class Factories.  But only do
00664                     // so if this application has been launched by COM as
00665                     // indicated by the -Embedding command line switch.
00666                     if (0 == lstrcmpiA(lpCmdLine, "-Embedding")
00667                         || 0 == lstrcmpiA(lpCmdLine, "/Embedding"))
00668                       iRun = g_pServer->OpenFactories();
00669                   }
00670                 }
00671               }
00672             }
00673           }
00674         }
00675
00676         switch (iRun)
00677         {
00678           case TRUE:
00679             {
00680               // If we initialized the app instance properly then we are
00681               // still go for running. We then start up the main message
00682               // pump for the application. The application will live hidden
00683               // as a local server.
00684               while (GetMessage(&msg, NULL, 0, 0))
00685               {
00686                 TranslateMessage(&msg);
00687                 DispatchMessage(&msg);
00688               }
00689
00690               // We'll pass to the OS the reason why we exited the message
00691               // loop.
00692               iRun = (int) msg.wParam;
00693             }
00694             break;
00695
00696           case FALSE:
00697             // We failed to initialize the application--issue an error
00698             // messagebox.  Can't initialize or can't run stand-alone.
00699             ErrorBox(hInstance, NULL, IDS_APPINITFAILED);
00700
00701             // Delete the CMainWindow object.
00702             DELETE_POINTER(pWin);
00703
00704             // Pass the OS an error code of 1.
00705             iRun = 1;
00706             break;
00707
00708           default:
00709             // Pass the OS an error code of 0.
00710             iRun = 0;
00711             break;
00712         }
00713
00714         // We're exiting this app (either normally or by init failure) so
00715         // shut down the COM Library.
00716         CoUninitialize();
00717       }
00718       else
00719       {
00720         // We failed to Initialize the COM Library. Put up error message box
00721         // saying that COM Library couldn't be initialized.  Parent window
00722         // is desktop (ie, NULL). Exit the failed application (ie, by
00723         // returning FALSE to WinMain).
00724         ErrorBox(hInstance, NULL, IDS_COMINITFAILED);
00725       }
00726     }
00727     else
00728     {
00729       // If DCOM is not installed indicate an error and
00730       // exit the app immediately.
00731       ErrorBox(hInstance, NULL, IDS_NODCOM);
00732     }
00733   }
00734   else
00735   {
00736     // If we were compiled for UNICODE but the platform has problems with
00737     // this then indicate an error and exit the app immediately.
00738     CHAR szMsg[MAX_STRING_LENGTH];
00739
00740     if (LoadStringA(
00741           hInstance,
00742           IDS_NOUNICODE,
00743           szMsg,
00744           MAX_STRING_LENGTH))
00745     {
00746       MessageBoxA(
00747         NULL,
00748         szMsg,
00749         ERROR_TITLE_STR,
00750         MB_OK | MB_ICONEXCLAMATION);
00751     }
00752   }
00753
00754   return iRun;
00755 }
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::CursorTypeEnum Member List

This is the complete list of members for msado15::CursorTypeEnum, including all inherited members.
adOpenDynamic | msado15::CursorTypeEnum | [static]
adOpenForwardOnly | msado15::CursorTypeEnum | [static]
adOpenKeyset | msado15::CursorTypeEnum | [static]
adOpenStatic | msado15::CursorTypeEnum | [static]
adOpenUnspecified | msado15::CursorTypeEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step2/ADsFirstExt_p.c Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step2

ADsFirstExt_p.c

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the proxy stub code */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Mon Apr 29 12:54:31 2002
00006  */
00007 /* Compiler settings for C:\sdk\sdkpublic\samples\netds\adsi\samples\Extension\tutorial\Step2\ADsFirstExt.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013 #define USE_STUBLESS_PROXY
00014
00015
00016 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00017 #ifndef __REDQ_RPCPROXY_H_VERSION__
00018 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00019 #endif
00020
00021
00022 #include "rpcproxy.h"
00023 #ifndef __RPCPROXY_H_VERSION__
00024 #error this stub requires an updated version of <rpcproxy.h>
00025 #endif // __RPCPROXY_H_VERSION__
00026
00027
00028 #include "ADsFirstExt.h"
00029
00030 #define TYPE_FORMAT_STRING_SIZE   3
00031 #define PROC_FORMAT_STRING_SIZE   23
00032
00033 typedef struct _MIDL_TYPE_FORMAT_STRING
00034     {
00035     short          Pad;
00036     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00037     } MIDL_TYPE_FORMAT_STRING;
00038
00039 typedef struct _MIDL_PROC_FORMAT_STRING
00040     {
00041     short          Pad;
00042     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00043     } MIDL_PROC_FORMAT_STRING;
00044
00045
00046 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00047 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00048
00049
00050 /* Object interface: IUnknown, ver. 0.0,
00051    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00052
00053
00054 /* Object interface: IDispatch, ver. 0.0,
00055    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IHelloWorld, ver. 0.0,
00059    GUID={0xE1E3EDF7,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}} */
00060
00061
00062 extern const MIDL_STUB_DESC Object_StubDesc;
00063
00064
00065 extern const MIDL_SERVER_INFO IHelloWorld_ServerInfo;
00066
00067 #pragma code_seg(".orpc")
00068
00069 static const MIDL_STUB_DESC Object_StubDesc =
00070     {
00071     0,
00072     NdrOleAllocate,
00073     NdrOleFree,
00074     0,
00075     0,
00076     0,
00077     0,
00078     0,
00079     __MIDL_TypeFormatString.Format,
00080     1, /* -error bounds_check flag */
00081     0x20000, /* Ndr library version */
00082     0,
00083     0x50100a4, /* MIDL Version 5.1.164 */
00084     0,
00085     0,
00086     0,  /* notify & notify_flag routine table */
00087     1,  /* Flags */
00088     0,  /* Reserved3 */
00089     0,  /* Reserved4 */
00090     0   /* Reserved5 */
00091     };
00092
00093 static const unsigned short IHelloWorld_FormatStringOffsetTable[] =
00094     {
00095     (unsigned short) -1,
00096     (unsigned short) -1,
00097     (unsigned short) -1,
00098     (unsigned short) -1,
00099     0
00100     };
00101
00102 static const MIDL_SERVER_INFO IHelloWorld_ServerInfo =
00103     {
00104     &Object_StubDesc,
00105     0,
00106     __MIDL_ProcFormatString.Format,
00107     &IHelloWorld_FormatStringOffsetTable[-3],
00108     0,
00109     0,
00110     0,
00111     0
00112     };
00113
00114 static const MIDL_STUBLESS_PROXY_INFO IHelloWorld_ProxyInfo =
00115     {
00116     &Object_StubDesc,
00117     __MIDL_ProcFormatString.Format,
00118     &IHelloWorld_FormatStringOffsetTable[-3],
00119     0,
00120     0,
00121     0
00122     };
00123
00124 CINTERFACE_PROXY_VTABLE(8) _IHelloWorldProxyVtbl =
00125 {
00126     &IHelloWorld_ProxyInfo,
00127     &IID_IHelloWorld,
00128     IUnknown_QueryInterface_Proxy,
00129     IUnknown_AddRef_Proxy,
00130     IUnknown_Release_Proxy ,
00131     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00132     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00133     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00134     0 /* IDispatch_Invoke_Proxy */ ,
00135     (void *)-1 /* IHelloWorld::Say */
00136 };
00137
00138
00139 static const PRPC_STUB_FUNCTION IHelloWorld_table[] =
00140 {
00141     STUB_FORWARDING_FUNCTION,
00142     STUB_FORWARDING_FUNCTION,
00143     STUB_FORWARDING_FUNCTION,
00144     STUB_FORWARDING_FUNCTION,
00145     NdrStubCall2
00146 };
00147
00148 CInterfaceStubVtbl _IHelloWorldStubVtbl =
00149 {
00150     &IID_IHelloWorld,
00151     &IHelloWorld_ServerInfo,
00152     8,
00153     &IHelloWorld_table[-3],
00154     CStdStubBuffer_DELEGATING_METHODS
00155 };
00156
00157 #pragma data_seg(".rdata")
00158
00159 #if !defined(__RPC_WIN32__)
00160 #error  Invalid build platform for this stub.
00161 #endif
00162
00163 #if !(TARGET_IS_NT40_OR_LATER)
00164 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00165 #error   -Oif or -Oicf, more than 32 methods in the interface.
00166 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00167 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00168 #endif
00169
00170
00171 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00172     {
00173         0,
00174         {
00175
00176   /* Procedure Say */
00177
00178       0x33,   /* FC_AUTO_HANDLE */
00179       0x6c,   /* Old Flags:  object, Oi2 */
00180 /*  2 */  NdrFcLong( 0x0 ), /* 0 */
00181 /*  6 */  NdrFcShort( 0x7 ),  /* 7 */
00182 #ifndef _ALPHA_
00183 /*  8 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00184 #else
00185       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00186 #endif
00187 /* 10 */  NdrFcShort( 0x0 ),  /* 0 */
00188 /* 12 */  NdrFcShort( 0x8 ),  /* 8 */
00189 /* 14 */  0x4,    /* Oi2 Flags:  has return, */
00190       0x1,    /* 1 */
00191
00192   /* Return value */
00193
00194 /* 16 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00195 #ifndef _ALPHA_
00196 /* 18 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00197 #else
00198       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00199 #endif
00200 /* 20 */  0x8,    /* FC_LONG */
00201       0x0,    /* 0 */
00202
00203       0x0
00204         }
00205     };
00206
00207 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00208     {
00209         0,
00210         {
00211       NdrFcShort( 0x0 ),  /* 0 */
00212
00213       0x0
00214         }
00215     };
00216
00217 const CInterfaceProxyVtbl * _ADsFirstExt_ProxyVtblList[] =
00218 {
00219     ( CInterfaceProxyVtbl *) &_IHelloWorldProxyVtbl,
00220     0
00221 };
00222
00223 const CInterfaceStubVtbl * _ADsFirstExt_StubVtblList[] =
00224 {
00225     ( CInterfaceStubVtbl *) &_IHelloWorldStubVtbl,
00226     0
00227 };
00228
00229 PCInterfaceName const _ADsFirstExt_InterfaceNamesList[] =
00230 {
00231     "IHelloWorld",
00232     0
00233 };
00234
00235 const IID *  _ADsFirstExt_BaseIIDList[] =
00236 {
00237     &IID_IDispatch,
00238     0
00239 };
00240
00241
00242 #define _ADsFirstExt_CHECK_IID(n) IID_GENERIC_CHECK_IID( _ADsFirstExt, pIID, n)
00243
00244 int __stdcall _ADsFirstExt_IID_Lookup( const IID * pIID, int * pIndex )
00245 {
00246
00247     if(!_ADsFirstExt_CHECK_IID(0))
00248         {
00249         *pIndex = 0;
00250         return 1;
00251         }
00252
00253     return 0;
00254 }
00255
00256 const ExtendedProxyFileInfo ADsFirstExt_ProxyFileInfo =
00257 {
00258     (PCInterfaceProxyVtblList *) & _ADsFirstExt_ProxyVtblList,
00259     (PCInterfaceStubVtblList *) & _ADsFirstExt_StubVtblList,
00260     (const PCInterfaceName * ) & _ADsFirstExt_InterfaceNamesList,
00261     (const IID ** ) & _ADsFirstExt_BaseIIDList,
00262     & _ADsFirstExt_IID_Lookup,
00263     1,
00264     2,
00265     0, /* table of [async_uuid] interfaces */
00266     0, /* Filler1 */
00267     0, /* Filler2 */
00268     0  /* Filler3 */
00269 };
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/DynOut/DynOutp.c Source File

  • NetDS
  • RPC
  • DynOut

DynOutp.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1995 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011 //
00012 // Sample code to show server-side
00013 // memory allocation for an [out] parameter
00014 //
00015 //
00016
00017 #include <assert.h>
00018 #include "stdio.h"
00019 #include "string.h"
00020 #include "dynout.h"
00021
00022 short GrabChunk(long *lSize, unsigned char **ppData)
00023 {
00024   int cbChunk = rand() % 10000; // how much memory to grab
00025   int cChar = 33 + rand()%30;   // what to fill it with
00026
00027   printf("GrabChunk() allocating %d bytes of '%c'\n",cbChunk,cChar);
00028
00029   *lSize = (long)cbChunk;
00030   *ppData = midl_user_allocate(cbChunk);
00031   memset(*ppData,cChar,cbChunk);
00032
00033   return 0;
00034 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/land.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

land.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Land.h"
00021
00022 const GUID CLandBasedVehicle::thisGuid = { 0x2974380e, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CLandBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SIGNATURE Member List

This is the complete list of members for _SIGNATURE, including all inherited members.
MessageId | _SIGNATURE
Tag | _SIGNATURE
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/StdAfx.h Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification

StdAfx.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       StdAfx.h
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011 #if !defined(AFX_STDAFX_H__DDE8437E_FFF8_4CA6_8514_387D7E8125DF__INCLUDED_)
00012 #define AFX_STDAFX_H__DDE8437E_FFF8_4CA6_8514_387D7E8125DF__INCLUDED_
00013
00014 #if _MSC_VER > 1000
00015 #pragma once
00016 #endif // _MSC_VER > 1000
00017
00018 #define STRICT
00019 #ifndef _WIN32_WINNT
00020 #define _WIN32_WINNT 0x0400
00021 #endif
00022 #define _ATL_APARTMENT_THREADED
00023
00024 #include <atlbase.h>
00025 //You may derive a class from CComModule and use it if you want to override
00026 //something, but do not change the name of _Module
00027 extern CComModule _Module;
00028 #include <atlcom.h>
00029
00030 #include "event.h"
00031 #include "wmsserver.h"
00032 #include "WMSBasicPlugin.h"
00033
00034
00035 //{{AFX_INSERT_LOCATION}}
00036 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00037
00038 #endif // !defined(AFX_STDAFX_H__DDE8437E_FFF8_4CA6_8514_387D7E8125DF__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/land.h Source File

  • SysMgmt
  • MMC
  • WMI

land.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _LAND_H
00021 #define _LAND_H
00022
00023 #include "DeleBase.h"
00024
00025 class CLandBasedVehicle : public CDelegationBase {
00026 public:
00027     CLandBasedVehicle() { }
00028
00029     virtual ~CLandBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Land-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_LANDICON; }
00034
00035 private:
00036     enum { IDM_NEW_LAND = 2 };
00037
00038     // {2974380E-4C4B-11d2-89D8-000021473128}
00039     static const GUID thisGuid;
00040 };
00041
00042
00043 #endif // _LAND_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CScreenCanvas Member List

This is the complete list of members for CScreenCanvas, including all inherited members.
_hdc | CCanvas | [protected]
_hwnd | CScreenCanvas | [protected]
CCanvas() | CCanvas | [inline]
Char(int x, int y, TCHAR ch) | CCanvas | [inline]
Circle(int x, int y, int r) | CCanvas | [inline]
Clear(RECT &rect) | CCanvas | [inline]
CScreenCanvas(HWND hwnd) | CScreenCanvas | [inline]
DPtoLP(LPPOINT lppt) | CCanvas | [inline]
Init(HDC hdc) | CCanvas | [inline, protected]
Line(COORD x1, COORD y1, COORD x2, COORD y2) | CCanvas | [inline]
LPtoDP(LPPOINT lppt) | CCanvas | [inline]
operator HDC() | CCanvas | [inline]
RCText(LPRECT lprc, LPTSTR buf, int cBuf) | CCanvas | [inline]
Scale(UINT iScale) | CCanvas | [inline]
Scroll(int dx, int dy) | CCanvas | [inline]
Text(int x, int y, LPTSTR buf, int cBuf) | CCanvas | [inline]
TextAlign(WORD aligntype) | CCanvas | [inline]
~CScreenCanvas() | CScreenCanvas | [inline]
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/resource.h Source File

  • SysMgmt
  • MMC
  • Extens

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDB_SMOPEN                      111
00012 #define IDB_SMBMP                       112
00013 #define IDB_LGBMP                       113
00014 #define IDR_SMICONS                     120
00015 #define IDR_LGICONS                     121
00016 #define IDB_ROCKET                      40004
00017 #define IDB_CAR                         40005
00018 #define IDB_PLANE                       40006
00019 #define IDB_BIKE                        40007
00020 #define IDB_ROCKET2                     40008
00021 #define IDB_CAR2                        40009
00022 #define IDB_PLANE2                      40010
00023 #define IDB_BIKE2                       40011
00024 #define IDB_CLOSED2                     40012
00025 #define IDB_OPEN2                       40013
00026 #define IDB_CLOSED                      40014
00027 #define IDB_OPEN                        40015
00028
00029 // Next default values for new objects
00030 //
00031 #ifdef APSTUDIO_INVOKED
00032 #ifndef APSTUDIO_READONLY_SYMBOLS
00033 #define _APS_NEXT_RESOURCE_VALUE        115
00034 #define _APS_NEXT_COMMAND_VALUE         40016
00035 #define _APS_NEXT_CONTROL_VALUE         1000
00036 #define _APS_NEXT_SYMED_VALUE           101
00037 #endif
00038 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/basesnap.h Source File

  • SysMgmt
  • MMC
  • Ppgeext

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {CONTEXTEXTENSION = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/WiaWrap.cpp Source File

  • Multimedia
  • wia
  • GetImage

WiaWrap.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010
00011 #include "DataCallback.h"
00012 #include "ProgressDlg.h"
00013 #include "WiaWrap.h"
00014
00015 namespace WiaWrap
00016 {
00017
00018 //////////////////////////////////////////////////////////////////////////
00019 //
00020 //
00021 //
00022
00023 #ifndef MAX_GUID_STRING_LEN
00024 #define MAX_GUID_STRING_LEN 39
00025 #endif //MAX_GUID_STRING_LEN
00026
00027 //////////////////////////////////////////////////////////////////////////
00028 //
00029 // ReadPropertyLong
00030 //
00031
00032 HRESULT
00033 ReadPropertyLong(
00034     IWiaPropertyStorage *pWiaPropertyStorage,
00035     const PROPSPEC      *pPropSpec,
00036     LONG                *plResult
00037 )
00038 {
00039     PROPVARIANT PropVariant;
00040
00041     HRESULT hr = pWiaPropertyStorage->ReadMultiple(
00042         1,
00043         pPropSpec,
00044         &PropVariant
00045     );
00046
00047     // Generally, the return value should be checked against S_FALSE.
00048     // If ReadMultiple returns S_FALSE, it means the property name or ID
00049     // had valid syntax, but it didn't exist in this property set, so
00050     // no properties were retrieved, and each PROPVARIANT structure is set
00051     // to VT_EMPTY. But the following switch statement will handle this case
00052     // and return E_FAIL. So the caller of ReadPropertyLong does not need
00053     // to check for S_FALSE explicitly.
00054
00055     if (SUCCEEDED(hr))
00056     {
00057         switch (PropVariant.vt)
00058         {
00059             case VT_I1:
00060             {
00061                 *plResult = (LONG) PropVariant.cVal;
00062
00063                 hr = S_OK;
00064
00065                 break;
00066             }
00067
00068             case VT_UI1:
00069             {
00070                 *plResult = (LONG) PropVariant.bVal;
00071
00072                 hr = S_OK;
00073
00074                 break;
00075             }
00076
00077             case VT_I2:
00078             {
00079                 *plResult = (LONG) PropVariant.iVal;
00080
00081                 hr = S_OK;
00082
00083                 break;
00084             }
00085
00086             case VT_UI2:
00087             {
00088                 *plResult = (LONG) PropVariant.uiVal;
00089
00090                 hr = S_OK;
00091
00092                 break;
00093             }
00094
00095             case VT_I4:
00096             {
00097                 *plResult = (LONG) PropVariant.lVal;
00098
00099                 hr = S_OK;
00100
00101                 break;
00102             }
00103
00104             case VT_UI4:
00105             {
00106                 *plResult = (LONG) PropVariant.ulVal;
00107
00108                 hr = S_OK;
00109
00110                 break;
00111             }
00112
00113             case VT_INT:
00114             {
00115                 *plResult = (LONG) PropVariant.intVal;
00116
00117                 hr = S_OK;
00118
00119                 break;
00120             }
00121
00122             case VT_UINT:
00123             {
00124                 *plResult = (LONG) PropVariant.uintVal;
00125
00126                 hr = S_OK;
00127
00128                 break;
00129             }
00130
00131             case VT_R4:
00132             {
00133                 *plResult = (LONG) (PropVariant.fltVal + 0.5);
00134
00135                 hr = S_OK;
00136
00137                 break;
00138             }
00139
00140             case VT_R8:
00141             {
00142                 *plResult = (LONG) (PropVariant.dblVal + 0.5);
00143
00144                 hr = S_OK;
00145
00146                 break;
00147             }
00148
00149             default:
00150             {
00151                 hr = E_FAIL;
00152
00153                 break;
00154             }
00155         }
00156     }
00157
00158     PropVariantClear(&PropVariant);
00159
00160     return hr;
00161 }
00162
00163 //////////////////////////////////////////////////////////////////////////
00164 //
00165 // ReadPropertyGuid
00166 //
00167
00168 HRESULT
00169 ReadPropertyGuid(
00170     IWiaPropertyStorage *pWiaPropertyStorage,
00171     const PROPSPEC      *pPropSpec,
00172     GUID                *pguidResult
00173 )
00174 {
00175     PROPVARIANT PropVariant;
00176
00177     HRESULT hr = pWiaPropertyStorage->ReadMultiple(
00178         1,
00179         pPropSpec,
00180         &PropVariant
00181     );
00182
00183     // Generally, the return value should be checked against S_FALSE.
00184     // If ReadMultiple returns S_FALSE, it means the property name or ID
00185     // had valid syntax, but it didn't exist in this property set, so
00186     // no properties were retrieved, and each PROPVARIANT structure is set
00187     // to VT_EMPTY. But the following switch statement will handle this case
00188     // and return E_FAIL. So the caller of ReadPropertyGuid does not need
00189     // to check for S_FALSE explicitly.
00190
00191     if (SUCCEEDED(hr))
00192     {
00193         switch (PropVariant.vt)
00194         {
00195             case VT_CLSID:
00196             {
00197                 *pguidResult = *PropVariant.puuid;
00198
00199                 hr = S_OK;
00200
00201                 break;
00202             }
00203
00204             case VT_BSTR:
00205             {
00206                 hr = CLSIDFromString(PropVariant.bstrVal, pguidResult);
00207
00208                 break;
00209             }
00210
00211             case VT_LPWSTR:
00212             {
00213                 hr = CLSIDFromString(PropVariant.pwszVal, pguidResult);
00214
00215                 break;
00216             }
00217
00218             case VT_LPSTR:
00219             {
00220                 WCHAR wszGuid[MAX_GUID_STRING_LEN];
00221
00222                 mbstowcs(wszGuid, PropVariant.pszVal, MAX_GUID_STRING_LEN);
00223
00224                 wszGuid[MAX_GUID_STRING_LEN - 1] = L'\0';
00225
00226                 hr = CLSIDFromString(wszGuid, pguidResult);
00227
00228                 break;
00229             }
00230
00231             default:
00232             {
00233                 hr = E_FAIL;
00234
00235                 break;
00236             }
00237         }
00238     }
00239
00240     PropVariantClear(&PropVariant);
00241
00242     return hr;
00243 }
00244
00245 //////////////////////////////////////////////////////////////////////////
00246 //
00247 // WiaGetNumDevices
00248 //
00249
00250 HRESULT
00251 WiaGetNumDevices(
00252     IWiaDevMgr *pSuppliedWiaDevMgr,
00253     ULONG      *pulNumDevices
00254 )
00255 {
00256     HRESULT hr;
00257
00258     // Validate and initialize output parameters
00259
00260     if (pulNumDevices == NULL)
00261     {
00262         return E_POINTER;
00263     }
00264
00265     *pulNumDevices = 0;
00266
00267     // Create a connection to the local WIA device manager
00268
00269     CComPtr<IWiaDevMgr> pWiaDevMgr = pSuppliedWiaDevMgr;
00270
00271     if (pWiaDevMgr == NULL)
00272     {
00273         hr = pWiaDevMgr.CoCreateInstance(CLSID_WiaDevMgr);
00274
00275         if (FAILED(hr))
00276         {
00277             return hr;
00278         }
00279     }
00280
00281     // Get a list of all the WIA devices on the system
00282
00283     CComPtr<IEnumWIA_DEV_INFO> pIEnumWIA_DEV_INFO;
00284
00285     hr = pWiaDevMgr->EnumDeviceInfo(
00286         0,
00287         &pIEnumWIA_DEV_INFO
00288     );
00289
00290     if (FAILED(hr))
00291     {
00292         return hr;
00293     }
00294
00295     // Get the number of WIA devices
00296
00297     ULONG celt;
00298
00299     hr = pIEnumWIA_DEV_INFO->GetCount(&celt);
00300
00301     if (FAILED(hr))
00302     {
00303         return hr;
00304     }
00305
00306     *pulNumDevices = celt;
00307
00308     return S_OK;
00309 }
00310
00311 //////////////////////////////////////////////////////////////////////////
00312 //
00313 // DefaultProgressCallback
00314 //
00315
00316 HRESULT
00317 CALLBACK
00318 DefaultProgressCallback(
00319     LONG   lStatus,
00320     LONG   lPercentComplete,
00321     PVOID  pParam
00322 )
00323 {
00324     CProgressDlg *pProgressDlg = (CProgressDlg *) pParam;
00325
00326     if (pProgressDlg == NULL)
00327     {
00328         return E_POINTER;
00329     }
00330
00331     // If the user has pressed the cancel button, abort transfer
00332
00333     if (pProgressDlg->Cancelled())
00334     {
00335         return S_FALSE;
00336     }
00337
00338     // Form the message text
00339
00340   UINT uID;
00341
00342     switch (lStatus)
00343     {
00344         case IT_STATUS_TRANSFER_FROM_DEVICE:
00345     {
00346       uID = IDS_STATUS_TRANSFER_FROM_DEVICE;
00347             break;
00348     }
00349
00350         case IT_STATUS_PROCESSING_DATA:
00351     {
00352             uID = IDS_STATUS_PROCESSING_DATA;
00353             break;
00354     }
00355
00356         case IT_STATUS_TRANSFER_TO_CLIENT:
00357     {
00358             uID = IDS_STATUS_TRANSFER_TO_CLIENT;
00359             break;
00360     }
00361
00362     default:
00363     {
00364       return E_INVALIDARG;
00365     }
00366     }
00367
00368     TCHAR szFormat[DEFAULT_STRING_SIZE] = _T("%d");
00369
00370     LoadString(g_hInstance, uID, szFormat, COUNTOF(szFormat));
00371
00372     TCHAR szStatusText[DEFAULT_STRING_SIZE];
00373
00374     _sntprintf(szStatusText, COUNTOF(szStatusText) - 1, szFormat, lPercentComplete);
00375
00376     szStatusText[COUNTOF(szStatusText) - 1] = _T('\0');
00377
00378     // Update the progress bar values
00379
00380     pProgressDlg->SetMessage(szStatusText);
00381
00382     pProgressDlg->SetPercent(lPercentComplete);
00383
00384     return S_OK;
00385 }
00386
00387 //////////////////////////////////////////////////////////////////////////
00388 //
00389 // WiaGetImage
00390 //
00391
00392 HRESULT
00393 WiaGetImage(
00394     HWND                 hWndParent,
00395     LONG                 lDeviceType,
00396     LONG                 lFlags,
00397     LONG                 lIntent,
00398     IWiaDevMgr          *pSuppliedWiaDevMgr,
00399     IWiaItem            *pSuppliedItemRoot,
00400     PFNPROGRESSCALLBACK  pfnProgressCallback,
00401     PVOID                pProgressCallbackParam,
00402     GUID                *pguidFormat,
00403     LONG                *plCount,
00404     IStream             ***pppStream
00405 )
00406 {
00407     HRESULT hr;
00408
00409     // Validate and initialize output parameters
00410
00411     if (plCount == NULL)
00412     {
00413         return E_POINTER;
00414     }
00415
00416     if (pppStream == NULL)
00417     {
00418         return E_POINTER;
00419     }
00420
00421     *plCount = 0;
00422     *pppStream = NULL;
00423
00424     // Initialize the local root item variable with the supplied value.
00425     // If no value is supplied, display the device selection common dialog.
00426
00427     CComPtr<IWiaItem> pItemRoot = pSuppliedItemRoot;
00428
00429     if (pItemRoot == NULL)
00430     {
00431         // Initialize the device manager pointer with the supplied value
00432         // If no value is supplied, connect to the local device manager
00433
00434         CComPtr<IWiaDevMgr> pWiaDevMgr = pSuppliedWiaDevMgr;
00435
00436         if (pWiaDevMgr == NULL)
00437         {
00438             hr = pWiaDevMgr.CoCreateInstance(CLSID_WiaDevMgr);
00439
00440             if (FAILED(hr))
00441             {
00442                 return hr;
00443             }
00444         }
00445
00446         // Display the device selection common dialog
00447
00448         hr = pWiaDevMgr->SelectDeviceDlg(
00449             hWndParent,
00450             lDeviceType,
00451             lFlags,
00452             0,
00453             &pItemRoot
00454         );
00455
00456         if (FAILED(hr) || hr == S_FALSE)
00457         {
00458             return hr;
00459         }
00460     }
00461
00462     // Display the image selection common dialog
00463
00464     CComPtrArray<IWiaItem> ppIWiaItem;
00465
00466     hr = pItemRoot->DeviceDlg(
00467         hWndParent,
00468         lFlags,
00469         lIntent,
00470         &ppIWiaItem.Count(),
00471         &ppIWiaItem
00472     );
00473
00474     if (FAILED(hr) || hr == S_FALSE)
00475     {
00476         return hr;
00477     }
00478
00479     // For ADF scanners, the common dialog explicitly sets the page count to one.
00480     // So in order to transfer multiple images, set the page count to ALL_PAGES
00481     // if the WIA_DEVICE_DIALOG_SINGLE_IMAGE flag is not specified,
00482
00483     if (!(lFlags & WIA_DEVICE_DIALOG_SINGLE_IMAGE))
00484     {
00485         // Get the property storage interface pointer for the root item
00486
00487         CComQIPtr<IWiaPropertyStorage> pWiaRootPropertyStorage(pItemRoot);
00488
00489         if (pWiaRootPropertyStorage == NULL)
00490         {
00491             return E_NOINTERFACE;
00492         }
00493
00494         // Determine if the selected device is a scanner or not
00495
00496         PROPSPEC specDevType;
00497
00498         specDevType.ulKind = PRSPEC_PROPID;
00499         specDevType.propid = WIA_DIP_DEV_TYPE;
00500
00501         LONG nDevType;
00502
00503         hr = ReadPropertyLong(
00504             pWiaRootPropertyStorage,
00505             &specDevType,
00506             &nDevType
00507         );
00508
00509         if (SUCCEEDED(hr) && (GET_STIDEVICE_TYPE(nDevType) == StiDeviceTypeScanner))
00510         {
00511             // Determine if the document feeder is selected or not
00512
00513             PROPSPEC specDocumentHandlingSelect;
00514
00515             specDocumentHandlingSelect.ulKind = PRSPEC_PROPID;
00516             specDocumentHandlingSelect.propid = WIA_DPS_DOCUMENT_HANDLING_SELECT;
00517
00518             LONG nDocumentHandlingSelect;
00519
00520             hr = ReadPropertyLong(
00521                 pWiaRootPropertyStorage,
00522                 &specDocumentHandlingSelect,
00523                 &nDocumentHandlingSelect
00524             );
00525
00526             if (SUCCEEDED(hr) && (nDocumentHandlingSelect & FEEDER))
00527             {
00528                 PROPSPEC specPages;
00529
00530                 specPages.ulKind = PRSPEC_PROPID;
00531                 specPages.propid = WIA_DPS_PAGES;
00532
00533                 PROPVARIANT varPages;
00534
00535                 varPages.vt = VT_I4;
00536                 varPages.lVal = ALL_PAGES;
00537
00538                 pWiaRootPropertyStorage->WriteMultiple(
00539                     1,
00540                     &specPages,
00541                     &varPages,
00542                     WIA_DPS_FIRST
00543                 );
00544
00545                 PropVariantClear(&varPages);
00546             }
00547         }
00548     }
00549
00550     // If a status callback function is not supplied, use the default.
00551     // The default displays a simple dialog with a progress bar and cancel button.
00552
00553     CComPtr<CProgressDlg> pProgressDlg;
00554
00555     if (pfnProgressCallback == NULL)
00556     {
00557         pfnProgressCallback = DefaultProgressCallback;
00558
00559         pProgressDlg = new CProgressDlg(hWndParent);
00560
00561         pProgressCallbackParam = (CProgressDlg *) pProgressDlg;
00562     }
00563
00564     // Create the data callback interface
00565
00566     CComPtr<CDataCallback> pDataCallback = new CDataCallback(
00567         pfnProgressCallback,
00568         pProgressCallbackParam,
00569         plCount,
00570         pppStream
00571     );
00572
00573     if (pDataCallback == NULL)
00574     {
00575         return E_OUTOFMEMORY;
00576     }
00577
00578     // Start the transfer of the selected items
00579
00580     for (int i = 0; i < ppIWiaItem.Count(); ++i)
00581     {
00582         // Get the interface pointers
00583
00584         CComQIPtr<IWiaPropertyStorage> pWiaPropertyStorage(ppIWiaItem[i]);
00585
00586         if (pWiaPropertyStorage == NULL)
00587         {
00588             return E_NOINTERFACE;
00589         }
00590
00591         CComQIPtr<IWiaDataTransfer> pIWiaDataTransfer(ppIWiaItem[i]);
00592
00593         if (pIWiaDataTransfer == NULL)
00594         {
00595             return E_NOINTERFACE;
00596         }
00597
00598         // Set the transfer type
00599
00600         PROPSPEC specTymed;
00601
00602         specTymed.ulKind = PRSPEC_PROPID;
00603         specTymed.propid = WIA_IPA_TYMED;
00604
00605         PROPVARIANT varTymed;
00606
00607         varTymed.vt = VT_I4;
00608         varTymed.lVal = TYMED_CALLBACK;
00609
00610         hr = pWiaPropertyStorage->WriteMultiple(
00611             1,
00612             &specTymed,
00613             &varTymed,
00614             WIA_IPA_FIRST
00615         );
00616
00617         PropVariantClear(&varTymed);
00618
00619         if (FAILED(hr))
00620         {
00621             return hr;
00622         }
00623
00624         // If there is no transfer format specified, use the device default
00625
00626         GUID guidFormat = GUID_NULL;
00627
00628         if (pguidFormat == NULL)
00629         {
00630             pguidFormat = &guidFormat;
00631         }
00632
00633         if (*pguidFormat == GUID_NULL)
00634         {
00635             PROPSPEC specPreferredFormat;
00636
00637             specPreferredFormat.ulKind = PRSPEC_PROPID;
00638             specPreferredFormat.propid = WIA_IPA_PREFERRED_FORMAT;
00639
00640             hr = ReadPropertyGuid(
00641                 pWiaPropertyStorage,
00642                 &specPreferredFormat,
00643                 pguidFormat
00644             );
00645
00646             if (FAILED(hr))
00647             {
00648                 return hr;
00649             }
00650         }
00651
00652         // Set the transfer format
00653
00654         PROPSPEC specFormat;
00655
00656         specFormat.ulKind = PRSPEC_PROPID;
00657         specFormat.propid = WIA_IPA_FORMAT;
00658
00659         PROPVARIANT varFormat;
00660
00661         varFormat.vt = VT_CLSID;
00662         varFormat.puuid = (CLSID *) CoTaskMemAlloc(sizeof(CLSID));
00663
00664         if (varFormat.puuid == NULL)
00665         {
00666             return E_OUTOFMEMORY;
00667         }
00668
00669         *varFormat.puuid = *pguidFormat;
00670
00671         hr = pWiaPropertyStorage->WriteMultiple(
00672             1,
00673             &specFormat,
00674             &varFormat,
00675             WIA_IPA_FIRST
00676         );
00677
00678         PropVariantClear(&varFormat);
00679
00680         if (FAILED(hr))
00681         {
00682             return hr;
00683         }
00684
00685         // Read the transfer buffer size from the device, default to 64K
00686
00687         PROPSPEC specBufferSize;
00688
00689         specBufferSize.ulKind = PRSPEC_PROPID;
00690         specBufferSize.propid = WIA_IPA_BUFFER_SIZE;
00691
00692         LONG nBufferSize;
00693
00694         hr = ReadPropertyLong(
00695             pWiaPropertyStorage,
00696             &specBufferSize,
00697             &nBufferSize
00698         );
00699
00700         if (FAILED(hr))
00701         {
00702             nBufferSize = 64 * 1024;
00703         }
00704
00705         // Choose double buffered transfer for better performance
00706
00707         WIA_DATA_TRANSFER_INFO WiaDataTransferInfo = { 0 };
00708
00709         WiaDataTransferInfo.ulSize        = sizeof(WIA_DATA_TRANSFER_INFO);
00710         WiaDataTransferInfo.ulBufferSize  = 2 * nBufferSize;
00711         WiaDataTransferInfo.bDoubleBuffer = TRUE;
00712
00713         // Start the transfer
00714
00715         hr = pIWiaDataTransfer->idtGetBandedData(
00716             &WiaDataTransferInfo,
00717             pDataCallback
00718         );
00719
00720         if (FAILED(hr) || hr == S_FALSE)
00721         {
00722             return hr;
00723         }
00724     }
00725
00726     return S_OK;
00727 }
00728
00729 }; // namespace WiaWrap
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/mainfrm.h Source File

  • Multimedia
  • Audio
  • multichan

mainfrm.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 // MainFrm.h : interface of the CMainFrame class
00006 //
00007 /////////////////////////////////////////////////////////////////////////////
00008
00009 #if !defined(AFX_MAINFRM_H__C382F3F0_96AC_11D2_9012_00C04FC2D3B8__INCLUDED_)
00010 #define AFX_MAINFRM_H__C382F3F0_96AC_11D2_9012_00C04FC2D3B8__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016 #include "ChildView.h"
00017
00018 class CMainFrame : public CFrameWnd
00019 {
00020
00021 public:
00022   CMainFrame();
00023 protected:
00024   DECLARE_DYNAMIC(CMainFrame)
00025
00026 // Attributes
00027 public:
00028
00029 // Operations
00030 public:
00031
00032 // Overrides
00033   // ClassWizard generated virtual function overrides
00034   //{{AFX_VIRTUAL(CMainFrame)
00035   public:
00036   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00037   virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
00038   //}}AFX_VIRTUAL
00039
00040 // Implementation
00041 public:
00042   virtual ~CMainFrame();
00043 #ifdef _DEBUG
00044   virtual void AssertValid() const;
00045   virtual void Dump(CDumpContext& dc) const;
00046 #endif
00047
00048 protected:  // control bar embedded members
00049   CStatusBar  m_wndStatusBar;
00050   CToolBar    m_wndToolBar;
00051 //  CReBar      m_wndReBar;
00052   CDialogBar  m_wndDlgBar;
00053   CChildView  m_wndView;
00054
00055 // Generated message map functions
00056 protected:
00057   //{{AFX_MSG(CMainFrame)
00058   afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00059   afx_msg void OnSetFocus(CWnd *pOldWnd);
00060   afx_msg void OnMixerPlay();
00061   afx_msg void OnUpdateMixerPlay(CCmdUI* pCmdUI);
00062   //}}AFX_MSG
00063   DECLARE_MESSAGE_MAP()
00064 };
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067
00068 //{{AFX_INSERT_LOCATION}}
00069 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00070
00071 #endif // !defined(AFX_MAINFRM_H__C382F3F0_96AC_11D2_9012_00C04FC2D3B8__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 #include "Space.h"
00023 #include "Sky.h"
00024 #include "People.h"
00025 #include "Land.h"
00026
00027 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00028
00029 //==============================================================
00030 //
00031 // CStaticNode implementation
00032 //
00033 //
00034 CStaticNode::CStaticNode()
00035 {
00036     children[0] = new CPeoplePoweredVehicle;
00037     children[1] = new CLandBasedVehicle;
00038     children[2] = new CSkyBasedVehicle;
00039     children[3] = new CSpaceVehicle;
00040 }
00041
00042 CStaticNode::~CStaticNode()
00043 {
00044     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00045         if (children[n]) {
00046             delete children[n];
00047         }
00048 }
00049
00050 HRESULT CStaticNode::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00051 {
00052     SCOPEDATAITEM sdi;
00053
00054     if (!bExpanded) {
00055         // create the child nodes, then expand them
00056         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00057             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00058             sdi.mask = SDI_STR       |   // Displayname is valid
00059                 SDI_PARAM     |   // lParam is valid
00060                 SDI_IMAGE     |   // nImage is valid
00061                 SDI_OPENIMAGE |   // nOpenImage is valid
00062                 SDI_PARENT    |
00063                 SDI_CHILDREN;
00064
00065             sdi.relativeID  = (HSCOPEITEM)parent;
00066             sdi.nImage      = children[n]->GetBitmapIndex();
00067             sdi.nOpenImage  = INDEX_OPENFOLDER;
00068             sdi.displayname = MMC_CALLBACK;
00069             sdi.lParam      = (LPARAM)children[n];       // The cookie
00070             sdi.cChildren   = (n == 0); // only the first child has children
00071
00072             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00073
00074             _ASSERT( SUCCEEDED(hr) );
00075         }
00076     }
00077
00078     return S_OK;
00079 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/guids.h Source File

  • SysMgmt
  • MMC
  • Nodes

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // {6BB32802-92E6-11d2-9967-0080C7DCB3DC}
00020 DEFINE_GUID(CLSID_CComponentData,
00021             0x6bb32802, 0x92e6, 0x11d2, 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc);
00022
00023 // {73A37F60-92E6-11d2-9967-0080C7DCB3DC}
00024 DEFINE_GUID(CLSID_CSnapinAbout,
00025             0x73a37f60, 0x92e6, 0x11d2, 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/officedlg.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

officedlg.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  OfficeDlg.cpp
00006 //
00007 // Description:
00008 //  This file implements the OfficeDlg dialog class which
00009 //    collects information for the OnAddEquipment() routine.
00010 //
00011 // History:
00012 //
00013 // **************************************************************************
00014
00015 #include "stdafx.h"
00016 #include "AdvClient.h"
00017 #include "OfficeDlg.h"
00018
00019 #ifdef _DEBUG
00020 #define new DEBUG_NEW
00021 #undef THIS_FILE
00022 static char THIS_FILE[] = __FILE__;
00023 #endif
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // COfficeDlg dialog
00027
00028
00029 COfficeDlg::COfficeDlg(CWnd* pParent /*=NULL*/)
00030   : CDialog(COfficeDlg::IDD, pParent)
00031 {
00032   //{{AFX_DATA_INIT(COfficeDlg)
00033   m_item = _T("");
00034   m_SKU = _T("");
00035   //}}AFX_DATA_INIT
00036 }
00037
00038
00039 void COfficeDlg::DoDataExchange(CDataExchange* pDX)
00040 {
00041   CDialog::DoDataExchange(pDX);
00042   //{{AFX_DATA_MAP(COfficeDlg)
00043   DDX_Text(pDX, IDC_ITEM, m_item);
00044   DDX_Text(pDX, IDC_SKU, m_SKU);
00045   //}}AFX_DATA_MAP
00046 }
00047
00048
00049 BEGIN_MESSAGE_MAP(COfficeDlg, CDialog)
00050   //{{AFX_MSG_MAP(COfficeDlg)
00051     // NOTE: the ClassWizard will add message map macros here
00052   //}}AFX_MSG_MAP
00053 END_MESSAGE_MAP()
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // COfficeDlg message handlers
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_DIBDATA Member List

This is the complete list of members for _DIBDATA, including all inherited members.
rgbCoreHdr | _DIBDATA
rgFileInfo | _DIBDATA
rgpbmi | _DIBDATA
rgpjFrame | _DIBDATA
ulFiles | _DIBDATA
ulFrames | _DIBDATA
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEvtStoreSub Member List

This is the complete list of members for CEvtStoreSub, including all inherited members.
bstrEventClassID | CEvtStoreSub |
bstrEventClassID | CEvtStoreSub |
bstrPublisherID | CEvtStoreSub |
bstrPublisherID | CEvtStoreSub |
bstrSubscriptionID | CEvtStoreSub |
bstrSubscriptionID | CEvtStoreSub |
CEvtStoreSub(CComSpy *pSpy) | CEvtStoreSub | [inline]
CEvtStoreSub() | CEvtStoreSub | [inline]
changeType | CEvtStoreSub |
CSysLCESub() | CSysLCESub | [inline]
GetEventClass(LPGUID guid) | CEvtStoreSub | [inline, virtual]
GetEventType(EventEnum *e) | CEvtStoreSub | [inline, virtual]
GetInterface(IID *iid) | CEvtStoreSub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
pSpy | CEvtStoreSub |
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:56:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConServe/ConServe.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ConServe

ConServe.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CONSERVE.H
00003
00004   Summary:   Include file for the CONSERVE.DLL dynamic link library.
00005              Intended primarily for external users of this DLL who exploit
00006              it via static linkage to the DllRegisterServer and
00007              DllUnregisterServer exported service calls.
00008
00009              For a comprehensive tutorial code tour of CONSERVE's contents
00010              and offerings see the tutorial CONSERVE.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the CONSERVE source code.
00013
00014   Classes:   none.
00015
00016   Functions: DllRegisterServer, DllUnregisterServer.
00017
00018   Origin:    12-10-96: atrent - Editor-inheritance from FRESERVE.H in
00019                the FRESERVE Tutorial Code Sample. [Revised]
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(CONSERVE_H)
00037 #define CONSERVE_H
00038
00039 #if !defined(RC_INCLUDE)
00040
00041 #if !defined(_DLLEXPORT_)
00042
00043 // If _DLLEXPORT_ is NOT defined then the default is to import.
00044 #if defined(__cplusplus)
00045 #define DLLENTRY extern "C" __declspec(dllimport)
00046 #else
00047 #define DLLENTRY extern __declspec(dllimport)
00048 #endif
00049 #define STDENTRY DLLENTRY HRESULT WINAPI
00050 #define STDENTRY_(type) DLLENTRY type WINAPI
00051
00052 // Here is the list of server APIs offered by the DLL (using the
00053 // appropriate entry API declaration macros just #defined above).
00054
00055 STDENTRY DllRegisterServer(void);
00056
00057 STDENTRY DllUnregisterServer(void);
00058
00059 #else  // _DLLEXPORT_
00060
00061 // Else if _DLLEXPORT_ is indeed defined then we've been told to export.
00062 #if defined(__cplusplus)
00063 #define DLLENTRY extern "C" __declspec(dllexport)
00064 #else
00065 #define DLLENTRY __declspec(dllexport)
00066 #endif
00067 #define STDENTRY DLLENTRY HRESULT WINAPI
00068 #define STDENTRY_(type) DLLENTRY type WINAPI
00069
00070 #endif // _DLLEXPORT_
00071
00072 #endif // RC_INCLUDE
00073
00074 #endif // CONSERVE_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/inc/IsapiDebug.h Source File

  • Web
  • iis
  • ISAPI_6.0
  • inc

IsapiDebug.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: IsapiDebug.h
00006
00007 Abstract:
00008
00009     Debug functions for ISAPI tools library
00010
00011 Author:
00012
00013     ISAPI developer (Microsoft employee), October 2002
00014
00015 --*/
00016
00017 #ifndef _isapidebug_h
00018 #define _isapidebug_h
00019
00020 //
00021 // Definitions
00022 //
00023
00024 #define MAX_DEBUG_OUTPUT    2048
00025
00026 //
00027 // Project globals
00028 //
00029
00030 extern
00031 CHAR    g_szModuleName[MAX_PATH+1];
00032
00033 //
00034 // Prototypes
00035 //
00036
00037 VOID
00038 SetModuleName(
00039     CHAR *  szModuleName
00040     );
00041
00042 VOID
00043 IsapiAssert(
00044     CHAR *  szExpr,
00045     CHAR *  szFile,
00046     DWORD   dwLine
00047     );
00048
00049 VOID
00050 WriteDebug(
00051     CHAR *  szFormat,
00052     ...
00053     );
00054
00055 #endif  // _isapidebug_h
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/HalfIME/Main.C Source File

  • WinUI
  • Input
  • Ime
  • HalfIME

Main.C

Go to the documentation of this file.
00001 /************************************************************************
00002 *
00003 * Title:
00004 *
00005 *   Main.C - IME Half-aware Simple Text Editor (DBCS version)
00006 *
00007 * Purpose:
00008 *
00009 *   Sample program for DBCS programming and IME half-aware application.
00010 *
00011 * Synopsis:
00012 *
00013 *   This program is designed as a bare-bone example to demonstrate the
00014 *   basic elements of DBCS-enabling, and how to design an IME half-aware
00015 *   application.
00016 *
00017 *   The data structure is a fixed-size 2-dimensional byte array.  The
00018 *   font is the fixed-pitch system font.  Rudimentary text editing
00019 *   functions, such as the basic cursor movements, insertion, deletion,
00020 *   have been implemented.
00021 *
00022 * DBCS-enabling notes:
00023 *
00024 *   This version of STE is DBCS-enabled with respect to character input,
00025 *   caret shape and movement, and mouse clicking.  It should work on
00026 *   any version of Far East Windows since 4.0.
00027 *
00028 *   As far as source code maintenance goes, there are generally two
00029 *   approaches.
00030 *
00031 *   The first is to add DBCS enabling code under '#ifdef DBCS'.  The
00032 *   advantage of this approach is that it keeps the DBCS enabling code
00033 *   distinct from the SBCS, so it's easier to add them in, and also to
00034 *   remove them later.  (For example, when you want to replace DBCS
00035 *   enabling with Unicode enabling.)  The drawback is that because the
00036 *   DBCS and the SBCS logic are not integrated, they can easily get out
00037 *   of sync (as the SBCS code evolves.)
00038 *
00039 *   The second approach, which is adopted by this sample app, is to
00040 *   integrate DBCS enabling with SBCS.  It takes longer to do, but
00041 *   the resulting source is easier to maintain.  Since IsDBCSLeadByte
00042 *   is at the heart of any DBCS-enabling logic, an additional speed up
00043 *   for generating an SBCS-only version is to define that function as
00044 *   FALSE, and let the compiler optimize the DBCS logic away.
00045 *
00046 * IME Half-Aware notes:
00047 *
00048 *   This version of STE is an IME half-aware application with the
00049 *   capiabilities to open/close IME conversion engine and control
00050 *   where the IME composition window will be located in. It should
00051 *   work on any version of Far East Windows since 4.0.
00052 *
00053 *   This kind of application typically wants to control the behavior
00054 *   of IME like opening/closing IME, setting where to show composition
00055 *   window, setting where to show candidate lists and so on. It does
00056 *   not display any user interface for IME.
00057 *
00058 * History:
00059 *
00060 *   17-Aug-1992     created
00061 *   28-Sep-1992     added DBCS-enabling
00062 *   30-Sep-1992     bug fixes
00063 *   25-Mar-1994     added IME half-aware logics
00064 *
00065 ************************************************************************/
00066
00067 #include <assert.h>
00068 #include <windows.h>
00069 #include <imm.h>
00070 #include "halfime.h"
00071
00072 //
00073 // Function prototype
00074 //
00075 void    ResetCaret( HWND );
00076 void    SetIMECompFormPos( HWND );
00077 LRESULT CALLBACK SteWndProc( HWND, UINT, WPARAM, LPARAM );
00078
00079
00080 /************************************************************************
00081 *
00082 * Global data
00083 *
00084 ************************************************************************/
00085 TCHAR szSteClass[10] = {0};         // window class name
00086 TCHAR szSteTitle[40] = {0};         // window frame title
00087 UINT  cxMetrics,                    // aver. character width
00088       cxOverTypeCaret,              // caret width for overtype mode
00089       cyMetrics;                    // character height
00090 int xPos, yPos;                     // caret position
00091 HFONT hfntFixed;                    // fixed-pitch font
00092 HFONT hfntOld;                      // default font holder
00093 BOOL fInsertMode;                   // insert/overtype mode flag
00094 int CaretWidth;                     // insert/overtype mode caret width
00095 BYTE textbuf[MAXROW][MAXCOL];       // text buffer
00096 int DBCSFillChar;                   // 'Pattern/DBCS' fill character
00097
00098 WPARAM CompWindowMode;              // Composition window mode.
00099 COMPOSITIONFORM CompForm = {0};     // Storage for composition window
00100                                     // structure.
00101 DWORD fdwProperty;                  // the property of current active IME
00102
00103
00104 /************************************************************************
00105 *
00106 *   SteRegister - standard class registration routine
00107 *
00108 ************************************************************************/
00109 int SteRegister(
00110     HANDLE hInstance )
00111 {
00112     WNDCLASS wc = {0};
00113
00114     wc.hCursor       = LoadCursor( NULL, IDC_IBEAM );
00115     wc.hIcon         = LoadIcon( hInstance, MAKEINTRESOURCE(ID_ICON));
00116     wc.lpszMenuName  = MAKEINTRESOURCE(ID_MENU);
00117     wc.hInstance     = hInstance;
00118     wc.lpszClassName = szSteClass;
00119     wc.lpfnWndProc   = (WNDPROC)SteWndProc;
00120     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
00121     wc.style         = CS_BYTEALIGNCLIENT | CS_CLASSDC;
00122
00123     if ( !RegisterClass( &wc ) )
00124     {
00125         return FALSE;
00126     }
00127     else
00128     {
00129         return TRUE;
00130     }
00131 }
00132
00133
00134 /************************************************************************
00135 *
00136 *   WinMain
00137 *
00138 ************************************************************************/
00139 int WINAPI WinMain(
00140     HINSTANCE hInstance,
00141     HINSTANCE hPrevInstance,
00142     LPSTR lpszCmdLine,
00143     int nCmdShow )
00144 {
00145     MSG msg = {0};
00146     HWND hWnd = NULL;
00147     BOOL bSuccess = TRUE;
00148     BOOL bRet;
00149
00150     LoadString( hInstance, IDS_CLASS, szSteClass, 10 );
00151     LoadString( hInstance, IDS_TITLE, szSteTitle, 40 );
00152
00153   if ( !SteRegister( hInstance ) )
00154   {
00155       bSuccess = FALSE;
00156       goto exit_func;
00157   }
00158
00159     if ( !(hWnd = CreateWindow( szSteClass, szSteTitle,
00160                                 WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
00161                                 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
00162                                 NULL, NULL, hInstance, NULL)) )
00163     {
00164       bSuccess = FALSE;
00165       goto exit_func;
00166     }
00167
00168     //
00169     // Create window with just enough client space for the text buffer
00170     //
00171     SetWindowPos( hWnd, 0, 0, 0,
00172                   MAXCOL*cxMetrics + GetSystemMetrics(SM_CXBORDER)*2,
00173                   MAXROW*cyMetrics + GetSystemMetrics(SM_CYBORDER)*2
00174                     + GetSystemMetrics(SM_CYCAPTION)
00175                     + GetSystemMetrics(SM_CYMENU),
00176                   SWP_NOZORDER );
00177
00178     ShowWindow( hWnd, nCmdShow );
00179
00180
00181     //
00182     // Any IME half-aware application should call TranslateMessage API to
00183     // translate messages. This is because Windows95 IME architecture
00184     // will call ImmToAsciiEx API, if necessary, to make IME conversion
00185     // engine work, and generate some IME messages during TranslateMessage
00186     // session. Otherwise, IME will not work.
00187     //
00188     while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
00189     {
00190         if (bRet == -1)
00191         {
00192             // possibly handle the error
00193             bSuccess = FALSE;
00194         }
00195         else
00196         {
00197             TranslateMessage(&msg);
00198             DispatchMessage(&msg);
00199         }
00200     }
00201
00202
00203 exit_func:
00204     if (bSuccess)
00205     {
00206         return (int) msg.wParam;
00207     }
00208     else
00209     {
00210         return 0;
00211     }
00212 }
00213
00214 /**********************************************************************
00215 *
00216 * SteIMEOpenClose()
00217 *
00218 * This routines calls IMM API to open or close IME.
00219 *
00220 ***********************************************************************/
00221 void SteImeOpenClose(
00222     HWND hWnd,
00223     BOOL fFlag )
00224 {
00225     HIMC hIMC = NULL;    // Input context handle.
00226
00227     //
00228     // If fFlag is true then open IME; otherwise close it.
00229     //
00230     if ( !( hIMC = ImmGetContext( hWnd ) ) )
00231     {
00232         return;
00233     }
00234
00235     //
00236     // When an application wants to open/close IME for some
00237     // reasons, it should call TMMSetOpenStatus() to do that.
00238     //
00239     ImmSetOpenStatus( hIMC, fFlag );
00240     ImmReleaseContext( hWnd, hIMC );
00241 }
00242
00243
00244 /**********************************************************************
00245 *
00246 * SteIMECompWindowPos()
00247 *
00248 * This routines inform IME where to display composition window.
00249 * Here we control IME composition window with the following cases:
00250 * 1: DEFAULT:   Display composition window in IME default position.
00251 * 2: NEARCARET: Display composition window in near caret position.
00252 * 3: PreFer:    Display composition window in application prefer position.
00253 *
00254 ***********************************************************************/
00255 void SteIMECompWindowPos(
00256     HWND hWnd,
00257     WPARAM cmd )
00258 {
00259     RECT rect = {0};  // Storage for client rect.
00260     HIMC hImc = NULL;
00261
00262
00263     //
00264     // Set current composition mode.
00265     //
00266     CompWindowMode = cmd;
00267
00268     switch( cmd )
00269     {
00270         case IDC_DEFAULT_POS:
00271
00272             //
00273             // Put composition window in default position
00274             // being deterimined by IME UI. Applications
00275             // have to set composition form style with
00276             // CFS_DEFAULT to imform IME UI.
00277             //
00278
00279             CompForm.dwStyle = CFS_DEFAULT;
00280             break;
00281
00282         case IDC_NEARCARET_POS:
00283
00284             //
00285             // Put composition window in near caret
00286             // position. If IME UI receives this control
00287             // message, it will put the composition window
00288             // near to the position deesignated by ptCurrentPos.
00289             // So for this operation, applications have to set
00290             // composition form style with CFS_POINT and store
00291             // caret position in ptCurrentPos.
00292             //
00293
00294             CompForm.dwStyle = CFS_POINT;
00295             GetCaretPos( (PPOINT) &CompForm.ptCurrentPos );
00296             break;
00297
00298         case IDC_PREFER_POS:
00299
00300             // Put composition window in application
00301             // prefer position. Applications have to set
00302             // composition form sytle with  CFS_POINT |
00303             // CFS_FORCE_POSITION and store the prefer
00304             // position in ptCurrentPos.
00305             //
00306             // The difference between CFS_POINT and CFS_POINT
00307             // with CFS_FORCE_POSITION is if setting
00308             // CFS_FORCE_POSITION style, IME will actually
00309             // display its composition window in the position
00310             // specified by ptCurrent without any adjustment;
00311             // otherwise IME will shPosow its composition window
00312             // by adjusting the position specified by
00313             // ptCurrentPos.
00314             //
00315
00316             CompForm.dwStyle = CFS_POINT | CFS_FORCE_POSITION;
00317
00318             GetClientRect( hWnd, (LPRECT) &rect);
00319
00320             CompForm.ptCurrentPos.x = 0;
00321             CompForm.ptCurrentPos.y = rect.bottom;
00322             break;
00323     }
00324
00325     hImc = ImmGetContext( hWnd );
00326     ImmSetCompositionWindow( hImc, (COMPOSITIONFORM FAR*)&CompForm );
00327     ImmReleaseContext( hWnd, hImc );
00328 }
00329
00330
00331 /***********************************************************************
00332 *
00333 * ResetIMECompWin()
00334 *
00335 * This routine informs IME the fact that caret position has been changed.
00336 *
00337 ************************************************************************/
00338 void ResetIMECompWin(
00339     HWND hWnd )
00340 {
00341     if ( CompWindowMode == IDC_NEARCARET_POS ||
00342          CompWindowMode == IDC_PREFER_POS )
00343     {
00344         HIMC hIMC = ImmGetContext(hWnd);
00345         if ( hIMC )
00346         {
00347             ImmSetCompositionWindow(hIMC,&CompForm);
00348         }
00349         ImmReleaseContext( hWnd , hIMC);
00350     }
00351 }
00352
00353
00354 /***********************************************************************
00355 *
00356 * SetIMECompFormPos( HWND )
00357 *
00358 ************************************************************************/
00359 void SetIMECompFormPos(
00360     HWND hWnd )
00361 {
00362
00363     //
00364     // If current composition form mode is near caret operation,
00365     // application should inform IME UI the caret position has been
00366     // changed. IME UI will make decision whether it has to adjust
00367     // composition window position.
00368     //
00369     //
00370     if ( CompWindowMode == IDC_NEARCARET_POS )
00371     {
00372         HIMC hIMC = ImmGetContext(hWnd);
00373         POINT point = {0};
00374
00375         GetCaretPos( &point );
00376
00377         CompForm.dwStyle = CFS_POINT;
00378
00379         CompForm.ptCurrentPos.x = (long) point.x;
00380         CompForm.ptCurrentPos.y = (long) point.y;
00381
00382         if ( hIMC )
00383         {
00384             ImmSetCompositionWindow(hIMC,&CompForm);
00385         }
00386         ImmReleaseContext( hWnd , hIMC);
00387     }
00388
00389 }
00390
00391
00392 /************************************************************************
00393 *
00394 *   SteCreate - WM_CREATE message handler
00395 *
00396 ************************************************************************/
00397 void SteCreate(
00398     HWND hWnd )
00399 {
00400     HDC        hdc = NULL;
00401     TEXTMETRIC tm = {0};
00402     LOGFONT    lFont = {0};
00403     HFONT      hFont = NULL;
00404
00405     //
00406     // Note that this window has a class DC
00407     //
00408     hdc = GetDC( hWnd );
00409
00410     //
00411     // Select fixed pitch system font and get its text metrics
00412     //
00413     hfntFixed = GetStockObject( SYSTEM_FIXED_FONT );
00414     hfntOld = SelectObject( hdc, hfntFixed );
00415     GetTextMetrics( hdc, &tm );
00416     ReleaseDC( hWnd, hdc );
00417     cxMetrics = tm.tmAveCharWidth;
00418     cyMetrics = tm.tmHeight;
00419
00420     //
00421     // Determine the version of DBCS Windows from system font charset ID.
00422     // Then hardcode a DBCS character value for the 'Pattern/DBCS' command.
00423     // The value is the Han character for 'door' or 'gate', which is
00424     // left-right symmetrical.
00425     //
00426     switch( tm.tmCharSet )
00427     {
00428         case SHIFTJIS_CHARSET:
00429             DBCSFillChar = 0x96e5;
00430             break;
00431
00432         case HANGEUL_CHARSET:
00433             DBCSFillChar = 0xdaa6;
00434             break;
00435
00436         case CHINESEBIG5_CHARSET:
00437             DBCSFillChar = 0xaaf9;
00438             break;
00439
00440         default:
00441             DBCSFillChar = 0x7071;  // 'pq'
00442             break;
00443     }
00444
00445     //
00446     // Initialize caret width.  Fat in INSERT mode, skinny in OVERTYPE mode.
00447     //
00448     fInsertMode = FALSE;
00449     CaretWidth = cxOverTypeCaret = GetSystemMetrics( SM_CXBORDER );
00450
00451     //
00452     // Sets the logical font to be used to display characters in the
00453     // composition window. Especially for at caret or near caret operation,
00454     // application should set composition font.
00455     //
00456     if ( ( hFont = (HFONT)SendMessage( hWnd, WM_GETFONT, 0, 0L ) ) != NULL )
00457     {
00458         if ( GetObject( hFont, sizeof(LOGFONT), (LPVOID)&lFont ) )
00459         {
00460             HIMC hImc = NULL;
00461             if ( (  hImc = ImmGetContext( hWnd ) ) )
00462             {
00463                 ImmSetCompositionFont( hImc, &lFont );
00464                 ImmReleaseContext( hWnd, hImc );
00465             }
00466         }
00467     }
00468
00469     PostMessage( hWnd, WM_COMMAND, IDC_CLEAR, 0L );
00470
00471     fdwProperty = ImmGetProperty( GetKeyboardLayout(0), IGP_PROPERTY );
00472 }
00473
00474
00475 /************************************************************************
00476 *
00477 *   ResetCaret - Reset caret shape to match input mode (overtype/insert)
00478 *
00479 ************************************************************************/
00480 void ResetCaret(
00481     HWND hWnd )
00482 {
00483
00484     HideCaret( hWnd );
00485     DestroyCaret();
00486     CreateCaret( hWnd,
00487                  NULL,
00488                  (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
00489                     CaretWidth*2 : CaretWidth,
00490                  cyMetrics );
00491     SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
00492     ShowCaret( hWnd );
00493
00494     SetIMECompFormPos( hWnd );
00495
00496 }
00497
00498
00499
00500 /************************************************************************
00501 *
00502 *   SteCommand - WM_COMMAND handler
00503 *
00504 ************************************************************************/
00505 void SteCommand(
00506     HWND hWnd,
00507     WPARAM cmd )
00508 {
00509     switch( cmd )
00510     {
00511         case IDC_CLEAR:
00512             //
00513             // Blank out text buffer.  Return caret to home position
00514             //
00515
00516             for ( yPos = FIRSTROW; yPos <= LASTROW; yPos++ )
00517             {
00518                 for ( xPos = FIRSTCOL; xPos <= LASTCOL; xPos++ )
00519                 {
00520                     textbuf[yPos][xPos] = ' ';
00521                 }
00522             }
00523             break;
00524
00525         case IDC_ANSIFILL: /* fall-through */
00526         case IDC_DBCSFILL:
00527
00528             //
00529             // Fill text buffer with ANSI or DBCS pattern
00530             //
00531
00532             for ( yPos = FIRSTROW; yPos <= LASTROW; yPos++ )
00533             {
00534                 for ( xPos = FIRSTCOL; xPos <= LASTCOL; xPos++ )
00535                 {
00536                     if ( cmd == IDC_ANSIFILL )
00537                     {
00538                         textbuf[yPos][xPos] = 'a';
00539                     }
00540                     else
00541                     {
00542                         textbuf[yPos][xPos]   = HIBYTE(DBCSFillChar);
00543                         textbuf[yPos][++xPos] = LOBYTE(DBCSFillChar);
00544                     }
00545                 }
00546             }
00547             break;
00548
00549
00550         //
00551         // The following messages are to control IME.
00552         //
00553
00554         case IDC_OPENIME:
00555
00556             SteImeOpenClose( hWnd, TRUE );
00557             goto RETURN;
00558             break;
00559
00560         case IDC_CLOSEIME:
00561
00562             SteImeOpenClose( hWnd, FALSE );
00563             goto RETURN;
00564             break;
00565
00566         case IDC_DEFAULT_POS:    /* fall-through */
00567         case IDC_NEARCARET_POS:  /* fall-through */
00568         case IDC_PREFER_POS:
00569
00570             SteIMECompWindowPos( hWnd, cmd );
00571             goto RETURN;
00572             break;
00573
00574     }
00575
00576     yPos = FIRSTROW;
00577     xPos = FIRSTCOL;
00578
00579     InvalidateRect( hWnd, (LPRECT)NULL, TRUE );
00580     ResetCaret(hWnd);
00581
00582 RETURN:
00583
00584     return;
00585 }
00586
00587
00588 /************************************************************************
00589 *
00590 *   IsDBCSTrailByte - returns TRUE if the given byte is a DBCS trail byte
00591 *
00592 *                     The algorithm searchs backward in the string, to some
00593 *                     known character boundary, counting consecutive bytes
00594 *                     in the lead byte range. An odd number indicates the
00595 *                     current byte is part of a two byte character code.
00596 *
00597 *   INPUT: PCHAR  - pointer to a preceding known character boundary.
00598 *          PCHAR  - pointer to the character to test.
00599 *
00600 *   OUTPUT:BOOL   - indicating truth of p==trailbyte.
00601 *
00602 ************************************************************************/
00603 BOOL IsDBCSTrailByte(
00604     char *base,
00605     char *p )
00606 {
00607     int lbc = 0;    // lead byte count
00608
00609     assert(base <= p);
00610
00611     while ( p > base )
00612     {
00613       if ( !IsDBCSLeadByte(*(--p)) )
00614       {
00615           break;
00616       }
00617       lbc++;
00618     }
00619
00620     return (lbc & 1);
00621 }
00622
00623
00624
00625
00626 /************************************************************************
00627 *
00628 *   VirtualKeyHandler - WM_KEYDOWN handler
00629 *
00630 *
00631 *   INPUT:  HWND - handle to the window for repainting output.
00632 *           WPARAM - virtual key code.
00633 *
00634 ************************************************************************/
00635 void VirtualKeyHandler(
00636     HWND hWnd,
00637     WPARAM wParam )
00638 {
00639     int i;
00640     HDC hdc;
00641     static int delta = 1;
00642
00643     switch( wParam )
00644     {
00645         case VK_HOME:   // beginning of line
00646             xPos = FIRSTCOL;
00647             break;
00648
00649         case VK_END:    // end of line
00650             xPos = LASTCOL;
00651             goto check_for_trailbyte;
00652
00653         case VK_RIGHT:
00654             if ( IsDBCSLeadByte( textbuf[yPos][xPos] ) )
00655             {
00656                 if (xPos==LASTCOL - 1)
00657                 {
00658                     break;   // last character don't move
00659                 }
00660                 xPos += 2;   // skip 2 for DB Character
00661             }
00662             else
00663             {
00664                 xPos = min( xPos+1, LASTCOL );
00665             }
00666             break;
00667
00668         case VK_LEFT:
00669             xPos = max( xPos-1, FIRSTCOL );
00670
00671 check_for_trailbyte:
00672
00673             if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
00674             {
00675                 xPos--;
00676             }
00677             break;
00678
00679         case VK_UP:
00680             yPos = max( yPos-1, FIRSTROW );
00681             goto Virtical_Check_Trail;
00682
00683         case VK_DOWN:
00684             yPos = min( yPos+1, LASTROW );
00685
00686 Virtical_Check_Trail:
00687
00688             if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
00689             {
00690                 if (xPos<LASTCOL)
00691                 {
00692                     xPos+=delta;
00693                     delta *= -1;
00694                 }
00695                 else
00696                 {
00697                     xPos--;
00698                 }
00699             }
00700             break;
00701
00702
00703         case VK_INSERT:
00704
00705             //
00706             // Change caret shape to indicate insert/overtype mode
00707             //
00708
00709             fInsertMode = !fInsertMode;
00710             CaretWidth = fInsertMode ? cxMetrics : cxOverTypeCaret;
00711             break;
00712
00713         case VK_BACK:   // backspace
00714             if ( xPos > FIRSTCOL )
00715             {
00716                 xPos--;
00717
00718                 //
00719                 // DB Character so backup one more to allign on boundary
00720                 //
00721                 if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
00722                 {
00723                   xPos--;
00724                 }
00725                 //
00726                 // Fall Through to VK_DELETE to adjust row
00727                 //
00728             }
00729             else     //FIRST COLUMN  don't backup -- this would change for wrapping
00730             {
00731                break;
00732             }
00733
00734         case VK_DELETE:
00735
00736             if ( !IsDBCSLeadByte( textbuf[yPos][xPos] ) )
00737             {
00738                 //
00739                 // Move rest of line left by one, then blank out last character
00740                 //
00741                 for ( i = xPos; i < LASTCOL; i++ )
00742               textbuf[yPos][i] = textbuf[yPos][i+1];
00743                 textbuf[yPos][LASTCOL] = ' ';
00744             }
00745             else
00746             {
00747                 //
00748                 // Move line left by two bytes, blank out last two bytes
00749                 //
00750
00751                 for ( i = xPos; i < LASTCOL-1; i++ )
00752                 {
00753                   textbuf[yPos][i] = textbuf[yPos][i+2];
00754                 }
00755                 textbuf[yPos][LASTCOL-1] = ' ';
00756                 textbuf[yPos][LASTCOL]   = ' ';
00757             }
00758
00759             //
00760             // Repaint the entire line
00761             //
00762
00763             hdc = GetDC( hWnd );
00764             HideCaret( hWnd );
00765             TextOutA( hdc, 0, yPos*cyMetrics, (LPCSTR)textbuf[yPos], MAXCOL );
00766             ReleaseDC( hWnd, hdc );
00767             break;
00768
00769         case VK_TAB:    // tab  -- tabs are column allignment not character
00770             {
00771                  int xTabMax = xPos + TABSTOP;
00772                  int xPosPrev;
00773
00774                  do
00775                  {
00776                      xPosPrev = xPos;
00777                      SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
00778                  }
00779                  while ((xPos % TABSTOP) &&
00780                         (xPos < xTabMax) &&
00781                         (xPos != xPosPrev));
00782
00783             }
00784             break;
00785
00786         case VK_RETURN: // linefeed
00787             yPos = min( yPos+1, LASTROW );
00788             xPos = FIRSTCOL;
00789             break;
00790     }
00791
00792     ResetCaret( hWnd );
00793 }
00794
00795
00796 /************************************************************************
00797 *
00798 *   StoreChar - Stores one SBCS character into text buffer and advances
00799 *               cursor
00800 *
00801 ************************************************************************/
00802 void StoreChar(
00803     HWND hWnd,
00804     BYTE ch )
00805 {
00806     int i;
00807     HDC hdc = NULL;
00808
00809     //
00810     // If insert mode, move rest of line to the right by one
00811     //
00812
00813     if ( fInsertMode )
00814     {
00815         for ( i = LASTCOL; i > xPos; i-- )
00816         {
00817             textbuf[yPos][i] = textbuf[yPos][i-1];
00818         }
00819
00820         //
00821         // If the row ends on a lead byte, blank it out
00822         // To do this we must first traverse the string
00823         // starting from a known character boundry until
00824         // we reach the last column. If the last column
00825         // is a character boundry then the last character
00826         // is either a single byte or a lead byte
00827         //
00828
00829         for ( i = xPos+1; i < LASTCOL; )
00830         {
00831             if ( IsDBCSLeadByte( textbuf[yPos][i] ) )
00832             {
00833                 i++;
00834             }
00835             i++;
00836         }
00837
00838         if (i==LASTCOL)
00839         {
00840            if ( IsDBCSLeadByte( textbuf[yPos][LASTCOL] ) )
00841            {
00842                textbuf[yPos][LASTCOL] = ' ';
00843            }
00844         }
00845     }
00846     else
00847     {  // overtype mode
00848       if ( IsDBCSLeadByte( textbuf[yPos][xPos] ) )
00849       {
00850             //
00851             // Blank out trail byte
00852             //
00853             textbuf[yPos][xPos+1] = ' ';
00854
00855             //
00856             // or shift line left on character and blank last column
00857             //
00858             // for ( i = xPos+1; i < LASTCOL; i++ )
00859             //     textbuf[yPos][i] = textbuf[yPos][i+1];
00860             // textbuf[yPos][LASTCOL] = ' ';
00861         }
00862     }
00863
00864     //
00865     // Store input character at current caret position
00866     //
00867     textbuf[yPos][xPos] = ch;
00868
00869     //
00870     // Display input character.
00871     //
00872     hdc = GetDC( hWnd );
00873     HideCaret( hWnd );
00874     TextOutA( hdc, xPos*cxMetrics, yPos*cyMetrics,
00875               (LPCSTR)&(textbuf[yPos][xPos]), MAXCOL-xPos );
00876     ShowCaret( hWnd );
00877     ReleaseDC( hWnd, hdc );
00878
00879     SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
00880 }
00881
00882
00883 /************************************************************************
00884 *
00885 *   StoreDBCSChar - Stores one DBCS character into text buffer and
00886 *                   advances cursor
00887 *
00888 ************************************************************************/
00889 void StoreDBCSChar(
00890     HWND hWnd,
00891     WORD ch )
00892 {
00893     int i;
00894     HDC hdc;
00895
00896     //
00897     // If there is no room for a DBCS character, discard it
00898     //
00899     if ( xPos == LASTCOL )
00900     {
00901         return;
00902     }
00903
00904     //
00905     // If insert mode, move rest of line to the right by two
00906     //
00907     if ( fInsertMode )
00908     {
00909         for ( i = LASTCOL; i > xPos+1; i-- )
00910         {
00911             textbuf[yPos][i] = textbuf[yPos][i-2];
00912         }
00913
00914         //
00915         // If the row ends on a lead byte, blank it out
00916         // To do this we must first traverse the string
00917         // starting from a known charcter boundry until
00918         // we reach the last column. If the last column
00919         // is not a trail byte then it is a single byte
00920         // or a lead byte
00921         //
00922         for ( i = xPos+2; i < LASTCOL; )
00923         {
00924             if ( IsDBCSLeadByte( textbuf[yPos][i] ) )
00925             {
00926                 i++;
00927             }
00928             i++;
00929         }
00930         if (i==LASTCOL)
00931         {
00932            if (IsDBCSLeadByte( textbuf[yPos][LASTCOL] ) )
00933            {
00934                 textbuf[yPos][LASTCOL] = ' ';
00935            }
00936         }
00937     }
00938     else
00939     {  // overtype mode
00940         if ( !IsDBCSLeadByte( textbuf[yPos][xPos] ) )
00941         {
00942             //
00943             // Overtyping the current byte, plus the following byte,
00944             // which could be a lead byte.
00945             //
00946             if ( IsDBCSLeadByte( textbuf[yPos][xPos+1] ) )
00947             {
00948                 textbuf[yPos][xPos+2] = ' ';
00949             }
00950         }
00951     }
00952
00953     //
00954     // Store input character at current caret position
00955     //
00956     textbuf[yPos][xPos]   = LOBYTE(ch);     // lead byte
00957     textbuf[yPos][xPos+1] = HIBYTE(ch);     // trail byte
00958
00959     //
00960     // Display input character.
00961     //
00962     hdc = GetDC( hWnd );
00963     HideCaret( hWnd );
00964     TextOutA( hdc, xPos*cxMetrics, yPos*cyMetrics,
00965              (LPCSTR)&(textbuf[yPos][xPos]), MAXCOL-xPos );
00966     ShowCaret( hWnd );
00967     ReleaseDC( hWnd, hdc );
00968
00969     SendMessage( hWnd, WM_KEYDOWN, VK_RIGHT, 1L );
00970 }
00971
00972
00973 /************************************************************************
00974 *
00975 *   CharHandler - WM_CHAR handler
00976 *
00977 ************************************************************************/
00978 void CharHandler(
00979     HWND hWnd,
00980     WPARAM wParam )
00981 {
00982     unsigned char ch = (unsigned char)wParam;
00983
00984     //
00985     // Because DBCS characters are usually generated by IMEs (as two
00986     // PostMessages), if a lead byte comes in, the trail byte should
00987     // arrive very soon after.  We wait here for the trail byte and
00988     // store them into the text buffer together.
00989     if ( IsDBCSLeadByte( ch ) )
00990     {
00991         //
00992         // Wait an arbitrary amount of time for the trail byte to
00993         // arrive.  If it doesn't, then discard the lead byte.
00994         //
00995         // This could happen if the IME screwed up.  Or, more likely,
00996         // the user generated the lead byte through ALT-numpad.
00997         //
00998         MSG msg = {0};
00999         int i = 10;
01000
01001         while (!PeekMessage((LPMSG)&msg, hWnd, WM_CHAR, WM_CHAR, PM_REMOVE))
01002         {
01003             if ( --i == 0 )
01004             {
01005                 return;
01006             }
01007             Yield();
01008         }
01009
01010         StoreDBCSChar( hWnd, (WORD)(((unsigned)(msg.wParam)<<8) | (unsigned)ch ));
01011     }
01012     else
01013     {
01014         switch( ch )
01015         {
01016             case '\r': /* fall-through */
01017             case '\t': /* fall-through */
01018             case '\b':
01019                 //
01020                 // Throw away.  Already handled at WM_KEYDOWN time.
01021                 //
01022                 break;
01023
01024             default:
01025                 StoreChar( hWnd, ch );
01026                 break;
01027         }
01028     }
01029 }
01030
01031
01032 /************************************************************************
01033 *
01034 *   MouseHandler - WM_BUTTONDOWN handler
01035 *
01036 ************************************************************************/
01037 void MouseHandler(
01038     HWND hWnd,
01039     LPARAM lParam )
01040 {
01041     HideCaret( hWnd );
01042
01043     //
01044     // Calculate caret position based on fixed pitched font
01045     //
01046     yPos = MAKEPOINTS(lParam).y / cyMetrics;
01047     xPos = MAKEPOINTS(lParam).x / cxMetrics;
01048
01049     //
01050     // Adjust caret position if click landed on a trail byte
01051     //
01052     if ( IsDBCSTrailByte( (CHAR *)textbuf[yPos], (CHAR *)&(textbuf[yPos][xPos]) ) )
01053     {
01054         //
01055         // If click landed on the last quarter of the DBCS character,
01056         // assume the user was aiming at the next character.
01057         //
01058         if ( (MAKEPOINTS(lParam).x - xPos * cxMetrics) > (cxMetrics / 2) )
01059         {
01060             xPos++;
01061         }
01062         else
01063         {
01064             xPos--;
01065         }
01066     }
01067
01068     DestroyCaret();
01069     CreateCaret(hWnd,
01070                 NULL,
01071                 (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
01072                     CaretWidth*2 : CaretWidth,
01073                 cyMetrics );
01074     SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
01075     ShowCaret( hWnd );
01076
01077     SetIMECompFormPos( hWnd );
01078 }
01079
01080
01081 /************************************************************************
01082 *
01083 *   InputChangeHandler - WM_INPUTLANGCHANGE handler
01084 *
01085 ************************************************************************/
01086 void InputChangeHandler(
01087     HWND hWnd )
01088 {
01089     HIMC hIMC;
01090
01091     fdwProperty = ImmGetProperty( GetKeyboardLayout(0), IGP_PROPERTY );
01092
01093     // if this application set the candidate position, it need to set
01094     // it to default for the near caret IME
01095     if ( hIMC = ImmGetContext( hWnd ) )
01096     {
01097         UINT i;
01098
01099         for (i = 0; i < 4; i++)
01100         {
01101             CANDIDATEFORM CandForm = {0};
01102
01103             if ( fdwProperty & IME_PROP_AT_CARET )
01104             {
01105                 CandForm.dwIndex = i;
01106                 CandForm.dwStyle = CFS_CANDIDATEPOS;
01107 #if 0
01108                 // This application do not want to set candidate window to
01109                 // any position. Anyway, if an application need to set the
01110                 // candiadet position, it should remove the if 0 code
01111
01112                 // the position you want to set
01113                 CandForm.ptCurrentPos.x = ptAppWantPosition[i].x;
01114                 CandForm.ptCurrentPos.y = ptAppWantPosition[i].y;
01115
01116                 ImmSetCandidateWindow( hIMC, &CandForm );
01117 #endif
01118             }
01119             else
01120             {
01121                 if ( !ImmGetCandidateWindow( hIMC, i, &CandForm ) )
01122                 {
01123                     continue;
01124                 }
01125
01126                 if ( CandForm.dwStyle == CFS_DEFAULT )
01127                 {
01128                     continue;
01129                 }
01130
01131                 CandForm.dwStyle = CFS_DEFAULT;
01132
01133                 ImmSetCandidateWindow( hIMC, &CandForm );
01134             }
01135         }
01136
01137         ImmReleaseContext( hWnd, hIMC );
01138     }
01139
01140     return;
01141 }
01142
01143
01144 /************************************************************************
01145 *
01146 *   SteWndProc - STE class window procedure
01147 *
01148 ************************************************************************/
01149 LRESULT CALLBACK SteWndProc(
01150     HWND hWnd,
01151     UINT msg,
01152     WPARAM wParam,
01153     LPARAM lParam )
01154 {
01155     int i = 0;
01156     HDC hdc = NULL;
01157     PAINTSTRUCT ps = {0};
01158     BOOL bRetDWP = FALSE;
01159
01160     switch( msg )
01161     {
01162         case WM_CREATE:
01163             SteCreate( hWnd );
01164             break;
01165
01166         case WM_MOVE:
01167             ResetIMECompWin( hWnd );
01168             break;
01169
01170         case WM_DESTROY:
01171             PostQuitMessage(0);
01172             break;
01173
01174         case WM_CLOSE:
01175             DestroyWindow( hWnd );
01176             break;
01177
01178         case WM_SETFOCUS:
01179             CreateCaret(hWnd,
01180                         NULL,
01181                         (fInsertMode && IsDBCSLeadByte( textbuf[yPos][xPos] )) ?
01182                             CaretWidth*2 : CaretWidth,
01183                         cyMetrics );
01184             SetCaretPos( xPos * cxMetrics, yPos * cyMetrics );
01185             ShowCaret( hWnd );
01186             break;
01187
01188         case WM_KILLFOCUS:
01189             HideCaret( hWnd );
01190             DestroyCaret();
01191             break;
01192
01193         case WM_KEYDOWN:
01194             VirtualKeyHandler( hWnd, wParam );
01195             break;
01196
01197         case WM_CHAR:
01198             CharHandler( hWnd, wParam );
01199             break;
01200
01201         case WM_LBUTTONDOWN:
01202             MouseHandler( hWnd, lParam );
01203             break;
01204
01205         case WM_COMMAND:
01206             SteCommand( hWnd, wParam );
01207             break;
01208
01209         case WM_PAINT:
01210             InvalidateRect(hWnd,NULL,FALSE);
01211             hdc = BeginPaint( hWnd, &ps );
01212
01213             //
01214             // Refresh display from text buffer
01215             //
01216             for ( i = FIRSTROW; i <= LASTROW; i++ )
01217             {
01218                 TextOutA( hdc, 0, i*cyMetrics, (LPCSTR)textbuf[i], MAXCOL );
01219             }
01220             EndPaint( hWnd, &ps );
01221             break;
01222
01223         case WM_INPUTLANGCHANGE:
01224             InputChangeHandler( hWnd );
01225             bRetDWP = TRUE;
01226             break;
01227
01228         default:
01229             bRetDWP = TRUE;
01230             break;
01231     }
01232
01233     if (bRetDWP)
01234     {
01235         return DefWindowProc( hWnd, msg, wParam, lParam );
01236     }
01237     else
01238     {
01239         return 0;
01240     }
01241 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/GLOBALS.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

GLOBALS.h

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // PURPOSE:
00009 //
00010 //  Contains declarations for all globally scoped names in the program
00011 //
00012
00013 //
00014 // Product identifier string defines
00015 //
00016 //  **TODO** Change these strings to the name of your application.
00017
00018 #define APPNAME  TAPICOMM
00019 #define ICONFILE TAPICOMM.ICO
00020 #define SZAPPNAME "TAPICOMM"
00021 #define SZDESCRIPTION "TAPI/COMM Sample"
00022 #define SZABOUT "About TAPICOMM"
00023 #define SZVERSION "4.0"
00024
00025 //-------------------------------------------------------------------------
00026 // Functions for handling main window messages.  The message-dispatching
00027 // mechanism expects all message-handling functions to have the following
00028 // prototype:
00029 //
00030 //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
00031
00032 // **TODO**  Add message-handling function prototypes here.  Be sure to
00033 //           add the function names to the main window message table in
00034 //           TapiComm.c.
00035
00036 LRESULT MsgCommand   (HWND, UINT, WPARAM, LPARAM);
00037 LRESULT MsgCreate    (HWND, UINT, WPARAM, LPARAM);
00038 LRESULT MsgDestroy   (HWND, UINT, WPARAM, LPARAM);
00039 LRESULT MsgSize      (HWND, UINT, WPARAM, LPARAM);
00040 LRESULT MsgSetFocus  (HWND, UINT, WPARAM, LPARAM);
00041 LRESULT MsgTimer     (HWND, UINT, WPARAM, LPARAM);
00042 LRESULT MsgMousemove (HWND, UINT, WPARAM, LPARAM);
00043 LRESULT MsgMenuSelect(HWND, UINT, WPARAM, LPARAM);
00044 LRESULT MsgNotify    (HWND, UINT, WPARAM, LPARAM);
00045 LRESULT MsgClose     (HWND, UINT, WPARAM, LPARAM);
00046 LRESULT MsgPaint     (HWND, UINT, WPARAM, LPARAM);
00047
00048
00049 //-------------------------------------------------------------------------
00050 // Functions for handling main window commands--ie. functions for
00051 // processing WM_COMMAND messages based on the wParam value.
00052 // The message-dispatching mechanism expects all command-handling
00053 // functions to have the following prototype:
00054 //
00055 //     LRESULT FunctionName(HWND, WORD, WORD, HWND);
00056
00057 // **TODO**  Add message-handling function prototypes here.  Be sure to
00058 //           add the function names to the main window command table in
00059 //           TapiComm.c.
00060
00061 LRESULT CmdExit (HWND, WORD, WORD, HWND);
00062 LRESULT CmdAbout(HWND, WORD, WORD, HWND);
00063 LRESULT CmdStub (HWND, WORD, WORD, HWND);
00064 LRESULT CmdMakeCall   (HWND, WORD, WORD, HWND);
00065 LRESULT CmdHangupCall (HWND, WORD, WORD, HWND);
00066
00067
00068
00069
00070 //-------------------------------------------------------------------------
00071 // Global function prototypes.
00072
00073 // **TODO**  Add global function prototypes here.
00074
00075 BOOL InitApplication(HINSTANCE, int);
00076 BOOL CenterWindow(HWND, HWND);
00077
00078     // Callback functions.  These are called by Windows.
00079
00080 // **TODO**  Add new callback function prototypes here.
00081
00082 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00083
00084 //-------------------------------------------------------------------------
00085 // Command ID definitions.  These definitions are used to associate menu
00086 // items with commands.
00087
00088 // **TODO**  Add IDs for all menu commands here.  Be sure that the IDs you
00089 //           add are also added to the main window command table in TapiComm.c
00090 //           and the menu statements in the resource file.
00091
00092 // File menu
00093 #define IDS_FILEMENU       1000
00094 #define IDM_FILENEW        1001
00095 #define IDM_FILEOPEN       1002
00096 #define IDM_FILESAVE       1003
00097 #define IDM_FILESAVEAS     1004
00098 #define IDM_FILECLOSE      1005
00099 #define IDM_FILEPRINT      1006
00100 #define IDM_FILEPAGESU     1007
00101 #define IDM_FILEPRINTSU    1008
00102 #define IDM_EXIT           1009
00103 #define IDM_MAKECALL       1010
00104 #define IDM_HANGUPCALL     1011
00105
00106 // Edit menu
00107 #define IDS_EDITMENU       2000
00108 #define IDM_EDITUNDO       2001
00109 #define IDM_EDITCUT        2002
00110 #define IDM_EDITCOPY       2003
00111 #define IDM_EDITPASTE      2004
00112 #define IDM_EDITCLEAR      2005
00113
00114 // Help menu
00115 #define IDS_HELPMENU       3000
00116 #define IDM_ABOUT          3001
00117
00118 //-------------------------------------------------------------------------
00119 // String Table ID definitions.
00120
00121 #define IDS_APPNAME     1
00122 #define IDS_DESCRIPTION 2
00123
00124 //-------------------------------------------------------------------------
00125 //  About dialog defines.
00126
00127 #define IDD_VERFIRST    100
00128 #define IDD_VERLAST     104
00129
00130
00131 // -----------------------------------------------------------------------
00132 // Global Variable declarations
00133 //
00134
00135 extern HINSTANCE hInst;     // The current instance
00136 extern char szAppName[];    // The name of this application
00137 extern char szTitle[];      // The title bar text
00138
00139 // **TODO**  For NON-MDI applications, uncomment line 1 below and comment
00140 //           line 2.  For MDI applications, uncomment line 2 below, comment
00141 //           line 1, and then define hwndMDIClient as a global variable in
00142 //           INIT.C
00143 #define hwndMDIClient NULL        /* (1) Stub for NON-MDI applications. */
00144 // extern HWND hwndMDIClient;     /* (2) For MDI applications.          */
00145
00146
00147 //-------------------------------------------------------------------------
00148 // Message and command dispatch infrastructure.  The following type
00149 // definitions and functions are used by the message and command dispatching
00150 // mechanism and do not need to be changed.
00151
00152     // Function pointer prototype for message handling functions.
00153 typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM);
00154
00155     // Function pointer prototype for command handling functions.
00156 typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND);
00157
00158     // Enumerated type used to determine which default window procedure
00159     // should be called by the message- and command-dispatching mechanism
00160     // if a message or command is not handled explicitly.
00161 typedef enum
00162 {
00163    edwpNone,            // Do not call any default procedure.
00164    edwpWindow,          // Call DefWindowProc.
00165    edwpDialog,          // Call DefDlgProc (This should be used only for
00166                         // custom dialogs - standard dialog use edwpNone).
00167    edwpMDIChild,        // Call DefMDIChildProc.
00168    edwpMDIFrame         // Call DefFrameProc.
00169 } EDWP;                // Enumeration for Default Window Procedures
00170
00171     // This structure maps messages to message handling functions.
00172 typedef struct _MSD
00173 {
00174     UINT   uMessage;
00175     PFNMSG pfnmsg;
00176 } MSD;                 // MeSsage Dispatch structure
00177
00178     // This structure contains all of the information that a window
00179     // procedure passes to DispMessage in order to define the message
00180     // dispatching behavior for the window.
00181 typedef struct _MSDI
00182 {
00183     int  cmsd;          // Number of message dispatch structs in rgmsd
00184     MSD *rgmsd;         // Table of message dispatch structures
00185     EDWP edwp;          // Type of default window handler needed.
00186 } MSDI, FAR *LPMSDI;   // MeSsage Dipatch Information
00187
00188     // This structure maps command IDs to command handling functions.
00189 typedef struct _CMD
00190 {
00191     WORD   wCommand;
00192     PFNCMD pfncmd;
00193 } CMD;                 // CoMmand Dispatch structure
00194
00195     // This structure contains all of the information that a command
00196     // message procedure passes to DispCommand in order to define the
00197     // command dispatching behavior for the window.
00198 typedef struct _CMDI
00199 {
00200     int  ccmd;          // Number of command dispatch structs in rgcmd
00201     CMD *rgcmd;         // Table of command dispatch structures
00202     EDWP edwp;          // Type of default window handler needed.
00203 } CMDI, FAR *LPCMDI;   // CoMmand Dispatch Information
00204
00205     // Message and command dispatching functions.  They look up messages
00206     // and commands in the dispatch tables and call the appropriate handler
00207     // function.
00208 LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM);
00209 LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM);
00210
00211     // Message dispatch information for the main window
00212 extern MSDI msdiMain;
00213     // Command dispatch information for the main window
00214 extern CMDI cmdiMain;
00215
00216
00217 #define SZRCOMPANYNAME "CompanyName"
00218 #define SZRDESCRIPTION "FileDescription"
00219 #define SZRVERSION     "FileVersion"
00220 #define SZRAPPNAME     "InternalName"
00221 #define SZRCOPYRIGHT   "LegalCopyright"
00222 #define SZRTRADEMARK   "LegalTrademarks"
00223 #define SZRPRODNAME    "ProductName"
00224 #define SZRPRODVER     "ProuctVersion"
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcChar.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcChar.h

Go to the documentation of this file.
00001 #if !defined(AFX_AGENTCTLCHARACTEREX_H__AB8FEBA5_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00002 #define AFX_AGENTCTLCHARACTEREX_H__AB8FEBA5_3841_11D2_8512_00C04FA34A14__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00008
00009 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00010 //  Microsoft Visual C++, your modifications will be overwritten.
00011
00012
00013 // Dispatch interfaces referenced by this interface
00014 class CAgentCtlBalloonEx;
00015 class CAgentCtlCommandsEx;
00016 class CAgentCtlRequest;
00017 class CAgentCtlAnimationNames;
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CAgentCtlCharacterEx wrapper class
00021
00022 class CAgentCtlCharacterEx : public COleDispatchDriver
00023 {
00024 public:
00025   CAgentCtlCharacterEx() {}   // Calls COleDispatchDriver default constructor
00026   CAgentCtlCharacterEx(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
00027   CAgentCtlCharacterEx(const CAgentCtlCharacterEx& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
00028
00029 // Attributes
00030 public:
00031
00032 // Operations
00033 public:
00034   CAgentCtlBalloonEx GetBalloon();
00035   CAgentCtlCommandsEx GetCommands();
00036   CString GetName();
00037   CString GetDescription();
00038   BOOL GetVisible();
00039   void SetLeft(short nNewValue);
00040   short GetLeft();
00041   void SetTop(short nNewValue);
00042   short GetTop();
00043   void SetHeight(short nNewValue);
00044   short GetHeight();
00045   void SetWidth(short nNewValue);
00046   short GetWidth();
00047   long GetSpeed();
00048   long GetPitch();
00049   void SetIdleOn(BOOL bNewValue);
00050   BOOL GetIdleOn();
00051   BOOL Activate(const VARIANT& State);
00052   CAgentCtlRequest Play(LPCTSTR Animation);
00053   CAgentCtlRequest Get(LPCTSTR Type, LPCTSTR Name, const VARIANT& Queue);
00054   void Stop(const VARIANT& Request);
00055   CAgentCtlRequest Wait(LPDISPATCH WaitForRequest);
00056   CAgentCtlRequest Interrupt(LPDISPATCH InterruptRequest);
00057   CAgentCtlRequest Speak(const VARIANT& Text, const VARIANT& Url);
00058   CAgentCtlRequest GestureAt(short x, short y);
00059   CAgentCtlRequest MoveTo(short x, short y, const VARIANT& Speed);
00060   CAgentCtlRequest Hide(const VARIANT& Fast);
00061   CAgentCtlRequest Show(const VARIANT& Fast);
00062   void StopAll(const VARIANT& Types);
00063   short GetMoveCause();
00064   short GetVisibilityCause();
00065   BOOL GetHasOtherClients();
00066   void SetSoundEffectsOn(BOOL bNewValue);
00067   BOOL GetSoundEffectsOn();
00068   void SetName(LPCTSTR lpszNewValue);
00069   void SetDescription(LPCTSTR lpszNewValue);
00070   CString GetExtraData();
00071   void ShowPopupMenu(short x, short y);
00072   void SetAutoPopupMenu(BOOL bNewValue);
00073   BOOL GetAutoPopupMenu();
00074   void SetHelpModeOn(BOOL bNewValue);
00075   BOOL GetHelpModeOn();
00076   void SetHelpContextID(long nNewValue);
00077   long GetHelpContextID();
00078   short GetActive();
00079   BOOL Listen(BOOL Listen);
00080   void SetLanguageID(long nNewValue);
00081   long GetLanguageID();
00082   CString GetSRModeID();
00083   void SetSRModeID(LPCTSTR lpszNewValue);
00084   CString GetTTSModeID();
00085   void SetTTSModeID(LPCTSTR lpszNewValue);
00086   CString GetHelpFile();
00087   void SetHelpFile(LPCTSTR lpszNewValue);
00088   CString GetGuid();
00089   short GetOriginalHeight();
00090   short GetOriginalWidth();
00091   CAgentCtlRequest Think(LPCTSTR Text);
00092   CString GetVersion();
00093   CAgentCtlAnimationNames GetAnimationNames();
00094   long GetSRStatus();
00095 };
00096
00097 //{{AFX_INSERT_LOCATION}}
00098 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00099
00100 #endif // !defined(AFX_AGENTCTLCHARACTEREX_H__AB8FEBA5_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/RegAcc32.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

RegAcc32.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 1998 Microsoft Corporation
00005 //
00006 //  File:       RegAcc.hxx
00007 //
00008 //  Contents:   'Simple' registry access
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #if !defined( __REGACC32_HXX__ )
00013 #define __REGACC32_HXX__
00014
00015 void StringToClsid( WCHAR *wszClass, GUID& guidClass );
00016
00017
00018 //+-------------------------------------------------------------------------
00019 //
00020 //  Class:      CRegAccess
00021 //
00022 //  Purpose:    'Simple' registry access
00023 //
00024 //  Notes:      This class provides read-only access to the registry.
00025 //
00026 //--------------------------------------------------------------------------
00027
00028 class CRegAccess
00029 {
00030 public:
00031
00032     CRegAccess( HKEY keyRelative, WCHAR const * pwcsRegPath );
00033
00034     ~CRegAccess();
00035
00036     BOOL Get( WCHAR const * pwcsValue, WCHAR * wcsVal, unsigned cc );
00037
00038 private:
00039
00040     HKEY    _hKey;
00041     WCHAR   _wcsPathBuf[100];
00042     WCHAR * _wcsPath;
00043 };
00044
00045 #endif // __REGACC32_HXX__
00046
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/CAsyncXXX.cpp Source File

  • Com
  • async
  • server

CAsyncXXX.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "Debug.h"
00018
00019 /*
00020  *  This static member function instanciates the call object by way of a two part initialization.
00021  */
00022 template<class T, class ISyncFace, class IAsyncFace>
00023 LPUNKNOWN __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::Create
00024               (LPUNKNOWN lpUnkCtrl, REFIID riid1, REFIID riid2, T *pT, ISyncFace *lpSyncface)
00025 {
00026   DEBUGTRACE(_T("CAsyncXXX::Create()"));
00027
00028   /* Create the uninitialized object. The reason for this two part creation mechanism is that there is no
00029    * easy way to handle failures within a ctor. Therefore only the operations certain to succeed are done
00030    * within the ctor. The more complex initializations that could fail are done in the call to Init()
00031    */
00032   CAsyncXXX<T, ISyncFace, IAsyncFace> *pAsync = new CAsyncXXX<T, ISyncFace, IAsyncFace>(lpUnkCtrl, riid1);
00033
00034   if (!pAsync)
00035     return NULL;
00036
00037   pAsync->NondelegatingAddRef();
00038   LPUNKNOWN lpUnk = NULL;
00039   HRESULT hr;
00040   if (SUCCEEDED(hr = pAsync->Init(pT, lpSyncface)))
00041   {
00042     hr = pAsync->NondelegatingQueryInterface(riid2, reinterpret_cast<PVOID*>(&lpUnk));
00043
00044   }
00045   pAsync->NondelegatingRelease();
00046
00047   if (FAILED(hr))
00048     DEBUGTRACE(_T("Error instanciating Call Object: HRESULT is %#X"), hr);
00049
00050   return lpUnk;
00051 }
00052
00053
00054 #pragma warning(disable : 4355)
00055 template<class T, class ISyncFace, class IAsyncFace>
00056 CAsyncXXX<T, ISyncFace, IAsyncFace>::CAsyncXXX(LPUNKNOWN lpUnk, REFIID iid)
00057     :CUnknown(lpUnk,"CAsyncXXX"), CAsyncTest(this),
00058     m_lpSyncface(NULL), m_lpObj(NULL), m_iid(iid), m_lpUnkSync(NULL)
00059 {
00060   DEBUGTRACE(_T("CAsyncXXX ctor"));
00061 }
00062
00063
00064 template<class T, class ISyncFace, class IAsyncFace>
00065 CAsyncXXX<T, ISyncFace, IAsyncFace>::~CAsyncXXX()
00066 {
00067   DEBUGTRACE(_T("CAsyncXXX dtor"));
00068 }
00069
00070
00071 template<class T, class ISyncFace, class IAsyncFace>
00072 long __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::Init(const CFactoryData *pData)
00073 {
00074   DEBUGTRACE(_T("This function should never be called"));
00075   DebugBreak();
00076   return 0;
00077 }
00078
00079
00080 template<class T, class ISyncFace, class IAsyncFace>
00081 HRESULT __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::Init(T *pT, ISyncFace *lpSyncface)
00082 {
00083   DEBUGTRACE(_T("In CAsyncXXX::Init"));
00084   _ASSERT(pT);
00085   _ASSERT(lpSyncface);
00086
00087   /*
00088    *  The life type of class T is contained within the life time of ISyncFace
00089    */
00090    m_lpObj = pT;
00091   (m_lpSyncface = lpSyncface)->AddRef();
00092
00093
00094   /*
00095    *  Note that the CLSID_ManualResetEvent object is aggreated by the call to GetOuterUnknown(). This is done so that
00096    *  both objects created in the same apartment or different apartments can be treated the same.
00097    *
00098    *  The GetOuterUnknown() method will either return the controlling Unknown passed into ICallFactory::CreateCall()
00099    *  if aggregated or itself in the non-aggreated case. The client will either be using the ISynchronize interface returned
00100    *  from the CoCreateInstance() method below in the typical inproc case or COM's implemenation of ISynchronize in
00101    *  the typical Local server case. In each case the call object must use the same ISynchronize
00102    *  implementation as the client does.
00103    *
00104    */
00105   HRESULT hr = CoCreateInstance(CLSID_ManualResetEvent, GetOuterUnknown(), CLSCTX_INPROC, IID_IUnknown, reinterpret_cast<PVOID*>(&m_lpUnkSync));
00106   _ASSERT(SUCCEEDED(hr) && m_lpUnkSync);
00107
00108   return S_OK;
00109 }
00110
00111
00112 template<class T, class ISyncFace, class IAsyncFace>
00113 HRESULT __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::NondelegatingQueryInterface(REFIID iid, PVOID *ppv)
00114 {
00115   CHECKPOINTER(ppv);
00116
00117   if (iid == IID_IUnknown)
00118   {
00119     return FinishQI(reinterpret_cast<LPUNKNOWN>
00120                        (static_cast<INondelegatingUnknown*>(this)), iid, ppv) ;
00121   }
00122   else if (iid == m_iid)
00123   {
00124     return FinishQI(static_cast<IAsyncFace*>(this), iid, ppv);
00125   }
00126   else if (iid == IID_ISynchronize)
00127   {
00128     return m_lpUnkSync->QueryInterface(IID_ISynchronize, ppv);
00129   }
00130
00131   return CUnknown::NondelegatingQueryInterface(iid, ppv);
00132 }
00133
00134
00135
00136 /*
00137  *  Reset(), Signal() and Wait() are helper functions that wrap either COM's implemenation of ISynchronize or
00138  *  the CLSID_ManualResetEvent object.
00139  */
00140 template<class T, class ISyncFace, class IAsyncFace>
00141 HRESULT __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::Reset()
00142 {
00143   LPSYNCHRONIZE   lpSync = NULL;
00144   HRESULT hr = QueryInterface(IID_ISynchronize, reinterpret_cast<PVOID*>(&lpSync));
00145   _ASSERT(SUCCEEDED(hr) && lpSync);
00146   hr = lpSync->Reset();
00147   RELEASEINTERFACE(lpSync);
00148   return S_OK;
00149 }
00150
00151 template<class T, class ISyncFace, class IAsyncFace>
00152 HRESULT __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::Signal()
00153 {
00154   LPSYNCHRONIZE   lpSync = NULL;
00155   HRESULT hr = QueryInterface(IID_ISynchronize, reinterpret_cast<PVOID*>(&lpSync));
00156   _ASSERT(SUCCEEDED(hr) && lpSync);
00157   hr = lpSync->Signal();
00158   _ASSERT(SUCCEEDED(hr));
00159   RELEASEINTERFACE(lpSync);
00160   return hr;
00161 }
00162
00163
00164 template<class T, class ISyncFace, class IAsyncFace>
00165 HRESULT __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::Wait(ULONG dwFlags, ULONG dwMilliseconds)
00166 {
00167   LPSYNCHRONIZE   lpSync = NULL;
00168   HRESULT hr = QueryInterface(IID_ISynchronize, reinterpret_cast<PVOID*>(&lpSync));
00169   _ASSERT(SUCCEEDED(hr) && lpSync);
00170   hr = lpSync->Wait(dwFlags, dwMilliseconds);
00171   _ASSERT(SUCCEEDED(hr));
00172   RELEASEINTERFACE(lpSync);
00173   return hr;
00174 }
00175
00176
00177 template<class T, class ISyncFace, class IAsyncFace>
00178 void __stdcall CAsyncXXX<T, ISyncFace, IAsyncFace>::FinalRelease()
00179 {
00180   DEBUGTRACE(_T("CAsyncXXX::FinalRelease"));
00181   RELEASEINTERFACE(m_lpUnkSync);
00182   RELEASEINTERFACE(m_lpSyncface);
00183 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_ENUMERATE_DIRECTORY_STACK Member List

This is the complete list of members for _ENUMERATE_DIRECTORY_STACK, including all inherited members.
FindHandle | _ENUMERATE_DIRECTORY_STACK
PathEnd | _ENUMERATE_DIRECTORY_STACK
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/HtmlProp/HtmlProp.Cxx Source File

  • WinBase
  • Indexing
  • HtmlProp

HtmlProp.Cxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // PROGRAM:  htmlprop.cxx
00011 //
00012 // PURPOSE:  Sits on the Indexing Service HTML filter to translate string
00013 //           meta properties into specified data types.
00014 //
00015 // PLATFORM: Windows 2000
00016 //
00017 //--------------------------------------------------------------------------
00018
00019 #define UNICODE
00020
00021 #include <stdio.h>
00022 #include <wchar.h>
00023
00024 #include <windows.h>
00025 #include <oledb.h>
00026 #include <cmdtree.h>
00027
00028 #include <filterr.h>
00029 #include <filter.h>
00030
00031 #include "htmlprop.hxx"
00032 #include "filtreg.hxx"
00033
00034 // The typid of the html filter
00035
00036 CLSID TYPID_HtmlPropIFilter =
00037 {
00038     0xc8e2ab80, 0xa1db, 0x11d1,
00039     { 0xa8, 0xfb, 0x00, 0xe0, 0x98, 0x00, 0x6e, 0xd3 }
00040 };
00041
00042 // The CLSID for the html property filter
00043
00044 CLSID CLSID_HtmlPropIFilter =
00045 {
00046     0xf4309e80, 0xa1db, 0x11d1,
00047     { 0xa8, 0xfb, 0x00, 0xe0, 0x98, 0x00, 0x6e, 0xd3 }
00048 };
00049
00050 // Class of the html property filter
00051
00052 CLSID CLSID_HtmlPropClass =
00053 {
00054     0x4cbd1020, 0xa1db, 0x11d1,
00055     { 0xa8, 0xfb, 0x00, 0xe0, 0x98, 0x00, 0x6e, 0xd3 }
00056 };
00057
00058 // The built-in html filter
00059
00060 CLSID CLSID_HtmlIFilter =
00061 {
00062     0xe0ca5340, 0x4534, 0x11cf,
00063     { 0xb9, 0x52, 0x00, 0xaa, 0x00, 0x51, 0xfe, 0x20 }
00064 };
00065
00066 // The guid for html meta properties
00067
00068 CLSID CLSID_MetaProperty =
00069 {
00070     0xd1b5d3f0, 0xc0b3, 0x11cf,
00071     { 0x9a, 0x92, 0x00, 0xa0, 0xc9, 0x08, 0xdb, 0xf1 }
00072 };
00073
00074 // The guid for html meta properties in string form
00075
00076 const WCHAR * pwcMetaProperty = L"d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1";
00077
00078 struct SPropertyEntry
00079 {
00080     WCHAR  awcName[cwcMaxName]; // name of the meta property
00081     DBTYPE dbType;              // data type of property
00082 };
00083
00084 const SPropertyEntry aTypeEntries[] =
00085 {
00086     { L"DBTYPE_I1",   DBTYPE_I1   }, //  0: signed char
00087     { L"DBTYPE_UI1",  DBTYPE_UI1  }, //  1: unsigned char
00088     { L"DBTYPE_I2",   DBTYPE_I2   }, //  2: 2 byte signed int
00089     { L"DBTYPE_UI2",  DBTYPE_UI2  }, //  3: 2 byte unsigned int
00090     { L"DBTYPE_I4",   DBTYPE_I4   }, //  4: 4 byte signed int
00091     { L"DBTYPE_UI4",  DBTYPE_UI4  }, //  5: 4 byte unsigned int
00092     { L"DBTYPE_I8",   DBTYPE_I8   }, //  6: 8 byte signed int
00093     { L"DBTYPE_UI8",  DBTYPE_UI8  }, //  7: 8 byte unsigned int
00094     { L"DBTYPE_R4",   DBTYPE_R4   }, //  8: 4 byte float
00095     { L"DBTYPE_R8",   DBTYPE_R8   }, //  9: 8 byte float
00096     { L"DBTYPE_BOOL", DBTYPE_BOOL }, // 12: BOOL (true=-1, false=0)
00097     { L"DBTYPE_WSTR", DBTYPE_WSTR }, // 14: wide null terminated string
00098     { L"VT_FILETIME", VT_FILETIME }  // 19: I8 filetime
00099 };
00100
00101 const ULONG cTypeEntries = sizeof aTypeEntries / sizeof aTypeEntries[0];
00102
00103 const WCHAR * pwcHTMLPropertyFile = L"htmlprop.ini";
00104
00105 const ULONG maxEntries = 500;
00106 SPropertyEntry g_aEntries[ maxEntries ];
00107 ULONG g_cEntries = 0; // count of entries in g_aEntries
00108
00109 long g_cInstances = 0;
00110 HMODULE g_hHtmlDll = 0; // module handle for nlhtml.dll
00111
00112 // htmlfilt.dll for IS 1.x and nlhtml.dll for IS 2.x
00113
00114 const WCHAR * pwcHTMLFilter = L"nlhtml.dll";
00115
00116 //+-------------------------------------------------------------------------
00117 //
00118 //  Method:     HtmlPropIFilter::HtmlPropIFilter
00119 //
00120 //  Synopsis:   Constructor
00121 //
00122 //--------------------------------------------------------------------------
00123
00124 HtmlPropIFilter::HtmlPropIFilter() :
00125     _pHtmlFilter( 0 ),
00126     _pPersistFile( 0 ),
00127     _lRefs( 1 ),
00128     _fMetaProperty( FALSE )
00129 {
00130     _awcName[0] = 0;
00131     InterlockedIncrement( &g_cInstances );
00132 } //HtmlPropIFilter
00133
00134 //+-------------------------------------------------------------------------
00135 //
00136 //  Method:     HtmlPropIFilter::~HtmlPropIFilter
00137 //
00138 //  Synopsis:   Destructor
00139 //
00140 //--------------------------------------------------------------------------
00141
00142 HtmlPropIFilter::~HtmlPropIFilter()
00143 {
00144     InterlockedDecrement( &g_cInstances );
00145
00146     if ( _pHtmlFilter )
00147         _pHtmlFilter->Release();
00148
00149     if ( _pPersistFile )
00150         _pPersistFile->Release();
00151 } //~HtmlPropIFilter
00152
00153 //+-------------------------------------------------------------------------
00154 //
00155 //  Method:     HtmlPropIFilter::QueryInterface
00156 //
00157 //  Synopsis:   Rebind to other interface
00158 //
00159 //  Arguments:  [riid]      -- IID of new interface
00160 //              [ppvObject] -- New interface * returned here
00161 //
00162 //  Returns:    S_OK if bind succeeded, E_NOINTERFACE if bind failed
00163 //
00164 //--------------------------------------------------------------------------
00165
00166 SCODE STDMETHODCALLTYPE HtmlPropIFilter::QueryInterface(
00167     REFIID   riid,
00168     void  ** ppvObject)
00169 {
00170     if ( IID_IFilter == riid )
00171         *ppvObject = (IFilter *)this;
00172     else if ( IID_IPersist == riid )
00173         *ppvObject = (IPersist *)(IPersistFile *)this;
00174     else if ( IID_IPersistFile == riid )
00175         *ppvObject = (IPersistFile *)this;
00176     else if ( IID_IUnknown == riid )
00177         *ppvObject = (IUnknown *)(IPersist *)(IPersistFile *)this;
00178     else
00179     {
00180         *ppvObject = 0;
00181         return E_NOINTERFACE;
00182     }
00183
00184     AddRef();
00185     return S_OK;
00186 } //QueryInterface
00187
00188 //+-------------------------------------------------------------------------
00189 //
00190 //  Method:     HtmlPropIFilter::AddRef
00191 //
00192 //  Synopsis:   Increments refcount
00193 //
00194 //--------------------------------------------------------------------------
00195
00196 ULONG STDMETHODCALLTYPE HtmlPropIFilter::AddRef()
00197 {
00198     return InterlockedIncrement( &_lRefs );
00199 } //AddRef
00200
00201 //+-------------------------------------------------------------------------
00202 //
00203 //  Method:     HtmlPropIFilter::Release
00204 //
00205 //  Synopsis:   Decrement refcount.  Delete if necessary.
00206 //
00207 //--------------------------------------------------------------------------
00208
00209 ULONG STDMETHODCALLTYPE HtmlPropIFilter::Release()
00210 {
00211     long lTmp = InterlockedDecrement( &_lRefs );
00212
00213     if ( 0 == lTmp )
00214         delete this;
00215     return lTmp;
00216 } //Release
00217
00218 //+-------------------------------------------------------------------------
00219 //
00220 //  Member:     HtmlPropIFilter::Init, public
00221 //
00222 //  Synopsis:   Initializes instance of property filter
00223 //
00224 //  Arguments:  [grfFlags]      -- flags for filter behavior
00225 //              [cAttributes]   -- number of attributes in array aAttributes
00226 //              [aAttributes]   -- array of attributes
00227 //              [pFlags]        -- flags
00228 //
00229 //----------------------------------------------------------------------------
00230
00231 SCODE STDMETHODCALLTYPE HtmlPropIFilter::Init(
00232     ULONG                grfFlags,
00233     ULONG                cAttributes,
00234     FULLPROPSPEC const * aAttributes,
00235     ULONG *              pFlags )
00236 {
00237     return _pHtmlFilter->Init( grfFlags, cAttributes, aAttributes, pFlags );
00238 } //Init
00239
00240 //+-------------------------------------------------------------------------
00241 //
00242 //  Method:     HtmlPropIFilter::GetChunk
00243 //
00244 //  Synopsis:   Gets the next chunk
00245 //
00246 //  Arguments:  [pStat]      -- Chunk info
00247 //
00248 //--------------------------------------------------------------------------
00249
00250 SCODE STDMETHODCALLTYPE HtmlPropIFilter::GetChunk(
00251     STAT_CHUNK * pStat )
00252 {
00253     SCODE sc = _pHtmlFilter->GetChunk( pStat );
00254
00255     // If we got a chunk, it's a value chunk, and it's a meta property with
00256     // a string identifier, store away the name so it's available when the
00257     // value is retrieved.
00258
00259     if ( ( SUCCEEDED( sc ) ) &&
00260          ( 0 != ( pStat->flags & CHUNK_VALUE ) ) &&
00261          ( PRSPEC_LPWSTR == pStat->attribute.psProperty.ulKind ) &&
00262          ( CLSID_MetaProperty == pStat->attribute.guidPropSet ) &&
00263          ( 0 != pStat->attribute.psProperty.lpwstr ) &&
00264          ( wcslen( pStat->attribute.psProperty.lpwstr ) < cwcMaxName ) )
00265     {
00266         _fMetaProperty = TRUE;
00267         wcscpy( _awcName, pStat->attribute.psProperty.lpwstr );
00268     }
00269     else
00270     {
00271         _fMetaProperty = FALSE;
00272     }
00273
00274     return sc;
00275 } //GetChunk
00276
00277 //+-------------------------------------------------------------------------
00278 //
00279 //  Function:   ParseDateTime
00280 //
00281 //  Synopsis:   Parse the string and return a date/time
00282 //              n.b. If the date is ill-formed and this function returns
00283 //              an error code, the file will be unfiltered, and can be
00284 //              found by using the unfiltered admin query.
00285 //              The date parsing is very strict.
00286 //              Times are in any time zone you like, but .htx will interpret
00287 //              all dates as GMT.  You can always use .asp script to munge
00288 //              dates as you like.
00289 //
00290 //  Arguments:  [pwcDate]   -- String form of the date/time
00291 //              [ft]        -- Returns the date/time
00292 //
00293 //--------------------------------------------------------------------------
00294
00295 SCODE ParseDateTime(
00296     WCHAR *    pwcDate,
00297     FILETIME & ft )
00298 {
00299     SCODE      scResult = S_OK;
00300     int        cItems = 0;
00301     SYSTEMTIME stValue = { 0, 0, 0, 0, 0, 0, 0, 0 };
00302     wchar_t    szMonthAbrv[1024] = {0};
00303     wchar_t    szMonthList[] = L"JanFebMarAprMayJunJulAugSepOctNovDec";
00304     wchar_t    *pDest = NULL;
00305
00306     // Format: 1994/11/06 08:49:37:00, time optional, milliseconds optional
00307
00308     cItems = swscanf( pwcDate,
00309                       L"%4hd/%2hd/%2hd %2hd:%2hd:%2hd:%3hd",
00310                       &stValue.wYear,
00311                       &stValue.wMonth,
00312                       &stValue.wDay,
00313                       &stValue.wHour,
00314                       &stValue.wMinute,
00315                       &stValue.wSecond,
00316                       &stValue.wMilliseconds );
00317
00318     if (cItems == 3 || cItems == 6 || cItems == 7)
00319         goto prepdate;
00320
00321     // Format: 1994-11-06 08:49:37:00, time optional, milliseconds optional
00322
00323     cItems = swscanf( pwcDate,
00324                       L"%4hd-%2hd-%2hd %2hd:%2hd:%2hd:%3hd",
00325                       &stValue.wYear,
00326                       &stValue.wMonth,
00327                       &stValue.wDay,
00328                       &stValue.wHour,
00329                       &stValue.wMinute,
00330                       &stValue.wSecond,
00331                       &stValue.wMilliseconds );
00332
00333     if (cItems == 3 || cItems == 6 || cItems == 7)
00334         goto prepdate;
00335
00336     // Format: Sun, 06 Nov 1994 08:49:37 GMT
00337
00338     cItems = swscanf( pwcDate,
00339                       L"%*Ls %2hd %3Ls %4hd %2hd:%2hd:%2hd GMT",
00340                                           &stValue.wDay,
00341                                           szMonthAbrv,
00342                       &stValue.wYear,
00343                       &stValue.wHour,
00344                       &stValue.wMinute,
00345                       &stValue.wSecond );
00346
00347     if (cItems == 6)
00348     {
00349          pDest = wcsstr(szMonthList, szMonthAbrv);
00350          if (pDest != NULL)
00351          {
00352              stValue.wMonth = (WORD) ((pDest - szMonthList) / 3) + 1;
00353              goto prepdate;
00354          }
00355     }
00356
00357     // Format: Sunday, 06-Nov-94 08:49:37 GMT
00358
00359     cItems = swscanf( pwcDate,
00360                       L"%*Ls %2hd-%3Ls-%2hd %2hd:%2hd:%2hd GMT",
00361                       &stValue.wDay,
00362                       szMonthAbrv,
00363                       &stValue.wYear,
00364                       &stValue.wHour,
00365                       &stValue.wMinute,
00366                       &stValue.wSecond );
00367
00368     if (cItems == 6)
00369     {
00370         pDest = wcsstr(szMonthList, szMonthAbrv);
00371         if (pDest != NULL)
00372         {
00373             stValue.wMonth = (WORD) ((pDest - szMonthList) / 3) + 1;
00374             goto prepdate;
00375         }
00376     }
00377
00378         // Format: Sun Nov 6 08:49:37 1994
00379     cItems = swscanf( pwcDate,
00380                       L"%*Ls %3Ls %2hd %2hd:%2hd:%2hd %4hd",
00381                                           szMonthAbrv,
00382                                           &stValue.wDay,
00383                       &stValue.wHour,
00384                       &stValue.wMinute,
00385                       &stValue.wSecond,
00386                       &stValue.wYear );
00387
00388     if (cItems == 6)
00389     {
00390         pDest = wcsstr(szMonthList, szMonthAbrv);
00391         if (pDest != NULL)
00392         {
00393             stValue.wMonth = (WORD) ((pDest - szMonthList) / 3) + 1;
00394             goto prepdate;
00395         }
00396     }
00397
00398     // Format: 1994-11-06T08:49:37.000Z
00399
00400     cItems = swscanf( pwcDate,
00401                       L"%4hd-%2hd-%2hdT%2hd:%2hd:%2hd.%3hdZ",
00402                       &stValue.wYear,
00403                       &stValue.wMonth,
00404                       &stValue.wDay,
00405                       &stValue.wHour,
00406                       &stValue.wMinute,
00407                       &stValue.wSecond,
00408                       &stValue.wMilliseconds );
00409
00410     if (cItems == 7)
00411         goto prepdate;
00412
00413     // Format: 1994-11-06T08:49:37.000 (like above, but without the Z at the end)
00414
00415     cItems = swscanf( pwcDate,
00416                       L"%4hd-%2hd-%2hdT%2hd:%2hd:%2hd.%3hd",
00417                       &stValue.wYear,
00418                       &stValue.wMonth,
00419                       &stValue.wDay,
00420                       &stValue.wHour,
00421                       &stValue.wMinute,
00422                       &stValue.wSecond,
00423                       &stValue.wMilliseconds );
00424
00425     if (cItems == 7)
00426         goto prepdate;
00427
00428
00429         // If we reach the next line, none of the formats were found.
00430     scResult = E_INVALIDARG;
00431         goto cleanup;
00432
00433 prepdate:
00434
00435     // Make a sensible split for Year 2000
00436
00437     if (stValue.wYear < 30)
00438         stValue.wYear += 2000;
00439     else if (stValue.wYear < 100)
00440         stValue.wYear += 1900;
00441
00442         // Generate a filetime value to pass back to the caller.
00443     if (! SystemTimeToFileTime(&stValue, &ft))
00444     {
00445         scResult = HRESULT_FROM_WIN32(GetLastError());
00446         goto cleanup;
00447     }
00448
00449     scResult = S_OK;
00450
00451 cleanup:
00452     return scResult;
00453 } //ParseDateTime
00454
00455 //+-------------------------------------------------------------------------
00456 //
00457 //  Function:   Translate
00458 //
00459 //  Synopsis:   Translates the string property value to the given type
00460 //
00461 //  Arguments:  [v]      -- The variant to translate
00462 //              [dbType] -- The resulting data type
00463 //
00464 //--------------------------------------------------------------------------
00465
00466 SCODE Translate(
00467     PROPVARIANT & v,
00468     DBTYPE        dbType )
00469 {
00470     PROPVARIANT varCopy = v;
00471     BOOL fChange = TRUE;
00472     SCODE sc = S_OK;
00473
00474     WCHAR *p = v.pwszVal;
00475
00476     // The source must be a string variant
00477
00478     if ( 0 == p || VT_LPWSTR != v.vt )
00479         return S_OK;
00480
00481     v.vt = dbType;
00482
00483     // Eat leading white space
00484
00485     while ( ' ' == *p )
00486         p++;
00487
00488     int base = 10;
00489
00490     // Is this a hex number?
00491
00492     if ( '0' == *p && ( 'x' == *(p+1) || 'X' == *(p+1) ) )
00493     {
00494         p += 2;
00495         base = 16;
00496     }
00497
00498     WCHAR * pwc;
00499
00500     // DBTYPE_I1 isn't an official OLE property type, so it isn't supported.
00501     //
00502     // Note: range checking could be added and a failure code could be
00503     // returned if the check failed.  That would put the file in the
00504     // unfiltered list.
00505
00506     switch ( dbType )
00507     {
00508         case DBTYPE_UI1 :
00509             v.bVal = (BYTE) wcstoul( v.pwszVal, &pwc, base );
00510             break;
00511         case DBTYPE_I2 :
00512             v.iVal = (SHORT) wcstol( v.pwszVal, &pwc, base );
00513             break;
00514         case DBTYPE_UI2 :
00515             v.uiVal = (USHORT) wcstoul( v.pwszVal, &pwc, base );
00516             break;
00517         case DBTYPE_I4 :
00518             v.lVal = (LONG) wcstol( v.pwszVal, &pwc, base );
00519             break;
00520         case DBTYPE_UI4 :
00521             v.ulVal = (ULONG) wcstoul( v.pwszVal, &pwc, base );
00522             break;
00523         case DBTYPE_I8 :
00524             swscanf( v.pwszVal, L"%I64d", &v.fltVal );
00525             break;
00526         case DBTYPE_UI8 :
00527             swscanf( v.pwszVal, L"%I64u", &v.fltVal );
00528             break;
00529         case DBTYPE_R4 :
00530             swscanf( v.pwszVal, L"%f", &v.fltVal );
00531             break;
00532         case DBTYPE_R8 :
00533             swscanf( v.pwszVal, L"%lf", &v.dblVal );
00534             break;
00535         case DBTYPE_BOOL :
00536
00537             // If the first character is t or 1, assume VARIANT_TRUE
00538
00539             if ( 't' == *v.pwszVal ||
00540                  'T' == *v.pwszVal ||
00541                  '1' == *v.pwszVal )
00542                 v.boolVal = VARIANT_TRUE;
00543             else
00544                 v.boolVal = VARIANT_FALSE;
00545             break;
00546         case VT_FILETIME :
00547             sc = ParseDateTime( p, v.filetime );
00548             break;
00549         default :
00550
00551             // leave the property as it was
00552
00553             fChange = FALSE;
00554             v.vt = varCopy.vt;
00555             break;
00556     }
00557
00558     // Free the memory for the (now converted) string value
00559
00560     if ( fChange )
00561         PropVariantClear( &varCopy );
00562
00563     return sc;
00564 } //Translate
00565
00566 //+-------------------------------------------------------------------------
00567 //
00568 //  Method:     HtmlPropIFilter::GetValue
00569 //
00570 //  Synopsis:   Retrieves the current value
00571 //
00572 //  Arguments:  [ppPropValue]  -- Where the value is stored
00573 //
00574 //--------------------------------------------------------------------------
00575
00576 SCODE STDMETHODCALLTYPE HtmlPropIFilter::GetValue(
00577     PROPVARIANT ** ppPropValue )
00578 {
00579     SCODE sc = _pHtmlFilter->GetValue( ppPropValue );
00580
00581     // Is this a value that must be translated?
00582
00583     if ( SUCCEEDED( sc ) && _fMetaProperty && 0 != *ppPropValue )
00584     {
00585         // lookup the datatype of the translation based on property name
00586
00587         for ( ULONG i = 0; i < g_cEntries; i++ )
00588         {
00589             if ( !_wcsicmp( g_aEntries[i].awcName, _awcName ) )
00590             {
00591                 // found it, so translate it
00592
00593                 sc = Translate( **ppPropValue,
00594                                 g_aEntries[i].dbType );
00595                 break;
00596             }
00597         }
00598     }
00599
00600     return sc;
00601 } //GetValue
00602
00603 //+-------------------------------------------------------------------------
00604 //
00605 //  Method:     HtmlPropIFilter::GetText
00606 //
00607 //  Synopsis:   Gets text from the filter
00608 //
00609 //  Arguments:  [pcwcBuffer]  -- Returns the # of WCHARs returned
00610 //              [awcBuffer]   -- Where text is written
00611 //
00612 //--------------------------------------------------------------------------
00613
00614 SCODE STDMETHODCALLTYPE HtmlPropIFilter::GetText(
00615     ULONG * pcwcBuffer,
00616     WCHAR * awcBuffer )
00617 {
00618     return _pHtmlFilter->GetText( pcwcBuffer, awcBuffer );
00619 } //GetText
00620
00621 //+-------------------------------------------------------------------------
00622 //
00623 //  Method:     HtmlPropIFilter::BindRegion
00624 //
00625 //--------------------------------------------------------------------------
00626
00627 SCODE STDMETHODCALLTYPE HtmlPropIFilter::BindRegion(
00628     FILTERREGION origPos,
00629     REFIID       riid,
00630     void **      ppunk )
00631 {
00632     return _pHtmlFilter->BindRegion( origPos, riid, ppunk );
00633 } //BindRegion
00634
00635 //+-------------------------------------------------------------------------
00636 //
00637 //  Method:     HtmlPropIFilter::GetClassID
00638 //
00639 //--------------------------------------------------------------------------
00640
00641 SCODE STDMETHODCALLTYPE HtmlPropIFilter::GetClassID( CLSID * pClassID )
00642 {
00643     *pClassID = CLSID_HtmlPropIFilter;
00644     return S_OK;
00645 } //GetClassID
00646
00647 //+-------------------------------------------------------------------------
00648 //
00649 //  Method:     HtmlPropIFilter::IsDirty
00650 //
00651 //--------------------------------------------------------------------------
00652
00653 SCODE STDMETHODCALLTYPE HtmlPropIFilter::IsDirty()
00654 {
00655     return S_FALSE;
00656 } //IsDirty
00657
00658 //+-------------------------------------------------------------------------
00659 //
00660 //  Method:     HtmlPropIFilter::Load
00661 //
00662 //  Synopsis:   Loads the file for the filter
00663 //
00664 //  Arguments:  [pszFileName] -- Name of the file
00665 //              [dwMode]      -- Mode of the load
00666 //
00667 //--------------------------------------------------------------------------
00668
00669 SCODE STDMETHODCALLTYPE HtmlPropIFilter::Load(
00670     LPCWSTR pszFileName,
00671     DWORD   dwMode)
00672 {
00673     //
00674     // Get html filter class object and class factory
00675     //
00676
00677     IClassFactory * pcf = 0;
00678     SCODE sc = E_FAIL;
00679
00680     if ( 0 != g_hHtmlDll )
00681     {
00682         LPFNGETCLASSOBJECT pfn = (LPFNGETCLASSOBJECT)GetProcAddress(
00683                                  g_hHtmlDll,
00684                                  "DllGetClassObject" );
00685
00686         if ( 0 != pfn )
00687             sc = (pfn)( CLSID_HtmlIFilter, IID_IClassFactory, (void **)&pcf );
00688     }
00689
00690     if ( SUCCEEDED(sc) && ( 0 != pcf ) )
00691     {
00692         // Get an html filter
00693
00694         sc = pcf->CreateInstance( 0, IID_IFilter, (void **)&_pHtmlFilter );
00695         pcf->Release();
00696
00697         if ( SUCCEEDED(sc) )
00698         {
00699             // Load the file
00700
00701             sc = _pHtmlFilter->QueryInterface( IID_IPersistFile,
00702                                                (void **) &_pPersistFile );
00703
00704             if ( SUCCEEDED(sc) )
00705             {
00706                 sc = _pPersistFile->Load( pszFileName, dwMode );
00707             }
00708             else
00709             {
00710                 _pHtmlFilter->Release();
00711                 _pHtmlFilter = 0;
00712             }
00713         }
00714     }
00715
00716     return sc;
00717 } //Load
00718
00719 //+-------------------------------------------------------------------------
00720 //
00721 //  Method:     HtmlPropIFilter::Save
00722 //
00723 //--------------------------------------------------------------------------
00724
00725 SCODE STDMETHODCALLTYPE HtmlPropIFilter::Save(
00726     LPCWSTR pszFileName,
00727     BOOL    fRemember )
00728 {
00729     return E_FAIL;
00730 } //Save
00731
00732 //+-------------------------------------------------------------------------
00733 //
00734 //  Method:     HtmlPropIFilter::SaveCompleted
00735 //
00736 //--------------------------------------------------------------------------
00737
00738 SCODE STDMETHODCALLTYPE HtmlPropIFilter::SaveCompleted(
00739     LPCWSTR pszFileName )
00740 {
00741     return E_FAIL;
00742 } //SaveCompleted
00743
00744 //+-------------------------------------------------------------------------
00745 //
00746 //  Method:     HtmlPropIFilter::GetcurFile
00747 //
00748 //--------------------------------------------------------------------------
00749
00750 SCODE STDMETHODCALLTYPE HtmlPropIFilter::GetCurFile(
00751     LPWSTR * ppszFileName )
00752 {
00753     return _pPersistFile->GetCurFile( ppszFileName );
00754 } //GetCurFile
00755
00756 //+-------------------------------------------------------------------------
00757 //
00758 //  Function:   ParsePropertyFile
00759 //
00760 //  Synopsis:   Parses a property file and stores datatypes for html meta
00761 //              properties.  Property files are in .idq format, with a
00762 //              [Names] section.
00763 //
00764 //--------------------------------------------------------------------------
00765
00766 void ParsePropertyFile()
00767 {
00768     // already parsed the file?
00769
00770     if ( g_cEntries > 0 )
00771         return;
00772
00773     // open the property file in the system32 directory
00774
00775     WCHAR awcFile[ MAX_PATH ];
00776     GetSystemDirectory( awcFile, sizeof awcFile / sizeof WCHAR );
00777
00778     wcscat( awcFile, L"\\" );
00779     wcscat( awcFile, pwcHTMLPropertyFile );
00780
00781     FILE *file = _wfopen( awcFile, L"r" );
00782
00783     if ( 0 != file )
00784     {
00785         WCHAR awc[ 500 ];
00786         BOOL fNames = FALSE;
00787
00788         // for each line of the file
00789
00790         while ( fgetws( awc, sizeof awc / sizeof awc[0], file ) )
00791         {
00792             int cwc = (int)wcslen( awc );
00793             if ( 0 == cwc )
00794                 continue;
00795
00796             // trim off trailing newline
00797
00798             if ( awc[ cwc - 1 ] == '\n' )
00799             {
00800                 cwc--;
00801                 awc[cwc] = 0;
00802             }
00803
00804             // is this a section line?
00805
00806             if ( '[' == awc[0] )
00807             {
00808                 fNames = !_wcsicmp( L"[names]", awc );
00809             }
00810             else if ( ( '#' != awc[0] ) && fNames )
00811             {
00812                 // parse the data type
00813
00814                 WCHAR *pwcType = wcschr( awc, L'(' );
00815
00816                 if ( 0 != pwcType )
00817                 {
00818                     pwcType++;
00819                     while ( ' ' == *pwcType )
00820                         pwcType++;
00821
00822                     WCHAR *pwcX = wcstok( pwcType, L", )" );
00823
00824                     if ( 0 != pwcType )
00825                     {
00826                         // lookup the type in the list of types
00827
00828                         for ( ULONG i = 0; i < cTypeEntries; i++ )
00829                         {
00830                             if ( !_wcsicmp( aTypeEntries[i].awcName,
00831                                             pwcType ) )
00832                                 break;
00833                         }
00834
00835                         // got the type, so find the guid
00836
00837                         if ( i < cTypeEntries )
00838                         {
00839                             // find the property guid
00840
00841                             pwcType += 1 + wcslen( pwcType );
00842
00843                             WCHAR *pwcName = wcschr( pwcType, '=' );
00844
00845                             if ( pwcName )
00846                             {
00847                                 pwcName++;
00848                                 while ( ' ' == *pwcName )
00849                                     pwcName++;
00850
00851                                 // is this the html guid?
00852
00853                                 if ( !_wcsnicmp( pwcName,
00854                                                  pwcMetaProperty,
00855                                                  wcslen( pwcMetaProperty ) ) )
00856                                 {
00857                                     // find the property name
00858
00859                                     pwcName = wcschr( pwcName, ' ' );
00860                                     if ( pwcName )
00861                                     {
00862                                         // skip white space
00863
00864                                         while ( ' ' == *pwcName )
00865                                             pwcName++;
00866
00867                                         // got it -- save it away if it fits
00868
00869                                         if ( ( wcslen( pwcName ) < cwcMaxName ) &&
00870                                              ( g_cEntries < maxEntries ) )
00871                                         {
00872                                             wcscpy( g_aEntries[g_cEntries].awcName,
00873                                                     pwcName );
00874                                             g_aEntries[g_cEntries++].dbType =
00875                                                 aTypeEntries[i].dbType;
00876                                         }
00877                                     }
00878                                 }
00879                             }
00880                         }
00881                     }
00882                 }
00883             }
00884         }
00885
00886         fclose( file );
00887     }
00888 } //ParsePropertyFile
00889
00890 //+-------------------------------------------------------------------------
00891 //
00892 //  Method:     HtmlPropIFilterCF::HtmlPropIFilterCF
00893 //
00894 //  Synopsis:   HTML Property IFilter class factory constructor
00895 //
00896 //--------------------------------------------------------------------------
00897
00898 HtmlPropIFilterCF::HtmlPropIFilterCF()
00899 {
00900     _lRefs = 1;
00901
00902     long c = InterlockedIncrement( &g_cInstances );
00903
00904     if ( 0 == g_hHtmlDll && 1 == c )
00905     {
00906         // load the html filter dll
00907
00908         g_hHtmlDll = LoadLibrary( pwcHTMLFilter );
00909
00910         // load the property information
00911
00912         ParsePropertyFile();
00913     }
00914 } //HtmlPropIFilterCF
00915
00916 //+-------------------------------------------------------------------------
00917 //
00918 //  Method:     HtmlPropIFilterCF::~HtmlPropIFilterCF
00919 //
00920 //  Synopsis:   HTML IFilter class factory constructor
00921 //
00922 //--------------------------------------------------------------------------
00923
00924 HtmlPropIFilterCF::~HtmlPropIFilterCF()
00925 {
00926     long c = InterlockedDecrement( &g_cInstances );
00927
00928     if ( 0 != g_hHtmlDll && 0 == c )
00929     {
00930         FreeLibrary( g_hHtmlDll );
00931         g_hHtmlDll = 0;
00932     }
00933 } //~HtmlPropIFilterCF
00934
00935 //+-------------------------------------------------------------------------
00936 //
00937 //  Method:     HtmlPropIFilterCF::QueryInterface
00938 //
00939 //  Synopsis:   Rebind to other interface
00940 //
00941 //  Arguments:  [riid]      -- IID of new interface
00942 //              [ppvObject] -- New interface * returned here
00943 //
00944 //  Returns:    S_OK if bind succeeded, E_NOINTERFACE if bind failed
00945 //
00946 //--------------------------------------------------------------------------
00947
00948 SCODE STDMETHODCALLTYPE HtmlPropIFilterCF::QueryInterface(
00949     REFIID   riid,
00950     void  ** ppvObject )
00951 {
00952     if ( IID_IClassFactory == riid )
00953         *ppvObject = (IUnknown *) (IClassFactory *) this;
00954     else if ( IID_IUnknown == riid )
00955         *ppvObject = (IUnknown *) (IPersist *) this;
00956     else
00957     {
00958         *ppvObject = 0;
00959         return E_NOINTERFACE;
00960     }
00961
00962     AddRef();
00963     return S_OK;
00964 } //QueryInterface
00965
00966 //+-------------------------------------------------------------------------
00967 //
00968 //  Method:     HtmlPropIFilterCF::AddRef
00969 //
00970 //  Synopsis:   Increments refcount
00971 //
00972 //--------------------------------------------------------------------------
00973
00974 ULONG STDMETHODCALLTYPE HtmlPropIFilterCF::AddRef()
00975 {
00976     return InterlockedIncrement( &_lRefs );
00977 } //AddRef
00978
00979 //+-------------------------------------------------------------------------
00980 //
00981 //  Method:     HtmlPropIFilterCF::Release
00982 //
00983 //  Synopsis:   Decrement refcount.  Delete if necessary.
00984 //
00985 //--------------------------------------------------------------------------
00986
00987 ULONG STDMETHODCALLTYPE HtmlPropIFilterCF::Release()
00988 {
00989     long lTmp = InterlockedDecrement( &_lRefs );
00990
00991     if ( 0 == lTmp )
00992         delete this;
00993
00994     return lTmp;
00995 } //Release
00996
00997 //+-------------------------------------------------------------------------
00998 //
00999 //  Method:     HtmlPropIFilterCF::CreateInstance
01000 //
01001 //  Synopsis:   Creates new HtmlPropIFilter object
01002 //
01003 //  Arguments:  [pUnkOuter] -- 'Outer' IUnknown
01004 //              [riid]      -- Interface to bind
01005 //              [ppvObject] -- Interface returned here
01006 //
01007 //--------------------------------------------------------------------------
01008
01009 SCODE STDMETHODCALLTYPE HtmlPropIFilterCF::CreateInstance(
01010     IUnknown * pUnkOuter,
01011     REFIID     riid,
01012     void * *   ppvObject )
01013 {
01014     *ppvObject = 0;
01015
01016     HtmlPropIFilter * pFilter = new HtmlPropIFilter;
01017
01018     if ( 0 == pFilter )
01019         return E_OUTOFMEMORY;
01020
01021     SCODE sc = pFilter->QueryInterface( riid , ppvObject );
01022
01023     pFilter->Release();
01024
01025     return sc;
01026 } //CreateInstance
01027
01028 //+-------------------------------------------------------------------------
01029 //
01030 //  Method:     HtmlPropIFilterCF::LockServer
01031 //
01032 //  Synopsis:   Force class factory to remain loaded
01033 //
01034 //  Arguments:  [fLock] -- TRUE if locking, FALSE if unlocking
01035 //
01036 //  Returns:    S_OK
01037 //
01038 //--------------------------------------------------------------------------
01039
01040 SCODE STDMETHODCALLTYPE HtmlPropIFilterCF::LockServer(BOOL fLock)
01041 {
01042     if(fLock)
01043         InterlockedIncrement( &g_cInstances );
01044     else
01045         InterlockedDecrement( &g_cInstances );
01046
01047     return S_OK;
01048 } //LockServer
01049
01050 //+-------------------------------------------------------------------------
01051 //
01052 //  Function:   DllGetClassObject
01053 //
01054 //  Synopsis:   Ole DLL load class routine
01055 //
01056 //  Arguments:  [cid]    -- Class to load
01057 //              [iid]    -- Interface to bind to on class object
01058 //              [ppvObj] -- Interface pointer returned here
01059 //
01060 //  Returns:    HTML Property filter class factory
01061 //
01062 //--------------------------------------------------------------------------
01063
01064 extern "C" SCODE STDMETHODCALLTYPE DllGetClassObject(
01065     REFCLSID cid,
01066     REFIID   iid,
01067     void **  ppvObj )
01068 {
01069     IUnknown * pUnk = 0;
01070
01071     if ( CLSID_HtmlPropIFilter == cid ||
01072          CLSID_HtmlPropClass   == cid )
01073     {
01074         pUnk = new HtmlPropIFilterCF;
01075
01076         if ( 0 == pUnk )
01077             return E_OUTOFMEMORY;
01078     }
01079     else
01080     {
01081         *ppvObj = 0;
01082         return E_NOINTERFACE;
01083     }
01084
01085     SCODE sc = pUnk->QueryInterface( iid, ppvObj );
01086
01087     pUnk->Release();
01088
01089     return sc;
01090 } //DllGetClassObject
01091
01092 //+-------------------------------------------------------------------------
01093 //
01094 //  Method:     DllCanUnloadNow
01095 //
01096 //  Synopsis:   Notifies DLL to unload (cleanup global resources)
01097 //
01098 //  Returns:    S_OK if it is acceptable for caller to unload DLL.
01099 //
01100 //--------------------------------------------------------------------------
01101
01102 extern "C" SCODE STDMETHODCALLTYPE DllCanUnloadNow( void )
01103 {
01104     if ( 0 == g_cInstances )
01105         return S_OK;
01106     else
01107         return S_FALSE;
01108 } //DllCanUnloadNow
01109
01110 SClassEntry const aHtmlPropClasses[] =
01111 {
01112     { L".hhc",  L"hhcfile",       L"HHC file",      L"{7f73b8f6-c19c-11d0-aa66-00c04fc2eddc}", L"HHC file" },
01113     { L".htm",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
01114     { L".html", L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
01115     { L".htx",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
01116     { L".stm",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
01117     { L".htw",  L"htmlfile",      L"HTML file",     L"{25336920-03f9-11cf-8fd0-00aa00686f13}", L"HTML file" },
01118     { L".asp",  L"asp_auto_file", L"ASP auto file", L"{bd70c020-2d24-11d0-9110-00004c752752}", L"ASP auto file" },
01119 };
01120
01121 SHandlerEntry const HtmlPropHandler =
01122 {
01123     L"{c694d910-a439-11d1-a903-00e098006ed3}",
01124     L"html property persistent handler",
01125     L"{f4309e80-a1db-11d1-a8fb-00e098006ed3}",
01126 };
01127
01128 SFilterEntry const HtmlPropFilter =
01129 {
01130     L"{f4309e80-a1db-11d1-a8fb-00e098006ed3}",
01131     L"html property filter",
01132     L"HtmlProp.dll",
01133     L"Both"
01134 };
01135
01136 DEFINE_DLLREGISTERFILTER( HtmlPropHandler, HtmlPropFilter, aHtmlPropClasses )
01137
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/_Parameter.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

_Parameter.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface _Parameter
00019 /** @com.interface(iid=0000050C-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface _Parameter extends msado15._ADO
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1610809344, type=PROPGET, name="Name", name2="getName", addFlagsVtable=4)
00027       @com.parameters([type=STRING] return) */
00028   public String getName();
00029
00030   /** @com.method(vtoffset=6, dispid=1610809344, type=PROPPUT, name="Name", name2="putName", addFlagsVtable=4)
00031       @com.parameters([in,type=STRING] pbstr) */
00032   public void setName(String pbstr);
00033
00034   /** @com.method(vtoffset=7, dispid=0, type=PROPGET, name="Value", name2="getValue", addFlagsVtable=4)
00035       @com.parameters([type=VARIANT] return) */
00036   public Variant getValue();
00037
00038   /** @com.method(vtoffset=8, dispid=0, type=PROPPUT, name="Value", name2="putValue", addFlagsVtable=4)
00039       @com.parameters([in,type=VARIANT] pvar) */
00040   public void setValue(Variant pvar);
00041
00042   /** @com.method(vtoffset=9, dispid=1610809348, type=PROPGET, name="Type", name2="getType", addFlagsVtable=4)
00043       @com.parameters([type=I4] return) */
00044   public int getType();
00045
00046   /** @com.method(vtoffset=10, dispid=1610809348, type=PROPPUT, name="Type", name2="putType", addFlagsVtable=4)
00047       @com.parameters([in,type=I4] psDataType) */
00048   public void setType(int psDataType);
00049
00050   /** @com.method(vtoffset=11, dispid=1610809350, type=PROPPUT, name="Direction", name2="putDirection", addFlagsVtable=4)
00051       @com.parameters([in,type=I4] plParmDirection) */
00052   public void setDirection(int plParmDirection);
00053
00054   /** @com.method(vtoffset=12, dispid=1610809350, type=PROPGET, name="Direction", name2="getDirection", addFlagsVtable=4)
00055       @com.parameters([type=I4] return) */
00056   public int getDirection();
00057
00058   /** @com.method(vtoffset=13, dispid=1610809352, type=PROPPUT, name="Precision", name2="putPrecision", addFlagsVtable=4)
00059       @com.parameters([in,type=U1] pbPrecision) */
00060   public void setPrecision(byte pbPrecision);
00061
00062   /** @com.method(vtoffset=14, dispid=1610809352, type=PROPGET, name="Precision", name2="getPrecision", addFlagsVtable=4)
00063       @com.parameters([type=U1] return) */
00064   public byte getPrecision();
00065
00066   /** @com.method(vtoffset=15, dispid=1610809354, type=PROPPUT, name="NumericScale", name2="putNumericScale", addFlagsVtable=4)
00067       @com.parameters([in,type=U1] pbScale) */
00068   public void setNumericScale(byte pbScale);
00069
00070   /** @com.method(vtoffset=16, dispid=1610809354, type=PROPGET, name="NumericScale", name2="getNumericScale", addFlagsVtable=4)
00071       @com.parameters([type=U1] return) */
00072   public byte getNumericScale();
00073
00074   /** @com.method(vtoffset=17, dispid=1610809356, type=PROPPUT, name="Size", name2="putSize", addFlagsVtable=4)
00075       @com.parameters([in,type=I4] pl) */
00076   public void setSize(int pl);
00077
00078   /** @com.method(vtoffset=18, dispid=1610809356, type=PROPGET, name="Size", name2="getSize", addFlagsVtable=4)
00079       @com.parameters([type=I4] return) */
00080   public int getSize();
00081
00082   /** @com.method(vtoffset=19, dispid=1610809358, type=METHOD, name="AppendChunk", addFlagsVtable=4)
00083       @com.parameters([in,type=VARIANT] Val) */
00084   public void AppendChunk(Variant Val);
00085
00086   /** @com.method(vtoffset=20, dispid=1610809359, type=PROPGET, name="Attributes", name2="getAttributes", addFlagsVtable=4)
00087       @com.parameters([type=I4] return) */
00088   public int getAttributes();
00089
00090   /** @com.method(vtoffset=21, dispid=1610809359, type=PROPPUT, name="Attributes", name2="putAttributes", addFlagsVtable=4)
00091       @com.parameters([in,type=I4] plParmAttribs) */
00092   public void setAttributes(int plParmAttribs);
00093
00094
00095   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x50c, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00096 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/CStorageResource.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

CStorageResource.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      CStorageResource.h
00005 //
00006 //  Implementation Files:
00007 //      CStorageResource.cpp
00008 //
00009 //  Description:
00010 //      Header file for the CStorageResource class
00011 //
00012 //////////////////////////////////////////////////////////////////////////////
00013
00014 #pragma once
00015
00016 //////////////////////////////////////////////////////////////////////////////
00017 // Include Files
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020 #include "stdafx.h"
00021
00022 //
00023 // Definition of the ClusCfg Managed Resource Type that this Resource belongs to
00024 //
00025
00026 #include "CStorageResType.h"
00027 #include "CMgdClusCfgInit.h"
00028
00029 //////////////////////////////////////////////////////////////////////////////
00030 // Behavior Define's
00031 //////////////////////////////////////////////////////////////////////////////
00032
00033 //
00034 // Available dependency modes are:
00035 // - dfEXCLUSIVE
00036 // - dfSHARED
00037 //
00038
00039 #define MYRES_DEPENDENCY_MODE dfSHARED
00040
00041
00042 //////////////////////////////////////////////////////////////////////////////
00043 //++
00044 //
00045 //  class CStorageResource
00046 //
00047 //  Description:
00048 //      The CStorageResource class is an implementation of the
00049 //      IClusCfgManagedResourceInfo and IClusCfgManagedResourceCfg interfaces.
00050 //
00051 //  Note:
00052 //      Although this sample does not contain a quorum capable resource, the
00053 //      IClusCfgVerifyQuorum interface is implemented for demonstration
00054 //
00055 //  Note 2:
00056 //      Although this sample does not include any resource private data, the
00057 //      IClusCfgManagedResourceData interface is implemented for demonstration
00058 //
00059 //--
00060 //////////////////////////////////////////////////////////////////////////////
00061 class CStorageResource
00062     : public IClusCfgManagedResourceCfg
00063     , public IClusCfgManagedResourceInfo
00064     , public IClusCfgVerifyQuorum
00065     , public IClusCfgManagedResourceData
00066     , public IEnumClusCfgPartitions
00067     , public IWMIServices
00068     , public IWMIObject
00069     , public IStorageProperties
00070     , public CMgdClusCfgInit
00071     , public CComCoClass< CStorageResource, &CLSID_CStorageResource >
00072 {
00073 public:
00074     CStorageResource( void );
00075     virtual ~CStorageResource( void );
00076
00077 BEGIN_COM_MAP( CStorageResource )
00078     COM_INTERFACE_ENTRY( IClusCfgManagedResourceInfo )
00079     COM_INTERFACE_ENTRY( IClusCfgInitialize )
00080     COM_INTERFACE_ENTRY( IClusCfgManagedResourceCfg )
00081     COM_INTERFACE_ENTRY( IClusCfgVerifyQuorum )
00082     COM_INTERFACE_ENTRY( IClusCfgManagedResourceData )
00083     COM_INTERFACE_ENTRY( IEnumClusCfgPartitions )
00084     COM_INTERFACE_ENTRY( IWMIServices )
00085     COM_INTERFACE_ENTRY( IWMIObject )
00086     COM_INTERFACE_ENTRY( IStorageProperties )
00087 END_COM_MAP()
00088
00089 DECLARE_NOT_AGGREGATABLE( CStorageResource )
00090
00091 #pragma warning( push, 3 )
00092 #pragma warning( disable : 4995 ) // warning C4995: '<x>': name was marked as #pragma deprecated
00093 DECLARE_REGISTRY_RESOURCEID( IDR_CStorageResource )
00094 #pragma warning( pop )
00095
00096     //
00097     // IClusCfgManagedResourceInfo interface
00098     //
00099
00100     STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
00101     STDMETHOD( GetName )( BSTR * pbstrNameOut );
00102     STDMETHOD( SetName )( LPCWSTR pwszNameIn );
00103     STDMETHOD( IsManaged )( void );
00104     STDMETHOD( SetManaged )( BOOL fIsManagedIn );
00105     STDMETHOD( IsQuorumResource )( void );
00106     STDMETHOD( SetQuorumResource )( BOOL fIsQuorumDeviceIn );
00107     STDMETHOD( IsQuorumCapable )( void );
00108     STDMETHOD( SetQuorumCapable )( BOOL fIsQuorumCapableIn );
00109     STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterMappingsOut );
00110     STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappingsIn );
00111     STDMETHOD( IsManagedByDefault )( void );
00112     STDMETHOD( SetManagedByDefault )( BOOL fIsManagedByDefaultIn );
00113
00114     //
00115     // IClusCfgManagedResourceCfg interface
00116     //
00117
00118     STDMETHOD( PreCreate )( IUnknown * punkServicesIn );
00119     STDMETHOD( Create )( IUnknown * punkServicesIn );
00120     STDMETHOD( PostCreate )( IUnknown * punkServicesIn );
00121     STDMETHOD( Evict )( IUnknown * punkServicesIn );
00122
00123     //
00124     // IClusCfgVerifyQuorum interface
00125     //
00126
00127     STDMETHOD( IsMultiNodeCapable )( void );
00128     STDMETHOD( SetMultiNodeCapable )( BOOL fMultiNodeCapableIn );
00129     STDMETHOD( PrepareToHostQuorumResource )( void );
00130     STDMETHOD( Cleanup )( EClusCfgCleanupReason cccrReasonIn );
00131
00132     //
00133     // IClusCfgManagedResourceData interface
00134     //
00135
00136     STDMETHOD( GetResourcePrivateData )( BYTE * pbBufferOut, DWORD * pcbBufferInout );
00137     STDMETHOD( SetResourcePrivateData )( const BYTE * pcbBufferIn, DWORD cbBufferIn );
00138
00139     //
00140     // IWMIServices Interface
00141     //
00142
00143     STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
00144
00145     //
00146     // IWMIObject Interface
00147     //
00148
00149     STDMETHOD( SetWbemObject )( IWbemClassObject * pDiskIn, BOOL * pfRetainObjectOut );
00150
00151     //
00152     // IEnumClusCfgPartitions Interface
00153     //
00154
00155     STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgPartitionInfo ** rgpPartitionInfoOut, ULONG * pcNumberFetchedOut );
00156     STDMETHOD( Skip )( ULONG cNumberToSkipIn );
00157     STDMETHOD( Reset )( void );
00158     STDMETHOD( Clone )( IEnumClusCfgPartitions ** ppEnumClusCfgPartitionsOut );
00159     STDMETHOD( Count )( DWORD * pnCountOut );
00160
00161     //
00162     // IStorageProperties Interface
00163     //
00164
00165     STDMETHOD( IsThisLogicalDisk )( WCHAR cLogicalDiskIn );
00166     STDMETHOD( HrGetSCSIBus )( ULONG * pulSCSIBusOut );
00167     STDMETHOD( HrGetSCSIPort )( ULONG * pulSCSIPortOut );
00168     STDMETHOD( CanBeManaged )( void );
00169     STDMETHOD( HrGetDeviceID )( BSTR * pbstrDeviceIDOut );
00170     STDMETHOD( HrGetSignature )( DWORD * pdwSignatureOut );
00171     STDMETHOD( HrSetFriendlyName )( LPCWSTR pcszFriendlyNameIn );
00172     STDMETHOD( HrGetDeviceIndex )( DWORD * pidxDeviceOut );
00173     STDMETHOD( HrIsDynamicDisk )( void );
00174     STDMETHOD( HrIsGPTDisk )( void );
00175     STDMETHOD( HrGetDiskNames )( BSTR * pbstrDiskNameOut, BSTR * pbstrDeviceNameOut );
00176
00177 private:
00178
00179     BSTR                m_bstrName;
00180     BSTR                m_bstrDescription;
00181     BSTR                m_bstrFriendlyName;
00182     BSTR                m_bstrDeviceID;
00183
00184     BOOL                m_fIsQuorumCapable;
00185     BOOL                m_fIsQuorumResource;
00186     BOOL                m_fIsMultiNodeCapable;
00187     BOOL                m_fIsManaged;
00188     BOOL                m_fIsManagedByDefault;
00189     BOOL                m_fIsDynamicDisk;
00190     BOOL                m_fIsGPTDisk;
00191
00192     ULONG               m_ulSCSIBus;
00193     ULONG               m_ulSCSITid;
00194     ULONG               m_ulSCSIPort;
00195     ULONG               m_ulSCSILun;
00196
00197     DWORD               m_idxDevice;
00198     DWORD               m_idxNextPartition;
00199     DWORD               m_idxEnumPartitionNext;
00200     DWORD               m_cPartitions;
00201     DWORD               m_dwSignature;
00202
00203     IWbemServices *     m_pIWbemServices;
00204     IUnknown *          ((*m_prgPartitions)[]);
00205
00206     //
00207     // Private copy constructor to avoid copying.
00208     //
00209
00210     CStorageResource( const CStorageResource & rSrcIn );
00211
00212     //
00213     // Private assignment operator to avoid copying.
00214     //
00215
00216     const CStorageResource & operator = ( const CStorageResource & rSrcIn );
00217
00218     //
00219     // Helper functions.
00220     //
00221
00222     HRESULT HrGetPartitionInfo( IWbemClassObject * pDiskIn, BOOL * pfRetainObjectOut );
00223     HRESULT HrCreatePartitionInfo( IWbemClassObject * pPartitionIn );
00224     HRESULT HrAddPartitionToArray( IUnknown * punkIn );
00225     HRESULT HrCreateFriendlyName( void );
00226     HRESULT HrCreateFriendlyName( BSTR bstrNameIn );
00227     HRESULT HrIsPartitionGPT( IWbemClassObject * pPartitionIn );
00228     HRESULT HrIsPartitionLDM( IWbemClassObject * pPartitionIn );
00229     HRESULT HrIsClusterCapable( void );
00230
00231 }; //*** class CStorageResource
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRowsetViewerDlg Member List

This is the complete list of members for CRowsetViewerDlg, including all inherited members.
CRowsetViewerDlg(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CRowsetViewerDlg |
GetOptions() | CRowsetViewerDlg | [virtual]
m_pCMainWindow | CRowsetViewerDlg |
m_pCMDIChild | CRowsetViewerDlg |
Generated on Wed Nov 13 2024 16:57:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/globals.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

globals.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "BaseNode.h"
00016
00017 //---------------------------------------------------------------------------
00018 // MMC's requiered clipboard formats
00019
00020 UINT g_cfDisplayName = 0;      // DisplayName for our SnapIn node
00021 UINT g_cfNodeType    = 0;      // GUID of the selected node
00022 UINT g_cfszNodeType  = 0;      // String representation of namespace GUID
00023 UINT g_cfSnapinClsid = 0;      // Class ID of this SnapIn
00024
00025 //---------------------------------------------------------------------------
00026 //  Custom clipboard formats
00027
00028 UINT g_cfBaseNodePtr = 0;
00029 UINT g_cfDataObjPtr  = 0;
00030
00031 //---------------------------------------------------------------------------
00032 //  XPROPPAGE:  Clipboard format for PropertyPage extension
00033
00034 UINT g_cfNodeAttrPtr = 0;
00035
00036 // Global variables
00037
00038 HINSTANCE g_hInst = NULL;      // Our global instance handle
00039 ULONG g_uObjectCount = 0;      // Global object count
00040 ULONG g_uServerLocks = 0;      // Global lock count
00041
00042
00043 //---------------------------------------------------------------------------
00044 //  This is the fast, simple way to convert unicode to ansi.  It does NOT
00045 //  handle multibyte ansi strings and is not localized.  But it should be
00046 //  fine for registry entries
00047 //  NOTE:  The caller is responsible for freeing the memory.
00048 //
00049 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide )
00050 {
00051   LONG nLen = wcslen( szWide ) +1;
00052   *pszAnsi = (char*)CoTaskMemAlloc( nLen );
00053   char* pCounter = *pszAnsi;
00054
00055   while( *szWide )
00056   {
00057     *pCounter = LOBYTE(*szWide);
00058     pCounter++;
00059     szWide++;
00060   }
00061   *pCounter = NULL;
00062 }
00063
00064 //---------------------------------------------------------------------------
00065 //  copies a string ( like strncpy )
00066 //  in non-unicode version coverts ansi-to-unicode first.
00067 //
00068 void _fastcall CopyT2W( LPWSTR strDest, LPCTSTR strSource, size_t count)
00069 {
00070 #ifndef _UNICODE
00071
00072   MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, strSource, -1, strDest, count );
00073
00074 #else
00075
00076   wcsncpy( strDest, strSource, count );
00077
00078 #endif
00079
00080   if ( count > 0 )
00081     strDest[ count - 1 ] = 0;
00082 }
00083
00084
00085 //---------------------------------------------------------------------------
00086 //
00087 void InitClipboardFormats()
00088 {
00089   g_cfDisplayName  = RegisterClipboardFormat( T_CCF_DISPLAY_NAME );
00090   g_cfNodeType     = RegisterClipboardFormat( T_CCF_NODETYPE );
00091   g_cfszNodeType   = RegisterClipboardFormat( T_CCF_SZNODETYPE );
00092   g_cfSnapinClsid  = RegisterClipboardFormat( T_CCF_SNAPIN_CLASSID );
00093
00094   g_cfBaseNodePtr  = RegisterClipboardFormat( T_CCF_BASENODE_PTR );
00095   g_cfDataObjPtr   = RegisterClipboardFormat( T_CCF_DATAOBJ_PTR );
00096
00097   //XPROPPAGE:  Register the clipformat
00098   g_cfNodeAttrPtr  = RegisterClipboardFormat( T_CCF_ATTRIB_PTR );
00099
00100 }
00101
00102 //---------------------------------------------------------------------------
00103 //  Extracts data based on the passed-in clipboard format
00104 //
00105 HRESULT ExtractFromDataObject
00106 (
00107   LPDATAOBJECT ipDataObject,   // [in]  Points to data object
00108   UINT         cfClipFormat,   // [in]  Clipboard format to use
00109   ULONG        nByteCount,     // [in]  Number of bytes to allocate
00110   HGLOBAL      *phGlobal       // [out] Points to the data we want
00111 )
00112 {
00113   _ASSERT( NULL != ipDataObject );
00114
00115             *phGlobal = NULL;
00116   HRESULT   hResult   = S_FALSE;
00117   STGMEDIUM StgMedium = { TYMED_HGLOBAL,  NULL  };
00118   FORMATETC FormatEtc = { cfClipFormat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00119
00120   do
00121   {
00122     // Allocate memory for the stream
00123     StgMedium.hGlobal = ::GlobalAlloc( GMEM_SHARE, nByteCount );
00124
00125     if( NULL == StgMedium.hGlobal )
00126     {
00127       hResult = E_OUTOFMEMORY;
00128       break;
00129     }
00130
00131     // Attempt to get data from the object
00132     hResult = ipDataObject->GetDataHere( &FormatEtc, &StgMedium );
00133     if( FAILED(hResult) )
00134     {
00135       break;
00136     }
00137     // StgMedium now has the data we need
00138     *phGlobal = StgMedium.hGlobal;
00139     StgMedium.hGlobal = NULL;
00140
00141   } while (0);
00142
00143   if( FAILED(hResult) && StgMedium.hGlobal )
00144   {
00145     HGLOBAL hRetVal = ::GlobalFree(StgMedium.hGlobal);
00146     _ASSERT( NULL == hRetVal );         // Must return NULL
00147   }
00148   return hResult;
00149
00150 }
00151
00152
00153 //---------------------------------------------------------------------------
00154 //  This helper returns the current BaseNode object on the custom
00155 //  g_cfBaseNodePtr clipboard format
00156 //
00157 CBaseNode* ExtractBaseNodePtr
00158 (
00159   LPDATAOBJECT ipDataObject      // [in] IComponent pointer
00160 )
00161 {
00162   LPBASENODE  pNode   = NULL;
00163   HGLOBAL     hGlobal = NULL;
00164   HRESULT     hResult = S_FALSE;
00165
00166   hResult = ExtractFromDataObject( ipDataObject,
00167                                    g_cfBaseNodePtr,
00168                                    sizeof(LPBASENODE),
00169                                    &hGlobal
00170                                  );
00171   if( SUCCEEDED(hResult) )
00172   {
00173     pNode = *(LPBASENODE*)(hGlobal);
00174     HGLOBAL hRetVal = GlobalFree(hGlobal);
00175     _ASSERT( NULL == hRetVal );        // Must return NULL
00176   }
00177
00178   return pNode;
00179
00180 }
00181
00182 //---------------------------------------------------------------------------
00183 //  Converts an IDataObject pointer to a CDataObject pointer by
00184 //  retrieving a "this" pointer using a custom clipboard format.
00185 //
00186 CDataObject* ExtractDataObjPtr
00187 (
00188   LPDATAOBJECT ipDataObject      //[in] IDataObject pointer
00189 )
00190 {
00191   _ASSERT( 0 != g_cfDataObjPtr );
00192
00193   HGLOBAL      hGlobal = NULL;
00194   HRESULT      hResult = S_OK;
00195   CDataObject* pDO     = NULL;
00196
00197   hResult = ExtractFromDataObject( ipDataObject,
00198                                    g_cfDataObjPtr,
00199                                    sizeof(CDataObject **),
00200                                    &hGlobal
00201                                  );
00202
00203   if( SUCCEEDED(hResult) )
00204   {
00205     pDO = *(CDataObject **)(hGlobal);
00206     _ASSERT( NULL != pDO );
00207
00208     HGLOBAL hRetVal = GlobalFree(hGlobal);
00209     _ASSERT( NULL == hRetVal );       // Must return NULL
00210   }
00211
00212   return pDO;
00213
00214 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/ClipBook ServerEx.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

ClipBook ServerEx.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ClipBook ServerEx.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the CClipBookServerApp class and DLL initialization
00010 //      routines.
00011 //
00012 //  Author:
00013 //      <name> (<e-mail name>) Mmmm DD, 2003
00014 //
00015 //  Revision History:
00016 //
00017 //  Notes:
00018 //
00019 /////////////////////////////////////////////////////////////////////////////
00020
00021 #include "stdafx.h"
00022
00023 #pragma warning( push )
00024 #include <initguid.h>
00025 #include <CluAdmEx.h>
00026 #pragma warning( pop )
00027
00028 #include "ClipBook ServerEx.h"
00029 #include "ExtObj.h"
00030 #include "BasePage.h"
00031 #include "RegExt.h"
00032
00033 #ifdef _DEBUG
00034 #define new DEBUG_NEW
00035 #undef THIS_FILE
00036 static char THIS_FILE[] = __FILE__;
00037 #endif
00038
00039 CComModule _Module;
00040
00041 BEGIN_OBJECT_MAP( ObjectMap )
00042     OBJECT_ENTRY( CLSID_CoClipBookServerEx, CExtObject )
00043 END_OBJECT_MAP()
00044
00045 /////////////////////////////////////////////////////////////////////////////
00046 // Global Function Prototypes
00047 /////////////////////////////////////////////////////////////////////////////
00048
00049 STDAPI
00050 DllCanUnloadNow( void );
00051
00052 STDAPI
00053 DllGetClassObject(
00054       REFCLSID  rclsidIn
00055     , REFIID    riidIn
00056     , LPVOID *  ppvOut
00057     );
00058
00059 STDAPI
00060 DllRegisterServer( void );
00061
00062 STDAPI
00063 DllUnregisterServer( void );
00064
00065 STDAPI
00066 DllRegisterCluAdminExtension(
00067     HCLUSTER hClusterIn
00068     );
00069
00070 STDAPI
00071 DllUnregisterCluAdminExtension(
00072     HCLUSTER hClusterIn
00073     );
00074
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // class CClipBookServerApp
00078 /////////////////////////////////////////////////////////////////////////////
00079
00080 class CClipBookServerApp : public CWinApp
00081 {
00082 public:
00083     virtual BOOL InitInstance();
00084     virtual int ExitInstance();
00085
00086 }; //*** class CClipBookServerApp
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // The one and only CClipBookServerApp object
00090
00091 CClipBookServerApp theApp;
00092
00093 /////////////////////////////////////////////////////////////////////////////
00094 //++
00095 //
00096 //  CClipBookServerApp::InitInstance
00097 //
00098 //  Description:
00099 //      Initialize this instance of the application.
00100 //
00101 //  Arguments:
00102 //      None.
00103 //
00104 //  Return Value:
00105 //      Any return codes from CWinApp::InitInstance().
00106 //
00107 //--
00108 /////////////////////////////////////////////////////////////////////////////
00109 BOOL
00110 CClipBookServerApp::InitInstance( void )
00111 {
00112     _Module.Init( ObjectMap, m_hInstance );
00113
00114     return CWinApp::InitInstance();
00115
00116 }  //*** CClipBookServerApp::InitInstance
00117
00118 /////////////////////////////////////////////////////////////////////////////
00119 //++
00120 //
00121 //  CClipBookServerApp::ExitInstance
00122 //
00123 //  Description:
00124 //      Deinitialize this instance of the application.
00125 //
00126 //  Arguments:
00127 //      None.
00128 //
00129 //  Return Value:
00130 //      Any return codes from CWinApp::ExitInstance().
00131 //
00132 //--
00133 /////////////////////////////////////////////////////////////////////////////
00134 int
00135 CClipBookServerApp::ExitInstance( void )
00136 {
00137     _Module.Term();
00138
00139     return CWinApp::ExitInstance();
00140
00141 }  //*** CClipBookServerApp::ExitInstance
00142
00143 /////////////////////////////////////////////////////////////////////////////
00144 //++
00145 //
00146 //  FormatError
00147 //
00148 //  Description:
00149 //      Format an error.
00150 //
00151 //  Arguments:
00152 //      rstrError   String in which to return the error message.
00153 //      dwError     Error code to format.
00154 //
00155 //  Return Value:
00156 //      None.
00157 //
00158 //--
00159 /////////////////////////////////////////////////////////////////////////////
00160 void
00161 FormatError(
00162       CString & rstrErrorInout
00163     , DWORD     dwErrorIn
00164     )
00165 {
00166     DWORD   cch;
00167     TCHAR   szError[ 512 ];
00168
00169     //
00170     // Format the NT status code from CLUSAPI.  This is necessary
00171     // for the cases where cluster messages haven't been added to
00172     // the system message file yet.
00173     //
00174
00175     cch = FormatMessage(
00176                       FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS
00177                     , ::GetModuleHandle( _T( "CLUSAPI.DLL" ) )
00178                     , dwErrorIn
00179                     , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00180                     , szError
00181                     , RTL_NUMBER_OF( szError )
00182                     , 0
00183                     );
00184     if ( cch == 0 )
00185     {
00186         cch = FormatMessage(
00187                           FORMAT_MESSAGE_FROM_SYSTEM
00188                         , NULL
00189                         , dwErrorIn
00190                         , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00191                         , szError
00192                         , RTL_NUMBER_OF( szError )
00193                         , 0
00194                         );
00195         if ( cch == 0 )
00196         {
00197             //
00198             // Format the NT status code from NTDLL since this hasn't been
00199             // integrated into the system yet.
00200             //
00201
00202             cch = FormatMessage(
00203                               FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS
00204                             , ::GetModuleHandle( _T( "NTDLL.DLL" ) )
00205                             , dwErrorIn
00206                             , MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)
00207                             , szError
00208                             , RTL_NUMBER_OF( szError )
00209                             , 0
00210                             );
00211         }  // if:  error formatting status code from system
00212     }  // if:  error formatting status code from ClusApi
00213
00214     if ( cch > 0 )
00215     {
00216         rstrErrorInout = szError;
00217     }  // if:  no error
00218     else
00219     {
00220         TRACE( _T( "FormatError() - Error 0x%08.8x formatting string for error code 0x%08.8x\n" ), GetLastError(), dwErrorIn );
00221         rstrErrorInout.Format( _T( "Error 0x%08.8x" ), dwErrorIn );
00222     }  // else:  error formatting the message
00223
00224 }  //*** FormatError
00225
00226 /////////////////////////////////////////////////////////////////////////////
00227 //++
00228 //
00229 //  DllCanUnloadNow
00230 //
00231 //  Description:
00232 //      Used to determine whether the DLL can be unloaded by COM.
00233 //
00234 //  Arguments:
00235 //      None.
00236 //
00237 //  Return Value:
00238 //      S_OK
00239 //          Dll can be unloaded now.
00240 //
00241 //      S_FALSE
00242 //          Dll cannot be unloaded now...
00243 //
00244 //--
00245 /////////////////////////////////////////////////////////////////////////////
00246 STDAPI
00247 DllCanUnloadNow( void )
00248 {
00249     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00250
00251     return ( AfxDllCanUnloadNow() && _Module.GetLockCount() == 0 ) ? S_OK : S_FALSE;
00252
00253 }  //*** DllCanUnloadNow
00254
00255 /////////////////////////////////////////////////////////////////////////////
00256 //++
00257 //
00258 //  DllGetClassObject
00259 //
00260 //  Description:
00261 //      Returns a class factory to create an object of the requested type
00262 //
00263 //  Arguments:
00264 //      rclsidIn    - CLSID of the class to create.
00265 //      riidIn      - Requested interface of the class.
00266 //      ppvOut      - Pointer to send the class back to the caller.
00267 //
00268 //  Return Value:
00269 //      S_OK
00270 //          Success.
00271 //
00272 //      Other errors as HRESULTs...
00273 //
00274 //--
00275 /////////////////////////////////////////////////////////////////////////////
00276 STDAPI
00277 DllGetClassObject(
00278       REFCLSID  rclsidIn
00279     , REFIID    riidIn
00280     , LPVOID *  ppvOut
00281     )
00282 {
00283     return _Module.GetClassObject( rclsidIn, riidIn, ppvOut );
00284
00285 }  //*** DllGetClassObject
00286
00287 /////////////////////////////////////////////////////////////////////////////
00288 //++
00289 //
00290 //  DllRegisterServer
00291 //
00292 //  Description:
00293 //      Perform all relevant COM registration for this component.
00294 //
00295 //  Arguments:
00296 //      None.
00297 //
00298 //  Return Value:
00299 //      S_OK
00300 //          Success.
00301 //
00302 //      Other errors as HRESULTs...
00303 //
00304 //--
00305 /////////////////////////////////////////////////////////////////////////////
00306 STDAPI
00307 DllRegisterServer( void )
00308 {
00309     HRESULT hr = S_OK;
00310
00311     //
00312     //  Registers object, typelib and all interfaces in typelib
00313     //
00314
00315     hr = _Module.RegisterServer( FALSE /*bRegTypeLib*/ );
00316
00317     return hr;
00318
00319 }  //*** DllRegisterServer
00320
00321 /////////////////////////////////////////////////////////////////////////////
00322 //++
00323 //
00324 //  DllRegisterServer
00325 //
00326 //  Description:
00327 //      Perform all relevant COM un-registration for this component.
00328 //
00329 //  Arguments:
00330 //      None.
00331 //
00332 //  Return Value:
00333 //      S_OK
00334 //          Success.
00335 //
00336 //      Other errors as HRESULTs...
00337 //
00338 //--
00339 /////////////////////////////////////////////////////////////////////////////
00340 STDAPI
00341 DllUnregisterServer( void )
00342 {
00343     HRESULT hr = S_OK;
00344
00345     hr = _Module.UnregisterServer();
00346
00347     return hr;
00348
00349 }  //*** DllUnregisterServer
00350
00351 /////////////////////////////////////////////////////////////////////////////
00352 //++
00353 //
00354 //  DllRegisterCluAdminExtension
00355 //
00356 //  Description:
00357 //      Register the extension with the cluster database.
00358 //
00359 //  Arguments:
00360 //      hClusterIn      Handle to the cluster to modify.
00361 //
00362 //  Return Value:
00363 //      S_OK            Extension registered successfully.
00364 //      Win32 error code if another failure occurred.
00365 //
00366 //--
00367 /////////////////////////////////////////////////////////////////////////////
00368 STDAPI
00369 DllRegisterCluAdminExtension(
00370     HCLUSTER hClusterIn
00371     )
00372 {
00373     DWORD       sc = ERROR_SUCCESS;
00374     DWORD       scTemp = ERROR_SUCCESS;
00375     LPCWSTR     pwszResTypes = g_wszResourceTypeNames;
00376
00377     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00378
00379     //
00380     // Register to extend our resource type(s).
00381     //
00382
00383     while ( *pwszResTypes != L'\0' )
00384     {
00385         wprintf( L"  %s\n", pwszResTypes );
00386         scTemp = RegisterCluAdminResourceTypeExtension(
00387                       hClusterIn
00388                     , pwszResTypes
00389                     , &CLSID_CoClipBookServerEx
00390                     );
00391         if ( scTemp != ERROR_SUCCESS )
00392         {
00393             sc = scTemp;
00394         } // if:  error registering the extension
00395
00396         pwszResTypes += lstrlenW( pwszResTypes ) + 1;
00397     }  // while:  more resource types
00398
00399     if ( sc != ERROR_SUCCESS )
00400     {
00401         goto Cleanup;
00402     } // if:
00403
00404 Cleanup:
00405
00406     return HRESULT_FROM_WIN32( sc );
00407
00408 }  //*** DllRegisterCluAdminExtension
00409
00410 /////////////////////////////////////////////////////////////////////////////
00411 //++
00412 //
00413 //  DllUnregisterCluAdminExtension
00414 //
00415 //  Description:
00416 //      Unregister the extension with the cluster database.
00417 //
00418 //  Arguments:
00419 //      hClusterIn      Handle to the cluster to modify.
00420 //
00421 //  Return Value:
00422 //      S_OK            Extension unregistered successfully.
00423 //      Win32 error code if another failure occurred.
00424 //
00425 //--
00426 /////////////////////////////////////////////////////////////////////////////
00427 STDAPI
00428 DllUnregisterCluAdminExtension(
00429     HCLUSTER hClusterIn
00430     )
00431 {
00432     DWORD       sc = ERROR_SUCCESS;
00433     DWORD       scTemp = ERROR_SUCCESS;
00434     LPCWSTR     pwszResTypes = g_wszResourceTypeNames;
00435
00436     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00437
00438
00439     //
00440     // Unregister to extend our resource type(s).
00441     //
00442
00443     while ( *pwszResTypes != L'\0' )
00444     {
00445         wprintf( L"  %s\n", pwszResTypes );
00446         scTemp = UnregisterCluAdminResourceTypeExtension(
00447                       hClusterIn
00448                     , pwszResTypes
00449                     , &CLSID_CoClipBookServerEx
00450                     );
00451         if ( scTemp != ERROR_SUCCESS )
00452         {
00453             sc = scTemp;
00454         } // if:  error unregistering the extension
00455
00456         pwszResTypes += lstrlenW( pwszResTypes ) + 1;
00457     }  // while:  more resource types
00458
00459     if ( sc != ERROR_SUCCESS )
00460     {
00461         goto Cleanup;
00462     } // if:
00463
00464 Cleanup:
00465
00466     return HRESULT_FROM_WIN32( sc );
00467
00468 }  //*** DllUnregisterCluAdminExtension
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Dragsrc.Cpp Source File

  • WinUI
  • Shell
  • DragImg

Dragsrc.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DragSrc.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "DragSrc.h"
00023
00024 /**************************************************************************
00025
00026    CDragSource::CDragSource()
00027
00028 **************************************************************************/
00029
00030 CDragSource::CDragSource()
00031 {
00032 m_cRefCount = 1;
00033 }
00034
00035 /**************************************************************************
00036
00037    CDragSource::~CDragSource()
00038
00039 **************************************************************************/
00040
00041 CDragSource::~CDragSource()
00042 {
00043 }
00044
00045 ///////////////////////////////////////////////////////////////////////////
00046 //
00047 // IUnknown Implementation
00048 //
00049
00050 /**************************************************************************
00051
00052    CDragSource::QueryInterface()
00053
00054 **************************************************************************/
00055
00056 STDMETHODIMP CDragSource::QueryInterface(REFIID riid, LPVOID* ppvOut)
00057 {
00058 *ppvOut = NULL;
00059
00060 //IUnknown
00061 if(IsEqualIID(riid, IID_IUnknown))
00062    {
00063    *ppvOut = this;
00064    }
00065
00066 //IDropSource
00067 else if(IsEqualIID(riid, IID_IDropSource))
00068    {
00069    *ppvOut = (IDropSource*)this;
00070    }
00071
00072 if(*ppvOut)
00073    {
00074    (*(LPUNKNOWN*)ppvOut)->AddRef();
00075    return S_OK;
00076    }
00077
00078 return E_NOINTERFACE;
00079 }
00080
00081 /**************************************************************************
00082
00083    CDragSource::AddRef()
00084
00085 **************************************************************************/
00086
00087 STDMETHODIMP_(ULONG) CDragSource::AddRef(void)
00088 {
00089 return ++m_cRefCount;
00090 }
00091
00092 /**************************************************************************
00093
00094    CDragSource::Release()
00095
00096 **************************************************************************/
00097
00098 STDMETHODIMP_(ULONG) CDragSource::Release(void)
00099 {
00100 if(--m_cRefCount == 0)
00101    {
00102    delete this;
00103    return 0;
00104    }
00105
00106 return m_cRefCount;
00107 }
00108
00109 ///////////////////////////////////////////////////////////////////////////
00110 //
00111 // IDropSource Implementation
00112 //
00113
00114 /**************************************************************************
00115
00116    CDragSource::GiveFeedback()
00117
00118 **************************************************************************/
00119
00120 STDMETHODIMP CDragSource::GiveFeedback(DWORD dwEffect)
00121 {
00122 return DRAGDROP_S_USEDEFAULTCURSORS;
00123 }
00124
00125 /**************************************************************************
00126
00127    CDragSource::QueryContinueDrag()
00128
00129 **************************************************************************/
00130
00131 STDMETHODIMP CDragSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
00132 {
00133 if(fEscapePressed)
00134    return DRAGDROP_S_CANCEL;
00135
00136 if(!(grfKeyState & MK_LBUTTON))
00137    return DRAGDROP_S_DROP;
00138
00139 return S_OK;
00140 }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_INTS Member List

This is the complete list of members for _INTS, including all inherited members.
value | _INTS
vtType | _INTS
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMDITrace Member List

This is the complete list of members for CMDITrace, including all inherited members.
AutoPosition(BOOL fDefaultPosition=TRUE) | CMDITrace | [virtual]
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
CMDIChildLite() | CMDIChildLite |
CMDITrace(CMainWindow *pCMainWindow) | CMDITrace |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, HICON hIcon, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CMDIChildLite | [virtual]
CWndLite::Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CMDIChildLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pCMainWindow | CMDITrace |
m_pCTrace | CMDITrace |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
MDIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CMDIChildLite | [static]
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CMDITrace | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CMDITrace | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CMDITrace | [virtual]
CMDIChildLite::OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CMDITrace | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CMDITrace | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMDIActivate(BOOL bActivate, HWND hWndActivate, HWND hWndDeactivate) | CMDITrace | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CMDITrace | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CMDITrace | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CMDITrace | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CMDITrace | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CMDITrace | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CMDIChildLite | [virtual]
UpdateControls() | CMDITrace | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CMDIChildLite() | CMDIChildLite | [virtual]
~CMDITrace() | CMDITrace | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ConnectionEventsVt Member List

This is the complete list of members for msado15::ConnectionEventsVt, including all inherited members.
BeginTransComplete(int TransactionLevel, msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
CommitTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
ConnectComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
Disconnect(int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
ExecuteComplete(int RecordsAffected, msado15.Error pError, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
iid | msado15::ConnectionEventsVt | [static]
InfoMessage(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
RollbackTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
WillConnect(String[] ConnectionString, String[] UserID, String[] Password, int[] Options, int[] adStatus, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
WillExecute(String[] Source, int[] CursorType, int[] LockType, int[] Options, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection) | msado15::ConnectionEventsVt |
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/osv.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

osv.Hxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 // Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 // File:        osv.hxx
00006 //
00007 // Contents:    OS Version API
00008 //
00009 //----------------------------------------------------------------------------
00010
00011 #if !defined( __OSV_HXX__ )
00012 #define __OSV_HXX__
00013
00014 extern int g_nOSWinNT;
00015
00016 void InitOSVersion();
00017
00018 inline DWORD GetOSVersion()
00019 {
00020     return g_nOSWinNT;
00021 }
00022
00023 #endif // __OSV_HXX__
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

itemlist Member List

This is the complete list of members for itemlist, including all inherited members.
isselected | itemlist
nitems | itemlist
selitem | itemlist
statels | itemlist
Generated on Wed Nov 13 2024 16:57:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TREEINFO Member List

This is the complete list of members for TREEINFO, including all inherited members.
hItem | TREEINFO
hParent | TREEINFO
ulIndex | TREEINFO
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COptionsNotify Member List

This is the complete list of members for COptionsNotify, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
COptionsNotify() | COptionsNotify |
CPropPageLite(UINT uIDD, TCHAR *ptszTitle=NULL) | CPropPageLite |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetParent() | CPropPageLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pCPropSheet | CPropPageLite |
m_psPage | CPropPageLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnApply() | COptionsNotify | [virtual]
OnCancel() | CPropPageLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | COptionsNotify | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnKillActive() | CPropPageLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CPropPageLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnReset() | CPropPageLite | [virtual]
OnSetActive() | CPropPageLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
PropPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [static]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetParent(CPropSheetLite *pCPropSheetLite) | CPropPageLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CPropPageLite() | CPropPageLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/ioo.h Source File

  • Com
  • Fundamentals
  • SimpSvr

ioo.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: ioo.h
00003 //
00004 //      Definition of COleObject
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008 #if !defined( _IOO_H_)
00009 #define _IOO_H_
00010
00011
00012 #include <ole2.h>
00013 #include "obj.h"
00014
00015 class CSimpSvrObj;
00016
00017 interface COleObject : public IOleObject
00018 {
00019 private:
00020   CSimpSvrObj FAR * m_lpObj;
00021   int m_nCount;
00022   BOOL m_fOpen;
00023
00024 public:
00025   COleObject::COleObject(CSimpSvrObj FAR * lpSimpSvrObj)
00026     {
00027     m_lpObj = lpSimpSvrObj;
00028     m_nCount = 0;
00029     m_fOpen = FALSE;
00030     };
00031   COleObject::~COleObject()
00032     {
00033     };
00034   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppvObj);
00035   STDMETHODIMP_(ULONG) AddRef ();
00036   STDMETHODIMP_(ULONG) Release ();
00037
00038   STDMETHODIMP SetClientSite (LPOLECLIENTSITE pClientSite);
00039   STDMETHODIMP Advise (LPADVISESINK pAdvSink, DWORD FAR* pdwConnection);
00040   //@@WTK WIN32, UNICODE
00041   //STDMETHODIMP SetHostNames  ( LPCSTR szContainerApp, LPCSTR szContainerObj);
00042   STDMETHODIMP SetHostNames  ( LPCOLESTR szContainerApp, LPCOLESTR szContainerObj);
00043   STDMETHODIMP DoVerb  (  LONG iVerb,
00044               LPMSG lpmsg,
00045               LPOLECLIENTSITE pActiveSite,
00046               LONG lindex,
00047               HWND hwndParent,
00048               LPCRECT lprcPosRect);
00049   STDMETHODIMP GetExtent  ( DWORD dwDrawAspect, LPSIZEL lpsizel);
00050   STDMETHODIMP Update  () ;
00051   STDMETHODIMP Close  ( DWORD dwSaveOption) ;
00052   STDMETHODIMP Unadvise ( DWORD dwConnection);
00053   STDMETHODIMP EnumVerbs  ( LPENUMOLEVERB FAR* ppenumOleVerb) ;
00054   STDMETHODIMP GetClientSite  ( LPOLECLIENTSITE FAR* ppClientSite);
00055   STDMETHODIMP SetMoniker  ( DWORD dwWhichMoniker, LPMONIKER pmk);
00056   STDMETHODIMP GetMoniker  ( DWORD dwAssign, DWORD dwWhichMoniker,
00057                  LPMONIKER FAR* ppmk);
00058   STDMETHODIMP InitFromData  ( LPDATAOBJECT pDataObject,
00059                  BOOL fCreation,
00060                  DWORD dwReserved);
00061   STDMETHODIMP GetClipboardData  ( DWORD dwReserved,
00062                    LPDATAOBJECT FAR* ppDataObject);
00063   STDMETHODIMP IsUpToDate  ();
00064   STDMETHODIMP GetUserClassID  ( CLSID FAR* pClsid);
00065   //@@WTK WIN32, UNICODE
00066   //STDMETHODIMP GetUserType  ( DWORD dwFormOfType, LPSTR FAR* pszUserType);
00067   STDMETHODIMP GetUserType  ( DWORD dwFormOfType, LPOLESTR FAR* pszUserType);
00068   STDMETHODIMP SetExtent  ( DWORD dwDrawAspect, LPSIZEL lpsizel);
00069   STDMETHODIMP EnumAdvise  ( LPENUMSTATDATA FAR* ppenumAdvise);
00070   STDMETHODIMP GetMiscStatus  ( DWORD dwAspect, DWORD FAR* pdwStatus);
00071   STDMETHODIMP SetColorScheme  ( LPLOGPALETTE lpLogpal);
00072
00073   void OpenEdit(LPOLECLIENTSITE pActiveSite);
00074
00075 };
00076
00077 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/irowsetchange.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

irowsetchange.h

Go to the documentation of this file.
00001 // Start of code for IRowsetChange.h
00002 // File: IRowsetChange.h
00003 //
00004 //  This file contains the information for the IRowsetChangeImpl class.
00005 //
00006 //  IRowsetChangeImpl inherits from IRowsetChange and does the following:
00007 //
00008 //    1. IRowsetChangeImpl :: SetData - Performs immediate updates of rowset data
00009 //    2. IRowsetChangeImpl :: CreateRow - Inserts a new default row in the Data Array
00010 //    3. IRowsetChangeImpl :: CreateHRow - Inserts a new row in the Row Handles Array
00011 //    4. IRowsetChangeImpl :: InsertRow - Performs immediate inserts of rowset data
00012 //    5. IRowsetChangeImpl :: DeleteRows - Performs immediate deletes of rowset data
00013 //
00014
00015 // Class IRowsetChangeImpl
00016 #ifndef _ROWSETCHANGE_C822BFE1_C6A1_11d2_AC47_00C04F8DB3D5_H
00017 #define _ROWSETCHANGE_C822BFE1_C6A1_11d2_AC47_00C04F8DB3D5_H
00018
00019 #include "CRow.h"
00020
00021 template <class T, class Storage, class RowClass = CSimpleRow>
00022 class ATL_NO_VTABLE IRowsetChangeImpl:  public IRowsetChange
00023 {
00024 public:
00025
00026 //    IRowsetChangeImpl::SetData( )...
00027 //      Performs Immediate Updates
00028
00029   STDMETHOD (SetData)( HROW  hRow,HACCESSOR hAccessor,  void __RPC_FAR *pData )
00030     {
00031       ATLTRACE2(atlTraceDBProvider, 0, "IRowsetChangeImpl::SetData\n");
00032       HRESULT hr;
00033       T* pT = (T*) this;
00034       // Putting a Lock on the object in the scope of this member function
00035       T::ObjectLock cab((T*) this);
00036
00037     // A. Validation
00038       // Check the Row Handle
00039       if(NULL==hRow)
00040       {
00041         ATLTRACE2(atlTraceDBProvider, 0, _T("SetData: Bad hRow\n"));
00042         return DB_E_BADROWHANDLE;
00043       }
00044       // Check the Accessor Handle
00045       if(NULL==hAccessor)
00046       {
00047         ATLTRACE2(atlTraceDBProvider, 0, _T("SetData : Bad hAccessor\n"));
00048         return DB_E_BADACCESSORHANDLE;
00049       }
00050       // Check the Data pointer
00051       if(NULL== pData)
00052       {
00053         ATLTRACE2(atlTraceDBProvider, 0, _T("SetData : Data Pointer was NULL\n"));
00054         return E_INVALIDARG;
00055       }
00056       // Getting the Row structure from the row handle
00057     // B. Instantiation
00058       // 1. Instantiate the T::_HRowClass pointer and get the pointer to the row in m_rgRowHandles from the Row handle...
00059       // m_rgHandles --- for the row handles
00060       T::_HRowClass *pHRow = pT->m_rgRowHandles.Lookup((T::_HRowClass::KeyType)hRow);
00061       if(!pHRow)
00062       {
00063         ATLTRACE2(atlTraceDBProvider, 0, _T("SetData : Could not get Accessor\n"));
00064         return DB_E_BADROWHANDLE;
00065       }
00066       CRow* pRow = pT->m_DBFile.m_Rows[pHRow->m_iRowset];
00067       if(!pRow)
00068       {
00069         ATLTRACE2(atlTraceDBProvider, 0, _T("SetData : Could not get Accessor\n"));
00070         return DB_E_BADROWHANDLE;
00071       }
00072       // 2. Instantiate the Bindings Accessor pointer and get the pointer to the row in m_rgBindings from the Accessor handle...
00073       // m_rgBindings for the Row Bindings oftype ATLBINDINGS or _BindType
00074       T::_BindType *pAccessor = pT->m_rgBindings.Lookup(hAccessor);
00075       if(!pAccessor)
00076       {
00077         ATLTRACE2(atlTraceDBProvider, 0, _T("SetData : Could not get Accessor\n"));
00078         return DB_E_BADACCESSORHANDLE;
00079       }
00080       // Now all the pointers are obtained ...
00081     // C. Updating
00082       // Check for a ROW accessor
00083       if(!(pAccessor->dwAccessorFlags & DBACCESSOR_ROWDATA))
00084       {
00085         ATLTRACE2(atlTraceDBProvider, 0, _T("SetData : Not a Row Accessor\n"));
00086         return DB_E_BADACCESSORHANDLE;
00087       }
00088       // Get pointer to the Row Data from the Data buffer for the handle from m_rgRowData of type _RowsetArrayType
00089       // Pointer returned is a Storage Class pointer...
00090       // The index lies in m_iRowset in IRowset
00091       //The data is taken out as a BYTE array
00092
00093       // Get the column info about the Destination rowset i.e. in the Provider Buffer !!!
00094       ATLCOLUMNINFO* pColInfo;  // Column Information structure
00095       ULONG cCols;  // # of cols.
00096       pColInfo = pT->GetColumnInfo((T*) this,&cCols);
00097       // D. Transfer data into the Data Buffer for Updation
00098       ULONG cBindings = pAccessor->cBindings; // Total # of Bindings
00099       DBBINDING *pBinding = pAccessor->pBindings; // The DBBINDINGS structure pointer...
00100       HRESULT hrEvent;
00101
00102       for(ULONG iBind =0; iBind < cBindings; iBind++)
00103       {
00104         DBBINDING *pBindCur = &pBinding[iBind];
00105         // To ensure one or zero Bindings per Column
00106         for(ULONG iCol=0; iCol < cCols && pBindCur->iOrdinal != pColInfo[iCol].iOrdinal; iCol++);
00107         if(iCol == cCols)
00108         {
00109           return DB_E_BADORDINAL;
00110         }
00111         ATLCOLUMNINFO* pColCur = &pColInfo[iCol];
00112         if (FAILED(hrEvent = pT->Fire_OnFieldChange((T*)this,  hRow, 1,&iCol, DBREASON_COLUMN_SET, DBEVENTPHASE_OKTODO, TRUE)))
00113         {
00114           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_COLUMN_SET in DBEVENTPHASE_OKTODO phase\n");
00115           if(hrEvent==S_FALSE)
00116             return hrEvent;
00117         }
00118         if(FAILED(hrEvent = pT->Fire_OnFieldChange((T*)this,  hRow, 1,&iCol, DBREASON_COLUMN_SET, DBEVENTPHASE_ABOUTTODO, TRUE)))
00119           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_COLUMN_SET in DBEVENTPHASE_ABOUTTODO phase\n");
00120         // 1. Build up the 12 parameters to IConvertType::DataConvert(  )
00121         // 1. Types x 2
00122         DBTYPE wSrcType = pBindCur->wType;
00123         DBTYPE wDstType = pColCur->wType;
00124         // 2. Lengths x 2
00125         //DANK: Changed the following line as it was calculating the dwSrcLength incorrectly. This caused a problem
00126         //      in rowsetviewer when I change the last record, last column value from 300 to 400. IDataConvert would
00127         //      fail with errors occurred
00128         ULONG dwSrcLength = *((ULONG *)((BYTE*)pData + pBindCur->obLength));
00129         //ULONG dwDstLength = dwSrcLength;  // [in]/[out]
00130         ULONG dwDstLength = pColCur->ulColumnSize;  // [in]/[out]
00131         // 3. Data ptrs or Offsets from the base ptrs - pRowData (Dst) and pDstData x 2
00132         BYTE *pSrc = (BYTE*)((BYTE*)pData + pBindCur->obValue);   // obValue contains the offset...
00133         BYTE *pDst = (BYTE*) ((BYTE*) pRow->m_pbProxyData + pColCur->cbOffset);
00134         // 4. Dst Max Length
00135         ULONG dwDstMaxLen = pColCur->ulColumnSize;
00136         // 5. Status x 2
00137         DWORD dwSrcStatus = pBindCur->obStatus;
00138         DWORD dwDstStatus;
00139         // 6. Precision - pBindCur->bPrecision;
00140         // 7. Scale - pBindCur->bScale;
00141         // 8. Convert Flags - DATACONVERT_SETDATABEHAVIOUR
00142         T* pT = (T*) this;
00143         // Check on DBMEMBER_PROVIDEROWNED or DBMEMBER_PROVIDEROWNED
00144         BOOL bProvOwn = pBindCur->dwMemOwner == DBMEMOWNER_PROVIDEROWNED;
00145         bProvOwn;
00146         // Initialize the Destination Memory to all 0's to remove the junk seen after the string data
00147         //memset(pDst,0,dwDstMaxLen);
00148         if(bProvOwn && pColCur->wType == pBindCur->wType)
00149           // If Provider owned and the types are the same then return the Src pointer to consumer
00150           pDst =  (BYTE*)((BYTE*)pData + pBindCur->obValue);
00151         else
00152         {
00153           // The memory is to be freed by consumer or types differ
00154           if(FAILED( hr = pT->m_spConvert->DataConvert(
00155                                           wSrcType,                         //* [in] */ DBTYPE wSrcType,
00156                                           wDstType,                         //* [in] */ DBTYPE wDstType,
00157                                           dwSrcLength,                      //* [in] */ ULONG cbSrcLength,
00158                                           &dwDstLength,                     //* [out][in] */ ULONG __RPC_FAR *pcbDstLength,
00159                                           pSrc,                             //* [in] */ void __RPC_FAR *pSrc,
00160                                           pDst,                             //* [out] */ void __RPC_FAR *pDst,
00161                                           dwDstMaxLen,                    //* [in] */ ULONG cbDstMaxLength,
00162                                           dwSrcStatus,                      ///* [in] */ DBSTATUS dbsSrcStatus,
00163                                           &dwDstStatus,                     //* [out] */ DBSTATUS __RPC_FAR *pdbsStatus,
00164                                           pBindCur->bPrecision,               //* [in] */ BYTE bPrecision,
00165                                           pBindCur->bScale,                   //* [in] */ BYTE bScale,
00166                                           DBDATACONVERT_SETDATABEHAVIOR //* [in] */ DBDATACONVERT dwFlags) = 0;
00167                                         )))
00168           {
00169             //TODO: Need to handle failure
00170             if(FAILED(hrEvent = pT->Fire_OnFieldChange((T*)this,  hRow, 1,&iCol, DBREASON_COLUMN_SET, DBEVENTPHASE_FAILEDTODO, TRUE)))
00171               ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_COLUMN_SET in DBEVENTPHASE_FAILEDTODO phase\n");
00172             return hr;
00173           }
00174         }
00175         // 2. Write the data to the Storage
00176         if( FAILED(hr=pT->m_DBFile.UpdateRowImmediate(pRow, pT->m_prgColInfo, pT->m_cCols)) )
00177         {
00178           ATLTRACE2(atlTraceDBProvider, 0, _T("SetData : Unsuccessful in writing data to storage\n"));
00179           // Clean-up the Rows of the Data Buffer
00180           if(FAILED(hrEvent = pT->Fire_OnFieldChange((T*)this,  hRow, 1,&iCol, DBREASON_COLUMN_SET, DBEVENTPHASE_FAILEDTODO, TRUE)))
00181             ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_COLUMN_SET in DBEVENTPHASE_FAILEDTODO phase\n");
00182           return hr;
00183         }
00184
00185         if(FAILED(pT->Fire_OnFieldChange((T*)this, hRow, 1, &iCol, DBREASON_COLUMN_SET, DBEVENTPHASE_SYNCHAFTER, TRUE)))
00186           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_COLUMN_SET in DBEVENTPHASE_SYNCHAFTER phase\n");
00187
00188         if(FAILED(pT->Fire_OnFieldChange((T*)this, hRow, 1, &iCol, DBREASON_COLUMN_SET, DBEVENTPHASE_DIDEVENT, TRUE)))
00189           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_COLUMN_SET in DBEVENTPHASE_DIDEVENT phase\n");
00190
00191         if(FAILED(pT->Fire_OnFieldChange((T*)this, hRow, 1, &iCol, DBREASON_COLUMN_RECALCULATED, DBEVENTPHASE_DIDEVENT, TRUE)))
00192           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_COLUMN_SET in DBEVENTPHASE_DIDEVENT phase\n");
00193       }
00194       return S_OK;
00195     }
00196
00197     // IRowsetImpl::CreateHRow( )
00198     // Helper function to create a new entry in the m_rgRowHandles
00199     HRESULT CreateHRow(LONG lRowsOffset, HROW *phRow)
00200     {
00201       T* pT = (T*) this;
00202       T::_HRowClass* pRow = NULL;
00203       ATLASSERT(lRowsOffset >= 0);
00204       T::_HRowClass::KeyType key = lRowsOffset+1;
00205       ATLASSERT(key > 0);
00206       pRow = pT->m_rgRowHandles.Lookup(key);
00207       if (pRow == NULL)
00208       {
00209         ATLTRY(pRow = new T::_HRowClass(lRowsOffset))  // Copy constructor
00210         if (pRow == NULL)
00211           return E_OUTOFMEMORY;
00212         if (!pT->m_rgRowHandles.Add(key, pRow))
00213           return E_OUTOFMEMORY;
00214       }
00215       // Doing the AddRef here
00216       pRow->AddRefRow();
00217       pT->m_bReset = false;
00218       if(phRow != NULL)
00219         *phRow = (HROW)key;
00220
00221       return S_OK;
00222     }
00223
00224     // IRowsetImpl::CreateHRow( )
00225     // Helper function to create a new entry in the Data array to store a default row
00226     HRESULT CreateRecord(ULONG &cRowsObtained, HROW *phRow)
00227     {
00228       ATLTRACE2(atlTraceDBProvider, 0, "IRowsetChangeImpl::CreateRecord\n");
00229       HRESULT hr = S_OK;
00230       T* pT = (T*) this;
00231
00232       CRow* pRow = new CRow();  // A New blank row inserted into the MM file
00233       if(pRow == NULL)
00234         return E_OUTOFMEMORY;
00235
00236       // Need to Set the BookMark appropriately after creating the Row
00237       // Get the last Bookmark
00238       int tmpSize = pT->m_DBFile.m_Rows.m_nSize;
00239       DWORD newBkMrk;
00240       if (0 != tmpSize)
00241         newBkMrk = pT->m_DBFile.m_Rows[tmpSize-1]->m_bmk + 1;
00242       else  // When there are 0 records
00243         newBkMrk = 1;
00244
00245       // Create new Row in the Row Array
00246       ATLCOLUMNINFO* pColInfo;  // Column Information structure
00247       ULONG cCols;  // # of cols.
00248       pColInfo =pT-> GetColumnInfo( pT,&cCols);
00249       if (!pT->m_DBFile.AddRow(pRow, pColInfo, cCols)) // This will add the CRow object to the file and initialize it
00250       {
00251         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Unsuccessful in creating a Row\n"));
00252         // The Cleanup
00253         phRow = NULL;
00254         if(FAILED(pT->Fire_OnRowChange((T*)this, 1, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00255           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00256         return E_FAIL;
00257       }
00258
00259       // Set the new BookMark
00260       if(newBkMrk)
00261         pT->m_DBFile.m_Rows[tmpSize]->m_bmk= newBkMrk;
00262
00263       // Add the data to the File
00264       if( FAILED(hr = pT->m_DBFile.InsertRowImmediate(pRow, pColInfo, cCols,false)) )
00265       {
00266         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Unsuccessful in converting data\n"));
00267         // Clean-up the Rows of the Data Buffer
00268         if(!(pT->m_DBFile.m_Rows.Remove(pRow)) )
00269           _ASSERTE(0); // This should not happen...
00270         pT->m_iRowset--;
00271         phRow = NULL;
00272         if(FAILED(pT->Fire_OnRowChange((T*)this, 1, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00273           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00274         return hr;
00275       }
00276
00277       //Add the Row into the m_rgRowHandles
00278       if((hr=pT->CreateHRow(pT->m_DBFile.m_Rows.m_nSize - 1, phRow)) != S_OK)
00279       {
00280         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Unsuccessful in creating a Row Handle\n"));
00281         // The Cleanup
00282         phRow = NULL;
00283         if(FAILED(pT->Fire_OnRowChange((T*)this, 1, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00284           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00285         return hr;
00286       }
00287
00288       if(FAILED(pT->Fire_OnRowChange((T*)this, 1, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_SYNCHAFTER, TRUE)))
00289         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_SYNCHAFTER phase\n");
00290
00291       if(FAILED(pT->Fire_OnRowChange((T*)this, 1, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_DIDEVENT, TRUE)))
00292       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_DIDEVENT phase\n");
00293
00294       return S_OK;
00295     }
00296
00297
00298 //    IRowsetImpl::InsertRow( )
00299 //     Performing Immediate Inserts...
00300
00301         STDMETHOD (InsertRow)(
00302             /* [in] */ HCHAPTER hReserved,
00303             /* [in] */ HACCESSOR hAccessor,
00304             /* [in] */ void __RPC_FAR *pData,
00305             /* [out] */ HROW __RPC_FAR *phRow)
00306     {
00307       ATLTRACE2(atlTraceDBProvider, 0, "IRowsetChangeImpl::InsertRow\n");
00308       HRESULT hr;
00309       T* pT = (T*) this;
00310       // Putting a Lock on the object in the scope of this member function
00311       T::ObjectLock cab((T*) this);
00312
00313       HRESULT hrEvent = S_OK;
00314       ULONG cRows = 1;
00315
00316   // A. Validate
00317
00318       // Chapters not supported
00319       if(DB_NULL_HCHAPTER != hReserved)
00320         return DB_E_NOTSUPPORTED;
00321
00322       if (FAILED(hrEvent = pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_OKTODO, TRUE)))
00323       {
00324         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_OKTODO phase\n");
00325         if(hrEvent==S_FALSE)
00326           return hrEvent;
00327       }
00328       // Check the Accessor Handle
00329       if(NULL==hAccessor)
00330       {
00331         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Bad hAccessor\n"));
00332         return DB_E_BADACCESSORHANDLE;
00333       }
00334       // Check the Data pointer
00335       if(NULL== pData)
00336       {
00337         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Data Pointer was NULL\n"));
00338         ULONG cRowsObtained=0;
00339         if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_ABOUTTODO, TRUE)))
00340           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_ABOUTTODO phase\n");
00341         // Create a new record if the pData pointer is NULL
00342         // The ADO Data Grid asks for a NULL or Default row during insertions
00343         return CreateRecord(cRowsObtained, phRow);
00344       }
00345
00346   // B. Instantiation
00347
00348       // 1. Instantiate the Bindings Accessor pointer and get the pointer to the row in m_rgBindings from the Accessor handle...
00349       // m_rgBindings for the Row Bindings oftype ATLBINDINGS or _BindType
00350       T::_BindType *pAccessor = pT->m_rgBindings.Lookup(hAccessor);
00351       if(!pAccessor)
00352       {
00353         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Could not get Accessor\n"));
00354         return DB_E_BADACCESSORHANDLE;
00355       }
00356
00357   //C. Preparing for Insertion
00358
00359       // Check for a ROW accessor
00360       if(!(pAccessor->dwAccessorFlags & DBACCESSOR_ROWDATA))
00361       {
00362         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Not a Row Accessor\n"));
00363         return DB_E_BADACCESSORHANDLE;
00364       }
00365
00366       // Create a new row in the Row Array
00367       CRow * pRow = new CRow;
00368       ATLCOLUMNINFO* pColInfo;  // Column Information structure
00369       ULONG cCols;  // # of cols.
00370       pColInfo =pT-> GetColumnInfo( pT,&cCols);
00371
00372
00373       // Need to Set the BookMark appropriately after creating the Row
00374       // Get the last Bookmark
00375       int tmpSize = pT->m_DBFile.m_Rows.m_nSize;
00376       DWORD newBkMrk;
00377       if (0 != tmpSize)
00378         newBkMrk = pT->m_DBFile.m_Rows[tmpSize-1]->m_bmk + 1;
00379       else  // When there are 0 records
00380         newBkMrk = 1;
00381
00382       // This will add the CRow object to the file and initialize it
00383       if (!pT->m_DBFile.AddRow(pRow, pColInfo, cCols))
00384       {
00385         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Unsuccessful in creating a Row\n"));
00386         // The Cleanup
00387         phRow = NULL;
00388         if(FAILED(pT->Fire_OnRowChange((T*)this, 1, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00389           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00390         return E_FAIL;
00391       }
00392
00393       // Assign proxy buffer to the destination pointer
00394       BYTE * pRowData = pRow->m_pbProxyData;
00395
00396       if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_ABOUTTODO, TRUE)))
00397         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_ABOUTTODO phase\n");
00398
00399   //D. Inserting the Row
00400
00401       ULONG cBindings = pAccessor->cBindings; // Total # of Bindings
00402       DBBINDING *pBinding = pAccessor->pBindings; // The DBBINDINGS structure pointer...
00403       for(ULONG iBind =0; iBind < cBindings; iBind++)
00404       {
00405         DBBINDING *pBindCur = &pBinding[iBind];
00406         // To ensure one or zero Bindings per Column
00407         for(ULONG iCol=0; iCol < cCols && pBindCur->iOrdinal != pColInfo[iCol].iOrdinal; iCol++);
00408         if(iCol == cCols)
00409         {
00410           if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00411             ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00412           return DB_E_BADORDINAL;
00413         }
00414         ATLCOLUMNINFO* pColCur = &pColInfo[iCol];
00415         // Build up the 12 parameters to IConvertType::DataConvert(  )
00416         // 1. Types x 2
00417         DBTYPE wSrcType = pBindCur->wType;
00418         DBTYPE wDstType = pColCur->wType;
00419         // 2. Lengths x 2
00420         ULONG dwSrcLength = *((ULONG *)((BYTE*)pData + pBindCur->obLength));
00421         ULONG dwDstLength = pColCur->ulColumnSize;  // [in]/[out]
00422         // 3. Data ptrs or Offsets from the base ptrs - pRowData (Dst) and pDstData x 2
00423         BYTE *pSrc = (BYTE*)((BYTE*)pData + pBindCur->obValue);   // obValue contains the offset...
00424         BYTE *pDst = (BYTE*) ((BYTE*) pRowData + pColCur->cbOffset);
00425         // 4. Dst Max Length
00426         ULONG dwDstMaxLen = pColCur->ulColumnSize;
00427         // 5. Status x 2
00428         DWORD dwSrcStatus = pBindCur->obStatus;
00429         DWORD dwDstStatus;
00430         // 6. Precision - pBindCur->bPrecision;
00431         // 7. Scale - pBindCur->bScale;
00432         // 8. Convert Flags - DATACONVERT_SETDATABEHAVIOUR
00433         // Check on DBMEMBER_PROVIDEROWNED or DBMEMBER_PROVIDEROWNED
00434         BOOL bProvOwn = pBindCur->dwMemOwner == DBMEMOWNER_PROVIDEROWNED;
00435         bProvOwn;
00436
00437         if(bProvOwn && pColCur->wType == pBindCur->wType)
00438           // If Provider owned and the types are the same then return the Src pointer to consumer
00439           pDst =  (BYTE*)((BYTE*)pData + pBindCur->obValue);
00440         else
00441         {
00442           // The memory is to be freed by consumer or types differ
00443           if(FAILED( hr = pT->m_spConvert->DataConvert(
00444                                           wSrcType,                         //* [in] */ DBTYPE wSrcType,
00445                                           wDstType,                         //* [in] */ DBTYPE wDstType,
00446                                           dwSrcLength,                      //* [in] */ ULONG cbSrcLength,
00447                                           &dwDstLength,                     //* [out][in] */ ULONG __RPC_FAR *pcbDstLength,
00448                                           pSrc,                             //* [in] */ void __RPC_FAR *pSrc,
00449                                           pDst,                             //* [out] */ void __RPC_FAR *pDst,
00450                                           dwDstMaxLen,                    //* [in] */ ULONG cbDstMaxLength,
00451                                           dwSrcStatus,                      ///* [in] */ DBSTATUS dbsSrcStatus,
00452                                           &dwDstStatus,                     //* [out] */ DBSTATUS __RPC_FAR *pdbsStatus,
00453                                           pBindCur->bPrecision,               //* [in] */ BYTE bPrecision,
00454                                           pBindCur->bScale,                   //* [in] */ BYTE bScale,
00455                                           DBDATACONVERT_SETDATABEHAVIOR //* [in] */ DBDATACONVERT dwFlags) = 0;
00456                                         )))
00457           {
00458             ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Unsuccessful in converting data\n"));
00459             // The Cleanup...
00460             pT->m_iRowset--;
00461             phRow = NULL;
00462             if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00463               ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00464             return hr | E_FAIL;
00465           }
00466         }
00467       }
00468
00469       // Set the new BookMark
00470       if(newBkMrk)
00471         pT->m_DBFile.m_Rows[tmpSize]->m_bmk= newBkMrk;
00472
00473       // Insert the data into the Storage from
00474       //now that the data has been transfer to the proxy buffer, store to file
00475       if( FAILED(hr = pT->m_DBFile.InsertRowImmediate(pRow, pColInfo, cCols,true)) )
00476       {
00477         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Unsuccessful in converting data\n"));
00478         // Clean-up the Rows of the Data Buffer
00479         if(!(pT->m_DBFile.m_Rows.Remove(pRow)) )
00480           _ASSERTE(0); // This should not happen...
00481         pT->m_iRowset--;
00482         phRow = NULL;
00483         if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00484           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00485         return hr;
00486       }
00487
00488       //Add the Row into the m_rgRowHandles
00489       if((hr=pT->CreateHRow(pT->m_DBFile.m_Rows.m_nSize - 1, phRow)) != S_OK)
00490       {
00491         ATLTRACE2(atlTraceDBProvider, 0, _T("InsertRow : Unsuccessful in creating a Row Handle\n"));
00492         // Clean-up the Rows of the Data Buffer
00493         if(!(pT->m_DBFile.m_Rows.Remove(pRow)) )
00494           _ASSERTE(0); // This should not happen...
00495         // The Cleanup
00496         pT->m_iRowset--;
00497         phRow = NULL;
00498         if(FAILED(pT->Fire_OnRowChange((T*)this, 1, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_FAILEDTODO, TRUE)))
00499           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_FAILEDTODO phase\n");
00500         return hr;
00501       }
00502
00503       if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_SYNCHAFTER, TRUE)))
00504           ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_SYNCHAFTER phase\n");
00505
00506       if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, phRow, DBREASON_ROW_INSERT, DBEVENTPHASE_DIDEVENT, TRUE)))
00507         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_INSERT in DBEVENTPHASE_DIDEVENT phase\n");
00508
00509       return S_OK;
00510     }
00511
00512
00513 //    IRowsetImpl: DeleteRows( )
00514 //    Performing Immediate deletes
00515
00516        STDMETHOD (DeleteRows)(
00517             /* [in] */ HCHAPTER hReserved,
00518             /* [in] */ ULONG cRows,   // Total number of rows to be deleted
00519             /* [size_is][in] */ const HROW __RPC_FAR rghRows[  ], //An array of handles of the rows to be deleted
00520             /* [size_is][out] */ DBROWSTATUS __RPC_FAR rgRowStatus[  ]) //An array with cRows elements in which to return values indicating the status of each row specified in rghRows
00521     {
00522       ATLTRACE2(atlTraceDBProvider, 0, "IRowsetChangeImpl::DeleteRows\n");
00523       T* pT = (T*) this;
00524       T::ObjectLock cab((T*) pT);
00525       HRESULT hr = S_OK;
00526
00527       HRESULT hrEvent = S_OK;
00528       if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, rghRows, DBREASON_ROW_DELETE, DBEVENTPHASE_OKTODO, TRUE)))
00529       {
00530         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_DELETE in DBEVENTPHASE_OKTODO phase\n");
00531         if(hrEvent==S_FALSE)
00532           return hrEvent;
00533       }
00534       // Putting a Lock on the object in the scope of this member function
00535
00536   // A. Validation
00537
00538       if(DB_NULL_HCHAPTER != hReserved)
00539       {
00540         ATLTRACE2(atlTraceDBProvider, 0, "IRowsetChangeImpl::DeleteRows: Chapters are not supported\n");
00541         return DB_E_NOTSUPPORTED;
00542       }
00543
00544       if(cRows <= 0)
00545       {
00546         ATLTRACE2(atlTraceDBProvider, 0, "IRowsetChangeImpl::DeleteRows: Too few Rows\n");
00547         return E_INVALIDARG;
00548       }
00549
00550       if(NULL == rghRows)
00551       {
00552         ATLTRACE2(atlTraceDBProvider, 0, "IRowsetChangeImpl::DeleteRows: Too few Row Handles\n");
00553         return E_INVALIDARG;
00554       }
00555
00556       if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, rghRows, DBREASON_ROW_DELETE, DBEVENTPHASE_ABOUTTODO, TRUE)))
00557         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_DELETE in DBEVENTPHASE_ABOUTTODO phase\n");
00558
00559   // B. Deleting the rows
00560       // Delete Rows dealing only with the m_rgRowData
00561       // ADO client Release the rows appropriately
00562       // The process of Deleting the rows
00563
00564       for(ULONG i=0; i<cRows; i++)
00565       {
00566         // Find the Row from the handle
00567         T::_HRowClass *pHRow = pT->m_rgRowHandles.Lookup((T::_HRowClass::KeyType)rghRows[i]);
00568         if(!pHRow)
00569         {
00570           ATLTRACE2(atlTraceDBProvider, 0, _T("IRowsetChangeImpl::DeleteRows: Bad Row Handle\n"));
00571           if(rgRowStatus) rgRowStatus[i] = DBROWSTATUS_E_INVALID;
00572           if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, rghRows, DBREASON_ROW_DELETE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00573             ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_DELETE in DBEVENTPHASE_FAILEDTODO phase\n");
00574           return DB_E_BADROWHANDLE;
00575         }
00576
00577         // The marking of the rows to be deleted is to be from the Buffer (m_rgRowData) itself
00578         // 1. rghRows[i] - handle of therow to deleted
00579         // 2. phRow - CSimpleRow in m_rgRowHandles whose m_aKey = rghRows[i]
00580         // 3. pHRow->m_iRowset - index of the row in the Data array
00581         // 4. pT->m_DBFile.m_Rows - the Data array
00582         hr = pT->m_DBFile.DeleteRowImmediate(pT->m_DBFile.m_Rows[pHRow->m_iRowset]);
00583         if (FAILED(hr))
00584         {
00585           ATLTRACE2(atlTraceDBProvider, 0, _T("IRowsetChangeImpl::DeleteRows: Unable to remove Row \n"));
00586           if(rgRowStatus) rgRowStatus[i] = DBROWSTATUS_E_FAIL;
00587           if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, rghRows, DBREASON_ROW_DELETE, DBEVENTPHASE_FAILEDTODO, TRUE)))
00588             ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_DELETE in DBEVENTPHASE_FAILEDTODO phase\n");
00589           return DB_S_ERRORSOCCURRED;
00590         }
00591
00592         if (rgRowStatus)
00593           rgRowStatus[i] = DBROWSTATUS_S_OK;
00594
00595       }
00596
00597     if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, rghRows, DBREASON_ROW_DELETE, DBEVENTPHASE_SYNCHAFTER, TRUE)))
00598         ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_DELETE in DBEVENTPHASE_SYNCHAFTER phase\n");
00599
00600     if(FAILED(pT->Fire_OnRowChange((T*)this, cRows, rghRows, DBREASON_ROW_DELETE, DBEVENTPHASE_DIDEVENT, TRUE)))
00601       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_DELETE in DBEVENTPHASE_DIDEVENT phase\n");
00602
00603     return hr;
00604      }
00605 };
00606 #endif
00607
00608 // End of code for IRowsetChange.h
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMMCControl Member List

This is the complete list of members for IMMCControl, including all inherited members.
DoHelp() | IMMCControl
StartAnimation() | IMMCControl
StopAnimation() | IMMCControl
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Server/StdAfx.h Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Server

StdAfx.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: StdAfx.h
00004
00005 Summary:  Produced by VS6 ATL Wizard. Project's include file used to generate
00006           pre-compiled headers.
00007
00008 ----------------------------------------------------------------------------
00009
00010 This file is part of the Microsoft COM+ Samples.
00011
00012 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00013
00014 This source code is intended only as a supplement to Microsoft
00015 Development Tools and/or on-line documentation. See these other
00016 materials for detailed information regarding Microsoft code samples.
00017
00018 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00021 PARTICULAR PURPOSE.
00022
00023 ==========================================================================+*/
00024 // stdafx.h : include file for standard system include files,
00025 //      or project specific include files that are used frequently,
00026 //      but are changed infrequently
00027
00028 #if !defined(AFX_STDAFX_H__F159BD53_4DA8_11D2_9672_00AA00B913AC__INCLUDED_)
00029 #define AFX_STDAFX_H__F159BD53_4DA8_11D2_9672_00AA00B913AC__INCLUDED_
00030
00031 #if _MSC_VER >= 1000
00032 #pragma once
00033 #endif // _MSC_VER >= 1000
00034
00035 #define STRICT
00036
00037
00038 #define _ATL_APARTMENT_THREADED
00039
00040
00041 #include <atlbase.h>
00042 //You may derive a class from CComModule and use it if you want to override
00043 //something, but do not change the name of _Module
00044 class CExeModule : public CComModule
00045 {
00046 public:
00047   LONG Unlock();
00048   DWORD dwThreadID;
00049 };
00050 extern CExeModule _Module;
00051 #include <atlcom.h>
00052
00053 //{{AFX_INSERT_LOCATION}}
00054 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00055
00056 #endif // !defined(AFX_STDAFX_H__F159BD53_4DA8_11D2_9672_00AA00B913AC__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/LocServe.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

LocServe.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      LOCSERVE.H
00003
00004   Summary:   Include file for the LOCSERVE code sample application.
00005              In addition to class definitions, this LOCSERVE.H file
00006              contains definitions of the application's menu, string,
00007              and other resource IDs.
00008
00009              For a comprehensive tutorial code tour of LOCSERVE's
00010              contents and offerings see the tutorial LOCSERVE.HTM file.
00011              For more specific technical details on the internal workings
00012              see the comments dispersed throughout the LOCSERVE source code.
00013
00014   Classes:   CMainWindow
00015
00016   Functions: WinMain
00017
00018   Origin:    11-14-95: atrent - Editor-inheritance from the DLLCLIEN source.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 #if !defined(LOCSERVE_H)
00036 #define LOCSERVE_H
00037
00038 #ifdef __cplusplus
00039
00040 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00041   Class:    CMainWindow
00042
00043   Summary:  Class to encapsulate the application's main window, menu, and
00044             message dispatching behavior.
00045
00046   Methods:  CMainWindow
00047               Constructor.
00048             InitInstance
00049               Creates a new instance of the main window.
00050 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00051 class CMainWindow: public CVirWindow
00052 {
00053 public:
00054   CMainWindow();
00055   ~CMainWindow();
00056   BOOL InitInstance(HINSTANCE, int);
00057
00058   // Methods for registering and unregistering this server.
00059   BOOL RegisterServer(void);
00060   BOOL UnregisterServer(void);
00061
00062   // For message box dialogs.
00063   CMsgBox*  m_pMsgBox;
00064   CSendLog* m_pMsgLog;
00065
00066 protected:
00067   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00068
00069 private:
00070   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00071 };
00072
00073 #endif // __cplusplus
00074
00075 // Window Class String Macros.
00076 #define MAIN_WINDOW_TITLE_STR       "LOCSERVE: Tutorial Code Sample"
00077 #define MAIN_WINDOW_CLASS_NAME_STR  "LOCSERVEWindow"
00078 #define MAIN_WINDOW_CLASS_MENU_STR  "LOCSERVEMenu"
00079 #define CLIENT_WINDOW_TITLE         "LOCCLIEN: Tutorial Code Sample"
00080
00081 // File Menu Command Identifiers.
00082 #define IDM_FILE_EXIT               1000
00083
00084 // Log Menu Command Identifiers.
00085 #define IDM_LOG_LOGCLEAR            1890
00086 #define IDM_LOG_COPYCLIP            1891
00087
00088 // Help Menu Command Identifiers.
00089 #define IDM_HELP_ABOUT              1905
00090
00091 // Error-related String Identifiers.
00092 #define IDS_COMINITFAILED           2000
00093 #define IDS_APPINITFAILED           2001
00094 #define IDS_OUTOFMEMORY             2002
00095 #define IDS_NOHELPFILE              2003
00096 #define IDS_NOUNICODE               2004
00097 #define IDS_NOSERVER                2005
00098
00099 #define IDS_ASSERT_FAIL             2200
00100
00101 // Notice-related String Identifiers.
00102 #define IDS_NOTIMPLEMENTED          2301
00103
00104 // Log Message String Identifiers.
00105 #define IDS_LOGTO_CLIENT            2400
00106 #define IDS_LOGTO_SERVER            2401
00107
00108 #endif  // LOCSERVE_H
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/DCO_DimmerService/resource.h Source File

  • NetDS
  • upnp
  • DCO_DimmerService

resource.h

Go to the documentation of this file.
00001 //
00002 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 // PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00008 //
00009 //
00010 // resource.h
00011 //
00012 //
00013 // Used by UPNPSampleDimmerDevice.rc
00014 //
00015 #define IDR_UPNPDIMMERDEVICE            100
00016
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/dxferObj.Cpp Source File

  • Com
  • Fundamentals
  • SimpDnd

dxferObj.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: DXFEROBJ.CPP
00003 //
00004 //       Implementation file for CDataXferObj, data transfer object
00005 //     implementation of IDataObject interface.
00006 //
00007 // Functions:
00008 //
00009 //      See DXFEROBJ.H for class definition
00010 //
00011 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00012 //**********************************************************************
00013
00014 #include "pre.h"
00015 //@@WTK WIN32, UNICODE
00016 //#include "..\include\enumfetc.h"
00017 #include <assert.h>
00018 #include "dxferobj.h"
00019 #include "site.h"
00020
00021 CLIPFORMAT g_cfEmbeddedObject = RegisterClipboardFormat(CF_EMBEDDEDOBJECT);
00022 CLIPFORMAT g_cfObjectDescriptor =RegisterClipboardFormat(CF_OBJECTDESCRIPTOR);
00023
00024 // List of formats offered by our data transfer object via EnumFormatEtc
00025 static FORMATETC s_arrGetFmtEtcs[] =
00026 {
00027         { g_cfEmbeddedObject, NULL, DVASPECT_CONTENT, -1, TYMED_ISTORAGE},
00028         { g_cfObjectDescriptor, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL},
00029         { CF_METAFILEPICT, NULL, DVASPECT_CONTENT, -1, TYMED_MFPICT}
00030 };
00031
00032
00033 //**********************************************************************
00034 //
00035 // CDataXferObj::Create
00036 //
00037 // Purpose:
00038 //
00039 //      Creation routine for CDataXferObj
00040 //
00041 // Parameters:
00042 //
00043 //      CSimpleSite FAR *lpSite   - Pointer to source CSimpleSite
00044 //                                  this is the container site of the
00045 //                                  source OLE object to be transfered
00046 //
00047 // Return Value:
00048 //
00049 //      None
00050 //
00051 // Function Calls:
00052 //      Function                    Location
00053 //
00054 //      StgCreateDocfile            OLE API
00055 //      assert                      C Runtime
00056 //
00057 // Comments:
00058 //      reference count of CDataXferObj will be 0 on return.
00059 //
00060 //********************************************************************
00061
00062 CDataXferObj FAR * CDataXferObj::Create(
00063                 CSimpleSite FAR *lpSite,
00064                 POINTL FAR* pPointl
00065 )
00066 {
00067         CDataXferObj FAR * lpTemp = new CDataXferObj();
00068
00069         if (!lpTemp)
00070                 return NULL;
00071
00072         // create a sub-storage for the object
00073         HRESULT hErr = StgCreateDocfile(
00074                                 NULL,
00075                                 STGM_READWRITE | STGM_DIRECT | STGM_SHARE_EXCLUSIVE |
00076                                         STGM_DELETEONRELEASE,
00077                                 0,
00078                                 &lpTemp->m_lpObjStorage);
00079
00080         assert(hErr == NOERROR);
00081
00082         if (hErr != NOERROR)
00083                 {
00084                 delete lpTemp;
00085                 return NULL;
00086                 }
00087
00088         // Clone the source object
00089         if (lpSite->m_lpOleObject) {
00090                 // Object is loaded; ask the object to save into the new storage
00091                 LPPERSISTSTORAGE pPersistStorage;
00092
00093                 lpSite->m_lpOleObject->QueryInterface(IID_IPersistStorage,
00094                                 (LPVOID FAR*)&pPersistStorage);
00095                 assert(pPersistStorage);
00096                 OleSave(pPersistStorage, lpTemp->m_lpObjStorage, FALSE);
00097
00098                 // pass NULL so that object application won't forget the real stg
00099                 pPersistStorage->SaveCompleted(NULL);
00100                 pPersistStorage->Release();
00101         } else {
00102                 // Object not loaded so use cheaper IStorage CopyTo operation
00103                 lpSite->m_lpObjStorage->CopyTo(0, NULL, NULL, lpTemp->m_lpObjStorage);
00104         }
00105
00106         OleLoad(lpTemp->m_lpObjStorage, IID_IOleObject, NULL,
00107                         (LPVOID FAR*)&lpTemp->m_lpOleObject);
00108         assert(lpTemp->m_lpOleObject);
00109
00110         lpTemp->m_sizel = lpSite->m_sizel;
00111         if (pPointl)
00112                 lpTemp->m_pointl = *pPointl;
00113         else
00114                 lpTemp->m_pointl.x = lpTemp->m_pointl.y = 0;
00115         return lpTemp;
00116 }
00117
00118 //**********************************************************************
00119 //
00120 // CDataXferObj::CDataXferObj
00121 //
00122 // Purpose:
00123 //
00124 //      Constructor for CDataXferObj
00125 //
00126 // Parameters:
00127 //
00128 //      CSimpleDoc FAR *lpDoc   - Pointer to CSimpleDoc
00129 //
00130 // Return Value:
00131 //
00132 //      None
00133 //
00134 // Function Calls:
00135 //      Function                    Location
00136 //
00137 // Comments:
00138 //
00139 //********************************************************************
00140
00141 CDataXferObj::CDataXferObj (void)
00142 {
00143         // clear the reference count
00144         m_nCount = 0;
00145
00146         m_lpObjStorage = NULL;
00147         m_lpOleObject = NULL;
00148         m_sizel.cx = m_sizel.cy = 0;
00149         m_pointl.x = m_pointl.y = 0;
00150 }
00151
00152 //**********************************************************************
00153 //
00154 // CDataXferObj::~CDataXferObj
00155 //
00156 // Purpose:
00157 //
00158 //      Destructor for CDataXferObj
00159 //
00160 // Parameters:
00161 //
00162 //      None
00163 //
00164 // Return Value:
00165 //
00166 //      None
00167 //
00168 // Function Calls:
00169 //      Function                                Location
00170 //
00171 //      OutputDebugString                       Windows API
00172 //      IOleObject::Release                     Object
00173 //      IStorage::Release                       OLE API
00174 //
00175 // Comments:
00176 //
00177 //********************************************************************
00178
00179 CDataXferObj::~CDataXferObj ()
00180 {
00181         OutputDebugString ("In CDataXferObj's Destructor \r\n");
00182
00183         if (m_lpOleObject)
00184            {
00185            m_lpOleObject->Release();
00186            m_lpOleObject = NULL;
00187
00188            // Release the storage for this object
00189            m_lpObjStorage->Release();
00190            m_lpObjStorage = NULL;
00191            }
00192 }
00193
00194
00195
00196 //**********************************************************************
00197 //
00198 // CDataXferObj::QueryInterface
00199 //
00200 // Purpose:
00201 //
00202 //      Used for interface negotiation of the CDataXferObj instance
00203 //
00204 // Parameters:
00205 //
00206 //      REFIID riid         -   A reference to the interface that is
00207 //                              being queried.
00208 //
00209 //      LPVOID FAR* ppvObj  -   An out parameter to return a pointer to
00210 //                              the interface.
00211 //
00212 // Return Value:
00213 //
00214 //      S_OK            -   The interface is supported.
00215 //      E_NOINTERFACE   -   The interface is not supported
00216 //
00217 // Function Calls:
00218 //      Function                    Location
00219 //
00220 //      OutputDebugString           Windows API
00221 //      IsEqualIID                  OLE API
00222 //                   OLE API
00223 //      CDataXferObj::AddRef        DXFEROBJ.CPP
00224 //
00225 // Comments:
00226 //
00227 //
00228 //********************************************************************
00229
00230 STDMETHODIMP CDataXferObj::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
00231 {
00232         OutputDebugString("In CDataXferObj::QueryInterface\r\n");
00233
00234         if ( riid == IID_IUnknown || riid == IID_IDataObject)
00235                 {
00236                 AddRef();
00237                 *ppvObj = this;
00238                 return NOERROR;
00239                 }
00240
00241         // unknown interface requested
00242         *ppvObj = NULL;     // must set out pointer parameters to NULL
00243         return E_NOINTERFACE;
00244 }
00245
00246 //**********************************************************************
00247 //
00248 // CDataXferObj::AddRef
00249 //
00250 // Purpose:
00251 //
00252 //      Increments the reference count of the CDataXferObj instance
00253 //
00254 // Parameters:
00255 //
00256 //      None
00257 //
00258 // Return Value:
00259 //
00260 //      ULONG   -   The new reference count of the object
00261 //
00262 // Function Calls:
00263 //      Function                    Location
00264 //
00265 //      OutputDebugString           Windows API
00266 //
00267 // Comments:
00268 //
00269 //********************************************************************
00270
00271 STDMETHODIMP_(ULONG) CDataXferObj::AddRef()
00272 {
00273         OutputDebugString("In CDataXferObj::AddRef\r\n");
00274
00275         return ++m_nCount;
00276 }
00277
00278 //**********************************************************************
00279 //
00280 // CDataXferObj::Release
00281 //
00282 // Purpose:
00283 //
00284 //      Decrements the reference count of the CDataXferObj object
00285 //
00286 // Parameters:
00287 //
00288 //      None
00289 //
00290 // Return Value:
00291 //
00292 //      ULONG   -   The new reference count of the object.
00293 //
00294 // Function Calls:
00295 //      Function                    Location
00296 //
00297 //      OutputDebugString           Windows API
00298 //
00299 // Comments:
00300 //
00301 //********************************************************************
00302
00303 STDMETHODIMP_(ULONG) CDataXferObj::Release()
00304 {
00305         OutputDebugString("In CDataXferObj::Release\r\n");
00306
00307         if (--m_nCount == 0) {
00308                 delete this;
00309                 return 0;
00310         }
00311         return m_nCount;
00312 }
00313
00314
00315 /********************************************************************
00316 ** This IDataObject implementation is used for data transfer.
00317 **
00318 ** The following methods are NOT supported for data transfer:
00319 **      IDataObject::SetData    -- return E_NOTIMPL
00320 **      IDataObject::DAdvise    -- return OLE_E_ADVISENOTSUPPORTED
00321 **                 ::DUnadvise
00322 **                 ::EnumDAdvise
00323 **      IDataObject::GetCanonicalFormatEtc -- return E_NOTIMPL
00324 **                      (NOTE: must set pformatetcOut->ptd = NULL)
00325 *********************************************************************/
00326
00327
00328 //**********************************************************************
00329 //
00330 // CDataXferObj::QueryGetData
00331 //
00332 // Purpose:
00333 //
00334 //      Called to determine if our object supports a particular
00335 //      FORMATETC.
00336 //
00337 // Parameters:
00338 //
00339 //      LPFORMATETC pformatetc  - Pointer to the FORMATETC being queried for.
00340 //
00341 // Return Value:
00342 //
00343 //      DV_E_FORMATETC    - The FORMATETC is not supported
00344 //      S_OK              - The FORMATETC is supported.
00345 //
00346 //
00347 // Function Calls:
00348 //      Function                    Location
00349 //
00350 //      OutputDebugString           Windows API
00351 //                   OLE API
00352 //
00353 // Comments:
00354 //      we support the following formats:
00355 //          "Embedded Object"
00356 //          "Object Descriptor"
00357 //          CF_METAFILEPICT
00358 //
00359 //********************************************************************
00360 STDMETHODIMP CDataXferObj::QueryGetData (LPFORMATETC pformatetc)
00361 {
00362         SCODE sc = DV_E_FORMATETC;
00363
00364         OutputDebugString("In CDataXferObj::QueryGetData\r\n");
00365
00366         // check the validity of the formatetc.
00367
00368         if ( (pformatetc->cfFormat == g_cfEmbeddedObject) &&
00369                  (pformatetc->dwAspect == DVASPECT_CONTENT) &&
00370                  (pformatetc->tymed == TYMED_ISTORAGE) )
00371                 sc = S_OK;
00372
00373         else if ( (pformatetc->cfFormat == g_cfObjectDescriptor) &&
00374                  (pformatetc->dwAspect == DVASPECT_CONTENT) &&
00375                  (pformatetc->tymed == TYMED_HGLOBAL) )
00376                 sc = S_OK;
00377
00378         else if ( (pformatetc->cfFormat == CF_METAFILEPICT) &&
00379                  (pformatetc->dwAspect == DVASPECT_CONTENT) &&
00380                  (pformatetc->tymed == TYMED_MFPICT) )
00381                 sc = S_OK;
00382
00383         return sc;
00384 }
00385
00386
00387 STDMETHODIMP CDataXferObj::EnumFormatEtc(
00388                 DWORD dwDirection,
00389                 LPENUMFORMATETC FAR* ppenumFormatEtc
00390 )
00391 {
00392         SCODE sc = E_NOTIMPL;
00393
00394         OutputDebugString("In CDataXferObj::EnumFormatEtc\r\n");
00395         *ppenumFormatEtc = NULL;
00396
00397         if (dwDirection == DATADIR_GET) {
00398                 *ppenumFormatEtc = OleStdEnumFmtEtc_Create(
00399                                 sizeof(s_arrGetFmtEtcs)/sizeof(s_arrGetFmtEtcs[0]),
00400                                 s_arrGetFmtEtcs);
00401                 if (*ppenumFormatEtc == NULL)
00402                         sc = E_OUTOFMEMORY;
00403                 else
00404                         sc = S_OK;
00405         }
00406         return sc;
00407 }
00408
00409
00410 //**********************************************************************
00411 //
00412 // CDataXferObj::GetData
00413 //
00414 // Purpose:
00415 //
00416 //      Returns the data in the format specified in pformatetcIn.
00417 //
00418 // Parameters:
00419 //
00420 //      LPFORMATETC pformatetcIn    -   The format requested by the caller
00421 //
00422 //      LPSTGMEDIUM pmedium         -   The medium requested by the caller
00423 //
00424 // Return Value:
00425 //
00426 //      DV_E_FORMATETC    - Format not supported
00427 //      S_OK                - Success
00428 //
00429 // Function Calls:
00430 //      Function                        Location
00431 //
00432 //      OutputDebugString               Windows API
00433 //      OleStdGetOleObjectData          OLESTD API
00434 //      OleStdGetMetafilePictFromOleObject OLESTD API
00435 //                       OLE API
00436 //
00437 // Comments:
00438 //      we support GetData for the following formats:
00439 //          "Embedded Object"
00440 //          "Object Descriptor"
00441 //          CF_METAFILEPICT
00442 //
00443 //********************************************************************
00444
00445 STDMETHODIMP CDataXferObj::GetData (
00446                 LPFORMATETC pformatetcIn,
00447                 LPSTGMEDIUM pmedium
00448 )
00449 {
00450         SCODE sc = DV_E_FORMATETC;
00451
00452         OutputDebugString("In CDataXferObj::GetData\r\n");
00453
00454         // we must set all out pointer parameters to NULL. */
00455         pmedium->tymed = TYMED_NULL;
00456         pmedium->pUnkForRelease = NULL;    // we transfer ownership to caller
00457         pmedium->hGlobal = NULL;
00458
00459         // Check the FORMATETC and fill pmedium if valid.
00460         if ( (pformatetcIn->cfFormat == g_cfEmbeddedObject) &&
00461                  (pformatetcIn->dwAspect == DVASPECT_CONTENT) &&
00462                  (pformatetcIn->tymed == TYMED_ISTORAGE) ) {
00463                  LPPERSISTSTORAGE pPersistStorage;
00464
00465                  /* render CF_EMBEDDEDOBJECT by asking the object to save
00466                  **    into a temporary, DELETEONRELEASE IStorage allocated by us.
00467                  */
00468                  m_lpOleObject->QueryInterface(
00469                                  IID_IPersistStorage, (LPVOID FAR*)&pPersistStorage);
00470                  assert(pPersistStorage);
00471                  HRESULT hrErr = OleStdGetOleObjectData(
00472                                         pPersistStorage,
00473                                         pformatetcIn,
00474                                         pmedium,
00475                                         FALSE   /* fUseMemory -- (use file-base stg) */
00476                  );
00477                  pPersistStorage->Release();
00478                  sc =  hrErr ;
00479
00480         } else if ( (pformatetcIn->cfFormat == g_cfObjectDescriptor) &&
00481                  (pformatetcIn->dwAspect == DVASPECT_CONTENT) &&
00482                  (pformatetcIn->tymed == TYMED_HGLOBAL) ) {
00483
00484                  // render CF_OBJECTDESCRIPTOR data
00485                  pmedium->hGlobal = OleStdGetObjectDescriptorDataFromOleObject(
00486                                  m_lpOleObject,
00487                                  //@@WTK WIN32, UNICODE
00488                                  //"Simple OLE 2.0 Container",    // string to identify source
00489                                  OLESTR("Simple OLE 2.0 Container"),    // string to identify source
00490                                  DVASPECT_CONTENT,
00491                                  m_pointl,
00492                                  (LPSIZEL)&m_sizel
00493                         );
00494                  if (! pmedium->hGlobal)
00495                          sc = E_OUTOFMEMORY;
00496                  else {
00497                          pmedium->tymed = TYMED_HGLOBAL;
00498                          sc = S_OK;
00499                  }
00500
00501         } else if ( (pformatetcIn->cfFormat == CF_METAFILEPICT) &&
00502                  (pformatetcIn->dwAspect == DVASPECT_CONTENT) &&
00503                  (pformatetcIn->tymed == TYMED_MFPICT) ) {
00504
00505                  // render CF_METAFILEPICT by drawing the object into a metafile DC
00506                  pmedium->hGlobal = OleStdGetMetafilePictFromOleObject(
00507                                  m_lpOleObject, DVASPECT_CONTENT, NULL, pformatetcIn->ptd);
00508                  if (! pmedium->hGlobal)
00509                          sc = E_OUTOFMEMORY;
00510                  else {
00511                          pmedium->tymed = TYMED_MFPICT;
00512                          sc = S_OK;
00513                  }
00514         }
00515
00516         return  sc ;
00517 }
00518
00519 //**********************************************************************
00520 //
00521 // CDataXferObj::GetDataHere
00522 //
00523 // Purpose:
00524 //
00525 //      Called to get a data format in a caller supplied location
00526 //
00527 // Parameters:
00528 //
00529 //      LPFORMATETC pformatetc  - FORMATETC requested
00530 //
00531 //      LPSTGMEDIUM pmedium     - Medium to return the data
00532 //
00533 // Return Value:
00534 //
00535 //      DATA_E_FORMATETC    - We don't support the requested format
00536 //
00537 // Function Calls:
00538 //      Function                    Location
00539 //
00540 //      OutputDebugString           Windows API
00541 //      OleStdGetOleObjectData      OLESTD API
00542 //
00543 // Comments:
00544 //
00545 //********************************************************************
00546
00547 STDMETHODIMP CDataXferObj::GetDataHere (
00548                 LPFORMATETC pformatetc,
00549                 LPSTGMEDIUM pmedium
00550 )
00551 {
00552         SCODE sc = DV_E_FORMATETC;
00553
00554         OutputDebugString("In CDataXferObj::GetDataHere\r\n");
00555
00556         // NOTE: pmedium is an IN parameter. we should NOT set
00557         //           pmedium->pUnkForRelease to NULL
00558
00559         // Check the FORMATETC and fill pmedium if valid.
00560         if ( (pformatetc->cfFormat == g_cfEmbeddedObject) &&
00561                  (pformatetc->dwAspect == DVASPECT_CONTENT) &&
00562                  (pformatetc->tymed == TYMED_ISTORAGE) ) {
00563                  LPPERSISTSTORAGE pPersistStorage;
00564
00565                  /* render CF_EMBEDDEDOBJECT by asking the object to save
00566                  **    into the IStorage allocated by the caller.
00567                  */
00568                  m_lpOleObject->QueryInterface(
00569                                  IID_IPersistStorage, (LPVOID FAR*)&pPersistStorage);
00570                  assert(pPersistStorage);
00571                  HRESULT hrErr = OleStdGetOleObjectData(
00572                                  pPersistStorage, pformatetc, pmedium,0 /*fUseMemory--N/A*/ );
00573                  pPersistStorage->Release();
00574                  sc =  hrErr ;
00575         }
00576         return  sc ;
00577 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/foldernode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

foldernode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CFolderNode class.  This node is a child of
00014 //                CDeviceNode.  It represents a Virtual Storage folder
00015 //
00016 //
00017
00018
00019 #ifndef _CLASS_CFOLDERNODE_
00020 #define _CLASS_CFOLDERNODE_
00021
00022 #include "Globals.h"
00023 #include "BaseNode.h"
00024 #include "VirtualFile.h"     // Result item children of this node
00025 #include "LListImpl.h"       // Linked list class
00026
00027
00028 class CComponentData;        // References
00029
00030 //---------------------------------------------------------------------------
00031 class CFolderNode : public CBaseNode
00032 {
00033   public:
00034     CFolderNode();
00035     virtual ~CFolderNode();
00036
00037     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00038
00039   ///////////////////////////////////////////////////////////////////////////
00040   // Virtual methods
00041   public:
00042     ULONG   GetNodeType() { return NODETYPE_FOLDER; }
00043     GUID&   GetNodeGUID() { return thisGUID; }
00044
00045     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00046     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00047     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00048
00049   ///////////////////////////////////////////////////////////////////////////
00050   // Property Page methods.  This node does not support Property Pages
00051   public:
00052     HRESULT QueryForPropertyPage()
00053             { return E_NOTIMPL; }
00054
00055     HRESULT CreatePropertyPages( LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle )
00056             { return E_NOTIMPL; }
00057
00058     HRESULT GetWatermarks( HBITMAP __RPC_FAR *lphWatermark,
00059                            HBITMAP __RPC_FAR *lphHeader,
00060                            HPALETTE __RPC_FAR *lphPalette,
00061                            BOOL __RPC_FAR *bStretch )
00062             { return E_NOTIMPL; }
00063
00064
00065   ///////////////////////////////////////////////////////////////////////////
00066   //  Notification handlers
00067   public:
00068     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00069     HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00070     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00071     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00072
00073     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00074     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00075             { return E_NOTIMPL; }
00076
00077   ///////////////////////////////////////////////////////////////////////////
00078   //  Context Menu methods
00079   public:
00080     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00081     HRESULT Command( long lCommandID );
00082
00083   ///////////////////////////////////////////////////////////////////////////
00084   // Private helpers
00085   private:
00086     HRESULT RefreshNodeList();
00087     VOID    RemoveNodes();
00088     HRESULT EnumerateResultItems( LPRESULTDATA ipResultData );
00089     HRESULT AddVirtualFile( NODE_PROPERTIES* pProps = NULL );
00090
00091   private:
00092     static GUID  thisGUID;
00093     DWORD        m_dwAttributes;
00094
00095     CLListImpl<CVirtualFile*,CVirtualFile*>  m_NodeList;
00096     CComponentData* m_pCompData;
00097     HWND            m_hMessageWnd;     // Our message handler
00098
00099   public:
00100     HWND   m_hAddVFileDlg;             // Instance of AddDeviceDlg
00101
00102     VOID   RemoveVirtualFile( CVirtualFile* pDeadNode );
00103
00104     static LRESULT CALLBACK FolderNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00105
00106   // XPROPPAGE: Support for attributes
00107   public:
00108     BOOL    IsAttributeSet( DWORD dwAttribute ) { return FALSE; }
00109     VOID    SetAttribute( DWORD dwAttribute ) {}
00110     VOID    RemoveAttribute( DWORD dwAttribute ) {}
00111     LPWSTR  GetAttributeString() { return m_pAttributeStr; }
00112     DWORD   GetAttributes() { return 0; }
00113     LPWSTR  GetObjectPath() { return NULL; }
00114
00115 };
00116
00117 #endif //_CLASS_CFOLDERNODE_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/plgterm.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

plgterm.h

Go to the documentation of this file.
00001 // PlgTerm.h: interface for the CPlgTermSample class.
00002 //
00003 //////////////////////////////////////////////////////////////////////
00004
00005 #if !defined(AFX_TERMSAMPLE_H__4FD57957_2DF1_4F78_AB2C_5E365EFD9CC8__INCLUDED_)
00006 #define AFX_TERMSAMPLE_H__4FD57957_2DF1_4F78_AB2C_5E365EFD9CC8__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #define SZTERMNAME    _T("Pluggable Sample Terminal")
00013
00014 #include "PlgTermPriv.h"
00015
00016
00017 class CPlgTermSample  :
00018     public CComCoClass<CPlgTermSample, &CLSID_PlgTermSample>,
00019     public ITPluggableTerminalEventSinkRegistration,
00020     public ITPluggableTerminalInitialization,
00021     public ITPlgPrivEventSink,
00022     public CMSPObjectSafetyImpl,
00023     public CSingleFilterTerminal
00024 {
00025
00026 public:
00027
00028     DECLARE_REGISTRY_RESOURCEID(IDR_PLG_TEST)
00029
00030
00031 BEGIN_COM_MAP(CPlgTermSample)
00032     COM_INTERFACE_ENTRY(ITPluggableTerminalEventSinkRegistration)
00033     COM_INTERFACE_ENTRY(ITPluggableTerminalInitialization)
00034     COM_INTERFACE_ENTRY(ITPlgPrivEventSink)
00035     COM_INTERFACE_ENTRY(IObjectSafety)
00036     COM_INTERFACE_ENTRY2(IDispatch, ITTerminal)
00037     COM_INTERFACE_ENTRY_CHAIN(CSingleFilterTerminal)
00038     COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
00039 END_COM_MAP()
00040
00041     CPlgTermSample();
00042   virtual ~CPlgTermSample();
00043
00044     DECLARE_NOT_AGGREGATABLE(CPlgTermSample)
00045     DECLARE_GET_CONTROLLING_UNKNOWN()
00046
00047     virtual HRESULT FinalConstruct(void);
00048
00049     //
00050     // ITTerminal methods - is implemented in base class
00051     //
00052
00053 //    STDMETHOD(get_TerminalClass)(OUT  BSTR *pbstrTerminalClass);
00054 //    STDMETHOD(get_TerminalType) (OUT  TERMINAL_TYPE *pTerminalType);
00055 //    STDMETHOD(get_State)        (OUT  TERMINAL_STATE *pTerminalState);
00056 //    STDMETHOD(get_Name)         (OUT  BSTR *pVal);
00057 //    STDMETHOD(get_MediaType)    (OUT  long * plMediaType);
00058 //    STDMETHOD(get_Direction)    (OUT  TERMINAL_DIRECTION *pDirection);
00059
00060
00061     //
00062     // implementations of CBaseTerminal methods
00063     //
00064
00065     virtual HRESULT AddFiltersToGraph();
00066
00067     virtual DWORD GetSupportedMediaTypes();
00068
00069     //
00070     // implementations of CSingleFilterTerminal methods - is implemented in base class
00071     //
00072
00073 //  virtual HRESULT GetNumExposedPins(
00074 //        IN   IGraphBuilder * pGraph,
00075 //        OUT  DWORD         * pdwNumPins);
00076
00077
00078   //
00079     // ITPluggableTerminalInitialization method
00080     //
00081
00082     virtual HRESULT STDMETHODCALLTYPE InitializeDynamic(
00083         IN  IID                   iidTerminalClass,
00084         IN  DWORD                 dwMediaType,
00085         IN  TERMINAL_DIRECTION    Direction,
00086         IN  MSP_HANDLE            htAddress
00087         );
00088
00089     //
00090     // overriding IObjectSafety methods. we are only safe if properly
00091     // initialized by terminal manager, so these methods will fail if this
00092     // is not the case.
00093     //
00094
00095     STDMETHOD(SetInterfaceSafetyOptions)(REFIID riid,
00096                                          DWORD dwOptionSetMask,
00097                                          DWORD dwEnabledOptions);
00098
00099     STDMETHOD(GetInterfaceSafetyOptions)(REFIID riid,
00100                                          DWORD *pdwSupportedOptions,
00101                                          DWORD *pdwEnabledOptions);
00102
00103
00104   //
00105     // ITPlgPrivEventSink methods
00106     //
00107
00108     STDMETHOD (FireEvent)(long lEventCode);
00109
00110     //
00111     // ITPluggableTerminalEventSinkRegistration methods
00112     //
00113
00114     STDMETHOD(RegisterSink)(
00115         IN  ITPluggableTerminalEventSink *pSink
00116         );
00117
00118     STDMETHOD(UnregisterSink)();
00119
00120
00121 private:
00122     // --- Helper functions ---
00123     HRESULT SetTerminalInfo();
00124
00125     HRESULT CreateFilter();
00126
00127     HRESULT FindPin();
00128
00129
00130 private:
00131     //
00132     // sink for firing terminal events
00133     //
00134
00135     ITPluggableTerminalEventSink* m_pEventSink;
00136
00137   //
00138   // pointer to the free threaded marshaler
00139   //
00140
00141   IUnknown*            m_pFTM;
00142
00143   //
00144     // this terminal should only be instantiated in the context of terminal
00145     // manager. the object will only be safe for scripting if it has been
00146     // InitializeDynamic'ed.
00147     //
00148     // this flag will be set when InitializeDynamic succeeds
00149     //
00150
00151     BOOL m_bKnownSafeContext;
00152
00153 };
00154
00155 #endif // !defined(AFX_TERMSAMPLE_H__4FD57957_2DF1_4F78_AB2C_5E365EFD9CC8__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/Inc/AppMemi.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • Inc

AppMemi.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1995 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 Header Name:
00011
00012     appmem.h
00013
00014 Abstract:
00015
00016     Contains the global definitions for use by the performance DLL and
00017     the DLL used by the application to allocate and track memory. The
00018     definitions in this file ARE NOT used by the application programmer
00019
00020 --*/
00021 #ifndef _APPMEM_H_
00022 #define _APPMEM_H_
00023
00024 #define MAX_SIZEOF_INSTANCE_NAME    32
00025
00026 typedef struct _APPMEM_INSTANCE
00027 {
00028    DWORD   dwOffsetOfNext;     // offset from mem base to next item in list
00029    DWORD   dwProcessId;        // id of process using this instance
00030    HANDLE  hProcessHeap;       // handle of process's default heap
00031    DWORD   dwApplicationBytes; // current count of heap bytes allocated
00032                                //  by the app mem allocation DLL functions
00033    DWORD   dwAllocCalls;       // number of memory allocation calls
00034    DWORD   dwReAllocCalls;     // number of Re-Allocation calls
00035    DWORD   dwFreeCalls;        // number of memory free calls
00036    WCHAR   wcszInstanceName[MAX_SIZEOF_INSTANCE_NAME]; // SZ instance name
00037    DWORD   dwReserved1;        // unused
00038    DWORD   dwReserved2;        // unused
00039 } APPMEM_INSTANCE, *PAPPMEM_INSTANCE;
00040
00041 #define SHARED_MEMORY_ITEM_COUNT    100
00042 #define SHARED_MEMORY_OBJECT_SIZE   (sizeof(PDWORD) + (sizeof(PAPPMEM_INSTANCE) * 2) + (SHARED_MEMORY_ITEM_COUNT * sizeof(APPMEM_INSTANCE)))
00043 #define SHARED_MEMORY_OBJECT_NAME   (TEXT("APPMEM_PERF_DATA"))
00044
00045 #define SHARED_MEMORY_MUTEX_NAME    (TEXT("APPMEM_PERF_DATA_MUTEX"))
00046 #define SHARED_MEMORY_MUTEX_TIMEOUT ((DWORD)1000L)
00047
00048 typedef struct _APPMEM_DATA_HEADER
00049 {
00050    DWORD               dwInstanceCount;        // number of entries In Use
00051    DWORD               dwFirstInUseOffset;     // offset from mem base
00052    DWORD               dwFirstFreeOffset;      // offset from mem base
00053 } APPMEM_DATA_HEADER, *PAPPMEM_DATA_HEADER;
00054
00055 #define     FIRST_FREE(base)    ((PAPPMEM_INSTANCE)((LPBYTE)(base) + ((PAPPMEM_DATA_HEADER)(base))->dwFirstFreeOffset))
00056 #define     FIRST_INUSE(base)   ((PAPPMEM_INSTANCE)((LPBYTE)(base) + ((PAPPMEM_DATA_HEADER)(base))->dwFirstInUseOffset))
00057 #define     APPMEM_INST(base, offset)   ((PAPPMEM_INSTANCE)((LPBYTE)(base) + (DWORD)(offset)))
00058
00059 LONG
00060 _stdcall
00061 GetSharedMemoryDataHeader (
00062                           IN  HANDLE              *phAppMemSharedMemory,
00063                           IN  PAPPMEM_DATA_HEADER *pHeader,
00064                           IN  BOOL                bReadOnlyAccess
00065                           );
00066
00067
00068 #endif //_APPMEM_H_
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAddFolderDlg Member List

This is the complete list of members for CAddFolderDlg, including all inherited members.
CAddFolderDlg(ULONG nTemplate, HWND hParentWnd) | CAddFolderDlg |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
m_hParentWnd | CAddFolderDlg | [private]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddFolderDlg | [private, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddFolderDlg | [private, virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAddFolderDlg | [virtual]
~CAddFolderDlg() | CAddFolderDlg |
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
Generated on Wed Nov 13 2024 16:55:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CacheProxySamplePlugin::IWMSCacheItemCollectionImpl Member List

This is the complete list of members for CacheProxySamplePlugin::IWMSCacheItemCollectionImpl, including all inherited members.
DT | CacheProxySamplePlugin::IWMSCacheItemCollectionImpl | [private]
GetCount(out int count) | CacheProxySamplePlugin::IWMSCacheItemCollectionImpl | [inline, private]
GetItem(int index, out IWMSCacheItemDescriptor cacheItem) | CacheProxySamplePlugin::IWMSCacheItemCollectionImpl | [inline, private]
IWMSCacheItemCollectionImpl(CacheProxyPlugin plugin, DataTable dt) | CacheProxySamplePlugin::IWMSCacheItemCollectionImpl | [inline]
Plugin | CacheProxySamplePlugin::IWMSCacheItemCollectionImpl |
strSel | CacheProxySamplePlugin::IWMSCacheItemCollectionImpl | [private, static]
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPort/MQPort.Cpp Source File

  • NetDS
  • MessageQueuing
  • MQPort

MQPort.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // Purpose:
00014 //   This console application sample demonstrates how to use NT
00015 //   completion ports in MSMQ to asynchronously receive messages in an
00016 //   efficient manner. This mechanism is scalable in the number of
00017 //   queues and messages by adding more processors and threads.
00018 //   Similarly, generic completion port handlers can be provided to
00019 //   handle other NT resources as well as queues.
00020 //
00021 //   Both the MSMQ COM components and the MQ API are used in this program.
00022 //   Note that the COM components are used for creating a queue, open
00023 //   the queue, and sending messages. Conversely, the MQ API is used
00024 //   to implement completion port-based asynchronous receive.
00025 //
00026 // Requirements:
00027 //   VC5 is required.
00028 //   MSMQ must be installed. Specifically mqoa.dll must be registered
00029 //   and on the path.
00030 //   Project settings:
00031 //     - The include path must include the location of mq.h:
00032 //          e.g. ...\msmq\sdk\include
00033 //     - The link library path must include the location of mqrt.lib:
00034 //          e.g ...\msmq\sdk\lib
00035 //
00036 // Overview:
00037 //   The following steps comprise this sample:
00038 //     - A global MSMQQueueInfo object is used to reference the sample's
00039 //       single queue.
00040 //     - Initialize OLE.
00041 //     - Create a new completion port.
00042 //     - Create a bunch of threads with a generic CompletionPortThread start
00043 //       routine parameterized with the completion port handle from the previous step.
00044 //     - Open the queue and associate its handle with the completion port.
00045 //       - Note that the queue is deleted and recreated if already exists;
00046 //         otherwise, a new queue is created.
00047 //     - Enable a bunch of asynchronous message receive requests on the queue.
00048 //       Since the queue is associated with the completion port, each of these
00049 //       requests results in the CompletionPortThread handler being notified
00050 //       asynchronously by NT when an async receive message operation "completes."
00051 //       - Note that the NT scheduler will select the "best" available completion
00052 //         port thread that is synchronously waiting for a completion notification.
00053 //     - Finally, to test the completion port handlers, a bunch of messages is sent
00054 //       to the queue and the program hibernates.
00055 //     - To exit, just kill the console application window.
00056 //
00057 // Warning:  *** Only limited error checking and handling are provided. ***
00058 //
00059 #include <windows.h>
00060 #include <stdio.h>
00061 #import <mqoa.tlb> no_namespace
00062 #include <mq.h>
00063
00064 //
00065 // Global queue object.
00066 //
00067 IMSMQQueueInfoPtr g_qinfo;
00068
00069 //
00070 // Structure containing both an OVERLAPPED structure and other MSMQ
00071 // application-specific data.
00072 //
00073 struct RECEIVE_CONTEXT
00074 {
00075     OVERLAPPED ov;
00076     HANDLE hQueue;
00077     MQMSGPROPS *pmsgprops;
00078 };
00079
00080
00081 //
00082 // AllocMsgProps
00083 //  Parameters:
00084 //    prc      IN  receive context containing an OVERLAPPED structure and
00085 //                 additional MSMQ-specific information: queue handle and
00086 //                 message properties.
00087 //
00088 //  Purpose:
00089 //    Allocates a property identifier array for the PROPID_M_APPSPECIFIC property.
00090 //    This is just because we're lazy and don't want to allocate/deallocate
00091 //    buffers for the message body, label, etc. The PROPID_M_APPSPECIFIC
00092 //    property allows us to "uniquely" stamp each messsages for identification
00093 //    purposes (in this case, with an ordinal number).
00094 //
00095 void AllocMsgProps(RECEIVE_CONTEXT *prc)
00096 {
00097     int cProp = 1;
00098     prc->pmsgprops->aPropID = new MSGPROPID[cProp];
00099     prc->pmsgprops->aPropVar = new MQPROPVARIANT[cProp];
00100     prc->pmsgprops->aStatus = new HRESULT[cProp];
00101
00102     int iProp = 0;
00103     prc->pmsgprops->aPropID[iProp] = PROPID_M_APPSPECIFIC;
00104     prc->pmsgprops->aPropVar[iProp].vt = VT_UI4;
00105     prc->pmsgprops->cProp = cProp;
00106 }
00107
00108 //
00109 // HandleReceivedMessage:
00110 //  Parameters:
00111 //    prc      IN  receive context containing an OVERLAPPED structure and
00112 //                 additional MSMQ-specific information: queue handle and
00113 //                 message properties.
00114 //
00115 //  Purpose:
00116 //    Inspects the value of HRESULT returned by the MSMQ device driver
00117 //    in the OVERLAPPED structure. Provides more detailed last-error
00118 //    information. Then displays the message -- in this case just the
00119 //    message's PROPID_M_APPSPECIFIC property.
00120 //
00121 void HandleReceivedMessage(RECEIVE_CONTEXT* prc)
00122 {
00123     //
00124     // Get receive message final status.
00125     //
00126     HRESULT rc = MQGetOverlappedResult(&prc->ov);
00127
00128     //
00129     // Handle the status and message.
00130     //
00131     if (SUCCEEDED(rc))
00132     {
00133       //
00134       // Get the received message. PROPID_M_ APPSPECIFIC is the single property
00135       // that we set and now retrieve.
00136       //
00137       long lAppSpecific = prc->pmsgprops->aPropVar[0].lVal;
00138       printf("Thread id: %x Message received with the app-specific data: %d\n",
00139         GetCurrentThreadId(),
00140         lAppSpecific);
00141     }
00142 }
00143
00144 //
00145 // HandleErrors
00146 // Parameters:
00147 //    _com_error
00148 //
00149 // Purpose:
00150 //   Displays an error and aborts further execution.
00151 //
00152 void HandleErrors(_com_error comerr)
00153 {
00154     HRESULT hr = comerr.Error();
00155     printf("An error occurred. Error code: %x\nExiting...", hr);
00156     exit(hr);
00157 };
00158
00159 //
00160 // EnableAsyncReceive:
00161 //  Parameters:
00162 //    prc      IN  receive context containing an OVERLAPPED structure and
00163 //                 additional MSMQ-specific information: queue handle and
00164 //                 message properties.
00165 //
00166 //  Purpose:
00167 //    Makes an MSMQ asynchronous receive request, specifying
00168 //    an OVERLAPPED structure with the appropriate queue, which
00169 //    has been associated already with a completion port.
00170 //
00171 HRESULT EnableAsyncReceive(RECEIVE_CONTEXT* prc)
00172 {
00173     //
00174     // Re-enable asynchronous receiving.
00175     //
00176     return MQReceiveMessage(
00177             prc->hQueue,
00178             INFINITE,               // Time-out interval
00179             MQ_ACTION_RECEIVE,
00180             prc->pmsgprops,
00181             &prc->ov,               // OVERLAPPED
00182             NULL,                   // No callback function
00183             NULL,                   // No cursor
00184             NULL);                  // No transaction pointer
00185 }
00186
00187 //
00188 // CompletionPortThread:
00189 //  Parameters:
00190 //    lParam     IN  completion port handle.
00191 //
00192 //  Purpose:
00193 //    Start routine for each worker thread.
00194 //    Waits for the completion port to complete. When notification arrives,
00195 //    handles the received message and re-enables MSMQ asynchronous receiving.
00196 //
00197 DWORD WINAPI CompletionPortThread(LPVOID lParam)
00198 {
00199     HANDLE hPort = (HANDLE)lParam;
00200     HRESULT hr = NOERROR;
00201
00202     for (;;)
00203     {
00204       //
00205       // Wait for completion notification.
00206       //
00207       DWORD dwNoOfBytes;
00208       ULONG_PTR dwKey;
00209       OVERLAPPED* pov = NULL;
00210       BOOL fSuccess = GetQueuedCompletionStatus(
00211                           hPort,
00212                           &dwNoOfBytes,
00213                           &dwKey,
00214                           &pov,
00215                           INFINITE    // Notification time-out interval
00216                           );
00217       //
00218       // A NULL value of pov is returned if completion port notification
00219       // failed. In this case, fSuccess is guaranteed to be FALSE.
00220       // When fSuccess is TRUE, the OVERLAPPED structure may still
00221       // contain an error code. It is inspected in HandleReceivedMessage.
00222       //
00223       if (pov == NULL)
00224       {
00225         //
00226         // Unrecoverable error occurred in the completion port. Wait for the next notification.
00227         //
00228         continue;
00229       }
00230       RECEIVE_CONTEXT* prc = CONTAINING_RECORD(pov, RECEIVE_CONTEXT, ov);
00231       HandleReceivedMessage(prc);
00232
00233       //
00234       // Start the next message receive operation.
00235       //
00236       hr = EnableAsyncReceive(prc);
00237       if (FAILED(hr))
00238         return hr;
00239     }
00240
00241     //
00242     // The queue is unreachable.
00243     //
00244     return 0;
00245 }
00246
00247
00248 //
00249 // CreateWorkingThreads
00250 //  Parameters:
00251 //    hPort   IN    completion port handle.
00252 //
00253 //  Purpose:
00254 //    Creates a certain number of worker threads whose start routine
00255 //    is CompletionPortThread, associating each of them with
00256 //    the incoming port handle.
00257 //
00258 void CreateWorkingThreads(HANDLE hPort)
00259 {
00260     //
00261     // Start several threads to handle the completion port.
00262     // The number of threads that you create depends on number of processors
00263     // in the system and the expected serialization in the working thread logic.
00264     //
00265     const int xNumberOfProcessors = 1;
00266     const int xNumberOfThreads = 2 * xNumberOfProcessors;
00267
00268     for (int i = 0; i < xNumberOfThreads; i++)
00269     {
00270       DWORD dwThreadId;
00271       HANDLE hThread = CreateThread(
00272                           NULL,                   // Thread security
00273                           0,                      // Default stack
00274                           CompletionPortThread,   // Start routine
00275                           hPort,                  // Start routine parameter
00276                           0,                      // Run immediately
00277                           &dwThreadId             // Thread identifier
00278                           );
00279       CloseHandle(hThread);
00280     }
00281 }
00282
00283 //
00284 // OpenQueueForAsyncReceiveWithCompletionPort
00285 //  Parameters:
00286 //    hPort   IN    completion port handle
00287 //
00288 //  Purpose:
00289 //    Deletes and recreates the existing queue if already exists;
00290 //    otherwise, creates a new queue which is then opened for receive.
00291 //    Finally, the newly opened queue handle is associated with the incoming
00292 //    completion port.
00293 //
00294 IMSMQQueuePtr OpenQueueForAsyncReceiveWithCompletionPort(
00295     HANDLE hPort)
00296 {
00297     IMSMQQueuePtr qRec;
00298
00299     //
00300     // Delete the existing queue, ignoring errors.
00301     //
00302     try {
00303       g_qinfo->Delete();
00304     }
00305     catch(_com_error comerr) {
00306     };
00307
00308     //
00309     // Recreate the queue.
00310     //
00311     g_qinfo->Create();
00312     //
00313     // Open the queue to receive messages from it.
00314     //
00315     qRec = g_qinfo->Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE);
00316
00317     //
00318     // Associate the queue with the completion port.
00319     //
00320     CreateIoCompletionPort(
00321       (HANDLE)qRec->Handle,       // Queue to associate port with
00322       hPort,                      // Port handle
00323       0,
00324       0);
00325     return qRec;
00326 }
00327
00328 //
00329 // SendSomeMessages
00330 //  Parameters:
00331 //    cMsgs     IN    number of messages to send.
00332 //
00333 //  Purpose:
00334 //    Sends a bunch of messages to the queue.
00335 //
00336 void SendSomeMessages(int cMsgs)
00337 {
00338     IMSMQQueuePtr qSend;
00339     IMSMQMessagePtr msg("MSMQ.MSMQMessage");
00340
00341     //
00342     // Open the queue for sending messages.
00343     //
00344     qSend = g_qinfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE);
00345
00346     //
00347     // Send a bunch of messages.
00348     //
00349     for (int i = 0; i < cMsgs; i++)
00350     {
00351       msg->AppSpecific = i;
00352       msg->Send(qSend);
00353     }
00354 }
00355
00356 //
00357 // InitiateAsyncReceiveWithCompletionPort
00358 //  Parameters:
00359 //    q         IN    queue object to enable asynchronous messaging on
00360 //
00361 //  Purpose:
00362 //    Creates several (a bunch!) MSMQ asynchronous message receive requests. Each
00363 //    one is completion-port based.
00364 //
00365 HRESULT InitiateAsyncReceiveWithCompletionPort(IMSMQQueuePtr q)
00366 {
00367     HRESULT hr = NOERROR;
00368
00369     //
00370     // Kick off several overlapped receives.
00371     //
00372     const cOverlappedReceives = 1;
00373
00374     for (int i = 0; i < cOverlappedReceives; i++)
00375     {
00376       //
00377       // Allocate and set a receive context.
00378       //
00379       RECEIVE_CONTEXT* prc = new RECEIVE_CONTEXT;
00380       memset(prc, 0, sizeof(RECEIVE_CONTEXT));
00381       prc->hQueue = (HANDLE)q->Handle;
00382       prc->pmsgprops = new MQMSGPROPS;
00383       AllocMsgProps(prc);
00384       hr = EnableAsyncReceive(prc);
00385       if (FAILED(hr)) {
00386         return hr;
00387       }
00388     }
00389     return hr;
00390 }
00391
00392
00393 //
00394 // Check whether the local computer has access to the directory service (DS).
00395 //
00396 short DetectDsConnection(void)
00397 {
00398     HRESULT hresult;
00399     IMSMQApplication2Ptr pApp;
00400
00401     hresult = CoInitialize(NULL);
00402     if (FAILED(hresult))
00403     {
00404         printf("\nCOM cannot be initialized. Error code: %d\n", hresult);
00405         exit(1);
00406     }
00407
00408     hresult = pApp.CreateInstance(__uuidof(MSMQApplication));
00409     if (FAILED(hresult))
00410     {
00411         printf("\nThe MSMQApplication object cannot be created. Error code: %d\n", hresult);
00412         exit(1);
00413     }
00414
00415     return pApp->GetIsDsEnabled();
00416 }
00417
00418
00419 //
00420 // MAIN
00421 //
00422 int main()
00423 {
00424     HRESULT hr;
00425     char strPathName[522];
00426     char strComputerName[256];
00427     char strQueueName[256];
00428     int dNoOfMessages;
00429
00430     //
00431     // Initialize OLE.
00432     //
00433     hr = OleInitialize(NULL);
00434     if (FAILED(hr))
00435         return hr;
00436
00437     try
00438     {
00439         g_qinfo = IMSMQQueueInfoPtr("MSMQ.MSMQQueueInfo");
00440         IMSMQQueuePtr qRec;
00441
00442         //
00443         // Create a new completion port.
00444         //
00445         HANDLE hPort = CreateIoCompletionPort(
00446                       INVALID_HANDLE_VALUE,     // Create a new port.
00447                       NULL,                     // Create a new port.
00448                       0,
00449                       0);
00450
00451         //
00452         // Create some worker threads to handle asynchronous receive operations.
00453         //
00454         CreateWorkingThreads(hPort);
00455
00456         //
00457         // Get a queue path name.
00458         //
00459         printf("\nEnter queue computer name: ");
00460     if (fgets(strComputerName, 255, stdin) == NULL)
00461     {
00462       printf("\nInvalid input was entered.\n");
00463             exit(1);
00464     }
00465     //
00466     // Remove the \n at the end of the string created by fgets.
00467     //
00468     if(strComputerName[strlen(strComputerName) - 1] == '\n')
00469     {
00470       strComputerName[strlen(strComputerName) - 1] = '\0';
00471     }
00472
00473         printf("\nEnter queue name: ");
00474     if (fgets(strQueueName, 255, stdin) == NULL)
00475     {
00476       printf("\nInvalid input was entered.\n");
00477             exit(1);
00478     }
00479     if(strQueueName[strlen(strQueueName) - 1] == '\n')
00480     {
00481       strQueueName[strlen(strQueueName) - 1] = '\0';
00482     }
00483
00484         if(strComputerName[0] == 0 || strQueueName[0] == 0)
00485         {
00486             printf("\nInvalid parameters were supplied. Exiting...\n");
00487             exit(1);
00488         }
00489
00490         //
00491         // Open the queue and associate it with the completion port.
00492         //
00493     int nRes, nSize;
00494     nSize = (sizeof(strComputerName)/sizeof(strComputerName[0])) + (sizeof(strQueueName)/sizeof(strQueueName[0])) -1;
00495
00496         if(DetectDsConnection())
00497         //
00498     // Access to the DS is enabled, so work with a public queue.
00499         //
00500     {
00501       nRes = _snprintf(strPathName, nSize+1, "%s\\%s", strComputerName, strQueueName);
00502         }
00503
00504         else
00505     //
00506         // Access to the DS is disabled, so work with a private queue.
00507         //
00508     {
00509       nRes = _snprintf(strPathName, nSize+10, "%s\\private$\\%s", strComputerName, strQueueName);
00510         }
00511
00512     if(nRes < 0)
00513     {
00514       printf("The path name is too long for the buffer specified.\n");
00515       exit(1);
00516     }
00517
00518     strPathName[nRes] = '\0';
00519         g_qinfo->PathName = strPathName;
00520         qRec = OpenQueueForAsyncReceiveWithCompletionPort(hPort);
00521
00522         //
00523         // Invoke MSMQ to start an asynchronous receive operation on the queue several times.
00524         //
00525         hr = InitiateAsyncReceiveWithCompletionPort(qRec);
00526         if (FAILED(hr)) {
00527         return hr;
00528         }
00529
00530         //
00531         // Send some messages.
00532         //
00533         printf("\nEnter the number of messages to send: ");
00534     int iRes = scanf("%d", &dNoOfMessages);
00535     if (iRes == 0 || iRes == EOF)
00536     {
00537       printf("\nInvalid input was entered.\n");
00538       exit(1);
00539     }
00540
00541         SendSomeMessages(dNoOfMessages);
00542
00543         //
00544         // Wait forever. Kill the application manually to exit.
00545         //
00546         printf("\nKill the application manually to exit.\n");
00547         Sleep(INFINITE);
00548         }
00549     catch(_com_error comerr) {
00550       HandleErrors(comerr);
00551     };
00552     return 0;
00553 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COptionsError Member List

This is the complete list of members for COptionsError, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
COptionsError() | COptionsError |
CPropPageLite(UINT uIDD, TCHAR *ptszTitle=NULL) | CPropPageLite |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetParent() | CPropPageLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pCPropSheet | CPropPageLite |
m_psPage | CPropPageLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnApply() | COptionsError | [virtual]
OnCancel() | CPropPageLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | COptionsError | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | COptionsError | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnKillActive() | CPropPageLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CPropPageLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnReset() | CPropPageLite | [virtual]
OnSetActive() | CPropPageLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
PropPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [static]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetParent(CPropSheetLite *pCPropSheetLite) | CPropPageLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CPropPageLite() | CPropPageLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/IPersistStm.h Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

IPersistStm.h

Go to the documentation of this file.
00001 #ifndef _IPERSISTSTREAM_H
00002 #define _IPERSISTSTREAM_H
00003
00004 //////////////////////////////////////////////////////////////////////////////
00005 // IMyPersistStream
00006 // Implements IPersistStream as a template class.
00007 //
00008 // ToDo: Derive your own class form this class and implement the methods
00009 //        IMyPersistStreamImpl_Load
00010 //        IMyPersistStreamImpl_Save
00011 //        IMyPersistStreamImpl_GetSizeMax
00012 //     and the member variable
00013 //        m_bRequiresSave
00014 //////////////////////////////////////////////////////////////////////////////
00015 template <class T>
00016 class ATL_NO_VTABLE IMyPersistStreamImpl
00017 {
00018 public:
00019   // IUnknown
00020   //
00021   STDMETHOD(QueryInterface)(REFIID riid, void ** ppvObject) = 0;
00022   _ATL_DEBUG_ADDREF_RELEASE_IMPL(IMyPersistStreamImpl)
00023
00024   // IPersist
00025   STDMETHOD(GetClassID)(CLSID *pClassID)
00026   {
00027     ATLTRACE(_T("IMyPersistStreamImpl::GetClassID\n"));
00028     T* pT = static_cast<T*>(this);
00029     *pClassID = pT->GetObjectCLSID();
00030     return S_OK;
00031   }
00032
00033   // IPersistStream
00034   STDMETHOD(IsDirty)()
00035   {
00036     ATLTRACE(_T("IMyPersistStreamImpl::IsDirty\n"));
00037     T* pT = static_cast<T*>(this);
00038     return (pT->m_bRequiresSave) ? S_OK : S_FALSE;
00039   }
00040   STDMETHOD(Load)(LPSTREAM pStm)
00041   {
00042     ATLTRACE(_T("IMyPersistStreamImpl::Load\n"));
00043     T* pT = static_cast<T*>(this);
00044     return pT->IMyPersistStreamImpl_Load(pStm);
00045   }
00046   STDMETHOD(Save)(LPSTREAM pStm, BOOL fClearDirty)
00047   {
00048     T* pT = static_cast<T*>(this);
00049     ATLTRACE(_T("IMyPersistStreamImpl::Save\n"));
00050     return pT->IMyPersistStreamImpl_Save(pStm, fClearDirty);
00051   }
00052   STDMETHOD(GetSizeMax)(ULARGE_INTEGER FAR* pcbSize )
00053   {
00054     T* pT = static_cast<T*>(this);
00055     ATLTRACE(_T("IMyPersistStreamImpl::GetSizeMax\n"));
00056     return pT->IMyPersistStreamImpl_GetSizeMax(pcbSize);
00057   }
00058
00059 };
00060
00061 #endif
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/ABOUT.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

ABOUT.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   about.c
00009 //
00010 //  PURPOSE:   Displays the "About" dialog box
00011 //
00012 //  FUNCTIONS:
00013 //    CmdAbout        - Displays the "About" dialog box
00014 //    About           - Processes messages for "About" dialog box.
00015 //    MsgAboutInit    - To initialize the about box with version info
00016 //                      from resources.
00017 //    MsgAboutCommand - Process WM_COMMAND message sent to the about box.
00018 //    CmdAboutDone    - Free the about box and related data.
00019 //
00020 //  COMMENTS:
00021 //
00022 //
00023
00024 #include <windows.h>            // required for all Windows applications
00025 #include <windowsx.h>
00026 #include "globals.h"            // prototypes specific to this application
00027
00028 LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
00029 LRESULT MsgAboutInit(HWND, UINT, WPARAM, LPARAM);
00030 LRESULT MsgAboutCommand(HWND, UINT, WPARAM, LPARAM);
00031 LRESULT CmdAboutDone(HWND, WORD, WORD, HWND);
00032
00033 // About dialog message table definition.
00034 MSD rgmsdAbout[] =
00035 {
00036     {WM_COMMAND,    MsgAboutCommand},
00037     {WM_INITDIALOG, MsgAboutInit}
00038 };
00039
00040 MSDI msdiAbout =
00041 {
00042     sizeof(rgmsdAbout) / sizeof(MSD),
00043     rgmsdAbout,
00044     edwpNone
00045 };
00046
00047 // About dialog command table definition.
00048 CMD rgcmdAbout[] =
00049 {
00050     {IDOK,     CmdAboutDone},
00051     {IDCANCEL, CmdAboutDone}
00052 };
00053
00054 CMDI cmdiAbout =
00055 {
00056     sizeof(rgcmdAbout) / sizeof(CMD),
00057     rgcmdAbout,
00058     edwpNone
00059 };
00060
00061 // Module specific "globals"  Used when a variable needs to be
00062 // accessed in more than on handler function.
00063
00064 HFONT hFontCopyright;
00065
00066 //
00067 //  FUNCTION: CmdAbout(HWND, WORD, WORD, HWND)
00068 //
00069 //  PURPOSE: Displays the "About" dialog box
00070 //
00071 //  PARAMETERS:
00072 //    hwnd      - Window handle
00073 //    wCommand  - IDM_ABOUT (unused)
00074 //    wNotify   - Notification number (unused)
00075 //    hwndCtrl  - NULL (unused)
00076 //
00077 //  RETURN VALUE:
00078 //
00079 //    Always returns 0 - Message handled
00080 //
00081 //  COMMENTS:
00082 //    To process the IDM_ABOUT message, call DialogBox() to display the
00083 //    about dialog box.
00084
00085 LRESULT CmdAbout(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00086 {
00087     DialogBox(hInst, "AboutBox", hwnd, (DLGPROC)About);
00088     return 0;
00089 }
00090
00091
00092 //
00093 //  FUNCTION: About(HWND, UINT, WPARAM, LPARAM)
00094 //
00095 //  PURPOSE:  Processes messages for "About" dialog box.
00096 //
00097 //  PARAMETERS:
00098 //    hdlg - window handle of the dialog box
00099 //    wMessage - type of message
00100 //    wparam - message-specific information
00101 //    lparam - message-specific information
00102 //
00103 //  RETURN VALUE:
00104 //    TRUE - message handled
00105 //    FALSE - message not handled
00106 //
00107 //  COMMENTS:
00108 //
00109 //     Display version information from the version section of the
00110 //     application resource.
00111 //
00112 //     Wait for user to click on "Ok" button, then close the dialog box.
00113 //
00114
00115 LRESULT CALLBACK About(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
00116 {
00117     return DispMessage(&msdiAbout, hdlg, uMessage, wparam, lparam);
00118 }
00119
00120
00121 //
00122 //  FUNCTION: MsgAboutInit(HWND, UINT, WPARAM, LPARAM)
00123 //
00124 //  PURPOSE: To initialize the about box with version info from resources.
00125 //
00126 //  PARAMETERS:
00127 //    hwnd - The window handing the message.
00128 //    uMessage - The message number. (unused).
00129 //    wparam - Message specific data (unused).
00130 //    lparam - Message specific data (unused).
00131 //
00132 //  RETURN VALUE:
00133 //    Always returns 0 - message handled.
00134 //
00135 //  COMMENTS:
00136 //    Uses the version apis to retrieve version information for
00137 //    each of the static text boxes in the about box.
00138 //
00139
00140 LRESULT MsgAboutInit(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
00141 {
00142     #define POINTSIZE 8
00143
00144     char  szFullPath[256];
00145     DWORD dwVerHnd;
00146     DWORD dwVerInfoSize;
00147     HDC   hDC;
00148     int   iLogPixelsY, iPointSize;
00149
00150     // Center the dialog over the application window
00151     CenterWindow(hdlg, GetWindow(hdlg, GW_OWNER));
00152
00153     // Set the copyright font to something smaller than default
00154     hDC = GetDC(hdlg);
00155     iLogPixelsY = GetDeviceCaps(hDC, LOGPIXELSY);
00156     ReleaseDC(hdlg, hDC);
00157     iPointSize = MulDiv(iLogPixelsY, POINTSIZE, 72);
00158     iPointSize *= -1;
00159
00160     hFontCopyright = CreateFont(iPointSize,
00161                                 0, 0, 0,
00162                                 FW_BOLD,
00163                                 0, 0, 0, 0,
00164                                 0, 0, 0, 0,
00165                                 "Arial");
00166
00167     SendDlgItemMessage(hdlg,
00168                        IDD_VERLAST,
00169                        WM_SETFONT,
00170                        (WPARAM)hFontCopyright,
00171                        0L);
00172
00173     // Get version information from the application
00174     GetModuleFileName(hInst, szFullPath, sizeof(szFullPath));
00175     dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
00176     if (dwVerInfoSize)
00177     {
00178         // If we were able to get the information, process it:
00179         HANDLE  hMem;
00180         LPVOID  lpvMem;
00181         char    szGetName[256];
00182         int     cchRoot;
00183         int     i;
00184     DWORD dwRemainingLength;
00185
00186         hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
00187         lpvMem = GlobalLock(hMem);
00188         GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpvMem);
00189         strncpy(szGetName, "\\StringFileInfo\\040904E4\\",255 );
00190     szGetName[255] = '\0';
00191         cchRoot = lstrlen(szGetName);
00192
00193         // Walk through the dialog items that we want to replace:
00194         for (i = IDD_VERFIRST; i <= IDD_VERLAST; i++)
00195         {
00196             BOOL  fRet;
00197             UINT  cchVer = 0;
00198             LPSTR lszVer = NULL;
00199             char  szResult[256];
00200
00201             GetDlgItemText(hdlg, i, szResult, sizeof(szResult));
00202       dwRemainingLength = 255 - strlen(szGetName);
00203             strncpy(&szGetName[cchRoot], szResult, dwRemainingLength);
00204       szGetName[255] = '\0';
00205             fRet = VerQueryValue(lpvMem, szGetName, &lszVer, &cchVer);
00206
00207             if (fRet && cchVer && lszVer)
00208             {
00209                 // Replace dialog item text with version info
00210
00211                 strncpy(szResult, lszVer, 255);
00212         szResult[255] = '\0';
00213                 SetDlgItemText(hdlg, i, szResult);
00214             }
00215         }
00216         GlobalUnlock(hMem);
00217         GlobalFree(hMem);
00218     }
00219     return TRUE;
00220 }
00221
00222 //
00223 //  FUNCTION: MsgAboutCommand(HWND, UINT, WPARAM, LPARAM)
00224 //
00225 //  PURPOSE: Process WM_COMMAND message sent to the about box.
00226 //
00227 //  PARAMETERS:
00228 //    hwnd - The window handing the message.
00229 //    uMessage - The message number. (unused).
00230 //    wparam - Message specific data (unused).
00231 //    lparam - Message specific data (unused).
00232 //
00233 //  RETURN VALUE:
00234 //    Always returns 0 - message handled.
00235 //
00236 //  COMMENTS:
00237 //    Uses this DipsCommand function defined in wndproc.c combined
00238 //    with the cmdiAbout structure defined in this file to handle
00239 //    the command messages for the about dialog box.
00240 //
00241
00242 LRESULT MsgAboutCommand(HWND   hwnd,
00243                         UINT   uMessage,
00244                         WPARAM wparam,
00245                         LPARAM lparam)
00246 {
00247     return DispCommand(&cmdiAbout, hwnd, wparam, lparam);
00248 }
00249
00250 //
00251 //  FUNCTION: CmdAboutDone(HWND, WORD, HWND)
00252 //
00253 //  PURPOSE: Free the about box and related data.
00254 //
00255 //  PARAMETERS:
00256 //    hwnd - The window handling the command.
00257 //    wCommand - The command to be handled (unused).
00258 //    wNotify   - Notification number (unused)
00259 //    hwndCtrl - NULL (unused).
00260 //
00261 //  RETURN VALUE:
00262 //    Always returns TRUE.
00263 //
00264 //  COMMENTS:
00265 //    Calls EndDialog to finish the dialog session.
00266 //
00267
00268 LRESULT CmdAboutDone(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00269 {
00270     if (hFontCopyright)
00271        DeleteObject(hFontCopyright);
00272
00273     EndDialog(hdlg, TRUE);          // Exit the dialog
00274     return TRUE;
00275 }
00276
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCmdLineConsumerDlg Member List

This is the complete list of members for CCmdLineConsumerDlg, including all inherited members.
CCmdLineConsumerDlg(CWnd *pParent=NULL) | CCmdLineConsumerDlg |
DoDataExchange(CDataExchange *pDX) | CCmdLineConsumerDlg | [protected, virtual]
IDD enum value | CCmdLineConsumerDlg |
m_hIcon | CCmdLineConsumerDlg | [protected]
m_output | CCmdLineConsumerDlg |
OnInitDialog() | CCmdLineConsumerDlg | [protected, virtual]
OnPaint() | CCmdLineConsumerDlg | [protected]
OnQueryDragIcon() | CCmdLineConsumerDlg | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CCmdLineConsumerDlg | [protected]
Generated on Wed Nov 13 2024 16:55:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditCommands/dlldata.c Source File

  • Web
  • Browser
  • EditCommands

dlldata.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /*********************************************************
00006    DllData file -- generated by MIDL compiler
00007
00008         DO NOT ALTER THIS FILE
00009
00010    This file is regenerated by MIDL on every IDL file compile.
00011
00012    To completely reconstruct this file, delete it and rerun MIDL
00013    on all the IDL files in this DLL, specifying this file for the
00014    /dlldata command line option
00015
00016 *********************************************************/
00017
00018 #define PROXY_DELEGATION
00019
00020 #include <rpcproxy.h>
00021
00022 #ifdef __cplusplus
00023 extern "C"   {
00024 #endif
00025
00026 EXTERN_PROXY_FILE( EdCommands )
00027
00028
00029 PROXYFILE_LIST_START
00030 /* Start of list */
00031   REFERENCE_PROXY_FILE( EdCommands ),
00032 /* End of list */
00033 PROXYFILE_LIST_END
00034
00035
00036 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00037
00038 #ifdef __cplusplus
00039 }  /*extern "C" */
00040 #endif
00041
00042 /* end of generated dlldata file */
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAdvRecoApp Member List

This is the complete list of members for CAdvRecoApp, including all inherited members.
CAdvRecoApp() | CAdvRecoApp | [inline]
const_cast(&mc_AtlFuncInfo[1])) HRESULT __stdcall Stroke(IInkCursor *pIInkCursor | IInkCollectorEventsImpl< CAdvRecoApp > |
CreateChildWindows() | CAdvRecoApp |
DIID__IInkCollectorEvents | IInkCollectorEventsImpl< CAdvRecoApp > |
DISPID_CEGesture | IInkCollectorEventsImpl< CAdvRecoApp > |
Gesture | IInkCollectorEventsImpl< CAdvRecoApp > |
GetGestureName(InkApplicationGesture idGesture, UINT &idGestureName) | CAdvRecoApp |
LoadMenu() | CAdvRecoApp |
m_bAllMSGestures | CAdvRecoApp |
m_bAllSSGestures | CAdvRecoApp |
m_bCoerceInputScope | CAdvRecoApp |
m_bstrCurRecoName | CAdvRecoApp |
m_hwndMSGestLV | CAdvRecoApp |
m_hwndSSGestLV | CAdvRecoApp |
m_hwndStatusBar | CAdvRecoApp |
m_nCmdGuide | CAdvRecoApp |
m_nCmdInputScope | CAdvRecoApp |
m_nCmdMode | CAdvRecoApp |
m_nCmdRecognizer | CAdvRecoApp |
m_spIInkCollector | CAdvRecoApp |
m_spIInkDisp | CAdvRecoApp |
m_spIInkRecoContext | CAdvRecoApp |
m_spIInkRecognizers | CAdvRecoApp |
m_spIInkRecoGuide | CAdvRecoApp |
m_spIInkRenderer | CAdvRecoApp |
m_spIInkStrokes | CAdvRecoApp |
m_szGuideBox | CAdvRecoApp |
m_wndInput | CAdvRecoApp |
m_wndResults | CAdvRecoApp |
IInkCollectorEventsImpl< CAdvRecoApp >::mc_AtlFuncInfo | IInkCollectorEventsImpl< CAdvRecoApp > | [static]
IInkRecognitionEventsImpl< CAdvRecoApp >::mc_AtlFuncInfo | IInkRecognitionEventsImpl< CAdvRecoApp > | [static]
mc_cNumMSGestures enum value | CAdvRecoApp |
mc_cNumSSGestures enum value | CAdvRecoApp |
mc_cxBoxMargin enum value | CAdvRecoApp |
mc_cxGestLVWidth enum value | CAdvRecoApp |
mc_cyBoxMargin enum value | CAdvRecoApp |
mc_iGuideColWidth enum value | CAdvRecoApp |
mc_iGuideRowHeight enum value | CAdvRecoApp |
mc_iInputWndId enum value | CAdvRecoApp |
mc_iMSGestLVId enum value | CAdvRecoApp |
mc_iNumRowsCols enum value | CAdvRecoApp |
mc_iOutputWndId enum value | CAdvRecoApp |
mc_iPenWidth enum value | CAdvRecoApp |
mc_iSSGestLVId enum value | CAdvRecoApp |
mc_iStatusWndId enum value | CAdvRecoApp |
mc_iSubmenuGuides enum value | CAdvRecoApp |
mc_iSubmenuInputScopes enum value | CAdvRecoApp |
mc_iSubmenuModes enum value | CAdvRecoApp |
mc_iSubmenuRecognizers enum value | CAdvRecoApp |
OnClear(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CAdvRecoApp |
OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CAdvRecoApp |
OnExit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnGesture(IInkCursor *pIInkCursor, IInkStrokes *pIInkStrokes, VARIANT vGestures, VARIANT_BOOL *pbCancel) | CAdvRecoApp |
OnGuide(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnInputScope(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnInputScopeCoerce(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnLVColumnClick(int idCtrl, LPNMHDR pnmh, BOOL &bHandled) | CAdvRecoApp |
OnLVItemChanging(int idCtrl, LPNMHDR pnmh, BOOL &bHandled) | CAdvRecoApp |
OnMode(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnRecognitionWithAlternates(IInkRecognitionResult *pIInkRecoResult, VARIANT vCustomParam, InkRecognitionStatus RecognitionStatus) | CAdvRecoApp |
IInkRecognitionEventsImpl< CAdvRecoApp >::OnRecognitionWithAlternates(pIInkRecoResult, vCustomParam, RecognitionStatus) | IInkRecognitionEventsImpl< CAdvRecoApp > |
OnRecognize(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnRecognizer(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CAdvRecoApp |
OnSetFocus(UINT, WPARAM, LPARAM, BOOL &bHandled) | CAdvRecoApp |
OnSize(UINT, WPARAM, LPARAM, BOOL &bHandled) | CAdvRecoApp |
OnStroke(IInkCursor *pIInkCursor, IInkStrokeDisp *pIInkStroke, VARIANT_BOOL *pbCancel) | CAdvRecoApp |
pInkStroke | IInkCollectorEventsImpl< CAdvRecoApp > |
PresetGestures() | CAdvRecoApp |
pT | IInkRecognitionEventsImpl< CAdvRecoApp > |
Run(int nCmdShow) | CAdvRecoApp | [static]
IInkCollectorEventsImpl< CAdvRecoApp >::SINK_ENTRY_INFO(SINK_ID, DIID__IInkCollectorEvents, DISPID_CEStroke, Stroke, const_cast< _ATL_FUNC_INFO * >(&mc_AtlFuncInfo[0])) SINK_ENTRY_INFO(SINK_ID | IInkCollectorEventsImpl< CAdvRecoApp > |
IInkCollectorEventsImpl< CAdvRecoApp >::SINK_ENTRY_INFO(SINK_ID, DIID__IInkCollectorEvents, DISPID_CEStroke, Stroke, const_cast< _ATL_FUNC_INFO * >(&mc_AtlFuncInfo)) HRESULT __stdcall Stroke(IInkCursor *pIInkCursor | IInkCollectorEventsImpl< CAdvRecoApp > |
IInkRecognitionEventsImpl< CAdvRecoApp >::SINK_ENTRY_INFO(SINK_ID, DIID__IInkRecognitionEvents, DISPID_RERecognitionWithAlternates, RecognitionWithAlternates, const_cast< _ATL_FUNC_INFO * >(&mc_AtlFuncInfo)) HRESULT __stdcall RecognitionWithAlternates(IInkRecognitionResult *pIInkRecoResult | IInkRecognitionEventsImpl< CAdvRecoApp > |
IInkRecognitionEventsImpl< CAdvRecoApp >::SINK_ENTRY_INFO(SINK_ID, DIID__IInkRecognitionEvents, DISPID_RERecognition, Recognition, const_cast< _ATL_FUNC_INFO * >(&mc_AtlFuncInfo)) HRESULT __stdcall Recognition(BSTR bstrRecognizedString | IInkRecognitionEventsImpl< CAdvRecoApp > |
UpdateInputScopeMenu() | CAdvRecoApp |
UpdateLayout() | CAdvRecoApp |
UpdateMenuRadioItems(UINT iSubMenu, UINT idCheck, UINT idUncheck) | CAdvRecoApp |
UpdateStatusBar() | CAdvRecoApp |
UseRecognizer(IInkRecognizer *pIInkRecognizer) | CAdvRecoApp |
vCustomParam | IInkRecognitionEventsImpl< CAdvRecoApp > |
Generated on Wed Nov 13 2024 16:55:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagCONFIGITEMLISTVIEWLPARAM Member List

This is the complete list of members for _tagCONFIGITEMLISTVIEWLPARAM, including all inherited members.
ItemID _tagCONFIGITEMLISTVIEWLPARAM
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPermEventsDlg Member List

This is the complete list of members for CPermEventsDlg, including all inherited members.
CPermEventsDlg(CWnd *pParent=NULL) | CPermEventsDlg |
DoDataExchange(CDataExchange *pDX) | CPermEventsDlg | [protected, virtual]
IDD enum value | CPermEventsDlg |
m_hIcon | CPermEventsDlg | [protected]
m_outputList | CPermEventsDlg |
OnInitDialog() | CPermEventsDlg | [protected, virtual]
OnPaint() | CPermEventsDlg | [protected]
OnQueryDragIcon() | CPermEventsDlg | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CPermEventsDlg | [protected]
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/iocp/IocpServer.Cpp Source File

  • NetDS
  • WinSock
  • iocp

IocpServer.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      iocpserver.cpp
00010 //
00011 // Abstract:
00012 //      This program is a Winsock echo server program that uses I/O Completion Ports
00013 //      (IOCP) to receive data from and echo data back to a sending client. The server
00014 //      program supports multiple clients connecting via TCP/IP and sending arbitrary
00015 //      sized data buffers which the server then echoes back to the client.  For
00016 //      convenience a simple client program, iocpclient was developed to connect
00017 //      and continually send data to the server to stress it.
00018 //
00019 //      Direct IOCP support was added to Winsock 2 and is fully implemented on the NT
00020 //      platform.  IOCPs provide a model for developing very high performance and very
00021 //      scalable server programs.
00022 //
00023 //      The basic idea is that this server continuously accepts connection requests from
00024 //      a client program.  When this happens, the accepted socket descriptor is added to
00025 //      the existing IOCP and an initial receive (WSARecv) is posted on that socket.  When
00026 //      the client then sends data on that socket, a completion packet will be delivered
00027 //      and handled by one of the server's worker threads.  The worker thread echoes the
00028 //      data back to the sender by posting a send (WSASend) containing all the data just
00029 //      received.  When sending the data back to the client completes, another completion
00030 //      packet will be delivered and again handled by one of the server's worker threads.
00031 //      Assuming all the data that needed to be sent was actually sent, another receive
00032 //      (WSARecv) is once again posted and the scenario repeats itself until the client
00033 //      stops sending data.
00034 //
00035 //      When using IOCPs it is important to remember that the worker threads must be able
00036 //      to distinguish between I/O that occurs on multiple handles in the IOCP as well as
00037 //      multiple I/O requests initiated on a single handle.  The per handle data
00038 //      (PER_SOCKET_CONTEXT) is associated with the handle as the CompletionKey when the
00039 //      handle is added to the IOCP using CreateIoCompletionPort.  The per IO operation
00040 //      data (PER_IO_CONTEXT) is associated with a specific handle during an I/O
00041 //      operation as part of the overlapped structure passed to either WSARecv or
00042 //      WSASend.  Please notice that the first member of the PER_IO_CONTEXT structure is
00043 //      a WSAOVERLAPPED structure (compatible with the Win32 OVERLAPPED structure).
00044 //
00045 //      When the worker thread unblocks from GetQueuedCompletionStatus, the key
00046 //      associated with the handle when the handle was added to the IOCP is returned as
00047 //      well as the overlapped structure associated when this particular I/O operation
00048 //      was initiated.
00049 //
00050 //      This program cleans up all resources and shuts down when CTRL-C is pressed.
00051 //      This will cause the main thread to break out of the accept loop and close all open
00052 //      sockets and free all context data.  The worker threads get unblocked by posting
00053 //      special I/O packets with a NULL CompletionKey to the IOCP.  The worker
00054 //      threads check for a NULL CompletionKey and exits if it encounters one. If CTRL-BRK
00055 //      is pressed instead, cleanup process is same as above but instead of exit the process,
00056 //      the program loops back to restart the server.
00057
00058 //      Another point worth noting is that the Win32 API CreateThread() does not
00059 //      initialize the C Runtime and therefore, C runtime functions such as
00060 //      printf() have been avoid or rewritten (see myprintf()) to use just Win32 APIs.
00061 //
00062 //  Usage:
00063 //      Start the server and wait for connections on port 6001
00064 //          iocpserver -e:6001
00065 //
00066 //  Build:
00067 //      Use the headers and libs from the April98 Platform SDK or later.
00068 //      Link with ws2_32.lib
00069 //
00070 //  Author: Wei Hua, Barry Butterklee - Microsoft Developer Support
00071 //
00072 //
00073
00074 #ifdef _IA64_
00075   #pragma warning(disable:4127 4267)
00076 #endif
00077
00078 #ifndef WIN32_LEAN_AND_MEAN
00079   #define WIN32_LEAN_AND_MEAN
00080 #endif
00081
00082 #define xmalloc(s) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(s))
00083 #define xfree(p)   HeapFree(GetProcessHeap(),0,(p))
00084
00085 #include <winsock2.h>
00086 #include <Ws2tcpip.h>
00087 #include <stdio.h>
00088 #include <stdlib.h>
00089
00090 #include "iocpserver.h"
00091
00092 char *g_Port = DEFAULT_PORT;
00093 BOOL g_bEndServer = FALSE;      // set to TRUE on CTRL-C
00094 BOOL g_bRestart = TRUE;       // set to TRUE to CTRL-BRK
00095 BOOL g_bVerbose = FALSE;
00096 DWORD g_dwThreadCount = 0;    //worker thread count
00097 HANDLE g_hIOCP = INVALID_HANDLE_VALUE;
00098 SOCKET g_sdListen = INVALID_SOCKET;
00099 HANDLE g_ThreadHandles[MAX_WORKER_THREAD];
00100 PPER_SOCKET_CONTEXT g_pCtxtList = NULL;   // linked list of context info structures
00101                       // maintained to allow the the cleanup
00102                       // handler to cleanly close all sockets and
00103                       // free resources.
00104
00105 CRITICAL_SECTION g_CriticalSection;   // guard access to the global context list
00106
00107 int myprintf(const char *lpFormat, ...);
00108
00109 void __cdecl main (int argc, char *argv[]) {
00110
00111   SYSTEM_INFO systemInfo;
00112   WSADATA wsaData;
00113   SOCKET sdAccept = INVALID_SOCKET;
00114   PPER_SOCKET_CONTEXT lpPerSocketContext = NULL;
00115   DWORD dwRecvNumBytes = 0;
00116   DWORD dwFlags = 0;
00117   int nRet = 0;
00118
00119   for( int i = 0; i < MAX_WORKER_THREAD; i++ ) {
00120     g_ThreadHandles[i] = INVALID_HANDLE_VALUE;
00121   }
00122
00123   if( !ValidOptions(argc, argv) )
00124     return;
00125
00126   if( !SetConsoleCtrlHandler(CtrlHandler, TRUE) ) {
00127     myprintf("SetConsoleCtrlHandler() failed to install console handler: %d\n",
00128          GetLastError());
00129     return;
00130   }
00131
00132   GetSystemInfo(&systemInfo);
00133   g_dwThreadCount = systemInfo.dwNumberOfProcessors * 2;
00134
00135   if( (nRet = WSAStartup(MAKEWORD(2,2), &wsaData)) != 0 ) {
00136     myprintf("WSAStartup() failed: %d\n",nRet);
00137     SetConsoleCtrlHandler(CtrlHandler, FALSE);
00138     return;
00139   }
00140
00141   InitializeCriticalSection(&g_CriticalSection);
00142
00143   while( g_bRestart ) {
00144     g_bRestart = FALSE;
00145     g_bEndServer = FALSE;
00146
00147     __try {
00148       g_hIOCP = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
00149       if( g_hIOCP == NULL ) {
00150         myprintf("CreateIoCompletionPort() failed to create I/O completion port: %d\n",
00151             GetLastError());
00152         __leave;
00153       }
00154
00155       for( DWORD dwCPU = 0; dwCPU < g_dwThreadCount; dwCPU++ ) {
00156
00157         //
00158         // Create worker threads to service the overlapped I/O requests.  The decision
00159         // to create 2 worker threads per CPU in the system is a heuristic.  Also,
00160         // note that thread handles are closed right away, because we will not need them
00161         // and the worker threads will continue to execute.
00162         //
00163         HANDLE hThread = INVALID_HANDLE_VALUE;
00164         DWORD dwThreadId = 0;
00165
00166         hThread = CreateThread(NULL, 0, WorkerThread, g_hIOCP, 0, &dwThreadId);
00167         if( hThread == NULL ) {
00168           myprintf("CreateThread() failed to create worker thread: %d\n",
00169               GetLastError());
00170           __leave;
00171         }
00172         g_ThreadHandles[dwCPU] = hThread;
00173         hThread = INVALID_HANDLE_VALUE;
00174       }
00175
00176       if( !CreateListenSocket() )
00177         __leave;
00178
00179       while( TRUE ) {
00180
00181         //
00182         // Loop forever accepting connections from clients until console shuts down.
00183         //
00184         sdAccept = WSAAccept(g_sdListen, NULL, NULL, NULL, 0);
00185         if( sdAccept == SOCKET_ERROR ) {
00186
00187           //
00188           // If user hits Ctrl+C or Ctrl+Brk or console window is closed, the control
00189           // handler will close the g_sdListen socket. The above WSAAccept call will
00190           // fail and we thus break out the loop,
00191           //
00192           myprintf("WSAAccept() failed: %d\n", WSAGetLastError());
00193           __leave;
00194         }
00195
00196                 //
00197         // we add the just returned socket descriptor to the IOCP along with its
00198         // associated key data.  Also the global list of context structures
00199         // (the key data) gets added to a global list.
00200         //
00201         lpPerSocketContext = UpdateCompletionPort(sdAccept, ClientIoRead, TRUE);
00202         if( lpPerSocketContext == NULL )
00203           __leave;
00204
00205         //
00206         // if a CTRL-C was pressed "after" WSAAccept returns, the CTRL-C handler
00207         // will have set this flag and we can break out of the loop here before
00208         // we go ahead and post another read (but after we have added it to the
00209         // list of sockets to close).
00210         //
00211         if( g_bEndServer )
00212           break;
00213
00214                 //
00215         // post initial receive on this socket
00216         //
00217         nRet = WSARecv(sdAccept, &(lpPerSocketContext->pIOContext->wsabuf),
00218                  1, &dwRecvNumBytes, &dwFlags,
00219                  &(lpPerSocketContext->pIOContext->Overlapped), NULL);
00220         if( nRet == SOCKET_ERROR && (ERROR_IO_PENDING != WSAGetLastError()) ) {
00221           myprintf("WSARecv() Failed: %d\n", WSAGetLastError());
00222           CloseClient(lpPerSocketContext, FALSE);
00223         }
00224       } //while
00225     }
00226
00227     __finally   {
00228
00229       g_bEndServer = TRUE;
00230
00231             //
00232       // Cause worker threads to exit
00233       //
00234       if( g_hIOCP ) {
00235         for( DWORD i = 0; i < g_dwThreadCount; i++ )
00236           PostQueuedCompletionStatus(g_hIOCP, 0, 0, NULL);
00237       }
00238
00239       //
00240       //Make sure worker threads exits.
00241             //
00242       if( WAIT_OBJECT_0 != WaitForMultipleObjects( g_dwThreadCount,  g_ThreadHandles, TRUE, 1000) )
00243         myprintf("WaitForMultipleObjects() failed: %d\n", GetLastError());
00244       else
00245         for( DWORD i = 0; i < g_dwThreadCount; i++ ) {
00246           if( g_ThreadHandles[i] != INVALID_HANDLE_VALUE ) CloseHandle(g_ThreadHandles[i]);
00247           g_ThreadHandles[i] = INVALID_HANDLE_VALUE;
00248         }
00249
00250       CtxtListFree();
00251
00252       if( g_hIOCP ) {
00253         CloseHandle(g_hIOCP);
00254         g_hIOCP = NULL;
00255       }
00256
00257       if( g_sdListen != INVALID_SOCKET ) {
00258         closesocket(g_sdListen);
00259         g_sdListen = INVALID_SOCKET;
00260       }
00261
00262       if( sdAccept != INVALID_SOCKET ) {
00263         closesocket(sdAccept);
00264         sdAccept = INVALID_SOCKET;
00265       }
00266
00267     } //finally
00268
00269     if( g_bRestart ) {
00270       myprintf("\niocpserver is restarting...\n");
00271     } else
00272       myprintf("\niocpserver is exiting...\n");
00273
00274   } //while (g_bRestart)
00275
00276   DeleteCriticalSection(&g_CriticalSection);
00277   WSACleanup();
00278   SetConsoleCtrlHandler(CtrlHandler, FALSE);
00279 } //main
00280
00281 //
00282 //  Just validate the command line options.
00283 //
00284 BOOL ValidOptions(int argc, char *argv[]) {
00285
00286   BOOL bRet = TRUE;
00287
00288   for( int i = 1; i < argc; i++ ) {
00289     if( (argv[i][0] =='-') || (argv[i][0] == '/') ) {
00290       switch( tolower(argv[i][1]) ) {
00291       case 'e':
00292         if( strlen(argv[i]) > 3 )
00293           g_Port = &argv[i][3];
00294         break;
00295
00296       case 'v':
00297         g_bVerbose = TRUE;
00298         break;
00299
00300       case '?':
00301         myprintf("Usage:\n  iocpserver [-p:port] [-v] [-?]\n");
00302         myprintf("  -e:port\tSpecify echoing port number\n");
00303         myprintf("  -v\t\tVerbose\n");
00304         myprintf("  -?\t\tDisplay this help\n");
00305         bRet = FALSE;
00306         break;
00307
00308       default:
00309         myprintf("Unknown options flag %s\n", argv[i]);
00310         bRet = FALSE;
00311         break;
00312       }
00313     }
00314   }
00315
00316   return(bRet);
00317 }
00318
00319 //
00320 //  Intercept CTRL-C or CTRL-BRK events and cause the server to initiate shutdown.
00321 //  CTRL-BRK resets the restart flag, and after cleanup the server restarts.
00322 //
00323 BOOL WINAPI CtrlHandler (DWORD dwEvent) {
00324
00325   SOCKET sockTemp = INVALID_SOCKET;
00326
00327   switch( dwEvent ) {
00328   case CTRL_BREAK_EVENT:
00329     g_bRestart = TRUE;
00330   case CTRL_C_EVENT:
00331   case CTRL_LOGOFF_EVENT:
00332   case CTRL_SHUTDOWN_EVENT:
00333   case CTRL_CLOSE_EVENT:
00334     if( g_bVerbose )
00335       myprintf("CtrlHandler: closing listening socket\n");
00336
00337     //
00338     // cause the accept in the main thread loop to fail
00339     //
00340
00341         //
00342     //We want to make closesocket the last call in the handler because it will
00343     //cause the WSAAccept to return in the main thread
00344     //
00345     sockTemp = g_sdListen;
00346     g_sdListen = INVALID_SOCKET;
00347     g_bEndServer = TRUE;
00348     closesocket(sockTemp);
00349     sockTemp = INVALID_SOCKET;
00350     break;
00351
00352   default:
00353     // unknown type--better pass it on.
00354     return(FALSE);
00355   }
00356   return(TRUE);
00357 }
00358
00359 //
00360 //  Create a listening socket.
00361 //
00362 BOOL CreateListenSocket(void) {
00363
00364   int nRet = 0;
00365   int nZero = 0;
00366   struct addrinfo hints;
00367   struct addrinfo *addrlocal = NULL;
00368
00369   //
00370   // Resolve the interface
00371   //
00372   memset(&hints, 0, sizeof(hints));
00373   hints.ai_flags  = AI_PASSIVE;
00374   hints.ai_family = AF_INET;
00375   hints.ai_socktype = SOCK_STREAM;
00376   hints.ai_protocol = IPPROTO_IP;
00377
00378   if( getaddrinfo(NULL, g_Port, &hints, &addrlocal) != 0 ) {
00379     myprintf("getaddrinfo() failed with error %d\n", WSAGetLastError());
00380         return(FALSE);
00381   }
00382
00383   if( addrlocal == NULL ) {
00384     myprintf("getaddrinfo() failed to resolve/convert the interface\n");
00385         return(FALSE);
00386   }
00387
00388   g_sdListen = WSASocket(addrlocal->ai_family, addrlocal->ai_socktype, addrlocal->ai_protocol,
00389                NULL, 0, WSA_FLAG_OVERLAPPED);
00390   if( g_sdListen == INVALID_SOCKET ) {
00391     myprintf("WSASocket(g_sdListen) failed: %d\n", WSAGetLastError());
00392     return(FALSE);
00393   }
00394
00395   nRet = bind(g_sdListen, addrlocal->ai_addr, addrlocal->ai_addrlen);
00396   if( nRet == SOCKET_ERROR ) {
00397     myprintf("bind() failed: %d\n", WSAGetLastError());
00398     return(FALSE);
00399   }
00400
00401   nRet = listen(g_sdListen, 5);
00402   if( nRet == SOCKET_ERROR ) {
00403     myprintf("listen() failed: %d\n", WSAGetLastError());
00404     return(FALSE);
00405   }
00406
00407     //
00408   // Disable send buffering on the socket.  Setting SO_SNDBUF
00409   // to 0 causes winsock to stop buffering sends and perform
00410   // sends directly from our buffers, thereby reducing CPU usage.
00411     //
00412     // However, this does prevent the socket from ever filling the
00413     // send pipeline. This can lead to packets being sent that are
00414     // not full (i.e. the overhead of the IP and TCP headers is
00415     // great compared to the amount of data being carried).
00416     //
00417     // Disabling the send buffer has less serious repercussions
00418     // than disabling the receive buffer.
00419   //
00420   nZero = 0;
00421   nRet = setsockopt(g_sdListen, SOL_SOCKET, SO_SNDBUF, (char *)&nZero, sizeof(nZero));
00422   if( nRet == SOCKET_ERROR ) {
00423     myprintf("setsockopt(SNDBUF) failed: %d\n", WSAGetLastError());
00424     return(FALSE);
00425   }
00426
00427     //
00428     // Don't disable receive buffering. This will cause poor network
00429     // performance since if no receive is posted and no receive buffers,
00430     // the TCP stack will set the window size to zero and the peer will
00431     // no longer be allowed to send data.
00432     //
00433
00434     //
00435     // Do not set a linger value...especially don't set it to an abortive
00436     // close. If you set abortive close and there happens to be a bit of
00437     // data remaining to be transfered (or data that has not been
00438     // acknowledged by the peer), the connection will be forcefully reset
00439     // and will lead to a loss of data (i.e. the peer won't get the last
00440     // bit of data). This is BAD. If you are worried about malicious
00441     // clients connecting and then not sending or receiving, the server
00442     // should maintain a timer on each connection. If after some point,
00443     // the server deems a connection is "stale" it can then set linger
00444     // to be abortive and close the connection.
00445     //
00446
00447     /*
00448   LINGER lingerStruct;
00449
00450   lingerStruct.l_onoff = 1;
00451   lingerStruct.l_linger = 0;
00452
00453   nRet = setsockopt(g_sdListen, SOL_SOCKET, SO_LINGER,
00454             (char *)&lingerStruct, sizeof(lingerStruct) );
00455   if( nRet == SOCKET_ERROR ) {
00456     myprintf("setsockopt(SO_LINGER) failed: %d\n", WSAGetLastError());
00457     return(FALSE);
00458   }
00459     */
00460
00461   freeaddrinfo(addrlocal);
00462
00463   return(TRUE);
00464 }
00465
00466 //
00467 // Worker thread that handles all I/O requests on any socket handle added to the IOCP.
00468 //
00469 DWORD WINAPI WorkerThread (LPVOID WorkThreadContext) {
00470
00471   HANDLE hIOCP = (HANDLE)WorkThreadContext;
00472   BOOL bSuccess = FALSE;
00473   int nRet = 0;
00474   LPWSAOVERLAPPED lpOverlapped = NULL;
00475   PPER_SOCKET_CONTEXT lpPerSocketContext = NULL;
00476   PPER_IO_CONTEXT lpIOContext = NULL;
00477   WSABUF buffRecv;
00478   WSABUF buffSend;
00479   DWORD dwRecvNumBytes = 0;
00480   DWORD dwSendNumBytes = 0;
00481   DWORD dwFlags = 0;
00482   DWORD dwIoSize = 0;
00483
00484   while( TRUE ) {
00485
00486         //
00487     // continually loop to service io completion packets
00488     //
00489     bSuccess = GetQueuedCompletionStatus(hIOCP, &dwIoSize,
00490                        (PDWORD_PTR)&lpPerSocketContext,
00491                        (LPOVERLAPPED *)&lpOverlapped,
00492                        INFINITE);
00493     if( !bSuccess )
00494       myprintf("GetQueuedCompletionStatus() failed: %d\n", GetLastError());
00495
00496     if( lpPerSocketContext == NULL ) {
00497
00498       //
00499       // CTRL-C handler used PostQueuedCompletionStatus to post an I/O packet with
00500       // a NULL CompletionKey (or if we get one for any reason).  It is time to exit.
00501       //
00502       return(0);
00503     }
00504
00505     if( g_bEndServer ) {
00506
00507       //
00508       // main thread will do all cleanup needed - see finally block
00509       //
00510       return(0);
00511     }
00512
00513     if( !bSuccess || (bSuccess && (dwIoSize == 0)) ) {
00514
00515       //
00516       // client connection dropped, continue to service remaining (and possibly
00517       // new) client connections
00518       //
00519       CloseClient(lpPerSocketContext, FALSE);
00520       continue;
00521     }
00522
00523         //
00524     // determine what type of IO packet has completed by checking the PER_IO_CONTEXT
00525     // associated with this socket.  This will determine what action to take.
00526     //
00527     lpIOContext = (PPER_IO_CONTEXT)lpOverlapped;
00528     switch( lpIOContext->IOOperation ) {
00529     case ClientIoRead:
00530
00531       //
00532       // a read operation has completed, post a write operation to echo the
00533       // data back to the client using the same data buffer.
00534       //
00535       lpIOContext->IOOperation = ClientIoWrite;
00536       lpIOContext->nTotalBytes = dwIoSize;
00537       lpIOContext->nSentBytes  = 0;
00538       lpIOContext->wsabuf.len  = dwIoSize;
00539       dwFlags = 0;
00540       nRet = WSASend(lpPerSocketContext->Socket, &lpIOContext->wsabuf, 1,
00541                &dwSendNumBytes, dwFlags, &(lpIOContext->Overlapped), NULL);
00542       if( nRet == SOCKET_ERROR && (ERROR_IO_PENDING != WSAGetLastError()) ) {
00543         myprintf("WSASend() failed: %d\n", WSAGetLastError());
00544         CloseClient(lpPerSocketContext, FALSE);
00545       } else if( g_bVerbose ) {
00546         myprintf("WorkerThread %d: Socket(%d) Recv completed (%d bytes), Send posted\n",
00547              GetCurrentThreadId(), lpPerSocketContext->Socket, dwIoSize);
00548       }
00549       break;
00550
00551     case ClientIoWrite:
00552
00553       //
00554       // a write operation has completed, determine if all the data intended to be
00555       // sent actually was sent.
00556       //
00557       lpIOContext->IOOperation = ClientIoWrite;
00558       lpIOContext->nSentBytes  += dwIoSize;
00559       dwFlags = 0;
00560       if( lpIOContext->nSentBytes < lpIOContext->nTotalBytes ) {
00561
00562         //
00563         // the previous write operation didn't send all the data,
00564         // post another send to complete the operation
00565         //
00566         buffSend.buf = lpIOContext->Buffer + lpIOContext->nSentBytes;
00567         buffSend.len = lpIOContext->nTotalBytes - lpIOContext->nSentBytes;
00568         nRet = WSASend (lpPerSocketContext->Socket, &buffSend, 1,
00569                 &dwSendNumBytes, dwFlags, &(lpIOContext->Overlapped), NULL);
00570         if( nRet == SOCKET_ERROR && (ERROR_IO_PENDING != WSAGetLastError()) ) {
00571           myprintf("WSASend() failed: %d\n", WSAGetLastError());
00572           CloseClient(lpPerSocketContext, FALSE);
00573         } else if( g_bVerbose ) {
00574           myprintf("WorkerThread %d: Socket(%d) Send partially completed (%d bytes), Recv posted\n",
00575                GetCurrentThreadId(), lpPerSocketContext->Socket, dwIoSize);
00576         }
00577       } else {
00578
00579         //
00580         // previous write operation completed for this socket, post another recv
00581         //
00582         lpIOContext->IOOperation = ClientIoRead;
00583         dwRecvNumBytes = 0;
00584         dwFlags = 0;
00585         buffRecv.buf = lpIOContext->Buffer,
00586         buffRecv.len = MAX_BUFF_SIZE;
00587         nRet = WSARecv(lpPerSocketContext->Socket, &buffRecv, 1,
00588                  &dwRecvNumBytes, &dwFlags, &lpIOContext->Overlapped, NULL);
00589         if( nRet == SOCKET_ERROR && (ERROR_IO_PENDING != WSAGetLastError()) ) {
00590           myprintf("WSARecv() failed: %d\n", WSAGetLastError());
00591           CloseClient(lpPerSocketContext, FALSE);
00592         } else if( g_bVerbose ) {
00593           myprintf("WorkerThread %d: Socket(%d) Send completed (%d bytes), Recv posted\n",
00594                GetCurrentThreadId(), lpPerSocketContext->Socket, dwIoSize);
00595         }
00596       }
00597       break;
00598
00599     } //switch
00600   } //while
00601   return(0);
00602 }
00603
00604 //
00605 //  Allocate a context structures for the socket and add the socket to the IOCP.
00606 //  Additionally, add the context structure to the global list of context structures.
00607 //
00608 PPER_SOCKET_CONTEXT UpdateCompletionPort(SOCKET sd, IO_OPERATION ClientIo,
00609                      BOOL bAddToList) {
00610
00611   PPER_SOCKET_CONTEXT lpPerSocketContext;
00612
00613   lpPerSocketContext = CtxtAllocate(sd, ClientIo);
00614   if( lpPerSocketContext == NULL )
00615     return(NULL);
00616
00617   g_hIOCP = CreateIoCompletionPort((HANDLE)sd, g_hIOCP, (DWORD_PTR)lpPerSocketContext, 0);
00618   if( g_hIOCP == NULL ) {
00619     myprintf("CreateIoCompletionPort() failed: %d\n", GetLastError());
00620     if( lpPerSocketContext->pIOContext )
00621       xfree(lpPerSocketContext->pIOContext);
00622     xfree(lpPerSocketContext);
00623     return(NULL);
00624   }
00625
00626     //
00627   //The listening socket context (bAddToList is FALSE) is not added to the list.
00628   //All other socket contexts are added to the list.
00629   //
00630   if( bAddToList ) CtxtListAddTo(lpPerSocketContext);
00631
00632   if( g_bVerbose )
00633     myprintf("UpdateCompletionPort: Socket(%d) added to IOCP\n", lpPerSocketContext->Socket);
00634
00635   return(lpPerSocketContext);
00636 }
00637
00638 //
00639 //  Close down a connection with a client.  This involves closing the socket (when
00640 //  initiated as a result of a CTRL-C the socket closure is not graceful).  Additionally,
00641 //  any context data associated with that socket is free'd.
00642 //
00643 VOID CloseClient (PPER_SOCKET_CONTEXT lpPerSocketContext,
00644           BOOL bGraceful) {
00645
00646   EnterCriticalSection(&g_CriticalSection);
00647
00648   if( lpPerSocketContext ) {
00649     if( g_bVerbose )
00650       myprintf("CloseClient: Socket(%d) connection closing (graceful=%s)\n",
00651            lpPerSocketContext->Socket, (bGraceful?"TRUE":"FALSE"));
00652     if( !bGraceful ) {
00653
00654       //
00655       // force the subsequent closesocket to be abortative.
00656       //
00657       LINGER  lingerStruct;
00658
00659       lingerStruct.l_onoff = 1;
00660       lingerStruct.l_linger = 0;
00661       setsockopt(lpPerSocketContext->Socket, SOL_SOCKET, SO_LINGER,
00662              (char *)&lingerStruct, sizeof(lingerStruct) );
00663     }
00664     closesocket(lpPerSocketContext->Socket);
00665     lpPerSocketContext->Socket = INVALID_SOCKET;
00666     CtxtListDeleteFrom(lpPerSocketContext);
00667     lpPerSocketContext = NULL;
00668   } else {
00669     myprintf("CloseClient: lpPerSocketContext is NULL\n");
00670   }
00671
00672   LeaveCriticalSection(&g_CriticalSection);
00673   return;
00674 }
00675
00676 //
00677 // Allocate a socket context for the new connection.
00678 //
00679 PPER_SOCKET_CONTEXT CtxtAllocate(SOCKET sd, IO_OPERATION ClientIO) {
00680
00681   PPER_SOCKET_CONTEXT lpPerSocketContext;
00682
00683   EnterCriticalSection(&g_CriticalSection);
00684
00685   lpPerSocketContext = (PPER_SOCKET_CONTEXT)xmalloc(sizeof(PER_SOCKET_CONTEXT));
00686   if( lpPerSocketContext ) {
00687     lpPerSocketContext->pIOContext = (PPER_IO_CONTEXT)xmalloc(sizeof(PER_IO_CONTEXT));
00688     if( lpPerSocketContext->pIOContext ) {
00689       lpPerSocketContext->Socket = sd;
00690       lpPerSocketContext->pCtxtBack = NULL;
00691       lpPerSocketContext->pCtxtForward = NULL;
00692
00693       lpPerSocketContext->pIOContext->Overlapped.Internal = 0;
00694       lpPerSocketContext->pIOContext->Overlapped.InternalHigh = 0;
00695       lpPerSocketContext->pIOContext->Overlapped.Offset = 0;
00696       lpPerSocketContext->pIOContext->Overlapped.OffsetHigh = 0;
00697       lpPerSocketContext->pIOContext->Overlapped.hEvent = NULL;
00698       lpPerSocketContext->pIOContext->IOOperation = ClientIO;
00699       lpPerSocketContext->pIOContext->pIOContextForward = NULL;
00700       lpPerSocketContext->pIOContext->nTotalBytes = 0;
00701       lpPerSocketContext->pIOContext->nSentBytes  = 0;
00702       lpPerSocketContext->pIOContext->wsabuf.buf  = lpPerSocketContext->pIOContext->Buffer;
00703       lpPerSocketContext->pIOContext->wsabuf.len  = sizeof(lpPerSocketContext->pIOContext->Buffer);
00704
00705       ZeroMemory(lpPerSocketContext->pIOContext->wsabuf.buf, lpPerSocketContext->pIOContext->wsabuf.len);
00706     } else {
00707       xfree(lpPerSocketContext);
00708       myprintf("HeapAlloc() PER_IO_CONTEXT failed: %d\n", GetLastError());
00709     }
00710
00711   } else {
00712     myprintf("HeapAlloc() PER_SOCKET_CONTEXT failed: %d\n", GetLastError());
00713   }
00714
00715   LeaveCriticalSection(&g_CriticalSection);
00716
00717   return(lpPerSocketContext);
00718 }
00719
00720 //
00721 //  Add a client connection context structure to the global list of context structures.
00722 //
00723 VOID CtxtListAddTo (PPER_SOCKET_CONTEXT lpPerSocketContext) {
00724
00725   PPER_SOCKET_CONTEXT     pTemp;
00726
00727   EnterCriticalSection(&g_CriticalSection);
00728
00729   if( g_pCtxtList == NULL ) {
00730
00731     //
00732     // add the first node to the linked list
00733     //
00734     lpPerSocketContext->pCtxtBack    = NULL;
00735     lpPerSocketContext->pCtxtForward = NULL;
00736     g_pCtxtList = lpPerSocketContext;
00737   } else {
00738
00739     //
00740     // add node to head of list
00741     //
00742     pTemp = g_pCtxtList;
00743
00744     g_pCtxtList = lpPerSocketContext;
00745     lpPerSocketContext->pCtxtBack    = pTemp;
00746     lpPerSocketContext->pCtxtForward = NULL;
00747
00748     pTemp->pCtxtForward = lpPerSocketContext;
00749   }
00750
00751   LeaveCriticalSection(&g_CriticalSection);
00752   return;
00753 }
00754
00755 //
00756 //  Remove a client context structure from the global list of context structures.
00757 //
00758 VOID CtxtListDeleteFrom(PPER_SOCKET_CONTEXT lpPerSocketContext) {
00759
00760   PPER_SOCKET_CONTEXT pBack;
00761   PPER_SOCKET_CONTEXT pForward;
00762   PPER_IO_CONTEXT     pNextIO     = NULL;
00763   PPER_IO_CONTEXT     pTempIO     = NULL;
00764
00765   EnterCriticalSection(&g_CriticalSection);
00766
00767   if( lpPerSocketContext ) {
00768     pBack       = lpPerSocketContext->pCtxtBack;
00769     pForward    = lpPerSocketContext->pCtxtForward;
00770
00771
00772     if( ( pBack == NULL ) && ( pForward == NULL ) ) {
00773
00774       //
00775       // This is the only node in the list to delete
00776       //
00777       g_pCtxtList = NULL;
00778     } else if ( ( pBack == NULL ) && ( pForward != NULL ) ) {
00779
00780       //
00781       // This is the start node in the list to delete
00782       //
00783       pForward->pCtxtBack = NULL;
00784       g_pCtxtList = pForward;
00785     } else if ( ( pBack != NULL ) && ( pForward == NULL ) ) {
00786
00787       //
00788       // This is the end node in the list to delete
00789       //
00790       pBack->pCtxtForward = NULL;
00791     } else if( pBack && pForward ) {
00792
00793       //
00794       // Neither start node nor end node in the list
00795       //
00796       pBack->pCtxtForward = pForward;
00797       pForward->pCtxtBack = pBack;
00798     }
00799
00800     //
00801     // Free all i/o context structures per socket
00802     //
00803     pTempIO = (PPER_IO_CONTEXT)(lpPerSocketContext->pIOContext);
00804     do {
00805       pNextIO = (PPER_IO_CONTEXT)(pTempIO->pIOContextForward);
00806       if( pTempIO ) {
00807
00808         //
00809         //The overlapped structure is safe to free when only the posted i/o has
00810         //completed. Here we only need to test those posted but not yet received
00811         //by PQCS in the shutdown process.
00812         //
00813         if( g_bEndServer )
00814           while( !HasOverlappedIoCompleted((LPOVERLAPPED)pTempIO) ) Sleep(0);
00815         xfree(pTempIO);
00816         pTempIO = NULL;
00817       }
00818       pTempIO = pNextIO;
00819     } while( pNextIO );
00820
00821     xfree(lpPerSocketContext);
00822     lpPerSocketContext = NULL;
00823
00824   } else {
00825     myprintf("CtxtListDeleteFrom: lpPerSocketContext is NULL\n");
00826   }
00827
00828   LeaveCriticalSection(&g_CriticalSection);
00829   return;
00830 }
00831
00832 //
00833 //  Free all context structure in the global list of context structures.
00834 //
00835 VOID CtxtListFree() {
00836
00837   PPER_SOCKET_CONTEXT     pTemp1, pTemp2;
00838
00839   EnterCriticalSection(&g_CriticalSection);
00840
00841   pTemp1 = g_pCtxtList;
00842   while( pTemp1 ) {
00843     pTemp2 = pTemp1->pCtxtBack;
00844     CloseClient(pTemp1, FALSE);
00845     pTemp1 = pTemp2;
00846   }
00847
00848   LeaveCriticalSection(&g_CriticalSection);
00849   return;
00850 }
00851
00852 //
00853 // Our own printf. This is done because calling printf from multiple
00854 // threads can AV. The standard out for WriteConsole is buffered...
00855 //
00856 int myprintf (const char *lpFormat, ... ) {
00857
00858   int nLen = 0;
00859   int nRet = 0;
00860   char cBuffer[512] ;
00861   va_list arglist ;
00862   HANDLE hOut = NULL;
00863
00864   ZeroMemory(cBuffer, sizeof(cBuffer));
00865
00866   va_start(arglist, lpFormat);
00867
00868   nLen = lstrlen( lpFormat ) ;
00869   nRet = wvsprintf( cBuffer, lpFormat, arglist );
00870
00871   if( nRet >= nLen || GetLastError() == 0 ) {
00872     hOut = GetStdHandle(STD_OUTPUT_HANDLE) ;
00873     if( hOut != INVALID_HANDLE_VALUE )
00874       WriteConsole( hOut, cBuffer, lstrlen(cBuffer), (LPDWORD)&nLen, NULL ) ;
00875   }
00876
00877   return nLen ;
00878 }
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/ComSyncObject/StdAfx.Cpp Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • ComSyncObject

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/sky.h Source File

  • SysMgmt
  • MMC
  • Menubtn

sky.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SKY_H
00021 #define _SKY_H
00022
00023 #include "DeleBase.h"
00024
00025 class CSkyBasedVehicle : public CDelegationBase {
00026 public:
00027     CSkyBasedVehicle() { }
00028
00029     virtual ~CSkyBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Sky-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_SKYICON; }
00034
00035 public:
00036     // virtual functions go here (for MMCN_*)
00037
00038 private:
00039     enum { IDM_NEW_SKY = 3 };
00040
00041     // {2974380F-4C4B-11d2-89D8-000021473128}
00042     static const GUID thisGuid;
00043 };
00044
00045 #endif // _SKY_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/STAObject/STATest.Cpp Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • STAObject

STATest.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: STATest.cpp
00004
00005 Summary: Implementation of CSTATest
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021 #include "stdafx.h"
00022 #include "STAObject.h"
00023 #include "STATest.h"
00024
00025 #define LOOPCOUNT 10000
00026
00027 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00028
00029 Class: CSTATest
00030
00031 CSTATest is a simply object that does nothing but is marked as Apartment threaded.
00032 It's purpose is just so our client has an apartment threaded object to call
00033
00034 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00035
00036 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00037
00038 Method: Exercise
00039
00040 Summary: Exercise simply loops for a while doing some math on the stack
00041
00042
00043 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00044
00045 STDMETHODIMP CSTATest::Exercise(void)
00046 {
00047
00048   DWORD dwCount, dwValue = 0;
00049
00050   for (dwCount = 0; dwCount < LOOPCOUNT; dwCount++)
00051     dwValue += dwCount;
00052
00053   return S_OK;
00054 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Consumer/Globals.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Consumer

Globals.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   Globals.cpp
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #include "PreComp.h"
00017 #include <wbemprov.h>
00018
00019 #include <initguid.h>
00020 #ifndef INITGUID
00021 #define INITGUID
00022 #endif
00023
00024 #include "Globals.h"
00025
00026 /******************************************************************************
00027  *
00028  *  Name:
00029  *
00030  *    s_LocksInProgress
00031  *    s_ObjectsInProgress
00032  *
00033  *  Description:
00034  *
00035  *    Keep a count of outstanding global objects. Used for debugging purposes.
00036  *
00037  *****************************************************************************/
00038
00039 LONG Provider_Globals :: s_LocksInProgress ;
00040 LONG Provider_Globals :: s_ObjectsInProgress ;
00041
00042 /******************************************************************************
00043  *
00044  *  Name: Global_Startup ()
00045  *
00046  *
00047  *  Description:
00048  *
00049  *    Global function to handle initialization.
00050  *    Place user code here.
00051  *
00052  *****************************************************************************/
00053
00054 HRESULT Provider_Globals :: Global_Startup ()
00055 {
00056   HRESULT t_Result = S_OK ;
00057   return t_Result ;
00058 }
00059
00060 /******************************************************************************
00061  *
00062  *  Name: Global_Shutdown ()
00063  *
00064  *
00065  *  Description:
00066  *
00067  *    Global function to handle uninitialization.
00068  *    Place user code here.
00069  *
00070  *****************************************************************************/
00071
00072 HRESULT Provider_Globals :: Global_Shutdown ()
00073 {
00074   HRESULT t_Result = S_OK ;
00075   return t_Result ;
00076 }
00077
00078 /******************************************************************************
00079  *
00080  *  Name: CreateInstance
00081  *
00082  *
00083  *  Description:
00084  *
00085  *      Wrapper function for CoCreateInstance/CoGetClassObject.
00086  *      Useful for specific security context and debugging purposes.
00087  *
00088  *****************************************************************************/
00089
00090 HRESULT Provider_Globals :: CreateInstance (
00091
00092   const CLSID &a_ReferenceClsid ,
00093   LPUNKNOWN a_OuterUnknown ,
00094   const DWORD &a_ClassContext ,
00095   const UUID &a_ReferenceInterfaceId ,
00096   void **a_ObjectInterface
00097 )
00098 {
00099   HRESULT t_Result = S_OK ;
00100
00101 #if 1
00102
00103 /*
00104  *  Use standard implementation
00105  */
00106
00107    t_Result = CoCreateInstance (
00108
00109     a_ReferenceClsid ,
00110     a_OuterUnknown ,
00111     a_ClassContext ,
00112     a_ReferenceInterfaceId ,
00113     ( void ** )  a_ObjectInterface
00114   );
00115
00116 #else
00117
00118 /*
00119  *  Tweak configuration settings for call.
00120  */
00121
00122   COAUTHIDENTITY t_AuthenticationIdentity ;
00123   ZeroMemory ( & t_AuthenticationIdentity , sizeof ( t_AuthenticationIdentity ) ) ;
00124
00125   t_AuthenticationIdentity.User = NULL ;
00126   t_AuthenticationIdentity.UserLength = 0 ;
00127   t_AuthenticationIdentity.Domain = NULL ;
00128   t_AuthenticationIdentity.DomainLength = 0 ;
00129   t_AuthenticationIdentity.Password = NULL ;
00130   t_AuthenticationIdentity.PasswordLength = 0 ;
00131   t_AuthenticationIdentity.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE ;
00132
00133   COAUTHINFO t_AuthenticationInfo ;
00134   ZeroMemory ( & t_AuthenticationInfo , sizeof ( t_AuthenticationInfo ) ) ;
00135
00136     t_AuthenticationInfo.dwAuthnSvc = RPC_C_AUTHN_DEFAULT ;
00137     t_AuthenticationInfo.dwAuthzSvc = RPC_C_AUTHZ_DEFAULT ;
00138     t_AuthenticationInfo.pwszServerPrincName = NULL ;
00139     t_AuthenticationInfo.dwAuthnLevel = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; // RPC_C_AUTHN_LEVEL_CONNECT ;
00140     t_AuthenticationInfo.dwImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE  ;
00141     t_AuthenticationInfo.dwCapabilities = EOAC_NONE ;
00142     t_AuthenticationInfo.pAuthIdentityData = NULL ;
00143
00144   COSERVERINFO t_ServerInfo ;
00145   ZeroMemory ( & t_ServerInfo , sizeof ( t_ServerInfo ) ) ;
00146
00147   t_ServerInfo.pwszName = NULL ;
00148     t_ServerInfo.dwReserved2 = 0 ;
00149     t_ServerInfo.pAuthInfo = & t_AuthenticationInfo ;
00150
00151   IClassFactory *t_ClassFactory = NULL ;
00152
00153   t_Result = CoGetClassObject (
00154
00155     a_ReferenceClsid ,
00156     a_ClassContext ,
00157     & t_ServerInfo ,
00158     IID_IClassFactory ,
00159     ( void ** )  & t_ClassFactory
00160   ) ;
00161
00162   if ( SUCCEEDED ( t_Result ) )
00163   {
00164     t_Result = t_ClassFactory->CreateInstance (
00165
00166       a_OuterUnknown ,
00167       a_ReferenceInterfaceId ,
00168       a_ObjectInterface
00169     );
00170
00171     t_ClassFactory->Release () ;
00172   }
00173
00174 #endif
00175
00176   return t_Result ;
00177 }
00178
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/backgrnd.Cpp Source File

  • SysMgmt
  • MMC
  • Nodes

backgrnd.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Backgrnd.h"
00021
00022 const GUID CBackgroundFolder::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023 const GUID CBackground::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00024
00025 #define WM_NEWOBJECT WM_APP
00026 #define WM_DISCOVERYCOMPLETE (WM_APP + 1)
00027
00028 //==============================================================
00029 //
00030 // CBackgroundFolder implementation
00031 //
00032 //
00033 CBackgroundFolder::CBackgroundFolder()
00034 : m_pConsoleNameSpace(NULL), m_scopeitem(0), m_threadId(0), m_thread(NULL),
00035 m_running(false), m_bViewUpdated(false)
00036 {
00037     ZeroMemory(m_children, sizeof(m_children));
00038
00039     WNDCLASS wndClass;
00040
00041     ZeroMemory(&wndClass, sizeof(WNDCLASS));
00042
00043     wndClass.lpfnWndProc = WindowProc;
00044     wndClass.lpszClassName = _T("backgroundthreadwindow");
00045     wndClass.hInstance = g_hinst;
00046
00047     ATOM atom = RegisterClass(&wndClass);
00048     m_backgroundHwnd = CreateWindow(
00049             _T("backgroundthreadwindow"),  // pointer to registered class name
00050             NULL, // pointer to window name
00051             0,        // window style
00052             0,                // horizontal position of window
00053             0,                // vertical position of window
00054             0,           // window width
00055             0,          // window height
00056             NULL,      // handle to parent or owner window
00057             NULL,          // handle to menu or child-window identifier
00058             g_hinst,     // handle to application instance
00059             (void *)this        // pointer to window-creation data
00060         );
00061
00062     if (m_backgroundHwnd)
00063         SetWindowLong(m_backgroundHwnd, GWL_USERDATA, (LONG)this);
00064
00065     InitializeCriticalSection(&m_critSect);
00066 }
00067
00068 CBackgroundFolder::~CBackgroundFolder()
00069 {
00070     StopThread();
00071
00072     for (int n = 0; n < MAX_CHILDREN; n++)
00073         if (m_children[n] != NULL)
00074             delete m_children[n];
00075
00076     if (m_backgroundHwnd != NULL)
00077         DestroyWindow(m_backgroundHwnd);
00078
00079     UnregisterClass(_T("backgroundthreadwindow"), NULL);
00080
00081     DeleteCriticalSection(&m_critSect);
00082 }
00083
00084 LRESULT CALLBACK CBackgroundFolder::WindowProc(
00085       HWND hwnd,      // handle to window
00086       UINT uMsg,      // message identifier
00087       WPARAM wParam,  // first message parameter
00088       LPARAM lParam   // second message parameter
00089     )
00090 {
00091     CBackgroundFolder *pThis = (CBackgroundFolder *)GetWindowLong(hwnd, GWL_USERDATA);
00092
00093     switch (uMsg) {
00094     case WM_NEWOBJECT:
00095         _ASSERT(pThis != NULL);
00096         pThis->AddItem(lParam);
00097         break;
00098
00099     case WM_DISCOVERYCOMPLETE:
00100         _ASSERT(pThis != NULL);
00101         pThis->m_bViewUpdated = true;
00102         pThis->StopThread();
00103         break;
00104    }
00105
00106     return DefWindowProc(hwnd, uMsg, wParam, lParam);
00107 }
00108
00109 DWORD WINAPI CBackgroundFolder::ThreadProc(
00110   LPVOID lpParameter   // thread data
00111 )
00112 {
00113     CBackgroundFolder *pThis = (CBackgroundFolder *)lpParameter;
00114
00115     EnterCriticalSection(&pThis->m_critSect);
00116     pThis->m_running = true;
00117     LeaveCriticalSection(&pThis->m_critSect);
00118
00119     for (int n = 0; n < MAX_CHILDREN; n++) {
00120         EnterCriticalSection(&pThis->m_critSect);
00121         bool running = pThis->m_running;
00122         LeaveCriticalSection(&pThis->m_critSect);
00123
00124         if (running == false)
00125             return 0;
00126
00127         PostMessage(pThis->m_backgroundHwnd, WM_NEWOBJECT, 0, n);
00128         Sleep(500);
00129     }
00130
00131     PostMessage(pThis->m_backgroundHwnd, WM_DISCOVERYCOMPLETE, 0, 0);
00132
00133     return 0;
00134 }
00135
00136 void CBackgroundFolder::StartThread()
00137 {
00138     EnterCriticalSection(&m_critSect);
00139     m_thread = CreateThread(NULL, 0, ThreadProc, (void *)this, 0, &m_threadId);
00140     LeaveCriticalSection(&m_critSect);
00141 }
00142
00143 void CBackgroundFolder::StopThread()
00144 {
00145     EnterCriticalSection(&m_critSect);
00146     m_running = false;
00147
00148     if (m_thread != NULL) {
00149         // this is ugly, wait for 10 seconds, then kill the thread
00150         DWORD res = WaitForSingleObject(m_thread, 10000);
00151
00152         if (res == WAIT_TIMEOUT)
00153             TerminateThread(m_thread, 0);
00154
00155         CloseHandle(m_thread);
00156
00157         m_thread = NULL;
00158     }
00159     LeaveCriticalSection(&m_critSect);
00160 }
00161
00162 void CBackgroundFolder::AddItem(int id)
00163 {
00164     HRESULT hr;
00165
00166     EnterCriticalSection(&m_critSect);
00167
00168     _ASSERT(m_children[id] == NULL);
00169
00170     m_children[id] = new CBackground(id);
00171
00172     SCOPEDATAITEM sdi;
00173
00174     // insert items here
00175     ZeroMemory(&sdi, sizeof(SCOPEDATAITEM));
00176
00177     sdi.mask = SDI_STR       |   // Displayname is valid
00178         SDI_PARAM     |   // lParam is valid
00179         SDI_IMAGE     |   // nImage is valid
00180         SDI_OPENIMAGE |   // nOpenImage is valid
00181         SDI_PARENT    |
00182         SDI_CHILDREN;
00183
00184     sdi.relativeID  = (HSCOPEITEM)m_scopeitem;
00185     sdi.nImage      = m_children[id]->GetBitmapIndex();
00186     sdi.nOpenImage  = INDEX_OPENFOLDER;
00187     sdi.displayname = MMC_CALLBACK;
00188     sdi.lParam      = (LPARAM)m_children[id];       // The cookie
00189     sdi.cChildren   = 0;
00190
00191     hr = m_pConsoleNameSpace->InsertItem( &sdi );
00192     _ASSERT( SUCCEEDED(hr) );
00193
00194     m_children[id]->SetHandle(sdi.ID);
00195
00196     LeaveCriticalSection(&m_critSect);
00197
00198     return;
00199 }
00200
00201 HRESULT CBackgroundFolder::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00202 {
00203     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00204         (long *)m_pBMapLg, // pointer to a handle
00205         0, // index of the first image in the strip
00206         RGB(0, 128, 128)  // color of the icon mask
00207         );
00208 }
00209
00210 HRESULT CBackgroundFolder::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00211 {
00212     // cache the stuff
00213     m_pConsoleNameSpace = pConsoleNameSpace;
00214     m_scopeitem = parent;
00215
00216     if (m_bViewUpdated == false && m_running == false)
00217         StartThread();
00218
00219     return S_OK;
00220 }
00221
00222 HRESULT CBackgroundFolder::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00223 {
00224     m_bSelected = (bSelect && bScope) ? true : false;
00225
00226     if (bSelect && !m_running) {
00227         IConsoleVerb *pConsoleVerb;
00228
00229         HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00230         _ASSERT(SUCCEEDED(hr));
00231
00232         hr = pConsoleVerb->SetVerbState(MMC_VERB_REFRESH, ENABLED, TRUE);
00233
00234         pConsoleVerb->Release();
00235     }
00236
00237     return S_OK;
00238 }
00239
00240 HRESULT CBackgroundFolder::OnRefresh()
00241 {
00242     HRESULT hr = S_OK;
00243
00244     StopThread();
00245
00246     EnterCriticalSection(&m_critSect);
00247     for (int n = 0; n < MAX_CHILDREN; n++) {
00248         if (m_children[n] != NULL) {
00249             HSCOPEITEM hItem = m_children[n]->GetHandle();
00250             hr = m_pConsoleNameSpace->DeleteItem(hItem, TRUE);
00251
00252             delete m_children[n];
00253             m_children[n] = NULL;
00254         }
00255     }
00256     LeaveCriticalSection(&m_critSect);
00257
00258     m_bViewUpdated = false;
00259
00260     StartThread();
00261
00262     return S_OK;
00263 }
00264
00265 const _TCHAR *CBackground::GetDisplayName(int nCol)
00266 {
00267     _TCHAR buf[128];
00268
00269     wsprintf(buf, _T("Background object #%d"), m_id);
00270
00271     _TCHAR *pszCol =
00272         static_cast<_TCHAR *>(CoTaskMemAlloc((_tcslen(buf) + 1) * sizeof(_TCHAR)));
00273     _tcscpy(pszCol, buf);
00274
00275     return pszCol;
00276 }
00277
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/Resource.h Source File

  • NetDS
  • fax
  • PrintSdi

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by PrintSDI.rc
00004 //
00005 #define IDD_ABOUTBOX                    100
00006 #define IDR_MAINFRAME                   128
00007 #define IDR_PRINTSTYPE                  129
00008 #define IDD_NEWDIALOG                   130
00009 #define IDD_FAX                         131
00010 #define IDC_EDIT1                       1000
00011 #define IDC_CIRCLE                      1001
00012 #define IDC_SQUARE                      1002
00013 #define IDC_TRIANGLE                    1003
00014 #define IDC_EDIT2                       1004
00015 #define ID_FILE_FAX                     32771
00016
00017 // Next default values for new objects
00018 //
00019 #ifdef APSTUDIO_INVOKED
00020 #ifndef APSTUDIO_READONLY_SYMBOLS
00021 #define _APS_3D_CONTROLS                     1
00022 #define _APS_NEXT_RESOURCE_VALUE        132
00023 #define _APS_NEXT_COMMAND_VALUE         32772
00024 #define _APS_NEXT_CONTROL_VALUE         1005
00025 #define _APS_NEXT_SYMED_VALUE           101
00026 #endif
00027 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Draw.h Source File

  • Multimedia
  • Gdi
  • GdiDemo

Draw.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012
00013 #ifdef WIN16
00014 #define APIENTRY FAR PASCAL
00015 typedef WORD WPARAM;
00016 //#else
00017 //typedef DWORD WPARAM;
00018 #endif
00019
00020 #define DRAWCLASS  "DRAWDEMO"
00021
00022
00023 #define OBJ_RECTANGLE       0
00024 #define OBJ_ELLIPSE         1
00025 #define OBJ_ROUNDRECT       2
00026 #define OBJ_CHORD           3
00027 #define OBJ_PIE             4
00028
00029
00030 typedef struct _DRAWDATA
00031 {
00032     int    nObject;
00033 } DRAWDATA;
00034 typedef DRAWDATA      *PDRAWDATA;
00035 typedef DRAWDATA NEAR *NPDRAWDATA;
00036 typedef DRAWDATA FAR  *LPDRAWDATA;
00037
00038
00039 /*
00040 ** DRAW WINDOW ROUTINES (draw.c)
00041 */
00042 HWND  FAR      CreateDrawWindow(HWND,int);
00043 LRESULT  CALLBACK DrawProc(HWND,UINT,WPARAM,LPARAM);
00044 BOOL           DrawCreateProc(HWND);
00045 VOID           DrawDestroyProc(HWND);
00046 BOOL           DrawCommandProc(HWND,WPARAM,LPARAM);
00047 VOID           DrawPaintProc(HWND);
00048
00049
00050 VOID           DrawObject(HWND);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/people.h Source File

  • SysMgmt
  • MMC
  • Nodes

people.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _PEOPLE_H
00021 #define _PEOPLE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CBicycle : public CDelegationBase {
00026 public:
00027     CBicycle(int i) : id(i) { }
00028     virtual ~CBicycle() {}
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00033
00034 private:
00035     // {2974380D-4C4B-11d2-89D8-000021473128}
00036     static const GUID thisGuid;
00037
00038     int id;
00039 };
00040
00041 class CBicycleFolder : public CDelegationBase {
00042 public:
00043     CBicycleFolder();
00044     virtual ~CBicycleFolder();
00045
00046     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Bicycles"); }
00047     virtual const GUID & getNodeType() { return thisGuid; }
00048     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00049
00050 public:
00051     // virtual functions go here (for MMCN_*)
00052     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00053
00054 private:
00055     // {2974380D-4C4B-11d2-89D8-000021473128}
00056     static const GUID thisGuid;
00057
00058     enum { NUMBER_OF_CHILDREN = 20 };
00059     CDelegationBase *children[NUMBER_OF_CHILDREN];
00060 };
00061
00062 class CSkateboard : public CDelegationBase {
00063 public:
00064     CSkateboard(int i) : id(i) { }
00065     virtual ~CSkateboard() {}
00066
00067     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00068     virtual const GUID & getNodeType() { return thisGuid; }
00069     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00070
00071 private:
00072     // {2974380D-4C4B-11d2-89D8-000021473128}
00073     static const GUID thisGuid;
00074
00075     int id;
00076 };
00077
00078 class CSkateboardFolder : public CDelegationBase {
00079 public:
00080     CSkateboardFolder();
00081     virtual ~CSkateboardFolder();
00082
00083     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Skateboards"); }
00084     virtual const GUID & getNodeType() { return thisGuid; }
00085     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00086
00087 public:
00088     // virtual functions go here (for MMCN_*)
00089     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00090
00091 private:
00092     // {2974380D-4C4B-11d2-89D8-000021473128}
00093     static const GUID thisGuid;
00094
00095     enum { NUMBER_OF_CHILDREN = 20 };
00096     CDelegationBase *children[NUMBER_OF_CHILDREN];
00097 };
00098
00099 class CIceSkate : public CDelegationBase {
00100 public:
00101     CIceSkate(int i) : id(i) { }
00102     virtual ~CIceSkate() {}
00103
00104     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00105     virtual const GUID & getNodeType() { return thisGuid; }
00106     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00107
00108 private:
00109     // {2974380D-4C4B-11d2-89D8-000021473128}
00110     static const GUID thisGuid;
00111
00112     int id;
00113 };
00114
00115 class CIceSkateFolder : public CDelegationBase {
00116 public:
00117     CIceSkateFolder();
00118     virtual ~CIceSkateFolder();
00119
00120     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Ice Skates"); }
00121     virtual void GetChildColumnInfo(RESULTDATAITEM *rdi);
00122     virtual const GUID & getNodeType() { return thisGuid; }
00123     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00124
00125   virtual CDelegationBase *GetChildPtr(int index) {
00126     return (index < NUMBER_OF_CHILDREN) ? children[index] : NULL;
00127   }
00128
00129     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions);
00130
00131 public:
00132     // virtual functions go here (for MMCN_*)
00133     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00134     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00135
00136 private:
00137     // {2974380D-4C4B-11d2-89D8-000021473128}
00138     static const GUID thisGuid;
00139
00140     enum { NUMBER_OF_CHILDREN = 5000 };
00141     CDelegationBase *children[NUMBER_OF_CHILDREN];
00142 };
00143
00144 class CPeoplePoweredVehicle : public CDelegationBase {
00145 public:
00146     CPeoplePoweredVehicle();
00147     virtual ~CPeoplePoweredVehicle();
00148
00149     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("People-powered Vehicles"); }
00150     virtual const GUID & getNodeType() { return thisGuid; }
00151     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00152
00153     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00154
00155 private:
00156     enum { IDM_NEW_PEOPLE = 1 };
00157
00158     // {2974380D-4C4B-11d2-89D8-000021473128}
00159     static const GUID thisGuid;
00160
00161     enum { NUMBER_OF_CHILDREN = 3 };
00162     CDelegationBase *children[3];
00163 };
00164
00165 #endif // _PEOPLE_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditCommands/EdCommands.idl Source File

  • Web
  • Browser
  • EditCommands

EdCommands.idl

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // EdCommands.idl : IDL source for EdCommands.dll
00006
00007 // This file will be processed by the MIDL tool to
00008 // produce the type library (EdCommands.tlb) and marshalling code.
00009
00010 import "oaidl.idl";
00011 import "ocidl.idl";
00012   [
00013     object,
00014     uuid(CED48A59-F923-43E7-BBF0-96952F455236),
00015     dual,
00016     helpstring("IBrowserHost Interface"),
00017     pointer_default(unique)
00018   ]
00019   interface IBrowserHost : IDispatch
00020   {
00021     HRESULT Run();
00022     HRESULT Stop();
00023   };
00024
00025 [
00026   uuid(2C7F2F94-CF6F-4C27-A86D-2C51A9EE9AAF),
00027   version(1.0),
00028   helpstring("EdCommands 1.0 Type Library")
00029 ]
00030 library EDCOMMANDSLib
00031 {
00032   importlib("stdole32.tlb");
00033   importlib("stdole2.tlb");
00034
00035   [
00036     uuid(3B30D67E-F866-4126-8470-7D4D27CD7217),
00037     helpstring("BrowserHost Class")
00038   ]
00039   coclass BrowserHost
00040   {
00041     [default] interface IBrowserHost;
00042   };
00043 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/AuthFilt/AuthFilt.c Source File

  • Web
  • iis
  • filters
  • AuthFilt

AuthFilt.c

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1996-2002  Microsoft Corporation
00003
00004   Module Name:
00005
00006     authfilt.c
00007
00008   Abstract:
00009
00010     This module is an example of an ISAPI Authentication Filter.
00011
00012     It demonstrates how to do an authentication filter based on an external
00013     datasource.  Though this sample uses a flat file, access to a database
00014     could easily be plugged in.
00015 */
00016
00017 #include <windows.h>
00018 #include <httpfilt.h>
00019 #include "authfilt.h"
00020
00021 /*
00022   Description:
00023
00024     This function DllLibMain() is the main initialization function for
00025     this DLL. It initializes local variables and prepares it to be invoked
00026     subsequently.
00027
00028   Arguments:
00029
00030     hinstDll          Instance Handle of the DLL
00031     fdwReason         Reason why NT called this DLL
00032     lpvReserved       Reserved parameter for future use.
00033
00034   Return Value:
00035
00036     Returns TRUE is successful; otherwise FALSE is returned.
00037 */
00038
00039 BOOL WINAPI DllMain(IN HINSTANCE  hinstDll, IN DWORD fdwReason, IN LPVOID lpvContext OPTIONAL)
00040 {
00041   BOOL fReturn = TRUE;
00042
00043   switch (fdwReason)
00044   {
00045     case DLL_PROCESS_ATTACH :
00046
00047       if (!InitializeUserDatabase() || !InitializeCache())
00048       {
00049         DbgWrite((DEST, "[GetFilterVersion] Database or cache failed, error %d\n", GetLastError()))
00050
00051         return FALSE;
00052       }
00053
00054       /* We don't care about thread attach/detach notifications */
00055
00056       DisableThreadLibraryCalls(hinstDll);
00057
00058       break;
00059
00060     case DLL_PROCESS_DETACH :
00061
00062       if (lpvContext != NULL)
00063       {
00064         TerminateCache();
00065         TerminateUserDatabase();
00066       }
00067
00068       break;
00069
00070     default :
00071
00072       break;
00073   }
00074
00075   return fReturn;
00076 }
00077
00078 BOOL WINAPI GetFilterVersion(HTTP_FILTER_VERSION *pVer)
00079 {
00080   DbgWrite(( DEST,
00081     "[GetFilterVersion] Server filter version is %d.%d\n",
00082     HIWORD(pVer->dwServerFilterVersion ),
00083     LOWORD(pVer->dwServerFilterVersion )));
00084
00085   pVer->dwFilterVersion = HTTP_FILTER_REVISION;
00086
00087   /* Specify the types and order of notification */
00088
00089   pVer->dwFlags = (SF_NOTIFY_SECURE_PORT |
00090     SF_NOTIFY_NONSECURE_PORT |
00091     SF_NOTIFY_AUTHENTICATION |
00092     SF_NOTIFY_LOG |
00093     SF_NOTIFY_ORDER_DEFAULT);
00094
00095   strcpy(pVer->lpszFilterDesc, "Sample Authentication Filter, version 1.0");
00096
00097   return TRUE;
00098 }
00099
00100 /*
00101   Description:
00102
00103     Filter notification entry point
00104
00105   Arguments:
00106
00107     pfc              Filter context
00108     NotificationType Type of notification
00109     pvData           Notification specific data
00110
00111   Return Value:
00112
00113     One of the SF_STATUS response codes
00114 */
00115
00116 DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *pfc, DWORD NotificationType, VOID *pvData)
00117 {
00118   BOOL                  fAllowed;
00119   CHAR                  achUser[SF_MAX_USERNAME];
00120   HTTP_FILTER_AUTHENT   *pAuth;
00121   HTTP_FILTER_LOG       *pLog;
00122   CHAR                  *pch;
00123
00124   /*  Handle this notification */
00125
00126   switch (NotificationType)
00127   {
00128     case SF_NOTIFY_AUTHENTICATION :
00129
00130       pAuth = (HTTP_FILTER_AUTHENT *)pvData;
00131
00132       /* Ignore the anonymous user */
00133
00134       if (!*pAuth->pszUser)
00135       {
00136
00137         /*  Tell the server to notify any subsequent notifications in the chain */
00138
00139         return SF_STATUS_REQ_NEXT_NOTIFICATION;
00140       }
00141
00142       /*  Save the unmapped username so we can log it later */
00143
00144       strcpy(achUser, pAuth->pszUser);
00145
00146       /*  Make sure this user is a valid user and map to the appropriate Windows NT user */
00147
00148       if (!ValidateUser(pAuth->pszUser, pAuth->pszPassword, &fAllowed))
00149       {
00150         DbgWrite((DEST,
00151           "[OnAuthentication] Error %d validating user %s\n",
00152           GetLastError(),
00153           pAuth->pszUser));
00154
00155         return SF_STATUS_REQ_ERROR;
00156       }
00157
00158       if (!fAllowed)
00159       {
00160         /* This user isn't allowed access.  Indicate this to the server */
00161
00162         SetLastError(ERROR_ACCESS_DENIED);
00163
00164         return SF_STATUS_REQ_ERROR;
00165       }
00166
00167       /*
00168         Save the unmapped user name so we can log it later on.  We allocate
00169         enough space for two usernames so we can use this memory block
00170         for logging.  Note we may have already allocated it from a previous
00171         request on this TCP session.
00172       */
00173
00174       if (!pfc->pFilterContext)
00175       {
00176         pfc->pFilterContext = pfc->AllocMem(pfc, 2 * SF_MAX_USERNAME + 4, 0);
00177
00178         if (!pfc->pFilterContext)
00179         {
00180           SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00181
00182           return SF_STATUS_REQ_ERROR;
00183         }
00184       }
00185
00186       strcpy((CHAR *)pfc->pFilterContext, achUser);
00187
00188       return SF_STATUS_REQ_HANDLED_NOTIFICATION;
00189
00190     case SF_NOTIFY_LOG :
00191
00192       /*
00193         The unmapped username is in pFilterContext if this filter authenticated this user
00194       */
00195
00196       if (pfc->pFilterContext)
00197       {
00198         pch  = pfc->pFilterContext;
00199         pLog = (HTTP_FILTER_LOG *)pvData;
00200
00201         /*
00202           Put both the original username and the NT mapped username into the log in the form "Original User (NT User)"
00203         */
00204
00205         strcat(pch, " (");
00206         strcat(pch, pLog->pszClientUserName);
00207         strcat(pch, ")");
00208
00209         pLog->pszClientUserName = pch;
00210       }
00211
00212       return SF_STATUS_REQ_NEXT_NOTIFICATION;
00213
00214     default :
00215
00216       DbgWrite((DEST, "[HttpFilterProc] Unknown notification type, %d\n", NotificationType));
00217
00218       break;
00219   }
00220
00221   return SF_STATUS_REQ_NEXT_NOTIFICATION;
00222 }
00223
00224
00225
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/editsess.h Source File

  • WinUI
  • TSFcase

editsess.h

Go to the documentation of this file.
00001 //
00002 // editsess.h
00003 //
00004 // CEditSessionBase declaration.
00005 //
00006
00007 #ifndef EDITSESS_H
00008 #define EDITSESS_H
00009
00010 class CEditSessionBase : public ITfEditSession
00011 {
00012 public:
00013     CEditSessionBase(ITfContext *pContext)
00014     {
00015         _cRef = 1;
00016         _pContext = pContext;
00017         _pContext->AddRef();
00018     }
00019     virtual ~CEditSessionBase()
00020     {
00021         _pContext->Release();
00022     }
00023
00024     // IUnknown
00025     STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj)
00026     {
00027         if (ppvObj == NULL)
00028             return E_INVALIDARG;
00029
00030         *ppvObj = NULL;
00031
00032         if (IsEqualIID(riid, IID_IUnknown) ||
00033             IsEqualIID(riid, IID_ITfEditSession))
00034         {
00035             *ppvObj = (ITfLangBarItemButton *)this;
00036         }
00037
00038         if (*ppvObj)
00039         {
00040             AddRef();
00041             return S_OK;
00042         }
00043
00044         return E_NOINTERFACE;
00045     }
00046     STDMETHODIMP_(ULONG) AddRef(void)
00047     {
00048         return ++_cRef;
00049     }
00050     STDMETHODIMP_(ULONG) Release(void)
00051     {
00052         LONG cr = --_cRef;
00053
00054         assert(_cRef >= 0);
00055
00056         if (_cRef == 0)
00057         {
00058             delete this;
00059         }
00060
00061         return cr;
00062     }
00063
00064     // ITfEditSession
00065     virtual STDMETHODIMP DoEditSession(TfEditCookie ec) = 0;
00066
00067 protected:
00068     ITfContext *_pContext;
00069
00070 private:
00071     LONG _cRef;     // COM ref count
00072 };
00073
00074 #endif // EDITSESS_H
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_EVENT_ENTRY Member List

This is the complete list of members for _EVENT_ENTRY, including all inherited members.
mMessage | _EVENT_ENTRY
qeEventQueueLink | _EVENT_ENTRY
rpeEvent | _EVENT_ENTRY
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/string_fast.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

string_fast.Cpp

Go to the documentation of this file.
00001 // swprintf_fast.cpp
00002 //
00003
00004 #include "stdafx.h"
00005 #include <stdio.h>
00006 #include "string_fast.h"
00007
00008
00009 static const WCHAR char_table[4000] = {
00010     L'0',L'0',L'0',L'\0', L'0',L'0',L'1',L'\0', L'0',L'0',L'2',L'\0', L'0',L'0',L'3',L'\0', L'0',L'0',L'4',L'\0',
00011     L'0',L'0',L'5',L'\0', L'0',L'0',L'6',L'\0', L'0',L'0',L'7',L'\0', L'0',L'0',L'8',L'\0', L'0',L'0',L'9',L'\0',
00012     L'0',L'1',L'0',L'\0', L'0',L'1',L'1',L'\0', L'0',L'1',L'2',L'\0', L'0',L'1',L'3',L'\0', L'0',L'1',L'4',L'\0',
00013     L'0',L'1',L'5',L'\0', L'0',L'1',L'6',L'\0', L'0',L'1',L'7',L'\0', L'0',L'1',L'8',L'\0', L'0',L'1',L'9',L'\0',
00014     L'0',L'2',L'0',L'\0', L'0',L'2',L'1',L'\0', L'0',L'2',L'2',L'\0', L'0',L'2',L'3',L'\0', L'0',L'2',L'4',L'\0',
00015     L'0',L'2',L'5',L'\0', L'0',L'2',L'6',L'\0', L'0',L'2',L'7',L'\0', L'0',L'2',L'8',L'\0', L'0',L'2',L'9',L'\0',
00016     L'0',L'3',L'0',L'\0', L'0',L'3',L'1',L'\0', L'0',L'3',L'2',L'\0', L'0',L'3',L'3',L'\0', L'0',L'3',L'4',L'\0',
00017     L'0',L'3',L'5',L'\0', L'0',L'3',L'6',L'\0', L'0',L'3',L'7',L'\0', L'0',L'3',L'8',L'\0', L'0',L'3',L'9',L'\0',
00018     L'0',L'4',L'0',L'\0', L'0',L'4',L'1',L'\0', L'0',L'4',L'2',L'\0', L'0',L'4',L'3',L'\0', L'0',L'4',L'4',L'\0',
00019     L'0',L'4',L'5',L'\0', L'0',L'4',L'6',L'\0', L'0',L'4',L'7',L'\0', L'0',L'4',L'8',L'\0', L'0',L'4',L'9',L'\0',
00020     L'0',L'5',L'0',L'\0', L'0',L'5',L'1',L'\0', L'0',L'5',L'2',L'\0', L'0',L'5',L'3',L'\0', L'0',L'5',L'4',L'\0',
00021     L'0',L'5',L'5',L'\0', L'0',L'5',L'6',L'\0', L'0',L'5',L'7',L'\0', L'0',L'5',L'8',L'\0', L'0',L'5',L'9',L'\0',
00022     L'0',L'6',L'0',L'\0', L'0',L'6',L'1',L'\0', L'0',L'6',L'2',L'\0', L'0',L'6',L'3',L'\0', L'0',L'6',L'4',L'\0',
00023     L'0',L'6',L'5',L'\0', L'0',L'6',L'6',L'\0', L'0',L'6',L'7',L'\0', L'0',L'6',L'8',L'\0', L'0',L'6',L'9',L'\0',
00024     L'0',L'7',L'0',L'\0', L'0',L'7',L'1',L'\0', L'0',L'7',L'2',L'\0', L'0',L'7',L'3',L'\0', L'0',L'7',L'4',L'\0',
00025     L'0',L'7',L'5',L'\0', L'0',L'7',L'6',L'\0', L'0',L'7',L'7',L'\0', L'0',L'7',L'8',L'\0', L'0',L'7',L'9',L'\0',
00026     L'0',L'8',L'0',L'\0', L'0',L'8',L'1',L'\0', L'0',L'8',L'2',L'\0', L'0',L'8',L'3',L'\0', L'0',L'8',L'4',L'\0',
00027     L'0',L'8',L'5',L'\0', L'0',L'8',L'6',L'\0', L'0',L'8',L'7',L'\0', L'0',L'8',L'8',L'\0', L'0',L'8',L'9',L'\0',
00028     L'0',L'9',L'0',L'\0', L'0',L'9',L'1',L'\0', L'0',L'9',L'2',L'\0', L'0',L'9',L'3',L'\0', L'0',L'9',L'4',L'\0',
00029     L'0',L'9',L'5',L'\0', L'0',L'9',L'6',L'\0', L'0',L'9',L'7',L'\0', L'0',L'9',L'8',L'\0', L'0',L'9',L'9',L'\0',
00030     L'1',L'0',L'0',L'\0', L'1',L'0',L'1',L'\0', L'1',L'0',L'2',L'\0', L'1',L'0',L'3',L'\0', L'1',L'0',L'4',L'\0',
00031     L'1',L'0',L'5',L'\0', L'1',L'0',L'6',L'\0', L'1',L'0',L'7',L'\0', L'1',L'0',L'8',L'\0', L'1',L'0',L'9',L'\0',
00032     L'1',L'1',L'0',L'\0', L'1',L'1',L'1',L'\0', L'1',L'1',L'2',L'\0', L'1',L'1',L'3',L'\0', L'1',L'1',L'4',L'\0',
00033     L'1',L'1',L'5',L'\0', L'1',L'1',L'6',L'\0', L'1',L'1',L'7',L'\0', L'1',L'1',L'8',L'\0', L'1',L'1',L'9',L'\0',
00034     L'1',L'2',L'0',L'\0', L'1',L'2',L'1',L'\0', L'1',L'2',L'2',L'\0', L'1',L'2',L'3',L'\0', L'1',L'2',L'4',L'\0',
00035     L'1',L'2',L'5',L'\0', L'1',L'2',L'6',L'\0', L'1',L'2',L'7',L'\0', L'1',L'2',L'8',L'\0', L'1',L'2',L'9',L'\0',
00036     L'1',L'3',L'0',L'\0', L'1',L'3',L'1',L'\0', L'1',L'3',L'2',L'\0', L'1',L'3',L'3',L'\0', L'1',L'3',L'4',L'\0',
00037     L'1',L'3',L'5',L'\0', L'1',L'3',L'6',L'\0', L'1',L'3',L'7',L'\0', L'1',L'3',L'8',L'\0', L'1',L'3',L'9',L'\0',
00038     L'1',L'4',L'0',L'\0', L'1',L'4',L'1',L'\0', L'1',L'4',L'2',L'\0', L'1',L'4',L'3',L'\0', L'1',L'4',L'4',L'\0',
00039     L'1',L'4',L'5',L'\0', L'1',L'4',L'6',L'\0', L'1',L'4',L'7',L'\0', L'1',L'4',L'8',L'\0', L'1',L'4',L'9',L'\0',
00040     L'1',L'5',L'0',L'\0', L'1',L'5',L'1',L'\0', L'1',L'5',L'2',L'\0', L'1',L'5',L'3',L'\0', L'1',L'5',L'4',L'\0',
00041     L'1',L'5',L'5',L'\0', L'1',L'5',L'6',L'\0', L'1',L'5',L'7',L'\0', L'1',L'5',L'8',L'\0', L'1',L'5',L'9',L'\0',
00042     L'1',L'6',L'0',L'\0', L'1',L'6',L'1',L'\0', L'1',L'6',L'2',L'\0', L'1',L'6',L'3',L'\0', L'1',L'6',L'4',L'\0',
00043     L'1',L'6',L'5',L'\0', L'1',L'6',L'6',L'\0', L'1',L'6',L'7',L'\0', L'1',L'6',L'8',L'\0', L'1',L'6',L'9',L'\0',
00044     L'1',L'7',L'0',L'\0', L'1',L'7',L'1',L'\0', L'1',L'7',L'2',L'\0', L'1',L'7',L'3',L'\0', L'1',L'7',L'4',L'\0',
00045     L'1',L'7',L'5',L'\0', L'1',L'7',L'6',L'\0', L'1',L'7',L'7',L'\0', L'1',L'7',L'8',L'\0', L'1',L'7',L'9',L'\0',
00046     L'1',L'8',L'0',L'\0', L'1',L'8',L'1',L'\0', L'1',L'8',L'2',L'\0', L'1',L'8',L'3',L'\0', L'1',L'8',L'4',L'\0',
00047     L'1',L'8',L'5',L'\0', L'1',L'8',L'6',L'\0', L'1',L'8',L'7',L'\0', L'1',L'8',L'8',L'\0', L'1',L'8',L'9',L'\0',
00048     L'1',L'9',L'0',L'\0', L'1',L'9',L'1',L'\0', L'1',L'9',L'2',L'\0', L'1',L'9',L'3',L'\0', L'1',L'9',L'4',L'\0',
00049     L'1',L'9',L'5',L'\0', L'1',L'9',L'6',L'\0', L'1',L'9',L'7',L'\0', L'1',L'9',L'8',L'\0', L'1',L'9',L'9',L'\0',
00050     L'2',L'0',L'0',L'\0', L'2',L'0',L'1',L'\0', L'2',L'0',L'2',L'\0', L'2',L'0',L'3',L'\0', L'2',L'0',L'4',L'\0',
00051     L'2',L'0',L'5',L'\0', L'2',L'0',L'6',L'\0', L'2',L'0',L'7',L'\0', L'2',L'0',L'8',L'\0', L'2',L'0',L'9',L'\0',
00052     L'2',L'1',L'0',L'\0', L'2',L'1',L'1',L'\0', L'2',L'1',L'2',L'\0', L'2',L'1',L'3',L'\0', L'2',L'1',L'4',L'\0',
00053     L'2',L'1',L'5',L'\0', L'2',L'1',L'6',L'\0', L'2',L'1',L'7',L'\0', L'2',L'1',L'8',L'\0', L'2',L'1',L'9',L'\0',
00054     L'2',L'2',L'0',L'\0', L'2',L'2',L'1',L'\0', L'2',L'2',L'2',L'\0', L'2',L'2',L'3',L'\0', L'2',L'2',L'4',L'\0',
00055     L'2',L'2',L'5',L'\0', L'2',L'2',L'6',L'\0', L'2',L'2',L'7',L'\0', L'2',L'2',L'8',L'\0', L'2',L'2',L'9',L'\0',
00056     L'2',L'3',L'0',L'\0', L'2',L'3',L'1',L'\0', L'2',L'3',L'2',L'\0', L'2',L'3',L'3',L'\0', L'2',L'3',L'4',L'\0',
00057     L'2',L'3',L'5',L'\0', L'2',L'3',L'6',L'\0', L'2',L'3',L'7',L'\0', L'2',L'3',L'8',L'\0', L'2',L'3',L'9',L'\0',
00058     L'2',L'4',L'0',L'\0', L'2',L'4',L'1',L'\0', L'2',L'4',L'2',L'\0', L'2',L'4',L'3',L'\0', L'2',L'4',L'4',L'\0',
00059     L'2',L'4',L'5',L'\0', L'2',L'4',L'6',L'\0', L'2',L'4',L'7',L'\0', L'2',L'4',L'8',L'\0', L'2',L'4',L'9',L'\0',
00060     L'2',L'5',L'0',L'\0', L'2',L'5',L'1',L'\0', L'2',L'5',L'2',L'\0', L'2',L'5',L'3',L'\0', L'2',L'5',L'4',L'\0',
00061     L'2',L'5',L'5',L'\0', L'2',L'5',L'6',L'\0', L'2',L'5',L'7',L'\0', L'2',L'5',L'8',L'\0', L'2',L'5',L'9',L'\0',
00062     L'2',L'6',L'0',L'\0', L'2',L'6',L'1',L'\0', L'2',L'6',L'2',L'\0', L'2',L'6',L'3',L'\0', L'2',L'6',L'4',L'\0',
00063     L'2',L'6',L'5',L'\0', L'2',L'6',L'6',L'\0', L'2',L'6',L'7',L'\0', L'2',L'6',L'8',L'\0', L'2',L'6',L'9',L'\0',
00064     L'2',L'7',L'0',L'\0', L'2',L'7',L'1',L'\0', L'2',L'7',L'2',L'\0', L'2',L'7',L'3',L'\0', L'2',L'7',L'4',L'\0',
00065     L'2',L'7',L'5',L'\0', L'2',L'7',L'6',L'\0', L'2',L'7',L'7',L'\0', L'2',L'7',L'8',L'\0', L'2',L'7',L'9',L'\0',
00066     L'2',L'8',L'0',L'\0', L'2',L'8',L'1',L'\0', L'2',L'8',L'2',L'\0', L'2',L'8',L'3',L'\0', L'2',L'8',L'4',L'\0',
00067     L'2',L'8',L'5',L'\0', L'2',L'8',L'6',L'\0', L'2',L'8',L'7',L'\0', L'2',L'8',L'8',L'\0', L'2',L'8',L'9',L'\0',
00068     L'2',L'9',L'0',L'\0', L'2',L'9',L'1',L'\0', L'2',L'9',L'2',L'\0', L'2',L'9',L'3',L'\0', L'2',L'9',L'4',L'\0',
00069     L'2',L'9',L'5',L'\0', L'2',L'9',L'6',L'\0', L'2',L'9',L'7',L'\0', L'2',L'9',L'8',L'\0', L'2',L'9',L'9',L'\0',
00070     L'3',L'0',L'0',L'\0', L'3',L'0',L'1',L'\0', L'3',L'0',L'2',L'\0', L'3',L'0',L'3',L'\0', L'3',L'0',L'4',L'\0',
00071     L'3',L'0',L'5',L'\0', L'3',L'0',L'6',L'\0', L'3',L'0',L'7',L'\0', L'3',L'0',L'8',L'\0', L'3',L'0',L'9',L'\0',
00072     L'3',L'1',L'0',L'\0', L'3',L'1',L'1',L'\0', L'3',L'1',L'2',L'\0', L'3',L'1',L'3',L'\0', L'3',L'1',L'4',L'\0',
00073     L'3',L'1',L'5',L'\0', L'3',L'1',L'6',L'\0', L'3',L'1',L'7',L'\0', L'3',L'1',L'8',L'\0', L'3',L'1',L'9',L'\0',
00074     L'3',L'2',L'0',L'\0', L'3',L'2',L'1',L'\0', L'3',L'2',L'2',L'\0', L'3',L'2',L'3',L'\0', L'3',L'2',L'4',L'\0',
00075     L'3',L'2',L'5',L'\0', L'3',L'2',L'6',L'\0', L'3',L'2',L'7',L'\0', L'3',L'2',L'8',L'\0', L'3',L'2',L'9',L'\0',
00076     L'3',L'3',L'0',L'\0', L'3',L'3',L'1',L'\0', L'3',L'3',L'2',L'\0', L'3',L'3',L'3',L'\0', L'3',L'3',L'4',L'\0',
00077     L'3',L'3',L'5',L'\0', L'3',L'3',L'6',L'\0', L'3',L'3',L'7',L'\0', L'3',L'3',L'8',L'\0', L'3',L'3',L'9',L'\0',
00078     L'3',L'4',L'0',L'\0', L'3',L'4',L'1',L'\0', L'3',L'4',L'2',L'\0', L'3',L'4',L'3',L'\0', L'3',L'4',L'4',L'\0',
00079     L'3',L'4',L'5',L'\0', L'3',L'4',L'6',L'\0', L'3',L'4',L'7',L'\0', L'3',L'4',L'8',L'\0', L'3',L'4',L'9',L'\0',
00080     L'3',L'5',L'0',L'\0', L'3',L'5',L'1',L'\0', L'3',L'5',L'2',L'\0', L'3',L'5',L'3',L'\0', L'3',L'5',L'4',L'\0',
00081     L'3',L'5',L'5',L'\0', L'3',L'5',L'6',L'\0', L'3',L'5',L'7',L'\0', L'3',L'5',L'8',L'\0', L'3',L'5',L'9',L'\0',
00082     L'3',L'6',L'0',L'\0', L'3',L'6',L'1',L'\0', L'3',L'6',L'2',L'\0', L'3',L'6',L'3',L'\0', L'3',L'6',L'4',L'\0',
00083     L'3',L'6',L'5',L'\0', L'3',L'6',L'6',L'\0', L'3',L'6',L'7',L'\0', L'3',L'6',L'8',L'\0', L'3',L'6',L'9',L'\0',
00084     L'3',L'7',L'0',L'\0', L'3',L'7',L'1',L'\0', L'3',L'7',L'2',L'\0', L'3',L'7',L'3',L'\0', L'3',L'7',L'4',L'\0',
00085     L'3',L'7',L'5',L'\0', L'3',L'7',L'6',L'\0', L'3',L'7',L'7',L'\0', L'3',L'7',L'8',L'\0', L'3',L'7',L'9',L'\0',
00086     L'3',L'8',L'0',L'\0', L'3',L'8',L'1',L'\0', L'3',L'8',L'2',L'\0', L'3',L'8',L'3',L'\0', L'3',L'8',L'4',L'\0',
00087     L'3',L'8',L'5',L'\0', L'3',L'8',L'6',L'\0', L'3',L'8',L'7',L'\0', L'3',L'8',L'8',L'\0', L'3',L'8',L'9',L'\0',
00088     L'3',L'9',L'0',L'\0', L'3',L'9',L'1',L'\0', L'3',L'9',L'2',L'\0', L'3',L'9',L'3',L'\0', L'3',L'9',L'4',L'\0',
00089     L'3',L'9',L'5',L'\0', L'3',L'9',L'6',L'\0', L'3',L'9',L'7',L'\0', L'3',L'9',L'8',L'\0', L'3',L'9',L'9',L'\0',
00090     L'4',L'0',L'0',L'\0', L'4',L'0',L'1',L'\0', L'4',L'0',L'2',L'\0', L'4',L'0',L'3',L'\0', L'4',L'0',L'4',L'\0',
00091     L'4',L'0',L'5',L'\0', L'4',L'0',L'6',L'\0', L'4',L'0',L'7',L'\0', L'4',L'0',L'8',L'\0', L'4',L'0',L'9',L'\0',
00092     L'4',L'1',L'0',L'\0', L'4',L'1',L'1',L'\0', L'4',L'1',L'2',L'\0', L'4',L'1',L'3',L'\0', L'4',L'1',L'4',L'\0',
00093     L'4',L'1',L'5',L'\0', L'4',L'1',L'6',L'\0', L'4',L'1',L'7',L'\0', L'4',L'1',L'8',L'\0', L'4',L'1',L'9',L'\0',
00094     L'4',L'2',L'0',L'\0', L'4',L'2',L'1',L'\0', L'4',L'2',L'2',L'\0', L'4',L'2',L'3',L'\0', L'4',L'2',L'4',L'\0',
00095     L'4',L'2',L'5',L'\0', L'4',L'2',L'6',L'\0', L'4',L'2',L'7',L'\0', L'4',L'2',L'8',L'\0', L'4',L'2',L'9',L'\0',
00096     L'4',L'3',L'0',L'\0', L'4',L'3',L'1',L'\0', L'4',L'3',L'2',L'\0', L'4',L'3',L'3',L'\0', L'4',L'3',L'4',L'\0',
00097     L'4',L'3',L'5',L'\0', L'4',L'3',L'6',L'\0', L'4',L'3',L'7',L'\0', L'4',L'3',L'8',L'\0', L'4',L'3',L'9',L'\0',
00098     L'4',L'4',L'0',L'\0', L'4',L'4',L'1',L'\0', L'4',L'4',L'2',L'\0', L'4',L'4',L'3',L'\0', L'4',L'4',L'4',L'\0',
00099     L'4',L'4',L'5',L'\0', L'4',L'4',L'6',L'\0', L'4',L'4',L'7',L'\0', L'4',L'4',L'8',L'\0', L'4',L'4',L'9',L'\0',
00100     L'4',L'5',L'0',L'\0', L'4',L'5',L'1',L'\0', L'4',L'5',L'2',L'\0', L'4',L'5',L'3',L'\0', L'4',L'5',L'4',L'\0',
00101     L'4',L'5',L'5',L'\0', L'4',L'5',L'6',L'\0', L'4',L'5',L'7',L'\0', L'4',L'5',L'8',L'\0', L'4',L'5',L'9',L'\0',
00102     L'4',L'6',L'0',L'\0', L'4',L'6',L'1',L'\0', L'4',L'6',L'2',L'\0', L'4',L'6',L'3',L'\0', L'4',L'6',L'4',L'\0',
00103     L'4',L'6',L'5',L'\0', L'4',L'6',L'6',L'\0', L'4',L'6',L'7',L'\0', L'4',L'6',L'8',L'\0', L'4',L'6',L'9',L'\0',
00104     L'4',L'7',L'0',L'\0', L'4',L'7',L'1',L'\0', L'4',L'7',L'2',L'\0', L'4',L'7',L'3',L'\0', L'4',L'7',L'4',L'\0',
00105     L'4',L'7',L'5',L'\0', L'4',L'7',L'6',L'\0', L'4',L'7',L'7',L'\0', L'4',L'7',L'8',L'\0', L'4',L'7',L'9',L'\0',
00106     L'4',L'8',L'0',L'\0', L'4',L'8',L'1',L'\0', L'4',L'8',L'2',L'\0', L'4',L'8',L'3',L'\0', L'4',L'8',L'4',L'\0',
00107     L'4',L'8',L'5',L'\0', L'4',L'8',L'6',L'\0', L'4',L'8',L'7',L'\0', L'4',L'8',L'8',L'\0', L'4',L'8',L'9',L'\0',
00108     L'4',L'9',L'0',L'\0', L'4',L'9',L'1',L'\0', L'4',L'9',L'2',L'\0', L'4',L'9',L'3',L'\0', L'4',L'9',L'4',L'\0',
00109     L'4',L'9',L'5',L'\0', L'4',L'9',L'6',L'\0', L'4',L'9',L'7',L'\0', L'4',L'9',L'8',L'\0', L'4',L'9',L'9',L'\0',
00110     L'5',L'0',L'0',L'\0', L'5',L'0',L'1',L'\0', L'5',L'0',L'2',L'\0', L'5',L'0',L'3',L'\0', L'5',L'0',L'4',L'\0',
00111     L'5',L'0',L'5',L'\0', L'5',L'0',L'6',L'\0', L'5',L'0',L'7',L'\0', L'5',L'0',L'8',L'\0', L'5',L'0',L'9',L'\0',
00112     L'5',L'1',L'0',L'\0', L'5',L'1',L'1',L'\0', L'5',L'1',L'2',L'\0', L'5',L'1',L'3',L'\0', L'5',L'1',L'4',L'\0',
00113     L'5',L'1',L'5',L'\0', L'5',L'1',L'6',L'\0', L'5',L'1',L'7',L'\0', L'5',L'1',L'8',L'\0', L'5',L'1',L'9',L'\0',
00114     L'5',L'2',L'0',L'\0', L'5',L'2',L'1',L'\0', L'5',L'2',L'2',L'\0', L'5',L'2',L'3',L'\0', L'5',L'2',L'4',L'\0',
00115     L'5',L'2',L'5',L'\0', L'5',L'2',L'6',L'\0', L'5',L'2',L'7',L'\0', L'5',L'2',L'8',L'\0', L'5',L'2',L'9',L'\0',
00116     L'5',L'3',L'0',L'\0', L'5',L'3',L'1',L'\0', L'5',L'3',L'2',L'\0', L'5',L'3',L'3',L'\0', L'5',L'3',L'4',L'\0',
00117     L'5',L'3',L'5',L'\0', L'5',L'3',L'6',L'\0', L'5',L'3',L'7',L'\0', L'5',L'3',L'8',L'\0', L'5',L'3',L'9',L'\0',
00118     L'5',L'4',L'0',L'\0', L'5',L'4',L'1',L'\0', L'5',L'4',L'2',L'\0', L'5',L'4',L'3',L'\0', L'5',L'4',L'4',L'\0',
00119     L'5',L'4',L'5',L'\0', L'5',L'4',L'6',L'\0', L'5',L'4',L'7',L'\0', L'5',L'4',L'8',L'\0', L'5',L'4',L'9',L'\0',
00120     L'5',L'5',L'0',L'\0', L'5',L'5',L'1',L'\0', L'5',L'5',L'2',L'\0', L'5',L'5',L'3',L'\0', L'5',L'5',L'4',L'\0',
00121     L'5',L'5',L'5',L'\0', L'5',L'5',L'6',L'\0', L'5',L'5',L'7',L'\0', L'5',L'5',L'8',L'\0', L'5',L'5',L'9',L'\0',
00122     L'5',L'6',L'0',L'\0', L'5',L'6',L'1',L'\0', L'5',L'6',L'2',L'\0', L'5',L'6',L'3',L'\0', L'5',L'6',L'4',L'\0',
00123     L'5',L'6',L'5',L'\0', L'5',L'6',L'6',L'\0', L'5',L'6',L'7',L'\0', L'5',L'6',L'8',L'\0', L'5',L'6',L'9',L'\0',
00124     L'5',L'7',L'0',L'\0', L'5',L'7',L'1',L'\0', L'5',L'7',L'2',L'\0', L'5',L'7',L'3',L'\0', L'5',L'7',L'4',L'\0',
00125     L'5',L'7',L'5',L'\0', L'5',L'7',L'6',L'\0', L'5',L'7',L'7',L'\0', L'5',L'7',L'8',L'\0', L'5',L'7',L'9',L'\0',
00126     L'5',L'8',L'0',L'\0', L'5',L'8',L'1',L'\0', L'5',L'8',L'2',L'\0', L'5',L'8',L'3',L'\0', L'5',L'8',L'4',L'\0',
00127     L'5',L'8',L'5',L'\0', L'5',L'8',L'6',L'\0', L'5',L'8',L'7',L'\0', L'5',L'8',L'8',L'\0', L'5',L'8',L'9',L'\0',
00128     L'5',L'9',L'0',L'\0', L'5',L'9',L'1',L'\0', L'5',L'9',L'2',L'\0', L'5',L'9',L'3',L'\0', L'5',L'9',L'4',L'\0',
00129     L'5',L'9',L'5',L'\0', L'5',L'9',L'6',L'\0', L'5',L'9',L'7',L'\0', L'5',L'9',L'8',L'\0', L'5',L'9',L'9',L'\0',
00130     L'6',L'0',L'0',L'\0', L'6',L'0',L'1',L'\0', L'6',L'0',L'2',L'\0', L'6',L'0',L'3',L'\0', L'6',L'0',L'4',L'\0',
00131     L'6',L'0',L'5',L'\0', L'6',L'0',L'6',L'\0', L'6',L'0',L'7',L'\0', L'6',L'0',L'8',L'\0', L'6',L'0',L'9',L'\0',
00132     L'6',L'1',L'0',L'\0', L'6',L'1',L'1',L'\0', L'6',L'1',L'2',L'\0', L'6',L'1',L'3',L'\0', L'6',L'1',L'4',L'\0',
00133     L'6',L'1',L'5',L'\0', L'6',L'1',L'6',L'\0', L'6',L'1',L'7',L'\0', L'6',L'1',L'8',L'\0', L'6',L'1',L'9',L'\0',
00134     L'6',L'2',L'0',L'\0', L'6',L'2',L'1',L'\0', L'6',L'2',L'2',L'\0', L'6',L'2',L'3',L'\0', L'6',L'2',L'4',L'\0',
00135     L'6',L'2',L'5',L'\0', L'6',L'2',L'6',L'\0', L'6',L'2',L'7',L'\0', L'6',L'2',L'8',L'\0', L'6',L'2',L'9',L'\0',
00136     L'6',L'3',L'0',L'\0', L'6',L'3',L'1',L'\0', L'6',L'3',L'2',L'\0', L'6',L'3',L'3',L'\0', L'6',L'3',L'4',L'\0',
00137     L'6',L'3',L'5',L'\0', L'6',L'3',L'6',L'\0', L'6',L'3',L'7',L'\0', L'6',L'3',L'8',L'\0', L'6',L'3',L'9',L'\0',
00138     L'6',L'4',L'0',L'\0', L'6',L'4',L'1',L'\0', L'6',L'4',L'2',L'\0', L'6',L'4',L'3',L'\0', L'6',L'4',L'4',L'\0',
00139     L'6',L'4',L'5',L'\0', L'6',L'4',L'6',L'\0', L'6',L'4',L'7',L'\0', L'6',L'4',L'8',L'\0', L'6',L'4',L'9',L'\0',
00140     L'6',L'5',L'0',L'\0', L'6',L'5',L'1',L'\0', L'6',L'5',L'2',L'\0', L'6',L'5',L'3',L'\0', L'6',L'5',L'4',L'\0',
00141     L'6',L'5',L'5',L'\0', L'6',L'5',L'6',L'\0', L'6',L'5',L'7',L'\0', L'6',L'5',L'8',L'\0', L'6',L'5',L'9',L'\0',
00142     L'6',L'6',L'0',L'\0', L'6',L'6',L'1',L'\0', L'6',L'6',L'2',L'\0', L'6',L'6',L'3',L'\0', L'6',L'6',L'4',L'\0',
00143     L'6',L'6',L'5',L'\0', L'6',L'6',L'6',L'\0', L'6',L'6',L'7',L'\0', L'6',L'6',L'8',L'\0', L'6',L'6',L'9',L'\0',
00144     L'6',L'7',L'0',L'\0', L'6',L'7',L'1',L'\0', L'6',L'7',L'2',L'\0', L'6',L'7',L'3',L'\0', L'6',L'7',L'4',L'\0',
00145     L'6',L'7',L'5',L'\0', L'6',L'7',L'6',L'\0', L'6',L'7',L'7',L'\0', L'6',L'7',L'8',L'\0', L'6',L'7',L'9',L'\0',
00146     L'6',L'8',L'0',L'\0', L'6',L'8',L'1',L'\0', L'6',L'8',L'2',L'\0', L'6',L'8',L'3',L'\0', L'6',L'8',L'4',L'\0',
00147     L'6',L'8',L'5',L'\0', L'6',L'8',L'6',L'\0', L'6',L'8',L'7',L'\0', L'6',L'8',L'8',L'\0', L'6',L'8',L'9',L'\0',
00148     L'6',L'9',L'0',L'\0', L'6',L'9',L'1',L'\0', L'6',L'9',L'2',L'\0', L'6',L'9',L'3',L'\0', L'6',L'9',L'4',L'\0',
00149     L'6',L'9',L'5',L'\0', L'6',L'9',L'6',L'\0', L'6',L'9',L'7',L'\0', L'6',L'9',L'8',L'\0', L'6',L'9',L'9',L'\0',
00150     L'7',L'0',L'0',L'\0', L'7',L'0',L'1',L'\0', L'7',L'0',L'2',L'\0', L'7',L'0',L'3',L'\0', L'7',L'0',L'4',L'\0',
00151     L'7',L'0',L'5',L'\0', L'7',L'0',L'6',L'\0', L'7',L'0',L'7',L'\0', L'7',L'0',L'8',L'\0', L'7',L'0',L'9',L'\0',
00152     L'7',L'1',L'0',L'\0', L'7',L'1',L'1',L'\0', L'7',L'1',L'2',L'\0', L'7',L'1',L'3',L'\0', L'7',L'1',L'4',L'\0',
00153     L'7',L'1',L'5',L'\0', L'7',L'1',L'6',L'\0', L'7',L'1',L'7',L'\0', L'7',L'1',L'8',L'\0', L'7',L'1',L'9',L'\0',
00154     L'7',L'2',L'0',L'\0', L'7',L'2',L'1',L'\0', L'7',L'2',L'2',L'\0', L'7',L'2',L'3',L'\0', L'7',L'2',L'4',L'\0',
00155     L'7',L'2',L'5',L'\0', L'7',L'2',L'6',L'\0', L'7',L'2',L'7',L'\0', L'7',L'2',L'8',L'\0', L'7',L'2',L'9',L'\0',
00156     L'7',L'3',L'0',L'\0', L'7',L'3',L'1',L'\0', L'7',L'3',L'2',L'\0', L'7',L'3',L'3',L'\0', L'7',L'3',L'4',L'\0',
00157     L'7',L'3',L'5',L'\0', L'7',L'3',L'6',L'\0', L'7',L'3',L'7',L'\0', L'7',L'3',L'8',L'\0', L'7',L'3',L'9',L'\0',
00158     L'7',L'4',L'0',L'\0', L'7',L'4',L'1',L'\0', L'7',L'4',L'2',L'\0', L'7',L'4',L'3',L'\0', L'7',L'4',L'4',L'\0',
00159     L'7',L'4',L'5',L'\0', L'7',L'4',L'6',L'\0', L'7',L'4',L'7',L'\0', L'7',L'4',L'8',L'\0', L'7',L'4',L'9',L'\0',
00160     L'7',L'5',L'0',L'\0', L'7',L'5',L'1',L'\0', L'7',L'5',L'2',L'\0', L'7',L'5',L'3',L'\0', L'7',L'5',L'4',L'\0',
00161     L'7',L'5',L'5',L'\0', L'7',L'5',L'6',L'\0', L'7',L'5',L'7',L'\0', L'7',L'5',L'8',L'\0', L'7',L'5',L'9',L'\0',
00162     L'7',L'6',L'0',L'\0', L'7',L'6',L'1',L'\0', L'7',L'6',L'2',L'\0', L'7',L'6',L'3',L'\0', L'7',L'6',L'4',L'\0',
00163     L'7',L'6',L'5',L'\0', L'7',L'6',L'6',L'\0', L'7',L'6',L'7',L'\0', L'7',L'6',L'8',L'\0', L'7',L'6',L'9',L'\0',
00164     L'7',L'7',L'0',L'\0', L'7',L'7',L'1',L'\0', L'7',L'7',L'2',L'\0', L'7',L'7',L'3',L'\0', L'7',L'7',L'4',L'\0',
00165     L'7',L'7',L'5',L'\0', L'7',L'7',L'6',L'\0', L'7',L'7',L'7',L'\0', L'7',L'7',L'8',L'\0', L'7',L'7',L'9',L'\0',
00166     L'7',L'8',L'0',L'\0', L'7',L'8',L'1',L'\0', L'7',L'8',L'2',L'\0', L'7',L'8',L'3',L'\0', L'7',L'8',L'4',L'\0',
00167     L'7',L'8',L'5',L'\0', L'7',L'8',L'6',L'\0', L'7',L'8',L'7',L'\0', L'7',L'8',L'8',L'\0', L'7',L'8',L'9',L'\0',
00168     L'7',L'9',L'0',L'\0', L'7',L'9',L'1',L'\0', L'7',L'9',L'2',L'\0', L'7',L'9',L'3',L'\0', L'7',L'9',L'4',L'\0',
00169     L'7',L'9',L'5',L'\0', L'7',L'9',L'6',L'\0', L'7',L'9',L'7',L'\0', L'7',L'9',L'8',L'\0', L'7',L'9',L'9',L'\0',
00170     L'8',L'0',L'0',L'\0', L'8',L'0',L'1',L'\0', L'8',L'0',L'2',L'\0', L'8',L'0',L'3',L'\0', L'8',L'0',L'4',L'\0',
00171     L'8',L'0',L'5',L'\0', L'8',L'0',L'6',L'\0', L'8',L'0',L'7',L'\0', L'8',L'0',L'8',L'\0', L'8',L'0',L'9',L'\0',
00172     L'8',L'1',L'0',L'\0', L'8',L'1',L'1',L'\0', L'8',L'1',L'2',L'\0', L'8',L'1',L'3',L'\0', L'8',L'1',L'4',L'\0',
00173     L'8',L'1',L'5',L'\0', L'8',L'1',L'6',L'\0', L'8',L'1',L'7',L'\0', L'8',L'1',L'8',L'\0', L'8',L'1',L'9',L'\0',
00174     L'8',L'2',L'0',L'\0', L'8',L'2',L'1',L'\0', L'8',L'2',L'2',L'\0', L'8',L'2',L'3',L'\0', L'8',L'2',L'4',L'\0',
00175     L'8',L'2',L'5',L'\0', L'8',L'2',L'6',L'\0', L'8',L'2',L'7',L'\0', L'8',L'2',L'8',L'\0', L'8',L'2',L'9',L'\0',
00176     L'8',L'3',L'0',L'\0', L'8',L'3',L'1',L'\0', L'8',L'3',L'2',L'\0', L'8',L'3',L'3',L'\0', L'8',L'3',L'4',L'\0',
00177     L'8',L'3',L'5',L'\0', L'8',L'3',L'6',L'\0', L'8',L'3',L'7',L'\0', L'8',L'3',L'8',L'\0', L'8',L'3',L'9',L'\0',
00178     L'8',L'4',L'0',L'\0', L'8',L'4',L'1',L'\0', L'8',L'4',L'2',L'\0', L'8',L'4',L'3',L'\0', L'8',L'4',L'4',L'\0',
00179     L'8',L'4',L'5',L'\0', L'8',L'4',L'6',L'\0', L'8',L'4',L'7',L'\0', L'8',L'4',L'8',L'\0', L'8',L'4',L'9',L'\0',
00180     L'8',L'5',L'0',L'\0', L'8',L'5',L'1',L'\0', L'8',L'5',L'2',L'\0', L'8',L'5',L'3',L'\0', L'8',L'5',L'4',L'\0',
00181     L'8',L'5',L'5',L'\0', L'8',L'5',L'6',L'\0', L'8',L'5',L'7',L'\0', L'8',L'5',L'8',L'\0', L'8',L'5',L'9',L'\0',
00182     L'8',L'6',L'0',L'\0', L'8',L'6',L'1',L'\0', L'8',L'6',L'2',L'\0', L'8',L'6',L'3',L'\0', L'8',L'6',L'4',L'\0',
00183     L'8',L'6',L'5',L'\0', L'8',L'6',L'6',L'\0', L'8',L'6',L'7',L'\0', L'8',L'6',L'8',L'\0', L'8',L'6',L'9',L'\0',
00184     L'8',L'7',L'0',L'\0', L'8',L'7',L'1',L'\0', L'8',L'7',L'2',L'\0', L'8',L'7',L'3',L'\0', L'8',L'7',L'4',L'\0',
00185     L'8',L'7',L'5',L'\0', L'8',L'7',L'6',L'\0', L'8',L'7',L'7',L'\0', L'8',L'7',L'8',L'\0', L'8',L'7',L'9',L'\0',
00186     L'8',L'8',L'0',L'\0', L'8',L'8',L'1',L'\0', L'8',L'8',L'2',L'\0', L'8',L'8',L'3',L'\0', L'8',L'8',L'4',L'\0',
00187     L'8',L'8',L'5',L'\0', L'8',L'8',L'6',L'\0', L'8',L'8',L'7',L'\0', L'8',L'8',L'8',L'\0', L'8',L'8',L'9',L'\0',
00188     L'8',L'9',L'0',L'\0', L'8',L'9',L'1',L'\0', L'8',L'9',L'2',L'\0', L'8',L'9',L'3',L'\0', L'8',L'9',L'4',L'\0',
00189     L'8',L'9',L'5',L'\0', L'8',L'9',L'6',L'\0', L'8',L'9',L'7',L'\0', L'8',L'9',L'8',L'\0', L'8',L'9',L'9',L'\0',
00190     L'9',L'0',L'0',L'\0', L'9',L'0',L'1',L'\0', L'9',L'0',L'2',L'\0', L'9',L'0',L'3',L'\0', L'9',L'0',L'4',L'\0',
00191     L'9',L'0',L'5',L'\0', L'9',L'0',L'6',L'\0', L'9',L'0',L'7',L'\0', L'9',L'0',L'8',L'\0', L'9',L'0',L'9',L'\0',
00192     L'9',L'1',L'0',L'\0', L'9',L'1',L'1',L'\0', L'9',L'1',L'2',L'\0', L'9',L'1',L'3',L'\0', L'9',L'1',L'4',L'\0',
00193     L'9',L'1',L'5',L'\0', L'9',L'1',L'6',L'\0', L'9',L'1',L'7',L'\0', L'9',L'1',L'8',L'\0', L'9',L'1',L'9',L'\0',
00194     L'9',L'2',L'0',L'\0', L'9',L'2',L'1',L'\0', L'9',L'2',L'2',L'\0', L'9',L'2',L'3',L'\0', L'9',L'2',L'4',L'\0',
00195     L'9',L'2',L'5',L'\0', L'9',L'2',L'6',L'\0', L'9',L'2',L'7',L'\0', L'9',L'2',L'8',L'\0', L'9',L'2',L'9',L'\0',
00196     L'9',L'3',L'0',L'\0', L'9',L'3',L'1',L'\0', L'9',L'3',L'2',L'\0', L'9',L'3',L'3',L'\0', L'9',L'3',L'4',L'\0',
00197     L'9',L'3',L'5',L'\0', L'9',L'3',L'6',L'\0', L'9',L'3',L'7',L'\0', L'9',L'3',L'8',L'\0', L'9',L'3',L'9',L'\0',
00198     L'9',L'4',L'0',L'\0', L'9',L'4',L'1',L'\0', L'9',L'4',L'2',L'\0', L'9',L'4',L'3',L'\0', L'9',L'4',L'4',L'\0',
00199     L'9',L'4',L'5',L'\0', L'9',L'4',L'6',L'\0', L'9',L'4',L'7',L'\0', L'9',L'4',L'8',L'\0', L'9',L'4',L'9',L'\0',
00200     L'9',L'5',L'0',L'\0', L'9',L'5',L'1',L'\0', L'9',L'5',L'2',L'\0', L'9',L'5',L'3',L'\0', L'9',L'5',L'4',L'\0',
00201     L'9',L'5',L'5',L'\0', L'9',L'5',L'6',L'\0', L'9',L'5',L'7',L'\0', L'9',L'5',L'8',L'\0', L'9',L'5',L'9',L'\0',
00202     L'9',L'6',L'0',L'\0', L'9',L'6',L'1',L'\0', L'9',L'6',L'2',L'\0', L'9',L'6',L'3',L'\0', L'9',L'6',L'4',L'\0',
00203     L'9',L'6',L'5',L'\0', L'9',L'6',L'6',L'\0', L'9',L'6',L'7',L'\0', L'9',L'6',L'8',L'\0', L'9',L'6',L'9',L'\0',
00204     L'9',L'7',L'0',L'\0', L'9',L'7',L'1',L'\0', L'9',L'7',L'2',L'\0', L'9',L'7',L'3',L'\0', L'9',L'7',L'4',L'\0',
00205     L'9',L'7',L'5',L'\0', L'9',L'7',L'6',L'\0', L'9',L'7',L'7',L'\0', L'9',L'7',L'8',L'\0', L'9',L'7',L'9',L'\0',
00206     L'9',L'8',L'0',L'\0', L'9',L'8',L'1',L'\0', L'9',L'8',L'2',L'\0', L'9',L'8',L'3',L'\0', L'9',L'8',L'4',L'\0',
00207     L'9',L'8',L'5',L'\0', L'9',L'8',L'6',L'\0', L'9',L'8',L'7',L'\0', L'9',L'8',L'8',L'\0', L'9',L'8',L'9',L'\0',
00208     L'9',L'9',L'0',L'\0', L'9',L'9',L'1',L'\0', L'9',L'9',L'2',L'\0', L'9',L'9',L'3',L'\0', L'9',L'9',L'4',L'\0',
00209     L'9',L'9',L'5',L'\0', L'9',L'9',L'6',L'\0', L'9',L'9',L'7',L'\0', L'9',L'9',L'8',L'\0', L'9',L'9',L'9',L'\0'};
00210
00211 inline long wcscpy_count (WCHAR *d, WCHAR const *s)
00212 {
00213   register int i = 0;
00214   while (d[i] = s[i])
00215     ++i;
00216   return (i);
00217 }
00218
00219 inline long WriteChars(WCHAR* str, const WCHAR *text)
00220 {
00221   return wcscpy_count(str, text);
00222 }
00223
00224 inline long WriteChars(WCHAR* str, const WCHAR *name, const WCHAR *data, int slen, bool bQuotes)
00225 {
00226   long length = 0;
00227
00228   length += wcscpy_count(&str[length], name);
00229
00230   if (bQuotes)
00231     length += wcscpy_count(&str[length], L" = \"");
00232   else
00233     length += wcscpy_count(&str[length], L" = ");
00234
00235   if (slen > 0)
00236   {
00237     wcsncpy_fast(&str[length], data, slen);
00238
00239     length += slen;
00240   }
00241   else
00242   {
00243     length += wcscpy_count(&str[length], data);
00244   }
00245
00246   if (bQuotes)
00247     length += wcscpy_count(&str[length], L"\", ");
00248   else
00249     length += wcscpy_count(&str[length], L", ");
00250
00251   return length;
00252 }
00253
00254 inline long WriteChars(WCHAR* str, const WCHAR *name, const WCHAR *month, short nDay, short nYear)
00255 {
00256   long length = 0;
00257
00258   length += wcscpy_count(&str[length], name);
00259   length += wcscpy_count(&str[length], L" = \"");
00260   length += wcscpy_count(&str[length], month);
00261   length += WriteChars(&str[length], nDay);
00262   str[length++] = L' ';
00263   length += WriteChars(&str[length], nYear);
00264   length += wcscpy_count(&str[length], L"\", ");
00265   return length;
00266 }
00267
00268 inline long WriteChars(WCHAR* str, const WCHAR *str1, const WCHAR *str2, const WCHAR *str3)
00269 {
00270   long length = 0;
00271
00272   length += wcscpy_count(&str[length], str1);
00273   str[length++] = L' ';
00274   length += wcscpy_count(&str[length], str2);
00275   str[length++] = L' ';
00276   length += wcscpy_count(&str[length], str3);
00277   return length;
00278 }
00279
00280 inline long WriteChars(WCHAR* string, int nData)
00281 {
00282   WCHAR *str = string;
00283
00284   WCHAR buffer[32];
00285
00286   register unsigned int v2;
00287   register const WCHAR *ap;
00288   register WCHAR *s = buffer + 30;
00289   if (nData <= 0)
00290   {
00291     if (nData == 0)
00292     {
00293       *str++ = L'0';
00294       return str - string;
00295     }
00296     else
00297     {
00298       *str++ = L'-';
00299       #pragma warning (disable:4146)
00300       nData = -nData;
00301       #pragma warning (default:4146)
00302     }
00303   }
00304   s[1] = L'\0';
00305
00306   do
00307   {
00308     v2 = nData / 1000;
00309     ap = char_table + 2 + ((nData - 1000 * v2) << 2);
00310     *s-- = *ap--;
00311     *s-- = *ap--;
00312     *s-- = *ap;
00313   }
00314   while ((nData = v2) > 0);
00315
00316   while (L'0' == *++s);
00317   *str = *s;
00318   while ((*++str = *++s));
00319
00320   return str - string;
00321 }
00322
00323 inline long WriteChars(WCHAR* string, const WCHAR *name, int nData)
00324 {
00325   long length = 0;
00326
00327   length += wcscpy_count(&string[length], name);
00328   length += wcscpy_count(&string[length], L" = ");
00329
00330   WCHAR *str = &string[length];
00331
00332   WCHAR buffer[32];
00333
00334   register unsigned int v2;
00335   register const WCHAR *ap;
00336   register WCHAR *s = buffer + 30;
00337   if (nData <= 0)
00338   {
00339     if (nData == 0)
00340     {
00341       *str++ = L'0';
00342       length = str - string;
00343
00344       length += wcscpy_count(&string[length], L", ");
00345
00346       return length;
00347     }
00348     else
00349     {
00350       *str++ = L'-';
00351       #pragma warning (disable:4146)
00352       nData = -nData;
00353       #pragma warning (default:4146)
00354     }
00355   }
00356   s[1] = L'\0';
00357
00358   do
00359   {
00360     v2 = nData / 1000;
00361     ap = char_table + 2 + ((nData - 1000 * v2) << 2);
00362     *s-- = *ap--;
00363     *s-- = *ap--;
00364     *s-- = *ap;
00365   }
00366   while ((nData = v2) > 0);
00367
00368   while (L'0' == *++s);
00369   *str = *s;
00370   while ((*++str = *++s));
00371
00372   length = str - string;
00373
00374   length += wcscpy_count(&string[length], L", ");
00375
00376   return length;
00377 }
00378
00379 WCHAR *wcscpy_fast (WCHAR *d, WCHAR const *s)
00380 {
00381   register int i = 0;
00382   while (d[i] = s[i])
00383     ++i;
00384   return (d);
00385 }
00386
00387 inline WCHAR *wcsncpy_fast (WCHAR * dest, const WCHAR * source, size_t count)
00388 {
00389   dest[count] = L'\0';
00390   while ((count-- > 0) && (dest[count] = source[count]) != 0);    /* copy string */
00391
00392   return dest;
00393 }
00394
00395 int wcsncmp_fast (const WCHAR * first, const WCHAR * last, size_t count)
00396 {
00397   if (!count)
00398     return(0);
00399   register int i = -1;
00400
00401   do
00402   {
00403     i++;
00404   }
00405   while (--count && first[i] && first[i] == last[i]);
00406   return((int)(first[i] - last[i]));
00407 }
00408
00409 int __cdecl wcscmp_fast (const WCHAR * src, const WCHAR * dst)
00410 {
00411   register int i = -1;
00412
00413   do
00414   {
00415     i++;
00416   }
00417   while (dst[i] && src[i] == dst[i]);
00418
00419   return((int)(src[i] - dst[i]));
00420 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/service.h Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

service.h

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: Service.h
00008
00009     PURPOSE: Provides file replication service function declarations.
00010
00011     FUNCTIONS:
00012
00013     COMMENTS: These funtions may be used by the main service routines
00014         as well as by the client and server file replication RPC routines.
00015
00016 */
00017 #pragma once
00018
00019 #include "Resources.h"
00020
00021 // Name of the executable
00022 #define APPNAME TEXT("FileRepService")
00023
00024 // Internal name of the service
00025 #define SERVICENAME TEXT("FileRepService")
00026
00027 // Displayed name of the service
00028 #define SERVICEDISPLAYNAME TEXT("File Replication Service")
00029
00030 // List of service dependencies
00031 #define DEPENDENCIES TEXT("RPCSS\0\0")
00032
00033 #ifdef PROF
00034 #include "Prof.h"
00035 #endif
00036
00037 // The maximum number of concurrent requests that can be handled
00038 // by the server system service for each of the priority groups.
00039 extern const UINT ServerReqBounds[];
00040
00041 // The maximum number of requests that can be placed to the client
00042 // system service from each user group.
00043 extern const UINT ClientReqBounds[];
00044
00045 // The maximum number of concurrent requests that a client system
00046 // service will handle.
00047 extern const UINT ClientActiveReqBounds[];
00048
00049 // The number of priority groups.
00050 extern const UINT NumPriGroups;
00051
00052 extern Counter *pServerReqCounters[];
00053 extern Counter *pClientReqCounters[];
00054 extern Counter *pClientActiveReqCounters[];
00055
00056 // Keeps queued requests.
00057 extern Queue *ClientReqQueues[];
00058
00059 // Keeps requests that are being handled.
00060 extern Queue *ClientActiveReqHashQueues[];
00061
00062 // Conteins the number of requests that are being
00063 // handled for each user.
00064 extern Queue *ClientActiveReqHashCounters[];
00065
00066 // The maximum number of requests for a single
00067 // user that can be handled simultaneously.
00068 extern const UINT MaxUserReqs;
00069
00070 // The priority of regular users.
00071 // A separate queue is maintained for
00072 // scheduling each user's requests on the client.
00073 extern const UINT RegUsersPri;
00074
00075 /*
00076     Prototypes for shared service functions.
00077     See function definitions in Service.cpp for help.
00078 */
00079
00080 PSID GetUserSID();
00081
00082 PTOKEN_GROUPS GetUserGroups();
00083
00084 BOOL IsGroupMember(PSID pSID, PTOKEN_GROUPS pGroupInfo);
00085
00086 VOID CreateWellKnownSids(VOID);
00087
00088 VOID DeleteWellKnownSids(VOID);
00089
00090 UINT GetCurrentUserPriority(VOID);
00091
00092 BOOL ReportStatusToSCMgr(SERVICE_STATUS_HANDLE *sshStatusHandle,
00093                          SERVICE_STATUS *ssStatus,
00094                          DWORD dwCurrentState,
00095                          DWORD dwWin32ExitCode,
00096                          DWORD dwWaitHint);
00097
00098 VOID AddToMessageLog(LPTSTR lpszMsg);
00099
00100 VOID AddToMessageLogProcFailure(LPTSTR ProcName, DWORD ErrCode);
00101
00102 VOID AddToMessageLogProcFailureEEInfo(LPTSTR ProcName, DWORD ErrCode);
00103
00104 VOID AddRpcEEInfo(DWORD Status, LPTSTR Msg);
00105
00106 VOID AddRpcEEInfoAndRaiseException(DWORD Status, LPTSTR Msg);
00107
00108 // RPC heap size bounds.
00109 #define RPC_HEAP_SIZE_INIT (1024*1024)
00110 #define RPC_HEAP_SIZE_MAX (128*1024*1024)
00111
00112 // Heap for use by midl_user_allocate and midl_user_free.
00113 extern HANDLE RpcHeap;
00114
00115 VOID * AutoHeapAlloc(size_t dwBytes);
00116
00117 VOID AutoHeapFree(VOID * lpMem);
00118
00119 // end Service.h
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/mqf_draw/connectdlg.cpp Source File

  • NetDS
  • MessageQueuing
  • mqf_draw

connectdlg.cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // connectdlg.cpp : implementation file
00014 //
00015
00016
00017 #include "stdafx.h"
00018 #include "mqfdraw.h"
00019 #include "connectdlg.h"
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CConnectDlg dialog
00029
00030 CConnectDlg::CConnectDlg(CWnd* pParent /*=NULL*/)
00031   : CDialog(CConnectDlg::IDD, pParent)
00032 {
00033   //{{AFX_DATA_INIT(CConnectDlg)
00034   m_iRadioDS = 0;
00035   //}}AFX_DATA_INIT
00036 }
00037
00038 void CConnectDlg::DoDataExchange(CDataExchange* pDX)
00039 {
00040   CDialog::DoDataExchange(pDX);
00041   //{{AFX_DATA_MAP(CConnectDlg)
00042   DDX_Control(pDX, IDCANCEL, m_CancelButton);
00043   DDX_Control(pDX, IDC_RADIO_DS, m_cRadioDS);
00044   DDX_Control(pDX, IDOK, m_cContinueButton);
00045   DDX_Radio(pDX, IDC_RADIO_DS, m_iRadioDS);
00046   DDX_Control(pDX, IDC_RADIO_WORKGROUP, m_cRadioWorkgroup);
00047   //}}AFX_DATA_MAP
00048 }
00049
00050
00051 BEGIN_MESSAGE_MAP(CConnectDlg, CDialog)
00052   //{{AFX_MSG_MAP(CLoginDlg)
00053     // NOTE: the ClassWizard will add message map macros here
00054   //}}AFX_MSG_MAP
00055 END_MESSAGE_MAP()
00056
00057
00058 BOOL CConnectDlg::OnInitDialog()
00059 {
00060   CDialog::OnInitDialog();
00061
00062
00063   //
00064   // Display the login name in the window title.
00065   //
00066   SetWindowText("Listening to: " + m_strLogin);
00067
00068     return TRUE;  // return TRUE  unless you set the focus to a control.
00069 }
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/comp.Cpp Source File

  • SysMgmt
  • MMC
  • Simple

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 CComponent::CComponent(CComponentData *parent)
00029 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL)
00030 {
00031     OBJECT_CREATED
00032 }
00033
00034 CComponent::~CComponent()
00035 {
00036     OBJECT_DESTROYED
00037 }
00038
00039 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00040 {
00041     if (!ppv)
00042         return E_FAIL;
00043
00044     *ppv = NULL;
00045
00046     if (IsEqualIID(riid, IID_IUnknown))
00047         *ppv = static_cast<IComponent *>(this);
00048     else if (IsEqualIID(riid, IID_IComponent))
00049         *ppv = static_cast<IComponent *>(this);
00050
00051     if (*ppv)
00052     {
00053         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00054         return S_OK;
00055     }
00056
00057     return E_NOINTERFACE;
00058 }
00059
00060 STDMETHODIMP_(ULONG) CComponent::AddRef()
00061 {
00062     return InterlockedIncrement((LONG *)&m_cref);
00063 }
00064
00065 STDMETHODIMP_(ULONG) CComponent::Release()
00066 {
00067     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00068     {
00069         delete this;
00070         return 0;
00071     }
00072     return m_cref;
00073
00074 }
00075
00076 ///////////////////////////////
00077 // Interface IComponent
00078 ///////////////////////////////
00079 STDMETHODIMP CComponent::Initialize(
00080                                     /* [in] */ LPCONSOLE lpConsole)
00081 {
00082     HRESULT hr = S_OK;
00083
00084     m_ipConsole = lpConsole;
00085     m_ipConsole->AddRef();
00086
00087     return hr;
00088 }
00089
00090 STDMETHODIMP CComponent::Notify(
00091                                 /* [in] */ LPDATAOBJECT lpDataObject,
00092                                 /* [in] */ MMC_NOTIFY_TYPE event,
00093                                 /* [in] */ LPARAM arg,
00094                                 /* [in] */ LPARAM param)
00095 {
00096   MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00097
00098     return S_FALSE;
00099 }
00100
00101 STDMETHODIMP CComponent::Destroy(
00102                                  /* [in] */ MMC_COOKIE cookie)
00103 {
00104     if (m_ipConsole) {
00105         m_ipConsole->Release();
00106         m_ipConsole = NULL;
00107     }
00108
00109     return S_OK;
00110 }
00111
00112 STDMETHODIMP CComponent::QueryDataObject(
00113                                          /* [in] */ MMC_COOKIE cookie,
00114                                          /* [in] */ DATA_OBJECT_TYPES type,
00115                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00116 {
00117     CDataObject *pObj = NULL;
00118
00119     if (cookie == 0)
00120         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00121     else
00122         pObj = new CDataObject(cookie, type);
00123
00124     if (!pObj)
00125         return E_OUTOFMEMORY;
00126
00127     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00128
00129     return S_OK;
00130 }
00131
00132 STDMETHODIMP CComponent::GetResultViewType(
00133                                            /* [in] */ MMC_COOKIE cookie,
00134                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00135                                            /* [out] */ long __RPC_FAR *pViewOptions)
00136 {
00137     CDelegationBase *base = (CDelegationBase *)cookie;
00138
00139     //
00140     // Ask for default listview.
00141     //
00142     if (base == NULL) {
00143         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00144         *ppViewType = NULL;
00145     }
00146     else
00147         return base->GetResultViewType(ppViewType, pViewOptions);
00148
00149     return S_OK;
00150 }
00151
00152 STDMETHODIMP CComponent::GetDisplayInfo(
00153                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00154 {
00155     HRESULT hr = S_OK;
00156     CDelegationBase *base = NULL;
00157
00158     // if they are asking for the RDI_STR we have one of those to give
00159
00160     if (pResultDataItem->lParam) {
00161         base = (CDelegationBase *)pResultDataItem->lParam;
00162         if (pResultDataItem->mask & RDI_STR) {
00163       LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00164       MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00165             pResultDataItem->str = pszW;
00166         }
00167
00168         if (pResultDataItem->mask & RDI_IMAGE) {
00169             pResultDataItem->nImage = base->GetBitmapIndex();
00170         }
00171     }
00172
00173     return hr;
00174 }
00175
00176 STDMETHODIMP CComponent::CompareObjects(
00177                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00178                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00179 {
00180     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00181     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00182
00183     // compare the object pointers
00184     if (baseA->GetCookie() == baseB->GetCookie())
00185         return S_OK;
00186
00187     return S_FALSE;
00188 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyface/ComSpyCtl.Idl Source File

  • Com
  • Administration
  • Spy
  • ComSpyface

ComSpyCtl.Idl

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include <olectl.h>
00018
00019 // This file will be processed by the MIDL tool to
00020 // produce the type library (ComSpyCtl.tlb) and marshalling code.
00021 cpp_quote ("#define DISPID_LOGFILE    5")
00022 cpp_quote ("#define DISPID_GRIDLINES  6")
00023 cpp_quote ("#define DISPID_COLWIDTH   8")
00024 cpp_quote ("#define DISPID_AUDIT    17")
00025
00026 typedef enum
00027 {
00028   Application = 0,
00029   Thread,
00030   Instance,
00031   Transaction,
00032   Method,
00033   Object,
00034   Resource,
00035   User,
00036   Security,
00037   ObjectPool,
00038   ObjectPool2,
00039   ObjectConstruction,
00040   Activity,
00041   Identity,
00042   QC,
00043   Exception,
00044   CRM,
00045   //System Events
00046   EventStore,
00047   LoadBalancing,
00048 } EventEnum;
00049
00050
00051 import "oaidl.idl";
00052 import "ocidl.idl";
00053
00054
00055   [
00056     object,
00057     uuid(A9B39080-AAD0-11D0-B183-00AA00BA3258),
00058     dual,
00059     helpstring("IComSpy Interface"),
00060     pointer_default(unique)
00061   ]
00062   interface IComSpy : IDispatch
00063   {
00064     [propget, id(DISPID_HWND)]
00065     HRESULT Window([out, retval]LONG_PTR * phwnd);
00066     [propputref, id(DISPID_FONT)]
00067     HRESULT Font([in]IFontDisp* pFont);
00068     [propput, id(DISPID_FONT)]
00069     HRESULT Font([in]IFontDisp* pFont);
00070     [propget, id(DISPID_FONT)]
00071     HRESULT Font([out, retval]IFontDisp** ppFont);
00072     [propget, id(5), helpstring("property LogFile")] HRESULT LogFile([out, retval] BSTR *pVal);
00073     [propput, id(5), helpstring("property LogFile")] HRESULT LogFile([in] BSTR newVal);
00074     [propget, id(6), helpstring("property ShowGridLines")] HRESULT ShowGridLines([out, retval] BOOL *pVal);
00075     [propput, id(6), helpstring("property ShowGridLines")] HRESULT ShowGridLines([in] BOOL newVal);
00076     [propget, id(8), helpstring("property ColWidth")] HRESULT ColWidth(short nColumn, [out, retval] long *pVal);
00077     [propput, id(8), helpstring("property ColWidth")] HRESULT ColWidth(short nColumn, [in] long newVal);
00078     [id(9), helpstring("method SelectApplications")] HRESULT SelectApplications();
00079     [id(10), helpstring("method SaveToFile")] HRESULT SaveToFile();
00080     [id(11), helpstring("method ClearAllEvents")] HRESULT ClearAllEvents();
00081     [id(12), helpstring("method About")] HRESULT About();
00082     [propget, id(13), helpstring("property LogToFile")] HRESULT LogToFile([out, retval] BOOL *pVal);
00083     [propput, id(13), helpstring("property LogToFile")] HRESULT LogToFile([in] BOOL newVal);
00084     [id(14), helpstring("method ChooseFont")] HRESULT ChooseFont();
00085     [propget, id(15), helpstring("property ShowOnScreen")] HRESULT ShowOnScreen([out, retval] BOOL *pVal);
00086     [propput, id(15), helpstring("property ShowOnScreen")] HRESULT ShowOnScreen([in] BOOL newVal);
00087     [id(16), helpstring("method ChooseLogFile")] HRESULT ChooseLogFile([out] BSTR * sLogFileName, [out] BOOL * bCanceled);
00088     [propget, id(17), helpstring("property Audit")] HRESULT Audit([out, retval] BOOL *pVal);
00089     [propput, id(17), helpstring("property Audit")] HRESULT Audit([in] BOOL newVal);
00090
00091   };
00092   [
00093
00094     uuid(0243D433-3849-11d2-89BB-00C04F99140F),
00095
00096     helpstring("ICOMSysLCE Interface"),
00097     pointer_default(unique)
00098   ]
00099   interface ICOMSysLCE : IUnknown
00100   {
00101     [helpstring("method GetEventType")] HRESULT GetEventType([out] EventEnum * e);
00102     [helpstring("method GetEventClass")] HRESULT GetEventClass([out] LPGUID guid);
00103     [helpstring("method Install")] HRESULT Install([in] BSTR* PropertyName, [in] VARIANT PropertyValue);
00104     [helpstring("method Uninstall")] HRESULT Uninstall();
00105   };
00106 [
00107   uuid(A9B39071-AAD0-11D0-B183-00AA00BA3258),
00108   version(1.0),
00109   helpstring("COMSpyCtl 1.0 Type Library")
00110 ]
00111 library COMSPYCTLLib
00112 {
00113   importlib("stdole2.tlb");
00114
00115   [
00116     uuid(A9B39081-AAD0-11D0-B183-00AA00BA3258),
00117     helpstring("COM Spy ActiveX Control")
00118   ]
00119   coclass ComSpy
00120   {
00121     [default] interface ICOMSpy;
00122   };
00123
00124
00125   [
00126     uuid(AAF6270D-AC5E-11D0-B185-00AA00BA3258),
00127     helpstring("COMSpyPropPage Class")
00128   ]
00129   coclass ComSpyPropPage
00130   {
00131     interface IUnknown;
00132   };
00133 };
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/tracemacro.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

tracemacro.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  TraceMacro.h : Defines custom tracing helpers.
00014 //
00015
00016
00017 #ifndef _TRACE_MACRO_HEADER_
00018 #define _TRACE_MACRO_HEADER_
00019
00020 //---------------------------------------------------------------------------
00021 //  Function prototypes
00022 //
00023 VOID Trace_Start( LPCTSTR pszClass, LPCTSTR pszFunction );
00024 VOID Trace_HR( LPCTSTR pszClass, LPCTSTR pszFunction, HRESULT hr );
00025 VOID Trace_Value( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszValueName, LONG nValue );
00026 VOID Trace_Pointer( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszAction, ULONG ulValue );
00027 VOID Trace_Event( LPCTSTR pszClass, LPCTSTR pszFunction, LONG nEvent );
00028 VOID MapEvent( LONG Event, LPTSTR szEventStr );
00029
00030
00031 // Alternate version provides complete path to the file
00032 // #define TRACE_HRESULT(str,hr)  Trace_HR( _T(__FILE__), (str), (hr) )
00033
00034 #ifdef _DEBUG
00035
00036 #undef  TRACE_HRESULT
00037 #define TRACE_HRESULT(s1,hr) Trace_HR( (MODULESTRING),(s1),(hr) )
00038
00039 #undef  TRACE_VAL
00040 #define TRACE_VAL(s1,s2,val) Trace_Value( (MODULESTRING),(s1),(s2),(val) )
00041
00042 #undef  TRACE_PTR
00043 #define TRACE_PTR(s1,s2,val) Trace_Pointer( (MODULESTRING),(s1),(s2),(val) )
00044
00045 #undef  TRACE_EVENT
00046 #define TRACE_EVENT(s1,val)  Trace_Event( (MODULESTRING),(s1),(val) )
00047
00048 #undef  TRACE_START
00049 #define TRACE_START( s1 )    Trace_Start( (MODULESTRING),(s1) )
00050
00051
00052 #else
00053
00054 #undef  TRACE_HRESULT
00055 #define TRACE_HRESULT
00056
00057 #undef  TRACE_VAL
00058 #define TRACE_VAL
00059
00060 #undef  TRACE_PTR
00061 #define TRACE_PTR
00062
00063 #undef  TRACE_EVENT
00064 #define TRACE_EVENT
00065
00066 #undef  TRACE_START
00067 #define TRACE_START
00068
00069 #endif //_DEBUG
00070
00071
00072 #endif //_TRACE_MACRO_HEADER_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ServerDlg.Cpp Source File

  • WinBase
  • WtsApi
  • WtsApi

ServerDlg.Cpp

Go to the documentation of this file.
00001 // ServerDlg.cpp : implementation file
00002 //
00003 //  Copyright 1995-1999, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006
00007 #include "stdafx.h"
00008 #include "API.h"
00009 #include "ServerDlg.h"
00010 //#include "wtsapi32.h"
00011 #include "string.h"
00012 #include "APIDoc.h"
00013
00014 #ifdef _DEBUG
00015 #define new DEBUG_NEW
00016 #undef THIS_FILE
00017 static char THIS_FILE[] = __FILE__;
00018 #endif
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // CServerDlg dialog
00022
00023
00024 CServerDlg::CServerDlg(CWnd* pParent /*=NULL*/)
00025   : CDialog(CServerDlg::IDD, pParent)
00026 {
00027   //{{AFX_DATA_INIT(CServerDlg)
00028   //}}AFX_DATA_INIT
00029 }
00030
00031
00032 void CServerDlg::DoDataExchange(CDataExchange* pDX)
00033 {
00034   CDialog::DoDataExchange(pDX);
00035   //{{AFX_DATA_MAP(CServerDlg)
00036   DDX_Control(pDX, IDC_SERVER_LIST2, m_serverList2);
00037   DDX_Control(pDX, IDC_DOMAIN_NAME, m_domainName);
00038   //}}AFX_DATA_MAP
00039 }
00040
00041
00042 BEGIN_MESSAGE_MAP(CServerDlg, CDialog)
00043   //{{AFX_MSG_MAP(CServerDlg)
00044   ON_CBN_DROPDOWN(IDC_SERVER_LIST2, OnDropdownServerList2)
00045   ON_EN_CHANGE(IDC_DOMAIN_NAME, OnChangeDomainName)
00046   //}}AFX_MSG_MAP
00047 END_MESSAGE_MAP()
00048
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // CServerDlg message handlers
00052
00053 BOOL CServerDlg::OnInitDialog()
00054 {
00055   CDialog::OnInitDialog();
00056   m_domainName.SetWindowText("TEST");
00057   domainFlag = FALSE;
00058   return TRUE;
00059 }
00060
00061 void CServerDlg::OnOK()
00062 {
00063   //int nIndex = m_serverList2.GetCurSel();
00064   //if (nIndex != LB_ERR)
00065   //  m_serverList2.GetLBText(nIndex, serverName);
00066
00067   WTSFreeMemory(&pServerInfo);
00068   m_serverList2.GetWindowText( serverName);
00069   //AfxMessageBox(serverName);
00070   g_pDoc->SetServerName( (TCHAR *) LPCTSTR(serverName));
00071
00072   CDialog::OnOK();
00073 }
00074
00075 void CServerDlg::OnDropdownServerList2()
00076 {
00077   CString dname;
00078   m_domainName.GetWindowText(dname);
00079
00080   if (dname == "")
00081     AfxMessageBox("Please enter a domain name.");
00082   else
00083     {
00084   if (domainFlag == FALSE) {
00085     m_serverList2.ResetContent();
00086     if (!WTSEnumerateServers((TCHAR *)LPCTSTR (dname),
00087       0, 1, &pServerInfo, &count))
00088     AfxMessageBox("Unable to enumerate servers");
00089     PWTS_SERVER_INFO pServer = pServerInfo;
00090     for (DWORD i=0; i < count; i++)
00091     {
00092       m_serverList2.AddString(pServer->pServerName);
00093       pServer++;
00094     }
00095     domainFlag = TRUE;
00096   }
00097     /*m_serverList2.AddString("purple");
00098     m_serverList2.AddString("blue");
00099     m_serverList2.AddString("red");
00100     m_serverList2.AddString("orange");
00101     m_serverList2.AddString("yellow");*/
00102   }
00103 }
00104
00105 void CServerDlg::OnChangeDomainName()
00106 {
00107   domainFlag = FALSE;
00108 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDllShared Member List

This is the complete list of members for CDllShared, including all inherited members.
iHelloCount | CDllShared
iUserCount | CDllShared
Generated on Wed Nov 13 2024 16:56:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/CMgdClusCfgInit.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

CMgdClusCfgInit.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      CMgdClusCfgInit.h
00007 //
00008 //  Description:
00009 //      Header file for the CMgdClusCfgInit class
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020 #pragma once
00021
00022
00023 //////////////////////////////////////////////////////////////////////////////
00024 // Include Files
00025 //////////////////////////////////////////////////////////////////////////////
00026
00027 #include "clres.h"
00028
00029
00030 //////////////////////////////////////////////////////////////////////////////
00031 //++
00032 //
00033 //  class CMgdClusCfgInit
00034 //
00035 //  Description:
00036 //      The CMgdClusCfgInit class is a base class implementation of the
00037 //      IClusCfgInitialize interface.
00038 //
00039 //--
00040 //////////////////////////////////////////////////////////////////////////////
00041 class CMgdClusCfgInit
00042     : public IClusCfgInitialize
00043     , public CComObjectRoot
00044 {
00045 public:
00046
00047     CMgdClusCfgInit( void );
00048     virtual ~CMgdClusCfgInit( void );
00049
00050     //
00051     // IClusCfgInitialize interface
00052     //
00053
00054     STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
00055
00056     //
00057     // Public member functions.
00058     //
00059
00060     IClusCfgCallback *  GetCallback( void )     { return m_picccCallback; }
00061     LCID                GetLCID( void )         { return m_lcid; }
00062     BSTR                GetNodeName( void )     { return m_bstrNodeName; }
00063     BSTR                GetDllName( void )      { return m_bstrDllName; }
00064     BSTR                GetResTypeName( void )  { return m_bstrResTypeName; }
00065     BSTR                GetDisplayName( void )  { return m_bstrDisplayName; }
00066
00067     STDMETHOD( HrSendStatusReport )(
00068           CLSID      clsidTaskMajorIn
00069         , CLSID      clsidTaskMinorIn
00070         , ULONG      ulMinIn
00071         , ULONG      ulMaxIn
00072         , ULONG      ulCurrentIn
00073         , HRESULT    hrStatusIn
00074         , LPCWSTR    pcszDescriptionIn
00075         , LPCWSTR    pcszReferenceIn
00076         ...
00077         );
00078
00079     STDMETHOD( HrSendStatusReport )(
00080           CLSID      clsidTaskMajorIn
00081         , CLSID      clsidTaskMinorIn
00082         , ULONG      ulMinIn
00083         , ULONG      ulMaxIn
00084         , ULONG      ulCurrentIn
00085         , HRESULT    hrStatusIn
00086         , LPCWSTR    pcszDescriptionIn
00087         , UINT       idsReferenceIn
00088         ...
00089         );
00090
00091     STDMETHOD( HrSendStatusReport )(
00092           CLSID     clsidTaskMajorIn
00093         , CLSID     clsidTaskMinorIn
00094         , ULONG     ulMinIn
00095         , ULONG     ulMaxIn
00096         , ULONG     ulCurrentIn
00097         , HRESULT   hrStatusIn
00098         , UINT      idsDescriptionIn
00099         , UINT      idsReferenceIn
00100         ...
00101         );
00102
00103 private:
00104
00105     //
00106     // Private member functions.
00107     //
00108
00109     STDMETHOD( SendStatusReport )(
00110           CLSID     clsidTaskMajorIn
00111         , CLSID     clsidTaskMinorIn
00112         , ULONG     ulMinIn
00113         , ULONG     ulMaxIn
00114         , ULONG     ulCurrentIn
00115         , HRESULT   hrStatusIn
00116         , LPCWSTR   pcszDescriptionIn
00117         , LPCWSTR   pcszReferenceIn
00118         );
00119
00120     //
00121     // Private copy constructor to avoid copying.
00122     //
00123
00124     CMgdClusCfgInit( const CMgdClusCfgInit & rSrcIn );
00125
00126     //
00127     // Private assignment operator to avoid copying.
00128     //
00129
00130     const CMgdClusCfgInit & operator = ( const CMgdClusCfgInit & rSrcIn );
00131
00132     //
00133     // IClusCfgCallback info.
00134     //
00135
00136     LCID                m_lcid;
00137     IClusCfgCallback *  m_picccCallback;
00138     BSTR                m_bstrNodeName;
00139
00140     //
00141     // Resource dll, resource type, and resource type display names.
00142     //
00143
00144     BSTR    m_bstrDllName;
00145     BSTR    m_bstrResTypeName;
00146     BSTR    m_bstrDisplayName;
00147
00148 }; //*** class CMgdClusCfgInit
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

POINT3D Member List

This is the complete list of members for POINT3D, including all inherited members.
x | POINT3D
y | POINT3D
z | POINT3D
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/OPBank/linkable.h Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • OPBank

linkable.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      Linkable.h
00003   Summary:   Header for linked list helper class
00004   Classes:   CLinkable
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #ifndef _LINKABLE_H_
00023 #define _LINKABLE_H_
00024
00025 #include <windows.h>
00026
00027 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00028 Class:  CLinkable
00029     Base class for objects that can be placed onto cheap circular
00030     doubly-linked lists.
00031 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00032 class CLinkable
00033 {
00034 public:
00035
00036   // Constructor
00037   CLinkable() { m_pNext = m_pPrev = this; }
00038
00039   // Destructor
00040   ~CLinkable() { Remove(); }
00041
00042   // return TRUE iff on a list
00043   BOOL      IsLinked() { return ( m_pNext != this ); }
00044
00045   // return next element on list
00046   CLinkable*    Next() { return m_pNext; }
00047
00048   // return previous element on list
00049   CLinkable*    Previous() { return m_pPrev; }
00050
00051   // insert parameter onto list after this, removing it first if necessary
00052   void      InsertAfter( CLinkable* other );
00053
00054   // insert parameter onto list before this, removing it first if necessary
00055   void      InsertBefore( CLinkable* other );
00056
00057   // remove us from list, if any
00058   void      Remove();
00059
00060 private:
00061   CLinkable*    m_pNext;    // next element on list
00062   CLinkable*    m_pPrev;    // previous element on list
00063 };
00064
00065
00066 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00067 Class:  CListHeader
00068     List header for list of CLinkable's. This is merely a CLinkable with
00069     some methods renamed for better readability.
00070 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00071 class CListHeader : public CLinkable
00072 {
00073
00074 public:
00075
00076   // Constructor
00077   CListHeader() {}
00078
00079   // Destructor
00080   ~CListHeader() {};
00081
00082   // return TRUE iff list is empty
00083   BOOL      IsEmpty() { return !IsLinked(); }
00084
00085   // return first element on list
00086   CLinkable*    First()   { return Next(); }
00087
00088   // return last element on list
00089   CLinkable*    Last()    { return Previous(); }
00090
00091   // insert parameter at head of list
00092   void      InsertFirst ( CLinkable* other )  { InsertAfter( other ); }
00093
00094   // insert parameter at tail of list
00095   void      InsertLast ( CLinkable* other )   { InsertBefore( other ); }
00096 };
00097
00098 #endif _LINKABLE_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/StdAfx.h Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

StdAfx.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 // stdafx.h : include file for standard system include files,
00013 //      or project specific include files that are used frequently,
00014 //      but are changed infrequently
00015
00016 #if !defined(AFX_STDAFX_H__BEEDC07F_EBD2_11D0_A78F_00805F0D2083__INCLUDED_)
00017 #define AFX_STDAFX_H__BEEDC07F_EBD2_11D0_A78F_00805F0D2083__INCLUDED_
00018
00019 #if _MSC_VER >= 1000
00020 #pragma once
00021 #endif // _MSC_VER >= 1000
00022
00023 #define STRICT
00024
00025
00026 #define _WIN32_WINNT 0x0400
00027 #define _ATL_APARTMENT_THREADED
00028
00029
00030 #include <atlbase.h>
00031 //You may derive a class from CComModule and use it if you want to override
00032 //something, but do not change the name of _Module
00033 extern CComModule _Module;
00034 #include <atlcom.h>
00035
00036 //{{AFX_INSERT_LOCATION}}
00037 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00038
00039 #endif // !defined(AFX_STDAFX_H__BEEDC07F_EBD2_11D0_A78F_00805F0D2083__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/StdAfx.Cpp Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

StdAfx.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "stdafx.h"
00018
00019 #ifdef _ATL_STATIC_REGISTRY
00020 #include <statreg.h>
00021 #include <statreg.cpp>
00022 #endif
00023
00024 #include <atlimpl.cpp>
00025 #include <atlctl.cpp>
00026 #include <atlwin.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_RqsConfigString Member List

This is the complete list of members for _RqsConfigString, including all inherited members.
pszString | _RqsConfigString
uiLength | _RqsConfigString
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CShellIconOverlayID Member List

This is the complete list of members for CShellIconOverlayID, including all inherited members.
CShellIconOverlayID() | CShellIconOverlayID |
GetOverlayInfo(LPWSTR pwszIconFile, int cchMax, LPINT pIndex, LPDWORD pdwFlags) | CShellIconOverlayID |
GetPriority(LPINT pPriority) | CShellIconOverlayID |
IsMemberOf(LPCWSTR pwszPath, DWORD dwAttr) | CShellIconOverlayID |
m_ObjRefCount | CShellIconOverlayID | [protected]
QueryInterface(REFIID, LPVOID FAR *) | CShellIconOverlayID |
STDMETHODIMP_(DWORD) AddRef() | CShellIconOverlayID |
STDMETHODIMP_(DWORD) Release() | CShellIconOverlayID |
~CShellIconOverlayID() | CShellIconOverlayID |
Generated on Wed Nov 13 2024 16:57:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/asyncdemocomplete/resource.h Source File

  • Web
  • winhttp
  • asyncdemocomplete

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by AsyncDemo.rc
00004 //
00005 #define IDD_DIALOG1                     101
00006 #define IDC_CBLIST                      1000
00007 #define IDC_DOWNLOAD                    1001
00008 #define IDC_EXIT                        1002
00009 #define IDC_URL1                        1003
00010 #define IDC_HEADER1                     1004
00011 #define IDC_RESOURCE1                   1005
00012 #define IDC_URL2                        1006
00013 #define IDC_HEADER2                     1007
00014 #define IDC_RESOURCE2                   1008
00015
00016 // Next default values for new objects
00017 //
00018 #ifdef APSTUDIO_INVOKED
00019 #ifndef APSTUDIO_READONLY_SYMBOLS
00020 #define _APS_NEXT_RESOURCE_VALUE        102
00021 #define _APS_NEXT_COMMAND_VALUE         40001
00022 #define _APS_NEXT_CONTROL_VALUE         1006
00023 #define _APS_NEXT_SYMED_VALUE           101
00024 #endif
00025 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/Utils.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

Utils.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          Utils.cpp
00021
00022   Description:   Contains utility routines for the DOServer sample.
00023
00024 **************************************************************************/
00025
00026 /**************************************************************************
00027 #include statements
00028 **************************************************************************/
00029
00030 #include <windows.h>
00031 #include "utils.h"
00032
00033 /**************************************************************************
00034
00035   ParseCommandLine()
00036
00037   Parses the Windows command line which was passed to WinMain.
00038   This function determines if the -Embedding switch has been given.
00039
00040 **************************************************************************/
00041
00042 STDAPI_(void) ParseCommandLine(LPSTR pszCommandLine, LPBOOL pfEmbedFlag, LPTSTR pszFileName)
00043 {
00044   int      i;
00045   TCHAR    szCmdLine[MAX_PATH];
00046   LPTSTR   pszCmdLine = szCmdLine;
00047   TCHAR    szBuf[MAX_PATH];
00048
00049   if(!pszCommandLine)
00050     return;
00051
00052   if(!pfEmbedFlag)
00053     return;
00054
00055   *pfEmbedFlag = FALSE;
00056
00057 #ifdef UNICODE
00058   MultiByteToWideChar( CP_ACP,
00059     MB_PRECOMPOSED,
00060     pszCommandLine,
00061     -1,
00062     pszCmdLine,
00063     ARRAYSIZE(szCmdLine));
00064 #else
00065   lstrcpyn(pszCmdLine, pszCommandLine, sizeof(szCmdLine)/sizeof(TCHAR));
00066 #endif
00067
00068   // skip blanks
00069   while(isspace(*pszCmdLine))
00070     pszCmdLine++;
00071
00072   // No filename or options, so start a fresh document.
00073   if(!*pszCmdLine)
00074     return;
00075
00076   // Check for "-Embedding" or "/Embedding" and set fEmbedding.
00077   if((*pszCmdLine == '-') || (*pszCmdLine == '/'))
00078   {
00079     pszCmdLine++;
00080     pszCmdLine = GetWord(pszCmdLine, szBuf);
00081     *pfEmbedFlag = !lstrcmp(szBuf, EMBEDDINGFLAG);
00082   }
00083
00084   if(!pszFileName)
00085     return;
00086
00087   *pszFileName = 0;
00088
00089   // skip blanks
00090   while(isspace(*pszCmdLine))
00091     pszCmdLine++;
00092
00093   // set pszFileName to argument
00094   for(i = 0; *(pszCmdLine + i); i++)
00095   {
00096     *(pszFileName + i) = *(pszCmdLine + i);
00097   }
00098
00099   *(pszFileName + i) = 0;
00100 }
00101
00102
00103 /**************************************************************************
00104
00105   GetWord()
00106
00107   LPSTR lpszSrc - Pointer to a source string
00108   LPSTR lpszDst - Pointer to destination buffer
00109
00110     Will copy one space-terminated or null-terminated word from the source
00111     string to the destination buffer.
00112
00113     returns: pointer to next character following the word.
00114
00115 **************************************************************************/
00116
00117 static LPTSTR GetWord(LPTSTR lpszSrc, LPTSTR lpszDst)
00118 {
00119   while (*lpszSrc && !isspace(*lpszSrc))
00120     *lpszDst++ = *lpszSrc++;
00121
00122   *lpszDst = '\0';
00123
00124   return lpszSrc;
00125 }
00126
00127 /* GetOleObjectDataHere
00128 ** ----------------------
00129 **    Render CF_EMBEDSOURCE/CF_EMBEDDEDOBJECT data on an TYMED_ISTORAGE
00130 **    medium by asking the object to save into the storage.
00131 **    the object must support IPersistStorage.
00132 **
00133 **    if lpMedium->tymed == TYMED_NULL, then a delete-on-release
00134 **    storage is allocated (either file-based or memory-base depending
00135 **    the value of fUseMemory). this is useful to support an
00136 **    IDataObject::GetData call where the callee must allocate the
00137 **    medium.
00138 **
00139 **    if lpMedium->tymed == TYMED_ISTORAGE, then the data is writen
00140 **    into the passed in IStorage. this is useful to support an
00141 **    IDataObject::GetDataHere call where the caller has allocated his
00142 **    own IStorage.
00143 */
00144 STDAPI GetOleObjectDataHere(  LPPERSISTSTORAGE lpPStg,
00145               LPFORMATETC lpformatetc,
00146               LPSTGMEDIUM lpMedium)
00147 {
00148   UNREFERENCED_PARAMETER(lpformatetc);
00149   HRESULT     hr = DATA_E_FORMATETC;
00150
00151   lpMedium->pUnkForRelease = NULL;
00152
00153   if(lpMedium->tymed != TYMED_ISTORAGE)
00154   {
00155     return hr;
00156   }
00157
00158   //AddRef the IStorage pointer
00159   lpPStg->AddRef();
00160
00161   // NOTE: even if OleSave returns an error you should still call
00162   // SaveCompleted.
00163
00164   hr = OleSave(lpPStg, lpMedium->pstg, FALSE /* fSameAsLoad */);
00165
00166   lpPStg->SaveCompleted(NULL);
00167
00168   return hr;
00169 }
00170
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/JavaClient/FullSvr/ICancelMethodCalls.java Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • JavaClient
  • FullSvr

ICancelMethodCalls.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc958.tmp" /nologo /d "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\JavaClient" "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\FullSvr\Debug\FullSvr.exe")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package fullsvr;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ICancelMethodCalls
00019 /** @com.interface(iid=00000029-0000-0000-C000-000000000046, thread=AUTO) */
00020 public interface ICancelMethodCalls extends IUnknown
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([in,type=U4] ulSeconds) */
00024   public void Cancel(int ulSeconds);
00025
00026   /** @com.method(vtoffset=1, addFlagsVtable=4)
00027       @com.parameters() */
00028   public void TestCancel();
00029
00030
00031   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x29, (short)0x0, (short)0x0, (byte)0xc0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x46);
00032 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/guids.h Source File

  • SysMgmt
  • MMC
  • Taskpads

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // {C83216B2-A4E5-11d2-970B-0080C7DCB3DC}
00020 DEFINE_GUID(CLSID_CComponentData,
00021             0xc83216b2, 0xa4e5, 0x11d2, 0x97, 0xb, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc);
00022
00023 // {CED3C801-A4E5-11d2-970B-0080C7DCB3DC}
00024 DEFINE_GUID(CLSID_CSnapinAbout,
00025             0xced3c801, 0xa4e5, 0x11d2, 0x97, 0xb, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/OPBank/OPBank.Idl Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • OPBank

OPBank.Idl

Go to the documentation of this file.
00001 // OPBank.idl : IDL source for OPBank.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (OPBank.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010 [
00011   uuid(7B876BC0-96BC-11D2-84FA-00C04F79E4B5),
00012   version(1.0),
00013   helpstring("OPBank 1.0 Type Library")
00014 ]
00015 library OPBANKLib
00016 {
00017   importlib("stdole32.tlb");
00018   importlib("stdole2.tlb");
00019
00020 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/File Share SampleEx.h Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

File Share SampleEx.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      File Share SampleEx.h
00007 //
00008 //  Implementation File:
00009 //      File Share SampleEx.cpp
00010 //
00011 //  Description:
00012 //      Global definitions across the DLL.
00013 //
00014 //  Author:
00015 //      <name> (<e-mail name>) Mmmm DD, 2003
00016 //
00017 //  Revision History:
00018 //
00019 //  Notes:
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #pragma once
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Include Files
00027 /////////////////////////////////////////////////////////////////////////////
00028
00029 #ifndef __AFXWIN_H__
00030     #error include 'stdafx.h' before including this file for PCH
00031 #endif
00032
00033 #include "resource.h"       // main symbols
00034
00035 /////////////////////////////////////////////////////////////////////////////
00036 // Constant Definitions
00037 /////////////////////////////////////////////////////////////////////////////
00038
00039 #define REGPARAM_FILESHARESAMPLE_SHARENAME L"ShareName"
00040 #define REGPARAM_FILESHARESAMPLE_PATH L"Path"
00041 #define REGPARAM_FILESHARESAMPLE_REMARK L"Remark"
00042 #define REGPARAM_FILESHARESAMPLE_MAXUSERS L"MaxUsers"
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045 // Global Function Declarations
00046 /////////////////////////////////////////////////////////////////////////////
00047
00048 void
00049 FormatError(
00050       CString & rstrErrorInout
00051     , DWORD     dwErrorIn
00052     );
00053
00054 /////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSimpleObject Member List

This is the complete list of members for CSimpleObject, including all inherited members.
Clone(IStream **ppstm) | CSimpleObject | [inline]
Commit(DWORD grfCommitFlags) | CSimpleObject | [inline]
CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) | CSimpleObject | [inline]
CSimpleObject() | CSimpleObject | [inline]
CSimpleObject() | CSimpleObject | [inline]
CSimpleObject() | CSimpleObject | [inline]
CSimpleObject() | CSimpleObject | [inline]
GetClassID(CLSID *pClsID) | CSimpleObject |
GetClassID(CLSID *pClsID) | CSimpleObject |
GetClassID(CLSID *pClsID) | CSimpleObject |
hConsole | CSimpleObject | [private]
LockRegion(ULARGE_INTEGER bOffset, ULARGE_INTEGER cb, DWORD dwLockType) | CSimpleObject | [inline]
m_cRef | CSimpleObject | [private]
QueryInterface(REFIID iid, void **ppv) | CSimpleObject |
QueryInterface(REFIID iid, void **ppv) | CSimpleObject |
QueryInterface(REFIID iid, void **ppv) | CSimpleObject |
QueryInterface(REFIID iid, void **ppv) | CSimpleObject |
Read(void *pv, ULONG cb, ULONG *pcbRead) | CSimpleObject |
Revert(void) | CSimpleObject | [inline]
Seek(LARGE_INTEGER dbMove, DWORD dwOrigin, ULARGE_INTEGER *pbNewPosition) | CSimpleObject | [inline]
SetSize(ULARGE_INTEGER cbNewSize) | CSimpleObject | [inline]
Stat(STATSTG *pstatstg, DWORD grfStatFlag) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) Release(void) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) Release(void) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) Release(void) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CSimpleObject | [inline]
STDMETHODIMP_(ULONG) Release(void) | CSimpleObject | [inline]
UnlockRegion(ULARGE_INTEGER bOffset, ULARGE_INTEGER cb, DWORD dwLockType) | CSimpleObject | [inline]
WasteTime(TCHAR *szMessage) | CSimpleObject |
WasteTime(TCHAR *szMessage) | CSimpleObject |
WasteTime(TCHAR *szMessage) | CSimpleObject |
Write(VOID const *pv, ULONG cb, ULONG *pcbWritten) | CSimpleObject |
xy | CSimpleObject | [private]
~CSimpleObject() | CSimpleObject | [inline]
~CSimpleObject() | CSimpleObject | [inline]
~CSimpleObject() | CSimpleObject | [inline]
~CSimpleObject() | CSimpleObject | [inline]
Generated on Wed Nov 13 2024 16:57:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/util.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

util.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       util.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "util.h"
00013
00014 HRESULT SetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, LPCWSTR lpszValue)
00015 {
00016   ASSERT(pIADs != NULL);
00017   ASSERT(lpszAttr != NULL);
00018
00019   //
00020   // Allocate the string
00021   //
00022   BSTR bstrAttr = ::SysAllocString(lpszAttr);
00023
00024   //
00025   // Imbed the value in a VARIANT
00026   //
00027   HRESULT hr = S_OK;
00028   CComVariant varValue;
00029   varValue.vt = VT_BSTR;
00030   varValue.bstrVal = ::SysAllocString(lpszValue);
00031
00032   //
00033   // Set the value in the temporary object
00034   //
00035   hr = pIADs->Put(bstrAttr, varValue);
00036
00037   //
00038   // Clean up memory
00039   //
00040   ::SysFreeString(bstrAttr);
00041   return hr;
00042 }
00043
00044 //////////////////////////////////////////////////////////////////////////////////////////
00045 //////////////////////////////////////////////////////////////////////////////////////////
00046
00047 //
00048 // Attribute value edit box
00049 //
00050 BEGIN_MESSAGE_MAP(CAttributeValueEditor, CEdit)
00051   ON_CONTROL_REFLECT_EX(EN_CHANGE, OnChange)
00052 END_MESSAGE_MAP()
00053
00054 BOOL CAttributeValueEditor::OnChange()
00055 {
00056   //
00057   // Let the editor handle the message
00058   //
00059   m_pEditor->OnEditChange();
00060   return FALSE;
00061 }
00062
00063 //////////////////////////////////////////////////////////////////////////////////////////
00064
00065 //
00066 // Attribute value list box
00067 //
00068 BEGIN_MESSAGE_MAP(CMultiValuedListBox, CListBox)
00069   ON_CONTROL_REFLECT_EX(LBN_SELCHANGE, OnSelChange)
00070 END_MESSAGE_MAP()
00071
00072 BOOL CMultiValuedListBox::OnSelChange()
00073 {
00074   //
00075   // Let the editor handle the message
00076   //
00077   m_pEditor->OnValueSelChange();
00078   return FALSE;
00079 }
00080
00081 //////////////////////////////////////////////////////////////////////////////////////////
00082
00083 //
00084 // Add button
00085 //
00086 BEGIN_MESSAGE_MAP(CAttributeValueAddButton, CButton)
00087   ON_CONTROL_REFLECT_EX(BN_CLICKED, OnAdd)
00088 END_MESSAGE_MAP()
00089
00090 BOOL CAttributeValueAddButton::OnAdd()
00091 {
00092   //
00093   // Let the editor handle the message
00094   //
00095   m_pEditor->OnAddValue();
00096   return FALSE;
00097 }
00098
00099 //////////////////////////////////////////////////////////////////////////////////////////
00100
00101 //
00102 // Delete button
00103 //
00104 BEGIN_MESSAGE_MAP(CAttributeValueDeleteButton, CButton)
00105   ON_CONTROL_REFLECT_EX(BN_CLICKED, OnDelete)
00106 END_MESSAGE_MAP()
00107
00108 BOOL CAttributeValueDeleteButton::OnDelete()
00109 {
00110   //
00111   // Let the editor handle the message
00112   //
00113   m_pEditor->OnDeleteValue();
00114   return FALSE;
00115 }
00116
00117
00118 //////////////////////////////////////////////////////////////////////////////////////////
00119
00120 CMultiValuedAttributeEditor::CMultiValuedAttributeEditor(CStringList& strrefAttributeList) :
00121   m_ValueEditor(this),
00122   m_ValueList(this),
00123   m_AddButton(this),
00124   m_DeleteButton(this),
00125   m_strrefAttributeList(strrefAttributeList)
00126
00127 {
00128 }
00129
00130 BOOL CMultiValuedAttributeEditor::Initialize(UINT nEditBox,
00131                                               UINT nListBox,
00132                                               UINT nAddButton,
00133                                               UINT nDeleteButton,
00134                                               CWnd* pParentWnd)
00135 {
00136   BOOL bRes = TRUE;
00137
00138   //
00139   // Subclass controls
00140   //
00141   bRes = m_ValueEditor.SubclassDlgItem(nEditBox, pParentWnd);
00142   ASSERT(bRes);
00143   if (!bRes) return FALSE;
00144
00145   bRes = m_ValueList.SubclassDlgItem(nListBox, pParentWnd);
00146   ASSERT(bRes);
00147   if (!bRes) return FALSE;
00148
00149   bRes = m_AddButton.SubclassDlgItem(nAddButton, pParentWnd);
00150   ASSERT(bRes);
00151   if (!bRes) return FALSE;
00152
00153   bRes = m_DeleteButton.SubclassDlgItem(nDeleteButton, pParentWnd);
00154   ASSERT(bRes);
00155   if (!bRes) return FALSE;
00156
00157   //
00158   // Add strings to list box
00159   //
00160   POSITION pos = m_strrefAttributeList.GetHeadPosition();
00161   while (pos != NULL)
00162   {
00163     CString szAddString = m_strrefAttributeList.GetNext(pos);
00164     m_ValueList.AddString(szAddString);
00165   }
00166   return bRes;
00167 }
00168
00169 void CMultiValuedAttributeEditor::OnEditChange()
00170 {
00171   CString szNewValue;
00172
00173   //
00174   // Retrieve the new value and enable the add button if it's not empty
00175   //
00176   m_ValueEditor.GetWindowText(szNewValue);
00177   m_AddButton.EnableWindow(!szNewValue.IsEmpty());
00178 }
00179
00180 void CMultiValuedAttributeEditor::OnValueSelChange()
00181 {
00182   //
00183   // Enable the delete button if a value is selected in the list box
00184   //
00185   int nSelection = m_ValueList.GetCurSel();
00186   m_DeleteButton.EnableWindow(nSelection != LB_ERR);
00187 }
00188
00189 void CMultiValuedAttributeEditor::OnAddValue()
00190 {
00191   CString szNewValue;
00192
00193   //
00194   // Retrieve the new value and add it to the data list and list box
00195   //
00196   m_ValueEditor.GetWindowText(szNewValue);
00197   m_strrefAttributeList.AddTail(szNewValue);
00198   if (m_ValueList.AddString(szNewValue) != LB_ERR)
00199   {
00200     m_ValueEditor.SetWindowText(_T(""));
00201   }
00202
00203   if (m_ValueList.GetCount() !=0)
00204   {
00205     m_DeleteButton.EnableWindow(TRUE);
00206   }
00207 }
00208
00209 void CMultiValuedAttributeEditor::OnDeleteValue()
00210 {
00211   //
00212   // Remove the value from the list box and the data list
00213   //
00214   int nSelection = m_ValueList.GetCurSel();
00215   if (nSelection != LB_ERR)
00216   {
00217     m_ValueList.DeleteString(nSelection);
00218
00219     POSITION pos = m_strrefAttributeList.FindIndex(nSelection);
00220     if (pos != NULL)
00221     {
00222       m_strrefAttributeList.RemoveAt(pos);
00223     }
00224   }
00225   if (m_ValueList.GetCount() == 0)
00226   {
00227     m_DeleteButton.EnableWindow(FALSE);
00228   }
00229 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcsample.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcsample.cpp

Go to the documentation of this file.
00001 // rtcsample.cpp : Defines the entry point for the application.
00002 //
00003
00004 #include "stdafx.h"
00005
00006 /////////////////////////////////////////////
00007 //
00008 // WinMain
00009 //
00010
00011 int APIENTRY WinMain(HINSTANCE hInstance,
00012                      HINSTANCE hPrevInstance,
00013                      LPSTR     lpCmdLine,
00014                      int       nCmdShow)
00015 {
00016     HRESULT hr;
00017
00018     // Initialize COM
00019     hr = CoInitialize(NULL);
00020
00021     if (FAILED(hr))
00022     {
00023         // CoInitialize failed
00024         return 0;
00025     }
00026
00027     // Initialize windows common controls
00028     InitCommonControls();
00029
00030     // Load the rich edit library
00031     HMODULE hRichEdit;
00032
00033     hRichEdit = LoadLibraryW(L"riched20.dll");
00034
00035     if (hRichEdit == NULL)
00036     {
00037         // LoadLibrary failed
00038         return 0;
00039     }
00040
00041     // Register the window classes
00042     CRTCWin::RegisterClass();
00043     CRTCIMSession::RegisterClass();
00044     CRTCAVSession::RegisterClass();
00045
00046     // Create the main window
00047     HWND hWnd;
00048
00049     hWnd = CreateWindowExW(
00050                 0,
00051                 APP_CLASS,
00052                 APP_TITLE,
00053                 WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
00054                 CW_USEDEFAULT, CW_USEDEFAULT,
00055                 APP_WIDTH, APP_HEIGHT,
00056                 NULL,
00057                 NULL,
00058                 hInstance,
00059                 NULL);
00060
00061     if ( !hWnd )
00062     {
00063         // CreateWindowExW failed
00064         return 0;
00065     }
00066
00067     // Make the main window visible
00068     ShowWindow( hWnd, nCmdShow );
00069     UpdateWindow( hWnd );
00070
00071     // Message loop
00072     BOOL bRet;
00073     MSG msg;
00074
00075     while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
00076     {
00077         if (bRet == -1)
00078         {
00079             // GetMessage failed
00080             return 0;
00081         }
00082         else
00083         {
00084             TranslateMessage(&msg);
00085             DispatchMessage(&msg);
00086         }
00087     }
00088
00089     // Free the rich edit library
00090     FreeLibrary(hRichEdit);
00091
00092     // Shutdown COM
00093     CoUninitialize();
00094
00095   return msg.wParam;
00096 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminAuthenticationLevelOptions Member List

This is the complete list of members for comadmin::COMAdminAuthenticationLevelOptions, including all inherited members.
COMAdminAuthenticationCall | comadmin::COMAdminAuthenticationLevelOptions | [static]
COMAdminAuthenticationConnect | comadmin::COMAdminAuthenticationLevelOptions | [static]
COMAdminAuthenticationDefault | comadmin::COMAdminAuthenticationLevelOptions | [static]
COMAdminAuthenticationIntegrity | comadmin::COMAdminAuthenticationLevelOptions | [static]
COMAdminAuthenticationNone | comadmin::COMAdminAuthenticationLevelOptions | [static]
COMAdminAuthenticationPacket | comadmin::COMAdminAuthenticationLevelOptions | [static]
COMAdminAuthenticationPrivacy | comadmin::COMAdminAuthenticationLevelOptions | [static]
Generated on Wed Nov 13 2024 16:58:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/rqsconfig.cpp Source File

  • NetDS
  • RRas
  • rqs
  • server

rqsconfig.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RqsConfig.cpp
00004 //
00005 //      Synopsis:   Class to read configuration for the server-side quarantine
00006 //                  removal utility.
00007 //
00008 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00009 //
00010 //+--------------------------------------------------------------------------
00011
00012 #include <Rqs.h>
00013
00014 static const UINT g_uiPort = 7250;
00015
00016 static int __cdecl
00017 RqsCompare(
00018     IN const void* elem1,
00019     IN const void* elem2)
00020 {
00021     RqsConfigString* p1 = (RqsConfigString*) elem1;
00022     RqsConfigString* p2 = (RqsConfigString*) elem2;
00023
00024     return strcmp( p1->pszString, p2->pszString );
00025 }
00026
00027 //+--------------------------------------------------------------------------
00028 //
00029 // Synopsis: Creates a configuration object
00030 //
00031 //+--------------------------------------------------------------------------
00032 RqsConfig::RqsConfig() : m_pStrings(NULL), m_uiCount(0),
00033                         m_uiPort(g_uiPort), m_fTraceEnabled(FALSE),
00034                         m_fDebuggerTrace(FALSE), m_pszLibrary(NULL)
00035 {
00036 }
00037
00038 //+--------------------------------------------------------------------------
00039 //
00040 // Synopsis: Destroys a configuration object
00041 //
00042 //+--------------------------------------------------------------------------
00043 RqsConfig::~RqsConfig()
00044 {
00045     Clear();
00046 }
00047
00048 //+--------------------------------------------------------------------------
00049 //
00050 // Synopsis: Helper function clears a table of strings.
00051 //
00052 //+--------------------------------------------------------------------------
00053 VOID
00054 RqsConfig::ClearStrings(
00055     IN RqsConfigString* pStrings,
00056     IN UINT uiCount)
00057 {
00058     UINT i;
00059
00060     for (i = 0; i < uiCount; i++)
00061     {
00062         RuFree(pStrings[i].pszString);
00063     }
00064     delete [] pStrings;
00065 }
00066
00067 //+--------------------------------------------------------------------------
00068 //
00069 // Synopsis: Clears a configuration object
00070 //
00071 //+--------------------------------------------------------------------------
00072 VOID
00073 RqsConfig::Clear()
00074 {
00075
00076     if (m_pStrings)
00077     {
00078         ClearStrings(m_pStrings, m_uiCount);
00079     }
00080
00081     m_pszLibrary = NULL;
00082     m_pStrings = NULL;
00083     m_uiCount = 0;
00084 }
00085
00086 //+--------------------------------------------------------------------------
00087 //
00088 // Synopsis: Returns the port
00089 //
00090 //+--------------------------------------------------------------------------
00091 UINT
00092 RqsConfig::GetPort() const
00093 {
00094     return m_uiPort;
00095 }
00096
00097 //+--------------------------------------------------------------------------
00098 //
00099 // Synopsis: Returns whether debugger tracing is enabled
00100 //
00101 //+--------------------------------------------------------------------------
00102 BOOL
00103 RqsConfig::GetDebugTrace() const
00104 {
00105     return m_fDebuggerTrace;
00106 }
00107
00108 //+--------------------------------------------------------------------------
00109 //
00110 // Synopsis: Returns whether tracing is enabled
00111 //
00112 //+--------------------------------------------------------------------------
00113 BOOL
00114 RqsConfig::GetTraceEnabled() const
00115 {
00116     return m_fTraceEnabled;
00117 }
00118
00119 //+--------------------------------------------------------------------------
00120 //
00121 // Synopsis: Returns the library to load for authentication.
00122 //
00123 //+--------------------------------------------------------------------------
00124 CONST WCHAR*
00125 RqsConfig::GetLibrary() const
00126 {
00127     if (m_pszLibrary)
00128     {
00129         return m_pszLibrary;
00130     }
00131
00132     return L"mprapi.dll";
00133 }
00134
00135 //+--------------------------------------------------------------------------
00136 //
00137 // Synopsis: Loads the trace settings
00138 //
00139 //+--------------------------------------------------------------------------
00140 HRESULT
00141 RqsConfig::LoadTrace()
00142 {
00143     HRESULT hr = S_OK;
00144     RUREGVALUE ruVals[] =
00145     {
00146         {
00147             L"EnableConsoleTracing",
00148             REG_DWORD,
00149             0,
00150             NULL,
00151             0
00152         },
00153         {
00154             L"EnableFileTracing",
00155             REG_DWORD,
00156             0,
00157             NULL,
00158             0
00159         }
00160     };
00161
00162     __try
00163     {
00164         m_fTraceEnabled = FALSE;
00165
00166         hr = RuRegGet(
00167                 GetTracePath(),
00168                 ruVals,
00169                 RU_ELEMENT_COUNT(ruVals));
00170         if (hr != NO_ERROR)
00171         {
00172            hr = HRESULT_FROM_WIN32(hr);
00173            __leave;
00174         }
00175
00176         // If either value is set, then set m_fTracing
00177         //
00178         if (S_OK == ruVals[0].hr)
00179         {
00180             if (*((DWORD*)ruVals[0].pbData))
00181             {
00182                 m_fTraceEnabled = TRUE;
00183             }
00184         }
00185
00186         if (S_OK == ruVals[1].hr)
00187         {
00188             if (*((DWORD*)ruVals[1].pbData))
00189             {
00190                 m_fTraceEnabled = TRUE;
00191             }
00192         }
00193
00194     }
00195
00196     __finally
00197     {
00198         RuRegFreeValues(ruVals, RU_ELEMENT_COUNT(ruVals));
00199     }
00200
00201     return hr;
00202 }
00203
00204 //+--------------------------------------------------------------------------
00205 //
00206 // Synopsis: Loads configuration settings
00207 //
00208 //+--------------------------------------------------------------------------
00209 HRESULT
00210 RqsConfig::LoadConfig()
00211 {
00212     DWORD dwErr = NO_ERROR;
00213     HRESULT hr = S_OK;
00214     WCHAR* pszCur;
00215     UINT uiCount = 0, uiLen;
00216     CHAR* pszString;
00217     RqsConfigString* pStrings = NULL;
00218     RUREGVALUE ruVals[] =
00219     {
00220         {
00221             L"AllowedSet",
00222             REG_MULTI_SZ,
00223             0,
00224             NULL,
00225             0
00226         },
00227         {
00228             L"Port",
00229             REG_DWORD,
00230             0,
00231             NULL,
00232             0
00233         },
00234         {
00235             L"DebuggerTrace",
00236             REG_DWORD,
00237             0,
00238             NULL,
00239             0
00240         },
00241         {
00242             L"Authenticator",
00243             REG_SZ,
00244             0,
00245             NULL,
00246             0
00247         }
00248     };
00249
00250     __try
00251     {
00252         // Read the multisz from the registry
00253         //
00254         dwErr = RuRegGet(
00255                    GetConfigPath(),
00256                    ruVals,
00257                    RU_ELEMENT_COUNT(ruVals));
00258         if (dwErr != NO_ERROR)
00259         {
00260            hr = HRESULT_FROM_WIN32(dwErr);
00261            __leave;
00262         }
00263
00264         // Read in the [optional] allowed set.
00265         //
00266         if (S_OK == ruVals[0].hr)
00267         {
00268             // Count the number of wide-character strings
00269             //
00270             pszCur = (WCHAR*) ruVals[0].pbData;
00271             while (*pszCur)
00272             {
00273                 uiCount++;
00274                 pszCur += wcslen(pszCur) + 1;
00275             }
00276             if (uiCount)
00277             {
00278                 // Allocate the array of ansi strings
00279                 //
00280                 pStrings = new RqsConfigString[uiCount];
00281                 if (pStrings == NULL)
00282                 {
00283                     hr = E_OUTOFMEMORY;
00284                     __leave;
00285                 }
00286                 ZeroMemory(pStrings, sizeof(pStrings) * uiCount);
00287
00288                 uiCount = 0;
00289                 pszCur = (WCHAR*) ruVals[0].pbData;
00290                 while (*pszCur)
00291                 {
00292                     // Covert the unicode string to ansi
00293                     //
00294                     pszString = RuStringDupWtoA(pszCur);
00295                     if (pszString == NULL)
00296                     {
00297                         hr = E_OUTOFMEMORY;
00298                         __leave;
00299                     }
00300
00301                     // If the string ends in '*', then we only want to compare
00302                     // the characters up to that wildcard symbol
00303                     //
00304                     uiLen = (UINT)strlen(pszString);
00305                     if (pszString[uiLen - 1] == '*')
00306                     {
00307                         pStrings[uiCount].uiLength = uiLen - 1;
00308                     }
00309                     else
00310                     {
00311                         pStrings[uiCount].uiLength = 0;
00312                     }
00313
00314                     pStrings[uiCount].pszString = pszString;
00315                     pszCur += wcslen(pszCur) + 1;
00316                     uiCount++;
00317                 }
00318
00319                 // Sort the set of allowed strings
00320                 //
00321                 qsort(
00322                     pStrings,
00323                     uiCount,
00324                     sizeof(RqsConfigString),
00325                     RqsCompare);
00326
00327                 ClearStrings(m_pStrings, m_uiCount);
00328                 m_pStrings = pStrings;
00329                 m_uiCount = uiCount;
00330             }
00331         }
00332
00333         // Read in the [optional] port
00334         //
00335         if (S_OK == ruVals[1].hr)
00336         {
00337             m_uiPort = *((DWORD*)ruVals[1].pbData);
00338         }
00339
00340         // Read in the [optional] debug trace flag
00341         //
00342         if (S_OK == ruVals[2].hr)
00343         {
00344             m_fDebuggerTrace = *((DWORD*)ruVals[2].pbData);
00345         }
00346
00347         // Read in the [optional] authenticator
00348         //
00349         if (S_OK == ruVals[3].hr)
00350         {
00351             m_pszLibrary = (reinterpret_cast<CONST PWSTR>(ruVals[3].pbData));
00352         }
00353
00354     }
00355
00356     __finally
00357     {
00358         RuRegFreeValues(ruVals, RU_ELEMENT_COUNT(ruVals));
00359         if ((S_OK != hr) && (pStrings))
00360         {
00361             ClearStrings(pStrings, uiCount);
00362         }
00363     }
00364
00365     return hr;
00366 }
00367
00368 //+--------------------------------------------------------------------------
00369 //
00370 // Synopsis: Loads the configuration object
00371 //
00372 //+--------------------------------------------------------------------------
00373 HRESULT
00374 RqsConfig::Load()
00375 {
00376     HRESULT hr = S_OK;
00377
00378     // Ignore the error return from LoadTrace -- it's safe to continue
00379     // without it.
00380     //
00381     LoadTrace();
00382     hr = LoadConfig();
00383
00384     return hr;
00385 }
00386 //+--------------------------------------------------------------------------
00387 //
00388 // Synopsis: Finds a string in the "allowed strings table" of the
00389 //           configuration object.
00390 //
00391 //+--------------------------------------------------------------------------
00392 BOOL
00393 RqsConfig::Find(
00394     IN CHAR* pszString) const
00395 {
00396     INT iRet;
00397
00398     for (UINT i = 0; i < m_uiCount; i++)
00399     {
00400         // Wild card strings have non-zero length.  If the length is 0,
00401         // it means we should do an exact string comparison.
00402         //
00403         if (m_pStrings[i].uiLength == 0)
00404         {
00405             iRet = strcmp(
00406                         m_pStrings[i].pszString,
00407                         pszString);
00408         }
00409         else
00410         {
00411             iRet = strncmp(
00412                     m_pStrings[i].pszString,
00413                     pszString,
00414                     m_pStrings[i].uiLength);
00415         }
00416
00417         if (iRet == 0)
00418         {
00419             return TRUE;
00420         }
00421         else if (iRet == 1)
00422         {
00423             return FALSE;
00424         }
00425     }
00426
00427     return FALSE;
00428 }
00429
00430 //+--------------------------------------------------------------------------
00431 //
00432 // Synopsis: Returns the registry path where configuration is stored
00433 //
00434 //+--------------------------------------------------------------------------
00435 const PWSTR
00436 RqsConfig::GetConfigPath()
00437 {
00438     return L"HKLM\\System\\CurrentControlSet\\Services\\Rqs";
00439 }
00440
00441 //+--------------------------------------------------------------------------
00442 //
00443 // Synopsis: Returns the registry path where the tracing enabling/disabling
00444 //           is stored.
00445 //
00446 //+--------------------------------------------------------------------------
00447 const PWSTR
00448 RqsConfig::GetTracePath()
00449 {
00450     return L"HKLM\\Software\\Microsoft\\Tracing\\Rqs";
00451 }
00452
00453 //+--------------------------------------------------------------------------
00454 //
00455 // Synopsis: Traces the current configuration using the engine provided
00456 //
00457 //+--------------------------------------------------------------------------
00458 VOID
00459 RqsConfig::TraceSelf(
00460     IN const RqsEngine& Engine)
00461 {
00462     UINT i;
00463
00464     Engine.Trace("Port %d", m_uiPort);
00465     Engine.Trace("Trace: %d", m_fTraceEnabled);
00466     Engine.Trace("Debugger Trace: %d", m_fDebuggerTrace);
00467     Engine.Trace("%d strings:", m_uiCount);
00468
00469     for (i = 0; i < m_uiCount; i++)
00470     {
00471        Engine.Trace(
00472             "[%04d] %s",
00473             m_pStrings[i].uiLength,
00474             m_pStrings[i].pszString);
00475     }
00476
00477 }
00478
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/space.Cpp Source File

  • SysMgmt
  • MMC
  • Complete

space.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include <windows.h>
00021 #include "Space.h"
00022 #include "Comp.h"
00023 #include "CompData.h"
00024 #include "DataObj.h"
00025 #include "globals.h"
00026 #include "resource.h"
00027 #define STRSAFE_NO_DEPRECATE
00028 #include <strsafe.h>
00029
00030 const GUID CSpaceVehicle::thisGuid = { 0xb95e11f4, 0x6be7, 0x11d3, {0x91, 0x56, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} };
00031
00032 const GUID CRocket::thisGuid = { 0xb95e11f5, 0x6be7, 0x11d3, {0x91, 0x56, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} };
00033
00034
00035 //==============================================================
00036 //
00037 // CSpaceVehicle implementation
00038 //
00039 //
00040 CSpaceVehicle::CSpaceVehicle() : m_cchildren(NUMBER_OF_CHILDREN)
00041 {
00042     for (int n = 0; n < m_cchildren; n++) {
00043         children[n] = new CRocket(_T("Rocket"), n+1, 500000, 265, 75000, this);
00044     }
00045 }
00046
00047 CSpaceVehicle::~CSpaceVehicle()
00048 {
00049     for (int n = 0; n < m_cchildren; n++)
00050         if (children[n]) {
00051             delete children[n];
00052         }
00053 }
00054
00055 HRESULT CSpaceVehicle::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00056 {
00057     HRESULT      hr = S_OK;
00058
00059     IHeaderCtrl *pHeaderCtrl = NULL;
00060     IResultData *pResultData = NULL;
00061
00062     if (bShow) {
00063
00064                 hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00065         _ASSERT( SUCCEEDED(hr) );
00066
00067         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00068         _ASSERT( SUCCEEDED(hr) );
00069
00070         // Set the column headers in the results pane
00071         hr = pHeaderCtrl->InsertColumn( 0, L"Rocket Class", 0, MMCLV_AUTO );
00072         _ASSERT( S_OK == hr );
00073         hr = pHeaderCtrl->InsertColumn( 1, L"Rocket Weight", 0, MMCLV_AUTO );
00074         _ASSERT( S_OK == hr );
00075         hr = pHeaderCtrl->InsertColumn( 2, L"Rocket Height", 0, MMCLV_AUTO );
00076         _ASSERT( S_OK == hr );
00077         hr = pHeaderCtrl->InsertColumn( 3, L"Rocket Payload", 0, MMCLV_AUTO );
00078         _ASSERT( S_OK == hr );
00079         hr = pHeaderCtrl->InsertColumn( 4, L"Status", 0, MMCLV_AUTO );
00080         _ASSERT( S_OK == hr );
00081
00082         // insert items here
00083         RESULTDATAITEM rdi;
00084
00085         hr = pResultData->DeleteAllRsltItems();
00086         _ASSERT( SUCCEEDED(hr) );
00087
00088         if (!bExpanded) {
00089             // create the child nodes, then expand them
00090             for (int n = 0; n < m_cchildren; n++)
00091             {
00092                 BOOL childDeleteStatus = children[n]->getDeletedStatus();
00093
00094                 // If the child is deleted by the user do not insert it.
00095                 if ( !childDeleteStatus)
00096                 {
00097                     ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00098                     rdi.mask       = RDI_STR       |   // Displayname is valid
00099                         RDI_IMAGE     |
00100                         RDI_PARAM;        // nImage is valid
00101
00102                     rdi.nImage      = children[n]->GetBitmapIndex();
00103                     rdi.str         = MMC_CALLBACK;
00104                     rdi.nCol        = 0;
00105                     rdi.lParam      = (LPARAM)children[n];
00106
00107                     hr = pResultData->InsertItem( &rdi );
00108                     _ASSERT( SUCCEEDED(hr) );
00109                 }
00110             }
00111         }
00112
00113         pHeaderCtrl->Release();
00114         pResultData->Release();
00115     }
00116
00117     return hr;
00118 }
00119
00120
00121 HRESULT CSpaceVehicle::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed)
00122 {
00123     HRESULT hr = S_OK;
00124     CONTEXTMENUITEM menuItemsNew[] =
00125     {
00126         {
00127             L"New future vehicle", L"Add a new future vehicle",
00128             IDM_NEW_SPACE, CCM_INSERTIONPOINTID_PRIMARY_NEW, 0, CCM_SPECIAL_DEFAULT_ITEM
00129         },
00130         { NULL, NULL, 0, 0, 0 }
00131     };
00132
00133     // Loop through and add each of the menu items, we
00134     // want to add to new menu, so see if it is allowed.
00135     if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_NEW)
00136     {
00137         for (LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++)
00138         {
00139             hr = pContextMenuCallback->AddItem(m);
00140
00141             if (FAILED(hr))
00142                 break;
00143         }
00144     }
00145
00146     return hr;
00147 }
00148
00149 HRESULT CSpaceVehicle::OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *pDataObject)
00150 {
00151     switch (lCommandID)
00152     {
00153     case IDM_NEW_SPACE:
00154
00155         if (m_cchildren < MAX_NUMBER_OF_CHILDREN)
00156         {       //create new Rocket
00157             children[m_cchildren] = new CRocket(_T("Rocket"), m_cchildren+1, 500000, 265, 75000, this);
00158
00159             pConsole->MessageBox(L"Created a new future vehicle", L"Menu Command", MB_OK|MB_ICONINFORMATION, NULL);
00160
00161             m_cchildren++;
00162
00163             // We created a new object in result pane. We need to insert this object
00164             // in all the views, call UpdateAllViews for this.
00165             // Pass pointer to data object passed into OnMenuCommand.
00166             HRESULT hr;
00167             hr = pConsole->UpdateAllViews(pDataObject, m_hParentHScopeItem, UPDATE_SCOPEITEM);
00168             _ASSERT( S_OK == hr);
00169
00170         }
00171         else
00172             pConsole->MessageBox(L"No more future vehicles allowed", L"Menu Command", MB_OK|MB_ICONWARNING, NULL);
00173         break;
00174     }
00175
00176     return S_OK;
00177 }
00178
00179
00180 //==============================================================
00181 //
00182 // CRocket implementation
00183 //
00184 //
00185 CRocket::CRocket(_TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload, CSpaceVehicle *pParent)
00186 : szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED), m_pParent(pParent)
00187 {
00188     if (szName) {
00189         this->szName = new _TCHAR[(_tcslen(szName) + 1) * sizeof(_TCHAR)];
00190         _tcscpy(this->szName, szName);
00191     }
00192
00193     this->nId = id;
00194     this->lWeight = lWeight;
00195     this->lHeight = lHeight;
00196     this->lPayload = lPayload;
00197
00198     m_ppHandle = 0;
00199
00200     isDeleted = FALSE;
00201 }
00202
00203 CRocket::~CRocket()
00204 {
00205     if (szName)
00206         delete [] szName;
00207 }
00208
00209 const _TCHAR *CRocket::GetDisplayName(int nCol)
00210 {
00211     const size_t cchBuffer = 128;
00212     static _TCHAR buf[cchBuffer];
00213
00214     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00215     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00216
00217     switch (nCol) {
00218     case 0:
00219         StringCchPrintf(buf, cchBuffer, _T("%s (#%d)"), szName ? szName : _T(""), nId);
00220         break;
00221
00222     case 1:
00223         StringCchPrintf(buf, cchBuffer, _T("%ld metric tons"), lWeight);
00224         break;
00225
00226     case 2:
00227         StringCchPrintf(buf, cchBuffer, _T("%ld meters"), lHeight);
00228         break;
00229
00230     case 3:
00231         StringCchPrintf(buf, cchBuffer, _T("%ld kilos"), lPayload);
00232         break;
00233
00234     case 4:
00235         StringCchPrintf(buf, cchBuffer, _T("%s"),
00236             iStatus == RUNNING ? _T("running") :
00237         iStatus == PAUSED ? _T("paused") :
00238         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00239         break;
00240
00241     }
00242
00243     return buf;
00244 }
00245
00246 HRESULT CRocket::OnRename(LPOLESTR pszNewName)
00247 {
00248
00249     HRESULT hr = S_FALSE;
00250
00251     if (szName)
00252     {
00253         delete [] szName;
00254         szName = NULL;
00255     }
00256
00257     MAKE_TSTRPTR_FROMWIDE(ptrname, pszNewName);
00258     szName = new _TCHAR[(_tcslen(ptrname) + 1) * sizeof(_TCHAR)];
00259     _tcscpy(szName, ptrname);
00260
00261     return hr;
00262 }
00263
00264 // handle anything special when the user clicks Apply or Ok
00265 // on the property sheet.  This sample directly accesses the
00266 // operated-on object, so there's nothing special to do...
00267 // ...except to update all views
00268 HRESULT CRocket::OnPropertyChange(IConsole *pConsole, CComponent *pComponent)
00269 {
00270
00271     HRESULT hr = S_FALSE;
00272
00273     //Call IConsole::UpdateAllViews to redraw the item
00274     //in all views. We need a data object because of the
00275     //way UpdateAllViews is implemented, and because
00276     //MMCN_PROPERTY_CHANGE doesn't give us one
00277
00278     LPDATAOBJECT pDataObject;
00279     hr = pComponent->QueryDataObject((MMC_COOKIE)this, CCT_RESULT, &pDataObject );
00280     _ASSERT( S_OK == hr);
00281
00282     hr = pConsole->UpdateAllViews(pDataObject, nId, UPDATE_RESULTITEM);
00283     _ASSERT( S_OK == hr);
00284
00285     pDataObject->Release();
00286
00287     return hr;
00288 }
00289
00290 HRESULT CRocket::OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect)
00291 {
00292
00293     // enable rename, refresh, and delete verbs
00294     IConsoleVerb *pConsoleVerb;
00295
00296     HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00297     _ASSERT(SUCCEEDED(hr));
00298
00299     hr = pConsoleVerb->SetVerbState(MMC_VERB_RENAME, ENABLED, TRUE);
00300     hr = pConsoleVerb->SetVerbState(MMC_VERB_REFRESH, ENABLED, TRUE);
00301     hr = pConsoleVerb->SetVerbState(MMC_VERB_DELETE, ENABLED, TRUE);
00302
00303
00304     // can't get to properties (via the standard methods) unless
00305     // we tell MMC to display the Properties menu item and
00306     // toolbar button, this will give the user a visual cue that
00307     // there's "something" to do
00308     hr = pConsoleVerb->SetVerbState(MMC_VERB_PROPERTIES, ENABLED, TRUE);
00309
00310     //also set MMC_VERB_PROPERTIES as the default verb
00311     hr = pConsoleVerb->SetDefaultVerb(MMC_VERB_PROPERTIES);
00312
00313     pConsoleVerb->Release();
00314
00315         // now set toolbar button states
00316     if (bSelect) {
00317         switch (iStatus)
00318         {
00319         case RUNNING:
00320             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, TRUE);
00321             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, FALSE);
00322             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00323             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00324             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00325             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00326             break;
00327
00328         case PAUSED:
00329             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00330             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00331             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, TRUE);
00332             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, FALSE);
00333             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, FALSE);
00334             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, TRUE);
00335             break;
00336
00337         case STOPPED:
00338             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, BUTTONPRESSED, FALSE);
00339             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTART, ENABLED, TRUE);
00340             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, BUTTONPRESSED, FALSE);
00341             pComponent->getToolbar()->SetButtonState(ID_BUTTONPAUSE, ENABLED, TRUE);
00342             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, BUTTONPRESSED, TRUE);
00343             pComponent->getToolbar()->SetButtonState(ID_BUTTONSTOP, ENABLED, FALSE);
00344             break;
00345         }
00346     }
00347
00348     return S_OK;
00349 }
00350
00351 // Implement the dialog proc
00352 BOOL CALLBACK CRocket::DialogProc(
00353                                   HWND hwndDlg,  // handle to dialog box
00354                                   UINT uMsg,     // message
00355                                   WPARAM wParam, // first message parameter
00356                                   LPARAM lParam  // second message parameter
00357                                   )
00358 {
00359     static CRocket *pRocket = NULL;
00360
00361     switch (uMsg) {
00362     case WM_INITDIALOG:
00363         // catch the "this" pointer so we can actually operate on the object
00364         pRocket = reinterpret_cast<CRocket *>(reinterpret_cast<PROPSHEETPAGE *>(lParam)->lParam);
00365
00366         SetDlgItemText(hwndDlg, IDC_ROCKET_NAME, pRocket->szName);
00367         SetDlgItemInt(hwndDlg, IDC_ROCKET_HEIGHT, pRocket->lHeight, FALSE);
00368         SetDlgItemInt(hwndDlg, IDC_ROCKET_WEIGHT, pRocket->lWeight, FALSE);
00369         SetDlgItemInt(hwndDlg, IDC_ROCKET_PAYLOAD, pRocket->lPayload, FALSE);
00370
00371         _ASSERT( CB_ERR != SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_INSERTSTRING, 0, (LPARAM)_T("Running")) );
00372         _ASSERT( CB_ERR != SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_INSERTSTRING, 1, (LPARAM)_T("Paused")) );
00373         _ASSERT( CB_ERR != SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_INSERTSTRING, 2, (LPARAM)_T("Stopped")) );
00374
00375         SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_SETCURSEL, (WPARAM)pRocket->iStatus, 0);
00376
00377         break;
00378
00379     case WM_COMMAND:
00380         // turn the Apply button on
00381         if (HIWORD(wParam) == EN_CHANGE ||
00382             HIWORD(wParam) == CBN_SELCHANGE)
00383             SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00384         break;
00385
00386     case WM_DESTROY:
00387         // tell MMC that we're done with the property sheet (we got this
00388         // handle in CreatePropertyPages
00389         MMCFreeNotifyHandle(pRocket->m_ppHandle);
00390         break;
00391
00392     case WM_NOTIFY:
00393         switch (((NMHDR *) lParam)->code) {
00394         case PSN_APPLY:
00395             // update the information
00396             if (pRocket->szName) {
00397                 delete [] pRocket->szName;
00398                 pRocket->szName = NULL;
00399             }
00400
00401             {
00402                 int n = SendDlgItemMessage(hwndDlg, IDC_ROCKET_NAME, WM_GETTEXTLENGTH, 0, 0);
00403                 if (n != 0) {
00404                     pRocket->szName = new _TCHAR[n + 1];
00405                     GetDlgItemText(hwndDlg, IDC_ROCKET_NAME, pRocket->szName, n + 1);
00406                 }
00407             }
00408             pRocket->lHeight = GetDlgItemInt(hwndDlg, IDC_ROCKET_HEIGHT, NULL, FALSE);
00409             pRocket->lWeight = GetDlgItemInt(hwndDlg, IDC_ROCKET_WEIGHT, NULL, FALSE);
00410             pRocket->lPayload = GetDlgItemInt(hwndDlg, IDC_ROCKET_PAYLOAD, NULL, FALSE);
00411
00412             pRocket->iStatus = (ROCKET_STATUS)SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_GETCURSEL, 0, 0);
00413
00414             // ask MMC to send us a message (on the main thread) so
00415             // we know the Apply button was clicked.
00416             HRESULT hr = MMCPropertyChangeNotify(pRocket->m_ppHandle, (long)pRocket);
00417
00418             _ASSERT(SUCCEEDED(hr));
00419
00420             return PSNRET_NOERROR;
00421         }
00422         break;
00423     }
00424
00425     return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
00426 }
00427
00428
00429 HRESULT CRocket::HasPropertySheets()
00430 {
00431     // say "yes" when MMC asks if we have pages
00432     return S_OK;
00433 }
00434
00435 HRESULT CRocket::CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle)
00436 {
00437     PROPSHEETPAGE psp;
00438     HPROPSHEETPAGE hPage = NULL;
00439
00440     // cache this handle so we can call MMCPropertyChangeNotify
00441     m_ppHandle = handle;
00442
00443     // create the property page for this node.
00444     // NOTE: if your node has multiple pages, put the following
00445     // in a loop and create multiple pages calling
00446     // lpProvider->AddPage() for each page.
00447     psp.dwSize = sizeof(PROPSHEETPAGE);
00448     psp.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USEICONID;
00449     psp.hInstance = g_hinst;
00450     psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_LARGE);
00451     psp.pfnDlgProc = DialogProc;
00452     psp.lParam = reinterpret_cast<LPARAM>(this);
00453     psp.pszTitle = MAKEINTRESOURCE(IDS_PST_ROCKET);
00454     psp.pszIcon = MAKEINTRESOURCE(IDI_PSI_ROCKET);
00455
00456
00457     hPage = CreatePropertySheetPage(&psp);
00458     _ASSERT(hPage);
00459
00460     return lpProvider->AddPage(hPage);
00461 }
00462
00463 HRESULT CRocket::GetWatermarks(HBITMAP *lphWatermark,
00464                                HBITMAP *lphHeader,
00465                                HPALETTE *lphPalette,
00466                                BOOL *bStretch)
00467 {
00468     return S_FALSE;
00469 }
00470
00471
00472 HRESULT CRocket::OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect)
00473 {
00474     HRESULT hr = S_OK;
00475
00476     if (bSelect) {
00477         // Always make sure the menuButton is attached
00478         hr = pControlbar->Attach(TOOLBAR, pToolbar);
00479     } else {
00480         // Always make sure the toolbar is detached
00481         hr = pControlbar->Detach(pToolbar);
00482     }
00483
00484     return hr;
00485 }
00486
00487 HRESULT CRocket::OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject)
00488 {
00489     const size_t cchBuffer = 128;
00490     _TCHAR szVehicle[cchBuffer];
00491
00492     static _TCHAR buf[cchBuffer];
00493
00494     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00495     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00496
00497     StringCchPrintf(buf, cchBuffer, _T("%s (#%d)"), szName ? szName : _T(""), nId);
00498
00499     switch (verb)
00500     {
00501     case ID_BUTTONSTART:
00502         iStatus = RUNNING;
00503         break;
00504
00505     case ID_BUTTONPAUSE:
00506         iStatus = PAUSED;
00507         break;
00508
00509     case ID_BUTTONSTOP:
00510         iStatus = STOPPED;
00511         break;
00512     }
00513
00514     StringCchPrintf(szVehicle, cchBuffer, _T("%s has been %s"), buf,
00515         (long)verb == ID_BUTTONSTART ? _T("started") :
00516     (long)verb == ID_BUTTONPAUSE ? _T("paused") :
00517     (long)verb == ID_BUTTONSTOP ? _T("stopped") : _T("!!!unknown command!!!"));
00518
00519     int ret = 0;
00520     MAKE_WIDEPTR_FROMTSTR_ALLOC(wszVehicle, szVehicle);
00521     pConsole->MessageBox(wszVehicle,
00522         L"Vehicle command", MB_OK | MB_ICONINFORMATION, &ret);
00523
00524     // Now call IConsole::UpdateAllViews to redraw the item in all views
00525     HRESULT hr;
00526     hr = pConsole->UpdateAllViews(pDataObject, nId, UPDATE_RESULTITEM);
00527     _ASSERT( S_OK == hr);
00528
00529
00530     return S_OK;
00531 }
00532
00533 HRESULT CRocket::OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype)
00534
00535 {
00536     HRESULT hr = S_FALSE;
00537
00538     _ASSERT(NULL != this || isDeleted || RESULT == itemtype);
00539
00540     //redraw the item
00541     IResultData *pResultData = NULL;
00542
00543     hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00544     _ASSERT( SUCCEEDED(hr) );
00545
00546     HRESULTITEM myhresultitem;
00547     _ASSERT(NULL != &myhresultitem);
00548
00549     //lparam == this. See CSpaceStation::OnShow
00550     hr = pResultData->FindItemByLParam( (LPARAM)this, &myhresultitem );
00551
00552     if ( FAILED(hr) )
00553     {
00554         // Failed : Reason may be that current view does not have this item.
00555         // So exit gracefully.
00556         hr = S_FALSE;
00557     } else
00558
00559     {
00560         hr = pResultData->UpdateItem( myhresultitem );
00561         _ASSERT( SUCCEEDED(hr) );
00562     }
00563
00564     pResultData->Release();
00565
00566     return hr;
00567 }
00568
00569 HRESULT CRocket::OnRefresh(IConsole *pConsole)
00570
00571 {
00572     //Call IConsole::UpdateAllViews to redraw all views
00573     //owned by the parent scope item
00574
00575     IDataObject *dummy = NULL;
00576
00577     HRESULT hr;
00578
00579     hr = pConsole->UpdateAllViews(dummy, m_pParent->GetParentScopeItem(), UPDATE_SCOPEITEM);
00580     _ASSERT( S_OK == hr);
00581
00582     return hr;
00583 }
00584
00585 HRESULT CRocket::OnDelete(IConsole *pConsoleComp)
00586 {
00587     HRESULT hr;
00588
00589     //Delete the item
00590     IResultData *pResultData = NULL;
00591
00592     hr = pConsoleComp->QueryInterface(IID_IResultData, (void **)&pResultData);
00593     _ASSERT( SUCCEEDED(hr) );
00594
00595     HRESULTITEM myhresultitem;
00596
00597     //lparam == this. See CSpaceVehicle::OnShow
00598     hr = pResultData->FindItemByLParam( (LPARAM)this, &myhresultitem );
00599     if ( FAILED(hr) )
00600     {
00601         // Failed : Reason may be that current view does not have this item.
00602         // So exit gracefully.
00603         hr = S_FALSE;
00604     } else
00605
00606     {
00607         hr = pResultData->DeleteItem( myhresultitem, 0 );
00608         _ASSERT( SUCCEEDED(hr) );
00609     }
00610
00611     pResultData->Release();
00612
00613     //Now set isDeleted member so that the parent doesn't try to
00614     //to insert it again in CSpaceVehicle::OnShow. Admittedly, a hack...
00615     isDeleted = TRUE;
00616
00617     return hr;
00618 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/backgrnd.h Source File

  • SysMgmt
  • MMC
  • Multisel

backgrnd.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BACKGROUND_H
00021 #define _BACKGROUND_H
00022
00023 #include "DeleBase.h"
00024
00025 class CBackground : public CDelegationBase {
00026 public:
00027     CBackground(int id) : m_itemId(NULL), m_id(id) { }
00028     virtual ~CBackground() {}
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_BACKGROUND; }
00033
00034 private:
00035     enum { IDM_NEW_BACKGROUND = 6 };
00036
00037     static const GUID thisGuid;
00038     int m_id;
00039     HSCOPEITEM m_itemId;
00040 };
00041
00042 class CBackgroundFolder : public CDelegationBase {
00043 public:
00044     CBackgroundFolder();
00045     virtual ~CBackgroundFolder();
00046
00047     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Background Objects"); }
00048     virtual const GUID & getNodeType() { return thisGuid; }
00049     virtual const int GetBitmapIndex() { return INDEX_BACKGROUND; }
00050
00051 public:
00052     // virtual functions go here (for MMCN_*)
00053     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00054     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00055     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00056     virtual HRESULT OnRefresh();
00057
00058 private:
00059     enum { MAX_CHILDREN = 30 };
00060
00061     CBackground *m_children[MAX_CHILDREN];
00062
00063     HWND m_backgroundHwnd;
00064
00065     static const GUID thisGuid;
00066
00067     static LRESULT CALLBACK WindowProc(
00068           HWND hwnd,      // handle to window
00069           UINT uMsg,      // message identifier
00070           WPARAM wParam,  // first message parameter
00071           LPARAM lParam   // second message parameter
00072         );
00073
00074     static DWORD WINAPI ThreadProc(
00075       LPVOID lpParameter   // thread data
00076     );
00077
00078     DWORD m_threadId;
00079     HANDLE m_thread;
00080     bool m_running;
00081
00082     IConsoleNameSpace *m_pConsoleNameSpace;
00083     HSCOPEITEM m_scopeitem;
00084     void AddItem(int id);
00085
00086     CRITICAL_SECTION m_critSect;
00087
00088     void StopThread();
00089     void StartThread();
00090
00091     bool m_bSelected;
00092     bool m_bViewUpdated;
00093 };
00094
00095
00096 #endif // _BACKGROUND_H
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/llistimpl.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

llistimpl.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //  This is a part of the MMC SDK.
00003 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  MMC SDK Reference and related
00008 //  electronic documentation provided with the library.
00009 //  See these sources for detailed information regarding the
00010 //  MMC Library product.
00011 //
00012 //  LListImple.cpp: implementation of CLListImpl helper functions
00013 //
00014
00015
00016 #include "LListImpl.h"
00017
00018
00019 //---------------------------------------------------------------------------
00020 CPlex* PASCAL CPlex::Create(CPlex*& pHead, UINT nMax, UINT cbElement)
00021 {
00022   _ASSERT( nMax > 0 && cbElement > 0 );
00023   CPlex* p = (CPlex*) new BYTE[sizeof(CPlex) + nMax * cbElement];
00024       // may throw exception
00025   p->pNext = pHead;
00026   pHead = p;  // change head (adds in reverse order for simplicity)
00027   return p;
00028
00029 } //end Create()
00030
00031 //---------------------------------------------------------------------------
00032 // Free this one and links
00033 //
00034 void CPlex::FreeDataChain()
00035 {
00036   CPlex* p = this;
00037   while (p != NULL)
00038   {
00039     BYTE* bytes = (BYTE*) p;
00040     CPlex* pNext = p->pNext;
00041     delete[] bytes;
00042     p = pNext;
00043   }
00044 } //end FreeDataChain()
00045
00046 //---------------------------------------------------------------------------
00047 // IsValidAddress() returns TRUE if the passed parameter points
00048 // to at least nBytes of accessible memory. If bReadWrite is TRUE,
00049 // the memory must be writeable; if bReadWrite is FALSE, the memory
00050 // may be const.
00051 //
00052 BOOL IsValidAddress
00053 (
00054   const void*  lp,
00055   UINT         nBytes,
00056   BOOL         bReadWrite /* TRUE */
00057 )
00058 {
00059   // Simple version using Win-32 APIs for pointer validation.
00060   return (lp != NULL && !IsBadReadPtr(lp, nBytes) &&
00061          (!bReadWrite || !IsBadWritePtr((LPVOID)lp, nBytes)));
00062
00063 } //end IsValidAddress()
00064
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCrmFilesTest Member List

This is the complete list of members for CCrmFilesTest, including all inherited members.
Abort() | CCrmFilesTest |
Activate() | CCrmFilesTest |
CCrmFilesTest() | CCrmFilesTest | [inline]
Commit() | CCrmFilesTest |
CreateFile() | CCrmFilesTest |
crm_Total enum value | CCrmFilesTest | [private]
crm_VB enum value | CCrmFilesTest | [private]
crm_VC enum value | CCrmFilesTest | [private]
crm_VJ enum value | CCrmFilesTest | [private]
DeleteFile() | CCrmFilesTest |
GetCorrectCRM(void) | CCrmFilesTest | [private]
m_bstrFileName | CCrmFilesTest | [private]
m_lLanguage | CCrmFilesTest | [private]
m_pICrmFilesWorker | CCrmFilesTest | [private]
m_pICrmFilesWorkerCurrent | CCrmFilesTest | [private]
m_spObjectContext | CCrmFilesTest |
put_FileName(BSTR newVal) | CCrmFilesTest |
put_Language(long newVal) | CCrmFilesTest |
STDMETHOD_(BOOL, CanBePooled)() | CCrmFilesTest |
STDMETHOD_(void, Deactivate)() | CCrmFilesTest |
Generated on Wed Nov 13 2024 16:55:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/account.Idl Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

account.Idl

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: Account.idl
00003 //
00004 // Description: IDL source for Account.dll
00005 // This file will be processed by the MIDL tool to
00006 // produce the type library (Account.tlb) and marshalling code
00007 //
00008 // This file is part of the Microsoft COM+ Samples
00009 //
00010 // Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved
00011 //
00012 // This source code is intended only as a supplement to Microsoft
00013 // Development Tools and/or on-line documentation.  See these other
00014 // materials for detailed information reagrding Microsoft code samples.
00015 //
00016 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 // PARTICULAR PURPOSE.
00020 //
00021 //==============================================================================
00022
00023
00024 #include <mtxattr.h>
00025
00026   [
00027     object,
00028     uuid(04CF0B72-1989-11D0-B917-0080C7394688),
00029     dual,
00030     helpstring("IAccount Interface"),
00031     pointer_default(unique)
00032
00033   ]
00034   interface IAccount : IDispatch
00035   {
00036     import "oaidl.idl";
00037     import "ocidl.idl";
00038     HRESULT Post(
00039       [in] long lAccount,
00040       [in] long lAmount,
00041       [out,retval] BSTR* pbstrResult);
00042   };
00043
00044   [
00045     object,
00046     uuid(04CF0B77-1989-11D0-B917-0080C7394688),
00047     dual,
00048     helpstring("IMoveMoney Interface"),
00049     pointer_default(unique)
00050
00051   ]
00052   interface IMoveMoney : IDispatch
00053   {
00054     import "oaidl.idl";
00055     HRESULT Perform(
00056       [in] long lPrimeAccount,
00057       [in] long lSecondAccount,
00058       [in] long lAmount,
00059       [in] long lTranType,
00060       [out, retval] BSTR* pbstrResult);
00061   };
00062
00063
00064   [
00065     object,
00066     uuid(A81260B1-DDC8-11D0-B5A0-00C04FB957D8),
00067     dual,
00068     helpstring("IGetReceipt Interface"),
00069     pointer_default(unique)
00070
00071   ]
00072   interface IGetReceipt : IDispatch
00073   {
00074     import "oaidl.idl";
00075     HRESULT GetNextReceipt (
00076       [out,retval] long* plReceiptNo);
00077   };
00078
00079   [
00080     object,
00081     uuid(A81260B7-DDC8-11D0-B5A0-00C04FB957D8),
00082     dual,
00083     helpstring("IUpdateReceipt Interface"),
00084     pointer_default(unique)
00085
00086   ]
00087   interface IUpdateReceipt : IDispatch
00088   {
00089     import "oaidl.idl";
00090     HRESULT Update (
00091       [out,retval] long* plReceiptNo);
00092   };
00093
00094
00095
00096
00097
00098
00099
00100
00101 [
00102   uuid(04CF0B70-1989-11D0-B917-0080C7394688),
00103   version(1.0),
00104   helpstring("Sample Bank Account (VC version)")
00105 ]
00106 library ACCOUNT
00107 {
00108   importlib("stdole2.tlb");
00109
00110   [
00111     uuid(04CF0B76-1989-11D0-B917-0080C7394688),
00112     helpstring("Account Class"),
00113     TRANSACTION_REQUIRED
00114   ]
00115   coclass CAccount
00116   {
00117     [default] interface IAccount;
00118   };
00119
00120   [
00121     uuid(04CF0B7B-1989-11D0-B917-0080C7394688),
00122     helpstring("MoveMoney Class"),
00123     TRANSACTION_REQUIRED
00124   ]
00125   coclass CMoveMoney
00126   {
00127     [default] interface IMoveMoney;
00128   };
00129
00130   [
00131     uuid(A81260B2-DDC8-11D0-B5A0-00C04FB957D8),
00132     helpstring("GetReceipt Class"),
00133     TRANSACTION_SUPPORTED
00134   ]
00135   coclass CGetReceipt
00136   {
00137     [default] interface IGetReceipt;
00138   };
00139
00140
00141   [
00142     uuid(A81260B8-DDC8-11D0-B5A0-00C04FB957D8),
00143     helpstring("UpdateReceipt Class"),
00144     TRANSACTION_REQUIRES_NEW
00145   ]
00146   coclass CUpdateReceipt
00147   {
00148     [default] interface IUpdateReceipt;
00149   };
00150
00151 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkBlog/C#/Default.aspx.cs Source File

  • TabletPC
  • InkBlog
  • C#

Default.aspx.cs

Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 //
00003 //  This is part of the Microsoft Tablet PC Platform SDK
00004 //  Copyright (C) 2004 Microsoft Corporation
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00009 //  documentation provided with the Software Development Kit.
00010 //  See these sources for more detailed information.
00011 //
00012 //  File: Default.aspx.cs
00013 //  ASP.NET code behind page that displays a list of all blog entries
00014 //  collected on the server.
00015 //
00016 //--------------------------------------------------------------------------
00017
00018
00019 using System;
00020 using System.IO;
00021 using System.Web.UI;
00022
00023 namespace InkBlog
00024 {
00025     /// <summary>
00026     /// The Default code-behind page.
00027     /// </summary>
00028     public class _Default : Page
00029     {
00030
00031         /// <summary>
00032         /// Handles the Load event for this Page.
00033         ///
00034         /// Displays a web page with a list of all blog entries collected on the
00035         /// server.  It also contains a button that allows the user to add
00036         /// more blog entries using AddBlog.aspx.
00037         /// </summary>
00038         /// <param name="sender">The object that raised the event.</param>
00039         /// <param name="e">The event arguments.</param>
00040         private void Page_Load(object sender, System.EventArgs e)
00041         {
00042
00043             // Display a button that allows the user to add more blog entries
00044             Response.Write("<hr><a href=\"AddBlog.aspx\">Add Blog</a><br><hr>");
00045
00046             string path = Server.MapPath("Blogs");
00047             DirectoryInfo dirInfo = new DirectoryInfo(path);
00048
00049             // Output the content of each page in the server's blog directory.
00050             if (dirInfo.Exists)
00051             {
00052                 foreach (FileInfo file in dirInfo.GetFiles("*.htm"))
00053                 {
00054                     using (StreamReader sr = file.OpenText())
00055                     {
00056                         Response.Write(sr.ReadToEnd());
00057                     }
00058                 }
00059             }
00060         }
00061
00062         #region Web Form Designer generated code
00063         override protected void OnInit(EventArgs e)
00064         {
00065             //
00066             // CODEGEN: This call is required by the ASP.NET Web Form Designer.
00067             //
00068             InitializeComponent();
00069             base.OnInit(e);
00070         }
00071
00072         /// <summary>
00073         /// Required method for Designer support - do not modify
00074         /// the contents of this method with the code editor.
00075         /// </summary>
00076         private void InitializeComponent()
00077         {
00078             this.Load += new System.EventHandler(this.Page_Load);
00079
00080         }
00081         #endregion
00082
00083     }
00084 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PropertiesVtbl Member List

This is the complete list of members for PropertiesVtbl, including all inherited members.
c | PropertiesVtbl
cNames | PropertiesVtbl
dispIdMember | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ADOProperties __RPC_FAR *This | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ADOProperties __RPC_FAR *This | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ADOProperties __RPC_FAR *This | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ADOProperties __RPC_FAR *This | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ADOProperties __RPC_FAR *This | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Count)(ADOProperties __RPC_FAR *This | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *_NewEnum)(ADOProperties __RPC_FAR *This | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Refresh)(ADOProperties __RPC_FAR *This) | PropertiesVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Item)(ADOProperties __RPC_FAR *This | PropertiesVtbl
Index | PropertiesVtbl
iTInfo | PropertiesVtbl
lcid | PropertiesVtbl
lcid | PropertiesVtbl
lcid | PropertiesVtbl
pctinfo | PropertiesVtbl
pDispParams | PropertiesVtbl
pExcepInfo | PropertiesVtbl
ppTInfo | PropertiesVtbl
ppvObject | PropertiesVtbl
ppvObject | PropertiesVtbl
ppvObject | PropertiesVtbl
puArgErr | PropertiesVtbl
pVarResult | PropertiesVtbl
rgDispId | PropertiesVtbl
rgszNames | PropertiesVtbl
riid | PropertiesVtbl
riid | PropertiesVtbl
riid | PropertiesVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ADOProperties __RPC_FAR *This) | PropertiesVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ADOProperties __RPC_FAR *This) | PropertiesVtbl
wFlags | PropertiesVtbl
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030         static TCHAR error[64];
00031
00032         switch (verb) {
00033     case MMC_VERB_NONE:
00034                 return _T("NONE");
00035     case MMC_VERB_OPEN:
00036                 return _T("OPEN");
00037     case MMC_VERB_COPY:
00038                 return _T("COPY");
00039     case MMC_VERB_PASTE:
00040                 return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042                 return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044                 return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046                 return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048                 return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050                 return _T("PRINT");
00051     case MMC_VERB_CUT:
00052                 return _T("CUT");
00053         default:
00054                 wsprintf(error, _T("Unknown verb id %d"), verb);
00055                 return error;
00056         }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061                                 IComponentData *pCompData,
00062                                 IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064                                 LPARAM arg,
00065                                 LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069         TCHAR message[cchMessage] = {0};
00070
00071         if (bComponentData == TRUE)
00072                 OutputDebugString(_T("IComponentData::Notify( "));
00073         else
00074                 OutputDebugString(_T("IComponent::Notify( "));
00075
00076         wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077         OutputDebugString(message);
00078
00079     switch (event)      {
00080                 case MMCN_ACTIVATE:
00081                         wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082                         break;
00083
00084                 case MMCN_ADD_IMAGES:
00085                         wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086                         break;
00087
00088                 case MMCN_BTN_CLICK:
00089                         wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090                         break;
00091
00092                 case MMCN_COLUMN_CLICK:
00093                         wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,       param);
00094                         break;
00095
00096                 case MMCN_COLUMNS_CHANGED:
00097                         wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098                         break;
00099
00100                 case MMCN_CONTEXTHELP:
00101                         wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102                         break;
00103
00104                 case MMCN_CONTEXTMENU:
00105                         wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106                         break;
00107
00108                 case MMCN_CUTORMOVE:
00109                         wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110                         break;
00111
00112                 case MMCN_DBLCLICK:
00113                         wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114                         break;
00115
00116                 case MMCN_DELETE:
00117                         wsprintf(message, _T("MMCN_DELETE\n"));
00118                         break;
00119
00120                 case MMCN_DESELECT_ALL:
00121                         wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122                         break;
00123
00124                 case MMCN_EXPAND:
00125                         wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126                         break;
00127
00128                 case MMCN_EXPANDSYNC:
00129                         wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130                         break;
00131
00132                 case MMCN_FILTERBTN_CLICK:
00133                         wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134                         break;
00135
00136                 case MMCN_FILTER_CHANGE:
00137                         wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138                         break;
00139
00140                 case MMCN_HELP:
00141                         wsprintf(message, _T("MMCN_HELP\n"));
00142                         break;
00143
00144                 case MMCN_INITOCX:
00145                         wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146                         break;
00147
00148                 case MMCN_LISTPAD:
00149                         wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150                         break;
00151
00152                 case MMCN_MENU_BTNCLICK:
00153                         wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154                         break;
00155
00156                 case MMCN_MINIMIZED:
00157                         wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158                         break;
00159
00160                 case MMCN_PASTE:
00161                         wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162                         break;
00163
00164                 case MMCN_PRELOAD:
00165                         wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166                         break;
00167
00168                 case MMCN_PRINT:
00169                         wsprintf(message, _T("MMCN_PRINT\n"));
00170                         break;
00171
00172                 case MMCN_PROPERTY_CHANGE:
00173                         wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174                         break;
00175
00176                 case MMCN_QUERY_PASTE:
00177                         wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178                         break;
00179
00180                 case MMCN_REFRESH:
00181                         wsprintf(message, _T("MMCN_REFRESH\n"));
00182                         break;
00183
00184                 case MMCN_REMOVE_CHILDREN:
00185                         wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186                         break;
00187
00188                 case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192                         StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193                         break;
00194
00195                 case MMCN_RESTORE_VIEW:
00196                         wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197                         break;
00198
00199                 case MMCN_SELECT:
00200                         wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201                         break;
00202
00203                 case MMCN_SHOW:
00204                         wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205                         break;
00206
00207                 case MMCN_SNAPINHELP:
00208                         wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209                         break;
00210
00211                 case MMCN_VIEW_CHANGE:
00212                         wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213                         break;
00214         }
00215
00216         if (message[0] != 0)
00217                 OutputDebugString(message);
00218         else
00219                 OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222         return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPChange/IPChange.Cpp Source File

  • NetDS
  • IPHelp
  • IPChange

IPChange.Cpp

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1996 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \******************************************************************************/
00010
00011 /*
00012 Module Name:
00013
00014     ipchange.cpp
00015
00016 Abstract:
00017
00018     This module illustrates how to programmatically change an IP address for
00019     a specific network adapter on your machine.  This program also demonstrates how
00020     to retrieve existing network adapter IP configuration information.
00021
00022     IP configurations can be changed for a specific network adapter by using the
00023     AddIpAddress() and DeleteIpAddress() Ip Helper APIs.  These APIs require you to
00024     understand adapter index numbers and IP context numbers.  In Windows, every network
00025     adapter has a unique index ID and every IP address has a unique context ID.
00026     Adapter index IDs and IP context numbers can be retrieved using the GetAdaptersInfo()
00027     IP Helper API.  This program features a list option that displays current network
00028     adapter configuration information by showing all adapters index numbers and IP
00029     address context numbers associated with their corresponding network adaptors.
00030
00031     To execute this application, simply build the application using the Visual C++
00032     Nmake.exe program generation facility.  A ipchange.exe program should result.
00033     Execute the ipchange.exe with the following parameters:
00034
00035     Ipchange.exe [ -l ] [ -a -n<index id> -i<ip address> -m<subnet mask> ]
00036                  [ -d -c<context id>]
00037
00038         -l List adapter index IDs and IP Address context ID information
00039         -a Add IP Address option
00040     -d Delete IP Address option
00041     -i IP Address to specify with -a option
00042     -m Subnet Mask to specify with -a option
00043     -c IP context ID for an existing IP address
00044     -n Index ID of an existing network adapter
00045
00046 Author:
00047
00048     Jim Ohlund 21-Apr-98
00049
00050 Revision History:
00051
00052 */
00053
00054 #include <windows.h>
00055 #include <stdio.h>
00056 #include <iphlpapi.h>
00057
00058 void Usage(void) {
00059     printf("Usage: Ipchange [ -l ] [ -a -n<index id> -i<ip address> -m<subnet mask> ] "
00060         "[ -d -c<context id>]\n\n"
00061         "\t -l List adapter index IDs and IP Address context ID information\n"
00062         "\t -a Add IP Address option\n"
00063         "\t -d Delete IP Address option\n"
00064         "\t -i IP Address to specify with -a option\n"
00065         "\t -m Subnet Mask to specify with -a option\n"
00066         "\t -c IP context ID for an existing IP address\n"
00067         "\t -n Index ID of an existing network adapter\n");
00068 }
00069
00070 void main(int argc, char *argv[]) {
00071     ULONG NTEContext = 0;
00072     ULONG NTEInstance;
00073     IPAddr NewIP;
00074     IPAddr NewMask;
00075     DWORD Index;
00076     DWORD Context;
00077     CHAR NewIPStr[64];
00078     CHAR NewMaskStr[64];
00079
00080     PIP_ADAPTER_INFO pAdapterInfo, pAdapt;
00081     PIP_ADDR_STRING pAddrStr;
00082     DWORD AdapterInfoSize;
00083     DWORD Err;
00084     BOOL OptList = FALSE;
00085     BOOL OptAdd = FALSE;
00086     BOOL OptDel = FALSE;
00087
00088     NewIPStr[0] = '\0';
00089     NewMaskStr[0] = '\0';
00090     Context = Index = (DWORD)-1;
00091     for (int i = 1; i < argc; i++)
00092     {
00093         if ((argv[i][0] == '-') || (argv[i][0] == '/'))
00094         {
00095             switch(tolower(argv[i][1]))
00096             {
00097                 case 'l':
00098                     OptList = TRUE;
00099                     break;
00100                 case 'a':
00101                     OptAdd = TRUE;
00102                     break;
00103                 case 'c':
00104                     if (strlen(argv[i]) > 2)
00105                         Context = atoi(&argv[i][2]);
00106                     break;
00107                 case 'd':
00108                     OptDel = TRUE;
00109                     break;
00110                 case 'i':
00111                     if (strlen(argv[i]) > 2)
00112                         strcpy(NewIPStr, &argv[i][2]);
00113                     break;
00114                 case 'm':
00115                     if (strlen(argv[i]) > 2)
00116                         strcpy(NewMaskStr, &argv[i][2]);
00117                     break;
00118                 case 'n':
00119                     if (strlen(argv[i]) > 2)
00120                         Index = atoi(&argv[i][2]);
00121                     break;
00122                 default:
00123                     printf("default\n");
00124                     Usage();
00125                     return;
00126                 }
00127         }
00128         else
00129         {
00130             printf("else\n");
00131             Usage();
00132             return;
00133         }
00134     }
00135
00136     // Check options
00137     if ((OptAdd && (Index == -1 || NewIPStr[0] == '\0' || NewMaskStr[0] == '\0'))
00138         || (OptDel && Context == -1))
00139     {
00140         Usage();
00141         return;
00142     }
00143
00144     // Get sizing information about all adapters
00145     AdapterInfoSize = 0;
00146     if ((Err = GetAdaptersInfo(NULL, &AdapterInfoSize)) != 0)
00147     {
00148         if (Err != ERROR_BUFFER_OVERFLOW)
00149         {
00150             printf("GetAdaptersInfo sizing failed with error %d\n", Err);
00151             return;
00152         }
00153     }
00154
00155     // Allocate memory from sizing information
00156     if ((pAdapterInfo = (PIP_ADAPTER_INFO) GlobalAlloc(GPTR, AdapterInfoSize)) == NULL)
00157     {
00158         printf("Memory allocation error\n");
00159         return;
00160     }
00161
00162     // Get actual adapter information
00163     if ((Err = GetAdaptersInfo(pAdapterInfo, &AdapterInfoSize)) != 0)
00164     {
00165         printf("GetAdaptersInfo failed with error %d\n", Err);
00166         return;
00167     }
00168
00169     if (OptList)
00170     {
00171         printf("MAC Address - Adapter\n"
00172             "Index     Context   Ip Address          Subnet Mask\n"
00173             "--------------------------------------------------------------\n");
00174
00175         pAdapt = pAdapterInfo;
00176
00177         while (pAdapt)
00178         {
00179             for (UINT i=0; i<pAdapt->AddressLength; i++)
00180             {
00181                 if (i == (pAdapt->AddressLength - 1))
00182                     printf("%.2X - ",(int)pAdapt->Address[i]);
00183                 else
00184                     printf("%.2X-",(int)pAdapt->Address[i]);
00185             }
00186             printf("%s\n", pAdapt->Description);
00187
00188             pAddrStr = &(pAdapt->IpAddressList);
00189             while(pAddrStr)
00190             {
00191                 printf("%-10.d%-10.d%-20.20s%s\n", pAdapt->Index, pAddrStr->Context, pAddrStr->IpAddress.String, pAddrStr->IpMask.String);
00192                 pAddrStr = pAddrStr->Next;
00193             }
00194
00195             pAdapt = pAdapt->Next;
00196         }
00197     }
00198
00199     if (OptAdd)
00200     {
00201         NewIP = inet_addr(NewIPStr);
00202         NewMask = inet_addr(NewMaskStr);
00203         if ((Err = AddIPAddress(NewIP, NewMask, Index, &NTEContext, &NTEInstance)) != 0)
00204         {
00205             printf("AddIPAddress failed with error %d, %d\n", NTEContext, Err);
00206             return;
00207         }
00208     }
00209
00210     if (OptDel)
00211     {
00212         if ((Err = DeleteIPAddress(Context)) != 0)
00213             printf("DeleteIPAddress failed %d\n", Err);
00214     }
00215 }
00216
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_MSD Member List

This is the complete list of members for _MSD, including all inherited members.
pfnmsg | _MSD
uMessage | _MSD
uMsg | _MSD
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Behavior.cpp Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Behavior.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Behavior.cpp : Implementation of CBehavior
00006 #include "stdafx.h"
00007 #include "Render.h"
00008 #include "EventSink.h"
00009 #include "Behavior.h"
00010 #include "math.h"
00011
00012 ///////////////////////////////////////////////
00013 // IElementBehavior implementation
00014 //
00015 STDMETHODIMP
00016 CBehavior::Detach(void)
00017 {
00018   // Release cached EventSink and PaintSite pointers
00019   // (Note: Other cached pointers are smart pointers and
00020   // automatically release themselves)
00021   m_pEventSink->Release();
00022   m_pPaintSite->Release();
00023
00024   return S_OK;
00025 }
00026
00027 STDMETHODIMP
00028 CBehavior::Init(IElementBehaviorSite* pBehaviorSite)
00029 {
00030   HRESULT hr;
00031
00032   // Cache the IElementBehaviorSite interface pointer.
00033   m_spSite = pBehaviorSite;
00034
00035   // Cache the IElementBehaviorSiteOM interface pointer.
00036   hr = m_spSite->QueryInterface(
00037               IID_IElementBehaviorSiteOM,
00038               (void**)&m_spOMSite);
00039
00040   // Cache the IHTMLPaintSite interface pointer.
00041   hr = m_spSite->QueryInterface(
00042               IID_IHTMLPaintSite,
00043               (void**)&m_pPaintSite);
00044
00045   return hr;
00046 }
00047
00048 STDMETHODIMP
00049 CBehavior::Notify(LONG lEvent, VARIANT* pVar)
00050 {
00051   HRESULT hr = S_OK;
00052
00053   switch (lEvent)
00054   {
00055     // The HTML document has been parsed. The DOM is available
00056     case BEHAVIOREVENT_DOCUMENTREADY:
00057       if (!m_spSite) break;
00058
00059       // Cache the IHTMLElement interface pointer for this element
00060       // and its parent
00061       hr = m_spSite->GetElement(&m_spElem);
00062       hr = m_spElem->get_offsetParent(&m_spParent);
00063
00064       // Cache the IHTMLDocument2 interface pointer
00065       IDispatch* pDisp;
00066       hr = m_spElem->get_document(&pDisp);
00067       hr = pDisp->QueryInterface(IID_IHTMLDocument2, (void**)&m_spDoc);
00068       pDisp->Release();
00069
00070       // Cache the IHTMLWindow2 interface pointer
00071       hr = m_spDoc->get_parentWindow(&m_spWin);
00072
00073       // Cache the IHTMLSelectionObject interface pointer
00074       hr = m_spDoc->get_selection(&m_spSel);
00075
00076       // Change mouse cursor to arrow only for this element
00077       IHTMLStyle* pStyle;
00078       hr = m_spElem->get_style(&pStyle);
00079       hr = pStyle->put_cursor(L"default");
00080       pStyle->Release();
00081
00082       long lHeight, lWidth;
00083
00084       m_spElem->get_offsetHeight(&lHeight);
00085       m_spElem->get_offsetWidth(&lWidth);
00086
00087       // Cache the initial coordinates of the element's
00088       // corner points
00089       m_rtElemCorners.top = 0;
00090       m_rtElemCorners.bottom = lHeight;
00091       m_rtElemCorners.left = 0;
00092       m_rtElemCorners.right = lWidth;
00093
00094       // Set the initial coordinates of the polygon to
00095       // the element's corner points
00096       m_ptPolyCorners[0].x = 0;
00097       m_ptPolyCorners[0].y = 0;
00098       m_ptPolyCorners[1].x = lWidth;
00099       m_ptPolyCorners[1].y = 0;
00100       m_ptPolyCorners[2].x = lWidth;
00101       m_ptPolyCorners[2].y = lHeight;
00102       m_ptPolyCorners[3].x = 0;
00103       m_ptPolyCorners[3].y = lHeight;
00104
00105
00106       // Create and connect the event sink.
00107       hr = CComObject<CEventSink>::CreateInstance(&m_pEventSink);
00108       if (SUCCEEDED(hr))
00109       {
00110         m_pEventSink->AddRef();
00111         m_pEventSink->m_pBehavior = this;
00112
00113         hr = AtlAdvise(m_spElem, (IDispatch*)m_pEventSink,
00114                   DIID_HTMLElementEvents,
00115                   &m_dwCookie);
00116       }
00117
00118
00119       break;
00120
00121     default:
00122       break;
00123   }
00124
00125   return S_OK;
00126 }
00127
00128 ///////////////////////////////////////////
00129 // IHTMLPainter Method Implementation
00130 //
00131 HRESULT CBehavior::Draw(RECT rcBounds, RECT rcUpdate, LONG lDrawFlags, HDC hdc, LPVOID pvDrawObject)
00132 {
00133   if (!m_pEventSink) return S_OK;
00134   HBRUSH blackBrush     = (HBRUSH)GetStockObject(BLACK_BRUSH);
00135   HBRUSH coloredBrush   = CreateSolidBrush(RGB(0x99,0x66,0x99));
00136   HBRUSH highlightBrush = CreateSolidBrush(RGB(0xff, 0xff, 0x00));
00137   HPEN   blackPen       = (HPEN)GetStockObject(BLACK_PEN);
00138
00139   HPEN   oldPen         = (HPEN)SelectObject(hdc,blackPen);
00140   HBRUSH oldBrush       = (HBRUSH)SelectObject(hdc,coloredBrush);
00141
00142   POINT ptGlobalCorners[4];
00143
00144   for (int i = 0; i < 4; i++)
00145   {
00146     ptGlobalCorners[i].x = m_ptPolyCorners[i].x + rcBounds.left + HANDLE_RADIUS;
00147     ptGlobalCorners[i].y = m_ptPolyCorners[i].y + rcBounds.top + HANDLE_RADIUS;
00148   }
00149
00150   Polygon(hdc, ptGlobalCorners, 4);
00151
00152   for (i = 0; i < 4; i++)
00153   {
00154     if (m_pEventSink->mouseDown && m_lPartID == i)
00155       SelectObject(hdc, highlightBrush);
00156     else
00157       SelectObject(hdc, blackBrush);
00158
00159     Ellipse(hdc,
00160         ptGlobalCorners[i].x - HANDLE_RADIUS,
00161         ptGlobalCorners[i].y - HANDLE_RADIUS,
00162         ptGlobalCorners[i].x + HANDLE_RADIUS,
00163         ptGlobalCorners[i].y + HANDLE_RADIUS);
00164   }
00165
00166   SelectObject(hdc, oldPen);
00167   SelectObject(hdc, oldBrush);
00168
00169   DeleteObject(coloredBrush);
00170   DeleteObject(highlightBrush);
00171
00172   return S_OK;
00173 }
00174
00175 HRESULT CBehavior::GetPainterInfo(HTML_PAINTER_INFO *pInfo)
00176 {
00177   pInfo->lFlags = HTMLPAINTER_OPAQUE | HTMLPAINTER_HITTEST;
00178   pInfo->lZOrder = HTMLPAINT_ZORDER_ABOVE_CONTENT;
00179
00180   memset(&pInfo->iidDrawObject, 0, sizeof(IID));
00181
00182   pInfo->rcExpand.left = HANDLE_RADIUS;
00183   pInfo->rcExpand.right = HANDLE_RADIUS;
00184   pInfo->rcExpand.top = HANDLE_RADIUS;
00185   pInfo->rcExpand.bottom = HANDLE_RADIUS;
00186
00187   return S_OK;
00188 }
00189
00190 HRESULT CBehavior::HitTestPoint(POINT pt, BOOL *pbHit, LONG *plPartID)
00191 {
00192   if (!m_pEventSink) return S_OK;
00193   if (m_pEventSink->mouseDown) return S_OK;
00194
00195   *pbHit = FALSE;
00196   *plPartID = NULL;
00197   m_lPartID = -1;
00198
00199   // Convert point coordinates, which are given with respect to the element's
00200   // expanded region, to reflect the element without its expanded region
00201   pt.x = pt.x - HANDLE_RADIUS;
00202   pt.y = pt.y - HANDLE_RADIUS;
00203
00204   for (int i = 0; i < 4; i++)
00205   {
00206     if (Distance(pt, m_ptPolyCorners[i]) <= HANDLE_RADIUS)
00207     {
00208       // Setting pbHit to TRUE will trigger an event that can be handled
00209       // by IEventSink::Invoke
00210       *pbHit = TRUE;
00211       *plPartID = i;
00212       m_lPartID = i;
00213     }
00214   }
00215
00216   return S_OK;
00217 }
00218
00219 HRESULT CBehavior::OnResize(SIZE pt)
00220 {
00221   if (!m_spElem) return E_FAIL;
00222
00223   long lHeight, lWidth, lOldElemHeight, lOldElemWidth;
00224   float ratioX, ratioY;
00225
00226   lOldElemHeight = m_rtElemCorners.bottom;
00227   lOldElemWidth = m_rtElemCorners.right;
00228
00229   m_spElem->get_offsetHeight(&lHeight);
00230   m_spElem->get_offsetWidth(&lWidth);
00231
00232   m_rtElemCorners.top = 0;
00233   m_rtElemCorners.bottom = lHeight;
00234   m_rtElemCorners.left = 0;
00235   m_rtElemCorners.right = lWidth;
00236
00237   ratioX = (float)lWidth/(float)lOldElemWidth;
00238   ratioY = (float)lHeight/(float)lOldElemHeight;
00239
00240   for (int i = 0; i < 4; i++)
00241   {
00242     m_ptPolyCorners[i].x = (long)(ratioX * m_ptPolyCorners[i].x);
00243     m_ptPolyCorners[i].y = (long)(ratioY * m_ptPolyCorners[i].y);
00244   }
00245
00246   return S_OK;
00247 }
00248
00249 /////////////////////////////////////////////
00250 // Helper functions
00251 //
00252 // Calculates the distance between two points
00253 double
00254 CBehavior::Distance(POINT pt1, POINT pt2)
00255 {
00256   return _hypot((pt1.x - pt2.x), (pt1.y - pt2.y));
00257 }
00258
00259 // Retrieves the window's IHTMLEventObj interface
00260 HRESULT
00261 CBehavior::GetEventObject(IHTMLEventObj** ppEvent)
00262 {
00263   HRESULT       hr;
00264
00265   hr = m_spWin->get_event(ppEvent);
00266   if (*ppEvent == NULL) hr =  E_FAIL;
00267
00268   return hr;
00269 }
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CComboBoxGuid Member List

This is the complete list of members for CComboBoxGuid, including all inherited members.
AddString(WCHAR *pwszString) | CComboBoxLite | [inline, virtual]
AddString(WCHAR *pwszString, LPARAM lParam) | CComboBoxLite | [virtual]
CComboBoxGuid() | CComboBoxGuid |
CComboBoxLite(HWND hWndParent=NULL, UINT nID=0) | CComboBoxLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DeleteString(INDEX nIndex) | CComboBoxLite | [inline, virtual]
DestroyWindow() | CWndLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
FindString(WCHAR *pwszString, INDEX nStartIndex=-1) | CComboBoxLite | [inline, virtual]
FindStringExact(WCHAR *pwszString, INDEX nStartIndex=-1) | CComboBoxLite | [inline, virtual]
GetCount() | CComboBoxLite | [inline, virtual]
GetCurSel() const | CComboBoxLite | [inline, virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetGuid() | CComboBoxGuid | [virtual]
GetItemParam(INDEX nIndex) const | CComboBoxLite | [inline, virtual]
GetSelText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CComboBoxLite | [virtual]
GetSelValue() | CComboBoxLite | [virtual]
GetText(INDEX nIndex, WCHAR *pwszBuffer) | CComboBoxLite | [inline, virtual]
GetTextLength(INDEX nIndex) | CComboBoxLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_cGuidMaps | CComboBoxGuid |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iSavedSel | CComboBoxLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_rgGuidMaps | CComboBoxGuid |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropDown(INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSelChange(INT iID, HWND hWndCtrl) | CComboBoxLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
Populate(ULONG cGuidMaps, const WIDEGUIDMAP *rgGuidMaps) | CComboBoxGuid | [virtual]
CComboBoxLite::Populate(ULONG cItems, const WIDENAMEMAP *rgItems) | CComboBoxLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
ResetContent() | CComboBoxLite | [inline, virtual]
RestoreSelection() | CComboBoxLite | [inline, virtual]
SaveSelection() | CComboBoxLite | [inline, virtual]
SetCurSel(WPARAM nSelect) | CComboBoxLite | [inline, virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetGuid(REFIID riid) | CComboBoxGuid | [virtual]
SetItemParam(INDEX nIndex, LPARAM lParam) | CComboBoxLite | [inline, virtual]
SetSelText(WCHAR *pwszBuffer, BOOL fAddItem=FALSE) | CComboBoxLite | [virtual]
SetSelValue(LPARAM lParam) | CComboBoxLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CComboBoxGuid() | CComboBoxGuid | [virtual]
~CComboBoxLite() | CComboBoxLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:55:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPUIGeneral Member List

This is the complete list of members for CSCPUIGeneral, including all inherited members.
Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal) | CPropertyPage |
Apply() | CPropertyPage |
CPropertyPage(REFCLSID clsid, INT iDialogID) | CPropertyPage |
CSCPUIGeneral() | CSCPUIGeneral | [inline]
CSCPUIGeneral(HWND hNotifyObj) | CSCPUIGeneral | [inline]
Deactivate() | CPropertyPage |
DEFINE_ADDREF_RELEASE | CPropertyPage |
DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [static]
GetClassID(CLSID __RPC_FAR *pClassID) | CPropertyPage | [inline]
GetPageInfo(PROPPAGEINFO __RPC_FAR *pPageInfo) | CPropertyPage | [inline, virtual]
GetUIData() | CSCPUIGeneral | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [virtual]
Help(LPCOLESTR pszHelpDir) | CPropertyPage | [inline]
Init(PWSTR pszPath, PWSTR pszClass) | CSCPUIGeneral | [virtual]
InitNew(void) | CPropertyPage | [inline]
IsPageDirty() | CPropertyPage |
Load(IPropertyBag __RPC_FAR *pPropBag, IErrorLog __RPC_FAR *pErrorLog) | CPropertyPage | [inline]
m_bDirty | CSCPUIGeneral | [private]
m_clsid | CPropertyPage | [protected]
m_cRef | CPropertyPage | [protected]
m_hNotifyObj | CSCPUIGeneral | [private]
m_hWnd | CPropertyPage | [protected]
m_iDialogID | CPropertyPage | [protected]
m_pIPropertyPageSite | CPropertyPage | [protected]
m_pWritableAttrs | CSCPUIGeneral | [private]
m_spDsObj | CSCPUIGeneral | [private]
m_szBindingInfo | CSCPUIGeneral | [private]
m_szClass | CSCPUIGeneral | [private]
m_szDescription | CSCPUIGeneral | [private]
m_szPath | CSCPUIGeneral | [private]
m_szServiceClassName | CSCPUIGeneral | [private]
m_szServiceDNSName | CSCPUIGeneral | [private]
m_szServiceDNSNameType | CSCPUIGeneral | [private]
Move(LPCRECT pRect) | CPropertyPage |
OnApply() | CSCPUIGeneral | [virtual]
OnDestroy() | CSCPUIGeneral | [virtual]
OnInitDialog() | CSCPUIGeneral | [virtual]
OnPropertyChange() | CSCPUIGeneral |
QueryInterface(REFIID riid, LPVOID *ppv) | CPropertyPage |
Save(IPropertyBag __RPC_FAR *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) | CPropertyPage | [inline]
SetObjects(ULONG cObjects, IUnknown __RPC_FAR *__RPC_FAR *ppUnk) | CPropertyPage | [inline]
SetPageSite(IPropertyPageSite *pPageSite) | CPropertyPage |
SetUIData() | CSCPUIGeneral | [virtual]
Show(UINT nCmdShow) | CPropertyPage |
TranslateAccelerator(MSG *pMsg) | CPropertyPage |
~CPropertyPage() | CPropertyPage | [virtual]
~CSCPUIGeneral() | CSCPUIGeneral | [inline]
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyAudit/StdAfx.Cpp Source File

  • Com
  • Administration
  • Spy
  • ComSpyAudit

StdAfx.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "stdafx.h"
00018
00019 #ifdef _ATL_STATIC_REGISTRY
00020 #include <statreg.h>
00021 #include <statreg.cpp>
00022 #endif
00023
00024 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/Debug.Cpp Source File

  • Web
  • NetMeeting
  • NMShare

Debug.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       DEBUG.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 #ifdef DEBUG /* The whole file! */
00019
00020
00021 //****************************************************************************
00022 //
00023 // VOID FAR PASCAL AssertProc(LPSTR lpszMsg, LPSTR lpszAssert, LPSTR lpszFile, UINT line)
00024 //
00025 //****************************************************************************
00026
00027 VOID FAR PASCAL AssertProc(LPSTR lpszMsg, LPSTR lpszAssert, LPSTR lpszFile, UINT line)
00028 {
00029   int  id;
00030
00031   TCHAR szBuffer[1025];
00032   ZeroMemory(szBuffer,1025 * sizeof(TCHAR));
00033   _sntprintf(szBuffer,1024,TEXT("Assert: %s\nFile %s, Line %d"),
00034     (lpszMsg && *lpszMsg) ? lpszMsg  : lpszAssert,
00035     lpszFile ? lpszFile : "", line);
00036
00037
00038   OutputDebugString(szBuffer);
00039
00040   do {
00041     id = MessageBox(NULL, (LPSTR)szBuffer, TEXT("NmChat Assert"),
00042           MB_ICONHAND | MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL);
00043
00044     switch (id)
00045     {
00046       case IDRETRY:
00047         DebugBreak();
00048         break;
00049       case IDABORT:
00050         FatalAppExit(0, (LPSTR)szBuffer);
00051         break;
00052       case IDIGNORE:
00053       default:
00054         break;
00055     }
00056   } while (id == IDRETRY);
00057 }
00058
00059
00060
00061 #endif /* DEBUG - the whole file! */
00062
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CObjData Member List

This is the complete list of members for CObjData, including all inherited members.
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CObjData | [inline, virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CObjData | [inline, virtual]
CObjData(void) | CObjData | [inline]
CObjData(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
HrInitialize(IUnknown *piDataIn) | CObjData | [protected, virtual]
HrInitialize(IUnknown *piDataIn) | CObjData | [protected, virtual]
InvokeCommand(ULONG nCommandIDIn) | CObjData | [inline, virtual]
InvokeCommand(ULONG nCommandIDIn) | CObjData | [inline, virtual]
m_cot | CObjData | [protected]
m_rgprtcPSPages | CObjData | [protected]
m_rgprtcWizPages | CObjData | [protected]
m_strName | CObjData | [protected]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
StrName(void) | CObjData | [inline, virtual]
StrName(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/space.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

space.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "DataObj.h"
00021 #include "Space.h"
00022 #include "Comp.h"
00023 #define STRSAFE_NO_DEPRECATE
00024 #include <strsafe.h>
00025
00026 const GUID CSpaceFolder::thisGuid = { 0x29743810, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00027 const GUID CSpaceStation::thisGuid = { 0x62273a12, 0x1914, 0x11d3, { 0x9a, 0x38, 0x0, 0x80, 0xc7, 0x25, 0x80, 0x72 } };
00028 const GUID CRocket::thisGuid = { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00029
00030 //==============================================================
00031 //
00032 // CSpaceFolder implementation
00033 //
00034 //
00035 CSpaceFolder::CSpaceFolder()
00036 {
00037     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00038         children[n] = new CSpaceStation();
00039     }
00040 }
00041
00042 CSpaceFolder::~CSpaceFolder()
00043 {
00044     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00045         if (children[n]) {
00046             delete children[n];
00047         }
00048 }
00049
00050 HRESULT CSpaceFolder::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00051 {
00052     SCOPEDATAITEM sdi;
00053
00054     if (!bExpanded) {
00055         // create the child nodes, then expand them
00056         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00057             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00058             sdi.mask = SDI_STR       |   // Displayname is valid
00059                 SDI_PARAM     |   // lParam is valid
00060                 SDI_IMAGE     |   // nImage is valid
00061                 SDI_OPENIMAGE |   // nOpenImage is valid
00062                 SDI_PARENT    |
00063                 SDI_CHILDREN;
00064
00065             sdi.relativeID  = (HSCOPEITEM)parent;
00066             sdi.nImage      = children[n]->GetBitmapIndex();
00067             sdi.nOpenImage  = INDEX_OPENFOLDER;
00068             sdi.displayname = MMC_CALLBACK;
00069             sdi.lParam      = (LPARAM)children[n];       // The cookie
00070             sdi.cChildren   = 0;
00071
00072             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00073
00074             _ASSERT( SUCCEEDED(hr) );
00075
00076                     children[n]->SetHandle((HANDLE)sdi.ID);
00077         }
00078     }
00079
00080     return S_OK;
00081 }
00082
00083 //==============================================================
00084 //
00085 // CSpaceStation implementation
00086 //
00087 //
00088 CSpaceStation::CSpaceStation() : m_cChildSpaceStations(0)
00089 {
00090     for (int n = 0; n < MAX_CHILDREN; n++) {
00091         children[n] = NULL;
00092     }
00093
00094     for (n = 0; n < NUMBER_OF_CHILDREN; n++) {
00095         children[n] = new CRocket(this, _T("Rocket"), n, 350115, 320, 52300);
00096     }
00097 }
00098
00099 CSpaceStation::~CSpaceStation()
00100 {
00101     for (int n = 0; n < MAX_CHILDREN; n++)
00102         if (children[n]) {
00103             delete children[n];
00104         }
00105 }
00106
00107 HRESULT CSpaceStation::Expand(IConsoleNameSpace *pConsoleNameSpace)
00108 {
00109
00110         //Expand the CSpaceStation if necessary.
00111         //This method is called by the object's OnPaste method during paste operations.
00112
00113         HRESULT hr = S_FALSE;
00114
00115         //First, need the IConsoleNameSpace2 interface to call Expand.
00116         IConsoleNameSpace2 *pConsoleNamespace2 = NULL;
00117         hr = pConsoleNameSpace->QueryInterface(IID_IConsoleNameSpace2, (void **)&pConsoleNamespace2);
00118         _ASSERT( SUCCEEDED(hr) );
00119
00120         hr = pConsoleNamespace2->Expand((HSCOPEITEM)GetHandle());
00121
00122         pConsoleNamespace2->Release();
00123
00124         return hr;
00125 }
00126
00127
00128 HRESULT CSpaceStation::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00129 {
00130         return S_FALSE;
00131 }
00132
00133 HRESULT CSpaceStation::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00134 {
00135     HRESULT      hr = S_OK;
00136
00137     IHeaderCtrl *pHeaderCtrl = NULL;
00138     IResultData *pResultData = NULL;
00139
00140     if (bShow) {
00141         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00142         _ASSERT( SUCCEEDED(hr) );
00143
00144         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00145         _ASSERT( SUCCEEDED(hr) );
00146
00147         // Set the column headers in the results pane
00148         hr = pHeaderCtrl->InsertColumn( 0, L"Rocket Class", 0, MMCLV_AUTO );
00149         _ASSERT( S_OK == hr );
00150         hr = pHeaderCtrl->InsertColumn( 1, L"Rocket Weight", 0, MMCLV_AUTO );
00151         _ASSERT( S_OK == hr );
00152         hr = pHeaderCtrl->InsertColumn( 2, L"Rocket Height", 0, MMCLV_AUTO );
00153         _ASSERT( S_OK == hr );
00154         hr = pHeaderCtrl->InsertColumn( 3, L"Rocket Payload", 0, MMCLV_AUTO );
00155         _ASSERT( S_OK == hr );
00156         hr = pHeaderCtrl->InsertColumn( 4, L"Status", 0, MMCLV_AUTO );
00157         _ASSERT( S_OK == hr );
00158
00159         // insert items here
00160         RESULTDATAITEM rdi;
00161
00162         hr = pResultData->DeleteAllRsltItems();
00163         _ASSERT( SUCCEEDED(hr) );
00164
00165         if (!bExpanded) {
00166             // create the child nodes, then expand them
00167             for (int n = 0; n < MAX_CHILDREN; n++) {
00168
00169                                 if (NULL == children[n])
00170                                         //No more children to insert, so exit for loop
00171                                         break;
00172
00173                                 BOOL childDeleteStatus = children[n]->getDeletedStatus();
00174                                 if ( !childDeleteStatus) {
00175                                                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00176                                                 rdi.mask       = RDI_STR       |   // Displayname is valid
00177                                                                                                                  RDI_IMAGE     |
00178                                                                                                                  RDI_PARAM;        // nImage is valid
00179
00180                                                 rdi.nImage      = children[n]->GetBitmapIndex();
00181                                                 rdi.str         = MMC_CALLBACK;
00182                                                 rdi.nCol        = 0;
00183                                                 rdi.lParam      = (LPARAM)children[n];
00184
00185                                                 hr = pResultData->InsertItem( &rdi );
00186
00187                                                 _ASSERT( SUCCEEDED(hr) );
00188
00189                                                 children[n]->SetHandle((HANDLE)rdi.itemID);
00190                  }
00191             }
00192         }
00193
00194         pHeaderCtrl->Release();
00195         pResultData->Release();
00196     }
00197
00198     return hr;
00199 }
00200
00201 HRESULT CSpaceStation::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00202 {
00203     IConsoleVerb *pConsoleVerb;
00204
00205     HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00206     _ASSERT(SUCCEEDED(hr));
00207
00208     hr = pConsoleVerb->SetVerbState(MMC_VERB_CUT, ENABLED, TRUE);
00209     hr = pConsoleVerb->SetVerbState(MMC_VERB_CUT, HIDDEN, FALSE);
00210     hr = pConsoleVerb->SetVerbState(MMC_VERB_COPY, ENABLED, TRUE);
00211     hr = pConsoleVerb->SetVerbState(MMC_VERB_COPY, HIDDEN, FALSE);
00212     hr = pConsoleVerb->SetVerbState(MMC_VERB_DELETE, ENABLED, TRUE);
00213     hr = pConsoleVerb->SetVerbState(MMC_VERB_DELETE, HIDDEN, FALSE);
00214     hr = pConsoleVerb->SetVerbState(MMC_VERB_PASTE, ENABLED, TRUE);
00215     hr = pConsoleVerb->SetVerbState(MMC_VERB_PASTE, HIDDEN, FALSE);
00216
00217     pConsoleVerb->Release();
00218
00219     return S_OK;
00220 }
00221
00222 HRESULT CSpaceStation::OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted)
00223 {
00224         CRocket *pRocket = dynamic_cast<CRocket *>(pPasted);
00225
00226         HRESULT hr = S_OK;
00227
00228         if (NULL == pRocket)
00229         {
00230             // See if this is CSpaceStation, if so paste it into this item.
00231             // This sample simply creates a new CSpaceStation
00232             // and inserts it as a child of the destination of the paste.
00233             // It does not paste the cut/copied CSpaceStation and the
00234             // current state of its result items.
00235             CSpaceStation* pSpaceStn = dynamic_cast<CSpaceStation*>(pPasted);
00236             if ( (NULL != pSpaceStn) &&
00237                  (pSpaceStn != this) )
00238             {
00239                 // Regardless of whether this item is expanded or not
00240                 // always try to expand this scopeitem (so that paste can
00241                 // succeed).
00242                 hr = Expand(pComponentData->GetConsoleNameSpace());
00243
00244                 CSpaceStation* pNewStation = new CSpaceStation();
00245
00246                 SCOPEDATAITEM sdi;
00247                 ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00248                 sdi.mask = SDI_STR|   // Displayname is valid
00249                     SDI_PARAM     |   // lParam is valid
00250                     SDI_IMAGE     |   // nImage is valid
00251                     SDI_OPENIMAGE |   // nOpenImage is valid
00252                     SDI_PARENT    |
00253                     SDI_CHILDREN;
00254
00255                 sdi.relativeID  = (HSCOPEITEM)GetHandle();
00256                 sdi.nImage      = pNewStation->GetBitmapIndex();
00257                 sdi.nOpenImage  = INDEX_OPENFOLDER;
00258                 sdi.displayname = MMC_CALLBACK;
00259                 sdi.lParam      = (LPARAM)pNewStation;       // The cookie
00260                 sdi.cChildren   = 0;
00261
00262                 hr = pComponentData->GetConsoleNameSpace()->InsertItem( &sdi );
00263                 _ASSERT( SUCCEEDED(hr) );
00264
00265                 pNewStation->SetHandle((HANDLE)sdi.ID);
00266
00267             }
00268
00269                         //increment count of child space stations
00270                         m_cChildSpaceStations++;
00271
00272             return hr;
00273         }
00274
00275         if (pRocket->m_pSpaceStation == this)
00276                 return S_FALSE;
00277
00278                 //Create a new CRocket for the destination CSpaceStation
00279                 CRocket *myRocket = new CRocket(pRocket->m_pSpaceStation, pRocket->szName, pRocket->nId,
00280                                                                                 pRocket->lWeight, pRocket->lHeight, pRocket->lPayload);
00281
00282         for (int n = 0; n < MAX_CHILDREN; n++) {
00283                 if (NULL == children[n]) {
00284                         // put it here
00285
00286                                                 children[n] = myRocket;
00287                                                 children[n]->isDeleted = FALSE;
00288                                                 children[n]->nId = n;
00289                                                 children[n]->m_pSpaceStation = this;
00290
00291                         return S_OK;
00292                 }
00293         }
00294
00295         return S_FALSE;
00296 }
00297
00298 HRESULT CSpaceStation::OnQueryPaste(CDelegationBase *pPasted)
00299 {
00300         CRocket *pRocket = dynamic_cast<CRocket *>(pPasted);
00301
00302         if (NULL == pRocket)
00303         {
00304             // See if this is CSpaceStation.
00305             CSpaceStation* pSpaceStn = dynamic_cast<CSpaceStation*>(pPasted);
00306             if ( (NULL != pSpaceStn) &&
00307                  (pSpaceStn != this) )
00308             {
00309                 return S_OK;
00310             }
00311
00312             return S_FALSE;
00313         }
00314
00315         if (pRocket->m_pSpaceStation != this)
00316                 for (int n = 0; n < MAX_CHILDREN; n++) {
00317                         if (NULL == children[n]) {
00318                                 return S_OK;
00319                         }
00320                 }
00321
00322         return S_FALSE;
00323 }
00324
00325 HRESULT CSpaceStation::OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype)
00326
00327 {
00328         HRESULT hr = S_OK;
00329
00330         _ASSERT(item);
00331         _ASSERT(SCOPE == itemtype);
00332
00333         //refresh all result pane views
00334         hr = pConsole->SelectScopeItem( (HSCOPEITEM)item );
00335         _ASSERT( S_OK == hr);
00336
00337         return hr;
00338 }
00339
00340
00341 HRESULT CSpaceStation::OnDeleteScopeItem (IConsoleNameSpace *pConsoleNameSpace)
00342
00343 {
00344         HRESULT hr = S_FALSE;
00345
00346         HSCOPEITEM hCutItem = (HSCOPEITEM)GetHandle();
00347
00348         //Get handle and cookie of parent scope item. We need these to
00349         //remove the "+" sign if the parent's m_cChildSpaceStations goes to zero.
00350         HSCOPEITEM hParentItem;
00351         MMC_COOKIE cookieParentItem;
00352
00353         HRESULT hr1 = pConsoleNameSpace->GetParentItem(hCutItem, &hParentItem,
00354                                                                                                         (long *)&cookieParentItem);
00355
00356         //Delete the cut item
00357         hr = pConsoleNameSpace->DeleteItem(hCutItem, TRUE);
00358         _ASSERT(S_OK == hr);
00359
00360         if (SUCCEEDED(hr1))
00361         {
00362                 //Decrement parent's m_cChildSpaceStations count and
00363                 //remove "+" sign if necessary
00364                 CSpaceStation* pParentSpaceStn = reinterpret_cast<CSpaceStation*>(cookieParentItem);
00365                 pParentSpaceStn->DecrementCountChildSpaceStations();
00366
00367                 if ( !pParentSpaceStn->GetCountChildSpaceStations() )
00368                 {
00369                         SCOPEDATAITEM sdi;
00370
00371                         ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00372                         sdi.mask                = SDI_CHILDREN; //cChildren is valid
00373                         sdi.ID          = (HSCOPEITEM)hParentItem;
00374                         sdi.cChildren   = 0;
00375
00376                         hr = pConsoleNameSpace->SetItem( &sdi );
00377                         _ASSERT( SUCCEEDED(hr) );
00378                 }
00379
00380         }
00381
00382         return hr;
00383 }
00384
00385 //==============================================================
00386 //
00387 // CRocket implementation
00388 //
00389 //
00390 CRocket::CRocket(CSpaceStation *pSpaceStation, _TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload)
00391 : m_pSpaceStation(pSpaceStation), szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED)
00392 {
00393     if (szName) {
00394         this->szName = new _TCHAR[(_tcslen(szName) + 1) * sizeof(_TCHAR)];
00395         _tcscpy(this->szName, szName);
00396     }
00397
00398     this->nId = id;
00399     this->lWeight = lWeight;
00400     this->lHeight = lHeight;
00401     this->lPayload = lPayload;
00402
00403         isDeleted = FALSE;
00404 }
00405
00406 CRocket::~CRocket()
00407 {
00408     if (szName)
00409         delete [] szName;
00410 }
00411
00412 const _TCHAR *CRocket::GetDisplayName(int nCol)
00413 {
00414     const size_t cchBuffer = 128;
00415     static _TCHAR buf[cchBuffer];
00416
00417     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00418     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00419
00420     switch (nCol) {
00421     case 0:
00422         StringCchPrintf(buf, cchBuffer, _T("%s (#%d)"), szName ? szName : _T(""), nId);
00423         break;
00424
00425     case 1:
00426         StringCchPrintf(buf, cchBuffer, _T("%ld metric tons"), lWeight);
00427         break;
00428
00429     case 2:
00430         StringCchPrintf(buf, cchBuffer, _T("%ld meters"), lHeight);
00431         break;
00432
00433     case 3:
00434         StringCchPrintf(buf, cchBuffer, _T("%ld kilos"), lPayload);
00435         break;
00436
00437     case 4:
00438         StringCchPrintf(buf, cchBuffer, _T("%s"),
00439             iStatus == RUNNING ? _T("running") :
00440         iStatus == PAUSED ? _T("paused") :
00441         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00442         break;
00443
00444     }
00445
00446     return buf;
00447 }
00448
00449
00450 HRESULT CRocket::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00451 {
00452     IConsoleVerb *pConsoleVerb;
00453
00454     HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00455     _ASSERT(SUCCEEDED(hr));
00456
00457     hr = pConsoleVerb->SetVerbState(MMC_VERB_RENAME, ENABLED, TRUE);
00458     hr = pConsoleVerb->SetVerbState(MMC_VERB_CUT, ENABLED, TRUE);
00459     hr = pConsoleVerb->SetVerbState(MMC_VERB_COPY, ENABLED, TRUE);
00460     hr = pConsoleVerb->SetVerbState(MMC_VERB_DELETE, ENABLED, TRUE);
00461
00462     pConsoleVerb->Release();
00463
00464     return S_OK;
00465 }
00466
00467 HRESULT CRocket::OnRefresh(IConsole *pConsole)
00468
00469 {
00470         //Call IConsole::UpdateAllViews to redraw all views
00471         //owned by the parent scope item
00472
00473         IDataObject *pDummy = NULL;
00474         HANDLE handle  = m_pSpaceStation->GetHandle();
00475
00476         HRESULT hr;
00477
00478         hr = pConsole->UpdateAllViews(pDummy, (long)handle, UPDATE_SCOPEITEM);
00479         _ASSERT( S_OK == hr);
00480
00481         return hr;
00482 }
00483
00484 HRESULT CRocket::OnDelete(IConsole *pConsole)
00485 {
00486
00487         _ASSERT( NULL != this );
00488
00489         HRESULT hr = S_OK;
00490
00491         //Delete the item. The IConsole that is passed into DeleteChild
00492         //is from the child result item, so we can use it to QI for IResultData
00493         IResultData *pResultData = NULL;
00494
00495         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00496         _ASSERT( SUCCEEDED(hr) );
00497
00498         HRESULTITEM childresultitem;
00499
00500         _ASSERT( NULL != &childresultitem );
00501
00502         //lparam == this. See CSpaceStation::OnShow
00503         hr = pResultData->FindItemByLParam( (LPARAM)this, &childresultitem );
00504         _ASSERT( SUCCEEDED(hr) );
00505
00506         hr = pResultData->DeleteItem( childresultitem, 0 );
00507         _ASSERT( SUCCEEDED(hr) );
00508
00509         pResultData->Release();
00510
00511         //Now set child's isDeleted member to true so that the parent doesn't try to
00512         //to insert it again in CSpaceVehicle::OnShow. Admittedly, a hack...
00513         isDeleted = TRUE;
00514
00515         return hr;
00516 }
00517
00518 HRESULT CRocket::OnRename(LPOLESTR pszNewName)
00519 {
00520
00521         HRESULT hr = S_FALSE;
00522
00523         if (szName) {
00524         delete [] szName;
00525         szName = NULL;
00526     }
00527
00528     MAKE_TSTRPTR_FROMWIDE(ptrname, pszNewName);
00529     szName = new _TCHAR[(_tcslen(ptrname) + 1) * sizeof(_TCHAR)];
00530     _tcscpy(szName, ptrname);
00531
00532     return hr;
00533 }
00534
00535
00536 HRESULT CRocket::OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype)
00537
00538 {
00539         HRESULT hr = S_FALSE;
00540
00541         _ASSERT(NULL != this || isDeleted || RESULT == itemtype);
00542
00543         //redraw the item
00544         IResultData *pResultData = NULL;
00545
00546         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00547         _ASSERT( SUCCEEDED(hr) );
00548
00549         HRESULTITEM myhresultitem;
00550         _ASSERT(NULL != &myhresultitem);
00551
00552         //lparam == this. See CSpaceStation::OnShow
00553         hr = pResultData->FindItemByLParam( (LPARAM)this, &myhresultitem );
00554
00555         if ( FAILED(hr) ) {
00556                 //there is no HRESULTITEM for the item, because
00557                 //the item is not inserted in the current view. Exit gracefully
00558                 hr = S_FALSE;
00559         } else
00560
00561         {
00562                 hr = pResultData->UpdateItem( myhresultitem );
00563                 _ASSERT( SUCCEEDED(hr) );
00564         }
00565
00566         pResultData->Release();
00567
00568         return hr;
00569 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

port_hdr Member List

This is the complete list of members for port_hdr, including all inherited members.
dest_portno | port_hdr
src_portno | port_hdr
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyAudit/ComSpyAudit.Cpp Source File

  • Com
  • Administration
  • Spy
  • ComSpyAudit

ComSpyAudit.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "stdafx.h"
00018 #include "resource.h"
00019 #include "initguid.h"
00020 #include <SQL.h>
00021 #include <SQLEXT.h>
00022 #include <ODBCINST.h>
00023 #include "ComSpyAudit.h"
00024 #include "ComSpyAudit_i.c"
00025 #include "ComSpySqlAudit.h"
00026
00027
00028 CComModule _Module;
00029
00030 BEGIN_OBJECT_MAP(ObjectMap)
00031   OBJECT_ENTRY(CLSID_ComSpyAudit, CComSpySqlAudit)
00032 END_OBJECT_MAP()
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // DLL Entry Point
00036
00037 extern "C"
00038 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00039 {
00040   if (dwReason == DLL_PROCESS_ATTACH)
00041   {
00042     _Module.Init(ObjectMap, hInstance);
00043     DisableThreadLibraryCalls(hInstance);
00044   }
00045   else if (dwReason == DLL_PROCESS_DETACH)
00046     _Module.Term();
00047   return TRUE;    // ok
00048 }
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // Used to determine whether the DLL can be unloaded by OLE
00052
00053 STDAPI DllCanUnloadNow(void)
00054 {
00055   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00056 }
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 // Returns a class factory to create an object of the requested type
00060
00061 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00062 {
00063   return _Module.GetClassObject(rclsid, riid, ppv);
00064 }
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067 // DllRegisterServer - Adds entries to the system registry
00068
00069 STDAPI DllRegisterServer(void)
00070 {
00071   // registers object, typelib and all interfaces in typelib
00072   return _Module.RegisterServer(TRUE);
00073 }
00074
00075 /////////////////////////////////////////////////////////////////////////////
00076 // DllUnregisterServer - Removes entries from the system registry
00077
00078 STDAPI DllUnregisterServer(void)
00079 {
00080   _Module.UnregisterServer();
00081   return S_OK;
00082 }
00083
00084
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/CConf.h Source File

  • Web
  • NetMeeting
  • NMUI

CConf.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CCONF.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 //****************************************************************************
00017 //
00018 // CLASS CConfNotify
00019 //
00020 //****************************************************************************
00021
00022 class CConfNotify : public RefCount, public CNotify, public INmConferenceNotify
00023 {
00024 public:
00025   CConfNotify();
00026   ~CConfNotify();
00027
00028   // INmConferenceNotify
00029   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00030   HRESULT STDMETHODCALLTYPE StateChanged(NM_CONFERENCE_STATE uState);
00031   HRESULT STDMETHODCALLTYPE MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pfMember);
00032   HRESULT STDMETHODCALLTYPE ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel);
00033
00034   // ICNotify methods
00035   HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00036   HRESULT STDMETHODCALLTYPE Disconnect(void);
00037
00038   // IUnknown methods
00039   ULONG STDMETHODCALLTYPE AddRef(void);
00040   ULONG STDMETHODCALLTYPE Release(void);
00041   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
00042 };
00043
00044
00045 //****************************************************************************
00046 //
00047 // Global Variables
00048 //
00049 //****************************************************************************
00050
00051 extern COBLIST * g_pListConference;
00052 extern COBLIST * g_pListConferenceNotify;
00053
00054
00055 //****************************************************************************
00056 //
00057 // Global Functions
00058 //
00059 //****************************************************************************
00060
00061 INmConference * GetCurrentConference(void);
00062 VOID DoConferenceCreate(void);
00063 VOID DoConferenceLeave(void);
00064 VOID FreeConferences(void);
00065 HRESULT HookConference(INmConference * pConference);
00066
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/imsconf2.idl Source File

  • Web
  • NetMeeting
  • NMChat2

imsconf2.idl

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       imsconf2.idl
00004 //
00005 //
00006 //  Copyright (c) Microsoft Corporation 1999-2002
00007 //
00008 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00009 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00010 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00011 // PARTICULAR PURPOSE.
00012 //****************************************************************************
00013
00014 #include <imsconf2.idl>
00015
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/PoolWrap/PoolWrap.h Source File

  • Web
  • iis
  • ISAPI_6.0
  • PoolWrap

PoolWrap.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: PoolWrap.h
00006
00007 Abstract:
00008
00009     Header file for PoolWrap
00010
00011 Author:
00012
00013     ISAPI developer (Microsoft employee)
00014
00015 --*/
00016
00017 #define MODULE_NAME "DemoPoolWrap"
00018
00019 extern LONG g_QueueFullPages;
00020 extern LONG g_TotalRequests;
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026 BOOL
00027 InitThread(
00028     VOID
00029     );
00030
00031 VOID
00032 UninitThread(
00033     VOID
00034     );
00035
00036 BOOL
00037 IsapiWriteLog(
00038     LPSTR   szString,
00039     ...
00040     );
00041
00042 #ifdef __cplusplus
00043 }
00044 #endif
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/FullIME/FullIME.h Source File

  • WinUI
  • Input
  • Ime
  • FullIME

FullIME.h

Go to the documentation of this file.
00001 #define MAXROW          12
00002 #define MAXCOL          60
00003 #define FIRSTROW         0
00004 #define FIRSTCOL         0
00005 #define LASTROW         (MAXROW-1)
00006 #define LASTCOL         (MAXCOL-1)
00007 #define TABSTOP          4
00008 #define MAX_LISTCAND     32
00009 #define MAX_CHARS_PER_LINE   10
00010 #define MAX_COMP_STRING_LEN  10
00011 #define DEFAULT_CAND_NUM_PER_PAGE 5
00012 #define X_INDENT         10
00013 #define Y_INDENT         10
00014
00015 #define ID_ICON         1
00016 #define ID_MENU         1
00017 #define IDS_CLASS       1
00018 #define IDS_TITLE       2
00019 #define IDS_CANDUI      3
00020 #define IDS_COMPTITLE   4
00021 #define IDS_CANDTITLE   5
00022 #define IDS_CANDCLASS   6
00023
00024 #define IDC_LIST1                0
00025 #define IDC_LIST32              31
00026
00027 #define IDC_CLEAR               41
00028 #define IDC_ANSIFILL            42
00029 #define IDC_DBCSFILL            43
00030 #define IDC_OPENIME             44
00031 #define IDC_CLOSEIME            45
00032
00033 #define IME_IN_COMPOSITION      1
00034 #define IME_IN_CHOSECAND        2
00035
00036 #define CheckProperty   {       \
00037     if ( ( gImeUIData.fdwProperty & IME_PROP_SPECIAL_UI ) ||  \
00038    !( gImeUIData.fdwProperty & IME_PROP_AT_CARET ) )  \
00039   goto call_defwinproc;         \
00040 }
00041
00042 typedef struct _IMEUIDATA {
00043     int        ImeState;   // Current Ime state.
00044     UINT       uCompLen;   // To save previous composition string length.
00045     DWORD      fdwProperty;
00046     HWND       hListCand[ MAX_LISTCAND ];
00047     HGLOBAL    hListCandMem[ MAX_LISTCAND ];
00048 } IMEUIDATA;
00049
00050 //
00051 // Prototype declaration
00052 //
00053
00054 int WINAPI SteWndProc( HWND, UINT, UINT, LONG );
00055 int WINAPI CandWndProc( HWND hwnd, UINT, WPARAM, LPARAM );
00056
00057 void ResetCaret( HWND );
00058
00059 void ImeUIStartComposition( HWND );
00060 void ImeUIComposition( HWND, WPARAM, LPARAM );
00061 void GetCompositionStr( HWND, LPARAM );
00062 void GetResultStr( HWND );
00063 void ImeUIEndComposition( HWND );
00064 void ImeUIOpenCandidate( HWND, LPARAM );
00065 void ImeUICloseCandidate( HWND, LPARAM );
00066 void ImeUISetOpenStatus( HWND );
00067 void DisplayResultString( HWND, LPSTR );
00068 void DisplayCompString( HWND, LPSTR, LPSTR );
00069 void RestoreImeUI( HWND );
00070 BOOL ImeUINotify( HWND, WPARAM, LPARAM );
00071 void ImeUIChangeCandidate( HWND, LPARAM );
00072 void DisplayCandStrings( HWND, LPCANDIDATELIST );
00073 void CandUIPaint( HWND );
00074 void ImeUIMoveCandWin( HWND );
00075 BOOL MoveCaret( HWND );
00076 void ImeUIClearData( HWND );
00077 void SetIMECompFormPos( HWND );
00078
00079 //
00080 // Global data
00081 //
00082
00083 extern char szSteClass[];
00084 extern char szSteCandUIClass[];
00085 extern char szSteTitle[];
00086 extern char szSteCompTitle[];
00087 extern char szSteCandTitle[];
00088 extern char szCandClass[];
00089
00090 extern UINT   cxMetrics,
00091               cxOverTypeCaret,
00092               cyMetrics;
00093
00094 extern int    xPos, yPos;
00095 extern HFONT  hfntFixed;
00096 extern HFONT  hfntOld;
00097 extern BOOL   fInsertMode;
00098 extern int    CaretWidth;
00099 extern int    DBCSFillChar;
00100 extern BYTE   textbuf[MAXROW][MAXCOL];
00101
00102 extern IMEUIDATA gImeUIData;
00103
00104 extern HKL    hCurKL;
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/mqf_draw/drawdlg.cpp Source File

  • NetDS
  • MessageQueuing
  • mqf_draw

drawdlg.cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // drawdlg.cpp : implementation file
00014 //
00015
00016
00017 #include "stdafx.h"
00018 #include "mqfdraw.h"
00019 #include "drawdlg.h"
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 #define MAX_FORMAT_NAME_LEN 256
00028 #define FORMAT_NAME_LIST_LEN 1026
00029
00030
00031 //
00032 // Define the distributed draw queue type.
00033 //
00034 CLSID guidDrawType =
00035 { 0x151ceac0, 0xacb5, 0x11cf, { 0x8b, 0x51, 0x00, 0x20, 0xaf, 0x92, 0x95, 0x46 } };
00036
00037 //
00038 //Title
00039 //
00040 CString strTitle;
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // CDisdrawDlg dialog box
00044
00045 CDisdrawDlg::CDisdrawDlg(CWnd* pParent /*=NULL*/)
00046   : CDialog(CDisdrawDlg::IDD, pParent)
00047 {
00048   //{{AFX_DATA_INIT(CDisdrawDlg)
00049   m_strFriend = _T("");
00050   m_iDelivery = 0;
00051     m_iType = 0;
00052   m_strRemoteComputerName = _T("");
00053   m_iRadioDS = 0;
00054   m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
00055   //}}AFX_DATA_INIT
00056   m_fDsEnabledLocaly = 0;
00057   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32.
00058 }
00059
00060 void CDisdrawDlg::DoDataExchange(CDataExchange* pDX)
00061 {
00062   CDialog::DoDataExchange(pDX);
00063   //{{AFX_DATA_MAP(CDisdrawDlg)
00064   DDX_Control(pDX, IDC_FRAME_FRIEND, m_cFriendFrame);
00065   DDX_Control(pDX, IDC_STATIC_C_LABEL, m_cComputerLabel);
00066   DDX_Control(pDX, IDCANCEL, m_CancelButton);
00067   DDX_Control(pDX, IDC_STATIC_Q_LABEL, m_cQueueLabel);
00068   DDX_Control(pDX, IDC_STATIC_CHOOSE_MESSAGE, m_cMessageFrame);
00069   DDX_Control(pDX, IDC_STATIC_CHOOSE_QUEUE, m_cQueueFrame);
00070   DDX_Control(pDX, IDC_RADIO_EXPRESS, m_cRadioExpress);
00071   DDX_Control(pDX, IDC_EDIT_FRIEND_COMPUTER, m_cComputerInput);
00072   DDX_Control(pDX, IDC_EDIT_FRIEND, m_cQueueInput);
00073   DDX_Control(pDX, IDC_DRAWAREA_SCRIBLLE, m_drawScribble);
00074   DDX_Control(pDX, IDC_BUTTON_ATTACH, m_btnAttach);
00075   DDX_Text(pDX, IDC_EDIT_FRIEND, m_strFriend);
00076   DDV_MaxChars(pDX, m_strFriend, 50);
00077   DDX_Radio(pDX, IDC_RADIO_EXPRESS, m_iDelivery);
00078   DDX_Radio(pDX, IDC_RADIO_PUBLICQUEUE, m_iType);
00079   DDX_Text(pDX, IDC_EDIT_FRIEND_COMPUTER, m_strRemoteComputerName);
00080   DDV_MaxChars(pDX, m_strRemoteComputerName, 50);
00081     DDX_Control(pDX, IDC_RADIO_RECOVERABLE, m_cRadioRecoverable);
00082   DDX_Control(pDX, IDC_RADIO_PUBLICQUEUE, m_cRadioPublic);
00083   DDX_Control(pDX, IDC_RADIO_PRIVATEQUEUE, m_cRadioPrivate);
00084   DDX_Control(pDX, IDC_BUTTON_ADDQUEUE, m_btnAddQueue);
00085   DDX_Control(pDX, IDC_CONNECTION, m_cConnectionMode);
00086   //}}AFX_DATA_MAP
00087
00088
00089 }
00090
00091 BEGIN_MESSAGE_MAP(CDisdrawDlg, CDialog)
00092   //{{AFX_MSG_MAP(CDisdrawDlg)
00093   ON_WM_PAINT()
00094   ON_WM_QUERYDRAGICON()
00095   ON_BN_CLICKED(IDC_BUTTON_ATTACH, OnButtonAttach)
00096   ON_BN_CLICKED(IDC_BUTTON_ADDQUEUE, OnButtonAddQueue)
00097   ON_WM_CLOSE()
00098   ON_BN_CLICKED(IDC_RADIO_PRIVATEQUEUE, OnRadioPrivatequeue)
00099   ON_BN_CLICKED(IDC_RADIO_PUBLICQUEUE, OnRadioPublicqueue)
00100   //}}AFX_MSG_MAP
00101 END_MESSAGE_MAP()
00102
00103 /////////////////////////////////////////////////////////////////////////////
00104 // CDisdrawDlg message handle
00105
00106
00107 BOOL LocateQueue(CString m_strLabel, WCHAR *wcsFormatName, DWORD dwNumChars)
00108 {
00109   //
00110   // Set restrictions to locate a draw queue with the specified label.
00111   //
00112   DWORD cProps = 0;
00113   MQPROPERTYRESTRICTION aPropRestriction[2];
00114   MQRESTRICTION Restriction;
00115
00116   aPropRestriction[cProps].rel           = PREQ;
00117   aPropRestriction[cProps].prop          = PROPID_Q_TYPE;
00118   aPropRestriction[cProps].prval.vt      = VT_CLSID;
00119   aPropRestriction[cProps].prval.puuid   = &guidDrawType;
00120   cProps++;
00121
00122   WCHAR wcsLabel[MQ_MAX_Q_LABEL_LEN];
00123   mbstowcs(wcsLabel, m_strLabel, MQ_MAX_Q_LABEL_LEN);
00124   aPropRestriction[cProps].rel           = PREQ;
00125   aPropRestriction[cProps].prop          = PROPID_Q_LABEL;
00126   aPropRestriction[cProps].prval.vt      = VT_LPWSTR;
00127   aPropRestriction[cProps].prval.pwszVal = wcsLabel;
00128   cProps++;
00129
00130   Restriction.cRes = cProps;
00131   Restriction.paPropRes = aPropRestriction;
00132
00133
00134   //
00135   // Retrieve the GUID of the specified queue.
00136   //
00137   cProps = 0;
00138   QUEUEPROPID aPropId[1];
00139   MQCOLUMNSET Column;
00140
00141   aPropId[cProps] = PROPID_Q_INSTANCE;
00142   cProps++;
00143
00144   Column.cCol = cProps;
00145   Column.aCol = aPropId;
00146
00147
00148   //
00149   // Locate the specified queue.
00150   //
00151   HANDLE hEnum;
00152   BOOL fFound = FALSE;
00153   HRESULT hr = MQLocateBegin(NULL, &Restriction, &Column, NULL, &hEnum);
00154   if (!FAILED(hr))
00155   {
00156       MQPROPVARIANT aPropVar[1];
00157     DWORD cQueue = 1;
00158     hr = MQLocateNext(hEnum, &cQueue, aPropVar);
00159     if (!FAILED(hr) && cQueue > 0)
00160     {
00161       //
00162       // Obtain the format name for the queue located.
00163       //
00164       hr = MQInstanceToFormatName(aPropVar[0].puuid, wcsFormatName, &dwNumChars);
00165             MQFreeMemory(aPropVar[0].puuid);
00166       if (!FAILED(hr))
00167         fFound = TRUE;
00168     }
00169
00170     MQLocateEnd(hEnum);
00171   }
00172
00173
00174     return fFound;
00175 }
00176
00177
00178
00179 BOOL CDisdrawDlg::OpenReceiveQueue()
00180 {
00181     //
00182     // Do not create the receiving queue if it already exists in the enterprise.
00183     //
00184     HRESULT hr;
00185   WCHAR wcsFormatName[MAX_FORMAT_NAME_LEN];
00186     if (!LocateQueue(m_strLogin, wcsFormatName, MAX_FORMAT_NAME_LEN))
00187     {
00188       //
00189       // Form the path name of the receiving queue.
00190       //
00191       char mbsPathName[MQ_MAX_Q_NAME_LEN];
00192       DWORD dwNumChars = MQ_MAX_Q_NAME_LEN;
00193     if(!GetComputerName(mbsPathName, &dwNumChars))
00194     {
00195       return FALSE;
00196     }
00197
00198     if(MQ_MAX_Q_NAME_LEN <= (dwNumChars + m_strLogin.GetLength() + 1))
00199     {
00200       return FALSE;
00201     }
00202
00203     strncat(mbsPathName,"\\",1);
00204     strncat(mbsPathName, m_strLogin,m_strLogin.GetLength());
00205
00206
00207       //
00208       // Prepare the receiving queue properties.
00209       //
00210       DWORD cProps = 0;
00211       QUEUEPROPID  aPropId[3];
00212       MQPROPVARIANT aPropVar[3];
00213       MQQUEUEPROPS propsQueue;
00214
00215     WCHAR wcsPathName[MQ_MAX_Q_NAME_LEN];
00216     mbstowcs(wcsPathName, mbsPathName, MQ_MAX_Q_NAME_LEN);
00217       aPropId[cProps]      = PROPID_Q_PATHNAME;
00218       aPropVar[cProps].vt    = VT_LPWSTR;
00219       aPropVar[cProps].pwszVal = wcsPathName;
00220       cProps++;
00221
00222       aPropId[cProps]      = PROPID_Q_TYPE;
00223       aPropVar[cProps].vt    = VT_CLSID;
00224       aPropVar[cProps].puuid   = &guidDrawType;
00225       cProps++;
00226
00227     WCHAR wcsLabel[MQ_MAX_Q_LABEL_LEN];
00228     mbstowcs(wcsLabel, m_strLogin, MQ_MAX_Q_LABEL_LEN);
00229       aPropId[cProps]      = PROPID_Q_LABEL;
00230       aPropVar[cProps].vt    = VT_LPWSTR;
00231       aPropVar[cProps].pwszVal = wcsLabel;
00232       cProps++;
00233
00234       propsQueue.cProp  = cProps;
00235       propsQueue.aPropID  = aPropId;
00236       propsQueue.aPropVar = aPropVar;
00237       propsQueue.aStatus  = NULL;
00238
00239
00240       //
00241       // Create the receiving queue.
00242       //
00243       dwNumChars = MAX_FORMAT_NAME_LEN;
00244       hr = MQCreateQueue(NULL, &propsQueue, wcsFormatName, &dwNumChars);
00245
00246
00247       //
00248       // If the receiving queue already exists, obtain its format name.
00249       //
00250       if (hr == MQ_ERROR_QUEUE_EXISTS)
00251         hr = MQPathNameToFormatName(wcsPathName, wcsFormatName, &dwNumChars);
00252
00253       if (FAILED(hr))
00254         return FALSE;
00255     }
00256
00257   //
00258   // Open the receiving queue (may need to retry due to replication latency).
00259   //
00260     int iCount = 0;
00261   while ((hr = MQOpenQueue(wcsFormatName,
00262                              MQ_RECEIVE_ACCESS,
00263                              MQ_DENY_NONE ,
00264                              &m_hqIncoming)) == MQ_ERROR_QUEUE_NOT_FOUND)
00265     {
00266
00267         Sleep (500);
00268         iCount++;
00269         if (iCount >= 30)
00270         {
00271             //
00272             // Because 15 seconds have past without locating the queue,
00273             // we allow the user to stop making attempts to open the queue.
00274             //
00275             int iRes = MessageBox("The receiving queue has not beeen located.\nDo you want to keep searching?",
00276                                 NULL,
00277                                 MB_YESNO);
00278             if(iRes == IDYES)
00279             {
00280                 //
00281                 // Continue searching.
00282                 //
00283                 iCount = 0;
00284             }
00285             else
00286             {
00287                 //
00288                 // Stop searching.
00289                 //
00290                 break;
00291             }
00292         }
00293     }
00294
00295   if (FAILED(hr))
00296     return FALSE;
00297
00298
00299   return TRUE;
00300 }
00301
00302
00303 DWORD ReceiveUpdates(CDisdrawDlg *pDrawDlg)
00304 {
00305     //
00306   // Prepare the message properties for receiving a message.
00307   //
00308   DWORD cProps = 0;
00309   MQMSGPROPS    propsMessage;
00310   MQPROPVARIANT aPropVar[2];
00311   MSGPROPID     aPropId[2];
00312
00313   WCHAR wcsBody[MAX_MSG_BODY_LEN];
00314   aPropId[cProps]       = PROPID_M_BODY;
00315   aPropVar[cProps].vt     = VT_UI1 | VT_VECTOR;
00316   aPropVar[cProps].caub.cElems = sizeof(wcsBody);
00317   aPropVar[cProps].caub.pElems = (UCHAR *)wcsBody;
00318   cProps++;
00319
00320     aPropId[cProps]       = PROPID_M_BODY_SIZE;
00321   aPropVar[cProps].vt     = VT_UI4;
00322   cProps++;
00323
00324   propsMessage.cProp    = cProps;
00325   propsMessage.aPropID  = aPropId;
00326   propsMessage.aPropVar = aPropVar;
00327   propsMessage.aStatus  = NULL;
00328
00329
00330     //
00331     // Keep receiving updates sent to the incoming queue.
00332     //
00333     HRESULT hr;
00334     LINE line;
00335   char mbsBody[MAX_MSG_BODY_LEN + 1];
00336
00337     while (TRUE)
00338     {
00339         //
00340         // Synchronously receive a message from the incoming queue.
00341         //
00342         hr = MQReceiveMessage(pDrawDlg->m_hqIncoming, INFINITE,
00343                               MQ_ACTION_RECEIVE, &propsMessage,
00344                 NULL, NULL, NULL, NULL);
00345
00346     //
00347     // Determine whether the message contains a keystroke or a line.
00348     //
00349         if (!FAILED(hr))
00350         {
00351       //
00352       // Convert the body to a multi-byte null-terminated string.
00353       //
00354       UINT uNumChars = aPropVar[1].ulVal/sizeof(WCHAR);
00355       if(MAX_MSG_BODY_LEN < uNumChars)
00356       {
00357         AfxMessageBox("The message body length exceeds the allowed value. Exiting...");
00358         exit(1);
00359       }
00360
00361             size_t rc = wcstombs(mbsBody, wcsBody, uNumChars);
00362       if (rc == (size_t)(-1))
00363       {
00364         AfxMessageBox("An unsupported wide character was encountered. Ignoring...");
00365         continue;
00366       }
00367
00368       mbsBody[uNumChars] = '\0';
00369
00370       //
00371       // Add the keystroke to the drawing.
00372       //
00373       if (uNumChars == 1)
00374             {
00375         pDrawDlg->m_drawScribble.AddKeystroke(mbsBody);
00376             }
00377
00378       //
00379       // Add the received line to the drawing.
00380       //
00381       else
00382       {
00383         int iRes = sscanf(mbsBody, "%07ld%07ld%07ld%07ld",
00384              &line.ptStart.x, &line.ptStart.y,
00385              &line.ptEnd.x, &line.ptEnd.y);
00386         if (iRes != 0 && iRes != EOF)
00387         {
00388           pDrawDlg->m_drawScribble.AddLine(line);
00389         }
00390       }
00391         }
00392     }
00393
00394
00395     return 0;
00396 }
00397
00398
00399 BOOL CDisdrawDlg::OnInitDialog()
00400 {
00401   m_iFormatNameList = FORMAT_NAME_LIST_LEN;
00402   m_wcsFormatNameList = new WCHAR[FORMAT_NAME_LIST_LEN];
00403     m_wcsFormatNameList[0] = L'\0';
00404   CDialog::OnInitDialog();
00405
00406   // Set the icon for this dialog box.  The framework does this automatically
00407   // when the application's main window is not a dialog box.
00408   SetIcon(m_hIcon, TRUE);     // Set the big icon.
00409   SetIcon(m_hIcon, FALSE);    // Set the small icon.
00410
00411
00412   //
00413   // Display the logon name in the window title.
00414   //
00415   SetWindowText("Listening to: " + m_strLogin);
00416
00417
00418   //
00419   // No queues are open yet.
00420   //
00421   m_hqIncoming = NULL;
00422   m_hqOutgoing = NULL;
00423
00424
00425     if (!m_fDsEnabledLocaly)
00426     {
00427         //
00428         // Access to the DS is disabled. This is the right place to open the receiving queue.
00429         // Because we open a local private queue, this operation is not time consuming.
00430         //
00431         //
00432       // Open the receiving queue and receive incoming messages.
00433       //
00434
00435         if (OpenPrivateReceiveQueue())
00436         {
00437             startReceiveUpdateThread();
00438         }
00439       else
00440         {
00441             //
00442             // The attempt to open the receiving queue failed.
00443             //
00444         MessageBox("The receiving queue cannot be opened.");
00445         }
00446     m_cComputerInput.ShowWindow(SW_SHOW);
00447     m_cComputerLabel.ShowWindow(SW_SHOW);
00448
00449
00450     m_cRadioPrivate.ShowWindow(SW_HIDE);
00451     m_cRadioPublic.ShowWindow(SW_HIDE);
00452     m_cQueueFrame.ShowWindow(SW_HIDE);
00453     m_iType = 1;
00454     m_cConnectionMode.SetWindowText("Mode: Workgroup");
00455
00456     }
00457
00458
00459   if((m_iRadioDS == 0)&&(m_fDsEnabledLocaly))
00460     {
00461         //
00462         // Access to the DS is enabled locally, and the user chose to connect in domain (standard) mode.
00463         //
00464
00465          CWaitCursor wait;
00466
00467         //
00468       // Open the receiving queue and receive incoming messages.
00469       //
00470
00471         if (OpenReceiveQueue())
00472         {
00473             startReceiveUpdateThread();
00474         }
00475       else
00476         {
00477         AfxMessageBox("The receiving queue cannot be opened.");
00478         }
00479     m_cQueueFrame.ShowWindow(SW_SHOW);
00480     m_cRadioPublic.ShowWindow(SW_SHOW);
00481     m_cRadioPrivate.ShowWindow(SW_SHOW);
00482     m_cConnectionMode.SetWindowText("Mode: Domain");
00483   }
00484   else if(m_fDsEnabledLocaly)  // m_iRadio == 1
00485     {
00486         //
00487         // Access to the DS is enabled locally, and the user chose to connect in workgroup (direct) mode.
00488         //
00489         //
00490         // Change the cursor to an hourglass. The constructor changes the cursor.
00491         // When the object goes out of scope, the cursor returns to normal.
00492         //
00493         CWaitCursor wait ;
00494
00495         //
00496       // Open the receiving private queue and receive incoming messages.
00497       //
00498
00499         if (OpenPrivateReceiveQueue())
00500         {
00501             startReceiveUpdateThread();
00502         }
00503       else
00504         {
00505         AfxMessageBox("The receiving queue cannot be opened.");
00506         }
00507
00508     m_cQueueFrame.ShowWindow(SW_SHOW);
00509     m_cRadioPublic.ShowWindow(SW_SHOW);
00510     m_cRadioPrivate.ShowWindow(SW_SHOW);
00511     m_cConnectionMode.SetWindowText("Mode: Domain");
00512   }
00513   strTitle = m_strLogin + " connected to ";
00514
00515
00516     return TRUE;  // Return TRUE unless you set the focus to a control.
00517 }
00518
00519
00520
00521
00522
00523 // If you add a minimize button to your dialog box, you will need the code below
00524 // to draw the icon. For MFC applications using the document/view model,
00525 // this is done automatically for you by the framework.
00526
00527 void CDisdrawDlg::OnPaint()
00528 {
00529   if (IsIconic())
00530   {
00531     CPaintDC dc(this); // device context for painting
00532
00533     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00534
00535     // Center the icon in the client rectangle.
00536     int cxIcon = GetSystemMetrics(SM_CXICON);
00537     int cyIcon = GetSystemMetrics(SM_CYICON);
00538     CRect rect;
00539     GetClientRect(&rect);
00540     int x = (rect.Width() - cxIcon + 1) / 2;
00541     int y = (rect.Height() - cyIcon + 1) / 2;
00542
00543     // Draw the icon.
00544     dc.DrawIcon(x, y, m_hIcon);
00545   }
00546   else
00547   {
00548     CDialog::OnPaint();
00549   }
00550 }
00551
00552
00553 // The system calls this to obtain the cursor to display while the user drags
00554 //  the minimized window.
00555 HCURSOR CDisdrawDlg::OnQueryDragIcon()
00556 {
00557   return (HCURSOR) m_hIcon;
00558 }
00559
00560
00561 void CDisdrawDlg::SendKeystroke(UINT uChar)
00562 {
00563   //
00564   // Send the keystroke to the friend queue, if any exists.
00565   //
00566   if (m_hqOutgoing != NULL)
00567   {
00568     //
00569     // Prepare the message properties for sending a messages.
00570     //
00571     DWORD cProps = 0;
00572     MQMSGPROPS    propsMessage;
00573     MQPROPVARIANT aPropVar[5];
00574     MSGPROPID     aPropId[5];
00575
00576     WCHAR wcsBody[2];
00577     _snwprintf(wcsBody, 1, L"%c", uChar);
00578     wcsBody[1] = L'\0';
00579
00580     aPropId[cProps]       = PROPID_M_BODY;
00581     aPropVar[cProps].vt     = VT_UI1 | VT_VECTOR;
00582     aPropVar[cProps].caub.cElems = sizeof(wcsBody[0]);
00583     aPropVar[cProps].caub.pElems = (UCHAR *)wcsBody;
00584     cProps++;
00585
00586     WCHAR wcsLabel[MQ_MAX_MSG_LABEL_LEN];
00587     int n = _snwprintf(wcsLabel, 6, L"Key: %c", uChar);
00588     if(n < 0)
00589     {
00590       AfxMessageBox("The label too long for the buffer specified.");
00591       exit(1);
00592     }
00593     wcsLabel[n] = L'\0';
00594
00595     aPropId[cProps]       = PROPID_M_LABEL;
00596     aPropVar[cProps].vt     = VT_LPWSTR;
00597     aPropVar[cProps].pwszVal  = wcsLabel;
00598     cProps++;
00599
00600         UpdateData(TRUE);
00601     aPropId[cProps]       = PROPID_M_DELIVERY;
00602     aPropVar[cProps].vt     = VT_UI1;
00603     aPropVar[cProps].bVal   = m_iDelivery;
00604     cProps++;
00605
00606     aPropId[cProps]       = PROPID_M_PRIORITY;
00607     aPropVar[cProps].vt     = VT_UI1;
00608     aPropVar[cProps].bVal   = 4;
00609     cProps++;
00610
00611     aPropId[cProps]       = PROPID_M_BODY_TYPE;
00612     aPropVar[cProps].vt     = VT_UI4;
00613     aPropVar[cProps].lVal   = (long)VT_BSTR;
00614     cProps++;
00615
00616     propsMessage.cProp    = cProps;
00617     propsMessage.aPropID  = aPropId;
00618     propsMessage.aPropVar = aPropVar;
00619     propsMessage.aStatus  = NULL;
00620
00621
00622     //
00623     // Send the message to the outgoing queue.
00624     //
00625     MQSendMessage(m_hqOutgoing, &propsMessage, NULL);
00626   }
00627 }
00628
00629
00630 void CDisdrawDlg::SendMouseMovement(LINE line)
00631 {
00632   //
00633   // Send the line to the friend queue, if any exists.
00634   //
00635   if (m_hqOutgoing != NULL)
00636   {
00637     //
00638     // Prepare the message properties for sending.
00639     //
00640     DWORD cProps = 0;
00641     MQMSGPROPS    propsMessage;
00642     MQPROPVARIANT aPropVar[5];
00643     MSGPROPID     aPropId[5];
00644
00645     WCHAR wcsBody[MAX_MSG_BODY_LEN];
00646     swprintf(wcsBody, L"%07ld%07ld%07ld%07ld",
00647          line.ptStart.x, line.ptStart.y, line.ptEnd.x, line.ptEnd.y);
00648
00649     aPropId[cProps]       = PROPID_M_BODY;
00650     aPropVar[cProps].vt     = VT_UI1 | VT_VECTOR;
00651     aPropVar[cProps].caub.cElems = sizeof(wcsBody);
00652     aPropVar[cProps].caub.pElems = (UCHAR *)wcsBody;
00653     cProps++;
00654
00655     WCHAR wcsLabel[MQ_MAX_MSG_LABEL_LEN];
00656     swprintf(wcsLabel, L"%07ld,%07ld To %07ld,%07ld",
00657          line.ptStart.x, line.ptStart.y, line.ptEnd.x, line.ptEnd.y);
00658
00659     aPropId[cProps]       = PROPID_M_LABEL;
00660     aPropVar[cProps].vt     = VT_LPWSTR;
00661     aPropVar[cProps].pwszVal  = wcsLabel;
00662     cProps++;
00663
00664         UpdateData(TRUE);
00665     aPropId[cProps]       = PROPID_M_DELIVERY;
00666     aPropVar[cProps].vt     = VT_UI1;
00667     aPropVar[cProps].bVal   = m_iDelivery;
00668     cProps++;
00669
00670     aPropId[cProps]       = PROPID_M_PRIORITY;
00671     aPropVar[cProps].vt     = VT_UI1;
00672     aPropVar[cProps].bVal   = 3;
00673     cProps++;
00674
00675     aPropId[cProps]       = PROPID_M_BODY_TYPE;
00676     aPropVar[cProps].vt     = VT_UI4;
00677     aPropVar[cProps].lVal   = (long)VT_BSTR;
00678     cProps++;
00679
00680     propsMessage.cProp    = cProps;
00681     propsMessage.aPropID  = aPropId;
00682     propsMessage.aPropVar = aPropVar;
00683     propsMessage.aStatus  = NULL;
00684
00685
00686     //
00687     // Send the message to the outgoing queue.
00688     //
00689     MQSendMessage(m_hqOutgoing, &propsMessage, NULL);
00690   }
00691 }
00692
00693
00694
00695
00696 void CDisdrawDlg::OnButtonAddQueue()
00697 {
00698   CWaitCursor wait;
00699   WCHAR wcsFormatName[MAX_FORMAT_NAME_LEN];
00700   UpdateData(TRUE);
00701   if (!m_fDsEnabledLocaly)
00702     m_iType = 1;
00703   if (0 == m_iType) // public queue
00704   {
00705
00706     m_strFriend.MakeUpper();
00707
00708     if (!LocateQueue(m_strFriend, wcsFormatName, MAX_FORMAT_NAME_LEN))
00709       {
00710         AfxMessageBox("No such friend queue was found.");
00711         return;
00712     }
00713
00714   }
00715   else
00716   {
00717     //
00718     // Connect to a computer in workgroup (direct) mode.
00719     //
00720
00721     //
00722     // Obtain the names of the friend queue and the remote computer.
00723     //
00724     m_strFriend.MakeUpper();
00725     m_strRemoteComputerName.MakeUpper();
00726
00727     //
00728     // Verify that the friend queue exists. Because we are connecting to
00729     // a private queue, we cannot obtain its format name through the DS,
00730     // and we shall asuume that it exists and shall try to open it.
00731     //
00732
00733
00734
00735     //
00736     // Form the format name.
00737     //
00738     char mbsFormatName[MAX_FORMAT_NAME_LEN];
00739     int n = _snprintf(mbsFormatName, MAX_FORMAT_NAME_LEN - 1, "DIRECT=OS:%s\\private$\\%s", (LPCTSTR)m_strRemoteComputerName, (LPCTSTR)m_strFriend);
00740     if(n < 0)
00741     {
00742       AfxMessageBox("The format name is too long for the buffer specified. Exiting...");
00743       exit(1);
00744     }
00745
00746     mbsFormatName[n] = L'\0';
00747     mbstowcs(wcsFormatName, mbsFormatName, MAX_FORMAT_NAME_LEN);
00748
00749   }
00750
00751   //
00752   // Make sure that there is enough space for the new format name.
00753   //
00754   if((wcslen(m_wcsFormatNameList) + wcslen(wcsFormatName) + 2) > m_iFormatNameList)
00755   {
00756     UINT iLength = m_iFormatNameList + FORMAT_NAME_LIST_LEN + 1;
00757
00758     WCHAR *tempList = new WCHAR[iLength];
00759     if (tempList == NULL)
00760     {
00761       AfxMessageBox("There is insufficient memory. Exiting...");
00762       exit(1);
00763     }
00764
00765     wcsncpy(tempList, m_wcsFormatNameList, iLength - 1);
00766     tempList[iLength - 1] = '\0';
00767
00768     m_iFormatNameList += FORMAT_NAME_LIST_LEN + 1;
00769     delete []  m_wcsFormatNameList;
00770     m_wcsFormatNameList = tempList;
00771   }
00772   if(m_wcsFormatNameList[0] != L'\0')
00773     wcsncat(m_wcsFormatNameList, L",", 1);
00774
00775   //
00776   // Add the new format name to the list.
00777   //
00778   wcsncat(m_wcsFormatNameList, wcsFormatName, wcslen(wcsFormatName) + 1);
00779
00780   m_btnAttach.EnableWindow(TRUE);
00781   strTitle = strTitle + " " + m_strFriend;
00782
00783 }
00784
00785
00786
00787
00788 void CDisdrawDlg::OnButtonAttach()
00789 {
00790
00791
00792   // Open the remote queue for sending.
00793
00794   HANDLE hqNewFriend;
00795   HRESULT hr = MQOpenQueue(m_wcsFormatNameList, MQ_SEND_ACCESS, MQ_DENY_NONE , &hqNewFriend);
00796   if (FAILED(hr))
00797     AfxMessageBox("The remote queue cannot be opened.");
00798
00799   else
00800   {
00801     //
00802     // Close the previous friend queue and update the window title.
00803     //
00804     if (m_hqOutgoing != NULL)
00805         {
00806       MQCloseQueue(m_hqOutgoing);
00807         }
00808     m_hqOutgoing = hqNewFriend;
00809
00810
00811     SetWindowText(strTitle);
00812     m_btnAttach.EnableWindow(FALSE);
00813   }
00814
00815   //
00816   // Hide the data.
00817   //
00818   m_cComputerLabel.ShowWindow(SW_HIDE);
00819   m_cQueueLabel.ShowWindow(SW_HIDE);
00820   m_cQueueFrame.ShowWindow(SW_HIDE);
00821   m_cComputerInput.ShowWindow(SW_HIDE);
00822   m_cQueueInput.ShowWindow(SW_HIDE);
00823   m_btnAttach.ShowWindow(SW_HIDE);
00824   m_cRadioPublic.ShowWindow(SW_HIDE);
00825   m_cRadioPrivate.ShowWindow(SW_HIDE);
00826   m_btnAddQueue.ShowWindow(SW_HIDE);
00827   m_cFriendFrame.ShowWindow(SW_HIDE);
00828
00829   //
00830   // Show the data.
00831   //
00832   m_cMessageFrame.ShowWindow(SW_SHOW);
00833   m_cRadioExpress.ShowWindow(SW_SHOW);
00834   m_cRadioRecoverable.ShowWindow(SW_SHOW);
00835
00836 }
00837
00838
00839
00840 void CDisdrawDlg::OnClose()
00841 {
00842   // TODO: Add your message handler code here and/or call teh default.
00843
00844   //
00845   // Close the open queues, if any exist.
00846   //
00847   if (m_hqIncoming != NULL)
00848     MQCloseQueue(m_hqIncoming);
00849
00850   if (m_hqOutgoing != NULL)
00851     MQCloseQueue(m_hqOutgoing);
00852
00853   CDialog::OnClose();
00854 }
00855
00856
00857
00858 BOOL CDisdrawDlg::OpenPrivateReceiveQueue()
00859 {
00860
00861     //
00862     // Form the path name of the receiving queue, making it private.
00863     //
00864     char mbsPathName[MQ_MAX_Q_NAME_LEN];
00865     DWORD dwNumChars = MQ_MAX_Q_NAME_LEN;
00866
00867   if(!GetComputerName(mbsPathName, &dwNumChars))
00868   {
00869     return FALSE;
00870   }
00871
00872   if(MQ_MAX_Q_NAME_LEN <= (dwNumChars + m_strLogin.GetLength() + 10))
00873   {
00874     return FALSE;
00875   }
00876   strncat(mbsPathName, "\\private$\\", 10);
00877   strncat(mbsPathName, m_strLogin,m_strLogin.GetLength());
00878
00879
00880     //
00881     // Prepare the receiving queue properties.
00882     //
00883     DWORD cProps = 0;
00884     QUEUEPROPID  aPropId[3];
00885     MQPROPVARIANT aPropVar[3];
00886   MQQUEUEPROPS propsQueue;
00887
00888   WCHAR wcsPathName[MQ_MAX_Q_NAME_LEN];
00889   mbstowcs(wcsPathName, mbsPathName, MQ_MAX_Q_NAME_LEN);
00890   aPropId[cProps]      = PROPID_Q_PATHNAME;
00891   aPropVar[cProps].vt    = VT_LPWSTR;
00892   aPropVar[cProps].pwszVal = wcsPathName;
00893   cProps++;
00894
00895   aPropId[cProps]      = PROPID_Q_TYPE;
00896   aPropVar[cProps].vt    = VT_CLSID;
00897   aPropVar[cProps].puuid   = &guidDrawType;
00898   cProps++;
00899
00900   WCHAR wcsLabel[MQ_MAX_Q_LABEL_LEN];
00901   mbstowcs(wcsLabel, m_strLogin, MQ_MAX_Q_LABEL_LEN);
00902   aPropId[cProps]      = PROPID_Q_LABEL;
00903   aPropVar[cProps].vt    = VT_LPWSTR;
00904   aPropVar[cProps].pwszVal = wcsLabel;
00905   cProps++;
00906
00907   propsQueue.cProp  = cProps;
00908   propsQueue.aPropID  = aPropId;
00909   propsQueue.aPropVar = aPropVar;
00910   propsQueue.aStatus  = NULL;
00911
00912
00913   //
00914   // Create the receiving queue.
00915   //
00916     WCHAR wcsFormatName[MAX_FORMAT_NAME_LEN];
00917   dwNumChars = MAX_FORMAT_NAME_LEN;
00918   HRESULT hr = MQCreateQueue(NULL, &propsQueue, wcsFormatName, &dwNumChars);
00919
00920
00921   if (FAILED(hr) && hr != MQ_ERROR_QUEUE_EXISTS)
00922     {
00923     return FALSE;
00924     }
00925
00926
00927     if( hr ==  MQ_ERROR_QUEUE_EXISTS)
00928     {
00929         //
00930       // If the receiving queue already exists, create a format name.
00931       //
00932
00933         WCHAR wcsLoginName[MQ_MAX_Q_NAME_LEN];
00934         mbstowcs(wcsLoginName, m_strLogin, MQ_MAX_Q_LABEL_LEN);
00935
00936     int n = _snwprintf(wcsFormatName, MAX_FORMAT_NAME_LEN-1, L"DIRECT=OS:.\\private$\\%s",wcsLoginName);
00937     if(n < 0)
00938     {
00939       AfxMessageBox("The format name is too long for the buffer specified. Exiting...");
00940       exit(1);
00941     }
00942     wcsFormatName[n] = L'\0';
00943
00944
00945     }
00946
00947     //
00948   // Open the receiving queue (a local private queue).
00949   //
00950
00951   hr = MQOpenQueue(wcsFormatName,
00952                              MQ_RECEIVE_ACCESS,
00953                              MQ_DENY_NONE ,
00954                              &m_hqIncoming);
00955
00956
00957   if (FAILED(hr))
00958     {
00959     return FALSE;
00960     }
00961     return TRUE;
00962
00963 }
00964
00965
00966
00967 void CDisdrawDlg::startReceiveUpdateThread()
00968 {
00969     DWORD dwThreadID=NULL;
00970     CreateThread(NULL,
00971                  0,
00972                  (LPTHREAD_START_ROUTINE)ReceiveUpdates,
00973                  this,
00974                  0,
00975                  &dwThreadID);
00976     if( dwThreadID == NULL)
00977     {
00978        MessageBox("The system failed to initialize the receiving queue.\nNo Drawing will be received.");
00979     }
00980
00981 }
00982
00983 void CDisdrawDlg::OnRadioPrivatequeue()
00984 {
00985     m_cComputerLabel.ShowWindow(SW_SHOW);
00986     m_cComputerInput.ShowWindow(SW_SHOW);
00987 }
00988
00989 void CDisdrawDlg::OnRadioPublicqueue()
00990 {
00991     m_cComputerLabel.ShowWindow(SW_HIDE);
00992     m_cComputerInput.ShowWindow(SW_HIDE);
00993 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropSheetLite Member List

This is the complete list of members for CPropSheetLite, including all inherited members.
AddPage(CPropPageLite *pCPropPageLite) | CPropSheetLite | [virtual]
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
CPropSheetLite(TCHAR *ptszTitle=NULL, HICON hIcon=NULL) | CPropSheetLite |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DoModal(HWND hWndParent, INT nStartPage=0) | CPropSheetLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_psHeader | CPropSheetLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CPropSheetLite() | CPropSheetLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IPluggableTransport Member List

This is the complete list of members for IPluggableTransport, including all inherited members.
CloseConnection([in] BSTR bstrConnectionID) | IPluggableTransport
CreateConnection([out] BSTR *pbstrConnectionID,[in] PLUGXPRT_CALL_TYPE eCaller,[in] DWORD dwProcessID,[in] HCOMMDEV hCommLink,[in] HEVENT hevtDataAvailable,[in] HEVENT hevtWriteReady,[in] HEVENT hevtConnectionClosed,[in] PLUGXPRT_FRAMING eFraming,[in] PLUGXPRT_PARAMETERS *pParams) | IPluggableTransport
DisableWinsock() | IPluggableTransport
EnableWinsock() | IPluggableTransport
Generated on Wed Nov 13 2024 16:57:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/mfc_tree/XMLTree.cpp Source File

  • Web
  • xml
  • mfc_tree

XMLTree.cpp

Go to the documentation of this file.
00001 //=--------------------------------------------------------------------------=
00002 //  (C) Copyright 1996 - 2000 Microsoft Corporation. All Rights Reserved.
00003 //=--------------------------------------------------------------------------=
00004
00005 // XMLTree.cpp : Defines the class behaviors for the application.
00006 //
00007
00008 #include "stdafx.h"
00009 #include "XMLTree.h"
00010 #include "XMLTreeDlg.h"
00011
00012 #ifdef _DEBUG
00013 #define new DEBUG_NEW
00014 #undef THIS_FILE
00015 static char THIS_FILE[] = __FILE__;
00016 #endif
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CXMLTreeApp
00020
00021 BEGIN_MESSAGE_MAP(CXMLTreeApp, CWinApp)
00022   //{{AFX_MSG_MAP(CXMLTreeApp)
00023     // NOTE - the ClassWizard will add and remove mapping macros here.
00024     //    DO NOT EDIT what you see in these blocks of generated code!
00025   //}}AFX_MSG
00026   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00027 END_MESSAGE_MAP()
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // CXMLTreeApp construction
00031
00032 CXMLTreeApp::CXMLTreeApp()
00033 {
00034   // TODO: add construction code here,
00035   // Place all significant initialization in InitInstance
00036 }
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // The one and only CXMLTreeApp object
00040
00041 CXMLTreeApp theApp;
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 // CXMLTreeApp initialization
00045
00046 BOOL CXMLTreeApp::InitInstance()
00047 {
00048   AfxEnableControlContainer();
00049
00050   // Standard initialization
00051   // If you are not using these features and wish to reduce the size
00052   //  of your final executable, you should remove from the following
00053   //  the specific initialization routines you do not need.
00054
00055 #ifdef _AFXDLL
00056   Enable3dControls();     // Call this when using MFC in a shared DLL
00057 #else
00058   Enable3dControlsStatic(); // Call this when linking to MFC statically
00059 #endif
00060
00061   CXMLTreeDlg dlg;
00062   m_pMainWnd = &dlg;
00063   int nResponse = dlg.DoModal();
00064   if (nResponse == IDOK)
00065   {
00066     // TODO: Place code here to handle when the dialog is
00067     //  dismissed with OK
00068   }
00069   else if (nResponse == IDCANCEL)
00070   {
00071     // TODO: Place code here to handle when the dialog is
00072     //  dismissed with Cancel
00073   }
00074
00075   // Since the dialog has been closed, return FALSE so that we exit the
00076   //  application, rather than start the application's message pump.
00077   return FALSE;
00078 }
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/DllServe.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

DllServe.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DLLSERVE.H
00003
00004   Summary:   Include file for the DLLSERVE.DLL dynamic link library.
00005              Intended primarily for external users of this DLL who
00006              exploit it via static linkage to the DllRegisterServer and
00007              DllUnregisterServer exported service calls.
00008
00009              For a comprehensive tutorial code tour of DLLSERVE's
00010              contents and offerings see the tutorial DLLSERVE.HTM file.
00011              For more specific technical details on the internal workings
00012              see the comments dispersed throughout the DLLSERVE source code.
00013
00014   Classes:   none.
00015
00016   Functions: DllRegisterServer, DllUnregisterServer.
00017
00018   Origin:    12-10-96: atrent - Editor-inheritance from COMOBJ.H in
00019                the COMOBJ Tutorial Code Sample. [Revised]
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(DLLSERVE_H)
00037 #define DLLSERVE_H
00038
00039 #if !defined(RC_INCLUDE)
00040
00041 #if !defined(_DLLEXPORT_)
00042
00043 // If _DLLEXPORT_ is NOT defined then the default is to import.
00044 #if defined(__cplusplus)
00045 #define DLLENTRY extern "C" __declspec(dllimport)
00046 #else
00047 #define DLLENTRY extern __declspec(dllimport)
00048 #endif
00049 #define STDENTRY DLLENTRY HRESULT WINAPI
00050 #define STDENTRY_(type) DLLENTRY type WINAPI
00051
00052 // Here is the list of server APIs offered by the DLL (using the
00053 // appropriate entry API declaration macros just #defined above).
00054
00055 STDENTRY DllRegisterServer(void);
00056
00057 STDENTRY DllUnregisterServer(void);
00058
00059 #else  // _DLLEXPORT_
00060
00061 // Else if _DLLEXPORT_ is indeed defined then we've been told to export.
00062 #if defined(__cplusplus)
00063 #define DLLENTRY extern "C" __declspec(dllexport)
00064 #else
00065 #define DLLENTRY __declspec(dllexport)
00066 #endif
00067 #define STDENTRY DLLENTRY HRESULT WINAPI
00068 #define STDENTRY_(type) DLLENTRY type WINAPI
00069
00070 #endif // _DLLEXPORT_
00071
00072 #endif // RC_INCLUDE
00073
00074 #endif // DLLSERVE_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/ClsFact.Cpp Source File

  • WinUI
  • Shell
  • BandObjs

ClsFact.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ClsFact.cpp
00013
00014    Description:   Implements CClassFactory.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "ClsFact.h"
00023 #include "Guid.h"
00024
00025 /**************************************************************************
00026    private function prototypes
00027 **************************************************************************/
00028
00029 /**************************************************************************
00030    global variables
00031 **************************************************************************/
00032
00033 ///////////////////////////////////////////////////////////////////////////
00034 //
00035 // IClassFactory implementation
00036 //
00037
00038 /**************************************************************************
00039
00040    CClassFactory::CClassFactory
00041
00042 **************************************************************************/
00043
00044 CClassFactory::CClassFactory(CLSID clsid)
00045 {
00046 m_clsidObject = clsid;
00047 m_ObjRefCount = 1;
00048 g_DllRefCount++;
00049 }
00050
00051 /**************************************************************************
00052
00053    CClassFactory::~CClassFactory
00054
00055 **************************************************************************/
00056
00057 CClassFactory::~CClassFactory()
00058 {
00059 g_DllRefCount--;
00060 }
00061
00062 /**************************************************************************
00063
00064    CClassFactory::QueryInterface
00065
00066 **************************************************************************/
00067
00068 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppReturn)
00069 {
00070 *ppReturn = NULL;
00071
00072 if(IsEqualIID(riid, IID_IUnknown))
00073    {
00074    *ppReturn = this;
00075    }
00076
00077 else if(IsEqualIID(riid, IID_IClassFactory))
00078    {
00079    *ppReturn = (IClassFactory*)this;
00080    }
00081
00082 if(*ppReturn)
00083    {
00084    (*(LPUNKNOWN*)ppReturn)->AddRef();
00085    return S_OK;
00086    }
00087
00088 return E_NOINTERFACE;
00089 }
00090
00091 /**************************************************************************
00092
00093    CClassFactory::AddRef
00094
00095 **************************************************************************/
00096
00097 STDMETHODIMP_(DWORD) CClassFactory::AddRef()
00098 {
00099 return ++m_ObjRefCount;
00100 }
00101
00102
00103 /**************************************************************************
00104
00105    CClassFactory::Release
00106
00107 **************************************************************************/
00108
00109 STDMETHODIMP_(DWORD) CClassFactory::Release()
00110 {
00111 if(--m_ObjRefCount == 0)
00112    {
00113    delete this;
00114    return 0;
00115    }
00116
00117 return m_ObjRefCount;
00118 }
00119
00120 /**************************************************************************
00121
00122    CClassFactory::CreateInstance
00123
00124 **************************************************************************/
00125
00126 STDMETHODIMP CClassFactory::CreateInstance(  LPUNKNOWN pUnknown,
00127                                              REFIID riid,
00128                                              LPVOID *ppObject)
00129 {
00130 HRESULT  hResult = E_FAIL;
00131 LPVOID   pTemp = NULL;
00132
00133 *ppObject = NULL;
00134
00135 if(pUnknown != NULL)
00136    return CLASS_E_NOAGGREGATION;
00137
00138 //create the proper object
00139 if(IsEqualCLSID(m_clsidObject, CLSID_SampleDeskBand))
00140    {
00141    CDeskBand *pDeskBand = new CDeskBand();
00142    if(NULL == pDeskBand)
00143       return E_OUTOFMEMORY;
00144
00145    pTemp = pDeskBand;
00146    }
00147
00148 else if(IsEqualCLSID(m_clsidObject, CLSID_SampleExplorerBar))
00149    {
00150    CExplorerBar *pExplorerBar = new CExplorerBar();
00151    if(NULL == pExplorerBar)
00152       return E_OUTOFMEMORY;
00153
00154    pTemp = pExplorerBar;
00155    }
00156
00157 else if(IsEqualCLSID(m_clsidObject, CLSID_SampleCommBand))
00158    {
00159    CCommBand *pCommBand = new CCommBand();
00160    if(NULL == pCommBand)
00161       return E_OUTOFMEMORY;
00162
00163    pTemp = pCommBand;
00164    }
00165
00166 else if(IsEqualCLSID(m_clsidObject, CLSID_SampleToolBand))
00167    {
00168    CToolBand *pToolBand = new CToolBand();
00169    if(NULL == pToolBand)
00170       return E_OUTOFMEMORY;
00171
00172    pTemp = pToolBand;
00173    }
00174
00175 if(pTemp)
00176    {
00177    //get the QueryInterface return for our return value
00178    hResult = ((LPUNKNOWN)pTemp)->QueryInterface(riid, ppObject);
00179
00180    //call Release to decement the ref count
00181    ((LPUNKNOWN)pTemp)->Release();
00182    }
00183
00184 return hResult;
00185 }
00186
00187 /**************************************************************************
00188
00189    CClassFactory::LockServer
00190
00191 **************************************************************************/
00192
00193 STDMETHODIMP CClassFactory::LockServer(BOOL)
00194 {
00195 return E_NOTIMPL;
00196 }
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/rcvall/resolve.c Source File

  • NetDS
  • WinSock
  • rcvall

resolve.c

Go to the documentation of this file.
00001 //
00002 // Common routines for resolving addresses and hostnames
00003 //
00004 // Files:
00005 //      resolve.c       - Common routines
00006 //      resolve.h       - Header file for common routines
00007 //
00008 // Description:
00009 //      This file contains common name resolution and name printing
00010 //      functions.
00011 //
00012 #include <winsock2.h>
00013 #include <ws2tcpip.h>
00014
00015 // This sample uses the new getaddrinfo/getnameinfo functions which are new to
00016 // Windows XP. To run this sample on older OSes, include the following header
00017 // file which makes it work automagically.
00018 #include <wspiapi.h>
00019
00020 #include <stdio.h>
00021 #include <stdlib.h>
00022
00023 #include "resolve.h"
00024
00025 //
00026 // Function: PrintAddress
00027 //
00028 // Description:
00029 //    This routine takes a SOCKADDR structure and its lenght and prints
00030 //    converts it to a string representation. This string is printed
00031 //    to the console via stdout.
00032 //
00033 int PrintAddress(SOCKADDR *sa, int salen)
00034 {
00035     char    host[NI_MAXHOST],
00036             serv[NI_MAXSERV];
00037     int     hostlen = NI_MAXHOST,
00038             servlen = NI_MAXSERV,
00039             rc = 0;
00040
00041     // Validate argument
00042     if (sa == NULL)
00043         return WSAEFAULT;
00044
00045     rc = getnameinfo(
00046             sa,
00047             salen,
00048             host,
00049             hostlen,
00050             serv,
00051             servlen,
00052             NI_NUMERICHOST | NI_NUMERICSERV
00053             );
00054     if (rc != 0)
00055     {
00056         fprintf(stderr, "%s: getnameinfo failed: %d\n", __FILE__, rc);
00057         return rc;
00058     }
00059
00060     // If the port is zero then don't print it
00061     if (strncmp(serv, "0", 1) != 0)
00062     {
00063         if (sa->sa_family == AF_INET6)
00064             printf("[%s]:%s", host, serv);
00065         else
00066             printf("%s:%s", host, serv);
00067     }
00068     else
00069         printf("%s", host);
00070
00071     return NO_ERROR;
00072 }
00073
00074 //
00075 // Function: FormatAddress
00076 //
00077 // Description:
00078 //    This is similar to the PrintAddress function except that instead of
00079 //    printing the string address to the console, it is formatted into
00080 //    the supplied string buffer.
00081 //
00082 int FormatAddress(SOCKADDR *sa, int salen, char *addrbuf, int addrbuflen)
00083 {
00084     char    host[NI_MAXHOST],
00085             serv[NI_MAXSERV];
00086     int     hostlen = NI_MAXHOST,
00087             servlen = NI_MAXSERV,
00088             rc = 0;
00089
00090     // Validate input
00091     if ((sa == NULL) || (addrbuf == NULL))
00092         return WSAEFAULT;
00093
00094     // Format the name
00095     rc = getnameinfo(
00096             sa,
00097             salen,
00098             host,
00099             hostlen,
00100             serv,
00101             servlen,
00102             NI_NUMERICHOST | NI_NUMERICSERV     // Convert to numeric representation
00103             );
00104     if (rc != 0)
00105     {
00106         fprintf(stderr, "%s: getnameinfo failed: %d\n", __FILE__, rc);
00107         return rc;
00108     }
00109     if ( (strlen(host) + strlen(serv) + 1) > (unsigned)addrbuflen)
00110         return WSAEFAULT;
00111     if (strncmp(serv, "0", 1) != 0)
00112     {
00113         if (sa->sa_family == AF_INET)
00114             _snprintf(addrbuf, addrbuflen-1, "%s:%s", host, serv);
00115         else if (sa->sa_family == AF_INET6)
00116             _snprintf(addrbuf, addrbuflen-1, "[%s]:%s", host, serv);
00117         else
00118             addrbuf[0] = '\0';
00119     }
00120     else
00121     {
00122         _snprintf(addrbuf, addrbuflen-1, "%s", host);
00123     }
00124
00125     return NO_ERROR;
00126 }
00127
00128 //
00129 // Function: ResolveAddress
00130 //
00131 // Description:
00132 //    This routine resolves the specified address and returns a list of addrinfo
00133 //    structure containing SOCKADDR structures representing the resolved addresses.
00134 //    Note that if 'addr' is non-NULL, then getaddrinfo will resolve it whether
00135 //    it is a string listeral address or a hostname.
00136 //
00137 struct addrinfo *ResolveAddress(char *addr, char *port, int af, int type, int proto)
00138 {
00139     struct addrinfo hints,
00140     *res = NULL;
00141     int             rc = 0;
00142
00143     memset(&hints, 0, sizeof(hints));
00144     hints.ai_flags  = ((addr) ? 0 : AI_PASSIVE);
00145     hints.ai_family = af; //((addr) ? AF_UNSPEC : af);
00146     hints.ai_socktype = type;
00147     hints.ai_protocol = proto;
00148
00149     rc = getaddrinfo(
00150             addr,
00151             port,
00152            &hints,
00153            &res
00154             );
00155     if (rc != 0)
00156     {
00157         printf("Invalid address %s, getaddrinfo failed: %d\n", addr, rc);
00158         return NULL;
00159     }
00160     return res;
00161 }
00162
00163 //
00164 // Function: ReverseLookup
00165 //
00166 // Description:
00167 //    This routine takes a SOCKADDR and does a reverse lookup for the name
00168 //    corresponding to that address.
00169 //
00170 int ReverseLookup(SOCKADDR *sa, int salen, char *buf, int buflen)
00171 {
00172     char    host[NI_MAXHOST] = {'\0'};
00173     int     hostlen=NI_MAXHOST,
00174             rc = 0;
00175
00176     // Validate parameters
00177     if ((sa == NULL) || (buf == NULL))
00178         return WSAEFAULT;
00179
00180     rc = getnameinfo(
00181             sa,
00182             salen,
00183             host,
00184             hostlen,
00185             NULL,
00186             0,
00187             0
00188             );
00189     if (rc != 0)
00190     {
00191         fprintf(stderr, "getnameinfo failed: %d\n", rc);
00192         return rc;
00193     }
00194
00195     strncpy(buf, host, buflen-1);
00196
00197     return NO_ERROR;
00198 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSimpSvrApp Member List

This is the complete list of members for CSimpSvrApp, including all inherited members.
CClassFactory | CSimpSvrApp | [friend]
ClearDoc() | CSimpSvrApp | [inline]
CSafeRefCount() | CSafeRefCount |
CSimpSvrApp() | CSimpSvrApp |
DecrementNestCount() | CSafeRefCount |
fInitApplication(HINSTANCE hInstance) | CSimpSvrApp |
fInitInstance(HINSTANCE hInstance, int nCmdShow, CClassFactory FAR *lpClassFactory) | CSimpSvrApp |
GetColorMenu() | CSimpSvrApp | [inline]
GetDoc() | CSimpSvrApp | [inline]
GethAppWnd() | CSimpSvrApp | [inline]
GetHelpMenu() | CSimpSvrApp | [inline]
GethInst() | CSimpSvrApp | [inline]
GetMainMenu() | CSimpSvrApp | [inline]
GetOleObject() | CSimpSvrApp | [inline]
GetRegisterClass() | CSimpSvrApp | [inline]
HideAppWnd() | CSimpSvrApp |
IncrementNestCount() | CSafeRefCount |
IsInitialized() | CSimpSvrApp | [inline]
IsInPlaceActive() | CSimpSvrApp |
IsStartedByOle() | CSimpSvrApp | [inline]
lCommandHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpSvrApp |
lCreateDoc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpSvrApp |
lSizeHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | CSimpSvrApp |
m_dwRegisterClass | CSimpSvrApp | [private]
m_fInitialized | CSimpSvrApp | [private]
m_fOleStdInit | CSimpSvrApp | [private]
m_fStartByOle | CSimpSvrApp | [private]
m_hAppWnd | CSimpSvrApp | [private]
m_hColorMenu | CSimpSvrApp | [private]
m_hHelpMenu | CSimpSvrApp | [private]
m_hInst | CSimpSvrApp | [private]
m_hMainMenu | CSimpSvrApp | [private]
m_lpDoc | CSimpSvrApp | [private]
m_OleObject | CSimpSvrApp | [private]
nullRect | CSimpSvrApp | [private]
PaintApp(HDC hDC) | CSimpSvrApp |
ParseCmdLine(LPSTR lpCmdLine) | CSimpSvrApp |
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CSimpSvrApp |
SafeAddRef() | CSafeRefCount |
SafeRelease() | CSafeRefCount |
SetStatusText() | CSimpSvrApp |
ShowAppWnd(int nCmdShow=SW_SHOWNORMAL) | CSimpSvrApp |
STDMETHODIMP_(ULONG) AddRef() | CSimpSvrApp |
STDMETHODIMP_(ULONG) Release() | CSimpSvrApp |
~CSafeRefCount() | CSafeRefCount | [virtual]
~CSimpSvrApp() | CSimpSvrApp |
Generated on Wed Nov 13 2024 16:57:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagDescInfo Member List

This is the complete list of members for tagDescInfo, including all inherited members.
cbValue | tagDescInfo
DefaultVal | tagDescInfo
fDefault | tagDescInfo
fGettable | tagDescInfo
fHeader | tagDescInfo
fSettable | tagDescInfo
NewValue | tagDescInfo
size | tagDescInfo
szDescFieldName | tagDescInfo
uwDescField | tagDescInfo
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpICreateRow Member List

This is the complete list of members for CImpICreateRow, including all inherited members.
CreateRow(IUnknown *pUnkOuter, LPCOLESTR pwszURL, DWORD dwBindFlags, REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession, DWORD *pdwBindStatus, LPOLESTR *ppwszNewURL, IUnknown **ppUnk) | CImpICreateRow
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CBinder, CImpICreateRow) | CImpICreateRow
Generated on Wed Nov 13 2024 16:56:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows.Net/module.cpp Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows.Net

module.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 1999
00005 //
00006 // File:        module.cpp
00007 //
00008 // Contents:    Cert Server Policy Module implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013 #pragma hdrstop
00014
00015 #include "celib.h"
00016 #include "module.h"
00017 #include "policy.h"
00018
00019
00020 STDMETHODIMP
00021 CCertManagePolicyModuleSample::GetProperty(
00022             /* [in] */ const BSTR strConfig,
00023             /* [in] */ BSTR strStorageLocation,
00024             /* [in] */ BSTR strPropertyName,
00025             /* [in] */ LONG Flags,
00026             /* [retval][out] */ VARIANT __RPC_FAR *pvarProperty)
00027 {
00028     LPWSTR szStr = NULL;
00029
00030     if (NULL == pvarProperty)
00031     {
00032         return E_POINTER;
00033     }
00034     VariantInit(pvarProperty);
00035
00036     if (strPropertyName == NULL)
00037         return S_FALSE;
00038
00039     if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_NAME))
00040         szStr = wsz_SAMPLE_NAME;
00041     else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_DESCRIPTION))
00042         szStr = wsz_SAMPLE_DESCRIPTION;
00043     else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_COPYRIGHT))
00044         szStr = wsz_SAMPLE_COPYRIGHT;
00045     else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_FILEVER))
00046         szStr = wsz_SAMPLE_FILEVER;
00047     else if (0 == _wcsicmp(strPropertyName, wszCMM_PROP_PRODUCTVER))
00048         szStr = wsz_SAMPLE_PRODUCTVER;
00049     else
00050         return S_FALSE;
00051
00052     pvarProperty->bstrVal = SysAllocString(szStr);
00053     if (NULL == pvarProperty->bstrVal)
00054         return E_OUTOFMEMORY;
00055
00056     pvarProperty->vt = VT_BSTR;
00057
00058     return S_OK;
00059 }
00060
00061 STDMETHODIMP
00062 CCertManagePolicyModuleSample::SetProperty(
00063             /* [in] */ const BSTR strConfig,
00064             /* [in] */ BSTR strStorageLocation,
00065             /* [in] */ BSTR strPropertyName,
00066             /* [in] */ LONG Flags,
00067             /* [in] */ VARIANT const __RPC_FAR *pvarProperty)
00068 {
00069      // no settable properties supported
00070      return S_FALSE;
00071 }
00072
00073 STDMETHODIMP
00074 CCertManagePolicyModuleSample::Configure(
00075             /* [in] */ const BSTR strConfig,
00076             /* [in] */ BSTR strStorageLocation,
00077             /* [in] */ LONG Flags)
00078 {
00079     MessageBox(NULL, L"No Configurable Options", NULL, MB_OK|MB_ICONINFORMATION);
00080
00081     return S_OK;
00082 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Class1 Member List

This is the complete list of members for Class1, including all inherited members.
main(String[] args) Class1 [inline, static]
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/stdafx.cpp Source File

  • Multimedia
  • Audio
  • multichan

stdafx.cpp

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 // stdafx.cpp : source file that includes just the standard includes
00006 //  multichan.pch will be the pre-compiled header
00007 //  stdafx.obj will contain the pre-compiled type information
00008
00009 #include "stdafx.h"
00010
00011
00012
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/common/rustring.cpp Source File

  • NetDS
  • RRas
  • rqs
  • common

rustring.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //  File:       RuString.cpp
00004 //
00005 //  Synopsis:   String helper functions
00006 //
00007 //  Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //---------------------------------------------------------------------------
00010 #ifndef _UNICODE
00011 #define _UNICODE
00012 #endif
00013
00014 #include "rasutil.h"
00015 #include "RuString.h"
00016
00017 //+----------------------------------------------------------------------------
00018 //
00019 //  Synopsis:   worker fn for WideChar -> Multibyte conversions
00020 //
00021 //-----------------------------------------------------------------------------
00022 static HRESULT
00023 RuStringWideToNarrowInternal(
00024     IN      PWSTR   psz,
00025     IN OUT  PSTR *  ppszansi,
00026     IN      UINT    cchansi,
00027     IN      UINT    CodePage
00028 )
00029 {
00030     HRESULT hr = S_OK;
00031
00032     if (cchansi == 0)
00033     {
00034         // we allocate memory
00035         cchansi = WideCharToMultiByte(CodePage, 0, psz, -1, NULL, 0, NULL, NULL);
00036         *ppszansi = (PSTR) RuAlloc(cchansi * sizeof(CHAR), FALSE);
00037     }
00038
00039     if (!WideCharToMultiByte(CodePage, 0, psz, -1, *ppszansi, cchansi, NULL, NULL))
00040     {
00041         hr = HRESULT_FROM_WIN32(GetLastError());
00042     }
00043
00044     return hr;
00045 }
00046
00047 //+----------------------------------------------------------------------------
00048 //
00049 //  Synopsis:   Converts Unicode to Ansi with alloc
00050 //
00051 //-----------------------------------------------------------------------------
00052 PSTR
00053 RuStringDupWtoA(
00054     IN      PWSTR   psz
00055 )
00056 {
00057     PSTR    pszansi = NULL;
00058     HRESULT hr = RuStringWideToNarrowInternal(psz, &pszansi, 0, CP_ACP);
00059     return ((hr == S_OK) ? pszansi : NULL);
00060 }
00061
00062
00063 //+----------------------------------------------------------------------------
00064 //
00065 //  Synopsis:   worker fn for Multibyte -> WideChar conversions
00066 //
00067 //-----------------------------------------------------------------------------
00068 static HRESULT
00069 RuStringNarrowToWideInternal(
00070     IN      PSTR    pszansi,
00071     IN      UINT    CodePage,
00072     IN OUT  PWSTR * ppsz,
00073     IN      UINT    cch
00074 )
00075 {
00076     HRESULT hr = S_OK;
00077
00078     if (cch == 0)
00079     {
00080         // we allocate memory
00081         cch = MultiByteToWideChar(CodePage, 0, pszansi, -1, NULL, 0);
00082         *ppsz = (PWSTR) RuAlloc(cch * sizeof(WCHAR), FALSE);
00083     }
00084
00085     if (!MultiByteToWideChar(CodePage, 0, pszansi, -1, *ppsz, cch))
00086     {
00087         hr = HRESULT_FROM_WIN32(GetLastError());
00088     }
00089
00090     return hr;
00091 }
00092
00093 //+----------------------------------------------------------------------------
00094 //
00095 //  Synopsis:   Converts Ansi to Unicode with alloc
00096 //
00097 //-----------------------------------------------------------------------------
00098 PWSTR
00099 RuStringDupAtoW(
00100     IN      PSTR    pszansi
00101 )
00102 {
00103     PWSTR psz = NULL;
00104     HRESULT hr = RuStringNarrowToWideInternal(pszansi, CP_ACP, &psz, 0);
00105     return ((hr == S_OK) ? psz : NULL);
00106 }
00107
00108
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/setup.exe/setup.cpp Source File

  • SysMgmt
  • Msi
  • setup.exe

setup.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       setup.cpp
00006 //
00007 //--------------------------------------------------------------------------
00008
00009 #define WIN // scope W32 API
00010 #define MSI // scope MSI API
00011
00012 #include <windows.h>
00013 #include <tchar.h>
00014 #include <assert.h>
00015 #include <strsafe.h>
00016
00017 // internet download
00018 #include "wininet.h"  // DeleteUrlCacheEntry, InternetCanonicalizeUrl
00019 #include "urlmon.h"   // URLDownloadToCacheFile
00020
00021 // package trust
00022 #include "wintrust.h"
00023 #include "softpub.h"
00024
00025 // msi installation
00026 #include "msidefs.h"
00027 #include "msiquery.h"
00028 #include "msi.h"
00029
00030 // setup.exe
00031 #include "common.h"
00032 #include "setup.h"
00033 #include "setupui.h"
00034 #include "resource.h"
00035
00036 //--------------------------------------------------------------------------------------
00037 // MSI API -- delay load
00038 //--------------------------------------------------------------------------------------
00039
00040 #define MSI_DLL "msi.dll"
00041
00042 #define MSIAPI_MsiSetInternalUI "MsiSetInternalUI"
00043 typedef INSTALLUILEVEL (WINAPI* PFnMsiSetInternalUI)(INSTALLUILEVEL dwUILevel, HWND *phWnd);
00044
00045 #define MSIAPI_MsiInstallProduct "MsiInstallProductA"
00046 typedef UINT (WINAPI* PFnMsiInstallProduct)(LPCSTR szPackagePath, LPCSTR szCommandLine);
00047
00048 #define MSIAPI_MsiApplyPatch "MsiApplyPatchA"
00049 typedef UINT (WINAPI* PFnMsiApplyPatch)(LPCSTR szPatchPackage, LPCSTR szInstallPackage, INSTALLTYPE eInstallType, LPCSTR szCommandLine);
00050
00051 #define MSIAPI_MsiReinstallProduct "MsiReinstallProductA"
00052 typedef UINT (WINAPI* PFnMsiReinstallProduct)(LPCSTR szProduct, DWORD dwReinstallMode);
00053
00054 #define MSIAPI_MsiQueryProductState "MsiQueryProductStateA"
00055 typedef INSTALLSTATE (WINAPI* PFnMsiQueryProductState)(LPCSTR szProduct);
00056
00057 #define MSIAPI_MsiOpenDatabase "MsiOpenDatabaseA"
00058 typedef UINT (WINAPI* PFnMsiOpenDatabase)(LPCSTR szDatabasePath, LPCSTR szPersist, MSIHANDLE *phDatabase);
00059
00060 #define MSIAPI_MsiDatabaseOpenView "MsiDatabaseOpenViewA"
00061 typedef UINT (WINAPI* PFnMsiDatabaseOpenView)(MSIHANDLE hDatabase, LPCSTR szQuery, MSIHANDLE *phView);
00062
00063 #define MSIAPI_MsiViewExecute "MsiViewExecute"
00064 typedef UINT (WINAPI* PFnMsiViewExecute)(MSIHANDLE hView, MSIHANDLE hRecord);
00065
00066 #define MSIAPI_MsiViewFetch "MsiViewFetch"
00067 typedef UINT (WINAPI* PFnMsiViewFetch)(MSIHANDLE hView, MSIHANDLE *phRecord);
00068
00069 #define MSIAPI_MsiRecordGetString "MsiRecordGetStringA"
00070 typedef UINT (WINAPI* PFnMsiRecordGetString)(MSIHANDLE hRecord, unsigned int uiField, LPSTR szValue, DWORD *pcchValueBuf);
00071
00072 #define MSIAPI_MsiCloseHandle "MsiCloseHandle"
00073 typedef UINT (WINAPI* PFnMsiCloseHandle)(MSIHANDLE h);
00074
00075 const DWORD lcidLOCALE_INVARIANT = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
00076
00077 /////////////////////////////////////////////////////////////////////////////
00078 // WinMain -- Application Entry Point
00079 //
00080
00081 extern "C" int __stdcall WinMain(HINSTANCE hInst, HINSTANCE hPrevInst , LPSTR lpszCmdLine, int nCmdShow)
00082 {
00083
00084 //-----------------------------------------------------------------------------------------------------------------
00085 //  VARIABLES
00086 //
00087 //-----------------------------------------------------------------------------------------------------------------
00088     UINT    uiRet = ERROR_SUCCESS;
00089     HRESULT hr    = S_OK;
00090
00091     char *szMsiFile          = 0;
00092     char *szBaseURL          = 0;
00093     char *szInstallPath      = 0;
00094     char *szMsiCacheFile     = 0;
00095     char *szOperation        = 0;
00096     char *szProductName      = 0;
00097     char *szMinimumMsi       = 0;
00098     char *szProperties       = 0;
00099     char *szInstProperties   = 0;
00100     char *szTempPath         = 0;
00101     char *szFilePart         = 0;
00102     char *szBase             = 0;
00103     char *szUpdate           = 0;
00104
00105     char *szRegisteredMsiFolder = 0;
00106     char *szMsiDllLocation      = 0;
00107
00108     char szAppTitle[MAX_STR_CAPTION]    = {0};
00109     char szError[MAX_STR_LENGTH]        = {0};
00110     char szText[MAX_STR_CAPTION]        = {0};
00111     char szBanner[MAX_STR_LENGTH]       = {0};
00112     char szAction[MAX_STR_LENGTH]       = {0};
00113     char szUserPrompt[MAX_STR_LENGTH]   = {0};
00114     char szProductCode[MAX_LENGTH_GUID] = {0};
00115
00116     char szModuleFile[MAX_PATH]         = {0};
00117     DWORD dwModuleFileSize       = MAX_PATH;
00118
00119     DWORD dwMsiFileSize          = 0;
00120     DWORD dwBaseURLSize          = 0;
00121     DWORD cchInstallPath         = 0;
00122     DWORD dwMsiCacheFileSize     = 0;
00123     DWORD dwOperationSize        = 0;
00124     DWORD dwProductNameSize      = 0;
00125     DWORD dwMinimumMsiSize       = 0;
00126     DWORD dwPropertiesSize       = 0;
00127     DWORD cchInstProperties      = 0;
00128     DWORD cchTempPath            = 0;
00129     DWORD dwLastError            = 0;
00130     DWORD cchReturn              = 0;
00131     DWORD dwBaseUpdateSize      = 0;
00132     DWORD dwUpdateSize          = 0;
00133     DWORD dwResult               = 0;
00134     DWORD dwType                 = 0;
00135     DWORD dwProductCodeSize      = MAX_LENGTH_GUID;
00136
00137     DWORD dwRegisteredMsiFolderSize  = 0;
00138     DWORD dwMsiDllLocationSize       = 0;
00139
00140     ULONG ulMsiMinVer        = 0;
00141     char *szStopScan         = NULL;
00142
00143     bool        fDelayRebootReq    = false;
00144     bool        fPatch             = false;
00145     bool        fQFE               = false;
00146     bool        fOSSupported       = false;
00147     emEnum      emExecMode         = emPreset;
00148
00149     HKEY hInstallerKey = 0;
00150
00151     HMODULE hMsi = 0;
00152     PFnMsiSetInternalUI pfnMsiSetInternalUI = 0;
00153     PFnMsiInstallProduct pfnMsiInstallProduct = 0;
00154     PFnMsiApplyPatch pfnMsiApplyPatch = 0;
00155     PFnMsiReinstallProduct pfnMsiReinstallProduct = 0;
00156     PFnMsiQueryProductState pfnMsiQueryProductState = 0;
00157     PFnMsiOpenDatabase pfnMsiOpenDatabase = 0;
00158     PFnMsiDatabaseOpenView pfnMsiDatabaseOpenView = 0;
00159     PFnMsiViewExecute pfnMsiViewExecute = 0;
00160     PFnMsiViewFetch pfnMsiViewFetch = 0;
00161     PFnMsiRecordGetString pfnMsiRecordGetString = 0;
00162     PFnMsiCloseHandle pfnMsiCloseHandle = 0;
00163
00164     MSIHANDLE hDatabase = 0;
00165     MSIHANDLE hView = 0;
00166     MSIHANDLE hRec = 0;
00167
00168     INSTALLSTATE isProduct = INSTALLSTATE_UNKNOWN;
00169
00170     const char * szAdminImagePath = 0;
00171
00172
00173
00174 //-----------------------------------------------------------------------------------------------------------------
00175 //-----------------------------------------------------------------------------------------------------------------
00176     // create our UI object
00177     CDownloadUI DownloadUI;
00178
00179     // Load our AppTitle (caption)
00180     WIN::LoadString(hInst, IDS_APP_TITLE, szAppTitle, sizeof(szAppTitle)/sizeof(char));
00181
00182     // Obtain path we are running from
00183     if (0 == WIN::GetModuleFileName(hInst, szModuleFile, dwModuleFileSize))
00184     {
00185         // No UI displayed. Silent failure.
00186         uiRet = GetLastError();
00187         goto CleanUp;
00188     }
00189     DebugMsg("[Info] we are running from --> %s\n", szModuleFile);
00190
00191     // Figure out what we want to do
00192     emExecMode = GetExecutionMode (lpszCmdLine);
00193
00194     if (emVerify == emExecMode)
00195     {
00196         //
00197         // We don't want any UI to be displayed in this case. The return value
00198         // from the exe is the result of the verification. Therefore, this
00199         // should be done before initializing the UI.
00200         //
00201         uiRet = VerifyFileSignature (szModuleFile, lpszCmdLine);
00202         if (ERROR_BAD_ARGUMENTS != uiRet)
00203             goto CleanUp;
00204     }
00205
00206     if (ERROR_BAD_ARGUMENTS == uiRet || emHelp == emExecMode)
00207     {
00208         DisplayUsage(hInst, NULL, szAppTitle);
00209         goto CleanUp;
00210     }
00211
00212     //
00213     // NOTE:
00214     // Delay handling admin. installs until we have determined if we are
00215     // patching an existing install or if we are doing a default install.
00216     //
00217
00218     // initialize our UI object with desktop as parent
00219     DownloadUI.Initialize(hInst, /* hwndParent = */ 0, szAppTitle);
00220
00221     // Check if we are installing on an OS that supports Windows Installer 3.0
00222     fOSSupported = IsOSSupported();
00223     if(!fOSSupported)
00224     {
00225         PostError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_OS_NOT_SUPPORTED);
00226         uiRet = ERROR_INSTALL_FAILURE;
00227         goto CleanUp;
00228     }
00229
00230     // only run one instance at a time
00231     if (AlreadyInProgress())
00232     {
00233         // silently return - correct return code ?
00234         return ERROR_INSTALL_ALREADY_RUNNING;
00235     }
00236
00237     // determine operation, default (if not present) is INSTALL
00238     if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_OPERATION, &szOperation, dwOperationSize)))
00239     {
00240         ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00241         goto CleanUp;
00242     }
00243     if (ERROR_SUCCESS != uiRet)
00244     {
00245         // set operation to default which is install
00246         if (!szOperation)
00247         {
00248             szOperation = new char[lstrlen(szDefaultOperation) + 1];
00249             if (!szOperation)
00250             {
00251                 ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00252                 goto CleanUp;
00253             }
00254         }
00255         if (lstrlen(szOperation) <= lstrlen(szDefaultOperation))
00256         {
00257             delete [] szOperation;
00258             szOperation = new char[lstrlen(szDefaultOperation) + 1];
00259             if (!szOperation)
00260             {
00261                 ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00262                 goto CleanUp;
00263             }
00264         }
00265         lstrcpy(szOperation, szDefaultOperation);
00266     }
00267
00268     // obtain name of product
00269     if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_PRODUCTNAME, &szProductName, dwProductNameSize)))
00270     {
00271         ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00272         goto CleanUp;
00273     }
00274     if (ERROR_SUCCESS != uiRet)
00275     {
00276         // use default
00277         WIN::LoadString(hInst, IDS_DEFAULT_PRODUCT, szProductName, MAX_STR_CAPTION);
00278     }
00279
00280     // set banner text
00281     WIN::LoadString(hInst, IDS_BANNER_TEXT, szText, MAX_STR_CAPTION);
00282     StringCchPrintf(szBanner, sizeof(szBanner), szText, szProductName);
00283     if (irmCancel == DownloadUI.SetBannerText(szBanner))
00284     {
00285         ReportUserCancelled(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00286         uiRet = ERROR_INSTALL_USEREXIT;
00287         goto CleanUp;
00288     }
00289
00290     // Determine if this is a patch or a normal install.
00291     if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_DATABASE, &szMsiFile, dwMsiFileSize)))
00292     {
00293         ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00294         goto CleanUp;
00295     }
00296     else if (ERROR_SUCCESS != uiRet)
00297     {
00298         // look for patch
00299         if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_PATCH, &szMsiFile, dwMsiFileSize)))
00300         {
00301             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00302             goto CleanUp;
00303         }
00304         else if (ERROR_SUCCESS != uiRet)
00305         {
00306             PostResourceNotFoundError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, ISETUPPROPNAME_DATABASE);
00307             goto CleanUp;
00308         }
00309
00310         fPatch = true;
00311     }
00312
00313     //
00314     // If we are here, this is either an admin. install or a default install.
00315     // File signature verification, help and other invalid parameters have
00316     // already been taken care of above.
00317     //
00318     if (emAdminInstall == emExecMode)
00319     {
00320         uiRet = GetAdminInstallInfo (fPatch, lpszCmdLine, &szAdminImagePath);
00321         if (ERROR_BAD_ARGUMENTS == uiRet)
00322         {
00323             DisplayUsage(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00324             goto CleanUp;
00325         }
00326     }
00327
00328     //
00329     // At this point, the validation of the commandline arguments is complete
00330     // and we have all the information we need.
00331     //
00332
00333     // obtain minimum required MSI version
00334     if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_MINIMUM_MSI, &szMinimumMsi, dwMinimumMsiSize)))
00335     {
00336         ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00337         goto CleanUp;
00338     }
00339     else if (ERROR_SUCCESS != uiRet)
00340     {
00341         PostResourceNotFoundError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, ISETUPPROPNAME_MINIMUM_MSI);
00342         goto CleanUp;
00343     }
00344
00345     // make sure required Msi version is a valid value -- must be >= 150
00346     ulMsiMinVer = strtoul(szMinimumMsi, &szStopScan, 10);
00347     if (!szStopScan || (szStopScan == szMinimumMsi) || (*szStopScan != 0) || ulMsiMinVer < MINIMUM_SUPPORTED_MSI_VERSION)
00348     {
00349         // invalid minimum version string
00350         PostError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_INVALID_VER_STR, szMinimumMsi, MINIMUM_SUPPORTED_MSI_VERSION);
00351         uiRet = ERROR_INVALID_PARAMETER;
00352         goto CleanUp;
00353     }
00354
00355     DebugMsg("[Resource] Minimum Msi Value = %d\n", ulMsiMinVer);
00356
00357     // compare minimum required MSI version to that which is on the machine
00358     if (IsMsiUpgradeNecessary(ulMsiMinVer))
00359     {
00360         DebugMsg("[Info] Upgrade of Windows Installer is requested\n");
00361
00362         // make sure this is admin -- must have admin priviledges to upgrade Windows Installer
00363         if (!IsAdmin())
00364         {
00365             PostError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_REQUIRES_ADMIN_PRIV);
00366             uiRet = ERROR_INSTALL_FAILURE;
00367             goto CleanUp;
00368         }
00369
00370         // Ask the user if they want to upgrade the installer
00371         WIN::LoadString(hInst, IDS_ALLOW_MSI_UPDATE, szUserPrompt, MAX_STR_LENGTH);
00372         if (IDYES != WIN::MessageBox(DownloadUI.GetCurrentWindow(), szUserPrompt, szAppTitle, MB_YESNO|MB_ICONQUESTION))
00373         {
00374             // user decided to cancel
00375             ReportUserCancelled(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00376             uiRet = ERROR_INSTALL_USEREXIT;
00377             goto CleanUp;
00378         }
00379
00380         if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_UPDATE, &szUpdate, dwUpdateSize)))
00381         {
00382             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00383             goto CleanUp;
00384         }
00385         else if (ERROR_SUCCESS != uiRet)
00386         {
00387             PostResourceNotFoundError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, ISETUPPROPNAME_UPDATE);
00388             goto CleanUp;
00389         }
00390
00391         // determine if we need to download the Windows Installer update package from the web -- based on presence of UPDATELOCATION property
00392         if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_UPDATELOCATION, &szBase, dwBaseUpdateSize)))
00393         {
00394             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00395             goto CleanUp;
00396         }
00397         else if (ERROR_SUCCESS == uiRet)
00398         {
00399             // presence of UPDATELOCATION property indicates assumption of URL source
00400             if (ERROR_SUCCESS != (uiRet = DownloadAndUpgradeMsi(hInst, &DownloadUI, szAppTitle, szBase, szUpdate, szModuleFile, ulMsiMinVer)))
00401             {
00402                 if (ERROR_SUCCESS_REBOOT_REQUIRED == uiRet)
00403                 {
00404                     // successful, but must reboot at end
00405                     fDelayRebootReq = true;
00406                 }
00407                 else
00408                     goto CleanUp;
00409             }
00410         }
00411         else
00412         {
00413             // lack of UPDATELOCATION property indicates assumption of Media source
00414             if (ERROR_SUCCESS != (uiRet = UpgradeMsi(hInst, &DownloadUI, szAppTitle, szModuleFile, szUpdate, ulMsiMinVer)))
00415             {
00416                 if (ERROR_SUCCESS_REBOOT_REQUIRED == uiRet)
00417                 {
00418                     // successful, but must reboot at end
00419                     fDelayRebootReq = true;
00420                 }
00421                 else
00422                     goto CleanUp;
00423             }
00424         }
00425     }
00426
00427     DebugMsg("[Info] Windows Installer has been upgraded, or was already correct version\n");
00428
00429     // perform some extra authoring validation
00430     if (fPatch
00431         && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szMinPatchOperation, -1)
00432         && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szMajPatchOperation, -1)
00433         && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szDefaultOperation, -1))
00434     {
00435         // wrong operation
00436         DebugMsg("[Error] Operation %s is not valid for a patch\n", szOperation);
00437         PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_INVALID_OPERATION, szOperation);
00438         uiRet = ERROR_INVALID_PARAMETER;
00439         goto CleanUp;
00440     }
00441     else if (!fPatch
00442         && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szInstallOperation, -1)
00443         && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szInstallUpdOperation, -1)
00444         && CSTR_EQUAL != CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szDefaultOperation, -1))
00445     {
00446         // wrong operation
00447         DebugMsg("[Error] Operation %s is not valid for a package\n", szOperation);
00448         PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_INVALID_OPERATION, szOperation);
00449         uiRet = ERROR_INVALID_PARAMETER;
00450         goto CleanUp;
00451     }
00452
00453     // by now we either have a MSI or a MSP
00454     if (CSTR_EQUAL == CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szMinPatchOperation, -1)
00455         || CSTR_EQUAL == CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szInstallUpdOperation, -1)
00456         || (fPatch && CSTR_EQUAL == CompareString(lcidLOCALE_INVARIANT, NORM_IGNORECASE, szOperation, -1, szDefaultOperation, -1)))
00457         fQFE = true;
00458
00459     // obtain base URL
00460     if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_BASEURL, &szBaseURL, dwBaseURLSize)))
00461     {
00462         ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00463         goto CleanUp;
00464     }
00465     else if (ERROR_SUCCESS == uiRet)
00466     {
00467         // presence of BASEURL property indicates assumption of URL source . . .
00468
00469         // generate the path to the installation package == baseURL + msiFile
00470         //   note: msiFile is a relative path
00471         cchTempPath = lstrlen(szBaseURL) + lstrlen(szMsiFile) + 2; // 1 for slash, 1 for null
00472         szTempPath = new char[cchTempPath ];
00473         if (!szTempPath)
00474         {
00475             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00476             uiRet = ERROR_OUTOFMEMORY;
00477             goto CleanUp;
00478         }
00479         lstrcpy(szTempPath, szBaseURL);
00480         // check for trailing slash on szBaseURL
00481         char *pch = szBaseURL + lstrlen(szBaseURL) + 1; // put at null terminator
00482         pch = CharPrev(szBaseURL, pch);
00483         if (*pch != '/')
00484             lstrcat(szTempPath, szUrlPathSep);
00485         lstrcat(szTempPath, szMsiFile);
00486
00487         // canocialize the URL path
00488         cchInstallPath = cchTempPath*2;
00489         szInstallPath = new char[cchInstallPath];
00490         if (!szInstallPath)
00491         {
00492             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00493             uiRet = ERROR_OUTOFMEMORY;
00494             goto CleanUp;
00495         }
00496
00497         dwLastError = 0; // success
00498         if (!InternetCanonicalizeUrl(szTempPath, szInstallPath, &cchInstallPath, 0))
00499         {
00500             dwLastError = GetLastError();
00501             if (ERROR_INSUFFICIENT_BUFFER == dwLastError)
00502             {
00503                 // try again
00504                 delete [] szInstallPath;
00505                 szInstallPath = new char[cchInstallPath];
00506                 if (!szInstallPath)
00507                 {
00508                     ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00509                     uiRet = ERROR_OUTOFMEMORY;
00510                     goto CleanUp;
00511                 }
00512                 dwLastError = 0; // reset to success for 2nd attempt
00513                 if (!InternetCanonicalizeUrl(szTempPath, szInstallPath, &cchInstallPath, 0))
00514                     dwLastError = GetLastError();
00515             }
00516         }
00517         if (0 != dwLastError)
00518         {
00519             // error -- invalid path/Url
00520             PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_INVALID_PATH, szTempPath);
00521             uiRet = dwLastError;
00522             goto CleanUp;
00523         }
00524
00525         // set action text for download
00526         WIN::LoadString(hInst, IDS_DOWNLOADING_PACKAGE, szText, MAX_STR_CAPTION);
00527         StringCchPrintf(szAction, sizeof(szAction), szText, szMsiFile);
00528         if (irmCancel == DownloadUI.SetActionText(szAction))
00529         {
00530             ReportUserCancelled(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00531             uiRet = ERROR_INSTALL_USEREXIT;
00532             goto CleanUp;
00533         }
00534
00535         // download the msi file so we can attempt a trust check -- must be local for WinVerifyTrust
00536         DebugMsg("[Info] Downloading msi file %s for WinVerifyTrust check\n", szInstallPath);
00537
00538         szMsiCacheFile = new char[MAX_PATH];
00539         dwMsiCacheFileSize = MAX_PATH;
00540         if (!szMsiCacheFile)
00541         {
00542             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00543             uiRet = ERROR_OUTOFMEMORY;
00544             goto CleanUp;
00545         }
00546
00547         hr = WIN::URLDownloadToCacheFile(NULL, szInstallPath, szMsiCacheFile, dwMsiCacheFileSize, 0, /* IBindStatusCallback = */ &CDownloadBindStatusCallback(&DownloadUI));
00548         if (DownloadUI.HasUserCanceled())
00549         {
00550             ReportUserCancelled(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00551             uiRet = ERROR_INSTALL_USEREXIT;
00552             goto CleanUp;
00553         }
00554         if (FAILED(hr))
00555         {
00556             // error during download -- probably because file not found (or lost connection)
00557             PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_NOMSI, szInstallPath);
00558             uiRet = ERROR_FILE_NOT_FOUND;
00559             goto CleanUp;
00560         }
00561
00562         DebugMsg("[Info] Msi file was cached to %s\n", szMsiCacheFile);
00563
00564         // set action text for trust verification
00565         WIN::LoadString(hInst, IDS_VALIDATING_SIGNATURE, szText, MAX_STR_CAPTION);
00566         StringCchPrintf(szAction, sizeof(szAction), szText, szMsiFile);
00567         if (irmCancel == DownloadUI.SetActionText(szAction))
00568         {
00569             ReportUserCancelled(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00570             uiRet = ERROR_INSTALL_USEREXIT;
00571             goto CleanUp;
00572         }
00573
00574         // perform trust check
00575         itvEnum itv = IsPackageTrusted(szModuleFile, szMsiCacheFile, DownloadUI.GetCurrentWindow());
00576         if (itvWintrustNotOnMachine == itv)
00577         {
00578             PostError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_NO_WINTRUST);
00579             uiRet = ERROR_CALL_NOT_IMPLEMENTED;
00580             goto CleanUp;
00581         }
00582         else if (itvUnTrusted == itv)
00583         {
00584             PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_UNTRUSTED, szInstallPath);
00585             uiRet = HRESULT_CODE(TRUST_E_SUBJECT_NOT_TRUSTED);
00586             goto CleanUp;
00587         }
00588     }
00589     else
00590     {
00591         // lack of BASEURL property indicates assumption of Media source
00592
00593         // generate the path to the Msi file =  szModuleFile + msiFile
00594         //   note: msiFile is a relative path
00595         cchTempPath = lstrlen(szModuleFile) + lstrlen(szMsiFile) + 2; // 1 for null terminator, 1 for back slash
00596         szTempPath = new char[cchTempPath];
00597         if (!szTempPath)
00598         {
00599             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00600             uiRet = ERROR_OUTOFMEMORY;
00601             goto CleanUp;
00602         }
00603
00604         // find 'setup.exe' in the path so we can remove it
00605         if (0 == GetFullPathName(szModuleFile, cchTempPath, szTempPath, &szFilePart))
00606         {
00607             uiRet = GetLastError();
00608             PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_INVALID_PATH, szTempPath);
00609             goto CleanUp;
00610         }
00611         if (szFilePart)
00612             *szFilePart = '\0';
00613
00614         lstrcat(szTempPath, szMsiFile);
00615
00616         cchInstallPath = 2*cchTempPath;
00617         szInstallPath = new char[cchInstallPath];
00618         if (!szInstallPath)
00619         {
00620             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00621             uiRet = ERROR_OUTOFMEMORY;
00622             goto CleanUp;
00623         }
00624
00625         // normalize the path
00626         cchReturn = GetFullPathName(szTempPath, cchInstallPath, szInstallPath, &szFilePart);
00627         if (cchReturn > cchInstallPath)
00628         {
00629             // try again, with larger buffer
00630             delete [] szInstallPath;
00631             cchInstallPath = cchReturn;
00632             szInstallPath = new char[cchInstallPath];
00633             if (!szInstallPath)
00634             {
00635                 ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00636                 uiRet = ERROR_OUTOFMEMORY;
00637                 goto CleanUp;
00638             }
00639             cchReturn = GetFullPathName(szTempPath, cchInstallPath, szInstallPath, &szFilePart);
00640         }
00641         if (0 == cchReturn)
00642         {
00643             // error -- invalid path
00644             PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_INVALID_PATH, szTempPath);
00645             uiRet = dwLastError;
00646             goto CleanUp;
00647         }
00648
00649         // no download is necessary -- but we can check for the file's existence
00650         DWORD dwFileAttrib = GetFileAttributes(szInstallPath);
00651         if (0xFFFFFFFF == dwFileAttrib)
00652         {
00653             // package is missing
00654             PostFormattedError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_NOMSI, szInstallPath);
00655             uiRet = ERROR_FILE_NOT_FOUND;
00656             goto CleanUp;
00657         }
00658     }
00659
00660     //
00661     // good to go -- terminate our UI and let the Windows Installer take over
00662     //
00663
00664     // retrieve the optional command line PROPERTY = VALUE strings if available
00665     if (ERROR_OUTOFMEMORY == (uiRet = SetupLoadResourceString(hInst, ISETUPPROPNAME_PROPERTIES, &szProperties, dwPropertiesSize)))
00666     {
00667         ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00668         uiRet = ERROR_OUTOFMEMORY;
00669         goto CleanUp;
00670     }
00671     else if (ERROR_SUCCESS != uiRet)
00672     {
00673         // PROPERTY=VALUE pairs not specified
00674         if (szProperties)
00675             delete [] szProperties;
00676         szProperties = NULL;
00677     }
00678
00679     DownloadUI.Terminate();
00680
00681     //
00682     // perform install
00683     //
00684
00685     hMsi = LoadLibrary(MSI_DLL);
00686
00687     if (hMsi)
00688     {
00689         pfnMsiSetInternalUI = (PFnMsiSetInternalUI)GetProcAddress(hMsi, MSIAPI_MsiSetInternalUI);
00690         pfnMsiInstallProduct = (PFnMsiInstallProduct)GetProcAddress(hMsi, MSIAPI_MsiInstallProduct);
00691         pfnMsiApplyPatch = (PFnMsiApplyPatch)GetProcAddress(hMsi, MSIAPI_MsiApplyPatch);
00692         pfnMsiReinstallProduct = (PFnMsiReinstallProduct)GetProcAddress(hMsi, MSIAPI_MsiReinstallProduct);
00693         pfnMsiQueryProductState = (PFnMsiQueryProductState)GetProcAddress(hMsi, MSIAPI_MsiQueryProductState);
00694         pfnMsiOpenDatabase = (PFnMsiOpenDatabase)GetProcAddress(hMsi, MSIAPI_MsiOpenDatabase);
00695         pfnMsiDatabaseOpenView = (PFnMsiDatabaseOpenView)GetProcAddress(hMsi, MSIAPI_MsiDatabaseOpenView);
00696         pfnMsiViewExecute = (PFnMsiViewExecute)GetProcAddress(hMsi, MSIAPI_MsiViewExecute);
00697         pfnMsiViewFetch = (PFnMsiViewFetch)GetProcAddress(hMsi, MSIAPI_MsiViewFetch);
00698         pfnMsiRecordGetString = (PFnMsiRecordGetString)GetProcAddress(hMsi, MSIAPI_MsiRecordGetString);
00699         pfnMsiCloseHandle = (PFnMsiCloseHandle)GetProcAddress(hMsi, MSIAPI_MsiCloseHandle);
00700     }
00701     if (!hMsi || !pfnMsiSetInternalUI || !pfnMsiInstallProduct || !pfnMsiApplyPatch || !pfnMsiReinstallProduct || !pfnMsiQueryProductState
00702         || !pfnMsiDatabaseOpenView || !pfnMsiViewExecute || !pfnMsiViewFetch || !pfnMsiRecordGetString || !pfnMsiCloseHandle)
00703     {
00704         PostError(hInst, DownloadUI.GetCurrentWindow(), szAppTitle, IDS_FAILED_TO_UPGRADE_MSI);
00705         uiRet = ERROR_INSTALL_FAILURE;
00706         goto CleanUp;
00707     }
00708
00709     DebugMsg("[Info] Setting Internal UI level to FULL...\n");
00710     pfnMsiSetInternalUI(INSTALLUILEVEL_FULL, 0);
00711
00712     if (!fPatch)
00713     {
00714         // performing install or reinstall/recache
00715         DebugMsg("[Info] Calling MsiInstallProduct with szInstallPath = %s", szInstallPath);
00716         DebugMsg(" and szCommandLine = %s\n", szProperties ? szProperties : "{null}");
00717
00718         // default operation for a package is INSTALL
00719
00720         if (fQFE)
00721         {
00722             // check to see if this product is already installed
00723             if (ERROR_SUCCESS == pfnMsiOpenDatabase(szMsiCacheFile ? szMsiCacheFile : szInstallPath, MSIDBOPEN_READONLY, &hDatabase)
00724                 && ERROR_SUCCESS == pfnMsiDatabaseOpenView(hDatabase, sqlProductCode, &hView)
00725                 && ERROR_SUCCESS == pfnMsiViewExecute(hView, 0)
00726                 && ERROR_SUCCESS == pfnMsiViewFetch(hView, &hRec)
00727                 && ERROR_SUCCESS == pfnMsiRecordGetString(hRec, 1, szProductCode, &dwProductCodeSize))
00728             {
00729                 isProduct = pfnMsiQueryProductState(szProductCode);
00730                 DebugMsg("[Info] MsiQueryProductState returned %d\n", isProduct);
00731                 if (INSTALLSTATE_ADVERTISED != isProduct && INSTALLSTATE_DEFAULT != isProduct)
00732                 {
00733                     // product is unknown, so this will be a first time install
00734                     DebugMsg("[Info] The product code '%s' is unknown. Will use first time install logic...\n", szProductCode);
00735                     fQFE = false;
00736                 }
00737                 else
00738                 {
00739                     // product is known, use QFE syntax
00740                     DebugMsg("[Info] The product code '%s' is known. Will use QFE recache and reinstall upgrade logic...\n", szProductCode);
00741                 }
00742             }
00743             else
00744             {
00745                 // some failure occurred when processing the product code, so treat as non-QFE
00746                 DebugMsg("[Info] Unable to process product code. Will treat as first time install...\n");
00747                 fQFE = false;
00748             }
00749             if (hDatabase)
00750                 pfnMsiCloseHandle(hDatabase);
00751             if (hView)
00752                 pfnMsiCloseHandle(hView);
00753             if (hRec)
00754                 pfnMsiCloseHandle(hRec);
00755         }
00756
00757         //
00758         // Set up the properties to be passed into MSIInstallProduct
00759         //
00760         if (fQFE && !szProperties)
00761             cchInstProperties = lstrlen (szDefaultInstallUpdCommandLine);
00762         else if (szProperties)
00763             cchInstProperties = lstrlen (szProperties);
00764         if (emAdminInstall == emExecMode)
00765             cchInstProperties += lstrlen (szAdminInstallProperty);
00766
00767         szInstProperties = new char[cchInstProperties + 1];
00768         if (! szInstProperties)
00769         {
00770             ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00771             uiRet = ERROR_OUTOFMEMORY;
00772             goto CleanUp;
00773         }
00774
00775         if (fQFE && !szProperties)
00776             lstrcpy (szInstProperties, szDefaultInstallUpdCommandLine);
00777         else if (szProperties)
00778             lstrcpy (szInstProperties, szProperties);
00779         else
00780             szInstProperties[0] = '\0';
00781         if (emAdminInstall == emExecMode)
00782             lstrcat (szInstProperties, szAdminInstallProperty);
00783
00784         uiRet = pfnMsiInstallProduct(szInstallPath, szInstProperties);
00785         if (ERROR_SUCCESS != uiRet)
00786         {
00787             // attempt to display an error message stored in msi.dll
00788             PostMsiError(hInst, hMsi, DownloadUI.GetCurrentWindow(), szAppTitle, uiRet);
00789         }
00790
00791         DebugMsg("[Info] MsiInstallProduct returned %d\n", uiRet);
00792     }
00793     else
00794     {
00795         // default Operation for a patch is MINPATCH
00796
00797         // if szProperties is NULL, use our default value for QFE patches
00798         if (!szProperties && fQFE)
00799         {
00800             DebugMsg("[Info] Patch is a MINPATCH (small or minor update patch) so using default command line '%s'\n", szDefaultMinPatchCommandLine);
00801
00802             szProperties = new char[lstrlen(szDefaultMinPatchCommandLine) + 1];
00803             if (!szProperties)
00804             {
00805                 ReportErrorOutOfMemory(hInst, DownloadUI.GetCurrentWindow(), szAppTitle);
00806                 uiRet = ERROR_OUTOFMEMORY;
00807                 goto CleanUp;
00808             }
00809             lstrcpy(szProperties, szDefaultMinPatchCommandLine);
00810         }
00811
00812         if (emAdminInstall == emExecMode)
00813         {
00814             // performing a patch
00815             DebugMsg("[Info] Calling MsiApplyPatch with szPatchPackage = %s", szMsiCacheFile);
00816             DebugMsg(" and szInstallPackage = %s and eInstallType = INSTALLTYPE_NETWORK_IMAGE", szAdminImagePath);
00817             DebugMsg(" and szCommandLine = %s\n", szProperties ? szProperties : "{null}");
00818
00819             uiRet = pfnMsiApplyPatch(szMsiCacheFile, szAdminImagePath, INSTALLTYPE_NETWORK_IMAGE, szProperties);
00820         }
00821         else
00822         {
00823             // performing a patch
00824             DebugMsg("[Info] Calling MsiApplyPatch with szPatchPackage = %s", szInstallPath);
00825             DebugMsg(" and szInstallPackage = {null} and eInstallType = INSTALLTYPE_DEFAULT");
00826             DebugMsg(" and szCommandLine = %s\n", szProperties ? szProperties : "{null}");
00827
00828             uiRet = pfnMsiApplyPatch(szInstallPath, NULL, INSTALLTYPE_DEFAULT, szProperties);
00829         }
00830         if (ERROR_SUCCESS != uiRet)
00831         {
00832             // attempt to display an error message stored in msi.dll
00833             PostMsiError(hInst, hMsi, DownloadUI.GetCurrentWindow(), szAppTitle, uiRet);
00834         }
00835
00836         DebugMsg("[Info] MsiApplyPatch returned %d\n", uiRet);
00837     }
00838
00839
00840 CleanUp:
00841
00842     if (szMsiFile)
00843         delete [] szMsiFile;
00844     if (szBaseURL)
00845         delete [] szBaseURL;
00846     if (szInstallPath)
00847         delete [] szInstallPath;
00848     if (szMsiCacheFile)
00849     {
00850         WIN::DeleteUrlCacheEntry(szMsiCacheFile);
00851         delete [] szMsiCacheFile;
00852     }
00853     if (szProductName)
00854         delete [] szProductName;
00855     if (szMinimumMsi)
00856         delete [] szMinimumMsi;
00857     if (szProperties)
00858         delete [] szProperties;
00859     if (szTempPath)
00860         delete [] szTempPath;
00861     if (szBase)
00862         delete [] szBase;
00863     if (szUpdate)
00864         delete [] szUpdate;
00865     if (szRegisteredMsiFolder)
00866         delete [] szRegisteredMsiFolder;
00867     if (szMsiDllLocation)
00868         delete [] szMsiDllLocation;
00869
00870     if (hMsi)
00871         FreeLibrary(hMsi);
00872
00873     DebugMsg("[Info] Setup exit code is %d\n", uiRet);
00874
00875     if (fDelayRebootReq)
00876     {
00877         // need to reboot machine for updating Windows Installer
00878         WIN::LoadString(hInst, IDS_REBOOT_REQUIRED, szAction, MAX_STR_LENGTH);
00879         if (IDYES == MessageBox(NULL, szAction, szAppTitle, MB_YESNO|MB_ICONQUESTION))
00880         {
00881             // must first aquire system shutdown privileges on NT/Win2K
00882             AcquireShutdownPrivilege();
00883             // initiate system shutdown for reboot
00884             WIN::ExitWindowsEx(EWX_REBOOT, PCLEANUI | SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_INSTALLATION);
00885         }
00886     }
00887
00888     return uiRet;
00889 }
00890
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/MyDevice.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step3

MyDevice.h

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Fri Apr 12 22:33:43 2002
00006  */
00007 /* Compiler settings for C:\UPnPSample\SDKDimmer\DimmerDevice\StepByStep\Step3\MyDevice.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013
00014 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00015 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00016 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00017 #endif
00018
00019 #include "rpc.h"
00020 #include "rpcndr.h"
00021
00022 #ifndef __MyDevice_h__
00023 #define __MyDevice_h__
00024
00025 #ifdef __cplusplus
00026 extern "C"{
00027 #endif
00028
00029 /* Forward Declarations */
00030
00031 #ifndef __IUPnPService_DimmingService_SCPD_FWD_DEFINED__
00032 #define __IUPnPService_DimmingService_SCPD_FWD_DEFINED__
00033 typedef interface IUPnPService_DimmingService_SCPD IUPnPService_DimmingService_SCPD;
00034 #endif  /* __IUPnPService_DimmingService_SCPD_FWD_DEFINED__ */
00035
00036
00037 #ifndef __Dimmer_FWD_DEFINED__
00038 #define __Dimmer_FWD_DEFINED__
00039
00040 #ifdef __cplusplus
00041 typedef class Dimmer Dimmer;
00042 #else
00043 typedef struct Dimmer Dimmer;
00044 #endif /* __cplusplus */
00045
00046 #endif  /* __Dimmer_FWD_DEFINED__ */
00047
00048
00049 /* header files for imported files */
00050 #include "oaidl.h"
00051 #include "ocidl.h"
00052
00053 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00054 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00055
00056
00057 #ifndef __MYDEVICELib_LIBRARY_DEFINED__
00058 #define __MYDEVICELib_LIBRARY_DEFINED__
00059
00060 /* library MYDEVICELib */
00061 /* [helpstring][version][uuid] */
00062
00063 typedef /* [v1_enum] */
00064 enum DIMMINGSERVICE_SCPD_DISPIDS
00065     { DISPID_POWER  = 1,
00066   DISPID_DIMLEVEL = DISPID_POWER + 1,
00067   DISPID_POWERON  = DISPID_DIMLEVEL + 1,
00068   DISPID_POWEROFF = DISPID_POWERON + 1,
00069   DISPID_GETPOWERVALUE  = DISPID_POWEROFF + 1,
00070   DISPID_SETDIMLEVEL  = DISPID_GETPOWERVALUE + 1,
00071   DISPID_GETDIMLEVEL  = DISPID_SETDIMLEVEL + 1,
00072   DISPID_GETCONFIGDETAILS = DISPID_GETDIMLEVEL + 1
00073     } DIMMINGSERVICE_SCPD_DISPIDS;
00074
00075
00076 EXTERN_C const IID LIBID_MYDEVICELib;
00077
00078 #ifndef __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__
00079 #define __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__
00080
00081 /* interface IUPnPService_DimmingService_SCPD */
00082 /* [object][unique][oleautomation][uuid] */
00083
00084
00085 EXTERN_C const IID IID_IUPnPService_DimmingService_SCPD;
00086
00087 #if defined(__cplusplus) && !defined(CINTERFACE)
00088
00089     MIDL_INTERFACE("a315fcbd-7f4b-4081-a172-2f534c438957")
00090     IUPnPService_DimmingService_SCPD : public IDispatch
00091     {
00092     public:
00093         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Power(
00094             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pPower) = 0;
00095
00096         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_dimLevel(
00097             /* [retval][out] */ long __RPC_FAR *pdimLevel) = 0;
00098
00099         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PowerOn( void) = 0;
00100
00101         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PowerOff( void) = 0;
00102
00103         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetPowerValue(
00104             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVall) = 0;
00105
00106         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetDimLevel(
00107             /* [in] */ long dLevel) = 0;
00108
00109         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetDimLevel(
00110             /* [out][in] */ long __RPC_FAR *pdLevel) = 0;
00111
00112         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetConfigDetails(
00113             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVal,
00114             /* [out][in] */ long __RPC_FAR *pdLevel) = 0;
00115
00116     };
00117
00118 #else   /* C style interface */
00119
00120     typedef struct IUPnPService_DimmingService_SCPDVtbl
00121     {
00122         BEGIN_INTERFACE
00123
00124         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00125             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00126             /* [in] */ REFIID riid,
00127             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00128
00129         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00130             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00131
00132         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00133             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00134
00135         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
00136             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00137             /* [out] */ UINT __RPC_FAR *pctinfo);
00138
00139         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
00140             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00141             /* [in] */ UINT iTInfo,
00142             /* [in] */ LCID lcid,
00143             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
00144
00145         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
00146             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00147             /* [in] */ REFIID riid,
00148             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
00149             /* [in] */ UINT cNames,
00150             /* [in] */ LCID lcid,
00151             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
00152
00153         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
00154             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00155             /* [in] */ DISPID dispIdMember,
00156             /* [in] */ REFIID riid,
00157             /* [in] */ LCID lcid,
00158             /* [in] */ WORD wFlags,
00159             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
00160             /* [out] */ VARIANT __RPC_FAR *pVarResult,
00161             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
00162             /* [out] */ UINT __RPC_FAR *puArgErr);
00163
00164         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Power )(
00165             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00166             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pPower);
00167
00168         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_dimLevel )(
00169             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00170             /* [retval][out] */ long __RPC_FAR *pdimLevel);
00171
00172         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PowerOn )(
00173             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00174
00175         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PowerOff )(
00176             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00177
00178         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetPowerValue )(
00179             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00180             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVall);
00181
00182         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetDimLevel )(
00183             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00184             /* [in] */ long dLevel);
00185
00186         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetDimLevel )(
00187             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00188             /* [out][in] */ long __RPC_FAR *pdLevel);
00189
00190         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetConfigDetails )(
00191             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00192             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVal,
00193             /* [out][in] */ long __RPC_FAR *pdLevel);
00194
00195         END_INTERFACE
00196     } IUPnPService_DimmingService_SCPDVtbl;
00197
00198     interface IUPnPService_DimmingService_SCPD
00199     {
00200         CONST_VTBL struct IUPnPService_DimmingService_SCPDVtbl __RPC_FAR *lpVtbl;
00201     };
00202
00203
00204
00205 #ifdef COBJMACROS
00206
00207
00208 #define IUPnPService_DimmingService_SCPD_QueryInterface(This,riid,ppvObject)  \
00209     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00210
00211 #define IUPnPService_DimmingService_SCPD_AddRef(This) \
00212     (This)->lpVtbl -> AddRef(This)
00213
00214 #define IUPnPService_DimmingService_SCPD_Release(This)  \
00215     (This)->lpVtbl -> Release(This)
00216
00217
00218 #define IUPnPService_DimmingService_SCPD_GetTypeInfoCount(This,pctinfo) \
00219     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
00220
00221 #define IUPnPService_DimmingService_SCPD_GetTypeInfo(This,iTInfo,lcid,ppTInfo)  \
00222     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
00223
00224 #define IUPnPService_DimmingService_SCPD_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)  \
00225     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
00226
00227 #define IUPnPService_DimmingService_SCPD_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)  \
00228     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
00229
00230
00231 #define IUPnPService_DimmingService_SCPD_get_Power(This,pPower) \
00232     (This)->lpVtbl -> get_Power(This,pPower)
00233
00234 #define IUPnPService_DimmingService_SCPD_get_dimLevel(This,pdimLevel) \
00235     (This)->lpVtbl -> get_dimLevel(This,pdimLevel)
00236
00237 #define IUPnPService_DimmingService_SCPD_PowerOn(This)  \
00238     (This)->lpVtbl -> PowerOn(This)
00239
00240 #define IUPnPService_DimmingService_SCPD_PowerOff(This) \
00241     (This)->lpVtbl -> PowerOff(This)
00242
00243 #define IUPnPService_DimmingService_SCPD_GetPowerValue(This,ppowerVall) \
00244     (This)->lpVtbl -> GetPowerValue(This,ppowerVall)
00245
00246 #define IUPnPService_DimmingService_SCPD_SetDimLevel(This,dLevel) \
00247     (This)->lpVtbl -> SetDimLevel(This,dLevel)
00248
00249 #define IUPnPService_DimmingService_SCPD_GetDimLevel(This,pdLevel)  \
00250     (This)->lpVtbl -> GetDimLevel(This,pdLevel)
00251
00252 #define IUPnPService_DimmingService_SCPD_GetConfigDetails(This,ppowerVal,pdLevel) \
00253     (This)->lpVtbl -> GetConfigDetails(This,ppowerVal,pdLevel)
00254
00255 #endif /* COBJMACROS */
00256
00257
00258 #endif  /* C style interface */
00259
00260
00261
00262 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_get_Power_Proxy(
00263     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00264     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pPower);
00265
00266
00267 void __RPC_STUB IUPnPService_DimmingService_SCPD_get_Power_Stub(
00268     IRpcStubBuffer *This,
00269     IRpcChannelBuffer *_pRpcChannelBuffer,
00270     PRPC_MESSAGE _pRpcMessage,
00271     DWORD *_pdwStubPhase);
00272
00273
00274 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_get_dimLevel_Proxy(
00275     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00276     /* [retval][out] */ long __RPC_FAR *pdimLevel);
00277
00278
00279 void __RPC_STUB IUPnPService_DimmingService_SCPD_get_dimLevel_Stub(
00280     IRpcStubBuffer *This,
00281     IRpcChannelBuffer *_pRpcChannelBuffer,
00282     PRPC_MESSAGE _pRpcMessage,
00283     DWORD *_pdwStubPhase);
00284
00285
00286 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_PowerOn_Proxy(
00287     IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00288
00289
00290 void __RPC_STUB IUPnPService_DimmingService_SCPD_PowerOn_Stub(
00291     IRpcStubBuffer *This,
00292     IRpcChannelBuffer *_pRpcChannelBuffer,
00293     PRPC_MESSAGE _pRpcMessage,
00294     DWORD *_pdwStubPhase);
00295
00296
00297 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_PowerOff_Proxy(
00298     IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00299
00300
00301 void __RPC_STUB IUPnPService_DimmingService_SCPD_PowerOff_Stub(
00302     IRpcStubBuffer *This,
00303     IRpcChannelBuffer *_pRpcChannelBuffer,
00304     PRPC_MESSAGE _pRpcMessage,
00305     DWORD *_pdwStubPhase);
00306
00307
00308 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_GetPowerValue_Proxy(
00309     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00310     /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVall);
00311
00312
00313 void __RPC_STUB IUPnPService_DimmingService_SCPD_GetPowerValue_Stub(
00314     IRpcStubBuffer *This,
00315     IRpcChannelBuffer *_pRpcChannelBuffer,
00316     PRPC_MESSAGE _pRpcMessage,
00317     DWORD *_pdwStubPhase);
00318
00319
00320 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_SetDimLevel_Proxy(
00321     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00322     /* [in] */ long dLevel);
00323
00324
00325 void __RPC_STUB IUPnPService_DimmingService_SCPD_SetDimLevel_Stub(
00326     IRpcStubBuffer *This,
00327     IRpcChannelBuffer *_pRpcChannelBuffer,
00328     PRPC_MESSAGE _pRpcMessage,
00329     DWORD *_pdwStubPhase);
00330
00331
00332 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_GetDimLevel_Proxy(
00333     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00334     /* [out][in] */ long __RPC_FAR *pdLevel);
00335
00336
00337 void __RPC_STUB IUPnPService_DimmingService_SCPD_GetDimLevel_Stub(
00338     IRpcStubBuffer *This,
00339     IRpcChannelBuffer *_pRpcChannelBuffer,
00340     PRPC_MESSAGE _pRpcMessage,
00341     DWORD *_pdwStubPhase);
00342
00343
00344 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_GetConfigDetails_Proxy(
00345     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00346     /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVal,
00347     /* [out][in] */ long __RPC_FAR *pdLevel);
00348
00349
00350 void __RPC_STUB IUPnPService_DimmingService_SCPD_GetConfigDetails_Stub(
00351     IRpcStubBuffer *This,
00352     IRpcChannelBuffer *_pRpcChannelBuffer,
00353     PRPC_MESSAGE _pRpcMessage,
00354     DWORD *_pdwStubPhase);
00355
00356
00357
00358 #endif  /* __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__ */
00359
00360
00361 EXTERN_C const CLSID CLSID_Dimmer;
00362
00363 #ifdef __cplusplus
00364
00365 class DECLSPEC_UUID("d31b8f49-367e-41b7-8fc4-50e23d36625d")
00366 Dimmer;
00367 #endif
00368 #endif /* __MYDEVICELib_LIBRARY_DEFINED__ */
00369
00370 /* Additional Prototypes for ALL interfaces */
00371
00372 /* end of Additional Prototypes */
00373
00374 #ifdef __cplusplus
00375 }
00376 #endif
00377
00378 #endif
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_stringstruct Member List

This is the complete list of members for _stringstruct, including all inherited members.
cSize | _stringstruct
pszStr | _stringstruct
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/onenumsvcs.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

onenumsvcs.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  OnEnumSvcs.cpp
00006 //
00007 // Description:
00008 //  This file implements the OnEnumservices() routine which
00009 //    demonstrates the ExecQuery() calls.
00010 //
00011 // History:
00012 //
00013 // **************************************************************************
00014
00015 #include "stdafx.h"
00016 #include "AdvClientDlg.h"
00017
00018 #define TIMEOUT -1
00019
00020
00021 // **************************************************************************
00022 //
00023 //  CAdvClientDlg::OnEnumservices()
00024 //
00025 // Description:
00026 //    Enumerate the services. Demonstrates ExecQuery() using WQL and
00027 //    begin/end enumeration through properties.
00028 // Parameters:
00029 //    None.
00030 //
00031 // Returns:
00032 //    nothing.
00033 //
00034 // Globals accessed:
00035 //    None.
00036 //
00037 // Globals modified:
00038 //    None.
00039 //
00040 //===========================================================================
00041 void CAdvClientDlg::OnEnumservices()
00042 {
00043   HRESULT  hRes;
00044   BSTR propName = NULL, val = NULL;
00045   VARIANT pVal;
00046   WCHAR *pBuf;
00047   CString clMyBuff, prop;
00048   ULONG uReturned;
00049
00050   IWbemClassObject *pService = NULL;
00051   IEnumWbemClassObject *pEnumServices = NULL;
00052
00053   BSTR qLang = SysAllocString(L"WQL");
00054   if (!qLang)
00055   {
00056     TRACE(_T("SysAllocString failed: not enough memory\n"));
00057     return;
00058   }
00059
00060   BSTR query = SysAllocString(L"select * from Win32_Service");
00061   if (!query)
00062   {
00063     SysFreeString(qLang);
00064     TRACE(_T("SysAllocString failed: not enough memory\n"));
00065     return;
00066   }
00067
00068   m_outputList.ResetContent();
00069   m_outputList.AddString(_T("working..."));
00070
00071   //----------------------
00072   // execute the query.
00073   if((hRes = m_pIWbemServices->ExecQuery(qLang, query,
00074                     0L, NULL,
00075                     &pEnumServices)) == S_OK)
00076   {
00077     TRACE(_T("Executed query\n"));
00078
00079     m_outputList.ResetContent();
00080
00081     //----------------------
00082     // enumerate through services.
00083     while(((hRes = pEnumServices->Next(TIMEOUT, 1,
00084                     &pService, &uReturned)) == S_OK) &&
00085         (uReturned == 1))
00086     {
00087       // clear my output buffer.
00088       clMyBuff.Empty();
00089
00090       //----------------------
00091       // different way to enumerate properties.
00092       if((hRes = pService->BeginEnumeration(WBEM_FLAG_NONSYSTEM_ONLY)) == S_OK)
00093       {
00094         //----------------------
00095         // try to get the next property.
00096         while(pService->Next(0, &propName,
00097                   &pVal, NULL, NULL) == S_OK)
00098         {
00099           // is it one of the 'names' we want?
00100           if((wcsncmp(propName, L"Name", 4) == 0) ||
00101             (wcsncmp(propName, L"DisplayName", 11) == 0) ||
00102             (wcsncmp(propName, L"PathName", 8) == 0))
00103           {
00104             // format the property=value/
00105             clMyBuff += propName;
00106             clMyBuff += _T("=");
00107             clMyBuff += ValueToString(&pVal, &pBuf);
00108             clMyBuff += _T("/");
00109             free(pBuf); // allocated by ValueToString()
00110           }
00111
00112           // cleanup stuff used in the Next() loop.
00113           SysFreeString(propName);
00114           VariantClear(&pVal);
00115         }
00116
00117         // did the while loop exit due to an error?
00118         if(hRes != S_OK)
00119         {
00120           TRACE(_T("pService->Next() failed %s\n"), ErrorString(hRes));
00121         }
00122       }
00123       else
00124       {
00125         TRACE(_T("BeginEnumeration() failed %s\n"), ErrorString(hRes));
00126       }
00127
00128       // output the buffer.
00129       m_outputList.AddString(clMyBuff);
00130
00131       //----------------------
00132       // free the iterator space.
00133       pService->EndEnumeration();
00134
00135       // done with the ClassObject
00136       if (pService)
00137       {
00138         pService->Release();
00139         pService = NULL;
00140       }
00141     } //endwhile Next()
00142
00143     TRACE(_T("walked query\n"));
00144     m_outputList.AddString(_T("Done Enumerating"));
00145
00146     // did the while loop exit due to an error?
00147     if((hRes != S_OK) &&
00148        (hRes != 1))
00149     {
00150       TRACE(_T("pEnumServices->Next() failed %s\n"), ErrorString(hRes));
00151     }
00152
00153     if (pEnumServices)
00154     {
00155       pEnumServices->Release();
00156       pEnumServices = NULL;
00157     }
00158   }
00159   else
00160   {
00161     TRACE(_T("ExecQuery() failed %s\n"), ErrorString(hRes));
00162
00163   } //endif ExecQuery()
00164
00165   SysFreeString(qLang);
00166   SysFreeString(query);
00167 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/Factory.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

Factory.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.CPP
00003
00004   Summary:   Implementation file for the ClassFactories of the DLLSERVE
00005              server.  This server provides several Car-related COM
00006              Components: Car, UtilityCar, and CruiseCar.  For each of
00007              these components, IClassFactory is implemented in
00008              appropriate ClassFactory COM objects: CFCar, CFUtilityCar,
00009              and CFCruiseCar.  In addition a CFCarSample class factory
00010              is included to provide a component with the Code Sample
00011              utility interface (ISample).  This interface is primarily
00012              for use within the code samples for the purposes of setting
00013              them up as samples (eg, setting up the server so that it
00014              trace logs to the client's trace log facility).  The COM
00015              Components that can be manufactured by this server are
00016              known outside the server by their respective CLSIDs:
00017              CLSID_DllCar, CLSID_DllUtilityCar, CLSID_DllCruiseCar, and
00018              CLSID_DllCarSample.
00019
00020              For a comprehensive tutorial code tour of this module's
00021              contents and offerings see the tutorial DLLSERVE.HTM file.
00022              For more specific technical details on the internal workings
00023              see the comments dispersed throughout the module's source code.
00024
00025   Classes:   CFCar, CFUtilityCar, CFCruiseCar, CFCarSample.
00026
00027   Functions: .
00028
00029   Origin:    9-11-95: atrent - Editor-inheritance from CAR.CPP in
00030                the COMOBJ Tutorial Code Sample.
00031
00032 ----------------------------------------------------------------------------
00033   This file is part of the Microsoft COM Tutorial Code Samples.
00034
00035   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00036
00037   This source code is intended only as a supplement to Microsoft
00038   Development Tools and/or on-line documentation.  See these other
00039   materials for detailed information regarding Microsoft code samples.
00040
00041   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00042   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00043   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00044   PARTICULAR PURPOSE.
00045 ==========================================================================+*/
00046
00047 /*---------------------------------------------------------------------------
00048   We include WINDOWS.H for all Win32 applications.
00049   We include OLE2.H because we will be calling the COM/OLE Libraries.
00050   We include APPUTIL.H because we will be building this DLL using
00051     the convenient Virtual Window and Dialog classes and other
00052     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00053   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00054     class, GUID, and CLSID specifications.
00055   We include SERVER.H because it has the necessary internal class and
00056     resource definitions for this DLL.
00057   We include FACTORY.H because it has the necessary internal class factory
00058     declarations for this DLL component server.  Those factories we will be
00059     implementing in this module.
00060   We include CAR.H, UTILCAR,H, and, CRUCAR.H for the object class
00061     declarations for the COCar, COUtilityCar, and COCruiseCar COM objects.
00062   We include SAMPLE.H for the utility Sample class COCarSample.
00063 ---------------------------------------------------------------------------*/
00064 #include <windows.h>
00065 #include <ole2.h>
00066 #include <apputil.h>
00067 #include <icars.h>
00068 #include <carguids.h>
00069 #include "server.h"
00070 #include "factory.h"
00071 #include "car.h"
00072 #include "utilcar.h"
00073 #include "crucar.h"
00074 #include "sample.h"
00075
00076 /*---------------------------------------------------------------------------
00077   Implementation the CFCar Class Factory.  CFCar is the COM
00078   object class for the Class Factory that can manufacture COCar
00079   COM Components.
00080 ---------------------------------------------------------------------------*/
00081
00082 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00083   Method:   CFCar::CFCar
00084
00085   Summary:  CFCar Constructor. Note the member initializer:
00086             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00087             to pass the 'this', pUnkOuter, and pServer pointers of this
00088             constructor function to the constructor executed in the
00089             instantiation of the CImpIClassFactory interface whose
00090             implementation is nested inside this present object class.
00091
00092   Args:     IUnknown* pUnkOuter,
00093               Pointer to the the outer Unknown.  NULL means this COM Object
00094               is not being Aggregated.  Non NULL means it is being created
00095               on behalf of an outside COM object that is reusing it via
00096               aggregation.
00097             CServer* pServer)
00098               Pointer to the server's control object.
00099
00100   Modifies: m_cRefs, m_pUnkOuter.
00101
00102   Returns:  void
00103 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00104 CFCar::CFCar(
00105   IUnknown* pUnkOuter,
00106   CServer* pServer) :
00107   m_ImpIClassFactory(this, pUnkOuter, pServer)
00108 {
00109   // Zero the COM object's reference count.
00110   m_cRefs = 0;
00111
00112   // No AddRef necessary if non-NULL, as we're nested.
00113   m_pUnkOuter = pUnkOuter;
00114
00115   // Init the pointer to the server control object.
00116   m_pServer = pServer;
00117
00118   LOGF1("S: CFCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00119
00120   return;
00121 }
00122
00123
00124 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00125   Method:   CFCar::~CFCar
00126
00127   Summary:  CFCar Destructor.
00128
00129   Args:     void
00130
00131   Returns:  void
00132 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00133 CFCar::~CFCar(void)
00134 {
00135   LOG("S: CFCar::Destructor.");
00136
00137   return;
00138 }
00139
00140
00141 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00142   Method:   CFCar::QueryInterface
00143
00144   Summary:  QueryInterface of the CFCar non-delegating
00145             IUnknown implementation.
00146
00147   Args:     REFIID riid,
00148               [in] GUID of the Interface being requested.
00149             PPVOID ppv)
00150               [out] Address of the caller's pointer variable that will
00151               receive the requested interface pointer.
00152
00153   Returns:  HRESULT
00154               Standard result code. NOERROR for success.
00155 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00156 STDMETHODIMP CFCar::QueryInterface(
00157                REFIID riid,
00158                PPVOID ppv)
00159 {
00160   HRESULT hr = E_NOINTERFACE;
00161   *ppv = NULL;
00162
00163   if (IID_IUnknown == riid)
00164   {
00165     *ppv = this;
00166     LOG("S: CFCar::QueryInterface. 'this' pIUnknown returned.");
00167   }
00168   else if (IID_IClassFactory == riid)
00169   {
00170     *ppv = &m_ImpIClassFactory;
00171     LOG("S: CFCar::QueryInterface. pIClassFactory returned.");
00172   }
00173
00174   if (NULL != *ppv)
00175   {
00176     // We've handed out a pointer to the interface so obey the COM rules
00177     // and AddRef the reference count.
00178     ((LPUNKNOWN)*ppv)->AddRef();
00179     hr = NOERROR;
00180   }
00181
00182   return (hr);
00183 }
00184
00185
00186 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00187   Method:   CFCar::AddRef
00188
00189   Summary:  AddRef of the CFCar non-delegating IUnknown implementation.
00190
00191   Args:     void
00192
00193   Modifies: m_cRefs.
00194
00195   Returns:  ULONG
00196               New value of m_cRefs (COM object's reference count).
00197 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00198 STDMETHODIMP_(ULONG) CFCar::AddRef(void)
00199 {
00200   m_cRefs++;
00201
00202   LOGF1("S: CFCar::AddRef. New cRefs=%i.", m_cRefs);
00203
00204   return m_cRefs;
00205 }
00206
00207
00208 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00209   Method:   CFCar::Release
00210
00211   Summary:  Release of the CFCar non-delegating IUnknown implementation.
00212
00213   Args:     void
00214
00215   Modifies: m_cRefs.
00216
00217   Returns:  ULONG
00218               New value of m_cRefs (COM object's reference count).
00219 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00220 STDMETHODIMP_(ULONG) CFCar::Release(void)
00221 {
00222   m_cRefs--;
00223
00224   LOGF1("S: CFCar::Release. New cRefs=%i.", m_cRefs);
00225
00226   if (0 == m_cRefs)
00227   {
00228     // We've reached a zero reference count for this COM object.
00229     // So we tell the server housing to decrement its global object
00230     // count so that the server will be unloaded if appropriate.
00231     if (NULL != m_pServer)
00232       m_pServer->ObjectsDown();
00233
00234     // We artificially bump the main ref count to prevent reentrancy
00235     // via the main object destructor.  Not really needed in this
00236     // CFCar but a good practice because we are aggregatable and
00237     // may at some point in the future add something entertaining like
00238     // some Releases to the CFCar destructor.
00239     m_cRefs++;
00240     delete this;
00241   }
00242
00243   return m_cRefs;
00244 }
00245
00246
00247 /*---------------------------------------------------------------------------
00248   CFCar's nested implementation of the IClassFactory interface
00249   including Constructor, Destructor, QueryInterface, AddRef, Release,
00250   CreateInstance, and LockServer methods.
00251 ---------------------------------------------------------------------------*/
00252
00253 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00254   Method:   CFCar::CImpIClassFactory::CImpIClassFactory
00255
00256   Summary:  Constructor for the CImpIClassFactory interface instantiation.
00257
00258   Args:     CFCar* pBackObj,
00259               Back pointer to the parent outer object.
00260             IUnknown* pUnkOuter,
00261               Pointer to the outer Unknown.  For delegation.
00262             CServer* pServer)
00263               Pointer to the server's control object.
00264
00265   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter, m_pServer.
00266
00267   Returns:  void
00268 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00269 CFCar::CImpIClassFactory::CImpIClassFactory(
00270   CFCar* pBackObj,
00271   IUnknown* pUnkOuter,
00272   CServer* pServer)
00273 {
00274   // Init the Interface Ref Count (used for debugging only).
00275   m_cRefI = 0;
00276
00277   // Init the Back Object Pointer to point to the parent object.
00278   m_pBackObj = pBackObj;
00279
00280   // Init the pointer to the server control object.
00281   m_pServer = pServer;
00282
00283   // Init the CImpIClassFactory interface's delegating Unknown pointer.
00284   // We use the Back Object pointer for IUnknown delegation here if we are
00285   // not being aggregated.  If we are being aggregated we use the supplied
00286   // pUnkOuter for IUnknown delegation.  In either case the pointer
00287   // assignment requires no AddRef because the CImpIClassFactory lifetime is
00288   // quaranteed by the lifetime of the parent object in which
00289   // CImpIClassFactory is nested.
00290   if (NULL == pUnkOuter)
00291   {
00292     m_pUnkOuter = pBackObj;
00293     LOG("S: CFCar::CImpIClassFactory Constructor. Non-Aggregating.");
00294   }
00295   else
00296   {
00297     m_pUnkOuter = pUnkOuter;
00298     LOG("S: CFCar::CImpIClassFactory Constructor. Aggregating.");
00299   }
00300
00301   return;
00302 }
00303
00304
00305 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00306   Method:   CFCar::CImpIClassFactory::~CImpIClassFactory
00307
00308   Summary:  Destructor for the CImpIClassFactory interface instantiation.
00309
00310   Args:     void
00311
00312   Returns:  void
00313 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00314 CFCar::CImpIClassFactory::~CImpIClassFactory(void)
00315 {
00316   LOG("S: CFCar::CImpIClassFactory Destructor.");
00317
00318   return;
00319 }
00320
00321
00322 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00323   Method:   CFCar::CImpIClassFactory::QueryInterface
00324
00325   Summary:  The QueryInterface IUnknown member of this IClassFactory
00326             interface implementation that delegates to m_pUnkOuter,
00327             whatever it is.
00328
00329   Args:     REFIID riid,
00330               [in] GUID of the Interface being requested.
00331             PPVOID ppv)
00332               [out] Address of the caller's pointer variable that will
00333               receive the requested interface pointer.
00334
00335   Returns:  HRESULT
00336               Standard result code. NOERROR for success.
00337               Returned by the delegated outer QueryInterface call.
00338 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00339 STDMETHODIMP CFCar::CImpIClassFactory::QueryInterface(
00340                REFIID riid,
00341                PPVOID ppv)
00342 {
00343   LOG("S: CFCar::CImpIClassFactory::QueryInterface. Delegating.");
00344
00345   // Delegate this call to the outer object's QueryInterface.
00346   return m_pUnkOuter->QueryInterface(riid, ppv);
00347 }
00348
00349
00350 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00351   Method:   CFCar::CImpIClassFactory::AddRef
00352
00353   Summary:  The AddRef IUnknown member of this IClassFactory interface
00354             implementation that delegates to m_pUnkOuter, whatever it is.
00355
00356   Args:     void
00357
00358   Modifies: m_cRefI.
00359
00360   Returns:  ULONG
00361               Returned by the delegated outer AddRef call.
00362 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00363 STDMETHODIMP_(ULONG) CFCar::CImpIClassFactory::AddRef(void)
00364 {
00365   // Increment the Interface Reference Count.
00366   ++m_cRefI;
00367
00368   LOGF1("S: CFCar::CImpIClassFactory::Addref. Delegating. New cI=%i.",m_cRefI);
00369
00370   // Delegate this call to the outer object's AddRef.
00371   return m_pUnkOuter->AddRef();
00372 }
00373
00374
00375 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00376   Method:   CFCar::CImpIClassFactory::Release
00377
00378   Summary:  The Release IUnknown member of this IClassFactory interface
00379             implementation that delegates to m_pUnkOuter, whatever it is.
00380
00381   Args:     void
00382
00383   Returns:  ULONG
00384               Returned by the delegated outer Release call.
00385 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00386 STDMETHODIMP_(ULONG) CFCar::CImpIClassFactory::Release(void)
00387 {
00388   // Decrement the Interface Reference Count.
00389   --m_cRefI;
00390
00391   LOGF1("S: CFCar::CImpIClassFactory::Release. Delegating. New cI=%i.",m_cRefI);
00392
00393   // Delegate this call to the outer object's Release.
00394   return m_pUnkOuter->Release();
00395 }
00396
00397
00398 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00399   Method:   CFCar::CImpIClassFactory::CreateInstance
00400
00401   Summary:  The CreateInstance member method of this IClassFactory interface
00402             implementation.  Creates an instance of the COCar COM
00403             component.
00404
00405   Args:     IUnknown* pUnkOuter,
00406               [in] Pointer to the controlling IUnknown.
00407             REFIID riid,
00408               [in] GUID of the Interface being requested.
00409             PPVOID ppvCob)
00410               [out] Address of the caller's pointer variable that will
00411               receive the requested interface pointer.
00412
00413   Returns:  HRESULT
00414               Standard result code. NOERROR for success.
00415 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00416 STDMETHODIMP CFCar::CImpIClassFactory::CreateInstance(
00417                IUnknown* pUnkOuter,
00418                REFIID riid,
00419                PPVOID ppv)
00420 {
00421   HRESULT hr = E_FAIL;
00422   COCar* pCob = NULL;
00423
00424   LOGF1("S: CFCar::CImpIClassFactory::CreateInstance. pUnkOuter=0x%X.",pUnkOuter);
00425
00426   // NULL the output pointer.
00427   *ppv = NULL;
00428
00429   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00430   // the COM rules state the IUnknown interface MUST also be concomitantly
00431   // be requested.  If it is not so requested (riid != IID_IUnknown) then
00432   // an error must be returned indicating that no aggregate creation of
00433   // the CFCar COM Object can be performed.
00434   if (NULL != pUnkOuter && riid != IID_IUnknown)
00435     hr = CLASS_E_NOAGGREGATION;
00436   else
00437   {
00438     // Instantiate a COCar COM Object.
00439     pCob = new COCar(pUnkOuter, m_pServer);
00440     if (NULL != pCob)
00441     {
00442       // We initially created the new COM object so tell the server
00443       // to increment its global server object count to help ensure
00444       // that the server remains loaded until this partial creation
00445       // of a COM component is completed.
00446       m_pServer->ObjectsUp();
00447
00448       // We QueryInterface this new COM Object not only to deposit the
00449       // main interface pointer to the caller's pointer variable, but to
00450       // also automatically bump the Reference Count on the new COM
00451       // Object after handing out this reference to it.
00452       hr = pCob->QueryInterface(riid, (PPVOID)ppv);
00453       if (FAILED(hr))
00454       {
00455         m_pServer->ObjectsDown();
00456         delete pCob;
00457       }
00458     }
00459     else
00460       hr = E_OUTOFMEMORY;
00461   }
00462
00463   if (SUCCEEDED(hr))
00464   {
00465     LOGF1("S: CFCar::CImpIClassFactory::CreateInstance Succeeded. *ppv=0x%X.",*ppv);
00466   }
00467   else
00468   {
00469     LOG("S: CFCar::CImpIClassFactory::CreateInstance Failed.");
00470   }
00471
00472   return hr;
00473 }
00474
00475
00476 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00477   Method:   CFCar::CImpIClassFactory::LockServer
00478
00479   Summary:  The LockServer member method of this IClassFactory interface
00480             implementation.
00481
00482   Args:     BOOL fLock)
00483               [in] Flag determining whether to Lock or Unlock the server.
00484
00485   Returns:  HRESULT
00486               Standard result code. NOERROR for success.
00487 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00488 STDMETHODIMP CFCar::CImpIClassFactory::LockServer(
00489                BOOL fLock)
00490 {
00491   HRESULT hr = NOERROR;
00492
00493   LOG("S: CFCar::CImpIClassFactory::LockServer.");
00494
00495   if (fLock)
00496     m_pServer->Lock();
00497   else
00498     m_pServer->Unlock();
00499
00500   return hr;
00501 }
00502
00503
00504 /*---------------------------------------------------------------------------
00505   Implementation the CFUtilityCar Class Factory.  CFUtilityCar is the COM
00506   object class for the Class Factory that can manufacture COUtilityCar
00507   COM Components.
00508 ---------------------------------------------------------------------------*/
00509
00510 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00511   Method:   CFUtilityCar::CFUtilityCar
00512
00513   Summary:  CFUtilityCar Constructor. Note the member initializer:
00514             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00515             to pass the 'this', pUnkOuter, and pServer pointers of this
00516             constructor function to the constructor executed in the
00517             instantiation of the CImpIClassFactory interface whose
00518             implementation is nested inside this present object class.
00519
00520   Args:     IUnknown* pUnkOuter,
00521               Pointer to the the outer Unknown.  NULL means this COM Object
00522               is not being Aggregated.  Non NULL means it is being created
00523               on behalf of an outside COM object that is reusing it via
00524               aggregation.
00525             CServer* pServer)
00526               Pointer to the server's control object.
00527
00528   Modifies: m_cRefs, m_pUnkOuter.
00529
00530   Returns:  void
00531 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00532 CFUtilityCar::CFUtilityCar(
00533   IUnknown* pUnkOuter,
00534   CServer* pServer) :
00535   m_ImpIClassFactory(this, pUnkOuter, pServer)
00536 {
00537   // Zero the COM object's reference count.
00538   m_cRefs = 0;
00539
00540   // No AddRef necessary if non-NULL, as we're nested.
00541   m_pUnkOuter = pUnkOuter;
00542
00543   // Init the pointer to the server control object.
00544   m_pServer = pServer;
00545
00546   LOGF1("S: CFUtilityCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00547
00548   return;
00549 }
00550
00551
00552 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00553   Method:   CFUtilityCar::~CFUtilityCar
00554
00555   Summary:  CFUtilityCar Destructor.
00556
00557   Args:     void
00558
00559   Returns:  void
00560 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00561 CFUtilityCar::~CFUtilityCar(void)
00562 {
00563   LOG("S: CFUtilityCar::Destructor.");
00564
00565   return;
00566 }
00567
00568
00569 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00570   Method:   CFUtilityCar::QueryInterface
00571
00572   Summary:  QueryInterface of the CFUtilityCar non-delegating
00573             IUnknown implementation.
00574
00575   Args:     REFIID riid,
00576               [in] GUID of the Interface being requested.
00577             PPVOID ppv)
00578               [out] Address of the caller's pointer variable that will
00579               receive the requested interface pointer.
00580
00581   Returns:  HRESULT
00582               Standard result code. NOERROR for success.
00583 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00584 STDMETHODIMP CFUtilityCar::QueryInterface(
00585                REFIID riid,
00586                PPVOID ppv)
00587 {
00588   HRESULT hr = E_NOINTERFACE;
00589   *ppv = NULL;
00590
00591   if (IID_IUnknown == riid)
00592   {
00593     *ppv = this;
00594     LOG("S: CFUtilityCar::QueryInterface. 'this' pIUnknown returned.");
00595   }
00596   else if (IID_IClassFactory == riid)
00597   {
00598     *ppv = &m_ImpIClassFactory;
00599     LOG("S: CFUtilityCar::QueryInterface. pIClassFactory returned.");
00600   }
00601
00602   if (NULL != *ppv)
00603   {
00604     // We've handed out a pointer to the interface so obey the COM rules
00605     //   and AddRef the reference count.
00606     ((LPUNKNOWN)*ppv)->AddRef();
00607     hr = NOERROR;
00608   }
00609
00610   return (hr);
00611 }
00612
00613
00614 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00615   Method:   CFUtilityCar::AddRef
00616
00617   Summary:  AddRef of the CFUtilityCar non-delegating IUnknown implementation.
00618
00619   Args:     void
00620
00621   Modifies: m_cRefs.
00622
00623   Returns:  ULONG
00624               New value of m_cRefs (COM object's reference count).
00625 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00626 STDMETHODIMP_(ULONG) CFUtilityCar::AddRef(void)
00627 {
00628   m_cRefs++;
00629
00630   LOGF1("S: CFUtilityCar::AddRef. New cRefs=%i.", m_cRefs);
00631
00632   return m_cRefs;
00633 }
00634
00635
00636 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00637   Method:   CFUtilityCar::Release
00638
00639   Summary:  Release of the CFUtilityCar non-delegating IUnknown implementation.
00640
00641   Args:     void
00642
00643   Modifies: m_cRefs.
00644
00645   Returns:  ULONG
00646               New value of m_cRefs (COM object's reference count).
00647 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00648 STDMETHODIMP_(ULONG) CFUtilityCar::Release(void)
00649 {
00650   m_cRefs--;
00651
00652   LOGF1("S: CFUtilityCar::Release. New cRefs=%i.", m_cRefs);
00653
00654   if (0 == m_cRefs)
00655   {
00656     // We've reached a zero reference count for this COM object.
00657     // So we tell the server housing to decrement its global object
00658     // count so that the server will be unloaded if appropriate.
00659     if (NULL != m_pServer)
00660       m_pServer->ObjectsDown();
00661
00662     // We artificially bump the main ref count to prevent reentrancy
00663     // via the main object destructor.  Not really needed in this
00664     // CFUtilityCar but a good practice because we are aggregatable and
00665     // may at some point in the future add something entertaining like
00666     // some Releases to the CFUtilityCar destructor.
00667     m_cRefs++;
00668     delete this;
00669   }
00670
00671   return m_cRefs;
00672 }
00673
00674
00675 /*---------------------------------------------------------------------------
00676   CFUtilityCar's nested implementation of the IClassFactory interface
00677   including Constructor, Destructor, QueryInterface, AddRef, Release,
00678   CreateInstance, and LockServer methods.
00679 ---------------------------------------------------------------------------*/
00680
00681 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00682   Method:   CFUtilityCar::CImpIClassFactory::CImpIClassFactory
00683
00684   Summary:  Constructor for the CImpIClassFactory interface instantiation.
00685
00686   Args:     CFUtilityCar* pBackObj,
00687               Back pointer to the parent outer object.
00688             IUnknown* pUnkOuter,
00689               Pointer to the outer Unknown.  For delegation.
00690             CServer* pServer)
00691               Pointer to the server's control object.
00692
00693   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter, m_pServer.
00694
00695   Returns:  void
00696 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00697 CFUtilityCar::CImpIClassFactory::CImpIClassFactory(
00698   CFUtilityCar* pBackObj,
00699   IUnknown* pUnkOuter,
00700   CServer* pServer)
00701 {
00702   // Init the Interface Ref Count (used for debugging only).
00703   m_cRefI = 0;
00704
00705   // Init the Back Object Pointer to point to the parent object.
00706   m_pBackObj = pBackObj;
00707
00708   // Init the pointer to the server control object.
00709   m_pServer = pServer;
00710
00711   // Init the CImpIClassFactory interface's delegating Unknown pointer.
00712   // We use the Back Object pointer for IUnknown delegation here if we are
00713   // not being aggregated.  If we are being aggregated we use the supplied
00714   // pUnkOuter for IUnknown delegation.  In either case the pointer
00715   // assignment requires no AddRef because the CImpIClassFactory lifetime is
00716   // quaranteed by the lifetime of the parent object in which
00717   // CImpIClassFactory is nested.
00718   if (NULL == pUnkOuter)
00719   {
00720     m_pUnkOuter = pBackObj;
00721     LOG("S: CFUtilityCar::CImpIClassFactory Constructor. Non-Aggregating.");
00722   }
00723   else
00724   {
00725     m_pUnkOuter = pUnkOuter;
00726     LOG("S: CFUtilityCar::CImpIClassFactory Constructor. Aggregating.");
00727   }
00728
00729   return;
00730 }
00731
00732
00733 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00734   Method:   CFUtilityCar::CImpIClassFactory::~CImpIClassFactory
00735
00736   Summary:  Destructor for the CImpIClassFactory interface instantiation.
00737
00738   Args:     void
00739
00740   Returns:  void
00741 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00742 CFUtilityCar::CImpIClassFactory::~CImpIClassFactory(void)
00743 {
00744   LOG("S: CFUtilityCar::CImpIClassFactory Destructor.");
00745
00746   return;
00747 }
00748
00749
00750 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00751   Method:   CFUtilityCar::CImpIClassFactory::QueryInterface
00752
00753   Summary:  The QueryInterface IUnknown member of this IClassFactory
00754             interface implementation that delegates to m_pUnkOuter,
00755             whatever it is.
00756
00757   Args:     REFIID riid,
00758               [in] GUID of the Interface being requested.
00759             PPVOID ppv)
00760               [out] Address of the caller's pointer variable that will
00761               receive the requested interface pointer.
00762
00763   Returns:  HRESULT
00764               Standard result code. NOERROR for success.
00765               Returned by the delegated outer QueryInterface call.
00766 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00767 STDMETHODIMP CFUtilityCar::CImpIClassFactory::QueryInterface(
00768                REFIID riid,
00769                PPVOID ppv)
00770 {
00771   LOG("S: CFUtilityCar::CImpIClassFactory::QueryInterface. Delegating.");
00772
00773   // Delegate this call to the outer object's QueryInterface.
00774   return m_pUnkOuter->QueryInterface(riid, ppv);
00775 }
00776
00777
00778 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00779   Method:   CFUtilityCar::CImpIClassFactory::AddRef
00780
00781   Summary:  The AddRef IUnknown member of this IClassFactory interface
00782             implementation that delegates to m_pUnkOuter, whatever it is.
00783
00784   Args:     void
00785
00786   Modifies: m_cRefI.
00787
00788   Returns:  ULONG
00789               Returned by the delegated outer AddRef call.
00790 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00791 STDMETHODIMP_(ULONG) CFUtilityCar::CImpIClassFactory::AddRef(void)
00792 {
00793   // Increment the Interface Reference Count.
00794   ++m_cRefI;
00795
00796   LOGF1("S: CFUtilityCar::CImpIClassFactory::Addref. Delegating. New cI=%i.",m_cRefI);
00797
00798   // Delegate this call to the outer object's AddRef.
00799   return m_pUnkOuter->AddRef();
00800 }
00801
00802
00803 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00804   Method:   CFUtilityCar::CImpIClassFactory::Release
00805
00806   Summary:  The Release IUnknown member of this IClassFactory interface
00807             implementation that delegates to m_pUnkOuter, whatever it is.
00808
00809   Args:     void
00810
00811   Returns:  ULONG
00812               Returned by the delegated outer Release call.
00813 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00814 STDMETHODIMP_(ULONG) CFUtilityCar::CImpIClassFactory::Release(void)
00815 {
00816   // Decrement the Interface Reference Count.
00817   --m_cRefI;
00818
00819   LOGF1("S: CFUtilityCar::CImpIClassFactory::Release. Delegating. New cI=%i.",m_cRefI);
00820
00821   // Delegate this call to the outer object's Release.
00822   return m_pUnkOuter->Release();
00823 }
00824
00825
00826 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00827   Method:   CFUtilityCar::CImpIClassFactory::CreateInstance
00828
00829   Summary:  The CreateInstance member method of this IClassFactory interface
00830             implementation.  Creates an instance of the COUtilityCar COM
00831             component.
00832
00833   Args:     IUnknown* pUnkOuter,
00834               [in] Pointer to the controlling IUnknown.
00835             REFIID riid,
00836               [in] GUID of the Interface being requested.
00837             PPVOID ppvCob)
00838               [out] Address of the caller's pointer variable that will
00839               receive the requested interface pointer.
00840
00841   Returns:  HRESULT
00842               Standard result code. NOERROR for success.
00843 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00844 STDMETHODIMP CFUtilityCar::CImpIClassFactory::CreateInstance(
00845                IUnknown* pUnkOuter,
00846                REFIID riid,
00847                PPVOID ppv)
00848 {
00849   HRESULT hr = E_FAIL;
00850   COUtilityCar* pCob = NULL;
00851
00852   LOGF1("S: CFUtilityCar::CImpIClassFactory::CreateInstance. pUnkOuter=0x%X.",pUnkOuter);
00853
00854   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00855   // the COM rules state the IUnknown interface MUST also be concomitantly
00856   // be requested.  If it is not so requested ( riid != IID_IUnknown) then
00857   // an error must be returned indicating that no aggregate creation of
00858   // the COUtilityCar COM Object can be performed.
00859   if (NULL != pUnkOuter && riid != IID_IUnknown)
00860     hr = CLASS_E_NOAGGREGATION;
00861   else
00862   {
00863     // Instantiate a COUtilityCar COM Object.
00864     pCob = new COUtilityCar(pUnkOuter, m_pServer);
00865     if (NULL != pCob)
00866     {
00867       // We initially created the new COM object so tell the server
00868       // to increment its global server object count to help ensure
00869       // that the server remains loaded until this partial creation
00870       // of a COM component is completed.
00871       m_pServer->ObjectsUp();
00872
00873       // If we have succeeded in instantiating the COM object we
00874       // initialize it to set up any subordinate objects.
00875       hr = pCob->Init();
00876       if (SUCCEEDED(hr))
00877       {
00878         // We QueryInterface this new COM Object not only to deposit the
00879         // main interface pointer to the caller's pointer variable, but to
00880         // also automatically bump the Reference Count on the new COM
00881         // Object after handing out this reference to it.
00882         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
00883       }
00884
00885       if (FAILED(hr))
00886       {
00887         m_pServer->ObjectsDown();
00888         delete pCob;
00889       }
00890     }
00891     else
00892       hr = E_OUTOFMEMORY;
00893   }
00894
00895   if (SUCCEEDED(hr))
00896   {
00897     LOGF1("S: CFUtilityCar::CImpIClassFactory::CreateInstance Succeeded. *ppv=0x%X.",*ppv);
00898   }
00899   else
00900   {
00901     LOG("S: CFUtilityCar::CImpIClassFactory::CreateInstance Failed.");
00902   }
00903
00904   return hr;
00905 }
00906
00907
00908 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00909   Method:   CFUtilityCar::CImpIClassFactory::LockServer
00910
00911   Summary:  The LockServer member method of this IClassFactory interface
00912             implementation.
00913
00914   Args:     BOOL fLock)
00915               [in] Flag determining whether to Lock or Unlock the server.
00916
00917   Returns:  HRESULT
00918               Standard result code. NOERROR for success.
00919 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00920 STDMETHODIMP CFUtilityCar::CImpIClassFactory::LockServer(
00921                BOOL fLock)
00922 {
00923   HRESULT hr = NOERROR;
00924
00925   LOG("S: CFUtilityCar::CImpIClassFactory::LockServer.");
00926
00927   if (fLock)
00928     m_pServer->Lock();
00929   else
00930     m_pServer->Unlock();
00931
00932   return hr;
00933 }
00934
00935
00936 /*---------------------------------------------------------------------------
00937   Implementation the CFCruiseCar Class Factory.  CFCruiseCar is the COM
00938   object class for the Class Factory that can manufacture COCruiseCar
00939   COM Components.
00940 ---------------------------------------------------------------------------*/
00941
00942 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00943   Method:   CFCruiseCar::CFCruiseCar
00944
00945   Summary:  CFCruiseCar Constructor. Note the member initializer:
00946             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00947             to pass the 'this', pUnkOuter, and pServer pointers of this
00948             constructor function to the constructor executed in the
00949             instantiation of the CImpIClassFactory interface whose
00950             implementation is nested inside this present object class.
00951
00952   Args:     IUnknown* pUnkOuter,
00953               Pointer to the the outer Unknown.  NULL means this COM Object
00954               is not being Aggregated.  Non NULL means it is being created
00955               on behalf of an outside COM object that is reusing it via
00956               aggregation.
00957             CServer* pServer)
00958               Pointer to the server's control object.
00959
00960   Modifies: m_cRefs, m_pUnkOuter, m_pServer.
00961
00962   Returns:  void
00963 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00964 CFCruiseCar::CFCruiseCar(
00965   IUnknown* pUnkOuter,
00966   CServer* pServer) :
00967   m_ImpIClassFactory(this, pUnkOuter, pServer)
00968 {
00969   // Zero the COM object's reference count.
00970   m_cRefs = 0;
00971
00972   // No AddRef necessary if non-NULL, as we're nested.
00973   m_pUnkOuter = pUnkOuter;
00974
00975   // Init the pointer to the server control object.
00976   m_pServer = pServer;
00977
00978   LOGF1("S: CFCruiseCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00979
00980   return;
00981 }
00982
00983
00984 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00985   Method:   CFCruiseCar::~CFCruiseCar
00986
00987   Summary:  CFCruiseCar Destructor.
00988
00989   Args:     void
00990
00991   Returns:  void
00992 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00993 CFCruiseCar::~CFCruiseCar(void)
00994 {
00995   LOG("S: CFCruiseCar::Destructor.");
00996
00997   return;
00998 }
00999
01000
01001 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01002   Method:   CFCruiseCar::QueryInterface
01003
01004   Summary:  QueryInterface of the CFCruiseCar non-delegating
01005             IUnknown implementation.
01006
01007   Args:     REFIID riid,
01008               [in] GUID of the Interface being requested.
01009             PPVOID ppv)
01010               [out] Address of the caller's pointer variable that will
01011               receive the requested interface pointer.
01012
01013   Returns:  HRESULT
01014               Standard result code. NOERROR for success.
01015 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01016 STDMETHODIMP CFCruiseCar::QueryInterface(
01017                REFIID riid,
01018                PPVOID ppv)
01019 {
01020   HRESULT hr = E_NOINTERFACE;
01021   *ppv = NULL;
01022
01023   if (IID_IUnknown == riid)
01024   {
01025     *ppv = this;
01026     LOG("S: CFCruiseCar::QueryInterface. 'this' pIUnknown returned.");
01027   }
01028   else if (IID_IClassFactory == riid)
01029   {
01030     *ppv = &m_ImpIClassFactory;
01031     LOG("S: CFCruiseCar::QueryInterface. pIClassFactory returned.");
01032   }
01033
01034   if (NULL != *ppv)
01035   {
01036     // We've handed out a pointer to the interface so obey the COM rules
01037     //   and AddRef the reference count.
01038     ((LPUNKNOWN)*ppv)->AddRef();
01039     hr = NOERROR;
01040   }
01041
01042   return (hr);
01043 }
01044
01045
01046 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01047   Method:   CFCruiseCar::AddRef
01048
01049   Summary:  AddRef of the CFCruiseCar non-delegating IUnknown implementation.
01050
01051   Args:     void
01052
01053   Modifies: m_cRefs.
01054
01055   Returns:  ULONG
01056               New value of m_cRefs (COM object's reference count).
01057 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01058 STDMETHODIMP_(ULONG) CFCruiseCar::AddRef(void)
01059 {
01060   m_cRefs++;
01061
01062   LOGF1("S: CFCruiseCar::AddRef. New cRefs=%i.", m_cRefs);
01063
01064   return m_cRefs;
01065 }
01066
01067
01068 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01069   Method:   CFCruiseCar::Release
01070
01071   Summary:  Release of the CFCruiseCar non-delegating IUnknown implementation.
01072
01073   Args:     void
01074
01075   Modifies: m_cRefs.
01076
01077   Returns:  ULONG
01078               New value of m_cRefs (COM object's reference count).
01079 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01080 STDMETHODIMP_(ULONG) CFCruiseCar::Release(void)
01081 {
01082   m_cRefs--;
01083
01084   LOGF1("S: CFCruiseCar::Release. New cRefs=%i.", m_cRefs);
01085
01086   if (0 == m_cRefs)
01087   {
01088     // We've reached a zero reference count for this COM object.
01089     // So we tell the server housing to decrement its global object
01090     // count so that the server will be unloaded if appropriate.
01091     if (NULL != m_pServer)
01092       m_pServer->ObjectsDown();
01093
01094     // We artificially bump the main ref count to prevent reentrancy
01095     // via the main object destructor.  Not really needed in this
01096     // CFCruiseCar but a good practice because we are aggregatable and
01097     // may at some point in the future add something entertaining like
01098     // some Releases to the CFCruiseCar destructor.
01099     m_cRefs++;
01100     delete this;
01101   }
01102
01103   return m_cRefs;
01104 }
01105
01106
01107 /*---------------------------------------------------------------------------
01108   CFCruiseCar's nested implementation of the IClassFactory interface
01109   including Constructor, Destructor, QueryInterface, AddRef, Release,
01110   CreateInstance, and LockServer methods.
01111 ---------------------------------------------------------------------------*/
01112
01113 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01114   Method:   CFCruiseCar::CImpIClassFactory::CImpIClassFactory
01115
01116   Summary:  Constructor for the CImpIClassFactory interface instantiation.
01117
01118   Args:     CFCruiseCar* pBackObj,
01119               Back pointer to the parent outer object.
01120             IUnknown* pUnkOuter,
01121               Pointer to the outer Unknown.  For delegation.
01122             CServer* pServer)
01123               Pointer to the server's control object.
01124
01125   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter, m_pServer.
01126
01127   Returns:  void
01128 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01129 CFCruiseCar::CImpIClassFactory::CImpIClassFactory(
01130   CFCruiseCar* pBackObj,
01131   IUnknown* pUnkOuter,
01132   CServer* pServer)
01133 {
01134   // Init the Interface Ref Count (used for debugging only).
01135   m_cRefI = 0;
01136
01137   // Init the Back Object Pointer to point to the parent object.
01138   m_pBackObj = pBackObj;
01139
01140   // Init the pointer to the server control object.
01141   m_pServer = pServer;
01142
01143   // Init the CImpIClassFactory interface's delegating Unknown pointer.
01144   // We use the Back Object pointer for IUnknown delegation here if we are
01145   // not being aggregated.  If we are being aggregated we use the supplied
01146   // pUnkOuter for IUnknown delegation.  In either case the pointer
01147   // assignment requires no AddRef because the CImpIClassFactory lifetime is
01148   // quaranteed by the lifetime of the parent object in which
01149   // CImpIClassFactory is nested.
01150   if (NULL == pUnkOuter)
01151   {
01152     m_pUnkOuter = pBackObj;
01153     LOG("S: CFCruiseCar::CImpIClassFactory Constructor. Non-Aggregating.");
01154   }
01155   else
01156   {
01157     m_pUnkOuter = pUnkOuter;
01158     LOG("S: CFCruiseCar::CImpIClassFactory Constructor. Aggregating.");
01159   }
01160
01161   return;
01162 }
01163
01164
01165 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01166   Method:   CFCruiseCar::CImpIClassFactory::~CImpIClassFactory
01167
01168   Summary:  Destructor for the CImpIClassFactory interface instantiation.
01169
01170   Args:     void
01171
01172   Returns:  void
01173 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01174 CFCruiseCar::CImpIClassFactory::~CImpIClassFactory(void)
01175 {
01176   LOG("S: CFCruiseCar::CImpIClassFactory Destructor.");
01177
01178   return;
01179 }
01180
01181
01182 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01183   Method:   CFCruiseCar::CImpIClassFactory::QueryInterface
01184
01185   Summary:  The QueryInterface IUnknown member of this IClassFactory
01186             interface implementation that delegates to m_pUnkOuter,
01187             whatever it is.
01188
01189   Args:     REFIID riid,
01190               [in] GUID of the Interface being requested.
01191             PPVOID ppv)
01192               [out] Address of the caller's pointer variable that will
01193               receive the requested interface pointer.
01194
01195   Returns:  HRESULT
01196               Standard result code. NOERROR for success.
01197               Returned by the delegated outer QueryInterface call.
01198 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01199 STDMETHODIMP CFCruiseCar::CImpIClassFactory::QueryInterface(
01200                REFIID riid,
01201                PPVOID ppv)
01202 {
01203   LOG("S: CFCruiseCar::CImpIClassFactory::QueryInterface. Delegating.");
01204
01205   // Delegate this call to the outer object's QueryInterface.
01206   return m_pUnkOuter->QueryInterface(riid, ppv);
01207 }
01208
01209
01210 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01211   Method:   CFCruiseCar::CImpIClassFactory::AddRef
01212
01213   Summary:  The AddRef IUnknown member of this IClassFactory interface
01214             implementation that delegates to m_pUnkOuter, whatever it is.
01215
01216   Args:     void
01217
01218   Modifies: m_cRefI.
01219
01220   Returns:  ULONG
01221               Returned by the delegated outer AddRef call.
01222 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01223 STDMETHODIMP_(ULONG) CFCruiseCar::CImpIClassFactory::AddRef(void)
01224 {
01225   // Increment the Interface Reference Count.
01226   ++m_cRefI;
01227
01228   LOGF1("S: CFCruiseCar::CImpIClassFactory::Addref. Delegating. New cI=%i.",m_cRefI);
01229
01230   // Delegate this call to the outer object's AddRef.
01231   return m_pUnkOuter->AddRef();
01232 }
01233
01234
01235 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01236   Method:   CFCruiseCar::CImpIClassFactory::Release
01237
01238   Summary:  The Release IUnknown member of this IClassFactory interface
01239             implementation that delegates to m_pUnkOuter, whatever it is.
01240
01241   Args:     void
01242
01243   Returns:  ULONG
01244               Returned by the delegated outer Release call.
01245 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01246 STDMETHODIMP_(ULONG) CFCruiseCar::CImpIClassFactory::Release(void)
01247 {
01248   // Decrement the Interface Reference Count.
01249   --m_cRefI;
01250
01251   LOGF1("S: CFCruiseCar::CImpIClassFactory::Release. Delegating. New cI=%i.",m_cRefI);
01252
01253   // Delegate this call to the outer object's Release.
01254   return m_pUnkOuter->Release();
01255 }
01256
01257
01258 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01259   Method:   CFCruiseCar::CImpIClassFactory::CreateInstance
01260
01261   Summary:  The CreateInstance member method of this IClassFactory interface
01262             implementation.  Creates an instance of the COCruiseCar COM
01263             component.
01264
01265   Args:     IUnknown* pUnkOuter,
01266               [in] Pointer to the controlling IUnknown.
01267             REFIID riid,
01268               [in] GUID of the Interface being requested.
01269             PPVOID ppvCob)
01270               [out] Address of the caller's pointer variable that will
01271               receive the requested interface pointer.
01272
01273   Returns:  HRESULT
01274               Standard result code. NOERROR for success.
01275 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01276 STDMETHODIMP CFCruiseCar::CImpIClassFactory::CreateInstance(
01277                IUnknown* pUnkOuter,
01278                REFIID riid,
01279                PPVOID ppv)
01280 {
01281   HRESULT hr = E_FAIL;
01282   COCruiseCar* pCob = NULL;
01283
01284   LOGF1("S: CFCruiseCar::CImpIClassFactory::CreateInstance. pUnkOuter=0x%X.",pUnkOuter);
01285
01286   // If the creation call is requesting aggregation (pUnkOuter != NULL),
01287   // the COM rules state the IUnknown interface MUST also be concomitantly
01288   // be requested.  If it is not so requested ( riid != IID_IUnknown) then
01289   // an error must be returned indicating that no aggregate creation of
01290   // the COCruiseCarFactory COM Object can be performed.
01291   if (NULL != pUnkOuter && riid != IID_IUnknown)
01292     hr = CLASS_E_NOAGGREGATION;
01293   else
01294   {
01295     // Instantiate a COCruiseCar COM Object.
01296     pCob = new COCruiseCar(pUnkOuter, m_pServer);
01297     if (NULL != pCob)
01298     {
01299       // We initially created the new COM object so tell the server
01300       // to increment its global server object count to help ensure
01301       // that the server remains loaded until this partial creation
01302       // of a COM component is completed.
01303       m_pServer->ObjectsUp();
01304
01305       // If we have succeeded in instantiating the COM object we
01306       // initialize it to set up any subordinate objects.
01307       hr = pCob->Init();
01308       if (SUCCEEDED(hr))
01309       {
01310         // We QueryInterface this new COM Object not only to deposit the
01311         // main interface pointer to the caller's pointer variable, but to
01312         // also automatically bump the Reference Count on the new COM
01313         // Object after handing out this reference to it.
01314         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
01315       }
01316
01317       if (FAILED(hr))
01318       {
01319         m_pServer->ObjectsDown();
01320         delete pCob;
01321       }
01322     }
01323     else
01324       hr = E_OUTOFMEMORY;
01325   }
01326
01327   if (SUCCEEDED(hr))
01328   {
01329     LOGF1("S: CFCruiseCar::CImpIClassFactory::CreateInstance Succeeded. *ppv=0x%X.",*ppv);
01330   }
01331   else
01332   {
01333     LOG("S: CFCruiseCar::CImpIClassFactory::CreateInstance Failed.");
01334   }
01335
01336   return hr;
01337 }
01338
01339
01340 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01341   Method:   CFCruiseCar::CImpIClassFactory::LockServer
01342
01343   Summary:  The LockServer member method of this IClassFactory interface
01344             implementation.
01345
01346   Args:     BOOL fLock)
01347               [in] Flag determining whether to Lock or Unlock the server.
01348
01349   Returns:  HRESULT
01350               Standard result code. NOERROR for success.
01351 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01352 STDMETHODIMP CFCruiseCar::CImpIClassFactory::LockServer(
01353                BOOL fLock)
01354 {
01355   HRESULT hr = NOERROR;
01356
01357   LOG("S: CFCruiseCar::CImpIClassFactory::LockServer.");
01358
01359   if (fLock)
01360     m_pServer->Lock();
01361   else
01362     m_pServer->Unlock();
01363
01364   return hr;
01365 }
01366
01367
01368 /*---------------------------------------------------------------------------
01369   Implementation the CFCarSample Class Factory.  CFCarSample is the COM
01370   object class for the Class Factory that can manufacture COCarSample
01371   COM Components.
01372 ---------------------------------------------------------------------------*/
01373
01374 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01375   Method:   CFCarSample::CFCarSample
01376
01377   Summary:  CFCruiseCar Constructor. Note the member initializer:
01378             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
01379             to pass the 'this', pUnkOuter, and pServer pointers of this
01380             constructor function to the constructor executed in the
01381             instantiation of the CImpIClassFactory interface whose
01382             implementation is nested inside this present object class.
01383
01384   Args:     IUnknown* pUnkOuter,
01385               Pointer to the the outer Unknown.  NULL means this COM Object
01386               is not being Aggregated.  Non NULL means it is being created
01387               on behalf of an outside COM object that is reusing it via
01388               aggregation.
01389             CServer* pServer)
01390               Pointer to the server's control object.
01391
01392   Modifies: m_cRefs, m_pUnkOuter.
01393
01394   Returns:  void
01395 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01396 CFCarSample::CFCarSample(
01397   IUnknown* pUnkOuter,
01398   CServer* pServer) :
01399   m_ImpIClassFactory(this, pUnkOuter, pServer)
01400 {
01401   // Zero the COM object's reference count.
01402   m_cRefs = 0;
01403
01404   // No AddRef necessary if non-NULL, as we're nested.
01405   m_pUnkOuter = pUnkOuter;
01406
01407   // Init the pointer to the server control object.
01408   m_pServer = pServer;
01409
01410   LOGF1("S: CFCarSample Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
01411
01412   return;
01413 }
01414
01415
01416 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01417   Method:   CFCarSample::~CFCarSample
01418
01419   Summary:  CFCarSample Destructor.
01420
01421   Args:     void
01422
01423   Returns:  void
01424 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01425 CFCarSample::~CFCarSample(void)
01426 {
01427   LOG("S: CFCarSample::Destructor.");
01428
01429   return;
01430 }
01431
01432
01433 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01434   Method:   CFCarSample::QueryInterface
01435
01436   Summary:  QueryInterface of the CFCarSample non-delegating
01437             IUnknown implementation.
01438
01439   Args:     REFIID riid,
01440               [in] GUID of the Interface being requested.
01441             PPVOID ppv)
01442               [out] Address of the caller's pointer variable that will
01443               receive the requested interface pointer.
01444
01445   Returns:  HRESULT
01446               Standard result code. NOERROR for success.
01447 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01448 STDMETHODIMP CFCarSample::QueryInterface(
01449                REFIID riid,
01450                PPVOID ppv)
01451 {
01452   HRESULT hr = E_NOINTERFACE;
01453   *ppv = NULL;
01454
01455   if (IID_IUnknown == riid)
01456   {
01457     *ppv = this;
01458     LOG("S: CFCarSample::QueryInterface. 'this' pIUnknown returned.");
01459   }
01460   else if (IID_IClassFactory == riid)
01461   {
01462     *ppv = &m_ImpIClassFactory;
01463     LOG("S: CFCarSample::QueryInterface. pIClassFactory returned.");
01464   }
01465
01466   if (NULL != *ppv)
01467   {
01468     // We've handed out a pointer to the interface so obey the COM rules
01469     //   and AddRef the reference count.
01470     ((LPUNKNOWN)*ppv)->AddRef();
01471     hr = NOERROR;
01472   }
01473
01474   return (hr);
01475 }
01476
01477
01478 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01479   Method:   CFCarSample::AddRef
01480
01481   Summary:  AddRef of the CFCarSample non-delegating IUnknown implementation.
01482
01483   Args:     void
01484
01485   Modifies: m_cRefs.
01486
01487   Returns:  ULONG
01488               New value of m_cRefs (COM object's reference count).
01489 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01490 STDMETHODIMP_(ULONG) CFCarSample::AddRef(void)
01491 {
01492   m_cRefs++;
01493
01494   LOGF1("S: CFCarSample::AddRef. New cRefs=%i.", m_cRefs);
01495
01496   return m_cRefs;
01497 }
01498
01499
01500 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01501   Method:   CFCarSample::Release
01502
01503   Summary:  Release of the CFCarSample non-delegating IUnknown implementation.
01504
01505   Args:     void
01506
01507   Modifies: m_cRefs.
01508
01509   Returns:  ULONG
01510               New value of m_cRefs (COM object's reference count).
01511 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01512 STDMETHODIMP_(ULONG) CFCarSample::Release(void)
01513 {
01514   m_cRefs--;
01515
01516   LOGF1("S: CFCarSample::Release. New cRefs=%i.", m_cRefs);
01517
01518   if (0 == m_cRefs)
01519   {
01520     // We've reached a zero reference count for this COM object.
01521     // So we tell the server housing to decrement its global object
01522     // count so that the server will be unloaded if appropriate.
01523     if (NULL != m_pServer)
01524       m_pServer->ObjectsDown();
01525
01526     // We artificially bump the main ref count to prevent reentrancy
01527     // via the main object destructor.  Not really needed in this
01528     // CFCarSample but a good practice because we are aggregatable and
01529     // may at some point in the future add something entertaining like
01530     // some Releases to the CFCarSample destructor.
01531     m_cRefs++;
01532     delete this;
01533   }
01534
01535   return m_cRefs;
01536 }
01537
01538
01539 /*---------------------------------------------------------------------------
01540   CFCarSample's nested implementation of the IClassFactory interface
01541   including Constructor, Destructor, QueryInterface, AddRef, Release,
01542   CreateInstance, and LockServer methods.
01543 ---------------------------------------------------------------------------*/
01544
01545 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01546   Method:   CFCarSample::CImpIClassFactory::CImpIClassFactory
01547
01548   Summary:  Constructor for the CImpIClassFactory interface instantiation.
01549
01550   Args:     CFCarSample* pBackObj,
01551               Back pointer to the parent outer object.
01552             IUnknown* pUnkOuter,
01553               Pointer to the outer Unknown.  For delegation.
01554             CServer* pServer)
01555               Pointer to the server's control object.
01556
01557   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter, m_pServer.
01558
01559   Returns:  void
01560 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01561 CFCarSample::CImpIClassFactory::CImpIClassFactory(
01562   CFCarSample* pBackObj,
01563   IUnknown* pUnkOuter,
01564   CServer* pServer)
01565 {
01566   // Init the Interface Ref Count (used for debugging only).
01567   m_cRefI = 0;
01568
01569   // Init the Back Object Pointer to point to the parent object.
01570   m_pBackObj = pBackObj;
01571
01572   // Init the pointer to the server control object.
01573   m_pServer = pServer;
01574
01575   // Init the CImpIClassFactory interface's delegating Unknown pointer.
01576   // We use the Back Object pointer for IUnknown delegation here if we are
01577   // not being aggregated.  If we are being aggregated we use the supplied
01578   // pUnkOuter for IUnknown delegation.  In either case the pointer
01579   // assignment requires no AddRef because the CImpIClassFactory lifetime is
01580   // quaranteed by the lifetime of the parent object in which
01581   // CImpIClassFactory is nested.
01582   if (NULL == pUnkOuter)
01583   {
01584     m_pUnkOuter = pBackObj;
01585     LOG("S: CFCarSample::CImpIClassFactory Constructor. Non-Aggregating.");
01586   }
01587   else
01588   {
01589     m_pUnkOuter = pUnkOuter;
01590     LOG("S: CFCarSample::CImpIClassFactory Constructor. Aggregating.");
01591   }
01592
01593   return;
01594 }
01595
01596
01597 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01598   Method:   CFCarSample::CImpIClassFactory::~CImpIClassFactory
01599
01600   Summary:  Destructor for the CImpIClassFactory interface instantiation.
01601
01602   Args:     void
01603
01604   Returns:  void
01605 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01606 CFCarSample::CImpIClassFactory::~CImpIClassFactory(void)
01607 {
01608   LOG("S: CFCarSample::CImpIClassFactory Destructor.");
01609
01610   return;
01611 }
01612
01613
01614 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01615   Method:   CFCarSample::CImpIClassFactory::QueryInterface
01616
01617   Summary:  The QueryInterface IUnknown member of this IClassFactory
01618             interface implementation that delegates to m_pUnkOuter,
01619             whatever it is.
01620
01621   Args:     REFIID riid,
01622               [in] GUID of the Interface being requested.
01623             PPVOID ppv)
01624               [out] Address of the caller's pointer variable that will
01625               receive the requested interface pointer.
01626
01627   Returns:  HRESULT
01628               Standard result code. NOERROR for success.
01629               Returned by the delegated outer QueryInterface call.
01630 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01631 STDMETHODIMP CFCarSample::CImpIClassFactory::QueryInterface(
01632                REFIID riid,
01633                PPVOID ppv)
01634 {
01635   LOG("S: CFCarSample::CImpIClassFactory::QueryInterface. Delegating.");
01636
01637   // Delegate this call to the outer object's QueryInterface.
01638   return m_pUnkOuter->QueryInterface(riid, ppv);
01639 }
01640
01641
01642 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01643   Method:   CFCarSample::CImpIClassFactory::AddRef
01644
01645   Summary:  The AddRef IUnknown member of this IClassFactory interface
01646             implementation that delegates to m_pUnkOuter, whatever it is.
01647
01648   Args:     void
01649
01650   Modifies: m_cRefI.
01651
01652   Returns:  ULONG
01653               Returned by the delegated outer AddRef call.
01654 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01655 STDMETHODIMP_(ULONG) CFCarSample::CImpIClassFactory::AddRef(void)
01656 {
01657   // Increment the Interface Reference Count.
01658   ++m_cRefI;
01659
01660   LOGF1("S: CFCarSample::CImpIClassFactory::Addref. Delegating. New cI=%i.",m_cRefI);
01661
01662   // Delegate this call to the outer object's AddRef.
01663   return m_pUnkOuter->AddRef();
01664 }
01665
01666
01667 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01668   Method:   CFCarSample::CImpIClassFactory::Release
01669
01670   Summary:  The Release IUnknown member of this IClassFactory interface
01671             implementation that delegates to m_pUnkOuter, whatever it is.
01672
01673   Args:     void
01674
01675   Returns:  ULONG
01676               Returned by the delegated outer Release call.
01677 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01678 STDMETHODIMP_(ULONG) CFCarSample::CImpIClassFactory::Release(void)
01679 {
01680   // Decrement the Interface Reference Count.
01681   --m_cRefI;
01682
01683   LOGF1("S: CFCarSample::CImpIClassFactory::Release. Delegating. New cI=%i.",m_cRefI);
01684
01685   // Delegate this call to the outer object's Release.
01686   return m_pUnkOuter->Release();
01687 }
01688
01689
01690 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01691   Method:   CFCarSample::CImpIClassFactory::CreateInstance
01692
01693   Summary:  The CreateInstance member method of this IClassFactory
01694             interface implementation.  Creates an instance of the
01695             COCarSample COM component.
01696
01697   Args:     IUnknown* pUnkOuter,
01698               [in] Pointer to the controlling IUnknown.
01699             REFIID riid,
01700               [in] GUID of the Interface being requested.
01701             PPVOID ppv)
01702               [out] Address of the caller's pointer variable that will
01703               receive the requested interface pointer.
01704
01705   Returns:  HRESULT
01706               Standard result code. NOERROR for success.
01707 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01708 STDMETHODIMP CFCarSample::CImpIClassFactory::CreateInstance(
01709                IUnknown* pUnkOuter,
01710                REFIID riid,
01711                PPVOID ppv)
01712 {
01713   HRESULT hr = E_FAIL;
01714   COCarSample* pCob = NULL;
01715
01716   LOGF1("S: CFCarSample::CImpIClassFactory::CreateInstance. pUnkOuter=0x%X.",pUnkOuter);
01717
01718   // If the creation call is requesting aggregation (pUnkOuter != NULL),
01719   // the COM rules state the IUnknown interface MUST also be concomitantly
01720   // be requested.  If it is not so requested ( riid != IID_IUnknown) then
01721   // an error must be returned indicating that no aggregate creation of
01722   // the CFCarSample COM Object can be performed.
01723   if (NULL != pUnkOuter && riid != IID_IUnknown)
01724     hr = CLASS_E_NOAGGREGATION;
01725   else
01726   {
01727     // Instantiate a COCarSample COM Object.
01728     pCob = new COCarSample(pUnkOuter, m_pServer);
01729     if (NULL != pCob)
01730     {
01731       // We initially created the new COM object so tell the server
01732       // to increment its global server object count to help ensure
01733       // that the server remains loaded until this partial creation
01734       // of a COM component is completed.
01735       m_pServer->ObjectsUp();
01736
01737       // We QueryInterface this new COM Object not only to deposit the
01738       // main interface pointer to the caller's pointer variable, but to
01739       // also automatically bump the Reference Count on the new COM
01740       // Object after handing out this reference to it.
01741       hr = pCob->QueryInterface(riid, (PPVOID)ppv);
01742       if (FAILED(hr))
01743       {
01744         m_pServer->ObjectsDown();
01745         delete pCob;
01746       }
01747     }
01748     else
01749       hr = E_OUTOFMEMORY;
01750   }
01751
01752   if (SUCCEEDED(hr))
01753   {
01754     LOGF1("S: CFCarSample::CImpIClassFactory::CreateInstance Succeeded. *ppv=0x%X.",*ppv);
01755   }
01756   else
01757   {
01758     LOG("S: CFCarSample::CImpIClassFactory::CreateInstance Failed.");
01759   }
01760
01761   return hr;
01762 }
01763
01764
01765 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01766   Method:   CFCarSample::CImpIClassFactory::LockServer
01767
01768   Summary:  The LockServer member method of this IClassFactory interface
01769             implementation.
01770
01771   Args:     BOOL fLock)
01772               [in] Flag determining whether to Lock or Unlock the server.
01773
01774   Returns:  HRESULT
01775               Standard result code. NOERROR for success.
01776 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01777 STDMETHODIMP CFCarSample::CImpIClassFactory::LockServer(
01778                BOOL fLock)
01779 {
01780   HRESULT hr = NOERROR;
01781
01782   LOG("S: CFCarSample::CImpIClassFactory::LockServer.");
01783
01784   if (fLock)
01785     m_pServer->Lock();
01786   else
01787     m_pServer->Unlock();
01788
01789   return hr;
01790 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/CompImportDlg.Cpp Source File

  • Com
  • Administration
  • Explore.VC

CompImportDlg.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 #include "stdafx.h"
00020 #include "VCExplore.h"
00021 #include "CompImportDlg.h"
00022
00023 #ifdef _DEBUG
00024 #define new DEBUG_NEW
00025 #undef THIS_FILE
00026 static char THIS_FILE[] = __FILE__;
00027 #endif
00028
00029
00030
00031 #define IMPORT_TYPE_UNDEFINED -1
00032 #define IMPORT_TYPE_PROGID    0
00033 #define IMPORT_TYPE_CLSID   1
00034
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 // CCompImportDlg dialog
00038
00039
00040 CCompImportDlg::CCompImportDlg(CWnd* pParent /*=NULL*/)
00041   : CDialog(CCompImportDlg::IDD, pParent)
00042 {
00043   //{{AFX_DATA_INIT(CCompImportDlg)
00044     // NOTE: the ClassWizard will add member initialization here
00045   //}}AFX_DATA_INIT
00046
00047   // Load the dialogs icon resource
00048   m_hIcon = AfxGetApp()->LoadIcon(IDI_IMPORT);
00049
00050   // Initialize the members
00051   m_pCatalog = NULL;
00052   m_nImportType = IMPORT_TYPE_UNDEFINED;
00053 }
00054
00055
00056 void CCompImportDlg::DoDataExchange(CDataExchange* pDX)
00057 {
00058   CDialog::DoDataExchange(pDX);
00059   //{{AFX_DATA_MAP(CCompImportDlg)
00060   DDX_Control(pDX, IDC_EDIT_COMPONENT, m_edtID);
00061   DDX_Control(pDX, IDC_LABEL_COMPONENT, m_lblComponentDesc);
00062   DDX_Control(pDX, IDC_COMBO_APPLICATION, m_cboApplications);
00063   //}}AFX_DATA_MAP
00064 }
00065
00066
00067 BEGIN_MESSAGE_MAP(CCompImportDlg, CDialog)
00068   //{{AFX_MSG_MAP(CCompImportDlg)
00069   ON_WM_CLOSE()
00070   ON_BN_CLICKED(IDC_RADIO_CLSID, OnCLSID)
00071   ON_BN_CLICKED(IDC_RADIO_PROG_ID, OnProgID)
00072   //}}AFX_MSG_MAP
00073 END_MESSAGE_MAP()
00074
00075 /////////////////////////////////////////////////////////////////////////////
00076 // CCompImportDlg message handlers
00077
00078 void CCompImportDlg::set_Catalog(ICOMAdminCatalog *pCatalog)
00079 {
00080   // Only can have one Catalog object reference... release all prior references before assignment
00081   ReleaseCatalog();
00082
00083   // Assign the new Catalog reference
00084   m_pCatalog = pCatalog;
00085 }
00086
00087 void CCompImportDlg::OnClose()
00088 {
00089   // Release the reference to the Catalog object if needed
00090   ReleaseCatalog();
00091
00092   CDialog::OnClose();
00093 }
00094
00095 void CCompImportDlg::ReleaseCatalog()
00096 {
00097   // Release the reference to the Catalog object if needed
00098   if (NULL != m_pCatalog)
00099     m_pCatalog->Release();
00100 }
00101
00102 void CCompImportDlg::OnOK()
00103 {
00104   // Continue only if we have a valid Catalog pointer
00105   if (NULL != m_pCatalog)
00106   {
00107     // Extract the method parameters from the UI
00108     int nAppNameSize = m_cboApplications.GetWindowTextLength() + 1;
00109     char* pAppNameBuf = new char[nAppNameSize];
00110     m_cboApplications.GetWindowText(pAppNameBuf, nAppNameSize);
00111     _bstr_t bstrAppName = pAppNameBuf;
00112     delete [] pAppNameBuf;
00113
00114     int nIDSize = m_edtID.GetWindowTextLength() + 1;
00115     char* pComponentNameBuf = new char[nIDSize];
00116     m_edtID.GetWindowText(pComponentNameBuf, nIDSize);
00117     _bstr_t bstrID = pComponentNameBuf;
00118     delete [] pComponentNameBuf;
00119
00120     // Attempt to invoke the method
00121     HRESULT hr = m_pCatalog->ImportComponent(bstrAppName,
00122                           bstrID);
00123     // Report errors, if any
00124     if FAILED(hr)
00125       MessageBox("Failed to export the specified component.\n\nPress OK to continue.",
00126             "Error",
00127             (MB_OK | MB_ICONERROR));
00128   }
00129   else
00130     MessageBox("Invalid Catalog reference.\n\nNo processing will be performed.\n\nPress OK to continue.",
00131           "Error",
00132           (MB_OK | MB_ICONERROR));
00133
00134   // Release the catalog reference
00135   ReleaseCatalog();
00136
00137   CDialog::OnOK();
00138 }
00139
00140 BOOL CCompImportDlg::OnInitDialog()
00141 {
00142   CDialog::OnInitDialog();
00143
00144   // Set the dialogs icon resources
00145   SetIcon(m_hIcon, true);     // 32x32 icon
00146   SetIcon(m_hIcon, false);    // 16x16 icon
00147
00148   // Select and set default export type
00149   CheckRadioButton(IDC_RADIO_PROG_ID, IDC_RADIO_CLSID, IDC_RADIO_PROG_ID);
00150
00151   // Set the import type and description to match the current/default selection
00152   OnProgID();
00153
00154   // Load the available applications
00155   LoadAppCombo();
00156
00157   return TRUE;  // return TRUE unless you set the focus to a control
00158                 // EXCEPTION: OCX Property Pages should return FALSE
00159 }
00160
00161 void CCompImportDlg::OnCLSID()
00162 {
00163   // Set the import type....
00164   m_nImportType = IMPORT_TYPE_CLSID;
00165   //... and set the description to match the selection
00166   m_lblComponentDesc.SetWindowText("CLSID:");
00167 }
00168
00169 void CCompImportDlg::OnProgID()
00170 {
00171   // Set the import type....
00172   m_nImportType = IMPORT_TYPE_PROGID;
00173   //... and set the description to match the selection
00174   m_lblComponentDesc.SetWindowText("ProgID:");
00175 }
00176
00177 void CCompImportDlg::LoadAppCombo()
00178 {
00179   // Continue only if we have a valid Catalog pointer
00180   if (NULL == m_pCatalog)
00181   {
00182     MessageBox("Invalid Catalog reference.\n\nNo processing will be performed.\n\nPress OK to continue.",
00183           "Error",
00184           (MB_OK | MB_ICONERROR));
00185     return;
00186   }
00187
00188   _bstr_t       bstrAppCollection = "Applications";
00189   ICatalogCollection* pAppCollection = NULL;
00190
00191   // Attempt to get a reference to the Catalog's "Application" collection
00192   HRESULT hr = m_pCatalog->GetCollection(bstrAppCollection,
00193                       (IDispatch**) &pAppCollection);
00194   if SUCCEEDED(hr)
00195   {
00196     // Attempt to populate the collection
00197     hr = pAppCollection->Populate();
00198     if SUCCEEDED(hr)
00199     {
00200       // Determine the number of items in the current collection
00201       long lCount = 0;
00202       hr = pAppCollection->get_Count(&lCount);
00203       if SUCCEEDED(hr)
00204       {
00205         _variant_t    vtItemName;
00206         ICatalogObject* pCatalogObject = NULL;
00207
00208         // Enumerate through the objects in the current collection and
00209         //  populate the combo box
00210         for (long lIndex = 0; lIndex < lCount; lIndex++)
00211         {
00212           hr = pAppCollection->get_Item(lIndex,
00213                           (IDispatch**) &pCatalogObject);
00214           if SUCCEEDED(hr)
00215           {
00216             hr = pCatalogObject->get_Name(&vtItemName);
00217             if SUCCEEDED(hr)
00218               m_cboApplications.AddString(_bstr_t(vtItemName));
00219
00220             pCatalogObject->Release();
00221           }
00222           else
00223             MessageBox("Error when attempting to get the current items name.\n\nPress OK to continue.",
00224                   "Error",
00225                   (MB_OK | MB_ICONERROR));
00226         }
00227       }
00228       else
00229         MessageBox("Failed to successfully determine the number of items in the Applications collection.\n\nNo processing will be performed.\n\nPress OK to continue.",
00230               "Error",
00231               (MB_OK | MB_ICONERROR));
00232     }
00233     else
00234       MessageBox("Failed to successfully populate the Applications collection.\n\nNo processing will be performed.\n\nPress OK to continue.",
00235             "Error",
00236             (MB_OK | MB_ICONERROR));
00237   }
00238   else
00239     MessageBox("Failed to get a reference to the Applications collection.\n\nNo processing will be performed.\n\nPress OK to continue.",
00240           "Error",
00241           (MB_OK | MB_ICONERROR));
00242 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/dbsess.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

dbsess.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module DBSESS.CPP | CDBSession object implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012
00013 #include "headers.h"
00014
00015
00016 // Code ----------------------------------------------------------------------
00017
00018 // CDBSession::CDBSession --------------------------------------------------
00019 //
00020 // @mfunc Constructor for this class
00021 //
00022 // @rdesc NONE
00023 //
00024 CDBSession::CDBSession
00025   (
00026     LPUNKNOWN pUnkOuter         //@parm IN | Outer Unkown Pointer
00027   ) // invoke ctor for base class
00028   : CBaseObj( BOT_SESSION )
00029 {
00030     //
00031   // Initialize simple member vars
00032   //
00033     m_cRef                = 0L;
00034   m_pUnkOuter       = pUnkOuter ? pUnkOuter : this;
00035     m_pUtilProp       = NULL;
00036
00037     //
00038     // Initially, NULL all contained interfaces
00039     //
00040     m_pIGetDataSource   = NULL;
00041     m_pIOpenRowset      = NULL;
00042   m_pISessionProperties = NULL;
00043   m_pIDBCreateCommand   = NULL;
00044   m_pIBindResource      = NULL;
00045
00046     //
00047   // Pointer to parent object
00048     //
00049   m_pCDataSource      = NULL;
00050
00051     //
00052     // Increment global object count.
00053     //
00054     OBJECT_CONSTRUCTED();
00055     return;
00056 }
00057
00058
00059 // CDBSession::~CDBSession -------------------------------------------------
00060 //
00061 // @mfunc Destructor for this class
00062 //
00063 // @rdesc NONE
00064 //
00065 CDBSession:: ~CDBSession
00066 (
00067     void
00068 )
00069 {
00070   //
00071   // Asserts
00072     //
00073   assert(m_pCDataSource);
00074   assert(m_pCDataSource->m_pUnkOuter);
00075
00076     //
00077     // Free properties management object
00078     //
00079     SAFE_DELETE(m_pUtilProp);
00080
00081     //
00082     // Free contained interfaces
00083     //
00084     SAFE_DELETE(m_pIGetDataSource);
00085     SAFE_DELETE(m_pIOpenRowset);
00086     SAFE_DELETE(m_pISessionProperties);
00087   SAFE_DELETE(m_pIDBCreateCommand);
00088   SAFE_DELETE(m_pIBindResource);
00089
00090     //
00091     // Release the Data Source Object
00092     //
00093   m_pCDataSource->RemoveSession();
00094   m_pCDataSource->m_pUnkOuter->Release();
00095
00096     //
00097     // Decrement global object count.
00098     //
00099     OBJECT_DESTRUCTED();
00100     return;
00101 }
00102
00103
00104 // CDBSession::FInit --------------------------------------------------------
00105 //
00106 // @mfunc Initialize the command Object
00107 //
00108 // @rdesc Did the Initialization Succeed
00109 //      @flag  TRUE | Initialization succeeded
00110 //      @flag  FALSE | Initialization failed
00111 //
00112 BOOL CDBSession::FInit
00113 (
00114   CDataSource * pCDataSource
00115 )
00116 {
00117   //
00118   // Asserts
00119     //
00120   assert(pCDataSource);
00121
00122   //
00123   // Establish parent object pointer
00124   //
00125   m_pCDataSource = pCDataSource;
00126   m_pCDataSource->m_pUnkOuter->AddRef();
00127
00128   //
00129     // Allocate properties management object
00130   //
00131     m_pUtilProp = new CUtilProp();
00132
00133     // Allocate contained interface objects
00134     m_pIOpenRowset      = new CImpIOpenRowset(this, m_pUnkOuter);
00135     m_pIGetDataSource   = new CImpIGetDataSource(this, m_pUnkOuter);
00136   m_pIDBCreateCommand   = new CImpIDBCreateCommand(this, m_pUnkOuter);
00137     m_pISessionProperties = new CImpISessionProperties(this, m_pUnkOuter);
00138   m_pIBindResource    = new CImpIBindResource(this, m_pUnkOuter);
00139
00140     return (BOOL)(m_pUtilProp && m_pIGetDataSource && m_pIOpenRowset &&
00141               m_pISessionProperties && m_pIDBCreateCommand &&
00142           m_pIBindResource);
00143 }
00144
00145
00146
00147 // CDBSession::QueryInterface -----------------------------------------------
00148 //
00149 // @mfunc Returns a pointer to a specified interface. Callers use
00150 // QueryInterface to determine which interfaces the called object
00151 // supports.
00152 //
00153 // @rdesc HRESULT indicating the status of the method
00154 //      @flag S_OK          | Interface is supported and ppvObject is set.
00155 //      @flag E_NOINTERFACE | Interface is not supported by the object
00156 //      @flag E_INVALIDARG  | One or more arguments are invalid.
00157 //
00158 STDMETHODIMP CDBSession::QueryInterface
00159 (
00160     REFIID riid,   //@parm IN | Interface ID of the interface being queried for.
00161     LPVOID * ppv   //@parm OUT | Pointer to interface that was instantiated
00162 )
00163 {
00164     //
00165     // Check in-params and NULL out-params in case of error
00166     //
00167     if( !ppv )
00168         return (E_INVALIDARG);
00169
00170     //
00171     //  This is the non-delegating IUnknown implementation
00172     //
00173     if( riid == IID_IUnknown )
00174         *ppv = (LPVOID) this;
00175     else if( riid == IID_IGetDataSource )
00176         *ppv = (LPVOID) m_pIGetDataSource;
00177     else if( riid == IID_IOpenRowset )
00178         *ppv = (LPVOID) m_pIOpenRowset;
00179     else if( riid == IID_ISessionProperties )
00180         *ppv = (LPVOID) m_pISessionProperties;
00181   else if( riid == IID_IDBCreateCommand )
00182     *ppv = (LPVOID) m_pIDBCreateCommand;
00183   else if( riid == IID_IBindResource )
00184     *ppv = (LPVOID) m_pIBindResource;
00185     else {
00186         *ppv = NULL;
00187         return (E_NOINTERFACE);
00188     }
00189
00190   ((LPUNKNOWN) *ppv)->AddRef();
00191     return (S_OK);
00192 }
00193
00194
00195 // CDBSession::AddRef -------------------------------------------------------
00196 //
00197 // @mfunc Increments a persistence count for the object
00198 //
00199 // @rdesc Current reference count
00200 //
00201 STDMETHODIMP_( DBREFCOUNT ) CDBSession::AddRef
00202 (
00203   void
00204 )
00205 {
00206     return ++m_cRef;
00207 }
00208
00209
00210 // CDBSession::Release ------------------------------------------------------
00211 //
00212 // @mfunc Decrements a persistence count for the object and if
00213 // persistence count is 0, the object destroys itself.
00214 //
00215 // @rdesc Current reference count
00216 //
00217 STDMETHODIMP_( DBREFCOUNT ) CDBSession::Release
00218 (
00219   void
00220 )
00221 {
00222     if( !--m_cRef )
00223   {
00224     delete this;
00225     return 0;
00226   }
00227
00228     return m_cRef;
00229 }
00230
00231
00232 //-----------------------------------------------------------------------------
00233 // CImpIGetDataSource::GetDataSource
00234 //
00235 // @mfunc Retrieve an interface pointer on the session object
00236 //
00237 // @rdesc
00238 //    @flag S_OK | Session Object Interface returned
00239 //    @flag E_INVALIDARG | ppDataSource was NULL
00240 //    @flag E_NOINTERFACE | IID not supported
00241 //
00242 STDMETHODIMP CImpIGetDataSource::GetDataSource
00243 (
00244   REFIID    riid,     // @parm IN  | IID desired
00245   IUnknown**  ppDataSource  // @parm OUT | ptr to interface
00246 )
00247 {
00248   //
00249   // Asserts
00250     //
00251   assert(m_pObj);
00252   assert(m_pObj->m_pCDataSource);
00253   assert(m_pObj->m_pCDataSource->m_pUnkOuter);
00254
00255     //
00256     // Check in-params and NULL out-params in case of error
00257     //
00258   if( !ppDataSource )
00259     return (E_INVALIDARG);
00260
00261   //
00262   // Handle Aggregated DataSource (if aggregated)
00263   //
00264   return m_pObj->m_pCDataSource->m_pUnkOuter->QueryInterface(riid, (LPVOID*)ppDataSource);
00265 }
00266
00267
00268 // ISessionProperties::GetProperties ----------------------------------------------------
00269 //
00270 // @mfunc Returns current settings of all properties in the DBPROPFLAGS_SESSION property
00271 //      group
00272 // @rdesc HRESULT
00273 //      @flag S_OK          | The method succeeded
00274 //      @flag E_INVALIDARG  | pcProperties or prgPropertyInfo was NULL
00275 //      @flag E_OUTOFMEMORY | Out of memory
00276 //
00277 STDMETHODIMP CImpISessionProperties::GetProperties
00278 (
00279     ULONG       cPropertySets,    //@parm IN | count of restiction guids
00280   const DBPROPIDSET rgPropertySets[], //@parm IN | restriction guids
00281   ULONG*              pcProperties,   //@parm OUT | count of properties returned
00282   DBPROPSET**     prgProperties   //@parm OUT | property information returned
00283 )
00284 {
00285     HRESULT hr;
00286
00287   //
00288   // Asserts
00289     //
00290   assert(m_pObj);
00291     assert(m_pObj->m_pUtilProp);
00292
00293     //
00294     // Check in-params and NULL out-params in case of error
00295     //
00296   hr = m_pObj->m_pUtilProp->GetPropertiesArgChk(PROPSET_SESSION,
00297         cPropertySets, rgPropertySets, pcProperties, prgProperties);
00298
00299   if( FAILED(hr) )
00300     return hr;
00301
00302     //
00303     // Just pass this call on to the utility object that manages our properties
00304     //
00305     return m_pObj->m_pUtilProp->GetProperties(PROPSET_SESSION, cPropertySets,
00306                   rgPropertySets, pcProperties, prgProperties);
00307 }
00308
00309
00310 // CImpISessionProperties::SetProperties  --------------------------------------------
00311 //
00312 // @mfunc Set properties in the DBPROPFLAGS_SESSION property group
00313 //
00314 // @rdesc HRESULT
00315 //      @flag E_INVALIDARG  | cProperties was not equal to 0 and rgProperties was NULL
00316 //      @flag E_NOTIMPL   | this method is not implemented
00317 //
00318 STDMETHODIMP    CImpISessionProperties::SetProperties
00319   (
00320   ULONG   cPropertySets,    //@parm IN | Count of structs returned
00321   DBPROPSET rgPropertySets[]    //@parm IN | Array of Properties
00322   )
00323 {
00324     HRESULT hr = E_FAIL;
00325
00326     //
00327   // Asserts
00328     //
00329   assert( m_pObj );
00330     assert( m_pObj->m_pUtilProp );
00331
00332     //
00333   // Quick return if the Count of cPropertySets is 0
00334     //
00335   if( cPropertySets == 0 )
00336     return S_OK;
00337
00338     //
00339     // Check in-params and NULL out-params in case of error
00340     //
00341   hr=m_pObj->m_pUtilProp->SetPropertiesArgChk(cPropertySets, rgPropertySets);
00342
00343   if( FAILED(hr) )
00344     return hr;
00345
00346     //
00347     // Just pass this call on to the utility object that manages our properties
00348     //
00349     return m_pObj->m_pUtilProp->SetProperties(PROPSET_SESSION,
00350                         cPropertySets, rgPropertySets);
00351 }
00352
00353
00354 // CImpIDBCreateCommand::CreateCommand  ---------------------------------------------
00355 //
00356 // @mfunc Creates a Command object.
00357 //
00358 // @rdesc HRESULT
00359 //    @flag S_OK      | success
00360 //    @flag E_INVALIDARG  | ppICommand was NULL
00361 //    @flag E_NOINTERFACE | IID not supported
00362 //    @flag E_OUTOFMEMORY | Not enough resource to create command object
00363 //
00364
00365 STDMETHODIMP CImpIDBCreateCommand::CreateCommand
00366 (
00367   IUnknown *pUnkOuter,    //@parm IN | Outer unknown for new Command
00368   REFIID   riid,        //@parm IN | Desired interface on new Command
00369   IUnknown **ppCommand    //@parm OUT | New Command object
00370 )
00371 {
00372     //
00373     // Check in-params and NULL out-params in case of error
00374     //
00375   if( !ppCommand )
00376     return (E_INVALIDARG);
00377
00378   *ppCommand = NULL;
00379
00380     //
00381   // We do not allow any other iid than IID_IUnknown for aggregation
00382     //
00383   if( pUnkOuter && riid != IID_IUnknown )
00384     return (DB_E_NOAGGREGATION);
00385
00386   //
00387   // This is the outer unknown from the user, for the new Command,
00388   // not to be confused with the outer unknown of this DBSession object.
00389   //
00390   HRESULT hr = E_OUTOFMEMORY;
00391   CCommand* pCCommand = new CCommand(m_pObj, pUnkOuter);
00392
00393   if( !pCCommand || FAILED(hr=pCCommand->FInit()) )
00394   {
00395     SAFE_DELETE(pCCommand);
00396     return (hr);
00397   }
00398
00399   hr = pCCommand->QueryInterface(riid, (void **) ppCommand);
00400
00401     if( FAILED(hr) )
00402         SAFE_DELETE(pCCommand);
00403
00404   return (hr);
00405 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • Openserv

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include <windows.h>
00021 #include <Shlwapi.h>
00022 #include <Shlobj.H>
00023
00024 #include "StatNode.h"
00025
00026 #include "Space.h"
00027 #include "Sky.h"
00028 #include "People.h"
00029 #include "Land.h"
00030
00031 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00032
00033 //==============================================================
00034 //
00035 // CStaticNode implementation
00036 //
00037 //
00038 CStaticNode::CStaticNode()
00039 {
00040     children[0] = new CPeoplePoweredVehicle;
00041     children[1] = new CLandBasedVehicle;
00042     children[2] = new CSkyBasedVehicle;
00043     children[3] = new CSpaceVehicle;
00044 }
00045
00046 CStaticNode::~CStaticNode()
00047 {
00048     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00049         if (children[n]) {
00050             delete children[n];
00051         }
00052 }
00053
00054 HRESULT CStaticNode::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00055 {
00056     SCOPEDATAITEM sdi;
00057
00058     if (GetHandle() == NULL) {
00059         SetHandle((HANDLE)parent);
00060     }
00061
00062     if (!bExpanded) {
00063         // create the child nodes, then expand them
00064         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00065             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00066             sdi.mask = SDI_STR       |   // Displayname is valid
00067                 SDI_PARAM     |   // lParam is valid
00068                 SDI_IMAGE     |   // nImage is valid
00069                 SDI_OPENIMAGE |   // nOpenImage is valid
00070                 SDI_PARENT    |
00071                 SDI_CHILDREN;
00072
00073             sdi.relativeID  = (HSCOPEITEM)parent;
00074             sdi.nImage      = children[n]->GetBitmapIndex();
00075             sdi.nOpenImage  = INDEX_OPENFOLDER;
00076             sdi.displayname = MMC_CALLBACK;
00077             sdi.lParam      = (LPARAM)children[n];       // The cookie
00078             sdi.cChildren   = (n == 0); // only the first child has children
00079
00080             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00081
00082             children[n]->SetHandle((HANDLE)sdi.ID);
00083
00084             _ASSERT( SUCCEEDED(hr) );
00085         }
00086     }
00087
00088     return S_OK;
00089 }
00090
00091 HRESULT CStaticNode::CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle)
00092 {
00093     PROPSHEETPAGE psp;
00094     HPROPSHEETPAGE hPage = NULL;
00095
00096     psp.dwSize = sizeof(PROPSHEETPAGE);
00097     psp.dwFlags = PSP_DEFAULT;
00098     psp.hInstance = g_hinst;
00099     psp.pszTemplate = MAKEINTRESOURCE(IDD_CHOOSER_CHOOSE_MACHINE);
00100     psp.pfnDlgProc = DialogProc;
00101     psp.lParam = reinterpret_cast<LPARAM>(&snapInData);
00102     psp.pszTitle = MAKEINTRESOURCE(IDS_SELECT_COMPUTER);
00103
00104     hPage = CreatePropertySheetPage(&psp);
00105     _ASSERT(hPage);
00106
00107     return lpProvider->AddPage(hPage);
00108 }
00109
00110 HRESULT CStaticNode::HasPropertySheets()
00111 {
00112     return S_OK;
00113 }
00114
00115 HRESULT CStaticNode::GetWatermarks(HBITMAP *lphWatermark,
00116                                    HBITMAP *lphHeader,
00117                                    HPALETTE *lphPalette,
00118                                    BOOL *bStretch)
00119 {
00120     *lphHeader = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_HEADER), IMAGE_BITMAP, 0, 0, 0);
00121     *lphWatermark = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_WATERMARK), IMAGE_BITMAP, 0, 0, 0);
00122     *bStretch = FALSE;
00123
00124     return S_OK;
00125 }
00126
00127 BOOL CALLBACK CStaticNode::DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00128 {
00129     static privateData *pData = NULL;
00130     static HWND m_hwndCheckboxOverride;
00131
00132     switch (uMsg)
00133     {
00134     case WM_INITDIALOG:
00135         pData = reinterpret_cast<privateData *>(reinterpret_cast<PROPSHEETPAGE *>(lParam)->lParam);
00136
00137         SendDlgItemMessage(hwndDlg, IDC_CHOOSER_RADIO_LOCAL_MACHINE, BM_SETCHECK, pData->m_fIsRadioLocalMachine, 0L);
00138         SendDlgItemMessage(hwndDlg, IDC_CHOOSER_RADIO_SPECIFIC_MACHINE, BM_SETCHECK, !pData->m_fIsRadioLocalMachine, 0L);
00139
00140         EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSER_EDIT_MACHINE_NAME), !pData->m_fIsRadioLocalMachine);
00141         EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES), !pData->m_fIsRadioLocalMachine);
00142
00143         m_hwndCheckboxOverride = ::GetDlgItem(hwndDlg, IDC_CHOOSER_CHECK_OVERRIDE_MACHINE_NAME);
00144
00145         // fill in the supplied machine name (could be us, need to check here first)
00146         if (*pData->m_host != '\0')
00147         {
00148             ::SetWindowText(GetDlgItem(hwndDlg, IDC_CHOOSER_EDIT_MACHINE_NAME), pData->m_host);
00149             ::SendMessage(GetDlgItem(hwndDlg, IDC_CHOOSER_RADIO_SPECIFIC_MACHINE), BM_CLICK, 0, 0);
00150         }
00151
00152
00153         return TRUE;
00154
00155     case WM_COMMAND:
00156         switch (wParam)
00157         {
00158         case IDC_CHOOSER_RADIO_LOCAL_MACHINE:
00159             pData->m_fIsRadioLocalMachine = TRUE;
00160             EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSER_EDIT_MACHINE_NAME), FALSE);
00161             EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES), FALSE);
00162             break;
00163
00164         case IDC_CHOOSER_RADIO_SPECIFIC_MACHINE:
00165             pData->m_fIsRadioLocalMachine = FALSE;
00166             EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSER_EDIT_MACHINE_NAME), TRUE);
00167             EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES), TRUE);
00168             break;
00169
00170         case IDC_CHOOSER_BUTTON_BROWSE_MACHINENAMES:
00171             {
00172                 // Fall back to IE-style browser
00173                 BROWSEINFO bi;
00174                 LPITEMIDLIST lpItemIdList;
00175                 LPMALLOC lpMalloc;
00176
00177                 if (SUCCEEDED(SHGetSpecialFolderLocation(hwndDlg, CSIDL_NETWORK, &lpItemIdList)))
00178                 {
00179                     _TCHAR szBrowserCaption[MAX_PATH];
00180                     LoadString(g_hinst, IDS_COMPUTER_BROWSER_CAPTION, szBrowserCaption, (sizeof szBrowserCaption)/(sizeof szBrowserCaption[0]));
00181
00182                     bi.hwndOwner = hwndDlg;
00183                     bi.pidlRoot = lpItemIdList;
00184                     bi.pszDisplayName = pData->m_host;
00185                     bi.lpszTitle = szBrowserCaption;
00186                     bi.ulFlags = BIF_BROWSEFORCOMPUTER | BIF_EDITBOX;
00187                     bi.lpfn = NULL;
00188                     bi.lParam = NULL;
00189                     bi.iImage = NULL;
00190
00191                     if (SHBrowseForFolder(&bi) != NULL)
00192                     {
00193                         if (*pData->m_host != '\0')
00194                         {
00195                             ::SetWindowText(GetDlgItem(hwndDlg,
00196                                 IDC_CHOOSER_EDIT_MACHINE_NAME), pData->m_host);
00197                         }
00198                     }
00199
00200                     if (SUCCEEDED(SHGetMalloc(&lpMalloc)))
00201                     {
00202                         lpMalloc->Free(lpItemIdList);
00203                         lpMalloc->Release();
00204                     }
00205                 }
00206             }
00207             break;
00208
00209         case IDC_CHOOSER_CHECK_OVERRIDE_MACHINE_NAME:
00210             break;
00211         }
00212         break;
00213
00214         case WM_NOTIFY:
00215             switch (((LPNMHDR)lParam)->code) {
00216             case PSN_SETACTIVE:
00217                 PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_FINISH);
00218                 break;
00219
00220             case PSN_WIZFINISH:
00221                 if (pData->m_fIsRadioLocalMachine) {
00222                     // Return empty string to caller
00223                     *pData->m_host = '\0';
00224                 } else {
00225                     // Get the machine name from the edit window
00226                     GetWindowText(GetDlgItem(hwndDlg, IDC_CHOOSER_EDIT_MACHINE_NAME),
00227                         pData->m_host, sizeof(pData->m_host));
00228                 }
00229
00230                 // Save the override flag if the caller asked for it
00231                 pData->m_fAllowOverrideMachineNameOut =
00232                     SendMessage(m_hwndCheckboxOverride, BM_GETCHECK, 0, 0) == BST_CHECKED ? TRUE : FALSE;
00233
00234                 break;
00235             }
00236
00237             break;
00238     }
00239
00240     return FALSE;
00241 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/hashtbl.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

hashtbl.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @module hashtbl.cpp | Hashing routines for row manipulation.
00006 //
00007 //
00008 #include "headers.h"
00009 #include "hashtbl.h"
00010
00011
00012
00013 //--------------------------------------------------------------------
00014 // GetNextSlots
00015 //
00016 // @func Allocates a contiguous block of the required number of slots.
00017 //
00018 // @rdesc Returns one of the following values:
00019 //      @flag S_OK          | slot allocate succeeded
00020 //    @flag E_OUTOFMEMORY | slot allocation failed because of memory allocation
00021 //                problem
00022 ///
00023 HRESULT GetNextSlots
00024     (
00025     PLSTSLOT plstslot,  //@parm IN | slot list
00026     ULONG cslot,        //@parm IN | needed block size (in slots)
00027     ULONG* pislot       //@parm IN | handle of the first slot in the returned block
00028     )
00029 {
00030     ULONG   islot, dslot;
00031     PSLOT   pslot, pslotTmp;
00032     ULONG   cbCommit;
00033     HRESULT hr;
00034
00035     if (plstslot->islotRov)
00036         plstslot->islotRov = ((PSLOT) & plstslot->rgslot[(plstslot->islotRov * plstslot->cbSlot)-sizeof(SLOT)])->islotNext;
00037     else
00038         plstslot->islotRov = plstslot->islotFirst;
00039
00040     islot = plstslot->islotRov;
00041     while (islot)
00042         {
00043         if (((PSLOT) & plstslot->rgslot[(islot *plstslot->cbSlot)-sizeof(SLOT)])->cslot >= cslot)
00044             break;
00045         islot = ((PSLOT) & plstslot->rgslot[(islot *plstslot->cbSlot)-sizeof(SLOT)])->islotNext;
00046         }
00047     if (islot == 0)
00048         {
00049         islot = plstslot->islotFirst;
00050         while (islot != plstslot->islotRov)
00051             {
00052             if (((PSLOT) & plstslot->rgslot[(islot *plstslot->cbSlot)-sizeof(SLOT)])->cslot >= cslot)
00053                 break;
00054             islot = ((PSLOT) & plstslot->rgslot[(islot *plstslot->cbSlot)-sizeof(SLOT)])->islotNext;
00055             }
00056         if (islot == plstslot->islotRov)
00057             islot = 0;
00058         }
00059
00060
00061     if (islot == 0)
00062         {
00063         cbCommit = ((cslot *plstslot->cbSlot) / plstslot->cbPage + 1) *plstslot->cbPage;
00064         if ((plstslot->cbCommitCurrent + cbCommit) > plstslot->cbCommitMax
00065             || VirtualAlloc((VOID *) ((BYTE *) plstslot + plstslot->cbCommitCurrent),
00066                                     cbCommit,
00067                                     MEM_COMMIT,
00068                                     PAGE_READWRITE ) == NULL)
00069             return ResultFromScode( E_OUTOFMEMORY );
00070
00071         islot = (ULONG) ((plstslot->cbCommitCurrent + plstslot->cbExtra) / plstslot->cbSlot);
00072         dslot = ((cbCommit + plstslot->cbslotLeftOver) / plstslot->cbSlot);
00073         if ((plstslot->pbitsSlot)->IsSlotSet( islot - 1 ) != NOERROR)
00074             {
00075             if ((plstslot->pbitsSlot)->FindSet( islot - 1, plstslot->islotMin, &islot ) == NOERROR)
00076                 islot++;
00077             else
00078                 islot = plstslot->islotMin;
00079             pslot = (PSLOT) & plstslot->rgslot[(islot *plstslot->cbSlot)-sizeof(SLOT)];
00080             pslot->cslot += dslot;
00081             DecoupleSlot( plstslot, islot, pslot );
00082             }
00083         else
00084             {
00085             pslot = (PSLOT) ((BYTE *) plstslot + plstslot->cbCommitCurrent - plstslot->cbslotLeftOver);
00086             pslot->cslot = dslot;
00087             }
00088
00089         pslot->islotNext = plstslot->islotFirst;
00090         pslot->islotPrev = 0;
00091
00092         plstslot->islotMax += dslot;
00093         plstslot->islotFirst       = islot;
00094         plstslot->cbslotLeftOver   = (cbCommit + plstslot->cbslotLeftOver) % plstslot->cbSlot;
00095         plstslot->cbCommitCurrent += cbCommit;
00096
00097         if (pslot->islotNext)
00098             ((PSLOT) & plstslot->rgslot[(pslot->islotNext *plstslot->cbSlot)-sizeof(SLOT)])->islotPrev = islot;
00099         islot = plstslot->islotFirst;
00100         }
00101
00102     pslot = (PSLOT) & plstslot->rgslot[(islot *plstslot->cbSlot)-sizeof(SLOT)];
00103     DecoupleSlot( plstslot, islot, pslot );
00104     if (pslot->cslot > cslot)
00105         {
00106         pslotTmp = (PSLOT) & plstslot->rgslot[ ((islot + cslot) *plstslot->cbSlot)-sizeof(SLOT)];
00107         pslotTmp->cslot = pslot->cslot - cslot;
00108         AddSlotToList( plstslot, islot + cslot, pslotTmp );
00109         }
00110
00111     if (FAILED( hr = (plstslot->pbitsSlot)->SetSlots( islot, islot + cslot - 1 )))
00112         return hr;
00113
00114     if (pislot)
00115         *pislot = islot;
00116     return ResultFromScode( S_OK );
00117 }
00118
00119
00120
00121 //--------------------------------------------------------------------
00122 // DecoupleSlot
00123 //
00124 // @func Decouples a slot from the list of free slots
00125 //
00126 // @rdesc NONE
00127 //
00128 VOID DecoupleSlot
00129     (
00130     PLSTSLOT plstslot,  //@parm IN | slot list
00131     ULONG islot,        //@parm IN | slot handle to decouple
00132     PSLOT pslot         //@parm IN | pointer to the slot header
00133     )
00134 {
00135     if (pslot->islotNext)
00136         ((PSLOT) & plstslot->rgslot[(pslot->islotNext *plstslot->cbSlot)-sizeof(SLOT)])->islotPrev = pslot->islotPrev;
00137     if (pslot->islotPrev)
00138         ((PSLOT) & plstslot->rgslot[(pslot->islotPrev *plstslot->cbSlot)-sizeof(SLOT)])->islotNext = pslot->islotNext;
00139     else
00140         plstslot->islotFirst = pslot->islotNext;
00141     if (islot == plstslot->islotRov)
00142         plstslot->islotRov = pslot->islotNext;
00143 }
00144
00145
00146 //--------------------------------------------------------------------
00147 // AddSlotToList
00148 //
00149 // @func Adds a slot to the list of free slots
00150 //
00151 // @rdesc NONE
00152 //
00153 VOID AddSlotToList
00154     (
00155     PLSTSLOT plstslot,  //@parm IN | slot list
00156     ULONG islot,        //@parm IN | slot handle
00157     PSLOT pslot         //@parm IN | pointer to the slot header
00158     )
00159 {
00160     pslot->islotPrev = 0;
00161     pslot->islotNext = plstslot->islotFirst;
00162     plstslot->islotFirst = islot;
00163     if (pslot->islotNext)
00164         ((PSLOT) & plstslot->rgslot[(pslot->islotNext *plstslot->cbSlot)-sizeof(SLOT)])->islotPrev = islot;
00165 }
00166
00167
00168
00169
00170 //--------------------------------------------------------------------
00171 // ReleaseSlots
00172 //
00173 // @func Releases a contiguous block of slots.
00174 //
00175 // @rdesc Returns one of the following values:
00176 //      @flag   S_OK | method succeeded
00177 //
00178 HRESULT ReleaseSlots
00179     (
00180     PLSTSLOT plstslot,  //@parm IN | slot list
00181     ULONG    islot,     //@parm IN | handle of first slot to release
00182     ULONG    cslot      //@parm IN | count of slots to release
00183     )
00184 {
00185     PSLOT pslot, pslotTmp;
00186
00187     (plstslot->pbitsSlot)->ResetSlots( islot, islot + cslot - 1 );
00188     pslot = (PSLOT) & plstslot->rgslot[(islot * plstslot->cbSlot)-sizeof(SLOT)];
00189     pslot->cslot = cslot;
00190
00191     if (islot > plstslot->islotMin && (plstslot->pbitsSlot)->IsSlotSet( islot - 1 ) != NOERROR)
00192         {
00193         if ((plstslot->pbitsSlot)->FindSet( islot - 1, plstslot->islotMin, &islot ) == NOERROR)
00194             islot++;
00195         else
00196             islot = plstslot->islotMin;
00197         pslot = (PSLOT) & plstslot->rgslot[(islot * plstslot->cbSlot)-sizeof(SLOT)];
00198         pslot->cslot += cslot;
00199         DecoupleSlot( plstslot, islot, pslot );
00200         }
00201
00202     if ((islot + cslot) <= plstslot->islotMax && (plstslot->pbitsSlot)->IsSlotSet( islot + cslot ) != NOERROR)
00203         {
00204         pslotTmp = (PSLOT) & plstslot->rgslot[ ((islot + cslot) *plstslot->cbSlot)-sizeof(SLOT)];
00205         pslot->cslot += pslotTmp->cslot;
00206         DecoupleSlot( plstslot, (islot + cslot), pslotTmp );
00207         }
00208
00209     AddSlotToList( plstslot, islot, pslot );
00210     return ResultFromScode( S_OK );
00211 }
00212
00213
00214 //--------------------------------------------------------------------
00215 // InitializeSlotList
00216 //
00217 // @func Initializes the Slot List object
00218 //
00219 // @rdesc Did the initialization succeed
00220 //      @flag S_OK          | method succeeded
00221 //      @flag E_OUTOFMEMORY | failed, out of memory
00222 //
00223 //
00224 HRESULT InitializeSlotList
00225     (
00226     ULONG cslotMax,         //@parm IN | max number of slots
00227     ULONG cbSlot,           //@parm IN | slot size (row buffer size)
00228     ULONG cbPage,           //@parm IN | page size
00229     LPBITARRAY pbits,       //@parm IN |
00230     PLSTSLOT* pplstslot,    //@parm OUT | pointer to slot list
00231     BYTE** prgslot          //@parm OUT |
00232     )
00233 {
00234     ULONG    cbReserve;
00235     BYTE     *pbAlloc;
00236     ULONG    cbCommitFirst;
00237     PLSTSLOT plstslot;
00238     ULONG    cslot, islotFirst;
00239     PSLOT    pslot;
00240
00241
00242     if (cbPage == 0)
00243         {
00244         SYSTEM_INFO sysinfo;
00245
00246         GetSystemInfo( &sysinfo );
00247         cbPage = sysinfo.dwPageSize;
00248         }
00249
00250     // Add in the LSTSLOT and SLOT
00251   cbSlot = cbSlot + (sizeof( LSTSLOT ) + sizeof( SLOT ));
00252
00253   cbReserve = ((cslotMax *(cbSlot + (sizeof( LSTSLOT ) + sizeof( SLOT )))) / cbPage + 1) *cbPage;
00254
00255     pbAlloc = (BYTE *) VirtualAlloc( NULL, cbReserve, MEM_RESERVE, PAGE_READWRITE );
00256     if (pbAlloc == NULL)
00257         return ResultFromScode( E_OUTOFMEMORY );
00258
00259     cbCommitFirst = ((sizeof( LSTSLOT ) + sizeof( SLOT )) / cbPage + 1) * cbPage;
00260     plstslot = (PLSTSLOT) VirtualAlloc( pbAlloc, cbCommitFirst, MEM_COMMIT, PAGE_READWRITE );
00261     if (plstslot == NULL)
00262         {
00263         VirtualFree((VOID *) pbAlloc, 0, MEM_RELEASE );
00264         return ResultFromScode( E_OUTOFMEMORY );
00265         }
00266
00267     plstslot->cbSlot          = cbSlot;
00268     plstslot->cbPage          = cbPage;
00269     plstslot->cbCommitCurrent = cbCommitFirst;
00270     plstslot->cbCommitMax     = cbReserve;
00271     plstslot->pbitsSlot       = pbits;
00272
00273
00274     if (cbSlot <= 2*(sizeof( LSTSLOT ) + sizeof( SLOT )))
00275         {
00276         islotFirst        = (sizeof( LSTSLOT ) + sizeof( SLOT )) / cbSlot + (((sizeof( LSTSLOT ) + sizeof( SLOT )) % cbSlot) ? 1 : 0);
00277         plstslot->cbExtra = 0;
00278         cslot = (ULONG) ((cbCommitFirst / cbSlot) - islotFirst);
00279         plstslot->cbslotLeftOver = cbCommitFirst - cbSlot * (cslot + islotFirst);
00280         }
00281     else
00282         {
00283         islotFirst        = 1;
00284         plstslot->cbExtra = cbSlot - (sizeof( LSTSLOT ) + sizeof( SLOT ));
00285         cslot = (cbCommitFirst - (sizeof( LSTSLOT ) + sizeof( SLOT ))) / cbSlot;
00286         plstslot->cbslotLeftOver = cbCommitFirst - (sizeof( LSTSLOT ) + sizeof( SLOT )) - cslot*cbSlot;
00287         }
00288     plstslot->rgslot = ((BYTE *) plstslot - plstslot->cbExtra);
00289     if (cslot)
00290         {
00291         plstslot->islotFirst = islotFirst;
00292         pslot = (PSLOT) & plstslot->rgslot[(islotFirst *plstslot->cbSlot)-sizeof(SLOT)];
00293         pslot->cslot     = cslot;
00294         pslot->islotNext = 0;
00295         pslot->islotPrev = 0;
00296         }
00297     else
00298         plstslot->islotFirst = 0;
00299     plstslot->islotMin   = islotFirst;
00300     plstslot->islotMax   = islotFirst + cslot - 1;
00301     plstslot->islotRov = plstslot->islotFirst;
00302
00303     *pplstslot = plstslot;
00304     *prgslot   = plstslot->rgslot;
00305     return ResultFromScode( S_OK );
00306 }
00307
00308
00309 //--------------------------------------------------------------------
00310 //  ResetSlotList
00311 //
00312 // @func Restore slot list to newly-initiated state
00313 //
00314 // @rdesc
00315 //  @flag S_OK  | method succeeded
00316 //
00317 HRESULT ResetSlotList
00318     (
00319     PLSTSLOT plstslot           //@parm IN | slot list
00320     )
00321 {
00322     ULONG   cslot;
00323     PSLOT   pslot;
00324
00325     cslot = (plstslot->islotMax >= plstslot->islotMin) ? (plstslot->islotMax - plstslot->islotMin + 1) : 0;
00326     if (cslot)
00327         {
00328         plstslot->islotFirst = plstslot->islotMin;
00329         pslot = (PSLOT) & plstslot->rgslot[(plstslot->islotFirst *plstslot->cbSlot)-sizeof(SLOT)];
00330         pslot->cslot     = cslot;
00331         pslot->islotNext = 0;
00332         pslot->islotPrev = 0;
00333         }
00334     else
00335         plstslot->islotFirst = 0;
00336
00337     plstslot->islotRov = plstslot->islotFirst;
00338     return ResultFromScode( S_OK );
00339 }
00340
00341
00342 //--------------------------------------------------------------------
00343 // ReleaseSlotList
00344 //
00345 // @func Free slot list's memory
00346 //
00347 // @rdesc
00348 //  @flag S_OK  | method succeeded
00349 //
00350 HRESULT ReleaseSlotList
00351     (
00352     PLSTSLOT plstslot           //@parm IN | slot list
00353     )
00354 {
00355     if (plstslot == NULL)
00356         return NOERROR;
00357
00358     if (plstslot->cbCommitCurrent)
00359         VirtualFree((VOID *) plstslot, plstslot->cbCommitCurrent, MEM_DECOMMIT );
00360
00361     VirtualFree((VOID *) plstslot, 0, MEM_RELEASE );
00362     return ResultFromScode( S_OK );
00363 }
00364
00365
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/rcvall/parser.h Source File

  • NetDS
  • WinSock
  • rcvall

parser.h

Go to the documentation of this file.
00001 #ifndef _RCVALL_H_
00002 #define _RCVALL_H_
00003
00004 //
00005 // Size defines
00006 //
00007 #define MAX_IP_SIZE        65535
00008 #define MIN_IP_HDR_SIZE       20
00009
00010 //
00011 // Macros to extract the high and low order 4-bits from a byte
00012 //
00013 #define HI_BYTE(byte)    (((byte) >> 4) & 0x0F)
00014 #define LO_BYTE(byte)    ((byte) & 0x0F)
00015
00016 //
00017 // Used to indicate to parser what fields to filter on
00018 //
00019 #define FILTER_MASK_SOURCE_ADDRESS      0x01
00020 #define FILTER_MASK_SOURCE_PORT         0x02
00021 #define FILTER_MASK_DESTINATION_ADDRESS 0x04
00022 #define FILTER_MASK_DESTINATION_PORT    0x08
00023
00024 // Prints a sequence of raw bytes to the display
00025 void
00026 PrintRawBytes(
00027     BYTE *ptr,
00028     DWORD len
00029     );
00030
00031 int
00032 DecodeIGMPHeader(
00033     char *buf,
00034     DWORD iphdrlen
00035     );
00036
00037 int
00038 DecodeUDPHeader(
00039     char *buf,
00040     DWORD iphdrlen
00041     );
00042
00043 int
00044 DecodeTCPHeader(
00045     char *buf,
00046     DWORD iphdrlen
00047     );
00048
00049 int
00050 DecodeIPHeader(
00051     char *buf,
00052     int buflen,
00053     unsigned long filtermask,
00054     SOCKADDR *srcfilter,
00055     SOCKADDR *destfilter
00056     );
00057
00058 #endif
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Cursor/Cursor.h Source File

  • WinUI
  • Cursor

Cursor.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corp.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 #define IDM_ABOUT 100
00013
00014 typedef POINTS MPOINT;
00015 #define MPOINT2POINT(mpt,pt)  ((pt).x = (mpt).x, (pt).y = (mpt).y)
00016 #define POINT2MPOINT(pt, mpt) ((mpt).x = (SHORT)(pt).x, (mpt).y = (SHORT)(pt).y)
00017
00018 BOOL InitApplication(HANDLE);
00019 BOOL InitInstance(HANDLE, INT);
00020 LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
00021 INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
00022 INT sieve(VOID);
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 #include "Space.h"
00023 #include "Sky.h"
00024 #include "People.h"
00025 #include "Land.h"
00026
00027 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00028
00029 //==============================================================
00030 //
00031 // CStaticNode implementation
00032 //
00033 //
00034 CStaticNode::CStaticNode(CComponentData *pComponentData)
00035 {
00036     m_pComponentData = pComponentData;
00037
00038     children[0] = new CPeoplePoweredVehicle(pComponentData);
00039     children[1] = new CLandBasedVehicle(pComponentData);
00040     children[2] = new CSkyBasedVehicle(pComponentData);
00041     children[3] = new CSpaceVehicle(pComponentData);
00042 }
00043
00044 CStaticNode::~CStaticNode()
00045 {
00046     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00047         if (children[n]) {
00048             delete children[n];
00049         }
00050 }
00051
00052 HRESULT CStaticNode::Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00053 {
00054     SCOPEDATAITEM sdi;
00055
00056     if (!bExpanded) {
00057         // create the child nodes, then expand them
00058         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00059             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00060             sdi.mask = SDI_STR       |   // Displayname is valid
00061                 SDI_PARAM     |   // lParam is valid
00062                 SDI_IMAGE     |   // nImage is valid
00063                 SDI_OPENIMAGE |   // nOpenImage is valid
00064                 SDI_PARENT    |
00065                 SDI_CHILDREN;
00066
00067             sdi.relativeID  = (HSCOPEITEM)parent;
00068             sdi.nImage      = children[n]->GetBitmapIndex();
00069             sdi.nOpenImage  = INDEX_OPENFOLDER;
00070             sdi.displayname = MMC_CALLBACK;
00071             sdi.lParam      = (LPARAM)children[n];       // The cookie
00072             sdi.cChildren   = (n == 0); // only the first child has children
00073
00074             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00075
00076             _ASSERT( SUCCEEDED(hr) );
00077         }
00078     }
00079
00080     return S_OK;
00081 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IPSAMPLE_MIB_GET_INPUT_DATA Member List

This is the complete list of members for _IPSAMPLE_MIB_GET_INPUT_DATA, including all inherited members.
IMGID_IfIndex | _IPSAMPLE_MIB_GET_INPUT_DATA
IMGID_TypeID | _IPSAMPLE_MIB_GET_INPUT_DATA
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/dataobj.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

dataobj.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "DataObj.h"
00016 #include "Guids.h"
00017 #include "StaticNode.h"
00018 #include "globals.h"
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // Construction/Destruction
00022
00023
00024 CDataObject::CDataObject()
00025 {
00026   m_cRef     = 0;
00027   m_uCookie  = 0;
00028   m_uContext = 0;
00029
00030 }
00031
00032 CDataObject::~CDataObject()
00033 {
00034 }
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 // IUnknown implementation
00038
00039 //---------------------------------------------------------------------------
00040 STDMETHODIMP CDataObject::QueryInterface
00041 (
00042   REFIID   riid,
00043   LPVOID*  ppv
00044 )
00045 {
00046   if( !ppv )
00047     return E_FAIL;
00048
00049   HRESULT hResult = E_NOINTERFACE;
00050   *ppv = NULL;
00051
00052   if( IsEqualIID(riid, IID_IUnknown) )
00053     *ppv = static_cast<IDataObject*>(this);
00054   else if( IsEqualIID(riid, IID_IDataObject) )
00055     *ppv = static_cast<IDataObject*>(this);
00056
00057   if( *ppv )
00058   {
00059     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00060     hResult = S_OK;
00061   }
00062
00063   return hResult;
00064 }
00065
00066 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00067 {
00068     return InterlockedIncrement((LONG *)&m_cRef);
00069 }
00070
00071 STDMETHODIMP_(ULONG) CDataObject::Release()
00072 {
00073     if (InterlockedDecrement((LONG *)&m_cRef) == 0)
00074     {
00075         delete this;
00076         return 0;
00077     }
00078     return m_cRef;
00079
00080 }
00081
00082 /////////////////////////////////////////////////////////////////////////////
00083 // IDataObject implementation
00084 //
00085
00086 //---------------------------------------------------------------------------
00087 //  MMC will call GetDataHere() for it's required clipboard formats
00088 //
00089 HRESULT CDataObject::GetDataHere
00090 (
00091   FORMATETC *pFormatEtc,     //[in]  Pointer to the FORMATETC structure
00092   STGMEDIUM *pMedium         //[out] Pointer to the STGMEDIUM structure
00093 )
00094 {
00095   const CLIPFORMAT cf = pFormatEtc->cfFormat;
00096   IStream* ipStream = NULL;
00097
00098   HRESULT hResult = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &ipStream );
00099   if( S_OK != hResult )
00100     return hResult;                        // Minimal error checking
00101
00102   hResult = DV_E_FORMATETC;                // Unknown format
00103
00104   if( cf == g_cfDisplayName )
00105   {
00106     hResult = RetrieveDisplayString( ipStream );
00107   }
00108   else if( cf == g_cfSnapinClsid )
00109   {
00110     hResult = RetrieveSnapInClassID( ipStream );
00111   }
00112   else if( cf == g_cfNodeType )
00113   {
00114     hResult = RetrieveNodeTypeGuid( ipStream );
00115   }
00116   else if( cf == g_cfszNodeType )
00117   {
00118     hResult = RetrieveGuidString( ipStream );
00119   }
00120
00121   ipStream->Release();
00122
00123   return hResult;
00124 }
00125
00126 //---------------------------------------------------------------------------
00127 VOID CDataObject::SetPrivateData
00128 (
00129   ULONG_PTR  uCookie,      //[in] Pointer to node this object represents
00130   ULONG  uContext      //[in] Context of the node
00131 )
00132 {
00133   m_uCookie  = uCookie;
00134   m_uContext = uContext;
00135 }
00136
00137 /////////////////////////////////////////////////////////////////////////////
00138 //  Handlers for MMC's required clipboard formats
00139
00140
00141 //---------------------------------------------------------------------------
00142 // CCF_DISPLAY_NAME is one of the required clipformats.
00143 // MMC askes for this string to display the name of the SnapIn's RootNode
00144 // in the ScopePane
00145 //
00146 HRESULT CDataObject::RetrieveDisplayString
00147 (
00148   IStream* ipStream        //[in][out] Stream to return our data in.
00149 )
00150 {
00151   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00152   LPWSTR pNodeName = pNode->GetNodeName();
00153
00154   SIZE_T ulSizeofName = (wcslen(pNodeName) + 1) * sizeof(WCHAR);
00155   return ipStream->Write(pNodeName, ulSizeofName, NULL);
00156 }
00157
00158 //---------------------------------------------------------------------------
00159 //  CCF_SNAPIN_CLASSID is one of the required clipformats.
00160 //  MMC will ask for this data.  This ClassID which we return represents
00161 //  the COM object which is the entry point for our SnapIn
00162 //
00163 HRESULT CDataObject::RetrieveSnapInClassID
00164 (
00165   IStream* ipStream        //[in][out] Stream to return our data in.
00166 )
00167 {
00168   return ipStream->Write( &CLSID_CComponentData, sizeof(GUID), NULL );
00169 }
00170
00171
00172 //---------------------------------------------------------------------------
00173 //  CCF_NODETYPE is one of the required clipformats.
00174 //  MMC needs the NodeType GUID to determine what extensions to activate
00175 //  for a node.  It looks under the MMC/NodeTypes registry key for the GUID
00176 //  and enumerates the extensions found beneath it.  MMC uses this GUID
00177 //  strictly as a uniquie identifier.  It does not expect it to correspond
00178 //  to the ClaseID of a com object.
00179 //
00180 HRESULT CDataObject::RetrieveNodeTypeGuid
00181 (
00182   IStream* ipStream        //[in][out] Stream to return our data in.
00183 )
00184 {
00185   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00186   GUID* pGuid = pNode->GetNodeGUID();
00187
00188   return ipStream->Write( (void*)pGuid, sizeof(GUID), NULL );
00189 }
00190
00191
00192 //---------------------------------------------------------------------------
00193 //  CCF_SZNODETYPE is a required clipboard format.
00194 //  We return the node's GUID as a wide string.
00195 //
00196 HRESULT CDataObject::RetrieveGuidString
00197 (
00198   IStream* ipStream        //[in][out] Stream to return our data in.
00199 )
00200 {
00201   LPOLESTR pszGUID;
00202   GUID     TmpGUID;
00203
00204   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00205   CopyMemory( &TmpGUID, pNode->GetNodeGUID(), sizeof(GUID) );
00206
00207   HRESULT  hResult = StringFromCLSID( TmpGUID, &pszGUID );
00208   if( S_OK == hResult )
00209   {
00210     hResult = ipStream->Write( pszGUID, (wcslen(pszGUID) + 1) * sizeof(WCHAR), NULL );
00211     CoTaskMemFree( pszGUID );
00212   }
00213   return hResult;
00214 }
00215
00216
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptClien/UTCRUCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptClien

UTCRUCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COUtilityCruiseCar
00005              COM object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and
00009              IUtility interfaces.  This is done through Containment reuse
00010              of COCruiseCar's ICar and ICruise interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial APTCLIEN.HTM
00014              file.  For more specific technical details on the internal
00015              workings see the comments dispersed throughout the
00016              module's source code.
00017
00018   Classes:   COUtilityCruiseCar.
00019
00020   Functions: CreateUtilityCruiseCar.
00021
00022   Origin:    3-20-96: atrent - Editor inheritance from LOCCLIEN source.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will make calls to the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include APTCLIEN.H because it has class and resource definitions
00048     specific to this LOCCLIEN application.
00049   We include UTCRUCAR.H because it has the COUtilityCruiseCar declarations.
00050 ---------------------------------------------------------------------------*/
00051 #include <windows.h>
00052 #include <ole2.h>
00053 #include <apputil.h>
00054 #include <micars.h>
00055 #include <carguids.h>
00056 #include "aptclien.h"
00057 #include "utcrucar.h"
00058
00059
00060 /*---------------------------------------------------------------------------
00061   COUtilityCruiseCar's implementation of its main COM object class including
00062   Constructor, Destructor, QueryInterface, AddRef, and Release.
00063 ---------------------------------------------------------------------------*/
00064
00065 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00066   Method:   COUtilityCruiseCar::COUtilityCruiseCar
00067
00068   Summary:  COUtilityCruiseCar Constructor. Note the member initializer:
00069             "m_ImpIUtility(this, pUnkOuter)" which is used to pass the
00070             'this' and pUnkOuter pointers of this constructor function to
00071             the constructor in the instantiation of the implementation of
00072             the CImpIUtility interface (which is nested inside this
00073             present COUtilityCruiseCar Object Class).
00074
00075   Args:     IUnknown* pUnkOuter)
00076               Pointer to the the outer Unknown.  NULL means this COM Object
00077               is not being Aggregated.  Non NULL means it is being created
00078               on behalf of an outside COM object that is reusing it via
00079               aggregation.
00080
00081   Modifies: m_cRefs, m_pUnkOuter, m_pUnkCruiseCar.
00082
00083   Returns:  void
00084 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00085 COUtilityCruiseCar::COUtilityCruiseCar(
00086   IUnknown* pUnkOuter) :
00087   m_ImpICar(this, pUnkOuter),
00088   m_ImpICruise(this, pUnkOuter),
00089   m_ImpIUtility(this, pUnkOuter)
00090 {
00091   // Zero the COM object's reference count.
00092   m_cRefs = 0;
00093
00094   // No AddRef necessary if non-NULL, as this COM object's lifetime
00095   // is totally coupled with the controlling Outer object's lifetime.
00096   m_pUnkOuter = pUnkOuter;
00097
00098   // Zero the pointer to the contained COCruiseCar object's ICar interface.
00099   m_pICar = NULL;
00100
00101   // Zero the pointer to the contained COCruiseCar object's ICruise
00102   // interface.
00103   m_pICruise = NULL;
00104
00105   LOGF1("C: COUtilityCruiseCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00106
00107   return;
00108 }
00109
00110
00111 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00112   Method:   COUtilityCruiseCar::~COUtilityCruiseCar
00113
00114   Summary:  COUtilityCruiseCar Destructor.
00115
00116   Args:     void
00117
00118   Modifies: .
00119
00120   Returns:  void
00121 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00122 COUtilityCruiseCar::~COUtilityCruiseCar(void)
00123 {
00124   LOG("C: COUtilityCruiseCar::Destructor.");
00125
00126   // Release the contained CruiseCar interfaces.
00127   m_pICruise->Release();
00128   m_pICar->Release();
00129
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   COUtilityCruiseCar::Init
00136
00137   Summary:  COUtilityCruiseCar Initialization method.
00138
00139   Args:     void
00140
00141   Modifies: m_pICar, m_pICruise, m_cRefs.
00142
00143   Returns:  HRESULT
00144               Standard result code. NOERROR for success.
00145 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00146 HRESULT COUtilityCruiseCar::Init(void)
00147 {
00148   HRESULT hr;
00149   IClassFactory* pICFCruiseCar;
00150
00151   // Set up the right pIUnknown for delegation.  If we are being
00152   // aggregated then we pass the pUnkOuter in turn to any COM objects
00153   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00154   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00155
00156   LOGF1("C: COUtilityCruiseCar::Init. pUnkOuter=0x%X",pUnkOuter);
00157
00158   // Get a class factory for AptCruiseCar and issue IClassFactory's
00159   // CreateInstance method to manufacture a COCruiseCar COM object.
00160   LOG("C: COUtilityCruiseCar::Init. Obtain CruiseCar Class Factory.");
00161   hr = CoGetClassObject(
00162          CLSID_AptCruiseCar,
00163          CLSCTX_LOCAL_SERVER,
00164          NULL,
00165          IID_IClassFactory,
00166          (PPVOID)&pICFCruiseCar);
00167   if (SUCCEEDED(hr))
00168   {
00169     LOG("C: COUtilityCruiseCar::Init. CruiseCar Class Factory obtained.");
00170     LOG("C: COUtilityCruiseCar::Init. Calling CFCruiseCar::CreateInstance.");
00171     // A NULL pUnkOuter is passed indicating that we are creating a
00172     // COCruiseCar component via the Containment reuse method.  We can
00173     // currently pass nothing other than this NULL pUnkOuter because
00174     // aggregation is not supported across process or machine boundaries.
00175     // Since we are not requesting a COCruiseCar create for aggregation we
00176     // can directly request for the ICruise interface on the new object.
00177     hr = pICFCruiseCar->CreateInstance(
00178                           NULL,
00179                           IID_ICruise,
00180                           (PPVOID)&m_pICruise);
00181     LOG("C: COUtilityCruiseCar::Init. Releasing CruiseCar Class Factory.");
00182     pICFCruiseCar->Release();
00183     if (SUCCEEDED(hr))
00184     {
00185       // Now that we have a valid interface pointer (m_pICruise) on the
00186       // new object we can obtain and cache a pointer to that contained
00187       // object's ICar interface as well.  We must QI using the obtained
00188       // ICruise pointer on the object to ensure that the marshaling proxy
00189       // is involved in the QueryInterface call to provide the pointer to
00190       // the ICar interface proxy.
00191       hr = m_pICruise->QueryInterface(IID_ICar, (PPVOID)&m_pICar);
00192     }
00193   }
00194
00195   if (SUCCEEDED(hr))
00196   {
00197     LOG("C: COUtilityCruiseCar::Init (CruiseCar Containment) Succeeded.");
00198   }
00199   else
00200   {
00201     LOGF1("C: COUtilityCruiseCar::Init (CruiseCar Containment) Failed. hr=0x%X",hr);
00202   }
00203
00204   return (hr);
00205 }
00206
00207
00208 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00209   Method:   COUtilityCruiseCar::QueryInterface
00210
00211   Summary:  QueryInterface of the COUtilityCruiseCar non-delegating
00212             IUnknown implementation.
00213
00214   Args:     REFIID riid,
00215               [in] GUID of the Interface being requested.
00216             PPVOID ppv)
00217               [out] Address of the caller's pointer variable that will
00218               receive the requested interface pointer.
00219
00220   Modifies: *ppv.
00221
00222   Returns:  HRESULT
00223 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00224 STDMETHODIMP COUtilityCruiseCar::QueryInterface(
00225                REFIID riid,
00226                PPVOID ppv)
00227 {
00228   HRESULT hr = E_NOINTERFACE;
00229   *ppv = NULL;
00230
00231   if (IID_IUnknown == riid)
00232   {
00233     *ppv = this;
00234     LOG("C: COUtilityCruiseCar::QueryInterface. 'this' pIUnknown returned.");
00235   }
00236   else if (IID_ICar == riid)
00237   {
00238     *ppv = &m_ImpICar;
00239     LOG("C: COUtilityCruiseCar::QueryInterface. pICar returned");
00240   }
00241   else if (IID_ICruise == riid)
00242   {
00243     *ppv = &m_ImpICruise;
00244     LOG("C: COUtilityCruiseCar::QueryInterface. pICruise returned");
00245   }
00246   else if (IID_IUtility == riid)
00247   {
00248     // This IUtility interface is implemented in this COUtilityCruiseCar
00249     // object as a native interface of COUtilityCruiseCar.
00250     *ppv = &m_ImpIUtility;
00251     LOG("C: COUtilityCruiseCar::QueryInterface. pIUtility returned.");
00252   }
00253
00254   if (NULL != *ppv)
00255   {
00256     // We've handed out a pointer to an interface so obey the COM rules
00257     // and AddRef its reference count.
00258     ((LPUNKNOWN)*ppv)->AddRef();
00259     hr = NOERROR;
00260   }
00261
00262   return (hr);
00263 }
00264
00265
00266 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00267   Method:   COUtilityCruiseCar::AddRef
00268
00269   Summary:  AddRef of the COUtilityCruiseCar non-delegating
00270             IUnknown implementation.
00271
00272   Args:     void
00273
00274   Modifies: m_cRefs.
00275
00276   Returns:  ULONG
00277               New value of m_cRefs (COM object's reference count).
00278 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00279 STDMETHODIMP_(ULONG) COUtilityCruiseCar::AddRef(void)
00280 {
00281   m_cRefs++;
00282
00283   LOGF1("C: COUtilityCruiseCar::AddRef. New cRefs=%i.", m_cRefs);
00284
00285   return m_cRefs;
00286 }
00287
00288
00289 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00290   Method:   COUtilityCruiseCar::Release
00291
00292   Summary:  Release of the COUtilityCruiseCar non-delegating IUnknown
00293             implementation.
00294
00295   Args:     void
00296
00297   Modifies: m_cRefs.
00298
00299   Returns:  ULONG
00300               New value of m_cRefs (COM object's reference count).
00301 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00302 STDMETHODIMP_(ULONG) COUtilityCruiseCar::Release(void)
00303 {
00304   ULONG ulCount = --m_cRefs;
00305
00306   LOGF1("C: COUtilityCruiseCar::Release. New cRefs=%i.", m_cRefs);
00307
00308   if (0 == m_cRefs)
00309   {
00310     // We artificially bump the main ref count.  This fulfills one of
00311     // the rules of aggregated objects and ensures that an indirect
00312     // recursive call to this release won't occur because of other
00313     // delegating releases that might happen in our own destructor.
00314     m_cRefs++;
00315     delete this;
00316   }
00317
00318   return ulCount;
00319 }
00320
00321
00322 /*---------------------------------------------------------------------------
00323   COUtilityCruiseCar's nested implementation of the ICar interface
00324   including Constructor, Destructor, QueryInterface, AddRef, Release,
00325   Shift, Clutch, Speed, and Steer.
00326 ---------------------------------------------------------------------------*/
00327
00328 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00329   Method:   COUtilityCruiseCar::CImpICar::CImpICar
00330
00331   Summary:  Constructor for the CImpICar interface instantiation.
00332
00333   Args:     COUtilityCruiseCar* pBackObj,
00334               Back pointer to the parent outer object.
00335             IUnknown* pUnkOuter,
00336               Pointer to the outer Unknown.  For delegation.
00337
00338   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00339
00340   Returns:  void
00341 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00342 COUtilityCruiseCar::CImpICar::CImpICar(
00343   COUtilityCruiseCar* pBackObj,
00344   IUnknown* pUnkOuter)
00345 {
00346   // Init the Interface Ref Count (used for debugging only).
00347   m_cRefI = 0;
00348
00349   // Init the Back Object Pointer to point to the outer object.
00350   m_pBackObj = pBackObj;
00351
00352   // Init the CImpICar interface's delegating Unknown pointer.  We use
00353   // the Back Object pointer for IUnknown delegation here if we are not
00354   // being aggregated.  If we are being aggregated we use the supplied
00355   // pUnkOuter for IUnknown delegation.  In either case the pointer
00356   // assignment requires no AddRef because the CImpICar lifetime is
00357   // quaranteed by the lifetime of the parent object in which
00358   // CImpICar is nested.
00359   if (NULL == pUnkOuter)
00360   {
00361     m_pUnkOuter = pBackObj;
00362     LOG("C: COUtilityCruiseCar::CImpICar Constructor. Non-Aggregating");
00363   }
00364   else
00365   {
00366     m_pUnkOuter = pUnkOuter;
00367     LOG("C: COUtilityCruiseCar::CImpICar Constructor. Aggregating");
00368   }
00369
00370   return;
00371 }
00372
00373
00374 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00375   Method:   COUtilityCruiseCar::CImpICar::~CImpICar
00376
00377   Summary:  Destructor for the CImpICar interface instantiation.
00378
00379   Args:     void
00380
00381   Modifies: .
00382
00383   Returns:  void
00384 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00385 COUtilityCruiseCar::CImpICar::~CImpICar(void)
00386 {
00387   LOG("C: COUtilityCruiseCar::CImpICar Destructor.");
00388
00389   return;
00390 }
00391
00392
00393 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00394   Method:   COUtilityCruiseCar::CImpICar::QueryInterface
00395
00396   Summary:  The QueryInterface IUnknown member of this ICar interface
00397             implementation that delegates to m_pUnkOuter, whatever it is.
00398
00399   Args:     REFIID riid,
00400               [in] GUID of the Interface being requested.
00401             PPVOID ppv)
00402               [out] Address of the caller's pointer variable that will
00403               receive the requested interface pointer.
00404
00405   Modifies: *ppv.
00406
00407   Returns:  HRESULT
00408               Returned by the delegated outer QueryInterface call.
00409 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00410 STDMETHODIMP COUtilityCruiseCar::CImpICar::QueryInterface(
00411                REFIID riid,
00412                PPVOID ppv)
00413 {
00414   LOG("C: COUtilityCruiseCar::CImpICar::QueryInterface. Delegating.");
00415
00416   // Delegate this call to the outer object's QueryInterface.
00417   return m_pUnkOuter->QueryInterface(riid, ppv);
00418 }
00419
00420
00421 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00422   Method:   COUtilityCruiseCar::CImpICar::AddRef
00423
00424   Summary:  The AddRef IUnknown member of this ICar interface
00425             implementation that delegates to m_pUnkOuter, whatever it is.
00426
00427   Args:     void
00428
00429   Modifies: m_cRefI.
00430
00431   Returns:  ULONG
00432               Returned by the delegated outer AddRef call.
00433 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00434 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICar::AddRef(void)
00435 {
00436   // Increment the Interface Reference Count.
00437   ++m_cRefI;
00438
00439   LOGF1("C: COUtilityCruiseCar::CImpICar::Addref. Delegating. New cI=%i.", m_cRefI);
00440
00441   // Delegate this call to the outer object's AddRef.
00442   return m_pUnkOuter->AddRef();
00443 }
00444
00445
00446 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00447   Method:   COUtilityCruiseCar::CImpICar::Release
00448
00449   Summary:  The Release IUnknown member of this ICar interface
00450             implementation that delegates to m_pUnkOuter, whatever it is.
00451
00452   Args:     void
00453
00454   Modifies: m_cRefI.
00455
00456   Returns:  ULONG
00457               Returned by the delegated outer Release call.
00458 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00459 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICar::Release(void)
00460 {
00461   // Decrement the Interface Reference Count.
00462   --m_cRefI;
00463
00464   LOGF1("C: COUtilityCruiseCar::CImpICar::Release. Delegating. New cI=%i.", m_cRefI);
00465
00466   // Delegate this call to the outer object's Release.
00467   return m_pUnkOuter->Release();
00468 }
00469
00470
00471 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00472   Method:   COUtilityCruiseCar::CImpICar::Shift
00473
00474   Summary:  The Shift member method of this ICar interface implementation.
00475             A simple empty method on a COUtilityCruiseCar COM object for
00476             tutorial purposes.  Presumably if this Car object were
00477             modeling a real Car then the Shift method would shift to the
00478             specified gear.
00479
00480   Args:     short nGear
00481               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00482
00483   Modifies: .
00484
00485   Returns:  HRESULT
00486               Delegated HRESULT.
00487 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00488 STDMETHODIMP COUtilityCruiseCar::CImpICar::Shift(
00489                short nGear)
00490 {
00491   LOGF1("C: COUtilityCruiseCar::CImpICar::Shift. Delegating. nGear=%i.",nGear);
00492
00493   // Delegate this call to the contained COCruiseCar's ICar::Shift.
00494   return m_pBackObj->m_pICar->Shift(nGear);
00495 }
00496
00497
00498 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00499   Method:   COUtilityCruiseCar::CImpICar::Clutch
00500
00501   Summary:  The Clutch member method of this ICar interface
00502             implementation. A simple empty method on a COUtilityCruiseCar
00503             COM object for tutorial purposes.  Presumably if this Car
00504             object were modeling a real Car then the Clutch method would
00505             engage the clutch the specified amount.
00506
00507   Args:     short nEngaged)
00508               Percent clutch is engaged (0 to 100%).
00509
00510   Modifies: .
00511
00512   Returns:  HRESULT
00513               Delegated HRESULT.
00514 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00515 STDMETHODIMP COUtilityCruiseCar::CImpICar::Clutch(
00516                short nEngaged)
00517 {
00518   LOGF1("C: COUtilityCruiseCar::CImpICar::Clutch. Delegating. nEngaged=%i.", nEngaged);
00519
00520   // Delegate this call to the contained COCruiseCar's ICar::Clutch.
00521   return m_pBackObj->m_pICar->Clutch(nEngaged);
00522 }
00523
00524
00525 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00526   Method:   COUtilityCruiseCar::CImpICar::Speed
00527
00528   Summary:  The Propel member method of this ICar interface
00529             implementation. A simple empty method on a COUtilityCruiseCar
00530             COM object for tutorial purposes.  Presumably if this Car
00531             object were modeling a real Car then this method would
00532             accelerate/brake to bring the car to the specified speed.
00533
00534   Args:     short nMph
00535               New speed in miles per hour.
00536
00537   Modifies: .
00538
00539   Returns:  HRESULT
00540               Delegated HRESULT.
00541 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00542 STDMETHODIMP COUtilityCruiseCar::CImpICar::Speed(
00543                short nMph)
00544 {
00545   LOGF1("C: COUtilityCruiseCar::CImpICar::Speed. Delegating. nMph=%i.",nMph);
00546
00547   // Delegate this call to the contained COCruiseCar's ICar::Speed.
00548   return m_pBackObj->m_pICar->Speed(nMph);
00549 }
00550
00551
00552 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00553   Method:   COUtilityCruiseCar::CImpICar::Steer
00554
00555   Summary:  The Steer member method of this ICar interface implementation.
00556             A simple empty method on a COUtilityCruiseCar COM object for
00557             tutorial purposes.  Presumably if this Car object were
00558             modeling a real Car then the Steer method would set the
00559             steering angle of the Car.
00560
00561   Args:     short nAngle)
00562               0 degrees straight ahead, -45 Full left, +45 Full right.
00563
00564   Modifies: .
00565
00566   Returns:  HRESULT
00567               Delegated HRESULT.
00568 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00569 STDMETHODIMP COUtilityCruiseCar::CImpICar::Steer(
00570                short nAngle)
00571 {
00572   LOGF1("C: COUtilityCruiseCar::CImpICar::Steer. Delegating. nAngle=%i.",nAngle);
00573
00574   // Delegate this call to the contained COCruiseCar's ICar::Steer.
00575   return m_pBackObj->m_pICar->Steer(nAngle);
00576 }
00577
00578
00579 /*---------------------------------------------------------------------------
00580   COUtilityCruiseCar's nested implementation of the ICruise interface
00581   including Constructor, Destructor, QueryInterface, AddRef, Release,
00582   Engage, and Adjust.
00583 ---------------------------------------------------------------------------*/
00584
00585 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00586   Method:   COUtilityCruiseCar::CImpICruise::CImpICruise
00587
00588   Summary:  Constructor for the CImpICruise interface instantiation.
00589
00590   Args:     COUtilityCruiseCar* pBackObj,
00591               Back pointer to the parent outer object.
00592             IUnknown* pUnkOuter,
00593               Pointer to the outer Unknown.  For delegation.
00594
00595   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00596
00597   Returns:  void
00598 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00599 COUtilityCruiseCar::CImpICruise::CImpICruise(
00600   COUtilityCruiseCar* pBackObj,
00601   IUnknown* pUnkOuter)
00602 {
00603   // Init the Interface Ref Count (used for debugging only).
00604   m_cRefI = 0;
00605
00606   // Init the Back Object Pointer to point to the outer object.
00607   m_pBackObj = pBackObj;
00608
00609   // Init the CImpICruise interface's delegating Unknown pointer.  We use
00610   // the Back Object pointer for IUnknown delegation here if we are not
00611   // being aggregated.  If we are being aggregated we use the supplied
00612   // pUnkOuter for IUnknown delegation.  In either case the pointer
00613   // assignment requires no AddRef because the CImpICruise lifetime is
00614   // quaranteed by the lifetime of the parent object in which
00615   // CImpICruise is nested.
00616   if (NULL == pUnkOuter)
00617   {
00618     m_pUnkOuter = pBackObj;
00619     LOG("C: COUtilityCruiseCar::CImpICruise Constructor. Non-Aggregating");
00620   }
00621   else
00622   {
00623     m_pUnkOuter = pUnkOuter;
00624     LOG("C: COUtilityCruiseCar::CImpICruise Constructor. Aggregating");
00625   }
00626
00627   return;
00628 }
00629
00630
00631 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00632   Method:   COUtilityCruiseCar::CImpICruise::~CImpICruise
00633
00634   Summary:  Destructor for the CImpICruise interface instantiation.
00635
00636   Args:     void
00637
00638   Modifies: .
00639
00640   Returns:  void
00641 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00642 COUtilityCruiseCar::CImpICruise::~CImpICruise(void)
00643 {
00644   LOG("C: COUtilityCruiseCar::CImpICruise Destructor.");
00645
00646   return;
00647 }
00648
00649
00650 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00651   Method:   COUtilityCruiseCar::CImpICruise::QueryInterface
00652
00653   Summary:  The QueryInterface IUnknown member of this ICruise interface
00654             implementation that delegates to m_pUnkOuter, whatever it is.
00655
00656   Args:     REFIID riid,
00657               [in] GUID of the Interface being requested.
00658             PPVOID ppv)
00659               [out] Address of the caller's pointer variable that will
00660               receive the requested interface pointer.
00661
00662   Modifies: *ppv.
00663
00664   Returns:  HRESULT
00665               Returned by the delegated outer QueryInterface call.
00666 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00667 STDMETHODIMP COUtilityCruiseCar::CImpICruise::QueryInterface(
00668                REFIID riid,
00669                PPVOID ppv)
00670 {
00671   LOG("C: COUtilityCruiseCar::CImpICruise::QueryInterface. Delegating.");
00672
00673   // Delegate this call to the outer object's QueryInterface.
00674   return m_pUnkOuter->QueryInterface(riid, ppv);
00675 }
00676
00677
00678 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00679   Method:   COUtilityCruiseCar::CImpICruise::AddRef
00680
00681   Summary:  The AddRef IUnknown member of this ICruise interface
00682             implementation that delegates to m_pUnkOuter, whatever it is.
00683
00684   Args:     void
00685
00686   Modifies: m_cRefI.
00687
00688   Returns:  ULONG
00689               Returned by the delegated outer AddRef call.
00690 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00691 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICruise::AddRef(void)
00692 {
00693   // Increment the Interface Reference Count.
00694   ++m_cRefI;
00695
00696   LOGF1("C: COUtilityCruiseCar::CImpICruise::Addref. Delegating. New cI=%i.", m_cRefI);
00697
00698   // Delegate this call to the outer object's AddRef.
00699   return m_pUnkOuter->AddRef();
00700 }
00701
00702
00703 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00704   Method:   COUtilityCruiseCar::CImpICruise::Release
00705
00706   Summary:  The Release IUnknown member of this ICruise interface
00707             implementation that delegates to m_pUnkOuter, whatever it is.
00708
00709   Args:     void
00710
00711   Modifies: m_cRefI.
00712
00713   Returns:  ULONG
00714               Returned by the delegated outer Release call.
00715 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00716 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpICruise::Release(void)
00717 {
00718   // Decrement the Interface Reference Count.
00719   --m_cRefI;
00720
00721   LOGF1("C: COUtilityCruiseCar::CImpICruise::Release. Delegating. New cI=%i.", m_cRefI);
00722
00723   // Delegate this call to the outer object's Release.
00724   return m_pUnkOuter->Release();
00725 }
00726
00727
00728 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00729   Method:   COUtilityCruiseCar::CImpICruise::Engage
00730
00731   Summary:  The Engage member method of this ICruise interface
00732             implementation.  A simple empty method on a COUtilityCruiseCar
00733             COM object for tutorial purposes.  Presumably if this Car
00734             object were modeling a real Car then the Engage method would
00735             turn the Cruise control system on or off.
00736
00737   Args:     BOOL bOnOff)
00738               TRUE for On; FALSE for Off.
00739
00740   Modifies: .
00741
00742   Returns:  HRESULT
00743               Delegated HRESULT.
00744 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00745 STDMETHODIMP COUtilityCruiseCar::CImpICruise::Engage(
00746                BOOL bOnOff)
00747 {
00748   LOGF1("C: COUtilityCruiseCar::CImpICruise::Engage. Delegating. bOnOff=%i.",bOnOff);
00749
00750   // Delegate this call to the contained COCruiseCar's ICruise::Engage.
00751   m_pBackObj->m_pICruise->Engage(bOnOff);
00752
00753   return NOERROR;
00754 }
00755
00756
00757 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00758   Method:   COUtilityCruiseCar::CImpICruise::Adjust
00759
00760   Summary:  The Adjust member method of this ICruise interface
00761             implementation.  A simple empty method on a COUtilityCruiseCar
00762             COM object for tutorial purposes.  Presumably if this Car
00763             object were modeling a real Car then the Adjust method would
00764             allow notching the cruise set speed up or down by increments
00765             of 3 mph.
00766
00767   Args:     BOOL bUpDown)
00768               TRUE for Up; FALSE for Down.
00769
00770   Modifies: .
00771
00772   Returns:  HRESULT
00773               Delegated HRESULT.
00774 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00775 STDMETHODIMP COUtilityCruiseCar::CImpICruise::Adjust(
00776                BOOL bUpDown)
00777 {
00778   LOGF1("C: COUtilityCruiseCar::CImpICruise::Adjust. Delegating. bUpDown=%i.",bUpDown);
00779
00780   // Delegate this call to the contained COCruiseCar's ICruise::Adjust.
00781   m_pBackObj->m_pICruise->Adjust(bUpDown);
00782
00783   return NOERROR;
00784 }
00785
00786
00787 /*---------------------------------------------------------------------------
00788   COUtilityCruiseCar's nested implementation of the IUtility interface
00789   including methods: Constructor, Destructor, QueryInterface, AddRef,
00790   Release, Offroad, and Winch.
00791 ---------------------------------------------------------------------------*/
00792
00793 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00794   Method:   COUtilityCruiseCar::CImpIUtility::CImpIUtility
00795
00796   Summary:  Constructor for the CImpIUtility interface instantiation.
00797
00798   Args:     COUtilityCruiseCar* pBackObj,
00799               Back pointer to the parent outer object.
00800             IUnknown* pUnkOuter)
00801               Pointer to the outer Unknown.  For delegation.
00802
00803   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00804
00805   Returns:  void
00806 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00807 COUtilityCruiseCar::CImpIUtility::CImpIUtility(
00808   COUtilityCruiseCar* pBackObj,
00809   IUnknown* pUnkOuter)
00810 {
00811   // Init the Interface Ref Count (used for debugging only).
00812   m_cRefI = 0;
00813
00814   // Init the Back Object Pointer to point to the outer object.
00815   m_pBackObj = pBackObj;
00816
00817   // Init the CImpIUtility interface's delegating IUnknown pointer.  We use
00818   // the Back Object pointer for IUnknown delegation here if we are not
00819   // being aggregated.  If we are being aggregated we use the supplied
00820   // pUnkOuter for IUnknown delegation.  In either case the pointer
00821   // assignment requires no AddRef because the CImpIUtility lifetime is
00822   // quaranteed by the lifetime of the parent object in which
00823   // CImpIUtility is nested.
00824   if (NULL == pUnkOuter)
00825   {
00826     m_pUnkOuter = pBackObj;
00827     LOG("C: COUtilityCruiseCar::CImpIUtility Constructor. Non-Aggregating.");
00828   }
00829   else
00830   {
00831     m_pUnkOuter = pUnkOuter;
00832     LOG("C: COUtilityCruiseCar::CImpIUtility Constructor. Aggregating.");
00833   }
00834
00835   return;
00836 }
00837
00838
00839 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00840   Method:   COUtilityCruiseCar::CImpIUtility::~CImpIUtility
00841
00842   Summary:  Destructor for the CImpIUtility interface instantiation.
00843
00844   Args:     void
00845
00846   Modifies: .
00847
00848   Returns:  void
00849 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00850 COUtilityCruiseCar::CImpIUtility::~CImpIUtility(void)
00851 {
00852   LOG("C: COUtilityCruiseCar::CImpIUtility Destructor.");
00853
00854   return;
00855 }
00856
00857
00858 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00859   Method:   COUtilityCruiseCar::CImpIUtility::QueryInterface
00860
00861   Summary:  The QueryInterface IUnknown member of this IUtility interface
00862             implementation that delegates to m_pUnkOuter, whatever it is.
00863
00864   Args:     REFIID riid,
00865               [in] GUID of the Interface being requested.
00866             PPVOID ppv)
00867               [out] Address of the caller's pointer variable that will
00868               receive the requested interface pointer.
00869
00870   Modifies: *ppv.
00871
00872   Returns:  HRESULT
00873               Returned by the delegated outer QueryInterface call.
00874 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00875 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::QueryInterface(
00876                REFIID riid,
00877                PPVOID ppv)
00878 {
00879   LOG("C: COUtilityCruiseCar::CImpIUtility::QueryInterface. Delegating.");
00880
00881   // Delegate this call to the outer object's QueryInterface.
00882   return m_pUnkOuter->QueryInterface(riid, ppv);
00883 }
00884
00885
00886 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00887   Method:   COUtilityCruiseCar::CImpIUtility::AddRef
00888
00889   Summary:  The AddRef IUnknown member of this IUtility interface
00890             implementation that delegates to m_pUnkOuter, whatever it is.
00891
00892   Args:     void
00893
00894   Modifies: m_cRefI.
00895
00896   Returns:  ULONG
00897               Returned by the delegated outer AddRef call.
00898 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00899 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::AddRef(void)
00900 {
00901   // Increment the Interface Reference Count.
00902   ++m_cRefI;
00903
00904   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Addref. Delegating. New cI=%i.", m_cRefI);
00905
00906   // Delegate this call to the outer object's AddRef.
00907   return m_pUnkOuter->AddRef();
00908 }
00909
00910
00911 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00912   Method:   COUtilityCruiseCar::CImpIUtility::Release
00913
00914   Summary:  The Release IUnknown member of this IUtility interface
00915             implementation that delegates to m_pUnkOuter, whatever it is.
00916
00917   Args:     void
00918
00919   Modifies: m_cRefI.
00920
00921   Returns:  ULONG
00922               Returned by the delegated outer Release call.
00923 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00924 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::Release(void)
00925 {
00926   // Decrement the Interface Reference Count.
00927   --m_cRefI;
00928
00929   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Release. Delegating. New cI=%i.", m_cRefI);
00930
00931   // Delegate this call to the outer object's Release.
00932   return m_pUnkOuter->Release();
00933 }
00934
00935
00936 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00937   Method:   COUtilityCruiseCar::CImpIUtility::Offroad
00938
00939   Summary:  The Offroad member method of this IUtility interface
00940             implementation.  A simple empty method on a COUtilityCruiseCar
00941             COM object for tutorial purposes.  Presumably if this
00942             UtilityCruise Car object were modeling a real Car then the
00943             Offroad method would function the 4-wheel drive transfer case
00944             and shift it to the specified 4-wheel drive mode.
00945
00946   Args:     short nGear
00947               0 = 2H or regular 2-wheel drive;
00948               1 = 4H or 4-wheel drive high speed;
00949               2 = neutral; and
00950               3 = 4L or 4-wheel drive low speed).
00951
00952   Modifies: .
00953
00954   Returns:  HRESULT
00955               NOERROR
00956 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00957 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Offroad(
00958                short nGear)
00959 {
00960   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Offroad. Called. nGear=%i.",nGear);
00961
00962   // We don't delegate because this IUtility implementation is native to
00963   // the composite COUtilityCruiseCar object.
00964
00965   return NOERROR;
00966 }
00967
00968
00969 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00970   Method:   COUtilityCruiseCar::CImpIUtility::Winch
00971
00972   Summary:  The Winch member method of this IUtility interface
00973             implementation.  A simple empty method on a COUtilityCruiseCar
00974             COM object for tutorial purposes.  Presumably if this
00975             UtilityCruiseCar object were modeling a real Car then the
00976             Winch method would turn on/off the front-mounted Winch to the
00977             specified RPMs.
00978
00979   Args:     short nRpm
00980               0 = off; 1 - 50 RPM.
00981
00982   Modifies: .
00983
00984   Returns:  HRESULT
00985               NOERROR
00986 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00987 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Winch(
00988                short nRpm)
00989 {
00990   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Winch. Called. nRpm=%i.",nRpm);
00991
00992   // We don't delegate because this IUtility implementation is native to
00993   // the composite COUtilityCruiseCar object.
00994
00995   return NOERROR;
00996 }
00997
00998
00999 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01000   Function: CreateUtilityCruiseCar
01001
01002   Summary:  Creates an instance of the COUtilityCruiseCar COM object class
01003             returning a requested interface pointer. COUtilityCruiseCar
01004             uses the Containment reuse technique to incorporate
01005             COCruiseCar features (ie, ICar and ICruise implementations)
01006             into its Interface offerings of IUnknown and IUtility. With
01007             this containment, the ICar and ICruise interfaces are
01008             implemented in COUtilityCruiseCar as delegating interfaces
01009             that delegate to their matching interface implementations in
01010             an instance of the contained COCruiseCar.  COCruiseCar is
01011             provided by the outside APTSERVE.EXE server.
01012
01013   Args:     IUnknown* pUnkOuter,
01014               Pointer the outer Unknown interface.  Non NULL implies
01015               that the new COM object is being created via an
01016               aggregation with an Outer object.  NULL implies that the
01017               object is not being created via aggregation.
01018             REFIID riid,
01019               The GUID of the interface requested on the new COM Object.
01020             PPVOID ppv)
01021               Address of the caller's pointer variable that will
01022               receive the requested interface pointer.
01023
01024   Returns:  HRESULT
01025               NOERROR if successful, CLASS_E_NOAGREGATION if IUnknown is
01026               not requested with non-NULL pUnkOuter, or other errors as
01027               appropriate.
01028 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01029 HRESULT CreateUtilityCruiseCar(
01030           IUnknown* pUnkOuter,
01031           REFIID riid,
01032           PPVOID ppv)
01033 {
01034   HRESULT hr;
01035   COUtilityCruiseCar* pCob;
01036
01037   LOGF1("C: CreateUtilityCruiseCar. pUnkOuter=0x%X.",pUnkOuter);
01038
01039   // If the creation call is requesting aggregation (pUnkOuter != NULL),
01040   // the COM rules state the IUnknown interface MUST also be concomitantly
01041   // requested.  If it is not so requested ( riid != IID_IUnknown) then
01042   // an error must be returned indicating that no aggregate creation of
01043   // the COUtilityCruiseCar COM Object can be performed using anything
01044   // other than a controlling IUnknown interface.
01045   if (NULL != pUnkOuter && riid != IID_IUnknown)
01046     hr = CLASS_E_NOAGGREGATION;
01047   else
01048   {
01049     // Instantiate a COUtilityCruiseCar COM Object.
01050     pCob = new COUtilityCruiseCar(pUnkOuter);
01051     if (NULL != pCob)
01052     {
01053       // If we have succeeded in instantiating the COUtilityCruiseCar object
01054       // we initialize it (with any subordinate COM objects) to offer it's
01055       // interfaces.
01056       hr = pCob->Init();
01057       if (SUCCEEDED(hr))
01058       {
01059         // We QueryInterface this new COM Object not only to deposit the
01060         // main interface pointer to the caller's pointer variable, but to
01061         // also automatically bump the Reference Count on the new COM
01062         // Object after handing out this *ppv reference to it.
01063         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
01064       }
01065       else
01066         DELETE_POINTER(pCob);
01067     }
01068     else
01069       hr = E_OUTOFMEMORY;
01070   }
01071
01072   if (SUCCEEDED(hr))
01073   {
01074     LOGF1("C: CreateUtilityCruiseCar Succeeded. *ppv=0x%X.",*ppv);
01075   }
01076   else
01077   {
01078     LOGF1("C: CreateUtilityCruiseCar Failed. hr=0x%X.",hr);
01079   }
01080
01081   return hr;
01082 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/Service.H Source File

  • WinBase
  • Service

Service.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  MODULE: service.h
00010
00011  Comments:  The use of this header file and the accompanying service.c
00012  file simplifies the process of writting a service.  You as a developer
00013  simply need to follow the TODO's outlined in this header file, and
00014  implement the ServiceStart() and ServiceStop() functions.
00015
00016  There is no need to modify the code in service.c.  Just add service.c
00017  to your project and link with the following libraries...
00018
00019  libcmt.lib kernel32.lib advapi.lib shell32.lib
00020
00021  This code also supports unicode.  Be sure to compile both service.c and
00022  and code #include "service.h" with the same Unicode setting.
00023
00024  Upon completion, your code will have the following command line interface
00025
00026  <service exe> -?                to display this list
00027  <service exe> -install          to install the service
00028  <service exe> -remove           to remove the service
00029  <service exe> -debug <params>   to run as a console app for debugging
00030
00031  Note: This code also implements Ctrl+C and Ctrl+Break handlers
00032        when using the debug option.  These console events cause
00033        your ServiceStop routine to be called
00034
00035        Also, this code only handles the OWN_SERVICE service type
00036        running in the LOCAL_SYSTEM security context.
00037
00038        To control your service ( start, stop, etc ) you may use the
00039        Services control panel applet or the NET.EXE program.
00040
00041        To aid in writing/debugging service, the
00042        SDK contains a utility (MSTOOLS\BIN\SC.EXE) that
00043        can be used to control, configure, or obtain service status.
00044        SC displays complete status for any service/driver
00045        in the service database, and allows any of the configuration
00046        parameters to be easily changed at the command line.
00047        For more information on SC.EXE, type SC at the command line.
00048
00049
00050 ------------------------------------------------------------------------------*/
00051
00052 #ifndef _SERVICE_H
00053 #define _SERVICE_H
00054
00055
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059
00060
00061 //////////////////////////////////////////////////////////////////////////////
00062 //// todo: change to desired strings
00063 ////
00064 // name of the executable
00065 #define SZAPPNAME            "Simple"
00066 // internal name of the service
00067 #define SZSERVICENAME        "SimpleService"
00068 // displayed name of the service
00069 #define SZSERVICEDISPLAYNAME "Simple Service"
00070 // list of service dependencies - "dep1\0dep2\0\0"
00071 #define SZDEPENDENCIES       ""
00072 //////////////////////////////////////////////////////////////////////////////
00073
00074
00075
00076 //////////////////////////////////////////////////////////////////////////////
00077 //// todo: ServiceStart()must be defined by in your code.
00078 ////       The service should use ReportStatusToSCMgr to indicate
00079 ////       progress.  This routine must also be used by StartService()
00080 ////       to report to the SCM when the service is running.
00081 ////
00082 ////       If a ServiceStop procedure is going to take longer than
00083 ////       3 seconds to execute, it should spawn a thread to
00084 ////       execute the stop code, and return.  Otherwise, the
00085 ////       ServiceControlManager will believe that the service has
00086 ////       stopped responding
00087 ////
00088    VOID ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
00089    VOID ServiceStop();
00090 //////////////////////////////////////////////////////////////////////////////
00091
00092
00093
00094 //////////////////////////////////////////////////////////////////////////////
00095 //// The following are procedures which
00096 //// may be useful to call within the above procedures,
00097 //// but require no implementation by the user.
00098 //// They are implemented in service.c
00099
00100 //
00101 //  FUNCTION: ReportStatusToSCMgr()
00102 //
00103 //  PURPOSE: Sets the current status of the service and
00104 //           reports it to the Service Control Manager
00105 //
00106 //  PARAMETERS:
00107 //    dwCurrentState - the state of the service
00108 //    dwWin32ExitCode - error code to report
00109 //    dwWaitHint - worst case estimate to next checkpoint
00110 //
00111 //  RETURN VALUE:
00112 //    TRUE  - success
00113 //    FALSE - failure
00114 //
00115    BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint);
00116
00117
00118 //
00119 //  FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
00120 //
00121 //  PURPOSE: Allows any thread to log an error message
00122 //
00123 //  PARAMETERS:
00124 //    lpszMsg - text for message
00125 //
00126 //  RETURN VALUE:
00127 //    none
00128 //
00129    void AddToMessageLog(LPTSTR lpszMsg);
00130 //////////////////////////////////////////////////////////////////////////////
00131
00132
00133 #ifdef __cplusplus
00134 }
00135 #endif
00136
00137 #endif
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/atl/mmccontrol.h Source File

  • SysMgmt
  • MMC
  • ActiveX
  • atl

mmccontrol.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // MMCControl.h : Declaration of the CMMCControl
00020
00021 #ifndef __MMCCONTROL_H_
00022 #define __MMCCONTROL_H_
00023
00024 #include "resource.h"       // main symbols
00025 #include <atlctl.h>
00026
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CMMCControl
00030 class ATL_NO_VTABLE CMMCControl :
00031   public CComObjectRootEx<CComSingleThreadModel>,
00032   public IDispatchImpl<IMMCControl, &IID_IMMCControl, &LIBID_ATLCONTROLLib>,
00033   public CComCompositeControl<CMMCControl>,
00034   public IPersistStreamInitImpl<CMMCControl>,
00035   public IOleControlImpl<CMMCControl>,
00036   public IOleObjectImpl<CMMCControl>,
00037   public IOleInPlaceActiveObjectImpl<CMMCControl>,
00038   public IViewObjectExImpl<CMMCControl>,
00039   public IOleInPlaceObjectWindowlessImpl<CMMCControl>,
00040   public ISupportErrorInfo,
00041   public CComCoClass<CMMCControl, &CLSID_MMCControl>
00042 {
00043 public:
00044   CMMCControl()
00045   {
00046         OutputDebugString(_TEXT("CMMCControl constructor\n"));
00047
00048         m_bWindowOnly = TRUE;
00049         m_bAnimating = FALSE;
00050     CalcExtent(m_sizeExtent);
00051   }
00052
00053   ~CMMCControl()
00054     {
00055         OutputDebugString(_TEXT("CMMCControl destructor\n"));
00056     }
00057
00058 DECLARE_REGISTRY_RESOURCEID(IDR_MMCCONTROL)
00059 DECLARE_NOT_AGGREGATABLE(CMMCControl)
00060
00061 DECLARE_PROTECT_FINAL_CONSTRUCT()
00062
00063 BEGIN_COM_MAP(CMMCControl)
00064   COM_INTERFACE_ENTRY(IMMCControl)
00065   COM_INTERFACE_ENTRY(IDispatch)
00066   COM_INTERFACE_ENTRY(IViewObjectEx)
00067   COM_INTERFACE_ENTRY(IViewObject2)
00068   COM_INTERFACE_ENTRY(IViewObject)
00069   COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
00070   COM_INTERFACE_ENTRY(IOleInPlaceObject)
00071   COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
00072   COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
00073   COM_INTERFACE_ENTRY(IOleControl)
00074   COM_INTERFACE_ENTRY(IOleObject)
00075   COM_INTERFACE_ENTRY(IPersistStreamInit)
00076   COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
00077   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00078 END_COM_MAP()
00079
00080 BEGIN_PROP_MAP(CMMCControl)
00081   PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
00082   PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
00083   // Example entries
00084   // PROP_ENTRY("Property Description", dispid, clsid)
00085   // PROP_PAGE(CLSID_StockColorPage)
00086 END_PROP_MAP()
00087
00088 BEGIN_MSG_MAP(CMMCControl)
00089   CHAIN_MSG_MAP(CComCompositeControl<CMMCControl>)
00090   COMMAND_HANDLER(IDC_ANIMATE, BN_CLICKED, OnClickedAnimate)
00091 END_MSG_MAP()
00092 // Handler prototypes:
00093 //  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00094 //  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00095 //  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
00096
00097 BEGIN_SINK_MAP(CMMCControl)
00098   //Make sure the Event Handlers have __stdcall calling convention
00099 END_SINK_MAP()
00100
00101   STDMETHOD(OnAmbientPropertyChange)(DISPID dispid)
00102   {
00103     if (dispid == DISPID_AMBIENT_BACKCOLOR)
00104     {
00105       SetBackgroundColorFromAmbient();
00106       FireViewChange();
00107     }
00108     return IOleControlImpl<CMMCControl>::OnAmbientPropertyChange(dispid);
00109   }
00110
00111
00112
00113 // ISupportsErrorInfo
00114   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid)
00115   {
00116     static const IID* arr[] =
00117     {
00118       &IID_IMMCControl,
00119     };
00120     for (int i=0; i<sizeof(arr)/sizeof(arr[0]); i++)
00121     {
00122             if (::InlineIsEqualGUID(*arr[i], riid))
00123         return S_OK;
00124     }
00125     return S_FALSE;
00126   }
00127
00128 // IViewObjectEx
00129   DECLARE_VIEW_STATUS(0)
00130
00131 // IMMCControl
00132 public:
00133   STDMETHOD(DoHelp)();
00134   STDMETHOD(StopAnimation)();
00135   STDMETHOD(StartAnimation)();
00136
00137   enum { IDD = IDD_MMCCONTROL };
00138   LRESULT OnClickedAnimate(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00139   {
00140         m_bAnimating = !m_bAnimating;
00141
00142         if (m_bAnimating)
00143             StartAnimation();
00144         else
00145             StopAnimation();
00146
00147     return 0;
00148   }
00149
00150 private:
00151     BOOL m_bAnimating;
00152     UINT m_timerId;
00153 };
00154
00155 #endif //__MMCCONTROL_H_
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/CChan.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

CChan.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CCHAT.CPP
00004 //  Content:    INmChannel Routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018 COBLIST * g_pListChannel    = NULL;
00019 COBLIST * g_pListChannelNotify  = NULL;
00020
00021
00022 //****************************************************************************
00023 //
00024 // HRESULT HookChannel(INmChannel * pChannel)
00025 //
00026 // Hook into notification callback for the channel
00027 //
00028 //****************************************************************************
00029
00030 HRESULT HookChannel(INmChannel * pChannel)
00031 {
00032   HRESULT      hr     = E_FAIL;
00033   CChannelNotify * pNotify  = NULL  ;
00034   ULONG      uch    = 0   ;
00035
00036   pChannel->GetNmch(&uch);
00037   TRACE_MSG(TEXT("[%08X] - Channel=[%s] Added"), pChannel, GetNmchSz(uch));
00038
00039   ASSERT(NULL != pChannel);
00040   if  (NULL == pChannel)
00041   {
00042     return E_POINTER;
00043   }
00044
00045   pChannel->AddRef();
00046   if  (NULL == AddNode(pChannel, &g_pListChannel))
00047   {
00048     pChannel -> Release();
00049     return E_FAIL;
00050   }
00051
00052     pNotify = new CChannelNotify();
00053     if (pNotify == NULL)
00054     {
00055         hr = E_OUTOFMEMORY;
00056     }
00057     else
00058     {
00059     hr = pNotify->Connect(pChannel);
00060     if (FAILED(hr))
00061     {
00062       WARN_MSG(TEXT("CConfNotify Failed (%s)"), GetHrSz(hr));
00063       pNotify->Release();
00064     }
00065     else
00066     {
00067       OBJECT_MSG(TEXT("Conference Connection point established successfully"));
00068       if  (NULL == AddNode(pNotify, &g_pListChannelNotify))
00069       {
00070         ERROR_MSG(TEXT("AddNode failed in HookChannel"));
00071         pNotify->Disconnect();
00072         pNotify->Release();
00073         return E_FAIL;
00074       }
00075     }
00076   }
00077
00078   if (SUCCEEDED(hr))
00079   {
00080     if (SUCCEEDED(pChannel->GetNmch(&uch)))
00081     {
00082       switch (uch)
00083         {
00084       case NMCH_SHARE:
00085         HookAppShare(pChannel);
00086         break;
00087
00088       case NMCH_DATA:
00089         HookData(pChannel);
00090         break;
00091
00092       case NMCH_FT:
00093         HookFileTransfer(pChannel);
00094         break;
00095
00096       default:
00097         break;
00098         }
00099     }
00100   }
00101
00102   return hr;
00103 }
00104
00105
00106 //****************************************************************************
00107 //
00108 // VOID UnHookChannel(INmChannel * pChannel)
00109 //
00110 //****************************************************************************
00111
00112 VOID UnHookChannel(INmChannel * pChannel)
00113 {
00114   if  (NULL == pChannel)
00115   {
00116     WARN_MSG(TEXT("NULL == pChannel"));
00117     return;
00118   }
00119
00120   POSITION pos    = 0;
00121   POSITION posSav   = 0;
00122   IUnknown * pUnk   = pChannel;
00123   ULONG uch     = 0;
00124
00125   pChannel->GetNmch(&uch);
00126   TRACE_MSG(TEXT("[%08X] - Channel=[%s] Removed"), pChannel, GetNmchSz(uch));
00127
00128   // Search for the notify object responsible for this channel
00129   ASSERT(NULL != g_pListChannelNotify);
00130
00131   if  (NULL != g_pListChannelNotify)
00132   {
00133     for (pos = g_pListChannelNotify->GetHeadPosition(); NULL != pos; )
00134     {
00135       posSav = pos;
00136       CChannelNotify * pNotify = (CChannelNotify *) g_pListChannelNotify->GetNext(pos);
00137       ASSERT(NULL != pNotify);
00138       if  (NULL == pNotify)
00139       {
00140         WARN_MSG(TEXT("NULL == pNotify"));
00141         break;
00142       }
00143
00144       if (S_OK == pChannel->IsSameAs((INmChannel *) pNotify->GetPunk()))
00145       {
00146         g_pListChannelNotify->RemoveAt(posSav);
00147         pNotify->Disconnect();
00148         pNotify->Release();
00149         break;
00150       }
00151     }
00152   }
00153
00154   // Search for the channel in the list
00155   ASSERT(NULL != g_pListChannel);
00156   if  (NULL != g_pListChannel)
00157   {
00158     for (pos = g_pListChannel->GetHeadPosition(); NULL != pos; )
00159     {
00160       posSav = pos;
00161       if (S_OK == pChannel->IsSameAs((INmChannel *) g_pListChannel->GetNext(pos)))
00162       {
00163         g_pListChannel->RemoveAt(posSav);
00164         pChannel->Release();
00165         break;
00166       }
00167     }
00168   }
00169
00170   if  (g_pChannelData)
00171   {
00172     g_pChannelData->Release();
00173     g_pChannelData = NULL;
00174   }
00175
00176   OBJECT_MSG(TEXT("Channel connection point removed"));
00177 }
00178
00179
00180 //****************************************************************************
00181 //
00182 // VOID UpdateChannelState(INmChannel * pChannel)
00183 //
00184 //****************************************************************************
00185
00186 VOID UpdateChannelState(INmChannel * pChannel)
00187 {
00188   if  (NULL == pChannel)
00189   {
00190     WARN_MSG(TEXT("NULL == pChannel"));
00191     return;
00192   }
00193
00194   HRESULT hr      = NO_ERROR  ;
00195   ULONG nmch    = 0     ;
00196   BOOL  fActive   = FALSE   ;
00197   ULONG cMember   = 0     ;
00198
00199   hr = pChannel->GetNmch(&nmch);
00200   if (FAILED(hr))
00201   {
00202     return;
00203   }
00204   fActive = S_OK == pChannel->IsActive();
00205
00206   if  FAILED(hr = pChannel->GetMemberCount(&cMember))
00207   {
00208     WARN_MSG(TEXT("GetMemberCount returned error code %08X"), hr);
00209   }
00210
00211   TRACE_MSG(TEXT("%s channel %08X is %s with %d members"), GetNmchSz(nmch), pChannel,
00212                 fActive ? TEXT("Active") : TEXT("Inactive"), cMember);
00213
00214   switch (nmch)
00215   {
00216   case NMCH_DATA:
00217   {
00218     INmChannelData * pChannelData = NULL;
00219     hr = pChannel->QueryInterface(IID_INmChannelData, (void **)&pChannelData);
00220     if (FAILED(hr) || (NULL == pChannelData))
00221       return;
00222     if (pChannelData != g_pChannelData)
00223     {
00224       WARN_MSG(TEXT("second data channel?"));
00225     }
00226     SetMenuCheck(IDM_CHANNEL_DATA, fActive);
00227     pChannelData->Release();
00228     break;
00229   }
00230   case NMCH_AUDIO:
00231   case NMCH_VIDEO:
00232     break;
00233
00234   case NMCH_SHARE:
00235   {
00236     if (fActive)
00237       break;
00238     FreeAs();
00239     break;
00240   }
00241   default:
00242     break;
00243   }
00244 }
00245
00246
00247 //****************************************************************************
00248 //
00249 // VOID FreeChannels(void)
00250 //
00251 //****************************************************************************
00252
00253 VOID FreeChannels(void)
00254 {
00255   // Release all notify
00256   if (NULL != g_pListChannelNotify)
00257   {
00258     while (!g_pListChannelNotify->IsEmpty())
00259     {
00260       CChannelNotify * pNotify = (CChannelNotify *) g_pListChannelNotify->RemoveHead();
00261       ASSERT(NULL != pNotify);
00262       if  (NULL == pNotify)
00263       {
00264         WARN_MSG(TEXT("NULL == pNotify in FreeChannels"));
00265         break;
00266       }
00267
00268       OBJECT_MSG(TEXT("[%08X] channel notify released"), pNotify);
00269       pNotify->Disconnect();
00270       pNotify->Release();
00271     }
00272   }
00273
00274   if (NULL != g_pListChannel)
00275   {
00276     while (!g_pListChannel->IsEmpty())
00277     {
00278       INmChannel * pChannel = (INmChannel *) g_pListChannel->RemoveHead();
00279       ASSERT(NULL != pChannel);
00280       if  (NULL == pChannel)
00281       {
00282         WARN_MSG(TEXT("NULL == pNotify in FreeChannels"));
00283         break;
00284       }
00285       OBJECT_MSG(TEXT("[%08X] channel released"), pChannel);
00286       pChannel->Release();
00287     }
00288   }
00289 }
00290
00291
00292 //****************************************************************************
00293 //
00294 // CLASS CChannelNotify
00295 //
00296 //****************************************************************************
00297
00298 CChannelNotify::CChannelNotify() : RefCount(), CNotify()
00299 {
00300   OBJECT_MSG(TEXT("CChannelNotify created"));
00301 }
00302
00303 CChannelNotify::~CChannelNotify()
00304 {
00305   OBJECT_MSG(TEXT("CChannelNotify destroyed"));
00306 }
00307
00308
00309 //****************************************************************************
00310 //
00311 // Methods from IUnknown
00312 //
00313 //****************************************************************************
00314
00315 ULONG STDMETHODCALLTYPE CChannelNotify::AddRef(void)
00316 {
00317   return RefCount::AddRef();
00318 }
00319
00320
00321 ULONG STDMETHODCALLTYPE CChannelNotify::Release(void)
00322 {
00323   return RefCount::Release();
00324 }
00325
00326 HRESULT STDMETHODCALLTYPE CChannelNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00327 {
00328   if  (NULL == ppvObject)
00329     return E_POINTER;
00330
00331   HRESULT hr = NO_ERROR;
00332
00333   if (riid == IID_IUnknown)
00334   {
00335     *ppvObject = (IUnknown *)this;
00336     OBJECT_MSG(TEXT("CChannelNotify::QueryInterface(): Returning IUnknown."));
00337   }
00338   else if (riid == IID_INmChannelNotify)
00339   {
00340     *ppvObject = (INmChannelNotify *)this;
00341     OBJECT_MSG(TEXT("CChannelNotify::QueryInterface(): Returning INmChannelNotify."));
00342   }
00343   else
00344   {
00345     hr = E_NOINTERFACE;
00346     *ppvObject = NULL;
00347     OBJECT_MSG(TEXT("CChannelNotify::QueryInterface(): Called on unknown interface."));
00348   }
00349
00350   if SUCCEEDED(hr)
00351   {
00352     AddRef();
00353   }
00354
00355   return hr;
00356 }
00357
00358
00359 //****************************************************************************
00360 //
00361 // Methods from ICNotify
00362 //
00363 //****************************************************************************
00364
00365 HRESULT STDMETHODCALLTYPE CChannelNotify::Connect(IUnknown *pUnk)
00366 {
00367   return CNotify::Connect(pUnk, IID_INmChannelNotify, (IUnknown *)this);
00368 }
00369
00370 HRESULT STDMETHODCALLTYPE CChannelNotify::Disconnect(void)
00371 {
00372   return CNotify::Disconnect();
00373 }
00374
00375
00376 //****************************************************************************
00377 //
00378 // Methods from IConfNotify
00379 //
00380 //****************************************************************************
00381
00382 HRESULT STDMETHODCALLTYPE CChannelNotify::NmUI(CONFN uNotify)
00383 {
00384   NOTIFY_MSG(TEXT("CChannelNotify::NmUI uNotify=%08X, pChannel=%08X"), uNotify, CNotify::GetPunk());
00385   return S_OK;
00386 }
00387
00388
00389 HRESULT STDMETHODCALLTYPE CChannelNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00390 {
00391   if  (NULL == pMember)
00392   {
00393     WARN_MSG(TEXT("NULL == pMember"));
00394     return E_POINTER;
00395   }
00396
00397   NOTIFY_MSG(TEXT("CChannelNotify::MemberChanged uNotify=%d pMember=%08X, pChannel=%08X"), uNotify, pMember, CNotify::GetPunk());
00398   PUSER pUser = PUserFromINmMember(pMember);
00399
00400   if  (NULL == pUser)
00401   {
00402     WARN_MSG(TEXT("NULL == pUser"));
00403     return E_POINTER;
00404   }
00405
00406   pMember->GetNmchCaps(&pUser->uchCaps);
00407   pMember->GetID(&pUser->uId);
00408
00409   UpdateUserChannel(pUser, (INmChannel *) (CNotify::GetPunk()), uNotify);
00410
00411   return S_OK;
00412 }
00413
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ContMenu.h Source File

  • WinUI
  • Shell
  • SampView

ContMenu.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /******************************************************************************
00011
00012    File:          ContMenu.h
00013
00014    Description:   CContextMenu definitions.
00015
00016 ******************************************************************************/
00017
00018 #ifndef CONTMENU_H
00019 #define CONTMENU_H
00020
00021 #include <windows.h>
00022 #include <windowsx.h>
00023 #include <shlobj.h>
00024 #include "ShlFldr.h"
00025 #include "PidlMgr.h"
00026 #include "resource.h"
00027
00028 /**************************************************************************
00029
00030    CContextMenu class definition
00031
00032 **************************************************************************/
00033
00034 class CContextMenu : public IContextMenu
00035 {
00036 private:
00037    DWORD          m_ObjRefCount;
00038    LPITEMIDLIST   *m_aPidls;
00039    IMalloc        *m_pMalloc;
00040    CPidlMgr       *m_pPidlMgr;
00041    CShellFolder   *m_psfParent;
00042    UINT           m_uItemCount;
00043    BOOL           m_fBackground;
00044    UINT           m_cfPrivateData;
00045
00046 public:
00047    CContextMenu(CShellFolder *psfParent, LPCITEMIDLIST *aPidls = NULL, UINT uItemCount = 0);
00048    ~CContextMenu();
00049
00050    //IUnknown methods
00051    STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
00052    STDMETHODIMP_(DWORD) AddRef();
00053    STDMETHODIMP_(DWORD) Release();
00054
00055    //IContextMenu methods
00056    STDMETHODIMP QueryContextMenu(HMENU, UINT, UINT, UINT, UINT);
00057    STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO);
00058    STDMETHODIMP GetCommandString(UINT_PTR, UINT, LPUINT, LPSTR, UINT);
00059
00060 private:
00061    LPITEMIDLIST* AllocPidlTable(DWORD);
00062    VOID FreePidlTable(LPITEMIDLIST*);
00063    BOOL FillPidlTable(LPCITEMIDLIST*, UINT);
00064    BOOL DoCopyOrCut(HWND, BOOL);
00065    BOOL DoPaste(VOID);
00066    BOOL DoExplore(HWND);
00067    BOOL DoOpen(HWND);
00068    STDMETHODIMP DoDelete(VOID);
00069    STDMETHODIMP DoNewFolder(HWND);
00070    STDMETHODIMP DoNewItem(HWND);
00071    VOID DoRename(HWND);
00072    BOOL DoModifyData(HWND);
00073    UINT InsertBackgroundItems(HMENU, UINT, UINT);
00074    UINT InsertItems(HMENU, UINT, UINT, UINT);
00075 };
00076
00077 #define MYCMF_MULTISELECT   0x00010000
00078
00079 #endif// CONTMENU_H
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/scandir.cpp Source File

  • Begin
  • sdkdiff

scandir.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * scandir.cpp
00013  *
00014  * build lists of filenames given a pathname.
00015  *
00016  * dir_buildlist takes a pathname and returns a handle. Subsequent
00017  * calls to dir_firstitem and dir_nextitem return handles to
00018  * items within the list, from which you can get the name of the
00019  * file (relative to the original pathname, or complete), and a checksum
00020  * and filesize.
00021  *
00022  * The list can be either built entirely during the build call, or
00023  * built one directory at a time as required by dir_nextitem calls. This
00024  * option affects only relative performance, and is taken as a
00025  * recommendation only (ie some of the time we will ignore the flag).
00026  *
00027  * the list is ordered alphabetically (case-insensitive using lstrcmpi).
00028  * within any one directory, we list filenames before going on
00029  * to subdirectory contents.
00030  *
00031  * All memory is allocated using HeapAlloc
00032  */
00033
00034 #include "precomp.h"
00035
00036 #include "list.h"
00037 #include "scandir.h"
00038
00039 #include "sdkdiff.h"
00040 #include "wdiffrc.h"
00041
00042 #ifdef trace
00043 extern BOOL bTrace;  /* in sdkdiff.cpp.  Read only here */
00044 #endif //trace
00045
00046 /*
00047  * The caller gets handles to two things: a DIRLIST, representing the
00048  * entire list of filenames, and a DIRITEM: one item within the list.
00049  *
00050  * from the DIRITEM he can get the filename relative to tree root
00051  * passed to dir_build*) - and also he can get to the next
00052  * DIRITEM (and back to the DIRLIST).
00053  *
00054  * We permit lazy building of the tree (usually so the caller can keep
00055  * the user-interface uptodate as we go along). In this case,
00056  * we need to store information about how far we have scanned and
00057  * what is next to do. We need to scan an entire directory at a time and then
00058  * sort it so we can return files in the correct order.
00059  *
00060  *
00061  * We scan an entire directory and store it in a DIRECT struct. This contains
00062  * a list of DIRITEMs for the files in the current directory, and a list of
00063  * DIRECTs for the subdirectories (possible un-scanned).
00064  *
00065  * dir_nextitem will use the list functions to get the next DIRITEM on the list.
00066  * When the end of the list is reached, it will use the backpointer back to the
00067  * DIRECT struct to find the next directory to scan.
00068  *
00069  */
00070
00071 /*
00072  * hold name and information about a given file (one ITEM in a DIRectory)
00073  * caller's DIRITEM handle is a pointer to one of these structures
00074  */
00075 struct diritem {
00076     LPSTR name;             /* ptr to filename (final element only) */
00077     long size;              /* filesize */
00078     DWORD checksum;         /* checksum of file */
00079     DWORD attr;             /* file attributes */
00080     FILETIME ft_lastwrite;  /* last write time, set whenever size is set */
00081     BOOL sumvalid;          /* TRUE if checksum calculated */
00082     BOOL fileerror;         // true if some file error occurred
00083     struct direct * direct; /* containing directory */
00084     LPSTR localname;        /* name of temp copy of file */
00085     BOOL bLocalIsTemp;      /* true if localname is tempfile. not
00086                              * defined if localname is NULL
00087                              */
00088     int sequence;           /* sequence number, for dir_compsequencenumber */
00089 };
00090
00091
00092 /* DIRECT: hold state about directory and current position in list of filenames.
00093  */
00094 typedef struct direct {
00095     LPSTR relname;          /* name of dir relative to DIRLIST root */
00096     DIRLIST head;           /* back ptr (to get fullname and server) */
00097     struct direct * parent; /* parent directory (NULL if above tree root)*/
00098
00099     BOOL bScanned;          /* TRUE if scanned */
00100     LIST diritems;          /* list of DIRITEMs for files in cur. dir */
00101     LIST directs;           /* list of DIRECTs for child dirs */
00102
00103     int pos;                /* where are we? begin, files, dirs */
00104     struct direct * curdir; /* subdir being scanned (ptr to list element)*/
00105 } * DIRECT;
00106
00107 /* values for direct.pos */
00108 #define DL_FILES        1       /* reading files from the diritems */
00109 #define DL_DIRS         2       /* in the dirs: List_Next on curdir */
00110
00111
00112 /*
00113  * the DIRLIST handle returned from a build function is in fact
00114  * a pointer to one of these. Although this is not built from a LIST object,
00115  * it behaves like a list to the caller.
00116  */
00117 struct dirlist {
00118
00119     char rootname[MAX_PATH];        /* name of root of tree */
00120     BOOL bFile;             /* TRUE if root of tree is file, not dir */
00121     BOOL bSum;              /* TRUE if checksums required */
00122     DIRECT dot;             /* dir  for '.' - for tree root dir */
00123
00124     LPSTR pPattern;         /* wildcard pattern or NULL */
00125     LPSTR pDescription;     /* description */
00126
00127     DIRLIST pOtherDirList;
00128 };
00129
00130 extern BOOL bAbort;             /* from sdkdiff.cpp (read only here). */
00131
00132 /* file times are completely different under DOS and NT.
00133    On NT they are FILETIMEs with a 2 DWORD structure.
00134    Under DOS they are single long.  We emulate the NT
00135    thing under DOS by providing CompareFileTime and a
00136    definition of FILETIME
00137 */
00138
00139 /*-- forward declaration of internal functions ---------------------------*/
00140
00141 BOOL iswildpath(LPCSTR pszPath);
00142 LPSTR dir_finalelem(LPSTR path);
00143 void dir_cleardirect(DIRECT dir);
00144 void dir_adddirect(DIRECT dir, LPSTR path);
00145 BOOL dir_addfile(DIRECT dir, LPSTR path, DWORD size, FILETIME ft, DWORD attr, int *psequence);
00146 void dir_scan(DIRECT dir, BOOL bRecurse);
00147 BOOL dir_isvalidfile(LPSTR path);
00148 BOOL dir_fileinit(DIRITEM pfile, DIRECT dir, LPSTR path, long size, FILETIME ft, DWORD attr, int *psequence);
00149 void dir_dirinit(DIRECT dir, DIRLIST head, DIRECT parent, LPSTR name);
00150 long dir_getpathsizeetc(LPSTR path, FILETIME FAR*ft, DWORD FAR*attr);
00151 DIRITEM dir_findnextfile(DIRLIST dl, DIRECT curdir);
00152
00153 /* --- external functions ------------------------------------------------*/
00154
00155
00156 /* ----- list initialisation/cleanup --------------------------------------*/
00157
00158
00159 /*
00160  * build a list of filenames
00161  *
00162  * optionally build the list on demand, in which case we scan the
00163  * entire directory but don't recurse into subdirs until needed
00164  *
00165  * if bSum is true, checksum each file as we build the list. checksums can
00166  * be obtained from the DIRITEM (dir_getchecksum(DIRITEM)). If bSum is FALSE,
00167  * checksums will be calculated on request (the first call to dir_getchecksum
00168  * for a given DIRITEM).
00169  */
00170
00171 DIRLIST
00172 dir_buildlist(
00173               LPSTR path,
00174               BOOL bSum,
00175               BOOL bOnDemand
00176               )
00177 {
00178     DIRLIST dlOut = 0;
00179     DIRLIST dl = 0;
00180     BOOL bFile;
00181     char tmppath[MAX_PATH] = {0};
00182     LPSTR pstr;
00183     LPSTR pPat = NULL;
00184     LPSTR pTag = NULL;
00185   HRESULT hr;
00186
00187     /*
00188      * copy the path so we can modify it
00189      */
00190     strncat(tmppath, path, sizeof(tmppath)-1);
00191
00192     /* look for wildcards and separate out pattern if there */
00193     if (My_mbschr(tmppath, '*') || My_mbschr(tmppath, '?'))
00194     {
00195         pstr = dir_finalelem(tmppath);
00196         pPat = (char*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lstrlen(pstr) +1);
00197         if (pPat == NULL)
00198       goto LError;
00199     hr = StringCchCopy(pPat, (lstrlen(pstr)+1), pstr);
00200     if (FAILED(hr)) {
00201       OutputError(hr, IDS_SAFE_COPY);
00202       goto LError;
00203     }
00204         *pstr = '\0';
00205     }
00206
00207     /* we may have reduced the path to nothing - replace with . if so */
00208     if (lstrlen(tmppath) == 0)
00209     {
00210         hr = StringCchCopy(tmppath, MAX_PATH, ".");
00211     if (FAILED(hr)) {
00212       OutputError(hr, IDS_SAFE_COPY);
00213       goto LError;
00214     }
00215     }
00216     else
00217     {
00218         /*
00219          * remove the trailing slash if unnecessary (\, c:\ need it)
00220          */
00221         pstr = &tmppath[lstrlen(tmppath) -1];
00222         if ((*pstr == '\\') && (pstr > tmppath) && (pstr[-1] != ':')
00223             && !IsDBCSLeadByte((BYTE)*(pstr-1)))
00224         {
00225             *pstr = '\0';
00226         }
00227     }
00228
00229
00230     /* check if the path is valid */
00231     if ((pTag && !iswildpath(tmppath)) || (tmppath[0] == '/' && tmppath[1] == '/'))
00232     {
00233         bFile = TRUE;
00234     }
00235     else if (dir_isvaliddir(tmppath))
00236     {
00237         bFile = FALSE;
00238     }
00239     else if (dir_isvalidfile(tmppath))
00240     {
00241         bFile = TRUE;
00242     }
00243     else
00244     {
00245         /* not valid */
00246         goto LError;
00247     }
00248
00249
00250     /* alloc and init the DIRLIST head */
00251
00252     dl = (DIRLIST) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct dirlist));
00253     if (dl == NULL)
00254     goto LError;
00255   dl->pOtherDirList = NULL;
00256
00257     /* convert the pathname to an absolute path */
00258     _fullpath(dl->rootname, tmppath, sizeof(dl->rootname));
00259
00260     dl->bSum = bSum;
00261     dl->bSum = FALSE;  // to speed things up. even if we do want checksums,
00262                        // let's get them on demand, not right now.
00263     dl->bFile = bFile;
00264
00265     if (pPat)
00266     {
00267         dl->pPattern = pPat;
00268         pPat = 0;
00269     }
00270
00271
00272     /* make a '.' directory for the tree root directory -
00273      * all files and subdirs will be listed from here
00274      */
00275     {    /* Do NOT chain on anything with garbage pointers in it */
00276         DIRECT temp;
00277         temp = (DIRECT) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct direct));
00278         if (temp == NULL)
00279       return NULL;
00280     dl->dot = temp;
00281     }
00282
00283     dir_dirinit(dl->dot, dl, NULL, ".");
00284
00285     /* were we given a file or a directory ? */
00286     if (bFile)
00287     {
00288         /* its a file. create a single file entry
00289          * and set the state accordingly
00290          */
00291         long fsize;
00292         FILETIME ft;
00293         DWORD attr;
00294         fsize = dir_getpathsizeetc(tmppath, &ft, &attr);
00295
00296         dl->dot->bScanned = TRUE;
00297
00298     if (!dir_addfile(dl->dot, dir_finalelem(tmppath), fsize, ft, attr, 0))
00299             goto LError;
00300     }
00301     else
00302     {
00303         /* scan the root directory and return. if we are asked
00304          * to scan the whole thing, this will cause a recursive
00305          * scan all the way down the tree
00306          */
00307         dir_scan(dl->dot, (!bOnDemand) );
00308     }
00309
00310     dlOut = dl;
00311     dl = 0;
00312
00313 LError:
00314     if (pTag)
00315         HeapFree(GetProcessHeap(), NULL,  pTag);
00316     if (pPat)
00317         HeapFree(GetProcessHeap(), NULL, pPat);
00318     dir_delete(dl);
00319     return dlOut;
00320 } /* dir_buildlist */
00321
00322 /*
00323  * build/append a list of filenames
00324  *
00325  * if bSum is true, checksum each file as we build the list. checksums can
00326  * be obtained from the DIRITEM (dir_getchecksum(DIRITEM)). If bSum is FALSE,
00327  * checksums will be calculated on request (the first call to dir_getchecksum
00328  * for a given DIRITEM).
00329  */
00330
00331 BOOL
00332 dir_appendlist(
00333                DIRLIST *pdl,
00334                LPCSTR path,
00335                BOOL bSum,
00336                int *psequence
00337                )
00338 {
00339     DIRLIST dl;
00340     BOOL bFile=FALSE;
00341     char tmppath[MAX_PATH];
00342     LPSTR pstr;
00343     LPSTR pTag = NULL;
00344     BOOL fSuccess = FALSE;
00345   HRESULT hr;
00346
00347     if (path)
00348     {
00349         // copy the path so we can modify it
00350         hr = StringCchCopy(tmppath, MAX_PATH, path);
00351     if (FAILED(hr))
00352       OutputError(hr, IDS_SAFE_COPY);
00353
00354     // remove the trailing slash if unnecessary (\, c:\ need it)
00355         pstr = &tmppath[lstrlen(tmppath) -1];
00356         if ((*pstr == '\\') && (pstr > tmppath) && (pstr[-1] != ':')
00357             && !IsDBCSLeadByte((BYTE)*(pstr-1)))
00358         {
00359             *pstr = '\0';
00360         }
00361
00362
00363         /* check if the path is valid */
00364         if ((pTag && !iswildpath(tmppath))|| (tmppath[0] == '/' && tmppath[1] == '/'))
00365         {
00366             // assume valid
00367             bFile = TRUE;
00368         }
00369         else if (dir_isvaliddir(tmppath))
00370         {
00371             bFile = FALSE;
00372         }
00373         else if (dir_isvalidfile(tmppath))
00374         {
00375             bFile = TRUE;
00376         }
00377         else
00378         {
00379             /* not valid */
00380             goto LError;
00381         }
00382     }
00383
00384     if (!*pdl)
00385     {
00386         DIRECT temp;
00387
00388         /* alloc and init the DIRLIST head */
00389         *pdl = (DIRLIST) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct dirlist));
00390         if (*pdl == NULL)
00391       goto LError;
00392     (*pdl)->pOtherDirList = NULL;
00393
00394         (*pdl)->bSum = bSum;
00395         (*pdl)->bSum = FALSE;   // to speed things up. even if we do want
00396                                 // checksums, let's get them on demand, not
00397                                 // right now.
00398         (*pdl)->bFile = FALSE;
00399
00400         /* make a null directory for the tree root directory -
00401          * all files and subdirs will be listed from here
00402          */
00403         /* Do NOT chain on anything with garbage pointers in it */
00404         temp = (DIRECT) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct direct));
00405         if (temp == NULL)
00406       goto LError;
00407     (*pdl)->dot = temp;
00408
00409         dir_dirinit((*pdl)->dot, (*pdl), NULL, "");
00410         (*pdl)->dot->relname[0] = 0;
00411         (*pdl)->dot->bScanned = TRUE;
00412     }
00413     dl = *pdl;
00414
00415     if (path)
00416     {
00417         /* were we given a file or a directory ? */
00418         if (bFile)
00419         {
00420             /* its a file. create a single file entry
00421              * and set the state accordingly
00422              */
00423             long fsize;
00424             FILETIME ft;
00425             DWORD attr;
00426
00427             fsize = dir_getpathsizeetc(tmppath, &ft, &attr);
00428
00429       if (!dir_addfile(dl->dot, tmppath, fsize, ft, attr, psequence))
00430                 goto LError;
00431         }
00432     }
00433
00434     fSuccess = TRUE;
00435
00436 LError:
00437     if (pTag)
00438         HeapFree(GetProcessHeap(), NULL, pTag);
00439     return fSuccess;
00440 } /* dir_appendlist */
00441
00442 void
00443 dir_setotherdirlist(
00444                     DIRLIST dl,
00445                     DIRLIST otherdl
00446                     )
00447 {
00448     dl->pOtherDirList = otherdl;
00449 }
00450
00451 /* free up the DIRLIST and all associated memory */
00452 void
00453 dir_delete(
00454            DIRLIST dl
00455            )
00456 {
00457     if (dl == NULL) {
00458         return;
00459     }
00460
00461     dir_cleardirect(dl->dot);
00462     HeapFree(GetProcessHeap(), NULL, dl->dot);
00463
00464     if (dl->pPattern) {
00465         HeapFree(GetProcessHeap(), NULL, dl->pPattern);
00466     }
00467
00468     HeapFree(GetProcessHeap(), NULL,  dl);
00469 }
00470
00471 /* ----- DIRLIST functions ------------------------------------------------*/
00472
00473 /* was the original build request a file or a directory ? */
00474 BOOL
00475 dir_isfile(
00476            DIRLIST dl
00477            )
00478 {
00479     if (dl == NULL) {
00480         return(FALSE);
00481     }
00482
00483     return(dl->bFile);
00484 }
00485
00486
00487 /* return the first file in the list, or NULL if no files found.
00488  * returns a DIRITEM. This can be used to get filename, size and chcksum.
00489  * if there are no files in the root, we recurse down until we find a file
00490  */
00491 DIRITEM
00492 dir_firstitem(
00493               DIRLIST dl
00494               )
00495 {
00496     if (dl == NULL) {
00497         return(NULL);
00498     }
00499
00500     /*
00501      * reset the state to indicate that no files have been read yet
00502      */
00503     dl->dot->pos = DL_FILES;
00504     dl->dot->curdir = NULL;
00505
00506     /* now get the next filename */
00507     return(dir_findnextfile(dl, dl->dot));
00508 } /* dir_firstitem */
00509
00510
00511 /*
00512  * get the next filename after the one given.
00513  *
00514  * The List_Next function can give us the next element on the list of files.
00515  * If this is null, we need to go back to the DIRECT and find the
00516  * next list of files to traverse (in the next subdir).
00517  *
00518  * after scanning all the subdirs, return to the parent to scan further
00519  * dirs that are peers of this, if there are any. If we have reached the end of
00520  * the tree (no more dirs in dl->dot to scan), return NULL.
00521  *
00522  * Don't recurse to lower levels unless fDeep is TRUE
00523  */
00524 DIRITEM
00525 dir_nextitem(
00526              DIRLIST dl,
00527              DIRITEM cur,
00528              BOOL fDeep
00529              )
00530 {
00531     DIRITEM next;
00532
00533     if ((dl == NULL) || (cur == NULL)) {
00534         TRACE_ERROR("DIR: null arguments to dir_nextitem", FALSE);
00535         return(NULL);
00536     }
00537
00538     if (bAbort) return NULL;  /* user requested abort */
00539
00540     /* local list */
00541
00542     if ( (next = (DIRITEM)List_Next(cur)) != NULL) {
00543         /* there was another file on this list */
00544         return(next);
00545     }
00546     if (!fDeep) return NULL;
00547
00548     /* get the head of the next list of filenames from the directory */
00549     cur->direct->pos = DL_DIRS;
00550     cur->direct->curdir = NULL;
00551     return(dir_findnextfile(dl, cur->direct));
00552 } /* dir_nextitem */
00553
00554 DIRITEM
00555 dir_findnextfile(
00556                  DIRLIST dl,
00557                  DIRECT curdir
00558                  )
00559 {
00560     DIRITEM curfile;
00561
00562     if (bAbort) return NULL;  /* user requested abort */
00563
00564     if ((dl == NULL) || (curdir == NULL)) {
00565         return(NULL);
00566     }
00567
00568     /* scan the subdir if necessary */
00569     if (!curdir->bScanned) {
00570         dir_scan(curdir, FALSE);
00571     }
00572
00573     /* have we already read the files in this directory ? */
00574     if (curdir->pos == DL_FILES) {
00575         /* no - return head of file list */
00576         curfile = (DIRITEM) List_First(curdir->diritems);
00577         if (curfile != NULL) {
00578             return(curfile);
00579         }
00580
00581         /* no more files - try the subdirs */
00582         curdir->pos = DL_DIRS;
00583     }
00584
00585     /* try the next subdir on the list, if any */
00586     /* is this the first or the next */
00587     if (curdir->curdir == NULL) {
00588         curdir->curdir = (DIRECT) List_First(curdir->directs);
00589     } else {
00590         curdir->curdir = (DIRECT) List_Next(curdir->curdir);
00591     }
00592     /* did we find a subdir ? */
00593     if (curdir->curdir == NULL) {
00594
00595         /* no more dirs - go back to parent if there is one */
00596         if (curdir->parent == NULL) {
00597             /* no parent - we have exhausted the tree */
00598             return(NULL);
00599         }
00600
00601         /* reset parent state to indicate this is the current
00602          * directory - so that next gets the next after this.
00603          * this ensures that multiple callers of dir_nextitem()
00604          * to the same tree work.
00605          */
00606         curdir->parent->pos = DL_DIRS;
00607         curdir->parent->curdir = curdir;
00608
00609         return(dir_findnextfile(dl, curdir->parent));
00610     }
00611
00612     /* there is a next directory - set it to the
00613      * beginning and get the first file from it
00614      */
00615     curdir->curdir->pos = DL_FILES;
00616     curdir->curdir->curdir = NULL;
00617     return(dir_findnextfile(dl, curdir->curdir));
00618
00619 } /* dir_findnextfile */
00620
00621
00622 /*
00623  * get a description of this DIRLIST - this is essentially the
00624  * rootname with any wildcard specifier at the end.
00625  *
00626  * NOTE that this is not a valid path to the tree root - for that you
00627  * need dir_getrootpath().
00628  */
00629 LPSTR
00630 dir_getrootdescription(
00631                        DIRLIST dl
00632                        )
00633 {
00634     LPSTR pname;
00635   HRESULT hr;
00636
00637     // allow enough space for \\servername! + MAX_PATH
00638     pname = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH + 15);
00639     if (pname == NULL) {
00640         return(NULL);
00641     }
00642
00643     if (dl->pDescription) {
00644         hr = StringCchCopy(pname, (MAX_PATH+15), dl->pDescription);
00645     if (FAILED(hr)) {
00646       OutputError(hr, IDS_SAFE_COPY);
00647       return (NULL);
00648     }
00649     } else {
00650         hr = StringCchCopy(pname, (MAX_PATH+15), dl->rootname);
00651     if (FAILED(hr)) {
00652       OutputError(hr, IDS_SAFE_COPY);
00653       return (NULL);
00654     }
00655
00656         if (dl->pPattern) {
00657             hr = StringCchCat(pname,(MAX_PATH+15), "\\");
00658       if (FAILED(hr)) {
00659         OutputError(hr, IDS_SAFE_CAT);
00660         return (NULL);
00661       }
00662             hr = StringCchCat(pname,(MAX_PATH+15),dl->pPattern);
00663       if (FAILED(hr)) {
00664         OutputError(hr, IDS_SAFE_CAT);
00665         return (NULL);
00666       }
00667         }
00668     }
00669
00670     return(pname);
00671 }
00672
00673 /*
00674  * free up a string returned from dir_getrootdescription
00675  */
00676 VOID
00677 dir_freerootdescription(
00678                         DIRLIST dl,
00679                         LPSTR string
00680                         )
00681 {
00682     HeapFree(GetProcessHeap(), NULL, string);
00683 }
00684
00685
00686 /*
00687  * dir_getrootpath
00688  *
00689  * return the path to the DIRLIST root. This will be a valid path, not
00690  * including the checksum server name or pPattern etc
00691  */
00692 LPSTR
00693 dir_getrootpath(
00694                 DIRLIST dl
00695                 )
00696 {
00697     return(dl->rootname);
00698 }
00699
00700
00701
00702 /*
00703  * free up a path created by dir_getrootpath
00704  */
00705 void
00706 dir_freerootpath(
00707                  DIRLIST dl,
00708                  LPSTR path
00709                  )
00710 {
00711     return;
00712 }
00713
00714
00715 /*
00716  * set custom description for dirlist
00717  */
00718 void
00719 dir_setdescription(DIRLIST dl, LPCSTR psz)
00720 {
00721     dl->pDescription = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lstrlen(psz) + 1);
00722   if (dl->pDescription) {
00723         HRESULT hr = StringCchCopy(dl->pDescription, (lstrlen(psz)+1), psz);
00724     if (FAILED(hr))
00725       OutputError(hr, IDS_SAFE_COPY);
00726   }
00727 }
00728
00729
00730
00731
00732 /*
00733  * returns TRUE if the DIRLIST parameter has a wildcard specified
00734  */
00735 BOOL
00736 dir_iswildcard(
00737                DIRLIST dl
00738                )
00739 {
00740     return (dl->pPattern != NULL);
00741 }
00742
00743
00744
00745
00746 /* --- DIRITEM functions ----------------------------------------------- */
00747
00748
00749 /*
00750  * Return a handle to the DIRLIST given a handle to the DIRITEM within it.
00751  *
00752  */
00753 DIRLIST
00754 dir_getlist(
00755             DIRITEM item
00756             )
00757 {
00758     if (item == NULL) {
00759         return(NULL);
00760     } else {
00761         return(item->direct->head);
00762     }
00763 }
00764
00765
00766 /*
00767  * return the name of the current file relative to tree root
00768  * This allocates storage.  Call dir_freerelname to release it.
00769  */
00770 LPSTR
00771 dir_getrelname(
00772                DIRITEM cur
00773                )
00774 {
00775     LPSTR name;
00776   HRESULT hr;
00777
00778     /* check this is a valid item */
00779     if (cur == NULL) {
00780         return(NULL);
00781     }
00782
00783     name = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
00784   if (name == NULL)
00785     return NULL;
00786         hr = StringCchCopy(name, MAX_PATH, cur->direct->relname);
00787     if (FAILED(hr)) {
00788       OutputError(hr, IDS_SAFE_COPY);
00789       return(NULL);
00790     }
00791     hr = StringCchCat(name, MAX_PATH, cur->name);
00792   if (FAILED(hr)) {
00793     OutputError(hr, IDS_SAFE_CAT);
00794     return(NULL);
00795   }
00796
00797     return(name);
00798 } /* dir_getrelname */
00799
00800
00801 /* free up a relname that we allocated. This interface allows us
00802  * some flexibility in how we store relative and complete names
00803  *
00804  */
00805 void
00806 dir_freerelname(
00807                 DIRITEM cur,
00808                 LPSTR name
00809                 )
00810 {
00811     if ((cur != NULL)) {
00812         if (name != NULL) {
00813             HeapFree(GetProcessHeap(), NULL, name);
00814         }
00815     }
00816 } /* dir_freerelname */
00817
00818
00819 /*
00820  * get an open-able name for the file. This is the complete pathname
00821  * of the item (DIRLIST rootpath + DIRITEM relname)
00822  *
00823  */
00824 LPSTR
00825 dir_getopenname(
00826                 DIRITEM item
00827                 )
00828 {
00829     LPSTR fname;
00830     DIRLIST phead;
00831   HRESULT hr;
00832
00833     if (item == NULL) {
00834         return(NULL);
00835     }
00836
00837     phead = item->direct->head;
00838
00839     if (item->localname != NULL) {
00840         return(item->localname);
00841     }
00842
00843     if (phead->bFile) {
00844         return(phead->rootname);
00845     }
00846
00847     // build up the file name from rootname+relname
00848     // start with the root portion
00849     fname = (char*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MAX_PATH);
00850     if (!fname)
00851         return NULL;
00852     hr = StringCchCopy(fname, MAX_PATH, phead->rootname);
00853   if (FAILED(hr)) {
00854     OutputError(hr, IDS_SAFE_COPY);
00855     return(NULL);
00856   }
00857
00858     /*
00859      * it's a simple local name - add both relname and name to make
00860      * the complete filename
00861      */
00862     /* avoid the . or .\ at the end of the relname */
00863     if (*CharPrev(fname, fname+lstrlen(fname)) == '\\') {
00864         hr = StringCchCat(fname, MAX_PATH,&item->direct->relname[2]);
00865     if (FAILED(hr)) {
00866       OutputError(hr, IDS_SAFE_COPY);
00867       return(NULL);
00868     }
00869     } else {
00870         hr = StringCchCat(fname, MAX_PATH,&item->direct->relname[1]);
00871     if (FAILED(hr)) {
00872       OutputError(hr, IDS_SAFE_CAT);
00873       return(NULL);
00874     }
00875     }
00876     hr = StringCchCat(fname, MAX_PATH, item->name);
00877   if (FAILED(hr)) {
00878     OutputError(hr, IDS_SAFE_CAT);
00879     return(NULL);
00880   }
00881
00882     return(fname);
00883 }
00884
00885
00886
00887 /*
00888  * free up memory created by a call to dir_getopenname(). This *may*
00889  * cause the file to be deleted if it was a temporary copy.
00890  */
00891 void
00892 dir_freeopenname(
00893                  DIRITEM item,
00894                  LPSTR openname
00895                  )
00896 {
00897     if ((item == NULL) || (openname == NULL)) {
00898         return;
00899     }
00900
00901     if (item->localname != NULL) {
00902         /* freed in dir_cleardirect */
00903         return;
00904     }
00905     if (item->direct->head->bFile) {
00906         /* we used the rootname */
00907         return;
00908     }
00909
00910     HeapFree(GetProcessHeap(), NULL, openname);
00911
00912 } /* dir_freeopenname */
00913
00914
00915 /*
00916  * return an open file handle to the file. if it is local,
00917  * just open the file.
00918  */
00919 HANDLE
00920 dir_openfile(
00921              DIRITEM item
00922              )
00923 {
00924     LPSTR fname;
00925     HANDLE fh;
00926
00927
00928     fname = dir_getopenname(item);
00929     if (fname == NULL) {
00930         return INVALID_HANDLE_VALUE;
00931     }
00932
00933     fh = CreateFile(fname, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
00934                     0, OPEN_EXISTING, 0, 0);
00935
00936     dir_freeopenname(item, fname);
00937
00938     return(fh);
00939 } /* dir_openfile */
00940
00941
00942
00943
00944 /*
00945  * close a file opened with dir_openfile.
00946  */
00947 void
00948 dir_closefile(
00949               DIRITEM item,
00950               HANDLE fh
00951               )
00952 {
00953     CloseHandle(fh);
00954
00955 } /* dir_closefile */
00956
00957
00958
00959 /* Recreate all the checksums and status for di as though
00960    it had never been looked at before
00961 */
00962 void
00963 dir_rescanfile(
00964                DIRITEM di
00965                )
00966 {
00967     LPSTR fullname;
00968
00969     if (di==NULL) return;
00970
00971     /* start with it invalid, erroneous and zero */
00972     di->sumvalid = FALSE;
00973     di->fileerror = TRUE;
00974     di->checksum = 0;
00975
00976     fullname = dir_getopenname(di);
00977     di->size = dir_getpathsizeetc(fullname, &(di->ft_lastwrite), &(di->attr));
00978     di->checksum = dir_getchecksum(di);
00979
00980     dir_freeopenname(di, fullname);
00981
00982     di->sumvalid = !(di->fileerror);
00983
00984 } /* dir_rescanfile */
00985
00986
00987 /* return a TRUE iff item has a valid checksum */
00988 BOOL
00989 dir_validchecksum(
00990                   DIRITEM item
00991                   )
00992 {
00993     return (item!=NULL) && (item->sumvalid);
00994 }
00995
00996
00997 BOOL
00998 dir_fileerror(
00999               DIRITEM item
01000               )
01001 {
01002     return (item == NULL) || (item->fileerror);
01003 }
01004
01005
01006 /* return the current file checksum. Open the file and
01007  * calculate the checksum if it has not already been done.
01008  */
01009 DWORD
01010 dir_getchecksum(
01011                 DIRITEM cur
01012                 )
01013 {
01014     LPSTR fullname;
01015
01016     /* check this is a valid item */
01017     if (cur == NULL) {
01018         return(0);
01019     }
01020
01021     if (!cur->sumvalid) {
01022         /*
01023          * need to calculate checksum
01024          */
01025             LONG err;
01026
01027             fullname = dir_getopenname(cur);
01028             cur->checksum = checksum_file(fullname, &err);
01029             if (err==0) {
01030                 cur->sumvalid = TRUE;
01031                 cur->fileerror = FALSE;
01032             } else {
01033                 cur->fileerror = TRUE;
01034                 return 0;
01035             }
01036
01037             dir_freeopenname(cur, fullname);
01038     }
01039
01040     return(cur->checksum);
01041 } /* dir_getchecksum */
01042
01043
01044
01045 /* return the file size (set during scanning) - returns 0 if invalid */
01046 long
01047 dir_getfilesize(
01048                 DIRITEM cur
01049                 )
01050 {
01051     /* check this is a valid item */
01052     if (cur == NULL) {
01053         return(0);
01054     }
01055
01056
01057     return(cur->size);
01058 } /* dir_getfilesize */
01059
01060 /* return the file attributes (set during scanning) - returns 0 if invalid */
01061 DWORD
01062 dir_getattr(
01063             DIRITEM cur
01064             )
01065 {
01066     /* check this is a valid item */
01067     if (cur == NULL) {
01068         return(0);
01069     }
01070
01071
01072     return(cur->attr);
01073 } /* dir_getattr */
01074
01075 /* return the file time (last write time) (set during scanning), (0,0) if invalid */
01076 FILETIME
01077 dir_GetFileTime(
01078                 DIRITEM cur
01079                 )
01080 {
01081     /* return time of (0,0) if this is an invalid item */
01082     if (cur == NULL) {
01083         FILETIME ft;
01084         ft.dwLowDateTime = 0;
01085         ft.dwHighDateTime = 0;
01086         return ft;
01087     }
01088
01089     return(cur->ft_lastwrite);
01090
01091 } /* dir_GetFileTime */
01092
01093 /*
01094  * extract the portions of a name that match wildcards - for now,
01095  * we only support wildcards at start and end.
01096  * if pTag is non-null, then the source will have a tag matching it that
01097  * can also be ignored.
01098  */
01099 void
01100 dir_extractwildportions(
01101                        LPSTR pDest,
01102                        LPSTR pSource,
01103                        LPSTR pPattern,
01104                        LPSTR pTag
01105                        )
01106 {
01107     int size;
01108
01109     /*
01110      * for now, just support the easy cases where there is a * at beginning or
01111      * end
01112      */
01113
01114     if (pPattern[0] == '*') {
01115         size = lstrlen(pSource) - (lstrlen(pPattern) -1);
01116
01117     } else if (pPattern[lstrlen(pPattern) -1] == '*') {
01118         pSource += lstrlen(pPattern) -1;
01119         size = lstrlen(pSource);
01120     } else {
01121         size = lstrlen(pSource);
01122     }
01123
01124     if (pTag != NULL) {
01125         size -= lstrlen(pTag);
01126     }
01127
01128     My_mbsncpy(pDest, pSource, size);
01129     pDest[size] = '\0';
01130 }
01131
01132 /*
01133  * compares two DIRITEM paths that are both based on wildcards. if the
01134  * directories match, then the filenames are compared after removing
01135  * the fixed portion of the name - thus comparing only the
01136  * wildcard portion.
01137  */
01138 int
01139 dir_compwildcard(
01140                 DIRLIST dleft,
01141                 DIRLIST dright,
01142                 LPSTR lname,
01143                 LPSTR rname
01144                 )
01145 {
01146     LPSTR pfinal1, pfinal2;
01147     char final1[MAX_PATH], final2[MAX_PATH];
01148     int res;
01149
01150     /*
01151      * relnames always have at least one backslash
01152      */
01153     pfinal1 = My_mbsrchr(lname, '\\');
01154     pfinal2 = My_mbsrchr(rname, '\\');
01155
01156     My_mbsncpy(final1, lname, (size_t)(pfinal1 - lname));
01157     final1[pfinal1 - lname] = '\0';
01158     My_mbsncpy(final2, rname, (size_t)(pfinal2 - rname));
01159     final2[pfinal2 - rname] = '\0';
01160
01161
01162     /*
01163      * compare all but the final component - if not the same, then
01164      * all done.
01165      */
01166     res = utils_CompPath(final1,final2);
01167     if (res != 0) {
01168         return(res);
01169     }
01170
01171     // extract just the wildcard-matching portions of the final elements
01172     dir_extractwildportions(final1, &pfinal1[1], dleft->pPattern, 0);
01173     dir_extractwildportions(final2, &pfinal2[1], dright->pPattern, 0);
01174
01175     return(utils_CompPath(final1, final2));
01176 }
01177
01178 /*
01179  * compares two DIRLIST items, based on a sequence number rather than filenames.
01180  */
01181 BOOL dir_compsequencenumber(DIRITEM dleft, DIRITEM dright, int *pcmpvalue)
01182 {
01183     if (!dleft->sequence && !dright->sequence)
01184         return FALSE;
01185
01186     if (!dleft->sequence)
01187         *pcmpvalue = -1;
01188     else if (!dright->sequence)
01189         *pcmpvalue = 1;
01190     else
01191         *pcmpvalue = dleft->sequence - dright->sequence;
01192
01193     return TRUE;
01194 }
01195
01196
01197
01198
01199
01200
01201 /* --- file copying ---------------------------------------------------*/
01202
01203 static int nLocalCopies;        /* cleared in startcopy, ++d in copy
01204                                 ** inspected in endcopy
01205                                 */
01206
01207 /* start a bulk copy */
01208 BOOL
01209 dir_startcopy(
01210               DIRLIST dl
01211               )
01212 {
01213     nLocalCopies = 0;
01214     return(TRUE);
01215 } /* dir_startcopy */
01216
01217 int
01218 dir_endcopy(
01219             DIRLIST dl
01220             )
01221 {
01222   return(nLocalCopies);
01223 } /* dir_endcopy */
01224
01225 /* Build the real path from item and newroot into newpath.
01226  * Create directories as needed so that it is valid.
01227  * If mkdir fails, return FALSE, but return the full path that we were
01228  * trying to make anyway.
01229  */
01230 BOOL
01231 dir_MakeValidPath(
01232                   LPSTR newpath,
01233                   DIRITEM item,
01234                   LPSTR newroot
01235                   )
01236 {
01237     LPSTR relname;
01238     LPSTR pstart, pdest, pel;
01239     BOOL bOK = TRUE;
01240   HRESULT hr;
01241
01242     /*
01243      * name of file relative to the tree root
01244      */
01245     relname = dir_getrelname(item);
01246
01247     /*
01248      * build the new pathname by concatenating the new root and
01249      * the old relative name. add one path element at a time and
01250      * ensure that the directory exists, creating it if necessary.
01251      */
01252     hr = StringCchCopy(newpath, MAX_PATH, newroot);
01253   if (FAILED(hr))
01254     OutputError(hr, IDS_SAFE_COPY);
01255
01256     /* add separating slash if not already there */
01257     if (*CharPrev(newpath, newpath+lstrlen(newpath)) != '\\') {
01258         hr = StringCchCat(newpath, MAX_PATH, "\\");
01259     if (FAILED(hr))
01260       OutputError(hr, IDS_SAFE_CAT);
01261     }
01262
01263     pstart = relname;
01264     while ( (pel = My_mbschr(pstart, '\\')) != NULL) {
01265
01266         /*
01267          * ignore .
01268          */
01269         if (My_mbsncmp(pstart, ".\\", 2) != 0) {
01270
01271             pdest = &newpath[lstrlen(newpath)];
01272
01273             // copy all but the backslash
01274             // on NT you can create a dir 'fred\'
01275             // on dos you have to pass 'fred' to _mkdir()
01276             My_mbsncpy(pdest, pstart, (size_t)(pel - pstart));
01277             pdest[pel - pstart] = '\0';
01278
01279             /* create subdir if necessary */
01280             if (!dir_isvaliddir(newpath)) {
01281                 if (_mkdir(newpath) != 0) {
01282                     /* note error, but keep going */
01283                     bOK = FALSE;
01284                 }
01285             }
01286
01287             // now insert the backslash
01288             hr = StringCchCat(pdest, (MAX_PATH - lstrlen(newpath)),"\\");
01289       if (FAILED(hr))
01290         OutputError(hr, IDS_SAFE_CAT);
01291         }
01292
01293         /* found another element ending in slash. incr past the \\ */
01294         pel++;
01295
01296         pstart = pel;
01297     }
01298
01299     /*
01300      * there are no more slashes, so pstart points at the final
01301      * element
01302      */
01303     hr = StringCchCat(newpath, (MAX_PATH - lstrlen(newpath)), pstart);
01304   if (FAILED(hr))
01305     OutputError(hr, IDS_SAFE_CAT);
01306     dir_freerelname(item, relname);
01307     return bOK;
01308 }
01309
01310
01311
01312 /*
01313  * create a copy of the file, in the new root directory.
01314  * returns TRUE for success and FALSE for failure.
01315  */
01316 BOOL
01317 dir_copy(
01318          DIRITEM item,
01319          LPSTR newroot,
01320          BOOL HitReadOnly,
01321          BOOL CopyNoAttributes
01322          )
01323 {
01324     /*
01325      * newpath must be static for Win 3.1 so that it is in the
01326      * data segment (near) and not on the stack (far).
01327      */
01328     static char newpath[MAX_PATH];
01329     BOOL bOK;
01330
01331     char msg[MAX_PATH+40];
01332     BY_HANDLE_FILE_INFORMATION bhfi;
01333     HANDLE hfile;
01334     DWORD fa;
01335   HRESULT hr;
01336
01337     /*
01338      * check that the newroot directory itself exists
01339      */
01340     if ((item == NULL) || !dir_isvaliddir(newroot)) {
01341         return(FALSE);
01342     }
01343
01344     if (!dir_MakeValidPath(newpath, item, newroot)) return FALSE;
01345
01346     /* local copy of file */
01347     LPSTR pOpenName;
01348
01349     pOpenName = dir_getopenname(item);
01350
01351     /* if the target file already exists and is readonly,
01352      * warn the user, and delete if ok (remembering to clear
01353      * the read-only flag
01354      */
01355     bOK = TRUE;
01356     fa = GetFileAttributes(newpath);
01357     if ( (fa != -1) &&  (fa & FILE_ATTRIBUTE_READONLY)) {
01358         hr = StringCchPrintf(msg, (MAX_PATH+40), LoadRcString(IDS_IS_READONLY),
01359                  (LPSTR) newpath);
01360     if (FAILED(hr))
01361       OutputError(hr, IDS_SAFE_PRINTF);
01362
01363         sdkdiff_UI(TRUE);
01364         if ((HitReadOnly)
01365      || (MessageBox(hwndClient, msg, LoadRcString(IDS_COPY_FILES),
01366                            MB_OKCANCEL|MB_ICONSTOP) == IDOK)) {
01367             sdkdiff_UI(FALSE);
01368             SetFileAttributes(newpath, fa & ~FILE_ATTRIBUTE_READONLY);
01369             DeleteFile(newpath);
01370         } else {
01371             sdkdiff_UI(FALSE);
01372             bOK = FALSE; /* don't overwrite */
01373              // abort the copy... go and release resources
01374         }
01375      }
01376
01377     if (bOK) {
01378         bOK = CopyFile(pOpenName, newpath, FALSE);
01379     }
01380     // The attributes are copied by CopyFile
01381     if (bOK) {
01382
01383         /* having copied the file, now copy the times */
01384         hfile = CreateFile(pOpenName, GENERIC_READ, 0, NULL,
01385                            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
01386
01387         GetFileTime(hfile, &bhfi.ftCreationTime,
01388                     &bhfi.ftLastAccessTime, &bhfi.ftLastWriteTime);
01389         CloseHandle(hfile);
01390
01391         hfile = CreateFile(newpath, GENERIC_WRITE, 0, NULL,
01392                            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
01393         SetFileTime(hfile, &bhfi.ftCreationTime,
01394                     &bhfi.ftLastAccessTime,
01395                     &bhfi.ftLastWriteTime);
01396         CloseHandle(hfile);
01397
01398         if (CopyNoAttributes) {
01399             // Prepare to kill the attributes...
01400             SetFileAttributes(newpath, FILE_ATTRIBUTE_NORMAL);
01401         }
01402     }
01403     if (bOK)
01404         ++nLocalCopies;
01405
01406     dir_freeopenname(item, pOpenName);
01407
01408
01409     return(bOK);
01410 } /* dir_copy */
01411
01412
01413
01414 /*--- internal functions ---------------------------------------- */
01415
01416 /* fill out a new DIRECT for a subdirectory (pre-allocated).
01417  * init files and dirs lists to empty (List_Create). set the relname
01418  * of the directory by pre-pending the parent relname if there
01419  * is a parent, and appending a trailing slash (if there isn't one).
01420  */
01421 void
01422 dir_dirinit(
01423             DIRECT dir,
01424             DIRLIST head,
01425             DIRECT parent,
01426             LPSTR name
01427             )
01428 {
01429     int size;
01430   HRESULT hr;
01431
01432     dir->head = head;
01433     dir->parent = parent;
01434
01435     /* add on one for the null and one for the trailing slash */
01436     size = lstrlen(name) + 2;
01437     if (parent != NULL) {
01438         size += lstrlen(parent->relname);
01439     }
01440
01441     /* build the relname from the parent and the current name
01442      * with a terminating slash
01443      */
01444     dir->relname = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
01445     if (dir->relname == NULL)
01446     return;
01447   if (parent != NULL) {
01448         hr = StringCchCopy(dir->relname, size,parent->relname);
01449     if (FAILED(hr))
01450       OutputError(hr, IDS_SAFE_COPY);
01451     } else {
01452         dir->relname[0] = '\0';
01453     }
01454
01455     hr = StringCchCat(dir->relname, size, name);
01456   if (FAILED(hr))
01457     OutputError(hr, IDS_SAFE_CAT);
01458
01459     if (*CharPrev(dir->relname, dir->relname+lstrlen(dir->relname)) != '\\')
01460     {
01461         hr = StringCchCat(dir->relname, size, "\\");
01462     if (FAILED(hr))
01463       OutputError(hr, IDS_SAFE_CAT);
01464     }
01465
01466     /* force name to lowercase */
01467     AnsiLowerBuff(dir->relname, lstrlen(dir->relname));
01468
01469     dir->diritems = List_Create();
01470     dir->directs = List_Create();
01471     dir->bScanned = FALSE;
01472     dir->pos = DL_FILES;
01473
01474 } /* dir_dirinit */
01475
01476 /* initialise the contents of an (allocated) DIRITEM struct. checksum
01477  * the file if dir->head->bSum is true
01478  *
01479  */
01480 BOOL
01481 dir_fileinit(
01482              DIRITEM pfile,
01483              DIRECT dir,
01484              LPSTR path,
01485              long size,
01486              FILETIME ft,
01487              DWORD attr,
01488              int *psequence
01489              )
01490 {
01491     BOOL bFileOk = TRUE;
01492   HRESULT hr;
01493
01494     pfile->name = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lstrlen(path) + 1);
01495     if (pfile->name == NULL)
01496     return NULL;
01497
01498   hr = StringCchCopy(pfile->name, (lstrlen(path)+1), path);
01499   if (FAILED(hr))
01500     OutputError(hr, IDS_SAFE_COPY);
01501
01502   /*force name to lower case */
01503     AnsiLowerBuff(pfile->name, lstrlen(path));
01504
01505     pfile->direct = dir;
01506     pfile->size = size;
01507     pfile->ft_lastwrite = ft;
01508     pfile->attr = attr;
01509
01510     pfile->sequence = psequence ? *psequence : 0;
01511
01512     pfile->localname = NULL;
01513
01514     if (dir->head->bSum) {
01515         LONG err;
01516         LPSTR openname;
01517
01518         openname = dir_getopenname(pfile);
01519         pfile->checksum = checksum_file(openname, &err);
01520
01521         if (err!=0) {
01522             pfile->sumvalid = FALSE;
01523         } else {
01524             pfile->sumvalid = TRUE;
01525         }
01526         dir_freeopenname(pfile, openname);
01527
01528     } else {
01529         pfile->sumvalid = FALSE;
01530     }
01531
01532     return bFileOk;
01533 } /* dir_fileinit */
01534
01535
01536
01537 /* is this a valid file or not */
01538 BOOL
01539 dir_isvalidfile(
01540                 LPSTR path
01541                 )
01542 {
01543     DWORD dwAttrib;
01544
01545     dwAttrib = GetFileAttributes(path);
01546     if (dwAttrib == -1) {
01547         return(FALSE);
01548     }
01549     if (dwAttrib & FILE_ATTRIBUTE_DIRECTORY) {
01550         return(FALSE);
01551     }
01552     return(TRUE);
01553 } /* dir_isvalidfile */
01554
01555
01556 /* is this a valid directory ? */
01557 BOOL
01558 dir_isvaliddir(
01559                LPCSTR path
01560                )
01561 {
01562     DWORD dwAttrib;
01563
01564     dwAttrib = GetFileAttributes(path);
01565     if (dwAttrib == -1) {
01566         return(FALSE);
01567     }
01568     if (dwAttrib & FILE_ATTRIBUTE_DIRECTORY) {
01569         return(TRUE);
01570     }
01571     return(FALSE);
01572 } /* dir_isvaliddir */
01573
01574
01575
01576 /*
01577  * scan the directory given. add all files to the list
01578  * in alphabetic order, and add all directories in alphabetic
01579  * order to the list of child DIRITEMs. If bRecurse is true, go on to
01580  * recursive call dir_scan for each of the child DIRITEMs
01581  */
01582 void
01583 dir_scan(
01584          DIRECT dir,
01585          BOOL bRecurse
01586          )
01587 {
01588     PSTR path=NULL, completepath = NULL;
01589     int size;
01590     DIRECT child;
01591     BOOL bMore;
01592     long filesize;
01593     FILETIME ft;
01594     BOOL bIsDir;
01595     LPSTR name;
01596     HANDLE hFind;
01597     WIN32_FIND_DATA finddata;
01598   HRESULT hr;
01599
01600     /* make the complete search string including *.* */
01601     size = lstrlen(dir->head->rootname);
01602     size += lstrlen(dir->relname);
01603
01604     /* add on one null and \*.* */
01605     // in fact, we need space for pPattern instead of *.* but add an
01606     // extra few in case pPattern is less than *.*
01607     if (dir->head->pPattern != NULL) {
01608         size += lstrlen(dir->head->pPattern);
01609     }
01610     size += 5;
01611
01612     path = (PSTR)HeapAlloc(GetProcessHeap(), NULL, size);
01613   if (path == NULL)
01614     goto LSkip;
01615     completepath = (PSTR)HeapAlloc(GetProcessHeap(), NULL, size);
01616   if (completepath == NULL)
01617     goto LSkip;
01618
01619     if (!path || !completepath)
01620         goto LSkip;
01621
01622     /*
01623      * fill out path with all but the *.*
01624      */
01625     hr = StringCchCopy(path, size, dir->head->rootname);
01626   if (FAILED(hr))
01627     OutputError(hr, IDS_SAFE_COPY);
01628
01629     /* omit the . at the beginning of the relname, and the
01630      * .\ if there is a trailing \ on the rootname
01631      */
01632     if (*CharPrev(path, path+lstrlen(path)) == '\\') {
01633         hr = StringCchCat(path, size, &dir->relname[2]);
01634     if (FAILED(hr))
01635       OutputError(hr, IDS_SAFE_CAT);
01636     } else {
01637         hr = StringCchCat(path, size, &dir->relname[1]);
01638     if (FAILED(hr))
01639       OutputError(hr, IDS_SAFE_CAT);
01640     }
01641
01642
01643     /*
01644      * do this scan twice, once for subdirectories
01645      * (using *.* as the final element)
01646      * and the other for files (using the pattern or *.* if none)
01647      */
01648
01649     hr = StringCchCopy(completepath, size, path);
01650   if (FAILED(hr))
01651     OutputError(hr, IDS_SAFE_COPY);
01652     hr = StringCchCat(completepath, size, "*.*");
01653   if (FAILED(hr))
01654     OutputError(hr, IDS_SAFE_CAT);
01655
01656
01657     /*
01658      * scan for all subdirectories
01659      */
01660
01661     hFind = FindFirstFile(completepath, &finddata);
01662     bMore = (hFind != INVALID_HANDLE_VALUE);
01663
01664     while (bMore) {
01665
01666         bIsDir = (finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
01667         name = (LPSTR) &finddata.cFileName;
01668         filesize = finddata.nFileSizeLow;
01669         if (bIsDir) {
01670             if ( (lstrcmp(name, ".") != 0) &&
01671                  (lstrcmp(name, "..") != 0))  {
01672
01673                 if (dir->head->pOtherDirList == NULL) {
01674                     dir_adddirect(dir, name);
01675                 } else {
01676                     char otherName[MAX_PATH+1];
01677                     hr = StringCchCopy(otherName, (MAX_PATH+1), dir_getrootpath(dir->head->pOtherDirList));
01678           if (FAILED(hr))
01679             OutputError(hr, IDS_SAFE_COPY);
01680                     if (otherName[strlen(otherName)-1] == '\\') {
01681                         hr = StringCchCat(otherName, (MAX_PATH+1), &dir->relname[2]);
01682             if (FAILED(hr))
01683               OutputError(hr, IDS_SAFE_CAT);
01684                     } else {
01685                         hr = StringCchCat(otherName, (MAX_PATH+1), &dir->relname[1]);
01686             if (FAILED(hr))
01687               OutputError(hr, IDS_SAFE_CAT);
01688                     }
01689                     hr = StringCchCat(otherName, (MAX_PATH+1), name);
01690           if (FAILED(hr))
01691             OutputError(hr, IDS_SAFE_CAT);
01692
01693                     if (dir_isvaliddir(otherName)) {
01694                         dir_adddirect(dir, name);
01695                     }
01696                 }
01697             }
01698         }
01699         if (bAbort) break;  /* User requested abort */
01700
01701         bMore = FindNextFile(hFind, &finddata);
01702     }
01703
01704     FindClose(hFind);
01705
01706     /*
01707      * now do it a second time looking for files
01708      */
01709     hr = StringCchCopy(completepath, size, path);
01710   if (FAILED(hr))
01711     OutputError(hr, IDS_SAFE_COPY);
01712     hr = StringCchCat(completepath, size,
01713             dir->head->pPattern == NULL ? "*.*" : dir->head->pPattern);
01714   if (FAILED(hr))
01715     OutputError(hr, IDS_SAFE_CAT);
01716
01717     /* read all file entries in the directory */
01718     hFind = FindFirstFile(completepath, &finddata);
01719     bMore = (hFind != INVALID_HANDLE_VALUE);
01720
01721     while (bMore) {
01722         if (bAbort) break;  /* user requested abort */
01723
01724         bIsDir = (finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
01725         name = (LPSTR) &finddata.cFileName;
01726         filesize = finddata.nFileSizeLow;
01727         ft = finddata.ftLastWriteTime;
01728         if (!bIsDir) {
01729       dir_addfile(dir, name, filesize, ft, finddata.dwFileAttributes, 0);
01730         }
01731         bMore = FindNextFile(hFind, &finddata);
01732     }
01733
01734     FindClose(hFind);
01735
01736 LSkip:
01737     HeapFree(GetProcessHeap(), NULL, path);
01738     HeapFree(GetProcessHeap(), NULL, completepath);
01739
01740     dir->bScanned = TRUE;
01741     dir->pos = DL_FILES;
01742
01743     if (bRecurse) {
01744     for( child=(DIRECT)List_First(dir->directs);  child!=NULL;  child = (DIRECT)List_Next((LPVOID)child)) {
01745             if (bAbort) break;  /* user requested abort */
01746             dir_scan(child, TRUE);
01747         }
01748     }
01749
01750 } /* dir_scan */
01751
01752
01753 /*
01754  * add the file 'path' to the list of files in dir, in order.
01755  *
01756  * checksum the file if dir->head->bSum  is true
01757  *
01758  */
01759 BOOL
01760 dir_addfile(
01761             DIRECT dir,
01762             LPSTR path,
01763             DWORD size,
01764             FILETIME ft,
01765             DWORD attr,
01766             int *psequence
01767             )
01768 {
01769     DIRITEM pfile;
01770
01771     AnsiLowerBuff(path, lstrlen(path));
01772
01773     // when psequence is passed, do not sort the list
01774     if (!psequence)
01775     {
01776     for( pfile=(DIRITEM)List_Last(dir->diritems);  pfile!=NULL;  pfile = (DIRITEM)List_Prev((LPVOID)pfile)) {
01777             if (utils_CompPath(pfile->name, path) <= 0) {
01778                 break;     /* goes after this one */
01779             }
01780         }
01781         /* goes after pfile, NULL => goes at start */
01782         pfile = (DIRITEM)List_NewAfter(dir->diritems, pfile, sizeof(struct diritem));
01783     }
01784     else
01785     {
01786         /* append to end -- psequence implies that we are being called in
01787          * sequence order and do not need to do any further sorting.
01788          */
01789         pfile = (DIRITEM)List_NewBefore(dir->diritems, NULL, sizeof(struct diritem));
01790     }
01791
01792   if (!dir_fileinit(pfile, dir, path, size, ft, attr, psequence))
01793     {
01794         List_Delete(pfile);
01795         return FALSE;
01796     }
01797
01798     return TRUE;
01799 } /* dir_addfile */
01800
01801
01802 /* add a new directory in alphabetic order on
01803  * the list dir->directs
01804  *
01805  */
01806 void
01807 dir_adddirect(
01808               DIRECT dir,
01809               LPSTR path
01810               )
01811 {
01812     DIRECT child;
01813     LPSTR finalel;
01814     char achTempName[MAX_PATH];
01815
01816     AnsiLowerBuff(path, lstrlen(path));
01817     for( child=(DIRECT)List_First(dir->directs);  child!=NULL;  child = (DIRECT)List_Next((LPVOID)child)) {
01818         int cmpval;
01819
01820         /* we need to compare the child name with the new name.
01821          * the child name is a relname with a trailing
01822          * slash - so compare only the name up to but
01823          * not including the final slash.
01824          */
01825         finalel = dir_finalelem(child->relname);
01826
01827         /*
01828          * we cannot use strnicmp since this uses a different
01829          * collating sequence to lstrcmpi. So copy the portion
01830          * we are interested in to a null-term. buffer.
01831          */
01832         My_mbsncpy(achTempName, finalel, lstrlen(finalel)-1);
01833         achTempName[lstrlen(finalel)-1] = '\0';
01834
01835         cmpval = utils_CompPath(achTempName, path);
01836
01837 #ifdef trace
01838         {
01839       HRESULT hr;
01840       char msg[600];
01841             hr = StringCchPrintf( msg, 600, "dir_adddirect: %s %s %s\n"
01842                       , achTempName
01843                       , ( cmpval<0 ? "<"
01844                           : (cmpval==0 ? "=" : ">")
01845                         )
01846                       , path
01847                     );
01848       if (FAILED(hr))
01849         OutputError(hr, IDS_SAFE_PRINTF);
01850             if (bTrace) Trace_File(msg);
01851         }
01852 #endif
01853         if (cmpval > 0) {
01854
01855             /* goes before this one */
01856             child = (DIRECT)List_NewBefore(dir->directs, child, sizeof(struct direct));
01857             dir_dirinit(child, dir->head, dir, path);
01858             return;
01859         }
01860     }
01861     /* goes at end */
01862     child = (DIRECT)List_NewLast(dir->directs, sizeof(struct direct));
01863     dir_dirinit(child, dir->head, dir, path);
01864 } /* dir_adddirect */
01865
01866
01867 /* free all memory associated with a DIRECT (including freeing
01868  * child lists). Don't de-alloc the direct itself (allocated on a list)
01869  */
01870 void
01871 dir_cleardirect(
01872                 DIRECT dir
01873                 )
01874 {
01875     DIRITEM pfile;
01876     DIRECT child;
01877
01878     /* clear contents of files list */
01879   for( pfile=(DIRITEM)List_First(dir->diritems);  pfile!=NULL;  pfile = (DIRITEM)List_Next((LPVOID)pfile)) {
01880         HeapFree(GetProcessHeap(), NULL, pfile->name);
01881
01882         if (pfile->localname) {
01883             if (pfile->bLocalIsTemp) {
01884                 /*
01885                  * the copy will have copied the attributes,
01886                  * including read-only. We should unset this bit
01887                  * so we can delete the temp file.
01888                  */
01889                 SetFileAttributes(pfile->localname,
01890                                   GetFileAttributes(pfile->localname)
01891                                   & ~FILE_ATTRIBUTE_READONLY);
01892                 DeleteFile(pfile->localname);
01893             }
01894
01895             HeapFree(GetProcessHeap(), NULL, pfile->localname);
01896             pfile->localname = NULL;
01897         }
01898     }
01899     List_Destroy(&dir->diritems);
01900
01901     /* clear contents of dirs list (recursively) */
01902   for( child=(DIRECT)List_First(dir->directs);  child!=NULL;  child = (DIRECT)List_Next((LPVOID)child)) {
01903         dir_cleardirect(child);
01904     }
01905     List_Destroy(&dir->directs);
01906
01907     HeapFree(GetProcessHeap(), NULL, dir->relname);
01908
01909 } /* dir_cleardirect */
01910
01911
01912
01913 /*
01914  * return a pointer to the final element in a path. note that
01915  * we may be passed relnames with a trailing final slash - ignore this
01916  * and return the element before that final slash.
01917  */
01918 LPSTR
01919 dir_finalelem(
01920               LPSTR path
01921               )
01922 {
01923     LPSTR chp;
01924     int size;
01925
01926     /* is the final character a slash ? */
01927     size = lstrlen(path) - 1;
01928     if (*(chp = CharPrev(path, path+lstrlen(path))) == '\\') {
01929             /* find the slash before this */
01930             while (chp > path) {
01931                     if (*(chp = CharPrev(path, chp)) == '\\') {
01932                             /* skip the slash itself */
01933                             chp++;
01934                             break;
01935                     }
01936             }
01937             return(chp);
01938     }
01939     /* look for final slash */
01940     chp = My_mbsrchr(path, '\\');
01941     if (chp != NULL) {
01942         return(chp+1);
01943     }
01944
01945     /* no slash - is there a drive letter ? */
01946     chp = My_mbsrchr(path, ':');
01947     if (chp != NULL) {
01948         return(chp+1);
01949     }
01950
01951     /* this is a final-element anyway */
01952     return(path);
01953
01954 } /* dir_finalelem */
01955
01956
01957
01958 /* find the size of a file given a pathname to it */
01959 long
01960 dir_getpathsizeetc(
01961                    LPSTR path,
01962                    FILETIME *pft,
01963                    DWORD *pattr
01964                    )
01965 {
01966     HANDLE fh;
01967     long size;
01968
01969     fh = CreateFile(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
01970     if (fh == INVALID_HANDLE_VALUE)
01971     {
01972         HANDLE hFind;
01973         WIN32_FIND_DATA finddata;
01974
01975         hFind = FindFirstFile(path, &finddata);
01976         if (hFind == INVALID_HANDLE_VALUE)
01977         {
01978             return 0;
01979         }
01980         else
01981         {
01982             FindClose(hFind);
01983             if (pft)
01984                 *pft = finddata.ftLastWriteTime;
01985             if (pattr != NULL)
01986                 *pattr = finddata.dwFileAttributes;
01987             return finddata.nFileSizeLow;
01988         }
01989     }
01990
01991     size = GetFileSize(fh, NULL);
01992     if (pft)
01993         GetFileTime(fh, NULL, NULL, pft);
01994     if (pattr != NULL)
01995         *pattr = GetFileAttributes(path);
01996     CloseHandle(fh);
01997     return(size);
01998 } /* dir_getpathsize */
01999
02000 /* ---- helpers ----------------------------------------------------------- */
02001
02002 BOOL iswildpath(LPCSTR pszPath)
02003 {
02004     if (strchr(pszPath, '*') || strchr(pszPath, '?'))
02005         return TRUE;
02006
02007     if (!(pszPath[0] && pszPath[0] == '/' && pszPath[1] && pszPath[1] == '/'))
02008     {
02009         DWORD dw;
02010
02011         dw = GetFileAttributes(pszPath);
02012         if (dw != (DWORD)-1 && (dw & FILE_ATTRIBUTE_DIRECTORY))
02013             return TRUE;
02014     }
02015
02016     return FALSE;
02017 }
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

StdAfx.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       StdAfx.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // stdafx.cpp : source file that includes just the standard includes
00012 //  stdafx.pch will be the pre-compiled header
00013 //  stdafx.obj will contain the pre-compiled type information
00014
00015 #include "stdafx.h"
00016
00017
00018 #include <atlimpl.cpp>
00019
00020 HRESULT WINAPI CSCPContextMenuModule::UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister)
00021 {
00022   static const WCHAR szIPS32[] = _T("InprocServer32");
00023   static const WCHAR szCLSID[] = _T("CLSID");
00024
00025   HRESULT hRes = S_OK;
00026
00027   LPOLESTR lpOleStrCLSIDValue;
00028   ::StringFromCLSID(clsid, &lpOleStrCLSIDValue);
00029
00030   CRegKey key;
00031   if (bRegister)
00032   {
00033     LONG lRes = key.Open(HKEY_CLASSES_ROOT, szCLSID);
00034     if (lRes == ERROR_SUCCESS)
00035     {
00036       lRes = key.Create(key, lpOleStrCLSIDValue);
00037       if (lRes == ERROR_SUCCESS)
00038       {
00039         WCHAR szModule[_MAX_PATH];
00040         ::GetModuleFileName(m_hInst, szModule, _MAX_PATH);
00041         key.SetKeyValue(szIPS32, szModule);
00042       }
00043     }
00044     if (lRes != ERROR_SUCCESS)
00045       hRes = HRESULT_FROM_WIN32(lRes);
00046   }
00047   else
00048   {
00049     key.Attach(HKEY_CLASSES_ROOT);
00050     if (key.Open(key, szCLSID) == ERROR_SUCCESS)
00051       key.RecurseDeleteKey(lpOleStrCLSIDValue);
00052   }
00053   ::CoTaskMemFree(lpOleStrCLSIDValue);
00054   return hRes;
00055 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COptionsCommand Member List

This is the complete list of members for COptionsCommand, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
COptionsCommand() | COptionsCommand |
CPropPageLite(UINT uIDD, TCHAR *ptszTitle=NULL) | CPropPageLite |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetParent() | CPropPageLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pCPropSheet | CPropPageLite |
m_psPage | CPropPageLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnApply() | COptionsCommand | [virtual]
OnCancel() | CPropPageLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | COptionsCommand | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnKillActive() | CPropPageLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CPropPageLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnReset() | CPropPageLite | [virtual]
OnSetActive() | CPropPageLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
PropPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropPageLite | [static]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetParent(CPropSheetLite *pCPropSheetLite) | CPropPageLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CPropPageLite() | CPropPageLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/childview.cpp Source File

  • Multimedia
  • Audio
  • multichan

childview.cpp

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 // ChildView.cpp : implementation of the CChildView class
00006 //
00007
00008 #include "stdafx.h"
00009 #include "multichan.h"
00010 #include "dlgdest.h"
00011 #include "ChildView.h"
00012
00013 #ifdef _DEBUG
00014 #define new DEBUG_NEW
00015 #undef THIS_FILE
00016 static char THIS_FILE[] = __FILE__;
00017 #endif
00018
00019 CChildView*                 g_pChildView    = 0;
00020 CDlgDest*                   g_pdlgDest      = 0;
00021 CList<CDlgSrc*,CDlgSrc*>    g_listSources;
00022 HWAVEOUT                    g_hwo           = 0;
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CChildView
00026
00027 CChildView::CChildView()
00028   : m_cChannels(0)
00029 {
00030     m_sizeInitPos.cx = 100;
00031     m_sizeInitPos.cy = 40;
00032
00033     g_pChildView = this;
00034 }
00035
00036 CChildView::~CChildView()
00037 {}
00038
00039
00040 BEGIN_MESSAGE_MAP(CChildView,CWnd )
00041   //{{AFX_MSG_MAP(CChildView)
00042   ON_WM_PAINT()
00043   ON_COMMAND(IDM_MIXER_MERGE, OnMixerMerge)
00044   ON_UPDATE_COMMAND_UI(IDM_MIXER_MERGE, OnUpdateMixerMerge)
00045   ON_COMMAND(IDM_MIXER_PLAY, OnMixerPlay)
00046   ON_UPDATE_COMMAND_UI(IDM_MIXER_PLAY, OnUpdateMixerPlay)
00047     ON_COMMAND( IDM_MIXER_STOP, OnMixerStop )
00048     ON_UPDATE_COMMAND_UI( IDM_MIXER_STOP, OnUpdateMixerStop )
00049   ON_COMMAND(ID_FILE_SAVE, OnFileSave)
00050   ON_UPDATE_COMMAND_UI(ID_FILE_SAVE, OnUpdateFileSave)
00051   ON_EN_SETFOCUS(IDC_EDIT_VALIDBITS, OnSetfocusEditValidbits)
00052   ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
00053   //}}AFX_MSG_MAP
00054 END_MESSAGE_MAP()
00055
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // CChildView message handlers
00059
00060 // ----------------------------------------------------------------------------------------
00061 BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
00062 {
00063   if (!CWnd::PreCreateWindow(cs))
00064     return FALSE;
00065
00066   cs.dwExStyle |= WS_EX_CLIENTEDGE;
00067   cs.style &= ~WS_BORDER;
00068   cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
00069     ::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_APPWORKSPACE+1), NULL);
00070
00071   return TRUE;
00072 }
00073
00074 // ----------------------------------------------------------------------------------------
00075 void CChildView::OnPaint()
00076 {
00077   CPaintDC dc(this); // device context for painting
00078 }
00079
00080 // ----------------------------------------------------------------------------------
00081 // dlgproc
00082 // ----------------------------------------------------------------------------------
00083 BOOL
00084 dlgproc
00085 (
00086     HWND hwndDlg,  // handle to dialog box
00087     UINT uMsg,     // message
00088     WPARAM wParam, // first message parameter
00089     LPARAM lParam  // second message parameter
00090 )
00091 {
00092     return 0;
00093 }
00094
00095 // ----------------------------------------------------------------------------------------
00096 void CChildView::OnFileOpen()
00097 {
00098     DWORD           dwThreadID  = 0;
00099
00100     //
00101     // std file open dialog
00102     //
00103     CFileDialog dlg(    TRUE,
00104                         "*.wav",
00105                         NULL,
00106                         OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,
00107                         "Wave Files (*.wav)|*.wav|All Files (*.*)|*.*||"
00108                    );
00109     if(IDOK != dlg.DoModal())
00110     {
00111         return;
00112     }
00113
00114     //
00115     // parse the wave file
00116     //
00117     LPWAVEFORMATEX      pwfx  = 0;
00118     ULONG         cbData  = 0;
00119     HANDLE          hFile = INVALID_HANDLE_VALUE;
00120
00121     ZeroMemory(&pwfx, sizeof(WAVEFORMATEX));
00122
00123   hFile = WaveOpenFile(dlg.GetPathName(), &pwfx, &cbData);
00124
00125   ASSERT( 0 != pwfx );
00126
00127     if(IsValidHandle(hFile) && pwfx && cbData)
00128     {
00129
00130         ULONG   cbRead;
00131         PVOID   pvData = LocalAlloc(LPTR, cbData);
00132     if( 0 == pvData )
00133     {
00134       MessageBox( "Insufficient memory to complete the task.", "MultiChan : Error", MB_OK | MB_ICONSTOP );
00135       return;
00136     }
00137
00138         //
00139         // read the data into a buffer
00140         //
00141         if
00142         (
00143             pvData &&
00144             ReadFile
00145             (
00146                 hFile,
00147                 pvData,
00148                 cbData,
00149                 &cbRead,
00150                 NULL
00151             )
00152         )
00153         {
00154             m_cChannels = ( int )g_listSources.GetCount();
00155
00156             //
00157             // create a src dialog for each channel in the wave file
00158             //
00159             for(int c = 0; c < pwfx->nChannels; c++)
00160             {
00161                 char    szTitle[MAX_PATH];
00162                 DWORD   dwChanMsk = 0;
00163
00164                 CDlgSrc* pdlgSrcNew = new CDlgSrc(this);
00165                 g_listSources.AddTail(pdlgSrcNew);
00166
00167                 //
00168                 // find an unused speaker mask
00169                 //
00170
00171                 //
00172                 //  currently only 18 speaker positions are defined
00173                 //  any channel above 18 will be assigned a non specified speaker
00174                 //  it is the sole responsibility of the driver to deal with
00175                 //  unspecified speaker masks
00176                 //
00177                 if(g_pdlgDest)
00178                 {
00179                     for
00180           (
00181             dwChanMsk = SPEAKER_FRONT_LEFT;
00182                         dwChanMsk & g_pdlgDest->m_wfExt.dwChannelMask;
00183                         dwChanMsk <<= 1
00184           )
00185                             ;
00186
00187                     if( SPEAKER_NOT_SPECIFIED != dwChanMsk )
00188                         g_pdlgDest->m_wfExt.dwChannelMask |= dwChanMsk;
00189
00190                     //
00191                     //  g_pdlgDest->m_wfExt.dwChannelMask &= 0x7fffffff;
00192                     //
00193                 }
00194                 else
00195                 {
00196                     if( c >= SPEAKERS_USED )
00197                     {
00198                         dwChanMsk = SPEAKER_NOT_SPECIFIED;
00199                     }
00200                     else
00201                     {
00202                         dwChanMsk = cdrSpeakers[c].dwConstant;
00203                     }
00204                 }
00205
00206                 //
00207                 // create the dialog
00208                 //
00209                 _snprintf(szTitle, MAX_PATH, "\"%s\" channel %d of %d", dlg.GetFileTitle(), c, pwfx->nChannels);
00210                 pdlgSrcNew->Create(szTitle, m_sizeInitPos, dwChanMsk);
00211
00212         //
00213                 // pull the c-th channel of data out of this wave file
00214         //  also treat return codes
00215         //
00216                 if( !pdlgSrcNew->AquireData(pwfx, pvData, cbData, c) )
00217         {
00218           MessageBox( "Only max 2 channel PCM formats are accepted as input.", "MultiChan : Error", MB_OK | MB_ICONSTOP );
00219           break;
00220         }
00221
00222                 //
00223                 // the next dialog created should be cascaded
00224                 //
00225                 m_sizeInitPos.cx += 32;
00226                 m_sizeInitPos.cy += 32;
00227             }
00228
00229             //
00230             // make sure the src dialogs are consistent
00231             //
00232             UpdateDialogs();
00233         }
00234
00235         SafeLocalFree(pvData);
00236     }
00237
00238     SafeLocalFree(pwfx);
00239     SafeCloseHandle(hFile);
00240 }
00241
00242 // ----------------------------------------------------------------------------------------
00243 void CChildView::OnFileSave()
00244 {
00245     // std file open dialog
00246     CFileDialog dlg(FALSE, "*.wav", NULL, OFN_PATHMUSTEXIST, "Wave Files (*.wav)|*.wav|All Files (*.*)|*.*||");
00247
00248     if(IDOK == dlg.DoModal())
00249     {
00250         WaveSaveFile(dlg.GetFileName(), (WAVEFORMATEX*)&g_pdlgDest->m_wfExt, g_pdlgDest->m_pbData, g_pdlgDest->m_cbData);
00251     }
00252 }
00253
00254 // ----------------------------------------------------------------------------------------
00255 void CChildView::OnUpdateFileSave(CCmdUI* pCmdUI)
00256 {
00257   pCmdUI->Enable(g_pdlgDest && g_pdlgDest->m_fPlayable);
00258 }
00259
00260 // ----------------------------------------------------------------------------------------
00261 BOOL CChildView::UpdateDialogs(void)
00262 {
00263     //
00264     // set channel numbers for each SRC
00265     //
00266     ULONG       nChannel = 0;
00267     DWORD       dwBit;
00268     DWORD       dwChanMsk = 0;
00269     POSITION    pos;
00270     CDlgSrc*    pdlgSrc;
00271
00272     // make a bitmask
00273     pos = g_listSources.GetHeadPosition();
00274     while(pos)
00275     {
00276         pdlgSrc = g_listSources.GetNext(pos);
00277
00278         // bail if this seat is taken
00279         if( dwChanMsk & pdlgSrc->m_dwChannelMask & 0x7fffffff)
00280             return FALSE;
00281
00282         dwChanMsk |= pdlgSrc->m_dwChannelMask;
00283     }
00284
00285     // sort
00286     for(dwBit = SPEAKER_FRONT_LEFT; dwBit <= 0x80000000; dwBit <<= 1) //KSAUDIO_SPEAKER_TOP_REAR_RIGHT
00287     {
00288         pos = g_listSources.GetHeadPosition();
00289         while(pos)
00290         {
00291             pdlgSrc = g_listSources.GetNext(pos);
00292             if(pdlgSrc->m_dwChannelMask == dwBit)
00293                 pdlgSrc->SetChannelNum(nChannel++);
00294         }
00295
00296         // shift this again, and you get 0 => hangsville
00297         if(dwBit == 0x80000000)
00298             break;
00299     }
00300
00301     // update the dest
00302     g_pdlgDest->Update();
00303
00304     return TRUE;
00305 }
00306
00307 // ----------------------------------------------------------------------------------------
00308 void CChildView::OnMixerMerge()
00309 {
00310   g_pdlgDest->OnRemix();
00311 }
00312
00313 // ----------------------------------------------------------------------------------------
00314 void CChildView::OnUpdateMixerMerge(CCmdUI* pCmdUI)
00315 {
00316   pCmdUI->Enable( (0 != g_pdlgDest) && (0 != g_listSources.GetHeadPosition()) );
00317 }
00318
00319 // ----------------------------------------------------------------------------------------
00320 void CChildView::OnMixerPlay()
00321 {
00322     g_pdlgDest->OnPlay();
00323 }
00324
00325 // ----------------------------------------------------------------------------------------
00326 void CChildView::OnUpdateMixerPlay(CCmdUI* pCmdUI)
00327 {
00328   pCmdUI->Enable(g_pdlgDest && g_pdlgDest->m_fPlayable);
00329 }
00330
00331 // ----------------------------------------------------------------------------------------
00332 void CChildView::OnMixerStop()
00333 {
00334     ASSERT( 0 );
00335 }
00336
00337 // ----------------------------------------------------------------------------------------
00338 void CChildView::OnUpdateMixerStop( CCmdUI* pCmdUI )
00339 {}
00340
00341 // ----------------------------------------------------------------------------------------
00342 void CChildView::OnSetfocusEditValidbits()
00343 {
00344   // TODO: Add your control notification handler code here
00345   ASSERT(0);
00346 }
00347
00348 // ----------------------------------------------------------------------------------------
00349 LRESULT CChildView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
00350 {
00351     switch(message)
00352     {
00353         case WM_COMMAND:
00354             {
00355                 if(wParam == IDC_EDIT_VALIDBITS)
00356                 {
00357                     char sz[128];
00358                     _snprintf(sz, 128, "WM_COMMAND\n");
00359                     OutputDebugString(sz);
00360                 }
00361                 break;
00362             }
00363
00364         case WM_CTLCOLOR:
00365             {
00366                 if ( HIWORD(lParam) == IDC_EDIT_VALIDBITS)
00367                 {
00368                     SetBkColor((HDC)wParam, RGB(128,128,128));
00369                     SetTextColor((HDC)wParam, RGB(255, 255, 255) );
00370                     return (LRESULT)GetStockObject(LTGRAY_BRUSH);
00371                 }
00372                 break;
00373             }
00374     }
00375
00376   return CWnd ::WindowProc(message, wParam, lParam);
00377 }
00378
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/resource.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Help.rc
00004 //
00005 #define IDB_APPIMG_32                   101
00006 #define IDB_APPIMG_16                   104
00007 #define IDI_APP_ICON                    105
00008 #define IDB_NODEIMAGES_16               106
00009 #define IDB_NODEIMAGES_32               107
00010 #define IDD_BASE_DIALOG                 108
00011 #define IDD_ADDDEVICE_DLG               109
00012 #define IDD_ADDVFILE_DLG                110
00013 #define IDD_VFILE_PPAGE0                111
00014 #define IDC_ARCHIVE_ATTR                1000
00015 #define IDC_HIDDEN_ATTR                 1001
00016 #define IDC_LOCKED_ATTR                 1002
00017 #define IDC_READONLY_ATTR               1003
00018 #define IDC_DEVNAME_EDIT                1004
00019 #define IDC_BACKUP_FLAG                 1005
00020
00021 // Next default values for new objects
00022 //
00023 #ifdef APSTUDIO_INVOKED
00024 #ifndef APSTUDIO_READONLY_SYMBOLS
00025 #define _APS_NEXT_RESOURCE_VALUE        112
00026 #define _APS_NEXT_COMMAND_VALUE         40001
00027 #define _APS_NEXT_CONTROL_VALUE         1010
00028 #define _APS_NEXT_SYMED_VALUE           101
00029 #endif
00030 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/StreamWriteEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

StreamWriteEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: StreamWriteEnum
00019
00020 public class StreamWriteEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adWriteChar = 0;
00023   public static final short adWriteLine = 1;
00024   public static final short stWriteChar = 0;
00025   public static final short stWriteLine = 1;
00026 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/utils.h Source File

  • NetDS
  • RRas
  • ip

utils.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\utils.h
00008
00009 Abstract:
00010
00011     The file contains miscellaneous utilities.
00012
00013 --*/
00014
00015 #ifndef _UTILS_H_
00016 #define _UTILS_H_
00017
00018
00019 // Worker Function Processing
00020
00021 // functions
00022
00023 DWORD
00024 QueueSampleWorker(
00025     IN  WORKERFUNCTION  pfnFunction,
00026     IN  PVOID           pvContext
00027     );
00028
00029 BOOL
00030 EnterSampleAPI(
00031     );
00032
00033 BOOL
00034 EnterSampleWorker(
00035     );
00036
00037 VOID
00038 LeaveSampleWorker(
00039     );
00040
00041 #endif // _UTILS_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreClien/FreClien.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • FreClien

FreClien.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FRECLIEN.H
00003
00004   Summary:   Include file for the FRECLIEN code sample application.
00005              In addition to class definitions, this FRECLIEN.H file
00006              contains definitions of the application's menu, string,
00007              and other resource IDs.
00008
00009              For a comprehensive tutorial code tour of FRECLIEN's contents
00010              and offerings see the tutorial FRECLIEN.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the FRECLIEN source code.
00013
00014   Classes:   CMainWindow
00015
00016   Functions: WinMain
00017
00018   Origin:    4-6-96: atrent - Editor-inheritance from the DLLCLIEN source.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 #if !defined(FRECLIEN_H)
00036 #define FRECLIEN_H
00037
00038 #ifdef __cplusplus
00039
00040 extern CMsgLog* g_pMsgLog;
00041
00042 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00043   Class:    CMainWindow
00044
00045   Summary:  Class to encapsulate the application's main window, menu, and
00046             message dispatching behavior.
00047
00048   Methods:  CMainWindow
00049               Constructor.
00050             InitInstance
00051               Creates a new instance of the main window.
00052 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00053 class CMainWindow: public CVirWindow
00054 {
00055 public:
00056   CMainWindow();
00057   ~CMainWindow();
00058   BOOL InitInstance(HINSTANCE, int);
00059
00060   TCHAR m_szFileName[MAX_PATH];
00061   CMsgBox*  m_pMsgBox;
00062   CGuiBall* m_pGuiBall;
00063
00064 protected:
00065   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00066
00067 private:
00068   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00069
00070   WORD m_wWidth;
00071   WORD m_wHeight;
00072   TCHAR m_szHelpFile[MAX_PATH];
00073   TCHAR m_szFileTitle[MAX_PATH];
00074   TEXTMETRIC m_tm;
00075   OPENFILENAME m_ofnFile;
00076 };
00077
00078
00079 #endif // __cplusplus
00080
00081 // Window Class String Macros.
00082 #define MAIN_WINDOW_TITLE_STR       "FRECLIEN: Tutorial Code Sample"
00083 #define MAIN_WINDOW_CLASS_NAME_STR  "FRECLIENWindow"
00084 #define MAIN_WINDOW_CLASS_MENU_STR  "FRECLIENMenu"
00085
00086 // File Name String Macros.
00087 #define SERVER_TUTFILE_STR          "freserve.htm"
00088
00089 // Error strings.
00090 #define NOTHREAD_ERROR_STR "Can't Create Thread"
00091 #define NOCOMOBJ_ERROR_STR "Can't Create COM Object"
00092
00093 // OpenFile-related String Macros.
00094 #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
00095 #define OFN_DEFAULTTITLE_STR "Open File"
00096
00097 // File Menu Command Identifiers.
00098 #define IDM_FILE_EXIT               1000
00099
00100 // Help Menu Command Identifiers.
00101 #define IDM_HELP_CONTENTS           1900
00102 #define IDM_HELP_TUTORIAL           1901
00103 #define IDM_HELP_TUTSERVER          1902
00104 #define IDM_HELP_READSOURCE         1904
00105 #define IDM_HELP_ABOUT              1905
00106 #define IDM_HELP_ABOUTSERVER        1906
00107
00108 // Error-related String Identifiers.
00109 #define IDS_COMINITFAILED           2000
00110 #define IDS_APPINITFAILED           2001
00111 #define IDS_OUTOFMEMORY             2002
00112 #define IDS_NOUNICODE               2003
00113 #define IDS_NODCOM                  2004
00114 #define IDS_NOSERVER                2005
00115
00116 #define IDS_ASSERT_FAIL             2200
00117
00118 // Notice-related String Identifiers.
00119 #define IDS_NOTIMPLEMENTED          2301
00120
00121 #endif
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/cdbfile.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

cdbfile.h

Go to the documentation of this file.
00001 // File: CBDFile.h
00002 //
00003 //  This file contains the information for the CDBFile class.
00004 //
00005 //  CDBFile does the following:
00006 //
00007 //    - Opens the text file which will be read/written
00008 //    - Gathers information from the .INI information file
00009 //    - Contains the CRows array which contains all of the row
00010 //        information
00011 //      - Does all of the reading and writing to the file
00012 //    - Contains all of the column information
00013 //
00014 #ifndef __CDBFile_H_
00015 #define __CDBFile_H_
00016
00017 #include "CRow.h"
00018 #include <comdef.h>
00019
00020 //#define MAX_SUPPORTED_RECORDS 10000
00021 #define MAX_RECORD_SIZE 10000
00022
00023 #define LAST_ROW_FETCHED 1
00024 #define ERROR_IN_ROW_DATA -1
00025 #define FETCH_SUCCESS 0
00026 #define DBFILE_FLUSH_ERROR 100
00027 #define MAX_TABLE_NAME_SIZE 20
00028
00029 #define EXPAND_FILE true
00030 #define CONTRACT_FILE false
00031
00032 #ifdef _DEBUG
00033   #define OUT_LINE_FILE()  { TCHAR szOut[500]; wsprintf(szOut, "Error: %s, Line %d\n", __FILE__, __LINE__); \
00034               ATLTRACE(szOut); }
00035 #else
00036   #define OUT_LINE_FILE()
00037 #endif
00038
00039
00040 class CDBFile
00041 {
00042 public:
00043
00044
00045 //  Attributes
00046
00047   HANDLE m_hFile;   // handle of the data file
00048   HANDLE m_hMapFile;  // handle of the file mapping object
00049   LPVOID m_pFileMap;  // pointer to the beginning of the mapped file
00050   char * m_pbEOF;   // pointer to the last character in the file
00051   char * m_pbCurrentPos; // used to track the current location in the file
00052
00053   CSimpleArray<CRow *> m_Rows;
00054   //std::vector<CRow> m_Rows;
00055
00056   CDBFile():m_bClosed(true),m_prgColInfo(NULL)
00057   {
00058
00059   }
00060
00061   ~CDBFile();
00062 //  Methods
00063   bool Open(LPCTSTR pszFileName, bool bOpenMode= false);
00064   bool Close();
00065   bool FillRowArray();
00066   int FetchRow(CRow** pRow);
00067   int DeleteRowImmediate(CRow * pRow);
00068   HRESULT UpdateRowImmediate(CRow * pRow, ATLCOLUMNINFO * pColInfo, ULONG ulCols);
00069   HRESULT InsertRowImmediate(CRow * pRow, ATLCOLUMNINFO * pColInfo, ULONG ulCols,bool bData);
00070   int SaveAndReOpenFile();
00071   int ExpandFileAndAdjustRowObjects(ULONG ulBytesNeeded, bool bExpOrCon = EXPAND_FILE);
00072   BOOL AddRow(CRow * pRow, ATLCOLUMNINFO * prgColInfo, ULONG ulCols);
00073
00074   void AllocateProxyBuffers(bool bUseBookmarks);
00075
00076 //schema information
00077   bool GetFileSchemaInfo(LPCTSTR pszFileName);
00078   ATLCOLUMNINFO * GetSchemaInfo(ULONG * pNumCols);
00079   ATLCOLUMNINFO * m_prgColInfo;
00080   int m_cCols;
00081   TCHAR m_szTblNm[MAX_TABLE_NAME_SIZE];
00082   bool m_bClosed;
00083 };
00084
00085 #endif // __CDBFile_H_
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/LineSeparatorEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

LineSeparatorEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: LineSeparatorEnum
00019
00020 public class LineSeparatorEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adLF = 10;
00023   public static final short adCR = 13;
00024   public static final short adCRLF = -1;
00025 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/Dlg.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

Dlg.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       DLG.CPP
00004 //  Content:    Dialog Box Procedures
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 #define NM_NT_DISPLAY_DRIVER_KEY  _T("System\\CurrentControlSet\\Services\\mnmdd")
00018 #define REGVAL_NM_NT_DISPLAY_DRIVER_ENABLED _T("Start")
00019 #define NT_DRIVER_START_DISABLED  0x4
00020 #define REGVAL_INSTALL_DIR          TEXT("InstallationDirectory")
00021
00022
00023 DWSTR _rgCallType[] = {
00024   {NM_CALL_DEFAULT, TEXT("Default")},
00025   {NM_CALL_T120,    TEXT("T120")},
00026   {NM_CALL_H323,    TEXT("H323")},
00027 };
00028
00029 DWSTR _rgAddrType[] = {
00030   {NM_ADDR_UNKNOWN,      TEXT("Unknown")},
00031   {NM_ADDR_IP,           TEXT("IP")},
00032   {NM_ADDR_MACHINENAME,  TEXT("Machine name")},
00033   {NM_ADDR_PSTN,         TEXT("PSTN")},
00034   {NM_ADDR_ULS,          TEXT("ULS")},
00035   {NM_ADDR_H323_GATEWAY, TEXT("H323 Gateway")},
00036   {6,            TEXT("callto")},
00037 };
00038
00039 VOID InitLBox(HWND hwndCombo, DWSTR *pdwstr, UINT cElt, DWORD dwDefault)
00040 {
00041   DWORD dwIndex = 0;
00042   DWORD iSel  = 0;
00043
00044   ASSERT(NULL != hwndCombo);
00045   if  (NULL == hwndCombo)
00046   {
00047     ERROR_MSG(TEXT("InitLBox: NULL == hwndCombo"));
00048     return;
00049   }
00050
00051   if  (NULL == pdwstr)
00052   {
00053     ERROR_MSG(TEXT("InitLBox: NULL == pdwstr"));
00054     return;
00055   }
00056
00057   for ( ; cElt > 0; cElt--, pdwstr++)
00058   {
00059     dwIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) pdwstr->psz);
00060     SendMessage(hwndCombo, CB_SETITEMDATA, dwIndex, (LPARAM) pdwstr->dw);
00061     if (pdwstr->dw == dwDefault)
00062     {
00063       iSel = dwIndex;
00064     }
00065   }
00066
00067   SendMessage(hwndCombo, CB_SETCURSEL, dwDefault, 0);
00068 }
00069
00070
00071 //****************************************************************************
00072 //
00073 // DWORD GetLBoxDw(HWND hwndCombo)
00074 //
00075 //****************************************************************************
00076
00077 DWORD GetLBoxDw(HWND hwndCombo)
00078 {
00079   if  (NULL == hwndCombo)
00080   {
00081     ERROR_MSG(TEXT("GetLBoxDw: NULL == hwndCombo"));
00082     return 0;
00083   }
00084
00085   int iSel = SendMessage(hwndCombo, CB_GETCURSEL, 0, 0);
00086   if (CB_ERR == iSel)
00087     return 0;
00088
00089   return SendMessage(hwndCombo, CB_GETITEMDATA, (WPARAM) iSel, 0);
00090 }
00091
00092
00093 //****************************************************************************
00094 //
00095 // VOID InitUserLBox(HWND hdlg, BOOL fEveryone)
00096 //
00097 //****************************************************************************
00098
00099 VOID InitUserLBox(HWND hdlg, BOOL fEveryone)
00100 {
00101   HWND hwndCombo = GetDlgItem(hdlg, IDL_USERS);
00102
00103   ASSERT(NULL != hwndCombo);
00104   if  (NULL == hwndCombo)
00105   {
00106     ERROR_MSG(TEXT("InitUserLBox: NULL == hwndCombo"));
00107     return;
00108   }
00109
00110   InitializeUserList(hwndCombo, fEveryone);
00111 }
00112
00113
00114 //****************************************************************************
00115 //
00116 // VOID InitializeUserList(HWND hwndCombo, BOOL fEveryone)
00117 //
00118 //****************************************************************************
00119
00120 VOID InitializeUserList(HWND hwndCombo, BOOL fEveryone)
00121 {
00122   if (NULL == g_pListUser)
00123     return;
00124
00125   if  (NULL == hwndCombo)
00126   {
00127     ERROR_MSG(TEXT("InitializeUserList: hwndCombo == NULL"));
00128     return;
00129   }
00130
00131   POSITION pos = g_pListUser->GetHeadPosition();
00132   while (NULL != pos)
00133   {
00134     POSITION posSav = pos;
00135     PUSER pUser = (PUSER) g_pListUser->GetNext(pos);
00136     AddUserToUList(pUser, hwndCombo, fEveryone);
00137   }
00138
00139   SendMessage(hwndCombo, CB_SETCURSEL, 0, 0);
00140 }
00141
00142
00143 //****************************************************************************
00144 //
00145 // VOID AddUserToUList(PUSER pUser, HWND hwndCombo, BOOL fEveryone)
00146 //
00147 //****************************************************************************
00148
00149 VOID AddUserToUList(PUSER pUser, HWND hwndCombo, BOOL fEveryone)
00150 {
00151   DWORD dwIndex = 0;
00152
00153   ASSERT(NULL != pUser);
00154   if  (NULL == pUser)
00155   {
00156     ERROR_MSG(TEXT("AddUserToUList: NULL == pUser"));
00157     return;
00158   }
00159
00160   if  (NULL == hwndCombo)
00161   {
00162     ERROR_MSG(TEXT("AddUserToUList: NULL == hwndCombo"));
00163     return;
00164   }
00165
00166   if (fEveryone && (S_OK == pUser->pMember->IsSelf()))
00167   {
00168     dwIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) TEXT("<all>"));
00169   }
00170   else
00171   {
00172     dwIndex = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) pUser->pszName);
00173   }
00174   SendMessage(hwndCombo, CB_SETITEMDATA, dwIndex, (LPARAM) pUser);
00175 }
00176
00177
00178 //****************************************************************************
00179 //
00180 // VOID RemoveUserFromUList(PUSER pUser, HWND hwndCombo)
00181 //
00182 //****************************************************************************
00183
00184 VOID RemoveUserFromUList(PUSER pUser, HWND hwndCombo)
00185 {
00186   ASSERT(NULL != pUser);
00187   if  (NULL == pUser)
00188   {
00189     ERROR_MSG(TEXT("RemoveUserFromList: NULL == pUser"));
00190     return;
00191   }
00192
00193   if (!IsWindow(hwndCombo))
00194   {
00195     ERROR_MSG(TEXT("RemoveUserFromUList: invalid hwnd combo?"));
00196     return;
00197   }
00198
00199   for (DWORD dwIndex = 0; ; dwIndex++)
00200   {
00201     DWORD dw = SendMessage(hwndCombo, CB_GETITEMDATA, dwIndex, 0);
00202     if (CB_ERR == dw)
00203     {
00204       break;
00205     }
00206     if (pUser == (PUSER) dw)
00207     {
00208       SendMessage(hwndCombo, CB_DELETESTRING, (WPARAM)dwIndex, 0);
00209       return;
00210     }
00211   }
00212
00213   ERROR_MSG(TEXT("RemoveUserFromUList: Unable to delete [%s]"), pUser->pszName);
00214 }
00215
00216
00217 //****************************************************************************
00218 //
00219 // VOID DrawUserItem(LPDRAWITEMSTRUCT lpdis)
00220 //
00221 //****************************************************************************
00222
00223 VOID DrawUserItem(LPDRAWITEMSTRUCT lpdis)
00224 {
00225   if  (NULL == lpdis)
00226   {
00227     ERROR_MSG(TEXT("DrawUserItem: NULL == lpdis"));
00228     return;
00229   }
00230
00231   if (lpdis->itemID == -1)
00232     return;
00233
00234   PUSER   pUser = (PUSER) lpdis->itemData;
00235   COLORREF  cvText  = RGB(0, 0, 0);
00236   COLORREF  cvBack  = RGB(0, 0, 0);
00237
00238   cvText = SetTextColor(lpdis->hDC, GetSysColor((lpdis->itemState & ODS_SELECTED)
00239     ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT));
00240
00241   cvBack = SetBkColor(lpdis->hDC, GetSysColor((lpdis->itemState & ODS_SELECTED)
00242     ? COLOR_HIGHLIGHT : COLOR_WINDOW));
00243
00244   if (NULL == pUser->pszName)
00245   {
00246     ExtTextOut(lpdis->hDC, lpdis->rcItem.left+2, lpdis->rcItem.top+2,
00247       ETO_CLIPPED | ETO_OPAQUE, &lpdis->rcItem,
00248       TEXT("? user\0"), 6, NULL);
00249   }
00250   else
00251   {
00252     ExtTextOut(lpdis->hDC, lpdis->rcItem.left+2, lpdis->rcItem.top+2,
00253       ETO_CLIPPED | ETO_OPAQUE, &lpdis->rcItem,
00254       pUser->pszName, lstrlen(pUser->pszName), NULL);
00255   }
00256
00257   SetTextColor(lpdis->hDC, cvText);
00258   SetBkColor(lpdis->hDC, cvBack);
00259
00260   if (lpdis->itemState & ODS_FOCUS)
00261   {
00262     DrawFocusRect(lpdis->hDC, &lpdis->rcItem);
00263   }
00264 }
00265
00266
00267 //****************************************************************************
00268 //
00269 // LRESULT CALLBACK ConferenceDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00270 //
00271 //****************************************************************************
00272
00273 LRESULT CALLBACK ConferenceDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00274 {
00275   switch (uMsg)
00276   {
00277   case WM_INITDIALOG:
00278     CenterWindow(hdlg, ghwndMain);
00279
00280     SetDlgItemText(hdlg, IDE_NAME, gPref.pszConferenceName);
00281     SetDlgItemText(hdlg, IDE_PASSWORD, gPref.pszPassword);
00282
00283     { // check channel types
00284       DWORD dwFlag = 0x01;
00285       for (int id = IDC_NMCH_FIRST; id <= IDC_NMCH_LAST; id++)
00286       {
00287         CheckDlgButton(hdlg, id, 0 != (gPref.dwNmch & dwFlag));
00288         dwFlag <<= 1;
00289       }
00290     }
00291
00292     return TRUE;
00293
00294   case WM_COMMAND:
00295     switch (GET_WM_COMMAND_ID(wParam, lParam))
00296     {
00297     case IDOK:
00298       GetDlgItemPsz(hdlg, IDE_NAME, &gPref.pszConferenceName);
00299       GetDlgItemPsz(hdlg, IDE_PASSWORD, &gPref.pszPassword);
00300
00301       { // check media types
00302         DWORD dwFlag = 0x01;
00303         gPref.dwNmch = 0;
00304         for (int id = IDC_NMCH_FIRST; id <= IDC_NMCH_LAST; id++)
00305         {
00306           if (IsDlgButtonChecked(hdlg, id))
00307             gPref.dwNmch |= dwFlag;
00308           dwFlag <<= 1;
00309         }
00310       }
00311
00312       EndDialog(hdlg, 0);
00313       return TRUE;
00314
00315     case IDCANCEL:
00316       EndDialog(hdlg, 1);
00317       return TRUE;
00318
00319     default:
00320       return TRUE;
00321     } /* switch (cmd) */
00322
00323   default:
00324     break;
00325   } /* switch (uMsg) */
00326
00327   return FALSE;
00328 }
00329
00330
00331 //****************************************************************************
00332 //
00333 // BOOL DlgNewConference(VOID)
00334 //
00335 //****************************************************************************
00336
00337 BOOL DlgNewConference(VOID)
00338 {
00339   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_CONFERENCE),
00340     ghwndMain, (DLGPROC)ConferenceDlgProc));
00341 }
00342
00343
00344 //****************************************************************************
00345 //
00346 // LRESULT CALLBACK SendFileDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00347 //
00348 //****************************************************************************
00349
00350 LRESULT CALLBACK SendFileDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00351 {
00352   switch (uMsg)
00353   {
00354   case WM_INITDIALOG:
00355   {
00356     HWND hwnd;
00357
00358     CenterWindow(hdlg, ghwndMain);
00359
00360     hwnd = GetDlgItem(hdlg, IDC_USERNAME);
00361
00362     InitUserLBox(hdlg, TRUE);
00363
00364     // Set the default filename
00365     SetDlgItemText(hdlg, IDE_FILENAME, gPref.pszFileName);
00366
00367     return TRUE;
00368   }
00369
00370   case WM_COMMAND:
00371     switch (GET_WM_COMMAND_ID(wParam, lParam))
00372     {
00373     case IDOK:
00374     {
00375       INmMember * pMember = NULL;
00376       int iSel = SendDlgItemMessage(hdlg, IDL_USERS, CB_GETCURSEL, 0, 0);
00377       if (CB_ERR != iSel)
00378       {
00379         PUSER pUser = (PUSER) SendDlgItemMessage(hdlg, IDL_USERS,
00380           CB_GETITEMDATA, (WPARAM) iSel, 0);
00381         if (NULL != pUser)
00382         {
00383           pMember = pUser->pMember;
00384           if (S_OK == pMember->IsSelf())
00385             pMember = NULL; // everyone
00386         }
00387       }
00388       GetDlgItemPsz(hdlg, IDE_FILENAME, &gPref.pszFileName);
00389
00390       SendFile(pMember);
00391       EndDialog(hdlg, 0);
00392       return TRUE;
00393     }
00394
00395     case IDCANCEL:
00396       EndDialog(hdlg, 1);
00397       return TRUE;
00398
00399     case IDB_BROWSE:
00400     {
00401       TCHAR szFileName[MAX_PATH + 1];
00402       ZeroMemory(szFileName, sizeof(TCHAR) * (MAX_PATH + 1));
00403
00404       // Get the file name
00405       if (!FGetFileName(szFileName))    //  FGetFileName assumes buffer size is MAX_PATH
00406         return FALSE;
00407
00408       SetDlgItemText(hdlg, IDE_FILENAME, szFileName);
00409       return TRUE;
00410     }
00411
00412     default:
00413       return TRUE;
00414     } /* switch (cmd) */
00415
00416   default:
00417     break;
00418   } /* switch (uMsg) */
00419
00420   return FALSE;
00421 }
00422
00423 //****************************************************************************
00424 //
00425 // BOOL DlgSendFile(VOID)
00426 //
00427 //****************************************************************************
00428
00429 BOOL DlgSendFile(VOID)
00430 {
00431   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_SENDFILE),
00432     ghwndMain, (DLGPROC)SendFileDlgProc));
00433 }
00434
00435
00436 //****************************************************************************
00437 //
00438 // LRESULT CALLBACK CallConfDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00439 //
00440 //****************************************************************************
00441
00442 LRESULT CALLBACK CallConfDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00443 {
00444   switch (uMsg)
00445   {
00446   case WM_INITDIALOG:
00447     CenterWindow(hdlg, ghwndMain);
00448
00449     SetDlgItemText(hdlg, IDE_ADDR,       gPref.pszAddr);
00450     SetDlgItemText(hdlg, IDE_CONFERENCE, gPref.pszConferenceName);
00451     SetDlgItemText(hdlg, IDE_PASSWORD,   gPref.pszPassword);
00452
00453     InitLBox(GetDlgItem(hdlg, IDL_ADDR_TYPE),
00454       _rgAddrType, ARRAY_ELEMENTS(_rgAddrType), gPref.nmAddrType);
00455     InitLBox(GetDlgItem(hdlg, IDL_CALL_TYPE),
00456       _rgCallType, ARRAY_ELEMENTS(_rgCallType), gPref.nmCallType);
00457     return TRUE;
00458
00459   case WM_COMMAND:
00460     switch (GET_WM_COMMAND_ID(wParam, lParam))
00461     {
00462     case IDOK:
00463       GetDlgItemPsz(hdlg, IDE_ADDR,       &gPref.pszAddr);
00464       GetDlgItemPsz(hdlg, IDE_CONFERENCE, &gPref.pszConferenceName);
00465       GetDlgItemPsz(hdlg, IDE_PASSWORD,   &gPref.pszPassword);
00466
00467       gPref.nmAddrType = (NM_ADDR_TYPE) GetLBoxDw(GetDlgItem(hdlg, IDL_ADDR_TYPE));
00468       gPref.nmCallType = (NM_CALL_TYPE) GetLBoxDw(GetDlgItem(hdlg, IDL_CALL_TYPE));
00469
00470       EndDialog(hdlg, 0);
00471       return TRUE;
00472
00473     case IDCANCEL:
00474       EndDialog(hdlg, 1);
00475       return TRUE;
00476
00477     default:
00478       return TRUE;
00479     } /* switch (cmd) */
00480
00481   default:
00482     break;
00483   } /* switch (uMsg) */
00484
00485   return FALSE;
00486 }
00487
00488
00489 //****************************************************************************
00490 //
00491 // BOOL DlgCallConf(VOID)
00492 //
00493 //****************************************************************************
00494
00495 BOOL DlgCallConf(VOID)
00496 {
00497   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_CALL_CONF),
00498     ghwndMain, (DLGPROC)CallConfDlgProc));
00499 }
00500
00501
00502 //****************************************************************************
00503 //
00504 // LRESULT CALLBACK CallDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00505 //
00506 //****************************************************************************
00507
00508 LRESULT CALLBACK CallDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00509 {
00510   switch (uMsg)
00511   {
00512   case WM_INITDIALOG:
00513     CenterWindow(hdlg, ghwndMain);
00514
00515     SetDlgItemText(hdlg, IDE_ADDR, gPref.pszAddr);
00516     InitLBox(GetDlgItem(hdlg, IDL_ADDR_TYPE),
00517       _rgAddrType, ARRAY_ELEMENTS(_rgAddrType), gPref.nmAddrType);
00518     InitLBox(GetDlgItem(hdlg, IDL_CALL_TYPE),
00519       _rgCallType, ARRAY_ELEMENTS(_rgCallType), gPref.nmCallType);
00520     return TRUE;
00521
00522   case WM_COMMAND:
00523     switch (GET_WM_COMMAND_ID(wParam, lParam))
00524     {
00525     case IDOK:
00526       GetDlgItemPsz(hdlg, IDE_ADDR, &gPref.pszAddr);
00527
00528       gPref.nmAddrType = (NM_ADDR_TYPE) GetLBoxDw(GetDlgItem(hdlg, IDL_ADDR_TYPE));
00529       gPref.nmCallType = (NM_CALL_TYPE) GetLBoxDw(GetDlgItem(hdlg, IDL_CALL_TYPE));
00530
00531       EndDialog(hdlg, 0);
00532       return TRUE;
00533
00534     case IDCANCEL:
00535       EndDialog(hdlg, 1);
00536       return TRUE;
00537
00538     default:
00539       return TRUE;
00540     } /* switch (cmd) */
00541
00542   default:
00543     break;
00544   } /* switch (uMsg) */
00545
00546   return FALSE;
00547 }
00548
00549
00550 //****************************************************************************
00551 //
00552 // BOOL DlgNewCall(VOID)
00553 //
00554 //****************************************************************************
00555
00556 BOOL DlgNewCall(VOID)
00557 {
00558   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_CALL),
00559     ghwndMain, (DLGPROC)CallDlgProc));
00560 }
00561
00562
00563 //****************************************************************************
00564 //
00565 // LRESULT CALLBACK OptionsDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00566 //
00567 //****************************************************************************
00568
00569 LRESULT CALLBACK OptionsDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00570 {
00571   switch (uMsg)
00572   {
00573   case WM_INITDIALOG:
00574     CenterWindow(hdlg, ghwndMain);
00575
00576     CheckDlgButton(hdlg, IDC_MONITOR, gPref.fAutoMonitor);
00577
00578     CheckDlgButton(hdlg, IDC_HOST, gPref.fAutoHost);
00579     SetDlgItemText(hdlg, IDE_CONFERENCE_NAME, gPref.pszConferenceName);
00580
00581     CheckDlgButton(hdlg, IDC_CALL_USER, gPref.fAutoCall);
00582     SetDlgItemText(hdlg, IDE_USER_NAME, gPref.pszAddr);
00583
00584     CheckDlgButton(hdlg, IDC_AUTO_CHAT, gPref.fAutoChat);
00585
00586     CheckDlgButton(hdlg, IDC_MSG_TRACE,   gPref.fMsgTrace);
00587     CheckDlgButton(hdlg, IDC_MSG_OBJECTS, gPref.fMsgObjects);
00588     CheckDlgButton(hdlg, IDC_MSG_NOTIFY,  gPref.fMsgNotify);
00589     CheckDlgButton(hdlg, IDC_MSG_STATE,   gPref.fMsgState);
00590
00591     CheckRadioButton(hdlg, IDR_INIT_NORMAL, IDR_INIT_BACKGROUND,
00592       gPref.iInit + IDR_INIT_NORMAL);
00593     return TRUE;
00594
00595   case WM_COMMAND:
00596     switch (GET_WM_COMMAND_ID(wParam, lParam))
00597     {
00598     case IDOK:
00599       gPref.fAutoMonitor= IsDlgButtonChecked(hdlg, IDC_MONITOR);
00600
00601       gPref.fAutoHost   = IsDlgButtonChecked(hdlg, IDC_HOST);
00602       GetDlgItemPsz(hdlg, IDE_CONFERENCE_NAME, &gPref.pszConferenceName);
00603
00604       gPref.fAutoCall   = IsDlgButtonChecked(hdlg, IDC_CALL_USER);
00605       GetDlgItemPsz(hdlg, IDE_USER_NAME, &gPref.pszAddr);
00606
00607       gPref.fAutoChat   = IsDlgButtonChecked(hdlg, IDC_AUTO_CHAT);
00608
00609       gPref.fMsgTrace   = IsDlgButtonChecked(hdlg, IDC_MSG_TRACE);
00610       gPref.fMsgObjects = IsDlgButtonChecked(hdlg, IDC_MSG_OBJECTS);
00611       gPref.fMsgNotify  = IsDlgButtonChecked(hdlg, IDC_MSG_NOTIFY);
00612       gPref.fMsgState   = IsDlgButtonChecked(hdlg, IDC_MSG_STATE);
00613
00614       if (IsDlgButtonChecked(hdlg, IDR_INIT_NORMAL))
00615         gPref.iInit = NM_INIT_NORMAL;
00616       else if (IsDlgButtonChecked(hdlg, IDR_INIT_CONTROL))
00617         gPref.iInit = NM_INIT_CONTROL;
00618       else if (IsDlgButtonChecked(hdlg, IDR_INIT_NO_LAUNCH))
00619         gPref.iInit = NM_INIT_NO_LAUNCH;
00620       else if (IsDlgButtonChecked(hdlg, IDR_INIT_BACKGROUND))
00621         gPref.iInit = NM_INIT_BACKGROUND;
00622
00623
00624       EndDialog(hdlg, 0);
00625       return TRUE;
00626
00627     case IDCANCEL:
00628       EndDialog(hdlg, 1);
00629       return TRUE;
00630
00631     default:
00632       return TRUE;
00633     } /* switch (cmd) */
00634
00635   default:
00636     break;
00637   } /* switch (uMsg) */
00638
00639   return FALSE;
00640 }
00641
00642
00643 //****************************************************************************
00644 //
00645 // BOOL DlgOptions(VOID)
00646 //
00647 //****************************************************************************
00648
00649 BOOL DlgOptions(VOID)
00650 {
00651   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_OPTIONS),
00652     ghwndMain, (DLGPROC)OptionsDlgProc));
00653 }
00654
00655
00656 //****************************************************************************
00657 //
00658 // VOID UpdateAudioSettings(HWND hdlg)
00659 //
00660 //****************************************************************************
00661
00662 VOID UpdateAudioSettings(HWND hdlg)
00663 {
00664   int iSel = SendDlgItemMessage(hdlg, IDL_USERS, CB_GETCURSEL, 0, 0);
00665   if (CB_ERR == iSel)
00666     return;
00667
00668   PUSER pUser = (PUSER) SendDlgItemMessage(hdlg, IDL_USERS,
00669     CB_GETITEMDATA, (WPARAM) iSel, 0);
00670
00671   if  (NULL == pUser)
00672   {
00673     ERROR_MSG(TEXT("UpdateAudioSettings: NULL == pUser"));
00674     return;
00675   }
00676
00677   INmChannelAudio * pChannel = pUser->m_pChannelAudio;
00678   if (NULL != pChannel)
00679   {
00680     NM_AUDIO_STATE uState;
00681     if (SUCCEEDED(pChannel->GetState(&uState)))
00682     {
00683       TRACE_MSG(TEXT("Audio State is %d"), uState);
00684     }
00685
00686     DWORD dwLevel = 0;
00687     if (SUCCEEDED(pChannel->GetProperty(NM_AUDPROP_LEVEL, &dwLevel)))
00688     {
00689       SendDlgItemMessage (hdlg, IDC_LEVEL, TBM_SETPOS, TRUE,
00690                 dwLevel );
00691
00692       SetDlgItemInt(hdlg, IDE_LEVEL, dwLevel, FALSE);
00693     }
00694
00695     CheckDlgButton(hdlg, IDC_ACTIVE,
00696       (S_OK == pChannel->IsActive()) ? BST_CHECKED : BST_UNCHECKED);
00697
00698     DWORD fPause = FALSE;
00699     pChannel->GetProperty(NM_AUDPROP_PAUSE, &fPause);
00700     CheckDlgButton(hdlg, IDC_PAUSE, fPause ? BST_CHECKED : BST_UNCHECKED);
00701   }
00702 }
00703
00704
00705 //****************************************************************************
00706 //
00707 // LRESULT CALLBACK AudioDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00708 //
00709 //****************************************************************************
00710
00711 LRESULT CALLBACK AudioDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00712 {
00713   HRESULT hr  = NO_ERROR;
00714
00715   switch (uMsg)
00716   {
00717   case WM_INITDIALOG:
00718   {
00719     CenterWindow(hdlg, ghwndMain);
00720
00721     InitUserLBox(hdlg, FALSE);
00722
00723     SendDlgItemMessage (hdlg, IDC_LEVEL, TBM_SETRANGEMIN, FALSE,
00724       0 );
00725     SendDlgItemMessage (hdlg, IDC_LEVEL, TBM_SETRANGEMAX, FALSE,
00726       NM_MAX_AUDIO_LEVEL );
00727     SendDlgItemMessage (hdlg, IDC_LEVEL, TBM_SETTICFREQ,
00728       8096, 0 );
00729     SendDlgItemMessage (hdlg, IDC_LEVEL, TBM_SETPAGESIZE,
00730       0, 8096 );
00731     SendDlgItemMessage (hdlg, IDC_LEVEL, TBM_SETLINESIZE,
00732       0, 256 );
00733
00734     UpdateAudioSettings(hdlg);
00735     return TRUE;
00736   }
00737
00738   case WM_DRAWITEM:
00739     DrawUserItem((LPDRAWITEMSTRUCT) lParam);
00740     break;
00741
00742   case WM_COMMAND:
00743     switch (GET_WM_COMMAND_ID(wParam, lParam))
00744     {
00745     case IDOK:
00746     case IDCANCEL:
00747       EndDialog(hdlg, 1);
00748       return TRUE;
00749
00750     case IDB_UPDATE:
00751     {
00752       UpdateAudioSettings(hdlg);
00753       return TRUE;
00754     }
00755
00756     case IDC_ACTIVE:
00757     {
00758       int iSel = SendDlgItemMessage(hdlg, IDL_USERS, CB_GETCURSEL, 0, 0);
00759       if (CB_ERR != iSel)
00760       {
00761         PUSER pUser = (PUSER) SendDlgItemMessage(hdlg, IDL_USERS,
00762           CB_GETITEMDATA, (WPARAM) iSel, 0);
00763
00764         if  (NULL == pUser)
00765         {
00766           ERROR_MSG(TEXT("AudioDlgProc (IDC_ACTIVE): NULL == pUser"));
00767         }
00768         else
00769         {
00770           INmChannelAudio * pChannel = pUser->m_pChannelAudio;
00771           if (NULL != pChannel)
00772           {
00773             // Flip the active state
00774             BOOL fActive = (S_OK != pChannel->IsActive());
00775             hr = pChannel->SetActive(fActive);
00776             TRACE_MSG(TEXT("SetActive result=%s"), GetHrSz(hr));
00777           }
00778         }
00779       }
00780       return TRUE;
00781     }
00782
00783     case IDC_PAUSE:
00784     {
00785       int iSel = SendDlgItemMessage(hdlg, IDL_USERS, CB_GETCURSEL, 0, 0);
00786       if (CB_ERR != iSel)
00787       {
00788         PUSER pUser = (PUSER) SendDlgItemMessage(hdlg, IDL_USERS,
00789           CB_GETITEMDATA, (WPARAM) iSel, 0);
00790
00791         if  (NULL == pUser)
00792         {
00793           ERROR_MSG(TEXT("AudioDlgProc (IDC_PAUSE): NULL == pUser"));
00794         }
00795         else
00796         {
00797           INmChannelAudio * pChannel = pUser->m_pChannelAudio;
00798           if (NULL != pChannel)
00799           {
00800             // Flip the pause state
00801             DWORD fPause = IsDlgButtonChecked(hdlg, IDC_PAUSE);
00802             hr = pChannel->SetProperty(NM_AUDPROP_PAUSE, fPause);
00803             TRACE_MSG(TEXT("SetProperty result=%s"), GetHrSz(hr));
00804           }
00805         }
00806       }
00807       return TRUE;
00808     }
00809
00810     default:
00811       return TRUE;
00812     } /* switch (cmd) */
00813
00814   case WM_HSCROLL:
00815   {
00816     DWORD dwLevel = SendDlgItemMessage( hdlg, IDC_LEVEL,
00817           TBM_GETPOS, 0, 0 );
00818     SetDlgItemInt(hdlg, IDE_LEVEL, dwLevel, FALSE);
00819
00820     if (TB_ENDTRACK == LOWORD(wParam))
00821     {
00822       int iSel = SendDlgItemMessage(hdlg, IDL_USERS, CB_GETCURSEL, 0, 0);
00823       if (CB_ERR != iSel)
00824       {
00825         PUSER pUser = (PUSER) SendDlgItemMessage(hdlg, IDL_USERS,
00826           CB_GETITEMDATA, (WPARAM) iSel, 0);
00827
00828         if  (NULL == pUser)
00829         {
00830           ERROR_MSG(TEXT("AudioDlgProc (WM_HSCROLL): NULL == pUser"));
00831         }
00832         else
00833         {
00834           INmChannelAudio * pChannel = pUser->m_pChannelAudio;
00835           if (NULL != pChannel)
00836           {
00837             hr = pChannel->SetProperty(NM_AUDPROP_LEVEL, dwLevel);
00838             TRACE_MSG(TEXT("SetProperty result=%s"), GetHrSz(hr));
00839           }
00840         }
00841       }
00842     }
00843     return TRUE;
00844   }
00845
00846   default:
00847     break;
00848   } /* switch (uMsg) */
00849
00850   return FALSE;
00851 }
00852
00853
00854 //****************************************************************************
00855 //
00856 // BOOL DlgAudio(VOID)
00857 //
00858 //****************************************************************************
00859
00860 BOOL DlgAudio(VOID)
00861 {
00862   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_AUDIO),
00863     ghwndMain, (DLGPROC)AudioDlgProc));
00864 }
00865
00866
00867 //****************************************************************************
00868 //
00869 // Application sharing
00870 //
00871 //****************************************************************************
00872
00873 #define ILV_AS_HWND   0
00874 #define ILV_AS_STATUS 1
00875 #define ILV_AS_NAME   2
00876
00877 static COL _rgColShare[] = {
00878   {70,  TEXT("Hwnd")},
00879   {70,  TEXT("Status")},
00880   {120, TEXT("Name")},
00881 };
00882
00883
00884 //****************************************************************************
00885 //
00886 // VOID FreeShareList(HWND hwnd)
00887 //
00888 //****************************************************************************
00889
00890 VOID FreeShareList(HWND hwnd)
00891 {
00892   for (int iItem = 0; ; iItem++)
00893   {
00894     LV_ITEM lvi;
00895     ZeroMemory(&lvi, sizeof(LV_ITEM));
00896
00897     lvi.mask = LVIF_PARAM;
00898     lvi.iItem = iItem;
00899
00900     if (!ListView_GetItem(hwnd, &lvi))
00901       break;
00902
00903     INmSharableApp * pApp = (INmSharableApp *) lvi.lParam;
00904     ASSERT(NULL != pApp);
00905     if  (NULL == pApp)
00906     {
00907       ERROR_MSG(TEXT("FreeShareList: NULL == pApp"));
00908       break;
00909     }
00910
00911     pApp->Release();
00912     pApp = NULL;
00913   }
00914
00915   ListView_DeleteAllItems(hwnd);
00916 }
00917
00918
00919 //****************************************************************************
00920 //
00921 // VOID UpdateShareList(HWND hwnd)
00922 //
00923 //****************************************************************************
00924
00925 VOID UpdateShareList(HWND hwnd)
00926 {
00927   LV_ITEM         lvItem        ;
00928   HRESULT         hr    = NO_ERROR  ;
00929   ULONG         cFetched  = 0     ;
00930   IEnumNmSharableApp  * pEnum   = NULL    ;
00931   INmSharableApp    * pApp    = NULL    ;
00932   NM_SHAPP_STATE      uState        ;
00933   HWND          hwndApp = 0     ;
00934   int           iItem   = 0     ;
00935   BSTR          bstr    = NULL    ;
00936   LPTSTR          psz   = NULL    ;
00937   TCHAR         sz[MAX_PATH + 1]    ;
00938
00939   ZeroMemory(sz, (MAX_PATH + 1) * sizeof(TCHAR));
00940
00941   FreeShareList(hwnd);
00942
00943   if (NULL == g_pChannelAppShare)
00944     return;
00945
00946   ZeroMemory(&lvItem, sizeof(LV_ITEM));
00947   lvItem.mask = LVIF_PARAM | LVIF_TEXT;
00948
00949   hr = g_pChannelAppShare->EnumSharableApp(&pEnum);
00950   if (FAILED(hr))
00951   {
00952     ERROR_MSG(TEXT("UpdateShareList: EnumSharableApp returned 0x%08X"), hr);
00953       return;
00954   }
00955
00956   if  (NULL == pEnum)
00957   {
00958     ERROR_MSG(TEXT("UpdateShareList: EnumSharableApp returned a Null Ptr"));
00959     return;
00960   }
00961
00962   for ( ; ; )
00963   {
00964     hr = pEnum->Next(1, &pApp, &cFetched);
00965     if FAILED(hr)
00966       break;
00967
00968     if  (NULL == pApp)
00969     {
00970       ERROR_MSG(TEXT("UpdateShareList: NULL == pApp"));
00971       break;
00972     }
00973
00974     hr = pApp->GetHwnd(&hwndApp);
00975     _sntprintf(sz, MAX_PATH, TEXT("%08X"), hwndApp);
00976
00977     lvItem.pszText    = sz;
00978     lvItem.cchTextMax = lstrlen(sz);
00979     lvItem.lParam   = (LPARAM) pApp;
00980     iItem       = ListView_InsertItem(hwnd, &lvItem);
00981
00982     hr = pApp->GetState(&uState);
00983     ListView_SetItemText(hwnd, iItem, ILV_AS_STATUS,
00984       (NM_SHAPP_SHARED == uState) ? TEXT("Shared") : TEXT("Not Shared"));
00985
00986     hr = pApp->GetName(&bstr);
00987     psz = PszFromBstr(bstr);
00988     SysFreeString(bstr);
00989
00990     //  Store item to ListView (pApp will be released when removed from ListView)
00991     ListView_SetItemText(hwnd, iItem, ILV_AS_NAME, psz);
00992     FreePlpv(&psz);
00993   }
00994
00995   pEnum->Release();
00996   pEnum = NULL;
00997 }
00998
00999
01000 //****************************************************************************
01001 //
01002 // VOID InitShareList(HWND hdlg)
01003 //
01004 //****************************************************************************
01005
01006 VOID InitShareList(HWND hdlg)
01007 {
01008   HWND hwnd = GetDlgItem(hdlg, IDL_APP);
01009
01010   ASSERT(NULL != hwnd);
01011   if  (NULL == hwnd)
01012   {
01013     ERROR_MSG(TEXT("InitShareList: NULL == hwnd"));
01014     return;
01015   }
01016
01017
01018   // Initialize column data
01019   {
01020     int     iCol  = 0       ;
01021     LPCOL   lpCol = _rgColShare ;
01022     LV_COLUMN lvc           ;
01023
01024     ZeroMemory(&lvc, sizeof(LV_COLUMN));
01025     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
01026     lvc.fmt  = LVCFMT_LEFT;
01027
01028     for (iCol = 0; iCol < ARRAY_ELEMENTS(_rgColShare); iCol++)
01029     {
01030       lvc.iSubItem = iCol;
01031       lvc.cx = lpCol->dwWidth;
01032       lvc.pszText = lpCol->lpsz;
01033       if (ListView_InsertColumn(hwnd, iCol, &lvc) == -1)
01034         return;
01035       lpCol++;
01036     }
01037   }
01038
01039   UpdateShareList(hwnd);
01040 }
01041
01042
01043 //****************************************************************************
01044 //
01045 // LRESULT CALLBACK ShareDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01046 //
01047 //****************************************************************************
01048
01049 LRESULT CALLBACK ShareDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01050 {
01051   switch (uMsg)
01052   {
01053   case WM_INITDIALOG:
01054   {
01055     CenterWindow(hdlg, ghwndMain);
01056     InitShareList(hdlg);
01057     return TRUE;
01058   }
01059
01060   case WM_COMMAND:
01061   {
01062     UINT wCmd = GET_WM_COMMAND_ID(wParam, lParam);
01063     switch (wCmd)
01064     {
01065     case IDOK:
01066     case IDCANCEL:
01067       FreeShareList(GetDlgItem(hdlg, IDL_APP));
01068       EndDialog(hdlg, 1);
01069       return TRUE;
01070
01071     case IDB_UPDATE:
01072       UpdateShareList(GetDlgItem(hdlg, IDL_APP));
01073       break;
01074
01075     case IDB_SHARE:
01076     case IDB_UNSHARE:
01077     {
01078       HRESULT     hr    = NO_ERROR;
01079       NM_SHAPP_STATE  uState;
01080       HWND      hwndLv  = GetDlgItem(hdlg, IDL_APP);
01081
01082       int iItem = ListView_GetNextItem(hwndLv, -1, LVNI_ALL | LVNI_SELECTED);
01083       if (-1 == iItem)
01084         break;
01085
01086       LV_ITEM lvi;
01087       ZeroMemory(&lvi, sizeof(LV_ITEM));
01088
01089       lvi.iItem = iItem;
01090       lvi.mask = LVIF_PARAM;
01091       if (!ListView_GetItem(hwndLv, &lvi))
01092         break;
01093
01094       INmSharableApp * pApp = (INmSharableApp *) lvi.lParam;
01095       ASSERT(NULL != pApp);
01096       if  (NULL == pApp)
01097       {
01098         ERROR_MSG(TEXT("ShareDlgProc: NULL == pApp"));
01099         break;
01100       }
01101
01102       hr = pApp->GetState(&uState);
01103       if (FAILED(hr))
01104       {
01105         ERROR_MSG(TEXT("Invalid hwnd? hr=%s"), GetHrSz(hr));
01106         break;
01107       }
01108       STATE_MSG(TEXT("Current app share state is %s"), (uState==NM_SHAPP_SHARED) ? "shared" : (uState == NM_SHAPP_NOT_SHARED) ? "not shared": "unknown");
01109       hr = pApp->SetState((IDB_SHARE == wCmd) ? NM_SHAPP_SHARED : NM_SHAPP_NOT_SHARED);
01110       return TRUE;
01111     }
01112
01113     case IDB_COLLAB:
01114     case IDB_UNCOLLAB:
01115     {
01116       HRESULT     hr    = NO_ERROR;
01117       NM_SHARE_STATE  uState;
01118
01119       if  (NULL == g_pChannelAppShare)
01120       {
01121         ERROR_MSG(TEXT("ShareDlgProc: NULL == g_pChannelAppShare"));
01122         break;
01123       }
01124
01125       hr = g_pChannelAppShare->GetState(&uState);
01126       if (FAILED(hr))
01127       {
01128         ERROR_MSG(TEXT("Invalid hwnd? hr=%s"), GetHrSz(hr));
01129         break;
01130       }
01131
01132       STATE_MSG(TEXT("Current app collaboration status is %s"), GetCollaborationStateSz(uState));
01133
01134       {
01135         // set the state
01136         switch(uState)
01137         {
01138         case NM_SHARE_WORKING_ALONE:
01139         case NM_SHARE_COLLABORATING:
01140           hr = g_pChannelAppShare->SetState(NM_SHARE_IN_CONTROL);
01141           break;
01142
01143         case NM_SHARE_IN_CONTROL:
01144           hr = g_pChannelAppShare->SetState(NM_SHARE_WORKING_ALONE);
01145           break;
01146
01147         case NM_SHARE_UNKNOWN:
01148           TRACE_MSG(TEXT("Cannot collaborate"));
01149
01150         }
01151       }
01152
01153       return TRUE;
01154     }
01155
01156
01157     default:
01158       return TRUE;
01159     } /* switch (cmd) */
01160   }
01161
01162   default:
01163     break;
01164   } /* switch (uMsg) */
01165
01166   return FALSE;
01167 }
01168
01169
01170 //****************************************************************************
01171 //
01172 // BOOL DlgShare(VOID)
01173 //
01174 //****************************************************************************
01175
01176 BOOL DlgShare(VOID)
01177 {
01178   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_SHARE),
01179     ghwndMain, (DLGPROC)ShareDlgProc));
01180 }
01181
01182
01183 //****************************************************************************
01184 //
01185 // VOID _InitGuidLBox(HWND hwnd)
01186 //
01187 //****************************************************************************
01188
01189 VOID _InitGuidLBox(HWND hwnd)
01190 {
01191   HRESULT     hr    = NO_ERROR  ;
01192   DWORD     dwIndex = 0     ;
01193   INmSysInfo  * pSysInfo  = NULL    ;
01194
01195   GUID      guid;
01196   ZeroMemory(&guid, sizeof(GUID));
01197
01198   TCHAR     szGuid[MAX_PATH + 1];
01199   ZeroMemory(szGuid, (MAX_PATH + 1)*sizeof(TCHAR));
01200
01201   if  (NULL == g_pMgr)
01202   {
01203     ERROR_MSG(TEXT("_InitGuidLBox: NULL == g_pMgr"));
01204     return;
01205   }
01206
01207   hr = g_pMgr->GetSysInfo(&pSysInfo);
01208   if (FAILED(hr))
01209   {
01210     ERROR_MSG(TEXT("GetSysInfo Failed hr=%s"), GetHrSz(hr));
01211     return;
01212   }
01213
01214   if  (NULL == pSysInfo)
01215   {
01216     ERROR_MSG(TEXT("GetSysInfo returned a Null Ptr"));
01217     return;
01218   }
01219
01220   // TODO: use INmMgr::GetNmApp to enumerate local items
01221
01222   GuidToSz((GUID *)&g_guid, szGuid);
01223   dwIndex = SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM) szGuid);
01224
01225   ZeroMemory(szGuid, (MAX_PATH + 1) * sizeof(TCHAR));
01226   GuidToSz((GUID *)&g_guidNMUIChat, szGuid);
01227   dwIndex = SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM) szGuid);
01228
01229   memset(&guid, 0x00, sizeof(GUID));
01230   GuidToSz((GUID *)&guid, szGuid);
01231   dwIndex = SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM) szGuid);
01232
01233   memset(&guid, 0x11, sizeof(GUID));
01234   GuidToSz((GUID *)&guid, szGuid);
01235   dwIndex = SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM) szGuid);
01236
01237   memset(&guid, 0x22, sizeof(GUID));
01238   GuidToSz((GUID *)&guid, szGuid);
01239   dwIndex = SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM) szGuid);
01240
01241   SendMessage(hwnd, CB_SETCURSEL, 0, 0);
01242   pSysInfo->Release();
01243 }
01244
01245
01246 //****************************************************************************
01247 //
01248 // LRESULT CALLBACK LaunchDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01249 //
01250 //****************************************************************************
01251
01252 LRESULT CALLBACK LaunchDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01253 {
01254   switch (uMsg)
01255   {
01256   case WM_INITDIALOG:
01257   {
01258     CenterWindow(hdlg, ghwndMain);
01259
01260     InitUserLBox(hdlg, TRUE);
01261     _InitGuidLBox(GetDlgItem(hdlg, IDL_GUID));
01262     return TRUE;
01263   }
01264
01265   case WM_DRAWITEM:
01266     DrawUserItem((LPDRAWITEMSTRUCT) lParam);
01267     break;
01268
01269   case WM_COMMAND:
01270     switch (GET_WM_COMMAND_ID(wParam, lParam))
01271     {
01272     case IDOK:
01273     {
01274       // Get the Member
01275       INmMember * pMember = NULL;
01276       int iSel = SendDlgItemMessage(hdlg, IDL_USERS, CB_GETCURSEL, 0, 0);
01277       if (CB_ERR != iSel)
01278       {
01279         PUSER pUser = (PUSER) SendDlgItemMessage(hdlg, IDL_USERS,
01280           CB_GETITEMDATA, (WPARAM) iSel, 0);
01281         if (NULL != pUser)
01282         {
01283           pMember = pUser->pMember;
01284           if (S_OK == pMember->IsSelf())
01285             pMember = NULL; // everyone
01286         }
01287       }
01288
01289       // Get the Guid
01290       GUID  guid;
01291       ZeroMemory(&guid, sizeof(GUID));
01292
01293       TCHAR szGuid[MAX_PATH + 1];
01294       ZeroMemory(szGuid, sizeof(TCHAR) * (MAX_PATH + 1));
01295
01296       GetDlgItemText(hdlg, IDL_GUID, szGuid, MAX_PATH);
01297       SzToGuid(szGuid, &guid);
01298
01299       INmConference * pConference = GetCurrentConference();
01300       HRESULT hr  = NO_ERROR;
01301
01302       if (NULL == pConference)
01303       {
01304         hr = E_FAIL;
01305       }
01306       else
01307       {
01308         hr = pConference->LaunchRemote(guid, pMember);
01309       }
01310
01311       if (FAILED(hr))
01312       {
01313         ERROR_MSG(TEXT("LaunchRemote Failed hr=%s"), GetHrSz(hr));
01314       }
01315       else
01316       {
01317         EndDialog(hdlg, 1);
01318       }
01319       return TRUE;
01320     }
01321     case IDCANCEL:
01322       EndDialog(hdlg, 0);
01323       return TRUE;
01324
01325     default:
01326       return TRUE;
01327     } /* switch (cmd) */
01328
01329   default:
01330     break;
01331   } /* switch (uMsg) */
01332
01333   return FALSE;
01334 }
01335
01336
01337 //****************************************************************************
01338 //
01339 // BOOL DlgLaunch(VOID)
01340 //
01341 //****************************************************************************
01342
01343 BOOL DlgLaunch(VOID)
01344 {
01345   if (NULL == GetCurrentConference())
01346     return FALSE;
01347
01348   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_LAUNCH),
01349     ghwndMain, (DLGPROC)LaunchDlgProc));
01350 }
01351
01352
01353 //****************************************************************************
01354 //
01355 // LRESULT CALLBACK EjectDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01356 //
01357 //****************************************************************************
01358
01359 LRESULT CALLBACK EjectDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01360 {
01361   switch (uMsg)
01362   {
01363   case WM_INITDIALOG:
01364   {
01365     CenterWindow(hdlg, ghwndMain);
01366
01367     InitUserLBox(hdlg, FALSE);
01368     return TRUE;
01369   }
01370
01371   case WM_DRAWITEM:
01372     DrawUserItem((LPDRAWITEMSTRUCT) lParam);
01373     break;
01374
01375   case WM_COMMAND:
01376     switch (GET_WM_COMMAND_ID(wParam, lParam))
01377     {
01378     case IDOK:
01379     {
01380       // Get the Member
01381       INmMember * pMember = NULL;
01382       int iSel = SendDlgItemMessage(hdlg, IDL_USERS, CB_GETCURSEL, 0, 0);
01383       if (CB_ERR != iSel)
01384       {
01385         PUSER pUser = (PUSER) SendDlgItemMessage(hdlg, IDL_USERS,
01386           CB_GETITEMDATA, (WPARAM) iSel, 0);
01387         if (NULL != pUser)
01388           pMember = pUser->pMember;
01389       }
01390
01391       if (NULL != pMember)
01392       {
01393         HRESULT hr = pMember->Eject();
01394
01395         if (FAILED(hr))
01396         {
01397           ERROR_MSG(TEXT("Eject Failed hr=%s"), GetHrSz(hr));
01398         }
01399       }
01400
01401       EndDialog(hdlg, 1);
01402       return TRUE;
01403     }
01404     case IDCANCEL:
01405       EndDialog(hdlg, 0);
01406       return TRUE;
01407
01408     default:
01409       return TRUE;
01410     } /* switch (cmd) */
01411
01412   default:
01413     break;
01414   } /* switch (uMsg) */
01415
01416   return FALSE;
01417 }
01418
01419
01420 //****************************************************************************
01421 //
01422 // BOOL DlgEject(VOID)
01423 //
01424 //****************************************************************************
01425
01426 BOOL DlgEject(VOID)
01427 {
01428   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_EJECT),
01429     ghwndMain, (DLGPROC)EjectDlgProc));
01430 }
01431
01432
01433
01434 //****************************************************************************
01435 //
01436 // LRESULT CALLBACK ShowLocalDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01437 //
01438 //****************************************************************************
01439
01440 LRESULT CALLBACK ShowLocalDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01441 {
01442   HRESULT     hr    = NO_ERROR;
01443
01444   switch (uMsg)
01445   {
01446   case WM_INITDIALOG:
01447   {
01448
01449     INmSysInfo * pSysInfo = NULL;
01450
01451     CenterWindow(hdlg, ghwndMain);
01452
01453     if  (NULL == g_pMgr)
01454     {
01455       ERROR_MSG(TEXT("ShowLocalDlgProc: NULL == g_pMgr"));
01456     }
01457     else
01458     {
01459       hr = g_pMgr->GetSysInfo(&pSysInfo);
01460       if(FAILED(hr))
01461         ERROR_MSG(TEXT("GetSysInfo failed (%s)"), GetHrSz(hr));
01462       else if (NULL == pSysInfo)
01463         ERROR_MSG(TEXT("ShowLocalDlgProc: NULL == pSysInfo"));
01464     }
01465
01466     CheckRadioButton(hdlg, IDC_SHOW_CHAT, IDC_FINDSOMEONE, IDC_SHOW_CHAT);
01467
01468     if  (NULL != pSysInfo)
01469     {
01470       pSysInfo -> Release();
01471       pSysInfo =  NULL;
01472     }
01473
01474     return TRUE;
01475   }
01476   case WM_COMMAND:
01477   {
01478     UINT    wCmd    = GET_WM_COMMAND_ID(wParam, lParam);
01479     NM_APPID  AppID;
01480     INmObject * pObject = NULL;
01481
01482     switch (wCmd)
01483     {
01484     case IDOK:
01485
01486       if  (NULL == g_pMgr)
01487       {
01488         ERROR_MSG(TEXT("ShowLocalDlgProc: NULL == g_pMgr"));
01489         return FALSE;
01490       }
01491
01492       hr = g_pMgr->QueryInterface(IID_INmObject, (void**) &pObject);
01493
01494       ASSERT(NULL != pObject);
01495
01496       if  (FAILED(hr) || (NULL == pObject))
01497       {
01498         ERROR_MSG(TEXT("ShowLocalDlgProc: QI FAILED [hr=%08X ptr=%p]"), hr, pObject);
01499         return FALSE;
01500       }
01501
01502       if(IsDlgButtonChecked(hdlg, IDC_SHOW_FT))
01503         AppID = NM_APPID_FILE_TRANSFER;
01504       else if(IsDlgButtonChecked(hdlg, IDC_SHOW_CHAT))
01505         AppID = NM_APPID_CHAT;
01506       else if(IsDlgButtonChecked(hdlg, IDC_SHOW_WB))
01507         AppID = NM_APPID_WHITEBOARD;
01508       else if(IsDlgButtonChecked(hdlg, IDC_SHOW_T126WB))
01509         AppID = NM_APPID_T126_WHITEBOARD;
01510       else if(IsDlgButtonChecked(hdlg, IDC_SHOW_AS))
01511         AppID = NM_APPID_APPSHARING;
01512       else if(IsDlgButtonChecked(hdlg, IDC_FINDSOMEONE))
01513       {
01514         hr = pObject->CallDialog(NULL, 0);
01515         EndDialog(hdlg, 1);
01516
01517         pObject->Release();
01518         pObject = NULL;
01519
01520         return TRUE;
01521       }
01522
01523       hr = pObject->ShowLocal(AppID);
01524       if(FAILED(hr))
01525         ERROR_MSG(TEXT("ShowLocal failed (%s)"), GetHrSz(hr));
01526
01527       pObject -> Release();
01528       pObject =  NULL;
01529
01530       // fall through so the dialog goes away!!!
01531
01532     case IDCANCEL:
01533       EndDialog(hdlg, 1);
01534       return TRUE;
01535
01536
01537     default:
01538       return TRUE;
01539     } // switch (cmd)
01540
01541   }
01542
01543   default:
01544     break;
01545   } /* switch (uMsg) */
01546
01547   return FALSE;
01548 }
01549
01550
01551 //****************************************************************************
01552 //
01553 // BOOL DlgShowLocal(VOID)
01554 //
01555 //****************************************************************************
01556
01557 BOOL DlgShowLocal(VOID)
01558 {
01559   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_SHOWLOCAL),
01560     ghwndMain, (DLGPROC)ShowLocalDlgProc));
01561 }
01562
01563
01564
01565
01566 //****************************************************************************
01567 //
01568 // LRESULT CALLBACK LogOnOffDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01569 //
01570 //****************************************************************************
01571
01572 LRESULT CALLBACK LogOnOffDlgProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
01573 {
01574
01575   switch (uMsg)
01576   {
01577   case WM_INITDIALOG:
01578   {
01579     CenterWindow(hdlg, ghwndMain);
01580 //    InitShareList(hdlg);
01581     return TRUE;
01582   }
01583
01584   case WM_COMMAND:
01585   {
01586     UINT wCmd = GET_WM_COMMAND_ID(wParam, lParam);
01587     switch (wCmd)
01588     {
01589     case IDOK:
01590     case IDCANCEL:
01591 //      FreeShareList(GetDlgItem(hdlg, IDL_APP));
01592       EndDialog(hdlg, 1);
01593       return TRUE;
01594
01595 //    case IDB_UPDATE:
01596 //      UpdateShareList(GetDlgItem(hdlg, IDL_APP));
01597 //      break;
01598
01599     case IDB_SHARE:
01600     case IDB_UNSHARE:
01601     {
01602       HRESULT     hr    = NO_ERROR;
01603       NM_SHAPP_STATE  uState;
01604       HWND      hwndLv  = GetDlgItem(hdlg, IDL_APP);
01605       int       iItem = ListView_GetNextItem(hwndLv, -1, LVNI_ALL | LVNI_SELECTED);
01606
01607       if (-1 == iItem)
01608         break;
01609
01610       LV_ITEM lvi;
01611       ZeroMemory(&lvi, sizeof(LV_ITEM));
01612
01613       lvi.iItem = iItem;
01614       lvi.mask = LVIF_PARAM;
01615       if (!ListView_GetItem(hwndLv, &lvi))
01616         break;
01617
01618       INmSharableApp * pApp = (INmSharableApp *) lvi.lParam;
01619       ASSERT(NULL != pApp);
01620       if  (NULL == pApp)
01621       {
01622         ERROR_MSG(TEXT("LogOnOffDlgProc: NULL == pApp"));
01623         break;
01624       }
01625
01626       hr = pApp->GetState(&uState);
01627       if (FAILED(hr))
01628       {
01629         ERROR_MSG(TEXT("Invalid hwnd? hr=%s"), GetHrSz(hr));
01630         break;
01631       }
01632       STATE_MSG(TEXT("Current app share state is %s"), (uState==NM_SHAPP_SHARED) ? "shared" : (uState == NM_SHAPP_NOT_SHARED) ? "not shared": "unknown");
01633       hr = pApp->SetState((IDB_SHARE == wCmd) ? NM_SHAPP_SHARED : NM_SHAPP_NOT_SHARED);
01634       return TRUE;
01635     }
01636
01637     case IDB_COLLAB:
01638     case IDB_UNCOLLAB:
01639     {
01640       HRESULT     hr    = NO_ERROR;
01641       NM_SHARE_STATE  uState;
01642
01643       if  (NULL == g_pChannelAppShare)
01644       {
01645         ERROR_MSG(TEXT("LogOnOffDlgProc: NULL == g_pChannelAppShare"));
01646         break;
01647       }
01648
01649       hr = g_pChannelAppShare->GetState(&uState);
01650       if (FAILED(hr))
01651       {
01652         ERROR_MSG(TEXT("Invalid hwnd? hr=%s"), GetHrSz(hr));
01653         break;
01654       }
01655
01656       STATE_MSG(TEXT("Current app collaboration status is %s"), GetCollaborationStateSz(uState));
01657
01658       {
01659         // set the state
01660         switch(uState)
01661         {
01662         case NM_SHARE_WORKING_ALONE:
01663         case NM_SHARE_COLLABORATING:
01664           hr = g_pChannelAppShare->SetState(NM_SHARE_IN_CONTROL);
01665           break;
01666
01667         case NM_SHARE_IN_CONTROL:
01668           hr = g_pChannelAppShare->SetState(NM_SHARE_WORKING_ALONE);
01669           break;
01670
01671         case NM_SHARE_UNKNOWN:
01672           TRACE_MSG(TEXT("Cannot collaborate"));
01673
01674         }
01675       }
01676
01677       return TRUE;
01678     }
01679
01680
01681     default:
01682       return TRUE;
01683     } // switch (cmd)
01684   }
01685
01686   default:
01687     break;
01688   } /* switch (uMsg) */
01689
01690   return FALSE;
01691 }
01692
01693
01694 //****************************************************************************
01695 //
01696 // BOOL DlgLogOnOff(VOID)
01697 //
01698 //****************************************************************************
01699
01700 BOOL DlgLogOnOff(VOID)
01701 {
01702   return (0 == DialogBox(ghInst, MAKEINTRESOURCE(IDD_LOGONOFF),
01703     ghwndMain, (DLGPROC)LogOnOffDlgProc));
01704 }
01705
01706 BOOL IsSharingEnabled(VOID)
01707 {
01708   OSVERSIONINFO osvi;
01709   osvi.dwOSVersionInfoSize = sizeof(osvi);
01710
01711   if(FALSE == ::GetVersionEx(&osvi))
01712   {
01713     return TRUE;
01714   }
01715
01716     if((VER_PLATFORM_WIN32_NT == osvi.dwPlatformId) && (4 >= osvi.dwMajorVersion))
01717     {
01718     if(NT_DRIVER_START_DISABLED == GetRegDWORD(HKEY_LOCAL_MACHINE, NM_NT_DISPLAY_DRIVER_KEY, REGVAL_NM_NT_DISPLAY_DRIVER_ENABLED, 0))
01719     {
01720       return FALSE;
01721     }
01722   }
01723
01724   return TRUE;
01725
01726 }
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SynchInfo Member List

This is the complete list of members for _SynchInfo, including all inherited members.
hWndSynch | _SynchInfo
wpProc | _SynchInfo
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/ATMEvent/Receiver.Cpp Source File

  • NetDS
  • WinSock
  • ATMEvent

Receiver.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      receiver.cpp
00010 //
00011 // Abstract:
00012 //      Implement receive-side functionality.  The reciever can accept up to
00013 //      MAXCLIENT connections from senders.  The receiver uses WSAEventSelect
00014 //      to handle the potential multiple connections as well as to allow the
00015 //      receiver handle a request for a QoS connection during the accept.
00016 //
00017 // Author:
00018 //      Barry R. Butterklee
00019 //
00020
00021 #include "atmevent.h"
00022
00023 #define MAXCLIENTS 4
00024
00025
00026 // encapsulate socket, events, buffers, and various flags and counters that
00027 // control how/when data is received into a structure
00028 typedef struct _RECV_INFO
00029 {
00030     SOCKET          sd[MAXCLIENTS+1];
00031     WSAEVENT        hEvents[MAXCLIENTS+1];
00032     CHAR *          recvbuf;
00033     int             nTotalClients;
00034 } RECV_INFO;
00035
00036
00037
00038 static BOOL CreateReceivingSocket(RECV_INFO *, OPTIONS *);
00039 static BOOL fd_accept_func(DWORD, WSANETWORKEVENTS *, RECV_INFO *, OPTIONS *);
00040 static BOOL fd_read_func(DWORD, WSANETWORKEVENTS *, RECV_INFO *, OPTIONS *);
00041 static BOOL fd_close_func(DWORD, WSANETWORKEVENTS *, RECV_INFO *, OPTIONS *);
00042 int CALLBACK AcceptCondFunc(
00043                            LPWSABUF, LPWSABUF, LPQOS, LPQOS, LPWSABUF, LPWSABUF, GROUP FAR *, DWORD_PTR);
00044
00045
00046
00047
00048 // Abstract:
00049 //      Main function to create a socket that allows clients to connect and
00050 //      send it data.  Upto MAXCLIENTS can connect and send data.  The data
00051 //      is read in and then tossed (the data is not used).
00052 //
00053 VOID Receiver(
00054              OPTIONS             *pOptions
00055              )
00056 {
00057     WSANETWORKEVENTS NetworkEvents = {0};
00058     long lNetworkEvents = 0;
00059     BOOL bProcessEventsDone = FALSE;
00060     RECV_INFO RecvInfo = {0};
00061     int i = 0;
00062
00063     printf("Receiver\n");
00064
00065     //init RecvInfo sockets/event handles
00066     for (i = 0; i < MAXCLIENTS+1; i++)
00067     {
00068         RecvInfo.sd[i] = INVALID_SOCKET;
00069         RecvInfo.hEvents[i] = WSA_INVALID_EVENT;
00070     }
00071
00072
00073
00074
00075     for (i=0; i<MAXCLIENTS+1; i++)
00076     {
00077         if (WSA_INVALID_EVENT == (RecvInfo.hEvents[i] = WSACreateEvent()))
00078         {
00079             printf("WSACreateEvent(%d): %d\n", i, WSAGetLastError());
00080             goto CLEANUP;
00081         }
00082     }
00083
00084     // create the receiving/listening socket
00085     if (!CreateReceivingSocket(&RecvInfo, pOptions))
00086         goto CLEANUP;
00087
00088
00089     lNetworkEvents = (FD_ACCEPT|FD_READ|FD_CLOSE);
00090     if (SOCKET_ERROR == WSAEventSelect(RecvInfo.sd[0], RecvInfo.hEvents[0], lNetworkEvents))
00091     {
00092         printf("WSAEventSelect: %d\n", WSAGetLastError());
00093         goto CLEANUP;
00094     }
00095
00096     bProcessEventsDone = FALSE;
00097     while (!bProcessEventsDone)
00098     {
00099         DWORD dwEvent;
00100
00101         dwEvent = WSAWaitForMultipleEvents((MAXCLIENTS+1), RecvInfo.hEvents, FALSE, WSA_INFINITE, FALSE);
00102         switch (dwEvent)
00103         {
00104         case WSA_WAIT_FAILED:
00105             printf("WSAEventSelect: %d\n", WSAGetLastError());
00106             bProcessEventsDone = TRUE;
00107             break;
00108         case WAIT_IO_COMPLETION:
00109         case WSA_WAIT_TIMEOUT:
00110             break;
00111
00112         default:
00113             // lets see what network activity trigged this event
00114             NetworkEvents.lNetworkEvents = 0;
00115             if (SOCKET_ERROR == WSAEnumNetworkEvents(RecvInfo.sd[dwEvent], RecvInfo.hEvents[dwEvent], &NetworkEvents))
00116             {
00117                 printf("WSAEnumNetworkEvent: %d dwEvent %d lNetworkEvent %X\n",
00118                        WSAGetLastError(), dwEvent, NetworkEvents.lNetworkEvents);
00119                 NetworkEvents.lNetworkEvents = 0;
00120                 bProcessEventsDone = TRUE;
00121             } else
00122             {
00123                 // it is possible that more than one notification triggered the event
00124                 //printf("WSAEnumNetworkEvents %X\n", NetworkEvents.lNetworkEvents);
00125                 if (FD_ACCEPT & NetworkEvents.lNetworkEvents)
00126                     bProcessEventsDone |=
00127                     fd_accept_func(dwEvent, &NetworkEvents, &RecvInfo, pOptions);
00128                 if (FD_READ   & NetworkEvents.lNetworkEvents)
00129                     bProcessEventsDone |=
00130                     fd_read_func(dwEvent, &NetworkEvents, &RecvInfo, pOptions);
00131                 if (FD_CLOSE  & NetworkEvents.lNetworkEvents)
00132                     bProcessEventsDone |=
00133                     fd_close_func(dwEvent, &NetworkEvents, &RecvInfo, pOptions);
00134             }
00135             break;
00136         }
00137     } // while (!bProcessEventsDone)
00138
00139
00140     CLEANUP:
00141     for (i = 0; i < MAXCLIENTS+1; i++)
00142     {
00143         if (INVALID_SOCKET != RecvInfo.sd[i])
00144         {
00145             closesocket(RecvInfo.sd[i]);
00146             RecvInfo.sd[i] = INVALID_SOCKET;
00147         }
00148
00149         if (WSA_INVALID_EVENT != RecvInfo.hEvents[i])
00150         {
00151             WSACloseEvent(RecvInfo.hEvents[i]);
00152             RecvInfo.hEvents[i] = WSA_INVALID_EVENT;
00153         }
00154     }
00155
00156
00157
00158     return;
00159 }
00160
00161
00162
00163
00164 // Abstract:
00165 //      Create a socket on which to receive data.  Please note that WSA_FLAG_OVERLAPPED
00166 //      *MUST* be specified.  Also, note that the parameters for WSASocket and the
00167 //      data to fill in the SOCKADDR structure come from the supplied protocol
00168 //      info structure instead of being hardcoded.
00169 //
00170 static BOOL CreateReceivingSocket(
00171                                  RECV_INFO           *pRecvInfo,
00172                                  OPTIONS             *pOptions
00173                                  )
00174 {
00175     DWORD        dwSocketFlags = 0;
00176     SOCKADDR_ATM sockaddr = {0};
00177     int          nAddrLen = 0;
00178     int          nRet = 0;
00179
00180
00181     dwSocketFlags = WSA_FLAG_OVERLAPPED;
00182
00183     pRecvInfo->sd[0] = WSASocket(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
00184                                  &pOptions->protocolInfo, 0, dwSocketFlags);
00185     if (INVALID_SOCKET == pRecvInfo->sd[0])
00186     {
00187         printf("WSASocket failed w/%d", WSAGetLastError());
00188         return FALSE;
00189     }
00190
00191     ZeroMemory(&sockaddr, sizeof(sockaddr));
00192     nAddrLen = sizeof(sockaddr);
00193     nRet = WSAStringToAddress(pOptions->szLocalInterface, AF_ATM, &pOptions->protocolInfo,
00194                               (LPSOCKADDR)&sockaddr, &nAddrLen);
00195     if (SOCKET_ERROR == nRet)
00196     {
00197         printf("WSAAddressToString: %d\n", WSAGetLastError());
00198         return FALSE;
00199     }
00200     // fill in remainder of ATM address structure
00201     sockaddr.satm_family                 = AF_ATM;
00202     sockaddr.satm_number.AddressType     = ATM_NSAP;
00203     sockaddr.satm_number.NumofDigits     = ATM_ADDR_SIZE;
00204     sockaddr.satm_blli.Layer2Protocol    = SAP_FIELD_ANY;
00205     sockaddr.satm_blli.Layer3Protocol    = SAP_FIELD_ABSENT;
00206     sockaddr.satm_bhli.HighLayerInfoType = SAP_FIELD_ABSENT;
00207
00208     nRet = bind(pRecvInfo->sd[0], (LPSOCKADDR)&sockaddr, sizeof(sockaddr));
00209     if (SOCKET_ERROR == nRet)
00210     {
00211         printf("bind failed w/%d", WSAGetLastError());
00212         return FALSE;
00213     }
00214
00215     nRet = listen(pRecvInfo->sd[0], SOMAXCONN);
00216     if (SOCKET_ERROR == nRet)
00217     {
00218         printf("listen failed w/%d", WSAGetLastError());
00219         return FALSE;
00220     }
00221
00222     return TRUE;
00223 }
00224
00225
00226
00227
00228 // Abstract:
00229 //      FD_ACCEPT handler.  Invoked when a client is trying to connect.
00230 //      WSAAccept is called and an Accept Condition function is supplied to allow
00231 //      a connection to be rejected if too many client have already connected.
00232 //
00233 //
00234 static BOOL fd_accept_func(
00235                           DWORD               dwEvent,
00236                           WSANETWORKEVENTS    *NetworkEvents,
00237                           RECV_INFO           *pRecvInfo,
00238                           OPTIONS             *pOptions
00239                           )
00240 {
00241     BOOL    bProcessEventsDone = FALSE;
00242     SOCKET  temp_socket = INVALID_SOCKET;
00243     int     nRet = 0;
00244
00245
00246     printf("  FD_ACCEPT: dwEvent=%d error code =%d\n",
00247            dwEvent, NetworkEvents->iErrorCode[FD_ACCEPT_BIT]);
00248     if (NetworkEvents->iErrorCode[FD_ACCEPT_BIT])
00249         return TRUE;
00250
00251     temp_socket = WSAAccept(pRecvInfo->sd[0], NULL, NULL, (LPCONDITIONPROC)AcceptCondFunc, (DWORD_PTR)pOptions);
00252     if (INVALID_SOCKET == temp_socket)
00253     {
00254         printf("    WSAAccept failed w/%d\n", WSAGetLastError());
00255         bProcessEventsDone = FALSE;
00256     } else
00257     {
00258         // keep list of connected sockets
00259         printf("    socket connection accepted\n");
00260         for (int i=1; i<=MAXCLIENTS; i++)
00261         {
00262             if (INVALID_SOCKET == pRecvInfo->sd[i])
00263             {
00264                 pRecvInfo->sd[i] = temp_socket;
00265                 break;
00266             }
00267         }
00268
00269         nRet = WSAEventSelect(temp_socket, pRecvInfo->hEvents[i], (FD_READ|FD_CLOSE));
00270         if (SOCKET_ERROR == nRet)
00271         {
00272             printf("    WSAEventSelect: failed w/%d\n", WSAGetLastError());
00273             bProcessEventsDone = TRUE;
00274         }
00275     }
00276
00277     return bProcessEventsDone;
00278 }
00279
00280
00281
00282 // Abstract:
00283 //      FD_READ handler.  Handling FD_READ notifications is pretty straight-forward.
00284 //      Just read the amount of data you are interested in reading at this moment.
00285 //      If there is more data left, you will get another FD_READ.
00286 //
00287 //
00288 //
00289 static BOOL fd_read_func(
00290                         DWORD               dwEvent,
00291                         WSANETWORKEVENTS    *NetworkEvents,
00292                         RECV_INFO           *pRecvInfo,
00293                         OPTIONS             *pOptions
00294                         )
00295 {
00296     BOOL        bProcessEventsDone = FALSE;
00297     int         nRecv = 0;
00298     static CHAR *bufptr = NULL;
00299     static int  nBytesToRecv = pOptions->nBufSize;
00300
00301
00302     __try
00303     {
00304
00305
00306         if (NULL == (pRecvInfo->recvbuf = (CHAR*)Malloc(pOptions->nBufSize)))
00307         {
00308             printf(" HeapAlloc() failed: %d [%s:%ld]\n",GetLastError(),__FILE__,__LINE__);
00309             __leave;
00310         }
00311
00312         bufptr = pRecvInfo->recvbuf;
00313
00314         printf("  FD_READ: dwEvent=%d error code =%d bytestorecv=%d\n",
00315                dwEvent, NetworkEvents->iErrorCode[FD_READ_BIT], nBytesToRecv);
00316         if (NetworkEvents->iErrorCode[FD_READ_BIT])
00317         {
00318             bProcessEventsDone = TRUE;
00319             __leave;
00320         }
00321
00322
00323         nRecv = recv(pRecvInfo->sd[dwEvent], bufptr, nBytesToRecv, 0);
00324         if (SOCKET_ERROR == nRecv)
00325         {
00326             DWORD dwErr= WSAGetLastError();
00327             if (WSAEWOULDBLOCK != dwErr)
00328             {
00329                 printf("    recv[from]: failed w/%d\n", WSAGetLastError());
00330                 bProcessEventsDone = TRUE;
00331             } else
00332             {
00333                 printf("    recv[from]: WSAEWOULDBLOCK, wait for next FD_READ\n");
00334                 bProcessEventsDone = FALSE;
00335             }
00336         } else
00337         {
00338             // we got data
00339             if (nRecv)
00340                 printf("    recv'ed bytes=%d char=<%c>\n", nRecv, *bufptr);
00341             else
00342                 printf("    recv'ed 0 bytes\n");
00343
00344             bufptr += nRecv;
00345             nBytesToRecv -= nRecv;
00346             if (0 == nBytesToRecv)
00347             {
00348                 bufptr = pRecvInfo->recvbuf;
00349                 nBytesToRecv = pOptions->nBufSize;
00350             }
00351         }
00352
00353
00354     }
00355     __finally
00356     {
00357         if(NULL != pRecvInfo->recvbuf) Free(pRecvInfo->recvbuf);
00358     }
00359
00360
00361     return bProcessEventsDone;
00362 }
00363
00364
00365
00366
00367
00368 // Abstract:
00369 //      FD_CLOSE handler.  When receiving FD_CLOSE, it is still possible for data
00370 //      to be queued up and therefore the socket should be drained of that data so
00371 //      as not to lose that data.  Winsock2 events are manual reset events and FD_CLOSE
00372 //      has no re-enabling function, therefore must reset the event here, otherwise
00373 //      we would get additional FD_CLOSE notifications.
00374 //
00375 static BOOL fd_close_func(
00376                          DWORD               dwEvent,
00377                          WSANETWORKEVENTS    *NetworkEvents,
00378                          RECV_INFO           *pRecvInfo,
00379                          OPTIONS             *pOptions
00380                          )
00381 {
00382     BOOL bProcessEventsDone = FALSE;
00383
00384
00385     printf("  FD_CLOSE: dwEvent=%d error code =%d\n",
00386            dwEvent, NetworkEvents->iErrorCode[FD_CLOSE_BIT]);
00387     if (NetworkEvents->iErrorCode[FD_CLOSE_BIT])
00388         bProcessEventsDone = TRUE;
00389     else
00390     {
00391         // no need to drain the socket if running of over native ATM
00392         WSAResetEvent(pRecvInfo->hEvents[dwEvent]);
00393         if (INVALID_SOCKET != pRecvInfo->sd[dwEvent])
00394         {
00395             closesocket(pRecvInfo->sd[dwEvent]);
00396             pRecvInfo->sd[dwEvent] = INVALID_SOCKET;
00397         }
00398         pOptions->dwTotalClients--;
00399         bProcessEventsDone = FALSE;
00400     }
00401     return bProcessEventsDone;
00402 }
00403
00404
00405
00406
00407 // Abstract:
00408 //      Function called by Winsock to accept or reject a connection.  If more
00409 //      than MAXCLIENTS attempt to connect the connection will be rejected
00410 //      (CF_REJECT).
00411 //
00412 //
00413 int CALLBACK AcceptCondFunc(
00414                            LPWSABUF    lpCallerId,
00415                            LPWSABUF    lpCallerData,
00416                            LPQOS       lpSQos,
00417                            LPQOS       lpGQos,
00418                            LPWSABUF    lpCalleeId,
00419                            LPWSABUF    lpCalleeData,
00420                            GROUP FAR   *Group,
00421                            DWORD_PTR       CallbackData
00422                            )
00423 {
00424     int     nRet        = CF_ACCEPT;
00425     OPTIONS *pOptions   = (OPTIONS *)CallbackData;
00426
00427
00428     printf("    AcceptCondFunc\n");
00429     if (MAXCLIENTS == pOptions->dwTotalClients)
00430     {
00431         printf("      Rejecting connection, limit of %d clients reached\n",
00432                pOptions->dwTotalClients);
00433         nRet = CF_REJECT;
00434         // At this point a connection will already have been established,
00435         // this will just cause the connection to be reset.
00436     } else
00437         pOptions->dwTotalClients++;
00438
00439     return nRet;
00440 }
00441
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows.Net/celib.cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows.Net

celib.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1995 - 1999
00006 //
00007 //  File:       celib.cpp
00008 //
00009 //  Contents:   helper functions
00010 //
00011 //--------------------------------------------------------------------------
00012
00013 #include "pch.cpp"
00014 #pragma hdrstop
00015
00016 #include "celib.h"
00017 #include <assert.h>
00018
00019 //+--------------------------------------------------------------------------
00020 // ceDecodeObject -- call CryptDecodeObject, and allocate memory for output
00021 //
00022 //+--------------------------------------------------------------------------
00023
00024 #pragma warning(push)
00025 #pragma warning(disable: 4100)  // unreferenced formal parameter
00026 BOOL
00027 ceDecodeObject(
00028     IN DWORD dwEncodingType,
00029     IN LPCSTR lpszStructType,
00030     IN BYTE const *pbEncoded,
00031     IN DWORD cbEncoded,
00032     IN BOOL fCoTaskMemAlloc,  // referenced only by assert
00033     OUT VOID **ppvStructInfo,
00034     OUT DWORD *pcbStructInfo)
00035 {
00036     BOOL b;
00037
00038     assert(!fCoTaskMemAlloc);
00039     *ppvStructInfo = NULL;
00040     *pcbStructInfo = 0;
00041     while (TRUE)
00042     {
00043   b = CryptDecodeObject(
00044         dwEncodingType,
00045         lpszStructType,
00046         pbEncoded,
00047         cbEncoded,
00048         0,                  // dwFlags
00049         *ppvStructInfo,
00050         pcbStructInfo);
00051   if (b && 0 == *pcbStructInfo)
00052   {
00053       SetLastError((DWORD) HRESULT_FROM_WIN32(ERROR_INVALID_DATA));
00054       b = FALSE;
00055   }
00056   if (!b)
00057   {
00058       if (NULL != *ppvStructInfo)
00059       {
00060     HRESULT hr = GetLastError();
00061
00062     LocalFree(*ppvStructInfo);
00063     *ppvStructInfo = NULL;
00064     SetLastError(hr);
00065       }
00066       break;
00067   }
00068   if (NULL != *ppvStructInfo)
00069   {
00070       break;
00071   }
00072   *ppvStructInfo = (BYTE *) LocalAlloc(LMEM_FIXED, *pcbStructInfo);
00073   if (NULL == *ppvStructInfo)
00074   {
00075       b = FALSE;
00076       break;
00077   }
00078     }
00079     return(b);
00080 }
00081 #pragma warning(pop)
00082
00083
00084 #pragma warning(push)
00085 #pragma warning(disable: 4100)  // unreferenced formal parameter
00086 BOOL
00087 ceEncodeObject(
00088     IN DWORD dwEncodingType,
00089     IN LPCSTR lpszStructType,
00090     IN VOID const *pvStructInfo,
00091     IN DWORD dwFlags,   // referenced only by assert
00092     IN BOOL fCoTaskMemAlloc,  // referenced only by assert
00093     OUT BYTE **ppbEncoded,
00094     OUT DWORD *pcbEncoded)
00095 {
00096     BOOL b;
00097
00098     assert(0 == dwFlags);
00099     assert(!fCoTaskMemAlloc);
00100     *ppbEncoded = NULL;
00101     *pcbEncoded = 0;
00102     while (TRUE)
00103     {
00104   b = CryptEncodeObject(
00105         dwEncodingType,
00106         lpszStructType,
00107         const_cast<VOID *>(pvStructInfo),
00108         *ppbEncoded,
00109         pcbEncoded);
00110   if (b && 0 == *pcbEncoded)
00111   {
00112       SetLastError((DWORD) HRESULT_FROM_WIN32(ERROR_INVALID_DATA));
00113       b = FALSE;
00114   }
00115   if (!b)
00116   {
00117       if (NULL != *ppbEncoded)
00118       {
00119     HRESULT hr = GetLastError();
00120
00121     LocalFree(*ppbEncoded);
00122     *ppbEncoded = NULL;
00123     SetLastError(hr);
00124       }
00125       break;
00126   }
00127   if (NULL != *ppbEncoded)
00128   {
00129       break;
00130   }
00131   *ppbEncoded = (BYTE *) LocalAlloc(LMEM_FIXED, *pcbEncoded);
00132   if (NULL == *ppbEncoded)
00133   {
00134       b = FALSE;
00135       break;
00136   }
00137     }
00138     return(b);
00139 }
00140 #pragma warning(pop)
00141
00142
00143 // The returned pszObjId is a constant that must not be freed.  CryptFindOIDInfo
00144 // has a static internal database that is valid until crypt32.dll is unloaded.
00145
00146 WCHAR const *
00147 ceGetOIDNameA(
00148     IN char const *pszObjId)
00149 {
00150     CRYPT_OID_INFO const *pInfo = NULL;
00151     WCHAR const *pwszName = L"";
00152
00153     // First try looking up the ObjectId as an Extension or Attribute, because
00154     // we get a better Display Name, especially for Subject RDNs: CN, L, etc.
00155     // If that fails, look it up withoput restricting the group.
00156
00157     pInfo = CryptFindOIDInfo(
00158       CRYPT_OID_INFO_OID_KEY,
00159       (VOID *) pszObjId,
00160       CRYPT_EXT_OR_ATTR_OID_GROUP_ID);
00161
00162     if (NULL == pInfo || NULL == pInfo->pwszName || L'\0' == pInfo->pwszName[0])
00163     {
00164   pInfo = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, (VOID *) pszObjId, 0);
00165     }
00166     if (NULL != pInfo && NULL != pInfo->pwszName && L'\0' != pInfo->pwszName[0])
00167     {
00168   pwszName = pInfo->pwszName;
00169     }
00170     return(pwszName);
00171 }
00172
00173
00174 WCHAR const *
00175 ceGetOIDName(
00176     IN WCHAR const *pwszObjId)
00177 {
00178     char *pszObjId = NULL;
00179     WCHAR const *pwszName = L"";
00180
00181     if (!ceConvertWszToSz(&pszObjId, pwszObjId, -1))
00182     {
00183   _JumpError(E_OUTOFMEMORY, error, "ceConvertWszToSz");
00184     }
00185     pwszName = ceGetOIDNameA(pszObjId);
00186
00187 error:
00188     if (NULL != pszObjId)
00189     {
00190   LocalFree(pszObjId);
00191     }
00192     return(pwszName);
00193 }
00194
00195
00196 WCHAR *
00197 ceDuplicateString(
00198     IN WCHAR const *pwsz)
00199 {
00200     WCHAR *pwszOut;
00201
00202     pwszOut = (WCHAR *) LocalAlloc(
00203         LMEM_FIXED,
00204         (wcslen(pwsz) + 1) * sizeof(pwsz[0]));
00205     if (NULL != pwszOut)
00206     {
00207   wcscpy(pwszOut, pwsz);
00208     }
00209     return(pwszOut);
00210 }
00211
00212
00213 BOOL
00214 ceConvertWszToSz(
00215     OUT CHAR **ppsz,
00216     IN WCHAR const *pwc,
00217     IN LONG cwc)
00218 {
00219     BOOL fOk = FALSE;
00220     LONG cch = 0;
00221
00222     *ppsz = NULL;
00223     while (TRUE)
00224     {
00225   cch = WideCharToMultiByte(
00226       GetACP(),
00227       0,          // dwFlags
00228       pwc,
00229       cwc,        // cchWideChar, -1 => null terminated
00230       *ppsz,
00231       cch,
00232       NULL,
00233       NULL);
00234   if (0 >= cch)
00235   {
00236       DWORD err;
00237
00238       err = GetLastError();
00239       ceERRORPRINTLINE("WideCharToMultiByte", err);
00240       if (NULL != *ppsz)
00241       {
00242     LocalFree(*ppsz);
00243     *ppsz = NULL;
00244       }
00245       break;
00246   }
00247   if (NULL != *ppsz)
00248   {
00249       fOk = TRUE;
00250       break;
00251   }
00252   *ppsz = (CHAR *) LocalAlloc(LMEM_FIXED, cch + 1);
00253   if (NULL == *ppsz)
00254   {
00255       break;
00256   }
00257     }
00258     return(fOk);
00259 }
00260
00261
00262 BOOL
00263 ceConvertWszToBstr(
00264     OUT BSTR *pbstr,
00265     IN WCHAR const *pwc,
00266     IN LONG cb)
00267 {
00268     BOOL fOk = FALSE;
00269     BSTR bstr;
00270
00271     ceFreeBstr(pbstr);
00272     do
00273     {
00274   bstr = NULL;
00275   if (NULL != pwc)
00276   {
00277       if (-1 == cb)
00278       {
00279     cb = wcslen(pwc) * sizeof(WCHAR);
00280       }
00281       bstr = SysAllocStringByteLen((char const *) pwc, cb);
00282       if (NULL == bstr)
00283       {
00284     break;
00285       }
00286   }
00287   *pbstr = bstr;
00288   fOk = TRUE;
00289     } while (FALSE);
00290     return(fOk);
00291 }
00292
00293
00294 BOOL
00295 ceConvertSzToWsz(
00296     OUT WCHAR **ppwsz,
00297     IN char const *pch,
00298     IN LONG cch)
00299 {
00300     BOOL fOk = FALSE;
00301     LONG cwc = 0;
00302
00303     *ppwsz = NULL;
00304     while (TRUE)
00305     {
00306   cwc = MultiByteToWideChar(GetACP(), 0, pch, cch, *ppwsz, cwc);
00307   if (0 >= cwc)
00308   {
00309       DWORD err;
00310
00311       err = GetLastError();
00312       ceERRORPRINTLINE("MultiByteToWideChar", err);
00313       if (NULL != *ppwsz)
00314       {
00315     LocalFree(*ppwsz);
00316     *ppwsz = NULL;
00317       }
00318       break;
00319   }
00320   if (NULL != *ppwsz)
00321   {
00322       fOk = TRUE;
00323       break;
00324   }
00325   *ppwsz = (WCHAR *) LocalAlloc(LMEM_FIXED, (cwc + 1) * sizeof(WCHAR));
00326   if (NULL == *ppwsz)
00327   {
00328       break;
00329   }
00330     }
00331     return(fOk);
00332 }
00333
00334
00335 BOOL
00336 ceConvertSzToBstr(
00337     OUT BSTR *pbstr,
00338     IN CHAR const *pch,
00339     IN LONG cch)
00340 {
00341     BOOL fOk = FALSE;
00342     BSTR bstr = NULL;
00343     LONG cwc = 0;
00344
00345     ceFreeBstr(pbstr);
00346     if (-1 == cch)
00347     {
00348   cch = strlen(pch);
00349     }
00350     while (TRUE)
00351     {
00352   cwc = MultiByteToWideChar(GetACP(), 0, pch, cch, bstr, cwc);
00353   if (0 >= cwc)
00354   {
00355       //hr = ceHLastError();
00356       //printf("MultiByteToWideChar returned %d (%x)\n", hr, hr);
00357       break;
00358   }
00359   if (NULL != bstr)
00360   {
00361       bstr[cwc] = L'\0';
00362       *pbstr = bstr;
00363       fOk = TRUE;
00364       break;
00365   }
00366   bstr = SysAllocStringLen(NULL, cwc);
00367   if (NULL == bstr)
00368   {
00369       break;
00370   }
00371     }
00372     return(fOk);
00373 }
00374
00375
00376 VOID
00377 ceFreeBstr(
00378     IN OUT BSTR *pstr)
00379 {
00380     if (NULL != *pstr)
00381     {
00382   SysFreeString(*pstr);
00383   *pstr = NULL;
00384     }
00385 }
00386
00387
00388 HRESULT
00389 ceHError(
00390     IN HRESULT hr)
00391 {
00392     assert(S_FALSE != hr);
00393
00394     if (S_OK != hr && S_FALSE != hr && !FAILED(hr))
00395     {
00396         hr = HRESULT_FROM_WIN32(hr);
00397   if ((HRESULT) 0 == HRESULT_CODE(hr))
00398   {
00399       // A call failed without properly setting an error condition!
00400       hr = E_UNEXPECTED;
00401   }
00402   assert(FAILED(hr));
00403     }
00404     return(hr);
00405 }
00406
00407
00408 HRESULT
00409 ceHLastError(VOID)
00410 {
00411     return(ceHError(GetLastError()));
00412 }
00413
00414
00415 VOID
00416 ceErrorPrintLine(
00417     IN char const *pszFile,
00418     IN DWORD line,
00419     IN char const *pszMessage,
00420     IN WCHAR const *pwszData,
00421     IN HRESULT hr)
00422 {
00423     CHAR ach[4096];
00424     LONG cch;
00425
00426 #pragma prefast(disable:53, "PREfast bug 650")
00427     cch = _snprintf(
00428     ach,
00429     sizeof(ach),
00430     "CeLib: Error: %hs(%u): %hs%hs%ws%hs 0x%x (%d)\n",
00431     pszFile,
00432     line,
00433     pszMessage,
00434     NULL == pwszData? "" : szLPAREN,
00435     NULL == pwszData? L"" : pwszData,
00436     NULL == pwszData? "" : szRPAREN,
00437     hr,
00438     hr);
00439 #pragma prefast(enable:53, "re-enable")
00440     if (0 > cch || sizeof(ach) <= cch)
00441     {
00442   strcpy(&ach[sizeof(ach) - 5], "...\n");
00443     }
00444     OutputDebugStringA(ach);
00445     wprintf(L"%hs", ach);
00446 }
00447
00448
00449 HRESULT
00450 ceDateToFileTime(
00451     IN DATE const *pDate,
00452     OUT FILETIME *pft)
00453 {
00454     SYSTEMTIME st;
00455     HRESULT hr = S_OK;
00456
00457     if (*pDate == 0.0)
00458     {
00459         GetSystemTime(&st);
00460     }
00461     else
00462     {
00463   if (!VariantTimeToSystemTime(*pDate, &st))
00464   {
00465       hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00466       _JumpError(hr, error, "VariantTimeToSystemTime");
00467   }
00468     }
00469
00470     if (!SystemTimeToFileTime(&st, pft))
00471     {
00472         hr = ceHLastError();
00473         _JumpError(hr, error, "SystemTimeToFileTime");
00474     }
00475
00476 error:
00477     return(hr);
00478 }
00479
00480
00481 HRESULT
00482 ceFileTimeToDate(
00483     IN FILETIME const *pft,
00484     OUT DATE *pDate)
00485 {
00486     SYSTEMTIME st;
00487     HRESULT hr = S_OK;
00488
00489     if (!FileTimeToSystemTime(pft, &st))
00490     {
00491         hr = ceHLastError();
00492         _JumpError(hr, error, "FileTimeToSystemTime");
00493     }
00494     if (!SystemTimeToVariantTime(&st, pDate))
00495     {
00496         hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00497         _JumpError(hr, error, "SystemTimeToVariantTime");
00498     }
00499
00500 error:
00501     return(hr);
00502 }
00503
00504
00505 VOID
00506 ceMakeExprDateTime(
00507     IN OUT FILETIME *pft,
00508     IN LONG lDelta,
00509     IN enum ENUM_PERIOD enumPeriod)
00510 {
00511     LLFILETIME llft;
00512     LONGLONG llDelta;
00513     BOOL fSysTimeDelta;
00514
00515     llft.ft = *pft;
00516     llDelta = lDelta;
00517     fSysTimeDelta = FALSE;
00518     switch (enumPeriod)
00519     {
00520   case ENUM_PERIOD_WEEKS:   llDelta *= CVT_WEEKS;    break;
00521   case ENUM_PERIOD_DAYS:    llDelta *= CVT_DAYS;     break;
00522   case ENUM_PERIOD_HOURS:   llDelta *= CVT_HOURS;    break;
00523   case ENUM_PERIOD_MINUTES: llDelta *= CVT_MINUTES;  break;
00524   case ENUM_PERIOD_SECONDS:          break;
00525   default:
00526       fSysTimeDelta = TRUE;
00527       break;
00528     }
00529     if (fSysTimeDelta)
00530     {
00531   SYSTEMTIME SystemTime;
00532
00533   FileTimeToSystemTime(&llft.ft, &SystemTime);
00534   switch (enumPeriod)
00535   {
00536       case ENUM_PERIOD_MONTHS:
00537     if (0 > lDelta)
00538     {
00539         DWORD dwDelta = (DWORD) -lDelta;
00540
00541         SystemTime.wYear -= (WORD) (dwDelta / 12) + 1;
00542         SystemTime.wMonth += 12 - (WORD) (dwDelta % 12);
00543     }
00544     else
00545     {
00546         SystemTime.wMonth = (WORD) lDelta + SystemTime.wMonth;
00547     }
00548     if (12 < SystemTime.wMonth)
00549     {
00550         SystemTime.wYear += (SystemTime.wMonth - 1) / 12;
00551         SystemTime.wMonth = ((SystemTime.wMonth - 1) % 12) + 1;
00552     }
00553     break;
00554
00555       case ENUM_PERIOD_YEARS:
00556     SystemTime.wYear = (WORD) lDelta + SystemTime.wYear;
00557     break;
00558
00559       default:
00560     SystemTime.wYear += 1;
00561     break;
00562   }
00563
00564 DoConvert:
00565         if (!SystemTimeToFileTime(&SystemTime, &llft.ft))
00566         {
00567             if (GetLastError() != ERROR_INVALID_PARAMETER)
00568             {
00569                 assert(!"Unable to do time conversion");
00570                 return;
00571             }
00572
00573             // In some cases we'll convert to an invalid month-end
00574
00575             // only one month changes length from year to year
00576             if (SystemTime.wMonth == 2)
00577             {
00578                 // > 29? try leap year
00579                 if (SystemTime.wDay > 29)
00580                 {
00581                     SystemTime.wDay = 29;
00582                     goto DoConvert;
00583                 }
00584                 // == 29? try non-leap year
00585                 else if (SystemTime.wDay == 29)
00586                 {
00587                     SystemTime.wDay = 28;
00588                     goto DoConvert;
00589                 }
00590             }
00591             // sept (9), apr(4), jun(6), nov(11) all have 30 days
00592             else if ((SystemTime.wMonth == 9) ||
00593                      (SystemTime.wMonth == 4) ||
00594                      (SystemTime.wMonth == 6) ||
00595                      (SystemTime.wMonth == 11))
00596             {
00597                 if (SystemTime.wDay > 30)
00598                 {
00599                     SystemTime.wDay = 30;
00600                     goto DoConvert;
00601                 }
00602             }
00603
00604             // should never get here
00605             assert(!"Month/year processing: inaccessible code");
00606             return;
00607         }
00608     }
00609     else
00610     {
00611   llft.ll += llDelta * CVT_BASE;
00612     }
00613     *pft = llft.ft;
00614 }
00615
00616
00617 HRESULT
00618 ceMakeExprDate(
00619     IN OUT DATE *pDate,
00620     IN LONG lDelta,
00621     IN enum ENUM_PERIOD enumPeriod)
00622 {
00623     HRESULT hr;
00624     FILETIME ft;
00625
00626     hr = ceDateToFileTime(pDate, &ft);
00627     _JumpIfError(hr, error, "ceDateToFileTime");
00628
00629     ceMakeExprDateTime(&ft, lDelta, enumPeriod);
00630
00631     hr = ceFileTimeToDate(&ft, pDate);
00632     _JumpIfError(hr, error, "ceFileTimeToDate");
00633
00634 error:
00635     return(hr);
00636 }
00637
00638
00639 typedef struct _UNITSTABLE
00640 {
00641     WCHAR const     *pwszString;
00642     enum ENUM_PERIOD enumPeriod;
00643 } UNITSTABLE;
00644
00645
00646 UNITSTABLE g_aut[] =
00647 {
00648     { wszPERIODSECONDS, ENUM_PERIOD_SECONDS },
00649     { wszPERIODMINUTES, ENUM_PERIOD_MINUTES },
00650     { wszPERIODHOURS,   ENUM_PERIOD_HOURS },
00651     { wszPERIODDAYS,    ENUM_PERIOD_DAYS },
00652     { wszPERIODWEEKS,   ENUM_PERIOD_WEEKS },
00653     { wszPERIODMONTHS,  ENUM_PERIOD_MONTHS },
00654     { wszPERIODYEARS,   ENUM_PERIOD_YEARS },
00655 };
00656 #define CUNITSTABLEMAX  (sizeof(g_aut)/sizeof(g_aut[0]))
00657
00658
00659 HRESULT
00660 ceTranslatePeriodUnits(
00661     IN WCHAR const *pwszPeriod,
00662     IN LONG lCount,
00663     OUT enum ENUM_PERIOD *penumPeriod,
00664     OUT LONG *plCount)
00665 {
00666     HRESULT hr;
00667     UNITSTABLE const *put;
00668
00669     for (put = g_aut; put < &g_aut[CUNITSTABLEMAX]; put++)
00670     {
00671   if (0 == celstrcmpiL(pwszPeriod, put->pwszString))
00672   {
00673       *penumPeriod = put->enumPeriod;
00674       if (0 > lCount)
00675       {
00676     lCount = MAXLONG;
00677       }
00678       *plCount = lCount;
00679       hr = S_OK;
00680       goto error;
00681   }
00682     }
00683     hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00684
00685 error:
00686     return(hr);
00687 }
00688
00689
00690 //+-------------------------------------------------------------------------
00691 // ceVerifyObjIdA - verify the passed pszObjId is valid as per X.208
00692 //
00693 // Encode and Decode the Object Id and make sure it suvives the round trip.
00694 // The first number must be 0, 1 or 2.
00695 // Enforce all characters are digits and dots.
00696 // Enforce that no dot starts or ends the Object Id, and disallow double dots.
00697 // Enforce there is at least one dot separator.
00698 // If the first number is 0 or 1, the second number must be between 0 & 39.
00699 // If the first number is 2, the second number can be any value.
00700 //--------------------------------------------------------------------------
00701
00702 HRESULT
00703 ceVerifyObjIdA(
00704     IN CHAR const *pszObjId)
00705 {
00706     HRESULT hr;
00707     BYTE *pbEncoded = NULL;
00708     DWORD cbEncoded;
00709     CRYPT_ATTRIBUTE ainfo;
00710     CRYPT_ATTRIBUTE *painfo = NULL;
00711     DWORD cbainfo;
00712     char const *psz;
00713     int i;
00714
00715     ainfo.pszObjId = const_cast<char *>(pszObjId);
00716     ainfo.cValue = 0;
00717     ainfo.rgValue = NULL;
00718
00719     if (!ceEncodeObject(
00720         X509_ASN_ENCODING,
00721         PKCS_ATTRIBUTE,
00722         &ainfo,
00723         0,
00724         FALSE,
00725         &pbEncoded,
00726         &cbEncoded))
00727     {
00728   hr = ceHLastError();
00729   _JumpError(hr, error, "ceEncodeObject");
00730     }
00731
00732     if (!ceDecodeObject(
00733         X509_ASN_ENCODING,
00734         PKCS_ATTRIBUTE,
00735         pbEncoded,
00736         cbEncoded,
00737         FALSE,
00738         (VOID **) &painfo,
00739         &cbainfo))
00740     {
00741   hr = ceHLastError();
00742   _JumpError(hr, error, "ceDecodeObject");
00743     }
00744
00745     hr = E_INVALIDARG;
00746     if (0 != strcmp(ainfo.pszObjId, painfo->pszObjId))
00747     {
00748   _JumpError(hr, error, "bad ObjId: decode mismatch");
00749     }
00750     for (psz = painfo->pszObjId; '\0' != *psz; psz++)
00751     {
00752   // must be a digit or a dot separator
00753
00754   if (!isdigit(*psz))
00755   {
00756       if ('.' != *psz)
00757       {
00758     _JumpError(hr, error, "bad ObjId: bad char");
00759       }
00760
00761       // can't have dot at start, double dots or dot at end
00762
00763       if (psz == painfo->pszObjId || '.' == psz[1] || '\0' == psz[1])
00764       {
00765     _JumpError(hr, error, "bad ObjId: dot location");
00766       }
00767   }
00768     }
00769     psz = strchr(painfo->pszObjId, '.');
00770     if (NULL == psz)
00771     {
00772   _JumpError(hr, error, "bad ObjId: must have at least one dot");
00773     }
00774     i = atoi(painfo->pszObjId);
00775     switch (i)
00776     {
00777   case 0:
00778   case 1:
00779       i = atoi(++psz);
00780       if (0 > i || 39 < i)
00781       {
00782     _JumpError(hr, error, "bad ObjId: 0. or 1. must be followed by 0..39");
00783       }
00784       break;
00785
00786   case 2:
00787       break;
00788
00789   default:
00790       _JumpError(hr, error, "bad ObjId: must start with 0, 1 or 2");
00791     }
00792     hr = S_OK;
00793
00794 error:
00795     if (NULL != pbEncoded)
00796     {
00797       LocalFree(pbEncoded);
00798     }
00799     if (NULL != painfo)
00800     {
00801       LocalFree(painfo);
00802     }
00803     return(hr);
00804 }
00805
00806
00807 HRESULT
00808 ceVerifyObjId(
00809     IN WCHAR const *pwszObjId)
00810 {
00811     HRESULT hr;
00812     CHAR *pszObjId = NULL;
00813
00814     if (!ceConvertWszToSz(&pszObjId, pwszObjId, -1))
00815     {
00816   hr = E_OUTOFMEMORY;
00817   _JumpError(hr, error, "ceConvertWszToSz");
00818     }
00819     hr = ceVerifyObjIdA(pszObjId);
00820     _JumpIfErrorStr(hr, error, "ceVerifyObjIdA", pwszObjId);
00821
00822 error:
00823     if (NULL != pszObjId)
00824     {
00825       LocalFree(pszObjId);
00826     }
00827     return(hr);
00828 }
00829
00830
00831 HRESULT
00832 ceVerifyAltNameString(
00833     IN LONG NameChoice,
00834     IN BSTR strName)
00835 {
00836     HRESULT hr = S_OK;
00837     CERT_ALT_NAME_INFO AltName;
00838     CERT_ALT_NAME_ENTRY Entry;
00839     CERT_OTHER_NAME OtherName;
00840     char *pszObjectId = NULL;
00841     DWORD cbEncoded;
00842
00843     ZeroMemory(&AltName, sizeof(AltName));
00844     AltName.cAltEntry = 1;
00845     AltName.rgAltEntry = &Entry;
00846
00847     ZeroMemory(&Entry, sizeof(Entry));
00848     Entry.dwAltNameChoice = NameChoice;
00849
00850     switch (NameChoice)
00851     {
00852   case CERT_ALT_NAME_RFC822_NAME:
00853       Entry.pwszRfc822Name = strName;
00854       break;
00855
00856   case CERT_ALT_NAME_DNS_NAME:
00857       Entry.pwszDNSName = strName;
00858       break;
00859
00860   case CERT_ALT_NAME_URL:
00861       Entry.pwszURL = strName;
00862       break;
00863
00864   case CERT_ALT_NAME_REGISTERED_ID:
00865       if (!ceConvertWszToSz(&pszObjectId, strName, -1))
00866       {
00867     hr = E_OUTOFMEMORY;
00868     ceERRORPRINTLINE("ceConvertWszToSz", hr);
00869     goto error;
00870       }
00871       Entry.pszRegisteredID = pszObjectId;
00872       break;
00873
00874   case CERT_ALT_NAME_OTHER_NAME:
00875       Entry.pOtherName = &OtherName;
00876       OtherName.pszObjId = szOID_NT_PRINCIPAL_NAME;
00877       OtherName.Value.cbData = SysStringByteLen(strName);
00878       OtherName.Value.pbData = (BYTE *) strName;
00879       break;
00880
00881   case CERT_ALT_NAME_DIRECTORY_NAME:
00882       Entry.DirectoryName.cbData = SysStringByteLen(strName);
00883       Entry.DirectoryName.pbData = (BYTE *) strName;
00884       break;
00885
00886   case CERT_ALT_NAME_IP_ADDRESS:
00887       Entry.IPAddress.cbData = SysStringByteLen(strName);
00888       Entry.IPAddress.pbData = (BYTE *) strName;
00889       break;
00890
00891   //case CERT_ALT_NAME_X400_ADDRESS:
00892   //case CERT_ALT_NAME_EDI_PARTY_NAME:
00893   default:
00894       hr = E_INVALIDARG;
00895       ceERRORPRINTLINE("NameChoice", hr);
00896       goto error;
00897
00898     }
00899
00900     // Encode CERT_ALT_NAME_INFO:
00901
00902     if (!CryptEncodeObject(
00903         X509_ASN_ENCODING,
00904         X509_ALTERNATE_NAME,
00905         &AltName,
00906         NULL,
00907         &cbEncoded))
00908     {
00909   hr = ceHLastError();
00910   ceERRORPRINTLINE("ceEncodeObject", hr);
00911   goto error;
00912     }
00913
00914 error:
00915     if (NULL != pszObjectId)
00916     {
00917   LocalFree(pszObjectId);
00918     }
00919     return(hr);
00920 }
00921
00922
00923 HRESULT
00924 ceDispatchSetErrorInfoSub(
00925     IN HRESULT hrError,
00926     OPTIONAL IN WCHAR const *pwszIDispatchMethod,
00927     OPTIONAL IN WCHAR const *pwszDescription,
00928     OPTIONAL IN WCHAR const *pwszSource,
00929     OPTIONAL IN IID const *piid,
00930     OPTIONAL IN WCHAR const *pwszHelpFile,
00931     IN DWORD dwHelpFileContext)
00932 {
00933     HRESULT hr;
00934     WCHAR const *pwszError = NULL;
00935     ICreateErrorInfo *pCreateErrorInfo = NULL;
00936     IErrorInfo *pErrorInfo = NULL;
00937
00938     if (NULL != pwszIDispatchMethod)
00939     {
00940   pwszError = ceGetErrorMessageText(hrError, TRUE);
00941     }
00942
00943     hr = CreateErrorInfo(&pCreateErrorInfo);
00944     _JumpIfError(hr, error, "CreateErrorInfo");
00945
00946     if (NULL != piid)
00947     {
00948   hr = pCreateErrorInfo->SetGUID(*piid);
00949   _PrintIfError(hr, "SetGUID");
00950     }
00951     if (NULL != pwszSource)
00952     {
00953   hr = pCreateErrorInfo->SetSource(const_cast<WCHAR *>(pwszSource));
00954   _PrintIfError(hr, "SetSource");
00955     }
00956     if (NULL != pwszDescription)
00957     {
00958   hr = pCreateErrorInfo->SetDescription(
00959           const_cast<WCHAR *>(pwszDescription));
00960   _PrintIfError(hr, "SetDescription");
00961     }
00962     if (NULL != pwszHelpFile)
00963     {
00964   hr = pCreateErrorInfo->SetHelpFile(const_cast<WCHAR *>(pwszHelpFile));
00965   _PrintIfError(hr, "SetHelpFile");
00966
00967   hr = pCreateErrorInfo->SetHelpContext(dwHelpFileContext);
00968   _PrintIfError(hr, "SetHelpContext");
00969     }
00970
00971     hr = pCreateErrorInfo->QueryInterface(
00972             IID_IErrorInfo,
00973             (VOID **) &pErrorInfo);
00974     _JumpIfError(hr, error, "QueryInterface");
00975
00976     SetErrorInfo(0, pErrorInfo);
00977     hr = S_OK;
00978
00979 error:
00980     if (NULL != pwszError)
00981     {
00982   LocalFree(const_cast<WCHAR *>(pwszError));
00983     }
00984     if (NULL != pErrorInfo)
00985     {
00986   pErrorInfo->Release();
00987     }
00988     if (NULL != pCreateErrorInfo)
00989     {
00990   pCreateErrorInfo->Release();
00991     }
00992     return(hr);
00993 }
00994
00995
00996 HRESULT
00997 ceDispatchSetErrorInfo(
00998     IN HRESULT hrError,
00999     IN WCHAR const *pwszDescription,
01000     OPTIONAL IN WCHAR const *pwszProgId,
01001     OPTIONAL IN IID const *piid)
01002 {
01003     HRESULT hr;
01004     WCHAR const *pwszError = NULL;
01005     WCHAR *pwszText = NULL;
01006
01007     if (NULL == pwszDescription)
01008     {
01009         hr = E_POINTER;
01010   _JumpError(hr, error, "NULL pointer");
01011     }
01012     assert(FAILED(hrError));
01013     pwszError = ceGetErrorMessageText(hrError, TRUE);
01014     if (NULL == pwszError)
01015     {
01016   _PrintError(E_OUTOFMEMORY, "myGetErrorMessageText");
01017     }
01018     else
01019     {
01020   pwszText = (WCHAR *) LocalAlloc(
01021       LMEM_FIXED,
01022       (wcslen(pwszDescription) + 1 + wcslen(pwszError) + 1) *
01023        sizeof(WCHAR));
01024   if (NULL == pwszText)
01025   {
01026       _PrintError(E_OUTOFMEMORY, "LocalAlloc");
01027   }
01028   else
01029   {
01030       wcscpy(pwszText, pwszDescription);
01031       wcscat(pwszText, L" ");
01032       wcscat(pwszText, pwszError);
01033   }
01034     }
01035     hr = ceDispatchSetErrorInfoSub(
01036       hrError,
01037       NULL,   // pwszIDispatchMethod
01038       NULL != pwszText?
01039           pwszText : const_cast<WCHAR *>(pwszDescription),
01040       pwszProgId,
01041       piid,
01042       NULL,   // pwszHelpFile
01043       0);   // dwHelpFileContext
01044     _PrintIfError(hr, "ceDispatchSetErrorInfoSub");
01045
01046 error:
01047     if (NULL != pwszText)
01048     {
01049   LocalFree(pwszText);
01050     }
01051     if (NULL != pwszError)
01052     {
01053   LocalFree(const_cast<WCHAR *>(pwszError));
01054     }
01055     return(hrError);  // return input error!
01056 }
01057
01058
01059 int
01060 ceWtoI(
01061     IN WCHAR const *string,
01062     OUT BOOL *pfValid)
01063 {
01064     HRESULT hr;
01065     WCHAR szBuf[16];
01066     WCHAR *szTmp = szBuf;
01067     int cTmp = ARRAYSIZE(szBuf);
01068     int i = 0;
01069     WCHAR const *pwsz;
01070     BOOL fSawDigit = FALSE;
01071
01072     if (pfValid == NULL)
01073     {
01074         hr = E_POINTER;
01075         _JumpError(hr, error, "NULLPARAM");
01076     }
01077     *pfValid = FALSE;
01078
01079     assert(NULL != pfValid);
01080     cTmp = FoldString(
01081         MAP_FOLDDIGITS,
01082         string,
01083         -1,
01084         szTmp,
01085         cTmp);
01086     if (cTmp == 0)
01087     {
01088         hr = ceHLastError();
01089         if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) == hr)
01090         {
01091             hr = S_OK;
01092             cTmp = FoldString(
01093                 MAP_FOLDDIGITS,
01094                 string,
01095                 -1,
01096                 NULL,
01097                 0);
01098
01099             szTmp = (WCHAR*)LocalAlloc(LMEM_FIXED, cTmp*sizeof(WCHAR));
01100       if (NULL == szTmp)
01101       {
01102     hr = E_OUTOFMEMORY;
01103     _JumpError(hr, error, "LocalAlloc");
01104       }
01105
01106             cTmp = FoldString(
01107                 MAP_FOLDDIGITS,
01108                 string,
01109                 -1,
01110                 szTmp,
01111                 cTmp);
01112
01113             if (cTmp == 0)
01114                 hr = ceHLastError();
01115         }
01116         _JumpIfError(hr, error, "FoldString");
01117     }
01118     pwsz = szTmp;
01119     while (iswspace(*pwsz))
01120     {
01121   pwsz++;
01122     }
01123     while (iswdigit(*pwsz))
01124     {
01125   fSawDigit = TRUE;
01126   pwsz++;
01127     }
01128     while (iswspace(*pwsz))
01129     {
01130   pwsz++;
01131     }
01132     if (L'\0' == *pwsz)
01133     {
01134   *pfValid = fSawDigit;
01135     }
01136     i = _wtoi(szTmp);
01137
01138 error:
01139     if (szTmp && (szTmp != szBuf))
01140        LocalFree(szTmp);
01141
01142     return i;
01143 }
01144
01145
01146 HRESULT
01147 ceGetMachineDnsName(
01148     OUT WCHAR **ppwszDnsName)
01149 {
01150     HRESULT hr;
01151     WCHAR *pwszDnsName = NULL;
01152     DWORD cwc;
01153     COMPUTER_NAME_FORMAT NameType = ComputerNameDnsFullyQualified;
01154
01155     *ppwszDnsName = NULL;
01156     while (TRUE)
01157     {
01158   cwc = 0;
01159   if (!GetComputerNameEx(NameType, NULL, &cwc))
01160   {
01161       hr = ceHLastError();
01162       if (HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) == hr &&
01163     ComputerNameDnsFullyQualified == NameType)
01164       {
01165     _PrintError(hr, "GetComputerNameEx(DnsFullyQualified) -- switching to NetBIOS");
01166     NameType = ComputerNameNetBIOS;
01167     continue;
01168       }
01169       if (HRESULT_FROM_WIN32(ERROR_MORE_DATA) != hr)
01170       {
01171     _JumpError(hr, error, "GetComputerNameEx");
01172       }
01173       break;
01174   }
01175     }
01176     pwszDnsName = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
01177     if (NULL == pwszDnsName)
01178     {
01179   hr = E_OUTOFMEMORY;
01180   _JumpError(hr, error, "LocalAlloc");
01181     }
01182
01183     if (!GetComputerNameEx(NameType, pwszDnsName, &cwc))
01184     {
01185   hr = ceHLastError();
01186   _JumpError(hr, error, "GetComputerNameEx");
01187     }
01188
01189     *ppwszDnsName = pwszDnsName;
01190     pwszDnsName = NULL;
01191     hr = S_OK;
01192
01193 error:
01194     if (NULL != pwszDnsName)
01195     {
01196   LocalFree(pwszDnsName);
01197     }
01198     return(hr);
01199 }
01200
01201
01202 HRESULT
01203 ceGetComputerNames(
01204     OUT WCHAR **ppwszDnsName,
01205     OUT WCHAR **ppwszOldName)
01206 {
01207     HRESULT hr;
01208     DWORD cwc;
01209     WCHAR *pwszOldName = NULL;
01210
01211     *ppwszOldName = NULL;
01212     *ppwszDnsName = NULL;
01213
01214     cwc = MAX_COMPUTERNAME_LENGTH + 1;
01215     pwszOldName = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
01216     if (NULL == pwszOldName)
01217     {
01218       hr = E_OUTOFMEMORY;
01219       _JumpError(hr, error, "LocalAlloc");
01220     }
01221     if (!GetComputerName(pwszOldName, &cwc))
01222     {
01223         hr = ceHLastError();
01224         _JumpError(hr, error, "GetComputerName");
01225     }
01226
01227     hr = ceGetMachineDnsName(ppwszDnsName);
01228     _JumpIfError(hr, error, "ceGetMachineDnsName");
01229
01230     *ppwszOldName = pwszOldName;
01231     pwszOldName = NULL;
01232
01233 error:
01234     if (NULL != pwszOldName)
01235     {
01236   LocalFree(pwszOldName);
01237     }
01238     return(hr);
01239 }
01240
01241
01242 HRESULT
01243 _IsConfigLocal(
01244     IN WCHAR const *pwszConfig,
01245     IN WCHAR const *pwszDnsName,
01246     IN WCHAR const *pwszOldName,
01247     OPTIONAL OUT WCHAR **ppwszMachine,
01248     OUT BOOL *pfLocal)
01249 {
01250     HRESULT hr;
01251     WCHAR *pwszMachine = NULL;
01252     WCHAR const *pwsz;
01253     DWORD cwc;
01254
01255     *pfLocal = FALSE;
01256     if (NULL != ppwszMachine)
01257     {
01258   *ppwszMachine = NULL;
01259     }
01260
01261     while (L'\\' == *pwszConfig)
01262     {
01263   pwszConfig++;
01264     }
01265     pwsz = wcschr(pwszConfig, L'\\');
01266     if (NULL != pwsz)
01267     {
01268   cwc = SAFE_SUBTRACT_POINTERS(pwsz, pwszConfig);
01269     }
01270     else
01271     {
01272   cwc = wcslen(pwszConfig);
01273     }
01274     pwszMachine = (WCHAR *) LocalAlloc(LMEM_FIXED, (cwc + 1) * sizeof(WCHAR));
01275     if (NULL == pwszMachine)
01276     {
01277   hr = E_OUTOFMEMORY;
01278   _JumpError(hr, error, "LocalAlloc");
01279     }
01280     CopyMemory(pwszMachine, pwszConfig, cwc * sizeof(WCHAR));
01281     pwszMachine[cwc] = L'\0';
01282
01283     if (0 == celstrcmpiL(pwszMachine, pwszDnsName) ||
01284   0 == celstrcmpiL(pwszMachine, pwszOldName))
01285     {
01286   *pfLocal = TRUE;
01287     }
01288     if (NULL != ppwszMachine)
01289     {
01290   *ppwszMachine = pwszMachine;
01291   pwszMachine = NULL;
01292     }
01293     hr = S_OK;
01294
01295 error:
01296     if (NULL != pwszMachine)
01297     {
01298   LocalFree(pwszMachine);
01299     }
01300     return(hr);
01301 }
01302
01303
01304 HRESULT
01305 ceIsConfigLocal(
01306     IN WCHAR const *pwszConfig,
01307     OPTIONAL OUT WCHAR **ppwszMachine,
01308     OUT BOOL *pfLocal)
01309 {
01310     HRESULT hr;
01311     WCHAR *pwszDnsName = NULL;
01312     WCHAR *pwszOldName = NULL;
01313
01314     *pfLocal = FALSE;
01315     if (NULL != ppwszMachine)
01316     {
01317   *ppwszMachine = NULL;
01318     }
01319
01320     hr = ceGetComputerNames(&pwszDnsName, &pwszOldName);
01321     _JumpIfError(hr, error, "ceGetComputerNames");
01322
01323     hr = _IsConfigLocal(
01324         pwszConfig,
01325         pwszDnsName,
01326         pwszOldName,
01327         ppwszMachine,
01328         pfLocal);
01329     _JumpIfError(hr, error, "_IsConfigLocal");
01330
01331 error:
01332     if (NULL != pwszDnsName)
01333     {
01334   LocalFree(pwszDnsName);
01335     }
01336     if (NULL != pwszOldName)
01337     {
01338   LocalFree(pwszOldName);
01339     }
01340     return(hr);
01341 }
01342
01343
01344 HRESULT
01345 ceBuildPathAndExt(
01346     IN WCHAR const *pwszDir,
01347     IN WCHAR const *pwszFile,
01348     OPTIONAL IN WCHAR const *pwszExt,
01349     OUT WCHAR **ppwszPath)
01350 {
01351     HRESULT hr;
01352     WCHAR *pwsz;
01353     DWORD cwc;
01354
01355     *ppwszPath = NULL;
01356     cwc = wcslen(pwszDir) + 1 + wcslen(pwszFile) + 1;
01357     if (NULL != pwszExt)
01358     {
01359   cwc += wcslen(pwszExt);
01360     }
01361
01362     pwsz = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
01363     if (NULL == pwsz)
01364     {
01365   hr = E_OUTOFMEMORY;
01366   _JumpError(hr, error, "LocalAlloc");
01367     }
01368     wcscpy(pwsz, pwszDir);
01369     if (L'\\' != pwsz[wcslen(pwsz) - 1])
01370     {
01371   wcscat(pwsz, L"\\");
01372     }
01373     wcscat(pwsz, pwszFile);
01374     if (NULL != pwszExt)
01375     {
01376   wcscat(pwsz, pwszExt);
01377     }
01378     *ppwszPath = pwsz;
01379     hr = S_OK;
01380
01381 error:
01382     return(hr);
01383 }
01384
01385
01386 // Locale-independent case-ignore string compare
01387
01388 int
01389 celstrcmpiL(
01390     IN WCHAR const *pwsz1,
01391     IN WCHAR const *pwsz2)
01392 {
01393     // CSTR_LESS_THAN(1) - CSTR_EQUAL(2)    == -1 string 1 less than string 2
01394     // CSTR_EQUAL(2) - CSTR_EQUAL(2)        == 0 string 1 equal to string 2
01395     // CSTR_GREATER_THAN(3) - CSTR_EQUAL(2) == 1 string 1 greater than string 2
01396
01397     return(CompareString(
01398     LOCALE_INVARIANT,
01399     NORM_IGNORECASE,
01400     pwsz1,
01401     -1,
01402     pwsz2,
01403     -1) -
01404       CSTR_EQUAL);
01405 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Factory.h Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Factory.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Factory.h : Declaration of the CFactory
00006
00007 #ifndef __FACTORY_H_
00008 #define __FACTORY_H_
00009
00010 #include "resource.h"       // main symbols
00011 #include "behavior.h"
00012
00013 /////////////////////////////////////////////////////////////////////////////
00014 // CFactory
00015 class ATL_NO_VTABLE CFactory :
00016   public CComObjectRootEx<CComSingleThreadModel>,
00017   public CComCoClass<CFactory, &CLSID_Factory>,
00018   public IObjectSafetyImpl<CFactory, INTERFACESAFE_FOR_UNTRUSTED_CALLER>,
00019   public IElementBehaviorFactory
00020 {
00021 public:
00022   CFactory()
00023   {
00024   }
00025
00026 DECLARE_REGISTRY_RESOURCEID(IDR_FACTORY)
00027
00028 BEGIN_COM_MAP(CFactory)
00029   COM_INTERFACE_ENTRY(IElementBehaviorFactory)
00030   COM_INTERFACE_ENTRY(IObjectSafety)
00031 END_COM_MAP()
00032
00033 // IFactory
00034 public:
00035   STDMETHOD(FindBehavior)(BSTR bstrBehavior,
00036                             BSTR bstrBehaviorUrl,
00037               IElementBehaviorSite* pSite,
00038               IElementBehavior** ppBehavior);
00039
00040 // IObjectSafety override
00041   STDMETHOD(SetInterfaceSafetyOptions)(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
00042   {
00043     m_dwCurrentSafety = m_dwCurrentSafety  & ~dwEnabledOptions | dwOptionSetMask;
00044     return S_OK;
00045   }
00046 };
00047
00048 #endif //__FACTORY_H_
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/plgtermfilter.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

plgtermfilter.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     PlgTstFilter.cpp
00008
00009 Abstract:
00010
00011     Implementation of the Plg Filter class (CPlgFilter)
00012
00013 --*/
00014
00015 #include "stdafx.h"
00016 #include <initguid.h>
00017
00018 #include "PlgTermPin.h" //includes PlgTermFilter.h
00019
00020 #include "GUIDs.h"
00021
00022
00023 /*++
00024 Constructor CPlgFilter
00025 --*/
00026 CPlgFilter::CPlgFilter(  )
00027     : CBaseFilter(_T("PlgFilter"), NULL, (CCritSec *) this, CLSID_PlgSampleFilter),
00028     m_pInputPin(NULL),
00029     m_lpWaveFormatEx(NULL),
00030     m_pPlgEventSink(NULL)
00031 {
00032     LOG((MSP_TRACE, "CPlgFilter::CPlgFilter - enter"));
00033 }
00034
00035 /*++
00036 Destructor CPlgFilter
00037 --*/
00038 CPlgFilter::~CPlgFilter()
00039 {
00040     LOG((MSP_TRACE, "CPlgFilter::~CPlgFilter - enter"));
00041
00042     //
00043     // Delete the input pin
00044     //
00045     if(m_pInputPin)
00046     {
00047         delete m_pInputPin;
00048     }
00049
00050     m_pPlgEventSink = NULL;
00051
00052     //
00053     // Delete the WAVEFORMATEX
00054     //
00055     if(m_lpWaveFormatEx)
00056     {
00057         CoTaskMemFree(m_lpWaveFormatEx);
00058     }
00059
00060     LOG((MSP_TRACE, "CPlgFilter::~CPlgFilter - exit"));
00061
00062 }
00063
00064 /*++
00065 GetPinCount
00066 --*/
00067
00068 int CPlgFilter::GetPinCount()
00069 {
00070     LOG((MSP_TRACE, "CPlgFilter::GetPinCount - enter"));
00071
00072     LOG((MSP_TRACE, "CPlgFilter::GetPinCount - exit"));
00073     return 1;
00074 }
00075
00076 /*++
00077 GetPin
00078
00079 Description:
00080     Return the pin of the filter
00081 --*/
00082 CBasePin* CPlgFilter::GetPin(int nPinIndex)
00083 {
00084     LOG((MSP_TRACE, "CPlgFilter::GetPin - enter"));
00085
00086     //
00087     //check the index
00088     //
00089
00090     HRESULT hr = (0 == nPinIndex)?S_OK:E_FAIL;
00091
00092     LOG((MSP_TRACE, "CPlgFilter::GetPin - exit 0x%08x", hr));
00093
00094     return (hr == S_OK)? m_pInputPin : NULL;
00095
00096 }
00097
00098 /*++
00099 CreatePin
00100
00101 Description;
00102     Create the output pin CPlgFilter
00103 --*/
00104 HRESULT CPlgFilter::CreatePin( )
00105 {
00106     LOG((MSP_TRACE, "CPlgFilter::CreatePin - enter"));
00107     USES_CONVERSION;
00108
00109     CAutoLock lock(this);
00110
00111     HRESULT hr = S_OK;
00112
00113
00114     //
00115     // Already created?
00116     //
00117
00118     if (m_pInputPin)
00119     {
00120         LOG((MSP_TRACE, "CPlgFilter::CreatePin - exit, the pin already created"));
00121         return S_OK;
00122     }
00123
00124     //
00125     // Create the pin named using CLSID
00126     //
00127
00128     LPOLESTR lpolestrPinName = NULL;
00129     hr = StringFromCLSID(CLSID_PlgSamplePin, &lpolestrPinName);
00130     if (FAILED(hr))
00131     {
00132         LOG((MSP_ERROR, "StringFromCLSID 0x%08x", hr));
00133         return hr;
00134     }
00135
00136     //
00137     //create pin
00138     //
00139     m_pInputPin = new CPlgPin( this, &hr, OLE2W(lpolestrPinName));
00140
00141     //
00142     //clean up
00143     //
00144     ::CoTaskMemFree(lpolestrPinName);
00145
00146     //
00147     // Cannot allocate?
00148     //
00149
00150     if (m_pInputPin == NULL)
00151     {
00152         LOG((MSP_TRACE, "CPlgFilter::CreatePin - cannot create CPlgPin; returning E_OUTOFMEMORY"));
00153         return E_OUTOFMEMORY;
00154     }
00155
00156     //
00157     // Other things went wrong?
00158     //
00159
00160     if ( FAILED(hr) )
00161     {
00162         delete m_pInputPin;
00163         m_pInputPin = NULL;
00164     }
00165
00166     LOG((MSP_TRACE, "CPlgFilter::CreatePin - exit 0x%08x", hr));
00167     return hr;
00168 }
00169
00170 /*++
00171 Run
00172
00173 Description;
00174     Activate the pin, letting it know that we are moving to State_Running
00175 --*/
00176 HRESULT CPlgFilter::Run(
00177     IN  REFERENCE_TIME      tStart
00178     )
00179 {
00180     LOG((MSP_TRACE, "CPlgFilter::Run - enter"));
00181
00182     CAutoLock lock(this);
00183     HRESULT hr = NOERROR;
00184
00185     //
00186     // This will call Pause if currently stopped
00187     //
00188
00189     hr = CBaseFilter::Run(tStart);
00190
00191     LOG((MSP_TRACE, "CPlgFilter::Run - exit 0x%08x", hr));
00192
00193     return hr;
00194 }
00195
00196
00197 /*++
00198 Pause
00199
00200 Description;
00201     Activate the pin, letting it know that Paused will
00202     be the next state
00203 --*/
00204 HRESULT CPlgFilter::Pause(void)
00205 {
00206     LOG((MSP_TRACE, "CPlgFilter::Pause - enter"));
00207
00208     CAutoLock lock(this);
00209
00210     //
00211     // Check we can PAUSE given our current state
00212     //
00213
00214     if (m_State == State_Running)
00215     {
00216     }
00217
00218     //
00219     // tell the pin to go active or inactive and change state
00220     //
00221     HRESULT hr = CBaseFilter::Pause();
00222
00223     LOG((MSP_TRACE, "CPlgFilter::Pause - exit 0x%08x\n", hr));
00224     return hr;
00225 }
00226
00227
00228 /*++
00229 Stop
00230
00231 Description;
00232     Pass the current state to the pins Inactive method
00233 --*/
00234 HRESULT CPlgFilter::Stop(void)
00235 {
00236     LOG((MSP_TRACE, "CPlgFilter::Stop - enter"));
00237
00238     CAutoLock lock(this);
00239
00240     HRESULT hr = E_FAIL;
00241
00242     if (m_State != State_Stopped)
00243     {
00244
00245         // Pause the device if we were running
00246         if (m_State == State_Running)
00247         {
00248             hr = Pause();
00249             if (FAILED(hr))
00250             {
00251                 LOG((MSP_TRACE, "CPlgFilter::Stop - exit 0x%08x\n", hr));
00252                 return hr;
00253             }
00254         }
00255
00256         // Base class changes state and tells pin to go to inactive
00257         // the pin Inactive method will decommit our allocator which
00258         // we need to do before closing the device
00259
00260         hr = CBaseFilter::Stop();
00261     }
00262
00263     LOG((MSP_TRACE, "CPlgFilter::Stop - exit 0x%08x\n", hr));
00264     return hr;
00265 }
00266
00267
00268 HRESULT CPlgFilter::Initialize()
00269 {
00270
00271     LOG((MSP_TRACE, "CPlgFilter::Initialize - enter"));
00272
00273     HRESULT hr = CreatePin();
00274
00275     LOG((MSP_TRACE, "CPlgFilter::Initialize - exit 0x%08x\n", hr));
00276
00277     return hr;
00278
00279 }
00280
00281
00282 HRESULT CPlgFilter::InitializePrivate(ITPlgPrivEventSink* pSink )
00283 {
00284   m_pPlgEventSink = pSink;
00285   return S_OK;
00286 }
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/EventSink/TpcConpt.h Source File

  • TabletPC
  • EventSink

TpcConpt.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 // Module:
00012 //      TpcConpt.h
00013 //
00014 // Description:
00015 //      The header file for InkCollectorEvents, which is designed
00016 //      to be used by C++ applications as a base class for handling
00017 //      Ink Collector events. This base class is meant to be used
00018 //      as a template;  application-specific event handling should
00019 //      be handled by the derived class.  For an example of how to use
00020 //      this class, refer to CMyInkEvents in EventSink.h.
00021 //
00022 //      This file contains both the class definitions and the implementation
00023 //    of the methods.
00024 //
00025 //--------------------------------------------------------------------------
00026
00027 #ifndef TPCCONPT_H
00028 #define TPCCONPT_H
00029
00030 /////////////////////////////////////////////////////////
00031 //
00032 // class InkCollectorEvents
00033 //
00034 // The InkCollectorEvents class handles passing Ink Collector
00035 // events from the Ink Collector to the user of this class.
00036 // It sets up the connection between the InkCollector and
00037 // this class in AdviseInkCollector. In the Invoke method,
00038 // it converts the IDispatch event notification into a
00039 // call to a virtual function which the user of this class
00040 // can override to process a particular event.
00041 //
00042 // Two important points to consider when using this class:
00043 //
00044 // 1.  You must do more than simply override the event's
00045 // virtual function in order to handle the event. For
00046 // all but default events, you will have to call
00047 // IInkCollector::SetEventInterest to guarantee getting
00048 // an event. Stroke, CursorInRange, andCursorOutOfRange are
00049 // the only event interests that are on by default.
00050 //
00051 // 2.  This object marshals itself free threaded so all implemented
00052 // event handlers need to be free threaded as well. Of particular
00053 // importance is using Window's APIs, which may cause a switch to
00054 // another thread; the event handler is not guaranteed
00055 // to be running on the same thread as the window connected
00056 // with the Ink Collector.
00057 //
00058 /////////////////////////////////////////////////////////
00059 class InkCollectorEvents : public _IInkCollectorEvents
00060 {
00061 public:
00062
00063     //
00064     // IUnknown Interface
00065     //
00066   HRESULT __stdcall QueryInterface(
00067     REFIID riid,
00068         void **ppvObject)
00069     {
00070
00071         // Validate the input
00072         if (NULL == ppvObject)
00073         {
00074             return E_POINTER;
00075         }
00076
00077         // This object only supports IDispatch/_IInkCollectorEvents
00078         if ((riid == IID_IUnknown)
00079             || (riid == IID_IDispatch)
00080             || (riid == DIID__IInkCollectorEvents))
00081         {
00082             *ppvObject = (IDispatch *) this;
00083
00084             // Note: we do not AddRef here because the lifetime
00085             //  of this object does not depend on reference counting
00086             //  but on the duration of the connection set up by
00087             //  the user of this class.
00088
00089             return S_OK;
00090         }
00091         else if (riid == IID_IMarshal)
00092         {
00093             // Assert that the free threaded marshaller has been
00094             // initialized.  It is necessary to call Init() before
00095             // invoking this method.
00096             assert(NULL != m_punkFTM);
00097
00098             // Use free threaded marshalling.
00099             return m_punkFTM->QueryInterface(riid, ppvObject);
00100         }
00101
00102         return E_NOINTERFACE;
00103     }
00104
00105     virtual ULONG STDMETHODCALLTYPE AddRef()
00106     {
00107
00108         // Note: we do not AddRef here because the lifetime
00109         //  of this object does not depend on reference counting
00110         //  but on the duration of the connection set up by
00111         //  the user of this class.
00112         return 1;
00113     }
00114
00115     virtual ULONG STDMETHODCALLTYPE Release()
00116     {
00117
00118         // Note: we do not do Release here because the lifetime
00119         //  of this object does not depend on reference counting
00120         //  but on the duration of the connection set up by
00121         //  the user of this class.
00122         return 1;
00123     }
00124
00125     //
00126     // IDispatch Interface
00127     //
00128     STDMETHOD(GetTypeInfoCount)(UINT* pctinfo)
00129     {
00130         // This method is not needed for processing events.
00131         return E_NOTIMPL;
00132     }
00133
00134     STDMETHOD(GetTypeInfo)(
00135         UINT itinfo,
00136         LCID lcid,
00137         ITypeInfo** pptinfo)
00138     {
00139         // This method is not needed for processing events.
00140         return E_NOTIMPL;
00141     }
00142
00143     STDMETHOD(GetIDsOfNames)(
00144         REFIID riid,
00145         LPOLESTR* rgszNames,
00146         UINT cNames,
00147         LCID lcid,
00148         DISPID* rgdispid)
00149     {
00150         // This method is not needed for processing events.
00151         return E_NOTIMPL;
00152     }
00153
00154     // Invoke translates from IDispatch to an event callout
00155     //  that can be overriden by a subclass of this class.
00156     STDMETHOD(Invoke)(
00157         DISPID dispidMember,
00158         REFIID riid,
00159         LCID lcid,
00160         WORD /*wFlags*/,
00161         DISPPARAMS* pdispparams,
00162         VARIANT* pvarResult,
00163         EXCEPINFO* /*pexcepinfo*/,
00164         UINT* /*puArgErr*/)
00165     {
00166         switch(dispidMember)
00167         {
00168             case DISPID_ICEStroke:
00169                 Stroke(
00170                     (IInkCursor*) pdispparams->rgvarg[2].pdispVal,
00171                     (IInkStrokeDisp*) pdispparams->rgvarg[1].pdispVal,
00172                     (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal);
00173                 break;
00174
00175             case DISPID_ICECursorDown:
00176                 CursorDown(
00177                     (IInkCursor*) pdispparams->rgvarg[1].pdispVal,
00178                     (IInkStrokeDisp*) pdispparams->rgvarg[0].pdispVal);
00179                 break;
00180
00181             case DISPID_ICENewPackets:
00182                 NewPackets(
00183                     (IInkCursor*) pdispparams->rgvarg[3].pdispVal,
00184                     (IInkStrokeDisp*) pdispparams->rgvarg[2].pdispVal,
00185                     pdispparams->rgvarg[1].lVal,
00186                     pdispparams->rgvarg[0].pvarVal);
00187                 break;
00188
00189             case DISPID_IPEDblClick:
00190                 DblClick(
00191                     (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal);
00192                 break;
00193
00194             case DISPID_IPEMouseMove:
00195                 MouseMove(
00196                     (InkMouseButton) pdispparams->rgvarg[4].lVal,
00197                     (InkShiftKeyModifierFlags) pdispparams->rgvarg[3].lVal,
00198                     pdispparams->rgvarg[2].lVal,
00199                     pdispparams->rgvarg[1].lVal,
00200                     (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal);
00201                 break;
00202
00203             case DISPID_IPEMouseDown:
00204                 MouseDown(
00205                     (InkMouseButton) pdispparams->rgvarg[4].lVal,
00206                     (InkShiftKeyModifierFlags) pdispparams->rgvarg[3].lVal,
00207                     pdispparams->rgvarg[2].lVal,
00208                     pdispparams->rgvarg[1].lVal,
00209                     (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal);
00210                 break;
00211
00212             case DISPID_IPEMouseUp:
00213                 MouseUp(
00214                     (InkMouseButton) pdispparams->rgvarg[4].lVal,
00215                     (InkShiftKeyModifierFlags) pdispparams->rgvarg[3].lVal,
00216                     pdispparams->rgvarg[2].lVal,
00217                     pdispparams->rgvarg[1].lVal,
00218                     (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal);
00219                 break;
00220
00221             case DISPID_IPEMouseWheel:
00222                 MouseWheel(
00223                     (InkMouseButton) pdispparams->rgvarg[5].lVal,
00224                     (InkShiftKeyModifierFlags) pdispparams->rgvarg[4].lVal,
00225                     pdispparams->rgvarg[3].lVal,
00226                     pdispparams->rgvarg[2].lVal,
00227                     pdispparams->rgvarg[1].lVal,
00228                     (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal);
00229                 break;
00230
00231             case DISPID_ICENewInAirPackets:
00232                 NewInAirPackets(
00233                     (IInkCursor*) pdispparams->rgvarg[2].pdispVal,
00234                     pdispparams->rgvarg[1].lVal,
00235                     pdispparams->rgvarg[0].pvarVal);
00236                 break;
00237
00238             case DISPID_ICECursorButtonDown:
00239                 CursorButtonDown(
00240                     (IInkCursor*) pdispparams->rgvarg[1].pdispVal,
00241                     (IInkCursorButton*) pdispparams->rgvarg[0].pdispVal);
00242                 break;
00243
00244             case DISPID_ICECursorButtonUp:
00245                 CursorButtonUp(
00246                     (IInkCursor*) pdispparams->rgvarg[1].pdispVal,
00247                     (IInkCursorButton*) pdispparams->rgvarg[0].pdispVal);
00248                 break;
00249
00250             case DISPID_ICECursorInRange:
00251                 CursorInRange(
00252                     (IInkCursor*) pdispparams->rgvarg[2].pdispVal,
00253                     (VARIANT_BOOL) pdispparams->rgvarg[1].iVal,
00254                     pdispparams->rgvarg[0]);
00255                 break;
00256
00257             case DISPID_ICECursorOutOfRange:
00258                 CursorOutOfRange(
00259                     (IInkCursor*) pdispparams->rgvarg[0].pdispVal);
00260                 break;
00261
00262             case DISPID_ICESystemGesture:
00263                 SystemGesture(
00264                     (IInkCursor*) pdispparams->rgvarg[6].pdispVal,
00265                     (InkSystemGesture) pdispparams->rgvarg[5].lVal,
00266                     pdispparams->rgvarg[4].lVal,
00267                     pdispparams->rgvarg[3].lVal,
00268                     pdispparams->rgvarg[2].lVal,
00269                     pdispparams->rgvarg[1].bstrVal,
00270                     pdispparams->rgvarg[0].lVal);
00271                 break;
00272
00273             case DISPID_ICEGesture:
00274                 Gesture(
00275                     (IInkCursor*) pdispparams->rgvarg[3].pdispVal,
00276                     (IInkStrokes*) pdispparams->rgvarg[2].pdispVal,
00277                     pdispparams->rgvarg[1],
00278                     (VARIANT_BOOL *)pdispparams->rgvarg[0].pboolVal);
00279                 break;
00280
00281             case DISPID_ICETabletAdded:
00282                 TabletAdded(
00283                     (IInkTablet*) pdispparams->rgvarg[0].pdispVal);
00284                 break;
00285
00286             case DISPID_ICETabletRemoved:
00287                 TabletRemoved(
00288                     pdispparams->rgvarg[0].lVal);
00289                 break;
00290
00291             default:
00292                 break;
00293         }
00294
00295         return S_OK;
00296     }
00297
00298     //
00299     // Events
00300     //
00301
00302     virtual void Stroke(
00303         IInkCursor* Cursor,
00304         IInkStrokeDisp* Stroke,
00305         VARIANT_BOOL *Cancel)
00306     {
00307         // This is a place holder designed to be overridden by
00308         //  user of this class.
00309         return;
00310     }
00311
00312     virtual void CursorDown(
00313         IInkCursor* Cursor,
00314         IInkStrokeDisp* Stroke)
00315     {
00316         // This is a place holder designed to be overridden by
00317         //  user of this class.
00318         return;
00319     }
00320
00321     virtual void NewPackets(
00322         IInkCursor* Cursor,
00323         IInkStrokeDisp* Stroke,
00324         long PacketCount,
00325         VARIANT* PacketData)
00326     {
00327         // This is a place holder designed to be overridden by
00328         //  user of this class.
00329         return;
00330     }
00331
00332     virtual void DblClick(
00333         VARIANT_BOOL *Cancel)
00334     {
00335         // This is a place holder designed to be overridden by
00336         //  user of this class.
00337         return;
00338     }
00339
00340     virtual void MouseMove(
00341         InkMouseButton Button,
00342         InkShiftKeyModifierFlags Shift,
00343         long pX,
00344         long pY,
00345         VARIANT_BOOL *Cancel)
00346     {
00347         // This is a place holder designed to be overridden by
00348         //  user of this class.
00349         return;
00350     }
00351
00352     virtual void MouseDown(
00353         InkMouseButton Button,
00354         InkShiftKeyModifierFlags Shift,
00355         long pX,
00356         long pY,
00357         VARIANT_BOOL *Cancel)
00358     {
00359         // This is a place holder designed to be overridden by
00360         //  user of this class.
00361         return;
00362     }
00363
00364     virtual void MouseUp(
00365         InkMouseButton Button,
00366         InkShiftKeyModifierFlags Shift,
00367         long pX,
00368         long pY,
00369         VARIANT_BOOL *Cancel)
00370     {
00371         // This is a place holder designed to be overridden by
00372         //  user of this class.
00373         return;
00374     }
00375
00376     virtual void MouseWheel(
00377         InkMouseButton Button,
00378         InkShiftKeyModifierFlags Shift,
00379         long Delta,
00380         long X,
00381         long Y,
00382         VARIANT_BOOL *Cancel)
00383     {
00384         // This is a place holder designed to be overridden by
00385         //  user of this class.
00386         return;
00387     }
00388
00389     virtual void NewInAirPackets(
00390         IInkCursor* Cursor,
00391         long lPacketCount,
00392         VARIANT* PacketData)
00393     {
00394         // This is a place holder designed to be overridden by
00395         //  user of this class.
00396         return;
00397     }
00398
00399     virtual void CursorButtonDown(
00400         IInkCursor* Cursor,
00401         IInkCursorButton* Button)
00402     {
00403         // This is a place holder designed to be overridden by
00404         //  user of this class.
00405         return;
00406     }
00407
00408     virtual void CursorButtonUp(
00409         IInkCursor* Cursor,
00410         IInkCursorButton* Button)
00411     {
00412         // This is a place holder designed to be overridden by
00413         //  user of this class.
00414         return;
00415     }
00416
00417     virtual void CursorInRange(
00418         IInkCursor* Cursor,
00419         VARIANT_BOOL NewCursor,
00420         VARIANT ButtonsState)
00421     {
00422         // This is a place holder designed to be overridden by
00423         //  user of this class.
00424         return;
00425     }
00426
00427     virtual void CursorOutOfRange(
00428         IInkCursor* Cursor)
00429     {
00430         // This is a place holder designed to be overridden by
00431         //  user of this class.
00432         return;
00433     }
00434
00435     virtual void SystemGesture(
00436         IInkCursor* Cursor,
00437         InkSystemGesture Id,
00438         long X,
00439         long Y,
00440         long Modifier,
00441         BSTR Character,
00442         long CursorMode)
00443     {
00444         // This is a place holder designed to be overridden by
00445         //  user of this class.
00446         return;
00447     }
00448
00449     virtual void Gesture(
00450         IInkCursor* Cursor,
00451         IInkStrokes* Strokes,
00452         VARIANT Gestures,
00453         VARIANT_BOOL* Cancel)
00454     {
00455         // This is a place holder designed to be overridden by
00456         //  user of this class.
00457         return;
00458     }
00459
00460     virtual void TabletAdded(
00461         IInkTablet* Tablet)
00462     {
00463         // This is a place holder designed to be overridden by
00464         //  user of this class.
00465         return;
00466     }
00467
00468     virtual void TabletRemoved(
00469         long TabletId)
00470     {
00471         // This is a place holder designed to be overridden by
00472         //  user of this class.
00473         return;
00474     }
00475
00476     //
00477     // Methods
00478     //
00479
00480     // Constructor: initialize memory to null.
00481     InkCollectorEvents()
00482     {
00483         m_pIConnectionPoint = NULL;
00484         m_punkFTM = NULL;
00485     }
00486
00487     // Destructor: free resources
00488     ~InkCollectorEvents()
00489     {
00490         UnadviseInkCollector();
00491
00492         if (m_punkFTM != NULL)
00493         {
00494             m_punkFTM->Release();
00495         }
00496     }
00497
00498     // Init: set up free threaded marshaller.
00499     // It is necessary to call this method before using
00500     // this class to handle events.
00501     HRESULT Init()
00502     {
00503         return CoCreateFreeThreadedMarshaler(this, &m_punkFTM);
00504     }
00505
00506     // Set up connection between sink and Ink Collector
00507     HRESULT AdviseInkCollector(
00508         IInkCollector *pIInkCollector)
00509     {
00510         HRESULT hr = S_OK;
00511
00512         // Check to ensure that the sink is not currently connected
00513         // with another Ink Collector...
00514         if (NULL == m_pIConnectionPoint)
00515         {
00516             // Get the connection point container
00517             IConnectionPointContainer *pIConnectionPointContainer;
00518             hr = pIInkCollector->QueryInterface(
00519                 IID_IConnectionPointContainer,
00520                 (void **) &pIConnectionPointContainer);
00521
00522             if (FAILED(hr))
00523             {
00524                 return hr;
00525             }
00526
00527             // Find the connection point for Ink Collector events
00528             hr = pIConnectionPointContainer->FindConnectionPoint(
00529                 __uuidof(_IInkCollectorEvents), &m_pIConnectionPoint);
00530
00531             if (SUCCEEDED(hr))
00532             {
00533                 // Hook up sink to connection point
00534                 hr = m_pIConnectionPoint->Advise(this, &m_dwCookie);
00535             }
00536
00537             if (FAILED(hr))
00538             {
00539                 // Clean up after an error.
00540                 if (m_pIConnectionPoint)
00541                 {
00542                     m_pIConnectionPoint->Release();
00543                     m_pIConnectionPoint = NULL;
00544                 }
00545             }
00546
00547             // We don't need the connection point container any more.
00548             pIConnectionPointContainer->Release();
00549         }
00550         // If the sink is already connected to an Ink Collector, return a
00551         // failure; only one Ink Collector can be attached at any given time.
00552         else
00553         {
00554             hr = E_FAIL;
00555         }
00556
00557         return hr;
00558     }
00559
00560     // Remove the connection of the sink to the Ink Collector
00561     HRESULT UnadviseInkCollector()
00562     {
00563         HRESULT hr = S_OK;
00564
00565         // If there the ink collector is connected to the sink,
00566         // remove it.  Otherwise, do nothing (there is nothing
00567         // to unadvise).
00568         if (m_pIConnectionPoint != NULL)
00569         {
00570             hr = m_pIConnectionPoint->Unadvise(m_dwCookie);
00571             m_pIConnectionPoint->Release();
00572             m_pIConnectionPoint = NULL;
00573         }
00574
00575         return hr;
00576     }
00577
00578 private:
00579
00580     //
00581     //  Data Members
00582     //
00583
00584     // Connection point on InkCollector
00585     IConnectionPoint *m_pIConnectionPoint;
00586
00587     // Cookie returned from advise
00588     DWORD m_dwCookie;
00589
00590     // Free threaded marshaler.
00591     IUnknown *m_punkFTM;
00592 };
00593
00594 #endif // TPCCONPT_H
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/basesnap.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

basesnap.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  This file contains implementations for IClassFactory
00014 //             and the Snap-in's DLL exported functions
00015
00016
00017 #include <ObjBase.h>
00018 #include <InitGuid.h>
00019 #include "Globals.h"
00020 #include "BaseSnap.h"
00021 #include "CompData.h"
00022 #include "About.h"
00023 #include "Registry.h"
00024
00025
00026 #include "TraceMacro.h"
00027 #undef  MODULESTRING
00028 #define MODULESTRING  _T("BaseSnap")
00029
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 //  Implementation of IClassFactory for CComponentData
00033
00034 //---------------------------------------------------------------------------
00035 CClassFactory::CClassFactory( FACTORY_TYPE eFactoryType )
00036 {
00037   m_cRef = 0;
00038   m_FactoryType = eFactoryType;
00039
00040   InterlockedIncrement((long*)&g_uObjectCount);
00041 }
00042
00043
00044 //---------------------------------------------------------------------------
00045 CClassFactory::~CClassFactory()
00046 {
00047   InterlockedDecrement((long*)&g_uObjectCount);
00048 }
00049
00050
00051 //---------------------------------------------------------------------------
00052 STDMETHODIMP CClassFactory::QueryInterface
00053 (
00054   REFIID   riid,             //[in] Identifier of the requested interface
00055   LPVOID*  ppv               //[out] Address of requested interface
00056 )
00057 {
00058   if( NULL == ppv )
00059     return E_FAIL;
00060
00061   HRESULT hResult = E_NOINTERFACE;
00062   *ppv = NULL;
00063
00064   if( IsEqualIID(riid, IID_IUnknown) )
00065   {
00066     *ppv = static_cast<IClassFactory*>(this);
00067   }
00068   else if( IsEqualIID(riid, IID_IClassFactory) )
00069   {
00070     *ppv = static_cast<IClassFactory*>(this);
00071   }
00072
00073   if( *ppv )
00074   {
00075     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00076     hResult = S_OK;
00077   }
00078
00079   return hResult;
00080 }
00081
00082
00083 //---------------------------------------------------------------------------
00084 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00085 {
00086   return InterlockedIncrement( (long*)&m_cRef );
00087 }
00088
00089
00090 //---------------------------------------------------------------------------
00091 STDMETHODIMP_(ULONG) CClassFactory::Release()
00092 {
00093   if( 0 == InterlockedDecrement( (long*)&m_cRef) )
00094   {
00095     delete this;
00096     return 0;
00097   }
00098   return m_cRef;
00099 }
00100
00101 //---------------------------------------------------------------------------
00102 //  Creates an instance of the object type which was passed in the
00103 //  class constructor
00104 //
00105 STDMETHODIMP CClassFactory::CreateInstance
00106 (
00107   LPUNKNOWN  pUnkOuter,      //[in] NULL unless object is part of aggregate
00108   REFIID     riid,           //[in] Reference to interface indentifier
00109   LPVOID*    ppvObj          //[out] Address of requested interface pointer
00110 )
00111 {
00112   HRESULT  hResult = E_FAIL;
00113   void*    pObject = NULL;
00114
00115   if( NULL == ppvObj )
00116     return hResult;
00117
00118   *ppvObj = NULL;
00119
00120   // Our object does does not support aggregation, so we need to
00121   // fail if they ask us to do aggregation.
00122   if( pUnkOuter )
00123     return CLASS_E_NOAGGREGATION;
00124
00125   // Support for providing CSnapinAbout/CComponentData objects
00126   switch( m_FactoryType )
00127   {
00128     case COMPONENTDATA:
00129       pObject = new CComponentData();
00130       break;
00131
00132     case ABOUT:
00133       pObject = new CSnapinAbout();
00134       break;
00135
00136     default:
00137       pObject = NULL;
00138   }
00139
00140   if( NULL == pObject )                // Failed to create an object
00141     return E_INVALIDARG;               // due to bad argument
00142
00143   // QueryInterface will do the AddRef() for us, don't do it here
00144   hResult = ( (LPUNKNOWN)pObject)->QueryInterface( riid, ppvObj );
00145
00146   if( S_OK != hResult )
00147     delete pObject;
00148
00149   return hResult;
00150 }
00151
00152
00153 //---------------------------------------------------------------------------
00154 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00155 {
00156   if( TRUE == fLock )
00157     InterlockedIncrement((long*)&g_uServerLocks);
00158   else
00159     InterlockedDecrement((long*)&g_uServerLocks);
00160
00161   return S_OK;
00162 }
00163
00164
00165 /////////////////////////////////////////////////////////////////////////////
00166 //  Our Snap-in's exported functions
00167 //
00168
00169 //---------------------------------------------------------------------------
00170 //  Entry point into our Snap-in DLL
00171 //
00172 BOOL WINAPI DllMain
00173 (
00174   HINSTANCE  hInstDLL,         //[in] Handle to DLL module
00175   DWORD      fdwReason,        //[in] Reason for calling function
00176   void*      lpvReserved       //[in] Reserved
00177 )
00178 {
00179   if( DLL_PROCESS_ATTACH == fdwReason )
00180   {
00181      g_hInst = hInstDLL;
00182   }
00183
00184   return TRUE;
00185 }
00186
00187
00188 //---------------------------------------------------------------------------
00189 STDAPI DllGetClassObject
00190 (
00191   REFCLSID   rclsid,         //[in] CLSID for the class object
00192   REFIID     riid,           //[in] Reference to interface identifier
00193   LPVOID     *ppvObj         //[out] Object which recieves interface pointer
00194 )
00195 {
00196   // Test for CSnapinAbout
00197   if( (rclsid != CLSID_CComponentData) && (rclsid != CLSID_CSnapinAbout) )
00198     return CLASS_E_CLASSNOTAVAILABLE;
00199
00200   if( !ppvObj )
00201     return E_FAIL;
00202
00203   *ppvObj = NULL;
00204
00205   // We can only hand out IUnknown and IClassFactory pointers.  Fail
00206   // if caller asks for anything else.
00207   if( !IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory) )
00208     return E_NOINTERFACE;
00209
00210   CClassFactory *pFactory = NULL;
00211
00212   // Create the new class factory.  Pass in the type of object to create
00213   if( rclsid == CLSID_CComponentData )
00214     pFactory = new CClassFactory(CClassFactory::COMPONENTDATA);
00215   else if( rclsid == CLSID_CSnapinAbout )
00216     pFactory = new CClassFactory(CClassFactory::ABOUT);
00217
00218
00219   HRESULT hResult = pFactory->QueryInterface( riid, ppvObj );
00220
00221   return hResult;
00222 }
00223
00224
00225 //---------------------------------------------------------------------------
00226 STDAPI DllCanUnloadNow(void)
00227 {
00228   if( 0 == g_uObjectCount && 0 == g_uServerLocks )
00229     return S_OK;
00230   else
00231     return S_FALSE;
00232 }
00233
00234
00235 //---------------------------------------------------------------------------
00236 STDAPI DllRegisterServer()
00237 {
00238   HRESULT hResult = S_FALSE;
00239
00240   do
00241   { // Support ISnapinAbout
00242     hResult = RegisterServer( g_hInst, CLSID_CSnapinAbout, gtszABOUT_NAME );
00243     BREAK_ON_ERROR( hResult );
00244
00245     hResult = RegisterServer( g_hInst, CLSID_CComponentData, gtszSNAPIN_NAME );
00246     BREAK_ON_ERROR( hResult );
00247
00248     //XPROPPAGE:  Now support extending CVirtualFile
00249     hResult = RegisterSnapin( CLSID_CComponentData, gtszSNAPIN_NAME, CLSID_CSnapinAbout, TRUE );
00250     BREAK_ON_ERROR( hResult );
00251
00252   }while( 0 );
00253
00254   return hResult;
00255 }
00256
00257
00258 //---------------------------------------------------------------------------
00259 STDAPI DllUnregisterServer()
00260 {
00261   if( S_OK == UnregisterServer(CLSID_CComponentData) )
00262     return UnregisterSnapin(CLSID_CComponentData);
00263   else
00264     return E_FAIL;
00265 }
00266
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagEVENT Member List

This is the complete list of members for tagEVENT, including all inherited members.
abEvent | tagEVENT
cbParm | tagEVENT
hpbParm | tagEVENT
tkDelta | tagEVENT
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/line.cpp Source File

  • Begin
  • sdkdiff

line.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * line.cpp
00013  *
00014  * data type representing a string of ascii text along with a line number.
00015  * a LINE can compare itself to another line, and maintain a link if the
00016  * lines are similar. A line can also generate a hashcode for the line.
00017  *
00018  * Comparisons between lines take note of the global option flag
00019  * ignore_blanks, defined elsewhere. If this is true, we ignore
00020  * differences in spaces and tabs when comparing lines, and when
00021  * generating hashcodes.
00022  *
00023  * Links and hashcodes are only generated once. to clear the link and
00024  * force re-generation of the hashcode (eg after changing ignore_blanks)
00025  * call line_reset.
00026  *
00027  * Lines can be allocated on a list. If a null list handle is passed, the
00028  * line will be allocated using HeapAlloc().
00029  *
00030  */
00031
00032 #include "precomp.h"
00033
00034 #include "sdkdiff.h"    /* defines hHeap and ignore_blanks */
00035 #include "list.h"
00036 #include "line.h"
00037
00038 #define IS_BLANK(c) \
00039     (((c) == ' ') || ((c) == '\t') || ((c) == '\r'))
00040
00041 /*
00042  * a LINE handle is a pointer to a struct fileline, defined here
00043  */
00044 struct fileline {
00045
00046     UINT flags;     /* see below */
00047
00048     LPSTR text;     /* null-terminated copy of line text */
00049     DWORD hash;     /* hashcode for line */
00050     LINE link;      /* handle for linked line */
00051     UINT linenr;    /* line number (any arbitrary value) */
00052     LPWSTR pwzText; /* null-terminated original unicode text */
00053 };
00054
00055 /* flag values (or-ed) */
00056 #define LF_DISCARD      1       /* if true, alloced using HeapAlloc */
00057 #define LF_HASHVALID    2       /* if true, hashcode need not be recalced */
00058
00059
00060 /*
00061  * create a new line. make a copy of the text.
00062  *
00063  * if the list is non-null, allocate on the list. if null, alloc using
00064  * HeapAlloc.
00065  */
00066 LINE
00067 line_new(LPSTR text, int linelength, LPWSTR pwzText, int cwchText, UINT linenr, LIST list)
00068 {
00069     LINE line;
00070     int cch = 0;
00071
00072     /* alloc a line. from the list if there is a list */
00073     if (list) {
00074         line = (LINE)List_NewLast(list, sizeof(struct fileline));
00075         if (line == NULL) {
00076             return(NULL);
00077         }
00078         line->flags = 0;
00079     } else {
00080         line = (LINE) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct fileline));
00081         if (line == NULL) {
00082             return(NULL);
00083         }
00084         line->flags = LF_DISCARD;
00085     }
00086
00087     /* alloc space for the text. remember the null character */
00088     /* also add cr/nl pair if absent for composite file */
00089     cch = (text[linelength - 1] == '\n') ? 1 : 3;
00090     line->text = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, linelength + cch);
00091     if (line->text == NULL)
00092     return NULL;
00093   My_mbsncpy(line->text, text, linelength);
00094     if (cch == 3) {
00095         line->text[linelength++] = '\r';
00096         line->text[linelength++] = '\n';
00097     }
00098     line->text[linelength] = '\0';
00099
00100     line->pwzText = 0;
00101     if (pwzText)
00102     {
00103         /* alloc space for the unicode text. remember the null character */
00104         /* also add cr/nl pair if absent for composite file */
00105         cch = (pwzText[cwchText - 1] == '\n') ? 1 : 3;
00106         line->pwzText = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (cwchText + cch) * sizeof(*pwzText));
00107         if (line->pwzText == NULL)
00108       return NULL;
00109     wcsncpy(line->pwzText, pwzText, cwchText);
00110         if (cch == 3) {
00111             line->pwzText[cwchText++] = '\r';
00112             line->pwzText[cwchText++] = '\n';
00113         }
00114         line->pwzText[cwchText] = '\0';
00115     }
00116
00117     line->link = NULL;
00118     line->linenr = linenr;
00119
00120     return(line);
00121 }
00122
00123 /*
00124  * delete a line. free up all associated memory and if the line
00125  * was not alloc-ed from a list, free up the line struct itself
00126  */
00127 void
00128 line_delete(LINE line)
00129 {
00130     if (line == NULL) {
00131         return;
00132     }
00133
00134     /* free up text space */
00135     HeapFree(GetProcessHeap(), NULL, line->text);
00136
00137     /* free up line itself only if not on list */
00138     if (line->flags & LF_DISCARD) {
00139         HeapFree(GetProcessHeap(), NULL, (LPSTR) line);
00140     }
00141 }
00142
00143 /*
00144  * clear the link and force recalc of the hash code.
00145  */
00146 void
00147 line_reset(LINE line)
00148 {
00149     if (line == NULL) {
00150         return;
00151     }
00152
00153     line->link = NULL;
00154
00155     line->flags &= ~LF_HASHVALID;
00156 }
00157
00158
00159 /* return a pointer to the line text */
00160 LPSTR
00161 line_gettext(LINE line)
00162 {
00163     if (line == NULL) {
00164         return(NULL);
00165     }
00166
00167     return (line->text);
00168 }
00169
00170 /* return a pointer to the line text */
00171 LPWSTR
00172 line_gettextW(LINE line)
00173 {
00174     if (line == NULL) {
00175         return(NULL);
00176     }
00177
00178     return (line->pwzText);
00179 }
00180
00181 /* get the effective text length, ignoring blanks */
00182 int line_gettextlen(LINE line)
00183 {
00184     int sum = 0;
00185     LPSTR string = line->text;
00186
00187     while (*string != '\0') {
00188
00189         if (ignore_blanks) {
00190             while (IS_BLANK(*string)) {
00191                 string++;
00192             }
00193         }
00194         if(IsDBCSLeadByte((BYTE)*string)) {
00195             ++sum;
00196             ++string;
00197         }
00198         ++sum;
00199         ++string;
00200     }
00201     return(sum);
00202 }
00203
00204
00205 /*
00206  * line_gettabbedlength
00207  *
00208  * return length of line in characters, expanding tabs. useful
00209  * for display-space calculations.
00210  */
00211 int
00212 line_gettabbedlength(LINE line, int tabstops)
00213 {
00214     int length;
00215     LPSTR chp;
00216
00217     if (line == NULL) {
00218         return(0);
00219     }
00220
00221     for (length = 0, chp = line->text; *chp != '\0'; chp++) {
00222         if (*chp == '\t') {
00223             length = (length + tabstops) / tabstops * tabstops;
00224         } else {
00225             if (IsDBCSLeadByte(*chp)) {
00226                 chp++;
00227                 length++;
00228             }
00229             length++;
00230         }
00231     }
00232     return(length);
00233 }
00234
00235
00236 /* return the hashcode for this line */
00237 DWORD
00238 line_gethashcode(LINE line)
00239 {
00240     if (line == NULL) {
00241         return(0);
00242     }
00243
00244     if (! (line->flags & LF_HASHVALID)) {
00245         /* hashcode needs to be recalced */
00246         line->hash = hash_string(line->text, ignore_blanks);
00247         line->flags |= LF_HASHVALID;
00248     }
00249     return (line->hash);
00250 }
00251
00252 /* return the handle for the line that is linked to this line (the
00253  * result of a successful line_link() operation). This line is
00254  * identical in text to the linked line (allowing for ignore_blanks).
00255  */
00256 LINE
00257 line_getlink(LINE line)
00258 {
00259     if (line == NULL) {
00260         return(NULL);
00261     }
00262
00263     return(line->link);
00264 }
00265
00266 /* return the line number associated with this line */
00267 UINT
00268 line_getlinenr(LINE line)
00269 {
00270     if (line == NULL) {
00271         return(0);
00272     }
00273
00274     return(line->linenr);
00275 }
00276
00277 /* compare two lines. return TRUE if they are the same. uses
00278  * ignore_blanks to determine whether to ignore any
00279  * spaces/tabs in the comparison.
00280  */
00281 BOOL
00282 line_compare(LINE line1, LINE line2)
00283 {
00284     LPSTR p1, p2;
00285
00286     if ((line1 == NULL) || (line2 == NULL)) {
00287         /* null line handles do not compare */
00288         return(FALSE);
00289     }
00290
00291     /* check that the hashcodes match */
00292     if (line_gethashcode(line1) != line_gethashcode(line2)) {
00293         return(FALSE);
00294     }
00295
00296     /* hashcodes match - are the lines really the same ? */
00297     /* note that this is coupled to gutils\utils.c in definition of blank */
00298     p1 = line_gettext(line1);
00299     p2 = line_gettext(line2);
00300     do {
00301         if (ignore_blanks) {
00302             while (IS_BLANK(*p1)) {
00303                 p1 = CharNext(p1);
00304             }
00305             while (IS_BLANK(*p2)) {
00306                 p2 = CharNext(p2);
00307             }
00308         }
00309         if (IsDBCSLeadByte(*p1) && *(p1+1) != '\0'
00310         &&  IsDBCSLeadByte(*p2) && *(p2+1) != '\0') {
00311             if (*p1 != *p2 || *(p1+1) != *(p2+1)) {
00312                 return(FALSE);
00313             }
00314             p1 += 2;
00315             p2 += 2;
00316         } else {
00317             if (*p1 != *p2) {
00318                 return(FALSE);
00319             }
00320             p1++;
00321             p2++;
00322         }
00323     } while ( (*p1 != '\0') && (*p2 != '\0'));
00324
00325     return(TRUE);
00326 }
00327
00328 /*
00329  * attempt to link two lines. return TRUE if succesful.
00330  *
00331  * this will fail if either line is NULL, or already linked, or if
00332  * they differ.
00333  */
00334 BOOL
00335 line_link(LINE line1, LINE line2)
00336 {
00337     if ( (line1 == NULL) || (line2 == NULL)) {
00338         return(FALSE);
00339     }
00340
00341     if ( (line1->link != NULL) || (line2->link != NULL)) {
00342         return(FALSE);
00343     }
00344
00345     if (line_compare(line1, line2)) {
00346         line1->link = line2;
00347         line2->link = line1;
00348         return(TRUE);
00349     } else {
00350         return(FALSE);
00351     }
00352 }
00353
00354
00355 /* return TRUE iff line is blank.  NULL => return FALSE */
00356 BOOL line_isblank(LINE line)
00357 {
00358     return line!=NULL && utils_isblank(line->text);
00359 }
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/TextFx/TextFx.h Source File

  • Multimedia
  • Gdi
  • TextFx

TextFx.h

Go to the documentation of this file.
00001 /*****************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1992 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \*****************************************************************************/
00010
00011 BOOL InitApplication(HANDLE);
00012 BOOL InitInstance(HANDLE, int);
00013 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00014 LRESULT CALLBACK About  (HWND, UINT, WPARAM, LPARAM);
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/filerep.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

filerep.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     File Replication Client Utility
00006
00007     FILE: FileRep.cpp
00008
00009     USAGE:
00010         FileRep [server name] [remote file] [local file] <options...>
00011
00012     OPTIONS:
00013         -n network_address
00014         -p protocol_sequence
00015         -e endpoint
00016         -d print messages
00017
00018     PURPOSE: Client utility for the file replication application
00019
00020     FUNCTIONS: main() - binds to replication server and requests
00021         file replication.
00022
00023     COMMENTS:
00024 */
00025
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <process.h>
00029 #include <tchar.h>
00030 #include <rpc.h>
00031 #include <Ntdsapi.h>
00032
00033 #include "common.h"
00034
00035 #include "Service.h"
00036
00037 // header file generated by MIDL compiler
00038 #include "FileRepClient.h"
00039
00040 /*
00041     FUNCTION: PrintUsage()
00042
00043     PURPOSE: Prints help information.
00044
00045     PARAMETERS:
00046         ProgName - name of the executable
00047
00048     RETURN VALUE:
00049         none
00050
00051     COMMENTS:
00052 */
00053 void PrintUsage(TCHAR *ProgName) {
00054     _tprintf(TEXT("%s - File Replication Client Utility\n\n"), ProgName);
00055     _tprintf(TEXT("Usage: %s [server name] [remote file] [local file] <options...> \n\n"), ProgName);
00056     _tprintf(TEXT("Options:\n"));
00057     _tprintf(TEXT(" -p protocol_sequence\n"));
00058     _tprintf(TEXT(" -n network_address\n"));
00059     _tprintf(TEXT(" -e endpoint\n"));
00060     _tprintf(TEXT(" -d print messages\n"));
00061 }
00062
00063 /*
00064     FUNCTION: main()
00065
00066     PURPOSE: Main funciton for the utility.  It binds to the local server
00067         and requests file replication.
00068
00069     PARAMETERS:
00070         dwArgc - number of command line arguments
00071         lpszArgv - array of command line arguments
00072
00073     RETURN VALUE:
00074         none
00075
00076     COMMENTS:
00077
00078 */
00079 INT _cdecl main(int argc, char **argv) {
00080
00081     INT i;
00082     RPC_STATUS rpcstatus;
00083
00084     // Controlls printing out of messages.
00085     BOOL bDebug = FALSE;
00086
00087     // Explicit binding handle to the client system service.
00088     handle_t hFileRepClient = NULL;
00089
00090     // These are the default values for extablishing connections.
00091     // Default connection is to a local server over local rpc.
00092     LPTSTR pszProtocolSequence = TEXT("ncalrpc");
00093     LPTSTR pszNetworkAddress = NULL;
00094
00095     // An empty endpoint string is used, since we are going to
00096     // connect to the endpoint dynamically generated by the
00097     // RPC run-time library.  Server calls RpcServerUseProtseq to
00098     // obtain a binding hadnle and a dynamic endpoint.
00099     LPTSTR pszEndpoint = TEXT("");
00100
00101     LPTSTR pszUuid = NULL;
00102     LPTSTR pszOptions = NULL;
00103     LPTSTR pszStringBinding = NULL;
00104
00105     LPTSTR ServerName = NULL;
00106     LPTSTR RemoteFileName = NULL;
00107     LPTSTR LocalFileName = NULL;
00108
00109     INT nNumArgs;
00110
00111     // Quality of service structure to ensure authentication.
00112     RPC_SECURITY_QOS SecurityQOS;
00113
00114     // Used in generating the principal name for the local system service.
00115     TCHAR Name[128];
00116     DWORD cbName = sizeof(Name);
00117     TCHAR DomainName[128];
00118     DWORD cbDomainName = sizeof(DomainName);
00119     SID_NAME_USE Use;
00120     SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
00121     BYTE sidBuffer[100];
00122     PSID pSID = (PSID)&sidBuffer;
00123
00124     // Get a common handle on the command line arguments for both
00125     // UNICODE and ASCII
00126 #ifdef _UNICODE
00127     LPWSTR *szArgList = CommandLineToArgvW(GetCommandLine(), &nNumArgs);
00128     if (NULL == szArgList) {
00129         _tprintf(TEXT("FileRep main: CommandLineToArgW failed"));
00130         exit(EXIT_FAILURE);
00131     }
00132 #else
00133     char **szArgList = argv;
00134     nNumArgs = argc;
00135 #endif
00136
00137     // Check that the correct number of arguments is given.
00138     if(nNumArgs<4){
00139         PrintUsage(szArgList[0]);
00140         exit(EXIT_FAILURE);
00141     }
00142
00143     // Extract the required arguments.
00144     ServerName = szArgList[1];
00145     RemoteFileName = szArgList[2];
00146     LocalFileName = szArgList[3];
00147
00148     // Allow the user to override settings with command line switches.
00149     for (i = 4; i < nNumArgs; i++) {
00150         // Well-formed argument switches start with '/' or '-' and are
00151         // two characters long.
00152         if (((*szArgList[i] == TEXT('-')) || (*szArgList[i] == TEXT('/'))) && _tcsclen(szArgList[i]) == 2) {
00153
00154             switch (_totlower(*(szArgList[i]+1))) {
00155
00156                 case TEXT('p'):
00157
00158               // Override protocol sequence.
00159
00160               // Check that the next argument exists and is not a
00161               // switch.
00162                     if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00163                   pszProtocolSequence = szArgList[++i];
00164                     }
00165               // Otherwise we have an empty protocol sequence.
00166               else {
00167             // We do not allow an empty protocol sequence.
00168             _tprintf(TEXT("Protocol sequence can't be \"\".\n"));
00169                         exit(EXIT_FAILURE);
00170               }
00171
00172         break;
00173
00174                 case TEXT('n'):
00175
00176         // Override the network address.
00177         if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00178       pszNetworkAddress = szArgList[++i];
00179         }
00180         else {
00181       pszNetworkAddress = TEXT("");
00182         }
00183
00184         break;
00185
00186           case TEXT('e'):
00187
00188         // Override the endpoint.
00189         if(i+1 < nNumArgs && *szArgList[i+1] != TEXT('-') && *szArgList[i+1] != TEXT('/')) {
00190       pszEndpoint = szArgList[++i];
00191         }
00192         else {
00193       pszEndpoint = TEXT("");
00194         }
00195
00196         break;
00197
00198                 case TEXT('d'):
00199         // Turn on debugging.
00200         bDebug = TRUE;
00201         break;
00202
00203                 case TEXT('h'):
00204                 case TEXT('?'):
00205                 default:
00206         PrintUsage(szArgList[0]);
00207         exit(EXIT_SUCCESS);
00208             }
00209         }
00210         else {
00211             PrintUsage(szArgList[0]);
00212             exit(EXIT_FAILURE);
00213         }
00214     }
00215
00216     // Concatenate the elements of
00217     // the string binding into the proper sequence.
00218     rpcstatus = RpcStringBindingCompose(pszUuid,
00219           pszProtocolSequence,
00220           pszNetworkAddress,
00221           pszEndpoint,
00222           pszOptions,
00223           &pszStringBinding);
00224     if(bDebug){
00225         _tprintf(TEXT("RpcStringBindingCompose returned 0x%x\n"), rpcstatus);
00226         _tprintf(TEXT("pszStringBinding = %s\n"), pszStringBinding);
00227     }
00228     EXIT_IF_FAIL(rpcstatus, "RpcStringBindingCompose");
00229
00230     // Set the binding handle that will be used to bind to the server.
00231     rpcstatus = RpcBindingFromStringBinding(pszStringBinding, &hFileRepClient);
00232     if(bDebug) _tprintf(TEXT("RpcBindingFromStringBinding returned 0x%x\n"), rpcstatus);
00233     EXIT_IF_FAIL(rpcstatus, "RpcBindingFromStringBinding");
00234
00235     // Free the binding string.
00236     rpcstatus = RpcStringFree(&pszStringBinding);
00237     ASSERTE(rpcstatus == RPC_S_OK);
00238
00239     // Specify quality of service parameters.
00240     SecurityQOS.Version = RPC_C_SECURITY_QOS_VERSION;
00241     SecurityQOS.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH;
00242     // Dynamic identity tracking is more efficient for a single LRPC call.
00243     SecurityQOS.IdentityTracking = RPC_C_QOS_IDENTITY_DYNAMIC;
00244     // The client system service needs to impersonate the security context
00245     // of the client utility on the remote systems where it may replicate
00246     // files from.
00247     // We need to impersonate with level delegate, since the server system
00248     // service will need to impersonate the user further.
00249     SecurityQOS.ImpersonationType = RPC_C_IMP_LEVEL_DELEGATE;
00250
00251     // Generate the principal name for the local system service.
00252     // We can't just use the a string constant, because then
00253     // we rely on a particular English-language representation of the
00254     // principal.
00255
00256     if (AllocateAndInitializeSid(&SIDAuth, 1,
00257          SECURITY_NETWORK_SERVICE_RID,
00258          0, 0, 0, 0, 0, 0, 0,
00259          &pSID) == 0) {
00260         printf("AllocateAndInitializeSid failed\n");
00261   exit(EXIT_FAILURE);
00262     }
00263
00264     if (LookupAccountSid(NULL, // name of local or remote computer
00265        pSID, // security identifier
00266        Name, // account name buffer
00267        &cbName, // size of account name buffer
00268        DomainName, // domain name
00269        &cbDomainName, // size of domain name buffer
00270        &Use) == 0) { // SID type
00271         printf("LookupAccountSid failed\n");
00272   exit(EXIT_FAILURE);
00273     }
00274
00275     if(bDebug) _tprintf(TEXT("Server \"magic name\" is %s\n"), Name);
00276
00277     // Set authentication and authorisation information for
00278     // the binding handle.
00279     // By speciying NULL for the 5th parameter we use the security login
00280     // context for the current address space.
00281     // The security level is "PRIVACY" since it is the only level
00282     // provided by LRPC.
00283     // We are assured of talking to a local service running with
00284     // system privileges.
00285     rpcstatus = RpcBindingSetAuthInfoEx(hFileRepClient, Name, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_WINNT, NULL, NULL, &SecurityQOS);
00286     EXIT_IF_FAIL(rpcstatus, "RpcBindingSetAuthInfo");
00287
00288     // Make the RPC to request file replication.
00289     RpcTryExcept {
00290         if(bDebug) _tprintf(TEXT("Calling the remote procedure RequestFile(hFileRepClient, %s, %s, %s)\n"), ServerName, RemoteFileName, LocalFileName);
00291
00292         RequestFile(hFileRepClient, ServerName, RemoteFileName, LocalFileName);
00293
00294         if(bDebug) _tprintf(TEXT("RequestFile() finished\n"));
00295     }
00296     // Return "non-fatal" errors.  Catching fatal errors
00297     // makes it harder to debug.
00298     RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00299       (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00300       (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00301       (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00302       (RpcExceptionCode() != STATUS_BREAKPOINT))
00303       ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00304
00305         _tprintf(TEXT("Exception: RequestFile failed with code %d\n"), GetExceptionCode());
00306         exit(EXIT_FAILURE);
00307     }
00308     RpcEndExcept;
00309
00310     // Free the binding.
00311     rpcstatus = RpcBindingFree((VOID **)&hFileRepClient);
00312     ASSERTE(rpcstatus == RPC_S_OK);
00313
00314     if(bDebug) _tprintf(TEXT("Success!\n"));
00315
00316     return(EXIT_SUCCESS);
00317
00318 } // end main()
00319
00320 /*
00321     MIDL allocate() and free()
00322 */
00323
00324 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
00325     return(AutoHeapAlloc(len));
00326 }
00327
00328 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
00329     if(ptr != NULL) {
00330         AutoHeapFree(ptr);
00331     }
00332 }
00333
00334 // end FileRep.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SFFS Member List

This is the complete list of members for _SFFS, including all inherited members.
buff | _SFFS
cbFile | _SFFS
date | _SFFS
dateVariable | _SFFS
dom | _SFFS
hr | _SFFS
mint | _SFFS
mon | _SFFS
sec | _SFFS
szFileName | _SFFS
time | _SFFS
timeVariable | _SFFS
wAttr | _SFFS
yr | _SFFS
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAggregate Member List

This is the complete list of members for CAggregate, including all inherited members.
CAggregate() | CAggregate |
HandleAggregation(REFIID riid, IUnknown **ppIUnknown) | CAggregate | [virtual]
m_cRef | CAggregate | [protected]
m_spUnkInner | CAggregate | [protected]
QueryInterface(REFIID riid, LPVOID *ppv) | CAggregate | [virtual]
ReleaseInner() | CAggregate |
SetInner(IUnknown *pIUnkInner) | CAggregate |
STDMETHODIMP_(ULONG) AddRef(void) | CAggregate | [virtual]
STDMETHODIMP_(ULONG) Release(void) | CAggregate | [virtual]
~CAggregate() | CAggregate | [virtual]
Generated on Wed Nov 13 2024 16:55:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/message.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

message.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       message.h
00007 //
00008 //  Contents:   Helper functions for popup message boxes.
00009 //
00010 //  Classes:
00011 //
00012 //  Functions:  MessageBoxFromStringIds
00013 //
00014 //  History:    6-24-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #ifndef __MESSAGE_H__
00019 #define __MESSAGE_H__
00020
00021 #define MAX_STRING_LENGTH           256
00022
00023 int MessageBoxFromStringIds(
00024     const HWND hwndOwner,
00025     const HINSTANCE hinst,
00026     const UINT idText,
00027     const UINT idTitle,
00028     const UINT fuStyle);
00029
00030 int MessageBoxFromStringIdsAndArgs(
00031     const HWND hwndOwner,
00032     const HINSTANCE hinst,
00033     const UINT idText,
00034     const UINT idTitle,
00035     const UINT fuStyle,
00036     ...);
00037
00038 #endif //__MESSAGE_H__
00039
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/QueueDef.h Source File

  • NetDS
  • MessageQueuing
  • MQPers

QueueDef.h

Go to the documentation of this file.
00001 //
00002 // Defines the queue label and path
00003 //
00004 #define STR_QUEUE_NAME  L".\\IStreamTest"
00005 #define STR_QUEUE_LABEL L"Object Test Queue"
00006
00007 // COM exception handler
00008 void dump_com_error(_com_error &e)
00009 {
00010     _tprintf(_T("Oops - hit an error!\n"));
00011     _tprintf(_T("\a\tCode = %08lx\n"), e.Error());
00012     _tprintf(_T("\a\tCode meaning = %s\n"), e.ErrorMessage());
00013     _bstr_t bstrSource(e.Source());
00014     _bstr_t bstrDescription(e.Description());
00015     _tprintf(_T("\a\tSource = %s\n"), (LPCTSTR) bstrSource);
00016     _tprintf(_T("\a\tDescription = %s\n"), (LPCTSTR) bstrDescription);
00017 }
00018
00019
00020 struct InitOle {
00021     InitOle() { CoInitialize(NULL); }   // Initialize Component Object Model(COM) library
00022     ~InitOle() { CoUninitialize(); }  // Uninitialize Component Object Model(COM) library
00023 };
00024
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/ErrorOut.h Source File

  • Begin
  • sdkdiff

ErrorOut.h

Go to the documentation of this file.
00001
00002 #ifndef _ERROR_OUT
00003 #define _ERROR_OUT
00004
00005 void OutputError(HRESULT hr, LPCSTR operation);
00006
00007 #define ERROR_LENGTH  25
00008 #define ERROR_MAX   256
00009 #define IDS_SAFE_PRINTF "safe string printf"
00010 #define IDS_SAFE_COPY "safe string copy"
00011 #define IDS_SAFE_CAT  "safe string concatenation"
00012
00013 #endif
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/iapplet.h Source File

  • Web
  • NetMeeting
  • NMChat2

iapplet.h

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Thu Apr 18 16:14:45 2002
00006  */
00007 /* Compiler settings for ..\..\include\iapplet.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013
00014 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00015 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00016 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00017 #endif
00018
00019 #include "rpc.h"
00020 #include "rpcndr.h"
00021
00022 #ifndef __RPCNDR_H_VERSION__
00023 #error this stub requires an updated version of <rpcndr.h>
00024 #endif // __RPCNDR_H_VERSION__
00025
00026 #ifndef COM_NO_WINDOWS_H
00027 #include "windows.h"
00028 #include "ole2.h"
00029 #endif /*COM_NO_WINDOWS_H*/
00030
00031 #ifndef __iapplet_h__
00032 #define __iapplet_h__
00033
00034 #ifdef __cplusplus
00035 extern "C"{
00036 #endif
00037
00038 /* Forward Declarations */
00039
00040 #ifndef __IAppletSessionNotify_FWD_DEFINED__
00041 #define __IAppletSessionNotify_FWD_DEFINED__
00042 typedef interface IAppletSessionNotify IAppletSessionNotify;
00043 #endif  /* __IAppletSessionNotify_FWD_DEFINED__ */
00044
00045
00046 #ifndef __IAppletSession_FWD_DEFINED__
00047 #define __IAppletSession_FWD_DEFINED__
00048 typedef interface IAppletSession IAppletSession;
00049 #endif  /* __IAppletSession_FWD_DEFINED__ */
00050
00051
00052 #ifndef __IAppletNotify_FWD_DEFINED__
00053 #define __IAppletNotify_FWD_DEFINED__
00054 typedef interface IAppletNotify IAppletNotify;
00055 #endif  /* __IAppletNotify_FWD_DEFINED__ */
00056
00057
00058 #ifndef __IApplet_FWD_DEFINED__
00059 #define __IApplet_FWD_DEFINED__
00060 typedef interface IApplet IApplet;
00061 #endif  /* __IApplet_FWD_DEFINED__ */
00062
00063
00064 #ifndef __NmApplet_FWD_DEFINED__
00065 #define __NmApplet_FWD_DEFINED__
00066
00067 #ifdef __cplusplus
00068 typedef class NmApplet NmApplet;
00069 #else
00070 typedef struct NmApplet NmApplet;
00071 #endif /* __cplusplus */
00072
00073 #endif  /* __NmApplet_FWD_DEFINED__ */
00074
00075
00076 /* header files for imported files */
00077 #include "oaidl.h"
00078 #include "ocidl.h"
00079
00080 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00081 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00082
00083 /* interface __MIDL_itf_iapplet_0000 */
00084 /* [local] */
00085
00086 typedef USHORT AppletSessionID;
00087
00088 typedef USHORT AppletChannelID;
00089
00090 typedef AppletChannelID AppletUserID;
00091
00092 typedef AppletUserID AppletNodeID;
00093
00094 typedef USHORT AppletTokenID;
00095
00096 typedef USHORT AppletEntityID;
00097
00098 typedef ULONG AppletConfID;
00099
00100 typedef UINT AppletRequestTag;
00101
00102 typedef
00103 enum tagAppletRegistryCommand
00104     { APPLET_REGISTER_CHANNEL = 0,
00105   APPLET_ASSIGN_TOKEN = 1,
00106   APPLET_SET_PARAMETER  = 2,
00107   APPLET_RETRIEVE_ENTRY = 3,
00108   APPLET_DELETE_ENTRY = 4,
00109   APPLET_ALLOCATE_HANDLE  = 5,
00110   APPLET_MONITOR  = 6
00111     } AppletRegistryCommand;
00112
00113 typedef
00114 enum tagAppletRegistryItemType
00115     { APPLET_REGISTRY_CHANNEL_ID  = 1,
00116   APPLET_REGISTRY_TOKEN_ID  = 2,
00117   APPLET_REGISTRY_PARAMETER = 3,
00118   APPLET_REGISTRY_NONE  = 4
00119     } AppletRegistryItemType;
00120
00121 typedef
00122 enum tagAppletModificationRights
00123     { APPLET_OWNER_RIGHTS = 0,
00124   APPLET_SESSION_RIGHTS = 1,
00125   APPLET_PUBLIC_RIGHTS  = 2,
00126   APPLET_NO_MODIFICATION_RIGHTS_SPECIFIED = 3
00127     } AppletModificationRights;
00128
00129 typedef
00130 enum tagAppletChannelCommand
00131     { APPLET_JOIN_CHANNEL = 0,
00132   APPLET_LEAVE_CHANNEL  = 1,
00133   APPLET_CONVENE_CHANNEL  = 2,
00134   APPLET_DISBAND_CHANNEL  = 3,
00135   APPLET_ADMIT_CHANNEL  = 4,
00136   APPLET_EXPEL_CHANNEL  = 5
00137     } AppletChannelCommand;
00138
00139 typedef
00140 enum tagAppletChannelType
00141     { APPLET_STATIC_CHANNEL = 0,
00142   APPLET_DYNAMIC_MULTICAST_CHANNEL  = 1,
00143   APPLET_DYNAMIC_PRIVATE_CHANNEL  = 2,
00144   APPLET_DYNAMIC_USER_ID_CHANNEL  = 3,
00145   APPLET_NO_CHANNEL_TYPE_SPECIFIED  = 4
00146     } AppletChannelType;
00147
00148 typedef
00149 enum tagAppletTokenCommand
00150     { APPLET_GRAB_TOKEN = 0,
00151   APPLET_INHIBIT_TOKEN  = 1,
00152   APPLET_GIVE_TOKEN = 2,
00153   APPLET_PLEASE_TOKEN = 3,
00154   APPLET_RELEASE_TOKEN  = 4,
00155   APPLET_TEST_TOKEN = 5,
00156   APPLET_GIVE_TOKEN_RESPONSE  = 6
00157     } AppletTokenCommand;
00158
00159 typedef
00160 enum tagAppletTokenStatus
00161     { APPLET_TOKEN_NOT_IN_USE = 0,
00162   APPLET_TOKEN_SELF_GRABBED = 1,
00163   APPLET_TOKEN_OTHER_GRABBED  = 2,
00164   APPLET_TOKEN_SELF_INHIBITED = 3,
00165   APPLET_TOKEN_OTHER_INHIBITED  = 4,
00166   APPLET_TOKEN_SELF_RECIPIENT = 5,
00167   APPLET_TOKEN_SELF_GIVING  = 6,
00168   APPLET_TOKEN_OTHER_GIVING = 7
00169     } AppletTokenStatus;
00170
00171 typedef
00172 enum tagAppletCapabilityType
00173     { APPLET_UNKNOWN_CAP_TYPE = 0,
00174   APPLET_LOGICAL_CAPABILITY = 1,
00175   APPLET_UNSIGNED_MINIMUM_CAPABILITY  = 2,
00176   APPLET_UNSIGNED_MAXIMUM_CAPABILITY  = 3
00177     } AppletCapabilityType;
00178
00179 typedef struct  tagAppletCapabilityClass
00180     {
00181     AppletCapabilityType eType;
00182     ULONG nMinOrMax;
00183     } AppletCapabilityClass;
00184
00185 typedef
00186 enum tagAppletCapIDType
00187     { APPLET_STANDARD_CAPABILITY  = 0,
00188   APPLET_NONSTD_CAPABILITY  = 1
00189     } AppletCapIDType;
00190
00191 typedef
00192 enum tagAppletResourceAllocCommand
00193     { APPLET_JOIN_DYNAMIC_CHANNEL = 0,
00194   APPLET_GRAB_TOKEN_REQUEST = 1
00195     } AppletResourceAllocCommand;
00196
00197 typedef
00198 enum tagAppletPriority
00199     { APPLET_TOP_PRIORITY = 0,
00200   APPLET_HIGH_PRIORITY  = 1,
00201   APPLET_MEDIUM_PRIORITY  = 2,
00202   APPLET_LOW_PRIORITY = 3
00203     } AppletPriority;
00204
00205 typedef
00206 enum tagAppletKeyType
00207     { APPLET_OBJECT_KEY = 1,
00208   APPLET_H221_NONSTD_KEY  = 2
00209     } AppletKeyType;
00210
00211
00212 enum tagAppletErrorCode
00213     { APPLET_E_NO_SERVICE = 0x82000001,
00214   APPLET_E_SERVICE_FAIL = 0x82000002,
00215   APPLET_E_ALREADY_REGISTERED = 0x82000003,
00216   APPLET_E_NOT_REGISTERED = 0x82000004,
00217   APPLET_E_INVALID_CONFERENCE = 0x82000005,
00218   APPLET_E_INVALID_COOKIE = 0x82000006,
00219   APPLET_E_ALREADY_JOIN = 0x82000007,
00220   APPLET_E_NOT_JOINED = 0x82000008,
00221   APPLET_E_INVALID_JOIN_REQUEST = 0x82000009,
00222   APPLET_E_ENTRY_ALREADY_EXISTS = 0x8200000a,
00223   APPLET_E_ENTRY_DOES_NOT_EXIST = 0x8200000b,
00224   APPLET_E_NOT_OWNER  = 0x8200000c,
00225   APPLET_E_NOT_ADVISED  = 0x8200000d,
00226   APPLET_E_ALREADY_ADVISED  = 0x8200000e
00227     };
00228 typedef
00229 enum tagAppletReason
00230     { APPLET_R_UNSPECIFIED  = 0,
00231   APPLET_R_CONFERENCE_GONE  = 1,
00232   APPLET_R_USER_REJECTED  = 2,
00233   APPLET_R_RESOURCE_PURGED  = 3
00234     } AppletReason;
00235
00236 typedef struct  tagAppletOctetString
00237     {
00238     ULONG cbStrSize;
00239     /* [size_is] */ BYTE __RPC_FAR *pbValue;
00240     } AppletOctetString;
00241
00242 typedef struct  tagAppletLongString
00243     {
00244     ULONG nStrLen;
00245     /* [size_is] */ ULONG __RPC_FAR *pnValue;
00246     } AppletLongString;
00247
00248 typedef struct  tagAppletObjectKey
00249     {
00250     AppletKeyType eType;
00251     AppletLongString lstrObjectID;
00252     AppletOctetString ostrH221NonStdID;
00253     } AppletObjectKey;
00254
00255 typedef struct  tagAppletSessionKey
00256     {
00257     AppletObjectKey AppletProtocolKey;
00258     AppletSessionID nSessionID;
00259     } AppletSessionKey;
00260
00261 typedef struct  tagAppletRegistryKey
00262     {
00263     AppletSessionKey SessionKey;
00264     AppletOctetString ostrResourceID;
00265     } AppletRegistryKey;
00266
00267 typedef struct  tagAppletRegistryRequest
00268     {
00269     AppletRegistryCommand eCommand;
00270     AppletRegistryKey RegistryKey;
00271     AppletChannelID nChannelID;
00272     AppletOctetString ostrParamValue;
00273     AppletModificationRights eParamModifyRights;
00274     ULONG cHandles;
00275     } AppletRegistryRequest;
00276
00277 typedef struct  tagAppletChannelRequest
00278     {
00279     AppletChannelCommand eCommand;
00280     AppletChannelID nChannelID;
00281     ULONG cUsers;
00282     /* [size_is] */ AppletUserID __RPC_FAR *aUsers;
00283     } AppletChannelRequest;
00284
00285 typedef struct  tagAppletTokenRequest
00286     {
00287     AppletTokenCommand eCommand;
00288     AppletTokenID nTokenID;
00289     AppletUserID uidGiveTo;
00290     HRESULT hrGiveResponse;
00291     } AppletTokenRequest;
00292
00293 typedef struct  tagAppletCapabilityID
00294     {
00295     AppletCapIDType eType;
00296     AppletObjectKey nNonStdCap;
00297     ULONG nStdCap;
00298     } AppletCapabilityID;
00299
00300 typedef struct  tagAppletCapability
00301     {
00302     AppletCapabilityID CapID;
00303     AppletCapabilityClass CapClass;
00304     ULONG cEntities;
00305     } AppletCapability;
00306
00307 typedef struct  tagAppletCapability2
00308     {
00309     AppletCapabilityID CapID;
00310     AppletOctetString __RPC_FAR *pCapData;
00311     } AppletCapability2;
00312
00313 typedef struct  tagAppletProtocolEntity
00314     {
00315     AppletSessionKey SessionKey;
00316     AppletChannelType eStartupChannelType;
00317     BOOL fMustBeInvoked;
00318     ULONG cExpectedCapabilities;
00319     /* [size_is] */ AppletCapability __RPC_FAR *__RPC_FAR *apExpectedCapabilities;
00320     } AppletProtocolEntity;
00321
00322 typedef struct  tagAppletRecord
00323     {
00324     AppletNodeID nNodeID;
00325     AppletEntityID nEntityID;
00326     BOOL fEnrolledActively;
00327     BOOL fConductingCapable;
00328     AppletChannelType eStartupChannelType;
00329     AppletUserID nAppletUserID;
00330     ULONG cCapabilities;
00331     /* [size_is] */ AppletCapability2 __RPC_FAR *__RPC_FAR *apCapabilities;
00332     } AppletRecord;
00333
00334 typedef struct  tagAppletRoster
00335     {
00336     AppletSessionKey SessionKey;
00337     BOOL fRosterChanged;
00338     ULONG nInstanceNumber;
00339     BOOL fNodesAdded;
00340     BOOL fNodesRemoved;
00341     BOOL fCapabilitiesChanged;
00342     ULONG cRecords;
00343     /* [size_is] */ AppletRecord __RPC_FAR *__RPC_FAR *apAppletRecords;
00344     ULONG cCapabilities;
00345     /* [size_is] */ AppletCapability __RPC_FAR *__RPC_FAR *apCapabilities;
00346     } AppletRoster;
00347
00348 typedef struct  tagAppletRegistryItem
00349     {
00350     AppletRegistryItemType ItemType;
00351     AppletChannelID nChannelID;
00352     AppletTokenID nTokenID;
00353     AppletOctetString ostrParamValue;
00354     } AppletRegistryItem;
00355
00356 typedef struct  tagAppletRegistryEntryOwner
00357     {
00358     BOOL fEntryOwned;
00359     AppletNodeID nOwnerNodeID;
00360     AppletEntityID nOwnerEntityID;
00361     } AppletRegistryEntryOwner;
00362
00363 typedef struct  tagAppletSessionRequest
00364     {
00365     AppletSessionKey SessionKey;
00366     AppletChannelType nStartupChannelType;
00367     ULONG cCollapsedCaps;
00368     /* [size_is] */ AppletCapability __RPC_FAR *__RPC_FAR *apCollapsedCaps;
00369     ULONG cNonCollapsedCaps;
00370     /* [size_is] */ AppletCapability2 __RPC_FAR *__RPC_FAR *apNonCollapsedCaps;
00371     ULONG cStaticChannels;
00372     /* [size_is] */ AppletChannelID __RPC_FAR *aStaticChannels;
00373     ULONG cDynamicChannels;
00374     /* [size_is] */ AppletRegistryKey __RPC_FAR *aChannelRegistryKeys;
00375     } AppletSessionRequest;
00376
00377
00378
00379 extern RPC_IF_HANDLE __MIDL_itf_iapplet_0000_v0_0_c_ifspec;
00380 extern RPC_IF_HANDLE __MIDL_itf_iapplet_0000_v0_0_s_ifspec;
00381
00382 #ifndef __IAppletSessionNotify_INTERFACE_DEFINED__
00383 #define __IAppletSessionNotify_INTERFACE_DEFINED__
00384
00385 /* interface IAppletSessionNotify */
00386 /* [unique][uuid][object] */
00387
00388
00389 EXTERN_C const IID IID_IAppletSessionNotify;
00390
00391 #if defined(__cplusplus) && !defined(CINTERFACE)
00392
00393     MIDL_INTERFACE("f7c10ec0-a4d9-11d2-b724-00104bc51339")
00394     IAppletSessionNotify : public IUnknown
00395     {
00396     public:
00397         virtual HRESULT STDMETHODCALLTYPE JoinSessionConfirm(
00398             /* [in] */ HRESULT hrResult,
00399             /* [in] */ AppletUserID uidMyself,
00400             /* [in] */ AppletNodeID nidMyself,
00401             /* [in] */ AppletSessionID sidMyself,
00402             /* [in] */ AppletEntityID eidMyself,
00403             /* [in] */ ULONG cDynamicChannels,
00404             /* [size_is][in] */ AppletChannelID __RPC_FAR aDynamicChannels[  ]) = 0;
00405
00406         virtual HRESULT STDMETHODCALLTYPE LeaveSessionIndication(
00407             /* [in] */ AppletReason eReason,
00408             /* [in] */ AppletUserID uidLeave) = 0;
00409
00410         virtual HRESULT STDMETHODCALLTYPE SendDataIndication(
00411             /* [in] */ BOOL fUniformSend,
00412             /* [in] */ AppletUserID uidInitiator,
00413             /* [in] */ AppletChannelID nChannelID,
00414             /* [in] */ AppletPriority eDataPriority,
00415             /* [in] */ AppletOctetString Data) = 0;
00416
00417         virtual HRESULT STDMETHODCALLTYPE RosterReportIndication(
00418             /* [in] */ ULONG cRosters,
00419             /* [size_is][in] */ AppletRoster __RPC_FAR *__RPC_FAR *apAppRosters) = 0;
00420
00421         virtual HRESULT STDMETHODCALLTYPE InquireRosterConfirm(
00422             /* [in] */ HRESULT hrResult,
00423             /* [in] */ ULONG cRosters,
00424             /* [size_is][in] */ AppletRoster __RPC_FAR *__RPC_FAR *apAppRosters) = 0;
00425
00426         virtual HRESULT STDMETHODCALLTYPE InvokeAppletConfirm(
00427             /* [in] */ AppletRequestTag nReqTag,
00428             /* [in] */ HRESULT hrResult) = 0;
00429
00430         virtual HRESULT STDMETHODCALLTYPE RegistryConfirm(
00431             /* [in] */ AppletRegistryCommand eCommand,
00432             /* [in] */ HRESULT hrResult,
00433             /* [in] */ AppletRegistryKey __RPC_FAR *pRegistryKey,
00434             /* [in] */ AppletRegistryItem __RPC_FAR *pRegistryItem,
00435             /* [in] */ AppletRegistryEntryOwner __RPC_FAR *pEntryOwner,
00436             /* [in] */ AppletModificationRights eRights) = 0;
00437
00438         virtual HRESULT STDMETHODCALLTYPE AllocateHandleConfirm(
00439             /* [in] */ HRESULT hrResult,
00440             /* [in] */ ULONG nFirstHandle,
00441             /* [in] */ ULONG cHandles) = 0;
00442
00443         virtual HRESULT STDMETHODCALLTYPE ChannelConfirm(
00444             /* [in] */ AppletChannelCommand eCommand,
00445             /* [in] */ HRESULT hrResult,
00446             /* [in] */ AppletChannelID nChannelID) = 0;
00447
00448         virtual HRESULT STDMETHODCALLTYPE ChannelIndication(
00449             /* [in] */ AppletChannelCommand eCommand,
00450             /* [in] */ AppletChannelID nChannelID,
00451             /* [in] */ AppletReason eReason,
00452             /* [in] */ AppletUserID uidManager) = 0;
00453
00454         virtual HRESULT STDMETHODCALLTYPE TokenConfirm(
00455             /* [in] */ AppletTokenCommand eCommand,
00456             /* [in] */ HRESULT hrResult,
00457             /* [in] */ AppletTokenID nTokenID) = 0;
00458
00459         virtual HRESULT STDMETHODCALLTYPE TestTokenConfirm(
00460             /* [in] */ AppletTokenID nTokenID,
00461             /* [in] */ AppletTokenStatus eStatus) = 0;
00462
00463         virtual HRESULT STDMETHODCALLTYPE TokenIndication(
00464             /* [in] */ AppletTokenCommand eCommand,
00465             /* [in] */ AppletReason eReason,
00466             /* [in] */ AppletTokenID nTokenID,
00467             /* [in] */ AppletUserID uidInitiator) = 0;
00468
00469     };
00470
00471 #else   /* C style interface */
00472
00473     typedef struct IAppletSessionNotifyVtbl
00474     {
00475         BEGIN_INTERFACE
00476
00477         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00478             IAppletSessionNotify __RPC_FAR * This,
00479             /* [in] */ REFIID riid,
00480             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00481
00482         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00483             IAppletSessionNotify __RPC_FAR * This);
00484
00485         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00486             IAppletSessionNotify __RPC_FAR * This);
00487
00488         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *JoinSessionConfirm )(
00489             IAppletSessionNotify __RPC_FAR * This,
00490             /* [in] */ HRESULT hrResult,
00491             /* [in] */ AppletUserID uidMyself,
00492             /* [in] */ AppletNodeID nidMyself,
00493             /* [in] */ AppletSessionID sidMyself,
00494             /* [in] */ AppletEntityID eidMyself,
00495             /* [in] */ ULONG cDynamicChannels,
00496             /* [size_is][in] */ AppletChannelID __RPC_FAR aDynamicChannels[  ]);
00497
00498         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *LeaveSessionIndication )(
00499             IAppletSessionNotify __RPC_FAR * This,
00500             /* [in] */ AppletReason eReason,
00501             /* [in] */ AppletUserID uidLeave);
00502
00503         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SendDataIndication )(
00504             IAppletSessionNotify __RPC_FAR * This,
00505             /* [in] */ BOOL fUniformSend,
00506             /* [in] */ AppletUserID uidInitiator,
00507             /* [in] */ AppletChannelID nChannelID,
00508             /* [in] */ AppletPriority eDataPriority,
00509             /* [in] */ AppletOctetString Data);
00510
00511         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RosterReportIndication )(
00512             IAppletSessionNotify __RPC_FAR * This,
00513             /* [in] */ ULONG cRosters,
00514             /* [size_is][in] */ AppletRoster __RPC_FAR *__RPC_FAR *apAppRosters);
00515
00516         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *InquireRosterConfirm )(
00517             IAppletSessionNotify __RPC_FAR * This,
00518             /* [in] */ HRESULT hrResult,
00519             /* [in] */ ULONG cRosters,
00520             /* [size_is][in] */ AppletRoster __RPC_FAR *__RPC_FAR *apAppRosters);
00521
00522         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *InvokeAppletConfirm )(
00523             IAppletSessionNotify __RPC_FAR * This,
00524             /* [in] */ AppletRequestTag nReqTag,
00525             /* [in] */ HRESULT hrResult);
00526
00527         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RegistryConfirm )(
00528             IAppletSessionNotify __RPC_FAR * This,
00529             /* [in] */ AppletRegistryCommand eCommand,
00530             /* [in] */ HRESULT hrResult,
00531             /* [in] */ AppletRegistryKey __RPC_FAR *pRegistryKey,
00532             /* [in] */ AppletRegistryItem __RPC_FAR *pRegistryItem,
00533             /* [in] */ AppletRegistryEntryOwner __RPC_FAR *pEntryOwner,
00534             /* [in] */ AppletModificationRights eRights);
00535
00536         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AllocateHandleConfirm )(
00537             IAppletSessionNotify __RPC_FAR * This,
00538             /* [in] */ HRESULT hrResult,
00539             /* [in] */ ULONG nFirstHandle,
00540             /* [in] */ ULONG cHandles);
00541
00542         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ChannelConfirm )(
00543             IAppletSessionNotify __RPC_FAR * This,
00544             /* [in] */ AppletChannelCommand eCommand,
00545             /* [in] */ HRESULT hrResult,
00546             /* [in] */ AppletChannelID nChannelID);
00547
00548         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ChannelIndication )(
00549             IAppletSessionNotify __RPC_FAR * This,
00550             /* [in] */ AppletChannelCommand eCommand,
00551             /* [in] */ AppletChannelID nChannelID,
00552             /* [in] */ AppletReason eReason,
00553             /* [in] */ AppletUserID uidManager);
00554
00555         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *TokenConfirm )(
00556             IAppletSessionNotify __RPC_FAR * This,
00557             /* [in] */ AppletTokenCommand eCommand,
00558             /* [in] */ HRESULT hrResult,
00559             /* [in] */ AppletTokenID nTokenID);
00560
00561         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *TestTokenConfirm )(
00562             IAppletSessionNotify __RPC_FAR * This,
00563             /* [in] */ AppletTokenID nTokenID,
00564             /* [in] */ AppletTokenStatus eStatus);
00565
00566         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *TokenIndication )(
00567             IAppletSessionNotify __RPC_FAR * This,
00568             /* [in] */ AppletTokenCommand eCommand,
00569             /* [in] */ AppletReason eReason,
00570             /* [in] */ AppletTokenID nTokenID,
00571             /* [in] */ AppletUserID uidInitiator);
00572
00573         END_INTERFACE
00574     } IAppletSessionNotifyVtbl;
00575
00576     interface IAppletSessionNotify
00577     {
00578         CONST_VTBL struct IAppletSessionNotifyVtbl __RPC_FAR *lpVtbl;
00579     };
00580
00581
00582
00583 #ifdef COBJMACROS
00584
00585
00586 #define IAppletSessionNotify_QueryInterface(This,riid,ppvObject)  \
00587     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00588
00589 #define IAppletSessionNotify_AddRef(This) \
00590     (This)->lpVtbl -> AddRef(This)
00591
00592 #define IAppletSessionNotify_Release(This)  \
00593     (This)->lpVtbl -> Release(This)
00594
00595
00596 #define IAppletSessionNotify_JoinSessionConfirm(This,hrResult,uidMyself,nidMyself,sidMyself,eidMyself,cDynamicChannels,aDynamicChannels)  \
00597     (This)->lpVtbl -> JoinSessionConfirm(This,hrResult,uidMyself,nidMyself,sidMyself,eidMyself,cDynamicChannels,aDynamicChannels)
00598
00599 #define IAppletSessionNotify_LeaveSessionIndication(This,eReason,uidLeave)  \
00600     (This)->lpVtbl -> LeaveSessionIndication(This,eReason,uidLeave)
00601
00602 #define IAppletSessionNotify_SendDataIndication(This,fUniformSend,uidInitiator,nChannelID,eDataPriority,Data) \
00603     (This)->lpVtbl -> SendDataIndication(This,fUniformSend,uidInitiator,nChannelID,eDataPriority,Data)
00604
00605 #define IAppletSessionNotify_RosterReportIndication(This,cRosters,apAppRosters) \
00606     (This)->lpVtbl -> RosterReportIndication(This,cRosters,apAppRosters)
00607
00608 #define IAppletSessionNotify_InquireRosterConfirm(This,hrResult,cRosters,apAppRosters)  \
00609     (This)->lpVtbl -> InquireRosterConfirm(This,hrResult,cRosters,apAppRosters)
00610
00611 #define IAppletSessionNotify_InvokeAppletConfirm(This,nReqTag,hrResult) \
00612     (This)->lpVtbl -> InvokeAppletConfirm(This,nReqTag,hrResult)
00613
00614 #define IAppletSessionNotify_RegistryConfirm(This,eCommand,hrResult,pRegistryKey,pRegistryItem,pEntryOwner,eRights) \
00615     (This)->lpVtbl -> RegistryConfirm(This,eCommand,hrResult,pRegistryKey,pRegistryItem,pEntryOwner,eRights)
00616
00617 #define IAppletSessionNotify_AllocateHandleConfirm(This,hrResult,nFirstHandle,cHandles) \
00618     (This)->lpVtbl -> AllocateHandleConfirm(This,hrResult,nFirstHandle,cHandles)
00619
00620 #define IAppletSessionNotify_ChannelConfirm(This,eCommand,hrResult,nChannelID)  \
00621     (This)->lpVtbl -> ChannelConfirm(This,eCommand,hrResult,nChannelID)
00622
00623 #define IAppletSessionNotify_ChannelIndication(This,eCommand,nChannelID,eReason,uidManager) \
00624     (This)->lpVtbl -> ChannelIndication(This,eCommand,nChannelID,eReason,uidManager)
00625
00626 #define IAppletSessionNotify_TokenConfirm(This,eCommand,hrResult,nTokenID)  \
00627     (This)->lpVtbl -> TokenConfirm(This,eCommand,hrResult,nTokenID)
00628
00629 #define IAppletSessionNotify_TestTokenConfirm(This,nTokenID,eStatus)  \
00630     (This)->lpVtbl -> TestTokenConfirm(This,nTokenID,eStatus)
00631
00632 #define IAppletSessionNotify_TokenIndication(This,eCommand,eReason,nTokenID,uidInitiator) \
00633     (This)->lpVtbl -> TokenIndication(This,eCommand,eReason,nTokenID,uidInitiator)
00634
00635 #endif /* COBJMACROS */
00636
00637
00638 #endif  /* C style interface */
00639
00640
00641
00642 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_JoinSessionConfirm_Proxy(
00643     IAppletSessionNotify __RPC_FAR * This,
00644     /* [in] */ HRESULT hrResult,
00645     /* [in] */ AppletUserID uidMyself,
00646     /* [in] */ AppletNodeID nidMyself,
00647     /* [in] */ AppletSessionID sidMyself,
00648     /* [in] */ AppletEntityID eidMyself,
00649     /* [in] */ ULONG cDynamicChannels,
00650     /* [size_is][in] */ AppletChannelID __RPC_FAR aDynamicChannels[  ]);
00651
00652
00653 void __RPC_STUB IAppletSessionNotify_JoinSessionConfirm_Stub(
00654     IRpcStubBuffer *This,
00655     IRpcChannelBuffer *_pRpcChannelBuffer,
00656     PRPC_MESSAGE _pRpcMessage,
00657     DWORD *_pdwStubPhase);
00658
00659
00660 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_LeaveSessionIndication_Proxy(
00661     IAppletSessionNotify __RPC_FAR * This,
00662     /* [in] */ AppletReason eReason,
00663     /* [in] */ AppletUserID uidLeave);
00664
00665
00666 void __RPC_STUB IAppletSessionNotify_LeaveSessionIndication_Stub(
00667     IRpcStubBuffer *This,
00668     IRpcChannelBuffer *_pRpcChannelBuffer,
00669     PRPC_MESSAGE _pRpcMessage,
00670     DWORD *_pdwStubPhase);
00671
00672
00673 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_SendDataIndication_Proxy(
00674     IAppletSessionNotify __RPC_FAR * This,
00675     /* [in] */ BOOL fUniformSend,
00676     /* [in] */ AppletUserID uidInitiator,
00677     /* [in] */ AppletChannelID nChannelID,
00678     /* [in] */ AppletPriority eDataPriority,
00679     /* [in] */ AppletOctetString Data);
00680
00681
00682 void __RPC_STUB IAppletSessionNotify_SendDataIndication_Stub(
00683     IRpcStubBuffer *This,
00684     IRpcChannelBuffer *_pRpcChannelBuffer,
00685     PRPC_MESSAGE _pRpcMessage,
00686     DWORD *_pdwStubPhase);
00687
00688
00689 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_RosterReportIndication_Proxy(
00690     IAppletSessionNotify __RPC_FAR * This,
00691     /* [in] */ ULONG cRosters,
00692     /* [size_is][in] */ AppletRoster __RPC_FAR *__RPC_FAR *apAppRosters);
00693
00694
00695 void __RPC_STUB IAppletSessionNotify_RosterReportIndication_Stub(
00696     IRpcStubBuffer *This,
00697     IRpcChannelBuffer *_pRpcChannelBuffer,
00698     PRPC_MESSAGE _pRpcMessage,
00699     DWORD *_pdwStubPhase);
00700
00701
00702 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_InquireRosterConfirm_Proxy(
00703     IAppletSessionNotify __RPC_FAR * This,
00704     /* [in] */ HRESULT hrResult,
00705     /* [in] */ ULONG cRosters,
00706     /* [size_is][in] */ AppletRoster __RPC_FAR *__RPC_FAR *apAppRosters);
00707
00708
00709 void __RPC_STUB IAppletSessionNotify_InquireRosterConfirm_Stub(
00710     IRpcStubBuffer *This,
00711     IRpcChannelBuffer *_pRpcChannelBuffer,
00712     PRPC_MESSAGE _pRpcMessage,
00713     DWORD *_pdwStubPhase);
00714
00715
00716 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_InvokeAppletConfirm_Proxy(
00717     IAppletSessionNotify __RPC_FAR * This,
00718     /* [in] */ AppletRequestTag nReqTag,
00719     /* [in] */ HRESULT hrResult);
00720
00721
00722 void __RPC_STUB IAppletSessionNotify_InvokeAppletConfirm_Stub(
00723     IRpcStubBuffer *This,
00724     IRpcChannelBuffer *_pRpcChannelBuffer,
00725     PRPC_MESSAGE _pRpcMessage,
00726     DWORD *_pdwStubPhase);
00727
00728
00729 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_RegistryConfirm_Proxy(
00730     IAppletSessionNotify __RPC_FAR * This,
00731     /* [in] */ AppletRegistryCommand eCommand,
00732     /* [in] */ HRESULT hrResult,
00733     /* [in] */ AppletRegistryKey __RPC_FAR *pRegistryKey,
00734     /* [in] */ AppletRegistryItem __RPC_FAR *pRegistryItem,
00735     /* [in] */ AppletRegistryEntryOwner __RPC_FAR *pEntryOwner,
00736     /* [in] */ AppletModificationRights eRights);
00737
00738
00739 void __RPC_STUB IAppletSessionNotify_RegistryConfirm_Stub(
00740     IRpcStubBuffer *This,
00741     IRpcChannelBuffer *_pRpcChannelBuffer,
00742     PRPC_MESSAGE _pRpcMessage,
00743     DWORD *_pdwStubPhase);
00744
00745
00746 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_AllocateHandleConfirm_Proxy(
00747     IAppletSessionNotify __RPC_FAR * This,
00748     /* [in] */ HRESULT hrResult,
00749     /* [in] */ ULONG nFirstHandle,
00750     /* [in] */ ULONG cHandles);
00751
00752
00753 void __RPC_STUB IAppletSessionNotify_AllocateHandleConfirm_Stub(
00754     IRpcStubBuffer *This,
00755     IRpcChannelBuffer *_pRpcChannelBuffer,
00756     PRPC_MESSAGE _pRpcMessage,
00757     DWORD *_pdwStubPhase);
00758
00759
00760 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_ChannelConfirm_Proxy(
00761     IAppletSessionNotify __RPC_FAR * This,
00762     /* [in] */ AppletChannelCommand eCommand,
00763     /* [in] */ HRESULT hrResult,
00764     /* [in] */ AppletChannelID nChannelID);
00765
00766
00767 void __RPC_STUB IAppletSessionNotify_ChannelConfirm_Stub(
00768     IRpcStubBuffer *This,
00769     IRpcChannelBuffer *_pRpcChannelBuffer,
00770     PRPC_MESSAGE _pRpcMessage,
00771     DWORD *_pdwStubPhase);
00772
00773
00774 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_ChannelIndication_Proxy(
00775     IAppletSessionNotify __RPC_FAR * This,
00776     /* [in] */ AppletChannelCommand eCommand,
00777     /* [in] */ AppletChannelID nChannelID,
00778     /* [in] */ AppletReason eReason,
00779     /* [in] */ AppletUserID uidManager);
00780
00781
00782 void __RPC_STUB IAppletSessionNotify_ChannelIndication_Stub(
00783     IRpcStubBuffer *This,
00784     IRpcChannelBuffer *_pRpcChannelBuffer,
00785     PRPC_MESSAGE _pRpcMessage,
00786     DWORD *_pdwStubPhase);
00787
00788
00789 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_TokenConfirm_Proxy(
00790     IAppletSessionNotify __RPC_FAR * This,
00791     /* [in] */ AppletTokenCommand eCommand,
00792     /* [in] */ HRESULT hrResult,
00793     /* [in] */ AppletTokenID nTokenID);
00794
00795
00796 void __RPC_STUB IAppletSessionNotify_TokenConfirm_Stub(
00797     IRpcStubBuffer *This,
00798     IRpcChannelBuffer *_pRpcChannelBuffer,
00799     PRPC_MESSAGE _pRpcMessage,
00800     DWORD *_pdwStubPhase);
00801
00802
00803 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_TestTokenConfirm_Proxy(
00804     IAppletSessionNotify __RPC_FAR * This,
00805     /* [in] */ AppletTokenID nTokenID,
00806     /* [in] */ AppletTokenStatus eStatus);
00807
00808
00809 void __RPC_STUB IAppletSessionNotify_TestTokenConfirm_Stub(
00810     IRpcStubBuffer *This,
00811     IRpcChannelBuffer *_pRpcChannelBuffer,
00812     PRPC_MESSAGE _pRpcMessage,
00813     DWORD *_pdwStubPhase);
00814
00815
00816 HRESULT STDMETHODCALLTYPE IAppletSessionNotify_TokenIndication_Proxy(
00817     IAppletSessionNotify __RPC_FAR * This,
00818     /* [in] */ AppletTokenCommand eCommand,
00819     /* [in] */ AppletReason eReason,
00820     /* [in] */ AppletTokenID nTokenID,
00821     /* [in] */ AppletUserID uidInitiator);
00822
00823
00824 void __RPC_STUB IAppletSessionNotify_TokenIndication_Stub(
00825     IRpcStubBuffer *This,
00826     IRpcChannelBuffer *_pRpcChannelBuffer,
00827     PRPC_MESSAGE _pRpcMessage,
00828     DWORD *_pdwStubPhase);
00829
00830
00831
00832 #endif  /* __IAppletSessionNotify_INTERFACE_DEFINED__ */
00833
00834
00835 #ifndef __IAppletSession_INTERFACE_DEFINED__
00836 #define __IAppletSession_INTERFACE_DEFINED__
00837
00838 /* interface IAppletSession */
00839 /* [unique][uuid][object] */
00840
00841
00842 EXTERN_C const IID IID_IAppletSession;
00843
00844 #if defined(__cplusplus) && !defined(CINTERFACE)
00845
00846     MIDL_INTERFACE("e65dc590-a4d9-11d2-b724-00104bc51339")
00847     IAppletSession : public IUnknown
00848     {
00849     public:
00850         virtual HRESULT STDMETHODCALLTYPE GetConfID(
00851             /* [out] */ AppletConfID __RPC_FAR *pnConfID) = 0;
00852
00853         virtual HRESULT STDMETHODCALLTYPE IsThisNodeTopProvider(
00854             /* [out] */ BOOL __RPC_FAR *pfTopProvider) = 0;
00855
00856         virtual HRESULT STDMETHODCALLTYPE Join(
00857             /* [in] */ AppletSessionRequest __RPC_FAR *pRequest) = 0;
00858
00859         virtual HRESULT STDMETHODCALLTYPE Leave( void) = 0;
00860
00861         virtual HRESULT STDMETHODCALLTYPE SendData(
00862             /* [in] */ BOOL fUniformSend,
00863             /* [in] */ AppletChannelID nChannelID,
00864             /* [in] */ AppletPriority ePriority,
00865             /* [in] */ ULONG cbBufSize,
00866             /* [size_is][in] */ BYTE __RPC_FAR *pBuffer) = 0;
00867
00868         virtual HRESULT STDMETHODCALLTYPE InvokeApplet(
00869             /* [out] */ AppletRequestTag __RPC_FAR *pnReqTag,
00870             /* [in] */ AppletProtocolEntity __RPC_FAR *pAPE,
00871             /* [in] */ ULONG cNodes,
00872             /* [size_is][in] */ AppletNodeID __RPC_FAR aNodeIDs[  ]) = 0;
00873
00874         virtual HRESULT STDMETHODCALLTYPE InquireRoster(
00875             /* [in] */ AppletSessionKey __RPC_FAR *pSessionKey) = 0;
00876
00877         virtual HRESULT STDMETHODCALLTYPE RegistryRequest(
00878             /* [in] */ AppletRegistryRequest __RPC_FAR *pRequest) = 0;
00879
00880         virtual HRESULT STDMETHODCALLTYPE ChannelRequest(
00881             /* [in] */ AppletChannelRequest __RPC_FAR *pRequest) = 0;
00882
00883         virtual HRESULT STDMETHODCALLTYPE TokenRequest(
00884             /* [in] */ AppletTokenRequest __RPC_FAR *pRequest) = 0;
00885
00886         virtual HRESULT STDMETHODCALLTYPE Advise(
00887             /* [in] */ IAppletSessionNotify __RPC_FAR *pNotify,
00888             /* [out] */ DWORD __RPC_FAR *pdwCookie) = 0;
00889
00890         virtual HRESULT STDMETHODCALLTYPE UnAdvise(
00891             /* [in] */ DWORD dwCookie) = 0;
00892
00893     };
00894
00895 #else   /* C style interface */
00896
00897     typedef struct IAppletSessionVtbl
00898     {
00899         BEGIN_INTERFACE
00900
00901         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00902             IAppletSession __RPC_FAR * This,
00903             /* [in] */ REFIID riid,
00904             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00905
00906         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00907             IAppletSession __RPC_FAR * This);
00908
00909         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00910             IAppletSession __RPC_FAR * This);
00911
00912         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetConfID )(
00913             IAppletSession __RPC_FAR * This,
00914             /* [out] */ AppletConfID __RPC_FAR *pnConfID);
00915
00916         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *IsThisNodeTopProvider )(
00917             IAppletSession __RPC_FAR * This,
00918             /* [out] */ BOOL __RPC_FAR *pfTopProvider);
00919
00920         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Join )(
00921             IAppletSession __RPC_FAR * This,
00922             /* [in] */ AppletSessionRequest __RPC_FAR *pRequest);
00923
00924         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Leave )(
00925             IAppletSession __RPC_FAR * This);
00926
00927         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SendData )(
00928             IAppletSession __RPC_FAR * This,
00929             /* [in] */ BOOL fUniformSend,
00930             /* [in] */ AppletChannelID nChannelID,
00931             /* [in] */ AppletPriority ePriority,
00932             /* [in] */ ULONG cbBufSize,
00933             /* [size_is][in] */ BYTE __RPC_FAR *pBuffer);
00934
00935         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *InvokeApplet )(
00936             IAppletSession __RPC_FAR * This,
00937             /* [out] */ AppletRequestTag __RPC_FAR *pnReqTag,
00938             /* [in] */ AppletProtocolEntity __RPC_FAR *pAPE,
00939             /* [in] */ ULONG cNodes,
00940             /* [size_is][in] */ AppletNodeID __RPC_FAR aNodeIDs[  ]);
00941
00942         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *InquireRoster )(
00943             IAppletSession __RPC_FAR * This,
00944             /* [in] */ AppletSessionKey __RPC_FAR *pSessionKey);
00945
00946         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RegistryRequest )(
00947             IAppletSession __RPC_FAR * This,
00948             /* [in] */ AppletRegistryRequest __RPC_FAR *pRequest);
00949
00950         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ChannelRequest )(
00951             IAppletSession __RPC_FAR * This,
00952             /* [in] */ AppletChannelRequest __RPC_FAR *pRequest);
00953
00954         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *TokenRequest )(
00955             IAppletSession __RPC_FAR * This,
00956             /* [in] */ AppletTokenRequest __RPC_FAR *pRequest);
00957
00958         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Advise )(
00959             IAppletSession __RPC_FAR * This,
00960             /* [in] */ IAppletSessionNotify __RPC_FAR *pNotify,
00961             /* [out] */ DWORD __RPC_FAR *pdwCookie);
00962
00963         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *UnAdvise )(
00964             IAppletSession __RPC_FAR * This,
00965             /* [in] */ DWORD dwCookie);
00966
00967         END_INTERFACE
00968     } IAppletSessionVtbl;
00969
00970     interface IAppletSession
00971     {
00972         CONST_VTBL struct IAppletSessionVtbl __RPC_FAR *lpVtbl;
00973     };
00974
00975
00976
00977 #ifdef COBJMACROS
00978
00979
00980 #define IAppletSession_QueryInterface(This,riid,ppvObject)  \
00981     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00982
00983 #define IAppletSession_AddRef(This) \
00984     (This)->lpVtbl -> AddRef(This)
00985
00986 #define IAppletSession_Release(This)  \
00987     (This)->lpVtbl -> Release(This)
00988
00989
00990 #define IAppletSession_GetConfID(This,pnConfID) \
00991     (This)->lpVtbl -> GetConfID(This,pnConfID)
00992
00993 #define IAppletSession_IsThisNodeTopProvider(This,pfTopProvider)  \
00994     (This)->lpVtbl -> IsThisNodeTopProvider(This,pfTopProvider)
00995
00996 #define IAppletSession_Join(This,pRequest)  \
00997     (This)->lpVtbl -> Join(This,pRequest)
00998
00999 #define IAppletSession_Leave(This)  \
01000     (This)->lpVtbl -> Leave(This)
01001
01002 #define IAppletSession_SendData(This,fUniformSend,nChannelID,ePriority,cbBufSize,pBuffer) \
01003     (This)->lpVtbl -> SendData(This,fUniformSend,nChannelID,ePriority,cbBufSize,pBuffer)
01004
01005 #define IAppletSession_InvokeApplet(This,pnReqTag,pAPE,cNodes,aNodeIDs) \
01006     (This)->lpVtbl -> InvokeApplet(This,pnReqTag,pAPE,cNodes,aNodeIDs)
01007
01008 #define IAppletSession_InquireRoster(This,pSessionKey)  \
01009     (This)->lpVtbl -> InquireRoster(This,pSessionKey)
01010
01011 #define IAppletSession_RegistryRequest(This,pRequest) \
01012     (This)->lpVtbl -> RegistryRequest(This,pRequest)
01013
01014 #define IAppletSession_ChannelRequest(This,pRequest)  \
01015     (This)->lpVtbl -> ChannelRequest(This,pRequest)
01016
01017 #define IAppletSession_TokenRequest(This,pRequest)  \
01018     (This)->lpVtbl -> TokenRequest(This,pRequest)
01019
01020 #define IAppletSession_Advise(This,pNotify,pdwCookie) \
01021     (This)->lpVtbl -> Advise(This,pNotify,pdwCookie)
01022
01023 #define IAppletSession_UnAdvise(This,dwCookie)  \
01024     (This)->lpVtbl -> UnAdvise(This,dwCookie)
01025
01026 #endif /* COBJMACROS */
01027
01028
01029 #endif  /* C style interface */
01030
01031
01032
01033 HRESULT STDMETHODCALLTYPE IAppletSession_GetConfID_Proxy(
01034     IAppletSession __RPC_FAR * This,
01035     /* [out] */ AppletConfID __RPC_FAR *pnConfID);
01036
01037
01038 void __RPC_STUB IAppletSession_GetConfID_Stub(
01039     IRpcStubBuffer *This,
01040     IRpcChannelBuffer *_pRpcChannelBuffer,
01041     PRPC_MESSAGE _pRpcMessage,
01042     DWORD *_pdwStubPhase);
01043
01044
01045 HRESULT STDMETHODCALLTYPE IAppletSession_IsThisNodeTopProvider_Proxy(
01046     IAppletSession __RPC_FAR * This,
01047     /* [out] */ BOOL __RPC_FAR *pfTopProvider);
01048
01049
01050 void __RPC_STUB IAppletSession_IsThisNodeTopProvider_Stub(
01051     IRpcStubBuffer *This,
01052     IRpcChannelBuffer *_pRpcChannelBuffer,
01053     PRPC_MESSAGE _pRpcMessage,
01054     DWORD *_pdwStubPhase);
01055
01056
01057 HRESULT STDMETHODCALLTYPE IAppletSession_Join_Proxy(
01058     IAppletSession __RPC_FAR * This,
01059     /* [in] */ AppletSessionRequest __RPC_FAR *pRequest);
01060
01061
01062 void __RPC_STUB IAppletSession_Join_Stub(
01063     IRpcStubBuffer *This,
01064     IRpcChannelBuffer *_pRpcChannelBuffer,
01065     PRPC_MESSAGE _pRpcMessage,
01066     DWORD *_pdwStubPhase);
01067
01068
01069 HRESULT STDMETHODCALLTYPE IAppletSession_Leave_Proxy(
01070     IAppletSession __RPC_FAR * This);
01071
01072
01073 void __RPC_STUB IAppletSession_Leave_Stub(
01074     IRpcStubBuffer *This,
01075     IRpcChannelBuffer *_pRpcChannelBuffer,
01076     PRPC_MESSAGE _pRpcMessage,
01077     DWORD *_pdwStubPhase);
01078
01079
01080 HRESULT STDMETHODCALLTYPE IAppletSession_SendData_Proxy(
01081     IAppletSession __RPC_FAR * This,
01082     /* [in] */ BOOL fUniformSend,
01083     /* [in] */ AppletChannelID nChannelID,
01084     /* [in] */ AppletPriority ePriority,
01085     /* [in] */ ULONG cbBufSize,
01086     /* [size_is][in] */ BYTE __RPC_FAR *pBuffer);
01087
01088
01089 void __RPC_STUB IAppletSession_SendData_Stub(
01090     IRpcStubBuffer *This,
01091     IRpcChannelBuffer *_pRpcChannelBuffer,
01092     PRPC_MESSAGE _pRpcMessage,
01093     DWORD *_pdwStubPhase);
01094
01095
01096 HRESULT STDMETHODCALLTYPE IAppletSession_InvokeApplet_Proxy(
01097     IAppletSession __RPC_FAR * This,
01098     /* [out] */ AppletRequestTag __RPC_FAR *pnReqTag,
01099     /* [in] */ AppletProtocolEntity __RPC_FAR *pAPE,
01100     /* [in] */ ULONG cNodes,
01101     /* [size_is][in] */ AppletNodeID __RPC_FAR aNodeIDs[  ]);
01102
01103
01104 void __RPC_STUB IAppletSession_InvokeApplet_Stub(
01105     IRpcStubBuffer *This,
01106     IRpcChannelBuffer *_pRpcChannelBuffer,
01107     PRPC_MESSAGE _pRpcMessage,
01108     DWORD *_pdwStubPhase);
01109
01110
01111 HRESULT STDMETHODCALLTYPE IAppletSession_InquireRoster_Proxy(
01112     IAppletSession __RPC_FAR * This,
01113     /* [in] */ AppletSessionKey __RPC_FAR *pSessionKey);
01114
01115
01116 void __RPC_STUB IAppletSession_InquireRoster_Stub(
01117     IRpcStubBuffer *This,
01118     IRpcChannelBuffer *_pRpcChannelBuffer,
01119     PRPC_MESSAGE _pRpcMessage,
01120     DWORD *_pdwStubPhase);
01121
01122
01123 HRESULT STDMETHODCALLTYPE IAppletSession_RegistryRequest_Proxy(
01124     IAppletSession __RPC_FAR * This,
01125     /* [in] */ AppletRegistryRequest __RPC_FAR *pRequest);
01126
01127
01128 void __RPC_STUB IAppletSession_RegistryRequest_Stub(
01129     IRpcStubBuffer *This,
01130     IRpcChannelBuffer *_pRpcChannelBuffer,
01131     PRPC_MESSAGE _pRpcMessage,
01132     DWORD *_pdwStubPhase);
01133
01134
01135 HRESULT STDMETHODCALLTYPE IAppletSession_ChannelRequest_Proxy(
01136     IAppletSession __RPC_FAR * This,
01137     /* [in] */ AppletChannelRequest __RPC_FAR *pRequest);
01138
01139
01140 void __RPC_STUB IAppletSession_ChannelRequest_Stub(
01141     IRpcStubBuffer *This,
01142     IRpcChannelBuffer *_pRpcChannelBuffer,
01143     PRPC_MESSAGE _pRpcMessage,
01144     DWORD *_pdwStubPhase);
01145
01146
01147 HRESULT STDMETHODCALLTYPE IAppletSession_TokenRequest_Proxy(
01148     IAppletSession __RPC_FAR * This,
01149     /* [in] */ AppletTokenRequest __RPC_FAR *pRequest);
01150
01151
01152 void __RPC_STUB IAppletSession_TokenRequest_Stub(
01153     IRpcStubBuffer *This,
01154     IRpcChannelBuffer *_pRpcChannelBuffer,
01155     PRPC_MESSAGE _pRpcMessage,
01156     DWORD *_pdwStubPhase);
01157
01158
01159 HRESULT STDMETHODCALLTYPE IAppletSession_Advise_Proxy(
01160     IAppletSession __RPC_FAR * This,
01161     /* [in] */ IAppletSessionNotify __RPC_FAR *pNotify,
01162     /* [out] */ DWORD __RPC_FAR *pdwCookie);
01163
01164
01165 void __RPC_STUB IAppletSession_Advise_Stub(
01166     IRpcStubBuffer *This,
01167     IRpcChannelBuffer *_pRpcChannelBuffer,
01168     PRPC_MESSAGE _pRpcMessage,
01169     DWORD *_pdwStubPhase);
01170
01171
01172 HRESULT STDMETHODCALLTYPE IAppletSession_UnAdvise_Proxy(
01173     IAppletSession __RPC_FAR * This,
01174     /* [in] */ DWORD dwCookie);
01175
01176
01177 void __RPC_STUB IAppletSession_UnAdvise_Stub(
01178     IRpcStubBuffer *This,
01179     IRpcChannelBuffer *_pRpcChannelBuffer,
01180     PRPC_MESSAGE _pRpcMessage,
01181     DWORD *_pdwStubPhase);
01182
01183
01184
01185 #endif  /* __IAppletSession_INTERFACE_DEFINED__ */
01186
01187
01188 #ifndef __IAppletNotify_INTERFACE_DEFINED__
01189 #define __IAppletNotify_INTERFACE_DEFINED__
01190
01191 /* interface IAppletNotify */
01192 /* [unique][uuid][object] */
01193
01194
01195 EXTERN_C const IID IID_IAppletNotify;
01196
01197 #if defined(__cplusplus) && !defined(CINTERFACE)
01198
01199     MIDL_INTERFACE("16153670-a4da-11d2-b724-00104bc51339")
01200     IAppletNotify : public IUnknown
01201     {
01202     public:
01203         virtual HRESULT STDMETHODCALLTYPE PermitToJoinSessionIndication(
01204             /* [in] */ AppletConfID nConfID,
01205             /* [in] */ BOOL fPermissionGranted) = 0;
01206
01207         virtual HRESULT STDMETHODCALLTYPE AutoJoinSessionIndication(
01208             /* [in] */ IAppletSession __RPC_FAR *pSession,
01209             /* [in] */ HRESULT hrResult,
01210             /* [in] */ AppletUserID uidMyself,
01211             /* [in] */ AppletNodeID nidMyself,
01212             /* [in] */ AppletSessionID sidMyself,
01213             /* [in] */ AppletEntityID eidMyself,
01214             /* [in] */ ULONG cDynamicChannels,
01215             /* [size_is][in] */ AppletChannelID __RPC_FAR aDynamicChannels[  ]) = 0;
01216
01217     };
01218
01219 #else   /* C style interface */
01220
01221     typedef struct IAppletNotifyVtbl
01222     {
01223         BEGIN_INTERFACE
01224
01225         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
01226             IAppletNotify __RPC_FAR * This,
01227             /* [in] */ REFIID riid,
01228             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
01229
01230         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
01231             IAppletNotify __RPC_FAR * This);
01232
01233         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
01234             IAppletNotify __RPC_FAR * This);
01235
01236         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PermitToJoinSessionIndication )(
01237             IAppletNotify __RPC_FAR * This,
01238             /* [in] */ AppletConfID nConfID,
01239             /* [in] */ BOOL fPermissionGranted);
01240
01241         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AutoJoinSessionIndication )(
01242             IAppletNotify __RPC_FAR * This,
01243             /* [in] */ IAppletSession __RPC_FAR *pSession,
01244             /* [in] */ HRESULT hrResult,
01245             /* [in] */ AppletUserID uidMyself,
01246             /* [in] */ AppletNodeID nidMyself,
01247             /* [in] */ AppletSessionID sidMyself,
01248             /* [in] */ AppletEntityID eidMyself,
01249             /* [in] */ ULONG cDynamicChannels,
01250             /* [size_is][in] */ AppletChannelID __RPC_FAR aDynamicChannels[  ]);
01251
01252         END_INTERFACE
01253     } IAppletNotifyVtbl;
01254
01255     interface IAppletNotify
01256     {
01257         CONST_VTBL struct IAppletNotifyVtbl __RPC_FAR *lpVtbl;
01258     };
01259
01260
01261
01262 #ifdef COBJMACROS
01263
01264
01265 #define IAppletNotify_QueryInterface(This,riid,ppvObject) \
01266     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
01267
01268 #define IAppletNotify_AddRef(This)  \
01269     (This)->lpVtbl -> AddRef(This)
01270
01271 #define IAppletNotify_Release(This) \
01272     (This)->lpVtbl -> Release(This)
01273
01274
01275 #define IAppletNotify_PermitToJoinSessionIndication(This,nConfID,fPermissionGranted)  \
01276     (This)->lpVtbl -> PermitToJoinSessionIndication(This,nConfID,fPermissionGranted)
01277
01278 #define IAppletNotify_AutoJoinSessionIndication(This,pSession,hrResult,uidMyself,nidMyself,sidMyself,eidMyself,cDynamicChannels,aDynamicChannels) \
01279     (This)->lpVtbl -> AutoJoinSessionIndication(This,pSession,hrResult,uidMyself,nidMyself,sidMyself,eidMyself,cDynamicChannels,aDynamicChannels)
01280
01281 #endif /* COBJMACROS */
01282
01283
01284 #endif  /* C style interface */
01285
01286
01287
01288 HRESULT STDMETHODCALLTYPE IAppletNotify_PermitToJoinSessionIndication_Proxy(
01289     IAppletNotify __RPC_FAR * This,
01290     /* [in] */ AppletConfID nConfID,
01291     /* [in] */ BOOL fPermissionGranted);
01292
01293
01294 void __RPC_STUB IAppletNotify_PermitToJoinSessionIndication_Stub(
01295     IRpcStubBuffer *This,
01296     IRpcChannelBuffer *_pRpcChannelBuffer,
01297     PRPC_MESSAGE _pRpcMessage,
01298     DWORD *_pdwStubPhase);
01299
01300
01301 HRESULT STDMETHODCALLTYPE IAppletNotify_AutoJoinSessionIndication_Proxy(
01302     IAppletNotify __RPC_FAR * This,
01303     /* [in] */ IAppletSession __RPC_FAR *pSession,
01304     /* [in] */ HRESULT hrResult,
01305     /* [in] */ AppletUserID uidMyself,
01306     /* [in] */ AppletNodeID nidMyself,
01307     /* [in] */ AppletSessionID sidMyself,
01308     /* [in] */ AppletEntityID eidMyself,
01309     /* [in] */ ULONG cDynamicChannels,
01310     /* [size_is][in] */ AppletChannelID __RPC_FAR aDynamicChannels[  ]);
01311
01312
01313 void __RPC_STUB IAppletNotify_AutoJoinSessionIndication_Stub(
01314     IRpcStubBuffer *This,
01315     IRpcChannelBuffer *_pRpcChannelBuffer,
01316     PRPC_MESSAGE _pRpcMessage,
01317     DWORD *_pdwStubPhase);
01318
01319
01320
01321 #endif  /* __IAppletNotify_INTERFACE_DEFINED__ */
01322
01323
01324 #ifndef __IApplet_INTERFACE_DEFINED__
01325 #define __IApplet_INTERFACE_DEFINED__
01326
01327 /* interface IApplet */
01328 /* [unique][uuid][object] */
01329
01330
01331 EXTERN_C const IID IID_IApplet;
01332
01333 #if defined(__cplusplus) && !defined(CINTERFACE)
01334
01335     MIDL_INTERFACE("07970b30-a4da-11d2-b724-00104bc51339")
01336     IApplet : public IUnknown
01337     {
01338     public:
01339         virtual HRESULT STDMETHODCALLTYPE Initialize( void) = 0;
01340
01341         virtual HRESULT STDMETHODCALLTYPE RegisterAutoJoin(
01342             /* [in] */ AppletSessionRequest __RPC_FAR *pRequest) = 0;
01343
01344         virtual HRESULT STDMETHODCALLTYPE UnregisterAutoJoin( void) = 0;
01345
01346         virtual HRESULT STDMETHODCALLTYPE CreateSession(
01347             /* [out] */ IAppletSession __RPC_FAR *__RPC_FAR *ppSession,
01348             /* [in] */ AppletConfID nConfID) = 0;
01349
01350         virtual HRESULT STDMETHODCALLTYPE Advise(
01351             /* [in] */ IAppletNotify __RPC_FAR *pNotify,
01352             /* [out] */ DWORD __RPC_FAR *pdwCookie) = 0;
01353
01354         virtual HRESULT STDMETHODCALLTYPE UnAdvise(
01355             /* [in] */ DWORD dwCookie) = 0;
01356
01357     };
01358
01359 #else   /* C style interface */
01360
01361     typedef struct IAppletVtbl
01362     {
01363         BEGIN_INTERFACE
01364
01365         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
01366             IApplet __RPC_FAR * This,
01367             /* [in] */ REFIID riid,
01368             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
01369
01370         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
01371             IApplet __RPC_FAR * This);
01372
01373         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
01374             IApplet __RPC_FAR * This);
01375
01376         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Initialize )(
01377             IApplet __RPC_FAR * This);
01378
01379         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RegisterAutoJoin )(
01380             IApplet __RPC_FAR * This,
01381             /* [in] */ AppletSessionRequest __RPC_FAR *pRequest);
01382
01383         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *UnregisterAutoJoin )(
01384             IApplet __RPC_FAR * This);
01385
01386         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreateSession )(
01387             IApplet __RPC_FAR * This,
01388             /* [out] */ IAppletSession __RPC_FAR *__RPC_FAR *ppSession,
01389             /* [in] */ AppletConfID nConfID);
01390
01391         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Advise )(
01392             IApplet __RPC_FAR * This,
01393             /* [in] */ IAppletNotify __RPC_FAR *pNotify,
01394             /* [out] */ DWORD __RPC_FAR *pdwCookie);
01395
01396         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *UnAdvise )(
01397             IApplet __RPC_FAR * This,
01398             /* [in] */ DWORD dwCookie);
01399
01400         END_INTERFACE
01401     } IAppletVtbl;
01402
01403     interface IApplet
01404     {
01405         CONST_VTBL struct IAppletVtbl __RPC_FAR *lpVtbl;
01406     };
01407
01408
01409
01410 #ifdef COBJMACROS
01411
01412
01413 #define IApplet_QueryInterface(This,riid,ppvObject) \
01414     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
01415
01416 #define IApplet_AddRef(This)  \
01417     (This)->lpVtbl -> AddRef(This)
01418
01419 #define IApplet_Release(This) \
01420     (This)->lpVtbl -> Release(This)
01421
01422
01423 #define IApplet_Initialize(This)  \
01424     (This)->lpVtbl -> Initialize(This)
01425
01426 #define IApplet_RegisterAutoJoin(This,pRequest) \
01427     (This)->lpVtbl -> RegisterAutoJoin(This,pRequest)
01428
01429 #define IApplet_UnregisterAutoJoin(This)  \
01430     (This)->lpVtbl -> UnregisterAutoJoin(This)
01431
01432 #define IApplet_CreateSession(This,ppSession,nConfID) \
01433     (This)->lpVtbl -> CreateSession(This,ppSession,nConfID)
01434
01435 #define IApplet_Advise(This,pNotify,pdwCookie)  \
01436     (This)->lpVtbl -> Advise(This,pNotify,pdwCookie)
01437
01438 #define IApplet_UnAdvise(This,dwCookie) \
01439     (This)->lpVtbl -> UnAdvise(This,dwCookie)
01440
01441 #endif /* COBJMACROS */
01442
01443
01444 #endif  /* C style interface */
01445
01446
01447
01448 HRESULT STDMETHODCALLTYPE IApplet_Initialize_Proxy(
01449     IApplet __RPC_FAR * This);
01450
01451
01452 void __RPC_STUB IApplet_Initialize_Stub(
01453     IRpcStubBuffer *This,
01454     IRpcChannelBuffer *_pRpcChannelBuffer,
01455     PRPC_MESSAGE _pRpcMessage,
01456     DWORD *_pdwStubPhase);
01457
01458
01459 HRESULT STDMETHODCALLTYPE IApplet_RegisterAutoJoin_Proxy(
01460     IApplet __RPC_FAR * This,
01461     /* [in] */ AppletSessionRequest __RPC_FAR *pRequest);
01462
01463
01464 void __RPC_STUB IApplet_RegisterAutoJoin_Stub(
01465     IRpcStubBuffer *This,
01466     IRpcChannelBuffer *_pRpcChannelBuffer,
01467     PRPC_MESSAGE _pRpcMessage,
01468     DWORD *_pdwStubPhase);
01469
01470
01471 HRESULT STDMETHODCALLTYPE IApplet_UnregisterAutoJoin_Proxy(
01472     IApplet __RPC_FAR * This);
01473
01474
01475 void __RPC_STUB IApplet_UnregisterAutoJoin_Stub(
01476     IRpcStubBuffer *This,
01477     IRpcChannelBuffer *_pRpcChannelBuffer,
01478     PRPC_MESSAGE _pRpcMessage,
01479     DWORD *_pdwStubPhase);
01480
01481
01482 HRESULT STDMETHODCALLTYPE IApplet_CreateSession_Proxy(
01483     IApplet __RPC_FAR * This,
01484     /* [out] */ IAppletSession __RPC_FAR *__RPC_FAR *ppSession,
01485     /* [in] */ AppletConfID nConfID);
01486
01487
01488 void __RPC_STUB IApplet_CreateSession_Stub(
01489     IRpcStubBuffer *This,
01490     IRpcChannelBuffer *_pRpcChannelBuffer,
01491     PRPC_MESSAGE _pRpcMessage,
01492     DWORD *_pdwStubPhase);
01493
01494
01495 HRESULT STDMETHODCALLTYPE IApplet_Advise_Proxy(
01496     IApplet __RPC_FAR * This,
01497     /* [in] */ IAppletNotify __RPC_FAR *pNotify,
01498     /* [out] */ DWORD __RPC_FAR *pdwCookie);
01499
01500
01501 void __RPC_STUB IApplet_Advise_Stub(
01502     IRpcStubBuffer *This,
01503     IRpcChannelBuffer *_pRpcChannelBuffer,
01504     PRPC_MESSAGE _pRpcMessage,
01505     DWORD *_pdwStubPhase);
01506
01507
01508 HRESULT STDMETHODCALLTYPE IApplet_UnAdvise_Proxy(
01509     IApplet __RPC_FAR * This,
01510     /* [in] */ DWORD dwCookie);
01511
01512
01513 void __RPC_STUB IApplet_UnAdvise_Stub(
01514     IRpcStubBuffer *This,
01515     IRpcChannelBuffer *_pRpcChannelBuffer,
01516     PRPC_MESSAGE _pRpcMessage,
01517     DWORD *_pdwStubPhase);
01518
01519
01520
01521 #endif  /* __IApplet_INTERFACE_DEFINED__ */
01522
01523
01524 /* interface __MIDL_itf_iapplet_0212 */
01525 /* [local] */
01526
01527 enum { NmApplet_Ver_Major = 1};
01528 enum { NmApplet_Ver_Minor = 0};
01529
01530
01531 extern RPC_IF_HANDLE __MIDL_itf_iapplet_0212_v0_0_c_ifspec;
01532 extern RPC_IF_HANDLE __MIDL_itf_iapplet_0212_v0_0_s_ifspec;
01533
01534
01535 #ifndef __NmApplet_LIBRARY_DEFINED__
01536 #define __NmApplet_LIBRARY_DEFINED__
01537
01538 /* library NmApplet */
01539 /* [helpstring][version][uuid] */
01540
01541
01542 EXTERN_C const IID LIBID_NmApplet;
01543
01544 EXTERN_C const CLSID CLSID_NmApplet;
01545
01546 #ifdef __cplusplus
01547
01548 class DECLSPEC_UUID("8C3ADF99-CCFE-11d2-AD10-00C04F72DD47")
01549 NmApplet;
01550 #endif
01551 #endif /* __NmApplet_LIBRARY_DEFINED__ */
01552
01553 /* Additional Prototypes for ALL interfaces */
01554
01555 /* end of Additional Prototypes */
01556
01557 #ifdef __cplusplus
01558 }
01559 #endif
01560
01561 #endif
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLDisp Member List

This is the complete list of members for CLDisp, including all inherited members.
Alloc(long *pJAustin) | CLDisp |
CLDisp() | CLDisp | [inline]
CreateResource(const RESTYPID ResTypId, RESID *pResId, TIMEINSECS *SecsFreeBeforeDestroy) | CLDisp |
DeAlloc(long JAustin) | CLDisp |
DECLARE_CLASSFACTORY_SINGLETON(CLDisp) | CLDisp |
DECLARE_PROTECT_FINAL_CONSTRUCT() | CLDisp |
DestroyResource(const RESID ResId) | CLDisp |
DestroyResourceS(constSRESID ResId) | CLDisp |
EnlistResource(const RESID ResId, const TRANSID TransId) | CLDisp |
FinalConstruct() | CLDisp | [inline]
FinalRelease() | CLDisp | [inline]
m_cs | CLDisp | [private]
m_pDispMan | CLDisp | [private]
m_pHolder | CLDisp | [private]
m_pUnkMarshaler | CLDisp |
RateResource(const RESTYPID ResTypId, const RESID ResId, const BOOL fRequiresTransactionEnlistment, RESOURCERATING *pRating) | CLDisp |
ResetResource(const RESID ResId) | CLDisp |
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::_Stream Member List

This is the complete list of members for msado15::_Stream, including all inherited members.
Cancel() | msado15::_Stream |
Close() | msado15::_Stream |
CopyTo(msado15._Stream DestStream, int CharNumber) | msado15::_Stream |
Flush() | msado15::_Stream |
getCharset() | msado15::_Stream |
getEOS() | msado15::_Stream |
getLineSeparator() | msado15::_Stream |
getMode() | msado15::_Stream |
getPosition() | msado15::_Stream |
getSize() | msado15::_Stream |
getState() | msado15::_Stream |
getType() | msado15::_Stream |
iid | msado15::_Stream | [static]
LoadFromFile(String FileName) | msado15::_Stream |
Open(Variant Source, int Mode, int Options, String UserName, String Password) | msado15::_Stream |
Read(int NumBytes) | msado15::_Stream |
ReadText(int NumChars) | msado15::_Stream |
SaveToFile(String FileName, int Options) | msado15::_Stream |
setCharset(String pbstrCharset) | msado15::_Stream |
SetEOS() | msado15::_Stream |
setLineSeparator(int pLS) | msado15::_Stream |
setMode(int pMode) | msado15::_Stream |
setPosition(int pPos) | msado15::_Stream |
setType(int ptype) | msado15::_Stream |
SkipLine() | msado15::_Stream |
Write(Variant Buffer) | msado15::_Stream |
WriteText(String Data, int Options) | msado15::_Stream |
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/LSP/asyncselect.cpp Source File

  • NetDS
  • WinSock
  • LSP

asyncselect.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: asyncselect.cpp
00009 //
00010 // Description:
00011 //    This file contains the routines necessary to implement the WSPAsyncSelect
00012 //    API. In order for our LSP to count the bytes sent and received by an
00013 //    application when the app uses WSAAsyncSelect we need to intercept all
00014 //    of the app's send and receive calls. To do this we implement a hidden
00015 //    window. When the app makes a send/recv call we intercept this and post
00016 //    the operation with the provider's socket to our own window. This allows
00017 //    the LSP to receive the completion notification. At this point we will
00018 //    update the statistics and then post the completion to the app's window
00019 //    so that it may continue as expected.
00020 //
00021 //    This file contains the I/O manager for all WSAAsyncselect I/O operations
00022 //
00023 #include "provider.h"
00024
00025 #include <windows.h>
00026
00027 #define PROVIDER_CLASS TEXT("Layered WS2 Provider")
00028
00029 #define MAX_ASYNC_RETRIES   7
00030 #define ASYNC_TIMEOUT       500         // half a second
00031
00032
00033 //
00034 // External globals defined in spi.cpp
00035 //
00036 extern HINSTANCE        hDllInstance;
00037 extern CRITICAL_SECTION gCriticalSection;
00038 extern HANDLE           gAddContextEvent;
00039
00040 //
00041 // Function Prototypes
00042 //
00043 static DWORD WINAPI AsyncMsgHandler(LPVOID lpParameter);
00044 static LRESULT CALLBACK AsyncWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00045
00046 //
00047 // Globals
00048 //
00049 static HANDLE   WorkerThreadHandle = NULL;        // Dispatch thread for handing window messages
00050 static HWND     AsyncWindow = NULL;               // Handle to the hidden window
00051
00052 static TCHAR    Msg[512];                         // For outputting debug messages
00053
00054 //
00055 // Function: StopAsyncWindowManager
00056 //
00057 // Description:
00058 //    This function cleans up the subsystem that handles asynchronous
00059 //    window IO (e.g. WSAAsyncSelect). Basically, it destroys the the
00060 //    hidden window if its been created. Note that this function is
00061 //    only called from WSPCleanup when the DLL is about to be unloaded,
00062 //    and we've already entered the critical section (gCriticalSection).
00063 //
00064 int StopAsyncWindowManager()
00065 {
00066     if (AsyncWindow)
00067     {
00068         DestroyWindow(AsyncWindow);
00069         AsyncWindow = NULL;
00070
00071         CloseHandle(WorkerThreadHandle);
00072     }
00073     return 0;
00074 }
00075
00076 //
00077 // Function: GetWorkerWindow
00078 //
00079 // Description:
00080 //    This returns a handle to our hidden window that acts as an
00081 //    intermediary between the apps window and winsock. If the window
00082 //    hasn't already been created, then create it.
00083 //
00084 HWND GetWorkerWindow()
00085 {
00086   DWORD ThreadId;
00087
00088     EnterCriticalSection(&gCriticalSection);
00089   if (WorkerThreadHandle == NULL)
00090   {
00091     WorkerThreadHandle = CreateThread(NULL, 0, AsyncMsgHandler, NULL, 0, &ThreadId);
00092         if (WorkerThreadHandle)
00093         {
00094             // Wait for the window to become initialized
00095             while (AsyncWindow == NULL)
00096                 SleepEx(0, TRUE);
00097         }
00098         else
00099         {
00100             dbgprint("GetWorkerWindow: CreateThread failed");
00101             AsyncWindow = NULL;
00102         }
00103   }
00104     LeaveCriticalSection(&gCriticalSection);
00105
00106   return AsyncWindow;
00107 }
00108
00109 //
00110 // Function: AsyncMsgHandler
00111 //
00112 // Description:
00113 //    This is the message pump for our hidden window.
00114 //
00115 static DWORD WINAPI AsyncMsgHandler(LPVOID lpParameter)
00116 {
00117   MSG      msg;
00118   DWORD    Ret;
00119     WNDCLASS wndclass;
00120
00121     wndclass.style = CS_HREDRAW | CS_VREDRAW;
00122     wndclass.lpfnWndProc = (WNDPROC)AsyncWndProc;
00123     wndclass.cbClsExtra = 0;
00124     wndclass.cbWndExtra = 0;
00125     wndclass.hInstance = hDllInstance;
00126     wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
00127     wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
00128     wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
00129     wndclass.lpszMenuName = NULL;
00130     wndclass.lpszClassName = PROVIDER_CLASS;
00131
00132     if(RegisterClass(&wndclass) == 0)
00133     {
00134         dbgprint("AsyncMsgHandle: RegisterClass failed: %d", GetLastError());
00135         return NULL;
00136     }
00137
00138     // Create a window.
00139
00140     AsyncWindow = CreateWindow(
00141         PROVIDER_CLASS,
00142         TEXT("Layered Hidden Window"),
00143         WS_OVERLAPPEDWINDOW,
00144         CW_USEDEFAULT,
00145         CW_USEDEFAULT,
00146         CW_USEDEFAULT,
00147         CW_USEDEFAULT,
00148         NULL,
00149         NULL,
00150         hDllInstance,
00151         NULL
00152     );
00153
00154     if (AsyncWindow == NULL)
00155     {
00156         dbgprint("AsyncMessageHandler: CreateWindow failed");
00157         return NULL;
00158     }
00159
00160     // Message pump
00161   while((Ret = GetMessage (&msg, NULL, 0, 0)))
00162   {
00163     if (Ret == -1)
00164     {
00165             dbgprint("AsyncMessageHandler: GetMessage returned -1, exiting loop");
00166       return 0;
00167     }
00168     TranslateMessage(&msg);
00169     DispatchMessage(&msg);
00170   }
00171   return 0;
00172 }
00173
00174 //
00175 // Function: AsyncWndProc
00176 //
00177 // Description:
00178 //    This is the window proc for our hidden window. Once we receive a message
00179 //    on our hidden window we must translate our lower provider's socket handle
00180 //    to the app's socket handle and then complete the notification to the user.
00181 //
00182 static LRESULT CALLBACK AsyncWndProc(
00183   HWND hWnd,
00184   UINT uMsg,
00185   WPARAM wParam,
00186   LPARAM lParam)
00187 {
00188   SOCK_INFO *si;
00189     int        retries,
00190                rc;
00191
00192   if (uMsg == WM_SOCKET)
00193   {
00194         retries = 0;
00195
00196         do
00197         {
00198             #ifdef DEBUG_ASYNC
00199             dbgprint("hWnd 0x%p, uMsg 0x%x, WPARAM 0x%p, LPARAM 0x%p (retries %d)",
00200                     hWnd, uMsg, wParam, lParam, retries);
00201             #endif
00202
00203             if (si = GetCallerSocket(NULL, wParam))
00204             {
00205                 MainUpCallTable.lpWPUPostMessage(
00206                         si->hWnd,
00207                         si->uMsg,
00208                         si->LayeredSocket,
00209                         lParam);
00210                 return 0;
00211             }
00212             else
00213             {
00214                 dbgprint("Unable to find socket context for 0x%p", wParam);
00215
00216
00217                 // Got a message and we coun't find the socket! This usually occurs
00218                 // after WSPAccept completes and we immediately get a message for
00219                 // the client socket BUT the socket context for that new socket hasn't
00220                 // been added to our list yet. If this occurs we'll wait on an event
00221
00222                 if (retries > MAX_ASYNC_RETRIES)
00223                 {
00224                     dbgprint("AsyncWndProc: Maximum retries exceeded waiting for socket context");
00225                     break;
00226                 }
00227
00228                 // Wait on an event which is signaled when context is added
00229                 rc = WaitForSingleObject(gAddContextEvent, ASYNC_TIMEOUT);
00230                 if (rc == WAIT_FAILED)
00231                 {
00232                     dbgprint("AsyncWndProc: WaitForSingleObject failed: %d",
00233                     GetLastError());
00234                     break;
00235                 }
00236                 else // timeout or success
00237                 {
00238                     // Reset the event if it was signaled
00239                     if (rc == WAIT_OBJECT_0)
00240                         ResetEvent(gAddContextEvent);
00241
00242                     // If signaled, hopefully next lookup will succeed
00243                     retries++;
00244                     continue;
00245                 }
00246             }
00247         } while (1);
00248   }
00249     else if (uMsg == WM_DESTROY)
00250     {
00251         // Post a quit message to exit our async message pump thread
00252         PostQuitMessage(0);
00253         return 0;
00254     }
00255
00256   return DefWindowProc(hWnd, uMsg, wParam, lParam);
00257 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/CompImportDlg.h Source File

  • Com
  • Administration
  • Explore.VC

CompImportDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019
00020 #if !defined(AFX_COMPIMPORT_H__0B7BB739_B53B_11D2_86A8_000000000000__INCLUDED_)
00021 #define AFX_COMPIMPORT_H__0B7BB739_B53B_11D2_86A8_000000000000__INCLUDED_
00022
00023 #if _MSC_VER > 1000
00024 #pragma once
00025 #endif // _MSC_VER > 1000
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CCompImportDlg dialog
00029
00030 class CCompImportDlg : public CDialog
00031 {
00032 // Construction
00033 public:
00034   void set_Catalog(ICOMAdminCatalog* pCatalog);
00035   CCompImportDlg(CWnd* pParent = NULL);   // standard constructor
00036
00037 // Dialog Data
00038   //{{AFX_DATA(CCompImportDlg)
00039   enum { IDD = IDD_IMPORT_COMPONENT };
00040   CEdit m_edtID;
00041   CStatic m_lblComponentDesc;
00042   CComboBox m_cboApplications;
00043   //}}AFX_DATA
00044
00045
00046 // Overrides
00047   // ClassWizard generated virtual function overrides
00048   //{{AFX_VIRTUAL(CCompImportDlg)
00049   protected:
00050   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00051   //}}AFX_VIRTUAL
00052
00053 // Implementation
00054 protected:
00055   HICON m_hIcon;
00056
00057   // Generated message map functions
00058   //{{AFX_MSG(CCompImportDlg)
00059   afx_msg void OnClose();
00060   virtual void OnOK();
00061   virtual BOOL OnInitDialog();
00062   afx_msg void OnCLSID();
00063   afx_msg void OnProgID();
00064   //}}AFX_MSG
00065   DECLARE_MESSAGE_MAP()
00066 private:
00067   void LoadAppCombo();
00068   int m_nImportType;
00069   void ReleaseCatalog();
00070   ICOMAdminCatalog* m_pCatalog;
00071 };
00072
00073 //{{AFX_INSERT_LOCATION}}
00074 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00075
00076 #endif // !defined(AFX_COMPIMPORT_H__0B7BB739_B53B_11D2_86A8_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/basesnap.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

basesnap.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  This file contains implementations for IClassFactory
00014 //             and the Snap-in's DLL exported functions
00015
00016
00017 #include <ObjBase.h>
00018 #include <InitGuid.h>
00019 #include "Globals.h"
00020 #include "BaseSnap.h"
00021 #include "Registry.h"
00022 #include "ContextMenuEx.h"
00023
00024
00025 #include "TraceMacro.h"
00026 #undef  MODULESTRING
00027 #define MODULESTRING  _T("BaseSnap")
00028
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 //  Implementation of IClassFactory for CComponentData
00032
00033 //---------------------------------------------------------------------------
00034 CClassFactory::CClassFactory( FACTORY_TYPE eFactoryType )
00035 {
00036   m_cRef = 0;
00037   m_FactoryType = eFactoryType;
00038
00039   InterlockedIncrement((long*)&g_uObjectCount);
00040 }
00041
00042
00043 //---------------------------------------------------------------------------
00044 CClassFactory::~CClassFactory()
00045 {
00046   InterlockedDecrement((long*)&g_uObjectCount);
00047 }
00048
00049
00050 //---------------------------------------------------------------------------
00051 STDMETHODIMP CClassFactory::QueryInterface
00052 (
00053   REFIID   riid,             //[in]  Identifier of the requested interface
00054   LPVOID*  ppv               //[out] Address of requested interface
00055 )
00056 {
00057   if( NULL == ppv )
00058     return E_FAIL;
00059
00060   HRESULT hResult = E_NOINTERFACE;
00061   *ppv = NULL;
00062
00063   if( IsEqualIID(riid, IID_IUnknown) )
00064   {
00065     *ppv = static_cast<IClassFactory*>(this);
00066   }
00067   else if( IsEqualIID(riid, IID_IClassFactory) )
00068   {
00069     *ppv = static_cast<IClassFactory*>(this);
00070   }
00071
00072   if( *ppv )
00073   {
00074     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00075     hResult = S_OK;
00076   }
00077
00078   return hResult;
00079 }
00080
00081
00082 //---------------------------------------------------------------------------
00083 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00084 {
00085   return InterlockedIncrement( (long*)&m_cRef );
00086 }
00087
00088
00089 //---------------------------------------------------------------------------
00090 STDMETHODIMP_(ULONG) CClassFactory::Release()
00091 {
00092   if( 0 == InterlockedDecrement( (long*)&m_cRef) )
00093   {
00094     delete this;
00095     return 0;
00096   }
00097   return m_cRef;
00098 }
00099
00100 //---------------------------------------------------------------------------
00101 //  Creates an instance of the object type which was passed in the
00102 //  class constructor
00103 //
00104 STDMETHODIMP CClassFactory::CreateInstance
00105 (
00106   LPUNKNOWN  pUnkOuter,      //[in] NULL unless object is part of aggregate
00107   REFIID     riid,           //[in] Reference to interface indentifier
00108   LPVOID*    ppvObj          //[out] Address of requested interface pointer
00109 )
00110 {
00111   HRESULT  hResult = E_FAIL;
00112   void*    pObject = NULL;
00113
00114   if( NULL == ppvObj )
00115     return hResult;
00116
00117   *ppvObj = NULL;
00118
00119   // Our object does does not support aggregation, so we need to
00120   // fail if they ask us to do aggregation.
00121   if( pUnkOuter )
00122     return CLASS_E_NOAGGREGATION;
00123
00124   // Support for providing CSnapinAbout/CComponentData objects
00125   switch( m_FactoryType )
00126   {
00127     case CONTEXTMENUX:                //CONTEXTMENUX: Create CExtendContextMenuEx
00128       pObject = new CExtendContextMenuEx();
00129       break;
00130
00131     default:
00132       pObject = NULL;
00133   }
00134
00135   if( NULL == pObject )                // Failed to create an object
00136     return E_INVALIDARG;               // due to bad argument
00137
00138   // QueryInterface will do the AddRef() for us, don't do it here
00139   hResult = ( (LPUNKNOWN)pObject)->QueryInterface( riid, ppvObj );
00140
00141   if( S_OK != hResult )
00142     delete pObject;
00143
00144   return hResult;
00145 }
00146
00147
00148 //---------------------------------------------------------------------------
00149 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00150 {
00151   if( TRUE == fLock )
00152     InterlockedIncrement((long*)&g_uServerLocks);
00153   else
00154     InterlockedDecrement((long*)&g_uServerLocks);
00155
00156   return S_OK;
00157 }
00158
00159
00160 /////////////////////////////////////////////////////////////////////////////
00161 //  Our Snap-in's exported functions
00162 //
00163
00164 //---------------------------------------------------------------------------
00165 //  Entry point into our Snap-in DLL
00166 //
00167 BOOL WINAPI DllMain
00168 (
00169   HINSTANCE  hInstDLL,         //[in] Handle to DLL module
00170   DWORD      fdwReason,        //[in] Reason for calling function
00171   void*      lpvReserved       //[in] Reserved
00172 )
00173 {
00174   if( DLL_PROCESS_ATTACH == fdwReason )
00175   {
00176      g_hInst = hInstDLL;
00177   }
00178
00179   return TRUE;
00180 }
00181
00182
00183 //---------------------------------------------------------------------------
00184 STDAPI DllGetClassObject
00185 (
00186   REFCLSID   rclsid,         //[in] CLSID for the class object
00187   REFIID     riid,           //[in] Reference to interface identifier
00188   LPVOID     *ppvObj         //[out] Object which recieves interface pointer
00189 )
00190 {
00191   //CONTEXTMENUX: Test for our class
00192   if( (rclsid != CLSID_CExtendContextMenuEx) )
00193     return CLASS_E_CLASSNOTAVAILABLE;
00194
00195   if( !ppvObj )
00196     return E_FAIL;
00197
00198   *ppvObj = NULL;
00199
00200   // We can only hand out IUnknown and IClassFactory pointers.  Fail
00201   // if caller asks for anything else.
00202   if( !IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory) )
00203     return E_NOINTERFACE;
00204
00205   CClassFactory *pFactory = NULL;
00206
00207   // CONTEXTMENUX: Create the new class factory.  Pass in the type of object to create
00208   if( rclsid == CLSID_CExtendContextMenuEx )
00209     pFactory = new CClassFactory(CClassFactory::CONTEXTMENUX);
00210
00211
00212   HRESULT hResult = pFactory->QueryInterface( riid, ppvObj );
00213
00214   return hResult;
00215 }
00216
00217
00218 //---------------------------------------------------------------------------
00219 STDAPI DllCanUnloadNow(void)
00220 {
00221   if( 0 == g_uObjectCount && 0 == g_uServerLocks )
00222     return S_OK;
00223   else
00224     return S_FALSE;
00225 }
00226
00227
00228 //---------------------------------------------------------------------------
00229 //  CONTEXTMENUX:  Support only CLSID_CExtendContextMenuEx
00230 //
00231 STDAPI DllRegisterServer()
00232 {
00233   HRESULT hResult = S_FALSE;
00234
00235   do
00236   {
00237     hResult = RegisterServer( g_hInst, CLSID_CExtendContextMenuEx, gtszSNAPIN_NAME );
00238     BREAK_ON_ERROR( hResult );
00239
00240     hResult = RegisterSnapin( CLSID_CExtendContextMenuEx, gtszSNAPIN_NAME, IID_NULL, FALSE );
00241     BREAK_ON_ERROR( hResult );
00242
00243   }while( 0 );
00244
00245   return hResult;
00246 }
00247
00248
00249 //---------------------------------------------------------------------------
00250 //  CONTEXTMENUX: Support only CLSID_CExtendContextMenuEx
00251 //
00252 STDAPI DllUnregisterServer()
00253 {
00254   if( S_OK == UnregisterServer(CLSID_CExtendContextMenuEx) )
00255     return UnregisterSnapin(CLSID_CExtendContextMenuEx);
00256   else
00257     return E_FAIL;
00258 }
00259
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/NPServer/Server32.h Source File

  • WinBase
  • IPC
  • NamePipe
  • NPServer

Server32.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014 \******************************************************************************/
00015
00016 #define MAX_PIPE_INSTANCES 100
00017
00018 #define LINE_LEN   80
00019 #define NAME_SIZE  25
00020
00021 // Bitmaps and coordinates.
00022 #define END_LIVE   1
00023 #define END_DEAD   2
00024 #define MID_LIVE   3
00025 #define MID_DEAD   4
00026 #define BITMAP_X   20
00027 #define BITMAP_Y   32
00028 #define NAME_X     60
00029 #define NAME_Y     10
00030
00031 // Buffers and pipe symbolic constants.
00032 #define IN_BUF_SIZE        1000
00033 #define OUT_BUF_SIZE       1000
00034 #define TIME_OUT           0
00035 #define PLEASE_READ        1000
00036 #define PLEASE_WRITE       1000
00037
00038 //Stringtable identifiers
00039 #define IDS_WRONGOS     100
00040 #define IDS_WINDOWTITLE 101
00041 #define IDS_ERRORCODE   102
00042 #define IDS_DEBUGTITLE  103
00043 #define IDS_READERROR   104
00044 #define IDS_DEBUGINFO   105
00045 #define IDS_DEBUGLAST   106
00046
00047 // Structure used to hold information about a pipe client.
00048 // They're used as array elements.
00049 typedef struct { HANDLE     hPipe;
00050                  HANDLE     hThread;
00051                  HANDLE     hEvent;
00052                  OVERLAPPED overLap;
00053                  BOOL       live;
00054                  CHAR Name[NAME_SIZE];
00055                } WRTHANDLE;
00056
00057
00058 LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);
00059 VOID          ServerProc (HWND *);
00060 VOID          TellAll    (CHAR *);
00061 VOID          DrawBranch(HDC);
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/resource.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ClipBook Server.rc
00004 //
00005 #define IDD_PP_CLIPBOOKSERVER_PARAMETERS      130
00006 #define IDD_WIZ_CLIPBOOKSERVER_PARAMETERS     131
00007 #define IDC_PP_ICON                     1000
00008 #define IDC_PP_TITLE                    1001
00009 #define IDS_CLUSTER_MENU_ITEM_1             1100
00010 #define IDS_CLUSTER_MENU_ITEM_1_DESC        1101
00011 #define IDS_NODE_MENU_ITEM_1                1110
00012 #define IDS_NODE_MENU_ITEM_1_DESC           1111
00013 #define IDS_GROUP_MENU_ITEM_1               1120
00014 #define IDS_GROUP_MENU_ITEM_1_DESC          1121
00015 #define IDS_RESOURCE_MENU_ITEM_1            1130
00016 #define IDS_RESOURCE_MENU_ITEM_1_DESC       1131
00017 #define IDS_ALLRESOURCES_MENU_ITEM_1        1140
00018 #define IDS_ALLRESOURCES_MENU_ITEM_1_DESC   1141
00019 #define IDS_RESTYPE_MENU_ITEM_1             1150
00020 #define IDS_RESTYPE_MENU_ITEM_1_DESC        1151
00021 #define IDS_ALLRESTYPES_MENU_ITEM_1         1160
00022 #define IDS_ALLRESTYPES_MENU_ITEM_1_DESC    1161
00023 #define IDS_NETWORK_MENU_ITEM_1             1170
00024 #define IDS_NETWORK_MENU_ITEM_1_DESC        1171
00025 #define IDS_NETINTERFACE_MENU_ITEM_1        1180
00026 #define IDS_NETINTERFACE_MENU_ITEM_1_DESC   1181
00027 #define IDS_CLUADMEX_COMOBJ_DESC        31100
00028 #define IDS_ERROR_MSG_ID                31101
00029 #define IDS_REQUIRED_FIELD_EMPTY        31102
00030 #define IDS_ERROR_SETTING_PROPERTIES    31103
00031 #define IDS_ERROR_VALIDATING_PROPERTIES 31104
00032 #define IDS_APPLY_PARAM_CHANGES_ERROR   31200
00033
00034 // Next default values for new objects
00035 //
00036 #ifdef APSTUDIO_INVOKED
00037 #ifndef APSTUDIO_READONLY_SYMBOLS
00038 #define _APS_NEXT_RESOURCE_VALUE        134
00039 #define _APS_NEXT_COMMAND_VALUE         32771
00040 #define _APS_NEXT_CONTROL_VALUE         1200
00041 #define _APS_NEXT_SYMED_VALUE           101
00042 #endif
00043 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/WinHlprs/strmHelp.h Source File

  • Com
  • Fundamentals
  • WinHlprs

strmHelp.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright Microsoft Corporation.
00005 //
00006 //  File:       strmhelp.h
00007 //
00008 //  Contents:   Routines for writting variables to a stream in an
00009 //              architecture independent manner.
00010 //
00011 //  Classes:
00012 //
00013 //  Functions:  WriteDouble
00014 //              ReadDouble
00015 //              SizeDouble
00016 //
00017 //  History:    4-26-94   stevebl   Created
00018 //
00019 //----------------------------------------------------------------------------
00020
00021 #ifndef __STRMHELP_H__
00022 #define __STRMHELP_H__
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 DWORD SizeDouble(void);
00029
00030 HRESULT WriteDouble(IStream * pstm, double d, ULONG FAR * pcbWritten);
00031
00032 HRESULT ReadDouble(IStream * pstm, double * pd, ULONG FAR * pcbRead);
00033
00034 #ifdef __cplusplus
00035 }
00036 #endif
00037
00038 #endif //__STRMHELP_H__
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Provider/Include/Events.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Provider
  • Include

Events.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   ProvResv.H
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #ifndef _CProvider_IWbemEventProvider_H
00017 #define _CProvider_IWbemEventProvider_H
00018
00019 /******************************************************************************
00020  *
00021  *  Name:
00022  *
00023  *
00024  *  Description:
00025  *
00026  *
00027  *****************************************************************************/
00028
00029 class CProvider_IWbemEventProvider :  public IWbemEventProvider ,
00030                     public IWbemProviderInit ,
00031                     public IWbemShutdown
00032 {
00033 private:
00034
00035   LONG m_ReferenceCount ;
00036   LONG m_InternalReferenceCount ;
00037
00038   CRITICAL_SECTION m_CriticalSection ;
00039
00040   IWbemServices *m_CoreService ;
00041   IWbemClassObject *m_EventObject ;
00042   IWbemObjectSink *m_EventSink ;
00043
00044   HANDLE m_ThreadTerminate ;
00045   HANDLE m_ThreadHandle ;
00046
00047   BSTR m_Namespace ;
00048   BSTR m_Locale ;
00049   BSTR m_User ;
00050
00051 private:
00052
00053   static DWORD ThreadExecutionFunction ( void *a_Context ) ;
00054
00055 public:
00056
00057   CProvider_IWbemEventProvider () ;
00058     ~CProvider_IWbemEventProvider () ;
00059
00060     STDMETHODIMP_( ULONG ) InternalAddRef () ;
00061     STDMETHODIMP_( ULONG ) InternalRelease () ;
00062
00063 public:
00064
00065   //Non-delegating object IUnknown
00066
00067     STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
00068     STDMETHODIMP_( ULONG ) AddRef () ;
00069     STDMETHODIMP_( ULONG ) Release () ;
00070
00071   HRESULT STDMETHODCALLTYPE ProvideEvents (
00072
00073     IWbemObjectSink *a_Sink ,
00074     LONG a_Flags
00075   ) ;
00076
00077   /* IWbemProviderInit methods */
00078
00079   HRESULT STDMETHODCALLTYPE Initialize (
00080
00081     LPWSTR a_User ,
00082     LONG a_Flags ,
00083     LPWSTR a_Namespace ,
00084     LPWSTR a_Locale ,
00085     IWbemServices *a_Core ,
00086     IWbemContext *a_Context ,
00087     IWbemProviderInitSink *a_Sink
00088   ) ;
00089
00090   HRESULT STDMETHODCALLTYPE Shutdown (
00091
00092     LONG a_Flags ,
00093     ULONG a_MaxMilliSeconds ,
00094     IWbemContext *a_Context
00095   ) ;
00096 } ;
00097
00098
00099 #endif // _CProvider_IWbemEventProvider_H
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMessageDlg Member List

This is the complete list of members for CMessageDlg, including all inherited members.
CMessageDlg(CWnd *pParent=NULL) | CMessageDlg |
DoDataExchange(CDataExchange *pDX) | CMessageDlg | [protected, virtual]
IDD enum value | CMessageDlg |
m_message | CMessageDlg |
m_sendMessage | CMessageDlg |
m_serverName | CMessageDlg |
OnInitDialog() | CMessageDlg | [protected, virtual]
OnSendMessage() | CMessageDlg | [protected]
Generated on Wed Nov 13 2024 16:56:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IAppletSessionVtbl Member List

This is the complete list of members for IAppletSessionVtbl, including all inherited members.
aNodeIDs | IAppletSessionVtbl
cbBufSize | IAppletSessionVtbl
cNodes | IAppletSessionVtbl
dwCookie | IAppletSessionVtbl
ePriority | IAppletSessionVtbl
fUniformSend | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetConfID)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *IsThisNodeTopProvider)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Join)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Leave)(IAppletSession __RPC_FAR *This) | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *SendData)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *InvokeApplet)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *InquireRoster)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *RegistryRequest)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *ChannelRequest)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *TokenRequest)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Advise)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *UnAdvise)(IAppletSession __RPC_FAR *This | IAppletSessionVtbl
nChannelID | IAppletSessionVtbl
pAPE | IAppletSessionVtbl
pBuffer | IAppletSessionVtbl
pdwCookie | IAppletSessionVtbl
pfTopProvider | IAppletSessionVtbl
pnConfID | IAppletSessionVtbl
pNotify | IAppletSessionVtbl
pnReqTag | IAppletSessionVtbl
ppvObject | IAppletSessionVtbl
pRequest | IAppletSessionVtbl
pRequest | IAppletSessionVtbl
pRequest | IAppletSessionVtbl
pRequest | IAppletSessionVtbl
pSessionKey | IAppletSessionVtbl
riid | IAppletSessionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(IAppletSession __RPC_FAR *This) | IAppletSessionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(IAppletSession __RPC_FAR *This) | IAppletSessionVtbl
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ActiveDirectory/PropSheetHost/Main.cpp Source File

  • NetDS
  • ActiveDirectory
  • PropSheetHost

Main.cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002 //    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003 //    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 //    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 //    PARTICULAR PURPOSE.
00006 //
00007 //    Copyright Microsoft Corporation. All Rights Reserved.
00008 //***************************************************************************
00009
00010 //***************************************************************************
00011 //
00012 //    File:          Main.cpp
00013 //
00014 //    Description:
00015 //
00016 //***************************************************************************
00017
00018 //***************************************************************************
00019 //    #include statements
00020 //***************************************************************************
00021
00022 #include "stdafx.h"
00023
00024 #define MAX_ADSPATH_CHARS 2048
00025
00026 //***************************************************************************
00027 //    local function prototypes
00028 //***************************************************************************
00029
00030 int LocalToWideChar(LPWSTR pWide, LPCTSTR pLocal, DWORD dwChars);
00031
00032 /***************************************************************************
00033
00034     _tmain()
00035
00036 ***************************************************************************/
00037
00038 int _tmain(int argc, _TCHAR* argv[])
00039 {
00040     TCHAR szTemp[MAX_ADSPATH_CHARS];
00041     LPWSTR pwszADsPath = NULL;
00042
00043     CoInitialize(NULL);
00044
00045     if(argc < 2)
00046     {
00047         // Prompt the user for the ADsPath.
00048         _tprintf(TEXT("Enter the ADsPath of the object to display the property sheet for:\n"));
00049         _fgetts(szTemp, MAX_ADSPATH_CHARS - 1, stdin);
00050
00051         // Trim the last character, which is the carriage return.
00052         szTemp[lstrlen(szTemp) - 1] = 0;
00053     }
00054     else
00055     {
00056         lstrcpyn(szTemp, argv[1], MAX_ADSPATH_CHARS - 1);
00057     }
00058
00059     DWORD dwChars = lstrlen(szTemp) + 1;
00060     pwszADsPath = new WCHAR[dwChars];
00061
00062     if(pwszADsPath)
00063     {
00064         HRESULT hr;
00065
00066         HINSTANCE hInstance = NULL;
00067         HWND hwndConsole = GetConsoleWindow();
00068         if(hwndConsole)
00069         {
00070             hInstance = (HINSTANCE)(LONG_PTR)GetWindowLongPtr(hwndConsole, GWLP_HINSTANCE);
00071         }
00072
00073         CPropSheetHost *pHost = new CPropSheetHost(hInstance);
00074
00075         LocalToWideChar(pwszADsPath, szTemp, dwChars);
00076
00077         // Hold a reference count for the CPropSheetHost object.
00078         pHost->AddRef();
00079
00080         hr = pHost->SetObject(pwszADsPath);
00081         if(FAILED(hr))
00082         {
00083             goto ExitMain;
00084         }
00085
00086         pHost->Run();
00087
00088         /*
00089         Release the CPropSheetHost object. Other components may still hold a
00090         reference to the object, so this cannot just be deleted here. Let
00091         the object delete itself when all references are released.
00092         */
00093         pHost->Release();
00094     }
00095
00096 ExitMain:
00097     if(pwszADsPath)
00098     {
00099         delete pwszADsPath;
00100     }
00101
00102     CoUninitialize();
00103
00104     return 0;
00105 }
00106
00107 /**************************************************************************
00108
00109    LocalToWideChar()
00110
00111 **************************************************************************/
00112
00113 int LocalToWideChar(LPWSTR pWide, LPCTSTR pLocal, DWORD dwChars)
00114 {
00115     *pWide = 0;
00116
00117     #ifdef UNICODE
00118     lstrcpyn(pWide, pLocal, dwChars);
00119     #else
00120     MultiByteToWideChar( CP_ACP,
00121                         0,
00122                         pLocal,
00123                         -1,
00124                         pWide,
00125                         dwChars);
00126     #endif
00127
00128     return lstrlenW(pWide);
00129 }
00130
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkCollection_RTS/C#/AssemblyInfo.cs Source File

  • TabletPC
  • InkCollection_RTS
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("Ink Collection (RTS) Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2004 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ShortName.h Source File

  • WinUI
  • Shell
  • ColumnProvider

ShortName.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  ShortName.h
00011 //
00012 //////////////////////////////////////////////////////////////////////
00013
00014 #ifndef _SHORTNAME_H_INCLUDED
00015 #define _SHORTNAME_H_INCLUDED
00016
00017 #if _MSC_VER > 1000
00018 #pragma once
00019 #endif // _MSC_VER > 1000
00020
00021 #include <windows.h>
00022 #include <olectl.h>
00023 #include <shellapi.h>
00024 #include <shlwapi.h>
00025 #include <shlobj.h>
00026
00027 #define MAX_DISPLAY_LEN     100
00028 #define MAX_DESCRIPTION_LEN 500
00029 #define MAX_BUTTONTEXT_LEN  25
00030
00031 extern HINSTANCE hDllInstance;
00032 extern ULONG nDllRefCount;
00033
00034 #define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
00035
00036
00037 //
00038 //  GetStringByteSize
00039 //
00040 //      Returns the number of bytes for a string, including the
00041 //      terminating NULL character
00042 //
00043 inline UINT GetStringByteSize (LPTSTR pszString) {return ((lstrlen(pszString) + 1) * sizeof(TCHAR));}
00044
00045 //
00046 //  GetStringByteSizeUnicode
00047 //
00048 //      Returns the number of bytes required to convert an ANSI
00049 //      string to UNICODE. Used in the sample when allocating
00050 //      memory for ANSI->UNICODE conversions
00051 //
00052 inline UINT GetStringByteSizeUnicode (LPCSTR pszString) {return ((lstrlenA(pszString) + 1) * sizeof(WCHAR));}
00053
00054 //
00055 //  GetObjectClsid
00056 //
00057 //      Returns either a string or a CLSID that contains the class ID
00058 //      of the object.
00059 //
00060 BOOL WINAPI GetObjectClsid (LPTSTR lpszClsid, DWORD cbClsid);
00061 BOOL WINAPI GetObjectClsid (LPCLSID pClsid);
00062
00063 #endif // _VCCLEANUP_H_INCLUDED
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ExtrIcon.h Source File

  • WinUI
  • Shell
  • SampView

ExtrIcon.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ExtrIcon.h
00013
00014    Description:   CExtractIcon definitions.
00015
00016 **************************************************************************/
00017
00018 #ifndef EXTRACTICON_H
00019 #define EXTRACTICON_H
00020
00021 /**************************************************************************
00022    #include statements
00023 **************************************************************************/
00024
00025 #include <windows.h>
00026 #include <shlobj.h>
00027 #include "PidlMgr.h"
00028 #include "Utility.h"
00029
00030 /**************************************************************************
00031
00032    CExtractIcon class definition
00033
00034 **************************************************************************/
00035
00036 class CExtractIcon : public IExtractIcon
00037 {
00038 private:
00039    DWORD          m_ObjRefCount;
00040   LPITEMIDLIST   m_pidl;
00041    CPidlMgr       *m_pPidlMgr;
00042
00043 public:
00044    CExtractIcon(LPCITEMIDLIST);
00045    ~CExtractIcon();
00046
00047    //IUnknown methods
00048    STDMETHOD (QueryInterface) (REFIID riid, LPVOID * ppvObj);
00049    STDMETHOD_ (ULONG, AddRef) (VOID);
00050    STDMETHOD_ (ULONG, Release) (VOID);
00051
00052    //IExtractIcon methods
00053    STDMETHOD (GetIconLocation) (UINT, LPTSTR, UINT, LPINT, LPUINT);
00054    STDMETHOD (Extract) (LPCTSTR, UINT, HICON*, HICON*, UINT);
00055 };
00056
00057 #define ICON_INDEX_ITEM       0
00058 #define ICON_INDEX_FOLDER     1
00059 #define ICON_INDEX_FOLDEROPEN 2
00060
00061 #endif   //EXTRACTICON_H
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CContainerBase Member List

This is the complete list of members for CContainerBase, including all inherited members.
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CContainerBase | [virtual]
AutoRelease() | CContainerBase | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface()=0 | CBase | [pure virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CContainerBase | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage()=0 | CBase | [pure virtual]
GetObjectMenu()=0 | CBase | [pure virtual]
GetObjectName()=0 | CBase | [pure virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIConnectionPointContainer | CContainerBase |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
~CBase() | CBase | [virtual]
~CContainerBase() | CContainerBase | [virtual]
Generated on Wed Nov 13 2024 16:55:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Intermediate/StdAfx.Cpp Source File

  • Web
  • iis
  • Components
  • Cpp
  • Intermediate

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/tracemacro.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

tracemacro.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  TraceMacro.h : Defines custom tracing helpers.
00014 //
00015
00016
00017 #ifndef _TRACE_MACRO_HEADER_
00018 #define _TRACE_MACRO_HEADER_
00019
00020 //---------------------------------------------------------------------------
00021 //  Function prototypes
00022 //
00023 VOID Trace_Start( LPCTSTR pszClass, LPCTSTR pszFunction );
00024 VOID Trace_HR( LPCTSTR pszClass, LPCTSTR pszFunction, HRESULT hr );
00025 VOID Trace_Value( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszValueName, LONG Value );
00026 VOID Trace_Event( LPCTSTR pszClass, LPCTSTR pszFunction, LONG nEvent );
00027 VOID MapEvent( LONG Event, LPTSTR szEventStr );
00028
00029
00030 // Alternate version provides complete path to the file
00031 // #define TRACE_HRESULT(str,hr)  Trace_HR( _T(__FILE__), (str), (hr) )
00032
00033 #ifdef _DEBUG
00034
00035 #undef  TRACE_HRESULT
00036 #define TRACE_HRESULT(s1,hr) Trace_HR( (MODULESTRING),(s1),(hr) )
00037
00038 #undef  TRACE_VAL
00039 #define TRACE_VAL(s1,s2,val) Trace_Value( (MODULESTRING),(s1),(s2),(val) )
00040
00041 #undef  TRACE_EVENT
00042 #define TRACE_EVENT(s1,val)  Trace_Event( (MODULESTRING),(s1),(val) )
00043
00044 #undef  TRACE_START
00045 #define TRACE_START( s1 )    Trace_Start( (MODULESTRING),(s1) )
00046
00047
00048 #else
00049
00050 #undef  TRACE_HRESULT
00051 #define TRACE_HRESULT
00052
00053 #undef  TRACE_VAL
00054 #define TRACE_VAL
00055
00056 #undef  TRACE_EVENT
00057 #define TRACE_EVENT
00058
00059 #undef  TRACE_START
00060 #define TRACE_START
00061
00062 #endif //_DEBUG
00063
00064
00065 #endif //_TRACE_MACRO_HEADER_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/caccount.Cpp Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

caccount.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 //
00003 // This file is part of the Microsoft COM+ Samples
00004 //
00005 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation.  See these other
00009 // materials for detailed information reagrding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 //==============================================================================
00017
00018 #include "stdafx.h"
00019 #include "Account.h"
00020 #include "CAccount.h"
00021 #include <stdio.h>
00022 #include <comsvcs.h>
00023 #include <adoid.h>
00024 #include <adoint.h>
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 //
00028
00029 STDMETHODIMP CAccount::InterfaceSupportsErrorInfo(REFIID riid)
00030 {
00031   static const IID* arr[] =
00032   {
00033     &IID_IAccount,
00034   };
00035
00036   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00037   {
00038     if (::InlineIsEqualGUID(*arr[i],riid))
00039       return S_OK;
00040   }
00041   return S_FALSE;
00042 }
00043
00044 //F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++
00045 //
00046 // Function: Post
00047 //
00048 // Modifies the specified account by the specified amount
00049 //
00050 // Args:  lAcocunt: Account to particptae in bank transaction
00051 //      lAmount:  Amount of transaction
00052 //      pbstrResult: Return String contains new balance. NULL of error occurs
00053 //
00054 // Returns:  S_OK or E_FAIL
00055 //
00056 //F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-
00057 STDMETHODIMP CAccount::Post (IN long lAccount, IN long lAmount, OUT BSTR* pbstrResult) {
00058
00059   HRESULT hr = S_OK;
00060
00061   IObjectContext* pObjectContext = NULL;
00062
00063   ADOConnection* adoCoConnection = NULL;
00064   ADORecordset* adoRsBalance = NULL;
00065   ADOFields* pFields = NULL;
00066   ADOField* pField = NULL;
00067
00068   *pbstrResult = NULL;
00069
00070   long lErrFlag = 0;
00071   TCHAR* pErrMsg = NULL;
00072
00073   try {
00074
00075     // Get our object context
00076     THROW_ERR (CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext), "GetObjectContext" );
00077
00078     // Check security for large transfers
00079     if (lAmount > 500 || lAmount < -500) {
00080       BOOL bInRole;
00081       BSTR bstrRole;
00082
00083       bstrRole = ::SysAllocString(L"Managers");
00084       hr = pObjectContext->IsCallerInRole (bstrRole, &bInRole);
00085       ::SysFreeString(bstrRole);
00086
00087       if (!SUCCEEDED ( hr )) {
00088         THROW_STR ( _T("IsCallerInRole() call failed!  Please add the 'Managers' Roll to the package."));
00089       }
00090
00091       if (!bInRole) {
00092         THROW_STR ( _T("Need 'Managers' role for amounts over $500") );
00093       }
00094     }
00095
00096     // Create ADOConnection object and initialize the connection
00097     THROW_ERR ( CoCreateInstance (CLSID_CADOConnection, NULL, CLSCTX_INPROC_SERVER, IID_IADOConnection,
00098       (LPVOID *) &adoCoConnection), "CoCreateInstance(CADOConnection)" );
00099
00100     BSTR bstrDSN = ::SysAllocString (L"FILEDSN=BankSample");
00101     hr = adoCoConnection->Open (bstrDSN, NULL, NULL, adCmdUnspecified);
00102     ::SysFreeString (bstrDSN);
00103     RETHROW_ERR(hr);
00104
00105     // Update the account balance and
00106     // then check to see if account would be overdrawn
00107     TCHAR szBuffer [512];
00108     wsprintf (szBuffer, _T("UPDATE Account SET Balance = Balance + %li WHERE AccountNo = %li"),
00109       lAmount, lAccount);
00110     BSTR bstrSQL = TCHAR2BSTR (szBuffer);
00111     CComVariant vRecordCount;
00112     vRecordCount.Clear();
00113     hr = adoCoConnection->Execute(bstrSQL, &vRecordCount, -1, NULL);
00114     ::SysFreeString (bstrSQL);
00115     RETHROW_ERR(hr);
00116
00117     // If no records got updated, the account doesn't exist
00118     if (vRecordCount.lVal == 0) {
00119       TCHAR szBuffer1 [512];
00120       wsprintf (szBuffer1, _T("Error. Account %ld not on file."), lAccount);
00121       THROW_STR ( szBuffer1 );
00122     }
00123
00124     wsprintf (szBuffer, _T("SELECT Balance FROM Account WHERE AccountNo = %ld"), lAccount);
00125     bstrSQL = TCHAR2BSTR (szBuffer);
00126     hr = adoCoConnection->Execute (bstrSQL, &vRecordCount, -1, &adoRsBalance);
00127     ::SysFreeString (bstrSQL);
00128     RETHROW_ERR(hr);
00129     // Get the appropriate fields
00130     hr =  adoRsBalance->get_Fields(&pFields);
00131     RETHROW_ERR(hr);
00132
00133     // Get the appropriate field
00134     CComVariant vField = L"Balance";
00135     CComVariant vBalance;
00136     hr = pFields->get_Item (vField, &pField) ;
00137     RETHROW_ERR(hr);
00138     hr = pField->get_Value (&vBalance) ;
00139     RETHROW_ERR(hr);
00140
00141     // Check for overdraw, then prepare return string
00142     if (vBalance.lVal < 0) {
00143
00144       TCHAR szBuffer2 [512];
00145       wsprintf (szBuffer2, _T("Error. Account %ld would be overdrawn by %ld.  Balance is still %ld"),
00146         lAccount, vBalance.lVal, vBalance.lVal - lAmount);
00147       THROW_STR ( szBuffer2 );
00148     }
00149
00150     TCHAR szBuffer3 [512];
00151     wsprintf (szBuffer3, _T("%s account %ld, balance is $%ld. (VC++)"),
00152       ((lAmount >= 0) ? _T("Credit to") : _T("Debit from")), lAccount, vBalance.lVal);
00153     *pbstrResult = TCHAR2BSTR (szBuffer3);
00154
00155     // Resource cleanup
00156     if (pField) pField->Release();
00157     if (pFields) pFields->Release();
00158     if (adoRsBalance) adoRsBalance->Release();
00159     if (adoCoConnection) adoCoConnection->Release();
00160
00161     // We are finished and happy
00162     pObjectContext->SetComplete();
00163
00164
00165   } catch (HRESULT hr) {
00166
00167     //
00168     //  ErrorInfo is saved here because the following ADO cleanup code
00169     //  may clear it.
00170     //
00171     IErrorInfo * pErrorInfo = NULL;
00172     GetErrorInfo(NULL, &pErrorInfo);
00173
00174     if (pField) pField->Release();
00175     if (pFields) pFields->Release();
00176     if (adoRsBalance) adoRsBalance->Release();
00177     if (adoCoConnection) adoCoConnection->Release();
00178
00179     // Fill in error information
00180     switch (lErrFlag) {
00181
00182     // Unknown error occurred in this object
00183     case (0):
00184       TCHAR szErr [512];
00185       wsprintf (szErr, _T("Error 0x%x from CAccount calling %s."), hr, pErrMsg);
00186       pErrMsg = szErr;
00187       // Fall through
00188
00189     // An application error occurred in this object
00190     case (1):
00191       //
00192       //  we are going to put our own error in TLS, so if there is one there, clear it
00193       //
00194       if (pErrorInfo)
00195         pErrorInfo -> Release();
00196
00197       AtlReportError( CLSID_CAccount, pErrMsg, IID_IAccount, hr);
00198       break;
00199     case (2): // ADO error
00200     {
00201       //
00202       //  put the error back in TLS
00203       //
00204       SetErrorInfo(NULL, pErrorInfo);
00205
00206     }
00207     break;
00208     // Will never reach here
00209     default:
00210       break;
00211     }
00212
00213     // Indicate our unhappiness
00214     if (pObjectContext)
00215       pObjectContext->SetAbort();
00216
00217   }
00218
00219   if (pObjectContext) pObjectContext->Release();
00220
00221   return hr;
00222 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/moveMoney.h Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

moveMoney.h

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: MoveMoney.h
00003 //
00004 // Description: Declaration of MoveMoney
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022 #include "resource.h"       // main symbols
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // Account
00026
00027 class CMoveMoney :
00028   public IDispatchImpl<IMoveMoney, &IID_IMoveMoney, &LIBID_ACCOUNT>,
00029   public ISupportErrorInfo,
00030   public CComObjectRoot,
00031   public CComCoClass<CMoveMoney,&CLSID_CMoveMoney>
00032 {
00033 public:
00034   CMoveMoney() {}
00035 BEGIN_COM_MAP(CMoveMoney)
00036   COM_INTERFACE_ENTRY(IDispatch)
00037   COM_INTERFACE_ENTRY(IMoveMoney)
00038   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00039 END_COM_MAP()
00040 //DECLARE_NOT_AGGREGATABLE(CMoveMoney)
00041 // Remove the comment from the line above if you don't want your object to
00042 // support aggregation.  The default is to support it
00043
00044 DECLARE_REGISTRY_RESOURCEID(IDR_MoveMoney)
00045 // ISupportsErrorInfo
00046   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00047
00048 // IMoveMoney
00049 public:
00050   STDMETHOD(Perform)(
00051     IN long lPrimeAccount,
00052     IN long lSecondAccount,
00053     IN long lAmount,
00054     IN long lTranType,
00055     OUT BSTR* pbstrResult);
00056 };
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ADOConnectionConstruction15.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ADOConnectionConstruction15.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ADOConnectionConstruction15
00019 /** @com.interface(iid=00000516-0000-0010-8000-00AA006D2EA4, thread=AUTO) */
00020 public interface ADOConnectionConstruction15 extends IUnknown
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00024   public IUnknown getDSO();
00025
00026   /** @com.method(vtoffset=1, addFlagsVtable=4)
00027       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00028   public IUnknown getSession();
00029
00030   /** @com.method(vtoffset=2, addFlagsVtable=4)
00031       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] pDSO, [in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] pSession) */
00032   public void WrapDSOandSession(IUnknown pDSO, IUnknown pSession);
00033
00034
00035   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x516, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00036 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/_DynaCollection.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

_DynaCollection.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface _DynaCollection
00019 /** @com.interface(iid=00000513-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface _DynaCollection extends msado15._Collection
00021 {
00022   /** @com.method(vtoffset=4, dispid=1610743808, type=PROPGET, name="Count", name2="getCount", addFlagsVtable=4)
00023       @com.parameters([type=I4] return) */
00024   public int getCount();
00025
00026   /** @com.method(vtoffset=5, dispid=4294967292, type=METHOD, name="_NewEnum", addFlagsVtable=4)
00027       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00028   public IUnknown _NewEnum();
00029
00030   /** @com.method(vtoffset=6, dispid=1610743810, type=METHOD, name="Refresh", addFlagsVtable=4)
00031       @com.parameters() */
00032   public void Refresh();
00033
00034   /** @com.method(vtoffset=7, dispid=1610809344, type=METHOD, name="Append", addFlagsVtable=4)
00035       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] Object) */
00036   public void Append(Object Object);
00037
00038   /** @com.method(vtoffset=8, dispid=1610809345, type=METHOD, name="Delete", addFlagsVtable=4)
00039       @com.parameters([in,type=VARIANT] Index) */
00040   public void Delete(Variant Index);
00041
00042
00043   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x513, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00044 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/Xmit/Xmits.c Source File

  • NetDS
  • RPC
  • Data
  • Xmit

Xmits.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                         xmit Example
00005
00006     FILE:       xmits.c
00007
00008     USAGE:      xmits  -p protocol_sequence
00009                        -e endpoint
00010                        -m max calls
00011                        -n min calls
00012                        -f flag for RpcServerListen
00013
00014     PURPOSE:    Server side of RPC distributed application xmit
00015
00016     FUNCTIONS:  main() - registers server as RPC server
00017
00018     COMMENTS:   This sample program generates a linked list to
00019                 demonstrate how the list can be transmitted over
00020                 the network more efficiently as a sized array.
00021                 The pointers are rebuilt on the server side.
00022
00023                 The [transmit_as] attribute (used in the typedef of
00024                 DOUBLE_LINK_TYPE in the file XMIT.IDL) requires the
00025                 four user-supplied functions whose names start with
00026                 the name of the presented type, DOUBLE_LINK_TYPE.
00027
00028                 The [in, out] attributes applied to remote procedure
00029                 parameters require the two user-supplied functions
00030                 midl_user_allocate and midl_user_free.
00031
00032                 The other functions are utilities that are used to
00033                 build or display the data structures.
00034
00035 ****************************************************************************/
00036
00037 #include <stdlib.h>
00038 #include <stdio.h>
00039 #include <ctype.h>
00040 #include "xmit.h"     // header file generated by MIDL compiler
00041 #include "xmitu.h"    // Function prototypes for utility functions
00042
00043 #define PURPOSE \
00044 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00045 the use of the [transmit_as] attribute. For more information\n\
00046 about the attributes and the RPC API functions, see the\n\
00047 RPC programming guide and reference.\n\n"
00048
00049 void Usage(char * pszProgramName)
00050 {
00051     fprintf(stderr, "%s", PURPOSE);
00052     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00053     fprintf(stderr, " -p protocol_sequence\n");
00054     fprintf(stderr, " -e endpoint\n");
00055     fprintf(stderr, " -m maxcalls\n");
00056     fprintf(stderr, " -n mincalls\n");
00057     fprintf(stderr, " -f flag_wait_op\n");
00058     exit(1);
00059 }
00060
00061 /* main:  register the interface, start listening for clients */
00062 void __cdecl main(int argc, char * argv[])
00063 {
00064     RPC_STATUS status;
00065     unsigned char * pszProtocolSequence = "ncacn_np";
00066     unsigned char * pszSecurity         = NULL;
00067     unsigned char * pszEndpoint         = "\\pipe\\xmit";
00068     unsigned int    cMinCalls           = 1;
00069     unsigned int    cMaxCalls           = 20;
00070     unsigned int    fDontWait           = FALSE;
00071     int i;
00072
00073     /* allow the user to override settings with command line switches */
00074     for (i = 1; i < argc; i++) {
00075         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00076             switch (tolower(*(argv[i]+1))) {
00077             case 'p':  // protocol sequence
00078                 pszProtocolSequence = argv[++i];
00079                 break;
00080             case 'e':
00081                 pszEndpoint = argv[++i];
00082                 break;
00083             case 'm':
00084                 cMaxCalls = (unsigned int) atoi(argv[++i]);
00085                 break;
00086             case 'n':
00087                 cMinCalls = (unsigned int) atoi(argv[++i]);
00088                 break;
00089             case 'f':
00090                 fDontWait = (unsigned int) atoi(argv[++i]);
00091                 break;
00092             case 'h':
00093             case '?':
00094             default:
00095                 Usage(argv[0]);
00096             }
00097         }
00098         else
00099             Usage(argv[0]);
00100     }
00101
00102     status = RpcServerUseProtseqEp(pszProtocolSequence,
00103                                    cMaxCalls,
00104                                    pszEndpoint,
00105                                    pszSecurity);  // Security descriptor
00106     printf("RpcServerUseProtseqEp returned 0x%x\n", status);
00107     if (status) {
00108         exit(status);
00109     }
00110
00111     status = RpcServerRegisterIf(xmit_ServerIfHandle,  // interface to register
00112                                  NULL,   // MgrTypeUuid
00113                                  NULL);  // MgrEpv; null means use default
00114     printf("RpcServerRegisterIf returned 0x%x\n", status);
00115     if (status) {
00116         exit(status);
00117     }
00118
00119     printf("Calling RpcServerListen\n");
00120     status = RpcServerListen(cMinCalls,
00121                              cMaxCalls,
00122                              fDontWait);
00123     printf("RpcServerListen returned: 0x%x\n", status);
00124     if (status) {
00125         exit(status);
00126     }
00127
00128     if (fDontWait) {
00129         printf("Calling RpcMgmtWaitServerListen\n");
00130         status = RpcMgmtWaitServerListen();  //  wait operation
00131         printf("RpcMgmtWaitServerListen returned: 0x%x\n", status);
00132         if (status) {
00133             exit(status);
00134         }
00135     }
00136
00137 }  // end main()
00138
00139 /* end file xmits.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/service.h Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

service.h

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: Service.h
00008
00009     PURPOSE: Provides file replication service function declarations.
00010
00011     FUNCTIONS:
00012
00013     COMMENTS: These funtions may be used by the main service routines
00014         as well as by the client and server file replication RPC routines.
00015
00016 */
00017 #pragma once
00018
00019 // Name of the executable
00020 #define APPNAME TEXT("FileRepService")
00021
00022 // Internal name of the service
00023 #define SERVICENAME TEXT("FileRepService")
00024
00025 // Displayed name of the service
00026 #define SERVICEDISPLAYNAME TEXT("File Replication Service")
00027
00028 // List of service dependencies
00029 #define DEPENDENCIES TEXT("RPCSS\0\0")
00030
00031 #ifdef PROF
00032 #include "Prof.h"
00033 #endif
00034
00035 /*
00036     These are prototypes for shared service functions.
00037     See function definitions in Service.c for help.
00038 */
00039
00040 BOOL ReportStatusToSCMgr(SERVICE_STATUS_HANDLE *sshStatusHandle,
00041        SERVICE_STATUS *ssStatus,
00042        DWORD dwCurrentState,
00043        DWORD dwWin32ExitCode,
00044        DWORD dwWaitHint);
00045
00046 VOID AddToMessageLog(LPTSTR lpszMsg);
00047
00048 // The initial size of the RPC heap
00049 #define RPC_HEAP_SIZE_INIT (1024*1024)
00050 #define RPC_HEAP_SIZE_MAX (128*1024*1024)
00051
00052 // Heap for use by midl_user_allocate and midl_user_free.
00053 extern HANDLE RpcHeap;
00054
00055 // end Service.h
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CInterfaceDlg Member List

This is the complete list of members for CInterfaceDlg, including all inherited members.
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
CInterfaceDlg(UINT nID, WCHAR *pwszTitle, REFIID riid) | CInterfaceDlg |
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetAggregate() | CInterfaceDlg | [inline, virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetSelInterface() | CInterfaceDlg | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_CComboInterface | CInterfaceDlg | [protected]
m_fAggregation | CInterfaceDlg |
m_fModal | CDialogLite |
m_fOutput | CInterfaceDlg |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iid | CInterfaceDlg | [protected]
m_nID | CWndLite |
m_pCAggregate | CInterfaceDlg | [protected]
m_pIUnknown | CInterfaceDlg | [protected]
m_ppIUnknown | CInterfaceDlg | [protected]
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_pwszTitle | CInterfaceDlg | [protected]
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnAggregation() | CInterfaceDlg | [virtual]
OnCancel() | CDialogLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CInterfaceDlg | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | CInterfaceDlg | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CInterfaceDlg | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdate() | CInterfaceDlg | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
ppUnknown() | CInterfaceDlg | [inline, virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
pUnknown() | CInterfaceDlg | [inline, virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CInterfaceDlg() | CInterfaceDlg | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows.Net/ceformat.cpp Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows.Net

ceformat.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1995 - 1999
00006 //
00007 //  File:       ceformat.cpp
00008 //
00009 //  Contents:   helper functions
00010 //
00011 //--------------------------------------------------------------------------
00012
00013 #include "pch.cpp"
00014 #pragma hdrstop
00015
00016 #include "celib.h"
00017 #include <assert.h>
00018 #include <wininet.h>
00019
00020
00021
00022 HRESULT
00023 ceDupString(
00024     IN WCHAR const *pwszIn,
00025     IN WCHAR **ppwszOut)
00026 {
00027     DWORD cb;
00028     HRESULT hr;
00029
00030     cb = (wcslen(pwszIn) + 1) * sizeof(WCHAR);
00031     *ppwszOut = (WCHAR *) LocalAlloc(LMEM_FIXED, cb);
00032     if (NULL == *ppwszOut)
00033     {
00034   hr = E_OUTOFMEMORY;
00035   _JumpError(hr, error, "LocalAlloc");
00036     }
00037     CopyMemory(*ppwszOut, pwszIn, cb);
00038     hr = S_OK;
00039
00040 error:
00041     return(hr);
00042 }
00043
00044
00045 #define cwcCNMAX  64    // 64 chars max for CN
00046 #define cwcCHOPHASHMAX  (1 + 5)   // "-%05hu" decimal USHORT hash digits
00047 #define cwcCHOPBASE   (cwcCNMAX - (cwcCHOPHASHMAX + cwcSUFFIXMAX))
00048
00049 HRESULT
00050 ceSanitizedNameToDSName(
00051     IN WCHAR const *pwszSanitizedName,
00052     OUT WCHAR **ppwszNameOut)
00053 {
00054     HRESULT hr;
00055     DWORD cwc;
00056     DWORD cwcCopy;
00057     WCHAR wszDSName[cwcCHOPBASE + cwcCHOPHASHMAX + 1];
00058
00059     *ppwszNameOut = NULL;
00060
00061     cwc = wcslen(pwszSanitizedName);
00062     cwcCopy = cwc;
00063     if (cwcCHOPBASE < cwcCopy)
00064     {
00065   cwcCopy = cwcCHOPBASE;
00066     }
00067     CopyMemory(wszDSName, pwszSanitizedName, cwcCopy * sizeof(WCHAR));
00068     wszDSName[cwcCopy] = L'\0';
00069
00070     if (cwcCHOPBASE < cwc)
00071     {
00072         // Hash the rest of the name into a USHORT
00073         USHORT usHash = 0;
00074   DWORD i;
00075   WCHAR *pwsz;
00076
00077   // Truncate an incomplete sanitized Unicode character
00078
00079   pwsz = wcsrchr(wszDSName, L'!');
00080   if (NULL != pwsz && wcslen(pwsz) < 5)
00081   {
00082       cwcCopy -= wcslen(pwsz);
00083       *pwsz = L'\0';
00084   }
00085
00086         for (i = cwcCopy; i < cwc; i++)
00087         {
00088             USHORT usLowBit = (0x8000 & usHash)? 1 : 0;
00089
00090       usHash = ((usHash << 1) | usLowBit) + pwszSanitizedName[i];
00091         }
00092   wsprintf(&wszDSName[cwcCopy], L"-%05hu", usHash);
00093   assert(wcslen(wszDSName) < ARRAYSIZE(wszDSName));
00094     }
00095
00096     hr = ceDupString(wszDSName, ppwszNameOut);
00097     _JumpIfError(hr, error, "ceDupString");
00098
00099 error:
00100     return(hr);
00101 }
00102
00103
00104 HRESULT
00105 ceInternetCanonicalizeUrl(
00106     IN WCHAR const *pwszIn,
00107     OUT WCHAR **ppwszOut)
00108 {
00109     HRESULT hr;
00110     WCHAR *pwsz = NULL;
00111
00112     assert(NULL != pwszIn);
00113
00114     if (0 == _wcsnicmp(L"file:", pwszIn, 5))
00115     {
00116   hr = ceDupString(pwszIn, &pwsz);
00117         _JumpIfError(hr, error, "ceDupString");
00118     }
00119     else
00120     {
00121   // Calculate required buffer size by passing a very small buffer
00122   // The call will fail, and tell us how big the buffer should be.
00123
00124   WCHAR wszPlaceHolder[1];
00125   DWORD cwc = ARRAYSIZE(wszPlaceHolder);
00126   BOOL bResult;
00127
00128   bResult = InternetCanonicalizeUrl(
00129             pwszIn,   // lpszUrl
00130             wszPlaceHolder, // lpszBuffer
00131             &cwc,   // lpdwBufferLength
00132             0);   // dwFlags
00133   assert(!bResult); // This will always fail
00134
00135   hr = ceHLastError();
00136   if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) != hr)
00137   {
00138       // unexpected error
00139
00140       _JumpError(hr, error, "InternetCanonicalizeUrl");
00141   }
00142
00143   // NOTE: InternetCanonicalizeUrl counts characters, not bytes as doc'd
00144   // cwc includes trailing L'0'
00145
00146   pwsz = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
00147   if (NULL == pwsz)
00148   {
00149       hr = E_OUTOFMEMORY;
00150       _JumpError(hr, error, "LocalAlloc");
00151   }
00152
00153   // canonicalize
00154   if (!InternetCanonicalizeUrl(
00155         pwszIn, // lpszUrl
00156         pwsz, // lpszBuffer
00157         &cwc, // lpdwBufferLength
00158         0))   // dwFlags
00159   {
00160       hr = ceHLastError();
00161       _JumpError(hr, error, "InternetCanonicalizeUrl");
00162   }
00163     }
00164     *ppwszOut = pwsz;
00165     pwsz = NULL;
00166     hr = S_OK;
00167
00168 error:
00169     if (NULL != pwsz)
00170     {
00171         LocalFree(pwsz);
00172     }
00173     return(hr);
00174 }
00175
00176
00177 // ceFormatCertsrvStringArray FormatMessage arguments:
00178 //
00179 // %1 -- Machine full DNS name: pwszServerName_p1_2;
00180 //
00181 // %2 -- Machine short name: first DNS component of pwszServerName_p1_2
00182 //
00183 // %3 -- Sanitized CA name: pwszSanitizedName_p3_7
00184 //
00185 // %4 -- Cert Filename Suffix:
00186 //       if 0 == iCert_p4 && MAXDWORD == iCertTarget_p4: L""
00187 //       else if MAXDWORD != iCertTarget_p4 L"(%u-%u)"
00188 //       else L"(%u)"
00189 //
00190 // %5 -- DS DN path to Domain root: pwszDomainDN_p5
00191 //
00192 // %6 -- DS DN path to Configuration container: pwszConfigDN_p6
00193 //
00194 // %7 -- Sanitized CA name, truncated and hash suffix added if too long:
00195 //   pwszSanitizedName_p3_7
00196 //
00197 // %8 -- CRL Filename/Key Name Suffix: L"" if 0 == iCRL_p8; else L"(%u)"
00198 //
00199 // %9 -- CRL Filename Suffix: L"" if !fDeltaCRL_p9; else L"+"
00200 //
00201 // %10 -- DS CRL attribute: L"" if !fDSAttrib_p10_11; depends on fDeltaCRL_p9
00202 //
00203 // %11 -- DS CA Cert attribute: L"" if !fDSAttrib_p10_11
00204 //
00205 // %12 -- DS user cert attribute
00206 //
00207 // %13 -- DS KRA cert attribute
00208 //
00209 // %14 -- DS cross cert pair attribute
00210
00211 #ifndef wszDSSEARCHBASECRLATTRIBUTE
00212 #define wszDSSEARCHBASECRLATTRIBUTE L"?certificateRevocationList?base?objectclass=cRLDistributionPoint"
00213 #endif
00214
00215 #ifndef wszDSSEARCHDELTACRLATTRIBUTE
00216 #define wszDSSEARCHDELTACRLATTRIBUTE L"?deltaRevocationList?base?objectclass=cRLDistributionPoint"
00217 #endif
00218
00219 #ifndef wszDSSEARCHCACERTATTRIBUTE
00220 #define wszDSSEARCHCACERTATTRIBUTE L"?cACertificate?base?objectclass=certificationAuthority"
00221 #endif
00222
00223 #ifndef wszDSSEARCHUSERCERTATTRIBUTE
00224 #define wszDSSEARCHUSERCERTATTRIBUTE L"?userCertificate?base?objectClass=*"
00225 #endif
00226
00227 #ifndef wszDSSEARCHKRACERTATTRIBUTE
00228 #define wszDSSEARCHKRACERTATTRIBUTE L"?userCertificate?one?objectClass=msPKI-PrivateKeyRecoveryAgent"
00229 #endif
00230
00231 #ifndef wszDSSEARCHCROSSCERTPAIRATTRIBUTE
00232 #define wszDSSEARCHCROSSCERTPAIRATTRIBUTE L"?crossCertificatePair?one?objectClass=certificationAuthority"
00233 #endif
00234
00235
00236 HRESULT
00237 ceFormatCertsrvStringArray(
00238     IN BOOL    fURL,
00239     IN LPCWSTR pwszServerName_p1_2,
00240     IN LPCWSTR pwszSanitizedName_p3_7,
00241     IN DWORD   iCert_p4,
00242     IN DWORD   iCertTarget_p4,
00243     IN LPCWSTR pwszDomainDN_p5,
00244     IN LPCWSTR pwszConfigDN_p6,
00245     IN DWORD   iCRL_p8,
00246     IN BOOL    fDeltaCRL_p9,
00247     IN BOOL    fDSAttrib_p10_11,
00248     IN DWORD   cStrings,
00249     IN LPCWSTR *apwszStringsIn,
00250     OUT LPWSTR *apwszStringsOut)
00251 {
00252     HRESULT hr = S_OK;
00253     LPCWSTR apwszInsertionArray[100];  // 100 'cause this is the max number of insertion numbers allowed by FormatMessage
00254     LPWSTR    pwszCurrent = NULL;
00255     BSTR      strShortMachineName = NULL;
00256     DWORD     i;
00257     WCHAR *pwszSanitizedDSName = NULL;
00258     WCHAR wszCertSuffix[2 * cwcFILENAMESUFFIXMAX];
00259     WCHAR wszCRLSuffix[cwcFILENAMESUFFIXMAX];
00260     WCHAR wszDeltaCRLSuffix[cwcFILENAMESUFFIXMAX];
00261     WCHAR const *pwszT;
00262
00263
00264     ZeroMemory(apwszStringsOut, cStrings * sizeof(apwszStringsOut[0]));
00265     ZeroMemory(apwszInsertionArray, sizeof(apwszInsertionArray));
00266
00267     // Format the template into a real name
00268     // Initialize the insertion string array.
00269
00270     //+================================================
00271     // Machine DNS name (%1)
00272
00273     assert(L'1' == wszFCSAPARM_SERVERDNSNAME[1]);
00274     apwszInsertionArray[1 - 1] = pwszServerName_p1_2;
00275
00276     //+================================================
00277     // Short Machine Name (%2)
00278
00279     assert(L'2' == wszFCSAPARM_SERVERSHORTNAME[1]);
00280     strShortMachineName = SysAllocString(pwszServerName_p1_2);
00281     if (strShortMachineName == NULL)
00282     {
00283         hr = E_OUTOFMEMORY;
00284         _JumpIfError(hr, error, "SysAllocString");
00285     }
00286
00287     pwszCurrent = wcschr(strShortMachineName, L'.');
00288     if (NULL != pwszCurrent)
00289     {
00290         *pwszCurrent = 0;
00291     }
00292     apwszInsertionArray[2 - 1] = strShortMachineName;
00293
00294     //+================================================
00295     // sanitized name (%3)
00296
00297     assert(L'3' == wszFCSAPARM_SANITIZEDCANAME[1]);
00298     apwszInsertionArray[3 - 1] = pwszSanitizedName_p3_7;
00299
00300     //+================================================
00301     // Cert filename suffix (%4) | (%4-%4)
00302
00303     assert(L'4' == wszFCSAPARM_CERTFILENAMESUFFIX[1]);
00304     wszCertSuffix[0] = L'\0';
00305     if (0 != iCert_p4 || MAXDWORD != iCertTarget_p4)
00306     {
00307         wsprintf(
00308       wszCertSuffix,
00309       MAXDWORD != iCertTarget_p4? L"(%u-%u)" : L"(%u)",
00310       iCert_p4,
00311       iCertTarget_p4);
00312     }
00313     apwszInsertionArray[4 - 1] = wszCertSuffix;
00314
00315     //+================================================
00316     // Domain DN (%5)
00317
00318     if (NULL == pwszDomainDN_p5 || L'\0' == *pwszDomainDN_p5)
00319     {
00320   pwszDomainDN_p5 = L"DC=UnavailableDomainDN";
00321     }
00322     assert(L'5' == wszFCSAPARM_DOMAINDN[1]);
00323     apwszInsertionArray[5 - 1] = pwszDomainDN_p5;
00324
00325     //+================================================
00326     // Config DN (%6)
00327
00328     if (NULL == pwszConfigDN_p6 || L'\0' == *pwszConfigDN_p6)
00329     {
00330   pwszConfigDN_p6 = L"DC=UnavailableConfigDN";
00331     }
00332     assert(L'6' == wszFCSAPARM_CONFIGDN[1]);
00333     apwszInsertionArray[6 - 1] = pwszConfigDN_p6;
00334
00335     // Don't pass pwszSanitizedName_p3_7 to SysAllocStringLen with the extended
00336     // length to avoid faulting past end of pwszSanitizedName_p3_7.
00337
00338     //+================================================
00339     // Sanitized Short Name (%7)
00340
00341     assert(L'7' == wszFCSAPARM_SANITIZEDCANAMEHASH[1]);
00342     hr = ceSanitizedNameToDSName(pwszSanitizedName_p3_7, &pwszSanitizedDSName);
00343     _JumpIfError(hr, error, "ceSanitizedNameToDSName");
00344
00345     apwszInsertionArray[7 - 1] = pwszSanitizedDSName;
00346
00347     //+================================================
00348     // CRL filename suffix (%8)
00349
00350     assert(L'8' == wszFCSAPARM_CRLFILENAMESUFFIX[1]);
00351     wszCRLSuffix[0] = L'\0';
00352     if (0 != iCRL_p8)
00353     {
00354         wsprintf(wszCRLSuffix, L"(%u)", iCRL_p8);
00355     }
00356     apwszInsertionArray[8 - 1] = wszCRLSuffix;
00357
00358     //+================================================
00359     // Delta CRL filename suffix (%9)
00360
00361     assert(L'9' == wszFCSAPARM_CRLDELTAFILENAMESUFFIX[1]);
00362     wszDeltaCRLSuffix[0] = L'\0';
00363     if (fDeltaCRL_p9)
00364     {
00365         wcscpy(wszDeltaCRLSuffix, L"+");
00366     }
00367     apwszInsertionArray[9 - 1] = wszDeltaCRLSuffix;
00368
00369     //+================================================
00370     // CRL attribute (%10)
00371
00372     assert(L'1' == wszFCSAPARM_DSCRLATTRIBUTE[1]);
00373     assert(L'0' == wszFCSAPARM_DSCRLATTRIBUTE[2]);
00374     pwszT = L"";
00375     if (fDSAttrib_p10_11)
00376     {
00377   pwszT = fDeltaCRL_p9?
00378         wszDSSEARCHDELTACRLATTRIBUTE :
00379         wszDSSEARCHBASECRLATTRIBUTE;
00380     }
00381     apwszInsertionArray[10 - 1] = pwszT;
00382
00383     //+================================================
00384     // CA cert attribute (%11)
00385
00386     assert(L'1' == wszFCSAPARM_DSCACERTATTRIBUTE[1]);
00387     assert(L'1' == wszFCSAPARM_DSCACERTATTRIBUTE[2]);
00388     pwszT = L"";
00389     if (fDSAttrib_p10_11)
00390     {
00391   pwszT = wszDSSEARCHCACERTATTRIBUTE;
00392     }
00393     apwszInsertionArray[11 - 1] = pwszT;
00394
00395     //+================================================
00396     // User cert attribute (%12)
00397
00398     assert(L'1' == wszFCSAPARM_DSUSERCERTATTRIBUTE[1]);
00399     assert(L'2' == wszFCSAPARM_DSUSERCERTATTRIBUTE[2]);
00400     pwszT = L"";
00401     if (fDSAttrib_p10_11)
00402     {
00403   pwszT = wszDSSEARCHUSERCERTATTRIBUTE;
00404     }
00405     apwszInsertionArray[12 - 1] = pwszT;
00406
00407     //+================================================
00408     // KRA cert attribute (%13)
00409
00410     assert(L'1' == wszFCSAPARM_DSKRACERTATTRIBUTE[1]);
00411     assert(L'3' == wszFCSAPARM_DSKRACERTATTRIBUTE[2]);
00412     pwszT = L"";
00413     if (fDSAttrib_p10_11)
00414     {
00415   pwszT = wszDSSEARCHKRACERTATTRIBUTE;
00416     }
00417     apwszInsertionArray[13 - 1] = pwszT;
00418
00419     //+================================================
00420     // Cross cert pair attribute (%14)
00421
00422     assert(L'1' == wszFCSAPARM_DSCROSSCERTPAIRATTRIBUTE[1]);
00423     assert(L'4' == wszFCSAPARM_DSCROSSCERTPAIRATTRIBUTE[2]);
00424     pwszT = L"";
00425     if (fDSAttrib_p10_11)
00426     {
00427   pwszT = wszDSSEARCHCROSSCERTPAIRATTRIBUTE;
00428     }
00429     apwszInsertionArray[14 - 1] = pwszT;
00430
00431     //+================================================
00432     // Now format the strings...
00433
00434     for (i = 0; i < cStrings; i++)
00435     {
00436         if (0 == FormatMessage(
00437       FORMAT_MESSAGE_ALLOCATE_BUFFER |
00438           FORMAT_MESSAGE_FROM_STRING |
00439           FORMAT_MESSAGE_ARGUMENT_ARRAY,
00440       (VOID *) apwszStringsIn[i],
00441       0,              // dwMessageID
00442       0,              // dwLanguageID
00443       (LPWSTR) &apwszStringsOut[i],
00444       wcslen(apwszStringsIn[i]),
00445       (va_list *) apwszInsertionArray))
00446         {
00447             hr = ceHLastError();
00448       _JumpError(hr, error, "FormatMessage");
00449         }
00450   if (fURL)
00451   {
00452       WCHAR *pwsz;
00453
00454       hr = ceInternetCanonicalizeUrl(apwszStringsOut[i], &pwsz);
00455       _JumpIfError(hr, error, "ceInternetCanonicalizeUrl");
00456
00457       LocalFree(apwszStringsOut[i]);
00458       apwszStringsOut[i] = pwsz;
00459   }
00460     }
00461
00462 error:
00463     if (S_OK != hr)
00464     {
00465   for (i = 0; i < cStrings; i++)
00466   {
00467       if (NULL != apwszStringsOut[i])
00468       {
00469     LocalFree(apwszStringsOut[i]);
00470     apwszStringsOut[i] = NULL;
00471       }
00472   }
00473     }
00474     if (NULL != strShortMachineName)
00475     {
00476         SysFreeString(strShortMachineName);
00477     }
00478     if (NULL != pwszSanitizedDSName)
00479     {
00480         LocalFree(pwszSanitizedDSName);
00481     }
00482     return (hr);
00483 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

view Member List

This is the complete list of members for view, including all inherited members.
bExpand | view
bExpandGuard | view
bExpanding | view
ciSelect | view
cl | view
hwnd | view
maxrest | view
maxtag | view
nrtext | view
pItems | view
pLines | view
rows | view
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/socket.h Source File

  • NetDS
  • RRas
  • ip

socket.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\socket.h
00008
00009 Abstract:
00010
00011     The file contains the header for socket.c
00012
00013 --*/
00014
00015 #ifndef _SOCKET_H_
00016 #define _SOCKET_H_
00017
00018 DWORD
00019 SocketCreate (
00020     IN  IPADDRESS               ipAddress,
00021     IN  HANDLE                  hEvent,
00022     OUT SOCKET                  *psSocket);
00023
00024 DWORD
00025 SocketDestroy (
00026     IN  SOCKET                  sSocket);
00027
00028 DWORD
00029 SocketSend (
00030     IN  SOCKET                  sSocket,
00031     IN  IPADDRESS               ipDestination,
00032     IN  PPACKET                 pPacket);
00033
00034 DWORD
00035 SocketReceive (
00036     IN  SOCKET                  sSocket,
00037     IN  PPACKET                 pPacket);
00038
00039 BOOL
00040 SocketReceiveEvent (
00041     IN  SOCKET                  sSocket);
00042
00043 #endif // _SOCKET_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/inc/IsapiExtension.h Source File

  • Web
  • iis
  • ISAPI_6.0
  • inc

IsapiExtension.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: IsapiExtension.h
00006
00007 Abstract:
00008
00009     A class to provide basic services to an
00010     ISAPI extension
00011
00012 Author:
00013
00014     ISAPI developer (Microsoft employee), October 2002
00015
00016 --*/
00017
00018 #ifndef _isapiextension_h
00019 #define _isapiextension_h
00020
00021 #include <IsapiTools.h>
00022
00023 typedef BOOL (WINAPI * PFN_FIRST_HIT_INIT)(VOID * pContext);
00024
00025
00026 class ISAPI_EXTENSION
00027 {
00028 public:
00029
00030     ISAPI_EXTENSION();
00031
00032     virtual
00033     ~ISAPI_EXTENSION();
00034
00035     BOOL
00036     Initialize(
00037         LPSTR   szModuleName
00038         );
00039
00040     BOOL
00041     InitOnce(
00042         PFN_FIRST_HIT_INIT          pfnInit,
00043         VOID *                      pContext
00044         );
00045
00046     CHAR *
00047     QueryModulePath(
00048         VOID
00049         );
00050
00051 private:
00052
00053     ISAPI_STRING        _strModuleName;
00054     ISAPI_STRING        _strModulePath;
00055     PFN_FIRST_HIT_INIT  _pfnInit;
00056     CRITICAL_SECTION    _csInit;
00057     BOOL                _fFirstHitInitDone;
00058     BOOL                _fInitialized;
00059 };
00060
00061 #endif  // _isaextension_h
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/CConf.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

CConf.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CCONF.CPP
00004 //  Content:    INmConference Routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018 COBLIST * g_pListConference     = NULL;
00019 COBLIST * g_pListConferenceNotify = NULL;
00020
00021
00022 //****************************************************************************
00023 //
00024 // INmConference * GetCurrentConference(void)
00025 //
00026 //****************************************************************************
00027
00028 INmConference * GetCurrentConference(void)
00029 {
00030   if (NULL == g_pListConference)
00031     return NULL;
00032
00033   return (INmConference *) g_pListConference->GetTail();
00034 }
00035
00036
00037 //****************************************************************************
00038 //
00039 // HRESULT HookConference(INmConference * pConference)
00040 //
00041 //****************************************************************************
00042
00043 HRESULT HookConference(INmConference * pConference)
00044 {
00045   HRESULT     hr    = NO_ERROR  ;
00046   CConfNotify * pNotify = NULL    ;
00047
00048   ASSERT(NULL != pConference);
00049   if  (NULL == pConference)
00050     return E_POINTER;
00051
00052   pConference->AddRef();
00053   if  (NULL == AddNode(pConference, &g_pListConference))
00054   {
00055     ERROR_MSG(TEXT("AddNode failed HookConference, pNotify"));
00056     pConference -> Release();
00057     return E_FAIL;
00058   }
00059
00060     // Connect to the conference object
00061     pNotify = new CConfNotify();
00062     if (NULL == pNotify)
00063     {
00064         hr = E_OUTOFMEMORY;
00065         ERROR_MSG(TEXT("Unable to allocate CConfNotify"));
00066     }
00067     else
00068     {
00069     hr = pNotify->Connect(pConference);
00070     if (FAILED(hr))
00071     {
00072       TRACE_MSG(TEXT("CConfNotify Failed (%s)"), GetHrSz(hr));
00073       pNotify->Release();
00074       pNotify = NULL;
00075     }
00076     else
00077     {
00078       if  (NULL != AddNode(pNotify, &g_pListConferenceNotify))
00079       {
00080         TRACE_MSG(TEXT("Conference Connection point established successfully"));
00081       }
00082       else
00083       {
00084         ERROR_MSG(TEXT("AddNode failed HookConference, pNotify"));
00085         pNotify -> Disconnect();
00086         pNotify -> Release();
00087         pNotify =  NULL;
00088
00089         hr = E_FAIL;
00090       }
00091     }
00092   }
00093
00094   if  SUCCEEDED(hr)
00095   {
00096     UpdateStatusIcon(ICO_PHONE);
00097   }
00098
00099   return hr;
00100 }
00101
00102
00103 //****************************************************************************
00104 //
00105 // VOID FreeConferences(void)
00106 //
00107 //****************************************************************************
00108
00109 VOID FreeConferences(void)
00110 {
00111   // Release all notify
00112   if (NULL != g_pListConferenceNotify)
00113   {
00114     while (!g_pListConferenceNotify->IsEmpty())
00115     {
00116       CConfNotify * pNotify = (CConfNotify *) g_pListConferenceNotify->RemoveHead();
00117       ASSERT(NULL != pNotify);
00118       if  (NULL == pNotify)
00119       {
00120         WARN_MSG(TEXT("FreeConferences, NULL == pNotify"));
00121         break;
00122       }
00123
00124       OBJECT_MSG(TEXT("[%08X] conference notify released"), pNotify);
00125       pNotify->Disconnect();
00126       pNotify->Release();
00127     }
00128   }
00129
00130   if (NULL != g_pListConference)
00131   {
00132     while (!g_pListConference->IsEmpty())
00133     {
00134       INmConference * pConference = (INmConference *) g_pListConference->RemoveHead();
00135       ASSERT(NULL != pConference);
00136       if  (NULL == pConference)
00137       {
00138         WARN_MSG(TEXT("FreeConferences, NULL == pNotify"));
00139         break;
00140       }
00141
00142       OBJECT_MSG(TEXT("[%08X] conference released"), pConference);
00143       pConference->Release();
00144     }
00145   }
00146
00147   UpdateStatusIcon(NULL);
00148 }
00149
00150
00151 //****************************************************************************
00152 //
00153 // VOID DoConferenceCreate(void)
00154 //
00155 // Create a local conference object
00156 //
00157 //****************************************************************************
00158
00159 VOID DoConferenceCreate(void)
00160 {
00161   HRESULT       hr      = NO_ERROR  ;
00162   INmConference * pConference = NULL    ;
00163
00164   // Validate system
00165   if (NULL == g_pMgr)
00166   {
00167     ERROR_MSG(TEXT("No conference manager object"));
00168     return;
00169   }
00170
00171   if (NULL != GetCurrentConference())
00172   {
00173     WARN_MSG(TEXT("Attempting to create second conference"));
00174   }
00175
00176   // Create Local Conference
00177   BSTRING bstrName(gPref.pszConferenceName);
00178   BSTRING bstrPassword(gPref.pszPassword);
00179
00180   if  ( ((NULL == (BSTR) bstrName) && (NULL != gPref.pszConferenceName))
00181     ||  ((NULL == (BSTR) bstrPassword) && (NULL != gPref.pszPassword))
00182     )
00183     return;
00184
00185
00186   hr = g_pMgr->CreateConference(&pConference, bstrName, bstrPassword, gPref.dwNmch);
00187   if (SUCCEEDED(hr) && (NULL != pConference))
00188   {
00189     hr = pConference->Host();
00190     if (FAILED(hr))
00191     {
00192       WARN_MSG(TEXT("Failed to host conference"));
00193     }
00194
00195     // Release here, because we always AddRef in INmManager.ConferenceCreated
00196
00197     ASSERT(pConference == GetCurrentConference());
00198     pConference->Release();
00199
00200     TRACE_MSG(TEXT("CreateConference succeeded"));
00201   }
00202   else
00203   {
00204     ERROR_MSG(TEXT("CreateConference failed HResult=%s"), GetHrSz(hr));
00205   }
00206 }
00207
00208
00209 //****************************************************************************
00210 //
00211 // VOID DoConferenceLeave(void)
00212 //
00213 //****************************************************************************
00214
00215 VOID DoConferenceLeave(void)
00216 {
00217   HRESULT       hr      = NO_ERROR  ;
00218   INmConference * pConference = NULL    ;
00219
00220   pConference = GetCurrentConference();
00221   if (NULL == pConference)
00222   {
00223     ERROR_MSG(TEXT("No conference object"));
00224     return;
00225   }
00226
00227   hr = pConference->Leave();
00228   if (FAILED(hr))
00229   {
00230     ERROR_MSG(TEXT("Conference Leave hresult=%s"), GetHrSz(hr));
00231   }
00232   else
00233   {
00234     TRACE_MSG(TEXT("Conference Leave successful..."));
00235   }
00236 }
00237
00238
00239 //****************************************************************************
00240 //
00241 // CLASS CConfNotify
00242 //
00243 //****************************************************************************
00244
00245 CConfNotify::CConfNotify() : RefCount(), CNotify()
00246 {
00247   OBJECT_MSG(TEXT("CConfNotify created"));
00248 }
00249
00250 CConfNotify::~CConfNotify()
00251 {
00252   OBJECT_MSG(TEXT("CConfNotify destroyed"));
00253 }
00254
00255
00256 //****************************************************************************
00257 //
00258 // Methods from IUknown
00259 //
00260 //****************************************************************************
00261
00262 ULONG STDMETHODCALLTYPE CConfNotify::AddRef(void)
00263 {
00264   return RefCount::AddRef();
00265 }
00266
00267
00268 ULONG STDMETHODCALLTYPE CConfNotify::Release(void)
00269 {
00270   return RefCount::Release();
00271 }
00272
00273 HRESULT STDMETHODCALLTYPE CConfNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00274 {
00275   if  (NULL == ppvObject)
00276     return E_POINTER;
00277
00278   HRESULT hr = NO_ERROR;
00279
00280   if (riid == IID_IUnknown)
00281   {
00282     *ppvObject = (IUnknown *)this;
00283     OBJECT_MSG(TEXT("CConfNotify::QueryInterface(): Returning IUnknown."));
00284   }
00285   else if (riid == IID_INmConferenceNotify)
00286   {
00287     *ppvObject = (INmConferenceNotify *)this;
00288     OBJECT_MSG(TEXT("CConfNotify::QueryInterface(): Returning INmConferenceNotify."));
00289   }
00290   else
00291   {
00292     hr = E_NOINTERFACE;
00293     *ppvObject = NULL;
00294     OBJECT_MSG(TEXT("CConfNotify::QueryInterface(): Called on unknown interface."));
00295   }
00296
00297   if  SUCCEEDED(hr)
00298   {
00299     AddRef();
00300   }
00301
00302   return hr;
00303 }
00304
00305
00306 //****************************************************************************
00307 //
00308 // Methods from ICNotify
00309 //
00310 //****************************************************************************
00311
00312 HRESULT STDMETHODCALLTYPE CConfNotify::Connect(IUnknown *pUnk)
00313 {
00314   return CNotify::Connect(pUnk, IID_INmConferenceNotify, (IUnknown *)this);
00315 }
00316
00317 HRESULT STDMETHODCALLTYPE CConfNotify::Disconnect(void)
00318 {
00319   return CNotify::Disconnect();
00320 }
00321
00322
00323 //****************************************************************************
00324 //
00325 // Methods from IConfNotify
00326 //
00327 //****************************************************************************
00328
00329
00330 //****************************************************************************
00331 //
00332 // HRESULT STDMETHODCALLTYPE CConfNotify::NmUI(CONFN uNotify)
00333 //
00334 //****************************************************************************
00335
00336 HRESULT STDMETHODCALLTYPE CConfNotify::NmUI(CONFN uNotify)
00337 {
00338   LOG_MSG(RGB(255, 0, 255), TEXT("INmConference.NmUI CONFN=%s"), GetConfnSz(uNotify));
00339   return S_OK;
00340 }
00341
00342
00343 //****************************************************************************
00344 //
00345 // HRESULT STDMETHODCALLTYPE CConfNotify::StateChanged(NM_CONFERENCE_STATE uState)
00346 //
00347 //****************************************************************************
00348
00349 HRESULT STDMETHODCALLTYPE CConfNotify::StateChanged(NM_CONFERENCE_STATE uState)
00350 {
00351   STATE_MSG(TEXT("INmConference.StateChanged uState=%s"), GetConferenceStateSz(uState));
00352
00353   switch (uState)
00354     {
00355   case NM_CONFERENCE_ACTIVE:
00356   {
00357     if (gPref.fAutoChat)
00358     {
00359       DoCreateDataChannel(GetCurrentConference());
00360     }
00361     break;
00362   }
00363   case NM_CONFERENCE_IDLE:
00364   {
00365     FreeDataChannel();
00366     FreeAllUsers();
00367     FreeChannels();
00368     break;
00369   }
00370   default:
00371     break;
00372     } /* switch (uState) */
00373
00374   return S_OK;
00375 }
00376
00377
00378 //****************************************************************************
00379 //
00380 // HRESULT STDMETHODCALLTYPE CConfNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00381 //
00382 //****************************************************************************
00383
00384 HRESULT STDMETHODCALLTYPE CConfNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00385 {
00386   NOTIFY_MSG(TEXT("INmConference.MemberChanged uNotify=%d"), uNotify);
00387   DumpMemberInfo(pMember);
00388
00389   switch (uNotify)
00390     {
00391   case NM_MEMBER_ADDED:
00392     AddMember(pMember);
00393     break;
00394   case NM_MEMBER_REMOVED:
00395     RemoveMember(pMember);
00396     break;
00397   default:
00398     break;
00399     }
00400
00401   return S_OK;
00402 }
00403
00404
00405 //****************************************************************************
00406 //
00407 // HRESULT STDMETHODCALLTYPE CConfNotify::ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel)
00408 //
00409 //****************************************************************************
00410
00411 HRESULT STDMETHODCALLTYPE CConfNotify::ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *pChannel)
00412 {
00413   NOTIFY_MSG(TEXT("INmConference.ChannelChanged uNotify=%d"), uNotify);
00414   DumpChannelInfo(pChannel);
00415   static BOOL s_fShared = FALSE;
00416   static BOOL s_fCollaborated = FALSE;
00417
00418
00419   switch (uNotify)
00420     {
00421   case NM_CHANNEL_ADDED:
00422     HookChannel(pChannel);
00423     break;
00424   case NM_CHANNEL_REMOVED:
00425     UnHookChannel(pChannel);
00426     break;
00427   case NM_CHANNEL_UPDATED:
00428     UpdateChannelState(pChannel);
00429     break;
00430   default:
00431     break;
00432     }
00433
00434   return S_OK;
00435 }
00436
00437
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/DCOMServer.h Source File

  • Com
  • async
  • server

DCOMServer.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #if !defined(__CSERVER__)
00018 #define __CSERVER__
00019
00020 #include <windows.h>
00021 #include "CUnknown.h"
00022 #include "proxy.h"
00023 #include "CConnectionpt.h"
00024
00025
00026 typedef ISynchronize *LPSYNCHRONIZE;
00027 typedef ICallFactory *LPCALLFACTORY;
00028
00029 extern "C" const CLSID CLSID_AsyncTest;
00030 extern CLSID g_clsid;
00031 extern LPOLESTR g_progID;
00032
00033
00034 class CServer  : public CUnknown,
00035            public ITest
00036 #if defined(_ASYNC_COM_)
00037            ,public ICallFactory
00038 #endif
00039 #if defined(_EVENTSINK_)
00040            ,public CConnectionPointContainer
00041 #endif
00042
00043 {
00044 public:
00045   // Creation
00046   static HRESULT _stdcall CreateInstance(IUnknown* pUnknownOuter,
00047                                 CUnknown** ppNewComponent) ;
00048
00049 private:
00050   // Declare the delegating IUnknown.
00051   DECLARE_IUNKNOWN
00052
00053   // IUnknown
00054   virtual HRESULT __stdcall
00055     NondelegatingQueryInterface(const IID& iid, void** ppv);
00056
00057   // Initialization
00058   virtual HRESULT __stdcall Init(const CFactoryData *pData);
00059
00060
00061   // Notify derived classes that we are releasing.
00062   virtual void __stdcall FinalRelease();
00063
00064   // Constructor
00065   CServer(IUnknown* pUnknownOuter);
00066
00067   // Destructor
00068   ~CServer();
00069
00070 private:
00071   // state variables
00072
00073 /*
00074  * ITest
00075  *
00076  */
00077   HRESULT __stdcall Test1(BSTR bstr);
00078   HRESULT __stdcall Test2(BSTR bstrIn, BSTR *lpbstrOut);
00079
00080
00081 #if defined(_ASYNC_COM_)
00082 /*
00083  * ICallFactory
00084  *
00085  */
00086     HRESULT __stdcall CreateCall(REFIID riid, LPUNKNOWN pUnkCtrl, REFIID riid2, LPUNKNOWN *ppv);
00087 #endif
00088
00089 public:
00090
00091 // accessor functions
00092   static LPOLESTR GetProgID() {return g_progID;}
00093   static CLSID GetCLSID() {return g_clsid;}
00094 };
00095
00096 #endif // __CSERVER__
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/tracemacro.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

tracemacro.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "TraceMacro.h"
00017 #include <StdIo.h>             // Needed for sprintf on Win98
00018
00019
00020 //---------------------------------------------------------------------------
00021 //  Function implementations
00022 //
00023
00024 //---------------------------------------------------------------------------
00025 //  Provides trace output for HRESULTs in hex.
00026 //
00027 VOID Trace_HR
00028 (
00029   LPCTSTR pszClass,        //[in] Class name for message
00030   LPCTSTR pszFunction,     //[in] Function name for message
00031   HRESULT hr               //[in] HRESULT to display as a value
00032 )
00033 {
00034 #ifdef _DEBUG
00035
00036   TCHAR  szBuffer[512];
00037   TCHAR  szFormat[] = _T("%s::%s-> Returned 0x%X\n");
00038   INT    nChars     = 0;
00039
00040   nChars = _stprintf( szBuffer, szFormat, pszClass, pszFunction, hr );
00041   _ASSERTE( nChars < sizeof(szBuffer) );
00042
00043   OutputDebugString( szBuffer );
00044
00045 #endif
00046 } //end Trace_HR()
00047
00048
00049 //---------------------------------------------------------------------------
00050 //  Provides trace output for user defined numeric values in the form:
00051 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00052 //
00053 VOID Trace_Value
00054 (
00055   LPCTSTR pszClass,        //[in] Class name for message
00056   LPCTSTR pszFunction,     //[in] Function name for message
00057   LPCTSTR pszValueName,    //[in] Value name for message
00058   LONG    nValue           //[in] Numeric value for message
00059 )
00060 {
00061 #ifdef _DEBUG
00062
00063   TCHAR  szBuffer[512];
00064   TCHAR  szFormat[] = _T("%s::%s-> %s = %u\n");
00065   INT    nChars     = 0;
00066
00067   nChars = _stprintf( szBuffer,
00068                       szFormat,
00069                       pszClass,
00070                       pszFunction,
00071                       pszValueName,
00072                       nValue
00073                     );
00074   _ASSERTE( nChars < sizeof(szBuffer) );
00075
00076   OutputDebugString( szBuffer );
00077
00078 #endif
00079 } //end Trace_Value()
00080
00081 //---------------------------------------------------------------------------
00082 //  Provides trace output for user defined numeric values in the form:
00083 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00084 //
00085 VOID Trace_Pointer
00086 (
00087   LPCTSTR pszClass,        //[in] Class name for message
00088   LPCTSTR pszFunction,     //[in] Function name for message
00089   LPCTSTR pszAction,       //[in] Action which was taken
00090   ULONG   ulValue          //[in] Numeric value for message
00091 )
00092 {
00093 #ifdef _DEBUG
00094
00095   TCHAR  szBuffer[512];
00096   TCHAR  szFormat[] = _T("%s::%s-> %s = 0x%X\n");
00097   INT    nChars     = 0;
00098
00099   nChars = _stprintf( szBuffer,
00100                       szFormat,
00101                       pszClass,
00102                       pszFunction,
00103                       pszAction,
00104                       ulValue
00105                     );
00106   _ASSERTE( nChars < sizeof(szBuffer) );
00107
00108   OutputDebugString( szBuffer );
00109
00110 #endif
00111 } //end Trace_Pointer()
00112
00113
00114 //---------------------------------------------------------------------------
00115 //  Provides trace output which shows the class name, function name, and
00116 //  a string which maps to an MMC notification.
00117 //
00118 VOID Trace_Event
00119 (
00120   LPCTSTR pszClass,        //[in] Class name for message
00121   LPCTSTR pszFunction,     //[in] Event name for message
00122   LONG    nEvent           //[in] Event code to map to string
00123 )
00124 {
00125 #ifdef _DEBUG
00126
00127   TCHAR  szEventStr[64];
00128   TCHAR  szBuffer[512];
00129   TCHAR  szFormat[] = _T("%s::%s-> Event = %s\n");
00130   INT    nChars     = 0;
00131
00132   MapEvent( nEvent, szEventStr );
00133
00134   nChars = _stprintf( szBuffer,
00135                       szFormat,
00136                       pszClass,
00137                       pszFunction,
00138                       szEventStr
00139                     );
00140   _ASSERTE( nChars < sizeof(szBuffer) );
00141
00142   OutputDebugString( szBuffer );
00143
00144 #endif
00145 } //end Trace_Event()
00146
00147 //---------------------------------------------------------------------------
00148 //  Provides trace output which shows the class name and function name
00149 //
00150 VOID Trace_Start
00151 (
00152   LPCTSTR pszClass,        //[in] Class name for message
00153   LPCTSTR pszFunction      //[in] Event name for message
00154 )
00155 {
00156 #ifdef _DEBUG
00157
00158   TCHAR  szBuffer[512];
00159   TCHAR  szFormat[] = _T("%s::%s-> Started \n");
00160   INT    nChars     = 0;
00161
00162   nChars = _stprintf( szBuffer,
00163                       szFormat,
00164                       pszClass,
00165                       pszFunction
00166                     );
00167   _ASSERTE( nChars < sizeof(szBuffer) );
00168
00169   OutputDebugString( szBuffer );
00170
00171 #endif
00172 } //end Trace_Start()
00173
00174
00175
00176 //---------------------------------------------------------------------------
00177 // Provides human readable output for notifications
00178 //
00179 VOID MapEvent( LONG Event, LPTSTR szEventStr )
00180 {
00181 #ifdef _DEBUG
00182
00183   switch( Event )
00184   {
00185     case 0x8001:
00186       _tcscpy( szEventStr, _T("MMCN_ACTIVATE          ") );
00187       break;
00188
00189     case 0x8002:
00190       _tcscpy( szEventStr, _T("MMCN_ADD_IMAGES        ") );
00191       break;
00192
00193     case 0x8003:
00194       _tcscpy( szEventStr, _T("MMCN_BTN_CLICK         ") );
00195       break;
00196
00197     case 0x8004:
00198       _tcscpy( szEventStr, _T("MMCN_CLICK             ") );
00199       break;
00200
00201     case 0x8005:
00202       _tcscpy( szEventStr, _T("MMCN_COLUMN_CLICK       ") );
00203       break;
00204
00205     case 0x8006:
00206       _tcscpy( szEventStr, _T("MMCN_CONTEXTMENU        ") );
00207       break;
00208
00209     case 0x8007:
00210       _tcscpy( szEventStr, _T("MMCN_CUTORMOVE          ") );
00211       break;
00212
00213     case 0x8008:
00214       _tcscpy( szEventStr, _T("MMCN_DBLCLICK           ") );
00215       break;
00216
00217     case 0x8009:
00218       _tcscpy( szEventStr, _T("MMCN_DELETE             ") );
00219       break;
00220
00221     case 0x800A:
00222       _tcscpy( szEventStr, _T("MMCN_DESELECT_ALL       ") );
00223       break;
00224
00225     case 0x800B:
00226       _tcscpy( szEventStr, _T("MMCN_EXPAND             ") );
00227       break;
00228
00229     case 0x800C:
00230       _tcscpy( szEventStr, _T("MMCN_HELP               ") );
00231       break;
00232
00233     case 0x800D:
00234       _tcscpy( szEventStr, _T("MMCN_MENU_BTNCLICK      ") );
00235       break;
00236
00237     case 0x800E:
00238       _tcscpy( szEventStr, _T("MMCN_MINIMIZED          ") );
00239       break;
00240
00241     case 0x800F:
00242       _tcscpy( szEventStr, _T("MMCN_PASTE              ") );
00243       break;
00244
00245     case 0x8010:
00246       _tcscpy( szEventStr, _T("MMCN_PROPERTY_CHANGE    ") );
00247       break;
00248
00249     case 0x8011:
00250       _tcscpy( szEventStr, _T("MMCN_QUERY_PASTE        ") );
00251       break;
00252
00253     case 0x8012:
00254       _tcscpy( szEventStr, _T("MMCN_REFRESH            ") );
00255       break;
00256
00257     case 0x8013:
00258       _tcscpy( szEventStr, _T("MMCN_REMOVE_CHILDREN    ") );
00259       break;
00260
00261     case 0x8014:
00262       _tcscpy( szEventStr, _T("MMCN_RENAME             ") );
00263       break;
00264
00265     case 0x8015:
00266       _tcscpy( szEventStr, _T("MMCN_SELECT             ") );
00267       break;
00268
00269     case 0x8016:
00270       _tcscpy( szEventStr, _T("MMCN_SHOW               ") );
00271       break;
00272
00273     case 0x8017:
00274       _tcscpy( szEventStr, _T("MMCN_VIEW_CHANGE        ") );
00275       break;
00276
00277     case 0x8018:
00278       _tcscpy( szEventStr, _T("MMCN_SNAPINHELP         ") );
00279       break;
00280
00281     case 0x8019:
00282       _tcscpy( szEventStr, _T("MMCN_CONTEXTHELP        ") );
00283       break;
00284
00285     case 0x801A:
00286       _tcscpy( szEventStr, _T("MMCN_INITOCX            ") );
00287       break;
00288
00289     // MMC Version 1.1 notifications
00290     case 0x801B:
00291       _tcscpy( szEventStr, _T("MMCN_FILTER_CHANGE      ") );
00292       break;
00293
00294     case 0x801C:
00295       _tcscpy( szEventStr, _T("MMCN_FILTERBTN_CLICK    ") );
00296       break;
00297
00298     case 0x801D:
00299       _tcscpy( szEventStr, _T("MMCN_RESTORE_VIEW       ") );
00300       break;
00301
00302     case 0x801E:
00303       _tcscpy( szEventStr, _T("MMCN_PRINT              ") );
00304       break;
00305
00306     case 0x801F:
00307       _tcscpy( szEventStr, _T("MMCN_PRELOAD            ") );
00308       break;
00309
00310     case 0x8020:
00311       _tcscpy( szEventStr, _T("MMCN_LISTPAD            ") );
00312       break;
00313
00314     case 0x8021:
00315       _tcscpy( szEventStr, _T("MMCN_EXPANDSYNC         ") );
00316       break;
00317
00318     // MMC Version 1.2 notifications
00319     case 0x8022:
00320       _tcscpy( szEventStr, _T("MMCN_COLUMNS_CHANGED    ") );
00321       break;
00322
00323     // MMC Version 2.0 notifications
00324     case 0x8023:
00325       _tcscpy( szEventStr, _T("MMCN_CANPASTE_OUTOFPROC ") );
00326       break;
00327
00328     default:
00329       _stprintf( szEventStr, _T("0x%X"), Event );
00330       break;
00331   }
00332
00333 #endif
00334 } //end MapEvent()
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBoxFormat Member List

This is the complete list of members for CBoxFormat, including all inherited members.
_fontAlias | CBoxFormat |
_fontChar | CBlockFormat |
_fontCode | CBlockFormat |
_fontCtype | CBoxFormat |
_fuFormat | CBlockFormat |
_size | CBlockFormat |
CBlockFormat() | CBlockFormat | [protected]
CBoxFormat(SIZE sizeChar) | CBoxFormat |
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CClusPropList Member List

This is the complete list of members for CClusPropList, including all inherited members.
BIsListEmpty(void) const | CClusPropList | [inline]
BIsListEmpty(void) const | CClusPropList | [inline]
BIsListEmpty(void) const | CClusPropList | [inline]
CbBufferSize(void) const | CClusPropList | [inline]
CbBufferSize(void) const | CClusPropList | [inline]
CbBufferSize(void) const | CClusPropList | [inline]
CbCurrentValueLength(void) const | CClusPropList | [inline]
CbCurrentValueLength(void) const | CClusPropList | [inline]
CbCurrentValueLength(void) const | CClusPropList | [inline]
CbDataLeft(void) const | CClusPropList | [inline]
CbDataLeft(void) const | CClusPropList | [inline]
CbDataLeft(void) const | CClusPropList | [inline]
CbhCurrentPropertyName(void) | CClusPropList | [inline]
CbhCurrentPropertyName(void) | CClusPropList | [inline]
CbhCurrentPropertyName(void) | CClusPropList | [inline]
CbhCurrentValue(void) | CClusPropList | [inline]
CbhCurrentValue(void) | CClusPropList | [inline]
CbhCurrentValue(void) | CClusPropList | [inline]
CbhCurrentValueList(void) | CClusPropList | [inline]
CbhCurrentValueList(void) | CClusPropList | [inline]
CbhCurrentValueList(void) | CClusPropList | [inline]
CbhPropList(void) const | CClusPropList | [inline]
CbhPropList(void) const | CClusPropList | [inline]
CbhPropList(void) const | CClusPropList | [inline]
CbPropList(void) const | CClusPropList | [inline]
CbPropList(void) const | CClusPropList | [inline]
CbPropList(void) const | CClusPropList | [inline]
CClusPropList(BOOL bAlwaysAddPropIn=FALSE) | CClusPropList | [inline]
CClusPropList(BOOL bAlwaysAddPropIn=FALSE) | CClusPropList | [inline]
CClusPropList(BOOL bAlwaysAddPropIn=FALSE) | CClusPropList | [inline]
ClearPropList(void) | CClusPropList | [inline]
ClearPropList(void) | CClusPropList | [inline]
ClearPropList(void) | CClusPropList | [inline]
CopyEmptyProp(PCLUSPROP_VALUE ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, CLUSTER_PROPERTY_FORMAT propFormatIn) | CClusPropList | [protected]
CopyEmptyProp(PCLUSPROP_VALUE ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, CLUSTER_PROPERTY_FORMAT propFormatIn) | CClusPropList | [protected]
CopyEmptyProp(PCLUSPROP_VALUE ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, CLUSTER_PROPERTY_FORMAT propFormatIn) | CClusPropList | [protected]
CopyExpandSzProp(PCLUSPROP_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyExpandSzProp(PCLUSPROP_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyExpandSzProp(PCLUSPROP_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyMultiSzProp(PCLUSPROP_MULTI_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyMultiSzProp(PCLUSPROP_MULTI_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyMultiSzProp(PCLUSPROP_MULTI_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyProp(PCLUSPROP_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyProp(PCLUSPROP_DWORD ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, DWORD nValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_LONG ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONG nValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_ULARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, ULONGLONG ullValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_LARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONGLONG llValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_ULARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONGLONG llValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_BINARY ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, const unsigned char *pbValueIn, size_t cbValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyProp(PCLUSPROP_DWORD ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, DWORD nValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_LONG ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONG nValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_ULARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, ULONGLONG ullValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_LARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONGLONG llValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_ULARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONGLONG llValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_BINARY ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, const unsigned char *pbValueIn, size_t cbValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_SZ ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LPCWSTR pszIn, size_t cbszIn=0) | CClusPropList | [protected]
CopyProp(PCLUSPROP_DWORD ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, DWORD nValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_LONG ppropIn, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONG nValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_ULARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, ULONGLONG ullValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_LARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONGLONG llValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_ULARGE_INTEGER ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, LONGLONG llValueIn) | CClusPropList | [protected]
CopyProp(PCLUSPROP_BINARY ppropOut, CLUSTER_PROPERTY_TYPE cptPropTypeIn, const unsigned char *pbValueIn, size_t cbValueIn) | CClusPropList | [protected]
CpfCurrentValueFormat(void) const | CClusPropList | [inline]
CpfCurrentValueFormat(void) const | CClusPropList | [inline]
CpfCurrentValueFormat(void) const | CClusPropList | [inline]
Cprops(void) const | CClusPropList | [inline]
Cprops(void) const | CClusPropList | [inline]
Cprops(void) const | CClusPropList | [inline]
CpsCurrentValueSyntax(void) const | CClusPropList | [inline]
CpsCurrentValueSyntax(void) const | CClusPropList | [inline]
CpsCurrentValueSyntax(void) const | CClusPropList | [inline]
CptCurrentValueType(void) const | CClusPropList | [inline]
CptCurrentValueType(void) const | CClusPropList | [inline]
CptCurrentValueType(void) const | CClusPropList | [inline]
DeletePropList(void) | CClusPropList | [inline]
DeletePropList(void) | CClusPropList | [inline]
DeletePropList(void) | CClusPropList | [inline]
InitSize(size_t cbSizeIn) | CClusPropList | [inline]
InitSize(size_t cbSizeIn) | CClusPropList | [inline]
InitSize(size_t cbSizeIn) | CClusPropList | [inline]
m_cbBufferSize | CClusPropList | [protected]
m_cbDataLeft | CClusPropList | [protected]
m_cbDataSize | CClusPropList | [protected]
m_cbhCurrentProp | CClusPropList | [protected]
m_cbhCurrentPropName | CClusPropList | [private]
m_cbhPropList | CClusPropList | [protected]
m_fAlwaysAddProp | CClusPropList | [protected]
m_nPropsRemaining | CClusPropList | [private]
m_pvlValues | CClusPropList | [private]
operator PCLUSPROP_LIST(void) const | CClusPropList | [inline]
operator PCLUSPROP_LIST(void) const | CClusPropList | [inline]
operator PCLUSPROP_LIST(void) const | CClusPropList | [inline]
PbPropList(void) const | CClusPropList | [inline]
PbPropList(void) const | CClusPropList | [inline]
PbPropList(void) const | CClusPropList | [inline]
Plist(void) | CClusPropList | [inline]
Plist(void) | CClusPropList | [inline]
Plist(void) | CClusPropList | [inline]
PszCurrentPropertyName(void) const | CClusPropList | [inline]
PszCurrentPropertyName(void) const | CClusPropList | [inline]
PszCurrentPropertyName(void) const | CClusPropList | [inline]
RPvlPropertyValue(void) | CClusPropList | [inline]
RPvlPropertyValue(void) | CClusPropList | [inline]
RPvlPropertyValue(void) | CClusPropList | [inline]
ScAddExpandSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddExpandSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn) | CClusPropList | [inline]
ScAddExpandSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddExpandSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn) | CClusPropList | [inline]
ScAddExpandSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddExpandSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn) | CClusPropList | [inline]
ScAddMultiSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddMultiSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddMultiSzProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, DWORD nValueIn, DWORD nPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LONG nValueIn, LONG nPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, ULONGLONG ullValueIn, ULONGLONG ullPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LONGLONG llValueIn, LONGLONG llPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, const unsigned char *pbValueIn, size_t cbValueIn, const unsigned char *pbPrevValueIn, size_t cbPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn) | CClusPropList | [inline]
ScAddProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, DWORD nValueIn, DWORD nPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LONG nValueIn, LONG nPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, ULONGLONG ullValueIn, ULONGLONG ullPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LONGLONG llValueIn, LONGLONG llPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, const unsigned char *pbValueIn, size_t cbValueIn, const unsigned char *pbPrevValueIn, size_t cbPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn) | CClusPropList | [inline]
ScAddProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, DWORD nValueIn, DWORD nPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LONG nValueIn, LONG nPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, ULONGLONG ullValueIn, ULONGLONG ullPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LONGLONG llValueIn, LONGLONG llPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, const unsigned char *pbValueIn, size_t cbValueIn, const unsigned char *pbPrevValueIn, size_t cbPrevValueIn) | CClusPropList |
ScAddProp(LPCWSTR pwszNameIn, LPCWSTR pwszValueIn) | CClusPropList | [inline]
ScAllocPropList(size_t cbMinimumIn) | CClusPropList |
ScAllocPropList(size_t cbMinimumIn) | CClusPropList |
ScAllocPropList(size_t cbMinimumIn) | CClusPropList |
ScAppend(const CClusPropList &rclPropListIn) | CClusPropList |
ScAppend(const CClusPropList &rclPropListIn) | CClusPropList |
ScAppend(const CClusPropList &rclPropListIn) | CClusPropList |
ScCheckIfAtLastProperty(void) const | CClusPropList | [inline]
ScCheckIfAtLastProperty(void) const | CClusPropList | [inline]
ScCheckIfAtLastProperty(void) const | CClusPropList | [inline]
ScCopy(const PCLUSPROP_LIST pcplPropListIn, size_t cbListSizeIn) | CClusPropList |
ScCopy(const PCLUSPROP_LIST pcplPropListIn, size_t cbListSizeIn) | CClusPropList |
ScCopy(const PCLUSPROP_LIST pcplPropListIn, size_t cbListSizeIn) | CClusPropList |
ScGetClusterProperties(HCLUSTER hClusterIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetClusterProperties(HCLUSTER hClusterIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetClusterProperties(HCLUSTER hClusterIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetGroupProperties(HGROUP hGroupIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetGroupProperties(HGROUP hGroupIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetGroupProperties(HGROUP hGroupIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNetInterfaceProperties(HNETINTERFACE hNetInterfaceIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNetInterfaceProperties(HNETINTERFACE hNetInterfaceIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNetInterfaceProperties(HNETINTERFACE hNetInterfaceIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNetworkProperties(HNETWORK hNetworkIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNetworkProperties(HNETWORK hNetworkIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNetworkProperties(HNETWORK hNetworkIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNodeProperties(HNODE hNodeIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNodeProperties(HNODE hNodeIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetNodeProperties(HNODE hNodeIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetResourceProperties(HRESOURCE hResourceIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetResourceProperties(HRESOURCE hResourceIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetResourceProperties(HRESOURCE hResourceIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetResourceTypeProperties(HCLUSTER hClusterIn, LPCWSTR pwszResTypeNameIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetResourceTypeProperties(HCLUSTER hClusterIn, LPCWSTR pwszResTypeNameIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScGetResourceTypeProperties(HCLUSTER hClusterIn, LPCWSTR pwszResTypeNameIn, DWORD dwControlCodeIn, HNODE hHostNodeIn=NULL, LPVOID lpBufferIn=NULL, size_t cbBufferIn=0) | CClusPropList |
ScMoveToFirstProperty(void) | CClusPropList |
ScMoveToFirstProperty(void) | CClusPropList |
ScMoveToFirstProperty(void) | CClusPropList |
ScMoveToFirstPropertyValue(void) | CClusPropList | [inline]
ScMoveToFirstPropertyValue(void) | CClusPropList | [inline]
ScMoveToFirstPropertyValue(void) | CClusPropList | [inline]
ScMoveToNextProperty(void) | CClusPropList |
ScMoveToNextProperty(void) | CClusPropList |
ScMoveToNextProperty(void) | CClusPropList |
ScMoveToNextPropertyValue(void) | CClusPropList | [inline]
ScMoveToNextPropertyValue(void) | CClusPropList | [inline]
ScMoveToNextPropertyValue(void) | CClusPropList | [inline]
ScMoveToPropertyByName(LPCWSTR pwszPropNameIn) | CClusPropList |
ScMoveToPropertyByName(LPCWSTR pwszPropNameIn) | CClusPropList |
ScMoveToPropertyByName(LPCWSTR pwszPropNameIn) | CClusPropList |
ScSetPropToDefault(LPCWSTR pwszNameIn, CLUSTER_PROPERTY_FORMAT propFormatIn) | CClusPropList |
ScSetPropToDefault(LPCWSTR pwszNameIn, CLUSTER_PROPERTY_FORMAT propFormatIn) | CClusPropList |
ScSetPropToDefault(LPCWSTR pwszNameIn, CLUSTER_PROPERTY_FORMAT propFormatIn) | CClusPropList |
~CClusPropList(void) | CClusPropList | [inline]
~CClusPropList(void) | CClusPropList | [inline]
~CClusPropList(void) | CClusPropList | [inline]
Generated on Wed Nov 13 2024 16:55:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/FileTerm/FileTerm.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • FileTerm

FileTerm.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //
00004 //  Copyright (c) 1998-2001  Microsoft Corporation
00005 //
00006 //
00007 //  Fileterm.cpp
00008 //
00009 // Sample application that handles incoming TAPI calls
00010 // and uses the file terminals to perform the
00011 // functions of a simple answering machine.
00012 //
00013 // This sample was adapted from the ANSMACH sample.
00014 //
00015 // In order to receive incoming calls, the application must
00016 // implement and register the outgoing ITCallNotification
00017 // interface.
00018 //
00019 // This application will register to receive calls on
00020 // all addresses that support at least the audio media type.
00021 //
00022 // NOTES:
00023 // 1. This application is limited to work with one
00024 //    call at a time - all other calls will be rejected
00025 // 2. This works for half-duplex modems and voice boards with the
00026 //    wave MSP, as well as IP telephony with the H.323 MSP.
00027 //
00028 //////////////////////////////////////////////////////////////////////
00029 #include <windows.h>
00030 #include <tchar.h>
00031 #include <tapi3.h>
00032
00033 #include "FileTerm.h"
00034 #include "callnot.h"
00035 #include "resource.h"
00036
00037 //////////////////////////////////////////////////////////
00038 //    GLOBALS
00039 //////////////////////////////////////////////////////////
00040
00041 //
00042 // Application dialog window handle
00043 //
00044 HWND                    g_hDlg = NULL;
00045
00046 //
00047 // TAPI object, Call Object
00048 //
00049 ITTAPI *                g_pTapi = NULL;
00050 ITBasicCallControl *    g_pCall = NULL;
00051
00052 //
00053 // File Terminals
00054 //
00055 ITTerminal              *g_pPlayFileTerm = NULL;
00056 ITTerminal        *g_pRecordFileTerm = NULL;
00057
00058 //
00059 // Connection point cookie
00060 //
00061 ULONG                   g_ulAdvise = 0;
00062
00063 //////////////////////////////////////////////////////////
00064 //
00065 //    FUNCTIONS
00066 //
00067 //////////////////////////////////////////////////////////
00068
00069 //////////////////////////////////////////////////////////
00070 // wWinMain - UNICODE application
00071 //////////////////////////////////////////////////////////
00072 int
00073 WINAPI
00074 WinMain(
00075         HINSTANCE hInst,
00076         HINSTANCE hPrevInst,
00077         LPSTR lpCmdLine,
00078         int nCmdShow
00079        )
00080 {
00081   //
00082   // need to coinitialize
00083   //
00084     if (!SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED)))
00085     {
00086         return 0;
00087     }
00088
00089   //
00090   // do all tapi initialization
00091   //
00092     if (S_OK == InitializeTapi())
00093     {
00094     //
00095     // everything is initialized, so start the main dialog box
00096     //
00097     DialogBox(
00098           hInst,
00099           MAKEINTRESOURCE(IDD_MAINDLG),
00100           NULL,
00101           MainDialogProc
00102          );
00103   }
00104
00105     //
00106     // When EndDialog is called, we get here; clean up and exit.
00107     //
00108
00109     CoUninitialize();
00110
00111     return 1;
00112 }
00113
00114
00115 //////////////////////////////////////////////////////////////
00116 // InitializeTapi
00117 //
00118 // Create TAPI object, register callback object,
00119 // register addresses for call notifications
00120 //
00121 ///////////////////////////////////////////////////////////////
00122 HRESULT
00123 InitializeTapi()
00124 {
00125     HRESULT         hr;
00126
00127     //
00128   // cocreate the TAPI object
00129   //
00130     hr = CoCreateInstance(
00131                           CLSID_TAPI,
00132                           NULL,
00133                           CLSCTX_INPROC_SERVER,
00134                           IID_ITTAPI,
00135                           (LPVOID *)&g_pTapi
00136                          );
00137
00138     if (FAILED(hr))
00139     {
00140         DoMessage(_T("InitializeTapi: CoCreateInstance on TAPI failed"));
00141         return hr;
00142     }
00143
00144     //
00145   // call initialize.  this must be called before any other tapi functions are called.
00146   //
00147     hr = g_pTapi->Initialize();
00148
00149     if (FAILED(hr))
00150     {
00151         g_pTapi->Release();
00152         g_pTapi = NULL;
00153         DoMessage(_T("InitializeTapi: TAPI failed to initialize"));
00154         return hr;
00155     }
00156
00157   //
00158   //register event callback object
00159   //
00160     hr = RegisterTapiEventInterface();
00161     if (FAILED(hr))
00162   {
00163         //
00164         // shutdown and release TAPI
00165         //
00166         g_pTapi->Shutdown();
00167         g_pTapi->Release();
00168         g_pTapi = NULL;
00169         DoMessage(_T("InitializeTapi: RegisterTapiEventInterface failed"));
00170         return hr;
00171   }
00172
00173     //
00174   // put the Event filter to only give us only the events we process
00175   //
00176     hr = g_pTapi->put_EventFilter(TE_CALLNOTIFICATION | TE_CALLSTATE | TE_CALLMEDIA | TE_FILETERMINAL);
00177     if (FAILED(hr))
00178   {
00179         //
00180         // unregister callback
00181         //
00182     UnRegisterTapiEventInterface();
00183         //
00184         // shutdown and release TAPI
00185         //
00186         g_pTapi->Shutdown();
00187         g_pTapi->Release();
00188         g_pTapi = NULL;
00189         DoMessage(_T("InitializeTapi: put_EventFilter failed"));
00190         return hr;
00191   }
00192
00193
00194     // find all address objects that
00195     // we will use to listen for calls on
00196     hr = ListenOnAddresses();
00197
00198     if (FAILED(hr))
00199     {
00200         //
00201         // unregister callback
00202         //
00203     UnRegisterTapiEventInterface();
00204         //
00205         // shutdown and release TAPI
00206         //
00207         g_pTapi->Shutdown();
00208         g_pTapi->Release();
00209         g_pTapi = NULL;
00210         DoMessage(_T("InitializeTapi: ListenOnAddresses failed"));
00211     }
00212
00213     return hr;
00214
00215 }
00216
00217
00218 ///////////////////////////////////////////////////////////////
00219 // ShutdownTapi
00220 //
00221 // Called when application exits
00222 // Disconnects the call and releases all internal objects
00223 //
00224 ///////////////////////////////////////////////////////////////
00225 void
00226 ShutdownTapi()
00227 {
00228     //
00229     // unregister callback
00230     //
00231   UnRegisterTapiEventInterface();
00232     //
00233     // if there is still a call, disconnect and release it
00234     //
00235     DisconnectTheCall();
00236   //
00237   //
00238   //
00239     ReleaseTheCall();
00240   //
00241   //wait for TAPI to cool off (2 sec. may be too short)
00242   //maybe there was an event sent by PostMessage but not processed yet
00243     //
00244   {
00245     //
00246     //we need an event for MsgWaitForMultipleObjectsEx
00247     //
00248     HANDLE hDumbEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
00249     while(NULL != hDumbEvent)
00250     {
00251
00252       DWORD dwStatus;
00253       MSG msg;
00254
00255       dwStatus=::MsgWaitForMultipleObjectsEx(1,
00256                     &hDumbEvent,
00257                     TAPI_TIMEOUT,
00258                     QS_ALLPOSTMESSAGE,
00259                     MWMO_ALERTABLE);
00260       if(dwStatus != WAIT_TIMEOUT)
00261       {
00262         while(TRUE == ::PeekMessage(&msg,
00263             g_hDlg,//only from post thread
00264             NULL,
00265             NULL,
00266             PM_REMOVE))
00267         {
00268           //
00269           //if not TAPI event translate and dispatch it
00270           //
00271           if(msg.message != WM_PRIVATETAPIEVENT)
00272           {
00273             ::TranslateMessage(&msg);
00274             ::DispatchMessage(&msg);
00275           }
00276           //
00277           //TAPI event
00278           //
00279           else
00280           {
00281             if((IDispatch *) msg.lParam != NULL)
00282             {
00283               //release the event
00284               ((IDispatch *) msg.lParam)->Release();
00285               msg.lParam = NULL;
00286             }
00287           }
00288         }
00289       }
00290       else
00291       {
00292         ::CloseHandle(hDumbEvent);
00293         hDumbEvent = NULL;
00294       }
00295     }
00296   }
00297     //
00298     // release main TAPI object.
00299     //
00300
00301     if (NULL != g_pTapi)
00302     {
00303         g_pTapi->Shutdown();
00304         g_pTapi->Release();
00305     g_pTapi = NULL;
00306
00307     }
00308 }
00309
00310
00311 ///////////////////////////////////////////////////////////////////////////
00312 // MainDlgProc
00313 //
00314 // Process dialog messages
00315 //
00316 ///////////////////////////////////////////////////////////////////////////
00317 INT_PTR
00318 CALLBACK
00319 MainDialogProc(
00320                HWND hDlg,
00321                UINT uMsg,
00322                WPARAM wParam,
00323                LPARAM lParam
00324               )
00325 {
00326     switch (uMsg)
00327     {
00328         case WM_PRIVATETAPIEVENT:
00329         {
00330       //
00331       //Process TAPI event
00332       //
00333           OnTapiEvent(
00334                         (TAPI_EVENT) wParam,
00335                         (IDispatch *) lParam
00336                        );
00337
00338             return 0;
00339         }
00340
00341         case WM_INITDIALOG:
00342         {
00343             //
00344       // store dialog window handle
00345       //
00346             g_hDlg = hDlg;
00347
00348             SetStatusMessage( _T("Waiting for a call..."));
00349
00350             return 0;
00351         }
00352
00353         case WM_COMMAND:
00354         {
00355             if ( LOWORD(wParam) == IDCANCEL )
00356             {
00357
00358         ShutdownTapi();
00359                 //
00360                 // quit
00361                 //
00362                 EndDialog( hDlg, 0 );
00363
00364                 return 1;
00365             }
00366
00367             switch ( LOWORD(wParam) )
00368             {
00369                 //
00370         // offering notification
00371         //
00372                 case IDC_ANSWER:
00373                 {
00374                     SetStatusMessage(_T("Answering..."));
00375                     // answer the call
00376                     if ( S_OK == AnswerTheCall() )
00377                     {
00378                         SetStatusMessage(_T("Connecting..."));
00379                     }
00380                     else
00381                     {
00382                         DoMessage(_T("Answer failed"));
00383                         SetStatusMessage(_T("Waiting for a call..."));
00384                     }
00385
00386                     return 1;
00387                 }
00388
00389                 //
00390         // connect notification
00391         //
00392                 case IDC_CONNECTED:
00393                 {
00394                     SetStatusMessage(_T("Connected; waiting for file playback terminal to run..."));
00395
00396                     return 1;
00397                 }
00398
00399                 //
00400         // disconnected notification
00401         //
00402                 case IDC_DISCONNECTED:
00403                 {
00404                     //
00405           // release internal call objetcs
00406           //
00407                     ReleaseTheCall();
00408
00409                     SetStatusMessage(_T("Waiting for a call..."));
00410
00411                     return 1;
00412                 }
00413                 default:
00414
00415                     return 0;
00416             }
00417         }
00418         case WM_TIMER:
00419         {
00420       //
00421       //disconnect the call when maximum record time is reached
00422       //it will unselect the terminal too
00423       //
00424             if ( g_pCall != NULL )
00425             {
00426                 SetStatusMessage(_T("Disconnecting..."));
00427
00428                 //
00429         // disconnect the call
00430         //
00431                 if (S_OK != DisconnectTheCall())
00432                 {
00433                     DoMessage(_T("Disconnect failed"));
00434                 }
00435             }
00436
00437             return 1;
00438         }
00439         default:
00440
00441             return 0;
00442     }
00443 }
00444
00445
00446 ///////////////////////////////////////////////////////////////////////////////
00447 //
00448 // RegisterTapiEventInterface
00449 //
00450 // register call notification object used to receive events
00451 // fired by TAPI object
00452 //
00453 // The event notification interface is registered with TAPI 3.1
00454 // through the IConnectionPoint mechanism.
00455 // For more information on IConnectionPoint, and IConnectiontPointContainer
00456 // please refer to the COM documentation.
00457 //
00458 ///////////////////////////////////////////////////////////////////////////////
00459 HRESULT
00460 RegisterTapiEventInterface()
00461 {
00462     HRESULT                       hr = S_OK;
00463     IConnectionPointContainer   * pCPC = NULL;
00464     IConnectionPoint            * pCP = NULL;
00465
00466
00467
00468     hr = g_pTapi->QueryInterface(
00469                                 IID_IConnectionPointContainer,
00470                                 (void **)&pCPC
00471                                );
00472
00473     if (!SUCCEEDED(hr))
00474     {
00475         DoMessage(_T("RegisterTapiEventInterface: ")
00476                  _T("Failed to get IConnectionPointContainer on TAPI"));
00477         return hr;
00478     }
00479
00480     hr = pCPC->FindConnectionPoint(
00481                                    IID_ITTAPIEventNotification,
00482                                    &pCP
00483                                   );
00484     pCPC->Release();
00485
00486     if (!SUCCEEDED(hr))
00487     {
00488         DoMessage(_T("RegisterTapiEventInterface: Failed to get a connection point for ")
00489                  _T("ITTAPIEventNotification"));
00490         return hr;
00491     }
00492
00493
00494   //
00495   //create event callback object
00496   //
00497     CTAPIEventNotification* pTAPIEventNotification = new CTAPIEventNotification;
00498   if(NULL == pTAPIEventNotification)
00499   {
00500         DoMessage(_T("RegisterTapiEventInterface: Could not create CTAPIEventNotification"));
00501         return E_OUTOFMEMORY;
00502   }
00503   //
00504   //advise the callback object - it will be released by Unadvise
00505   //
00506     hr = pCP->Advise(
00507                       pTAPIEventNotification,
00508                       &g_ulAdvise
00509                      );
00510
00511     pCP->Release();
00512     //
00513     // whether Advise failed or succeeded - Advise already addrefed the object,
00514   // we no longer need a reference to the callback object
00515     //
00516     pTAPIEventNotification->Release();
00517     pTAPIEventNotification = NULL;
00518
00519     if (FAILED(hr))
00520   {
00521         DoMessage(_T("RegisterTapiEventInterface: Advise failed"));
00522   }
00523
00524
00525     return hr;
00526
00527 }
00528
00529
00530
00531 ///////////////////////////////////////////////////////////////////////////////
00532 //
00533 // UnRegisterTapiEventInterface
00534 //
00535 // Unadvise call notification object.
00536 //
00537 // The event notification interface was registered with TAPI 3.1
00538 // through the IConnectionPoint mechanism.
00539 // For more information on IConnectionPoint, and IConnectiontPointContainer
00540 // please refer to the COM documentation.
00541 //
00542 ///////////////////////////////////////////////////////////////////////////////
00543
00544 HRESULT UnRegisterTapiEventInterface()
00545 {
00546     HRESULT hr = S_OK;
00547     IConnectionPointContainer *pCPC = NULL;
00548     IConnectionPoint *pCP = NULL;
00549
00550     //
00551     // get connection point container on the tapi object
00552     //
00553
00554     hr = g_pTapi->QueryInterface(IID_IConnectionPointContainer,
00555                                 (void **)&pCPC);
00556
00557     if (FAILED(hr))
00558     {
00559         DoMessage(_T("UnRegisterTapiEventInterface: ")
00560                  _T("Failed to get IConnectionPointContainer on TAPI"));
00561         return hr;
00562     }
00563
00564
00565     //
00566     // find connection point for our interface
00567     //
00568
00569
00570     hr = pCPC->FindConnectionPoint(IID_ITTAPIEventNotification,
00571                                            &pCP);
00572
00573     pCPC->Release();
00574     pCPC = NULL;
00575
00576     if (FAILED(hr))
00577     {
00578         DoMessage(_T("UnRegisterTapiEventInterface: Failed to get a connection point for ")
00579                  _T("ITTAPIEventNotification"));
00580
00581         return hr;
00582     }
00583
00584
00585     //
00586     // unregister the callback
00587     //
00588
00589     hr = pCP->Unadvise(g_ulAdvise);
00590
00591     pCP->Release();
00592     pCP = NULL;
00593
00594     g_ulAdvise = 0;
00595
00596     if (FAILED(hr))
00597   {
00598         DoMessage(_T("UnRegisterTapiEventInterface: Unadvise failed"));
00599   }
00600
00601     return hr;
00602 }
00603
00604
00605 ////////////////////////////////////////////////////////////////////////
00606 // ListenOnAddresses
00607 //
00608 // This function will find all addresses that support audio in and audio out
00609 // and will call ListenOnThisAddress to start listening on it.
00610 ////////////////////////////////////////////////////////////////////////
00611
00612 HRESULT
00613 ListenOnAddresses()
00614 {
00615     HRESULT             hr = S_OK;
00616     IEnumAddress *      pEnumAddress = NULL;
00617     ITAddress *         pAddress = NULL;
00618     ITMediaSupport *    pMediaSupport = NULL;
00619     VARIANT_BOOL        bSupport = VARIANT_FALSE;
00620   BOOL        bAddressFound = FALSE;
00621
00622     // enumerate the addresses
00623     hr = g_pTapi->EnumerateAddresses( &pEnumAddress );
00624
00625     if (FAILED(hr))
00626     {
00627         DoMessage(_T("ListenOnAddresses: EnumerateAddresses failed"));
00628         return hr;
00629     }
00630
00631   //
00632   // loop for all addresses
00633   //
00634
00635     while ( S_OK == pEnumAddress->Next( 1, &pAddress, NULL ) )
00636     {
00637
00638         hr = pAddress->QueryInterface( IID_ITMediaSupport, (void **)&pMediaSupport );
00639     if(FAILED(hr))
00640     {
00641           pAddress->Release();
00642       continue;
00643     }
00644
00645     //
00646         // does it support Audio
00647     //
00648         hr = pMediaSupport->QueryMediaType(
00649                                       TAPIMEDIATYPE_AUDIO,
00650                                       &bSupport
00651                                      );
00652
00653         pMediaSupport->Release();
00654
00655     if(FAILED(hr))
00656     {
00657           pAddress->Release();
00658       continue;
00659     }
00660
00661         if (bSupport)
00662         {
00663             //
00664       // If it does support then we'll listen.
00665       //
00666             hr = ListenOnThisAddress( pAddress );
00667             if (SUCCEEDED(hr))
00668             {
00669                 bAddressFound = TRUE;
00670             }
00671         }
00672         pAddress->Release();
00673     }
00674
00675   //
00676   //clean up
00677   //
00678
00679     pEnumAddress->Release();
00680
00681   if(!bAddressFound)
00682   {
00683         DoMessage(_T("ListenOnAddresses: not address found"));
00684     return E_FAIL;
00685   }
00686   else
00687   {
00688     return S_OK;
00689   }
00690
00691 }
00692
00693
00694 ///////////////////////////////////////////////////////////////////
00695 // ListenOnThisAddress
00696 //
00697 // We call RegisterCallNotifications to inform TAPI that we want
00698 // notifications of calls on this address. We already resistered
00699 // our notification interface with TAPI, so now we are just telling
00700 // TAPI that we want calls from this address to trigger events on
00701 // our existing notification interface.
00702 //
00703 ///////////////////////////////////////////////////////////////////
00704
00705 HRESULT
00706 ListenOnThisAddress(
00707           IN ITAddress * pAddress)
00708 {
00709
00710     //
00711     // RegisterCallNotifications takes a media type bitmap indicating
00712     // the set of media types we are interested in. We know the
00713     // address supports audio.
00714     //
00715
00716
00717     long     lRegister = 0;
00718
00719     return g_pTapi->RegisterCallNotifications(
00720                                            pAddress,
00721                                            VARIANT_FALSE,
00722                                            VARIANT_TRUE,
00723                                            TAPIMEDIATYPE_AUDIO,
00724                                            0,
00725                                            &lRegister
00726                                           );
00727
00728 }
00729
00730
00731 /////////////////////////////////////////////////////////////////////
00732 //
00733 // Answers the call
00734 // It will create and select the Playback terminal
00735 //
00736 /////////////////////////////////////////////////////////////////////
00737
00738 HRESULT
00739 AnswerTheCall()
00740 {
00741
00742   //
00743   // check if call available
00744   //
00745     if (NULL == g_pCall)
00746     {
00747         DoMessage( _T("AnswerTheCall: call not available"));
00748         return E_UNEXPECTED;
00749     }
00750
00751   //
00752   // it should not happen, but if you have already the terminal release it
00753   //
00754     if(NULL != g_pPlayFileTerm)
00755   {
00756     g_pPlayFileTerm->Release();
00757     g_pPlayFileTerm = NULL;
00758   }
00759
00760     //
00761   // prepare to request the terminal - need ITBasicCallControl2 interface
00762   //
00763     ITBasicCallControl2*    pITBCC2 = NULL;
00764     HRESULT hr = g_pCall->QueryInterface( IID_ITBasicCallControl2, (void**)&pITBCC2 );
00765   if(FAILED(hr))
00766   {
00767         DoMessage( _T("AnswerTheCall: QI ITBasicCallControl2 failed"));
00768         g_pCall->Disconnect(DC_NORMAL);
00769     return hr;
00770   }
00771
00772     //
00773   // prepare to request the terminal - need CLSID BSTR
00774   //
00775   BSTR bstrCLSID = NULL;
00776   hr = StringFromCLSID(CLSID_FilePlaybackTerminal, &bstrCLSID);
00777   if(FAILED(hr))
00778   {
00779     pITBCC2->Release();
00780         DoMessage( _T("AnswerTheCall: StringFromCLSID failed"));
00781         g_pCall->Disconnect(DC_NORMAL);
00782     return hr;
00783   }
00784
00785   //
00786   //request the terminal using right media type and direction
00787   //
00788   hr = pITBCC2->RequestTerminal(bstrCLSID,
00789                   TAPIMEDIATYPE_AUDIO,
00790                   TD_CAPTURE,
00791                   &g_pPlayFileTerm);
00792   //
00793   //clean up
00794   //
00795   ::CoTaskMemFree(bstrCLSID);
00796
00797   if(FAILED(hr))
00798   {
00799     pITBCC2->Release();
00800         DoMessage( _T("AnswerTheCall: RequestTerminal failed"));
00801         g_pCall->Disconnect(DC_NORMAL);
00802     return hr;
00803   }
00804
00805   //
00806   // prepare to put the file name
00807   //
00808   BSTR bstrFileName = ::SysAllocString(PLAY_FILENAME);
00809
00810   if(NULL == bstrFileName)
00811   {
00812     g_pPlayFileTerm->Release();
00813     g_pPlayFileTerm = NULL;
00814     pITBCC2->Release();
00815         DoMessage( _T("AnswerTheCall: SysAllocString for play list failed"));
00816         g_pCall->Disconnect(DC_NORMAL);
00817     return E_OUTOFMEMORY;
00818   }
00819
00820   //
00821   // call helper method for put_PlayList
00822   //
00823   hr = PutPlayList(g_pPlayFileTerm, bstrFileName);
00824
00825   //
00826   // free the file name
00827   //
00828   ::SysFreeString(bstrFileName);
00829
00830   if(FAILED(hr))
00831   {
00832     g_pPlayFileTerm->Release();
00833     g_pPlayFileTerm = NULL;
00834     pITBCC2->Release();
00835     DoMessage( _T("AnswerTheCall: PutPlayList failed"));
00836     g_pCall->Disconnect(DC_NORMAL);
00837     return hr;
00838   }
00839
00840   //
00841   //select the terminal using ITBasicCallControl2 method
00842   //
00843   hr = pITBCC2->SelectTerminalOnCall(g_pPlayFileTerm);
00844   if(FAILED(hr))
00845   {
00846     g_pPlayFileTerm->Release();
00847     g_pPlayFileTerm = NULL;
00848     pITBCC2->Release();
00849         DoMessage( _T("AnswerTheCall: SelectTerminalOnCall failed"));
00850         g_pCall->Disconnect(DC_NORMAL);
00851     return hr;
00852   }
00853
00854   //
00855   //finally answer the call
00856   //
00857     hr = g_pCall->Answer();
00858   if(FAILED(hr))
00859   {
00860     g_pPlayFileTerm->Release();
00861     g_pPlayFileTerm = NULL;
00862     pITBCC2->Release();
00863         DoMessage( _T("AnswerTheCall: Answer failed"));
00864         g_pCall->Disconnect(DC_NORMAL);
00865     return hr;
00866   }
00867
00868   //
00869   //if we are here we are OK
00870   //
00871   pITBCC2->Release();
00872     return S_OK;
00873 }
00874
00875 //////////////////////////////////////////////////////////////////////
00876 // DisconnectTheCall
00877 //
00878 // Disconnects the call - the objects will be released when
00879 // processing disconnect notification
00880 //
00881 //////////////////////////////////////////////////////////////////////
00882
00883 HRESULT
00884 DisconnectTheCall()
00885 {
00886   //
00887   //disconnect the call
00888   //
00889     if (NULL != g_pCall)
00890     {
00891     //
00892     // we will release the call and terminals on disconnected notification.
00893     //
00894         return g_pCall->Disconnect( DC_NORMAL );
00895
00896     }
00897
00898     return E_FAIL;
00899 }
00900
00901 //////////////////////////////////////////////////////////////////////
00902 // ReleaseTheCall
00903 //
00904 // Releases the objects used for call processing
00905 //
00906 //////////////////////////////////////////////////////////////////////
00907
00908 void
00909 ReleaseTheCall()
00910 {
00911   //
00912   //do not the timer anymore anymore
00913   //
00914   KillTimer(g_hDlg, TIMER_ID);
00915
00916   //
00917   //release the terminals
00918   //
00919   if(NULL != g_pPlayFileTerm)
00920   {
00921     g_pPlayFileTerm->Release();
00922     g_pPlayFileTerm = NULL;
00923   }
00924   if(NULL != g_pRecordFileTerm)
00925   {
00926     g_pRecordFileTerm->Release();
00927     g_pRecordFileTerm = NULL;
00928   }
00929   //
00930   //release the call object - this will unselect all selected terminals
00931   //
00932     if (NULL != g_pCall)
00933     {
00934         g_pCall->Release();
00935         g_pCall = NULL;
00936     }
00937 }
00938
00939
00940 ///////////////////////////////////////////////////////////////////
00941 //
00942 // HELPER FUNCTIONS
00943 //
00944 ///////////////////////////////////////////////////////////////////
00945
00946
00947 ///////////////////////////////////////////////////////////////////
00948 //
00949 // DoMessage - pops up a message box
00950 //
00951 ///////////////////////////////////////////////////////////////////
00952
00953 void
00954 DoMessage(
00955       IN LPWSTR pszMessage)
00956 {
00957     ::MessageBox(
00958                g_hDlg,
00959                pszMessage,
00960                MSGBOX_NAME,
00961                MB_OK
00962               );
00963 }
00964
00965
00966 //////////////////////////////////////////////////////////////////
00967 //
00968 // SetStatusMessage - change the status
00969 //
00970 //////////////////////////////////////////////////////////////////
00971
00972 void
00973 SetStatusMessage(
00974       IN LPWSTR pszMessage)
00975 {
00976     ::SetDlgItemText(
00977                    g_hDlg,
00978                    IDC_STATUS,
00979                    pszMessage
00980                   );
00981 }
00982
00983 //////////////////////////////////////////////////////////////////
00984 //
00985 // PutPlayList - prepare the variant for put_PlayList method
00986 // and invoke the method
00987 //
00988 //////////////////////////////////////////////////////////////////
00989
00990 HRESULT PutPlayList(
00991       IN ITTerminal *pITTerminal,
00992       IN BSTR bstrFileName)
00993 {
00994   //
00995   //check if really have a terminal
00996   //
00997   if(NULL == pITTerminal)
00998   {
00999         DoMessage( _T("PutPlayList: playback terminal NULL"));
01000     return E_UNEXPECTED;
01001   }
01002
01003   //
01004     // Get ITMediaPlayback interface - only playback terminal object
01005   // exposes this interface
01006   //
01007     ITMediaPlayback*    pMediaPlayback = NULL;
01008
01009     HRESULT hr = pITTerminal->QueryInterface(
01010                     IID_ITMediaPlayback,
01011                     (void**)&pMediaPlayback);
01012
01013
01014   if(FAILED(hr))
01015   {
01016         DoMessage( _T("PutPlayList: QI ITMediaPlayback failed"));
01017     return hr;
01018   }
01019
01020   //
01021   //VARIANT to be passed to put_PlayList
01022   //
01023   VARIANT varPlaylist;
01024   VariantInit(&varPlaylist);
01025
01026   //
01027   //Prepare SAFEARRAYBOUND for SAFEARRAY
01028   //Put file name into array with one element
01029   //
01030     SAFEARRAYBOUND DimensionBounds;
01031     DimensionBounds.lLbound = 1;
01032
01033   //
01034   //number of files in play list - modify for more files
01035   //
01036     DimensionBounds.cElements = 1;
01037
01038     //
01039   // Put file name into array at index 1 - see lLbound
01040   //
01041     long lArrayPos = 1;
01042
01043   //
01044   //variant that will hold the BSTR - it will be added to SAFEARRAY
01045   //
01046     VARIANT* pvarArrayEntry = new VARIANT;
01047     if( pvarArrayEntry == NULL)
01048     {
01049         DoMessage( _T("PutPlayList: new VARIANT failed"));
01050         return E_OUTOFMEMORY;
01051     }
01052   VariantInit(pvarArrayEntry);
01053
01054     //
01055   // Create SAFEARRAY
01056   //
01057     SAFEARRAY *pPlayListArray = NULL;
01058     pPlayListArray = SafeArrayCreate( VT_VARIANT, 1, &DimensionBounds);
01059     if( pPlayListArray == NULL)
01060     {
01061         DoMessage( _T("PutPlayList: SafeArrayCreate failed"));
01062     delete pvarArrayEntry;
01063         return E_OUTOFMEMORY;
01064     }
01065
01066   //
01067   //repeat this for each file you want to add
01068   //you need to increment lArrayPos
01069   //
01070     pvarArrayEntry->vt = VT_BSTR;
01071     pvarArrayEntry->bstrVal = ::SysAllocString(bstrFileName);
01072     SafeArrayPutElement( pPlayListArray, &lArrayPos, pvarArrayEntry);
01073   VariantClear(pvarArrayEntry);
01074
01075   //
01076   //prepare the variant for put_PlayList
01077   //
01078     V_VT(&varPlaylist) = VT_ARRAY | VT_VARIANT;
01079     V_ARRAY(&varPlaylist) = pPlayListArray;
01080
01081   //
01082   //finally put play list
01083   //
01084     hr = pMediaPlayback->put_PlayList(varPlaylist);
01085     if(FAILED(hr))
01086     {
01087         DoMessage( _T("PutPlayList: put_PlayList failed"));
01088     delete pvarArrayEntry;
01089         return E_OUTOFMEMORY;
01090     }
01091
01092   //
01093   //clean up
01094   //
01095   delete pvarArrayEntry;
01096     pMediaPlayback->Release();
01097   VariantClear(&varPlaylist);
01098
01099     return hr;
01100 }
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/land.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

land.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Land.h"
00021
00022 const GUID CLandBasedVehicle::thisGuid = { 0x2974380e, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CLandBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_foo Member List

This is the complete list of members for _foo, including all inherited members.
dw | _foo
dwh | _foo
uli | _foo
w0 | _foo
w1 | _foo
w2 | _foo
w3 | _foo
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_WAVE_DATA Member List

This is the complete list of members for _WAVE_DATA, including all inherited members.
dwAmplitude | _WAVE_DATA
dwPeriod | _WAVE_DATA
szInstanceName | _WAVE_DATA
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CChildView Member List

This is the complete list of members for CChildView, including all inherited members.
CChildView() | CChildView |
m_cChannels | CChildView |
m_sizeInitPos | CChildView |
OnFileOpen() | CChildView | [protected]
OnFileSave() | CChildView | [protected]
OnMixerMerge() | CChildView | [protected]
OnMixerPlay() | CChildView | [protected]
OnMixerStop() | CChildView | [protected]
OnPaint() | CChildView | [protected]
OnSetfocusEditValidbits() | CChildView | [protected]
OnUpdateFileSave(CCmdUI *pCmdUI) | CChildView | [protected]
OnUpdateMixerMerge(CCmdUI *pCmdUI) | CChildView | [protected]
OnUpdateMixerPlay(CCmdUI *pCmdUI) | CChildView | [protected]
OnUpdateMixerStop(CCmdUI *pCmdUI) | CChildView | [protected]
PreCreateWindow(CREATESTRUCT &cs) | CChildView | [protected, virtual]
UpdateDialogs(void) | CChildView |
WindowProc(UINT message, WPARAM wParam, LPARAM lParam) | CChildView | [protected, virtual]
~CChildView() | CChildView | [virtual]
Generated on Wed Nov 13 2024 16:55:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/precomp.h Source File

  • Web
  • NetMeeting
  • PlugTransport

precomp.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     PLUGTRANSPORT.EXE
00003 //  File:       PRECOMP.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016
00017 #include <windows.h>
00018 #include <ocidl.h>
00019 #include <assert.h>
00020
00021 #include <string.h>
00022 #include <tchar.h>
00023
00024 #include "resource.h"
00025 #include "plugtransport.h"
00026 #include "utils.h"
00027 #include "nmsession.h"
00028 #include "nullmdm.h"
00029 #include "x224.h"
00030 #include "plugxprt.h"
00031
00032
00033
00034
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/OPBank/resource.h Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • OPBank

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by OPBank.rc
00004 //
00005 #define DEBIT                           1
00006 #define CREDIT                          2
00007 #define TRANSFER                        3
00008 #define MOVEMONEY                       4
00009 #define ACCOUNT                         5
00010 #define POOLTEST                        7
00011 #define IDS_PROJNAME                    100
00012 #define IDR_OPBank                      100
00013 #define IDD_BANKDLG                     101
00014 #define CREATEROWS                      107
00015 #define VERIFY_SCHEMA                   108
00016 #define IDC_SUBMIT                      200
00017 #define IDR_MENU                        201
00018 #define IDC_ROWS                        201
00019 #define IDC_MOVEMONEY                   202
00020 #define IDR_ACCELERATORS                202
00021 #define IDC_ACCOUNT                     203
00022 #define IDC_FROM                        204
00023 #define IDC_TO                          205
00024 #define IDC_CREATE_ROWS                 207
00025 #define IDC_RESULTS                     208
00026 #define IDC_ITERS                       209
00027 #define IDC_STA                         210
00028 #define IDC_MTA                         211
00029 #define IDC_STOP                        212
00030 #define IDC_CREDIT                      213
00031 #define IDC_DEBIT                       214
00032 #define IDC_AMOUNT                      216
00033 #define IDC_THREADS                     217
00034 #define IDC_CHATTY                      218
00035 #define IDC_CREATE_TABLES               219
00036 #define IDC_RUN_SUITE                   220
00037 #define IDC_VIEW_NEXT                   221
00038 #define IDC_VIEW_PREV                   222
00039 #define IDC_ADD                         224
00040 #define IDC_SUITE_STATUS                225
00041 #define IDC_REMOVE                      226
00042 #define IDC_DESCRIPTION                 226
00043 #define IDC_ODBC_STOP                   227
00044 #define ID_COINIT_MTA                   32675
00045 #define ID_COINIT_STA                   32676
00046 #define ID_COINIT_RANDOM                32677
00047 #define ID_MM_TRANSFER                  32770
00048 #define ID_MM_DEBIT                     32771
00049 #define ID_MM_CREDIT                    32772
00050 #define ID_AC_DEBIT                     32773
00051 #define ID_AC_CREDIT                    32774
00052 #define ID_ASSERT_ON_ERRORS             32777
00053 #define IDM_OPTION_ODBC_ASSERT          32778
00054 #define IDM_OPTION_ODBC_STOP            32778
00055 #define IDM_OPTION_CHATTY               32779
00056 #define IDM_OPTION_CREATE_ITERATION     32780
00057 #define IDM_RANDOM                      32781
00058 #define IDM_GO                          32782
00059 #define IDM_STOP                        32783
00060 #define IDM_KILL_THREADS                32784
00061 #define IDM_VIEW_NEXT                   32785
00062 #define IDM_PREV                        32786
00063 #define IDM_ADD                         32787
00064 #define IDM_REMOVE                      32788
00065 #define IDM_RUN_SUITE                   32789
00066 #define IDM_RANDOM_COINIT               32790
00067 #define ID_LANG_C                       32791
00068 #define ID_LANG_VB                      32792
00069 #define ID_LANG_JAVA                    32793
00070 #define ID_LANG_DELPHI                  32794
00071 #define IDM_RETRY                       32795
00072 #define IDM_COPY                        32796
00073 #define IDM_COPYALL                     32797
00074 #define IDM_COPYERRORS                  32798
00075 #define IDM_ACCOUNT_ALL                 32803
00076 #define IDM_POOL_TEST                   32804
00077
00078 // Next default values for new objects
00079 //
00080 #ifdef APSTUDIO_INVOKED
00081 #ifndef APSTUDIO_READONLY_SYMBOLS
00082 #define _APS_NEXT_RESOURCE_VALUE        203
00083 #define _APS_NEXT_COMMAND_VALUE         32805
00084 #define _APS_NEXT_CONTROL_VALUE         227
00085 #define _APS_NEXT_SYMED_VALUE           110
00086 #endif
00087 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsError/ADsError.idl Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsError

ADsError.idl

Go to the documentation of this file.
00001 // ADsError.idl : IDL source for ADsError.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (ADsError.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010   [
00011     object,
00012     uuid(417D01DF-F1C6-11D2-BC88-00C04FD430AF),
00013     dual,
00014     helpstring("IADsError Interface"),
00015     pointer_default(unique)
00016   ]
00017   interface IADsError : IDispatch
00018   {
00019     [id(1), helpstring("method GetErrorMessage")] HRESULT GetErrorMessage([in] long hResult, [out,retval] BSTR *pbMsg);
00020   };
00021
00022 [
00023   uuid(417D01D3-F1C6-11D2-BC88-00C04FD430AF),
00024   version(1.0),
00025   helpstring("ADsError 1.0 Type Library")
00026 ]
00027 library ADSERRORLib
00028 {
00029   importlib("stdole32.tlb");
00030   importlib("stdole2.tlb");
00031
00032
00033   [
00034     uuid(417D01E0-F1C6-11D2-BC88-00C04FD430AF),
00035     helpstring("ADsError Class")
00036   ]
00037   coclass ADsError
00038   {
00039     [default] interface IADsError;
00040   };
00041 };
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/virtualfile.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

virtualfile.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Defines a virtual file class derived from CBaseNode.  This
00014 //             class will represent our result items
00015 //
00016
00017
00018 #ifndef _CLASS_VIRTUALFILE_
00019 #define _CLASS_VIRTUALFILE_
00020
00021 #include "Globals.h"
00022 #include "BaseNode.h"
00023
00024
00025 class CFolderNode;           // References
00026 class CComponentData;
00027
00028 //---------------------------------------------------------------------------
00029 class CVirtualFile : public CBaseNode
00030 {
00031   public:
00032     CVirtualFile();
00033     virtual ~CVirtualFile();
00034
00035     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00036
00037   ///////////////////////////////////////////////////////////////////////////
00038   // Virtual methods
00039   public:
00040     ULONG   GetNodeType() { return NODETYPE_VFILE; }
00041     GUID&   GetNodeGUID() { return thisGUID; }
00042
00043     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo )
00044             { return E_NOTIMPL; }
00045
00046     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI )
00047             { return E_NOTIMPL; }
00048
00049     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00050
00051   ///////////////////////////////////////////////////////////////////////////
00052   // Property Page methods
00053   public:
00054     HRESULT QueryForPropertyPage();
00055     HRESULT CreatePropertyPages( LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle );
00056     HRESULT GetWatermarks( HBITMAP __RPC_FAR *lphWatermark,
00057                            HBITMAP __RPC_FAR *lphHeader,
00058                            HPALETTE __RPC_FAR *lphPalette,
00059                            BOOL __RPC_FAR *bStretch );
00060
00061
00062   /////////////////////////////////////////////////////////////////////////
00063   //  Notification handlers
00064   public:
00065     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00066     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00067     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00068     HRESULT OnContextHelp( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00069
00070     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData )
00071             { return E_NOTIMPL; }
00072
00073     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData )
00074             { return E_NOTIMPL; }
00075
00076   ///////////////////////////////////////////////////////////////////////////
00077   //  Context Menu methods
00078   public:
00079     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00080     HRESULT Command( long lCommandID );
00081
00082   private:
00083     static GUID      thisGUID;
00084     DWORD            m_dwAttributes;
00085     CFolderNode*     m_pParentFolder;
00086     CComponentData*  m_pCompData;
00087     WCHAR            m_pAttributeStr[16];  // Attribute string
00088
00089   private:
00090     static BOOL CALLBACK PPageWndProc0( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam );
00091
00092     BOOL   OnInitPropPage( HWND hPage, WPARAM wParam, LPARAM lParam );
00093     BOOL   OnApplyChanges( HWND hPage, WPARAM wParam, LPARAM lParam );
00094
00095   public:
00096     LONG_PTR     m_nNotifyHandle;
00097
00098   public:
00099     BOOL    IsAttributeSet( DWORD dwAttribute );
00100     VOID    SetAttribute( DWORD dwAttribute );
00101     VOID    RemoveAttribute( DWORD dwAttribute );
00102     LPWSTR  GetAttributeString();
00103
00104 };
00105
00106 #endif //_CLASS_VIRTUALFILE_
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/HtmlProp/HtmlProp.Hxx Source File

  • WinBase
  • Indexing
  • HtmlProp

HtmlProp.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // PROGRAM:  htmlprop.hxx
00011 //
00012 // PURPOSE:  Sits on the Indexing Service HTML filter to translate string
00013 //           meta properties into specified data types.
00014 //
00015 // PLATFORM: Windows 2000
00016 //
00017 //--------------------------------------------------------------------------
00018
00019 #pragma once
00020
00021 //
00022 // Standard Ole exports
00023 //
00024
00025 extern "C" SCODE STDMETHODCALLTYPE DllGetClassObject( REFCLSID cid,
00026                                                       REFIID   iid,
00027                                                       void **  ppvObj );
00028
00029 extern "C" SCODE STDMETHODCALLTYPE DllCanUnloadNow( void );
00030
00031 const ULONG cwcMaxName = 80;
00032
00033 class HtmlPropIFilter : public IFilter, public IPersistFile
00034 {
00035 public:
00036
00037     //
00038     // From IUnknown
00039     //
00040
00041     SCODE STDMETHODCALLTYPE QueryInterface(REFIID riid, void * * ppvObject);
00042
00043     ULONG STDMETHODCALLTYPE AddRef();
00044
00045     ULONG STDMETHODCALLTYPE Release();
00046
00047     //
00048     // From IFilter
00049     //
00050
00051     SCODE STDMETHODCALLTYPE Init( ULONG grfFlags,
00052                                   ULONG cAttributes,
00053                                   FULLPROPSPEC const * aAttributes,
00054                                   ULONG * pFlags );
00055
00056     SCODE STDMETHODCALLTYPE GetChunk( STAT_CHUNK * pStat);
00057
00058     SCODE STDMETHODCALLTYPE GetText( ULONG * pcwcBuffer,
00059                                      WCHAR * awcBuffer );
00060
00061     SCODE STDMETHODCALLTYPE GetValue( PROPVARIANT * * ppPropValue );
00062
00063     SCODE STDMETHODCALLTYPE BindRegion( FILTERREGION origPos,
00064                                         REFIID riid,
00065                                         void ** ppunk);
00066
00067     //
00068     // From IPersistFile
00069     //
00070
00071     SCODE STDMETHODCALLTYPE GetClassID( CLSID * pClassID );
00072
00073     SCODE STDMETHODCALLTYPE IsDirty();
00074
00075     SCODE STDMETHODCALLTYPE Load( LPCWSTR pszFileName,
00076                                   DWORD dwMode);
00077
00078     SCODE STDMETHODCALLTYPE Save( LPCWSTR pszFileName,
00079                                   BOOL fRemember );
00080
00081     SCODE STDMETHODCALLTYPE SaveCompleted( LPCWSTR pszFileName );
00082
00083     SCODE STDMETHODCALLTYPE GetCurFile( LPWSTR  * ppszFileName );
00084
00085 protected:
00086     friend class HtmlPropIFilterCF;
00087
00088     HtmlPropIFilter();
00089     ~HtmlPropIFilter();
00090
00091     IFilter *      _pHtmlFilter;
00092     IPersistFile * _pPersistFile;
00093     long           _lRefs;
00094     BOOL           _fMetaProperty;
00095     WCHAR          _awcName[cwcMaxName];
00096 };
00097
00098 class HtmlPropIFilterCF : public IClassFactory
00099 {
00100 public:
00101
00102     HtmlPropIFilterCF();
00103
00104     SCODE STDMETHODCALLTYPE QueryInterface( REFIID riid,
00105                                             void  ** ppvObject);
00106
00107     ULONG STDMETHODCALLTYPE AddRef();
00108
00109     ULONG STDMETHODCALLTYPE Release();
00110
00111     SCODE STDMETHODCALLTYPE CreateInstance( IUnknown * pUnkOuter,
00112                                             REFIID riid, void  * * ppvObject );
00113
00114     SCODE STDMETHODCALLTYPE LockServer( BOOL fLock );
00115
00116 protected:
00117
00118     friend SCODE STDMETHODCALLTYPE DllGetClassObject( REFCLSID cid,
00119                                                       REFIID iid, void** ppvObj );
00120     ~HtmlPropIFilterCF();
00121
00122     long _lRefs;
00123 };
00124
00125
00126
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ITEMINFO Member List

This is the complete list of members for ITEMINFO, including all inherited members.
pidlFQ | ITEMINFO
pidlRel | ITEMINFO
pParentFolder | ITEMINFO
Generated on Wed Nov 13 2024 16:57:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/resource.h Source File

  • SysMgmt
  • MMC
  • Tbarext

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by resource.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDR_TOOLBAR1                    112
00012 #define IDR_SMICONS                     120
00013 #define IDR_LGICONS                     121
00014 #define IDB_SMOPEN                      124
00015 #define IDB_SMBMP                       125
00016 #define IDB_LGBMP                       126
00017 #define IDB_ROCKET                      40004
00018 #define IDB_CAR                         40005
00019 #define IDB_PLANE                       40006
00020 #define IDB_BIKE                        40007
00021 #define IDB_ROCKET2                     40008
00022 #define IDB_CAR2                        40009
00023 #define IDB_PLANE2                      40010
00024 #define IDB_BIKE2                       40011
00025 #define IDB_CLOSED2                     40012
00026 #define IDB_OPEN2                       40013
00027 #define IDB_CLOSED                      40014
00028 #define IDB_OPEN                        40015
00029 #define ID_BUTTON40016                  40016
00030 #define ID_BUTTON40017                  40017
00031 #define ID_BUTTON40018                  40018
00032 #define ID_BUTTON40019                  40019
00033 #define ID_BUTTON40020                  40020
00034 #define ID_BUTTON40021                  40021
00035 #define ID_BUTTONSTART                  40021
00036 #define ID_BUTTON40022                  40022
00037 #define ID_BUTTONPAUSE                  40022
00038 #define ID_BUTTON40023                  40023
00039 #define ID_BUTTONSTOP                   40023
00040 #define ID_BUTTON40024                  40024
00041 #define ID_BUTTON40025                  40025
00042 #define ID_BUTTON40026                  40026
00043
00044 // Next default values for new objects
00045 //
00046 #ifdef APSTUDIO_INVOKED
00047 #ifndef APSTUDIO_READONLY_SYMBOLS
00048 #define _APS_NEXT_RESOURCE_VALUE        127
00049 #define _APS_NEXT_COMMAND_VALUE         40027
00050 #define _APS_NEXT_CONTROL_VALUE         1000
00051 #define _APS_NEXT_SYMED_VALUE           101
00052 #endif
00053 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/common.h Source File

  • Dataaccess
  • oledb
  • tablecopy

common.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module COMMON.H
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011 #ifndef _COMMON_H_
00012 #define _COMMON_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019 #include "winmain.h"
00020
00021 #include "oledb.h"
00022 #include "oledberr.h"
00023
00024 #include "error.h"
00025 #include "tablecopy.h"
00026
00027
00028 ///////////////////////////////////////////////////////////////
00029 // Defines
00030 //
00031 ///////////////////////////////////////////////////////////////
00032 #define NUMELE(rgEle) (sizeof(rgEle) / sizeof(rgEle[0]))
00033 #define __WIDESTRING(str) L##str
00034 #define WIDESTRING(str) __WIDESTRING(str)
00035
00036 //FindLeaks
00037 #ifdef _DEBUG
00038 #define DISP_FILE_LINE  TRACE("File '%s', Line '%lu'\n", __FILE__, __LINE__)
00039 #else
00040 #define DISP_FILE_LINE
00041 #endif //_DEBUG
00042
00043 //IMalloc Wrappers
00044 #define SAFE_ALLOC(pv, type, cb)  { DISP_FILE_LINE; pv = (type*)CoTaskMemAlloc((cb)*sizeof(type)); CHECK_MEMORY(pv);      }
00045 #define SAFE_REALLOC(pv, type, cb)  { DISP_FILE_LINE; pv = (type*)CoTaskMemRealloc(pv, (cb)*sizeof(type)); CHECK_MEMORY(pv);  }
00046 #define SAFE_SYSALLOC(pv, bstr)   { pv = SysAllocString(bstr); CHECK_MEMORY(pv);                        }
00047
00048 #define SAFE_FREE(pv)       { CoTaskMemFree(pv); pv = NULL;           }
00049 #define SAFE_SYSFREE(bstr)      { SysFreeString(bstr); bstr = NULL;         }
00050
00051 //IUnknown->Release Wrapper
00052 #define SAFE_ADDREF(pv)       if(pv) { ((IUnknown*)(pv))->AddRef();       }
00053 #define SAFE_RELEASE(pv)      if(pv) { ((IUnknown*)(pv))->Release(); pv = NULL; }
00054
00055 //Test macros
00056 #define CHECKC(exp)         { if(!(exp)) { ASSERT(!#exp); goto CLEANUP;     } }
00057 #define QTESTC(exp)         { if(FAILED(exp)) goto CLEANUP;           }
00058
00059 #define XTEST(exp)          { HRESULT Internalhr = exp; if(FAILED(Internalhr)) { DisplayAllErrors(NULL, Internalhr, WIDESTRING(__FILE__), __LINE__); }}
00060 #define XTESTC(exp)         { HRESULT Internalhr = exp; if(FAILED(Internalhr)) { DisplayAllErrors(NULL, Internalhr, WIDESTRING(__FILE__), __LINE__); goto CLEANUP; }}
00061
00062
00063
00064 ///////////////////////////////////////////////////////////////////
00065 // Accessor / Binding
00066 //
00067 ///////////////////////////////////////////////////////////////////
00068 #define ADJUST_SIZE(Size, MaxSize)  ((Size) = min((Size), (MaxSize)))
00069
00070 //STATUS helpers, for locating obStatus offsets in the bindings
00071 #define STATUS_IS_BOUND(Binding)    ( Binding.dwPart & DBPART_STATUS )
00072 #define BINDING_STATUS(Binding, pv) (*(ULONG*)((BYTE*)pv + Binding.obStatus))
00073
00074 //LENGTH helpers, for locating obLength offsets in the bindings
00075 #define LENGTH_IS_BOUND(Binding)    ( Binding.dwPart & DBPART_LENGTH )
00076 #define BINDING_LENGTH(Binding, pv) (*(ULONG*)((BYTE*)pv + Binding.obLength))
00077
00078 //VALUE helpers, for locating obValue offsets in the bindings
00079 #define VALUE_IS_BOUND(Binding)     ( Binding.dwPart & DBPART_VALUE )
00080 #define BINDING_VALUE(Binding, pv)  (*(ULONG*)((BYTE*)pv + Binding.obValue ))
00081
00082 //ROUNDUP on all platforms pointers must be aligned properly
00083 #define ROUNDUP_AMOUNT  8
00084 #define ROUNDUP_(size,amount)   (((ULONG)(size)+((amount)-1))&~((amount)-1))
00085 #define ROUNDUP(size)       ROUNDUP_(size, ROUNDUP_AMOUNT)
00086
00087 BOOL FreeBindings(ULONG cBindings, DBBINDING* rgBindings);
00088 BOOL FreeBindingData(ULONG cBindings, DBBINDING* rgBindings, void* pData);
00089
00090
00091
00092 ////////////////////////////////////////////////////////////////////////////
00093 // DBTYPE functions
00094 //
00095 ////////////////////////////////////////////////////////////////////////////
00096 BOOL IsFixedType(DBTYPE wType);
00097 BOOL IsVariableType(DBTYPE wType);
00098 BOOL IsNumericType(DBTYPE wType);
00099
00100 WCHAR* GetDBTypeName(DBTYPE wType);
00101 BOOL GetPromotedType(DBTYPE* pwType);
00102
00103
00104
00105 ////////////////////////////////////////////////////////////////////////////
00106 // OLEDB General Helper functions
00107 //
00108 ////////////////////////////////////////////////////////////////////////////
00109 ULONG GetCreateParams(WCHAR* pwszCreateParam);
00110
00111 HRESULT ConvertToMBCS(WCHAR* pwsz, CHAR* psz, ULONG cbStrLen);
00112 HRESULT ConvertToWCHAR(CHAR* psz, WCHAR* pwsz, ULONG cbStrLen);
00113 WCHAR* wcsDuplicate(WCHAR* pwsz);
00114
00115
00116 ///////////////////////////////////////////////////////////////
00117 // Static Strings Messages
00118 //
00119 ///////////////////////////////////////////////////////////////
00120
00121 //General Statss
00122 extern WCHAR wsz_OLEDB[];
00123 extern WCHAR wsz_SUCCESS[];
00124 extern WCHAR wsz_WARNING[];
00125 extern WCHAR wsz_INFO[];
00126 extern WCHAR wsz_ERROR[];
00127 extern WCHAR wsz_CANCEL[];
00128 extern WCHAR wsz_ERRORINFO[];
00129
00130 //Copying Status
00131 extern WCHAR wsz_COPYING[];
00132 extern WCHAR wsz_COPIED_RECORDS[];
00133 extern WCHAR wsz_COPY_SUCCESS[];
00134 extern WCHAR wsz_COPY_FAILURE[];
00135 extern WCHAR wsz_CANCEL_OP[];
00136 extern WCHAR wsz_TYPEMAPPING_FAILURE[];
00137
00138 //Tables
00139 extern WCHAR wsz_CREATE_TABLE[];
00140 extern WCHAR wsz_DROP_TABLE_[];
00141 extern WCHAR wsz_ASK_DROP_TABLE_[];
00142 extern WCHAR wsz_SAME_TABLE_NAME[];
00143 extern WCHAR wsz_FROMTABLEHELP_[];
00144 extern WCHAR wsz_FROMQUALTABLE_[];
00145 extern WCHAR wsz_TOTABLEHELP_[];
00146
00147 //Indexes
00148 extern WCHAR wsz_CREATE_INDEX_[];
00149 extern WCHAR wsz_UNIQUE_INDEX[];
00150 extern WCHAR wsz_INDEX_DESC[];
00151 extern WCHAR wsz_INDEX_FAILED_[];
00152
00153 //Columns
00154 extern WCHAR wsz_NO_TYPE_MATCH_[];
00155 extern WCHAR wsz_NO_TYPE_FOUND_[];
00156
00157 extern WCHAR wsz_CONNECT_STRING_[];
00158 extern WCHAR wsz_TYPES_STRING_[];
00159 extern WCHAR wsz_NOT_CONNECTED[];
00160
00161 extern WCHAR wsz_PROVIDER_INFO_[];
00162
00163 extern WCHAR wsz_INVALID_VALUE_[];
00164 extern WCHAR wsz_READONLY_DATASOURCE_[];
00165
00166 //Query
00167 extern WCHAR wsz_SHOW_SQL_[];
00168 extern WCHAR wsz_SELECT[];
00169 extern WCHAR wsz_FROM[];
00170 extern WCHAR wsz_BOGUS_WHERE[];
00171 extern WCHAR wsz_INSERT_INTO[];
00172 extern WCHAR wsz_VALUES_CLAUSE[];
00173 extern WCHAR wsz_PARAM[];
00174 extern WCHAR wsz_PRIMARY_KEY[];
00175
00176 //General String Values
00177 extern WCHAR wsz_COMMA[];
00178 extern WCHAR wsz_LPAREN[];
00179 extern WCHAR wsz_RPAREN[];
00180 extern WCHAR wsz_SPACE[];
00181 extern WCHAR wsz_PERIOD[];
00182
00183 #define EOL     L'\0'
00184 #define SPACE   L' '
00185 #define UNDERSCORE  L'_'
00186
00187
00188 #endif //_COMMON_H_
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/filerepclient.idl Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

filerepclient.idl

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005
00006     FILE: FileRepClient.idl
00007
00008     PURPOSE:  Defines the interface for the client system service.
00009
00010 */
00011
00012 [
00013     uuid(fe7f2eda-5da1-4041-928c-d2534d3fa129),
00014     pointer_default(ref),
00015     version(1.0)
00016 ]
00017
00018 interface FileRepClient {
00019
00020 // Declare the string data type. This should work for UNICODE.
00021 #ifdef _UNICODE
00022     typedef wchar_t * STR;
00023 #else
00024     typedef unsigned char * STR;
00025 #endif
00026
00027     /*
00028         A replication request is made by making this RPC.  With ServerName
00029   specifying the source machine for replication, RemoteFileName
00030   specifying the source file for replication, and LocalFileName
00031   the name for the file on the local machine.  A thread is forked
00032   to handle the actual file replication and an error encountered by
00033   the thread will not produce the error return status.
00034     */
00035     void RequestFile([in] handle_t hFileRepClient,
00036          [in, ref, string] STR ServerName,
00037          [in, ref, string] STR RemoteFileName,
00038          [in, ref, string] STR LocalFileName);
00039 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD Member List

This is the complete list of members for SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD, including all inherited members.
dimLevel([out, retval] long *pdimLevel) | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
GetConfigDetails([in, out] VARIANT_BOOL *ppowerVal,[in, out] long *pdLevel) | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
GetDimLevel([in, out] long *pdLevel) | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
GetPowerValue([in, out] VARIANT_BOOL *ppowerVall) | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
Power([out, retval] VARIANT_BOOL *pPower) | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
PowerOff() | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
PowerOn() | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
SetDimLevel([in] long dLevel) | SDKDimmerServiceLib::IUPnPService_DimmingService_SCPD
Generated on Wed Nov 13 2024 16:58:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Inc/BALLGUID.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • Inc

BALLGUID.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      BALLGUID.H
00003
00004   Summary:   This is the common include file for the ball-related COM
00005              Interfaces and COM Objects. GUIDs are defined for the
00006              Interfaces and CLSIDs for the COM objects constructed using
00007              those interfaces.
00008
00009              This file is global to all the Tutorial Code Samples (kept
00010              in the ..\INC directory).  It is a good practice to
00011              factor out Interface and GUID specifications to reduce the
00012              possibility of GUID or interface conflicts.
00013
00014   Classes:   .
00015
00016   Functions: .
00017
00018   Origin:    6-3-96: atrent - Revised for the COM Tutorial Code Samples.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 #if !defined(BALLGUID_H)
00036 #define BALLGUID_H
00037
00038 #if !defined(RC_INCLUDE)
00039
00040
00041 /*---------------------------------------------------------------------------
00042   Here are the IIDs for interfaces and the CLSIDs for the Class Factories
00043   of the Ball-related COM components in the FRESERVE, and FRECLIEN code
00044   samples. IID_IBall is also used in the CONSERVE and CONCLIEN samples.
00045 ---------------------------------------------------------------------------*/
00046 DEFINE_GUID(IID_IBall,
00047   0x0002da22, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00048
00049 DEFINE_GUID(CLSID_DllBall,
00050   0x0002da23, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00051
00052
00053 /*---------------------------------------------------------------------------
00054   Here are the IIDs for interfaces and the CLSIDs for the Class Factories
00055   of the Ball-related COM components in the CONSERVE and CONCLIEN code
00056   samples.
00057 ---------------------------------------------------------------------------*/
00058 DEFINE_GUID(IID_IBallSink,
00059   0x0002da26, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00060
00061 DEFINE_GUID(CLSID_DllSndBall,
00062   0x0002da27, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00063
00064
00065 #endif // RC_INCLUDE
00066
00067 #endif // BALLGUID_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/msdfmap.cpp Source File

  • Dataaccess
  • rds
  • handler
  • vc

msdfmap.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File:    msdfmap.cpp
00004 //
00005 // Copyright: Copyright (c) 1991-1999 Microsoft Corporation
00006 //
00007 // Contents:  Implementation of DLL Exports.
00008 //
00009 // Comments:    To build a separate proxy/stub DLL,
00010 //              run nmake -f msdfmapps.mk in the project directory.
00011 //
00012 //-----------------------------------------------------------------------------
00013
00014 #include "stdafx.h"
00015 #include <initguid.h>
00016 #include "resource.h"
00017 #include "msdfmap.h"
00018 #include "msdfmap_i.cpp"
00019 #include "HANDLER.h"
00020 #include "msdfhdl.cpp"
00021
00022 CComModule _Module;
00023
00024 BEGIN_OBJECT_MAP(ObjectMap)
00025   OBJECT_ENTRY(CLSID_Handler, CHandler)
00026 END_OBJECT_MAP()
00027
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // DLL Entry Point
00031
00032 extern "C"
00033 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00034 {
00035   if (dwReason == DLL_PROCESS_ATTACH)
00036   {
00037     _Module.Init(ObjectMap, hInstance);
00038     DisableThreadLibraryCalls(hInstance);
00039   }
00040   else if (dwReason == DLL_PROCESS_DETACH)
00041     _Module.Term();
00042   return TRUE;    // ok
00043 }
00044
00045 /////////////////////////////////////////////////////////////////////////////
00046 // Used to determine whether the DLL can be unloaded by OLE
00047
00048 STDAPI DllCanUnloadNow(void)
00049 {
00050   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00051 }
00052
00053 /////////////////////////////////////////////////////////////////////////////
00054 // Returns a class factory to create an object of the requested type
00055
00056 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00057 {
00058   return _Module.GetClassObject(rclsid, riid, ppv);
00059 }
00060
00061 /////////////////////////////////////////////////////////////////////////////
00062 // DllRegisterServer - Adds entries to the system registry
00063
00064 STDAPI DllRegisterServer(void)
00065 {
00066   // registers object, typelib and all interfaces in typelib
00067   return _Module.RegisterServer(TRUE);
00068 }
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 // DllUnregisterServer - Removes entries from the system registry
00072
00073 STDAPI DllUnregisterServer(void)
00074 {
00075   _Module.UnregisterServer();
00076   return S_OK;
00077 }
00078
00079
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CExtPageUser Member List

This is the complete list of members for CExtPageUser, including all inherited members.
Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal) | CPropertyPage |
Apply() | CPropertyPage |
CExtPageUser(CWizExtUser *pWizExt) | CExtPageUser | [inline]
CPropertyPage(REFCLSID clsid, INT iDialogID) | CPropertyPage |
CWizExtUser class | CExtPageUser | [friend]
Deactivate() | CPropertyPage |
DEFINE_ADDREF_RELEASE | CPropertyPage |
DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [static]
GetChangePictureButton() | CExtPageUser | [inline, private]
GetClassID(CLSID __RPC_FAR *pClassID) | CPropertyPage | [inline]
GetClearPictureButton() | CExtPageUser | [inline, private]
GetIDEdit() | CExtPageUser | [inline, private]
GetPageInfo(PROPPAGEINFO __RPC_FAR *pPageInfo) | CPropertyPage | [inline, virtual]
GetPathEdit() | CExtPageUser | [inline, private]
GetPicture() | CExtPageUser | [inline, private]
GetSummaryInfo(BSTR *pBstrText) | CExtPageUser | [private]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [virtual]
Help(LPCOLESTR pszHelpDir) | CPropertyPage | [inline]
IDD enum value | CExtPageUser |
InitNew(void) | CPropertyPage | [inline]
IsPageDirty() | CPropertyPage |
Load(IPropertyBag __RPC_FAR *pPropBag, IErrorLog __RPC_FAR *pErrorLog) | CPropertyPage | [inline]
m_clsid | CPropertyPage | [protected]
m_cRef | CPropertyPage | [protected]
m_hWnd | CPropertyPage | [protected]
m_iDialogID | CPropertyPage | [protected]
m_pIPropertyPageSite | CPropertyPage | [protected]
m_pWizExt | CExtPageUser | [private]
m_thumbNailPhotoHolder | CExtPageUser | [private]
Move(LPCRECT pRect) | CPropertyPage |
OnChangePicture() | CExtPageUser |
OnClearPicture() | CExtPageUser |
OnInitDialog() | CExtPageUser | [virtual]
OnKillActive() | CExtPageUser | [virtual]
OnSetActive() | CExtPageUser | [virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | CPropertyPage |
Save(IPropertyBag __RPC_FAR *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) | CPropertyPage | [inline]
SetObjects(ULONG cObjects, IUnknown __RPC_FAR *__RPC_FAR *ppUnk) | CPropertyPage | [inline]
SetPageSite(IPropertyPageSite *pPageSite) | CPropertyPage |
SetWizardButtons() | CExtPageUser | [private]
Show(UINT nCmdShow) | CPropertyPage |
TranslateAccelerator(MSG *pMsg) | CPropertyPage |
WriteDataHelper() | CExtPageUser | [private]
~CExtPageUser() | CExtPageUser | [inline, virtual]
~CPropertyPage() | CPropertyPage | [virtual]
Generated on Wed Nov 13 2024 16:56:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/registry.h Source File

  • SysMgmt
  • MMC
  • Openserv

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout,   // Class Id for About Class
00040                        const BOOL fSupportExtensions = FALSE);
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Bounce.c Source File

  • Multimedia
  • Gdi
  • GdiDemo

Bounce.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /*---------------------------------------------------------------------------*\
00013 | BOUNCING BALL MODULE
00014 \*---------------------------------------------------------------------------*/
00015
00016 #include <windows.h>
00017 #include "gdidemo.h"
00018 #include "bounce.h"
00019
00020
00021 VOID XFormClear(PMYXFORM);
00022 VOID XFormScale(PMYXFORM,int,int);
00023 VOID XFormTrans(PMYXFORM,int,int);
00024 VOID XFormPoint(PMYXFORM,LPPOINT);
00025
00026
00027 /*---------------------------------------------------------------------------*\
00028 | CREATE BOUNCE WINDOW PROCEDURE
00029 |
00030 \*---------------------------------------------------------------------------*/
00031 HWND FAR CreateBounceWindow(HWND hWndClient, int nItem)
00032 {
00033     HANDLE          hInstance;
00034     MDICREATESTRUCT mcs;
00035     static char buffer[256];
00036
00037
00038     hInstance = GETINSTANCE(hWndClient);
00039     LoadString (hInstance, BOUNCETITLE, buffer, 256);
00040
00041     /*
00042     ** Initialize the MDI create struct for creation of the
00043     ** test window.
00044     */
00045     mcs.szClass = BOUNCECLASS;
00046     mcs.szTitle = buffer;
00047     mcs.hOwner  = hInstance;
00048     mcs.x       = CW_USEDEFAULT;
00049     mcs.y       = CW_USEDEFAULT;
00050     mcs.cx      = CW_USEDEFAULT;
00051     mcs.cy      = CW_USEDEFAULT;
00052     mcs.style   = 0l;
00053     mcs.lParam  = (LONG)nItem;
00054
00055     return((HWND)SendMessage(hWndClient,WM_MDICREATE,0,(LPARAM)(LPMDICREATESTRUCT)&mcs));
00056 }
00057
00058
00059 /*---------------------------------------------------------------------------*\
00060 | BOUNCE WINDOW PROCEDURE
00061 |
00062 \*---------------------------------------------------------------------------*/
00063 LRESULT CALLBACK BounceProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
00064 {
00065     switch(wMsg)
00066     {
00067         case WM_CREATE:
00068             BounceCreateProc(hWnd);
00069             break;
00070
00071         case WM_MOVE:
00072             BounceRefresh(hWnd);
00073             break;
00074
00075         case WM_COMMAND:
00076             BounceCommandProc(hWnd,wParam,lParam);
00077             break;
00078
00079         case WM_TIMER:
00080             BounceObjects(hWnd);
00081             break;
00082
00083         case WM_PAINT:
00084             BouncePaintProc(hWnd);
00085             break;
00086
00087         case WM_DESTROY:
00088             BounceDestroyProc(hWnd);
00089             break;
00090
00091
00092         default:
00093             return(DefMDIChildProc(hWnd,wMsg,wParam,lParam));
00094     }
00095     return(0l);
00096 }
00097
00098
00099 /*---------------------------------------------------------------------------*\
00100 | BOUNCE CREATE PROCEDURE
00101 |
00102 \*---------------------------------------------------------------------------*/
00103 BOOL BounceCreateProc(HWND hWnd)
00104 {
00105     PBOUNCEDATA pbd;
00106
00107
00108     if(AllocWindowInfo(hWnd,sizeof(BOUNCEDATA)))
00109     {
00110         if(pbd = (PBOUNCEDATA)LockWindowInfo(hWnd))
00111         {
00112             pbd->hBall1 = ballCreate(hWnd,20,20,RGB(255,0,0));
00113             pbd->hBall2 = ballCreate(hWnd,20,20,RGB(0,0,255));
00114             pbd->hBall3 = ballCreate(hWnd,20,20,RGB(0,255,0));
00115             pbd->hBall4 = ballCreate(hWnd,20,20,RGB(255,0,255));
00116
00117             UnlockWindowInfo(hWnd);
00118
00119             SetTimer(hWnd,1,50,NULL);
00120             return(TRUE);
00121         }
00122         FreeWindowInfo(hWnd);
00123     }
00124     return(FALSE);
00125 }
00126
00127
00128 /*---------------------------------------------------------------------------*\
00129 | BOUNCE COMMAND PROCEDURE
00130 |
00131 \*---------------------------------------------------------------------------*/
00132 BOOL BounceCommandProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
00133 {
00134     hWnd   = hWnd;
00135     wParam = wParam;
00136     lParam = lParam;
00137
00138     return(TRUE);
00139 }
00140
00141
00142 /*---------------------------------------------------------------------------*\
00143 | BOUNCE PAINT PROCEDURE
00144 |
00145 \*---------------------------------------------------------------------------*/
00146 VOID BouncePaintProc(HWND hWnd)
00147 {
00148     HDC         hDC;
00149     PAINTSTRUCT ps;
00150
00151
00152     if(hDC = BeginPaint(hWnd,&ps))
00153         EndPaint(hWnd,&ps);
00154
00155     BounceRefresh(hWnd);
00156
00157     return;
00158 }
00159
00160
00161 /*---------------------------------------------------------------------------*\
00162 | BOUNCE DESTROY PROCEDURE
00163 |
00164 \*---------------------------------------------------------------------------*/
00165 VOID BounceDestroyProc(HWND hWnd)
00166 {
00167     PBOUNCEDATA pbd;
00168
00169
00170     KillTimer(hWnd,1);
00171     if(pbd = (PBOUNCEDATA)LockWindowInfo(hWnd))
00172     {
00173         ballDestroy(pbd->hBall1);
00174         ballDestroy(pbd->hBall2);
00175         ballDestroy(pbd->hBall3);
00176         ballDestroy(pbd->hBall4);
00177
00178         UnlockWindowInfo(hWnd);
00179     }
00180     FreeWindowInfo(hWnd);
00181     return;
00182 }
00183
00184
00185 /*---------------------------------------------------------------------------*\
00186 | BOUNCE REFRESH
00187 |
00188 \*---------------------------------------------------------------------------*/
00189 VOID BounceRefresh(HWND hWnd)
00190 {
00191     PBOUNCEDATA pbd;
00192     RECT        rect;
00193     HDC         hDC;
00194     POINT       pDimensions;
00195     int         xDirection,yDirection;
00196
00197
00198     if(pbd = (PBOUNCEDATA)LockWindowInfo(hWnd))
00199     {
00200         if(hDC = GetDC(hWnd))
00201         {
00202             GetClientRect(hWnd,&rect);
00203             FillRect(hDC,&rect,GETCLASSBRUSH(hWnd));
00204
00205             xDirection = ((lRandom() % 5)+5);
00206             yDirection = ((lRandom() % 5)+5);
00207             ballSetPosition(pbd->hBall1,0,0);
00208             ballSetDirection(pbd->hBall1,xDirection,yDirection);
00209
00210
00211             ballGetDimensions(pbd->hBall2,&pDimensions);
00212             ballSetPosition(pbd->hBall2,rect.right-pDimensions.x,0);
00213             xDirection = -(((int)lRandom() % 5)+5);
00214             yDirection =  ((lRandom() % 5)+5);
00215             ballSetDirection(pbd->hBall2,xDirection,yDirection);
00216
00217
00218             ballGetDimensions(pbd->hBall3,&pDimensions);
00219             ballSetPosition(pbd->hBall3,0,rect.bottom-pDimensions.y);
00220             xDirection =  ((lRandom() % 5)+5);
00221             yDirection = -((int)(lRandom() % 5)+5);
00222             ballSetDirection(pbd->hBall3,xDirection,yDirection);
00223
00224
00225             ballGetDimensions(pbd->hBall4,&pDimensions);
00226             ballSetPosition(pbd->hBall4,rect.right-pDimensions.x,rect.bottom-pDimensions.y);
00227             xDirection = -((int)(lRandom() % 5)+5);
00228             yDirection = -((int)(lRandom() % 5)+5);
00229             ballSetDirection(pbd->hBall4,xDirection,yDirection);
00230
00231
00232             ballBounce(pbd->hBall1);
00233             ballBounce(pbd->hBall2);
00234             ballBounce(pbd->hBall3);
00235             ballBounce(pbd->hBall4);
00236
00237             ReleaseDC(hWnd,hDC);
00238         }
00239         UnlockWindowInfo(hWnd);
00240     }
00241     return;
00242 }
00243
00244
00245
00246 VOID BounceObjects(HWND hWnd)
00247 {
00248     PBOUNCEDATA pbd;
00249
00250
00251     if(pbd = (PBOUNCEDATA)LockWindowInfo(hWnd))
00252     {
00253         /*
00254         ** Determine if the balls hit any of the edges of the display.  If
00255         ** they do, then these functions reset their position to something
00256         ** more desireable and re-do their direction.
00257         */
00258         CheckEdgePosition(hWnd,pbd->hBall1);
00259         CheckEdgePosition(hWnd,pbd->hBall2);
00260         CheckEdgePosition(hWnd,pbd->hBall3);
00261         CheckEdgePosition(hWnd,pbd->hBall4);
00262
00263         ballBounce(pbd->hBall1);
00264         ballBounce(pbd->hBall2);
00265         ballBounce(pbd->hBall3);
00266         ballBounce(pbd->hBall4);
00267
00268
00269         UnlockWindowInfo(hWnd);
00270     }
00271     return;
00272 }
00273
00274
00275 VOID CheckEdgePosition(HWND hWnd, HANDLE hBall)
00276 {
00277     POINT pPos,pDir,pDim;
00278     int   xNewPos,yNewPos,xNewDir,yNewDir;
00279     RECT  rect;
00280
00281
00282
00283     ballGetPosition(hBall,&pPos);
00284     ballGetDirection(hBall,&pDir);
00285     ballGetDimensions(hBall,&pDim);
00286
00287     GetClientRect(hWnd,&rect);
00288
00289
00290     /*
00291     ** Check each edge of the client rectagle.  If the ball goes past the
00292     ** boundries, reset the position and give it a new direction.
00293     */
00294     xNewDir = pDir.x;
00295     yNewDir = pDir.y;
00296     xNewPos = pPos.x+pDir.x;
00297     yNewPos = pPos.y+pDir.y;
00298
00299     if(xNewPos < rect.left)
00300     {
00301         xNewDir = ((lRandom() % 5)+5);
00302         ballSetPosition(hBall,rect.left,pPos.y);
00303     }
00304     if((xNewPos+pDim.x) > rect.right)
00305     {
00306         xNewDir = -(((int)lRandom() % 5)+5);
00307         ballSetPosition(hBall,rect.right-pDim.x,pPos.y);
00308     }
00309     if(yNewPos < rect.top)
00310     {
00311         yNewDir = ((lRandom() % 5)+5);
00312         ballSetPosition(hBall,pPos.x,rect.top);
00313     }
00314     if((yNewPos+pDim.y) > rect.bottom)
00315     {
00316         yNewDir = -(((int)lRandom() % 5)+5);
00317         ballSetPosition(hBall,pPos.x,rect.bottom-pDim.y);
00318     }
00319     ballSetDirection(hBall,xNewDir,yNewDir);
00320
00321     return;
00322 }
00323
00324
00325 /*---------------------------------------------------------------------------*\
00326 | CLEAR XFORM
00327 |
00328 \*---------------------------------------------------------------------------*/
00329 VOID XFormClear(PMYXFORM pXForm)
00330 {
00331     int Row,Col;
00332
00333
00334     for(Row=0; Row < 3; Row++)
00335         for(Col=0; Col < 3; Col++)
00336             if(Row == Col)
00337                 pXForm->xForm[Row][Col] = 1;
00338             else
00339                 pXForm->xForm[Row][Col] = 0;
00340     return;
00341 }
00342
00343
00344 /*---------------------------------------------------------------------------*\
00345 | XFORM SCALE
00346 |
00347 \*---------------------------------------------------------------------------*/
00348 VOID XFormScale(PMYXFORM pXForm, int xScale, int yScale)
00349 {
00350     int idx;
00351
00352
00353     for(idx=0; idx < 3; idx++)
00354     {
00355         pXForm->xForm[idx][0] = pXForm->xForm[idx][0] * xScale;
00356         pXForm->xForm[idx][1] = pXForm->xForm[idx][1] * yScale;
00357     }
00358     return;
00359 }
00360
00361
00362
00363 VOID XFormTrans(PMYXFORM pXForm, int xTrans, int yTrans)
00364 {
00365     pXForm->xForm[2][0] = pXForm->xForm[2][0] + xTrans;
00366     pXForm->xForm[2][1] = pXForm->xForm[2][1] + yTrans;
00367
00368     return;
00369 }
00370
00371
00372
00373 VOID XFormPoint(PMYXFORM pXForm, LPPOINT pPoint)
00374 {
00375     int x,y;
00376
00377
00378     x = (pXForm->xForm[0][0] * pPoint->x) + (pXForm->xForm[1][0] * pPoint->y) + pXForm->xForm[2][0];
00379     y = (pXForm->xForm[0][1] * pPoint->x) + (pXForm->xForm[1][1] * pPoint->y) + pXForm->xForm[2][1];
00380
00381     pPoint->x = x;
00382     pPoint->y = y;
00383
00384     return;
00385 }
00386
00387
00388 /*
00389 ** -------------------------------
00390 ** -------------------------------
00391 ** -------------------------------
00392 */
00393
00394 HANDLE ballCreate(HWND hWnd, int nWidth, int nHeight, COLORREF crColor)
00395 {
00396     HANDLE    hBall;
00397     PBALLDATA pbd;
00398
00399     if(hBall = LocalAlloc(LHND,sizeof(BALLDATA)))
00400     {
00401         if(pbd = (PBALLDATA)LocalLock(hBall))
00402         {
00403             pbd->hWnd         = hWnd;
00404             pbd->nWidth       = nWidth;
00405             pbd->nHeight      = nHeight;
00406             pbd->xDirection   = 0;
00407             pbd->yDirection   = 0;
00408             pbd->bNewPosition = FALSE;
00409             pbd->xPosition    = 0;
00410             pbd->yPosition    = 0;
00411             pbd->crColor      = crColor;
00412             XFormClear(&pbd->xForm);
00413
00414             LocalUnlock(hBall);
00415             return(hBall);
00416         }
00417         LocalFree(hBall);
00418     }
00419     return(NULL);
00420 }
00421
00422
00423 BOOL ballDestroy(HANDLE hBall)
00424 {
00425     if(LocalFree(hBall))
00426         return(FALSE);
00427     return(TRUE);
00428 }
00429
00430
00431 VOID ballBounce(HANDLE hBall)
00432 {
00433     PBALLDATA pbd;
00434     HDC       hDC;
00435     HBRUSH    hBrush;
00436     POINT     pOrg,pExt;
00437     HRGN      hTmp,hOld,hNew;
00438
00439
00440     if(pbd = (PBALLDATA)LocalLock(hBall))
00441     {
00442         /*
00443         ** Create old ball object.
00444         */
00445         pOrg.x = 0;
00446         pOrg.y = 0;
00447         pExt.x = pbd->nWidth;
00448         pExt.y = pbd->nHeight;
00449         XFormPoint(&pbd->xForm,&pOrg);
00450         XFormPoint(&pbd->xForm,&pExt);
00451         hOld = CreateEllipticRgn(pOrg.x,pOrg.y,pExt.x,pExt.y);
00452
00453
00454         /*
00455         ** Create new ball object.
00456         */
00457         if(pbd->bNewPosition)
00458         {
00459             pbd->bNewPosition = FALSE;
00460             XFormClear(&pbd->xForm);
00461             XFormTrans(&pbd->xForm,pbd->xPosition,pbd->yPosition);
00462         }
00463         else
00464             XFormTrans(&pbd->xForm,pbd->xDirection,pbd->yDirection);
00465         pOrg.x = 0;
00466         pOrg.y = 0;
00467         pExt.x = pbd->nWidth;
00468         pExt.y = pbd->nHeight;
00469         XFormPoint(&pbd->xForm,&pOrg);
00470         XFormPoint(&pbd->xForm,&pExt);
00471         hNew = CreateEllipticRgn(pOrg.x,pOrg.y,pExt.x,pExt.y);
00472
00473
00474
00475         if(hDC = GetDC(pbd->hWnd))
00476         {
00477             hTmp = CreateRectRgn(1,1,2,2);
00478             CombineRgn(hTmp,hOld,hNew,RGN_DIFF);
00479             FillRgn(hDC,hTmp,GETCLASSBRUSH(pbd->hWnd));
00480
00481             hBrush = CreateSolidBrush(pbd->crColor);
00482             FillRgn(hDC,hNew,hBrush);
00483             DeleteObject(hBrush);
00484
00485             ReleaseDC(pbd->hWnd,hDC);
00486
00487             DeleteObject(hTmp);
00488         }
00489
00490         DeleteObject(hOld);
00491         DeleteObject(hNew);
00492
00493         LocalUnlock(hBall);
00494     }
00495     return;
00496 }
00497
00498
00499 BOOL ballGetDimensions(HANDLE hBall, LPPOINT pDimension)
00500 {
00501     PBALLDATA pbd;
00502     BOOL      bOK;
00503
00504
00505     bOK = FALSE;
00506     if(pbd = (PBALLDATA)LocalLock(hBall))
00507     {
00508         pDimension->x = pbd->nWidth;
00509         pDimension->y = pbd->nHeight;
00510
00511         bOK = TRUE;
00512         LocalUnlock(hBall);
00513     }
00514     return(bOK);
00515 }
00516
00517
00518 BOOL ballSetDimensions(HANDLE hBall, int nWidth, int nHeight)
00519 {
00520     PBALLDATA pbd;
00521     BOOL      bOK;
00522
00523
00524     bOK = FALSE;
00525     if(pbd = (PBALLDATA)LocalLock(hBall))
00526     {
00527         pbd->nWidth  = nWidth;
00528         pbd->nHeight = nHeight;
00529
00530         bOK = TRUE;
00531         LocalUnlock(hBall);
00532     }
00533     return(bOK);
00534 }
00535
00536
00537 BOOL ballGetDirection(HANDLE hBall, LPPOINT pDirection)
00538 {
00539     PBALLDATA pbd;
00540     BOOL      bOK;
00541
00542
00543     bOK = FALSE;
00544     if(pbd = (PBALLDATA)LocalLock(hBall))
00545     {
00546         pDirection->x = pbd->xDirection;
00547         pDirection->y = pbd->yDirection;
00548
00549         bOK = TRUE;
00550         LocalUnlock(hBall);
00551     }
00552     return(bOK);
00553 }
00554
00555
00556 BOOL ballSetDirection(HANDLE hBall, int xDirection, int yDirection)
00557 {
00558     PBALLDATA pbd;
00559     BOOL      bOK;
00560
00561
00562     bOK = FALSE;
00563     if(pbd = (PBALLDATA)LocalLock(hBall))
00564     {
00565         pbd->xDirection = xDirection;
00566         pbd->yDirection = yDirection;
00567
00568         bOK = TRUE;
00569         LocalUnlock(hBall);
00570     }
00571     return(bOK);
00572 }
00573
00574
00575 BOOL ballGetPosition(HANDLE hBall, LPPOINT pPosition)
00576 {
00577     PBALLDATA pbd;
00578     BOOL      bOK;
00579     POINT     pOrg;
00580
00581
00582     bOK = FALSE;
00583     if(pbd = (PBALLDATA)LocalLock(hBall))
00584     {
00585         pOrg.x = 0;
00586         pOrg.y = 0;
00587         XFormPoint(&pbd->xForm,&pOrg);
00588
00589         pPosition->x = pOrg.x;
00590         pPosition->y = pOrg.y;
00591
00592         bOK = TRUE;
00593         LocalUnlock(hBall);
00594     }
00595     return(bOK);
00596 }
00597
00598
00599 BOOL ballSetPosition(HANDLE hBall, int x, int y)
00600 {
00601     PBALLDATA pbd;
00602     BOOL      bOK;
00603
00604
00605     bOK = FALSE;
00606     if(pbd = (PBALLDATA)LocalLock(hBall))
00607     {
00608         pbd->bNewPosition = TRUE;
00609         pbd->xPosition    = x;
00610         pbd->yPosition    = y;
00611
00612         bOK = TRUE;
00613         LocalUnlock(hBall);
00614     }
00615     return(bOK);
00616 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/RootDSE/VC/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • RootDSE
  • VC

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  RootDSE.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/ADQI.cpp Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

ADQI.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       ADQI.cxx
00008 //
00009 //  Contents:   ADQI Main
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014
00015
00016 // ADQI.cpp : Defines the class behaviors for the application.
00017 //
00018
00019 #include "stdafx.h"
00020 #include "ADQI.h"
00021 #include "ADQIDlg.h"
00022
00023 #ifdef _DEBUG
00024 #define new DEBUG_NEW
00025 #undef THIS_FILE
00026 static char THIS_FILE[] = __FILE__;
00027 #endif
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // CADQIApp
00031
00032 BEGIN_MESSAGE_MAP(CADQIApp, CWinApp)
00033   //{{AFX_MSG_MAP(CADQIApp)
00034     // NOTE - the ClassWizard will add and remove mapping macros here.
00035     //    DO NOT EDIT what you see in these blocks of generated code!
00036   //}}AFX_MSG
00037   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00038 END_MESSAGE_MAP()
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // CADQIApp construction
00042
00043 CADQIApp::CADQIApp()
00044 {
00045   m_dwFlag = 0;
00046   m_sUserName.Empty();
00047 }
00048
00049
00050 HRESULT CADQIApp::ADsOpenObject( LPWSTR pszPath, REFIID riid, void**pUnk )
00051 {
00052
00053   if ( m_sUserName.Length() )
00054   {
00055     return ::ADsOpenObject( pszPath, m_sUserName, NULL, m_dwFlag, riid, pUnk );
00056   }
00057   else
00058   {
00059     return ADsGetObject( pszPath, riid, pUnk );
00060   }
00061 }
00062
00063 void CADQIApp::SetCredentials( LPCTSTR pszUserName, DWORD dwFlag )
00064 {
00065   m_sUserName = pszUserName;
00066   m_dwFlag    = dwFlag;
00067
00068 }
00069 /////////////////////////////////////////////////////////////////////////////
00070 // The one and only CADQIApp object
00071
00072 CADQIApp theApp;
00073
00074 /////////////////////////////////////////////////////////////////////////////
00075 // CADQIApp initialization
00076
00077 BOOL CADQIApp::InitInstance()
00078 {
00079   // Standard initialization
00080   // If you are not using these features and wish to reduce the size
00081   //  of your final executable, you should remove from the following
00082   //  the specific initialization routines you do not need.
00083
00084 #ifdef _AFXDLL
00085   Enable3dControls();     // Call this when using MFC in a shared DLL
00086 #else
00087   Enable3dControlsStatic(); // Call this when linking to MFC statically
00088 #endif
00089
00090   CADQIDlg dlg;
00091   AfxOleInit();
00092   m_pMainWnd = &dlg;
00093   int nResponse = dlg.DoModal();
00094   if (nResponse == IDOK)
00095   {
00096   }
00097   else if (nResponse == IDCANCEL)
00098   {
00099   }
00100
00101   // Since the dialog has been closed, return FALSE so that we exit the
00102   //  application, rather than start the application's message pump.
00103   return FALSE;
00104 }
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ADDRESS_DATA Member List

This is the complete list of members for ADDRESS_DATA, including all inherited members.
szName | ADDRESS_DATA
szTitle | ADDRESS_DATA
szURI | ADDRESS_DATA
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/CAsyncTest.h Source File

  • Com
  • async
  • server

CAsyncTest.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #if !defined(__CAsyncTest__)
00018 #define __CAsyncTest__
00019
00020 #include <objidl.h>
00021 #include "proxy.h"
00022
00023 class  CServer;
00024 struct ITest;
00025
00026 template<class T, class ISyncFace, class IAsyncFace> class  CAsyncXXX;
00027
00028 class CAsyncTest : public AsyncITest
00029 {
00030 protected:
00031   CAsyncXXX<CServer, ITest, CAsyncTest> *m_lpAsyncXXX;    // Back pointer
00032   CAsyncTest() {};
00033   enum  {CallNone, CallDone, CallPending};          // Flags used track call progress
00034   enum  {Test1, Test2};                   // Used by either TimerProc or ThreadProc to designate which
00035                                 // asynchronous method to call
00036   DWORD m_state;                        // State variable that can be set to CallNone/Done/Pending
00037   HRESULT m_hResult;                      // State variable used to hold hresult returned by Begin_XXX
00038 public:
00039   struct threadParam
00040   {
00041     threadParam(DWORD w, CAsyncTest* p, DWORD method, BSTR s) : wait(w), id(0), pA(p), func(method), data(s){}
00042
00043     UINT wait;
00044     UINT_PTR id;
00045     CAsyncTest* pA;
00046     DWORD func;
00047     BSTR data;
00048   };
00049 protected:
00050   CAsyncTest(CAsyncXXX<CServer, ITest, CAsyncTest> *pA);
00051   virtual ~CAsyncTest();
00052
00053 #if defined(_APARTMENT_)
00054   static void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
00055 #else
00056   static void __cdecl ThreadProc(threadParam *pthdParam);
00057 #endif
00058
00059 public:
00060   bool __stdcall Init();
00061 private:
00062   // AsyncTest
00063   virtual HRESULT __stdcall Begin_Test1(BSTR bstr);
00064   virtual HRESULT __stdcall Finish_Test1(BSTR bstr);
00065   virtual HRESULT __stdcall Begin_Test2(BSTR bstrIn);
00066   virtual HRESULT __stdcall Finish_Test2(BSTR *lpbstrOut);
00067 };
00068 #endif // __CAsyncTest__
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagHANDLERITEMSETTINGS Member List

This is the complete list of members for _tagHANDLERITEMSETTINGS, including all inherited members.
dir1 | _tagHANDLERITEMSETTINGS
dir2 | _tagHANDLERITEMSETTINGS
fRecursive | _tagHANDLERITEMSETTINGS
ft | _tagHANDLERITEMSETTINGS
ItemID | _tagHANDLERITEMSETTINGS
szItemName | _tagHANDLERITEMSETTINGS
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DComDraw/DComDraw.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DComDraw

DComDraw.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DCOMDRAW.H
00003
00004   Summary:   Include file for the DCOMDRAW code sample application. In
00005              addition to class definitions, this DCOMDRAW.H file contains
00006              definitions of the application's menu, string, and other
00007              resource IDs.
00008
00009              For a comprehensive tutorial code tour of DCOMDRAW's contents
00010              and offerings see the tutorial DCOMDRAW.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the DCOMDRAW source code.
00013
00014   Classes:   CMainWindow.
00015
00016   Functions: WinMain.
00017
00018   Origin:    8-23-97: atrent - Editor-inheritance from CONCLIEN source.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 #if !defined(DCOMDRAW_H)
00036 #define DCOMDRAW_H
00037
00038 #ifdef __cplusplus
00039
00040 extern COSERVERINFO g_ServerInfo;
00041
00042 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00043   Class:    CMainWindow
00044
00045   Summary:  Class to encapsulate the application's main window, menu, and
00046             message dispatching behavior.
00047
00048   Methods:  CMainWindow
00049               Constructor.
00050             InitInstance
00051               Creates a new instance of the main window.
00052 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00053 class CMainWindow: public CVirWindow
00054 {
00055   public:
00056     CMainWindow();
00057     ~CMainWindow();
00058     BOOL InitInstance(HINSTANCE hInst, LPSTR pszCmdLine, int nCmdShow);
00059
00060     TCHAR m_szFileName[MAX_PATH];
00061     CMsgBox*   m_pMsgBox;
00062     CGuiPaper* m_pGuiPaper;
00063
00064   protected:
00065     LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00066
00067   private:
00068     LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00069
00070     LONG m_lWidth;
00071     LONG m_lHeight;
00072     TCHAR m_szFileTitle[MAX_PATH];
00073     TCHAR m_szHelpFile[MAX_PATH];
00074     TEXTMETRIC m_tm;
00075     OPENFILENAME m_ofnFile;
00076 };
00077
00078
00079 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00080   Class:    CDlgLoadRemote
00081
00082   Summary:  Class to encapsulate the Load Remote Dialog.
00083
00084   Methods:  DialogProc
00085               Dialog procedure
00086 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00087 class CDlgLoadRemote: public CVirDialog
00088 {
00089 public:
00090   BOOL DialogProc(
00091          HWND hWndDlg,
00092          UINT uMsg,
00093          WPARAM wParam,
00094          LPARAM lParam);
00095 };
00096
00097 #endif // __cplusplus
00098
00099 // Window Class String Macros.
00100 #define MAIN_APP_NAME_STR           "DCOMDRAW: "
00101 #define MAIN_WINDOW_TITLE_STR       "DCOMDRAW: Shared Drawing"
00102 #define MAIN_WINDOW_MASTER_STR      "DCOMDRAW: Shared Drawing [***TALK***]"
00103 #define MAIN_WINDOW_SLAVE_STR       "DCOMDRAW: Shared Drawing [LISTEN]"
00104 #define MAIN_WINDOW_CLASS_NAME_STR  "DCOMDRAWWindow"
00105 #define MAIN_WINDOW_CLASS_MENU_STR  "DCOMDRAWMenu"
00106
00107 // File Name String Macros.
00108 #define SERVER_TUTFILE_STR          "dcdserve.htm"
00109 #define MARSHAL_TUTFILE_STR         "dcdmarsh.htm"
00110
00111 // OpenFile-related String Macros.
00112 #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
00113 #define OFN_DEFAULTTITLE_STR "Open File"
00114
00115 // Error strings.
00116 #define REMOTE_CREATE_ERR_STR       "Remote Object Creation"
00117 #define LOCAL_CREATE_ERR_STR        "Local Object Creation"
00118
00119 // Some compile-time constants for ink thickness in pixels.
00120 enum
00121 {
00122   INK_THIN = 2,
00123   INK_MEDIUM = 10,
00124   INK_THICK = 20
00125 };
00126
00127 // Bit constants for the pen cursor.
00128 #define PENCUR_OFF    0
00129 #define PENCUR_ON     1
00130 #define PENCUR_THIN   2
00131 #define PENCUR_MEDIUM 4
00132 #define PENCUR_THICK  8
00133
00134
00135 // File Menu Command Identifiers.
00136 #define IDM_FILE_LOADREMOTE         1000
00137 #define IDM_FILE_LOADLOCAL          1001
00138 #define IDM_FILE_SAVE               1002
00139 #define IDM_FILE_EXIT               1019
00140
00141 // Draw Menu Command Identifiers.
00142 #define IDM_DRAW_MASTER             1100
00143 #define IDM_DRAW_SLAVE              1101
00144 #define IDM_DRAW_REDRAW             1102
00145 #define IDM_DRAW_ERASE              1103
00146
00147 // PEN Menu Command Identifiers.
00148 #define IDM_PEN_COLOR               1200
00149 #define IDM_PEN_THIN                1201
00150 #define IDM_PEN_MEDIUM              1202
00151 #define IDM_PEN_THICK               1203
00152
00153 // Help Menu Command Identifiers.
00154 #define IDM_HELP_CONTENTS           1900
00155 #define IDM_HELP_TUTORIAL           1901
00156 #define IDM_HELP_TUTSERVER          1902
00157 #define IDM_HELP_TUTMARSH           1903
00158 #define IDM_HELP_READSOURCE         1904
00159 #define IDM_HELP_ABOUT              1905
00160
00161 // Error-related String Identifiers.
00162 #define IDS_COMINITFAILED           2000
00163 #define IDS_APPINITFAILED           2001
00164 #define IDS_OUTOFMEMORY             2002
00165 #define IDS_NOUNICODE               2003
00166 #define IDS_NODCOM                  2004
00167 #define IDS_NOSERVER                2005
00168 #define IDS_NOTIMPLEMENTED          2006
00169
00170 #define IDS_ASSERT_FAIL             2200
00171
00172 // Notice-related String Identifiers.
00173 #define IDS_DRAWING_CHANGED         2300
00174 #define IDS_ASK_SAVE                2301
00175
00176 // Dialog IDs.
00177 #define IDD_LOAD_REMOTE             2500
00178 #define IDC_STATIC_MACHINE          2501
00179 #define IDC_EDIT_MACHINE            2502
00180
00181 #endif
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cbase.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cbase.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CBASE.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 /////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 /////////////////////////////////////////////////////////////////
00019 // CBase::CBase
00020 //
00021 /////////////////////////////////////////////////////////////////
00022 CBase::CBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00023 {
00024   //IUnknown
00025   m_cRef              = 1;
00026
00027   //BackPointers
00028   ASSERT(pCMainWindow || pCMDIChild);
00029   m_pCMDIChild      =  pCMDIChild;
00030   m_pCMainWindow      =  pCMainWindow ? pCMainWindow : pCMDIChild->m_pCMainWindow;
00031
00032   //Common OLE DB Interfaces
00033   m_pIUnknown           = NULL;
00034   m_pISupportErrorInfo      = NULL;
00035   m_pIAggregate         = NULL;
00036   m_pIService           = NULL;
00037
00038   //Data
00039   m_hTreeItem           = NULL;
00040   m_eObjectType         = eObjectType;
00041   m_eBaseClass          = eCBase;
00042   m_dwCLSCTX            = CLSCTX_INPROC_SERVER;
00043
00044   //Parent Info
00045   m_pCParent            = NULL;
00046   m_guidSource          = GUID_NULL;
00047 }
00048
00049
00050 /////////////////////////////////////////////////////////////////
00051 // CBase::~CBase
00052 //
00053 /////////////////////////////////////////////////////////////////
00054 CBase::~CBase()
00055 {
00056   //ReleaseObject should have already been called...
00057   //If you hit this ASSERT put a "ReleaseObject(0)" in the obhjects destructor...
00058
00059   //NOTE:  We can't just call ReleaseObject here since its a virtual function.
00060   //Calling a virtual function would invoke the derived class, which when we are here
00061   //(in the base destructor) the derived class is already garbaged!
00062   ASSERT(m_pIUnknown == NULL);
00063   ASSERT(m_pCParent == NULL);
00064
00065   //Make sure this item is removed from the tree...
00066   CObjTree* pCObjTree = m_pCMainWindow->m_pCMDIObjects->m_pCObjTree;
00067   if(pCObjTree && m_hTreeItem)
00068   {
00069     //NOTE: The object (after this desctructor) is no longer available,
00070     //so make sure that even if the node cannot be removed (child nodes),
00071     //we need to still remove the object reference so it doesn't try and access it anymore...
00072     pCObjTree->RemoveObject(this);
00073     pCObjTree->SetItemParam(m_hTreeItem, NULL);
00074   }
00075 }
00076
00077
00078 /////////////////////////////////////////////////////////////////
00079 // CBase::AddRef
00080 //
00081 /////////////////////////////////////////////////////////////////
00082 STDMETHODIMP_(ULONG)  CBase::AddRef()
00083 {
00084   //AddRef
00085   return ++m_cRef;
00086 }
00087
00088
00089 /////////////////////////////////////////////////////////////////
00090 // CBase::Release
00091 //
00092 /////////////////////////////////////////////////////////////////
00093 STDMETHODIMP_(ULONG)  CBase::Release()
00094 {
00095   //NOTE: The only thing that we have to be careful with is that our objects are refcounted,
00096   //but they contain a pointer to the window, which might have gone away or be going away.
00097   //So if the window is no longer valid, make sure we NULL out our window pointer...
00098   if(m_pCMDIChild && !m_pCMDIChild->m_hWnd)
00099     m_pCMDIChild = NULL;
00100
00101   //Release
00102   if(--m_cRef)
00103     return m_cRef;
00104
00105   delete this;
00106   return 0;
00107 }
00108
00109 /////////////////////////////////////////////////////////////////
00110 // CBase::QueryInterface
00111 //
00112 /////////////////////////////////////////////////////////////////
00113 STDMETHODIMP      CBase::QueryInterface(REFIID riid, LPVOID *ppv)
00114 {
00115   if(!ppv)
00116     return E_INVALIDARG;
00117   *ppv = NULL;
00118
00119   //IUNKNOWN
00120   if(riid == IID_IUnknown)
00121     *ppv = this;
00122
00123   if(*ppv)
00124   {
00125     ((IUnknown*)(*ppv))->AddRef();
00126     return S_OK;
00127   }
00128
00129   return E_NOINTERFACE;
00130 }
00131
00132
00133 /////////////////////////////////////////////////////////////////
00134 // CBase::ObjectAddRef
00135 //
00136 /////////////////////////////////////////////////////////////////
00137 ULONG CBase::ObjectAddRef()
00138 {
00139   //Record the number of times the user has addref'd this object.
00140   //So we can know when to correctly NULL out the interface, so they can longer use it...
00141   AddRef();
00142
00143   //IUnknown::AddRef
00144   return TRACE_ADDREF(m_pIUnknown, GetObjectName());
00145 }
00146
00147
00148 /////////////////////////////////////////////////////////////////
00149 // CBase::ObjectRelease
00150 //
00151 /////////////////////////////////////////////////////////////////
00152 ULONG CBase::ObjectRelease()
00153 {
00154   IUnknown* pIUnknown = m_pIUnknown;
00155   ULONG ulRefCount = 0;
00156
00157   //IUnknown::Release
00158   ulRefCount = CIntTrace::TraceRelease(&pIUnknown, GetObjectName());
00159
00160   //We need to disable this interface once it hits zero so
00161   //its not used incorrectly after the object is released...
00162   if(ulRefCount == 0 || m_cRef<=1)
00163   {
00164     m_pIUnknown = NULL;
00165     ReleaseObject();
00166   }
00167   else
00168   {
00169     Release();
00170   }
00171
00172   return ulRefCount;
00173 }
00174
00175
00176 /////////////////////////////////////////////////////////////////
00177 // HRESULT CBase::SetInterface
00178 //
00179 /////////////////////////////////////////////////////////////////
00180 HRESULT CBase::SetInterface(REFIID riid, IUnknown* pIUnknown)
00181 {
00182   //We need to put the obtained interface in the appropiate member...
00183   if(pIUnknown)
00184   {
00185     //First obtain the correct interface member variable...
00186     IUnknown** ppInterfaceMember = GetInterfaceAddress(riid);
00187     if(!ppInterfaceMember)
00188       return E_NOINTERFACE;
00189
00190     TRACE_RELEASE(*ppInterfaceMember, GetObjectName());
00191     TRACE_ADDREF(pIUnknown, GetObjectName());
00192     *ppInterfaceMember = pIUnknown;
00193   }
00194
00195   return S_OK;
00196 }
00197
00198
00199 /////////////////////////////////////////////////////////////////
00200 // HRESULT CBase::GetInterface
00201 //
00202 /////////////////////////////////////////////////////////////////
00203 IUnknown* CBase::GetInterface(REFIID riid)
00204 {
00205   //Delegate to the derived class...
00206   IUnknown** ppIUnknown = GetInterfaceAddress(riid);
00207   if(ppIUnknown)
00208     return *ppIUnknown;
00209
00210   return NULL;
00211 }
00212
00213
00214 /////////////////////////////////////////////////////////////////
00215 // HRESULT CBase::ObjectQI
00216 //
00217 /////////////////////////////////////////////////////////////////
00218 HRESULT CBase::ObjectQI(REFIID riid, IUnknown** ppIUnknown)
00219 {
00220   HRESULT hr = S_OK;
00221
00222   //IUnknown::QueryInterface
00223   XTESTC(hr = TRACE_QI(m_pIUnknown, riid, ppIUnknown, GetObjectName()));
00224
00225   //We need to put the obtained interface in the appropiate member...
00226   if(ppIUnknown && *ppIUnknown)
00227     hr = SetInterface(riid, *ppIUnknown);
00228
00229 CLEANUP:
00230   return hr;
00231 }
00232
00233
00234 /////////////////////////////////////////////////////////////////
00235 // CBase::ReleaseObject
00236 //
00237 /////////////////////////////////////////////////////////////////
00238 HRESULT CBase::ReleaseObject(ULONG ulExpectedRefCount)
00239 {
00240   //Release Derived interfaces first...
00241   AutoRelease();
00242
00243   //IUnknown
00244   TRACE_RELEASE_(m_pIUnknown, L"IUnknown", ulExpectedRefCount);
00245
00246   //Cleanup when there are no more references
00247   if(ulExpectedRefCount==0)
00248   {
00249     //Remove this object from the tree, unless there is a window associated with it
00250     m_pCMainWindow->m_pCMDIObjects->m_pCObjTree->RemoveObject(this);
00251     m_guidSource    = GUID_NULL;
00252
00253     //Release Parent
00254     SAFE_RELEASE(m_pCParent);
00255   }
00256
00257   return S_OK;
00258 }
00259
00260
00261 /////////////////////////////////////////////////////////////////
00262 // CBase::ReleaseChildren
00263 //
00264 /////////////////////////////////////////////////////////////////
00265 HRESULT CBase::ReleaseChildren()
00266 {
00267   //Make our lives easier...
00268   CObjTree* pCObjTree = m_pCMainWindow->m_pCMDIObjects->m_pCObjTree;
00269
00270   //No-op
00271   if(!m_hTreeItem || !pCObjTree->m_hWnd)
00272     return S_OK;
00273   BOOL bAllRemoved = TRUE;
00274
00275   //Try to obtain the first child...
00276   HTREEITEM hChildItem = pCObjTree->GetChildItem(m_hTreeItem);
00277   while(hChildItem)
00278   {
00279     //NOTE: Before deleting this node of the tree, obtain the
00280     //next sibling (if there is one...).  Since we can't do this after the node has been deleted!
00281     HTREEITEM hNextSibling = pCObjTree->GetNextItem(hChildItem);
00282     CBase* pCChild = (CBase*)pCObjTree->GetItemParam(hChildItem);
00283
00284     if(pCChild)
00285     {
00286       //Make sure all its children are released (recurse)
00287       //If this child cannot be released, we still can continue on to the next child
00288       //(ie: release everything we can - not all or nothing...)
00289       if(SUCCEEDED(pCChild->ReleaseChildren()))
00290       {
00291         //Now we can release this child
00292         pCChild->ReleaseObject();
00293       }
00294     }
00295
00296     //Go to the next sibling...
00297     hChildItem = hNextSibling;
00298   }
00299
00300   return bAllRemoved ? S_OK : E_FAIL;
00301 }
00302
00303
00304 /////////////////////////////////////////////////////////////////
00305 // HRESULT CBase::CreateObject
00306 //
00307 /////////////////////////////////////////////////////////////////
00308 HRESULT CBase::CreateObject(CBase* pCSource, REFIID riid, IUnknown* pIUnkObject, DWORD dwCreateOpts)
00309 {
00310   //No-op...
00311   if(!pIUnkObject)
00312     return E_INVALIDARG;
00313
00314   //Use exsiting Connection
00315   IUnknown* pIUnknown = NULL;
00316
00317   if(dwCreateOpts == -1 /*Default*/)
00318     dwCreateOpts = GetOptions()->m_dwCreateOpts;
00319
00320   HRESULT hr      = S_OK;
00321
00322   //Store the Parent Object...
00323   SAFE_RELEASE(m_pCParent);
00324   SAFE_ADDREF(pCSource);
00325   m_pCParent = pCSource;
00326
00327   //First we QI for IID_IUnknown the object passed in.
00328   //NOTE: We do this before we call ReleaseObject since the caller of this
00329   //method could have passed in our own member variable (m_pIUnknown) to "recreate" the object.
00330   TRACE_QI(pIUnkObject, IID_IUnknown, &pIUnknown, GetObjectName());
00331
00332   //Release all Previous interfaces...
00333   ReleaseObject(1);
00334
00335   //[MANDATORY]
00336   //Used the AddRef'd input as our IUnknown, since all interfaces inherit from IUnknown.
00337   m_pIUnknown = pIUnknown;
00338
00339   //Now set the pointer pased into the appropiate interface member
00340   //NOTE: We already handled IUnknown above...
00341   if(riid != IID_IUnknown)
00342     SetInterface(riid, pIUnkObject);
00343
00344   //Now AutoQI for derived object interfaces...
00345   AutoQI(dwCreateOpts);
00346
00347   //Add this object to the Objects Window
00348   m_pCMainWindow->m_pCMDIObjects->m_pCObjTree->AddObject(pCSource, this);
00349
00350 //CLEANUP:
00351   return hr;
00352 }
00353
00354
00355 /////////////////////////////////////////////////////////////////
00356 // HRESULT CBase::AutoRelease
00357 //
00358 /////////////////////////////////////////////////////////////////
00359 HRESULT CBase::AutoRelease()
00360 {
00361   //Common OLE DB Interface
00362   RELEASE_INTERFACE(ISupportErrorInfo);
00363   RELEASE_INTERFACE(IAggregate);
00364   RELEASE_INTERFACE(IService);
00365   return S_OK;
00366 }
00367
00368
00369 /////////////////////////////////////////////////////////////////
00370 // HRESULT CBase::AutoQI
00371 //
00372 /////////////////////////////////////////////////////////////////
00373 HRESULT CBase::AutoQI(DWORD dwCreateOpts)
00374 {
00375   //[MANDATORY] Obtain [mandatory] interfaces
00376   if(dwCreateOpts & CREATE_QI_MANDATORY)
00377   {
00378   }
00379
00380   //[OPTIONAL]
00381   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00382   {
00383     OBTAIN_INTERFACE(ISupportErrorInfo);
00384     OBTAIN_INTERFACE(IAggregate);
00385     OBTAIN_INTERFACE(IService);
00386   }
00387
00388   return S_OK;
00389 }
00390
00391
00392 /////////////////////////////////////////////////////////////////
00393 // IUnknown** CBase::GetInterfaceAddress
00394 //
00395 /////////////////////////////////////////////////////////////////
00396 IUnknown** CBase::GetInterfaceAddress(REFIID riid)
00397 {
00398   HANDLE_GETINTERFACE(IUnknown);
00399   HANDLE_GETINTERFACE(ISupportErrorInfo);
00400   HANDLE_GETINTERFACE(IAggregate);
00401   HANDLE_GETINTERFACE(IService);
00402
00403   return NULL;
00404 }
00405
00406
00407 /////////////////////////////////////////////////////////////////
00408 // CBase::IsSameObject
00409 //
00410 /////////////////////////////////////////////////////////////////
00411 BOOL CBase::IsSameObject(IUnknown* pIUnkObject)
00412 {
00413   CComPtr<IUnknown> spUnknown = m_pIUnknown;
00414   return spUnknown.IsEqualObject(pIUnkObject);
00415 }
00416
00417
00418 /////////////////////////////////////////////////////////////////
00419 // CBase::GetParent
00420 //
00421 /////////////////////////////////////////////////////////////////
00422 CBase* CBase::GetParent(SOURCE eSource)
00423 {
00424   CBase* pCParent = m_pCParent;
00425
00426   //Try to find the requested parent object type
00427   while(pCParent)
00428   {
00429     //Do we have a match...
00430     if(pCParent->m_eObjectType == eSource)
00431       return pCParent;
00432
00433     //Try the previous parent...
00434     pCParent = pCParent->m_pCParent;
00435   }
00436
00437   return NULL;
00438 }
00439
00440
00441 ////////////////////////////////////////////////////////////////
00442 // CBase::SetObjectDesc
00443 //
00444 /////////////////////////////////////////////////////////////////
00445 void  CBase::SetObjectDesc(WCHAR* pwszObjectDesc, BOOL fCopy)
00446 {
00447   //Optmization:  If the caller no longer needs the name,
00448   //no sense in reallocing, copying, freeing, freeing.  Just reference it...
00449   if(fCopy)
00450   {
00451     m_strObjectDesc.CopyFrom(pwszObjectDesc);
00452   }
00453   else
00454   {
00455     m_strObjectDesc.Attach(pwszObjectDesc);
00456   }
00457
00458   //Update the object in the tree...
00459   if(m_strObjectDesc && m_hTreeItem)
00460     m_pCMainWindow->m_pCMDIObjects->m_pCObjTree->AddObject(NULL, this);
00461 }
00462
00463
00464 ////////////////////////////////////////////////////////////////
00465 // CBase::OnDefOperation
00466 //
00467 /////////////////////////////////////////////////////////////////
00468 void  CBase::OnDefOperation()
00469 {
00470   //The default implementation (unless its overridden)
00471   //Activate the MDIChild window assoicated with this object
00472   if(m_pCMDIChild && m_pCMDIChild->m_hWnd)
00473     m_pCMainWindow->MDIActivate(m_pCMDIChild->m_hWnd);
00474 }
00475
00476
00477 ////////////////////////////////////////////////////////////////
00478 // CBase::DisplayObject
00479 //
00480 /////////////////////////////////////////////////////////////////
00481 HRESULT CBase::DisplayObject()
00482 {
00483   //Update the object in the tree...
00484   if(m_hTreeItem)
00485     m_pCMainWindow->m_pCMDIObjects->m_pCObjTree->AddObject(NULL, this);
00486   return S_OK;
00487 }
00488
00489
00490 ////////////////////////////////////////////////////////////////
00491 // CBase::GetOptions
00492 //
00493 /////////////////////////////////////////////////////////////////
00494 COptionsSheet*  CBase::GetOptions()
00495 {
00496   return m_pCMainWindow->GetOptions();
00497 }
00498
00499
00500 // {CB21F4D6-878D-11d1-9528-00C04FB66A50}
00501 static const IID IID_IAggregate =
00502 { 0xcb21f4d6, 0x878d, 0x11d1, { 0x95, 0x28, 0x0, 0xc0, 0x4f, 0xb6, 0x6a, 0x50 } };
00503
00504
00505 ///////////////////////////////////////////////////////////////////////////////
00506 // CAggregate
00507 //
00508 ///////////////////////////////////////////////////////////////////////////////
00509 CAggregate::CAggregate()
00510 {
00511   m_cRef = 1;
00512 }
00513
00514
00515 ///////////////////////////////////////////////////////////////////////////////
00516 // ~CAggregate
00517 //
00518 ///////////////////////////////////////////////////////////////////////////////
00519 CAggregate::~CAggregate()
00520 {
00521   //COM Aggregation rule #6
00522   //To free an inner pointer (other than IUnknown), the outer object calls its
00523   //own outer unknown's AddRef followed by Release on the inner object's pointer
00524   //Currently we don't have this case, since we only have IUnknown
00525   //AddRef()
00526   //SAFE_RELEASE(m_pNonIUnknownInner);
00527
00528   //Inner object free
00529   ReleaseInner();
00530 }
00531
00532
00533 /////////////////////////////////////////////////////////////////////////////
00534 //  CAggregate::SetInner
00535 //
00536 /////////////////////////////////////////////////////////////////////////////
00537 HRESULT CAggregate::SetInner(IUnknown* pIUnkInner)
00538 {
00539   if(!pIUnkInner)
00540     return E_INVALIDARG;
00541
00542   TRACE_RELEASE(m_spUnkInner.p, L"IUnknown");
00543   return TRACE_QI(pIUnkInner, IID_IUnknown, (IUnknown**)&m_spUnkInner);
00544 }
00545
00546
00547 /////////////////////////////////////////////////////////////////////////////
00548 //  CAggregate::ReleaseInner
00549 //
00550 /////////////////////////////////////////////////////////////////////////////
00551 HRESULT CAggregate::ReleaseInner()
00552 {
00553   //Only release the inner if the RefCount of the outer has gone to its
00554   //orginal refcount
00555   if(m_cRef <= 1)
00556   {
00557     TRACE_RELEASE(m_spUnkInner.p, L"IUnknown");
00558     return S_OK;
00559   }
00560
00561   return S_FALSE;
00562 }
00563
00564
00565 /////////////////////////////////////////////////////////////////////////////
00566 //  CAggregate::HandleAggregation
00567 //
00568 /////////////////////////////////////////////////////////////////////////////
00569 HRESULT CAggregate::HandleAggregation(REFIID riid, IUnknown** ppIUnknown)
00570 {
00571   HRESULT hr = S_OK;
00572   IUnknown* pIUnkInner = ppIUnknown ? *ppIUnknown : NULL;
00573
00574   if(pIUnkInner)
00575   {
00576     //This would be a bug in the provider if aggregaiton succeeded
00577     //but the user didn't request IID_IUnknown.
00578     if(riid != IID_IUnknown)
00579     {
00580       //NOTE:  We don't want to just continue here since this is dangerous.
00581       //If the provider succeeds, this means the outer object was probably returned rather
00582       //than the inner non-delegating IUnknown, this will cause our outer controlling object
00583       //to have a circular QI problem when asked for an inner interface, and will have refcounting
00584       //problems as well.  Might as well let the use know, and don't further this provider bug...
00585       if(IDNO == wMessageBox
00586         (
00587           GetFocus(),
00588           MB_TASKMODAL | MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1,
00589           wsz_ERROR,
00590           L"Provider Bug: Allowed Aggregation and riid!=IID_IUnknown!\n\n"
00591           L"This may crash your Provider...\n"
00592           L"Do you wish to continue anyway?"
00593         ))
00594       {
00595         //return a failure if the user wished not to continue...
00596         TESTC(hr = E_INVALIDARG);
00597       }
00598     }
00599
00600     //We need to "hook" up our objects.  So that our outer controlling object
00601     //has a pointer to the inner for delegating QI calls.  This must be an non-delegating
00602     //inner IUnknown, (see below).  Also the caller of this function will ALWAYS
00603     //release their CAggregate object, and we return a the Aggregate object with our
00604     //reference count.  (consistent with COM, calle never releases callers IUnknown, and
00605     //calle always addref's if they hold onto the callers object).
00606     if(SUCCEEDED(hr = SetInner(pIUnkInner)))
00607     {
00608       //SetInner
00609       TRACE_RELEASE(pIUnkInner, L"IUnknown");
00610       hr = QueryInterface(IID_IUnknown, (void**)ppIUnknown);
00611     }
00612   }
00613
00614 CLEANUP:
00615   return hr;
00616 }
00617
00618
00619 /////////////////////////////////////////////////////////////////////////////
00620 //  CAggregate::AddRef
00621 //
00622 /////////////////////////////////////////////////////////////////////////////
00623 ULONG CAggregate::AddRef(void)
00624 {
00625   return ++m_cRef;
00626 }
00627
00628 /////////////////////////////////////////////////////////////////////////////
00629 //  CAggregate::Release
00630 //
00631 /////////////////////////////////////////////////////////////////////////////
00632 STDMETHODIMP_(ULONG)  CAggregate::Release(void)
00633 {
00634   ASSERT(m_cRef);
00635   if(--m_cRef)
00636     return m_cRef;
00637
00638   //COM Aggregation rule #5
00639   //The outer object must protect its implementation of Release from
00640   //reentrantcy with an artifical reference count arround its destruction code
00641   m_cRef++;
00642
00643   //Delete this object
00644   delete this;
00645   return 0;
00646 }
00647
00648
00649 /////////////////////////////////////////////////////////////////////////////
00650 //  CAggregate::QueryInterface
00651 //
00652 /////////////////////////////////////////////////////////////////////////////
00653 HRESULT CAggregate::QueryInterface(REFIID riid, LPVOID *ppv)
00654 {
00655   HRESULT hr = S_OK;
00656
00657   //TEST_ NULL
00658   if(ppv == NULL)
00659     return E_INVALIDARG;
00660   *ppv = NULL;
00661
00662   //Support IID_IUnknown
00663   if(riid == IID_IUnknown)
00664   {
00665     *ppv = (IUnknown*)this;
00666     SAFE_ADDREF((IUnknown*)*ppv);
00667   }
00668   else if(riid == IID_IAggregate)
00669   {
00670     *ppv = (IUnknown*)this;
00671     SAFE_ADDREF((IUnknown*)*ppv);
00672   }
00673   else if(m_spUnkInner)
00674   {
00675     //Delegate the the Inner Object
00676     //This is not "circular" since this interface is the IID_IUnknown
00677     //interface only, which has its own non-delegating QI...
00678     hr = m_spUnkInner->QueryInterface(riid, ppv);
00679   }
00680   else
00681   {
00682     return E_NOINTERFACE;
00683   }
00684
00685   return hr;
00686 }
00687
00688
00689
00690
00691 /////////////////////////////////////////////////////////////////
00692 // CContainerBase::CContainerBase
00693 //
00694 /////////////////////////////////////////////////////////////////
00695 CContainerBase::CContainerBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00696   : CBase(eObjectType, pCMainWindow, pCMDIChild)
00697 {
00698   //eBaseClass
00699   m_eBaseClass =  BASE_CLASS(m_eBaseClass | eCContainerBase);
00700
00701   //Common OLE DB Interfaces
00702   m_pIConnectionPointContainer  = NULL;
00703 }
00704
00705
00706 /////////////////////////////////////////////////////////////////
00707 // CContainerBase::~CContainerBase
00708 //
00709 /////////////////////////////////////////////////////////////////
00710 CContainerBase::~CContainerBase()
00711 {
00712   ReleaseObject(0);
00713 }
00714
00715
00716 /////////////////////////////////////////////////////////////////
00717 // HRESULT CContainerBase::AutoRelease
00718 //
00719 /////////////////////////////////////////////////////////////////
00720 HRESULT CContainerBase::AutoRelease()
00721 {
00722   //Common OLE DB Interface
00723   RELEASE_INTERFACE(IConnectionPointContainer);
00724
00725   //Delegate
00726   return CBase::AutoRelease();
00727 }
00728
00729
00730 /////////////////////////////////////////////////////////////////
00731 // HRESULT CContainerBase::AutoQI
00732 //
00733 /////////////////////////////////////////////////////////////////
00734 HRESULT CContainerBase::AutoQI(DWORD dwCreateOpts)
00735 {
00736   //Delegate First so we have base interfaces
00737   CBase::AutoQI(dwCreateOpts);
00738
00739   //[MANDATORY] Obtain [mandatory] interfaces
00740   if(dwCreateOpts & CREATE_QI_MANDATORY)
00741   {
00742   }
00743
00744   //[OPTIONAL]
00745   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00746   {
00747     OBTAIN_INTERFACE(IConnectionPointContainer);
00748   }
00749
00750   return S_OK;
00751 }
00752
00753
00754 /////////////////////////////////////////////////////////////////
00755 // IUnknown** CContainerBase::GetInterfaceAddress
00756 //
00757 /////////////////////////////////////////////////////////////////
00758 IUnknown** CContainerBase::GetInterfaceAddress(REFIID riid)
00759 {
00760   HANDLE_GETINTERFACE(IConnectionPointContainer);
00761
00762   //Otherwise delegate
00763   return CBase::GetInterfaceAddress(riid);
00764 }
00765
00766
00767 /////////////////////////////////////////////////////////////////
00768 // HRESULT CContainerBase::FindConnectionPoint
00769 //
00770 /////////////////////////////////////////////////////////////////
00771 HRESULT CContainerBase::FindConnectionPoint(REFIID riid, IConnectionPoint** ppIConnectionPoint)
00772 {
00773   HRESULT hr = S_OK;
00774
00775   if(m_pIConnectionPointContainer)
00776   {
00777     //IConnectionPointContainer::FindConnectionPoint
00778     hr = m_pIConnectionPointContainer->FindConnectionPoint(riid, ppIConnectionPoint);
00779     TESTC(TRACE_METHOD(hr, L"IConnectionPointContainer::FindConnectionPoint(%s, &0x%p)", GetInterfaceName(riid), ppIConnectionPoint ? *ppIConnectionPoint : NULL));
00780   }
00781
00782 CLEANUP:
00783   return hr;
00784 }
00785
00786
00787 /////////////////////////////////////////////////////////////////
00788 // HRESULT CContainerBase::AdviseListener
00789 //
00790 /////////////////////////////////////////////////////////////////
00791 HRESULT CContainerBase::AdviseListener(REFIID riid, DWORD* pdwCookie)
00792 {
00793   HRESULT hr = S_OK;
00794
00795   if(m_pIConnectionPointContainer)
00796   {
00797     if(riid == IID_IDBAsynchNotify)
00798     {
00799       if(GetOptions()->m_dwNotifyOpts & NOTIFY_IDBASYNCHNOTIFY)
00800         hr = m_pCMainWindow->m_pCListener->Advise(this, riid, pdwCookie);
00801     }
00802     else if(riid == IID_IRowsetNotify)
00803     {
00804       if(GetOptions()->m_dwNotifyOpts & NOTIFY_IROWSETNOTIFY)
00805         hr = m_pCMainWindow->m_pCListener->Advise(this, riid, pdwCookie);
00806     }
00807     else if(riid == IID_IRowPositionChange)
00808     {
00809       if(GetOptions()->m_dwNotifyOpts & NOTIFY_IROWPOSITIONCHANGE)
00810         hr = m_pCMainWindow->m_pCListener->Advise(this, riid, pdwCookie);
00811     }
00812     else
00813     {
00814       ASSERT(!"Unhandled Notification Type!");
00815     }
00816   }
00817
00818   return hr;
00819 }
00820
00821
00822 /////////////////////////////////////////////////////////////////
00823 // HRESULT CContainerBase::UnadviseListener
00824 //
00825 /////////////////////////////////////////////////////////////////
00826 HRESULT CContainerBase::UnadviseListener(REFIID riid, DWORD* pdwCookie)
00827 {
00828   ASSERT(pdwCookie);
00829   HRESULT hr = S_OK;
00830
00831   if(m_pIConnectionPointContainer)
00832   {
00833     if(*pdwCookie)
00834       hr = m_pCMainWindow->m_pCListener->Unadvise(this, riid, pdwCookie);
00835   }
00836
00837   return hr;
00838 }
00839
00840
00841
00842
00843
00844 /////////////////////////////////////////////////////////////////
00845 // CConnectionPoint::CConnectionPoint
00846 //
00847 /////////////////////////////////////////////////////////////////
00848 CConnectionPoint::CConnectionPoint(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00849   : CBase(eCConnectionPoint, pCMainWindow, pCMDIChild)
00850 {
00851   //Common OLE DB Interfaces
00852   m_pIConnectionPoint       = NULL;   //Connection interface
00853
00854   //Data
00855   m_dwCookie            = 0;
00856 }
00857
00858
00859 /////////////////////////////////////////////////////////////////
00860 // CConnectionPoint::~CConnectionPoint
00861 //
00862 /////////////////////////////////////////////////////////////////
00863 CConnectionPoint::~CConnectionPoint()
00864 {
00865   ReleaseObject(0);
00866 }
00867
00868
00869 /////////////////////////////////////////////////////////////////
00870 // HRESULT CConnectionPoint::AutoRelease
00871 //
00872 /////////////////////////////////////////////////////////////////
00873 HRESULT CConnectionPoint::AutoRelease()
00874 {
00875   //Common OLE DB Interface
00876   RELEASE_INTERFACE(IConnectionPoint);
00877
00878   //Delegate
00879   return CBase::AutoRelease();
00880 }
00881
00882
00883 /////////////////////////////////////////////////////////////////
00884 // HRESULT CConnectionPoint::AutoQI
00885 //
00886 /////////////////////////////////////////////////////////////////
00887 HRESULT CConnectionPoint::AutoQI(DWORD dwCreateOpts)
00888 {
00889   //Delegate First so we have base interfaces
00890   CBase::AutoQI(dwCreateOpts);
00891
00892   //[MANDATORY] Obtain [mandatory] interfaces
00893   if(dwCreateOpts & CREATE_QI_MANDATORY)
00894   {
00895     OBTAIN_INTERFACE(IConnectionPoint);
00896   }
00897
00898   //[OPTIONAL]
00899   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00900   {
00901   }
00902
00903   return S_OK;
00904 }
00905
00906
00907 /////////////////////////////////////////////////////////////////
00908 // IUnknown** CConnectionPoint::GetInterfaceAddress
00909 //
00910 /////////////////////////////////////////////////////////////////
00911 IUnknown** CConnectionPoint::GetInterfaceAddress(REFIID riid)
00912 {
00913   HANDLE_GETINTERFACE(IConnectionPoint);
00914
00915   //Otherwise delegate
00916   return CBase::GetInterfaceAddress(riid);
00917 }
00918
00919
00920 /////////////////////////////////////////////////////////////////////////////
00921 // CConnectionPoint::GetObjectDesc
00922 //
00923 /////////////////////////////////////////////////////////////////////////////
00924 WCHAR* CConnectionPoint::GetObjectDesc()
00925 {
00926   if(!m_strObjectDesc && m_pIConnectionPoint)
00927   {
00928     IID iid;
00929     if(SUCCEEDED(GetConnectionInterface(&iid)))
00930       m_strObjectDesc.CopyFrom(GetInterfaceName(iid));
00931   }
00932
00933   return m_strObjectDesc;
00934 }
00935
00936
00937 /////////////////////////////////////////////////////////////////
00938 // HRESULT CConnectionPoint::GetConnectionInterface
00939 //
00940 /////////////////////////////////////////////////////////////////
00941 HRESULT CConnectionPoint::GetConnectionInterface(IID* pIID)
00942 {
00943   HRESULT hr = S_OK;
00944
00945   if(m_pIConnectionPoint)
00946   {
00947     hr = m_pIConnectionPoint->GetConnectionInterface(pIID);
00948     TESTC(TRACE_METHOD(hr, L"IConnectionPoint::GetConnectionInterface(&%s)", GetInterfaceName(pIID ? *pIID : IID_NULL)));
00949   }
00950
00951 CLEANUP:
00952   return hr;
00953 }
00954
00955
00956
00957 /////////////////////////////////////////////////////////////////
00958 // CAsynchBase::CAsynchBase
00959 //
00960 /////////////////////////////////////////////////////////////////
00961 CAsynchBase::CAsynchBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00962   : CContainerBase(eObjectType, pCMainWindow, pCMDIChild)
00963 {
00964   //eBaseClass
00965   m_eBaseClass = BASE_CLASS(m_eBaseClass | eCAsynchBase);
00966
00967   //OLE DB Interfaces
00968   m_pIDBInitialize      = NULL;   //OLE DB interface
00969   m_pIDBAsynchStatus      = NULL;   //OLE DB interface
00970
00971   //Extra interfaces
00972   m_dwCookieAsynchNotify    = 0;
00973
00974   //Data
00975   m_fInitialized        = FALSE;
00976 }
00977
00978
00979 /////////////////////////////////////////////////////////////////
00980 // CAsynchBase::~CAsynchBase
00981 //
00982 /////////////////////////////////////////////////////////////////
00983 CAsynchBase::~CAsynchBase()
00984 {
00985 }
00986
00987
00988 /////////////////////////////////////////////////////////////////
00989 // IUnknown** CAsynchBase::GetInterfaceAddress
00990 //
00991 /////////////////////////////////////////////////////////////////
00992 IUnknown** CAsynchBase::GetInterfaceAddress(REFIID riid)
00993 {
00994   HANDLE_GETINTERFACE(IDBInitialize);
00995   HANDLE_GETINTERFACE(IDBAsynchStatus);
00996
00997   //Otherwise delegate
00998   return CContainerBase::GetInterfaceAddress(riid);
00999 }
01000
01001
01002 ////////////////////////////////////////////////////////////////
01003 // CAsynchBase::AutoRelease
01004 //
01005 /////////////////////////////////////////////////////////////////
01006 HRESULT CAsynchBase::AutoRelease()
01007 {
01008   //UnadviseListeners
01009   UnadviseListener(IID_IDBAsynchNotify, &m_dwCookieAsynchNotify);
01010
01011   //OLE DB interfaces
01012   RELEASE_INTERFACE(IDBInitialize);
01013   RELEASE_INTERFACE(IDBAsynchStatus);
01014
01015   //Extra interfaces
01016
01017   //Data
01018   m_fInitialized = FALSE;
01019
01020   //Delegate
01021   return CContainerBase::AutoRelease();
01022 }
01023
01024
01025 /////////////////////////////////////////////////////////////////
01026 // HRESULT CAsynchBase::AutoQI
01027 //
01028 /////////////////////////////////////////////////////////////////
01029 HRESULT CAsynchBase::AutoQI(DWORD dwCreateOpts)
01030 {
01031   //Delegate First so we have base interfaces
01032   CContainerBase::AutoQI(dwCreateOpts);
01033
01034   //[MANDATORY]
01035   if(dwCreateOpts & CREATE_QI_MANDATORY)
01036   {
01037   }
01038
01039   //AutoQI
01040   if(dwCreateOpts & CREATE_QI_OPTIONAL)
01041   {
01042     //[OPTIONAL]
01043     OBTAIN_INTERFACE(IDBInitialize);
01044     OBTAIN_INTERFACE(IDBAsynchStatus);
01045   }
01046
01047   //Listeners
01048   AdviseListener(IID_IDBAsynchNotify, &m_dwCookieAsynchNotify);
01049   return S_OK;
01050 }
01051
01052
01053 /////////////////////////////////////////////////////////////////
01054 // HRESULT CAsynchBase::Initialize
01055 //
01056 /////////////////////////////////////////////////////////////////
01057 HRESULT CAsynchBase::Initialize()
01058 {
01059   HRESULT hr = S_OK;
01060   DWORD dwCreateOpts = GetOptions()->m_dwCreateOpts;
01061
01062   if(!m_pIDBInitialize)
01063     goto CLEANUP;
01064
01065   //Initailize
01066   //NOTE: Expect S_OK or DB_E_CANCELED, since canceling the dialog always returns DB_E_CANCELED
01067   XTEST_(hr = m_pIDBInitialize->Initialize(), DB_E_CANCELED);
01068   TRACE_METHOD(hr, L"IDBInitialize::Initialize()");
01069
01070   //Display any property errors...
01071   TESTC(hr = DisplayPropErrors(hr, IID_IDBProperties, m_pIDBInitialize));
01072
01073   //We are now Initialized
01074   m_fInitialized = TRUE;
01075
01076   //Obtain all interfaces, now that we are initialized
01077   TESTC(hr = AutoQI(dwCreateOpts));
01078
01079   //Also "redraw" the object now that more interfaces are available for use
01080   //For Example: If the rowset was originally obtained Asynchronously and now interfaces
01081   //to obtain columns and data are available, display the object...
01082   TESTC(hr = DisplayObject());
01083
01084 CLEANUP:
01085   return hr;
01086 }
01087
01088
01089 /////////////////////////////////////////////////////////////////
01090 // HRESULT CAsynchBase::Uninitialize
01091 //
01092 /////////////////////////////////////////////////////////////////
01093 HRESULT CAsynchBase::Uninitialize()
01094 {
01095   HRESULT hr = S_OK;
01096
01097   if(!m_pIDBInitialize)
01098     goto CLEANUP;
01099
01100   //Uninitailize
01101   XTEST(hr = m_pIDBInitialize->Uninitialize());
01102   TESTC(TRACE_METHOD(hr, L"IDBInitialize::Uninitialize()"));
01103
01104   //We are now Uninitialized
01105   m_fInitialized = FALSE;
01106
01107 CLEANUP:
01108   return hr;
01109 }
01110
01111
01112
01113 /////////////////////////////////////////////////////////////////
01114 // HRESULT CAsynchBase::Abort
01115 //
01116 /////////////////////////////////////////////////////////////////
01117 HRESULT CAsynchBase::Abort(HCHAPTER hChapter, DBASYNCHOP eOperation)
01118 {
01119   HRESULT hr = S_OK;
01120
01121   if(!m_pIDBAsynchStatus)
01122     goto CLEANUP;
01123
01124   //IDBAsynchStatus::Abort
01125   XTEST(hr = m_pIDBAsynchStatus->Abort(hChapter, eOperation));
01126   TRACE_METHOD(hr, L"IDBAsynchStatus::Abort(0x%p, %s)", hChapter, GetAsynchReason(eOperation));
01127
01128 CLEANUP:
01129   return hr;
01130 }
01131
01132
01133 /////////////////////////////////////////////////////////////////
01134 // HRESULT CAsynchBase::GetStatus
01135 //
01136 /////////////////////////////////////////////////////////////////
01137 HRESULT CAsynchBase::GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM* pulProgress, DBCOUNTITEM* pulProgressMax, DBASYNCHPHASE* peAsynchPhase, LPOLESTR* ppwszStatusText)
01138 {
01139   HRESULT hr = S_OK;
01140
01141   if(!m_pIDBAsynchStatus)
01142     goto CLEANUP;
01143
01144   //IDBAsynchStatus::GetStatus
01145   XTEST(hr = m_pIDBAsynchStatus->GetStatus(hChapter, eOperation, pulProgress, pulProgressMax, peAsynchPhase, ppwszStatusText));
01146   TRACE_METHOD(hr, L"IDBAsynchStatus::GetStatus(0x%p, %s, &%lu, &%lu, &%s, &\"%s\")", hChapter, GetAsynchReason(eOperation), pulProgress ? *pulProgress : 0, pulProgressMax ? *pulProgressMax : 0, GetAsynchPhase(peAsynchPhase ? *peAsynchPhase : 0), ppwszStatusText ? *ppwszStatusText : NULL);
01147
01148 CLEANUP:
01149   return hr;
01150 }
01151
01152
01153 /////////////////////////////////////////////////////////////////
01154 // CPropertiesBase::CPropertiesBase
01155 //
01156 /////////////////////////////////////////////////////////////////
01157 CPropertiesBase::CPropertiesBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
01158   : CAsynchBase(eObjectType, pCMainWindow, pCMDIChild)
01159 {
01160   //eBaseClass
01161   m_eBaseClass = BASE_CLASS(m_eBaseClass | eCPropertiesBase);
01162
01163   //OLE DB Interfaces
01164   m_pIDBProperties      = NULL;   //OLE DB interface
01165 }
01166
01167
01168 /////////////////////////////////////////////////////////////////
01169 // CPropertiesBase::~CPropertiesBase
01170 //
01171 /////////////////////////////////////////////////////////////////
01172 CPropertiesBase::~CPropertiesBase()
01173 {
01174 }
01175
01176
01177 /////////////////////////////////////////////////////////////////
01178 // IUnknown** CPropertiesBase::GetInterfaceAddress
01179 //
01180 /////////////////////////////////////////////////////////////////
01181 IUnknown** CPropertiesBase::GetInterfaceAddress(REFIID riid)
01182 {
01183   HANDLE_GETINTERFACE(IDBProperties);
01184
01185   //Otherwise delegate
01186   return CAsynchBase::GetInterfaceAddress(riid);
01187 }
01188
01189
01190 ////////////////////////////////////////////////////////////////
01191 // CPropertiesBase::AutoRelease
01192 //
01193 /////////////////////////////////////////////////////////////////
01194 HRESULT CPropertiesBase::AutoRelease()
01195 {
01196   //OLE DB interfaces
01197   RELEASE_INTERFACE(IDBProperties);
01198
01199   //Delegate
01200   return CAsynchBase::AutoRelease();
01201 }
01202
01203
01204 /////////////////////////////////////////////////////////////////
01205 // HRESULT CPropertiesBase::AutoQI
01206 //
01207 /////////////////////////////////////////////////////////////////
01208 HRESULT CPropertiesBase::AutoQI(DWORD dwCreateOpts)
01209 {
01210   //Delegate First so we have IConnectionPointContainer
01211   CAsynchBase::AutoQI(dwCreateOpts);
01212
01213   //[MANDATORY]
01214   if(dwCreateOpts & CREATE_QI_MANDATORY)
01215   {
01216     OBTAIN_INTERFACE(IDBProperties);
01217
01218     //NOTE: Since this class inherits from CAsynchBase which already has an IDBInitialize
01219     //pointer we will just use that, but the problem is that in the object its an optional
01220     //interface, and under the DSO its a required interface.  So we just do a QI again
01221     //if the pointer has not already been retrived...
01222     OBTAIN_INTERFACE(IDBInitialize);
01223   }
01224
01225   //AutoQI
01226   if(dwCreateOpts & CREATE_QI_OPTIONAL)
01227   {
01228     //[OPTIONAL]
01229   }
01230
01231   return S_OK;
01232 }
01233
01234
01235 /////////////////////////////////////////////////////////////////
01236 // HRESULT CPropertiesBase::SetProperties
01237 //
01238 /////////////////////////////////////////////////////////////////
01239 HRESULT CPropertiesBase::SetProperties(ULONG cPropSets, DBPROPSET* rgPropSets)
01240 {
01241   HRESULT hr = S_OK;
01242
01243   if(m_pIDBProperties && cPropSets)
01244   {
01245     //SetProperties
01246     XTEST_(hr = m_pIDBProperties->SetProperties(cPropSets, rgPropSets),S_OK);
01247     TRACE_METHOD(hr, L"IDBProperties::SetProperties(%d, 0x%p)", cPropSets, rgPropSets);
01248
01249     //Display any property errors...
01250     TESTC(hr = DisplayPropErrors(hr, cPropSets, rgPropSets));
01251   }
01252
01253 CLEANUP:
01254   return hr;
01255 }
01256
01257
01258
01259
01260
01261 /////////////////////////////////////////////////////////////////
01262 // GuidToSourceType
01263 //
01264 /////////////////////////////////////////////////////////////////
01265 SOURCE GuidToSourceType(REFGUID guidType)
01266 {
01267   if(guidType == DBGUID_ROWSET)
01268     return eCRowset;
01269   else if(guidType == DBGUID_ROW)
01270     return eCRow;
01271   else if(guidType == DBGUID_COMMAND)
01272     return eCCommand;
01273   else if(guidType == DBGUID_SESSION)
01274     return eCSession;
01275   else if(guidType == DBGUID_DSO)
01276     return eCDataSource;
01277   else if(guidType == DBGUID_STREAM)
01278     return eCStream;
01279
01280   return eCUnknown;
01281 }
01282
01283
01284
01285 ////////////////////////////////////////////////////////////////
01286 // DetermineObjectType
01287 //
01288 /////////////////////////////////////////////////////////////////
01289 SOURCE DetermineObjectType(IUnknown* pIUnkObject, SOURCE eSource)
01290 {
01291   //Don't rely upon the caller knowing exactly what the object type is...
01292   //Since many OLE DB methods can return different objects depending upon interface or properties
01293   //requested.  So use the "suggested" type as an optimizing starting point, and if not
01294   //then proceed the hard way to determine exactly what it is...
01295
01296   //Do we need to figure out what type of object this is?
01297   if(!pIUnkObject)
01298     return eCUnknown;
01299
01300   IUnknown* pIUnknown = NULL;
01301   HRESULT hr = E_NOINTERFACE;
01302
01303   //See of the object is what the user's "guess" indicates...
01304   //If it is where done...
01305   switch(eSource)
01306   {
01307     case eCRow:
01308       hr = TRACE_QI(pIUnkObject, IID_IRow, &pIUnknown);
01309       break;
01310
01311     case eCRowset:
01312       hr = TRACE_QI(pIUnkObject, IID_IRowset, &pIUnknown);
01313       break;
01314
01315     case eCCommand:
01316       hr = TRACE_QI(pIUnkObject, IID_ICommand, &pIUnknown);
01317       break;
01318
01319     case eCSession:
01320       hr = TRACE_QI(pIUnkObject, IID_IOpenRowset, &pIUnknown);
01321       break;
01322
01323     case eCMultipleResults:
01324       hr = TRACE_QI(pIUnkObject, IID_IMultipleResults, &pIUnknown);
01325       break;
01326
01327     case eCEnumerator:
01328       hr = TRACE_QI(pIUnkObject, IID_ISourcesRowset, &pIUnknown);
01329       break;
01330
01331     case eCBinder:
01332       hr = TRACE_QI(pIUnkObject, IID_IBindResource, &pIUnknown);
01333       break;
01334
01335     case eCDataSource:
01336       //IDBInitialize is no longer enough to fully indentify wither the object returned
01337       //is a DataSource or not.  Other objects also have these: ie: Enumerator, Binder, etc
01338       if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IDBInitialize, &pIUnknown)))
01339       {
01340         TRACE_RELEASE(pIUnknown, L"IDBInitialize");
01341         hr = TRACE_QI(pIUnkObject, IID_IPersist, &pIUnknown);
01342       }
01343       break;
01344
01345     case eCServiceComp:
01346       hr = TRACE_QI(pIUnkObject, IID_IDataInitialize, &pIUnknown);
01347       break;
01348
01349     case eCDataLinks:
01350       hr = TRACE_QI(pIUnkObject, IID_IDBPromptInitialize, &pIUnknown);
01351       break;
01352
01353     case eCStream:
01354       //Some providers for some reason may not support the inherited ISequentialStream interface
01355       if(FAILED(hr = TRACE_QI(pIUnkObject, IID_ISequentialStream, &pIUnknown)))
01356         hr = TRACE_QI(pIUnkObject, IID_IStream, &pIUnknown);
01357       break;
01358
01359     case eCDataset:
01360       hr = TRACE_QI(pIUnkObject, IID_IMDDataset, &pIUnknown);
01361       break;
01362
01363     case eCRowPosition:
01364       hr = TRACE_QI(pIUnkObject, IID_IRowPosition, &pIUnknown);
01365       break;
01366
01367     case eCTransaction:
01368       hr = TRACE_QI(pIUnkObject, IID_ITransaction, &pIUnknown);
01369       break;
01370
01371     case eCTransactionOptions:
01372       hr = TRACE_QI(pIUnkObject, IID_ITransactionOptions, &pIUnknown);
01373       break;
01374
01375     case eCError:
01376       hr = TRACE_QI(pIUnkObject, IID_IErrorInfo, &pIUnknown);
01377       break;
01378
01379     case eCCustomError:
01380       hr = TRACE_QI(pIUnkObject, IID_ISQLErrorInfo, &pIUnknown);
01381       break;
01382
01383
01384     case eCConnectionPoint:
01385       hr = TRACE_QI(pIUnkObject, IID_IConnectionPoint, &pIUnknown);
01386       break;
01387
01388     default:
01389       hr = E_NOINTERFACE;
01390       break;
01391   };
01392
01393   //If the object doesn't match the users guess we will need to try and determine what it really is...
01394   if(FAILED(hr))
01395   {
01396     //Since many objects support the same interface,
01397     //we need to actually QI for a "unique" interface on that object
01398     //to determine what type of object it really is...
01399     if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IRow, &pIUnknown)))
01400       eSource = eCRow;
01401     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IRowset, &pIUnknown)))
01402       eSource = eCRowset;
01403     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_ICommand, &pIUnknown)))
01404       eSource = eCCommand;
01405     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IOpenRowset, &pIUnknown)))
01406       eSource = eCSession;
01407     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IMultipleResults, &pIUnknown)))
01408       eSource = eCMultipleResults;
01409     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_ISourcesRowset, &pIUnknown)))
01410       eSource = eCEnumerator;
01411     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IBindResource, &pIUnknown)))
01412       eSource = eCBinder;
01413     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IDBProperties, &pIUnknown)))
01414       eSource = eCDataSource;
01415     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IDataInitialize, &pIUnknown)))
01416       eSource = eCServiceComp;
01417     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IDBPromptInitialize, &pIUnknown)))
01418       eSource = eCDataLinks;
01419     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_ISequentialStream, &pIUnknown)) || SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IStream, &pIUnknown)))
01420       eSource = eCStream;
01421     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IMDDataset, &pIUnknown)))
01422       eSource = eCDataset;
01423     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IRowPosition, &pIUnknown)))
01424       eSource = eCRowPosition;
01425     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_ITransaction, &pIUnknown)))
01426       eSource = eCTransaction;
01427     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_ITransactionOptions, &pIUnknown)))
01428       eSource = eCTransactionOptions;
01429     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IErrorInfo, &pIUnknown)))
01430       eSource = eCError;
01431     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_ISQLErrorInfo, &pIUnknown)))
01432       eSource = eCCustomError;
01433     else if(SUCCEEDED(hr = TRACE_QI(pIUnkObject, IID_IConnectionPoint, &pIUnknown)))
01434       eSource = eCConnectionPoint;
01435     else
01436       eSource = eCUnknown;
01437   }
01438
01439   if(SUCCEEDED(hr))
01440     TRACE_RELEASE(pIUnknown, L"IUnknown");
01441   return eSource;
01442 }
01443
01444
01445
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BANDINFOSTRUCT Member List

This is the complete list of members for BANDINFOSTRUCT, including all inherited members.
bGraphics | BANDINFOSTRUCT
bText | BANDINFOSTRUCT
GraphicsRect | BANDINFOSTRUCT
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::ICOMAdminCatalog Member List

This is the complete list of members for comadmin::ICOMAdminCatalog, including all inherited members.
BackupREGDB(String bstrBackupFilePath) | comadmin::ICOMAdminCatalog |
Connect(String bstrConnectString) | comadmin::ICOMAdminCatalog |
ExportApplication(String bstrApplIdOrName, String bstrApplicationFile, int lOptions) | comadmin::ICOMAdminCatalog |
GetCollection(String bstrCollName) | comadmin::ICOMAdminCatalog |
GetCollectionByQuery(String bstrCollName, com.ms.com.SafeArray aQuery) | comadmin::ICOMAdminCatalog |
GetEventClassesForIID(String bstrIID, com.ms.com.SafeArray varCLSIDS, com.ms.com.SafeArray varProgIDs, com.ms.com.SafeArray varDescriptions) | comadmin::ICOMAdminCatalog |
getMajorVersion() | comadmin::ICOMAdminCatalog |
getMinorVersion() | comadmin::ICOMAdminCatalog |
GetMultipleComponentsInfo(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS, com.ms.com.SafeArray varClassNames, com.ms.com.SafeArray varFileFlags, com.ms.com.SafeArray varComponentFlags) | comadmin::ICOMAdminCatalog |
iid | comadmin::ICOMAdminCatalog | [static]
ImportComponent(String bstrApplIdOrName, String bstrCLSIDOrProgId) | comadmin::ICOMAdminCatalog |
InstallApplication(String bstrApplicationFile, String bstrDestinationDirectory, int lOptions, String bstrUserId, String bstrPassword, String bstrRSN) | comadmin::ICOMAdminCatalog |
InstallComponent(String bstrApplIdOrName, String bstrDLL, String bstrTLB, String bstrPSDLL) | comadmin::ICOMAdminCatalog |
InstallEventClass(String bstrApplIdOrName, String bstrDLL, String bstrTLB, String bstrPSDLL) | comadmin::ICOMAdminCatalog |
InstallMultipleComponents(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS) | comadmin::ICOMAdminCatalog |
InstallMultipleEventClasses(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS) | comadmin::ICOMAdminCatalog |
QueryApplicationFile(String bstrApplicationFile, String[] bstrApplicationName, String[] bstrApplicationDescription, boolean[] bHasUsers, boolean[] bIsProxy, com.ms.com.SafeArray varFileNames) | comadmin::ICOMAdminCatalog |
RefreshComponents() | comadmin::ICOMAdminCatalog |
RefreshRouter() | comadmin::ICOMAdminCatalog |
Reserved1() | comadmin::ICOMAdminCatalog |
Reserved2() | comadmin::ICOMAdminCatalog |
RestoreREGDB(String bstrBackupFilePath) | comadmin::ICOMAdminCatalog |
ServiceCheck(int lService) | comadmin::ICOMAdminCatalog |
ShutdownApplication(String bstrApplIdOrName) | comadmin::ICOMAdminCatalog |
StartApplication(String bstrApplIdOrName) | comadmin::ICOMAdminCatalog |
StartRouter() | comadmin::ICOMAdminCatalog |
StopRouter() | comadmin::ICOMAdminCatalog |
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/CustomAuth/CustomAuth.h Source File

  • Web
  • iis
  • ISAPI_6.0
  • CustomAuth

CustomAuth.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: CustomAuth.h
00006
00007 Abstract:
00008
00009     ISAPI extension to demonstrate using a wildcard script
00010     map with HSE_REQ_EXEC_URL to implement a custom forms
00011     based authentication scheme.
00012
00013 Author:
00014
00015     ISAPI developer (Microsoft employee), October 2002
00016
00017 --*/
00018
00019 #ifndef _customauth_h
00020 #define _customauth_h
00021
00022 #define MODULE_NAME                 "CustomAuth"
00023 #define DEFAULT_USE_BUILTIN_LOGON   1
00024 #define DEFAULT_USE_BUILTIN_LOGOFF  1
00025 #define DEFAULT_USE_SSL             0
00026 #define DEFAULT_USE_CLIENT_IP       1
00027 #define DEFAULT_LOGON_URL           "/Logon.htm"
00028 #define DEFAULT_LOGOFF_URL          "/Logoff.htm"
00029 #define DEFAULT_LOGON_SUCCESS_URL   "/"
00030 #define DEFAULT_LOGON_TIMEOUT       1200
00031 #define DEFAULT_LOGON_TYPE          "network_cleartext"
00032 #define DELETE_COOKIE               "CustomAuth=; Path=/; Expires=Tue, 01 Jan 1980 00:01:00 GMT"
00033
00034 //
00035 // Built-in HTML pages
00036 //
00037
00038 #define SERVER_ERROR    \
00039     "<html>\r\n"                                         \
00040     "<head> <title>500 Server Error</title> </head>\r\n" \
00041     "<h1> Server Error </h1>\r\n"                        \
00042     "<hr>\r\n"                                           \
00043     "The server was unable to process your request.\r\n" \
00044     "</html>"
00045
00046 #define LOGON_PAGE      \
00047     "<html>\r\n"                                                        \
00048     "<head><title>Please Log On</title></head>\r\n"                     \
00049     "<h1> Please log on to this server. </h1>\r\n"                      \
00050     "<hr>\r\n"                                                          \
00051     "<form name=\"LogonForm\" action=\"%s/Logon\" method=\"POST\">\r\n" \
00052     "<table border=0 cellspacing=2 cellpadding=0>\r\n"                  \
00053     "  <tr>\r\n"                                                        \
00054     "    <td>User Name:</td>\r\n"                                       \
00055     "    <td><input type=text size=30 name=UserName></td>\r\n"          \
00056     "  </tr>\r\n"                                                       \
00057     "  <tr>\r\n"                                                        \
00058     "    <td>Password:</td>\r\n"                                        \
00059     "    <td><input type=password size=30 name=Password></td>\r\n"      \
00060     "  </tr>\r\n"                                                       \
00061     "</table>\r\n"                                                      \
00062     "<input type=submit value=\"Log On\">\r\n"                          \
00063     "</form>\r\n"                                                       \
00064     "</html>\r\n"
00065
00066 #define LOGOFF_PAGE     \
00067     "<html>\r\n"                                              \
00068     "<head><title>Successfully Logged Off</title></head>\r\n" \
00069     "<h1> Goodbye </h1>\r\n"                                  \
00070     "<hr>\r\n"                                                \
00071     "You have successfully logged off from this server\r\n"   \
00072     "</html>\r\n"
00073
00074 #define REDIRECT_ENTITY \
00075     "<head><title>Document Moved</title></head>\r\n" \
00076     "<body><h1>Object Moved</h1>This document may "  \
00077     "be found <a HREF=\"%s\">here</a></body>"
00078
00079 //
00080 // External globals
00081 //
00082
00083 extern ISAPI_EXTENSION  g_Extension;
00084 extern ISAPI_STRING     g_strIniFile;
00085 extern ISAPI_STRING     g_strLogonUrl;
00086 extern ISAPI_STRING     g_strLogonSuccessUrl;
00087 extern ISAPI_STRING     g_strLogoffUrl;
00088 extern INT              g_LogonTimeoutSeconds;
00089 extern BOOL             g_fFilterInitialized;
00090 extern BOOL             g_fUseBuiltInLogon;
00091 extern BOOL             g_fUseBuiltInLogoff;
00092 extern BOOL             g_fUseSSLForSubmission;
00093 extern BOOL             g_fUseClientIpForEncryption;
00094 extern DWORD            g_LogonType;
00095
00096 #endif  // _customauth_h
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStaticEntity Member List

This is the complete list of members for CStaticEntity, including all inherited members.
DECLARE_FIXED_ALLOC(CStaticEntity) CStaticEntity [private]
Generated on Wed Nov 13 2024 16:57:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Sample::Sample Member List

This is the complete list of members for Sample::Sample, including all inherited members.
checkValidity(uint pChainContext) | Sample::Sample | [inline, static]
displayChain(uint pChainContext) | Sample::Sample | [inline, static]
displayHelp() | Sample::Sample | [inline, static]
getChainFromStore(uint pStoreContext, int index) | Sample::Sample | [inline, static]
Main(string[] args) | Sample::Sample | [inline, static]
Main() | Sample::Sample | [inline, static]
openStore(String szStoreName) | Sample::Sample | [inline, static]
showChains(uint pStoreContext) | Sample::Sample | [inline, static]
Generated on Wed Nov 13 2024 16:58:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/compdata.h Source File

  • SysMgmt
  • MMC
  • Nodes

compdata.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024 #include "StatNode.h"
00025 #include "Comp.h"
00026
00027 class CComponentData : public IComponentData
00028 {
00029     friend class CComponent;
00030
00031 private:
00032     ULONG       m_cref;
00033     LPCONSOLE     m_ipConsole;
00034     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00035
00036     CStaticNode     *m_pStaticNode;
00037
00038 public:
00039     CComponentData();
00040     ~CComponentData();
00041
00042     ///////////////////////////////
00043     // Interface IUnknown
00044     ///////////////////////////////
00045     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00046     STDMETHODIMP_(ULONG) AddRef();
00047     STDMETHODIMP_(ULONG) Release();
00048
00049     ///////////////////////////////
00050     // Interface IComponentData
00051     ///////////////////////////////
00052     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00053         /* [in] */ LPUNKNOWN pUnknown);
00054
00055         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00056         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00057
00058         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00059         /* [in] */ LPDATAOBJECT lpDataObject,
00060         /* [in] */ MMC_NOTIFY_TYPE event,
00061         /* [in] */ LPARAM arg,
00062         /* [in] */ LPARAM param);
00063
00064         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00065
00066     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00067         /* [in] */ MMC_COOKIE cookie,
00068         /* [in] */ DATA_OBJECT_TYPES type,
00069         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00070
00071         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00072         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00073
00074         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00075         /* [in] */ LPDATAOBJECT lpDataObjectA,
00076         /* [in] */ LPDATAOBJECT lpDataObjectB);
00077 };
00078
00079 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/irowiden.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

irowiden.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module IROWIDEN.CPP | IRowsetIdentity interface implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012
00013 #include "headers.h"
00014
00015 // Code ----------------------------------------------------------------------
00016
00017 //  IRowsetIdentity specific interface methods
00018
00019 // CImpIRowsetIdentity::IsSameRow --------------------------------------------------
00020 //
00021 // @mfunc Compares two row handles to see if they refer to the same row instance.
00022 //
00023 // @rdesc HRESULT
00024 //      @flag S_FALSE                | Method Succeeded but did not refer to the same row
00025 //      @flag S_OK           | Method Succeeded
00026 //      @flag DB_E_BADROWHANDLE      | Invalid row handle given
00027 //      @flag OTHER                  | Other HRESULTs returned by called functions
00028 //
00029 STDMETHODIMP CImpIRowsetIdentity::IsSameRow
00030 (
00031   HROW hThisRow,  //@parm IN | The handle of an active row
00032   HROW hThatRow //@parm IN | The handle of an active row
00033 )
00034 {
00035   //
00036   // Asserts
00037     //
00038   assert(m_pObj);
00039   assert(m_pObj->m_prowbitsIBuffer);
00040   assert(m_pObj->m_pFileio);
00041
00042     //
00043   // Check validity of input handles
00044     //
00045   if( m_pObj->m_prowbitsIBuffer->IsSlotSet((ULONG)hThisRow) != S_OK ||
00046     m_pObj->m_prowbitsIBuffer->IsSlotSet((ULONG)hThatRow) != S_OK )
00047     return (DB_E_BADROWHANDLE);
00048
00049     //
00050   // Obtain a pointers to corresponding row buffers.
00051     //
00052   PROWBUFF prowbuffThis = m_pObj->GetRowBuff((DBCOUNTITEM)hThisRow, TRUE);
00053   PROWBUFF prowbuffThat = m_pObj->GetRowBuff((DBCOUNTITEM)hThatRow, TRUE);
00054
00055     //
00056   // Check to see if the row is Deleted
00057     //
00058   if( m_pObj->m_pFileio->IsDeleted((DBBKMARK) prowbuffThis->pbBmk) == S_OK ||
00059     m_pObj->m_pFileio->IsDeleted((DBBKMARK) prowbuffThat->pbBmk) == S_OK )
00060     return (DB_E_DELETEDROW);
00061
00062     //
00063   // Check for a released row handle (most likely).
00064     //
00065   return (hThisRow == hThatRow) ? S_OK : S_FALSE;
00066 }
00067
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_PACKET Member List

This is the complete list of members for _PACKET, including all inherited members.
ipSource | _PACKET
oOverlapped | _PACKET
rgbyBuffer | _PACKET
wsaBuffer | _PACKET
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FILE_CONTEXT_TYPE Member List

This is the complete list of members for FILE_CONTEXT_TYPE, including all inherited members.
achFile | FILE_CONTEXT_TYPE
EOFCheck | FILE_CONTEXT_TYPE
hFile | FILE_CONTEXT_TYPE
hFile | FILE_CONTEXT_TYPE
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAboutDlg Member List

This is the complete list of members for CAboutDlg, including all inherited members.
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CAboutDlg() | CAboutDlg |
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CAboutDlg | [protected, virtual]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [virtual]
IDD enum value | CAboutDlg |
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnCancel() | CDialogLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnEasterEgg() | CAboutDlg | [protected]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | CAboutDlg | [protected, virtual]
OnInitDialog() | CAboutDlg | [virtual]
OnInitDialog() | CAboutDlg | [protected, virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CDialogLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CDialogLite() | CDialogLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/ClassProv/Sample.h Source File

  • SysMgmt
  • WMI
  • VC
  • ClassProv

Sample.h

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  sample.h
00006
00007 //
00008
00009 //  Module: WINMGMT class provider sample code
00010
00011 //
00012
00013 //  Purpose: Genral purpose include file.
00014
00015 //
00016
00017 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00018 //
00019 //***************************************************************************
00020
00021 #ifndef _sample_H_
00022 #define _sample_H_
00023
00024 #include <wbemprov.h>
00025
00026 typedef LPVOID * PPVOID;
00027
00028 // Provider interfaces are provided by objects of this class
00029
00030 class CClassPro : public IWbemServices, public IWbemProviderInit
00031     {
00032     protected:
00033         ULONG              m_cRef;         //Object reference count
00034         IWbemServices *  m_pNamespace;
00035      public:
00036         CClassPro(BSTR ObjectPath = NULL, BSTR User = NULL, BSTR Password = NULL, IWbemContext * pCtx=NULL);
00037         ~CClassPro(void);
00038
00039         //Non-delegating object IUnknown
00040
00041         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00042         STDMETHODIMP_(ULONG) AddRef(void);
00043         STDMETHODIMP_(ULONG) Release(void);
00044
00045                 //IWbemProviderInit
00046
00047         HRESULT STDMETHODCALLTYPE Initialize(
00048              /* [in] */ LPWSTR pszUser,
00049              /* [in] */ LONG lFlags,
00050              /* [in] */ LPWSTR pszNamespace,
00051              /* [in] */ LPWSTR pszLocale,
00052              /* [in] */ IWbemServices *pNamespace,
00053              /* [in] */ IWbemContext *pCtx,
00054              /* [in] */ IWbemProviderInitSink *pInitSink
00055                         );
00056
00057         SCODE GetByPath( BSTR Path, IWbemClassObject FAR* FAR* pObj, IWbemContext  *pCtx);
00058
00059         //IWbemServices
00060
00061       HRESULT STDMETHODCALLTYPE OpenNamespace(
00062             /* [in] */ const BSTR Namespace,
00063             /* [in] */ long lFlags,
00064             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00065             /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
00066             /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) {return WBEM_E_NOT_SUPPORTED;};
00067
00068         HRESULT STDMETHODCALLTYPE CancelAsyncCall(
00069             /* [in] */ IWbemObjectSink __RPC_FAR *pSink) {return WBEM_E_NOT_SUPPORTED;};
00070
00071         HRESULT STDMETHODCALLTYPE QueryObjectSink(
00072             /* [in] */ long lFlags,
00073             /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
00074
00075         HRESULT STDMETHODCALLTYPE GetObject(
00076             /* [in] */ const BSTR ObjectPath,
00077             /* [in] */ long lFlags,
00078             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00079             /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
00080             /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
00081
00082         HRESULT STDMETHODCALLTYPE GetObjectAsync(
00083             /* [in] */ const BSTR ObjectPath,
00084             /* [in] */ long lFlags,
00085             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00086             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
00087
00088         HRESULT STDMETHODCALLTYPE PutClass(
00089             /* [in] */ IWbemClassObject __RPC_FAR *pObject,
00090             /* [in] */ long lFlags,
00091             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00092             /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
00093
00094         HRESULT STDMETHODCALLTYPE PutClassAsync(
00095             /* [in] */ IWbemClassObject __RPC_FAR *pObject,
00096             /* [in] */ long lFlags,
00097             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00098             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
00099
00100         HRESULT STDMETHODCALLTYPE DeleteClass(
00101             /* [in] */ const BSTR Class,
00102             /* [in] */ long lFlags,
00103             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00104             /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
00105
00106         HRESULT STDMETHODCALLTYPE DeleteClassAsync(
00107             /* [in] */ const BSTR Class,
00108             /* [in] */ long lFlags,
00109             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00110             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
00111
00112         HRESULT STDMETHODCALLTYPE CreateClassEnum(
00113             /* [in] */ const BSTR Superclass,
00114             /* [in] */ long lFlags,
00115             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00116             /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
00117
00118         HRESULT STDMETHODCALLTYPE CreateClassEnumAsync(
00119             /* [in] */ const BSTR Superclass,
00120             /* [in] */ long lFlags,
00121             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00122             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
00123
00124         HRESULT STDMETHODCALLTYPE PutInstance(
00125             /* [in] */ IWbemClassObject __RPC_FAR *pInst,
00126             /* [in] */ long lFlags,
00127             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00128             /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
00129
00130         HRESULT STDMETHODCALLTYPE PutInstanceAsync(
00131             /* [in] */ IWbemClassObject __RPC_FAR *pInst,
00132             /* [in] */ long lFlags,
00133             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00134             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
00135
00136         HRESULT STDMETHODCALLTYPE DeleteInstance(
00137             /* [in] */ const BSTR ObjectPath,
00138             /* [in] */ long lFlags,
00139             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00140             /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
00141
00142         HRESULT STDMETHODCALLTYPE DeleteInstanceAsync(
00143             /* [in] */ const BSTR ObjectPath,
00144             /* [in] */ long lFlags,
00145             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00146             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
00147
00148         HRESULT STDMETHODCALLTYPE CreateInstanceEnum(
00149             /* [in] */ const BSTR Class,
00150             /* [in] */ long lFlags,
00151             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00152             /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
00153
00154         HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync(
00155             /* [in] */ const BSTR Class,
00156             /* [in] */ long lFlags,
00157             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00158             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
00159
00160         HRESULT STDMETHODCALLTYPE ExecQuery(
00161             /* [in] */ const BSTR QueryLanguage,
00162             /* [in] */ const BSTR Query,
00163             /* [in] */ long lFlags,
00164             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00165             /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
00166
00167         HRESULT STDMETHODCALLTYPE ExecQueryAsync(
00168             /* [in] */ const BSTR QueryLanguage,
00169             /* [in] */ const BSTR Query,
00170             /* [in] */ long lFlags,
00171             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00172             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
00173
00174         HRESULT STDMETHODCALLTYPE ExecNotificationQuery(
00175             /* [in] */ const BSTR QueryLanguage,
00176             /* [in] */ const BSTR Query,
00177             /* [in] */ long lFlags,
00178             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00179             /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
00180
00181         HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync(
00182             /* [in] */ const BSTR QueryLanguage,
00183             /* [in] */ const BSTR Query,
00184             /* [in] */ long lFlags,
00185             /* [in] */ IWbemContext __RPC_FAR *pCtx,
00186             /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
00187
00188         HRESULT STDMETHODCALLTYPE ExecMethod( const BSTR, const BSTR, long, IWbemContext*,
00189             IWbemClassObject*, IWbemClassObject**, IWbemCallResult**) {return WBEM_E_NOT_SUPPORTED;}
00190
00191         HRESULT STDMETHODCALLTYPE ExecMethodAsync( const BSTR, const BSTR, long,
00192             IWbemContext*, IWbemClassObject*, IWbemObjectSink*) {return WBEM_E_NOT_SUPPORTED;}
00193
00194 };
00195
00196 typedef CClassPro *PCClassPro;
00197
00198 // This class is the class factory for CClassPro objects.
00199
00200 class CProvFactory : public IClassFactory
00201     {
00202     protected:
00203         ULONG           m_cRef;
00204
00205     public:
00206         CProvFactory(void);
00207         ~CProvFactory(void);
00208
00209         //IUnknown members
00210         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00211         STDMETHODIMP_(ULONG) AddRef(void);
00212         STDMETHODIMP_(ULONG) Release(void);
00213
00214         //IClassFactory members
00215         STDMETHODIMP         CreateInstance(LPUNKNOWN, REFIID
00216                                  , PPVOID);
00217         STDMETHODIMP         LockServer(BOOL);
00218     };
00219
00220 typedef CProvFactory *PCProvFactory;
00221
00222
00223
00224 // These variables keep track of when the module can be unloaded
00225
00226 extern long       g_cObj;
00227 extern long       g_cLock;
00228
00229 // General purpose utilities.
00230
00231
00232 SCODE CreateInst( IWbemServices * pNamespace, LPWSTR pKey, long lVal,
00233                                              IWbemClassObject ** pNewInst,
00234                                              WCHAR * pwcClassName,
00235                        IWbemContext  *pCtx);
00236 SCODE CreateClass( IWbemServices * pNamespace, IWbemClassObject ** pNewInst,
00237                                              WCHAR * pwcClassName,
00238                        IWbemContext  *pCtx);
00239
00240 typedef struct {
00241    WCHAR * pwcKey;
00242    long lValue;
00243    } InstDef;
00244
00245 extern InstDef MyDefs[];
00246 extern long glNumInst;
00247
00248
00249 #endif
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleFSP/Util.c Source File

  • NetDS
  • fax
  • SampleFSP

Util.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1997 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007   util.c
00008
00009 Abstract:
00010
00011   This module implements utility functions for the fax service provider
00012
00013 --*/
00014
00015 #include "newfsp.h"
00016
00017 BOOL
00018 OpenLogFile(
00019     BOOL    bLoggingEnabled,
00020     LPWSTR  lpszLoggingDirectory
00021 )
00022 /*++
00023
00024 Routine Description:
00025
00026   Open the log file
00027
00028 Arguments:
00029
00030   bLoggingEnabled - indicates if logging is enabled
00031   lpszLoggingDirectory - indicates the logging directory
00032   pDeviceInfo - pointer to the virtual fax devices
00033
00034 Return Value:
00035
00036   TRUE on success
00037
00038 --*/
00039 {
00040     // szLoggingFilename is the logging file name
00041     WCHAR  szLoggingFilename[MAX_PATH]={0};
00042     // cUnicodeBOM is the Unicode BOM
00043     WCHAR  cUnicodeBOM = 0xFEFF;
00044     DWORD  dwSize;
00045
00046     if (bLoggingEnabled == TRUE) {
00047         // Set the logging file name
00048     if (wcslen(lpszLoggingDirectory) >= (sizeof(szLoggingFilename)/sizeof(szLoggingFilename[0]) - 2 - wcslen(NEWFSP_LOG_FILE))) {
00049       // directory path is too long, consider changing szLoggingFilename size
00050       return FALSE;
00051     }
00052         lstrcpy(szLoggingFilename, lpszLoggingDirectory);
00053         lstrcat(szLoggingFilename, L"\\");
00054         lstrcat(szLoggingFilename, NEWFSP_LOG_FILE);
00055
00056         // Create the new log file
00057         g_hLogFile = CreateFile(szLoggingFilename,
00058                 GENERIC_WRITE,
00059                 FILE_SHARE_READ,
00060                 NULL,
00061                 CREATE_ALWAYS,
00062                 FILE_ATTRIBUTE_NORMAL,
00063                 NULL);
00064         if (g_hLogFile == INVALID_HANDLE_VALUE) {
00065             return FALSE;
00066         }
00067
00068         // Write the Unicode BOM to the log file
00069         WriteFile(g_hLogFile,
00070           &cUnicodeBOM,
00071           sizeof(WCHAR),
00072           &dwSize,
00073           NULL);
00074     }
00075     else {
00076         g_hLogFile = INVALID_HANDLE_VALUE;
00077     }
00078
00079     return TRUE;
00080 }
00081
00082 VOID
00083 CloseLogFile(
00084 )
00085 /*++
00086
00087 Routine Description:
00088
00089   Close the log file
00090
00091 Return Value:
00092
00093   None
00094
00095 --*/
00096 {
00097     if (g_hLogFile != INVALID_HANDLE_VALUE) {
00098         CloseHandle(g_hLogFile);
00099         g_hLogFile = INVALID_HANDLE_VALUE;
00100     }
00101 }
00102
00103 VOID
00104 WriteDebugString(
00105     LPWSTR  lpszFormatString,
00106     ...
00107 )
00108 /*++
00109
00110 Routine Description:
00111
00112   Write a debug string to the debugger and log file
00113
00114 Arguments:
00115
00116   lpszFormatString - pointer to the string
00117
00118 Return Value:
00119
00120   None
00121
00122 --*/
00123 {
00124     va_list     varg_ptr;
00125     SYSTEMTIME  SystemTime;
00126     // szOutputString is the output string
00127     WCHAR       szOutputString[1024] = {0};
00128     DWORD       cb;
00129
00130     // Initialize the buffer
00131     ZeroMemory(szOutputString, sizeof(szOutputString));
00132
00133     // Get the current time
00134     GetLocalTime(&SystemTime);
00135     wsprintf(szOutputString,
00136        L"%02d.%02d.%04d@%02d:%02d:%02d.%03d:\n",
00137        SystemTime.wMonth,
00138        SystemTime.wDay,
00139        SystemTime.wYear,
00140        SystemTime.wHour,
00141        SystemTime.wMinute,
00142        SystemTime.wSecond,
00143        SystemTime.wMilliseconds);
00144
00145     cb = lstrlen(szOutputString);
00146
00147     va_start(varg_ptr, lpszFormatString);
00148     _vsnwprintf(&szOutputString[cb],
00149         (sizeof(szOutputString)/sizeof(szOutputString[0])) - cb -1,
00150         lpszFormatString,
00151         varg_ptr);
00152
00153     // Write the string to the debugger
00154     OutputDebugString(szOutputString);
00155     if (g_hLogFile != INVALID_HANDLE_VALUE) {
00156         // Write the string to the log file
00157         WriteFile(g_hLogFile,
00158           szOutputString,
00159           lstrlen(szOutputString) * sizeof(WCHAR),
00160           &cb,
00161           NULL);
00162     }
00163 }
00164
00165
00166 VOID
00167 PostJobStatus(
00168     HANDLE     CompletionPort,
00169     ULONG_PTR  CompletionKey,
00170     DWORD      StatusId,
00171     DWORD      ErrorCode
00172 )
00173 /*++
00174
00175 Routine Description:
00176
00177   Post a completion packet for a fax service provider fax job status change
00178
00179 Arguments:
00180
00181   CompletionPort - specifies a handle to an I/O completion port
00182   CompletionKey - specifies a completion port key value
00183   StatusId - specifies a fax status code
00184   ErrorCode - specifies one of the Win32 error codes that the fax service provider should use to report an error that occurs
00185
00186 Return Value:
00187
00188   TRUE on success
00189
00190 --*/
00191 {
00192     // pFaxDevStatus is a pointer to the completion packet
00193     PFAX_DEV_STATUS  pFaxDevStatus;
00194
00195     // Allocate a block of memory for the completion packet
00196     pFaxDevStatus = MemAllocMacro(sizeof(FAX_DEV_STATUS));
00197   if (pFaxDevStatus != NULL) {
00198         // Set the completion packet's structure size
00199         pFaxDevStatus->SizeOfStruct = sizeof(FAX_DEV_STATUS);
00200         // Copy the completion packet's fax status identifier
00201         pFaxDevStatus->StatusId = StatusId;
00202         // Set the completion packet's string resource identifier to 0
00203         pFaxDevStatus->StringId = 0;
00204         // Set the completion packet's current page number to 0
00205         pFaxDevStatus->PageCount = 0;
00206         // Set the completion packet's remote fax device identifier to NULL
00207         pFaxDevStatus->CSI = NULL;
00208         // Set the completion packet's calling fax device identifier to NULL
00209         pFaxDevStatus->CallerId = NULL;
00210         // Set the completion packet's routing string to NULL
00211         pFaxDevStatus->RoutingInfo = NULL;
00212         // Copy the completion packet's Win32 error code
00213         pFaxDevStatus->ErrorCode = ErrorCode;
00214
00215         // Post the completion packet
00216         PostQueuedCompletionStatus( CompletionPort,
00217                   sizeof(FAX_DEV_STATUS),
00218                   CompletionKey,
00219                   (LPOVERLAPPED) pFaxDevStatus);
00220     }
00221 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/RecvMDlg.h Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

RecvMDlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // RecvMDlg.h : header file
00013 //
00014
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // CReceiveMessageDialog dialog
00018
00019 class CReceiveMessageDialog : public CDialog
00020 {
00021 // Construction
00022 public:
00023   CReceiveMessageDialog(CArray <ARRAYQ*, ARRAYQ*>*, CWnd* pParent = NULL);   // standard constructor
00024
00025 // Dialog Data
00026   //{{AFX_DATA(CReceiveMessageDialog)
00027   enum { IDD = IDD_RECEIVE_MESSAGE_DIALOG };
00028   CComboBox m_PathNameCB;
00029   CString m_szPathName;
00030   int   m_iTimeout;
00031   DWORD m_dwBodySize;
00032   //}}AFX_DATA
00033
00034   /* pointer to the array with the strings for the combo box (Queues PathName). */
00035   CArray <ARRAYQ*, ARRAYQ*>* m_pStrArray ;
00036
00037 // Overrides
00038   // ClassWizard generated virtual function overrides
00039   //{{AFX_VIRTUAL(CReceiveMessageDialog)
00040   protected:
00041   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00042   //}}AFX_VIRTUAL
00043
00044 // Implementation
00045 protected:
00046
00047   // Generated message map functions
00048   //{{AFX_MSG(CReceiveMessageDialog)
00049   virtual BOOL OnInitDialog();
00050   //}}AFX_MSG
00051   DECLARE_MESSAGE_MAP()
00052
00053 public:
00054
00055   void GetPathName(TCHAR szPathName[BUFFERSIZE])
00056   {
00057     ASSERT(szPathName != NULL);
00058
00059     _tcsncpy (szPathName, m_szPathName, BUFFERSIZE-1);
00060     szPathName[BUFFERSIZE-1] = '\0';
00061
00062   }
00063
00064   DWORD GetTimeout()
00065   {
00066       if (m_iTimeout < 0)
00067       {
00068          m_iTimeout = INFINITE;
00069       }
00070     return (m_iTimeout);
00071   }
00072
00073   DWORD GetBodySize()
00074   {
00075       if (m_dwBodySize == 0)
00076       {
00077          m_dwBodySize = BUFFERSIZE ;
00078       }
00079     return (m_dwBodySize) ;
00080   }
00081
00082 };
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FVProc.Cpp Source File

  • WinUI
  • Shell
  • FileView

FVProc.Cpp

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  PROGRAM:FVPROC.CPP
00009 //
00010 //  PURPOSE:  Window procedures for main window and About box of the
00011 // sample FileViewer for text files.
00012 //
00013 //  PLATFORMS:  Windows 95
00014 //
00015 //  SPECIAL INSTRUCTIONS: N/A
00016 //
00017 //Always include the master FileViewer source include file here.
00018 #include "fileview.h"
00019
00020 //
00021 //   FUNCTION:   FileViewerFrameProc
00022 //
00023 //   PURPOSE:  Standard window procedure for the text file viewer frame window.
00024 //  Processes menu commands, acclerators, and handles resizing of
00025 //  the window
00026 //
00027 LRESULT WINAPI FileViewerFrameProc(HWND hWnd, UINT iMsg, WPARAM wParam
00028     , LPARAM lParam)
00029     {
00030     LONG_PTR        lTemp;
00031     PCFileViewer    pObj;
00032     LPTOOLTIPTEXT   pTTT;
00033
00034     //This is invalid until WM_NCCREATE is called.
00035     pObj=(PCFileViewer)GetWindowLongPtr(hWnd, FVWL_OBJECTPOINTER);
00036
00037     switch (iMsg)
00038         {
00039         case WM_NCCREATE:
00040             //Save the the CFileViewer object pointer we're passed
00041             lTemp=(LONG_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams;
00042             SetWindowLongPtr(hWnd, FVWL_OBJECTPOINTER, lTemp);
00043             return DefWindowProc(hWnd, iMsg, wParam, lParam);
00044
00045         case WM_COMMAND:
00046             pObj->OnCommand(LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
00047             break;
00048
00049         case WM_NOTIFY:
00050              // The toolbar, created with TBSTYLE_TOOLTIPS, will
00051              // send notifications for each button.  lParam will
00052              // be an LPTOOLTIPTEXT in such a case, but even when
00053              // the structure is something different it will always
00054              // have a hdr field of type NMHDR as the first field
00055              // which we use to see if it comes from the toolbar.
00056              // The notification we want is TTN_NEEDTEXT.
00057             pTTT=(LPTOOLTIPTEXT)lParam;
00058
00059             if (NULL==pTTT)
00060                 return 0L;
00061
00062             if (TTN_NEEDTEXT==pTTT->hdr.code)
00063                 pTTT->lpszText=pObj->PszToolTip((UINT)(pTTT->hdr.idFrom));
00064
00065             return 0L;
00066
00067
00068         case WM_CLOSE:
00069             DestroyWindow(hWnd);
00070             break;
00071
00072     case WM_DESTROY:
00073             if (NULL != pObj)
00074             {
00075                 ODSu("FileViewerFrameProc Quit? %u", pObj->m_fPostQuitMsg);
00076                 if (pObj->m_fPostQuitMsg)
00077                     PostQuitMessage(0);
00078                 pObj->m_fPostQuitMsg = TRUE;    // One shot that it did not...
00079
00080                 if (pObj->m_hWnd == hWnd)
00081                     pObj->m_hWnd = NULL;        // Don't try to destroy this again...
00082             }
00083             break;
00084
00085         case WM_SIZE:
00086             //Resize frame tools and viewport
00087             pObj->ChildrenResize();
00088             break;
00089
00090         case WM_MENUSELECT:
00091             //Win32 Parameters are wItem, wFlags, and hMenu
00092             pObj->m_pSH->MenuSelect(LOWORD(wParam)
00093                 , HIWORD(wParam), (HMENU)lParam);
00094             break;
00095
00096         case WM_DROPFILES:
00097             // We have a new file dropped on us so we need to pass this
00098             // information back to the caller of the viewer...
00099             pObj->DropFiles((HDROP)wParam);
00100             break;
00101
00102         default:
00103             return DefWindowProc(hWnd, iMsg, wParam, lParam);
00104         }
00105
00106     return 0L;
00107     }
00108 //
00109 //   FUNCTION:  ViewportWndProc
00110 //
00111 //   PURPOSE: Window procedure for the viewport window.  The viewport in
00112 //  this example just does draws the text into itself using an
00113 //  edit control.
00114 //
00115 //   COMMENTS:
00116 //   This will need to be modified for your file viewer.
00117 //
00118 LRESULT WINAPI ViewportWndProc(HWND hWnd, UINT iMsg, WPARAM wParam
00119     , LPARAM lParam)
00120     {
00121     LONG_PTR        lTemp;
00122     PCFileViewer    pObj;
00123     PAINTSTRUCT     ps;
00124
00125     //This is invalid until WM_NCCREATE is called.
00126     pObj=(PCFileViewer)GetWindowLongPtr(hWnd, VPWL_OBJECTPOINTER);
00127
00128     switch (iMsg)
00129         {
00130         case WM_NCCREATE:
00131             //Save the the CFileViewer object pointer we're passed
00132             lTemp=(LONG_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams;
00133             SetWindowLongPtr(hWnd, VPWL_OBJECTPOINTER, lTemp);
00134             return DefWindowProc(hWnd, iMsg, wParam, lParam);
00135
00136         case WM_PAINT:
00137             BeginPaint(hWnd, &ps);
00138
00139             if (NULL!=pObj->m_hMemText)
00140                 {
00141                 LPSTR       psz;
00142                 RECT        rc;
00143                 HFONT       hFont;
00144
00145                 GetClientRect(hWnd, &rc);
00146
00147                 SetTextColor(ps.hdc, GetSysColor(COLOR_WINDOWTEXT));
00148                 SetBkColor(ps.hdc, GetSysColor(COLOR_WINDOW));
00149                 hFont=(HFONT)SelectObject(ps.hdc, pObj->m_hFont);
00150
00151                 psz=(LPSTR)GlobalLock(pObj->m_hMemText);
00152
00153                  // We can use the client area rectangle here for
00154                  // drawing since we also use DT_NOCLIP, so we'll
00155                  // always draw all over the client area.
00156                 OffsetRect(&rc, -pObj->m_xPos, -pObj->m_yPos);
00157                 DrawText(ps.hdc, psz, -1, &rc, DT_LEFT
00158                     | DT_NOCLIP| DT_EXPANDTABS);
00159
00160                 GlobalUnlock(pObj->m_hMemText);
00161                 SelectObject(ps.hdc, hFont);
00162                 }
00163             EndPaint(hWnd, &ps);
00164             break;
00165
00166         case WM_MOUSEMOVE:
00167              // If this message is already displayed, CStatusHelper
00168              // will just ignore this call and return very fast.
00169             pObj->m_pSH->MessageDisplay(ID_MSGCHOOSEOPEN);
00170             break;
00171
00172         case WM_RBUTTONDOWN:
00173             {
00174             HMENU           hMenu, hMenuRes;
00175             POINT           pt;
00176             UINT            i, cItems;
00177
00178             //Load our context menu.
00179             hMenuRes=LoadMenu(pObj->m_hInst
00180                 , MAKEINTRESOURCE(IDR_MENUVIEWPORT));
00181
00182             if (NULL==hMenuRes)
00183                 break;
00184
00185              // Make a copy popup menu because you cannot
00186              // use a resource-loaded menu with TrackPopupMenu.
00187             cItems=GetMenuItemCount(hMenuRes);
00188             hMenu=CreatePopupMenu();
00189
00190             for (i=0; i < cItems; i++)
00191                 {
00192                 char    szItem[80];
00193                 int     id, uFlags;
00194
00195                 GetMenuString(hMenuRes, i, szItem, sizeof(szItem)
00196                     , MF_BYPOSITION);
00197                 id=GetMenuItemID(hMenuRes, i);
00198
00199                 uFlags=(0==id) ? MF_SEPARATOR : MF_STRING | MF_ENABLED;
00200                 AppendMenu(hMenu, uFlags, id, szItem);
00201                 }
00202
00203             DestroyMenu(hMenuRes);
00204
00205             pt.x=LOWORD(lParam);
00206             pt.y=HIWORD(lParam);
00207             ClientToScreen(hWnd, &pt);
00208
00209             //Messages sent to frame window from this menu.
00210             TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON
00211                 , pt.x, pt.y, 0, pObj->m_hWnd, NULL);
00212
00213             DestroyMenu(hMenu);
00214             }
00215             break;
00216
00217         case WM_HSCROLL:
00218         case WM_VSCROLL:
00219             {
00220             int             iTmp;
00221             UINT            idScroll;
00222             SCROLLINFO      si;
00223
00224             idScroll=(WM_HSCROLL==iMsg) ? SB_HORZ : SB_VERT;
00225
00226             si.cbSize = sizeof(SCROLLINFO);
00227             si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
00228             GetScrollInfo(hWnd, idScroll, &si);
00229
00230             iTmp=si.nPos;
00231
00232             switch (LOWORD(wParam))
00233                 {
00234                 case SB_LINEUP:     si.nPos -= 20;  break;
00235                 case SB_PAGEUP:     si.nPos -=si.nPage;  break;
00236                 case SB_LINEDOWN:   si.nPos += 20;  break;
00237                 case SB_PAGEDOWN:   si.nPos +=si.nPage;  break;
00238
00239                 case SB_THUMBPOSITION:
00240                 case SB_THUMBTRACK:
00241                     si.nPos=HIWORD(wParam);
00242                     break;
00243                 }
00244
00245             si.nPos=max(si.nMin, min(si.nPos, si.nMax));
00246
00247             if (si.nPos!=iTmp)
00248                 {
00249                 //Set the new position and scroll the window
00250                 SetScrollPos(hWnd, idScroll, si.nPos, TRUE);
00251
00252                 if (SB_HORZ==idScroll)
00253                     {
00254                     pObj->m_xPos=si.nPos;
00255                     ScrollWindow(hWnd, iTmp-si.nPos, 0, NULL, NULL);
00256                     }
00257                 else
00258                     {
00259                     pObj->m_yPos=si.nPos;
00260                     ScrollWindow(hWnd, 0, iTmp-si.nPos, NULL, NULL);
00261                     }
00262
00263                 UpdateWindow(hWnd);
00264                 }
00265             }
00266             break;
00267
00268         default:
00269             return DefWindowProc(hWnd, iMsg, wParam, lParam);
00270         }
00271
00272     return 0L;
00273     }
00274 //
00275 //   FUNCTION:  AboutProc
00276 //
00277 //   PURPOSE:  Dialog procedure for the omnipresent About box.
00278 //
00279 BOOL APIENTRY AboutProc(HWND hDlg, UINT iMsg, WPARAM wParam
00280     , LPARAM lParam)
00281     {
00282     switch (iMsg)
00283         {
00284         case WM_INITDIALOG:
00285             return TRUE;
00286
00287         case WM_COMMAND:
00288             switch (LOWORD(wParam))
00289                 {
00290                 case IDOK:
00291                     EndDialog(hDlg, TRUE);
00292                     break;
00293                 }
00294             break;
00295
00296         case WM_CLOSE:
00297             EndDialog(hDlg, FALSE);
00298             break;
00299         }
00300     return FALSE;
00301     }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PRIVCLIPDATA Member List

This is the complete list of members for PRIVCLIPDATA, including all inherited members.
aoffset | PRIVCLIPDATA
cidl | PRIVCLIPDATA
fCut | PRIVCLIPDATA
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpy/Resource.h Source File

  • Com
  • Administration
  • Spy
  • ComSpy

Resource.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define IDS_PROJNAME                    100
00018 #define IDR_ComSpy                      100
00019 #define IDR_SPYCON                      101
00020 #define IDR_MENU1                       201
00021 #define IDI_MAIN                        203
00022 #define ID_LOG                          32768
00023 #define IDM_SELECT_APPLICATIONS         32769
00024 #define IDM_EXIT                        32770
00025 #define ID_SAVE                         32771
00026 #define ID_CHOOSE_LOG_FILE_NAME         32772
00027 #define ID_CLEAR                        32773
00028 #define ID_OPTIONS_GRID_LINES           32774
00029 #define ID_CHOOSEFONT                   32775
00030 #define IDM_ON_TOP                      32776
00031 #define IDM_ABOUT                       32777
00032 #define ID_SHOW_ON_SCREEN               32778
00033 #define ID_SAVE_ON_EXIT                 32779
00034 #define ID_SAVE_NOW                     32780
00035
00036 // Next default values for new objects
00037 //
00038 #ifdef APSTUDIO_INVOKED
00039 #ifndef APSTUDIO_READONLY_SYMBOLS
00040 #define _APS_NEXT_RESOURCE_VALUE        203
00041 #define _APS_NEXT_COMMAND_VALUE         32781
00042 #define _APS_NEXT_CONTROL_VALUE         201
00043 #define _APS_NEXT_SYMED_VALUE           102
00044 #endif
00045 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlGuid.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

HtmlGuid.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       htmlguid.hxx
00006 //
00007 //  Contents:   Declarations of Html properties
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __HTMLGUID_HXX__ )
00012 #define __HTMLGUID_HXX__
00013
00014 extern GUID CLSID_Storage;
00015
00016 extern GUID CLSID_SummaryInformation;
00017 const PID_TITLE = 2;
00018
00019 extern GUID CLSID_HtmlInformation;
00020 const PID_HREF = 2;
00021 const PID_HEADING_1 = 3;
00022 const PID_HEADING_2 = 4;
00023 const PID_HEADING_3 = 5;
00024 const PID_HEADING_4 = 6;
00025 const PID_HEADING_5 = 7;
00026 const PID_HEADING_6 = 8;
00027
00028 #endif // __HTMLGUID_HXX__
00029
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/registry.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

registry.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef __Registry_H__
00015 #define __Registry_H__
00016
00017 #include <tchar.h>
00018
00019 // This function will register a component in the Registry.
00020 // The component calls this function from its DllRegisterServer function.
00021 HRESULT RegisterServer( HMODULE hModule,
00022                         const CLSID& clsid,
00023                         const TCHAR* szFriendlyName) ;
00024
00025 // This function will unregister a component.  Components
00026 // call this function from their DllUnregisterServer function.
00027 HRESULT UnregisterServer( const CLSID& clsid ) ;
00028
00029
00030 // This function will register a Snap-In component.  Components
00031 // call this function from their DllRegisterServer function.
00032 HRESULT RegisterSnapin( const CLSID& clsid,            // Class ID
00033                         const TCHAR* szNameString,     // NameString
00034                         const CLSID& clsidAbout,       // Class Id for About Class
00035                         const BOOL fSupportExtensions = FALSE
00036                       );
00037
00038 HRESULT UnregisterSnapin( const CLSID& clsid );        // Class ID
00039
00040 #endif //__Registry_H__
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/Main.Cpp Source File

  • Web
  • NetMeeting
  • NMFT

Main.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMFT.EXE
00003 //  File:       MAIN.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 //****************************************************************************
00019 //
00020 // Global variables.
00021 //
00022 //****************************************************************************
00023
00024 HINSTANCE ghInst        = NULL;   // Current Instance
00025 HWND      ghwndMain     = NULL;   // Main Window
00026 BOOL      g_fQuiet      = FALSE;  //
00027 TCHAR     g_szFile[MAX_PATH + 1]; //
00028
00029 CONST TCHAR g_szAppClassName[] = TEXT("NMFT Dialog");
00030
00031
00032 //****************************************************************************
00033 //
00034 // BOOL ParseCmdLine(void)
00035 //
00036 //****************************************************************************
00037
00038 BOOL ParseCmdLine(void)
00039 {
00040   LPTSTR pch = ::GetCommandLine();
00041   if (NULL == pch)
00042     return FALSE;
00043
00044   // Work on a copy of the buffer
00045   TCHAR sz[MAX_PATH*2 + 1];
00046
00047   ZeroMemory(sz, MAX_PATH*2 + 1);
00048
00049   lstrcpyn(sz, pch, MAX_PATH*2 + 1);
00050   sz[MAX_PATH*2] = 0;
00051
00052   pch = sz;
00053
00054   BOOL  fInStr  = FALSE;
00055   BOOL  fInName = FALSE;
00056   BOOL  fInApp  = TRUE;
00057   TCHAR ch    = 0;
00058   LPTSTR  lpsz  = NULL;
00059
00060   // walk through the command line, parsing filenames and options
00061   while (_T('\0') != (ch = *pch))
00062   {
00063     switch (ch)
00064     {
00065     case _T('\"'):      // Double quoted filename
00066       fInStr = !fInStr;
00067       if (fInStr)
00068       {
00069         lpsz = CharNext(pch);
00070         break;
00071       }
00072
00073     case _T(' '):       // Space usually terminates a filename
00074       if (fInStr)  // except in a long filename
00075         break;
00076
00077     case _T('\0'):
00078       if (fInApp)
00079       {
00080         // Skip the application name (first string on command line)
00081         fInApp = FALSE;
00082         fInName = FALSE;
00083         lpsz = CharNext(pch);
00084         break;
00085       }
00086
00087       if (!fInName)
00088       {
00089         lpsz = CharNext(pch);
00090         break; // ignore extra whitespace
00091       }
00092
00093       {
00094         LPTSTR pchT = CharNext(pch);
00095         *pch = _T('\0'); // null terminate string
00096         fInName = FALSE;
00097         pch = pchT;
00098         continue; // continue loop
00099       }
00100       break;
00101
00102     case _T('/'):      // Command line option
00103     {
00104       if (fInName || fInStr)
00105         break;
00106
00107       pch = CharNext(pch);
00108       ch = *pch;
00109       if (_T('\0') == ch)
00110         return FALSE;
00111
00112       if ((_T('Q') == ch) || (_T('q') == ch))
00113       {
00114         g_fQuiet = TRUE;
00115       }
00116       // TODO: other options
00117
00118       break;
00119     }
00120
00121     default:        // Normal character
00122       fInName = TRUE;
00123       break;
00124     } /* switch (ch) */
00125
00126     pch = CharNext(pch);
00127   }
00128
00129   if ((NULL == lpsz) || (_T('\0') == *lpsz))
00130     return FALSE;
00131
00132   ZeroMemory(g_szFile, MAX_PATH + 1);
00133   lstrcpyn(g_szFile, lpsz, MAX_PATH + 1);
00134   g_szFile[MAX_PATH] = 0;
00135
00136   return TRUE;
00137 }
00138
00139
00140 //****************************************************************************
00141 //
00142 // BOOL FVerifyFile(void)
00143 //
00144 //****************************************************************************
00145
00146 BOOL FVerifyFile(void)
00147 {
00148   // Check if filename was specified on command line
00149   if (ParseCmdLine())
00150     return TRUE;
00151
00152   // Prompt the user to select a file
00153   if (FGetFileName(g_szFile))
00154     return TRUE;
00155
00156   return FALSE;
00157 }
00158
00159
00160 //****************************************************************************
00161 //
00162 // BOOL FInitMain(void)
00163 //
00164 //****************************************************************************
00165
00166 BOOL FInitMain(void)
00167 {
00168   TCHAR szTitle[MAX_PATH + 1];
00169   WNDCLASS  wc;
00170
00171   ZeroMemory(szTitle, sizeof(TCHAR) * (MAX_PATH + 1));
00172   ZeroMemory(&wc, sizeof(WNDCLASS));
00173
00174   ASSERT(NULL != ghInst);
00175
00176   LoadString(ghInst, IDS_APP_TITLE, szTitle, MAX_PATH);
00177
00178   ZeroMemory(&wc, sizeof(WNDCLASS));
00179
00180   wc.style         = CS_HREDRAW | CS_VREDRAW;
00181   wc.lpfnWndProc   = (WNDPROC)WndProc;
00182   wc.cbClsExtra    = 0;
00183   wc.cbWndExtra    = DLGWINDOWEXTRA;
00184   wc.hInstance     = ghInst;
00185   wc.hIcon         = LoadIcon(ghInst, MAKEINTRESOURCE(ICO_MAIN));
00186   wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00187   wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
00188   wc.lpszMenuName  = MAKEINTRESOURCE(IDM_APP);
00189   wc.lpszClassName = g_szAppClassName;
00190
00191   // Register the window class and return FALSE if unsuccesful.
00192   if (!RegisterClass(&wc))
00193     return FALSE;
00194
00195   ghwndMain = CreateDialog(ghInst, MAKEINTRESOURCE(IDD_PROGRESS), 0, NULL);
00196
00197   if (NULL == ghwndMain)
00198     return FALSE;
00199
00200   if (!FInitNm())
00201   {
00202     // TODO: Display error message
00203     // Unable to initialize, no conference, etc.
00204     return FALSE;
00205   }
00206
00207   if (!FVerifyFile())
00208     return FALSE;
00209
00210   LPTSTR pszFile  = 0;
00211   GetFullPathName(g_szFile, MAX_PATH, g_szFile, &pszFile);
00212
00213   if (!FFileExists(g_szFile))
00214   {
00215     TCHAR szMsg[2 * MAX_PATH + 1];
00216
00217     ZeroMemory(szMsg, (2 * MAX_PATH + 1) * sizeof(TCHAR));
00218
00219     _sntprintf(szMsg, 2 * MAX_PATH, TEXT("Unable to send the file\r\n%s"), g_szFile);
00220     MessageBox(NULL, szMsg, TEXT("NmFt Error"), MB_OK | MB_ICONSTOP);
00221     return FALSE;
00222   }
00223
00224   if (FAILED(SendFile()))
00225     return FALSE;
00226
00227   return TRUE;
00228 }
00229
00230
00231 //****************************************************************************
00232 //
00233 // int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
00234 //
00235 // Main Windows entrypoint
00236 //
00237 //****************************************************************************
00238
00239 #ifdef _DEBUG
00240 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
00241 #else  // _DEBUG
00242 int __cdecl main()
00243 #endif // _DEBUG
00244 {
00245 #ifdef _DEBUG
00246   ghInst = hInstance;
00247 #else
00248   ghInst = ::GetModuleHandle(NULL);
00249 #endif // ! _DEBUG
00250
00251   ZeroMemory(g_szFile, sizeof(TCHAR) * (MAX_PATH + 1));
00252
00253   InitCommonControls();
00254
00255   if (FAILED(CoInitialize(NULL)))
00256     return 0;
00257
00258   if (FInitMain() && !g_fQuiet)
00259   {
00260     MSG  msg;
00261     while (GetMessage(&msg, NULL, 0, 0))
00262     {
00263       TranslateMessage(&msg);
00264       DispatchMessage(&msg);
00265     }
00266   }
00267
00268   FreeNmObjects();
00269     CoUninitialize();
00270
00271 #ifndef DEBUG
00272   ExitProcess(0);
00273 #endif
00274
00275   return 0;
00276 }
00277
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_TRANSMITPACKETSARGS Member List

This is the complete list of members for _TRANSMITPACKETSARGS, including all inherited members.
dwFlags | _TRANSMITPACKETSARGS
lpPacketArray | _TRANSMITPACKETSARGS
nElementCount | _TRANSMITPACKETSARGS
nSendSize | _TRANSMITPACKETSARGS
s | _TRANSMITPACKETSARGS
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/NewsFlash/NewsFlash.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • NewsFlash

NewsFlash.java

Go to the documentation of this file.
00001 import com.ms.wfc.app.*;
00002 import com.ms.wfc.core.*;
00003 import com.ms.wfc.ui.*;
00004 import com.ms.wfc.html.*;
00005 import com.ms.com.Variant;
00006
00007 /**
00008  * This class can take a variable number of parameters on the command
00009  * line. Program execution begins with the main() method. The class
00010  * constructor is not invoked unless an object of type 'Form1' is
00011  * created in the main() method.
00012  */
00013 public class NewsFlash extends Form
00014 {
00015   comadmin.ICOMAdminCatalog admin = null;
00016
00017   public NewsFlash()
00018   {
00019     // Required for Visual J++ Form Designer support
00020     initForm();
00021     ecDllNameFT.setText(helper.sampleConstants.NEW_EVENT_DLL);
00022     initAdminCatlog();
00023   }
00024
00025   /**
00026    * NewsFlash overrides dispose so it can clean up the
00027    * component list.
00028    */
00029   public void dispose()
00030   {
00031     super.dispose();
00032     components.dispose();
00033   }
00034   /**
00035      * Publish the event.
00036      *
00037      * @param       ---
00038      * @return      ---
00039      * @see     Queuing, Monikers, com.ms.win32.Ole32.CoGetObject
00040      **/
00041   private void publishButton_click(Object source, Event e)
00042   {
00043     String              monikerString = null;
00044     newseventclass.INewsEvent   traderObj   = null;
00045
00046     monikerString = "new:" + helper.sampleConstants.EVENT_CLSID;
00047     if(queuedCB.getChecked())
00048     {
00049       monikerString = "queue:/" + monikerString;  // if Queuing is used
00050     }
00051     traderObj = (newseventclass.INewsEvent)(com.ms.win32.Ole32.CoGetObject(monikerString,null,newseventclass.INewsEvent.iid));
00052     traderObj.NewsFlash((double)(System.currentTimeMillis()),symbolTF.getText(),headlineTF.getText(),urlTF.getText()); // Fire a event
00053   }
00054
00055   /**
00056      * Install event class.
00057      *
00058      * @param       ---
00059      * @return      ---
00060      * @see     ComAdmin.IComAdminCatalog
00061      **/
00062   private void installEventButton_click(Object source, Event e)
00063   {
00064     if((installEventButton.getText()).equals("Install"))
00065     {
00066       String ecName = ecDllNameFT.getText();
00067       //Install Event Class.
00068       admin.InstallEventClass(helper.sampleConstants.PUBLISHER_NAME,ecDllNameFT.getText(),"" , "");
00069       if(parallelCB.getChecked())
00070       {
00071         updateCollections(helper.sampleConstants.PARALLEL_FLAG);
00072       }
00073       installEventButton.setText("Uninstall");
00074
00075     }
00076     else //Uninstall the event class.
00077     {
00078       updateCollections(helper.sampleConstants.UNINSTALL_FLAG);
00079       installEventButton.setText("Install");
00080     }
00081   }
00082   /**
00083      * Update the different Collections in Admin catalog.
00084      *
00085      * @param       processFlag   The flag specify whether the object in the collection is required to be added or removed.
00086      * @return      ---
00087      * @see     ComAdmin.IComAdminCatalog
00088      **/
00089   private void updateCollections(boolean processFlag)
00090   {
00091     comadmin.ICatalogCollection   appCollec = null;
00092
00093     appCollec =(comadmin.ICatalogCollection)(admin.GetCollection("Application")); //Get the application collection
00094     appCollec.Populate(); //
00095     checkForApplication(appCollec,processFlag);
00096
00097   }
00098   /**
00099      * Check for whether the given application name is present or not.
00100      *
00101      * @param       appCollec   Collection of Applications
00102      * @param   processFlag   The flag specify whether the object in the collection is required to be added or removed.
00103      * @return      ---
00104      * @see     ComAdmin.IComAdminCatalog , ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00105      **/
00106   private void checkForApplication(comadmin.ICatalogCollection appCollec,boolean processFlag)
00107   {
00108     int               index   = 0;
00109     comadmin.ICatalogCollection   compCollec  = null;
00110
00111     for(index = 0; index < appCollec.getCount(); index++)
00112     {
00113        // Checking for Publisher Application in the collection
00114       if(((((comadmin.ICatalogCollection)(appCollec.getItem(index))).getName()).toString()).equals(helper.sampleConstants.PUBLISHER_NAME))
00115       {
00116         // If the application is present get the collection of components in the application.
00117         compCollec  =(comadmin.ICatalogCollection)(appCollec.GetCollection("Components",((comadmin.ICatalogObject)(appCollec.getItem(index))).getKey()));
00118         compCollec.Populate();
00119         checkForComponent(compCollec , processFlag);
00120         break;
00121       }
00122     }
00123   }
00124
00125   /**
00126      * Check for whether the given component name is present or not in application.
00127      *
00128      * @param       compCollec    Collection of Components in Application
00129      * @param   processFlag   The flag specify whether the object in the collection is required to be added or removed.
00130      * @return      ---
00131      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00132      **/
00133   private void checkForComponent(comadmin.ICatalogCollection compCollec, boolean processFlag)
00134   {
00135     int               index   = 0;
00136     comadmin.ICatalogObject     catalogObj  = null;
00137
00138     for(index = 0 ;index < compCollec.getCount(); index++)
00139     {
00140        //Checking for Event component in the collection
00141       if(((((comadmin.ICatalogObject)(compCollec.getItem(index))).getName()).toString()).equals(helper.sampleConstants.EVENT_NAME))
00142       {
00143         //Checking if event is required to be fired in parallel
00144         if(processFlag == helper.sampleConstants.PARALLEL_FLAG)
00145         {
00146           catalogObj = (comadmin.ICatalogObject)(compCollec.getItem(index));
00147           catalogObj.setValue("FireInParallel",new Variant(true));
00148           compCollec.SaveChanges();
00149           installEventButton.setText("Uninstall");
00150         }
00151         else
00152         {
00153           compCollec.Remove(index);
00154           compCollec.SaveChanges();
00155           installEventButton.setText("Install");
00156         }
00157         break;
00158       }
00159     }
00160   }
00161
00162   /**
00163      * Initialize the admin catalog
00164      *
00165      * @param       ---
00166      * @return      ---
00167      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00168      **/
00169   private void initAdminCatlog()
00170   {
00171     comadmin.ICatalogCollection appCollec = null;
00172     comadmin.ICatalogObject   catalogObj  = null;
00173
00174     try
00175     {
00176       admin   = (comadmin.ICOMAdminCatalog)new comadmin.COMAdminCatalog();
00177       appCollec = (comadmin.ICatalogCollection)(admin.GetCollection("Applications"));
00178       // Checking if application already present.
00179       checkForAppAlreadyInstalled(appCollec);
00180       //Setting the catalog properties
00181       catalogObj  = (comadmin.ICatalogObject)(appCollec.Add());
00182       catalogObj.setValue("Name" , new Variant(helper.sampleConstants.PUBLISHER_NAME));
00183       catalogObj.setValue("Activation" , new Variant(1));
00184       //catalogObj.setValue("QueuingEnabled" ,new  Variant(1));
00185       //catalogObj.setValue("QueueListenerEnabled",new Variant(1));
00186       catalogObj.setValue("Authentication", new Variant(1));
00187       appCollec.SaveChanges();
00188     }
00189     catch(com.ms.com.ComException exp)
00190     {
00191       int hr = exp.getHResult();
00192       System.out.println(exp);
00193     }
00194
00195
00196   }
00197   /**
00198      * Check if application is already present.
00199      *
00200      * @param       appCollec   Collection of  Applications.
00201      * @return      ---
00202      * @see     ComAdmin.IComAdminCatalog, ComAdmin.ICatalogCollection, ComAdmin.ICatalogObject
00203      **/
00204   private void checkForAppAlreadyInstalled(comadmin.ICatalogCollection appCollec)
00205   {
00206
00207     int     index   = 0;
00208
00209     appCollec.Populate();
00210     for(index = 0; index < appCollec.getCount(); index++)
00211     {
00212       Variant v = (((comadmin.ICatalogObject)(appCollec.getItem(index))).getName());
00213       if((v.toString()).equals(helper.sampleConstants.PUBLISHER_NAME))
00214       {
00215         // If application already present then remove the application from the catalog.
00216         appCollec.Remove(index);
00217         appCollec.SaveChanges();
00218         break;
00219       }
00220     }
00221
00222   }
00223
00224   /**
00225    * NOTE: The following code is required by the Visual J++ form
00226    * designer.  It can be modified using the form editor.  Do not
00227    * modify it using the code editor.
00228    */
00229   Container components = new Container();
00230   GroupBox PublishEventBorder = new GroupBox();
00231   GroupBox InstallEventBorder = new GroupBox();
00232   Button publishButton = new Button();
00233   Button installEventButton = new Button();
00234   Label symbolLabel = new Label();
00235   Label urlLabel = new Label();
00236   Label headlineLabel = new Label();
00237   Edit symbolTF = new Edit();
00238   Edit headlineTF = new Edit();
00239   CheckBox queuedCB = new CheckBox();
00240   Edit urlTF = new Edit();
00241   CheckBox parallelCB = new CheckBox();
00242   Label ecDllNameLabel = new Label();
00243   Edit ecDllNameFT = new Edit();
00244
00245   private void initForm()
00246   {
00247     this.setText("NewsFlash");
00248     this.setAutoScaleBaseSize(new Point(5, 13));
00249     this.setClientSize(new Point(555, 430));
00250
00251     PublishEventBorder.setLocation(new Point(24, 24));
00252     PublishEventBorder.setSize(new Point(408, 184));
00253     PublishEventBorder.setTabIndex(0);
00254     PublishEventBorder.setTabStop(false);
00255     PublishEventBorder.setText("Publish News Event");
00256
00257     InstallEventBorder.setLocation(new Point(24, 224));
00258     InstallEventBorder.setSize(new Point(408, 176));
00259     InstallEventBorder.setTabIndex(1);
00260     InstallEventBorder.setTabStop(false);
00261     InstallEventBorder.setText("Instal Event");
00262
00263     publishButton.setLocation(new Point(24, 32));
00264     publishButton.setSize(new Point(112, 32));
00265     publishButton.setTabIndex(0);
00266     publishButton.setText("Publish");
00267     publishButton.addOnClick(new EventHandler(this.publishButton_click));
00268
00269     installEventButton.setLocation(new Point(24, 32));
00270     installEventButton.setSize(new Point(112, 32));
00271     installEventButton.setTabIndex(0);
00272     installEventButton.setText("Install");
00273     installEventButton.addOnClick(new EventHandler(this.installEventButton_click));
00274
00275     symbolLabel.setLocation(new Point(152, 32));
00276     symbolLabel.setSize(new Point(80, 20));
00277     symbolLabel.setTabIndex(1);
00278     symbolLabel.setTabStop(false);
00279     symbolLabel.setText("Symbol");
00280
00281     urlLabel.setLocation(new Point(152, 136));
00282     urlLabel.setSize(new Point(80, 20));
00283     urlLabel.setTabIndex(3);
00284     urlLabel.setTabStop(false);
00285     urlLabel.setText("URL");
00286
00287     headlineLabel.setLocation(new Point(152, 88));
00288     headlineLabel.setSize(new Point(80, 20));
00289     headlineLabel.setTabIndex(2);
00290     headlineLabel.setTabStop(false);
00291     headlineLabel.setText("Headline");
00292
00293     symbolTF.setLocation(new Point(256, 32));
00294     symbolTF.setSize(new Point(144, 20));
00295     symbolTF.setTabIndex(4);
00296     symbolTF.setText("");
00297
00298     headlineTF.setLocation(new Point(256, 88));
00299     headlineTF.setSize(new Point(144, 20));
00300     headlineTF.setTabIndex(5);
00301     headlineTF.setText("");
00302
00303     queuedCB.setLocation(new Point(24, 136));
00304     queuedCB.setSize(new Point(104, 16));
00305     queuedCB.setTabIndex(6);
00306     queuedCB.setText("Queued");
00307
00308     urlTF.setLocation(new Point(256, 136));
00309     urlTF.setSize(new Point(144, 20));
00310     urlTF.setTabIndex(7);
00311     urlTF.setText("");
00312
00313     parallelCB.setLocation(new Point(24, 120));
00314     parallelCB.setSize(new Point(120, 24));
00315     parallelCB.setTabIndex(1);
00316     parallelCB.setText("Parallel");
00317
00318     ecDllNameLabel.setLocation(new Point(152, 40));
00319     ecDllNameLabel.setSize(new Point(96, 24));
00320     ecDllNameLabel.setTabIndex(2);
00321     ecDllNameLabel.setTabStop(false);
00322     ecDllNameLabel.setText("EC DLL Path");
00323
00324     ecDllNameFT.setLocation(new Point(256, 40));
00325     ecDllNameFT.setSize(new Point(144, 20));
00326     ecDllNameFT.setTabIndex(3);
00327     ecDllNameFT.setText("");
00328
00329     this.setNewControls(new Control[] {
00330               InstallEventBorder,
00331               PublishEventBorder});
00332     PublishEventBorder.setNewControls(new Control[] {
00333                       urlTF,
00334                       queuedCB,
00335                       headlineTF,
00336                       symbolTF,
00337                       urlLabel,
00338                       headlineLabel,
00339                       symbolLabel,
00340                       publishButton});
00341     InstallEventBorder.setNewControls(new Control[] {
00342                       ecDllNameFT,
00343                       ecDllNameLabel,
00344                       parallelCB,
00345                       installEventButton});
00346   }
00347
00348   /**
00349    * The main entry point for the application.
00350    *
00351    * @param args Array of parameters passed to the application
00352    * via the command line.
00353    */
00354   public static void main(String args[])
00355   {
00356     Application.run(new NewsFlash());
00357   }
00358 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/MainFrm.h Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

MainFrm.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // MainFrm.h : interface of the CMainFrame class
00013 //
00014
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017
00018 #include "OpenQDlg.h"
00019 class CMainFrame : public CFrameWnd
00020 {
00021 protected: // create from serialization only
00022   CMainFrame();
00023   DECLARE_DYNCREATE(CMainFrame)
00024
00025 // Attributes
00026 public:
00027
00028 // Operations
00029 public:
00030
00031 // Overrides
00032   // ClassWizard generated virtual function overrides
00033   //{{AFX_VIRTUAL(CMainFrame)
00034   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00035   //}}AFX_VIRTUAL
00036
00037 // Implementation
00038 public:
00039   virtual ~CMainFrame();
00040 #ifdef _DEBUG
00041   virtual void AssertValid() const;
00042   virtual void Dump(CDumpContext& dc) const;
00043 #endif
00044
00045 protected:  // control bar embedded members
00046   CStatusBar  m_wndStatusBar;
00047   CToolBar    m_wndToolBar;
00048
00049 // Generated message map functions
00050 protected:
00051   //{{AFX_MSG(CMainFrame)
00052   afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00053   afx_msg void OnApiCreateQueue();
00054   afx_msg void OnApiDeleteQueue();
00055   afx_msg void OnApiOpenQueue();
00056   afx_msg void OnApiCloseQueue();
00057   afx_msg void OnApiSendMessage();
00058   afx_msg void OnApiReceiveMessage();
00059   afx_msg void OnApiLocate();
00060   //}}AFX_MSG
00061   DECLARE_MESSAGE_MAP()
00062
00063 protected:
00064
00065     void OnUpdateFrameTitle(BOOL bAddToTitle);
00066
00067 protected:
00068   //
00069   // An array to hold the pathnames of the queues that were created so far.
00070   //
00071
00072     //
00073     // Holds information about all "located" queues
00074     //
00075   CArray<ARRAYQ*, ARRAYQ*> m_PathNameArray;
00076
00077     //
00078     // Holds information about all "opened" queues
00079     //
00080   CArray<ARRAYQ*, ARRAYQ*> m_OpenedQueuePathNameArray;
00081
00082 public:
00083   BOOL IsFormatName(TCHAR *pszName);
00084
00085   //
00086   // Utility function to display status string based on received msg Class property
00087   //
00088   void ClassToString(unsigned short MsgClass,LPTSTR pszStatus);
00089
00090
00091
00092   //
00093   // functions to manipulate the path names array.
00094   //
00095
00096     //
00097     // Adds a given ARRAYQ pointer to the PathName array.
00098     //
00099   void Add2PathNameArray(ARRAYQ* NewPath) {m_PathNameArray.Add(NewPath);}
00100     //
00101     // Removes an ARRAYQ pointer whose pathname matches
00102     // the given pathname form the PathName array.
00103     //
00104   ARRAYQ* RemoveFromPathNameArray(TCHAR *pszPathFormatName);
00105     //
00106     // Empties the PathName array and frees all allocated memory.
00107     //
00108   void CleanPathNameArray();
00109     //
00110     // Looks for an ARRAYQ pointer whose pathname matches the given one,
00111     // and returns the formatname of that ARRAYQ.
00112     //
00113     BOOL TranslatePathNameToFormatName(TCHAR *pszPathName, TCHAR *pszFormatName);
00114
00115
00116     //
00117     // Prints to screen the pathname of all ARRAYQ's in the PathName array.
00118     //
00119     void DisplayPathNameArray();
00120
00121   //
00122   // functions to manipulate the opened queues path name array.
00123   //
00124
00125     //
00126     // Adds a given ARRAYQ pointer to the Opened Queue PathName array.
00127     //
00128     void Add2OpenedQueuePathNameArray(ARRAYQ* NewPath)
00129                       {m_OpenedQueuePathNameArray.Add(NewPath);}
00130     //
00131     // Removes an ARRAYQ pointer whose pathname matches
00132     // the given pathname form the Opened Queue PathName array.
00133     //
00134   ARRAYQ* RemoveFromOpenedQueuePathNameArray(TCHAR *pszPathName);
00135     //
00136     // Checks if the Opened Queue PathName array is Empty.
00137     //
00138   BOOL IsOpenedQueueArrayEmpty();
00139     //
00140     // Looks for an ARRAYQ pointer whose pathname matches the given one,
00141     // and returns the formatname of that ARRAYQ.
00142     //
00143     //
00144     // Looks for an ARRAYQ pointer whose pathname matches the given one,
00145     // and returns the Queue Handle of that ARRAYQ.
00146     //
00147   BOOL GetQueueHandle(TCHAR *pszPathName, QUEUEHANDLE* phClosedQueueHandle);
00148     //
00149     // Prints to screen the pathname of all ARRAYQ's in the PathName array.
00150     //
00151     void DisplayOpenedQueuePathNameArray();
00152
00153
00154   //
00155   // functions to manipulate both of the queues.
00156   //
00157
00158     //
00159     // Moves an ARRAYQ pointer from the PathName array to the Opened Queue PathName array.
00160     //
00161     void MoveToOpenedQueuePathNameArray(TCHAR *pszPathName,
00162                     TCHAR *pszFormatName,
00163                                                QUEUEHANDLE hQueue, DWORD dwAccess);
00164     //
00165     // Moves an ARRAYQ pointer from the Opened Queue PathName array array to the PathName.
00166     //
00167   void MoveToPathNameArray(TCHAR *pszPathName);
00168     //
00169     // Looks for ARRAYQ's that are found in both arrays
00170     // and removes them from the PathName array.
00171     //
00172     void UpdatePathNameArrays();
00173
00174 };
00175
00176 extern "C" void  PrintToScreen(const TCHAR * Format, ...);
00177 extern CWnd* pMainView;
00178
00179 /////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/ComSyncObject/ComSyncTest.h Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • ComSyncObject

ComSyncTest.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: ComSyncTest.h
00004
00005 Summary: Declaration of the CComSyncTest
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 #ifndef __COMSYNCTEST_H_
00023 #define __COMSYNCTEST_H_
00024
00025 #include "resource.h"       // main symbols
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CComSyncTest
00029 class ATL_NO_VTABLE CComSyncTest :
00030   public CComObjectRootEx<CComMultiThreadModel>,
00031   public CComCoClass<CComSyncTest, &CLSID_ComSyncTest>,
00032   public IDispatchImpl<ISyncTest, &IID_ISyncTest, &LIBID_COMSYNCOBJECTLib>
00033 {
00034 public:
00035   CComSyncTest()
00036   {
00037   }
00038
00039 DECLARE_REGISTRY_RESOURCEID(IDR_COMSYNCTEST)
00040
00041 DECLARE_PROTECT_FINAL_CONSTRUCT()
00042
00043 BEGIN_COM_MAP(CComSyncTest)
00044   COM_INTERFACE_ENTRY(ISyncTest)
00045   COM_INTERFACE_ENTRY(IDispatch)
00046 END_COM_MAP()
00047
00048 // ISyncTest
00049 public:
00050   STDMETHOD(Exercise)(void);
00051 };
00052
00053 #endif //__COMSYNCTEST_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Handles/cxhndl/Cxhndls.c Source File

  • NetDS
  • RPC
  • Handles
  • cxhndl

Cxhndls.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                         cxhndl Example
00005
00006     FILE:       cxhndls.c
00007
00008     USAGE:      cxhndls  -p protocol_sequence
00009                          -e endpoint
00010                          -m max calls
00011                          -n min calls
00012                          -f flag for RpcServerListen
00013
00014     PURPOSE:    Server side of RPC distributed application cxhndl
00015
00016     FUNCTIONS:  main() - registers server as RPC server
00017
00018     COMMENTS:   This distributed application uses a context handle.
00019
00020 ****************************************************************************/
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <ctype.h>
00025 #include "cxhndl.h"    // header file generated by MIDL compiler
00026
00027 #define PURPOSE \
00028 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00029 the [context_handle] attribute. For more information\n\
00030 about this attribute and the RPC API functions, see the\n\
00031 RPC programming guide and reference.\n\n"
00032
00033 void Usage(char * pszProgramName)
00034 {
00035     fprintf(stderr, "%s", PURPOSE);
00036     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00037     fprintf(stderr, " -p protocol_sequence\n");
00038     fprintf(stderr, " -e endpoint\n");
00039     fprintf(stderr, " -m maxcalls\n");
00040     fprintf(stderr, " -n mincalls\n");
00041     fprintf(stderr, " -f flag_wait_op\n");
00042     exit(1);
00043 }
00044
00045 void __cdecl main(int argc, char * argv[])
00046 {
00047     RPC_STATUS status;
00048     unsigned char * pszProtocolSequence = "ncacn_np";
00049     unsigned char * pszSecurity         = NULL;
00050     unsigned char * pszEndpoint         = "\\pipe\\cxhndl";
00051     unsigned int    cMinCalls           = 1;
00052     unsigned int    cMaxCalls           = 20;
00053     unsigned int    fDontWait           = FALSE;
00054     int i;
00055
00056     /* allow the user to override settings with command line switches */
00057     for (i = 1; i < argc; i++) {
00058         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00059             switch (tolower(*(argv[i]+1))) {
00060             case 'p':  // protocol sequence
00061                 pszProtocolSequence = argv[++i];
00062                 break;
00063             case 'e':
00064                 pszEndpoint = argv[++i];
00065                 break;
00066             case 'm':
00067                 cMaxCalls = (unsigned int) atoi(argv[++i]);
00068                 break;
00069             case 'n':
00070                 cMinCalls = (unsigned int) atoi(argv[++i]);
00071                 break;
00072             case 'f':
00073                 fDontWait = (unsigned int) atoi(argv[++i]);
00074                 break;
00075             case 'h':
00076             case '?':
00077             default:
00078                 Usage(argv[0]);
00079             }
00080         }
00081         else
00082             Usage(argv[0]);
00083     }
00084
00085     status = RpcServerUseProtseqEp(pszProtocolSequence,
00086                                    cMaxCalls,
00087                                    pszEndpoint,
00088                                    pszSecurity);  // Security descriptor
00089     printf("RpcServerUseProtseqEp returned 0x%x\n", status);
00090     if (status) {
00091          exit(status);
00092     }
00093
00094     status = RpcServerRegisterIf(cxhndl_ServerIfHandle, // interface to register
00095                                  NULL,   // MgrTypeUuid
00096                                  NULL);  // MgrEpv; null means use default
00097     printf("RpcServerRegisterIf returned 0x%x\n", status);
00098     if (status) {
00099         exit(status);
00100     }
00101
00102     printf("Calling RpcServerListen\n");
00103     status = RpcServerListen(cMinCalls,
00104                              cMaxCalls,
00105                              fDontWait);
00106     printf("RpcServerListen returned: 0x%x\n", status);
00107     if (status) {
00108         exit(status);
00109     }
00110
00111     if (fDontWait) {
00112         printf("Calling RpcMgmtWaitServerListen\n");
00113         status = RpcMgmtWaitServerListen();  //  wait operation
00114         printf("RpcMgmtWaitServerListen returned: 0x%x\n", status);
00115         if (status) {
00116             exit(status);
00117         }
00118     }
00119
00120 } // end main()
00121
00122
00123 /*********************************************************************/
00124 /*                 MIDL allocate and free                            */
00125 /*********************************************************************/
00126
00127 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00128 {
00129     return(malloc(len));
00130 }
00131
00132 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00133 {
00134     free(ptr);
00135 }
00136
00137 /* end file cxhndls.c */
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/globals.h Source File

  • SysMgmt
  • MMC
  • Nodes

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025   #define IDM_BUTTON1    0x100
00026   #define IDM_BUTTON2    0x101
00027
00028   extern HINSTANCE g_hinst;
00029   extern ULONG g_uObjects;
00030
00031   #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032   #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034   // uncomment the following #define to enable message cracking
00035   // #define MMC_CRACK_MESSAGES
00036   void MMCN_Crack(BOOL bComponentData,
00037           IDataObject *pDataObject,
00038           IComponentData *pCompData,
00039           IComponent *pComp,
00040           MMC_NOTIFY_TYPE event,
00041           LPARAM arg,
00042           LPARAM param);
00043 #endif
00044
00045 //=--------------------------------------------------------------------------=
00046 // allocates a temporary buffer that will disappear when it goes out of scope
00047 // NOTE: be careful of that -- make sure you use the string in the same or
00048 // nested scope in which you created this buffer. people should not use this
00049 // class directly.  use the macro(s) below.
00050 //
00051 class TempBuffer {
00052   public:
00053     TempBuffer(ULONG cBytes) {
00054         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00055         m_fHeapAlloc = (cBytes > 120);
00056     }
00057     ~TempBuffer() {
00058         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00059     }
00060     void *GetBuffer() {
00061         return m_pBuf;
00062     }
00063
00064   private:
00065     void *m_pBuf;
00066     // we'll use this temp buffer for small cases.
00067     //
00068     char  m_szTmpBuf[120];
00069     unsigned m_fHeapAlloc:1;
00070 };
00071
00072 //=--------------------------------------------------------------------------=
00073 // string helpers.
00074 //
00075 // given a _TCHAR, copy it into a wide buffer.
00076 // be careful about scoping when using this macro!
00077 //
00078 // how to use the below two macros:
00079 //
00080 //  ...
00081 //  LPTSTR pszT;
00082 //  pszT = MyGetTStringRoutine();
00083 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00084 //  MyUseWideStringRoutine(pwsz);
00085 //  ...
00086 #ifdef UNICODE
00087 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00088     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00089     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00090     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00091     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00092 #else // ANSI
00093 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00094     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00095     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00096     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00097     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00098     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00099 #endif
00100
00101 #ifdef UNICODE
00102 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00103     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00104     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00105     lstrcpyW((LPWSTR)ptrname, tstr)
00106 #else // ANSI
00107 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00108     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00109     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00110     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00111     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00112 #endif
00113
00114 //
00115 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00116 // have to be declared, and no clean up must be done.
00117 //
00118 // * 2 for DBCS handling in below length computation
00119 //
00120 #ifdef UNICODE
00121 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00122     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00123     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00124     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00125     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00126 #else // ANSI
00127 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00128     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00129     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00130     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00131     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00132 #endif
00133
00134 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ADCPROP_ASYNCTHREADPRIORITY_ENUM.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ADCPROP_ASYNCTHREADPRIORITY_ENUM.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: ADCPROP_ASYNCTHREADPRIORITY_ENUM
00019
00020 public class ADCPROP_ASYNCTHREADPRIORITY_ENUM extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adPriorityLowest = 1;
00023   public static final short adPriorityBelowNormal = 2;
00024   public static final short adPriorityNormal = 3;
00025   public static final short adPriorityAboveNormal = 4;
00026   public static final short adPriorityHighest = 5;
00027 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/configentry.c Source File

  • NetDS
  • RRas
  • ip

configentry.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\configurationentry.c
00008
00009 Abstract:
00010
00011     The file contains functions to deal with the configuration entry.
00012
00013 --*/
00014
00015 #include "pchsample.h"
00016 #pragma hdrstop
00017
00018 static
00019 VOID
00020 DisplayEventEntry (
00021     IN  PQUEUE_ENTRY        pqeEntry)
00022 /*++
00023
00024 Routine Description
00025     Displays an EVENT_ENTRY object.
00026
00027 Locks
00028     None
00029
00030 Arguments
00031
00032     pqeEntry            address of the 'leEventQueueLink' field
00033
00034 Return Value
00035     None
00036
00037 --*/
00038 {
00039     EE_Display(CONTAINING_RECORD(pqeEntry, EVENT_ENTRY, qeEventQueueLink));
00040 }
00041
00042
00043
00044 static
00045 VOID
00046 FreeEventEntry (
00047     IN  PQUEUE_ENTRY        pqeEntry)
00048 /*++
00049
00050 Routine Description
00051     Frees an EVENT_ENTRY object.
00052
00053 Locks
00054     None
00055
00056 Arguments
00057
00058     pqeEntry            address of the 'leEventQueueLink' field
00059
00060 Return Value
00061     None
00062
00063 --*/
00064 {
00065     EE_Destroy(CONTAINING_RECORD(pqeEntry, EVENT_ENTRY, qeEventQueueLink));
00066 }
00067
00068
00069
00070 DWORD
00071 EE_Create (
00072     IN  ROUTING_PROTOCOL_EVENTS rpeEvent,
00073     IN  MESSAGE                 mMessage,
00074     OUT PEVENT_ENTRY            *ppeeEventEntry)
00075 /*++
00076
00077 Routine Description
00078     Creates an event entry.
00079
00080 Locks
00081     None
00082
00083 Arguments
00084     rpeEvent
00085     mMessage
00086     ppEventEntry        pointer to the event entry address
00087
00088 Return Value
00089     NO_ERROR            if success
00090     Failure code        o/w
00091
00092 --*/
00093 {
00094     DWORD               dwErr = NO_ERROR;
00095     PEVENT_ENTRY        peeEntry; // scratch
00096
00097     // validate parameters
00098     if (!ppeeEventEntry)
00099         return ERROR_INVALID_PARAMETER;
00100
00101     *ppeeEventEntry = NULL;
00102
00103     // allocate the interface entry structure
00104     MALLOC(&peeEntry, sizeof(EVENT_ENTRY), &dwErr);
00105     if (dwErr != NO_ERROR)
00106         return dwErr;
00107
00108     // initialize various fields
00109     InitializeQueueHead(&(peeEntry->qeEventQueueLink));
00110
00111     peeEntry->rpeEvent = rpeEvent;
00112     peeEntry->mMessage = mMessage;
00113
00114     *ppeeEventEntry = peeEntry;
00115     return dwErr;
00116 }
00117
00118
00119
00120 DWORD
00121 EE_Destroy (
00122     IN  PEVENT_ENTRY            peeEventEntry)
00123 /*++
00124
00125 Routine Description
00126     Destroys an event entry.
00127
00128 Locks
00129     None.
00130
00131 Arguments
00132     peeEventEntry       pointer to the event entry
00133
00134 Return Value
00135     NO_ERROR            always
00136
00137 --*/
00138 {
00139     if (!peeEventEntry)
00140         return NO_ERROR;
00141
00142     FREE(peeEventEntry);
00143
00144     return NO_ERROR;
00145 }
00146
00147
00148
00149 #ifdef DEBUG
00150 DWORD
00151 EE_Display (
00152     IN  PEVENT_ENTRY            peeEventEntry)
00153 /*++
00154
00155 Routine Description
00156     Displays an event entry.
00157
00158 Locks
00159     None.
00160
00161 Arguments
00162     peeEventEntry       pointer to the event entry
00163
00164 Return Value
00165     NO_ERROR            always
00166
00167 --*/
00168 {
00169     if (!peeEventEntry)
00170         return NO_ERROR;
00171
00172     TRACE1(CONFIGURATION,
00173            "Event %u",
00174            peeEventEntry->rpeEvent);
00175
00176     if (peeEventEntry->rpeEvent is SAVE_INTERFACE_CONFIG_INFO)
00177         TRACE1(CONFIGURATION,
00178                "Index %u",
00179                (peeEventEntry->mMessage).InterfaceIndex);
00180
00181     return NO_ERROR;
00182 }
00183 #endif // DEBUG
00184
00185
00186
00187 DWORD
00188 EnqueueEvent(
00189     IN  ROUTING_PROTOCOL_EVENTS rpeEvent,
00190     IN  MESSAGE                 mMessage)
00191 /*++
00192
00193 Routine Description
00194     Queues an event entry in g_ce.lqEventQueue.
00195
00196 Locks
00197     Locks and unlocks the locked queue g_ce.lqEventQueue.
00198
00199 Arguments
00200     rpeEvent
00201     mMessage
00202
00203 Return Value
00204     NO_ERROR            success
00205     Error Code          o/w
00206
00207 --*/
00208 {
00209     DWORD           dwErr = NO_ERROR;
00210     PEVENT_ENTRY    peeEntry = NULL;
00211
00212     dwErr = EE_Create(rpeEvent, mMessage, &peeEntry);
00213     // destroyed in EE_DequeueEvent
00214
00215     if (dwErr is NO_ERROR)
00216     {
00217         ACQUIRE_QUEUE_LOCK(&(g_ce.lqEventQueue));
00218
00219         Enqueue(&(g_ce.lqEventQueue.head), &(peeEntry->qeEventQueueLink));
00220
00221         RELEASE_QUEUE_LOCK(&(g_ce.lqEventQueue));
00222     }
00223
00224     return dwErr;
00225 }
00226
00227
00228
00229 DWORD
00230 DequeueEvent(
00231     OUT ROUTING_PROTOCOL_EVENTS  *prpeEvent,
00232     OUT MESSAGE                  *pmMessage)
00233 /*++
00234
00235 Routine Description
00236     Dequeues an event entry from g_ce.lqEventQueue.
00237
00238 Locks
00239     Locks and unlocks the locked queue g_ce.lqEventQueue.
00240
00241 Arguments
00242     prpeEvent
00243     pmMessage
00244
00245 Return Value
00246     NO_ERROR            success
00247     ERROR_NO_MORE_ITEMS o/w
00248
00249 --*/
00250 {
00251     DWORD           dwErr   = NO_ERROR;
00252     PQUEUE_ENTRY    pqe     = NULL;
00253     PEVENT_ENTRY    pee     = NULL;
00254
00255     ACQUIRE_QUEUE_LOCK(&(g_ce.lqEventQueue));
00256
00257     do                          // breakout loop
00258     {
00259         if (IsQueueEmpty(&(g_ce.lqEventQueue.head)))
00260         {
00261             dwErr = ERROR_NO_MORE_ITEMS;
00262             TRACE0(CONFIGURATION, "Error no events in the queue");
00263             LOGWARN0(EVENT_QUEUE_EMPTY, dwErr);
00264             break;
00265         }
00266
00267         pqe = Dequeue(&(g_ce.lqEventQueue.head));
00268
00269         pee = CONTAINING_RECORD(pqe, EVENT_ENTRY, qeEventQueueLink);
00270         *(prpeEvent) = pee->rpeEvent;
00271         *(pmMessage) = pee->mMessage;
00272
00273         // created in EE_EnqueueEvent
00274         EE_Destroy(pee);
00275         pee = NULL;
00276     } while (FALSE);
00277
00278     RELEASE_QUEUE_LOCK(&(g_ce.lqEventQueue));
00279
00280     return dwErr;
00281 }
00282
00283
00284
00285 DWORD
00286 CE_Create (
00287     IN  PCONFIGURATION_ENTRY    pce)
00288 /*++
00289
00290 Routine Description
00291     Creates a configuration entry on DLL_PROCESS_ATTACH.
00292
00293 Locks
00294     None
00295
00296 Arguments
00297     pce                 pointer to the configuration entry
00298
00299 Return Value
00300     NO_ERROR            if success
00301     Failure code        o/w
00302
00303 --*/
00304 {
00305     DWORD dwErr = NO_ERROR;
00306
00307     // initialize to default values
00308     ZeroMemory(pce, sizeof(CONFIGURATION_ENTRY));
00309     pce->dwTraceID = INVALID_TRACEID;
00310
00311     do                          // breakout loop
00312     {
00313         // initialize the read-write lock
00314         CREATE_READ_WRITE_LOCK(&(pce->rwlLock));
00315         if (!READ_WRITE_LOCK_CREATED(&(pce->rwlLock)))
00316         {
00317             dwErr = GetLastError();
00318
00319             TRACE1(CONFIGURATION, "Error %u creating read-write-lock", dwErr);
00320             LOGERR0(CREATE_RWL_FAILED, dwErr);
00321
00322             break;
00323         }
00324
00325         // initialize the global heap
00326         pce->hGlobalHeap = HeapCreate(0, 0, 0);
00327         if (pce->hGlobalHeap is NULL)
00328         {
00329             dwErr = GetLastError();
00330             TRACE1(CONFIGURATION, "Error %u creating global heap", dwErr);
00331             LOGERR0(HEAP_CREATE_FAILED, dwErr);
00332
00333             break;
00334         }
00335
00336         //
00337         // initialize the count of threads that are active in IPSAMPLE
00338         // create the semaphore released by each thread when it is done
00339         // required for clean stop to the protocol
00340         //
00341         pce->ulActivityCount = 0;
00342         pce->hActivitySemaphore = CreateSemaphore(NULL, 0, 0xfffffff, NULL);
00343         if (pce->hActivitySemaphore is NULL)
00344         {
00345             dwErr = GetLastError();
00346             TRACE1(CONFIGURATION, "Error %u creating semaphore", dwErr);
00347             LOGERR0(CREATE_SEMAPHORE_FAILED, dwErr);
00348             break;
00349         }
00350
00351         // Logging & Tracing Information
00352         pce->dwLogLevel = IPSAMPLE_LOGGING_INFO;
00353         pce->hLogHandle = RouterLogRegister("IPSAMPLE");
00354         pce->dwTraceID  = TraceRegister("IPSAMPLE");
00355
00356         // Event Queue
00357         INITIALIZE_LOCKED_QUEUE(&(pce->lqEventQueue));
00358         if (!LOCKED_QUEUE_INITIALIZED(&(pce->lqEventQueue)))
00359         {
00360             dwErr = GetLastError();
00361             TRACE1(CONFIGURATION, "Error %u initializing locked queue", dwErr);
00362             LOGERR0(INIT_CRITSEC_FAILED, dwErr);
00363             break;
00364         }
00365
00366         // Protocol State
00367         pce->iscStatus = IPSAMPLE_STATUS_STOPPED;
00368
00369
00370         // Store of Dynamic Locks
00371         // pce->dlsDynamicLocksStore    zero'ed out
00372
00373         // Timer Entry
00374         // pce->hTimerQueue             = NULL;
00375
00376         // Router Manager Information (later)
00377         // pce->hMgrNotificationEvent   = NULL
00378         // pce->sfSupportFunctions      zero'ed out
00379
00380         // RTMv2 Information
00381         // pce->reiRtmEntity            zero'ed out
00382         // pce->rrpRtmProfile           zero'ed out
00383         // pce->hRtmHandle              = NULL
00384         // pce->hRtmNotificationHandle  = NULL
00385
00386         // MGM Information
00387         // pce->hMgmHandle              = NULL
00388
00389         // Network Entry
00390         // pce->pneNetworkEntry         = NULL;
00391
00392         // Global Statistics
00393         // pce->igsStats                zero'ed out
00394
00395     } while (FALSE);
00396
00397     if (dwErr != NO_ERROR)
00398     {
00399         // something went wrong, so cleanup.
00400         TRACE0(CONFIGURATION, "Failed to create configuration entry");
00401         CE_Destroy(pce);
00402     }
00403
00404     return dwErr;
00405 }
00406
00407
00408
00409 DWORD
00410 CE_Destroy (
00411     IN  PCONFIGURATION_ENTRY    pce)
00412 /*++
00413
00414 Routine Description
00415     Destroys a configuration entry on DLL_PROCESS_DEATTACH
00416
00417 Locks
00418     Assumes exclusive access to rwlLock with no waiting thread.
00419
00420 Arguments
00421     pce                 pointer to the configuration entry
00422
00423 Return Value
00424     NO_ERROR            always
00425
00426 --*/
00427 {
00428     // Network Entry
00429
00430     // MGM Information
00431
00432     // RTMv2 Information
00433
00434     // Router Manager Information
00435
00436     // Timer Entry
00437
00438     // Store of Dynamic Locks
00439
00440     // protocol state should be such...
00441     RTASSERT(pce->iscStatus is IPSAMPLE_STATUS_STOPPED);
00442
00443     // Event Queue
00444     if (LOCKED_QUEUE_INITIALIZED(&(pce->lqEventQueue)))
00445         DELETE_LOCKED_QUEUE((&(pce->lqEventQueue)), FreeEventEntry);
00446
00447     // Logging & Tracing Information
00448     if (pce->dwTraceID != INVALID_TRACEID)
00449     {
00450         TraceDeregister(pce->dwTraceID);
00451         pce->dwTraceID = INVALID_TRACEID;
00452     }
00453     if (pce->hLogHandle != NULL)
00454     {
00455         RouterLogDeregister(pce->hLogHandle);
00456         pce->hLogHandle = NULL;
00457     }
00458
00459     // destroy the semaphore released by each thread when it is done
00460     if (pce->hActivitySemaphore != NULL)
00461     {
00462         CloseHandle(pce->hActivitySemaphore);
00463         pce->hActivitySemaphore = NULL;
00464     }
00465
00466     if (pce->hGlobalHeap != NULL)
00467     {
00468         HeapDestroy(pce->hGlobalHeap);
00469         pce->hGlobalHeap = NULL;
00470     }
00471
00472     // delete the read-write lock
00473     if (READ_WRITE_LOCK_CREATED(&(pce->rwlLock)))
00474         DELETE_READ_WRITE_LOCK(&(pce->rwlLock));
00475
00476     return NO_ERROR;
00477 }
00478
00479
00480
00481 DWORD
00482 CE_Initialize (
00483     IN  PCONFIGURATION_ENTRY    pce,
00484     IN  HANDLE                  hMgrNotificationEvent,
00485     IN  PSUPPORT_FUNCTIONS      psfSupportFunctions,
00486     IN  PIPSAMPLE_GLOBAL_CONFIG pigc)
00487 /*++
00488
00489 Routine Description
00490     Initializes a configuration entry on StartProtocol.
00491
00492 Locks
00493     Assumes exclusive access to pce->rwlLock
00494
00495 Arguments
00496     pce                     pointer to the configuration entry
00497     hMgrNotificationEvent   event used to notify ip router manager
00498     psfSupportFunctions     functions exported by ip router manager
00499     pigc                    global configuration set in registry
00500
00501 Return Value
00502     NO_ERROR            if success
00503     Failure code        o/w
00504
00505 --*/
00506 {
00507     WORD    wVersionRequested   = MAKEWORD(1,1);
00508     WSADATA wsaData;
00509     BOOL    bCleanupWinsock     = FALSE;
00510
00511     DWORD   dwErr               = NO_ERROR;
00512
00513     // validate environment
00514     RTASSERT(pce->ulActivityCount is 0);
00515     RTASSERT(pce->iscStatus is IPSAMPLE_STATUS_STOPPED);
00516
00517     do                          // breakout loop
00518     {
00519         pce->ulActivityCount    = 0;
00520         pce->dwLogLevel         = pigc->dwLoggingLevel;
00521
00522
00523         dwErr = (DWORD) WSAStartup(wVersionRequested, &wsaData);
00524         if (dwErr != 0)
00525         {
00526             TRACE1(CONFIGURATION, "Error %u starting windows sockets", dwErr);
00527             LOGERR0(WSASTARTUP_FAILED, dwErr);
00528             break;
00529         }
00530         bCleanupWinsock = TRUE;
00531
00532         // Store of Dynamic Locks
00533         dwErr = InitializeDynamicLocksStore(&(pce->dlsDynamicLocksStore),
00534                                             GLOBAL_HEAP);
00535         if (dwErr != NO_ERROR)
00536         {
00537             TRACE1(CONFIGURATION, "Error %u initializing locks store", dwErr);
00538             LOGERR0(INIT_CRITSEC_FAILED, dwErr);
00539             break;
00540         }
00541
00542         // Timer Entry
00543         pce->hTimerQueue = CreateTimerQueue();
00544         if (!pce->hTimerQueue)
00545         {
00546             dwErr = GetLastError();
00547             TRACE1(CONFIGURATION, "Error %u registering timer queue", dwErr);
00548             LOGERR0(CREATE_TIMER_QUEUE_FAILED, dwErr);
00549             break;
00550         }
00551
00552
00553         // Router Manager Information
00554         pce->hMgrNotificationEvent   = hMgrNotificationEvent;
00555         if (psfSupportFunctions)
00556             pce->sfSupportFunctions      = *psfSupportFunctions;
00557
00558
00559         // RTMv2 Information
00560         pce->reiRtmEntity.RtmInstanceId = 0;
00561         pce->reiRtmEntity.AddressFamily = AF_INET;
00562         pce->reiRtmEntity.EntityId.EntityProtocolId = PROTO_IP_SAMPLE;
00563         pce->reiRtmEntity.EntityId.EntityInstanceId = 0;
00564
00565         dwErr = RTM_RegisterEntity(
00566             &pce->reiRtmEntity,     // IN   my RTM_ENTITY_INFO
00567             NULL,                   // IN   my exported methods
00568             RTM_CallbackEvent,      // IN   my callback function
00569             TRUE,                   // IN   reserve opaque pointer?
00570             &pce->rrpRtmProfile,    // OUT  my RTM_REGN_PROFILE
00571             &pce->hRtmHandle);      // OUT  my RTMv2 handle
00572         if (dwErr != NO_ERROR)
00573         {
00574             TRACE1(CONFIGURATION, "Error %u registering with RTM", dwErr);
00575             LOGERR0(RTM_REGISTER_FAILED, dwErr);
00576             break;
00577         }
00578
00579         dwErr = RTM_RegisterForChangeNotification(
00580             pce->hRtmHandle,        // IN   my RTMv2 handle
00581             RTM_VIEW_MASK_MCAST,    // IN   route table views relevant to moi
00582             RTM_CHANGE_TYPE_BEST,   // IN   change types interesting to moi
00583             NULL,                   // IN   context in callback function
00584             &pce->hRtmNotificationHandle); // OUT   my notification handle
00585         if (dwErr != NO_ERROR)
00586         {
00587             TRACE1(CONFIGURATION,
00588                    "Error %u registering for change with RTM", dwErr);
00589             LOGERR0(RTM_REGISTER_FAILED, dwErr);
00590             break;
00591         }
00592
00593
00594         // MGM Information
00595         // pce->hMgmHandle (later)
00596
00597
00598         // Network Entry
00599         dwErr = NE_Create(&(pce->pneNetworkEntry));
00600         if (dwErr != NO_ERROR)
00601             break;
00602
00603
00604         // Global Statistics
00605         ZeroMemory(&(pce->igsStats), sizeof(IPSAMPLE_GLOBAL_STATS));
00606
00607
00608         pce->iscStatus = IPSAMPLE_STATUS_RUNNING;
00609     } while (FALSE);
00610
00611     // something went wrong, cleanup
00612     if (dwErr != NO_ERROR)
00613         CE_Cleanup(pce, bCleanupWinsock);
00614
00615     return dwErr;
00616 }
00617
00618
00619
00620 DWORD
00621 CE_Cleanup (
00622     IN  PCONFIGURATION_ENTRY    pce,
00623     IN  BOOL                    bCleanupWinsock)
00624 /*++
00625
00626 Routine Description
00627     Cleans up a configuration entry on StopProtocol.
00628
00629 Locks
00630     Exclusive access to pce->rwlLock by virtue of no competing threads.
00631
00632     NOTE: However, pce->rwlLock should NOT actually be held!  The call to
00633     DeleteTimerQueueEx blocks till all queued callbacks finish execution.
00634     These callbacks may acquire pce->rwlLock, causing deadlock.
00635
00636 Arguments
00637     pce                 pointer to the configuration entry
00638     bCleanupWinsock
00639 Return Value
00640     NO_ERROR            always
00641
00642 --*/
00643 {
00644     DWORD dwErr = NO_ERROR;
00645
00646
00647     // Network Entry
00648     NE_Destroy(pce->pneNetworkEntry);
00649     pce->pneNetworkEntry        = NULL;
00650
00651
00652     // MGM Information (later)
00653     pce->hMgmHandle = NULL;
00654
00655
00656     // RTMv2 Information
00657     if (pce->hRtmNotificationHandle)
00658     {
00659         dwErr = RTM_DeregisterFromChangeNotification(
00660             pce->hRtmHandle,
00661             pce->hRtmNotificationHandle);
00662
00663         if (dwErr != NO_ERROR)
00664             TRACE1(CONFIGURATION,
00665                    "Error %u deregistering for change from RTM", dwErr);
00666     }
00667     pce->hRtmNotificationHandle = NULL;
00668
00669     if (pce->hRtmHandle)
00670     {
00671         dwErr = RTM_DeregisterEntity(pce->hRtmHandle);
00672
00673         if (dwErr != NO_ERROR)
00674             TRACE1(CONFIGURATION,
00675                    "Error %u deregistering from RTM", dwErr);
00676     }
00677     pce->hRtmHandle             = NULL;
00678
00679
00680     // Router Manager Information
00681     // valid till overwritten, needed to signal the ip router manager
00682     //     pce->hMgrNotificationEvent
00683     //     pce->sfSupportFunctions
00684
00685
00686     // Timer Entry
00687     if (pce->hTimerQueue)
00688         DeleteTimerQueueEx(pce->hTimerQueue, INVALID_HANDLE_VALUE);
00689     pce->hTimerQueue            = NULL;
00690
00691
00692     // Store of Dynamic Locks
00693     if (DYNAMIC_LOCKS_STORE_INITIALIZED(&(pce->dlsDynamicLocksStore)))
00694     {
00695         dwErr = DeInitializeDynamicLocksStore(&(pce->dlsDynamicLocksStore));
00696
00697         // all dynamic locks should have been free
00698         RTASSERT(dwErr is NO_ERROR);
00699     }
00700
00701     if (bCleanupWinsock)
00702         WSACleanup();
00703
00704     // protocol state
00705     pce->iscStatus = IPSAMPLE_STATUS_STOPPED;
00706
00707     return NO_ERROR;
00708 }
00709
00710
00711
00712 #ifdef DEBUG
00713 DWORD
00714 CE_Display (
00715     IN  PCONFIGURATION_ENTRY    pce)
00716 /*++
00717
00718 Routine Description
00719     Displays a configuration entry.
00720
00721 Locks
00722     Acquires shared pce->rwlLock
00723     Releases        pce->rwlLock
00724
00725 Arguments
00726     pce                 pointer to the configuration entry to be displayed
00727
00728 Return Value
00729     NO_ERROR            always
00730
00731 --*/
00732 {
00733     if (!pce)
00734         return NO_ERROR;
00735
00736
00737     ACQUIRE_READ_LOCK(&(pce->rwlLock));
00738
00739     TRACE0(CONFIGURATION, "Configuration Entry...");
00740
00741     TRACE3(CONFIGURATION,
00742            "ActivityCount %u, LogLevel %u, NumInterfaces %u",
00743            pce->ulActivityCount,
00744            pce->dwLogLevel,
00745            pce->igsStats.ulNumInterfaces);
00746
00747     NE_Display(pce->pneNetworkEntry);
00748
00749     RELEASE_READ_LOCK(&(pce->rwlLock));
00750
00751     TRACE0(CONFIGURATION, "EventQueue...");
00752     ACQUIRE_QUEUE_LOCK(&(pce->lqEventQueue));
00753     MapCarQueue(&((pce->lqEventQueue).head), DisplayEventEntry);
00754     RELEASE_QUEUE_LOCK(&(pce->lqEventQueue));
00755
00756
00757     return NO_ERROR;
00758 }
00759 #endif // DEBUG
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/WinHlprs/cwindow.h Source File

  • Com
  • Fundamentals
  • WinHlprs

cwindow.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright Microsoft Corporation.
00005 //
00006 //  File:       cwindow.h
00007 //
00008 //  Contents:   definition of a virtual window class
00009 //
00010 //  Classes:    CHlprWindow
00011 //
00012 //  Functions:  WindowProc
00013 //
00014 //  History:    4-12-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018
00019 #ifndef __CWINDOW_H__
00020 #define __CWINDOW_H__
00021
00022 #include <windows.h>
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 LRESULT CALLBACK WindowProc(
00029     HWND hwnd,
00030     UINT uMsg,
00031     WPARAM wParam,
00032     LPARAM lParam);
00033
00034 #ifdef __cplusplus
00035 }
00036
00037 //+---------------------------------------------------------------------------
00038 //
00039 //  Class:      CHlprWindow
00040 //
00041 //  Purpose:    virtual base class for wrapping a window
00042 //
00043 //  Interface:  Create     -- analagous to Windows' CreateWindow function
00044 //              WindowProc -- pure virtual WindowProc for the window
00045 //              ~CHlprWindow   -- destructor
00046 //              CHlprWindow    -- constructor
00047 //
00048 //  History:    4-12-94   stevebl   Created
00049 //
00050 //  Notes:      This class allows a window to be cleanly wrapped in a
00051 //              c++ class.  Specifically, it provides a way for a c++ class
00052 //              to use one of its methods as a WindowProc, giving it a "this"
00053 //              pointer and allowing it to have direct access to all of its
00054 //              private members.
00055 //
00056 //----------------------------------------------------------------------------
00057
00058 class CHlprWindow
00059 {
00060 public:
00061     HWND Create(
00062         LPCTSTR lpszClassName,
00063         LPCTSTR lpszWindowName,
00064         DWORD dwStyle,
00065         int x,
00066         int y,
00067         int nWidth,
00068         int nHeight,
00069         HWND hwndParent,
00070         HMENU hmenu,
00071         HINSTANCE hinst);
00072     virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
00073     virtual ~CHlprWindow(){};
00074     HWND GetHwnd(void)
00075     {
00076         return(_hwnd);
00077     }
00078     CHlprWindow()
00079     {
00080         _hwnd = NULL;
00081         _hInstance = NULL;
00082     };
00083 protected:
00084 friend LRESULT CALLBACK ::WindowProc(
00085     HWND hwnd,
00086     UINT uMsg,
00087     WPARAM wParam,
00088     LPARAM lParam);
00089     HWND _hwnd;
00090     HINSTANCE _hInstance;
00091 };
00092
00093 #endif
00094
00095 #endif //__CWINDOW_H__
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/CRQDlg.h Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

CRQDlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // CrQDlg.h : header file
00013 //
00014
00015
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CCreateQueueDialog dialog
00019
00020 class CCreateQueueDialog : public CDialog
00021 {
00022 // Construction
00023 public:
00024   CCreateQueueDialog(CWnd* pParent = NULL);   // standard constructor
00025
00026 // Dialog Data
00027   //{{AFX_DATA(CCreateQueueDialog)
00028   enum { IDD = IDD_CREATE_QUEUE_DIALOG };
00029   CString m_strLabel;
00030   CString m_strPathName;
00031   //}}AFX_DATA
00032
00033 // Overrides
00034   // ClassWizard generated virtual function overrides
00035   //{{AFX_VIRTUAL(CCreateQueueDialog)
00036   protected:
00037   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00038   //}}AFX_VIRTUAL
00039
00040 // Implementation
00041 protected:
00042
00043   // Generated message map functions
00044   //{{AFX_MSG(CCreateQueueDialog)
00045   //}}AFX_MSG
00046   DECLARE_MESSAGE_MAP()
00047
00048 public:
00049   void GetPathName(TCHAR szPathNameBuffer[BUFFERSIZE])
00050   {
00051     ASSERT(szPathNameBuffer != NULL);
00052
00053     _tcsncpy (szPathNameBuffer, LPCTSTR(m_strPathName), BUFFERSIZE-1);
00054     szPathNameBuffer[BUFFERSIZE-1] = '\0';
00055
00056   }
00057
00058   void GetLabel(TCHAR szLabelBuffer[BUFFERSIZE])
00059   {
00060     ASSERT(szLabelBuffer != NULL);
00061
00062     _tcsncpy (szLabelBuffer, LPCTSTR(m_strLabel), BUFFERSIZE-1);
00063     szLabelBuffer[BUFFERSIZE-1] = '\0';
00064
00065   }
00066
00067 };
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • About

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057
00058     if (*ppv)
00059     {
00060         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00061         return S_OK;
00062     }
00063
00064     return E_NOINTERFACE;
00065 }
00066
00067 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00068 {
00069     return InterlockedIncrement((LONG *)&m_cref);
00070 }
00071
00072 STDMETHODIMP_(ULONG) CComponentData::Release()
00073 {
00074     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00075     {
00076         // we need to decrement our object count in the DLL
00077         delete this;
00078         return 0;
00079     }
00080
00081     return m_cref;
00082 }
00083
00084 ///////////////////////////////
00085 // Interface IComponentData
00086 ///////////////////////////////
00087 HRESULT CComponentData::Initialize(
00088                                    /* [in] */ LPUNKNOWN pUnknown)
00089 {
00090     HRESULT      hr;
00091
00092     // Get pointer to name space interface
00093     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00094     _ASSERT( S_OK == hr );
00095
00096     // Get pointer to console interface
00097     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00098     _ASSERT( S_OK == hr );
00099
00100     return S_OK;
00101 }
00102
00103 HRESULT CComponentData::CreateComponent(
00104                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00105 {
00106     *ppComponent = NULL;
00107
00108     CComponent *pComponent = new CComponent(this);
00109
00110     if (NULL == pComponent)
00111         return E_OUTOFMEMORY;
00112
00113     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00114 }
00115
00116 HRESULT CComponentData::Notify(
00117                                /* [in] */ LPDATAOBJECT lpDataObject,
00118                                /* [in] */ MMC_NOTIFY_TYPE event,
00119                                /* [in] */ LPARAM arg,
00120                                /* [in] */ LPARAM param)
00121 {
00122         MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00123
00124     return S_FALSE;
00125 }
00126
00127 HRESULT CComponentData::Destroy( void)
00128 {
00129     // Free interfaces
00130     if (m_ipConsoleNameSpace) {
00131         m_ipConsoleNameSpace->Release();
00132         m_ipConsoleNameSpace = NULL;
00133     }
00134
00135     if (m_ipConsole) {
00136         m_ipConsole->Release();
00137         m_ipConsole = NULL;
00138     }
00139
00140     return S_OK;
00141 }
00142
00143 HRESULT CComponentData::QueryDataObject(
00144                                         /* [in] */ MMC_COOKIE cookie,
00145                                         /* [in] */ DATA_OBJECT_TYPES type,
00146                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00147 {
00148     CDataObject *pObj = NULL;
00149
00150     if (cookie == 0)
00151         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00152     else
00153         pObj = new CDataObject(cookie, type);
00154
00155     if (!pObj)
00156         return E_OUTOFMEMORY;
00157
00158     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00159
00160     return S_OK;
00161 }
00162
00163 HRESULT CComponentData::GetDisplayInfo(
00164                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00165 {
00166     HRESULT hr = S_FALSE;
00167
00168     // if they are asking for the SDI_STR we have one of those to give
00169     if (pScopeDataItem->lParam) {
00170         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00171         if (pScopeDataItem->mask & SDI_STR) {
00172             LPCTSTR pszT = base->GetDisplayName();
00173             MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00174             pScopeDataItem->displayname = pszW;
00175         }
00176
00177         if (pScopeDataItem->mask & SDI_IMAGE) {
00178             pScopeDataItem->nImage = base->GetBitmapIndex();
00179         }
00180     }
00181
00182     return hr;
00183 }
00184
00185 HRESULT CComponentData::CompareObjects(
00186                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00187                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00188 {
00189     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00190     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00191
00192     // compare the object pointers
00193     if (baseA->GetCookie() == baseB->GetCookie())
00194         return S_OK;
00195
00196     return S_FALSE;
00197 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

vcacct::CMoveMoney Member List

This is the complete list of members for vcacct::CMoveMoney, including all inherited members.
clsid | vcacct::CMoveMoney | [static]
iid | vcacct::CMoveMoney | [static]
Perform(int lPrimeAccount, int lSecondAccount, int lAmount, int lTranType) | vcacct::CMoveMoney |
Generated on Wed Nov 13 2024 16:58:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/StdAfx.h Source File

  • WinBase
  • WtsApi
  • WtsApi

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__C090CEEC_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
00007 #define AFX_STDAFX_H__C090CEEC_303B_11D1_8310_00C04FBEFCDA__INCLUDED_
00008
00009 #if _MSC_VER >= 1000
00010 #pragma once
00011 #endif // _MSC_VER >= 1000
00012
00013 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00014
00015 #include <afxwin.h>         // MFC core and standard components
00016 #include <afxext.h>         // MFC extensions
00017 #ifndef _AFX_NO_AFXCMN_SUPPORT
00018 #include <afxcmn.h>     // MFC support for Windows Common Controls
00019 #endif // _AFX_NO_AFXCMN_SUPPORT
00020
00021
00022 //{{AFX_INSERT_LOCATION}}
00023 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00024
00025 #endif // !defined(AFX_STDAFX_H__C090CEEC_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdMarsh/PAPINT.Idl Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdMarsh

PAPINT.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PAPINT.IDL
00003
00004   Summary:   Interface definition file for use by the MIDL compiler.
00005              Specifies the following custom interfaces: ISharePaper and
00006              IPaperSink.
00007
00008              Compilation of this file using the MIDL.EXE compiler
00009              generates additional source files PAPINT.H, PAPINT_I.C,
00010              PAPINT_P.C, and DLLDATA.C.  They are in turn compiled in the
00011              Makefile to produce the marshaling server which is used by
00012              later code samples to provide standard marshaling for the
00013              ISharePaper and IPaperSink custom interfaces.
00014
00015   Origin:    8-23-97: atrent - Editor inheritance from MARSHAL sample.
00016
00017 ----------------------------------------------------------------------------
00018   This file is part of the Microsoft COM Tutorial Code Samples.
00019
00020   Copyright (C) 1995-1998 Microsoft Corporation.  All rights reserved.
00021
00022   This source code is intended only as a supplement to Microsoft
00023   Development Tools and/or on-line documentation.  See these other
00024   materials for detailed information regarding Microsoft code samples.
00025
00026   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00027   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00028   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00029   PARTICULAR PURPOSE.
00030 ==========================================================================+*/
00031
00032
00033 [uuid(0002da31-0000-0000-c000-000000000046),
00034     object
00035 ]
00036 interface ISharePaper : IUnknown
00037 {
00038   import "unknwn.idl";
00039
00040   HRESULT InitPaper(
00041             [in,out] RECT* pWinRect,
00042             [out]    BOOL* pbFirst);
00043   HRESULT Lock(
00044             [in] BOOL bLock);
00045   HRESULT Load(
00046             [out] RECT* pWinRect);
00047   HRESULT Save(
00048             void);
00049   HRESULT InkStart(
00050             [in] SHORT nX,
00051             [in] SHORT nY,
00052             [in] SHORT nInkWidth,
00053             [in] COLORREF crInkColor);
00054   HRESULT InkDraw(
00055             [in] SHORT nX,
00056             [in] SHORT nY);
00057   HRESULT InkStop(
00058             [in] SHORT nX,
00059             [in] SHORT nY);
00060   HRESULT GetInk(
00061             [in] LONG lIndex,
00062             [out] SHORT* pnInkType,
00063             [out] SHORT* pnX,
00064             [out] SHORT* pnY,
00065             [out] SHORT* pnInkWidth,
00066             [out] COLORREF* pcrInkColor);
00067   HRESULT Erase(
00068             void);
00069   HRESULT Resize(
00070             [in] LONG lWidth,
00071             [in] LONG lHeight);
00072 }
00073
00074 [uuid(0002da34-0000-0000-c000-000000000046),
00075     object
00076 ]
00077 interface IPaperSink : IUnknown
00078 {
00079   import "unknwn.idl";
00080
00081   HRESULT Locked(
00082             void);
00083   HRESULT Unlocked(
00084             void);
00085   HRESULT Loaded(
00086             void);
00087   HRESULT Saved(
00088             void);
00089   HRESULT InkStart(
00090             [in] SHORT nX,
00091             [in] SHORT nY,
00092             [in] SHORT nInkWidth,
00093             [in] COLORREF crInkColor);
00094   HRESULT InkDraw(
00095             [in] SHORT nX,
00096             [in] SHORT nY);
00097   HRESULT InkStop(
00098             [in] SHORT nX,
00099             [in] SHORT nY);
00100   HRESULT Erased(
00101             void);
00102   HRESULT Resized(
00103             [in] LONG lWidth,
00104             [in] LONG lHeight);
00105 }
00106
00107 cpp_quote ("// The types of Ink Data.")
00108 cpp_quote ("#define INKTYPE_NONE  0")
00109 cpp_quote ("#define INKTYPE_START 1")
00110 cpp_quote ("#define INKTYPE_DRAW  2")
00111 cpp_quote ("#define INKTYPE_STOP  3")
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/ClipBook ServerEx.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

ClipBook ServerEx.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ClipBook ServerEx.h
00007 //
00008 //  Implementation File:
00009 //      ClipBook ServerEx.cpp
00010 //
00011 //  Description:
00012 //      Global definitions across the DLL.
00013 //
00014 //  Author:
00015 //      <name> (<e-mail name>) Mmmm DD, 2003
00016 //
00017 //  Revision History:
00018 //
00019 //  Notes:
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #pragma once
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Include Files
00027 /////////////////////////////////////////////////////////////////////////////
00028
00029 #ifndef __AFXWIN_H__
00030     #error include 'stdafx.h' before including this file for PCH
00031 #endif
00032
00033 #include "resource.h"       // main symbols
00034
00035 /////////////////////////////////////////////////////////////////////////////
00036 // Constant Definitions
00037 /////////////////////////////////////////////////////////////////////////////
00038
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // Global Function Declarations
00042 /////////////////////////////////////////////////////////////////////////////
00043
00044 void
00045 FormatError(
00046       CString & rstrErrorInout
00047     , DWORD     dwErrorIn
00048     );
00049
00050 /////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSampleDirectory Member List

This is the complete list of members for CSampleDirectory, including all inherited members.
CSampleDirectory() | CSampleDirectory |
GetChildInfo(DWORD dwIndex, WMSDirectoryEntryInfo *pInfo) | CSampleDirectory | [virtual]
GetDataSourcePlugin(IWMSDataSourcePlugin **ppDataSource) | CSampleDirectory | [virtual]
GetName(LPOLESTR *pstrValue) | CSampleDirectory | [virtual]
Initialize(IWMSContext *pUserContext, LPWSTR pszContainerName, CSDKSampleStorageSystem *pOwnerStorageSystem, IWMSDataSourcePluginCallback *pCallback, QWORD qwContext) | CSampleDirectory |
m_cRef | CSampleDirectory | [protected]
m_CriticalSection | CSampleDirectory | [protected]
m_dwItemNum | CSampleDirectory | [protected]
m_dwPathNameLength | CSampleDirectory | [protected]
m_pChildren | CSampleDirectory | [protected]
m_pOwnerStorageSystem | CSampleDirectory | [protected]
m_pPathName | CSampleDirectory | [protected]
m_pRecentChild | CSampleDirectory | [protected]
m_pSearchDirName | CSampleDirectory | [protected]
QueryInterface(REFIID riid, void **ppvObject) | CSampleDirectory |
Shutdown() | CSampleDirectory |
STDMETHOD_(ULONG, AddRef)() | CSampleDirectory |
STDMETHOD_(ULONG, Release)() | CSampleDirectory |
~CSampleDirectory() | CSampleDirectory | [virtual]
Generated on Wed Nov 13 2024 16:57:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyAudit/ComSpysqlAudit.Cpp Source File

  • Com
  • Administration
  • Spy
  • ComSpyAudit

ComSpysqlAudit.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "stdafx.h"
00018 #include "ComSpyAudit.h"
00019 #ifndef DBNTWIN32
00020 #define DBNTWIN32
00021 #include <SQL.h>
00022 #include <SQLEXT.h>
00023 #include <ODBCINST.h>
00024 #endif // DBNTWIN32
00025 #include <ODBCINST.h>
00026 #include "ComSpySqlAudit.h"
00027
00028 LPTSTR sTables[] = {
00029 _T("SecurityEvents"),   //IComSecurityEvents,IComIdentityEvents
00030 _T("MethodEvents"),     //IComMethodEvents
00031 _T("ObjectEvents"),     //IComObjectEvents, IComInstanceEvents,IComObjectConstructionEvents
00032 _T("AppEvents"),      //IComAppEvents
00033 _T("ResourceEvents"),   //IComResourceEvents
00034 _T("ThreadEvents"),     //IComThreadEvents
00035 _T("TransactionEvents"),  //IComTransactionEvents
00036 _T("ObjectPoolEvents"),   //IComObjectPoolEvents,IComObjectPoolEvents2
00037 _T("ActivityEvents"),   //IComActivityEvents
00038 _T("QCEvents"),       //IComQCEvents
00039 _T("ExceptionEvents"),    //IComExceptionEvents
00040 _T("CRMEvents"),      //IComCRMEvents
00041 _T("LBEvents")        //ILBEvents
00042 };
00043
00044 //for testing table existance
00045 LPTSTR sCreateTable =
00046 _T("CREATE TABLE dbo.%s (Ct int NOT NULL )");
00047
00048 ////
00049 STDMETHODIMP CComSpySqlAudit::Init(LPCOLESTR sDSN, LPCOLESTR sUser, LPCOLESTR sPw)
00050 {
00051   CComBSTR msg;
00052   RETCODE rc;
00053
00054   if (m_henv || m_hstmt || m_hdbc)
00055     return E_UNEXPECTED; //did you call Init() twice?
00056
00057   rc = SQLAllocEnv( &m_henv );
00058     if( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
00059     {
00060         msg = L"CComSpySqlAudit::Init() - SQLAllocEnv failed!\n";
00061     goto Exit;
00062     }
00063
00064
00065     //Allocate the Connection handle
00066     rc = SQLAllocConnect( m_henv, &m_hdbc );
00067
00068     if( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO )
00069     {
00070         msg = L"CComSpySqlAudit::Init() - SQLAllocConnect failed!\n";
00071     goto Exit;
00072     }
00073
00074
00075   SQLSetConnectOption(m_hdbc, SQL_LOGIN_TIMEOUT, 5);
00076
00077     rc = SQLConnect( m_hdbc, (SQLWCHAR *)sDSN,  SQL_NTS,
00078                (SQLWCHAR *)sUser, SQL_NTS,
00079                (SQLWCHAR *)sPw,   SQL_NTS );
00080
00081     if( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO )
00082     {
00083         msg = L"CComSpySqlAudit::Init() - SQLConnect failed!\n";
00084     goto Exit;
00085     }
00086
00087
00088     //Allocate the statement handle
00089     rc = SQLAllocStmt( m_hdbc, &m_hstmt);
00090   if( rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO )
00091     {
00092         msg = L"CComSpySqlAudit::Init() - SQLConnect failed!\n";
00093     goto Exit;
00094     }
00095   //
00096   //  verify the table existence
00097   //
00098   {
00099     TCHAR sSQL[1024];
00100     for (int i=0; i<sizeof(sTables)/sizeof(sTables[0]); i++)
00101     {
00102       ZeroMemory(sSQL, 1024 * sizeof(TCHAR));
00103       wsprintf(sSQL, sCreateTable, sTables[i]);
00104       rc = SQLExecDirect(m_hstmt, sSQL, lstrlen(sSQL));
00105       if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
00106       {
00107         // this means the table is not in the db
00108
00109         //Clean up the table just created and exit
00110         ZeroMemory(sSQL, 1024 * sizeof(TCHAR));
00111         wsprintf(sSQL, _T("drop table %s"), sTables[i]);
00112         rc = SQLExecDirect(m_hstmt, sSQL, lstrlen(sSQL));
00113         msg = L"Table ";
00114         msg.Append(sTables[i]);
00115         msg.Append(L" is not in the Database.");
00116
00117         goto Exit;
00118       }
00119     }
00120   }
00121
00122   return S_OK;
00123
00124 Exit:
00125
00126   ATLTRACE(msg);
00127   ATLTRACE(_T("\n"));
00128
00129   if (m_hstmt)
00130   {
00131     SQLFreeStmt( m_hstmt, SQL_DROP );
00132   }
00133
00134   if (m_hdbc)
00135   {
00136      rc = SQLDisconnect( m_hdbc);
00137      SQLFreeConnect( m_hdbc);
00138      if (m_henv)
00139      SQLFreeEnv( m_henv );
00140   }
00141
00142   m_hdbc = m_hstmt  = m_henv = NULL;
00143
00144   return E_FAIL;
00145
00146 }
00147
00148
00149 void CComSpySqlAudit::GetError(HENV henv, HDBC hdbc, HSTMT hstmt, BSTR *msg)
00150 {
00151     WCHAR szSqlState[64];
00152     SDWORD NativeError;
00153     WCHAR szErr[512];
00154     SWORD cbErrorMsg;
00155     SQLError(henv, hdbc, hstmt, szSqlState, &NativeError, szErr, 511, &cbErrorMsg);
00156     *msg = SysAllocString(szErr);
00157 }
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cdatasource.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cdatasource.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CDATASOURCE.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CDATASOURCE_H_
00012 #define _CDATASOURCE_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019
00020
00021 /////////////////////////////////////////////////////////////////
00022 // CDataSource class
00023 //
00024 /////////////////////////////////////////////////////////////////
00025 class CDataSource : public CPropertiesBase
00026 {
00027 public:
00028   //Constructors
00029   CDataSource(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00030   virtual ~CDataSource();
00031
00032   //IUnknown Helpers
00033   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00034   virtual HRESULT     AutoRelease();
00035   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00036
00037   //Pure Virtual
00038   virtual WCHAR*      GetObjectName()     { return L"DataSource";       }
00039   virtual UINT      GetObjectMenu()     { return IDM_DATASOURCEMENU;    }
00040   virtual REFIID      GetDefaultInterface() { return IID_IDBProperties;     }
00041   virtual WCHAR*      GetObjectDesc();
00042
00043   virtual LONG      GetObjectImage()  { return IMAGE_DATASOURCE;      }
00044
00045   //Members
00046
00047   //Helpers
00048   virtual HRESULT     CreateSession(CAggregate* pCAggregate, REFIID riid, IUnknown** ppIUnknown);
00049   virtual HRESULT     AdminCreateDataSource(CAggregate* pCAggregate, ULONG cPropSets, DBPROPSET* rgPropSets, REFIID riid, IUnknown** ppIUnknown);
00050   virtual HRESULT     GetClassID(CLSID* pclsid, WCHAR** ppwszProgID = NULL);
00051
00052   //Pooling
00053
00054
00055   //OLE DB Interfaces
00056   //[MANADATORY]
00057   IDBCreateSession*     m_pIDBCreateSession;      //DataSource interface
00058   IPersist*         m_pIPersist;          //DataSource interface
00059
00060   //[OPTIONAL]
00061   IDBDataSourceAdmin*     m_pIDBDataSourceAdmin;      //DataSource interface
00062   IDBInfo*          m_pIDBInfo;           //DataSource interface
00063   IPersistFile*       m_pIPersistFile;        //DataSource interface
00064
00065   //Services
00066   IServiceProvider*     m_pIServiceProvider;      //Service Interface
00067
00068   //DataSource info
00069   CComBSTR          m_cstrDataSource;
00070   CComBSTR          m_cstrDBMS;
00071   CComBSTR          m_cstrDBMSVer;
00072
00073   CComBSTR          m_cstrProviderName;
00074   CComBSTR          m_cstrProviderDesc;
00075   LONG            m_lDataSourceType;
00076 };
00077
00078
00079 #endif  //_CDATASOURCE_H_
Generated on Wed Nov 13 2024 16:52:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/filerepclientproc.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

filerepclientproc.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Client System Service
00006
00007     FILE: FileRepClientProc.cpp
00008
00009     PURPOSE: Remote procedures for client system service
00010
00011     FUNCTIONS:
00012         RequestFile() - receives file replication requests
00013         ThreadProcRequest() - processes file replication requests
00014     in an independent thread.
00015
00016     COMMENTS:
00017
00018 */
00019
00020 #include <stdlib.h>
00021 #include <stdio.h>
00022 #include <tchar.h>
00023 #include <rpc.h>
00024 #include <Ntdsapi.h>
00025 #include <time.h>
00026
00027 #include "common.h"
00028
00029 // header file generated by MIDL compiler
00030 #include "FileRepClient.h"
00031 #include "FileRepServer.h"
00032
00033 // Contains declarations for system service functions.
00034 #include "Service.h"
00035
00036 #ifdef DEBUG
00037 #include "DbgMsg.h"
00038 #endif
00039
00040 #ifdef PROF
00041 #include "Prof.h"
00042 #endif
00043
00044 // The number of seconds we will spend on the RPC
00045 // thread before spawning a new worker thread.
00046 const time_t tServerThread = 5;
00047
00048 typedef enum tReqState {
00049     StateArrived,
00050     StateQueued,
00051     StateActive
00052 } ReqState;
00053
00054 //
00055 // Packages up the variables to be passed
00056 // to the processing thread.
00057 //
00058 typedef struct tReq{
00059     handle_t hFileRepServer;
00060     handle_t hFileRepClient;
00061     HANDLE hTokenHandle;
00062     HANDLE hLocalFile;
00063     PCONTEXT_HANDLE_TYPE phContext;
00064
00065     LPTSTR ServerName;
00066     LPTSTR RemoteFileName;
00067     LPTSTR LocalFileName;
00068
00069     // Set when we are impersonating the client.
00070     BOOL bRpcImpersonating;
00071     BOOL bImpersonating;
00072
00073     // Priority of this request.
00074     UINT Pri;
00075
00076     // User SID.
00077     PSID pSID;
00078
00079     ReqState State;
00080
00081 #ifdef PROF
00082     ULONG nReqId;
00083 #endif
00084 } Req;
00085
00086 //
00087 // Closes the file handle and frees all thread data if an error occured
00088 // in one of the following functions.
00089 //
00090 VOID ShutdownThread(Req *pReq) {
00091     DWORD status;
00092     RPC_STATUS rpcstatus;
00093
00094 #ifdef DEBUG
00095     TCHAR Msg[MSG_SIZE];
00096
00097     DbgMsgRecord(TEXT("-> ShutdownThread\n"));
00098 #endif
00099
00100     if(pReq != NULL) {
00101
00102         // Stop impersonating if we are.
00103         // The first thing we do in handling a request is impersonating the client.
00104         if (pReq->bRpcImpersonating) {
00105             rpcstatus = RpcRevertToSelf();
00106             if (rpcstatus != RPC_S_OK) {
00107                 AddToMessageLogProcFailureEEInfo(TEXT("ShutdownThread: RpcRevertToSelf"), rpcstatus);
00108             }
00109         }
00110         if (pReq->bImpersonating) {
00111             if (RevertToSelf() == 0) {
00112                 AddToMessageLogProcFailure(TEXT("ShutdownThread: RevertToSelf"), GetLastError());
00113             }
00114         }
00115
00116         if(pReq->hFileRepServer != NULL) {
00117             rpcstatus = RpcBindingFree(&(pReq->hFileRepServer));
00118             ASSERTE(rpcstatus == RPC_S_OK);
00119         }
00120         // Check that hLocalFile has been initialized and that initialization
00121         // was successful.
00122         if(pReq->hLocalFile != NULL && pReq->hLocalFile != INVALID_HANDLE_VALUE) {
00123             status = CloseHandle(pReq->hLocalFile);
00124             ASSERTE(status != 0);
00125         }
00126         if(pReq->phContext != NULL) {
00127             RpcSsDestroyClientContext((VOID **)&pReq->phContext);
00128             if (rpcstatus != RPC_S_OK) {
00129                 AddToMessageLogProcFailureEEInfo(TEXT("ShutdownThread: RpcSsDestroyClientContext"), rpcstatus);
00130             }
00131         }
00132
00133         // Check if any of the counters need to be decremented
00134         // since we are removing the request.
00135         if (pReq->State == StateQueued) {
00136             CounterDecrement(pClientReqCounters[pReq->Pri]);
00137 #ifdef DEBUG
00138             _stprintf(Msg, TEXT("Decremented ClientReqCounters[%d]\n"), pReq->Pri);
00139             DbgMsgRecord(Msg);
00140 #endif
00141         }
00142         if (pReq->State == StateActive) {
00143             CounterDecrement(pClientActiveReqCounters[pReq->Pri]);
00144             QueueHashDecrementCounter(ClientActiveReqHashCounters[pReq->Pri], pReq->pSID);
00145 #ifdef DEBUG
00146             _stprintf(Msg, TEXT("Decremented ClientActiveReqCounters[%d] and ClientActiveReqHashCounters[%d]\n"), pReq->Pri, pReq->Pri);
00147             DbgMsgRecord(Msg);
00148 #endif
00149         }
00150
00151         if (pReq->hTokenHandle != NULL) {
00152             status = CloseHandle(pReq->hTokenHandle);
00153             ASSERTE(status != NULL);
00154         }
00155
00156         if (pReq->ServerName != NULL) {
00157             AutoHeapFree(pReq->ServerName);
00158         }
00159         if (pReq->RemoteFileName != NULL) {
00160             AutoHeapFree(pReq->RemoteFileName);
00161         }
00162         if (pReq->LocalFileName != NULL) {
00163             AutoHeapFree(pReq->LocalFileName);
00164         }
00165
00166         if (pReq->pSID != NULL) {
00167             AutoHeapFree(pReq->pSID);
00168         }
00169
00170         AutoHeapFree(pReq);
00171     }
00172
00173 #ifdef DEBUG
00174     DbgMsgRecord(TEXT("<- ShutdownThread\n"));
00175 #endif
00176 }
00177
00178 //
00179 // Handles a request taken off req queue.
00180 //
00181 VOID HandleReq(tReq *pReq) {
00182
00183     BYTE pbBuf[MAX_BUFSIZE];
00184
00185     RPC_STATUS rpcstatus;
00186
00187     ULONG cbRead, cbWritten;
00188
00189     // Default connection to server system service is over TCP/IP.
00190     LPTSTR DefaultProtocolSequence = TEXT("ncacn_ip_tcp");
00191
00192     // An empty endpoint string is used, since we are going to
00193     // connect to the endpoint dynamically generated by the
00194     // RPC run-time library.    Server calls RpcServerUseProtseq to
00195     // obtain a binding hadnle and a dynamic endpoint.
00196     LPTSTR DefaultEndpoint = TEXT("");
00197
00198     LPTSTR pszUuid = NULL;
00199     LPTSTR pszOptions = NULL;
00200     LPTSTR pszStringBinding = NULL;
00201
00202     BOOL FoundReq = TRUE;
00203     BOOL FoundActiveReq = TRUE;
00204
00205     //
00206     // If a request is picked of the request queue.
00207     // Then we need to set up binding, bind to the server,
00208     // and do the initial read.
00209     //
00210
00211     // We need to impersonate the user that has issued the
00212     // remote call.
00213     // We want to impersonate as soon as possible to minimise
00214     // the amount of resources that can be consumed by an attack.
00215     if (ImpersonateLoggedOnUser(pReq->hTokenHandle) == 0) {
00216         ShutdownThread(pReq);
00217         AddToMessageLogProcFailure(TEXT("HandleReq: ImpersonateLoggedOnUser"), GetLastError());
00218         return;
00219     }
00220     pReq->bImpersonating = TRUE;
00221
00222     // Prepare the binding information.
00223     if ((rpcstatus = RpcStringBindingCompose(pszUuid,
00224                                              DefaultProtocolSequence,
00225                                              pReq->ServerName,
00226                                              DefaultEndpoint,
00227                                              pszOptions,
00228                                              &pszStringBinding)) != RPC_S_OK) {
00229         ShutdownThread(pReq);
00230         AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: RpcStringBindingCompose"), rpcstatus);
00231         return;
00232     }
00233
00234     if ((rpcstatus = RpcBindingFromStringBinding(pszStringBinding, &(pReq->hFileRepServer))) != RPC_S_OK) {
00235         // The binding handle is invalid
00236         pReq->hFileRepServer = NULL;
00237
00238         // Deallocate the string binding.
00239         rpcstatus = RpcStringFree(&pszStringBinding);
00240         ASSERTE(rpcstatus == RPC_S_OK);
00241
00242         ShutdownThread(pReq);
00243         AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: RpcBindingFromStringBinding"), rpcstatus);
00244         return;
00245     }
00246
00247     // We need to delete the string binding, since it is no longer
00248     // necessary.  All the binding information is now contained in the
00249     // binding handle.
00250     rpcstatus = RpcStringFree(&pszStringBinding);
00251     ASSERTE(rpcstatus == RPC_S_OK);
00252
00253     DWORD status;
00254
00255     // Quality of service structure to ensure authentication.
00256     RPC_SECURITY_QOS SecurityQOS;
00257
00258     // The length of the principal name and the principal name
00259     // for the client system service.
00260     TCHAR szSpn[MAX_PATH];
00261     ULONG ulSpn = sizeof(szSpn);
00262
00263     // Generate a principal name for the local system service.
00264     if ((status = DsMakeSpn(SERVICENAME,
00265                             pReq->ServerName,
00266                             NULL,
00267                             0,
00268                             0,
00269                             &ulSpn,
00270                             szSpn)) != ERROR_SUCCESS) {
00271         ShutdownThread(pReq);
00272         AddToMessageLogProcFailure(TEXT("HandleReq: DsMakeSpn"), GetLastError());
00273         return;
00274     }
00275
00276     // Specify quality of service parameters.
00277     SecurityQOS.Version = RPC_C_SECURITY_QOS_VERSION;
00278     SecurityQOS.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH;
00279     // Use static identity tracking since we will be issuing multiple
00280     // RPC calls from this thread with different identities: while
00281     // impersonating, and while not.  This insures that all the calls will
00282     // go to server under the identity of the user who created the binding
00283     // handle.
00284     SecurityQOS.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC;
00285     // The client system service needs to impersonate the security context
00286     // of the client utility on the remote systems where it may replicate
00287     // files from.  It will also need to obtain client's SID and hence
00288     // requires impersonation.
00289     SecurityQOS.ImpersonationType = RPC_C_IMP_LEVEL_IMPERSONATE;
00290
00291     // Set authentification and authorisation information for
00292     // the binding handle.
00293     if ((rpcstatus = RpcBindingSetAuthInfoEx(pReq->hFileRepServer, szSpn, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_GSS_KERBEROS, NULL, RPC_C_AUTHZ_NAME, &SecurityQOS)) != RPC_S_OK) {
00294
00295         ShutdownThread(pReq);
00296         AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: RpcBindingSetAuthInfoEx"), rpcstatus);
00297         return;
00298     }
00299
00300     // We did not read anything yet.
00301     cbRead = 0;
00302
00303 #ifdef RETRY_EXCEPTION
00304     // When making aggressive calls to the server, this flag is
00305     // set when the call succeeded.  This makes the client service attempt
00306     // to contact the server even after an exception occured.
00307     BOOL bRetryCall = TRUE;
00308     while (bRetryCall) {
00309 #endif
00310
00311         // Attempt to open the remote file.
00312         RpcTryExcept {
00313             c_RemoteOpen(pReq->hFileRepServer,
00314                          &(pReq->phContext),
00315                          pReq->RemoteFileName,
00316                          pbBuf,
00317                          &cbRead);
00318 #ifdef RETRY_EXCEPTION
00319             bRetryCall = FALSE;
00320 #endif
00321         }
00322         RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00323                       (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00324                       (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00325                       (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00326                       (RpcExceptionCode() != STATUS_BREAKPOINT) )
00327                     ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00328
00329 #ifdef RETRY_EXCEPTION
00330             // This code attempts to make aggressive calls, retrying
00331             // if no endpoints are available.  It is used to put servers
00332             // under stress.
00333             if (RpcExceptionCode() != EPT_S_NOT_REGISTERED &&
00334                 RpcExceptionCode() != RPC_S_SERVER_UNAVAILABLE) {
00335 #endif
00336                 // Deallocate all the thread data before failing.
00337                 ShutdownThread(pReq);
00338                 AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: c_RemoteOpen"), RpcExceptionCode());
00339                 return;
00340 #ifdef RETRY_EXCEPTION
00341             }
00342 #endif
00343         }
00344         RpcEndExcept;
00345 #ifdef RETRY_EXCEPTION
00346     }
00347 #endif
00348
00349     // Attempt to open the local file.
00350     if ((pReq->hLocalFile = CreateFile(pReq->LocalFileName,
00351                                        GENERIC_WRITE,
00352                                        0,
00353                                        NULL,
00354                                        CREATE_ALWAYS,
00355                                        FILE_ATTRIBUTE_NORMAL,
00356                                        NULL)) == INVALID_HANDLE_VALUE) {
00357         ShutdownThread(pReq);
00358         AddToMessageLogProcFailure(TEXT("HandleReq: CreateFile"), GetLastError());
00359         return;
00360     }
00361
00362     // We need to stop impersonating before putting this request back into
00363     // a queue or quitting.
00364     if (RevertToSelf() == 0) {
00365         AddToMessageLogProcFailure(TEXT("HandleReq: RevertToSelf"), GetLastError());
00366     }
00367
00368     // Write the data received to local file.
00369     if(!WriteFile(pReq->hLocalFile,
00370                   pbBuf,
00371                   cbRead,
00372                   &cbWritten,
00373                   NULL)){
00374
00375         ShutdownThread(pReq);
00376         AddToMessageLogProcFailure(TEXT("HandleReq: WriteFile"), GetLastError());
00377         return;
00378     }
00379
00380     // If there are no errors and the call returned NULL, then
00381     // the file was read in a single call and has already been closed.
00382     // We just need to write the buffer and go for the next round.
00383     if(pReq->phContext == NULL){
00384 #ifdef PROF
00385         ProfRecordTime(pReq->nReqId, TEXT("handled"));
00386 #endif
00387         ShutdownThread(pReq);
00388         return;
00389     }
00390
00391     // Now put the request onto the appropriate active request queue.
00392     // Lookup the subqueue for the user's sid.
00393     QueueHashAddToSubqueue(ClientActiveReqHashQueues[pReq->Pri], pReq->pSID, pReq);
00394
00395 #ifdef DEBUG
00396     TCHAR Msg[MSG_SIZE];
00397
00398     _stprintf(Msg, TEXT("RequestFile: Put req %p onto ActiveReq queue %p\n"), pReq, ClientActiveReqHashQueues[pReq->Pri]);
00399     DbgMsgRecord(Msg);
00400 #endif
00401 }
00402
00403 //
00404 // Handles a request taken off active req queue
00405 //
00406 VOID HandleActiveReq(tReq *pReq) {
00407
00408     BYTE pbBuf[MAX_BUFSIZE];
00409
00410     ULONG cbRead, cbWritten;
00411
00412     //
00413     // If a request for process is picked of the active request queue.
00414     // Then we simply need to read another segment and finish the request
00415     // if necessary.
00416     //
00417
00418     // Get the remainder of text from the remote file.  When the
00419     // server returns a NULL context handle, the read has completed and
00420     // the file has been closed.
00421
00422     // We did not read anything yet.
00423     cbRead = 0;
00424
00425 #ifdef RETRY_EXCEPTION
00426     // When making aggressive calls to the server, this flag is
00427     // set when the call succeeded.  This makes the client service attempt
00428     // to contact the server even after an exception occured.
00429     BOOL bRetryCall = TRUE;
00430     while (bRetryCall) {
00431 #endif
00432
00433         RpcTryExcept {
00434             c_RemoteRead(pReq->hFileRepServer,
00435                          &(pReq->phContext),
00436                          pbBuf,
00437                          &cbRead);
00438 #ifdef RETRY_EXCEPTION
00439             bRetryCall = FALSE;
00440 #endif
00441         }
00442         RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00443                       (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00444                       (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00445                       (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00446                       (RpcExceptionCode() != STATUS_BREAKPOINT))
00447                     ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00448
00449             // Log the error code as well as the error.
00450             // Msg is sufficiently large and can't overflow.
00451             AddToMessageLogProcFailureEEInfo(TEXT("HandleActiveReq: c_RemoteRead"), RpcExceptionCode());
00452
00453 #ifdef RETRY_EXCEPTION
00454             // This code attempts to make aggressive calls, retrying
00455             // if no endpoints were available.  It is used to put servers
00456             // under stress.
00457             if (RpcExceptionCode() != EPT_S_NOT_REGISTERED &&
00458                 RpcExceptionCode() != RPC_S_SERVER_UNAVAILABLE) {
00459 #endif
00460                 // Dump this request.
00461                 ShutdownThread(pReq);
00462                 return;
00463 #ifdef RETRY_EXCEPTION
00464             }
00465 #endif
00466         }
00467         RpcEndExcept;
00468 #ifdef RETRY_EXCEPTION
00469     }
00470 #endif
00471
00472     // Access check was done on opening when we were impersonating.
00473     // Thus we do not need to impersonate in this code.
00474     if(!WriteFile(pReq->hLocalFile,
00475                   pbBuf,
00476                   cbRead,
00477                   &cbWritten,
00478                   NULL)) {
00479
00480         AddToMessageLogProcFailure(TEXT("HandleActiveReq: WriteFile failed with code %d"), GetLastError());
00481         ShutdownThread(pReq);
00482         return;
00483     }
00484
00485     if (pReq->phContext == NULL) {
00486 #ifdef PROF
00487         ProfRecordTime(pReq->nReqId, TEXT("handled"));
00488 #endif
00489         ShutdownThread(pReq);
00490     }
00491     else {
00492         // We are not done and the request needs to go back onto queue.
00493         // Put the request onto the appropriate active request queue.
00494         QueueHashAddToSubqueue(ClientActiveReqHashQueues[pReq->Pri], pReq->pSID, pReq);
00495
00496 #ifdef DEBUG
00497         TCHAR Msg[MSG_SIZE];
00498
00499         _stprintf(Msg, TEXT("RequestFile: Put req %p onto ActiveReq queue %p\n"), pReq, ClientActiveReqHashQueues[pReq->Pri]);
00500         DbgMsgRecord(Msg);
00501 #endif
00502     }
00503 }
00504
00505 //
00506 // Handles the requests placed on req queue and active req queue
00507 // and returns when no requests are available.
00508 //
00509 VOID ServiceRequests(BOOL bIsRPCThread) {
00510
00511     UINT i = 0;
00512
00513     time_t tReqArrived;
00514
00515 #ifdef DEBUG
00516     TCHAR Msg[MSG_SIZE];
00517 #endif
00518
00519     DWORD status;
00520
00521     Req *pReq = NULL;
00522
00523     BOOL FoundReq = TRUE;
00524     BOOL FoundActiveReq = TRUE;
00525
00526     ULONG ThreadIdentifier;
00527     HANDLE hThread;
00528
00529     tReqArrived = time(NULL);
00530
00531     //
00532     // We will now go and check if the request or the active request sets of queues have anything that we
00533     // can service.  If they do not, then this thread can terminate.
00534     //
00535
00536     while(FoundReq || FoundActiveReq) {
00537
00538         // If this thread has handled too many requests
00539         // we want to allow it to return.  We will spawn a new
00540         // worker thread in its place.
00541         // This way a client will receive the synchronous reply.
00542
00543         if (bIsRPCThread && ((time(NULL) - tReqArrived) >= tServerThread)) {
00544             if ((hThread = CreateThread(NULL,
00545                                         0,
00546                                         (LPTHREAD_START_ROUTINE) ServiceRequests,
00547                                         (PVOID) FALSE,
00548                                         0,
00549                                         &ThreadIdentifier)) == NULL) {
00550
00551                 ShutdownThread(pReq);
00552                 AddToMessageLogProcFailure(TEXT("ServiceRequests: CreateThread"), GetLastError());
00553                 return;
00554             }
00555
00556             // Unless we close a handle to the thread, it will remain in the
00557             // system even after its execution has terminated.
00558             status = CloseHandle(hThread);
00559             ASSERTE(status != 0);
00560
00561             return;
00562         }
00563
00564         // Check if the request queues have anything on them.  If they do,
00565         // pick a request off the highest priority queue and handle it, but only if we
00566         // are not handling enough of those requests already.
00567         for (UINT pri = NumPriGroups; pri > 0; pri--) {
00568             pReq = (Req *) QueueRemove(ClientReqQueues[pri-1]);
00569             if (pReq != NULL) {
00570                 break;
00571             }
00572   }
00573
00574         if (pReq != NULL) {
00575
00576 #ifdef DEBUG
00577             _stprintf(Msg, TEXT("RequestFile: Took req %p off Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
00578             DbgMsgRecord(Msg);
00579 #endif
00580
00581             if (CounterIncrement(pClientActiveReqCounters[pReq->Pri])) {
00582                 if (QueueHashIncrementCounter(ClientActiveReqHashCounters[pReq->Pri], pReq->pSID)) {
00583 #ifdef DEBUG
00584                     _stprintf(Msg, TEXT("Incremented ClientActiveReqCounters[%d] and ClientActiveReqHashCounters[%d]\n"), pReq->Pri, pReq->Pri);
00585                     DbgMsgRecord(Msg);
00586 #endif
00587                     FoundReq = TRUE;
00588
00589                     // The request now resides on a new queue.
00590                     CounterDecrement(pClientReqCounters[pReq->Pri]);
00591 #ifdef DEBUG
00592                     _stprintf(Msg, TEXT("Decremented ClientReqCounters[%d]\n"), pReq->Pri);
00593                     DbgMsgRecord(Msg);
00594 #endif
00595                     pReq->State = StateActive;
00596
00597                     HandleReq(pReq);
00598                 }
00599                 else {
00600                     // There were too many requests for a given SID, place the request back
00601                     // onto the queue.
00602
00603                     // Don't forget to decrement the counter for the group!
00604                     CounterDecrement(pClientActiveReqCounters[pReq->Pri]);
00605
00606                     QueueAdd(ClientReqQueues[pReq->Pri], pReq, TRUE);
00607
00608                     // Even though we found a request, we could not process it.
00609                     // Thus, to ensure that a thread will not spin waiting for space
00610                     // for an active request we set this flag.
00611                     FoundReq = FALSE;
00612
00613 #ifdef DEBUG
00614                     _stprintf(Msg, TEXT("Too many active requests for a SID\n"));
00615                     DbgMsgRecord(Msg);
00616                     _stprintf(Msg, TEXT("RequestFile: Put req %p onto Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
00617                     DbgMsgRecord(Msg);
00618 #endif
00619                 }
00620             }
00621             else {
00622                 // There were too many active requests for the user group, place the request back
00623                 // onto the queue.
00624
00625                 QueueAdd(ClientReqQueues[pReq->Pri], pReq, TRUE);
00626
00627                 FoundReq = FALSE;
00628
00629 #ifdef DEBUG
00630                 _stprintf(Msg, TEXT("Too many active requests for priority %d\n"), pReq->Pri);
00631                 DbgMsgRecord(Msg);
00632                 _stprintf(Msg, TEXT("RequestFile: Put req %p onto Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
00633                 DbgMsgRecord(Msg);
00634 #endif
00635             }
00636         }
00637         else {
00638             // We did not find any passive queued requests to be handled.
00639             FoundReq = FALSE;
00640         }
00641
00642         // Check if the active request queues have anything on them.  If they do,
00643         // pick a request off the highest priority queue and handle it.
00644         for (pri = NumPriGroups; pri > 0; pri--) {
00645             pReq = (Req *) QueueHashRemoveFromSubqueue(ClientActiveReqHashQueues[pri-1]);
00646             if (pReq != NULL) {
00647                 break;
00648             }
00649         }
00650
00651         if (pReq != NULL) {
00652
00653             FoundActiveReq = TRUE;
00654
00655 #ifdef DEBUG
00656             _stprintf(Msg, TEXT("RequestFile: Took req %p off ActiveReq queue %p\n"), pReq, ClientActiveReqHashQueues[pReq->Pri]);
00657             DbgMsgRecord(Msg);
00658 #endif
00659             HandleActiveReq(pReq);
00660         }
00661         else {
00662             // We did not find any active requests to be handled.
00663             FoundActiveReq = FALSE;
00664         }
00665     }
00666
00667     // No requests on either of the queues; the thread can return.
00668 }
00669
00670 /*
00671     FUNCTIONS: IsSecureClient
00672
00673     PURPOSE:
00674         Returns TRUE if the service is being contacted by a proper
00675       authenticated client.
00676
00677     PARAMETERS:
00678         Self-explanatory.
00679
00680     RETURN VALUE: TRUE if YES, FALSE otherwise or on error.
00681
00682 */
00683 BOOL IsSecureClient(handle_t hFileRepClient, Req *pReq) {
00684     RPC_AUTHZ_HANDLE hAuth;
00685     ULONG ulAuthnLevel;
00686
00687     // Get client security info.
00688     if (RpcBindingInqAuthClient(pReq->hFileRepClient,
00689                                 &hAuth,
00690                                 NULL,
00691                                 &ulAuthnLevel,
00692                                 NULL,
00693                                 NULL) != RPC_S_OK) {
00694         AddRpcEEInfo(GetLastError(), TEXT("RequestFile: RpcBindingInqAuthClient failed"));
00695         return FALSE;
00696     }
00697
00698     // Make sure the client has adequate security measures.
00699     // Since this is LRPC, we get the security level of privacy
00700     // because it is the only available security level.
00701     // We do not interoperate with old versions of FileRep
00702     // client utilities, since appropriate versions should be
00703     // available with the local system service.
00704     if (ulAuthnLevel != RPC_C_AUTHN_LEVEL_PKT_PRIVACY) {
00705         AddRpcEEInfo(RPC_S_SEC_PKG_ERROR, TEXT("RequestFile: ulAuthnLevel != RPC_C_AUTHN_LEVEL_PKT_PRIVACY"));
00706         return FALSE;
00707     }
00708
00709     return TRUE;
00710 }
00711
00712 /*
00713     FUNCTIONS: RequestFile
00714
00715     PURPOSE:
00716         Called by FileRep to have the Client System
00717       Service request file replication from a Server System Service.
00718       The function processes rpc request and places it in a request
00719       queue.  It then checks the request and active request queues for
00720       requests to process, or exits.
00721
00722     PARAMETERS:
00723         Self-explanatory.
00724
00725     RETURN VALUE: none
00726
00727 */
00728 VOID RequestFile(handle_t hFileRepClient,
00729                  LPTSTR ServerName,
00730                  LPTSTR RemoteFileName,
00731                  LPTSTR LocalFileName) {
00732
00733     RPC_STATUS rpcstatus;
00734
00735     Req *pReq = NULL;
00736
00737     // The string binding that is used to make sure clients contact the
00738     // service via an LRPC call.
00739     LPTSTR StringBinding;
00740
00741     // The protocol sequence that gets extracted from the string binding.
00742     LPTSTR ProtSeq;
00743
00744     TCHAR Msg[MSG_SIZE];
00745
00746 #ifdef DEBUG
00747     DbgMsgRecord(TEXT("-> RequestFile\n"));
00748 #endif
00749
00750     if((pReq = (Req *) AutoHeapAlloc(sizeof(Req))) == NULL) {
00751         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
00752         return;
00753     }
00754
00755     // Set pReq' fields to NULL so that we will know
00756     // in ShutdownThread which ones have been initialized.
00757     pReq->hFileRepServer = NULL;
00758
00759     pReq->hFileRepClient = hFileRepClient;
00760
00761     pReq->hTokenHandle = NULL;
00762
00763     pReq->hLocalFile = NULL;
00764     pReq->phContext = NULL;
00765     pReq->bRpcImpersonating = FALSE;
00766     pReq->bImpersonating = FALSE;
00767     pReq->Pri = 0;
00768     pReq->State = StateArrived;
00769
00770     pReq->ServerName = NULL;
00771     pReq->RemoteFileName = NULL;
00772     pReq->LocalFileName = NULL;
00773
00774     pReq->pSID = NULL;
00775
00776     // Copy strings out since they may need to be allocated longer then
00777     // the arguments that live on the stack.
00778     // It is conceivable that this thread will put the
00779     // request on the queue and some other thread will
00780     // handle the request after this thread has exited.
00781     if ((pReq->ServerName = (LPTSTR) AutoHeapAlloc((_tcslen(ServerName)+1) * sizeof(TCHAR))) == NULL) {
00782         ShutdownThread(pReq);
00783         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
00784         return;
00785     }
00786     CopyMemory(pReq->ServerName, ServerName, (_tcslen(ServerName)+1) * sizeof(TCHAR));
00787     if ((pReq->RemoteFileName = (LPTSTR) AutoHeapAlloc((_tcslen(RemoteFileName)+1) * sizeof(TCHAR))) == NULL) {
00788         ShutdownThread(pReq);
00789         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
00790         return;
00791     }
00792     CopyMemory(pReq->RemoteFileName, RemoteFileName, (_tcslen(RemoteFileName)+1) * sizeof(TCHAR));
00793     if ((pReq->LocalFileName = (LPTSTR) AutoHeapAlloc((_tcslen(LocalFileName)+1) * sizeof(TCHAR))) == NULL) {
00794         ShutdownThread(pReq);
00795         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
00796         return;
00797     }
00798     CopyMemory(pReq->LocalFileName, LocalFileName, (_tcslen(LocalFileName)+1) * sizeof(TCHAR));
00799
00800 #ifdef PROF
00801     static ULONG nTotalId;
00802
00803     EnterCriticalSection(&ProfCriticalSection);
00804
00805     // Record the number of the current request.
00806     pReq->nReqId = nTotalId;
00807     // Increment the number of the request.
00808     nTotalId++;
00809
00810     LeaveCriticalSection(&ProfCriticalSection);
00811
00812     _stprintf(Msg, TEXT("name=\"%s\" arrived"), RemoteFileName);
00813
00814     // Record the time of arrival of this request.
00815     ProfRecordTime(pReq->nReqId, Msg);
00816 #endif
00817
00818     // Make sure that the client utility is local.
00819     // Client system service only services LRPC calls.
00820     if ((rpcstatus = RpcBindingToStringBinding(pReq->hFileRepClient, &StringBinding)) != RPC_S_OK) {
00821         ShutdownThread(pReq);
00822         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcBindingToStringBinding failed"));
00823         return;
00824     }
00825     if ((rpcstatus = RpcStringBindingParse(StringBinding, NULL, &ProtSeq, NULL, NULL, NULL)) != RPC_S_OK) {
00826
00827         // Free the string binding.
00828         rpcstatus = RpcStringFree(&StringBinding);
00829         ASSERTE(rpcstatus == RPC_S_OK);
00830
00831         ShutdownThread(pReq);
00832         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcStringBindingParse failed"));
00833         return;
00834     }
00835     if (_tcscmp(ProtSeq, TEXT("ncalrpc")) != 0) {
00836
00837         // Free the string binding.
00838         rpcstatus = RpcStringFree(&StringBinding);
00839         ASSERTE(rpcstatus == RPC_S_OK);
00840         // And the protocol sequence
00841         rpcstatus = RpcStringFree(&ProtSeq);
00842         ASSERTE(rpcstatus == RPC_S_OK);
00843
00844         ShutdownThread(pReq);
00845         AddRpcEEInfoAndRaiseException(RPC_S_INVALID_RPC_PROTSEQ, TEXT("RequestFile: _tcscmp(ProtSeq, TEXT(\"ncalrpc\")) != 0"));
00846         return;
00847     }
00848
00849     // Free the string binding.
00850     rpcstatus = RpcStringFree(&StringBinding);
00851     ASSERTE(rpcstatus == RPC_S_OK);
00852     // And the protocol sequence.
00853     rpcstatus = RpcStringFree(&ProtSeq);
00854     ASSERTE(rpcstatus == RPC_S_OK);
00855
00856     if (!IsSecureClient(hFileRepClient, pReq)) {
00857         ShutdownThread(pReq);
00858         AddRpcEEInfoAndRaiseException(RPC_S_SEC_PKG_ERROR, TEXT("RequestFile: IsSecureClient failed"));
00859         return;
00860     }
00861
00862     //
00863     // Check that we are not exceeding the bound on the number
00864     // of concurrent requests for this user's priority group.
00865     // And update the number of such requests.
00866     //
00867
00868     // Impersonate the caller so that we can get the caller's SID
00869     if ((rpcstatus = RpcImpersonateClient(pReq->hFileRepClient)) != RPC_S_OK) {
00870         ShutdownThread(pReq);
00871         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcImpersonateClient failed"));
00872         return;
00873     }
00874     pReq->bRpcImpersonating = TRUE;
00875
00876     // We need to write down the access token for the user so that
00877     // we can use it for impersonation later when the client binding handle
00878     // gets deallocated.
00879     if (OpenThreadToken(GetCurrentThread(),
00880                         TOKEN_QUERY | TOKEN_IMPERSONATE,
00881                         TRUE,
00882                         &pReq->hTokenHandle) == 0) {
00883
00884         ShutdownThread(pReq);
00885         AddRpcEEInfoAndRaiseException(GetLastError(), TEXT("RequestFile: OpenThreadToken failed"));
00886         return;
00887     }
00888
00889     // Determine current user's priority level.  This corresponds to the
00890     // priority level of the callee, since we are impersonating.
00891     pReq->Pri = GetCurrentUserPriority();
00892
00893     // Write down the SID for the user.
00894     pReq->pSID = GetUserSID();
00895
00896     // Stop impersonating.  We got what we wanted.
00897     if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
00898         pReq->bRpcImpersonating = FALSE;
00899
00900         ShutdownThread(pReq);
00901         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcRevertToSelf failed"));
00902         return;
00903     }
00904     pReq->bRpcImpersonating = FALSE;
00905
00906 #ifdef DEBUG
00907     _stprintf(Msg, TEXT("RequestFile: Pri=%d for req %p\n"), pReq->Pri, pReq);
00908     DbgMsgRecord(Msg);
00909 #endif
00910
00911     // Increment the counter for the number of concurrent requests.
00912     if (!CounterIncrement(pClientReqCounters[pReq->Pri])) {
00913
00914         ShutdownThread(pReq);
00915         // We have to raise exception after deallocating the data
00916         // since there is a possibility that a client thread
00917         // will retry and will attempt to open this local file
00918         // while it's previous request is still holding a lock.
00919         // This has been actually hit on an overloaded system.
00920         AddRpcEEInfoAndRaiseException(RPC_S_SERVER_TOO_BUSY, TEXT("RequestFile: CounterIncrement failed"));
00921         return;
00922     }
00923 #ifdef DEBUG
00924     _stprintf(Msg, TEXT("Incremented ClientReqCounters[%d]\n"), pReq->Pri);
00925     DbgMsgRecord(Msg);
00926 #endif
00927
00928     pReq->State = StateQueued;
00929
00930     // Place the request onto the queue.
00931     QueueAdd(ClientReqQueues[pReq->Pri], pReq, TRUE);
00932 #ifdef DEBUG
00933     _stprintf(Msg, TEXT("RequestFile: Put req %p onto Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
00934     DbgMsgRecord(Msg);
00935 #endif
00936
00937     //
00938     // After this point we can not throw exceptions, because we may be handling
00939     // a different request after placing the arriving request onto the queue.
00940     // We will log messages instead.
00941     //
00942
00943     // Go service some requests, remember that you are
00944     // an RPC thread.
00945     ServiceRequests(TRUE);
00946
00947 #ifdef DEBUG
00948     DbgMsgRecord(TEXT("<- RequestFile\n"));
00949 #endif
00950
00951     return;
00952 }
00953
00954 // end FileRepClientProc.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RqsClient Member List

This is the complete list of members for RqsClient, including all inherited members.
AssignSocket(IN RuSocket *pSocket) | RqsClient |
GetAddressH() | RqsClient |
GetAddressN() | RqsClient |
GetAddressPsz() | RqsClient |
GetState() | RqsClient | [inline]
GetString() | RqsClient | [inline]
GetUsername() | RqsClient |
m_dwAddressH | RqsClient | [private]
m_pEngine | RqsClient | [private]
m_pSocket | RqsClient | [private]
m_pszAddress | RqsClient | [private]
m_pszBuffer | RqsClient | [private]
m_pszString | RqsClient | [private]
m_pszUsername | RqsClient | [private]
m_State | RqsClient | [private]
m_uiBytesRead | RqsClient | [private]
m_uiMessageSize | RqsClient | [private]
ReceiveMessage() | RqsClient |
RqsClient() | RqsClient |
SendResponse(IN BOOL fOk) | RqsClient |
SetEngine(IN RqsEngine *pEngine) | RqsClient | [inline]
~RqsClient() | RqsClient |
Generated on Wed Nov 13 2024 16:57:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/stdafx.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

stdafx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__16E6A87A_DDB5_493E_B39B_A3AEE9375813__INCLUDED_)
00006 #define AFX_STDAFX_H__16E6A87A_DDB5_493E_B39B_A3AEE9375813__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 //
00013 //For mspbase
00014 //
00015 #define STRICT
00016
00017 //#define _ATL_APARTMENT_THREADED
00018
00019 #include <atlbase.h>
00020 //You may derive a class from CComModule and use it if you want to override
00021 //something, but do not change the name of _Module
00022 extern CComModule _Module;
00023 #include <atlcom.h>
00024 #include <mspbase.h>
00025
00026 #include "resource.h"
00027 //
00028 //generated by MIDL
00029 //
00030 #include "PlgTermSample.h"
00031
00032
00033 //{{AFX_INSERT_LOCATION}}
00034 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00035
00036 #endif // !defined(AFX_STDAFX_H__16E6A87A_DDB5_493E_B39B_A3AEE9375813__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Reg.h Source File

  • NetDS
  • SyncMgr
  • SyncDir

Reg.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012
00013 #ifndef _REGROUTINES_
00014 #define _REGROUTINES_
00015
00016
00017 #define GUID_SIZE 128
00018 #define MAX_STRING_LENGTH 256
00019
00020 BOOL SetRegKeyValue(HKEY hKeyTop,LPTSTR pszKey,LPTSTR pszSubkey,LPTSTR pszValue);
00021 BOOL AddRegNamedValue(LPTSTR pszKey,LPTSTR pszSubkey,LPTSTR pszValueName,LPTSTR pszValue);
00022
00023 HKEY CreateHandlerPrefKey(CLSID CLSIDServer);
00024
00025 STDMETHODIMP Reg_SetItemSettingsForHandlerItem(CLSID CLSIDServer,SYNCMGRITEMID ItemID,LPSAMPLEITEMSETTINGS pSampleItemSettings);
00026 STDMETHODIMP Reg_GetItemSettingsForHandlerItem(HKEY hKeyHandler,SYNCMGRITEMID ItemID,LPSAMPLEITEMSETTINGS pSampleItemSettings);
00027 STDMETHODIMP Reg_DeleteItemIdForHandlerItem(CLSID CLSIDServer,SYNCMGRITEMID ItemID);
00028
00029
00030 #endif // _REGROUTINES_
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/staticnode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

staticnode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  StaticNode.cpp: implementation of the CStaticNode class.
00014 //
00015
00016 #include "StaticNode.h"
00017
00018
00019 // Initialize our static GUID just once
00020 GUID CStaticNode::thisGUID = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00021
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // Construction/Destruction
00025
00026 CStaticNode::CStaticNode()
00027 {
00028   m_pCompData = NULL;
00029 }
00030
00031
00032 CStaticNode::~CStaticNode()
00033 {
00034 }
00035
00036 //---------------------------------------------------------------------------
00037 HRESULT CStaticNode::Initialize( NODE_PROPERTIES* pNodeProps )
00038 {
00039   _ASSERT( NULL != pNodeProps );
00040   _ASSERT( NULL != pNodeProps->pComponentData );
00041
00042   SIZE_T nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00043   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00044   wcscpy( pszTmp, pNodeProps->szNodeName );
00045   if( NULL != m_pwszNodeName )
00046     CoTaskMemFree( m_pwszNodeName );
00047
00048   m_pwszNodeName = pszTmp;
00049   m_pCompData    = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00050
00051   return S_OK;
00052 }
00053
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // Implementation of virtual methods
00057
00058
00059 //---------------------------------------------------------------------------
00060 //  The minimum implementation of this method is to return the
00061 //  Persistable View Description string.  This string must be allocated
00062 //  with CoTaskMemAlloc.  The console will free the string.
00063 //
00064 HRESULT CStaticNode::GetResultViewType2
00065 (
00066   MMC_COOKIE             nCookie,  //[in] Identifier of object
00067   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00068 )
00069 {
00070   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+1 );
00071   if( NULL == pszDescStr )
00072     return E_OUTOFMEMORY;
00073
00074   wcscpy( pszDescStr, L"DefaultListView" );
00075   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00076
00077   return S_OK;
00078 }
00079
00080
00081 //---------------------------------------------------------------------------
00082 HRESULT CStaticNode::GetDisplayInfo
00083 (
00084   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00085 )
00086 {
00087   _ASSERT( NULL != pSDI );
00088   pSDI->displayname = m_pwszNodeName;
00089
00090   return S_OK;
00091 }
00092
00093 //---------------------------------------------------------------------------
00094 HRESULT CStaticNode::GetDisplayInfo
00095 (
00096   RESULTDATAITEM* pRDI
00097 )
00098 {
00099   return S_FALSE;
00100 }
00101
00102 /////////////////////////////////////////////////////////////////////////////
00103 // Implementation of notification handlers
00104
00105
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCertPolicySample Member List

This is the complete list of members for CCertPolicySample, including all inherited members.
_AddAuthorityInfoAccessExtension(IN ICertServerPolicy *pServer) | CCertPolicySample | [protected]
_AddAuthorityKeyId(IN ICertServerPolicy *pServer) | CCertPolicySample | [private]
_AddAuthorityKeyId(IN ICertServerPolicy *pServer) | CCertPolicySample | [protected]
_AddCertTypeExtension(IN ICertServerPolicy *pServer, IN BOOL fCA) | CCertPolicySample | [protected]
_AddDefaultBasicConstraintsExtension(IN ICertServerPolicy *pServer, IN BOOL fCA) | CCertPolicySample | [private]
_AddDefaultBasicConstraintsExtension(IN ICertServerPolicy *pServer, IN BOOL fCA) | CCertPolicySample | [protected]
_AddDefaultKeyUsageExtension(IN ICertServerPolicy *pServer, IN BOOL fCA) | CCertPolicySample | [private]
_AddDefaultKeyUsageExtension(IN ICertServerPolicy *pServer, IN BOOL fCA) | CCertPolicySample | [protected]
_AddEnhancedKeyUsageExtension(IN ICertServerPolicy *pServer) | CCertPolicySample | [private]
_AddOldCertTypeExtension(IN ICertServerPolicy *pServer, IN BOOL fCA) | CCertPolicySample | [private]
_AddRevocationExtension(IN ICertServerPolicy *pServer) | CCertPolicySample | [private]
_AddRevocationExtension(IN ICertServerPolicy *pServer) | CCertPolicySample | [protected]
_AddStringArray(IN WCHAR const *pwszzValue, IN BOOL fURL, IN OUT DWORD *pcStrings, IN OUT LPWSTR **papwszRegValues) | CCertPolicySample | [private]
_AddStringArray(IN WCHAR const *pwszzValue, IN BOOL fURL, IN OUT DWORD *pcStrings, IN OUT LPWSTR **papstrRegValues) | CCertPolicySample | [protected]
_AddSubjectAltNameExtension(IN ICertServerPolicy *pServer, IN DWORD iAltName) | CCertPolicySample | [protected]
_Cleanup() | CCertPolicySample | [private]
_Cleanup() | CCertPolicySample | [protected]
_EnumerateExtensions(IN ICertServerPolicy *pServer, IN LONG bNewRequest, IN BOOL fFirstPass, IN BOOL fEnableEnrolleeExtensions, IN DWORD cCriticalExtensions, IN WCHAR const *const *apwszCriticalExtensions) | CCertPolicySample | [private]
_EnumerateExtensions(IN ICertServerPolicy *pServer, IN LONG bNewRequest, OPTIONAL OUT BOOL *pfCA) | CCertPolicySample | [protected]
_FreeStringArray(IN OUT DWORD *pcString, IN OUT LPWSTR **papwsz) | CCertPolicySample | [private]
_FreeStringArray(IN OUT DWORD *pcString, IN OUT LPWSTR **papstr) | CCertPolicySample | [protected]
_GetIssuer(IN ICertServerPolicy *pServer) | CCertPolicySample | [private]
_GetIssuer(IN ICertServerPolicy *pServer) | CCertPolicySample | [protected]
_InitAuthorityInfoAccessExtension(IN HKEY hkey) | CCertPolicySample | [protected]
_InitDisableExtensionList(IN HKEY hkey) | CCertPolicySample | [private]
_InitDisableExtensionList(IN HKEY hkey) | CCertPolicySample | [protected]
_InitRequestExtensionList(IN HKEY hkey) | CCertPolicySample | [private]
_InitRequestExtensionList(IN HKEY hkey) | CCertPolicySample | [protected]
_InitRevocationExtension(IN HKEY hkey) | CCertPolicySample | [private]
_InitRevocationExtension(IN HKEY hkey) | CCertPolicySample | [protected]
_InitSubjectAltNameExtension(IN HKEY hkey, IN WCHAR const *pwszRegName, IN WCHAR const *pwszObjectId, IN DWORD iAltName) | CCertPolicySample | [protected]
_ReadRegistryString(IN HKEY hkey, IN BOOL fURL, IN WCHAR const *pwszRegName, IN WCHAR const *pwszSuffix, OUT LPWSTR *pwszRegValue) | CCertPolicySample | [private]
_ReadRegistryString(IN HKEY hkey, IN BOOL fURL, IN WCHAR const *pwszRegName, IN WCHAR const *pwszSuffix, OUT LPWSTR *pwszRegValue) | CCertPolicySample | [protected]
_ReadRegistryStringArray(IN HKEY hkey, IN BOOL fURL, IN DWORD dwFlags, IN DWORD cRegNames, IN DWORD *aFlags, IN WCHAR const *const *apwszRegNames, IN OUT DWORD *pcStrings, IN OUT LPWSTR **papwszRegValues) | CCertPolicySample | [private]
_ReadRegistryStringArray(IN HKEY hkey, IN BOOL fURL, IN DWORD dwFlags, IN DWORD cRegNames, IN DWORD *aFlags, IN WCHAR const *const *apwszRegNames, IN OUT DWORD *pcStrings, IN OUT LPWSTR **papstrRegValues) | CCertPolicySample | [protected]
_SetSystemStringProp(IN ICertServerPolicy *pServer, IN WCHAR const *pwszName, OPTIONAL IN WCHAR const *pwszValue) | CCertPolicySample | [private]
_SetValidityPeriod(IN ICertServerPolicy *pServer) | CCertPolicySample | [private]
_SetValidityPeriod(IN ICertServerPolicy *pServer) | CCertPolicySample | [protected]
AddBasicConstraintsCommon(IN ICertServerPolicy *pServer, IN CERT_EXTENSION const *pExtension, IN BOOL fCA, IN BOOL fEnableExtension) | CCertPolicySample |
AddBasicConstraintsCommon(IN ICertServerPolicy *pServer, IN CERT_EXTENSION const *pExtension, IN BOOL fCA, IN BOOL fEnableExtension) | CCertPolicySample |
AddV1TemplateNameExtension(IN ICertServerPolicy *pServer, OPTIONAL IN WCHAR const *pwszTemplateName) | CCertPolicySample |
CCertPolicySample() | CCertPolicySample | [inline]
CCertPolicySample() | CCertPolicySample | [inline]
DECLARE_REGISTRY(CCertPolicySample, wszCLASS_CERTPOLICYSAMPLE TEXT(".1"), wszCLASS_CERTPOLICYSAMPLE, IDS_CERTPOLICY_DESC, THREADFLAGS_BOTH) STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) | CCertPolicySample |
DECLARE_REGISTRY(CCertPolicySample, wszCLASS_CERTPOLICYSAMPLE TEXT(".1"), wszCLASS_CERTPOLICYSAMPLE, IDS_CERTPOLICY_DESC, THREADFLAGS_BOTH) STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) | CCertPolicySample |
GetDescription(BSTR __RPC_FAR *pstrDescription) | CCertPolicySample |
GetDescription(BSTR __RPC_FAR *pstrDescription) | CCertPolicySample |
GetManageModule(ICertManageModule **ppManageModule) | CCertPolicySample |
GetPolicyDescription() | CCertPolicySample | [inline]
Initialize(BSTR const strConfig) | CCertPolicySample |
Initialize(BSTR const strConfig) | CCertPolicySample |
m_apstrCDPRevocationURL | CCertPolicySample | [protected]
m_apstrDisableExtensions | CCertPolicySample | [protected]
m_apstrEnableRequestExtensions | CCertPolicySample | [protected]
m_apstrIssuerCertURL | CCertPolicySample | [protected]
m_apwszDisableExtensions | CCertPolicySample | [private]
m_apwszEnableEnrolleeRequestExtensions | CCertPolicySample | [private]
m_apwszEnableRequestExtensions | CCertPolicySample | [private]
m_astrSubjectAltNameObjectId | CCertPolicySample | [protected]
m_astrSubjectAltNameProp | CCertPolicySample | [protected]
m_bstrCAName | CCertPolicySample | [protected]
m_bstrCASanitizedDSName | CCertPolicySample | [protected]
m_bstrCASanitizedName | CCertPolicySample | [protected]
m_bstrDescription | CCertPolicySample | [protected]
m_bstrMachineDNSName | CCertPolicySample | [protected]
m_CAPathLength | CCertPolicySample | [private]
m_CAType | CCertPolicySample | [private]
m_cCDPRevocationURL | CCertPolicySample | [protected]
m_cDisableExtensions | CCertPolicySample | [private]
m_cEnableEnrolleeRequestExtensions | CCertPolicySample | [private]
m_cEnableRequestExtensions | CCertPolicySample | [private]
m_CertType | CCertPolicySample | [protected]
m_cIssuerCertURL | CCertPolicySample | [protected]
m_dwDispositionFlags | CCertPolicySample | [private]
m_dwEditFlags | CCertPolicySample | [private]
m_dwIssuerCertURLFlags | CCertPolicySample | [protected]
m_dwRevocationFlags | CCertPolicySample | [private]
m_hrLastUpdateResult | CCertPolicySample | [protected]
m_iCert | CCertPolicySample | [private]
m_iCRL | CCertPolicySample | [private]
m_pCert | CCertPolicySample | [private]
m_pCert | CCertPolicySample | [protected]
m_PolicyCriticalSection | CCertPolicySample | [protected]
m_strCAName | CCertPolicySample | [private]
m_strCASanitizedDSName | CCertPolicySample | [private]
m_strCASanitizedName | CCertPolicySample | [private]
m_strDescription | CCertPolicySample | [private]
m_strMachineDNSName | CCertPolicySample | [private]
m_strRegStorageLoc | CCertPolicySample | [private]
m_wszASPRevocationURL | CCertPolicySample | [private]
m_wszRegStorageLoc | CCertPolicySample | [protected]
ShutDown() | CCertPolicySample |
ShutDown() | CCertPolicySample |
VerifyRequest(BSTR const strConfig, LONG Context, LONG bNewRequest, LONG Flags, LONG __RPC_FAR *pDisposition) | CCertPolicySample |
VerifyRequest(BSTR const strConfig, LONG Context, LONG bNewRequest, LONG Flags, LONG __RPC_FAR *pDisposition) | CCertPolicySample |
~CCertPolicySample() | CCertPolicySample |
~CCertPolicySample() | CCertPolicySample |
Generated on Wed Nov 13 2024 16:55:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/resource.h Source File

  • SysMgmt
  • MMC
  • Toolbar

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDR_TOOLBAR1                    112
00012 #define IDB_SMOPEN                      116
00013 #define IDB_SMBMP                       117
00014 #define IDB_LGBMP                       118
00015 #define IDR_SMICONS                     120
00016 #define IDR_LGICONS                     121
00017 #define IDB_ROCKET                      40004
00018 #define IDB_CAR                         40005
00019 #define IDB_PLANE                       40006
00020 #define IDB_BIKE                        40007
00021 #define IDB_ROCKET2                     40008
00022 #define IDB_CAR2                        40009
00023 #define IDB_PLANE2                      40010
00024 #define IDB_BIKE2                       40011
00025 #define IDB_CLOSED2                     40012
00026 #define IDB_OPEN2                       40013
00027 #define IDB_CLOSED                      40014
00028 #define IDB_OPEN                        40015
00029 #define ID_COMMAND_COMMAND1             40016
00030 #define ID_COMMAND_COMMAND2             40017
00031 #define ID_COMMAND_COMMAND3             40018
00032 #define ID_COMMAND_COMMAND4             40020
00033 #define ID_BUTTONSTART                  40021
00034 #define ID_BUTTONPAUSE                  40022
00035 #define ID_BUTTONSTOP                   40023
00036
00037
00038 // Next default values for new objects
00039 //
00040 #ifdef APSTUDIO_INVOKED
00041 #ifndef APSTUDIO_READONLY_SYMBOLS
00042 #define _APS_NEXT_RESOURCE_VALUE        119
00043 #define _APS_NEXT_COMMAND_VALUE         40024
00044 #define _APS_NEXT_CONTROL_VALUE         1000
00045 #define _APS_NEXT_SYMED_VALUE           101
00046 #endif
00047 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/extend.h Source File

  • SysMgmt
  • MMC
  • Complete

extend.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _EXTEND_H
00021 #define _EXTEND_H
00022
00023 #include <tchar.h>
00024
00025 struct NODESTRUCT
00026 {
00027     GUID  GUID;
00028     _TCHAR  szDescription[256];
00029 };
00030
00031 #endif // _EXTEND_H
00032
00033
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerServe/Factory.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerServe

Factory.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.H
00003
00004   Summary:   Include file for the class factory COM object: CFPageList.
00005              This constitutes the PERSERVE server's class factory for the
00006              CLSID_PageList COM component.
00007
00008              This multiple interface COM Object Class is achieved via the
00009              technique of nested classes: the implementation of the
00010              standard IClassFactory interface is nested inside of the
00011              class factory COM object class. APPUTIL's CThreaded OwnThis
00012              mechanism is used to ensure mutually exclusive access to the
00013              class factory by contending multiple threads.
00014
00015              For a comprehensive tutorial code tour of this module's
00016              contents and offerings see the tutorial PERSERVE.HTM
00017              file. For more specific technical details on the internal
00018              workings see the comments dispersed throughout the module's
00019              source code.
00020
00021   Classes:   CFPageList.
00022
00023   Functions: .
00024
00025   Origin:    6-10-96: atrent - Editor-inheritance from FACTORY.H in
00026                the CONSERVE Tutorial Code Sample.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 #if !defined(FACTORY_H)
00044 #define FACTORY_H
00045
00046 #ifdef __cplusplus
00047
00048 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00049   ObjectClass: CFPageList
00050
00051   Summary:     Class Factory COM Object Class for PageList COM components.
00052                Used to manufacture COPageList COM objects.  The mulitple
00053                interfaces on this COM object class are constructed via the
00054                nested interface classes technique.
00055
00056   Interfaces:  IUnknown
00057                  Standard interface providing COM object features.
00058                IClassFactory
00059                  Standard interface providing COM Class Factory features.
00060
00061   Aggregation: Yes, CFPageList COM objects are aggregatable by
00062                passing a non-NULL pUnkOuter IUnknown pointer into the
00063                constructor.
00064 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00065 class CFPageList : public IUnknown, public CThreaded
00066 {
00067   public:
00068     // Main Object Constructor & Destructor.
00069     CFPageList(IUnknown* pUnkOuter, CServer* pServer);
00070     ~CFPageList(void);
00071
00072     // IUnknown methods. Main object, non-delegating.
00073     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00074     STDMETHODIMP_(ULONG) AddRef(void);
00075     STDMETHODIMP_(ULONG) Release(void);
00076
00077     // We declare nested class interface implementations here.
00078
00079     // We implement the IClassFactory interface in this class
00080     // factory COM object class. Derive also from abstract CThreaded
00081     // to provide the OwnThis/UnOwnThis thread-safety mechanism.
00082     class CImpIClassFactory : public IClassFactory, public CThreaded
00083     {
00084       public:
00085         // Interface Implementation Constructor & Destructor.
00086         CImpIClassFactory(
00087           CFPageList* pCO,
00088           IUnknown* pUnkOuter,
00089           CServer* pServer);
00090         ~CImpIClassFactory(void);
00091
00092         // IUnknown methods.
00093         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00094         STDMETHODIMP_(ULONG) AddRef(void);
00095         STDMETHODIMP_(ULONG) Release(void);
00096
00097         // IClassFactory methods.
00098         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00099         STDMETHODIMP         LockServer(BOOL);
00100
00101       private:
00102         // Data private to this interface implementation of IClassFactory.
00103         CFPageList*   m_pCO;         // Parent Object back pointer.
00104         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00105         CServer*      m_pServer;     // Server's control object.
00106     };
00107
00108     // Make the otherwise private and nested IClassFactory interface
00109     // implementation a friend to COM object instantiations of this
00110     // CFPageList COM object class.
00111     friend CImpIClassFactory;
00112
00113   private:
00114     // Private data of CFPageList COM objects.
00115
00116     // Nested IClassFactory implementation instantiation.
00117     CImpIClassFactory m_ImpIClassFactory;
00118
00119     // Main Object reference count.
00120     ULONG             m_cRefs;
00121
00122     // Outer unknown (aggregation & delegation). Used when this
00123     // CFPageList object is being aggregated.  Otherwise it is used
00124     // for delegation if this object is reused via containment.
00125     IUnknown*         m_pUnkOuter;
00126
00127     // Pointer to this component server's control object.
00128     CServer*          m_pServer;
00129 };
00130
00131
00132 #endif // __cplusplus
00133
00134
00135 #endif // FACTORY_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/quiktest/custom.h Source File

  • Dataaccess
  • odbc
  • quiktest

custom.h

Go to the documentation of this file.
00001 //*---------------------------------------------------------------------------------
00002 //| Custom Auto Test DLL
00003 //|
00004 //| Title:  CUSTOM.H
00005 //|
00006 //| Purpose:
00007 //| This file contains the defines required for the resource strings in CUSTOM.RC.
00008 //| This file is optional for an auto test DLL.
00009 //|
00010 //| Note that user resource strings should start at 30001.
00011 //*---------------------------------------------------------------------------------
00012 #ifndef _CUSTOM_DEFS
00013 #define _CUSTOM_DEFS
00014
00015 #define idsTestName         30001
00016 #define idsHelloWorld       30002
00017 #define idsHelloWorldDesc     30003
00018 #define idsDisplayInfo        30004
00019 #define idsDisplayInfoDesc      30005
00020 #define idsSimpleConnect      30006
00021 #define idsSimpleConnectDesc    30007
00022
00023
00024 #endif
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/MTXSample/StdAfx.h Source File

  • Web
  • iis
  • Components
  • Cpp
  • MTXSample

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__5A67AAD6_37DA_11D2_955A_004005A2F9B1__INCLUDED_)
00006 #define AFX_STDAFX_H__5A67AAD6_37DA_11D2_955A_004005A2F9B1__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #define STRICT
00013 #ifndef _WIN32_WINNT
00014 #define _WIN32_WINNT 0x0400
00015 #endif
00016 #define _ATL_APARTMENT_THREADED
00017
00018 #include <atlbase.h>
00019 //You may derive a class from CComModule and use it if you want to override
00020 //something, but do not change the name of _Module
00021 extern CComModule _Module;
00022 #include <atlcom.h>
00023 #include <mtx.h>
00024 #import <msado15.dll> raw_interfaces_only no_namespace
00025
00026
00027 //{{AFX_INSERT_LOCATION}}
00028 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00029
00030 #endif // !defined(AFX_STDAFX_H__5A67AAD6_37DA_11D2_955A_004005A2F9B1__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/crowset.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

crowset.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CROWSET.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 //////////////////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 //////////////////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 /////////////////////////////////////////////////////////////////
00019 // CDataAccess::CDataAccess
00020 //
00021 /////////////////////////////////////////////////////////////////
00022 CDataAccess::CDataAccess(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00023   : CAsynchBase(eObjectType, pCMainWindow, pCMDIChild)
00024 {
00025   //eBaseClass
00026   m_eBaseClass = BASE_CLASS(m_eBaseClass | eCDataAccess);
00027
00028   //Rowset
00029   m_pIAccessor    = NULL;   //Rowset Interface
00030   m_pIColumnsInfo   = NULL;   //Rowset Interface
00031   m_pIConvertType   = NULL;   //Rowset Interface
00032   m_pIColumnsRowset = NULL;   //Rowset interface
00033
00034   //Extra Interfaces
00035
00036   //Accessor
00037   m_hAccessor     = NULL;
00038   m_cbRowSize     = 0;
00039   m_pData       = NULL;
00040
00041   //Bookmark Accessor
00042   m_hBmkAccessor    = NULL;
00043   m_bSchemaRowset   = FALSE;
00044 }
00045
00046
00047 /////////////////////////////////////////////////////////////////
00048 // CDataAccess::~CDataAccess
00049 //
00050 /////////////////////////////////////////////////////////////////
00051 CDataAccess::~CDataAccess()
00052 {
00053 }
00054
00055
00056 /////////////////////////////////////////////////////////////////
00057 // IUnknown** CDataAccess::GetInterfaceAddress
00058 //
00059 /////////////////////////////////////////////////////////////////
00060 IUnknown** CDataAccess::GetInterfaceAddress(REFIID riid)
00061 {
00062   HANDLE_GETINTERFACE(IAccessor);
00063   HANDLE_GETINTERFACE(IColumnsInfo);
00064   HANDLE_GETINTERFACE(IConvertType);
00065   HANDLE_GETINTERFACE(IColumnsRowset);
00066
00067   //Otherwise delegate
00068   return CAsynchBase::GetInterfaceAddress(riid);
00069 }
00070
00071
00072 /////////////////////////////////////////////////////////////////
00073 // HRESULT CDataAccess::AutoQI
00074 //
00075 /////////////////////////////////////////////////////////////////
00076 HRESULT CDataAccess::AutoQI(DWORD dwCreateOpts)
00077 {
00078   //Delegate First so we have base interfaces
00079   CAsynchBase::AutoQI(dwCreateOpts);
00080
00081   //[MANDATORY] Obtain [mandatory] interfaces
00082   if(dwCreateOpts & CREATE_QI_MANDATORY)
00083   {
00084     OBTAIN_INTERFACE(IColumnsInfo);
00085     OBTAIN_INTERFACE(IAccessor);
00086     OBTAIN_INTERFACE(IConvertType);
00087   }
00088
00089   //Auto QI
00090   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00091   {
00092     OBTAIN_INTERFACE(IColumnsRowset);
00093   }
00094
00095   return S_OK;
00096 }
00097
00098
00099 /////////////////////////////////////////////////////////////////
00100 // CDataAccess::AutoRelease
00101 //
00102 /////////////////////////////////////////////////////////////////
00103 HRESULT CDataAccess::AutoRelease()
00104 {
00105   //Data
00106   m_bSchemaRowset   = FALSE;
00107
00108   //ColInfo
00109   m_ColumnInfo.RemoveAll();
00110
00111   //Accessor
00112   m_Bindings.RemoveAll();
00113   ReleaseAccessor(&m_hAccessor);
00114   SAFE_FREE(m_pData);
00115   ReleaseAccessor(&m_hBmkAccessor);
00116
00117   //Rowset
00118   RELEASE_INTERFACE(IAccessor);
00119   RELEASE_INTERFACE(IColumnsInfo);
00120   RELEASE_INTERFACE(IConvertType);
00121   RELEASE_INTERFACE(IColumnsRowset);
00122
00123   //Delegate
00124   return CAsynchBase::AutoRelease();
00125 }
00126
00127
00128 /////////////////////////////////////////////////////////////////
00129 // HRESULT CDataAccess::GetColInfo
00130 //
00131 /////////////////////////////////////////////////////////////////
00132 HRESULT CDataAccess::GetColInfo()
00133 {
00134   HRESULT     hr = E_FAIL;
00135   DBORDINAL   cColumnInfo = 0;
00136   DBCOLUMNINFO* rgColumnInfo = NULL;
00137   WCHAR*      pwszStringBuffer = NULL;
00138   DBORDINAL   cHiddenColumns  = 0;
00139
00140   //Release an Previous Info
00141   m_ColumnInfo.RemoveAll();
00142
00143   //Delegate
00144   TESTC(hr = GetColInfo(&cColumnInfo, &rgColumnInfo, &pwszStringBuffer, &cHiddenColumns));
00145
00146   //Attach
00147   m_ColumnInfo.Attach(cColumnInfo, rgColumnInfo, pwszStringBuffer, cHiddenColumns);
00148
00149 CLEANUP:
00150   return hr;
00151 }
00152
00153
00154 /////////////////////////////////////////////////////////////////
00155 // HRESULT CDataAccess::GetColInfo
00156 //
00157 /////////////////////////////////////////////////////////////////
00158 HRESULT CDataAccess::GetColInfo(DBORDINAL* pcColumns, DBCOLUMNINFO** prgColumnInfo, WCHAR** ppStringBuffer, DBORDINAL* pcHiddenColumns)
00159 {
00160   HRESULT   hr = E_FAIL;
00161
00162   if(m_pIColumnsInfo)
00163   {
00164     //Get column information from the command object via IColumnsInfo::GetColumnInfo
00165     XTEST(hr = m_pIColumnsInfo->GetColumnInfo(pcColumns, prgColumnInfo, ppStringBuffer));
00166     TESTC(TRACE_METHOD(hr, L"IColumnsInfo::GetColumnInfo(&%lu, &0x%p, &0x%p)", pcColumns ? *pcColumns : 0, prgColumnInfo ? *prgColumnInfo : NULL, ppStringBuffer ? *ppStringBuffer : NULL));
00167
00168     //Obtain any Hidden Columns (if requested by the user)
00169     if(GetOptions()->m_dwRowsetOpts & ROWSET_HIDDENCOLUMNS)
00170     {
00171       //DBPROP_HIDDENCOLUMNS
00172       if(pcColumns && pcHiddenColumns)
00173       {
00174         CComPtr<IRowsetInfo> spRowsetInfo;
00175         if(SUCCEEDED(m_pIColumnsInfo->QueryInterface(IID_IRowsetInfo, (void**)&spRowsetInfo)))
00176         {
00177           if(SUCCEEDED(GetProperty(IID_IRowsetInfo, spRowsetInfo, DBPROP_HIDDENCOLUMNS, DBPROPSET_ROWSET, DBTYPE_I4, pcHiddenColumns)))
00178             *pcColumns += *pcHiddenColumns;
00179         }
00180       }
00181     }
00182   }
00183
00184 CLEANUP:
00185   return hr;
00186 }
00187
00188
00189 /////////////////////////////////////////////////////////////////
00190 // CDataAccess::GetColumnImage
00191 //
00192 /////////////////////////////////////////////////////////////////
00193 INT CDataAccess::GetColumnImage(const DBCOLUMNINFO* pColInfo, DBSTATUS dbStatus)
00194 {
00195   //NOTE:  Errors take precidence in the following function over readonly or chapter icons...
00196
00197   //Otherwise determine image from Status
00198   switch(dbStatus)
00199   {
00200     case DBSTATUS_S_OK:
00201     case DBSTATUS_S_ISNULL:
00202     case DBSTATUS_S_DEFAULT:
00203     case DBSTATUS_S_IGNORE:
00204       if(pColInfo)
00205       {
00206         //Hidden Column?
00207         if(m_ColumnInfo.IsHidden(pColInfo->iOrdinal))
00208           return IMAGE_DELETE;
00209
00210         //Chapter Column (takes precidence)
00211         if(pColInfo->dwFlags & DBCOLUMNFLAGS_ISCHAPTER)
00212           return IMAGE_CHAPTER;
00213
00214         //ReadOnly Column
00215         if(!(pColInfo->dwFlags & DBCOLUMNFLAGS_WRITE || pColInfo->dwFlags & DBCOLUMNFLAGS_WRITEUNKNOWN))
00216           return IMAGE_LOCK;
00217       }
00218       return IMAGE_NONE;
00219
00220     case DBSTATUS_S_TRUNCATED:
00221       return IMAGE_QUESTION;
00222
00223     default:
00224       return IMAGE_ERROR;
00225   }
00226
00227   return IMAGE_NORMAL;
00228 }
00229
00230
00231 /////////////////////////////////////////////////////////////////
00232 // HRESULT CDataAccess::ValidateAccessor
00233 //
00234 /////////////////////////////////////////////////////////////////
00235 HRESULT CDataAccess::ValidateAccessor(HACCESSOR hAccessor, ULONG ulRefCount)
00236 {
00237   //Warn user about NULL Accessor handle...
00238   if(hAccessor == DB_NULL_HACCESSOR || ulRefCount == 0)
00239   {
00240     if(IDNO == wMessageBox
00241       (
00242         GetFocus(),
00243         MB_TASKMODAL | MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1,
00244         wsz_ERROR,
00245         L"hAccessor == 0x%p\n"
00246         L"%s\n\n"
00247         L"This may crash your Provider...\n"
00248         L"Do you wish to continue anyway?",
00249         hAccessor,
00250         hAccessor == DB_NULL_HROW ? L"Invalid Accessor Handle" : L"Released Accessor Handle"
00251       )
00252       )
00253       return E_FAIL;
00254   }
00255
00256   return S_OK;
00257 }
00258
00259 /////////////////////////////////////////////////////////////////
00260 // HRESULT CDataAccess::CreateAccessors
00261 //
00262 /////////////////////////////////////////////////////////////////
00263 HRESULT CDataAccess::CreateAccessors(BINDCOLS eBindCols)
00264 {
00265   HRESULT hr = S_OK;
00266   DBCOUNTITEM cBindings = 0;
00267   DBBINDING* rgBindings = NULL;
00268
00269   //Release Previous Accessors
00270   ReleaseAccessor(&m_hAccessor);
00271   m_Bindings.RemoveAll();
00272   SAFE_FREE(m_pData);
00273   ReleaseAccessor(&m_hBmkAccessor);
00274
00275   //Delegate
00276   TESTC(hr = SetupBindings(eBindCols, &cBindings, &rgBindings, &m_cbRowSize));
00277   TESTC(hr = CreateAccessor(DBACCESSOR_ROWDATA, cBindings, rgBindings, m_cbRowSize, &m_hAccessor));
00278
00279   //Allocate pData
00280   SAFE_ALLOC(m_pData, BYTE, m_cbRowSize);
00281
00282 CLEANUP:
00283   m_Bindings.Attach(cBindings, rgBindings);
00284   return hr;
00285 }
00286
00287
00288 /////////////////////////////////////////////////////////////////
00289 // HRESULT CDataAccess::SetupBindings
00290 //
00291 /////////////////////////////////////////////////////////////////
00292 HRESULT CDataAccess::SetupBindings(BINDCOLS eBindCols, DBCOUNTITEM* pcBindings, DBBINDING** prgBindings, DBLENGTH* pcRowSize)
00293 {
00294   HRESULT hr = S_OK;
00295
00296   DBLENGTH dwOffset = 0;
00297   DBCOUNTITEM i,cBindings = 0;
00298   DBBINDING* rgBindings = NULL;
00299
00300   //Only capable of the Following Converions (for Display)
00301   DWORD dwMaxLength   = GetOptions()->m_dwMaxLength;
00302   DWORD dwAccessorOpts  = GetOptions()->m_dwAccessorOpts;
00303
00304   //Alloc the space to hold the Bindings
00305   SAFE_ALLOC(rgBindings, DBBINDING, m_ColumnInfo.GetCount());
00306
00307   cBindings = 0;
00308   for(i=0; i<m_ColumnInfo.GetCount(); i++)
00309   {
00310     DBCOLUMNINFO* pColInfo  = &m_ColumnInfo[i];
00311     DBBINDING*    pBinding  = &rgBindings[cBindings];
00312
00313     //Setup the Bindings
00314     pBinding->iOrdinal  = pColInfo->iOrdinal;
00315     pBinding->obStatus  = dwOffset;
00316     dwOffset += ROUNDUP(sizeof(DBSTATUS));
00317     pBinding->obLength  = dwOffset;
00318     dwOffset += ROUNDUP(sizeof(DBLENGTH));
00319     pBinding->obValue = dwOffset;
00320
00321     pBinding->pTypeInfo = NULL;
00322     pBinding->pBindExt  = NULL;
00323
00324     pBinding->dwPart  = dwAccessorOpts & (DBPART_VALUE|DBPART_LENGTH|DBPART_STATUS);
00325     pBinding->dwMemOwner= (dwAccessorOpts & ACCESSOR_OWNED_PROVIDER) ? DBMEMOWNER_PROVIDEROWNED : DBMEMOWNER_CLIENTOWNED;
00326     pBinding->eParamIO  = DBPARAMIO_NOTPARAM;
00327
00328     pBinding->dwFlags = 0;
00329     pBinding->bPrecision= pColInfo->bPrecision;
00330     pBinding->bScale  = pColInfo->bScale;
00331
00332     pBinding->pObject = NULL;
00333     pBinding->wType   = GetOptions()->GetBindingType(pColInfo->wType);
00334     pBinding->cbMaxLen  = GetMaxDisplaySize(pBinding->wType, pColInfo->wType, pColInfo->ulColumnSize, dwMaxLength);
00335
00336     //BLOB or IUnknown Bindings
00337     if(pBinding->wType == DBTYPE_IUNKNOWN || pColInfo->wType == DBTYPE_IUNKNOWN ||
00338       (pColInfo->dwFlags & DBCOLUMNFLAGS_ISLONG && (dwAccessorOpts & (ACCESSOR_BLOB_ISEQSTREAM|ACCESSOR_BLOB_ILOCKBYTES|ACCESSOR_BLOB_ISTORAGE|ACCESSOR_BLOB_ISTREAM))))
00339     {
00340       //For ColumnsRowset
00341       pBinding->wType   = DBTYPE_IUNKNOWN;
00342       pBinding->cbMaxLen  = sizeof(IUnknown*);
00343
00344       //Create pObject
00345       SAFE_ALLOC(pBinding->pObject, DBOBJECT, 1);
00346       pBinding->pObject->dwFlags  = STGM_READ;
00347       pBinding->pObject->iid    = IID_IUnknown;
00348
00349       //Setup pObject->iid
00350       if(dwAccessorOpts & ACCESSOR_BLOB_ISEQSTREAM)
00351         pBinding->pObject->iid    = IID_ISequentialStream;
00352       else if(dwAccessorOpts & ACCESSOR_BLOB_ISTREAM)
00353         pBinding->pObject->iid    = IID_IStream;
00354       else if(dwAccessorOpts & ACCESSOR_BLOB_ILOCKBYTES)
00355         pBinding->pObject->iid    = IID_ILockBytes;
00356       else if(dwAccessorOpts & ACCESSOR_BLOB_ISTORAGE)
00357         pBinding->pObject->iid    = IID_IStorage;
00358     }
00359
00360     //Special Handling for other non-OLE DB defined convertable types to WSTR
00361     //NOTE: The spec requires all supported types to be converted to
00362     //WSTR, but this only applies where the OLE DB conversion is defined.
00363     //Some are not defined so we need to bind nativly.
00364     switch(pColInfo->wType)
00365     {
00366       case DBTYPE_IUNKNOWN:
00367       case DBTYPE_IDISPATCH:
00368         pBinding->wType   = pColInfo->wType;
00369         pBinding->cbMaxLen  = sizeof(IUnknown*);
00370         break;
00371
00372       case DBTYPE_HCHAPTER:
00373         pBinding->wType   = pColInfo->wType;
00374         pBinding->cbMaxLen  = sizeof(HCHAPTER);
00375         break;
00376
00377       default:
00378         //DBTYPE_VECTOR
00379         if(pColInfo->wType & DBTYPE_VECTOR)
00380         {
00381           pBinding->wType   = pColInfo->wType;
00382           pBinding->cbMaxLen  = sizeof(DBVECTOR);
00383         }
00384
00385         //DBTYPE_ARRAY
00386         if(pColInfo->wType  & DBTYPE_ARRAY)
00387         {
00388           pBinding->wType   = pColInfo->wType;
00389           pBinding->cbMaxLen  = sizeof(SAFEARRAY*);
00390         }
00391         break;
00392     };
00393
00394     //Offset
00395     dwOffset += pBinding->cbMaxLen;
00396     dwOffset = ROUNDUP( dwOffset );
00397
00398     switch(eBindCols)
00399     {
00400       case BIND_ALLCOLS:
00401         cBindings++;
00402         break;
00403
00404       case BIND_ALLCOLSEXPECTBOOKMARK:
00405         if(pColInfo->iOrdinal != 0)
00406           cBindings++;
00407         break;
00408
00409       case BIND_UPDATEABLECOLS:
00410         if(pColInfo->dwFlags & DBCOLUMNFLAGS_WRITE || pColInfo->dwFlags & DBCOLUMNFLAGS_WRITEUNKNOWN)
00411           cBindings++;
00412         break;
00413
00414       default:
00415         ASSERT(!"Unhandled Type!");
00416         break;
00417     }
00418   }
00419
00420   //Size for pData
00421   if(pcRowSize)
00422     *pcRowSize = dwOffset;
00423
00424 CLEANUP:
00425   //Accessors
00426   *pcBindings = cBindings;
00427   *prgBindings = rgBindings;
00428   return hr;
00429 }
00430
00431
00432 /////////////////////////////////////////////////////////////////
00433 // HRESULT CDataAccess::CreateAccessor
00434 //
00435 /////////////////////////////////////////////////////////////////
00436 HRESULT CDataAccess::CreateAccessor(DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings, const DBBINDING* rgBindings, DBLENGTH cRowSize, HACCESSOR* phAccessor)
00437 {
00438   ASSERT(phAccessor);
00439
00440   HRESULT hr = E_FAIL;
00441   DBBINDSTATUS* rgStatus = NULL;
00442
00443   if(m_pIAccessor)
00444   {
00445     //Alloc the space to hold the status
00446     SAFE_ALLOC(rgStatus, DBBINDSTATUS, cBindings);
00447
00448     //Create the accessor
00449     *phAccessor = NULL;
00450     XTEST(hr = m_pIAccessor->CreateAccessor(dwAccessorFlags, cBindings, rgBindings, cRowSize, phAccessor, rgStatus));
00451     TRACE_METHOD(hr, L"IAccessor::CreateAccessor(0x%08x, %lu, 0x%p, %lu, &0x%p, 0x%p)", dwAccessorFlags, cBindings, rgBindings, cRowSize, *phAccessor, rgStatus);
00452
00453     //Display Errors
00454     TESTC(hr = DisplayAccessorErrors(hr, cBindings, rgBindings, rgStatus));
00455   }
00456
00457 CLEANUP:
00458   SAFE_FREE(rgStatus);
00459   return hr;
00460 }
00461
00462
00463
00464 /////////////////////////////////////////////////////////////////
00465 // HRESULT CDataAccess::AddRefAccessor
00466 //
00467 /////////////////////////////////////////////////////////////////
00468 HRESULT CDataAccess::AddRefAccessor(HACCESSOR hAccessor)
00469 {
00470   HRESULT hr = S_OK;
00471   ULONG ulRefCount = 0;
00472
00473   if(m_pIAccessor)
00474   {
00475     //IAccessor::AddRefAccessor
00476     XTEST(hr = m_pIAccessor->AddRefAccessor(hAccessor, &ulRefCount));
00477     TESTC(TRACE_METHOD(hr, L"IAccessor::AddRefAccessor(0x%p, &%d)", hAccessor, ulRefCount));
00478   }
00479
00480 CLEANUP:
00481   return hr;
00482 }
00483
00484
00485 /////////////////////////////////////////////////////////////////
00486 // HRESULT CDataAccess::ReleaseAccessor
00487 //
00488 /////////////////////////////////////////////////////////////////
00489 HRESULT CDataAccess::ReleaseAccessor(HACCESSOR* phAccessor, BOOL fReleaseAlways)
00490 {
00491   ASSERT(phAccessor);
00492   HRESULT hr = S_OK;
00493   ULONG ulRefCount = 0;
00494
00495   if(m_pIAccessor && (*phAccessor || fReleaseAlways))
00496   {
00497     XTEST(hr = m_pIAccessor->ReleaseAccessor(*phAccessor, &ulRefCount));
00498     TESTC(TRACE_METHOD(hr, L"IAccessor::ReleaseAccessor(0x%p, &%d)", *phAccessor, ulRefCount));
00499   }
00500
00501 CLEANUP:
00502   //Only NULL the handle if the RefCount is 0
00503   if(ulRefCount == 0)
00504     *phAccessor = NULL;
00505   return hr;
00506 }
00507
00508
00509 ////////////////////////////////////////////////////////////////
00510 // CDataAccess::GetColumnData
00511 //
00512 /////////////////////////////////////////////////////////////////
00513 HRESULT CDataAccess::GetColumnData(const DBBINDING* pBinding, void* pData, DBSTATUS* pdbStatus, DBLENGTH* pdbLength, DBTYPE* pwSubType, WCHAR* pwszValue, ULONG ulMaxSize, DWORD dwConvFlags, DBTYPE wBackendType)
00514 {
00515   ASSERT(pBinding);
00516   ASSERT(pwszValue);
00517   HRESULT hr = S_OK;
00518   DBTYPE  wSubType = DBTYPE_EMPTY;
00519
00520   //STATUS
00521   DBSTATUS dbStatus   = STATUS_IS_BOUND(*pBinding) ? BINDING_STATUS(*pBinding, pData) : DBSTATUS_E_BADSTATUS;
00522
00523   //LENGTH is the Actual (Untruncated) length of the string
00524   //We we need to make sure all operations are off of cbMaxLen and not LENGTH bound
00525   //NOTE: If the length is not bound, we set the length to our cbMaxLength NOT 0.  This is because
00526   //many datatypes can still be returned, and our conversion routines are based upon the length...
00527   DBLENGTH dbLength   = LENGTH_IS_BOUND(*pBinding) ? BINDING_LENGTH(*pBinding, pData) : pBinding->cbMaxLen;
00528
00529   //VALUE
00530   pwszValue[0] = wEOL;
00531   void* pValue = VALUE_IS_BOUND(*pBinding) ? &BINDING_VALUE(*pBinding, pData) : NULL;
00532
00533   //cbMaxLen
00534   //NOTE: The maximum size we can possibly read is either the specified cbMaxLen or our
00535   //data buffer we are retriving into for display...
00536
00537   switch(dbStatus)
00538   {
00539     case DBSTATUS_S_ISNULL:
00540     case DBSTATUS_S_DEFAULT:
00541     case DBSTATUS_S_IGNORE:
00542       hr = S_OK;
00543       goto CLEANUP;
00544
00545     case DBSTATUS_S_TRUNCATED:
00546     case DBSTATUS_S_OK:
00547       break;
00548
00549     default:
00550       hr = E_FAIL;
00551       goto CLEANUP;
00552   };
00553
00554   if(pValue)
00555   {
00556     //Handle any special conversions ourselves...
00557     switch(DBTYPE_SRC_DST(pBinding->wType, DBTYPE_WSTR))
00558     {
00559       //DBTYPE_IUNKNOWN => DBTYPE_WSTR
00560       case DBTYPE_SRC_DST(DBTYPE_IUNKNOWN, DBTYPE_WSTR):
00561       case DBTYPE_SRC_DST(DBTYPE_IUNKNOWN | DBTYPE_BYREF, DBTYPE_WSTR):
00562       {
00563         //Handle BYREF as well. (simple enough)
00564         if(pBinding->wType & DBTYPE_BYREF)
00565           pValue = *(void**)pValue;
00566
00567         //IUnknown is not a required conversion to string (WSTR)
00568         IUnknown* pIUnknown = *(IUnknown**)pValue;
00569
00570         //Determine the type of object. (default)
00571         REFIID iid = pBinding->pObject ? pBinding->pObject->iid : IID_IUnknown;
00572
00573         //Create a temporary stream wrapper...
00574         CStream  cStream(m_pCMainWindow);
00575         cStream.CreateObject(this, iid, pIUnknown);
00576         cStream.m_wType = wBackendType;
00577
00578         //Read the Stream Object (numerous different stream objects)
00579         if(FAILED(hr = cStream.ReadString(iid, 0/*ulOffset*/, (ulMaxSize*sizeof(WCHAR))-sizeof(WCHAR), ulMaxSize, pwszValue)))
00580         {
00581           //I have no clue what type of object this is, or was unable to read the
00582           //stream for some reason, so just display the error
00583           StringFormat(pwszValue, ulMaxSize, L"%S", GetErrorName(hr));
00584         }
00585
00586         //The refcount of the Stream now is 1.
00587         //Our FreeBindingData frees outofline data...
00588         break;
00589       }
00590
00591       default:
00592       {
00593         //Otherwise delegate...
00594         //NOTE: Make sure we indicate to DataConvert that the input buffer is only
00595         //as large as the specified length, but is bound by our allocated buffer size,
00596         //so it doesn't try and read beyond valid memory...
00597         XTESTC_(hr = DataConvert
00598           (
00599             dbStatus,
00600             dbLength,
00601             pBinding->cbMaxLen,
00602             pBinding->wType,
00603             pValue,
00604             pBinding->bPrecision,
00605             pBinding->bScale,
00606
00607             DBTYPE_WSTR,
00608
00609             //Status.
00610             //Only update our status if returned successfully from the provider.
00611             dbStatus == DBSTATUS_S_OK ? &dbStatus : NULL,
00612             NULL,
00613             pwszValue,
00614             ulMaxSize*sizeof(WCHAR),
00615             dwConvFlags
00616           ),S_OK);
00617
00618
00619         //Indicate a sub type...
00620         if(pBinding->wType == DBTYPE_VARIANT)
00621         {
00622           VARIANT* pVariant = (VARIANT*)pValue;
00623           wSubType = pVariant->vt;
00624         }
00625         break;
00626       }
00627     };
00628   }
00629
00630   //PostProcessing
00631   if(SUCCEEDED(hr))
00632   {
00633     //Hexadecimal
00634     if(dwConvFlags & CONV_HEX)
00635     {
00636       switch(wBackendType)
00637       {
00638         case DBTYPE_I1:
00639         case DBTYPE_UI1:
00640         case DBTYPE_I2:
00641         case DBTYPE_UI2:
00642         case DBTYPE_I4:
00643         case DBTYPE_UI4:
00644           PostProcessString(pwszValue, ulMaxSize, dwConvFlags);
00645           break;
00646
00647         default:
00648           break;
00649       };
00650     }
00651
00652     //Schema Rowsets:
00653     if(m_bSchemaRowset && (dwConvFlags & CONV_TYPENAME))
00654     {
00655       //Special Handling for Known Schema Rowsets,
00656       //map the "DBTYPE" column from UI2 to a textual name of the Type...
00657       if(
00658           (pBinding->iOrdinal == 2    && m_guidSource == DBSCHEMA_PROVIDER_TYPES)
00659         ||  (pBinding->iOrdinal == 12   && m_guidSource == DBSCHEMA_COLUMNS)
00660         ||  (pBinding->iOrdinal == 8    && m_guidSource == DBSCHEMA_TABLES_INFO)
00661         ||  (pBinding->iOrdinal == 10 && m_guidSource == DBSCHEMA_PROCEDURE_COLUMNS)
00662         )
00663       {
00664         //TODO: Why the double conversion?
00665         ASSERT(wBackendType == DBTYPE_UI2);
00666
00667         //The SchemaRowset column just contains an string(integer) of the type.
00668         //(ie: DBTYPE_WSTR = "130".  So we need to convert the string to an int, then to
00669         //the actual assoicated mapped type name (for ease of viewing without having to
00670         //have the header handy when viewing schemas).
00671         DBTYPE wSchemaType;
00672         if(ConvertToLONG(pwszValue, (LONG*)&wSchemaType, 0/*Min*/, LONG_MAX, 0/*Base*/))
00673         {
00674           //NOTE: on failure we have no choice to leave the column as the original
00675           //returned integer.
00676           StringCopy(pwszValue, GetDBTypeName(wSchemaType), ulMaxSize);
00677         }
00678       }
00679     }
00680   }
00681
00682 CLEANUP:
00683   //Output Params
00684   if(pdbStatus)
00685     *pdbStatus = dbStatus;
00686   if(pdbLength)
00687     *pdbLength = dbLength;
00688   if(pwSubType)
00689     *pwSubType = wSubType;
00690   return hr;
00691 }
00692
00693
00694
00695
00696 ////////////////////////////////////////////////////////////////
00697 // CDataAccess::SetColumnData
00698 //
00699 /////////////////////////////////////////////////////////////////
00700 HRESULT CDataAccess::SetColumnData(const DBBINDING* pBinding, void* pData, DBSTATUS dbStatus, DBLENGTH dbLength, WCHAR* pwszValue, DWORD dwConvFlags, DBTYPE wBackendType)
00701 {
00702   //NOTE: We ASSERT on pwszValue since DataConvert and even our conversion reqturns will fails
00703   //for NULL source.  If you really have a NULL string it should be since as an empty
00704   //string for conversion purposes and DataConvert will set length = 0...
00705   ASSERT(pwszValue);
00706   ASSERT(pBinding);
00707
00708   HRESULT hr = S_OK;
00709   void* pValue = VALUE_IS_BOUND(*pBinding) ? &BINDING_VALUE(*pBinding, pData) : NULL;
00710   DBSTATUS  dbDstStatus = dbStatus;
00711   DBLENGTH  cbDstLength = 0;
00712
00713   //STATUS
00714   switch(dbStatus)
00715   {
00716     case DBSTATUS_S_OK:
00717     case DBSTATUS_S_TRUNCATED:
00718       break;
00719
00720     default:
00721       //Any other Status, IGNORE, ISNULL, DEFAULT, ERROR, were done, nothing to convert...
00722       goto CLEANUP;
00723   }
00724
00725   if(pValue)
00726   {
00727     //Handle any special conversions ourselves...
00728     switch(DBTYPE_SRC_DST(pBinding->wType, DBTYPE_WSTR))
00729     {
00730       //DBTYPE_IUNKNOWN => DBTYPE_WSTR
00731       case DBTYPE_SRC_DST(DBTYPE_IUNKNOWN, DBTYPE_WSTR):
00732       case DBTYPE_SRC_DST(DBTYPE_IUNKNOWN | DBTYPE_BYREF, DBTYPE_WSTR):
00733       {
00734         //Handle BYREF as well. (simple enough)
00735         if(pBinding->wType & DBTYPE_BYREF)
00736         {
00737           SAFE_ALLOC(*(void**)pValue, IUnknown*, 1);
00738           pValue = *(void**)pValue;
00739         }
00740
00741         //Create the storage object (buffer) to use for SetData.
00742         CStorageBuffer* pCStorageBuffer = new CStorageBuffer; //m_cRef=1
00743
00744         //Create a temporary stream wrapper...
00745         CStream  cStream(m_pCMainWindow);
00746         cStream.CreateObject(this, IID_IStream, (IStream*)pCStorageBuffer);
00747         cStream.m_wType = wBackendType;
00748
00749         //Now, Set the user entered data into our storage object.
00750         //NOTE:  We set the Length = total bytes in stream, since some providers
00751         //requires this ahead of time.  And we reset the stream so the current seek
00752         //is at the head for when the provider begins to read from the stream on SetData
00753         cStream.WriteString(IID_ISequentialStream, 0, pwszValue ? wcslen(pwszValue)*sizeof(WCHAR) : 0, pwszValue, &cbDstLength);
00754         pCStorageBuffer->Seek(0);
00755
00756         //Passing the object pointer should be suffiencent enough, as the provider
00757         //will have to QI of the object anyway to determine if it even supports
00758         //the interface, but since many incorrectly do not we will explictly
00759         //QI here so the majority of the providers don't crash
00760         IUnknown* pIUnknown = NULL;
00761         XTESTC_(pCStorageBuffer->QueryInterface(pBinding->pObject ? pBinding->pObject->iid : IID_IUnknown, (void**)&pIUnknown), S_OK);
00762         *(IUnknown**)pValue = pIUnknown;
00763
00764         //The refcount of the Stream now is 2.
00765         //The provider releases one, and our FreeBindingData fress outofline data...
00766         break;
00767       }
00768
00769       default:
00770       {
00771         //Otherwise delegate...
00772         XTESTC_(hr = DataConvert
00773           (
00774             dbStatus,
00775             dbLength * sizeof(WCHAR),
00776             dbLength * sizeof(WCHAR) + sizeof(WCHAR),
00777             DBTYPE_WSTR,
00778             pwszValue,
00779             pBinding->bPrecision,
00780             pBinding->bScale,
00781
00782             pBinding->wType,
00783             &dbDstStatus,
00784             &cbDstLength,
00785             pValue,
00786             pBinding->cbMaxLen,
00787             dwConvFlags
00788           ),S_OK);
00789         break;
00790       }
00791     };
00792   }
00793
00794 CLEANUP:
00795   if(STATUS_IS_BOUND(*pBinding))
00796     BINDING_STATUS(*pBinding, pData) = dbDstStatus;
00797   if(LENGTH_IS_BOUND(*pBinding))
00798     BINDING_LENGTH(*pBinding, pData) = cbDstLength;
00799   return hr;
00800 }
00801
00802
00803 /////////////////////////////////////////////////////////////////
00804 // HRESULT CDataAccess::GetColumnsRowset
00805 //
00806 /////////////////////////////////////////////////////////////////
00807 HRESULT CDataAccess::GetColumnsRowset(CAggregate* pCAggregate, bool fOptColumns, REFIID riid, ULONG cPropSets, DBPROPSET* rgPropSets, IUnknown** ppIUnknown)
00808 {
00809   DBORDINAL i,cOptColumns = 0;
00810   DBID* rgOptColumns = 0;
00811   HRESULT hr = S_OK;
00812
00813   if(!m_pIColumnsRowset)
00814     return E_FAIL;
00815
00816   //GetAvailableColumns
00817   //We just use cRestrictions passed in as the flag
00818   //to indicate weither to use Optional Columns
00819   if(fOptColumns)
00820   {
00821     XTEST(hr = m_pIColumnsRowset->GetAvailableColumns(&cOptColumns, &rgOptColumns));
00822     TESTC(TRACE_METHOD(hr, L"IColumnsRowset::GetAvailableColumns(&%lu, &0x%p)", cOptColumns, rgOptColumns));
00823   }
00824
00825   //GetColumnsRowset
00826   XTEST_(hr = m_pIColumnsRowset->GetColumnsRowset(
00827             pCAggregate,    // punkOuter
00828             cOptColumns,    // cOptionalColumns
00829             rgOptColumns,   // rgOptionalColumns
00830             riid,       // rowset interface
00831             cPropSets,      // # of properties
00832             rgPropSets,     // properties
00833             ppIUnknown),S_OK);  // rowset pointer
00834   TRACE_METHOD(hr, L"IColumnsRowset::GetColumnsRowset(0x%p, %lu, 0x%p, %s, %d, 0x%p, &0x%p)", pCAggregate, cOptColumns, rgOptColumns, GetInterfaceName(riid), cPropSets, rgPropSets, ppIUnknown ? *ppIUnknown : NULL);
00835
00836   //Display Errors (if occurred)
00837   TESTC(hr = DisplayPropErrors(hr, cPropSets, rgPropSets));
00838
00839   //Handle Aggregation
00840   if(pCAggregate)
00841     TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00842
00843 CLEANUP:
00844   //FreeDBIDs
00845   for(i=0; i<cOptColumns; i++)
00846     DBIDFree(&rgOptColumns[i]);
00847   SAFE_FREE(rgOptColumns);
00848   return hr;
00849 }
00850
00851
00852 /////////////////////////////////////////////////////////////////
00853 // CRowset::CRowset
00854 //
00855 /////////////////////////////////////////////////////////////////
00856 CRowset::CRowset(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00857   : CDataAccess(eCRowset, pCMainWindow, pCMDIChild)
00858 {
00859   //Rowset
00860 //  m_pIAccessor          = NULL;//DataAccess Base Class
00861 //  m_pIColumnsInfo         = NULL;//DataAccess Base Class
00862 //  m_pIConvertType         = NULL;//DataAccess Base Class
00863   m_pIRowset            = NULL;//Rowset Interface
00864   m_pIRowsetInfo          = NULL;//Rowset Interface
00865   m_pIRowsetChange        = NULL;//Rowset Interface
00866   m_pIRowsetIdentity        = NULL;//Rowset Interface
00867   m_pIRowsetLocate        = NULL;//Rowset Interface
00868   m_pIRowsetFind          = NULL;//Rowset Interface
00869   m_pIRowsetView          = NULL;//Rowset Interface
00870   m_pIChapteredRowset       = NULL;//Rowset Interface
00871   m_pIRowsetResynch       = NULL;//Rowset Interface
00872   m_pIRowsetRefresh       = NULL;//Rowset Interface
00873   m_pIRowsetIndex         = NULL;//Rowset Interface
00874   m_pIRowsetScroll        = NULL;//Rowset Interface
00875   m_pIRowsetUpdate        = NULL;//Rowset Interface
00876   m_pIGetRow            = NULL;//Rowset Interface
00877
00878   //TODO: Not currently doc'd?
00879   m_pIRowsetBookmark        = NULL;//Rowset Interface
00880
00881   //Extra Interfaces
00882   m_dwCookieRowsetNotify      = 0;
00883
00884   //Chapters
00885   m_hChapter            = DB_NULL_HCHAPTER;
00886
00887   //Properties
00888   m_fRemoveDeleted        = FALSE;
00889 }
00890
00891
00892 /////////////////////////////////////////////////////////////////
00893 // CRowset::~CRowset
00894 //
00895 /////////////////////////////////////////////////////////////////
00896 CRowset::~CRowset()
00897 {
00898   ReleaseObject(0);
00899 }
00900
00901
00902 /////////////////////////////////////////////////////////////////
00903 // IUnknown** CRowset::GetInterfaceAddress
00904 //
00905 /////////////////////////////////////////////////////////////////
00906 IUnknown** CRowset::GetInterfaceAddress(REFIID riid)
00907 {
00908   HANDLE_GETINTERFACE(IRowset);
00909   HANDLE_GETINTERFACE(IRowsetInfo);
00910   HANDLE_GETINTERFACE(IRowsetChange);
00911   HANDLE_GETINTERFACE(IRowsetIdentity);
00912   HANDLE_GETINTERFACE(IRowsetLocate);
00913   HANDLE_GETINTERFACE(IRowsetFind);
00914   HANDLE_GETINTERFACE(IRowsetView);
00915   HANDLE_GETINTERFACE(IChapteredRowset);
00916   HANDLE_GETINTERFACE(IRowsetResynch);
00917   HANDLE_GETINTERFACE(IRowsetRefresh);
00918   HANDLE_GETINTERFACE(IRowsetIndex);
00919   HANDLE_GETINTERFACE(IRowsetScroll);
00920   HANDLE_GETINTERFACE(IRowsetUpdate);
00921   HANDLE_GETINTERFACE(IRowsetBookmark);
00922   HANDLE_GETINTERFACE(IGetRow);
00923
00924   //Otherwise delegate
00925   return CDataAccess::GetInterfaceAddress(riid);
00926 }
00927
00928
00929 /////////////////////////////////////////////////////////////////
00930 // HRESULT CRowset::AutoQI
00931 //
00932 /////////////////////////////////////////////////////////////////
00933 HRESULT CRowset::AutoQI(DWORD dwCreateOpts)
00934 {
00935   //Delegate First, so we have IConnectionPointContainer
00936   CDataAccess::AutoQI(dwCreateOpts);
00937
00938   //[MANDATORY] Obtain [mandatory] interfaces
00939   if(dwCreateOpts & CREATE_QI_MANDATORY)
00940   {
00941     OBTAIN_INTERFACE(IRowset);
00942     OBTAIN_INTERFACE(IRowsetInfo);
00943   }
00944
00945   //Auto QI
00946   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00947   {
00948     //Obtain [optional] interfaces
00949     OBTAIN_INTERFACE(IRowsetChange);
00950     OBTAIN_INTERFACE(IRowsetIdentity);
00951     OBTAIN_INTERFACE(IRowsetLocate);
00952     OBTAIN_INTERFACE(IRowsetFind);
00953     OBTAIN_INTERFACE(IRowsetView);
00954     OBTAIN_INTERFACE(IChapteredRowset);
00955     OBTAIN_INTERFACE(IRowsetResynch);
00956     OBTAIN_INTERFACE(IRowsetRefresh);
00957     OBTAIN_INTERFACE(IRowsetIndex);
00958     OBTAIN_INTERFACE(IRowsetScroll);
00959     OBTAIN_INTERFACE(IRowsetUpdate);
00960     OBTAIN_INTERFACE(IRowsetBookmark);
00961     OBTAIN_INTERFACE(IGetRow);
00962   }
00963
00964   //Listeners
00965   AdviseListener(IID_IRowsetNotify, &m_dwCookieRowsetNotify);
00966   return S_OK;
00967 }
00968
00969
00970 /////////////////////////////////////////////////////////////////
00971 // CRowset::AutoRelease
00972 //
00973 /////////////////////////////////////////////////////////////////
00974 HRESULT CRowset::AutoRelease()
00975 {
00976   //Data
00977
00978   //Rowset
00979   RELEASE_INTERFACE(IRowset);
00980   RELEASE_INTERFACE(IRowsetInfo);
00981   RELEASE_INTERFACE(IRowsetChange);
00982   RELEASE_INTERFACE(IRowsetIdentity);
00983   RELEASE_INTERFACE(IRowsetLocate);
00984   RELEASE_INTERFACE(IRowsetFind);
00985   RELEASE_INTERFACE(IRowsetView);
00986   RELEASE_INTERFACE(IChapteredRowset);
00987   RELEASE_INTERFACE(IRowsetResynch);
00988   RELEASE_INTERFACE(IRowsetRefresh);
00989   RELEASE_INTERFACE(IRowsetIndex);
00990   RELEASE_INTERFACE(IRowsetScroll);
00991   RELEASE_INTERFACE(IRowsetUpdate);
00992   RELEASE_INTERFACE(IRowsetBookmark);
00993   RELEASE_INTERFACE(IGetRow);
00994
00995   //Don't Unadvise the Listeners until the Rowset goes away.
00996   //We want to receive and Display the ROWSET_RELEASE notifications
00997 //  UnadviseListener(IID_IRowsetNotify,   &m_dwCookieRowsetNotify);
00998
00999   //Delegate
01000   return CDataAccess::AutoRelease();
01001 }
01002
01003
01004 /////////////////////////////////////////////////////////////////
01005 // HRESULT CRowset::DisplayObject
01006 //
01007 /////////////////////////////////////////////////////////////////
01008 HRESULT CRowset::DisplayObject()
01009 {
01010   HRESULT hr = S_OK;
01011
01012   BINDCOLS eBindCols = (GetOptions()->m_dwAccessorOpts & ACCESSOR_BIND_BOOKMARK ? BIND_ALLCOLS : BIND_ALLCOLSEXPECTBOOKMARK);
01013   if(m_pCMDIChild)
01014   {
01015     //Reset Cursor
01016     m_pCMDIChild->m_pCDataGrid->m_fLastFetchForward = FALSE;
01017     m_pCMDIChild->m_pCDataGrid->m_lCurPos = 0;
01018
01019     //First Clear the existing Window...
01020     TESTC(hr = m_pCMDIChild->m_pCDataGrid->ClearAll());
01021   }
01022
01023   //Obtain Properties
01024 //  if(FAILED(GetProperty(IID_IRowsetInfo, m_pIRowsetInfo, DBPROP_REMOVEDELETED, DBPROPSET_ROWSET, DBTYPE_BOOL, &m_fRemoveDeleted)))
01025 //    m_fRemoveDeleted = FALSE;
01026
01027   //Create ColumnInfo
01028   TESTC(hr = GetColInfo());
01029
01030   //Create Accessors and Setup bindings
01031   TESTC(hr = CreateAccessors(eBindCols));
01032
01033   if(m_pCMDIChild)
01034   {
01035     //Refresh the Columns and Rows
01036     TESTC(hr = m_pCMDIChild->m_pCDataGrid->RefreshData());
01037   }
01038
01039   //Display the object...
01040   TESTC(hr = CDataAccess::DisplayObject());
01041
01042 CLEANUP:
01043   if(m_pCMDIChild)
01044     m_pCMDIChild->UpdateControls();
01045   return hr;
01046 }
01047
01048
01049 /////////////////////////////////////////////////////////////////////////////
01050 // CRowset::GetObjectDesc
01051 //
01052 /////////////////////////////////////////////////////////////////////////////
01053 WCHAR* CRowset::GetObjectDesc()
01054 {
01055   if(!m_strObjectDesc && m_guidSource != GUID_NULL)
01056   {
01057     //Schema Rowset
01058     if(m_bSchemaRowset)
01059     {
01060       //Lookup the "Friendly Name" of the Schema Rowset...
01061       m_strObjectDesc.CopyFrom(GetSchemaName(m_guidSource));
01062     }
01063     else if(m_guidSource == IID_IColumnsRowset)
01064     {
01065       //What interface created this...
01066       m_strObjectDesc.CopyFrom(GetInterfaceName(m_guidSource));
01067     }
01068   }
01069
01070   return m_strObjectDesc;
01071 }
01072
01073
01074 /////////////////////////////////////////////////////////////////
01075 // HRESULT CRowset::ValidateRow
01076 //
01077 /////////////////////////////////////////////////////////////////
01078 HRESULT CRowset::ValidateRow(HROW hRow, ULONG ulRefCount)
01079 {
01080   //Warn user about NULL Rowhandles...
01081   if(hRow == DB_NULL_HROW || ulRefCount == 0)
01082   {
01083     if(IDNO == wMessageBox
01084       (
01085         GetFocus(),
01086         MB_TASKMODAL | MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1,
01087         wsz_ERROR,
01088         L"hRow == 0x%p\n"
01089         L"%s\n\n"
01090         L"This may crash your Provider...\n"
01091         L"Do you wish to continue anyway?",
01092         hRow,
01093         hRow == DB_NULL_HROW ? L"Invalid Row Handle" : L"Released Row Handle"
01094         )
01095       )
01096       return E_FAIL;
01097   }
01098
01099   return S_OK;
01100 }
01101
01102 /////////////////////////////////////////////////////////////////
01103 // HRESULT CRowset::GetData
01104 //
01105 /////////////////////////////////////////////////////////////////
01106 HRESULT CRowset::GetData(HROW hRow, HACCESSOR hAccessor, void* pData, DBPROPID dwSourceID)
01107 {
01108   //Since GetData is the only OLE DB method that is allowed to crash
01109   //if given invalid argumenets (for effiecientcy - provider speicific
01110   //weither it validates arguments), we should check the params and at the
01111   //very least warn the user...
01112   HRESULT hr = E_FAIL;
01113
01114   //Defaults
01115   if(hAccessor == NULL)
01116     hAccessor = m_hAccessor;
01117   if(pData == NULL)
01118     pData = m_pData;
01119
01120   //Check Arguments...
01121   TESTC(hr = ValidateRow(hRow));
01122   TESTC(hr = ValidateAccessor(hAccessor));
01123
01124   //GetData
01125   switch(dwSourceID)
01126   {
01127     //IRowset::GetData
01128     case DBPROP_IRowset:
01129       if(m_pIRowset)
01130       {
01131         XTEST(hr = m_pIRowset->GetData(hRow, hAccessor, pData));
01132         TESTC(TRACE_METHOD(hr, L"IRowset::GetData(0x%p, 0x%p, 0x%p)", hRow, hAccessor, pData));
01133       }
01134       break;
01135
01136     //IRowsetLocate::GetData
01137     case DBPROP_IRowsetLocate:
01138       if(m_pIRowsetLocate)
01139       {
01140         XTEST(hr = m_pIRowsetLocate->GetData(hRow, hAccessor, pData));
01141         TESTC(TRACE_METHOD(hr, L"IRowsetLocate::GetData(0x%p, 0x%p, 0x%p)", hRow, hAccessor, pData));
01142       }
01143       break;
01144
01145     //IRowsetScroll::GetData
01146     case DBPROP_IRowsetScroll:
01147       if(m_pIRowsetScroll)
01148       {
01149         XTEST(hr = m_pIRowsetScroll->GetData(hRow, hAccessor, pData));
01150         TESTC(TRACE_METHOD(hr, L"IRowsetScroll::GetData(0x%p, 0x%p, 0x%p)", hRow, hAccessor, pData));
01151       }
01152       break;
01153
01154     //IRowsetUpdate::GetOriginalData
01155     case DBPROP_IRowsetUpdate:
01156       if(m_pIRowsetUpdate)
01157       {
01158         XTEST(hr = m_pIRowsetUpdate->GetOriginalData(hRow, hAccessor, pData));
01159         TESTC(TRACE_METHOD(hr, L"IRowsetUpdate::GetOriginalData(0x%p, 0x%p, 0x%p)", hRow, hAccessor, pData));
01160       }
01161       break;
01162
01163     //IRowsetResynch::GetVisibleData
01164     case DBPROP_IRowsetResynch:
01165       if(m_pIRowsetResynch)
01166       {
01167         XTEST(hr = m_pIRowsetResynch->GetVisibleData(hRow, hAccessor, pData));
01168         TESTC(TRACE_METHOD(hr, L"IRowsetResynch::GetVisibleData(0x%p, 0x%p, 0x%p)", hRow, hAccessor, pData));
01169       }
01170       break;
01171
01172     //IRowsetRefresh::GetLastVisibleData
01173     case DBPROP_IRowsetRefresh:
01174       if(m_pIRowsetRefresh)
01175       {
01176         XTEST(hr = m_pIRowsetRefresh->GetLastVisibleData(hRow, hAccessor, pData));
01177         TESTC(TRACE_METHOD(hr, L"IRowsetRefresh::GetLastVisibleData(0x%p, 0x%p, 0x%p)", hRow, hAccessor, pData));
01178       }
01179       break;
01180
01181     default:
01182       ASSERT(!"Unhandled Source!");
01183       break;
01184   };
01185
01186 CLEANUP:
01187   return hr;
01188 }
01189
01190
01191 /////////////////////////////////////////////////////////////////
01192 // HRESULT CRowset::GetBookmark
01193 //
01194 /////////////////////////////////////////////////////////////////
01195 HRESULT CRowset::GetBookmark(HROW hRow, DBBKMARK* pcbBookmark, BYTE** ppBookmark)
01196 {
01197   ASSERT(pcbBookmark);
01198   ASSERT(ppBookmark);
01199   HRESULT hr = S_OK;
01200   *pcbBookmark = 0;
01201   *ppBookmark = NULL;
01202
01203   DBSTATUS dbStatus = 0;
01204   BYTE* pData = NULL;
01205
01206   //Make sure we have a bookmark...
01207   if(!m_ColumnInfo.GetCount() || !m_ColumnInfo.GetElements() || m_ColumnInfo[0].iOrdinal!=0)
01208     return E_FAIL;
01209
01210   //Obtain the maximum bookmark size...
01211   DBLENGTH ulMaxBmkSize = ROUNDUP(GetMaxDisplaySize(DBTYPE_BYTES, m_ColumnInfo[0].wType, m_ColumnInfo[0].ulColumnSize, MAX_COL_SIZE));
01212
01213   //Deferred Accessor Creation
01214   if(m_hBmkAccessor==NULL)
01215   {
01216     //Static bindings
01217     //Design the bindigs so the value is first and status length last.  This way we can return
01218     //the bookmark memory, the rest of the code can access the bookmark directly, and we can free
01219     //all the memory as well starting with the bookmark address...
01220     const DBCOUNTITEM cBindings = 1;
01221     DBBINDING rgBindings[cBindings] =
01222       {
01223         0,
01224         0,                  //VALUE
01225         ulMaxBmkSize,           //LENGTH
01226         ulMaxBmkSize + sizeof(DBLENGTH),  //STATUS
01227         NULL,
01228         NULL,
01229         NULL,
01230         DBPART_VALUE|DBPART_LENGTH|DBPART_STATUS,
01231         DBMEMOWNER_CLIENTOWNED,
01232         DBPARAMIO_NOTPARAM,
01233         ulMaxBmkSize + sizeof(DBLENGTH) + sizeof(DBSTATUS),
01234         0,
01235         DBTYPE_BYTES,
01236         0,
01237         0,
01238       };
01239
01240     //Now create the accessor...
01241     TESTC(hr = CreateAccessor(DBACCESSOR_ROWDATA, cBindings, rgBindings, 0, &m_hBmkAccessor));
01242   }
01243
01244   //Allocate enough space for the bookmark, (including status and length of course)
01245   SAFE_ALLOC(pData, BYTE, ulMaxBmkSize + sizeof(DBLENGTH) + sizeof(DBSTATUS));
01246
01247   //GetData to obtain Bookmark value (delegate)
01248   TESTC(hr = GetData(hRow, m_hBmkAccessor, pData));
01249
01250   //Length
01251
01252   dbStatus = *(DBSTATUS*)(pData + ulMaxBmkSize + sizeof(DBLENGTH));
01253   if(dbStatus == DBSTATUS_S_OK)
01254   {
01255     *pcbBookmark = *(ULONG*)(pData + ulMaxBmkSize); //LENGTH
01256     *ppBookmark = pData;              //VALUE
01257   }
01258
01259 CLEANUP:
01260   return hr;
01261 }
01262
01263
01264 /////////////////////////////////////////////////////////////////
01265 // HRESULT CRowset::GetChapter
01266 //
01267 /////////////////////////////////////////////////////////////////
01268 HRESULT CRowset::GetChapter(HROW hRow, DBORDINAL iOrdinal, HCHAPTER* phChapter)
01269 {
01270   ASSERT(hRow);
01271   ASSERT(phChapter);
01272   HRESULT hr = S_OK;
01273   HACCESSOR hAccessor = NULL;
01274
01275   //Initialize in case of ISNULL data...
01276   *phChapter = NULL;
01277
01278   //Bind only the Chapter column...
01279   const static DBCOUNTITEM cBindings = 1;
01280   DBBINDING rgBindings[cBindings] =
01281   {
01282       iOrdinal,
01283       0,  //pData = phChapter + 0 offset = phChapter
01284       0,
01285       0,
01286       NULL,
01287       NULL,
01288       NULL,
01289       DBPART_VALUE,
01290       DBMEMOWNER_CLIENTOWNED,
01291       DBPARAMIO_NOTPARAM,
01292       sizeof(HCHAPTER),
01293       0,
01294       DBTYPE_HCHAPTER,
01295       0,
01296       0,
01297   };
01298
01299   //Create the Accessor...
01300   TESTC(hr = CreateAccessor(DBACCESSOR_ROWDATA, cBindings, rgBindings, 0, &hAccessor));
01301
01302   //GetData to obtain Bookmark value (delegate)
01303   TESTC(hr = GetData(hRow, hAccessor, phChapter));
01304
01305 CLEANUP:
01306   ReleaseAccessor(&hAccessor);
01307   return hr;
01308 }
01309
01310
01311 /////////////////////////////////////////////////////////////////
01312 // HRESULT CRowset::RestartPosition
01313 //
01314 /////////////////////////////////////////////////////////////////
01315 HRESULT CRowset::RestartPosition()
01316 {
01317   HRESULT hr = E_FAIL;
01318
01319   //IRowset::RestartPosition
01320   if(m_pIRowset)
01321   {
01322     XTEST(hr = m_pIRowset->RestartPosition(m_hChapter));
01323     TESTC(TRACE_METHOD(hr, L"IRowset::RestartPosition(0x%p)", m_hChapter));
01324   }
01325
01326 CLEANUP:
01327   return hr;
01328 }
01329
01330
01331 /////////////////////////////////////////////////////////////////
01332 // HRESULT CRowset::GetNextRows
01333 //
01334 /////////////////////////////////////////////////////////////////
01335 HRESULT CRowset::GetNextRows(DBROWOFFSET lOffset, DBROWCOUNT cRows, DBCOUNTITEM* pcRowsObtained, HROW** prghRows)
01336 {
01337   HRESULT hr = E_FAIL;
01338
01339   DBCOUNTITEM cRowsObtained = 0;
01340   HROW* rghRows = NULL;
01341   if(prghRows)
01342     rghRows = *prghRows;
01343
01344   if(m_pIRowset)
01345   {
01346     //GetNextRows
01347     XTEST(hr = m_pIRowset->GetNextRows(
01348       m_hChapter,         // hChapter
01349       lOffset,          // lOffset
01350       cRows,            // cRows
01351       &cRowsObtained,       // cRowsObtained
01352       &rghRows));         // rghRows
01353     TESTC(TRACE_METHOD(hr, L"IRowset::GetNextRows(0x%p, %ld, %ld, &%lu, &0x%p)", m_hChapter, lOffset, cRows, cRowsObtained, rghRows));
01354   }
01355
01356 CLEANUP:
01357   if(pcRowsObtained)
01358     *pcRowsObtained = cRowsObtained;
01359
01360   if(prghRows)
01361     *prghRows = rghRows;
01362   else
01363     SAFE_FREE(rghRows);
01364   return hr;
01365 }
01366
01367
01368 /////////////////////////////////////////////////////////////////
01369 // HRESULT CRowset::AddRefRows
01370 //
01371 /////////////////////////////////////////////////////////////////
01372 HRESULT CRowset::AddRefRows(DBROWCOUNT cRows, HROW* rghRows, ULONG* rgRefCounts)
01373 {
01374   HRESULT hr = E_FAIL;
01375
01376   //Alloc Array for Status
01377   DBROWSTATUS* rgRowStatus = NULL;
01378   SAFE_ALLOC(rgRowStatus, DBROWSTATUS, cRows);
01379
01380   if(m_pIRowset)
01381   {
01382     //AddRefRows
01383     XTEST(hr = m_pIRowset->AddRefRows(cRows, rghRows, rgRefCounts, rgRowStatus));
01384     DisplayRowErrors(hr, cRows, rghRows, rgRowStatus);
01385     TESTC(TRACE_METHOD(hr, L"IRowset::AddRefRows(%lu, 0x%p, 0x%p, 0x%p)", cRows, rghRows, rgRefCounts, rgRowStatus));
01386   }
01387
01388 CLEANUP:
01389   SAFE_FREE(rgRowStatus);
01390   return hr;
01391 }
01392
01393
01394 /////////////////////////////////////////////////////////////////
01395 // HRESULT CRowset::ReleaseRows
01396 //
01397 /////////////////////////////////////////////////////////////////
01398 HRESULT CRowset::ReleaseRows(DBROWCOUNT cRows, HROW* rghRows, ULONG* rgRefCounts)
01399 {
01400   HRESULT hr = E_FAIL;
01401   DBROWSTATUS* rgRowStatus = NULL;
01402
01403   if(m_pIRowset)
01404   {
01405     //Alloc Array for Status
01406     SAFE_ALLOC(rgRowStatus, DBROWSTATUS, cRows);
01407
01408     //ReleaseRows
01409     XTEST(hr = m_pIRowset->ReleaseRows(cRows, rghRows, NULL, rgRefCounts, rgRowStatus));
01410     DisplayRowErrors(hr, cRows, rghRows, rgRowStatus);
01411     TESTC(TRACE_METHOD(hr, L"IRowset::ReleaseRows(%lu, 0x%p, NULL, 0x%p, 0x%p)", cRows, rghRows, rgRefCounts, rgRowStatus));
01412   }
01413
01414 CLEANUP:
01415   SAFE_FREE(rgRowStatus);
01416   return hr;
01417 }
01418
01419
01420
01421
01422 /////////////////////////////////////////////////////////////////
01423 //  HRESULT CRowset::GetRowFromHROW
01424 //
01425 /////////////////////////////////////////////////////////////////
01426 HRESULT CRowset::GetRowFromHROW(CAggregate* pCAggregate, HROW hRow, REFIID riid, IUnknown** ppIUnknown)
01427 {
01428   HRESULT hr = E_FAIL;
01429
01430   if(m_pIGetRow)
01431   {
01432     //IGetRow::GetRowFromHROW
01433     XTEST(hr = m_pIGetRow->GetRowFromHROW(pCAggregate, hRow, riid, ppIUnknown));
01434     TESTC(TRACE_METHOD(hr, L"IGetRow::GetRowFromHROW(0x%p, 0x%p, %s, &0x%p)", pCAggregate, hRow, GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL));
01435
01436     //Handle Aggregation
01437     if(pCAggregate)
01438       TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
01439   }
01440
01441 CLEANUP:
01442   return hr;
01443 }
01444
01445
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/Driver/StdAfx.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • Driver

StdAfx.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      Stdafx.h
00003   Summary:   Standard header
00004   Classes:   None
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #if !defined(AFX_STDAFX_H__6DD1E6E0_28C1_11D2_B5B6_00C04FC340EE__INCLUDED_)
00023 #define AFX_STDAFX_H__6DD1E6E0_28C1_11D2_B5B6_00C04FC340EE__INCLUDED_
00024
00025 #if _MSC_VER >= 1000
00026 #pragma once
00027 #endif // _MSC_VER >= 1000
00028
00029 #define STRICT
00030
00031
00032 #define _WIN32_WINNT 0x0500
00033 #define _ATL_APARTMENT_THREADED
00034
00035
00036 #include <atlbase.h>
00037 //You may derive a class from CComModule and use it if you want to override
00038 //something, but do not change the name of _Module
00039 extern CComModule _Module;
00040 #include <atlcom.h>
00041
00042 //{{AFX_INSERT_LOCATION}}
00043 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00044
00045 #include <crtdbg.h>
00046 #include <comsvcs.h>
00047 #include <stdlib.h>
00048 #include <vector>
00049 #include <comdef.h>
00050
00051 #endif // !defined(AFX_STDAFX_H__6DD1E6E0_28C1_11D2_B5B6_00C04FC340EE__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/classfac.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

classfac.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module CLASSFAC.CPP | The module contains the DLL Entry and Exit
00008 // points, plus the OLE ClassFactory class.
00009 //
00010 //
00011
00012 // Includes ------------------------------------------------------------------
00013
00014 #include "headers.h"
00015 #include "classfac.h"
00016 #include "msdasc.h"     //CLSID_RootBinder
00017
00018 // Static vars ---------------------------------------------------------------
00019
00020 static const char * s_strDllName = "SampProv";  // used with GetModuleHandle
00021 static const struct
00022 {
00023   char * strRegKey;
00024   char * strValueName;
00025   DWORD  dwType;
00026   char * strValue;
00027 } s_rgRegInfo[] =
00028 {
00029   //CLSID_SampProv
00030     { "SampProv",                               NULL,       REG_SZ,   "Microsoft OLE DB Sample Provider"          },
00031     { "SampProv\\Clsid",                            NULL,       REG_SZ,   "{E8CCCB79-7C36-101B-AC3A-00AA0044773D}"      },
00032     { "CLSID\\{E8CCCB79-7C36-101B-AC3A-00AA0044773D}",              NULL,       REG_SZ,   "SampProv"                      },
00033   { "CLSID\\{E8CCCB79-7C36-101B-AC3A-00AA0044773D}",              "OLEDB_SERVICES", REG_DWORD,  "-1"                        },
00034     { "CLSID\\{E8CCCB79-7C36-101B-AC3A-00AA0044773D}\\ProgID",          NULL,       REG_SZ,   "SampProv"                      },
00035     { "CLSID\\{E8CCCB79-7C36-101B-AC3A-00AA0044773D}\\VersionIndependentProgID",NULL,       REG_SZ,   "SampProv"                      },
00036     { "CLSID\\{E8CCCB79-7C36-101B-AC3A-00AA0044773D}\\InprocServer32",      NULL,       REG_SZ,   "%s"                        },
00037   { "CLSID\\{E8CCCB79-7C36-101B-AC3A-00AA0044773D}\\InprocServer32",      "ThreadingModel", REG_SZ,   "Both"                        },
00038   { "CLSID\\{E8CCCB79-7C36-101B-AC3A-00AA0044773D}\\OLE DB Provider",     NULL,       REG_SZ,   "Microsoft OLE DB Sample Provider"          },
00039
00040   //CLSID_SampProvConnectionPage
00041     { "SampProvConnectionPage",                         NULL,       REG_SZ,   "Microsoft OLE DB Sample Provider Connection Page"  },
00042     { "SampProvConnectionPage\\Clsid",                      NULL,       REG_SZ,   "{119C8711-905B-11d2-AF65-00C04F6F8697}"      },
00043     { "CLSID\\{119C8711-905B-11d2-AF65-00C04F6F8697}",              NULL,       REG_SZ,   "SampProvConnectionPage"              },
00044     { "CLSID\\{119C8711-905B-11d2-AF65-00C04F6F8697}\\ProgID",          NULL,       REG_SZ,   "SampProvConnectionPage"              },
00045     { "CLSID\\{119C8711-905B-11d2-AF65-00C04F6F8697}\\VersionIndependentProgID",NULL,       REG_SZ,   "SampProvConnectionPage"              },
00046     { "CLSID\\{119C8711-905B-11d2-AF65-00C04F6F8697}\\InprocServer32",      NULL,       REG_SZ,   "%s"                        },
00047   { "CLSID\\{119C8711-905B-11d2-AF65-00C04F6F8697}\\InprocServer32",      "ThreadingModel", REG_SZ,   "Both"                        },
00048
00049   //CLSID_SampProvAdvancedPage
00050     { "SampProvAdvancedPage",                         NULL,       REG_SZ,   "Microsoft OLE DB Sample Provider Advanced Page"  },
00051     { "SampProvAdvancedPage\\Clsid",                      NULL,       REG_SZ,   "{119C8712-905B-11d2-AF65-00C04F6F8697}"      },
00052     { "CLSID\\{119C8712-905B-11d2-AF65-00C04F6F8697}",              NULL,       REG_SZ,   "SampProvAdvancedPage"                },
00053     { "CLSID\\{119C8712-905B-11d2-AF65-00C04F6F8697}\\ProgID",          NULL,       REG_SZ,   "SampProvAdvancedPage"                },
00054     { "CLSID\\{119C8712-905B-11d2-AF65-00C04F6F8697}\\VersionIndependentProgID",NULL,       REG_SZ,   "SampProvAdvancedPage"                },
00055     { "CLSID\\{119C8712-905B-11d2-AF65-00C04F6F8697}\\InprocServer32",      NULL,       REG_SZ,   "%s"                        },
00056   { "CLSID\\{119C8712-905B-11d2-AF65-00C04F6F8697}\\InprocServer32",      "ThreadingModel", REG_SZ,   "Both"                        },
00057
00058
00059   //CLSID_SampProvBinder
00060   { "SampProvBinder",                             NULL,       REG_SZ,   "Microsoft OLE DB Sample Provider Binder"     },
00061   { "SampProvBinder\\Clsid",                          NULL,       REG_SZ,   "{245E7460-B577-11D2-AF53-00C04F782926}"      },
00062   { "CLSID\\{245E7460-B577-11D2-AF53-00C04F782926}",              NULL,       REG_SZ,   "SampProvBinder"                  },
00063   { "CLSID\\{245E7460-B577-11D2-AF53-00C04F782926}\\ProgID",          NULL,       REG_SZ,   "SampProvBinder"                  },
00064   { "CLSID\\{245E7460-B577-11D2-AF53-00C04F782926}\\VersionIndependentProgID",NULL,       REG_SZ,   "SampProvBinder"                  },
00065   { "CLSID\\{245E7460-B577-11D2-AF53-00C04F782926}\\InprocServer32",      NULL,       REG_SZ,   "%s"                        },
00066   { "CLSID\\{245E7460-B577-11D2-AF53-00C04F782926}\\InprocServer32",      "ThreadingModel", REG_SZ,   "Both"                        },
00067   { "CLSID\\{245E7460-B577-11D2-AF53-00C04F782926}\\OLE DB Binder",     NULL,       REG_SZ,   "Microsoft OLE DB Sample Provider Binder"     },
00068 };
00069
00070 // Code ----------------------------------------------------------------------
00071
00072 // DllMain -------------------------------------------------------------------
00073 //
00074 // @func DLL Entry point where Instance and Thread attach/detach notifications
00075 // takes place.  OLE is initialized and the IMalloc Interface pointer is obtained.
00076 //
00077 // @rdesc Boolean Flag
00078 //      @flag TRUE | Successful initialization
00079 //      @flag FALSE | Failure to intialize
00080 //
00081 BOOL WINAPI DllMain
00082     (
00083     HINSTANCE   hInstDLL,   //@parm IN | Application Instance Handle
00084     DWORD       fdwReason,  //@parm IN | Indicated Process or Thread activity
00085     LPVOID      lpvReserved //@parm IN | Reserved...
00086     )
00087 {
00088     BOOL        fRetVal = FALSE;
00089     SYSTEM_INFO SystemInformation;
00090
00091     switch (fdwReason)
00092         {
00093     case DLL_PROCESS_ATTACH:
00094
00095         // Assume successfully initialized
00096         fRetVal = TRUE;
00097
00098         // Do one-time initialization when first process attaches
00099         if (!g_cAttachedProcesses)
00100             {
00101             g_hInstance = hInstDLL;
00102
00103             // Get the system page size
00104             if (!g_dwPageSize)
00105                 {
00106                 GetSystemInfo( &SystemInformation );    // can't fail
00107                 g_dwPageSize = SystemInformation.dwPageSize;
00108                 }
00109             }
00110
00111         // Do per-process initialization here...
00112
00113         // Remember that another process successfully attached
00114         g_cAttachedProcesses++;
00115         break;
00116
00117     case DLL_PROCESS_DETACH:
00118         // Clean up when the last process is going away
00119         if (g_cAttachedProcesses == 1)
00120             {
00121             }
00122
00123         // Do per-process clean up here...
00124
00125         // Remember that a process has detached
00126         g_cAttachedProcesses--;
00127         break;
00128
00129     case DLL_THREAD_ATTACH:
00130         break;
00131
00132     case DLL_THREAD_DETACH:
00133         break;
00134         }
00135
00136     return fRetVal;
00137 }
00138
00139
00140 // DllGetClassObject ---------------------------------------------------------
00141 //
00142 // @func This function is exposed to OLE so that the classfactory can
00143 // be obtained.
00144 //
00145 // @rdesc HRESULT indicating status of routine
00146 //      @flag S_OK                      | The object was retrieved successfully.
00147 //      @flag CLASS_E_CLASSNOTAVAILABLE | DLL does not support class.
00148 //      @flag E_OUTOFMEMORY             | Out of memory.
00149 //      @flag E_INVALIDARG              | One or more arguments are invalid.
00150 //      @flag E_UNEXPECTED              | An unexpected error occurred.
00151 //      @flag OTHER | Other HRESULTs returned by called functions
00152 //
00153 HRESULT CALLBACK DllGetClassObject
00154     (
00155     REFCLSID    rclsid, //@parm IN | CLSID of the object class to be loaded
00156     REFIID      riid,   //@parm IN | Interface on object to be instantiated
00157     LPVOID *    ppvObj  //@parm OUT | Pointer to interface that was instantiated
00158     )
00159 {
00160     CClassFactory * pClassFactory;
00161     HRESULT         hr;
00162
00163     // Check for valid ppvObj pointer
00164     if (!ppvObj)
00165         return ResultFromScode( E_INVALIDARG );
00166
00167     // In case we fail, we need to zero output arguments
00168     *ppvObj = NULL;
00169
00170     // We only service CLSID_SampProv
00171     if (rclsid != CLSID_SampProv &&
00172     rclsid != CLSID_SampProvConnectionPage &&
00173     rclsid != CLSID_SampProvAdvancedPage &&
00174     rclsid != CLSID_SampProvBinder)
00175         return ResultFromScode( CLASS_E_CLASSNOTAVAILABLE );
00176
00177     // We only support the IUnknown and IClassFactory interfaces
00178     if (riid != IID_IUnknown &&
00179         riid != IID_IClassFactory)
00180         return ResultFromScode( E_NOINTERFACE );
00181
00182     // Create our ClassFactory object
00183     pClassFactory = new CClassFactory(rclsid);
00184     if (pClassFactory == NULL)
00185         return ResultFromScode( E_OUTOFMEMORY );
00186
00187     // Get the desired interface on this object
00188     hr = pClassFactory->QueryInterface( riid, ppvObj );
00189     if (!SUCCEEDED( hr ))
00190         SAFE_DELETE( pClassFactory );
00191
00192     return hr;
00193 }
00194
00195
00196 // DllCanUnloadNow -----------------------------------------------------------
00197 //
00198 // @func Indicates whether the DLL is no longer in use and
00199 // can be unloaded.
00200 //
00201 // @rdesc HRESULT indicating status of routine
00202 //      @flag S_OK | DLL can be unloaded now.
00203 //      @flag S_FALSE | DLL cannot be unloaded now.
00204 //
00205 STDAPI DllCanUnloadNow( void )
00206 {
00207     if (!g_cObj && !g_cLock)
00208         return ResultFromScode( S_OK );
00209     else
00210         return ResultFromScode( S_FALSE );
00211 }
00212
00213
00214 //-----------------------------------------------------------------------------
00215 // CClassFactory
00216 //-----------------------------------------------------------------------------
00217
00218 // CClassFactory -------------------------------------------------------------
00219 //
00220 // @mfunc Constructor for this class
00221 //
00222 // @rdesc NONE
00223 //
00224 CClassFactory::CClassFactory(REFCLSID clsid)
00225 {
00226     m_cRef  = 0;
00227   m_clsid = clsid;
00228
00229     // Increment global object count
00230     OBJECT_CONSTRUCTED();
00231 }
00232
00233 // ~CClassFactory ------------------------------------------------------------
00234 //
00235 // @mfunc Destructor for this class
00236 //
00237 // @rdesc NONE
00238 //
00239 CClassFactory:: ~CClassFactory( void )
00240 {
00241     // Decrement global object count
00242     OBJECT_DESTRUCTED();
00243 }
00244
00245 // QueryInterface ------------------------------------------------------------
00246 //
00247 // @mfunc Returns a pointer to a specified interface. Callers use
00248 // QueryInterface to determine which interfaces the called object
00249 // supports.
00250 //
00251 // @rdesc HRESULT indicating the status of the method
00252 //      @flag S_OK          | Interface is supported and ppvObject is set.
00253 //      @flag E_NOINTERFACE | Interface is not supported by the object
00254 //      @flag E_INVALIDARG  | One or more arguments are invalid.
00255 //
00256 STDMETHODIMP CClassFactory::QueryInterface
00257     (
00258     REFIID      riid,   //@parm IN | Interface ID of the interface being queried for.
00259     LPVOID *    ppvObj  //@parm OUT | Pointer to interface that was instantiated
00260     )
00261 {
00262     // Check for valid ppvObj pointer
00263     if (!ppvObj)
00264         return ResultFromScode( E_INVALIDARG );
00265
00266     // In case we fail, we need to zero output arguments
00267     *ppvObj = NULL;
00268
00269     // Do we support this interface?
00270     if (riid == IID_IUnknown ||
00271         riid == IID_IClassFactory)
00272         *ppvObj = (LPVOID) this;
00273
00274     // If we're going to return an interface, AddRef it first
00275     if (*ppvObj)
00276         {
00277         ((LPUNKNOWN) *ppvObj)->AddRef();
00278         return ResultFromScode( S_OK );
00279         }
00280     else
00281         return ResultFromScode( E_NOINTERFACE );
00282 }
00283
00284 // AddRef --------------------------------------------------------------------
00285 //
00286 // @mfunc Increments a persistence count for the object
00287 //
00288 // @rdesc Current reference count
00289 //
00290 STDMETHODIMP_( DBREFCOUNT ) CClassFactory::AddRef( void )
00291 {
00292     return ++m_cRef;
00293 }
00294
00295 // Release -------------------------------------------------------------------
00296 //
00297 // @mfunc Decrements a persistence count for the object and if
00298 // persistence count is 0, the object destroys itself.
00299 //
00300 // @rdesc Current reference count
00301 //
00302 STDMETHODIMP_( DBREFCOUNT ) CClassFactory::Release( void )
00303 {
00304     if (!--m_cRef)
00305         {
00306         delete this;
00307         return 0;
00308         }
00309
00310     return m_cRef;
00311 }
00312
00313 // CreateInstance ------------------------------------------------------------
00314 //
00315 // @mfunc Creates an uninitialized instance of an object class.
00316 // Initialization is subsequently performed using another
00317 // interface-specific method
00318 //
00319 // @rdesc HRESULT indicating the status of the method
00320 //      @flag S_OK          | Interface is supported and ppvObject is set.
00321 //      @flag E_NOINTERFACE | Interface is not supported by the object
00322 //      @flag E_INVALIDARG  | One or more arguments are invalid.
00323 //      @flag E_OUTOFMEMORY | Memory could not be allocated
00324 //      @flag OTHER         | Other HRESULTs returned by called functions
00325 //
00326 STDMETHODIMP CClassFactory::CreateInstance
00327     (
00328     LPUNKNOWN   pUnkOuter,  //@parm IN | Points to the controlling IUnknown interface
00329     REFIID      riid,       //@parm IN | Interface ID of the interface being queried for.
00330     LPVOID *    ppvObj      //@parm OUT | Pointer to interface that was instantiated
00331     )
00332 {
00333     HRESULT hr            = S_OK;
00334     CDataSource*  pCDataSource  = NULL;
00335   CPropertyPage*  pCPropertyPage  = NULL;
00336   CBinder *   pBinder = NULL;
00337
00338     // Check for valid ppvObj pointer
00339     if (!ppvObj)
00340         return E_INVALIDARG;
00341
00342     // In case we fail, we need to zero output arguments
00343     *ppvObj = NULL;
00344
00345     // If we're given a controlling IUnknown, it must ask for IUnknown.
00346     // Otherwise, the caller will end up getting a pointer to their pUnkOuter
00347     // instead of to the new object we create and will have no way of getting
00348     // back to this new object, so they won't be able to free it.  Bad!
00349     if (pUnkOuter && riid != IID_IUnknown)
00350         return DB_E_NOAGGREGATION;
00351
00352     //CLSID_SampProv
00353     if(m_clsid == CLSID_SampProv)
00354   {
00355     // Create a CDataSource object
00356     pCDataSource = new CDataSource( pUnkOuter );
00357   }
00358   else if(m_clsid == CLSID_SampProvConnectionPage)
00359   {
00360     // Create a CDSLConnectionPage object
00361     pCPropertyPage = new CDSLConnectionPage();
00362   }
00363   else if(m_clsid == CLSID_SampProvAdvancedPage)
00364   {
00365     // Create a CDSLAdvancedPage object
00366     pCPropertyPage = new CDSLAdvancedPage();
00367   }
00368   else if(m_clsid == CLSID_SampProvBinder)
00369   {
00370     // Create a CBinder object
00371     pBinder = new CBinder(pUnkOuter);
00372   }
00373   else
00374   {
00375         return CLASS_E_CLASSNOTAVAILABLE;
00376   }
00377
00378   //E_OUTOFMEMORY
00379   if(!pCDataSource && !pCPropertyPage && !pBinder)
00380   {
00381     return E_OUTOFMEMORY;
00382   }
00383
00384     //Obtain the correct interface...
00385     if(pCDataSource)
00386   {
00387     hr = E_FAIL;
00388     if(pCDataSource->FInit())
00389       hr = pCDataSource->QueryInterface( riid, ppvObj );
00390   }
00391   else if(pBinder)
00392   {
00393     hr = E_OUTOFMEMORY;
00394     if(pBinder->FInit())
00395       hr = pBinder->QueryInterface( riid, ppvObj );
00396   }
00397   else
00398   {
00399     hr = pCPropertyPage->QueryInterface( riid, ppvObj );
00400   }
00401
00402   if(FAILED(hr))
00403   {
00404     SAFE_DELETE(pCDataSource);
00405     SAFE_DELETE(pCPropertyPage);
00406   }
00407
00408     return hr;
00409 }
00410
00411 // LockServer ----------------------------------------------------------------
00412 //
00413 // @mfunc Controls whether an object application is kept in memory.
00414 // Keeping the application alive in memory allows instances of this
00415 // class to be created more quickly.
00416 //
00417 // @rdesc HRESULT indicating the status of the method
00418 //      @flag S_OK | Interface is supported and ppvObject is set.
00419 //
00420 STDMETHODIMP CClassFactory::LockServer
00421     (
00422     BOOL fLock                  //@parm IN | TRUE or FALSE to lock or unlock
00423     )
00424 {
00425     if (fLock)
00426         InterlockedIncrement( &g_cLock );
00427     else
00428         InterlockedDecrement( &g_cLock );
00429
00430     return NOERROR;
00431 }
00432
00433
00434 //---------------------------------------------------------------------------
00435 // @func    Removes keys to the registry.
00436 //
00437 // @rdesc Returns NOERROR
00438 //
00439 // @comm
00440 // Special Notes:   This allows us to avoid using a .reg file.
00441 //
00442 // Note that a more robust method would be to trace existing
00443 // CLSID and ProgID, and trace each from the other.  This would handle the
00444 // case where either changed.  Then should probably enumerate all keys under
00445 // the ProgID and CLSID, then delete them.
00446 //
00447 // Also note the problem with our exposing a different CLSID for the debug
00448 // and ndebug versions, yet the ProgID remains the same.  Should we have
00449 // different ProgID's also?
00450 //
00451 //---------------------------------------------------------------------------
00452 STDAPI DllUnregisterServer
00453     (
00454     void
00455     )
00456 {
00457     int     i;
00458     int     iNumErrors = 0;
00459   LONG  stat;
00460
00461     // Delete all table entries.  Loop in reverse order, since they
00462     // are entered in a basic-to-complex order.
00463     // We cannot delete a key that has subkeys.
00464     // Ignore errors.
00465     for (i=NUMELEM( s_rgRegInfo ) - 1; i >= 0; i--)
00466         {
00467     stat = RegDeleteKey( HKEY_CLASSES_ROOT, s_rgRegInfo[i].strRegKey );
00468         if ((stat != ERROR_SUCCESS) &&
00469           (stat != ERROR_FILE_NOT_FOUND) )
00470             iNumErrors++;
00471         }
00472
00473   IRegisterProvider*  pIRegisterProvider = NULL;
00474   //Obtain the Root Binder
00475   if(SUCCEEDED(CoCreateInstance(CLSID_RootBinder, NULL, CLSCTX_ALL, IID_IRegisterProvider, (void**)&pIRegisterProvider)))
00476   {
00477     //Unregister SampProv's URL prefix with the RootBinder
00478     //NOTE:  Don't fail, since we may have never registered ourselves with the root binder
00479     pIRegisterProvider->UnregisterProvider(SAMPPROV_URL_PREFIX, 0, CLSID_SampProvBinder);
00480     pIRegisterProvider->Release();
00481   }
00482
00483     return ResultFromScode( iNumErrors ? E_FAIL : S_OK );
00484 }
00485
00486
00487 //---------------------------------------------------------------------------
00488 // @func    Adds necessary keys to the registry.
00489 //
00490 // @rdesc Returns one of the following
00491 // @flag NOERROR    | Registration succeeded
00492 // @flag E_FAIL     | Something didn't work
00493 //
00494 // @comm
00495 // Special Notes:   This allows us to avoid using a .reg file.
00496 // Here is what was in the SampProv.REG file of yore.
00497 // Note that now we have two CLSID's, one for DEBUG.  Then each one
00498 // can point to a different .DLL.
00499 //
00500 //---------------------------------------------------------------------------
00501 STDAPI DllRegisterServer
00502     (
00503     void
00504     )
00505 {
00506     HKEY        hk;
00507     HMODULE     hModule;
00508     DWORD       dwDisposition;
00509     LONG        stat;
00510   CHAR    strFileName[MAX_PATH+1];
00511     CHAR        strOutBuff[300+1];
00512   HRESULT   hr = S_OK;
00513
00514     // Get the full path name for this DLL.
00515     if (NULL == (hModule = GetModuleHandle( s_strDllName )))
00516         return ResultFromScode( E_FAIL );
00517     if (0 == GetModuleFileName( hModule, strFileName, sizeof( strFileName ) / sizeof( char )))
00518         return ResultFromScode( E_FAIL );
00519
00520     // Make a clean start
00521     DllUnregisterServer();
00522
00523     // Loop through s_rgRegInfo, and put everything in it.
00524     // Every entry is based on HKEY_CLASSES_ROOT.
00525     for (ULONG i=0; i < NUMELEM( s_rgRegInfo ); i++)
00526         {
00527
00528     // Fill in any "%s" arguments with the name of this DLL.
00529     if (s_rgRegInfo[i].dwType == REG_DWORD)
00530       *(DWORD*)strOutBuff = atol( s_rgRegInfo[i].strValue );
00531     else
00532       wsprintf( strOutBuff, s_rgRegInfo[i].strValue, strFileName );
00533
00534         // Create the Key.  If it exists, we open it.
00535         // Thus we can still change the value below.
00536         stat = RegCreateKeyEx(
00537                 HKEY_CLASSES_ROOT,
00538                 s_rgRegInfo[i].strRegKey,
00539                 0,  // dwReserved
00540                 NULL,   // lpszClass
00541                 REG_OPTION_NON_VOLATILE,
00542                 KEY_ALL_ACCESS, // security access mask
00543                 NULL,   // lpSecurityAttributes
00544                 &hk,    // phkResult
00545                 &dwDisposition );
00546         if (stat != ERROR_SUCCESS)
00547             return ResultFromScode( E_FAIL );
00548
00549         stat = RegSetValueEx(
00550                 hk,               // created above
00551                 s_rgRegInfo[i].strValueName,  // lpszValueName
00552                 0,                // dwReserved
00553                 s_rgRegInfo[i].dwType,      // fdwType
00554         (BYTE *) strOutBuff,      // value
00555                 s_rgRegInfo[i].dwType == REG_SZ ?
00556                 strlen( strOutBuff ) + 1 :    // cbData, including null terminator
00557         sizeof(DWORD));
00558         RegCloseKey( hk );
00559         if (stat != ERROR_SUCCESS)
00560             return ResultFromScode( E_FAIL );
00561         }
00562
00563   IRegisterProvider*  pIRegisterProvider = NULL;
00564   //Register with the RootBinder
00565   if(SUCCEEDED(CoCreateInstance(CLSID_RootBinder, NULL, CLSCTX_ALL, IID_IRegisterProvider, (void**)&pIRegisterProvider)))
00566   {
00567     //Register Sampprov's URL prefix with the RootBinder
00568     hr = pIRegisterProvider->SetURLMapping(SAMPPROV_URL_PREFIX, 0, CLSID_SampProvBinder);
00569     pIRegisterProvider->Release();
00570   }
00571
00572     return ResultFromScode( hr );
00573 }
00574
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/TIMEWND.c Source File

  • Multimedia
  • Audio
  • MidiPlyr

TIMEWND.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 * TimeWnd.C
00013 *
00014 * Message handlers and other code for the time window
00015 *
00016 *****************************************************************************/
00017
00018 #pragma warning(disable:4756)
00019
00020 #define _INC_SHELLAPI
00021 #include <windows.h>
00022 #undef _INC_SHELLAPI
00023
00024 #include <shellapi.h>
00025 #include <windowsx.h>
00026 #include <mmsystem.h>
00027 #include <commdlg.h>
00028 #include <commctrl.h>
00029 #include <ctype.h>
00030
00031 #include "debug.h"
00032
00033 #include "MIDIPlyr.H"
00034
00035 /* Into gszFormatHMS[]
00036 */
00037 #define HOUR_INDEX          0
00038 #define MIN_INDEX           3
00039 #define SEC_INDEX           6
00040
00041 #define MIN_SEP_INDEX       2
00042 #define SEC_SEP_INDEX       5
00043
00044 #define TIMER_ID            0
00045 #define TIMER_INTERVAL      100
00046
00047 PRIVATE HFONT           ghFont          = NULL;
00048 PRIVATE char BCODE      gszFormatHMS[]  = "44:44:44";
00049 PRIVATE char BCODE      gszFormatTicks[]= "444444444";
00050
00051 #define MAX_CBFMT (max(sizeof(gszFormatHMS), sizeof(gszFormatTicks)))
00052
00053 PRIVATE BOOL            gbRepaint       = TRUE;
00054 PRIVATE int             gnPosY;
00055 PRIVATE int             ganPosX[MAX_CBFMT];
00056
00057 PRIVATE int             gnTimerOn       = 0;
00058
00059 PRIVATE VOID NEAR PASCAL PaintTime(HDC hDC);
00060
00061 PRIVATE BOOL NEAR PASCAL TWnd_OnCreate(HWND hWnd, CREATESTRUCT FAR* lpCreateStruct);
00062 PRIVATE VOID NEAR PASCAL TWnd_OnSize(HWND hWnd, UINT state, int cx, int cy);
00063 PRIVATE VOID NEAR PASCAL TWnd_OnPaint(HWND hWnd);
00064 PRIVATE VOID NEAR PASCAL TWnd_OnCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify);
00065 PRIVATE VOID NEAR PASCAL TWnd_OnDestroy(HWND hWnd);
00066 PRIVATE VOID NEAR PASCAL TWnd_OnTimer(HWND hWnd, UINT id);
00067
00068 /*****************************************************************************
00069 *
00070 * PaintTime
00071 *
00072 * Paint the current sequencer time into the time window.
00073 *
00074 * HWND hDC                  - DC to paint time into
00075 *
00076 * Repaint the time. Unless gbRepaint is set, just repaint the sections
00077 * of the time that need updating. Clear gbRepaint when done.
00078 *
00079 *****************************************************************************/
00080 static UINT oldh = 0;
00081 static UINT oldm = 0;
00082 static UINT olds = 0;
00083
00084 static char szOldTicks[MAX_CBFMT];
00085
00086 PRIVATE VOID NEAR PASCAL PaintTime(
00087     HDC                     hDC)
00088 {
00089     TICKS                   tkTime;
00090     DWORD                   msTime;
00091     int                     ii;
00092     int                     cb;
00093     char                    szWork[MAX_CBFMT];
00094     HFONT                   hFont;
00095     UINT                    h;
00096     UINT                    m;
00097     UINT                    s;
00098     BOOL                    fRepaintedSec;
00099     BOOL                    fRepaintedMin;
00100
00101     if (MMSYSERR_NOERROR != seqTime(gpSeq, &tkTime))
00102         return;
00103
00104     SetBkColor(hDC, RGB(0xFF, 0xFF, 0xFF));
00105     hFont = SelectObject(hDC, ghFont);
00106
00107     if (gnTimeFormat == IDS_TICKS)
00108     {
00109         wsprintf(szWork, "%9lu", (DWORD)tkTime);
00110
00111         for (ii = 0; ii < 9; ii++)
00112         {
00113             if (gbRepaint || szOldTicks[ii] != szWork[ii])
00114                 EmbossedTextOut(
00115                                 hDC,
00116                                 ganPosX[ii],
00117                                 gnPosY,
00118                                 szWork+ii,
00119                                 1,
00120                                 (COLORREF)-1,
00121                                 (COLORREF)-1,
00122                                 3,
00123                                 3);
00124             szOldTicks[ii] = szWork[ii];
00125         }
00126     }
00127     else
00128     {
00129         msTime = seqTicksToMillisecs(gpSeq, tkTime) / 1000L;
00130
00131         h = (UINT)(msTime / 3600L);    msTime %= 3600L;
00132         m = (UINT)(msTime / 60L);      msTime %= 60L;
00133         s = (UINT)msTime;
00134
00135         cb = lstrlen(gszFormatHMS);
00136
00137         if (gbRepaint || h != oldh)
00138         {
00139             szWork[0] = '0' + (char)(h / 10);
00140             szWork[1] = '0' + (char)(h % 10);
00141             EmbossedTextOut(
00142                             hDC,
00143                             ganPosX[HOUR_INDEX],
00144                             gnPosY,
00145                             szWork,
00146                             2,
00147                             (COLORREF)-1,
00148                             (COLORREF)-1,
00149                             3,
00150                             3);
00151             oldh = h;
00152         }
00153
00154         fRepaintedMin = FALSE;
00155         if (gbRepaint || m != oldm)
00156         {
00157             szWork[0] = gszFormatHMS[MIN_SEP_INDEX];
00158             szWork[1] = '0' + (char)(m / 10);
00159             szWork[2] = '0' + (char)(m % 10);
00160             EmbossedTextOut(
00161                             hDC,
00162                             ganPosX[MIN_SEP_INDEX],
00163                             gnPosY,
00164                             szWork,
00165                             3,
00166                             (COLORREF)-1,
00167                             (COLORREF)-1,
00168                             3,
00169                             3);
00170             oldm = m;
00171             fRepaintedMin = TRUE;
00172         }
00173
00174         fRepaintedSec = FALSE;
00175         if (gbRepaint || s != olds)
00176         {
00177             szWork[0] = gszFormatHMS[SEC_SEP_INDEX];
00178             szWork[1] = '0' + (char)(s / 10);
00179             szWork[2] = '0' + (char)(s % 10);
00180             EmbossedTextOut(
00181                             hDC,
00182                             ganPosX[SEC_SEP_INDEX],
00183                             gnPosY,
00184                             szWork,
00185                             3,
00186                             (COLORREF)-1,
00187                             (COLORREF)-1,
00188                             3,
00189                             3);
00190             olds = s;
00191             fRepaintedSec = TRUE;
00192         }
00193
00194         /* If we're doing a full repaint, then update the separators
00195          */
00196         if (gbRepaint)
00197             for (ii=0; ii < cb; ii++)
00198                 if (!isdigit(gszFormatHMS[ii]))
00199                 {
00200                     if (SEC_SEP_INDEX == ii && fRepaintedSec)
00201                         continue;
00202
00203                     if (MIN_SEP_INDEX == ii && fRepaintedMin)
00204                         continue;
00205
00206                     EmbossedTextOut(
00207                                     hDC,
00208                                     ganPosX[ii],
00209                                     gnPosY,
00210                                     gszFormatHMS+ii,
00211                                     1,
00212                                     (COLORREF)-1,
00213                                     (COLORREF)-1,
00214                                     3,
00215                                     3);
00216                 }
00217     }
00218
00219     gbRepaint = FALSE;
00220     SelectObject(hDC, hFont);
00221 }
00222
00223 /*****************************************************************************
00224 *
00225 * TWnd_OnCreate
00226 *
00227 * Handle WM_CREATE message to time window.
00228 *
00229 * HWND hWnd                 - Window handle
00230 * CREATESTRUCT FAR* lpCreateStruct
00231 *                           - Pointer to creation parameters for the window.
00232 *
00233 * Returns TRUE on success. Returning FALSE will cause the window to be
00234 * destroyed and the application will exit.
00235 *
00236 * Just return TRUE so the window will be created.
00237 *
00238 *****************************************************************************/
00239 BOOL NEAR PASCAL TWnd_OnCreate(
00240     HWND                    hWnd,
00241     CREATESTRUCT FAR*       lpCreateStruct)
00242 {
00243     return TRUE;
00244 }
00245
00246 /*****************************************************************************
00247 *
00248 * TWnd_OnSize
00249 *
00250 * Handle WM_SIZE message to time window.
00251 *
00252 * HWND hWnd                 - Window handle
00253 * UINT state                - Some SIZE_xxx code indicating what type of
00254 *                             size operation this is.
00255 * int  cx, cy               - New x and y size of the window's client area.
00256 *
00257 * Get the new client rect into grcTWnd.
00258 * Destroy and recreate the font scaled to show the time at the correct size.
00259 * Force the time to fully repaint.
00260 *
00261 *****************************************************************************/
00262 VOID NEAR PASCAL TWnd_OnSize(
00263     HWND                    hWnd,
00264     UINT                    state,
00265     int                     cx,
00266     int                     cy)
00267 {
00268     HDC                     hDC;
00269
00270     GetClientRect(hWnd, &grcTWnd);
00271
00272     if (ghFont != (HFONT)NULL)
00273         DeleteObject(ghFont);
00274
00275     hDC = GetDC(hWnd);
00276     ghFont = CreateScaledFont(hDC,
00277                               &grcTWnd,
00278                               (gnTimeFormat == IDS_TICKS) ? gszFormatTicks : gszFormatHMS,
00279                               ganPosX,
00280                               &gnPosY);
00281     ReleaseDC(hWnd, hDC);
00282
00283     gbRepaint = TRUE;
00284     InvalidateRect(hWnd, NULL, TRUE);
00285 }
00286
00287
00288 /*****************************************************************************
00289 *
00290 * TWnd_OnPaint
00291 *
00292 * Handle WM_PAINT message to time window.
00293 *
00294 * HWND hWnd                 - Window handle
00295 *
00296 * Repaint the 3D inset borders around the edge of the client area.
00297 * Repaint the time.
00298 *
00299 *****************************************************************************/
00300 VOID NEAR PASCAL TWnd_OnPaint( HWND hWnd) { PAINTSTRUCT ps; HDC hDC;
00301 HBRUSH hBrOld; int nWidth; int nHeight;
00302
00303     RECT                    rc;
00304
00305     GetClientRect(hWnd, &rc);
00306     nWidth  = rc.right;
00307     nHeight = rc.bottom;
00308
00309     hDC = BeginPaint(hWnd, &ps);
00310
00311     hBrOld = (HBRUSH)SelectObject(hDC, GetStockObject(GRAY_BRUSH));
00312     PatBlt(hDC, 0, 0, 1, nHeight-1, PATCOPY);
00313     PatBlt(hDC, 1, 0, nWidth-2, 1, PATCOPY);
00314
00315     SelectObject(hDC, GetStockObject(BLACK_BRUSH));
00316     PatBlt(hDC, 1, 1, 1, nHeight-3, PATCOPY);
00317     PatBlt(hDC, 2, 1, nWidth-4, 1, PATCOPY);
00318
00319     SelectObject(hDC, GetStockObject(WHITE_BRUSH));
00320     PatBlt(hDC, rc.right-1, 0, 1, nHeight-1, PATCOPY);
00321     PatBlt(hDC, 0, rc.bottom-1, nWidth, 1, PATCOPY);
00322
00323     SelectObject(hDC, GetStockObject(LTGRAY_BRUSH));
00324     PatBlt(hDC, rc.right-2, 1, 1, nHeight-2, PATCOPY);
00325     PatBlt(hDC, 1, rc.bottom-2, nWidth-2, 1, PATCOPY);
00326
00327     SelectObject(hDC, hBrOld);
00328
00329     gbRepaint = TRUE;
00330     PaintTime(hDC);
00331
00332     EndPaint(hWnd, &ps);
00333 }
00334
00335 /*****************************************************************************
00336 *
00337 * TWnd_OnCommand
00338 *
00339 * Handle WM_COMMAND message to the time window.
00340 *
00341 * HWND hWnd                 - Window handle
00342 * int id                    - id of control or menu causing WM_COMMAND
00343 * HWND hwndCtl              - Window handle of child control, if any
00344 * UINT codeNotify           - Notification code if this message is from a
00345 *                             control.
00346 *
00347 * We will receive IDM_PLAY and IDM_STOP messages forwarded from the main
00348 * application window whenver playback starts or stops. Use these messages
00349 * to create or kill a timer which will be used to update the time.
00350 *
00351 *****************************************************************************/
00352 VOID NEAR PASCAL TWnd_OnCommand(
00353     HWND                    hWnd,
00354     int                     id,
00355     HWND                    hWndCtl,
00356     UINT                    codeNotify)
00357 {
00358     switch(id)
00359     {
00360         case IDM_PLAY:
00361             if (0 == gnTimerOn)
00362             {
00363                 gnTimerOn++;
00364                 SetTimer(hWnd, TIMER_ID, TIMER_INTERVAL, 0);
00365             }
00366
00367             UpdateWindow(hWnd);
00368             break;
00369
00370         case IDM_STOP:
00371             if (0 == gnTimerOn)
00372             {
00373                 gnTimerOn--;
00374                 KillTimer(hWnd, TIMER_ID);
00375             }
00376
00377             UpdateWindow(hWnd);
00378             break;
00379     }
00380 }
00381
00382 /*****************************************************************************
00383 *
00384 * TWnd_OnDestroy
00385 *
00386 * Handle WM_DESTROY message to the time window.
00387 *
00388 * HWND hWnd                 - Window handle
00389 *
00390 * If we're being destroyed and the timer is still running, stop it.
00391 *
00392 *****************************************************************************/
00393 VOID NEAR PASCAL TWnd_OnDestroy(
00394     HWND                    hWnd)
00395 {
00396     if (gnTimerOn)
00397     {
00398         KillTimer(hWnd, TIMER_ID);
00399     }
00400 }
00401
00402 /*****************************************************************************
00403 *
00404 * TWnd_OnTimer
00405 *
00406 * Handle WM_TIMER message to the time window.
00407 *
00408 * HWND hWnd                 - Window handle
00409 * UINT id                   - Timer ID
00410 *
00411 * Update the time.
00412 *
00413 *****************************************************************************/
00414 PRIVATE VOID NEAR PASCAL TWnd_OnTimer(
00415     HWND                    hWnd,
00416     UINT                    id)
00417 {
00418     HDC                     hDC;
00419
00420     hDC = GetDC(hWnd);
00421     PaintTime(hDC);
00422     ReleaseDC(hWnd, hDC);
00423 }
00424
00425 /*****************************************************************************
00426 *
00427 * TWnd_WndProc
00428 *
00429 * Window procedure for main application window.
00430 *
00431 * HWND hWnd                 - Window handle
00432 * UINT msg                  - Message code
00433 * WPARAM wParam             - Message specific parameter
00434 * LPARAM lParam             - Message specific parameter
00435 *
00436 * Dispatch messages we care about to the appropriate handler, else just
00437 * call DefWindowProc.
00438 *
00439 * Note this use of message cracker macros from windowsx.h. Using these
00440 * macros will shield you from the differences between Win16 and Win32;
00441 * if your app is cross-compilable, you should use these and save yourself
00442 * some headaches!
00443 *
00444 *****************************************************************************/
00445 LRESULT CALLBACK TWnd_WndProc(
00446     HWND                    hWnd,
00447     UINT                    msg,
00448     WPARAM                  wParam,
00449     LPARAM                  lParam)
00450 {
00451     switch( msg )
00452     {
00453         HANDLE_MSG(hWnd, WM_CREATE,         TWnd_OnCreate);
00454         HANDLE_MSG(hWnd, WM_SIZE,           TWnd_OnSize);
00455         HANDLE_MSG(hWnd, WM_PAINT,          TWnd_OnPaint);
00456         HANDLE_MSG(hWnd, WM_COMMAND,        TWnd_OnCommand);
00457         HANDLE_MSG(hWnd, WM_DESTROY,        TWnd_OnDestroy);
00458         HANDLE_MSG(hWnd, WM_TIMER,          TWnd_OnTimer);
00459
00460         default:
00461             return DefWindowProc(hWnd, msg, wParam, lParam);
00462     }
00463
00464     return 0;
00465 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/BitmapWnd.h Source File

  • Multimedia
  • wia
  • GetImage

BitmapWnd.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #ifndef __BITMAPWND__
00008 #define __BITMAPWND__
00009
00010 //////////////////////////////////////////////////////////////////////////
00011 //
00012 // CBitmapWnd
00013 //
00014
00015 /*++
00016
00017     CBitmapWnd is an MDI child window that displays a bitmap using GDI+.
00018     It is descended from IUnknown for reference counting.
00019
00020 Methods
00021
00022     Register
00023         Registers the window class
00024
00025     WindowProc
00026         Processes window messages.
00027
00028     OnPaint
00029         Centers and displays the image using GDI+ functions.
00030
00031 --*/
00032
00033 class CBitmapWnd : public IUnknown
00034 {
00035 public:
00036     CBitmapWnd(IStream *pStream);
00037     CBitmapWnd(PCWSTR pszFileName);
00038
00039     // IUnknown interface
00040
00041     STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppvObj);
00042     STDMETHOD_(ULONG, AddRef)();
00043     STDMETHOD_(ULONG, Release)();
00044
00045     // CBitmapWnd Methods
00046
00047     static ATOM Register();
00048
00049 private:
00050     static LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM);
00051
00052     LRESULT OnPaint(HWND hWnd);
00053
00054 private:
00055     LONG           m_cRef;
00056     HGLOBAL        m_hBitmap;
00057     Gdiplus::Image m_Image;
00058 };
00059
00060 //////////////////////////////////////////////////////////////////////////
00061 //
00062 // CGdiplusInit
00063 //
00064
00065 /*++
00066
00067     CGdiplusInit is a wrapper class that automatically initializes and
00068     shuts down the GDI+ library. GDI+ initialization is necessary for
00069     any program that uses GDI+ functions.
00070
00071 Methods
00072
00073     CGdiplusInit
00074         Initializes the GDI+ library.
00075
00076     ~CGdiplusInit
00077         Shuts down the GDI+ library.
00078
00079 --*/
00080
00081 class CGdiplusInit : public Gdiplus::GdiplusStartupOutput
00082 {
00083 public:
00084     CGdiplusInit(
00085         Gdiplus::DebugEventProc debugEventCallback       = 0,
00086         BOOL                    suppressBackgroundThread = FALSE,
00087         BOOL                    suppressExternalCodecs   = FALSE
00088     )
00089     {
00090         Gdiplus::GdiplusStartupInput StartupInput(
00091             debugEventCallback,
00092             suppressBackgroundThread,
00093             suppressExternalCodecs
00094         );
00095
00096         StartupStatus = Gdiplus::GdiplusStartup(
00097             &Token,
00098             &StartupInput,
00099             this
00100         );
00101     }
00102
00103     ~CGdiplusInit()
00104     {
00105         if (StartupStatus == Gdiplus::Ok)
00106         {
00107             Gdiplus::GdiplusShutdown(Token);
00108         }
00109     }
00110
00111 private:
00112     Gdiplus::Status StartupStatus;
00113     ULONG_PTR       Token;
00114 };
00115
00116 #endif //__BITMAPWND__
00117
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CObject Member List

This is the complete list of members for CObject, including all inherited members.
CObject() | CObject | [inline]
CObject() | CObject | [inline]
mcRef | CObject | [private]
QueryInterface(REFIID iid, void **ppv) | CObject | [private]
QueryInterface(REFIID iid, void **ppv) | CObject | [private]
STDMETHODIMP_(ULONG) AddRef(void) | CObject | [inline, private]
STDMETHODIMP_(ULONG) Release(void) | CObject | [private]
STDMETHODIMP_(ULONG) AddRef(void) | CObject | [inline, private]
STDMETHODIMP_(ULONG) Release(void) | CObject | [private]
Generated on Wed Nov 13 2024 16:56:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/SetDisp/SetDisp.c Source File

  • Multimedia
  • Gdi
  • SetDisp

SetDisp.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \******************************************************************************/
00010 /******************************************************************************\
00011 *
00012 *   Implementation file for SetDisp
00013 *
00014 *   SetDisp creates a tray Notification Icon
00015 *   that you can use to dynamically change your srceen
00016 *   resolution. The core APIs used are:
00017 *
00018 *   Shell_NotifyIcon -- to create and maintain the tray icon
00019 *   TrackPopupMenu   -- to implement the icon resolution
00020 *                       context menu
00021 *   ChangeDisplaySettings -- to test and set the display
00022 *                       settings dynamically and to update
00023 *                       the registry with these setttings
00024 *   EnumDisplaySettings -- to get the display settings that are
00025 *                       supported by the video driver
00026 *
00027 *   KNOWN ISSUES:  On Windows 95 one cannot use the EnunDisplaySettings
00028 *   to get the current settings.  This causes the check mark to not
00029 *   be displayed and the current setting to not be bolded.  This
00030 *   information could be obtained from the registry. Also on Windows 95
00031 *   color depth changes require a reboot.  None of the possible returns
00032 *   from ChangeDisplaySettings are currently handled execpt for
00033 *   success and a message is displayed indicated the sample does not
00034 *   support a reboot. If your driver has many resolutions, the menu
00035 *   may not fit on some resolutions.  This could be resolved with
00036 *   the use of sub menus for different settings such as color depth
00037 *   or frequencies.
00038 *
00039 \******************************************************************************/
00040
00041 #if DBG
00042
00043 #define TRC(_x) OutputDebugString(TEXT(_x))
00044
00045 #else
00046
00047 #define TRC(_x)
00048
00049 #endif
00050
00051 #include "setdisp.h"
00052 #include <windowsx.h>
00053 #include <winuser.h>
00054 #include <shellapi.h>
00055 #include <stdio.h>
00056 #include <stdlib.h>
00057 #include "resource.h"
00058
00059
00060 /**************************************************************\
00061 *                                                              *
00062 *  Tray Icon Structure taken from Win32\TrayNot sample         *
00063 *                                                              *
00064 \**************************************************************/
00065
00066 struct _DLGITEMS
00067 {
00068   DWORD dwStart;
00069   UINT uNotify;
00070   UINT uDelayID;
00071   UINT uState1;
00072   UINT uTip1;
00073   UINT uState2;
00074   UINT uTip2;
00075 } g_sDlgItems [] =
00076
00077 //
00078 // Data for one tray icon
00079 //
00080
00081 {
00082   {
00083     0, IDC_NOTIFY1, IDC_DELAY1, IDC_STATE11, IDC_TIP11, IDC_STATE12, IDC_TIP12,
00084   },
00085 } ;
00086
00087
00088  /****************************************************************************
00089  *
00090  *  FUNCTION   : WinMain (HINSTANCE hInstance,  HINSTANCE hPrevInstance,
00091  *                        LPSTR lpCmdLine, int nCmdShow )
00092  *
00093  *  PURPOSE    : Creates a dialog box which implements the tray icon
00094  *               and which handles the resolution changes
00095  *
00096  \****************************************************************************/
00097
00098 int WINAPI WinMain (
00099
00100   HINSTANCE hInstance,
00101   HINSTANCE hPrevInstance,
00102   LPSTR lpCmdLine,
00103   int nCmdShow )
00104 {
00105
00106     g_hinst = hInstance;
00107
00108   DialogBox(hInstance, MAKEINTRESOURCE(IDD_SETDISP), (HWND)NULL, SetDispDlgProc);
00109
00110     if (gpDevModes)
00111     {
00112         free(gpDevModes);
00113     }
00114
00115     return(FALSE);
00116
00117 }
00118
00119  /****************************************************************************
00120  *
00121  *  FUNCTION   : SetDispDlgProc (HWND hDlg, UINT uMsg,
00122  *                                WPARAM wParam, LPARAM lParam)
00123  *
00124  *  PURPOSE    : Dialog box callback which manages the tray icon
00125  *               and which handles the resolution changes
00126  *
00127  \****************************************************************************/
00128
00129 INT_PTR CALLBACK SetDispDlgProc (
00130
00131    HWND hDlg,
00132    UINT uMsg,
00133    WPARAM wParam,
00134    LPARAM lParam)
00135 {
00136
00137     switch (uMsg)
00138     {
00139
00140     case WM_INITDIALOG:
00141     {
00142   BOOL bRet;
00143
00144   //
00145   //Get DEVMODES
00146   //
00147
00148   bRet = GetDevModes (hDlg);
00149
00150         if (bRet == FALSE)
00151         {
00152             //
00153             // Failed to get DEVMODES so end the dialog
00154             //
00155
00156       EndDialog(hDlg, TRUE);
00157
00158       break;
00159         }
00160
00161   //
00162   // Initialize Menu with Resolutions
00163   //
00164
00165   SetResolutionMenu (hDlg);
00166
00167   //
00168   // Add Tray Notify Icon
00169   //
00170
00171   NotifyAdd(hDlg, 0);
00172
00173   //
00174   // Update Tip to current settings
00175   //
00176   {
00177
00178       char szTip[50];
00179         memset(szTip, 0, 50);
00180
00181       //
00182       // Set the menu text
00183       //
00184
00185       if (IsNT())
00186             {
00187                 _snprintf(szTip, sizeof(szTip) - 1,
00188                           "%d x %d, %d bit color at %d hz",
00189                           gpCurrentMode->dmPelsWidth,
00190                           gpCurrentMode->dmPelsHeight,
00191                           gpCurrentMode->dmBitsPerPel,
00192                           gpCurrentMode->dmDisplayFrequency);
00193             }
00194             else
00195             {
00196                 szTip[0] = '\0';
00197             }
00198
00199       //
00200       // For the current mode, set the tool tip
00201         //
00202
00203       TrayMessage(hDlg, NIM_MODIFY, g_sDlgItems[0].uNotify,
00204                         LoadImage(g_hinst, MAKEINTRESOURCE(IDI_SETDISP),
00205                         IMAGE_ICON, 16, 16, 0), szTip);
00206   }
00207
00208   SetForegroundWindow (hDlg);
00209
00210   break;
00211
00212     } // WM_INITDIALOG:
00213
00214     case WM_DESTROY:  NotifyDelete(hDlg, 0);
00215       break;
00216
00217     case WM_COMMAND:
00218     {
00219   switch (GET_WM_COMMAND_ID(wParam, lParam))
00220   {
00221       case IDCANCEL:   EndDialog(hDlg, TRUE);
00222            break;
00223
00224       case IDABORT:    ShowWindow(hDlg, SW_HIDE);
00225            break;
00226
00227       case IDM_ABOUT:
00228       DialogBox(g_hinst, MAKEINTRESOURCE(IDD_ABOUT),
00229           hDlg, (DLGPROC)About);
00230       break;
00231
00232       default:
00233
00234       //
00235       // handle MYWM_NOTIFYICON + 10 + i for diffent devmodes
00236       //
00237
00238             if ( MYWM_NOTIFYICON + 10  <= GET_WM_COMMAND_ID(wParam, lParam) &&
00239      MYWM_NOTIFYICON + 11 + gnModes >= GET_WM_COMMAND_ID(wParam, lParam))
00240       {
00241     UINT nNewMode;
00242
00243                 nNewMode = GET_WM_COMMAND_ID(wParam, lParam) - (MYWM_NOTIFYICON + 10);
00244
00245     //
00246     // Only update if they chose a new setting
00247     //
00248
00249                 if (gnCurrentMode != nNewMode)
00250                 {
00251        ChangeResolution (nNewMode, hDlg);
00252     }
00253
00254     break;
00255
00256             }
00257
00258
00259   } //WM_COMMAN switch
00260
00261     } //WM_COMMAND
00262
00263     case MYWM_NOTIFYICON:
00264     {
00265   switch (lParam)
00266   {
00267
00268       case WM_LBUTTONDOWN:
00269
00270      //
00271      // Handle popup here when user right mouse clicks tray icon
00272      //
00273      {
00274
00275          //
00276          // Handle popup here
00277          //
00278
00279          POINT point;
00280
00281          GetCursorPos (&point);
00282
00283          HandlePopupMenu (hDlg, point);
00284
00285          break;
00286
00287      }
00288
00289
00290       case WM_RBUTTONDOWN:
00291      switch (wParam)
00292      {
00293
00294         //
00295         // Diplay the dialog box on Left mouse click
00296         // this is how the user gets the dialog back if it is hidden
00297         //
00298
00299         case IDC_NOTIFY1:  ShowWindow (hDlg, SW_RESTORE);
00300                SetForegroundWindow (hDlg);
00301                break;
00302
00303         default:
00304        break;
00305
00306       }
00307
00308
00309       default:
00310      break;
00311
00312   }  // lParam switch
00313
00314     }// MYWM_NOTIFYICON
00315
00316     default:
00317    return(FALSE);
00318
00319     }  // switch (uMsg)
00320
00321     return(TRUE);
00322
00323 }
00324
00325 /****************************************************************************
00326 *
00327 *  FUNCTION   : GetDevModes (hwnd)
00328 *
00329 *  PURPOSE    : Get the display modes supported by the current driver
00330 *
00331 \****************************************************************************/
00332 BOOL GetDevModes (
00333
00334   HWND hwnd)
00335 {
00336
00337     BOOL bRet = TRUE;
00338     BOOL bAddDM;
00339     UINT iModeNum = 0;
00340     DEVMODE CurrentDM, WorkingDM;
00341     INT i, structSize;
00342     UINT nlist;
00343     LPDEVMODE pDM;
00344
00345     //
00346     // setting param 1 to NULL (lpszDeviceName) uses current device on NT
00347     // and NULL is required on Win95
00348     //
00349
00350     if (IsNT())
00351     {
00352   //
00353   // NT specific; returns current devmode when param 2 set to ENUM_CURRENT_SETTINGS,
00354   //
00355
00356   EnumDisplaySettings (NULL, ENUM_CURRENT_SETTINGS, &CurrentDM);
00357     }
00358
00359     //
00360     // Determine how much memory we need
00361     //
00362
00363     for (iModeNum = 0, gnModes = -1;
00364          bRet && (gnModes <= MAX_MODES);
00365          iModeNum++)
00366     {
00367         bRet = EnumDisplaySettings
00368                      (NULL,            // use default device
00369                      iModeNum,         // DEVMODEs start at 0
00370                      &WorkingDM);      // if successful the system
00371                                        // fills in the DEVMODE
00372                                        // structure
00373
00374         //
00375         // For some reason my driver supports 1 hz display frequency
00376         // So filter out settings we do not want to display
00377         //
00378
00379         if ( bRet &&
00380        WorkingDM.dmPelsWidth    >= MIN_WIDTH &&
00381             (WorkingDM.dmDisplayFrequency >= MIN_FREQUENCY  ||
00382        WorkingDM.dmDisplayFrequency == 0) )
00383
00384       //
00385       // Accept 0 frequency since windows 95 does return frequency
00386       //
00387         {
00388             //
00389             // Increment to use next DEVMODE
00390             //
00391
00392             gnModes++;
00393   }
00394
00395     } // for loop
00396
00397     if(-1 == gnModes)
00398     {
00399         MessageBox(hwnd, "No Display modes available.", "SetDisp Error", IDOK);
00400         return (FALSE);
00401     }
00402
00403     //
00404     // We need gnModes worth of DEVMODE Structures
00405   // Check to make sure the system dmSize is not larger
00406   // than the size of DEVMODE at compile time.  If it is
00407   // and we do not do this check we will overwrite memory.
00408     //
00409
00410     structSize = (sizeof(DEVMODE) >= (int) WorkingDM.dmSize ?
00411     sizeof(DEVMODE) : (int) WorkingDM.dmSize);
00412
00413     gpDevModes = (PDEVMODE) malloc ((size_t) (gnModes + 1) * structSize);
00414
00415     if (gpDevModes == NULL)
00416     {
00417         return (FALSE);
00418     }
00419
00420     //
00421     // Loop through EnumDisplaySetting to get each supported DEVMODE
00422     // When returns false we have them all
00423     //
00424
00425     for (iModeNum = 0, i = 0, bRet = TRUE;
00426          bRet && i <= gnModes;
00427          iModeNum++)
00428     {
00429         bRet = EnumDisplaySettings
00430                      (NULL,            // use default device
00431                      iModeNum,         // DEVMODEs start at 0
00432                      &WorkingDM);      // if successful the system
00433                                        // fills in the DEVMODE
00434                                        // structure
00435
00436         //
00437         // Miniport drivers support 1 hz display frequency representing the default
00438         // and older drivers support 0 hz display frequency representing the default
00439         // So filter out settings we do not want to display
00440         //
00441
00442         if ( bRet &&
00443              WorkingDM.dmPelsWidth        >= MIN_WIDTH      &&
00444             (WorkingDM.dmDisplayFrequency >= MIN_FREQUENCY  ||
00445              WorkingDM.dmDisplayFrequency == 0              ||
00446              WorkingDM.dmDisplayFrequency == 1))
00447              // Accept 0 or 1 frequency which represent default frequencies
00448         {
00449             bAddDM = TRUE;
00450
00451             //
00452             // We will take this one unless another default has already been
00453             // added at these settings
00454             //
00455
00456             if (WorkingDM.dmDisplayFrequency == 0 ||
00457                 WorkingDM.dmDisplayFrequency == 1)
00458             {
00459                 for (nlist = 0; nlist <= gnCurrentMode; nlist++)
00460                 {
00461                       pDM = gpDevModes + nlist;
00462
00463                       if (pDM->dmPelsWidth  == WorkingDM.dmPelsWidth   &&
00464                           pDM->dmPelsHeight == WorkingDM.dmPelsHeight  &&
00465                           pDM->dmBitsPerPel == WorkingDM.dmBitsPerPel)
00466                       {
00467                           //
00468                           // If everything else is the same do not add another default
00469                           //
00470
00471                           bAddDM = FALSE;
00472                       }
00473                 } // end for nlist
00474
00475             } // end if default
00476
00477             if (bAddDM)
00478             {
00479                 //
00480                 // Increment to use next DEVMODE
00481         // Note: ChangeDisplaySettings required dmSize to be
00482         // set to structSize, so we set that here
00483                 //
00484
00485                 if (i == 0)
00486                 {
00487                     gpCurrentMode = gpDevModes;
00488           gpCurrentMode->dmSize = (WORD)structSize;
00489                 }
00490                 else
00491                 {
00492                     gpCurrentMode += 1;
00493           gpCurrentMode->dmSize = (WORD)structSize;
00494                 }
00495
00496                 EnumDisplaySettings (NULL, iModeNum, gpCurrentMode);
00497                 i++;
00498
00499             } // end if bAddDM
00500
00501         } // end bRet and hz if
00502
00503     } // end for EnumDisplaySettings
00504
00505
00506     //
00507     // Sort the array for display; default sort
00508     // A different compare routine could sort by different attributes
00509     //
00510
00511     qsort((void *) gpDevModes,
00512           (size_t) gnModes + 1,  // add one since gnModes is zero based
00513           (size_t) structSize,
00514           ( int (_cdecl*)(const void*,const void*) )CompareDevModes);
00515
00516     //
00517     // Set gCurrentMode to CurrentDM
00518     //
00519     if (IsNT())
00520     {
00521         for (i =0; i <= gnModes; i++)
00522         {
00523
00524             if (i == 0)
00525             {
00526                 gpCurrentMode = gpDevModes;
00527             }
00528             else
00529             {
00530                 gpCurrentMode += 1;
00531             }
00532
00533             if (0 == CompareDevModes (&CurrentDM, gpCurrentMode))
00534             {
00535                 gnCurrentMode = i;
00536                 break;
00537             }
00538         }
00539     }
00540     else
00541     {
00542         //
00543         // Default to the first one
00544         // since we error out if there is not even this one
00545         //
00546
00547         gnCurrentMode = 0;
00548     }
00549
00550     //
00551     // TODO: What if some of the DEVMODES are not supported on
00552     //       the physical Device?
00553     //
00554
00555     return (TRUE);
00556
00557 }  //GetDevModes scope
00558
00559
00560 /****************************************************************************
00561 *
00562 *  FUNCTION   : ChangeResolution (UINT nNewMode, HWND hwnd)
00563 *
00564 *  PURPOSE    : Change the resolution to the nNewMode index DEVMODE
00565 *
00566 \****************************************************************************/
00567 BOOL ChangeResolution (
00568     UINT nNewMode,
00569     HWND hwnd )
00570 {
00571
00572     LONG lResult;       //Result of ChangeDisplaySettings
00573     INT_PTR nUserResponse;  //Return from VerifyRes Dlg
00574     UINT nOldMode;
00575
00576    /*
00577     ChangeDisplaySettings can set
00578   dmBitsPerPel      Bits per pixel
00579   dmPelsWidth     Pixel width
00580   dmPelsHeight      Pixel height
00581   dmDisplayFlags      Mode flags
00582   dmDisplayFrequency  Mode frequency
00583
00584         but one of these must be set in the DEVMODE dmFields
00585         DM_BITSPERPEL     Use the dmBitsPerPel value.
00586         DM_PELSWIDTH      Use the dmPelsWidth value.
00587         DM_PELSHEIGHT     Use the dmPelsHeight value.
00588         DM_DISPLAYFLAGS     Use the dmDisplayFlags value.
00589   DM_DISPLAYFREQENCY  Use the dmDisplayFrequency value.
00590
00591     dmSize must be set to the size, in bytes, of the DEVMODE structure.
00592
00593     */
00594
00595     //
00596     // First select a DevMode to use
00597     // to start, just cycling through them
00598     //
00599
00600     nOldMode = gnCurrentMode;
00601     gnCurrentMode = nNewMode;
00602
00603     //
00604     // Increment ptr to the new mode
00605     //
00606
00607     gpCurrentMode = gpDevModes;
00608     gpCurrentMode += nNewMode;
00609
00610     //
00611     // Verify that the DEVMODE select will change something
00612     //
00613
00614     if (!(DM_BITSPERPEL      & gpCurrentMode->dmFields ||
00615           DM_PELSWIDTH       & gpCurrentMode->dmFields ||
00616           DM_PELSHEIGHT      & gpCurrentMode->dmFields ||
00617           DM_DISPLAYFLAGS  & gpCurrentMode->dmFields ||
00618           DM_DISPLAYFREQUENCY & gpCurrentMode->dmFields ) )
00619
00620     {
00621
00622   //
00623         // Note our DEVMODE returned from EnumDisplaySettings
00624   // So we should never enter here
00625   //
00626
00627         gnCurrentMode = nOldMode;
00628
00629         gpCurrentMode = gpDevModes;
00630         gpCurrentMode += gnCurrentMode;
00631
00632         return (FALSE);
00633     }
00634
00635
00636     /************************************************************\
00637     *                                                            *
00638     *   Possible Flags for param 2 of ChangeDisplay Settings     *
00639     *    0          The graphics mode for the current            *
00640     *                screen will be changed dynamically.         *
00641     *    CDS_UPDATEREGISTRY The graphics mode for the            *
00642     *                current screen will be changed dynamically  *
00643     *                and the graphics mode will be updated in    *
00644     *                the registry. The mode information is       *
00645     *                stored in the USER profile.                 *
00646     *    CDS_TEST The system tests if the requested            *
00647     *                graphics mode could be set.                 *
00648     *                                                            *
00649     \************************************************************/
00650
00651     //
00652     // First have the system test if we can set it
00653     //
00654
00655     //
00656     // Param 1 is the new DEVMODE
00657     // Param 2 is Test Flag,
00658     // which asks the operating system if this is a valid setting
00659     // to change to -- wedon't want to make the system unusable
00660     //
00661
00662   // Note: ChangeDisplaySettings required dmSize to be
00663   // set to structSize, so we set that here
00664
00665     lResult = ChangeDisplaySettings
00666                 ( gpCurrentMode,
00667                   CDS_TEST );
00668
00669
00670     if (lResult == DISP_CHANGE_RESTART)
00671     {
00672         MessageBox(hwnd, "This mode requires a reboot which\n"  \
00673                          "is not supported in this sample.",
00674        "SetDisp Message", IDOK);
00675
00676         gnCurrentMode = nOldMode;
00677         gpCurrentMode = gpDevModes;
00678         gpCurrentMode += gnCurrentMode;
00679
00680         return FALSE;
00681     }
00682
00683     if (DISP_CHANGE_SUCCESSFUL ==lResult)
00684     {
00685
00686    //
00687    // Param 2 is 0 to change dynamically
00688    // hence the app name SetDisp!
00689    //
00690
00691   // Note: ChangeDisplaySettings required dmSize to be
00692   // set to structSize, so we set that here
00693
00694          lResult = ChangeDisplaySettings
00695                      ( gpCurrentMode,
00696                        0 );
00697     }
00698
00699
00700
00701     switch (lResult)
00702     {
00703
00704     case DISP_CHANGE_SUCCESSFUL:  //The settings change was successful.
00705    TRC("DISP_CHANGE_SUCCESSFUL\n");
00706    break;
00707
00708     case DISP_CHANGE_RESTART:   //The computer must be restarted in order
00709                                   //  for the graphics mode to work.
00710          TRC("DISP_CHANGE_RESTART\n");
00711          break;
00712
00713     case DISP_CHANGE_BADFLAGS:    //An invalid set of flags was passed in.
00714          TRC("DISP_CHANGE_BADFLAGS\n");
00715          break;
00716
00717     case DISP_CHANGE_FAILED:    //The display driver failed the specified
00718                                   //  graphics mode.
00719          TRC("DISP_CHANGE_FAILED\n");
00720          break;
00721
00722     case DISP_CHANGE_BADMODE:   //The graphics mode is not supported.
00723          TRC("DISP_CHANGE_BADMODE\n");
00724          break;
00725
00726     case DISP_CHANGE_NOTUPDATED:  //Windows NT only: Unable to write settings
00727                                   //  to the registry.
00728          TRC("DISP_CHANGE_NOTUPDATED\n");
00729          break;
00730     default:
00731    TRC("Undocumented return value!!!!\n");
00732    break;
00733     }
00734
00735
00736     //
00737     // Set a timer to only give the user so much
00738     // time to dedice incase the screen is garbled
00739     //
00740
00741     SetTimer(hwnd,  VERIFY_RESCHANGE, VERIFY_TIMEOUT, VerifyTimerProc);
00742
00743     //
00744     // Have the user verify the new resolution and depth
00745     //
00746
00747     nUserResponse = DialogBox(g_hinst,// handle this application
00748                               MAKEINTRESOURCE(IDD_VERIFYRES),// identifies dialog box template
00749                               NULL,               // handle to owner window
00750                               VerifyDlgProc);  // the dialog box procedure
00751
00752
00753     //
00754     // The verification is over, kill the timer
00755     //
00756
00757     KillTimer(hwnd, VERIFY_RESCHANGE);
00758
00759     if (IDYES == nUserResponse)
00760     {
00761
00762   //
00763   // Keep resolution and update registry
00764   //
00765
00766         char szTip[50];
00767         memset(szTip, 0, 50);
00768
00769   //
00770   // TODO: give them three choices:
00771         //       Dynamic only, Registry too, or Abort
00772   //
00773
00774   // Note: ChangeDisplaySettings required dmSize to be
00775   // set to structSize, so we set that here
00776
00777         lResult = ChangeDisplaySettings
00778                     ( gpCurrentMode,
00779                       CDS_UPDATEREGISTRY );  //  Flag to update registry
00780
00781         switch (lResult)
00782
00783         {
00784
00785         case DISP_CHANGE_SUCCESSFUL:
00786
00787       //
00788       // The settings change was successful.
00789       //
00790
00791             TRC("DISP_CHANGE_SUCCESSFUL - reg\n");
00792
00793             _snprintf(szTip, sizeof(szTip) - 1,
00794                  "%d x %d, %d bit color at %d hz",
00795                  gpCurrentMode->dmPelsWidth,
00796                  gpCurrentMode->dmPelsHeight,
00797                  gpCurrentMode->dmBitsPerPel,
00798                  gpCurrentMode->dmDisplayFrequency);
00799
00800              {
00801
00802      //
00803      // Update the Menu informtion, just a check mark for now
00804      //
00805
00806                  HMENU hMenu, hMenu2;
00807
00808                  hMenu = GetMenu(hwnd);
00809
00810                  hMenu2 = GetSubMenu (hMenu, 0);
00811
00812      //
00813      // Uncheck the old
00814      //
00815
00816                  CheckMenuItem (hMenu2, nOldMode, MF_BYPOSITION | MF_UNCHECKED);
00817
00818      //
00819      // Check the new
00820      //
00821
00822      CheckMenuItem (hMenu2, gnCurrentMode, MF_BYPOSITION | MF_CHECKED);
00823
00824              }
00825
00826        //
00827        // Update the Notify_Icon quick tip
00828        //
00829
00830              TrayMessage(hwnd, NIM_MODIFY, g_sDlgItems[0].uNotify,
00831                     LoadImage(g_hinst, MAKEINTRESOURCE(IDI_SETDISP),
00832                     IMAGE_ICON, 16, 16, 0), szTip);
00833
00834              break;
00835
00836         case DISP_CHANGE_RESTART:   //The computer must be restarted in order
00837                                       //  for the graphics mode to work.
00838              TRC("DISP_CHANGE_RESTART - reg\n");
00839              break;
00840
00841         case DISP_CHANGE_BADFLAGS:    //An invalid set of flags was passed in.
00842              TRC("DISP_CHANGE_BADFLAGS - reg\n");
00843              break;
00844
00845         case DISP_CHANGE_FAILED:    //The display driver failed the specified
00846                                       //  graphics mode.
00847              TRC("DISP_CHANGE_FAILED - reg\n");
00848              break;
00849
00850         case DISP_CHANGE_BADMODE:   //The graphics mode is not supported.
00851              TRC("DISP_CHANGE_BADMODE - reg\n");
00852              break;
00853
00854         case DISP_CHANGE_NOTUPDATED:  //Windows NT only: Unable to write settings
00855                                       //  to the registry.
00856              TRC("DISP_CHANGE_NOTUPDATED - reg\n");
00857              break;
00858         default:
00859               TRC("Undocumented return value!!!! - reg\n");
00860               break;
00861         }
00862
00863     }
00864
00865     else
00866
00867     {
00868   //
00869   // The user chose to not keep the setting or  we timed out
00870         // so they may not have seen the dialog box to choose
00871         //
00872         // Change resolution back by calling
00873         // ChangeDisplaySettings
00874         // with a NULL DEVMODE which returns us to the current
00875         // registry settings
00876   //
00877
00878   // Note: ChangeDisplaySettings required dmSize to be
00879   // set to structSize, so we set that here
00880
00881         lResult = ChangeDisplaySettings
00882                     ( NULL,
00883                       0 );  // 0 to change dynamically
00884
00885         gnCurrentMode = nOldMode;
00886
00887         gpCurrentMode = gpDevModes;
00888         gpCurrentMode += gnCurrentMode;
00889
00890     }
00891
00892     return (TRUE);
00893
00894 }
00895
00896
00897  /****************************************************************************
00898  *
00899  *  FUNCTION   : SetResolutionMenu (hwnd)
00900  *
00901  *  PURPOSE    : Create a context menu with all of the resolutions
00902  *               that are in the devmodes we obtained from the drive
00903  *
00904  \****************************************************************************/
00905 BOOL SetResolutionMenu (
00906     HWND hwnd)
00907 {
00908
00909     HMENU hMenu, hWndMenu; //hMenuTrackPopup;
00910     INT i;
00911     BOOL bRet=FALSE;
00912     PDEVMODE pDevMode = gpDevModes;
00913
00914     //
00915     // Create new Resolutions menu from the DevModes collected
00916     //
00917
00918     hMenu = CreateMenu();
00919
00920     if (!hMenu)
00921     {
00922        return (FALSE);
00923     }
00924
00925     //
00926     // For each devmode add an menu item
00927     // TODO: make the description on BitPerPel better
00928     //
00929
00930     for(i=0; i<= gnModes; i++)
00931     {
00932
00933         char szRes[50];
00934         memset(szRes, 0, 50);
00935
00936         if (i == 0)
00937         {
00938             pDevMode = gpDevModes;
00939         }
00940         else
00941         {
00942             pDevMode += 1;
00943   }
00944
00945         //
00946   // Set the menu text
00947   //
00948
00949         if (pDevMode->dmDisplayFrequency == 0 ||
00950             pDevMode->dmDisplayFrequency == 1)
00951   {
00952         _snprintf(szRes, sizeof(szRes) - 1,
00953                  "%d x %d, %d bit color, default frequency",
00954                  pDevMode->dmPelsWidth,
00955                  pDevMode->dmPelsHeight,
00956                  pDevMode->dmBitsPerPel);
00957   }
00958   else
00959   {
00960         _snprintf(szRes, sizeof(szRes) - 1,
00961                  "%d x %d, %d bit color at %d hz",
00962                  pDevMode->dmPelsWidth,
00963                  pDevMode->dmPelsHeight,
00964                  pDevMode->dmBitsPerPel,
00965                  pDevMode->dmDisplayFrequency);
00966   }
00967
00968         bRet = AppendMenu (hMenu, MF_STRING, MYWM_NOTIFYICON + 10 + i, szRes);
00969
00970         SetMenuItemBitmaps(
00971       hMenu,   // handle of menu
00972       gnCurrentMode, // menu item to receive new bitmaps
00973                   MF_BYPOSITION, // menu item flags
00974                   NULL,          // handle of unchecked bitmap
00975       NULL);   // handle of checked bitmap
00976                                  // if last two are NULL the default
00977                                  // bitmap is used
00978
00979
00980     } // for loop to set menu
00981
00982     if (!bRet)
00983     {
00984
00985         //
00986         // if the last one worked they all likely worked
00987         // otherwise let's clean up
00988         //
00989
00990         DestroyMenu(hMenu);
00991
00992         return(FALSE);
00993
00994     }
00995     else
00996     {
00997
00998         if (IsNT())
00999         {
01000             //
01001             // Check the Current one
01002             //
01003
01004             CheckMenuItem (hMenu, gnCurrentMode, MF_BYPOSITION | MF_CHECKED);
01005
01006             //
01007             // Set it as the default so it is easy to go back to
01008             //
01009
01010       SetMenuDefaultItem(hMenu, gnCurrentMode, TRUE ); //TRUE if for by Position
01011
01012         }
01013
01014         hWndMenu = GetMenu (hwnd);
01015
01016         InsertMenu (hWndMenu, 0, MF_POPUP|MF_BYPOSITION, (DWORD_PTR)hMenu, "&Resolutions");
01017
01018         return(TRUE);
01019
01020     }
01021
01022 }
01023
01024
01025  /****************************************************************************
01026  *
01027  *  FUNCTION   : TrayMessage (HWND hDlg, DWORD dwMessage, UINT uID,
01028  *                            HICON hIcon, PSTR pszTip )
01029  *
01030  *  PURPOSE    : Creates, Modifies or deletes the tray icon
01031  *               If pszTip is not null, it uses that for the tip
01032  *               otherwise it sets a default tip
01033  *
01034  \****************************************************************************/
01035
01036 BOOL TrayMessage (
01037
01038   HWND hDlg,
01039   DWORD dwMessage,
01040   UINT uID,
01041   HICON hIcon,
01042   PSTR pszTip )
01043
01044 {
01045     BOOL res;
01046     NOTIFYICONDATA tnd;
01047
01048     //
01049     // Get the Tray Icon
01050     //
01051
01052     hIcon = (HICON)LoadImage(g_hinst, MAKEINTRESOURCE(IDI_SETDISP), IMAGE_ICON,
01053            16, 16, 0);
01054
01055     tnd.cbSize    = sizeof(NOTIFYICONDATA);
01056     tnd.hWnd    = hDlg;
01057     tnd.uID   = uID;
01058     tnd.uFlags    = NIF_MESSAGE|NIF_ICON|NIF_TIP;
01059     tnd.uCallbackMessage= MYWM_NOTIFYICON;
01060     tnd.hIcon   = hIcon;
01061
01062     //
01063     // If there is a specific tip, set it
01064     // otherwise use SetDisp as the default
01065     //
01066
01067     memset(tnd.szTip, 0, sizeof(tnd.szTip));
01068     if (pszTip)
01069     {
01070   lstrcpyn(tnd.szTip, pszTip, sizeof(tnd.szTip));
01071     }
01072     else
01073     {
01074   lstrcpyn(tnd.szTip, "SetDisp", sizeof("SetDisp"));;
01075     }
01076
01077
01078     //
01079     //  Use the Shell_NotifyIcon API to setup the tray icon
01080     //
01081
01082     res = Shell_NotifyIcon(dwMessage, &tnd);
01083
01084     if (hIcon)
01085     {
01086    DestroyIcon(hIcon);
01087     }
01088
01089
01090     return res;
01091
01092 }
01093
01094
01095  /****************************************************************************
01096  *
01097  *  FUNCTION   : NotifyDelete (HWND hDlg, UINT uIndex)
01098  *
01099  *  PURPOSE    : Deletes a tray icon based on the uIndex .
01100  *               In this SetDisp sample, it is only used for a single icon
01101  *
01102  \****************************************************************************/
01103
01104 void NotifyDelete (
01105
01106   HWND hDlg,
01107   UINT uIndex )
01108
01109 {
01110
01111     TrayMessage(hDlg, NIM_DELETE, g_sDlgItems[uIndex].uNotify, NULL, NULL);
01112
01113 }
01114
01115
01116  /****************************************************************************
01117  *
01118  *  FUNCTION   : NotifyAdd (HWND hDlg, UINT uIndex)
01119  *
01120  *  PURPOSE    : Creates tray icons based on the uIndex .
01121  *               In this SetDisp sample, it is only used for a single icon
01122  *
01123  \****************************************************************************/
01124
01125 void NotifyAdd (
01126
01127   HWND hDlg,
01128   UINT uIndex )
01129
01130 {
01131
01132     TrayMessage(hDlg, NIM_ADD, g_sDlgItems[uIndex].uNotify, NULL, NULL);
01133
01134 }
01135
01136
01137  /****************************************************************************
01138  *
01139  *  FUNCTION   : VerifyTimerProc (HWND hwnd, UINT uMsg,
01140  *                                UINT_PTR idEvent, DWORD dwTime )
01141  *
01142  *  PURPOSE    : Simply sends an IDNO to the Verify Dialog
01143  *               This is setup to give the user a limited amount of time
01144  *               to approve
01145  *
01146  \****************************************************************************/
01147
01148 VOID CALLBACK VerifyTimerProc (
01149
01150   HWND hwnd,
01151   UINT uMsg,
01152   UINT_PTR idEvent,
01153   DWORD dwTime )
01154 {
01155
01156     SendMessage(ghVerifyDlg, WM_COMMAND, IDNO, 0);
01157
01158 }
01159
01160  /****************************************************************************
01161  *
01162  *  FUNCTION   : VerifyDlgProc (HWND hDlg, UINT uMsg,
01163  *                                WPARAM wParam, LPARAM lParam)
01164  *
01165  *
01166  *  PURPOSE    : Ask the user if they want to keep the new resolution
01167  *
01168  \****************************************************************************/
01169
01170 INT_PTR CALLBACK VerifyDlgProc(
01171     HWND hDlg,
01172     UINT uMsg,
01173     WPARAM wParam,
01174     LPARAM lParam)
01175 {
01176     switch(uMsg)
01177     {
01178   case WM_INITDIALOG: ghVerifyDlg = hDlg;
01179         return(TRUE);
01180
01181   case WM_COMMAND:
01182
01183        //
01184        // LOWORD added for portability
01185        //
01186
01187        switch (LOWORD(wParam))
01188        {
01189
01190      case IDNO:
01191      case IDCANCEL: ghVerifyDlg = NULL;
01192         EndDialog(hDlg, IDNO);
01193         return 0;
01194
01195
01196      case IDYES:  ghVerifyDlg = NULL;
01197         EndDialog(hDlg, IDYES);
01198         return 0;
01199         }
01200
01201   default:
01202        break;
01203
01204     }
01205
01206     return(FALSE);
01207
01208     UNREFERENCED_PARAMETER(lParam);
01209
01210 }
01211
01212 /****************************************************************************
01213  *                                                                          *
01214  *  FUNCTION   : HandlePopupMenu (hwnd, point)                              *
01215  *                                                                          *
01216  *  PURPOSE    : Handles the display of the "floating" popup that appears   *
01217  *               on a mouse click in the app's client area.                 *
01218  *                                                                          *
01219  ****************************************************************************/
01220
01221 VOID APIENTRY HandlePopupMenu (
01222     HWND  hwnd,
01223     POINT point)
01224 {
01225
01226     HMENU hMenu;
01227     HMENU hMenuTrackPopup;
01228
01229     //
01230     // Get the menu for the windows
01231     //
01232
01233     hMenu = GetMenu(hwnd);
01234
01235     if (!hMenu)
01236     {
01237   return;
01238     }
01239
01240     //
01241     // Get the first menu in it which we will use for the call to
01242     // TrackPopup(). This could also have been created on the fly using
01243     // CreatePopupMenu and then we could have used InsertMenu() or
01244     // AppendMenu.
01245     //
01246
01247     hMenuTrackPopup = GetSubMenu (hMenu, 0);
01248
01249     //
01250     // Draw and track the "floating" popup
01251     //
01252
01253     if (point.x < (long) (gpCurrentMode->dmPelsWidth - 50))
01254         point.x = (long) (gpCurrentMode->dmPelsWidth - 50);
01255
01256     if (point.y < (long) (gpCurrentMode->dmPelsHeight - 50))
01257         point.y = (long) (gpCurrentMode->dmPelsHeight - 50);
01258
01259
01260     //
01261     // This is required when using a notify icon -- see KB article
01262     // PRB: Menus for Notification Icons Don't Work Correctly
01263     //
01264
01265     SetForegroundWindow (hwnd);
01266
01267     TrackPopupMenu (hMenuTrackPopup, TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
01268                     point.x, point.y, 0, hwnd, NULL);
01269
01270     //
01271     // This is required when using a notify icon -- see KB article
01272     // PRB: Menus for Notification Icons Don't Work Correctly
01273     //
01274
01275     PostMessage (hwnd, WM_USER, 0, 0);
01276
01277 }
01278
01279
01280 /****************************************************************************\
01281 *
01282 *  FUNCTION   : CompareDevModes (DEVMODE *leftDM, DEVMODE *rightDM)
01283 *
01284 *  PURPOSE    : Handles the display of the "floating" popup that appears
01285 *               on a mouse click in the app's client area.
01286 *
01287 \****************************************************************************/
01288 int CompareDevModes (
01289
01290     DEVMODE *leftDM,
01291     DEVMODE *rightDM)
01292 {
01293
01294     //
01295     // Return 1  if left is bigger
01296     //        0  if equal
01297     //        -1 if right is bigger
01298     //
01299     // Comparison order is Width then Height then Bits then Frequency
01300     // This is an arbitrary order of importance. Often BitPerPels is
01301     // on considered the most important measure of a display setting
01302     //
01303     // return on the first one that is larger between left and right
01304     //
01305
01306     if (leftDM->dmPelsWidth  > rightDM->dmPelsWidth)
01307     {
01308         return 1;
01309     }
01310     else if (leftDM->dmPelsWidth  < rightDM->dmPelsWidth)
01311     {
01312         return -1;
01313     }
01314
01315
01316     if (leftDM->dmPelsHeight > rightDM->dmPelsHeight)
01317     {
01318         return 1;
01319     }
01320     else if (leftDM->dmPelsHeight < rightDM->dmPelsHeight)
01321     {
01322         return -1;
01323     }
01324
01325
01326     if (leftDM->dmBitsPerPel > rightDM->dmBitsPerPel)
01327     {
01328         return 1;
01329     }
01330     else if (leftDM->dmBitsPerPel < rightDM->dmBitsPerPel)
01331     {
01332         return -1;
01333     }
01334
01335
01336     if (leftDM->dmDisplayFrequency > rightDM->dmDisplayFrequency)
01337     {
01338         return 1;
01339     }
01340     else if (leftDM->dmDisplayFrequency < rightDM->dmDisplayFrequency)
01341     {
01342         return -1;
01343     }
01344
01345     //
01346     // All are equal
01347     //
01348
01349     return 0;
01350
01351 }
01352
01353 /****************************************************************************\
01354 *
01355 *  FUNCTION: About(HWND, UINT, UINT, LONG)
01356 *
01357 *  PURPOSE:  Processes messages for the "About" dialog box
01358 *
01359 \****************************************************************************/
01360 BOOL APIENTRY About(
01361     HWND hDlg,
01362     UINT message,
01363     WPARAM wParam,
01364     LPARAM lParam)
01365 {
01366   switch (message)
01367   {
01368      case WM_INITDIALOG:
01369       return TRUE;
01370
01371      case WM_COMMAND:
01372      if (LOWORD(wParam) == IDOK)
01373      {
01374         EndDialog(hDlg, TRUE);
01375         return TRUE;
01376      }
01377
01378      break;
01379
01380      default:
01381
01382     return FALSE;
01383
01384   }
01385
01386   return FALSE;
01387 }
01388
01389 BOOL IsNT()
01390 {
01391     OSVERSIONINFO          osvi;
01392
01393     osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
01394
01395     GetVersionEx(&osvi);
01396
01397     if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
01398     {
01399         return TRUE;
01400     }
01401     else
01402     {
01403         return FALSE;
01404     }
01405 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAgentCtlPropertySheet Member List

This is the complete list of members for CAgentCtlPropertySheet, including all inherited members.
CAgentCtlPropertySheet() | CAgentCtlPropertySheet | [inline]
CAgentCtlPropertySheet(LPDISPATCH pDispatch) | CAgentCtlPropertySheet | [inline]
CAgentCtlPropertySheet(const CAgentCtlPropertySheet &dispatchSrc) | CAgentCtlPropertySheet | [inline]
GetHeight() | CAgentCtlPropertySheet |
GetLeft() | CAgentCtlPropertySheet |
GetPage() | CAgentCtlPropertySheet |
GetTop() | CAgentCtlPropertySheet |
GetVisible() | CAgentCtlPropertySheet |
GetWidth() | CAgentCtlPropertySheet |
SetPage(LPCTSTR lpszNewValue) | CAgentCtlPropertySheet |
SetVisible(BOOL bNewValue) | CAgentCtlPropertySheet |
Generated on Wed Nov 13 2024 16:55:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Props Member List

This is the complete list of members for Props, including all inherited members.
alignment | Props
backcolour | Props
box | Props
forecolour | Props
forecolourws | Props
height | Props
hFont | Props
valid | Props
width | Props
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/error.cpp Source File

  • Dataaccess
  • oledb
  • tablecopy

error.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module ERROR.CPP
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011 ////////////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 ////////////////////////////////////////////////////////////////////////
00015 #include "WinMain.h"
00016 #include "Error.h"
00017
00018 #include <olectl.h>   // IConnectionPoints interface
00019
00020
00021 ////////////////////////////////////////////////////////////////////////
00022 // Defines
00023 //
00024 ////////////////////////////////////////////////////////////////////////
00025
00026 //Displays values like VALUE as   VALUE , L"VALUE"
00027 #define VALUE_WCHAR(value) value, L#value
00028
00029
00030 typedef struct _INTERFACEMAP
00031 {
00032   const IID*  pIID;       // The sql type value
00033   WCHAR*    pwszInterface;    // Name for display
00034 } INTERFACEMAP;
00035
00036
00037 INTERFACEMAP rgInterfaceMap[] =
00038 {
00039   //IUnknown
00040     & VALUE_WCHAR(IID_IUnknown),
00041
00042   //TEnumerator
00043     & VALUE_WCHAR(IID_IParseDisplayName),
00044     & VALUE_WCHAR(IID_ISourcesRowset),
00045
00046   //TDataSource
00047     & VALUE_WCHAR(IID_IDBInitialize),
00048     & VALUE_WCHAR(IID_IDBProperties),
00049     & VALUE_WCHAR(IID_IDBCreateSession),
00050     & VALUE_WCHAR(IID_IDBInfo),
00051     & VALUE_WCHAR(IID_IPersist),
00052     & VALUE_WCHAR(IID_IDBDataSourceAdmin),
00053     & VALUE_WCHAR(IID_IPersistFile),
00054     & VALUE_WCHAR(IID_ISupportErrorInfo),
00055
00056   //TSession
00057     & VALUE_WCHAR(IID_IGetDataSource),
00058     & VALUE_WCHAR(IID_IOpenRowset),
00059     & VALUE_WCHAR(IID_ISessionProperties),
00060     & VALUE_WCHAR(IID_IDBCreateCommand),
00061     & VALUE_WCHAR(IID_IDBSchemaRowset),
00062     & VALUE_WCHAR(IID_IIndexDefinition),
00063     & VALUE_WCHAR(IID_ITableDefinition),
00064     & VALUE_WCHAR(IID_ITransactionJoin),
00065     & VALUE_WCHAR(IID_ITransactionLocal),
00066     & VALUE_WCHAR(IID_ITransactionObject),
00067
00068   //TCommand
00069     & VALUE_WCHAR(IID_IAccessor),
00070     & VALUE_WCHAR(IID_IColumnsInfo),
00071     & VALUE_WCHAR(IID_ICommand),
00072     & VALUE_WCHAR(IID_ICommandProperties),
00073     & VALUE_WCHAR(IID_ICommandText),
00074     & VALUE_WCHAR(IID_IConvertType),
00075     & VALUE_WCHAR(IID_IColumnsRowset),
00076     & VALUE_WCHAR(IID_ICommandPrepare),
00077     & VALUE_WCHAR(IID_ICommandWithParameters),
00078
00079   //TRowset
00080     & VALUE_WCHAR(IID_IRowset),
00081     & VALUE_WCHAR(IID_IRowsetInfo),
00082     & VALUE_WCHAR(IID_IColumnsRowset),
00083     & VALUE_WCHAR(IID_IConnectionPointContainer),
00084     & VALUE_WCHAR(IID_IRowsetChange),
00085     & VALUE_WCHAR(IID_IRowsetIdentity),
00086     & VALUE_WCHAR(IID_IRowsetLocate),
00087     & VALUE_WCHAR(IID_IRowsetResynch),
00088     & VALUE_WCHAR(IID_IRowsetScroll),
00089     & VALUE_WCHAR(IID_IRowsetUpdate),
00090
00091   //TIndex
00092     & VALUE_WCHAR(IID_IRowsetIndex),
00093
00094   //TError
00095     & VALUE_WCHAR(IID_IErrorInfo),
00096     & VALUE_WCHAR(IID_IErrorRecords),
00097     & VALUE_WCHAR(IID_ISQLErrorInfo),
00098 };
00099
00100
00101 ////////////////////////////////////////////////////////////////////////
00102 // ERRORMAP
00103 //
00104 ////////////////////////////////////////////////////////////////////////
00105 typedef struct _ERRORMAP
00106 {
00107   HRESULT   hr;     // HRESULT
00108   WCHAR*    pwszError;  // Name
00109 } ERRORMAP;
00110
00111 ERRORMAP rgErrorMap[] =
00112 {
00113    VALUE_WCHAR(NULL),
00114
00115    //System Errors
00116    VALUE_WCHAR(E_FAIL),
00117    VALUE_WCHAR(E_INVALIDARG),
00118    VALUE_WCHAR(E_OUTOFMEMORY),
00119    VALUE_WCHAR(E_NOINTERFACE),
00120    VALUE_WCHAR(REGDB_E_CLASSNOTREG),
00121    VALUE_WCHAR(CLASS_E_NOAGGREGATION),
00122      VALUE_WCHAR(E_UNEXPECTED),
00123      VALUE_WCHAR(E_NOTIMPL),
00124      VALUE_WCHAR(E_POINTER),
00125      VALUE_WCHAR(E_HANDLE),
00126      VALUE_WCHAR(E_ABORT),
00127      VALUE_WCHAR(E_ACCESSDENIED),
00128      VALUE_WCHAR(E_PENDING),
00129
00130    //OLE DB Errors
00131      VALUE_WCHAR(DB_E_BADACCESSORHANDLE),
00132      VALUE_WCHAR(DB_E_ROWLIMITEXCEEDED),
00133      VALUE_WCHAR(DB_E_READONLYACCESSOR),
00134      VALUE_WCHAR(DB_E_SCHEMAVIOLATION),
00135      VALUE_WCHAR(DB_E_BADROWHANDLE),
00136      VALUE_WCHAR(DB_E_OBJECTOPEN),
00137      VALUE_WCHAR(DB_E_CANTCONVERTVALUE),
00138      VALUE_WCHAR(DB_E_BADBINDINFO),
00139      VALUE_WCHAR(DB_SEC_E_PERMISSIONDENIED),
00140      VALUE_WCHAR(DB_E_NOTAREFERENCECOLUMN),
00141      VALUE_WCHAR(DB_E_NOCOMMAND),
00142      VALUE_WCHAR(DB_E_BADBOOKMARK),
00143      VALUE_WCHAR(DB_E_BADLOCKMODE),
00144      VALUE_WCHAR(DB_E_PARAMNOTOPTIONAL),
00145      VALUE_WCHAR(DB_E_BADCOLUMNID),
00146      VALUE_WCHAR(DB_E_BADRATIO),
00147      VALUE_WCHAR(DB_E_ERRORSINCOMMAND),
00148      VALUE_WCHAR(DB_E_CANTCANCEL),
00149      VALUE_WCHAR(DB_E_DIALECTNOTSUPPORTED),
00150      VALUE_WCHAR(DB_E_DUPLICATEDATASOURCE),
00151      VALUE_WCHAR(DB_E_CANNOTRESTART),
00152      VALUE_WCHAR(DB_E_NOTFOUND),
00153      VALUE_WCHAR(DB_E_NEWLYINSERTED),
00154      VALUE_WCHAR(DB_E_UNSUPPORTEDCONVERSION),
00155      VALUE_WCHAR(DB_E_BADSTARTPOSITION),
00156      VALUE_WCHAR(DB_E_NOTREENTRANT),
00157      VALUE_WCHAR(DB_E_ERRORSOCCURRED),
00158      VALUE_WCHAR(DB_E_NOAGGREGATION),
00159      VALUE_WCHAR(DB_E_DELETEDROW),
00160      VALUE_WCHAR(DB_E_CANTFETCHBACKWARDS),
00161      VALUE_WCHAR(DB_E_ROWSNOTRELEASED),
00162      VALUE_WCHAR(DB_E_BADSTORAGEFLAG),
00163      VALUE_WCHAR(DB_E_BADSTATUSVALUE),
00164      VALUE_WCHAR(DB_E_CANTSCROLLBACKWARDS),
00165      VALUE_WCHAR(DB_E_MULTIPLESTATEMENTS),
00166      VALUE_WCHAR(DB_E_INTEGRITYVIOLATION),
00167      VALUE_WCHAR(DB_E_ABORTLIMITREACHED),
00168      VALUE_WCHAR(DB_E_DUPLICATEINDEXID),
00169      VALUE_WCHAR(DB_E_NOINDEX),
00170      VALUE_WCHAR(DB_E_INDEXINUSE),
00171      VALUE_WCHAR(DB_E_NOTABLE),
00172      VALUE_WCHAR(DB_E_CONCURRENCYVIOLATION),
00173      VALUE_WCHAR(DB_E_BADCOPY),
00174      VALUE_WCHAR(DB_E_BADPRECISION),
00175      VALUE_WCHAR(DB_E_BADSCALE),
00176      VALUE_WCHAR(DB_E_BADID),
00177      VALUE_WCHAR(DB_E_BADTYPE),
00178      VALUE_WCHAR(DB_E_DUPLICATECOLUMNID),
00179      VALUE_WCHAR(DB_E_DUPLICATETABLEID),
00180      VALUE_WCHAR(DB_E_TABLEINUSE),
00181      VALUE_WCHAR(DB_E_NOLOCALE),
00182      VALUE_WCHAR(DB_E_BADRECORDNUM),
00183      VALUE_WCHAR(DB_E_BOOKMARKSKIPPED),
00184      VALUE_WCHAR(DB_E_BADPROPERTYVALUE),
00185      VALUE_WCHAR(DB_E_INVALID),
00186      VALUE_WCHAR(DB_E_BADACCESSORFLAGS),
00187      VALUE_WCHAR(DB_E_BADSTORAGEFLAGS),
00188      VALUE_WCHAR(DB_E_BYREFACCESSORNOTSUPPORTED),
00189      VALUE_WCHAR(DB_E_NULLACCESSORNOTSUPPORTED),
00190      VALUE_WCHAR(DB_E_NOTPREPARED),
00191      VALUE_WCHAR(DB_E_BADACCESSORTYPE),
00192      VALUE_WCHAR(DB_E_WRITEONLYACCESSOR),
00193      VALUE_WCHAR(DB_SEC_E_AUTH_FAILED),
00194      VALUE_WCHAR(DB_E_CANCELED),
00195      VALUE_WCHAR(DB_E_BADSOURCEHANDLE),
00196      VALUE_WCHAR(DB_E_PARAMUNAVAILABLE),
00197      VALUE_WCHAR(DB_E_ALREADYINITIALIZED),
00198      VALUE_WCHAR(DB_E_NOTSUPPORTED),
00199      VALUE_WCHAR(DB_E_MAXPENDCHANGESEXCEEDED),
00200      VALUE_WCHAR(DB_E_BADORDINAL),
00201      VALUE_WCHAR(DB_E_PENDINGCHANGES),
00202      VALUE_WCHAR(DB_E_DATAOVERFLOW),
00203      VALUE_WCHAR(DB_E_BADHRESULT),
00204      VALUE_WCHAR(DB_E_BADLOOKUPID),
00205      VALUE_WCHAR(DB_E_BADDYNAMICERRORID),
00206      VALUE_WCHAR(DB_E_PENDINGINSERT),
00207      VALUE_WCHAR(DB_E_BADCONVERTFLAG),
00208      VALUE_WCHAR(DB_S_ROWLIMITEXCEEDED),
00209      VALUE_WCHAR(DB_S_COLUMNTYPEMISMATCH),
00210      VALUE_WCHAR(DB_S_TYPEINFOOVERRIDDEN),
00211      VALUE_WCHAR(DB_S_BOOKMARKSKIPPED),
00212      VALUE_WCHAR(DB_S_ENDOFROWSET),
00213      VALUE_WCHAR(DB_S_COMMANDREEXECUTED),
00214      VALUE_WCHAR(DB_S_BUFFERFULL),
00215      VALUE_WCHAR(DB_S_NORESULT),
00216      VALUE_WCHAR(DB_S_CANTRELEASE),
00217      VALUE_WCHAR(DB_S_DIALECTIGNORED),
00218      VALUE_WCHAR(DB_S_UNWANTEDPHASE),
00219      VALUE_WCHAR(DB_S_UNWANTEDREASON),
00220      VALUE_WCHAR(DB_S_COLUMNSCHANGED),
00221      VALUE_WCHAR(DB_S_ERRORSRETURNED),
00222      VALUE_WCHAR(DB_S_BADROWHANDLE),
00223      VALUE_WCHAR(DB_S_DELETEDROW),
00224      VALUE_WCHAR(DB_S_STOPLIMITREACHED),
00225      VALUE_WCHAR(DB_S_LOCKUPGRADED),
00226      VALUE_WCHAR(DB_S_PROPERTIESCHANGED),
00227      VALUE_WCHAR(DB_S_ERRORSOCCURRED),
00228      VALUE_WCHAR(DB_S_PARAMUNAVAILABLE),
00229      VALUE_WCHAR(DB_S_MULTIPLECHANGES),
00230 };
00231
00232
00233 ////////////////////////////////////////////////////////////////////////
00234 // WCHAR* GetErrorName
00235 //
00236 ////////////////////////////////////////////////////////////////////////
00237 WCHAR* GetErrorName(HRESULT hr)
00238 {
00239   for(ULONG i=0; i<NUMELE(rgErrorMap); i++)
00240   {
00241     if(hr == rgErrorMap[i].hr)
00242       return rgErrorMap[i].pwszError;
00243   }
00244
00245   //Otherwise just return Unknown
00246   return rgErrorMap[0].pwszError;
00247 }
00248
00249
00250 ////////////////////////////////////////////////////////////////////////
00251 // WCHAR* GetInterfaceName
00252 //
00253 ////////////////////////////////////////////////////////////////////////
00254 WCHAR* GetInterfaceName(REFIID riid)
00255 {
00256   for(ULONG i=0; i<NUMELE(rgInterfaceMap); i++)
00257   {
00258     if(riid == *(rgInterfaceMap[i].pIID))
00259       return rgInterfaceMap[i].pwszInterface;
00260   }
00261
00262   //Otherwise just return IUnknown
00263   return rgInterfaceMap[0].pwszInterface;
00264 }
00265
00266
00267 ////////////////////////////////////////////////////////////////////////
00268 // HRESULT GetErrorRecords
00269 //
00270 // Get the error message generated by an OLE DB object
00271 /////////////////////////////////////////////////////////////////////////////
00272 HRESULT GetErrorRecords(ULONG* pcRecords, IErrorRecords** ppIErrorRecords)
00273 {
00274   ASSERT(pcRecords && ppIErrorRecords);
00275   HRESULT hr;
00276
00277   //NULL output params
00278   *pcRecords = 0;
00279   *ppIErrorRecords = NULL;
00280
00281   ISupportErrorInfo* pISupportErrorInfo = NULL;
00282   IErrorInfo* pIErrorInfo = NULL;
00283
00284   //See if this interface supports ErrorInfo
00285   //If not there is no reason to display any error
00286   if((hr = GetErrorInfo(0, &pIErrorInfo))==S_OK && pIErrorInfo)
00287   {
00288     //IErrorRecords may not be supported on the existing error object.
00289     //Some other things could have posted an error object (VB) for example...
00290     QTESTC(hr = pIErrorInfo->QueryInterface(IID_IErrorRecords, (void**)ppIErrorRecords));
00291     XTESTC(hr = (*ppIErrorRecords)->GetRecordCount(pcRecords));
00292   }
00293
00294 CLEANUP:
00295   SAFE_RELEASE(pISupportErrorInfo);
00296   SAFE_RELEASE(pIErrorInfo);
00297   return hr;
00298 }
00299
00300
00301 ////////////////////////////////////////////////////////////////////////
00302 // HRESULT GetSqlErrorInfo
00303 //
00304 // Get the error message generated by an OLE DB object
00305 /////////////////////////////////////////////////////////////////////////////
00306 HRESULT GetSqlErrorInfo(ULONG iRecord, IErrorRecords* pIErrorRecords, BSTR* pBstr)
00307 {
00308   ASSERT(pBstr);
00309   HRESULT hr = S_OK;
00310
00311   ISQLErrorInfo* pISQLErrorInfo = NULL;
00312   LONG lNativeError = 0;
00313
00314   //Get the Error Records
00315   if(pIErrorRecords)
00316   {
00317     //If there is ErrorInfo, GetSQLInfo for the desired record
00318     //ISQLErrorInfo is not mandatory
00319     QTESTC(hr = pIErrorRecords->GetCustomErrorObject(iRecord, IID_ISQLErrorInfo, (IUnknown**)&pISQLErrorInfo));
00320
00321     //If there was a CustomErrorObject
00322     if(pISQLErrorInfo)
00323       hr = pISQLErrorInfo->GetSQLInfo(pBstr, &lNativeError);
00324   }
00325
00326 CLEANUP:
00327   SAFE_RELEASE(pISQLErrorInfo);
00328   return hr;
00329 }
00330
00331
00332 ////////////////////////////////////////////////////////////////////////
00333 // HRESULT DisplayAllErrors
00334 //
00335 /////////////////////////////////////////////////////////////////////////////
00336 HRESULT DisplayAllErrors(HWND hWnd, HRESULT Actualhr, WCHAR* pwszFile, ULONG ulLine)
00337 {
00338   HRESULT hr = S_OK;
00339
00340   ULONG cRecords = 0;
00341   IErrorRecords* pIErrorRecords = NULL;
00342
00343   //Try to display Extened ErrorInfo
00344   if((hr = GetErrorRecords(&cRecords, &pIErrorRecords))==S_OK)
00345   {
00346     hr = DisplayErrorRecords(hWnd, cRecords, pIErrorRecords, pwszFile, ulLine);
00347   }
00348   //If not available, display MSG Box with info
00349   else
00350   {
00351     //display the Error
00352     wMessageBox(hWnd, (hWnd ? MB_APPLMODAL : MB_TASKMODAL) | MB_ICONEXCLAMATION | MB_OK, wsz_ERRORINFO,
00353       L"Interface: %s\nResult: %x = %s\n\nIErrorInfo: %s\n\nFile: %s\nLine: %d", L"Unknown", Actualhr, GetErrorName(Actualhr), L"Error Object not available", pwszFile, ulLine);
00354   }
00355
00356
00357   SAFE_RELEASE(pIErrorRecords);
00358   return hr;
00359 }
00360
00361
00362 ////////////////////////////////////////////////////////////////////////
00363 // HRESULT DisplayErrorRecords
00364 //
00365 /////////////////////////////////////////////////////////////////////////////
00366 HRESULT DisplayErrorRecords(HWND hWnd, ULONG cRecords, IErrorRecords* pIErrorRecords, WCHAR* pwszFile, ULONG ulLine)
00367 {
00368   HRESULT hr = S_OK;
00369
00370   IErrorInfo* pIErrorInfo = NULL;
00371   BSTR bstrErrorInfo = NULL;
00372   BSTR bstrSQLInfo = NULL;
00373
00374   LCID lcid = GetSystemDefaultLCID();
00375
00376   //Get the Error Records
00377   if(cRecords && pIErrorRecords)
00378   {
00379     LONG lNativeError = 0;
00380     ERRORINFO ErrorInfo;
00381
00382     //Loop through the records
00383     for(ULONG i=0; i<cRecords; i++)
00384     {
00385       //GetErrorInfo
00386       XTESTC(hr = pIErrorRecords->GetErrorInfo(i,lcid,&pIErrorInfo));
00387
00388       //Get the Description
00389       XTESTC(hr = pIErrorInfo->GetDescription(&bstrErrorInfo));
00390
00391       //Get the Basic ErrorInfo
00392       XTESTC(hr = pIErrorRecords->GetBasicErrorInfo(i,&ErrorInfo));
00393
00394       //Get the SQL Info
00395       GetSqlErrorInfo(i, pIErrorRecords, &bstrSQLInfo);
00396
00397       //Display the Error
00398       if(bstrSQLInfo)
00399         wMessageBox(hWnd, (hWnd ? MB_APPLMODAL : MB_TASKMODAL) | MB_ICONEXCLAMATION | MB_OK, wsz_ERRORINFO, L"Interface: %s\nResult: %x = %s\n\nIErrorInfo: [%s] %s\n\nFile: %s\nLine: %d", GetInterfaceName(ErrorInfo.iid), ErrorInfo.hrError, GetErrorName(ErrorInfo.hrError), bstrSQLInfo, bstrErrorInfo, pwszFile, ulLine);
00400       else
00401         wMessageBox(hWnd, (hWnd ? MB_APPLMODAL : MB_TASKMODAL) | MB_ICONEXCLAMATION | MB_OK, wsz_ERRORINFO, L"Interface: %s\nResult: %x = %s\n\nIErrorInfo: %s\n\nFile: %s\nLine: %d", GetInterfaceName(ErrorInfo.iid), ErrorInfo.hrError, GetErrorName(ErrorInfo.hrError), bstrErrorInfo, pwszFile, ulLine);
00402
00403       SAFE_RELEASE(pIErrorInfo);
00404       SAFE_SYSFREE(bstrErrorInfo);
00405       SAFE_SYSFREE(bstrSQLInfo);
00406     }
00407   }
00408
00409
00410 CLEANUP:
00411   SAFE_RELEASE(pIErrorInfo);
00412   SAFE_SYSFREE(bstrErrorInfo);
00413   SAFE_SYSFREE(bstrSQLInfo);
00414   return hr;
00415 }
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cdatasource.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cdatasource.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CDATASOURCE.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 /////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 /////////////////////////////////////////////////////////////////
00019 // CDataSource::CDataSource
00020 //
00021 /////////////////////////////////////////////////////////////////
00022 CDataSource::CDataSource(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00023   : CPropertiesBase(eCDataSource, pCMainWindow, pCMDIChild)
00024 {
00025   //OLE DB Interfaces
00026   m_pIDBCreateSession     = NULL;   //DataSource interface
00027   m_pIPersist         = NULL;   //DataSource interface
00028
00029   m_pIDBDataSourceAdmin   = NULL;   //DataSource interface
00030   m_pIDBInfo          = NULL;   //DataSource interface
00031   m_pIPersistFile       = NULL;   //DataSource interface
00032
00033   //Services
00034   m_pIServiceProvider     = NULL;   //Service interface
00035
00036
00037   //Properties
00038   m_lDataSourceType     = DBPROPVAL_DST_TDP;
00039 }
00040
00041 /////////////////////////////////////////////////////////////////
00042 // CDataSource::~CDataSource
00043 //
00044 /////////////////////////////////////////////////////////////////
00045 CDataSource::~CDataSource()
00046 {
00047   ReleaseObject(0);
00048 }
00049
00050
00051 /////////////////////////////////////////////////////////////////
00052 // IUnknown** CDataSource::GetInterfaceAddress
00053 //
00054 /////////////////////////////////////////////////////////////////
00055 IUnknown** CDataSource::GetInterfaceAddress(REFIID riid)
00056 {
00057   HANDLE_GETINTERFACE(IDBCreateSession);
00058   HANDLE_GETINTERFACE(IPersist);
00059   HANDLE_GETINTERFACE(IDBDataSourceAdmin);
00060   HANDLE_GETINTERFACE(IDBInfo);
00061   HANDLE_GETINTERFACE(IPersistFile);
00062   HANDLE_GETINTERFACE(IServiceProvider);
00063
00064
00065   //Otherwise delegate
00066   return CPropertiesBase::GetInterfaceAddress(riid);
00067 }
00068
00069
00070 ////////////////////////////////////////////////////////////////
00071 // CDataSource::AutoRelease
00072 //
00073 /////////////////////////////////////////////////////////////////
00074 HRESULT CDataSource::AutoRelease()
00075 {
00076   //DataSource interfaces
00077   RELEASE_INTERFACE(IDBCreateSession);
00078   RELEASE_INTERFACE(IPersist);
00079
00080   RELEASE_INTERFACE(IDBDataSourceAdmin);
00081   RELEASE_INTERFACE(IDBInfo);
00082   RELEASE_INTERFACE(IPersistFile);
00083
00084   //Services
00085   RELEASE_INTERFACE(IServiceProvider);
00086
00087
00088   //Extra interfaces
00089
00090   //Properties
00091   m_cstrDataSource.Empty();
00092   m_cstrDBMS.Empty();
00093   m_cstrDBMSVer.Empty();
00094   m_cstrProviderName.Empty();
00095   m_cstrProviderDesc.Empty();
00096
00097   //Delegate
00098   return CPropertiesBase::AutoRelease();
00099 }
00100
00101
00102 /////////////////////////////////////////////////////////////////
00103 // HRESULT CDataSource::AutoQI
00104 //
00105 /////////////////////////////////////////////////////////////////
00106 HRESULT CDataSource::AutoQI(DWORD dwCreateOpts)
00107 {
00108   //Delegate First so we have base interfaces
00109   CPropertiesBase::AutoQI(dwCreateOpts);
00110
00111   //[MANDATORY]
00112   if(dwCreateOpts & CREATE_QI_MANDATORY)
00113   {
00114     OBTAIN_INTERFACE(IDBCreateSession);
00115     OBTAIN_INTERFACE(IPersist);
00116   }
00117
00118   //AutoQI
00119   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00120   {
00121     OBTAIN_INTERFACE(IDBDataSourceAdmin);
00122     OBTAIN_INTERFACE(IDBInfo);
00123     OBTAIN_INTERFACE(IPersistFile);
00124
00125     //Services
00126     OBTAIN_INTERFACE(IServiceProvider);
00127   }
00128
00129   //Are we intialized yet...
00130   if(m_pIDBProperties && (IsInitialized() || m_pIDBCreateSession))
00131   {
00132     //DBPROP_DATASOURCENAME
00133     GetProperty(IID_IDBProperties, m_pIDBProperties, DBPROP_DATASOURCENAME,     DBPROPSET_DATASOURCEINFO, DBTYPE_BSTR, &m_cstrDataSource);
00134     //DBPROP_DBMSNAME
00135     GetProperty(IID_IDBProperties, m_pIDBProperties, DBPROP_DBMSNAME,       DBPROPSET_DATASOURCEINFO, DBTYPE_BSTR, &m_cstrDBMS);
00136     //DBPROP_DBMSVER
00137     GetProperty(IID_IDBProperties, m_pIDBProperties, DBPROP_DBMSVER,        DBPROPSET_DATASOURCEINFO, DBTYPE_BSTR, &m_cstrDBMSVer);
00138     //DBPROP_PROVIDERFILENAME
00139     GetProperty(IID_IDBProperties, m_pIDBProperties, DBPROP_PROVIDERFILENAME,   DBPROPSET_DATASOURCEINFO, DBTYPE_BSTR, &m_cstrProviderName);
00140     //DBPROP_PROVIDERFRIENDLYNAME
00141     GetProperty(IID_IDBProperties, m_pIDBProperties, DBPROP_PROVIDERFRIENDLYNAME, DBPROPSET_DATASOURCEINFO, DBTYPE_BSTR, &m_cstrProviderDesc);
00142     //DBPROP_DATASOURCE_TYPE
00143     GetProperty(IID_IDBProperties, m_pIDBProperties, DBPROP_DATASOURCE_TYPE,    DBPROPSET_DATASOURCEINFO, DBTYPE_I4,   &m_lDataSourceType);
00144
00145     //Only set "Default" properties, if requested by the user
00146     if(GetOptions()->m_dwRowsetOpts & ROWSET_SETDEFAULTPROPS)
00147     {
00148       //Kagera has a problem with OPTIONAL properties, still treating
00149       //them as SETIFCHEAP and lets you know the NOTSET ones...
00150       //Instead of always getting DB_S_ERRORSOCCURRED just special case until fixed
00151       DBPROPOPTIONS dwPropOptions = DBPROPOPTIONS_OPTIONAL;
00152       if(m_cstrProviderName == L"MSDASQL.DLL")
00153         dwPropOptions = DBPROPOPTIONS_REQUIRED;
00154
00155       if(m_pCMDIChild)
00156       {
00157         CPropSets* pCPropSets = &m_pCMDIChild->m_CDefPropSets;
00158
00159         //We want to provide Scrolling Capabilites to the user (if supported)
00160         if(IsSettableProperty(m_pIDBProperties, DBPROP_CANSCROLLBACKWARDS, DBPROPSET_ROWSET))
00161           pCPropSets->SetProperty(DBPROP_CANSCROLLBACKWARDS, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00162         if(IsSettableProperty(m_pIDBProperties, DBPROP_CANFETCHBACKWARDS, DBPROPSET_ROWSET))
00163           pCPropSets->SetProperty(DBPROP_CANFETCHBACKWARDS, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00164
00165         //Allow the user to change data (if supported)
00166         if(IsSettableProperty(m_pIDBProperties, DBPROP_IRowsetChange, DBPROPSET_ROWSET))
00167           pCPropSets->SetProperty(DBPROP_IRowsetChange, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00168         if(IsSettableProperty(m_pIDBProperties, DBPROP_UPDATABILITY, DBPROPSET_ROWSET))
00169           pCPropSets->SetProperty(DBPROP_UPDATABILITY, DBPROPSET_ROWSET, DBTYPE_I4, (void*)(DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE), dwPropOptions);
00170
00171         //The table may contain BLOBs, and the Provider may require random positioning
00172         if(IsSettableProperty(m_pIDBProperties, DBPROP_ACCESSORDER, DBPROPSET_ROWSET))
00173           pCPropSets->SetProperty(DBPROP_ACCESSORDER, DBPROPSET_ROWSET, DBTYPE_I4, (void*)DBPROPVAL_AO_RANDOM, dwPropOptions);
00174
00175         //Notifications are very useful debugging info (if supported)
00176         if(IsSettableProperty(m_pIDBProperties, DBPROP_IConnectionPointContainer, DBPROPSET_ROWSET))
00177           pCPropSets->SetProperty(DBPROP_IConnectionPointContainer, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00178
00179         //DBPROP_ISequentialStream
00180         if(GetOptions()->m_dwAccessorOpts & ACCESSOR_BLOB_ISEQSTREAM &&
00181           IsSettableProperty(m_pIDBProperties, DBPROP_ISequentialStream, DBPROPSET_ROWSET))
00182           pCPropSets->SetProperty(DBPROP_ISequentialStream, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00183         //DBPROP_ILockBytes
00184         if(GetOptions()->m_dwAccessorOpts & ACCESSOR_BLOB_ILOCKBYTES &&
00185           IsSettableProperty(m_pIDBProperties, DBPROP_ILockBytes, DBPROPSET_ROWSET))
00186           pCPropSets->SetProperty(DBPROP_ILockBytes, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00187         //DBPROP_IStorage
00188         if(GetOptions()->m_dwAccessorOpts & ACCESSOR_BLOB_ISTORAGE &&
00189           IsSettableProperty(m_pIDBProperties, DBPROP_IStorage, DBPROPSET_ROWSET))
00190           pCPropSets->SetProperty(DBPROP_IStorage, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00191         //DBPROP_IStream
00192         if(GetOptions()->m_dwAccessorOpts & ACCESSOR_BLOB_ISTREAM &&
00193           IsSettableProperty(m_pIDBProperties, DBPROP_IStream, DBPROPSET_ROWSET))
00194           pCPropSets->SetProperty(DBPROP_IStream, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, dwPropOptions);
00195
00196         //DBPROP_UNIQUEROWS
00197         //If the user has requested to display Hidden Columns then we need to set UniqueRows
00198         //Since hidden columns are only returned if UniqueRows==TRUE...
00199         if(GetOptions()->m_dwRowsetOpts & ROWSET_HIDDENCOLUMNS &&
00200           IsSettableProperty(m_pIDBProperties, DBPROP_UNIQUEROWS, DBPROPSET_ROWSET))
00201           pCPropSets->SetProperty(DBPROP_UNIQUEROWS, DBPROPSET_ROWSET, DBTYPE_BOOL, (void*)VARIANT_TRUE, DBPROPOPTIONS_REQUIRED/*DBPROPOPTIONS_OPTIONAL*/);
00202       }
00203     }
00204
00205   }
00206
00207   return S_OK;
00208 }
00209
00210
00211 /////////////////////////////////////////////////////////////////////////////
00212 // CDataSource::GetObjectDesc
00213 //
00214 /////////////////////////////////////////////////////////////////////////////
00215 WCHAR* CDataSource::GetObjectDesc()
00216 {
00217   if(!m_strObjectDesc && m_pIPersist)
00218   {
00219     CLSID clsid;
00220     GetClassID(&clsid, &m_strObjectDesc);
00221   }
00222
00223   return m_strObjectDesc;
00224 }
00225
00226
00227 /////////////////////////////////////////////////////////////////
00228 // HRESULT CDataSource::CreateSession
00229 //
00230 /////////////////////////////////////////////////////////////////
00231 HRESULT CDataSource::CreateSession(CAggregate* pCAggregate, REFIID riid, IUnknown** ppIUnknown)
00232 {
00233   HRESULT       hr = S_OK;
00234
00235   if(m_pIDBCreateSession)
00236   {
00237     //CreateSession
00238     TEST(hr = m_pIDBCreateSession->CreateSession(pCAggregate, riid, ppIUnknown));
00239     TESTC(TRACE_METHOD(hr, L"IDBCreateSession::CreateSession(0x%p, %s, &0x%p)", pCAggregate, GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL));
00240
00241     //Handle Aggregation
00242     if(pCAggregate)
00243       TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00244   }
00245
00246 CLEANUP:
00247   return hr;
00248 }
00249
00250
00251
00252 /////////////////////////////////////////////////////////////////
00253 // HRESULT CDataSource::AdminCreateDataSource
00254 //
00255 /////////////////////////////////////////////////////////////////
00256 HRESULT CDataSource::AdminCreateDataSource(CAggregate* pCAggregate, ULONG cPropSets, DBPROPSET* rgPropSets, REFIID riid, IUnknown** ppIUnknown)
00257 {
00258   HRESULT hr = S_OK;
00259   DWORD dwCreateOpts = GetOptions()->m_dwCreateOpts;
00260
00261   if(m_pIDBDataSourceAdmin)
00262   {
00263     //IDBDataSourceAdmin::CreateDataSource
00264     XTEST(hr = m_pIDBDataSourceAdmin->CreateDataSource(cPropSets, rgPropSets, pCAggregate, riid, ppIUnknown));
00265     TRACE_METHOD(hr, L"IDBDataSourceAdmin::CreateDataSource(%d, 0x%p, 0x%p, %s, &0x%p)", cPropSets, rgPropSets, pCAggregate, GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL);
00266
00267     //Display any property errors...
00268     TESTC(hr = DisplayPropErrors(hr, cPropSets, rgPropSets));
00269
00270     //Handle Aggregation
00271     if(pCAggregate)
00272       pCAggregate->HandleAggregation(riid, ppIUnknown);
00273
00274     //We are now Initialized
00275     m_fInitialized = TRUE;
00276
00277     //Obtain all interfaces, now that we are initialized
00278     TESTC(hr = AutoQI(dwCreateOpts));
00279   }
00280
00281 CLEANUP:
00282   return hr;
00283 }
00284
00285
00286 ////////////////////////////////////////////////////////////////
00287 // CDataSource::GetClassID
00288 //
00289 /////////////////////////////////////////////////////////////////
00290 HRESULT CDataSource::GetClassID(CLSID* pclsid, WCHAR** ppwszProgID)
00291 {
00292   HRESULT hr = S_OK;
00293   WCHAR* pwszProgID = NULL;
00294
00295   if(!m_pIPersist)
00296     return E_FAIL;
00297
00298   //IPersist::GetClassID
00299   XTEST(hr = m_pIPersist->GetClassID(pclsid));
00300
00301   //Obtain ProgID
00302   if(pclsid)
00303     pwszProgID = GetProgID(*pclsid);
00304   TESTC(TRACE_METHOD(hr, L"IPersist::GetClassID(%s)", pwszProgID));
00305
00306 CLEANUP:
00307   if(ppwszProgID)
00308     *ppwszProgID = pwszProgID;
00309   else
00310     SAFE_FREE(pwszProgID);
00311   return hr;
00312 }
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
Generated on Wed Nov 13 2024 16:52:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Range/recvbuf.hpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Range

recvbuf.hpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 // ===========================================================================
00019 //                     RecvBuf utility class
00020 // ===========================================================================
00021 class RecvBuf
00022 {
00023     DWORD  m_cbBufSize; // size of buffer
00024     PBYTE  m_pbBufBeg;  // start of buffer
00025     PBYTE  m_pbBufEnd;  // end of buffer
00026
00027 public:
00028
00029     PBYTE  m_pbDataBeg; // start of data
00030     PBYTE  m_pbDataEnd; // end of data
00031
00032     RecvBuf()
00033     {
00034         m_pbBufBeg = NULL;
00035     }
00036
00037     ~RecvBuf()
00038     {
00039         if (m_pbBufBeg)
00040             LocalFree ((HLOCAL) m_pbBufBeg);
00041     }
00042
00043     PBYTE BufBeg(void)   { return m_pbBufBeg; }
00044     DWORD BufSpace(void) { return (DWORD)(m_pbBufEnd - m_pbDataEnd); }
00045     DWORD BufSize(void)  { return m_cbBufSize; }
00046
00047     void  BufReset(void)
00048     {
00049         m_pbDataBeg = m_pbBufBeg;
00050         m_pbDataEnd = m_pbBufBeg;
00051     }
00052
00053     void BufShift (void)
00054     {
00055         if (m_pbDataBeg > m_pbBufBeg)
00056         {
00057             // Shift the data to front of buffer.
00058             DWORD cbData = (DWORD)(m_pbDataEnd - m_pbDataBeg);
00059             MoveMemory (m_pbBufBeg, m_pbDataBeg, cbData);
00060             m_pbDataBeg  = m_pbBufBeg;
00061             m_pbDataEnd  = m_pbBufBeg + cbData;
00062         }
00063     }
00064
00065     BOOL BufAlloc (DWORD dwSize);
00066     BOOL BufScanStr (PSTR pszSearch, DWORD cbSearch);
00067     BOOL BufScanInt (DWORD *pdwRet, BYTE cDelimit);
00068 };
00069
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/DllMain.Cpp Source File

  • NetDS
  • SyncMgr
  • SyncDir

DllMain.Cpp

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #include "precomp.h"
00013
00014 // if writing own handler need to change CLSID value in guid.h
00015 EXTERN_C const GUID CLSID_SyncMgrHandler;
00016
00017 TCHAR szCLSIDDescription[] = TEXT("Sample Synchronization Manager Handler");
00018 WCHAR wszCLSIDDescription[] = L"Sample Synchronization Handler Handler";
00019
00020 //
00021 // Global variables
00022 //
00023
00024 UINT      g_cRefThisDll = 0;    // Reference count of this DLL.
00025 HINSTANCE g_hmodThisDll = NULL; // Handle to this DLL itself.
00026 CSettings *g_pSettings = NULL;  // ptr to global settings class.
00027
00028 //+---------------------------------------------------------------------------
00029 //
00030 //  Function:     DllMain, public
00031 //
00032 //  Synopsis:
00033 //
00034 //  Arguments:
00035 //
00036 //  Returns:
00037 //
00038 //  Modifies:
00039 //
00040 //----------------------------------------------------------------------------
00041
00042 extern "C" int APIENTRY
00043 DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00044 {
00045     if (dwReason == DLL_PROCESS_ATTACH)
00046     {
00047         // Extension DLL one-time initialization
00048         g_hmodThisDll = hInstance;
00049
00050         g_pSettings = new CSettings;
00051         if (NULL == g_pSettings)
00052         {
00053             return FALSE;
00054         }
00055
00056         //initialize the common controls for property sheets
00057     INITCOMMONCONTROLSEX controlsEx;
00058     controlsEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
00059     controlsEx.dwICC = ICC_USEREX_CLASSES | ICC_WIN95_CLASSES;
00060     InitCommonControlsEx(&controlsEx);
00061
00062     }
00063     else if (dwReason == DLL_PROCESS_DETACH)
00064     {
00065     DWORD cRefs;
00066     CSettings *pSettings = g_pSettings;  // ptr to global settings class.
00067
00068         g_pSettings = NULL;
00069         Assert(0 == g_cRefThisDll);
00070
00071         if (pSettings)
00072         {
00073             cRefs = pSettings->Release();
00074             Assert(0 == cRefs);
00075         }
00076
00077     }
00078
00079     return TRUE;
00080 }
00081
00082
00083 //+---------------------------------------------------------------------------
00084 //
00085 //  Function:     DllRegisterServer, public
00086 //
00087 //  Synopsis:
00088 //
00089 //  Arguments:
00090 //
00091 //  Returns:
00092 //
00093 //  Modifies:
00094 //
00095 //----------------------------------------------------------------------------
00096
00097 STDAPI DllRegisterServer(void)
00098 {
00099 HRESULT  hr = NOERROR;
00100 #ifndef _UNICODE
00101 WCHAR   wszID[GUID_SIZE+1];
00102 #endif // !_UNICODE
00103 TCHAR    szID[GUID_SIZE+1];
00104 TCHAR    szCLSID[GUID_SIZE+1];
00105 TCHAR    szModulePath[MAX_PATH];
00106
00107   // Obtain the path to this module's executable file for later use.
00108   GetModuleFileName(
00109     g_hmodThisDll,
00110     szModulePath,
00111     sizeof(szModulePath)/sizeof(TCHAR));
00112
00113   /*-------------------------------------------------------------------------
00114     Create registry entries for the DllSndBall Component.
00115   -------------------------------------------------------------------------*/
00116   // Create some base key strings.
00117 #ifdef _UNICODE
00118   StringFromGUID2(CLSID_SyncMgrHandler, szID, GUID_SIZE);
00119 #else
00120   BOOL fUsedDefaultChar;
00121
00122   StringFromGUID2(CLSID_SyncMgrHandler, wszID, GUID_SIZE);
00123
00124   WideCharToMultiByte(CP_ACP ,0,
00125     wszID,-1,szID,GUID_SIZE + 1,
00126     NULL,&fUsedDefaultChar);
00127
00128 #endif // _UNICODE
00129
00130   lstrcpy(szCLSID, TEXT("CLSID\\"));
00131   lstrcat(szCLSID, szID);
00132
00133   // Create entries under CLSID.
00134
00135   SetRegKeyValue(HKEY_CLASSES_ROOT,
00136     szCLSID,
00137     NULL,
00138     szCLSIDDescription);
00139
00140   SetRegKeyValue(HKEY_CLASSES_ROOT,
00141     szCLSID,
00142     TEXT("InProcServer32"),
00143     szModulePath);
00144
00145   AddRegNamedValue(
00146     szCLSID,
00147     TEXT("InProcServer32"),
00148     TEXT("ThreadingModel"),
00149     TEXT("Apartment"));
00150
00151   // register with SyncMgr
00152     LPSYNCMGRREGISTER lpSyncMgrRegister;
00153
00154     hr = CoCreateInstance(CLSID_SyncMgr,NULL,CLSCTX_SERVER,IID_ISyncMgrRegister,
00155                                             (LPVOID *) &lpSyncMgrRegister);
00156
00157     if (SUCCEEDED(hr))
00158     {
00159         hr = lpSyncMgrRegister->RegisterSyncMgrHandler(CLSID_SyncMgrHandler,
00160             wszCLSIDDescription,0 /* dwSyncMgrRegisterFlags */);
00161
00162         AssertSz(SUCCEEDED(hr),"Registration Failed");
00163
00164         lpSyncMgrRegister->Release();
00165     }
00166
00167     return hr;
00168 }
00169
00170
00171 //+---------------------------------------------------------------------------
00172 //
00173 //  Function:     DllUnregisterServer, public
00174 //
00175 //  Synopsis:
00176 //
00177 //  Arguments:
00178 //
00179 //  Returns:
00180 //
00181 //  Modifies:
00182 //
00183 //----------------------------------------------------------------------------
00184
00185 STDAPI DllUnregisterServer(void)
00186 {
00187 HRESULT hr;
00188
00189   // UnRegister with SyncMgr
00190     LPSYNCMGRREGISTER lpSyncMgrRegister;
00191
00192     hr = CoCreateInstance(CLSID_SyncMgr,NULL,CLSCTX_SERVER,IID_ISyncMgrRegister,
00193                                             (LPVOID *) &lpSyncMgrRegister);
00194
00195     if (SUCCEEDED(hr))
00196     {
00197         hr = lpSyncMgrRegister->UnregisterSyncMgrHandler(CLSID_SyncMgrHandler,0);
00198         lpSyncMgrRegister->Release();
00199     }
00200
00201     return hr;
00202
00203
00204
00205
00206 }
00207
00208 //+---------------------------------------------------------------------------
00209 //
00210 //  Function:     DllCanUnloadNow, public
00211 //
00212 //  Synopsis:
00213 //
00214 //  Arguments:
00215 //
00216 //  Returns:
00217 //
00218 //  Modifies:
00219 //
00220 //----------------------------------------------------------------------------
00221
00222 STDAPI DllCanUnloadNow(void)
00223 {
00224     return (g_cRefThisDll == 0) ? S_OK : S_FALSE;
00225 }
00226
00227 //+---------------------------------------------------------------------------
00228 //
00229 //  Function:     DllGetClassObject, public
00230 //
00231 //  Synopsis:
00232 //
00233 //  Arguments:
00234 //
00235 //  Returns:
00236 //
00237 //  Modifies:
00238 //
00239 //----------------------------------------------------------------------------
00240
00241 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvOut)
00242 {
00243     *ppvOut = NULL;
00244
00245     if (IsEqualIID(rclsid, CLSID_SyncMgrHandler))
00246     {
00247         CClassFactory *pcf = new CClassFactory;
00248
00249         return pcf->QueryInterface(riid, ppvOut);
00250     }
00251
00252     return CLASS_E_CLASSNOTAVAILABLE;
00253 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinNT/NetApi/NetShare/NetShare.c Source File

  • NetDS
  • WinNT
  • NetApi
  • NetShare

NetShare.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1995 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     netshare.c
00008
00009 Abstract:
00010
00011     This module illustrates how to use the Windows NT Lan Manager API
00012     in conjunction with the Win32 security API to create a new share
00013     on an arbitrary machine with permissions that grant an arbitrary
00014     user/group Full Access to the share.
00015
00016 Author:
00017
00018     Scott Field (sfield)    01-Oct-95
00019
00020 --*/
00021
00022 #include <windows.h>
00023 #include <lm.h>
00024 #include <stdio.h>
00025
00026 #define RTN_OK 0
00027 #define RTN_USAGE 1
00028 #define RTN_ERROR 13
00029
00030 //
00031 // Note: UNICODE entry point and argv.  This way, we don't need to bother
00032 // with converting commandline args to Unicode
00033 //
00034
00035 int
00036 __cdecl
00037 wmain(
00038     int argc,
00039     wchar_t *argv[]
00040     )
00041 {
00042     LPWSTR DirectoryToShare;
00043     LPWSTR Sharename;
00044     LPWSTR Username;
00045     LPWSTR Server;
00046
00047     PSID pSid = NULL;
00048     DWORD cbSid;
00049
00050     WCHAR RefDomain[DNLEN + 1];
00051     DWORD cchDomain = DNLEN + 1;
00052     SID_NAME_USE peUse;
00053
00054     SECURITY_DESCRIPTOR sd;
00055     PACL pDacl = NULL;
00056     DWORD dwAclSize;
00057
00058     SHARE_INFO_502 si502;
00059     NET_API_STATUS nas;
00060
00061     BOOL bSuccess = FALSE; // assume this function fails
00062
00063     if(argc < 4) {
00064         printf("Usage: %ls <directory> <sharename> <user/group> [\\\\Server]\n", argv[0]);
00065         printf(" directory is fullpath of directory to share\n");
00066         printf(" sharename is name of share on server\n");
00067         printf(" user/group is an WinNT user/groupname (REDMOND\\sfield, Administrators, etc)\n");
00068         printf(" optional Server is the name of the computer to create the share on\n");
00069         printf("\nExample: %ls c:\\public public Everyone\n", argv[0]);
00070         printf("c:\\public shared as public granting Everyone full access\n");
00071         printf("\nExample: %ls c:\\private cool$ REDMOND\\sfield \\\\WINBASE\n", argv[0]);
00072         printf("c:\\private on \\\\WINBASE shared as cool$ (hidden) granting REDMOND\\sfield access\n");
00073
00074         return RTN_USAGE;
00075     }
00076
00077     //
00078     // since the commandline was Unicode, just provide pointers to
00079     // the relevant items
00080     //
00081
00082     DirectoryToShare = argv[1];
00083     Sharename = argv[2];
00084     Username = argv[3];
00085
00086     if( argc > 4 ) {
00087         Server = argv[4];
00088     } else {
00089         Server = NULL; // local machine
00090     }
00091
00092     //
00093     // initial allocation attempt for Sid
00094     //
00095 #define SID_SIZE 96
00096     cbSid = SID_SIZE;
00097
00098     pSid = (PSID)HeapAlloc(GetProcessHeap(), 0, cbSid);
00099     if(pSid == NULL) {
00100         printf("HeapAlloc error!\n");
00101         return RTN_ERROR;
00102     }
00103
00104     //
00105     // get the Sid associated with the supplied user/group name
00106     // force Unicode API since we always pass Unicode string
00107     //
00108
00109     if(!LookupAccountNameW(
00110         NULL,       // default lookup logic
00111         Username,   // user/group of interest from commandline
00112         pSid,       // Sid buffer
00113         &cbSid,     // size of Sid
00114         RefDomain,  // Domain account found on (unused)
00115         &cchDomain, // size of domain in chars
00116         &peUse
00117         )) {
00118
00119         //
00120         // if the buffer wasn't large enough, try again
00121         //
00122
00123         if(GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
00124
00125             PSID psidTemp;
00126
00127             psidTemp = (PSID)HeapReAlloc(GetProcessHeap(), 0, pSid, cbSid);
00128
00129             if(psidTemp == NULL) {
00130                 printf("HeapReAlloc error!\n");
00131                 goto cleanup;
00132             }
00133             else
00134             {
00135                 pSid = psidTemp;
00136             }
00137
00138             cchDomain = DNLEN + 1;
00139
00140             if(!LookupAccountNameW(
00141                 NULL,       // default lookup logic
00142                 Username,   // user/group of interest from commandline
00143                 pSid,       // Sid buffer
00144                 &cbSid,     // size of Sid
00145                 RefDomain,  // Domain account found on (unused)
00146                 &cchDomain, // size of domain in chars
00147                 &peUse
00148                 )) {
00149                     printf("LookupAccountName error! (rc=%lu)\n", GetLastError());
00150                     goto cleanup;
00151                 }
00152
00153         } else {
00154             printf("LookupAccountName error! (rc=%lu)\n", GetLastError());
00155             goto cleanup;
00156         }
00157     }
00158
00159     //
00160     // compute size of new acl
00161     //
00162
00163     dwAclSize = sizeof(ACL) +
00164         1 * ( sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) ) +
00165         GetLengthSid(pSid) ;
00166
00167     //
00168     // allocate storage for Acl
00169     //
00170
00171     pDacl = (PACL)HeapAlloc(GetProcessHeap(), 0, dwAclSize);
00172     if(pDacl == NULL) goto cleanup;
00173
00174     if(!InitializeAcl(pDacl, dwAclSize, ACL_REVISION))
00175         goto cleanup;
00176
00177     //
00178     // grant GENERIC_ALL (Full Control) access
00179     //
00180
00181     if(!AddAccessAllowedAce(
00182         pDacl,
00183         ACL_REVISION,
00184         GENERIC_ALL,
00185         pSid
00186         )) goto cleanup;
00187
00188     if(!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION))
00189         goto cleanup;
00190
00191     if(!SetSecurityDescriptorDacl(&sd, TRUE, pDacl, FALSE)) {
00192         fprintf(stderr, "SetSecurityDescriptorDacl error! (rc=%lu)\n",
00193             GetLastError());
00194         goto cleanup;
00195     }
00196
00197     //
00198     // setup share info structure
00199     //
00200
00201     si502.shi502_netname = (LMSTR) Sharename;
00202     si502.shi502_type = STYPE_DISKTREE;
00203     si502.shi502_remark = NULL;
00204     si502.shi502_permissions = 0;
00205     si502.shi502_max_uses = SHI_USES_UNLIMITED;
00206     si502.shi502_current_uses = 0;
00207     si502.shi502_path = (LMSTR) DirectoryToShare;
00208     si502.shi502_passwd = NULL;
00209     si502.shi502_reserved = 0;
00210     si502.shi502_security_descriptor = &sd;
00211
00212     nas = NetShareAdd(
00213         (LMSTR) Server,         // share is on local machine
00214         502,            // info-level
00215         (LPBYTE)&si502, // info-buffer
00216         NULL            // don't bother with parm
00217         );
00218
00219     if(nas != NO_ERROR) {
00220         printf("NetShareAdd error! (rc=%lu)\n", nas);
00221         goto cleanup;
00222     }
00223
00224     bSuccess = TRUE; // indicate success
00225
00226 cleanup:
00227
00228     //
00229     // free allocated resources
00230     //
00231     if(pDacl != NULL)
00232         HeapFree(GetProcessHeap(), 0, pDacl);
00233
00234     if(pSid != NULL)
00235         HeapFree(GetProcessHeap(), 0, pSid);
00236
00237     if(!bSuccess) {
00238         return RTN_ERROR;
00239     }
00240
00241     return RTN_OK;
00242 }
00243
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/backgrnd.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

backgrnd.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "Backgrnd.h"
00021
00022 const GUID CBackgroundFolder::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023 const GUID CBackground::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00024
00025 #define WM_NEWOBJECT WM_APP
00026 #define WM_DISCOVERYCOMPLETE (WM_APP + 1)
00027
00028 //==============================================================
00029 //
00030 // CBackgroundFolder implementation
00031 //
00032 //
00033 CBackgroundFolder::CBackgroundFolder()
00034 : m_pConsoleNameSpace(NULL), m_scopeitem(0), m_threadId(0), m_thread(NULL),
00035 m_running(false), m_bViewUpdated(false)
00036 {
00037     ZeroMemory(m_children, sizeof(m_children));
00038
00039     WNDCLASS wndClass;
00040
00041     ZeroMemory(&wndClass, sizeof(WNDCLASS));
00042
00043     wndClass.lpfnWndProc = WindowProc;
00044     wndClass.lpszClassName = _T("backgroundthreadwindow");
00045     wndClass.hInstance = g_hinst;
00046
00047     ATOM atom = RegisterClass(&wndClass);
00048     m_backgroundHwnd = CreateWindow(
00049             _T("backgroundthreadwindow"),  // pointer to registered class name
00050             NULL, // pointer to window name
00051             0,        // window style
00052             0,                // horizontal position of window
00053             0,                // vertical position of window
00054             0,           // window width
00055             0,          // window height
00056             NULL,      // handle to parent or owner window
00057             NULL,          // handle to menu or child-window identifier
00058             g_hinst,     // handle to application instance
00059             (void *)this        // pointer to window-creation data
00060         );
00061
00062     if (m_backgroundHwnd)
00063         SetWindowLong(m_backgroundHwnd, GWL_USERDATA, (LONG)this);
00064
00065     InitializeCriticalSection(&m_critSect);
00066 }
00067
00068 CBackgroundFolder::~CBackgroundFolder()
00069 {
00070     StopThread();
00071
00072     for (int n = 0; n < MAX_CHILDREN; n++)
00073         if (m_children[n] != NULL)
00074             delete m_children[n];
00075
00076     if (m_backgroundHwnd != NULL)
00077         DestroyWindow(m_backgroundHwnd);
00078
00079     UnregisterClass(_T("backgroundthreadwindow"), NULL);
00080
00081     DeleteCriticalSection(&m_critSect);
00082 }
00083
00084 LRESULT CALLBACK CBackgroundFolder::WindowProc(
00085       HWND hwnd,      // handle to window
00086       UINT uMsg,      // message identifier
00087       WPARAM wParam,  // first message parameter
00088       LPARAM lParam   // second message parameter
00089     )
00090 {
00091     CBackgroundFolder *pThis = (CBackgroundFolder *)GetWindowLong(hwnd, GWL_USERDATA);
00092
00093     switch (uMsg) {
00094     case WM_NEWOBJECT:
00095         _ASSERT(pThis != NULL);
00096         pThis->AddItem(lParam);
00097         break;
00098
00099     case WM_DISCOVERYCOMPLETE:
00100         _ASSERT(pThis != NULL);
00101         pThis->m_bViewUpdated = true;
00102         pThis->StopThread();
00103         break;
00104    }
00105
00106     return DefWindowProc(hwnd, uMsg, wParam, lParam);
00107 }
00108
00109 DWORD WINAPI CBackgroundFolder::ThreadProc(
00110   LPVOID lpParameter   // thread data
00111 )
00112 {
00113     CBackgroundFolder *pThis = (CBackgroundFolder *)lpParameter;
00114
00115     EnterCriticalSection(&pThis->m_critSect);
00116     pThis->m_running = true;
00117     LeaveCriticalSection(&pThis->m_critSect);
00118
00119     for (int n = 0; n < MAX_CHILDREN; n++) {
00120         EnterCriticalSection(&pThis->m_critSect);
00121         bool running = pThis->m_running;
00122         LeaveCriticalSection(&pThis->m_critSect);
00123
00124         if (running == false)
00125             return 0;
00126
00127         PostMessage(pThis->m_backgroundHwnd, WM_NEWOBJECT, 0, n);
00128         Sleep(500);
00129     }
00130
00131     PostMessage(pThis->m_backgroundHwnd, WM_DISCOVERYCOMPLETE, 0, 0);
00132
00133     return 0;
00134 }
00135
00136 void CBackgroundFolder::StartThread()
00137 {
00138     EnterCriticalSection(&m_critSect);
00139     m_thread = CreateThread(NULL, 0, ThreadProc, (void *)this, 0, &m_threadId);
00140     LeaveCriticalSection(&m_critSect);
00141 }
00142
00143 void CBackgroundFolder::StopThread()
00144 {
00145     EnterCriticalSection(&m_critSect);
00146     m_running = false;
00147
00148     if (m_thread != NULL) {
00149         // this is ugly, wait for 10 seconds, then kill the thread
00150         DWORD res = WaitForSingleObject(m_thread, 10000);
00151
00152         if (res == WAIT_TIMEOUT)
00153             TerminateThread(m_thread, 0);
00154
00155         CloseHandle(m_thread);
00156
00157         m_thread = NULL;
00158     }
00159     LeaveCriticalSection(&m_critSect);
00160 }
00161
00162 void CBackgroundFolder::AddItem(int id)
00163 {
00164     HRESULT hr;
00165
00166     EnterCriticalSection(&m_critSect);
00167
00168     _ASSERT(m_children[id] == NULL);
00169
00170     m_children[id] = new CBackground(id);
00171
00172     SCOPEDATAITEM sdi;
00173
00174     // insert items here
00175     ZeroMemory(&sdi, sizeof(SCOPEDATAITEM));
00176
00177     sdi.mask = SDI_STR       |   // Displayname is valid
00178         SDI_PARAM     |   // lParam is valid
00179         SDI_IMAGE     |   // nImage is valid
00180         SDI_OPENIMAGE |   // nOpenImage is valid
00181         SDI_PARENT    |
00182         SDI_CHILDREN;
00183
00184     sdi.relativeID  = (HSCOPEITEM)m_scopeitem;
00185     sdi.nImage      = m_children[id]->GetBitmapIndex();
00186     sdi.nOpenImage  = INDEX_OPENFOLDER;
00187     sdi.displayname = MMC_CALLBACK;
00188     sdi.lParam      = (LPARAM)m_children[id];       // The cookie
00189     sdi.cChildren   = 0;
00190
00191     hr = m_pConsoleNameSpace->InsertItem( &sdi );
00192     _ASSERT( SUCCEEDED(hr) );
00193
00194     m_children[id]->SetHandle((HANDLE)sdi.ID);
00195
00196     LeaveCriticalSection(&m_critSect);
00197
00198     return;
00199 }
00200
00201 HRESULT CBackgroundFolder::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00202 {
00203     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00204         (long *)m_pBMapLg, // pointer to a handle
00205         0, // index of the first image in the strip
00206         RGB(0, 128, 128)  // color of the icon mask
00207         );
00208 }
00209
00210 HRESULT CBackgroundFolder::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00211 {
00212     // cache the stuff
00213     m_pConsoleNameSpace = pConsoleNameSpace;
00214     m_scopeitem = parent;
00215
00216     if (m_bViewUpdated == false && m_running == false)
00217         StartThread();
00218
00219     return S_OK;
00220 }
00221
00222 HRESULT CBackgroundFolder::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00223 {
00224     m_bSelected = (bSelect && bScope) ? true : false;
00225
00226     if (bSelect && !m_running) {
00227         IConsoleVerb *pConsoleVerb;
00228
00229         HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00230         _ASSERT(SUCCEEDED(hr));
00231
00232         hr = pConsoleVerb->SetVerbState(MMC_VERB_REFRESH, ENABLED, TRUE);
00233
00234         pConsoleVerb->Release();
00235     }
00236
00237     return S_OK;
00238 }
00239
00240 HRESULT CBackgroundFolder::OnRefresh()
00241 {
00242     HRESULT hr = S_OK;
00243
00244     StopThread();
00245
00246     EnterCriticalSection(&m_critSect);
00247     for (int n = 0; n < MAX_CHILDREN; n++) {
00248         if (m_children[n] != NULL) {
00249             HSCOPEITEM hItem = (HSCOPEITEM)m_children[n]->GetHandle();
00250             hr = m_pConsoleNameSpace->DeleteItem(hItem, TRUE);
00251
00252             delete m_children[n];
00253             m_children[n] = NULL;
00254         }
00255     }
00256     LeaveCriticalSection(&m_critSect);
00257
00258     m_bViewUpdated = false;
00259
00260     StartThread();
00261
00262     return S_OK;
00263 }
00264
00265 const _TCHAR *CBackground::GetDisplayName(int nCol)
00266 {
00267     static _TCHAR buf[128];
00268
00269     _stprintf(buf, _T("Background object #%d"), m_id);
00270
00271     return buf;
00272 }
00273
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ADVISE_SINK Member List

This is the complete list of members for ADVISE_SINK, including all inherited members.
dwMask | ADVISE_SINK
pTextStoreACPSink | ADVISE_SINK
punkID | ADVISE_SINK
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authorization/stdafx.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Authorization

stdafx.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName: StdAfx.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011 #if !defined(AFX_STDAFX_H__3BD37859_22AD_40A0_A478_F3B39084E570__INCLUDED_)
00012 #define AFX_STDAFX_H__3BD37859_22AD_40A0_A478_F3B39084E570__INCLUDED_
00013
00014 #if _MSC_VER > 1000
00015 #pragma once
00016 #endif // _MSC_VER > 1000
00017
00018 #define STRICT
00019 #ifndef _WIN32_WINNT
00020 #define _WIN32_WINNT 0x0400
00021 #endif
00022 #define _ATL_APARTMENT_THREADED
00023
00024 #include <atlbase.h>
00025 //You may derive a class from CComModule and use it if you want to override
00026 //something, but do not change the name of _Module
00027 extern CComModule _Module;
00028 #include <atlcom.h>
00029
00030 #include <event.h>
00031 #include <wmsserver.h>
00032 #include <WMSBasicPlugin.h>
00033
00034 //{{AFX_INSERT_LOCATION}}
00035 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00036
00037 #endif // !defined(AFX_STDAFX_H__3BD37859_22AD_40A0_A478_F3B39084E570__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cdatalinks.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cdatalinks.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CDATALINKS.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 /////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 /////////////////////////////////////////////////////////////////
00019 // CServiceComp::CServiceComp
00020 //
00021 /////////////////////////////////////////////////////////////////
00022 CServiceComp::CServiceComp(CMainWindow* pCMainWindow)
00023   : CBase(eCServiceComp, pCMainWindow, NULL)
00024 {
00025   //OLE DB Interfaces
00026   m_pIDataInitialize      = NULL;   //DataLink interface
00027
00028
00029   //Data
00030   m_pwszInitString      = NULL;
00031   GetRegEnumValue(HKEY_ROWSETVIEWER, wszRECENTINITSTRING_KEY, 0,  &m_pwszInitString);
00032 }
00033
00034 /////////////////////////////////////////////////////////////////
00035 // CServiceComp::~CServiceComp
00036 //
00037 /////////////////////////////////////////////////////////////////
00038 CServiceComp::~CServiceComp()
00039 {
00040   ReleaseObject(0);
00041
00042   //ServiceComponents
00043   DelRegEntry(HKEY_ROWSETVIEWER, wszRECENTINITSTRING_KEY);
00044   SetRegEntry(HKEY_ROWSETVIEWER, wszRECENTINITSTRING_KEY, m_pwszInitString, L"");
00045
00046   SAFE_FREE(m_pwszInitString);
00047 }
00048
00049
00050 /////////////////////////////////////////////////////////////////
00051 // IUnknown** CServiceComp::GetInterfaceAddress
00052 //
00053 /////////////////////////////////////////////////////////////////
00054 IUnknown** CServiceComp::GetInterfaceAddress(REFIID riid)
00055 {
00056   HANDLE_GETINTERFACE(IDataInitialize);
00057
00058   //Otherwise delegate
00059   return CBase::GetInterfaceAddress(riid);
00060 }
00061
00062
00063 /////////////////////////////////////////////////////////////////
00064 // CServiceComp::AutoRelease
00065 //
00066 /////////////////////////////////////////////////////////////////
00067 HRESULT CServiceComp::AutoRelease()
00068 {
00069   //OLE DB Interfaces
00070   RELEASE_INTERFACE(IDataInitialize);
00071
00072
00073   //Delegate
00074   return CBase::AutoRelease();
00075 }
00076
00077
00078 /////////////////////////////////////////////////////////////////
00079 // HRESULT CServiceComp::AutoQI
00080 //
00081 /////////////////////////////////////////////////////////////////
00082 HRESULT CServiceComp::AutoQI(DWORD dwCreateOpts)
00083 {
00084   //Delegate First so we have base interfaces
00085   CBase::AutoQI(dwCreateOpts);
00086
00087   //[MANDATORY]
00088   if(dwCreateOpts & CREATE_QI_MANDATORY)
00089   {
00090     OBTAIN_INTERFACE(IDataInitialize);
00091
00092   }
00093
00094   //[OPTIONAL]
00095   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00096   {
00097   }
00098
00099   return S_OK;
00100 }
00101
00102
00103 /////////////////////////////////////////////////////////////////
00104 // HRESULT CServiceComp::Create
00105 //
00106 /////////////////////////////////////////////////////////////////
00107 HRESULT CServiceComp::Create(CBase* pCSource, DWORD dwCSLCTX, WCHAR* pwszRemoteServer)
00108 {
00109   HRESULT   hr = S_OK;
00110   CComPtr<IUnknown> spUnknown;
00111
00112   //CLSID_MSDAINITIALIZE
00113   XTESTC(hr = m_pCMainWindow->m_pCRootEnumerator->CreateInstance(NULL, CLSID_MSDAINITIALIZE, dwCSLCTX, IID_IUnknown, &spUnknown, pwszRemoteServer));
00114
00115   //Delegate
00116   TESTC(hr = CBase::CreateObject(pCSource, IID_IUnknown, spUnknown));
00117
00118 CLEANUP:
00119   return hr;
00120 }
00121
00122
00123 ////////////////////////////////////////////////////////////////
00124 // CServiceComp::OnDefOperation
00125 //
00126 /////////////////////////////////////////////////////////////////
00127 void  CServiceComp::OnDefOperation()
00128 {
00129   //Need to bring up the GetDataSource Dialog
00130   if(m_pIDataInitialize)
00131     m_pCMainWindow->DisplayDialog(IDD_DATAINIT_GETDATASOURCE, GetFocus(), CMainWindow::GetDataSourceProc, this);
00132 }
00133
00134
00135 /////////////////////////////////////////////////////////////////
00136 // HRESULT CServiceComp::CreateDBInstance
00137 //
00138 /////////////////////////////////////////////////////////////////
00139 HRESULT CServiceComp::CreateDBInstance(REFCLSID clsid, CAggregate* pCAggregate, DWORD dwCLSCTX, REFIID riid, IUnknown** ppIUnknown)
00140 {
00141   HRESULT hr      = E_FAIL;
00142
00143   //CLSID to String (just for display purposes...)
00144   WCHAR* pwszProgID = GetProgID(clsid);
00145
00146   //Defferred Creation
00147   if(!m_pIUnknown)
00148     TESTC(hr = Create(NULL));
00149
00150   if(m_pIDataInitialize)
00151   {
00152     //Now Obtain Instance of Provider (with Service Components)
00153     XTEST(hr = m_pIDataInitialize->CreateDBInstance(clsid, pCAggregate, dwCLSCTX, L"pwszReserved", riid, ppIUnknown));
00154     TESTC(TRACE_METHOD(hr, L"IDataInitialize::CreateDBInstance(%s, 0x%p, 0x%08x, \"pwszReserved\", %s, &0x%p)", pwszProgID, pCAggregate, dwCLSCTX, GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL));
00155
00156     //Handle Aggregation
00157     if(pCAggregate)
00158       TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00159   }
00160
00161 CLEANUP:
00162   SAFE_FREE(pwszProgID);
00163   return hr;
00164 }
00165
00166
00167 /////////////////////////////////////////////////////////////////
00168 // CServiceComp::GetDataSource
00169 //
00170 /////////////////////////////////////////////////////////////////
00171 HRESULT CServiceComp::GetDataSource(CAggregate* pCAggregate, DWORD dwCLSCTX, WCHAR* pwszInitString, REFIID riid, IUnknown** ppIUnknown)
00172 {
00173   HRESULT hr      = E_FAIL;
00174
00175   //Defferred Creation
00176   if(!m_pIUnknown)
00177     TESTC(hr = Create(NULL));
00178
00179   if(m_pIDataInitialize)
00180   {
00181     //GetDataSource based upoon the InitString
00182     XTEST(hr = m_pIDataInitialize->GetDataSource(pCAggregate, dwCLSCTX, pwszInitString, riid, ppIUnknown));
00183     TESTC(TRACE_METHOD(hr, L"IDataInitialize::GetDataSource(0x%p, 0x%08x, \"%s\", %s, &0x%p)", pCAggregate, GetOptions()->m_dwCLSCTX, pwszInitString, GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL));
00184
00185     //Handle Aggregation
00186     if(pCAggregate)
00187       TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00188   }
00189
00190 CLEANUP:
00191   return hr;
00192 }
00193
00194
00195 /////////////////////////////////////////////////////////////////
00196 // CServiceComp::GetInitString
00197 //
00198 /////////////////////////////////////////////////////////////////
00199 HRESULT CServiceComp::GetInitString(IUnknown* pIUnknown, boolean fIncludePassword, WCHAR** ppwszInitString)
00200 {
00201   HRESULT hr        = E_FAIL;
00202
00203   //Defferred Creation
00204   if(!m_pIUnknown)
00205     TESTC(hr = Create(NULL));
00206
00207   if(m_pIDataInitialize)
00208   {
00209     //GetInitializationString
00210     XTEST(hr = m_pIDataInitialize->GetInitializationString(pIUnknown, fIncludePassword, ppwszInitString));
00211     TESTC(TRACE_METHOD(hr, L"IDataInitialize::GetInitializationString(0x%p, %s, &\"%s\")", pIUnknown, fIncludePassword ? L"True" : L"False", ppwszInitString ? *ppwszInitString : NULL));
00212   }
00213
00214 CLEANUP:
00215   return hr;
00216 }
00217
00218
00219
00220 /////////////////////////////////////////////////////////////////
00221 // CServiceComp::SaveInitString
00222 //
00223 /////////////////////////////////////////////////////////////////
00224 HRESULT CServiceComp::SaveInitString(WCHAR* pwszFileName, WCHAR* pwszInitString, DWORD dwCreateOpts)
00225 {
00226   HRESULT hr      = E_FAIL;
00227
00228   //Defferred Creation
00229   if(!m_pIUnknown)
00230     TESTC(hr = Create(NULL));
00231
00232   if(m_pIDataInitialize)
00233   {
00234     //WriteStringToStorage
00235     XTEST(hr = m_pIDataInitialize->WriteStringToStorage(pwszFileName, pwszInitString, dwCreateOpts));
00236     TESTC(TRACE_METHOD(hr, L"IDataInitialize::WriteStringToStorage(\"%s\", \"%s\", 0x%08x)", pwszFileName, pwszInitString, dwCreateOpts));
00237   }
00238
00239 CLEANUP:
00240   return hr;
00241 }
00242
00243
00244 /////////////////////////////////////////////////////////////////
00245 // CServiceComp::LoadInitString
00246 //
00247 /////////////////////////////////////////////////////////////////
00248 HRESULT CServiceComp::LoadInitString(WCHAR* pwszFileName, WCHAR** ppwszInitString)
00249 {
00250   HRESULT hr        = E_FAIL;
00251
00252   //Defferred Creation
00253   if(!m_pIUnknown)
00254     TESTC(hr = Create(NULL));
00255
00256   if(m_pIDataInitialize)
00257   {
00258     //LoadStringFromStorage
00259     XTEST(hr = m_pIDataInitialize->LoadStringFromStorage(pwszFileName, ppwszInitString));
00260     TESTC(TRACE_METHOD(hr, L"IDataInitialize::LoadStringFromStorage(\"%s\", &\"%s\")", pwszFileName, ppwszInitString ? *ppwszInitString : NULL));
00261   }
00262
00263 CLEANUP:
00264   return hr;
00265 }
00266
00267
00268
00269 /////////////////////////////////////////////////////////////////
00270 // CServiceComp::ConnectFromFile
00271 //
00272 /////////////////////////////////////////////////////////////////
00273 HRESULT CServiceComp::ConnectFromFile(WCHAR* pwszSelectedFile)
00274 {
00275   HRESULT hr = S_OK;
00276   WCHAR* pwszInitString = NULL;
00277   CComPtr<IUnknown> spUnknown;
00278
00279   //No-op
00280   if(pwszSelectedFile == NULL)
00281     return E_FAIL;
00282
00283   //Load the saved InitString from the SelectedFile
00284   TESTC(hr = LoadInitString(pwszSelectedFile, &pwszInitString));
00285
00286   //Delegate - Now that we have the InitString
00287   TESTC(hr = GetDataSource(NULL, GetOptions()->m_dwCLSCTX, pwszInitString, IID_IUnknown, &spUnknown));
00288
00289   //Update the Saved Files (now that successfuly connected)
00290   m_pCMainWindow->m_pCFullConnect->AddRecentFile(pwszSelectedFile);
00291
00292   //Handle the returned object...
00293   //NOTE: Can pontentially return other object types: (ie: CREATE_DETERMINE_TYPE)
00294   if(!m_pCMainWindow->HandleObjectType(this, spUnknown, IID_IUnknown, eCDataSource, 0, NULL, CREATE_NEWWINDOW | CREATE_DETERMINE_TYPE | GetOptions()->m_dwCreateOpts))
00295     TESTC(hr = E_FAIL);
00296
00297 CLEANUP:
00298   SAFE_FREE(pwszInitString);
00299   return hr;
00300 }
00301
00302
00303
00304
00305
00306 /////////////////////////////////////////////////////////////////
00307 // CDataLinks::CDataLinks
00308 //
00309 /////////////////////////////////////////////////////////////////
00310 CDataLinks::CDataLinks(CMainWindow* pCMainWindow)
00311   : CBase(eCDataLinks, pCMainWindow, NULL)
00312 {
00313   //OLE DB Interfaces
00314   m_pIDBPromptInitialize    = NULL;   //DataLink interface
00315
00316   //Data
00317 }
00318
00319 /////////////////////////////////////////////////////////////////
00320 // CDataLinks::~CDataLinks
00321 //
00322 /////////////////////////////////////////////////////////////////
00323 CDataLinks::~CDataLinks()
00324 {
00325   ReleaseObject(0);
00326 }
00327
00328
00329 /////////////////////////////////////////////////////////////////
00330 // IUnknown** CDataLinks::GetInterfaceAddress
00331 //
00332 /////////////////////////////////////////////////////////////////
00333 IUnknown** CDataLinks::GetInterfaceAddress(REFIID riid)
00334 {
00335   HANDLE_GETINTERFACE(IDBPromptInitialize);
00336
00337   //Otherwise delegate
00338   return CBase::GetInterfaceAddress(riid);
00339 }
00340
00341
00342 /////////////////////////////////////////////////////////////////
00343 // CDataLinks::AutoRelease
00344 //
00345 /////////////////////////////////////////////////////////////////
00346 HRESULT CDataLinks::AutoRelease()
00347 {
00348   //OLE DB Interfaces
00349   RELEASE_INTERFACE(IDBPromptInitialize);
00350
00351   //Delegate
00352   return CBase::AutoRelease();
00353 }
00354
00355
00356 /////////////////////////////////////////////////////////////////
00357 // HRESULT CDataLinks::AutoQI
00358 //
00359 /////////////////////////////////////////////////////////////////
00360 HRESULT CDataLinks::AutoQI(DWORD dwCreateOpts)
00361 {
00362   //Delegate First so we have base interfaces
00363   CBase::AutoQI(dwCreateOpts);
00364
00365   //[MANDATORY]
00366   if(dwCreateOpts & CREATE_QI_MANDATORY)
00367   {
00368     OBTAIN_INTERFACE(IDBPromptInitialize);
00369   }
00370
00371   //[OPTIONAL]
00372   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00373   {
00374   }
00375
00376   return S_OK;
00377 }
00378
00379
00380 /////////////////////////////////////////////////////////////////
00381 // HRESULT CDataLinks::Create
00382 //
00383 /////////////////////////////////////////////////////////////////
00384 HRESULT CDataLinks::Create(CBase* pCSource, DWORD dwCSLCTX, WCHAR* pwszRemoteServer)
00385 {
00386   HRESULT   hr = S_OK;
00387   CComPtr<IUnknown> spUnknown;
00388
00389   //CLSID_MSDAINITIALIZE
00390   XTESTC(hr = m_pCMainWindow->m_pCRootEnumerator->CreateInstance(NULL, CLSID_DataLinks, dwCSLCTX, IID_IUnknown, &spUnknown, pwszRemoteServer));
00391
00392   //Delegate
00393   TESTC(hr = CBase::CreateObject(pCSource, IID_IUnknown, spUnknown));
00394
00395 CLEANUP:
00396   return hr;
00397 }
00398
00399
00400 ////////////////////////////////////////////////////////////////
00401 // CDataLinks::OnDefOperation
00402 //
00403 /////////////////////////////////////////////////////////////////
00404 void  CDataLinks::OnDefOperation()
00405 {
00406   //PromptDataSource dialog
00407   CComPtr<IDBInitialize> spDBInitialize;
00408
00409   //Just display the PromptDataSource dialog directly (common case)
00410   if(SUCCEEDED(PromptDataSource(NULL, m_pCMainWindow->m_hWnd, DBPROMPTOPTIONS_PROPERTYSHEET, 0, NULL, NULL, IID_IDBInitialize, (IUnknown**)&spDBInitialize)))
00411   {
00412     //Handle the returned object...
00413     //NOTE: Can pontentially return other object types: (ie: CREATE_DETERMINE_TYPE)
00414     m_pCMainWindow->HandleObjectType(this, spDBInitialize, IID_IDBInitialize, eCDataSource, 0, NULL, CREATE_NEWWINDOW | CREATE_DETERMINE_TYPE | GetOptions()->m_dwCreateOpts);
00415   }
00416 }
00417
00418
00419 /////////////////////////////////////////////////////////////////
00420 // CDataLinks::PromptDataSource
00421 //
00422 /////////////////////////////////////////////////////////////////
00423 HRESULT CDataLinks::PromptDataSource(CAggregate* pCAggregate, HWND hWndParent, DBPROMPTOPTIONS dwPromptOptions, ULONG cTypeFilters, DBSOURCETYPE* rgTypeFilters, WCHAR* pwszProvFilter, REFIID riid, IUnknown** ppDataSource)
00424 {
00425   HRESULT hr      = E_FAIL;
00426
00427   //Defferred Creation
00428   if(!m_pIUnknown)
00429     TESTC(hr = Create(NULL));
00430
00431   if(m_pIDBPromptInitialize)
00432   {
00433     //IDBPromptInitialize::PromptDataSource
00434     //NOTE: Expect S_OK or DB_E_CANCELED, since canceling the dialog always returns DB_E_CANCELED
00435     XTEST_(hr = m_pIDBPromptInitialize->PromptDataSource(pCAggregate, hWndParent, dwPromptOptions, cTypeFilters, rgTypeFilters, pwszProvFilter, riid, ppDataSource),DB_E_CANCELED);
00436     TESTC(TRACE_METHOD(hr, L"IDBPromptInitialize::PromptDataSource(0x%p, 0x%p, 0x%08x, %d, 0x%p, \"%s\", %s, &0x%p)", pCAggregate, hWndParent, dwPromptOptions, cTypeFilters, rgTypeFilters, pwszProvFilter, GetInterfaceName(riid), ppDataSource ? *ppDataSource : NULL));
00437
00438     //Handle Aggregation
00439     if(pCAggregate)
00440       TESTC(hr = pCAggregate->HandleAggregation(riid, ppDataSource));
00441   }
00442
00443 CLEANUP:
00444   return hr;
00445 }
00446
00447
00448 /////////////////////////////////////////////////////////////////
00449 // CDataLinks::PromptFileName
00450 //
00451 /////////////////////////////////////////////////////////////////
00452 HRESULT CDataLinks::PromptFileName(HWND hWndParent, DBPROMPTOPTIONS dwPromptOptions, WCHAR* pwszDirectory, WCHAR* pwszFileName, WCHAR** ppwszSelectedFile)
00453 {
00454   HRESULT hr      = E_FAIL;
00455
00456   //Defferred Creation
00457   if(!m_pIUnknown)
00458     TESTC(hr = Create(NULL));
00459
00460   if(m_pIDBPromptInitialize)
00461   {
00462     //IDBPromptInitalize::PromptFileName
00463     //NOTE: Expect S_OK or DB_E_CANCELED, since canceling the dialog always returns DB_E_CANCELED
00464     XTEST_(hr = m_pIDBPromptInitialize->PromptFileName
00465           (
00466           hWndParent,             // hWndParent
00467           dwPromptOptions,          // dwPromptOptions
00468                 pwszDirectory,            // pwszInitialDirectory
00469                 pwszFileName,           // pwszInitialFile
00470                 ppwszSelectedFile         // pwszSelectedFile
00471           ), DB_E_CANCELED);
00472     TESTC(TRACE_METHOD(hr, L"IDBPromptInitialize::PromptFileName(0x%p, 0x%08x, \"%s\", \"%s\", &\"%s\")", hWndParent, dwPromptOptions, pwszDirectory, pwszFileName, ppwszSelectedFile ? *ppwszSelectedFile : NULL));
00473   }
00474
00475 CLEANUP:
00476   return hr;
00477 }
00478
00479
00480
00481
Generated on Wed Nov 13 2024 16:52:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/mfc_tree/StdAfx.cpp Source File

  • Web
  • xml
  • mfc_tree

StdAfx.cpp

Go to the documentation of this file.
00001 //=--------------------------------------------------------------------------=
00002 //  (C) Copyright 1996 - 2000 Microsoft Corporation. All Rights Reserved.
00003 //=--------------------------------------------------------------------------=
00004
00005 // stdafx.cpp : source file that includes just the standard includes
00006 //  XMLTree.pch will be the pre-compiled header
00007 //  stdafx.obj will contain the pre-compiled type information
00008
00009 #include "stdafx.h"
00010
00011
00012
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/WildCardMap/WildCardMap.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • WildCardMap

WildCardMap.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name:  WildCardMap.cpp
00006
00007 Abstract:
00008
00009     ISAPI extension to demonstrate a very simple wildcard
00010     script map that sees a request and passes it along for
00011     further processing.
00012
00013 Author:
00014
00015     ISAPI developer (Microsoft employee), July 2002
00016
00017 --*/
00018
00019 #ifndef _WIN32_WINNT
00020 #define _WIN32_WINNT 0x0500
00021 #endif
00022
00023 #include <stdio.h>
00024 #include <windows.h>
00025 #include <httpext.h>
00026
00027 #define MODULE_NAME         "WildCardMap"
00028 #define WRITE_BUFFER_SIZE   1000
00029
00030 VOID
00031 WINAPI
00032 ExecUrlCompletion (
00033     EXTENSION_CONTROL_BLOCK *   pecb,
00034     PVOID                       pContext,
00035     DWORD                       cbIO,
00036     DWORD                       dwError
00037     );
00038
00039 BOOL
00040 SendServerError(
00041     EXTENSION_CONTROL_BLOCK *   pecb
00042     );
00043
00044 VOID
00045 WriteDebug(
00046     LPSTR   szFormat,
00047     ...
00048     );
00049
00050 BOOL
00051 WINAPI
00052 GetExtensionVersion(
00053     HSE_VERSION_INFO *  pVer
00054     )
00055 /*++
00056
00057 Purpose:
00058
00059     Entry point for ISAPI extension initialization.  Required.
00060
00061     This function will be called exactly once in the lifetime
00062     of the extension, at initialization time.  This function is
00063     a useful point to do complex initialization tasks.  This
00064     function is called outside of the system loader lock, so
00065     it does not have the same restrictions as DllMain.
00066
00067 Arguments:
00068
00069     pVer - points to extension version info structure
00070
00071 Returns:
00072
00073     TR2UE on success, FALSE on failure.
00074
00075     Note that in the case of FALSE, IIS will call GetLastError()
00076     and return an error page to the client.  The entity body of
00077     the page may be textual if the FormatMessage API can resolve
00078     it, or it may just be an error number if FormatMessage can't
00079     resolve it.
00080
00081 --*/
00082 {
00083     //
00084     // Tell IIS which version of ISAPI this extension was build from.
00085     //
00086
00087     pVer->dwExtensionVersion = MAKELONG( HSE_VERSION_MINOR,
00088                                          HSE_VERSION_MAJOR);
00089
00090     //
00091     // Report the description string for this extension.  Ensure
00092     // that it does not exceed the maximum length and is NULL
00093     // terminated.
00094     //
00095
00096     strncpy( pVer->lpszExtensionDesc,
00097              "WildCardMap Sample ISAPI Extension",
00098              HSE_MAX_EXT_DLL_NAME_LEN );
00099
00100     pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN-1] = '\0';
00101
00102     //
00103     // Return TRUE if we successfully initialized.
00104     //
00105
00106   return TRUE;
00107 }
00108
00109 DWORD
00110 WINAPI
00111 HttpExtensionProc(
00112     EXTENSION_CONTROL_BLOCK *   pecb
00113     )
00114 /*++
00115
00116 Purpose:
00117
00118     Entry point for ISAPI requests.  Required.
00119
00120     This function is called once per request.  The EXTENSION_CONTROL_BLOCK
00121     passed in contains information and function pointers sufficient to
00122     interact with the server during this processing.
00123
00124     Note that, once HttpExtensionProc is called, it is the responsibility
00125     of the extension to send back any data that the client should receive.
00126     IIS will not automatically generate any response, even in the case of
00127     HSE_STATUS_ERROR once the request has progressed to the point where
00128     this function is called.
00129
00130     Also note that you should not make any blocking calls or do long-running
00131     operations within this function.  To allow efficient scaling of your
00132     server, you should consider creating a pool of private threads to handle
00133     the requests.  In that case, the implementation of this function would
00134     be just to add the pecb to a queue and return HSE_STATUS_PENDING.  The
00135     threads in the pool would be responsible for dequeing a pecb and calling
00136     HSE_REQ_DONE_WITH_SESSION when they are finished processing it.
00137
00138 Arguments:
00139
00140     pecb - pointer to the extenstion control block
00141
00142 Returns:
00143
00144     HSE_STATUS_SUCCESS - Indicates successful request.
00145     HSE_STATUS_ERROR   - Indicates failed request.
00146     HSE_STATUS_PENDING - Indicates that processing of the request
00147                          should continue after this function returns.
00148                          It HSE_STATUS_PENDING is used, it is necessary
00149                          that HSE_REQ_DONE_WITH_SESSION is called
00150                          exactly once when processing is completed for
00151                          the request.
00152
00153 --*/
00154 {
00155     HSE_EXEC_URL_INFO   ExecUrlInfo;
00156     LPSTR               pUrl = NULL;
00157     DWORD               cbData;
00158
00159     //
00160     // Acquire the URL for the current request.
00161     //
00162
00163     if ( pecb->GetServerVariable( pecb->ConnID,
00164                                   "URL",
00165                                   NULL,
00166                                   &cbData ) == FALSE )
00167     {
00168         if ( GetLastError() == ERROR_INSUFFICIENT_BUFFER )
00169         {
00170             pUrl = (LPSTR)LocalAlloc( LPTR, cbData );
00171
00172             if ( pUrl )
00173             {
00174                 pecb->GetServerVariable( pecb->ConnID,
00175                                          "URL",
00176                                          pUrl,
00177                                          &cbData );
00178             }
00179         }
00180     }
00181
00182     if ( !pUrl )
00183     {
00184         WriteDebug( "Error %d occurred acquiring URL.\r\n",
00185                     GetLastError() );
00186
00187         goto Failed;
00188     }
00189
00190     //
00191     // Since this is just a sample to demonstrate a very simple
00192     // wildcard script map, we aren't going to actually modify
00193     // or otherwise process the request.  We'll just report our
00194     // presence and then call the original URL using
00195     // HSE_REQ_EXEC_URL.
00196     //
00197
00198     WriteDebug( "Request Received: URL=%s\r\n",
00199                 pUrl );
00200
00201     ExecUrlInfo.pszUrl = NULL;          // Use original request URL
00202     ExecUrlInfo.pszMethod = NULL;       // Use original request method
00203     ExecUrlInfo.pszChildHeaders = NULL; // Use original request headers
00204     ExecUrlInfo.pUserInfo = NULL;       // Use original request user info
00205     ExecUrlInfo.pEntity = NULL;         // Use original request entity
00206
00207     //
00208     // Since this extension is intended to be used as a wildcard script
00209     // map, we need to set the below flag to prevent recursion, which
00210     // can occur in some cases.
00211     //
00212
00213     ExecUrlInfo.dwExecUrlFlags = HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR;
00214
00215     //
00216     // Associate the completion routine and the current URL with
00217     // this request.
00218     //
00219
00220     if ( pecb->ServerSupportFunction( pecb->ConnID,
00221                                       HSE_REQ_IO_COMPLETION,
00222                                       ExecUrlCompletion,
00223                                       NULL,
00224                                       (LPDWORD)pUrl ) == FALSE )
00225     {
00226         WriteDebug( "Error %d occurred setting I/O completion.\r\n",
00227                      GetLastError() );
00228
00229         goto Failed;
00230     }
00231
00232     //
00233     // Ok, now that everything is set up, let's call the child request.
00234     //
00235
00236     if ( pecb->ServerSupportFunction( pecb->ConnID,
00237                                       HSE_REQ_EXEC_URL,
00238                                       &ExecUrlInfo,
00239                                       NULL,
00240                                       NULL ) == FALSE )
00241     {
00242         WriteDebug( "Error %d occurred calling HSE_REQ_EXEC_URL.\r\n",
00243                      GetLastError() );
00244
00245         goto Failed;
00246     }
00247
00248     //
00249     // Return pending and let the completion clean up.
00250     //
00251
00252     return HSE_STATUS_PENDING;
00253
00254 Failed:
00255
00256     if ( pUrl )
00257     {
00258         LocalFree( pUrl );
00259         pUrl = NULL;
00260     }
00261
00262     SendServerError( pecb );
00263
00264     return HSE_STATUS_ERROR;
00265 }
00266
00267 VOID
00268 WINAPI
00269 ExecUrlCompletion (
00270     EXTENSION_CONTROL_BLOCK *   pecb,
00271     PVOID                       pContext,
00272     DWORD                       cbIO,
00273     DWORD                       dwError
00274     )
00275 {
00276     HSE_EXEC_URL_STATUS ExecUrlStatus;
00277     CHAR                szStatus[32] = "";
00278     CHAR                szWin32Error[32] = "";
00279     LPSTR               pChildUrl;
00280     BOOL                fResult;
00281
00282     pChildUrl = (LPSTR)pContext;
00283
00284     //
00285     // Get the results of the child request and report it.
00286     //
00287
00288     fResult = pecb->ServerSupportFunction( pecb->ConnID,
00289                                            HSE_REQ_GET_EXEC_URL_STATUS,
00290                                            &ExecUrlStatus,
00291                                            NULL,
00292                                            NULL );
00293
00294     if ( fResult )
00295     {
00296         if ( ExecUrlStatus.uHttpSubStatus != 0 )
00297         {
00298             _snprintf( szStatus,
00299                        32,
00300                        "Child Status=%d.%d",
00301                        ExecUrlStatus.uHttpStatusCode,
00302                        ExecUrlStatus.uHttpSubStatus );
00303         }
00304         else
00305         {
00306             _snprintf( szStatus,
00307                        32,
00308                        "%d",
00309                        ExecUrlStatus.uHttpStatusCode );
00310         }
00311
00312         szStatus[31] = '\0';
00313
00314         if ( ExecUrlStatus.dwWin32Error != ERROR_SUCCESS )
00315         {
00316             _snprintf( szWin32Error,
00317                        16,
00318                        "ErrorCode=%d, ",
00319                        ExecUrlStatus.dwWin32Error );
00320
00321             szWin32Error[31] = '\0';
00322         }
00323
00324         WriteDebug( "ExecUrl Completion: %s, %sURL=%s.\r\n",
00325                     szStatus,
00326                     szWin32Error,
00327                     pChildUrl );
00328     }
00329     else
00330     {
00331         WriteDebug( "ExecUrl Completion: Error %d, URL=%s.\r\n",
00332                     GetLastError(),
00333                     pChildUrl );
00334     }
00335
00336     //
00337     // Clean up the context pointer
00338     //
00339
00340     if ( pChildUrl )
00341     {
00342         LocalFree( pChildUrl );
00343         pChildUrl = NULL;
00344     }
00345
00346     //
00347     // Notify IIS that we are done with this request
00348     //
00349
00350     pecb->ServerSupportFunction(
00351         pecb->ConnID,
00352         HSE_REQ_DONE_WITH_SESSION,
00353         NULL,
00354         NULL,
00355         NULL
00356         );
00357 }
00358
00359 BOOL
00360 SendServerError(
00361     EXTENSION_CONTROL_BLOCK *   pecb
00362     )
00363 {
00364     DWORD   cbData;
00365     CHAR    szError[] = "<html>\r\n"
00366                         "<head><title> A server error occurred. </title></head>\r\n"
00367                         "<h1> Server Error </h1>\r\n"
00368                         "<hr>\r\n"
00369                         "An error occurred processing this request.";
00370
00371     //
00372     // Set the status code so that a 500 gets logged in the w3svc log.
00373     //
00374
00375     pecb->dwHttpStatusCode = 500;
00376
00377     //
00378     // Send headers and response
00379     //
00380
00381     pecb->ServerSupportFunction( pecb->ConnID,
00382                                  HSE_REQ_SEND_RESPONSE_HEADER,
00383                                  "500 Server Error",
00384                                  NULL,
00385                                  (LPDWORD)"Content-Type: text/html\r\n\r\n" );
00386
00387     cbData = sizeof( szError );
00388
00389     return pecb->WriteClient( pecb->ConnID,
00390                               szError,
00391                               &cbData,
00392                               HSE_IO_SYNC );
00393 }
00394
00395 VOID
00396 WriteDebug(
00397     LPSTR   szFormat,
00398     ...
00399     )
00400 {
00401     CHAR    szBuffer[WRITE_BUFFER_SIZE];
00402     LPSTR   pCursor;
00403     DWORD   cbToWrite;
00404     INT     nWritten;
00405     va_list args;
00406
00407     if ( WRITE_BUFFER_SIZE < 3 )
00408     {
00409         //
00410         // This is just too small to deal with...
00411         //
00412
00413         return;
00414     }
00415
00416     //
00417     // Inject the module name tag into the buffer
00418     //
00419
00420     nWritten = _snprintf( szBuffer,
00421                           WRITE_BUFFER_SIZE,
00422                           "[%s.dll] ",
00423                           MODULE_NAME );
00424
00425     if ( nWritten == -1 )
00426     {
00427         return;
00428     }
00429
00430     pCursor = szBuffer + nWritten;
00431     cbToWrite = WRITE_BUFFER_SIZE - nWritten;
00432
00433     va_start( args, szFormat );
00434
00435     nWritten = _vsnprintf( pCursor,
00436                            cbToWrite,
00437                            szFormat,
00438                            args );
00439
00440     va_end( args );
00441
00442     if ( nWritten == -1 )
00443     {
00444         szBuffer[WRITE_BUFFER_SIZE-3] = '\r';
00445         szBuffer[WRITE_BUFFER_SIZE-2] = '\n';
00446     }
00447
00448     szBuffer[WRITE_BUFFER_SIZE-1] = '\0';
00449
00450     OutputDebugString( szBuffer );
00451 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/StoServe/Factory.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • StoServe

Factory.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.CPP
00003
00004   Summary:   Implementation file for the class factories of the STOSERVE
00005              server.  This server provides the DllPaper COM component.
00006              For this component, IClassFactory is implemented in an
00007              appropriate class factory COM object: CFPaper. The COM
00008              component that can be manufactured by this server is known
00009              outside the server by its CLSID: CLSID_DllPaper.
00010
00011              The class factories in this server use the CThreaded
00012              OwnThis mechanism to ensure mutually exclusive access by
00013              contending multiple threads.
00014
00015              For a comprehensive tutorial code tour of this module's
00016              contents and offerings see the tutorial STOSERVE.HTM
00017              file. For more specific technical details on the internal
00018              workings see the comments dispersed throughout the module's
00019              source code.
00020
00021   Classes:   CFPaper.
00022
00023   Functions: .
00024
00025   Origin:    6-10-96: atrent - Editor-inheritance from FACTORY.CPP in
00026                the CONSERVE Tutorial Code Sample.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 /*---------------------------------------------------------------------------
00044   We include WINDOWS.H for all Win32 applications.
00045   We include OLE2.H because we will be calling the COM/OLE Libraries.
00046   We include OLECTL.H because it has definitions for connectable objects.
00047   We include APPUTIL.H because we will be building this DLL using
00048     the convenient Virtual Window and Dialog classes and other
00049     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00050   We include IPAPER.H and PAPGUIDS.H for the common Paper-related
00051     Interface class, GUID, and CLSID specifications.
00052   We include SERVER.H because it has the necessary internal class and
00053     resource definitions for this DLL.
00054   We include FACTORY.H because it has the necessary internal class factory
00055     declarations for this DLL component server.  Those factories we will be
00056     implementing in this module.
00057   We include CONNECT.H for object class declarations for the various
00058     connection point and connection COM objects used in STOSERVE.
00059   We include PAPER.H, for the object class declarations for the
00060     COPaper COM object.
00061 ---------------------------------------------------------------------------*/
00062 #include <windows.h>
00063 #include <ole2.h>
00064 #include <olectl.h>
00065 #include <apputil.h>
00066 #include <ipaper.h>
00067 #include <papguids.h>
00068 #include "server.h"
00069 #include "factory.h"
00070 #include "connect.h"
00071 #include "paper.h"
00072
00073 /*---------------------------------------------------------------------------
00074   Implementation the CFPaper Class Factory.  CFPaper is the COM
00075   object class for the Class Factory that can manufacture COPaper
00076   COM Components.
00077 ---------------------------------------------------------------------------*/
00078
00079 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00080   Method:   CFPaper::CFPaper
00081
00082   Summary:  CFPaper Constructor. Note the member initializer:
00083             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00084             to pass the 'this', pUnkOuter, and pServer pointers of this
00085             constructor function to the constructor executed in the
00086             instantiation of the CImpIClassFactory interface whose
00087             implementation is nested inside this present object class.
00088
00089   Args:     IUnknown* pUnkOuter,
00090               Pointer to the the outer Unknown.  NULL means this COM Object
00091               is not being Aggregated.  Non NULL means it is being created
00092               on behalf of an outside COM object that is reusing it via
00093               aggregation.
00094             CServer* pServer)
00095               Pointer to the server's control object.
00096
00097   Modifies: m_cRefs, m_pUnkOuter.
00098
00099   Returns:  void
00100 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00101 CFPaper::CFPaper(
00102   IUnknown* pUnkOuter,
00103   CServer* pServer) :
00104   m_ImpIClassFactory(this, pUnkOuter, pServer)
00105 {
00106   // Zero the COM object's reference count.
00107   m_cRefs = 0;
00108
00109   // No AddRef necessary if non-NULL, as we're nested.
00110   m_pUnkOuter = pUnkOuter;
00111
00112   // Init the pointer to the server control object.
00113   m_pServer = pServer;
00114
00115   return;
00116 }
00117
00118
00119 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00120   Method:   CFPaper::~CFPaper
00121
00122   Summary:  CFPaper Destructor.
00123
00124   Args:     void
00125
00126   Returns:  void
00127 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00128 CFPaper::~CFPaper(void)
00129 {
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   CFPaper::QueryInterface
00136
00137   Summary:  QueryInterface of the CFPaper non-delegating
00138             IUnknown implementation.
00139
00140   Args:     REFIID riid,
00141               [in] GUID of the Interface being requested.
00142             PPVOID ppv)
00143               [out] Address of the caller's pointer variable that will
00144               receive the requested interface pointer.
00145
00146   Returns:  HRESULT
00147               Standard result code. NOERROR for success.
00148 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00149 STDMETHODIMP CFPaper::QueryInterface(
00150                REFIID riid,
00151                PPVOID ppv)
00152 {
00153   HRESULT hr = E_NOINTERFACE;
00154
00155   if (OwnThis())
00156   {
00157     *ppv = NULL;
00158
00159     if (IID_IUnknown == riid)
00160       *ppv = this;
00161     else if (IID_IClassFactory == riid)
00162       *ppv = &m_ImpIClassFactory;
00163
00164     if (NULL != *ppv)
00165     {
00166       // We've handed out a pointer to the interface so obey the COM rules
00167       // and AddRef the reference count.
00168       ((LPUNKNOWN)*ppv)->AddRef();
00169       hr = NOERROR;
00170     }
00171
00172     UnOwnThis();
00173   }
00174
00175   return (hr);
00176 }
00177
00178
00179 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00180   Method:   CFPaper::AddRef
00181
00182   Summary:  AddRef of the CFPaper non-delegating IUnknown implementation.
00183
00184   Args:     void
00185
00186   Modifies: m_cRefs.
00187
00188   Returns:  ULONG
00189               New value of m_cRefs (COM object's reference count).
00190 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00191 STDMETHODIMP_(ULONG) CFPaper::AddRef(void)
00192 {
00193   ULONG cRefs;
00194
00195   if (OwnThis())
00196   {
00197     cRefs = ++m_cRefs;
00198
00199     UnOwnThis();
00200   }
00201
00202   return cRefs;
00203 }
00204
00205
00206 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00207   Method:   CFPaper::Release
00208
00209   Summary:  Release of the CFPaper non-delegating IUnknown implementation.
00210
00211   Args:     void
00212
00213   Modifies: m_cRefs.
00214
00215   Returns:  ULONG
00216               New value of m_cRefs (COM object's reference count).
00217 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00218 STDMETHODIMP_(ULONG) CFPaper::Release(void)
00219 {
00220   ULONG cRefs;
00221
00222   if (OwnThis())
00223   {
00224     cRefs = --m_cRefs;
00225
00226     if (0 == cRefs)
00227     {
00228       // We've reached a zero reference count for this COM object.
00229       // So we tell the server housing to decrement its global object
00230       // count so that the server will be unloaded if appropriate.
00231       if (NULL != m_pServer)
00232         m_pServer->ObjectsDown();
00233
00234       // We artificially bump the main ref count to prevent reentrancy
00235       // via the main object destructor.  Not really needed in this
00236       // CFPaper but a good practice because we are aggregatable and
00237       // may at some point in the future add something entertaining like
00238       // some Releases to the CFPaper destructor.
00239       m_cRefs++;
00240       UnOwnThis();
00241       delete this;
00242     }
00243     else
00244       UnOwnThis();
00245   }
00246
00247   return cRefs;
00248 }
00249
00250
00251 /*---------------------------------------------------------------------------
00252   CFPaper's nested implementation of the IClassFactory interface
00253   including Constructor, Destructor, QueryInterface, AddRef, Release,
00254   CreateInstance, and LockServer methods.
00255 ---------------------------------------------------------------------------*/
00256
00257 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00258   Method:   CFPaper::CImpIClassFactory::CImpIClassFactory
00259
00260   Summary:  Constructor for the CImpIClassFactory interface instantiation.
00261
00262   Args:     CFPaper* pBackObj,
00263               Back pointer to the parent outer object.
00264             IUnknown* pUnkOuter,
00265               Pointer to the outer Unknown.  For delegation.
00266             CServer* pServer)
00267               Pointer to the server's control object.
00268
00269   Modifies: m_pBackObj, m_pUnkOuter, m_pServer.
00270
00271   Returns:  void
00272 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00273 CFPaper::CImpIClassFactory::CImpIClassFactory(
00274   CFPaper* pBackObj,
00275   IUnknown* pUnkOuter,
00276   CServer* pServer)
00277 {
00278   // Init the Back Object Pointer to point to the parent object.
00279   m_pBackObj = pBackObj;
00280
00281   // Init the pointer to the server control object.
00282   m_pServer = pServer;
00283
00284   // Init the CImpIClassFactory interface's delegating Unknown pointer.
00285   // We use the Back Object pointer for IUnknown delegation here if we are
00286   // not being aggregated. If we are being aggregated we use the supplied
00287   // pUnkOuter for IUnknown delegation. In either case the pointer
00288   // assignment requires no AddRef because the CImpIClassFactory lifetime
00289   // is quaranteed by the lifetime of the parent object in which
00290   // CImpIClassFactory is nested.
00291   if (NULL == pUnkOuter)
00292     m_pUnkOuter = pBackObj;
00293   else
00294     m_pUnkOuter = pUnkOuter;
00295
00296   return;
00297 }
00298
00299
00300 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00301   Method:   CFPaper::CImpIClassFactory::~CImpIClassFactory
00302
00303   Summary:  Destructor for the CImpIClassFactory interface instantiation.
00304
00305   Args:     void
00306
00307   Returns:  void
00308 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00309 CFPaper::CImpIClassFactory::~CImpIClassFactory(void)
00310 {
00311   return;
00312 }
00313
00314
00315 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00316   Method:   CFPaper::CImpIClassFactory::QueryInterface
00317
00318   Summary:  The QueryInterface IUnknown member of this IClassFactory
00319             interface implementation that delegates to m_pUnkOuter,
00320             whatever it is.
00321
00322   Args:     REFIID riid,
00323               [in] GUID of the Interface being requested.
00324             PPVOID ppv)
00325               [out] Address of the caller's pointer variable that will
00326               receive the requested interface pointer.
00327
00328   Returns:  HRESULT
00329               Standard result code. NOERROR for success.
00330               Returned by the delegated outer QueryInterface call.
00331 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00332 STDMETHODIMP CFPaper::CImpIClassFactory::QueryInterface(
00333                REFIID riid,
00334                PPVOID ppv)
00335 {
00336   // Delegate this call to the outer object's QueryInterface.
00337   return m_pUnkOuter->QueryInterface(riid, ppv);
00338 }
00339
00340
00341 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00342   Method:   CFPaper::CImpIClassFactory::AddRef
00343
00344   Summary:  The AddRef IUnknown member of this IClassFactory interface
00345             implementation that delegates to m_pUnkOuter, whatever it is.
00346
00347   Args:     void
00348
00349   Returns:  ULONG
00350               Returned by the delegated outer AddRef call.
00351 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00352 STDMETHODIMP_(ULONG) CFPaper::CImpIClassFactory::AddRef(void)
00353 {
00354   // Delegate this call to the outer object's AddRef.
00355   return m_pUnkOuter->AddRef();
00356 }
00357
00358
00359 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00360   Method:   CFPaper::CImpIClassFactory::Release
00361
00362   Summary:  The Release IUnknown member of this IClassFactory interface
00363             implementation that delegates to m_pUnkOuter, whatever it is.
00364
00365   Args:     void
00366
00367   Returns:  ULONG
00368               Returned by the delegated outer Release call.
00369 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00370 STDMETHODIMP_(ULONG) CFPaper::CImpIClassFactory::Release(void)
00371 {
00372   // Delegate this call to the outer object's Release.
00373   return m_pUnkOuter->Release();
00374 }
00375
00376
00377 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00378   Method:   CFPaper::CImpIClassFactory::CreateInstance
00379
00380   Summary:  The CreateInstance member method of this IClassFactory
00381             interface implementation.  Creates an instance of the COPaper
00382             COM component.
00383
00384   Args:     IUnknown* pUnkOuter,
00385               [in] Pointer to the controlling IUnknown.
00386             REFIID riid,
00387               [in] GUID of the Interface being requested.
00388             PPVOID ppvCob)
00389               [out] Address of the caller's pointer variable that will
00390               receive the requested interface pointer.
00391
00392   Returns:  HRESULT
00393               Standard result code. NOERROR for success.
00394 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00395 STDMETHODIMP CFPaper::CImpIClassFactory::CreateInstance(
00396                IUnknown* pUnkOuter,
00397                REFIID riid,
00398                PPVOID ppv)
00399 {
00400   HRESULT hr = E_FAIL;
00401   COPaper* pCob = NULL;
00402
00403   // NULL the output pointer.
00404   *ppv = NULL;
00405
00406   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00407   // the COM rules state the IUnknown interface MUST also be concomitantly
00408   // be requested.  If it is not so requested (riid != IID_IUnknown) then
00409   // an error must be returned indicating that no aggregate creation of
00410   // the CFPaper COM Object can be performed.
00411   if (NULL != pUnkOuter && riid != IID_IUnknown)
00412     hr = CLASS_E_NOAGGREGATION;
00413   else
00414   {
00415     // Instantiate a COPaper COM Object.
00416     pCob = new COPaper(pUnkOuter, m_pServer);
00417     if (NULL != pCob)
00418     {
00419       // Create and initialize any subordinate objects.
00420       hr = pCob->Init();
00421       if (SUCCEEDED(hr))
00422       {
00423         // We successfully created the new COM object so tell the server
00424         // to increment its global server object count to help ensure
00425         // that the server remains loaded until this partial creation
00426         // of a COM component is completed.
00427         m_pServer->ObjectsUp();
00428
00429         // We QueryInterface this new COM Object not only to deposit the
00430         // main interface pointer to the caller's pointer variable, but to
00431         // also automatically bump the Reference Count on the new COM
00432         // Object after handing out this reference to it.
00433         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
00434         if (FAILED(hr))
00435         {
00436           m_pServer->ObjectsDown();
00437           delete pCob;
00438         }
00439       }
00440       else
00441         delete pCob;
00442     }
00443     else
00444       hr = E_OUTOFMEMORY;
00445   }
00446
00447   return hr;
00448 }
00449
00450
00451 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00452   Method:   CFPaper::CImpIClassFactory::LockServer
00453
00454   Summary:  The LockServer member method of this IClassFactory interface
00455             implementation.
00456
00457   Args:     BOOL bLock)
00458               [in] Flag determining whether to Lock or Unlock the server.
00459
00460   Returns:  HRESULT
00461               Standard result code. NOERROR for success.
00462 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00463 STDMETHODIMP CFPaper::CImpIClassFactory::LockServer(
00464                BOOL bLock)
00465 {
00466   HRESULT hr = NOERROR;
00467
00468   if (bLock)
00469     m_pServer->Lock();
00470   else
00471     m_pServer->Unlock();
00472
00473   return hr;
00474 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LicServe/LicServe.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • LicServe

LicServe.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      LICSERVE.CPP
00003
00004   Summary:   Implementation file for a DLL COM Component server providing
00005              the licensed COM component COLicCruiseCar. This server
00006              supports self registration and unregistration.  A special
00007              Utility COM Component is also provided: COLicCarSample.
00008              Exposing an ISample interface it supports utility operations
00009              on the DLL server itself (eg, the server can be given a
00010              pointer to the Client's trace Logging facility and can be
00011              told to show the server's Aboutbox dialog).
00012
00013              For a comprehensive tutorial code tour of LICSERVE's contents
00014              and offerings see the tutorial LICSERVE.HTM file. For
00015              more specific technical details on the internal workings see
00016              the comments dispersed throughout the LICSERVE source code.
00017
00018   Classes:   none.
00019
00020   Functions: DllMain, DllGetClassObject, DllCanUnloadNow, DllRegisterServer,
00021              DllUnregisterServer.
00022
00023   Origin:    10-5-95: atrent - Editor-inheritance from DLLSERVE.CPP in
00024                the DLLSERVE Tutorial Code Sample.
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 /*---------------------------------------------------------------------------
00042   We include WINDOWS.H for all Win32 applications.
00043   We include OLE2.H because we will be calling the COM/OLE Libraries.
00044   We include INITGUID.H only once (here) in the entire DLL because we
00045     will be defining GUIDs and want them as constants in the data segment.
00046   We include OLECTL.H because we will using IClassFactory2.
00047   We include APPUTIL.H because we will be building this DLL using
00048     the convenient Virtual Window and Dialog classes and other
00049     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00050   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00051     class, GUID, and CLSID specifications.
00052   We include LICSERVE.H because it has the main declerations of all the
00053     car related interfaces and their GUIDs.  It also has the _DLLEXPORT_
00054     controlled import and export specifications.
00055   We include SERVER.H because it has the necessary internal class and
00056     resource definitions for this DLL.
00057   We include FACTORY.H because it has the necessary internal class factory
00058     declarations for this DLL component server.
00059 ---------------------------------------------------------------------------*/
00060 #include <windows.h>
00061 #include <ole2.h>
00062 #include <initguid.h>
00063 #include <olectl.h>
00064 #include <apputil.h>
00065 #include <icars.h>
00066 #include <carguids.h>
00067 #define _DLLEXPORT_
00068 #include "licserve.h"
00069 #include "server.h"
00070 #include "factory.h"
00071
00072
00073 // Global variable definitions. Some Initialized in DllMain() below.
00074
00075 // We encapsulate the control of this COM server (eg, lock and object
00076 // counting) in a server control C++ object.  Here is it's pointer.
00077 CServer* g_pServer = NULL;
00078
00079 // Here is a pointer for use by the global Trace Message logging macros.
00080 // Set by the ISample::Init function call from an outside EXE client.
00081 CMsgLog* g_pMsgLog = NULL;
00082
00083
00084 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00085   Function: UnicodeOk
00086
00087   Summary:  Checks if the platform will handle unicode versions of
00088             Win32 string API calls.
00089
00090   Args:     void
00091
00092   Returns:  BOOL
00093               TRUE if unicode support; FALSE if not.
00094 ------------------------------------------------------------------------F-F*/
00095 BOOL UnicodeOk(void)
00096 {
00097   BOOL bOk = TRUE;
00098   TCHAR szUserName[MAX_STRING_LENGTH];
00099   DWORD dwSize = MAX_STRING_LENGTH;
00100
00101   if (!GetUserName(szUserName, &dwSize))
00102     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00103
00104   return bOk;
00105 }
00106
00107
00108 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00109   Function: DllMain
00110
00111   Summary:  Like WinMain is for an EXE application, this DllMain function
00112             is the main entry point for this DLL.  It is called when the
00113             DLL is loaded by a process, and when new threads are created
00114             by a process that has already loaded this DLL.  DllMain is also
00115             called when threads of a process that has loaded the DLL exit
00116             cleanly and when the process itself unloads the DLL.
00117
00118             If you want to use C runtime libraries, keep this function
00119             named "DllMain" and you won't have to do anything special to
00120             initialize the runtime libraries.
00121
00122             When fdwReason == DLL_PROCESS_ATTACH, the return value is used
00123             to determine if the DLL should remain loaded, or should be
00124             immediately unloaded depending upon whether the DLL could be
00125             initialized properly.  For all other values of fdwReason,
00126             the return value is ignored.
00127
00128   Args:     HINSTANCE hDLLInst,
00129               Instance handle of the DLL.
00130             DWORD fdwReason,
00131               Process attach/detach or thread attach/detach.
00132               Reason for calling.
00133             LPVOID lpvReserved)
00134               Reserved and not used.
00135
00136   Returns:  BOOL,
00137               Return value is used only when fdwReason == DLL_PROCESS_ATTACH.
00138               TRUE  -  Used to signify that the DLL should remain loaded.
00139               FALSE -  Used to signify that the DLL should be
00140                 immediately unloaded.
00141 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00142 BOOL WINAPI DllMain(
00143               HINSTANCE hDllInst,
00144               DWORD fdwReason,
00145               LPVOID lpvReserved)
00146 {
00147   BOOL bResult = TRUE;
00148
00149   // Dispatch this main call based on the reason it was called.
00150   switch (fdwReason)
00151   {
00152     case DLL_PROCESS_ATTACH:
00153       // The DLL is being loaded for the first time by a given process.
00154       // Perform per-process initialization here.  If the initialization
00155       // is successful, return TRUE; if unsuccessful, return FALSE.
00156       bResult = FALSE;
00157       if (UnicodeOk())
00158       {
00159         // Instantiate the CServer utility class.
00160         g_pServer = new CServer;
00161         if (NULL != g_pServer)
00162         {
00163           // Remember the DLL Instance handle.
00164           g_pServer->m_hDllInst = hDllInst;
00165
00166           // Create a MsgBox object.
00167           g_pServer->m_pMsgBox = new CMsgBox;
00168           if (NULL != g_pServer->m_pMsgBox)
00169           {
00170             // Check for valid Machine License.
00171             g_pServer->CheckLicense();
00172             bResult = TRUE;
00173           }
00174         }
00175       }
00176       break;
00177
00178     case DLL_PROCESS_DETACH:
00179       // The DLL is being unloaded by a given process.  Do any
00180       // per-process clean up here, such as undoing what was done in
00181       // DLL_PROCESS_ATTACH.  The return value is ignored.
00182       DELETE_POINTER(g_pServer->m_pMsgBox);
00183       DELETE_POINTER(g_pServer);
00184       break;
00185
00186     case DLL_THREAD_ATTACH:
00187       // A thread is being created in a process that has already loaded
00188       // this DLL.  Perform any per-thread initialization here.  The
00189       // return value is ignored.
00190       break;
00191
00192     case DLL_THREAD_DETACH:
00193       // A thread is exiting cleanly in a process that has already
00194       // loaded this DLL.  Perform any per-thread clean up here.  The
00195       // return value is ignored.
00196       break;
00197
00198     default:
00199       break;
00200   }
00201
00202   return (bResult);
00203 }
00204
00205
00206 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00207   Function: DllGetClassObject
00208
00209   Summary:  The standard exported function that the COM service library
00210             uses to obtain an object class of the class factory for a
00211             specified component provided by this server DLL.
00212
00213   Args:     REFCLSID rclsid,
00214               [in] The CLSID of the requested Component.
00215             REFIID riid,
00216               [in] GUID of the requested interface on the Class Factory.
00217             PPVOID ppv)
00218               [out] Address of the caller's pointer variable that will
00219               receive the requested interface pointer.
00220
00221   Returns:  HRESULT
00222               E_FAIL if requested component isn't supported.
00223               E_OUTOFMEMORY if out of memory.
00224               Error code out of the QueryInterface.
00225 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00226 STDAPI DllGetClassObject(
00227          REFCLSID rclsid,
00228          REFIID riid,
00229          PPVOID ppv)
00230 {
00231   HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
00232   IUnknown* pCob = NULL;
00233
00234   if (CLSID_LicCruiseCar == rclsid)
00235   {
00236     LOG("P: DllGetClassObject: Requesting CFLicCruiseCar.");
00237     hr = E_OUTOFMEMORY;
00238     pCob = new CFLicCruiseCar(NULL, g_pServer);
00239   }
00240   else if (CLSID_LicCarSample == rclsid)
00241   {
00242     LOG("P: DllGetClassObject: Requesting CFLicCarSample.");
00243     hr = E_OUTOFMEMORY;
00244     pCob = new CFLicCarSample(NULL, g_pServer);
00245   }
00246
00247   if (NULL != pCob)
00248   {
00249     g_pServer->ObjectsUp();
00250     hr = pCob->QueryInterface(riid, ppv);
00251     if (FAILED(hr))
00252     {
00253       g_pServer->ObjectsDown();
00254       DELETE_POINTER(pCob);
00255     }
00256   }
00257
00258   return hr;
00259 }
00260
00261
00262 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00263   Function: DllCanUnloadNow
00264
00265   Summary:  The standard exported function that the COM service library
00266             uses to determine if this server DLL can be unloaded.
00267
00268   Args:     void.
00269
00270   Returns:  HRESULT
00271               S_OK if this DLL server can be unloaded.
00272               S_FALSE if this DLL can not be unloaded.
00273 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00274 STDAPI DllCanUnloadNow(void)
00275 {
00276   HRESULT hr;
00277
00278   LOGF2("P: DllCanUnloadNow. cObjects=%i, cLocks=%i.", g_pServer->m_cObjects, g_pServer->m_cLocks);
00279
00280   // We return S_OK of there are no longer any living objects AND
00281   // there are no outstanding client locks on this server.
00282   hr = (0L==g_pServer->m_cObjects && 0L==g_pServer->m_cLocks) ? S_OK : S_FALSE;
00283
00284   return hr;
00285 }
00286
00287
00288 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00289   Function: DllRegisterServer
00290
00291   Summary:  The standard exported function that can be called to command
00292             this DLL server to register itself in the system registry.
00293
00294   Args:     void.
00295
00296   Returns:  HRESULT
00297               NOERROR
00298 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00299 STDAPI DllRegisterServer(void)
00300 {
00301   HRESULT  hr = NOERROR;
00302   TCHAR    szID[GUID_SIZE+1];
00303   TCHAR    szCLSID[GUID_SIZE+32];
00304   TCHAR    szModulePath[MAX_PATH];
00305
00306   // Obtain the path to this module's executable file for later use.
00307   GetModuleFileName(
00308     g_pServer->m_hDllInst,
00309     szModulePath,
00310     sizeof(szModulePath) / sizeof(TCHAR));
00311
00312   /*-------------------------------------------------------------------------
00313     Create registry entries for the LicCruiseCar Component.
00314   -------------------------------------------------------------------------*/
00315   // Create some base key strings.
00316   StringFromGUID2(CLSID_LicCruiseCar, szID, GUID_SIZE);
00317   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00318   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00319
00320   // Create ProgID keys.
00321   SetRegKeyValue(
00322     TEXT("CTS.LicCruiseCar.1"),
00323     NULL,
00324     TEXT("LicCruiseCar Component - LICSERVE Code Sample"));
00325   SetRegKeyValue(
00326     TEXT("CTS.LicCruiseCar.1"),
00327     TEXT("CLSID"),
00328     szID);
00329
00330   // Create VersionIndependentProgID keys.
00331   SetRegKeyValue(
00332     TEXT("CTS.LicCruiseCar"),
00333     NULL,
00334     TEXT("LicCruiseCar Component - LICSERVE Code Sample"));
00335   SetRegKeyValue(
00336     TEXT("CTS.LicCruiseCar"),
00337     TEXT("CurVer"),
00338     TEXT("CTS.LicCruiseCar.1"));
00339   SetRegKeyValue(
00340     TEXT("CTS.LicCruiseCar"),
00341     TEXT("CLSID"),
00342     szID);
00343
00344   // Create entries under CLSID.
00345   SetRegKeyValue(
00346     szCLSID,
00347     NULL,
00348     TEXT("LicCruiseCar Component - LICSERVE Code Sample"));
00349   SetRegKeyValue(
00350     szCLSID,
00351     TEXT("ProgID"),
00352     TEXT("CTS.LicCruiseCar.1"));
00353   SetRegKeyValue(
00354     szCLSID,
00355     TEXT("VersionIndependentProgID"),
00356     TEXT("CTS.LicCruiseCar"));
00357   SetRegKeyValue(
00358     szCLSID,
00359     TEXT("NotInsertable"),
00360     NULL);
00361   SetRegKeyValue(
00362     szCLSID,
00363     TEXT("InprocServer32"),
00364     szModulePath);
00365
00366   /*-------------------------------------------------------------------------
00367     Create registry entries for the LicCarSample Component.
00368   -------------------------------------------------------------------------*/
00369   // Create some base key strings.
00370   StringFromGUID2(CLSID_LicCarSample, szID, GUID_SIZE);
00371   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00372   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00373
00374   // Create ProgID keys.
00375   SetRegKeyValue(
00376     TEXT("CTS.LicCarSample.1"),
00377     NULL,
00378     TEXT("LicCarSample Component - LICSERVE Code Sample"));
00379   SetRegKeyValue(
00380     TEXT("CTS.LicCarSample.1"),
00381     TEXT("CLSID"),
00382     szID);
00383
00384   // Create VersionIndependentProgID keys.
00385   SetRegKeyValue(
00386     TEXT("CTS.LicCarSample"),
00387     NULL,
00388     TEXT("LicCarSample Component - LICSERVE Code Sample"));
00389   SetRegKeyValue(
00390     TEXT("CTS.LicCarSample"),
00391     TEXT("CurVer"),
00392     TEXT("CTS.LicCarSample.1"));
00393   SetRegKeyValue(
00394     TEXT("CTS.LicCarSample"),
00395     TEXT("CLSID"),
00396     szID);
00397
00398   // Create entries under CLSID.
00399   SetRegKeyValue(
00400     szCLSID,
00401     NULL,
00402     TEXT("LicCarSample Component - LICSERVE Code Sample"));
00403   SetRegKeyValue(
00404     szCLSID,
00405     TEXT("ProgID"),
00406     TEXT("CTS.LicCarSample.1"));
00407   SetRegKeyValue(
00408     szCLSID,
00409     TEXT("VersionIndependentProgID"),
00410     TEXT("CTS.LicCarSample"));
00411   SetRegKeyValue(
00412     szCLSID,
00413     TEXT("NotInsertable"),
00414     NULL);
00415   SetRegKeyValue(
00416     szCLSID,
00417     TEXT("InprocServer32"),
00418     szModulePath);
00419
00420   return hr;
00421 }
00422
00423
00424 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00425   Function: DllUnregisterServer
00426
00427   Summary:  The standard exported function that can be called to command
00428             this DLL server to unregister itself from the system Registry
00429             (under main key: HKEY_CLASSES_ROOT).
00430
00431   Args:     void.
00432
00433   Returns:  HRESULT
00434               NOERROR
00435 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00436 STDAPI DllUnregisterServer(void)
00437 {
00438   HRESULT  hr = NOERROR;
00439   TCHAR    szID[GUID_SIZE+1];
00440   TCHAR    szCLSID[GUID_SIZE+32];
00441   TCHAR    szTemp[MAX_PATH+GUID_SIZE];
00442
00443   /*-------------------------------------------------------------------------
00444     Delete registry entries for the LicCruiseCar Component.
00445   -------------------------------------------------------------------------*/
00446   //Create some base key strings.
00447   StringFromGUID2(CLSID_LicCruiseCar, szID, GUID_SIZE);
00448   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00449   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00450
00451   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCruiseCar\\CurVer"));
00452   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCruiseCar\\CLSID"));
00453   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCruiseCar"));
00454
00455   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCruiseCar.1\\CLSID"));
00456   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCruiseCar.1"));
00457
00458   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00459   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00460
00461   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00462   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00463
00464   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00465   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00466
00467   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("InprocServer32"));
00468   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00469
00470   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00471
00472   /*-------------------------------------------------------------------------
00473     Delete registry entries for the LicCarSample Component.
00474   -------------------------------------------------------------------------*/
00475   //Create some base key strings.
00476   StringFromGUID2(CLSID_LicCarSample, szID, GUID_SIZE);
00477   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00478   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00479
00480   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCarSample\\CurVer"));
00481   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCarSample\\CLSID"));
00482   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCarSample"));
00483
00484   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCarSample.1\\CLSID"));
00485   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LicCarSample.1"));
00486
00487   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00488   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00489
00490   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00491   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00492
00493   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00494   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00495
00496   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("InprocServer32"));
00497   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00498
00499   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00500
00501   return hr;
00502 }
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/sky.h Source File

  • SysMgmt
  • MMC
  • Multisel

sky.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SKY_H
00021 #define _SKY_H
00022
00023 #include "DeleBase.h"
00024
00025 class CSkyBasedVehicle : public CDelegationBase {
00026 public:
00027     CSkyBasedVehicle() { }
00028
00029     virtual ~CSkyBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Sky-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_SKYICON; }
00034
00035 public:
00036     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00037     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions);
00038
00039 private:
00040     enum { IDM_NEW_SKY = 3 };
00041
00042     // {2974380F-4C4B-11d2-89D8-000021473128}
00043     static const GUID thisGuid;
00044 };
00045
00046
00047 #endif // _SKY_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFlipEditSession Member List

This is the complete list of members for CFlipEditSession, including all inherited members.
_pContext | CEditSessionBase | [protected]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CFlipEditSession(ITfContext *pContext) | CFlipEditSession | [inline]
DoEditSession(TfEditCookie ec) | CFlipEditSession | [virtual]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::SeekEnum Member List

This is the complete list of members for msado15::SeekEnum, including all inherited members.
adSeekAfter | msado15::SeekEnum | [static]
adSeekAfterEQ | msado15::SeekEnum | [static]
adSeekBefore | msado15::SeekEnum | [static]
adSeekBeforeEQ | msado15::SeekEnum | [static]
adSeekFirstEQ | msado15::SeekEnum | [static]
adSeekLastEQ | msado15::SeekEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/MyDevice.idl Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

MyDevice.idl

Go to the documentation of this file.
00001 // MyDevice.idl : IDL source for MyDevice.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (MyDevice.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009 /*
00010   [
00011     object,
00012     uuid(B620B328-B1ED-4205-8593-08C762C96562),
00013     dual,
00014     helpstring("IDimmer Interface"),
00015     pointer_default(unique)
00016   ]
00017   interface IDimmer : IDispatch
00018   {
00019   };
00020   [
00021     object,
00022     uuid(AEF464AB-75A6-4205-B143-72A43675863F),
00023     dual,
00024     helpstring("IDimmerService Interface"),
00025     pointer_default(unique)
00026   ]
00027   interface IDimmerService : IDispatch
00028   {
00029   };
00030 */
00031 [
00032   uuid(51AC2F4C-3F4F-48B3-A018-910E81677EEF),
00033   version(1.0),
00034   helpstring("MyDevice 1.0 Type Library")
00035 ]
00036 library MYDEVICELib
00037 {
00038   importlib("stdole32.tlb");
00039   importlib("stdole2.tlb");
00040
00041 typedef [v1_enum] enum DIMMINGSERVICE_SCPD_DISPIDS
00042 {
00043    DISPID_POWER = 1,
00044    DISPID_DIMLEVEL,
00045    DISPID_POWERON,
00046    DISPID_POWEROFF,
00047    DISPID_GETPOWERVALUE,
00048    DISPID_SETDIMLEVEL,
00049    DISPID_GETDIMLEVEL,
00050    DISPID_GETCONFIGDETAILS
00051
00052 } DIMMINGSERVICE_SCPD_DISPIDS;
00053
00054 [
00055    uuid(a315fcbd-7f4b-4081-a172-2f534c438957),
00056    oleautomation,
00057    pointer_default(unique)
00058 ]
00059 interface IUPnPService_DimmingService_SCPD : IDispatch {
00060   [propget, id(DISPID_POWER), helpstring("Property Power")]
00061   HRESULT Power(
00062     [out, retval] VARIANT_BOOL *pPower);
00063
00064   [propget, id(DISPID_DIMLEVEL), helpstring("Property dimLevel")]
00065   HRESULT dimLevel(
00066     [out, retval] long *pdimLevel);
00067
00068
00069   [ id(DISPID_POWERON), helpstring("Method PowerOn")]
00070   HRESULT PowerOn();
00071
00072   [ id(DISPID_POWEROFF), helpstring("Method PowerOff")]
00073   HRESULT PowerOff();
00074
00075   [ id(DISPID_GETPOWERVALUE), helpstring("Method GetPowerValue")]
00076   HRESULT GetPowerValue(
00077     [in, out] VARIANT_BOOL *ppowerVall);
00078
00079   [ id(DISPID_SETDIMLEVEL), helpstring("Method SetDimLevel")]
00080   HRESULT SetDimLevel(
00081     [in] long dLevel);
00082
00083   [ id(DISPID_GETDIMLEVEL), helpstring("Method GetDimLevel")]
00084   HRESULT GetDimLevel(
00085     [in, out] long *pdLevel);
00086
00087   [ id(DISPID_GETCONFIGDETAILS), helpstring("Method GetConfigDetails")]
00088   HRESULT GetConfigDetails(
00089     [in, out] VARIANT_BOOL *ppowerVal,
00090     [in, out] long *pdLevel);
00091 };
00092
00093   [
00094     //uuid(433B7962-88CD-48F3-B726-2187A48C7128),
00095     uuid(d31b8f49-367e-41b7-8fc4-50e23d36625d),
00096     helpstring("Dimmer Class")
00097   ]
00098   coclass Dimmer
00099   {
00100     [default] interface IUnknown;
00101   };
00102
00103 /*
00104   [
00105     uuid(67B046DD-6000-4122-9092-0706F1C7C4D8),
00106     helpstring("DimmerService Class")
00107   ]
00108   coclass DimmerService
00109   {
00110     [default] interface IDimmerService;
00111   };
00112 */
00113 };
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/localres.h Source File

  • SysMgmt
  • MMC
  • WMI

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CConnectionPointContainer Member List

This is the complete list of members for CConnectionPointContainer, including all inherited members.
CConnectionPointContainer() | CConnectionPointContainer | [protected]
EnumConnectionPoints(LPENUMCONNECTIONPOINTS *ppenum) | CConnectionPointContainer | [private, virtual]
FindConnectionPoint(REFIID id, LPCONNECTIONPOINT *ppCP) | CConnectionPointContainer | [private, virtual]
GetConnectionPoint(REFIID iid) | CConnectionPointContainer |
Init(EventID &events) | CConnectionPointContainer |
m_cCP | CConnectionPointContainer | [private]
m_cookie | CConnectionPointContainer | [private]
m_prgCP | CConnectionPointContainer | [private]
m_prgEventIID | CConnectionPointContainer | [private]
~CConnectionPointContainer() | CConnectionPointContainer | [protected, virtual]
Generated on Wed Nov 13 2024 16:55:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/Provider.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

Provider.Cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  Provider.cpp
00006 //
00007 // Description: Event consumer provider class implementation
00008 //
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include "stdafx.h"
00015 #include "Provider.h"
00016 #include "Consumer.h"
00017 #include <objbase.h>
00018
00019 CProvider::CProvider(CListBox *pOutputList)
00020 {
00021   m_cRef = 0L;
00022   m_pOutputList = pOutputList;
00023 }
00024
00025 CProvider::~CProvider()
00026 {
00027 }
00028
00029 STDMETHODIMP CProvider::QueryInterface(REFIID riid, LPVOID FAR *ppv)
00030 {
00031     *ppv=NULL;
00032
00033     if (riid == IID_IUnknown || riid == IID_IWbemEventConsumerProvider)
00034         *ppv=this;
00035
00036     if (*ppv != NULL)
00037     {
00038         ((LPUNKNOWN)*ppv)->AddRef();
00039         return NOERROR;
00040     }
00041
00042     return E_NOINTERFACE;
00043 }
00044
00045 STDMETHODIMP_(ULONG) CProvider::AddRef(void)
00046 {
00047     return ++m_cRef;
00048 }
00049
00050 STDMETHODIMP_(ULONG) CProvider::Release(void)
00051 {
00052     if (--m_cRef != 0L)
00053         return m_cRef;
00054
00055     delete this;
00056     return 0L;
00057 }
00058
00059 STDMETHODIMP CProvider::Initialize(LPWSTR wszUser, LONG lFlags,
00060                    LPWSTR wszNamespace, LPWSTR wszLocale,
00061                    IWbemServices __RPC_FAR *pNamespace,
00062                    IWbemContext __RPC_FAR *pCtx,
00063                    IWbemProviderInitSink __RPC_FAR *pInitSink)
00064 {
00065
00066     // Tell CIMOM that we are initialized
00067     pInitSink->SetStatus(WBEM_S_INITIALIZED, 0);
00068     return WBEM_S_NO_ERROR;
00069 }
00070
00071 //-----------------------------------------------------------
00072 STDMETHODIMP CProvider::FindConsumer(
00073             IWbemClassObject* pLogicalConsumer,
00074             IWbemUnboundObjectSink** ppConsumer)
00075 {
00076   CConsumer* pSink = new CConsumer(m_pOutputList);
00077   if (pSink)
00078   {
00079     return pSink->QueryInterface(IID_IWbemUnboundObjectSink,
00080                                         (void**)ppConsumer);
00081   }
00082    return WBEM_E_FAILED;
00083 }
00084
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/CascadeEC/cascade.h Source File

  • Com
  • Services
  • Events
  • EventNews
  • CascadeEC

cascade.h

Go to the documentation of this file.
00001 // Cascade.h : Declaration of the CCascade
00002
00003 #ifndef __CASCADE_H_
00004 #define __CASCADE_H_
00005
00006 #include "resource.h"       // main symbols
00007
00008 /////////////////////////////////////////////////////////////////////////////
00009 // CCascade
00010 class ATL_NO_VTABLE CCascade :
00011   public CComObjectRootEx<CComMultiThreadModel>,
00012   public CComCoClass<CCascade, &CLSID_CascadeEC>
00013 {
00014 public:
00015   CCascade()
00016   {
00017   }
00018
00019 DECLARE_REGISTRY_RESOURCEID(IDR_CASCADE)
00020
00021 DECLARE_PROTECT_FINAL_CONSTRUCT()
00022
00023 BEGIN_COM_MAP(CCascade)
00024 END_COM_MAP()
00025
00026 // ICascade
00027 public:
00028 };
00029
00030 #endif //__CASCADE_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/TextFx/TextFx.c Source File

  • Multimedia
  • Gdi
  • TextFx

TextFx.c

Go to the documentation of this file.
00001 /*****************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1992 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \*****************************************************************************/
00010 /*****************************************************************************
00011  *                                       *
00012  *   PROGRAM: TextFX.c                             *
00013  *                                       *
00014  *   PURPOSE: TextFX template for Windows applications             *
00015  *                                       *
00016  *   FUNCTIONS:                                *
00017  *                                       *
00018  *   GetLastErrorBox() - Report GetLastError() values as text                *
00019  *   WinMain() - calls initialization function, processes message loop     *
00020  *   InitApplication() - initializes window data and registers window    *
00021  *   InitInstance() - saves instance handle and creates main window      *
00022  *   WndProc() - processes messages                      *
00023  *   CenterWindow() - used to center the "About" box over application window *
00024  *   About() - processes messages for "About" dialog box           *
00025  *                                       *
00026  *   COMMENTS:                                 *
00027  *****************************************************************************/
00028
00029 #include <windows.h>   // required for all Windows applications
00030 #include "resource.h"  // specific to this program
00031 #include <time.h>
00032 #include "textfx.h"    // specific to this program
00033 #include "guide.h"
00034 #include "fx.h"
00035
00036 #define QUICKTESTPOINTS 2      // Number of points to use for Quick Test
00037
00038 HINSTANCE hInst;       // current instance
00039
00040 char szAppName[] = "TextFX";   // The name of this application
00041 char szTitle[]   = "TextFX Test Application"; // The title bar text
00042
00043 // Random number stuff for generating random points for "Quick Test" option
00044 #define random(i) (rand() % (i))
00045
00046 #define FONTNAME "arial"
00047
00048 /**********************************************************************
00049  *                                                                    *
00050  * FUNCTION:  GetLastErrorBox(HWND, LPSTR)                            *
00051  *                                    *
00052  * PURPOSE:   Gets the error status and, if an error is indicated,    *
00053  *            converts the error number into text and displays it     *
00054  *            in a MessageBox.                                        *
00055  *                                                                    *
00056  *********************************************************************/
00057 DWORD GetLastErrorBox(HWND hWnd, LPSTR lpTitle)
00058 {
00059    LPVOID lpv;
00060    DWORD  dwRv;
00061
00062    if (GetLastError() == 0) return 0;
00063
00064    dwRv = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
00065                         FORMAT_MESSAGE_FROM_SYSTEM,
00066                         NULL,
00067                         GetLastError(),
00068                         MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
00069                         (LPVOID)&lpv,
00070                         0,
00071                         NULL);
00072
00073    MessageBox(hWnd, lpv, lpTitle, MB_OK);
00074
00075    if(dwRv)
00076       LocalFree(lpv);
00077
00078    SetLastError(0);
00079    return dwRv;
00080 }
00081
00082 /*****************************************************************************
00083  *                                       *
00084  * FUNCTION: WinMain(HINSTANCE, HINSTANCE, LPSTR, int)             *
00085  *                                       *
00086  * PURPOSE: calls initialization function, processes message loop      *
00087  *                                       *
00088  * COMMENTS:                                 *
00089  *                                       *
00090  *    Windows recognizes this function by name as the initial entry point  *
00091  *    for the program.  This function calls the application initialization   *
00092  *    routine, if no other instance of the program is running, and always  *
00093  *    calls the instance initialization routine.  It then executes a message *
00094  *    retrieval and dispatch loop that is the top-level control structure  *
00095  *    for the remainder of execution.  The loop is terminated when a WM_QUIT *
00096  *    message is received, at which time this function exits the application *
00097  *    instance by returning the value passed by PostQuitMessage().       *
00098  *                                       *
00099  *    If this function must abort before entering the message loop, it     *
00100  *    returns the conventional value NULL.                   *
00101  *                                       *
00102  ****************************************************************************/
00103 int APIENTRY WinMain(
00104         HINSTANCE hInstance,
00105         HINSTANCE hPrevInstance,
00106         LPSTR lpCmdLine,
00107         int nCmdShow)
00108 {
00109     MSG msg;
00110     HANDLE hAccelTable;
00111   LONG lTime;
00112
00113   // Just for fun, lets seed the random number generator
00114   time(&lTime);
00115     srand(lTime);
00116
00117
00118     if (!hPrevInstance) {       // Other instances of app running?
00119             if (!InitApplication(hInstance)) { // Initialize shared things
00120             return (FALSE);     // Exits if unable to initialize
00121         }
00122     }
00123
00124     /* Perform initializations that apply to a specific instance */
00125
00126     if (!InitInstance(hInstance, nCmdShow)) {
00127             return (FALSE);
00128     }
00129
00130     hAccelTable = LoadAccelerators (hInstance, "TEXTFXACCEL");
00131
00132     /* Acquire and dispatch messages until a WM_QUIT message is received. */
00133
00134     while (GetMessage(&msg, // message structure
00135        NULL,   // handle of window receiving the message
00136        0,      // lowest message to examine
00137        0))     // highest message to examine
00138     {
00139         if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) {
00140             TranslateMessage(&msg);// Translates virtual key codes
00141             DispatchMessage(&msg); // Dispatches message to window
00142         }
00143     }
00144
00145     return (int)(msg.wParam); // Returns the value from PostQuitMessage
00146
00147     UNREFERENCED_PARAMETER(lpCmdLine); // This will prevent 'unused formal parameter' warnings
00148 }
00149
00150
00151 /*****************************************************************************
00152  *                                       *
00153  *  FUNCTION: InitApplication(HINSTANCE)                   *
00154  *                                       *
00155  *  PURPOSE: Initializes window data and registers window class        *
00156  *                                       *
00157  *  COMMENTS:                                *
00158  *                                       *
00159  *    This function is called at initialization time only if no other    *
00160  *    instances of the application are running.  This function performs      *
00161  *    initialization tasks that can be done once for any number of running   *
00162  *    instances.                               *
00163  *                                       *
00164  *    In this case, we initialize a window class by filling out a data     *
00165  *    structure of type WNDCLASS and calling the Windows RegisterClass()   *
00166  *    function.  Since all instances of this application use the same window *
00167  *    class, we only need to do this when the first instance is initialized. *
00168  *                                       *
00169  *****************************************************************************/
00170 BOOL InitApplication(HINSTANCE hInstance)
00171 {
00172     WNDCLASS  wc;
00173
00174     // Fill in window class structure with parameters that describe the
00175     // main window.
00176
00177     wc.style         = CS_OWNDC;               // Class style(s).
00178     wc.lpfnWndProc   = (WNDPROC)WndProc;       // Window Procedure
00179     wc.cbClsExtra    = 0;                      // No per-class extra data.
00180     wc.cbWndExtra    = 0;                      // No per-window extra data.
00181     wc.hInstance     = hInstance;              // Owner of this class
00182     wc.hIcon         = LoadIcon (hInstance, szAppName); // Icon name from .RC
00183     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);// Cursor
00184     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);// Default color
00185     wc.lpszMenuName  = "TEXTFXMENU";           // Menu name from .RC
00186     wc.lpszClassName = szAppName;              // Name to register as
00187
00188     // Register the window class and return success/failure code.
00189     return (RegisterClass(&wc));
00190 }
00191
00192
00193 /*****************************************************************************
00194  *                                       *
00195  *   FUNCTION:  InitInstance(HINSTANCE, int)                 *
00196  *                                       *
00197  *   PURPOSE:  Saves instance handle and creates main window         *
00198  *                                       *
00199  *   COMMENTS:                                 *
00200  *                                       *
00201  *      This function is called at initialization time for every instance of *
00202  *      this application.  This function performs initialization tasks that  *
00203  *      cannot be shared by multiple instances.                *
00204  *                                       *
00205  *      In this case, we save the instance handle in a static variable and   *
00206  *      create and display the main program window.              *
00207  *                                       *
00208  ****************************************************************************/
00209 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
00210 {
00211     HWND            hWnd; // Main window handle.
00212
00213     // Save the instance handle in static variable, which will be used in
00214     // many subsequence calls from this application to Windows.
00215
00216     hInst = hInstance; // Store instance handle in our global variable
00217
00218     // Create a main window for this application instance.
00219
00220     hWnd = CreateWindow(
00221             szAppName,           // See RegisterClass() call.
00222             szTitle,             // Text for window title bar.
00223             WS_OVERLAPPEDWINDOW,// Window style.
00224             CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, // Use default positioning
00225             NULL,                // Overlapped windows have no parent.
00226             NULL,                // Use the window class menu.
00227             hInstance,           // This instance owns this window.
00228             NULL                 // We don't use any data in our WM_CREATE
00229     );
00230
00231     // If window could not be created, return "failure"
00232     if (!hWnd) {
00233             return (FALSE);
00234     }
00235
00236     // Make the window visible; update its client area; and return "success"
00237     ShowWindow(hWnd, nCmdShow); // Show the window
00238     UpdateWindow(hWnd);         // Sends WM_PAINT message
00239
00240     return (TRUE);              // We succeeded...
00241
00242 }
00243
00244
00245 /*****************************************************************************
00246  *                                       *
00247  *   FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)               *
00248  *                                       *
00249  *   PURPOSE:  Processes messages                      *
00250  *                                       *
00251  *   MESSAGES:                                 *
00252  *                                       *
00253  *   WM_COMMAND    - application menu (About dialog box)           *
00254  *   WM_DESTROY    - destroy window                      *
00255  *                                       *
00256  *   COMMENTS:                                 *
00257  *                                       *
00258  *   To process the IDM_ABOUT message, call MakeProcInstance() to get the  *
00259  *   current instance address of the About() function.  Then call Dialog   *
00260  *   box which will create the box according to the information in your    *
00261  *   TextFX.rc file and turn control over to the About() function.  When   *
00262  *   it returns, free the intance address.                   *
00263  *                                       *
00264  ****************************************************************************/
00265 LRESULT CALLBACK WndProc(
00266                 HWND hWnd,         // window handle
00267                 UINT message,      // type of message
00268                 WPARAM uParam,     // additional information
00269                 LPARAM lParam)     // additional information
00270 {
00271   int wmId, wmEvent;
00272     static BOOL bOn = TRUE;  // Which guide line (top = TRUE) are we on?
00273     static LPPOINT lpTop = NULL;
00274   static LPPOINT lpBot = NULL;
00275     static DWORD dwTop = 0;
00276   static DWORD dwBot = 0;
00277   static BOOL bOutlineOnly = FALSE;
00278   static BOOL bShowGuides  = FALSE;
00279     static HPEN hpenBlue, hpenRed;
00280
00281   SetLastError(0); // Set error flag to "no errors"
00282
00283   switch (message) {
00284       case WM_CREATE:  // Select an big Arial font into our DC
00285         {
00286           HDC hDC = GetDC(hWnd);
00287                 LOGFONT lf;
00288         HFONT hf;
00289
00290         ZeroMemory(&lf, sizeof(LOGFONT));
00291           lf.lfHeight = -72;    // Big fonts scale better
00292             lstrcpyn((LPSTR)&(lf.lfFaceName), FONTNAME, lstrlen(FONTNAME)+1);
00293
00294           // Create and select the font
00295           hf = CreateFontIndirect(&lf);
00296           SelectObject(hDC, hf);
00297
00298         hpenBlue = CreatePen(PS_SOLID, 1, RGB(0,0,255));
00299         hpenRed  = CreatePen(PS_SOLID, 1, RGB(255,0,0));
00300       }
00301
00302       GetLastErrorBox(hWnd, "Error in WM_CREATE");
00303       break;
00304
00305     case WM_PAINT:
00306             {
00307          PAINTSTRUCT ps;
00308          HDC hDC = BeginPaint(hWnd, &ps);
00309                RECT rect;
00310
00311          // Clear the client area
00312                GetClientRect(hWnd, &rect);
00313                PatBlt(hDC, 0, 0, rect.right, rect.bottom, WHITENESS);
00314
00315
00316            // If we have something to show...
00317            if (dwTop && dwBot) {
00318
00319              // Show the top guide line if we have one and the user wants to
00320              if (dwTop && bShowGuides) {
00321                      SelectObject(hDC, hpenBlue);
00322                      ShowGuide(hDC, lpTop, dwTop);
00323                      SelectObject(hDC, GetStockObject(BLACK_PEN));
00324                    }
00325
00326              // If we have a bottom guide line
00327              if (dwBot) {
00328
00329                    // ...then show it if the use wants to
00330                    if (bShowGuides) {
00331                      SelectObject(hDC, hpenRed);
00332                          ShowGuide(hDC, lpBot, dwBot);
00333                    SelectObject(hDC, GetStockObject(BLACK_PEN));
00334                        }
00335
00336                    // Do the mapping and show the text
00337                    TextEffect(hDC, lpTop, lpBot, dwTop, dwBot, "This is a test", bOutlineOnly);
00338                    }
00339                }
00340
00341                EndPaint(hWnd, &ps);
00342       }
00343             break;
00344
00345     case WM_LBUTTONDOWN: // Read a guide line from the user
00346             {
00347                HDC hDC = GetDC(hWnd);
00348                RECT rect;
00349
00350                if (bOn) {
00351                    GetClientRect(hWnd, &rect);
00352
00353                    // Clear the screen
00354                    PatBlt(hDC, 0, 0, rect.right, rect.bottom, WHITENESS);
00355
00356                    // Get rid of the previous guide lines
00357                    if (lpTop)
00358                      GlobalFree(lpTop);
00359                    if (lpBot)
00360                      GlobalFree(lpBot);
00361              dwBot = 0;
00362
00363            SelectObject(hDC, hpenBlue);  // Top guide line is blue
00364                    GetGuideLine(hWnd, &lpTop, &dwTop);
00365                }
00366                else {
00367                    SelectObject(hDC, hpenRed);  // Bottom guide line is red
00368                    GetGuideLine(hWnd, &lpBot, &dwBot);
00369                }
00370
00371                // Black as night, black as coal, I want to see the sun blotted out from the sky...
00372                SelectObject(hDC, GetStockObject(BLACK_PEN));
00373                bOn = !bOn;
00374
00375          if (bOn) {
00376
00377                   // Expand the line segment into points
00378                 FillOut(&lpTop, &dwTop);
00379                   FillOut(&lpBot, &dwBot);
00380
00381                   InvalidateRect(hWnd, NULL, FALSE);  // Draw the text via WM_PAINT
00382                }
00383             }
00384
00385       GetLastErrorBox(hWnd, "Error in WM_LBUTTONDOWN");
00386             break;
00387
00388         case WM_COMMAND:
00389             wmId    = LOWORD(uParam);
00390             wmEvent = HIWORD(uParam);
00391
00392             switch (wmId) {
00393         case IDM_QUICKTEST:  // Randomly generate guide lines
00394             {
00395             RECT rect;
00396             int i;
00397
00398             bOn = TRUE;  // Reset to top guide line
00399
00400             GetClientRect(hWnd, &rect);
00401             if (dwTop)
00402               GlobalFree(lpTop);
00403             if (dwBot)
00404               GlobalFree(lpBot);
00405
00406             // Allocate top guide line
00407             lpTop = (LPPOINT)GlobalAlloc(GPTR, sizeof(POINT) * QUICKTESTPOINTS);
00408             if (!lpTop) break;
00409
00410             // Allocate bottom guide line
00411             lpBot = (LPPOINT)GlobalAlloc(GPTR, sizeof(POINT) * QUICKTESTPOINTS);
00412             if (!lpBot) {
00413               GlobalFree(lpTop);
00414             break;
00415             }
00416
00417             // Generate points
00418             for (i=0; i<QUICKTESTPOINTS; i++) {
00419               lpTop[i].x = random(rect.right);
00420                         lpTop[i].y = random(rect.bottom);
00421             lpBot[i].x = random(rect.right);
00422                         lpBot[i].y = random(rect.bottom);
00423             }
00424
00425             // Set number of points for top and bottom lines
00426             dwTop = QUICKTESTPOINTS;
00427             dwBot = QUICKTESTPOINTS;
00428
00429             // Expand the line segment into points
00430                   FillOut(&lpTop, &dwTop);
00431                       FillOut(&lpBot, &dwBot);
00432
00433                 InvalidateRect(hWnd, NULL, FALSE);  // Draw the text via WM_PAINT
00434           }
00435
00436           GetLastErrorBox(hWnd, "Error in IDM_QUICKTEST");
00437           break;
00438
00439               case IDM_CHOOSEFONT: // Let the user pick a font
00440           {
00441              HDC hDC = GetDC(hWnd);
00442                        HFONT hf;
00443              LOGFONT lf;
00444              CHOOSEFONT cf;
00445
00446                ZeroMemory(&cf, sizeof(cf));
00447              ZeroMemory(&lf, sizeof(lf));
00448
00449              cf.lStructSize = sizeof(CHOOSEFONT);
00450              cf.lpLogFont = &lf;
00451                        cf.Flags = CF_SCREENFONTS | CF_TTONLY;
00452
00453              if (ChooseFont(&cf)) {
00454                            lf.lfHeight = -72;    // Bigger fonts look better
00455                  hf = CreateFontIndirect(&lf);
00456                            DeleteObject(SelectObject(hDC, hf));
00457              }
00458               }
00459
00460               // If we have text to show then re-render it
00461           if (dwTop && dwBot)
00462             InvalidateRect(hWnd, NULL, FALSE);  // Draw the text via WM_PAINT
00463
00464           GetLastErrorBox(hWnd, "Error in IDM_CHOOSEFONT");
00465               break;
00466
00467         case IDM_SHOWGUIDES:  // User toggled guide display
00468                     bShowGuides = !bShowGuides;
00469                     CheckMenuItem(GetMenu(hWnd), IDM_SHOWGUIDES, bShowGuides ? MF_CHECKED : MF_UNCHECKED);
00470
00471           // If we have text to show then re-render it
00472           if (dwTop && dwBot)
00473             InvalidateRect(hWnd, NULL, FALSE);  // Draw the text via WM_PAINT
00474
00475           GetLastErrorBox(hWnd, "Error in IDM_SHOWGUIDES");
00476                     break;
00477
00478         case IDM_OUTLINE:   // User toggled display of text as outline
00479                     bOutlineOnly = !bOutlineOnly;
00480                     CheckMenuItem(GetMenu(hWnd), IDM_OUTLINE, bOutlineOnly ? MF_CHECKED : MF_UNCHECKED);
00481
00482           // If we have text to show then re-render it
00483           if (dwTop && dwBot)
00484             InvalidateRect(hWnd, NULL, FALSE);  // Draw the text via WM_PAINT
00485
00486           GetLastErrorBox(hWnd, "Error in IDM_OUTLINE");
00487                     break;
00488
00489                 case IDM_ABOUT:
00490                     DialogBox(hInst,          // current instance
00491                              "ABOUTBOX",      // dlg resource to use
00492                              hWnd,            // parent handle
00493                              (DLGPROC)About); // About() instance address
00494
00495                     break;
00496
00497
00498                 case IDM_EXIT:
00499           DestroyWindow (hWnd);
00500                     break;
00501
00502                 default:
00503                     return (DefWindowProc(hWnd, message, uParam, lParam));
00504             }
00505             break;
00506
00507         case WM_DESTROY:  // message: window being destroyed
00508                 if (lpTop) GlobalFree(lpTop);
00509         if (lpBot) GlobalFree(lpBot);
00510
00511                 PostQuitMessage(0);
00512                 break;
00513
00514         default:          // Passes it on if unproccessed
00515                 return (DefWindowProc(hWnd, message, uParam, lParam));
00516   }
00517   return (0);
00518 }
00519
00520 /*****************************************************************************
00521  *                                       *
00522  *   FUNCTION: CenterWindow (HWND, HWND)                   *
00523  *                                       *
00524  *   PURPOSE:  Center one window over another                *
00525  *                                       *
00526  *   COMMENTS:                                 *
00527  *                                       *
00528  *   Dialog boxes take on the screen position that they were designed at,  *
00529  *   which is not always appropriate. Centering the dialog over a particular *
00530  *   window usually results in a better position.              *
00531  *                                       *
00532  ****************************************************************************/
00533
00534 BOOL CenterWindow (HWND hwndChild, HWND hwndParent)
00535 {
00536         RECT    rChild, rParent;
00537         int     wChild, hChild, wParent, hParent;
00538         int     wScreen, hScreen, xNew, yNew;
00539         HDC     hdc;
00540
00541         // Get the Height and Width of the child window
00542         GetWindowRect (hwndChild, &rChild);
00543         wChild = rChild.right - rChild.left;
00544         hChild = rChild.bottom - rChild.top;
00545
00546         // Get the Height and Width of the parent window
00547         GetWindowRect (hwndParent, &rParent);
00548         wParent = rParent.right - rParent.left;
00549         hParent = rParent.bottom - rParent.top;
00550
00551         // Get the display limits
00552         hdc = GetDC (hwndChild);
00553         wScreen = GetDeviceCaps (hdc, HORZRES);
00554         hScreen = GetDeviceCaps (hdc, VERTRES);
00555         ReleaseDC (hwndChild, hdc);
00556
00557         // Calculate new X position, then adjust for screen
00558         xNew = rParent.left + ((wParent - wChild) /2);
00559         if (xNew < 0) {
00560                 xNew = 0;
00561         } else if ((xNew+wChild) > wScreen) {
00562                 xNew = wScreen - wChild;
00563         }
00564
00565         // Calculate new Y position, then adjust for screen
00566         yNew = rParent.top  + ((hParent - hChild) /2);
00567         if (yNew < 0) {
00568                 yNew = 0;
00569         } else if ((yNew+hChild) > hScreen) {
00570                 yNew = hScreen - hChild;
00571         }
00572
00573         // Set it, and return
00574         return SetWindowPos (hwndChild, NULL,
00575                 xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
00576 }
00577
00578
00579 /*****************************************************************************
00580  *                                       *
00581  *   FUNCTION: About(HWND, UINT, WPARAM, LPARAM)               *
00582  *                                       *
00583  *   PURPOSE:  Processes messages for "About" dialog box           *
00584  *                                       *
00585  *   MESSAGES:                                 *
00586  *                                       *
00587  *   WM_INITDIALOG - initialize dialog box                   *
00588  *   WM_COMMAND    - Input received                      *
00589  *                                       *
00590  *   COMMENTS:                                 *
00591  *                                       *
00592  *   Display version information from the version section of the       *
00593  *   application resource.                           *
00594  *                                       *
00595  *   Wait for user to click on "Ok" button, then close the dialog box.     *
00596  *                                       *
00597  ****************************************************************************/
00598
00599 LRESULT CALLBACK About(
00600                 HWND hDlg,           // window handle of the dialog box
00601                 UINT message,        // type of message
00602                 WPARAM uParam,       // message-specific information
00603                 LPARAM lParam)
00604 {
00605     switch (message) {
00606         case WM_INITDIALOG:  // message: initialize dialog box
00607             // Center the dialog over the application window
00608             CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
00609             return (TRUE);
00610
00611         case WM_COMMAND:                      // message: received a command
00612             if (LOWORD(uParam) == IDOK || LOWORD(uParam) == IDCANCEL) {
00613                 EndDialog(hDlg, TRUE);        // Exit the dialog
00614                 return (TRUE);
00615             }
00616             break;
00617     }
00618     return (FALSE); // Didn't process the message
00619
00620     UNREFERENCED_PARAMETER(lParam); // This will prevent 'unused formal parameter' warnings
00621 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/DrawDlg.Cpp Source File

  • NetDS
  • MessageQueuing
  • c_draw

DrawDlg.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // drawdlg.cpp : implementation file
00013 //
00014 //
00015
00016 #include "stdafx.h"
00017 #include "disdraw.h"
00018 #include "drawdlg.h"
00019
00020 #ifdef _DEBUG
00021 #define new DEBUG_NEW
00022 #undef THIS_FILE
00023 static char THIS_FILE[] = __FILE__;
00024 #endif
00025
00026 #define MAX_FORMAT_NAME_LEN 256
00027
00028 #define MAX_VAR       20
00029
00030
00031 //
00032 // Distributed drawing queue type.
00033 //
00034 CLSID guidDrawType =
00035 { 0x151ceac0, 0xacb5, 0x11cf, { 0x8b, 0x51, 0x00, 0x20, 0xaf, 0x92, 0x95, 0x46 } };
00036
00037 /////////////////////////////////////////////////////////////////////////////
00038 // CDisdrawDlg dialog
00039
00040 CDisdrawDlg::CDisdrawDlg(CWnd* pParent /*=NULL*/)
00041   : CDialog(CDisdrawDlg::IDD, pParent)
00042 {
00043   //{{AFX_DATA_INIT(CDisdrawDlg)
00044   m_strFriend = _T("");
00045   m_iDelivery = 0;
00046   m_iRadioDS = 0;
00047   m_strRemoteComputerName = _T("");
00048   //}}AFX_DATA_INIT
00049   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
00050   m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
00051 }
00052
00053 void CDisdrawDlg::DoDataExchange(CDataExchange* pDX)
00054 {
00055   CDialog::DoDataExchange(pDX);
00056   //{{AFX_DATA_MAP(CDisdrawDlg)
00057   DDX_Control(pDX, IDC_STATIC_C_LABEL, m_cComputerLabel);
00058   DDX_Control(pDX, IDCANCEL, m_CancelButton);
00059   DDX_Control(pDX, IDC_STATIC_Q_LABEL, m_cQueueLabel);
00060   DDX_Control(pDX, IDC_STATIC_CHOOSE_MESSAGE, m_cMessageFrame);
00061   DDX_Control(pDX, IDC_STATIC_CHOOSE_DS, m_cDsFrame);
00062   DDX_Control(pDX, IDC_RADIO_EXPRESS, m_cRadioExpress);
00063   DDX_Control(pDX, IDC_RADIO_DS, m_cRadioDS);
00064   DDX_Control(pDX, IDC_EDIT_FRIEND_COMPUTER, m_cComputerInput);
00065   DDX_Control(pDX, IDC_EDIT_FRIEND, m_cQueueInput);
00066   DDX_Control(pDX, IDC_CONTINUE, m_cContinueButton);
00067   DDX_Control(pDX, IDC_DRAWAREA_SCRIBLLE, m_drawScribble);
00068   DDX_Control(pDX, IDC_BUTTON_ATTACH, m_btnAttach);
00069   DDX_Text(pDX, IDC_EDIT_FRIEND, m_strFriend);
00070   DDV_MaxChars(pDX, m_strFriend, 50);
00071   DDX_Radio(pDX, IDC_RADIO_EXPRESS, m_iDelivery);
00072   DDX_Radio(pDX, IDC_RADIO_DS, m_iRadioDS);
00073   DDX_Text(pDX, IDC_EDIT_FRIEND_COMPUTER, m_strRemoteComputerName);
00074   DDV_MaxChars(pDX, m_strRemoteComputerName, 50);
00075     DDX_Control(pDX, IDC_RADIO_WORKGROUP, m_cRadioWorkgroup);
00076     DDX_Control(pDX, IDC_RADIO_RECOVERABLE, m_cRadioRecoverable);
00077   //}}AFX_DATA_MAP
00078
00079
00080 }
00081
00082 BEGIN_MESSAGE_MAP(CDisdrawDlg, CDialog)
00083   //{{AFX_MSG_MAP(CDisdrawDlg)
00084   ON_WM_PAINT()
00085   ON_WM_QUERYDRAGICON()
00086   ON_BN_CLICKED(IDC_BUTTON_ATTACH, OnButtonAttach)
00087   ON_EN_CHANGE(IDC_EDIT_FRIEND, OnChangeEditFriend)
00088   ON_WM_CLOSE()
00089   ON_BN_CLICKED(IDC_CONTINUE, OnConnect)
00090   ON_EN_CHANGE(IDC_EDIT_FRIEND_COMPUTER, OnChangeEditFriendComputer)
00091   //}}AFX_MSG_MAP
00092 END_MESSAGE_MAP()
00093
00094 /////////////////////////////////////////////////////////////////////////////
00095 // CDisdrawDlg message handlers
00096
00097
00098 BOOL LocateQueue(CString m_strLabel, WCHAR *wcsFormatName, DWORD dwNumChars)
00099 {
00100   //
00101   // Set restrictions to locate the drawing queue with the label specified.
00102   //
00103   DWORD cProps = 0;
00104   MQPROPERTYRESTRICTION aPropRestriction[2];
00105   MQRESTRICTION Restriction;
00106
00107   aPropRestriction[cProps].rel           = PREQ;
00108   aPropRestriction[cProps].prop          = PROPID_Q_TYPE;
00109   aPropRestriction[cProps].prval.vt      = VT_CLSID;
00110   aPropRestriction[cProps].prval.puuid   = &guidDrawType;
00111   cProps++;
00112
00113   WCHAR wcsLabel[MQ_MAX_Q_LABEL_LEN];
00114   mbstowcs(wcsLabel, m_strLabel, MQ_MAX_Q_LABEL_LEN);
00115   aPropRestriction[cProps].rel           = PREQ;
00116   aPropRestriction[cProps].prop          = PROPID_Q_LABEL;
00117   aPropRestriction[cProps].prval.vt      = VT_LPWSTR;
00118   aPropRestriction[cProps].prval.pwszVal = wcsLabel;
00119   cProps++;
00120
00121   Restriction.cRes = cProps;
00122   Restriction.paPropRes = aPropRestriction;
00123
00124
00125   //
00126   // Request the queue instance for the queue specified.
00127   //
00128   cProps = 0;
00129   QUEUEPROPID aPropId[1];
00130   MQCOLUMNSET Column;
00131
00132   aPropId[cProps] = PROPID_Q_INSTANCE;
00133   cProps++;
00134
00135   Column.cCol = cProps;
00136   Column.aCol = aPropId;
00137
00138
00139   //
00140   // Locate the queue specified.
00141   //
00142   HANDLE hEnum;
00143   BOOL fFound = FALSE;
00144   HRESULT hr = MQLocateBegin(NULL, &Restriction, &Column, NULL, &hEnum);
00145   if (!FAILED(hr))
00146   {
00147       MQPROPVARIANT aPropVar[1];
00148     DWORD cQueue = 1;
00149     hr = MQLocateNext(hEnum, &cQueue, aPropVar);
00150     if (!FAILED(hr) && cQueue > 0)
00151     {
00152       //
00153       // Obtain the format name for the queue located.
00154       //
00155       hr = MQInstanceToFormatName(aPropVar[0].puuid, wcsFormatName, &dwNumChars);
00156             MQFreeMemory(aPropVar[0].puuid);
00157       if (!FAILED(hr))
00158         fFound = TRUE;
00159     }
00160
00161     MQLocateEnd(hEnum);
00162   }
00163
00164
00165     return fFound;
00166 }
00167
00168
00169 BOOL CDisdrawDlg::OpenReceiveQueue()
00170 {
00171     //
00172     // Do not create the receiving queue if it already exists in the enterprise.
00173     //
00174     HRESULT hr;
00175   WCHAR wcsFormatName[MAX_FORMAT_NAME_LEN];
00176     if (!LocateQueue(m_strLogin, wcsFormatName, MAX_FORMAT_NAME_LEN))
00177     {
00178       //
00179       // Form the pathname of the receiving queue.
00180       //
00181       char mbsPathName[MQ_MAX_Q_NAME_LEN];
00182       DWORD dwNumChars = MQ_MAX_Q_NAME_LEN;
00183       GetComputerName(mbsPathName, &dwNumChars);
00184     strcat(mbsPathName, "\\");
00185     strcat(mbsPathName, m_strLogin);
00186
00187
00188       //
00189       // Prepare the receiving queue properties.
00190       //
00191       DWORD cProps = 0;
00192       QUEUEPROPID  aPropId[3];
00193       MQPROPVARIANT aPropVar[3];
00194       MQQUEUEPROPS propsQueue;
00195
00196     WCHAR wcsPathName[MQ_MAX_Q_NAME_LEN];
00197     mbstowcs(wcsPathName, mbsPathName, MQ_MAX_Q_NAME_LEN);
00198       aPropId[cProps]      = PROPID_Q_PATHNAME;
00199       aPropVar[cProps].vt    = VT_LPWSTR;
00200       aPropVar[cProps].pwszVal = wcsPathName;
00201       cProps++;
00202
00203       aPropId[cProps]      = PROPID_Q_TYPE;
00204       aPropVar[cProps].vt    = VT_CLSID;
00205       aPropVar[cProps].puuid   = &guidDrawType;
00206       cProps++;
00207
00208     WCHAR wcsLabel[MQ_MAX_Q_LABEL_LEN];
00209     mbstowcs(wcsLabel, m_strLogin, MQ_MAX_Q_LABEL_LEN);
00210       aPropId[cProps]      = PROPID_Q_LABEL;
00211       aPropVar[cProps].vt    = VT_LPWSTR;
00212       aPropVar[cProps].pwszVal = wcsLabel;
00213       cProps++;
00214
00215       propsQueue.cProp  = cProps;
00216       propsQueue.aPropID  = aPropId;
00217       propsQueue.aPropVar = aPropVar;
00218       propsQueue.aStatus  = NULL;
00219
00220
00221       //
00222       // Create the receiving queue.
00223       //
00224       dwNumChars = MAX_FORMAT_NAME_LEN;
00225       hr = MQCreateQueue(NULL, &propsQueue, wcsFormatName, &dwNumChars);
00226
00227
00228       //
00229       // If the receiving queue already exists, obtain its format name.
00230       //
00231       if (hr == MQ_ERROR_QUEUE_EXISTS)
00232         hr = MQPathNameToFormatName(wcsPathName, wcsFormatName, &dwNumChars);
00233
00234       if (FAILED(hr))
00235         return FALSE;
00236     }
00237
00238   //
00239   // Open the receiving queue (it may be necessary to retry due to replication latency).
00240   //
00241     int iCount = 0;
00242   while ((hr = MQOpenQueue(wcsFormatName,
00243                              MQ_RECEIVE_ACCESS,
00244                              MQ_DENY_NONE ,
00245                              &m_hqIncoming)) == MQ_ERROR_QUEUE_NOT_FOUND)
00246     {
00247
00248         Sleep (500);
00249         iCount++;
00250         if (iCount >=30)
00251         {
00252             //
00253             // A period of 15 seconds past without locating the queue.
00254             // We allow the user to stop attempts to open the queue.
00255             //
00256             int iRes = MessageBox("The receiving queue was not located.\nDo you want to continue searching?",
00257                                 NULL,
00258                                 MB_YESNO);
00259             if(iRes == IDYES)
00260             {
00261                 //
00262                 // Continue searching.
00263                 //
00264                 iCount =0;
00265             }
00266             else
00267             {
00268                 //
00269                 // Stop searching.
00270                 //
00271                 break;
00272             }
00273         }
00274     }
00275
00276   if (FAILED(hr))
00277     return FALSE;
00278
00279
00280   return TRUE;
00281 }
00282
00283
00284 DWORD ReceiveUpdates(CDisdrawDlg *pDrawDlg)
00285 {
00286     //
00287   // Prepare the message properties to receive.
00288   //
00289   DWORD cProps = 0;
00290   MQMSGPROPS    propsMessage;
00291   MQPROPVARIANT aPropVar[2];
00292   MSGPROPID     aPropId[2];
00293
00294   WCHAR wcsBody[MAX_MSG_BODY_LEN];
00295   aPropId[cProps]       = PROPID_M_BODY;
00296   aPropVar[cProps].vt     = VT_UI1 | VT_VECTOR;
00297   aPropVar[cProps].caub.cElems = sizeof(wcsBody);
00298   aPropVar[cProps].caub.pElems = (UCHAR *)wcsBody;
00299   cProps++;
00300
00301     aPropId[cProps]       = PROPID_M_BODY_SIZE;
00302   aPropVar[cProps].vt     = VT_UI4;
00303   cProps++;
00304
00305   propsMessage.cProp    = cProps;
00306   propsMessage.aPropID  = aPropId;
00307   propsMessage.aPropVar = aPropVar;
00308   propsMessage.aStatus  = NULL;
00309
00310
00311     //
00312     // Keep receiving updates sent to the incoming queue.
00313     //
00314     HRESULT hr;
00315     LINE line;
00316   char mbsBody[MAX_MSG_BODY_LEN + 1];
00317
00318     while (TRUE)
00319     {
00320         //
00321         // Synchronously receive a message from the incoming queue.
00322         //
00323         hr = MQReceiveMessage(pDrawDlg->m_hqIncoming, INFINITE,
00324                               MQ_ACTION_RECEIVE, &propsMessage,
00325                 NULL, NULL, NULL, NULL);
00326
00327     //
00328     // Determine if the message contains a keystroke or a line.
00329     //
00330         if (!FAILED(hr))
00331         {
00332       //
00333       // Convert the body to a multibyte null-terminated string.
00334       //
00335             UINT uNumChars = aPropVar[1].ulVal/sizeof(WCHAR);
00336       wcstombs(mbsBody, wcsBody, uNumChars);
00337       mbsBody[uNumChars] = '\0';
00338
00339       //
00340       // Add the keystroke to the drawing.
00341       //
00342       if (uNumChars == 1)
00343             {
00344         pDrawDlg->m_drawScribble.AddKeystroke(mbsBody);
00345             }
00346
00347       //
00348       // Add the line received to the drawing.
00349       //
00350       else
00351       {
00352             sscanf(mbsBody, "%07ld%07ld%07ld%07ld",
00353              &line.ptStart.x, &line.ptStart.y,
00354              &line.ptEnd.x, &line.ptEnd.y);
00355         pDrawDlg->m_drawScribble.AddLine(line);
00356       }
00357         }
00358     }
00359
00360
00361     return 0;
00362 }
00363
00364
00365 BOOL CDisdrawDlg::OnInitDialog()
00366 {
00367   CDialog::OnInitDialog();
00368
00369   // Set the icon for this dialog box.  The framework does this automatically
00370   //  when the application's main window is not a dialog box.
00371   SetIcon(m_hIcon, TRUE);     // Use the large icon.
00372   SetIcon(m_hIcon, FALSE);    // Use the small icon.
00373
00374
00375   //
00376   // Display the logon name in the title bar.
00377   //
00378   SetWindowText(m_strLogin);
00379
00380
00381   //
00382   // No queues are open yet.
00383   //
00384   m_hqIncoming = NULL;
00385   m_hqOutgoing = NULL;
00386
00387     //
00388     // Establish connection mode.
00389     //
00390     m_fDsEnabledLocaly = IsDsEnabledLocaly();
00391
00392     if (!m_fDsEnabledLocaly)
00393     {
00394         //
00395         // The computer is DS-disabled. This is the right place to open the receiving queue
00396         // because it is a local private queue. This operation is not time-consuming.
00397         //
00398         //
00399       // Open the receiving queue and receive incoming messages.
00400       //
00401
00402         if (OpenPrivateReceiveQueue())
00403         {
00404             startReceiveUpdateThread();
00405         }
00406       else
00407         {
00408             //
00409             // The receiving queue could not be opened.
00410             //
00411         MessageBox("The receiving queue cannot be opened.");
00412         }
00413
00414     }
00415
00416     initializeUi(m_fDsEnabledLocaly);
00417
00418     return TRUE;  // Return TRUE unless you set the focus to a control.
00419 }
00420
00421
00422 // If you add a minimize button to your dialog box, you will need the code below
00423 // to draw the icon.  For MFC applications using the document/view model,
00424 // this is automatically done for you by the framework.
00425
00426 void CDisdrawDlg::OnPaint()
00427 {
00428   if (IsIconic())
00429   {
00430     CPaintDC dc(this); // Device context for painting
00431
00432     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00433
00434     // Center the icon in the client rectangle.
00435     int cxIcon = GetSystemMetrics(SM_CXICON);
00436     int cyIcon = GetSystemMetrics(SM_CYICON);
00437     CRect rect;
00438     GetClientRect(&rect);
00439     int x = (rect.Width() - cxIcon + 1) / 2;
00440     int y = (rect.Height() - cyIcon + 1) / 2;
00441
00442     // Draw the icon.
00443     dc.DrawIcon(x, y, m_hIcon);
00444   }
00445   else
00446   {
00447     CDialog::OnPaint();
00448   }
00449 }
00450
00451
00452 // The system calls this function to obtain the cursor to display while the user drags
00453 // the minimized window.
00454 HCURSOR CDisdrawDlg::OnQueryDragIcon()
00455 {
00456   return (HCURSOR) m_hIcon;
00457 }
00458
00459
00460 void CDisdrawDlg::SendKeystroke(UINT uChar)
00461 {
00462   //
00463   // Send the keystroke to the friend queue, if there is one.
00464   //
00465   if (m_hqOutgoing != NULL)
00466   {
00467     //
00468     // Prepare the message properties to send the message.
00469     //
00470     DWORD cProps = 0;
00471     MQMSGPROPS    propsMessage;
00472     MQPROPVARIANT aPropVar[5];
00473     MSGPROPID     aPropId[5];
00474
00475     WCHAR wcsBody[1];
00476     swprintf(wcsBody, L"%c", uChar);
00477     aPropId[cProps]       = PROPID_M_BODY;
00478     aPropVar[cProps].vt     = VT_UI1 | VT_VECTOR;
00479     aPropVar[cProps].caub.cElems = sizeof(wcsBody);
00480     aPropVar[cProps].caub.pElems = (UCHAR *)wcsBody;
00481     cProps++;
00482
00483     WCHAR wcsLabel[MQ_MAX_MSG_LABEL_LEN];
00484     swprintf(wcsLabel, L"Key: %c", uChar);
00485     aPropId[cProps]       = PROPID_M_LABEL;
00486     aPropVar[cProps].vt     = VT_LPWSTR;
00487     aPropVar[cProps].pwszVal  = wcsLabel;
00488     cProps++;
00489
00490         UpdateData(TRUE);
00491     aPropId[cProps]       = PROPID_M_DELIVERY;
00492     aPropVar[cProps].vt     = VT_UI1;
00493     aPropVar[cProps].bVal   = m_iDelivery;
00494     cProps++;
00495
00496     aPropId[cProps]       = PROPID_M_PRIORITY;
00497     aPropVar[cProps].vt     = VT_UI1;
00498     aPropVar[cProps].bVal   = 4;
00499     cProps++;
00500
00501     aPropId[cProps]       = PROPID_M_BODY_TYPE;
00502     aPropVar[cProps].vt     = VT_UI4;
00503     aPropVar[cProps].lVal   = (long)VT_BSTR;
00504     cProps++;
00505
00506     propsMessage.cProp    = cProps;
00507     propsMessage.aPropID  = aPropId;
00508     propsMessage.aPropVar = aPropVar;
00509     propsMessage.aStatus  = NULL;
00510
00511
00512     //
00513     // Send the message to the outgoing queue.
00514     //
00515     MQSendMessage(m_hqOutgoing, &propsMessage, NULL);
00516   }
00517 }
00518
00519
00520 void CDisdrawDlg::SendMouseMovement(LINE line)
00521 {
00522   //
00523   // Send the line to the friend queue, if there is one.
00524   //
00525   if (m_hqOutgoing != NULL)
00526   {
00527     //
00528     // Prepare the message properties to send the message.
00529     //
00530     DWORD cProps = 0;
00531     MQMSGPROPS    propsMessage;
00532     MQPROPVARIANT aPropVar[5];
00533     MSGPROPID     aPropId[5];
00534
00535     WCHAR wcsBody[MAX_MSG_BODY_LEN];
00536     swprintf(wcsBody, L"%07ld%07ld%07ld%07ld",
00537          line.ptStart.x, line.ptStart.y, line.ptEnd.x, line.ptEnd.y);
00538     aPropId[cProps]       = PROPID_M_BODY;
00539     aPropVar[cProps].vt     = VT_UI1 | VT_VECTOR;
00540     aPropVar[cProps].caub.cElems = sizeof(wcsBody);
00541     aPropVar[cProps].caub.pElems = (UCHAR *)wcsBody;
00542     cProps++;
00543
00544     WCHAR wcsLabel[MQ_MAX_MSG_LABEL_LEN];
00545     swprintf(wcsLabel, L"%ld,%ld To %ld,%ld",
00546          line.ptStart.x, line.ptStart.y, line.ptEnd.x, line.ptEnd.y);
00547     aPropId[cProps]       = PROPID_M_LABEL;
00548     aPropVar[cProps].vt     = VT_LPWSTR;
00549     aPropVar[cProps].pwszVal  = wcsLabel;
00550     cProps++;
00551
00552         UpdateData(TRUE);
00553     aPropId[cProps]       = PROPID_M_DELIVERY;
00554     aPropVar[cProps].vt     = VT_UI1;
00555     aPropVar[cProps].bVal   = m_iDelivery;
00556     cProps++;
00557
00558     aPropId[cProps]       = PROPID_M_PRIORITY;
00559     aPropVar[cProps].vt     = VT_UI1;
00560     aPropVar[cProps].bVal   = 3;
00561     cProps++;
00562
00563     aPropId[cProps]       = PROPID_M_BODY_TYPE;
00564     aPropVar[cProps].vt     = VT_UI4;
00565     aPropVar[cProps].lVal   = (long)VT_BSTR;
00566     cProps++;
00567
00568     propsMessage.cProp    = cProps;
00569     propsMessage.aPropID  = aPropId;
00570     propsMessage.aPropVar = aPropVar;
00571     propsMessage.aStatus  = NULL;
00572
00573
00574     //
00575     // Send the message to the outgoing queue.
00576     //
00577     MQSendMessage(m_hqOutgoing, &propsMessage, NULL);
00578   }
00579 }
00580
00581
00582 void CDisdrawDlg::OnButtonAttach()
00583 {
00584
00585     //
00586     // The constructor changes the cursor to an hourglass.
00587     // When the object goes out of scope, the cursor changes back to normal.
00588     //
00589     CWaitCursor wait ;
00590     WCHAR wcsFormatName[MAX_FORMAT_NAME_LEN];
00591
00592   if(m_fDsEnabledLocaly && m_iRadioDS == 0)
00593     {
00594         //
00595         // Connect with a remote computer in standard mode.
00596         //
00597
00598         //
00599       // Obtain the name of the friend queue.
00600       //
00601       UpdateData(TRUE);
00602       m_strFriend.MakeUpper();
00603         //
00604         // Make sure the friend queue exists.
00605         //
00606       if (!LocateQueue(m_strFriend, wcsFormatName, MAX_FORMAT_NAME_LEN))
00607       {
00608         AfxMessageBox("No such queue exists.");
00609         return;
00610       }
00611
00612
00613     }
00614     else if(!m_fDsEnabledLocaly || m_iRadioDS == 1)
00615     {
00616         //
00617         // Connect with a remote computer in direct mode.
00618         //
00619
00620         //
00621       // Obtain the name of the friend queue and the remote computer.
00622       //
00623       UpdateData(TRUE);
00624       m_strFriend.MakeUpper();
00625         m_strRemoteComputerName.MakeUpper();
00626
00627
00628         //
00629         // Make sure the friend queue exists. Since we are connecting to
00630         // a private queue, we cannot obtain its format name from the
00631         // directory service (DS), so we will asuume it exists and try to open it.
00632         //
00633
00634       //
00635       // Open the friend queue for sending (in direct mode)
00636         // Please Note:
00637         // Opening a remote queue for sending will always
00638         // succeed even if the queue or computer does not exist.
00639         // When working in direct mode, we must use private queues.
00640         // We cannot know whether a given private queue on another computer exists or not,
00641         // so here we will just assume that it does. To make the application more robust,
00642         // an acknowledgement queue should be created on the local computer, and
00643         // a request for acknowledgement messages should be added to the messages sent.
00644         // Then the application can notify the user when a negative adknowledgement message
00645         // (NACK) is received.
00646         //
00647
00648
00649         //
00650         // Compose the format name.
00651         //
00652         char mbsFormatName[MAX_FORMAT_NAME_LEN];
00653         sprintf(mbsFormatName,"DIRECT=OS:%s\\private$\\%s",m_strRemoteComputerName,m_strFriend);
00654         mbstowcs(wcsFormatName,mbsFormatName,MAX_FORMAT_NAME_LEN);
00655
00656     }
00657
00658     //
00659   // Open the remote queue for sending.
00660     // The action is the same in both cases.
00661   //
00662   HANDLE hqNewFriend;
00663   HRESULT hr = MQOpenQueue(wcsFormatName, MQ_SEND_ACCESS, MQ_DENY_NONE , &hqNewFriend);
00664   if (FAILED(hr))
00665     AfxMessageBox("The remote queue cannot be opened.");
00666
00667   else
00668   {
00669     //
00670     // Close the previous friend queue and update the title bar.
00671     //
00672     if (m_hqOutgoing != NULL)
00673         {
00674       MQCloseQueue(m_hqOutgoing);
00675         }
00676     m_hqOutgoing = hqNewFriend;
00677     CString strTitle = m_strLogin + " connected to " + m_strFriend;
00678     SetWindowText(strTitle);
00679     m_btnAttach.EnableWindow(FALSE);
00680   }
00681
00682 }
00683
00684
00685 void CDisdrawDlg::OnChangeEditFriend()
00686 {
00687
00688   m_btnAttach.EnableWindow(TRUE);
00689 }
00690
00691
00692 void CDisdrawDlg::OnClose()
00693 {
00694   // TODO: Add your message handler code here and/or call default.
00695
00696   //
00697   // Close any open queues.
00698   //
00699   if (m_hqIncoming != NULL)
00700     MQCloseQueue(m_hqIncoming);
00701
00702   if (m_hqOutgoing != NULL)
00703     MQCloseQueue(m_hqOutgoing);
00704
00705   CDialog::OnClose();
00706 }
00707
00708
00709 BOOL CDisdrawDlg::IsDsEnabledLocaly()
00710 /*++
00711
00712 Routine Description:
00713
00714       The routine checks whether the local computer is DS-enabled
00715       or DS-disabled.
00716
00717 Arguments:
00718
00719       None
00720
00721 Return Value:
00722
00723       TRUE     -  DS-enabled.
00724       FALSE    -  DS-disabled.
00725
00726 --*/
00727
00728 {
00729
00730     MQPRIVATEPROPS PrivateProps;
00731     QMPROPID       aPropId[MAX_VAR];
00732     MQPROPVARIANT  aPropVar[MAX_VAR];
00733     DWORD          cProp;
00734     HRESULT        hr;
00735     //
00736     // Prepare a DS-enabled property.
00737     //
00738     cProp = 0;
00739
00740     aPropId[cProp] = PROPID_PC_DS_ENABLED;
00741     aPropVar[cProp].vt = VT_NULL;
00742     ++cProp;
00743     //
00744     // Create a PRIVATEPROPS structure.
00745     //
00746     PrivateProps.cProp = cProp;
00747   PrivateProps.aPropID = aPropId;
00748   PrivateProps.aPropVar = aPropVar;
00749     PrivateProps.aStatus = NULL;
00750
00751     //
00752     // Retrieve the information.
00753     //
00754
00755
00756     //
00757     // This code is used to detect a DS connection.
00758     // This code is designed to allow compilation on both
00759     // Windows NT 4.0 and Windows 2000.
00760     //
00761     HINSTANCE hMqrtLibrary = GetModuleHandle(TEXT("mqrt.dll"));
00762   ASSERT(hMqrtLibrary != NULL);
00763
00764     typedef HRESULT (APIENTRY *MQGetPrivateComputerInformation_ROUTINE)(LPCWSTR , MQPRIVATEPROPS*);
00765     MQGetPrivateComputerInformation_ROUTINE pfMQGetPrivateComputerInformation =
00766           (MQGetPrivateComputerInformation_ROUTINE)GetProcAddress(hMqrtLibrary,
00767                            "MQGetPrivateComputerInformation");
00768     if(pfMQGetPrivateComputerInformation == NULL)
00769     {
00770         //
00771         // There is no entry point in the DLL that matches this routine.
00772         // It must be an old version of mqrt.dll -> product one.
00773         // It will be OK to handle this case as the case of DS-enabled computer.
00774         //
00775         return TRUE;
00776     }
00777
00778   hr = pfMQGetPrivateComputerInformation(
00779              NULL,
00780            &PrivateProps);
00781   if(FAILED(hr))
00782   {
00783         //
00784         // We were not able to determine whether the computer is DS-enabled or DS-disabled.
00785         // Notify the user and assume the worst case (i.e., the computer is DS-disasbled).
00786         //
00787         MessageBox("No DS connection can be detected.");
00788         return FALSE;
00789     }
00790
00791
00792     if(PrivateProps.aPropVar[0].boolVal == 0)
00793     {
00794         //
00795         // DS-disabled.
00796         //
00797         return FALSE;
00798     }
00799
00800     return TRUE;
00801
00802 }
00803
00804
00805
00806
00807 void CDisdrawDlg::initializeUi(BOOL fConnectedToDS)
00808 {
00809     if(fConnectedToDS)
00810     {
00811         //
00812         // Show the relevant controls for a DS-enabled computer.
00813         //
00814         m_cDsFrame.ShowWindow(SW_SHOW);
00815         m_cRadioDS.ShowWindow(SW_SHOW);
00816         m_cRadioWorkgroup.ShowWindow(SW_SHOW);
00817         m_cContinueButton.ShowWindow(SW_SHOW);
00818         m_CancelButton.ShowWindow(SW_SHOW);
00819
00820
00821
00822
00823     }
00824     else
00825     {
00826         //
00827         //Show the relevant controls for a DS-disabled computer.
00828         //
00829         m_cMessageFrame.ShowWindow(SW_SHOW);
00830         m_cRadioExpress.ShowWindow(SW_SHOW);
00831         m_cRadioRecoverable.ShowWindow(SW_SHOW);
00832         m_cQueueInput.ShowWindow(SW_SHOW);
00833         m_cQueueLabel.ShowWindow(SW_SHOW);
00834         m_cComputerInput.ShowWindow(SW_SHOW);
00835         m_cComputerLabel.ShowWindow(SW_SHOW);
00836         m_CancelButton.ShowWindow(SW_SHOW);
00837         m_btnAttach.ShowWindow(SW_SHOW);
00838
00839
00840     }
00841
00842
00843 }
00844
00845 void CDisdrawDlg::OnConnect()
00846 {
00847     //
00848     // See what the user selected.
00849     //
00850     UpdateData(TRUE);
00851     if(m_iRadioDS == 0)
00852     {
00853         //
00854         // The DS is enabled locally, and the user chose to connect in standard mode.
00855         //
00856
00857          CWaitCursor wait ;
00858
00859         //
00860       // Open the receiving queue and receive incoming messages.
00861       //
00862
00863         if (OpenReceiveQueue())
00864         {
00865             startReceiveUpdateThread();
00866         }
00867       else
00868         {
00869         AfxMessageBox("The receiving queue cannot be opened.");
00870         }
00871
00872
00873         //
00874         // Hide relevant controls.
00875         //
00876         m_cDsFrame.ShowWindow(SW_HIDE);
00877         m_cRadioDS.ShowWindow(SW_HIDE);
00878         m_cRadioWorkgroup.ShowWindow(SW_HIDE);
00879         m_cContinueButton.ShowWindow(SW_HIDE);
00880
00881         //
00882         // Show relevant controls.
00883         //
00884
00885         m_cMessageFrame.ShowWindow(SW_SHOW);
00886         m_cRadioExpress.ShowWindow(SW_SHOW);
00887         m_cRadioRecoverable.ShowWindow(SW_SHOW);
00888         m_cQueueInput.ShowWindow(SW_SHOW);
00889         m_cQueueLabel.ShowWindow(SW_SHOW);
00890
00891         m_CancelButton.ShowWindow(SW_SHOW);
00892         m_btnAttach.ShowWindow(SW_SHOW);
00893
00894     }
00895     else//m_iRadio == 1
00896     {
00897         //
00898         // The DS is enabled locally, and the user chose to connect in direct mode.
00899         //
00900         //
00901         // The constructor changes the cursor to an hourglass.
00902         // When the object goes out of scope, the cursor changes back to normal.
00903         //
00904         CWaitCursor wait ;
00905
00906         //
00907       // Open the receiving private queue and receive incoming messages.
00908       //
00909
00910         if (OpenPrivateReceiveQueue())
00911         {
00912             startReceiveUpdateThread();
00913         }
00914       else
00915         {
00916         AfxMessageBox("The receiving queue cannot be opened.");
00917         }
00918
00919
00920
00921         //
00922         // Hide relevant controls.
00923         //
00924         m_cDsFrame.ShowWindow(SW_HIDE);
00925         m_cRadioDS.ShowWindow(SW_HIDE);
00926         m_cRadioWorkgroup.ShowWindow(SW_HIDE);
00927         m_cContinueButton.ShowWindow(SW_HIDE);
00928
00929         //
00930         // Show relevant controls.
00931         //
00932         m_cMessageFrame.ShowWindow(SW_SHOW);
00933         m_cRadioExpress.ShowWindow(SW_SHOW);
00934         m_cRadioRecoverable.ShowWindow(SW_SHOW);
00935         m_cQueueInput.ShowWindow(SW_SHOW);
00936         m_cQueueLabel.ShowWindow(SW_SHOW);
00937         m_cComputerInput.ShowWindow(SW_SHOW);
00938         m_cComputerLabel.ShowWindow(SW_SHOW);
00939         m_CancelButton.ShowWindow(SW_SHOW);
00940         m_btnAttach.ShowWindow(SW_SHOW);
00941
00942     }
00943
00944
00945 }
00946
00947 BOOL CDisdrawDlg::OpenPrivateReceiveQueue()
00948 {
00949
00950     //
00951     // Compose the pathname to the receiving queue and make it private.
00952     //
00953     char mbsPathName[MQ_MAX_Q_NAME_LEN];
00954     DWORD dwNumChars = MQ_MAX_Q_NAME_LEN;
00955     GetComputerName(mbsPathName, &dwNumChars);
00956   strcat(mbsPathName, "\\");
00957     strcat(mbsPathName,"private$");
00958     strcat(mbsPathName, "\\");
00959   strcat(mbsPathName, m_strLogin);
00960
00961
00962     //
00963     // Prepare the properties of the receiving queue.
00964     //
00965     DWORD cProps = 0;
00966     QUEUEPROPID  aPropId[3];
00967     MQPROPVARIANT aPropVar[3];
00968   MQQUEUEPROPS propsQueue;
00969
00970   WCHAR wcsPathName[MQ_MAX_Q_NAME_LEN];
00971   mbstowcs(wcsPathName, mbsPathName, MQ_MAX_Q_NAME_LEN);
00972   aPropId[cProps]      = PROPID_Q_PATHNAME;
00973   aPropVar[cProps].vt    = VT_LPWSTR;
00974   aPropVar[cProps].pwszVal = wcsPathName;
00975   cProps++;
00976
00977   aPropId[cProps]      = PROPID_Q_TYPE;
00978   aPropVar[cProps].vt    = VT_CLSID;
00979   aPropVar[cProps].puuid   = &guidDrawType;
00980   cProps++;
00981
00982   WCHAR wcsLabel[MQ_MAX_Q_LABEL_LEN];
00983   mbstowcs(wcsLabel, m_strLogin, MQ_MAX_Q_LABEL_LEN);
00984   aPropId[cProps]      = PROPID_Q_LABEL;
00985   aPropVar[cProps].vt    = VT_LPWSTR;
00986   aPropVar[cProps].pwszVal = wcsLabel;
00987   cProps++;
00988
00989   propsQueue.cProp  = cProps;
00990   propsQueue.aPropID  = aPropId;
00991   propsQueue.aPropVar = aPropVar;
00992   propsQueue.aStatus  = NULL;
00993
00994
00995   //
00996   // Create the receiving queue.
00997   //
00998     WCHAR wcsFormatName[MAX_FORMAT_NAME_LEN];
00999   dwNumChars = MAX_FORMAT_NAME_LEN;
01000   HRESULT hr = MQCreateQueue(NULL, &propsQueue, wcsFormatName, &dwNumChars);
01001
01002
01003   if (FAILED(hr) && hr != MQ_ERROR_QUEUE_EXISTS)
01004     {
01005     return FALSE;
01006     }
01007
01008
01009     if( hr ==  MQ_ERROR_QUEUE_EXISTS)
01010     {
01011         //
01012       // If the receiving queue already exists, obtain its format name.
01013       //
01014
01015         WCHAR wcsLoginName[MQ_MAX_Q_NAME_LEN];
01016         mbstowcs(wcsLoginName, m_strLogin, MQ_MAX_Q_LABEL_LEN);
01017         swprintf(wcsFormatName,L"DIRECT=OS:.\\private$\\%s",wcsLoginName);
01018
01019     }
01020
01021     //
01022   // Open the receiving queue (a local private queue).
01023   //
01024
01025   hr = MQOpenQueue(wcsFormatName,
01026                              MQ_RECEIVE_ACCESS,
01027                              MQ_DENY_NONE ,
01028                              &m_hqIncoming);
01029
01030   if (FAILED(hr))
01031     {
01032     return FALSE;
01033     }
01034     return TRUE;
01035
01036 }
01037
01038 void CDisdrawDlg::OnChangeEditFriendComputer()
01039 {
01040     //
01041     // Allow specifying another remote computer.
01042     //
01043   m_btnAttach.EnableWindow(TRUE);
01044
01045 }
01046
01047
01048 void CDisdrawDlg::startReceiveUpdateThread()
01049 {
01050     DWORD dwThreadID=NULL;
01051     CreateThread(NULL,
01052                  0,
01053                  (LPTHREAD_START_ROUTINE)ReceiveUpdates,
01054                  this,
01055                  0,
01056                  &dwThreadID);
01057     if( dwThreadID == NULL)
01058     {
01059        MessageBox("The system failed to initialize receiving queue.\nNo Drawing will be received");
01060     }
01061
01062 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/data.Idl Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

data.Idl

Go to the documentation of this file.
00001 // Data.idl : IDL source for Data.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (Data.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009 #include <mtxattr.h>
00010
00011 #if (__midl >= 503)
00012 midl_pragma warning( disable: 2400 ) // Happy to be delivered NULLs for optional parameters
00013 #endif
00014
00015 [
00016   uuid(B9F881E5-0063-433A-AD7F-2ED2CA579305),
00017   version(1.0),
00018   helpstring("DataServices 1.0 Type Library")
00019 ]
00020 library DataServices
00021 {
00022   importlib("stdole32.tlb");
00023   importlib("stdole2.tlb");
00024   importlib("c:\Program Files\Common Files\System\ado\msado15.dll");
00025
00026     typedef enum {
00027         colEditNone = 0,
00028         colEditInProgress = 1,
00029         colEditAdd = 2,
00030         colEditDelete = 4,
00031         colEditDeleted = 8
00032     } ColEditModeEnum;
00033
00034   [
00035     object,
00036     uuid(A008E1F2-E559-4349-B01D-DF1E6F69D3B4),
00037     dual,
00038     helpstring("IEntityData Interface"),
00039     pointer_default(unique)
00040   ]
00041   interface IEntityData : IDispatch
00042   {
00043     [id(8), helpstring("Given an index, returns an item in the structure.")]
00044     HRESULT _stdcall Item(
00045             [in] VARIANT* Index,
00046             [out, retval] VARIANT* pvarRet);
00047
00048     [id(0x00000001), helpstring("Adds an item to the structure.")]
00049     HRESULT _stdcall Add(
00050             [in] VARIANT* Item,
00051             [in, optional] VARIANT* Key,
00052             [in, optional] VARIANT* Before,
00053             [in, optional] VARIANT* After);
00054     [id(0x00000002), helpstring("Returns number of items in structure.")]
00055     HRESULT _stdcall Count([out, retval] long* pi4);
00056     [id(0x00000003), helpstring("Removes an item to the structure.")]
00057     HRESULT _stdcall Remove([in] VARIANT* Index);
00058     [id(DISPID_NEWENUM)]
00059     HRESULT _stdcall _NewEnum([out, retval] IUnknown** ppunk);
00060     [id(4), helpstring("Initialize the structure to a given size.")] HRESULT Initialize(long Size);
00061     [propget, id(5), helpstring("The EditMode represents the current state of the entity data.")] HRESULT EditMode([out, retval] ColEditModeEnum *pVal);
00062     [propput, id(5), helpstring("The EditMode represents the current state of the entity data.")] HRESULT EditMode([in] ColEditModeEnum newVal);
00063     [propget, id(6), helpstring("The name of a field in the entity.")] HRESULT Key(long Index, [out, retval] BSTR *pVal);
00064     [propput, id(6), helpstring("The name of a field in the entity.")] HRESULT Key(long Index, [in] BSTR newVal);
00065     [id(7), helpstring("Insert a metadata item into the entity.")] HRESULT Insert([in] long Index, [in] BSTR Key, [in] VARIANT *pVal);
00066     [propget, id(DISPID_VALUE), helpstring("Entity Data Item")] HRESULT Field([in] VARIANT *Index, [out, retval] VARIANT *pVal);
00067     [propput, id(DISPID_VALUE), helpstring("Entity Data Item")] HRESULT Field([in] VARIANT *Index, [in] VARIANT *pVal);
00068     [propput, id(9), helpstring("Assign an ADO record to an entity")] HRESULT Recordset([in] _Recordset* newVal);
00069     [propget, id(10), helpstring("Retrieve the internal UpdateCommand for this entity")] HRESULT UpdateCommand([out, retval] BSTR *pVal);
00070     [propget, id(11), helpstring("Retrieve the internal ReadCommand for this entity")] HRESULT ReadCommand([out, retval] BSTR *pVal);
00071     [propget, id(12), helpstring("Stored procedure used for storing entity data to the database")] HRESULT UpdateStoredProcedure([out, retval] BSTR *pVal);
00072     [propput, id(12), helpstring("Stored procedure used for storing entity data to the database")] HRESULT UpdateStoredProcedure([in] BSTR newVal);
00073     [propget, id(13), helpstring("Stored procedure used for reading an entity from the database")] HRESULT ReadStoredProcedure([out, retval] BSTR *pVal);
00074     [propput, id(13), helpstring("Stored procedure used for reading an entity from the database")] HRESULT ReadStoredProcedure([in] BSTR newVal);
00075     [propget, id(14), helpstring("The database primary key field for this entity")] HRESULT KeyField([out, retval] BSTR *pVal);
00076     [propput, id(14), helpstring("The database primary key field for this entity")] HRESULT KeyField([in] BSTR newVal);
00077     [id(15), helpstring("Append and item to the entity.")] HRESULT Append(VARIANT *pItem, VARIANT *pKey);
00078     [propget, id(16), helpstring("Stored procedure used for deleting an entity from the database")] HRESULT DeleteStoredProcedure([out, retval] BSTR *pVal);
00079     [propput, id(16), helpstring("Stored procedure used for deleting an entity from the database")] HRESULT DeleteStoredProcedure([in] BSTR newVal);
00080     [propget, id(17), helpstring("Retrieve the internal DeleteCommand for this entity")] HRESULT DeleteCommand([out, retval] BSTR *pVal);
00081     [propget, id(18), helpstring("Stored procedure used for inserting an entity into the database")] HRESULT InsertStoredProcedure([out, retval] BSTR *pVal);
00082     [propput, id(18), helpstring("Stored procedure used for inserting an entity into the database")] HRESULT InsertStoredProcedure([in] BSTR newVal);
00083     [propget, id(19), helpstring("Retrieve the internal InsertCommand for this entity")] HRESULT InsertCommand([out, retval] BSTR *pVal);
00084   };
00085
00086   [
00087     object,
00088     uuid(99F2DD53-A1C2-4878-AF80-4A30EDEA8288),
00089     dual,
00090     helpstring("IDynamic Interface"),
00091     pointer_default(unique)
00092   ]
00093   interface IDynamic : IDispatch
00094   {
00095     [id(DISPID_VALUE), helpstring("Given an index, returns an item in the collection.")]
00096     HRESULT _stdcall Item(
00097             [in] VARIANT* Index,
00098             [out, retval] VARIANT* pvarRet);
00099
00100     [id(0x00000001), helpstring("Adds an item to the collection.")]
00101     HRESULT _stdcall Add(
00102             [in] VARIANT* Item,
00103             [in, optional] VARIANT* Key,
00104             [in, optional] VARIANT* Before,
00105             [in, optional] VARIANT* After);
00106     [id(0x00000002), helpstring("Returns number of items in collection.")]
00107     HRESULT _stdcall Count([out, retval] long* pi4);
00108     [id(0x00000003), helpstring("Removes an item to the collection.")]
00109     HRESULT _stdcall Remove([in] VARIANT* Index);
00110     [id(DISPID_NEWENUM)]
00111     HRESULT _stdcall _NewEnum([out, retval] IUnknown** ppunk);
00112   };
00113
00114   [
00115     object,
00116     uuid(A008E1F1-E559-4349-B01D-DF1E6F69D3B4),
00117     dual,
00118     helpstring("IEntity Interface"),
00119     pointer_default(unique)
00120   ]
00121   interface IEntity : IDispatch
00122   {
00123     [id(7), helpstring("Given an index, returns an item in the structure.")]
00124     HRESULT _stdcall Item(
00125             [in] VARIANT* Index,
00126             [out, retval] VARIANT* pvarRet);
00127
00128     [id(0x00000002), helpstring("Returns number of items in structure.")] HRESULT _stdcall Count([out, retval] long* pi4);
00129     [id(DISPID_NEWENUM)] HRESULT _stdcall _NewEnum([out, retval] IUnknown** ppunk);
00130     [propget, id(5), helpstring("The EditMode represents the current state of the entity data.")] HRESULT EditMode([out, retval] ColEditModeEnum *pVal);
00131     [propget, id(6), helpstring("The name of a field in the entity.")] HRESULT Key(long Index, [out, retval] BSTR *pVal);
00132     [propget, id(DISPID_VALUE), helpstring("Entity Data Item")] HRESULT Field([in] VARIANT* Index, [out, retval] VARIANT *pVal);
00133     [propput, id(DISPID_VALUE), helpstring("Entity Data Item")] HRESULT Field([in] VARIANT* Index, [in] VARIANT *newVal);
00134     [propput, id(8), helpstring("Assign an ADO record to an entity")] HRESULT Recordset([in] _Recordset* newVal);
00135   };
00136
00137   [
00138     object,
00139     uuid(A497E6A9-95E6-4EAE-BD82-6E2D67306172),
00140     dual,
00141     helpstring("IResultset Interface"),
00142     pointer_default(unique)
00143   ]
00144   interface IResultset : IDispatch
00145   {
00146     [propget, id(DISPID_VALUE), helpstring("Given an index, returns an item in the resultset.")] HRESULT Record(long nIndex, [out, retval] IEntityData **pVal);
00147     [id(0x00000002), helpstring("Returns number of items in resultset.")] HRESULT _stdcall Count([out, retval] long* pi4);
00148     [id(DISPID_NEWENUM)] HRESULT _stdcall _NewEnum([out, retval] IUnknown** ppunk);
00149   };
00150
00151   [
00152     object,
00153     uuid(0851A589-A57B-42EB-8124-45A1C5A0AF24),
00154     dual,
00155     helpstring("IDataProxy Interface"),
00156     pointer_default(unique)
00157   ]
00158   interface IDataProxy : IDispatch
00159   {
00160     [id(1), helpstring("Execute a SQL String as fast as possible.")] HRESULT Execute([in] BSTR SQLString, [out, retval] long *Result);
00161     [id(2), helpstring("Construct the DB connection")] HRESULT ManualConstruct([in] BSTR ConstructString);
00162     [id(3), helpstring("Update the database using a given entity as it's source")] HRESULT EntityUpdate([in]IEntityData *Entity, [out, retval] long *Result);
00163     [id(4), helpstring("Load an entity from the database")] HRESULT EntityLoad([in] BSTR ReadStoredProc, [in] BSTR UpdateStoredProc, [in] BSTR DeleteStoredProc, [in] BSTR InsertStoredProc, [in] BSTR KeyField, [in] VARIANT KeyValue, [out, optional] long *Result, [out, retval] IEntityData **Entity);
00164     [id(5), helpstring("Query for a collection of entities")] HRESULT EntityQuery([in]BSTR SQLString, [out, optional] long * Result, [in, optional] BSTR ReadStoredProc, [in, optional] BSTR UpdateStoredProc, [in, optional] BSTR DeleteStoredProc, [in, optional] BSTR InsertStoredProc, [in, optional] BSTR KeyField, [out, retval] IResultset **Resultset);
00165     [id(6), helpstring("Query for an ADO Recordset and SP return value (int) - read only and disconnected")] HRESULT RSQuery([in] BSTR QueryText, [out, optional] VARIANT *Result, [out, retval] _Recordset ** Recordset);
00166     [id(7), helpstring("Query for an ADO Recordset and SP return value (int) - read/write and disconnected")] HRESULT RSQueryRW([in] BSTR QueryText, [out, optional] VARIANT *Result, [out, retval] _Recordset **rs);
00167     [id(8), helpstring("Update the database using the given ADO recordset as a source.")] HRESULT RSUpdate(_Recordset *rs);
00168     [id(9), helpstring("Retrieve an entity's data from the database")] HRESULT EntityRead([in] IEntityData *Entity, [out, retval] long *Results);
00169     [id(10), helpstring("Lookup entities - first found is returned. Use NextEntity for the rest.")] HRESULT EntityLookup([in]BSTR SQLString, [out, optional] long * Result, [in, optional] BSTR ReadStoredProc, [in, optional] BSTR UpdateStoredProc, [in, optional] BSTR DeleteStoredProc, [in, optional] BSTR InsertStoredProc, [in, optional] BSTR KeyField, [out, retval] IEntityData **Entity);
00170     [id(11), helpstring("Retrieve the next entity from the current lookup set.")] HRESULT NextEntity([out, retval] IEntityData **Entity);
00171     [id(12), helpstring("Free up resources used in the current entity lookup.")] HRESULT LookupFree();
00172     [id(13), helpstring("Delete the entity from the database.")] HRESULT EntityDelete([in] IEntityData *Entity, [out, retval] long *Result);
00173     [id(14), helpstring("Insert into the database using a given entity as it's source")] HRESULT EntityInsert(IEntityData *Entity, [out, retval] long *Result);
00174     [id(15), helpstring("Retrieve the next Resultset for the current query")] HRESULT NextResultset([out, optional] long * Result, [out, retval] IResultset **Resultset);
00175     [id(16), helpstring("Retrieve the first entity of the next set of results for the current lookup")] HRESULT NextLookup([out, optional] long *Result, [out, retval] IEntityData **Entity);
00176   };
00177
00178   [
00179     uuid(0D515874-C926-4024-BD7F-D4F945F77FE7),
00180     helpstring("Entity Class")
00181   ]
00182   coclass Entity
00183   {
00184     [default] interface IEntity;
00185     interface IEntityData;
00186   };
00187   [
00188     uuid(8BBDD465-4026-4529-97F4-4262A1878396),
00189     helpstring("Dynamic Class")
00190   ]
00191   coclass Dynamic
00192   {
00193     [default] interface IDynamic;
00194   };
00195
00196   [
00197     uuid(A814DCF9-1F97-45E3-84F3-42B5CF9F1EB0),
00198     helpstring("Proxy Class"),
00199     TRANSACTION_SUPPORTED
00200   ]
00201   coclass Proxy
00202   {
00203     [default] interface IDataProxy;
00204   };
00205   [
00206     uuid(04263932-CE17-4D71-B841-8B514E778ADC),
00207     helpstring("Resultset Class")
00208   ]
00209   coclass Resultset
00210   {
00211     [default] interface IResultset;
00212   };
00213 };
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpCntr/site.h Source File

  • Com
  • Fundamentals
  • SimpCntr

site.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: SITE.H
00003 //
00004 //      Definition of CSimpleSite
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008 #if !defined( _SITE_H_ )
00009 #define _SITE_H_
00010
00011 #include <ole2.h>
00012 #include <stablize.h>
00013 #include "ias.h"
00014 #include "ioips.h"
00015 #include "iocs.h"
00016
00017 class CSimpleDoc;
00018
00019 class CSimpleSite : public IUnknown, public CSafeRefCount
00020 {
00021 public:
00022         DWORD m_dwConnection;
00023         LPOLEOBJECT m_lpOleObject;
00024         LPOLEINPLACEOBJECT m_lpInPlaceObject;
00025         HWND m_hwndIPObj;
00026         DWORD m_dwDrawAspect;
00027         SIZEL m_sizel;
00028         BOOL m_fInPlaceActive;
00029         BOOL m_fObjectOpen;
00030         LPSTORAGE m_lpObjStorage;
00031
00032         CAdviseSink m_AdviseSink;
00033         COleInPlaceSite m_OleInPlaceSite;
00034         COleClientSite m_OleClientSite;
00035
00036         CSimpleDoc FAR * m_lpDoc;
00037
00038         // IUnknown Interfaces
00039         STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
00040         STDMETHODIMP_(ULONG) AddRef();
00041         STDMETHODIMP_(ULONG) Release();
00042
00043         void InitObject(BOOL fCreateNew);
00044         static CSimpleSite FAR * Create(CSimpleDoc FAR *lpDoc);
00045         CSimpleSite(CSimpleDoc FAR *lpDoc);
00046         ~CSimpleSite();
00047         void PaintObj(HDC hDC);
00048         void GetObjRect(LPRECT lpRect);
00049         void CloseOleObject(void);
00050         void UnloadOleObject(void);
00051 };
00052
00053 #endif
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/xmldsig/SignVerify.cs Source File

  • Security
  • capicom
  • c_sharp
  • xmldsig

SignVerify.cs

Go to the documentation of this file.
00001 //******************************************************************************
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004 // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005 // WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 1999- 2002.  Microsoft Corporation.  All rights reserved.
00008 //
00009 //******************************************************************************
00010 //
00011 // SignVerify.cs
00012 //
00013 // This is a C# sample that illustrates how to use features introduced in
00014 // CAPICOM's bridging support to interop between CAPI and System.Security.xml.
00015 //
00016 // Note: for simplicity, this code does not handle exceptions.
00017 //
00018 //******************************************************************************
00019
00020 using System;
00021 using System.Drawing;
00022 using System.ComponentModel;
00023 using System.Windows.Forms;
00024 using System.Security.Cryptography;
00025 using System.Security.Cryptography.X509Certificates;
00026 using System.Security.Cryptography.Xml;
00027 using System.Xml;
00028 using System.Collections;
00029 using Interop.CAPICOM;
00030 using System.Runtime.InteropServices;
00031
00032
00033 namespace Sample {
00034     public class MySignedXml : SignedXml {
00035         private IEnumerator m_keyInfoEnum = null;
00036       public MySignedXml() : base() {}
00037       public MySignedXml(XmlDocument document) : base(document) {}
00038
00039         [DllImport("CertGetKey.dll", ExactSpelling=true)]
00040         private static extern void UnmanagedArrayFree (IntPtr ppbKeyBlob);
00041
00042         [DllImport("CertGetKey.dll", ExactSpelling=true)]
00043         private static extern int PublicKeyBlobFromCertificateRawData (byte[] rgbRawData, int cbRawData,
00044                                                         out IntPtr /* ref byte[] */ ppbKeyBlob, out uint pKeyBlobSize);
00045
00046         [DllImport("CertGetKey.dll", ExactSpelling=true)]
00047         private static extern void ImportPublicKeyBlob (byte[] rgbPubKeyBlob, int cbPubKeyBlob, out uint pExponent,
00048                              out IntPtr /* ref byte[] */ ppbModulus, out uint pModulusSize);
00049
00050         private static byte[] ConvertIntToByteArray(uint dwInput) {
00051             // output of this routine is always big endian
00052             byte[] rgbTemp = new byte[4];
00053             uint t1, t2;
00054
00055             if (dwInput == 0) return new byte[1];
00056             t1 = dwInput;
00057             int i = 0;
00058             while (t1 > 0) {
00059                 t2 = t1 % 256;
00060                 rgbTemp[i] = (byte) t2;
00061                 t1 = (t1 - t2)/256;
00062                 i++;
00063             }
00064             // Now, copy only the non-zero part of rgbTemp and reverse
00065             byte[] rgbOutput = new byte[i];
00066             // copy and reverse in one pass
00067             for (int j = 0; j < i; j++) {
00068                 rgbOutput[j] = rgbTemp[i-j-1];
00069             }
00070             return(rgbOutput);
00071         }
00072
00073       protected override AsymmetricAlgorithm GetPublicKey() {
00074             RSAKeyValue tempRSA;
00075             DSAKeyValue tempDSA;
00076         KeyInfoX509Data tempCert;
00077
00078             if (m_keyInfoEnum == null)
00079                 m_keyInfoEnum = KeyInfo.GetEnumerator();
00080
00081             while (m_keyInfoEnum.MoveNext()) {
00082                 tempRSA = m_keyInfoEnum.Current as RSAKeyValue;
00083                 if (tempRSA != null) return(tempRSA.Key);
00084
00085                 tempDSA = m_keyInfoEnum.Current as DSAKeyValue;
00086                 if (tempDSA != null) return(tempDSA.Key);
00087
00088           tempCert = m_keyInfoEnum.Current as KeyInfoX509Data;
00089           if (tempCert != null) {
00090             if (tempCert.Certificates != null) {
00091               // The code here doesn't look in all the certificates and doesn't check if they belong
00092                         // to the same certificate chain, or whether they are valid
00093                         if (tempCert.Certificates != null) {
00094                             foreach (X509Certificate x509certificate in tempCert.Certificates) {
00095                                 IntPtr KeyBlob = IntPtr.Zero;
00096                                 uint KeyBlobSize = 0;
00097                                 int result = PublicKeyBlobFromCertificateRawData(x509certificate.GetRawCertData(), x509certificate.GetRawCertData().Length, out KeyBlob, out KeyBlobSize);
00098                                 byte[] blob = new byte[KeyBlobSize];
00099                                 Marshal.Copy(KeyBlob, blob, 0, (int)KeyBlobSize);
00100                                 UnmanagedArrayFree(KeyBlob);
00101                             RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
00102                   RSAParameters parameters = new RSAParameters();
00103                   IntPtr ExponentBlob = IntPtr.Zero, ModulusBlob = IntPtr.Zero;
00104                   uint PubExponent = 0, ModulusSize = 0;
00105                                 ImportPublicKeyBlob(blob, blob.Length, out PubExponent, out ModulusBlob, out ModulusSize);
00106                                 parameters.Exponent = ConvertIntToByteArray(PubExponent);
00107                                 parameters.Modulus = new byte[ModulusSize];
00108                                 Marshal.Copy(ModulusBlob, parameters.Modulus, 0, (int)ModulusSize);
00109                                 UnmanagedArrayFree(ModulusBlob);
00110                   rsa.ImportParameters(parameters);
00111                                 return rsa;
00112                   }
00113                         }
00114                     }
00115                 }
00116             }
00117             return(null);
00118       }
00119     }
00120
00121     internal class SignVerify {
00122         private static void GetSignatureKey (out RSACryptoServiceProvider rsa, out X509Certificate x509Cert) {
00123             rsa = null;
00124             x509Cert = null;
00125             try {
00126                 Store st = new Store();
00127                 st.Open(CAPICOM_STORE_LOCATION.CAPICOM_CURRENT_USER_STORE,
00128                         "MY", // Store Name
00129                         CAPICOM_STORE_OPEN_MODE.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED);
00130                 Certificates selectedCerts = ((ICertificates2)st.Certificates).Select(
00131                                         Messages.DemoTitle,
00132                                         Messages.ChooseCertMessage,
00133                                         false);
00134
00135                 ICertificate2 selectedCert = ((ICertificate2)selectedCerts[1]);
00136                 if (selectedCert.HasPrivateKey() == false) {
00137                     MessageBox.Show(Messages.ChooseCertNoPrivateKey, Messages.ExceptionTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00138                     return;
00139                 }
00140
00141                 // This only works with RSA keys
00142                 if (selectedCert.PublicKey().Algorithm.FriendlyName != "RSA") {
00143                     MessageBox.Show(Messages.ChooseCertKeyAlgorithm, Messages.ExceptionTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00144                     return;
00145                 }
00146
00147                 // Construct the public key
00148                 CspParameters csp = new CspParameters();
00149                 csp.KeyContainerName = selectedCert.PrivateKey.ContainerName;
00150                 csp.ProviderName = selectedCert.PrivateKey.ProviderName;
00151                 csp.ProviderType = Convert.ToInt32(selectedCert.PrivateKey.ProviderType);
00152                 switch (selectedCert.PrivateKey.KeySpec) {
00153                     case CAPICOM_KEY_SPEC.CAPICOM_KEY_SPEC_KEYEXCHANGE:
00154                         csp.KeyNumber = 1;
00155                         break;
00156                     case CAPICOM_KEY_SPEC.CAPICOM_KEY_SPEC_SIGNATURE:
00157                         csp.KeyNumber = 2;
00158                         break;
00159                 }
00160                 if (selectedCert.PrivateKey.IsMachineKeyset())
00161                     csp.Flags = CspProviderFlags.UseMachineKeyStore;
00162                 rsa = new RSACryptoServiceProvider(csp);
00163
00164                 x509Cert = GetX509Certificate(selectedCert);
00165             } catch (Exception) {
00166                 MessageBox.Show(Messages.ChooseCertUnableToConstructKey, Messages.ExceptionTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00167             }
00168         }
00169
00170         private static X509Certificate GetX509Certificate (ICertificate2 cert) {
00171             String certAsString = cert.Export(CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64);
00172         char[] charArray = {'\r', '\n', '\0'};
00173         certAsString = certAsString.TrimEnd(charArray);
00174
00175         byte[] buffer = Convert.FromBase64String(certAsString);
00176         return new X509Certificate(buffer);
00177         }
00178
00179         public static string SignXML (string strXML) {
00180             string strResult = "";
00181             try {
00182                 SignedXml signedXml = new SignedXml();
00183
00184                 // Get the signature key. For this demo, we look for keys associated with a certificate in the "MY" store
00185                 RSACryptoServiceProvider rsa = null;
00186                 X509Certificate x509Cert = null;
00187                 GetSignatureKey(out rsa, out x509Cert);
00188                 if (rsa == null) return "";
00189                 signedXml.SigningKey = rsa;
00190
00191                 Reference reference = new Reference();
00192                 reference.Uri = "#object-1";
00193             reference.Type = "http://www.w3.org/2000/09/xmldsig#Object";
00194
00195             // Add an object
00196             System.Security.Cryptography.Xml.DataObject obj = new System.Security.Cryptography.Xml.DataObject();
00197             XmlDocument doc = new XmlDocument();
00198                 doc.PreserveWhitespace = true;
00199                 doc.LoadXml(strXML);
00200             obj.Data = doc.ChildNodes;
00201             obj.Id = "object-1";
00202             signedXml.AddObject(obj);
00203
00204                 signedXml.AddReference(reference);
00205                 KeyInfo keyInfo = new KeyInfo();
00206
00207                 keyInfo.AddClause(new RSAKeyValue(rsa));
00208                 signedXml.KeyInfo = keyInfo;
00209
00210                 // compute the signature
00211                 signedXml.ComputeSignature();
00212
00213                 strResult = signedXml.GetXml().OuterXml;
00214             } catch (Exception exc) {
00215                 MessageBox.Show(exc.ToString(), Messages.ExceptionTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00216                 return strResult;
00217             }
00218
00219             return strResult;
00220         }
00221
00222         public static string SignXMLX509Data (string strXML) {
00223             string strResult = "";
00224             try {
00225                 SignedXml signedXml = new SignedXml();
00226
00227                 // Get the signature key. For this demo, we look for keys associated with a certificate in the "MY" store
00228                 RSACryptoServiceProvider rsa = null;
00229                 X509Certificate x509Cert = null;
00230                 GetSignatureKey(out rsa, out x509Cert);
00231                 if (rsa == null) return "";
00232                 signedXml.SigningKey = rsa;
00233
00234                 Reference reference = new Reference();
00235                 reference.Uri = "#object-1";
00236             reference.Type = "http://www.w3.org/2000/09/xmldsig#Object";
00237
00238             // Add an object
00239             System.Security.Cryptography.Xml.DataObject obj = new System.Security.Cryptography.Xml.DataObject();
00240             XmlDocument doc = new XmlDocument();
00241                 doc.PreserveWhitespace = true;
00242                 doc.LoadXml(strXML);
00243             obj.Data = doc.ChildNodes;
00244             obj.Id = "object-1";
00245             signedXml.AddObject(obj);
00246
00247                 signedXml.AddReference(reference);
00248                 KeyInfo keyInfo = new KeyInfo();
00249
00250                 // Include the certificate raw data with the signed file
00251                 keyInfo.AddClause(new KeyInfoX509Data(x509Cert));
00252                 signedXml.KeyInfo = keyInfo;
00253
00254                 // compute the signature
00255                 signedXml.ComputeSignature();
00256
00257                 strResult = signedXml.GetXml().OuterXml;
00258             } catch (Exception exc) {
00259                 MessageBox.Show(exc.ToString(), Messages.ExceptionTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00260                 return strResult;
00261             }
00262
00263             return strResult;
00264         }
00265
00266         public static bool VerifyXML (string strXML) {
00267             bool bResult = false;
00268
00269             try {
00270                 XmlDocument xmlDocument = new XmlDocument();
00271                 xmlDocument.PreserveWhitespace = true;
00272                 xmlDocument.LoadXml(strXML);
00273
00274                 MySignedXml signedXml = new MySignedXml(xmlDocument);
00275
00276                 XmlNodeList nodeList = xmlDocument.GetElementsByTagName("Signature");
00277                 signedXml.LoadXml((XmlElement)nodeList[0]);
00278
00279                 AsymmetricAlgorithm key = null;
00280                 if (signedXml.CheckSignatureReturningKey(out key)) {
00281                     bResult = true;
00282                 }
00283             } catch (Exception exc) {
00284                 MessageBox.Show(exc.ToString(), Messages.ExceptionTitle, MessageBoxButtons.OK, MessageBoxIcon.Stop);
00285             }
00286
00287             return bResult;
00288         }
00289     }
00290 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/Cmd.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

Cmd.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CMD.CPP
00004 //  Content:    Main Command Routines
00005 //        All functions in this file have the format:
00006 //                VOID CmdXxx(void);
00007 //
00008 //  Copyright (c) Microsoft Corporation 1995-2002
00009 //
00010 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00011 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00012 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00013 // PARTICULAR PURPOSE.
00014 //****************************************************************************
00015
00016
00017 #include "precomp.h"
00018
00019
00020 //****************************************************************************
00021 //
00022 // VOID CmdMonitor(void)
00023 //
00024 //****************************************************************************
00025
00026 VOID CmdMonitor(void)
00027 {
00028   if (NULL == g_pMgr)
00029   {
00030     if (FAILED(InitConfMgr()))
00031     {
00032       ERROR_MSG(TEXT("Failed to monitor incoming calls"));
00033     }
00034     else
00035     {
00036       TRACE_MSG(TEXT("Monitoring incoming calls"));
00037     }
00038
00039   }
00040   else
00041   {
00042     FreeAllComObjects();
00043     //FreeConfMgr();
00044     ASSERT(NULL == g_pMgr);
00045
00046   }
00047
00048   BOOL fChecked = NULL != g_pMgr;
00049   SetToolbarCheck(IDM_MONITOR, fChecked);
00050   SetMenuCheck(IDM_MONITOR, fChecked);
00051 }
00052
00053
00054 //****************************************************************************
00055 //
00056 // VOID CmdConfStart(void)
00057 //
00058 //****************************************************************************
00059
00060 VOID CmdConfStart(void)
00061 {
00062   if (!DlgNewConference())
00063     return;
00064
00065   TRACE_MSG(TEXT("Starting conference [%s] nmch=%08X"),
00066     (NULL != gPref.pszConferenceName) ?  gPref.pszConferenceName : TEXT("NULL"),
00067     gPref.dwNmch);
00068   DoConferenceCreate();
00069 }
00070
00071
00072 //****************************************************************************
00073 //
00074 // VOID CmdConfStop(void)
00075 //
00076 //****************************************************************************
00077
00078 VOID CmdConfStop(void)
00079 {
00080   TRACE_MSG(TEXT("Stopping conference..."));
00081   DoConferenceLeave();
00082 }
00083
00084
00085 //****************************************************************************
00086 //
00087 // VOID CmdCall(void)
00088 //
00089 //****************************************************************************
00090
00091 VOID CmdCall(void)
00092 {
00093   if (!DlgNewCall())
00094     return;
00095   DoCallCreate();
00096 }
00097
00098 //****************************************************************************
00099 //
00100 // VOID CmdCallConf(void)
00101 //
00102 //****************************************************************************
00103
00104 VOID CmdCallConf(void)
00105 {
00106   if (!DlgCallConf())
00107     return;
00108   DoCallConference();
00109 }
00110
00111
00112 //****************************************************************************
00113 //
00114 // VOID CmdCallAccept(void)
00115 //
00116 //****************************************************************************
00117
00118 VOID CmdCallAccept(void)
00119 {
00120   DoHandleCall(TRUE);
00121 }
00122
00123
00124 //****************************************************************************
00125 //
00126 // VOID CmdCallReject(void)
00127 //
00128 //****************************************************************************
00129
00130 VOID CmdCallReject(void)
00131 {
00132   DoHandleCall(FALSE);
00133 }
00134
00135
00136 //****************************************************************************
00137 //
00138 // VOID CmdCallCancel(void)
00139 //
00140 //****************************************************************************
00141
00142 VOID CmdCallCancel(void)
00143 {
00144   DoCancelCall();
00145 }
00146
00147
00148 //****************************************************************************
00149 //
00150 // VOID CmdShare(void)
00151 //
00152 //****************************************************************************
00153
00154 VOID CmdShare(void)
00155 {
00156   DlgShare();
00157 }
00158
00159 VOID CmdSysLogOnOff(void)
00160 {
00161   DlgLogOnOff();
00162 }
00163
00164 VOID CmdShowLocal(void)
00165 {
00166   DlgShowLocal();
00167 }
00168
00169 //****************************************************************************
00170 //
00171 // VOID CmdLaunch(void)
00172 //
00173 //****************************************************************************
00174
00175 VOID CmdLaunch(void)
00176 {
00177   DlgLaunch();
00178 }
00179
00180 VOID CmdEject(void)
00181 {
00182   DlgEject();
00183 }
00184
00185 VOID CmdFtCancel(void)
00186 {
00187   DoFtCancel();
00188 }
00189
00190 VOID CmdDataEnable(void)
00191 {
00192   if (NULL == g_pChannelData)
00193     return;
00194
00195   DoActivateDataChannel(S_OK != g_pChannelData->IsActive());
00196 }
00197
00198
00199 VOID CmdChannelData(void)
00200 {
00201   DoCreateDataChannel(GetCurrentConference());
00202 }
00203
00204 VOID CmdChat(void)
00205 {
00206   TCHAR sz[MAX_PATH + 1];
00207   ZeroMemory(sz, (MAX_PATH+1) * sizeof(TCHAR));
00208
00209   // Get the text line
00210   SendMessage(ghwndChat, WM_GETTEXT, (WPARAM) MAX_PATH, (LPARAM) sz);
00211   SendMessage(ghwndChat, EM_SETSEL, (WPARAM) 0, (LPARAM)-1);
00212   SendMessage(ghwndChat, WM_SETTEXT, (WPARAM) 0, (LPARAM) "");
00213
00214   if (NULL != g_pChannelData)
00215   {
00216     INmMember * pMember = NULL;
00217     int iSel = SendMessage(ghwndUList, CB_GETCURSEL, 0, 0);
00218     if (CB_ERR != iSel)
00219     {
00220       PUSER pUser = (PUSER) SendMessage(ghwndUList, CB_GETITEMDATA, (WPARAM) iSel, 0);
00221       if (NULL != pUser)
00222         pMember = pUser->pMember;
00223     }
00224     DoSendChatMsg(sz, pMember);
00225   }
00226
00227   SetFocus(ghwndChat);
00228 }
00229
00230 VOID CmdAudio(void)
00231 {
00232   DlgAudio();
00233 }
00234
00235
00236 VOID CmdSendFile(void)
00237 {
00238   DlgSendFile();
00239 }
00240
00241 VOID CmdSysInfo(void)
00242 {
00243   DumpSysInfo();
00244 }
00245
00246 VOID CmdConfInfo(void)
00247 {
00248   DoEnumAll();
00249 }
00250
00251 VOID CmdConfLeak(void)
00252 {
00253   DoEnumMemberLeak();
00254 }
00255
00256 VOID CmdConfAppLeak(void)
00257 {
00258   DoSharableAppLeak();
00259 }
00260
00261 VOID CmdOptions(void)
00262 {
00263   DlgOptions();
00264 }
00265
00266
00267 VOID CmdUpdate(void)
00268 {
00269   UpdateConfView();
00270 }
00271
00272
00273 VOID CmdTopMost(void)
00274 {
00275
00276   TCHAR szTitle[MAX_PATH+1];
00277   WNDCLASSEX  wc;
00278   HWND hwndTest;
00279
00280   ZeroMemory(szTitle, sizeof(TCHAR) * (MAX_PATH + 1));
00281   ZeroMemory(&wc, sizeof(WNDCLASSEX));
00282
00283   ASSERT(NULL != ghwndMain);
00284   ASSERT(NULL != ghInst);
00285
00286 //  ghAccelTable = LoadAccelerators(ghInst, MAKEINTRESOURCE(ID_APPACCEL));
00287
00288   LoadString(ghInst, IDS_APP_TITLE, szTitle, MAX_PATH);
00289
00290   wc.cbSize        = sizeof(WNDCLASSEX);
00291   wc.style         = CS_HREDRAW | CS_VREDRAW;
00292   wc.lpfnWndProc   = (WNDPROC)WndProc;
00293   wc.cbClsExtra    = 0;
00294   wc.cbWndExtra    = 0;
00295   wc.hInstance     = ghInst;
00296   wc.hIcon         = LoadIcon(ghInst, MAKEINTRESOURCE(ICO_TOPMOST));
00297   wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00298   wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
00299   wc.lpszMenuName  = NULL;
00300   wc.lpszClassName = TEXT("NMTOPMOST");
00301   wc.hIconSm       = NULL;
00302
00303   if(!RegisterClassEx(&wc))
00304     return;
00305
00306   hwndTest = CreateWindowEx(
00307     WS_EX_TOPMOST,  // dwExStyle - extended styles
00308     TEXT("NMTOPMOST"),   // lpClassName - class name
00309     TEXT("szTitle"),     // window name
00310     WS_POPUP|WS_OVERLAPPEDWINDOW, // window style
00311     CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, // x, y, dx, dy
00312     NULL, // parent window handle
00313     NULL, // menu handle
00314     ghInst, // instance of app
00315     NULL); // window creation data
00316
00317   if (hwndTest == NULL)
00318     return;
00319
00320   ShowWindow(hwndTest, SW_SHOWNORMAL);
00321   UpdateWindow(hwndTest);
00322
00323 }
00324
00325 //****************************************************************************
00326 //
00327 // VOID CmdViewSbar(void)
00328 //
00329 // Show/Hide the status bar
00330 //
00331 //****************************************************************************
00332
00333 VOID CmdViewSbar(void)
00334 {
00335   gPref.fSbar = !gPref.fSbar;
00336   ShowHwnd(ghwndSbar, gPref.fSbar, IDM_VIEW_SBAR);
00337 }
00338
00339
00340 //****************************************************************************
00341 //
00342 // VOID CmdViewTbar(void)
00343 //
00344 //****************************************************************************
00345
00346 VOID CmdViewTbar(void)
00347 {
00348   gPref.fTbar = !gPref.fTbar;
00349   ShowHwnd(ghwndTbar, gPref.fTbar, IDM_VIEW_TBAR);
00350 }
00351
00352
00353 //****************************************************************************
00354 //
00355 // VOID CmdViewChat(void)
00356 //
00357 //****************************************************************************
00358
00359 VOID CmdViewChat(void)
00360 {
00361   gPref.fChat = !gPref.fChat;
00362   ShowWindow(ghwndSend, gPref.fChat ? SW_SHOW : SW_HIDE);
00363   ShowWindow(ghwndUList, gPref.fChat ? SW_SHOW : SW_HIDE);
00364   ShowHwnd(ghwndChat, gPref.fChat, IDM_VIEW_CHAT);
00365 }
00366
00367
00368 //****************************************************************************
00369 //
00370 // VOID CmdViewMsg(void)
00371 //
00372 //****************************************************************************
00373
00374 VOID CmdViewMsg(void)
00375 {
00376   gPref.fMsg = !gPref.fMsg;
00377   ShowHwnd(ghwndMsg, gPref.fMsg, IDM_VIEW_MSG);
00378   SetToolbarCheck(IDM_VIEW_MSG, gPref.fMsg);
00379 }
00380
00381
00382 //****************************************************************************
00383 //
00384 // VOID CmdClear(void)
00385 //
00386 // Clear the message window
00387 //
00388 //****************************************************************************
00389
00390 VOID CmdClear(void)
00391 {
00392   ClearLog();
00393 }
00394
00395
00396 //****************************************************************************
00397 //
00398 // VOID CmdClear(void)
00399 //
00400 // Shutdown the application.
00401 //
00402 //****************************************************************************
00403
00404 VOID CmdExit(void)
00405 {
00406   WritePref();
00407   DestroyWindow(ghwndMain);
00408 }
00409
00410
00411 //****************************************************************************
00412 //
00413 // VOID CmdHelp(void)
00414 //
00415 // Bring up help for the application
00416 //
00417 //****************************************************************************
00418
00419 VOID CmdHelp(void)
00420 {
00421   TCHAR  szFile[MAX_PATH + 1];
00422
00423   ZeroMemory(szFile, (MAX_PATH + 1) * sizeof(TCHAR));
00424
00425   GetModuleFileName(ghInst, szFile, MAX_PATH);
00426
00427   // convert the app name to the help filename (foo.exe => foo.hlp)
00428
00429   LPTSTR  tsz = SzFindLastCh(szFile, _T('.'));
00430   if  ( (NULL != tsz)
00431     &&  (MAX_PATH - 4 > (tsz - szFile) / sizeof(TCHAR))
00432     &&  (tsz > szFile)
00433     )
00434   {
00435     _sntprintf(tsz, 4, TEXT(".hlp"));
00436     WinHelp(ghwndMain, szFile, HELP_CONTENTS, 0);
00437   }
00438 }
00439
00440
00441 //****************************************************************************
00442 //
00443 // VOID CmdFont(void)
00444 //
00445 // Change the font for the message window
00446 //
00447 //****************************************************************************
00448
00449 VOID CmdFont(void)
00450 {
00451   CHOOSEFONT cf;
00452   LOGFONT    lf;
00453   HFONT      hfont;
00454
00455   ZeroMemory(&cf, sizeof(CHOOSEFONT));
00456   ZeroMemory(&lf, sizeof(LOGFONT));
00457   ZeroMemory(&hfont, sizeof(HFONT));
00458
00459   lf = gPref.lf;
00460
00461   cf.lStructSize = sizeof(CHOOSEFONT);
00462   cf.hwndOwner = ghwndMain;
00463   cf.lpLogFont = &lf;
00464   cf.iPointSize = 10;
00465   cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_INITTOLOGFONTSTRUCT;
00466
00467   if (ChooseFont(&cf) != TRUE)
00468     return;
00469
00470   hfont= CreateFontIndirect(cf.lpLogFont);
00471   if (NULL == hfont)
00472     return;
00473
00474   MaybeDeleteObject((HGDIOBJ *) &ghfontEntry);
00475   ghfontEntry = hfont;
00476   SendMessage(ghwndMsg, WM_SETFONT,
00477     (WPARAM) ghfontEntry, MAKELPARAM(TRUE, 0));
00478
00479   gPref.lf = lf;
00480 }
00481
00482
00483 //****************************************************************************
00484 //
00485 // VOID CmdAbout(void)
00486 //
00487 // Display the about box
00488 //
00489 //****************************************************************************
00490
00491 VOID CmdAbout(void)
00492 {
00493   TCHAR szVersion[MAX_PATH + 1];
00494   ZeroMemory(szVersion, sizeof(TCHAR) * (MAX_PATH + 1));
00495
00496   LoadString(ghInst, IDS_VERSION, szVersion, MAX_PATH);
00497
00498   ShellAbout(ghwndMain, szVersion, NULL, LoadIcon(ghInst, MAKEINTRESOURCE(ICO_MAIN)));
00499 }
00500
00501 //****************************************************************************
00502 //
00503 // VOID CmdEnableAppSharing(void)
00504 //
00505 // Enable appsharing if it isn't already Enabled
00506 //
00507 //****************************************************************************
00508
00509 typedef BOOL (WINAPI *LPFNDLLFUNC)(HWND);
00510
00511 VOID CmdEnableAppSharing(void)
00512 {
00513   BOOL RetVal= IsSharingEnabled();
00514
00515   if(FALSE == RetVal)
00516   {
00517     HINSTANCE hDLL      = 0;
00518     LPFNDLLFUNC lpfnDllFunc1  = 0;    // Function pointer
00519     TCHAR szDLL[MAX_PATH + 1];
00520     TCHAR szFunc[MAX_PATH + 1];
00521     int retVal          = 0;
00522
00523     ZeroMemory(szDLL, (MAX_PATH + 1) * sizeof(TCHAR));
00524     ZeroMemory(szFunc, (MAX_PATH + 1)* sizeof(TCHAR));
00525
00526     LoadString(ghInst, IDS_DLLNAME, szDLL, MAX_PATH);
00527     LoadString(ghInst, IDS_SETUPDD_FUNC, szFunc, MAX_PATH);
00528
00529     // Load Library on the setupdd.dll
00530     hDLL = LoadLibrary(szDLL);
00531
00532     if (hDLL != NULL)
00533     {
00534       lpfnDllFunc1 = (LPFNDLLFUNC)GetProcAddress(hDLL, szFunc);
00535       if (!lpfnDllFunc1)
00536       {
00537         // handle the error
00538         ERROR_MSG(TEXT("Could not find the %s function\r\n"), szFunc);
00539         retVal = FALSE;
00540       }
00541       else
00542       {
00543         TRACE_MSG(TEXT("Found the %s function\r\n"), szFunc);
00544
00545         // call the function
00546         retVal = lpfnDllFunc1(ghwndMain);
00547
00548         TRACE_MSG(TEXT("%s returns %s\r\n"), szFunc, (retVal ? "TRUE" : "FALSE"));
00549
00550       }
00551       FreeLibrary(hDLL);
00552
00553       ::MessageBox(ghwndMain,TEXT("Attempt to enable sharing... COMPLETE - REBOOT NOW!"), TEXT("AppSharing Enabled"), MB_OK);
00554
00555     }
00556     else
00557     {
00558       ::MessageBox(ghwndMain, TEXT("Could not load Setupdd.dll"), TEXT("Error in Enabling Appsharing"), MB_OK);
00559     }
00560
00561   }
00562   else
00563     ::MessageBox(ghwndMain, TEXT("AppSharing Already Enabled"), TEXT("AppShare Status"), MB_OK);
00564
00565 }
00566
00567 //****************************************************************************
00568 //
00569 // VOID CmdIsSharingEnabled()
00570 //
00571 //  TRUE- if AppSharing is enabled
00572 //  FALSE- if AppSharing is not enabled
00573 //
00574 //****************************************************************************
00575
00576 VOID CmdIsSharingEnabled()
00577 {
00578   BOOL RetVal= IsSharingEnabled();
00579
00580   if(FALSE == RetVal)
00581     ::MessageBox(ghwndMain, TEXT("AppSharing Is Not Enabled"), TEXT("AppShare Enable Status"), MB_OK);
00582   else
00583     ::MessageBox(ghwndMain, TEXT("AppSharing Already Enabled"), TEXT("AppShare Enable Status"), MB_OK);
00584
00585
00586 }
00587
00588 //****************************************************************************
00589 //
00590 // VOID OnStartup(void)
00591 //
00592 // Perform any automatic startup commands
00593 //
00594 //****************************************************************************
00595
00596 VOID OnStartup(void)
00597 {
00598   if (gPref.fAutoMonitor)
00599   {
00600     CmdMonitor();
00601   }
00602
00603   if (gPref.fAutoHost)
00604   {
00605     DoConferenceCreate();
00606   }
00607
00608   if (gPref.fAutoCall)
00609   {
00610     DoCallCreate();
00611   }
00612 }
00613
00614
00615 //****************************************************************************
00616 //
00617 // Main window command table definition.
00618 //
00619 //****************************************************************************
00620
00621
00622 static CMD _rgcmdMain[] =
00623 {
00624   {IDM_MONITOR,             CmdMonitor},
00625   {IDM_SYSINFO,             CmdSysInfo},
00626   {IDM_EXIT,                CmdExit},
00627
00628   {IDM_CONF_START,          CmdConfStart},
00629   {IDM_CONF_STOP,           CmdConfStop},
00630   {IDM_CONFINFO,            CmdConfInfo},
00631   {IDM_CONF_LEAK,           CmdConfLeak},
00632   {IDM_CONF_LEAK2,          CmdConfAppLeak},
00633
00634   {IDM_VIEW_SBAR,           CmdViewSbar},
00635   {IDM_VIEW_TBAR,           CmdViewTbar},
00636   {IDM_VIEW_MSG,            CmdViewMsg},
00637   {IDM_VIEW_CHAT,           CmdViewChat},
00638   {IDM_VIEW_CLEAR,          CmdClear},
00639   {IDM_VIEW_FONT,           CmdFont},
00640   {IDM_OPTIONS,             CmdOptions},
00641
00642   {IDM_LAUNCH,              CmdLaunch},
00643   {IDM_EJECT,               CmdEject},
00644   {IDM_UPDATE,              CmdUpdate},
00645
00646   {IDM_CALL,                CmdCall},
00647   {IDM_CALL_CONF,           CmdCallConf},
00648   {IDM_CALL_ACCEPT,         CmdCallAccept},
00649   {IDM_CALL_REJECT,         CmdCallReject},
00650   {IDM_CALL_CANCEL,         CmdCallCancel},
00651
00652   {IDM_CHANNEL_DATA,        CmdChannelData},
00653   {IDM_CHANNEL_AUDIO,       CmdAudio},
00654   {IDM_CHANNEL_FT,          CmdSendFile},
00655   {IDM_CHANNEL_SHARE,       CmdShare},
00656
00657   {IDW_SEND,                CmdChat},
00658   {IDM_FT_CANCEL,           CmdFtCancel},
00659   {IDM_DATA_ENABLE,         CmdDataEnable},
00660
00661   {IDM_HELP,                CmdHelp},
00662   {IDM_ABOUT,               CmdAbout},
00663
00664   {IDM_TOPMOST,             CmdTopMost},
00665   {IDM_LOGONOFF,        CmdSysLogOnOff},
00666   {IDM_SHOWLOCAL,       CmdShowLocal},
00667   {IDM_ENABLE_APPSHARING,   CmdEnableAppSharing},
00668   {IDM_IS_SHARING_ENABLED,   CmdIsSharingEnabled},
00669   {0, NULL}  // MUST be last entry in the table
00670 };
00671
00672
00673 //****************************************************************************
00674 //
00675 // LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
00676 //
00677 // Handle a WM_COMMAND message
00678 //
00679 //****************************************************************************
00680
00681 LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
00682 {
00683   UINT wCmd = (UINT) GET_WM_COMMAND_ID(wparam, lparam);
00684
00685   for (LPCMD lpcmd = _rgcmdMain; 0 != lpcmd->wCmd; lpcmd++)
00686   {
00687     if (wCmd == lpcmd->wCmd)
00688     {
00689       lpcmd->pfncmd();
00690       break;
00691     }
00692   }
00693
00694   return 0L;
00695 }
00696
00697
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEvent Member List

This is the complete list of members for CEvent, including all inherited members.
Beep(short alert) | CEvent | [inline]
CEvent() | CEvent | [inline]
m_cRef | CEvent |
~CEvent() | CEvent | [inline]
Generated on Wed Nov 13 2024 16:56:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/doc.Cpp Source File

  • Com
  • Fundamentals
  • SimpSvr

doc.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: DOC.CPP
00003 //
00004 //      Implementation file for CSimpSvrDoc.
00005 //
00006 // Functions:
00007 //
00008 //      See DOC.H for Class Definition
00009 //
00010 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "obj.h"
00015 #include "app.h"
00016 #include "doc.h"
00017
00018 //**********************************************************************
00019 //
00020 // CSimpSvrDoc::Create
00021 //
00022 // Purpose:
00023 //
00024 //      Creation for the CSimpSvrDoc Class
00025 //
00026 // Parameters:
00027 //
00028 //      CSimpSvrApp FAR * lpApp  -   Pointer to the CSimpSvrApp Class
00029 //
00030 //      LPRECT lpRect           -   Client area rect of "frame" window
00031 //
00032 //      HWND hWnd               -   Window Handle of "frame" window
00033 //
00034 // Return Value:
00035 //
00036 //      None
00037 //
00038 // Function Calls:
00039 //      Function                    Location
00040 //
00041 //      StgCreateDocfile            OLE API
00042 //      CreateWindow                Windows API
00043 //      ShowWindow                  Windows API
00044 //      UpdateWindow                Windows API
00045 //      CSimpSvrDoc::CSimpSvrDoc    DOC.CPP
00046 //      CreateHatchWindow           OLESTD
00047 //
00048 // Comments:
00049 //
00050 //      This routine was added so that failure could be returned
00051 //      from object creation.
00052 //
00053 //********************************************************************
00054
00055 CSimpSvrDoc FAR * CSimpSvrDoc::Create(CSimpSvrApp FAR *lpApp, LPRECT lpRect,HWND hWnd)
00056 {
00057         CSimpSvrDoc FAR * lpTemp = new CSimpSvrDoc(lpApp, hWnd);
00058
00059         if (!lpTemp)
00060                 return NULL;
00061
00062         // create the document Window
00063         lpTemp->m_hDocWnd = CreateWindow(
00064                         "DocWClass",
00065                         NULL,
00066                         WS_CHILD | WS_CLIPSIBLINGS,
00067                         lpRect->left,
00068                         lpRect->top,
00069                         lpRect->right,
00070                         lpRect->bottom,
00071                         hWnd,
00072                         NULL,
00073                         lpApp->GethInst(),
00074                         NULL);
00075
00076         if (!lpTemp->m_hDocWnd)
00077                 goto error;
00078
00079         lpTemp->ShowDocWnd();
00080
00081         lpTemp->m_hHatchWnd = CreateHatchWindow( lpTemp->m_hDocWnd, lpApp->GethInst());
00082
00083         lpTemp->HideHatchWnd();
00084
00085         return (lpTemp);
00086
00087 error:
00088         delete (lpTemp);
00089         return NULL;
00090
00091 }
00092
00093 //**********************************************************************
00094 //
00095 // CSimpSvrDoc::CSimpSvrDoc
00096 //
00097 // Purpose:
00098 //
00099 //      Constructor for the CSimpSvrDoc Class
00100 //
00101 // Parameters:
00102 //
00103 //      CSimpSvrApp FAR * lpApp  -   Pointer to the CSimpSvrApp Class
00104 //
00105 //      HWND hWnd               -   Window Handle of "frame" window
00106 //
00107 // Return Value:
00108 //
00109 //      None
00110 //
00111 // Function Calls:
00112 //      Function                    Location
00113 //
00114 //      OutputDebugString           Windows API
00115 //      GetMenu                     Windows API
00116 //      GetSubMenu                  Windows API
00117 //
00118 // Comments:
00119 //
00120 //********************************************************************
00121
00122 CSimpSvrDoc::CSimpSvrDoc(CSimpSvrApp FAR * lpApp,HWND hWnd)
00123 {
00124         OutputDebugString("In CSimpSvrDoc's Constructor\r\n");
00125         m_lpApp = lpApp;
00126         m_lpObj = NULL;
00127         m_fClosing = FALSE;
00128
00129         // set up menu handles
00130
00131
00132 }
00133
00134 //**********************************************************************
00135 //
00136 // CSimpSvrDoc::~CSimpSvrDoc
00137 //
00138 // Purpose:
00139 //
00140 //      Destructor for CSimpSvrDoc
00141 //
00142 // Parameters:
00143 //
00144 //      None
00145 //
00146 // Return Value:
00147 //
00148 //      None
00149 //
00150 // Function Calls:
00151 //      Function                    Location
00152 //
00153 //      OutputDebugString           Windows API
00154 //      DestroyWindow               Windows API
00155 //      CSimpSvrApp::ClearDoc       APP.CPP
00156 //
00157 // Comments:
00158 //
00159 //********************************************************************
00160
00161 CSimpSvrDoc::~CSimpSvrDoc()
00162 {
00163         OutputDebugString("In CSimpSvrDoc's Destructor\r\n");
00164         m_lpApp->ClearDoc();
00165         DestroyWindow(m_hHatchWnd);
00166 }
00167
00168
00169 //**********************************************************************
00170 //
00171 // CSimpSvrDoc::QueryInterface
00172 //
00173 // Purpose:
00174 //
00175 //      Return a pointer to a requested interface
00176 //
00177 // Parameters:
00178 //
00179 //      REFIID riid         -   ID of interface to be returned
00180 //      LPVOID FAR* ppvObj  -   Location to return the interface
00181 //
00182 // Return Value:
00183 //
00184 //      E_NOINTERFACE -   Always
00185 //
00186 // Function Calls:
00187 //      Function                    Location
00188 //
00189 //      OutputDebugString           Windows API
00190 //      CSimpSvrApp::QueryInterface APP.CPP
00191 //
00192 // Comments:
00193 //
00194 //      Since the document could contain multiple objects, all
00195 //      interfaces except those associated with the document should
00196 //      be returned.  In this implementation, there are no doc level
00197 //      interfaces.
00198 //
00199 //********************************************************************
00200
00201 STDMETHODIMP CSimpSvrDoc::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
00202 {
00203         OutputDebugString("In CSimpSvrDoc::QueryInterface\r\n");
00204
00205         SCODE sc = E_NOINTERFACE;
00206
00207         if ( (riid == IID_IUnknown) )
00208            {
00209            AddRef();
00210            *ppvObj = this;
00211            sc = S_OK;
00212            }
00213
00214         return sc;
00215 }
00216
00217 //**********************************************************************
00218 //
00219 // CSimpSvrDoc::AddRef
00220 //
00221 // Purpose:
00222 //
00223 //      Increments the document level reference count
00224 //
00225 // Parameters:
00226 //
00227 //      None
00228 //
00229 // Return Value:
00230 //
00231 //      UINT    -   The current reference count on the document
00232 //
00233 // Function Calls:
00234 //      Function                    Location
00235 //
00236 //      OutputDebugString           Windows API
00237 //      CSimpSvrApp::AddRef         APP.CPP
00238 //
00239 // Comments:
00240 //
00241 //      The reference count at this level reflects the total ref.
00242 //      count of all interfaces on all objects contained within
00243 //      this document.  Note that it also "trickles up" the
00244 //      ref count to the app level.
00245 //
00246 //********************************************************************
00247
00248 STDMETHODIMP_(ULONG) CSimpSvrDoc::AddRef()
00249 {
00250         OutputDebugString("In CSimpSvrDoc::AddRef\r\n");
00251         // AddRef the app, but return the doc count
00252         m_lpApp->AddRef();
00253
00254         return SafeAddRef();
00255 }
00256
00257 //**********************************************************************
00258 //
00259 // CSimpSvrDoc::Release
00260 //
00261 // Purpose:
00262 //
00263 //      Decrements the document level reference count
00264 //
00265 // Parameters:
00266 //
00267 //      None
00268 //
00269 // Return Value:
00270 //
00271 //      UINT    -   The current reference count on the document
00272 //
00273 // Function Calls:
00274 //      Function                    Location
00275 //
00276 //      OutputDebugString           Windows API
00277 //      CSimpSvrApp::Release         APP.CPP
00278 //
00279 // Comments:
00280 //
00281 //      The reference count at this level reflects the total ref.
00282 //      count of all interfaces on all objects contained within
00283 //      this document.  Note that it also "trickles up" the
00284 //      ref count to the app level.
00285 //
00286 //********************************************************************
00287
00288 STDMETHODIMP_(ULONG) CSimpSvrDoc::Release()
00289 {
00290         OutputDebugString("In CSimpSvrDoc::Release\r\n");
00291         // Release the app, but return the app count
00292         m_lpApp->Release();
00293
00294         return SafeRelease();
00295 }
00296
00297 //**********************************************************************
00298 //
00299 // CSimpSvrDoc::lResizeDoc
00300 //
00301 // Purpose:
00302 //
00303 //      Resizes the document
00304 //
00305 // Parameters:
00306 //
00307 //      LPRECT lpRect   -   The size of the client are of the "frame"
00308 //                          Window.
00309 //
00310 // Return Value:
00311 //
00312 //      NULL
00313 //
00314 // Function Calls:
00315 //      Function                                Location
00316 //
00317 //      MoveWindow                              Windows API
00318 //
00319 // Comments:
00320 //
00321 //********************************************************************
00322
00323 long CSimpSvrDoc::lResizeDoc(LPRECT lpRect)
00324 {
00325         MoveWindow(m_hDocWnd, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, TRUE);
00326         return NULL;
00327 }
00328
00329
00330 //**********************************************************************
00331 //
00332 // CSimpSvrDoc::PaintDoc
00333 //
00334 // Purpose:
00335 //
00336 //      Paints the Document
00337 //
00338 // Parameters:
00339 //
00340 //      HDC hDC -   hDC of the document Window
00341 //
00342 // Return Value:
00343 //
00344 //      None
00345 //
00346 // Function Calls:
00347 //      Function                    Location
00348 //
00349 //      CSimpSvrObj::Draw                   OBJ.CPP
00350 //      CSimpSvrObj::GetDataAdviseHolder    OBJ.H
00351 //      CSimpSvrObj::GetDataObject          OBJ.H
00352 //      CSimpAppObj::IsStartedByOle         APP.CPP
00353 //      IDataAdviseHolder::SendOnDataChange OLE API
00354 //
00355 // Comments:
00356 //
00357 //********************************************************************
00358
00359 void CSimpSvrDoc::PaintDoc (HDC hDC)
00360 {
00361         // if the object hasn't been created yet, then don't draw
00362         if (m_lpObj)
00363                 m_lpObj->Draw(hDC,FALSE);
00364         else
00365                 return;
00366
00367         CStabilize stabilize(this);
00368
00369         // Sending a data change every time we paint, but only if we
00370         // were started by OLE
00371         if (m_lpApp->IsStartedByOle())
00372                         m_lpObj->SendOnDataChange( );
00373 }
00374
00375
00376
00377 //**********************************************************************
00378 //
00379 // CSimpSvrDoc::CreateObject
00380 //
00381 // Purpose:
00382 //
00383 //
00384 // Parameters:
00385 //
00386 //
00387 // Return Value:
00388 //
00389 //      NOERROR if the function succeeds, otherwise E_FAIL
00390 //
00391 // Function Calls:
00392 //      Function                    Location
00393 //
00394 //      CSimpSvrObj::CSimpSvrObj    OBJ.CPP
00395 //      CSimpSvrOjb::QueryInterface OBJ.CPP
00396 //
00397 // Comments:
00398 //
00399 //********************************************************************
00400
00401 HRESULT CSimpSvrDoc::CreateObject(REFIID riid, LPVOID FAR *ppvObject)
00402 {
00403         SCODE sc = E_FAIL;
00404
00405         m_lpObj = new CSimpSvrObj(this);
00406
00407         if (m_lpObj)
00408                 {
00409                 m_lpObj->QueryInterface(riid, ppvObject);
00410                 sc = S_OK;
00411                 }
00412
00413         return sc;
00414 }
00415
00416 //**********************************************************************
00417 //
00418 // CSimpSvrDoc::Close
00419 //
00420 // Purpose:
00421 //
00422 //      Closes the object
00423 //
00424 // Parameters:
00425 //
00426 //      None
00427 //
00428 // Return Value:
00429 //
00430 //      None
00431 //
00432 // Function Calls:
00433 //      Function                                Location
00434 //
00435 //      OutputDebugString                       Windows API
00436 //      CSimpSvrObj::AddRef                     OBJ.CPP
00437 //      CSimpSvrObj::Release                    OBJ.CPP
00438 //      CSimpSvrObj::IsInPlaceActive            OBJ.H
00439 //      CSimpSvrObj::GetOleInPlaceObject        OBJ.H
00440 //      CSimpSvrObj::ClearOleClientSite         OBJ.H
00441 //      CSimpSvrObj::GetDataAdviseHolder        OBJ.H
00442 //      CSimpSvrObj::GetOleClientSite           OBJ.H
00443 //      CSimpSvrObj::ClearDataAdviseHolder      OBJ.H
00444 //      CSimpSvrObj::GetOleAdviseHolder         OBJ.H
00445 //      CSimpSvrObj::ClearOleAdviseHolder       OBJ.H
00446 //      IOleInPlaceObject::InPlaceDeactivate    Container
00447 //      IOleClientSite::SaveObject              Container
00448 //      IOleClientSite::OnShowWindow            Container
00449 //      IOleClientSite::Release                 Container
00450 //      IDataAdviseHolder::SendOnDataChange     OLE
00451 //      IDataAdviseHolder::Release              OLE
00452 //      IOleAdviseHolder::SendOnClose           OLE
00453 //      IOleAdviseHolder::Release               OLE
00454 //
00455 // Comments:
00456 //
00457 //********************************************************************
00458
00459 void CSimpSvrDoc::Close()
00460 {
00461         OutputDebugString("In CSimpSvrDoc::Close() \r\n");
00462         CStabilize stabilize(this);
00463
00464         m_lpObj->AddRef(); // hold object alive
00465
00466         if (m_fClosing)
00467                 return;
00468
00469         m_fClosing = TRUE;
00470
00471         // if the object is currently inplace active, then deactivate
00472         if (m_lpObj->IsInPlaceActive())
00473                 m_lpObj->GetOleInPlaceObject()->InPlaceDeactivate();
00474
00475         // unregister from the ROT...
00476         if (m_lpObj->GetRotRegister())
00477                 {
00478                 LPRUNNINGOBJECTTABLE lpRot;
00479
00480                 if (GetRunningObjectTable (0, &lpRot) == NOERROR )
00481                         {
00482                         lpRot->Revoke(m_lpObj->GetRotRegister());
00483                         lpRot->Release();
00484                         }
00485                 }
00486
00487         // if we have a clientsite, instruct it to save the object
00488         if (m_lpObj->GetOleClientSite())
00489                 {
00490                 m_lpObj->GetOleClientSite()->SaveObject();
00491                 m_lpObj->GetOleClientSite()->OnShowWindow(FALSE);
00492                 }
00493
00494         // Do a final SendOnDataChange for those containers that have specified the
00495         // ADF_DATAONSTOP flag.
00496         if (m_lpObj->GetDataAdviseHolder())
00497                 {
00498                 m_lpObj->GetDataAdviseHolder()->SendOnDataChange( m_lpObj->GetDataObject(), 0, ADVF_DATAONSTOP);
00499                 m_lpObj->GetDataAdviseHolder()->Release();
00500                 m_lpObj->ClearDataAdviseHolder();
00501                 }
00502
00503
00504         // Tell the container that we are shutting down.
00505         if (m_lpObj->GetOleAdviseHolder())
00506                 {
00507                 m_lpObj->GetOleAdviseHolder()->SendOnClose();
00508                 m_lpObj->GetOleAdviseHolder()->Release();
00509                 m_lpObj->ClearOleAdviseHolder();
00510                 }
00511
00512         if (m_lpObj->GetOleClientSite())
00513                 {
00514                 m_lpObj->GetOleClientSite()->Release();
00515                 m_lpObj->ClearOleClientSite();
00516                 }
00517
00518         // release our streams and storage
00519         m_lpObj->GetPersistStorage()->ReleaseStreamsAndStorage();
00520
00521         // Disconnect the object.  NOTE: This call should not do anything
00522         // unless the container has cause a GP Fault or some other problem
00523         // has occured...
00524         OutputDebugString("*** Before CoDisconnectObject *** \r\n");
00525         CoDisconnectObject((LPUNKNOWN)m_lpObj, 0);
00526         OutputDebugString("*** After CoDisconnectObject *** \r\n");
00527
00528         m_lpObj->Release(); // let object close
00529
00530 }
00531
00532
00533 //**********************************************************************
00534 //
00535 // CSimpSvrDoc::SetStatusText
00536 //
00537 // Purpose:
00538 //
00539 //      Sets the Container's status bar text
00540 //
00541 // Parameters:
00542 //
00543 //      None
00544 //
00545 // Return Value:
00546 //
00547 //      None
00548 //
00549 // Function Calls:
00550 //      Function                        Location
00551 //
00552 //      CSimpSvrObj::IsInPlaceActive    OBJ.CPP
00553 //      IOleInPlaceFrame::SetStatusText Container
00554 //
00555 // Comments:
00556 //
00557 //      Even though there is no status line in this sample, this
00558 //      method must be called on WM_MENUSELECT to clear the last
00559 //      message in the status line.
00560 //
00561 //********************************************************************
00562
00563 void CSimpSvrDoc::SetStatusText()
00564 {
00565         CStabilize stabilize(this);
00566         if (m_lpObj->IsInPlaceActive())
00567                 //@@WTK WIN32, UNICODE
00568                 //m_lpObj->GetInPlaceFrame()->SetStatusText("\0");
00569                 m_lpObj->GetInPlaceFrame()->SetStatusText(OLESTR("\0"));
00570 }
00571
00572 //**********************************************************************
00573 //
00574 // CSimpSvrDoc::ShowDocWnd
00575 //
00576 // Purpose:
00577 //
00578 //      Shows the Document Window
00579 //
00580 // Parameters:
00581 //
00582 //      None
00583 //
00584 // Return Value:
00585 //
00586 //      None
00587 //
00588 // Function Calls:
00589 //      Function                        Location
00590 //
00591 //      ShowWindow                      Windows API
00592 //      UpdateWindow                    Windows API
00593 //
00594 // Comments:
00595 //
00596 //********************************************************************
00597
00598 void CSimpSvrDoc::ShowDocWnd()
00599 {
00600         ShowWindow(m_hDocWnd, SW_SHOWNORMAL);  // Show the window
00601         UpdateWindow(m_hDocWnd);               // Sends WM_PAINT message
00602 }
00603
00604 //**********************************************************************
00605 //
00606 // CSimpSvrDoc::ShowHatchWnd
00607 //
00608 // Purpose:
00609 //
00610 //      Shows the hatch Window
00611 //
00612 // Parameters:
00613 //
00614 //      None
00615 //
00616 // Return Value:
00617 //
00618 //      None
00619 //
00620 // Function Calls:
00621 //      Function                        Location
00622 //
00623 //      ShowWindow                      Windows API
00624 //
00625 // Comments:
00626 //
00627 //********************************************************************
00628
00629 void CSimpSvrDoc::ShowHatchWnd()
00630 {
00631         ShowWindow(m_hHatchWnd, SW_SHOW);
00632 }
00633
00634 //**********************************************************************
00635 //
00636 // CSimpSvrDoc::HideDocWnd
00637 //
00638 // Purpose:
00639 //
00640 //      Hides the DocumentWindow
00641 //
00642 // Parameters:
00643 //
00644 //      None
00645 //
00646 // Return Value:
00647 //
00648 //      None
00649 //
00650 // Function Calls:
00651 //      Function                        Location
00652 //
00653 //      ShowWindow                      Windows API
00654 //
00655 // Comments:
00656 //
00657 //********************************************************************
00658
00659 void CSimpSvrDoc::HideDocWnd()
00660 {
00661         ShowWindow(m_hDocWnd, SW_HIDE);
00662 }
00663
00664 //**********************************************************************
00665 //
00666 // CSimpSvrDoc::HideHatchWnd
00667 //
00668 // Purpose:
00669 //
00670 //      Hides the Hatch Window
00671 //
00672 // Parameters:
00673 //
00674 //      None
00675 //
00676 // Return Value:
00677 //
00678 //      None
00679 //
00680 // Function Calls:
00681 //      Function                        Location
00682 //
00683 //      ShowWindow                      Windows API
00684 //
00685 // Comments:
00686 //
00687 //********************************************************************
00688
00689 void CSimpSvrDoc::HideHatchWnd()
00690 {
00691         ShowWindow(m_hHatchWnd, SW_HIDE);
00692 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextSamplePropPage/ContextSamplePropPageImpl.h Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification
  • ContextSamplePropPage

ContextSamplePropPageImpl.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:  ContextSamplePropPageImpl.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016 #include "stdafx.h"
00017 #include "resource.h"
00018 #include "WMSServer.h"
00019 #include "ContextSamplePropPage.h"
00020 #include "ContextDll.h"
00021 #include <comdef.h>
00022 #include <commctrl.h>
00023
00024
00025 EXTERN_C const CLSID CLSID_ContextSamplePropPage;
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CContextSamplePropPage
00029 class ATL_NO_VTABLE CContextSamplePropPage :
00030   public CComObjectRootEx<CComSingleThreadModel>,
00031   public CComCoClass<CContextSamplePropPage, &CLSID_ContextSamplePropPage>,
00032   public IPropertyPageImpl<CContextSamplePropPage>,
00033   public CDialogImpl<CContextSamplePropPage>
00034 {
00035 public:
00036   CContextSamplePropPage();
00037   enum {IDD = IDD_CONTEXTSAMPLEPROPPAGE};
00038
00039 DECLARE_REGISTRY_RESOURCEID(IDR_CONTEXTSAMPLEPROPPAGE)
00040
00041 DECLARE_PROTECT_FINAL_CONSTRUCT()
00042
00043 BEGIN_COM_MAP(CContextSamplePropPage)
00044   COM_INTERFACE_ENTRY(IPropertyPage)
00045 END_COM_MAP()
00046
00047 BEGIN_MSG_MAP(CContextSamplePropPage)
00048   COMMAND_HANDLER(IDC_EDIT_OUTPUT_PATH, EN_CHANGE, SetDirtyFlag )
00049   MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog )
00050     COMMAND_HANDLER( IDC_CHECK_USER_CONTEXT, BN_CLICKED, SetDirtyFlag )
00051     COMMAND_HANDLER( IDC_CHECK_PRESENTATION_CONTEXT, BN_CLICKED, SetDirtyFlag )
00052     COMMAND_HANDLER( IDC_CHECK_COMMAND_REQUEST_CONTEXT, BN_CLICKED, SetDirtyFlag )
00053     COMMAND_HANDLER( IDC_CHECK_COMMAND_RESPONSE_CONTEXT, BN_CLICKED, SetDirtyFlag )
00054   CHAIN_MSG_MAP(IPropertyPageImpl<CContextSamplePropPage>)
00055 END_MSG_MAP()
00056 // Handler prototypes:
00057 //  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00058 //  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00059 //  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
00060
00061 private:
00062     HRESULT GetPluginSetting();
00063     HRESULT PopulateControls();
00064     HRESULT RetrieveDialogInformation();
00065
00066   void MessageBox(UINT id);
00067   STDMETHOD (Apply)(void);
00068   HRESULT   Connect(void);
00069   LRESULT   OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00070   LRESULT   SetDirtyFlag(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
00071   {
00072       if( !m_fInitializing )
00073       {
00074             SetDirty( TRUE );
00075       }
00076
00077       return( 0 );
00078   };
00079
00080     //
00081     //data members
00082     //
00083     CComQIPtr<IWMSContextAdmin> m_pPluginAdmin;
00084   BOOL m_fInitializing;
00085   CComBSTR m_bstrOrigOutputPath;
00086   CComBSTR m_bstrOutputPath;
00087   WMS_CONTEXT_PLUGIN_CONTEXT_TYPE m_wmsOrigContextTypes;
00088   WMS_CONTEXT_PLUGIN_CONTEXT_TYPE m_wmsContextTypes;
00089 };
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/basesnap.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

basesnap.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  This file contains implementations for IClassFactory
00014 //             and the Snap-in's DLL exported functions
00015
00016
00017 #include <ObjBase.h>
00018 #include <InitGuid.h>
00019 #include "Globals.h"
00020 #include "BaseSnap.h"
00021 #include "CompData.h"
00022 #include "About.h"
00023 #include "Registry.h"
00024
00025
00026 #include "TraceMacro.h"
00027 #undef  MODULESTRING
00028 #define MODULESTRING  _T("BaseSnap")
00029
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 //  Implementation of IClassFactory for CComponentData
00033
00034 //---------------------------------------------------------------------------
00035 CClassFactory::CClassFactory( FACTORY_TYPE eFactoryType )
00036 {
00037   m_cRef = 0;
00038   m_FactoryType = eFactoryType;
00039
00040   InterlockedIncrement((long*)&g_uObjectCount);
00041 }
00042
00043
00044 //---------------------------------------------------------------------------
00045 CClassFactory::~CClassFactory()
00046 {
00047   InterlockedDecrement((long*)&g_uObjectCount);
00048 }
00049
00050
00051 //---------------------------------------------------------------------------
00052 STDMETHODIMP CClassFactory::QueryInterface
00053 (
00054   REFIID   riid,             //[in] Identifier of the requested interface
00055   LPVOID*  ppv               //[out] Address of requested interface
00056 )
00057 {
00058   if( NULL == ppv )
00059     return E_FAIL;
00060
00061   HRESULT hResult = E_NOINTERFACE;
00062   *ppv = NULL;
00063
00064   if( IsEqualIID(riid, IID_IUnknown) )
00065   {
00066     *ppv = static_cast<IClassFactory*>(this);
00067   }
00068   else if( IsEqualIID(riid, IID_IClassFactory) )
00069   {
00070     *ppv = static_cast<IClassFactory*>(this);
00071   }
00072
00073   if( *ppv )
00074   {
00075     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00076     hResult = S_OK;
00077   }
00078
00079   return hResult;
00080 }
00081
00082
00083 //---------------------------------------------------------------------------
00084 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00085 {
00086   return InterlockedIncrement( (long*)&m_cRef );
00087 }
00088
00089
00090 //---------------------------------------------------------------------------
00091 STDMETHODIMP_(ULONG) CClassFactory::Release()
00092 {
00093   if( 0 == InterlockedDecrement( (long*)&m_cRef) )
00094   {
00095     delete this;
00096     return 0;
00097   }
00098   return m_cRef;
00099 }
00100
00101 //---------------------------------------------------------------------------
00102 //  Creates an instance of the object type which was passed in the
00103 //  class constructor
00104 //
00105 STDMETHODIMP CClassFactory::CreateInstance
00106 (
00107   LPUNKNOWN  pUnkOuter,      //[in] NULL unless object is part of aggregate
00108   REFIID     riid,           //[in] Reference to interface indentifier
00109   LPVOID*    ppvObj          //[out] Address of requested interface pointer
00110 )
00111 {
00112   HRESULT  hResult = E_FAIL;
00113   void*    pObject = NULL;
00114
00115   if( NULL == ppvObj )
00116     return hResult;
00117
00118   *ppvObj = NULL;
00119
00120   // Our object does does not support aggregation, so we need to
00121   // fail if they ask us to do aggregation.
00122   if( pUnkOuter )
00123     return CLASS_E_NOAGGREGATION;
00124
00125   // Support for providing CSnapinAbout/CComponentData objects
00126   switch( m_FactoryType )
00127   {
00128     case COMPONENTDATA:
00129       pObject = new CComponentData();
00130       break;
00131
00132     case ABOUT:
00133       pObject = new CSnapinAbout();
00134       break;
00135
00136     default:
00137       pObject = NULL;
00138   }
00139
00140   if( NULL == pObject )                // Failed to create an object
00141     return E_INVALIDARG;               // due to bad argument
00142
00143   // QueryInterface will do the AddRef() for us, don't do it here
00144   hResult = ( (LPUNKNOWN)pObject)->QueryInterface( riid, ppvObj );
00145
00146   if( S_OK != hResult )
00147     delete pObject;
00148
00149   return hResult;
00150 }
00151
00152
00153 //---------------------------------------------------------------------------
00154 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00155 {
00156   if( TRUE == fLock )
00157     InterlockedIncrement((long*)&g_uServerLocks);
00158   else
00159     InterlockedDecrement((long*)&g_uServerLocks);
00160
00161   return S_OK;
00162 }
00163
00164
00165 /////////////////////////////////////////////////////////////////////////////
00166 //  Our Snap-in's exported functions
00167 //
00168
00169 //---------------------------------------------------------------------------
00170 //  Entry point into our Snap-in DLL
00171 //
00172 BOOL WINAPI DllMain
00173 (
00174   HINSTANCE  hInstDLL,         //[in] Handle to DLL module
00175   DWORD      fdwReason,        //[in] Reason for calling function
00176   void*      lpvReserved       //[in] Reserved
00177 )
00178 {
00179   if( DLL_PROCESS_ATTACH == fdwReason )
00180   {
00181      g_hInst = hInstDLL;
00182   }
00183
00184   return TRUE;
00185 }
00186
00187
00188 //---------------------------------------------------------------------------
00189 STDAPI DllGetClassObject
00190 (
00191   REFCLSID   rclsid,         //[in] CLSID for the class object
00192   REFIID     riid,           //[in] Reference to interface identifier
00193   LPVOID     *ppvObj         //[out] Object which recieves interface pointer
00194 )
00195 {
00196   // Test for CSnapinAbout
00197   if( (rclsid != CLSID_CComponentData) && (rclsid != CLSID_CSnapinAbout) )
00198     return CLASS_E_CLASSNOTAVAILABLE;
00199
00200   if( !ppvObj )
00201     return E_FAIL;
00202
00203   *ppvObj = NULL;
00204
00205   // We can only hand out IUnknown and IClassFactory pointers.  Fail
00206   // if caller asks for anything else.
00207   if( !IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory) )
00208     return E_NOINTERFACE;
00209
00210   CClassFactory *pFactory = NULL;
00211
00212   // Create the new class factory.  Pass in the type of object to create
00213   if( rclsid == CLSID_CComponentData )
00214     pFactory = new CClassFactory(CClassFactory::COMPONENTDATA);
00215   else if( rclsid == CLSID_CSnapinAbout )
00216     pFactory = new CClassFactory(CClassFactory::ABOUT);
00217
00218
00219   HRESULT hResult = pFactory->QueryInterface( riid, ppvObj );
00220
00221   return hResult;
00222 }
00223
00224
00225 //---------------------------------------------------------------------------
00226 STDAPI DllCanUnloadNow(void)
00227 {
00228   if( 0 == g_uObjectCount && 0 == g_uServerLocks )
00229     return S_OK;
00230   else
00231     return S_FALSE;
00232 }
00233
00234
00235 //---------------------------------------------------------------------------
00236 STDAPI DllRegisterServer()
00237 {
00238   HRESULT hResult = S_FALSE;
00239
00240   do
00241   { // Support ISnapinAbout
00242     hResult = RegisterServer( g_hInst, CLSID_CSnapinAbout, gtszABOUT_NAME );
00243     BREAK_ON_ERROR( hResult );
00244
00245     hResult = RegisterServer( g_hInst, CLSID_CComponentData, gtszSNAPIN_NAME );
00246     BREAK_ON_ERROR( hResult );
00247
00248     hResult = RegisterSnapin( CLSID_CComponentData, gtszSNAPIN_NAME, CLSID_CSnapinAbout, FALSE );
00249     BREAK_ON_ERROR( hResult );
00250
00251   }while( 0 );
00252
00253   return hResult;
00254 }
00255
00256
00257 //---------------------------------------------------------------------------
00258 STDAPI DllUnregisterServer()
00259 {
00260   if( S_OK == UnregisterServer(CLSID_CComponentData) )
00261     return UnregisterSnapin(CLSID_CComponentData);
00262   else
00263     return E_FAIL;
00264 }
00265
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/about.h Source File

  • SysMgmt
  • MMC
  • Ppgeext

about.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPABOUT_H_
00020 #define _SAMPABOUT_H_
00021
00022 #include <tchar.h>
00023 #include <mmc.h>
00024
00025 class CSnapinAbout : public ISnapinAbout
00026 {
00027 private:
00028     ULONG       m_cref;
00029     HBITMAP       m_hSmallImage;
00030     HBITMAP       m_hLargeImage;
00031     HBITMAP       m_hSmallImageOpen;
00032     HICON       m_hAppIcon;
00033
00034 public:
00035     CSnapinAbout();
00036     ~CSnapinAbout();
00037
00038     ///////////////////////////////
00039     // Interface IUnknown
00040     ///////////////////////////////
00041     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042     STDMETHODIMP_(ULONG) AddRef();
00043     STDMETHODIMP_(ULONG) Release();
00044
00045     ///////////////////////////////
00046     // Interface ISnapinAbout
00047     ///////////////////////////////
00048     STDMETHODIMP GetSnapinDescription(
00049         /* [out] */ LPOLESTR *lpDescription);
00050
00051         STDMETHODIMP GetProvider(
00052         /* [out] */ LPOLESTR *lpName);
00053
00054         STDMETHODIMP GetSnapinVersion(
00055         /* [out] */ LPOLESTR *lpVersion);
00056
00057         STDMETHODIMP GetSnapinImage(
00058         /* [out] */ HICON *hAppIcon);
00059
00060         STDMETHODIMP GetStaticFolderImage(
00061         /* [out] */ HBITMAP *hSmallImage,
00062         /* [out] */ HBITMAP *hSmallImageOpen,
00063         /* [out] */ HBITMAP *hLargeImage,
00064         /* [out] */ COLORREF *cMask);
00065
00066         ///////////////////////////////
00067         // Private Interface
00068         ///////////////////////////////
00069 private:
00070     HRESULT CSnapinAbout::AllocOleStr(
00071         LPOLESTR *lpDest,
00072         _TCHAR *szBuffer);
00073 };
00074
00075 #endif _SAMPABOUT_H_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/InvokObjThreads/IsapiThread.cpp Source File

  • Web
  • iis
  • extensions
  • InvokObjThreads

IsapiThread.cpp

Go to the documentation of this file.
00001 //  Copyright (c) 1998-2002  Microsoft Corporation
00002 //
00003 //  Module Name:
00004 //
00005 //    IsapiThread.cpp
00006 //
00007 //  Abstract:
00008 //
00009 //    Implements a simple thread pool class for use with ISAPI extensions
00010
00011 #include "IsapiThread.h"
00012
00013 //  Description:
00014 //
00015 //    This function initializes the thread pool by creating the worker
00016 //    threads and the work item queue
00017 //
00018 //  Arguments:
00019 //
00020 //    pThreadProc  - Thread proc for the worker threads
00021 //    dwNumThreads - The number of threads to create in the pool
00022 //    dwQueueSize  - The size of the work item queue
00023 //
00024 //  Return Value:
00025 //
00026 //    Returns TRUE if successful, otherwise FALSE.
00027
00028 BOOL ISAPITHREAD::InitThreadPool(LPTHREAD_START_ROUTINE pThreadProc, DWORD dwNumThreads, DWORD dwQueueSize)
00029 {
00030   DWORD dwThreadId;
00031
00032   // Initialize the member variables
00033
00034   m_WorkItemQueue = NULL;
00035   m_dwCurrentItem = 0;
00036   m_dwItemsInQueue = 0;
00037   m_arrWorkerThreads = NULL;
00038   m_dwNumThreads = 0;
00039
00040   // Queue size defaults to twice the number of worker threads
00041
00042   m_dwWorkItemQueueSize = (dwQueueSize == 0xffffffff) ? dwNumThreads * 2 : dwQueueSize;
00043
00044   // Allocate the array to store the worker thread handles
00045
00046   m_arrWorkerThreads = new HANDLE[dwNumThreads];
00047
00048   if (!m_arrWorkerThreads)
00049     goto Failed;
00050
00051   // Allocate the work item queue
00052
00053   m_WorkItemQueue = new EXTENSION_CONTROL_BLOCK *[m_dwWorkItemQueueSize];
00054
00055   if (!m_WorkItemQueue)
00056     goto Failed;
00057
00058   // Initialize the queue critical section
00059
00060   InitializeCriticalSection(&m_csQueue);
00061
00062   // Start the worker threads
00063
00064   for (DWORD x = 0; x < dwNumThreads; x++)
00065   {
00066     m_arrWorkerThreads[x] = CreateThread(
00067       NULL,                 // security attributes
00068       0,                    // stack size
00069       pThreadProc,          // thread routine
00070       this,                 // parameter
00071       0,                    // flags
00072       &dwThreadId           // thread id
00073       );
00074
00075     if (m_arrWorkerThreads[x])
00076       m_dwNumThreads++;
00077     else
00078       break;
00079   }
00080
00081   if (m_dwNumThreads != dwNumThreads)
00082     goto Failed;
00083
00084   // Create the worker thread semaphore
00085
00086   m_hWorkerThreadSemaphore = CreateSemaphore(
00087     NULL,       // security attributes
00088     0,          // initial count - nonsignaled
00089     0x7fffffff, // max count
00090     NULL        // name
00091     );
00092
00093   if (!m_hWorkerThreadSemaphore)
00094     goto Failed;
00095
00096   // Done
00097
00098   return TRUE;
00099
00100 Failed:
00101
00102   // The destructor will deallocate buffers, so we don't need to here
00103
00104   return FALSE;
00105 }
00106
00107 //  Description:
00108 //
00109 //    Adds and item to the work item queue
00110 //
00111 //  Arguments:
00112 //
00113 //    pecb - A pointer to the ECB to be added to the queue
00114 //    fReleaseThread - If this flag is TRUE, release a worker thread
00115 //
00116 //  Return Value:
00117 //
00118 //    Returns TRUE if successful, FALSE if the queue is full.
00119
00120 BOOL ISAPITHREAD::QueueWorkItem(EXTENSION_CONTROL_BLOCK *pecb, BOOL fReleaseThread)
00121 {
00122   EnterCriticalSection(&m_csQueue);
00123
00124   // Check to see if the queue is full
00125
00126   if (m_dwItemsInQueue == m_dwWorkItemQueueSize)
00127     goto Failed;
00128
00129   // Add the work item to the queue
00130
00131   DWORD dwInsertionPoint = m_dwCurrentItem + m_dwItemsInQueue;
00132
00133   if (dwInsertionPoint > m_dwWorkItemQueueSize - 1)
00134     dwInsertionPoint -= m_dwWorkItemQueueSize;
00135
00136   m_WorkItemQueue[dwInsertionPoint] = pecb;
00137
00138   m_dwItemsInQueue++;
00139
00140   // Done
00141
00142   LeaveCriticalSection(&m_csQueue);
00143
00144   // If requested, release a worker thread
00145
00146   if (fReleaseThread)
00147       ReleaseThread();
00148
00149   return TRUE;
00150
00151 Failed:
00152
00153   LeaveCriticalSection(&m_csQueue);
00154
00155   return FALSE;
00156 }
00157
00158 //  Description:
00159 //
00160 //    Gets the next item from the work item queue
00161 //
00162 //  Arguments:
00163 //
00164 //    none
00165 //
00166 //  Return Value:
00167 //
00168 //    Returns a pointer to the next ECB in the queue, else NULL if the
00169 //    queue is empty
00170
00171 EXTENSION_CONTROL_BLOCK * ISAPITHREAD::GetWorkItem(void)
00172 {
00173   EnterCriticalSection(&m_csQueue);
00174
00175   // Check to see if the queue is empty
00176
00177   if (!m_dwItemsInQueue)
00178     goto Failed;
00179
00180   // Get the next item from the queue
00181
00182   EXTENSION_CONTROL_BLOCK *pRet = m_WorkItemQueue[m_dwCurrentItem];
00183
00184   m_dwCurrentItem++;
00185
00186   if (m_dwCurrentItem == m_dwWorkItemQueueSize)
00187     m_dwCurrentItem = 0;
00188
00189   m_dwItemsInQueue--;
00190
00191   // Done
00192
00193   LeaveCriticalSection(&m_csQueue);
00194
00195   return pRet;
00196
00197 Failed:
00198
00199   LeaveCriticalSection(&m_csQueue);
00200
00201   return NULL;
00202 }
00203
00204 //  Description:
00205 //
00206 //    Releases one or more waiting pool threads
00207 //
00208 //  Arguments:
00209 //
00210 //    dwNumThreads - The number of threads to release
00211 //
00212 //  Return Value:
00213 //
00214 //    None
00215
00216 void ISAPITHREAD::ReleaseThread(DWORD dwNumThreads)
00217 {
00218   ReleaseSemaphore(m_hWorkerThreadSemaphore, dwNumThreads, NULL);
00219
00220   return;
00221 }
00222
00223 //  Description:
00224 //
00225 //    Clears the work item queue
00226 //
00227 //  Arguments:
00228 //
00229 //    None
00230 //
00231 //  Return Value:
00232 //
00233 //    None
00234
00235 void ISAPITHREAD::ClearQueue(void)
00236 {
00237   EnterCriticalSection(&m_csQueue);
00238
00239   // Clear the work items in the queue
00240
00241   for (DWORD x = 0; x < m_dwWorkItemQueueSize; x++)
00242     m_WorkItemQueue[x] = NULL;
00243
00244   // Reset the index counters
00245
00246   m_dwCurrentItem = 0;
00247   m_dwItemsInQueue = 0;
00248
00249   LeaveCriticalSection(&m_csQueue);
00250
00251   return;
00252 }
00253
00254 //  Description:
00255 //
00256 //    Constructor for the ISAPITHREAD object
00257 //
00258 //  Arguments:
00259 //
00260 //    None
00261 //
00262 //  Return Value:
00263 //
00264 //    None
00265
00266 ISAPITHREAD::ISAPITHREAD(void)
00267 {
00268 }
00269
00270 //  Description:
00271 //
00272 //    Destructor for the ISAPITHREAD object
00273 //
00274 //  Arguments:
00275 //
00276 //    None
00277 //
00278 //  Return Value:
00279 //
00280 //    None
00281
00282 ISAPITHREAD::~ISAPITHREAD(void)
00283 {
00284   // Clear the work item queue
00285
00286   ClearQueue();
00287
00288   // Release the worker threads.  The threads should exit
00289   // gracefully when they retrieve a NULL item from the queue.
00290
00291   ReleaseThread(m_dwNumThreads);
00292
00293   // Wait for the worker threads to exit.
00294
00295   #ifdef _DEBUG
00296     OutputDebugString("Waiting for worker threads to exit...\r\n");
00297   #endif
00298
00299   WaitForMultipleObjects(
00300     m_dwNumThreads,       // number of objects
00301     m_arrWorkerThreads,   // array of handles
00302     TRUE,                 // wait all flag
00303     INFINITE              // timeout
00304     );
00305
00306   #ifdef _DEBUG
00307     OutputDebugString("All worker threads exited gracefully.\r\n");
00308   #endif
00309
00310   // Close the handles
00311
00312   for (DWORD x = 0; x < m_dwNumThreads; x++)
00313     CloseHandle(m_arrWorkerThreads[x]);
00314
00315   CloseHandle(m_hWorkerThreadSemaphore);
00316
00317   // Delete the critical section
00318
00319   DeleteCriticalSection(&m_csQueue);
00320
00321   // Deallocate the arrays
00322
00323   delete m_arrWorkerThreads;
00324   delete m_WorkItemQueue;
00325
00326   return;
00327 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasDialAsync/RasDialAsync.c Source File

  • NetDS
  • Ras
  • RasDialAsync

RasDialAsync.c

Go to the documentation of this file.
00001 //
00002 //       This is a part of the Microsoft Source Code Samples.
00003 //       Copyright 1993 - 2000 Microsoft Corporation.
00004 //       All rights reserved.
00005 //       This source code is only intended as a supplement to
00006 //       Microsoft Development Tools and/or Help documentation.
00007 //       See these sources for detailed information regarding the
00008 //       Microsoft samples programs.
00009 //
00010
00011 //
00012 //    RasDialAsync.c
00013 //
00014 //    Usage:
00015 //    RasDialAsync
00016 //
00017 //    RAS API's used:
00018 //        RasDial
00019 //        RasHangUp
00020 //
00021 //    Callback function:
00022 //        RasDialFunc
00023 //
00024 #ifndef _WIN32_WINNT
00025 #define _WIN32_WINNT 0x500
00026 #endif
00027
00028 #ifdef UNICODE
00029 #undef UNICODE
00030 #endif
00031
00032 #define WIN32_LEAN_AND_MEAN
00033
00034 #include <stdio.h>
00035 #include <windows.h>
00036 #include <ras.h>
00037 #include <raserror.h>
00038 #include <string.h>
00039 #include <winbase.h>
00040 #include <time.h>
00041 #include <stdlib.h>
00042 #include <tchar.h>
00043
00044 // Macro for counting maximum characters that will fit into a buffer
00045 #define CELEMS(x) ((sizeof(x))/(sizeof(x[0])))
00046
00047 void WINAPI RasDialFunc(UINT unMsg,
00048                         RASCONNSTATE rasconnstate,
00049                         DWORD dwError );
00050
00051 HANDLE gEvent_handle; // Global event handle
00052
00053 // Usage
00054 void Usage(char *pszProgName)
00055 {
00056     TCHAR szTempBuf[256] = {0};
00057
00058     if (pszProgName)
00059     {
00060         _snprintf(szTempBuf,
00061                   CELEMS(szTempBuf) - 1,
00062                   "Usage\n%s \t-e [entry name] -p [phone number] \n\t\t-u [username] -z [password] -d [domain]\n",
00063                   pszProgName);
00064         printf(szTempBuf);
00065     }
00066     return;
00067 }
00068
00069
00070 // Begin main()...
00071
00072 int main(int argc, char*argv[])
00073 {
00074     LPRASDIALPARAMS lpRasDialParams = NULL;   // Structure to store the RasDial parameters
00075     HRASCONN        hRasConn = NULL;          // Handle to RAS connection
00076     DWORD           nRet = 0;                 // Return value from a function
00077     DWORD           dwMaxTickCount = 0;               // Final Tick Count value
00078     int             i = 0;
00079     int             j = 0;
00080     BOOL            fRequired = FALSE;
00081     TCHAR           szTempBuf[256] = {0};
00082
00083     // Create the event, which indicates completion of RasDial()
00084     gEvent_handle = CreateEvent(NULL, FALSE, FALSE, NULL);
00085     if (!gEvent_handle)
00086     {
00087         nRet = GetLastError();
00088         printf("CreateEvent failed: Error = %d", nRet);
00089         return nRet;
00090     }
00091
00092     // Initialize the RASDIALPARAMS structure
00093     lpRasDialParams = (LPRASDIALPARAMS) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RASDIALPARAMS));
00094     if (NULL == lpRasDialParams)
00095     {
00096       printf("HeapAlloc failed\n");
00097       goto done;
00098     }
00099
00100     lpRasDialParams->dwSize =sizeof(RASDIALPARAMS);
00101
00102     // Copy command line arguments into the RASDIALPARAMS structure
00103     if (argc > 1)
00104     {
00105       for(i = 1; i < (argc - 1); i++)
00106       {
00107         if (argv[i] && ((argv[i][0] == '-') || (argv[i][0] == '/')))
00108         {
00109           switch(tolower(argv[i][1]))
00110           {
00111               case 'e': // Entry name
00112                         j = ++i; // Increment i and assign it to j
00113                         if (argv[j])
00114                         {
00115                             lstrcpyn(lpRasDialParams->szEntryName, argv[j], CELEMS(lpRasDialParams->szEntryName));
00116                             fRequired = TRUE;
00117                         }
00118               break;
00119             case 'p': // Phone number
00120                         j = ++i; // Increment i and assign it to j
00121                         if (argv[j])
00122                         {
00123                             lstrcpyn(lpRasDialParams->szPhoneNumber, argv[j], CELEMS(lpRasDialParams->szPhoneNumber));
00124                         }
00125                         break;
00126                     case 'u': // User name
00127                         j = ++i; // Increment i and assign it to j
00128                         if (argv[j])
00129                         {
00130                             lstrcpyn(lpRasDialParams->szUserName, argv[j], CELEMS(lpRasDialParams->szUserName));
00131                         }
00132                         break;
00133                     case 'z': // Password
00134                         j = ++i; // Increment i and assign it to j
00135                         if (argv[j])
00136                         {
00137                             lstrcpyn(lpRasDialParams->szPassword, argv[j], CELEMS(lpRasDialParams->szPassword));
00138                         }
00139                         break;
00140                     case 'd': // Domain name
00141                         j = ++i; // Increment i and assign it to j
00142                         if (argv[j])
00143                         {
00144                             lstrcpyn(lpRasDialParams->szDomain, argv[j], CELEMS(lpRasDialParams->szDomain));
00145                         }
00146                         break;
00147                     default:
00148                         Usage(argv[0]);
00149                         goto done;
00150                         break;
00151           }
00152         }
00153             else
00154             {
00155                 Usage(argv[0]);
00156                 goto done;
00157             }
00158       }
00159     }
00160     else
00161     {
00162         Usage(argv[0]);
00163         goto done;
00164     }
00165
00166     // Check if we got at least required entry name
00167     if (FALSE == fRequired)
00168     {
00169         Usage(argv[0]);
00170         goto done;
00171     }
00172
00173     // Dial out asynchronously using RasDial()
00174     ZeroMemory((LPVOID)szTempBuf, sizeof(szTempBuf));
00175     _snprintf(szTempBuf, CELEMS(szTempBuf) - 1, "Dialing... %s\n", lpRasDialParams->szPhoneNumber);
00176     printf(szTempBuf);
00177     hRasConn = NULL;
00178
00179     nRet = RasDial(NULL, NULL, lpRasDialParams, 0, &RasDialFunc, &hRasConn);
00180     // Check whether RasDial() succeeded
00181     if (nRet)
00182     {
00183         printf("RasDial failed: Error = %d\n", nRet);
00184         goto done;
00185     }
00186
00187     // Wait for the RasDial() to complete, signaled by the SetEvent()
00188     nRet = WaitForSingleObject(gEvent_handle, 50000);
00189     switch (nRet)
00190     {
00191         case WAIT_OBJECT_0:
00192         // Normal completion or Ras Error encountered
00193             printf("Will hang up in 5 seconds...\n");
00194             Sleep(5000);
00195
00196             break;
00197
00198         case WAIT_TIMEOUT: // RasDial timed out
00199             printf("RasDial Timed out...\n");
00200             break;
00201
00202         default:
00203             printf("WaitForSingleObject returned %d\n", nRet);
00204             break;
00205     }
00206
00207     printf("Calling RasHangUp...\n");
00208     nRet = RasHangUp(hRasConn);
00209     if (ERROR_SUCCESS == nRet)
00210     {
00211         ZeroMemory((LPVOID)szTempBuf, sizeof(szTempBuf));
00212         _snprintf(szTempBuf, CELEMS(szTempBuf) - 1, "Connection to %s terminated.\n", lpRasDialParams->szPhoneNumber);
00213         printf(szTempBuf);
00214     }
00215     else
00216     {
00217         printf("RasHangUp failed with error = %d.\n", nRet);
00218     }
00219
00220
00221 done:
00222    CloseHandle(gEvent_handle);
00223
00224     if (lpRasDialParams)
00225     {
00226         // Clear password from memory
00227         ZeroMemory(lpRasDialParams->szPassword, sizeof(lpRasDialParams->szPassword));
00228         HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasDialParams);
00229     }
00230
00231     return (int)nRet;
00232 }
00233
00234
00235 // Callback function RasDialFunc()
00236 void WINAPI RasDialFunc(UINT unMsg,
00237                         RASCONNSTATE rasconnstate,
00238                         DWORD dwError )
00239 {
00240     char szRasString[256] = {0}; // Buffer for storing the error string
00241     TCHAR szTempBuf[256] = {0};  // Buffer used for printing out the text
00242
00243     if (dwError)  // Error occurred
00244     {
00245         RasGetErrorString((UINT)dwError, szRasString, CELEMS(szRasString));
00246
00247         ZeroMemory((LPVOID)szTempBuf, sizeof(szTempBuf));
00248         _snprintf(szTempBuf, CELEMS(szTempBuf) - 1, "Error: %d - %s\n", dwError, szRasString);
00249         printf(szTempBuf);
00250
00251         SetEvent(gEvent_handle);
00252         return;
00253     }
00254
00255    // Map each of the states of RasDial() and display on the screen
00256    // the next state that RasDial() is entering
00257    switch (rasconnstate)
00258    {
00259       case RASCS_OpenPort:
00260             printf ("RASCS_OpenPort = %d\n", rasconnstate);
00261             printf ("Opening port...\n");
00262       break;
00263         case RASCS_PortOpened:
00264             printf ("RASCS_PortOpened = %d\n", rasconnstate);
00265             printf ("Port opened.\n");
00266           break;
00267         case RASCS_ConnectDevice:
00268             printf ("RASCS_ConnectDevice = %d\n", rasconnstate);
00269             printf ("Connecting device...\n");
00270            break;
00271         case RASCS_DeviceConnected:
00272             printf ("RASCS_DeviceConnected = %d\n", rasconnstate);
00273             printf ("Device connected.\n");
00274             break;
00275         case RASCS_AllDevicesConnected:
00276             printf ("RASCS_AllDevicesConnected = %d\n", rasconnstate);
00277             printf ("All devices connected.\n");
00278             break;
00279         case RASCS_Authenticate:
00280             printf ("RASCS_Authenticate = %d\n", rasconnstate);
00281             printf ("Authenticating...\n");
00282             break;
00283         case RASCS_AuthNotify:
00284             printf ("RASCS_AuthNotify = %d\n", rasconnstate);
00285             printf ("Authentication notify.\n");
00286             break;
00287         case RASCS_AuthRetry:
00288             printf ("RASCS_AuthRetry = %d\n", rasconnstate);
00289             printf ("Retrying authentication...\n");
00290             break;
00291         case RASCS_AuthCallback:
00292             printf ("RASCS_AuthCallback = %d\n", rasconnstate);
00293             printf ("Authentication callback...\n");
00294             break;
00295         case RASCS_AuthChangePassword:
00296             printf ("RASCS_AuthChangePassword = %d\n", rasconnstate);
00297             printf ("Change password...\n");
00298             break;
00299         case RASCS_AuthProject:
00300             printf ("RASCS_AuthProject = %d\n", rasconnstate);
00301             printf ("Projection phase started...\n");
00302             break;
00303         case RASCS_AuthLinkSpeed:
00304             printf ("RASCS_AuthLinkSpeed = %d\n", rasconnstate);
00305             printf ("Negoting speed...\n");
00306             break;
00307         case RASCS_AuthAck:
00308             printf ("RASCS_AuthAck = %d\n", rasconnstate);
00309             printf ("Authentication acknowledge...\n");
00310             break;
00311         case RASCS_ReAuthenticate:
00312             printf ("RASCS_ReAuthenticate = %d\n", rasconnstate);
00313             printf ("Retrying Authentication...\n");
00314             break;
00315         case RASCS_Authenticated:
00316             printf ("RASCS_Authenticated = %d\n", rasconnstate);
00317             printf ("Authentication complete.\n");
00318             break;
00319         case RASCS_PrepareForCallback:
00320             printf ("RASCS_PrepareForCallback = %d\n", rasconnstate);
00321             printf ("Preparing for callback...\n");
00322             break;
00323         case RASCS_WaitForModemReset:
00324             printf ("RASCS_WaitForModemReset = %d\n", rasconnstate);
00325             printf ("Waiting for modem reset...\n");
00326             break;
00327         case RASCS_WaitForCallback:
00328             printf ("RASCS_WaitForCallback = %d\n", rasconnstate);
00329             printf ("Waiting for callback...\n");
00330             break;
00331         case RASCS_Projected:
00332             printf ("RASCS_Projected = %d\n", rasconnstate);
00333             printf ("Projection completed.\n");
00334             break;
00335     #if (WINVER >= 0x400)
00336         case RASCS_StartAuthentication:    // Windows 95 only
00337             printf ("RASCS_StartAuthentication = %d\n", rasconnstate);
00338             printf ("Starting authentication...\n");
00339
00340             break;
00341         case RASCS_CallbackComplete:       // Windows 95 only
00342             printf ("RASCS_CallbackComplete = %d\n", rasconnstate);
00343             printf ("Callback complete.\n");
00344             break;
00345         case RASCS_LogonNetwork:           // Windows 95 only
00346             printf ("RASCS_LogonNetwork = %d\n", rasconnstate);
00347             printf ("Login to the network.\n");
00348             break;
00349     #endif
00350         case RASCS_SubEntryConnected:
00351             printf ("RASCS_SubEntryConnected = %d\n", rasconnstate);
00352             printf ("Subentry connected.\n");
00353             break;
00354         case RASCS_SubEntryDisconnected:
00355             printf ("RASCS_SubEntryDisconnected = %d\n", rasconnstate);
00356             printf ("Subentry disconnected.\n");
00357             break;
00358     //PAUSED STATES:
00359     case RASCS_Interactive:
00360             printf ("RASCS_Interactive = %d\n", rasconnstate);
00361             printf ("In Paused state: Interactive mode.\n");
00362             break;
00363     case RASCS_RetryAuthentication:
00364             printf ("RASCS_RetryAuthentication = %d\n", rasconnstate);
00365             printf ("In Paused state: Retry Authentication...\n");
00366             break;
00367     case RASCS_CallbackSetByCaller:
00368             printf ("RASCS_CallbackSetByCaller = %d\n", rasconnstate);
00369             printf ("In Paused state: Callback set by Caller.\n");
00370             break;
00371     case RASCS_PasswordExpired:
00372             printf ("RASCS_PasswordExpired = %d\n", rasconnstate);
00373             printf ("In Paused state: Password has expired...\n");
00374             break;
00375
00376         case RASCS_Connected: // = RASCS_DONE:
00377             printf ("RASCS_Connected = %d\n", rasconnstate);
00378             printf ("Connection completed.\n");
00379       SetEvent(gEvent_handle);
00380             break;
00381         case RASCS_Disconnected:
00382             printf ("RASCS_Disconnected = %d\n", rasconnstate);
00383             printf ("Disconnecting...\n");
00384             break;
00385     default:
00386       printf ("Unknown Status = %d\n", rasconnstate);
00387       printf ("What are you going to do about it?\n");
00388       break;
00389    }
00390 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/Resource.h Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

Resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 2000
00006 //
00007 //  File:       resource.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by certpsam.rc
00014 //
00015 #define IDS_CERTPOLICY_DESC 1
00016 #define IDS_CERTMANAGEPOLICYMODULE_DESC 2
00017
00018
00019 // Next default values for new objects
00020 //
00021 #ifdef APSTUDIO_INVOKED
00022 #ifndef APSTUDIO_READONLY_SYMBOLS
00023 #define _APS_NEXT_RESOURCE_VALUE        201
00024 #define _APS_NEXT_COMMAND_VALUE         32768
00025 #define _APS_NEXT_CONTROL_VALUE         201
00026 #define _APS_NEXT_SYMED_VALUE           101
00027 #endif
00028 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/MidiPlyr.c Source File

  • Multimedia
  • Audio
  • MidiPlyr

MidiPlyr.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 * MIDIPlyr.C
00013 *
00014 * Initialization code for the polymessage MIDI playback app.
00015 *
00016 *****************************************************************************/
00017
00018 #pragma warning(disable:4756)
00019
00020 #define _INC_SHELLAPI
00021 #include <windows.h>
00022 #undef _INC_SHELLAPI
00023
00024 #include <shellapi.h>
00025 #include <windowsx.h>
00026 #include <mmsystem.h>
00027 #include <commdlg.h>
00028 #include <commctrl.h>
00029 #include <ctype.h>
00030
00031 #include "debug.h"
00032
00033 #include "MIDIPlyr.H"
00034
00035 PUBLIC  char BCODE      gszMWndClass[]      = "MIDIPlyrMWnd";
00036 PUBLIC  char BCODE      gszTWndClass[]      = "MIDIPlyrTWnd";
00037 PUBLIC  HINSTANCE       ghInst              = NULL;
00038 PUBLIC  PSEQ            gpSeq               = NULL;
00039 PUBLIC  char            gszUntitled[80]     = "";
00040 PUBLIC  char            gszAppLongName[80]  = "";
00041 PUBLIC  char            gszAppTitleMask[80] = "";
00042 PUBLIC  char            grgszTimeFormats[N_TIME_FORMATS][CB_TIME_FORMATS] = {0};
00043 PUBLIC  RECT            grcTWnd             = {0, 0, 0, 0};
00044 PUBLIC  int             gnTimeFormat        = 0;
00045
00046 PRIVATE BOOL FNLOCAL InitApp(HINSTANCE hInst);
00047 PRIVATE BOOL FNLOCAL InitInstance(HINSTANCE hInst, int nCmdShow);
00048 PRIVATE VOID FNLOCAL TerminateInstance(VOID);
00049
00050 /*****************************************************************************
00051 *
00052 * WinMain
00053 *
00054 * Called by C startup code.
00055 *
00056 * HANDLE hInst              - Instance handle of this instance
00057 * HANDLE hPrevInst          - Instance handle of previous instance or
00058 *                             NULL if we are the first instance
00059 * LPSTR lpstrCmdLine        - Any command line arguments
00060 * int nCmdShow              - Code for ShowWindow which tells us what state
00061 *                             to initially show the main application window.
00062 *
00063 * Initialize application if first instance.
00064 * Initialize instance.
00065 * Stay in main message processing loop until exit.
00066 *
00067 *****************************************************************************/
00068 int PASCAL WinMain(
00069     HINSTANCE                  hInst,
00070     HINSTANCE                  hPrevInst,
00071     LPSTR                   lpstrCmdLine,
00072     int                     nCmdShow)
00073 {
00074     MSG                     msg;
00075
00076     if (hPrevInst == NULL)
00077         if (!InitApp(hInst))
00078             return 0;
00079
00080     if (!InitInstance(hInst, nCmdShow))
00081     {
00082         TerminateInstance();
00083         return 0;
00084     }
00085
00086     while (GetMessage(&msg, NULL, 0, 0))
00087     {
00088         TranslateMessage(&msg);
00089         DispatchMessage(&msg);
00090     }
00091
00092     TerminateInstance();
00093
00094     return (int) msg.wParam;
00095 }
00096
00097 /*****************************************************************************
00098 *
00099 * InitApp
00100 *
00101 * Called for one-time initialization if we are the first app instance.
00102 *
00103 * HANDLE hInst              - Instance handle of this instance
00104 *
00105 * Returns TRUE on success.
00106 *
00107 * Register the window class for the main window and the time window.
00108 *
00109 *****************************************************************************/
00110 BOOL FNLOCAL InitApp(
00111     HINSTANCE               hInst)
00112 {
00113     WNDCLASS                wc;
00114
00115     InitCommonControls();
00116
00117     /* Don't specify CS_HREDRAW or CS_VREDRAW if you're going to use the
00118     ** commctrl status or toolbar -- invalidate the (remaining) client
00119     ** area yourself if you want this behavior. This will allow the child
00120     ** control redraws to be much more efficient.
00121     */
00122     wc.style =          0;
00123     wc.lpfnWndProc =    MWnd_WndProc;
00124     wc.cbClsExtra =     0;
00125     wc.cbWndExtra =     0;
00126     wc.hInstance =      hInst;
00127     wc.hIcon =          LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON));
00128     wc.hCursor =        LoadCursor(NULL, IDC_ARROW);
00129     wc.hbrBackground =  (HBRUSH)(COLOR_BTNFACE+1);
00130     wc.lpszMenuName =   MAKEINTRESOURCE(ID_MENU);
00131     wc.lpszClassName =  (LPCSTR)gszMWndClass;
00132
00133     RegisterClass(&wc);
00134
00135     wc.style =          CS_HREDRAW|CS_VREDRAW;
00136     wc.lpfnWndProc =    TWnd_WndProc;
00137     wc.cbClsExtra =     0;
00138     wc.cbWndExtra =     0;
00139     wc.hInstance =      hInst;
00140     wc.hIcon =          LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON));
00141     wc.hCursor =        LoadCursor(NULL, IDC_ARROW);
00142     wc.hbrBackground =  (HBRUSH)(COLOR_WINDOW+1);
00143     wc.lpszMenuName =   NULL;
00144     wc.lpszClassName =  (LPCSTR)gszTWndClass;
00145
00146     RegisterClass(&wc);
00147
00148     return TRUE;
00149 }
00150
00151 /*****************************************************************************
00152 *
00153 * InitInstance
00154 *
00155 * Called once per instance of application.
00156 *
00157 * HANDLE hInst              - Instance handle of this instance
00158 * int nCmdShow              - Code for ShowWindow which tells us what state
00159 *                             to initially show the main application window.
00160 * Returns TRUE on success.
00161 *
00162 * Initialize debug library.
00163 * Save the instance handle.
00164 * Load global resource strings.
00165 * Allocate and initialize the global sequencer structure.
00166 * Create the main window.
00167 * Add time formats to the options menu.
00168 * Show the main window.
00169 *
00170 *****************************************************************************/
00171 BOOL FNLOCAL InitInstance(
00172     HINSTANCE               hInst,
00173     int                     nCmdShow)
00174 {
00175     HWND                    hWnd;
00176     int                     idx;
00177
00178     DbgInitialize(TRUE);
00179
00180     ghInst = hInst;
00181
00182     LoadString(hInst, IDS_APPTITLEMASK, gszAppTitleMask, sizeof(gszAppTitleMask));
00183     LoadString(hInst, IDS_APPNAME,      gszAppLongName,  sizeof(gszAppLongName));
00184     LoadString(hInst, IDS_UNTITLED,     gszUntitled,     sizeof(gszUntitled));
00185
00186     for (idx = 0; idx < N_TIME_FORMATS; idx++)
00187     {
00188         *grgszTimeFormats[idx] = '\0';
00189         LoadString(hInst,
00190                    IDS_TF_FIRST+idx,
00191                    grgszTimeFormats[idx],
00192                    sizeof(grgszTimeFormats[idx]));
00193     }
00194
00195     if ((gpSeq = (PSEQ)LocalAlloc(LPTR, sizeof(SEQ))) == NULL)
00196         return FALSE;
00197
00198     gpSeq->cBuffer  = C_MIDI_BUFFERS;
00199     gpSeq->cbBuffer = CB_MIDI_BUFFERS;
00200
00201     if (seqAllocBuffers(gpSeq) != MMSYSERR_NOERROR)
00202         return FALSE;
00203
00204     hWnd = CreateWindow(
00205         gszMWndClass,
00206         NULL,
00207         WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN,
00208         CW_USEDEFAULT,CW_USEDEFAULT,
00209         CW_USEDEFAULT,CW_USEDEFAULT,
00210         HWND_DESKTOP,
00211         NULL,
00212         hInst,
00213         NULL);
00214
00215     if (hWnd == (HWND)NULL)
00216         return FALSE;
00217
00218     gpSeq->hWnd = hWnd;
00219
00220     ShowWindow(hWnd, nCmdShow);
00221
00222     return TRUE;
00223 }
00224
00225 /*****************************************************************************
00226 *
00227 * TerminateInstance
00228 *
00229 * Release any resources for the current instance
00230 *
00231 *****************************************************************************/
00232 VOID FNLOCAL TerminateInstance(
00233     VOID)
00234 {
00235     if (gpSeq != NULL)
00236     {
00237         seqFreeBuffers(gpSeq);
00238         LocalFree((HLOCAL)gpSeq);
00239         gpSeq = NULL;
00240     }
00241 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/localres.h Source File

  • SysMgmt
  • MMC
  • About

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CWbemClientDlg Member List

This is the complete list of members for CWbemClientDlg, including all inherited members.
CWbemClientDlg(CWnd *pParent=NULL) | CWbemClientDlg |
DoDataExchange(CDataExchange *pDX) | CWbemClientDlg | [protected, virtual]
IDD enum value | CWbemClientDlg |
m_diskInfo | CWbemClientDlg |
m_enumDisks | CWbemClientDlg |
m_hIcon | CWbemClientDlg | [protected]
m_namespace | CWbemClientDlg |
m_outputList | CWbemClientDlg |
m_pIWbemServices | CWbemClientDlg | [private]
m_pOfficeService | CWbemClientDlg | [private]
OnConnect() | CWbemClientDlg | [protected]
OnDiskinfo() | CWbemClientDlg | [protected]
OnEnumdisks() | CWbemClientDlg | [protected]
OnInitDialog() | CWbemClientDlg | [protected, virtual]
OnMakeoffice() | CWbemClientDlg | [protected]
OnPaint() | CWbemClientDlg | [protected]
OnQueryDragIcon() | CWbemClientDlg | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CWbemClientDlg | [protected]
~CWbemClientDlg() | CWbemClientDlg |
Generated on Wed Nov 13 2024 16:57:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/textstor.cpp Source File

  • WinUI
  • tsfapp

textstor.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          TextStor.cpp
00013
00014    Description:   ITextStoreACP Implementation
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "TSFEdit.h"
00023 #include "DataObj.h"
00024 #include "Globals.h"
00025
00026 #include <tsattrs.h>
00027
00028 /**************************************************************************
00029    global variables
00030 **************************************************************************/
00031
00032 /**************************************************************************
00033
00034    CTSFEditWnd::AdviseSink()
00035
00036 **************************************************************************/
00037
00038 STDMETHODIMP CTSFEditWnd::AdviseSink(REFIID riid, IUnknown *pUnknown, DWORD dwMask)
00039 {
00040     OutputDebugString(TEXT("CTSFEditWnd::AdviseSink \n"));
00041
00042     HRESULT     hr;
00043     IUnknown    *punkID;
00044
00045     //Get the "real" IUnknown pointer. This needs to be done for comparison purposes.
00046     hr = pUnknown->QueryInterface(IID_IUnknown, (LPVOID*)&punkID);
00047     if(FAILED(hr))
00048     {
00049         return hr;
00050     }
00051
00052     hr = E_INVALIDARG;
00053
00054     //see if this advise sink already exists
00055     if(punkID == m_AdviseSink.punkID)
00056     {
00057         //this is the same advise sink, so just update the advise mask
00058         m_AdviseSink.dwMask = dwMask;
00059
00060         hr = S_OK;
00061     }
00062     else if(NULL != m_AdviseSink.punkID)
00063     {
00064         //only one advise sink is allowed at a time
00065         hr = CONNECT_E_ADVISELIMIT;
00066     }
00067     else if(IsEqualIID(riid, IID_ITextStoreACPSink))
00068     {
00069         //set the advise mask
00070         m_AdviseSink.dwMask = dwMask;
00071
00072         /*
00073         Set the IUnknown pointer. This is used for comparison in
00074         UnadviseSink and future calls to this method.
00075         */
00076         m_AdviseSink.punkID = punkID;
00077
00078         //AddRef this because it will get released below and it needs to be kept
00079         punkID->AddRef();
00080
00081         //get the ITextStoreACPSink interface
00082         pUnknown->QueryInterface(IID_ITextStoreACPSink, (LPVOID*)&m_AdviseSink.pTextStoreACPSink);
00083
00084         //get the ITextStoreACPServices interface
00085         pUnknown->QueryInterface(IID_ITextStoreACPServices, (LPVOID*)&m_pServices);
00086
00087         hr = S_OK;
00088     }
00089
00090     //this isn't needed anymore
00091     punkID->Release();
00092
00093     return hr;
00094 }
00095
00096 /**************************************************************************
00097
00098    CTSFEditWnd::UnadviseSink()
00099
00100 **************************************************************************/
00101
00102 STDMETHODIMP CTSFEditWnd::UnadviseSink(IUnknown *pUnknown)
00103 {
00104     OutputDebugString(TEXT("CTSFEditWnd::UnadviseSink \n"));
00105
00106     HRESULT     hr;
00107     IUnknown    *punkID;
00108
00109     /*
00110     Get the "real" IUnknown pointer. This needs to be done for comparison
00111     purposes.
00112     */
00113     hr = pUnknown->QueryInterface(IID_IUnknown, (LPVOID*)&punkID);
00114     if(FAILED(hr))
00115     {
00116         return hr;
00117     }
00118
00119     //find the advise sink
00120     if(punkID == m_AdviseSink.punkID)
00121     {
00122         //remove the advise sink from the list
00123         _ClearAdviseSink(&m_AdviseSink);
00124
00125         if(m_pServices)
00126         {
00127             m_pServices->Release();
00128             m_pServices = NULL;
00129         }
00130
00131         hr = S_OK;
00132     }
00133     else
00134     {
00135         hr = CONNECT_E_NOCONNECTION;
00136     }
00137
00138     punkID->Release();
00139
00140     return hr;
00141 }
00142
00143 /**************************************************************************
00144
00145    CTSFEditWnd::RequestLock()
00146
00147 **************************************************************************/
00148
00149 STDMETHODIMP CTSFEditWnd::RequestLock(DWORD dwLockFlags, HRESULT *phrSession)
00150 {
00151     OutputDebugString(TEXT("CTSFEditWnd::RequestLock \n"));
00152
00153     if(NULL == m_AdviseSink.pTextStoreACPSink)
00154     {
00155         return E_UNEXPECTED;
00156     }
00157
00158     if(IsBadWritePtr(phrSession, sizeof(HRESULT)))
00159     {
00160         return E_INVALIDARG;
00161     }
00162
00163     *phrSession = E_FAIL;
00164
00165     if(m_fLocked)
00166     {
00167         //the document is locked
00168
00169         if(dwLockFlags & TS_LF_SYNC)
00170         {
00171             /*
00172             The caller wants an immediate lock, but this cannot be granted because
00173             the document is already locked.
00174             */
00175             *phrSession = TS_E_SYNCHRONOUS;
00176             return S_OK;
00177         }
00178         else
00179         {
00180             //the request is asynchronous
00181
00182             /*
00183             The only type of asynchronous lock request this application
00184             supports while the document is locked is to upgrade from a read
00185             lock to a read/write lock. This scenario is referred to as a lock
00186             upgrade request.
00187             */
00188             if(((m_dwLockType & TS_LF_READWRITE) == TS_LF_READ) &&
00189                 ((dwLockFlags & TS_LF_READWRITE) == TS_LF_READWRITE))
00190             {
00191                 m_fPendingLockUpgrade = TRUE;
00192
00193                 *phrSession = TS_S_ASYNC;
00194
00195                 return S_OK;
00196             }
00197
00198         }
00199         return E_FAIL;
00200     }
00201
00202     //lock the document
00203     _LockDocument(dwLockFlags);
00204
00205     //call OnLockGranted
00206     *phrSession = m_AdviseSink.pTextStoreACPSink->OnLockGranted(dwLockFlags);
00207
00208     //unlock the document
00209     _UnlockDocument();
00210
00211     return S_OK;
00212 }
00213
00214 /**************************************************************************
00215
00216    CTSFEditWnd::GetStatus()
00217
00218 **************************************************************************/
00219
00220 STDMETHODIMP CTSFEditWnd::GetStatus(TS_STATUS *pdcs)
00221 {
00222     OutputDebugString(TEXT("CTSFEditWnd::GetStatus \n"));
00223
00224     if(IsBadWritePtr(pdcs, sizeof(TS_STATUS)))
00225     {
00226         return E_INVALIDARG;
00227     }
00228
00229     /*
00230     Can be zero or:
00231     TS_SD_READONLY  // if set, document is read only; writes will fail
00232     TS_SD_LOADING   // if set, document is loading, expect additional inserts
00233     */
00234     pdcs->dwDynamicFlags = 0;
00235
00236     /*
00237     Can be zero or:
00238     TS_SS_DISJOINTSEL   // if set, the document supports multiple selections
00239     TS_SS_REGIONS       // if clear, the document will never contain multiple regions
00240     TS_SS_TRANSITORY    // if set, the document is expected to have a short lifespan
00241     TS_SS_NOHIDDENTEXT  // if set, the document will never contain hidden text (for perf)
00242     */
00243     pdcs->dwStaticFlags = TS_SS_REGIONS;
00244
00245     return S_OK;
00246 }
00247
00248 /**************************************************************************
00249
00250    CTSFEditWnd::QueryInsert()
00251
00252 **************************************************************************/
00253
00254 STDMETHODIMP CTSFEditWnd::QueryInsert(  LONG acpTestStart,
00255                                         LONG acpTestEnd,
00256                                         ULONG cch,
00257                                         LONG *pacpResultStart,
00258                                         LONG *pacpResultEnd)
00259 {
00260     OutputDebugString(TEXT("CTSFEditWnd::QueryInsert\n"));
00261
00262     LONG   lTextLength;
00263
00264     lTextLength = GetWindowTextLength(m_hwndEdit);
00265
00266     //make sure the parameters are within range of the document
00267     if( (acpTestStart > acpTestEnd) ||
00268         (acpTestEnd > lTextLength))
00269     {
00270         return E_INVALIDARG;
00271     }
00272
00273     //set the start point to the given start point
00274     *pacpResultStart = acpTestStart;
00275
00276     //set the end point to the given end point
00277     *pacpResultEnd = acpTestEnd;
00278
00279     return S_OK;
00280 }
00281
00282 /**************************************************************************
00283
00284     CTSFEditWnd::_TestInsert()
00285
00286     This method is similar to QueryInsert except this method assumes the
00287     insertion will actually happen, so the document length would get
00288     expanded to fit the inserted text. QueryInsert doesn't allow the ranges
00289     to go outside of the existing text.
00290
00291 **************************************************************************/
00292
00293 STDMETHODIMP CTSFEditWnd::_TestInsert(  LONG acpTestStart,
00294                                         LONG acpTestEnd,
00295                                         ULONG cch,
00296                                         LONG *pacpResultStart,
00297                                         LONG *pacpResultEnd)
00298 {
00299     //make sure the parameters are within range of the document
00300     if(acpTestStart > acpTestEnd)
00301     {
00302         return E_INVALIDARG;
00303     }
00304
00305     //set the start point after the insertion
00306     *pacpResultStart = acpTestStart;
00307
00308     //set the end point after the insertion
00309     *pacpResultEnd = acpTestStart + cch;
00310
00311     return S_OK;
00312 }
00313
00314 /**************************************************************************
00315
00316    CTSFEditWnd::GetSelection()
00317
00318 **************************************************************************/
00319
00320 STDMETHODIMP CTSFEditWnd::GetSelection( ULONG ulIndex,
00321                                         ULONG ulCount,
00322                                         TS_SELECTION_ACP *pSelection,
00323                                         ULONG *pcFetched)
00324 {
00325     OutputDebugString(TEXT("CTSFEditWnd::GetSelection \n"));
00326
00327     //verify pSelection
00328     if(IsBadWritePtr(pSelection, sizeof(TS_SELECTION_ACP) * ulCount))
00329     {
00330         return E_INVALIDARG;
00331     }
00332
00333     //verify pcFetched
00334     if(IsBadWritePtr(pcFetched, sizeof(ULONG)))
00335     {
00336         return E_INVALIDARG;
00337     }
00338
00339     *pcFetched = 0;
00340
00341     //does the caller have a lock
00342     if(!_IsLocked(TS_LF_READ))
00343     {
00344         //the caller doesn't have a lock
00345         return TS_E_NOLOCK;
00346     }
00347
00348     //check the requested index
00349     if(TF_DEFAULT_SELECTION == ulIndex)
00350     {
00351         ulIndex = 0;
00352     }
00353     else if (ulIndex > 1)
00354     {
00355         /*
00356         The index is too high. This app only supports one selection.
00357         */
00358         return E_INVALIDARG;
00359     }
00360
00361     _GetCurrentSelection();
00362
00363     //find out which end of the selection the caret (insertion point) is
00364     POINT   pt;
00365     LRESULT lPos;
00366     GetCaretPos(&pt);
00367     lPos = ::SendMessage(m_hwndEdit, EM_POSFROMCHAR, m_acpStart, 0);
00368
00369     //if the caret position is the same as the start character, then the selection end is the start of the selection
00370     m_ActiveSelEnd = ((pt.x == LOWORD(lPos) && pt.y == HIWORD(lPos)) ? TS_AE_START : TS_AE_END);
00371
00372     pSelection[0].acpStart = m_acpStart;
00373     pSelection[0].acpEnd = m_acpEnd;
00374     pSelection[0].style.fInterimChar = m_fInterimChar;
00375     if(m_fInterimChar)
00376     {
00377         /*
00378         fInterimChar will be set when an intermediate character has been
00379         set. One example of when this will happen is when an IME is being
00380         used to enter characters and a character has been set, but the IME
00381         is still active.
00382         */
00383         pSelection[0].style.ase = TS_AE_NONE;
00384     }
00385     else
00386     {
00387         pSelection[0].style.ase = m_ActiveSelEnd;
00388     }
00389
00390     *pcFetched = 1;
00391
00392     return S_OK;
00393 }
00394
00395 /**************************************************************************
00396
00397    CTSFEditWnd::SetSelection()
00398
00399 **************************************************************************/
00400
00401 STDMETHODIMP CTSFEditWnd::SetSelection( ULONG ulCount,
00402                                         const TS_SELECTION_ACP *pSelection)
00403 {
00404     OutputDebugString(TEXT("CTSFEditWnd::SetSelection \n"));
00405
00406     //verify pSelection
00407     if(IsBadReadPtr(pSelection, sizeof(TS_SELECTION_ACP) * ulCount))
00408     {
00409         return E_INVALIDARG;
00410     }
00411
00412     if(ulCount > 1)
00413     {
00414         //this implementaiton only supports a single selection
00415         return E_INVALIDARG;
00416     }
00417
00418     //does the caller have a lock
00419     if(!_IsLocked(TS_LF_READWRITE))
00420     {
00421         //the caller doesn't have a lock
00422         return TS_E_NOLOCK;
00423     }
00424
00425     m_acpStart = pSelection[0].acpStart;
00426     m_acpEnd = pSelection[0].acpEnd;
00427     m_fInterimChar = pSelection[0].style.fInterimChar;
00428     if(m_fInterimChar)
00429     {
00430         /*
00431         fInterimChar will be set when an intermediate character has been
00432         set. One example of when this will happen is when an IME is being
00433         used to enter characters and a character has been set, but the IME
00434         is still active.
00435         */
00436         m_ActiveSelEnd = TS_AE_NONE;
00437     }
00438     else
00439     {
00440         m_ActiveSelEnd = pSelection[0].style.ase;
00441     }
00442
00443     //if the selection end is at the start of the selection, reverse the parameters
00444     LONG    lStart = m_acpStart;
00445     LONG    lEnd = m_acpEnd;
00446
00447     if(TS_AE_START == m_ActiveSelEnd)
00448     {
00449         lStart = m_acpEnd;
00450         lEnd = m_acpStart;
00451     }
00452
00453     m_fNotify = FALSE;
00454
00455     ::SendMessage(m_hwndEdit, EM_SETSEL, lStart, lEnd);
00456
00457     m_fNotify = TRUE;
00458
00459     return S_OK;
00460 }
00461
00462 /**************************************************************************
00463
00464    CTSFEditWnd::GetText()
00465
00466 **************************************************************************/
00467
00468 STDMETHODIMP CTSFEditWnd::GetText(  LONG acpStart,
00469                                     LONG acpEnd,
00470                                     WCHAR *pchPlain,
00471                                     ULONG cchPlainReq,
00472                                     ULONG *pcchPlainOut,
00473                                     TS_RUNINFO *prgRunInfo,
00474                                     ULONG ulRunInfoReq,
00475                                     ULONG *pulRunInfoOut,
00476                                     LONG *pacpNext)
00477 {
00478     OutputDebugString(TEXT("CTSFEditWnd::GetText\n"));
00479
00480     //does the caller have a lock
00481     if(!_IsLocked(TS_LF_READ))
00482     {
00483         //the caller doesn't have a lock
00484         return TS_E_NOLOCK;
00485     }
00486
00487     BOOL    fDoText = cchPlainReq > 0;
00488     BOOL    fDoRunInfo = ulRunInfoReq > 0;
00489     LONG    cchTotal;
00490     HRESULT hr = E_FAIL;
00491
00492     if(pcchPlainOut)
00493     {
00494         *pcchPlainOut = 0;
00495     }
00496
00497     if(fDoRunInfo)
00498     {
00499         *pulRunInfoOut = 0;
00500     }
00501
00502     if(pacpNext)
00503     {
00504         *pacpNext = acpStart;
00505     }
00506
00507     //get all of the text
00508     LPWSTR  pwszText;
00509     hr = _GetText(&pwszText, &cchTotal);
00510     if(FAILED(hr))
00511     {
00512         return hr;
00513     }
00514
00515     //validate the start pos
00516     if((acpStart < 0) || (acpStart > cchTotal))
00517     {
00518         hr = TS_E_INVALIDPOS;
00519     }
00520     else
00521     {
00522         //are we at the end of the document
00523         if(acpStart == cchTotal)
00524         {
00525             hr = S_OK;
00526         }
00527         else
00528         {
00529             ULONG    cchReq;
00530
00531             /*
00532             acpEnd will be -1 if all of the text up to the end is being requested.
00533             */
00534
00535             if(acpEnd >= acpStart)
00536             {
00537                 cchReq = acpEnd - acpStart;
00538             }
00539             else
00540             {
00541                 cchReq = cchTotal - acpStart;
00542             }
00543
00544             if(fDoText)
00545             {
00546                 if(cchReq > cchPlainReq)
00547                 {
00548                     cchReq = cchPlainReq;
00549                 }
00550
00551                 //extract the specified text range
00552                 LPWSTR  pwszStart = pwszText + acpStart;
00553
00554                 if(pchPlain && cchPlainReq)
00555                 {
00556                     //the text output is not NULL terminated
00557                     CopyMemory(pchPlain, pwszStart, cchReq * sizeof(WCHAR));
00558                 }
00559             }
00560
00561             //it is possible that only the length of the text is being requested
00562             if(pcchPlainOut)
00563             {
00564                 *pcchPlainOut = cchReq;
00565             }
00566
00567             if(fDoRunInfo)
00568             {
00569                 /*
00570                 Runs are used to separate text characters from formatting characters.
00571
00572                 In this example, sequences inside and including the <> are treated as
00573                 control sequences and are not displayed.
00574
00575                 Plain text = "Text formatting."
00576                 Actual text = "Text <B><I>formatting</I></B>."
00577
00578                 If all of this text were requested, the run sequence would look like this:
00579
00580                 prgRunInfo[0].type = TS_RT_PLAIN;   //"Text "
00581                 prgRunInfo[0].uCount = 5;
00582
00583                 prgRunInfo[1].type = TS_RT_HIDDEN;  //<B><I>
00584                 prgRunInfo[1].uCount = 6;
00585
00586                 prgRunInfo[2].type = TS_RT_PLAIN;   //"formatting"
00587                 prgRunInfo[2].uCount = 10;
00588
00589                 prgRunInfo[3].type = TS_RT_HIDDEN;  //</B></I>
00590                 prgRunInfo[3].uCount = 8;
00591
00592                 prgRunInfo[4].type = TS_RT_PLAIN;   //"."
00593                 prgRunInfo[4].uCount = 1;
00594
00595                 TS_RT_OPAQUE is used to indicate characters or character sequences
00596                 that are in the document, but are used privately by the application
00597                 and do not map to text.  Runs of text tagged with TS_RT_OPAQUE should
00598                 NOT be included in the pchPlain or cchPlainOut [out] parameters.
00599                 */
00600
00601                 /*
00602                 This implementation is plain text, so the text only consists of one run.
00603                 If there were multiple runs, it would be an error to have consecuative runs
00604                 of the same type.
00605                 */
00606                 *pulRunInfoOut = 1;
00607                 prgRunInfo[0].type = TS_RT_PLAIN;
00608                 prgRunInfo[0].uCount = cchReq;
00609             }
00610
00611             if(pacpNext)
00612             {
00613                 *pacpNext = acpStart + cchReq;
00614             }
00615
00616             hr = S_OK;
00617         }
00618     }
00619
00620     GlobalFree(pwszText);
00621
00622     return hr;
00623 }
00624
00625 /**************************************************************************
00626
00627    CTSFEditWnd::SetText()
00628
00629 **************************************************************************/
00630
00631 STDMETHODIMP CTSFEditWnd::SetText(  DWORD dwFlags,
00632                                     LONG acpStart,
00633                                     LONG acpEnd,
00634                                     const WCHAR *pchText,
00635                                     ULONG cch,
00636                                     TS_TEXTCHANGE *pChange)
00637 {
00638     OutputDebugString(TEXT("CTSFEditWnd::SetText \n"));
00639
00640     HRESULT hr;
00641
00642     /*
00643     dwFlags can be:
00644     TS_ST_CORRECTION
00645     */
00646
00647     if(dwFlags & TS_ST_CORRECTION)
00648     {
00649         OutputDebugString(TEXT("\tTS_ST_CORRECTION\n"));
00650     }
00651
00652     //set the selection to the specified range
00653     TS_SELECTION_ACP    tsa;
00654     tsa.acpStart = acpStart;
00655     tsa.acpEnd = acpEnd;
00656     tsa.style.ase = TS_AE_START;
00657     tsa.style.fInterimChar = FALSE;
00658
00659     hr = SetSelection(1, &tsa);
00660
00661     if(SUCCEEDED(hr))
00662     {
00663         //call InsertTextAtSelection
00664         hr = InsertTextAtSelection(TS_IAS_NOQUERY, pchText, cch, NULL, NULL, pChange);
00665     }
00666
00667     return hr;
00668 }
00669
00670 /**************************************************************************
00671
00672    CTSFEditWnd::GetFormattedText()
00673
00674 **************************************************************************/
00675
00676 STDMETHODIMP CTSFEditWnd::GetFormattedText( LONG acpStart,
00677                                             LONG acpEnd,
00678                                             IDataObject **ppDataObject)
00679 {
00680     OutputDebugString(TEXT("CTSFEditWnd::GetFormattedText \n"));
00681
00682     if(IsBadWritePtr(ppDataObject, sizeof(IDataObject*)))
00683     {
00684         return E_INVALIDARG;
00685     }
00686
00687     *ppDataObject = NULL;
00688
00689     //does the caller have a lock
00690     if(!_IsLocked(TS_LF_READ))
00691     {
00692         //the caller doesn't have a lock
00693         return TS_E_NOLOCK;
00694     }
00695
00696     HRESULT     hr;
00697
00698     CTSFDataObject *pdo = new CTSFDataObject;
00699     if(NULL != pdo)
00700     {
00701         //get the text
00702         ULONG   cchOut;
00703
00704         if(-1 == acpEnd)
00705         {
00706             //get the length of all of the text
00707             hr = GetText(acpStart, acpEnd, NULL, 0, &cchOut, NULL, 0, NULL, NULL);
00708         }
00709         else
00710         {
00711             cchOut = acpEnd - acpStart;
00712             hr = S_OK;
00713         }
00714
00715         if(SUCCEEDED(hr))
00716         {
00717             LPWSTR  pwszTemp = (LPWSTR)GlobalAlloc(GPTR, (cchOut + 1) * sizeof(WCHAR));
00718             if(NULL != pwszTemp)
00719             {
00720                 hr = GetText(acpStart, acpEnd, pwszTemp, cchOut, &cchOut, NULL, 0, NULL, NULL);
00721                 pwszTemp[cchOut] = '\0';
00722                 if(SUCCEEDED(hr))
00723                 {
00724                     //set the text in the data object
00725                     hr = pdo->_SetText(pwszTemp);
00726                     if(SUCCEEDED(hr))
00727                     {
00728                         //get the IID_IDataObject interface
00729                         hr = pdo->QueryInterface(IID_IDataObject, (LPVOID*)ppDataObject);
00730                     }
00731                 }
00732             }
00733             else
00734             {
00735                 hr = E_OUTOFMEMORY;
00736             }
00737         }
00738
00739         //release the interface
00740         pdo->Release();
00741     }
00742     else
00743     {
00744         hr = E_OUTOFMEMORY;
00745     }
00746
00747
00748     return hr;
00749 }
00750
00751 /**************************************************************************
00752
00753    CTSFEditWnd::GetEmbedded()
00754
00755 **************************************************************************/
00756
00757 STDMETHODIMP CTSFEditWnd::GetEmbedded(  LONG acpPos,
00758                                         REFGUID rguidService,
00759                                         REFIID riid, IUnknown **ppunk)
00760 {
00761     OutputDebugString(TEXT("CTSFEditWnd::GetEmbedded \n"));
00762
00763     //this implementation doesn't support embedded objects
00764     return E_NOTIMPL;
00765 }
00766
00767 /**************************************************************************
00768
00769    CTSFEditWnd::QueryInsertEmbedded()
00770
00771 **************************************************************************/
00772
00773 STDMETHODIMP CTSFEditWnd::QueryInsertEmbedded(  const GUID *pguidService,
00774                                                 const FORMATETC *pFormatEtc,
00775                                                 BOOL *pfInsertable)
00776 {
00777     OutputDebugString(TEXT("CTSFEditWnd::QueryInsertEmbedded \n"));
00778
00779     //this implementation doesn't support embedded objects
00780     *pfInsertable = FALSE;
00781
00782     return S_OK;
00783 }
00784
00785 /**************************************************************************
00786
00787    CTSFEditWnd::InsertEmbedded()
00788
00789 **************************************************************************/
00790
00791 STDMETHODIMP CTSFEditWnd::InsertEmbedded(   DWORD dwFlags,
00792                                             LONG acpStart,
00793                                             LONG acpEnd,
00794                                             IDataObject *pDataObject,
00795                                             TS_TEXTCHANGE *pChange)
00796 {
00797     OutputDebugString(TEXT("CTSFEditWnd::InsertEmbedded \n"));
00798
00799     //this implementation doesn't support embedded objects
00800     return E_NOTIMPL;
00801 }
00802
00803 /**************************************************************************
00804
00805    CTSFEditWnd::RequestSupportedAttrs()
00806
00807 **************************************************************************/
00808
00809 STDMETHODIMP CTSFEditWnd::RequestSupportedAttrs(    DWORD dwFlags,
00810                                                     ULONG cFilterAttrs,
00811                                                     const TS_ATTRID *paFilterAttrs)
00812 {
00813     OutputDebugString(TEXT("CTSFEditWnd::RequestSupportedAttrs \n"));
00814
00815     _ClearRequestedAttributes();
00816
00817     int i;
00818
00819     for(i = 0; i < NUM_SUPPORTED_ATTRS; i++)
00820     {
00821         ULONG x;
00822
00823         for(x = 0; x < cFilterAttrs; x++)
00824         {
00825             if(IsEqualGUID(*m_rgAttributes[i].attrid, paFilterAttrs[x]))
00826             {
00827                 m_rgAttributes[i].dwFlags = ATTR_FLAG_REQUESTED;
00828                 if(dwFlags & TS_ATTR_FIND_WANT_VALUE)
00829                 {
00830                     m_rgAttributes[i].dwFlags |= ATTR_FLAG_DEFAULT;
00831                 }
00832                 else
00833                 {
00834                     //just copy the default value into the regular value
00835                     VariantCopy(&m_rgAttributes[i].varValue, &m_rgAttributes[i].varDefaultValue);
00836                 }
00837             }
00838         }
00839     }
00840
00841     return S_OK;
00842 }
00843
00844 /**************************************************************************
00845
00846    CTSFEditWnd::RequestAttrsAtPosition()
00847
00848 **************************************************************************/
00849
00850 STDMETHODIMP CTSFEditWnd::RequestAttrsAtPosition(   LONG acpPos,
00851                                                     ULONG cFilterAttrs,
00852                                                     const TS_ATTRID *paFilterAttrs,
00853                                                     DWORD dwFlags)
00854 {
00855     OutputDebugString(TEXT("CTSFEditWnd::RequestAttrsAtPosition \n"));
00856
00857     int cch = GetWindowTextLength(m_hwndEdit);
00858
00859     if(acpPos < 0 || acpPos > cch)
00860     {
00861         return TS_E_INVALIDPOS;
00862     }
00863
00864     _ClearRequestedAttributes();
00865
00866     /*
00867     This app doesn't maintain per-character attributes, so just return the default attributes.
00868     */
00869     int i;
00870
00871     for(i = 0; i < NUM_SUPPORTED_ATTRS; i++)
00872     {
00873         ULONG x;
00874
00875         for(x = 0; x < cFilterAttrs; x++)
00876         {
00877             if(IsEqualGUID(*m_rgAttributes[i].attrid, paFilterAttrs[x]))
00878             {
00879                 m_rgAttributes[i].dwFlags = ATTR_FLAG_REQUESTED;
00880                 if(dwFlags & TS_ATTR_FIND_WANT_VALUE)
00881                 {
00882                     m_rgAttributes[i].dwFlags |= ATTR_FLAG_DEFAULT;
00883                 }
00884                 else
00885                 {
00886                     //just copy the default value into the regular value
00887                     VariantCopy(&m_rgAttributes[i].varValue, &m_rgAttributes[i].varDefaultValue);
00888                 }
00889             }
00890         }
00891     }
00892
00893     return S_OK;
00894 }
00895
00896 /**************************************************************************
00897
00898    CTSFEditWnd::RequestAttrsTransitioningAtPosition()
00899
00900 **************************************************************************/
00901
00902 STDMETHODIMP CTSFEditWnd::RequestAttrsTransitioningAtPosition(  LONG acpPos,
00903                                                                 ULONG cFilterAttrs,
00904                                                                 const TS_ATTRID *paFilterAttrs,
00905                                                                 DWORD dwFlags)
00906 {
00907     OutputDebugString(TEXT("CTSFEditWnd::RequestAttrsTransitioningAtPosition \n"));
00908
00909     return E_NOTIMPL;
00910 }
00911
00912 /**************************************************************************
00913
00914    CTSFEditWnd::FindNextAttrTransition()
00915
00916 **************************************************************************/
00917
00918 STDMETHODIMP CTSFEditWnd::FindNextAttrTransition(   LONG acpStart,
00919                                                     LONG acpHalt,
00920                                                     ULONG cFilterAttrs,
00921                                                     const TS_ATTRID *paFilterAttrs,
00922                                                     DWORD dwFlags,
00923                                                     LONG *pacpNext,
00924                                                     BOOL *pfFound,
00925                                                     LONG *plFoundOffset)
00926 {
00927     OutputDebugString(TEXT("CTSFEditWnd::FindNextAttrTransition \n"));
00928
00929     return E_NOTIMPL;
00930 }
00931
00932 /**************************************************************************
00933
00934    CTSFEditWnd::RetrieveRequestedAttrs()
00935
00936 **************************************************************************/
00937
00938 STDMETHODIMP CTSFEditWnd::RetrieveRequestedAttrs(   ULONG ulCount,
00939                                                     TS_ATTRVAL *paAttrVals,
00940                                                     ULONG *pcFetched)
00941 {
00942     OutputDebugString(TEXT("CTSFEditWnd::RetrieveRequestedAttrs \n"));
00943
00944     ULONG   uFetched = 0;
00945     int     i;
00946
00947     for(i = 0; i < NUM_SUPPORTED_ATTRS && ulCount; i++)
00948     {
00949         if(m_rgAttributes[i].dwFlags & ATTR_FLAG_REQUESTED)
00950         {
00951             paAttrVals->varValue.vt = VT_EMPTY;
00952
00953             //copy the attribute ID
00954             CopyMemory(&paAttrVals->idAttr, m_rgAttributes[i].attrid, sizeof(GUID));
00955
00956             //this app doesn't support overlapped attributes
00957             paAttrVals->dwOverlapId = 0;
00958
00959             if (m_rgAttributes[i].dwFlags & ATTR_FLAG_DEFAULT)
00960             {
00961                 VariantCopy(&paAttrVals->varValue, &m_rgAttributes[i].varDefaultValue);
00962             }
00963             else
00964             {
00965                 VariantCopy(&paAttrVals->varValue, &m_rgAttributes[i].varValue);
00966             }
00967
00968             paAttrVals++;
00969             uFetched++;
00970             ulCount--;
00971
00972             //remove the item from the requested state
00973             VariantClear(&m_rgAttributes[i].varValue);
00974             m_rgAttributes[i].dwFlags = ATTR_FLAG_NONE;
00975         }
00976     }
00977
00978     *pcFetched = uFetched;
00979
00980     return S_OK;
00981 }
00982
00983 /**************************************************************************
00984
00985    CTSFEditWnd::GetEndACP()
00986
00987 **************************************************************************/
00988
00989 STDMETHODIMP CTSFEditWnd::GetEndACP(LONG *pacp)
00990 {
00991     OutputDebugString(TEXT("CTSFEditWnd::GetEndACP \n"));
00992
00993     //does the caller have a lock
00994     if(!_IsLocked(TS_LF_READWRITE))
00995     {
00996         //the caller doesn't have a lock
00997         return TS_E_NOLOCK;
00998     }
00999
01000     if(IsBadWritePtr(pacp, sizeof(LONG)))
01001     {
01002         return E_INVALIDARG;
01003     }
01004
01005     _GetCurrentSelection();
01006
01007     *pacp = m_acpEnd;
01008
01009     return S_OK;
01010 }
01011
01012 /**************************************************************************
01013
01014    CTSFEditWnd::GetActiveView()
01015
01016 **************************************************************************/
01017
01018 STDMETHODIMP CTSFEditWnd::GetActiveView(TsViewCookie *pvcView)
01019 {
01020     OutputDebugString(TEXT("CTSFEditWnd::GetActiveView \n"));
01021
01022     //this app only supports one view, so this can be constant
01023     *pvcView = EDIT_VIEW_COOKIE;
01024
01025     return S_OK;
01026 }
01027
01028 /**************************************************************************
01029
01030    CTSFEditWnd::GetACPFromPoint()
01031
01032 **************************************************************************/
01033
01034 STDMETHODIMP CTSFEditWnd::GetACPFromPoint(  TsViewCookie vcView,
01035                                             const POINT *pt,
01036                                             DWORD dwFlags,
01037                                             LONG *pacp)
01038 {
01039     OutputDebugString(TEXT("CTSFEditWnd::GetACPFromPoint \n"));
01040
01041     return E_NOTIMPL;
01042 }
01043
01044 /**************************************************************************
01045
01046     CTSFEditWnd::GetTextExt()
01047
01048     If the text spans multiple lines, the result is the rectangle that
01049     contains all of the requested characters.
01050
01051 **************************************************************************/
01052
01053 STDMETHODIMP CTSFEditWnd::GetTextExt(   TsViewCookie vcView,
01054                                         LONG acpStart,
01055                                         LONG acpEnd,
01056                                         RECT *prc,
01057                                         BOOL *pfClipped)
01058 {
01059     OutputDebugString(TEXT("CTSFEditWnd::GetTextExt \n"));
01060
01061     if(IsBadWritePtr(prc, sizeof(RECT)) || IsBadWritePtr(pfClipped, sizeof(BOOL)))
01062     {
01063         return E_INVALIDARG;
01064     }
01065
01066     *pfClipped = FALSE;
01067     ZeroMemory(prc, sizeof(RECT));
01068
01069     if(EDIT_VIEW_COOKIE != vcView)
01070     {
01071         return E_INVALIDARG;
01072     }
01073
01074     //does the caller have a lock
01075     if(!_IsLocked(TS_LF_READ))
01076     {
01077         //the caller doesn't have a lock
01078         return TS_E_NOLOCK;
01079     }
01080
01081     //is this an empty request?
01082     if(acpStart == acpEnd)
01083     {
01084         return E_INVALIDARG;
01085     }
01086
01087     LONG        lTextLength;
01088     LONG        lTemp;
01089     RECT        rc;
01090     DWORD       dwStart;
01091     DWORD       dwEnd;
01092     HDC         hdc;
01093     HFONT       hfont;
01094     TEXTMETRIC  tm;
01095     LONG        lLineHeight;
01096     LPWSTR      pwszText;
01097     HRESULT     hr;
01098
01099     hr = _GetText(&pwszText);
01100     if(FAILED(hr))
01101     {
01102         return hr;
01103     }
01104
01105     lTextLength = (LONG)SendMessage(m_hwndEdit, WM_GETTEXTLENGTH, 0, 0);
01106
01107     //are the start and end reversed?
01108     if(acpStart > acpEnd)
01109     {
01110         lTemp = acpStart;
01111         acpStart = acpEnd;
01112         acpEnd = lTemp;
01113     }
01114
01115     //request to the end of the text?
01116     if(-1 == acpEnd)
01117     {
01118         acpEnd = lTextLength - 1;
01119     }
01120
01121     hdc = GetDC(m_hwndEdit);
01122     hfont = (HFONT)SendMessage(m_hwndEdit, WM_GETFONT, 0, 0);
01123     hfont = (HFONT)SelectObject(hdc, hfont);
01124
01125     //get the position of the start character
01126     dwStart = (DWORD)SendMessage(m_hwndEdit, EM_POSFROMCHAR, acpStart, 0);
01127     rc.left = LOWORD(dwStart);
01128     rc.top = HIWORD(dwStart);
01129
01130     //get the position of the last character
01131     /*
01132     The character offset passed to this method is inclusive. For example, if
01133     the first character is being requested, acpStart will be 0 and acpEnd will
01134     be 1. If the last character is requested, acpEnd will not equal a valid
01135     character, so EM_POSFROMCHAR fails. If the next character is on another
01136     line, EM_POSFROMCHAR won't return a valid value. To work around this, get
01137     the position of the beginning of the end character, calculate the width of
01138     the end character and add the width to the rectangle.
01139     */
01140     acpEnd--;
01141     dwEnd = (DWORD)SendMessage(m_hwndEdit, EM_POSFROMCHAR, acpEnd, 0);
01142
01143     //calculate the width of the last character
01144     SIZE    size;
01145     GetTextExtentPoint32(hdc, pwszText + acpEnd, 1, &size);
01146     rc.right = LOWORD(dwEnd) + size.cx;
01147     rc.bottom = HIWORD(dwEnd);
01148
01149     //calculate the line height
01150     GetTextMetrics(hdc, &tm);
01151     lLineHeight = tm.tmHeight;
01152
01153     SelectObject(hdc, hfont);
01154     ReleaseDC(m_hwndEdit, hdc);
01155
01156     /*
01157     If the text range spans multiple lines, expand the rectangle to include all
01158     of the requested text.
01159     */
01160     if(rc.bottom > rc.top)
01161     {
01162         DWORD   dwMargins;
01163         RECT    rcEdit;
01164
01165         GetClientRect(m_hwndEdit, &rcEdit);
01166
01167         dwMargins = (DWORD)SendMessage(m_hwndEdit, EM_GETMARGINS, 0, 0);
01168
01169         //set the left point of the rectangle to the left margin of the edit control
01170         rc.left = LOWORD(dwMargins);
01171
01172         //set the right member to the width of the edit control less both the right margin
01173         rc.right = rc.right - HIWORD(dwMargins);
01174     }
01175
01176     //add the line height to the bottom of the rectangle
01177     rc.bottom += lLineHeight;
01178
01179     *prc = rc;
01180
01181     //if any part of the text rectangle is not visible, set *pfClipped to TRUE
01182     GetClientRect(m_hwndEdit, &rc);
01183
01184     if( (prc->left < rc.left) ||
01185         (prc->top < rc.top) ||
01186         (prc->right > rc.right) ||
01187         (prc->bottom > rc.bottom))
01188     {
01189         *pfClipped = TRUE;
01190     }
01191
01192     //convert the rectangle to screen coordinates
01193     MapWindowPoints(m_hwndEdit, NULL, (LPPOINT)prc, 2);
01194
01195     GlobalFree(pwszText);
01196
01197     return S_OK;
01198 }
01199
01200 /**************************************************************************
01201
01202    CTSFEditWnd::GetScreenExt()
01203
01204 **************************************************************************/
01205
01206 STDMETHODIMP CTSFEditWnd::GetScreenExt(TsViewCookie vcView, RECT *prc)
01207 {
01208     OutputDebugString(TEXT("CTSFEditWnd::GetScreenExt \n"));
01209
01210     if(IsBadWritePtr(prc, sizeof(RECT)))
01211     {
01212         return E_INVALIDARG;
01213     }
01214
01215     ZeroMemory(prc, sizeof(RECT));
01216
01217     if(EDIT_VIEW_COOKIE != vcView)
01218     {
01219         return E_INVALIDARG;
01220     }
01221
01222     //no lock is necessary for this method.
01223
01224     GetClientRect(m_hwndEdit, prc);
01225     MapWindowPoints(m_hwndEdit, NULL, (LPPOINT)prc, 2);
01226
01227     return S_OK;
01228 }
01229
01230 /**************************************************************************
01231
01232    CTSFEditWnd::GetWnd()
01233
01234 **************************************************************************/
01235
01236 STDMETHODIMP CTSFEditWnd::GetWnd(TsViewCookie vcView, HWND *phwnd)
01237 {
01238     OutputDebugString(TEXT("CTSFEditWnd::GetWnd \n"));
01239
01240     if(EDIT_VIEW_COOKIE == vcView)
01241     {
01242         *phwnd = _GetWindow();
01243
01244         return S_OK;
01245     }
01246
01247     return E_INVALIDARG;
01248 }
01249
01250 /**************************************************************************
01251
01252    CTSFEditWnd::InsertTextAtSelection()
01253
01254 **************************************************************************/
01255
01256 STDMETHODIMP CTSFEditWnd::InsertTextAtSelection(    DWORD dwFlags,
01257                                                     const WCHAR *pwszText,
01258                                                     ULONG cch,
01259                                                     LONG *pacpStart,
01260                                                     LONG *pacpEnd,
01261                                                     TS_TEXTCHANGE *pChange)
01262 {
01263     OutputDebugString(TEXT("CTSFEditWnd::InsertTextAtSelection \n"));
01264
01265     LONG    lTemp;
01266
01267     //does the caller have a lock
01268     if(!_IsLocked(TS_LF_READWRITE))
01269     {
01270         //the caller doesn't have a lock
01271         return TS_E_NOLOCK;
01272     }
01273
01274     //verify pwszText
01275     if(IsBadReadPtr(pwszText, cch * sizeof(WCHAR)))
01276     {
01277         return E_INVALIDARG;
01278     }
01279
01280     //verify pacpStart
01281     if(IsBadWritePtr(pacpStart, sizeof(LONG)))
01282     {
01283         pacpStart = &lTemp;
01284     }
01285
01286     //verify pacpEnd
01287     if(IsBadWritePtr(pacpEnd, sizeof(LONG)))
01288     {
01289         pacpEnd = &lTemp;
01290     }
01291
01292     LONG    acpStart;
01293     LONG    acpOldEnd;
01294     LONG    acpNewEnd;
01295
01296     _GetCurrentSelection();
01297
01298     acpOldEnd = m_acpEnd;
01299     _TestInsert(m_acpStart, m_acpEnd, cch, &acpStart, &acpNewEnd);
01300
01301     if(dwFlags & TS_IAS_QUERYONLY)
01302     {
01303         *pacpStart = acpStart;
01304         *pacpEnd = acpOldEnd;
01305         return S_OK;
01306     }
01307
01308     LPWSTR  pwszCopy;
01309
01310     pwszCopy = (LPWSTR)GlobalAlloc(GMEM_FIXED, (cch + 1) * sizeof(WCHAR));
01311     if(NULL == pwszCopy)
01312     {
01313         return E_OUTOFMEMORY;
01314     }
01315
01316     //pwszText will most likely not be NULL terminated
01317     CopyMemory(pwszCopy, pwszText, cch * sizeof(WCHAR));
01318     pwszCopy[cch] = 0;
01319
01320     //don't notify TSF of text and selection changes when in response to a TSF action
01321     m_fNotify = FALSE;
01322
01323     //insert the text
01324     ::SendMessage(m_hwndEdit, EM_REPLACESEL, TRUE, (LPARAM)pwszCopy);
01325
01326     //set the selection
01327     ::SendMessage(m_hwndEdit, EM_SETSEL, acpStart, acpNewEnd);
01328
01329     m_fNotify = TRUE;
01330
01331     _GetCurrentSelection();
01332
01333     if(!(dwFlags & TS_IAS_NOQUERY))
01334     {
01335         *pacpStart = acpStart;
01336         *pacpEnd = acpNewEnd;
01337     }
01338
01339     //set the TS_TEXTCHANGE members
01340     pChange->acpStart = acpStart;
01341     pChange->acpOldEnd = acpOldEnd;
01342     pChange->acpNewEnd = acpNewEnd;
01343
01344     GlobalFree(pwszCopy);
01345
01346     //defer the layout change notification until the document is unlocked
01347     m_fLayoutChanged = TRUE;
01348
01349     return S_OK;
01350 }
01351
01352 /**************************************************************************
01353
01354    CTSFEditWnd::InsertEmbeddedAtSelection()
01355
01356 **************************************************************************/
01357
01358 STDMETHODIMP CTSFEditWnd::InsertEmbeddedAtSelection(    DWORD dwFlags,
01359                                                         IDataObject *pDataObject,
01360                                                         LONG *pacpStart,
01361                                                         LONG *pacpEnd,
01362                                                         TS_TEXTCHANGE *pChange)
01363 {
01364     OutputDebugString(TEXT("CTSFEditWnd::InsertEmbeddedAtSelection \n"));
01365
01366     return E_NOTIMPL;
01367 }
01368
01369
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/Atl.Cpp Source File

  • Security
  • CertServices
  • Encode

Atl.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        atl.cpp
00007 //
00008 // Contents:    ActiveX Template Library COM support
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include <pch.cpp>
00013
00014 #pragma hdrstop
00015
00016 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagSAMPLEITEMSETTINGS Member List

This is the complete list of members for _tagSAMPLEITEMSETTINGS, including all inherited members.
dir1 | _tagSAMPLEITEMSETTINGS
dir2 | _tagSAMPLEITEMSETTINGS
fRecursive | _tagSAMPLEITEMSETTINGS
fSyncLock | _tagSAMPLEITEMSETTINGS
genericItem | _tagSAMPLEITEMSETTINGS
pLockHandler | _tagSAMPLEITEMSETTINGS
syncmgrItem | _tagSAMPLEITEMSETTINGS
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GBGETTEXTW Member List

This is the complete list of members for GBGETTEXTW, including all inherited members.
cch | GBGETTEXTW
psz | GBGETTEXTW
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/common.h Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

common.h

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: Service.h
00008
00009     PURPOSE: Provides file replication service function declarations.
00010
00011     FUNCTIONS:
00012
00013     COMMENTS: These funtions may be used by the main service routines
00014         as well as by the client and server file replication RPC routines.
00015
00016 */
00017
00018 #pragma once
00019
00020 #include <windows.h>
00021 #include <crtdbg.h>
00022
00023 // Macro for printing out error message and exiting the program if an
00024 // error occured during an RPC library call.
00025 #define EXIT_IF_FAIL(x, string){ \
00026         ((x) != RPC_S_OK) ? _tprintf(TEXT("%s failed with error %d\n"), \
00027         TEXT(string), (x)), exit(EXIT_FAILURE) : 0;}
00028
00029 // Make sure the ASSERTE macro is defined.
00030 #ifndef ASSERTE
00031 #define ASSERTE _ASSERTE
00032 #endif
00033
00034 // Size for short message strings.
00035 #define MSG_SIZE (256)
00036
00037 VOID * AutoHeapAlloc(size_t dwBytes);
00038
00039 VOID AutoHeapFree(VOID * lpMem);
00040
00041 // end common.h
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/multichan.cpp Source File

  • Multimedia
  • Audio
  • multichan

multichan.cpp

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 // multichan.cpp : Defines the class behaviors for the application.
00006 //
00007
00008 #include "stdafx.h"
00009 #include "multichan.h"
00010
00011 #include "MainFrm.h"
00012 #include "resource.h"
00013
00014 #ifdef _DEBUG
00015 #define new DEBUG_NEW
00016 #undef THIS_FILE
00017 static char THIS_FILE[] = __FILE__;
00018 #endif
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // CMultichanApp
00022
00023 BEGIN_MESSAGE_MAP(CMultichanApp, CWinApp)
00024   //{{AFX_MSG_MAP(CMultichanApp)
00025   ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00026   //}}AFX_MSG_MAP
00027 END_MESSAGE_MAP()
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // CMultichanApp construction
00031
00032 CMultichanApp::CMultichanApp()
00033 {
00034   // TODO: add construction code here,
00035   // Place all significant initialization in InitInstance
00036 }
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CMultichanApp destruction
00040 CMultichanApp::~CMultichanApp()
00041 {
00042     if( g_pdlgDest )
00043         delete g_pdlgDest;
00044
00045   POSITION  pos   = g_listSources.GetHeadPosition();
00046   CDlgSrc * pdlgSrc = 0;
00047
00048   for( ; pos; )
00049   {
00050     pdlgSrc = g_listSources.GetNext( pos );
00051     delete pdlgSrc;
00052     pdlgSrc = 0;
00053   }
00054
00055   g_listSources.RemoveAll();
00056
00057     ASSERT( g_listSources.IsEmpty() );
00058 }
00059
00060 /////////////////////////////////////////////////////////////////////////////
00061 // The one and only CMultichanApp object
00062
00063 CMultichanApp theApp;
00064
00065 /////////////////////////////////////////////////////////////////////////////
00066 // CMultichanApp initialization
00067
00068 BOOL CMultichanApp::InitInstance()
00069 {
00070   // Standard initialization
00071   // If you are not using these features and wish to reduce the size
00072   //  of your final executable, you should remove from the following
00073   //  the specific initialization routines you do not need.
00074
00075 #ifdef _AFXDLL
00076   Enable3dControls();     // Call this when using MFC in a shared DLL
00077 #else
00078   Enable3dControlsStatic(); // Call this when linking to MFC statically
00079 #endif
00080
00081   // Change the registry key under which our settings are stored.
00082   // TODO: You should modify this string to be something appropriate
00083   // such as the name of your company or organization.
00084   SetRegistryKey(_T("Local AppWizard-Generated Applications"));
00085
00086
00087   // To create the main window, this code creates a new frame window
00088   // object and then sets it as the application's main window object.
00089
00090   CMainFrame* pFrame = new CMainFrame;
00091   m_pMainWnd = pFrame;
00092
00093   // create and load the frame with its resources
00094   pFrame->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL);
00095
00096     ASSERT(g_pChildView);
00097     g_pdlgDest = new CDlgDest(g_pChildView);
00098     g_pdlgDest->Create();
00099
00100   // The one and only window has been initialized, so show and update it.
00101   pFrame->ShowWindow(SW_SHOW);
00102   pFrame->UpdateWindow();
00103
00104   return TRUE;
00105 }
00106
00107 /////////////////////////////////////////////////////////////////////////////
00108 // CMultichanApp message handlers
00109
00110 void CMultichanApp::OnAppAbout()
00111 {
00112   CDialog* pdlg = new CDialog(MAKEINTRESOURCE(IDD_ABOUTBOX));
00113
00114     pdlg->DoModal();
00115 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/networking/asyncdemo/resource.h Source File

  • Web
  • networking
  • asyncdemo

resource.h

Go to the documentation of this file.
00001 /* Microsoft Corporation Copyright 1999 - 2000 */
00002 //{{NO_DEPENDENCIES}}
00003 // Microsoft Developer Studio generated include file.
00004 // Used by AsyncDemo.rc
00005 //
00006 #define ID_EXIT                         1000
00007 #define IDC_EXIT                        1000
00008 #define IDC_Download                    1001
00009 #define IDC_URL1                        1002
00010 #define IDC_Header1                     1003
00011 #define IDC_Resource1                   1004
00012 #define IDC_LIST1                       1005
00013 #define IDC_CallbackList                1005
00014 #define IDC_URL2                        1011
00015 #define IDC_Header2                     1012
00016 #define IDC_Resource2                   1013
00017
00018 // Next default values for new objects
00019 //
00020 #ifdef APSTUDIO_INVOKED
00021 #ifndef APSTUDIO_READONLY_SYMBOLS
00022 #define _APS_NEXT_RESOURCE_VALUE        102
00023 #define _APS_NEXT_COMMAND_VALUE         40001
00024 #define _APS_NEXT_CONTROL_VALUE         1006
00025 #define _APS_NEXT_SYMED_VALUE           101
00026 #endif
00027 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/Imp_Draw.Cpp Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

Imp_Draw.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // Imp_Draw.cpp : Defines the class behaviors for the application.
00014 //
00015
00016
00017 #include "stdafx.h"
00018 #include "Imp_Draw.h"
00019 #include "Imp_Dlg.h"
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CImp_DrawApp
00029
00030 BEGIN_MESSAGE_MAP(CImp_DrawApp, CWinApp)
00031   //{{AFX_MSG_MAP(CImp_DrawApp)
00032     // NOTE - the ClassWizard will add and remove mapping macros here.
00033     //    DO NOT EDIT what you see in these blocks of generated code!
00034   //}}AFX_MSG
00035   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00036 END_MESSAGE_MAP()
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CImp_DrawApp construction
00040
00041 CImp_DrawApp::CImp_DrawApp()
00042 {
00043   // TODO: add construction code here,
00044   // Place all significant initialization in InitInstance
00045 }
00046
00047 /////////////////////////////////////////////////////////////////////////////
00048 // The one and only CImp_DrawApp object
00049
00050 CImp_DrawApp theApp;
00051
00052 /////////////////////////////////////////////////////////////////////////////
00053 // CImp_DrawApp initialization
00054
00055 BOOL CImp_DrawApp::InitInstance()
00056 {
00057   // Standard initialization
00058   // If you are not using these features and wish to reduce the size
00059   //  of your final executable, you should remove from the following
00060   //  the specific initialization routines you do not need.
00061
00062 #ifdef _AFXDLL
00063   Enable3dControls();     // Call this when using MFC in a shared DLL
00064 #else
00065   Enable3dControlsStatic(); // Call this when linking to MFC statically
00066 #endif
00067
00068   CImp_DrawDlg dlg;
00069   m_pMainWnd = &dlg;
00070   int nResponse = dlg.DoModal();
00071   if (nResponse == IDOK)
00072   {
00073     // TODO: Place code here to handle when the dialog is
00074     //  dismissed with OK
00075   }
00076   else if (nResponse == IDCANCEL)
00077   {
00078     // TODO: Place code here to handle when the dialog is
00079     //  dismissed with Cancel
00080   }
00081
00082   // Since the dialog has been closed, return FALSE so that we exit the
00083   //  application, rather than start the application's message pump.
00084   return FALSE;
00085 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Common/ProxyStub/SimpleLog.Idl Source File

  • Com
  • Common
  • ProxyStub

SimpleLog.Idl

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 ********************************************************************************
00004 * Filename: SimpleLog.idl
00005 *
00006 * Description:
00007 *
00008 * This file is provided as part of the Microsoft Transaction Server
00009 * Software Development Kit
00010 *
00011 *THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
00012 *WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
00013 *INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00014 *OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
00015 *PURPOSE.
00016 *
00017 * Copyright (C) 1997 Microsoft Corporation, All rights reserved
00018 ********************************************************************************
00019 \******************************************************************************/
00020 // SimpleLog.idl : IDL source for SimpleLog.dll
00021 //
00022
00023 // This file will be processed by the MIDL tool to
00024 // produce the type library (SimpleLog.tlb) and marshalling code.
00025 import "oaidl.idl";
00026
00027 //---------------------------------------------------------------------
00028 // LOG_RM_COMMAND:
00029 // Enumeration of resource manager command codes used during logging.
00030 //---------------------------------------------------------------------
00031
00032 typedef long LOG_RM_COMMAND;
00033
00034 const LOG_RM_COMMAND  LOG_RM_PRIVATE      =1;
00035 const LOG_RM_COMMAND  LOG_RM_XACT_PREPARE   =2;
00036 const LOG_RM_COMMAND  LOG_RM_XACT_COMMIT    =3;
00037 const LOG_RM_COMMAND  LOG_RM_XACT_BEGIN   =4;
00038 const LOG_RM_COMMAND  LOG_RM_XACT_END     =5;
00039 const LOG_RM_COMMAND  LOG_RM_ENDOFLOG     =6;
00040 const LOG_RM_COMMAND  LOG_RM_CHECKPOINT   =7;
00041 const LOG_RM_COMMAND  LOG_RM_ABORT_REQUEST  =20;
00042 const LOG_RM_COMMAND  LOG_RM_COMMIT_REQUEST =21;
00043
00044
00045 [
00046
00047     object,
00048     uuid(5BFC4335-4C90-11D0-9697-00AA00C149A6),
00049     helpstring("ISimpleLog Interface"),
00050     pointer_default(unique)
00051   ]
00052   interface ISimpleLog : IUnknown
00053   {
00054
00055
00056     HRESULT WriteLog (  [in] GUID guidTx,
00057               [in] LOG_RM_COMMAND eOp,
00058               [in, size_is(cbBytes)] BYTE * pByte,
00059               [in] long cbBytes);
00060
00061     HRESULT Init([in]BSTR  pszLogFileName);
00062     HRESULT RecoveryInfo([out] IStorage **ppStorage);
00063     [helpstring("method WriteStreamToLog")] HRESULT WriteStreamToLog(GUID GuidTx, LOG_RM_COMMAND eOp, IStream * pStream);
00064     [helpstring("method RemoveTxStream")] HRESULT RemoveTxStream(GUID guidTx);
00065     [helpstring("method WriteVariantToLog")] HRESULT WriteVariantToLog(GUID m_guidTx, VARIANT *pVariant);
00066     [helpstring("method GetStream")] HRESULT GetStream(GUID guidTx, [out] IStream **ppStream);
00067
00068
00069   };
00070 [
00071   uuid(5BFC4333-4C90-11D0-9697-00AA00C149A6),
00072   version(1.0),
00073   helpstring("SimpleLog 1.0 Type Library")
00074 ]
00075 library SIMPLELOGLib
00076 {
00077   importlib("stdole32.tlb");
00078
00079   [
00080     uuid(5BFC4336-4C90-11D0-9697-00AA00C149A6),
00081     helpstring("SimpleLog Class")
00082   ]
00083   coclass CoSimpleLog
00084   {
00085     [default] interface ISimpleLog;
00086   };
00087 };
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlGuid.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

HtmlGuid.Cxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       htmlguid.cxx
00006 //
00007 //  Contents:   Definitions of Html properties
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include <pch.cxx>
00012 #pragma hdrstop
00013
00014 #include <htmlguid.hxx>
00015 #include <ntquery.h>
00016
00017 GUID CLSID_Storage = PSGUID_STORAGE;
00018
00019 GUID CLSID_SummaryInformation = {
00020     0xF29F85E0,
00021     0x4FF9,
00022     0x1068,
00023     { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 }
00024 };
00025
00026 GUID CLSID_HtmlInformation = {
00027     0x70eb7a10,
00028     0x55d9,
00029     0x11cf,
00030     { 0xb7, 0x5b, 0x00, 0xaa, 0x00, 0x51, 0xfe, 0x20 }
00031 };
00032
00033
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Title.c Source File

  • WinUI
  • CommDlg
  • CDTest

Title.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 /************************************************************************
00007
00008   File: title.c
00009
00010   Purpose:
00011
00012      Contains the functions that control CDTEST's GetFileTitle()
00013      dialog box.
00014
00015
00016   Functions:
00017
00018     - DoTitleDialog()    -- Creates CDTEST's GetFileTitle() dialog.
00019
00020     - TitleProc()        -- The callback function for CDTEST's
00021                             GetFileTitle() dialog box.
00022
00023 ************************************************************************/
00024
00025
00026 #include <windows.h>
00027 #include <commdlg.h>
00028 #include "cdtest.h"
00029 #include "title.h"
00030
00031 extern UINT_PTR uMode ;                               //see cdtest.c
00032 extern LONG_PTR MyAtol(LPTSTR, BOOL, LPBOOL) ;
00033
00034
00035 #define MAXTITLE 256
00036
00037 TCHAR szTitle[MAXTITLE] ;
00038 TCHAR szPath[MAXTITLE] ;
00039 short nReturn ;
00040 WORD wBufSize ;
00041
00042
00043
00044
00045 /************************************************************************
00046
00047   Function: DoTitleDialog(HWND)
00048
00049   Purpose: Creates CDTEST's GetFileTitle() dialog box.
00050
00051   Returns: Nothing.
00052
00053   Comments:
00054
00055 ************************************************************************/
00056
00057 void DoTitleDialog(HWND hwnd)
00058 {
00059   DialogBox(hInst, MAKEINTRESOURCE(ID_TITLEDIALOG), hwnd, TitleProc) ;
00060
00061 }
00062
00063
00064
00065
00066
00067
00068 /************************************************************************
00069
00070   Function: TitleProc(HWND, UINT, WPARAM, LPARAM)
00071
00072   Purpose: Is the callback function for CDTEST's GetFileTitle() dialog.
00073
00074   Returns: TRUE or FALSE depending on the situation.
00075
00076   Comments:
00077
00078 ************************************************************************/
00079
00080
00081 INT_PTR APIENTRY TitleProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00082 {
00083   TCHAR szNum[30] ;
00084   BOOL b ;
00085
00086   switch (msg)
00087   {
00088     case WM_INITDIALOG:
00089       SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
00090       break ;
00091
00092     case WM_COMMAND:
00093     {
00094         switch (LOWORD(wParam))
00095         {
00096           case IDOK:
00097             GetDlgItemText(hwnd, ID_PATHTI, szPath, MAXTITLE) ;
00098             GetDlgItemText(hwnd, ID_BUFFSIZETI, szNum, 30) ;
00099
00100             wBufSize =  (WORD) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;
00101
00102             if (wBufSize > 256)
00103             {
00104                 wBufSize = 256 ;
00105                 SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
00106             }
00107
00108             nReturn = GetFileTitle(szPath, szTitle, wBufSize) ;
00109             wsprintf(szTemp, szShortFilter, nReturn) ;
00110             SetDlgItemText(hwnd, ID_RETURNTI, szTemp) ;
00111             SetDlgItemText(hwnd, ID_TITLETI, szTitle) ;
00112
00113             break ;
00114
00115           case IDCANCEL:
00116             EndDialog(hwnd, FALSE) ;
00117             break ;
00118
00119           case ID_RESETTITLE:
00120             szPath[0] = 0 ;
00121             szNum[0] = 0 ;
00122             szTemp[0] = 0 ;
00123             szTitle[0] = 0 ;
00124             SetDlgItemText(hwnd, ID_PATHTI, szPath) ;
00125             SetDlgItemText(hwnd, ID_RETURNTI, szTemp) ;
00126             SetDlgItemText(hwnd, ID_TITLETI, szTitle) ;
00127             SetDlgItemText(hwnd, ID_BUFFSIZETI, TEXT("256")) ;
00128             break ;
00129
00130
00131           default: break ;
00132         }
00133     }
00134
00135     default: break ;
00136   }
00137
00138   return FALSE ;
00139 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/GenericUCP/CPP/genericucpdlg.h Source File

  • NetDS
  • upnp
  • GenericUCP
  • CPP

genericucpdlg.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation
00004
00005
00006 --*/
00007 // GenericUCPDlg.h : header file
00008 //
00009
00010 #if !defined(AFX_GenericUCPDLG_H__06D8F92D_3842_4BB8_9B3B_39AF51C4070A__INCLUDED_)
00011 #define AFX_GenericUCPDLG_H__06D8F92D_3842_4BB8_9B3B_39AF51C4070A__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017 #include <objbase.h>
00018 #include <upnp.h>
00019
00020 #define DATA_BUFSIZE 2048
00021
00022
00023 class CGenericUCPDlg;
00024
00025 // DeviceFinder Callback
00026 class CDeviceFinderCallback :
00027   public CComObjectRootEx <CComSingleThreadModel>,
00028   public IUPnPDeviceFinderCallback
00029 {
00030   private:
00031     CGenericUCPDlg* m_pGenericUCPDlg;
00032   public:
00033   CDeviceFinderCallback() {};
00034   ~CDeviceFinderCallback() {};
00035
00036   BEGIN_COM_MAP(CDeviceFinderCallback)
00037         COM_INTERFACE_ENTRY(IUPnPDeviceFinderCallback)
00038     END_COM_MAP()
00039
00040   // *** IUPnPDeviceFinderCallback methods ***
00041     STDMETHOD(DeviceAdded)(LONG lFindData, IUPnPDevice * pDevice);
00042     STDMETHOD(DeviceRemoved)(LONG lFindData, BSTR bstrUDN);
00043     STDMETHOD(SearchComplete)(LONG lFindData);
00044
00045   // Other functions
00046   static CDeviceFinderCallback * Create();
00047   void SetDialogPointer(CGenericUCPDlg* pDialog);
00048
00049 };
00050
00051 // Service Callback
00052 class CServiceCallback :
00053   public CComObjectRootEx <CComSingleThreadModel>,
00054   public IUPnPServiceCallback
00055 {
00056   private:
00057     CGenericUCPDlg* m_pGenericUCPDlg;
00058   public:
00059
00060   CServiceCallback() {};
00061   ~CServiceCallback() {};
00062
00063   BEGIN_COM_MAP(CServiceCallback)
00064         COM_INTERFACE_ENTRY(IUPnPServiceCallback)
00065     END_COM_MAP()
00066
00067   // *** IUPnPServiceCallback methods ***
00068   STDMETHOD (StateVariableChanged)(IUPnPService *pus, LPCWSTR pcwszStateVarName, VARIANT varValue);
00069   STDMETHOD (ServiceInstanceDied)(IUPnPService *pus);
00070
00071   // Other functions
00072   static CServiceCallback * Create();
00073   void SetDialogPointer(CGenericUCPDlg* pDialog);
00074
00075
00076 };
00077
00078
00079 ////////////////////////////////////////////////////////////////////////////
00080 // CGenericUCPDlg dialog
00081
00082 class CGenericUCPDlg :
00083   public CDialog
00084 {
00085 // Construction
00086 public:
00087   CGenericUCPDlg(CWnd* pParent = NULL); // standard constructor
00088   ~CGenericUCPDlg();
00089
00090
00091   // Dialog Data
00092   //{{AFX_DATA(CGenericUCPDlg)
00093   enum { IDD = IDD_GENERICUCP_DIALOG };
00094   CEdit m_VariableName;
00095   CEdit m_ActionName;
00096   CStatic m_StatusText;
00097   CStatic m_EventText;
00098   CButton m_ViewSCPD;
00099   CEdit m_SCPDURL;
00100   CButton m_Presentation;
00101   CButton m_QueryVariable;
00102   CButton m_InvokeAction;
00103   CButton m_StartDiscovery;
00104   CButton m_DeviceProperties;
00105   CComboBox m_ServiceCombo;
00106   CComboBox m_FindCombo;
00107   CComboBox m_DeviceCombo;
00108   CButton m_CloseApp;
00109   CEdit m_ActionOutArgument;
00110   CEdit m_ActionInArgument;
00111   CButton m_FindByType;
00112   CButton m_FindByUDN;
00113   CButton m_AsyncFind;
00114   //}}AFX_DATA
00115
00116   // ClassWizard generated virtual function overrides
00117   //{{AFX_VIRTUAL(CGenericUCPDlg)
00118   protected:
00119   virtual void DoDataExchange(CDataExchange* pDX);  // DDX/DDV support
00120   //}}AFX_VIRTUAL
00121
00122   virtual BOOL PreTranslateMessage(MSG *);
00123 // Implementation
00124 protected:
00125   HICON m_hIcon;
00126
00127   // Generated message map functions
00128   //{{AFX_MSG(CGenericUCPDlg)
00129   virtual BOOL OnInitDialog();
00130   afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
00131   afx_msg void OnAppAbout();
00132   afx_msg void OnPaint();
00133   afx_msg HCURSOR OnQueryDragIcon();
00134   afx_msg void OnFindByType();
00135   afx_msg void OnDiscoveryClicked();
00136   afx_msg void OnFindbyUDN();
00137   afx_msg void OnAsyncFind();
00138   afx_msg void OnSelEndOkComboDevice();
00139   afx_msg void OnSelEndOkComboService();
00140   afx_msg void OnDevpropClick();
00141   afx_msg void OnQueryVariable();
00142   afx_msg void OnInvokeAction();
00143   afx_msg void OnCloseClick();
00144   afx_msg void OnClose();
00145   //}}AFX_MSG
00146   DECLARE_MESSAGE_MAP()
00147
00148 private:
00149   void ProcessFindByType(BSTR bstrSearchType);
00150   void ProcessFindByUDN(BSTR bstrSearchType);
00151   void ProcessAsyncFind(BSTR bstrSearchType);
00152
00153   int iNumberOfInArguments(TCHAR *tszString);
00154   void StopAsyncFindIfStarted();
00155   void InitializeUDNList();
00156   BOOL fFileExists(LPTSTR ptszFileName);
00157   void InitializeDevTypeArray();
00158   void ClearAllDataStructures(BOOL fClearFindCombo);
00159
00160   void ClearDeviceCombo();
00161   void ClearServiceCombo();
00162
00163   //Private variables
00164   IUPnPDeviceFinder* m_pDeviceFinder;
00165
00166   LONG  m_lAsyncFindHandle;
00167   BOOL  m_fAsyncFindRunning;
00168   CStringArray m_astrDevType;
00169
00170
00171   //Callback object pointers
00172   IUPnPDeviceFinderCallback *m_pDeviceFinderCallback;
00173   IUPnPServiceCallback *m_pServiceCallback;
00174
00175 public:
00176   void AddDevice(IUPnPDevice *pDevice);
00177   void RemoveDevice(BSTR bstrUDN);
00178 };
00179
00180 //{{AFX_INSERT_LOCATION}}
00181 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00182
00183 #endif // !defined(AFX_GenericUCPDLG_H__06D8F92D_3842_4BB8_9B3B_39AF51C4070A__INCLUDED_)
00184
00185
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ISAPI_STRING Member List

This is the complete list of members for ISAPI_STRING, including all inherited members.
_Buffer | ISAPI_STRING | [private]
Append(CHAR *szString, DWORD cchString=0) | ISAPI_STRING |
AppendW(WCHAR *szStringW, DWORD cchStringW=0) | ISAPI_STRING |
Base64Encode(VOID *pBuffer, DWORD cbBuffer) | ISAPI_STRING |
CalcLen(VOID) | ISAPI_STRING |
Copy(CHAR *szString, DWORD cchString=0) | ISAPI_STRING |
CopyToOffset(CHAR *szString, DWORD cchString, DWORD dwOffset) | ISAPI_STRING | [private]
CopyW(WCHAR *szStringW, DWORD cchStringW=0) | ISAPI_STRING |
CopyWToOffset(WCHAR *szStringW, DWORD cchStringW, DWORD dwOffset) | ISAPI_STRING | [private]
Escape(BOOL fAllowDoubleEscaping=FALSE) | ISAPI_STRING |
FindStr(CHAR *szSubString, BOOL fCaseInsensitive=FALSE, DWORD dwStartingOffset=0) | ISAPI_STRING |
ISAPI_STRING(DWORD dwMaxAlloc=0) | ISAPI_STRING |
Printf(CHAR *szString,...) | ISAPI_STRING |
QueryBufferSize(VOID) | ISAPI_STRING |
QueryCB(VOID) | ISAPI_STRING |
QueryCCH(VOID) | ISAPI_STRING |
QueryMaxAlloc(VOID) | ISAPI_STRING |
QueryStr(VOID) | ISAPI_STRING |
ResizeBuffer(DWORD cbSize) | ISAPI_STRING |
SetLen(DWORD cchNewLength) | ISAPI_STRING |
SetMaxAlloc(DWORD dwMaxAlloc) | ISAPI_STRING |
Unescape(VOID) | ISAPI_STRING |
Vsprintf(CHAR *szFormat, va_list args) | ISAPI_STRING |
ZeroBuffer(VOID) | ISAPI_STRING |
~ISAPI_STRING() | ISAPI_STRING | [virtual]
Generated on Wed Nov 13 2024 16:57:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/RegisterServer.Cpp Source File

  • WinUI
  • Shell
  • DiskCleanupHandler

RegisterServer.Cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  RegisterServer.cpp
00011 //
00012 //      Registers the Disk Cleanup Handler in the registry. The
00013 //      following registry keys will be created to register the
00014 //      volume cache:
00015 //
00016 //          HKEY_CLASSES_ROOT\CLSID\{CLSID}
00017 //          HKEY_CLASSES_ROOT\CLSID\{CLSID}\InProcServer32
00018 //
00019 //          HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\
00020 //              CurrentVersion\Explorer\VolumeCaches\CleanupSample
00021 //
00022 //////////////////////////////////////////////////////////////////////
00023
00024 #include "Cleanup.h"
00025 #include "Resource.h"
00026
00027 PSECURITY_DESCRIPTOR WINAPI CreateDacl ();
00028
00029 extern HINSTANCE hDllInstance;
00030
00031 STDAPI DllRegisterServer (VOID)
00032 {
00033     SECURITY_ATTRIBUTES sa = {0};
00034     SECURITY_ATTRIBUTES *pSA = &sa;
00035     TCHAR       szModuleName[MAX_PATH];
00036     HRESULT     hResult = S_OK;
00037     TCHAR       szBuffer[500] = TEXT("");
00038     TCHAR       szClsid[MAX_PATH] = TEXT("");
00039     TCHAR       szSubKey[MAX_PATH] = TEXT("");
00040     TCHAR       szDisplay[MAX_PATH] = TEXT("");
00041     TCHAR       szDescription[MAX_PATH] = TEXT("");
00042     TCHAR       szEmptyVCSubKey[MAX_PATH] = TEXT("");
00043
00044     //
00045     //  Load some necessary string values
00046     //
00047     LoadString (hDllInstance, IDS_CLSID, szClsid, MAX_PATH);
00048     LoadString (hDllInstance, IDS_DISPLAY, szDisplay, MAX_PATH);
00049     LoadString (hDllInstance, IDS_DESCRIPTION, szDescription, MAX_PATH);
00050     LoadString (hDllInstance, IDS_EMPTYVC_SUBKEY, szEmptyVCSubKey, MAX_PATH);
00051
00052 #if _WIN32_WINNT >= 0x5000
00053     //
00054     //  Initialize the security attributes structure
00055     //
00056     sa.nLength              = sizeof (SECURITY_ATTRIBUTES);
00057     sa.lpSecurityDescriptor = CreateDacl ();
00058     sa.bInheritHandle       = FALSE;
00059 #else
00060     pSA = NULL;
00061 #endif
00062     //
00063     //  Get the name of this module
00064     //
00065     GetModuleFileName (hDllInstance, szModuleName, MAX_PATH);
00066
00067     //
00068     //  Register the component under HKCR\CLSID
00069     //
00070     HKEY    hKey            = NULL;
00071     DWORD   dwDisposition   = 0;
00072     LRESULT lResult         = 0;
00073
00074     wsprintf (szSubKey, TEXT("CLSID\\%s"), szClsid);
00075     lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
00076                               0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00077                               pSA, &hKey, &dwDisposition);
00078
00079     if (lResult == NOERROR)
00080     {
00081         lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
00082          (LPBYTE) szDisplay, GetStringByteSize(szDisplay));
00083         if (lResult != NOERROR)
00084             hResult = SELFREG_E_CLASS;
00085         RegCloseKey (hKey);
00086         hKey = NULL;
00087     }
00088     else
00089     {
00090         hResult = SELFREG_E_CLASS;
00091     }
00092
00093     //
00094     //  Register component information under HKCR\CLSID\{CLSID}
00095     //
00096     StrCatBuff (szSubKey, TEXT("\\InprocServer32"), ARRAYSIZE(szSubKey));
00097     lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
00098                               0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00099                               pSA, &hKey, &dwDisposition);
00100
00101     if (lResult == NOERROR)
00102     {
00103         lstrcpyn (szBuffer, TEXT("Apartment"), ARRAYSIZE(szBuffer));
00104         lResult = RegSetValueEx (hKey, TEXT("ThreadingModel"), 0, REG_SZ,
00105          (LPBYTE) szBuffer, GetStringByteSize (szBuffer));
00106         if (lResult != NOERROR)
00107             hResult = SELFREG_E_CLASS;
00108
00109         lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
00110          (LPBYTE) szModuleName, GetStringByteSize(szModuleName));
00111         if (lResult != NOERROR)
00112             hResult = SELFREG_E_CLASS;
00113
00114         RegCloseKey (hKey);
00115         hKey = NULL;
00116     }
00117     else
00118     {
00119         hResult = SELFREG_E_CLASS;
00120     }
00121
00122     wsprintf (szSubKey, TEXT("CLSID\\%s\\DefaultIcon"), szClsid);
00123     lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
00124                               0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00125                               pSA, &hKey, &dwDisposition);
00126
00127     if (lResult == NOERROR)
00128     {
00129         wsprintf (szBuffer, TEXT("%s,%d"), szModuleName, 0);
00130         lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
00131          (LPBYTE) szBuffer, GetStringByteSize(szBuffer));
00132         if (lResult != NOERROR)
00133             hResult = SELFREG_E_CLASS;
00134
00135         RegCloseKey (hKey);
00136         hKey = NULL;
00137     }
00138     else
00139     {
00140         hResult = SELFREG_E_CLASS;
00141     }
00142
00143
00144     //
00145     //  Register the shell extension under
00146     //  HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches
00147     //
00148     wsprintf (szSubKey, TEXT("%s\\%s"), szEmptyVCSubKey, szDisplay);
00149     lResult = RegCreateKeyEx (HKEY_LOCAL_MACHINE, szSubKey,
00150                               0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00151                               pSA, &hKey, &dwDisposition);
00152
00153     if (lResult == NOERROR)
00154     {
00155         lResult = RegSetValueEx (hKey, TEXT("Description"), 0, REG_SZ,
00156          (LPBYTE)szDescription, GetStringByteSize(szDescription));
00157         if (lResult != NOERROR)
00158             hResult = SELFREG_E_CLASS;
00159
00160         lResult = RegSetValueEx (hKey, TEXT("Display"), 0, REG_SZ,
00161          (LPBYTE)szDisplay, GetStringByteSize(szDisplay));
00162         if (lResult != NOERROR)
00163             hResult = SELFREG_E_CLASS;
00164
00165         lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
00166          (LPBYTE)szClsid, GetStringByteSize(szClsid));
00167         if (lResult != NOERROR)
00168             hResult = SELFREG_E_CLASS;
00169
00170         RegCloseKey (hKey);
00171         hKey = NULL;
00172     }
00173     else
00174     {
00175         hResult = SELFREG_E_CLASS;
00176     }
00177
00178     //
00179     //  Free the security descriptor
00180     //
00181     if (sa.lpSecurityDescriptor) {
00182       LocalFree(sa.lpSecurityDescriptor);
00183     }
00184
00185     return hResult;
00186 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/dacl.cpp Source File

  • WinUI
  • Shell
  • DiskCleanupHandler

dacl.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  NullDacl.cpp
00011 //
00012 //      Provides functions to allocate and free a SECURITY_DESCRIPTOR
00013 //      with a NULL DACL
00014 //
00015 //////////////////////////////////////////////////////////////////////
00016
00017
00018 #include "Cleanup.h"
00019 #include <sddl.h>
00020 #include <accctrl.h>
00021 #include <aclapi.h>
00022
00023 #if _WIN32_WINNT >= 0x0500
00024 PSECURITY_DESCRIPTOR WINAPI CreateDacl(void)
00025 {
00026     OSVERSIONINFO           osvi    = {0};
00027     PSECURITY_DESCRIPTOR    psd     = NULL;
00028     static WCHAR *pwszSD=L"D:(A;OICI;GA;;;SY)(A;OICI;GA;;;BA)(A;OICI;GA;;;CO)(A;OICI;GRGWGX;;;IU)";
00029
00030     //
00031     //  Get the OS version info. If not on NT, return NULL
00032     //
00033     osvi.dwOSVersionInfoSize    = sizeof (OSVERSIONINFO);
00034     GetVersionEx (&osvi);
00035     if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT)
00036     {
00037         SetLastError (NOERROR);
00038   goto err;
00039     }
00040
00041     //
00042     //  Allocate memory for the security descriptor
00043     //
00044
00045     ConvertStringSecurityDescriptorToSecurityDescriptorW(pwszSD,
00046               SDDL_REVISION_1,
00047               &psd,
00048               NULL);
00049  err:
00050     return psd;
00051 }
00052
00053 #elif _WIN32_WINNT >= 0x0400
00054 PSECURITY_DESCRIPTOR CreateDacl(void)
00055 {
00056
00057   // ACL creates two ACES - Everyone (R) and Administrator (FC)
00058
00059   DWORD dwRes;
00060   PSID pEveryoneSID = NULL, pAdminSID = NULL;
00061   PACL pACL = NULL;
00062   PSECURITY_DESCRIPTOR pSD = NULL;
00063   EXPLICIT_ACCESS ea[2];
00064   SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
00065   SID_IDENTIFIER_AUTHORITY SIDAuthNT = SECURITY_NT_AUTHORITY;
00066   HKEY hkSub = NULL;
00067
00068   // Create a well-known SID for the Everyone group.
00069
00070   if(! AllocateAndInitializeSid( &SIDAuthWorld, 1,
00071          SECURITY_WORLD_RID,
00072          0, 0, 0, 0, 0, 0, 0,
00073          &pEveryoneSID) ) {
00074     goto Cleanup;
00075   }
00076
00077   // Initialize an EXPLICIT_ACCESS structure for an ACE.
00078   // The ACE will allow Everyone read access to the key.
00079
00080   ZeroMemory(&ea, 2 * sizeof(EXPLICIT_ACCESS));
00081   ea[0].grfAccessPermissions = KEY_READ;
00082   ea[0].grfAccessMode = SET_ACCESS;
00083   ea[0].grfInheritance= NO_INHERITANCE;
00084   ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
00085   ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
00086   ea[0].Trustee.ptstrName  = (LPTSTR) pEveryoneSID;
00087
00088   // Create a SID for the BUILTIN\Administrators group.
00089
00090   if(! AllocateAndInitializeSid( &SIDAuthNT, 2,
00091          SECURITY_BUILTIN_DOMAIN_RID,
00092          DOMAIN_ALIAS_RID_ADMINS,
00093          0, 0, 0, 0, 0, 0,
00094          &pAdminSID) ) {
00095     goto Cleanup;
00096   }
00097
00098   // Initialize an EXPLICIT_ACCESS structure for an ACE.
00099   // The ACE will allow the Administrators group full access to the key.
00100
00101   ea[1].grfAccessPermissions = KEY_ALL_ACCESS;
00102   ea[1].grfAccessMode = SET_ACCESS;
00103   ea[1].grfInheritance= NO_INHERITANCE;
00104   ea[1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
00105   ea[1].Trustee.TrusteeType = TRUSTEE_IS_GROUP;
00106   ea[1].Trustee.ptstrName  = (LPTSTR) pAdminSID;
00107
00108   // Create a new ACL that contains the new ACEs.
00109
00110   dwRes = SetEntriesInAcl(2, ea, NULL, &pACL);
00111   if (ERROR_SUCCESS != dwRes) {
00112     goto Cleanup;
00113   }
00114
00115   // Initialize a security descriptor.
00116
00117   pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR,
00118             SECURITY_DESCRIPTOR_MIN_LENGTH);
00119   if (pSD != NULL) {
00120     if (InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) {
00121
00122       // Add the ACL to the security descriptor.
00123
00124       if (SetSecurityDescriptorDacl(pSD,
00125             TRUE,     // fDaclPresent flag
00126             pACL,
00127             FALSE))   // not a default DACL
00128   {
00129     return pSD;
00130   }
00131     }
00132   }
00133
00134
00135
00136  Cleanup:
00137
00138   if (pEveryoneSID)
00139     FreeSid(pEveryoneSID);
00140   if (pAdminSID)
00141     FreeSid(pAdminSID);
00142   if (pACL)
00143         LocalFree(pACL);
00144   if (pSD)
00145     LocalFree(pSD);
00146
00147   return NULL;
00148
00149 }
00150 #endif
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagTrackObject Member List

This is the complete list of members for tagTrackObject, including all inherited members.
allowedModes | tagTrackObject
hdc | tagTrackObject
Mode | tagTrackObject
Next | tagTrackObject
rect | tagTrackObject
rectClip | tagTrackObject
xfmChange | tagTrackObject
xfmDown | tagTrackObject
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/log.h Source File

  • NetDS
  • RRas
  • ip

log.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\log.h
00008
00009 Abstract:
00010
00011     This file is processed by mapmsg to produce a .mc file,
00012     then the .mc file is compiled by the message compiler,
00013     and the resulting binary is included in IPSAMPLE's resource file.
00014
00015     Don't change the comments following the manifest constants
00016     without understanding how mapmsg works.
00017
00018 --*/
00019
00020 #define IPSAMPLELOG_BASE                        43000
00021
00022 #define IPSAMPLELOG_INIT_CRITSEC_FAILED         (IPSAMPLELOG_BASE + 1)
00023 /*
00024  * SAMPLE was unable to initialize a critical section.
00025  * The data is the exception code.
00026  */
00027
00028 #define IPSAMPLELOG_CREATE_SEMAPHORE_FAILED     (IPSAMPLELOG_BASE + 2)
00029 /*
00030  * SAMPLE was unable to create a semaphore.
00031  * The data is the error code.
00032  */
00033
00034 #define IPSAMPLELOG_CREATE_EVENT_FAILED         (IPSAMPLELOG_BASE + 3)
00035 /*
00036  * SAMPLE was unable to create an event.
00037  * The data is the error code.
00038  */
00039
00040 #define IPSAMPLELOG_CREATE_RWL_FAILED           (IPSAMPLELOG_BASE + 4)
00041 /*
00042  * SAMPLE was unable to create a synchronization object.
00043  * The data is the error code.
00044  */
00045
00046 #define IPSAMPLELOG_REGISTER_WAIT_FAILED        (IPSAMPLELOG_BASE + 5)
00047 /*
00048  * IPSAMPLE could not register an event wait.
00049  * The data is the error code.
00050  */
00051
00052 #define IPSAMPLELOG_HEAP_CREATE_FAILED          (IPSAMPLELOG_BASE + 6)
00053 /*
00054  * SAMPLE was unable to create a heap.
00055  * The data is the error code.
00056  */
00057
00058 #define IPSAMPLELOG_HEAP_ALLOC_FAILED           (IPSAMPLELOG_BASE + 7)
00059 /*
00060  * SAMPLE was unable to allocate memory from its heap.
00061  * The data is the error code.
00062  */
00063
00064 #define IPSAMPLELOG_CREATE_HASHTABLE_FAILED     (IPSAMPLELOG_BASE + 8)
00065 /*
00066  * SAMPLE was unable to create a hash table.
00067  * The data is the error code.
00068  */
00069
00070 #define IPSAMPLELOG_WSASTARTUP_FAILED           (IPSAMPLELOG_BASE + 9)
00071 /*
00072  * SAMPLE was unable to start Windows Sockets.
00073  * The data is the error code.
00074  */
00075
00076 #define IPSAMPLELOG_CREATE_SOCKET_FAILED        (IPSAMPLELOG_BASE + 10)
00077 /*
00078  * SAMPLE was unable to create a socket for the IP address %1.
00079  * The data is the error code.
00080  */
00081
00082 #define IPSAMPLELOG_DESTROY_SOCKET_FAILED       (IPSAMPLELOG_BASE + 11)
00083 /*
00084  * SAMPLE was unable to close a socket.
00085  * The data is the error code.
00086  */
00087
00088 #define IPSAMPLELOG_EVENTSELECT_FAILED          (IPSAMPLELOG_BASE + 12)
00089 /*
00090  * SAMPLE was unable to request notification of events on a socket.
00091  * The data is the error code.
00092  */
00093
00094 #define IPSAMPLELOG_BIND_IF_FAILED              (IPSAMPLELOG_BASE + 13)
00095 /*
00096  * SAMPLE could not bind to the IP address %1.
00097  * Please make sure TCP/IP is installed and configured correctly.
00098  * The data is the error code.
00099  */
00100
00101 #define IPSAMPLELOG_RECVFROM_FAILED             (IPSAMPLELOG_BASE + 14)
00102 /*
00103  * SAMPLE was unable to receive an incoming message on an interface.
00104  * The data is the error code.
00105  */
00106
00107 #define IPSAMPLELOG_SENDTO_FAILED               (IPSAMPLELOG_BASE + 15)
00108 /*
00109  * SAMPLE was unable to send a packet on an interface.
00110  * The data is the error code.
00111  */
00112
00113 #define IPSAMPLELOG_SET_MCAST_IF_FAILED         (IPSAMPLELOG_BASE + 16)
00114 /*
00115  * SAMPLE could not request multicasting
00116  * for the local interface with IP address %1.
00117  * The data is the error code.
00118  */
00119
00120 #define IPSAMPLELOG_JOIN_GROUP_FAILED           (IPSAMPLELOG_BASE + 17)
00121 /*
00122  * SAMPLE could not join the multicast group 224.0.0.100
00123  * on the local interface with IP address %1.
00124  * The data is the error code.
00125  */
00126
00127 #define IPSAMPLELOG_ENUM_NETWORK_EVENTS_FAILED  (IPSAMPLELOG_BASE + 18)
00128 /*
00129  * IPSAMPLE was unable to enumerate network events on a local interface.
00130  * The data is the error code.
00131  */
00132
00133 #define IPSAMPLELOG_INPUT_RECORD_ERROR          (IPSAMPLELOG_BASE + 19)
00134 /*
00135  * IPSAMPLE detected an error on a local interface.
00136  * The error occurred while the interface was receiving packets.
00137  * The data is the error code.
00138  */
00139
00140 #define IPSAMPLELOG_SAMPLE_STARTED              (IPSAMPLELOG_BASE + 20)
00141 /*
00142  * SAMPLE has started successfully.
00143  */
00144
00145 #define IPSAMPLELOG_SAMPLE_ALREADY_STARTED      (IPSAMPLELOG_BASE + 21)
00146 /*
00147  * SAMPLE received a start request when it was already running.
00148  */
00149
00150 #define IPSAMPLELOG_SAMPLE_START_FAILED         (IPSAMPLELOG_BASE + 22)
00151 /*
00152  * SAMPLE failed to start
00153  */
00154
00155 #define IPSAMPLELOG_SAMPLE_STOPPED              (IPSAMPLELOG_BASE + 23)
00156 /*
00157  * SAMPLE has stopped.
00158  */
00159
00160 #define IPSAMPLELOG_SAMPLE_ALREADY_STOPPED      (IPSAMPLELOG_BASE + 24)
00161 /*
00162  * SAMPLE received a stop request when it was not running.
00163  */
00164
00165 #define IPSAMPLELOG_SAMPLE_STOP_FAILED          (IPSAMPLELOG_BASE + 25)
00166 /*
00167  * SAMPLE failed to stop
00168  */
00169
00170 #define IPSAMPLELOG_CORRUPT_GLOBAL_CONFIG       (IPSAMPLELOG_BASE + 26)
00171 /*
00172  * SAMPLE global configuration is corrupted.
00173  * The data is the error code.
00174  */
00175
00176 #define IPSAMPLELOG_RTM_REGISTER_FAILED         (IPSAMPLELOG_BASE + 27)
00177 /*
00178  * SAMPLE was unable to register with the Routing Table Manager.
00179  * The data is the error code.
00180  */
00181
00182 #define IPSAMPLELOG_EVENT_QUEUE_EMPTY           (IPSAMPLELOG_BASE + 28)
00183 /*
00184  * SAMPLE event queue is empty.
00185  * The data is the error code.
00186  */
00187
00188 #define IPSAMPLELOG_CREATE_TIMER_QUEUE_FAILED   (IPSAMPLELOG_BASE + 29)
00189 /*
00190  * SAMPLE was unable to create the timer queue.
00191  * The data is the error code.
00192  */
00193
00194 #define IPSAMPLELOG_NETWORK_MODULE_ERROR        (IPSAMPLELOG_BASE + 30)
00195 /*
00196  * SAMPLE encountered a problem in the Network Module.
00197  * The data is the error code.
00198  */
00199
00200 #define IPSAMPLELOG_CORRUPT_INTERFACE_CONFIG    (IPSAMPLELOG_BASE + 31)
00201 /*
00202  * SAMPLE interface configuration is corrupted.
00203  */
00204
00205 #define IPSAMPLELOG_INTERFACE_PRESENT           (IPSAMPLELOG_BASE + 32)
00206 /*
00207  * SAMPLE interface already exists.
00208  */
00209
00210 #define IPSAMPLELOG_INTERFACE_ABSENT            (IPSAMPLELOG_BASE + 33)
00211 /*
00212  * SAMPLE interface does not exist.
00213  */
00214
00215 #define IPSAMPLELOG_PACKET_TOO_SMALL            (IPSAMPLELOG_BASE + 34)
00216 /* SAMPLE received a packet which was smaller than the minimum size allowed
00217  * for SAMPLE packets. The packet has been discarded.  It was received on
00218  * the local interface with IP address %1, and it came from the neighboring
00219  * router with IP address %2.
00220  */
00221
00222 #define IPSAMPLELOG_PACKET_HEADER_CORRUPT       (IPSAMPLELOG_BASE + 35)
00223 /*
00224  * SAMPLE received a packet with an invalid header. The packet has been
00225  * discarded. It was received on the local interface with IP address %1,
00226  * and it came from the neighboring router with IP address %2.
00227  */
00228
00229 #define IPSAMPLELOG_PACKET_VERSION_INVALID      (IPSAMPLELOG_BASE + 36)
00230 /*
00231  * SAMPLE received a packet with an invalid version in its header.
00232  * The packet has been discarded. It was received on the local interface
00233  * with IP address %1, and it came from the neighboring router
00234  * with IP address %2.
00235  */
00236
00237 #define IPSAMPLELOG_TIMER_MODULE_ERROR          (IPSAMPLELOG_BASE + 37)
00238 /*
00239  * SAMPLE encountered a problem in the Timer Module.
00240  * The data is the error code.
00241  */
00242
00243 #define IPSAMPLELOG_CREATE_TIMER_FAILED         (IPSAMPLELOG_BASE + 38)
00244 /*
00245  * IPSAMPLE could not create a timer.
00246  * The data is the error code.
00247  */
00248
00249 #define IPSAMPLELOG_PROTOCOL_MODULE_ERROR       (IPSAMPLELOG_BASE + 39)
00250 /*
00251  * SAMPLE encountered a problem in the Protocol Module.
00252  * The data is the error code.
00253  */
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/people.h Source File

  • SysMgmt
  • MMC
  • Menubtn

people.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _PEOPLE_H
00021 #define _PEOPLE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CBicycle : public CDelegationBase {
00026 public:
00027     CBicycle(int i) : id(i) { }
00028     virtual ~CBicycle() {}
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00033
00034 private:
00035     // {2974380D-4C4B-11d2-89D8-000021473128}
00036     static const GUID thisGuid;
00037
00038     int id;
00039 };
00040
00041 class CBicycleFolder : public CDelegationBase {
00042 public:
00043     CBicycleFolder();
00044     virtual ~CBicycleFolder();
00045
00046     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Bicycles"); }
00047     virtual const GUID & getNodeType() { return thisGuid; }
00048     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00049
00050 public:
00051     // virtual functions go here (for MMCN_*)
00052     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00053
00054 private:
00055     // {2974380D-4C4B-11d2-89D8-000021473128}
00056     static const GUID thisGuid;
00057
00058     enum { NUMBER_OF_CHILDREN = 20 };
00059     CDelegationBase *children[NUMBER_OF_CHILDREN];
00060 };
00061
00062 class CSkateboard : public CDelegationBase {
00063 public:
00064     CSkateboard(int i) : id(i) { }
00065     virtual ~CSkateboard() {}
00066
00067     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00068     virtual const GUID & getNodeType() { return thisGuid; }
00069     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00070
00071 private:
00072     // {2974380D-4C4B-11d2-89D8-000021473128}
00073     static const GUID thisGuid;
00074
00075     int id;
00076 };
00077
00078 class CSkateboardFolder : public CDelegationBase {
00079 public:
00080     CSkateboardFolder();
00081     virtual ~CSkateboardFolder();
00082
00083     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Skateboards"); }
00084     virtual const GUID & getNodeType() { return thisGuid; }
00085     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00086
00087 public:
00088     // virtual functions go here (for MMCN_*)
00089     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00090
00091 private:
00092     // {2974380D-4C4B-11d2-89D8-000021473128}
00093     static const GUID thisGuid;
00094
00095     enum { NUMBER_OF_CHILDREN = 20 };
00096     CDelegationBase *children[NUMBER_OF_CHILDREN];
00097 };
00098
00099 class CIceSkate : public CDelegationBase {
00100 public:
00101     CIceSkate(int i) : id(i) { }
00102     virtual ~CIceSkate() {}
00103
00104     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00105     virtual const GUID & getNodeType() { return thisGuid; }
00106     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00107
00108 private:
00109     // {2974380D-4C4B-11d2-89D8-000021473128}
00110     static const GUID thisGuid;
00111
00112     int id;
00113 };
00114
00115 class CIceSkateFolder : public CDelegationBase {
00116 public:
00117     CIceSkateFolder();
00118     virtual ~CIceSkateFolder();
00119
00120     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Ice Skates"); }
00121     virtual const GUID & getNodeType() { return thisGuid; }
00122     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00123
00124 public:
00125     // virtual functions go here (for MMCN_*)
00126     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00127
00128 private:
00129     // {2974380D-4C4B-11d2-89D8-000021473128}
00130     static const GUID thisGuid;
00131
00132     enum { NUMBER_OF_CHILDREN = 20 };
00133     CDelegationBase *children[NUMBER_OF_CHILDREN];
00134 };
00135
00136 class CPeoplePoweredVehicle : public CDelegationBase {
00137 public:
00138     CPeoplePoweredVehicle();
00139     virtual ~CPeoplePoweredVehicle();
00140
00141     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("People-powered Vehicles"); }
00142     virtual const GUID & getNodeType() { return thisGuid; }
00143     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00144
00145     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00146
00147 private:
00148     enum { IDM_NEW_PEOPLE = 1 };
00149
00150     // {2974380D-4C4B-11d2-89D8-000021473128}
00151     static const GUID thisGuid;
00152
00153     enum { NUMBER_OF_CHILDREN = 3 };
00154     CDelegationBase *children[3];
00155 };
00156
00157 #endif // _PEOPLE_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDataXferObj Member List

This is the complete list of members for CDataXferObj, including all inherited members.
CDataXferObj() | CDataXferObj | [private]
Create(CSimpleSite FAR *lpSite, POINTL FAR *pPointl) | CDataXferObj | [static]
DAdvise(FORMATETC FAR *pFormatetc, DWORD advf, LPADVISESINK pAdvSink, DWORD FAR *pdwConnection) | CDataXferObj | [inline]
DUnadvise(DWORD dwConnection) | CDataXferObj | [inline]
EnumDAdvise(LPENUMSTATDATA FAR *ppenumAdvise) | CDataXferObj | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC FAR *ppenumFormatEtc) | CDataXferObj |
GetCanonicalFormatEtc(LPFORMATETC pformatetc, LPFORMATETC pformatetcOut) | CDataXferObj | [inline]
GetData(LPFORMATETC pformatetcIn, LPSTGMEDIUM pmedium) | CDataXferObj |
GetDataHere(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium) | CDataXferObj |
m_lpObjStorage | CDataXferObj | [private]
m_lpOleObject | CDataXferObj | [private]
m_nCount | CDataXferObj | [private]
m_pointl | CDataXferObj | [private]
m_sizel | CDataXferObj | [private]
QueryGetData(LPFORMATETC pformatetc) | CDataXferObj |
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CDataXferObj |
SetData(LPFORMATETC pformatetc, STGMEDIUM FAR *pmedium, BOOL fRelease) | CDataXferObj | [inline]
STDMETHODIMP_(ULONG) AddRef() | CDataXferObj |
STDMETHODIMP_(ULONG) Release() | CDataXferObj |
~CDataXferObj() | CDataXferObj | [private]
Generated on Wed Nov 13 2024 16:56:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/Atsp32/Atsp.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • Atsp32

Atsp.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright 1995 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     atsp.h
00008
00009 Notes:
00010
00011 --*/
00012
00013 #include <windows.h>
00014 #include "tapi.h"
00015 #include "tspi.h"
00016 #include <stdarg.h>
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <malloc.h>
00020 #include <string.h>
00021 #include "resource.h"
00022 #include <initguid.h>
00023
00024
00025 //
00026 // Line device GUID of MSP
00027 //
00028 // CLSID = s '// 23F7C678- 24E1 -48db- AE AC- 54 A6 F2 A0 10 A0
00029
00030
00031 DEFINE_GUID(CLSID_SAMPMSP,
00032 0x23F7C678, 0x24E1, 0x48db, 0xAE, 0xAC, 0x54, 0xA6, 0xF2, 0xA0, 0x10, 0xA0);
00033
00034
00035
00036 #define  MAX_DEV_NAME_LENGTH    63
00037 #define  ATSP_TIMEOUT           60000   // milliseconds
00038
00039
00040 typedef struct _DRVLINE
00041 {
00042     HTAPILINE               htLine;
00043
00044     LINEEVENT               pfnEventProc;
00045
00046   //
00047   // MSP Variables
00048
00049   DWORD           dwMSPHandle;
00050
00051     HTAPIMSPLINE      htMSPLineHandle;
00052
00053   //
00054
00055     DWORD                   dwDeviceID;
00056
00057     char                    szComm[8];
00058
00059     HTAPICALL               htCall;
00060
00061     DWORD                   dwCallState;
00062
00063     DWORD                   dwCallStateMode;
00064
00065     DWORD                   dwMediaMode;
00066
00067     HANDLE                  hComm;
00068
00069     BOOL                    bDropInProgress;
00070
00071     OVERLAPPED              Overlapped;
00072
00073 } DRVLINE, FAR *PDRVLINE;
00074
00075
00076 typedef struct _DRVLINECONFIG
00077 {
00078     char                    szPort[8];
00079
00080     char                    szCommands[64];
00081
00082 } DRVLINECONFIG, FAR *PDRVLINECONFIG;
00083
00084
00085 typedef struct _ASYNC_REQUEST
00086 {
00087     DWORD                   dwRequestID;
00088
00089     DWORD                   dwCommand;
00090
00091     char                    szCommand[32];
00092
00093     struct _ASYNC_REQUEST  *pNext;
00094
00095 } ASYNC_REQUEST, *PASYNC_REQUEST;
00096
00097
00098 #if DBG
00099
00100 typedef struct _FUNC_PARAM
00101 {
00102     char        *lpszVal;
00103
00104     DWORD       dwVal;
00105
00106 } FUNC_PARAM, *PFUNC_PARAM;
00107
00108 #endif
00109
00110 typedef struct _FUNC_INFO
00111 {
00112
00113 #if DBG
00114
00115     char        *lpszFuncName;
00116
00117     DWORD       dwNumParams;
00118
00119     PFUNC_PARAM aParams;
00120
00121 #endif
00122
00123     LONG        lResult;
00124
00125 } FUNC_INFO, *PFUNC_INFO;
00126
00127
00128 DWORD               gdwLineDeviceIDBase;
00129 DWORD               gdwPermanentProviderID;
00130 HANDLE              ghInst;
00131 ASYNC_COMPLETION    gpfnCompletionProc;
00132
00133 char gszAtspKey[]      = "Software\\Microsoft\\ATSP";
00134 char gszNumLines[]     = "NumLines";
00135 char gszDefLineConfigParams[] = "my new line,COM1,L0";
00136
00137 #if DBG
00138
00139 char gszTab[]          = "    ";
00140 char gszhdLine[]       = "hdLine";
00141 char gszhdCall[]       = "hdCall";
00142 char gszdwSize[]       = "dwSize";
00143 char gszhwndOwner[]    = "hwndOwner";
00144 char gszdwDeviceID[]   = "dwDeviceID";
00145 char gszdwRequestID[]  = "dwRequestID";
00146 char gszlpCallParams[] = "lpCallParams";
00147 char gszdwPermanentProviderID[] = "dwPermanentProviderID";
00148
00149 DWORD   gdwDebugLevel = 0;
00150
00151 void
00152 CDECL
00153 DebugOutput(
00154     DWORD   dwLevel,
00155     LPCSTR  lpszFormat,
00156     ...
00157     );
00158
00159 #define DBGOUT(arg) DebugOutput arg
00160
00161 LONG
00162 PASCAL
00163 Epilog(
00164     PFUNC_INFO  pInfo,
00165     LONG        lResult
00166     );
00167
00168 void
00169 PASCAL
00170 Prolog(
00171     PFUNC_INFO  pInfo
00172     );
00173
00174 #else
00175
00176 #define DBGOUT(arg)
00177
00178 #define Epilog(pAsyncRequestInfo, lResult) (lResult)
00179
00180 #define Prolog(pAsyncRequestInfo)
00181
00182 #endif
00183
00184
00185 LPWSTR
00186 PASCAL
00187 My_lstrcpyW(
00188     WCHAR   *pString1,
00189     WCHAR   *pString2
00190     );
00191
00192 LPVOID
00193 PASCAL
00194 DrvAlloc(
00195     DWORD dwSize
00196     );
00197
00198 VOID
00199 PASCAL
00200 DrvFree(
00201     LPVOID lp
00202     );
00203
00204 void
00205 PASCAL
00206 SetCallState(
00207     PDRVLINE    pLine,
00208     DWORD       dwCallState,
00209     DWORD       dwCallStateMode
00210     );
00211
00212 BOOL
00213 CALLBACK
00214 ConfigDlgProc(
00215     HWND    hwnd,
00216     UINT    msg,
00217     WPARAM  wParam,
00218     LPARAM  lParam
00219     );
00220
00221 LONG
00222 PASCAL
00223 ProviderInstall(
00224     char   *pszProviderName,
00225     BOOL    bNoMultipleInstance
00226     );
00227
00228 void
00229 PASCAL
00230 DropActiveCall(
00231     PDRVLINE    pLine
00232     );
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/about.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

about.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     This class implements ISnapinAbout
00014
00015
00016
00017 #ifndef _CLASS_CSNAPINABOUT_
00018 #define _CLASS_CSNAPINABOUT_
00019
00020 #include <mmc.h>
00021
00022
00023 //---------------------------------------------------------------------------
00024 class CSnapinAbout : public ISnapinAbout
00025 {
00026   private:
00027     ULONG       m_cRef;
00028     HBITMAP     m_hSmallImage;
00029     HBITMAP     m_hLargeImage;
00030     HBITMAP     m_hOpenImage;
00031     HICON       m_hAppIcon;
00032
00033   public:
00034     CSnapinAbout();
00035     ~CSnapinAbout();
00036
00037     /////////////////////////////////////////////////////////////////////////
00038     // Interface IUnknown
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     /////////////////////////////////////////////////////////////////////////
00044     // Interface ISnapinAbout
00045     STDMETHODIMP GetSnapinDescription(/*[out]*/ LPOLESTR* pszDescription );
00046
00047     STDMETHODIMP GetProvider(/*[out]*/ LPOLESTR* pszProvider );
00048
00049     STDMETHODIMP GetSnapinVersion(/*[out]*/ LPOLESTR* pszVersion);
00050
00051     STDMETHODIMP GetSnapinImage(/*[out]*/ HICON* hAppIcon );
00052
00053     STDMETHODIMP GetStaticFolderImage
00054                  (/*[out]*/ HBITMAP*  hSmallImage,
00055                   /*[out]*/ HBITMAP*  hOpenImage,
00056                   /*[out]*/ HBITMAP*  hLargeImage,
00057                   /*[out]*/ COLORREF* cMask
00058                  );
00059 };
00060
00061 #endif _CLASS_CSNAPINABOUT_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/theprovider.idl Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

theprovider.idl

Go to the documentation of this file.
00001 // TheProvider.idl : IDL source for TheProvider.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (TheProvider.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010 [
00011   uuid(B14C8EA5-3632-11D3-AC81-00C04F8DB3D5),
00012   version(1.0),
00013   helpstring("TheProvider 1.0 Type Library")
00014 ]
00015 library THEPROVIDERLib
00016 {
00017   importlib("stdole32.tlb");
00018   importlib("stdole2.tlb");
00019
00020   [
00021     uuid(B14C8EB2-3632-11D3-AC81-00C04F8DB3D5),
00022     helpstring("MSOmniProv OLE DB Provider")
00023   ]
00024   coclass MSOmniProv
00025   {
00026     interface IUnknown;
00027   };
00028 };
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/BrochureMachine/dlldata.c Source File

  • Web
  • Browser
  • BrochureMachine

dlldata.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /*********************************************************
00006    DllData file -- generated by MIDL compiler
00007
00008         DO NOT ALTER THIS FILE
00009
00010    This file is regenerated by MIDL on every IDL file compile.
00011
00012    To completely reconstruct this file, delete it and rerun MIDL
00013    on all the IDL files in this DLL, specifying this file for the
00014    /dlldata command line option
00015
00016 *********************************************************/
00017
00018 #define PROXY_DELEGATION
00019
00020 #include <rpcproxy.h>
00021
00022 #ifdef __cplusplus
00023 extern "C"   {
00024 #endif
00025
00026 EXTERN_PROXY_FILE( BrochureMachine )
00027
00028
00029 PROXYFILE_LIST_START
00030 /* Start of list */
00031   REFERENCE_PROXY_FILE( BrochureMachine ),
00032 /* End of list */
00033 PROXYFILE_LIST_END
00034
00035
00036 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00037
00038 #ifdef __cplusplus
00039 }  /*extern "C" */
00040 #endif
00041
00042 /* end of generated dlldata file */
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CVCExploreDlg Member List

This is the complete list of members for CVCExploreDlg, including all inherited members.
AddParent(ICatalogCollection *pCatalogCollection) | CVCExploreDlg | [private]
CreateCatalog() | CVCExploreDlg | [private]
CVCExploreDlg(CWnd *pParent=NULL) | CVCExploreDlg |
DestroyCatalog() | CVCExploreDlg | [private]
DisplayPropertyValue() | CVCExploreDlg | [private]
DoDataExchange(CDataExchange *pDX) | CVCExploreDlg | [protected, virtual]
GetCatalog() | CVCExploreDlg | [private]
IDD enum value | CVCExploreDlg |
m_bChangesArePending | CVCExploreDlg | [private]
m_btnSetProperty | CVCExploreDlg |
m_edtPropertyValue | CVCExploreDlg |
m_hIcon | CVCExploreDlg | [protected]
m_hwndToolBar | CVCExploreDlg | [private]
m_lblCollectionName | CVCExploreDlg |
m_lblComputerName | CVCExploreDlg |
m_lstObjects | CVCExploreDlg |
m_lstParentCollections | CVCExploreDlg |
m_lstProperties | CVCExploreDlg |
m_lstRelatedCollections | CVCExploreDlg |
m_pCatalog | CVCExploreDlg | [private]
m_pCurrCollection | CVCExploreDlg | [private]
NavigateTo(ICatalogCollection *pCatalogCollection, BOOL bPopulate=TRUE) | CVCExploreDlg | [private]
OnClose() | CVCExploreDlg | [protected]
OnInitDialog() | CVCExploreDlg | [protected, virtual]
OnPaint() | CVCExploreDlg | [protected]
OnQueryDragIcon() | CVCExploreDlg | [protected]
OnSelChangeObjects() | CVCExploreDlg | [protected]
OnSelChangeParentCollections() | CVCExploreDlg | [protected]
OnSelChangeProperties() | CVCExploreDlg | [protected]
OnSelChangeRelatedCollections() | CVCExploreDlg | [protected]
OnSetProperty() | CVCExploreDlg | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CVCExploreDlg | [protected]
OnTBtnAbout() | CVCExploreDlg | [protected]
OnTBtnConnect() | CVCExploreDlg | [protected]
OnTBtnDelete() | CVCExploreDlg | [protected]
OnTBtnExportApp() | CVCExploreDlg | [protected]
OnTBtnImportComponent() | CVCExploreDlg | [protected]
OnTBtnInstallApp() | CVCExploreDlg | [protected]
OnTBtnInstallComponent() | CVCExploreDlg | [protected]
OnTBtnNew() | CVCExploreDlg | [protected]
OnTBtnRefresh() | CVCExploreDlg | [protected]
OnTBtnSave() | CVCExploreDlg | [protected]
OnTBtnStartApp() | CVCExploreDlg | [protected]
OnTBtnStopApp() | CVCExploreDlg | [protected]
OnTBtnUtility() | CVCExploreDlg | [protected]
RemoveParent(int nNewCurrIndex) | CVCExploreDlg | [private]
set_ComputerName(_bstr_t bstrComputerName) | CVCExploreDlg |
set_CurrentCollection(ICatalogCollection *pCollection) | CVCExploreDlg |
TryToSaveChanges() | CVCExploreDlg | [private]
Generated on Wed Nov 13 2024 16:57:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/LSP/provider.h Source File

  • NetDS
  • WinSock
  • LSP

provider.h

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: provider.h
00009 //
00010 // Description:
00011 //
00012 //    This sample illustrates how to develop a layered service provider that is
00013 //    capable of counting all bytes transmitted through a TCP/IP socket.
00014 //
00015 //    This file contains all datatypes and function prototypes used
00016 //    throughout this project.
00017 //
00018 #ifndef _PROVIDER_H_
00019 #define _PROVIDER_H_
00020
00021 #include <ws2spi.h>
00022 #include <mswsock.h>
00023
00024 extern WSPUPCALLTABLE MainUpCallTable;
00025
00026 #define WM_SOCKET (WM_USER + 1)
00027
00028 //
00029 // This is the socket context data that we associate with each socket
00030 //  that is passed back to the user app. That way when another API
00031 //  is called we can query for this context information and find out
00032 //  the socket handle to the lower provider.
00033 //
00034 struct _PROVIDER;
00035
00036 typedef struct _SOCK_INFO
00037 {
00038     SOCKET ProviderSocket;      // lower provider socket handle
00039     SOCKET LayeredSocket;       // app's socket handle
00040     DWORD  dwOutstandingAsync;  // count of outstanding async operations
00041     BOOL   bClosing;            // has the app closed the socket?
00042
00043     volatile LONG  RefCount;
00044
00045     DWORD  BytesSent;           // Byte counts
00046     DWORD  BytesRecv;
00047     HANDLE hIocp;               // associated with an IOCP?
00048
00049     HWND   hWnd;                // Window (if any) associated with socket
00050     UINT   uMsg;                // Message for socket events
00051
00052     CRITICAL_SECTION   SockCritSec;
00053
00054     struct _PROVIDER  *Provider;
00055     struct _SOCK_INFO *prev,
00056                       *next;
00057 } SOCK_INFO;
00058
00059 typedef struct _EXT_WSPPROC_TABLE
00060 {
00061     LPFN_ACCEPTEX             lpfnAcceptEx;
00062     LPFN_TRANSMITFILE         lpfnTransmitFile;
00063     LPFN_GETACCEPTEXSOCKADDRS lpfnGetAcceptExSockaddrs;
00064     LPFN_TRANSMITPACKETS      lpfnTransmitPackets;
00065     LPFN_CONNECTEX            lpfnConnectEx;
00066     LPFN_DISCONNECTEX         lpfnDisconnectEx;
00067     LPFN_WSARECVMSG           lpfnWSARecvMsg;
00068 } EXT_WSPPROC_TABLE;
00069
00070 typedef struct _PROVIDER
00071 {
00072     WSAPROTOCOL_INFOW   NextProvider,           // Next provider in chain
00073                         LayeredProvider;        // This layered provider
00074     WSPPROC_TABLE       NextProcTable;          // Proc table of next provider
00075     EXT_WSPPROC_TABLE   NextProcTableExt;       // Proc table of next provider's extension functions
00076
00077     WCHAR               ProviderPathW[MAX_PATH],
00078                         LibraryPathW[MAX_PATH];
00079     CHAR                ProviderPathA[MAX_PATH],
00080                         LibraryPathA[MAX_PATH];
00081     INT                 ProviderPathLen;
00082     HINSTANCE           hProvider;
00083
00084     LPWSPSTARTUP        lpWSPStartup;
00085
00086     SOCK_INFO          *SocketList;
00087
00088     CRITICAL_SECTION    ProviderCritSec;
00089 } PROVIDER, * LPPROVIDER;
00090
00091 //
00092 // Argument list for the AcceptEx API
00093 //
00094 typedef struct _ACCEPTEXARGS
00095 {
00096     SOCKET       sAcceptSocket,
00097                  sProviderAcceptSocket;
00098     PVOID        lpOutputBuffer;
00099     DWORD        dwReceiveDataLength,
00100                  dwLocalAddressLength,
00101                  dwRemoteAddressLength;
00102     DWORD        dwBytesReceived;
00103 } ACCEPTEXARGS;
00104
00105 //
00106 // Argument list for the TransmitFile API
00107 //
00108 typedef struct _TRANSMITFILEARGS
00109 {
00110     HANDLE        hFile;
00111     DWORD         nNumberOfBytesToWrite,
00112                   nNumberOfBytesPerSend;
00113     LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers;
00114     DWORD         dwFlags;
00115 } TRANSMITFILEARGS;
00116
00117 //
00118 // Argument list for the ConnectEx API
00119 //
00120 typedef struct _CONNECTEXARGS
00121 {
00122     SOCKET           s;
00123     SOCKADDR_STORAGE name;
00124     int              namelen;
00125     PVOID            lpSendBuffer;
00126     DWORD            dwSendDataLength;
00127     DWORD            dwBytesSent;
00128 } CONNECTEXARGS;
00129
00130 //
00131 // Argument list for TransmitPackets API
00132 //
00133 typedef struct _TRANSMITPACKETSARGS
00134 {
00135     SOCKET          s;
00136     LPTRANSMIT_PACKETS_ELEMENT lpPacketArray;
00137     DWORD           nElementCount;
00138     DWORD           nSendSize;
00139     DWORD           dwFlags;
00140 } TRANSMITPACKETSARGS;
00141
00142 //
00143 // Argument list for DisconnectEx API
00144 //
00145 typedef struct _DISCONNECTEXARGS
00146 {
00147     SOCKET          s;
00148     DWORD           dwFlags;
00149     DWORD           dwReserved;
00150 } DISCONNECTEXARGS;
00151
00152 //
00153 // Argument list for WSARecvMsg API
00154 //
00155 typedef struct _WSARECVMSGARGS
00156 {
00157     SOCKET          s;
00158     LPWSAMSG        lpMsg;
00159     DWORD           dwNumberOfBytesRecvd;
00160 } WSARECVMSGARGS;
00161
00162 //
00163 // Argument list for the WSARecv API
00164 //
00165 typedef struct _RECVARGS
00166 {
00167     LPWSABUF       lpBuffers;
00168     DWORD          dwBufferCount;
00169     DWORD          dwNumberOfBytesRecvd,
00170                    dwFlags;
00171 } RECVARGS;
00172
00173 //
00174 // Argument list for the WSARecvFrom API
00175 //
00176 typedef struct _RECVFROMARGS
00177 {
00178     LPWSABUF       lpBuffers;
00179     DWORD          dwBufferCount;
00180     DWORD          dwNumberOfBytesRecvd,
00181                    dwFlags;
00182     LPSOCKADDR     lpFrom;
00183     LPINT          lpFromLen;
00184 } RECVFROMARGS;
00185
00186 //
00187 // Argument list for the WSASend API
00188 //
00189 typedef struct _SENDARGS
00190 {
00191     LPWSABUF       lpBuffers;
00192     DWORD          dwBufferCount;
00193     DWORD          dwNumberOfBytesSent;
00194     DWORD          dwFlags;
00195 } SENDARGS;
00196
00197 //
00198 // Argument list for the WSASendTo API
00199 //
00200 typedef struct _SENDTOARGS
00201 {
00202     LPWSABUF         lpBuffers;
00203     DWORD            dwBufferCount;
00204     DWORD            dwNumberOfBytesSent;
00205     DWORD            dwFlags;
00206     SOCKADDR_STORAGE To;
00207     int              iToLen;
00208 } SENDTOARGS;
00209
00210 //
00211 // Argument list for the WSAIoctl API
00212 //
00213 typedef struct _IOCTLARGS
00214 {
00215     DWORD          dwIoControlCode;
00216     LPVOID         lpvInBuffer;
00217     DWORD          cbInBuffer;
00218     LPVOID         lpvOutBuffer;
00219     DWORD          cbOutBuffer;
00220     DWORD          cbBytesReturned;
00221 } IOCTLARGS;
00222
00223 //
00224 // Our OVERLAPPED structure that includes state and argument
00225 //  information. This structure is used for all overlapped IO
00226 //  operations. Whenever the user app requests overlapped IO
00227 //  we intercept this and make our own call with our own
00228 //  structure. This way we will receive notification first
00229 //  at which time we can perform post processesing. When we
00230 //  are done we can then post the completion to the user app.
00231 //
00232 typedef struct _WSAOVERLAPPEDPLUS
00233 {
00234     WSAOVERLAPPED   ProviderOverlapped;
00235     PROVIDER       *Provider;
00236     SOCK_INFO      *SockInfo;
00237     SOCKET          CallerSocket;
00238     SOCKET          ProviderSocket;
00239     HANDLE          Iocp;
00240     int             Error;
00241
00242     union
00243     {
00244         ACCEPTEXARGS        AcceptExArgs;
00245         TRANSMITFILEARGS    TransmitFileArgs;
00246         CONNECTEXARGS       ConnectExArgs;
00247         TRANSMITPACKETSARGS TransmitPacketsArgs;
00248         DISCONNECTEXARGS    DisconnectExArgs;
00249         WSARECVMSGARGS      WSARecvMsgArgs;
00250         RECVARGS            RecvArgs;
00251         RECVFROMARGS        RecvFromArgs;
00252         SENDARGS            SendArgs;
00253         SENDTOARGS          SendToArgs;
00254         IOCTLARGS           IoctlArgs;
00255     };
00256
00257 #define LSP_OP_IOCTL           1
00258 #define LSP_OP_RECV            2
00259 #define LSP_OP_RECVFROM        3
00260 #define LSP_OP_SEND            4
00261 #define LSP_OP_SENDTO          5
00262 #define LSP_OP_TRANSMITFILE    6
00263 #define LSP_OP_ACCEPTEX        7
00264 #define LSP_OP_CONNECTEX       8
00265 #define LSP_OP_DISCONNECTEX    9
00266 #define LSP_OP_TRANSMITPACKETS 10
00267 #define LSP_OP_WSARECVMSG      11
00268     int             Operation;
00269     WSATHREADID     CallerThreadId;
00270     LPWSAOVERLAPPED lpCallerOverlapped;
00271     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCallerCompletionRoutine;
00272     _WSAOVERLAPPEDPLUS                *next;
00273 } WSAOVERLAPPEDPLUS, * LPWSAOVERLAPPEDPLUS;
00274
00275 //
00276 // AsyncSelect.cpp prototypes
00277 //
00278 HWND GetWorkerWindow();
00279
00280 //
00281 // Spi.cpp prototypes
00282 //
00283 void CopyOffset(WSAOVERLAPPED *ProviderOverlapped, WSAOVERLAPPED *UserOverlapped);
00284 WSABUF *CopyBuffer(WSABUF *BufferArray, DWORD BufferCount);
00285 void FreeBuffer(WSABUF *BufferArray);
00286 void dbgprint(char *format,...);
00287
00288 //
00289 // Overlap.cpp prototypes
00290 //
00291 void InitOverlappedCS(void);
00292 int  InitOverlappedManager();
00293 int  StopOverlappedManager();
00294 int  StopAsyncWindowManager();
00295 int  QueueOverlappedOperation(WSAOVERLAPPEDPLUS *lpOverlapped, SOCK_INFO *Context);
00296
00297 //
00298 // Provider.cpp prototypes
00299 //
00300 LPWSAOVERLAPPEDPLUS GetOverlappedStructure(SOCK_INFO *SocketContext);
00301 void PutbackOverlappedStructure(WSAOVERLAPPEDPLUS *olp);
00302
00303 SOCK_INFO *GetCallerSocket(PROVIDER *provider, SOCKET ProviderSocket);
00304 void       InsertSocketInfo(PROVIDER *provider, SOCK_INFO *sock);
00305 void       RemoveSocketInfo(PROVIDER *provider, SOCK_INFO *sock);
00306
00307 void  CALLBACK IntermediateCompletionRoutine(DWORD dwError, DWORD cbTransferred,
00308                    LPWSAOVERLAPPED lpOverlapped, DWORD dwFlags);
00309
00310 //
00311 // Sockinfo.cpp prototypes
00312 //
00313 SOCK_INFO *CreateSockInfo(PROVIDER *Provider, SOCKET ProviderSocket, SOCK_INFO *Inherit, BOOL Insert=TRUE);
00314 SOCK_INFO *FindAndLockSocketContext(SOCKET s, int *err);
00315 void FreeSockInfo(SOCK_INFO *info);
00316 void InsertSocketInfo(PROVIDER *provider, SOCK_INFO *sock);
00317 void UnlockSocketContext(SOCK_INFO *context, int *err);
00318 void AcquireSocketLock(SOCK_INFO *SockInfo);
00319 void ReleaseSocketLock(SOCK_INFO *SockInfo);
00320 void CloseAndFreeSocketInfo(PROVIDER *provider);
00321
00322 //
00323 // Extension.cpp prototypes
00324 //
00325 BOOL PASCAL FAR ExtTransmitFile (
00326     IN SOCKET hSocket,
00327     IN HANDLE hFile,
00328     IN DWORD nNumberOfBytesToWrite,
00329     IN DWORD nNumberOfBytesPerSend,
00330     IN LPOVERLAPPED lpOverlapped,
00331     IN LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
00332     IN DWORD dwReserved);
00333
00334 BOOL PASCAL FAR ExtAcceptEx(
00335     IN SOCKET sListenSocket,
00336     IN SOCKET sAcceptSocket,
00337     IN PVOID lpOutputBuffer,
00338     IN DWORD dwReceiveDataLength,
00339     IN DWORD dwLocalAddressLength,
00340     IN DWORD dwRemoteAddressLength,
00341     OUT LPDWORD lpdwBytesReceived,
00342     IN LPOVERLAPPED lpOverlapped);
00343
00344 BOOL PASCAL FAR ExtConnectEx(
00345     IN SOCKET s,
00346     IN const struct sockaddr FAR *name,
00347     IN int namelen,
00348     IN PVOID lpSendBuffer OPTIONAL,
00349     IN DWORD dwSendDataLength,
00350     OUT LPDWORD lpdwBytesSent,
00351     IN LPOVERLAPPED lpOverlapped);
00352
00353 BOOL PASCAL FAR ExtTransmitPackets(
00354     SOCKET hSocket,
00355     LPTRANSMIT_PACKETS_ELEMENT lpPacketArray,
00356     DWORD nElementCount,
00357     DWORD nSendSize,
00358     LPOVERLAPPED lpOverlapped,
00359     DWORD dwFlags);
00360
00361 BOOL PASCAL FAR ExtDisconnectEx(
00362     IN SOCKET s,
00363     IN LPOVERLAPPED lpOverlapped,
00364     IN DWORD  dwFlags,
00365     IN DWORD  dwReserved);
00366
00367 INT PASCAL FAR ExtWSARecvMsg(
00368     IN SOCKET s,
00369     IN OUT LPWSAMSG lpMsg,
00370     OUT LPDWORD lpdwNumberOfBytesRecvd,
00371     IN LPWSAOVERLAPPED lpOverlapped,
00372     IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
00373
00374 #endif
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

VERBMAPPING Member List

This is the complete list of members for VERBMAPPING, including all inherited members.
dwCommand | VERBMAPPING
szVerb | VERBMAPPING
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/rqsclient.cpp Source File

  • NetDS
  • RRas
  • rqs
  • server

rqsclient.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RqsClient.cpp
00004 //
00005 //      Synopsis:   Object representing a client to the Quarantine engine
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011 #include <rqs.h>
00012
00013 //+--------------------------------------------------------------------------
00014 //
00015 // Synopsis: Instantiate a client control block
00016 //
00017 //+--------------------------------------------------------------------------
00018 RqsClient::RqsClient() : m_pSocket(NULL), m_uiBytesRead(0), m_uiMessageSize(0),
00019                         m_pszString(NULL), m_pszUsername(NULL), m_State(Receiving),
00020                         m_pEngine(NULL), m_dwAddressH(0)
00021 {
00022     m_pszBuffer[0] = '\0';
00023     ZeroMemory(m_pszAddress, sizeof(m_pszAddress));
00024 }
00025
00026 //+--------------------------------------------------------------------------
00027 //
00028 // Synopsis: Destroy a client control block
00029 //
00030 //+--------------------------------------------------------------------------
00031 RqsClient::~RqsClient()
00032 {
00033     if (m_pSocket)
00034     {
00035         m_pSocket->Close();
00036         delete m_pSocket;
00037     }
00038 }
00039
00040 //+--------------------------------------------------------------------------
00041 //
00042 // Synopsis: Assign ownership of a socket to a client control block.
00043 //
00044 //+--------------------------------------------------------------------------
00045 VOID
00046 RqsClient::AssignSocket(
00047     IN RuSocket* pSocket)
00048 {
00049     HRESULT hr;
00050     DWORD dwAddress = 0;
00051
00052     m_pSocket = pSocket;
00053
00054     hr = pSocket->GetAddress(&dwAddress);
00055     if (S_OK != hr)
00056     {
00057         m_pEngine->Trace("Unable to obtain client address. 0x%x", hr);
00058         m_State = ClientError;
00059         dwAddress = 0;
00060     }
00061
00062     m_dwAddressH = ntohl(dwAddress);
00063
00064     _snprintf(
00065         m_pszAddress,
00066         sizeof(m_pszAddress) - 1,
00067         "%d.%d.%d.%d",
00068         IP1(m_dwAddressH),
00069         IP2(m_dwAddressH),
00070         IP3(m_dwAddressH),
00071         IP4(m_dwAddressH));
00072
00073 }
00074
00075 //+--------------------------------------------------------------------------
00076 //
00077 // Synopsis: Receieve data from a client
00078 //
00079 //+--------------------------------------------------------------------------
00080 HRESULT
00081 RqsClient::ReceiveMessage()
00082 {
00083     HRESULT hr;
00084     UINT uiSize;
00085     CHAR* pszCur;
00086     INT iSize;
00087
00088     // Sanity check that we haven't already read in too many bytes
00089     //
00090     if (m_uiBytesRead >= sizeof(m_pszBuffer))
00091     {
00092         m_pEngine->Trace(
00093             "Too many bytes read from client %s",
00094             GetAddressPsz());
00095         m_State = ClientError;
00096         return E_FAIL;
00097     }
00098
00099     // Read in whatever data is readily available
00100     //
00101     uiSize = sizeof(m_pszBuffer) - m_uiBytesRead;
00102     pszCur = &(m_pszBuffer[m_uiBytesRead]);
00103     hr = m_pSocket->Read((BYTE*)pszCur, &uiSize, FALSE);
00104     if (hr == HRESULT_FROM_WIN32(WSAEWOULDBLOCK))
00105     {
00106         return S_OK;
00107     }
00108     else if (S_OK != hr)
00109     {
00110         m_pEngine->Trace(
00111             "ClientError 0x%x while receiving message from %s",
00112             hr,
00113             GetAddressPsz());
00114             m_State = ClientError;
00115         return hr;
00116     }
00117     if (uiSize == 0)
00118     {
00119         // The client has disconnected this socket.  This should not happen
00120         //
00121         m_pEngine->Trace(
00122             "Dropping client because socket was closed remotely %s",
00123             GetAddressPsz());
00124         m_State = ClientError;
00125         return E_FAIL;
00126     }
00127
00128     // Update the total number of bytes read
00129     //
00130     m_uiBytesRead += uiSize;
00131
00132     // The message is in the form "Size:1:username:String".
00133     //
00134     // If we have Size, then remember it
00135     //
00136     if ((m_uiBytesRead >= RQS_MESSAGE_LENGH_SIZE) && (m_uiMessageSize == 0))
00137     {
00138         m_pszBuffer[RQS_MESSAGE_LENGH_SIZE] = '\0';
00139         iSize = atoi(m_pszBuffer);
00140
00141         // iSize is the size of the rest of the buffer. i.e. strlen(":1:username:String")
00142         // Make sure that there is at least 1 character in String and that String
00143         // is no longer than 1024 bytes.
00144         //
00145         // 4 = strlen(":1:S")
00146         // 1027 = strlen(":1:username:String") if username:String is 1024 characters long
00147         // Note that the username string is optional.
00148         //
00149         if ((iSize < 4) || (iSize > 1027))
00150         {
00151             m_pEngine->Trace(
00152                 "Client %s sent an out-of-range size",
00153                 GetAddressPsz());
00154             m_State = ClientError;
00155             return E_FAIL;
00156         }
00157         m_uiMessageSize = iSize;
00158     }
00159
00160     // See if we're done reading yet
00161     //
00162     if (m_uiBytesRead >= (m_uiMessageSize + RQS_MESSAGE_LENGH_SIZE))
00163     {
00164         // First, remove the prefix
00165         //
00166         m_pszBuffer[RQS_MESSAGE_PREFIX_SIZE + m_uiMessageSize] = '\0';
00167         m_pszUsername = &(m_pszBuffer[RQS_MESSAGE_PREFIX_SIZE]);
00168
00169         // Now check to see if there is a username
00170         //
00171         PCHAR pszColon = strchr(m_pszUsername, ':');
00172         if (pszColon)
00173         {
00174             m_pszString = pszColon + 1;
00175             *pszColon = '\0';
00176
00177             // Make sure the username isn't longer than the username + domain + separator
00178             //
00179             if ((pszColon - m_pszUsername) > (UNLEN + DNLEN + 1))
00180             {
00181                 m_pEngine->Trace(
00182                     "Client %s sent a larger than expected username",
00183                     GetAddressPsz());
00184                 m_State = ClientError;
00185                 return E_FAIL;
00186             }
00187         }
00188         else
00189         {
00190            m_pszString = m_pszUsername;
00191            m_pszUsername = NULL;
00192         }
00193
00194         // Finally save off the remaining as the string
00195         //
00196         m_State = ReceiveComplete;
00197     }
00198
00199     return S_OK;
00200 }
00201
00202 //+--------------------------------------------------------------------------
00203 //
00204 // Synopsis: Send a response to a client
00205 //
00206 //+--------------------------------------------------------------------------
00207 HRESULT
00208 RqsClient::SendResponse(
00209     IN BOOL fOk)
00210 {
00211     UINT uiTot, uiSize;
00212     HRESULT hr;
00213
00214     m_State = Responding;
00215
00216     uiTot = uiSize = 3;
00217     hr = m_pSocket->Write(
00218             (BYTE*) ((fOk) ? "Ok" : "No"),
00219             &uiSize);
00220     if ((S_OK != hr) || (uiTot != uiSize))
00221     {
00222         m_pEngine->Trace(
00223             "Unable to respond to %s %x %d %d",
00224             GetAddressPsz(),
00225             hr,
00226             uiTot,
00227             uiSize);
00228     }
00229
00230     m_State = RespondComplete;
00231
00232     return hr;
00233 }
00234
00235 //+--------------------------------------------------------------------------
00236 //
00237 // Synopsis: Retrieve the network-order address of the client
00238 //
00239 //+--------------------------------------------------------------------------
00240 DWORD
00241 RqsClient::GetAddressN()
00242 {
00243     return htonl(m_dwAddressH);
00244 }
00245
00246 //+--------------------------------------------------------------------------
00247 //
00248 // Synopsis: Retrieve the host-order address of the client
00249 //
00250 //+--------------------------------------------------------------------------
00251 DWORD
00252 RqsClient::GetAddressH()
00253 {
00254     return m_dwAddressH;
00255 }
00256
00257 //+--------------------------------------------------------------------------
00258 //
00259 // Synopsis: Retrieve the displayable string version of the client's address
00260 //
00261 //+--------------------------------------------------------------------------
00262 CONST CHAR*
00263 RqsClient::GetAddressPsz()
00264 {
00265     return m_pszAddress;
00266 }
00267
00268 CONST CHAR*
00269 RqsClient::GetUsername()
00270 {
00271     if (m_pszUsername)
00272     {
00273         return m_pszUsername;
00274     }
00275     else
00276     {
00277         return "Unknown";
00278     }
00279 }
00280
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/Comp.h Source File

  • SysMgmt
  • MMC
  • Help

Comp.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMP_H_
00020 #define _SAMPCOMP_H_
00021
00022 #include <mmc.h>
00023
00024 class CComponent : public IComponent
00025 {
00026 private:
00027     ULONG       m_cref;
00028
00029     IConsole*   m_ipConsole;
00030     IDisplayHelp* m_ipDisplayHelp;
00031
00032     class CComponentData *m_pComponentData;
00033
00034     public:
00035         CComponent(CComponentData *parent);
00036         ~CComponent();
00037
00038         ///////////////////////////////
00039         // Interface IUnknown
00040         ///////////////////////////////
00041         STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042         STDMETHODIMP_(ULONG) AddRef();
00043         STDMETHODIMP_(ULONG) Release();
00044
00045         ///////////////////////////////
00046         // Interface IComponent
00047         ///////////////////////////////
00048         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00049             /* [in] */ LPCONSOLE lpConsole);
00050
00051             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00052             /* [in] */ LPDATAOBJECT lpDataObject,
00053             /* [in] */ MMC_NOTIFY_TYPE event,
00054             /* [in] */ LPARAM arg,
00055             /* [in] */ LPARAM param);
00056
00057             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
00058             /* [in] */ MMC_COOKIE cookie);
00059
00060             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00061             /* [in] */ MMC_COOKIE cookie,
00062             /* [in] */ DATA_OBJECT_TYPES type,
00063             /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00064
00065             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
00066             /* [in] */ MMC_COOKIE cookie,
00067             /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00068             /* [out] */ long __RPC_FAR *pViewOptions);
00069
00070             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00071             /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
00072
00073             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00074             /* [in] */ LPDATAOBJECT lpDataObjectA,
00075             /* [in] */ LPDATAOBJECT lpDataObjectB);
00076 };
00077
00078 #endif _SAMPCOMP_H_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ADOConnectionConstruction15 Member List

This is the complete list of members for msado15::ADOConnectionConstruction15, including all inherited members.
getDSO() | msado15::ADOConnectionConstruction15 |
getSession() | msado15::ADOConnectionConstruction15 |
iid | msado15::ADOConnectionConstruction15 | [static]
WrapDSOandSession(IUnknown pDSO, IUnknown pSession) | msado15::ADOConnectionConstruction15 |
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/binder.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

binder.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module BINDER.CPP | CBinder object implementation and contained
00008 //  interfaces
00009 //
00010 //
00011
00012 // Includes ------------------------------------------------------------------
00013 #include "headers.h"
00014
00015 // Globals -------------------------------------------------------------------
00016 WCHAR g_wszDataSourceKeyword[]  = L"DataSource";
00017 WCHAR g_wszFileKeyword[]    = L"File";
00018 WCHAR g_wszRowKeyword[]     = L"Row";
00019
00020
00021 // Code ----------------------------------------------------------------------
00022
00023 // CBinder::CBinder ----------------------------------------------------------
00024 //
00025 // @mfunc Constructor for this class
00026 //
00027 // @rdesc NONE
00028 //
00029 CBinder::CBinder
00030     (
00031   LPUNKNOWN pUnkOuter  //@parm IN | Outer Unkown Pointer
00032     ) // invoke ctor for base class
00033   : CBaseObj( BOT_BINDER )
00034 {
00035   m_cRef = 0;
00036   m_pUnkOuter = pUnkOuter ? pUnkOuter : this;
00037
00038   m_pUtilProp     = NULL;
00039
00040   // Contained interfaces
00041   m_pIBindResource    = NULL;
00042   m_pIDBBinderProperties  = NULL;
00043   m_pICreateRow     = NULL;
00044 }
00045
00046
00047 // CBinder::~CBinder ---------------------------------------------------------
00048 //
00049 // @mfunc Destructor for this class
00050 //
00051 // @rdesc NONE
00052 //
00053 CBinder::~CBinder()
00054 {
00055   SAFE_DELETE( m_pUtilProp );
00056   SAFE_DELETE( m_pIBindResource );
00057   SAFE_DELETE( m_pIDBBinderProperties );
00058   SAFE_DELETE( m_pICreateRow );
00059 }
00060
00061
00062 // CBinder::FInit ------------------------------------------------------------
00063 //
00064 // @mfunc Initialize the Binder Object
00065 //
00066 // @rdesc Did the Initialization Succeed
00067 //      @flag  TRUE | Initialization succeeded
00068 //      @flag  FALSE | Initialization failed
00069 //
00070 BOOL CBinder::FInit()
00071 {
00072   assert(m_pUnkOuter);
00073
00074   m_pUtilProp     = new CUtilProp();
00075
00076   // contained interfaces
00077   m_pIBindResource    = new CImpIBindResource( this, m_pUnkOuter );
00078   m_pIDBBinderProperties  = new CImpIDBBinderProperties( this, m_pUnkOuter );
00079   m_pICreateRow     = new CImpICreateRow( this, m_pUnkOuter );
00080
00081   return (m_pUtilProp && m_pIBindResource && m_pIDBBinderProperties &&
00082       m_pICreateRow);
00083 }
00084
00085
00086 // CBinder::QueryInterface ---------------------------------------------------
00087 //
00088 // @mfunc Returns a pointer to a specified interface. Callers use
00089 // QueryInterface to determine which interfaces the called object
00090 // supports.
00091 //
00092 // @rdesc HRESULT indicating the status of the method
00093 //      @flag S_OK | Interface is supported and ppvObject is set.
00094 //      @flag E_NOINTERFACE | Interface is not supported by the object
00095 //      @flag E_INVALIDARG | One or more arguments are invalid.
00096 //
00097 STDMETHODIMP CBinder::QueryInterface
00098     (
00099     REFIID riid,
00100     LPVOID * ppv
00101     )
00102 {
00103     if (NULL == ppv)
00104         return ResultFromScode( E_INVALIDARG );
00105
00106   //  Place NULL in *ppv in case of failure
00107     *ppv = NULL;
00108
00109   //IUNKNOWN
00110   if (riid == IID_IUnknown)
00111     *ppv = this;
00112   else if(riid == IID_IBindResource)
00113     *ppv = (LPVOID) m_pIBindResource;
00114   else if(riid == IID_IDBProperties)
00115     *ppv = (LPVOID) m_pIDBBinderProperties;
00116   else if(riid == IID_IDBBinderProperties)
00117     *ppv = (LPVOID) m_pIDBBinderProperties;
00118   else if(riid == IID_ICreateRow)
00119     *ppv = (LPVOID) m_pICreateRow;
00120
00121     //  If we're going to return an interface, AddRef it first
00122     if (*ppv)
00123         {
00124         ((LPUNKNOWN) *ppv)->AddRef();
00125         return ResultFromScode( S_OK );
00126         }
00127     else
00128         return ResultFromScode( E_NOINTERFACE );
00129 }
00130
00131
00132 // CBinder::AddRef -----------------------------------------------------------
00133 //
00134 // @mfunc Increments a persistence count for the object
00135 //
00136 // @rdesc Current reference count
00137 //
00138 STDMETHODIMP_( DBREFCOUNT ) CBinder::AddRef
00139      (
00140      void
00141      )
00142 {
00143     return ++m_cRef;
00144 }
00145
00146
00147 // CBinder::Release ----------------------------------------------------------
00148 //
00149 // @mfunc Decrements a persistence count for the object and if
00150 // persistence count is 0, the object destroys itself.
00151 //
00152 // @rdesc HRESULT indicating the status of the method
00153 //      @flag S_OK | Interface is supported and ppvObject is set.
00154 //      @flag E_NOINTERFACE | Interface is not supported by the object
00155 //      @flag E_INVALIDARG | One or more arguments are invalid.
00156 //
00157 STDMETHODIMP_( ULONG ) CBinder::Release
00158      (
00159      void
00160      )
00161 {
00162     if (!--m_cRef)
00163         {
00164         delete this;
00165         return 0;
00166         }
00167
00168     return m_cRef;
00169 }
00170
00171
00172 // CImpIBindResource::BindDSO ------------------------------------------------
00173 //
00174 // @mfunc Returns an initialized datasource object
00175 //
00176 // @rdesc
00177 //      @flag S_OK                   | Method succeeded
00178 //      @flag E_OUTOFMEMORY          | Out of memory
00179 //      @flag OTHER                  | Other HRESULTs returned by called functions
00180 //
00181 HRESULT CImpIBindResource::BindDSO
00182   (
00183   IUnknown *  pUnkOuter,    // [in] controllig IUnknown
00184   REFIID    riid,     // [in] interface to be requested
00185   BOOL    fWaitForInit,   // [in] flag indicating if DSO should be initialized
00186   WCHAR *   pwszDataSource, // [in] datasource path
00187   IUnknown ** ppUnk     // [out] interface retrieved on DSO
00188   )
00189 {
00190   HRESULT       hr        = E_FAIL;
00191   IGetDataSource *  pIGetDataSource = NULL;
00192   IDBProperties *   pIDBProperties  = NULL;
00193   IDBInitialize *   pIDBInitialize  = NULL;
00194   CDataSource *   pDataSource   = NULL;
00195   ULONG       cPropSets   = 0;
00196   DBPROPSET *     rgPropSets    = NULL;
00197
00198   if( BOT_SESSION == m_pObj->GetBaseObjectType() )
00199   {
00200     // In this case the datasource is alreay initialized
00201     if( fWaitForInit )
00202       return E_INVALIDARG;
00203
00204     // Obtain an instance of the current session Session::IBindResource
00205     // pUnkOuter is always ignored when the DSO already exists
00206     TESTC(hr = ((CDBSession*)m_pObj)->QueryInterface(IID_IGetDataSource, (void**)&pIGetDataSource));
00207     TESTC(hr = pIGetDataSource->GetDataSource(riid, ppUnk));
00208   }
00209   else
00210   {
00211     // create DSO (aggregating if necessary)
00212     pDataSource = new CDataSource(pUnkOuter);
00213     if( pDataSource == NULL || !pDataSource->FInit() )
00214     {
00215       hr = E_OUTOFMEMORY;
00216       SAFE_DELETE(pDataSource);
00217       goto CLEANUP;
00218     }
00219
00220     // initialize the DSO with the cached properties
00221     TESTC(hr = pDataSource->QueryInterface(IID_IDBProperties, (void**)&pIDBProperties));
00222     TESTC(hr = pDataSource->QueryInterface(IID_IDBInitialize, (void**)&pIDBInitialize));
00223
00224     // Get the cached initialization properties
00225     // and set them on the requested DataSource
00226     TESTC(hr = ((CBinder*)m_pObj)->m_pUtilProp->GetProperties(PROPSET_DSO, 0,
00227                         NULL, &cPropSets, &rgPropSets));
00228     TESTC(hr = pIDBProperties->SetProperties(cPropSets, rgPropSets));
00229
00230     // Set the DBPROP_INIT_DATASOURCE property if specified in the URL
00231     if( pwszDataSource )
00232     {
00233       DBPROPSET PropSet;
00234       DBPROP    PropDataSource;
00235
00236       PropSet.guidPropertySet = DBPROPSET_DBINIT;
00237       PropSet.rgProperties  = &PropDataSource;
00238       PropSet.cProperties   = 1;
00239
00240       PropDataSource.dwPropertyID   = DBPROP_INIT_DATASOURCE;
00241       PropDataSource.dwOptions    = DBPROPOPTIONS_REQUIRED;
00242       PropDataSource.dwStatus     = 0;
00243       V_VT(&PropDataSource.vValue)  = VT_BSTR;
00244       V_BSTR(&PropDataSource.vValue)  = SysAllocString(pwszDataSource);
00245
00246       if( FAILED(hr = pIDBProperties->SetProperties(1, &PropSet)) )
00247       {
00248         VariantClear(&PropDataSource.vValue);
00249         goto CLEANUP;
00250       }
00251       VariantClear(&PropDataSource.vValue);
00252     }
00253
00254     if( !fWaitForInit )
00255     {
00256       // Initialize
00257       TESTC(hr = pIDBInitialize->Initialize());
00258     }
00259
00260     // Return the requested interface
00261     TESTC(hr = pDataSource->QueryInterface(riid, (void**)ppUnk));
00262   }
00263
00264   hr = S_OK;
00265
00266 CLEANUP:
00267
00268   // release properties
00269   FreeProperties(&cPropSets, &rgPropSets);
00270
00271   SAFE_RELEASE(pIGetDataSource);
00272   SAFE_RELEASE(pIDBProperties);
00273   SAFE_RELEASE(pIDBInitialize);
00274
00275   return hr;
00276 }
00277
00278
00279 // CImpIBindResource::BindSession --------------------------------------------
00280 //
00281 // @mfunc Returns a session object
00282 //
00283 // @rdesc
00284 //      @flag S_OK                   | Method succeeded
00285 //      @flag OTHER                  | Other HRESULTs returned by called functions
00286 //
00287 HRESULT CImpIBindResource::BindSession
00288   (
00289   IUnknown *  pUnkOuter,    // [in] controllig IUnknown
00290   REFIID    riid,     // [in] interface to be requested
00291   WCHAR *   pwszDataSource, // [in] datasource path
00292   IUnknown ** ppUnk     // [out] session interface
00293   )
00294 {
00295   HRESULT       hr          = E_FAIL;
00296   IDBCreateSession *  pIDBCreateSession = NULL;
00297
00298   if( BOT_SESSION == m_pObj->GetBaseObjectType() )
00299   {
00300     // Obtain an instance of the current session Session::IBindResource
00301     // pUnkOuter is always ignored when the DSO already exists
00302     TESTC(hr = ((CDBSession*)m_pObj)->QueryInterface(riid, (void**)ppUnk));
00303   }
00304   else
00305   {
00306     // bind a DSO first
00307     TESTC(hr = BindDSO(NULL, IID_IDBCreateSession, FALSE, pwszDataSource,
00308               (IUnknown**)&pIDBCreateSession));
00309
00310     // Create Session.
00311     TESTC(hr = pIDBCreateSession->CreateSession(pUnkOuter, riid, (IUnknown**)ppUnk));
00312   }
00313
00314   hr = S_OK;
00315
00316 CLEANUP:
00317
00318   SAFE_RELEASE(pIDBCreateSession);
00319
00320   return hr;
00321 }
00322
00323
00324 // CImpIBindResource::BindSession --------------------------------------------
00325 //
00326 // @mfunc Returns an implicit session object
00327 //
00328 // @rdesc
00329 //      @flag S_OK                   | Method succeeded
00330 //      @flag OTHER                  | Other HRESULTs returned by called functions
00331 //
00332 HRESULT CImpIBindResource::BindSession
00333   (
00334   DBIMPLICITSESSION * pImplSession, // [in|out] implicit session pointer
00335   WCHAR *       pwszDataSource  // [in] DataSource path name
00336   )
00337 {
00338   HRESULT       hr          = E_FAIL;
00339   IDBCreateSession *  pIDBCreateSession = NULL;
00340
00341   // check arguments
00342   if( !pImplSession || !pImplSession->piid )
00343   {
00344     hr = E_INVALIDARG;
00345     goto CLEANUP;
00346   }
00347
00348   if( pImplSession->pUnkOuter && IID_IUnknown != *(pImplSession->piid) )
00349   {
00350     hr = DB_E_NOAGGREGATION;
00351     goto CLEANUP;
00352   }
00353
00354   // This method should not be called when on a session's
00355   // implementation of IBindResource.
00356   // pImplSession should just be ignored in this case
00357   if( BOT_SESSION == m_pObj->GetBaseObjectType() )
00358     return E_FAIL;
00359
00360   // bind a DSO first
00361   TESTC(hr = BindDSO(NULL, IID_IDBCreateSession, FALSE, pwszDataSource,
00362             (IUnknown**)&pIDBCreateSession));
00363
00364   //Create Session.
00365   pImplSession->pSession = NULL;
00366   TESTC(hr = pIDBCreateSession->CreateSession(pImplSession->pUnkOuter,
00367     *(pImplSession->piid), (IUnknown**)&pImplSession->pSession));
00368
00369   hr = S_OK;
00370
00371 CLEANUP:
00372
00373   if (FAILED(hr))
00374     pImplSession->pSession = NULL;
00375
00376   SAFE_RELEASE(pIDBCreateSession);
00377
00378   return hr;
00379 }
00380
00381
00382 // CImpIBindResource::BindRowset ---------------------------------------------
00383 //
00384 // @mfunc Retrieves a rowset object
00385 //
00386 // @rdesc Returns one of the following values:
00387 //      @flag S_OK                   | Method Succeeded
00388 //    @flag DB_E_NOTFOUND      | Object does not exist
00389 //      @flag OTHER                  | Other HRESULTs returned by called functions
00390 //
00391 HRESULT CImpIBindResource::BindRowset
00392   (
00393   IUnknown *      pUnkOuter,    // [in] controllig IUnknown
00394   REFIID        riid,     // [in] interface to be requested
00395   DBIMPLICITSESSION * pImplSession, // [in|out] implicit session pointer
00396   WCHAR *       pwszDataSource, // [in] DataSource path name
00397   WCHAR *       pwszFile,   // [in] URL name
00398   IUnknown **     ppUnk     // [out] session interface
00399   )
00400 {
00401   HRESULT     hr        = E_FAIL;
00402   IOpenRowset * pIOpenRowset  = NULL;
00403   DBID      TableID;
00404
00405   if( BOT_SESSION != m_pObj->GetBaseObjectType() && pImplSession )
00406   {
00407     TESTC(hr = BindSession(pImplSession, pwszDataSource));
00408     TESTC(hr = pImplSession->pSession->QueryInterface(IID_IOpenRowset, (void**)&pIOpenRowset));
00409   }
00410   else
00411     TESTC(hr = BindSession(NULL, IID_IOpenRowset, pwszDataSource, (IUnknown**)&pIOpenRowset));
00412
00413   TableID.eKind     = DBKIND_NAME;
00414   TableID.uName.pwszName  = pwszFile;
00415
00416   TESTC(hr = pIOpenRowset->OpenRowset(pUnkOuter, &TableID, NULL, riid,
00417     0, NULL, ppUnk));
00418
00419   hr = S_OK;
00420
00421 CLEANUP:
00422
00423   if( DB_E_NOTABLE == hr )
00424     hr = DB_E_NOTFOUND;
00425
00426   SAFE_RELEASE(pIOpenRowset);
00427
00428   return hr;
00429 }
00430
00431
00432 // CImpIBindResource::BindRow ------------------------------------------------
00433 //
00434 // @mfunc Retrieves a row object
00435 //
00436 // @rdesc Returns one of the following values:
00437 //      @flag S_OK                   | Method Succeeded
00438 //    @flag DB_E_NOTFOUND      | Object does not exist
00439 //      @flag OTHER                  | Other HRESULTs returned by called functions
00440 //
00441 HRESULT CImpIBindResource::BindRow
00442   (
00443   IUnknown *      pUnkOuter,    // [in] controllig IUnknown
00444   REFIID        riid,     // [in] interface to be requested
00445   DBIMPLICITSESSION * pImplSession, // [in|out] implicit session pointer
00446   WCHAR *       pwszDataSource, // [in] DataSource path name
00447   WCHAR *       pwszFile,   // [in] URL name
00448   ULONG       ulRowNum,   // [in] Row number to retrieve
00449   IUnknown **     ppUnk     // [out] session interface
00450   )
00451 {
00452   HRESULT     hr  = E_FAIL;
00453   CDBSession *  pCSession = NULL;
00454   CFileIO *   pFileio = NULL;
00455   CRow *      pCRow = NULL;
00456
00457   if( BOT_SESSION != m_pObj->GetBaseObjectType() && pImplSession )
00458   {
00459     TESTC(hr = BindSession(pImplSession, pwszDataSource));
00460     TESTC(hr = pImplSession->pSession->QueryInterface(IID_IUnknown, (void**)&pCSession));
00461   }
00462   else
00463     TESTC(hr = BindSession(NULL, IID_IUnknown, pwszDataSource, (IUnknown**)&pCSession));
00464
00465   //Try to open the file...
00466   TESTC(hr = pCSession->m_pCDataSource->OpenFile(pwszFile, &pFileio));
00467
00468   // If no row number specified, just fetch the first 1
00469   if( ulRowNum == 0 )
00470     ulRowNum = 1;
00471
00472   if( pFileio->GetRowCnt() < ulRowNum )
00473   {
00474     hr = DB_E_NOTFOUND;
00475     goto CLEANUP;
00476   }
00477
00478   pCRow = new CRow(pUnkOuter);
00479   if( !pCRow || !pCRow->FInit(pCSession, pFileio, ulRowNum) )
00480   {
00481     hr = E_OUTOFMEMORY;
00482     goto CLEANUP;
00483   }
00484
00485   TESTC(hr = pCRow->QueryInterface(riid, (LPVOID*)ppUnk));
00486
00487 CLEANUP:
00488
00489   if( FAILED(hr) )
00490   {
00491     if( DB_E_NOTABLE == hr )
00492       hr = DB_E_NOTFOUND;
00493
00494     SAFE_DELETE(pCRow);
00495   }
00496
00497   SAFE_RELEASE(pCSession);
00498
00499   return hr;
00500 }
00501
00502
00503 // CImpIBindResource::BindStream ---------------------------------------------
00504 //
00505 // @mfunc Retrieves a stream object
00506 //
00507 // @rdesc Returns one of the following values:
00508 //      @flag S_OK                   | Method Succeeded
00509 //    @flag DB_E_NOTFOUND      | Object does not exist
00510 //      @flag OTHER                  | Other HRESULTs returned by called functions
00511 //
00512 HRESULT CImpIBindResource::BindStream
00513   (
00514   IUnknown *      pUnkOuter,    // [in] controllig IUnknown
00515   REFIID        riid,     // [in] interface to be requested
00516   DBIMPLICITSESSION * pImplSession, // [in|out] implicit session pointer
00517   WCHAR *       pwszDataSource, // [in] DataSource path name
00518   WCHAR *       pwszFile,   // [in] URL name
00519   ULONG       ulRowNum,   // [in] Row number to retrieve
00520   IUnknown **     ppUnk     // [out] session interface
00521   )
00522 {
00523   HRESULT     hr  = E_FAIL;
00524   CRow *      pCRow = NULL;
00525   CStream *   pCStream = NULL;
00526
00527   TESTC(hr = BindRow(NULL, IID_IUnknown, pImplSession, pwszDataSource,
00528           pwszFile, ulRowNum, (IUnknown **)&pCRow));
00529
00530   pCStream = new CStream(pUnkOuter);
00531   if( pCStream && pCStream->FInit(pCRow, pCRow->GetRowBuff()) )
00532     hr = pCStream->QueryInterface(riid, (LPVOID *)ppUnk);
00533   else
00534     hr = E_OUTOFMEMORY;
00535
00536 CLEANUP:
00537   if( FAILED(hr) )
00538   {
00539     if( DB_E_NOTABLE == hr )
00540       hr = DB_E_NOTFOUND;
00541
00542     SAFE_DELETE(pCStream);
00543   }
00544
00545   SAFE_RELEASE(pCRow);
00546
00547   return hr;
00548 }
00549
00550
00551 // CImpIBindResource::ValidateBindArgs ---------------------------------------
00552 //
00553 // @mfunc Decrements a persistence count for the object and if
00554 // persistence count is 0, the object destroys itself.
00555 //
00556 // @rdesc HRESULT indicating the status of the method
00557 //      @flag S_OK               | Method succeeded
00558 //      @flag DB_E_NOAGGREGATION | valid pUnkOuter but riid != IID_IUnknown
00559 //      @flag E_INVALIDARG       | One or more arguments are invalid.
00560 //    @flag E_NOINTERFACE      | riid == IID_NULL
00561 //
00562 HRESULT CImpIBindResource::ValidateBindArgs
00563   (
00564   IUnknown *      pUnkOuter,
00565   LPCOLESTR     pwszURL,
00566   DBBINDURLFLAG   dwBindFlags,
00567   REFGUID       rguid,
00568   REFIID        riid,
00569   DBIMPLICITSESSION * pImplSession,
00570   IAuthenticate *   pAuthenticate,
00571   DWORD *       pdwBindStatus,
00572   IUnknown **     ppUnk
00573   )
00574 {
00575     // Check in-params and NULL out-params in case of error
00576   *pdwBindStatus = DBBINDURLSTATUS_S_OK;
00577
00578   if ( ppUnk )
00579     *ppUnk = NULL;
00580
00581   if( !ppUnk || !pwszURL )
00582     return E_INVALIDARG;
00583
00584   if( pUnkOuter && riid != IID_IUnknown )
00585     return DB_E_NOAGGREGATION;
00586
00587   if( riid == IID_NULL )
00588     return E_NOINTERFACE;
00589
00590   if( dwBindFlags == 0 )
00591     return E_INVALIDARG;
00592
00593   if( pImplSession )
00594   {
00595     if( pImplSession->piid == NULL )
00596     {
00597       return E_INVALIDARG;
00598     }
00599
00600     if( pImplSession->pUnkOuter && (*(pImplSession->piid) != IID_IUnknown) )
00601     {
00602       return DB_E_NOAGGREGATION;
00603     }
00604   }
00605
00606   // Special cases - Detect invalid or unsupported flags
00607
00608   // WAITFORINIT is only valid for DBGUID_DSO
00609   if( rguid != DBGUID_DSO && (dwBindFlags & DBBINDURLFLAG_WAITFORINIT) )
00610     return E_INVALIDARG;
00611
00612   // OUTPUT flag is ignored when binding to DBGUID_ROWSET
00613   if( rguid != DBGUID_ROWSET && (dwBindFlags & DBBINDURLFLAG_OUTPUT) )
00614     return E_INVALIDARG;
00615
00616   // WAITFORINIT and OUTPUT have been handled
00617   // Sample Provider has no notion of a hierarchy, so the recursive flag is always ignored
00618   dwBindFlags &= ~(DBBINDURLFLAG_WAITFORINIT | DBBINDURLFLAG_OUTPUT | DBBINDURLFLAG_RECURSIVE);
00619
00620   if( dwBindFlags &
00621     ~(DBBINDURLFLAG_READWRITE | DBBINDURLFLAG_SHARE_DENY_NONE | DBBINDURLFLAG_SHARE_EXCLUSIVE) )
00622   {
00623     if( dwBindFlags & DBBINDURLFLAG_ASYNCHRONOUS )
00624     {
00625       return DB_E_ASYNCNOTSUPPORTED;
00626     }
00627     else
00628       return E_INVALIDARG;
00629   }
00630
00631   // Allow the bind to succeed, but warn user
00632   if( dwBindFlags & DBBINDURLFLAG_SHARE_EXCLUSIVE )
00633   {
00634     *pdwBindStatus = DBBINDURLSTATUS_S_DENYTYPENOTSUPPORTED;
00635   }
00636
00637   if( rguid == DBGUID_DSO || rguid == DBGUID_SESSION )
00638   {
00639     if( dwBindFlags & ~(DBBINDURLFLAG_READ) )
00640     {
00641       return E_INVALIDARG;
00642     }
00643   }
00644   else if( rguid == DBGUID_ROW || rguid == DBGUID_ROWSET )
00645   {
00646     NULL;
00647   }
00648   else if( rguid == DBGUID_STREAM )
00649   {
00650     // Sample Provider's Streams are read only
00651     if( dwBindFlags & DBBINDURLFLAG_WRITE )
00652       return DB_E_READONLY;
00653   }
00654   else
00655   {
00656     // invalid rguid
00657     return DB_E_NOTSUPPORTED;
00658   }
00659
00660   return S_OK;
00661 }
00662
00663
00664 // CImpIBindResource::ParseURL -----------------------------------------------
00665 //
00666 // @mfunc Parses the URL for tablename and row number information
00667 //
00668 // @rdesc HRESULT indicating the status of the method
00669 //      @flag S_OK               | Method succeeded
00670 //      @flag DB_E_NOTFOUND      | The object does not exist
00671 //
00672 HRESULT CImpIBindResource::ParseURL
00673   (
00674   LPCOLESTR     pwszURL,
00675   WCHAR **      ppwszDataSource,
00676   WCHAR **      ppwszTableName,
00677   ULONG *       pulRowNum
00678   )
00679 {
00680   // parse the URL for destination file.
00681   // The sample provider recognizes URLs of the form
00682   // sampprov: [datasource=c:\oledbtst], file=customer.csv, [row=n]
00683   //
00684   // The datasource keyword is ignored when using a session object's
00685   // IBindResource implementation.
00686
00687   const WCHAR * pwsz = NULL;
00688   WCHAR *     pwszRowNum = NULL;
00689   WCHAR *     pwszStop = NULL;
00690   ULONG     cchPrefix = (sizeof(SAMPPROV_URL_PREFIX)-sizeof(WCHAR))/sizeof(WCHAR);
00691
00692   if( !pwszURL )
00693     return E_INVALIDARG;
00694
00695   // Check that the prefix is of the form  "sampprov:..."
00696   if( 0 != _wcsnicmp(pwszURL, SAMPPROV_URL_PREFIX, cchPrefix) ||
00697     L':' != *(pwszURL+cchPrefix) )
00698     return DB_E_NOTFOUND;
00699
00700   pwsz = pwszURL+cchPrefix;
00701   while ( iswspace(*pwsz) )
00702     pwsz++;
00703
00704   FindKeyword(pwsz, g_wszDataSourceKeyword, ppwszDataSource);
00705   FindKeyword(pwsz, g_wszFileKeyword, ppwszTableName);
00706
00707   if( FindKeyword(pwsz, g_wszRowKeyword, &pwszRowNum) )
00708   {
00709     *pulRowNum = wcstol(pwszRowNum, &pwszStop, 10);
00710     if( pwszStop && pwszStop[0] != L'\0' )
00711     {
00712       delete [] pwszRowNum;
00713       return DB_E_NOTFOUND;
00714     }
00715     delete [] pwszRowNum;
00716   }
00717
00718     return S_OK;
00719 }
00720
00721
00722 // CImpIBindResource::FindKeyword---------------------------------------------
00723 //
00724 // @mfunc Extracts a keyword value
00725 //
00726 // @rdesc BOOL
00727 //      @flag TRUE        | Found a keyword value
00728 //      @flag FALSE             | Failed to find a value
00729 //
00730 BOOL CImpIBindResource::FindKeyword
00731   (
00732   LPCOLESTR     pwszURL,
00733   LPCOLESTR     pwszKeyword,
00734   WCHAR **      ppwszToken
00735   )
00736 {
00737   assert( pwszKeyword && pwszURL && ppwszToken );
00738
00739   while( *pwszURL )
00740     {
00741     const WCHAR* p1 = pwszURL;
00742     const WCHAR* p2 = pwszKeyword;
00743
00744         while(*p1 && *p2 && (towlower(*p1)==towlower(*p2)) )
00745       p1++, p2++;
00746
00747         if( !*p2 )
00748     {
00749       const WCHAR* pTokBegin = NULL;
00750       const WCHAR* pTokEnd = NULL;
00751
00752       pTokBegin = pwszURL + wcslen(pwszKeyword);
00753       while( iswspace(*pTokBegin) )
00754         pTokBegin++;
00755
00756       if( *pTokBegin == L'=' )
00757       {
00758         pTokBegin += 1;
00759         while( iswspace(*pTokBegin) )
00760           pTokBegin++;
00761
00762         pTokEnd = pTokBegin;
00763         while( *pTokEnd && *pTokEnd != L',' )
00764           pTokEnd++;
00765
00766         *ppwszToken = new WCHAR [pTokEnd - pTokBegin + 1];
00767         if( !ppwszToken )
00768           return FALSE;
00769
00770         wcsncpy(*ppwszToken, pTokBegin, pTokEnd - pTokBegin);
00771         *(*ppwszToken + (pTokEnd - pTokBegin)) = L'\0';
00772         return TRUE;
00773       }
00774       return FALSE;
00775     }
00776
00777         pwszURL++;
00778     }
00779
00780   return FALSE;
00781 }
00782
00783
00784 // CImpIBindResource::Bind ---------------------------------------------------
00785 //
00786 // @mfunc Retrieves an interface pointer to service a URL
00787 //
00788 // @rdesc Returns one of the following values:
00789 //      @flag S_OK                   | Method Succeeded
00790 //      @flag DB_S_ERRORSOCCURED     | Some bind flags were not satisfied
00791 //    @flag DB_E_NOTFOUND          | The object does not exist
00792 //      @flag E_INVALIDARG           | pwszURL or ppUnk were NULL
00793 //      @flag OTHER                  | Other HRESULTs returned by called functions
00794 //
00795 STDMETHODIMP CImpIBindResource::Bind
00796   (
00797   IUnknown *      pUnkOuter,
00798   LPCOLESTR     pwszURL,
00799   DBBINDURLFLAG   dwBindFlags,
00800   REFGUID       rguid,
00801   REFIID        riid,
00802   IAuthenticate *   pAuthenticate,
00803   DBIMPLICITSESSION * pImplSession,
00804   DBBINDURLSTATUS * pdwBindStatus,
00805   IUnknown **     ppUnk
00806   )
00807 {
00808   HRESULT     hr;
00809   WCHAR *     pwszDataSource = NULL;
00810   WCHAR *     pwszFile = NULL;
00811   ULONG     ulRowNum = 0;
00812   DBBINDURLSTATUS dwBindStatus = DBBINDURLSTATUS_S_OK;
00813
00814   // Ignore pImplSession when binding to a DSO
00815   // Also, on a session object, always ignore pImplSession
00816   if( BOT_SESSION == m_pObj->GetBaseObjectType() ||
00817     rguid == DBGUID_DSO )
00818     pImplSession = NULL;
00819
00820   // On a session object, ignore pUnkOuter when binding to
00821   // objects that already exist
00822   if( BOT_SESSION == m_pObj->GetBaseObjectType() &&
00823     (rguid == DBGUID_DSO || rguid == DBGUID_SESSION) )
00824     pUnkOuter = NULL;
00825
00826   if( !pdwBindStatus )
00827     pdwBindStatus = &dwBindStatus;
00828
00829   // When implemented on a session object, a more functional
00830   // provider would examine it's DBPROP_INIT_MODE and DBPROP_INIT_BINDFLAGS
00831   // properties to determine if it should use its inherited binding
00832   // options.  In the case of the sample provider, there are no
00833   // binding options to inherit.
00834
00835   // Validate the Bind Arguments
00836   TESTC(hr = ValidateBindArgs(pUnkOuter, pwszURL, dwBindFlags, rguid,
00837             riid, pImplSession, pAuthenticate, pdwBindStatus, ppUnk));
00838
00839   // Parse the URL for binding information
00840   // Ignore datasource keyword for now...
00841   TESTC(hr = ParseURL(pwszURL, &pwszDataSource, &pwszFile, &ulRowNum));
00842
00843   if( rguid == DBGUID_DSO )
00844   {
00845     TESTC(hr = BindDSO(pUnkOuter, riid, dwBindFlags & DBBINDURLFLAG_WAITFORINIT,
00846               pwszDataSource, ppUnk));
00847   }
00848   else if( rguid == DBGUID_SESSION )
00849   {
00850     TESTC(hr = BindSession(pUnkOuter, riid, pwszDataSource, ppUnk));
00851   }
00852   else if( rguid == DBGUID_ROWSET )
00853   {
00854     if( 0 != ulRowNum)
00855     {
00856       hr = DB_E_NOTCOLLECTION;
00857       goto CLEANUP;
00858     }
00859
00860     TESTC(hr = BindRowset(pUnkOuter, riid, pImplSession, pwszDataSource, pwszFile, ppUnk));
00861   }
00862   else if( rguid == DBGUID_ROW )
00863   {
00864     TESTC(hr = BindRow(pUnkOuter, riid, pImplSession, pwszDataSource, pwszFile, ulRowNum, ppUnk));
00865   }
00866   else if( rguid == DBGUID_STREAM )
00867   {
00868     TESTC(hr = BindStream(pUnkOuter, riid, pImplSession, pwszDataSource, pwszFile, ulRowNum, ppUnk));
00869   }
00870   else
00871   {
00872     assert(!"Bad rguid type not detected!");
00873   }
00874
00875
00876 CLEANUP:
00877   if( pwszDataSource )
00878     delete [] pwszDataSource;
00879   if( pwszFile )
00880     delete [] pwszFile;
00881
00882   if( FAILED(hr) && ppUnk )
00883   {
00884     *ppUnk = NULL;
00885   }
00886
00887   // Bind status is only set on DB_S_ERRORSOCCURRED
00888   if( hr == S_OK )
00889   {
00890     if( *pdwBindStatus )
00891       hr = DB_S_ERRORSOCCURRED;
00892   }
00893   else
00894     *pdwBindStatus = DBBINDURLSTATUS_S_OK;;
00895
00896   return hr;
00897 }
00898
00899
00900 //  ICreateRow specific interface methods
00901
00902 // CImpICreateRow::CreateRow -------------------------------------------------
00903 //
00904 // @mfunc Retrieves an interface pointer to service a URL
00905 //
00906 // @rdesc Returns one of the following values:
00907 //      @flag E_NOINTERFACE           | Sample provider does not support
00908 //                    ICreateRow
00909 //
00910 STDMETHODIMP CImpICreateRow::CreateRow
00911   (
00912   IUnknown *      pUnkOuter,
00913   LPCOLESTR     pwszURL,
00914   DBBINDURLFLAG   dwBindFlags,
00915   REFGUID       rguid,
00916   REFIID        riid,
00917   IAuthenticate *   pAuthenticate,
00918   DBIMPLICITSESSION * pImplSession,
00919   DBBINDURLSTATUS * pdwBindStatus,
00920   LPOLESTR *      ppwszNewURL,
00921   IUnknown **     ppUnk
00922   )
00923 {
00924   // ICreateRow is a mandatory interface on Provider Binders
00925   // Although there is no support for object creation, the Sample Provider
00926   // must support this interface and simply return E_NOINTERFACE
00927   return E_NOINTERFACE;
00928 }
00929
00930
00931 //  IDBBinderProperties specific interface methods
00932
00933 // CImpIDBBinderProperties::GetProperties ------------------------------------
00934 //
00935 // @mfunc Returns current settings of all properties in the FLAGS_DATASRCINF
00936 //      property group
00937 //
00938 // @rdesc HRESULT
00939 //      @flag S_OK          | The method succeeded
00940 //      @flag E_INVALIDARG  | pcProperties or prgPropertyInfo was NULL
00941 //      @flag E_OUTOFMEMORY | Out of memory
00942 //
00943 STDMETHODIMP CImpIDBBinderProperties::GetProperties
00944   (
00945   ULONG       cPropertySets,
00946   const DBPROPIDSET*  rgPropertySets,
00947   ULONG*              pcPropertySets,
00948   DBPROPSET**     prgPropertySets
00949   )
00950 {
00951     assert( m_pObj );
00952     assert( m_pObj->m_pUtilProp );
00953
00954   HRESULT hr = m_pObj->m_pUtilProp->GetPropertiesArgChk(PROPSET_DSO, cPropertySets,
00955                 rgPropertySets, pcPropertySets, prgPropertySets);
00956   if ( FAILED(hr) )
00957     return hr;
00958
00959     // Just pass this call on to the utility object that manages our properties
00960     return m_pObj->m_pUtilProp->GetProperties(
00961                   PROPSET_DSO,
00962                   cPropertySets,
00963                   rgPropertySets,
00964                   pcPropertySets,
00965                   prgPropertySets );
00966 }
00967
00968
00969 // CImpIDBBinderProperties::GetPropertyInfo  ---------------------------------
00970 //
00971 // @mfunc Returns information about rowset and data source properties supported
00972 // by the provider
00973 //
00974 // @rdesc HRESULT
00975 //      @flag S_OK          | The method succeeded
00976 //      @flag E_INVALIDARG  | pcPropertyInfo or prgPropertyInfo was NULL
00977 //      @flag E_OUTOFMEMORY | Out of memory
00978 //
00979 STDMETHODIMP CImpIDBBinderProperties::GetPropertyInfo
00980   (
00981   ULONG       cPropertySets,
00982   const DBPROPIDSET*  rgPropertySets,
00983   ULONG*        pcPropertyInfoSets,
00984   DBPROPINFOSET**   prgPropertyInfoSets,
00985   WCHAR**       ppDescBuffer
00986   )
00987 {
00988     assert( m_pObj );
00989     assert( m_pObj->m_pUtilProp );
00990
00991     // just pass this call on to the utility object that manages our properties
00992     return m_pObj->m_pUtilProp->GetPropertyInfo(
00993                   FALSE,
00994                   cPropertySets,
00995                   rgPropertySets,
00996                   pcPropertyInfoSets,
00997                   prgPropertyInfoSets,
00998                   ppDescBuffer);
00999 }
01000
01001
01002 // CImpIDBBinderProperties::SetProperties  --------------------------------------
01003 //
01004 // @mfunc Set properties in the FLAGS_DATASRCINF property group
01005 //
01006 // @rdesc HRESULT
01007 //      @flag S_OK          | The method succeeded
01008 //      @flag E_INVALIDARG  | cProperties was not equal to 0 and rgProperties was NULL
01009 //
01010 STDMETHODIMP CImpIDBBinderProperties::SetProperties
01011   (
01012   ULONG   cPropertySets,    //@parm IN | Count of structs returned
01013   DBPROPSET rgPropertySets[]    //@parm IN | Array of Properties
01014   )
01015 {
01016     HRESULT hr = E_FAIL;
01017
01018   //
01019   // Asserts
01020   //
01021   assert( m_pObj );
01022     assert( m_pObj->m_pUtilProp );
01023
01024   //
01025   // Quick return if the Count of cPropertySets is 0
01026   //
01027   if( cPropertySets == 0 )
01028     return S_OK;
01029
01030     //
01031     // Check in-params and NULL out-params in case of error
01032     //
01033   hr=m_pObj->m_pUtilProp->SetPropertiesArgChk(cPropertySets, rgPropertySets);
01034
01035   if( FAILED(hr) )
01036     return hr;
01037
01038   //
01039     // just pass this call on to the utility object that manages our properties
01040   //
01041     return m_pObj->m_pUtilProp->SetProperties(PROPSET_DSO,
01042                         cPropertySets, rgPropertySets);
01043 }
01044
01045
01046 // CImpIDBBinderProperties::Reset  ----------------------------------------------
01047 //
01048 // @mfunc Reset properties to their default value
01049 //
01050 // @rdesc HRESULT
01051 //      @flag S_OK          | The method succeeded
01052 //      @flag E_OUTOFMEMORY | Out of memory
01053 //
01054 STDMETHODIMP CImpIDBBinderProperties::Reset()
01055 {
01056   PCUTILPROP  pCUtilProp = NULL;
01057
01058   pCUtilProp = new CUtilProp();
01059   if( !pCUtilProp )
01060     return E_OUTOFMEMORY;
01061
01062   SAFE_DELETE( m_pObj->m_pUtilProp );
01063   m_pObj->m_pUtilProp = pCUtilProp;
01064
01065   return S_OK;
01066 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/bits_ie/bits_ie.cpp Source File

  • Web
  • bits
  • bits_ie

bits_ie.cpp

Go to the documentation of this file.
00001 /************************************************************************
00002
00003 Copyright (c) Microsoft Corporation
00004
00005 Module Name :
00006
00007     bits_ie.cpp
00008
00009 Abstract :
00010
00011     Sample background downloader which uses BITS.
00012
00013 Revision History :
00014
00015 Notes:
00016
00017     This program is a very simple background downloader which demonstrates
00018     the use of BITS. The program hooks into the IE context menu, to
00019     allow the user to schedule the download instead of using the default
00020     IE downloader.
00021
00022 Concepts Covered:
00023
00024     1. Basic connection with manager and job submission.
00025     2. Example presentation to user of job state.
00026     3. Job control such as suspend/resume/cancel/complete.
00027     4. Interface based callbacks for updating progress/state.
00028     5. How to get the text message for a BITS error code.
00029
00030  ***********************************************************************/
00031
00032 #ifndef UNICODE
00033 #define UNICODE
00034 #endif
00035
00036 #ifndef _UNICODE
00037 #define _UNICODE
00038 #endif
00039
00040 #pragma warning( disable : 4786 )
00041
00042 #include <windows.h>
00043 #include <stdio.h>
00044 #include <stdlib.h>
00045 #include <malloc.h>
00046 #include <math.h>
00047 #include <float.h>
00048 #include <commctrl.h>
00049 #include <commdlg.h>
00050 #include <shellapi.h>
00051 #include <wininet.h>
00052 #include <shlobj.h>
00053 #include "resource.h"
00054 #include <bits.h>
00055 #include <comdef.h>
00056
00057 template<class T> class SmartRefPointer
00058 {
00059 private:
00060    T * m_Interface;
00061
00062    void ReleaseIt()
00063    {
00064       if ( m_Interface )
00065          m_Interface->Release();
00066       m_Interface = NULL;
00067    }
00068
00069    void RefIt()
00070    {
00071       if ( m_Interface )
00072           m_Interface->AddRef();
00073    }
00074
00075 public:
00076
00077    SmartRefPointer()
00078    {
00079       m_Interface = NULL;
00080    }
00081
00082    SmartRefPointer( T * RawInterface )
00083    {
00084       m_Interface = RawInterface;
00085       RefIt();
00086    }
00087
00088    SmartRefPointer( SmartRefPointer & Other )
00089    {
00090       m_Interface = Other.m_Interface;
00091       RefIt();
00092    }
00093
00094    ~SmartRefPointer()
00095    {
00096       ReleaseIt();
00097    }
00098
00099    T * Get() const
00100    {
00101       return m_Interface;
00102    }
00103
00104    T * Release()
00105    {
00106       T * temp = m_Interface;
00107       m_Interface = NULL;
00108       return temp;
00109    }
00110
00111    void Clear()
00112    {
00113       ReleaseIt();
00114    }
00115
00116    T** GetRecvPointer()
00117    {
00118       ReleaseIt();
00119       return &m_Interface;
00120    }
00121
00122    SmartRefPointer & operator=( SmartRefPointer & Other )
00123    {
00124       ReleaseIt();
00125       m_Interface = Other.m_Interface;
00126       RefIt();
00127       return *this;
00128    }
00129
00130    T* operator->() const
00131    {
00132       return m_Interface;
00133    }
00134
00135    operator const T*() const
00136    {
00137       return m_Interface;
00138    }
00139 };
00140
00141 typedef SmartRefPointer<IUnknown> SmartIUnknownPointer;
00142 typedef SmartRefPointer<IBackgroundCopyManager> SmartManagerPointer;
00143 typedef SmartRefPointer<IBackgroundCopyJob> SmartJobPointer;
00144 typedef SmartRefPointer<IBackgroundCopyJob2> SmartJob2Pointer;
00145 typedef SmartRefPointer<IBackgroundCopyError> SmartJobErrorPointer;
00146 typedef SmartRefPointer<IBackgroundCopyFile> SmartFilePointer;
00147 typedef SmartRefPointer<IEnumBackgroundCopyFiles> SmartEnumFilesPointer;
00148 typedef SmartRefPointer<IEnumBackgroundCopyJobs> SmartEnumJobsPointer;
00149 typedef SmartRefPointer<IShellLink> SmartShellLinkPointer;
00150 typedef SmartRefPointer<IPersistFile> SmartPersistFilePointer;
00151
00152 // Maxstring size, bump up on problems
00153 #define MAX_STRING 0x800 // 2K
00154
00155 GUID g_JobId;
00156 WCHAR g_szFileName[MAX_PATH];
00157 HWND g_hwndDlg = NULL;
00158
00159 // These two global variables throttle updates.
00160 // The algorithm is to set a timer on the first update request,
00161 // and delay additional updates until after the timer expires.
00162
00163 // The timer is set
00164 bool g_UpdateTimerSet = FALSE;
00165 // Received on update request while timer is active
00166 bool g_RefreshOnTimer = FALSE;
00167
00168 SmartJobPointer g_pJob;
00169 SmartManagerPointer g_pManager;
00170
00171 void HandleUpdate( );
00172 void CheckHR( HWND hwnd, HRESULT Hr, bool bThrow );
00173
00174 void SafeCopy( WCHAR * Dest, const WCHAR * Source, size_t Count )
00175 {
00176     if ( !Count )
00177         return;
00178
00179     while (Count && (*Source != L'\0'))
00180     {
00181         *Dest++ = *Source++;
00182         Count--;
00183     }
00184
00185     if (Count == 0)
00186     {
00187         // we are going to truncate Dest
00188         Dest--;
00189     }
00190
00191     *Dest= L'\0';
00192 }
00193
00194 void SafeCat( WCHAR * Dest, const WCHAR * Source, size_t Count )
00195 {
00196     size_t DestSize = wcslen( Dest );
00197
00198     if ( DestSize > Count )
00199         return;
00200
00201     SafeCopy( Dest + DestSize,
00202               Source,
00203               Count - DestSize );
00204 }
00205
00206 void SafeStringPrintf( WCHAR *Dest, DWORD Count, const WCHAR * Format, ... )
00207 {
00208      va_list arglist;
00209      va_start( arglist, Format );
00210
00211      if ( !Count )
00212          return;
00213
00214      int Ret;
00215      size_t Max;
00216
00217      // leave the last space for the null terminator
00218      Max = Count - 1;
00219
00220      Ret = _vsnwprintf( Dest, Max, Format, arglist);
00221
00222      if ((Ret < 0) || (((size_t)Ret) > Max))
00223      {
00224          // need to null terminate the string
00225          Dest += Max;
00226          *Dest = '\0';
00227      }
00228      else if (((size_t)Ret) == Max)
00229      {
00230          // need to null terminate the string
00231          Dest += Max;
00232          *Dest = '\0';
00233      }
00234 }
00235
00236 const WCHAR * GetString( UINT id )
00237 {
00238
00239     //
00240     // Retrieves the localized string for the resource id
00241     // caching the string when loaded.
00242
00243     static const WCHAR* pStringArray[ IDS_MAX ];
00244     static WCHAR TempStringBuffer[ MAX_STRING ];
00245     const WCHAR * & pStringPointer = pStringArray[ id - 1 ];
00246
00247     // Cache resource strings
00248     if ( pStringPointer )
00249         return pStringPointer;
00250
00251     // Load string from resource
00252
00253     int CharsLoaded =
00254         LoadStringW(
00255             (HINSTANCE)GetModuleHandle(NULL),
00256             id,
00257             TempStringBuffer,
00258             MAX_STRING );
00259
00260     if ( !CharsLoaded )
00261         {
00262         CheckHR( NULL, HRESULT_FROM_WIN32( GetLastError() ), false );
00263         return L"";
00264         }
00265
00266     WCHAR *pNewString = new WCHAR[ CharsLoaded + 1];
00267     if ( !pNewString )
00268         {
00269         CheckHR( NULL, E_OUTOFMEMORY, false );
00270         return L"";
00271         }
00272
00273     SafeCopy( pNewString, TempStringBuffer, CharsLoaded + 1 );
00274     return ( pStringPointer = pNewString );
00275
00276 }
00277
00278 void
00279 DeleteStartupLink(
00280     GUID JobID
00281     )
00282 {
00283
00284     //
00285     // Delete the link in the Startup folder for the job
00286     //
00287
00288     WCHAR szLinkFileName[MAX_PATH] = {0};
00289     WCHAR szGUIDString[MAX_PATH] = {0};
00290
00291     BOOL bResult =
00292         SHGetSpecialFolderPath(
00293             NULL,
00294             szLinkFileName,
00295             CSIDL_STARTUP,
00296             FALSE );
00297
00298     if ( !bResult )
00299         return;
00300
00301     SafeCat( szLinkFileName, L"\\", MAX_PATH );
00302     SafeCat( szLinkFileName, GetString( IDS_STARTUPLINK ), MAX_PATH );
00303     SafeCat( szLinkFileName, L" ", MAX_PATH );
00304
00305     StringFromGUID2( JobID, szGUIDString, MAX_PATH );
00306     SafeCat( szLinkFileName, szGUIDString, MAX_PATH );
00307     SafeCat( szLinkFileName, L".lnk", MAX_PATH );
00308
00309     if (!DeleteFile( szLinkFileName ))
00310         {
00311         DWORD dwError = GetLastError();
00312         if ( ERROR_PATH_NOT_FOUND != dwError &&
00313              ERROR_FILE_NOT_FOUND != dwError )
00314             {
00315             CheckHR( NULL, HRESULT_FROM_WIN32( dwError ), false );
00316             }
00317         }
00318
00319 }
00320
00321 void
00322 CreateStartupLink(
00323     GUID JobID,
00324     WCHAR *pszFileName
00325     )
00326 {
00327     //
00328     // Create a link in the Startup folder for this job.
00329     //
00330
00331     SmartShellLinkPointer   ShellLink;
00332     SmartPersistFilePointer PersistFile;
00333
00334     WCHAR szLinkFileName[MAX_PATH] = {0};
00335
00336     BOOL bResult =
00337         SHGetSpecialFolderPath(
00338             NULL,
00339             szLinkFileName,
00340             CSIDL_STARTUP,
00341             FALSE );
00342
00343     if ( !bResult )
00344         CheckHR( NULL, E_FAIL, true );
00345
00346     WCHAR szLinkDescription[MAX_PATH] = {0};
00347     SafeCopy( szLinkDescription, GetString( IDS_STARTUPLINK ), MAX_PATH );
00348     SafeCat( szLinkDescription, L" ", MAX_PATH );
00349
00350     WCHAR szGUIDString[MAX_PATH] = {0};
00351     StringFromGUID2( JobID, szGUIDString, MAX_PATH );
00352     SafeCat( szLinkDescription, szGUIDString, MAX_PATH );
00353
00354     WCHAR szArguments[MAX_PATH] = {0};
00355     SafeCopy( szArguments, L"/RESUMEJOB ", MAX_PATH);
00356     SafeCat( szArguments, szGUIDString, MAX_PATH );
00357     SafeCat( szArguments, L" ", MAX_PATH );
00358     SafeCat( szArguments, pszFileName, MAX_PATH );
00359
00360     SafeCat( szLinkFileName, L"\\", MAX_PATH );
00361     SafeCat( szLinkFileName, szLinkDescription, MAX_PATH );
00362     SafeCat( szLinkFileName, L".lnk", MAX_PATH );
00363
00364     CheckHR( NULL,
00365              CoCreateInstance( CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
00366                                IID_IShellLink, (LPVOID*)ShellLink.GetRecvPointer() ),
00367              true );
00368
00369     CheckHR( NULL, ShellLink->SetShowCmd( SW_SHOWMINIMIZED ), true );
00370     CheckHR( NULL, ShellLink->QueryInterface( IID_IPersistFile, (LPVOID*)PersistFile.GetRecvPointer() ), true );
00371     CheckHR( NULL, ShellLink->SetPath( L"%windir%\\system32\\bits_ie.exe" ), true );
00372     CheckHR( NULL, ShellLink->SetArguments( szArguments ), true );
00373     CheckHR( NULL, ShellLink->SetDescription( szLinkDescription ), true );
00374     CheckHR( NULL, PersistFile->Save( szLinkFileName, TRUE ), true );
00375
00376 }
00377
00378
00379 void SetWindowTime(
00380     HWND hwnd,
00381     FILETIME filetime
00382     )
00383 {
00384      // Set the window text to be the text representation
00385      // of the file time.
00386      // If an error occurs, set the window text to be error
00387
00388      FILETIME localtime;
00389      FileTimeToLocalFileTime( &filetime, &localtime );
00390
00391      SYSTEMTIME systemtime;
00392      FileTimeToSystemTime( &localtime, &systemtime );
00393
00394      WCHAR DateBuffer[ MAX_STRING ];
00395
00396      int DateSize =
00397          GetDateFormatW(
00398              LOCALE_USER_DEFAULT,
00399              0,
00400              &systemtime,
00401              NULL,
00402              DateBuffer,
00403              MAX_STRING );
00404
00405      if (!DateSize)
00406          {
00407          SetWindowText( hwnd, GetString( IDS_ERROR ) );
00408          return;
00409          }
00410
00411      WCHAR TimeBuffer[ MAX_STRING ];
00412
00413      int TimeSize =
00414         GetTimeFormatW(
00415             LOCALE_USER_DEFAULT,
00416             0,
00417             &systemtime,
00418             NULL,
00419             TimeBuffer,
00420             MAX_STRING );
00421
00422      if (!TimeSize)
00423          {
00424          SetWindowText( hwnd, GetString( IDS_ERROR ) );
00425          return;
00426          }
00427
00428      WCHAR FullTime[ MAX_STRING ];
00429      SafeStringPrintf( FullTime, MAX_STRING,
00430                        L"%s %s", DateBuffer, TimeBuffer );
00431
00432      SetWindowText( hwnd, FullTime );
00433 }
00434
00435 UINT64
00436 GetSystemTimeAsUINT64()
00437 {
00438
00439     //
00440     // Returns the system time as an UINT instead of a FILETIME.
00441     //
00442
00443     FILETIME filetime;
00444     GetSystemTimeAsFileTime( &filetime );
00445
00446     ULARGE_INTEGER large;
00447     memcpy( &large, &filetime, sizeof(FILETIME) );
00448
00449     return large.QuadPart;
00450 }
00451
00452 void SignalAlert(
00453     HWND hwndDlg,
00454     UINT Type
00455     )
00456 {
00457
00458     //
00459     // Alert the user that an important event has occurred
00460     //
00461
00462     FLASHWINFO FlashInfo;
00463     FlashInfo.cbSize    = sizeof(FlashInfo);
00464     FlashInfo.hwnd      = hwndDlg;
00465     FlashInfo.dwFlags   = FLASHW_ALL | FLASHW_TIMERNOFG;
00466     FlashInfo.uCount    = 0;
00467     FlashInfo.dwTimeout = 0;
00468
00469     FlashWindowEx( &FlashInfo );
00470     MessageBeep( Type );
00471
00472 }
00473
00474 const WCHAR *
00475 MapStateToString(
00476     BG_JOB_STATE state
00477     )
00478 {
00479
00480    //
00481    // Maps a BITS job state to a human readable string
00482    //
00483
00484    switch( state )
00485        {
00486
00487        case BG_JOB_STATE_QUEUED:
00488            return GetString( IDS_QUEUED );
00489
00490        case BG_JOB_STATE_CONNECTING:
00491            return GetString( IDS_CONNECTING );
00492
00493        case BG_JOB_STATE_TRANSFERRING:
00494            return GetString( IDS_TRANSFERRING );
00495
00496        case BG_JOB_STATE_SUSPENDED:
00497            return GetString( IDS_SUSPENDED );
00498
00499        case BG_JOB_STATE_ERROR:
00500            return GetString( IDS_FATALERROR );
00501
00502        case BG_JOB_STATE_TRANSIENT_ERROR:
00503            return GetString( IDS_TRANSIENTERROR );
00504
00505        case BG_JOB_STATE_TRANSFERRED:
00506            return GetString( IDS_TRANSFERRED );
00507
00508        case BG_JOB_STATE_ACKNOWLEDGED:
00509            return GetString( IDS_ACKNOWLEDGED );
00510
00511        case BG_JOB_STATE_CANCELLED:
00512            return GetString( IDS_CANCELLED );
00513
00514        default:
00515
00516            // NOTE: Always provide a default case
00517            // since new states may be added in future versions.
00518            return GetString( IDS_UNKNOWN );
00519
00520        }
00521 }
00522
00523 double
00524 ScaleDownloadRate(
00525     double Rate, // rate in seconds
00526     const WCHAR **pFormat )
00527 {
00528
00529     //
00530     // Scales a download rate and selects the correct
00531     // format to pass to wprintf for printing.
00532     //
00533
00534     double RateBounds[] =
00535     {
00536        1073741824.0, // Gigabyte
00537        1048576.0,    // Megabyte
00538        1024.0,       // Kilobyte
00539        0             // Byte
00540     };
00541
00542     UINT RateFormat[] =
00543     {
00544         IDS_GIGAFORMAT,
00545         IDS_MEGAFORMAT,
00546         IDS_KILOFORMAT,
00547         IDS_BYTEFORMAT
00548     };
00549
00550     for( unsigned int c = 0;; c++ )
00551         {
00552         if ( Rate >= RateBounds[c] )
00553             {
00554             *pFormat = GetString( RateFormat[c] );
00555             double scale = (RateBounds[c] >= 1.0) ? RateBounds[c] : 1.0;
00556             return Rate / scale;
00557             }
00558         }
00559 }
00560
00561 UINT64
00562 ScaleDownloadEstimate(
00563     double Time, // time in seconds
00564     const WCHAR **pFormat )
00565 {
00566
00567     //
00568     // Scales a download time estimate and selects the correct
00569     // format to pass to wprintf for printing.
00570     //
00571
00572
00573     double TimeBounds[] =
00574     {
00575        60.0 * 60.0 * 24.0,        // Days
00576        60.0 * 60.0,               // Hours
00577        60.0,                      // Minutes
00578        0.0                        // Seconds
00579     };
00580
00581     UINT TimeFormat[] =
00582     {
00583         IDS_DAYSFORMAT,
00584         IDS_HOURSFORMAT,
00585         IDS_MINUTESFORMAT,
00586         IDS_SECONDSFORMAT
00587     };
00588
00589     for( unsigned int c = 0;; c++ )
00590         {
00591         if ( Time >= TimeBounds[c] )
00592             {
00593             *pFormat = GetString( TimeFormat[c] );
00594             double scale = (TimeBounds[c] >= 1.0) ? TimeBounds[c] : 1.0;
00595             return (UINT64)floor( ( Time / scale ) + 0.5);
00596             }
00597         }
00598
00599 }
00600
00601 void
00602 UpdateDialog(
00603     HWND hwndDlg
00604     )
00605 {
00606
00607    //
00608    // Main update routine for the dialog box.
00609    // Retries the job state/properties from
00610    // BITS and updates the dialog box.
00611    //
00612
00613    {
00614    // update the display name
00615
00616    HWND hwndDisplayName = GetDlgItem( hwndDlg, IDC_DISPLAYNAME );
00617    WCHAR * pszDisplayName = NULL;
00618    if (FAILED( g_pJob->GetDisplayName( &pszDisplayName ) ) )
00619        return; // stop updating on an error
00620    SetWindowText( hwndDisplayName, pszDisplayName );
00621    ShowWindow( hwndDisplayName, SW_SHOW );
00622    CoTaskMemFree( pszDisplayName );
00623
00624    }
00625
00626    static BG_JOB_STATE prevstate = BG_JOB_STATE_SUSPENDED;
00627    BG_JOB_STATE state;
00628
00629    if (FAILED(g_pJob->GetState( &state )))
00630        return; // stop updating on an error
00631
00632    if ( BG_JOB_STATE_ACKNOWLEDGED == state ||
00633         BG_JOB_STATE_CANCELLED == state )
00634        {
00635        // someone else cancelled or completed the job on us,
00636        // just exist the exit.
00637        // May happen if job is canceled with bitsadmin
00638
00639        DeleteStartupLink( g_JobId );
00640        PostQuitMessage( 0 );
00641        return;
00642        }
00643
00644    BG_JOB_PROGRESS progress;
00645    if (FAILED(g_pJob->GetProgress( &progress )))
00646        return; // stop updating on an error
00647
00648    {
00649       // update the title, progress bar, and progress description
00650       WCHAR szProgress[MAX_STRING];
00651       WCHAR szTitle[MAX_STRING];
00652       WPARAM newpos = 0;
00653
00654       if ( progress.BytesTotal &&
00655            ( progress.BytesTotal != BG_SIZE_UNKNOWN ) )
00656           {
00657           SafeStringPrintf(
00658               szProgress, MAX_STRING, GetString( IDS_LONGPROGRESS ),
00659               progress.BytesTransferred, progress.BytesTotal );
00660
00661           double Percent = (double)(__int64)progress.BytesTransferred /
00662                            (double)(__int64)progress.BytesTotal;
00663           Percent *= 100.0;
00664           SafeStringPrintf(
00665               szTitle, MAX_STRING, L"%u%% %s",
00666               (unsigned int)Percent, g_szFileName );
00667           newpos = (WPARAM)Percent;
00668
00669           }
00670       else
00671           {
00672           SafeStringPrintf(
00673               szProgress, MAX_STRING, GetString( IDS_SHORTPROGRESS ),
00674               progress.BytesTransferred );
00675           SafeCopy( szTitle, g_szFileName, MAX_STRING );
00676           newpos = 0;
00677           }
00678
00679       SendDlgItemMessage( hwndDlg, IDC_PROGRESSBAR, PBM_SETPOS, newpos, 0 );
00680       SetWindowText( GetDlgItem( hwndDlg, IDC_PROGRESSINFO ), szProgress );
00681       ShowWindow( GetDlgItem( hwndDlg, IDC_PROGRESSINFO ), SW_SHOW );
00682       EnableWindow( GetDlgItem( hwndDlg, IDC_PROGRESSINFOTXT ), TRUE );
00683       SetWindowText( hwndDlg, szTitle );
00684
00685    }
00686
00687    {
00688    // update the status
00689    HWND hwndStatus = GetDlgItem( hwndDlg, IDC_STATUS );
00690
00691    SetWindowText( hwndStatus, MapStateToString( state ) );
00692    ShowWindow( hwndStatus, SW_SHOW );
00693
00694    // Only enable the finish button if the job is finished.
00695    EnableWindow( GetDlgItem( hwndDlg, IDC_FINISH ), ( state == BG_JOB_STATE_TRANSFERRED ) );
00696
00697    // Only enable the suspend button if the job is not finished or transferred
00698    BOOL EnableSuspend =
00699        ( state != BG_JOB_STATE_SUSPENDED ) && ( state != BG_JOB_STATE_TRANSFERRED );
00700    EnableWindow( GetDlgItem( hwndDlg, IDC_SUSPEND ), EnableSuspend );
00701
00702    // Only enable the resume button if the job is suspended
00703    BOOL EnableResume = ( BG_JOB_STATE_SUSPENDED == state );
00704    EnableWindow( GetDlgItem( hwndDlg, IDC_RESUME ), EnableResume );
00705
00706    // Alert the user when something important happens
00707    // such as the job completes or a unrecoverable error occurs
00708    if ( BG_JOB_STATE_TRANSFERRED == state &&
00709         BG_JOB_STATE_TRANSFERRED != prevstate )
00710        SignalAlert( hwndDlg, MB_OK );
00711
00712    else if ( BG_JOB_STATE_ERROR == state &&
00713         BG_JOB_STATE_ERROR != prevstate )
00714        SignalAlert( hwndDlg, MB_ICONEXCLAMATION );
00715
00716    }
00717
00718    {
00719    // update times
00720    BG_JOB_TIMES times;
00721    if (FAILED(g_pJob->GetTimes( &times )))
00722        return;
00723
00724    HWND hwndCreationTime = GetDlgItem( hwndDlg, IDC_STARTTIME );
00725    SetWindowTime( hwndCreationTime, times.CreationTime );
00726    ShowWindow( hwndCreationTime, SW_SHOW );
00727
00728    HWND hwndModificationTime = GetDlgItem( hwndDlg, IDC_MODIFICATIONTIME );
00729    SetWindowTime( hwndModificationTime, times.ModificationTime );
00730    ShowWindow( hwndModificationTime, SW_SHOW );
00731
00732    HWND hwndCompletionTime = GetDlgItem( hwndDlg, IDC_COMPLETIONTIME );
00733    if ( !times.TransferCompletionTime.dwLowDateTime && !times.TransferCompletionTime.dwHighDateTime )
00734        {
00735
00736        // BITS sets the CompletionTime to all zeros
00737        // if the job is incomplete
00738
00739        ShowWindow( hwndCompletionTime, SW_HIDE );
00740        EnableWindow( GetDlgItem( hwndDlg, IDC_COMPLETIONTIMETXT ), FALSE );
00741        }
00742    else
00743        {
00744        SetWindowTime( hwndCompletionTime, times.TransferCompletionTime );
00745        ShowWindow( hwndCompletionTime, SW_SHOW );
00746        EnableWindow( GetDlgItem( hwndDlg, IDC_COMPLETIONTIMETXT ), TRUE );
00747        }
00748    }
00749
00750    {
00751    // update the error message
00752    IBackgroundCopyError *pError;
00753    HRESULT Hr = g_pJob->GetError( &pError );
00754
00755    if ( FAILED(Hr) )
00756        {
00757        ShowWindow( GetDlgItem( hwndDlg, IDC_ERRORMSG ), SW_HIDE );
00758        EnableWindow( GetDlgItem( hwndDlg, IDC_ERRORMSGTXT ), FALSE );
00759        }
00760    else
00761        {
00762
00763        WCHAR* pszDescription = NULL;
00764        WCHAR* pszContext = NULL;
00765
00766        // If these APIs fail, we should get back
00767        // a NULL string. So everything should be harmless.
00768
00769        pError->GetErrorDescription(
00770            LANGIDFROMLCID( GetThreadLocale() ),
00771            &pszDescription );
00772        pError->GetErrorContextDescription(
00773            LANGIDFROMLCID( GetThreadLocale() ),
00774            &pszContext );
00775
00776        WCHAR FullText[ MAX_STRING ];
00777        FullText[0] = L'\0';
00778
00779        if ( pszDescription )
00780            SafeCopy( FullText, pszDescription, MAX_STRING );
00781        if ( pszContext )
00782            SafeCat( FullText, pszContext, MAX_STRING );
00783        CoTaskMemFree( pszDescription );
00784        CoTaskMemFree( pszContext );
00785
00786        HWND hwndErrorText = GetDlgItem( hwndDlg, IDC_ERRORMSG );
00787        SetWindowText( hwndErrorText, FullText );
00788        ShowWindow( hwndErrorText, SW_SHOW );
00789        EnableWindow( GetDlgItem( hwndDlg, IDC_ERRORMSGTXT ), TRUE );
00790
00791        }
00792
00793    }
00794
00795    if (!SendDlgItemMessage( hwndDlg, IDC_PRIORITY, CB_GETDROPPEDSTATE, 0, 0) )
00796        {
00797        // set the priority, but only do it if user isn't trying to
00798        // set the priority.
00799        BG_JOB_PRIORITY priority;
00800        g_pJob->GetPriority( &priority );
00801        SendDlgItemMessage( hwndDlg, IDC_PRIORITY, CB_SETCURSEL, (WPARAM)priority, 0 );
00802        }
00803
00804    {
00805
00806    //
00807    // This large block of text computes the average transfer rate
00808    // and estimated completion time.  This code has much
00809    // room for improvement.
00810    //
00811
00812    static BOOL HasRates = FALSE;
00813    static UINT64 LastMeasurementTime;
00814    static UINT64 LastMeasurementBytes;
00815    static double LastMeasurementRate;
00816
00817    WCHAR szRateText[MAX_STRING];
00818    BOOL EnableRate = FALSE;
00819
00820    if ( !( BG_JOB_STATE_QUEUED == state ) &&
00821         !( BG_JOB_STATE_CONNECTING == state ) &&
00822         !( BG_JOB_STATE_TRANSFERRING == state ) )
00823        {
00824        // If the job isn't running, then rate values won't
00825        // make any sense. Don't display them.
00826        HasRates = FALSE;
00827        }
00828    else
00829        {
00830
00831        if ( !HasRates )
00832            {
00833            LastMeasurementTime = GetSystemTimeAsUINT64();
00834            LastMeasurementBytes = progress.BytesTransferred;
00835            LastMeasurementRate = 0;
00836            HasRates = TRUE;
00837            }
00838        else
00839            {
00840
00841            UINT64 CurrentTime = GetSystemTimeAsUINT64();
00842            UINT64 NewTotalBytes = progress.BytesTransferred;
00843
00844            UINT64 NewTimeDiff = CurrentTime - LastMeasurementTime;
00845            UINT64 NewBytesDiff = NewTotalBytes - LastMeasurementBytes;
00846            double NewInstantRate = (double)(__int64)NewBytesDiff /
00847                                    (double)(__int64)NewTimeDiff;
00848            double NewAvgRate = (0.3 * LastMeasurementRate) +
00849                                (0.7 * NewInstantRate );
00850
00851            if ( !_finite(NewInstantRate) || !_finite(NewAvgRate) )
00852                {
00853                NewInstantRate = 0;
00854                NewAvgRate = LastMeasurementRate;
00855                }
00856
00857            LastMeasurementTime = CurrentTime;
00858            LastMeasurementBytes = NewTotalBytes;
00859            LastMeasurementRate = NewAvgRate;
00860
00861            // convert from FILETIME units to seconds
00862            double NewDisplayRate = NewAvgRate * 10000000;
00863
00864            const WCHAR *pRateFormat = NULL;
00865            double ScaledRate = ScaleDownloadRate( NewDisplayRate, &pRateFormat );
00866            SafeStringPrintf( szRateText, MAX_STRING, pRateFormat, ScaledRate );
00867
00868            EnableRate = TRUE;
00869            }
00870
00871        }
00872
00873    if (!EnableRate)
00874        {
00875        ShowWindow( GetDlgItem( hwndDlg, IDC_TRANSFERRATE ), SW_HIDE );
00876        EnableWindow( GetDlgItem( hwndDlg, IDC_TRANSFERRATETXT ), FALSE );
00877        }
00878    else
00879        {
00880        SetWindowText( GetDlgItem( hwndDlg, IDC_TRANSFERRATE ), szRateText );
00881        ShowWindow( GetDlgItem( hwndDlg, IDC_TRANSFERRATE ), SW_SHOW );
00882        EnableWindow( GetDlgItem( hwndDlg, IDC_TRANSFERRATETXT ), TRUE );
00883        }
00884
00885    BOOL EnableEstimate = FALSE;
00886    WCHAR szEstimateText[MAX_STRING];
00887
00888    if ( EnableRate )
00889        {
00890
00891        if ( progress.BytesTotal != 0 &&
00892             progress.BytesTotal != BG_SIZE_UNKNOWN )
00893            {
00894
00895            double TimeRemaining =
00896                ( (__int64)progress.BytesTotal - (__int64)LastMeasurementBytes ) / LastMeasurementRate;
00897
00898            // convert from FILETIME units to seconds
00899            TimeRemaining = TimeRemaining / 10000000.0;
00900
00901            static const double SecsPer30Days = 60.0 * 60.0 * 24.0 * 30.0;
00902
00903            // Don't estimate if estimate is larger then 30 days.
00904            if ( TimeRemaining < SecsPer30Days )
00905                {
00906
00907                const WCHAR *pFormat = NULL;
00908                UINT64 Time = ScaleDownloadEstimate( TimeRemaining, &pFormat );
00909                SafeStringPrintf( szEstimateText, MAX_STRING, pFormat, Time );
00910                EnableEstimate = TRUE;
00911                }
00912            }
00913        }
00914
00915    if (!EnableEstimate)
00916        {
00917        ShowWindow( GetDlgItem( hwndDlg, IDC_ESTIMATEDTIME ), SW_HIDE );
00918        EnableWindow( GetDlgItem( hwndDlg, IDC_ESTIMATEDTIMETXT ), FALSE );
00919        }
00920    else
00921        {
00922        SetWindowText( GetDlgItem( hwndDlg, IDC_ESTIMATEDTIME ), szEstimateText );
00923        ShowWindow( GetDlgItem( hwndDlg, IDC_ESTIMATEDTIME ), SW_SHOW );
00924        EnableWindow( GetDlgItem( hwndDlg, IDC_ESTIMATEDTIMETXT ), TRUE );
00925        }
00926
00927    }
00928
00929    prevstate = state;
00930 }
00931
00932 void
00933 InitDialog(
00934     HWND hwndDlg
00935     )
00936 {
00937
00938    //
00939    // Populate the priority list with priority descriptions
00940    //
00941
00942    const WCHAR *Foreground    = GetString( IDS_FOREGROUND );
00943    const WCHAR *High          = GetString( IDS_HIGH );
00944    const WCHAR *Normal        = GetString( IDS_NORMAL );
00945    const WCHAR *Low           = GetString( IDS_LOW );
00946
00947    SendDlgItemMessage( hwndDlg, IDC_PROGRESSBAR, PBM_SETRANGE, 0, MAKELPARAM(0, 100) );
00948    SendDlgItemMessage( hwndDlg, IDC_PRIORITY, CB_ADDSTRING, 0, (LPARAM)Foreground );
00949    SendDlgItemMessage( hwndDlg, IDC_PRIORITY, CB_ADDSTRING, 0, (LPARAM)High );
00950    SendDlgItemMessage( hwndDlg, IDC_PRIORITY, CB_ADDSTRING, 0, (LPARAM)Normal );
00951    SendDlgItemMessage( hwndDlg, IDC_PRIORITY, CB_ADDSTRING, 0, (LPARAM)Low );
00952
00953 }
00954
00955 void CheckHR( HWND hwnd, HRESULT Hr, bool bThrow )
00956 {
00957     //
00958     // Provides automatic error code checking and dialog
00959     // for generic system errors
00960     //
00961
00962     if (SUCCEEDED(Hr))
00963         return;
00964
00965     WCHAR * pszError = NULL;
00966
00967     DWORD dwFormatError =
00968     FormatMessage(
00969         FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
00970         FORMAT_MESSAGE_IGNORE_INSERTS,
00971         NULL,
00972         (DWORD)Hr,
00973         LANGIDFROMLCID( GetThreadLocale() ),
00974         (WCHAR*)&pszError,
00975         0,
00976         NULL );
00977
00978     if ( !dwFormatError )
00979        {
00980        WCHAR ErrorMsg[ MAX_STRING ];
00981        SafeStringPrintf( ErrorMsg, MAX_STRING, GetString( IDS_DISPLAYERRORCODE ), Hr );
00982
00983        MessageBox( hwnd, ErrorMsg, GetString( IDS_ERRORBOXTITLE ),
00984                    MB_OK | MB_ICONSTOP | MB_APPLMODAL );
00985        }
00986     else
00987        {
00988        MessageBox( hwnd, pszError, GetString( IDS_ERRORBOXTITLE ),
00989                    MB_OK | MB_ICONSTOP | MB_APPLMODAL );
00990        LocalFree( pszError );
00991        }
00992
00993     if ( bThrow )
00994         throw _com_error( Hr );
00995
00996 }
00997
00998 void BITSCheckHR( HWND hwnd, HRESULT Hr, bool bThrow )
00999 {
01000
01001    //
01002    // Provides automatic error code checking and dialog
01003    // for BITS specific errors
01004    //
01005
01006
01007    if (SUCCEEDED(Hr))
01008        return;
01009
01010    WCHAR * pszError = NULL;
01011    HRESULT hErrorHr =
01012    g_pManager->GetErrorDescription(
01013        Hr,
01014        LANGIDFROMLCID( GetThreadLocale() ),
01015        &pszError );
01016
01017    if ( FAILED(hErrorHr) || !pszError )
01018        {
01019
01020        WCHAR ErrorMsg[ MAX_STRING ];
01021        SafeStringPrintf( ErrorMsg, MAX_STRING, GetString( IDS_DISPLAYERRORCODE ), Hr );
01022
01023        MessageBox( hwnd, ErrorMsg, GetString( IDS_ERRORBOXTITLE ),
01024                    MB_OK | MB_ICONSTOP | MB_APPLMODAL );
01025
01026        }
01027
01028    else
01029        {
01030
01031        MessageBox( hwnd, pszError, GetString( IDS_ERRORBOXTITLE ),
01032                    MB_OK | MB_ICONSTOP | MB_APPLMODAL );
01033        CoTaskMemFree( pszError );
01034
01035        }
01036
01037
01038    if ( bThrow )
01039        throw _com_error( Hr );
01040 }
01041
01042 void
01043 DoCancel(
01044     HWND hwndDlg,
01045     bool PromptUser
01046     )
01047 {
01048
01049    //
01050    // Handle all the operations required to cancel the job.
01051    // This includes asking the user for confirmation.
01052    //
01053
01054    if ( PromptUser )
01055        {
01056
01057        int Result =
01058            MessageBox(
01059                hwndDlg,
01060                GetString( IDS_CANCELTEXT ),
01061                GetString( IDS_CANCELCAPTION ),
01062                MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2 | MB_APPLMODAL |
01063                MB_SETFOREGROUND | MB_TOPMOST );
01064
01065
01066        if ( IDYES != Result )
01067            return;
01068
01069        }
01070
01071    try
01072    {
01073        BITSCheckHR( hwndDlg, g_pJob->Cancel(), true );
01074    }
01075    catch( _com_error Error )
01076    {
01077        // If we can't cancel for some unknown reason,
01078        // don't exit
01079        return;
01080    }
01081
01082    DeleteStartupLink( g_JobId );
01083    PostQuitMessage( 0 );
01084 }
01085
01086 void
01087 DoFinish(
01088     HWND hwndDlg
01089     )
01090 {
01091
01092    //
01093    // Handles all the necessary work to complete
01094    // the download.
01095    //
01096
01097    try
01098    {
01099        BITSCheckHR( hwndDlg, g_pJob->Complete(), true );
01100    }
01101    catch( _com_error Error )
01102    {
01103        // If we can't finish/complete for some unknown reason,
01104        // don't exit
01105        return;
01106    }
01107
01108    DeleteStartupLink( g_JobId );
01109    PostQuitMessage( 0 );
01110
01111 }
01112
01113 void
01114 DoClose(
01115     HWND hwndDlg
01116     )
01117 {
01118     //
01119     // Handles an attempt by the user to close the sample.
01120     //
01121
01122     // Check to see if the download has finished,
01123     // if so don't let the user exit.
01124
01125     BG_JOB_STATE state;
01126     HRESULT hResult = g_pJob->GetState( &state );
01127
01128     if (FAILED( hResult ))
01129         {
01130         BITSCheckHR( hwndDlg, hResult, false );
01131         return;
01132         }
01133
01134     if ( BG_JOB_STATE_ERROR == state ||
01135          BG_JOB_STATE_TRANSFERRED == state )
01136         {
01137
01138         MessageBox(
01139             hwndDlg,
01140             GetString( IDS_ALREADYFINISHED ),
01141             GetString( IDS_ALREADYFINISHEDCAPTION ),
01142             MB_OK | MB_ICONERROR | MB_DEFBUTTON1 | MB_APPLMODAL |
01143             MB_SETFOREGROUND | MB_TOPMOST );
01144
01145
01146         return;
01147         }
01148
01149
01150     //
01151     // Inform the user that he selected close and ask
01152     // confirm the intention to exit.  Explain that the job
01153     // will be canceled.
01154
01155     int Result =
01156         MessageBox(
01157             hwndDlg,
01158             GetString( IDS_CLOSETEXT ),
01159             GetString( IDS_CLOSECAPTION ),
01160             MB_OKCANCEL | MB_ICONWARNING | MB_DEFBUTTON2 | MB_APPLMODAL |
01161             MB_SETFOREGROUND | MB_TOPMOST );
01162
01163     if ( IDOK == Result )
01164         {
01165
01166         // User confirmed the cancel, just do it.
01167
01168         DoCancel( hwndDlg, false );
01169         return;
01170         }
01171
01172     // The user didn't really want to exit, so ignore him
01173     else
01174         return;
01175
01176 }
01177
01178 void
01179 HandleTimerTick( HWND hwndDlg )
01180 {
01181
01182     //
01183     // Handle the throttling timer event
01184     // and update the dialog if needed
01185     //
01186
01187     if ( g_RefreshOnTimer )
01188         {
01189         // The timer fired, handle all updates at once.
01190         UpdateDialog( hwndDlg );
01191         g_RefreshOnTimer = FALSE;
01192         }
01193     else
01194         {
01195         // The timer expired with an additional modification
01196         // notification.  Just kill the timer.
01197         KillTimer( hwndDlg, 0 );
01198         g_RefreshOnTimer = g_UpdateTimerSet = FALSE;
01199         }
01200
01201 }
01202
01203 void
01204 HandleUpdate()
01205 {
01206
01207     //
01208     // Handle a update request, batching the update if needed
01209     //
01210
01211     if ( !g_UpdateTimerSet )
01212         {
01213         // We aren't currently batching updates,
01214         // so do this one update but prevent
01215         // further updates until the timer expires.
01216         SetTimer( g_hwndDlg, 0, 1000, NULL );
01217         g_UpdateTimerSet = TRUE;
01218         UpdateDialog( g_hwndDlg );
01219         }
01220     else
01221         {
01222         // We've started batching and yet received
01223         // another update request.  Delay this
01224         // update until the timer fires.
01225         g_RefreshOnTimer = TRUE;
01226         }
01227
01228 }
01229
01230 INT_PTR CALLBACK
01231 DialogProc(
01232   HWND hwndDlg,  // handle to dialog box
01233   UINT uMsg,     // message
01234   WPARAM wParam, // first message parameter
01235   LPARAM lParam  // second message parameter
01236   )
01237 {
01238
01239   //
01240   // Dialog proc for main dialog window
01241   //
01242
01243   switch( uMsg )
01244       {
01245
01246       case WM_INITDIALOG:
01247           g_hwndDlg = hwndDlg;
01248           InitDialog( hwndDlg );
01249           return TRUE;
01250
01251       case WM_TIMER:
01252           HandleTimerTick( hwndDlg );
01253           return TRUE;
01254
01255       case WM_CLOSE:
01256           DoClose( hwndDlg );
01257           return TRUE;
01258
01259       case WM_COMMAND:
01260
01261           switch( LOWORD( wParam ) )
01262               {
01263
01264               case IDC_RESUME:
01265                   BITSCheckHR( hwndDlg, g_pJob->Resume(), false );
01266                   return TRUE;
01267
01268               case IDC_SUSPEND:
01269                   BITSCheckHR( hwndDlg, g_pJob->Suspend(), false );
01270                   return TRUE;
01271
01272               case IDC_CANCEL:
01273                   DoCancel( hwndDlg, true );
01274                   return TRUE;
01275
01276               case IDC_FINISH:
01277                   DoFinish( hwndDlg );
01278                   return TRUE;
01279
01280               case IDC_PRIORITY:
01281                   switch( HIWORD( wParam ) )
01282                       {
01283
01284                       case CBN_SELENDOK:
01285
01286                           // User clicked on priority,
01287                           // update it.
01288
01289                           BITSCheckHR( hwndDlg,
01290                               g_pJob->SetPriority( (BG_JOB_PRIORITY)
01291                                   SendDlgItemMessage( hwndDlg, IDC_PRIORITY, CB_GETCURSEL, 0, 0 ) ), false );
01292                           return TRUE;
01293
01294                       case CBN_SELENDCANCEL:
01295                           return TRUE;
01296
01297                       default:
01298                           return FALSE;
01299                       }
01300
01301               default:
01302                   return FALSE;
01303               }
01304       default:
01305           return FALSE;
01306       }
01307 }
01308
01309 HRESULT
01310 HandleCOMCallback(
01311     IBackgroundCopyJob* pJob,
01312     bool CriticalEvent
01313     );
01314
01315 class CBackgroundCopyCallback : public IBackgroundCopyCallback
01316 {
01317
01318     //
01319     // Callback class.   Used for change notifications.
01320     //
01321
01322 public:
01323     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
01324     {
01325
01326         if ( riid == _uuidof(IUnknown) )
01327             {
01328             *ppvObject = (IUnknown*)(IBackgroundCopyCallback*)this;
01329             return S_OK;
01330             }
01331
01332         else if ( riid == _uuidof(IBackgroundCopyCallback) )
01333             {
01334             *ppvObject = (IBackgroundCopyCallback*)this;
01335             return S_OK;
01336             }
01337
01338         else
01339             return E_NOINTERFACE;
01340
01341     }
01342
01343     virtual HRESULT STDMETHODCALLTYPE CreateInstance(
01344         IUnknown *pUnkOuter,
01345         REFIID riid,
01346         void **ppvObject )
01347     {
01348
01349         if ( pUnkOuter )
01350             return CLASS_E_NOAGGREGATION;
01351
01352         return QueryInterface( riid, ppvObject );
01353
01354     }
01355
01356     // We are cheating on COM here, but we
01357     // are forcing the lifetime of the callback object
01358     // to be the same of the lifetime of the exe.
01359
01360     virtual ULONG STDMETHODCALLTYPE AddRef(void)
01361     {
01362         return 0;
01363     }
01364     virtual ULONG STDMETHODCALLTYPE Release(void)
01365     {
01366         return 0;
01367     }
01368
01369     virtual HRESULT STDMETHODCALLTYPE JobTransferred(IBackgroundCopyJob *pJob)
01370     {
01371         return HandleCOMCallback( pJob, true );
01372     }
01373
01374     virtual HRESULT STDMETHODCALLTYPE JobError(IBackgroundCopyJob *pJob, IBackgroundCopyError *pError)
01375     {
01376         return HandleCOMCallback( pJob, true );
01377     }
01378
01379     virtual HRESULT STDMETHODCALLTYPE JobModification( IBackgroundCopyJob *pJob, DWORD dwReserved )
01380     {
01381         return HandleCOMCallback( pJob, true );
01382     }
01383 } g_Callback;
01384
01385 HRESULT
01386 HandleCOMCallback(
01387     IBackgroundCopyJob* pJob,
01388     bool CriticalEvent
01389     )
01390 {
01391
01392     // In addition to the work of HandleUpdate,
01393     // this function checks to see if we've
01394     // already initialized the manager.  If not,
01395     // do it now.
01396
01397     if ( !g_pManager )
01398         {
01399
01400         try
01401         {
01402             CheckHR( NULL,
01403                      CoCreateInstance( CLSID_BackgroundCopyManager,
01404                          NULL,
01405                          CLSCTX_LOCAL_SERVER,
01406                          IID_IBackgroundCopyManager,
01407                          (void**)g_pManager.GetRecvPointer() ), true );
01408
01409             *g_pJob.GetRecvPointer() = pJob;
01410
01411             BITSCheckHR( NULL, g_pJob->SetNotifyFlags( BG_NOTIFY_JOB_MODIFICATION ), true );
01412
01413             // As an optimization, set the notification interface to be the callback
01414             // It shouldn't matter if this fails
01415             g_pJob->SetNotifyInterface( (IBackgroundCopyCallback*)&g_Callback );
01416
01417             HandleUpdate();
01418
01419             ShowWindow( g_hwndDlg, CriticalEvent ? SW_NORMAL : SW_MINIMIZE );
01420
01421         }
01422         catch(_com_error error )
01423         {
01424             g_pManager.Release();
01425             g_pJob.Release();
01426
01427             return error.Error();
01428         }
01429
01430         }
01431
01432     HandleUpdate();
01433     return S_OK;
01434 }
01435
01436 void
01437 CreateUI( int nShowCmd )
01438 {
01439
01440     //
01441     // Creates the dialog box for the sample.
01442     //
01443
01444     g_hwndDlg =
01445       CreateDialog(
01446          (HINSTANCE)GetModuleHandle(NULL),
01447          MAKEINTRESOURCE( IDD_DIALOG ),
01448          GetDesktopWindow(),
01449          DialogProc );
01450
01451     if ( !g_hwndDlg )
01452         CheckHR( NULL, HRESULT_FROM_WIN32(GetLastError()), true );
01453
01454     ShowWindow( g_hwndDlg, nShowCmd );
01455 }
01456
01457 void CreateJob(
01458     WCHAR* szJobURL
01459     )
01460 {
01461     //
01462     // Request a destination file name from the user
01463     // and submit a new job.
01464     //
01465
01466     try
01467     {
01468
01469         // crack the URL and get the filename
01470         WCHAR szURLFilePath[MAX_PATH] = {L'\0'};
01471         URL_COMPONENTS UrlComponents;
01472
01473         memset( &UrlComponents, 0, sizeof(UrlComponents) );
01474         UrlComponents.dwStructSize = sizeof(URL_COMPONENTS);
01475         UrlComponents.lpszUrlPath = szURLFilePath;
01476         UrlComponents.dwUrlPathLength =
01477             sizeof(szURLFilePath)/sizeof(*szURLFilePath);
01478
01479         BOOL CrackResult =
01480             InternetCrackUrl(
01481                 szJobURL,
01482                 0,
01483                 0,
01484                 &UrlComponents );
01485
01486         if (!CrackResult)
01487             CheckHR( NULL, HRESULT_FROM_WIN32( GetLastError() ), false );
01488
01489         if ( UrlComponents.nScheme != INTERNET_SCHEME_HTTP &&
01490              UrlComponents.nScheme != INTERNET_SCHEME_HTTPS
01491              )
01492             {
01493
01494             MessageBox(
01495                 NULL,
01496                 GetString( IDS_NOHTTPORHTTPS ),
01497                 GetString( IDS_ERRORBOXTITLE ),
01498                 MB_OK | MB_ICONERROR | MB_APPLMODAL |
01499                 MB_SETFOREGROUND | MB_TOPMOST );
01500
01501
01502             throw _com_error( E_INVALIDARG );
01503
01504             }
01505
01506         const WCHAR *szURLFileName =
01507             szURLFilePath + wcslen( szURLFilePath );
01508
01509         // parse out the filename part of the URL
01510         while( szURLFileName != szURLFilePath )
01511             {
01512
01513             if ( L'/' == *szURLFileName ||
01514                  L'\\' == *szURLFileName )
01515                 {
01516                 szURLFileName++;
01517                 break;
01518                 }
01519
01520             szURLFileName--;
01521             }
01522
01523     // This is needed in case the first
01524     // character is a slash.
01525         if ( L'/' == *szURLFileName ||
01526        L'\\' == *szURLFileName )
01527        szURLFileName++;
01528
01529         // parse out the extension from the name
01530         const WCHAR *szURLFileExtension =
01531             szURLFileName + wcslen( szURLFileName );
01532
01533         while( szURLFileName != szURLFileExtension )
01534             {
01535             if ( L'.' == *szURLFileExtension )
01536                 break;
01537             szURLFileExtension--;
01538             }
01539
01540         // build the extension list
01541
01542         WCHAR *szExtensionList = NULL;
01543         const WCHAR *szAllFiles = GetString( IDS_ALLFILES );
01544         const size_t AllFilesSize = wcslen( szAllFiles ) + 1;
01545         const WCHAR *szAllFilesPattern = L"*";
01546         const size_t AllFilesPatternSize = sizeof(L"*")/sizeof(WCHAR);
01547
01548         WCHAR *p;
01549
01550         if ( szURLFileExtension == szURLFileName &&
01551              *szURLFileExtension != L'.' )
01552             {
01553             size_t StringSize = sizeof(WCHAR) * ( AllFilesSize + AllFilesPatternSize + 2 );
01554             szExtensionList = (WCHAR*)_alloca( StringSize );
01555             p = szExtensionList;
01556             }
01557         else
01558             {
01559             size_t ExtensionSize = wcslen( szURLFileExtension ) + 1;
01560             size_t StringSize =
01561                 sizeof(WCHAR) * ( ExtensionSize + ExtensionSize + 1 + AllFilesSize
01562                                   + AllFilesPatternSize + 2 );
01563             szExtensionList = (WCHAR*)_alloca( StringSize );
01564             p = szExtensionList;
01565
01566             memcpy( p, szURLFileExtension, ExtensionSize * sizeof(WCHAR) );
01567             p += ExtensionSize;
01568             *p++ = L'*';
01569             memcpy( p, szURLFileExtension, ExtensionSize * sizeof(WCHAR) );
01570             p += ExtensionSize;
01571             }
01572
01573         memcpy( p, szAllFiles, AllFilesSize * sizeof(WCHAR) );
01574         p += AllFilesSize;
01575         memcpy( p, szAllFilesPattern, AllFilesPatternSize * sizeof(WCHAR) );
01576         p += AllFilesPatternSize;
01577         memset( p, 0, sizeof(WCHAR) * 2 );
01578
01579
01580         OPENFILENAME ofn;
01581         memset( &ofn, 0, sizeof( ofn ) );
01582
01583         WCHAR szFileName[MAX_PATH];
01584         WCHAR szFileTitle[MAX_PATH];
01585
01586         SafeCopy( szFileName, szURLFileName, MAX_PATH );
01587         SafeCopy( szFileTitle, szURLFileName, MAX_PATH );
01588
01589         /* fill in non-variant fields of OPENFILENAME struct. */
01590         ofn.lStructSize       = sizeof(OPENFILENAME);
01591         ofn.hwndOwner         = g_hwndDlg;
01592         ofn.lpstrFilter       = szExtensionList;
01593         ofn.lpstrCustomFilter = NULL;
01594         ofn.nMaxCustFilter    = 0;
01595         ofn.nFilterIndex      = 0;
01596         ofn.lpstrFile         = szFileName;
01597         ofn.nMaxFile          = MAX_PATH;
01598         ofn.lpstrInitialDir   = NULL;
01599         ofn.lpstrFileTitle    = szFileTitle;
01600         ofn.nMaxFileTitle     = MAX_PATH;
01601         ofn.lpstrTitle        = GetString( IDS_FILEDLGTITLE );
01602         ofn.lpstrDefExt       = NULL;
01603         ofn.Flags             = 0;
01604
01605         /* Use standard open dialog */
01606         BOOL bResult = GetSaveFileName ((LPOPENFILENAME)&ofn);
01607
01608         if ( !bResult )
01609             {
01610             if ( !CommDlgExtendedError() )
01611                 {
01612                 // user canceled the box
01613                 PostQuitMessage( 0 );
01614                 return;
01615                 }
01616             else
01617                 CheckHR( NULL, HRESULT_FROM_WIN32( GetLastError() ), true );
01618             }
01619
01620
01621         SafeCopy( g_szFileName, szFileTitle, MAX_STRING );
01622
01623         CheckHR( NULL,
01624                  CoCreateInstance( CLSID_BackgroundCopyManager,
01625                      NULL,
01626                      CLSCTX_LOCAL_SERVER,
01627                      IID_IBackgroundCopyManager,
01628                      (void**)g_pManager.GetRecvPointer() ), true );
01629
01630         GUID guid;
01631         BITSCheckHR( NULL,
01632             g_pManager->CreateJob( szJobURL,
01633                                  BG_JOB_TYPE_DOWNLOAD,
01634                                  &guid,
01635                                  g_pJob.GetRecvPointer() ),
01636                         true );
01637
01638         memset( &g_JobId, 0, sizeof(GUID) );
01639         BITSCheckHR( NULL, g_pJob->GetId( &g_JobId ), true );
01640         BITSCheckHR( NULL, g_pJob->AddFile( szJobURL, szFileName ), true );
01641
01642         CreateStartupLink( g_JobId, g_szFileName );
01643
01644         BITSCheckHR( NULL, g_pJob->SetNotifyFlags( BG_NOTIFY_JOB_MODIFICATION ), true );
01645
01646         BITSCheckHR( NULL,
01647                      g_pJob->SetNotifyInterface( (IBackgroundCopyCallback*)&g_Callback ),
01648                      true );
01649         BITSCheckHR( NULL, g_pJob->Resume(), true );
01650
01651         HandleUpdate();
01652
01653     }
01654     catch( const _com_error &error )
01655     {
01656         if ( g_pJob )
01657             {
01658             g_pJob->Cancel();
01659             DeleteStartupLink( g_JobId );
01660             }
01661
01662         throw error;
01663     }
01664
01665 }
01666
01667 void ResumeJob(
01668     WCHAR* szJobGUID,
01669     WCHAR* szJobFileName
01670     )
01671 {
01672
01673     //
01674     // Resume the display on an existing job
01675     //
01676
01677     SafeCopy( g_szFileName, szJobFileName, MAX_PATH );
01678     CheckHR( NULL, IIDFromString( szJobGUID, &g_JobId ), true );
01679
01680     CheckHR( NULL,
01681              CoCreateInstance( CLSID_BackgroundCopyManager,
01682                  NULL,
01683                  CLSCTX_LOCAL_SERVER,
01684                  IID_IBackgroundCopyManager,
01685                  (void**)g_pManager.GetRecvPointer() ), true );
01686
01687     BITSCheckHR( NULL, g_pManager->GetJob( g_JobId, g_pJob.GetRecvPointer() ), true );
01688     BITSCheckHR( NULL,
01689                  g_pJob->SetNotifyInterface( (IBackgroundCopyCallback*)&g_Callback ),
01690                  true );
01691     BITSCheckHR( NULL, g_pJob->SetNotifyFlags( BG_NOTIFY_JOB_MODIFICATION ), true );
01692
01693     ShowWindow( g_hwndDlg, SW_MINIMIZE );
01694     HandleUpdate();
01695
01696 }
01697
01698 int WINAPI WinMain(
01699   HINSTANCE hInstance,      // handle to current instance
01700   HINSTANCE hPrevInstance,  // handle to previous instance
01701   LPSTR lpCmdLine,          // command line
01702   int nCmdShow)             // show state
01703 {
01704
01705   //
01706   // Expected syntax:
01707   // bits_ie /CREATEJOB URL
01708   // bits_ie /RESUMEJOB JobGUID DestinationFile
01709
01710   // /CREATEJOB - Called from the script which is run when
01711   //              "Background Download As" is selected.
01712   // /RESUMEJOB - Called from the link in the startup directory
01713   //              to resume a job when it is restarted.
01714
01715   try
01716   {
01717       CheckHR( NULL, CoInitialize(NULL), true );
01718
01719       InitCommonControls();
01720
01721       CreateUI( nCmdShow );
01722
01723       LPTSTR lpCommandLine = GetCommandLine();
01724
01725       int argc;
01726       WCHAR **argv =
01727           CommandLineToArgvW(
01728               lpCommandLine,
01729               &argc );
01730
01731       if ( argc < 2 )
01732           CheckHR( NULL, E_INVALIDARG, true );
01733
01734       if ( argc == 3 &&
01735            _wcsicmp( L"/CREATEJOB", argv[1] ) == 0 )
01736           CreateJob( argv[2] );
01737
01738       else if ( argc == 4 &&
01739                 _wcsicmp( L"/RESUMEJOB", argv[1] ) == 0 )
01740           ResumeJob( argv[2], argv[3] );
01741
01742       else
01743           CheckHR( NULL, E_INVALIDARG, true );
01744
01745       MSG msg;
01746       while( GetMessage( &msg, NULL, 0, 0 ) )
01747       {
01748           TranslateMessage( &msg );
01749           DispatchMessage( &msg );
01750       }
01751
01752   }
01753   catch(_com_error error )
01754   {
01755       return -1;
01756   }
01757
01758   return 0;
01759 }
01760
01761
01762
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

qcnotify::_ShipStatus Member List

This is the complete list of members for qcnotify::_ShipStatus, including all inherited members.
ssBackOrdered | qcnotify::_ShipStatus | [static]
ssNotStocked | qcnotify::_ShipStatus | [static]
ssShipped | qcnotify::_ShipStatus | [static]
ssUnprocessed | qcnotify::_ShipStatus | [static]
ssUnrecognizedItem | qcnotify::_ShipStatus | [static]
Generated on Wed Nov 13 2024 16:58:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/qcsub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

qcsub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __QCSUB_H__
00018 #define __QCSUB_H__
00019
00020 #include "resource.h"       // main symbols
00021
00022 CComBSTR GuidToBstr(REFGUID guid);
00023
00024 class CComSpy;
00025
00026 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00027 Class:   CQCSub
00028 Summary: Queued Components Events Subscriber
00029 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00030 class ATL_NO_VTABLE CQCSub :
00031   public CSysLCESub,
00032   public IComQCEvents
00033 {
00034 public:
00035   CQCSub(CComSpy * pSpy)
00036   {
00037     m_pSpy = pSpy;
00038   }
00039
00040   CQCSub()
00041   {
00042     m_pSpy = NULL;
00043   }
00044
00045   DECLARE_NOT_AGGREGATABLE(CQCSub)
00046   DECLARE_GET_CONTROLLING_UNKNOWN()
00047
00048   BEGIN_COM_MAP(CQCSub)
00049     COM_INTERFACE_ENTRY(IComQCEvents)
00050     COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00051   END_COM_MAP()
00052
00053   STDMETHODIMP GetEventType(EventEnum * e){*e = QC;return S_OK;}
00054   STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00055   STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComQCEvents;return S_OK;}
00056
00057   STDMETHODIMP OnQCRecord
00058      (COMSVCSEVENTINFO * pInfo,
00059     ULONG64 objid,
00060     WCHAR szQueue[60],
00061     REFGUID guidMsgId,
00062     REFGUID guidWorkFlowId,
00063     HRESULT msmqhr)
00064   {
00065     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnQCRecord"), GuidToBstr(pInfo->guidApp));
00066
00067
00068     CComBSTR sGuidMsgId = GuidToBstr(guidMsgId);
00069     CComBSTR sGuidWorkFlowId = GuidToBstr(guidWorkFlowId);
00070
00071     WCHAR szObjectID[32];
00072     wsprintfW(szObjectID, L"0x%016X", objid);
00073     m_pSpy -> AddParamValueToList(L"ObjectID", szObjectID);
00074
00075     m_pSpy -> AddParamValueToList(L"Queue", szQueue);
00076     m_pSpy -> AddParamValueToList(L"MsgId", sGuidMsgId);
00077     m_pSpy -> AddParamValueToList(L"WorkflowId", sGuidWorkFlowId);
00078
00079     WCHAR szHr[16];
00080     wsprintfW(szHr, L"0x%08X", msmqhr);
00081     m_pSpy -> AddParamValueToList(L"MSMQ HR", szHr);
00082
00083     IF_AUDIT_DO(OnQCRecord)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00084                 szObjectID,
00085                 szQueue,
00086                 sGuidMsgId,
00087                 sGuidWorkFlowId,
00088                 msmqhr);
00089
00090     return S_OK;
00091   }
00092
00093   STDMETHODIMP OnQCQueueOpen
00094      (COMSVCSEVENTINFO * pInfo,
00095     WCHAR szQueue[60],
00096     ULONG64 QueueID,
00097     HRESULT msmqhr)
00098   {
00099
00100     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnQCQueueOpen"), GuidToBstr(pInfo->guidApp));
00101     m_pSpy -> AddParamValueToList(L"Queue", szQueue);
00102
00103     WCHAR szQueueID[32];
00104     wsprintfW(szQueueID, L"0x%016X", QueueID);
00105     m_pSpy -> AddParamValueToList(L"QueueID", szQueueID);
00106
00107     WCHAR p1[16];
00108     wsprintfW(p1, L"0x%08X", msmqhr);
00109     m_pSpy -> AddParamValueToList(L"MSMQ HR", p1);
00110
00111     IF_AUDIT_DO(OnQCQueueOpen)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00112                   szQueue,
00113                   szQueueID,
00114                   msmqhr);
00115
00116     return S_OK;
00117   }
00118   STDMETHODIMP OnQCReceive
00119      (COMSVCSEVENTINFO * pInfo,
00120     ULONG64 QueueID,
00121     REFGUID guidMsgId,
00122     REFGUID guidWorkFlowId,
00123     HRESULT msmqhr)
00124   {
00125     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnQCReceive"), GuidToBstr(pInfo->guidApp));
00126
00127     CComBSTR sGuidMsgId = GuidToBstr(guidMsgId);
00128     CComBSTR sGuidWorkFlowId = GuidToBstr(guidWorkFlowId);
00129
00130
00131     WCHAR szQueueID[32];
00132     wsprintfW(szQueueID, L"0x%016X", QueueID);
00133     m_pSpy -> AddParamValueToList(L"QueueID", szQueueID);
00134
00135     m_pSpy -> AddParamValueToList(L"MsgId", sGuidMsgId);
00136     m_pSpy -> AddParamValueToList(L"WorkflowId", sGuidWorkFlowId);
00137
00138     WCHAR p1[16];
00139     wsprintfW(p1, L"0x%08X", msmqhr);
00140     m_pSpy -> AddParamValueToList(L"MSMQ HR", p1);
00141
00142
00143     IF_AUDIT_DO(OnQCReceive)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00144                   szQueueID,
00145                   sGuidMsgId,
00146                   sGuidWorkFlowId,
00147                   msmqhr);
00148     return S_OK;
00149   }
00150
00151   STDMETHODIMP OnQCReceiveFail
00152      (COMSVCSEVENTINFO * pInfo,
00153     ULONG64 QueueID,
00154     HRESULT msmqhr)
00155   {
00156
00157     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnQCReceiveFail"), GuidToBstr(pInfo->guidApp));
00158
00159     WCHAR szQueueID[32];
00160     wsprintfW(szQueueID, L"0x%016X", QueueID);
00161     m_pSpy -> AddParamValueToList(L"QueueID", szQueueID);
00162
00163     WCHAR p1[16];
00164     wsprintfW(p1, L"0x%08X", msmqhr);
00165     m_pSpy -> AddParamValueToList(L"MSMQ HR", p1);
00166
00167     IF_AUDIT_DO(OnQCReceiveFail)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00168                   szQueueID,
00169                   msmqhr);
00170     return S_OK;
00171   }
00172   STDMETHODIMP OnQCMoveToReTryQueue
00173      (COMSVCSEVENTINFO * pInfo,
00174     REFGUID guidMsgId,
00175     REFGUID guidWorkFlowId,
00176     ULONG RetryIndex)
00177   {
00178     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnQCMoveToReTryQueue"), GuidToBstr(pInfo->guidApp));
00179
00180     CComBSTR sGuidMsgId = GuidToBstr(guidMsgId);
00181     CComBSTR sGuidWorkFlowId = GuidToBstr(guidWorkFlowId);
00182
00183     m_pSpy -> AddParamValueToList(L"MsgId", sGuidMsgId);
00184     m_pSpy -> AddParamValueToList(L"WorkflowId", sGuidWorkFlowId);
00185
00186     WCHAR p1[16];
00187     wsprintfW(p1, L"0x%08X", RetryIndex);
00188     m_pSpy -> AddParamValueToList(L"ReTry Index", p1);
00189
00190     IF_AUDIT_DO(OnQCMoveToReTryQueue)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00191                   sGuidMsgId,
00192                   sGuidWorkFlowId,
00193                   RetryIndex);
00194
00195     return S_OK;
00196   }
00197   STDMETHODIMP OnQCMoveToDeadQueue
00198      (COMSVCSEVENTINFO * pInfo,
00199     REFGUID guidMsgId,
00200     REFGUID guidWorkFlowId)
00201   {
00202     CComBSTR sGuidMsgId = GuidToBstr(guidMsgId);
00203     CComBSTR sGuidWorkFlowId = GuidToBstr(guidWorkFlowId);
00204     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnQCMoveToDeadQueue"), GuidToBstr(pInfo->guidApp));
00205     m_pSpy -> AddParamValueToList(L"MsgId", sGuidMsgId);
00206     m_pSpy -> AddParamValueToList(L"WorkflowId", sGuidWorkFlowId);
00207
00208     IF_AUDIT_DO(OnQCMoveToDeadQueue)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00209                     sGuidMsgId,
00210                     sGuidWorkFlowId);
00211
00212
00213     return S_OK;
00214   }
00215
00216   STDMETHODIMP OnQCPlayback
00217      (COMSVCSEVENTINFO * pInfo,
00218     ULONG64 objid,
00219     REFGUID guidMsgId,
00220     REFGUID guidWorkFlowId,
00221     HRESULT msmqhr)
00222   {
00223
00224     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnQCPlayback"), GuidToBstr(pInfo->guidApp));
00225
00226     CComBSTR sGuidMsgId = GuidToBstr(guidMsgId);
00227     CComBSTR sGuidWorkFlowId = GuidToBstr(guidWorkFlowId);
00228
00229     WCHAR szObjectID[32];
00230     wsprintfW(szObjectID, L"0x%016X", objid);
00231     m_pSpy -> AddParamValueToList(L"ObjectID", szObjectID);
00232
00233     m_pSpy -> AddParamValueToList(L"MsgId", sGuidMsgId);
00234     m_pSpy -> AddParamValueToList(L"WorkflowId", sGuidWorkFlowId);
00235
00236     WCHAR p1[16];
00237     wsprintfW(p1, L"0x%08X", msmqhr);
00238     m_pSpy -> AddParamValueToList(L"MSMQ HR", p1);
00239
00240     IF_AUDIT_DO(OnQCPlayback)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00241                     szObjectID,
00242                     sGuidMsgId,
00243                     sGuidWorkFlowId,
00244                     msmqhr);
00245
00246     return S_OK;
00247   }
00248
00249 };
00250
00251 #endif //__QCSUB_H__
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/registry.Cpp Source File

  • SysMgmt
  • MMC
  • Complete

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021 #include "Extend.h"
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 // we need access to our g_nodes
00028 extern NODESTRUCT g_Nodes[];
00029
00030 ////////////////////////////////////////////////////////
00031 //
00032 // Internal helper functions prototypes
00033 //
00034
00035 // Set the given key and its value.
00036 BOOL setKeyAndValue(const _TCHAR* pszPath,
00037                     const _TCHAR* szSubkey,
00038                     const _TCHAR* szValue) ;
00039
00040 // Set the given key and its value in the MMC Snapin location
00041 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00042                           const _TCHAR* szSubkey,
00043                           const _TCHAR* szName,
00044                           const _TCHAR* szValue);
00045
00046 BOOL setSnapInExtensionNode(const _TCHAR* szSnapID,
00047                             const _TCHAR* szNodeID,
00048                             const _TCHAR* szDescription);
00049
00050 // Set the given valuename under the key to value
00051 BOOL setValue(const _TCHAR* szKey,
00052               const _TCHAR* szValueName,
00053               const _TCHAR* szValue);
00054
00055 // Delete szKeyChild and all of its descendents.
00056 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00057
00058 ////////////////////////////////////////////////////////
00059 //
00060 // Constants
00061 //
00062
00063 // Size of a CLSID as a string
00064 //const int CLSID_STRING_SIZE = 39 ;
00065
00066 /////////////////////////////////////////////////////////
00067 //
00068 // Public function implementation
00069 //
00070
00071 //
00072 // Register the component in the registry.
00073 //
00074 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00075                        const CLSID& clsid,         // Class ID
00076                        const _TCHAR* szFriendlyName)       //   IDs
00077 {
00078     // Get server location.
00079     _TCHAR szModule[512] ;
00080     DWORD dwResult =
00081         ::GetModuleFileName(hModule,
00082         szModule,
00083         sizeof(szModule)/sizeof(_TCHAR)) ;
00084
00085     assert(dwResult != 0) ;
00086
00087     // Get CLSID
00088     LPOLESTR wszCLSID = NULL ;
00089     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00090
00091     assert(SUCCEEDED(hr)) ;
00092
00093     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00094
00095     // Build the key CLSID\\{...}
00096     _TCHAR szKey[64] ;
00097     _tcscpy(szKey, _T("CLSID\\")) ;
00098         _tcscat(szKey, pszCLSID) ;
00099
00100     // Add the CLSID to the registry.
00101     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00102
00103     // Add the server filename subkey under the CLSID key.
00104     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00105
00106     // set the threading model
00107     _tcscat(szKey, _T("\\InprocServer32"));
00108     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00109
00110     // Free memory.
00111     CoTaskMemFree(wszCLSID) ;
00112
00113     return S_OK ;
00114 }
00115
00116 //
00117 // Remove the component from the registry.
00118 //
00119 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00120 {
00121     // Get CLSID
00122     LPOLESTR wszCLSID = NULL ;
00123     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00124
00125
00126     // Build the key CLSID\\{...}
00127     _TCHAR szKey[64] ;
00128     _tcscpy(szKey, _T("CLSID\\")) ;
00129
00130         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00131         _tcscat(szKey, pszT) ;
00132
00133     // Delete the CLSID Key - CLSID\{...}
00134     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00135     assert((lResult == ERROR_SUCCESS) ||
00136                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00137
00138     // Free memory.
00139     CoTaskMemFree(wszCLSID) ;
00140
00141     return S_OK ;
00142 }
00143
00144 //
00145 // Register the snap-in in the registry.
00146 //
00147 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00148                        const _TCHAR* szNameString,   // NameString
00149                        const CLSID& clsidAbout)         // Class Id for About Class
00150
00151 {
00152     // Get CLSID
00153     LPOLESTR wszCLSID = NULL ;
00154     LPOLESTR wszAboutCLSID = NULL;
00155     LPOLESTR wszExtendCLSID = NULL;
00156     NODESTRUCT *pNode;
00157
00158     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00159
00160     if (IID_NULL != clsidAbout)
00161         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00162
00163     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00164     MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00165
00166
00167     // Add the CLSID to the registry.
00168     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00169     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00170     if (IID_NULL != clsidAbout)
00171         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00172
00173     // register each of the node types in g_Nodes as an extendable node
00174     for (pNode = &(g_Nodes[0]);*pNode->szDescription;pNode++)
00175     {
00176         hr = StringFromCLSID(pNode->GUID, &wszExtendCLSID);
00177         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00178         setSnapInExtensionNode(pszCLSID, pszExtendCLSID, pNode->szDescription);
00179         CoTaskMemFree(wszExtendCLSID);
00180     }
00181
00182     // Free memory.
00183     CoTaskMemFree(wszCLSID) ;
00184     if (IID_NULL != clsidAbout)
00185         CoTaskMemFree(wszAboutCLSID);
00186
00187     return S_OK ;
00188 }
00189
00190 //
00191 // Unregister the snap-in in the registry.
00192 //
00193 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00194 {
00195     _TCHAR szKeyBuf[1024];
00196     LPOLESTR wszCLSID = NULL;
00197
00198     // Get CLSID
00199     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00200     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00201
00202     // Load the buffer with the Snap-In Location
00203     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00204
00205     // Copy keyname into buffer.
00206     _tcscat(szKeyBuf, _T("\\"));
00207     _tcscat(szKeyBuf, pszCLSID);
00208
00209     // Delete the CLSID Key - CLSID\{...}
00210     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00211     assert((lResult == ERROR_SUCCESS) ||
00212                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00213
00214   //Uncomment following for loop to unregister all extendable node types
00215   //Note that if a snap-in's extendable node types are unregistered,
00216   //any extension snap-ins for these node types will have to be re-registered
00217   //in order to rebuild their entries under the SOFTWARE\Microsoft\MMC\NodeTypes key
00218
00219 /*
00220     // Unregister each of the node types in g_Nodes as an extendable node
00221
00222     NODESTRUCT *pNode;
00223   LPOLESTR wszExtendCLSID = NULL;
00224
00225     for (pNode = &(g_Nodes[0]);*pNode->szDescription;pNode++)
00226     {
00227         hr = StringFromCLSID(pNode->GUID, &wszExtendCLSID);
00228         // Load the buffer with the Snap-In Location
00229         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00230         _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00231         // Copy keyname into buffer.
00232         _tcscat(szKeyBuf, pszExtendCLSID);
00233         recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00234         CoTaskMemFree(wszExtendCLSID);
00235     }
00236 */
00237
00238
00239     // free the memory
00240     CoTaskMemFree(wszCLSID);
00241
00242     return S_OK;
00243 }
00244
00245 //
00246 // Delete a key and all of its descendents.
00247 //
00248 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00249                         const _TCHAR* lpszKeyChild)  // Key to delete
00250 {
00251     // Open the child.
00252     HKEY hKeyChild ;
00253     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00254         KEY_ALL_ACCESS, &hKeyChild) ;
00255     if (lRes != ERROR_SUCCESS)
00256     {
00257         return lRes ;
00258     }
00259
00260     // Enumerate all of the decendents of this child.
00261     FILETIME time ;
00262     _TCHAR szBuffer[256] ;
00263     DWORD dwSize = 256 ;
00264     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00265         NULL, NULL, &time) == S_OK)
00266     {
00267         // Delete the decendents of this child.
00268         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00269         if (lRes != ERROR_SUCCESS)
00270         {
00271             // Cleanup before exiting.
00272             RegCloseKey(hKeyChild) ;
00273             return lRes;
00274         }
00275         dwSize = 256 ;
00276     }
00277
00278     // Close the child.
00279     RegCloseKey(hKeyChild) ;
00280
00281     // Delete this child.
00282     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00283 }
00284
00285 //
00286 // Create a key and set its value.
00287 //   - This helper function was borrowed and modifed from
00288 //     Kraig Brockschmidt's book Inside OLE.
00289 //
00290 BOOL setKeyAndValue(const _TCHAR* szKey,
00291                     const _TCHAR* szSubkey,
00292                     const _TCHAR* szValue)
00293 {
00294     HKEY hKey;
00295     _TCHAR szKeyBuf[1024] ;
00296
00297     // Copy keyname into buffer.
00298     _tcscpy(szKeyBuf, szKey) ;
00299
00300     // Add subkey name to buffer.
00301     if (szSubkey != NULL)
00302     {
00303         _tcscat(szKeyBuf, _T("\\")) ;
00304         _tcscat(szKeyBuf, szSubkey ) ;
00305     }
00306
00307     // Create and open key and subkey.
00308     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00309         szKeyBuf,
00310         0, NULL, REG_OPTION_NON_VOLATILE,
00311         KEY_ALL_ACCESS, NULL,
00312         &hKey, NULL) ;
00313     if (lResult != ERROR_SUCCESS)
00314     {
00315         return FALSE ;
00316     }
00317
00318     // Set the Value.
00319     if (szValue != NULL)
00320     {
00321         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00322             (BYTE *)szValue,
00323             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00324     }
00325
00326     RegCloseKey(hKey) ;
00327     return TRUE ;
00328 }
00329
00330 //
00331 // Open a key value and set it
00332 //
00333 BOOL setValue(const _TCHAR* szKey,
00334               const _TCHAR* szValueName,
00335               const _TCHAR* szValue)
00336 {
00337     HKEY hKey;
00338     _TCHAR szKeyBuf[1024] ;
00339
00340     // Copy keyname into buffer.
00341     _tcscpy(szKeyBuf, szKey) ;
00342
00343     // Create and open key and subkey.
00344     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00345         szKeyBuf,
00346         0, NULL, REG_OPTION_NON_VOLATILE,
00347         KEY_ALL_ACCESS, NULL,
00348         &hKey, NULL) ;
00349     if (lResult != ERROR_SUCCESS)
00350     {
00351         return FALSE ;
00352     }
00353
00354     // Set the Value.
00355     if (szValue != NULL)
00356     {
00357         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00358             (BYTE *)szValue,
00359             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00360     }
00361
00362     RegCloseKey(hKey) ;
00363     return TRUE ;
00364 }
00365
00366 //
00367 // Create a key and set its value.
00368 //   - This helper function was borrowed and modifed from
00369 //     Kraig Brockschmidt's book Inside OLE.
00370 //
00371 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00372                           const _TCHAR* szSubkey,
00373                           const _TCHAR* szName,
00374                           const _TCHAR* szValue)
00375 {
00376     HKEY hKey;
00377     _TCHAR szKeyBuf[1024] ;
00378
00379     // Load the buffer with the Snap-In Location
00380     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00381
00382     // Copy keyname into buffer.
00383     _tcscat(szKeyBuf, _T("\\")) ;
00384     _tcscat(szKeyBuf, szKey) ;
00385
00386     // Add subkey name to buffer.
00387     if (szSubkey != NULL)
00388     {
00389         _tcscat(szKeyBuf, _T("\\")) ;
00390         _tcscat(szKeyBuf, szSubkey ) ;
00391     }
00392
00393     // Create and open key and subkey.
00394     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00395         szKeyBuf,
00396         0, NULL, REG_OPTION_NON_VOLATILE,
00397         KEY_ALL_ACCESS, NULL,
00398         &hKey, NULL) ;
00399     if (lResult != ERROR_SUCCESS)
00400     {
00401         return FALSE ;
00402     }
00403
00404     // Set the Value.
00405     if (szValue != NULL)
00406     {
00407         RegSetValueEx(hKey, szName, 0, REG_SZ,
00408             (BYTE *)szValue,
00409             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00410     }
00411
00412     RegCloseKey(hKey) ;
00413     return TRUE ;
00414 }
00415
00416 BOOL setSnapInExtensionNode(const _TCHAR* szSnapID,
00417                             const _TCHAR* szNodeID,
00418                             const _TCHAR* szDescription)
00419 {
00420     HKEY hKey;
00421     _TCHAR szSnapNodeKeyBuf[1024] ;
00422     _TCHAR szMMCNodeKeyBuf[1024];
00423
00424     // Load the buffer with the Snap-In Location
00425     _tcscpy(szSnapNodeKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns\\"));
00426     // add in the clisid into buffer.
00427     _tcscat(szSnapNodeKeyBuf, szSnapID) ;
00428     _tcscat(szSnapNodeKeyBuf, _T("\\NodeTypes\\"));
00429     _tcscat(szSnapNodeKeyBuf, szNodeID) ;
00430
00431     // Load the buffer with the NodeTypes Location
00432     _tcscpy(szMMCNodeKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00433     _tcscat(szMMCNodeKeyBuf, szNodeID) ;
00434
00435     // Create and open the Snapin Key.
00436     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00437         szSnapNodeKeyBuf,
00438         0, NULL, REG_OPTION_NON_VOLATILE,
00439         KEY_ALL_ACCESS, NULL,
00440         &hKey, NULL) ;
00441     if (lResult != ERROR_SUCCESS)
00442     {
00443         return FALSE ;
00444     }
00445
00446     // Set the Value.
00447     if (szDescription != NULL)
00448     {
00449         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00450             (BYTE *)szDescription,
00451             (_tcslen(szDescription)+1)*sizeof(_TCHAR)) ;
00452     }
00453
00454     RegCloseKey(hKey) ;
00455
00456     // Create and open the NodeTypes Key.
00457     lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00458         szMMCNodeKeyBuf,
00459         0, NULL, REG_OPTION_NON_VOLATILE,
00460         KEY_ALL_ACCESS, NULL,
00461         &hKey, NULL) ;
00462     if (lResult != ERROR_SUCCESS)
00463     {
00464         return FALSE ;
00465     }
00466
00467     // Set the Value.
00468     if (szDescription != NULL)
00469     {
00470         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00471             (BYTE *)szDescription,
00472             (_tcslen(szDescription)+1)*sizeof(_TCHAR)) ;
00473     }
00474
00475     RegCloseKey(hKey) ;
00476
00477     return TRUE ;
00478 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRichEditLite Member List

This is the complete list of members for CRichEditLite, including all inherited members.
Append(LPCWSTR pwszString, bool bCanUndo=TRUE, DWORD dwMask=0, DWORD dwColor=0) | CRichEditLite | [virtual]
CanPaste() | CEditBoxLite | [inline]
CConsole() | CConsole | [inline]
CEditBoxLite(HWND hWndParent=NULL, UINT nID=0) | CEditBoxLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Copy() | CEditBoxLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CRichEditLite(HWND hWndParent=NULL, UINT nID=0) | CRichEditLite |
CSplitterLite(HWND hWndParent=NULL, UINT nID=0) | CSplitterLite |
Cut() | CEditBoxLite | [inline]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient) | CSplitterLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
FindNext(DWORD dwFindFlags, WCHAR *pwszText) | CRichEditLite | [virtual]
FindText(DWORD dwFindFlags, FINDTEXTEXW *pFINDTEXT) | CRichEditLite | [virtual]
GetConsole() | CConsole | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetLine(INDEX iLine, CHAR *pszBuffer, ULONG ulMaxSize) | CEditBoxLite |
GetLineCount() | CEditBoxLite | [inline]
GetSel(INDEX *piMin, INDEX *piMax) | CRichEditLite | [inline, virtual]
GetSel(CHARRANGE *pcr) | CRichEditLite | [inline, virtual]
CEditBoxLite::GetSel(INDEX *piMin, INDEX *piMax) | CEditBoxLite | [inline, virtual]
CEditBoxLite::GetSel(CHARRANGE *pcr) | CEditBoxLite | [inline, virtual]
GetSelectedText(BOOL fEntireLine=TRUE) | CRichEditLite |
GetTextRange(CHARRANGE &cr, WCHAR *pwszBuffer) | CEditBoxLite |
GetTextRange(CHARRANGE &cr, CHAR *pszBuffer) | CEditBoxLite |
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
LineFromChar(INDEX nIndex) | CRichEditLite | [inline]
LineIndex(INDEX nLine) | CEditBoxLite | [inline]
LineLength(INDEX nStartChar) | CEditBoxLite | [inline]
LineScroll(INDEX nLines, INDEX nChars=0) | CEditBoxLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hCursorOld | CSplitterLite |
m_hCursorRight | CSplitterLite |
m_hCursorTop | CSplitterLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iBorderCX | CSplitterLite |
m_iBorderCY | CSplitterLite |
m_nID | CWndLite |
m_pCWndBottom | CSplitterLite |
m_pCWndLeft | CSplitterLite |
m_pCWndRight | CSplitterLite |
m_pCWndTop | CSplitterLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_pwszNewLine | CConsole | [protected]
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnBorder(REFPOINTS pts, INT iBorder) | CSplitterLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CRichEditLite | [virtual]
CEditBoxLite::OnCreate(CREATESTRUCT *pCREATESTRUCT) | CEditBoxLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLink(INT idCtrl, ENLINK *pEnLink) | CRichEditLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CRichEditLite | [virtual]
CEditBoxLite::OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
operator<<(LPCWSTR pwsz) | CConsole | [inline, virtual]
operator<<(COLORREF refColor) | CConsole | [inline, virtual]
operator<<(COLORA attColor) | CConsole | [inline, virtual]
Paste() | CEditBoxLite | [inline]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
ReplaceAll(LPCWSTR pwszString, bool bReplaceAll=FALSE, bool fHighlight=FALSE) | CEditBoxLite | [virtual]
ReplaceSel(LPCWSTR pwszString, bool bCanUndo) | CRichEditLite | [inline, virtual]
ReplaceSel(LPCWSTR pwszString, bool bCanUndo, DWORD dwMask, DWORD dwColor) | CRichEditLite | [virtual]
CEditBoxLite::ReplaceSel(LPCWSTR pwszString, bool bCanUndo) | CEditBoxLite | [inline, virtual]
Save(LPCWSTR pwszFileName) | CEditBoxLite |
ScrollCaret() | CEditBoxLite | [inline]
SetCharFormat(DWORD dwMask, CHARFORMATW &charFormatW) | CRichEditLite |
SetColor(COLORREF refColor) | CRichEditLite | [inline, virtual]
SetColorAttrib(COLORA attColor, BOOL fEnable=TRUE) | CRichEditLite | [inline, virtual]
SetDefaultFont() | CRichEditLite |
SetEffects(DWORD dwMask, DWORD dwEffects, COLORREF crTextColor) | CRichEditLite |
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetOptions(UINT dwOptions, UINT fOperation=ECOOP_OR) | CEditBoxLite | [inline]
SetReadOnly(bool bReadOnly) | CEditBoxLite | [inline]
SetSel(INDEX iMin, INDEX iMax) | CRichEditLite | [inline, virtual]
CEditBoxLite::SetSel(INDEX iMin, INDEX iMax) | CEditBoxLite | [inline, virtual]
SetSplitter(CSplitterLite *pCWndTop, CSplitterLite *pCWndBottom=NULL, CSplitterLite *pCWndLeft=NULL, CSplitterLite *pCWndRight=NULL) | CSplitterLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
SetWordWrap(BOOL fWordWrap) | CRichEditLite | [virtual]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT *pPoint) | CSplitterLite | [virtual]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
Write(LPCWSTR pwszText) | CRichEditLite | [inline, virtual]
WriteLine(LPCWSTR pwsz=NULL) | CConsole | [inline, virtual]
~CConsole() | CConsole | [inline, virtual]
~CEditBoxLite() | CEditBoxLite | [virtual]
~CRichEditLite() | CRichEditLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmMonitor/Resource.h Source File

  • Com
  • Services
  • Crm
  • CrmMonitor

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by CrmMonComp.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_CRMMONCOMP                  101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditHost/resource.h Source File

  • Web
  • Browser
  • EditHost

resource.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 //{{NO_DEPENDENCIES}}
00006 // Microsoft Developer Studio generated include file.
00007 // Used by EdHost.rc
00008 //
00009 #define IDS_PROJNAME                    100
00010 #define IDR_EdHost                      100
00011 #define IDR_BROWSERHOST                 101
00012 #define IDR_TOOLBAR1                    201
00013 #define IDR_SNAP                        249
00014 #define IDR_GRID                        250
00015 #define ID_BUTTON1                      32768
00016 #define ID_BUTTON2                      32769
00017 #define ID_BUTTON3                      32770
00018 #define ID_TOOLBARWND                   32772
00019 #define ID_URLBOX                       32774
00020 #define ID_BUTTON4                      32776
00021 #define ID_BUTTON5                      32778
00022 #define ID_SNAPINCBOX                   32780
00023
00024 // Next default values for new objects
00025 //
00026 #ifdef APSTUDIO_INVOKED
00027 #ifndef APSTUDIO_READONLY_SYMBOLS
00028 #define _APS_NEXT_RESOURCE_VALUE        253
00029 #define _APS_NEXT_COMMAND_VALUE         32776
00030 #define _APS_NEXT_CONTROL_VALUE         201
00031 #define _APS_NEXT_SYMED_VALUE           104
00032 #endif
00033 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkBlog::InkArea Member List

This is the complete list of members for InkBlog::InkArea, including all inherited members.
components | InkBlog::InkArea | [private]
CreateInkCollectionSurface() | InkBlog::InkArea | [inline, protected]
Dispose(bool disposing) | InkBlog::InkArea | [inline, protected]
DisposeResources() | InkBlog::InkArea | [inline]
InitializeComponent() | InkBlog::InkArea | [inline, private]
InkArea() | InkBlog::InkArea | [inline]
inkCollector | InkBlog::InkArea | [private]
InkData | InkBlog::InkArea |
InkEnabled | InkBlog::InkArea |
inputArea | InkBlog::InkArea | [private]
OnResize(EventArgs e) | InkBlog::InkArea | [inline, protected]
RecognizeInkData() | InkBlog::InkArea | [inline, protected]
SerializeInkData() | InkBlog::InkArea | [inline, protected]
TextData | InkBlog::InkArea |
Generated on Wed Nov 13 2024 16:58:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Client/BYOTTransaction/BYOTtransObj.Cpp Source File

  • Com
  • Services
  • BYOT
  • Client
  • BYOTTransaction

BYOTtransObj.Cpp

Go to the documentation of this file.
00001 // ByotTransObj.cpp : Implementation of CByotTransObj
00002 #include "stdafx.h"
00003 #include <comsvcs.h>
00004 #include "ByotTransaction.h"
00005 #include "ByotTransObj.h"
00006
00007 //const GUID IID_ObjectContextTip = {92FD41CA,BAD9,11d2,9A2D,00C04F797BC9}
00008
00009 /////////////////////////////////////////////////////////////////////////////
00010 // CByotTransObj
00011
00012 STDMETHODIMP CByotTransObj::InterfaceSupportsErrorInfo(REFIID riid)
00013 {
00014   static const IID* arr[] =
00015   {
00016     &IID_IByotTransaction
00017   };
00018   for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
00019   {
00020     if (::InlineIsEqualGUID(*arr[i],riid))
00021       return S_OK;
00022   }
00023   return S_FALSE;
00024 }
00025
00026 STDMETHODIMP CByotTransObj::BeginTransaction()
00027 {
00028   // TODO: Add your implementation code here
00029   return S_OK;
00030 }
00031
00032 STDMETHODIMP CByotTransObj::CommitTransaction()
00033 {
00034   // TODO: Add your implementation code here
00035
00036   HRESULT       hr      = S_OK;
00037   IObjectContext*   pObjCtx   = NULL;
00038
00039   // TODO: Add your implementation code here
00040
00041   hr = GetObjectContext(&pObjCtx);
00042   if (FAILED(hr))
00043     return hr;
00044
00045   hr = pObjCtx->SetComplete ();
00046   if (FAILED(hr))
00047     return hr;
00048
00049   return hr;
00050 }
00051
00052 STDMETHODIMP CByotTransObj::AbortTransaction()
00053 {
00054   HRESULT       hr      = S_OK;
00055   IObjectContext*   pObjCtx   = NULL;
00056
00057   // TODO: Add your implementation code here
00058
00059   hr = GetObjectContext(&pObjCtx);
00060   if (FAILED(hr))
00061     return hr;
00062
00063   hr = pObjCtx->SetAbort ();
00064   if (FAILED(hr))
00065     return hr;
00066
00067   return hr;
00068 }
00069
00070 STDMETHODIMP CByotTransObj::get_TipURL(BSTR *pVal)
00071 {
00072   HRESULT       hr      = S_OK;
00073   IObjectContext*   pObjCtx   = NULL;
00074   IObjectContextTip*  pObjCtxTip  = NULL;
00075   BSTR          bstrTipURL  = NULL;
00076
00077   // TODO: Add your implementation code here
00078   if (!pVal)
00079     return E_POINTER;
00080
00081   hr = GetObjectContext(&pObjCtx);
00082   if (FAILED(hr))
00083     goto ErrorExit;
00084
00085   hr = pObjCtx->QueryInterface (IID_IObjectContextTip, (void**)&pObjCtxTip);
00086   if (FAILED(hr))
00087     goto ErrorExit;
00088
00089   hr = pObjCtxTip->GetTipUrl(&bstrTipURL);
00090   if (FAILED(hr))
00091     goto ErrorExit;
00092
00093 ErrorExit:
00094
00095   *pVal = bstrTipURL;
00096
00097   if (pObjCtxTip)
00098     pObjCtxTip->Release();
00099   if (pObjCtx)
00100     pObjCtx->Release ();
00101
00102   return hr;
00103 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/StreamReadEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

StreamReadEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: StreamReadEnum
00019
00020 public class StreamReadEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adReadAll = -1;
00023   public static final short adReadLine = -2;
00024 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/tracemacro.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

tracemacro.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  TraceMacro.h : Defines custom tracing helpers.
00014 //
00015
00016
00017 #ifndef _TRACE_MACRO_HEADER_
00018 #define _TRACE_MACRO_HEADER_
00019
00020 //---------------------------------------------------------------------------
00021 //  Function prototypes
00022 //
00023 VOID Trace_Start( LPCTSTR pszClass, LPCTSTR pszFunction );
00024 VOID Trace_HR( LPCTSTR pszClass, LPCTSTR pszFunction, HRESULT hr );
00025 VOID Trace_Value( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszValueName, LONG Value );
00026 VOID Trace_Event( LPCTSTR pszClass, LPCTSTR pszFunction, LONG nEvent );
00027 VOID MapEvent( LONG Event, LPTSTR szEventStr );
00028
00029
00030 // Alternate version provides complete path to the file
00031 // #define TRACE_HRESULT(str,hr)  Trace_HR( _T(__FILE__), (str), (hr) )
00032
00033 #ifdef _DEBUG
00034
00035 #undef  TRACE_HRESULT
00036 #define TRACE_HRESULT(s1,hr) Trace_HR( (MODULESTRING),(s1),(hr) )
00037
00038 #undef  TRACE_VAL
00039 #define TRACE_VAL(s1,s2,val) Trace_Value( (MODULESTRING),(s1),(s2),(val) )
00040
00041 #undef  TRACE_EVENT
00042 #define TRACE_EVENT(s1,val)  Trace_Event( (MODULESTRING),(s1),(val) )
00043
00044 #undef  TRACE_START
00045 #define TRACE_START( s1 )    Trace_Start( (MODULESTRING),(s1) )
00046
00047
00048 #else
00049
00050 #undef  TRACE_HRESULT
00051 #define TRACE_HRESULT
00052
00053 #undef  TRACE_VAL
00054 #define TRACE_VAL
00055
00056 #undef  TRACE_EVENT
00057 #define TRACE_EVENT
00058
00059 #undef  TRACE_START
00060 #define TRACE_START
00061
00062 #endif //_DEBUG
00063
00064
00065 #endif //_TRACE_MACRO_HEADER_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Save.c Source File

  • WinUI
  • CommDlg
  • CDTest

Save.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 /************************************************************************
00007
00008   File: save.c
00009
00010   Purpose:
00011
00012     This file contains only one function that set the bDoOpenDlg global
00013     variable to FALSE and then creates a dialog box with the same Callback
00014     function as the DoOpenDialog() function does.
00015
00016     Since GetOpenFileName() and GetSaveFileName() both use the
00017     OPENFILENAME structure to create their dialogs, one dialog
00018     proc and dialog box can handle both.
00019
00020   Functions:
00021
00022     - DoSaveDialog()    -- Creates CDTEST's Open/Save dialog.
00023
00024 ************************************************************************/
00025
00026
00027 #include <windows.h>
00028 #include <commdlg.h>
00029 #include "cdtest.h"
00030 #include "save.h"
00031 #include "open.h"
00032
00033
00034
00035
00036 /************************************************************************
00037
00038   Function: DoSaveDialog(HWND)
00039
00040   Purpose: To create the GetOpenFileName() and GetSaveFileName()
00041            creation dialog.
00042
00043   Returns: Nothing.
00044
00045   Comments:
00046
00047     GetOpenFileName() and GetSaveFileName() are similiar enough so that
00048     the same dialog can be used to edit their creation structure elements,
00049     so a global variable "bDoOpenDlg" keeps track of which one to create
00050     when the user clicks the OK or Multithread buttons...
00051
00052 ************************************************************************/
00053
00054
00055
00056 void DoSaveDialog(HWND hwnd)
00057 {
00058   bDoOpenDlg = FALSE ;
00059
00060   DialogBox(hInst, MAKEINTRESOURCE(ID_OPENDIALOG), hwnd, OpenFunc) ;
00061
00062 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/tprint.cpp Source File

  • Begin
  • sdkdiff

tprint.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * standard table class.
00013  *
00014  * print functions.
00015  *
00016  * see table.h for interface description
00017  */
00018
00019 #include "precomp.h"
00020 #include "gutilsrc.h"
00021
00022 #include "table.h"
00023 #include "tpriv.h"
00024 #include "..\sdkdiff\errorout.h"
00025
00026 /* in tpaint.c, calls GetTextExtentPoint */
00027 extern int GetTextExtent(HDC, LPSTR, int);
00028
00029 extern HANDLE hLibInst;
00030
00031 /* function prototypes */
00032 lpTable gtab_printsetup(HWND hwnd, lpTable ptab, lpPrintContext pcontext);
00033 BOOL gtab_prtwidths(HWND hwnd, lpTable ptab,  lpPrintContext
00034                     pcontext);
00035 void gtab_printjob(HWND hwnd, lpTable ptab, lpPrintContext pcontext);
00036 int APIENTRY AbortProc(HDC hpr, int code);
00037 int APIENTRY AbortDlg(HWND hdlg, UINT msg, UINT wParam, LONG lParam);
00038 BOOL gtab_printpage(HWND hwnd, lpTable ptab, lpPrintContext pcontext, int page);
00039 void gtab_setrects(lpPrintContext pcontext, LPRECT rcinner, LPRECT rcouter);
00040 void gtab_printhead(HWND hwnd, HDC hdc, lpTable ptab, lpTitle head, int page, BOOL fExpandChars);
00041
00042
00043 /*
00044  * gtab_print
00045  */
00046 BOOL
00047 gtab_print(HWND hwnd, lpTable ptab, lpPrintContext pcontext)
00048 {
00049     BOOL fNoContext, fNoMargin, fNoPD;
00050     BOOL fSuccess = TRUE;
00051     lpTable ptab_prt;
00052
00053     fNoContext = FALSE;
00054     fNoPD = FALSE;
00055     fNoMargin = FALSE;
00056
00057     if (pcontext == NULL) {
00058         fNoContext = TRUE;
00059         pcontext = (lpPrintContext) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
00060                                              sizeof(PrintContext));
00061         if (pcontext == NULL)
00062       return (FALSE);
00063     pcontext->head = pcontext->foot = NULL;
00064         pcontext->margin = NULL;
00065         pcontext->pd = NULL;
00066         pcontext->id = 0;
00067     }
00068     if (pcontext->pd == NULL) {
00069         fNoPD = TRUE;
00070     }
00071     if (pcontext->margin == NULL) {
00072         fNoMargin = TRUE;
00073     }
00074     ptab_prt = gtab_printsetup(hwnd, ptab, pcontext);
00075
00076     if (ptab_prt != NULL) {
00077         gtab_printjob(hwnd, ptab_prt, pcontext);
00078
00079         gtab_deltable(hwnd, ptab_prt);
00080     } else fSuccess = FALSE;
00081     if (fNoMargin) {
00082         HeapFree(GetProcessHeap(), NULL, pcontext->margin);
00083         pcontext->margin = NULL;
00084     }
00085     if (fNoPD) {
00086         if (pcontext->pd->hDevMode != NULL) {
00087             GlobalFree(pcontext->pd->hDevMode);
00088         }
00089         if (pcontext->pd->hDevNames != NULL) {
00090             GlobalFree(pcontext->pd->hDevNames);
00091         }
00092         HeapFree(GetProcessHeap(), NULL, pcontext->pd);
00093         pcontext->pd = NULL;
00094     }
00095     if (fNoContext) {
00096         HeapFree(GetProcessHeap(), NULL, pcontext);
00097     }
00098     return fSuccess;
00099 }
00100
00101
00102
00103 /*
00104  * gtab_printsetup()
00105  *
00106  * sets up printercontext - builds lpTable for printer, incl. sizing
00107  * and initialises pcontext fields that may be null.
00108  */
00109 lpTable
00110 gtab_printsetup(HWND hwnd, lpTable ptab, lpPrintContext pcontext)
00111 {
00112     lpTable pprttab;
00113     PRINTDLG FAR * pd;
00114     int ncols, i;
00115     ColPropsList cplist;
00116
00117     /* set fields for context that user left null */
00118     if (pcontext->margin == NULL) {
00119         pcontext->margin = (lpMargin) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(Margin));
00120         if (pcontext->margin == NULL) {
00121             return(NULL);
00122         }
00123         pcontext->margin->left = 10;
00124         pcontext->margin->right = 10;
00125         pcontext->margin->top = 15;
00126         pcontext->margin->bottom = 15;
00127         pcontext->margin->topinner = 15;
00128         pcontext->margin->bottominner = 15;
00129     }
00130
00131     if (pcontext->pd == NULL) {
00132         pd = (PRINTDLG FAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PRINTDLG));
00133         if (pd == NULL) {
00134             return(NULL);
00135         }
00136         pcontext->pd = pd;
00137
00138         pd->lStructSize = sizeof(PRINTDLG);
00139         pd->hwndOwner = hwnd;
00140         pd->hDevMode = (HANDLE) NULL;
00141         pd->hDevNames = (HANDLE) NULL;
00142         pd->Flags = PD_RETURNDC|PD_RETURNDEFAULT;
00143
00144         if (PrintDlg(pd) == FALSE) {
00145             return(NULL);
00146         }
00147     }
00148
00149     /* now create a Table struct by querying the owner */
00150     pprttab = (lpTable)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(Table));
00151
00152     if (pprttab == NULL) {
00153         return(NULL);
00154     }
00155     pprttab->hdr = ptab->hdr;
00156     pprttab->tabchars = ptab->tabchars;
00157     pprttab->show_whitespace = ptab->show_whitespace;
00158
00159     /* get the row/column count from owner window */
00160     if (pcontext->id == 0) {
00161         pprttab->hdr.id = ptab->hdr.id;
00162     } else {
00163         pprttab->hdr.id = pcontext->id;
00164     }
00165     pprttab->hdr.props.valid = 0;
00166     pprttab->hdr.sendscroll = FALSE;
00167     if (gtab_sendtq(hwnd, TQ_GETSIZE, (LPARAM)&pprttab->hdr) == FALSE) {
00168         return(NULL);
00169     }
00170
00171     /* alloc and init the col data structs */
00172     ncols = pprttab->hdr.ncols;
00173     pprttab->pcolhdr = (lpColProps) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ColProps) * ncols);
00174     if (pprttab->pcolhdr == NULL) {
00175         HeapFree(GetProcessHeap(), NULL, pprttab);
00176         return(NULL);
00177     }
00178
00179     /* init col properties to default */
00180     for (i=0; i < ncols; i++) {
00181         pprttab->pcolhdr[i].props.valid = 0;
00182         pprttab->pcolhdr[i].nchars = 0;
00183     }
00184     /* get the column props from owner */
00185     cplist.plist = pprttab->pcolhdr;
00186     cplist.id = pprttab->hdr.id;
00187     cplist.startcol = 0;
00188     cplist.ncols = ncols;
00189     gtab_sendtq(hwnd, TQ_GETCOLPROPS, (LPARAM)&cplist);
00190
00191
00192     pprttab->scrollscale = 1;
00193     pprttab->pcellpos = (lpCellPos) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
00194                                              sizeof(CellPos) * ptab->hdr.ncols);
00195     if (pprttab->pcellpos == NULL) {
00196         HeapFree(GetProcessHeap(), NULL, pprttab->pcolhdr);
00197         HeapFree(GetProcessHeap(), NULL, pprttab);
00198         return(NULL);
00199     }
00200
00201
00202     pprttab->pdata = NULL;
00203     pprttab->nlines = 0;
00204
00205     if (!gtab_prtwidths(hwnd, pprttab, pcontext)) {
00206         HeapFree(GetProcessHeap(), NULL, pprttab->pcellpos);
00207         HeapFree(GetProcessHeap(), NULL, pprttab);
00208         return(NULL);
00209     }
00210     return(pprttab);
00211 }
00212
00213
00214 /* calc the height/width settings and alloc line data */
00215 BOOL
00216 gtab_prtwidths(HWND hwnd, lpTable ptab, lpPrintContext pcontext)
00217 {
00218     TEXTMETRIC tm;
00219     int cx, cxtotal, i, curx, cury;
00220     lpProps hdrprops, cellprops;
00221     lpCellPos xpos, ypos;
00222     RECT rcinner, rcouter;
00223
00224     hdrprops = &ptab->hdr.props;
00225     GetTextMetrics(pcontext->pd->hDC, &tm);
00226     ptab->avewidth = tm.tmAveCharWidth;
00227     ptab->rowheight = tm.tmHeight + tm.tmExternalLeading;
00228     if (hdrprops->valid & P_HEIGHT) {
00229         ptab->rowheight = hdrprops->height;
00230     }
00231
00232     /* set sizes for headers */
00233     gtab_setrects(pcontext, &rcinner, &rcouter);
00234
00235     /* set width/pos for each col. */
00236     cxtotal = 0;
00237     curx = rcinner.left;
00238     for (i = 0; i < ptab->hdr.ncols; i++) {
00239         cellprops = &ptab->pcolhdr[i].props;
00240         xpos = &ptab->pcellpos[i];
00241
00242         if (cellprops->valid & P_WIDTH) {
00243             cx = cellprops->width;
00244         } else if (hdrprops->valid & P_WIDTH) {
00245             cx = hdrprops->width;
00246         } else {
00247             cx = ptab->pcolhdr[i].nchars + 1;
00248             cx *= ptab->avewidth;
00249         }
00250         /* add 2 for intercol spacing */
00251         cx += 2;
00252
00253         xpos->size = cx;
00254         xpos->start = curx + 1;
00255         xpos->clipstart = xpos->start;
00256         xpos->clipend = xpos->start + xpos->size - 2;
00257         xpos->clipend = min(xpos->clipend, rcinner.right);
00258
00259         cxtotal += xpos->size;
00260         curx += xpos->size;
00261     }
00262     ptab->rowwidth = cxtotal;
00263
00264     if (pcontext->head != NULL) {
00265         xpos = &pcontext->head->xpos;
00266         ypos = &pcontext->head->ypos;
00267
00268         xpos->start = rcouter.left + 1;
00269         xpos->clipstart = rcouter.left + 1;
00270         xpos->clipend = rcouter.right - 1;
00271         xpos->size = rcouter.right - rcouter.left;
00272
00273         ypos->start = rcouter.top;
00274         ypos->clipstart = rcouter.top;
00275         ypos->clipend = rcinner.top;
00276         ypos->size = ptab->rowheight;
00277     }
00278
00279     if (pcontext->foot != NULL) {
00280         xpos = &pcontext->foot->xpos;
00281         ypos = &pcontext->foot->ypos;
00282
00283         xpos->start = rcouter.left + 1;
00284         xpos->clipstart = rcouter.left + 1;
00285         xpos->clipend = rcouter.right - 1;
00286         xpos->size = rcouter.right - rcouter.left;
00287
00288         ypos->start = rcouter.bottom - ptab->rowheight;
00289         ypos->clipstart = rcinner.bottom;
00290         ypos->clipend = rcouter.bottom;
00291         ypos->size = ptab->rowheight;
00292     }
00293
00294     /* set nr of lines per page */
00295     ptab->nlines = (rcinner.bottom - rcinner.top) / ptab->rowheight;
00296     if (!gtab_alloclinedata(hwnd, ptab)) {
00297         return(FALSE);
00298     }
00299     /* set line positions */
00300     cury = rcinner.top;
00301     for (i = 0; i < ptab->nlines; i++) {
00302         ypos = &ptab->pdata[i].linepos;
00303         ypos->start = cury;
00304         ypos->clipstart = ypos->start;
00305         ypos->clipend = ypos->start + ypos->size;
00306         ypos->clipend = min(ypos->clipend, rcinner.bottom);
00307         cury += ypos->size;
00308     }
00309     return(TRUE);
00310 }
00311
00312
00313 /* static information for this module */
00314 BOOL g_bAbort;
00315 FARPROC lpAbortProc;
00316 DLGPROC lpAbortDlg;
00317 HWND hAbortWnd;
00318 int npage;
00319 int pages;
00320
00321 void
00322 gtab_printjob(HWND hwnd, lpTable ptab, lpPrintContext pcontext)
00323 {
00324     int moveables;
00325     int endpage;
00326     int startpage = 1;
00327     HDC hpr;
00328     int status;
00329     HANDLE hcurs;
00330     static char str[256];
00331     DOCINFO di;
00332     TCHAR szPage[60];  /* for LoadString */
00333
00334     hcurs = SetCursor(LoadCursor(NULL, IDC_WAIT));
00335
00336     moveables = ptab->nlines - ptab->hdr.fixedrows;
00337     pages = (int) (ptab->hdr.nrows - ptab->hdr.fixedrows + moveables - 1)
00338             / moveables;
00339     endpage = pages;
00340
00341     if (pcontext->pd->Flags & PD_PAGENUMS) {
00342         startpage = pcontext->pd->nFromPage;
00343         endpage = pcontext->pd->nToPage;
00344     }
00345     hpr = pcontext->pd->hDC;
00346
00347     lpAbortDlg = (DLGPROC) MakeProcInstance((WINPROCTYPE) AbortDlg, hLibInst);
00348     lpAbortProc = (FARPROC) MakeProcInstance((WINPROCTYPE)AbortProc, hLibInst);
00349
00350     SetAbortProc(hpr, (ABORTPROC) lpAbortProc);
00351
00352     di.lpszDocName = "Table";
00353     di.cbSize = lstrlen(di.lpszDocName);
00354     di.lpszOutput = NULL;
00355     di.lpszDatatype = NULL;
00356     di.fwType = 0;
00357
00358     StartDoc(hpr, &di);
00359
00360     g_bAbort = FALSE;
00361
00362     /* add abort modeless dialog later!! */
00363     hAbortWnd = CreateDialog((HINSTANCE)hLibInst, "GABRTDLG", hwnd, lpAbortDlg);
00364     if (hAbortWnd != NULL) {
00365         ShowWindow(hAbortWnd, SW_NORMAL);
00366         EnableWindow(hwnd, FALSE);
00367     }
00368     SetCursor((HCURSOR)hcurs);
00369
00370
00371     status = 0;  /* kills a "used without init" diagnostic */
00372     for (npage = startpage; npage<=endpage; npage++) {
00373         LoadString((HINSTANCE)hLibInst,IDS_PAGE_STR,szPage,sizeof(szPage));
00374         HRESULT hr = StringCchPrintf(str, 256, szPage,  npage, pages);
00375     if (FAILED(hr))
00376       OutputError(hr, IDS_SAFE_PRINTF);
00377         if (hAbortWnd != NULL)
00378             SetDlgItemText(hAbortWnd, IDC_LPAGENR, str);
00379         status = gtab_printpage(hwnd, ptab, pcontext, npage);
00380         if (status < 0) {
00381             AbortDoc(hpr);
00382             break;
00383         }
00384     }
00385     if (status >= 0) {
00386         EndDoc(hpr);
00387     }
00388
00389     if (hAbortWnd != NULL) {
00390         EnableWindow(hwnd, TRUE);
00391         DestroyWindow(hAbortWnd);
00392     }
00393     FreeProcInstance((WINPROCTYPE) lpAbortDlg);
00394     FreeProcInstance(lpAbortProc);
00395
00396     DeleteDC(hpr);
00397 }
00398
00399 int APIENTRY
00400 AbortProc(HDC hpr, int code)
00401 {
00402
00403     MSG msg;
00404
00405     if (!hAbortWnd) {
00406         return(TRUE);
00407     }
00408     while (!g_bAbort && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
00409         if (!IsDialogMessage(hAbortWnd, &msg)) {
00410             TranslateMessage(&msg);
00411             DispatchMessage(&msg);
00412         }
00413     }
00414     return(!g_bAbort);
00415 }
00416
00417 int APIENTRY
00418 AbortDlg(HWND hdlg, UINT msg, UINT wParam, LONG lParam)
00419 {
00420     switch (msg) {
00421
00422         case WM_COMMAND:
00423             g_bAbort = TRUE;
00424             EndDialog(hdlg, TRUE);
00425             return TRUE;
00426
00427         case WM_INITDIALOG:
00428             return TRUE;
00429     }
00430     return(FALSE);
00431 }
00432
00433 /*
00434  * print a single page. page number is 1-based
00435  */
00436 BOOL
00437 gtab_printpage(HWND hwnd, lpTable ptab, lpPrintContext pcontext, int page)
00438 {
00439     HDC hpr;
00440     int moveables, i;
00441     int x1, y1, x2, y2;
00442
00443     hpr = pcontext->pd->hDC;
00444     StartPage(hpr);
00445
00446     moveables = ptab->nlines - ptab->hdr.fixedrows;
00447     ptab->toprow = moveables * (page-1);
00448     gtab_invallines(hwnd, ptab, ptab->hdr.fixedrows, moveables);
00449
00450     for (i =0; i < ptab->nlines; i++) {
00451         gtab_paintline(hwnd, hpr, ptab, i, ptab->show_whitespace, TRUE);
00452     }
00453     if ((ptab->hdr.vseparator) && (ptab->hdr.fixedcols > 0)) {
00454         x1 = ptab->pcellpos[ptab->hdr.fixedcols -1].clipend+1;
00455         y1 = ptab->pdata[0].linepos.clipstart;
00456         y2 = ptab->pdata[ptab->nlines-1].linepos.clipend;
00457         MoveToEx(hpr, x1, y1, NULL);
00458         LineTo(hpr, x1, y2);
00459     }
00460     if ((ptab->hdr.hseparator) && (ptab->hdr.fixedrows > 0)) {
00461         y1 = ptab->pdata[ptab->hdr.fixedrows-1].linepos.clipend;
00462         x1 = ptab->pcellpos[0].clipstart;
00463         x2 = ptab->pcellpos[ptab->hdr.ncols-1].clipend;
00464         MoveToEx(hpr, x1, y1, NULL);
00465         LineTo(hpr, x2, y1);
00466     }
00467
00468     if (pcontext->head != NULL) {
00469         gtab_printhead(hwnd, hpr, ptab, pcontext->head, page, FALSE);
00470     }
00471     if (pcontext->foot != NULL) {
00472         gtab_printhead(hwnd, hpr, ptab, pcontext->foot, page, TRUE);
00473     }
00474
00475     return(EndPage(hpr));
00476 }
00477
00478
00479 /*
00480  * calculate the outline positions in pixels for the headers
00481  * (outer rect) and for the page itself (inner rect). Based on
00482  * page size and PrintContext margin info (which is in millimetres).
00483  */
00484 void
00485 gtab_setrects(lpPrintContext pcontext, LPRECT rcinner, LPRECT rcouter)
00486 {
00487     HDC hpr;
00488     int hpixels, hmms;
00489     int vpixels, vmms;
00490     int h_pixpermm, v_pixpermm;
00491
00492     hpr = pcontext->pd->hDC;
00493     hpixels = GetDeviceCaps(hpr, HORZRES);
00494     vpixels = GetDeviceCaps(hpr, VERTRES);
00495     vmms = GetDeviceCaps(hpr, VERTSIZE);
00496     hmms = GetDeviceCaps(hpr, HORZSIZE);
00497
00498     h_pixpermm = hpixels / hmms;
00499     v_pixpermm = vpixels / vmms;
00500
00501     rcouter->top = (pcontext->margin->top * v_pixpermm);
00502     rcouter->bottom = vpixels - (pcontext->margin->bottom * v_pixpermm);
00503     rcouter->left = (pcontext->margin->left * h_pixpermm);
00504     rcouter->right = hpixels - (pcontext->margin->right * h_pixpermm);
00505
00506     rcinner->left = rcouter->left;
00507     rcinner->right = rcouter->right;
00508     rcinner->top = rcouter->top +
00509                    (pcontext->margin->topinner * v_pixpermm);
00510     rcinner->bottom = rcouter->bottom -
00511                       (pcontext->margin->bottominner * v_pixpermm);
00512 }
00513
00514
00515 void
00516 gtab_printhead(HWND hwnd, HDC hdc, lpTable ptab, lpTitle head, int page, BOOL fExpandChars)
00517 {
00518     RECT rc, rcbox;
00519     int i, cx, x, y, tab;
00520     UINT align;
00521     LPSTR chp, tabp;
00522     DWORD fcol, bkcol;
00523     TCHAR str[MAX_PATH * 2];
00524   TCHAR szbuffer[MAX_PATH];
00525   HRESULT hr;
00526
00527     fcol = 0; bkcol = 0;  /* eliminate spurious diagnostic - generate worse code */
00528
00529     rc.top = head->ypos.clipstart;
00530     rc.bottom = head->ypos.clipend;
00531     rc.left = head->xpos.clipstart;
00532     rc.right = head->xpos.clipend;
00533   memset(str, 0, MAX_PATH*2);
00534
00535     /* update page number */
00536     if (fExpandChars) {
00537         chp = str;
00538         for (i = 0; i < lstrlen(head->ptext); i++) {
00539       memset(szbuffer, 0, MAX_PATH);
00540             switch (head->ptext[i]) {
00541
00542                 case '#':
00543           hr = StringCchPrintf(szbuffer, MAX_PATH, "%d", page);
00544           if (FAILED(hr)) {
00545             OutputError(hr, IDS_SAFE_PRINTF);
00546           }
00547           hr = StringCchCat(str, MAX_PATH*2, szbuffer);
00548           if (FAILED(hr)) {
00549             OutputError(hr, IDS_SAFE_CAT);
00550           }
00551           chp += strlen(szbuffer);
00552                     break;
00553
00554                 case '$':
00555                     hr = StringCchPrintf(szbuffer, MAX_PATH, "%d", pages);
00556           if (FAILED(hr))
00557             OutputError(hr, IDS_SAFE_PRINTF);
00558           hr = StringCchCat(str, MAX_PATH*2, szbuffer);
00559           if (FAILED(hr)) {
00560             OutputError(hr, IDS_SAFE_CAT);
00561           }
00562           chp += strlen(szbuffer);
00563                     break;
00564
00565                 default:
00566                     if (IsDBCSLeadByte(head->ptext[i]) &&
00567                         head->ptext[i+1])
00568                     {
00569                         *chp = head->ptext[i];
00570                         chp++;
00571                         i++;
00572                     }
00573                     *chp++ = head->ptext[i];
00574                     break;
00575             }
00576         }
00577         *chp = '\0';
00578     } else {
00579         hr = StringCchCopy(str,(MAX_PATH*2), head->ptext);
00580     if (FAILED(hr))
00581       OutputError(hr, IDS_SAFE_COPY);
00582     }
00583     chp = str;
00584
00585     if (head->props.valid & P_ALIGN) {
00586         align = head->props.alignment;
00587     } else {
00588         align = P_LEFT;
00589     }
00590
00591     /* set colours if not default */
00592     if (head->props.valid & P_FCOLOUR) {
00593         fcol = SetTextColor(hdc, head->props.forecolour);
00594     }
00595     if (head->props.valid & P_BCOLOUR) {
00596         bkcol = SetBkColor(hdc, head->props.backcolour);
00597     }
00598
00599     /* calc offset of text within cell for right-align or centering */
00600     if (align == P_LEFT) {
00601         cx = ptab->avewidth/2;
00602     } else {
00603         cx = LOWORD(GetTextExtent(hdc, chp, lstrlen(chp)));
00604         if (align == P_CENTRE) {
00605             cx = (head->xpos.size - cx) / 2;
00606         } else {
00607             cx = head->xpos.size - cx - (ptab->avewidth/2);
00608         }
00609     }
00610     cx += head->xpos.start;
00611
00612     /* expand tabs on output */
00613     tab = ptab->avewidth * ptab->tabchars;
00614     x = 0;
00615     y = head->ypos.start;
00616
00617     for ( ; (tabp = My_mbschr(chp, '\t')) != NULL; ) {
00618         /* perform output upto tab char */
00619         ExtTextOut(hdc, x+cx, y, ETO_CLIPPED, &rc, chp, (UINT)(tabp-chp), NULL);
00620
00621         /* advance past the tab */
00622         x += LOWORD(GetTextExtent(hdc, chp, (INT)(tabp - chp)));
00623         x = ( (x + tab) / tab) * tab;
00624         chp = ++tabp;
00625     }
00626
00627     /*no more tabs - output rest of string */
00628     ExtTextOut(hdc, x+cx, y, ETO_CLIPPED, &rc, chp, lstrlen(chp), NULL);
00629
00630     /* reset colours to original if not default */
00631     if (head->props.valid & P_FCOLOUR) {
00632         SetTextColor(hdc, fcol);
00633     }
00634     if (head->props.valid & P_BCOLOUR) {
00635         SetBkColor(hdc, bkcol);
00636     }
00637
00638     /* now box cell if marked */
00639     if (head->props.valid & P_BOX) {
00640         if (head->props.box != 0) {
00641             rcbox.top = head->ypos.start;
00642             rcbox.bottom = rcbox.top + head->ypos.size;
00643             rcbox.left = head->xpos.start;
00644             rcbox.right = rcbox.left + head->xpos.size;
00645             gtab_boxcell(hwnd, hdc, &rcbox, &rc, head->props.box);
00646         }
00647     }
00648 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/TextFx/Fx.h Source File

  • Multimedia
  • Gdi
  • TextFx

Fx.h

Go to the documentation of this file.
00001 /*****************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1992 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \*****************************************************************************/
00010 /*****************************************************************************
00011  *                                       *
00012  *  FX.H                                                 *
00013  *                                       *
00014  *  PURPOSE:  Routines for rendering text with stange effects                *
00015  *                                       *
00016  ****************************************************************************/
00017
00018 #include <windows.h>
00019
00020 #define MAXFILLPOINTS 64000
00021
00022 BOOL FillOut(LPPOINT*, LPDWORD);
00023 BOOL RenderPathPoints(HDC, LPPOINT, LPBYTE, int, BOOL);
00024 BOOL RenderAndFillPath(HDC, LPPOINT, LPBYTE, int);
00025 BOOL TextEffect(HDC, LPPOINT, LPPOINT, DWORD, DWORD, LPSTR, BOOL);
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/officedlg.h Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

officedlg.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  OfficeDlg.h
00006 //
00007 // Description:
00008 //  This file declares the COfficeDlg dialog class which
00009 //    collects information for the OnAddEquipment() routine.
00010 //
00011 // Part of: WMI Tutorial #1.
00012 //
00013 // Used by: OnAddEquipment().
00014 //
00015 // History:
00016 //
00017 // **************************************************************************
00018
00019 #if !defined(AFX_OFFICEDLG_H__DE6FFC13_FF91_11D0_AD84_00AA00B8E05A__INCLUDED_)
00020 #define AFX_OFFICEDLG_H__DE6FFC13_FF91_11D0_AD84_00AA00B8E05A__INCLUDED_
00021
00022 #if _MSC_VER >= 1000
00023 #pragma once
00024 #endif // _MSC_VER >= 1000
00025 // OfficeDlg.h : header file
00026 //
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // COfficeDlg dialog
00030
00031 class COfficeDlg : public CDialog
00032 {
00033 // Construction
00034 public:
00035   COfficeDlg(CWnd* pParent = NULL);   // standard constructor
00036
00037 // Dialog Data
00038   //{{AFX_DATA(COfficeDlg)
00039   enum { IDD = IDD_OFFICEEQUIP };
00040   CString m_item;
00041   CString m_SKU;
00042   //}}AFX_DATA
00043
00044
00045 // Overrides
00046   // ClassWizard generated virtual function overrides
00047   //{{AFX_VIRTUAL(COfficeDlg)
00048   protected:
00049   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00050   //}}AFX_VIRTUAL
00051
00052 // Implementation
00053 protected:
00054
00055   // Generated message map functions
00056   //{{AFX_MSG(COfficeDlg)
00057     // NOTE: the ClassWizard will add member functions here
00058   //}}AFX_MSG
00059   DECLARE_MESSAGE_MAP()
00060 };
00061
00062 //{{AFX_INSERT_LOCATION}}
00063 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00064
00065 #endif // !defined(AFX_OFFICEDLG_H__DE6FFC13_FF91_11D0_AD84_00AA00B8E05A__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/ips.Cpp Source File

  • Com
  • Fundamentals
  • SimpSvr

ips.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: ips.cpp
00003 //
00004 //    Implementation file for the CSimpSvrApp Class
00005 //
00006 // Functions:
00007 //
00008 //    See ips.h for a list of member functions.
00009 //
00010 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "obj.h"
00015 #include "ips.h"
00016 #include "app.h"
00017 #include "doc.h"
00018
00019 //@@WTK WIN32, UNICODE
00020 //#include <storage.h>
00021
00022 DEFINE_GUID(GUID_SIMPLE, 0xBCF6D4A0, 0xBE8C, 0x1068, 0xB6, 0xD4, 0x00, 0xDD, 0x01, 0x0C, 0x05, 0x09);
00023
00024 //**********************************************************************
00025 //
00026 // CPersistStorage::QueryInterface
00027 //
00028 // Purpose:
00029 //
00030 //
00031 // Parameters:
00032 //
00033 //      REFIID riid         -   Interface being queried for.
00034 //
00035 //      LPVOID FAR *ppvObj  -   Out pointer for the interface.
00036 //
00037 // Return Value:
00038 //
00039 //      S_OK            - Success
00040 //      E_NOINTERFACE   - Failure
00041 //
00042 // Function Calls:
00043 //      Function                    Location
00044 //
00045 //      CSimpSvrObj::QueryInterface OBJ.CPP
00046 //
00047 // Comments:
00048 //
00049 //
00050 //********************************************************************
00051
00052 STDMETHODIMP CPersistStorage::QueryInterface ( REFIID riid, LPVOID FAR* ppvObj)
00053 {
00054   OutputDebugString("In CPersistStorage::QueryInterface\r\n");
00055   // need to NULL the out parameter
00056   return m_lpObj->QueryInterface(riid, ppvObj);
00057 };
00058
00059 //**********************************************************************
00060 //
00061 // CPersistStorage::AddRef
00062 //
00063 // Purpose:
00064 //
00065 //      Increments the reference count on CPersistStorage and the "object"
00066 //      object.
00067 //
00068 // Parameters:
00069 //
00070 //      None
00071 //
00072 // Return Value:
00073 //
00074 //      The Reference count on the Object.
00075 //
00076 // Function Calls:
00077 //      Function                    Location
00078 //
00079 //      OuputDebugString            Windows API
00080 //      CSimpSvrObj::AddRef         OBJ.CPP
00081 //
00082 // Comments:
00083 //
00084 //
00085 //********************************************************************
00086
00087 STDMETHODIMP_(ULONG) CPersistStorage::AddRef ()
00088 {
00089   OutputDebugString("In CPersistStorage::AddRef\r\n");
00090   ++m_nCount;
00091   return m_lpObj->AddRef();
00092 };
00093
00094 //**********************************************************************
00095 //
00096 // CPersistStorage::Release
00097 //
00098 // Purpose:
00099 //
00100 //      Decrements the reference count of CPersistStorage and the
00101 //      "object" object.
00102 //
00103 // Parameters:
00104 //
00105 //      None
00106 //
00107 // Return Value:
00108 //
00109 //      The new reference count
00110 //
00111 // Function Calls:
00112 //      Function                    Location
00113 //
00114 //      OutputDebugString           Windows API
00115 //      CSimpSvrObj::Release        OBJ.CPP
00116 //
00117 // Comments:
00118 //
00119 //
00120 //********************************************************************
00121
00122 STDMETHODIMP_(ULONG) CPersistStorage::Release ()
00123 {
00124   OutputDebugString("In CPersistStorage::Release\r\n");
00125   --m_nCount;
00126   return m_lpObj->Release();
00127 };
00128
00129 //**********************************************************************
00130 //
00131 // CPersistStorage::InitNew
00132 //
00133 // Purpose:
00134 //
00135 //      Used to give a new OLE object a ptr to its storage.
00136 //
00137 // Parameters:
00138 //
00139 //      LPSTORAGE pStg  - Pointer to the storage
00140 //
00141 // Return Value:
00142 //
00143 //
00144 //
00145 // Function Calls:
00146 //      Function                    Location
00147 //
00148 //      OutputDebugString           Windows API
00149 //      IStorage::Release           OLE
00150 //      IStorage::AddRef            OLE
00151 //
00152 //
00153 // Comments:
00154 //
00155 //
00156 //********************************************************************
00157
00158 STDMETHODIMP CPersistStorage::InitNew (LPSTORAGE pStg)
00159 {
00160   OutputDebugString("In CPersistStorage::InitNew\r\n");
00161
00162   // release any streams and storages that may be open
00163   ReleaseStreamsAndStorage();
00164
00165   m_lpObj->m_lpStorage = pStg;
00166
00167   // AddRef the new Storage
00168   if (m_lpObj->m_lpStorage)
00169     m_lpObj->m_lpStorage->AddRef();
00170
00171   CreateStreams(m_lpObj->m_lpStorage);
00172
00173   return S_OK;
00174 }
00175
00176 //**********************************************************************
00177 //
00178 // CPersistStorage::GetClassID
00179 //
00180 // Purpose:
00181 //
00182 //      Returns the CLSID of this object.
00183 //
00184 // Parameters:
00185 //
00186 //      LPCLSID lpClassID   - Out ptr in which to return the CLSID
00187 //
00188 // Return Value:
00189 //
00190 //       S_OK
00191 //
00192 // Function Calls:
00193 //      Function                    Location
00194 //
00195 //      OutputDebugString           Windows API
00196 //
00197 //
00198 // Comments:
00199 //
00200 //
00201 //********************************************************************
00202
00203 STDMETHODIMP CPersistStorage::GetClassID  ( LPCLSID lpClassID)
00204 {
00205   OutputDebugString("In CPersistStorage::GetClassID\r\n");
00206
00207   *lpClassID = GUID_SIMPLE;
00208
00209   return  S_OK ;
00210 };
00211
00212 //**********************************************************************
00213 //
00214 // CPersistStorage::Save
00215 //
00216 // Purpose:
00217 //
00218 //      Instructs the object to save itself into the storage.
00219 //
00220 // Parameters:
00221 //
00222 //      LPSTORAGE pStgSave  - Storage in which the object should be saved
00223 //
00224 //      BOOL fSameAsLoad    - TRUE if pStgSave is the same as the storage
00225 //                            that the object was originally created with.
00226 //
00227 // Return Value:
00228 //
00229 //      S_OK
00230 //
00231 // Function Calls:
00232 //      Function                    Location
00233 //
00234 //      OutputDebugString           Windows API
00235 //      CPersistStorage::InitNew    IPS.CPP
00236 //      CSimpSvrObj::SaveToStorage  OBJ.CPP
00237 //
00238 //
00239 // Comments:
00240 //
00241 //      A real app will want better error checking in this method.
00242 //
00243 //********************************************************************
00244
00245 STDMETHODIMP CPersistStorage::Save  ( LPSTORAGE pStgSave, BOOL fSameAsLoad)
00246 {
00247   OutputDebugString("In CPersistStorage::Save\r\n");
00248
00249   // save the data
00250   m_lpObj->SaveToStorage (pStgSave, fSameAsLoad);
00251
00252   m_lpObj->m_fSaveWithSameAsLoad = fSameAsLoad;
00253   m_lpObj->m_fNoScribbleMode = TRUE;
00254
00255   return  S_OK ;
00256 };
00257
00258 //**********************************************************************
00259 //
00260 // CPersistStorage::SaveCompleted
00261 //
00262 // Purpose:
00263 //
00264 //      Called when the container is finished saving the object
00265 //
00266 // Parameters:
00267 //
00268 //      LPSTORAGE pStgNew   - ptr to the new storage
00269 //
00270 // Return Value:
00271 //
00272 //      S_OK
00273 //
00274 // Function Calls:
00275 //      Function                    Location
00276 //
00277 //      OutputDebugString           Windows API
00278 //
00279 //
00280 // Comments:
00281 //
00282 //
00283 //********************************************************************
00284
00285 STDMETHODIMP CPersistStorage::SaveCompleted  ( LPSTORAGE pStgNew)
00286 {
00287   OutputDebugString("In CPersistStorage::SaveCompleted\r\n");
00288
00289   if (pStgNew)
00290     {
00291     ReleaseStreamsAndStorage();
00292     m_lpObj->m_lpStorage = pStgNew;
00293     m_lpObj->m_lpStorage->AddRef();
00294     OpenStreams(pStgNew);
00295     }
00296
00297
00298   /* OLE2NOTE: it is only legal to perform a Save or SaveAs operation
00299   **    on an embedded object. if the document is a file-based document
00300   **    then we can not be changed to a IStorage-base object.
00301   **
00302   **      fSameAsLoad   lpStgNew     Type of Save     Send OnSave
00303   **    ---------------------------------------------------------
00304   **         TRUE        NULL        SAVE             YES
00305   **         TRUE        ! NULL      SAVE *           YES
00306   **         FALSE       ! NULL      SAVE AS          YES
00307   **         FALSE       NULL        SAVE COPY AS     NO
00308   **
00309   **    * this is a strange case that is possible. it is inefficient
00310   **    for the caller; it would be better to pass lpStgNew==NULL for
00311   **    the Save operation.
00312   */
00313
00314   if ( pStgNew || m_lpObj->m_fSaveWithSameAsLoad)
00315     {
00316     if (m_lpObj->m_fNoScribbleMode)
00317       m_lpObj->GetOleAdviseHolder()->SendOnSave();  // normally would clear a
00318                               // dirty bit
00319     m_lpObj->m_fSaveWithSameAsLoad = FALSE;
00320     }
00321
00322   m_lpObj->m_fNoScribbleMode = FALSE;
00323
00324   return  S_OK ;
00325 };
00326
00327 //**********************************************************************
00328 //
00329 // CPersistStorage::Load
00330 //
00331 // Purpose:
00332 //
00333 //      Instructs the object to be loaded from storage.
00334 //
00335 // Parameters:
00336 //
00337 //      LPSTORAGE pStg  - Ptr to the storage in which to be loaded
00338 //
00339 // Return Value:
00340 //
00341 //      S_OK
00342 //
00343 // Function Calls:
00344 //      Function                        Location
00345 //
00346 //      OutputDebugString               Windows API
00347 //      CSimpSvrObj::LoadFromStorage    OBJ.CPP
00348 //
00349 //
00350 // Comments:
00351 //
00352 //      A real app will want better error checking in this method.
00353 //
00354 //********************************************************************
00355
00356 STDMETHODIMP CPersistStorage::Load  ( LPSTORAGE pStg)
00357 {
00358   OutputDebugString("In CPersistStorage::Load\r\n");
00359
00360   // remember the storage
00361   if (m_lpObj->m_lpStorage)
00362     {
00363     m_lpObj->m_lpStorage->Release();
00364     m_lpObj->m_lpStorage = NULL;
00365     }
00366
00367   m_lpObj->m_lpStorage = pStg;
00368
00369   m_lpObj->m_lpStorage->AddRef();
00370
00371   OpenStreams(m_lpObj->m_lpStorage);
00372
00373   m_lpObj->LoadFromStorage();
00374
00375
00376   return  S_OK ;
00377 };
00378
00379
00380 //**********************************************************************
00381 //
00382 // CPersistStorage::IsDirty
00383 //
00384 // Purpose:
00385 //
00386 //      Returns whether or not the object is dirty w/respect to its
00387 //      Storage
00388 //
00389 // Parameters:
00390 //
00391 //      None
00392 //
00393 // Return Value:
00394 //
00395 //
00396 // Function Calls:
00397 //      Function                    Location
00398 //
00399 //      OutputDebugString           Windows API
00400 //
00401 //
00402 // Comments:
00403 //
00404 //      This sample does not implement this function, although a
00405 //      real application should.
00406 //
00407 //********************************************************************
00408
00409 STDMETHODIMP CPersistStorage::IsDirty()
00410 {
00411   OutputDebugString("In CPersistStorage::IsDirty\r\n");
00412   return  S_OK ;
00413 };
00414
00415 //**********************************************************************
00416 //
00417 // CPersistStorage::HandsOffStorage
00418 //
00419 // Purpose:
00420 //
00421 //      Forces the object to release its handle to its storage.
00422 //
00423 // Parameters:
00424 //
00425 //      None
00426 //
00427 // Return Value:
00428 //
00429 //      S_OK
00430 //
00431 // Function Calls:
00432 //      Function                    Location
00433 //
00434 //      OutputDebugString           Windows API
00435 //      IStorage::Release           OLE
00436 //
00437 // Comments:
00438 //
00439 //
00440 //********************************************************************
00441
00442 STDMETHODIMP CPersistStorage::HandsOffStorage  ()
00443 {
00444   OutputDebugString("In CPersistStorage::HandsOffStorage\r\n");
00445
00446   ReleaseStreamsAndStorage();
00447
00448   return  S_OK ;
00449 };
00450
00451 //**********************************************************************
00452 //
00453 // CPersistStorage::CreateStreams
00454 //
00455 // Purpose:
00456 //
00457 //      Creates the streams that are held open for the object's lifetime.
00458 //
00459 // Parameters:
00460 //
00461 //      LPSTORAGE lpStg -   Storage in which to create the streams
00462 //
00463 // Return Value:
00464 //
00465 //      S_OK
00466 //
00467 // Function Calls:
00468 //      Function                    Location
00469 //
00470 //      OutputDebugString           Windows API
00471 //      IStorage::Release           OLE
00472 //      IStream::Release            OLE
00473 //      IStorage::CreateStream      OLE
00474 //
00475 // Comments:
00476 //
00477 //
00478 //********************************************************************
00479
00480 void CPersistStorage::CreateStreams(LPSTORAGE lpStg)
00481 {
00482   if (m_lpObj->m_lpColorStm)
00483     m_lpObj->m_lpColorStm->Release();
00484
00485   if (m_lpObj->m_lpSizeStm)
00486     m_lpObj->m_lpSizeStm->Release();
00487
00488     // create a stream to save the colors
00489   //@@WTK WIN32, UNICODE
00490   //lpStg->CreateStream ( "RGB",
00491   lpStg->CreateStream ( OLESTR("RGB"),
00492                STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
00493                0,
00494                0,
00495                &m_lpObj->m_lpColorStm);
00496
00497   // create a stream to save the size
00498   //@@WTK WIN32, UNICODE
00499   //lpStg->CreateStream ( "size",
00500   lpStg->CreateStream ( OLESTR("size"),
00501                STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
00502                0,
00503                0,
00504                &m_lpObj->m_lpSizeStm);
00505 }
00506
00507 //**********************************************************************
00508 //
00509 // CPersistStorage::OpenStreams
00510 //
00511 // Purpose:
00512 //
00513 //      Opens the streams in a storage.
00514 //
00515 // Parameters:
00516 //
00517 //      LPSTORAGE lpStg -   Storage in which to open the streams.
00518 //
00519 // Return Value:
00520 //
00521 //      S_OK
00522 //
00523 // Function Calls:
00524 //      Function                    Location
00525 //
00526 //      OutputDebugString           Windows API
00527 //      IStorage::Release           OLE
00528 //
00529 // Comments:
00530 //
00531 //
00532 //********************************************************************
00533
00534 void CPersistStorage::OpenStreams(LPSTORAGE lpStg)
00535 {
00536   if (m_lpObj->m_lpColorStm)
00537     m_lpObj->m_lpColorStm->Release();
00538
00539   if (m_lpObj->m_lpSizeStm)
00540     m_lpObj->m_lpSizeStm->Release();
00541
00542     // open the color stream
00543   //@@WTK WIN32, UNICODE
00544   //lpStg->OpenStream ( "RGB",
00545   lpStg->OpenStream ( OLESTR("RGB"),
00546                0,
00547                STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
00548                0,
00549                &m_lpObj->m_lpColorStm);
00550
00551   // open the color stream
00552   //@@WTK WIN32, UNICODE
00553   //lpStg->OpenStream ( "size",
00554   lpStg->OpenStream ( OLESTR("size"),
00555                0,
00556                STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
00557                0,
00558                &m_lpObj->m_lpSizeStm);
00559 }
00560
00561 //**********************************************************************
00562 //
00563 // CPersistStorage::ReleaseStreamsAndStorage
00564 //
00565 // Purpose:
00566 //
00567 //      Releases the stream and storage ptrs
00568 //
00569 // Parameters:
00570 //
00571 //      None
00572 //
00573 // Return Value:
00574 //
00575 //      S_OK
00576 //
00577 // Function Calls:
00578 //      Function                    Location
00579 //
00580 //      OutputDebugString           Windows API
00581 //      IStorage::Release           OLE
00582 //
00583 // Comments:
00584 //
00585 //
00586 //********************************************************************
00587
00588 void CPersistStorage::ReleaseStreamsAndStorage()
00589 {
00590   if (m_lpObj->m_lpColorStm)
00591     {
00592     m_lpObj->m_lpColorStm->Release();
00593     m_lpObj->m_lpColorStm = NULL;
00594     }
00595
00596   if (m_lpObj->m_lpSizeStm)
00597     {
00598     m_lpObj->m_lpSizeStm->Release();
00599     m_lpObj->m_lpSizeStm = NULL;
00600     }
00601
00602   if (m_lpObj->m_lpStorage)
00603     {
00604     m_lpObj->m_lpStorage->Release();
00605     m_lpObj->m_lpStorage = NULL;
00606     }
00607 }
00608
00609 //**********************************************************************
00610 //
00611 // CPersistStorage::CreateStreams
00612 //
00613 // Purpose:
00614 //
00615 //      Creates temporary streams in a storage.
00616 //
00617 // Parameters:
00618 //
00619 //      LPSTORAGE lpStg                 - Pointer to the storage
00620 //
00621 //      LPSTREAM FAR* lplpTempColor     - Color Stream
00622 //
00623 //      LPSTREAM FAR* lplpTempSize      - Size Stream
00624 //
00625 // Return Value:
00626 //
00627 //      S_OK
00628 //
00629 // Function Calls:
00630 //      Function                    Location
00631 //
00632 //      OutputDebugString           Windows API
00633 //      IStorage::Release           OLE
00634 //
00635 // Comments:
00636 //
00637 //
00638 //********************************************************************
00639
00640 void CPersistStorage::CreateStreams(LPSTORAGE lpStg, LPSTREAM FAR* lplpTempColor,LPSTREAM FAR* lplpTempSize)
00641 {
00642     // create a stream to save the colors
00643    //@@WTK WIN32, UNICODE
00644    //lpStg->CreateStream ( "RGB",
00645    lpStg->CreateStream ( OLESTR("RGB"),
00646                STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
00647                0,
00648                0,
00649                lplpTempColor);
00650
00651   // create a stream to save the size
00652   //@@WTK WIN32, UNICODE
00653   //lpStg->CreateStream ( "size",
00654   lpStg->CreateStream ( OLESTR("size"),
00655                STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE,
00656                0,
00657                0,
00658                lplpTempSize);
00659
00660 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/SimpleClient/WbemClient.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • SimpleClient

WbemClient.Cpp

Go to the documentation of this file.
00001 // WbemClient.cpp : Defines the class behaviors for the application.
00002
00003 //
00004
00005 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00006
00007 #include "stdafx.h"
00008 #include "WbemClient.h"
00009 #include "WbemClientDlg.h"
00010
00011 #ifdef _DEBUG
00012 #define new DEBUG_NEW
00013 #undef THIS_FILE
00014 static char THIS_FILE[] = __FILE__;
00015 #endif
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CWbemClientApp
00019
00020 BEGIN_MESSAGE_MAP(CWbemClientApp, CWinApp)
00021   //{{AFX_MSG_MAP(CWbemClientApp)
00022     // NOTE - the ClassWizard will add and remove mapping macros here.
00023     //    DO NOT EDIT what you see in these blocks of generated code!
00024   //}}AFX_MSG
00025   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00026 END_MESSAGE_MAP()
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CWbemClientApp construction
00030
00031 CWbemClientApp::CWbemClientApp()
00032 {
00033   // TODO: add construction code here,
00034   // Place all significant initialization in InitInstance
00035 }
00036
00037 /////////////////////////////////////////////////////////////////////////////
00038 // The one and only CWbemClientApp object
00039
00040 CWbemClientApp theApp;
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // CWbemClientApp initialization
00044
00045 BOOL CWbemClientApp::InitInstance()
00046 {
00047   // Initialize OLE libraries
00048   if (!AfxOleInit())
00049   {
00050     AfxMessageBox(_T("Failed to initialize OLE"));
00051     return FALSE;
00052   }
00053   if (!InitSecurity())
00054   {
00055     AfxMessageBox(_T("Failed to fix security"));
00056     return FALSE;
00057   }
00058
00059   // Standard initialization
00060   // If you are not using these features and wish to reduce the size
00061   //  of your final executable, you should remove from the following
00062   //  the specific initialization routines you do not need.
00063
00064 #ifdef _AFXDLL
00065   Enable3dControls();     // Call this when using MFC in a shared DLL
00066 #else
00067   Enable3dControlsStatic(); // Call this when linking to MFC statically
00068 #endif
00069
00070   CWbemClientDlg dlg;
00071   m_pMainWnd = &dlg;
00072   INT_PTR nResponse = dlg.DoModal();
00073   if (nResponse == IDOK)
00074   {
00075     // TODO: Place code here to handle when the dialog is
00076     //  dismissed with OK
00077   }
00078   else if (nResponse == IDCANCEL)
00079   {
00080     // TODO: Place code here to handle when the dialog is
00081     //  dismissed with Cancel
00082   }
00083
00084   // Since the dialog has been closed, return FALSE so that we exit the
00085   //  application, rather than start the application's message pump.
00086   return FALSE;
00087 }
00088
00089 /////////////////////////////////////////////////////////////////////////////
00090 // CWbemClientApp security
00091
00092 // Initialize COM security for DCOM services.
00093 // Returns true if successful.
00094 bool CWbemClientApp::InitSecurity(void)
00095 {
00096   // Adjust the security to allow client impersonation.
00097
00098   //  NOTE:
00099   //  When using asynchronous WMI API's remotely in an environment where the "Local System" account
00100   //  has no network identity (such as non-Kerberos domains), the authentication level of
00101   //  RPC_C_AUTHN_LEVEL_NONE is needed. However, lowering the authentication level to
00102   //  RPC_C_AUTHN_LEVEL_NONE makes your application less secure. It is wise to
00103   //  use semi-synchronous API's for accessing WMI data and events instead of the asynchronous ones.
00104
00105   HRESULT hres = CoInitializeSecurity
00106                 ( NULL, -1, NULL, NULL,
00107                       RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
00108                       RPC_C_IMP_LEVEL_IMPERSONATE,
00109                       NULL,
00110                       EOAC_SECURE_REFS, //change to EOAC_NONE if you change dwAuthnLevel to RPC_C_AUTHN_LEVEL_NONE
00111                       NULL );
00112   return (SUCCEEDED(hres));
00113 }
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/PropList.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

PropList.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      PropList.cpp
00005 //
00006 //  Description:
00007 //      Implementation of the CClusPropList class.
00008 //
00009 //  Header File:
00010 //      PropList.h
00011 //
00012 /////////////////////////////////////////////////////////////////////////////
00013
00014
00015 #include "stdafx.h"
00016 #include "PropList.h"
00017 #include <StrSafe.h>
00018
00019 #ifdef _DEBUG
00020 #ifdef __AFX_H__
00021 #define new DEBUG_NEW
00022 #undef THIS_FILE
00023 static char THIS_FILE[] = __FILE__;
00024 #endif // __AFX_H__
00025 #endif
00026
00027 #ifndef __AFX_H__
00028 class CMemoryException
00029 {
00030 public:
00031     void Delete( void ) { }
00032
00033 }; //*** class CMemoryException
00034 #endif // __AFX_H__
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 // Constant Definitions
00038 /////////////////////////////////////////////////////////////////////////////
00039
00040 const int BUFFER_GROWTH_FACTOR = 256;
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // String utilities
00044 /////////////////////////////////////////////////////////////////////////////
00045
00046 /////////////////////////////////////////////////////////////////////////////
00047 //++
00048 //
00049 //  CchMultiSz
00050 //
00051 //  Description:
00052 //      Length of all of the substrings of a multisz string minus the final NULL.
00053 //
00054 //      (i.e., includes the nulls of the substrings, excludes the final null)
00055 //      multiszlen( "abcd\0efgh\0\0" => 5 + 5 = 10
00056 //
00057 //  Arguments:
00058 //      pszIn     The string to get the length of.
00059 //
00060 //  Return Value:
00061 //      Count of characters in the multisz or 0 if empty.
00062 //
00063 //--
00064 /////////////////////////////////////////////////////////////////////////////
00065 static size_t
00066 CchMultiSz(
00067     LPCWSTR pszIn
00068     )
00069 {
00070     ASSERT( pszIn != NULL );
00071
00072     size_t  cchTotal = 0;
00073     size_t  cchChars = 0;
00074
00075     while ( *pszIn != L'\0' )
00076     {
00077         cchChars = lstrlenW( pszIn ) + 1;
00078
00079         cchTotal += cchChars;
00080         pszIn += cchChars;
00081     } // while: pointer not stopped on EOS
00082
00083     return cchTotal;
00084
00085 } //*** CchMultiSz
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 //++
00089 //
00090 //  NCompareMultiSz
00091 //
00092 //  Description:
00093 //      Compare two MULTI_SZ buffers.
00094 //
00095 //  Arguments:
00096 //      pszSourceIn   The source string.
00097 //      pszTargetIn   The target string.
00098 //
00099 //  Return Value:
00100 //      If the string pointed to by pszSource is less than the string pointed
00101 //      to by pszTarget, the return value is negative. If the string pointed
00102 //      to by pszSource is greater than the string pointed to by pszTarget,
00103 //      the return value is positive. If the strings are equal, the return value
00104 //      is zero.
00105 //
00106 //--
00107 /////////////////////////////////////////////////////////////////////////////
00108 static int NCompareMultiSz(
00109       LPCWSTR pszSourceIn
00110     , LPCWSTR pszTargetIn
00111     )
00112 {
00113     ASSERT( pszSourceIn != NULL );
00114     ASSERT( pszTargetIn != NULL );
00115
00116     while ( ( *pszSourceIn != L'\0' ) && ( *pszTargetIn != L'\0') )
00117     {
00118         //
00119         // Move to end of strings.
00120         //
00121
00122         while ( ( *pszSourceIn != L'\0' ) && ( *pszTargetIn != L'\0') && ( *pszSourceIn == *pszTargetIn ) )
00123         {
00124             ++pszSourceIn;
00125             ++pszTargetIn;
00126         } // while: pointer not stopped on EOS
00127
00128         //
00129         // If strings are the same, skip past terminating NUL.
00130         // Otherwise exit the loop.
00131
00132         if ( ( *pszSourceIn == L'\0' ) && ( *pszTargetIn == L'\0') )
00133         {
00134             ++pszSourceIn;
00135             ++pszTargetIn;
00136         } // if: both stopped on EOS
00137         else
00138         {
00139             break;
00140         } // else: stopped because something is not equal -- we are done.
00141
00142     } // while: pointer not stopped on EOS
00143
00144     return *pszSourceIn - *pszTargetIn;
00145
00146 } //*** NCompareMultiSz
00147
00148 /////////////////////////////////////////////////////////////////////////////
00149 // CClusPropValueList class
00150 /////////////////////////////////////////////////////////////////////////////
00151
00152 #ifdef __AFX_H__
00153 IMPLEMENT_DYNAMIC( CClusPropValueList, CObject );
00154 #endif // __AFX_H__
00155
00156 /////////////////////////////////////////////////////////////////////////////
00157 //++
00158 //
00159 //  CClusPropValueList::ScMoveToFirstValue
00160 //
00161 //  Description:
00162 //      Move the cursor to the first value in the value list.
00163 //
00164 //  Arguments:
00165 //      None.
00166 //
00167 //  Return Value:
00168 //      ERROR_SUCCESS   Position moved to the first value successfully.
00169 //
00170 //--
00171 /////////////////////////////////////////////////////////////////////////////
00172 DWORD
00173 CClusPropValueList::ScMoveToFirstValue( void )
00174 {
00175     ASSERT( m_cbhValueList.pb != NULL );
00176
00177     DWORD   sc;
00178
00179     m_cbhCurrentValue = m_cbhValueList;
00180     m_cbDataLeft = m_cbDataSize;
00181     m_fAtEnd = FALSE;
00182
00183     if ( m_cbhCurrentValue.pSyntax->dw == CLUSPROP_SYNTAX_ENDMARK )
00184     {
00185         sc = ERROR_NO_MORE_ITEMS;
00186     } // if: no items in the value list
00187     else
00188     {
00189         sc = ERROR_SUCCESS;
00190     } // else: items exist in the value list
00191
00192     return sc;
00193
00194 } //*** CClusPropValueList::ScMoveToFirstValue
00195
00196 /////////////////////////////////////////////////////////////////////////////
00197 //++
00198 //
00199 //  CClusPropValueList::ScMoveToNextValue
00200 //
00201 //  Description:
00202 //      Move the cursor to the next value in the list.
00203 //
00204 //  Arguments:
00205 //      None.
00206 //
00207 //  Return Value:
00208 //      ERROR_SUCCESS       Position moved to the next value successfully.
00209 //      ERROR_NO_MORE_ITEMS Already at the end of the list.
00210 //      ERROR_INVALID_DATA  Not enough data in the buffer.
00211 //
00212 //--
00213 /////////////////////////////////////////////////////////////////////////////
00214 DWORD
00215 CClusPropValueList::ScMoveToNextValue( void )
00216 {
00217     ASSERT( m_cbhCurrentValue.pb != NULL );
00218
00219     DWORD                   sc     = ERROR_NO_MORE_ITEMS;
00220     size_t                  cbDataSize;
00221     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
00222
00223     cbhCurrentValue = m_cbhCurrentValue;
00224
00225     //
00226     // Don't try to move if we're already at the end.
00227     //
00228
00229     if ( m_fAtEnd )
00230     {
00231         goto Cleanup;
00232     } // if: already at the end of the list
00233
00234     //
00235     // Make sure the buffer is big enough for the value header.
00236     //
00237
00238     if ( m_cbDataLeft < sizeof( *cbhCurrentValue.pValue ) )
00239     {
00240         sc = ERROR_INVALID_DATA;
00241         goto Cleanup;
00242     } // if: not enough data left
00243
00244     //
00245     // Calculate how much to advance buffer pointer.
00246     //
00247
00248     cbDataSize = sizeof( *cbhCurrentValue.pValue )
00249                 + ALIGN_CLUSPROP( cbhCurrentValue.pValue->cbLength );
00250
00251     //
00252     // Make sure the buffer is big enough for the value header,
00253     // the data itself, and the endmark.
00254     //
00255
00256     if ( m_cbDataLeft < cbDataSize + sizeof( CLUSPROP_SYNTAX ) )
00257     {
00258         sc = ERROR_INVALID_DATA;
00259         goto Cleanup;
00260     } // if: not enough data left
00261
00262     //
00263     // Move past the current value to the next value's syntax.
00264     //
00265
00266     cbhCurrentValue.pb += cbDataSize;
00267
00268     //
00269     // This test will ensure that the value is always valid since we won't
00270     // advance if the next thing is the endmark.
00271     //
00272
00273     if ( cbhCurrentValue.pSyntax->dw != CLUSPROP_SYNTAX_ENDMARK )
00274     {
00275         m_cbhCurrentValue = cbhCurrentValue;
00276         m_cbDataLeft -= cbDataSize;
00277         sc = ERROR_SUCCESS;
00278     } // if: next value's syntax is not the endmark
00279     else
00280     {
00281         m_fAtEnd = TRUE;
00282     } // else: next value's syntax is the endmark
00283
00284 Cleanup:
00285
00286     return sc;
00287
00288 } //*** CClusPropValueList::ScMoveToNextValue
00289
00290 /////////////////////////////////////////////////////////////////////////////
00291 //++
00292 //
00293 //  CClusPropValueList::ScCheckIfAtLastValue
00294 //
00295 //  Description:
00296 //      Indicate whether we are on the last value in the list or not.
00297 //
00298 //  Arguments:
00299 //      None.
00300 //
00301 //  Return Value:
00302 //      ERROR_SUCCESS       Not currently at the last value in the list.
00303 //      ERROR_NO_MORE_ITEMS Currently at the last value in the list.
00304 //      ERROR_INVALID_DATA  Not enough data in the buffer.
00305 //
00306 //--
00307 /////////////////////////////////////////////////////////////////////////////
00308 DWORD
00309 CClusPropValueList::ScCheckIfAtLastValue( void )
00310 {
00311     ASSERT( m_cbhCurrentValue.pb != NULL );
00312
00313     DWORD                   sc = ERROR_SUCCESS;
00314     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
00315     size_t                  cbDataSize = 0;
00316
00317     cbhCurrentValue = m_cbhCurrentValue;
00318
00319     //
00320     // Don't try to recalculate if we already know
00321     // we're at the end of the list.
00322     //
00323
00324     if ( m_fAtEnd )
00325     {
00326         goto Cleanup;
00327     } // if: already at the end of the list
00328
00329     //
00330     // Make sure the buffer is big enough for the value header.
00331     //
00332
00333     if ( m_cbDataLeft < sizeof( *cbhCurrentValue.pValue ) )
00334     {
00335         sc = ERROR_INVALID_DATA;
00336         goto Cleanup;
00337     } // if: not enough data left
00338
00339     //
00340     // Calculate how much to advance buffer pointer.
00341     //
00342
00343     cbDataSize = sizeof( *cbhCurrentValue.pValue )
00344                 + ALIGN_CLUSPROP( cbhCurrentValue.pValue->cbLength );
00345
00346     //
00347     // Make sure the buffer is big enough for the value header,
00348     // the data itself, and the endmark.
00349     //
00350
00351     if ( m_cbDataLeft < cbDataSize + sizeof( CLUSPROP_SYNTAX ) )
00352     {
00353         sc = ERROR_INVALID_DATA;
00354         goto Cleanup;
00355     } // if: not enough data left
00356
00357     //
00358     // Move past the current value to the next value's syntax.
00359     //
00360
00361     cbhCurrentValue.pb += cbDataSize;
00362
00363     //
00364     // We are on the last value if the next thing after this value
00365     // is an endmark.
00366     //
00367
00368     if ( cbhCurrentValue.pSyntax->dw == CLUSPROP_SYNTAX_ENDMARK )
00369     {
00370         sc = ERROR_NO_MORE_ITEMS;
00371     } // if: next value's syntax is the endmark
00372
00373 Cleanup:
00374
00375     return sc;
00376
00377 } //*** CClusPropValueList::ScCheckIfAtLastValue
00378
00379 /////////////////////////////////////////////////////////////////////////////
00380 //++
00381 //
00382 //  CClusPropValueList::ScAllocValueList
00383 //
00384 //  Description:
00385 //      Allocate a value list buffer that's big enough to hold the next
00386 //      value.
00387 //
00388 //  Arguments:
00389 //      cbMinimumIn   Minimum size of the value list.
00390 //
00391 //  Return Value:
00392 //      None.
00393 //
00394 //--
00395 /////////////////////////////////////////////////////////////////////////////
00396 DWORD
00397 CClusPropValueList::ScAllocValueList(
00398     size_t cbMinimumIn
00399     )
00400 {
00401     ASSERT( cbMinimumIn > 0 );
00402
00403     DWORD   sc = ERROR_SUCCESS;
00404     size_t  cbTotal = 0;
00405
00406     //
00407     // Add the size of the item count and final endmark.
00408     //
00409
00410     cbMinimumIn += sizeof( CLUSPROP_VALUE );
00411     cbTotal = m_cbDataSize + cbMinimumIn;
00412
00413     if ( m_cbBufferSize < cbTotal )
00414     {
00415         PBYTE   _pbNewValuelist = NULL;
00416
00417         cbMinimumIn = max( BUFFER_GROWTH_FACTOR, cbMinimumIn );
00418         cbTotal = m_cbDataSize + cbMinimumIn;
00419
00420         //
00421         // Allocate and zero a new buffer.
00422         //
00423
00424         _pbNewValuelist = new BYTE[ cbTotal ];
00425         if ( _pbNewValuelist != NULL )
00426         {
00427             ZeroMemory( _pbNewValuelist, cbTotal );
00428
00429             //
00430             // If there was a previous buffer, copy it and the delete it.
00431             //
00432
00433             if ( m_cbhValueList.pb != NULL )
00434             {
00435                 if ( m_cbDataSize != 0 )
00436                 {
00437                     CopyMemory( _pbNewValuelist, m_cbhValueList.pb, m_cbDataSize );
00438                 } // if: data already exists in buffer
00439
00440                 delete [] m_cbhValueList.pb;
00441                 m_cbhCurrentValue.pb = _pbNewValuelist + (m_cbhCurrentValue.pb - m_cbhValueList.pb);
00442             } // if: there was a previous buffer
00443             else
00444             {
00445                 m_cbhCurrentValue.pb = _pbNewValuelist + sizeof( DWORD ); // move past prop count
00446             } // else: no previous buffer
00447
00448             //
00449             // Save the new buffer.
00450             //
00451
00452             m_cbhValueList.pb = _pbNewValuelist;
00453             m_cbBufferSize = cbTotal;
00454         } // if: allocation succeeded
00455         else
00456         {
00457             sc = ERROR_NOT_ENOUGH_MEMORY;
00458         } // else: allocation failed
00459     } // if: buffer isn't big enough
00460
00461     return sc;
00462
00463 } //*** CClusPropValueList::ScAllocValueList
00464
00465 /////////////////////////////////////////////////////////////////////////////
00466 //++
00467 //
00468 //  CClusPropValueList::ScGetResourceValueList
00469 //
00470 //  Description:
00471 //      Get value list of a resource.
00472 //
00473 //  Arguments:
00474 //      hResourceIn     Handle for the resource to get properties from.
00475 //      dwControlCodeIn Control code for the request.
00476 //      hHostNodeIn     Handle for the node to direct this request to.
00477 //                      Defaults to NULL.
00478 //      lpBufferIn      Input buffer for the request.  Defaults to NULL.
00479 //      cbBufferIn      Size of the input buffer.  Defaults to 0.
00480 //
00481 //  Return Value:
00482 //      None.
00483 //
00484 //--
00485 /////////////////////////////////////////////////////////////////////////////
00486 DWORD
00487 CClusPropValueList::ScGetResourceValueList(
00488       HRESOURCE hResourceIn
00489     , DWORD     dwControlCodeIn
00490     , HNODE     hHostNodeIn
00491     , LPVOID    lpBufferIn
00492     , size_t    cbBufferIn
00493     )
00494 {
00495     ASSERT( hResourceIn != NULL );
00496     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
00497             == ( CLUS_OBJECT_RESOURCE << CLUSCTL_OBJECT_SHIFT ) );
00498
00499     DWORD   sc = ERROR_SUCCESS;
00500     DWORD   cb = 512;
00501
00502     //
00503     // Overwrite anything that may be in the buffer.
00504     // Allows this class instance to be reused.
00505     //
00506
00507     m_cbDataSize = 0;
00508
00509     //
00510     // Get values.
00511     //
00512
00513     sc = ScAllocValueList( cb );
00514     if ( sc == ERROR_SUCCESS )
00515     {
00516         sc = ClusterResourceControl(
00517                         hResourceIn,
00518                         hHostNodeIn,
00519                         dwControlCodeIn,
00520                         lpBufferIn,
00521                         static_cast< DWORD >( cbBufferIn ),
00522                         m_cbhValueList.pb,
00523                         static_cast< DWORD >( m_cbBufferSize ),
00524                         &cb
00525                         );
00526         if ( sc == ERROR_MORE_DATA )
00527         {
00528             sc = ScAllocValueList( cb );
00529             if ( sc == ERROR_SUCCESS )
00530             {
00531                 sc = ClusterResourceControl(
00532                                 hResourceIn,
00533                                 hHostNodeIn,
00534                                 dwControlCodeIn,
00535                                 lpBufferIn,
00536                                 static_cast< DWORD >( cbBufferIn ),
00537                                 m_cbhValueList.pb,
00538                                 static_cast< DWORD >( m_cbBufferSize ),
00539                                 &cb
00540                                 );
00541             } // if: ScAllocValueList succeeded
00542         } // if: buffer too small
00543     } // if: ScAllocValueList succeeded
00544
00545     if ( sc != ERROR_SUCCESS )
00546     {
00547         DeleteValueList();
00548     } // if: error getting properties.
00549     else
00550     {
00551         m_cbDataSize = static_cast< size_t >( cb );
00552         m_cbDataLeft = static_cast< size_t >( cb );
00553     } // else: no errors
00554
00555     return sc;
00556
00557 } //*** CClusPropValueList::ScGetResourceValueList
00558
00559 /////////////////////////////////////////////////////////////////////////////
00560 //++
00561 //
00562 //  CClusPropValueList::ScGetResourceTypeValueList
00563 //
00564 //  Description:
00565 //      Get value list of a resource type.
00566 //
00567 //  Arguments:
00568 //      hClusterIn          Handle for the cluster in which the resource
00569 //                          type resides.
00570 //      pwszResTypeNameIn   Name of the resource type.
00571 //      dwControlCodeIn     Control code for the request.
00572 //      hHostNodeIn         Handle for the node to direct this request to.
00573 //                          Defaults to NULL.
00574 //      lpBufferIn          Input buffer for the request.  Defaults to NULL.
00575 //      cbBufferIn          Size of the input buffer.  Defaults to 0.
00576 //
00577 //  Return Value:
00578 //      None.
00579 //
00580 //--
00581 /////////////////////////////////////////////////////////////////////////////
00582 DWORD
00583 CClusPropValueList::ScGetResourceTypeValueList(
00584       HCLUSTER  hClusterIn
00585     , LPCWSTR   pwszResTypeNameIn
00586     , DWORD     dwControlCodeIn
00587     , HNODE     hHostNodeIn
00588     , LPVOID    lpBufferIn
00589     , size_t    cbBufferIn
00590     )
00591 {
00592     ASSERT( hClusterIn != NULL );
00593     ASSERT( pwszResTypeNameIn != NULL );
00594     ASSERT( *pwszResTypeNameIn != L'\0' );
00595     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
00596             == ( CLUS_OBJECT_RESOURCE_TYPE << CLUSCTL_OBJECT_SHIFT ) );
00597
00598     DWORD   sc = ERROR_SUCCESS;
00599     DWORD   cb = 512;
00600
00601     //
00602     // Overwrite anything that may be in the buffer.
00603     // Allows this class instance to be reused.
00604     //
00605
00606     m_cbDataSize = 0;
00607
00608     //
00609     // Get values.
00610     //
00611
00612     sc = ScAllocValueList( cb );
00613     if ( sc == ERROR_SUCCESS )
00614     {
00615         sc = ClusterResourceTypeControl(
00616                         hClusterIn,
00617                         pwszResTypeNameIn,
00618                         hHostNodeIn,
00619                         dwControlCodeIn,
00620                         lpBufferIn,
00621                         static_cast< DWORD >( cbBufferIn ),
00622                         m_cbhValueList.pb,
00623                         static_cast< DWORD >( m_cbBufferSize ),
00624                         &cb
00625                         );
00626         if ( sc == ERROR_MORE_DATA )
00627         {
00628             sc = ScAllocValueList( cb );
00629             if ( sc == ERROR_SUCCESS )
00630             {
00631                 sc = ClusterResourceTypeControl(
00632                                 hClusterIn,
00633                                 pwszResTypeNameIn,
00634                                 hHostNodeIn,
00635                                 dwControlCodeIn,
00636                                 lpBufferIn,
00637                                 static_cast< DWORD >( cbBufferIn ),
00638                                 m_cbhValueList.pb,
00639                                 static_cast< DWORD >( m_cbBufferSize ),
00640                                 &cb
00641                                 );
00642             } // if: ScAllocValueList succeeded
00643         } // if: buffer too small
00644     } // if: ScAllocValueList succeeded
00645
00646     if ( sc != ERROR_SUCCESS )
00647     {
00648         DeleteValueList();
00649     } // if: error getting properties.
00650     else
00651     {
00652         m_cbDataSize = static_cast< size_t >( cb );
00653         m_cbDataLeft = static_cast< size_t >( cb );
00654     } // else: no errors
00655
00656     return sc;
00657
00658 } //*** CClusPropValueList::ScGetResourceTypeValueList
00659
00660
00661 //*************************************************************************//
00662
00663
00664 /////////////////////////////////////////////////////////////////////////////
00665 // CClusPropList class
00666 /////////////////////////////////////////////////////////////////////////////
00667
00668 #ifdef __AFX_H__
00669 IMPLEMENT_DYNAMIC( CClusPropList, CObject );
00670 #endif // __AFX_H__
00671
00672 /////////////////////////////////////////////////////////////////////////////
00673 //++
00674 //
00675 //  CClusPropList::ScCopy
00676 //
00677 //  Description:
00678 //      Copy a property list.  This function is equivalent to an assignment
00679 //      operator.  Since this operation can fail, no assignment operator is
00680 //      provided.
00681 //
00682 //  Arguments:
00683 //      pcplPropListIn    The proplist to copy into this instance.
00684 //      cbPropListIn      The total size of the prop list.
00685 //
00686 //  Return Value:
00687 //      Win32 status code.
00688 //
00689 //--
00690 /////////////////////////////////////////////////////////////////////////////
00691 DWORD
00692 CClusPropList::ScCopy(
00693       const PCLUSPROP_LIST  pcplPropListIn
00694     , size_t                cbPropListIn
00695     )
00696 {
00697     ASSERT( pcplPropListIn != NULL );
00698
00699     DWORD   sc = ERROR_SUCCESS;
00700
00701     //
00702     // Clean up any vestiges of a previous prop list.
00703     //
00704
00705     if ( m_cbhPropList.pb != NULL )
00706     {
00707         DeletePropList();
00708     } // if: the current list is not empty
00709
00710     //
00711     // Allocate the new property list buffer.  If successful,
00712     // copy the source list.
00713     //
00714
00715     m_cbhPropList.pb = new BYTE[ cbPropListIn ];
00716     if ( m_cbhPropList.pb != NULL )
00717     {
00718         CopyMemory( m_cbhPropList.pList, pcplPropListIn, cbPropListIn );
00719         m_cbBufferSize = cbPropListIn;
00720         m_cbDataSize   = cbPropListIn;
00721         m_cbDataLeft   = cbPropListIn;
00722         sc = ScMoveToFirstProperty();
00723     } // if: new succeeded
00724     else
00725     {
00726         sc = ERROR_NOT_ENOUGH_MEMORY;
00727     } // else:
00728
00729     return sc;
00730
00731 } //*** CClusPropList::ScCopy
00732
00733 /////////////////////////////////////////////////////////////////////////////
00734 //++
00735 //
00736 //  CClusPropList::ScAppend
00737 //
00738 //  Description:
00739 //      Append to a property list.
00740 //
00741 //  Arguments:
00742 //      rclPropListIn    The proplist to append onto this instance.
00743 //
00744 //  Return Value:
00745 //      Win32 status code.
00746 //
00747 //--
00748 /////////////////////////////////////////////////////////////////////////////
00749 DWORD
00750 CClusPropList::ScAppend(
00751     const CClusPropList & rclPropListIn
00752     )
00753 {
00754     DWORD   sc = ERROR_SUCCESS;
00755     size_t  cbPropertyCountOffset = 0;
00756     size_t  cbIncrement = 0;
00757     size_t  cbDataLeft = 0;
00758     PBYTE   pbsrc = NULL;
00759     PBYTE   pbdest = NULL;
00760
00761     //
00762     //  Compute the number of bytes to get past the count of properties that
00763     //  is at the head of the list.  This is typically sizeof DWORD.
00764     //
00765
00766     cbPropertyCountOffset = sizeof( m_cbhPropList.pList->nPropertyCount );
00767
00768     //
00769     //  Compute the allocation increment.  This is used when growing our buffer
00770     //  and is the amount of data to copy from the passed in list.  This includes
00771     //  the trailing endmark.  m_cbDataSize does not include the leading property
00772     //  count DWORD.
00773     //
00774
00775     cbIncrement = rclPropListIn.m_cbDataSize;
00776
00777     //
00778     //  How much space remains in our current buffer?
00779     //
00780
00781     cbDataLeft = m_cbBufferSize - m_cbDataSize;
00782
00783     //
00784     //  If the size of the list to append is larger than what we have remaining
00785     //  then we need to grow the list.
00786     //
00787
00788     if ( cbIncrement > cbDataLeft )
00789     {
00790         sc = ScAllocPropList( m_cbDataSize + cbIncrement );
00791         if ( sc != ERROR_SUCCESS )
00792         {
00793             goto Cleanup;
00794         } // if:
00795     } // if:
00796
00797     pbdest = (PBYTE) &m_cbhPropList.pb[ cbPropertyCountOffset + m_cbDataSize ];
00798
00799     pbsrc = (PBYTE) &rclPropListIn.m_cbhPropList.pList->PropertyName;
00800
00801     CopyMemory( pbdest, pbsrc, cbIncrement );
00802
00803     //
00804     //  Grow our data size to match our new size.
00805     //
00806
00807     m_cbDataSize += cbIncrement;
00808
00809     //
00810     //  Increment our property count to include the count of properties appended to the end
00811     //  of our buffer.
00812     //
00813
00814     m_cbhPropList.pList->nPropertyCount += rclPropListIn.m_cbhPropList.pList->nPropertyCount;
00815
00816 Cleanup:
00817
00818     return sc;
00819
00820 } //*** CClusPropList::ScAppend
00821
00822 ////////////////////////////////////////////////////////////////////////////
00823 //++
00824 //
00825 //  CClusPropList::ScMoveToFirstProperty
00826 //
00827 //  Description:
00828 //      Move the cursor to the first propery in the list.
00829 //
00830 //  Arguments:
00831 //      None.
00832 //
00833 //  Return Value:
00834 //      ERROR_SUCCESS       Position moved to the first property successfully.
00835 //      ERROR_NO_MORE_ITEMS There are no properties in the list.
00836 //      ERROR_INVALID_DATA  Not enough data in the buffer.
00837 //
00838 //--
00839 /////////////////////////////////////////////////////////////////////////////
00840 DWORD
00841 CClusPropList::ScMoveToFirstProperty( void )
00842 {
00843     ASSERT( m_cbhPropList.pb != NULL );
00844     ASSERT( m_cbDataSize >= sizeof( m_cbhPropList.pList->nPropertyCount ) );
00845
00846     DWORD                   sc;
00847     size_t                  cbDataLeft;
00848     size_t                  cbDataSize;
00849     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
00850
00851     //
00852     // Make sure the buffer is big enough for the list header.
00853     //
00854
00855     if ( m_cbDataSize < sizeof( m_cbhPropList.pList->nPropertyCount ) )
00856     {
00857         sc = ERROR_INVALID_DATA;
00858         goto Cleanup;
00859     } // if: not enough data
00860
00861     //
00862     // Set the property counter to the number of properties in the list.
00863     //
00864
00865     m_nPropsRemaining = m_cbhPropList.pList->nPropertyCount;
00866
00867     //
00868     // Point the name pointer to the first name in the list.
00869     //
00870
00871     m_cbhCurrentPropName.pName = &m_cbhPropList.pList->PropertyName;
00872     m_cbDataLeft = m_cbDataSize - sizeof( m_cbhPropList.pList->nPropertyCount );
00873
00874     //
00875     // Check to see if there are any properties in the list.
00876     //
00877
00878     if ( m_nPropsRemaining == 0 )
00879     {
00880         sc = ERROR_NO_MORE_ITEMS;
00881         goto Cleanup;
00882     } // if: no properties in the list
00883
00884     //
00885     // Make sure the buffer is big enough for the first property name.
00886     //
00887
00888     if ( m_cbDataLeft < sizeof( *m_cbhCurrentPropName.pName ) )
00889     {
00890         sc = ERROR_INVALID_DATA;
00891         goto Cleanup;
00892     } // if: not enough data left
00893
00894     //
00895     // Calculate how much to advance the buffer pointer.
00896     //
00897
00898     cbDataSize = sizeof( *m_cbhCurrentPropName.pName )
00899                 + ALIGN_CLUSPROP( m_cbhCurrentPropName.pName->cbLength );
00900
00901     //
00902     // Make sure the buffer is big enough for the name header
00903     // and the data itself.
00904     //
00905
00906     if ( m_cbDataLeft < cbDataSize )
00907     {
00908         sc = ERROR_INVALID_DATA;
00909         goto Cleanup;
00910     } // if: not enough data left
00911
00912     //
00913     // Point the value buffer to the first value in the list.
00914     //
00915
00916     cbhCurrentValue.pb = m_cbhCurrentPropName.pb + cbDataSize;
00917     cbDataLeft = m_cbDataLeft - cbDataSize;
00918     m_pvlValues.Init( cbhCurrentValue, cbDataLeft );
00919
00920     //
00921     // Indicate we are successful.
00922     //
00923
00924     sc = ERROR_SUCCESS;
00925
00926 Cleanup:
00927
00928     return sc;
00929
00930 } //*** CClusPropList::ScMoveToFirstProperty
00931
00932 /////////////////////////////////////////////////////////////////////////////
00933 //++
00934 //
00935 //  CClusPropList::ScMoveToNextProperty
00936 //
00937 //  Description:
00938 //      Move the cursor to the next property in the list.
00939 //
00940 //  Arguments:
00941 //      None.
00942 //
00943 //  Return Value:
00944 //      ERROR_SUCCESS       Position moved to the next property successfully.
00945 //      ERROR_NO_MORE_ITEMS Already at the end of the list.
00946 //      ERROR_INVALID_DATA  Not enough data in the buffer.
00947 //
00948 //--
00949 /////////////////////////////////////////////////////////////////////////////
00950 DWORD
00951 CClusPropList::ScMoveToNextProperty( void )
00952 {
00953     ASSERT( m_cbhPropList.pb != NULL );
00954     ASSERT( m_pvlValues.CbhValueList().pb != NULL );
00955
00956     DWORD                   sc = ERROR_SUCCESS;
00957     size_t                  cbNameSize = 0;
00958     size_t                  cbDataLeft = 0;
00959     size_t                  cbDataSize = 0;
00960     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
00961     CLUSPROP_BUFFER_HELPER  cbhPropName;
00962
00963     cbhCurrentValue = m_pvlValues;
00964     cbDataLeft = m_pvlValues.CbDataLeft();
00965
00966     //
00967     // If we aren't already at the last property, attempt to move to the next one.
00968     //
00969
00970     sc = ScCheckIfAtLastProperty();
00971     if ( sc != ERROR_SUCCESS )
00972     {
00973         goto Cleanup;
00974     } // if: already at the last property (probably)
00975
00976     //
00977     // Make sure the buffer is big enough for the value header.
00978     //
00979
00980     if ( cbDataLeft < sizeof( *cbhCurrentValue.pValue ) )
00981     {
00982         sc = ERROR_INVALID_DATA;
00983         goto Cleanup;
00984     } // if: not enough data left
00985
00986     //
00987     // Careful!  Add offset only to cbhCurrentValue.pb.  Otherwise
00988     // pointer arithmetic will give undesirable results.
00989     //
00990
00991     while ( cbhCurrentValue.pSyntax->dw != CLUSPROP_SYNTAX_ENDMARK )
00992     {
00993         //
00994         // Make sure the buffer is big enough for the value
00995         // and an endmark.
00996         //
00997
00998         cbDataSize = sizeof( *cbhCurrentValue.pValue )
00999                     + ALIGN_CLUSPROP( cbhCurrentValue.pValue->cbLength );
01000         if ( cbDataLeft < cbDataSize + sizeof( *cbhCurrentValue.pSyntax ) )
01001         {
01002             sc = ERROR_INVALID_DATA;
01003             goto Cleanup;
01004         } // if: not enough data left
01005
01006         //
01007         // Advance past the value.
01008         //
01009
01010         cbhCurrentValue.pb += cbDataSize;
01011         cbDataLeft -= cbDataSize;
01012     } // while: not at endmark
01013
01014     if ( sc != ERROR_SUCCESS )
01015     {
01016         goto Cleanup;
01017     } // if: error occurred in loop
01018
01019     //
01020     // Advanced past the endmark.
01021     // Size check already performed in above loop.
01022     //
01023
01024     cbDataSize = sizeof( *cbhCurrentValue.pSyntax );
01025     cbhCurrentValue.pb += cbDataSize;
01026     cbDataLeft -= cbDataSize;
01027
01028     //
01029     // Point the name pointer to the next name in the list.
01030     //
01031
01032     cbhPropName = cbhCurrentValue;
01033     ASSERT( cbDataLeft == m_cbDataSize - (cbhPropName.pb - m_cbhPropList.pb) );
01034
01035     //
01036     // Calculate the size of the name with header.
01037     // Make sure the buffer is big enough for the name and an endmark.
01038     //
01039
01040     if ( cbDataLeft < sizeof( *cbhPropName.pName ) )
01041     {
01042         sc = ERROR_INVALID_DATA;
01043         goto Cleanup;
01044     } // if: not enough data
01045
01046     cbNameSize = sizeof( *cbhPropName.pName )
01047                 + ALIGN_CLUSPROP( cbhPropName.pName->cbLength );
01048
01049     if ( cbDataLeft < cbNameSize + sizeof( CLUSPROP_SYNTAX ) )
01050     {
01051         sc = ERROR_INVALID_DATA;
01052         goto Cleanup;
01053     } // if: not enough data
01054
01055     //
01056     // Point the value buffer to the first value in the list.
01057     //
01058
01059     cbhCurrentValue.pb = cbhPropName.pb + cbNameSize;
01060     m_cbhCurrentPropName = cbhPropName;
01061     m_cbDataLeft = cbDataLeft - cbNameSize;
01062     m_pvlValues.Init( cbhCurrentValue, m_cbDataLeft );
01063
01064     //
01065     // We've successfully advanced to the next property,
01066     // so there is now one fewer property remaining.
01067     //
01068
01069     --m_nPropsRemaining;
01070     ASSERT( m_nPropsRemaining >= 1 );
01071
01072     sc = ERROR_SUCCESS;
01073
01074 Cleanup:
01075
01076     return sc;
01077
01078 } //*** CClusPropList::ScMoveToNextProperty
01079
01080 /////////////////////////////////////////////////////////////////////////////
01081 //++
01082 //
01083 //  CClusPropList::ScMoveToPropertyByName
01084 //
01085 //  Description:
01086 //      Find the passed in property name in the proplist.  Note that the
01087 //      cursor is reset to the beginning at the beginning of the routine and
01088 //      the current state of the cursor is lost.
01089 //
01090 //  Arguments:
01091 //      pwszPropNameIn    Name of the property
01092 //
01093 //  Return Value:
01094 //      ERROR_SUCCESS if the property was found, other Win32 code if not.
01095 //
01096 //--
01097 /////////////////////////////////////////////////////////////////////////////
01098 DWORD
01099 CClusPropList::ScMoveToPropertyByName(
01100     LPCWSTR pwszPropNameIn
01101     )
01102 {
01103     ASSERT( m_cbhPropList.pb != NULL );
01104
01105     DWORD   sc = ERROR_SUCCESS;
01106
01107     sc = ScMoveToFirstProperty();
01108     if ( sc == ERROR_SUCCESS )
01109     {
01110         do
01111         {
01112             //
01113             // See if this is the specified property.  If so, we're done.
01114             //
01115
01116             if ( IStringCompareW( m_cbhCurrentPropName.pName->sz, pwszPropNameIn ) == 0 )
01117             {
01118                 break;
01119             } // if: property found
01120
01121             //
01122             // Advance to the next property.
01123             //
01124
01125             sc = ScMoveToNextProperty();   // No because we expect an error when at the d
01126
01127         } while ( sc == ERROR_SUCCESS );   // do-while: not end of list
01128     } // if: successfully moved to the first property
01129
01130     return sc;
01131
01132 } //*** ClusPropList::ScMoveToPropertyByName( LPCWSTR )
01133
01134 /////////////////////////////////////////////////////////////////////////////
01135 //++
01136 //
01137 //  CClusPropList::ScAllocPropList
01138 //
01139 //  Description:
01140 //      Allocate a property list buffer that's big enough to hold the next
01141 //      property.
01142 //
01143 //  Arguments:
01144 //      cbMinimumIn   Minimum size of the property list.
01145 //
01146 //  Return Value:
01147 //      ERROR_SUCCESS
01148 //      ERROR_NOT_ENOUGH_MEMORY
01149 //      Other Win32 error codes
01150 //
01151 //--
01152 /////////////////////////////////////////////////////////////////////////////
01153 DWORD
01154 CClusPropList::ScAllocPropList(
01155     size_t cbMinimumIn
01156     )
01157 {
01158     ASSERT( cbMinimumIn > 0 );
01159
01160     DWORD   sc = ERROR_SUCCESS;
01161     size_t  cbTotal = 0;
01162
01163     //
01164     // Add the size of the item count and final endmark.
01165     //
01166
01167     cbMinimumIn += sizeof( CLUSPROP_VALUE );
01168     cbTotal = m_cbDataSize + cbMinimumIn;
01169
01170     if ( m_cbBufferSize < cbTotal )
01171     {
01172         PBYTE   pbNewProplist = NULL;
01173
01174         cbMinimumIn = max( BUFFER_GROWTH_FACTOR, cbMinimumIn );
01175         cbTotal = m_cbDataSize + cbMinimumIn;
01176
01177         //
01178         // Allocate and zero a new buffer.
01179         //
01180
01181         pbNewProplist = new BYTE[ cbTotal ];
01182         if ( pbNewProplist != NULL )
01183         {
01184             ZeroMemory( pbNewProplist, cbTotal );
01185
01186             //
01187             // If there was a previous buffer, copy it and the delete it.
01188             //
01189
01190             if ( m_cbhPropList.pb != NULL )
01191             {
01192                 if ( m_cbDataSize != 0 )
01193                 {
01194                     CopyMemory( pbNewProplist, m_cbhPropList.pb, m_cbDataSize );
01195                 } // if: data already exists in buffer
01196
01197                 delete [] m_cbhPropList.pb;
01198                 m_cbhCurrentProp.pb = pbNewProplist + (m_cbhCurrentProp.pb - m_cbhPropList.pb);
01199             } // if: there was a previous buffer
01200             else
01201             {
01202                 m_cbhCurrentProp.pb = pbNewProplist + sizeof( DWORD ); // move past prop count
01203             } // else: no previous buffer
01204
01205             //
01206             // Save the new buffer.
01207             //
01208
01209             m_cbhPropList.pb = pbNewProplist;
01210             m_cbBufferSize = cbTotal;
01211         } // if: allocation succeeded
01212         else
01213         {
01214             sc = ERROR_NOT_ENOUGH_MEMORY;
01215         } // else: allocation failed
01216     } // if: buffer isn't big enough
01217
01218     return sc;
01219
01220 } //*** CClusPropList::ScAllocPropList
01221
01222 /////////////////////////////////////////////////////////////////////////////
01223 //++
01224 //
01225 //  CClusPropList::ScAddProp
01226 //
01227 //  Description:
01228 //      Add a string property to a property list if it has changed.
01229 //
01230 //  Arguments:
01231 //      pwszNameIn        Name of the property.
01232 //      pwszValueIn       Value of the property to set in the list.
01233 //      pwszPrevValueIn   Previous value of the property.
01234 //
01235 //  Return Value:
01236 //      ERROR_SUCCESS or other Win32 error code.
01237 //
01238 //--
01239 /////////////////////////////////////////////////////////////////////////////
01240 DWORD
01241 CClusPropList::ScAddProp(
01242       LPCWSTR   pwszNameIn
01243     , LPCWSTR   pwszValueIn
01244     , LPCWSTR   pwszPrevValueIn
01245     )
01246 {
01247     ASSERT( pwszNameIn != NULL );
01248
01249     DWORD                   sc = ERROR_SUCCESS;
01250     BOOL                    fValuesDifferent = TRUE;
01251     PCLUSPROP_PROPERTY_NAME pName = NULL;
01252     PCLUSPROP_SZ            pValue = NULL;
01253
01254     if ( ( pwszPrevValueIn != NULL ) && ( IStringCompareW( pwszValueIn, pwszPrevValueIn ) == 0 ) )
01255     {
01256         fValuesDifferent = FALSE;
01257     } // if: we have a prev value and the values are the same
01258
01259     //
01260     // If we should always add, or if the new value and the previous value
01261     // are not equal, add the property to the property list.
01262     //
01263
01264     if ( m_fAlwaysAddProp || fValuesDifferent )
01265     {
01266         size_t  cbNameSize;
01267         size_t  cbDataSize;
01268         size_t  cbValueSize = 0;
01269
01270         //
01271         // Calculate sizes and make sure we have a property list.
01272         //
01273
01274         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01275                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01276
01277         cbDataSize = (lstrlenW( pwszValueIn ) + 1) * sizeof( *pwszValueIn );
01278
01279         cbValueSize = sizeof( CLUSPROP_SZ )
01280                     + ALIGN_CLUSPROP( cbDataSize )
01281                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01282
01283         sc = ScAllocPropList( cbNameSize + cbValueSize );
01284         if ( sc == ERROR_SUCCESS )
01285         {
01286             //
01287             // Set the property name.
01288             //
01289
01290             pName = m_cbhCurrentProp.pName;
01291             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01292             m_cbhCurrentProp.pb += cbNameSize;
01293
01294             //
01295             // Set the property value.
01296             //
01297
01298             pValue = m_cbhCurrentProp.pStringValue;
01299             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pwszValueIn, cbDataSize );
01300             m_cbhCurrentProp.pb += cbValueSize;
01301
01302             //
01303             // Increment the property count and buffer size.
01304             //
01305
01306             m_cbhPropList.pList->nPropertyCount++;
01307             m_cbDataSize += cbNameSize + cbValueSize;
01308         } // if: ScAllocPropList successfully grew the proplist
01309
01310     } // if: the value has changed
01311
01312     return sc;
01313
01314 } //*** CClusPropList::ScAddProp( LPCWSTR )
01315
01316 /////////////////////////////////////////////////////////////////////////////
01317 //++
01318 //
01319 //  CClusPropList::ScAddMultiSzProp
01320 //
01321 //  Description:
01322 //      Add a string property to a property list if it has changed.
01323 //
01324 //  Arguments:
01325 //      pwszNameIn        Name of the property.
01326 //      pwszValueIn       Value of the property to set in the list.
01327 //      pwszPrevValueIn   Previous value of the property.
01328 //
01329 //  Return Value:
01330 //      ERROR_SUCCESS or other Win32 error code.
01331 //
01332 //--
01333 /////////////////////////////////////////////////////////////////////////////
01334 DWORD
01335 CClusPropList::ScAddMultiSzProp(
01336       LPCWSTR   pwszNameIn
01337     , LPCWSTR   pwszValueIn
01338     , LPCWSTR   pwszPrevValueIn
01339     )
01340 {
01341     ASSERT( pwszNameIn != NULL );
01342
01343     DWORD                   sc = ERROR_SUCCESS;
01344     BOOL                    fValuesDifferent = TRUE;
01345     PCLUSPROP_PROPERTY_NAME pName = NULL;
01346     PCLUSPROP_MULTI_SZ      pValue = NULL;
01347
01348     if ( ( pwszPrevValueIn != NULL ) && ( NCompareMultiSz( pwszValueIn, pwszPrevValueIn ) == 0 ) )
01349     {
01350         fValuesDifferent = FALSE;
01351     } // if: we have a prev value and the values are the same
01352
01353     //
01354     // If we should always add, or if the new value and the previous value
01355     // are not equal, add the property to the property list.
01356     //
01357
01358     if ( m_fAlwaysAddProp || fValuesDifferent )
01359     {
01360         size_t  cbNameSize;
01361         size_t  cbDataSize;
01362         size_t  cbValueSize;
01363
01364         //
01365         // Calculate sizes and make sure we have a property list.
01366         //
01367
01368         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01369                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01370
01371         cbDataSize = static_cast< DWORD >( (CchMultiSz( pwszValueIn ) + 1) * sizeof( *pwszValueIn ) );
01372
01373         cbValueSize = sizeof( CLUSPROP_SZ )
01374                     + ALIGN_CLUSPROP( cbDataSize )
01375                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01376
01377         sc = ScAllocPropList( cbNameSize + cbValueSize );
01378         if ( sc == ERROR_SUCCESS )
01379         {
01380             //
01381             // Set the property name.
01382             //
01383
01384             pName = m_cbhCurrentProp.pName;
01385             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01386             m_cbhCurrentProp.pb += cbNameSize;
01387
01388             //
01389             // Set the property value.
01390             //
01391
01392             pValue = m_cbhCurrentProp.pMultiSzValue;
01393             CopyMultiSzProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pwszValueIn, cbDataSize );
01394             m_cbhCurrentProp.pb += cbValueSize;
01395
01396             //
01397             // Increment the property count and buffer size.
01398             //
01399
01400             m_cbhPropList.pList->nPropertyCount++;
01401             m_cbDataSize += cbNameSize + cbValueSize;
01402         } // if: ScAllocPropList successfully grew the proplist
01403     } // if: the value has changed
01404
01405     return sc;
01406
01407 } //*** CClusPropList::ScAddMultiSzProp( LPCWSTR )
01408
01409 /////////////////////////////////////////////////////////////////////////////
01410 //++
01411 //
01412 //  CClusPropList::ScAddExpandSzProp
01413 //
01414 //  Description:
01415 //      Add an EXPAND_SZ string property to a property list if it has changed.
01416 //
01417 //  Arguments:
01418 //      pwszNameIn        Name of the property.
01419 //      pwszValueIn       Value of the property to set in the list.
01420 //      pwszPrevValueIn   Previous value of the property.
01421 //
01422 //  Return Value:
01423 //      None.
01424 //
01425 //--
01426 /////////////////////////////////////////////////////////////////////////////
01427 DWORD
01428 CClusPropList::ScAddExpandSzProp(
01429       LPCWSTR   pwszNameIn
01430     , LPCWSTR   pwszValueIn
01431     , LPCWSTR   pwszPrevValueIn
01432     )
01433 {
01434     ASSERT( pwszNameIn != NULL );
01435
01436     DWORD                   sc = ERROR_SUCCESS;
01437     BOOL                    fValuesDifferent = TRUE;
01438     PCLUSPROP_PROPERTY_NAME pName = NULL;
01439     PCLUSPROP_SZ            pValue = NULL;
01440
01441     if ( ( pwszPrevValueIn != NULL ) && ( IStringCompareW( pwszValueIn, pwszPrevValueIn ) == 0 ) )
01442     {
01443         fValuesDifferent = FALSE;
01444     } // if: we have a prev value and the values are the same
01445
01446     //
01447     // If we should always add, or if the new value and the previous value
01448     // are not equal, add the property to the property list.
01449     //
01450
01451     if ( m_fAlwaysAddProp || fValuesDifferent )
01452     {
01453         size_t  cbNameSize = 0;
01454         size_t  cbDataSize = 0;
01455         size_t  cbValueSize = 0;
01456
01457         //
01458         // Calculate sizes and make sure we have a property list.
01459         //
01460
01461         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01462                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01463
01464         cbDataSize = (lstrlenW( pwszValueIn ) + 1) * sizeof( *pwszValueIn );
01465
01466         cbValueSize = sizeof( CLUSPROP_SZ )
01467                     + ALIGN_CLUSPROP( cbDataSize )
01468                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01469
01470         sc = ScAllocPropList( cbNameSize + cbValueSize );
01471         if ( sc == ERROR_SUCCESS )
01472         {
01473             //
01474             // Set the property name.
01475             //
01476
01477             pName = m_cbhCurrentProp.pName;
01478             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01479             m_cbhCurrentProp.pb += cbNameSize;
01480
01481             //
01482             // Set the property value.
01483             //
01484
01485             pValue = m_cbhCurrentProp.pStringValue;
01486             CopyExpandSzProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pwszValueIn, cbDataSize );
01487             m_cbhCurrentProp.pb += cbValueSize;
01488
01489             //
01490             // Increment the property count and buffer size.
01491             //
01492
01493             m_cbhPropList.pList->nPropertyCount++;
01494             m_cbDataSize += cbNameSize + cbValueSize;
01495         } // if: ScAllocPropList successfully grew the proplist
01496     } // if: the value has changed
01497
01498     return sc;
01499
01500 } //*** CClusPropList::ScAddExpandSzProp( LPCWSTR )
01501
01502 /////////////////////////////////////////////////////////////////////////////
01503 //++
01504 //
01505 //  CClusPropList::ScAddProp
01506 //
01507 //  Description:
01508 //      Add a DWORD property to a property list if it has changed.
01509 //
01510 //  Arguments:
01511 //      pwszNameIn        Name of the property.
01512 //      nValueIn          Value of the property to set in the list.
01513 //      nPrevValueIn      Previous value of the property.
01514 //
01515 //  Return Value:
01516 //      None.
01517 //
01518 //--
01519 /////////////////////////////////////////////////////////////////////////////
01520 DWORD
01521 CClusPropList::ScAddProp(
01522       LPCWSTR   pwszNameIn
01523     , DWORD     nValueIn
01524     , DWORD     nPrevValueIn
01525     )
01526 {
01527     ASSERT( pwszNameIn != NULL );
01528
01529     DWORD                   sc = ERROR_SUCCESS;
01530     PCLUSPROP_PROPERTY_NAME pName = NULL;
01531     PCLUSPROP_DWORD         pValue = NULL;
01532
01533     if ( m_fAlwaysAddProp || ( nValueIn != nPrevValueIn ) )
01534     {
01535         size_t  cbNameSize = 0;
01536         size_t  cbValueSize = 0;
01537
01538         //
01539         // Calculate sizes and make sure we have a property list.
01540         //
01541
01542         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01543                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01544
01545         cbValueSize = sizeof( CLUSPROP_DWORD )
01546                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01547
01548         sc = ScAllocPropList( cbNameSize + cbValueSize );
01549         if ( sc == ERROR_SUCCESS )
01550         {
01551             //
01552             // Set the property name.
01553             //
01554
01555             pName = m_cbhCurrentProp.pName;
01556             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01557             m_cbhCurrentProp.pb += cbNameSize;
01558
01559             //
01560             // Set the property value.
01561             //
01562
01563             pValue = m_cbhCurrentProp.pDwordValue;
01564             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, nValueIn );
01565             m_cbhCurrentProp.pb += cbValueSize;
01566
01567             //
01568             // Increment the property count and buffer size.
01569             //
01570
01571             m_cbhPropList.pList->nPropertyCount++;
01572             m_cbDataSize += cbNameSize + cbValueSize;
01573         } // if: ScAllocPropList successfully grew the proplist
01574     } // if: the value has changed
01575
01576     return sc;
01577
01578 } //*** CClusPropList::ScAddProp( DWORD )
01579
01580 /////////////////////////////////////////////////////////////////////////////
01581 //++
01582 //
01583 //  CClusPropList::ScAddProp
01584 //
01585 //  Description:
01586 //      Add a LONG property to a property list if it has changed.
01587 //
01588 //  Arguments:
01589 //      pwszNameIn        Name of the property.
01590 //      nValueIn          Value of the property to set in the list.
01591 //      nPrevValueIn      Previous value of the property.
01592 //
01593 //  Return Value:
01594 //      None.
01595 //
01596 //--
01597 /////////////////////////////////////////////////////////////////////////////
01598 DWORD CClusPropList::ScAddProp(
01599       LPCWSTR  pwszNameIn
01600     , LONG     nValueIn
01601     , LONG     nPrevValueIn
01602     )
01603 {
01604     ASSERT( pwszNameIn != NULL );
01605
01606     DWORD                   sc = ERROR_SUCCESS;
01607     PCLUSPROP_PROPERTY_NAME pName = NULL;
01608     PCLUSPROP_LONG          pValue = NULL;
01609
01610     if ( m_fAlwaysAddProp || ( nValueIn != nPrevValueIn ) )
01611     {
01612         size_t  cbNameSize = 0;
01613         size_t  cbValueSize = 0;
01614
01615         //
01616         // Calculate sizes and make sure we have a property list.
01617         //
01618
01619         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01620                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01621
01622         cbValueSize = sizeof( CLUSPROP_LONG )
01623                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01624
01625         sc = ScAllocPropList( cbNameSize + cbValueSize );
01626         if ( sc == ERROR_SUCCESS )
01627         {
01628             //
01629             // Set the property name.
01630             //
01631
01632             pName = m_cbhCurrentProp.pName;
01633             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01634             m_cbhCurrentProp.pb += cbNameSize;
01635
01636             //
01637             // Set the property value.
01638             //
01639
01640             pValue = m_cbhCurrentProp.pLongValue;
01641             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, nValueIn );
01642             m_cbhCurrentProp.pb += cbValueSize;
01643
01644             //
01645             // Increment the property count and buffer size.
01646             //
01647
01648             m_cbhPropList.pList->nPropertyCount++;
01649             m_cbDataSize += cbNameSize + cbValueSize;
01650         } // if: ScAllocPropList successfully grew the proplist
01651     } // if: the value has changed
01652
01653     return sc;
01654
01655 } //*** CClusPropList::ScAddProp( LONG )
01656
01657 /////////////////////////////////////////////////////////////////////////////
01658 //++
01659 //
01660 //  CClusPropList::ScAddProp
01661 //
01662 //  Description:
01663 //      Add a binary property to a property list if it has changed.
01664 //
01665 //  Arguments:
01666 //      pwszNameIn        Name of the property.
01667 //      pbValueIn         Value of the property to set in the list.
01668 //      cbValueIn         Count of bytes in pbValueIn.
01669 //      pbPrevValueIn     Previous value of the property.
01670 //      cbPrevValueIn     Count of bytes in pbPrevValueIn.
01671 //
01672 //  Return Value:
01673 //      None.
01674 //
01675 //--
01676 /////////////////////////////////////////////////////////////////////////////
01677 DWORD
01678 CClusPropList::ScAddProp(
01679       LPCWSTR               pwszNameIn
01680     , const unsigned char * pbValueIn
01681     , size_t                cbValueIn
01682     , const unsigned char * pbPrevValueIn
01683     , size_t                cbPrevValueIn
01684     )
01685 {
01686     ASSERT( pwszNameIn != NULL );
01687
01688     DWORD                   sc = ERROR_SUCCESS;
01689     BOOL                    _fChanged = FALSE;
01690     PCLUSPROP_PROPERTY_NAME pName = NULL;
01691     PCLUSPROP_BINARY        pValue = NULL;
01692
01693     //
01694     // Determine if the buffer has changed.
01695     //
01696
01697     if ( m_fAlwaysAddProp || (cbValueIn != cbPrevValueIn) )
01698     {
01699         _fChanged = TRUE;
01700     } // if: always adding the property or the value size changed
01701     else if ( ( cbValueIn != 0 ) && ( cbPrevValueIn != 0 ) )
01702     {
01703         _fChanged = memcmp( pbValueIn, pbPrevValueIn, cbValueIn ) != 0;
01704     } // else if: value length changed
01705
01706     if ( _fChanged )
01707     {
01708         size_t  cbNameSize = 0;
01709         size_t  cbValueSize = 0;
01710
01711         //
01712         // Calculate sizes and make sure we have a property list.
01713         //
01714
01715         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01716                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01717
01718         cbValueSize = sizeof( CLUSPROP_BINARY )
01719                     + ALIGN_CLUSPROP( cbValueIn )
01720                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01721
01722         sc = ScAllocPropList( cbNameSize + cbValueSize );
01723         if ( sc == ERROR_SUCCESS )
01724         {
01725             //
01726             // Set the property name.
01727             //
01728
01729             pName = m_cbhCurrentProp.pName;
01730             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01731             m_cbhCurrentProp.pb += cbNameSize;
01732
01733             //
01734             // Set the property value.
01735             //
01736
01737             pValue = m_cbhCurrentProp.pBinaryValue;
01738             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pbValueIn, cbValueIn );
01739             m_cbhCurrentProp.pb += cbValueSize;
01740
01741             //
01742             // Increment the property count and buffer size.
01743             //
01744
01745             m_cbhPropList.pList->nPropertyCount++;
01746             m_cbDataSize += cbNameSize + cbValueSize;
01747         } // if: ScAllocPropList successfully grew the proplist
01748     } // if: the value has changed
01749
01750     return sc;
01751
01752 } //*** CClusPropList::ScAddProp( const unsigned char * )
01753
01754 /////////////////////////////////////////////////////////////////////////////
01755 //++
01756 //
01757 //  CClusPropList::ScAddProp
01758 //
01759 //  Routine Description:
01760 //      Add a ULONGLONG property to a property list if it has changed.
01761 //
01762 //  Arguments:
01763 //      pwszNameIn        Name of the property.
01764 //      ullValueIn        Value of the property to set in the list.
01765 //      ullPrevValueIn    Previous value of the property.
01766 //
01767 //  Return Value:
01768 //      ERROR_SUCCESS or other Win32 error codes.
01769 //
01770 //--
01771 /////////////////////////////////////////////////////////////////////////////
01772 DWORD
01773 CClusPropList::ScAddProp(
01774       LPCWSTR   pwszNameIn
01775     , ULONGLONG ullValueIn
01776     , ULONGLONG ullPrevValueIn
01777     )
01778 {
01779     ASSERT( pwszNameIn != NULL );
01780
01781     DWORD                       sc = ERROR_SUCCESS;
01782     PCLUSPROP_PROPERTY_NAME     pName = NULL;
01783     PCLUSPROP_ULARGE_INTEGER    pValue = NULL;
01784
01785     if ( m_fAlwaysAddProp || ( ullValueIn != ullPrevValueIn ) )
01786     {
01787         size_t  cbNameSize = 0;
01788         size_t  cbValueSize = 0;
01789
01790         //
01791         // Calculate sizes and make sure we have a property list.
01792         //
01793
01794         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01795                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01796
01797         cbValueSize = sizeof( CLUSPROP_ULARGE_INTEGER )
01798                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01799
01800         sc = ScAllocPropList( cbNameSize + cbValueSize );
01801         if ( sc == ERROR_SUCCESS )
01802         {
01803             //
01804             // Set the property name.
01805             //
01806
01807             pName = m_cbhCurrentProp.pName;
01808             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01809             m_cbhCurrentProp.pb += cbNameSize;
01810
01811             //
01812             // Set the property value.
01813             //
01814
01815             pValue = m_cbhCurrentProp.pULargeIntegerValue;
01816             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, ullValueIn );
01817             m_cbhCurrentProp.pb += cbValueSize;
01818
01819             //
01820             // Increment the property count and buffer size.
01821             //
01822
01823             m_cbhPropList.pList->nPropertyCount++;
01824             m_cbDataSize += cbNameSize + cbValueSize;
01825         } // if: ScAllocPropList successfully grew the proplist
01826     } // if: the value has changed
01827
01828     return sc;
01829
01830 } //*** CClusPropList::ScAddProp( ULONGLONG )
01831
01832 /////////////////////////////////////////////////////////////////////////////
01833 //++
01834 //
01835 //  CClusPropList::ScAddProp
01836 //
01837 //  Routine Description:
01838 //      Add a LONGLONG property to a property list if it has changed.
01839 //
01840 //  Arguments:
01841 //      pwszNameIn        Name of the property.
01842 //      llValueIn         Value of the property to set in the list.
01843 //      llPrevValueIn     Previous value of the property.
01844 //
01845 //  Return Value:
01846 //      ERROR_SUCCESS or other Win32 status codes.
01847 //
01848 //--
01849 /////////////////////////////////////////////////////////////////////////////
01850 DWORD
01851 CClusPropList::ScAddProp(
01852       LPCWSTR      pwszNameIn
01853     , LONGLONG     llValueIn
01854     , LONGLONG     llPrevValueIn
01855     )
01856 {
01857     ASSERT( pwszNameIn != NULL );
01858
01859     DWORD                       sc = ERROR_SUCCESS;
01860     PCLUSPROP_PROPERTY_NAME     pName = NULL;
01861     PCLUSPROP_LARGE_INTEGER     pValue = NULL;
01862
01863     if ( m_fAlwaysAddProp || ( llValueIn != llPrevValueIn ) )
01864     {
01865         size_t  cbNameSize = 0;
01866         size_t  cbValueSize = 0;
01867
01868         //
01869         // Calculate sizes and make sure we have a property list.
01870         //
01871
01872         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01873                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01874
01875         cbValueSize = sizeof( CLUSPROP_LARGE_INTEGER )
01876                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01877
01878         sc = ScAllocPropList( cbNameSize + cbValueSize );
01879         if ( sc == ERROR_SUCCESS )
01880         {
01881             //
01882             // Set the property name.
01883             //
01884
01885             pName = m_cbhCurrentProp.pName;
01886             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01887             m_cbhCurrentProp.pb += cbNameSize;
01888
01889             //
01890             // Set the property value.
01891             //
01892
01893             pValue = m_cbhCurrentProp.pLargeIntegerValue;
01894             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, llValueIn );
01895             m_cbhCurrentProp.pb += cbValueSize;
01896
01897             //
01898             // Increment the property count and buffer size.
01899             //
01900
01901             m_cbhPropList.pList->nPropertyCount++;
01902             m_cbDataSize += cbNameSize + cbValueSize;
01903         } // if: ScAllocPropList successfully grew the proplist
01904     } // if: the value has changed
01905
01906     return sc;
01907
01908 } //*** CClusPropList::ScAddProp( LONGLONG )
01909
01910 /////////////////////////////////////////////////////////////////////////////
01911 //++
01912 //
01913 //  CClusPropList::ScSetPropToDefault
01914 //
01915 //  Description:
01916 //      Add a property to the property list so that it will revert to its
01917 //      default value.
01918 //
01919 //  Arguments:
01920 //      pwszNameIn          Name of the property.
01921 //      cpfPropFormatIn     Format of property
01922 //
01923 //  Return Value:
01924 //      ERROR_SUCCESS or other Win32 status codes.
01925 //
01926 //--
01927 /////////////////////////////////////////////////////////////////////////////
01928 DWORD
01929 CClusPropList::ScSetPropToDefault(
01930       LPCWSTR                   pwszNameIn
01931     , CLUSTER_PROPERTY_FORMAT   cpfPropFormatIn
01932     )
01933 {
01934     ASSERT( pwszNameIn != NULL );
01935
01936     DWORD                   sc = ERROR_SUCCESS;
01937     size_t                  cbNameSize = 0;
01938     size_t                  cbValueSize = 0;
01939     PCLUSPROP_PROPERTY_NAME pName = NULL;
01940     PCLUSPROP_VALUE         pValue = NULL;
01941
01942     //
01943     //  Calculate sizes and make sure we have a property list.
01944     //
01945
01946     cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01947                 + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01948
01949     cbValueSize = sizeof( CLUSPROP_BINARY )
01950                 + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01951
01952     sc = ScAllocPropList( cbNameSize + cbValueSize );
01953     if ( sc == ERROR_SUCCESS )
01954     {
01955         //
01956         // Set the property name.
01957         //
01958
01959         pName = m_cbhCurrentProp.pName;
01960         CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01961         m_cbhCurrentProp.pb += cbNameSize;
01962
01963         //
01964         // Set the property value.
01965         //
01966
01967         pValue = m_cbhCurrentProp.pValue;
01968         CopyEmptyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, cpfPropFormatIn );
01969         m_cbhCurrentProp.pb += cbValueSize;
01970
01971         //
01972         // Increment the property count and buffer size.
01973         //
01974
01975         m_cbhPropList.pList->nPropertyCount++;
01976         m_cbDataSize += cbNameSize + cbValueSize;
01977     } // if:
01978
01979     return sc;
01980
01981 } //*** CClusPropList::ScSetPropToDefault
01982
01983 /////////////////////////////////////////////////////////////////////////////
01984 //++
01985 //
01986 //  CClusPropList::CopyProp
01987 //
01988 //  Description:
01989 //      Copy a string property to a property structure.
01990 //
01991 //  Arguments:
01992 //      ppropOut      Property structure to fill.
01993 //      cptPropTypeIn Type of string.
01994 //      pszIn         String to copy.
01995 //      cbSzIn        Count of bytes in pwsz string.  If specified as 0,
01996 //                    the the length will be determined by a call to strlen.
01997 //
01998 //  Return Value:
01999 //      None.
02000 //
02001 //--
02002 /////////////////////////////////////////////////////////////////////////////
02003 void
02004 CClusPropList::CopyProp(
02005       PCLUSPROP_SZ          ppropOut
02006     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02007     , LPCWSTR               pszIn
02008     , size_t                cbSzIn        // = 0
02009     )
02010 {
02011     ASSERT( ppropOut != NULL );
02012     ASSERT( pszIn != NULL );
02013
02014     CLUSPROP_BUFFER_HELPER  cbhProps;
02015     HRESULT                 hr = S_OK;
02016
02017     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_SZ;
02018     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02019
02020     if ( cbSzIn == 0 )
02021     {
02022         cbSzIn = (lstrlenW( pszIn ) + 1) * sizeof( *pszIn );
02023     } // if: zero size specified
02024
02025     ASSERT( cbSzIn == (lstrlenW( pszIn ) + 1) * sizeof( *pszIn ) );
02026
02027     ppropOut->cbLength = static_cast< DWORD >( cbSzIn );
02028
02029     hr = StringCbCopyW( ppropOut->sz, cbSzIn, pszIn );
02030     if ( SUCCEEDED( hr ) )
02031     {
02032         //
02033         // Set an endmark.
02034         //
02035
02036         cbhProps.pStringValue = ppropOut;
02037         cbhProps.pb += sizeof( *cbhProps.pStringValue ) + ALIGN_CLUSPROP( cbSzIn );
02038         cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02039     } // if:
02040
02041 } //*** CClusPropList::CopyProp
02042
02043 /////////////////////////////////////////////////////////////////////////////
02044 //++
02045 //
02046 //  CClusPropList::CopyMultiSzProp
02047 //
02048 //  Description:
02049 //      Copy a MULTI_SZ string property to a property structure.
02050 //
02051 //  Arguments:
02052 //      ppropOut      Property structure to fill.
02053 //      cptPropTypeIn Type of string.
02054 //      pszIn         String to copy.
02055 //      cbSzIn        Count of bytes in pszIn string.  If specified as 0,
02056 //                    the the length will be determined by calls to strlen.
02057 //
02058 //  Return Value:
02059 //      None.
02060 //
02061 //--
02062 /////////////////////////////////////////////////////////////////////////////
02063 void
02064 CClusPropList::CopyMultiSzProp(
02065       PCLUSPROP_MULTI_SZ    ppropOut
02066     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02067     , LPCWSTR               pszIn
02068     , size_t                cbSzIn
02069     )
02070 {
02071     ASSERT( ppropOut != NULL );
02072     ASSERT( pszIn != NULL );
02073
02074     CLUSPROP_BUFFER_HELPER  cbhProps;
02075
02076     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_MULTI_SZ;
02077     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02078
02079     if ( cbSzIn == 0 )
02080     {
02081         cbSzIn = (CchMultiSz( pszIn ) + 1) * sizeof( *pszIn );
02082     } // if: zero size specified
02083
02084     ASSERT( cbSzIn == (CchMultiSz( pszIn ) + 1) * sizeof( *pszIn ) );
02085
02086     ppropOut->cbLength = static_cast< DWORD >( cbSzIn );
02087     CopyMemory( ppropOut->sz, pszIn, cbSzIn );
02088
02089     //
02090     // Set an endmark.
02091     //
02092
02093     cbhProps.pMultiSzValue = ppropOut;
02094     cbhProps.pb += sizeof( *cbhProps.pMultiSzValue ) + ALIGN_CLUSPROP( cbSzIn );
02095     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02096
02097 } //*** CClusPropList::CopyMultiSzProp
02098
02099 /////////////////////////////////////////////////////////////////////////////
02100 //++
02101 //
02102 //  CClusPropList::CopyExpandSzProp
02103 //
02104 //  Description:
02105 //      Copy an EXPAND_SZ string property to a property structure.
02106 //
02107 //  Arguments:
02108 //      ppropOut      Property structure to fill.
02109 //      cptPropTypeIn Type of string.
02110 //      pszIn         String to copy.
02111 //      cbSzIn        Count of bytes in pszIn string.
02112 //
02113 //  Return Value:
02114 //      None.
02115 //
02116 //--
02117 /////////////////////////////////////////////////////////////////////////////
02118 void
02119 CClusPropList::CopyExpandSzProp(
02120       PCLUSPROP_SZ          ppropOut
02121     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02122     , LPCWSTR               pszIn
02123     , size_t                cbSzIn
02124     )
02125 {
02126     ASSERT( ppropOut != NULL );
02127     ASSERT( pszIn != NULL );
02128
02129     CLUSPROP_BUFFER_HELPER  cbhProps;
02130     HRESULT                 hr = S_OK;
02131
02132     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_EXPAND_SZ;
02133     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02134
02135     if ( cbSzIn == 0 )
02136     {
02137         cbSzIn = (lstrlenW( pszIn ) + 1) * sizeof( *pszIn );
02138     } // if: cbSzIn == 0
02139
02140     ASSERT( cbSzIn == (lstrlenW( pszIn ) + 1) * sizeof( *pszIn ) );
02141
02142     ppropOut->cbLength = static_cast< DWORD >( cbSzIn );
02143
02144     hr = StringCbCopyW( ppropOut->sz, cbSzIn, pszIn );
02145     if ( SUCCEEDED( hr ) )
02146     {
02147         //
02148         // Set an endmark.
02149         //
02150
02151         cbhProps.pStringValue = ppropOut;
02152         cbhProps.pb += sizeof( *cbhProps.pStringValue ) + ALIGN_CLUSPROP( cbSzIn );
02153         cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02154     } // if:
02155
02156 } //*** CClusPropList::CopyExpandSzProp
02157
02158 /////////////////////////////////////////////////////////////////////////////
02159 //++
02160 //
02161 //  CClusPropList::CopyProp
02162 //
02163 //  Description:
02164 //      Copy a DWORD property to a property structure.
02165 //
02166 //  Arguments:
02167 //      ppropOut      Property structure to fill.
02168 //      cptPropTypeIn Type of DWORD.
02169 //      nValueIn      Property value to copy.
02170 //
02171 //  Return Value:
02172 //      None.
02173 //
02174 //--
02175 /////////////////////////////////////////////////////////////////////////////
02176 void
02177 CClusPropList::CopyProp(
02178       PCLUSPROP_DWORD       ppropOut
02179     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02180     , DWORD                 nValueIn
02181     )
02182 {
02183     ASSERT( ppropOut != NULL );
02184
02185     CLUSPROP_BUFFER_HELPER  cbhProps;
02186
02187     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_DWORD;
02188     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02189     ppropOut->cbLength = sizeof( DWORD );
02190     ppropOut->dw = nValueIn;
02191
02192     //
02193     // Set an endmark.
02194     //
02195
02196     cbhProps.pDwordValue = ppropOut;
02197     cbhProps.pb += sizeof( *cbhProps.pDwordValue );
02198     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02199
02200 } //*** CClusPropList::CopyProp( DWORD )
02201
02202 /////////////////////////////////////////////////////////////////////////////
02203 //++
02204 //
02205 //  CClusPropList::CopyProp
02206 //
02207 //  Description:
02208 //      Copy a LONG property to a property structure.
02209 //
02210 //  Arguments:
02211 //      ppropOut      Property structure to fill.
02212 //      cptPropTypeIn Type of LONG.
02213 //      nValueIn      Property value to copy.
02214 //
02215 //  Return Value:
02216 //      None.
02217 //
02218 //--
02219 /////////////////////////////////////////////////////////////////////////////
02220 void
02221 CClusPropList::CopyProp(
02222       PCLUSPROP_LONG        ppropOut
02223     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02224     , LONG                  nValueIn
02225     )
02226 {
02227     ASSERT( ppropOut != NULL );
02228
02229     CLUSPROP_BUFFER_HELPER  cbhProps;
02230
02231     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_LONG;
02232     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02233     ppropOut->cbLength = sizeof( DWORD );
02234     ppropOut->l = nValueIn;
02235
02236     //
02237     // Set an endmark.
02238     //
02239
02240     cbhProps.pLongValue = ppropOut;
02241     cbhProps.pb += sizeof( *cbhProps.pLongValue );
02242     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02243
02244 } //*** CClusPropList::CopyProp( LONG )
02245
02246 /////////////////////////////////////////////////////////////////////////////
02247 //++
02248 //
02249 //  CClusPropList::CopyProp
02250 //
02251 //  Description:
02252 //      Copy a ULONGLONG property to a property structure.
02253 //
02254 //  Arguments:
02255 //      ppropOut        Property structure to fill.
02256 //      cptPropTypeIn   Type of LONG.
02257 //      ullValueIn      Property value to copy.
02258 //
02259 //  Return Value:
02260 //      None.
02261 //
02262 //--
02263 /////////////////////////////////////////////////////////////////////////////
02264 void
02265 CClusPropList::CopyProp(
02266       PCLUSPROP_ULARGE_INTEGER  ppropOut
02267     , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
02268     , ULONGLONG                 ullValueIn
02269     )
02270 {
02271     ASSERT( ppropOut != NULL );
02272
02273     CLUSPROP_BUFFER_HELPER  cbhProps;
02274
02275     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_ULARGE_INTEGER;
02276     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02277     ppropOut->cbLength = sizeof( ULONGLONG );
02278
02279     //
02280     // ppropOut may not have the correct alignment for large ints; copy as two
02281     // DWORDs to be safe
02282     //
02283
02284     ppropOut->li.u = ((ULARGE_INTEGER *)&ullValueIn)->u;
02285
02286     //
02287     // Set an endmark.
02288     //
02289
02290     cbhProps.pULargeIntegerValue = ppropOut;
02291     cbhProps.pb += sizeof( *cbhProps.pULargeIntegerValue );
02292     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02293
02294 } //*** CClusPropList::CopyProp( ULONGLONG )
02295
02296 /////////////////////////////////////////////////////////////////////////////
02297 //++
02298 //
02299 //  CClusPropList::CopyProp
02300 //
02301 //  Description:
02302 //      Copy a LONGLONG property to a property structure.
02303 //
02304 //  Arguments:
02305 //      ppropOut        Property structure to fill.
02306 //      cptPropTypeIn   Type of LONG.
02307 //      llValueIn       Property value to copy.
02308 //
02309 //  Return Value:
02310 //      None.
02311 //
02312 //--
02313 /////////////////////////////////////////////////////////////////////////////
02314 void
02315 CClusPropList::CopyProp(
02316       PCLUSPROP_LARGE_INTEGER   ppropOut
02317     , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
02318     , LONGLONG                  llValueIn
02319     )
02320 {
02321     ASSERT( ppropOut != NULL );
02322
02323     CLUSPROP_BUFFER_HELPER  cbhProps;
02324
02325     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_LARGE_INTEGER;
02326     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02327     ppropOut->cbLength = sizeof( LONGLONG );
02328
02329     //
02330     // ppropOut may not have the correct alignment for large ints; copy as two
02331     // DWORDs to be safe
02332     //
02333
02334     ppropOut->li.u = ((LARGE_INTEGER *)&llValueIn)->u;
02335
02336     //
02337     // Set an endmark.
02338     //
02339
02340     cbhProps.pLargeIntegerValue = ppropOut;
02341     cbhProps.pb += sizeof( *cbhProps.pLargeIntegerValue );
02342     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02343
02344 } //*** CClusPropList::CopyProp( LONGLONG )
02345
02346 /////////////////////////////////////////////////////////////////////////////
02347 //++
02348 //
02349 //  CClusPropList::CopyProp
02350 //
02351 //  Description:
02352 //      Copy a binary property to a property structure.
02353 //
02354 //  Arguments:
02355 //      ppropOut        Property structure to fill.
02356 //      cptPropTypeIn   Type of string.
02357 //      pbValueIn       Block to copy.
02358 //      cbValueIn       Count of bytes in pb buffer.
02359 //
02360 //  Return Value:
02361 //      None.
02362 //
02363 //--
02364 /////////////////////////////////////////////////////////////////////////////
02365 void
02366 CClusPropList::CopyProp(
02367       PCLUSPROP_BINARY      ppropOut
02368     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02369     , const unsigned char * pbValueIn
02370     , size_t                cbValueIn
02371     )
02372 {
02373     ASSERT( ppropOut != NULL );
02374
02375     CLUSPROP_BUFFER_HELPER  cbhProps;
02376
02377     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_BINARY;
02378     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02379     ppropOut->cbLength = static_cast< DWORD >( cbValueIn );
02380
02381     if ( cbValueIn > 0 )
02382     {
02383         CopyMemory( ppropOut->rgb, pbValueIn, cbValueIn );
02384     } // if: non-zero data length
02385
02386     //
02387     // Set an endmark.
02388     //
02389
02390     cbhProps.pBinaryValue = ppropOut;
02391     cbhProps.pb += sizeof( *cbhProps.pStringValue ) + ALIGN_CLUSPROP( cbValueIn );
02392     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02393
02394 } //*** CClusPropList::CopyProp( PBYTE )
02395
02396 /////////////////////////////////////////////////////////////////////////////
02397 //++
02398 //
02399 //  CClusPropList::CopyEmptyProp
02400 //
02401 //  Description:
02402 //      Copy an empty property to a property structure.
02403 //
02404 //  Arguments:
02405 //      ppropOut            Property structure to fill.
02406 //      cptPropTypeIn       Type of property.
02407 //      cpfPropFormatIn     Format of property.
02408 //
02409 //  Return Value:
02410 //      None.
02411 //
02412 //--
02413 /////////////////////////////////////////////////////////////////////////////
02414 void
02415 CClusPropList::CopyEmptyProp(
02416       PCLUSPROP_VALUE           ppropOut
02417     , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
02418     , CLUSTER_PROPERTY_FORMAT   cptPropFmt
02419     )
02420 {
02421     ASSERT( ppropOut != NULL );
02422
02423     CLUSPROP_BUFFER_HELPER  cbhProps;
02424
02425     ppropOut->Syntax.wFormat = static_cast< WORD >( cptPropFmt );
02426     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02427     ppropOut->cbLength = 0;
02428
02429     //
02430     // Set an endmark.
02431     //
02432
02433     cbhProps.pValue = ppropOut;
02434     cbhProps.pb += sizeof( *cbhProps.pValue );
02435     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02436
02437 } //*** CClusPropList::CopyEmptyProp
02438
02439 /////////////////////////////////////////////////////////////////////////////
02440 //++
02441 //
02442 //  CClusPropList::ScGetNodeProperties
02443 //
02444 //  Description:
02445 //      Get properties on a node.
02446 //
02447 //  Arguments:
02448 //      hNodeIn           Handle for the node to get properties from.
02449 //      dwControlCodeIn   Control code for the request.
02450 //      hHostNodeIn       Handle for the node to direct this request to.
02451 //                        Defaults to NULL.
02452 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02453 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02454 //
02455 //  Return Value:
02456 //      None.
02457 //
02458 //--
02459 /////////////////////////////////////////////////////////////////////////////
02460 DWORD
02461 CClusPropList::ScGetNodeProperties(
02462       HNODE     hNodeIn
02463     , DWORD     dwControlCodeIn
02464     , HNODE     hHostNodeIn
02465     , LPVOID    lpBufferIn              // = NULL
02466     , size_t    cbBufferIn              // = 0
02467     )
02468 {
02469     ASSERT( hNodeIn != NULL );
02470     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02471             == ( CLUS_OBJECT_NODE << CLUSCTL_OBJECT_SHIFT ) );
02472
02473     DWORD   sc = ERROR_SUCCESS;
02474     DWORD   cbProps = 256;
02475
02476     //
02477     // Overwrite anything that may be in the buffer.
02478     // Allows this class instance to be reused.
02479     //
02480
02481     m_cbDataSize = 0;
02482
02483     //
02484     // Get properties.
02485     //
02486
02487     sc = ScAllocPropList( cbProps );
02488     if ( sc == ERROR_SUCCESS )
02489     {
02490         sc = ClusterNodeControl(
02491                           hNodeIn
02492                         , hHostNodeIn
02493                         , dwControlCodeIn
02494                         , lpBufferIn
02495                         , static_cast< DWORD >( cbBufferIn )
02496                         , m_cbhPropList.pb
02497                         , static_cast< DWORD >( m_cbBufferSize )
02498                         , &cbProps
02499                         );
02500         if ( sc == ERROR_MORE_DATA )
02501         {
02502             sc = ScAllocPropList( cbProps );
02503             if ( sc == ERROR_SUCCESS )
02504             {
02505                 sc = ClusterNodeControl(
02506                                   hNodeIn
02507                                 , hHostNodeIn
02508                                 , dwControlCodeIn
02509                                 , lpBufferIn
02510                                 , static_cast< DWORD >( cbBufferIn )
02511                                 , m_cbhPropList.pb
02512                                 , static_cast< DWORD >( m_cbBufferSize )
02513                                 , &cbProps
02514                                 );
02515             } // if: ScAllocPropList succeeded
02516         } // if: buffer too small
02517     } // if: ScAllocPropList succeeded
02518
02519     if ( sc != ERROR_SUCCESS )
02520     {
02521         DeletePropList();
02522     } // if: error getting properties.
02523     else
02524     {
02525         m_cbDataSize = static_cast< size_t >( cbProps );
02526         m_cbDataLeft = static_cast< size_t >( cbProps );
02527     } // else: no errors
02528
02529     return sc;
02530
02531 } //*** CClusPropList::ScGetNodeProperties
02532
02533 /////////////////////////////////////////////////////////////////////////////
02534 //++
02535 //
02536 //  CClusPropList::ScGetGroupProperties
02537 //
02538 //  Description:
02539 //      Get properties on a group.
02540 //
02541 //  Arguments:
02542 //      hGroupIn          Handle for the group to get properties from.
02543 //      dwControlCodeIn   Control code for the request.
02544 //      hHostNodeIn       Handle for the node to direct this request to.
02545 //                        Defaults to NULL.
02546 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02547 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02548 //
02549 //  Return Value:
02550 //      None.
02551 //
02552 //--
02553 /////////////////////////////////////////////////////////////////////////////
02554 DWORD
02555 CClusPropList::ScGetGroupProperties(
02556       HGROUP    hGroupIn
02557     , DWORD     dwControlCodeIn
02558     , HNODE     hHostNodeIn
02559     , LPVOID    lpBufferIn          // = NULL
02560     , size_t    cbBufferIn          // = 0
02561     )
02562 {
02563     ASSERT( hGroupIn != NULL );
02564     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02565             == ( CLUS_OBJECT_GROUP << CLUSCTL_OBJECT_SHIFT ) );
02566
02567     DWORD   sc = ERROR_SUCCESS;
02568     DWORD   cbProps = 256;
02569
02570     //
02571     // Overwrite anything that may be in the buffer.
02572     // Allows this class instance to be reused.
02573     //
02574
02575     m_cbDataSize = 0;
02576
02577     //
02578     // Get properties.
02579     //
02580
02581     sc = ScAllocPropList( cbProps );
02582     if ( sc == ERROR_SUCCESS )
02583     {
02584         sc = ClusterGroupControl(
02585                           hGroupIn
02586                         , hHostNodeIn
02587                         , dwControlCodeIn
02588                         , lpBufferIn
02589                         , static_cast< DWORD >( cbBufferIn )
02590                         , m_cbhPropList.pb
02591                         , static_cast< DWORD >( m_cbBufferSize )
02592                         , &cbProps
02593                         );
02594         if ( sc == ERROR_MORE_DATA )
02595         {
02596             sc = ScAllocPropList( cbProps );
02597             if ( sc == ERROR_SUCCESS )
02598             {
02599                 sc = ClusterGroupControl(
02600                                   hGroupIn
02601                                 , hHostNodeIn
02602                                 , dwControlCodeIn
02603                                 , lpBufferIn
02604                                 , static_cast< DWORD >( cbBufferIn )
02605                                 , m_cbhPropList.pb
02606                                 , static_cast< DWORD >( m_cbBufferSize )
02607                                 , &cbProps
02608                                 );
02609             } // if: ScAllocPropList succeeded
02610         } // if: buffer too small
02611     } // if: ScAllocPropList succeeded
02612
02613     if ( sc != ERROR_SUCCESS )
02614     {
02615         DeletePropList();
02616     } // if: error getting properties.
02617     else
02618     {
02619         m_cbDataSize = static_cast< size_t >( cbProps );
02620         m_cbDataLeft = static_cast< size_t >( cbProps );
02621     } // else: no errors
02622
02623     return sc;
02624
02625 } //*** CClusPropList::ScGetGroupProperties
02626
02627 /////////////////////////////////////////////////////////////////////////////
02628 //++
02629 //
02630 //  CClusPropList::ScGetResourceProperties
02631 //
02632 //  Description:
02633 //      Get properties on a resource.
02634 //
02635 //  Arguments:
02636 //      hResourceIn       Handle for the resource to get properties from.
02637 //      dwControlCodeIn   Control code for the request.
02638 //      hHostNodeIn       Handle for the node to direct this request to.
02639 //                        Defaults to NULL.
02640 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02641 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02642 //
02643 //  Return Value:
02644 //      None.
02645 //
02646 //--
02647 /////////////////////////////////////////////////////////////////////////////
02648 DWORD
02649 CClusPropList::ScGetResourceProperties(
02650       HRESOURCE hResourceIn
02651     , DWORD     dwControlCodeIn
02652     , HNODE     hHostNodeIn
02653     , LPVOID    lpBufferIn          // = NULL
02654     , size_t    cbBufferIn          // = 0
02655     )
02656 {
02657     ASSERT( hResourceIn != NULL );
02658     ASSERT( ( dwControlCodeIn & (CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02659             == ( CLUS_OBJECT_RESOURCE << CLUSCTL_OBJECT_SHIFT ) );
02660
02661     DWORD   sc = ERROR_SUCCESS;
02662     DWORD   cbProps = 256;
02663
02664     //
02665     // Overwrite anything that may be in the buffer.
02666     // Allows this class instance to be reused.
02667     //
02668
02669     m_cbDataSize = 0;
02670
02671     //
02672     // Get properties.
02673     //
02674
02675     sc = ScAllocPropList( cbProps );
02676     if ( sc == ERROR_SUCCESS )
02677     {
02678         sc = ClusterResourceControl(
02679                           hResourceIn
02680                         , hHostNodeIn
02681                         , dwControlCodeIn
02682                         , lpBufferIn
02683                         , static_cast< DWORD >( cbBufferIn )
02684                         , m_cbhPropList.pb
02685                         , static_cast< DWORD >( m_cbBufferSize )
02686                         , &cbProps
02687                         );
02688         if ( sc == ERROR_MORE_DATA )
02689         {
02690             sc = ScAllocPropList( cbProps );
02691             if ( sc == ERROR_SUCCESS )
02692             {
02693                 sc = ClusterResourceControl(
02694                                   hResourceIn
02695                                 , hHostNodeIn
02696                                 , dwControlCodeIn
02697                                 , lpBufferIn
02698                                 , static_cast< DWORD >( cbBufferIn )
02699                                 , m_cbhPropList.pb
02700                                 , static_cast< DWORD >( m_cbBufferSize )
02701                                 , &cbProps
02702                                 );
02703             } // if: ScAllocPropList succeeded
02704         } // if: buffer too small
02705     } // if: ScAllocPropList succeeded
02706
02707     if ( sc != ERROR_SUCCESS )
02708     {
02709         DeletePropList();
02710     } // if: error getting properties.
02711     else
02712     {
02713         m_cbDataSize = static_cast< size_t >( cbProps );
02714         m_cbDataLeft = static_cast< size_t >( cbProps );
02715     } // else: no errors
02716
02717     return sc;
02718
02719 } //*** CClusPropList::ScGetResourceProperties
02720
02721 /////////////////////////////////////////////////////////////////////////////
02722 //++
02723 //
02724 //  CClusPropList::ScGetResourceTypeProperties
02725 //
02726 //  Description:
02727 //      Get properties on a resource type.
02728 //
02729 //  Arguments:
02730 //      hClusterIn        Handle for the cluster in which the resource
02731 //                        type resides.
02732 //      pwszResTypeNameIn Name of the resource type.
02733 //      dwControlCodeIn   Control code for the request.
02734 //      hHostNodeIn       Handle for the node to direct this request to.
02735 //                        Defaults to NULL.
02736 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02737 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02738 //
02739 //  Return Value:
02740 //      None.
02741 //
02742 //--
02743 /////////////////////////////////////////////////////////////////////////////
02744 DWORD
02745 CClusPropList::ScGetResourceTypeProperties(
02746       HCLUSTER  hClusterIn
02747     , LPCWSTR   pwszResTypeNameIn
02748     , DWORD     dwControlCodeIn
02749     , HNODE     hHostNodeIn
02750     , LPVOID    lpBufferIn          // = NULL
02751     , size_t    cbBufferIn          // = 0
02752     )
02753 {
02754     ASSERT( hClusterIn != NULL );
02755     ASSERT( pwszResTypeNameIn != NULL );
02756     ASSERT( *pwszResTypeNameIn != L'\0' );
02757     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02758             == ( CLUS_OBJECT_RESOURCE_TYPE << CLUSCTL_OBJECT_SHIFT ) );
02759
02760     DWORD   sc = ERROR_SUCCESS;
02761     DWORD   cbProps = 256;
02762
02763     //
02764     // Overwrite anything that may be in the buffer.
02765     // Allows this class instance to be reused.
02766     //
02767
02768     m_cbDataSize = 0;
02769
02770     //
02771     // Get properties.
02772     //
02773
02774     sc = ScAllocPropList( cbProps );
02775     if ( sc == ERROR_SUCCESS )
02776     {
02777         sc = ClusterResourceTypeControl(
02778                           hClusterIn
02779                         , pwszResTypeNameIn
02780                         , hHostNodeIn
02781                         , dwControlCodeIn
02782                         , lpBufferIn
02783                         , static_cast< DWORD >( cbBufferIn )
02784                         , m_cbhPropList.pb
02785                         , static_cast< DWORD >( m_cbBufferSize )
02786                         , &cbProps
02787                         );
02788         if ( sc == ERROR_MORE_DATA )
02789         {
02790             sc = ScAllocPropList( cbProps );
02791             if ( sc == ERROR_SUCCESS )
02792             {
02793                 sc = ClusterResourceTypeControl(
02794                                   hClusterIn
02795                                 , pwszResTypeNameIn
02796                                 , hHostNodeIn
02797                                 , dwControlCodeIn
02798                                 , lpBufferIn
02799                                 , static_cast< DWORD >( cbBufferIn )
02800                                 , m_cbhPropList.pb
02801                                 , static_cast< DWORD >( m_cbBufferSize )
02802                                 , &cbProps
02803                                 );
02804             } // if: ScAllocPropList succeeded
02805         } // if: buffer too small
02806     } // if: ScAllocPropList succeeded
02807
02808     if ( sc != ERROR_SUCCESS )
02809     {
02810         DeletePropList();
02811     } // if: error getting properties.
02812     else
02813     {
02814         m_cbDataSize = static_cast< size_t >( cbProps );
02815         m_cbDataLeft = static_cast< size_t >( cbProps );
02816     } // else: no errors
02817
02818     return sc;
02819
02820 } //*** CClusPropList::ScGetResourceTypeProperties
02821
02822 /////////////////////////////////////////////////////////////////////////////
02823 //++
02824 //
02825 //  CClusPropList::ScGetNetworkProperties
02826 //
02827 //  Description:
02828 //      Get properties on a network.
02829 //
02830 //  Arguments:
02831 //      hNetworkIn        Handle for the network to get properties from.
02832 //      dwControlCodeIn   Control code for the request.
02833 //      hHostNodeIn       Handle for the node to direct this request to.
02834 //                        Defaults to NULL.
02835 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02836 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02837 //
02838 //  Return Value:
02839 //      None.
02840 //
02841 //--
02842 /////////////////////////////////////////////////////////////////////////////
02843 DWORD
02844 CClusPropList::ScGetNetworkProperties(
02845       HNETWORK  hNetworkIn
02846     , DWORD     dwControlCodeIn
02847     , HNODE     hHostNodeIn
02848     , LPVOID    lpBufferIn              // = NULL
02849     , size_t    cbBufferIn              // = 0
02850     )
02851 {
02852     ASSERT( hNetworkIn != NULL );
02853     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02854             == ( CLUS_OBJECT_NETWORK << CLUSCTL_OBJECT_SHIFT ) );
02855
02856     DWORD   sc = ERROR_SUCCESS;
02857     DWORD   cbProps = 256;
02858
02859     //
02860     // Overwrite anything that may be in the buffer.
02861     // Allows this class instance to be reused.
02862     //
02863
02864     m_cbDataSize = 0;
02865
02866     //
02867     // Get properties.
02868     //
02869     sc = ScAllocPropList( cbProps );
02870     if ( sc == ERROR_SUCCESS )
02871     {
02872         sc = ClusterNetworkControl(
02873                           hNetworkIn
02874                         , hHostNodeIn
02875                         , dwControlCodeIn
02876                         , lpBufferIn
02877                         , static_cast< DWORD >( cbBufferIn )
02878                         , m_cbhPropList.pb
02879                         , static_cast< DWORD >( m_cbBufferSize )
02880                         , &cbProps
02881                         );
02882         if ( sc == ERROR_MORE_DATA )
02883         {
02884             sc = ScAllocPropList( cbProps );
02885             if ( sc == ERROR_SUCCESS )
02886             {
02887                 sc = ClusterNetworkControl(
02888                                   hNetworkIn
02889                                 , hHostNodeIn
02890                                 , dwControlCodeIn
02891                                 , lpBufferIn
02892                                 , static_cast< DWORD >( cbBufferIn )
02893                                 , m_cbhPropList.pb
02894                                 , static_cast< DWORD >( m_cbBufferSize )
02895                                 , &cbProps
02896                                 );
02897             } // if: ScAllocPropList succeeded
02898         } // if: buffer too small
02899     } // if: ScAllocPropList succeeded
02900
02901     if ( sc != ERROR_SUCCESS )
02902     {
02903         DeletePropList();
02904     } // if: error getting private properties.
02905     else
02906     {
02907         m_cbDataSize = static_cast< size_t >( cbProps );
02908         m_cbDataLeft = static_cast< size_t >( cbProps );
02909     } // else: no errors
02910
02911     return sc;
02912
02913 } //*** CClusPropList::ScGetNetworkProperties
02914
02915 /////////////////////////////////////////////////////////////////////////////
02916 //++
02917 //
02918 //  CClusPropList::ScGetNetInterfaceProperties
02919 //
02920 //  Description:
02921 //      Get properties on a network interface.
02922 //
02923 //  Arguments:
02924 //      hNetInterfaceIn   Handle for the network interface to get properties from.
02925 //      dwControlCodeIn   Control code for the request.
02926 //      hHostNodeIn       Handle for the node to direct this request to.
02927 //                        Defaults to NULL.
02928 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02929 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02930 //
02931 //  Return Value:
02932 //      None.
02933 //
02934 //--
02935 /////////////////////////////////////////////////////////////////////////////
02936 DWORD
02937 CClusPropList::ScGetNetInterfaceProperties(
02938       HNETINTERFACE hNetInterfaceIn
02939     , DWORD         dwControlCodeIn
02940     , HNODE         hHostNodeIn
02941     , LPVOID        lpBufferIn              // = NULL
02942     , size_t        cbBufferIn              // = 0
02943     )
02944 {
02945     ASSERT( hNetInterfaceIn != NULL );
02946     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02947             == ( CLUS_OBJECT_NETINTERFACE << CLUSCTL_OBJECT_SHIFT ) );
02948
02949     DWORD   sc = ERROR_SUCCESS;
02950     DWORD   cbProps = 256;
02951
02952     //
02953     // Overwrite anything that may be in the buffer.
02954     // Allows this class instance to be reused.
02955     //
02956
02957     m_cbDataSize = 0;
02958
02959     //
02960     // Get properties.
02961     //
02962
02963     sc = ScAllocPropList( cbProps );
02964     if ( sc == ERROR_SUCCESS )
02965     {
02966         sc = ClusterNetInterfaceControl(
02967                           hNetInterfaceIn
02968                         , hHostNodeIn
02969                         , dwControlCodeIn
02970                         , lpBufferIn
02971                         , static_cast< DWORD >( cbBufferIn )
02972                         , m_cbhPropList.pb
02973                         , static_cast< DWORD >( m_cbBufferSize )
02974                         , &cbProps
02975                         );
02976         if ( sc == ERROR_MORE_DATA )
02977         {
02978             sc = ScAllocPropList( cbProps );
02979             if ( sc == ERROR_SUCCESS )
02980             {
02981                 sc = ClusterNetInterfaceControl(
02982                                   hNetInterfaceIn
02983                                 , hHostNodeIn
02984                                 , dwControlCodeIn
02985                                 , lpBufferIn
02986                                 , static_cast< DWORD >( cbBufferIn )
02987                                 , m_cbhPropList.pb
02988                                 , static_cast< DWORD >( m_cbBufferSize )
02989                                 , &cbProps
02990                                 );
02991             } // if: ScAllocPropList succeeded
02992         } // if: buffer too small
02993     } // if: ScAllocPropList succeeded
02994
02995     if ( sc != ERROR_SUCCESS )
02996     {
02997         DeletePropList();
02998     } // if: error getting private properties.
02999     else
03000     {
03001         m_cbDataSize = static_cast< size_t >( cbProps );
03002         m_cbDataLeft = static_cast< size_t >( cbProps );
03003     } // else: no errors
03004
03005     return sc;
03006
03007 } //*** CClusPropList::ScGetNetInterfaceProperties
03008
03009
03010 /////////////////////////////////////////////////////////////////////////////
03011 //++
03012 //
03013 //  CClusPropList::ScGetClusterProperties
03014 //
03015 //  Description:
03016 //      Get properties on a cluster.
03017 //
03018 //  Arguments:
03019 //      hClusterIn        Handle for the cluster to get properties from.
03020 //      dwControlCodeIn   Control code for the request.
03021 //      hHostNodeIn       Handle for the node to direct this request to.
03022 //                        Defaults to NULL.
03023 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
03024 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
03025 //
03026 //  Return Value:
03027 //      None.
03028 //
03029 //--
03030 /////////////////////////////////////////////////////////////////////////////
03031 DWORD
03032 CClusPropList::ScGetClusterProperties(
03033       HCLUSTER  hClusterIn
03034     , DWORD     dwControlCodeIn
03035     , HNODE     hHostNodeIn
03036     , LPVOID    lpBufferIn              // = NULL
03037     , size_t    cbBufferIn              // = 0
03038     )
03039 {
03040     ASSERT( hClusterIn != NULL );
03041     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
03042             == ( CLUS_OBJECT_CLUSTER << CLUSCTL_OBJECT_SHIFT ) );
03043
03044     DWORD   sc = ERROR_SUCCESS;
03045     DWORD   cbProps = 256;
03046
03047     //
03048     // Overwrite anything that may be in the buffer.
03049     // Allows this class instance to be reused.
03050     //
03051
03052     m_cbDataSize = 0;
03053
03054     //
03055     // Get properties.
03056     //
03057
03058     sc = ScAllocPropList( cbProps );
03059     if ( sc == ERROR_SUCCESS )
03060     {
03061         sc = ClusterControl(
03062                           hClusterIn
03063                         , hHostNodeIn
03064                         , dwControlCodeIn
03065                         , lpBufferIn
03066                         , static_cast< DWORD >( cbBufferIn )
03067                         , m_cbhPropList.pb
03068                         , static_cast< DWORD >( m_cbBufferSize )
03069                         , &cbProps
03070                         );
03071         if ( sc == ERROR_MORE_DATA )
03072         {
03073             sc = ScAllocPropList( cbProps );
03074             if ( sc == ERROR_SUCCESS )
03075             {
03076                 sc = ClusterControl(
03077                                   hClusterIn
03078                                 , hHostNodeIn
03079                                 , dwControlCodeIn
03080                                 , lpBufferIn
03081                                 , static_cast< DWORD >( cbBufferIn )
03082                                 , m_cbhPropList.pb
03083                                 , static_cast< DWORD >( m_cbBufferSize )
03084                                 , &cbProps
03085                                 );
03086             } // if: ScAllocPropList succeeded
03087         } // if: buffer too small
03088     } // if: ScAllocPropList succeeded
03089
03090     if ( sc != ERROR_SUCCESS )
03091     {
03092         DeletePropList();
03093     } // if: error getting private properties.
03094     else
03095     {
03096         m_cbDataSize = static_cast< size_t >( cbProps );
03097         m_cbDataLeft = static_cast< size_t >( cbProps );
03098     } // else: no errors
03099
03100     return sc;
03101
03102 } //*** CClusPropList::ScGetClusterProperties
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTabLite Member List

This is the complete list of members for CTabLite, including all inherited members.
AdjustRect(RECT *pRect, BOOL fLarger=FALSE) | CTabLite | [inline, virtual]
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CSplitterLite(HWND hWndParent=NULL, UINT nID=0) | CSplitterLite |
CTabLite(HWND hWndParent=NULL, UINT nID=0) | CTabLite |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DeleteAllItems() | CTabLite | [inline, virtual]
DeleteItem(INDEX iItem) | CTabLite | [inline, virtual]
DestroyWindow() | CWndLite | [virtual]
DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient) | CSplitterLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
FindTab(LPARAM lParam) | CTabLite | [virtual]
GetCurSel() const | CTabLite | [inline, virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetItem(INDEX iItem, WCHAR *pwszText, ULONG ulMaxLength, LPARAM *plParam=NULL) | CTabLite |
GetItemCount() | CTabLite | [inline, virtual]
GetItemData(INDEX iItem) | CTabLite |
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
InsertItem(INDEX iItem, LPCWSTR pwszText, LPARAM lParam=PARAM_NONE, INT iImage=IMAGE_NONE, DWORD dwState=STATE_NONE, DWORD dwStateMask=STATE_NONE) | CTabLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hCursorOld | CSplitterLite |
m_hCursorRight | CSplitterLite |
m_hCursorTop | CSplitterLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iBorderCX | CSplitterLite |
m_iBorderCY | CSplitterLite |
m_nID | CWndLite |
m_pCWndBottom | CSplitterLite |
m_pCWndLeft | CSplitterLite |
m_pCWndRight | CSplitterLite |
m_pCWndTop | CSplitterLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnBorder(REFPOINTS pts, INT iBorder) | CSplitterLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CTabLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CTabLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSelChange(INT iID, HWND hWndCtrl) | CTabLite | [virtual]
OnSelChanging(INT iID, HWND hWndCtrl) | CTabLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetCurSel(INDEX iItem, BOOL fSendNotification=FALSE) | CTabLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetItem(INDEX iItem, LPCWSTR pwszName, LPARAM lParam=PARAM_NONE, INT iImage=IMAGE_NONE, DWORD dwState=STATE_NONE, DWORD dwStateMask=STATE_NONE) | CTabLite | [virtual]
SetItemText(INDEX iItem, LPCWSTR pwszName) | CTabLite | [virtual]
SetSplitter(CSplitterLite *pCWndTop, CSplitterLite *pCWndBottom=NULL, CSplitterLite *pCWndLeft=NULL, CSplitterLite *pCWndRight=NULL) | CSplitterLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT *pPoint) | CSplitterLite | [virtual]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CTabLite() | CTabLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTE_ENCODER_STRUCT Member List

This is the complete list of members for CTE_ENCODER_STRUCT, including all inherited members.
cbData | CTE_ENCODER_STRUCT
dwChunkSize | CTE_ENCODER_STRUCT
pData | CTE_ENCODER_STRUCT
pECB | CTE_ENCODER_STRUCT
Generated on Wed Nov 13 2024 16:57:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Delete/vc/Delete.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Delete
  • vc

Delete.cpp

Go to the documentation of this file.
00001 // Delete.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "stdio.h"
00006 #include "activeds.h"
00007
00008 int main(int argc, char* argv[])
00009 {
00010   HRESULT hr;
00011   IADsContainer *pCont=NULL;
00012
00013   CoInitialize(NULL);
00014
00015   hr = ADsGetObject(L"WinNT://INDEPENDENCE", IID_IADsContainer, (void**) &pCont);
00016   if ( !SUCCEEDED(hr) )
00017   {
00018     return 0;
00019   }
00020
00021   ///////////////////////////////////////////////////
00022   // Using IADsContainer::Delete to delete a user
00023   //////////////////////////////////////////////////
00024   hr = pCont->Delete(L"user", L"AliceW");
00025   pCont->Release();
00026
00027   /////////////////////////////////////////////////////////////
00028   // Using IDirectoryObject::DeleteDSObject to delete a user
00029   //////////////////////////////////////////////////////////////
00030   IDirectoryObject *pDirObject=NULL;
00031
00032   hr = ADsGetObject(L"LDAP://OU=testOU,DC=testDom1,DC=testDom2,DC=microsoft,DC=com",
00033                       IID_IDirectoryObject, (void**) &pDirObject );
00034
00035   if ( SUCCEEDED(hr) )
00036   {
00037     hr = pDirObject->DeleteDSObject(L"CN=Mike Smith");
00038     pDirObject->Release();
00039   }
00040
00041
00042   CoUninitialize();
00043
00044   return 0;
00045 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/basesnap.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

basesnap.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <olectl.h>
00021 #include <initguid.h>
00022 #include "guids.h"
00023 #include "basesnap.h"
00024 #include "Comp.h"
00025 #include "CompData.h"
00026 #include "About.h"
00027 #include "Registry.h"
00028
00029 // our globals
00030 HINSTANCE g_hinst;
00031
00032 BOOL WINAPI DllMain(HINSTANCE hinstDLL,
00033                     DWORD fdwReason,
00034                     void* lpvReserved)
00035 {
00036
00037     if (fdwReason == DLL_PROCESS_ATTACH) {
00038         g_hinst = hinstDLL;
00039     }
00040
00041     return TRUE;
00042 }
00043
00044
00045 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
00046 {
00047     if ((rclsid != CLSID_CComponentData) && (rclsid != CLSID_CSnapinAbout))
00048         return CLASS_E_CLASSNOTAVAILABLE;
00049
00050
00051     if (!ppvObj)
00052         return E_FAIL;
00053
00054     *ppvObj = NULL;
00055
00056     // We can only hand out IUnknown and IClassFactory pointers.  Fail
00057     // if they ask for anything else.
00058     if (!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00059         return E_NOINTERFACE;
00060
00061     CClassFactory *pFactory = NULL;
00062
00063     // make the factory passing in the creation function for the type of object they want
00064     if (rclsid == CLSID_CComponentData)
00065         pFactory = new CClassFactory(CClassFactory::COMPONENT);
00066     else if (rclsid == CLSID_CSnapinAbout)
00067         pFactory = new CClassFactory(CClassFactory::ABOUT);
00068
00069     if (NULL == pFactory)
00070         return E_OUTOFMEMORY;
00071
00072     HRESULT hr = pFactory->QueryInterface(riid, ppvObj);
00073
00074     return hr;
00075 }
00076
00077 STDAPI DllCanUnloadNow(void)
00078 {
00079     if (g_uObjects == 0 && g_uSrvLock == 0)
00080         return S_OK;
00081     else
00082         return S_FALSE;
00083 }
00084
00085
00086 CClassFactory::CClassFactory(FACTORY_TYPE factoryType)
00087 : m_cref(0), m_factoryType(factoryType)
00088 {
00089     OBJECT_CREATED
00090 }
00091
00092 CClassFactory::~CClassFactory()
00093 {
00094     OBJECT_DESTROYED
00095 }
00096
00097 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv)
00098 {
00099     if (!ppv)
00100         return E_FAIL;
00101
00102     *ppv = NULL;
00103
00104     if (IsEqualIID(riid, IID_IUnknown))
00105         *ppv = static_cast<IClassFactory *>(this);
00106     else
00107         if (IsEqualIID(riid, IID_IClassFactory))
00108             *ppv = static_cast<IClassFactory *>(this);
00109
00110         if (*ppv)
00111         {
00112             reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00113             return S_OK;
00114         }
00115
00116         return E_NOINTERFACE;
00117 }
00118
00119 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00120 {
00121     return InterlockedIncrement((LONG *)&m_cref);
00122 }
00123
00124 STDMETHODIMP_(ULONG) CClassFactory::Release()
00125 {
00126     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00127     {
00128         delete this;
00129         return 0;
00130     }
00131     return m_cref;
00132 }
00133
00134 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj)
00135 {
00136     HRESULT  hr;
00137     void* pObj;
00138
00139     if (!ppvObj)
00140         return E_FAIL;
00141
00142     *ppvObj = NULL;
00143
00144     // Our object does does not support aggregation, so we need to
00145     // fail if they ask us to do aggregation.
00146     if (pUnkOuter)
00147         return CLASS_E_NOAGGREGATION;
00148
00149     if (COMPONENT == m_factoryType) {
00150         pObj = new CComponentData();
00151     } else {
00152         pObj = new CSnapinAbout();
00153     }
00154
00155     if (!pObj)
00156         return E_OUTOFMEMORY;
00157
00158     // QueryInterface will do the AddRef() for us, so we do not
00159     // do it in this function
00160     hr = ((LPUNKNOWN)pObj)->QueryInterface(riid, ppvObj);
00161
00162     if (FAILED(hr))
00163         delete pObj;
00164
00165     return hr;
00166 }
00167
00168 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00169 {
00170     if (fLock)
00171         InterlockedIncrement((LONG *)&g_uSrvLock);
00172     else
00173         InterlockedDecrement((LONG *)&g_uSrvLock);
00174
00175     return S_OK;
00176 }
00177
00178 //////////////////////////////////////////////////////////
00179 //
00180 // Exported functions
00181 //
00182
00183
00184 //
00185 // Server registration
00186 //
00187 STDAPI DllRegisterServer()
00188 {
00189     HRESULT hr = SELFREG_E_CLASS;
00190     _TCHAR szName[256];
00191     _TCHAR szSnapInName[256];
00192
00193     LoadString(g_hinst, IDS_NAME, szName, (sizeof szName)/(sizeof szName[0]));
00194     LoadString(g_hinst, IDS_SNAPINNAME, szSnapInName, (sizeof szSnapInName)/(sizeof szSnapInName[0]));
00195
00196     _TCHAR szAboutName[256];
00197
00198     LoadString(g_hinst, IDS_ABOUTNAME, szAboutName, (sizeof szAboutName)/(sizeof szAboutName[0]));
00199
00200     // register our CoClasses
00201     hr = RegisterServer(g_hinst,
00202         CLSID_CComponentData,
00203         szName);
00204
00205     if SUCCEEDED(hr)
00206         hr = RegisterServer(g_hinst,
00207         CLSID_CSnapinAbout,
00208         szAboutName);
00209
00210     // place the registry information for SnapIns
00211     if SUCCEEDED(hr)
00212         hr = RegisterSnapin(CLSID_CComponentData, szSnapInName, CLSID_CSnapinAbout, FALSE);
00213
00214     return hr;
00215 }
00216
00217
00218 STDAPI DllUnregisterServer()
00219 {
00220     if (UnregisterServer(CLSID_CComponentData) == S_OK)
00221         return UnregisterSnapin(CLSID_CComponentData);
00222     else
00223         return E_FAIL;
00224 }
00225
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/stdafx.cpp Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

stdafx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Security/VC/StdAfx.h Source File

  • Com
  • Services
  • Security
  • VC

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__8107B4E5_166C_11D1_98C1_00C04FC2C8D5__INCLUDED_)
00006 #define AFX_STDAFX_H__8107B4E5_166C_11D1_98C1_00C04FC2C8D5__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012 #define STRICT
00013
00014
00015 #if !defined(_WIN32_WINNT)
00016 #define _WIN32_WINNT 0x0500
00017 #endif // !defined(_WIN32_WINNT)
00018
00019 #define _ATL_APARTMENT_THREADED
00020
00021
00022 #include <atlbase.h>
00023 //You may derive a class from CComModule and use it if you want to override
00024 //something, but do not change the name of _Module
00025 extern CComModule _Module;
00026 #include <atlcom.h>
00027
00028 //{{AFX_INSERT_LOCATION}}
00029 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00030
00031 #endif // !defined(AFX_STDAFX_H__8107B4E5_166C_11D1_98C1_00C04FC2C8D5__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Resource_Dispenser/Disp1.Cpp Source File

  • Com
  • Services
  • Resource_Dispenser

Disp1.Cpp

Go to the documentation of this file.
00001 // Disp1.cpp : Implementation of DLL Exports.
00002
00003
00004 // Note: Proxy/Stub Information
00005 //    To build a separate proxy/stub DLL,
00006 //    run nmake -f Disp1ps.mk in the project directory.
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 #include "initguid.h"
00011 #include "Disp1.h"
00012
00013 #include "Disp1_i.c"
00014 #include "LDisp.h"
00015
00016
00017 CComModule _Module;
00018
00019 BEGIN_OBJECT_MAP(ObjectMap)
00020   OBJECT_ENTRY(CLSID_LDisp, CLDisp)
00021 END_OBJECT_MAP()
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // DLL Entry Point
00025
00026 extern "C"
00027 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00028 {
00029   if (dwReason == DLL_PROCESS_ATTACH)
00030   {
00031     _Module.Init(ObjectMap, hInstance);
00032     DisableThreadLibraryCalls(hInstance);
00033   }
00034   else if (dwReason == DLL_PROCESS_DETACH)
00035     _Module.Term();
00036   return TRUE;    // ok
00037 }
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // Used to determine whether the DLL can be unloaded by OLE
00041
00042 STDAPI DllCanUnloadNow(void)
00043 {
00044   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00045 }
00046
00047 /////////////////////////////////////////////////////////////////////////////
00048 // Returns a class factory to create an object of the requested type
00049
00050 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00051 {
00052   return _Module.GetClassObject(rclsid, riid, ppv);
00053 }
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // DllRegisterServer - Adds entries to the system registry
00057
00058 STDAPI DllRegisterServer(void)
00059 {
00060   // registers object, typelib and all interfaces in typelib
00061   return _Module.RegisterServer(TRUE);
00062 }
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // DllUnregisterServer - Removes entries from the system registry
00066
00067 STDAPI DllUnregisterServer(void)
00068 {
00069   _Module.UnregisterServer();
00070   return S_OK;
00071 }
00072
00073
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Properties Member List

This is the complete list of members for msado15::Properties, including all inherited members.
_NewEnum() | msado15::Properties |
getCount() | msado15::Properties |
getItem(Variant Index) | msado15::Properties |
iid | msado15::Properties | [static]
Refresh() | msado15::Properties |
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Secure/secClnt.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • Secure

secClnt.Cpp

Go to the documentation of this file.
00001 // ===========================================================================
00002 // File: S E C C L N T . C P P
00003 //
00004 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007 // PARTICULAR PURPOSE.
00008 //
00009 // Description:
00010 //
00011 //  This is the client-portion of the SECURE Network OLE sample. This
00012 // application displays UI to allow you to select security settings for
00013 // the client process's connections to the server, connect to local or remote
00014 // instances of either the "LocalServer32" (CLSID_SecureObject) or "LocalService"
00015 // (CLSID_SecureObjectService) objects.
00016 //
00017 //  The purpose of this sample is to demonstrate client-side security
00018 // capabilities.
00019 //
00020 // Instructions:
00021 //
00022 //  To use this sample:
00023 //   * build the samples using the NMAKE command. NMAKE will create SECCLNT.EXE,
00024 //     SECSVR.EXE, and PSMYPROP.DLL. PSMYPROP.DLL is the remoting proxies and
00025 //     stubs for the custom interface used between the client and the server.
00026 //   * install the server on the current machine or on a remote machine
00027 //     by running INSTALL.BAT in the same directory with SECSVR.EXE and
00028 //     PSMYPROP.DLL. This program registers the proxy-stub DLL using the
00029 //     REGSVR32 tool (included in the \mstools\bin directory of the SDK) and
00030 //     runs the SECSVR.EXE program with "-AutoRegister" on the command-line,
00031 //     which forces it to install itself.
00032 //   * next, run SECCLNT.EXE. it will bring up a user interface with 3 different
00033 //     sections.
00034 //   * In Section 1, choose the security parameters to CoInitializeSecurity from
00035 //     the two drop-down lists, and press the Initialize button.
00036 //   * Next, in Section 2, choose a machine name to instantiate the object on
00037 //     (leave this field blank to use the current machine) and choose between the
00038 //     "LocalService" or the standard "LocalServer32" implementation of the object.
00039 //     Then, press the "Create Now" button to create an instance.
00040 //   * With some security settings, you will receive a message box at this point
00041 //     telling you that the connection to the object has no authentication. In this
00042 //     case, the call-level security choices in Section 3 will not be made available.
00043 //   * Next, go to Section 3 and set the color and the "Name" on the object.
00044 //     These UI elements make calls on the custom IMyProperties interface. If you
00045 //     have pre-launched SECSVR.EXE with the "-Interactive" flag on the local or
00046 //     remote machine that you are connected to, you will be able to see the
00047 //     changes you make to the color and the name reflected in its UI, and may
00048 //     adjust some simple security settings (see the Instructions section of
00049 //     SECSVR.CPP for details).
00050 //   * Push the "Release" button in Section 2 to release the object and connect to
00051 //     a different object. When you are done, close the dialog box or push the
00052 //     "Exit" button in Section 1 at any time to exit.
00053 //
00054 // Copyright 1996 - 2000 Microsoft Corporation. All Rights Reserved.
00055 // ===========================================================================
00056
00057 // %%Includes: ---------------------------------------------------------------
00058 #define INC_OLE2
00059 #define UNICODE
00060 #include <windows.h>
00061 #include <initguid.h>
00062 #include "myprop.h"
00063 #include <rpcdce.h>
00064 #include "secclnt.h"
00065
00066 // %%Macros: -----------------------------------------------------------------
00067 #define ENTRY(sz, val)      { sz, val }
00068 #define RGSIZEOF(rg)        (sizeof(rg)/sizeof((rg)[0]))
00069
00070 // %%Constants: --------------------------------------------------------------
00071 #define cServerEntries      RGSIZEOF(rgServerEntries)
00072 #define cAuthnLevelEntries  RGSIZEOF(rgAuthnLevelEntries)
00073 #define cAuthzEntries       RGSIZEOF(rgAuthzEntries)
00074 #define cImpLevelEntries    RGSIZEOF(rgImpLevelEntries)
00075 #define cAuthnEntries       RGSIZEOF(rgAuthnEntries)
00076
00077 // %%Types: ------------------------------------------------------------------
00078 typedef struct tagENTRY{
00079     TCHAR   *szName;
00080     DWORD   dwVal;
00081 } ENTRY, *PENTRY;
00082
00083 // %%Globals: ----------------------------------------------------------------
00084 COLORREF s_crCurrent;
00085 HBRUSH   s_hbrCurrent = NULL;
00086
00087 ENTRY   rgServerEntries[] = {
00088     ENTRY(TEXT("Secure Object"), (DWORD)(LPVOID)&CLSID_SecureObject),
00089     ENTRY(TEXT("Secure Object Service"), (DWORD)(LPVOID)&CLSID_SecureObjectService),
00090     };
00091
00092 ENTRY   rgAuthnLevelEntries[] = {
00093     ENTRY(TEXT("Default    "), RPC_C_AUTHN_DEFAULT),
00094     ENTRY(TEXT("None       "), RPC_C_AUTHN_LEVEL_NONE),
00095     ENTRY(TEXT("Connect    "), RPC_C_AUTHN_LEVEL_CONNECT),
00096     ENTRY(TEXT("Call       "), RPC_C_AUTHN_LEVEL_CALL),
00097     ENTRY(TEXT("Packet     "), RPC_C_AUTHN_LEVEL_PKT),
00098     ENTRY(TEXT("Integrity  "), RPC_C_AUTHN_LEVEL_PKT_INTEGRITY),
00099     ENTRY(TEXT("Privacy    "), RPC_C_AUTHN_LEVEL_PKT_PRIVACY),
00100     };
00101 ENTRY   rgAuthzEntries[] = {
00102     ENTRY(TEXT("None       "), RPC_C_AUTHZ_NONE),
00103     ENTRY(TEXT("Name       "), RPC_C_AUTHZ_NAME),
00104     ENTRY(TEXT("DCE        "), RPC_C_AUTHZ_DCE),
00105     };
00106
00107 ENTRY   rgImpLevelEntries[] = {
00108     ENTRY(TEXT("Anonymous  "), RPC_C_IMP_LEVEL_ANONYMOUS),
00109     ENTRY(TEXT("Identify   "), RPC_C_IMP_LEVEL_IDENTIFY),
00110     ENTRY(TEXT("Impersonate"), RPC_C_IMP_LEVEL_IMPERSONATE),
00111     ENTRY(TEXT("Delegate   "), RPC_C_IMP_LEVEL_DELEGATE),
00112     };
00113
00114 ENTRY   rgAuthnEntries[] = {
00115     ENTRY(TEXT("None       "), RPC_C_AUTHN_NONE),
00116     ENTRY(TEXT("DCE Private"), RPC_C_AUTHN_DCE_PRIVATE),
00117     ENTRY(TEXT("DCE Public "), RPC_C_AUTHN_DCE_PUBLIC),
00118     ENTRY(TEXT("DEC Public "), RPC_C_AUTHN_DEC_PUBLIC),
00119     ENTRY(TEXT("Windows NT "), RPC_C_AUTHN_WINNT),
00120     ENTRY(TEXT("Default    "), RPC_C_AUTHN_DEFAULT),
00121     };
00122
00123 // ---------------------------------------------------------------------------
00124 // %%Function: ErrorMessage
00125 // ---------------------------------------------------------------------------
00126  void
00127 ErrorMessage(HWND hwnd, LPTSTR szFunction, HRESULT hr)
00128 {
00129     LPTSTR   szMessage;
00130
00131     if (HRESULT_FACILITY(hr) == FACILITY_WINDOWS)
00132         hr = HRESULT_CODE(hr);
00133
00134     FormatMessage(
00135         FORMAT_MESSAGE_ALLOCATE_BUFFER |
00136         FORMAT_MESSAGE_FROM_SYSTEM,
00137         NULL,
00138         hr,
00139         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00140         (LPTSTR)&szMessage,
00141         0,
00142         NULL );
00143
00144     MessageBox(hwnd, szMessage, szFunction, MB_OK);
00145
00146     LocalFree(szMessage);
00147 }  // ErrorMessage
00148
00149 // ---------------------------------------------------------------------------
00150 // %%Function: SelectEntry
00151 // ---------------------------------------------------------------------------
00152  void
00153 SelectEntry(HWND hwnd, ENTRY* rgEntries, int cEntries, DWORD dwVal)
00154 {
00155     for (int i=0; i<cEntries; i++)
00156         {
00157         if (rgEntries[i].dwVal == dwVal)
00158             {
00159             SendMessage(hwnd, CB_SETCURSEL, i, 0);
00160             return;
00161             }
00162         }
00163 }  // SelectEntry
00164
00165 // ---------------------------------------------------------------------------
00166 // %%Function: GetField
00167 // ---------------------------------------------------------------------------
00168  DWORD
00169 GetField(HWND hwndDlg, UINT idItem)
00170 {
00171     HWND    hwnd;
00172     INT_PTR iCur;
00173
00174     hwnd = GetDlgItem(hwndDlg, idItem);
00175     iCur = SendMessage(hwnd, CB_GETCURSEL, 0, 0);
00176     return (DWORD) SendMessage(hwnd, CB_GETITEMDATA, iCur, 0);
00177 }  // GetField
00178
00179 // ---------------------------------------------------------------------------
00180 // %%Function: UpdateSecurityFields
00181 // ---------------------------------------------------------------------------
00182  void
00183 UpdateSecurityFields(HWND hwndDlg, LPUNKNOWN punk, BOOL fSet)
00184 {
00185     HWND    hwnd;
00186     DWORD   dwAuthn, dwAuthz, dwAuthnLevel, dwImpLevel;
00187     LPOLESTR wszPrinciple;
00188     HRESULT hr;
00189
00190     // in response to a CBN_SELCHANGE, we try to set the new proxy
00191     // security parameters first
00192     if (fSet)
00193         {
00194         hr = CoSetProxyBlanket(punk,
00195             GetField(hwndDlg, IDC_PROXY_AUTHN),
00196             GetField(hwndDlg, IDC_PROXY_AUTHZ),
00197             NULL,
00198             GetField(hwndDlg, IDC_PROXY_AUTHNLEVEL),
00199             GetField(hwndDlg, IDC_PROXY_IMPLEVEL),
00200             NULL,
00201             NULL);
00202         if (FAILED(hr))
00203             {
00204             ErrorMessage(hwndDlg, TEXT("CoSetProxyBlanket"), hr);
00205             }
00206         }
00207
00208     // in all cases, update the fields to reflect the actual state of
00209     // security on the proxy
00210     hr = CoQueryProxyBlanket(punk,
00211         &dwAuthn, &dwAuthz, &wszPrinciple, &dwAuthnLevel, &dwImpLevel,
00212         NULL, NULL);
00213     if (FAILED(hr))
00214         {
00215         ErrorMessage(hwndDlg, TEXT("CoQueryProxyBlanket"), hr);
00216         }
00217     else
00218         {
00219         hwnd = GetDlgItem(hwndDlg, IDC_PROXY_AUTHN);
00220         EnableWindow(hwnd, TRUE);
00221         SelectEntry(hwnd, rgAuthnEntries, cAuthnEntries, dwAuthn);
00222
00223         hwnd = GetDlgItem(hwndDlg, IDC_PROXY_AUTHZ);
00224         EnableWindow(hwnd, TRUE);
00225         SelectEntry(hwnd, rgAuthzEntries, cAuthzEntries, dwAuthz);
00226
00227         hwnd = GetDlgItem(hwndDlg, IDC_PROXY_AUTHNLEVEL);
00228         EnableWindow(hwnd, TRUE);
00229         SelectEntry(hwnd, rgAuthnLevelEntries, cAuthnLevelEntries, dwAuthnLevel);
00230
00231         hwnd = GetDlgItem(hwndDlg, IDC_PROXY_IMPLEVEL);
00232         EnableWindow(hwnd, TRUE);
00233         SelectEntry(hwnd, rgImpLevelEntries, cImpLevelEntries, dwImpLevel);
00234
00235         SetWindowTextW(GetDlgItem(hwndDlg, IDC_PROXY_PRINCIPLENAME),
00236             wszPrinciple);
00237         }
00238 }  // UpdateSecurityFields
00239
00240 // ---------------------------------------------------------------------------
00241 // %%Function: UpdatePropertyFields
00242 // ---------------------------------------------------------------------------
00243  void
00244 UpdatePropertyFields(HWND hwndDlg, LPMYPROPERTIES pmp)
00245 {
00246     COLORREF    cr;
00247     WCHAR       rgchUserName[20];
00248     HRESULT     hr;
00249
00250     hr = pmp->GetColor(&cr);
00251     if (FAILED(hr))
00252         {
00253         ErrorMessage(hwndDlg, TEXT("Get Color"), hr);
00254         }
00255     else
00256         {
00257         s_crCurrent = cr;
00258         if (s_hbrCurrent != NULL)
00259             DeleteObject(s_hbrCurrent);
00260         s_hbrCurrent = CreateSolidBrush(s_crCurrent);
00261         InvalidateRect(GetDlgItem(hwndDlg, IDC_COLOR), NULL, TRUE);
00262         }
00263
00264     hr = pmp->GetUserName(rgchUserName);
00265     if (FAILED(hr))
00266         {
00267         ErrorMessage(hwndDlg, TEXT("Get User Name"), hr);
00268         }
00269     else
00270         {
00271         SetWindowTextW(GetDlgItem(hwndDlg, IDC_USERNAME), rgchUserName);
00272         }
00273 }  // UpdatePropertyFields
00274
00275 // ---------------------------------------------------------------------------
00276 // %%Function: ClientDialogProc
00277 // ---------------------------------------------------------------------------
00278  BOOL CALLBACK
00279 ClientDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
00280 {
00281     static BOOL s_fInitialized = FALSE;
00282     static LPMYPROPERTIES s_pmp = NULL;
00283     static COLORREF s_rgcrCustom[16];
00284     HRESULT     hr;
00285
00286     switch (message)
00287         {
00288         case WM_INITDIALOG:
00289             {
00290             HWND    hwnd1, hwnd2;
00291             int     i, cxScreen, cyScreen;
00292             RECT    rcDlg;
00293
00294             cxScreen = GetSystemMetrics(SM_CXFULLSCREEN);
00295             cyScreen = GetSystemMetrics(SM_CYFULLSCREEN);
00296
00297             GetWindowRect(hwndDlg, &rcDlg);
00298             OffsetRect(&rcDlg,
00299                 (cxScreen - rcDlg.right - rcDlg.left)/2,
00300                 (cyScreen - rcDlg.bottom - rcDlg.top)/2);
00301
00302             MoveWindow(hwndDlg, rcDlg.left, rcDlg.top,
00303                 rcDlg.right-rcDlg.left, rcDlg.bottom-rcDlg.top, TRUE);
00304
00305             // build the list of servers, select the Remote Server by default
00306             hwnd1 = GetDlgItem(hwndDlg, IDC_SERVER_CLASS);
00307             for (i=0; i<cServerEntries; i++)
00308                 {
00309                 SendMessage(hwnd1, CB_INSERTSTRING, i, (LPARAM)rgServerEntries[i].szName);
00310                 SendMessage(hwnd1, CB_SETITEMDATA, i, rgServerEntries[i].dwVal);
00311                 }
00312             SendMessage(hwnd1, CB_SETCURSEL, 0, 0);
00313
00314             // build the lists of authentication levels. choose None for the
00315             // process default. the proxy setting will be retrieved via CoQueryProxyBlanket
00316             // once the object is instantiated
00317             hwnd1 = GetDlgItem(hwndDlg, IDC_CLIENT_AUTHNLEVEL);
00318             hwnd2 = GetDlgItem(hwndDlg, IDC_PROXY_AUTHNLEVEL);
00319             for (i=0; i<cAuthnLevelEntries; i++)
00320                 {
00321                 SendMessage(hwnd1, CB_INSERTSTRING, i, (LPARAM)rgAuthnLevelEntries[i].szName);
00322                 SendMessage(hwnd1, CB_SETITEMDATA, i, rgAuthnLevelEntries[i].dwVal);
00323                 SendMessage(hwnd2, CB_INSERTSTRING, i, (LPARAM)rgAuthnLevelEntries[i].szName);
00324                 SendMessage(hwnd2, CB_SETITEMDATA, i, rgAuthnLevelEntries[i].dwVal);
00325                 }
00326             SelectEntry(hwnd1, rgAuthnLevelEntries, cAuthnLevelEntries, RPC_C_AUTHN_LEVEL_NONE);
00327
00328             // build the lists of impersonation levels. choose Anonymous for the
00329             // process default. the proxy setting will be retrieved via CoQueryProxyBlanket
00330             // once the object is instantiated
00331             hwnd1 = GetDlgItem(hwndDlg, IDC_CLIENT_IMPLEVEL);
00332             hwnd2 = GetDlgItem(hwndDlg, IDC_PROXY_IMPLEVEL);
00333             for (i=0; i<cImpLevelEntries; i++)
00334                 {
00335                 SendMessage(hwnd1, CB_INSERTSTRING, i, (LPARAM)rgImpLevelEntries[i].szName);
00336                 SendMessage(hwnd1, CB_SETITEMDATA, i, rgImpLevelEntries[i].dwVal);
00337                 SendMessage(hwnd2, CB_INSERTSTRING, i, (LPARAM)rgImpLevelEntries[i].szName);
00338                 SendMessage(hwnd2, CB_SETITEMDATA, i, rgImpLevelEntries[i].dwVal);
00339                 }
00340             SelectEntry(hwnd1, rgImpLevelEntries, cImpLevelEntries, RPC_C_IMP_LEVEL_ANONYMOUS);
00341
00342             // build the list of authorization services. the actual setting will
00343             // be retrieved via CoQueryProxyBlanket once the object is instantiated,
00344             // and can be modified after that.
00345             hwnd1 = GetDlgItem(hwndDlg, IDC_PROXY_AUTHZ);
00346             for (i=0; i<cAuthzEntries; i++)
00347                 {
00348                 SendMessage(hwnd1, CB_INSERTSTRING, i, (LPARAM)rgAuthzEntries[i].szName);
00349                 SendMessage(hwnd1, CB_SETITEMDATA, i, rgAuthzEntries[i].dwVal);
00350                 }
00351
00352             // build the list of authentication services. the actual setting will
00353             // be retrieved via CoQueryProxyBlanket once the object is instantiated,
00354             // and can be modified after that.
00355             hwnd1 = GetDlgItem(hwndDlg, IDC_PROXY_AUTHN);
00356             for (i=0; i<cAuthnEntries; i++)
00357                 {
00358                 SendMessage(hwnd1, CB_INSERTSTRING, i, (LPARAM)rgAuthnEntries[i].szName);
00359                 SendMessage(hwnd1, CB_SETITEMDATA, i, rgAuthnEntries[i].dwVal);
00360                 }
00361             return 1;
00362             }
00363
00364         case WM_SYSCOMMAND:
00365             if (wParam == SC_CLOSE)
00366                 goto LClose;
00367             break;
00368
00369         case WM_COMMAND:
00370             if (HIWORD(wParam) == CBN_SELCHANGE && s_pmp != NULL)
00371                 {
00372                 UpdateSecurityFields(hwndDlg, s_pmp, TRUE);
00373                 }
00374             switch (LOWORD(wParam))
00375                 {
00376                 case IDCANCEL:
00377 LClose:
00378                     if (s_pmp != NULL)
00379                         {
00380                         s_pmp->Release();
00381                         s_pmp = NULL;
00382                         }
00383                     if (s_fInitialized == TRUE)
00384                         {
00385                         CoUninitialize();
00386                         s_fInitialized = FALSE;
00387                         }
00388                     if (s_hbrCurrent != NULL)
00389                         {
00390                         DeleteObject(s_hbrCurrent);
00391                         s_hbrCurrent = NULL;
00392                         }
00393                     EndDialog(hwndDlg, 0);
00394                     break;
00395
00396                 case IDC_INITIALIZE:
00397                     hr = CoInitialize(NULL);
00398                     if (FAILED(hr))
00399                         {
00400                         ErrorMessage(hwndDlg, TEXT("CoInitialize"), hr);
00401                         }
00402                     else
00403                         {
00404                         hr = CoInitializeSecurity(NULL,
00405                             -1,
00406                             NULL,
00407                             NULL,
00408                             GetField(hwndDlg, IDC_CLIENT_AUTHNLEVEL),
00409                             GetField(hwndDlg, IDC_CLIENT_IMPLEVEL),
00410                             NULL,
00411                             0,
00412                             NULL);
00413                         if (FAILED(hr))
00414                             {
00415                             ErrorMessage(hwndDlg, TEXT("CoInitializeSecurity"), hr);
00416                             }
00417                         else
00418                             {
00419                             // Disable Initialization Step (#1)
00420                             EnableWindow(GetDlgItem(hwndDlg, IDC_INITIALIZE), FALSE);
00421                             EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_AUTHNLEVEL), FALSE);
00422                             EnableWindow(GetDlgItem(hwndDlg, IDC_CLIENT_IMPLEVEL), FALSE);
00423
00424                             // Enable Object Creation Step (#2)
00425                             EnableWindow(GetDlgItem(hwndDlg, IDC_SERVER_CLASS), TRUE);
00426                             EnableWindow(GetDlgItem(hwndDlg, IDC_MACHINENAME), TRUE);
00427                             EnableWindow(GetDlgItem(hwndDlg, IDC_CREATE), TRUE);
00428                             s_fInitialized = TRUE;
00429                             }
00430                         }
00431                     break;
00432
00433                 case IDC_CREATE:
00434                     {
00435                     OLECHAR rgchName[MAX_PATH];
00436                     LPCLASSFACTORY  pcf;
00437                     COSERVERINFO    csi, *pcsi;
00438                     CLSID   *pclsid;
00439                     HWND    hwnd;
00440                     INT_PTR     iCur;
00441
00442                     // retrieve the class to instantiate
00443                     hwnd = GetDlgItem(hwndDlg, IDC_SERVER_CLASS);
00444                     iCur = SendMessage(hwnd, CB_GETCURSEL, 0, 0);
00445                     pclsid = (LPCLSID)SendMessage(hwnd, CB_GETITEMDATA, iCur, 0);
00446
00447                     // retrieve the machine name to run the server on. if this
00448                     // is blank or ".", instantiate locally by passing a NULL ComServerInfo
00449                     memset(&csi, 0, sizeof(COSERVERINFO));
00450                     csi.pwszName = rgchName;
00451                     GetWindowTextW(GetDlgItem(hwndDlg, IDC_MACHINENAME),
00452                         rgchName, RGSIZEOF(rgchName));
00453                     if (lstrlenW(rgchName) == 0 || lstrcmpiW(rgchName, L".") == 0)
00454                         pcsi = NULL;
00455                     else
00456                         pcsi = &csi;
00457
00458                     // create the object
00459                     hr = CoGetClassObject(*pclsid, CLSCTX_SERVER,
00460                         pcsi, IID_IClassFactory, (void**)&pcf);
00461                     if (FAILED(hr))
00462                         {
00463                         ErrorMessage(hwndDlg, TEXT("CoGetClassObject"), hr);
00464                         break;
00465                         }
00466                     hr = pcf->CreateInstance(NULL, IID_IMyProperties, (void**)&s_pmp);
00467                     pcf->Release();
00468                     if (FAILED(hr))
00469                         {
00470                         ErrorMessage(hwndDlg, TEXT("IClassFactory::CreateInstance"), hr);
00471                         break;
00472                         }
00473
00474                     // Allow a different instance to get created only if the Release
00475                     // button is pushed first
00476                     EnableWindow(GetDlgItem(hwndDlg, IDC_CREATE), FALSE);
00477                     EnableWindow(GetDlgItem(hwndDlg, IDC_SERVER_CLASS), FALSE);
00478                     EnableWindow(GetDlgItem(hwndDlg, IDC_MACHINENAME), FALSE);
00479                     EnableWindow(GetDlgItem(hwndDlg, IDC_RELEASE), TRUE);
00480
00481                     // Enable manipulation of the object's properties. Allow
00482                     // this even if the values of the object's call-security
00483                     // parameters can not be determined, due to errors in
00484                     // UpdateSecurityFields
00485                     EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSECOLOR), TRUE);
00486                     EnableWindow(GetDlgItem(hwndDlg, IDC_USERNAME), TRUE);
00487
00488                     UpdateSecurityFields(hwndDlg, s_pmp, FALSE);
00489                     UpdatePropertyFields(hwndDlg, s_pmp);
00490                     break;
00491                     }
00492
00493                 case IDC_RELEASE:
00494                     s_pmp->Release();
00495                     s_pmp = NULL;
00496
00497                     // Disable manipulating the properties and selecting the call
00498                     // security parameters
00499                     EnableWindow(GetDlgItem(hwndDlg, IDC_CHOOSECOLOR), FALSE);
00500                     EnableWindow(GetDlgItem(hwndDlg, IDC_USERNAME), FALSE);
00501                     EnableWindow(GetDlgItem(hwndDlg, IDC_PROXY_AUTHN), FALSE);
00502                     EnableWindow(GetDlgItem(hwndDlg, IDC_PROXY_AUTHN), FALSE);
00503                     EnableWindow(GetDlgItem(hwndDlg, IDC_PROXY_AUTHNLEVEL), FALSE);
00504                     EnableWindow(GetDlgItem(hwndDlg, IDC_PROXY_IMPLEVEL), FALSE);
00505
00506                     // Enable a new object to be created
00507                     EnableWindow(GetDlgItem(hwndDlg, IDC_RELEASE), FALSE);
00508                     EnableWindow(GetDlgItem(hwndDlg, IDC_CREATE), TRUE);
00509                     EnableWindow(GetDlgItem(hwndDlg, IDC_SERVER_CLASS), TRUE);
00510                     EnableWindow(GetDlgItem(hwndDlg, IDC_MACHINENAME), TRUE);
00511                     break;
00512
00513                 case IDC_CHOOSECOLOR:
00514                     {
00515                     CHOOSECOLOR cc;
00516
00517                     cc.lStructSize = sizeof(CHOOSECOLOR);
00518                     cc.hwndOwner = hwndDlg;
00519                     cc.rgbResult = s_crCurrent;
00520                     cc.lpCustColors = s_rgcrCustom;
00521                     cc.Flags = CC_RGBINIT | CC_SHOWHELP;
00522
00523                     if (ChooseColor(&cc))
00524                         {
00525                         hr = s_pmp->PutColor(cc.rgbResult);
00526                         if (FAILED(hr))
00527                             {
00528                             ErrorMessage(hwndDlg, TEXT("Put Color"), hr);
00529                             }
00530                         else
00531                             {
00532                             UpdatePropertyFields(hwndDlg, s_pmp);
00533                             }
00534                         }
00535                     break;
00536                     }
00537
00538                 case IDC_USERNAME:
00539                     {
00540                     static s_fDirty = FALSE;
00541
00542                     if (HIWORD(wParam) == EN_CHANGE)
00543                         {
00544                         s_fDirty = TRUE;
00545                         }
00546                     else if (HIWORD(wParam) == EN_KILLFOCUS && s_fDirty)
00547                         {
00548                         WCHAR   rgchUserName[20];
00549
00550                         GetWindowTextW(GetDlgItem(hwndDlg, IDC_USERNAME), rgchUserName, 20);
00551                         hr = s_pmp->PutUserName(rgchUserName);
00552                         if (FAILED(hr))
00553                             ErrorMessage(hwndDlg, TEXT("Put User Name"), hr);
00554                         UpdatePropertyFields(hwndDlg, s_pmp);
00555                         s_fDirty = FALSE;
00556                         }
00557                     break;
00558                     }
00559                 }
00560             break;
00561
00562         case WM_DRAWITEM:
00563             {
00564             LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
00565
00566             FillRect(lpdis->hDC, &lpdis->rcItem,
00567                 s_hbrCurrent != NULL ? s_hbrCurrent : (HBRUSH)GetStockObject(WHITE_BRUSH));
00568             FrameRect(lpdis->hDC, &lpdis->rcItem, (HBRUSH)GetStockObject(BLACK_BRUSH));
00569             if (lpdis->itemState & ODS_SELECTED)
00570                 InvertRect(lpdis->hDC, (LPRECT)&lpdis->rcItem);
00571             if (lpdis->itemState & ODS_FOCUS)
00572                 DrawFocusRect(lpdis->hDC, (LPRECT) &lpdis->rcItem);
00573             return TRUE;
00574             }
00575         }
00576     return FALSE;
00577 }  // ClientDialogProc
00578
00579 // ---------------------------------------------------------------------------
00580 // %%Function: WinMain
00581 // ---------------------------------------------------------------------------
00582  int WINAPI
00583 WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
00584 {
00585     return (int) DialogBox(hInstance, MAKEINTRESOURCE(IDD_SECCLNT), GetDesktopWindow(), (DLGPROC)ClientDialogProc);
00586 }  // WinMain
00587
00588 // EOF =======================================================================
00589
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/PingResp/PingResp.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • PingResp

PingResp.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: PingResp.cpp
00004
00005 Summary:  Produced by VS6 ATL Wizard. Handles COM Class and Proxy Registration
00006           for PingResp.Dll
00007
00008 ----------------------------------------------------------------------------
00009
00010 This file is part of the Microsoft COM+ Samples.
00011
00012 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00013
00014 This source code is intended only as a supplement to Microsoft
00015 Development Tools and/or on-line documentation. See these other
00016 materials for detailed information regarding Microsoft code samples.
00017
00018 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00021 PARTICULAR PURPOSE.
00022
00023 ==========================================================================+*/
00024
00025 // Note: Proxy/Stub Information
00026 //      To merge the proxy/stub code into the object DLL, add the file
00027 //      dlldatax.c to the project.  Make sure precompiled headers
00028 //      are turned off for this file, and add _MERGE_PROXYSTUB to the
00029 //      defines for the project.
00030 //
00031 //      If you are not running WinNT4.0 or Win95 with DCOM, then you
00032 //      need to remove the following define from dlldatax.c
00033 //      #define _WIN32_WINNT 0x0500
00034 //
00035 //      Further, if you are running MIDL without /Oicf switch, you also
00036 //      need to remove the following define from dlldatax.c.
00037 //      #define USE_STUBLESS_PROXY
00038 //
00039 //      Modify the custom build rule for PingResp.idl by adding the following
00040 //      files to the Outputs.
00041 //          PingResp_p.c
00042 //          dlldata.c
00043 //      To build a separate proxy/stub DLL,
00044 //      run nmake -f PingRespps.mk in the project directory.
00045
00046 #include "stdafx.h"
00047 #include "resource.h"
00048 #include <initguid.h>
00049 #include "PingResp.h"
00050 #include "dlldatax.h"
00051
00052 #include "PingResp_i.c"
00053 #include "PingResponder.h"
00054
00055 #ifdef _MERGE_PROXYSTUB
00056 extern "C" HINSTANCE hProxyDll;
00057 #endif
00058
00059 CComModule _Module;
00060
00061 BEGIN_OBJECT_MAP(ObjectMap)
00062 OBJECT_ENTRY(CLSID_PingResponder, CPingResponder)
00063 END_OBJECT_MAP()
00064
00065 /////////////////////////////////////////////////////////////////////////////
00066 // DLL Entry Point
00067
00068 extern "C"
00069 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00070 {
00071     lpReserved;
00072 #ifdef _MERGE_PROXYSTUB
00073     if (!PrxDllMain(hInstance, dwReason, lpReserved))
00074         return FALSE;
00075 #endif
00076     if (dwReason == DLL_PROCESS_ATTACH)
00077     {
00078         _Module.Init(ObjectMap, hInstance, &LIBID_PINGRESPLib);
00079         DisableThreadLibraryCalls(hInstance);
00080     }
00081     else if (dwReason == DLL_PROCESS_DETACH)
00082         _Module.Term();
00083     return TRUE;    // ok
00084 }
00085
00086 /////////////////////////////////////////////////////////////////////////////
00087 // Used to determine whether the DLL can be unloaded by OLE
00088
00089 STDAPI DllCanUnloadNow(void)
00090 {
00091 #ifdef _MERGE_PROXYSTUB
00092     if (PrxDllCanUnloadNow() != S_OK)
00093         return S_FALSE;
00094 #endif
00095     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // Returns a class factory to create an object of the requested type
00100
00101 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00102 {
00103 #ifdef _MERGE_PROXYSTUB
00104     if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
00105         return S_OK;
00106 #endif
00107     return _Module.GetClassObject(rclsid, riid, ppv);
00108 }
00109
00110 /////////////////////////////////////////////////////////////////////////////
00111 // DllRegisterServer - Adds entries to the system registry
00112
00113 STDAPI DllRegisterServer(void)
00114 {
00115 #ifdef _MERGE_PROXYSTUB
00116     HRESULT hRes = PrxDllRegisterServer();
00117     if (FAILED(hRes))
00118         return hRes;
00119 #endif
00120     // registers object, typelib and all interfaces in typelib
00121     return _Module.RegisterServer(TRUE);
00122 }
00123
00124 /////////////////////////////////////////////////////////////////////////////
00125 // DllUnregisterServer - Removes entries from the system registry
00126
00127 STDAPI DllUnregisterServer(void)
00128 {
00129 #ifdef _MERGE_PROXYSTUB
00130     PrxDllUnregisterServer();
00131 #endif
00132     return _Module.UnregisterServer(TRUE);
00133 }
00134
00135
00136
00137 /////////////////////////////////////////////////////////////////////////////
00138 // CPingResponder
00139
00140 HRESULT STDMETHODCALLTYPE CPingResponder::Ping(){
00141   return S_OK;
00142 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/space.h Source File

  • SysMgmt
  • MMC
  • Multisel

space.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SPACE_H
00021 #define _SPACE_H
00022
00023 #include "DeleBase.h"
00024 #include "CompData.h"
00025
00026 class CSpaceStation;
00027 class CComponentData;
00028
00029 class CRocket : public CDelegationBase {
00030 public:
00031     CRocket(CSpaceStation *pSpaceStation, _TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload);
00032     virtual ~CRocket();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00035     virtual const GUID & getNodeType() { return thisGuid; }
00036     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00037   BOOL getDeletedStatus() { return isDeleted; }
00038   void setDeletedStatus(BOOL status) { isDeleted = status; }
00039
00040     CSpaceStation* GetParent() { return  m_pSpaceStation; }
00041   int GetId() { return nId; }
00042
00043 public:
00044     // virtual functions go here (for MMCN_*)
00045     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00046   virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype);
00047   virtual HRESULT OnDelete(IConsole *pConsole);
00048   virtual HRESULT OnRefresh(IConsole *pConsole);
00049     virtual HRESULT OnRename(LPOLESTR pszNewName);
00050
00051 private:
00052     // {29743810-4C4B-11d2-89D8-000021473128}
00053     static const GUID thisGuid;
00054
00055     _TCHAR *szName;
00056     LONG   lWeight;
00057     LONG   lHeight;
00058     LONG   lPayload;
00059     int    nId;
00060
00061   friend CSpaceStation;
00062   CSpaceStation *m_pSpaceStation;
00063
00064     enum ROCKET_STATUS {RUNNING, PAUSED, STOPPED} iStatus;
00065
00066   BOOL isDeleted;
00067 };
00068
00069 class CSpaceStation : public CDelegationBase {
00070
00071 public:
00072     CSpaceStation();
00073     virtual ~CSpaceStation();
00074
00075     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Space Station"); }
00076     virtual const GUID & getNodeType() { return thisGuid; }
00077     virtual const int GetBitmapIndex() { return INDEX_STATION; }
00078
00079 public:
00080   virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00081     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions);
00082     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00083
00084   virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype);
00085
00086
00087 private:
00088     // {29743810-4C4B-11d2-89D8-000021473128}
00089     static const GUID thisGuid;
00090
00091 private:
00092     enum { NUMBER_OF_CHILDREN = 9, MAX_CHILDREN = 20 };
00093     CRocket *children[MAX_CHILDREN];
00094   CComponentData *m_pComponentData;
00095 };
00096
00097 class CSpaceFolder : public CDelegationBase {
00098 public:
00099     CSpaceFolder();
00100
00101     virtual ~CSpaceFolder();
00102
00103     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Space Vehicles"); }
00104     virtual const GUID & getNodeType() { return thisGuid; }
00105     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00106
00107 public:
00108     // virtual functions go here (for MMCN_*)
00109     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00110
00111 private:
00112     enum { IDM_NEW_SPACE = 4 };
00113
00114     // {29743810-4C4B-11d2-89D8-000021473128}
00115     static const GUID thisGuid;
00116
00117 private:
00118     enum { NUMBER_OF_CHILDREN = 1 };
00119     CSpaceStation *children[NUMBER_OF_CHILDREN];
00120 };
00121
00122 #endif // _SPACE_H
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Range/recvbuf.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Range

recvbuf.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include <windows.h>
00018 #include <wininet.h>
00019 #include <limits.h>
00020 #include "recvbuf.hpp"
00021 #define upcase(c)  ((BYTE) CharUpper ((LPSTR) (BYTE) (c)))
00022
00023 // ---------------------------------------------------------------------------
00024 // CUrlmonCallback::BufScanStr
00025 // Utility to seek for a string in a memory buffer.
00026 // ---------------------------------------------------------------------------
00027 BOOL RecvBuf::BufAlloc (DWORD dwSize)
00028 {
00029     m_cbBufSize = dwSize;
00030     m_pbBufBeg = (PBYTE) LocalAlloc (LMEM_FIXED, m_cbBufSize);
00031     if (!m_pbBufBeg)
00032         return FALSE;
00033     m_pbBufEnd = m_pbBufBeg + m_cbBufSize;
00034     m_pbDataBeg = m_pbBufBeg;
00035     m_pbDataEnd = m_pbBufBeg;
00036     return TRUE;
00037 }
00038
00039 // ---------------------------------------------------------------------------
00040 // CUrlmonCallback::SeekPastString
00041 // Utility to seek for a string in a memory buffer.
00042 // ---------------------------------------------------------------------------
00043 BOOL RecvBuf::BufScanStr (PSTR pszSearch, DWORD cbSearch)
00044 {
00045   PBYTE pbLimit = m_pbDataEnd - cbSearch;
00046
00047   while (m_pbDataBeg < pbLimit)
00048   {
00049       DWORD ibSearch;
00050
00051     // Check for overflow.
00052     if (m_pbDataBeg >= pbLimit)
00053       return FALSE;
00054
00055       for (ibSearch = 0; ibSearch < cbSearch; ibSearch++)
00056       {
00057           if (upcase(m_pbDataBeg[ibSearch]) != upcase(pszSearch[ibSearch]))
00058               break;
00059       }
00060
00061       if (ibSearch == cbSearch)
00062       {
00063           // Found it.
00064             m_pbDataBeg += cbSearch;
00065           return TRUE;
00066       }
00067       else
00068       {
00069           m_pbDataBeg++;
00070           continue;
00071       }
00072   }
00073   return FALSE;
00074 }
00075
00076 // ---------------------------------------------------------------------------
00077 // Utility to scan a 32-bit integer from memory buffer.
00078 // Returns FALSE on integer overflow or end of buffer.
00079 // ---------------------------------------------------------------------------
00080 BOOL RecvBuf::BufScanInt (DWORD *pdwRet, BYTE cDelimit)
00081 {
00082   DWORD dwRet = 0;
00083
00084   // Scan past non-delimiters and non-digits.
00085   while (*m_pbDataBeg != cDelimit && !isdigit(*m_pbDataBeg))
00086   {
00087     if (++m_pbDataBeg >= m_pbDataEnd)
00088       return FALSE;
00089   }
00090
00091   while (*m_pbDataBeg != cDelimit)
00092   {
00093     if (!isdigit(*m_pbDataBeg))
00094       return FALSE;
00095     if (dwRet > ULONG_MAX / 10)
00096       return FALSE;
00097     dwRet *= 10;
00098     dwRet += *m_pbDataBeg - '0';
00099     if (++m_pbDataBeg >= m_pbDataEnd)
00100       return FALSE;
00101   }
00102
00103   *pdwRet = dwRet;
00104   return TRUE;
00105 }
00106
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/Dialer/Dialer.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • Dialer

Dialer.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 Copyright 1995 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     dialer.h
00008
00009 Abstract:
00010
00011     Header file for dialer
00012
00013 Author:
00014
00015     Dan Knudson (DanKn)        05-Apr-1995
00016
00017 Revision History:
00018
00019     Jeremy Horwitz (t-jereh)   30-May-1995
00020
00021 --*/
00022
00023
00024 #define TAPI_VERSION_1_0 0x00010003
00025 #define TAPI_VERSION_1_4 0x00010004
00026 #define TAPI_VERSION_2_0 0x00020000
00027 #define TAPI_CURRENT_VERSION TAPI_VERSION_2_0
00028
00029 #include <windows.h>
00030 #include "tapi.h"
00031 #include "resource.h"
00032
00033 #define MENU_CHOICE         1 // for Connect Using dialog...
00034 #define INVALID_LINE        2 // if INVALID_LINE, turn off CANCEL
00035                               // button and add extra text...
00036
00037 #define MAXNUMLENGTH    64
00038 #define MAXBUFSIZE      256
00039 #define NSPEEDDIALS     8 // Dialer supports 8 configurable speed dial entries.
00040 #define NLASTDIALED     20 // Dialer keeps track of the 20 last dialed numbers.
00041
00042 #define ERR_NONE        0
00043 #define ERR_NOVOICELINE 1
00044 #define ERR_LINECLOSE   2
00045 #define ERR_NOLINES     3
00046 #define ERR_911WARN   4
00047 #define ERR_NEWDEFAULT  5
00048
00049 #define itoa(x,y,z) _itoa(x,y,z)
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CWaitDlg Member List

This is the complete list of members for CWaitDlg, including all inherited members.
CWaitDlg(CWnd *pParent=NULL) | CWaitDlg |
DoDataExchange(CDataExchange *pDX) | CWaitDlg | [protected, virtual]
IDD enum value | CWaitDlg |
Generated on Wed Nov 13 2024 16:57:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ExecuteOptionEnum Member List

This is the complete list of members for msado15::ExecuteOptionEnum, including all inherited members.
adAsyncExecute | msado15::ExecuteOptionEnum | [static]
adAsyncFetch | msado15::ExecuteOptionEnum | [static]
adAsyncFetchNonBlocking | msado15::ExecuteOptionEnum | [static]
adExecuteNoRecords | msado15::ExecuteOptionEnum | [static]
adOptionUnspecified | msado15::ExecuteOptionEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/DrawArea.Cpp Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

DrawArea.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // drawarea.cpp : implementation file
00014 //
00015
00016
00017
00018 #include "stdafx.h"
00019 #include "Imp_draw.h"
00020 #include "Imp_dlg.h"
00021
00022 #ifdef _DEBUG
00023 #define new DEBUG_NEW
00024 #undef THIS_FILE
00025 static char THIS_FILE[] = __FILE__;
00026 #endif
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CDrawArea
00030
00031 CDrawArea::CDrawArea()
00032 {
00033 }
00034
00035 CDrawArea::~CDrawArea()
00036 {
00037 }
00038
00039
00040 BEGIN_MESSAGE_MAP(CDrawArea, CEdit)
00041   //{{AFX_MSG_MAP(CDrawArea)
00042   ON_WM_LBUTTONDOWN()
00043   ON_WM_MOUSEMOVE()
00044   ON_WM_PAINT()
00045   ON_WM_RBUTTONUP()
00046   ON_WM_CTLCOLOR_REFLECT()
00047   ON_WM_KEYDOWN()
00048   ON_WM_CHAR()
00049   ON_WM_SETFOCUS()
00050   ON_WM_SETCURSOR()
00051   ON_WM_LBUTTONDBLCLK()
00052   //}}AFX_MSG_MAP
00053 END_MESSAGE_MAP()
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // CDrawArea message handlers
00057
00058 void CDrawArea::AddKeystroke(char *mbsKey)
00059 {
00060   //
00061   // The backspace keystroke should erase the last character.
00062   //
00063   if (mbsKey[0] == VK_BACK)
00064   {
00065     int nStart, nEnd;
00066     GetSel(nStart, nEnd);
00067     SetSel(nEnd-1, nEnd);
00068     mbsKey[0] = '\0';
00069
00070         //
00071         // Erasing a line feed should erase the preceding carriage return.
00072         //
00073         CString strText;
00074         GetWindowText(strText);
00075         int iLength = strText.GetLength();
00076         if (iLength > 0 && strText.GetAt(strText.GetLength() - 1) == '\n')
00077             SetSel(nEnd-2, nEnd);
00078   }
00079
00080   //
00081   // Append a line feed to a carriage return.
00082   //
00083   else if (mbsKey[0] == VK_RETURN)
00084   {
00085     mbsKey[1] = '\xa';
00086     mbsKey[2] = '\0';
00087   }
00088
00089   //
00090   // Store the new keystroke.
00091   //
00092   ReplaceSel(mbsKey);
00093 }
00094
00095
00096 void CDrawArea::AddLine(LINE line)
00097 {
00098   //
00099   // Set the clipping region for the drawing.
00100   //
00101   CClientDC dc(this);
00102   RECT rect;
00103   GetClientRect(&rect);
00104   CRgn rgn;
00105   rgn.CreateRectRgnIndirect(&rect);
00106   dc.SelectClipRgn(&rgn);
00107
00108   //
00109   // Draw the line and save it for redrawing.
00110   //
00111   dc.MoveTo(line.ptStart);
00112   dc.LineTo(line.ptEnd);
00113     m_listLines.AddTail(line);
00114 }
00115
00116
00117 void CDrawArea::OnLButtonDown(UINT nFlags, CPoint point)
00118 {
00119   // TODO: Add your message handler code here and/or call the default.
00120
00121   m_ptLast = point;
00122   SetFocus();
00123 }
00124
00125
00126 void CDrawArea::OnMouseMove(UINT nFlags, CPoint point)
00127 {
00128   // TODO: Add your message handler code here and/or call the default.
00129
00130   if (nFlags & MK_LBUTTON)
00131   {
00132     //
00133     // Add the drawn line to the drawing.
00134     //
00135     LINE line;
00136     line.ptStart = m_ptLast;
00137     line.ptEnd = point;
00138         AddLine(line);
00139
00140     //
00141     // Send the line to the friend queue.
00142     //
00143     ((CImp_DrawDlg *)GetParent())->SendMouseMovement(line);
00144
00145     //
00146     // Remember the end point of the line.
00147     //
00148     m_ptLast = point;
00149   }
00150 }
00151
00152
00153 void CDrawArea::OnPaint()
00154 {
00155   CPaintDC dc(this); // device context for painting
00156
00157   // TODO: Add your message handler code here.
00158
00159   //
00160   // Set the clipping region for the drawing.
00161   //
00162   RECT rect;
00163   GetClientRect(&rect);
00164   CRgn rgn;
00165   rgn.CreateRectRgnIndirect(&rect);
00166   dc.SelectClipRgn(&rgn);
00167
00168   //
00169   // Erase the drawing area.
00170   //
00171   dc.FillSolidRect(&rect, GetSysColor(COLOR_MENU));
00172
00173   //
00174   // Redisplay the text.
00175   //
00176     CString strText;
00177     GetWindowText(strText);
00178     dc.SelectStockObject(ANSI_VAR_FONT);
00179     rect.top++;
00180     rect.left++;
00181     dc.DrawText(strText, &rect, DT_TOP | DT_WORDBREAK);
00182
00183   //
00184   // Redraw each line.
00185   //
00186   LINE line;
00187   POSITION posLine = m_listLines.GetHeadPosition();
00188   while (posLine != NULL)
00189   {
00190     line = m_listLines.GetNext(posLine);
00191     dc.MoveTo(line.ptStart);
00192     dc.LineTo(line.ptEnd);
00193   }
00194
00195   // Do not call CEdit::OnPaint() for painting messages.
00196 }
00197
00198
00199 void CDrawArea::OnRButtonUp(UINT nFlags, CPoint point)
00200 {
00201   // TODO: Add your message handler code here and/or call the default.
00202
00203   //
00204   // Clear the drawing area.
00205   //
00206   SetSel(0, -1);
00207   Clear();
00208   m_listLines.RemoveAll();
00209   RedrawWindow();
00210 }
00211
00212
00213 BOOL CDrawArea::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
00214 {
00215   // TODO: Add your message handler code here and/or call the default.
00216
00217   return 0;
00218 }
00219
00220
00221 void CDrawArea::OnSetFocus(CWnd* pOldWnd)
00222 {
00223   CEdit::OnSetFocus(pOldWnd);
00224
00225   // TODO: Add your message handler code here.
00226
00227   HideCaret();
00228 }
00229
00230
00231 HBRUSH CDrawArea::CtlColor(CDC* pDC, UINT nCtlColor)
00232 {
00233   // TODO: Change any attributes of the DC here.
00234   pDC->SetBkColor(GetSysColor(COLOR_MENU));
00235
00236   // TODO: Return a non-NULL brush if the parent's handler should not be called.
00237   return HBRUSH((CBrush *)pDC->SelectStockObject(LTGRAY_BRUSH));
00238 }
00239
00240
00241 void CDrawArea::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00242 {
00243   // TODO: Add your message handler code here and/or call the default.
00244
00245   switch (nChar)
00246   {
00247   case VK_LEFT:
00248   case VK_RIGHT:
00249   case VK_UP:
00250   case VK_DOWN:
00251   case VK_HOME: break;
00252   default:    CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
00253   }
00254 }
00255
00256
00257 void CDrawArea::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
00258 {
00259   // TODO: Add your message handler code here and/or call the default.
00260   ((CImp_DrawDlg *)GetParent())->SendKeystroke(nChar);
00261
00262   CEdit::OnChar(nChar, nRepCnt, nFlags);
00263
00264   RedrawWindow();
00265 }
00266
00267
00268 void CDrawArea::OnLButtonDblClk(UINT nFlags, CPoint point)
00269 {
00270   // TODO: Add your message handler code here and/or call the default.
00271 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/OtherWKO/vc/otherwko1.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • OtherWKO
  • vc

otherwko1.cpp

Go to the documentation of this file.
00001 // otherwko.cpp : Defines the entry point for the console application.
00002 //
00003 #include <wchar.h>
00004 #include <objbase.h>
00005 #include <activeds.h>
00006 #include <stdio.h>
00007 //Make sure you define UNICODE
00008 //Need to define version 5 for Windows 2000
00009 #define _WIN32_WINNT 0x0500
00010 //FOR LDAP API...Required for Beta 3 only.
00011 #include <winldap.h>
00012 //Need to link against the following LIBs:
00013 //wldap32.lib
00014
00015
00016 static GUID MyWKOTestObjectGUID = { /* df447b5e-aa5b-11d2-8d53-00c04f79ab81 */
00017     0xdf447b5e,
00018     0xaa5b,
00019     0x11d2,
00020     {0x8d, 0x53, 0x00, 0xc0, 0x4f, 0x79, 0xab, 0x81}
00021   };
00022
00023
00024 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy=-1);
00025 bool SAFE_APPEND(int targetSize, LPWSTR szTarget, LPCWSTR szSource);
00026
00027
00028 HRESULT GUIDtoBindableString (LPGUID pGUID, LPOLESTR *ppGUIDString);
00029
00030 HRESULT AddValueToOtherWKOProperty(LPOLESTR szContainerDN, //DN for container whose otherWellKnownObjects property to modify
00031                    LPGUID pWKOGUID, //WKO GUID for the well-known object.
00032                    LPOLESTR szWKOObjectDN //DN of the well-known object.
00033                    );
00034
00035
00036
00037
00038 void wmain( int argc, wchar_t *argv[ ])
00039 {
00040
00041 int allocBuffer = MAX_PATH*2;
00042 LPOLESTR pszBuffer = new OLECHAR[allocBuffer];
00043   wprintf(L"This program does the following:\n");
00044   wprintf(L"1. Creates a container (MyWKOTestContainer) in the current Window 2000 domain.\n");
00045   wprintf(L"2. Creates a container object (MyWKOTestObject) within the container.\n");
00046   wprintf(L"3. Adds a value for the container object on the otherWellKnownObject property of the container.\n");
00047   wprintf(L"4. Binds to the container object using WKGUID binding string.\n");
00048   wprintf(L"5. Renames the container object using WKGUID binding string.\n");
00049   wprintf(L"6. Binds to the container object using WKGUID binding string.\n");
00050   wprintf(L"7. Optionally, cleans up by removing the container and container object.\n\n");
00051
00052
00053 //Intialize COM
00054 CoInitialize(NULL);
00055
00056 HRESULT hr = S_OK;
00057 IADs *pObject = NULL;
00058 IADsContainer *pDomain = NULL;
00059 IDispatch *pDisp = NULL;
00060 IDispatch *pDispNewObject = NULL;
00061 IADsContainer *pNewContainer = NULL;
00062 IADs *pIADsObject = NULL;
00063 IADs *pNewObject = NULL;
00064 IADs *pTestWKO1 = NULL;
00065 IADs *pTestWKO2 = NULL;
00066 VARIANT vartest;
00067 BSTR bstr;
00068
00069 LPOLESTR szNewContainerDN = new OLECHAR[MAX_PATH];
00070 LPOLESTR szPath = new OLECHAR[MAX_PATH];
00071 LPOLESTR szRelPath = new OLECHAR[MAX_PATH];
00072 LPOLESTR szGUIDString = NULL;
00073
00074 //Names of the container and child object.
00075 LPOLESTR szContainer = L"MyWKOTestContainer";
00076 LPOLESTR szNewObject = L"MyWKOTestObject";
00077
00078 LPOLESTR szNewObjectRenameRDN = L"cn=ObjectwithNEWNAME";
00079
00080 //Get rootDSE and the domain container's DN.
00081 VARIANT var;
00082 hr = ADsOpenObject(L"LDAP://rootDSE",
00083          NULL,
00084          NULL,
00085          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00086          IID_IADs,
00087          (void**)&pObject);
00088 if (FAILED(hr))
00089 {
00090    wprintf(L"Not Found. Could not bind to the domain.\n");
00091    if (pObject)
00092      pObject->Release();
00093    return;
00094 }
00095
00096 hr = pObject->Get(L"defaultNamingContext",&var);
00097 if (SUCCEEDED(hr))
00098 {
00099   //Build the ADsPath to the domain
00100   wcscpy(szPath,L"LDAP://");
00101   if (!SAFE_APPEND(MAX_PATH, szPath, var.bstrVal) )
00102   {
00103     pObject->Release();
00104     VariantClear(&var);
00105     wprintf(L"Buffer is to small, operation is aborting...");
00106     return;
00107   }
00108   VariantClear(&var);
00109   //Bind to the current domain.
00110   hr = ADsOpenObject(szPath,
00111            NULL,
00112            NULL,
00113            ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00114            IID_IADsContainer,
00115            (void**)&pDomain);
00116   if (SUCCEEDED(hr))
00117   {
00118     //Create the container.
00119     wcscpy(szRelPath,L"cn=");
00120
00121     // Check if there is enough buffer.
00122     if ( IS_BUFFER_ENOUGH(MAX_PATH, szRelPath, szContainer) > 0 )
00123     {
00124        wcscat(szRelPath,szContainer);
00125     }
00126     else
00127     {
00128       pObject->Release();
00129       pDomain->Release();
00130       wprintf(L"Buffer is to small, operation is aborting...");
00131       return;
00132     }
00133
00134
00135     hr = pDomain->Create(L"container", //ldapDisplayName of the class of the object to create.
00136                        szRelPath, //relative path in RDN=value format
00137                &pDisp); //return an IDispatch pointer to the new object.
00138     if (SUCCEEDED(hr))
00139     {
00140         //QI for an IADs interface.
00141       hr = pDisp->QueryInterface(IID_IADs, (void **)&pIADsObject);
00142     //Commit the new object to the directory.
00143     hr = pIADsObject->SetInfo();
00144     //QI for an IADsContainer interface.
00145     hr = pDisp->QueryInterface(IID_IADsContainer, (void **)&pNewContainer);
00146     if (SUCCEEDED(hr))
00147     {
00148       //Create the new container object in the container.
00149       wcscpy(szRelPath,L"cn=");
00150
00151       // Check for potential buffer overrun
00152       if (!SAFE_APPEND(MAX_PATH, szRelPath, szNewObject) )
00153       {
00154           pObject->Release();
00155           pDomain->Release();
00156           pDisp->Release();
00157           VariantClear(&var);
00158           wprintf(L"Buffer is too small to hold the string");
00159           return;
00160       }
00161
00162         hr = pNewContainer->Create(L"container", //ldapDisplayName of the class of the object to create.
00163                    szRelPath, //relative path in RDN=value format
00164            &pDispNewObject); //return an IDispatch pointer to the new object.
00165       if (SUCCEEDED(hr))
00166       {
00167       //Get the DN of the new container object
00168       hr = pIADsObject->Get(L"distinguishedName", &var);
00169       if (SUCCEEDED(hr))
00170       {
00171         if (!SAFE_APPEND(MAX_PATH, szNewContainerDN, var.bstrVal) )
00172         {
00173           pObject->Release();
00174           pDomain->Release();
00175           pDisp->Release();
00176           pIADsObject->Release();
00177           VariantClear(&var);
00178           wprintf(L"Buffer is too small to hold the string");
00179           return;
00180         }
00181         wcscpy(szNewContainerDN, var.bstrVal);
00182         VariantClear(&var);
00183         wprintf(L"Created new container with DN: %s\n",szNewContainerDN);
00184         hr = pDispNewObject->QueryInterface(IID_IADs, (void **)&pNewObject);
00185           if (SUCCEEDED(hr))
00186         {
00187             //Commit the new object to the directory.
00188             hr = pNewObject->SetInfo();
00189           //Get the DN for the new object
00190           hr = pNewObject->Get(L"distinguishedName", &var);
00191           if (SUCCEEDED(hr))
00192         {
00193             wprintf(L"Created new child object with DN: %s\n",var.bstrVal);
00194           //FOR BETA 3 only. Need to use LDAP API to set the otherWellKnownObjects property.
00195           wprintf(L"Call AddValueToOtherWKOProperty with:\n");
00196           wprintf(L"szContainer DN: %s\n",szNewContainerDN);
00197           GUIDtoBindableString (&MyWKOTestObjectGUID, &szGUIDString);
00198           wprintf(L"pWKOGUID (bindable string format): %s\n",szGUIDString);
00199           wprintf(L"szWKOObjectDN: %s\n",var.bstrVal);
00200                   hr = AddValueToOtherWKOProperty(szNewContainerDN, //DN for container whose otherWellKnownObjects property to modify
00201                    &MyWKOTestObjectGUID, //WKO GUID for the well-known object.
00202                    var.bstrVal //DN of the well-known object.
00203                    );
00204           wprintf(L"AddValueToOtherWKOProperty returned: %x\n",hr);
00205           if (SUCCEEDED(hr))
00206           {
00207             //Now bind using WKGUID binding
00208             //Build the ADsPath to the well-known object
00209
00210                     wcscpy(szPath,L"LDAP://<WKGUID=");
00211             SAFE_APPEND(MAX_PATH, szPath,szGUIDString);
00212             SAFE_APPEND(MAX_PATH, szPath,L",");
00213             SAFE_APPEND(MAX_PATH, szPath,szNewContainerDN);
00214             SAFE_APPEND(MAX_PATH, szPath,L">");
00215
00216               wprintf(L"Bind with the following WKGUID binding string: %s\n",szPath);
00217             hr = ADsOpenObject(szPath,
00218              NULL,
00219              NULL,
00220              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00221              IID_IADs,
00222              (void**)&pTestWKO1);
00223             if (SUCCEEDED(hr))
00224             {
00225               hr = pTestWKO1->Get(L"distinguishedName",&vartest);
00226                 if (SUCCEEDED(hr))
00227               {
00228                     wprintf(L"Successfully bound to object. DN: %s\n",vartest.bstrVal);
00229                 VariantClear(&vartest);
00230               }
00231             }
00232             else
00233                   wprintf(L"Binding failed with hr: %x\n",hr);
00234
00235             if (pTestWKO1)
00236               pTestWKO1->Release();
00237             //Bind again using the DN to get a regular ADsPath.
00238                     wcscpy(szPath,L"LDAP://");
00239             SAFE_APPEND(MAX_PATH, szPath,var.bstrVal);
00240
00241             hr = ADsOpenObject(szPath,
00242              NULL,
00243              NULL,
00244              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00245              IID_IADs,
00246              (void**)&pTestWKO1);
00247             hr = pTestWKO1->get_ADsPath(&bstr);
00248             //Rename the WKO object
00249             hr = pNewContainer->MoveHere(bstr,szNewObjectRenameRDN,NULL);
00250             FreeADsStr(bstr);
00251             if (pTestWKO1)
00252               pTestWKO1->Release();
00253             //Now AGAIN bind using WKGUID binding
00254             //Build the ADsPath to the well-known object
00255                     wcscpy(szPath,L"LDAP://<WKGUID=");
00256             SAFE_APPEND(MAX_PATH, szPath,szGUIDString);
00257             SAFE_APPEND(MAX_PATH, szPath,L",");
00258             SAFE_APPEND(MAX_PATH, szPath,szNewContainerDN);
00259             SAFE_APPEND(MAX_PATH, szPath,L">");
00260
00261             wprintf(L"Bind AGAIN with the following WKGUID binding string: %s\n",szPath);
00262             hr = ADsOpenObject(szPath,
00263              NULL,
00264              NULL,
00265              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00266              IID_IADs,
00267              (void**)&pTestWKO2);
00268             if (SUCCEEDED(hr))
00269             {
00270               hr = pTestWKO2->Get(L"distinguishedName",&vartest);
00271                 if (SUCCEEDED(hr))
00272               {
00273                     wprintf(L"Successfully bound to object (Note the DN reflects the rename). DN: %s\n",vartest.bstrVal);
00274                 VariantClear(&vartest);
00275               }
00276             }
00277             else
00278                   wprintf(L"Binding failed with hr: %x\n",hr);
00279           }
00280           CoTaskMemFree(szGUIDString);
00281         }
00282         }
00283           if (pNewObject)
00284           pNewObject->Release();
00285       }
00286       VariantClear(&var);
00287       }
00288         if (pIADsObject)
00289         pIADsObject->Release();
00290         if (pDispNewObject)
00291           pDispNewObject->Release();
00292     }
00293
00294     //Ask user if they want us to delete the test containers.
00295     wprintf(L"Do you want to delete the test container and object (Y/N):");
00296     fgetws(pszBuffer,allocBuffer,stdin);
00297
00298     if (0==wcsnicmp(L"Y", pszBuffer,1))
00299     {
00300       //Delete the object
00301       //Delete the container
00302       hr = pNewContainer->Delete(L"container",szNewObjectRenameRDN);
00303             if (SUCCEEDED(hr))
00304       {
00305         wprintf(L"Successfully deleted test object.\n");
00306         wcscpy(szRelPath,L"cn=");
00307         SAFE_APPEND(MAX_PATH, szRelPath,szContainer);
00308
00309         //Delete the container
00310         hr = pDomain->Delete(L"container",szRelPath);
00311         if (SUCCEEDED(hr))
00312           wprintf(L"Successfully deleted test container and its contents.\n");
00313         else
00314           wprintf(L"Failed to delete test container and its contents. hr: %x\n",hr);
00315       }
00316       else
00317         wprintf(L"Failed to delete test container and its contents. hr: %x\n",hr);
00318     }
00319
00320       if (pNewContainer)
00321         pNewContainer->Release();
00322     }
00323     if (pDisp)
00324       pDisp->Release();
00325   }
00326     if (pDomain)
00327     pDomain->Release();
00328 }
00329 if (pObject)
00330    pObject->Release();
00331
00332 //Uninitalize COM
00333 CoUninitialize();
00334
00335   return;
00336 }
00337
00338 HRESULT AddValueToOtherWKOProperty(LPOLESTR szContainerDN, //DN for container whose otherWellKnownObjects property to modify
00339                    LPGUID pWKOGUID, //WKO GUID for the well-known object.
00340                    LPOLESTR szWKOObjectDN //DN of the well-known object.
00341                    )
00342 {
00343 HRESULT hr = E_FAIL;
00344 LPOLESTR szGUIDString = new OLECHAR[MAX_PATH];
00345 int      maxAlloc = MAX_PATH*2;
00346 LPOLESTR szDNwithOctetString = new OLECHAR[MAX_PATH*2];
00347 DWORD dwReturn;
00348 //Connection handle
00349 LDAP *hConnect = NULL;
00350 //Specify NULL to bind to a DC in the current computer's domain.
00351 //LDAP_PORT is the default port, 389
00352 hConnect  = ldap_open(NULL,  LDAP_PORT);
00353 //Bind using the preferred authentication method on Windows 2000
00354 //and the logged on user's security context.
00355 dwReturn = ldap_bind_s( hConnect, NULL, NULL, LDAP_AUTH_NEGOTIATE );
00356 if (dwReturn==LDAP_SUCCESS)
00357 {
00358
00359   //Create the WKO value to add.
00360   GUIDtoBindableString (pWKOGUID, &szGUIDString);
00361   DWORD dwGUIDSize = (wcslen(szGUIDString));
00362   OLECHAR szLen[64];
00363   //Build the DNwithoctetstring
00364
00365
00366   wcscpy(szDNwithOctetString, L"B:");
00367   swprintf(szLen,L"%d", dwGUIDSize);
00368   SAFE_APPEND(maxAlloc, szDNwithOctetString,szLen);
00369   SAFE_APPEND(maxAlloc, szDNwithOctetString,L":");
00370   SAFE_APPEND(maxAlloc, szDNwithOctetString,szGUIDString);
00371   SAFE_APPEND(maxAlloc, szDNwithOctetString,L":");
00372   SAFE_APPEND(maxAlloc, szDNwithOctetString,szWKOObjectDN);
00373
00374   //swprintf(szDNwithOctetString, L"B:%d:%s:%s", dwGUIDSize, szGUIDString,szWKOObjectDN);
00375 //  ULONG ulBerSize = (wcslen(szDNwithOctetString));
00376   //Build the BerVal
00377 //  PCHAR pByteVal = (PCHAR)szDNwithOctetString;
00378 //  berval berWKO;
00379 //  berWKO.bv_len = ulBerSize;
00380 //  berWKO.bv_val = pByteVal;
00381   //Build the mod structure to add the value.
00382   LDAPMod ldWKO;
00383   //mod_values takes a NULL terminated array of WCHARs.
00384   //We're adding a single value.
00385   WCHAR *StrValues[] = {szDNwithOctetString , NULL };
00386   //Operation
00387   ldWKO.mod_op = LDAP_MOD_ADD;
00388   //Attribute
00389   ldWKO.mod_type = L"otherWellKnownObjects";
00390   //Value to set.
00391   ldWKO.mod_vals.modv_strvals = StrValues;
00392   //mods is a NULL terminated array of LDAPMod structures.
00393   //We're adding a single value.
00394   LDAPMod *pMod[] = {&ldWKO,NULL};
00395
00396   //Modify the object specified by szContainerDN.
00397   dwReturn = ldap_modify_s(  hConnect,
00398                            szContainerDN,
00399                pMod);
00400   CoTaskMemFree(szGUIDString);
00401
00402   if (dwReturn==LDAP_SUCCESS)
00403     hr = S_OK;
00404 }
00405 return hr;
00406 }
00407
00408
00409
00410
00411
00412 HRESULT GUIDtoBindableString (LPGUID pGUID, LPOLESTR *ppGUIDString)
00413 {
00414 HRESULT hr = E_FAIL;
00415 if (!pGUID)
00416   return E_INVALIDARG;
00417 //Build bindable GUID string
00418 LPOLESTR szDSGUID = new WCHAR [128];
00419 DWORD dwLen =  sizeof(*pGUID);
00420 LPBYTE lpByte = (LPBYTE) pGUID;
00421 //Copy a blank string to make it a zero length string.
00422 wcscpy( szDSGUID, L"" );
00423 //Loop through to add each byte to the string.
00424 for( DWORD dwItem = 0L; dwItem < dwLen ; dwItem++ )
00425 {
00426   //Append to szDSGUID, double-byte, byte at dwItem index.
00427   swprintf(szDSGUID + wcslen(szDSGUID), L"%02x", lpByte[dwItem]);
00428   if( wcslen( szDSGUID ) > 128 )
00429     break;
00430 }
00431 //Allocate memory for string
00432 *ppGUIDString = (OLECHAR *)CoTaskMemAlloc (sizeof(OLECHAR)*(wcslen(szDSGUID)+1));
00433 if (*ppGUIDString)
00434   wcscpy(*ppGUIDString, szDSGUID);
00435 else
00436   hr=E_FAIL;
00437 //Caller must free ppGUIDString using CoTaskMemFree.
00438 return hr;
00439 }
00440
00441
00442 // This function gets the specified well-known object for the current user's domain.
00443
00444 HRESULT GetWKOObject(LPOLESTR szBindableWKGUID, //IN. Bindable string GUID of well-known object.
00445               IADs **ppObject //OUT. Return a pointer to the specified well-known object.
00446               )
00447 {
00448 HRESULT hr = E_FAIL;
00449 //Get rootDSE and the domain container's DN.
00450 IADs *pObject = NULL;
00451 LPOLESTR szPath = new OLECHAR[MAX_PATH];
00452 VARIANT var;
00453 hr = ADsOpenObject(L"LDAP://rootDSE",
00454          NULL,
00455          NULL,
00456          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00457          IID_IADs,
00458          (void**)&pObject);
00459
00460 //Get current domain DN.
00461 if (SUCCEEDED(hr))
00462 {
00463   hr = pObject->Get(L"defaultNamingContext",&var);
00464   if (SUCCEEDED(hr))
00465   {
00466     //Build the WKGUID binding string.
00467     wcscpy(szPath,L"LDAP://");
00468     SAFE_APPEND(MAX_PATH, szPath,L"<WKGUID=");
00469     SAFE_APPEND(MAX_PATH, szPath,szBindableWKGUID);
00470     SAFE_APPEND(MAX_PATH, szPath,L",");
00471     SAFE_APPEND(MAX_PATH, szPath,var.bstrVal);
00472     SAFE_APPEND(MAX_PATH, szPath,L">");
00473
00474     //Print the binding string.
00475     //wprintf(L"WKGUID binding string: %s\n",szPath);
00476     VariantClear(&var);
00477     //Bind to the well-known object.
00478     hr = ADsOpenObject(szPath,
00479              NULL,
00480              NULL,
00481              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00482              IID_IADs,
00483              (void**)ppObject);
00484     if (FAILED(hr))
00485     {
00486       if (*ppObject)
00487       {
00488         (*ppObject)->Release();
00489         (*ppObject) = NULL;
00490       }
00491     }
00492   }
00493 }
00494 if (pObject)
00495   pObject->Release();
00496
00497 return hr;
00498 }
00499
00500
00501
00502
00503 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy)
00504 {
00505
00506          if (toCopy == -1)
00507
00508           {
00509                toCopy = wcslen(pszSource);
00510           }
00511
00512       return maxAlloc - (wcslen(pszTarget) + toCopy + 1);
00513 }
00514
00515
00516
00517 bool SAFE_APPEND(int targetSize, LPWSTR szTarget, LPCWSTR szSource)
00518 {
00519   if ( IS_BUFFER_ENOUGH( targetSize, szTarget, szSource) > 0 )
00520   {
00521     wcscpy(szTarget, szSource);
00522     return true;
00523   }
00524
00525   return false;
00526 }
00527
00528
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/ole2ui.c Source File

  • Com
  • Fundamentals
  • OleStd

ole2ui.c

Go to the documentation of this file.
00001 /*
00002  * OLE2UI.C
00003  *
00004  * Contains initialization routines and miscellaneous API implementations for
00005  * the OLE 2.0 User Interface Support Library.
00006  *
00007  * Copyright (c)1992 - 2000 Microsoft Corporation, All Right Reserved
00008  */
00009
00010 #define STRICT  1
00011
00012 #include "olestd.h"
00013 #include "common.h"
00014 #include "utility.h"
00015 #include <commdlg.h>
00016 #include "malspy.h"
00017
00018 OLEDBGDATA
00019
00020 #define WINDLL  1           // make far pointer version of stdargs.h
00021 #include <stdarg.h>
00022
00023 //The instance handle shared amongst all dialogs.
00024 HINSTANCE     ghInst;
00025
00026 // object count, used to support DllCanUnloadNow and OleUICanUnloadNow
00027 DWORD g_dwObjectCount=0;
00028 DWORD g_dwLockCount=0;
00029
00030 //Registered messages for use with all the dialogs, registered in LibMain
00031 UINT        uMsgHelp=0;
00032 UINT        uMsgEndDialog=0;
00033 UINT        uMsgBrowse=0;
00034 UINT        uMsgChangeIcon=0;
00035 UINT        uMsgFileOKString=0;
00036 UINT        uMsgCloseBusyDlg=0;
00037
00038 //Clipboard formats used by PasteSpecial
00039 UINT  cfObjectDescriptor;
00040 UINT  cfLinkSrcDescriptor;
00041 UINT  cfEmbedSource;
00042 UINT  cfEmbeddedObject;
00043 UINT  cfLinkSource;
00044 UINT  cfOwnerLink;
00045 UINT  cfFileName;
00046
00047
00048 // local definition
00049 #define WM_U_UPDATELINK WM_USER
00050
00051
00052
00053 /*
00054  * OleStdInitialize
00055  *
00056  * NOTE: This function should be called by your application before using any of
00057  *       the functions found in this library.
00058  *
00059  * Purpose:
00060  *   Initializes the OLE UI Library.
00061  *
00062  * Parameters:
00063  *
00064  *  hInstance       HINSTANCE of the module where the UI library resources
00065  *                  and Dialog Procedures are contained.  If you are calling
00066  *                  this function yourself, this should be the instance handle
00067  *                  of your application.
00068  *
00069  *  hPrevInst       HINSTANCE of the previous application instance.
00070  *                  This is the parameter passed in to your WinMain.  For
00071  *                  the DLL version, this should always be set to zero (for
00072  *                  WIN16 DLLs).
00073  *
00074  * Return Value:
00075  *  BOOL            TRUE if initialization was successful.
00076  *                  FALSE if either the "Magic Number" did not verify, or one of
00077  *                  the window classes could not be registered.  If the
00078  *                  "Magic Number" did not verify, then the resources
00079  *                  in your module are of a different version than the
00080  *                  ones you compiled with.
00081  */
00082
00083 STDAPI_(BOOL) OleStdInitialize(HINSTANCE hInstance)
00084 {
00085    OleDbgOut1("OleStdInitialize called.\r\n");
00086    ghInst=hInstance;
00087
00088    // Register Clipboard Formats used by PasteSpecial dialog.
00089    cfObjectDescriptor = RegisterClipboardFormat(CF_OBJECTDESCRIPTOR);
00090    cfLinkSrcDescriptor= RegisterClipboardFormat(CF_LINKSRCDESCRIPTOR);
00091    cfEmbedSource      = RegisterClipboardFormat(CF_EMBEDSOURCE);
00092    cfEmbeddedObject   = RegisterClipboardFormat(CF_EMBEDDEDOBJECT);
00093    cfLinkSource       = RegisterClipboardFormat(CF_LINKSOURCE);
00094    cfOwnerLink        = RegisterClipboardFormat(CF_OWNERLINK);
00095    cfFileName         = RegisterClipboardFormat(CF_FILENAME);
00096
00097 #ifdef TRACEMEM
00098    return (InitializeMallocSpy());
00099 #else
00100    return (TRUE);
00101 #endif
00102 }
00103
00104 STDAPI_(void) OleStdUninitialize(void)
00105 {
00106 #ifdef TRACEMEM
00107    UninitializeMallocSpy();
00108 #endif
00109 }
00110
00111 /*
00112  * OleUICanUnloadNow
00113  *
00114  * NOTE: if you link to this library and you implement
00115  *       DllCanUnloadNow, then you must call this routine in your
00116  *       implementation of DllCanUnloadNow to determine if you can be
00117  *       unloaded or not.
00118  *
00119  * Purpose:
00120  *   Determines when it is safe to go away
00121  *   (ie. there are no existing object instances).
00122  *
00123  * Return Value:
00124  *   HRESULT    NOERROR it is safe to go away, S_FALSE this code must stay
00125  *              loaded.
00126  *
00127  * Comments:
00128  *
00129  *   If an INPROC server DLL links to the OLESTD library,
00130  *   then the OleUILockLibrary function should NOT be used.
00131  *   instead the INPROC server DLL should call OleUICanUnloadNow API from
00132  *   within its own DllCanUnloadNow function. The idea here is, that if there
00133  *   are any existing instance of objects created by the OLESTD library
00134  *   functions (eg. EnumFORMATETC objects created by OleStdEnumFmtEtc_Create)
00135  *   then, the INPROC server DLL must NOT let itself be unloaded.
00136  *
00137  *   An EXE based object using the OLESTD libray need NOT use either the
00138  *   OleUILockLibrary or OleUICanUnloadNow functions. All objects created
00139  *   by the OLESTD library will have LRPC proxies and stubs created to
00140  *   manage remoting method calls. the worst that can happen when the EXE
00141  *   exits is that any outstanding proxies for unreleased objects will get
00142  *   RPC_E_SERVERDIED errors; they will not GPFault.
00143  */
00144
00145 STDAPI OleUICanUnloadNow()
00146 {
00147   if (g_dwObjectCount == 0) {
00148    return NOERROR;
00149   }
00150
00151   return S_FALSE;
00152 }
00153
00154
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/cshare.cpp Source File

  • Web
  • NetMeeting
  • NMUI

cshare.cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CDATA.CPP
00004 //  Content:    INmChannelData Routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 INmChannelAppShare  * g_pChannelAppShare  = NULL;
00018 CAppShareNotify   * g_pNotifyAppShare   = NULL;
00019
00020 static BOOL fRobCheck = FALSE;
00021
00022 // From CKIM
00023 VOID DoEnumApps(void)
00024 {
00025   HRESULT         hr    = NO_ERROR  ;
00026   ULONG         cFetched  = 0     ;
00027   IEnumNmSharableApp  * pEnum   = NULL    ;
00028   INmSharableApp    * pApp    = NULL    ;
00029
00030   if (NULL == g_pChannelAppShare)
00031     return;
00032
00033   if(fRobCheck != FALSE)
00034   {
00035     MessageBox(NULL, TEXT("DoEnumApps: Error"), TEXT("Error!!!"), MB_OK);
00036   }
00037
00038   fRobCheck = TRUE;
00039
00040   hr = g_pChannelAppShare->EnumSharableApp(&pEnum);
00041
00042   if (FAILED(hr))
00043     return;
00044
00045   while (1)
00046   {
00047     hr = pEnum->Next(1, &pApp, &cFetched);
00048
00049     if  (NULL != pApp)
00050     {
00051       pApp->Release();
00052       pApp = NULL;
00053     }
00054
00055     if FAILED(hr)
00056       break;
00057   }
00058
00059   pEnum->Release();
00060
00061   fRobCheck = FALSE;
00062 }
00063
00064
00065 //****************************************************************************
00066 //
00067 // HRESULT HookAppShare(INmChannel * pChannel)
00068 //
00069 //****************************************************************************
00070
00071
00072 HRESULT HookAppShare(INmChannel * pChannel)
00073 {
00074   HRESULT       hr    = NO_ERROR  ;
00075   CAppShareNotify * pNotify = NULL    ;
00076
00077   ASSERT(NULL != pChannel);
00078   if  (NULL == pChannel)
00079   {
00080     ERROR_MSG(TEXT("HookAppShare: NULL == pChannel"));
00081     return E_POINTER;
00082   }
00083
00084   //  Clean up any previous pointers [that were otherwise going to be overwritten]
00085
00086   if  ((NULL != g_pNotifyAppShare) || (NULL != g_pChannelAppShare))
00087   {
00088     ERROR_MSG(TEXT("HookAppShare: replacing existing App Sharing pointers"));
00089     FreeAs();
00090   }
00091
00092   //  Get new app sharing channel
00093
00094   hr = pChannel->QueryInterface(IID_INmChannelAppShare, (void **)&g_pChannelAppShare);
00095   if (FAILED(hr))
00096   {
00097     ERROR_MSG(TEXT("HookAppShare:Unable to get Application Sharing Channel"));
00098     return hr;
00099   }
00100
00101   if  (NULL == g_pChannelAppShare)
00102   {
00103     ERROR_MSG(TEXT("HookAppShare: QI Application Sharing Channel returned NULL"));
00104     return E_FAIL;
00105   }
00106
00107   // keep QI ref around
00108
00109     // Connect to the channel object
00110
00111     pNotify = new CAppShareNotify();
00112     if (pNotify == NULL)
00113     {
00114         hr = E_OUTOFMEMORY;
00115     }
00116     else
00117     {
00118     hr = pNotify->Connect(g_pChannelAppShare);
00119     if (FAILED(hr))
00120     {
00121       ERROR_MSG(TEXT("CConfNotify Failed (%s)"), GetHrSz(hr));
00122       pNotify->Release();
00123     }
00124     else
00125     {
00126       OBJECT_MSG(TEXT("AppSharing Connection point established successfully"));
00127       g_pNotifyAppShare = pNotify;
00128     }
00129   }
00130
00131   if (FAILED(hr))
00132   {
00133     g_pChannelAppShare->Release();
00134     g_pChannelAppShare = NULL;
00135   }
00136
00137   return hr;
00138 }
00139
00140
00141 //****************************************************************************
00142 //
00143 // VOID FreeAs(void)
00144 //
00145 //****************************************************************************
00146
00147 VOID FreeAs(void)
00148 {
00149   if(NULL != g_pNotifyAppShare)
00150   {
00151     g_pNotifyAppShare->Disconnect();
00152     g_pNotifyAppShare->Release();
00153     g_pNotifyAppShare = NULL;
00154   }
00155
00156   if (NULL != g_pChannelAppShare)
00157   {
00158     g_pChannelAppShare->Release();
00159     g_pChannelAppShare = NULL;
00160   }
00161 }
00162
00163
00164
00165 //****************************************************************************
00166 //
00167 // CLASS CAppShareNotify
00168 //
00169 //****************************************************************************
00170
00171 CAppShareNotify::CAppShareNotify() : RefCount(), CNotify()
00172 {
00173   OBJECT_MSG(TEXT("CAppShareNotify created"));
00174 }
00175
00176 CAppShareNotify::~CAppShareNotify()
00177 {
00178   OBJECT_MSG(TEXT("CAppShareNotify destroyed"));
00179 }
00180
00181
00182 //****************************************************************************
00183 //
00184 // Methods from IUnknown
00185 //
00186 //****************************************************************************
00187
00188 ULONG STDMETHODCALLTYPE CAppShareNotify::AddRef(void)
00189 {
00190   return RefCount::AddRef();
00191 }
00192
00193
00194 ULONG STDMETHODCALLTYPE CAppShareNotify::Release(void)
00195 {
00196   return RefCount::Release();
00197 }
00198
00199 HRESULT STDMETHODCALLTYPE CAppShareNotify::QueryInterface(REFIID riid, PVOID *ppvObject)
00200 {
00201   if  (NULL == ppvObject)
00202     return E_POINTER;
00203
00204   HRESULT hr = NO_ERROR;
00205
00206   if (riid == IID_IUnknown)
00207   {
00208     *ppvObject = (IUnknown *)this;
00209     OBJECT_MSG(TEXT("CAppShareNotify::QueryInterface(): Returning IUnknown."));
00210   }
00211   else if (riid == IID_INmChannelAppShareNotify)
00212   {
00213     *ppvObject = (INmChannelAppShareNotify *)this;
00214     OBJECT_MSG(TEXT("CAppShareNotify::QueryInterface(): Returning INmChannelAppShareNotify."));
00215   }
00216   else
00217   {
00218     hr = E_NOINTERFACE;
00219     *ppvObject = NULL;
00220     OBJECT_MSG(TEXT("CAppShareNotify::QueryInterface(): Called on unknown interface."));
00221   }
00222
00223   if SUCCEEDED(hr)
00224   {
00225     AddRef();
00226   }
00227
00228   return hr;
00229 }
00230
00231
00232 //****************************************************************************
00233 //
00234 // Methods from ICNotify
00235 //
00236 //****************************************************************************
00237
00238 HRESULT STDMETHODCALLTYPE CAppShareNotify::Connect(IUnknown *pUnk)
00239 {
00240   return CNotify::Connect(pUnk, IID_INmChannelAppShareNotify, (IUnknown *)this);
00241 }
00242
00243 HRESULT STDMETHODCALLTYPE CAppShareNotify::Disconnect(void)
00244 {
00245   return CNotify::Disconnect();
00246 }
00247
00248
00249 //****************************************************************************
00250 //
00251 // HRESULT STDMETHODCALLTYPE CAppShareNotify::NmUI(CONFN uNotify)
00252 //
00253 //****************************************************************************
00254
00255 HRESULT STDMETHODCALLTYPE CAppShareNotify::NmUI(CONFN uNotify)
00256 {
00257   NOTIFY_MSG(TEXT("CAppShareNotify::NmUI uNotify=%08X, pChannel=%08X"), uNotify, CNotify::GetPunk());
00258   return S_OK;
00259 }
00260
00261
00262 //****************************************************************************
00263 //
00264 // HRESULT STDMETHODCALLTYPE CAppShareNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00265 //
00266 //****************************************************************************
00267
00268 HRESULT STDMETHODCALLTYPE CAppShareNotify::MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember)
00269 {
00270   NOTIFY_MSG(TEXT("CAppShareNotify::MemberChanged uNotify=%d pMember=%08X, pChannel=%08X"), uNotify, pMember, CNotify::GetPunk());
00271
00272   PUSER pUser = PUserFromINmMember(pMember);
00273   if (NULL != pUser)
00274   {
00275     UpdateUserChannel(pUser, (INmChannel *) (CNotify::GetPunk()), uNotify);
00276   }
00277
00278   return S_OK;
00279 }
00280
00281
00282
00283 //****************************************************************************
00284 //
00285 // HRESULT STDMETHODCALLTYPE CAppShareNotify::StateChanged(NM_SHAPP_STATE uState, INmSharableApp *pApp)
00286 //
00287 //****************************************************************************
00288
00289 HRESULT STDMETHODCALLTYPE CAppShareNotify::StateChanged(NM_SHAPP_STATE uState, INmSharableApp *pApp)
00290 {
00291   if  (NULL == pApp)
00292   {
00293     ERROR_MSG(TEXT("CAppShareNotify::StateChanged: NULL == pApp"));
00294     return E_POINTER;
00295   }
00296
00297   TCHAR szState[MAX_PATH + 1];
00298   ZeroMemory(szState, MAX_PATH + 1);
00299
00300   BSTR  bstrApp = NULL;
00301   LPTSTR  pszApp  = NULL;
00302
00303   HRESULT hr    = NO_ERROR;
00304
00305   // Get the new share state
00306   _tcsncpy(szState, uState == NM_SHAPP_SHARED ? TEXT("shared\0") : TEXT("not shared\0"), MAX_PATH);
00307
00308   // Get the application information
00309   hr = pApp->GetName(&bstrApp);
00310   if(SUCCEEDED(hr))
00311   {
00312     pszApp = PszFromBstr(bstrApp);
00313     SysFreeString(bstrApp);
00314   }
00315
00316   STATE_MSG(TEXT("CAppShareNotify::StateChanged received."));
00317   STATE_MSG(TEXT("New state for [%s] is %s"), pszApp, szState);
00318
00319   FreePlpv(&pszApp);
00320
00321   return S_OK;
00322 }
00323
00324
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/about.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

about.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       about.h
00007 //
00008 //  Contents:   definition for an about dialog box class
00009 //
00010 //  Classes:    CAbout
00011 //
00012 //  Functions:
00013 //
00014 //  History:    6-08-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #ifndef __ABOUT_H__
00019 #define __ABOUT_H__
00020
00021 #include <cdialog.h>
00022
00023 #ifdef __cplusplus
00024
00025 //+---------------------------------------------------------------------------
00026 //
00027 //  Class:      CAbout
00028 //
00029 //  Purpose:    implements the about dialog box
00030 //
00031 //  Interface:  DialogProc -- dialog procedure
00032 //
00033 //  History:    6-08-94   stevebl   Created
00034 //
00035 //----------------------------------------------------------------------------
00036
00037 class CAbout: public CHlprDialog
00038 {
00039 public:
00040     BOOL DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
00041 };
00042
00043 #endif //__cplusplus
00044
00045 #endif //__ABOUT_H__
00046
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditHost/EdHost_p.c Source File

  • Web
  • Browser
  • EditHost

EdHost_p.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /* this ALWAYS GENERATED file contains the proxy stub code */
00006
00007
00008 /* File created by MIDL compiler version 5.01.0164 */
00009 /* at Thu Mar 02 10:33:13 2000
00010  */
00011 /* Compiler settings for C:\workshop\samples\browser\EditHost\EdHost.idl:
00012     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00013     error checks: allocation ref bounds_check enum stub_data
00014 */
00015 //@@MIDL_FILE_HEADING(  )
00016
00017 #define USE_STUBLESS_PROXY
00018
00019
00020 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00021 #ifndef __REDQ_RPCPROXY_H_VERSION__
00022 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00023 #endif
00024
00025
00026 #include "rpcproxy.h"
00027 #ifndef __RPCPROXY_H_VERSION__
00028 #error this stub requires an updated version of <rpcproxy.h>
00029 #endif // __RPCPROXY_H_VERSION__
00030
00031
00032 #include "EdHost.h"
00033
00034 #define TYPE_FORMAT_STRING_SIZE   11
00035 #define PROC_FORMAT_STRING_SIZE   241
00036
00037 typedef struct _MIDL_TYPE_FORMAT_STRING
00038     {
00039     short          Pad;
00040     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00041     } MIDL_TYPE_FORMAT_STRING;
00042
00043 typedef struct _MIDL_PROC_FORMAT_STRING
00044     {
00045     short          Pad;
00046     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00047     } MIDL_PROC_FORMAT_STRING;
00048
00049
00050 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00051 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00052
00053
00054 /* Object interface: IUnknown, ver. 0.0,
00055    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IDispatch, ver. 0.0,
00059    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00060
00061
00062 /* Object interface: IBrowserHost, ver. 0.0,
00063    GUID={0x5FD6158A,0x71F6,0x4F20,{0xB8,0xA9,0x6E,0xAF,0x5D,0x03,0x2D,0x15}} */
00064
00065
00066 extern const MIDL_STUB_DESC Object_StubDesc;
00067
00068
00069 extern const MIDL_SERVER_INFO IBrowserHost_ServerInfo;
00070
00071 #pragma code_seg(".orpc")
00072 static const unsigned short IBrowserHost_FormatStringOffsetTable[] =
00073     {
00074     (unsigned short) -1,
00075     (unsigned short) -1,
00076     (unsigned short) -1,
00077     (unsigned short) -1,
00078     0,
00079     22,
00080     44
00081     };
00082
00083 static const MIDL_SERVER_INFO IBrowserHost_ServerInfo =
00084     {
00085     &Object_StubDesc,
00086     0,
00087     __MIDL_ProcFormatString.Format,
00088     &IBrowserHost_FormatStringOffsetTable[-3],
00089     0,
00090     0,
00091     0,
00092     0
00093     };
00094
00095 static const MIDL_STUBLESS_PROXY_INFO IBrowserHost_ProxyInfo =
00096     {
00097     &Object_StubDesc,
00098     __MIDL_ProcFormatString.Format,
00099     &IBrowserHost_FormatStringOffsetTable[-3],
00100     0,
00101     0,
00102     0
00103     };
00104
00105 CINTERFACE_PROXY_VTABLE(10) _IBrowserHostProxyVtbl =
00106 {
00107     &IBrowserHost_ProxyInfo,
00108     &IID_IBrowserHost,
00109     IUnknown_QueryInterface_Proxy,
00110     IUnknown_AddRef_Proxy,
00111     IUnknown_Release_Proxy ,
00112     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00113     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00114     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00115     0 /* IDispatch_Invoke_Proxy */ ,
00116     (void *)-1 /* IBrowserHost::Run */ ,
00117     (void *)-1 /* IBrowserHost::Stop */ ,
00118     (void *)-1 /* IBrowserHost::GetHwnd */
00119 };
00120
00121
00122 static const PRPC_STUB_FUNCTION IBrowserHost_table[] =
00123 {
00124     STUB_FORWARDING_FUNCTION,
00125     STUB_FORWARDING_FUNCTION,
00126     STUB_FORWARDING_FUNCTION,
00127     STUB_FORWARDING_FUNCTION,
00128     NdrStubCall2,
00129     NdrStubCall2,
00130     NdrStubCall2
00131 };
00132
00133 CInterfaceStubVtbl _IBrowserHostStubVtbl =
00134 {
00135     &IID_IBrowserHost,
00136     &IBrowserHost_ServerInfo,
00137     10,
00138     &IBrowserHost_table[-3],
00139     CStdStubBuffer_DELEGATING_METHODS
00140 };
00141
00142
00143 /* Object interface: IGrid, ver. 0.0,
00144    GUID={0x213DA9A8,0xB856,0x4049,{0xBB,0xA3,0x11,0x75,0x8E,0x90,0x23,0x90}} */
00145
00146
00147 extern const MIDL_STUB_DESC Object_StubDesc;
00148
00149
00150 extern const MIDL_SERVER_INFO IGrid_ServerInfo;
00151
00152 #pragma code_seg(".orpc")
00153 static const unsigned short IGrid_FormatStringOffsetTable[] =
00154     {
00155     72,
00156     100
00157     };
00158
00159 static const MIDL_SERVER_INFO IGrid_ServerInfo =
00160     {
00161     &Object_StubDesc,
00162     0,
00163     __MIDL_ProcFormatString.Format,
00164     &IGrid_FormatStringOffsetTable[-3],
00165     0,
00166     0,
00167     0,
00168     0
00169     };
00170
00171 static const MIDL_STUBLESS_PROXY_INFO IGrid_ProxyInfo =
00172     {
00173     &Object_StubDesc,
00174     __MIDL_ProcFormatString.Format,
00175     &IGrid_FormatStringOffsetTable[-3],
00176     0,
00177     0,
00178     0
00179     };
00180
00181 CINTERFACE_PROXY_VTABLE(5) _IGridProxyVtbl =
00182 {
00183     &IGrid_ProxyInfo,
00184     &IID_IGrid,
00185     IUnknown_QueryInterface_Proxy,
00186     IUnknown_AddRef_Proxy,
00187     IUnknown_Release_Proxy ,
00188     (void *)-1 /* IGrid::get_GridSize */ ,
00189     (void *)-1 /* IGrid::put_GridSize */
00190 };
00191
00192 const CInterfaceStubVtbl _IGridStubVtbl =
00193 {
00194     &IID_IGrid,
00195     &IGrid_ServerInfo,
00196     5,
00197     0, /* pure interpreted */
00198     CStdStubBuffer_METHODS
00199 };
00200
00201
00202 /* Object interface: ISnap, ver. 0.0,
00203    GUID={0xCCBFDE40,0xFE5D,0x4A3C,{0x88,0x0B,0x47,0x83,0x97,0x15,0xE3,0xAC}} */
00204
00205
00206 extern const MIDL_STUB_DESC Object_StubDesc;
00207
00208
00209 extern const MIDL_SERVER_INFO ISnap_ServerInfo;
00210
00211 #pragma code_seg(".orpc")
00212
00213 static const MIDL_STUB_DESC Object_StubDesc =
00214     {
00215     0,
00216     NdrOleAllocate,
00217     NdrOleFree,
00218     0,
00219     0,
00220     0,
00221     0,
00222     0,
00223     __MIDL_TypeFormatString.Format,
00224     1, /* -error bounds_check flag */
00225     0x20000, /* Ndr library version */
00226     0,
00227     0x50100a4, /* MIDL Version 5.1.164 */
00228     0,
00229     0,
00230     0,  /* notify & notify_flag routine table */
00231     1,  /* Flags */
00232     0,  /* Reserved3 */
00233     0,  /* Reserved4 */
00234     0   /* Reserved5 */
00235     };
00236
00237 static const unsigned short ISnap_FormatStringOffsetTable[] =
00238     {
00239     (unsigned short) -1,
00240     (unsigned short) -1,
00241     (unsigned short) -1,
00242     (unsigned short) -1,
00243     128,
00244     156,
00245     184,
00246     212
00247     };
00248
00249 static const MIDL_SERVER_INFO ISnap_ServerInfo =
00250     {
00251     &Object_StubDesc,
00252     0,
00253     __MIDL_ProcFormatString.Format,
00254     &ISnap_FormatStringOffsetTable[-3],
00255     0,
00256     0,
00257     0,
00258     0
00259     };
00260
00261 static const MIDL_STUBLESS_PROXY_INFO ISnap_ProxyInfo =
00262     {
00263     &Object_StubDesc,
00264     __MIDL_ProcFormatString.Format,
00265     &ISnap_FormatStringOffsetTable[-3],
00266     0,
00267     0,
00268     0
00269     };
00270
00271 CINTERFACE_PROXY_VTABLE(11) _ISnapProxyVtbl =
00272 {
00273     &ISnap_ProxyInfo,
00274     &IID_ISnap,
00275     IUnknown_QueryInterface_Proxy,
00276     IUnknown_AddRef_Proxy,
00277     IUnknown_Release_Proxy ,
00278     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00279     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00280     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00281     0 /* IDispatch_Invoke_Proxy */ ,
00282     (void *)-1 /* ISnap::get_SnapIncrement */ ,
00283     (void *)-1 /* ISnap::put_SnapIncrement */ ,
00284     (void *)-1 /* ISnap::get_SnapOn */ ,
00285     (void *)-1 /* ISnap::put_SnapOn */
00286 };
00287
00288
00289 static const PRPC_STUB_FUNCTION ISnap_table[] =
00290 {
00291     STUB_FORWARDING_FUNCTION,
00292     STUB_FORWARDING_FUNCTION,
00293     STUB_FORWARDING_FUNCTION,
00294     STUB_FORWARDING_FUNCTION,
00295     NdrStubCall2,
00296     NdrStubCall2,
00297     NdrStubCall2,
00298     NdrStubCall2
00299 };
00300
00301 CInterfaceStubVtbl _ISnapStubVtbl =
00302 {
00303     &IID_ISnap,
00304     &ISnap_ServerInfo,
00305     11,
00306     &ISnap_table[-3],
00307     CStdStubBuffer_DELEGATING_METHODS
00308 };
00309
00310 #pragma data_seg(".rdata")
00311
00312 #if !defined(__RPC_WIN32__)
00313 #error  Invalid build platform for this stub.
00314 #endif
00315
00316 #if !(TARGET_IS_NT40_OR_LATER)
00317 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00318 #error   -Oif or -Oicf, more than 32 methods in the interface.
00319 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00320 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00321 #endif
00322
00323
00324 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00325     {
00326         0,
00327         {
00328
00329   /* Procedure Run */
00330
00331       0x33,   /* FC_AUTO_HANDLE */
00332       0x6c,   /* Old Flags:  object, Oi2 */
00333 /*  2 */  NdrFcLong( 0x0 ), /* 0 */
00334 /*  6 */  NdrFcShort( 0x7 ),  /* 7 */
00335 #ifndef _ALPHA_
00336 /*  8 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00337 #else
00338       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00339 #endif
00340 /* 10 */  NdrFcShort( 0x0 ),  /* 0 */
00341 /* 12 */  NdrFcShort( 0x8 ),  /* 8 */
00342 /* 14 */  0x4,    /* Oi2 Flags:  has return, */
00343       0x1,    /* 1 */
00344
00345   /* Return value */
00346
00347 /* 16 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00348 #ifndef _ALPHA_
00349 /* 18 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00350 #else
00351       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00352 #endif
00353 /* 20 */  0x8,    /* FC_LONG */
00354       0x0,    /* 0 */
00355
00356   /* Procedure Stop */
00357
00358 /* 22 */  0x33,   /* FC_AUTO_HANDLE */
00359       0x6c,   /* Old Flags:  object, Oi2 */
00360 /* 24 */  NdrFcLong( 0x0 ), /* 0 */
00361 /* 28 */  NdrFcShort( 0x8 ),  /* 8 */
00362 #ifndef _ALPHA_
00363 /* 30 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00364 #else
00365       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00366 #endif
00367 /* 32 */  NdrFcShort( 0x0 ),  /* 0 */
00368 /* 34 */  NdrFcShort( 0x8 ),  /* 8 */
00369 /* 36 */  0x4,    /* Oi2 Flags:  has return, */
00370       0x1,    /* 1 */
00371
00372   /* Return value */
00373
00374 /* 38 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00375 #ifndef _ALPHA_
00376 /* 40 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00377 #else
00378       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00379 #endif
00380 /* 42 */  0x8,    /* FC_LONG */
00381       0x0,    /* 0 */
00382
00383   /* Procedure GetHwnd */
00384
00385 /* 44 */  0x33,   /* FC_AUTO_HANDLE */
00386       0x6c,   /* Old Flags:  object, Oi2 */
00387 /* 46 */  NdrFcLong( 0x0 ), /* 0 */
00388 /* 50 */  NdrFcShort( 0x9 ),  /* 9 */
00389 #ifndef _ALPHA_
00390 /* 52 */  NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00391 #else
00392       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00393 #endif
00394 /* 54 */  NdrFcShort( 0x8 ),  /* 8 */
00395 /* 56 */  NdrFcShort( 0x8 ),  /* 8 */
00396 /* 58 */  0x4,    /* Oi2 Flags:  has return, */
00397       0x2,    /* 2 */
00398
00399   /* Parameter phwnd */
00400
00401 /* 60 */  NdrFcShort( 0x148 ),  /* Flags:  in, base type, simple ref, */
00402 #ifndef _ALPHA_
00403 /* 62 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00404 #else
00405       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00406 #endif
00407 /* 64 */  0x8,    /* FC_LONG */
00408       0x0,    /* 0 */
00409
00410   /* Return value */
00411
00412 /* 66 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00413 #ifndef _ALPHA_
00414 /* 68 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00415 #else
00416       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00417 #endif
00418 /* 70 */  0x8,    /* FC_LONG */
00419       0x0,    /* 0 */
00420
00421   /* Procedure get_GridSize */
00422
00423 /* 72 */  0x33,   /* FC_AUTO_HANDLE */
00424       0x6c,   /* Old Flags:  object, Oi2 */
00425 /* 74 */  NdrFcLong( 0x0 ), /* 0 */
00426 /* 78 */  NdrFcShort( 0x3 ),  /* 3 */
00427 #ifndef _ALPHA_
00428 /* 80 */  NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00429 #else
00430       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00431 #endif
00432 /* 82 */  NdrFcShort( 0x0 ),  /* 0 */
00433 /* 84 */  NdrFcShort( 0x10 ), /* 16 */
00434 /* 86 */  0x4,    /* Oi2 Flags:  has return, */
00435       0x2,    /* 2 */
00436
00437   /* Parameter pVal */
00438
00439 /* 88 */  NdrFcShort( 0x2150 ), /* Flags:  out, base type, simple ref, srv alloc size=8 */
00440 #ifndef _ALPHA_
00441 /* 90 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00442 #else
00443       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00444 #endif
00445 /* 92 */  0x8,    /* FC_LONG */
00446       0x0,    /* 0 */
00447
00448   /* Return value */
00449
00450 /* 94 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00451 #ifndef _ALPHA_
00452 /* 96 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00453 #else
00454       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00455 #endif
00456 /* 98 */  0x8,    /* FC_LONG */
00457       0x0,    /* 0 */
00458
00459   /* Procedure put_GridSize */
00460
00461 /* 100 */ 0x33,   /* FC_AUTO_HANDLE */
00462       0x6c,   /* Old Flags:  object, Oi2 */
00463 /* 102 */ NdrFcLong( 0x0 ), /* 0 */
00464 /* 106 */ NdrFcShort( 0x4 ),  /* 4 */
00465 #ifndef _ALPHA_
00466 /* 108 */ NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00467 #else
00468       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00469 #endif
00470 /* 110 */ NdrFcShort( 0x8 ),  /* 8 */
00471 /* 112 */ NdrFcShort( 0x8 ),  /* 8 */
00472 /* 114 */ 0x4,    /* Oi2 Flags:  has return, */
00473       0x2,    /* 2 */
00474
00475   /* Parameter newVal */
00476
00477 /* 116 */ NdrFcShort( 0x48 ), /* Flags:  in, base type, */
00478 #ifndef _ALPHA_
00479 /* 118 */ NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00480 #else
00481       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00482 #endif
00483 /* 120 */ 0x8,    /* FC_LONG */
00484       0x0,    /* 0 */
00485
00486   /* Return value */
00487
00488 /* 122 */ NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00489 #ifndef _ALPHA_
00490 /* 124 */ NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00491 #else
00492       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00493 #endif
00494 /* 126 */ 0x8,    /* FC_LONG */
00495       0x0,    /* 0 */
00496
00497   /* Procedure get_SnapIncrement */
00498
00499 /* 128 */ 0x33,   /* FC_AUTO_HANDLE */
00500       0x6c,   /* Old Flags:  object, Oi2 */
00501 /* 130 */ NdrFcLong( 0x0 ), /* 0 */
00502 /* 134 */ NdrFcShort( 0x7 ),  /* 7 */
00503 #ifndef _ALPHA_
00504 /* 136 */ NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00505 #else
00506       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00507 #endif
00508 /* 138 */ NdrFcShort( 0x0 ),  /* 0 */
00509 /* 140 */ NdrFcShort( 0x10 ), /* 16 */
00510 /* 142 */ 0x4,    /* Oi2 Flags:  has return, */
00511       0x2,    /* 2 */
00512
00513   /* Parameter pVal */
00514
00515 /* 144 */ NdrFcShort( 0x2150 ), /* Flags:  out, base type, simple ref, srv alloc size=8 */
00516 #ifndef _ALPHA_
00517 /* 146 */ NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00518 #else
00519       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00520 #endif
00521 /* 148 */ 0x8,    /* FC_LONG */
00522       0x0,    /* 0 */
00523
00524   /* Return value */
00525
00526 /* 150 */ NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00527 #ifndef _ALPHA_
00528 /* 152 */ NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00529 #else
00530       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00531 #endif
00532 /* 154 */ 0x8,    /* FC_LONG */
00533       0x0,    /* 0 */
00534
00535   /* Procedure put_SnapIncrement */
00536
00537 /* 156 */ 0x33,   /* FC_AUTO_HANDLE */
00538       0x6c,   /* Old Flags:  object, Oi2 */
00539 /* 158 */ NdrFcLong( 0x0 ), /* 0 */
00540 /* 162 */ NdrFcShort( 0x8 ),  /* 8 */
00541 #ifndef _ALPHA_
00542 /* 164 */ NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00543 #else
00544       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00545 #endif
00546 /* 166 */ NdrFcShort( 0x8 ),  /* 8 */
00547 /* 168 */ NdrFcShort( 0x8 ),  /* 8 */
00548 /* 170 */ 0x4,    /* Oi2 Flags:  has return, */
00549       0x2,    /* 2 */
00550
00551   /* Parameter newVal */
00552
00553 /* 172 */ NdrFcShort( 0x48 ), /* Flags:  in, base type, */
00554 #ifndef _ALPHA_
00555 /* 174 */ NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00556 #else
00557       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00558 #endif
00559 /* 176 */ 0x8,    /* FC_LONG */
00560       0x0,    /* 0 */
00561
00562   /* Return value */
00563
00564 /* 178 */ NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00565 #ifndef _ALPHA_
00566 /* 180 */ NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00567 #else
00568       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00569 #endif
00570 /* 182 */ 0x8,    /* FC_LONG */
00571       0x0,    /* 0 */
00572
00573   /* Procedure get_SnapOn */
00574
00575 /* 184 */ 0x33,   /* FC_AUTO_HANDLE */
00576       0x6c,   /* Old Flags:  object, Oi2 */
00577 /* 186 */ NdrFcLong( 0x0 ), /* 0 */
00578 /* 190 */ NdrFcShort( 0x9 ),  /* 9 */
00579 #ifndef _ALPHA_
00580 /* 192 */ NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00581 #else
00582       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00583 #endif
00584 /* 194 */ NdrFcShort( 0x0 ),  /* 0 */
00585 /* 196 */ NdrFcShort( 0x10 ), /* 16 */
00586 /* 198 */ 0x4,    /* Oi2 Flags:  has return, */
00587       0x2,    /* 2 */
00588
00589   /* Parameter pVal */
00590
00591 /* 200 */ NdrFcShort( 0x2150 ), /* Flags:  out, base type, simple ref, srv alloc size=8 */
00592 #ifndef _ALPHA_
00593 /* 202 */ NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00594 #else
00595       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00596 #endif
00597 /* 204 */ 0x8,    /* FC_LONG */
00598       0x0,    /* 0 */
00599
00600   /* Return value */
00601
00602 /* 206 */ NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00603 #ifndef _ALPHA_
00604 /* 208 */ NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00605 #else
00606       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00607 #endif
00608 /* 210 */ 0x8,    /* FC_LONG */
00609       0x0,    /* 0 */
00610
00611   /* Procedure put_SnapOn */
00612
00613 /* 212 */ 0x33,   /* FC_AUTO_HANDLE */
00614       0x6c,   /* Old Flags:  object, Oi2 */
00615 /* 214 */ NdrFcLong( 0x0 ), /* 0 */
00616 /* 218 */ NdrFcShort( 0xa ),  /* 10 */
00617 #ifndef _ALPHA_
00618 /* 220 */ NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00619 #else
00620       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00621 #endif
00622 /* 222 */ NdrFcShort( 0x8 ),  /* 8 */
00623 /* 224 */ NdrFcShort( 0x8 ),  /* 8 */
00624 /* 226 */ 0x4,    /* Oi2 Flags:  has return, */
00625       0x2,    /* 2 */
00626
00627   /* Parameter newVal */
00628
00629 /* 228 */ NdrFcShort( 0x48 ), /* Flags:  in, base type, */
00630 #ifndef _ALPHA_
00631 /* 230 */ NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00632 #else
00633       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00634 #endif
00635 /* 232 */ 0x8,    /* FC_LONG */
00636       0x0,    /* 0 */
00637
00638   /* Return value */
00639
00640 /* 234 */ NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00641 #ifndef _ALPHA_
00642 /* 236 */ NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00643 #else
00644       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00645 #endif
00646 /* 238 */ 0x8,    /* FC_LONG */
00647       0x0,    /* 0 */
00648
00649       0x0
00650         }
00651     };
00652
00653 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00654     {
00655         0,
00656         {
00657       NdrFcShort( 0x0 ),  /* 0 */
00658 /*  2 */
00659       0x11, 0x8,  /* FC_RP [simple_pointer] */
00660 /*  4 */  0x8,    /* FC_LONG */
00661       0x5c,   /* FC_PAD */
00662 /*  6 */
00663       0x11, 0xc,  /* FC_RP [alloced_on_stack] [simple_pointer] */
00664 /*  8 */  0x8,    /* FC_LONG */
00665       0x5c,   /* FC_PAD */
00666
00667       0x0
00668         }
00669     };
00670
00671 const CInterfaceProxyVtbl * _EdHost_ProxyVtblList[] =
00672 {
00673     ( CInterfaceProxyVtbl *) &_ISnapProxyVtbl,
00674     ( CInterfaceProxyVtbl *) &_IBrowserHostProxyVtbl,
00675     ( CInterfaceProxyVtbl *) &_IGridProxyVtbl,
00676     0
00677 };
00678
00679 const CInterfaceStubVtbl * _EdHost_StubVtblList[] =
00680 {
00681     ( CInterfaceStubVtbl *) &_ISnapStubVtbl,
00682     ( CInterfaceStubVtbl *) &_IBrowserHostStubVtbl,
00683     ( CInterfaceStubVtbl *) &_IGridStubVtbl,
00684     0
00685 };
00686
00687 PCInterfaceName const _EdHost_InterfaceNamesList[] =
00688 {
00689     "ISnap",
00690     "IBrowserHost",
00691     "IGrid",
00692     0
00693 };
00694
00695 const IID *  _EdHost_BaseIIDList[] =
00696 {
00697     &IID_IDispatch,
00698     &IID_IDispatch,
00699     0,
00700     0
00701 };
00702
00703
00704 #define _EdHost_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _EdHost, pIID, n)
00705
00706 int __stdcall _EdHost_IID_Lookup( const IID * pIID, int * pIndex )
00707 {
00708     IID_BS_LOOKUP_SETUP
00709
00710     IID_BS_LOOKUP_INITIAL_TEST( _EdHost, 3, 2 )
00711     IID_BS_LOOKUP_NEXT_TEST( _EdHost, 1 )
00712     IID_BS_LOOKUP_RETURN_RESULT( _EdHost, 3, *pIndex )
00713
00714 }
00715
00716 const ExtendedProxyFileInfo EdHost_ProxyFileInfo =
00717 {
00718     (PCInterfaceProxyVtblList *) & _EdHost_ProxyVtblList,
00719     (PCInterfaceStubVtblList *) & _EdHost_StubVtblList,
00720     (const PCInterfaceName * ) & _EdHost_InterfaceNamesList,
00721     (const IID ** ) & _EdHost_BaseIIDList,
00722     & _EdHost_IID_Lookup,
00723     3,
00724     2,
00725     0, /* table of [async_uuid] interfaces */
00726     0, /* Filler1 */
00727     0, /* Filler2 */
00728     0  /* Filler3 */
00729 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_Queue Member List

This is the complete list of members for _Queue, including all inherited members.
nAllocated | _Queue
nJobs | _Queue
pJobs | _Queue
Printer | _Queue
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows2000/Module.Cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows2000

Module.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        module.cpp
00007 //
00008 // Contents:    Cert Server Exit Module implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013 #pragma hdrstop
00014
00015 #include "celibw2k.h"
00016 #include "module.h"
00017 #include "exit.h"
00018
00019
00020 STDMETHODIMP
00021 CCertManageExitModuleSample::GetProperty(
00022             /* [in] */ const BSTR strConfig,
00023             /* [in] */ BSTR strStorageLocation,
00024             /* [in] */ BSTR strPropertyName,
00025             /* [in] */ LONG Flags,
00026             /* [retval][out] */ VARIANT __RPC_FAR *pvarProperty)
00027 {
00028     LPWSTR szStr = NULL;
00029     if (strPropertyName == NULL)
00030         return S_FALSE;
00031
00032     if (0 == wcscmp(strPropertyName, wszCMM_PROP_NAME))
00033         szStr = wsz_SAMPLE_NAME;
00034     else if (0 == wcscmp(strPropertyName, wszCMM_PROP_DESCRIPTION))
00035         szStr = wsz_SAMPLE_DESCRIPTION;
00036     else if (0 == wcscmp(strPropertyName, wszCMM_PROP_COPYRIGHT))
00037         szStr = wsz_SAMPLE_COPYRIGHT;
00038     else if (0 == wcscmp(strPropertyName, wszCMM_PROP_FILEVER))
00039         szStr = wsz_SAMPLE_FILEVER;
00040     else if (0 == wcscmp(strPropertyName, wszCMM_PROP_PRODUCTVER))
00041         szStr = wsz_SAMPLE_PRODUCTVER;
00042     else
00043         return S_FALSE;
00044
00045     pvarProperty->bstrVal = SysAllocString(szStr);
00046     if (NULL == pvarProperty->bstrVal)
00047         return E_OUTOFMEMORY;
00048
00049     pvarProperty->vt = VT_BSTR;
00050
00051     return S_OK;
00052 }
00053
00054 STDMETHODIMP
00055 CCertManageExitModuleSample::SetProperty(
00056             /* [in] */ const BSTR strConfig,
00057             /* [in] */ BSTR strStorageLocation,
00058             /* [in] */ BSTR strPropertyName,
00059             /* [in] */ LONG Flags,
00060             /* [in] */ VARIANT const __RPC_FAR *pvarProperty)
00061 {
00062      // no settable properties supported
00063      return S_FALSE;
00064 }
00065
00066 STDMETHODIMP
00067 CCertManageExitModuleSample::Configure(
00068             /* [in] */ const BSTR strConfig,
00069             /* [in] */ BSTR strStorageLocation,
00070             /* [in] */ LONG Flags)
00071 {
00072     MessageBox(NULL, L"No Configurable Options", NULL, MB_OK|MB_ICONINFORMATION);
00073
00074     return S_OK;
00075 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Filter/vc/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Filter
  • vc

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  Filter.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

BINDINGINFO Member List

This is the complete list of members for BINDINGINFO, including all inherited members.
cBindings | BINDINGINFO
hAccessor | BINDINGINFO
rgBindings | BINDINGINFO
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkBlog/C#/InkArea.cs Source File

  • TabletPC
  • InkBlog
  • C#

InkArea.cs

Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 //
00003 //  This is part of the Microsoft Tablet PC Platform SDK
00004 //  Copyright (C) 2004 Microsoft Corporation
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00009 //  documentation provided with the Software Development Kit.
00010 //  See these sources for more detailed information.
00011 //
00012 //  File: InkArea.cs
00013 //  Simple control that accepts either ink or text input, depending
00014 //  on the capabilities of the user's machine.
00015 //
00016 //  This control checks whether the client's machine is ink-enabled.
00017 //  If so, it uses an InkCollector attached to a Panel for ink
00018 //  collection.  Otherwise, it defaults to using a textbox.
00019 //
00020 //  The features used are: InkCollector, handwriting recognition, and
00021 //  ink serialization.
00022 //
00023 //--------------------------------------------------------------------------
00024
00025 using System;
00026 using System.Diagnostics;
00027 using System.IO;
00028 using System.Windows.Forms;
00029
00030 // The Ink namespace, which contains the Tablet PC Platform API
00031 using Microsoft.Ink;
00032
00033 namespace InkBlog
00034 {
00035
00036     /// <summary>
00037     /// The InkArea Sample Control class
00038     /// </summary>
00039     public class InkArea : UserControl
00040     {
00041
00042         // Declare the control used for collecting blog input
00043         private Control inputArea = null;
00044
00045         // Declare the InkCollector used for collecting blog
00046         // input when the client's machine is ink-enabled.
00047         private object inkCollector = null;
00048
00049         #region Standard Template Code
00050         /// <summary>
00051         /// Required designer variable.
00052         /// </summary>
00053         private System.ComponentModel.Container components = null;
00054         #endregion
00055
00056         public InkArea()
00057         {
00058             #region Standard Template Code
00059             // This call is required by the Windows.Forms Form Designer.
00060             InitializeComponent();
00061             #endregion
00062
00063             // Attempt to create an InkCollector and attach it to
00064             // a Panel control.  If successful, this client can
00065             // support inking within a web page.  Otherwise, use a
00066             // Textbox for collecting blog input.
00067             try
00068             {
00069                 inputArea = CreateInkCollectionSurface();
00070             }
00071             catch (FileNotFoundException)
00072             {
00073                 inputArea = new TextBox();
00074                 ((TextBox)inputArea).Multiline = true;
00075             }
00076
00077             inputArea.Size = this.Size;
00078
00079             // Add the control used for collecting blog input
00080             this.Controls.Add(inputArea);
00081
00082         }
00083
00084         #region Standard Template Code
00085         /// <summary>
00086         /// Clean up any resources being used.
00087         /// </summary>
00088         protected override void Dispose( bool disposing )
00089         {
00090             if( disposing )
00091             {
00092                 if(components != null)
00093                 {
00094                     components.Dispose();
00095                 }
00096             }
00097             base.Dispose( disposing );
00098         }
00099         #endregion
00100
00101         #region Component Designer generated code
00102         /// <summary>
00103         /// Required method for Designer support - do not modify
00104         /// the contents of this method with the code editor.
00105         /// </summary>
00106         private void InitializeComponent()
00107         {
00108             this.SuspendLayout();
00109             this.Name = "InkArea";
00110             this.ResumeLayout(false);
00111         }
00112         #endregion
00113
00114         /// <summary>
00115         /// Event hander from this control's Resize event
00116         /// Updates the child control to have the same size.
00117         /// </summary>
00118         /// <param name="e"></param>
00119         protected override void OnResize(EventArgs e)
00120         {
00121             if (null != inputArea)
00122             {
00123                 inputArea.Size = this.Size;
00124             }
00125         }
00126
00127
00128         /// <summary>
00129         /// Indicates whether inking is supported on the client machine.
00130         /// </summary>
00131         /// <returns>Returns true if inking is supported and false otherwise.</returns>
00132         public bool InkEnabled
00133         {
00134             get
00135             {
00136                 return inkCollector != null;
00137             }
00138         }
00139
00140         /// <summary>
00141         /// If inking is supported, returns the serialized ink data.
00142         /// Otherwise, returns an empty string.
00143         /// </summary>
00144         public string InkData
00145         {
00146             get
00147             {
00148                 if (InkEnabled)
00149                 {
00150                     return SerializeInkData();
00151                 }
00152                 else
00153                 {
00154                     return String.Empty;
00155                 }
00156             }
00157         }
00158
00159         /// <summary>
00160         /// If inking is supported, returns the recognized ink.
00161         /// Otherwise, returns the contents of the text box.
00162         /// </summary>
00163         public string TextData
00164         {
00165             get
00166             {
00167                 if (InkEnabled)
00168                 {
00169                     return RecognizeInkData();
00170                 }
00171                 else
00172                 {
00173                     return ((TextBox)inputArea).Text;
00174                 }
00175             }
00176         }
00177
00178         /// <summary>
00179         /// Disposes of the internal child control used for collecting ink.
00180         /// </summary>
00181         public void DisposeResources()
00182         {
00183             if (InkEnabled)
00184             {
00185                 ((InkCollector)inkCollector).Dispose();
00186             }
00187         }
00188
00189
00190         #region Helper Methods (private)
00191
00192         /// <summary>
00193         /// Attempts to create an InkCollector and attach it to a
00194         /// Panel control.  If unable to create the InkCollector,
00195         /// an exception is thrown.
00196         /// </summary>
00197         /// <returns>Control to be used for this inking area</returns>
00198         protected Control CreateInkCollectionSurface()
00199         {
00200             try
00201             {
00202                 Panel inkPanel = new Panel();
00203                 inkPanel.BorderStyle = BorderStyle.Fixed3D;
00204                 inkCollector = new InkCollector(inkPanel);
00205                 ((InkCollector)inkCollector).Enabled = true;
00206                 return inkPanel;
00207             }
00208             catch
00209             {
00210                 throw;
00211             }
00212         }
00213
00214         /// <summary>
00215         /// Serializes the ink data as GIF using a Base 64 string.
00216         /// </summary>
00217         /// <returns>Ink data as a GIF using a Base 64 string</returns>
00218         protected String SerializeInkData()
00219         {
00220             Debug.Assert(InkEnabled, null, "Client must be ink-enabled");
00221
00222             // Obtain the ink associated with this control
00223             Ink ink = ((InkCollector)inkCollector).Ink;
00224
00225             // Serialize the ink
00226             if (ink.Strokes.Count > 0)
00227             {
00228                 byte[] inkDataBytes = ink.Save(PersistenceFormat.Gif);
00229                 return Convert.ToBase64String(inkDataBytes);
00230             }
00231
00232             // Default to returning the empty string.
00233             return String.Empty;
00234         }
00235
00236         /// <summary>
00237         /// Recognize ink data using the default recognizer.
00238         /// </summary>
00239         /// <returns>The string containing the top recognition result.</returns>
00240         protected String RecognizeInkData()
00241         {
00242             Debug.Assert(InkEnabled, null, "Client must be ink-enabled");
00243
00244             // Obtain the ink associated with this control
00245             Ink ink = ((InkCollector)inkCollector).Ink;
00246
00247             if (ink.Strokes.Count > 0)
00248             {
00249
00250                 // Attempt to create a recognition context and use it to
00251                 // retrieve the top alternate.
00252                 try
00253                 {
00254                     RecognizerContext recognizerContext = new RecognizerContext();
00255                     RecognitionStatus recognitionStatus;
00256                     recognizerContext.Strokes = ink.Strokes;
00257                     RecognitionResult recognitionResult = recognizerContext.Recognize(out recognitionStatus);
00258                     if ( ( recognitionStatus == RecognitionStatus.NoError ) &&
00259                          ( null != recognitionResult) )
00260                     {
00261                         return recognitionResult.TopString;
00262                     }
00263                 }
00264                 catch (Exception)
00265                 {
00266                     // An exception will occur if the client does not have
00267                     // any handwriting recognizers installed on their system.
00268                     // In this case, we default to returning an empty string.
00269                 }
00270             }
00271
00272             return String.Empty;
00273         }
00274
00275         #endregion
00276     }
00277 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/CStrTabl.Cpp Source File

  • WinUI
  • Shell
  • FileView

CStrTabl.Cpp

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  PROGRAM:    CSTRTABL.CPP
00009 //
00010 //  PURPOSE:   Implementation of a string table handler.  The CStringTable
00011 // class hides details of storage from the user.  The strings might
00012 // be cached, or they might be loaded as necessary.  In either case,
00013 // we must know the number of strings so we know whether or not to
00014 // reload strings.
00015 //
00016 //  PLATFORMS:  Windows 95
00017 //
00018 //  FUNCTIONS:
00019 //
00020 //
00021 //  SPECIAL INSTRUCTIONS: N/A
00022 //
00023 #include "fileview.h"
00024
00025 //
00026 //   FUNCTION: CStringTable::CStringTable
00027 //
00028 //   PURPOSE:   Constructor
00029 //
00030 //   PARAMETERS:
00031 //       hInst           HANDLE to the module instance from which we  load strings.
00032 //
00033 CStringTable::CStringTable(HINSTANCE hInst)
00034     {
00035     m_hInst=hInst;
00036     m_pszStrings=NULL;
00037     m_ppszTable=NULL;
00038     return;
00039     }
00040
00041 //
00042 //   FUNCTION:  CStringTable::~CStringTable
00043 //
00044 //   PURPOSE:   Destructor
00045 //
00046 CStringTable::~CStringTable(void)
00047     {
00048     if (NULL!=m_pszStrings)
00049         free(m_pszStrings);
00050
00051     if (NULL!=m_ppszTable)
00052         free(m_ppszTable);
00053
00054     return;
00055     }
00056 //
00057 //   FUNCTION: CStringTable::FInit
00058 //
00059 //   PURPOSE:    Initialization function for a StringTable that is prone to
00060 //  failure.  If this fails then the caller is responsible for
00061 //  guaranteeing that the destructor is called quickly.
00062 //
00063 //   PARAMETERS:
00064 //   idsMin          UINT first identifier in the stringtable
00065 //  idsMax          UINT last identifier in the stringtable.
00066 //  cchMax          UINT with the maximum string length allowed.
00067 //
00068 //   RETURN VALUE:
00069 //     BOOL            TRUE if the function is successful,  FALSE otherwise.
00070 //
00071 BOOL CStringTable::FInit(UINT idsMin, UINT idsMax, UINT cchMax)
00072     {
00073     UINT        i;
00074     UINT        cch;
00075     UINT        cchUsed=0;
00076     LPSTR       psz;
00077
00078     m_idsMin=idsMin;
00079     m_idsMax=idsMax;
00080     m_cStrings=(idsMax-idsMin+1);
00081
00082     //Allocate space for the pointer table.
00083     m_ppszTable=(LPSTR *)malloc(sizeof(LPSTR)*m_cStrings);
00084
00085     if (NULL==m_ppszTable)
00086         return FALSE;
00087      // Allocate enough memory for cStrings*cchMax characters.  80
00088      // characters is the maximum string length we allow.  This
00089      // will result in some unused memory, but a few K is not
00090      // worth quibbling over.
00091     m_pszStrings=(LPSTR)malloc(m_cStrings * cchMax);
00092
00093     if (NULL==m_pszStrings)
00094         {
00095         free(m_ppszTable);
00096         m_ppszTable=NULL;
00097         return FALSE;
00098         }
00099      // Load the strings:  we load each string in turn into psz,
00100      // store the string pointer into the table and increment psz
00101      // to the next positions.
00102     psz=m_pszStrings;
00103
00104     for (i=idsMin; i <= idsMax; i++)
00105         {
00106         m_ppszTable[i-idsMin]=psz;
00107         cch=LoadString(m_hInst, i, psz, 255);
00108
00109         //Account for a null terminator with +1
00110         psz    +=cch+1;
00111         cchUsed+=cch;
00112         }
00113
00114     return TRUE;
00115     }
00116 //
00117 //   FUNCTION: CStringTable::operator[]
00118 //
00119 //   PURPOSE:  Returns a pointer to the requested string in the stringtable
00120 //  or NULL if the specified string does not exist.
00121 //
00122 const LPSTR CStringTable::operator[](const UINT uID) const
00123     {
00124     if (uID < m_idsMin || uID > m_idsMax)
00125         return NULL;
00126
00127     return (const LPSTR)m_ppszTable[uID-m_idsMin];
00128     }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/registry.h Source File

  • SysMgmt
  • MMC
  • Nodes

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout,   // Class Id for About Class
00040                        const BOOL fSupportExtensions = FALSE);
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/dataobj.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

dataobj.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "DataObj.h"
00016 #include "StaticNode.h"
00017
00018                              // Tracing stuff
00019 #include "TraceMacro.h"
00020 #undef  MODULESTRING
00021 #define MODULESTRING  _T("CDataObject")
00022
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // Construction/Destruction
00026
00027
00028 //---------------------------------------------------------------------------
00029 CDataObject::CDataObject()
00030 {
00031   m_cRef     = 0;
00032   m_uCookie  = 0;
00033   m_uContext = 0;
00034
00035   m_uNodeTypeFlg   = 0;                // DRAGDROP: New data members
00036   m_pEnumFormatEtc = NULL;
00037 }
00038
00039 //---------------------------------------------------------------------------
00040 // MMC20: In versions 1.X of MMC the pointer returned by ::EnumFormatEtc()
00041 //        was leaked.  This is fixed in 2.X but will cause an AV when your
00042 //        1.X Snap-in runs on 2.X, and you release the cached pointer used
00043 //        to work around the leak.  If your code needs to run on both
00044 //        platforms you should do something like this:
00045 //
00046 CDataObject::~CDataObject()
00047 {
00048   if( g_CV.nMajor < 2 )      // Running under MMC 1.X
00049   {
00050     if( NULL != m_pEnumFormatEtc )
00051     {
00052       LONG cRef = m_pEnumFormatEtc->Release();
00053       _ASSERT( 0 == cRef );
00054     }
00055   }
00056 }
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 // IUnknown implementation
00060
00061 //---------------------------------------------------------------------------
00062 STDMETHODIMP CDataObject::QueryInterface
00063 (
00064   REFIID   riid,
00065   LPVOID*  ppv
00066 )
00067 {
00068   if( !ppv )
00069     return E_FAIL;
00070
00071   HRESULT hResult = E_NOINTERFACE;
00072   *ppv = NULL;
00073
00074   if( IsEqualIID(riid, IID_IUnknown) )
00075     *ppv = static_cast<IDataObject*>(this);
00076   else if( IsEqualIID(riid, IID_IDataObject) )
00077     *ppv = static_cast<IDataObject*>(this);
00078
00079   if( *ppv )
00080   {
00081     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00082     hResult = S_OK;
00083   }
00084
00085   return hResult;
00086 }
00087
00088 //---------------------------------------------------------------------------
00089 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00090 {
00091   return InterlockedIncrement((LONG*)&m_cRef);
00092 }
00093
00094 //---------------------------------------------------------------------------
00095 STDMETHODIMP_(ULONG) CDataObject::Release()
00096 {
00097   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00098   {
00099     delete this;
00100     return 0;
00101   }
00102   return m_cRef;
00103 }
00104
00105 /////////////////////////////////////////////////////////////////////////////
00106 // IDataObject implementation
00107 //
00108
00109 //---------------------------------------------------------------------------
00110 //  MMC will call GetDataHere() for it's required clipboard formats
00111 //
00112 HRESULT CDataObject::GetDataHere
00113 (
00114   FORMATETC* pFormatEtc,     //[in]  Pointer to the FORMATETC structure
00115   STGMEDIUM* pMedium         //[out] Pointer to the STGMEDIUM structure
00116 )
00117 {
00118   const CLIPFORMAT cf = pFormatEtc->cfFormat;
00119   IStream* ipStream = NULL;
00120
00121   HRESULT hResult = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &ipStream );
00122   if( S_OK != hResult )
00123     return hResult;                        // Minimal error checking
00124
00125   hResult = DV_E_FORMATETC;                // Unknown format
00126
00127   if( cf == g_cfDisplayName )
00128   {
00129     hResult = RetrieveDisplayString( ipStream );
00130   }
00131   else if( cf == g_cfSnapinClsid )
00132   {
00133     hResult = RetrieveSnapInClassID( ipStream );
00134   }
00135   else if( cf == g_cfNodeType )
00136   {
00137     hResult = RetrieveNodeTypeGuid( ipStream );
00138   }
00139   else if( cf == g_cfszNodeType )
00140   {
00141     hResult = RetrieveGuidString( ipStream );
00142   }
00143   else if( cf == g_cfBaseNodePtr )
00144   {
00145     hResult = RetrieveBaseNodePtr( ipStream );
00146   }
00147   else if( cf == g_cfDataObjPtr )
00148   {
00149     hResult = RetrieveDataObjPtr( ipStream );
00150   }
00151
00152   ipStream->Release();
00153
00154   return hResult;
00155 }
00156
00157 //---------------------------------------------------------------------------
00158 //  DRAGDROP:  Support for the two custom clipboard formats we need to
00159 //             make interprocess DragDrop work
00160 //
00161 HRESULT CDataObject::GetData
00162 (
00163   FORMATETC*  pFormatEtc,    //[in]  Pointer to the FORMATETC structure
00164   STGMEDIUM*  pStgMedium     //[out] Pointer to the STGMEDIUM structure
00165 )
00166 {
00167   HRESULT hResult = DATA_E_FORMATETC;
00168
00169   if( g_cfNodePropPtr == pFormatEtc->cfFormat )  // Looking for Node Properties
00170   {
00171     hResult = RetrieveNodePropPtr( pStgMedium );
00172   }
00173   else if( g_cfNodeTypeFlg == pFormatEtc->cfFormat )
00174   {
00175     hResult = RetrieveNodeTypeFlg( pStgMedium );
00176   }
00177
00178   return hResult;
00179 }
00180
00181
00182 //---------------------------------------------------------------------------
00183 //  DRAGDROP:  We now implement this method so that the caller can test
00184 //             to see if a clipformat is supported by GetData
00185 //
00186 HRESULT CDataObject::QueryGetData
00187 (
00188   FORMATETC* pFormatEtc      //[in] FormatEtc struct to test
00189 )
00190 {
00191   HRESULT hResult = DATA_E_FORMATETC;
00192
00193   if( (DVASPECT_CONTENT & pFormatEtc->dwAspect) && (TYMED_HGLOBAL & pFormatEtc->tymed) )
00194   {
00195     if( g_cfNodePropPtr == pFormatEtc->cfFormat )
00196     {
00197       hResult = S_OK;
00198     }
00199     else if( g_cfNodeTypeFlg == pFormatEtc->cfFormat )
00200     {
00201       hResult = S_OK;
00202     }
00203   }
00204
00205   return hResult;
00206 }
00207
00208
00209 //---------------------------------------------------------------------------
00210 //  The console will call this to get the enumeration of custom clipboard
00211 //  formats we support for DragDrop.
00212 //
00213 HRESULT CDataObject::EnumFormatEtc
00214 (
00215   DWORD            dwDirection,      //[in]  Only DATADIR_GET supported
00216   LPENUMFORMATETC* ppEnumFormatEtc   //[out] Points to IEnumFormatEtc
00217 )
00218 {
00219   HRESULT hResult = S_FALSE;
00220
00221   static FORMATETC FormatArray[2];   // Use array so we can add more later
00222
00223   FormatArray[0].cfFormat  = g_cfNodePropPtr;
00224   FormatArray[0].dwAspect  = DVASPECT_CONTENT;
00225   FormatArray[0].ptd       = NULL;
00226   FormatArray[0].tymed     = TYMED_HGLOBAL;
00227   FormatArray[0].lindex    = -1;
00228
00229   FormatArray[1].cfFormat  = g_cfNodeTypeFlg;
00230   FormatArray[1].dwAspect  = DVASPECT_CONTENT;
00231   FormatArray[1].ptd       = NULL;
00232   FormatArray[1].tymed     = TYMED_HGLOBAL;
00233   FormatArray[1].lindex    = -1;
00234
00235
00236   switch( dwDirection )
00237   {
00238     case DATADIR_GET:
00239     {
00240       if( NULL == m_pEnumFormatEtc )
00241         m_pEnumFormatEtc = new CEnumFormatEtc( 2, FormatArray );
00242
00243       *ppEnumFormatEtc = m_pEnumFormatEtc;
00244       (*ppEnumFormatEtc)->AddRef();
00245       hResult = S_OK;
00246       break;
00247     }
00248     case DATADIR_SET:
00249     {
00250       *ppEnumFormatEtc = NULL;
00251       hResult = E_FAIL;
00252       break;
00253     }
00254   }
00255   return hResult;
00256 }
00257
00258
00259 //---------------------------------------------------------------------------
00260 VOID CDataObject::SetPrivateData
00261 (
00262   ULONG  uCookie,      //[in] Pointer to node this object represents
00263   ULONG  uContext      //[in] Context of the node
00264 )
00265 {
00266   m_uCookie  = uCookie;
00267   m_uContext = uContext;
00268
00269   LPBASENODE pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00270   m_uNodeTypeFlg   = pNode->GetNodeType();
00271 }
00272
00273 /////////////////////////////////////////////////////////////////////////////
00274 //  Handlers for MMC's required clipboard formats
00275
00276
00277 //---------------------------------------------------------------------------
00278 // CCF_DISPLAY_NAME is one of the required clipformats.
00279 // MMC askes for this string to display the name of the SnapIn's StaticNode
00280 // in the ScopePane
00281 //
00282 HRESULT CDataObject::RetrieveDisplayString
00283 (
00284   IStream* ipStream        //[in][out] Stream to return our data in.
00285 )
00286 {
00287   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00288   LPWSTR pNodeName = pNode->GetNodeName();
00289
00290   ULONG ulSizeofName = (wcslen(pNodeName) + 1) * sizeof(WCHAR);
00291   return ipStream->Write(pNodeName, ulSizeofName, NULL);
00292
00293 }
00294
00295 //---------------------------------------------------------------------------
00296 //  CCF_SNAPIN_CLASSID is one of the required clipformats.
00297 //  MMC will ask for this data.  This ClassID which we return represents
00298 //  the COM object which is the entry point for our SnapIn
00299 //
00300 HRESULT CDataObject::RetrieveSnapInClassID
00301 (
00302   IStream* ipStream        //[in][out] Stream to return our data in.
00303 )
00304 {
00305   return ipStream->Write( &CLSID_CComponentData, sizeof(GUID), NULL );
00306 }
00307
00308
00309 //---------------------------------------------------------------------------
00310 //  CCF_NODETYPE is one of the required clipformats.
00311 //  MMC needs the NodeType GUID to determine what extensions to activate
00312 //  for a node.  It looks under the MMC/NodeTypes registry key for the GUID
00313 //  and enumerates the extensions found beneath it.  MMC uses this GUID
00314 //  strictly as a uniquie identifier.  It does not expect it to correspond
00315 //  to the ClaseID of a com object.
00316 //
00317 HRESULT CDataObject::RetrieveNodeTypeGuid
00318 (
00319   IStream* ipStream        //[in][out] Stream to return our data in.
00320 )
00321 {
00322   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00323   GUID* pGuid = (GUID*)&pNode->GetNodeGUID();
00324
00325   return ipStream->Write( (void*)pGuid, sizeof(GUID), NULL );
00326 }
00327
00328
00329 //---------------------------------------------------------------------------
00330 //  CCF_SZNODETYPE is a required clipboard format.
00331 //  We return the node's GUID as a wide string.
00332 //
00333 HRESULT CDataObject::RetrieveGuidString
00334 (
00335   IStream* ipStream        //[in][out] Stream to return our data in.
00336 )
00337 {
00338   LPOLESTR pszGUID;
00339   CBaseNode* pNode = reinterpret_cast<CBaseNode*>(m_uCookie);
00340
00341   HRESULT  hResult = StringFromCLSID( pNode->GetNodeGUID(), &pszGUID );
00342   if( S_OK == hResult )
00343   {
00344     hResult = ipStream->Write( pszGUID, (wcslen(pszGUID) + 1) * sizeof(WCHAR), NULL );
00345     CoTaskMemFree( pszGUID );
00346   }
00347
00348   return hResult;
00349 }
00350
00351 /////////////////////////////////////////////////////////////////////////////
00352 //  Handlers for the Snap-in's custom clipboard formats
00353
00354
00355 //---------------------------------------------------------------------------
00356 //  DRAGDROP: Memory for the NodeProps struct is globally allocated by the
00357 //            node and free'd by the target node.  We just pass it on.
00358 //
00359 HRESULT CDataObject::RetrieveNodePropPtr
00360 (
00361   STGMEDIUM*  pStgMedium     //[out] Struct to store the data in
00362 )
00363 {
00364   _ASSERT( NULL != pStgMedium );
00365   HRESULT hResult = S_OK;
00366
00367   LPBASENODE  pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00368   LPNODEPROPS pNodeProps = NULL;
00369   pNode->GetProperties( &pNodeProps );
00370   if( NULL == pNodeProps )
00371   {
00372     hResult = E_OUTOFMEMORY;
00373   }
00374   else
00375   {
00376     pStgMedium->hGlobal = (HGLOBAL)pNodeProps;     //
00377     pStgMedium->tymed   = TYMED_HGLOBAL;
00378     pStgMedium->pUnkForRelease = NULL;
00379   }
00380
00381   return hResult;
00382 }
00383
00384
00385 //---------------------------------------------------------------------------
00386 //  DRAGDROP:  Since this project supports interprocess Copy/Cut/Paste,
00387 //             we need a custom clipboard format which will return the
00388 //             node type without using pointers
00389 //
00390 HRESULT CDataObject::RetrieveNodeTypeFlg
00391 (
00392   STGMEDIUM*  pStgMedium     //[out] Struct to store the data in
00393 )
00394 {
00395   _ASSERT( NULL != pStgMedium );
00396   HRESULT hResult = S_OK;
00397
00398   ULONG* pNodeTypeFlg = (ULONG*)::GlobalAlloc( GMEM_SHARE | GMEM_MOVEABLE, sizeof(ULONG) );
00399   if( NULL == pNodeTypeFlg )
00400   {
00401     hResult = E_OUTOFMEMORY;
00402   }
00403   else
00404   {
00405     pNodeTypeFlg  = (ULONG*)::GlobalLock( pNodeTypeFlg );
00406     *pNodeTypeFlg = m_uNodeTypeFlg;
00407     ::GlobalUnlock( pNodeTypeFlg );
00408
00409     pStgMedium->hGlobal = pNodeTypeFlg;
00410     pStgMedium->tymed   = TYMED_HGLOBAL;
00411     pStgMedium->pUnkForRelease = NULL;
00412   }
00413
00414   return hResult;
00415 }
00416
00417 //---------------------------------------------------------------------------
00418 HRESULT CDataObject::RetrieveBaseNodePtr
00419 (
00420   IStream* ipStream        //[in][out] Stream to return our data in.
00421 )
00422 {
00423   LPBASENODE pNode = reinterpret_cast<LPBASENODE>(m_uCookie);
00424   return ipStream->Write( &pNode, sizeof(LPBASENODE), NULL );
00425 }
00426
00427 //---------------------------------------------------------------------------
00428 HRESULT CDataObject::RetrieveDataObjPtr
00429 (
00430   IStream* ipStream        //[in][out] Stream to return our data in.
00431 )
00432 {
00433   CDataObject* pThis = this;
00434   return ipStream->Write( &pThis, sizeof(CDataObject*), NULL );
00435 }
00436
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/SampSSP/SampSSP.H Source File

  • Security
  • Authentication
  • SampSSP

SampSSP.H

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1992 - 2000.  Microsoft Corporation.  All rights reserved.
00008 ----------------------------------------------------------------------------*/
00009
00010 #ifndef WIN32_LEAN_AND_MEAN
00011 #define WIN32_LEAN_AND_MEAN
00012 #endif // WIN32_LEAN_AND_MEAN
00013 #include <windows.h>
00014 #ifndef SECURITY_WIN32
00015 #define SECURITY_WIN32
00016 #endif // SECURITY_WIN32
00017 #include <sspi.h>
00018 #include <stdio.h>
00019 #include <stdlib.h>
00020 #include <assert.h>
00021
00022 extern CRITICAL_SECTION DllCritSect;
00023
00024 typedef struct _SEC_CONTEXT {
00025     struct _SEC_CONTEXT * Next;
00026     ULONG ContextId;
00027     ULONG CredentialId;
00028     ULONG Nonce;
00029     ULONG ContextFlags;
00030     enum {
00031         Idle,
00032         FirstInit,
00033         FirstAccept,
00034         SecondInit,
00035         SecondAccept
00036     } State;
00037 } SEC_CONTEXT, *PSEC_CONTEXT;
00038
00039 typedef struct _CREDENTIAL {
00040     struct _CREDENTIAL *Next;
00041     ULONG CredentialId;
00042     ULONG Use;
00043     ULONG * AuthData;
00044 } CREDENTIAL, *PCREDENTIAL;
00045
00046 typedef enum {
00047     Negotiate,
00048     Challenge,
00049     ChallengeResponse,
00050     ReAuthenticate
00051 } MESSAGE_TYPE;
00052
00053 #define MESSAGE_SIZE 10
00054
00055 typedef struct _MESSAGE {
00056     MESSAGE_TYPE MessageType;
00057     UCHAR Buffer[MESSAGE_SIZE];
00058 } MESSAGE, *PMESSAGE;
00059
00060 typedef struct _SIGNATURE {
00061     ULONG MessageId;
00062     ULONG Tag;
00063 } SIGNATURE, *PSIGNATURE;
00064
00065
00066
00067 #define PACKAGE_NAME            L"SAMPSSP"
00068 #define PACKAGE_COMMENT         L"Sample package for testing Security Providers"
00069 #define PACKAGE_CAPABILITIES    (SECPKG_FLAG_TOKEN_ONLY | \
00070                                  SECPKG_FLAG_MULTI_REQUIRED | \
00071                                  SECPKG_FLAG_CONNECTION | \
00072                                  SECPKG_FLAG_INTEGRITY | \
00073                                  SECPKG_FLAG_PRIVACY)
00074 #define PACKAGE_VERSION         1
00075 //
00076 // This is the number we enter in
00077 // Registry\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\SecurityService
00078 // for example: 123 = REG_SZ "sampssp.dll"
00079 //
00080 #define PACKAGE_RPCID           123
00081 #define PACKAGE_MAXTOKEN        sizeof(MESSAGE)
00082 #define PACKAGE_SIGNATURE_SIZE  sizeof(SIGNATURE)
00083 #define PACKAGE_SIGNATURE_TAG   0xbaadf00d
00084
00085
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::BookmarkEnum Member List

This is the complete list of members for msado15::BookmarkEnum, including all inherited members.
adBookmarkCurrent | msado15::BookmarkEnum | [static]
adBookmarkFirst | msado15::BookmarkEnum | [static]
adBookmarkLast | msado15::BookmarkEnum | [static]
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpy/StdAfx.Cpp Source File

  • Com
  • Administration
  • Spy
  • ComSpy

StdAfx.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "stdafx.h"
00018
00019 #ifdef _ATL_STATIC_REGISTRY
00020 #include <statreg.h>
00021 #include <statreg.cpp>
00022 #endif
00023
00024 #include <atlimpl.cpp>
00025 #include <atlctl.cpp>
00026 #include <atlwin.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/DataCallback.cpp Source File

  • Multimedia
  • wia
  • GetImage

DataCallback.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #include "stdafx.h"
00008 #include "resource.h"
00009
00010 #include "BitmapUtil.h"
00011 #include "DataCallback.h"
00012
00013 namespace WiaWrap
00014 {
00015
00016 //////////////////////////////////////////////////////////////////////////
00017 //
00018 // CDataCallback::CDataCallback
00019 //
00020
00021 CDataCallback::CDataCallback(
00022     PFNPROGRESSCALLBACK  pfnProgressCallback,
00023     PVOID                pProgressCallbackParam,
00024     LONG                *plCount,
00025     IStream             ***pppStream
00026 )
00027 {
00028     m_cRef = 0;
00029
00030     m_bBMP        = FALSE;
00031     m_nHeaderSize = 0;
00032     m_nDataSize   = 0;
00033
00034     m_pfnProgressCallback    = pfnProgressCallback;
00035     m_pProgressCallbackParam = pProgressCallbackParam;
00036
00037     m_plCount   = plCount;
00038     m_pppStream = pppStream;
00039 }
00040
00041 //////////////////////////////////////////////////////////////////////////
00042 //
00043 // CDataCallback::QueryInterface
00044 //
00045
00046 STDMETHODIMP CDataCallback::QueryInterface(REFIID iid, LPVOID *ppvObj)
00047 {
00048     if (ppvObj == NULL)
00049     {
00050         return E_POINTER;
00051     }
00052
00053     if (iid == IID_IUnknown)
00054     {
00055         *ppvObj = (IUnknown*) this;
00056     }
00057     else if (iid == IID_IWiaDataCallback)
00058     {
00059         *ppvObj = (IWiaDataCallback *) this;
00060     }
00061     else
00062     {
00063         *ppvObj = NULL;
00064         return E_NOINTERFACE;
00065     }
00066
00067     AddRef();
00068     return S_OK;
00069 }
00070
00071 //////////////////////////////////////////////////////////////////////////
00072 //
00073 // CDataCallback::AddRef
00074 //
00075
00076 STDMETHODIMP_(ULONG) CDataCallback::AddRef()
00077 {
00078     return InterlockedIncrement(&m_cRef);
00079 }
00080
00081 //////////////////////////////////////////////////////////////////////////
00082 //
00083 // CDataCallback::Release
00084 //
00085
00086 STDMETHODIMP_(ULONG) CDataCallback::Release()
00087 {
00088     LONG cRef = InterlockedDecrement(&m_cRef);
00089
00090     if (cRef == 0)
00091     {
00092         delete this;
00093     }
00094
00095     return cRef;
00096 }
00097
00098 //////////////////////////////////////////////////////////////////////////
00099 //
00100 // CDataCallback::BandedDataCallback
00101 //
00102
00103 STDMETHODIMP CDataCallback::BandedDataCallback(
00104     LONG   lReason,
00105     LONG   lStatus,
00106     LONG   lPercentComplete,
00107     LONG   lOffset,
00108     LONG   lLength,
00109     LONG   lReserved,
00110     LONG   lResLength,
00111     PBYTE  pbBuffer
00112 )
00113 {
00114     HRESULT hr;
00115
00116     // Parse the message
00117
00118     switch (lReason)
00119     {
00120         case IT_MSG_DATA_HEADER:
00121         {
00122             PWIA_DATA_CALLBACK_HEADER pHeader = (PWIA_DATA_CALLBACK_HEADER) pbBuffer;
00123
00124             // Determine if this is a BMP transfer
00125
00126       m_bBMP = pHeader->guidFormatID == WiaImgFmt_MEMORYBMP || pHeader->guidFormatID == WiaImgFmt_BMP;
00127
00128             // For WiaImgFmt_MEMORYBMP transfers, WIA does not send a BITMAPFILEHEADER before the data.
00129             // In this program, we desire all BMP files to contain a BITMAPFILEHEADER, so add it manually
00130
00131             m_nHeaderSize = pHeader->guidFormatID == WiaImgFmt_MEMORYBMP ? sizeof(BITMAPFILEHEADER) : 0;
00132
00133             // Allocate memory for the image if the size is given in the header
00134
00135             if (pHeader != NULL && pHeader->lBufferSize != 0)
00136             {
00137                 hr = ReAllocBuffer(m_nHeaderSize + pHeader->lBufferSize);
00138
00139                 if (FAILED(hr))
00140                 {
00141                     return hr;
00142                 }
00143             }
00144
00145             break;
00146         }
00147
00148         case IT_MSG_DATA:
00149         {
00150             // Invoke the callback function
00151
00152             hr = m_pfnProgressCallback(lStatus, lPercentComplete, m_pProgressCallbackParam);
00153
00154             if (FAILED(hr) || hr == S_FALSE)
00155             {
00156                 return hr;
00157             }
00158
00159             // If the buffer is not allocated yet and this is the first block,
00160             // and the transferred image is in BMP format, allocate the buffer
00161             // according to the size information in the bitmap header
00162
00163             if (m_pStream == NULL && lOffset == 0 && m_bBMP)
00164             {
00165                 LONG nBufferSize = BitmapUtil::GetBitmapSize(pbBuffer);
00166
00167                 if (nBufferSize != 0)
00168                 {
00169                     hr = ReAllocBuffer(m_nHeaderSize + nBufferSize);
00170
00171                     if (FAILED(hr))
00172                     {
00173                         return hr;
00174                     }
00175                 }
00176             }
00177
00178             // If the transfer goes past the buffer, try to expand it
00179
00180             if (m_nHeaderSize + lOffset + lLength > m_nDataSize)
00181             {
00182                 hr = ReAllocBuffer(m_nHeaderSize + lOffset + lLength);
00183
00184                 if (FAILED(hr))
00185                 {
00186                     return hr;
00187                 }
00188             }
00189
00190             // copy the transfer buffer
00191
00192             hr = CopyToBuffer(m_nHeaderSize + lOffset, pbBuffer, lLength);
00193
00194             if (FAILED(hr))
00195             {
00196                 return hr;
00197             }
00198
00199             break;
00200         }
00201
00202         case IT_MSG_STATUS:
00203         {
00204             // Invoke the callback function
00205
00206             hr = m_pfnProgressCallback(lStatus, lPercentComplete, m_pProgressCallbackParam);
00207
00208             if (FAILED(hr) || hr == S_FALSE)
00209             {
00210                 return hr;
00211             }
00212
00213             break;
00214         }
00215
00216         case IT_MSG_TERMINATION:
00217         case IT_MSG_NEW_PAGE:
00218         {
00219             if (m_pStream != NULL)
00220             {
00221                 // For BMP files, we should validate the the image header
00222                 // So, obtain the memory buffer from the stream
00223
00224                 if (m_bBMP)
00225                 {
00226                     // Since the stream is created using CreateStreamOnHGlobal,
00227                     // we can get the memory buffer with GetHGlobalFromStream.
00228
00229                     HGLOBAL hBuffer;
00230
00231                     hr = GetHGlobalFromStream(m_pStream, &hBuffer);
00232
00233                     if (FAILED(hr))
00234                     {
00235                         return hr;
00236                     }
00237
00238                     PBITMAPFILEHEADER pBuffer = (PBITMAPFILEHEADER) GlobalLock(hBuffer);
00239
00240                     if (pBuffer == NULL)
00241                     {
00242                         return HRESULT_FROM_WIN32(GetLastError());
00243                     }
00244
00245                     // Some scroll-fed scanners may return 0 as the bitmap height
00246                     // In this case, calculate the image height and modify the header
00247
00248                     BitmapUtil::FixBitmapHeight(pBuffer + 1, m_nDataSize, TRUE);
00249
00250                     // For WiaImgFmt_MEMORYBMP transfers, the WIA service does not
00251                     // include a BITMAPFILEHEADER preceeding the bitmap data.
00252                     // In this case, fill in the BITMAPFILEHEADER structure.
00253
00254                     if (m_nHeaderSize != 0)
00255                     {
00256                         BitmapUtil::FillBitmapFileHeader(pBuffer + 1, pBuffer);
00257                     }
00258
00259                     GlobalUnlock(hBuffer);
00260                 }
00261
00262                 // Store this buffer in the successfully transferred images array
00263
00264         hr = StoreBuffer();
00265
00266                 if (FAILED(hr))
00267                 {
00268                     return hr;
00269                 }
00270             }
00271
00272             break;
00273         }
00274     }
00275
00276     return S_OK;
00277 }
00278
00279 //////////////////////////////////////////////////////////////////////////
00280 //
00281 // CDataCallback::ReAllocBuffer
00282 //
00283
00284 HRESULT CDataCallback::ReAllocBuffer(ULONG nSize)
00285 {
00286     HRESULT hr;
00287
00288     // If m_pStream is not initialized yet, create a new stream object
00289
00290     if (m_pStream == 0)
00291     {
00292         hr = CreateStreamOnHGlobal(0, TRUE, &m_pStream);
00293
00294         if (FAILED(hr))
00295         {
00296             return hr;
00297         }
00298     }
00299
00300     // Next, set the size of the stream object
00301
00302     ULARGE_INTEGER liSize = { nSize };
00303
00304     hr = m_pStream->SetSize(liSize);
00305
00306     if (FAILED(hr))
00307     {
00308         return hr;
00309     }
00310
00311     m_nDataSize = nSize;
00312
00313     return S_OK;
00314 }
00315
00316 //////////////////////////////////////////////////////////////////////////
00317 //
00318 // CDataCallback::CopyToBuffer
00319 //
00320
00321 HRESULT CDataCallback::CopyToBuffer(ULONG nOffset, LPCVOID pBuffer, ULONG nSize)
00322 {
00323     HRESULT hr;
00324
00325     // First move the stream pointer to the data offset
00326
00327     LARGE_INTEGER liOffset = { nOffset };
00328
00329     hr = m_pStream->Seek(liOffset, STREAM_SEEK_SET, 0);
00330
00331     if (FAILED(hr))
00332     {
00333         return hr;
00334     }
00335
00336     // Next, write the new data to the stream
00337
00338     hr = m_pStream->Write(pBuffer, nSize, 0);
00339
00340     if (FAILED(hr))
00341     {
00342         return hr;
00343     }
00344
00345     return S_OK;
00346 }
00347
00348
00349 //////////////////////////////////////////////////////////////////////////
00350 //
00351 // CDataCallback::StoreBuffer
00352 //
00353
00354 HRESULT CDataCallback::StoreBuffer()
00355 {
00356     // Increase the successfully transferred buffers array size
00357
00358     IStream **ppStream = (IStream **) CoTaskMemRealloc(
00359     *m_pppStream,
00360     (*m_plCount + 1) * sizeof(IStream *)
00361   );
00362
00363     if (ppStream == NULL)
00364     {
00365         return E_OUTOFMEMORY;
00366     }
00367
00368     *m_pppStream = ppStream;
00369
00370     // Rewind the current buffer
00371
00372     LARGE_INTEGER liZero = { 0 };
00373
00374     m_pStream->Seek(liZero, STREAM_SEEK_SET, 0);
00375
00376     // Store the current buffer as the last successfully transferred buffer
00377
00378   (*m_pppStream)[*m_plCount] = m_pStream;
00379     (*m_pppStream)[*m_plCount]->AddRef();
00380
00381     *m_plCount += 1;
00382
00383     // Reset the current buffer
00384
00385     m_pStream.Release();
00386
00387     m_nDataSize = 0;
00388
00389     return S_OK;
00390 }
00391
00392 }; // namespace WiaWrap
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/CRQDlg.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

CRQDlg.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // CrQDlg.cpp : implementation file
00013 //
00014
00015
00016
00017 #include "stdafx.h"
00018 #include "MQApitst.h"
00019 #include "CrQDlg.h"
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CCreateQueueDialog dialog box
00029
00030
00031 CCreateQueueDialog::CCreateQueueDialog(CWnd* pParent /*=NULL*/)
00032    : CDialog(CCreateQueueDialog::IDD, pParent)
00033 {
00034
00035   TCHAR szTmpBuffer[MAX_COMPUTERNAME_LENGTH + 2] ={0};
00036   DWORD dwTmpBufferSize = MAX_COMPUTERNAME_LENGTH+1;
00037   if (!GetComputerName(szTmpBuffer, &dwTmpBufferSize))
00038   {
00039
00040     AfxMessageBox(_T("The computer name is too long for the buffer specified.\n"));
00041     exit(1);
00042
00043   }
00044   //
00045   // The following line is OK, but any further concatenations will need a bigger array to be safe.
00046   //
00047   _tcsncat(szTmpBuffer, TEXT("\\"), 1);
00048
00049
00050    //{{AFX_DATA_INIT(CCreateQueueDialog)
00051    m_strLabel = TEXT("MQ API test");
00052    m_strPathName = szTmpBuffer;
00053    //}}AFX_DATA_INIT
00054 }
00055
00056
00057 void CCreateQueueDialog::DoDataExchange(CDataExchange* pDX)
00058 {
00059    CDialog::DoDataExchange(pDX);
00060    //{{AFX_DATA_MAP(CCreateQueueDialog)
00061    DDX_Text(pDX, IDC_QUEUE_LABEL, m_strLabel);
00062    DDV_MaxChars(pDX, m_strLabel, 128);
00063    DDX_Text(pDX, IDC_QUEUE_PATHNAME, m_strPathName);
00064    DDV_MaxChars(pDX, m_strPathName, 128);
00065    //}}AFX_DATA_MAP
00066 }
00067
00068
00069 BEGIN_MESSAGE_MAP(CCreateQueueDialog, CDialog)
00070    //{{AFX_MSG_MAP(CCreateQueueDialog)
00071    //}}AFX_MSG_MAP
00072 END_MESSAGE_MAP()
00073
00074 /////////////////////////////////////////////////////////////////////////////
00075 // CCreateQueueDialog message handlers
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/dataobj.h Source File

  • SysMgmt
  • MMC
  • Simple

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097 BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
00098
00099 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/PrintSdiVw.Cpp Source File

  • NetDS
  • fax
  • PrintSdi

PrintSdiVw.Cpp

Go to the documentation of this file.
00001 // PrintSDIView.cpp : implementation of the CPrintSDIView class
00002 //
00003
00004 #include "stdafx.h"
00005 #include "PrintSDI.h"
00006
00007 #include "PrintSDIDoc.h"
00008 #include "PrintSDIView.h"
00009 #include "faxdlg.h"
00010 #include <winfax.h>
00011
00012 #ifdef _DEBUG
00013 #define new DEBUG_NEW
00014 #undef THIS_FILE
00015 static char THIS_FILE[] = __FILE__;
00016 #endif
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CPrintSDIView
00020
00021 IMPLEMENT_DYNCREATE(CPrintSDIView, CView)
00022
00023 BEGIN_MESSAGE_MAP(CPrintSDIView, CView)
00024   //{{AFX_MSG_MAP(CPrintSDIView)
00025   ON_COMMAND(ID_FILE_FAX, OnFileFax)
00026   //}}AFX_MSG_MAP
00027   // Standard printing commands
00028   ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
00029   ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
00030   ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
00031 END_MESSAGE_MAP()
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // CPrintSDIView construction/destruction
00035
00036 CPrintSDIView::CPrintSDIView()
00037 {
00038   // TODO: add construction code here
00039
00040 }
00041
00042 CPrintSDIView::~CPrintSDIView()
00043 {
00044 }
00045
00046 BOOL CPrintSDIView::PreCreateWindow(CREATESTRUCT& cs)
00047 {
00048   // TODO: Modify the Window class or styles here by modifying
00049   //  the CREATESTRUCT cs
00050
00051   return CView::PreCreateWindow(cs);
00052 }
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // CPrintSDIView drawing
00056
00057 void CPrintSDIView::OnDraw(CDC* pDC)
00058 {
00059   CPrintSDIDoc* pDoc = GetDocument();
00060   ASSERT_VALID(pDoc);
00061
00062   CRect rect;
00063   GetClientRect(rect);
00064
00065   pDC->SetTextAlign(TA_BASELINE | TA_CENTER);
00066   pDC->SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));
00067   pDC->SetBkMode(TRANSPARENT);
00068   pDC->TextOut(rect.right/2, 3*rect.bottom/4,pDoc->m_szText);
00069
00070   CRect rect2( (rect.right-rect.left)/4 ,
00071          (rect.top),
00072          3*(rect.right-rect.left)/4,
00073          (rect.bottom)/2);
00074
00075   POINT pnt = {rect2.right/2,rect2.top};
00076   switch (pDoc->m_polytype) {
00077   case 0:
00078     //circle
00079     pDC->Arc(rect2,pnt,pnt);
00080     break;
00081   case 1:
00082     //sqare
00083     pDC->MoveTo(rect2.left,rect2.top);
00084     pDC->LineTo(rect2.right,rect2.top);
00085     pDC->LineTo(rect2.right,rect2.bottom);
00086     pDC->LineTo(rect2.left,rect2.bottom);
00087     pDC->LineTo(rect2.left,rect2.top);
00088     break;
00089   case 2:
00090     //triangle
00091     pDC->MoveTo(rect.right/2,rect2.top);
00092     pDC->LineTo(rect2.left,rect2.bottom);
00093     pDC->LineTo(rect2.right,rect2.bottom);
00094     pDC->LineTo(rect.right/2,rect2.top);
00095     break;
00096   default:
00097     pDC->Arc(rect2,pnt,pnt);
00098   }
00099
00100   CString dbg;
00101   dbg.Format(TEXT("%d %d %d %d\n"),rect2.left, rect2.top, rect2.right, rect2.bottom);
00102   OutputDebugString(dbg);
00103 }
00104
00105 /////////////////////////////////////////////////////////////////////////////
00106 // CPrintSDIView printing
00107
00108 BOOL CPrintSDIView::OnPreparePrinting(CPrintInfo* pInfo)
00109 {
00110   // default preparation
00111   return DoPreparePrinting(pInfo);
00112 }
00113
00114 void CPrintSDIView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
00115 {
00116   // TODO: add extra initialization before printing
00117 }
00118
00119 void CPrintSDIView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
00120 {
00121   // TODO: add cleanup after printing
00122 }
00123
00124 /////////////////////////////////////////////////////////////////////////////
00125 // CPrintSDIView diagnostics
00126
00127 #ifdef _DEBUG
00128 void CPrintSDIView::AssertValid() const
00129 {
00130   CView::AssertValid();
00131 }
00132
00133 void CPrintSDIView::Dump(CDumpContext& dc) const
00134 {
00135   CView::Dump(dc);
00136 }
00137
00138 CPrintSDIDoc* CPrintSDIView::GetDocument() // non-debug version is inline
00139 {
00140   ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPrintSDIDoc)));
00141   return (CPrintSDIDoc*)m_pDocument;
00142 }
00143 #endif //_DEBUG
00144
00145 /////////////////////////////////////////////////////////////////////////////
00146 // CPrintSDIView message handlers
00147
00148 void CPrintSDIView::OnFileFax()
00149 {
00150   FaxDlg dlg;
00151   dlg.DoModal();
00152
00153   FAX_CONTEXT_INFO FaxContextInfo;
00154     FAX_PRINT_INFO FaxPrintInfo = {0};
00155   DWORD JobId;
00156
00157   FaxContextInfo.SizeOfStruct = sizeof(FAX_CONTEXT_INFO);
00158
00159   FaxPrintInfo.SizeOfStruct = sizeof(FAX_PRINT_INFO);
00160     FaxPrintInfo.RecipientNumber = dlg.m_FaxNumber.GetBuffer(MAX_PATH);
00161   FaxPrintInfo.RecipientName   = dlg.m_RecipientName.GetBuffer(MAX_PATH);
00162
00163   // use the default FAX printer
00164   if (!FaxStartPrintJob(NULL,&FaxPrintInfo,&JobId,&FaxContextInfo) ) {
00165     CString dbg;
00166     dbg.Format(_T("FaxStartPrintJob failed, ec = %d\n"),GetLastError() );
00167     AfxMessageBox(dbg);
00168     return;
00169   }
00170
00171   // print the document
00172   CDC dc;
00173   dc.Attach(FaxContextInfo.hDC);
00174   OnDraw(&dc);
00175
00176   dc.EndDoc();
00177
00178 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/MidiPlyr.h Source File

  • Multimedia
  • Audio
  • MidiPlyr

MidiPlyr.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 * MIDIPlyr.H
00013 *
00014 * Main include file for the polymessage MIDI playback app.
00015 *
00016 *****************************************************************************/
00017
00018 #ifndef _MIDIPLYR_
00019 #define _MIDIPLYR_
00020
00021 #include "seq.h"
00022
00023 #define MAX_FILEPATH        256
00024
00025 /* Number and size of playback buffers to keep around
00026 */
00027 #define C_MIDI_BUFFERS      4
00028 #define CB_MIDI_BUFFERS     1024
00029
00030
00031 /* Popup menu positions in main menu bar
00032 */
00033 #define POS_FILE            0
00034 #define POS_ACTIONS         1
00035 #define POS_OPTIONS         2
00036 #define POS_PLAYTHRU        3
00037
00038 /* Status bar pane indices
00039 */
00040 #define SB_N_PANES          2
00041 #define SB_PANE_STATE       0
00042 #define SB_PANE_TFMT        1
00043
00044 /* Resource ID's
00045 */
00046 #define ID_ICON             50
00047 #define ID_MENU             51
00048
00049 #define IDM_EXIT            100
00050 #define IDM_ABOUT           101
00051 #define IDM_OPEN            102
00052 #define IDM_PLAY            103
00053 #define IDM_PAUSE           104
00054 #define IDM_STOP            105
00055 #define IDM_TOOLBAR         106
00056 #define IDM_STATUS          107
00057 #define IDM_AUTOPLAY        108
00058
00059 #define IDM_DEVMIN          129
00060 #define IDM_MAPPER          129         /* MUST be IDM_DEVICES - 1 */
00061 #define IDM_DEVICES         130         /* 129 thru 149 */
00062 #define IDM_DEVMAX          149
00063
00064 #define IDM_SYNCUI          150         /* DEBUG */
00065
00066 #define IDB_TOOLBAR         200
00067
00068 #define IDC_TOOLBAR         300
00069 #define IDC_STATBAR         301
00070
00071 #define IDS_APPTITLEMASK    1000
00072 #define IDS_APPNAME         1001
00073 #define IDS_UNTITLED        1002
00074
00075 /* ID's for these must be contiguous !!!
00076 ** Note that we also use these as IDM_ items in the Options menu
00077 */
00078 #define IDS_TF_FIRST        1010
00079 #define IDS_HMS             1010
00080 #define IDS_TICKS           1011
00081 #define IDS_TF_LAST         1011
00082
00083 /* ID's for sequencer state descriptions
00084 ** These must also be contigous and in the same order as the SEQ_S
00085 ** states in seq.h
00086 */
00087 #define IDS_STATES          1020
00088 #define IDS_NOFILE          (IDS_STATES + SEQ_S_NOFILE)
00089 #define IDS_OPENED          (IDS_STATES + SEQ_S_OPENED)
00090 #define IDS_PREROLLING      (IDS_STATES + SEQ_S_PREROLLING)
00091 #define IDS_PREROLLED       (IDS_STATES + SEQ_S_PREROLLED)
00092 #define IDS_PLAYING         (IDS_STATES + SEQ_S_PLAYING)
00093 #define IDS_PAUSED          (IDS_STATES + SEQ_S_PAUSED)
00094 #define IDS_STOPPING        (IDS_STATES + SEQ_S_STOPPING)
00095
00096 #define N_TIME_FORMATS      (IDS_TF_LAST - IDS_TF_FIRST + 1)
00097 #define CB_TIME_FORMATS     40
00098
00099 #define IDS_OPENFAILED      1050
00100 #define IDS_PREROLLFAILED   1051
00101 #define IDS_TESTERR         1052
00102 #define IDS_STOPFAILED    1053
00103
00104 /* Globals
00105 */
00106 extern  HINSTANCE       ghInst;
00107 extern  char BCODE      gszMWndClass[];
00108 extern  char BCODE      gszTWndClass[];
00109 extern  PSEQ            gpSeq;
00110 extern  char            gszUntitled[80];
00111 extern  char            gszAppLongName[80];
00112 extern  char            gszAppTitleMask[80];
00113 extern  char            grgszTimeFormats[N_TIME_FORMATS][CB_TIME_FORMATS];
00114 extern  RECT            grcTWnd;
00115 extern  int             gnTimeFormat;
00116
00117 /* MainWnd.C
00118 */
00119 VOID FNLOCAL InitToolbar(
00120     HWND                    hWnd);
00121
00122 VOID FNLOCAL InitToolbar(
00123     HWND                    hWnd);
00124
00125 LRESULT CALLBACK MWnd_WndProc(
00126     HWND                    hWnd,
00127     UINT                    msg,
00128     WPARAM                  wParam,
00129     LPARAM                  lParam);
00130
00131 /* TimeWnd.C
00132 */
00133 LRESULT CALLBACK TWnd_WndProc(
00134     HWND                    hWnd,
00135     UINT                    msg,
00136     WPARAM                  wParam,
00137     LPARAM                  lParam);
00138
00139 /* UiUtils.C
00140 */
00141 VOID FNLOCAL MessagePump(
00142     VOID);
00143
00144 VOID FNLOCAL Error(
00145      HWND                   hWnd,
00146      int                    nErrDesc,
00147      MMRESULT               mmrc);
00148
00149 VOID FNLOCAL EmbossedTextOut(
00150      HDC                    hDC,
00151      int                    x,
00152      int                    y,
00153      LPSTR                  lpsz,
00154      UINT                   cb,
00155      COLORREF               crText,
00156      COLORREF               crShadow,
00157      int                    cx,
00158      int                    cy);
00159
00160 HFONT FNLOCAL CreateScaledFont(
00161      HDC                    hDC,
00162      LPRECT                 lpRect,
00163      LPSTR                  lpszFormat,
00164      int                    anPosX[],
00165      int* nPosY);
00166
00167 #endif
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/virtualfile.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

virtualfile.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Implements our virtual file class derived from CBaseNode.  This
00014 //             class will represent our result items
00015 //
00016
00017 #include "VirtualFile.h"
00018 #include "FolderNode.h"
00019 #include "Globals.h"
00020 #include "CompData.h"
00021 #include "Comp.h"
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CVirtualFile")
00026
00027
00028 // Initialize our static GUID just once
00029 GUID CVirtualFile::m_thisGUID = CLSID_CVirtualFile;
00030
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // Construction/Destruction
00034
00035 //---------------------------------------------------------------------------
00036 CVirtualFile::CVirtualFile()
00037 {
00038   m_RDI.mask      = DEFAULT_RDI_MASK;
00039   m_RDI.str       = MMC_CALLBACK;
00040   m_RDI.nImage    = IMG_DATA_FILE;
00041   m_RDI.lParam    = reinterpret_cast<LPARAM>(this);
00042
00043   m_dwAttributes  = 0;
00044   m_pParentFolder = NULL;
00045   m_pCompData     = NULL;
00046 }
00047
00048 //---------------------------------------------------------------------------
00049 CVirtualFile::~CVirtualFile()
00050 {
00051 }
00052
00053 //---------------------------------------------------------------------------
00054 HRESULT CVirtualFile::Initialize
00055 (
00056   LPNODEPROPS  pNodeProps    //[in] Properties for this node
00057 )
00058 {
00059   _ASSERT( NULL != pNodeProps );
00060
00061   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00062   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00063   wcscpy( pszTmp, pNodeProps->szNodeName );
00064   if( NULL != m_pwszNodeName )
00065     CoTaskMemFree( m_pwszNodeName );
00066
00067   m_pwszNodeName  = pszTmp;
00068   m_pParentFolder = reinterpret_cast<CFolderNode*>(pNodeProps->pParentObject);
00069   m_pCompData     = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00070   m_dwAttributes  = pNodeProps->dwAttributes;
00071
00072   return S_OK;
00073 }
00074
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // Implementation of virtual methods
00078
00079
00080 //---------------------------------------------------------------------------
00081 HRESULT CVirtualFile::GetDisplayInfo
00082 (
00083   RESULTDATAITEM* pRDI       //[in-out] RESULTDATAITEM struct
00084 )
00085 {
00086   HRESULT hResult = S_OK;
00087
00088   if( pRDI->mask & RDI_STR )         // Console is requesting strings...
00089   {                                  // for each column
00090     switch( pRDI->nCol )
00091     {
00092       case 0:
00093         pRDI->str = m_pwszNodeName;
00094         break;
00095
00096       case 1:                        // Display attributes as a string
00097         pRDI->str = GetAttributeString();
00098         break;
00099
00100       default:
00101         hResult = S_FALSE;
00102         TRACE_VAL(_T("GetDisplayInfo"), _T("Column"), pRDI->nCol );
00103         break;
00104     }
00105   }
00106
00107   if( pRDI->mask & RDI_IMAGE )       // Looking for an image?
00108   {
00109     pRDI->nImage = m_RDI.nImage;
00110   }
00111
00112   //TRACE_HRESULT(_T("GetDisplayInfo"), hResult );
00113   return hResult;
00114 }
00115
00116
00117 /////////////////////////////////////////////////////////////////////////////
00118 // Implementation of virtual methods
00119
00120
00121 //---------------------------------------------------------------------------
00122 HRESULT CVirtualFile::OnSelect
00123 (
00124   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00125   LPARAM        nArg,          //[in] Bools for context & selection state
00126   LPARAM        nParam,        //[in] Not used
00127   LONG_PTR      pComponent     //[in] Points calling CComponent
00128 )
00129 {
00130   HRESULT hResult = S_FALSE;
00131
00132   m_pComponent = reinterpret_cast<CComponent*>(pComponent);
00133
00134   IConsoleVerb* ipConsoleVerb = NULL;
00135   hResult = m_pComponent->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00136   if( S_OK == hResult )
00137   {
00138     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_RENAME, ENABLED, TRUE );
00139     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_DELETE, ENABLED, TRUE );
00140   }
00141   TRACE_HRESULT(_T("OnSelect"), hResult );
00142   return hResult;
00143 }
00144
00145
00146 //---------------------------------------------------------------------------
00147 HRESULT CVirtualFile::OnShow
00148 (
00149   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00150   LPARAM        nArg,          //[in] TRUE if node was selcted
00151   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00152   LONG_PTR      pComponent     //[in] Points calling CComponent
00153 )
00154 {
00155   HRESULT  hResult = S_FALSE;
00156   //TRACE_HRESULT(_T("OnShow"), hResult );
00157   return hResult;
00158 }
00159
00160
00161 //---------------------------------------------------------------------------
00162 //  This message must return S_OK to allow the rename.  Anything else will
00163 //  disallow the rename
00164 //
00165 HRESULT CVirtualFile::OnRename
00166 (
00167   LPDATAOBJECT ipDataObject,   //[in] Points to Data Object
00168   LPARAM       nArg,           //[in] Not used
00169   LPARAM       nParam,         //[in] Pointer to the new name
00170   LONG_PTR     pComponent      //[in] Points to calling IComponent
00171 )
00172 {
00173   _ASSERT( NULL != ipDataObject );
00174   HRESULT hResult = S_OK;
00175
00176   LPWSTR pszTmpName = NULL;
00177   LPWSTR pszNewName = (LPWSTR)nParam;  // New name
00178   LONG   nLen = wcslen( pszNewName ) + 1;
00179
00180   pszTmpName = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00181   if( NULL == pszTmpName )
00182   {
00183     hResult = S_FALSE;                 // Can't change the name
00184   }
00185   else
00186   {
00187     wcscpy( pszTmpName, pszNewName );
00188     CoTaskMemFree( m_pwszNodeName );   // Free existing name...
00189     m_pwszNodeName = pszTmpName;       // Assign new name to pointer
00190   }
00191
00192   return hResult;
00193 }
00194
00195 /////////////////////////////////////////////////////////////////////////////
00196 // IExtendToolbar
00197
00198 //---------------------------------------------------------------------------
00199 HRESULT CVirtualFile::ControlbarNotify
00200 (
00201   LPARAM   nArg,         //[in] Selection status
00202   LPARAM   lParam,       //[in] Not used
00203   LONG_PTR pComp         //[in] Points to CComponent
00204 )
00205 {
00206   HRESULT hResult = S_FALSE;
00207   BOOL bScope  = (BOOL)LOWORD(nArg);
00208   BOOL bSelect = (BOOL)HIWORD(nArg);
00209
00210   CComponent* pComponent = reinterpret_cast<CComponent*>(pComp);
00211
00212   IControlbar* ipControlbar = NULL;
00213   hResult = pComponent->GetInterface( REQUEST_ICONTROLBAR, (LONG_PTR*)&ipControlbar );
00214   if( S_OK != hResult )
00215     return hResult;
00216
00217   IToolbar* ipToolbar = NULL;
00218   hResult = pComponent->GetInterface( REQUEST_IVFILETOOLBAR, (LONG_PTR*)&ipToolbar );
00219   if( S_OK != hResult )
00220     return hResult;
00221
00222   if( TRUE == bSelect )
00223   {
00224     hResult = ipControlbar->Attach(TOOLBAR, (LPUNKNOWN)ipToolbar);
00225     hResult = ipToolbar->SetButtonState( IDM_CLEAR_ATTRIBS, ENABLED, TRUE );
00226   }
00227   else
00228   {
00229     hResult = ipControlbar->Detach( (LPUNKNOWN)ipToolbar );
00230   }
00231
00232   return hResult;
00233
00234 }
00235
00236 /////////////////////////////////////////////////////////////////////////////
00237 //  CVirtualFile methods
00238
00239 //---------------------------------------------------------------------------
00240 BOOL CVirtualFile::IsAttributeSet
00241 (
00242   DWORD dwAttribute           //[in] Attribute to set
00243 )
00244 {
00245   return (m_dwAttributes & dwAttribute) ? TRUE : FALSE;
00246 }
00247
00248 //---------------------------------------------------------------------------
00249 VOID CVirtualFile::SetAttribute
00250 (
00251   DWORD dwAttribute           //[in] Attribute to set
00252 )
00253 {
00254   m_dwAttributes |= dwAttribute;
00255 }
00256
00257 //---------------------------------------------------------------------------
00258 VOID CVirtualFile::RemoveAttribute
00259 (
00260   DWORD dwAttribute           //[in] Attribute to remove
00261 )
00262 {
00263   m_dwAttributes &= ~dwAttribute;
00264 }
00265
00266 //---------------------------------------------------------------------------
00267 LPWSTR CVirtualFile::GetAttributeString()
00268 {
00269   *m_pAttributeStr = NULL;
00270
00271   if( IsAttributeSet(ATTRIBUTE_DATA_ARCHIVE) )
00272     wcscat( m_pAttributeStr, L"A " );
00273
00274   if( IsAttributeSet(ATTRIBUTE_DATA_HIDDEN) )
00275     wcscat( m_pAttributeStr, L"H " );
00276
00277   if( IsAttributeSet(ATTRIBUTE_DATA_LOCKED) )
00278     wcscat( m_pAttributeStr, L"L " );
00279
00280   if( IsAttributeSet(ATTRIBUTE_DATA_READONLY) )
00281     wcscat( m_pAttributeStr, L"R " );
00282
00283   return m_pAttributeStr;
00284 }
00285
00286
00287 /////////////////////////////////////////////////////////////////////////////
00288 // IExtendContextMenu
00289
00290 //---------------------------------------------------------------------------
00291 HRESULT CVirtualFile::AddMenuItems
00292 (
00293   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00294   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00295 )
00296 {
00297   HRESULT hResult = E_NOTIMPL;
00298   //TRACE_HRESULT(_T("AddMenuItems"), hResult );
00299   return hResult;
00300 }
00301
00302
00303 //---------------------------------------------------------------------------
00304 //  This handles commands for both Context Menu items and Toolbar items
00305 //
00306 HRESULT CVirtualFile::Command
00307 (
00308   long lCommandID          //[in] Indentifier for menu ID
00309 )
00310 {
00311   HRESULT hResult = S_OK;
00312
00313   switch( lCommandID )
00314   {
00315     case IDM_CLEAR_ATTRIBS:
00316     {
00317      m_dwAttributes = 0;
00318      break;
00319     }
00320     default:
00321       hResult = S_FALSE;
00322       break;
00323
00324   }
00325   return hResult;
00326 }
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCmdLineConsumerApp Member List

This is the complete list of members for CCmdLineConsumerApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CCmdLineConsumerApp() | CCmdLineConsumerApp |
CWinApp() | CWinApp |
ExitInstance() | CCmdLineConsumerApp | [virtual]
InitInstance() | CCmdLineConsumerApp | [virtual]
m_clsReg | CCmdLineConsumerApp | [private]
m_factory | CCmdLineConsumerApp | [private]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
RegisterServer(void) | CCmdLineConsumerApp | [private]
Run() | CAppLite | [virtual]
UnregisterServer(void) | CCmdLineConsumerApp | [private]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:55:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMyCapabilities Member List

This is the complete list of members for CMyCapabilities, including all inherited members.
CanNodeBeClustered(void) | CMyCapabilities |
CMyCapabilities(void) | CMyCapabilities | [protected]
HrGetApplicationCompatibilityInfo(BOOL *pfIsAppCompatible) | CMyCapabilities | [protected]
Initialize(IUnknown *punkCallbackIn, LCID lcidIn) | CMyCapabilities |
m_lcid | CMyCapabilities | [private]
m_piccCallback | CMyCapabilities | [private]
~CMyCapabilities(void) | CMyCapabilities | [protected]
Generated on Wed Nov 13 2024 16:56:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ErrorValueEnum Member List

This is the complete list of members for msado15::ErrorValueEnum, including all inherited members.
adErrBoundToCommand | msado15::ErrorValueEnum | [static]
adErrDataConversion | msado15::ErrorValueEnum | [static]
adErrFeatureNotAvailable | msado15::ErrorValueEnum | [static]
adErrIllegalOperation | msado15::ErrorValueEnum | [static]
adErrInTransaction | msado15::ErrorValueEnum | [static]
adErrInvalidArgument | msado15::ErrorValueEnum | [static]
adErrInvalidConnection | msado15::ErrorValueEnum | [static]
adErrInvalidParamInfo | msado15::ErrorValueEnum | [static]
adErrItemNotFound | msado15::ErrorValueEnum | [static]
adErrNoCurrentRecord | msado15::ErrorValueEnum | [static]
adErrNotExecuting | msado15::ErrorValueEnum | [static]
adErrNotReentrant | msado15::ErrorValueEnum | [static]
adErrObjectClosed | msado15::ErrorValueEnum | [static]
adErrObjectInCollection | msado15::ErrorValueEnum | [static]
adErrObjectNotSet | msado15::ErrorValueEnum | [static]
adErrObjectOpen | msado15::ErrorValueEnum | [static]
adErrOpeningFile | msado15::ErrorValueEnum | [static]
adErrOperationCancelled | msado15::ErrorValueEnum | [static]
adErrProviderNotFound | msado15::ErrorValueEnum | [static]
adErrReadFile | msado15::ErrorValueEnum | [static]
adErrStillConnecting | msado15::ErrorValueEnum | [static]
adErrStillExecuting | msado15::ErrorValueEnum | [static]
adErrUnsafeOperation | msado15::ErrorValueEnum | [static]
adErrWriteFile | msado15::ErrorValueEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Fields20 Member List

This is the complete list of members for msado15::Fields20, including all inherited members.
_Append(String Name, int Type, int DefinedSize, int Attrib) | msado15::Fields20 |
_NewEnum() | msado15::Fields20 |
Delete(Variant Index) | msado15::Fields20 |
getCount() | msado15::Fields20 |
getItem(Variant Index) | msado15::Fields20 |
iid | msado15::Fields20 | [static]
Refresh() | msado15::Fields20 |
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfapp/dataobj.cpp Source File

  • WinUI
  • tsfapp

dataobj.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DataObj.cpp
00013
00014    Description:   CTSFDataObject implementation.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "DataObj.h"
00023
00024 /**************************************************************************
00025    global variables
00026 **************************************************************************/
00027
00028 /**************************************************************************
00029
00030    CTSFDataObject::CTSFDataObject()
00031
00032 **************************************************************************/
00033
00034 CTSFDataObject::CTSFDataObject()
00035 {
00036     m_ObjRefCount = 1;
00037
00038     m_FormatEtc.cfFormat = CF_UNICODETEXT;
00039     m_FormatEtc.dwAspect = DVASPECT_CONTENT;
00040     m_FormatEtc.ptd = NULL;
00041     m_FormatEtc.tymed = TYMED_HGLOBAL;
00042     m_FormatEtc.lindex = -1;
00043
00044     m_pwszText = NULL;
00045 }
00046
00047 /**************************************************************************
00048
00049    CTSFDataObject::~CTSFDataObject()
00050
00051 **************************************************************************/
00052
00053 CTSFDataObject::~CTSFDataObject()
00054 {
00055     _SetText(NULL);
00056 }
00057
00058 ///////////////////////////////////////////////////////////////////////////
00059 //
00060 // IUnknown Implementation
00061 //
00062
00063 /**************************************************************************
00064
00065    CTSFDataObject::QueryInterface
00066
00067 **************************************************************************/
00068
00069 STDMETHODIMP CTSFDataObject::QueryInterface(   REFIID riid,
00070                                             LPVOID *ppReturn)
00071 {
00072     *ppReturn = NULL;
00073
00074     if(IsEqualIID(riid, IID_IUnknown))
00075     {
00076         *ppReturn = (LPUNKNOWN)(LPDATAOBJECT)this;
00077     }
00078     else if(IsEqualIID(riid, IID_IDataObject))
00079     {
00080         *ppReturn = (LPDATAOBJECT)this;
00081     }
00082
00083     if(*ppReturn)
00084     {
00085         (*(LPUNKNOWN*)ppReturn)->AddRef();
00086         return S_OK;
00087     }
00088
00089     return E_NOINTERFACE;
00090 }
00091
00092 /**************************************************************************
00093
00094    CTSFDataObject::AddRef
00095
00096 **************************************************************************/
00097
00098 STDMETHODIMP_(DWORD) CTSFDataObject::AddRef()
00099 {
00100     return ++m_ObjRefCount;
00101 }
00102
00103 /**************************************************************************
00104
00105    CTSFDataObject::Release
00106
00107 **************************************************************************/
00108
00109 STDMETHODIMP_(DWORD) CTSFDataObject::Release()
00110 {
00111     if(--m_ObjRefCount == 0)
00112     {
00113         delete this;
00114     }
00115
00116     return m_ObjRefCount;
00117 }
00118
00119 ///////////////////////////////////////////////////////////////////////////
00120 //
00121 // IDataObject Implementation
00122 //
00123
00124 /**************************************************************************
00125
00126    CTSFDataObject::GetData()
00127
00128 **************************************************************************/
00129
00130 STDMETHODIMP CTSFDataObject::GetData(LPFORMATETC pFE, LPSTGMEDIUM pStgMedium)
00131 {
00132     if(pFE->cfFormat == m_FormatEtc.cfFormat)
00133     {
00134         pStgMedium->pUnkForRelease = NULL;
00135         pStgMedium->hGlobal = GlobalAlloc(GHND | GMEM_SHARE, (lstrlenW(m_pwszText) + 1) * sizeof(WCHAR));
00136
00137         if(pStgMedium->hGlobal)
00138         {
00139             pStgMedium->tymed = TYMED_HGLOBAL;
00140             return GetDataHere(pFE, pStgMedium);
00141         }
00142
00143         return E_OUTOFMEMORY;
00144     }
00145
00146     return E_INVALIDARG;
00147 }
00148
00149 /**************************************************************************
00150
00151    CTSFDataObject::GetDataHere()
00152
00153 **************************************************************************/
00154
00155 STDMETHODIMP CTSFDataObject::GetDataHere(LPFORMATETC pFE, LPSTGMEDIUM pStgMedium)
00156 {
00157     if(pFE->cfFormat == m_FormatEtc.cfFormat)
00158     {
00159         if(pFE->tymed & TYMED_HGLOBAL)
00160         {
00161             //copy the text into the buffer
00162             LPWSTR  pwsz = (LPWSTR)GlobalLock(pStgMedium->hGlobal);
00163
00164             if(pwsz)
00165             {
00166                 SIZE_T  sizeDestBytes = GlobalSize(pStgMedium->hGlobal);
00167                 SIZE_T  sizeSrcBytes = (lstrlenW(m_pwszText) + 1) * sizeof(WCHAR);
00168
00169                 if(sizeDestBytes < sizeSrcBytes)
00170                 {
00171                     return STG_E_MEDIUMFULL;
00172                 }
00173
00174                 CopyMemory(pwsz, m_pwszText, sizeSrcBytes);
00175
00176                 GlobalUnlock(pStgMedium->hGlobal);
00177
00178                 return S_OK;
00179             }
00180         }
00181         else
00182         {
00183             return DV_E_TYMED;
00184         }
00185     }
00186     else
00187     {
00188         return DV_E_CLIPFORMAT;
00189     }
00190
00191     return E_FAIL;
00192 }
00193
00194 /**************************************************************************
00195
00196    CTSFDataObject::QueryGetData()
00197
00198 **************************************************************************/
00199
00200 STDMETHODIMP CTSFDataObject::QueryGetData(LPFORMATETC pFE)
00201 {
00202 BOOL fReturn = FALSE;
00203
00204     /*
00205     Check the aspects we support. Implementations of this object will only
00206     support DVASPECT_CONTENT.
00207     */
00208     if(!(DVASPECT_CONTENT & pFE->dwAspect))
00209     {
00210         return DV_E_DVASPECT;
00211     }
00212
00213     if(pFE->cfFormat == m_FormatEtc.cfFormat)
00214     {
00215         fReturn |= m_FormatEtc.tymed & pFE->tymed;
00216     }
00217
00218     return (fReturn ? S_OK : DV_E_TYMED);
00219 }
00220
00221 /**************************************************************************
00222
00223    CTSFDataObject::GetCanonicalFormatEtc()
00224
00225 **************************************************************************/
00226
00227 STDMETHODIMP CTSFDataObject::GetCanonicalFormatEtc(LPFORMATETC pFEIn, LPFORMATETC pFEOut)
00228 {
00229     if(NULL == pFEOut)
00230     {
00231         return E_INVALIDARG;
00232     }
00233
00234     pFEOut->ptd = NULL;
00235
00236     return DATA_S_SAMEFORMATETC;
00237 }
00238
00239 /**************************************************************************
00240
00241    CTSFDataObject::EnumFormatEtc()
00242
00243 **************************************************************************/
00244
00245 STDMETHODIMP CTSFDataObject::EnumFormatEtc(  DWORD dwDirection,
00246                                           IEnumFORMATETC** ppEFE)
00247 {
00248     return E_NOTIMPL;
00249 }
00250
00251 /**************************************************************************
00252
00253    CTSFDataObject::SetData()
00254
00255 **************************************************************************/
00256
00257 STDMETHODIMP CTSFDataObject::SetData(  LPFORMATETC pFE,
00258                                     LPSTGMEDIUM pStgMedium,
00259                                     BOOL fRelease)
00260 {
00261     return E_NOTIMPL;
00262 }
00263
00264 /**************************************************************************
00265
00266    CTSFDataObject::DAdvise()
00267
00268 **************************************************************************/
00269
00270 STDMETHODIMP CTSFDataObject::DAdvise(  LPFORMATETC pFE,
00271                                     DWORD advf,
00272                                     IAdviseSink *ppAdviseSink,
00273                                     LPDWORD pdwConnection)
00274 {
00275     return E_NOTIMPL;
00276 }
00277
00278 /**************************************************************************
00279
00280    CTSFDataObject::DUnadvise()
00281
00282 **************************************************************************/
00283
00284 STDMETHODIMP CTSFDataObject::DUnadvise(DWORD dwConnection)
00285 {
00286     return E_NOTIMPL;
00287 }
00288
00289 /**************************************************************************
00290
00291    CTSFDataObject::EnumDAdvise()
00292
00293 **************************************************************************/
00294
00295 STDMETHODIMP CTSFDataObject::EnumDAdvise(IEnumSTATDATA** ppEnumAdvise)
00296 {
00297     return E_NOTIMPL;
00298 }
00299
00300 ///////////////////////////////////////////////////////////////////////////
00301 //
00302 // private and utility methods
00303 //
00304
00305 /**************************************************************************
00306
00307    CTSFDataObject::_SetText()
00308
00309 **************************************************************************/
00310
00311 HRESULT CTSFDataObject::_SetText(LPWSTR pwszText)
00312 {
00313     if(m_pwszText)
00314     {
00315         GlobalFree(m_pwszText);
00316         m_pwszText = NULL;
00317     }
00318
00319     if(pwszText && *pwszText)
00320     {
00321         m_pwszText = (LPWSTR)GlobalAlloc(GMEM_FIXED, (lstrlenW(pwszText) + 1) * sizeof(WCHAR));
00322         if(NULL == m_pwszText)
00323         {
00324             return E_OUTOFMEMORY;
00325         }
00326
00327         lstrcpyW(m_pwszText, pwszText);
00328     }
00329
00330     return S_OK;
00331 }
00332
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/Property/Property.h Source File

  • WinUI
  • Controls
  • Common
  • Property

Property.h

Go to the documentation of this file.
00001 #include "resource.h"
00002
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/gres409/gres409.c Source File

  • WinUI
  • GlobalDev
  • globaldev
  • gres409

gres409.c

Go to the documentation of this file.
00001 // res409.cpp : Defines the entry point for the DLL application.
00002 //
00003
00004 #include <windows.h>
00005
00006 BOOL WINAPI DllMain( HANDLE hModule,
00007                        DWORD  ul_reason_for_call,
00008                        LPVOID lpReserved
00009                         )
00010 {
00011     return TRUE;
00012 }
00013
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/QosEvent/PrintQos.Cpp Source File

  • NetDS
  • GQos
  • QosEvent

PrintQos.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      printqos.cpp
00010 //
00011 // Abstract:
00012 //      This file contains one public entry point PrintQos, which is used to
00013 //      print out a QOS structure.  The remaining static functions are merely
00014 //      helper functions devoted to specific parts of a QOS structure.  The
00015 //      QOS structure contains 3 components:
00016 //          Sending FLOWSPEC
00017 //          Receiving FLOWSPEC
00018 //          ProviderSpecific buffer consisting of 0 or more QOS objects
00019 //
00020 // Entry Points:
00021 //      PrintQos - print out a QOS structure including Provider-specific data
00022 //
00023 // Author:
00024 //      Barry R. Butterklee
00025
00026
00027 #include "qosevent.h"
00028
00029
00030 // print functions for major components of a QOS structure
00031 static void PrintFlowspec(FLOWSPEC *pFlowspec, CHAR *lpszIndent);
00032 static void PrintProviderSpecific(WSABUF *pProviderSpecific, CHAR *lpszIndent);
00033
00034 // print functions for QOS objects (part of provider-specific buffer)
00035 static void PrintRsvpStatus(RSVP_STATUS_INFO *pRsvpStatus, CHAR *lpszIndent);
00036 static void PrintRsvpResv(RSVP_RESERVE_INFO *pRsvpResv, CHAR *lpszIndent);
00037 static void PrintRsvpAdspec(RSVP_ADSPEC *pRsvpAdspec, CHAR *lpszIndent);
00038 static void PrintRsvpPolicy(RSVP_POLICY_INFO *pRsvpPolicy, CHAR *lpszIndent);
00039 static void PrintQosSDMode(QOS_SD_MODE *pQosSDMode, CHAR *lpszIndent);
00040 static void PrintQosDestaddr(QOS_DESTADDR *pQosDestaddr, CHAR *lpszIndent);
00041
00042 static void PrintAdGeneralParams(AD_GENERAL_PARAMS *pGeneralParams, CHAR *lpszIndent);
00043 static void PrintPolicy(RSVP_POLICY PolicyElement[], ULONG NumPolicyElement, CHAR *lpszIndent);
00044 static void PrintSendersList(QOS_OBJECT_HDR *pObj, CHAR *lpszIndent);
00045
00046 static CHAR *ServiceTypeToStr(SERVICETYPE ServiceType);
00047
00048
00049
00050 // Abstract:
00051 //      Print out the passed in QOS structure.  Printouts start out indent by
00052 //      the specified amount.  Major subcomponents of the QOS structure get
00053 //      indented an extra 2 spaces.
00054 //
00055 void PrintQos(QOS *qos, CHAR *lpszIndent)
00056 {
00057     CHAR szIndent[24];
00058
00059     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00060     szIndent[sizeof(szIndent)-1] = '\0';
00061
00062     if (NULL == qos)
00063     {
00064         printf("%sQOS structure is NULL\n", szIndent);
00065         return;
00066     }
00067
00068     printf("%sSendingFlowSpec\n", szIndent);
00069     PrintFlowspec(&qos->SendingFlowspec, szIndent);
00070
00071     printf("%sReceivingingFlowSpec\n", szIndent);
00072     PrintFlowspec(&qos->ReceivingFlowspec, szIndent);
00073
00074     printf("%sProviderSpecific - len = %d\n", szIndent,
00075                 qos->ProviderSpecific.len);
00076     PrintProviderSpecific(&qos->ProviderSpecific, szIndent);
00077
00078     printf("\n");
00079     return;
00080 }
00081
00082
00083
00084
00085 static void PrintFlowspec(FLOWSPEC *pFlowspec, CHAR *lpszIndent)
00086 {
00087     CHAR szIndent[24];
00088
00089     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00090     strncat(szIndent, "  ", sizeof(szIndent));
00091     szIndent[sizeof(szIndent)-1] = '\0';
00092
00093     if (QOS_NOT_SPECIFIED == pFlowspec->TokenRate)
00094         printf("%sTokenRate          = QOS_NOT_SPECIFIED\n", szIndent);
00095     else
00096         printf("%sTokenRate          = %d\n", szIndent, pFlowspec->TokenRate);
00097
00098     if (QOS_NOT_SPECIFIED == pFlowspec->TokenBucketSize)
00099         printf("%sTokenBucketSize    = QOS_NOT_SPECIFIED\n", szIndent);
00100     else
00101         printf("%sTokenBucketSize    = %d\n", szIndent, pFlowspec->TokenBucketSize);
00102
00103     if (QOS_NOT_SPECIFIED == pFlowspec->PeakBandwidth)
00104         printf("%sPeakBandwidth      = QOS_NOT_SPECIFIED\n", szIndent);
00105     else
00106         printf("%sPeakBandwidth      = %d\n", szIndent, pFlowspec->PeakBandwidth);
00107
00108     if (QOS_NOT_SPECIFIED == pFlowspec->Latency)
00109         printf("%sLatency            = QOS_NOT_SPECIFIED\n", szIndent);
00110     else
00111         printf("%sLatency            = %d\n", szIndent, pFlowspec->Latency);
00112
00113     if (QOS_NOT_SPECIFIED == pFlowspec->DelayVariation)
00114         printf("%sDelayVariation     = QOS_NOT_SPECIFIED\n", szIndent);
00115     else
00116         printf("%sDelayVariation     = %d\n", szIndent, pFlowspec->DelayVariation);
00117
00118     printf("%sServiceType        = %s\n",
00119         szIndent, ServiceTypeToStr(pFlowspec->ServiceType));
00120
00121     if (QOS_NOT_SPECIFIED == pFlowspec->MaxSduSize)
00122         printf("%sMaxSduSize         = QOS_NOT_SPECIFIED\n", szIndent);
00123     else
00124         printf("%sMaxSduSize         = %d\n", szIndent, pFlowspec->MaxSduSize);
00125
00126     if (QOS_NOT_SPECIFIED == pFlowspec->MinimumPolicedSize)
00127         printf("%sMinimumPolicedSize = QOS_NOT_SPECIFIED\n", szIndent);
00128     else
00129         printf("%sMinimumPolicedSize = %d\n", szIndent, pFlowspec->MinimumPolicedSize);
00130
00131     return;
00132 }
00133
00134
00135
00136
00137
00138 static void PrintProviderSpecific(WSABUF *pProviderSpecific, CHAR *lpszIndent)
00139 {
00140     CHAR *pBuf = pProviderSpecific->buf;
00141     QOS_OBJECT_HDR *pObjectHdr = (QOS_OBJECT_HDR *)pBuf;
00142     ULONG length = 0;
00143     CHAR szIndent[24];
00144
00145
00146     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00147     strncat(szIndent, "  ", sizeof(szIndent));
00148     szIndent[sizeof(szIndent)-1] = '\0';
00149
00150     if (0 == pProviderSpecific->len)
00151         return;
00152
00153     do
00154     {
00155         switch (pObjectHdr->ObjectType)
00156         {
00157         case RSVP_OBJECT_STATUS_INFO:
00158             printf("%sRSVP_OBJECT_STATUS_INFO\n", szIndent);
00159             PrintRsvpStatus((RSVP_STATUS_INFO *)pObjectHdr, szIndent);
00160             break;
00161
00162         case RSVP_OBJECT_RESERVE_INFO:
00163             printf("%sRSVP_OBJECT_RESERVE_INFO\n", szIndent);
00164             PrintRsvpResv((RSVP_RESERVE_INFO *)pObjectHdr, szIndent);
00165             break;
00166
00167         case RSVP_OBJECT_ADSPEC:
00168             printf("%sRSVP_OBJECT_ADSPEC\n", szIndent);
00169             PrintRsvpAdspec((RSVP_ADSPEC *)pObjectHdr, szIndent);
00170             break;
00171
00172         case RSVP_OBJECT_POLICY_INFO:
00173             printf("%sRSVP_OBJECT_POLICY_INFO\n", szIndent);
00174             PrintRsvpPolicy((RSVP_POLICY_INFO *)pObjectHdr, szIndent);
00175             break;
00176
00177 // since this is added for Windows XP, we need to make sure it is there first
00178 #ifdef RSVP_OBJECT_FILTERSPEC_LIST
00179         case RSVP_OBJECT_FILTERSPEC_LIST :
00180       printf("%sRSVP_OBJECT_FILTERSPEC_LIST Object Present\n",szIndent);
00181       PrintSendersList(pObjectHdr, szIndent);
00182       break;
00183 #endif
00184
00185         case QOS_OBJECT_SD_MODE:
00186             printf("%sQOS_SD_MODE\n", szIndent);
00187             PrintQosSDMode((QOS_SD_MODE *)pObjectHdr, szIndent);
00188             break;
00189
00190         case QOS_OBJECT_DESTADDR:
00191             printf("%sQOS_OBJECT_DESTADDR\n", szIndent);
00192             PrintQosDestaddr((QOS_DESTADDR *)pObjectHdr, szIndent);
00193             break;
00194
00195         case QOS_OBJECT_END_OF_LIST:
00196             printf("%sQOS_END_OF_LIST - no more objects\n", szIndent);
00197             return;
00198
00199         default:
00200             printf("%sUnknown ObjectType %08x in QosObjectHdr\n",
00201                 szIndent, pObjectHdr->ObjectType);
00202             return;
00203         }
00204
00205         // advance past the current object
00206         length += pObjectHdr->ObjectLength;
00207         if (length < pProviderSpecific->len)
00208         {
00209             // ok to advance pointer becasue we will not exceed the provider
00210             // specific buffer
00211             pBuf += pObjectHdr->ObjectLength;
00212             pObjectHdr = (QOS_OBJECT_HDR *)pBuf;
00213             continue;
00214         }
00215
00216         break;
00217     }while (TRUE);
00218     return;
00219 }
00220
00221
00222
00223
00224 static void PrintRsvpStatus(RSVP_STATUS_INFO *pRsvpStatus, CHAR *lpszIndent)
00225 {
00226     CHAR szIndent[24];
00227
00228     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00229     strncat(szIndent, "  ", sizeof(szIndent));
00230     szIndent[sizeof(szIndent)-1] = '\0';
00231
00232     printf("%sStatusCode = ", szIndent);
00233     switch (pRsvpStatus->StatusCode)
00234     {
00235     case WSA_QOS_RECEIVERS:             // at least one Reserve has arrived
00236         printf("WSA_QOS_RECEIVERS");
00237         break;
00238
00239     case WSA_QOS_SENDERS:               // at least one Path has arrived
00240         printf("WSA_QOS_SENDERS");
00241         break;
00242
00243     case WSA_QOS_NO_SENDERS:            // there are no senders
00244         printf("WSA_QOS_NO_SENDERS");
00245         break;
00246
00247     case WSA_QOS_NO_RECEIVERS:          // there are no receivers
00248         printf("WSA_QOS_NO_RECEIVERS");
00249         break;
00250
00251     case WSA_QOS_REQUEST_CONFIRMED:     // Reserve has been confirmed
00252         printf("WSA_QOS_REQUEST_CONFIRMED");
00253         break;
00254
00255     case WSA_QOS_ADMISSION_FAILURE:     // error due to lack of resources
00256         printf("WSA_QOS_ADMISSION_FAILURE");
00257         break;
00258
00259     case WSA_QOS_POLICY_FAILURE:        // rejected for administrative reasons
00260                                         //      bad credentials
00261         printf("WSA_QOS_POLICY_FAILURE");
00262         break;
00263
00264     case WSA_QOS_BAD_STYLE:             // unknown or conflicting style
00265         printf("WSA_QOS_BAD_STYLE");
00266         break;
00267
00268     case WSA_QOS_BAD_OBJECT:            // problem with some part of the filterspec/
00269                                         //      providerspecific buffer in general
00270         printf("WSA_QOS_BAD_OBJECT");
00271         break;
00272
00273     case WSA_QOS_TRAFFIC_CTRL_ERROR:    // problem with some part of the flowspec
00274         printf("WSA_QOS_TRAFFIC_CTRL_ERROR");
00275         break;
00276
00277     case WSA_QOS_GENERIC_ERROR:         // general error
00278         printf("WSA_QOS_GENERIC_ERROR");
00279         break;
00280
00281     default:
00282         printf("Unknown RSVP StatusCode %lu", pRsvpStatus->StatusCode);
00283         break;
00284     }
00285
00286     printf("\n");
00287     printf("%sExtendedStatus1=%lu\n", szIndent, pRsvpStatus->ExtendedStatus1);
00288     printf("%sExtendedStatus2=%lu\n", szIndent, pRsvpStatus->ExtendedStatus2);
00289
00290     return;
00291 }
00292
00293
00294
00295
00296 static void PrintRsvpResv(RSVP_RESERVE_INFO *pRsvpResv, CHAR *lpszIndent)
00297 {
00298     CHAR    szIndent[24];
00299     ULONG   i;
00300
00301     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00302     strncat(szIndent, "  ", sizeof(szIndent));
00303     szIndent[sizeof(szIndent)-1] = '\0';
00304
00305     printf("%sStyle = ",szIndent);
00306     switch (pRsvpResv->Style)
00307     {
00308     case RSVP_DEFAULT_STYLE:
00309         printf("RSVP_DEFAULT_STYLE\n");
00310         break;
00311     case RSVP_WILDCARD_STYLE:
00312         printf("RSVP_WILDCARD_STYLE\n");
00313         break;
00314     case RSVP_FIXED_FILTER_STYLE:
00315         printf("RSVP_FIXED_FILTER_STYLE\n");
00316         break;
00317     case RSVP_SHARED_EXPLICIT_STYLE:
00318         printf("RSVP_SHARED_EXPLICIT_STYLE\n");
00319         break;
00320     default:
00321         printf("Unknown style %d\n", pRsvpResv->Style);
00322         break;
00323     }
00324
00325     printf("%sConfirmRequest %s\n", szIndent, (pRsvpResv->ConfirmRequest?"yes":"no"));
00326     printf("%sNumFlowDesc = %lu\n", szIndent, pRsvpResv->NumFlowDesc);
00327
00328     for (i=0; i<pRsvpResv->NumFlowDesc; i++)
00329     {
00330         ULONG   j;
00331
00332         PrintFlowspec(&pRsvpResv->FlowDescList[i].FlowSpec, szIndent);
00333         printf("%s  NumFilters = %lu\n", szIndent, pRsvpResv->FlowDescList[i].NumFilters);
00334         for (j=0; j<pRsvpResv->FlowDescList[i].NumFilters; j++)
00335         {
00336             printf("%s  FilterType = ", szIndent);
00337             switch (pRsvpResv->FlowDescList[i].FilterList[j].Type)
00338             {
00339                 case FILTERSPECV4:
00340                 {
00341                     PCHAR   lpszIPv4;
00342                     struct in_addr in;
00343
00344                     in.S_un.S_addr = pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV4.Address.Addr;
00345                     lpszIPv4 = inet_ntoa(in);
00346
00347                     if (lpszIPv4 != NULL)
00348                     {
00349                         printf("FILTERSPECV4\n");
00350                         printf("%s    Address = %s\n", szIndent, lpszIPv4);
00351                         printf("%s    Port    = %hu\n", szIndent,
00352                             pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV4.Port);
00353                     }
00354                 }
00355                 break;
00356                 case FILTERSPECV6:
00357                 {
00358                     CHAR    szIPv6[32];
00359                     DWORD   dwIPv6Len = sizeof(szIPv6);
00360                     DWORD   dwConvResult;
00361
00362                     dwConvResult =
00363                         WSAAddressToString(
00364                             (LPSOCKADDR)&pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV6.Address,
00365                             sizeof(IN_ADDR_IPV6),
00366                             NULL,
00367                             szIPv6,
00368                             &dwIPv6Len);
00369
00370                     if (0 == dwConvResult)
00371                     {
00372                         printf("FILTERSPECV6\n");
00373                         printf("%s    Address = %s\n", szIndent, szIPv6);
00374                         printf("%s    Port    = %hu\n", szIndent,
00375                             pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV6.Port);
00376                     }
00377                 }
00378                 break;
00379                 case FILTERSPECV6_FLOW:
00380                 {
00381                     CHAR    szIPv6[32];
00382                     DWORD   dwIPv6Len = sizeof(szIPv6);
00383                     DWORD   dwConvResult;
00384
00385                     dwConvResult =
00386                         WSAAddressToString(
00387                             (LPSOCKADDR)&pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV6Flow.Address,
00388                             sizeof(IN_ADDR_IPV6),
00389                             NULL,
00390                             szIPv6,
00391                             &dwIPv6Len);
00392
00393                     if (0 == dwConvResult)
00394                     {
00395                         printf("FILTERSPECV6_FLOW\n");
00396                         printf("%s    Address = %s\n", szIndent, szIPv6);
00397                         printf("%s    FlowLabel = %s\n", szIndent,
00398                             pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV6Flow.FlowLabel);
00399                     }
00400                 }
00401                 break;
00402                 case FILTERSPECV4_GPI:
00403                 {
00404                     PCHAR   lpszIPv4;
00405                     struct in_addr in;
00406
00407                     in.S_un.S_addr = pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV4.Address.Addr;
00408                     lpszIPv4 = inet_ntoa(in);
00409
00410                     if (lpszIPv4 != NULL)
00411                     {
00412                         printf("FILTERSPECV4_GPI\n");
00413                         printf("%s    Address = %s\n", szIndent, lpszIPv4);
00414                         printf("%s    Port    = %hu\n", szIndent,
00415                             pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV4Gpi.GeneralPortId);
00416                     }
00417                 }
00418                 break;
00419                 case FILTERSPECV6_GPI:
00420                 {
00421                     CHAR    szIPv6[32];
00422                     DWORD   dwIPv6Len = sizeof(szIPv6);
00423                     DWORD   dwConvResult;
00424
00425                     dwConvResult =
00426                         WSAAddressToString(
00427                             (LPSOCKADDR)&pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV6Gpi.Address,
00428                             sizeof(IN_ADDR_IPV6),
00429                             NULL,
00430                             szIPv6,
00431                             &dwIPv6Len);
00432
00433                     if (0 == dwConvResult)
00434                     {
00435                         printf("FILTERSPECV6_GPI\n");
00436                         printf("%s    Address = %s\n", szIndent, szIPv6);
00437                         printf("%s    Port    = %hu\n", szIndent,
00438                             pRsvpResv->FlowDescList[i].FilterList[j].FilterSpecV6Gpi.GeneralPortId);
00439                     }
00440                 }
00441                 break;
00442             }
00443         }
00444     }
00445
00446     return;
00447 }
00448
00449
00450
00451
00452 static void PrintRsvpAdspec(RSVP_ADSPEC *pRsvpAdspec, CHAR *lpszIndent)
00453 {
00454     CHAR szIndent[24];
00455
00456     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00457     strncat(szIndent, "  ", sizeof(szIndent));
00458     szIndent[sizeof(szIndent)-1] = '\0';
00459
00460     printf("%sGeneralParams\n", szIndent);
00461     PrintAdGeneralParams(&pRsvpAdspec->GeneralParams, szIndent);
00462     printf("%sNumberOfServices = %lu\n", szIndent, pRsvpAdspec->NumberOfServices);
00463     for (ULONG i=0; i<pRsvpAdspec->NumberOfServices; i++)
00464     {
00465         printf("%sServices[%lu].Length = %lu\n",
00466             szIndent, i, pRsvpAdspec->Services[i].Length);
00467         printf("%sServices[%lu].ServiceType = %s\n",
00468             szIndent, i, ServiceTypeToStr(pRsvpAdspec->Services[i].Service));
00469         printf("%sServices[%lu].Overrides\n", szIndent, i);
00470         PrintAdGeneralParams(&pRsvpAdspec->Services[i].Overrides, szIndent);
00471         if (SERVICETYPE_GUARANTEED == pRsvpAdspec->Services[i].Service)
00472         {
00473             printf("%s  Services[%lu].CTotal    = %ld\n",
00474                 szIndent, i, pRsvpAdspec->Services[i].Guaranteed.CTotal);
00475             printf("%s  Services[%lu].DTotal    = %ld\n",
00476                 szIndent, i, pRsvpAdspec->Services[i].Guaranteed.DTotal);
00477             printf("%s  Services[%lu].CSum      = %ld\n",
00478                 szIndent, i, pRsvpAdspec->Services[i].Guaranteed.CSum);
00479             printf("%s  Services[%lu].DSum      = %ld\n",
00480                 szIndent, i, pRsvpAdspec->Services[i].Guaranteed.DSum);
00481         } else {
00482             printf("%sServices[%lu].ParamBuffer[].ParameterId  = %lu\n",
00483                 szIndent, i, pRsvpAdspec->Services[i].ParamBuffer->ParameterId);
00484             printf("%sServices[%lu].ParamBuffer[].Length       = %lu\n",
00485                 szIndent, i, pRsvpAdspec->Services[i].ParamBuffer->Length);
00486         }
00487     }
00488     return;
00489 }
00490
00491
00492
00493
00494 static void PrintRsvpPolicy(RSVP_POLICY_INFO *pRsvpPolicy, CHAR *lpszIndent)
00495 {
00496     CHAR szIndent[24];
00497
00498     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00499     strncat(szIndent, "  ", sizeof(szIndent));
00500     szIndent[sizeof(szIndent)-1] = '\0';
00501
00502     PrintPolicy(pRsvpPolicy->PolicyElement, pRsvpPolicy->NumPolicyElement, szIndent);
00503     return;
00504 }
00505
00506
00507
00508
00509 static void PrintQosSDMode(QOS_SD_MODE *pQosSDMode, CHAR *lpszIndent)
00510 {
00511     CHAR szIndent[24];
00512
00513     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00514     strncat(szIndent, "  ", sizeof(szIndent));
00515     szIndent[sizeof(szIndent)-1] = '\0';
00516
00517     printf("%sShapeDiscardMode = ", szIndent);
00518     switch (pQosSDMode->ShapeDiscardMode)
00519     {
00520     case TC_NONCONF_BORROW:
00521         printf("TC_NONCONF_BORROW\n");
00522         break;
00523
00524     case TC_NONCONF_SHAPE:
00525         printf("TC_NONCONF_SHAPE\n");
00526         break;
00527
00528     case TC_NONCONF_DISCARD:
00529         printf("TC_NONCONF_DISCARD\n");
00530         break;
00531
00532     default:
00533         printf("Unknown traffic class %lu\n", pQosSDMode->ShapeDiscardMode);
00534         break;
00535     }
00536     return;
00537 }
00538
00539
00540
00541
00542 static void PrintQosDestaddr(QOS_DESTADDR *pQosDestaddr, CHAR *lpszIndent)
00543 {
00544     CHAR    szIndent[24];
00545     CHAR    szIP[32];
00546     DWORD   dwIPLen = sizeof(szIP);
00547     DWORD   dwConvResult;
00548
00549     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00550     strncat(szIndent, "  ", sizeof(szIndent));
00551     szIndent[sizeof(szIndent)-1] = '\0';
00552
00553     dwConvResult = WSAAddressToString(
00554                         (LPSOCKADDR)pQosDestaddr->SocketAddress,
00555                         pQosDestaddr->SocketAddressLength,
00556                         NULL,
00557                         szIP,
00558                         &dwIPLen);
00559
00560     if (0 == dwConvResult)
00561     {
00562         printf("%sDestAddress     = %s\n", szIndent, szIP);
00563         printf("%sDestAddress Len = %d\n", szIndent, pQosDestaddr->SocketAddressLength);
00564     }
00565     return;
00566 }
00567
00568
00569
00570
00571
00572 static void PrintAdGeneralParams(AD_GENERAL_PARAMS *pGeneralParams, CHAR *lpszIndent)
00573 {
00574     CHAR szIndent[24];
00575
00576     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00577     strncat(szIndent, "  ", sizeof(szIndent));
00578     szIndent[sizeof(szIndent)-1] = '\0';
00579
00580     printf("%sIntServAwareHopCount  = %ld\n", szIndent, pGeneralParams->IntServAwareHopCount);
00581
00582     if (POSITIVE_INFINITY_RATE == pGeneralParams->PathBandwidthEstimate)
00583         printf("%sPathBandwidthEstimate = <POSITIVE INFINITY>\n", szIndent);
00584     else
00585         printf("%sPathBandwidthEstimate = %ld\n", szIndent, pGeneralParams->PathBandwidthEstimate);
00586
00587     printf("%sMinimumLatency        = %ld\n", szIndent, pGeneralParams->MinimumLatency);
00588     printf("%sPathMTU               = %ld\n", szIndent, pGeneralParams->PathMTU);
00589     printf("%sFlags                 = %ld\n", szIndent, pGeneralParams->Flags);
00590     return;
00591 }
00592
00593
00594
00595
00596 static void PrintPolicy(RSVP_POLICY PolicyElement[], ULONG NumPolicyElement, CHAR *lpszIndent)
00597 {
00598     CHAR szIndent[24];
00599
00600     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00601     strncat(szIndent, "  ", sizeof(szIndent));
00602     szIndent[sizeof(szIndent)-1] = '\0';
00603
00604     printf("%sNum Policy Elements %d\n", lpszIndent, NumPolicyElement);
00605     for (ULONG i=0; i<NumPolicyElement; i++)
00606     {
00607         printf("%s  [%d] Len  = %hu\n", szIndent, i, PolicyElement[i].Len);
00608         printf("%s  [%d] Type = %hu\n", szIndent, i, PolicyElement[i].Type);
00609     }
00610     return;
00611 }
00612
00613
00614
00615 static CHAR *ServiceTypeToStr(SERVICETYPE ServiceType)
00616 {
00617     static CHAR szServiceType[128];
00618
00619     if (QOS_NOT_SPECIFIED == ServiceType)
00620     {
00621         strcpy(szServiceType, "QOS_NOT_SPECIFIED");
00622         return(szServiceType);
00623     }
00624
00625     switch ((ServiceType & 0x0000FFFF))
00626     {
00627     case SERVICETYPE_NOTRAFFIC :
00628         strcpy(szServiceType, "SERVICETYPE_NOTRAFFIC");
00629         break;
00630
00631     case SERVICETYPE_BESTEFFORT :
00632         strcpy(szServiceType, "SERVICETYPE_BESTEFFORT");
00633         break;
00634
00635     case SERVICETYPE_CONTROLLEDLOAD :
00636         strcpy(szServiceType, "SERVICETYPE_CONTROLLEDLOAD");
00637         break;
00638
00639     case SERVICETYPE_GUARANTEED :
00640         strcpy(szServiceType, "SERVICETYPE_GUARANTEED");
00641         break;
00642
00643     case SERVICETYPE_NETWORK_UNAVAILABLE :
00644         strcpy(szServiceType, "SERVICETYPE_NETWORK_UNAVAILABLE");
00645         break;
00646
00647     case SERVICETYPE_GENERAL_INFORMATION :
00648         strcpy(szServiceType, "SERVICETYPE_GENERAL_INFORMATION");
00649         break;
00650
00651     case SERVICETYPE_NOCHANGE :
00652         strcpy(szServiceType, "SERVICETYPE_NOCHANGE");
00653         break;
00654
00655     case SERVICETYPE_NONCONFORMING :
00656         strcpy(szServiceType, "SERVICETYPE_NONCONFORMING");
00657         break;
00658
00659     case SERVICETYPE_NETWORK_CONTROL :
00660         strcpy(szServiceType, "SERVICETYPE_NETWORK_CONTROL");
00661         break;
00662
00663     case SERVICETYPE_QUALITATIVE :
00664         strcpy(szServiceType, "SERVICETYPE_QUALITATIVE");
00665         break;
00666
00667     default:
00668         sprintf(szServiceType, "Unknown service type %lu  zzz", ServiceType);
00669         break;
00670     }
00671
00672     if (ServiceType & SERVICE_NO_TRAFFIC_CONTROL)
00673         strcat(szServiceType, " | SERVICE_NO_TRAFFIC_CONTROL");
00674     else if (ServiceType & SERVICE_NO_QOS_SIGNALING)
00675         strcat(szServiceType, " | SERVICE_NO_QOS_SIGNALING");
00676
00677     return(szServiceType);
00678 }
00679
00680 static void PrintSendersList(QOS_OBJECT_HDR *pObj, CHAR *lpszIndent)
00681 {
00682     CHAR    szIndent[24];
00683     LPRSVP_FILTERSPEC pFilterSpec = NULL;
00684     int nFilters = 0;
00685
00686     strncpy(szIndent, lpszIndent, sizeof(szIndent));
00687     strncat(szIndent, "  ", sizeof(szIndent));
00688     szIndent[sizeof(szIndent)-1] = '\0';
00689
00690     pFilterSpec = (LPRSVP_FILTERSPEC) ((char *)pObj + sizeof(QOS_OBJECT_HDR));
00691     nFilters = (pObj->ObjectLength - sizeof (QOS_OBJECT_HDR))
00692                   / sizeof (RSVP_FILTERSPEC);
00693
00694     printf("%sNumber of Filters present = %d\n", szIndent,nFilters);
00695     while (nFilters--)
00696     {
00697         PCHAR lpszFilter = inet_ntoa(*(struct in_addr*)&pFilterSpec->FilterSpecV4.Address.Addr);
00698
00699         if (!lpszFilter)
00700             return;
00701
00702         printf("%ssender ip = %s:%d\n", szIndent, lpszFilter, pFilterSpec->FilterSpecV4.Port);
00703         pFilterSpec++;
00704     }
00705 }
00706
00707
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBaseObj Member List

This is the complete list of members for CBaseObj, including all inherited members.
CBaseObj(EBaseObjectType botVal) | CBaseObj | [protected]
GetBaseObjectType() | CBaseObj | [inline]
GetOuterUnknown() | CBaseObj | [inline]
m_BaseObjectType | CBaseObj | [private]
m_pUnkOuter | CBaseObj | [protected]
~CBaseObj() | CBaseObj | [virtual]
Generated on Wed Nov 13 2024 16:55:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkRecognition/C#/AssemblyInfo.cs Source File

  • TabletPC
  • InkRecognition
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("Ink Recognition Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2003 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: UDDI/wsdldiscovery/main.cs Source File

  • UDDI
  • wsdldiscovery

main.cs

Go to the documentation of this file.
00001 /*=====================================================================
00002   This file is part of the Microsoft UDDI SDK Code Samples.
00003
00004   Copyright (C) Microsoft Corporation.  All rights reserved.
00005
00006 This source code is intended only as a supplement to Microsoft
00007 Development Tools and/or on-line documentation.  See these other
00008 materials for detailed information regarding Microsoft code samples.
00009
00010 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00011 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00012 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00013 PARTICULAR PURPOSE.
00014 =====================================================================*/
00015
00016 using System;
00017 using System.Drawing;
00018 using System.Collections;
00019 using System.Collections.Specialized;
00020 using System.ComponentModel;
00021 using System.Windows.Forms;
00022 using System.Data;
00023 using System.Text;
00024
00025 using Microsoft.Uddi;
00026 using Microsoft.Uddi.Businesses;
00027 using Microsoft.Uddi.Extensions;
00028 using Microsoft.Uddi.Services;
00029 using Microsoft.Uddi.TModels;
00030
00031 using System.Diagnostics;
00032
00033 using UDDI.Tools;
00034
00035 namespace WsdlDiscovery
00036 {
00037   /// <summary>
00038   /// Summary description for Form1.
00039   /// </summary>
00040   public class frmMain : System.Windows.Forms.Form
00041   {
00042     private System.Windows.Forms.Label _descriptionLabel;
00043     private System.Windows.Forms.Label _inquireLabel;
00044     private System.Windows.Forms.Label _extensionLabel;
00045     private System.Windows.Forms.Label _serviceLabel;
00046     private System.Windows.Forms.Label _providerLabel;
00047     private System.Windows.Forms.Label _categorizationLabel;
00048     private System.Windows.Forms.Label _resultsLabel;
00049     private System.Windows.Forms.GroupBox _groupBox1;
00050     private System.Windows.Forms.GroupBox _groupBox2;
00051     private System.Windows.Forms.GroupBox _groupBox3;
00052     private System.Windows.Forms.TextBox _inquireUrl;
00053     private System.Windows.Forms.TextBox _extensionUrl;
00054     private System.Windows.Forms.TextBox _serviceName;
00055     private System.Windows.Forms.TextBox _providerName;
00056     private System.Windows.Forms.Button _searchService;
00057     private System.Windows.Forms.Button _searchProvider;
00058     private System.Windows.Forms.Button _searchCategorization;
00059     private UDDI.Tools.CategoryTreeView _categories;
00060     private System.Windows.Forms.RichTextBox _results;
00061     private System.Windows.Forms.Button _loadSchemes;
00062
00063     private bool _okToReloadSchemes = true;
00064
00065     /// <summary>
00066     /// Required designer variable.
00067     /// </summary>
00068     private System.ComponentModel.Container components = null;
00069
00070     public frmMain()
00071     {
00072       //
00073       // Required for Windows Form Designer support
00074       //
00075       InitializeComponent();
00076
00077       //
00078       // Add any constructor code after InitializeComponent call
00079       //
00080       _inquireUrl.TextChanged += new EventHandler(_inquireUrl_TextChanged);
00081       _extensionUrl.TextChanged += new EventHandler(_extensionUrl_TextChanged);
00082       _providerName.TextChanged += new EventHandler(_providerName_TextChanged);
00083       _serviceName.TextChanged += new EventHandler(_serviceName_TextChanged);
00084
00085       _categories.AfterSelect += new TreeViewEventHandler(_categories_AfterSelect);
00086
00087       _searchCategorization.Enabled = false;
00088
00089       SetSearchProviderButtonState();
00090       SetSearchServiceButtonState();
00091       SetLoadSchemesButtonState();
00092     }
00093
00094     /// <summary>
00095     /// Clean up any resources being used.
00096     /// </summary>
00097     protected override void Dispose( bool disposing )
00098     {
00099       if( disposing )
00100       {
00101         if (components != null)
00102         {
00103           components.Dispose();
00104         }
00105       }
00106       base.Dispose( disposing );
00107     }
00108
00109     #region Windows Form Designer generated code
00110     /// <summary>
00111     /// Required method for Designer support - do not modify
00112     /// the contents of this method with the code editor.
00113     /// </summary>
00114     private void InitializeComponent()
00115     {
00116       this._descriptionLabel = new System.Windows.Forms.Label();
00117       this._inquireLabel = new System.Windows.Forms.Label();
00118       this._extensionLabel = new System.Windows.Forms.Label();
00119       this._serviceLabel = new System.Windows.Forms.Label();
00120       this._providerLabel = new System.Windows.Forms.Label();
00121       this._categorizationLabel = new System.Windows.Forms.Label();
00122       this._resultsLabel = new System.Windows.Forms.Label();
00123       this._groupBox1 = new System.Windows.Forms.GroupBox();
00124       this._groupBox2 = new System.Windows.Forms.GroupBox();
00125       this._groupBox3 = new System.Windows.Forms.GroupBox();
00126       this._inquireUrl = new System.Windows.Forms.TextBox();
00127       this._extensionUrl = new System.Windows.Forms.TextBox();
00128       this._serviceName = new System.Windows.Forms.TextBox();
00129       this._providerName = new System.Windows.Forms.TextBox();
00130       this._searchService = new System.Windows.Forms.Button();
00131       this._searchProvider = new System.Windows.Forms.Button();
00132       this._searchCategorization = new System.Windows.Forms.Button();
00133       this._categories = new UDDI.Tools.CategoryTreeView();
00134       this._results = new System.Windows.Forms.RichTextBox();
00135       this._loadSchemes = new System.Windows.Forms.Button();
00136       this.SuspendLayout();
00137       //
00138       // _descriptionLabel
00139       //
00140       this._descriptionLabel.Location = new System.Drawing.Point(24, 16);
00141       this._descriptionLabel.Name = "_descriptionLabel";
00142       this._descriptionLabel.Size = new System.Drawing.Size(408, 32);
00143       this._descriptionLabel.TabIndex = 0;
00144       this._descriptionLabel.Text = "This application searches a UDDI site for entities with WSDL described services. " +
00145         " Search by name or browse through available categorization schemes.";
00146       //
00147       // _inquireLabel
00148       //
00149       this._inquireLabel.Location = new System.Drawing.Point(24, 72);
00150       this._inquireLabel.Name = "_inquireLabel";
00151       this._inquireLabel.Size = new System.Drawing.Size(88, 24);
00152       this._inquireLabel.TabIndex = 1;
00153       this._inquireLabel.Text = "Inquire URL:";
00154       //
00155       // _extensionLabel
00156       //
00157       this._extensionLabel.Location = new System.Drawing.Point(24, 104);
00158       this._extensionLabel.Name = "_extensionLabel";
00159       this._extensionLabel.Size = new System.Drawing.Size(88, 24);
00160       this._extensionLabel.TabIndex = 2;
00161       this._extensionLabel.Text = "Extension URL:";
00162       //
00163       // _serviceLabel
00164       //
00165       this._serviceLabel.Location = new System.Drawing.Point(24, 152);
00166       this._serviceLabel.Name = "_serviceLabel";
00167       this._serviceLabel.Size = new System.Drawing.Size(88, 24);
00168       this._serviceLabel.TabIndex = 3;
00169       this._serviceLabel.Text = "Service Name:";
00170       //
00171       // _providerLabel
00172       //
00173       this._providerLabel.Location = new System.Drawing.Point(24, 184);
00174       this._providerLabel.Name = "_providerLabel";
00175       this._providerLabel.Size = new System.Drawing.Size(88, 24);
00176       this._providerLabel.TabIndex = 4;
00177       this._providerLabel.Text = "Provider Name:";
00178       //
00179       // _categorizationLabel
00180       //
00181       this._categorizationLabel.Location = new System.Drawing.Point(24, 216);
00182       this._categorizationLabel.Name = "_categorizationLabel";
00183       this._categorizationLabel.Size = new System.Drawing.Size(88, 24);
00184       this._categorizationLabel.TabIndex = 5;
00185       this._categorizationLabel.Text = "Categorization:";
00186       //
00187       // _resultsLabel
00188       //
00189       this._resultsLabel.Location = new System.Drawing.Point(24, 432);
00190       this._resultsLabel.Name = "_resultsLabel";
00191       this._resultsLabel.Size = new System.Drawing.Size(88, 24);
00192       this._resultsLabel.TabIndex = 6;
00193       this._resultsLabel.Text = "Results:";
00194       //
00195       // _groupBox1
00196       //
00197       this._groupBox1.Location = new System.Drawing.Point(24, 52);
00198       this._groupBox1.Name = "_groupBox1";
00199       this._groupBox1.Size = new System.Drawing.Size(400, 2);
00200       this._groupBox1.TabIndex = 7;
00201       this._groupBox1.TabStop = false;
00202       //
00203       // _groupBox2
00204       //
00205       this._groupBox2.Location = new System.Drawing.Point(24, 136);
00206       this._groupBox2.Name = "_groupBox2";
00207       this._groupBox2.Size = new System.Drawing.Size(400, 2);
00208       this._groupBox2.TabIndex = 8;
00209       this._groupBox2.TabStop = false;
00210       //
00211       // _groupBox3
00212       //
00213       this._groupBox3.Location = new System.Drawing.Point(24, 420);
00214       this._groupBox3.Name = "_groupBox3";
00215       this._groupBox3.Size = new System.Drawing.Size(400, 2);
00216       this._groupBox3.TabIndex = 9;
00217       this._groupBox3.TabStop = false;
00218       //
00219       // _inquireUrl
00220       //
00221       this._inquireUrl.Location = new System.Drawing.Point(112, 72);
00222       this._inquireUrl.Name = "_inquireUrl";
00223       this._inquireUrl.Size = new System.Drawing.Size(312, 20);
00224       this._inquireUrl.TabIndex = 6;
00225       this._inquireUrl.Text = "http://uddi.microsoft.com/inquire";
00226       //
00227       // _extensionUrl
00228       //
00229       this._extensionUrl.Location = new System.Drawing.Point(112, 104);
00230       this._extensionUrl.Name = "_extensionUrl";
00231       this._extensionUrl.Size = new System.Drawing.Size(312, 20);
00232       this._extensionUrl.TabIndex = 7;
00233       this._extensionUrl.Text = "http://uddi.microsoft.com/extension.asmx";
00234       //
00235       // _serviceName
00236       //
00237       this._serviceName.Location = new System.Drawing.Point(112, 152);
00238       this._serviceName.Name = "_serviceName";
00239       this._serviceName.Size = new System.Drawing.Size(248, 20);
00240       this._serviceName.TabIndex = 0;
00241       this._serviceName.Text = "";
00242       //
00243       // _providerName
00244       //
00245       this._providerName.Location = new System.Drawing.Point(112, 184);
00246       this._providerName.Name = "_providerName";
00247       this._providerName.Size = new System.Drawing.Size(248, 20);
00248       this._providerName.TabIndex = 2;
00249       this._providerName.Text = "";
00250       //
00251       // _searchService
00252       //
00253       this._searchService.FlatStyle = System.Windows.Forms.FlatStyle.System;
00254       this._searchService.Location = new System.Drawing.Point(368, 152);
00255       this._searchService.Name = "_searchService";
00256       this._searchService.Size = new System.Drawing.Size(56, 24);
00257       this._searchService.TabIndex = 1;
00258       this._searchService.Text = "&Search";
00259       this._searchService.Click += new System.EventHandler(this._searchService_Click);
00260       //
00261       // _searchProvider
00262       //
00263       this._searchProvider.FlatStyle = System.Windows.Forms.FlatStyle.System;
00264       this._searchProvider.Location = new System.Drawing.Point(368, 184);
00265       this._searchProvider.Name = "_searchProvider";
00266       this._searchProvider.Size = new System.Drawing.Size(56, 24);
00267       this._searchProvider.TabIndex = 3;
00268       this._searchProvider.Text = "S&earch";
00269       this._searchProvider.Click += new System.EventHandler(this._searchProvider_Click);
00270       //
00271       // _searchCategorization
00272       //
00273       this._searchCategorization.FlatStyle = System.Windows.Forms.FlatStyle.System;
00274       this._searchCategorization.Location = new System.Drawing.Point(368, 384);
00275       this._searchCategorization.Name = "_searchCategorization";
00276       this._searchCategorization.Size = new System.Drawing.Size(56, 24);
00277       this._searchCategorization.TabIndex = 5;
00278       this._searchCategorization.Text = "Se&arch";
00279       this._searchCategorization.Click += new System.EventHandler(this._searchCategorization_Click);
00280       //
00281       // _categories
00282       //
00283       this._categories.Connection = null;
00284       this._categories.ImageIndex = -1;
00285       this._categories.Location = new System.Drawing.Point(112, 216);
00286       this._categories.Name = "_categories";
00287       this._categories.SelectedImageIndex = -1;
00288       this._categories.Size = new System.Drawing.Size(312, 160);
00289       this._categories.TabIndex = 17;
00290       //
00291       // _results
00292       //
00293       this._results.DetectUrls = false;
00294       this._results.Location = new System.Drawing.Point(24, 456);
00295       this._results.Name = "_results";
00296       this._results.ReadOnly = true;
00297       this._results.Size = new System.Drawing.Size(400, 184);
00298       this._results.TabIndex = 18;
00299       this._results.Text = "";
00300       this._results.WordWrap = false;
00301       //
00302       // _loadSchemes
00303       //
00304       this._loadSchemes.FlatStyle = System.Windows.Forms.FlatStyle.System;
00305       this._loadSchemes.Location = new System.Drawing.Point(264, 384);
00306       this._loadSchemes.Name = "_loadSchemes";
00307       this._loadSchemes.Size = new System.Drawing.Size(96, 24);
00308       this._loadSchemes.TabIndex = 4;
00309       this._loadSchemes.Text = "&Load schemes";
00310       this._loadSchemes.Click += new System.EventHandler(this._loadSchemes_Click);
00311       //
00312       // frmMain
00313       //
00314       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00315       this.ClientSize = new System.Drawing.Size(448, 661);
00316       this.Controls.Add(this._groupBox1);
00317       this.Controls.Add(this._loadSchemes);
00318       this.Controls.Add(this._results);
00319       this.Controls.Add(this._categories);
00320       this.Controls.Add(this._searchCategorization);
00321       this.Controls.Add(this._searchProvider);
00322       this.Controls.Add(this._searchService);
00323       this.Controls.Add(this._providerName);
00324       this.Controls.Add(this._serviceName);
00325       this.Controls.Add(this._extensionUrl);
00326       this.Controls.Add(this._inquireUrl);
00327       this.Controls.Add(this._groupBox3);
00328       this.Controls.Add(this._groupBox2);
00329       this.Controls.Add(this._resultsLabel);
00330       this.Controls.Add(this._categorizationLabel);
00331       this.Controls.Add(this._providerLabel);
00332       this.Controls.Add(this._serviceLabel);
00333       this.Controls.Add(this._extensionLabel);
00334       this.Controls.Add(this._inquireLabel);
00335       this.Controls.Add(this._descriptionLabel);
00336       this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
00337       this.MaximizeBox = false;
00338       this.MinimizeBox = false;
00339       this.Name = "frmMain";
00340       this.Text = "Find WSDL Services";
00341       this.ResumeLayout(false);
00342
00343     }
00344     #endregion
00345
00346     /// <summary>
00347     /// The main entry point for the application.
00348     /// </summary>
00349     [STAThread]
00350     static void Main()
00351     {
00352       System.Windows.Forms.Application.EnableVisualStyles();
00353       Application.Run(new frmMain());
00354     }
00355
00356     //
00357     // The text in the Inquire Url textbox has changed.  This might
00358     // affect wether some of the buttons should be enabled or not.
00359     //
00360     private void _inquireUrl_TextChanged(object sender, EventArgs e)
00361     {
00362       SetSearchProviderButtonState();
00363       SetSearchServiceButtonState();
00364       SetLoadSchemesButtonState();
00365     }
00366
00367     //
00368     // The text in the Extension Url textbox has changed.  This might
00369     // affect wether some of the buttons should be enabled or not.
00370     //
00371     private void _extensionUrl_TextChanged(object sender, EventArgs e)
00372     {
00373       _okToReloadSchemes = true;
00374
00375       SetLoadSchemesButtonState();
00376     }
00377
00378     //
00379     // To perform the required search, we need an Inquire Url, and
00380     // a provider name to search on.
00381     //
00382     private void SetSearchProviderButtonState()
00383     {
00384       _searchProvider.Enabled = ( ( 0 != _inquireUrl.Text.Length ) && ( 0 != _providerName.Text.Length ) );
00385     }
00386
00387     //
00388     // To perform the required search, we need an Inquire Url, and
00389     // a service name to search on.
00390     //
00391     private void SetSearchServiceButtonState()
00392     {
00393       _searchService.Enabled = ( ( 0 != _inquireUrl.Text.Length ) && ( 0 != _serviceName.Text.Length ) );
00394     }
00395
00396     //
00397     // We can reload the categorization schemes only if:
00398     //
00399     // 1.  Either the Inquire Url or Extension Url has changed since
00400     //     the last reload.
00401     // 2.  An Inquire Url exists.
00402     // 3.  An Extension Url exists.
00403     //
00404     private void SetLoadSchemesButtonState()
00405     {
00406       _loadSchemes.Enabled = _okToReloadSchemes && ( ( 0 != _inquireUrl.Text.Length ) && ( 0 != _extensionUrl.Text.Length ) );
00407     }
00408
00409     //
00410     // If the user has changed the provider name, they might have
00411     // changed it to an empty string.  So we check for this.
00412     //
00413     private void _providerName_TextChanged(object sender, EventArgs e)
00414     {
00415       SetSearchProviderButtonState();
00416     }
00417
00418     //
00419     // If the user has changed the service name, they might have
00420     // changed it to an empty string.  So we check for this.
00421     private void _serviceName_TextChanged(object sender, EventArgs e)
00422     {
00423       SetSearchServiceButtonState();
00424     }
00425
00426     //
00427     // Helper function.  Does a case insensitive search inside coll
00428     // for str.
00429     //
00430     private bool ContainsInsensitive( string str, StringCollection coll )
00431     {
00432       bool found = false;
00433       foreach( string s in coll )
00434       {
00435         if( 0 == string.Compare( str, s, true ) )
00436         {
00437           found = true;
00438           break;
00439         }
00440       }
00441
00442       return found;
00443     }
00444
00445     //
00446     // Helper function.  Return true iff the tModel uniquely identified by
00447     // tModelKey is present in the tModels collection.
00448     //
00449     private bool ContainsInsensitive( string tModelKey, TModelCollection tModels )
00450     {
00451       bool found = false;
00452       foreach( TModel tm in tModels )
00453       {
00454         if( 0 == string.Compare( tModelKey, tm.TModelKey, true ) )
00455         {
00456           found = true;
00457           break;
00458         }
00459       }
00460
00461       return found;
00462     }
00463
00464     //
00465     // Helper function.  Return the tModel from tModels whose TModelKey matches
00466     // tModelKey.  Return null if nothing is found.
00467     //
00468     private TModel GetTModel( string tModelKey, TModelCollection tModels )
00469     {
00470       foreach( TModel tm in tModels )
00471       {
00472         if( 0 == string.Compare( tModelKey, tm.TModelKey, true ) )
00473         {
00474           return tm;
00475         }
00476       }
00477
00478       return null;
00479     }
00480
00481     private void FillResultsControl( BusinessEntityCollection businessEntities, StringCollection serviceKeys, TModelCollection wsdlTModels )
00482     {
00483       //
00484       // RTF control words & characters.
00485       //
00486       const string startRTF   = @"{\rtf1\ansi{\stylesheet\deftab200}";
00487       const string endRTF     = @"}";
00488       const string boldOn     = @"\b ";
00489       const string boldOff    = @"\b0 ";
00490       const string tab      = @"\tab ";
00491       const string newLine    = @"\par ";
00492
00493       //
00494       // Labels for the sections in our RTF output
00495       //
00496       const string serviceName  = @"Service: ";
00497       const string serviceDesc  = @"Description: ";
00498       const string bindings   = @"Binding: ";
00499       const string accessPoint  = @"Access Point: ";
00500       const string description  = @"Description: ";
00501       const string interfaceDefs  = @"Interface Definitions: ";
00502
00503       _results.Clear();
00504
00505       StringBuilder sb = new StringBuilder();
00506
00507       sb.Append( startRTF );
00508
00509       foreach( BusinessEntity be in businessEntities )
00510       {
00511         bool foundWsdlSvc = false;
00512         foreach( BusinessService bs in be.BusinessServices )
00513         {
00514           if( ContainsInsensitive( bs.ServiceKey, serviceKeys ) )
00515           {
00516             foundWsdlSvc = true;
00517             break;
00518           }
00519         }
00520
00521         //
00522         // This particular business entity has no services which
00523         // are categorized as consumable by wsdl.  So, move onto
00524         // the next business entity.
00525         //
00526         if( false == foundWsdlSvc )
00527         {
00528           continue;
00529         }
00530
00531         //
00532         // Just pick the 1st name out of the name collection.  The right
00533         // thing to do is either to show all names, or to determine the
00534         // CultureInfo of the current thread & try to display a name from
00535         // that language (if it exists in the collection ).
00536         //
00537         if( 0 < be.Names.Count )
00538         {
00539           sb.Append( boldOn + be.Names[ 0 ].Text + boldOff + newLine );
00540         }
00541
00542         //
00543         // Just pick the 1st description out of the description collection.
00544         // The right thing to do is either to show all descriptions, or to
00545         // determine the CultureInfo of the current thread & try to display
00546         // a description from that language (if it exists in the collection ).
00547         //
00548         if( 0 < be.Descriptions.Count )
00549         {
00550           sb.Append( tab + be.Descriptions[ 0 ].Text + newLine + newLine );
00551         }
00552
00553         foreach( BusinessService bs in be.BusinessServices )
00554         {
00555           //
00556           // We cannot assume that every Service owned by this particular
00557           // Business has been categorized as WSDL described.
00558           //
00559           if( !ContainsInsensitive( bs.ServiceKey, serviceKeys ) )
00560           {
00561             continue;
00562           }
00563
00564           //
00565           // Just pick the 1st name out of the name collection.
00566           // The right thing to do is either to show all names, or to
00567           // determine the CultureInfo of the current thread & try to display
00568           // a name from that language (if it exists in the collection ).
00569           //
00570           sb.Append( tab + boldOn + serviceName + boldOff );
00571           if( 0 < bs.Names.Count )
00572           {
00573             sb.Append( bs.Names[ 0 ].Text + newLine );
00574           }
00575
00576
00577           //
00578           // Just pick the 1st description out of the description collection.
00579           // The right thing to do is either to show all descriptions, or to
00580           // determine the CultureInfo of the current thread & try to display
00581           // a description from that language (if it exists in the collection ).
00582           //
00583           if( 0 != bs.Descriptions.Count )
00584           {
00585             sb.Append( tab + boldOn + serviceDesc + boldOff );
00586             sb.Append( bs.Descriptions[ 0 ].Text + newLine );
00587           }
00588           sb.Append( newLine );
00589
00590           //
00591           // Only display the BindingTemplate's description if it contains a
00592           // TModelInstanceInfo who's TModelKey property refers to a TModel
00593           // which is categorized as WSDL.
00594           //
00595           foreach( BindingTemplate bt in bs.BindingTemplates )
00596           {
00597             bool seenBindingTemplate = false;
00598
00599             foreach( TModelInstanceInfo tmii in bt.TModelInstanceInfos )
00600             {
00601               if( !ContainsInsensitive( tmii.TModelKey, wsdlTModels ) )
00602               {
00603                 continue;
00604               }
00605               //
00606               // A BindingTemplate could very well contain n TModelInstanceInfos,
00607               // all of which refer to TModels which are categorized as WSDL.  However,
00608               // we only want to display the BindingTemplate information once.
00609               //
00610               if( false == seenBindingTemplate )
00611               {
00612                 sb.Append( tab + tab + boldOn + bindings + boldOff + newLine );
00613                 sb.Append( tab + tab + tab + boldOn + accessPoint + boldOff + bt.AccessPoint.Text + newLine );
00614
00615                 if( 0 < bt.Descriptions.Count )
00616                 {
00617                   sb.Append( tab + tab + tab + boldOn + description + boldOff );
00618                   //
00619                   // Just pick the 1st description out of the description collection.
00620                   // The right thing to do is either to show all descriptions, or to
00621                   // determine the CultureInfo of the current thread & try to display
00622                   // a description from that language (if it exists in the collection ).
00623                   //
00624                   sb.Append( bt.Descriptions[ 0 ].Text + newLine );
00625                 }
00626
00627                 seenBindingTemplate = true;
00628               }
00629
00630               sb.Append( tab + tab + tab + boldOn + interfaceDefs + boldOff + newLine );
00631               TModel wsdlTModel = GetTModel( tmii.TModelKey, wsdlTModels );
00632               if( null != wsdlTModel )
00633               {
00634                 sb.Append( tab + tab + tab + wsdlTModel.OverviewDoc.OverviewUrl + newLine );
00635               }
00636             }
00637           }
00638
00639           sb.Append( newLine );
00640         }
00641       }
00642
00643       sb.Append( endRTF );
00644       _results.Rtf = sb.ToString();
00645     }
00646
00647     private void _loadSchemes_Click(object sender, System.EventArgs e)
00648     {
00649       //
00650       // We need both the Inquire Url and the Extension Url.
00651       //
00652       // The InquireUrl is issued a FindTModel message to get us
00653       // summary information about all TModels which are categorized
00654       // as categorizations.  This will give us all the top level
00655       // nodes in the tree control.
00656       //
00657       // The Extension Url is used to issue GetRelatedCategories
00658       // messages.  These are issued every time someone expands
00659       // a tree node.
00660       //
00661       if( 0 == _inquireUrl.Text.Length )
00662       {
00663         MessageBox.Show( "Please specify an Inquire URL.", "Inquire URL missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00664         return;
00665       }
00666
00667       if( 0 == _extensionUrl.Text.Length )
00668       {
00669         MessageBox.Show( "Please specify an Extension URL.", "Extension URL missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00670         return;
00671       }
00672
00673       try
00674       {
00675         //
00676         // Create a connection object, pass it to our tree control
00677         // and let the control populate itself.
00678         //
00679         Cursor.Current = Cursors.WaitCursor;
00680
00681         UddiConnection conn = new UddiConnection();
00682         conn.InquireUrl = _inquireUrl.Text;
00683         conn.ExtensionsUrl = _extensionUrl.Text;
00684         _categories.Connection = conn;
00685
00686         if( null != _categories.Nodes )
00687         {
00688           _categories.Nodes.Clear();
00689         }
00690
00691         _categories.LoadTModels();
00692
00693         //
00694         // We've just loaded the schemes (TModels which are categorized
00695         // as categorizations.  So disable this load functionality until
00696         // the user changes either the Inquire Url or the Publish Url.
00697         //
00698         _okToReloadSchemes = false;
00699         SetLoadSchemesButtonState();
00700       }
00701       catch( Exception exception )
00702       {
00703         Cursor.Current = Cursors.Default;
00704         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00705
00706         if( null != _categories.Nodes )
00707         {
00708           _categories.Nodes.Clear();
00709         }
00710
00711         return;
00712       }
00713     }
00714
00715     //
00716     // The topmost nodes in the treeview do not represent categories.
00717     // Rather they represent schemes.  Schemes contain categories.
00718     //
00719     // So after the user has selected a tree node, inspect the node
00720     // they have selected.  If it is a scheme node, disable the Search
00721     // by categorization button.  Otherwise enable it.
00722     //
00723     private void _categories_AfterSelect(object sender, TreeViewEventArgs e)
00724     {
00725       CategoryTreeNode catNode = (CategoryTreeNode)e.Node;
00726
00727       _searchCategorization.Enabled = ( ( false == catNode.IsSchemeNode ) && ( _extensionUrl.Text.Length >= 0 ) );
00728       if( catNode.IsSchemeNode )
00729       {
00730         _searchCategorization.Enabled = false;
00731       }
00732       else
00733       {
00734         _searchCategorization.Enabled = true;
00735       }
00736     }
00737
00738     private void _searchCategorization_Click(object sender, System.EventArgs e)
00739     {
00740       //
00741       // Two sanity checks.  These should never fire because the Search button
00742       // for categorizations should always be disabled in either of these 2 cases
00743       // (no tree node selected, or the selected node is not a category), but they
00744       // are here just in case.
00745       //
00746       CategoryTreeNode category = (CategoryTreeNode)_categories.SelectedNode;
00747       if( null == category )
00748       {
00749         MessageBox.Show( "Please select a category!", "Category not selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00750         return;
00751       }
00752
00753       if( null == category.CategoryValue.KeyValue )
00754       {
00755         MessageBox.Show( "This node represents a scheme, not a category.", "Category not selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00756         return;
00757       }
00758
00759       _results.Clear();
00760
00761       UddiConnection conn = new UddiConnection();
00762       conn.InquireUrl = _inquireUrl.Text;
00763
00764       Cursor.Current = Cursors.WaitCursor;
00765
00766       //
00767       // Find all Services that are categorized as whatever value the user selected
00768       // in the category taxonomy.
00769       //
00770       ServiceList sl = null;
00771       try
00772       {
00773         Cursor.Current = Cursors.WaitCursor;
00774
00775         FindService fs = new FindService();
00776         fs.CategoryBag.Add( category.CategoryValue.TModelKey, category.CategoryValue.KeyValue, null );
00777
00778         sl = fs.Send( conn );
00779       }
00780       catch( Exception exception )
00781       {
00782         Cursor.Current = Cursors.Default;
00783         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00784         return;
00785       }
00786
00787       if( 0 == sl.ServiceInfos.Count )
00788       {
00789         Cursor.Current = Cursors.Default;
00790         MessageBox.Show( "No services matching the categorization were found.", "No services found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00791         return;
00792       }
00793
00794       if( true == sl.Truncated )
00795       {
00796         MessageBox.Show( "The list of services matching the specified categorization was truncated by the server.  Consider using a more specific name.", "Truncated Results", MessageBoxButtons.OK, MessageBoxIcon.Information );
00797       }
00798
00799       //
00800       // Get the full service detail from the above services.  This is
00801       // necessary because we need to look inside each binding to see
00802       // which tmodels are implemented by each service.
00803       //
00804       GetServiceDetail gsd = new GetServiceDetail();
00805       foreach( ServiceInfo si in sl.ServiceInfos )
00806       {
00807         gsd.ServiceKeys.Add( si.ServiceKey );
00808       }
00809
00810       ServiceDetail sd = gsd.Send( conn );
00811
00812
00813       //
00814       // get a list of all (unique) tmodel keys implemented by the
00815       // services returned above.
00816       //
00817       StringCollection allTModelKeys = new StringCollection();
00818       foreach( BusinessService bs in sd.BusinessServices )
00819       {
00820         foreach( BindingTemplate bt in bs.BindingTemplates )
00821         {
00822           foreach( TModelInstanceInfo tmii in bt.TModelInstanceInfos )
00823           {
00824             if( !ContainsInsensitive( tmii.TModelKey, allTModelKeys ) )
00825             {
00826               allTModelKeys.Add( tmii.TModelKey );
00827             }
00828           }
00829         }
00830       }
00831
00832       //
00833       // get the detail on each of these tmodels, and determine which
00834       // tmodels represent wsdl interfaces.
00835       //
00836       if( 0 == allTModelKeys.Count )
00837       {
00838         Cursor.Current = Cursors.Default;
00839         MessageBox.Show( "Services matching the categorization were found, however none of them implement tModels.", "No tModels found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00840         return;
00841       }
00842
00843       TModelDetail tmd = null;
00844       try
00845       {
00846         GetTModelDetail gtmd = new GetTModelDetail();
00847         foreach( string key in allTModelKeys )
00848         {
00849           gtmd.TModelKeys.Add( key );
00850         }
00851
00852         tmd = gtmd.Send( conn );
00853       }
00854       catch( Exception exception )
00855       {
00856         Cursor.Current = Cursors.Default;
00857         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00858         return;
00859       }
00860
00861       TModelCollection wsdlTModels = new TModelCollection();
00862       foreach( TModel tm in tmd.TModels )
00863       {
00864         foreach( KeyedReference categorization in tm.CategoryBag )
00865         {
00866           if( 0 == string.Compare( CommonCanonical.UddiOrgTypes, categorization.TModelKey, true ) &&
00867             0 == string.Compare( @"wsdlSpec", categorization.KeyValue, false ) &&
00868             false == ContainsInsensitive( tm.TModelKey, wsdlTModels ) )
00869           {
00870             wsdlTModels.Add( tm );
00871           }
00872         }
00873       }
00874
00875       //
00876       // Now go through all of our business services from the
00877       // getservicedetail call & determine which ones implement
00878       // one of these tmodels.
00879       //
00880       if( 0 == wsdlTModels.Count )
00881       {
00882         Cursor.Current = Cursors.Default;
00883         MessageBox.Show( "Services matching the categorization were found, however none of them are WSDL described.", "No services found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00884         return;
00885       }
00886
00887       StringCollection serviceKeys = new StringCollection();
00888       StringCollection businessKeys = new StringCollection();
00889
00890       foreach( BusinessService bs in sd.BusinessServices )
00891       {
00892         foreach( BindingTemplate bt in bs.BindingTemplates )
00893         {
00894           foreach( TModelInstanceInfo tmii in bt.TModelInstanceInfos )
00895           {
00896             //
00897             // If we have hit an implementation of one of these tModels,
00898             // and if we don't already have the servicekey keep track of it.
00899             //
00900             if( ContainsInsensitive( tmii.TModelKey, wsdlTModels ) &&
00901               !ContainsInsensitive( bs.ServiceKey, serviceKeys ) )
00902             {
00903               serviceKeys.Add( bs.ServiceKey );
00904
00905               //
00906               // If we don't already have the business key, keep track of it.
00907               //
00908               if( !ContainsInsensitive( bs.BusinessKey, businessKeys ) )
00909               {
00910                 businessKeys.Add( bs.BusinessKey );
00911               }
00912             }
00913           }
00914         }
00915       }
00916
00917       if( 0 == businessKeys.Count )
00918       {
00919         MessageBox.Show( "Nothing was found.", "No businesses found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00920         return;
00921       }
00922
00923       GetBusinessDetail gbd = new GetBusinessDetail();
00924       gbd.BusinessKeys = businessKeys;
00925
00926       BusinessDetail bd = gbd.Send( conn );
00927
00928       FillResultsControl( bd.BusinessEntities, serviceKeys, wsdlTModels );
00929
00930       Cursor.Current = Cursors.Default;
00931     }
00932
00933     private void _searchProvider_Click(object sender, System.EventArgs e)
00934     {
00935       //
00936       // Two sanity checks.  These should never fire because the Search
00937       // by provider button should always be disabled if either one of
00938       // these is true.
00939       //
00940       if( 0 == _providerName.Text.Length )
00941       {
00942         MessageBox.Show( "Please specify a provider!", "No provider specified", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00943         return;
00944       }
00945
00946       if( 0 == _inquireUrl.Text.Length )
00947       {
00948         MessageBox.Show( "Please specify an Inquire URL.", "Inquire URL missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00949         return;
00950       }
00951
00952       _results.Clear();
00953
00954       UddiConnection conn = new UddiConnection();
00955       conn.InquireUrl = _inquireUrl.Text;
00956
00957       Cursor.Current = Cursors.WaitCursor;
00958
00959       //
00960       //  1.  Find all Businesses who's name matches what the user typed in.
00961       //
00962       BusinessList bl = null;
00963       try
00964       {
00965         FindBusiness fb = new FindBusiness();
00966         fb.Names.Add( _providerName.Text );
00967         bl = fb.Send( conn );
00968       }
00969       catch( Exception exception )
00970       {
00971         Cursor.Current = Cursors.Default;
00972         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00973         return;
00974       }
00975
00976       if( 0 == bl.BusinessInfos.Count )
00977       {
00978         Cursor.Current = Cursors.Default;
00979         MessageBox.Show( "No providers matching the specified name were found.", "No providers found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
00980         return;
00981       }
00982
00983       if( true == bl.Truncated )
00984       {
00985         MessageBox.Show( "The list of providers matching the specified name was truncated by the server.  Consider specifying a more restrictive name.", "Truncated Results", MessageBoxButtons.OK, MessageBoxIcon.Information );
00986       }
00987
00988       //
00989       // 2.  Do a GetBusinessDetail on all the Businesses returned from #1.
00990       //     This will get us every bit of information about each Business,
00991       //     each Businesses BusinessService, and each BindingDetail owned
00992       //     by each BusinessService.
00993       //
00994       BusinessDetail bd = null;
00995       try
00996       {
00997         GetBusinessDetail gbd = new GetBusinessDetail();
00998         foreach( BusinessInfo bi in bl.BusinessInfos )
00999         {
01000           gbd.BusinessKeys.Add( bi.BusinessKey );
01001         }
01002
01003         bd = gbd.Send( conn );
01004       }
01005       catch( Exception exception )
01006       {
01007         Cursor.Current = Cursors.Default;
01008         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01009         return;
01010       }
01011
01012
01013       //
01014       // 3.  Get a list of all unique tmodel keys which are implemented
01015       //     by the services owned by the businesses retrieved above.
01016       //
01017       StringCollection allTModelKeys = new StringCollection();
01018       foreach( BusinessEntity be in bd.BusinessEntities )
01019       {
01020         foreach( BusinessService bs in be.BusinessServices )
01021         {
01022           foreach( BindingTemplate bt in bs.BindingTemplates )
01023           {
01024             foreach( TModelInstanceInfo tmii in bt.TModelInstanceInfos )
01025             {
01026               if( false == ContainsInsensitive( tmii.TModelKey, allTModelKeys ) )
01027               {
01028                 allTModelKeys.Add( tmii.TModelKey );
01029               }
01030             }
01031           }
01032         }
01033       }
01034
01035       //
01036       // 4.  Now determine which of these tmodels are categorized as
01037       //     wsdl interfaces.
01038       //
01039       if( 0 == allTModelKeys.Count )
01040       {
01041         Cursor.Current = Cursors.Default;
01042         MessageBox.Show( "Businesses matching the specified name were found, but none implement a tModel.", "No tModels found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01043         return;
01044       }
01045
01046       TModelDetail tmd = null;
01047       try
01048       {
01049         GetTModelDetail gtmd = new GetTModelDetail();
01050         foreach( string key in allTModelKeys )
01051         {
01052           gtmd.TModelKeys.Add( key );
01053         }
01054
01055         tmd = gtmd.Send( conn );
01056       }
01057       catch( Exception exception )
01058       {
01059         Cursor.Current = Cursors.Default;
01060         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01061         return;
01062       }
01063
01064       TModelCollection wsdlTModels = new TModelCollection();
01065
01066       foreach( TModel tm in tmd.TModels )
01067       {
01068         foreach( KeyedReference categorization in tm.CategoryBag )
01069         {
01070           if( 0 == string.Compare( CommonCanonical.UddiOrgTypes, categorization.TModelKey, true ) &&
01071             0 == string.Compare( @"wsdlSpec", categorization.KeyValue, false ) &&
01072             false == ContainsInsensitive( tm.TModelKey, wsdlTModels ) )
01073           {
01074             wsdlTModels.Add( tm );
01075           }
01076         }
01077       }
01078
01079       //
01080       // 5.  now we have a list of businesses named what we want.
01081       //     we also have a list of tmodel keys which we know represent
01082       //     tmodels which are categorized as wsdl interfaces.
01083       //     we will now get a list of service keys representing
01084       //     services owned by these businesses which implement these
01085       //     tmodels.
01086       //
01087       if( 0 == wsdlTModels.Count )
01088       {
01089         Cursor.Current = Cursors.Default;
01090         MessageBox.Show( "Businesses matching the specified name were found, but none have services described with WSDL.", "No tModels found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01091         return;
01092       }
01093
01094       StringCollection serviceKeys = new StringCollection();
01095       foreach( BusinessEntity be in bd.BusinessEntities )
01096       {
01097         foreach( BusinessService bs in be.BusinessServices )
01098         {
01099           foreach( BindingTemplate bt in bs.BindingTemplates )
01100           {
01101             foreach( TModelInstanceInfo tmii in bt.TModelInstanceInfos )
01102             {
01103               if( ContainsInsensitive( tmii.TModelKey, wsdlTModels ) &&
01104                 !ContainsInsensitive( bs.ServiceKey, serviceKeys ) )
01105               {
01106                 serviceKeys.Add( bs.ServiceKey );
01107               }
01108             }
01109           }
01110         }
01111       }
01112
01113       FillResultsControl( bd.BusinessEntities, serviceKeys, wsdlTModels );
01114
01115       Cursor.Current = Cursors.Default;
01116     }
01117
01118     private void _searchService_Click(object sender, System.EventArgs e)
01119     {
01120       //
01121       // Two sanity checks.  These should never fire because the Search by
01122       // service button should always be disabled in either of these cases.
01123       //
01124       if( 0 == _serviceName.Text.Length )
01125       {
01126         MessageBox.Show( "Please specify a service name", "Service name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01127         return;
01128       }
01129
01130       if( 0 == _inquireUrl.Text.Length )
01131       {
01132         MessageBox.Show( "Please specify an Inquire URL.", "Inquire URL missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01133         return;
01134       }
01135
01136       _results.Clear();
01137
01138       UddiConnection conn = new UddiConnection();
01139       conn.InquireUrl = _inquireUrl.Text;
01140
01141       Cursor.Current = Cursors.WaitCursor;
01142
01143       //
01144       // Find all services that match the specified name.
01145       //
01146       ServiceList sl = null;
01147       try
01148       {
01149         FindService fs = new FindService();
01150         fs.Names.Add( _serviceName.Text );
01151         sl = fs.Send( conn );
01152       }
01153       catch( Exception exception )
01154       {
01155         Cursor.Current = Cursors.Default;
01156         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01157         return;
01158       }
01159
01160       if( 0 == sl.ServiceInfos.Count )
01161       {
01162         Cursor.Current = Cursors.Default;
01163         MessageBox.Show( "No services matching the specified name were found.", "No services found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01164         return;
01165       }
01166
01167       if( true == sl.Truncated )
01168       {
01169         MessageBox.Show( "The list of services matching the specified name was truncated by the server.  Consider using a more specific name.", "Truncated Results", MessageBoxButtons.OK, MessageBoxIcon.Information );
01170       }
01171
01172       //
01173       // get the full service detail from the above services.  this is
01174       // necessary because we need to look inside each binding to see
01175       // which tmodels are implemented by each service.
01176       //
01177       GetServiceDetail gsd = new GetServiceDetail();
01178       foreach( ServiceInfo si in sl.ServiceInfos )
01179       {
01180         gsd.ServiceKeys.Add( si.ServiceKey );
01181       }
01182
01183       ServiceDetail sd = null;
01184       try
01185       {
01186         sd = gsd.Send( conn );
01187       }
01188       catch( Exception exception )
01189       {
01190         Cursor.Current = Cursors.Default;
01191         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01192         return;
01193       }
01194
01195       //
01196       // get a list of all (unique) tmodel keys implemented by the
01197       // services returned above.
01198       //
01199       StringCollection allTModelKeys = new StringCollection();
01200       foreach( BusinessService bs in sd.BusinessServices )
01201       {
01202         foreach( BindingTemplate bt in bs.BindingTemplates )
01203         {
01204           foreach( TModelInstanceInfo tmii in bt.TModelInstanceInfos )
01205           {
01206             if( !ContainsInsensitive( tmii.TModelKey, allTModelKeys ) )
01207             {
01208               allTModelKeys.Add( tmii.TModelKey );
01209             }
01210           }
01211         }
01212       }
01213
01214       //
01215       // get the detail on each of these tmodels, and determine which
01216       // tmodels represent wsdl interfaces.
01217       //
01218       if( 0 == allTModelKeys.Count )
01219       {
01220         Cursor.Current = Cursors.Default;
01221         MessageBox.Show( "Services matching the specified name were found, however none implement tModels.", "No tModels found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01222         return;
01223       }
01224
01225       TModelDetail tmd = null;
01226       try
01227       {
01228         GetTModelDetail gtmd = new GetTModelDetail();
01229         foreach( string key in allTModelKeys )
01230         {
01231           gtmd.TModelKeys.Add( key );
01232         }
01233
01234         tmd = gtmd.Send( conn );
01235       }
01236       catch( Exception exception )
01237       {
01238         Cursor.Current = Cursors.Default;
01239         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01240         return;
01241       }
01242
01243       TModelCollection wsdlTModels = new TModelCollection();
01244       foreach( TModel tm in tmd.TModels )
01245       {
01246         foreach( KeyedReference categorization in tm.CategoryBag )
01247         {
01248           if( 0 == string.Compare( CommonCanonical.UddiOrgTypes, categorization.TModelKey, true ) &&
01249             0 == string.Compare( @"wsdlSpec", categorization.KeyValue, false ) &&
01250             false == ContainsInsensitive( tm.TModelKey, wsdlTModels ) )
01251           {
01252             wsdlTModels.Add( tm );
01253           }
01254         }
01255       }
01256
01257       //
01258       // now go through all of our business services from the
01259       // getservicedetail call & determine which ones implement
01260       // one of these tmodels.
01261       //
01262       if( 0 == wsdlTModels.Count )
01263       {
01264         Cursor.Current = Cursors.Default;
01265         MessageBox.Show( "Services matching the specified name were found, however none are WSDL described.", "No tModels found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01266         return;
01267       }
01268
01269       StringCollection serviceKeys = new StringCollection();
01270       StringCollection businessKeys = new StringCollection();
01271
01272       foreach( BusinessService bs in sd.BusinessServices )
01273       {
01274         foreach( BindingTemplate bt in bs.BindingTemplates )
01275         {
01276           foreach( TModelInstanceInfo tmii in bt.TModelInstanceInfos )
01277           {
01278             if( ContainsInsensitive( tmii.TModelKey, wsdlTModels ) &&
01279               !ContainsInsensitive( bs.ServiceKey, serviceKeys ) )
01280             {
01281               serviceKeys.Add( bs.ServiceKey );
01282
01283               if( !ContainsInsensitive( bs.BusinessKey, businessKeys ) )
01284               {
01285                 businessKeys.Add( bs.BusinessKey );
01286               }
01287             }
01288           }
01289         }
01290       }
01291
01292       if( 0 == businessKeys.Count )
01293       {
01294         MessageBox.Show( "Nothing was found.", "No businesses found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01295         return;
01296       }
01297
01298       GetBusinessDetail gbd = new GetBusinessDetail();
01299       gbd.BusinessKeys = businessKeys;
01300
01301       BusinessDetail bd = null;
01302
01303       try
01304       {
01305         bd = gbd.Send( conn );
01306       }
01307       catch( Exception exception )
01308       {
01309         Cursor.Current = Cursors.Default;
01310         MessageBox.Show( exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
01311         return;
01312       }
01313
01314       FillResultsControl( bd.BusinessEntities, serviceKeys, wsdlTModels );
01315
01316       Cursor.Current = Cursors.Default;
01317     }
01318   }
01319 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMSOmniProvSessionPTSchemaRowset Member List

This is the complete list of members for CMSOmniProvSessionPTSchemaRowset, including all inherited members.
Execute(LONG *pcRowsAffected, ULONG, const VARIANT *) CMSOmniProvSessionPTSchemaRowset [inline]
Generated on Wed Nov 13 2024 16:56:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreClien/GUIBALL.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • FreClien

GUIBALL.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GUIBALL.H
00003
00004   Summary:   Include file for the CGuiBall C++ class. A GuiBall is a C++
00005              object that uses three independent worker threads to display
00006              a moving and bouncing ball in the client area of a designated
00007              window.  It is anchored to the Windows GUI (Graphical User
00008              Interface) environment. This GuiBall object continuously
00009              paints a ball image based on data it obtains from a virtual
00010              ball object. This virtual ball object is instantiated as a
00011              COM object (a COBall) in a separate In-process server,
00012              FRESERVE.
00013
00014              GuiBall launches three threads which all continuously and
00015              asynchronously command the ball to move. GuiBall itself
00016              provides methods to initialize the GuiBall, paint the ball
00017              image, and restart the motion.
00018
00019              For a comprehensive tutorial code tour of GUIBALL's contents
00020              and offerings see the tutorial FRECLIEN.HTM file. For more
00021              specific technical details on the internal workings see the
00022              comments dispersed throughout the GUIBALL source code.
00023
00024   Classes:   CThreadInitData, CGuiBall
00025
00026   Origin:    9-8-97: atrent - Created for COM Tutorial Samples. [Revised]
00027 ----------------------------------------------------------------------------
00028   This file is part of the Microsoft COM Tutorial Code Samples.
00029
00030   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00031
00032   This source code is intended only as a supplement to Microsoft
00033   Development Tools and/or on-line documentation.  See these other
00034   materials for detailed information regarding Microsoft code samples.
00035
00036   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00037   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00038   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00039   PARTICULAR PURPOSE.
00040 ==========================================================================+*/
00041
00042 #if !defined(GUIBALL_H)
00043 #define GUIBALL_H
00044
00045 #if defined(__cplusplus)
00046
00047
00048 // Here are constants for the delays in millisecons that control
00049 // the incremental motion of the ball and how often a snapshot of
00050 // the ball image is painted.
00051 enum { BALL_PAINT_DELAY  = 33, BALL_MOVE_DELAY = 222 };
00052
00053 // A small utility struct providing an encapsulation of data needed when
00054 // worker threads are initialized.
00055 struct CThreadInitData
00056 {
00057   HWND     m_hWnd;
00058   IBall*   m_pIBall;
00059   DWORD    m_nDelay;
00060 };
00061
00062
00063 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00064   Class:    CGuiBall
00065
00066   Summary:  Class to encapsulate the displayable Graphical User
00067             Interface GUI Ball object.
00068
00069   Methods:  CGuiBall
00070               Constructor.
00071             ~CGuiBall
00072               Destructor.
00073             BOOL Init(HWND hWnd);
00074               Initialize the GuiBall.
00075             void PaintBall(void);
00076               Paint one image of the Ball.
00077             void Restart(void);
00078               Restart the process including clear window, move ball to
00079               start position, restart motion.
00080             void PaintWin(void);
00081               Repaint the window but don't restart motion.
00082 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00083 class CGuiBall
00084 {
00085   private:
00086     HWND     m_hWnd;
00087     IBall*   m_pIBall;
00088     COLORREF m_crColor;
00089
00090     // Pointers to thread init data structures.
00091     CThreadInitData m_BallThreadData1;
00092     CThreadInitData m_BallThreadData2;
00093     CThreadInitData m_BallThreadData3;
00094
00095   public:
00096     // Some member variables to store thread ids.
00097     DWORD m_dwBallThread1;
00098     DWORD m_dwBallThread2;
00099     DWORD m_dwBallThread3;
00100
00101     // An array of handles to the ball threads.
00102     HANDLE m_hBallThreads[3];
00103
00104     CGuiBall(void);
00105     ~CGuiBall(void);
00106     BOOL Init(HWND hWnd);
00107     void PaintBall(void);
00108     void Restart(void);
00109     void PaintWin(void);
00110 };
00111
00112
00113 #endif // __cplusplus
00114
00115 #endif
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/basesnap.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

basesnap.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  Abstract: This module provides the basic COM and DLL methods to create
00015 //            and load the Snap-in.  IClassFactory::CreateInstance creates
00016 //            an instance of a class whose type is passed in the constructor
00017 //
00018
00019
00020 #ifndef _BASESNAP_H_
00021 #define _BASESNAP_H_
00022
00023 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj);
00024 STDAPI DllCanUnloadNow(void);
00025
00026 //---------------------------------------------------------------------------
00027 class CClassFactory : public IClassFactory
00028 {
00029   public:
00030     enum FACTORY_TYPE {COMPONENTDATA = 0, ABOUT = 1};
00031
00032   public:
00033     CClassFactory(FACTORY_TYPE eFactoryType);
00034     ~CClassFactory();
00035
00036     STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv);
00037     STDMETHODIMP_(ULONG) AddRef();
00038     STDMETHODIMP_(ULONG) Release();
00039
00040     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID*);
00041     STDMETHODIMP LockServer(BOOL);
00042
00043   private:
00044     ULONG         m_cRef;
00045     FACTORY_TYPE  m_FactoryType;
00046
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/SimpleClient/StdAfx.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • SimpleClient

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002
00003 //  WbemClient.pch will be the pre-compiled header
00004
00005 //  stdafx.obj will contain the pre-compiled type information
00006
00007 //
00008
00009 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00010
00011 #include "stdafx.h"
00012
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DComDraw/GUIPAPER.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DComDraw

GUIPAPER.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GUIPAPER.H
00003
00004   Summary:   Include file for the CGuiPaper C++ class. A GuiPaper is a C++
00005              object that displays and stores mouse movements as free-form
00006              line drawing or "scribbling" in the client area of a
00007              designated window. GuiPaper is anchored to the Windows GUI
00008              (Graphical User Interface) environment. This GuiPaper object
00009              relies on a virtual Paper object that is instantiated as a
00010              COM object (a COPaper) in a separate out-of-process server,
00011              DCDSERVE, to store the "ink" data that is drawn.
00012
00013              For a comprehensive tutorial code tour of GUIPAPER's contents
00014              and offerings see the tutorial DCOMDRAW.HTM file. For
00015              more specific technical details on the internal workings see
00016              the comments dispersed throughout the GUIPAPER source code.
00017
00018   Classes:   CGuiPaper.
00019
00020   Origin:    8-23-97: atrent - Editor inheritance from GUIBALL.H in the
00021              CONCLIEN source. [Revised]
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037 #if !defined(GUIPAPER_H)
00038 #define GUIPAPER_H
00039
00040 #if defined(__cplusplus)
00041
00042
00043 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00044   Class:    CGuiPaper
00045
00046   Summary:  Class to encapsulate the displayable Graphical User Interface
00047             GUI Paper object.
00048
00049   Methods:  CGuiPaper
00050               Constructor.
00051             ~CGuiPaper
00052               Destructor.
00053             BOOL Init(HINSTANCE hInst, HWND hWnd);
00054               Initialize the GuiPaper.
00055             HRESULT SetPenCur(USHORT usPenCurNew);
00056               Set the pen width and pen On/Off.
00057             HRESULT Lock(BOOL bLock);
00058               Lock or unlock paper for drawing. Master client has lock.
00059             BOOL    Master(void);
00060               Return TRUE if this client is the owning master client.
00061             HRESULT ResizeWin(LONG lWidth, LONG lHeight);
00062               Resize the display window.
00063             HRESULT ClearWin(void);
00064               Clear display window but retain ink data.
00065             HRESULT PaintWin(void);
00066               Clear window and Repaint the window with ink data.
00067             HRESULT Erase(void);
00068               Erase current drawn content and clear display window.
00069             HRESULT Resize(LONG lWidth, LONG lHeight);
00070               Resize the display rectangle of the drawing.
00071             HRESULT InkWidth(SHORT nInkWidth);
00072               Set current ink line width for drawing.
00073             HRESULT InkColor(COLORREF crInkColor);
00074               Set current ink color for drawing.
00075             HRESULT InkStart(SHORT nX, SHORT nY);
00076               Start ink drawing sequence.
00077             HRESULT InkDraw(SHORT nX, SHORT nY);
00078               Draw ink sequence data.
00079             HRESULT InkStop(SHORT nX, SHORT nY);
00080               Stop ink drawing sequence.
00081             HRESULT ConnectPaperSink(void);
00082               Connect the PaperSink to the server COPaper source.
00083             HRESULT DisconnectPaperSink(void);
00084               Disconnect the PaperSink from the server COPaper source.
00085             HRESULT Load(void);
00086               Load ink data from current compound file (local or remote).
00087             HRESULT LoadLocal(void);
00088               Unload current drawing and Load drawing from local
00089               DCDSERVE server.
00090             HRESULT LoadRemote(void);
00091               Unload current drawing paper and reload from a DCDSERVE
00092               located on a remote machine. User gives remote machine
00093               name in a dialog.
00094             HRESULT Save(void);
00095               Save existing Ink Data to current compound file.
00096             INT AskSave(void);
00097               Check if new ink data, ask user, save if user says to.
00098             COLORREF PickColor(void);
00099               Common dialog. Ask user to choose new pen color.
00100 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00101 class CGuiPaper
00102 {
00103   public:
00104     CGuiPaper(void);
00105     ~CGuiPaper(void);
00106     BOOL Init(HINSTANCE hInst, HWND hWnd);
00107     HRESULT SetPenCur(USHORT usPenCurNew);
00108     HRESULT Lock(BOOL bLock);
00109     BOOL    Master(void);
00110     HRESULT ResizeWin(LONG lWidth, LONG lHeight);
00111     HRESULT ClearWin(void);
00112     HRESULT PaintWin(void);
00113     HRESULT Erase(void);
00114     HRESULT Resize(LONG lWidth, LONG lHeight);
00115     HRESULT InkWidth(SHORT nInkWidth);
00116     HRESULT InkColor(COLORREF crInkColor);
00117     HRESULT InkStart(SHORT nX, SHORT nY);
00118     HRESULT InkDraw(SHORT nX, SHORT nY);
00119     HRESULT InkStop(SHORT nX, SHORT nY);
00120     HRESULT ConnectPaperSink(void);
00121     HRESULT DisconnectPaperSink(void);
00122     HRESULT Load(void);
00123     HRESULT LoadLocal(void);
00124     HRESULT LoadRemote(void);
00125     HRESULT Save(void);
00126     INT     AskSave(void);
00127     COLORREF PickColor(void);
00128
00129   private:
00130     HINSTANCE    m_hInst;
00131     HWND         m_hWnd;
00132     HDC          m_hDC;
00133     RECT         m_WinRect;
00134     ISharePaper* m_pISharePaper;
00135     HPEN         m_hPen;
00136     USHORT       m_PenCur;
00137     HCURSOR      m_hPenCurN;
00138     HCURSOR      m_hPenCurT;
00139     HCURSOR      m_hPenCurM;
00140     HCURSOR      m_hPenCurF;
00141     SHORT        m_nInkWidth;
00142     COLORREF     m_crInkColor;
00143     BOOL         m_bLocked;
00144     BOOL         m_bInkSaving;
00145     BOOL         m_bInking;
00146     BOOL         m_bPainting;
00147     POINT        m_OldPos;
00148     IUnknown*    m_pCOPaperSink;
00149     DWORD        m_dwPaperSink;
00150     BOOL         m_bDirty;
00151     CHOOSECOLOR  m_ChooseColor;
00152     COLORREF     m_acrCustColors[16];
00153
00154     IConnectionPoint* GetConnectionPoint(REFIID riid);
00155 };
00156
00157
00158 #endif // __cplusplus
00159
00160 #endif
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/Helper/DatabaseSettings.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • Helper

DatabaseSettings.java

Go to the documentation of this file.
00001 package helper;
00002 public interface DatabaseSettings
00003 {
00004   //Database related constants
00005   public static String DSN  = "QCSample";
00006   public static String User = "sa";
00007   public static String Pass = "";
00008 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00025 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00026
00027
00028 //==============================================================
00029 //
00030 // CDelegationBase implementation
00031 //
00032 //
00033 CDelegationBase::CDelegationBase()
00034 : bExpanded(FALSE), m_handle(NULL)
00035 {
00036     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00037         LoadBitmaps();
00038 }
00039
00040 CDelegationBase::~CDelegationBase()
00041 {
00042 }
00043
00044 // CDelegationBase::AddImages sets up the collection of images to be displayed
00045 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00046 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00047 {
00048     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00049         (long *)m_pBMapLg, // pointer to a handle
00050         0, // index of the first image in the strip
00051         RGB(0, 128, 128)  // color of the icon mask
00052         );
00053 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/fileio.h Source File

  • Dataaccess
  • oledb
  • sampprov

fileio.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module FILEIO.H | Class Definitions for CFileIO Class
00008 //
00009 //
00010 #ifndef _FILEIO_H_
00011 #define _FILEIO_H_
00012
00013 #include <fstream.h>
00014 #include "fileidx.h"
00015 #include "hashtbl.h"
00016
00017 #define MAX_INPUT_BUFFER 2048
00018 #define MAX_COLUMNS 129   // 128 columns supported, but 1 extra
00019               // is needed since 1 based.
00020
00021 enum UPDTYPE {UPDATE, INSERT};
00022
00023 //--------------------------------------------------------------------
00024 // @class CFileIO | Opens and manipulates a given CSV file.  Allows
00025 // deletions, reads, and updates.
00026 //
00027 // @hungarian
00028 //
00029 class CFileIO : public fstream    //@base public | fstream
00030 {
00031 private: //@access private
00032   //@cmember Count of rows in the table
00033   DBCOUNTITEM   m_cRows;
00034   //@cmember Count of columns in the table
00035   DBORDINAL   m_cColumns;
00036   //@cmember Pointer to Column Names buffer
00037   LPTSTR      m_pColNames;
00038   //@cmember Array of pointers into the Column Names buffer
00039   LPTSTR      m_rgpColNames[MAX_COLUMNS];
00040   //@cmember Array of Column Data Types
00041   SWORD     m_rgswColType[MAX_COLUMNS];
00042   //@cmember Array of Precision values for columns
00043   UDWORD      m_rgudwColSize[MAX_COLUMNS];
00044   //@cmember True if columns contains signed values
00045   BOOL      m_rgfSigned[MAX_COLUMNS];
00046   //@cmember Array of pointers to Data
00047   PCOLUMNDATA   m_rgpColumnData[MAX_COLUMNS];
00048   //@cmember Array of Lengths for the data
00049   SDWORD      m_rgsdwMaxLen[MAX_COLUMNS];
00050   //@cmember Input buffer of size MAX_INPUT_BUFFER
00051   LPTSTR      m_pvInput;
00052   //@cmember Offset into file for DataTypes
00053   ULONG     m_ulDataTypeOffset;
00054   //@cmember Index Class declaration
00055   CFileIdx    m_FileIdx;
00056   //@cmember If the File is ReadOnly
00057   BOOL      m_FileReadOnly;
00058   //@cmember Array of DBCOLUMNINFO
00059   DBCOLUMNINFO  m_rgdbcolinfo[MAX_COLUMNS];
00060   //@cmember Array of column offsets used to interpret a rowbuffer
00061   DBLENGTH    m_rgdwDataOffsets[MAX_COLUMNS];
00062   //@cmember Pointer to Info Array Heap (heap of column name strings)
00063   BYTE *      m_pbHeap;
00064   //@cmember how many bytes of the column names heap is in use
00065   ULONG       m_cbHeapUsed;
00066   //@cmember size of row data for this file
00067   DBLENGTH      m_cbRowSize;
00068
00069 private: //@access private
00070   //@cmember Break a stream into column names
00071   HRESULT ParseColumnNames(LPTSTR ptstrInput);
00072   //@cmember Break a stream into MetaData information
00073   HRESULT ParseDataTypes();
00074   //@cmember Control procedure to Read and parse intitial
00075   //information from the file
00076   HRESULT GenerateFileInfo();
00077   //@cmember Fill the COLUMNDATA structure
00078   HRESULT CFileIO::FillBinding(DBORDINAL cColumn, LPTSTR pvCopy);
00079
00080
00081 public: //@access public
00082   //@cmember Constructor
00083   CFileIO(void);
00084   //@cmember Destructor
00085   ~CFileIO(void);
00086   //@cmember Initialization routine
00087   HRESULT fInit(LPTSTR pstrFileName);
00088   //@cmember Return the number of columns in the file
00089   inline DBORDINAL GetColumnCnt() { return m_cColumns; };
00090   //@cmember Return the number of rows in the file
00091   inline DBCOUNTITEM GetRowCnt() { return m_cRows; };
00092   //@cmember Determines if the rowset is ReadOnly
00093   inline BOOL IsReadOnly() { return m_FileReadOnly; };
00094   //@cmember Return the columninfo array
00095   inline DBCOLUMNINFO * GetColInfo() { return m_rgdbcolinfo; };
00096   //@cmember Return the column name heap
00097   inline BYTE * GetColNameHeap() { return m_pbHeap; };
00098   //@cmember Return the column name heap size
00099   inline ULONG GetColNameHeapSize() { return m_cbHeapUsed; };
00100   //@cmember Return row data size for this file
00101   inline DBLENGTH GetRowSize() { return m_cbRowSize; };
00102   //@cmember Retrieve pointers to the columns names
00103   HRESULT GetColumnName(DBORDINAL cCols, LPTSTR* pptstrName = NULL);
00104   //@cmember Retrieve the metadata for a particular column
00105   HRESULT GetDataTypes(DBORDINAL cCols, SWORD* pswType, UDWORD* pudwColDef, BOOL* pfSigned);
00106   //@cmember Set the Binding Areas.
00107   HRESULT SetColumnBind(DBORDINAL cCols, PCOLUMNDATA pColumn);
00108   //@cmember Extract the data from a stream
00109   HRESULT ParseRowValues();
00110   //@cmember Fetch A single rows data values
00111   HRESULT Fetch(DBCOUNTITEM ulRow);
00112   //@cmember Update the current rows values
00113   HRESULT UpdateRow(DBCOUNTITEM ulRow, BYTE* pbProvRow, UPDTYPE eUpdateType);
00114   //@cmember Remove the specified row from the file
00115   HRESULT DeleteRow(DBCOUNTITEM ulRow);
00116   //@cmember Determines if the row has already been deleted
00117   HRESULT IsDeleted(DBCOUNTITEM ulRow);
00118   //@cmember Gathers information that both the CCommand and CRowset objects use
00119   HRESULT GatherColumnInfo();
00120   //@cmember Return a ptr to a COLUMNDATA struct
00121   COLUMNDATA * GetColumnData(DBORDINAL cCols, ROWBUFF * pRowBuff);
00122 };
00123
00124 typedef CFileIO FAR * PCFILEIO;
00125
00126 #endif
00127
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcwin.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcwin.h

Go to the documentation of this file.
00001 // rtcwin.h
00002 //
00003
00004 #ifndef _RTCWIN_H_
00005 #define _RTCWIN_H_
00006
00007 // RTC events will be posted to the message queue with
00008 // this user defined window message
00009 #define WM_RTC_EVENT      WM_USER+100
00010
00011 class CRTCEvents;
00012 class CRTCSession;
00013
00014 // Class for the application window
00015 class CRTCWin
00016 {
00017 public:
00018     CRTCWin();
00019     ~CRTCWin();
00020
00021     // Registers the window class
00022     static HRESULT RegisterClass();
00023
00024     // Window procedure
00025     static LRESULT CALLBACK WindowProc(
00026         HWND hWnd,      // handle to window
00027         UINT uMsg,      // message identifier
00028         WPARAM wParam,  // first message parameter
00029         LPARAM lParam   // second message parameter
00030         );
00031
00032     // Remove a session from the session list
00033     HRESULT RemoveSession(
00034         CRTCSession * pSessWindow
00035         );
00036
00037     // Get the local user URI
00038     HRESULT GetUserURI(BSTR *pbstrURI);
00039
00040 private:
00041
00042     HWND    m_hWnd;
00043     HWND    m_hStatusBar;
00044     HWND    m_hBuddyList;
00045
00046     IRTCClient * m_pClient;
00047     IRTCProfile * m_pProfile;
00048     CRTCEvents * m_pEvents;
00049     RTC_REGISTRATION_STATE m_enState;
00050     BOOL m_fPresenceEnabled;
00051
00052     std::vector<CRTCSession *> m_SessionList;
00053
00054     // Helpers
00055     void ShowMessageBox(PWSTR szText);
00056     void SetStatusText(PWSTR szText);
00057
00058     // Add a session to the session list
00059     HRESULT AddSession(
00060         IRTCSession * pSession,
00061         RTC_SESSION_TYPE enType
00062         );
00063
00064     // Find a session in the session list
00065     HRESULT FindSession(
00066         IRTCSession * pSession,
00067         CRTCSession ** ppSessWindow
00068         );
00069
00070     // Cleanup the session list
00071     HRESULT CleanupSessions();
00072
00073     // Update a buddy entry in the buddy list
00074     HRESULT UpdateBuddyList(IRTCBuddy * pBuddy);
00075
00076     // Clear the buddy list
00077     HRESULT ClearBuddyList();
00078
00079     // Logon
00080     HRESULT DoLogOn(BSTR bstrURI, BSTR bstrServer, BSTR bstrTransport);
00081     HRESULT OnLoggingOn();
00082     HRESULT OnLoggedOn();
00083
00084     // Logoff
00085     HRESULT DoLogOff();
00086     HRESULT OnLoggingOff();
00087     HRESULT OnLoggedOff();
00088
00089     // Authentication
00090     HRESULT DoAuth(BSTR bstrURI, BSTR bstrAccount, BSTR bstrPassword);
00091
00092     // Enable presence
00093     HRESULT DoEnablePresence(BOOL fEnable);
00094
00095     // Generate provisioning XML profile
00096     HRESULT DoGenerateProvisioning(BSTR bstrURI, BSTR bstrServer,
00097                                    BSTR bstrTransport, BSTR *pbstrXML);
00098
00099     // Add a buddy
00100     HRESULT DoAddBuddy(BSTR bstrURI, BSTR bstrName);
00101
00102     // Remove a buddy
00103     HRESULT DoRemoveBuddy(IRTCBuddy *pBuddy);
00104
00105     // Place a call (AV or IM)
00106     HRESULT DoCall(RTC_SESSION_TYPE enType, BSTR bstrURI);
00107
00108     // Start the tuning wizard
00109     HRESULT DoTuningWizard();
00110
00111     // Set local presence status
00112     HRESULT DoSetPresence(RTC_PRESENCE_STATUS enStatus);
00113
00114     // Window message handlers
00115     LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam);
00116     LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam);
00117     LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam);
00118     LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam);
00119     LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam);
00120     LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam);
00121     LRESULT OnRTCEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
00122
00123     // RTC event handlers
00124     void OnRTCRegistrationStateChangeEvent(
00125                 IRTCRegistrationStateChangeEvent *pEvent
00126                 );
00127
00128     void OnRTCSessionStateChangeEvent(
00129                 IRTCSessionStateChangeEvent *pEvent
00130                 );
00131
00132     void OnRTCParticipantStateChangeEvent(
00133                 IRTCParticipantStateChangeEvent *pEvent
00134                 );
00135
00136     void OnRTCMessagingEvent(
00137                 IRTCMessagingEvent *pEvent
00138                 );
00139
00140     void OnRTCMediaEvent(
00141                 IRTCMediaEvent *pEvent
00142                 );
00143
00144     void OnRTCIntensityEvent(
00145                 IRTCIntensityEvent *pEvent
00146                 );
00147
00148     void OnRTCClientEvent(
00149                 IRTCClientEvent *pEvent
00150                 );
00151
00152     void OnRTCBuddyEvent(
00153                 IRTCBuddyEvent *pEvent
00154                 );
00155
00156     void OnRTCWatcherEvent(
00157                 IRTCWatcherEvent *pEvent
00158                 );
00159 };
00160
00161 #endif //_RTCWIN_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/StdAfx.h Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

StdAfx.h

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 // stdafx.h : include file for standard system include files,
00003 //  or project specific include files that are used frequently, but
00004 //      are changed infrequently
00005 //
00006
00007 #if !defined(AFX_STDAFX_H__7DD9207B_0510_11D1_AD84_00AA00B8E05A__INCLUDED_)
00008 #define AFX_STDAFX_H__7DD9207B_0510_11D1_AD84_00AA00B8E05A__INCLUDED_
00009
00010 #if _MSC_VER >= 1000
00011 #pragma once
00012 #endif // _MSC_VER >= 1000
00013 //#undef _AFX_NO_BSTR_SUPPORT
00014 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00015
00016 #include <afxwin.h>         // MFC core and standard components
00017 #include <afxext.h>         // MFC extensions
00018 #ifndef _AFX_NO_AFXCMN_SUPPORT
00019 #include <afxcmn.h>     // MFC support for Windows Common Controls
00020 #endif // _AFX_NO_AFXCMN_SUPPORT
00021
00022
00023 //{{AFX_INSERT_LOCATION}}
00024 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00025
00026 #endif // !defined(AFX_STDAFX_H__7DD9207B_0510_11D1_AD84_00AA00B8E05A__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagLISTPROP Member List

This is the complete list of members for _tagLISTPROP, including all inherited members.
lpbyBuf _tagLISTPROP
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CWiaDataCallback Member List

This is the complete list of members for CWiaDataCallback, including all inherited members.
AddRef() | CWiaDataCallback | [inline]
BandedDataCallback(LONG lMessage, LONG lStatus, LONG lPercentComplete, LONG lOffset, LONG lLength, LONG lReserved, LONG lResLength, BYTE *pbBuffer) | CWiaDataCallback | [inline]
CWiaDataCallback(const CWiaDataCallback &) | CWiaDataCallback | [private]
CWiaDataCallback() | CWiaDataCallback | [inline]
m_cRef | CWiaDataCallback | [private]
operator=(const CWiaDataCallback &) | CWiaDataCallback | [private]
QueryInterface(REFIID riid, void **ppvObject) | CWiaDataCallback | [inline]
Release() | CWiaDataCallback | [inline]
~CWiaDataCallback() | CWiaDataCallback | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/CopyHook.Cpp Source File

  • WinUI
  • Shell
  • ShellExt

CopyHook.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   copyhook.cpp
00009 //
00010 //  PURPOSE:   Implements the ICopyHook member functions necessary to support
00011 //             the copy hook portioins of this shell extension.
00012 //             Copy hook handlers are called each time a folder is copied, moved,
00013 //             renamed, etc. in the system.  Note that the CopyCallback is NOT
00014 //             called for each file, but only for entire folders.
00015 //
00016
00017 #include "priv.h"
00018 #include "shellext.h"
00019
00020
00021 //
00022 //  FUNCTION: CShellExt::CopyCallback(HWND,
00023 //                                    UINT,
00024 //                                    UINT,
00025 //                                    LPCSTR,
00026 //                                    DWORD,
00027 //                                    LPCSTR,
00028 //                                    DWORD)
00029 //
00030 //  PURPOSE: Called by the shell when a folder is being manipulated.
00031 //
00032 //  PARAMETERS:
00033 //    hwnd          - Window handle to use for any UI stuff
00034 //    wFunc         - what operation is being done
00035 //    wFlags        - and flags (FOF_*) set in the initial call
00036 //                    to the file operation
00037 //    pszSrcFile    - name of the source file
00038 //    dwSrcAttribs  - file attributes of the source file
00039 //    pszDestFile   - name of the destiation file (for move and renames)
00040 //    dwDestAttribs - file attributes of the destination file
00041 //
00042 //  RETURN VALUE:
00043 //
00044 //    IDYES    - allow the operation
00045 //    IDNO     - disallow the operation on this file, but continue with
00046 //               any other operations (eg. batch copy)
00047 //    IDCANCEL - disallow the current operation and cancel any pending
00048 //               operations
00049 //
00050 //  COMMENTS:
00051 //
00052
00053 STDMETHODIMP_(UINT) CShellExt::CopyCallback(HWND hwnd,
00054                                             UINT wFunc,
00055                                             UINT wFlags,
00056                                             LPCSTR pszSrcFile,
00057                                             DWORD dwSrcAttribs,
00058                                             LPCSTR pszDestFile,
00059                                             DWORD dwDestAttribs)
00060 {
00061     ODS("CShellExt::CopyCallback\r\n");
00062
00063     MessageBox(NULL, "CopyCallback!", "SHELLEXT", MB_OK);
00064
00065     return IDYES;
00066 }
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share Sample/File Share Sample.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share Sample

File Share Sample.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      File Share Sample.cpp
00007 //
00008 //  Description:
00009 //      Resource DLL for File Share Sample (File Share Sample).
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 #include "ClRes.h"
00021 #include <lmerr.h>
00022 #include <lmshare.h>
00023 #include <LMAPIbuf.h>
00024
00025 //
00026 // Type and constant definitions.
00027 //
00028
00029 #define CLUSCTL_RESOURCE_FILESHARESAMPLE_CALL_ISALIVE   CLUSCTL_USER_CODE( 1, CLUS_OBJECT_RESOURCE )
00030
00031 // ADDPARAM: Add new properties here.
00032 #define PROP_NAME__SHARENAME L"ShareName"
00033 #define PROP_NAME__PATH L"Path"
00034 #define PROP_NAME__REMARK L"Remark"
00035 #define PROP_NAME__MAXUSERS L"MaxUsers"
00036
00037 #define PROP_MIN__MAXUSERS      (0)
00038 #define PROP_MAX__MAXUSERS      (4294967295)
00039 #define PROP_DEFAULT__MAXUSERS  (4294967295)
00040
00041 // ADDPARAM: Add new properties here.
00042 typedef struct _FILESHARESAMPLE_PROPS
00043 {
00044     PWSTR           pwszShareName;
00045     PWSTR           pwszPath;
00046     PWSTR           pwszRemark;
00047     DWORD           nMaxUsers;
00048 } FILESHARESAMPLE_PROPS, * PFILESHARESAMPLE_PROPS;
00049
00050 typedef struct _FILESHARESAMPLE_RESOURCE
00051 {
00052     RESID                   resid;          // For validation.
00053     FILESHARESAMPLE_PROPS   propsActive;    // The active props.  Used for program flow and control when the resource is online.
00054     FILESHARESAMPLE_PROPS   props;          // The props in cluster DB.  May differ from propsActive until OnlineThread reloads them as propsActive.
00055     HCLUSTER                hCluster;
00056     HRESOURCE               hResource;
00057     HKEY                    hkeyParameters;
00058     RESOURCE_HANDLE         hResourceHandle;
00059     LPWSTR                  pwszResourceName;
00060     LPWSTR                  pwszComputerName;   // The current node name.
00061     LPWSTR                  pwszExpandedPath;   // The expanded path (in case there were env. variables embedded).
00062     LPWSTR                  pwszUNCSharedPath;  // UNC path to our share - used to test for aliveness.
00063     CLUS_WORKER             cwWorkerThread;
00064     CLUSTER_RESOURCE_STATE  state;
00065     BOOL                    fIsAliveFailed;
00066 } FILESHARESAMPLE_RESOURCE, * PFILESHARESAMPLE_RESOURCE;
00067
00068
00069 ///////////////////////////////////////////////////////////////////////////////
00070 // Global data.
00071 ///////////////////////////////////////////////////////////////////////////////
00072
00073 //
00074 //  Forward reference to our RESAPI function table.
00075 //
00076
00077 extern CLRES_FUNCTION_TABLE g_FileShareSampleFunctionTable;
00078
00079
00080 //
00081 // File Share Sample resource read-write private properties.
00082 //
00083
00084 RESUTIL_PROPERTY_ITEM
00085 FileShareSampleResourcePrivateProperties[] =
00086 {
00087     { PROP_NAME__SHARENAME, NULL, CLUSPROP_FORMAT_SZ, 0, 0, 0, RESUTIL_PROPITEM_REQUIRED, FIELD_OFFSET( FILESHARESAMPLE_PROPS, pwszShareName ) },
00088     { PROP_NAME__PATH, NULL, CLUSPROP_FORMAT_EXPAND_SZ, 0, 0, 0, RESUTIL_PROPITEM_REQUIRED, FIELD_OFFSET( FILESHARESAMPLE_PROPS, pwszPath ) },
00089     { PROP_NAME__REMARK, NULL, CLUSPROP_FORMAT_SZ, 0, 0, 0, 0, FIELD_OFFSET( FILESHARESAMPLE_PROPS, pwszRemark ) },
00090     { PROP_NAME__MAXUSERS, NULL, CLUSPROP_FORMAT_DWORD, PROP_DEFAULT__MAXUSERS, PROP_MIN__MAXUSERS, PROP_MAX__MAXUSERS, 0, FIELD_OFFSET( FILESHARESAMPLE_PROPS, nMaxUsers ) },
00091     { 0 }
00092 };
00093
00094
00095 //
00096 // Function prototypes.
00097 //
00098
00099 RESID WINAPI
00100 FileShareSampleOpen(
00101       LPCWSTR           pwszResourceNameIn
00102     , HKEY              hkeyResourceKeyIn
00103     , RESOURCE_HANDLE   hResourceHandleIn
00104     );
00105
00106 void WINAPI
00107 FileShareSampleClose(
00108     RESID residIn
00109     );
00110
00111 DWORD WINAPI
00112 FileShareSampleOnline(
00113       RESID     residIn
00114     , PHANDLE   phEventHandleInout
00115     );
00116
00117 DWORD WINAPI
00118 FileShareSampleOnlineThread(
00119       PCLUS_WORKER              pWorkerIn
00120     , PFILESHARESAMPLE_RESOURCE pResourceEntryIn
00121     );
00122
00123 DWORD WINAPI
00124 FileShareSampleOffline(
00125     RESID residIn
00126     );
00127
00128 DWORD WINAPI
00129 FileShareSampleOfflineThread(
00130       PCLUS_WORKER              pWorkerIn
00131     , PFILESHARESAMPLE_RESOURCE pResourceEntryIn
00132     );
00133
00134 void WINAPI
00135 FileShareSampleTerminate(
00136     RESID residIn
00137     );
00138
00139 BOOL WINAPI
00140 FileShareSampleLooksAlive(
00141     RESID residIn
00142     );
00143
00144 BOOL WINAPI
00145 FileShareSampleIsAlive(
00146     RESID residIn
00147     );
00148
00149 BOOL
00150 FileShareSampleCheckIsAlive(
00151       PFILESHARESAMPLE_RESOURCE pResourceEntryIn
00152     , BOOL                      fFullCheckIn
00153     );
00154
00155 DWORD WINAPI
00156 FileShareSampleResourceControl(
00157       RESID     residIn
00158     , DWORD     nControlCodeIn
00159     , PVOID     pInBufferIn
00160     , DWORD     cbInBufferSizeIn
00161     , PVOID     pOutBufferOut
00162     , DWORD     cbOutBufferSizeIn
00163     , LPDWORD   pcbBytesReturnedOut
00164     );
00165
00166 DWORD WINAPI
00167 FileShareSampleResourceTypeControl(
00168       LPCWSTR   pwszResourceTypeNameIn
00169     , DWORD     nControlCodeIn
00170     , PVOID     pInBufferIn
00171     , DWORD     cbInBufferSizeIn
00172     , PVOID     pOutBufferOut
00173     , DWORD     cbOutBufferSizeIn
00174     , LPDWORD   pcbBytesReturnedOut
00175     );
00176
00177 DWORD
00178 FileShareSampleGetPrivateResProperties(
00179       PFILESHARESAMPLE_RESOURCE pResourceEntryIn
00180     , PVOID                     pOutBufferOut
00181     , DWORD                     cbOutBufferSizeIn
00182     , LPDWORD                   pcbBytesReturnedOut
00183     );
00184
00185 DWORD
00186 FileShareSampleValidatePrivateResProperties(
00187       PFILESHARESAMPLE_RESOURCE pResourceEntryIn
00188     , const PVOID               pInBufferIn
00189     , DWORD                     cbInBufferSizeIn
00190     , PFILESHARESAMPLE_PROPS    pPropsOut
00191     );
00192
00193 DWORD
00194 FileShareSampleSetPrivateResProperties(
00195       PFILESHARESAMPLE_RESOURCE pResourceEntryIn
00196     , const PVOID               pInBufferIn
00197     , DWORD                     cbInBufferSizeIn
00198     );
00199
00200 DWORD
00201 FileShareSampleSetNameHandler(
00202       PFILESHARESAMPLE_RESOURCE pResourceEntryIn
00203     , LPWSTR                    pwszNameIn
00204     );
00205
00206
00207 /////////////////////////////////////////////////////////////////////////////
00208 //++
00209 //
00210 //  FileShareSampleDllMain
00211 //
00212 //  Description:
00213 //      Main DLL entry point for the File Share Sample resource type.
00214 //
00215 //  Arguments:
00216 //      hDllHandleIn
00217 //          DLL instance handle.
00218 //
00219 //      nReasonIn
00220 //          Reason for being called.
00221 //
00222 //      ReservedIn
00223 //          Reserved argument.
00224 //
00225 //  Return Value:
00226 //      TRUE
00227 //          Success.
00228 //
00229 //      FALSE
00230 //          Failure.
00231 //
00232 //--
00233 /////////////////////////////////////////////////////////////////////////////
00234 BOOL WINAPI
00235 FileShareSampleDllMain(
00236       HINSTANCE hDllHandleIn
00237     , DWORD     nReasonIn
00238     , LPVOID    ReservedIn
00239     )
00240 {
00241     BOOL    fSuccess = TRUE;
00242
00243     UNREFERENCED_PARAMETER( hDllHandleIn );
00244     UNREFERENCED_PARAMETER( ReservedIn );
00245
00246     switch ( nReasonIn )
00247     {
00248         case DLL_PROCESS_ATTACH:
00249             break;
00250
00251         case DLL_PROCESS_DETACH:
00252             break;
00253
00254     } // switch: nReason
00255
00256     return fSuccess;
00257
00258 } //*** FileShareSampleDllMain
00259
00260
00261 /////////////////////////////////////////////////////////////////////////////
00262 //++
00263 //
00264 //  FileShareSampleStartup
00265 //
00266 //  Description:
00267 //      Startup the resource DLL for the File Share Sample resource type.
00268 //      This routine verifies that at least one currently supported version
00269 //      of the resource DLL is between nMinVersionSupported and
00270 //      nMaxVersionSupported. If not, then the resource DLL should return
00271 //      ERROR_REVISION_MISMATCH.
00272 //
00273 //      If more than one version of the resource DLL interface is supported
00274 //      by the resource DLL, then the highest version (up to
00275 //      nMaxVersionSupported) should be returned as the resource DLL's
00276 //      interface. If the returned version is not within range, then startup
00277 //      fails.
00278 //
00279 //      The Resource Type is passed in so that if the resource DLL supports
00280 //      more than one Resource Type, it can pass back the correct function
00281 //      table associated with the Resource Type.
00282 //
00283 //  Arguments:
00284 //      pwszResourceTypeIn
00285 //          Type of resource requesting a function table.
00286 //
00287 //      nMinVersionSupportedIn
00288 //          Minimum resource DLL interface version supported by the cluster
00289 //          software.
00290 //
00291 //      nMaxVersionSupportedIn
00292 //          Maximum resource DLL interface version supported by the cluster
00293 //          software.
00294 //
00295 //      pfnSetResourceStatusIn
00296 //          Pointer to a routine that the resource DLL should call to update
00297 //          the state of a resource after the Online or Offline routine
00298 //          have returned a status of ERROR_IO_PENDING.
00299 //
00300 //      pfnLogEventIn
00301 //          Pointer to a routine that handles the reporting of events from
00302 //          the resource DLL.
00303 //
00304 //      pFunctionTableIn
00305 //          Returns a pointer to the function table defined for the version
00306 //          of the resource DLL interface returned by the resource DLL.
00307 //
00308 //  Return Value:
00309 //      ERROR_SUCCESS
00310 //          The operation was successful.
00311 //
00312 //      ERROR_CLUSTER_RESNAME_NOT_FOUND
00313 //          The resource type name is unknown by this DLL.
00314 //
00315 //      ERROR_REVISION_MISMATCH
00316 //          The version of the cluster service doesn't match the version of
00317 //          the DLL.
00318 //
00319 //      Win32 error code
00320 //          The operation failed.
00321 //
00322 //--
00323 /////////////////////////////////////////////////////////////////////////////
00324 DWORD WINAPI
00325 FileShareSampleStartup(
00326       LPCWSTR                       pwszResourceTypeIn
00327     , DWORD                         nMinVersionSupportedIn
00328     , DWORD                         nMaxVersionSupportedIn
00329     , PSET_RESOURCE_STATUS_ROUTINE  pfnSetResourceStatusIn
00330     , PLOG_EVENT_ROUTINE            pfnLogEventIn
00331     , PCLRES_FUNCTION_TABLE *       pFunctionTableOut
00332     )
00333 {
00334     DWORD sc = ERROR_SUCCESS;
00335
00336     // These are stored in the calling DllMain.
00337     UNREFERENCED_PARAMETER( pfnSetResourceStatusIn );
00338     UNREFERENCED_PARAMETER( pfnLogEventIn );
00339
00340     if (   (nMinVersionSupportedIn > CLRES_VERSION_V1_00)
00341         || (nMaxVersionSupportedIn < CLRES_VERSION_V1_00) )
00342     {
00343         sc = ERROR_REVISION_MISMATCH;
00344     } // if: version not supported
00345     else if ( NIStringCompareW( pwszResourceTypeIn, RESTYPE_NAME, RTL_NUMBER_OF( RESTYPE_NAME ) ) == 0 )
00346     {
00347         *pFunctionTableOut = &g_FileShareSampleFunctionTable;
00348         sc = ERROR_SUCCESS;
00349     } // else if: we support this type of resource
00350     else
00351     {
00352         //
00353         // We don't support this resource type.
00354         //
00355
00356         sc = ERROR_CLUSTER_RESNAME_NOT_FOUND;
00357     } // else: resource type name not supported
00358
00359     return sc;
00360
00361 } //*** FileShareSampleStartup
00362
00363
00364 /////////////////////////////////////////////////////////////////////////////
00365 //++
00366 //
00367 //  FileShareSampleOpen
00368 //
00369 //  Description:
00370 //      Open routine for File Share Sample resources.
00371 //
00372 //      Open the specified resource (create an instance of the resource).
00373 //      Allocate all structures necessary to bring the specified resource
00374 //      online.
00375 //
00376 //  Arguments:
00377 //      pwszResourceNameIn
00378 //          Supplies the name of the resource to open.
00379 //
00380 //      hkeyResourceKeyIn
00381 //                  Supplies handle to the resource's cluster database key.
00382 //
00383 //      hResourceHandleIn
00384 //          A handle that is passed back to the Resource Monitor when the
00385 //          SetResourceStatus or LogEvent method is called.  See the
00386 //          description of the pfnSetResourceStatus and pfnLogEvent arguments
00387 //          to the FileShareSampleStartup routine.  This handle should never be
00388 //          closed or used for any purpose other than passing it as an
00389 //          argument back to the Resource Monitor in the SetResourceStatus or
00390 //          LogEvent callbacks.
00391 //
00392 //  Return Value:
00393 //      resid
00394 //          RESID of opened resource.
00395 //
00396 //      NULL
00397 //          Error occurred opening the resource.  Resource Monitor may call
00398 //          GetLastError() to get more details on the error.
00399 //
00400 //--
00401 /////////////////////////////////////////////////////////////////////////////
00402 RESID WINAPI
00403 FileShareSampleOpen(
00404       LPCWSTR           pwszResourceNameIn
00405     , HKEY              hkeyResourceKeyIn
00406     , RESOURCE_HANDLE   hResourceHandleIn
00407     )
00408 {
00409     DWORD                   sc = ERROR_SUCCESS;
00410     size_t                  cchBuffer = 0;
00411     DWORD                   cchComputerName = 0;
00412     RESID                   resid = NULL;
00413     HKEY                    hkeyParameters = NULL;
00414     PFILESHARESAMPLE_RESOURCE pResourceEntry = NULL;
00415     HRESULT                 hr = S_OK;
00416
00417     //
00418     // Open the Parameters registry key for this resource.
00419     //
00420
00421     sc = ClusterRegOpenKey(
00422               hkeyResourceKeyIn
00423             , L"Parameters"
00424             , KEY_ALL_ACCESS
00425             , &hkeyParameters
00426             );
00427     if ( sc != ERROR_SUCCESS )
00428     {
00429         (g_pfnLogEvent)(
00430               hResourceHandleIn
00431             , LOG_ERROR
00432             , L"Open: Unable to open Parameters key. Error: %1!u!.\n"
00433             , sc
00434             );
00435         goto Cleanup;
00436     } // if: error creating the Parameters key for the resource
00437
00438     //
00439     // Allocate a resource entry.
00440     //
00441
00442     pResourceEntry = new FILESHARESAMPLE_RESOURCE;
00443     if ( pResourceEntry == NULL )
00444     {
00445         sc = GetLastError();
00446         (g_pfnLogEvent)(
00447               hResourceHandleIn
00448             , LOG_ERROR
00449             , L"Open: Unable to allocate resource entry structure. Error: %1!u!.\n"
00450             , sc
00451             );
00452         goto Cleanup;
00453     } // if: error allocating memory for the resource
00454
00455     //
00456     // Initialize the resource entry..
00457     //
00458
00459     ZeroMemory( pResourceEntry, sizeof( *pResourceEntry ) );
00460
00461     pResourceEntry->resid = static_cast< RESID >( pResourceEntry ); // for validation
00462     pResourceEntry->hResourceHandle = hResourceHandleIn;
00463     pResourceEntry->hkeyParameters = hkeyParameters;
00464     pResourceEntry->state = ClusterResourceOffline;
00465
00466     //
00467     // Save the name of the resource.
00468     //
00469
00470     cchBuffer = lstrlenW( pwszResourceNameIn ) + 1;
00471     pResourceEntry->pwszResourceName = new WCHAR[ cchBuffer ];
00472     if ( pResourceEntry->pwszResourceName == NULL )
00473     {
00474         sc = GetLastError();
00475         (g_pfnLogEvent)(
00476               hResourceHandleIn
00477             , LOG_ERROR
00478             , L"Open: Unable to allocate the resource name buffer. Error: %1!u!.\n"
00479             , sc
00480             );
00481         goto Cleanup;
00482     } // if: error allocating memory for the name.
00483
00484     hr = StringCchCopyW( pResourceEntry->pwszResourceName, cchBuffer, pwszResourceNameIn );
00485     if ( FAILED( hr ) )
00486     {
00487         sc = HRESULT_CODE( hr );
00488         (g_pfnLogEvent)(
00489               hResourceHandleIn
00490             , LOG_ERROR
00491             , L"Open: Unable to allocate the resource name buffer. Error: %1!u!.\n"
00492             , sc
00493             );
00494         goto Cleanup;
00495     } // if:
00496
00497     //
00498     // Open the cluster.
00499     //
00500
00501     pResourceEntry->hCluster = OpenCluster( NULL );
00502     if ( pResourceEntry->hCluster == NULL )
00503     {
00504         sc = GetLastError();
00505         (g_pfnLogEvent)(
00506               hResourceHandleIn
00507             , LOG_ERROR
00508             , L"Open: Unable to open the cluster. Error: %1!u!.\n"
00509             , sc
00510             );
00511         goto Cleanup;
00512     } // if: error opening the cluster
00513
00514     //
00515     // Open the resource.
00516     //
00517
00518     pResourceEntry->hResource = OpenClusterResource( pResourceEntry->hCluster, pwszResourceNameIn );
00519     if ( pResourceEntry->hResource == NULL )
00520     {
00521         sc = GetLastError();
00522         (g_pfnLogEvent)(
00523               hResourceHandleIn
00524             , LOG_ERROR
00525             , L"Open: Unable to open the resource. Error: %1!u!.\n"
00526             , sc
00527             );
00528         goto Cleanup;
00529     } // if: error opening the resource
00530
00531     //
00532     // Startup for the resource.
00533     //
00534
00535     //
00536     // Retrieve the computer name.
00537     //
00538
00539     cchComputerName = 0;
00540     GetComputerNameEx( ComputerNamePhysicalDnsHostname, NULL, &cchComputerName );
00541     sc = GetLastError();
00542     if ( sc != ERROR_MORE_DATA )
00543     {
00544         //
00545         // Something went wrong, we should've gotten ERROR_MORE_DATA.
00546         //
00547
00548         (g_pfnLogEvent)(
00549               hResourceHandleIn
00550             , LOG_ERROR
00551             , L"Open: failed to retrieve the computer name with error %1!u!.\n"
00552             , sc
00553             );
00554         goto Cleanup;
00555     } // if: GetComputerNameEx failed
00556
00557     pResourceEntry->pwszComputerName = new WCHAR[ cchComputerName ];
00558     if ( pResourceEntry->pwszComputerName == NULL )
00559     {
00560         sc = ERROR_OUTOFMEMORY;
00561         (g_pfnLogEvent)(
00562               hResourceHandleIn
00563             , LOG_ERROR
00564             , L"Open: failed to allocate computer name buffer with error %1!u!.\n"
00565             , sc
00566             );
00567         goto Cleanup;
00568     } // if: buffer allocation failed
00569
00570     if ( GetComputerNameEx(
00571                   ComputerNamePhysicalDnsHostname
00572                 , pResourceEntry->pwszComputerName
00573                 , &cchComputerName
00574                 ) == 0 )
00575     {
00576         sc = GetLastError();
00577         (g_pfnLogEvent)(
00578               hResourceHandleIn
00579             , LOG_ERROR
00580             , L"Open: failed to retrieve the computer name with error %1!u!.\n"
00581             , sc
00582             );
00583         goto Cleanup;
00584     } // if: GetComputerNameEx failed
00585
00586     resid = static_cast< RESID >( pResourceEntry );
00587
00588     sc = ERROR_SUCCESS;
00589
00590 Cleanup:
00591
00592     if ( resid == NULL )
00593     {
00594         assert( sc != ERROR_SUCCESS );
00595
00596         (g_pfnLogEvent)(
00597               hResourceHandleIn
00598             , LOG_ERROR
00599             , L"Open: failed with error %1!u!.\n"
00600             , sc
00601             );
00602
00603         if ( hkeyParameters != NULL )
00604         {
00605             ClusterRegCloseKey( hkeyParameters );
00606         } // if:
00607
00608         if ( pResourceEntry != NULL )
00609         {
00610             if ( pResourceEntry->hResource != NULL )
00611             {
00612                 CloseClusterResource( pResourceEntry->hResource );
00613             } // if:
00614
00615             if ( pResourceEntry->hCluster != NULL )
00616             {
00617                 CloseCluster( pResourceEntry->hCluster );
00618             } // if:
00619
00620             delete [] pResourceEntry->pwszResourceName;
00621             delete [] pResourceEntry->pwszComputerName;
00622             delete pResourceEntry;
00623
00624         } // if: resource entry allocated
00625     } // if: something failed
00626
00627     SetLastError( sc );
00628
00629     return resid;
00630
00631 } //*** FileShareSampleOpen
00632
00633
00634 /////////////////////////////////////////////////////////////////////////////
00635 //++
00636 //
00637 //  FileShareSampleClose
00638 //
00639 //  Description:
00640 //      Close routine for File Share Sample resources.
00641 //
00642 //      Close the specified resource and deallocate all structures, etc.,
00643 //      allocated in the Open call.  If the resource is not in the offline
00644 //      state, then the resource should be taken offline (by calling
00645 //      Terminate) before the close operation is performed.
00646 //
00647 //  Arguments:
00648 //      residIn
00649 //          Supplies the resource ID  of the resource to close.
00650 //
00651 //  Return Value:
00652 //      None.
00653 //
00654 //--
00655 /////////////////////////////////////////////////////////////////////////////
00656 void WINAPI
00657 FileShareSampleClose(
00658     RESID residIn
00659     )
00660 {
00661     PFILESHARESAMPLE_RESOURCE pResourceEntry = NULL;
00662     DWORD                   sc = ERROR_SUCCESS;
00663
00664     //
00665     // Verify we have a valid resource ID.
00666     //
00667
00668     pResourceEntry = static_cast< PFILESHARESAMPLE_RESOURCE >( residIn );
00669     if ( pResourceEntry == NULL )
00670     {
00671         DBG_PRINT( "FileShareSample: Close request for a nonexistent resource id.\n" );
00672         sc = ERROR_RESOURCE_NOT_FOUND;
00673         goto Cleanup;
00674     } // if: NULL resource ID
00675
00676     if ( pResourceEntry->resid != residIn )
00677     {
00678         (g_pfnLogEvent)(
00679               pResourceEntry->hResourceHandle
00680             , LOG_ERROR
00681             , L"Close resource sanity check failed! resid = 0x%1!08x!.\n"
00682             , residIn
00683             );
00684         sc = ERROR_RESOURCE_NOT_FOUND;
00685         goto Cleanup;
00686     } // if: invalid resource ID
00687
00688     if ( pResourceEntry->pwszResourceName == NULL )
00689     {
00690         (g_pfnLogEvent)(
00691               pResourceEntry->hResourceHandle
00692             , LOG_INFORMATION
00693             , L"Close request for resource with resid 0x%1!08x!.\n"
00694             , residIn
00695             );
00696     } // if: resource name is null...
00697     else
00698     {
00699         (g_pfnLogEvent)(
00700               pResourceEntry->hResourceHandle
00701             , LOG_INFORMATION
00702             , L"Close request for resource '%1!s!'.\n"
00703             , pResourceEntry->pwszResourceName
00704             );
00705     } // else: resource name is not null...
00706
00707     //
00708     // Close the Parameters key.
00709     //
00710
00711     if ( pResourceEntry->hkeyParameters != NULL )
00712     {
00713         ClusterRegCloseKey( pResourceEntry->hkeyParameters );
00714         pResourceEntry->hkeyParameters = NULL;
00715     } // if: parameters key is open
00716
00717     //
00718     // Close the cluster handle.
00719     //
00720
00721     if ( pResourceEntry->hCluster != NULL )
00722     {
00723         CloseCluster( pResourceEntry->hCluster );
00724         pResourceEntry->hCluster = NULL;
00725     } // if: cluster handle is open
00726
00727     //
00728     // Close the resource handle.
00729     //
00730
00731     if ( pResourceEntry->hResource != NULL )
00732     {
00733         CloseClusterResource( pResourceEntry->hResource );
00734         pResourceEntry->hResource = NULL;
00735     } // if: resource handle is open
00736
00737     // ADDPARAM: Add new properties here.
00738
00739     //
00740     // The ResUtil API's use LocalAlloc, so use LocalFree on the prop list members.
00741     //
00742
00743     LocalFree( pResourceEntry->propsActive.pwszShareName );
00744     LocalFree( pResourceEntry->props.pwszShareName );
00745     LocalFree( pResourceEntry->propsActive.pwszPath );
00746     LocalFree( pResourceEntry->props.pwszPath );
00747     LocalFree( pResourceEntry->propsActive.pwszRemark );
00748     LocalFree( pResourceEntry->props.pwszRemark );
00749     LocalFree( pResourceEntry->pwszExpandedPath );
00750
00751     //
00752     // Deallocate the resource entry.
00753     //
00754
00755     delete [] pResourceEntry->pwszResourceName;
00756     delete [] pResourceEntry->pwszComputerName;
00757     delete [] pResourceEntry->pwszUNCSharedPath;
00758
00759     delete pResourceEntry;
00760
00761     sc = ERROR_SUCCESS;
00762
00763 Cleanup:
00764
00765     SetLastError( sc );
00766
00767     return;
00768
00769 } //*** FileShareSampleClose
00770
00771
00772 /////////////////////////////////////////////////////////////////////////////
00773 //++
00774 //
00775 //  FileShareSampleOnline
00776 //
00777 //  Description:
00778 //      Online routine for File Share Sample resources.
00779 //
00780 //      Bring the specified resource online (available for use).  The resource
00781 //      DLL should attempt to arbitrate for the resource if it is present on
00782 //      a shared medium, like a shared SCSI bus.
00783 //
00784 //  Arguments:
00785 //      residIn
00786 //          Supplies the resource ID of the resource to be brought online
00787 //          (available for use).
00788 //
00789 //      phEventHandleOut
00790 //          Returns a signalable handle that is signaled when the resource DLL
00791 //          detects a failure on the resource.  This argument derferences as NULL
00792 //          on input, and the resource DLL returns NULL if asynchronous
00793 //          notification of failurs is not supported.  Otherwise this must be
00794 //          the address of a handle that is signaled on resource failures.
00795 //
00796 //  Return Value:
00797 //      ERROR_SUCCESS
00798 //          The operation was successful, and the resource is now online.
00799 //
00800 //      ERROR_RESOURCE_NOT_FOUND
00801 //          Resource ID is not valid.
00802 //
00803 //      ERROR_RESOURCE_NOT_AVAILABLE
00804 //          If the resource was arbitrated with some other systems and one of
00805 //          the other systems won the arbitration.
00806 //
00807 //      ERROR_IO_PENDING
00808 //          The request is pending.  A thread has been activated to process
00809 //          the online request.  The thread that is processing the online
00810 //          request will periodically report status by calling the
00811 //          SetResourceStatus callback method until the resource is placed
00812 //          into the ClusterResourceOnline state (or the resource monitor
00813 //          decides to timeout the online request and Terminate the resource.
00814 //          This pending timeout value is settable and has a default value of
00815 //          3 minutes.).
00816 //
00817 //      Win32 error code
00818 //          The operation failed.
00819 //
00820 //--
00821 /////////////////////////////////////////////////////////////////////////////
00822 DWORD WINAPI
00823 FileShareSampleOnline(
00824       RESID     residIn
00825     , PHANDLE   phEventHandleOut
00826     )
00827 {
00828     PFILESHARESAMPLE_RESOURCE pResourceEntry = NULL;
00829     DWORD                   sc = ERROR_SUCCESS;
00830
00831     UNREFERENCED_PARAMETER( phEventHandleOut );
00832
00833     //
00834     // Verify we have a valid resource ID.
00835     //
00836
00837     pResourceEntry = static_cast< PFILESHARESAMPLE_RESOURCE >( residIn );
00838     if ( pResourceEntry == NULL )
00839     {
00840         DBG_PRINT( "File Share Sample: Online request for a nonexistent resource id.\n" );
00841         return ERROR_RESOURCE_NOT_FOUND;
00842     } // if: NULL resource ID
00843
00844     if ( pResourceEntry->resid != residIn )
00845     {
00846         (g_pfnLogEvent)(
00847               pResourceEntry->hResourceHandle
00848             , LOG_ERROR
00849             , L"Online sanity check failed! resid = 0x%1!08x!.\n"
00850             , residIn
00851             );
00852         return ERROR_RESOURCE_NOT_FOUND;
00853     } // if: invalid resource ID
00854
00855     (g_pfnLogEvent)(
00856           pResourceEntry->hResourceHandle
00857         , LOG_INFORMATION
00858         , L"Online request.\n"
00859         );
00860
00861     //
00862     // Start the Online thread to perform the online operation.
00863     //
00864
00865     pResourceEntry->state = ClusterResourceOnlinePending;
00866     ClusWorkerTerminate( &pResourceEntry->cwWorkerThread );
00867     sc = ClusWorkerCreate(
00868                   &pResourceEntry->cwWorkerThread
00869                 , reinterpret_cast< PWORKER_START_ROUTINE >( FileShareSampleOnlineThread )
00870                 , pResourceEntry
00871                 );
00872     if ( sc != ERROR_SUCCESS )
00873     {
00874         pResourceEntry->state = ClusterResourceFailed;
00875         (g_pfnLogEvent)(
00876               pResourceEntry->hResourceHandle
00877             , LOG_ERROR
00878             , L"Online: Unable to start thread. Error: %1!u!.\n"
00879             , sc
00880             );
00881     } // if: error creating the worker thread
00882     else
00883     {
00884         sc = ERROR_IO_PENDING;
00885     } // if: worker thread created successfully
00886
00887     return sc;
00888
00889 } //*** FileShareSampleOnline
00890
00891
00892 /////////////////////////////////////////////////////////////////////////////
00893 //++
00894 //
00895 //  FileShareSampleOnlineThread
00896 //
00897 //  Description:
00898 //      Worker function which brings a resource online.
00899 //      This function is executed in a separate thread.
00900 //
00901 //  Arguments:
00902 //      pWorkerIn
00903 //          Supplies the worker thread structure.
00904 //
00905 //      pResourceEntryIn
00906 //          A pointer to the FILESHARESAMPLE_RESOURCE block for this resource.
00907 //
00908 //  Return Value:
00909 //      ERROR_SUCCESS
00910 //          The operation completed successfully.
00911 //
00912 //      Win32 error code
00913 //          The operation failed.
00914 //
00915 //  Notes:
00916 //      When using properties in this routine it is recommended that you
00917 //      use the properties in propsActive of the FILESHARESAMPLE_RESOURCE struct
00918 //      instead of the properties in props.  The primary reason you should
00919 //      use propsActive is that the properties in props could be changed by
00920 //      the SetPrivateResProperties() routine.  Using propsActive allows
00921 //      the online state of the resource to be steady while still allowing
00922 //      an administrator to change the stored value of the properties.
00923 //
00924 //--
00925 /////////////////////////////////////////////////////////////////////////////
00926 DWORD WINAPI
00927 FileShareSampleOnlineThread(
00928       PCLUS_WORKER              pWorkerIn
00929     , PFILESHARESAMPLE_RESOURCE   pResourceEntryIn
00930     )
00931 {
00932     RESOURCE_STATUS resourceStatus;
00933     DWORD           sc = ERROR_SUCCESS;
00934     DWORD           cch = 0;
00935     LPWSTR          pwszNameOfPropInError = NULL;
00936     SHARE_INFO_2    shareInfo;
00937     HRESULT         hr = S_OK;
00938
00939     ResUtilInitializeResourceStatus( &resourceStatus );
00940
00941     resourceStatus.ResourceState = ClusterResourceFailed;
00942     resourceStatus.WaitHint = 0;
00943     resourceStatus.CheckPoint = 1;
00944
00945     //
00946     // Parameter checking.
00947     //
00948
00949     if ( pResourceEntryIn == NULL )
00950     {
00951         sc = ERROR_INVALID_PARAMETER;
00952         goto Cleanup;
00953     } // if:
00954
00955     //
00956     // Read properties.
00957     //
00958
00959     sc = ResUtilGetPropertiesToParameterBlock(
00960               pResourceEntryIn->hkeyParameters
00961             , FileShareSampleResourcePrivateProperties
00962             , reinterpret_cast< LPBYTE >( &pResourceEntryIn->propsActive )
00963             , TRUE // CheckForRequiredProperties
00964             , &pwszNameOfPropInError
00965             );
00966     if ( sc != ERROR_SUCCESS )
00967     {
00968         (g_pfnLogEvent)(
00969               pResourceEntryIn->hResourceHandle
00970             , LOG_ERROR
00971             , L"OnlineThread: Unable to read the '%1!s!' property. Error: %2!u!.\n"
00972             , (pwszNameOfPropInError == NULL ? L"" : pwszNameOfPropInError)
00973             , sc
00974             );
00975         goto Cleanup;
00976     } // if: error getting properties
00977
00978     //
00979     // Start any services that we depend on.
00980     // The call to ClusWorkerCheckTerminate checks to see if this resource
00981     // has been told to stop the online process, in which case we should
00982     // not start the service.
00983     //
00984
00985     if ( ClusWorkerCheckTerminate( pWorkerIn ) == TRUE )
00986     {
00987         goto Cleanup;
00988     } // if: terminating
00989
00990     sc = ResUtilStartResourceService( FILESHARESAMPLE_SVCNAME, NULL );
00991     if ( sc == ERROR_SERVICE_ALREADY_RUNNING )
00992     {
00993         sc = ERROR_SUCCESS;
00994     } // if: service was already started
00995     else if ( sc != ERROR_SUCCESS )
00996     {
00997         (g_pfnLogEvent)(
00998               pResourceEntryIn->hResourceHandle
00999             , LOG_ERROR
01000             , L"OnlineThread: Failed to bring required service '%1!s!' online.  Error: %2!u!.\n"
01001             , FILESHARESAMPLE_SVCNAME
01002             , sc
01003             );
01004         goto Cleanup;
01005     } // else if: error starting the service
01006
01007     //
01008     // TODO: Add code to start the resource.
01009     //
01010
01011     if ( ClusWorkerCheckTerminate( pWorkerIn ) == TRUE )
01012     {
01013         goto Cleanup;
01014     } // if: terminating
01015
01016     //
01017     // The path may contain environment variables so we need to expand them.
01018     //
01019
01020     delete [] pResourceEntryIn->pwszUNCSharedPath;
01021     pResourceEntryIn->pwszUNCSharedPath = NULL;
01022
01023     LocalFree( pResourceEntryIn->pwszExpandedPath );
01024     pResourceEntryIn->pwszExpandedPath = ResUtilExpandEnvironmentStrings( pResourceEntryIn->propsActive.pwszPath );
01025     if ( pResourceEntryIn->pwszExpandedPath == NULL )
01026     {
01027         sc = GetLastError();
01028         (g_pfnLogEvent)(
01029               pResourceEntryIn->hResourceHandle
01030             , LOG_ERROR
01031             , L"OnlineThread: Error %1!u! expanding path '%2!ws!' for share '%3!ws!'.\n"
01032             , sc
01033             , pResourceEntryIn->propsActive.pwszPath
01034             , pResourceEntryIn->propsActive.pwszShareName
01035             );
01036         goto Cleanup;
01037     } // if:
01038
01039     //
01040     // Make sure the path doesn't end in a trailing backslash or it will fail to come online.
01041     // Accept paths such as E:\ though.
01042     //
01043
01044     cch = wcslen( pResourceEntryIn->pwszExpandedPath );
01045     if ( ( cch > 3 ) && (pResourceEntryIn->pwszExpandedPath[ cch - 1 ] == L'\\' ) )
01046     {
01047         pResourceEntryIn->pwszExpandedPath[ cch - 1 ] = L'\0';
01048     } // if:
01049
01050     //
01051     // Initialize the shareInfo struct and create the share.
01052     //
01053
01054     ZeroMemory( &shareInfo, sizeof( shareInfo ) );
01055     shareInfo.shi2_netname =    pResourceEntryIn->propsActive.pwszShareName;
01056     shareInfo.shi2_type =       STYPE_DISKTREE;
01057     shareInfo.shi2_remark =     pResourceEntryIn->propsActive.pwszRemark;
01058     shareInfo.shi2_max_uses =   pResourceEntryIn->propsActive.nMaxUsers;
01059     shareInfo.shi2_path =       pResourceEntryIn->pwszExpandedPath;
01060
01061     sc = NetShareAdd( NULL, 2, reinterpret_cast< PBYTE >( &shareInfo ), NULL );
01062     if ( sc != NERR_Success )
01063     {
01064         (g_pfnLogEvent)(
01065               pResourceEntryIn->hResourceHandle
01066             , LOG_ERROR
01067             , L"OnlineThread: Error %1!u! creating share '%2!ws!' for path '%3!ws!'.\n"
01068             , sc
01069             , pResourceEntryIn->propsActive.pwszShareName
01070             , pResourceEntryIn->pwszExpandedPath
01071             );
01072         goto Cleanup;
01073     } // if: error creating share
01074
01075     //
01076     // Calculate the UNC path in order to test for aliveness.  e.g. \\node1\myshare
01077     //
01078
01079     // Figure out how big of a buffer we need and allocate it.
01080     // The magic "8" comes from this: - \\x\y\*.* - excluding the x & y and adding the null.
01081     cch = 8 + wcslen( pResourceEntryIn->pwszComputerName ) + wcslen( pResourceEntryIn->propsActive.pwszShareName );
01082     pResourceEntryIn->pwszUNCSharedPath = new WCHAR[ cch ];
01083     if ( pResourceEntryIn->pwszUNCSharedPath == NULL )
01084     {
01085         sc = ERROR_OUTOFMEMORY;
01086         (g_pfnLogEvent)(
01087               pResourceEntryIn->hResourceHandle
01088             , LOG_ERROR
01089             , L"OnlineThread: Error %1!u! allocating memory for local path.\n"
01090             , sc
01091             );
01092         goto Cleanup;
01093     } // if:
01094
01095     // Format the path into pwszUNCSharedPath.
01096     hr = StringCchPrintf(
01097               pResourceEntryIn->pwszUNCSharedPath
01098             , cch
01099             , L"\\\\%ws\\%ws\\*.*"
01100             , pResourceEntryIn->pwszComputerName
01101             , pResourceEntryIn->propsActive.pwszShareName
01102             );
01103     if ( FAILED( hr ) )
01104     {
01105         sc = SCODE( hr );
01106         (g_pfnLogEvent)(
01107               pResourceEntryIn->hResourceHandle
01108             , LOG_ERROR
01109             , L"OnlineThread: Error %1!u! formatting share path from computer name '%2!s!' and share name '%3!s!'.\n"
01110             , sc
01111             , pResourceEntryIn->pwszComputerName
01112             , pResourceEntryIn->propsActive.pwszShareName
01113             );
01114         goto Cleanup;
01115     } // if:
01116
01117     sc = ERROR_SUCCESS;
01118     resourceStatus.ResourceState = ClusterResourceOnline;
01119
01120 Cleanup:
01121
01122     if ( sc != ERROR_SUCCESS )
01123     {
01124         (g_pfnLogEvent)(
01125               pResourceEntryIn->hResourceHandle
01126             , LOG_ERROR
01127             , L"OnlineThread: Error %1!u! bringing resource online.\n"
01128             , sc
01129             );
01130     } // if: error occurred
01131
01132     pResourceEntryIn->state = resourceStatus.ResourceState;
01133     g_pfnSetResourceStatus( pResourceEntryIn->hResourceHandle, &resourceStatus );
01134
01135     return sc;
01136
01137 } //*** FileShareSampleOnlineThread
01138
01139
01140 /////////////////////////////////////////////////////////////////////////////
01141 //++
01142 //
01143 //  FileShareSampleOffline
01144 //
01145 //  Description:
01146 //      Offline routine for File Share Sample resources.
01147 //
01148 //      Take the specified resource offline (unavailable for use).  Wait
01149 //      for any cleanup operations to complete before returning.
01150 //
01151 //  Arguments:
01152 //      residIn
01153 //          Supplies the resource ID of the resource to be shutdown
01154 //          gracefully.
01155 //
01156 //  Return Value:
01157 //      ERROR_SUCCESS
01158 //          The operation was successful, and the resource is now offline.
01159 //
01160 //      ERROR_RESOURCE_NOT_FOUND
01161 //          Resource ID is not valid.
01162 //
01163 //      ERROR_RESOURCE_NOT_AVAILABLE
01164 //          If the resource was arbitrated with some other systems and one of
01165 //          the other systems won the arbitration.
01166 //
01167 //      ERROR_IO_PENDING
01168 //          The request is still pending.  A thread has been activated to
01169 //          process the offline request.  The thread that is processing the
01170 //          offline request will periodically report status by calling the
01171 //          SetResourceStatus callback method until the resource is placed
01172 //          into the ClusterResourceOffline state (or the resource monitor
01173 //          decides  to timeout the offline request and Terminate the
01174 //          resource).
01175 //
01176 //      Win32 error code
01177 //          The operation failed.  This will cause the Resource Monitor to
01178 //          log an event and call the Terminate routine.
01179 //
01180 //  Notes:
01181 //      When using properties in this routine it is recommended that you
01182 //      use the properties in propsActive of the FILESHARESAMPLE_RESOURCE struct
01183 //      instead of the properties in props.  The primary reason you should
01184 //      use propsActive is that the properties in props could be changed by
01185 //      the SetPrivateResProperties() routine.  Using propsActive allows
01186 //      the online state of the resource to be steady while still allowing
01187 //      an administrator to change the stored value of the properties.
01188 //
01189 //--
01190 /////////////////////////////////////////////////////////////////////////////
01191 DWORD WINAPI
01192 FileShareSampleOffline(
01193     RESID residIn
01194     )
01195 {
01196     PFILESHARESAMPLE_RESOURCE pResourceEntry = NULL;
01197     DWORD                   sc = ERROR_SUCCESS;
01198
01199     //
01200     // Verify we have a valid resource ID.
01201     //
01202
01203     pResourceEntry = static_cast< PFILESHARESAMPLE_RESOURCE >( residIn );
01204     if ( pResourceEntry == NULL )
01205     {
01206         DBG_PRINT( "File Share Sample: Offline request for a nonexistent resource id.\n" );
01207         sc = ERROR_RESOURCE_NOT_FOUND;
01208         goto Cleanup;
01209     } // if: NULL resource ID
01210
01211     if ( pResourceEntry->resid != residIn )
01212     {
01213         (g_pfnLogEvent)(
01214               pResourceEntry->hResourceHandle
01215             , LOG_ERROR
01216             , L"Offline resource sanity check failed! resid = 0x%1!08x!.\n"
01217             , residIn
01218             );
01219         sc = ERROR_RESOURCE_NOT_FOUND;
01220         goto Cleanup;
01221     } // if: invalid resource ID
01222
01223     (g_pfnLogEvent)(
01224           pResourceEntry->hResourceHandle
01225         , LOG_INFORMATION
01226         , L"Offline request.\n"
01227         );
01228
01229     //
01230     // Start the Offline thread to perform the offline operation.
01231     //
01232
01233     pResourceEntry->state = ClusterResourceOfflinePending;
01234     ClusWorkerTerminate( &pResourceEntry->cwWorkerThread );
01235     sc = ClusWorkerCreate(
01236                   &pResourceEntry->cwWorkerThread
01237                 , reinterpret_cast< PWORKER_START_ROUTINE >( FileShareSampleOfflineThread )
01238                 , pResourceEntry
01239                 );
01240     if ( sc != ERROR_SUCCESS )
01241     {
01242         pResourceEntry->state = ClusterResourceFailed;
01243         (g_pfnLogEvent)(
01244               pResourceEntry->hResourceHandle
01245             , LOG_ERROR
01246             , L"Offline: Unable to start thread. Error: %1!u!.\n"
01247             , sc
01248             );
01249     } // if: error creating the worker thread
01250     else
01251     {
01252         sc = ERROR_IO_PENDING;
01253     } // if: worker thread created successfully
01254
01255 Cleanup:
01256
01257     return sc;
01258
01259 } //*** FileShareSampleOffline
01260
01261
01262 /////////////////////////////////////////////////////////////////////////////
01263 //++
01264 //
01265 //  FileShareSampleOfflineThread
01266 //
01267 //  Description:
01268 //      Worker function which takes a resource offline.
01269 //      This function is executed in a separate thread.
01270 //
01271 //  Arguments:
01272 //      pWorkerIn
01273 //          Supplies the worker thread structure.
01274 //
01275 //      pResourceEntryIn
01276 //          A pointer to the FILESHARESAMPLE_RESOURCE block for this resource.
01277 //
01278 //  Return Value:
01279 //      ERROR_SUCCESS
01280 //          The operation completed successfully.
01281 //
01282 //      Win32 error code
01283 //          The operation failed.
01284 //
01285 //  Notes:
01286 //      When using properties in this routine it is recommended that you
01287 //      use the properties in propsActive of the FILESHARESAMPLE_RESOURCE struct
01288 //      instead of the properties in props.  The primary reason you should
01289 //      use propsActive is that the properties in props could be changed by
01290 //      the SetPrivateResProperties() routine.  Using propsActive allows
01291 //      the online state of the resource to be steady while still allowing
01292 //      an administrator to change the stored value of the properties.
01293 //
01294 //--
01295 /////////////////////////////////////////////////////////////////////////////
01296 DWORD WINAPI
01297 FileShareSampleOfflineThread(
01298       PCLUS_WORKER              pWorkerIn
01299     , PFILESHARESAMPLE_RESOURCE pResourceEntryIn
01300     )
01301 {
01302     RESOURCE_STATUS     resourceStatus;
01303     DWORD               sc = ERROR_SUCCESS;
01304
01305     ResUtilInitializeResourceStatus( &resourceStatus );
01306
01307     resourceStatus.ResourceState = ClusterResourceFailed;
01308     resourceStatus.WaitHint = 0;
01309     resourceStatus.CheckPoint = 1;
01310
01311     //
01312     // Take the resource offline.
01313     //
01314
01315     //
01316     // The call to ClusWorkerCheckTerminate checks to see if this
01317     // resource has been terminated or not.
01318     //
01319
01320     if ( ClusWorkerCheckTerminate( pWorkerIn ) == TRUE )
01321     {
01322         goto Cleanup;
01323     } // if: resource terminated
01324
01325     sc = NetShareDel( NULL, pResourceEntryIn->propsActive.pwszShareName, 0 );
01326     if ( (sc != NERR_Success) && (sc != NERR_NetNameNotFound) )
01327     {
01328         (g_pfnLogEvent)(
01329               pResourceEntryIn->hResourceHandle
01330             , LOG_ERROR
01331             , L"OfflineThread: Error %1!u! taking share '%2!s!' offline.\n"
01332             , sc
01333             , pResourceEntryIn->propsActive.pwszShareName
01334             );
01335         goto Cleanup;
01336     } // if: error taking the resource offline
01337
01338     sc = ERROR_SUCCESS;
01339     resourceStatus.ResourceState = ClusterResourceOffline;
01340
01341 Cleanup:
01342
01343     pResourceEntryIn->state = resourceStatus.ResourceState;
01344     g_pfnSetResourceStatus( pResourceEntryIn->hResourceHandle, &resourceStatus );
01345
01346     return sc;
01347
01348 } //*** FileShareSampleOfflineThread
01349
01350
01351 /////////////////////////////////////////////////////////////////////////////
01352 //++
01353 //
01354 //  FileShareSampleTerminate
01355 //
01356 //  Description:
01357 //      Terminate routine for File Share Sample resources.
01358 //
01359 //      Take the specified resource offline immediately (the resource is
01360 //      unavailable for use).
01361 //
01362 //  Arguments:
01363 //      residIn
01364 //          Supplies the resource ID of the resource to be shutdown
01365 //          ungracefully.
01366 //
01367 //  Return Value:
01368 //      None.
01369 //
01370 //  Notes:
01371 //      When using properties in this routine it is recommended that you
01372 //      use the properties in propsActive of the FILESHARESAMPLE_RESOURCE struct
01373 //      instead of the properties in props.  The primary reason you should
01374 //      use propsActive is that the properties in props could be changed by
01375 //      the SetPrivateResProperties() routine.  Using propsActive allows
01376 //      the online state of the resource to be steady while still allowing
01377 //      an administrator to change the stored value of the properties.
01378 //
01379 //--
01380 /////////////////////////////////////////////////////////////////////////////
01381 void WINAPI
01382 FileShareSampleTerminate(
01383     RESID residIn
01384     )
01385 {
01386     DWORD                       sc = ERROR_SUCCESS;
01387     PFILESHARESAMPLE_RESOURCE   pResourceEntry = NULL;
01388
01389     //
01390     // Verify we have a valid resource ID.
01391     //
01392
01393     pResourceEntry = static_cast< PFILESHARESAMPLE_RESOURCE >( residIn );
01394     if ( pResourceEntry == NULL )
01395     {
01396         DBG_PRINT( "File Share Sample: Terminate request for a nonexistent resource id.\n" );
01397         return;
01398     } // if: NULL resource ID
01399
01400     if ( pResourceEntry->resid != residIn )
01401     {
01402         (g_pfnLogEvent)(
01403               pResourceEntry->hResourceHandle
01404             , LOG_ERROR
01405             , L"Terminate resource sanity check failed! resid = 0x%1!08x!.\n"
01406             , residIn
01407             );
01408         return;
01409     } // if: invalid resource ID
01410
01411     (g_pfnLogEvent)(
01412           pResourceEntry->hResourceHandle
01413         , LOG_INFORMATION
01414         , L"Terminate request.\n"
01415         );
01416
01417     //
01418     // Kill off any pending threads.
01419     //
01420
01421     ClusWorkerTerminate( &pResourceEntry->cwWorkerThread );
01422
01423     //
01424     // Terminate the resource.
01425     //
01426
01427     sc = NetShareDel( NULL, pResourceEntry->propsActive.pwszShareName, 0 );
01428     if ( sc != NERR_Success && sc != NERR_NetNameNotFound )
01429     {
01430         (g_pfnLogEvent)(
01431               pResourceEntry->hResourceHandle
01432             , LOG_ERROR
01433             , L"Terminate: Error %1!u! removing share '%2!ws!'.\n"
01434             , sc
01435             , pResourceEntry->propsActive.pwszShareName
01436             );
01437     } // if:  error taking the resource offline
01438
01439     pResourceEntry->state = ClusterResourceFailed;
01440
01441     return;
01442
01443 } //*** FileShareSampleTerminate
01444
01445
01446 /////////////////////////////////////////////////////////////////////////////
01447 //++
01448 //
01449 //  FileShareSampleLooksAlive
01450 //
01451 //  Description:
01452 //      LooksAlive routine for File Share Sample resources.
01453 //
01454 //      Perform a quick check to determine if the specified resource is
01455 //      probably online (available for use).  This call should not block for
01456 //      more than 300 ms, preferably less than 50 ms.
01457 //
01458 //  Arguments:
01459 //      residIn
01460 //          Supplies the resource ID for the resource to be polled.
01461 //
01462 //  Return Value:
01463 //      TRUE
01464 //          The specified resource is probably online and available for use.
01465 //
01466 //      FALSE
01467 //          The specified resource is not functioning normally.  The IsAlive
01468 //          function will be called to perform a more thorough check.
01469 //
01470 //  Notes:
01471 //      When using properties in this routine it is recommended that you
01472 //      use the properties in propsActive of the FILESHARESAMPLE_RESOURCE struct
01473 //      instead of the properties in props.  The primary reason you should
01474 //      use propsActive is that the properties in props could be changed by
01475 //      the SetPrivateResProperties() routine.  Using propsActive allows
01476 //      the online state of the resource to be steady while still allowing
01477 //      an administrator to change the stored value of the properties.
01478 //
01479 //--
01480 /////////////////////////////////////////////////////////////////////////////
01481 BOOL WINAPI
01482 FileShareSampleLooksAlive(
01483     RESID residIn
01484     )
01485 {
01486     PFILESHARESAMPLE_RESOURCE   pResourceEntry = NULL;
01487     BOOL                        fRet = FALSE;
01488
01489     //
01490     // Verify we have a valid resource ID.
01491     //
01492
01493     pResourceEntry = static_cast< PFILESHARESAMPLE_RESOURCE >( residIn );
01494     if ( pResourceEntry == NULL )
01495     {
01496         DBG_PRINT( "File Share Sample: LooksAlive request for a nonexistent resource id.\n" );
01497         return FALSE;
01498     } // if: NULL resource ID
01499
01500     if ( pResourceEntry->resid != residIn )
01501     {
01502         (g_pfnLogEvent)(
01503               pResourceEntry->hResourceHandle
01504             , LOG_ERROR
01505             , L"LooksAlive sanity check failed! resid = 0x%1!08x!.\n"
01506             , residIn
01507             );
01508         return FALSE;
01509     } // if: invalid resource ID
01510
01511 #ifdef LOG_VERBOSE
01512     (g_pfnLogEvent)(
01513           pResourceEntry->hResourceHandle
01514         , LOG_INFORMATION
01515         , L"LooksAlive request.\n"
01516         );
01517 #endif
01518
01519     //
01520     // NOTE: LooksAlive should be a quick check to see if the resource is
01521     // available or not, whereas IsAlive should be a thorough check.  If
01522     // there are no differences between a quick check and a thorough check,
01523     // IsAlive can be called for LooksAlive, as it is below.  However, if there
01524     // are differences, replace the call to IsAlive below with your quick
01525     // check code.
01526     //
01527
01528     //
01529     // Check to see if the resource is alive.
01530     //
01531
01532     if ( pResourceEntry->fIsAliveFailed == TRUE )
01533     {
01534         //
01535         // Somebody called ClusterResourceControl with our custom control code.
01536         // That had the same effect as calling IsAlive and the result was false,
01537         // so we can skip doing the LooksAlive check and return false.  This
01538         // will cause IsAlive to be called and we'll do another check just in
01539         // case we encountered a hiccup the first time.
01540         //
01541
01542         fRet = FALSE;
01543     } // if:
01544     else
01545     {
01546         fRet = FileShareSampleCheckIsAlive( pResourceEntry, FALSE /* fFullCheck */ );
01547     } // else:
01548
01549     return fRet;
01550
01551 } //*** FileShareSampleLooksAlive
01552
01553
01554 /////////////////////////////////////////////////////////////////////////////
01555 //++
01556 //
01557 //  FileShareSampleIsAlive
01558 //
01559 //  Description:
01560 //      IsAlive routine for File Share Sample resources.
01561 //
01562 //      Perform a thorough check to determine if the specified resource is
01563 //      online (available for use).  This call should not block for more
01564 //      more than 300 ms, preferably less than 50 ms.  If it must block for
01565 //      longer than this, create a separate thread dedicated to polling for
01566 //      this information and have this routine return the status of the last
01567 //      poll performed.
01568 //
01569 //  Arguments:
01570 //      residIn
01571 //          Supplies the resource ID for the resource to be polled.
01572 //
01573 //  Return Value:
01574 //      TRUE
01575 //          The specified resource is online and functioning normally.
01576 //
01577 //      FALSE
01578 //          The specified resource is not functioning normally.  The resource
01579 //          will be terminated and then Online will be called.
01580 //
01581 //  Notes:
01582 //      When using properties in this routine it is recommended that you
01583 //      use the properties in propsActive of the FILESHARESAMPLE_RESOURCE struct
01584 //      instead of the properties in props.  The primary reason you should
01585 //      use propsActive is that the properties in props could be changed by
01586 //      the SetPrivateResProperties() routine.  Using propsActive allows
01587 //      the online state of the resource to be steady while still allowing
01588 //      an administrator to change the stored value of the properties.
01589 //
01590 //--
01591 /////////////////////////////////////////////////////////////////////////////
01592 BOOL WINAPI
01593 FileShareSampleIsAlive(
01594     RESID residIn
01595     )
01596 {
01597     PFILESHARESAMPLE_RESOURCE pResourceEntry = NULL;
01598
01599     //
01600     // Verify we have a valid resource ID.
01601     //
01602
01603     pResourceEntry = static_cast< PFILESHARESAMPLE_RESOURCE >( residIn );
01604     if ( pResourceEntry == NULL )
01605     {
01606         DBG_PRINT( "File Share Sample: IsAlive request for a nonexistent resource id.\n" );
01607         return FALSE;
01608     } // if: NULL resource ID
01609
01610     if ( pResourceEntry->resid != residIn )
01611     {
01612         (g_pfnLogEvent)(
01613               pResourceEntry->hResourceHandle
01614             , LOG_ERROR
01615             , L"IsAlive sanity check failed! resid = 0x%1!08x!.\n"
01616             , residIn
01617             );
01618         return FALSE;
01619     } // if: invalid resource ID
01620
01621 #ifdef LOG_VERBOSE
01622     (g_pfnLogEvent)(
01623           pResourceEntry->hResourceHandle
01624         , LOG_INFORMATION
01625         , L"IsAlive request.\n"
01626         );
01627 #endif
01628
01629     //
01630     // Check to see if the resource is alive.
01631     //
01632
01633     return FileShareSampleCheckIsAlive( pResourceEntry, TRUE /* fFullCheck */ );
01634
01635 } //** FileShareSampleIsAlive
01636
01637
01638 /////////////////////////////////////////////////////////////////////////////
01639 //++
01640 //
01641 //  FileShareSampleCheckIsAlive
01642 //
01643 //  Description:
01644 //      Check to see if the resource is alive for File Share Sample
01645 //      resources.
01646 //
01647 //  Arguments:
01648 //      pResourceEntryIn
01649 //          Supplies the resource entry for the resource to polled.
01650 //
01651 //      fFullCheckIn
01652 //          TRUE = Perform a full check.
01653 //          FALSE = Perform a cursory check.
01654 //
01655 //  Return Value:
01656 //      TRUE
01657 //          The specified resource is online and functioning normally.
01658 //
01659 //      FALSE
01660 //          The specified resource is not functioning normally.
01661 //
01662 //  Notes:
01663 //      When using properties in this routine it is recommended that you
01664 //      use the properties in propsActive of the FILESHARESAMPLE_RESOURCE struct
01665 //      instead of the properties in props.  The primary reason you should
01666 //      use propsActive is that the properties in props could be changed by
01667 //      the SetPrivateResProperties() routine.  Using propsActive allows
01668 //      the online state of the resource to be steady while still allowing
01669 //      an administrator to change the stored value of the properties.
01670 //
01671 //--
01672 /////////////////////////////////////////////////////////////////////////////
01673 BOOL
01674 FileShareSampleCheckIsAlive(
01675       PFILESHARESAMPLE_RESOURCE pResourceEntryIn
01676     , BOOL                      fFullCheckIn
01677     )
01678 {
01679     BOOL            fIsAlive = FALSE;
01680     DWORD           sc = ERROR_SUCCESS;
01681     SHARE_INFO_2 *  pshareInfo = NULL;
01682     HANDLE          hFile = NULL;
01683     WIN32_FIND_DATA fileData;
01684
01685     ZeroMemory( &fileData, sizeof( fileData ) );
01686
01687     //
01688     // Reset the variable.
01689     //
01690
01691     pResourceEntryIn->fIsAliveFailed = FALSE;
01692
01693     //
01694     // Check to see if the resource is alive.
01695     //
01696
01697     sc = NetShareGetInfo(
01698               NULL
01699             , pResourceEntryIn->propsActive.pwszShareName
01700             , 2     // return a SHARE_INFO_2 structure
01701             , reinterpret_cast< LPBYTE * >( &pshareInfo )
01702             );
01703     if ( sc == NERR_NetNameNotFound )
01704     {
01705         (g_pfnLogEvent)(
01706               pResourceEntryIn->hResourceHandle
01707             , LOG_ERROR
01708             , L"CheckIsAlive: Error, share '%1!ws!' went away.\n"
01709             , pResourceEntryIn->propsActive.pwszShareName
01710             );
01711         goto Cleanup;
01712     } // if:  share name not found
01713     else if ( sc != NERR_Success )
01714     {
01715         (g_pfnLogEvent)(
01716               pResourceEntryIn->hResourceHandle
01717             , LOG_ERROR
01718             , L"CheckIsAlive: Error %1!u! checking for share '%2!ws!'.\n"
01719             , sc
01720             , pResourceEntryIn->propsActive.pwszShareName
01721             );
01722         goto Cleanup;
01723     } // else if: error getting share info
01724
01725     if ( fFullCheckIn == TRUE )
01726     {
01727         //
01728         // Do a full check by trying to open a file on the share.
01729         //
01730
01731         hFile = FindFirstFileW( pResourceEntryIn->pwszUNCSharedPath, &fileData );
01732
01733         //
01734         // If we fail on the first attempt, try again.  There seems to be
01735         // a bug in the RDR where the first attempt to read a share after
01736         // it has been deleted and reinstated fails.
01737         //
01738
01739         if ( hFile == INVALID_HANDLE_VALUE )
01740         {
01741             hFile = FindFirstFileW( pResourceEntryIn->pwszUNCSharedPath, &fileData );
01742         } // if:  error finding file
01743
01744         //
01745         // If we succeeded in finding a file, or there were no files in
01746         // the path, then return success, otherwise we had a failure.
01747         //
01748
01749         sc = GetLastError();
01750
01751         if (    ( hFile == INVALID_HANDLE_VALUE )
01752              && ( sc    != ERROR_FILE_NOT_FOUND )
01753              && ( sc    != ERROR_ACCESS_DENIED )
01754            )
01755         {
01756             (g_pfnLogEvent)(
01757                   pResourceEntryIn->hResourceHandle
01758                 , LOG_ERROR
01759                 , L"CheckIsAlive: Share has gone offline!\n"
01760                 );
01761         } // if:  error finding the file
01762         else
01763         {
01764             FindClose( hFile );
01765             sc = ERROR_SUCCESS;     // There are other non-failure status codes possible, reset to success.
01766         } // else:  found file
01767     } // if: performing a full check
01768
01769 Cleanup:
01770
01771     NetApiBufferFree( reinterpret_cast< LPBYTE * >( pshareInfo ) );
01772     pshareInfo = NULL;
01773
01774     if ( sc == ERROR_SUCCESS )
01775     {
01776         fIsAlive = TRUE;
01777     } // if:
01778
01779     return fIsAlive;
01780
01781 } //*** FileShareSampleCheckIsAlive
01782
01783
01784 /////////////////////////////////////////////////////////////////////////////
01785 //++
01786 //
01787 //  FileShareSampleResourceControl
01788 //
01789 //  Description:
01790 //      ResourceControl routine for File Share Sample resources.
01791 //
01792 //      Perform the control request specified by nControlCode on the specified
01793 //      resource.
01794 //
01795 //  Arguments:
01796 //      residIn
01797 //          Supplies the resource ID for the specific resource.
01798 //
01799 //      nControlCodeIn
01800 //          Supplies the control code that defines the action to be performed.
01801 //
01802 //      pInBufferIn
01803 //          Supplies a pointer to a buffer containing input data.
01804 //
01805 //      cbInBufferSizeIn
01806 //          Supplies the size, in bytes, of the data pointed to by pInBufferIn.
01807 //
01808 //      pOutBufferOut
01809 //          Supplies a pointer to the output buffer to be filled in.
01810 //
01811 //      cbOutBufferSizeIn
01812 //          Supplies the size, in bytes, of the available space pointed to by
01813 //          pOutBufferOut
01814 //
01815 //      pcbBytesReturnedOut
01816 //          Returns the number of bytes of pOutBufferOut actually filled in by
01817 //          the resource.  If pOutBufferOut is too small, pcbBytesReturnedOut
01818 //          contains the total number of bytes for the operation to succeed.
01819 //
01820 //  Return Value:
01821 //      ERROR_SUCCESS
01822 //          The function completed successfully.
01823 //
01824 //      ERROR_RESOURCE_NOT_FOUND
01825 //          Resource ID is not valid.
01826 //
01827 //      ERROR_MORE_DATA
01828 //          The output buffer is too small to return the data.
01829 //          pcbBytesReturnedOut contains the required size.
01830 //
01831 //      ERROR_INVALID_FUNCTION
01832 //          The requested control code is not supported.  In some cases,
01833 //          this allows the cluster software to perform the work.
01834 //
01835 //      Win32 error code
01836 //          The function failed.
01837 //
01838 //--
01839 /////////////////////////////////////////////////////////////////////////////
01840 DWORD WINAPI
01841 FileShareSampleResourceControl(
01842       RESID     residIn
01843     , DWORD     nControlCodeIn
01844     , PVOID     pInBufferIn
01845     , DWORD     cbInBufferSizeIn
01846     , PVOID     pOutBufferOut
01847     , DWORD     cbOutBufferSizeIn
01848     , LPDWORD   pcbBytesReturnedOut
01849     )
01850 {
01851     DWORD               sc = ERROR_SUCCESS;
01852     PFILESHARESAMPLE_RESOURCE pResourceEntry = NULL;
01853
01854     //
01855     // Verify we have a valid resource ID.
01856     //
01857     pResourceEntry = static_cast< PFILESHARESAMPLE_RESOURCE >( residIn );
01858     if ( pResourceEntry == NULL )
01859     {
01860         DBG_PRINT( "File Share Sample: ResourceControl request for a nonexistent resource id.\n" );
01861         return ERROR_RESOURCE_NOT_FOUND;
01862     } // if: NULL resource ID
01863
01864     if ( pResourceEntry->resid != residIn )
01865     {
01866         (g_pfnLogEvent)(
01867               pResourceEntry->hResourceHandle
01868             , LOG_ERROR
01869             , L"ResourceControl sanity check failed! resid = 0x%1!08x!.\n"
01870             , residIn
01871             );
01872         return ERROR_RESOURCE_NOT_FOUND;
01873     } // if: invalid resource ID
01874
01875     switch ( nControlCodeIn )
01876     {
01877         case CLUSCTL_RESOURCE_UNKNOWN:
01878             *pcbBytesReturnedOut = 0;
01879             sc = ERROR_SUCCESS;
01880             break;
01881
01882         case CLUSCTL_RESOURCE_ENUM_PRIVATE_PROPERTIES:
01883         {
01884             DWORD cbRequired = 0;
01885             sc = ResUtilEnumProperties(
01886                       FileShareSampleResourcePrivateProperties
01887                     , static_cast< LPWSTR >( pOutBufferOut )
01888                     , cbOutBufferSizeIn
01889                     , pcbBytesReturnedOut
01890                     , &cbRequired
01891                     );
01892             if ( sc == ERROR_MORE_DATA )
01893             {
01894                 *pcbBytesReturnedOut = cbRequired;
01895             } // if: output buffer is too small
01896             break;
01897         }
01898
01899         case CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES:
01900             sc = FileShareSampleGetPrivateResProperties(
01901                       pResourceEntry
01902                     , pOutBufferOut
01903                     , cbOutBufferSizeIn
01904                     , pcbBytesReturnedOut
01905                     );
01906             break;
01907
01908         case CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES:
01909             sc = FileShareSampleValidatePrivateResProperties(
01910                       pResourceEntry
01911                     , pInBufferIn
01912                     , cbInBufferSizeIn
01913                     , NULL
01914                     );
01915             break;
01916
01917         case CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES:
01918             sc = FileShareSampleSetPrivateResProperties(
01919                       pResourceEntry
01920                     , pInBufferIn
01921                     , cbInBufferSizeIn
01922                     );
01923             break;
01924
01925         case CLUSCTL_RESOURCE_SET_NAME:
01926             sc = FileShareSampleSetNameHandler( pResourceEntry, static_cast< LPWSTR >( pInBufferIn ) );
01927             break;
01928
01929         case CLUSCTL_RESOURCE_FILESHARESAMPLE_CALL_ISALIVE:
01930
01931             //
01932             // This has the same effect as the periodic IsAlive check.
01933             //
01934
01935             if ( pResourceEntry->state != ClusterResourceOnline )
01936             {
01937                 sc = ERROR_CLUSTER_INVALID_REQUEST;
01938             } // if:
01939             else if ( FileShareSampleCheckIsAlive( pResourceEntry, TRUE ) == FALSE )
01940             {
01941                 sc = ERROR_RESOURCE_FAILED;
01942                 pResourceEntry->fIsAliveFailed = TRUE;
01943                 (g_pfnLogEvent)(
01944                       pResourceEntry->hResourceHandle
01945                     , LOG_ERROR
01946                     , L"ResourceControl CALL_ISALIVE failed.\n"
01947                     );
01948             } // else if:
01949             else
01950             {
01951                 sc = ERROR_SUCCESS;
01952                 (g_pfnLogEvent)(
01953                       pResourceEntry->hResourceHandle
01954                     , LOG_INFORMATION
01955                     , L"ResourceControl CALL_ISALIVE succeeded.\n"
01956                     );
01957             } // else:
01958
01959             break;
01960
01961         case CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES:
01962         case CLUSCTL_RESOURCE_GET_CHARACTERISTICS:
01963         case CLUSCTL_RESOURCE_GET_CLASS_INFO:
01964         case CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO:
01965         case CLUSCTL_RESOURCE_STORAGE_IS_PATH_VALID:
01966         case CLUSCTL_RESOURCE_DELETE:
01967         case CLUSCTL_RESOURCE_INSTALL_NODE:
01968         case CLUSCTL_RESOURCE_EVICT_NODE:
01969         case CLUSCTL_RESOURCE_ADD_DEPENDENCY:
01970         case CLUSCTL_RESOURCE_REMOVE_DEPENDENCY:
01971         case CLUSCTL_RESOURCE_ADD_OWNER:
01972         case CLUSCTL_RESOURCE_REMOVE_OWNER:
01973         case CLUSCTL_RESOURCE_CLUSTER_NAME_CHANGED:
01974         case CLUSCTL_RESOURCE_CLUSTER_VERSION_CHANGED:
01975         default:
01976             sc = ERROR_INVALID_FUNCTION;
01977             break;
01978     } // switch: nControlCodeIn
01979
01980     return sc;
01981
01982 } //*** FileShareSampleResourceControl
01983
01984
01985 /////////////////////////////////////////////////////////////////////////////
01986 //++
01987 //
01988 //  FileShareSampleResourceTypeControl
01989 //
01990 //  Description:
01991 //      ResourceTypeControl routine for File Share Sample resources.
01992 //
01993 //      Perform the control request specified by nControlCode.
01994 //
01995 //  Arguments:
01996 //      pwszResourceTypeNameIn
01997 //          Supplies the name of the resource type.
01998 //
01999 //      nControlCodeIn
02000 //          Supplies the control code that defines the action to be performed.
02001 //
02002 //      pInBufferIn
02003 //          Supplies a pointer to a buffer containing input data.
02004 //
02005 //      cbInBufferSizeIn
02006 //          Supplies the size, in bytes, of the data pointed to by pInBufferIn.
02007 //
02008 //      pOutBufferOut
02009 //          Supplies a pointer to the output buffer to be filled in.
02010 //
02011 //      cbOutBufferSizeIn
02012 //          Supplies the size, in bytes, of the available space pointed to by
02013 //          pOutBufferOut.
02014 //
02015 //      pcbBytesReturnedOut
02016 //          Returns the number of bytes of pOutBufferOut actually filled in by
02017 //          the resource.  If pOutBufferOut is too small, pcbBytesReturnedOut
02018 //          contains the total number of bytes for the operation to succeed.
02019 //
02020 //  Return Value:
02021 //      ERROR_SUCCESS
02022 //          The function completed successfully.
02023 //
02024 //      ERROR_MORE_DATA
02025 //          The output buffer is too small to return the data.
02026 //          pcbBytesReturned contains the required size.
02027 //
02028 //      ERROR_INVALID_FUNCTION
02029 //          The requested control code is not supported.  In some cases,
02030 //          this allows the cluster software to perform the work.
02031 //
02032 //      Win32 error code
02033 //          The function failed.
02034 //
02035 //--
02036 /////////////////////////////////////////////////////////////////////////////
02037 DWORD WINAPI
02038 FileShareSampleResourceTypeControl(
02039       LPCWSTR   pwszResourceTypeNameIn
02040     , DWORD     nControlCodeIn
02041     , PVOID     pInBufferIn
02042     , DWORD     cbInBufferSizeIn
02043     , PVOID     pOutBufferOut
02044     , DWORD     cbOutBufferSizeIn
02045     , LPDWORD   pcbBytesReturnedOut
02046     )
02047 {
02048     DWORD   sc = ERROR_SUCCESS;
02049
02050     UNREFERENCED_PARAMETER( pwszResourceTypeNameIn );
02051     UNREFERENCED_PARAMETER( pInBufferIn );
02052     UNREFERENCED_PARAMETER( cbInBufferSizeIn );
02053
02054     switch ( nControlCodeIn )
02055     {
02056
02057         case CLUSCTL_RESOURCE_TYPE_UNKNOWN:
02058             *pcbBytesReturnedOut = 0;
02059             sc = ERROR_SUCCESS;
02060             break;
02061
02062         case CLUSCTL_RESOURCE_TYPE_ENUM_PRIVATE_PROPERTIES:
02063         {
02064             DWORD cbRequired = 0;
02065             sc = ResUtilEnumProperties(
02066                       FileShareSampleResourcePrivateProperties
02067                     , static_cast< LPWSTR >( pOutBufferOut )
02068                     , cbOutBufferSizeIn
02069                     , pcbBytesReturnedOut
02070                     , &cbRequired
02071                     );
02072             if ( sc == ERROR_MORE_DATA )
02073             {
02074                 *pcbBytesReturnedOut = cbRequired;
02075             } // if: output buffer is too small
02076             break;
02077         }
02078
02079         case CLUSCTL_RESOURCE_TYPE_GET_REQUIRED_DEPENDENCIES:
02080         case CLUSCTL_RESOURCE_TYPE_GET_CHARACTERISTICS:
02081         case CLUSCTL_RESOURCE_TYPE_GET_CLASS_INFO:
02082         case CLUSCTL_RESOURCE_TYPE_STORAGE_GET_AVAILABLE_DISKS:
02083         case CLUSCTL_RESOURCE_TYPE_INSTALL_NODE:
02084         case CLUSCTL_RESOURCE_TYPE_EVICT_NODE:
02085         default:
02086             sc = ERROR_INVALID_FUNCTION;
02087             break;
02088     } // switch: nControlCode
02089
02090     return sc;
02091
02092 } //*** FileShareSampleResourceTypeControl
02093
02094
02095 /////////////////////////////////////////////////////////////////////////////
02096 //++
02097 //
02098 //  FileShareSampleGetPrivateResProperties
02099 //
02100 //  Description:
02101 //      Processes the CLUSCTL_RESOURCE_GET_PRIVATE_PROPERTIES control
02102 //      function for resources of type File Share Sample.
02103 //
02104 //  Arguments:
02105 //      pResourceEntryIn
02106 //          Supplies the resource entry on which to operate.
02107 //
02108 //      pOutBufferOut
02109 //          Supplies a pointer to the output buffer to be filled in.
02110 //
02111 //      cbOutBufferSizeIn
02112 //          Supplies the size, in bytes, of the available space pointed to by
02113 //          pOutBuffer.
02114 //
02115 //      pcbBytesReturnedOut
02116 //          Returns the number of bytes of pOutBuffer actually filled in by
02117 //          the resource.  If pOutBuffer is too small, pcbBytesReturnedOut
02118 //          contains the total number of bytes for the operation to succeed.
02119 //
02120 //  Return Value:
02121 //      ERROR_SUCCESS
02122 //          The function completed successfully.
02123 //
02124 //      ERROR_MORE_DATA
02125 //          The output buffer is too small to return the data.
02126 //          pcbBytesReturnedOut contains the required size.
02127 //
02128 //      ERROR_INVALID_PARAMETER
02129 //          The data is formatted incorrectly.
02130 //
02131 //      ERROR_NOT_ENOUGH_MEMORY
02132 //          An error occurred allocating memory.
02133 //
02134 //      Win32 error code
02135 //          The function failed.
02136 //
02137 //--
02138 /////////////////////////////////////////////////////////////////////////////
02139 DWORD
02140 FileShareSampleGetPrivateResProperties(
02141       PFILESHARESAMPLE_RESOURCE   pResourceEntryIn
02142     , PVOID                     pOutBufferOut
02143     , DWORD                     cbOutBufferSizeIn
02144     , LPDWORD                   pcbBytesReturnedOut
02145     )
02146 {
02147     DWORD   sc;
02148     DWORD   cbRequired = 0;
02149
02150     sc = ResUtilGetAllProperties(
02151               pResourceEntryIn->hkeyParameters
02152             , FileShareSampleResourcePrivateProperties
02153             , pOutBufferOut
02154             , cbOutBufferSizeIn
02155             , pcbBytesReturnedOut
02156             , &cbRequired
02157             );
02158     if ( sc == ERROR_MORE_DATA )
02159     {
02160         *pcbBytesReturnedOut = cbRequired;
02161     } // if: output buffer is too small
02162
02163     return sc;
02164
02165 } //*** FileShareSampleGetPrivateResProperties
02166
02167
02168 /////////////////////////////////////////////////////////////////////////////
02169 //++
02170 //
02171 //  FileShareSampleValidatePrivateResProperties
02172 //
02173 //  Description:
02174 //      Processes the CLUSCTL_RESOURCE_VALIDATE_PRIVATE_PROPERTIES control
02175 //      function for resources of type File Share Sample.
02176 //
02177 //  Arguments:
02178 //      pResourceEntryIn
02179 //          Supplies the resource entry on which to operate.
02180 //
02181 //      pInBufferIn
02182 //          Supplies a pointer to a buffer containing input data.
02183 //
02184 //      cbOutBufferSizeIn
02185 //          Supplies the size, in bytes, of the data pointed to by pInBufferIn.
02186 //
02187 //      pPropsOut
02188 //          Supplies the parameter block to fill in (optional).
02189 //
02190 //  Return Value:
02191 //      ERROR_SUCCESS
02192 //          The function completed successfully.
02193 //
02194 //      ERROR_INVALID_PARAMETER
02195 //          The data is formatted incorrectly.
02196 //
02197 //      ERROR_NOT_ENOUGH_MEMORY
02198 //          An error occurred allocating memory.
02199 //
02200 //      Win32 error code
02201 //          The function failed.
02202 //
02203 //--
02204 /////////////////////////////////////////////////////////////////////////////
02205 DWORD
02206 FileShareSampleValidatePrivateResProperties(
02207       PFILESHARESAMPLE_RESOURCE   pResourceEntryIn
02208     , PVOID                     pInBufferIn
02209     , DWORD                     cbInBufferSizeIn
02210     , PFILESHARESAMPLE_PROPS      pPropsOut
02211     )
02212 {
02213     DWORD                   sc = ERROR_SUCCESS;
02214     FILESHARESAMPLE_PROPS   propsCurrent;
02215     FILESHARESAMPLE_PROPS   propsNew;
02216     PFILESHARESAMPLE_PROPS  pLocalProps = NULL;
02217     LPWSTR                  pwszNameOfPropInError;
02218     BOOL                    fRetrievedProps = FALSE;
02219
02220     //
02221     // Check if there is input data.
02222     //
02223
02224     if (    (pInBufferIn == NULL)
02225         ||  (cbInBufferSizeIn < sizeof( DWORD )) )
02226     {
02227         sc = ERROR_INVALID_DATA;
02228         goto Cleanup;
02229     } // if: no input buffer or input buffer not big enough to contain property list
02230
02231     //
02232     // Retrieve the current set of private properties from the
02233     // cluster database.
02234     //
02235
02236     ZeroMemory( &propsCurrent, sizeof( propsCurrent ) );
02237
02238     sc = ResUtilGetPropertiesToParameterBlock(
02239                pResourceEntryIn->hkeyParameters
02240              , FileShareSampleResourcePrivateProperties
02241              , reinterpret_cast< LPBYTE >( &propsCurrent )
02242              , FALSE /*CheckForRequiredProperties*/
02243              , &pwszNameOfPropInError
02244              );
02245     if ( sc != ERROR_SUCCESS )
02246     {
02247         (g_pfnLogEvent)(
02248               pResourceEntryIn->hResourceHandle
02249             , LOG_ERROR
02250             , L"Unable to read the '%1!s!' property. Error: %2!u!.\n"
02251             , (pwszNameOfPropInError == NULL ? L"" : pwszNameOfPropInError)
02252             , sc
02253             );
02254         goto Cleanup;
02255     } // if: error getting properties
02256     fRetrievedProps = TRUE;
02257
02258     //
02259     // Duplicate the resource parameter block.
02260     //
02261
02262     if ( pPropsOut == NULL )
02263     {
02264         pLocalProps = &propsNew;
02265     } // if: no parameter block passed in
02266     else
02267     {
02268         pLocalProps = pPropsOut;
02269     } // else: parameter block passed in
02270
02271     ZeroMemory( pLocalProps, sizeof( *pLocalProps ) );
02272
02273     sc = ResUtilDupParameterBlock(
02274               reinterpret_cast< LPBYTE >( pLocalProps )
02275             , reinterpret_cast< LPBYTE >( &propsCurrent )
02276             , FileShareSampleResourcePrivateProperties
02277             );
02278     if ( sc != ERROR_SUCCESS )
02279     {
02280         goto Cleanup;
02281     } // if: error duplicating the parameter block
02282
02283     //
02284     // Parse and validate the properties.
02285     //
02286
02287     sc = ResUtilVerifyPropertyTable(
02288               FileShareSampleResourcePrivateProperties
02289             , NULL
02290             , TRUE // AllowUnknownProperties
02291             , pInBufferIn
02292             , cbInBufferSizeIn
02293             , reinterpret_cast< LPBYTE >( pLocalProps )
02294             );
02295     if ( sc != ERROR_SUCCESS )
02296     {
02297         goto Cleanup;
02298     } // if: property list not validated successfully
02299
02300     //
02301     // Validate the property values.
02302     //
02303
02304     //
02305     // TODO: Code to validate interactions between properties goes here.
02306     //
02307
02308 Cleanup:
02309
02310     //
02311     // Cleanup our parameter block.
02312     //
02313
02314     if (    ( pLocalProps == &propsNew )
02315         ||  (   ( sc != ERROR_SUCCESS)
02316             &&  ( pLocalProps != NULL )
02317             )
02318        )
02319     {
02320         ResUtilFreeParameterBlock(
02321               reinterpret_cast< LPBYTE >( pLocalProps )
02322             , reinterpret_cast< LPBYTE >( &propsCurrent )
02323             , FileShareSampleResourcePrivateProperties
02324             );
02325     } // if: we duplicated the parameter block
02326
02327     if ( fRetrievedProps )
02328     {
02329         ResUtilFreeParameterBlock(
02330               reinterpret_cast< LPBYTE >( &propsCurrent )
02331             , NULL
02332             , FileShareSampleResourcePrivateProperties
02333             );
02334     } // if: properties were retrieved
02335
02336     return sc;
02337
02338 } // FileShareSampleValidatePrivateResProperties
02339
02340
02341 /////////////////////////////////////////////////////////////////////////////
02342 //++
02343 //
02344 //  FileShareSampleSetPrivateResProperties
02345 //
02346 //  Description:
02347 //      Processes the CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES control
02348 //      function for resources of type File Share Sample.
02349 //
02350 //  Arguments:
02351 //      pResourceEntryIn
02352 //          Supplies the resource entry on which to operate.
02353 //
02354 //      pInBufferIn
02355 //          Supplies a pointer to a buffer containing input data.
02356 //
02357 //      cbOutBufferSizeIn
02358 //          Supplies the size, in bytes, of the data pointed to by pInBufferIn.
02359 //
02360 //  Return Value:
02361 //      ERROR_SUCCESS
02362 //          The function completed successfully.
02363 //
02364 //      ERROR_INVALID_PARAMETER
02365 //          The data is formatted incorrectly.
02366 //
02367 //      ERROR_NOT_ENOUGH_MEMORY
02368 //          An error occurred allocating memory.
02369 //
02370 //      Win32 error code
02371 //          The function failed.
02372 //
02373 //--
02374 /////////////////////////////////////////////////////////////////////////////
02375 DWORD
02376 FileShareSampleSetPrivateResProperties(
02377       PFILESHARESAMPLE_RESOURCE pResourceEntryIn
02378     , PVOID                     pInBufferIn
02379     , DWORD                     cbInBufferSizeIn
02380     )
02381 {
02382     DWORD                   sc = ERROR_SUCCESS;
02383     FILESHARESAMPLE_PROPS   props;
02384     BOOL                    fAllowDynamicChanges = FALSE;
02385     PSHARE_INFO_2           psiOld = NULL;
02386     SHARE_INFO_2            siNew;
02387     DWORD                   nInvalidParam;
02388
02389     //
02390     // Parse the properties so they can be validated together.
02391     // This routine does individual property validation.
02392     //
02393
02394     sc = FileShareSampleValidatePrivateResProperties( pResourceEntryIn, pInBufferIn, cbInBufferSizeIn, &props );
02395     if ( sc != ERROR_SUCCESS )
02396     {
02397         goto Cleanup;
02398     } // if: error validating properties
02399
02400     //
02401     // Only update the share if the name and the path didn't change.
02402     //
02403
02404     if (   (    ( pResourceEntryIn->props.pwszShareName != NULL )
02405              && ( IStringCompareW( props.pwszShareName, pResourceEntryIn->props.pwszShareName ) != 0 )
02406            )
02407         || (    ( pResourceEntryIn->props.pwszPath != NULL )
02408              && ( IStringCompareW( props.pwszPath, pResourceEntryIn->props.pwszPath ) != 0 )
02409            )
02410        )
02411     {
02412         fAllowDynamicChanges = FALSE;
02413     } // if: share or path changed
02414     else
02415     {
02416         fAllowDynamicChanges = TRUE;
02417     } // else: share and path
02418
02419     //
02420     // Save the property values.
02421     //
02422
02423     sc = ResUtilSetPropertyParameterBlock(
02424               pResourceEntryIn->hkeyParameters
02425             , FileShareSampleResourcePrivateProperties
02426             , NULL
02427             , reinterpret_cast< LPBYTE >( &props )
02428             , pInBufferIn
02429             , cbInBufferSizeIn
02430             , reinterpret_cast< LPBYTE >( &pResourceEntryIn->props )
02431             );
02432
02433     ResUtilFreeParameterBlock(
02434               reinterpret_cast< LPBYTE >( &props )
02435             , reinterpret_cast< LPBYTE >( &pResourceEntryIn->props )
02436             , FileShareSampleResourcePrivateProperties
02437             );
02438
02439     if ( sc != ERROR_SUCCESS )
02440     {
02441         goto Cleanup;
02442     } // if: properties not set successfully
02443
02444     //
02445     // If the resource is online, return a non-success status.
02446     //
02447
02448     if (    ( pResourceEntryIn->state == ClusterResourceOnline )
02449          && ( fAllowDynamicChanges == TRUE )
02450        )
02451     {
02452         //
02453         // Get the current share info.
02454         //
02455
02456         sc = NetShareGetInfo(
02457                       NULL      // pwszServer
02458                     , pResourceEntryIn->props.pwszShareName
02459                     , 2         // level
02460                     , reinterpret_cast< LPBYTE * >( &psiOld )
02461                     );
02462         if ( sc != NERR_Success )
02463         {
02464             sc = ERROR_RESOURCE_PROPERTIES_STORED;
02465             goto Cleanup;
02466         } // if:
02467
02468         //
02469         // Set new share info.
02470         //
02471
02472         //
02473         // Note: NetShareSetInfo ignores all but shi2_remark and shi2_max_uses.
02474         //
02475
02476         CopyMemory( &siNew, psiOld, sizeof( siNew ) );
02477         siNew.shi2_remark =     pResourceEntryIn->props.pwszRemark;
02478         siNew.shi2_max_uses =   pResourceEntryIn->props.nMaxUsers;
02479
02480         sc = NetShareSetInfo(
02481                       NULL      // pwszServer
02482                     , pResourceEntryIn->props.pwszShareName
02483                     , 2         // level
02484                     , reinterpret_cast< LPBYTE >( &siNew )
02485                     , &nInvalidParam
02486                     );
02487         if ( sc != NERR_Success )
02488         {
02489             (g_pfnLogEvent)(
02490                   pResourceEntryIn->hResourceHandle
02491                 , LOG_ERROR
02492                 , L"SetPrivateProps: Error setting info on share '%1!ws!'. Error %2!u!, property # %3!d!.\n"
02493                 , pResourceEntryIn->props.pwszShareName
02494                 , sc
02495                 , nInvalidParam
02496                 );
02497             sc = ERROR_RESOURCE_PROPERTIES_STORED;
02498             goto Cleanup;
02499         } // if:  error setting new share info
02500
02501         sc = ERROR_SUCCESS;
02502
02503     } // if: resource is currently online
02504     else if (    ( pResourceEntryIn->state == ClusterResourceOnline )
02505               || ( pResourceEntryIn->state == ClusterResourceOnlinePending )
02506             )
02507     {
02508         sc = ERROR_RESOURCE_PROPERTIES_STORED;
02509     } // else if: resource is currently online or online pending
02510     else
02511     {
02512         sc = ERROR_SUCCESS;
02513     } // else: resource is in some other state
02514
02515 Cleanup:
02516
02517     if ( psiOld != NULL )
02518     {
02519         NetApiBufferFree( psiOld );
02520     } // if:
02521
02522     return sc;
02523
02524 } //*** FileShareSampleSetPrivateResProperties
02525
02526
02527 /////////////////////////////////////////////////////////////////////////////
02528 //++
02529 //
02530 //  FileShareSampleSetNameHandler
02531 //
02532 //  Description:
02533 //      Handle the CLUSCTL_RESOURCE_SET_NAME control code by saving the new
02534 //      name of the resource.
02535 //
02536 //  Arguments:
02537 //      pResourceEntryIn
02538 //          Supplies the resource entry on which to operate.
02539 //
02540 //      pwszNameIn
02541 //          The new name of the resource.
02542 //
02543 //  Return Value:
02544 //      ERROR_SUCCESS
02545 //          The function completed successfully.
02546 //
02547 //      Win32 error code
02548 //          The function failed.
02549 //
02550 //--
02551 /////////////////////////////////////////////////////////////////////////////
02552 DWORD
02553 FileShareSampleSetNameHandler(
02554       PFILESHARESAMPLE_RESOURCE   pResourceEntryIn
02555     , LPWSTR                    pwszNameIn
02556     )
02557 {
02558     DWORD   sc = ERROR_SUCCESS;
02559     DWORD   cchNameBuffer = 0;
02560     HRESULT hr = S_OK;
02561     WCHAR * pwszTemp = NULL;
02562
02563     //
02564     // Allocate a buffer for the new name.
02565     //
02566
02567     cchNameBuffer = lstrlenW( pwszNameIn ) + 1;
02568     pwszTemp = new WCHAR[ cchNameBuffer ];
02569     if ( pwszTemp == NULL )
02570     {
02571         sc = GetLastError();
02572         (g_pfnLogEvent)(
02573               pResourceEntryIn->hResourceHandle
02574             , LOG_ERROR
02575             , L"Failed to allocate memory for the new resource name '%1!s!'. Error: %2!u!.\n"
02576             , pwszNameIn
02577             , sc
02578             );
02579         goto Cleanup;
02580     } // if: error allocating memory for the name.
02581
02582     //
02583     // Copy the new name to the new buffer.
02584     //
02585
02586     hr = StringCchCopyW( pwszTemp, cchNameBuffer, pwszNameIn );
02587     if ( FAILED( hr ) )
02588     {
02589         sc = HRESULT_CODE( hr );
02590         goto Cleanup;
02591     } // if:
02592
02593     //
02594     // All went well, free the old buffer and assign the new one.
02595     //
02596
02597     delete [] pResourceEntryIn->pwszResourceName;
02598     pResourceEntryIn->pwszResourceName = pwszTemp;
02599     pwszTemp = NULL;
02600
02601 Cleanup:
02602
02603     delete [] pwszTemp;
02604
02605     return sc;
02606
02607 } //*** FileShareSampleSetNameHandler
02608
02609
02610 /////////////////////////////////////////////////////////////////////////////
02611 //
02612 // Define Function Table
02613 //
02614 /////////////////////////////////////////////////////////////////////////////
02615
02616 CLRES_V1_FUNCTION_TABLE(
02617     g_FileShareSampleFunctionTable,       // Name
02618     CLRES_VERSION_V1_00,                // Version
02619     FileShareSample,                      // Prefix
02620     NULL,                               // Arbitrate
02621     NULL,                               // Release
02622     FileShareSampleResourceControl,       // ResControl
02623     FileShareSampleResourceTypeControl    // ResTypeControl
02624     );
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows.Net/ceerror.cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows.Net

ceerror.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2002
00005 //
00006 // File:        ceerror.cpp
00007 //
00008 // Contents:    Cert Server error wrapper routines
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include <pch.cpp>
00013
00014 #pragma hdrstop
00015
00016 #include "celib.h"
00017 #include <assert.h>
00018 #include <ntdsbmsg.h>
00019 #include <delayimp.h>
00020 #include <wininet.h>
00021
00022 #define CERTLIB_12BITERRORMASK  0x00000fff
00023 #define CERTLIB_WIN32ERRORMASK  0x0000ffff
00024
00025
00026 //+--------------------------------------------------------------------------
00027 // Jet errors:
00028
00029 #define HRESULT_FROM_JETWARNING(jerr) \
00030         (ERROR_SEVERITY_WARNING | (FACILITY_NTDSB << 16) | jerr)
00031
00032 #define HRESULT_FROM_JETERROR(jerr) \
00033         (ERROR_SEVERITY_ERROR | (FACILITY_NTDSB << 16) | -jerr)
00034
00035 #define JETERROR_FROM_HRESULT(hr) \
00036         (-(LONG) (CERTLIB_WIN32ERRORMASK & (hr)))
00037
00038 #define ISJETERROR(hr) \
00039         ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) ~CERTLIB_WIN32ERRORMASK)
00040
00041 #define ISJETHRESULT(hr) \
00042     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_ERROR | \
00043                 (FACILITY_NTDSB << 16)))
00044
00045 #define wszJETERRORPREFIX       L"ESE"
00046
00047
00048 //+--------------------------------------------------------------------------
00049 // Setup API errors:
00050
00051 #define ISSETUPHRESULT(hr) \
00052     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_ERROR | \
00053                                               APPLICATION_ERROR_MASK | \
00054                                               (FACILITY_NULL << 16)))
00055
00056 #define wszSETUPERRORPREFIX       L"INF"
00057
00058
00059 //+--------------------------------------------------------------------------
00060 // Win32 errors:
00061
00062 #define ISWIN32ERROR(hr) \
00063         ((~CERTLIB_WIN32ERRORMASK & (hr)) == 0)
00064
00065 #define ISWIN32HRESULT(hr) \
00066     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_WARNING | \
00067                 (FACILITY_WIN32 << 16)))
00068
00069 #define WIN32ERROR_FROM_HRESULT(hr) \
00070         (CERTLIB_WIN32ERRORMASK & (hr))
00071
00072 #define wszWIN32ERRORPREFIX     L"WIN32"
00073
00074
00075 //+--------------------------------------------------------------------------
00076 // Http errors:
00077
00078 #define ISHTTPERROR(hr) \
00079     ((HRESULT) HTTP_STATUS_FIRST <= (hr) && (HRESULT) HTTP_STATUS_LAST >= (hr))
00080
00081 #define ISHTTPHRESULT(hr) \
00082     (ISWIN32HRESULT(hr) && ISHTTPERROR(WIN32ERROR_FROM_HRESULT(hr)))
00083
00084 #define wszHTTPERRORPREFIX     L"HTTP"
00085
00086
00087 //+--------------------------------------------------------------------------
00088 // Delayload errors:
00089
00090 #define DELAYLOAD_FROM_WIN32(hr)  VcppException(ERROR_SEVERITY_ERROR, (hr))
00091
00092 #define WIN32ERROR_FROM_DELAYLOAD(hr)  (CERTLIB_WIN32ERRORMASK & (hr))
00093
00094 #define ISDELAYLOADHRESULTFACILITY(hr) \
00095     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_ERROR | \
00096                                               (FACILITY_VISUALCPP << 16)))
00097
00098 // E_DELAYLOAD_MOD_NOT_FOUND    0xc06d007e
00099 #define E_DELAYLOAD_MOD_NOT_FOUND   DELAYLOAD_FROM_WIN32(ERROR_MOD_NOT_FOUND)
00100
00101 // E_DELAYLOAD_PROC_NOT_FOUND   0xc06d007f
00102 #define E_DELAYLOAD_PROC_NOT_FOUND  DELAYLOAD_FROM_WIN32(ERROR_PROC_NOT_FOUND)
00103
00104 #define ISDELAYLOADHRESULT(hr) \
00105         ((HRESULT) E_DELAYLOAD_MOD_NOT_FOUND == (hr) || \
00106          (HRESULT) E_DELAYLOAD_PROC_NOT_FOUND == (hr) || \
00107          HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND) == (hr) || \
00108          HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND) == (hr))
00109
00110
00111 //+--------------------------------------------------------------------------
00112 // ASN encoding errors:
00113
00114 #define ISOSSERROR(hr) \
00115         ((~CERTLIB_12BITERRORMASK & (hr)) == CRYPT_E_OSS_ERROR)
00116
00117 #define OSSERROR_FROM_HRESULT(hr) \
00118         (CERTLIB_12BITERRORMASK & (hr))
00119
00120 #define wszOSSERRORPREFIX       L"ASN"
00121
00122
00123 HRESULT
00124 ceJetHResult(
00125     IN HRESULT hr)
00126 {
00127     if (S_OK != hr)
00128     {
00129         if (SUCCEEDED(hr))
00130         {
00131 #if 0
00132             hr = HRESULT_FROM_JETWARNING(hr);
00133 #else
00134             if (S_FALSE != hr)
00135             {
00136                 _PrintError(hr, "JetHResult: mapping to S_FALSE");
00137             }
00138             assert(S_FALSE == hr);
00139             hr = S_FALSE;
00140 #endif
00141         }
00142         else if (ISJETERROR(hr))
00143         {
00144             hr = HRESULT_FROM_JETERROR(hr);
00145         }
00146     }
00147     assert(S_OK == hr || S_FALSE == hr || FAILED(hr));
00148     return(hr);
00149 }
00150
00151
00152 HRESULT
00153 ceHExceptionCode(
00154     IN EXCEPTION_POINTERS const *pep)
00155 {
00156     HRESULT hr = pep->ExceptionRecord->ExceptionCode;
00157
00158 #if (0 == i386)
00159     if ((HRESULT) STATUS_DATATYPE_MISALIGNMENT == hr)
00160     {
00161   hr = CERTSRV_E_ALIGNMENT_FAULT;
00162     }
00163 #endif
00164     return(ceHError(hr));
00165 }
00166
00167
00168 BOOL
00169 ceIsDelayLoadHResult(
00170     IN HRESULT hr)
00171 {
00172     return(ISDELAYLOADHRESULT(hr));
00173 }
00174
00175
00176 #define wszCOLONSPACE   L": "
00177
00178 WCHAR const *
00179 ceHResultToStringEx(
00180     IN OUT WCHAR *awchr,
00181     IN HRESULT hr,
00182     IN BOOL fRaw)
00183 {
00184     HRESULT hrd;
00185     WCHAR const *pwszType;
00186
00187     hrd = hr;
00188     pwszType = L"";
00189     if (ISJETERROR(hr))
00190     {
00191         pwszType = wszJETERRORPREFIX wszCOLONSPACE;
00192     }
00193     else if (ISJETHRESULT(hr))
00194     {
00195         hrd = JETERROR_FROM_HRESULT(hr);
00196         pwszType = wszJETERRORPREFIX wszCOLONSPACE;
00197     }
00198     else if (ISOSSERROR(hr))
00199     {
00200         hrd = OSSERROR_FROM_HRESULT(hr);
00201         pwszType = wszOSSERRORPREFIX wszCOLONSPACE;
00202     }
00203     else if (ISHTTPHRESULT(hr) || ISHTTPERROR(hr))
00204     {
00205         hrd = WIN32ERROR_FROM_HRESULT(hr);
00206         pwszType = wszWIN32ERRORPREFIX L"/" wszHTTPERRORPREFIX wszCOLONSPACE;
00207     }
00208     else if (ISWIN32HRESULT(hr) || ISWIN32ERROR(hr))
00209     {
00210         hrd = WIN32ERROR_FROM_HRESULT(hr);
00211         pwszType = wszWIN32ERRORPREFIX wszCOLONSPACE;
00212     }
00213     else if (ISDELAYLOADHRESULTFACILITY(hr))
00214     {
00215         hrd = WIN32ERROR_FROM_DELAYLOAD(hr);
00216         pwszType = wszWIN32ERRORPREFIX wszCOLONSPACE;
00217     }
00218     else if (ISSETUPHRESULT(hr))
00219     {
00220         pwszType = wszSETUPERRORPREFIX wszCOLONSPACE;
00221     }
00222     if (fRaw)
00223     {
00224         pwszType = L"";
00225     }
00226
00227     _snwprintf(
00228         awchr,
00229         cwcHRESULTSTRING,
00230         L"0x%x (%ws%d)",
00231         hr,
00232         pwszType,
00233         hrd);
00234     return(awchr);
00235 }
00236
00237
00238 WCHAR const *
00239 ceHResultToString(
00240     IN OUT WCHAR *awchr,
00241     IN HRESULT hr)
00242 {
00243     return(ceHResultToStringEx(awchr, hr, FALSE));
00244 }
00245
00246
00247 WCHAR const *
00248 ceHResultToStringRaw(
00249     IN OUT WCHAR *awchr,
00250     IN HRESULT hr)
00251 {
00252     return(ceHResultToStringEx(awchr, hr, TRUE));
00253 }
00254
00255
00256 static HMODULE s_hMod = NULL;
00257 static DWORD s_idsUnexpected = 0;
00258 static DWORD s_idsUnknownErrorCode = 0; // L"Error %ws %ws"
00259
00260 VOID
00261 ceInitErrorMessageText(
00262     IN HMODULE hMod,
00263     IN DWORD idsUnexpected,
00264     IN DWORD idsUnknownErrorCode) // L"Error %ws %ws"
00265 {
00266     s_hMod = hMod;
00267     s_idsUnexpected = idsUnexpected;
00268     s_idsUnknownErrorCode = idsUnknownErrorCode;
00269 }
00270
00271
00272 DWORD
00273 errFormatMessage(
00274     IN HMODULE hMod,
00275     IN HRESULT hr,
00276     OUT WCHAR const **ppwszOut,
00277     OPTIONAL IN WCHAR const * const *ppwszArgs)
00278 {
00279     DWORD dwFlags;
00280
00281     dwFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER;
00282     if (NULL == hMod)
00283     {
00284   dwFlags |= FORMAT_MESSAGE_FROM_SYSTEM;
00285     }
00286     else
00287     {
00288   dwFlags |= FORMAT_MESSAGE_FROM_HMODULE;
00289     }
00290     if (NULL == ppwszArgs || NULL == ppwszArgs[0])
00291     {
00292   dwFlags |= FORMAT_MESSAGE_IGNORE_INSERTS;
00293     }
00294     else
00295     {
00296   dwFlags |= FORMAT_MESSAGE_ARGUMENT_ARRAY;
00297     }
00298     return(FormatMessage(
00299     dwFlags,
00300                 hMod,
00301                 hr,
00302                 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00303                 (WCHAR *) ppwszOut,
00304                 1,
00305     (va_list *) ppwszArgs));
00306 }
00307
00308
00309 // Alloc and return error message string
00310
00311 WCHAR const *
00312 ceGetErrorMessageText(
00313     IN HRESULT hr,
00314     IN BOOL fHResultString)
00315 {
00316     return(ceGetErrorMessageTextEx(hr, fHResultString, NULL));
00317 }
00318
00319
00320 WCHAR const *
00321 ceGetErrorMessageText1(
00322     IN HRESULT hr,
00323     IN BOOL fHResultString,
00324     IN OPTIONAL WCHAR const *pwszInsertionText)
00325 {
00326     WCHAR const *apwszInsertionText[2];
00327     WCHAR const * const *papwsz = NULL;
00328
00329     if (NULL != pwszInsertionText)
00330     {
00331   apwszInsertionText[0] = pwszInsertionText;
00332   apwszInsertionText[1] = NULL;
00333   papwsz = apwszInsertionText;
00334     }
00335     return(ceGetErrorMessageTextEx(hr, fHResultString, papwsz));
00336 }
00337
00338
00339 WCHAR const *
00340 ceGetErrorMessageTextEx(
00341     IN HRESULT hr,
00342     IN BOOL fHResultString,
00343     IN OPTIONAL WCHAR const * const *papwszInsertionText)
00344 {
00345     WCHAR const *pwszRet = NULL;
00346     WCHAR const *pwszRetStatic = NULL;
00347     WCHAR *pwszMsgT;
00348     WCHAR awchr[cwcHRESULTSTRING];
00349     DWORD cwc;
00350     DWORD cwcCopy;
00351     DWORD cwcUnexpected;
00352     WCHAR const *pwszUnexpected = NULL;
00353     WCHAR wszEmpty[] = L"";
00354     HMODULE hMod1 = NULL;
00355     HMODULE hMod2 = NULL;
00356
00357     if (E_UNEXPECTED == hr)
00358     {
00359   pwszUnexpected = L"Unexpected method call sequence.";
00360     }
00361 #if (0 == i386)
00362     else if (STATUS_DATATYPE_MISALIGNMENT == hr)
00363     {
00364   pwszUnexpected = L"Possible data alignment fault.";
00365     }
00366 #endif
00367     if (NULL == pwszUnexpected)
00368     {
00369   pwszUnexpected = wszEmpty;
00370     }
00371     cwcUnexpected = wcslen(pwszUnexpected);
00372
00373     cwc = errFormatMessage(NULL, hr, &pwszRet, papwszInsertionText);
00374     if (0 == cwc && ISDELAYLOADHRESULTFACILITY(hr))
00375     {
00376   cwc = errFormatMessage(
00377       NULL,
00378       WIN32ERROR_FROM_DELAYLOAD(hr),
00379       &pwszRet,
00380       papwszInsertionText);
00381     }
00382     if (0 == cwc)
00383     {
00384         hMod1 = LoadLibrary(L"ntdsbmsg.dll");
00385         if (NULL != hMod1)
00386         {
00387             HRESULT hrEDB = hr;
00388             HRESULT hrFormat;
00389             BOOL fFirst = TRUE;
00390
00391             while (TRUE)
00392             {
00393                 cwc = errFormatMessage(hMod1, hrEDB, &pwszRet, papwszInsertionText);
00394                 if (0 == cwc && FAILED(hrEDB) && fFirst)
00395                 {
00396                     hrFormat = ceHLastError();
00397                     if (HRESULT_FROM_WIN32(ERROR_MR_MID_NOT_FOUND) == hrFormat)
00398                     {
00399                         hrEDB = ceJetHResult(hrEDB);
00400                         if (hrEDB != hr)
00401                         {
00402                             fFirst = FALSE;
00403                             continue;
00404                         }
00405                     }
00406                 }
00407                 break;
00408             }
00409         }
00410     }
00411     if (0 == cwc)
00412     {
00413   HMODULE hModT = GetModuleHandle(L"wininet.dll");
00414         if (NULL != hModT)
00415         {
00416             HRESULT hrHttp = hr;
00417             HRESULT hrFormat;
00418             BOOL fFirst = TRUE;
00419
00420             while (TRUE)
00421             {
00422     cwc = errFormatMessage(hModT, hrHttp, &pwszRet, papwszInsertionText);
00423                 if (0 == cwc && ISWIN32HRESULT(hrHttp) && fFirst)
00424                 {
00425                     hrFormat = ceHLastError();
00426                     if (HRESULT_FROM_WIN32(ERROR_MR_MID_NOT_FOUND) == hrFormat)
00427                     {
00428       hrHttp = WIN32ERROR_FROM_HRESULT(hrHttp);
00429                         if (hrHttp != hr)
00430                         {
00431                             fFirst = FALSE;
00432                             continue;
00433                         }
00434                     }
00435                 }
00436                 break;
00437             }
00438         }
00439     }
00440     if (0 == cwc)
00441     {
00442         hMod2 = LoadLibrary(L"cdosys.dll");
00443         if (NULL != hMod2)
00444         {
00445       cwc = errFormatMessage(hMod2, hr, &pwszRet, papwszInsertionText);
00446         }
00447     }
00448
00449     if (0 == cwc) // couldn't find error, use default & error code
00450     {
00451   fHResultString = TRUE;
00452     }
00453     awchr[0] = L'\0';
00454     if (fHResultString)
00455     {
00456   ceHResultToString(awchr, hr);
00457     }
00458
00459     if (0 == cwc)
00460     {
00461   pwszRetStatic = L"Error";
00462   pwszRet = pwszRetStatic;
00463     }
00464
00465     // strip trailing \r\n
00466
00467     cwcCopy = wcslen(pwszRet);
00468     if (2 <= cwcCopy &&
00469   L'\r' == pwszRet[cwcCopy - 2] &&
00470   L'\n' == pwszRet[cwcCopy - 1])
00471     {
00472   cwcCopy -= 2;
00473     }
00474     cwc = cwcCopy + 1 + cwcUnexpected + 1 + wcslen(awchr) + 1;
00475     pwszMsgT = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
00476     if (NULL == pwszMsgT)
00477     {
00478   _JumpError(E_OUTOFMEMORY, error, "LocalAlloc");
00479     }
00480     CopyMemory(pwszMsgT, pwszRet, cwcCopy * sizeof(WCHAR));
00481     pwszMsgT[cwcCopy] = L'\0';
00482
00483     if (0 != cwcUnexpected)
00484     {
00485   wcscat(pwszMsgT, L" ");
00486   wcscat(pwszMsgT, pwszUnexpected);
00487     }
00488     if (fHResultString)
00489     {
00490   wcscat(pwszMsgT, L" ");
00491   wcscat(pwszMsgT, awchr);
00492     }
00493     assert(wcslen(pwszMsgT) < cwc);
00494     if (NULL != pwszRet && pwszRetStatic != pwszRet)
00495     {
00496   LocalFree(const_cast<WCHAR *>(pwszRet));
00497     }
00498     pwszRet = pwszMsgT;
00499
00500 error:
00501     if (NULL != hMod1)
00502     {
00503         FreeLibrary(hMod1);
00504     }
00505     if (NULL != hMod2)
00506     {
00507         FreeLibrary(hMod2);
00508     }
00509     return(pwszRet);
00510 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WRTHANDLE Member List

This is the complete list of members for WRTHANDLE, including all inherited members.
hEvent | WRTHANDLE
hPipe | WRTHANDLE
hThread | WRTHANDLE
live | WRTHANDLE
Name | WRTHANDLE
overLap | WRTHANDLE
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vc/myclassfactory.h Source File

  • Dataaccess
  • osp
  • vc

myclassfactory.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample OLEDB Simple Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation.  All Rights Reserved.
00004 //
00005 // module MyClassFactory.h | Class Definitions for MyClassFactory and
00006 // DLL Entry Points
00007 //
00008 //
00009
00010 ////////////////////////////////////////////////////////
00011 // Includes
00012 //
00013 ////////////////////////////////////////////////////////
00014 #include "MyDataSource.h"
00015
00016
00017 ////////////////////////////////////////////////////////
00018 // MyClassFactory
00019 //
00020 ////////////////////////////////////////////////////////
00021 class MyClassFactory : public IClassFactory
00022 {
00023   public: // @access public
00024     MyClassFactory(void);
00025     virtual ~MyClassFactory(void);
00026
00027     //  IUnknown members
00028     virtual inline STDMETHODIMP_(ULONG) AddRef()
00029     {
00030       InterlockedIncrement((LONG*)&m_cRef);
00031       return m_cRef;
00032     }
00033     virtual inline STDMETHODIMP_(ULONG) Release()
00034     {
00035       if(InterlockedDecrement((LONG*)&m_cRef))
00036         return m_cRef;
00037
00038       delete this;
00039       return 0;
00040     }
00041     virtual STDMETHODIMP  QueryInterface(REFIID riid, void** ppv);
00042
00043     //  IClassFactory members
00044     STDMETHODIMP  CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00045     STDMETHODIMP  LockServer(BOOL);
00046
00047     HRESULT     GetProviderCLSID();
00048
00049   protected: //@access protected
00050     ULONG     m_cRef;
00051     GUID      m_guidProv;
00052 };
00053
00054
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/proppageuserui.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

proppageuserui.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       proppageuserui.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #ifndef _PROPPAGEUSERUI_H
00012 #define _PROPPAGEUSERUI_H
00013
00014 #include "resource.h"
00015 #include "util.h"
00016
00017
00018
00019
00020 ///////////////////////////////////////////////////////////////
00021
00022 class CProppageUserUI : public CPropertyPage
00023 {
00024 public:
00025   CProppageUserUI(HWND hNotifyObj)
00026     : CPropertyPage(IDD_USER_PAGE_EXT),
00027       m_hNotifyObj(hNotifyObj)
00028   {
00029   }
00030
00031   ~CProppageUserUI()
00032   {
00033   }
00034
00035   afx_msg void OnChangePicture();
00036   afx_msg void OnClearPicture();
00037   afx_msg void OnEmployeeIDChange();
00038
00039   virtual BOOL OnInitDialog();
00040   virtual BOOL OnApply();
00041   virtual void OnDestroy();
00042
00043
00044   HRESULT Init(PWSTR pszPath, PWSTR pszClass);
00045
00046 private:
00047   void SetUIData();
00048   void SetUIEmployeeID();
00049   void SetUIPhoto();
00050
00051   HRESULT WriteEmployeeID();
00052
00053
00054   // Control accessors
00055   CButton* GetChangePictureButton() { return (CButton*)GetDlgItem(IDC_BUTTON_CHANGE_PICTURE); }
00056   CButton* GetClearPictureButton() { return (CButton*)GetDlgItem(IDC_BUTTON_CLEAR_PICTURE); }
00057   CEdit*   GetPathEdit() { return (CEdit*)GetDlgItem(IDC_EDIT_PICTURE_PATH); }
00058   CEdit*   GetIDEdit() { return (CEdit*)GetDlgItem(IDC_EDIT_EMPLOYEE_ID); }
00059   CStatic* GetPicture() { return (CStatic*)GetDlgItem(IDC_PICTURE_DISPLAY); }
00060
00061 private:
00062   HWND    m_hNotifyObj;
00063   CString                   m_szPath;
00064   CString                   m_szClass;
00065
00066   CThumbNailPhotoHolder     m_thumbNailPhotoHolder;
00067
00068   CComPtr<IDirectoryObject> m_spDsObj;
00069   PADS_ATTR_INFO            m_pWritableAttrs;
00070
00071   DECLARE_MESSAGE_MAP()
00072 };
00073
00074 #endif // _PROPPAGEUSERUI_H
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/APIView.Cpp Source File

  • WinBase
  • WtsApi
  • WtsApi

APIView.Cpp

Go to the documentation of this file.
00001 // APIView.cpp : implementation of the CAPIView class
00002 //
00003 //  Copyright 1995-1998, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006
00007 #include "stdafx.h"
00008 #include "API.h"
00009
00010 #include "APIDoc.h"
00011 #include "APIView.h"
00012
00013 #ifdef _DEBUG
00014 #define new DEBUG_NEW
00015 #undef THIS_FILE
00016 static char THIS_FILE[] = __FILE__;
00017 #endif
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CAPIView
00021
00022 IMPLEMENT_DYNCREATE(CAPIView, CView)
00023
00024 BEGIN_MESSAGE_MAP(CAPIView, CView)
00025   //{{AFX_MSG_MAP(CAPIView)
00026   ON_WM_SETFOCUS()
00027   ON_WM_PAINT()
00028   //}}AFX_MSG_MAP
00029 END_MESSAGE_MAP()
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // CAPIView construction/destruction
00033
00034 CAPIView::CAPIView()
00035 {
00036   //g_pDoc->SetServerName("");
00037 }
00038
00039 CAPIView::~CAPIView()
00040 {
00041 }
00042
00043 BOOL CAPIView::PreCreateWindow(CREATESTRUCT& cs)
00044 {
00045   // TODO: Modify the Window class or styles here by modifying
00046   //  the CREATESTRUCT cs
00047
00048   return CView::PreCreateWindow(cs);
00049 }
00050
00051 /////////////////////////////////////////////////////////////////////////////
00052 // CAPIView drawing
00053
00054 void CAPIView::OnDraw(CDC* pDC)
00055 {
00056   CAPIDoc *pDoc = GetDocument();
00057   ASSERT_VALID(pDoc);
00058
00059   TCHAR* serverName;
00060   serverName = g_pDoc->GetServerName();
00061   if (*serverName == NULL)
00062     pDoc->SetTitle("local server");
00063   else
00064     pDoc->SetTitle(serverName);
00065
00066 }
00067
00068 /////////////////////////////////////////////////////////////////////////////
00069 // CAPIView diagnostics
00070
00071 #ifdef _DEBUG
00072 void CAPIView::AssertValid() const
00073 {
00074   CView::AssertValid();
00075 }
00076
00077 void CAPIView::Dump(CDumpContext& dc) const
00078 {
00079   CView::Dump(dc);
00080 }
00081
00082 CAPIDoc* CAPIView::GetDocument() // non-debug version is inline
00083 {
00084   ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAPIDoc)));
00085   return (CAPIDoc*)m_pDocument;
00086 }
00087 #endif //_DEBUG
00088
00089 /////////////////////////////////////////////////////////////////////////////
00090 // CAPIView message handlers
00091
00092
00093 void CAPIView::OnSetFocus(CWnd* pOldWnd)
00094 {
00095   CView::OnSetFocus(pOldWnd);
00096   CDC* pDC=NULL;
00097   OnDraw(pDC);
00098 }
00099
00100 void CAPIView::OnPaint()
00101 {
00102     CPaintDC dc(this); // device context for painting
00103   LOGFONT logFont;
00104   logFont.lfHeight = 30;
00105   logFont.lfWidth = 20;
00106   logFont.lfEscapement = 0;
00107   logFont.lfOrientation = 0;
00108   logFont.lfWeight= 0;
00109   logFont.lfItalic = 0;
00110   logFont.lfUnderline = 0;
00111   logFont.lfStrikeOut = 0;
00112   logFont.lfCharSet = ANSI_CHARSET;
00113   CFont font;
00114   font.CreateFontIndirect(&logFont);
00115   CFont* oldFont = dc.SelectObject(&font);
00116
00117   strcpy(logFont.lfFaceName, "Times New Roman");
00118   dc.TextOut(50, 50, "Test Program for WTSAPI32.DLL");
00119   dc.SelectObject(oldFont);
00120 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSampleDataContainer Member List

This is the complete list of members for CSampleDataContainer, including all inherited members.
CSampleDataContainer() | CSampleDataContainer |
DoDataContainerExtendedCommand(LPWSTR szCommandName, IWMSCommandContext *pCommand, DWORD dwCallFlags, IWMSDataContainerCallback __RPC_FAR *pCallback, QWORD qwContext) | CSampleDataContainer | [virtual]
FinishParsingPacketlist(IWMSPacketList *pPacketList) | CSampleDataContainer | [virtual]
GetContainerFormat(GUID __RPC_FAR *pFormat) | CSampleDataContainer | [virtual]
GetDataSourcePlugin(IWMSDataSourcePlugin __RPC_FAR *__RPC_FAR *ppDataSource) | CSampleDataContainer | [virtual]
GetInfo(DWORD dwInfoValueId, IWMSDataContainerCallback __RPC_FAR *pCallback, QWORD qwContext) | CSampleDataContainer | [virtual]
GetTransferParameters(QWORD qwDesiredOffset, DWORD dwDesiredMinSize, DWORD dwDesiredMaxSize, QWORD *pqwOffset, DWORD *pdwSize, DWORD *pdwBufferAlignment) | CSampleDataContainer | [virtual]
Initialize(IWMSContext *pUserContext, LPWSTR pszContainerName, DWORD dwFlags, IWMSBufferAllocator __RPC_FAR *pBufferAllocator, CSDKSampleStorageSystem *pOwnerContainer, IWMSDataSourcePluginCallback __RPC_FAR *pCallback, QWORD qwContext) | CSampleDataContainer |
IO_READ enum value | CSampleDataContainer | [protected]
IO_WRITE enum value | CSampleDataContainer | [protected]
m_cRef | CSampleDataContainer | [protected]
m_CriticalSection | CSampleDataContainer | [protected]
m_dwAlignment | CSampleDataContainer | [protected]
m_dwAlignmentLog2 | CSampleDataContainer | [protected]
m_hFile | CSampleDataContainer | [protected]
m_pOwnerStorageSystem | CSampleDataContainer | [protected]
m_pszPathName | CSampleDataContainer | [protected]
m_qwFileSize | CSampleDataContainer | [protected]
OnIoCompletion(DWORD dwError, DWORD dwIoType, QWORD qwOffset, DWORD cbTransferred, BYTE *pbBuffer, IWMSDataContainerCallback __RPC_FAR *pCallback, QWORD qwContext) | CSampleDataContainer |
QueryInterface(REFIID riid, void **ppvObject) | CSampleDataContainer |
Read(BYTE __RPC_FAR *pbBuffer, QWORD qwOffset, DWORD dwMaxDataSize, DWORD dwFlags, IWMSDataContainerCallback __RPC_FAR *pCallback, QWORD qwContext) | CSampleDataContainer | [virtual]
Shutdown() | CSampleDataContainer |
STDMETHOD_(ULONG, AddRef)() | CSampleDataContainer |
STDMETHOD_(ULONG, Release)() | CSampleDataContainer |
Write(BYTE __RPC_FAR *pbBuffer, DWORD dwDataSize, QWORD qwWritePosition, IWMSDataContainerCallback __RPC_FAR *pCallback, QWORD qwContext) | CSampleDataContainer | [virtual]
~CSampleDataContainer() | CSampleDataContainer | [virtual]
Generated on Wed Nov 13 2024 16:57:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/sky.Cpp Source File

  • SysMgmt
  • MMC
  • Complete

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0xb17867b9, 0x6be7, 0x11d3, {0x91, 0x56, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/resource.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDR_SMICONS                     120
00012 #define IDR_LGICONS                     121
00013 #define IDB_SMOPEN                      124
00014 #define IDB_SMBMP                       125
00015 #define IDB_LGBMP                       126
00016 #define IDB_ROCKET                      40004
00017 #define IDB_CAR                         40005
00018 #define IDB_PLANE                       40006
00019 #define IDB_BIKE                        40007
00020 #define IDB_ROCKET2                     40008
00021 #define IDB_CAR2                        40009
00022 #define IDB_PLANE2                      40010
00023 #define IDB_BIKE2                       40011
00024 #define IDB_CLOSED2                     40012
00025 #define IDB_OPEN2                       40013
00026 #define IDB_CLOSED                      40014
00027 #define IDB_OPEN                        40015
00028 #define ID_BUTTON40016                  40016
00029 #define ID_BUTTON40017                  40017
00030 #define ID_BUTTON40018                  40018
00031 #define ID_BUTTON40019                  40019
00032 #define ID_BUTTON40020                  40020
00033 #define ID_BUTTON40021                  40021
00034 #define ID_BUTTON40022                  40022
00035 #define ID_BUTTON40023                  40023
00036 #define ID_BUTTON40024                  40024
00037 #define ID_BUTTON40025                  40025
00038 #define ID_BUTTON40026                  40026
00039
00040 // Next default values for new objects
00041 //
00042 #ifdef APSTUDIO_INVOKED
00043 #ifndef APSTUDIO_READONLY_SYMBOLS
00044 #define _APS_NEXT_RESOURCE_VALUE        127
00045 #define _APS_NEXT_COMMAND_VALUE         40027
00046 #define _APS_NEXT_CONTROL_VALUE         1000
00047 #define _APS_NEXT_SYMED_VALUE           101
00048 #endif
00049 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Icons.h Source File

  • WinUI
  • Resource
  • Iconpro

Icons.h

Go to the documentation of this file.
00001 /****************************************************************************\
00002 *
00003 *     FILE:     Icons.H
00004 *
00005 *     PURPOSE:  IconPro Project Icon handling header file
00006 *
00007 *     COMMENTS:
00008 *
00009 *
00010 *     Copyright 1995 - 2000 Microsoft Corp.
00011 *
00012 *
00013 * History:
00014 *                July '95 - Created
00015 *
00016 \****************************************************************************/
00017
00018 #include <windows.h>
00019
00020 /****************************************************************************/
00021 // Structs
00022
00023 // These first two structs represent how the icon information is stored
00024 // when it is bound into a EXE or DLL file. Structure members are WORD
00025 // aligned and the last member of the structure is the ID instead of
00026 // the imageoffset.
00027 #pragma pack( push )
00028 #pragma pack( 2 )
00029 typedef struct
00030 {
00031     BYTE    bWidth;               // Width of the image
00032     BYTE    bHeight;              // Height of the image (times 2)
00033     BYTE    bColorCount;          // Number of colors in image (0 if >=8bpp)
00034     BYTE    bReserved;            // Reserved
00035     WORD    wPlanes;              // Color Planes
00036     WORD    wBitCount;            // Bits per pixel
00037     DWORD   dwBytesInRes;         // how many bytes in this resource?
00038     WORD    nID;                  // the ID
00039 } MEMICONDIRENTRY, *PMEMICONDIRENTRY;
00040 typedef struct
00041 {
00042     WORD            idReserved;   // Reserved
00043     WORD            idType;       // resource type (1 for icons)
00044     WORD            idCount;      // how many images?
00045     MEMICONDIRENTRY idEntries[1]; // the entries for each image
00046 } MEMICONDIR, *PMEMICONDIR;
00047 #pragma pack( pop )
00048
00049 // These next two structs represent how the icon information is stored
00050 // in an ICO file.
00051 typedef struct
00052 {
00053     BYTE    bWidth;               // Width of the image
00054     BYTE    bHeight;              // Height of the image (times 2)
00055     BYTE    bColorCount;          // Number of colors in image (0 if >=8bpp)
00056     BYTE    bReserved;            // Reserved
00057     WORD    wPlanes;              // Color Planes
00058     WORD    wBitCount;            // Bits per pixel
00059     DWORD   dwBytesInRes;         // how many bytes in this resource?
00060     DWORD   dwImageOffset;        // where in the file is this image
00061 } ICONDIRENTRY, *PICONDIRENTRY;
00062 typedef struct
00063 {
00064     WORD            idReserved;   // Reserved
00065     WORD            idType;       // resource type (1 for icons)
00066     WORD            idCount;      // how many images?
00067     ICONDIRENTRY    idEntries[1]; // the entries for each image
00068 } ICONDIR, *PICONDIR;
00069
00070
00071 // The following two structs are for the use of this program in
00072 // manipulating icons. They are more closely tied to the operation
00073 // of this program than the structures listed above. One of the
00074 // main differences is that they provide a pointer to the DIB
00075 // information of the masks.
00076 typedef struct
00077 {
00078     UINT            Width, Height, Colors; // Width, Height and bpp
00079     PBYTE           pBits;                 // ptr to DIB bits
00080     DWORD           dwNumBytes;            // how many bytes?
00081     PBITMAPINFO     pbi;                   // ptr to header
00082     PBYTE           pXOR;                  // ptr to XOR image bits
00083     PBYTE           pAND;                  // ptr to AND image bits
00084 } ICONIMAGE, *PICONIMAGE;
00085 typedef struct
00086 {
00087     BOOL        bHasChanged;                     // Has image changed?
00088     TCHAR       szOriginalICOFileName[MAX_PATH]; // Original name
00089     TCHAR       szOriginalDLLFileName[MAX_PATH]; // Original name
00090     UINT        nNumImages;                      // How many images?
00091     ICONIMAGE   IconImages[1];                   // Image entries
00092 } ICONRESOURCE, *PICONRESOURCE;
00093 /****************************************************************************/
00094
00095
00096
00097
00098 /****************************************************************************/
00099 // Exported function prototypes
00100 PICONRESOURCE ReadIconFromICOFile( PCTSTR szFileName );
00101 BOOL WriteIconToICOFile( PICONRESOURCE pIR, PCTSTR szFileName );
00102 HICON MakeIconFromResource( PICONIMAGE pIcon );
00103 PICONRESOURCE ReadIconFromEXEFile( PCTSTR szFileName );
00104 BOOL IconImageToClipBoard( PICONIMAGE pii );
00105 BOOL IconImageFromClipBoard( PICONIMAGE pii, BOOL bStretchToFit );
00106 BOOL CreateBlankNewFormatIcon( PICONIMAGE pii );
00107 BOOL DrawXORMask( HDC hDC, RECT Rect, PICONIMAGE pIcon );
00108 BOOL DrawANDMask( HDC hDC, RECT Rect, PICONIMAGE pIcon );
00109 RECT GetXORImageRect( RECT Rect, PICONIMAGE pIcon );
00110 BOOL MakeNewANDMaskBasedOnPoint( PICONIMAGE pIcon, POINT pt );
00111 BOOL IconImageFromBMPFile( PCTSTR szFileName, PICONIMAGE pii, BOOL bStretchToFit );
00112 BOOL IconImageToBMPFile( PCTSTR szFileName, PICONIMAGE pii );
00113 /****************************************************************************/
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBase Member List

This is the complete list of members for CBase, including all inherited members.
AutoQI(DWORD dwCreateOpts)=0 | CBase | [pure virtual]
AutoRelease()=0 | CBase | [pure virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface()=0 | CBase | [pure virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid)=0 | CBase | [pure virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage()=0 | CBase | [pure virtual]
GetObjectMenu()=0 | CBase | [pure virtual]
GetObjectName()=0 | CBase | [pure virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
~CBase() | CBase | [virtual]
Generated on Wed Nov 13 2024 16:55:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ClassFactory.Cpp Source File

  • WinUI
  • Shell
  • ColumnProvider

ClassFactory.Cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  ClassFactory.cpp
00011 //
00012 //      Implementation of the CClassFactory class.
00013 //
00014 //////////////////////////////////////////////////////////////////////
00015
00016 #include "ShortName.h"
00017 #include "ClassFactory.h"
00018 #include "ColumnProvider.h"
00019
00020
00021 //////////////////////////////////////////////////////////////////////
00022 // Construction/Destruction
00023 //////////////////////////////////////////////////////////////////////
00024
00025 CClassFactory::CClassFactory()
00026 {
00027     m_nRefCount = 0;
00028     nDllRefCount++;
00029 }
00030
00031 CClassFactory::~CClassFactory()
00032 {
00033     nDllRefCount--;
00034 }
00035
00036 /////////////////////////////////////////////////////////////////////
00037 //  IUnknown Methods
00038 /////////////////////////////////////////////////////////////////////
00039 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppvObject)
00040 {
00041     HRESULT hr = E_NOINTERFACE;
00042
00043     *ppvObject = NULL;
00044     if (IsEqualIID (riid, IID_IUnknown) || IsEqualIID (riid, IID_IClassFactory))
00045     {
00046         *ppvObject = (LPVOID)(LPCLASSFACTORY) this;
00047     }
00048
00049     if (*ppvObject != NULL)
00050     {
00051         ((LPUNKNOWN)*ppvObject)->AddRef ();
00052         hr = S_OK;
00053     }
00054     return hr;
00055 }
00056
00057 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00058 {
00059     m_nRefCount++;
00060     return m_nRefCount;
00061 }
00062
00063 STDMETHODIMP_(ULONG) CClassFactory::Release()
00064 {
00065     if (--m_nRefCount == 0)
00066     {
00067         delete this;
00068         return 0;
00069     }
00070     return m_nRefCount;
00071 }
00072
00073 /////////////////////////////////////////////////////////////////////
00074 //  IClassFactory Methods
00075 /////////////////////////////////////////////////////////////////////
00076 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
00077 {
00078     *ppvObject = NULL;
00079     if (pUnkOuter)
00080     {
00081         return CLASS_E_NOAGGREGATION;
00082     }
00083
00084     CColumnProvider *pcp = new CColumnProvider;
00085     if (!pcp)
00086     {
00087         return E_OUTOFMEMORY;
00088     }
00089
00090     HRESULT hResult = pcp->QueryInterface (riid, ppvObject);
00091     if (FAILED(hResult))
00092     {
00093         delete pcp;
00094         *ppvObject = NULL;
00095     }
00096     return hResult;
00097 }
00098
00099 STDMETHODIMP CClassFactory::LockServer (BOOL bLock)
00100 {
00101     return S_OK;
00102 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerServe/PageList.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerServe

PageList.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PAGELIST.H
00003
00004   Summary:   Include file for the connectable COPageList COM object class.
00005
00006              COPageList offers a main standard IUnknown interface (basic
00007              COM object features), an implementation of the standard
00008              IConnectionPointContainer interface (connectable object
00009              features), an implementation of the standard IPersistStream
00010              interface (stream persistence features), and an
00011              implementation of the custom IPageList interface (drawing
00012              PageList-related features). This multiple interface COM
00013              Object Class is achieved via the technique of nested classes.
00014              The implementation of the various interfaces are nested
00015              inside of the COPageList Class.
00016
00017              For a comprehensive tutorial code tour of this module's
00018              contents and offerings see the tutorial PERSERVE.HTM file.
00019              For more specific technical details on the internal workings
00020              see the comments dispersed throughout the module's source code.
00021
00022   Functions: .
00023
00024   Classes:   COPageList.
00025
00026   Origin:    2-4-97: atrent - Editor-inheritance from PAPER.H in
00027              the STOSERVE Tutorial Code Sample.
00028
00029 ----------------------------------------------------------------------------
00030   This file is part of the Microsoft COM Tutorial Code Samples.
00031
00032   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00033
00034   This source code is intended only as a supplement to Microsoft
00035   Development Tools and/or on-line documentation.  See these other
00036   materials for detailed information regarding Microsoft code samples.
00037
00038   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00039   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00040   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00041   PARTICULAR PURPOSE.
00042 ==========================================================================+*/
00043
00044 #if !defined(PAGELIST_H)
00045 #define PAGELIST_H
00046
00047 #ifdef __cplusplus
00048
00049
00050 // Current format version of PageList is 1.0. Thus, the format version
00051 // is a compile-time constant.
00052 #define PAGELIST_VERSION10 MAKELONG(0,1)
00053
00054 // PageList allocation sizes for the Dynamic PageList array.
00055 enum
00056 {
00057   PAGELIST_ALLOC_INIT = 30,
00058   PAGELIST_ALLOC = 20
00059 };
00060
00061 // Strings used for assembling IStorage/IStream names.
00062 #define DRAWING_STR "Drawing"
00063 #define TEXT_STR    "Text"
00064
00065 // The PageList item structure.
00066 typedef struct _PAGEITEM
00067 {
00068   SHORT     nType;                       // Page Type.
00069   BOOL      bOpen;                       // Page Open status.
00070   INT       iPage;                       // Page Number.
00071   WCHAR     wszDataName[PAGE_NAME_SIZE]; // Page Storage/Stream Data Name.
00072   WCHAR     wszTitle[PAGE_TITLE_SIZE];   // Page Title.
00073 } PAGEITEM;
00074
00075
00076 // Properties of the PageList.
00077 typedef struct _PAGELISTPROPS
00078 {
00079   LONG lPageListVersion;
00080   LONG lPageListSize;
00081   LONG lPageNameCounter;
00082   WCHAR wszTitle[PAGE_TITLE_SIZE];
00083   WCHAR wszAuthor[PAGE_TITLE_SIZE];
00084   WCHAR wszReserved1[PAGE_TITLE_SIZE];
00085 } PAGELISTPROPS;
00086
00087
00088 // PageList event constants.
00089 enum PAGELIST_EVENT
00090 {
00091   PAGELIST_EVENT_NONE = 0,
00092   PAGELIST_EVENT_LOADED,
00093   PAGELIST_EVENT_SAVED,
00094   PAGELIST_EVENT_CLEARED,
00095   PAGELIST_EVENT_PAGEADDED,
00096   PAGELIST_EVENT_PAGEDELETED,
00097   PAGELIST_EVENT_PAGESET
00098 };
00099
00100
00101 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00102   ObjectClass: COPageList
00103
00104   Summary:     COM object class for COPageList COM objects.  COM objects
00105                of this class encapsulate management of a page list. The
00106                list has items representing user editable pages. The
00107                mulitple interfaces on this COM object are constructed via
00108                the nested interface classes technique.
00109
00110   Interfaces:  IUnknown
00111                  Standard interface providing COM object features.
00112                IConnectionPointContainer
00113                  Standard Connection Point container features rendering
00114                  COPageList objects connectable objects.
00115                IPersistStream
00116                  Standard Stream Persistance features.
00117                IPageList
00118                  Custom interface providing basic PageList features.
00119
00120   Aggregation: Yes, COPageList COM Objects are aggregatable by passing
00121                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00122 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00123 class COPageList : public IUnknown
00124 {
00125   public:
00126     // Main Object Constructor & Destructor.
00127     COPageList(IUnknown* pUnkOuter, CServer* pServer);
00128     ~COPageList(void);
00129
00130     // A general public method for initializing this newly created
00131     // object. Creates any subordinate arrays, structures, or objects.
00132     // Not exposed as part of an interface. Used by Class Factory.
00133     HRESULT Init(void);
00134
00135     // Main object IUnknown methods. Non-delegating.
00136     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00137     STDMETHODIMP_(ULONG) AddRef(void);
00138     STDMETHODIMP_(ULONG) Release(void);
00139
00140   private:
00141     // We declare nested class interface implementations here.
00142
00143     class CImpIConnectionPointContainer : public IConnectionPointContainer
00144     {
00145       public:
00146         // Interface Implementation Constructor & Destructor.
00147         CImpIConnectionPointContainer(COPageList* pCO, IUnknown* pUnkOuter);
00148         ~CImpIConnectionPointContainer(void);
00149
00150         // IUnknown methods.
00151         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00152         STDMETHODIMP_(ULONG) AddRef(void);
00153         STDMETHODIMP_(ULONG) Release(void);
00154
00155         // IConnectionPointContainer methods.
00156         STDMETHODIMP         FindConnectionPoint(REFIID, IConnectionPoint**);
00157         STDMETHODIMP         EnumConnectionPoints(IEnumConnectionPoints**);
00158
00159       private:
00160         // Data private to this interface implementation.
00161         COPageList*   m_pCO;          // Parent Object back pointer.
00162         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00163     };
00164
00165     class CImpIPersistStream : public IPersistStream
00166     {
00167       public:
00168         // Interface Implementation Constructor & Destructor.
00169         CImpIPersistStream(COPageList* pCO, IUnknown* pUnkOuter);
00170         ~CImpIPersistStream(void);
00171
00172         // IUnknown methods.
00173         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00174         STDMETHODIMP_(ULONG) AddRef(void);
00175         STDMETHODIMP_(ULONG) Release(void);
00176
00177         // IPersistStream methods.
00178         STDMETHODIMP         GetClassID(CLSID* pClassID);
00179         STDMETHODIMP         IsDirty(void);
00180         STDMETHODIMP         Load(IStream* pIStream);
00181         STDMETHODIMP         Save(IStream* pIStream, BOOL bClearDirty);
00182         STDMETHODIMP         GetSizeMax(ULARGE_INTEGER* pcbSize);
00183
00184       private:
00185         // Data private to this interface implementation.
00186         COPageList*   m_pCO;          // Parent Object back pointer.
00187         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00188     };
00189
00190     class CImpIPageList : public IPageList
00191     {
00192       public:
00193         // Interface Implementation Constructor & Destructor.
00194         CImpIPageList(COPageList* pCO, IUnknown* pUnkOuter);
00195         ~CImpIPageList(void);
00196
00197         // IUnknown methods.
00198         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00199         STDMETHODIMP_(ULONG) AddRef(void);
00200         STDMETHODIMP_(ULONG) Release(void);
00201
00202         // IPageList methods.
00203         STDMETHODIMP         Get(
00204                                  INT     iPage,
00205                                  BOOL*   pbOpen,
00206                                  SHORT*  pnType,
00207                                  WCHAR*  pwszTitle,
00208                                  WCHAR*  pwszDataName);
00209         STDMETHODIMP         Set(
00210                                  INT     iPage,
00211                                  SHORT   nOpenStatus,
00212                                  WCHAR*  pwszNewTitle);
00213         STDMETHODIMP         Add(
00214                                  INT   iPage,
00215                                  SHORT nType,
00216                                  WCHAR* pwszTitle,
00217                                  INT* piNewPage);
00218         STDMETHODIMP         Delete(INT iPage);
00219         STDMETHODIMP         Clear(void);
00220
00221       private:
00222         // Private utility methods of this interface implementation.
00223         HRESULT FindSlot(INT iPage, LONG* plSlot);
00224         HRESULT NextSlot(INT iPage, LONG* plSlot);
00225         HRESULT NextName(SHORT nType, WCHAR* pwszDataName);
00226
00227         // Data private to this interface implementation of IPageList.
00228         COPageList*   m_pCO;          // Parent Object back pointer.
00229         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00230     };
00231
00232     // Make the otherwise private and nested interface implementations
00233     // friends to COM object instantiations of this COM object class.
00234     friend CImpIConnectionPointContainer;
00235     friend CImpIPersistStream;
00236     friend CImpIPageList;
00237
00238     // Private method of main connectable COPageList COM object to
00239     // broadcast event notifications to all connected listening sinks.
00240     HRESULT NotifySinks(PAGELIST_EVENT PageListEvent, INT iPage);
00241
00242     // Private method to Clear entire page list array.
00243     HRESULT Clear(void);
00244
00245     // Private data of COPageList COM objects.
00246
00247     // Nested IConnectionPointContainer implementation instantiation.
00248     CImpIConnectionPointContainer m_ImpIConnectionPointContainer;
00249
00250     // Nested IPersistStream implementation instantiation.
00251     CImpIPersistStream m_ImpIPersistStream;
00252
00253     // Nested IPageList implementation instantiation. This IPageList
00254     // interface is instantiated as a native interface of COPageList.
00255     CImpIPageList     m_ImpIPageList;
00256
00257     // Main Object reference count.
00258     ULONG             m_cRefs;
00259
00260     // Outer unknown (aggregation & delegation).
00261     IUnknown*         m_pUnkOuter;
00262
00263     // Pointer to this component server's control object.
00264     CServer*          m_pServer;
00265
00266     // The array of connection points for this connectable COM object.
00267     IConnectionPoint* m_aConnectionPoints[MAX_CONNECTION_POINTS];
00268
00269     // The following private data and methods constitute the working
00270     // heart of COPageList as an actual application object.
00271     PAGELISTPROPS     m_PageListProps;// For file storage.
00272     PAGEITEM*         m_paPageList;   // Dynamic page list array pointer.
00273     LONG              m_lPageListEnd; // Current end of the page list.
00274     LONG              m_lPageListMax; // Current end of the page list array.
00275     BOOL              m_bDirty;       // RAM doesn't match file--save needed.
00276     CLSID             m_ClassID;      // CLSID of this COM Object.
00277 };
00278
00279 #endif // __cplusplus
00280
00281
00282 #endif // PAGELIST_H
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcChars.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcChars.h

Go to the documentation of this file.
00001 #if !defined(AFX_AGENTCTLCHARACTERS_H__AB8FEBAA_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00002 #define AFX_AGENTCTLCHARACTERS_H__AB8FEBAA_3841_11D2_8512_00C04FA34A14__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00008
00009 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00010 //  Microsoft Visual C++, your modifications will be overwritten.
00011
00012
00013 // Dispatch interfaces referenced by this interface
00014 class CAgentCtlCharacterEx;
00015 class CAgentCtlRequest;
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CAgentCtlCharacters wrapper class
00019
00020 class CAgentCtlCharacters : public COleDispatchDriver
00021 {
00022 public:
00023   CAgentCtlCharacters() {}    // Calls COleDispatchDriver default constructor
00024   CAgentCtlCharacters(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
00025   CAgentCtlCharacters(const CAgentCtlCharacters& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
00026
00027 // Attributes
00028 public:
00029
00030 // Operations
00031 public:
00032   CAgentCtlCharacterEx GetItem(LPCTSTR CharacterID);
00033   CAgentCtlCharacterEx Character(LPCTSTR CharacterID);
00034   void Unload(LPCTSTR CharacterID);
00035   CAgentCtlRequest Load(LPCTSTR CharacterID, const VARIANT& LoadKey);
00036 };
00037
00038 //{{AFX_INSERT_LOCATION}}
00039 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00040
00041 #endif // !defined(AFX_AGENTCTLCHARACTERS_H__AB8FEBAA_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/DynOut/DynOut.Idl Source File

  • NetDS
  • RPC
  • DynOut

DynOut.Idl

Go to the documentation of this file.
00001 [
00002   uuid(8b4c8b20-fec6-11ce-b4eb-0080c779fc83),
00003   version(1.0),
00004   pointer_default(unique)
00005 ]
00006
00007 interface MemStuff
00008 {
00009   short GrabChunk([out] long *lSize, [out,size_is(,*lSize)] char **ppData);
00010 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/Module.h Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

Module.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        module.h
00007 //
00008 // Contents:    CCertManagePolicyModuleSample definition
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "certpsam.h"
00013 #include "resource.h"       // main symbols
00014
00015
00016 class CCertManagePolicyModuleSample:
00017     public CComDualImpl<ICertManageModule, &IID_ICertManageModule, &LIBID_CERTPOLICYSAMPLELib>,
00018     public CComObjectRoot,
00019     public CComCoClass<CCertManagePolicyModuleSample, &CLSID_CCertManagePolicyModuleSample>
00020 {
00021 public:
00022     CCertManagePolicyModuleSample() {}
00023     ~CCertManagePolicyModuleSample() {}
00024
00025 BEGIN_COM_MAP(CCertManagePolicyModuleSample)
00026     COM_INTERFACE_ENTRY(IDispatch)
00027     COM_INTERFACE_ENTRY(ICertManageModule)
00028 END_COM_MAP()
00029
00030 DECLARE_NOT_AGGREGATABLE(CCertManagePolicyModuleSample)
00031 // Remove the comment from the line above if you don't want your object to
00032 // support aggregation.  The default is to support it
00033
00034 // UNDONE UNDONE
00035 DECLARE_REGISTRY(
00036     CCertManagePolicyModuleSample,
00037     wszCLASS_CERTMANAGEPOLICYMODULE TEXT(".1"),
00038     wszCLASS_CERTMANAGEPOLICYMODULE,
00039     IDS_CERTMANAGEPOLICYMODULE_DESC,
00040     THREADFLAGS_BOTH)
00041
00042 // ICertManageModule
00043 public:
00044     STDMETHOD (GetProperty) (
00045             /* [in] */ const BSTR strConfig,
00046             /* [in] */ BSTR strStorageLocation,
00047             /* [in] */ BSTR strPropertyName,
00048             /* [in] */ LONG dwFlags,
00049             /* [retval][out] */ VARIANT __RPC_FAR *pvarProperty);
00050
00051     STDMETHOD (SetProperty)(
00052             /* [in] */ const BSTR strConfig,
00053             /* [in] */ BSTR strStorageLocation,
00054             /* [in] */ BSTR strPropertyName,
00055             /* [in] */ LONG dwFlags,
00056             /* [in] */ VARIANT const __RPC_FAR *pvarProperty);
00057
00058     STDMETHOD (Configure)(
00059             /* [in] */ const BSTR strConfig,
00060             /* [in] */ BSTR strStorageLocation,
00061             /* [in] */ LONG dwFlags);
00062 };
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/_ADO.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

_ADO.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface _ADO
00019 /** @com.interface(iid=00000534-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface _ADO extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public msado15.Properties getProperties();
00025
00026
00027   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x534, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00028 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/StructuredStorage/Propsets/writeread.cpp Source File

  • Com
  • StructuredStorage
  • Propsets

writeread.cpp

Go to the documentation of this file.
00001
00002
00003 //+============================================================================
00004 //
00005 //  WriteRead.cpp
00006 //
00007 //  Create a property set, write a property, close and reopen the property
00008 //  set, read the property back.  Creates the file "WriteRead.stg" in the
00009 //  current directory.
00010 //
00011 //  This sample creates property sets in a structure storage file, but
00012 //  a one-line change causes it to create NTFS property sets.
00013 //
00014 //  To build:
00015 //      cl /GX WriteRead.cpp
00016 //
00017 //+============================================================================
00018
00019
00020 #define WIN32_LEAN_AND_MEAN
00021 #define UNICODE
00022 #define _UNICODE
00023
00024 #include <stdio.h>
00025 #include <windows.h>
00026 #include <ole2.h>
00027
00028 // Implicitely link ole32.dll
00029 #pragma comment( lib, "ole32.lib" )
00030
00031
00032 // From uuidgen.exe:
00033 const FMTID fmtid = { /* d170df2e-1117-11d2-aa01-00805ffe11b8 */
00034     0xd170df2e,
00035     0x1117,
00036     0x11d2,
00037     {0xaa, 0x01, 0x00, 0x80, 0x5f, 0xfe, 0x11, 0xb8}
00038   };
00039
00040
00041 EXTERN_C void wmain()
00042 {
00043    HRESULT hr = S_OK;
00044    IPropertySetStorage *pPropSetStg = NULL;
00045    IPropertyStorage *pPropStg = NULL;
00046    WCHAR *pwszError = L"";
00047
00048    try
00049    {
00050
00051         // Create a file and a property set within it.
00052
00053         hr = StgCreateStorageEx( L"WriteRead.stg",
00054                                  STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE,
00055                                  STGFMT_STORAGE,
00056                                     // STGFMT_STORAGE => Structured Storage property sets
00057                                     // STGFMT_FILE    => NTFS property sets
00058                                  0, NULL, NULL,
00059                                  IID_IPropertySetStorage,
00060                                  reinterpret_cast<void**>(&pPropSetStg) );
00061         if( FAILED(hr) ) throw L"Failed StgCreateStorageEx";
00062
00063         hr = pPropSetStg->Create( fmtid, NULL, PROPSETFLAG_DEFAULT,
00064                                   STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE,
00065                                   &pPropStg );
00066         if( FAILED(hr) ) throw L"Failed IPropertySetStorage::Create";
00067
00068         // Write a Unicode string property to the property set
00069
00070         PROPVARIANT propvarWrite, propvarRead;
00071         PROPSPEC propspec;
00072
00073         propspec.ulKind = PRSPEC_LPWSTR;
00074         propspec.lpwstr = L"Property Name";
00075
00076         PropVariantInit( &propvarWrite );
00077         propvarWrite.vt = VT_LPWSTR;
00078         propvarWrite.pwszVal = L"Property Value";
00079
00080         hr = pPropStg->WriteMultiple( 1, &propspec, &propvarWrite, PID_FIRST_USABLE );
00081         if( FAILED(hr) ) throw L"Failed IPropertyStorage::WriteMultiple";
00082
00083         // It's not necessary, but give the property set a friendly name.
00084
00085         PROPID propidDictionary = PID_DICTIONARY;
00086         WCHAR *pwszFriendlyName = L"Write/Read Properties Sample Property Set";
00087         hr = pPropStg->WritePropertyNames( 1, &propidDictionary, &pwszFriendlyName );
00088         if( FAILED(hr) ) throw L"Failed IPropertyStorage::WritePropertyNames";
00089
00090         // Close and reopen everything.
00091         // By using the STGFMT_ANY flag in the StgOpenStorageEx call,
00092         // it doesn't matter if this is a structure storage property
00093         // set or an NTFS property set (see the StgCreateStorageEx call
00094         // above).
00095
00096         pPropStg->Release(); pPropStg = NULL;
00097         pPropSetStg->Release(); pPropSetStg = NULL;
00098
00099         hr = StgOpenStorageEx( L"WriteRead.stg",
00100                                STGM_READ|STGM_SHARE_DENY_WRITE,
00101                                STGFMT_ANY,
00102                                0, NULL, NULL,
00103                                IID_IPropertySetStorage,
00104                                reinterpret_cast<void**>(&pPropSetStg) );
00105         if( FAILED(hr) ) throw L"Failed StgOpenStorageEx";
00106
00107         hr = pPropSetStg->Open( fmtid, STGM_READ|STGM_SHARE_EXCLUSIVE,
00108                                 &pPropStg );
00109         if( FAILED(hr) ) throw L"Failed IPropertySetStorage::Open";
00110
00111         // Read the property back and validate it
00112
00113         PropVariantInit( &propvarRead );
00114         hr = pPropStg->ReadMultiple( 1, &propspec, &propvarRead );
00115         if( FAILED(hr) ) throw L"Failed IPropertyStorage::ReadMultiple";
00116
00117         if( S_FALSE == hr )
00118             throw L"Property didn't exist after reopening the property set";
00119         else if( propvarWrite.vt != propvarRead.vt )
00120             throw L"Property types didn't match after reopening the property set";
00121         else if( 0 != wcscmp( propvarWrite.pwszVal, propvarRead.pwszVal ))
00122             throw L"Property values didn't match after reopening the property set";
00123         else
00124             wprintf( L"Success\n" );
00125
00126    }
00127    catch( const WCHAR *pwszError )
00128    {
00129        wprintf( L"Error:  %s (hr=%08x)\n", pwszError, hr );
00130    }
00131
00132    if( pPropStg ) pPropStg->Release();
00133    if( pPropSetStg ) pPropSetStg->Release();
00134
00135 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/sync.c Source File

  • NetDS
  • RRas
  • ip

sync.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\sync.h
00008
00009 Abstract:
00010
00011     The file contains the READ_WRITE_LOCK definition which allows
00012     multiple-reader/single-writer.  This implementation DOES NOT
00013     starve a thread trying to acquire write accesss if there are
00014     a large number of threads interested in acquiring read access.
00015
00016 --*/
00017
00018 #include "pchsample.h"
00019 #pragma hdrstop
00020
00021 //----------------------------------------------------------------------------
00022 // Function: CreateReadWriteLock
00023 //
00024 // Initializes a multiple-reader/single-writer lock object
00025 //----------------------------------------------------------------------------
00026
00027 DWORD
00028 CreateReadWriteLock(
00029     PREAD_WRITE_LOCK pRWL
00030     ) {
00031
00032     pRWL->RWL_ReaderCount = 0;
00033
00034     __try {
00035         InitializeCriticalSection(&(pRWL)->RWL_ReadWriteBlock);
00036     }
00037     __except(EXCEPTION_EXECUTE_HANDLER) {
00038         return GetLastError();
00039     }
00040
00041     pRWL->RWL_ReaderDoneEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
00042     if (pRWL->RWL_ReaderDoneEvent != NULL) {
00043         return GetLastError();
00044     }
00045
00046     return NO_ERROR;
00047 }
00048
00049
00050
00051 //----------------------------------------------------------------------------
00052 // Function:    DeleteReadWriteLock
00053 //
00054 // Frees resources used by a multiple-reader/single-writer lock object
00055 //----------------------------------------------------------------------------
00056
00057 VOID
00058 DeleteReadWriteLock(
00059     PREAD_WRITE_LOCK pRWL
00060     ) {
00061
00062     CloseHandle(pRWL->RWL_ReaderDoneEvent);
00063     pRWL->RWL_ReaderDoneEvent = NULL;
00064     DeleteCriticalSection(&pRWL->RWL_ReadWriteBlock);
00065     pRWL->RWL_ReaderCount = 0;
00066 }
00067
00068
00069
00070 //----------------------------------------------------------------------------
00071 // Function:    AcquireReadLock
00072 //
00073 // Secures shared ownership of the lock object for the caller.
00074 //
00075 // readers enter the read-write critical section, increment the count,
00076 // and leave the critical section
00077 //----------------------------------------------------------------------------
00078
00079 VOID
00080 AcquireReadLock(
00081     PREAD_WRITE_LOCK pRWL
00082     ) {
00083
00084     EnterCriticalSection(&pRWL->RWL_ReadWriteBlock);
00085     InterlockedIncrement(&pRWL->RWL_ReaderCount);
00086     LeaveCriticalSection(&pRWL->RWL_ReadWriteBlock);
00087 }
00088
00089
00090
00091 //----------------------------------------------------------------------------
00092 // Function:    ReleaseReadLock
00093 //
00094 // Relinquishes shared ownership of the lock object.
00095 //
00096 // the last reader sets the event to wake any waiting writers
00097 //----------------------------------------------------------------------------
00098
00099 VOID
00100 ReleaseReadLock(
00101     PREAD_WRITE_LOCK pRWL
00102     ) {
00103
00104     if (InterlockedDecrement(&pRWL->RWL_ReaderCount) < 0) {
00105         SetEvent(pRWL->RWL_ReaderDoneEvent);
00106     }
00107 }
00108
00109
00110
00111 //----------------------------------------------------------------------------
00112 // Function:    AcquireWriteLock
00113 //
00114 // Secures exclusive ownership of the lock object.
00115 //
00116 // the writer blocks other threads by entering the ReadWriteBlock section,
00117 // and then waits for any thread(s) owning the lock to finish
00118 //----------------------------------------------------------------------------
00119
00120 VOID
00121 AcquireWriteLock(
00122     PREAD_WRITE_LOCK pRWL
00123     ) {
00124
00125     EnterCriticalSection(&pRWL->RWL_ReadWriteBlock);
00126     if (InterlockedDecrement(&pRWL->RWL_ReaderCount) >= 0) {
00127         WaitForSingleObject(pRWL->RWL_ReaderDoneEvent, INFINITE);
00128     }
00129 }
00130
00131
00132
00133 //----------------------------------------------------------------------------
00134 // Function:    ReleaseWriteLock
00135 //
00136 // Relinquishes exclusive ownership of the lock object.
00137 //
00138 // the writer releases the lock by setting the count to zero
00139 // and then leaving the ReadWriteBlock critical section
00140 //----------------------------------------------------------------------------
00141
00142 VOID
00143 ReleaseWriteLock(
00144     PREAD_WRITE_LOCK pRWL
00145     ) {
00146
00147     InterlockedIncrement(&pRWL->RWL_ReaderCount);
00148     LeaveCriticalSection(&(pRWL)->RWL_ReadWriteBlock);
00149 }
00150
00151
00152
00153 //----------------------------------------------------------------------------
00154 // InitializeDynamicLocksStore
00155 //
00156 // Initialize the structure from which dynamic readwrite locks are allocated.
00157 //----------------------------------------------------------------------------
00158
00159 DWORD
00160 InitializeDynamicLocksStore (
00161     PDYNAMIC_LOCKS_STORE    pStore,
00162     HANDLE                  hHeap
00163     ) {
00164
00165     // initialize the heap from where dynamic locks are allocated
00166     pStore->hHeap = hHeap;
00167
00168     INITIALIZE_LOCKED_LIST(&pStore->llFreeLocksList);
00169     if (!LOCKED_LIST_INITIALIZED(&pStore->llFreeLocksList))
00170         return GetLastError();
00171
00172     // initialize the count of the number of free and allocated locks
00173     pStore->ulCountAllocated = pStore->ulCountFree = 0;
00174
00175     return NO_ERROR;
00176 }
00177
00178
00179
00180 //----------------------------------------------------------------------------
00181 // DeInitializeDynamicLocksStore
00182 //
00183 // Fail if any allocated locks have not been freed.
00184 // Delete the free locks and the FreeLocksList.
00185 //----------------------------------------------------------------------------
00186
00187 DWORD
00188 DeInitializeDynamicLocksStore (
00189     PDYNAMIC_LOCKS_STORE    pStore
00190     ) {
00191
00192     PDYNAMIC_READWRITE_LOCK pLock;
00193     PLIST_ENTRY             pleHead, ple;
00194
00195     if (pStore->ulCountFree)
00196         return ERROR_CAN_NOT_COMPLETE;
00197
00198     // deinitialize the count of the number of free and allocated locks
00199     pStore->ulCountAllocated = pStore->ulCountFree = 0;
00200
00201     // deinitialize the FreeLocksList
00202     pStore->llFreeLocksList.created = 0;
00203
00204     // delete all dynamic readwrite locks and free the memory.
00205     pleHead = &(pStore->llFreeLocksList.head);
00206     for (ple = pleHead->Flink; ple != pleHead; ple = ple->Flink)
00207     {
00208         pLock = CONTAINING_RECORD(ple, DYNAMIC_READWRITE_LOCK, leLink);
00209         DELETE_READ_WRITE_LOCK(&pLock->rwlLock);
00210         HeapFree(pStore->hHeap, 0, pLock);
00211     }
00212
00213     DeleteCriticalSection(&(pStore->llFreeLocksList.lock));
00214
00215     // deinitialize the heap from where dynamic locks are allocated
00216     pStore->hHeap = NULL;
00217
00218     return NO_ERROR;
00219 }
00220
00221
00222
00223 //----------------------------------------------------------------------------
00224 // GetDynamicReadwriteLock
00225 //
00226 // Return a free dynamic readwrite lock, if one is available.
00227 // Else allocate a new dynamic readwrite lock.
00228 // Assumes pStore->llFreeLocksList is locked.
00229 //----------------------------------------------------------------------------
00230
00231 PDYNAMIC_READWRITE_LOCK
00232 GetDynamicReadwriteLock (
00233     PDYNAMIC_LOCKS_STORE    pStore
00234     ) {
00235
00236     PDYNAMIC_READWRITE_LOCK pLock;
00237     PLIST_ENTRY             pleHead, ple;
00238
00239
00240     // a free dynamic lock is available. Return it
00241     pleHead = &(pStore->llFreeLocksList.head);
00242     if (!IsListEmpty(pleHead))
00243     {
00244         pStore->ulCountFree--;
00245         ple = RemoveHeadList(pleHead);
00246         pLock = CONTAINING_RECORD(ple, DYNAMIC_READWRITE_LOCK, leLink);
00247         return pLock;
00248     }
00249
00250     // allocate memory for a new dynamic lock
00251     pLock = HeapAlloc(pStore->hHeap, 0, sizeof(DYNAMIC_READWRITE_LOCK));
00252     if (pLock ==  NULL)
00253         return NULL;
00254
00255     // initialize the fields
00256     CREATE_READ_WRITE_LOCK(&(pLock->rwlLock));
00257     if (!READ_WRITE_LOCK_CREATED(&(pLock->rwlLock)))
00258     {
00259         HeapFree(pStore->hHeap, 0, pLock);
00260         return NULL;
00261     }
00262     pLock->ulCount = 0;
00263
00264     pStore->ulCountAllocated++;
00265
00266     return pLock;
00267 }
00268
00269
00270
00271 //----------------------------------------------------------------------------
00272 // FreeDynamicReadwriteLock
00273 //
00274 // Accepts a released dynamic readwrite lock.
00275 // Frees it if there are too many dynamic readwrite locks.
00276 // Assumes pStore->llFreeLocksList is locked.
00277 //----------------------------------------------------------------------------
00278
00279 VOID
00280 FreeDynamicReadwriteLock (
00281     PDYNAMIC_READWRITE_LOCK pLock,
00282     PDYNAMIC_LOCKS_STORE    pStore
00283     ) {
00284
00285     PLIST_ENTRY             pleHead;
00286
00287
00288     // decrement count of allocated locks
00289     pStore->ulCountAllocated--;
00290
00291     // if there are too many dynamic readwrite locks, then free this lock
00292     if ((pStore->ulCountAllocated + pStore->ulCountFree + 1) >
00293         DYNAMIC_LOCKS_HIGH_THRESHOLD)
00294     {
00295         DELETE_READ_WRITE_LOCK(&pLock->rwlLock);
00296         HeapFree(pStore->hHeap, 0, pLock);
00297     }
00298     else                        // insert into the list of free locks
00299     {
00300         pleHead = &(pStore->llFreeLocksList.head);
00301         InsertHeadList(pleHead, &pLock->leLink);
00302         pStore->ulCountFree++;
00303     }
00304
00305     return;
00306 }
00307
00308
00309
00310 //----------------------------------------------------------------------------
00311 // AcquireDynamicLock
00312 //
00313 // Locks the FreeLocksList.
00314 // Allocates a new dynamic lock if required.
00315 // Increments the count.
00316 // Unlocks the FreeLocksList.
00317 // Acquires the dynamic lock.
00318 //----------------------------------------------------------------------------
00319
00320 DWORD
00321 AcquireDynamicReadwriteLock (
00322     PDYNAMIC_READWRITE_LOCK *ppLock,
00323     LOCK_MODE               lmMode,
00324     PDYNAMIC_LOCKS_STORE    pStore
00325     ) {
00326
00327     // acquire the lock for the free locks list
00328     ACQUIRE_LIST_LOCK(&pStore->llFreeLocksList);
00329
00330     // if it is does not already exist, allocate a new dynamic lock
00331     if (*ppLock == NULL)
00332     {
00333         *ppLock = GetDynamicReadwriteLock(pStore);
00334
00335         // if could not get a lock we are in serious trouble
00336         if (*ppLock == NULL)
00337         {
00338             RELEASE_LIST_LOCK(&pStore->llFreeLocksList);
00339             return ERROR_CAN_NOT_COMPLETE;
00340         }
00341     }
00342
00343     // increment count in the dynamic lock
00344     (*ppLock)->ulCount++;
00345
00346     // release the lock for the free locks list
00347     RELEASE_LIST_LOCK(&pStore->llFreeLocksList);
00348
00349     // acquire dynamic lock
00350     if (lmMode == READ_MODE)
00351         ACQUIRE_READ_LOCK(&(*ppLock)->rwlLock);
00352     else
00353         ACQUIRE_WRITE_LOCK(&(*ppLock)->rwlLock);
00354
00355     return NO_ERROR;
00356 }
00357
00358
00359
00360 //----------------------------------------------------------------------------
00361 // ReleaseDynamicReadwriteLock
00362 //
00363 // Locks the FreeLocksList.
00364 // Releases the dynamic lock.
00365 // Decrements the count.
00366 //  Free the dynamic lock if count becomes 0.
00367 // Unlocks the FreeLocksList.
00368 //----------------------------------------------------------------------------
00369
00370 VOID
00371 ReleaseDynamicReadwriteLock (
00372     PDYNAMIC_READWRITE_LOCK *ppLock,
00373     LOCK_MODE               lmMode,
00374     PDYNAMIC_LOCKS_STORE    pStore
00375     ) {
00376
00377     // acquire the lock for the free locks list
00378     ACQUIRE_LIST_LOCK(&pStore->llFreeLocksList);
00379
00380     // release the dynamic readwrite lock
00381     if (lmMode == READ_MODE)
00382         RELEASE_READ_LOCK(&(*ppLock)->rwlLock);
00383     else
00384         RELEASE_WRITE_LOCK(&(*ppLock)->rwlLock);
00385
00386     // decrement count in the dynamic lock, free it if count becomes 0
00387     if (!(*ppLock)->ulCount--)
00388     {
00389         FreeDynamicReadwriteLock(*ppLock, pStore);
00390         *ppLock = NULL;         // so it is known that it doesn't exist
00391     }
00392
00393     // release the lock for the free locks list
00394     RELEASE_LIST_LOCK(&pStore->llFreeLocksList);
00395
00396     return;
00397 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/virtualfile.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

virtualfile.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Implements our virtual file class derived from CBaseNode.  This
00014 //             class will represent our result items
00015 //
00016
00017 #include "VirtualFile.h"
00018 #include "Globals.h"
00019 #include "CompData.h"
00020 #include "Comp.h"
00021 #include "FolderNode.h"
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CVirtualFile")
00026
00027
00028 // Initialize our static GUID just once
00029 GUID CVirtualFile::thisGUID = CLSID_CVirtualFile;
00030
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // Construction/Destruction
00034
00035 //---------------------------------------------------------------------------
00036 CVirtualFile::CVirtualFile()
00037 {
00038   m_RDI.mask       = DEFAULT_RDI_MASK;
00039   m_RDI.str        = MMC_CALLBACK;
00040   m_RDI.nImage     = IMG_DATA_FILE;
00041   m_RDI.lParam     = reinterpret_cast<LPARAM>(this);
00042
00043   m_dwAttributes   = 0;
00044   m_pParentFolder  = NULL;
00045   m_pCompData      = NULL;
00046   m_nPropPageCount = 1;      // Number of property pages this node supports
00047   m_nNotifyHandle  = 0;      // Cached notification handle (not used)
00048 }
00049
00050 //---------------------------------------------------------------------------
00051 CVirtualFile::~CVirtualFile()
00052 {
00053 }
00054
00055 //---------------------------------------------------------------------------
00056 HRESULT CVirtualFile::Initialize( NODE_PROPERTIES* pNodeProps )
00057 {
00058   _ASSERT( NULL != pNodeProps );
00059   _ASSERT( NULL != pNodeProps->pParentObject );
00060
00061   SIZE_T   nLen  = wcslen( pNodeProps->szNodeName ) + 1;
00062   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00063   wcscpy( pszTmp, pNodeProps->szNodeName );
00064   if( NULL != m_pwszNodeName )
00065     CoTaskMemFree( m_pwszNodeName );
00066
00067   m_pwszNodeName  = pszTmp;
00068   m_pParentFolder = reinterpret_cast<CFolderNode*>(pNodeProps->pParentObject);
00069   m_pCompData     = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00070   m_dwAttributes  = pNodeProps->dwAttributes;
00071
00072   return S_OK;
00073 }
00074
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // Implementation of virtual methods
00078
00079 //---------------------------------------------------------------------------
00080 HRESULT CVirtualFile::GetDisplayInfo
00081 (
00082   RESULTDATAITEM* pRDI       //[in-out] RESULTDATAITEM struct
00083 )
00084 {
00085   HRESULT hResult = S_OK;
00086
00087   if( pRDI->mask & RDI_STR )         // Console is requesting strings...
00088   {                                  // for each column
00089     switch( pRDI->nCol )
00090     {
00091       case 0:
00092         pRDI->str = m_pwszNodeName;
00093         break;
00094
00095       case 1:                        // Return Attributes as string
00096         pRDI->str = GetAttributeString();
00097         break;
00098
00099       default:
00100         hResult = S_FALSE;
00101         TRACE_VAL(_T("GetDisplayInfo"), _T("Column"), pRDI->nCol );
00102         break;
00103     }
00104   }
00105
00106   if( pRDI->mask & RDI_IMAGE )       // Looking for an image?
00107   {
00108     pRDI->nImage = m_RDI.nImage;
00109   }
00110
00111   //TRACE_HRESULT(_T("GetDisplayInfo"), hResult );
00112   return hResult;
00113 }
00114
00115
00116 /////////////////////////////////////////////////////////////////////////////
00117 // Implementation of virtual methods
00118
00119 //---------------------------------------------------------------------------
00120 HRESULT CVirtualFile::OnSelect
00121 (
00122   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00123   LPARAM        nArg,          //[in] Bools for context & selection state
00124   LPARAM        nParam,        //[in] Not used
00125   LONG_PTR      pComponent     //[in] Points calling CComponent
00126 )
00127 {
00128   HRESULT hResult = S_FALSE;
00129
00130   BOOL    fScopePane = LOWORD(nArg);
00131   BOOL    fSelected  = HIWORD(nArg);
00132
00133   // Don't care about de-select notifications so just return
00134   if( FALSE == fSelected )
00135     return hResult;
00136
00137   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00138
00139   IConsoleVerb* ipConsoleVerb = NULL;
00140   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00141   if( S_OK != hResult )
00142    return hResult;
00143
00144   // Adding the Properties verb and making it the default
00145   hResult = ipConsoleVerb->SetVerbState( MMC_VERB_DELETE,     ENABLED, TRUE );
00146   hResult = ipConsoleVerb->SetVerbState( MMC_VERB_PROPERTIES, ENABLED, TRUE );
00147
00148   hResult = ipConsoleVerb->SetDefaultVerb( MMC_VERB_PROPERTIES );
00149
00150   TRACE_HRESULT(_T("OnSelect"), hResult );
00151   return hResult;
00152 }
00153
00154 //---------------------------------------------------------------------------
00155 HRESULT CVirtualFile::OnShow
00156 (
00157   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00158   LPARAM        nArg,          //[in] TRUE if node was selcted
00159   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00160   LONG_PTR      pComponent     //[in] Points calling CComponent
00161 )
00162 {
00163   HRESULT  hResult = S_FALSE;
00164
00165   TRACE_HRESULT(_T("OnShow"), hResult );
00166   return hResult;
00167 }
00168
00169 //---------------------------------------------------------------------------
00170 HRESULT CVirtualFile::OnDelete
00171 (
00172   LPDATAOBJECT ipDataObject,   //[in] Points to Data Object
00173   LPARAM       nArg,           //[in] Not used
00174   LPARAM       nParam,         //[in] Not used
00175   LONG_PTR     pComponent      //[in] Points to calling IComponent
00176 )
00177 {
00178   _ASSERT( NULL != ipDataObject );
00179   _ASSERT( NULL != m_pParentFolder );
00180
00181   HRESULT hResult = S_FALSE;
00182
00183   m_pParentFolder->RemoveVirtualFile( this );
00184
00185   LPRESULTDATA ipResultData = NULL;
00186   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00187   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00188   if( S_OK != hResult )
00189     return hResult;
00190
00191   ipResultData->DeleteItem( m_RDI.itemID, 0 );
00192   delete this;
00193
00194   return hResult;
00195 }
00196
00197 //---------------------------------------------------------------------------
00198 //  MMC_HELP:  This gets called when a VirtualFile node is selected and
00199 //  the F1 key is pressed.
00200 //
00201 HRESULT CVirtualFile::OnContextHelp
00202 (
00203   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00204   LPARAM        nArg,          //[in] Not used
00205   LPARAM        nParam,        //[in] Not used
00206   LONG_PTR      pComponent     //[in] Points calling CComponent
00207 )
00208 {
00209   HRESULT   hResult = S_FALSE;
00210   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00211
00212   LPOLESTR pszBaseHelpPath  = GetHelpFilePath();
00213   LPOLESTR pszTopicPath     = L"::/VirtualFiles.html";
00214
00215   // Allocate space for the topic string
00216   SIZE_T nBasePathLen  = wcslen( pszBaseHelpPath );
00217   SIZE_T nTopicPathLen = wcslen( pszTopicPath );
00218   SIZE_T nBufferSize   = (nBasePathLen + nTopicPathLen + 1) * sizeof(WCHAR);
00219
00220   // Build the topic string
00221   LPOLESTR pszThisTopicPath = (LPOLESTR)CoTaskMemAlloc( nBufferSize );
00222   wcscpy( pszThisTopicPath, pszBaseHelpPath );
00223   wcscat( pszThisTopicPath, pszTopicPath );
00224
00225   // Request a pointer to IDisplayHelp
00226   IDisplayHelp* ipDisplayHelp = NULL;
00227   pComp->GetInterface( REQUEST_IDISPLAYHELP, (LONG_PTR*)&ipDisplayHelp );
00228
00229   hResult = ipDisplayHelp->ShowTopic( pszThisTopicPath );
00230
00231   TRACE_HRESULT(_T("OnContextHelp"), hResult );   // Return value is not used
00232   return hResult;
00233 }
00234
00235 /////////////////////////////////////////////////////////////////////////////
00236 //  IExtendContextMenu implementation
00237
00238 //---------------------------------------------------------------------------
00239 HRESULT CVirtualFile::AddMenuItems
00240 (
00241   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00242   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00243 )
00244 {
00245   HRESULT hResult = E_NOTIMPL;
00246   return hResult;
00247 }
00248
00249
00250 //---------------------------------------------------------------------------
00251 HRESULT CVirtualFile::Command
00252 (
00253   long lCommandID          //[in] Indentifier for menu ID
00254 )
00255 {
00256   HRESULT hResult = E_NOTIMPL;
00257   return hResult;
00258 }
00259
00260 /////////////////////////////////////////////////////////////////////////////
00261 //  IExtendPropertySheet2 implementation
00262
00263 //---------------------------------------------------------------------------
00264 //  Tell the console that this node supports property pages
00265 //
00266 HRESULT CVirtualFile::QueryForPropertyPage()
00267 {
00268   TRACE_HRESULT(_T("OnShow"), S_OK );
00269   return S_OK;
00270 }
00271
00272
00273 //---------------------------------------------------------------------------
00274 HRESULT CVirtualFile::CreatePropertyPages
00275 (
00276   LPPROPERTYSHEETCALLBACK lpCallback,  //[in] Pointer to callback interface
00277   LONG_PTR                Handle       //[in] Routing handle
00278 )
00279 {
00280   HRESULT hResult = S_FALSE;
00281
00282   m_nNotifyHandle = Handle;            // Cache the routing handle
00283
00284   // Create an array of PropertySheetPages
00285   HPROPSHEETPAGE* hPPages = new HPROPSHEETPAGE[m_nPropPageCount];
00286   if( NULL == hPPages )
00287     return E_OUTOFMEMORY;
00288
00289   PROPSHEETPAGE  psp;
00290
00291   psp.dwSize      = sizeof(PROPSHEETPAGE);
00292   psp.dwFlags     = PSP_DEFAULT | PSP_USETITLE | PSP_HASHELP;
00293   psp.hInstance   = g_hInst;
00294   psp.pszTemplate = MAKEINTRESOURCE(IDD_VFILE_PPAGE0);
00295   psp.pfnDlgProc  = (DLGPROC)PPageWndProc0;
00296   psp.lParam      = reinterpret_cast<LPARAM>(this);
00297   psp.pszTitle    = _T("General");
00298   psp.pfnCallback = NULL;
00299
00300
00301   hPPages[0] = ::CreatePropertySheetPage( &psp );
00302
00303   // Add the pages to the console's Property Sheet
00304   for( LONG nPageCount = 0; nPageCount < m_nPropPageCount; nPageCount++ )
00305   {
00306     hResult = lpCallback->AddPage( hPPages[nPageCount] );
00307     BREAK_ON_ERROR( hResult );
00308   }
00309
00310   delete [] hPPages;
00311
00312   return hResult;
00313 }
00314
00315 //---------------------------------------------------------------------------
00316 HRESULT CVirtualFile::GetWatermarks
00317 (
00318   HBITMAP __RPC_FAR*  lphWatermark,  //[out] Pointer to watermark bitmap
00319   HBITMAP __RPC_FAR*  lphHeader,     //[out] Pointer to header bitmap
00320   HPALETTE __RPC_FAR* lphPalette,    //[out] Pointer to palette
00321   BOOL __RPC_FAR*     bStretch       //[out] TRUE to stretch instead of tile
00322 )
00323 {
00324   HRESULT hResult = S_FALSE;
00325
00326
00327   return hResult;
00328 }
00329
00330 //---------------------------------------------------------------------------
00331 //
00332 //
00333 BOOL CALLBACK CVirtualFile::PPageWndProc0
00334 (
00335   HWND    hPage,     //[in] Handle to property page
00336   UINT    uMsg,      //[in] Message
00337   WPARAM  wParam,    //[in] First message parameter
00338   LPARAM  lParam     //[in] Second message parameter
00339 )
00340 {
00341   static CVirtualFile* pVFile  = NULL;
00342          BOOL          bReturn = FALSE;
00343
00344   switch( uMsg )                       // Begin message switch
00345   {
00346     case WM_INITDIALOG:
00347     {
00348       // Cache the pointer to the calling instance of CVirtualFile and
00349       // call it's OnInitPropPage method
00350       PROPSHEETPAGE* psp = (PROPSHEETPAGE*)lParam;
00351       pVFile = reinterpret_cast<CVirtualFile*>(psp->lParam);
00352       pVFile->OnInitPropPage( hPage, wParam, lParam );
00353       break;
00354     }
00355     case WM_HELP:
00356     {
00357       LPOLESTR pszBasePath  = GetHelpFilePath();
00358       LPOLESTR pszTopicPath = L"::/WM_HELP.html";
00359
00360       SIZE_T nBasePathLen  = wcslen( pszBasePath  );
00361       SIZE_T nTopicPathLen = wcslen( pszTopicPath );
00362       SIZE_T nBufferSize   = (nBasePathLen + nTopicPathLen + 1) * sizeof(WCHAR);
00363
00364       LPOLESTR pszThisTopicPath = (LPOLESTR)CoTaskMemAlloc( nBufferSize );
00365       wcscpy( pszThisTopicPath, pszBasePath  );
00366       wcscat( pszThisTopicPath, pszTopicPath );
00367
00368       CoTaskMemFree( pszBasePath );
00369
00370       MMCPropertyHelp( pszThisTopicPath );
00371       break;
00372     }
00373     case WM_COMMAND:
00374     {
00375       // Activate the 'Apply' button if the user clicked a button
00376       if( BN_CLICKED == HIWORD(wParam) )
00377         SendMessage(GetParent(hPage), PSM_CHANGED, (WPARAM)hPage, 0);
00378
00379       break;
00380     }
00381     case WM_DESTROY:
00382     {
00383       MMCFreeNotifyHandle( pVFile->m_nNotifyHandle );
00384       TRACE_START( _T("WM_DESTROY") );
00385       bReturn = TRUE;
00386     }
00387
00388     case WM_NOTIFY:
00389     {
00390       if( 0 == lParam )  //BUGLIST:  AV if we don't do this
00391         return 0;
00392
00393       switch( (reinterpret_cast<NMHDR*>(lParam))->code )
00394       {
00395         case PSN_APPLY:      // Really the 'OK' button
00396         {
00397           pVFile->OnApplyChanges( hPage, wParam, lParam );
00398           return PSNRET_NOERROR;
00399         }
00400         case PSN_HELP:
00401         {
00402           LPOLESTR pszBasePath  = GetHelpFilePath();
00403           LPOLESTR pszTopicPath = L"::/PSN_HELP.html";
00404
00405           SIZE_T nBasePathLen  = wcslen( pszBasePath  );
00406           SIZE_T nTopicPathLen = wcslen( pszTopicPath );
00407           SIZE_T nBufferSize   = (nBasePathLen + nTopicPathLen + 1) * sizeof(WCHAR);
00408
00409           LPOLESTR pszThisTopicPath = (LPOLESTR)CoTaskMemAlloc( nBufferSize );
00410           wcscpy( pszThisTopicPath, pszBasePath  );
00411           wcscat( pszThisTopicPath, pszTopicPath );
00412
00413           CoTaskMemFree( pszBasePath );
00414
00415           MMCPropertyHelp( pszThisTopicPath );
00416           return PSNRET_NOERROR;
00417         }
00418         default:
00419         {
00420           break;
00421         }
00422       } //end lParam->code switch
00423     } // end WM_NOTIFY
00424
00425     default: break;
00426
00427   } // end uMsg switch
00428
00429   return bReturn;
00430
00431 }
00432
00433 //---------------------------------------------------------------------------
00434 BOOL CVirtualFile::OnInitPropPage
00435 (
00436   HWND     hPage,      //[in] Handle to Property Page
00437   WPARAM   wParam,     //[in] First message parameter
00438   LPARAM   lparam      //[in] Second message parameter
00439 )
00440 {
00441   LRESULT lResult = 0;
00442
00443   HWND hArchiveCtrl  = GetDlgItem( hPage, IDC_ARCHIVE_ATTR  );
00444   HWND hHiddenCtrl   = GetDlgItem( hPage, IDC_HIDDEN_ATTR   );
00445   HWND hLockedCtrl   = GetDlgItem( hPage, IDC_LOCKED_ATTR   );
00446   HWND hReadOnlyCtrl = GetDlgItem( hPage, IDC_READONLY_ATTR );
00447
00448
00449   if( TRUE == IsAttributeSet( ATTRIBUTE_DATA_ARCHIVE ) )
00450     lResult = SendMessage( hArchiveCtrl,  BM_SETCHECK, BST_CHECKED, 0 );
00451
00452   if( TRUE == IsAttributeSet( ATTRIBUTE_DATA_HIDDEN ) )
00453     lResult = SendMessage( hHiddenCtrl,  BM_SETCHECK, BST_CHECKED, 0 );
00454
00455   if( TRUE == IsAttributeSet( ATTRIBUTE_DATA_LOCKED ) )
00456     lResult = SendMessage( hLockedCtrl,  BM_SETCHECK, BST_CHECKED, 0 );
00457
00458   if( TRUE == IsAttributeSet( ATTRIBUTE_DATA_READONLY ) )
00459     lResult = SendMessage( hReadOnlyCtrl,  BM_SETCHECK, BST_CHECKED, 0 );
00460
00461   return TRUE;
00462 }
00463
00464 //---------------------------------------------------------------------------
00465 BOOL CVirtualFile::OnApplyChanges
00466 (
00467   HWND     hPage,      //[in] Handle to Property Page
00468   WPARAM   wParam,     //[in] First message parameter
00469   LPARAM   lparam      //[in] Second message parameter
00470 )
00471 {
00472   LRESULT lResult = 0;
00473
00474   HWND hArchiveCtrl  = GetDlgItem( hPage, IDC_ARCHIVE_ATTR  );
00475   if( BST_CHECKED == SendMessage( hArchiveCtrl, BM_GETCHECK, 0, 0 ) )
00476     SetAttribute( ATTRIBUTE_DATA_ARCHIVE );
00477   else
00478     RemoveAttribute( ATTRIBUTE_DATA_ARCHIVE );
00479
00480   HWND hHiddenCtrl   = GetDlgItem( hPage, IDC_HIDDEN_ATTR   );
00481   if( BST_CHECKED == SendMessage( hHiddenCtrl, BM_GETCHECK, 0, 0 ) )
00482     SetAttribute( ATTRIBUTE_DATA_HIDDEN );
00483   else
00484     RemoveAttribute( ATTRIBUTE_DATA_HIDDEN );
00485
00486   HWND hLockedCtrl   = GetDlgItem( hPage, IDC_LOCKED_ATTR   );
00487   if( BST_CHECKED == SendMessage( hLockedCtrl, BM_GETCHECK, 0, 0 ) )
00488     SetAttribute( ATTRIBUTE_DATA_LOCKED );
00489   else
00490     RemoveAttribute( ATTRIBUTE_DATA_LOCKED );
00491
00492   HWND hReadOnlyCtrl   = GetDlgItem( hPage, IDC_READONLY_ATTR   );
00493   if( BST_CHECKED == SendMessage( hReadOnlyCtrl, BM_GETCHECK, 0, 0 ) )
00494     SetAttribute( ATTRIBUTE_DATA_READONLY );
00495   else
00496     RemoveAttribute( ATTRIBUTE_DATA_READONLY );
00497
00498   return TRUE;
00499 }
00500
00501
00502 /////////////////////////////////////////////////////////////////////////////
00503 //  CVirtualFile methods
00504
00505 //---------------------------------------------------------------------------
00506 BOOL CVirtualFile::IsAttributeSet
00507 (
00508   DWORD dwAttribute           //[in] Attribute to set
00509 )
00510 {
00511   return (m_dwAttributes & dwAttribute) ? TRUE : FALSE;
00512 }
00513
00514 //---------------------------------------------------------------------------
00515 VOID CVirtualFile::SetAttribute
00516 (
00517   DWORD dwAttribute           //[in] Attribute to set
00518 )
00519 {
00520   m_dwAttributes |= dwAttribute;
00521 }
00522
00523 //---------------------------------------------------------------------------
00524 VOID CVirtualFile::RemoveAttribute
00525 (
00526   DWORD dwAttribute           //[in] Attribute to remove
00527 )
00528 {
00529   m_dwAttributes &= ~dwAttribute;
00530 }
00531
00532 //---------------------------------------------------------------------------
00533 //
00534 LPWSTR CVirtualFile::GetAttributeString()
00535 {
00536   *m_pAttributeStr = NULL;
00537
00538   if( IsAttributeSet(ATTRIBUTE_DATA_ARCHIVE) )
00539     wcscat( m_pAttributeStr, L"A " );
00540
00541   if( IsAttributeSet(ATTRIBUTE_DATA_HIDDEN) )
00542     wcscat( m_pAttributeStr, L"H " );
00543
00544   if( IsAttributeSet(ATTRIBUTE_DATA_LOCKED) )
00545     wcscat( m_pAttributeStr, L"L " );
00546
00547   if( IsAttributeSet(ATTRIBUTE_DATA_READONLY) )
00548     wcscat( m_pAttributeStr, L"R " );
00549
00550   return m_pAttributeStr;
00551 }
00552
00553
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CADQIDlg Member List

This is the complete list of members for CADQIDlg, including all inherited members.
CADQIDlg(CWnd *pParent=NULL) | CADQIDlg |
DoDataExchange(CDataExchange *pDX) | CADQIDlg | [protected, virtual]
EnumerateInterface() | CADQIDlg |
IDD enum value | CADQIDlg |
m_cADsPath | CADQIDlg |
m_cListIf | CADQIDlg |
m_cOK | CADQIDlg |
m_hIcon | CADQIDlg | [protected]
m_pUnk | CADQIDlg |
m_sADsPath | CADQIDlg |
OnCancel() | CADQIDlg | [protected, virtual]
OnChangeADsPath() | CADQIDlg | [protected]
OnDblClkInterfaces() | CADQIDlg | [protected]
OnInitDialog() | CADQIDlg | [protected, virtual]
OnOK() | CADQIDlg | [protected, virtual]
OnPaint() | CADQIDlg | [protected]
OnQueryDragIcon() | CADQIDlg | [protected]
Generated on Wed Nov 13 2024 16:55:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppagex/registry.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppagex

registry.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include <ObjBase.h>
00016 #include "Registry.h"
00017 #include "Globals.h"
00018
00019
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("Registry")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Internal helper functions prototypes
00027
00028
00029 // Set the given key and its value.
00030 HRESULT SetKeyAndValue( const TCHAR* pszPath, const TCHAR* szSubkey, const TCHAR* szValue);
00031
00032 // Set the given key and its value in the MMC Snapin location
00033 HRESULT SetSnapInKeyAndValue( const TCHAR* szKey, const TCHAR* szSubkey, const TCHAR* szName, const TCHAR* szValue );
00034
00035 // Set the given valuename under the key to value
00036 HRESULT SetValue( const TCHAR* szKey, const TCHAR* szValueName, const TCHAR* szValue);
00037
00038 // Delete szKeyChild and all of its descendents.
00039 HRESULT RecursiveDeleteKey( HKEY hKeyParent, const TCHAR* szKeyChild );
00040
00041 // Set the nodetype key and subkeys for this extension
00042 HRESULT SetExtensionKey( const TCHAR* szNodeType );
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045 // Public function implementation
00046
00047
00048 //---------------------------------------------------------------------------
00049 //  Register the component in the registry.  This is the minimalist way
00050 //  to register a component, you may want to add keys for ProgID.
00051 //
00052 HRESULT RegisterServer
00053 (
00054   HMODULE        hModule,          //[in] DLL module handle
00055   const CLSID&   clsid,            //[in] Class ID
00056   const TCHAR*   szFriendlyName    //[in] Name string
00057 )
00058 {
00059   // Get server location.
00060   TCHAR    szModule[512] ;
00061   TCHAR*   pszCLSID = NULL;
00062   LPOLESTR wszCLSID = NULL ;
00063   HRESULT  hResult  = S_FALSE;
00064
00065   DWORD dwResult = ::GetModuleFileName( hModule,
00066                                         szModule,
00067                                         sizeof(szModule)/sizeof(TCHAR)
00068                                       );
00069   if( 0 == dwResult ) return HRESULT_FROM_WIN32( dwResult );
00070
00071   do                         // Fail unless we complete everything
00072   {
00073     // Get CLSID string in wide char
00074     hResult = StringFromCLSID( clsid, &wszCLSID ) ;
00075     if( S_OK != hResult )
00076     {
00077       CoTaskMemFree( wszCLSID );
00078       BREAK_ON_ERROR( hResult );
00079     }
00080
00081     W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00082     CoTaskMemFree( wszCLSID );           // Through with wide version
00083
00084     TCHAR szKey[64];                     // Build the CLSID key string CLSID\\{...}
00085     _tcscpy( szKey, _T("CLSID\\") );
00086     _tcscat( szKey, pszCLSID );
00087
00088     // Add the CLSID to the registry.
00089     hResult = SetKeyAndValue( szKey, NULL, szFriendlyName );
00090     BREAK_ON_ERROR( hResult );
00091
00092     // Add the server filename subkey under the CLSID key.
00093     hResult = SetKeyAndValue( szKey, _T("InprocServer32"), szModule );
00094     BREAK_ON_ERROR( hResult );
00095
00096     // Set the threading model
00097     _tcscat( szKey, _T("\\InprocServer32") );
00098     hResult = SetValue( szKey, _T("ThreadingModel"), _T("Apartment") );
00099     BREAK_ON_ERROR( hResult );
00100
00101   }while( 0 );
00102
00103   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00104
00105   return hResult;
00106 }
00107
00108
00109 //---------------------------------------------------------------------------
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer
00113 (
00114   const CLSID& clsid         //[in] Class ID of component to remove
00115 )
00116 {
00117   HRESULT hResult = S_OK;
00118
00119   // Allocate the CLSID string
00120   LPOLESTR wszCLSID = NULL ;
00121   hResult = StringFromCLSID( clsid, &wszCLSID );
00122   if( S_OK != hResult )
00123   {
00124     CoTaskMemFree( wszCLSID );
00125     return hResult;
00126   }
00127
00128   // Build the key CLSID\\{...}
00129   TCHAR szKey[64];
00130   _tcscpy( szKey, _T("CLSID\\") );
00131
00132   TCHAR* pszCLSID = NULL;
00133   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00134   CoTaskMemFree( wszCLSID );           // Through with wide version
00135
00136   _tcscat( szKey, pszCLSID );
00137   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00138
00139   // Delete the CLSID Key - CLSID\{...}
00140   LONG lResult = RecursiveDeleteKey( HKEY_CLASSES_ROOT, szKey );
00141   if( ERROR_SUCCESS != lResult )
00142     hResult = HRESULT_FROM_WIN32( lResult );
00143
00144   return hResult;
00145 }
00146
00147 //---------------------------------------------------------------------------
00148 // Register the snap-in in the registry.
00149 //
00150 HRESULT RegisterSnapin
00151 (
00152   const  CLSID&  clsid,              //[in] Class ID
00153   const  TCHAR*  szNameString,       //[in] NameString
00154   const  CLSID&  clsidAbout,         //[in] Class Id for About Class
00155   const  BOOL    bSupportExtensions  //[in] TRUE if we support extensions
00156 )
00157 {
00158   HRESULT hResult = S_FALSE;
00159   TCHAR*  pszSnapCLSID = NULL;         // Needed for TCHAR version of the ClassID
00160
00161   // If any part of this process fails, jump out of the loop and return
00162   // the error code
00163   do
00164   {
00165     // Allocate the CLSID string
00166     LPOLESTR wszSnapCLSID  = NULL ;
00167     hResult = StringFromCLSID( clsid, &wszSnapCLSID ) ;
00168     if( S_OK != hResult )
00169     {
00170        CoTaskMemFree( wszSnapCLSID );
00171        continue;
00172     }
00173
00174     W2T( &pszSnapCLSID, wszSnapCLSID );  // W2T is defined in Globals.h
00175     CoTaskMemFree( wszSnapCLSID );       // Through with wide version
00176
00177     // Add the Snap-in's CLSID to the registry
00178     hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("NameString"), szNameString );
00179     BREAK_ON_ERROR( hResult );
00180
00181     // Extensions don't support ISnapinAbout, so this is not handled
00182
00183     if( TRUE == bSupportExtensions )     // Build the NodeTypesKey
00184     {
00185       hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("NodeTypes"), NULL, NULL );
00186       BREAK_ON_ERROR( hResult );
00187       TCHAR szKey[64];
00188       _tcscpy( szKey, pszSnapCLSID );
00189       _tcscat(szKey, _T("\\NodeTypes"));
00190       hResult = SetSnapInKeyAndValue( szKey, pszSnapCLSID, NULL, NULL );
00191       BREAK_ON_ERROR( hResult );
00192     }
00193   }while( 0 );
00194
00195   hResult = SetExtensionKey( gtszVFILE_GUID );
00196
00197
00198
00199   CoTaskMemFree( pszSnapCLSID);
00200   return hResult;
00201 }
00202
00203
00204 //---------------------------------------------------------------------------
00205 // Unregister the snap-in in the registry.
00206 //
00207 HRESULT UnregisterSnapin
00208 (
00209   const CLSID& clsid         //[in] Class ID of object to unregister
00210 )
00211 {
00212   HRESULT hResult = S_OK;
00213
00214   TCHAR    szKeyBuf[1024];
00215   LPOLESTR wszCLSID = NULL;
00216   TCHAR*   pszCLSID = NULL;        // Needed for TCHAR version of the ClassID
00217
00218   // Get CLSID as a wide string
00219   hResult = StringFromCLSID( clsid, &wszCLSID );
00220   if( S_OK != hResult )
00221   {
00222     CoTaskMemFree( wszCLSID );
00223     return hResult;
00224   }
00225
00226   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00227   CoTaskMemFree( wszCLSID );           // Through with wide version
00228
00229   // Load the buffer with the Snap-In Location
00230   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00231
00232   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00233   _tcscat( szKeyBuf, pszCLSID );
00234
00235   // Delete the CLSID Key - CLSID\{...}
00236   LONG lResult = RecursiveDeleteKey( HKEY_LOCAL_MACHINE, szKeyBuf );
00237   if( ERROR_SUCCESS != lResult )
00238     hResult = HRESULT_FROM_WIN32( lResult );
00239
00240   CoTaskMemFree( pszCLSID );
00241   return hResult;
00242 }
00243
00244 //---------------------------------------------------------------------------
00245 // Delete a key and all of its descendents.
00246 //
00247 HRESULT RecursiveDeleteKey
00248 (
00249   HKEY          hKeyParent,    //[in] Parent of key to delete
00250   const TCHAR*  lpszKeyChild   //[in] Key to delete
00251 )
00252 {
00253   // Open the child.
00254   HKEY hKeyChild = NULL;
00255   LONG lResult   = ERROR_SUCCESS;
00256
00257   do                     // We go to all this trouble to prevent any
00258   {                      // possibility of exiting while leaving a key open
00259
00260     lResult = RegOpenKeyEx( hKeyParent,
00261                             lpszKeyChild,
00262                             0,
00263                             KEY_ALL_ACCESS,
00264                             &hKeyChild
00265                           );
00266     if( ERROR_SUCCESS != lResult )
00267       continue;
00268
00269     // Enumerate all of the decendents of this child.
00270     FILETIME time;
00271     _TCHAR szBuffer[256];
00272     DWORD dwSize = 256;
00273     while( S_OK == RegEnumKeyEx(hKeyChild,0,szBuffer,&dwSize,NULL,NULL,NULL,&time) )
00274     {
00275       // Delete the decendents of this child.
00276       lResult = RecursiveDeleteKey( hKeyChild, szBuffer );
00277       if( ERROR_SUCCESS != lResult )
00278       {
00279         continue;
00280       }
00281       dwSize = 256;
00282     }
00283   }while( 0 );
00284
00285   RegCloseKey( hKeyChild );            // Always try to close the child
00286                                        // then delete this child.
00287   return RegDeleteKey( hKeyParent, lpszKeyChild );
00288 }
00289
00290 //---------------------------------------------------------------------------
00291 // Create a Registry Key and set its value.
00292 //   - This helper function was borrowed and modifed from
00293 //     Kraig Brockschmidt's book Inside OLE.
00294 //
00295 HRESULT SetKeyAndValue
00296 (
00297   const TCHAR*  szKey,       //[in] Parent key
00298   const TCHAR*  szSubkey,    //[in] Child key
00299   const TCHAR*  szValue      //[in] Value to set
00300 )
00301 {
00302   HKEY hKey = NULL;
00303   HRESULT hResult = S_FALSE;
00304   TCHAR szKeyBuf[1024];
00305
00306   // Copy keyname into buffer.
00307   _tcscpy( szKeyBuf, szKey );
00308
00309   // Add subkey name to buffer.
00310   if( NULL != szSubkey )
00311   {
00312     _tcscat( szKeyBuf, _T("\\") );
00313     _tcscat( szKeyBuf, szSubkey );
00314   }
00315
00316   do                     // We go to all this trouble to prevent any
00317   {                      // possibility of exiting while leaving a key open
00318
00319     // Create and open key and subkey.
00320     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT,
00321                                    szKeyBuf,
00322                                    0,
00323                                    NULL,
00324                                    REG_OPTION_NON_VOLATILE,
00325                                    KEY_ALL_ACCESS,
00326                                    NULL,
00327                                    &hKey,
00328                                    NULL
00329                                  );
00330     if( ERROR_SUCCESS != lResult )
00331     {
00332       hResult = HRESULT_FROM_WIN32( lResult );
00333       continue;
00334     }
00335
00336     if( NULL != szValue )    // Now set the value
00337     {
00338       hResult = RegSetValueEx( hKey,
00339                                NULL,
00340                                0,
00341                                REG_SZ,
00342                                (BYTE*)szValue,
00343                                BYTE_SIZE( szValue )    // BYTE_SIZE is in Globals.h
00344                              );
00345       BREAK_ON_ERROR( hResult );
00346     }
00347   }while( 0 );
00348
00349   RegCloseKey( hKey );       // Always try to close the key
00350   return hResult;
00351 }
00352
00353
00354 //---------------------------------------------------------------------------
00355 // Open a key value and set it
00356 //
00357 HRESULT SetValue
00358 (
00359   const TCHAR*  szKey,         //[in] Parent key
00360   const TCHAR*  szValueName,   //[in] Name of value
00361   const TCHAR*  szValue        //[in] Value in string format
00362 )
00363 {
00364   HKEY    hKey = NULL;
00365   HRESULT hResult = S_FALSE;
00366   TCHAR szKeyBuf[1024];
00367
00368   // Copy keyname into buffer.
00369   _tcscpy( szKeyBuf, szKey );
00370
00371   do                     // We go to all this trouble to prevent any
00372   {                      // possibility of exiting while leaving a key open
00373
00374     // Create and open key and subkey.
00375     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT ,
00376                                    szKeyBuf,
00377                                    0,
00378                                    NULL,
00379                                    REG_OPTION_NON_VOLATILE,
00380                                    KEY_ALL_ACCESS,
00381                                    NULL,
00382                                    &hKey,
00383                                    NULL
00384                                  );
00385     if( ERROR_SUCCESS != lResult )
00386     {
00387       hResult = HRESULT_FROM_WIN32( lResult );
00388       continue;
00389     }
00390
00391     if( NULL != szValue )    // Now set the value
00392     {
00393       hResult = RegSetValueEx( hKey,
00394                                szValueName,
00395                                0,
00396                                REG_SZ,
00397                                (BYTE*)szValue,
00398                                BYTE_SIZE( szValue )
00399                              );
00400       BREAK_ON_ERROR( hResult );
00401     }
00402   }while( 0 );
00403
00404   RegCloseKey( hKey );       //Always attempt to close the key
00405   return hResult;
00406 }
00407
00408
00409 //---------------------------------------------------------------------------
00410 // Create a key and set its value.
00411 //   - This helper function was borrowed and modifed from
00412 //     Kraig Brockschmidt's book Inside OLE.
00413 //
00414 HRESULT SetSnapInKeyAndValue
00415 (
00416   const TCHAR*  szKey,       //[in] Parent key
00417   const TCHAR*  szSubkey,    //[in] Child key
00418   const TCHAR*  szName,      //[in] Value name
00419   const TCHAR*  szValue      //[in] Value in string format
00420 )
00421 {
00422   HKEY    hKey = NULL;
00423   HRESULT hResult = S_FALSE;
00424   TCHAR   szKeyBuf[1024];
00425
00426   // Load the buffer with the Snap-In Location
00427   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00428
00429   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00430   _tcscat( szKeyBuf, szKey );
00431
00432   if( NULL != szSubkey )               // Add subkey name to buffer.
00433   {
00434     _tcscat( szKeyBuf, _T("\\") );
00435     _tcscat( szKeyBuf, szSubkey );
00436   }
00437
00438   do                     // We go to all this trouble to prevent any
00439   {                      // possibility of exiting while leaving a key open
00440
00441     // Create and open key and subkey.
00442     long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00443                                    szKeyBuf,
00444                                    0,
00445                                    NULL,
00446                                    REG_OPTION_NON_VOLATILE,
00447                                    KEY_ALL_ACCESS,
00448                                    NULL,
00449                                    &hKey,
00450                                    NULL
00451                                  );
00452     if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00453       continue;
00454
00455     // Set the Value.
00456     if( szValue != NULL )
00457     {
00458       hResult = RegSetValueEx( hKey,
00459                                szName,
00460                                0,
00461                                REG_SZ,
00462                                (BYTE*)szValue,
00463                                BYTE_SIZE(szValue)
00464                              );
00465       BREAK_ON_ERROR( hResult );
00466     }
00467     else
00468     {                        // Got this far so everything is OK.
00469       hResult = S_OK;
00470     }
00471   }while( 0 );
00472
00473   RegCloseKey( hKey );       //Always attempt to close the key
00474   return hResult;
00475 }
00476
00477 //---------------------------------------------------------------------------
00478 //  XPROPPAGE:  Adds the keys under the MMC/NodeTypes key to register our
00479 //              Snapin as an extension.
00480 //
00481 HRESULT SetExtensionKey
00482 (
00483   const TCHAR*  szNodeType
00484 )
00485 {
00486   HKEY    hNodeKey = NULL;
00487   HRESULT hResult  = S_FALSE;
00488   TCHAR   szKeyBuf[1024];
00489
00490   // Load the buffer with the NodeTypes Location
00491   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes") );
00492
00493   _tcscat( szKeyBuf, _T("\\") );       // Copy NodeType GUID into buffer.
00494   _tcscat( szKeyBuf, szNodeType );
00495
00496   _tcscat( szKeyBuf, _T("\\") );       // Copy Subkeys into buffer
00497   _tcscat( szKeyBuf, _T("Extensions\\PropertySheet") );
00498
00499   long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00500                                  szKeyBuf,
00501                                  0,
00502                                  NULL,
00503                                  REG_OPTION_NON_VOLATILE,
00504                                  KEY_ALL_ACCESS,
00505                                  NULL,
00506                                  &hNodeKey,
00507                                  NULL
00508                                );
00509
00510   if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00511   {
00512     RegCloseKey( hNodeKey );
00513     return S_FALSE;
00514   }
00515
00516   TCHAR* szDescription = _T("VirtFileX");
00517   hResult = RegSetValueEx( hNodeKey,
00518                            gtszPROPPAGEX_GUID,
00519                            0,
00520                            REG_SZ,
00521                            (BYTE*)szDescription,
00522                            BYTE_SIZE(szDescription)
00523                          );
00524
00525   return hResult;
00526 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::CompareEnum Member List

This is the complete list of members for msado15::CompareEnum, including all inherited members.
adCompareEqual | msado15::CompareEnum | [static]
adCompareGreaterThan | msado15::CompareEnum | [static]
adCompareLessThan | msado15::CompareEnum | [static]
adCompareNotComparable | msado15::CompareEnum | [static]
adCompareNotEqual | msado15::CompareEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/SmartCardAPI/SCQuery/SCCommon.h Source File

  • Security
  • SmartCard
  • SmartCardAPI
  • SCQuery

SCCommon.h

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Filename:    SCCommon.h
00010
00011  Abstract:    Common routines for used by Smart Card enbled application.
00012
00013  Environment: Win32 console, C++ w/SEH
00014
00015 ------------------------------------------------------------------------------*/
00016
00017 #if !defined (INC_SCCOMMON_H)
00018     #define INC_SCCOMMON_H
00019
00020 //
00021 // C interface
00022 //
00023     #ifdef __cplusplus
00024 extern "C"
00025 {
00026     #endif
00027
00028
00029     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00030
00031      Function : SCMalloc
00032
00033      Synopsis : Allocate a block of memory and initialize to all 0s.
00034
00035      Parameter: - IN DWORD dwSize
00036
00037                   Size of memory to allocate in bytes.
00038
00039      Return   : Pointer to allocated memory block or NULL. Memory allocated must be
00040                 freed with SCFree().
00041
00042     ------------------------------------------------------------------------------*/
00043
00044     LPVOID SCMalloc (IN DWORD dwSize);
00045
00046
00047     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00048
00049      Function : SCFree
00050
00051      Synopsis : Free a block of memory previously allocated by SCMalloc().
00052
00053      Parameter: - IN LPVOID lpMemory
00054
00055                   Pointer to memory block to be freed.
00056
00057      Return   : SCARD_S_SUCCESS or error code
00058
00059     ------------------------------------------------------------------------------*/
00060
00061     LONG SCFree (IN LPVOID lpMemory);
00062
00063
00064     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00065
00066      Function : SCListReaders
00067
00068      Synopsis : Return a list of registered Smart Card readers associated with the
00069                 specified reader groups.
00070
00071      Parameter: - IN SCARDCONTEXT hContext
00072
00073                   Resource manager context returned by SCardEstablishContext(), or
00074                   NULL if the query is not directed towards a specific context.
00075
00076                 - IN LPCTSTR lpmszReaderGroups
00077
00078                   Pointer to multi-string reader group names, or NULL to list all
00079                   readers known to the system.
00080
00081                 - OUT LPTSTR * lplpmszReaderNames
00082
00083                   Receives a pointer to a block of memory containing list of
00084                   registered reader names. This block of memory must be freed
00085                   with SCFree().
00086
00087      Return   : SCARD_S_SUCCESS or error code
00088
00089     ------------------------------------------------------------------------------*/
00090
00091     LONG SCListReaders (IN SCARDCONTEXT hContext,
00092                         IN LPCTSTR lpmszReaderGroups,
00093                         OUT LPTSTR * lplpmszReaderNames);
00094
00095
00096     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00097
00098      Function : SCListCards
00099
00100      Synopsis : Return a list of registered Smart Cards associated with the
00101                 specified ATR string.
00102
00103      Parameter: - IN SCARDCONTEXT hContext
00104
00105                   Resource manager context returned by SCardEstablishContext(), or
00106                   NULL if the query is not directed towards a specific context.
00107
00108                 - IN LPCBYTE lpszATR
00109
00110                   ATR string of the card to list, or NULL to return all cards known
00111                   to the system.
00112
00113                 - OUT LPTSTR * lplpmszCardNames
00114
00115                   Receives a pointer to a block of memory containing list of
00116                   registered card names. This block of memory must be freed
00117                   with SCFree().
00118
00119      Return   : SCARD_S_SUCCESS or error code
00120
00121     ------------------------------------------------------------------------------*/
00122
00123     LONG SCListCards (IN SCARDCONTEXT hContext,
00124                       IN LPCBYTE lpszATR,
00125                       OUT LPTSTR * lplpmszCardNames);
00126
00127
00128     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00129
00130      Function : SCListGroups
00131
00132      Synopsis : Return a list of registered reader groups.
00133
00134      Parameter: - IN SCARDCONTEXT hContext
00135
00136                   Resource manager context returned by SCardEstablishContext(), or
00137                   NULL if the query is not directed towards a specific context.
00138
00139                 - OUT LPTSTR * lplpmszGroupNames
00140
00141                   Receives a pointer to a block of memory containing list of
00142                   registered reader group names. This block of memory must be freed
00143                   with SCFree().
00144
00145      Return   : SCARD_S_SUCCESS or error code
00146
00147     ------------------------------------------------------------------------------*/
00148
00149     LONG SCListGroups (IN SCARDCONTEXT hContext,
00150                        OUT LPTSTR * lplpmszGroupNames);
00151
00152
00153     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00154
00155      Function : SCGetAttrib
00156
00157      Synopsis : Get the current reader attributes for the given card handle. It does
00158                 not affect the state of the reader, driver, or card.
00159
00160
00161      Parameter: - IN SCARDHANDLE hCard
00162
00163                   Card handle returned by SCardConnect()
00164
00165                 - IN DWORD dwAttrId
00166
00167                   Identifier for the attribute to get
00168
00169                 - OUT LPBYTE * lplpbAttr
00170
00171                   Receives a pointer to a block of memory containing the requested
00172                   attribute.  This block of memory must be freed with SCFree().
00173
00174      Return   : SCARD_S_SUCCESS or error code
00175
00176     ------------------------------------------------------------------------------*/
00177
00178     LONG SCGetAttrib (IN SCARDHANDLE hCard,
00179                       IN DWORD dwAttrId,
00180                       OUT LPBYTE * lplpbAttr);
00181
00182
00183     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00184
00185      Function : SCGetResponse
00186
00187      Synopsis : Get the response data from the card.
00188
00189      Parameter: - IN SCARDHANDLE hCard
00190
00191                   Card handle returned by SCardConnect()
00192
00193                 - IN DWORD dwLength
00194
00195                   Length of response data to retrieve in bytes
00196
00197                 - OUT LPBYTE * lplpbResponse
00198
00199                   Receives a pointer to a block of memory containing the requested
00200                   response data from the card. This block of memory must be freed
00201                   with SCFree().
00202
00203      Return   : SCARD_S_SUCCESS or error code
00204
00205     ------------------------------------------------------------------------------*/
00206
00207     LONG SCGetResponse (IN SCARDHANDLE hCard,
00208                         IN DWORD dwLength,
00209                         OUT LPBYTE * lplpbResponse);
00210
00211
00212     /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00213
00214      Function : SCSelectFile
00215
00216      Synopsis : Select a file on the Smart Card.
00217
00218      Parameter: - IN SCARDHANDLE hCard
00219
00220                   Card handle returned by SCardConnect()
00221
00222                 - IN LPBYTE lpbFileName
00223
00224                   Pointer to 2-byte filename to select on the card
00225
00226                 - OUT LPDWORD lpdwExtraBytes
00227
00228                   Pointer to a DWORD to receive number of extra bytes available from
00229                   the card as a consequent of this operation.
00230
00231      Return   : SCARD_S_SUCCESS or error code
00232
00233     ------------------------------------------------------------------------------*/
00234
00235     LONG SCSelectFile (IN SCARDHANDLE hCard,
00236                        IN LPBYTE lpbFileName,
00237                        OUT LPDWORD lpdwExtraBytes);
00238
00239     #ifdef __cplusplus
00240 }
00241     #endif
00242
00243 #endif
00244
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSimpleDialog Member List

This is the complete list of members for CSimpleDialog, including all inherited members.
AddStatusMessage(LPCWSTR wszFormat,...) | CSimpleDialog |
CollectUserInput(IN OUT WCHAR *wszBuffVirtualDir, IN DWORD cchBuffVirtualDir, IN OUT WCHAR *wszBuffSampleText, IN DWORD cchBuffSampleText, OUT BOOL *fRequireUploadReply) | CSimpleDialog | [private]
CSimpleDialog(HINSTANCE hInstance, ULONG ulDialogId) | CSimpleDialog |
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private, static]
GetHwnd() | CSimpleDialog |
m_DlgProc | CSimpleDialog | [private]
m_hInstance | CSimpleDialog | [private]
m_hWnd | CSimpleDialog | [private]
m_ulDialogId | CSimpleDialog | [private]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CSimpleDialog | [private]
Show(INT iShowState) | CSimpleDialog |
~CSimpleDialog() | CSimpleDialog |
Generated on Wed Nov 13 2024 16:57:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ADORecordsetConstruction Member List

This is the complete list of members for msado15::ADORecordsetConstruction, including all inherited members.
getChapter() | msado15::ADORecordsetConstruction |
getRowPosition() | msado15::ADORecordsetConstruction |
getRowset() | msado15::ADORecordsetConstruction |
iid | msado15::ADORecordsetConstruction | [static]
setChapter(int plChapter) | msado15::ADORecordsetConstruction |
setRowPosition(IUnknown ppRowPos) | msado15::ADORecordsetConstruction |
setRowset(IUnknown ppRowset) | msado15::ADORecordsetConstruction |
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/palette/Mypal.c Source File

  • Multimedia
  • Gdi
  • palette

Mypal.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /***************************************************************************
00013  *                                                                         *
00014  *  PROGRAM     : MyPal.c                                                  *
00015  *                                                                         *
00016  *  PURPOSE     : Sets up a bar representation of the current physical     *
00017  *                palette and displays useful information regarding        *
00018  *                pixel colors and palette indices.                        *
00019  *                                                                         *
00020  *  FUNCTIONS   : WinMain() - calls initialization function,               *
00021  *                            processes message loop                       *
00022  *                                                                         *
00023  *                WndProc() - Window function for app. Processes           *
00024  *                            window messages.                             *
00025  *                                                                         *
00026  *              ShowColor() - Displays a little box on each side of the    *
00027  *                            caption bar displaying the pixel color at the*
00028  *                            mouse position.                              *
00029  ***************************************************************************/
00030
00031 #include <windows.h>
00032 #include <tchar.h>
00033 #include <stdio.h>
00034 #include "mypal.h"
00035
00036 HANDLE          hPal;          /* Handle to the application's logical palette */
00037 static INT      nSizeX;        /* Width of the application window             */
00038 static INT      nSizeY;        /* Height of the application window            */
00039 INT             nXBorder;      /* Width of window border                      */
00040 INT             nXTitle;       /* Width of title bar                          */
00041 INT             nYTitle;       /* Height of title bar                         */
00042 BOOL            bCaptureOn;    /* Indicates if mouse capture is on            */
00043 DWORD           dwIndex;       /* Last index selected in palette              */
00044 CHAR            szTitlebuf[90];/* Buffer for pixel and palette info. text     */
00045 HDC             hDCGlobal;     /* The Screen DC                               */
00046 DWORD           dwNumColors;   /* Number of colors supported by device        */
00047 INT             iRasterCaps;   /* Raster capabilities                         */
00048 RECT            rClientRect;   /* Client rectangle coordinates                */
00049 DWORD           dwPal[PALETTESIZE];   /* Stores palette entries for later lookup  */
00050 INT             iGlobalXOffset;
00051 INT             iGlobalYOffset;
00052 INT             iYMiddle;
00053
00054 LONG APIENTRY WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam);
00055
00056 BOOL InPaletteBasedVideoMode()
00057 {
00058     HDC hdc = GetDC(NULL);
00059     BOOL bRet;
00060     int iRasCaps;
00061
00062     iRasCaps = GetDeviceCaps(hdc, RASTERCAPS);
00063     bRet = (iRasCaps & RC_PALETTE) ? TRUE : FALSE;
00064
00065     ReleaseDC(NULL, hdc);
00066
00067     return bRet;
00068 }
00069
00070 /****************************************************************************
00071  *                                                                          *
00072  *  FUNCTION   : void ShowColor(HWND hWnd, HDC hDC)                         *
00073  *                                                                          *
00074  *  PURPOSE    : Displays a little box on each side of the caption bar      *
00075  *               displaying the pixel color at the mouse position.          *
00076  *                                                                          *
00077  ****************************************************************************/
00078 VOID ShowColor (
00079         HWND  hWnd,
00080         HDC   hDC)
00081 {
00082      HBRUSH  hBrush, hOldBrush;
00083
00084      hBrush    = CreateSolidBrush ( PALETTEINDEX(dwIndex) );
00085    if (!hBrush)
00086      return;
00087    hOldBrush = SelectObject (hDC,hBrush) ;
00088
00089      GetWindowRect (hWnd, (LPRECT)&rClientRect);
00090
00091      PatBlt ( hDC,
00092               rClientRect.left + nXTitle + nXBorder + 1,
00093               rClientRect.top + nXBorder,
00094               nXTitle,
00095               nYTitle,
00096               PATCOPY);
00097
00098      PatBlt(hDC,
00099             rClientRect.right - ( 3 * nXTitle + nXBorder + 2),
00100             rClientRect.top + nXBorder,
00101             nXTitle,
00102             nYTitle,
00103             PATCOPY);
00104      SelectObject (hDC, hOldBrush);
00105      DeleteObject (hBrush) ;
00106 }
00107
00108 /****************************************************************************
00109  *                                                                          *
00110  *  FUNCTION   : WinMain(HANDLE, HANDLE, LPSTR, int)                        *
00111  *                                                                          *
00112  *  PURPOSE    : Creates the app. window and processes the message loop.    *
00113  *                                                                          *
00114  ****************************************************************************/
00115 int APIENTRY WinMain(
00116     HINSTANCE hInstance,
00117     HINSTANCE hPrevInstance,
00118     LPSTR lpCmdLine,
00119     int nCmdShow
00120     )
00121 {
00122      static CHAR szAppName [] = "MyPal";
00123      HWND        hWnd;
00124      WNDCLASS    wndclass;
00125      MSG         msg ;
00126      INT         xScreen;
00127      INT         yScreen;
00128      UNREFERENCED_PARAMETER( lpCmdLine );
00129
00130      if (!hPrevInstance){
00131          wndclass.style         = CS_HREDRAW | CS_VREDRAW;
00132          wndclass.lpfnWndProc   = (WNDPROC) WndProc;
00133          wndclass.cbClsExtra    = 0;
00134          wndclass.cbWndExtra    = 0;
00135          wndclass.hInstance     = hInstance;
00136          wndclass.hIcon         = LoadIcon(hInstance, szAppName);
00137          wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW);
00138          wndclass.hbrBackground = GetStockObject (BLACK_BRUSH);
00139          wndclass.lpszMenuName  = szAppName;
00140          wndclass.lpszClassName = szAppName;
00141
00142          if (!RegisterClass (&wndclass))
00143              return FALSE ;
00144      }
00145
00146      /* Do some global initializations */
00147      xScreen     = GetSystemMetrics (SM_CXSCREEN);
00148      yScreen     = GetSystemMetrics (SM_CYSCREEN);
00149      nXBorder    = (INT)GetSystemMetrics (SM_CXFRAME);
00150      nXTitle     = (INT)GetSystemMetrics (SM_CXSIZE);
00151      nYTitle     = (INT)GetSystemMetrics (SM_CYSIZE);
00152      dwIndex      = 0;
00153      bCaptureOn  = FALSE;
00154
00155      hDCGlobal   = GetDC (NULL);
00156      iRasterCaps = GetDeviceCaps(hDCGlobal, RASTERCAPS);
00157      iRasterCaps = (iRasterCaps & RC_PALETTE) ? TRUE : FALSE;
00158
00159      if (iRasterCaps)
00160          dwNumColors = GetDeviceCaps(hDCGlobal, SIZEPALETTE);
00161      else
00162          dwNumColors = GetDeviceCaps( hDCGlobal, NUMCOLORS);
00163      ReleaseDC (NULL,hDCGlobal);
00164
00165      nSizeX = ((xScreen - 2*nXBorder) / PALETTESIZE) * PALETTESIZE;
00166
00167      /* create the app. window */
00168      hWnd = CreateWindow (szAppName,
00169                           "My Physical Palette ",
00170                           WS_OVERLAPPEDWINDOW,
00171                           (xScreen-nSizeX) / 2 - nXBorder,
00172                           4 * GetSystemMetrics (SM_CYCAPTION),
00173                           nSizeX + 2 * nXBorder,
00174                           4 * GetSystemMetrics (SM_CYCAPTION),
00175                           NULL,
00176                           NULL,
00177                           hInstance,
00178                           NULL);
00179      ShowWindow (hWnd, nCmdShow);
00180      UpdateWindow (hWnd);
00181
00182      while (GetMessage (&msg, NULL, 0, 0)){
00183            TranslateMessage (&msg) ;
00184            DispatchMessage (&msg) ;
00185      }
00186
00187      return (int)msg.wParam ;
00188 }
00189
00190 /******************************************************************************
00191  *                                                                            *
00192  *  FUNCTION: WndProc(HWND, unsigned, WORD, LONG)                             *
00193  *                                                                            *
00194  *  PURPOSE:  Processes window messages and sets up a 256 bar representation  *
00195  *            of the current physical palette. Specifically, in response to:  *
00196  *                                                                            *
00197  *               WM_CREATE  -Allocates for and sets up a LOGPALETTE           *
00198  *                           structure, creates a logical palette the same    *
00199  *                           size as the physical palette and obtains a       *
00200  *                           handle to the logical palette.                   *
00201  *                                                                            *
00202  *               WM_DESTROY -Destroys the logical palette and shuts down app. *
00203  *                                                                            *
00204  *               WM_PAINT   -Resizes client area to hold as many vertical     *
00205  *                           color bars as there are physical palette entries.*
00206  *                           Also realises the current logical palette and    *
00207  *                           draws one color bar corresponding to each        *
00208  *                           palette entry                                    *
00209  *                                                                            *
00210  *           WM_RBUTTONDOWN -Captures the mouse and initiates the below       *
00211  *                           process:                                         *
00212  *                                                                            *
00213  *           WM_MOUSEMOVE   -Following a WM_RBUTTONDOWN, if the right mouse   *
00214  *                           key is depressed, displays info about the        *
00215  *                           pixel RGB value and palette index of the mouse   *
00216  *                           coordinates.                                     *
00217  *                                                                            *
00218  *           WM_RBUTTONUP   -Release mouse capture and terminates the above   *
00219  *                           process                                          *
00220  *                                                                            *
00221  *           WM_LBUTTONDOWN -Determines and displays the palette index and    *
00222  *                           RGB value of the bar under the mouse.            *
00223  *                                                                            *
00224  *           WM_KEYDOWN     -Allows use of the arrow keys in stepping thro'   *
00225  *                           palette entries.                                 *
00226  *                                                                            *
00227  *****************************************************************************/
00228  LONG APIENTRY WndProc (
00229      HWND         hWnd,
00230      UINT     iMessage,
00231      WPARAM         wParam,
00232      LPARAM         lParam)
00233  {
00234      HDC           hDC;
00235      PAINTSTRUCT   ps;
00236      DWORD         dwLoop;
00237      INT           nStart;
00238      HBRUSH        hBrush;
00239      HBRUSH        hOldBrush;
00240
00241      MPOINT        pt;
00242      static INT    nIncr;
00243      static DWORD  dwColor;
00244      static DWORD  dwLastColor;
00245      static DWORD  i, x;
00246
00247    switch (iMessage) {
00248      case WM_DISPLAYCHANGE:
00249          // The video mode changed, update the number of colors
00250          dwNumColors = 1 << wParam;
00251
00252          if (!InPaletteBasedVideoMode()) {  // Should we attempt to display a non palette mode
00253              MessageBox(hWnd, "<WM_DISPLAYCHANGE> The current video mode is not palette based.\nSwitch to a palette based video mode for this sample to work properly", NULL, MB_OK | MB_ICONHAND);
00254          }
00255          break;
00256
00257      case WM_DESTROY:
00258          // delete the handle to the logical palette
00259          if (hPal)
00260              DeleteObject (hPal);
00261          PostQuitMessage (0) ;
00262          break ;
00263
00264      case WM_CREATE:
00265          {
00266              NPLOGPALETTE    pLogPal;       /* Pointer to program's logical palette        */
00267
00268              if (!InPaletteBasedVideoMode()) {  // Should we attempt to display a non palette mode
00269                  MessageBox(hWnd, "<WM_CREATE> The current video mode is not palette based.\nSwitch to a palette based video mode for this sample to work properly", NULL, MB_OK | MB_ICONHAND);
00270              }
00271
00272              // Allocate enough memory for a logical palette with
00273              // PALETTESIZE entries and set the size and version fields
00274              // of the logical palette structure.
00275              pLogPal = (NPLOGPALETTE) LocalAlloc (LMEM_FIXED,
00276                  (sizeof (LOGPALETTE) +
00277                  (sizeof (PALETTEENTRY) * (PALETTESIZE))));
00278
00279              if(!pLogPal){
00280                  MessageBox(hWnd, "<WM_CREATE> Not enough memory for palette.", NULL, MB_OK | MB_ICONHAND);
00281                  PostQuitMessage (0) ;
00282                  break;
00283              }
00284
00285              pLogPal->palVersion    = 0x300;
00286              pLogPal->palNumEntries = PALETTESIZE;
00287
00288              // fill in intensities for all palette entry colors
00289              for (dwLoop = 0; dwLoop < PALETTESIZE; dwLoop++) {
00290                  *((WORD *) (&pLogPal->palPalEntry[dwLoop].peRed)) = (WORD)dwLoop;
00291                  pLogPal->palPalEntry[dwLoop].peBlue  = 0;
00292                  pLogPal->palPalEntry[dwLoop].peFlags = PC_EXPLICIT;
00293              }
00294
00295              //  create a logical color palette according the information
00296              //  in the LOGPALETTE structure.
00297              hPal = CreatePalette ((LPLOGPALETTE) pLogPal) ;
00298
00299              LocalFree(pLogPal);
00300          }
00301          break;
00302
00303      case WM_GETMINMAXINFO:
00304
00305          ((LPRGPT)lParam)->iInfo[6] = nXBorder * 2 + PALETTESIZE;
00306          ((LPRGPT)lParam)->iInfo[7] = nXBorder * 2 + nYTitle*3;
00307
00308          return (long) DefWindowProc (hWnd, iMessage, wParam, lParam) ;
00309          break;
00310
00311      case WM_PAINT:
00312          GetClientRect(hWnd,(LPRECT) &rClientRect);
00313
00314          if (!InPaletteBasedVideoMode()) {  // Should we attempt to display a palette
00315              hDC = BeginPaint(hWnd, &ps);
00316
00317              PatBlt(hDC,0,0,rClientRect.right, rClientRect.bottom, BLACKNESS);
00318              SetWindowText (hWnd, (LPSTR)"The current video mode is not palette based.");
00319
00320              EndPaint(hWnd,&ps);
00321
00322              return 0;
00323          }
00324
00325          // Divide client width into equal-sized parts, one per palette
00326          // entry, and re-calculate client width so that it will display
00327          // exactly as many vertical bars as there are palette entries.
00328          nSizeX = (rClientRect.right - rClientRect.left);
00329          nSizeX = (nSizeX/dwNumColors) * dwNumColors;
00330
00331          nSizeY = rClientRect.bottom - rClientRect.top;
00332          GetWindowRect(hWnd,(LPRECT) &rClientRect);
00333
00334          // Adjust window width so that it can display exactly
00335          // as many vertical bars( of equal width) as there are palette
00336          // colors.
00337
00338          SetWindowPos( hWnd,
00339              (HWND)NULL,
00340              0,
00341              0,
00342              nSizeX + 2*nXBorder,
00343              rClientRect.bottom - rClientRect.top,
00344              SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
00345
00346          hDC = BeginPaint(hWnd, &ps);
00347
00348
00349          // Select the palette into the window device context and
00350          // make the Palette Manager map the logical palette to the
00351          // system palette (realize it).
00352          SelectPalette (hDC, hPal, 1);
00353          RealizePalette (hDC);
00354
00355          // Calculate width of each color bar to be displayed
00356          nIncr = nSizeX / dwNumColors;
00357
00358          // Paint the individual bars separately on the app. window
00359          for (nStart = dwLoop = 0; dwLoop < dwNumColors; dwLoop++) {
00360
00361              // Since this app. uses a logical palette, use the
00362              // PALETTEINDEX macro to specify the palette entry
00363              // index instead of using an explicit RGB value.
00364
00365              hBrush       = CreateSolidBrush (PALETTEINDEX (dwLoop));
00366        if (!hBrush)
00367          break;
00368              dwPal[dwLoop] = GetNearestColor (hDC, PALETTEINDEX (dwLoop) );
00369              hOldBrush    = SelectObject (hDC,hBrush) ;
00370              PatBlt (hDC, nStart, 0, nIncr, nSizeY, PATCOPY);
00371              nStart       += nIncr;
00372              SelectObject (hDC, hOldBrush);
00373              DeleteObject (hBrush) ;
00374          }
00375          _sntprintf (szTitlebuf, 89,"    MyPal Colors = %d", dwNumColors);
00376      szTitlebuf [89] = '\0';
00377          SetWindowText (hWnd, (LPSTR)szTitlebuf);
00378
00379          EndPaint(hWnd,&ps);
00380
00381          break ;
00382
00383      case WM_MOUSEMOVE:
00384          // Are we in a palette based mode?
00385          if (!InPaletteBasedVideoMode())
00386              break;  // No, bail.
00387
00388          if (wParam & MK_RBUTTON) {
00389
00390              POINT pnt;
00391
00392 #ifdef WIN16
00393              /* Convert mouse position to screen coordinates */
00394              pnt.x = LOWORD(lParam);
00395              pnt.y = HIWORD(lParam);
00396 #else
00397              LONG2POINT(lParam, pnt);
00398 #endif
00399              ClientToScreen(hWnd, &pnt);
00400
00401              /* Get RGB value (color) of pixel under mouse coordinate */
00402              dwColor = GetPixel(hDCGlobal, pnt.x, pnt.y);
00403
00404              /* If color value already exists in palette lookup table,
00405              * obtain it's index.
00406              */
00407              for (i=0 ; i < dwNumColors ; i++)
00408                  if ( dwColor == dwPal[i] )
00409                      break;
00410                  dwIndex = i;
00411
00412                  /* If previous color value was not identical to current one,
00413                  * display color boxes on either side of title bar,
00414                  * the R, G, B values and palette index of current color.
00415                  */
00416                  if (dwColor != dwLastColor) {
00417            _sntprintf ( szTitlebuf, 89,
00418                          "    MyPal Colors = %d  Index=%d  R=%3u G=%3u B=%3u",
00419                          dwNumColors,
00420                          dwIndex,
00421                          (WORD)(BYTE) GetRValue (dwColor),
00422                          (WORD)(BYTE) GetGValue (dwColor),
00423                          (WORD)(BYTE) GetBValue (dwColor));
00424            szTitlebuf [89] = '\0';
00425                      SetWindowText (hWnd, (LPSTR)szTitlebuf);
00426                      ShowColor (hWnd, hDCGlobal);
00427                      dwLastColor = dwColor;
00428                  }
00429          }
00430          break;
00431
00432      case WM_RBUTTONDOWN:
00433          // Are we in a palette based mode?
00434          if (!InPaletteBasedVideoMode())
00435              break;  // No, bail.
00436
00437          // Determine number of color bar under mouse, thus the index
00438          // of color in palette.
00439          x = LOWORD(lParam);
00440          dwIndex = (x / nIncr );
00441
00442          _sntprintf ( szTitlebuf, 89,
00443              "    MyPal Colors = %d  Index=%d  PalSize=%d RasterCaps:%d",
00444              dwNumColors,
00445              dwIndex,
00446              dwNumColors,
00447              iRasterCaps );
00448          szTitlebuf [89] = '\0';
00449          SetWindowText (hWnd, (LPSTR)szTitlebuf);
00450
00451          // Set mouse capture so that subsequent WM_MOUSEMOVEs
00452          // (with right mouse button depressed) will allow MyPal
00453          // to display RGB info anywhere on the screen without losing
00454          // the focus.
00455          SetCapture (hWnd);
00456          bCaptureOn = TRUE;
00457          hDCGlobal = GetDC(NULL);
00458          if (hPal) {
00459              SelectPalette (hDCGlobal, hPal, FALSE);
00460              RealizePalette (hDCGlobal);
00461          }
00462          break;
00463
00464      case WM_RBUTTONUP:
00465          // Stops displaying RGB and palette info and releases mouse
00466          // capture
00467          ReleaseDC (NULL, hDCGlobal);
00468          bCaptureOn = FALSE;
00469          ReleaseCapture ();
00470          break;
00471
00472      case WM_MOVE:
00473          // If you have a wide column, this adds 1/2 so X is centered
00474          iGlobalXOffset  = LOWORD (lParam);
00475          iGlobalYOffset  = HIWORD (lParam) + nXBorder;
00476          break;
00477
00478      case WM_SIZE:
00479          iYMiddle = (HIWORD (lParam)/2);
00480          break;
00481
00482      case WM_LBUTTONDOWN:
00483      case WM_KEYDOWN:
00484          // Are we in a palette based mode?
00485          if (!InPaletteBasedVideoMode())
00486              break;  // No, bail.
00487
00488
00489          if (iMessage == WM_LBUTTONDOWN){
00490              // determine which column was hit by the mouse
00491              x = LOWORD(lParam);
00492              dwIndex = (x / nIncr );
00493          }
00494          else{
00495              // Use arrow keys to step thro' the palette entries
00496              switch (wParam) {
00497              case VK_RIGHT:
00498              case VK_UP:
00499                  // go to next (higher) palette entry
00500                  dwIndex++;
00501                  break;
00502              case VK_LEFT:
00503              case VK_DOWN:
00504                  // go to previous (lower) palette entry
00505                  dwIndex--;
00506                  break;
00507              case VK_NEXT:
00508                  dwIndex += 10;
00509                  break;
00510              case VK_PRIOR:
00511                  dwIndex -= 10;
00512                  break;
00513              case VK_HOME:
00514                  // go to first palette entry
00515                  dwIndex = 0;
00516                  break;
00517              case VK_END:
00518                  // go to last palette entry
00519                  dwIndex = dwNumColors-1;
00520                  break;
00521              default:
00522                  return 0L;
00523                  break;
00524              }
00525              // Make sure the palette index is within range else
00526              // set it to the limiting values and give a warning beep.
00527              if (dwIndex > dwNumColors-1) {
00528                  dwIndex = dwNumColors-1;
00529                  MessageBeep(1);
00530              }
00531
00532              pt.x = (SHORT)((dwIndex * nIncr) +
00533                  iGlobalXOffset   +
00534                  ((nIncr > 1) ? (nIncr / 2) : 1));
00535              pt.y = (SHORT)(iYMiddle + iGlobalYOffset);
00536
00537              SetCursorPos (pt.x, pt.y);
00538          }
00539
00540          if (TRUE == bCaptureOn) {
00541              MessageBeep(1);
00542              break;
00543          }
00544
00545          // Select & realize the palette or the colors > 0x7
00546          // will not match up.
00547          hDC = GetDC(NULL);
00548      if (hPal)
00549          {
00550        SelectPalette  (hDC, hPal, 1);
00551        RealizePalette (hDC) ;
00552              dwColor = GetNearestColor (hDC, PALETTEINDEX (dwIndex));
00553              _sntprintf ( szTitlebuf, 89,
00554          "    MyPal Colors = %d  Index=%d  R=%3u G=%3u B=%3u",
00555          dwNumColors,
00556                  dwIndex,
00557                  (WORD)(BYTE)GetRValue (dwColor),
00558                  (WORD)(BYTE)GetGValue (dwColor),
00559                  (WORD)(BYTE)GetBValue (dwColor)
00560          );
00561              szTitlebuf [89] = '\0';
00562
00563                  SetWindowText (hWnd, (LPSTR)szTitlebuf);
00564                  ShowColor (hWnd,hDC);
00565      }
00566          ReleaseDC(NULL, hDC);
00567          break;
00568
00569      default:
00570          return (long) DefWindowProc (hWnd, iMessage, wParam, lParam) ;
00571
00572     }
00573     return 0L ;
00574 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/DCO_DimmerService/DeviceDll.cpp Source File

  • NetDS
  • upnp
  • DCO_DimmerService

DeviceDll.cpp

Go to the documentation of this file.
00001 //
00002 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 // PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00008 //
00009 //
00010 // DeviceDll.cpp : Implementation of DLL Exports from DeviceDll.def
00011
00012
00013 #include <stdio.h>
00014 #include <atlbase.h>
00015
00016 #include "DeviceDll.h"
00017
00018
00019 //object that implements the COM Server
00020 CComModule _Module;
00021
00022 #include <atlcom.h>     //has the Macro BEGIN_OBJECT_MAP etc.
00023 #include <objbase.h>
00024 #include <upnphost.h>
00025 #include "resource.h"
00026 #include "dimmerdevice.h"
00027 #include "DimmerService.h"
00028 #include "DimmerDeviceDCO.h"
00029
00030
00031 BEGIN_OBJECT_MAP(ObjectMap)
00032    OBJECT_ENTRY(CLSID_UPNPSampleDimmerDevice, UPNPDimmerDevice)
00033 END_OBJECT_MAP()
00034
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 // DLL Entry Point
00038 /////////////////////////////////////////////////////////////////////////////
00039 extern "C"
00040 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00041 {
00042    if (dwReason == DLL_PROCESS_ATTACH)
00043    {
00044       _Module.Init(ObjectMap, hInstance);
00045       DisableThreadLibraryCalls(hInstance);
00046    }
00047    else
00048       if (dwReason == DLL_PROCESS_DETACH)
00049          _Module.Term();
00050
00051    return TRUE;    // ok
00052 }
00053
00054
00055
00056 /////////////////////////////////////////////////////////////////////////////
00057 // Used to determine whether the DLL can be unloaded by OLE
00058 /////////////////////////////////////////////////////////////////////////////
00059 STDAPI DllCanUnloadNow(void)
00060 {
00061    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00062 }
00063
00064
00065
00066
00067 /////////////////////////////////////////////////////////////////////////////
00068 // Returns a class factory to create an object of the requested type
00069 /////////////////////////////////////////////////////////////////////////////
00070 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00071 {
00072    return _Module.GetClassObject(rclsid, riid, ppv);
00073 }
00074
00075
00076
00077 /////////////////////////////////////////////////////////////////////////////
00078 // DllRegisterServer - Adds entries to the system registry
00079 /////////////////////////////////////////////////////////////////////////////
00080 STDAPI DllRegisterServer(void)
00081 {
00082    // registers object, typelib and all interfaces in typelib
00083    return _Module.RegisterServer(TRUE);
00084 }
00085
00086
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // DllUnregisterServer - Removes entries from the system registry
00090 ////////////////////////////////////////////////////////////////////////////
00091 STDAPI DllUnregisterServer(void)
00092 {
00093    return _Module.UnregisterServer(FALSE);
00094 }
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/Resource.h Source File

  • SysMgmt
  • MMC
  • Help

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDB_SMOPEN                      111
00012 #define IDB_SMBMP                       112
00013 #define IDB_LGBMP                       113
00014 #define IDR_SMICONS                     120
00015 #define IDR_LGICONS                     121
00016 #define IDB_ROCKET                      40004
00017 #define IDB_CAR                         40005
00018 #define IDB_PLANE                       40006
00019 #define IDB_BIKE                        40007
00020 #define IDB_ROCKET2                     40008
00021 #define IDB_CAR2                        40009
00022 #define IDB_PLANE2                      40010
00023 #define IDB_BIKE2                       40011
00024 #define IDB_CLOSED2                     40012
00025 #define IDB_OPEN2                       40013
00026 #define IDB_CLOSED                      40014
00027 #define IDB_OPEN                        40015
00028
00029 // Next default values for new objects
00030 //
00031 #ifdef APSTUDIO_INVOKED
00032 #ifndef APSTUDIO_READONLY_SYMBOLS
00033 #define _APS_NEXT_RESOURCE_VALUE        114
00034 #define _APS_NEXT_COMMAND_VALUE         40016
00035 #define _APS_NEXT_CONTROL_VALUE         1000
00036 #define _APS_NEXT_SYMED_VALUE           101
00037 #endif
00038 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/globals.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

globals.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015
00016 // Global variables
00017
00018 HINSTANCE g_hInst = NULL;      // Our global instance handle
00019 ULONG g_uObjectCount = 0;      // Global object count
00020 ULONG g_uServerLocks = 0;      // Global lock count
00021
00022
00023 //---------------------------------------------------------------------------
00024 //  This is the fast, simple way to convert unicode to ansi.  It does NOT
00025 //  handle multibyte ansi strings and is not localized.  But it should be
00026 //  fine for registry entries
00027 //  NOTE:  The caller is responsible for freeing the memory.
00028 //
00029 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide )
00030 {
00031   LONG nLen = wcslen( szWide ) +1;
00032   *pszAnsi = (char*)CoTaskMemAlloc( nLen );
00033   char* pCounter = *pszAnsi;
00034
00035   while( *szWide )
00036   {
00037     *pCounter = LOBYTE(*szWide);
00038     pCounter++;
00039     szWide++;
00040   }
00041   *pCounter = NULL;
00042 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/InOut/InOutc.c Source File

  • NetDS
  • RPC
  • Data
  • InOut

InOutc.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                       InOut Example
00005
00006     FILE:       inoutc.c
00007
00008     USAGE:      inoutc   -n network_address
00009                          -p protocol_sequence
00010                          -e endpoint
00011                          -o options
00012                          -1 short_value_1
00013                          -2 short_value_2
00014                          -3 float_value_3
00015
00016     PURPOSE:    Client side of RPC distributed application inout
00017
00018     FUNCTIONS:  main() - binds to server and calls remote procedure
00019
00020     COMMENTS:   This distributed application demonstrates in, out
00021                 parameters.
00022
00023 ****************************************************************************/
00024
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <ctype.h>
00028 #include "inout.h"    // header file generated by MIDL compiler
00029
00030 #define PURPOSE \
00031 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00032 use of the [in], [out], and [in, out] attributes. For more\n\
00033 information about attributes and RPC API functions, see the\n\
00034 Microsoft RPC programming guide and reference.\n\n"
00035
00036 #define DESCRIPTION \
00037 "One [in], one [out], and one [in,out] parameter are defined\n\
00038 for the function InOutProc(). This program displays the values\n\
00039 of these parameters before and after the remote procedure call.\n\n"
00040
00041 void Usage(char * pszProgramName)
00042 {
00043     fprintf(stderr, "%s", PURPOSE);
00044     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00045     fprintf(stderr, " -p protocol_sequence\n");
00046     fprintf(stderr, " -n network_address\n");
00047     fprintf(stderr, " -e endpoint\n");
00048     fprintf(stderr, " -o options\n");
00049     fprintf(stderr, " -1 parameter_1\n");
00050     fprintf(stderr, " -2 parameter_2\n");
00051     fprintf(stderr, " -3 parameter_3\n");
00052     exit(1);
00053 }
00054
00055 void __cdecl main(int argc, char **argv)
00056 {
00057     RPC_STATUS status;
00058     unsigned char * pszUuid             = NULL;
00059     unsigned char * pszProtocolSequence = "ncacn_np";
00060     unsigned char * pszNetworkAddress   = NULL;
00061     unsigned char * pszEndpoint         = "\\pipe\\inout";
00062     unsigned char * pszOptions          = NULL;
00063     unsigned char * pszStringBinding    = NULL;
00064     short   s1 = 257;
00065     short   s2 = 631;
00066     float   f3 = (float) 0.406;
00067     int i;
00068
00069     /* allow the user to override settings with command line switches */
00070     for (i = 1; i < argc; i++) {
00071         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00072             switch (tolower(*(argv[i]+1))) {
00073             case 'p':  // protocol sequence
00074                 pszProtocolSequence = argv[++i];
00075                 break;
00076             case 'n':  // network address
00077                 pszNetworkAddress = argv[++i];
00078                 break;
00079             case 'e':
00080                 pszEndpoint = argv[++i];
00081                 break;
00082             case 'o':
00083                 pszOptions = argv[++i];
00084                 break;
00085             case '1':
00086                 s1 = (short) atoi(argv[++i]);
00087                 break;
00088             case '2':
00089                 s2 = (short) atoi(argv[++i]);
00090                 break;
00091             case '3':
00092                 f3 = (float) atof(argv[++i]);
00093                 break;
00094             case 'h':
00095             case '?':
00096             default:
00097                 Usage(argv[0]);
00098             }
00099         }
00100         else
00101             Usage(argv[0]);
00102     }
00103
00104     printf("%s", DESCRIPTION);
00105
00106     /* Use a convenience function to concatenate the elements of  */
00107     /* the string binding into the proper sequence.               */
00108     status = RpcStringBindingCompose(pszUuid,
00109                                      pszProtocolSequence,
00110                                      pszNetworkAddress,
00111                                      pszEndpoint,
00112                                      pszOptions,
00113                                      &pszStringBinding);
00114     printf("RpcStringBindingCompose returned 0x%x\n", status);
00115     printf("pszStringBinding = %s\n", pszStringBinding);
00116     if (status) {
00117         exit(status);
00118     }
00119
00120     /* Set the binding handle that will be used to bind to the server. */
00121     status = RpcBindingFromStringBinding(pszStringBinding,
00122                                          &inout_IfHandle);
00123     printf("RpcBindingFromStringBinding returned 0x%x\n", status);
00124     if (status) {
00125         exit(status);
00126     }
00127
00128     printf("Calling the remote procedure 'InOutProc'\n");
00129     printf("  parameters = %d %d %0.3f\n", s1, s2, f3);
00130
00131     RpcTryExcept {
00132         InOutProc(s1, &s2, &f3);  // call the remote procedure
00133
00134         printf("Returning from the remote procedure 'InOutProc'\n");
00135         printf("  parameters = %d %d %0.3f\n", s1, s2, f3);
00136
00137         Shutdown();
00138     }
00139     RpcExcept(1) {
00140         printf("Runtime reported exception %ld\n", RpcExceptionCode() );
00141     }
00142     RpcEndExcept
00143
00144     /* The call to the remote procedure is complete. */
00145     /* Free the string and binding handle.           */
00146     status = RpcBindingFree(&inout_IfHandle);
00147     printf("RpcBindingFree returned 0x%x\n", status);
00148     if (status) {
00149         exit(status);
00150     }
00151
00152     status = RpcStringFree(&pszStringBinding);
00153     printf("RpcStringFree returned 0x%x\n", status);
00154     if (status) {
00155         exit(status);
00156     }
00157
00158     exit(0);
00159
00160 }  // end main()
00161
00162
00163 /*********************************************************************/
00164 /*                 MIDL allocate and free                            */
00165 /*********************************************************************/
00166
00167 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00168 {
00169     return(malloc(len));
00170 }
00171
00172 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00173 {
00174     free(ptr);
00175 }
00176
00177 /* end file inoutc.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SIGGEN_DATA_DEFINITION Member List

This is the complete list of members for _SIGGEN_DATA_DEFINITION, including all inherited members.
ConstantValueDef | _SIGGEN_DATA_DEFINITION
SigGenObjectType | _SIGGEN_DATA_DEFINITION
SineWaveDef | _SIGGEN_DATA_DEFINITION
SquareWaveDef | _SIGGEN_DATA_DEFINITION
TriangleWaveDef | _SIGGEN_DATA_DEFINITION
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/vcAcct/IAccount.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • vcAcct

IAccount.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc19.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\mssdk\samples\com\Services\Transaction\SampleBank\vcacct\release\vcacct.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package vcacct;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface IAccount
00019 /** @com.interface(iid=04CF0B72-1989-11D0-B917-0080C7394688, thread=AUTO, type=DUAL) */
00020 public interface IAccount extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1610743808, type=METHOD, name="Post", addFlagsVtable=4)
00023       @com.parameters([in,type=I4] lAccount, [in,type=I4] lAmount, [type=STRING] return) */
00024   public String Post(int lAccount, int lAmount);
00025
00026
00027   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x4cf0b72, (short)0x1989, (short)0x11d0, (byte)0xb9, (byte)0x17, (byte)0x0, (byte)0x80, (byte)0xc7, (byte)0x39, (byte)0x46, (byte)0x88);
00028 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Schema/vc/Schema.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Schema
  • vc

Schema.cpp

Go to the documentation of this file.
00001 // Schema.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "stdio.h"
00006 #include "activeds.h"
00007
00008
00009 int main(int argc, char* argv[])
00010 {
00011   IADsContainer *pSchema=NULL;
00012   HRESULT hr;
00013
00014   CoInitialize(NULL);
00015
00016   hr = ADsGetObject(L"WinNT://INDEPENDENCE/Schema", IID_IADsContainer, (void**) &pSchema );
00017
00018   if ( !SUCCEEDED(hr) )
00019   {
00020     return hr;
00021   }
00022
00023
00024   ////////////// Enumerate Schema objects ///////////////////////////////////
00025   IEnumVARIANT *pEnum = NULL;
00026   hr = ADsBuildEnumerator( pSchema, &pEnum );
00027   pSchema->Release(); // no longer needed, since we have the enumerator already
00028
00029   if ( SUCCEEDED(hr) )
00030   {
00031     VARIANT var;
00032     ULONG lFetch;
00033     IADs *pChild=NULL;
00034     VariantInit(&var);
00035
00036     while( SUCCEEDED(ADsEnumerateNext( pEnum, 1, &var, &lFetch )) && lFetch == 1 )
00037     {
00038       hr = V_DISPATCH(&var)->QueryInterface( IID_IADs, (void**) &pChild );
00039       if ( SUCCEEDED(hr) )
00040       {
00041         BSTR bstrName;
00042         BSTR bstrClass;
00043         // Get more information on the child classes
00044         pChild->get_Name(&bstrName);
00045         pChild->get_Class(&bstrClass);
00046
00047         printf("%S\t\t(%S)\n", bstrName, bstrClass );
00048
00049         // Clean-up
00050         SysFreeString(bstrName);
00051         SysFreeString(bstrClass);
00052
00053         pChild->Release();
00054       }
00055       VariantClear(&var);
00056     }
00057   }
00058
00059               //Release the enumerator.
00060               if (pEnum != NULL)
00061               {
00062                   ADsFreeEnumerator(pEnum);
00063               }
00064
00065
00066   CoUninitialize();
00067
00068
00069
00070   return 0;
00071 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CUtilProp Member List

This is the complete list of members for CUtilProp, including all inherited members.
CUtilProp(void) | CUtilProp |
GetProperties(DWORD dwBitMask, ULONG cPropertySets, const DBPROPIDSET rgPropertySets[], ULONG *pcProperties, DBPROPSET **prgProperties) | CUtilProp |
GetPropertiesArgChk(DWORD dwBitMask, const ULONG cPropertySets, const DBPROPIDSET rgPropertySets[], ULONG *pcProperties, DBPROPSET **prgProperties) | CUtilProp | [static]
GetPropertyInfo(BOOL fDSOInitialized, ULONG cPropertySets, const DBPROPIDSET rgPropertySets[], ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets, WCHAR **ppDescBuffer) | CUtilProp |
GetPropIndex(DBPROPID dwPropertyID, ULONG *pulIndex) | CUtilProp | [protected]
IsValidValue(DBPROP *pDBProp) | CUtilProp | [protected]
LoadDBPROP(PROPSTRUCT *pPropStruct, DBPROP *pPropSupport) | CUtilProp | [protected]
LoadDBPROPINFO(PROPSTRUCT *pPropStruct, DBPROPINFO *pPropInfo) | CUtilProp | [protected]
m_rgproperties | CUtilProp | [protected]
m_wszFilePath | CUtilProp | [protected]
SetProperties(DWORD dwBitMask, ULONG cProperties, DBPROPSET rgProperties[]) | CUtilProp |
SetPropertiesArgChk(const ULONG cProperties, const DBPROPSET rgProperties[]) | CUtilProp | [static]
~CUtilProp(void) | CUtilProp |
Generated on Wed Nov 13 2024 16:57:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/rtns.Cpp Source File

  • Web
  • NetMeeting
  • NMUI

rtns.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       RTNS.CPP
00004 //  Content:    General utility routines
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018
00019 //****************************************************************************
00020 //
00021 // VOID SizeStatus(int dxClient, int dy)
00022 //
00023 //****************************************************************************
00024
00025 VOID SizeStatus(int dxClient, int dy)
00026 {
00027   int rgdxp[3];
00028
00029   rgdxp[2] = dxClient;
00030   dxClient -= 50;
00031   rgdxp[1] = dxClient;
00032   dxClient -= 75;
00033   rgdxp[0] = dxClient;
00034   SendMessage(ghwndSbar, SB_SETPARTS, (WPARAM) 3, (LPARAM) rgdxp);
00035 }
00036
00037 //****************************************************************************
00038 //
00039 // VOID SizeMsgWindow(int dx, int dy)
00040 //
00041 //****************************************************************************
00042
00043 VOID SizeMsgWindow(int dx, int dy)
00044 {
00045   RECT  rc    = {0, 0, 0, 0};
00046   int   xLeft = 0;
00047   int   yTop  = 0;
00048   int   d   = 0;
00049   int   dyLView = 0;
00050
00051   xLeft = 0;
00052   yTop = 3;
00053   dy -= 3;
00054
00055   if (gPref.fTbar)
00056   {
00057     // adjust for Toolbar
00058     GetClientRect(ghwndTbar, &rc);
00059     d = (rc.bottom - rc.top);
00060     yTop += d;
00061     dy -= d;
00062   }
00063
00064   if (gPref.fSbar)
00065   {
00066     // adjust for status bar
00067     GetClientRect(ghwndSbar, &rc);
00068     d = (rc.bottom - rc.top);
00069     dy -= d;
00070   }
00071
00072   if (gPref.fChat)
00073   {
00074     // adjust for status bar
00075     GetClientRect(ghwndChat, &rc);
00076     d = (rc.bottom - rc.top);
00077     dy -= d;
00078     MoveWindow(ghwndChat, xLeft, yTop + dy, dx-(DXP_SEND+DXP_ULIST), d, TRUE);
00079     MoveWindow(ghwndSend, xLeft+dx-(DXP_SEND+DXP_ULIST), yTop + dy, DXP_SEND, DYP_SEND, TRUE);
00080     MoveWindow(ghwndUList, xLeft+dx-DXP_ULIST, yTop + dy, DXP_ULIST, DYP_ULIST, TRUE);
00081   }
00082
00083   dyLView = dy;
00084   if (gPref.fMsg)
00085   {
00086     dyLView = dyLView / 2;
00087     MoveWindow(ghwndMsg, xLeft, yTop+dyLView, dx, dyLView, TRUE);
00088   }
00089
00090   MoveWindow(ghwndLView, xLeft, yTop, dx, dyLView, TRUE);
00091 }
00092
00093 //****************************************************************************
00094 //
00095 // VOID RecalcMsgWindow(void)
00096 //
00097 //****************************************************************************
00098
00099 VOID RecalcMsgWindow(void)
00100 {
00101   RECT rc = {0,0,0,0};
00102
00103   GetClientRect(ghwndMain, &rc);
00104   SizeMsgWindow(rc.right, rc.bottom);
00105 }
00106
00107
00108 //****************************************************************************
00109 //
00110 // VOID ShowHwnd(HWND hwnd, BOOL fShow, int idm)
00111 //
00112 //****************************************************************************
00113
00114 VOID ShowHwnd(HWND hwnd, BOOL fShow, int idm)
00115 {
00116   if (IsWindow(hwnd))
00117   {
00118     ShowWindow(hwnd, fShow ? SW_SHOW : SW_HIDE);
00119     SetMenuCheck(idm, fShow);
00120     RecalcMsgWindow();
00121   }
00122 }
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/guids.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 /////////////////////////////////////////////////////////////////////////////
00003 //
00004 //  This source code is only intended as a supplement to existing
00005 //  Microsoft documentation.
00006 //
00007 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00008 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00009 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00010 //  PURPOSE.
00011 //
00012 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00013 //
00014
00015
00016 // {B34986D8-8DCA-4b10-97D5-4BE6DA997878}
00017 DEFINE_GUID( CLSID_CComponentData,
00018        0xb34986d8, 0x8dca, 0x4b10, 0x97, 0xd5, 0x4b, 0xe6, 0xda, 0x99, 0x78, 0x78);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/rcvall/iphdr.h Source File

  • NetDS
  • WinSock
  • rcvall

iphdr.h

Go to the documentation of this file.
00001 #ifndef _IPHDR_H_
00002 #define _IPHDR_H_
00003
00004 #include <pshpack1.h>
00005
00006 //
00007 // IPv4 Header (without any IP options)
00008 //
00009 typedef struct ip_hdr
00010 {
00011     unsigned char  ip_verlen;        // 4-bit IPv4 version
00012                                      // 4-bit header length (in 32-bit words)
00013     unsigned char  ip_tos;           // IP type of service
00014     unsigned short ip_totallength;   // Total length
00015     unsigned short ip_id;            // Unique identifier
00016     unsigned short ip_offset;        // Fragment offset field
00017     unsigned char  ip_ttl;           // Time to live
00018     unsigned char  ip_protocol;      // Protocol(TCP,UDP etc)
00019     unsigned short ip_checksum;      // IP checksum
00020     unsigned int   ip_srcaddr;       // Source address
00021     unsigned int   ip_destaddr;      // Source address
00022 } IPV4_HDR, *PIPV4_HDR, FAR * LPIPV4_HDR;
00023
00024 //
00025 // IPv6 Header
00026 //
00027 typedef struct ipv6_hdr
00028 {
00029     unsigned long   ipv6_vertcflow;        // 4-bit IPv6 version
00030                                            // 8-bit traffic class
00031                                            // 20-bit flow label
00032     unsigned short  ipv6_payloadlen;       // payload length
00033     unsigned char   ipv6_nexthdr;          // next header protocol value
00034     unsigned char   ipv6_hoplimit;         // TTL
00035     struct in6_addr ipv6_srcaddr;          // Source address
00036     struct in6_addr ipv6_destaddr;         // Destination address
00037 } IPV6_HDR, *PIPV6_HDR, FAR * LPIPV6_HDR;
00038
00039 //
00040 // IPv6 Fragmentation Header
00041 //
00042 typedef struct ipv6_fragment_hdr
00043 {
00044     unsigned char   ipv6_frag_nexthdr;      // Next protocol header
00045     unsigned char   ipv6_frag_reserved;     // Reserved: zero
00046     unsigned short  ipv6_frag_offset;       // Offset of fragment
00047     unsigned long   ipv6_frag_id;           // Unique fragment ID
00048 } IPV6_FRAGMENT_HDR, *PIPV6_FRAGMENT_HDR, FAR * LPIPV6_FRAGMENT_HDR;
00049
00050 //
00051 // Define the UDP header
00052 //
00053 typedef struct udp_hdr
00054 {
00055     unsigned short src_portno;       // Source port no.
00056     unsigned short dest_portno;      // Dest. port no.
00057     unsigned short udp_length;       // Udp packet length
00058     unsigned short udp_checksum;     // Udp checksum
00059 } UDP_HDR, *PUDP_HDR;
00060
00061 //
00062 // Define the TCP header
00063 //
00064 typedef struct tpc_hdr
00065 {
00066     unsigned short src_portno;       // Source port no.
00067     unsigned short dest_portno;      // Dest. port no.
00068     unsigned long  seq_num;          // Sequence number
00069     unsigned long  ack_num;          // Acknowledgement number;
00070     unsigned short lenflags;         // Header length and flags
00071     unsigned short window_size;      // Window size
00072     unsigned short tcp_checksum;     // Checksum
00073     unsigned short tcp_urgentptr;    // Urgent data?
00074 } TCP_HDR, *PTCP_HDR;
00075
00076 //
00077 // Stucture to extract port numbers that overlays the UDP and TCP header
00078 //
00079 typedef struct port_hdr
00080 {
00081     unsigned short src_portno;
00082     unsigned short dest_portno;
00083 } PORT_HDR, *PPORT_HDR;
00084
00085 //
00086 // IGMP header
00087 //
00088 typedef struct igmp_hdr
00089 {
00090     unsigned char   version_type;
00091     unsigned char   max_resp_time;
00092     unsigned short  checksum;
00093     unsigned long   group_addr;
00094 } IGMP_HDR, *PIGMP_HDR;
00095
00096 typedef struct igmp_hdr_query_v3
00097 {
00098     unsigned char   type;
00099     unsigned char   max_resp_time;
00100     unsigned short  checksum;
00101     unsigned long   group_addr;
00102     unsigned char   resv_suppr_robust;
00103     unsigned char   qqi;
00104     unsigned short  num_sources;
00105     unsigned long   sources[1];
00106 } IGMP_HDR_QUERY_V3, *PIGMP_HDR_QUERY_V3;
00107
00108 typedef struct igmp_group_record_v3
00109 {
00110     unsigned char   type;
00111     unsigned char   aux_data_len;
00112     unsigned short  num_sources;
00113     unsigned long   group_addr;
00114     unsigned long   source_addr[1];
00115 } IGMP_GROUP_RECORD_V3,  *PIGMP_GROUP_RECORD_V3;
00116
00117 typedef struct igmp_hdr_report_v3
00118 {
00119     unsigned char   type;
00120     unsigned char   reserved1;
00121     unsigned short  checksum;
00122     unsigned short  reserved2;
00123     unsigned short  num_records;
00124 } IGMP_HDR_REPORT_V3, *PIGMP_HDR_REPORT_V3;
00125
00126 #include <poppack.h>
00127
00128 #endif
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HelloWorld Member List

This is the complete list of members for HelloWorld, including all inherited members.
GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid) | HelloWorld |
GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo) | HelloWorld |
GetTypeInfoCount(UINT *pctinfo) | HelloWorld |
HelloWorld() | HelloWorld | [inline]
HelloWorld() | HelloWorld |
InterfaceSupportsErrorInfo(REFIID riid) | HelloWorld |
InterfaceSupportsErrorInfo(REFIID riid) | HelloWorld |
Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams, VARIANT *pvarResult, EXCEPINFO *pexcepinfo, UINT *puArgErr) | HelloWorld |
m_pTypeInfo | HelloWorld | [protected]
Operate(ULONG dwCode, VARIANT varData1, VARIANT varData2, VARIANT varData3) | HelloWorld | [inline]
PrivateGetIDsOfNames(REFIID riid, OLECHAR **rgszNames, unsigned int cNames, LCID lcid, DISPID *rgdispid) | HelloWorld | [inline]
PrivateInvoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams, VARIANT *pvarResult, EXCEPINFO *pexcepinfo, UINT *puArgErr) | HelloWorld | [inline]
Say() | HelloWorld |
Say() | HelloWorld |
~HelloWorld() | HelloWorld |
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/iphdrinc/iphdr.h Source File

  • NetDS
  • WinSock
  • iphdrinc

iphdr.h

Go to the documentation of this file.
00001 //
00002 // IP Header Definitions
00003 //
00004 // Description:
00005 //    This file contains protocol header definitions.
00006 //
00007 // NOTE:
00008 //    From Network Programming for Microsoft Windows, Second Edition
00009 //    by Anthony Jones and James Ohlund.  Copyright 2002.
00010 //    Reproduced by permission of Microsoft Press.  All rights reserved.
00011 //
00012 #include <pshpack1.h>
00013
00014 //
00015 // IPv4 Header (without any IP options)
00016 //
00017 typedef struct ip_hdr
00018 {
00019     unsigned char  ip_verlen;        // 4-bit IPv4 version
00020                                      // 4-bit header length (in 32-bit words)
00021     unsigned char  ip_tos;           // IP type of service
00022     unsigned short ip_totallength;   // Total length
00023     unsigned short ip_id;            // Unique identifier
00024     unsigned short ip_offset;        // Fragment offset field
00025     unsigned char  ip_ttl;           // Time to live
00026     unsigned char  ip_protocol;      // Protocol(TCP,UDP etc)
00027     unsigned short ip_checksum;      // IP checksum
00028     unsigned int   ip_srcaddr;       // Source address
00029     unsigned int   ip_destaddr;      // Source address
00030 } IPV4_HDR, *PIPV4_HDR, FAR * LPIPV4_HDR;
00031
00032 //
00033 // IPv6 Header
00034 //
00035 typedef struct ipv6_hdr
00036 {
00037     unsigned long   ipv6_vertcflow;        // 4-bit IPv6 version
00038                                            // 8-bit traffic class
00039                                            // 20-bit flow label
00040     unsigned short  ipv6_payloadlen;       // payload length
00041     unsigned char   ipv6_nexthdr;          // next header protocol value
00042     unsigned char   ipv6_hoplimit;         // TTL
00043     struct in6_addr ipv6_srcaddr;          // Source address
00044     struct in6_addr ipv6_destaddr;         // Destination address
00045 } IPV6_HDR, *PIPV6_HDR, FAR * LPIPV6_HDR;
00046
00047 //
00048 // IPv6 Fragmentation Header
00049 //
00050 typedef struct ipv6_fragment_hdr
00051 {
00052     unsigned char   ipv6_frag_nexthdr;      // Next protocol header
00053     unsigned char   ipv6_frag_reserved;     // Reserved: zero
00054     unsigned short  ipv6_frag_offset;       // Offset of fragment
00055     unsigned long   ipv6_frag_id;           // Unique fragment ID
00056 } IPV6_FRAGMENT_HDR, *PIPV6_FRAGMENT_HDR, FAR * LPIPV6_FRAGMENT_HDR;
00057
00058 //
00059 // Define the UDP header
00060 //
00061 typedef struct udp_hdr
00062 {
00063     unsigned short src_portno;       // Source port no.
00064     unsigned short dst_portno;       // Dest. port no.
00065     unsigned short udp_length;       // Udp packet length
00066     unsigned short udp_checksum;     // Udp checksum
00067 } UDP_HDR, *PUDP_HDR;
00068
00069 #include <poppack.h>
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/csharp_draw/inputbox.cs Source File

  • NetDS
  • MessageQueuing
  • csharp_draw

inputbox.cs

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 using System;
00013 using System.Drawing;
00014 using System.Collections;
00015 using System.ComponentModel;
00016 using System.Windows.Forms;
00017
00018 namespace CSharp_Draw
00019 {
00020   /// <summary>
00021   /// Summary description for InputBox.
00022   /// </summary>
00023   public class InputBox : System.Windows.Forms.Form
00024   {
00025     private System.Windows.Forms.Button btnOK;
00026     private System.Windows.Forms.Label label1;
00027     private System.Windows.Forms.Button btnCancel;
00028     public System.Windows.Forms.TextBox textBoxName;
00029     public bool bResult;
00030     /// <summary>
00031     /// Required designer variable.
00032     /// </summary>
00033     private System.ComponentModel.Container components;
00034
00035     public InputBox()
00036     {
00037       //
00038       // Required for Windows Form Designer support
00039       //
00040       InitializeComponent();
00041
00042       //
00043       // TODO: Add any constructor code after InitializeComponent call
00044       //
00045       bResult=false;
00046       textBoxName.Text=System.Environment.ExpandEnvironmentVariables("%USERNAME%");
00047     }
00048
00049     /// <summary>
00050     /// Clean up any resources being used.
00051     /// </summary>
00052     public override void Dispose()
00053     {
00054       base.Dispose();
00055       components.Dispose();
00056     }
00057
00058     #region Windows Form Designer generated code
00059     /// <summary>
00060     /// Required method for Designer support - do not modify
00061     /// the contents of this method with the code editor.
00062     /// </summary>
00063     private void InitializeComponent()
00064     {
00065       this.textBoxName = new System.Windows.Forms.TextBox();
00066       this.btnCancel = new System.Windows.Forms.Button();
00067       this.label1 = new System.Windows.Forms.Label();
00068       this.btnOK = new System.Windows.Forms.Button();
00069       this.textBoxName.Location = new System.Drawing.Point(8, 96);
00070       this.textBoxName.Size = new System.Drawing.Size(336, 20);
00071       this.textBoxName.TabIndex = 1;
00072       this.textBoxName.Text = "";
00073       this.btnCancel.Location = new System.Drawing.Point(296, 48);
00074       this.btnCancel.Size = new System.Drawing.Size(48, 24);
00075       this.btnCancel.TabIndex = 3;
00076       this.btnCancel.Text = "Cancel";
00077       this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
00078       this.label1.Location = new System.Drawing.Point(8, 16);
00079       this.label1.Size = new System.Drawing.Size(280, 24);
00080       this.label1.TabIndex = 0;
00081       this.label1.Text = "Enter the name of the local input queue for drawings:";
00082       this.btnOK.Location = new System.Drawing.Point(296, 16);
00083       this.btnOK.Size = new System.Drawing.Size(48, 24);
00084       this.btnOK.TabIndex = 2;
00085       this.btnOK.Text = "OK";
00086       this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
00087       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00088       this.BorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
00089       this.ClientSize = new System.Drawing.Size(357, 131);
00090       this.Controls.AddRange(new System.Windows.Forms.Control[] {this.btnCancel,
00091                                       this.btnOK,
00092                                       this.textBoxName,
00093                                       this.label1});
00094       this.MaximizeBox = false;
00095       this.MinimizeBox = false;
00096       this.Text = "C#_Draw: Input Queue Name";
00097
00098     }
00099     #endregion
00100
00101     private void btnCancel_Click(object sender, System.EventArgs e)
00102     {
00103       this.Close();
00104     }
00105
00106     private void btnOK_Click(object sender, System.EventArgs e)
00107     {
00108       bResult = true;
00109       this.Close();
00110     }
00111   }
00112 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCertEncodeDateArray Member List

This is the complete list of members for CCertEncodeDateArray, including all inherited members.
_Cleanup(VOID) | CCertEncodeDateArray | [private]
_SetErrorInfo(IN HRESULT hrError, IN WCHAR const *pwszDescription) | CCertEncodeDateArray | [private]
CCertEncodeDateArray() | CCertEncodeDateArray | [inline]
Encode(BSTR __RPC_FAR *pstrBinary) | CCertEncodeDateArray |
GetValue(LONG Index, DATE __RPC_FAR *pValue) | CCertEncodeDateArray |
m_aValue | CCertEncodeDateArray | [private]
m_cValue | CCertEncodeDateArray | [private]
m_cValuesSet | CCertEncodeDateArray | [private]
m_fConstructing | CCertEncodeDateArray | [private]
Reset(LONG Count) | CCertEncodeDateArray |
SetValue(LONG Index, DATE Value) | CCertEncodeDateArray |
~CCertEncodeDateArray() | CCertEncodeDateArray |
Generated on Wed Nov 13 2024 16:55:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/ViewDIB/DIBSectn.h Source File

  • Multimedia
  • Gdi
  • ViewDIB

DIBSectn.h

Go to the documentation of this file.
00001 /* **********************************************************************
00002 DIBSectn.H  Header file for sample source to demonstrate the use
00003             of DIBSections
00004
00005   Contains the following functions for Creating/Saving/Drawing:
00006     DSCreateDIBSection()
00007     DSLoadDIBSectionFromBMPFile()
00008     DSDrawDIBSectionOnDC()
00009     DSStoreDIBSectionInBMPFile()
00010
00011   Contains the following helper functions:
00012     DSCreatePaletteForDIBSection()
00013     DSGetBITMAPINFOForDIBSection()
00014     DSColorTableSize()
00015     DSTotalBytesSize()
00016     DSImageBitsSize()
00017     DSGetPointerToDIBSectionImageBits()
00018     DSCreateSpectrumPalette()
00019   DSBitsperPixel()
00020   DSGetDIBSectionFromClipboard()
00021   DSPutDIBSectionOnClipboard()
00022   DSCopyBitmap();
00023
00024   Notes:
00025     * Most of the functions in this module which are passed an HBITMAP
00026       as a parameter assume the HBITMAP is not selected into a device
00027       context at the time of the call. Since the underlying APIs usually
00028       require this, so do these functions.
00029     * Throughout this module, code is in place to handle color tables
00030       in DIBSections (in the BITMAPINFO) even when it is not necessary.
00031       This helps the re-usability of the code, since it is often desirable
00032       to include a "suggested" color table when storing 16bpp or higher
00033       BMP files.
00034
00035 ********************************************************************** */
00036
00037 // Create/Load/Store/Draw functions
00038 HBITMAP WINAPI DSCreateDIBSection( DWORD dwX, DWORD dwY, WORD wBits );
00039 BOOL WINAPI DSLoadDIBSectionFromBMPFile( LPTSTR szFileName, HBITMAP *phBitmap, HPALETTE *phPalette );
00040 BOOL WINAPI DSDrawDIBSectionOnDC( HDC hDC, HBITMAP hBitmap, LPRECT pRect );
00041 BOOL WINAPI DSStoreDIBSectionInBMPFile( LPTSTR szFileName, HBITMAP hBitmap );
00042
00043 // Helper Functions
00044 HPALETTE WINAPI DSCreatePaletteForDIBSection( HBITMAP hBitmap );
00045 LPBITMAPINFO WINAPI DSGetBITMAPINFOForDIBSection( HBITMAP hBitmap );
00046 DWORD WINAPI DSColorTableSize( LPBITMAPINFO pbmi );
00047 DWORD WINAPI DSTotalBytesSize( LPBITMAPINFO pbmi );
00048 DWORD WINAPI DSImageBitsSize( LPBITMAPINFO pbmi );
00049 LPBYTE WINAPI DSGetPointerToDIBSectionImageBits( HBITMAP hBitmap );
00050 HPALETTE WINAPI DSCreateSpectrumPalette( void );
00051 DWORD WINAPI DSBitsPerPixel (HBITMAP );
00052 BOOL WINAPI DSGetOptimalDIBFormat(HDC, BITMAPINFOHEADER*);
00053 BOOL WINAPI DSGetRGBBitsPerPixel(HDC, PINT, PINT, PINT);
00054 HBITMAP WINAPI DSGetDIBSectionFromClipboard( void );
00055 BOOL WINAPI DSPutDIBSectionOnClipboard(HBITMAP);
00056 HBITMAP WINAPI DSCopyBitmap(HBITMAP, HPALETTE);
00057 HBITMAP WINAPI DSCopyBitmapEx(HBITMAP, HPALETTE, WORD);
00058 HGLOBAL WINAPI DSGetDIBFromDIBSection(HBITMAP);
00059
00060 /* **********************************************************************
00061    Sample declares by Fred Nava for use from VB
00062
00063 Type BITMAPINFOHEADER
00064         biSize As Long
00065         biWidth As Long
00066         biHeight As Long
00067         biPlanes As Integer
00068         biBitCount As Integer
00069         biCompression As Long
00070         biSizeImage As Long
00071         biXPelsPerMeter As Long
00072         biYPelsPerMeter As Long
00073         biClrUsed As Long
00074         biClrImportant As Long
00075 End Type
00076
00077 Type RGBQUAD
00078         rgbBlue As Byte
00079         rgbGreen As Byte
00080         rgbRed As Byte
00081         rgbReserved As Byte
00082 End Type
00083
00084 Type RECT
00085         Left As Long
00086         Top As Long
00087         Right As Long
00088         Bottom As Long
00089 End Type
00090
00091 Type BITMAPINFO
00092         bmiHeader As BITMAPINFOHEADER
00093         bmiColors As RGBQUAD
00094 End Type
00095
00096 Declare Function DSCreateDIBSection Lib "dibsectn.dll" ( _
00097     ByVal dwX As Long, _
00098     ByVal dwY As Long, _
00099     ByVal wBits As Integer) _
00100 As Long
00101
00102 Declare Function DSLoadDIBSectionFromBMPFile Lib "dibsectn.dll" ( _
00103     ByVal szFileName As String, _
00104     phBitmap As Long, _
00105     phPalette As Long) _
00106 As Boolean
00107
00108 Declare Function DSDrawDIBSectionOnDC Lib "dibsectn.dll" ( _
00109     ByVal hDC As Long, _
00110     ByVal hBitmap As Long, _
00111     pRect As RECT) _
00112 As Boolean
00113
00114 Declare Function DSStoreDIBSectionInBMPFile Lib "dibsectn.dll" ( _
00115     ByVal szFileName As String, _
00116     ByVal hBitmap As Long) _
00117 As Boolean
00118
00119 Declare Function DSCreatePaletteForDIBSection Lib "dibsectn.dll" ( _
00120     ByVal hBitmap As Long) _
00121 As Long
00122
00123 Declare Function DSGetBITMAPINFOForDIBSection Lib "dibsectn.dll" ( _
00124     ByVal hBitmap As Long) _
00125 As Long
00126
00127 Declare Function DSColorTableSize Lib "dibsectn.dll" ( _
00128     ByVal pbmi As Long) _
00129 As Long
00130
00131 Declare Function DSTotalBytesSize Lib "dibsectn.dll" ( _
00132     ByVal pbmi As Long) _
00133 As Long
00134
00135 Declare Function DSImageBitsSize Lib "dibsectn.dll" ( _
00136     ByVal pbmi As Long) _
00137 As Long
00138
00139 Declare Function DSGetPointerToDIBSectionImageBits Lib "dibsectn.dll" ( _
00140     ByVal hBitmap As Long) _
00141 As Long
00142
00143 Declare Function DSCreateSpectrumPalette Lib "dibsectn.dll" () _
00144 As Long
00145
00146 ********************************************************************** */
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/case.cpp Source File

  • WinUI
  • TSFcase

case.cpp

Go to the documentation of this file.
00001 //
00002 // case.cpp
00003 //
00004 // IUnknown, ITfTextInputProcessor implementation.
00005 //
00006
00007 #include "globals.h"
00008 #include "case.h"
00009
00010 //+---------------------------------------------------------------------------
00011 //
00012 // CreateInstance
00013 //
00014 //----------------------------------------------------------------------------
00015
00016 /* static */
00017 HRESULT CCaseTextService::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObj)
00018 {
00019     CCaseTextService *pCase;
00020     HRESULT hr;
00021
00022     if (ppvObj == NULL)
00023         return E_INVALIDARG;
00024
00025     *ppvObj = NULL;
00026
00027     if (NULL != pUnkOuter)
00028         return CLASS_E_NOAGGREGATION;
00029
00030     if ((pCase = new CCaseTextService) == NULL)
00031         return E_OUTOFMEMORY;
00032
00033     hr = pCase->QueryInterface(riid, ppvObj);
00034
00035     pCase->Release(); // caller still holds ref if hr == S_OK
00036
00037     return hr;
00038 }
00039
00040 //+---------------------------------------------------------------------------
00041 //
00042 // ctor
00043 //
00044 //----------------------------------------------------------------------------
00045
00046 CCaseTextService::CCaseTextService()
00047 {
00048     DllAddRef();
00049
00050     _pThreadMgr = NULL;
00051     _tfClientId = TF_CLIENTID_NULL;
00052
00053     _fShowSnoop = FALSE;
00054     _pSnoopWnd = NULL;
00055
00056     _pLangBarItem = NULL;
00057
00058     _fFlipKeys = FALSE;
00059
00060     _dwThreadMgrEventSinkCookie = TF_INVALID_COOKIE;
00061     _dwThreadFocusSinkCookie = TF_INVALID_COOKIE;
00062     _dwTextEditSinkCookie = TF_INVALID_COOKIE;
00063     _pTextEditSinkContext = NULL;
00064
00065     _cRef = 1;
00066 }
00067
00068 //+---------------------------------------------------------------------------
00069 //
00070 // dtor
00071 //
00072 //----------------------------------------------------------------------------
00073
00074 CCaseTextService::~CCaseTextService()
00075 {
00076     DllRelease();
00077 }
00078
00079 //+---------------------------------------------------------------------------
00080 //
00081 // QueryInterface
00082 //
00083 //----------------------------------------------------------------------------
00084
00085 STDAPI CCaseTextService::QueryInterface(REFIID riid, void **ppvObj)
00086 {
00087     if (ppvObj == NULL)
00088         return E_INVALIDARG;
00089
00090     *ppvObj = NULL;
00091
00092     if (IsEqualIID(riid, IID_IUnknown) ||
00093         IsEqualIID(riid, IID_ITfTextInputProcessor))
00094     {
00095         *ppvObj = (ITfTextInputProcessor *)this;
00096     }
00097     else if (IsEqualIID(riid, IID_ITfThreadMgrEventSink))
00098     {
00099         *ppvObj = (ITfThreadMgrEventSink *)this;
00100     }
00101     else if (IsEqualIID(riid, IID_ITfThreadFocusSink))
00102     {
00103         *ppvObj = (ITfThreadFocusSink *)this;
00104     }
00105     else if (IsEqualIID(riid, IID_ITfTextEditSink))
00106     {
00107         *ppvObj = (ITfTextEditSink *)this;
00108     }
00109     else if (IsEqualIID(riid, IID_ITfKeyEventSink))
00110     {
00111         *ppvObj = (ITfKeyEventSink *)this;
00112     }
00113
00114     if (*ppvObj)
00115     {
00116         AddRef();
00117         return S_OK;
00118     }
00119
00120     return E_NOINTERFACE;
00121 }
00122
00123
00124 //+---------------------------------------------------------------------------
00125 //
00126 // AddRef
00127 //
00128 //----------------------------------------------------------------------------
00129
00130 STDAPI_(ULONG) CCaseTextService::AddRef()
00131 {
00132     return ++_cRef;
00133 }
00134
00135 //+---------------------------------------------------------------------------
00136 //
00137 // Release
00138 //
00139 //----------------------------------------------------------------------------
00140
00141 STDAPI_(ULONG) CCaseTextService::Release()
00142 {
00143     LONG cr = --_cRef;
00144
00145     assert(_cRef >= 0);
00146
00147     if (_cRef == 0)
00148     {
00149         delete this;
00150     }
00151
00152     return cr;
00153 }
00154
00155 //+---------------------------------------------------------------------------
00156 //
00157 // Activate
00158 //
00159 //----------------------------------------------------------------------------
00160
00161 STDAPI CCaseTextService::Activate(ITfThreadMgr *pThreadMgr, TfClientId tfClientId)
00162 {
00163     ITfDocumentMgr *pFocusDoc;
00164
00165     _pThreadMgr = pThreadMgr;
00166     _pThreadMgr->AddRef();
00167
00168     _tfClientId = tfClientId;
00169
00170     if (!_InitLanguageBar())
00171         goto ExitError;
00172
00173     if (!_InitThreadMgrSink())
00174         goto ExitError;
00175
00176     if (!_InitSnoopWnd())
00177         goto ExitError;
00178
00179     if (!_InitKeystrokeSink())
00180         goto ExitError;
00181
00182     if (!_InitPreservedKey())
00183         goto ExitError;
00184
00185     // start tracking the focus doc
00186     if (_pThreadMgr->GetFocus(&pFocusDoc) == S_OK)
00187     {
00188         // The system will call OnSetFocus only for focus events after Activate
00189         // is called.
00190         OnSetFocus(pFocusDoc, NULL);
00191         pFocusDoc->Release();
00192     }
00193
00194     return S_OK;
00195
00196 ExitError:
00197     Deactivate(); // cleanup any half-finished init
00198     return E_FAIL;
00199 }
00200
00201 //+---------------------------------------------------------------------------
00202 //
00203 // Deactivate
00204 //
00205 //----------------------------------------------------------------------------
00206
00207 STDAPI CCaseTextService::Deactivate()
00208 {
00209     _UninitSnoopWnd();
00210     _UninitThreadMgrSink();
00211     _UninitLanguageBar();
00212     _UninitKeystrokeSink();
00213     _UninitPreservedKey();
00214
00215     // we MUST release all refs to _pThreadMgr in Deactivate
00216     SafeReleaseClear(_pThreadMgr);
00217
00218     _tfClientId = TF_CLIENTID_NULL;
00219
00220     return S_OK;
00221 }
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/stdafx.cpp Source File

  • Dataaccess
  • rds
  • handler
  • vc

stdafx.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File:        StdAfx.cpp
00004 //
00005 // Copyright:   Copyright (c) 1991-1999 Microsoft Corporation
00006 //
00007 // Contents:    source file that includes just the standard includes
00008 //
00009 // Comments:    stdafx.pch will be the pre-compiled header
00010 //              stdafx.obj will contain the pre-compiled type information
00011 //
00012 //-----------------------------------------------------------------------------
00013
00014 #include "stdafx.h"
00015
00016 #ifdef _ATL_STATIC_REGISTRY
00017 #include <statreg.h>
00018 #include <statreg.cpp>
00019 #endif
00020
00021 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/space.h Source File

  • SysMgmt
  • MMC
  • WMI

space.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SPACE_H
00021 #define _SPACE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CRocket : public CDelegationBase {
00026 public:
00027     CRocket(_TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload);
00028     virtual ~CRocket();
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00033
00034 public:
00035     // virtual functions go here (for MMCN_*)
00036     virtual HRESULT OnRename(LPOLESTR pszNewName);
00037     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect);
00038
00039     virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle);
00040     virtual HRESULT HasPropertySheets();
00041     virtual HRESULT GetWatermarks(HBITMAP *lphWatermark,
00042         HBITMAP *lphHeader,
00043         HPALETTE *lphPalette,
00044         BOOL *bStretch);
00045
00046     virtual HRESULT OnPropertyChange(IConsole *pConsole);
00047
00048 private:
00049     // {29743810-4C4B-11d2-89D8-000021473128}
00050     static const GUID thisGuid;
00051
00052     _TCHAR *szName;
00053     LONG   lWeight;
00054     LONG   lHeight;
00055     LONG   lPayload;
00056     int    nId;
00057     enum ROCKET_STATUS {RUNNING, PAUSED, STOPPED} iStatus;
00058
00059     LONG_PTR m_ppHandle;
00060
00061     static BOOL CALLBACK DialogProc(
00062         HWND hwndDlg,  // handle to dialog box
00063         UINT uMsg,     // message
00064         WPARAM wParam, // first message parameter
00065         LPARAM lParam  // second message parameter
00066         );
00067
00068 };
00069
00070 class CSpaceVehicle : public CDelegationBase {
00071 public:
00072     CSpaceVehicle();
00073
00074     virtual ~CSpaceVehicle();
00075
00076     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Future Vehicles"); }
00077     virtual const GUID & getNodeType() { return thisGuid; }
00078     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00079
00080 public:
00081     // virtual functions go here (for MMCN_*)
00082     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00083
00084 private:
00085     enum { IDM_NEW_SPACE = 4 };
00086
00087     // {29743810-4C4B-11d2-89D8-000021473128}
00088     static const GUID thisGuid;
00089
00090 private:
00091     enum { NUMBER_OF_CHILDREN = 4 };
00092     CRocket *children[NUMBER_OF_CHILDREN];
00093 };
00094
00095 #endif // _SPACE_H
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreServe/Server.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • FreServe

Server.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.CPP
00003
00004   Summary:   Implementation file for the CServer server-related utility
00005              C++ object.  This object encapsulates the server's internal
00006              control of global server object and lock counts.
00007
00008              For a comprehensive tutorial code tour of this module's
00009              contents and offerings see the tutorial FRESERVE.HTM
00010              file. For more specific technical details on the internal
00011              workings see the comments dispersed throughout the module's
00012              source code.
00013
00014   Classes:   CServer.
00015
00016   Functions:
00017
00018   Origin:    4-5-96: atrent - Editor-inheritance from SERVER.CPP in
00019                the DLLSERVE Tutorial Code Sample.
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 /*---------------------------------------------------------------------------
00037   We include WINDOWS.H for all Win32 applications.
00038   We include OLE2.H because we will be calling the COM/OLE Libraries.
00039   We include APPUTIL.H because we will be building this DLL using
00040     the convenient Virtual Window and Dialog classes and other
00041     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00042   We include SERVER.H for the object class declarations for the
00043     C++ CServer server control object.
00044 ---------------------------------------------------------------------------*/
00045 #include <windows.h>
00046 #include <ole2.h>
00047 #include <apputil.h>
00048 #include "server.h"
00049
00050
00051 /*---------------------------------------------------------------------------
00052   Implementation the internal CServer C++ object.  Used to encapsulate
00053   some server data and the methods for Lock and Object count incrementing
00054   and decrementing.
00055 ---------------------------------------------------------------------------*/
00056
00057 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00058   Method:   CServer::CServer
00059
00060   Summary:  CServer Constructor.
00061
00062   Args:     void
00063
00064   Returns:  void
00065 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00066 CServer::CServer(void)
00067 {
00068   // Zero the Object and Lock counts for this attached process.
00069   m_cObjects = 0;
00070   m_cLocks = 0;
00071
00072   return;
00073 }
00074
00075
00076 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00077   Method:   CServer::~CServer
00078
00079   Summary:  CServer Destructor.
00080
00081   Args:     void
00082
00083   Returns:  void
00084 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00085 CServer::~CServer(void)
00086 {
00087   return;
00088 }
00089
00090
00091 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00092   Method:   CServer::Lock
00093
00094   Summary:  Increment the Server's Lock count.
00095
00096   Args:     void
00097
00098   Returns:  void
00099 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00100 void CServer::Lock(void)
00101 {
00102   LONG cLocks;
00103
00104   if (OwnThis())
00105   {
00106     cLocks = ++m_cLocks;
00107
00108     UnOwnThis();
00109   }
00110
00111   return;
00112 }
00113
00114
00115 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00116   Method:   CServer::Unlock
00117
00118   Summary:  Decrement the Server's Lock count.
00119
00120   Args:     void
00121
00122   Returns:  void
00123 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00124 void CServer::Unlock(void)
00125 {
00126   LONG cLocks;
00127
00128   if (OwnThis())
00129   {
00130     cLocks = --m_cLocks;
00131
00132     UnOwnThis();
00133   }
00134
00135   return;
00136 }
00137
00138
00139 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00140   Method:   CServer::ObjectsUp
00141
00142   Summary:  Increment the Server's living Object count.
00143
00144   Args:     void
00145
00146   Returns:  void
00147 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00148 void CServer::ObjectsUp(void)
00149 {
00150   LONG cObjects;
00151
00152   if (OwnThis())
00153   {
00154     cObjects = ++m_cObjects;
00155
00156     UnOwnThis();
00157   }
00158
00159   return;
00160 }
00161
00162
00163 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00164   Method:   CServer::ObjectsDown
00165
00166   Summary:  Decrement the Server's living object count.
00167
00168   Args:     void
00169
00170   Returns:  void
00171 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00172 void CServer::ObjectsDown(void)
00173 {
00174   LONG cObjects;
00175
00176   if (OwnThis())
00177   {
00178     cObjects = --m_cObjects;
00179
00180     UnOwnThis();
00181   }
00182
00183   return;
00184 }
00185
00186
00187 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00188   Method:   CServer::CanUnloadNow
00189
00190   Summary:  Check if we can unload the server (ie, if there are no longer
00191             any living COM objects and no locks.
00192
00193   Args:     void
00194
00195   Returns:  HRESULT
00196               S_OK if this server can be unloaded.
00197               S_FALSE if this server can not be unloaded.
00198 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00199 HRESULT CServer::CanUnloadNow(void)
00200 {
00201   HRESULT hr = S_FALSE;
00202   LONG cObjects, cLocks;
00203
00204   if (OwnThis())
00205   {
00206     cObjects = m_cObjects;
00207     cLocks = m_cLocks;
00208
00209     hr = (0L==cObjects && 0L==cLocks) ? S_OK : S_FALSE;
00210
00211     UnOwnThis();
00212   }
00213
00214   return hr;
00215 }
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/AsyncIO/AsyncIO.h Source File

  • WinBase
  • IO
  • AsyncIO

AsyncIO.h

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1992 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     AsyncIO.h
00012
00013 Abstract:
00014
00015     This is the main source file for the AsyncIO API demonstration
00016     program.  This include file defines macros, data structures and procedure
00017     prototypes for the code contained in the AsyncIO.C source file.
00018
00019 --*/
00020
00021 //
00022 // Include file for using the Win32 API
00023 //
00024
00025 #include <windows.h>
00026
00027 //
00028 // C Runtime include files used by the program.
00029 //
00030
00031 #include <stdio.h>
00032 #include <stdlib.h>
00033 #include <errno.h>
00034 #include <ctype.h>
00035 #include <string.h>
00036 #include <io.h>
00037 #include <fcntl.h>
00038 #include <malloc.h>
00039 #include <sys\types.h>
00040 #include <sys\stat.h>
00041
00042
00043 //
00044 // Macro definitions
00045 //
00046
00047 //
00048 // Useful rounding macros that the rounding amount is always a
00049 // power of two.
00050 //
00051
00052 #define ROUND_DOWN( Size, Amount ) ((SIZE_T)(Size) & ~((SIZE_T)(Amount) - 1))
00053 #define ROUND_UP( Size, Amount ) (((SIZE_T)(Size) + ((SIZE_T)(Amount) - 1)) & ~((SIZE_T)(Amount) - 1))
00054
00055 //
00056 // Pseudo keywords for documentation purposes.
00057 //
00058
00059 #define IN
00060 #define OUT
00061 #define OPTIONAL
00062
00063 //
00064 // Determine if an argument is present by testing a value of NULL
00065 //
00066
00067 #define ARGUMENT_PRESENT( ArgumentPointer )    (\
00068     (LPSTR)(ArgumentPointer) != (LPSTR)(NULL) )
00069
00070 //
00071 // Define NOTHING
00072 //
00073
00074 #define NOTHING
00075
00076 //
00077 // Virtual Buffer data structure and function prototypes.
00078 //
00079
00080 typedef struct _VIRTUAL_BUFFER {
00081     LPVOID Base;
00082     ULONG PageSize;
00083     LPVOID CommitLimit;
00084     LPVOID ReserveLimit;
00085 } VIRTUAL_BUFFER, *PVIRTUAL_BUFFER;
00086
00087 BOOL
00088 CreateVirtualBuffer(
00089     OUT PVIRTUAL_BUFFER Buffer,
00090     IN SIZE_T CommitSize,
00091     IN SIZE_T ReserveSize OPTIONAL
00092     );
00093
00094 BOOL
00095 ExtendVirtualBuffer(
00096     IN PVIRTUAL_BUFFER Buffer,
00097     IN LPVOID Address
00098     );
00099
00100 BOOL
00101 TrimVirtualBuffer(
00102     IN PVIRTUAL_BUFFER Buffer
00103     );
00104
00105 BOOL
00106 FreeVirtualBuffer(
00107     IN PVIRTUAL_BUFFER Buffer
00108     );
00109
00110 int
00111 VirtualBufferExceptionFilter(
00112     IN DWORD ExceptionCode,
00113     IN PEXCEPTION_POINTERS ExceptionInfo,
00114     IN OUT PVIRTUAL_BUFFER Buffer
00115     );
00116
00117
00118 //
00119 // Directory enumeration and file notification definitions.
00120 //
00121
00122 typedef
00123 VOID (*PDIRECTORY_ENUMERATE_ROUTINE)(
00124     LPSTR Path,
00125     PWIN32_FIND_DATA FindFileData,
00126     PVOID EnumerateParameter
00127     );
00128
00129 BOOL
00130 EnumerateDirectoryTree(
00131     LPSTR DirectoryPath,
00132     PDIRECTORY_ENUMERATE_ROUTINE EnumerateRoutine,
00133     PVOID EnumerateParameter
00134     );
00135
00136 //
00137 // Data structures private to the EnumerateDirectoryTree function.
00138 //
00139
00140 typedef struct _ENUMERATE_DIRECTORY_STACK {
00141     LPSTR PathEnd;
00142     HANDLE FindHandle;
00143 } ENUMERATE_DIRECTORY_STACK, *PENUMERATE_DIRECTORY_STACK;
00144
00145 #define MAX_DEPTH 256
00146
00147 typedef struct _ENUMERATE_DIRECTORY_STATE {
00148     DWORD Depth;
00149     ENUMERATE_DIRECTORY_STACK Stack[ MAX_DEPTH ];
00150     CHAR Path[ MAX_PATH ];
00151 } ENUMERATE_DIRECTORY_STATE, *PENUMERATE_DIRECTORY_STATE;
00152
00153
00154
00155 //
00156 //  Doubly-linked list manipulation routines.  Implemented as macros
00157 //  but logically these are procedures.
00158 //
00159
00160 //
00161 //  VOID
00162 //  InitializeListHead(
00163 //      PLIST_ENTRY ListHead
00164 //      );
00165 //
00166
00167 #define InitializeListHead(ListHead) (\
00168     (ListHead)->Flink = (ListHead)->Blink = (ListHead) )
00169
00170 //
00171 //  BOOLEAN
00172 //  IsListEmpty(
00173 //      PLIST_ENTRY ListHead
00174 //      );
00175 //
00176
00177 #define IsListEmpty(ListHead) (\
00178     ( ((ListHead)->Flink == (ListHead)) ? TRUE : FALSE ) )
00179
00180 //
00181 //  PLIST_ENTRY
00182 //  RemoveHeadList(
00183 //      PLIST_ENTRY ListHead
00184 //      );
00185 //
00186
00187 #define RemoveHeadList(ListHead) \
00188     (ListHead)->Flink;\
00189     {\
00190         PLIST_ENTRY FirstEntry;\
00191         FirstEntry = (ListHead)->Flink;\
00192         FirstEntry->Flink->Blink = (ListHead);\
00193         (ListHead)->Flink = FirstEntry->Flink;\
00194     }
00195
00196 //
00197 //  VOID
00198 //  RemoveEntryList(
00199 //      PLIST_ENTRY Entry
00200 //      );
00201 //
00202
00203 #define RemoveEntryList(Entry) {\
00204         PLIST_ENTRY _EX_Entry;\
00205         _EX_Entry = (Entry);\
00206         _EX_Entry->Blink->Flink = _EX_Entry->Flink;\
00207         _EX_Entry->Flink->Blink = _EX_Entry->Blink;\
00208         }
00209
00210 //
00211 //  VOID
00212 //  InsertTailList(
00213 //      PLIST_ENTRY ListHead,
00214 //      PLIST_ENTRY Entry
00215 //      );
00216 //
00217
00218 #define InsertTailList(ListHead,Entry) \
00219     (Entry)->Flink = (ListHead);\
00220     (Entry)->Blink = (ListHead)->Blink;\
00221     (ListHead)->Blink->Flink = (Entry);\
00222     (ListHead)->Blink = (Entry)
00223
00224 //
00225 //  VOID
00226 //  InsertHeadList(
00227 //      PLIST_ENTRY ListHead,
00228 //      PLIST_ENTRY Entry
00229 //      );
00230 //
00231
00232 #define InsertHeadList(ListHead,Entry) \
00233     (Entry)->Flink = (ListHead)->Flink;\
00234     (Entry)->Blink = (ListHead);\
00235     (ListHead)->Flink->Blink = (Entry);\
00236     (ListHead)->Flink = (Entry)
00237
00238
00239 //
00240 // Worker thread definitions
00241 //
00242
00243 typedef
00244 VOID
00245 (*PWORKER_ROUTINE)(
00246   //  IN PWORK_QUEUE_ITEM WorkItem
00247     );
00248
00249 typedef struct _WORK_QUEUE {
00250     CRITICAL_SECTION CriticalSection;
00251     HANDLE Semaphore;
00252     LIST_ENTRY Queue;
00253     BOOL Terminating;
00254     PWORKER_ROUTINE WorkerRoutine;
00255     DWORD NumberOfWorkerThreads;
00256     HANDLE WorkerThreads[ 1 ];      // Variable length array
00257 } WORK_QUEUE, *PWORK_QUEUE;
00258
00259 typedef struct _WORK_QUEUE_ITEM {
00260     LIST_ENTRY List;
00261     DWORD Reason;
00262     PWORK_QUEUE WorkQueue;
00263 } WORK_QUEUE_ITEM, *PWORK_QUEUE_ITEM;
00264
00265 #define MAXIMUM_WORKER_THREADS 128  // Maximum number of threads.
00266 #define WORK_INITIALIZE_ITEM 0
00267 #define WORK_ITEM            1
00268 #define WORK_TERMINATE_ITEM  2
00269
00270 VOID
00271 WorkerThread(
00272     LPVOID lpThreadParameter
00273     );
00274
00275 PWORK_QUEUE
00276 CreateWorkQueue(
00277     IN DWORD NumberOfWorkerThreads,
00278     IN PWORKER_ROUTINE WorkerRoutine
00279     );
00280
00281 BOOL
00282 QueueWorkItem(
00283     IN OUT PWORK_QUEUE WorkQueue,
00284     IN PWORK_QUEUE_ITEM WorkItem
00285     );
00286
00287 VOID
00288 DestroyWorkQueue(
00289     IN OUT PWORK_QUEUE WorkQueue
00290     );
00291
00292
00293 //
00294 // Main procedure prototypes
00295 //
00296
00297 BOOL
00298 ProcessCommandLineArguments(
00299     int argc,
00300     char *argv[]
00301     );
00302
00303 VOID
00304 QueueSearchFile(
00305     LPSTR Path,
00306     PWIN32_FIND_DATA FindFileData,
00307     PVOID EnumerateParameter
00308     );
00309
00310 typedef struct _SEARCH_REQUEST_STATE {
00311     VIRTUAL_BUFFER Buffer;
00312     LPSTR CurrentOutput;
00313 } SEARCH_REQUEST_STATE, *PSEARCH_REQUEST_STATE;
00314
00315
00316 typedef struct _SEARCH_REQUEST {
00317     WORK_QUEUE_ITEM WorkItem;
00318     DWORD FileSize;
00319     LPSTR FileData;
00320     HANDLE File;
00321     OVERLAPPED OverlappedIO;
00322     CHAR FullPathName[ 1 ];         // Variable length array
00323 } SEARCH_REQUEST, *PSEARCH_REQUEST;
00324
00325
00326 VOID
00327 ProcessRequest(
00328     IN PWORK_QUEUE_ITEM WorkItem
00329     );
00330
00331 VOID
00332 ProcessReadFileCompletion(
00333     DWORD dwErrorCode,
00334     DWORD dwNumberOfBytesTransfered,
00335     LPOVERLAPPED lpOverlapped
00336     );
00337
00338 VOID
00339 ProcessSearchFile(
00340     IN PSEARCH_REQUEST WorkerRequest,
00341     IN PSEARCH_REQUEST_STATE State
00342     );
00343
00344
00345 //
00346 // Global variables
00347 //
00348
00349 DWORD TlsIndex;
00350 INT NumberOfWorkerThreads;
00351 BOOL Verbose;
00352 BOOL IgnoreCase;
00353 BOOL MappedFileIO;
00354 BOOL ASyncIO;
00355 BOOL SyncIO;
00356 LPSTR DirectoryPath;
00357 LPSTR SearchString;
00358 DWORD SearchStringLength;
00359 DWORD SearchedFileCount;
00360 DWORD MatchedFileCount;
00361 DWORD MatchedLineCount;
00362 LONG  OutstandingIOOperations;
00363 HANDLE IoCompletedEvent;
00364
00365 typedef
00366 int
00367 (__cdecl *PCOMPARE_ROUTINE)(
00368     IN const char *,
00369     IN const char *,
00370     IN size_t
00371     );
00372
00373 PCOMPARE_ROUTINE SearchFunction;
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/MultiReco/EventSinks.h Source File

  • TabletPC
  • MultiReco

EventSinks.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 // Module:
00012 //      EventSinks.h
00013 //
00014 // Description:
00015 //      This file contains the definitions of the event sink templates,
00016 //      instantiated in the CAdvRecoApp class.
00017 //
00018 //      The event source interfaces used are:
00019 //      _IInkEvents, _IInkRecognitionEvent, _IInkCollectorEvents
00020 //
00021 //--------------------------------------------------------------------------
00022
00023 #pragma once
00024
00025 // The DISPID's of the events
00026 #ifndef DISPID_CEStroke
00027     #define DISPID_CEStroke                     0x00000001
00028 #endif
00029 #ifndef DISPID_RERecognition
00030     #define DISPID_RERecognition                0x00000002
00031 #endif
00032
00033 // IDispEventSimpleImpl requires a constant as a sink id; define it here
00034 #define SINK_ID  1
00035
00036 /////////////////////////////////////////////////////////
00037 //
00038 // IInkRecognitionEventsImpl
00039 //
00040 // The template is derived from the ATL's IDispEventSimpleImpl
00041 // to implement a sink for the IInkRecognitionEvents, fired by
00042 // the InkRecoContext object
00043 //
00044 /////////////////////////////////////////////////////////
00045
00046 template <class T>
00047 class ATL_NO_VTABLE IInkRecognitionEventsImpl :
00048   public IDispEventSimpleImpl<SINK_ID, IInkRecognitionEventsImpl<T>,
00049                                 &DIID__IInkRecognitionEvents>
00050 {
00051 public:
00052     // ATL structure with the type information for the event,
00053     // handled in this template. (Initialized in the AdvReco.cpp)
00054     static const _ATL_FUNC_INFO mc_AtlFuncInfo;
00055
00056 BEGIN_SINK_MAP(IInkRecognitionEventsImpl)
00057     SINK_ENTRY_INFO(SINK_ID,
00058                     DIID__IInkRecognitionEvents,
00059                     DISPID_RERecognition,
00060                     Recognition,
00061                     const_cast<_ATL_FUNC_INFO*>(&mc_AtlFuncInfo))
00062 END_SINK_MAP()
00063
00064     HRESULT __stdcall Recognition(BSTR bstrRecognizedString,
00065                                     VARIANT vCustomParam,
00066                                     InkRecognitionStatus RecognitionStatus)
00067     {
00068     T* pT = static_cast<T*>(this);
00069         return pT->OnRecognition(bstrRecognizedString, vCustomParam, RecognitionStatus);
00070     }
00071 };
00072
00073
00074 /////////////////////////////////////////////////////////
00075 //
00076 // IInkCollectorEventsImpl
00077 //
00078 // The template is derived from the ATL's IDispEventSimpleImpl
00079 // to implement a sink for the IInkCollectorEvents, fired by
00080 // the InkCollector object
00081 // Since the IDispEventSimpleImpl doesn't require to supply
00082 // implementation code for every event, this template has a handler
00083 // for the Gesture event only.
00084 //
00085 /////////////////////////////////////////////////////////
00086
00087 template <class T>
00088 class ATL_NO_VTABLE IInkCollectorEventsImpl :
00089   public IDispEventSimpleImpl<SINK_ID,
00090                                 IInkCollectorEventsImpl<T>,
00091                                 &DIID__IInkCollectorEvents>
00092 {
00093 public:
00094     // ATL structure with the type information of Stroke events,
00095     // handled in this template.(Initialized in the AdvReco.cpp)
00096     static const _ATL_FUNC_INFO mc_AtlFuncInfo;
00097
00098 BEGIN_SINK_MAP(IInkCollectorEventsImpl)
00099     SINK_ENTRY_INFO(SINK_ID,
00100                     DIID__IInkCollectorEvents,
00101                     DISPID_CEStroke,
00102                     Stroke,
00103                     const_cast<_ATL_FUNC_INFO*>(&mc_AtlFuncInfo))
00104 END_SINK_MAP()
00105
00106     HRESULT __stdcall Stroke(IInkCursor* pIInkCursor, IInkStrokeDisp* pInkStroke,
00107                              VARIANT_BOOL* pbCancel)
00108     {
00109     T* pT = static_cast<T*>(this);
00110         return pT->OnStroke(pIInkCursor, pInkStroke, pbCancel);
00111     }
00112 };
00113
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/ComDlg32/ComDlg32.C Source File

  • WinUI
  • CommDlg
  • ComDlg32

ComDlg32.C

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  PROGRAM:  Comdlg32.c
00009 //
00010 //  PURPOSE:  Demonstrates how to manipulate the file open common dialog.
00011 //
00012 //  PLATFORMS:  Windows 95
00013 //
00014 //  FUNCTIONS:
00015 //    WinMain() - calls initialization function, processes message loop
00016 //    InitApplication() - Initializes window data nd registers window
00017 //    InitInstance() -saves instance handle and creates main window
00018 //    MainWindProc() Processes messages
00019 //    About() - Process menssages for "About" dialog box
00020 //        OpenTheFile() - Processes the File Open common dialog box
00021 //        ComDlg32DlgProc() - Hook procedure for GetOpenFileName() common dialog
00022 //    TestNotify() - Processes the WM_NOTIFY function for ComDlg32DlgProc
00023 //    ProcessCDError() - uses CommonDialogExtendedError() to output useful error
00024 //          messages
00025 //
00026 //  SPECIAL INSTRUCTIONS: N/A
00027 //
00028
00029 #include <windows.h>    // includes basic windows functionality
00030 #include <commdlg.h>    // includes common dialog functionality
00031 #include <dlgs.h>       // includes common dialog template defines
00032 #include <cderr.h>      // includes the common dialog error codes
00033 #include "COMDLG32.h"   // includes application-specific information
00034
00035 const char szmsgSHAREVIOLATION[] = SHAREVISTRING;  // string for sharing violation
00036 const char szmsgFILEOK[]         = FILEOKSTRING;   // string for OK button
00037 const char szCommdlgHelp[]       = HELPMSGSTRING;  // string for Help button
00038
00039 #define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
00040
00041 UINT cdmsgShareViolation = 0;  // identifier from RegisterWindowMessage
00042 UINT cdmsgFileOK         = 0;  // identifier from RegisterWindowMessage
00043 UINT cdmsgHelp           = 0;  // identifier from RegisterWindowMessage
00044
00045 typedef struct _MYDATA
00046 {
00047   char szTest1[80];   // a test buffer containing the file selected
00048   char szTest2[80];       // a test buffer containing the file path
00049 } MYDATA, FAR * LPMYDATA;
00050
00051 HINSTANCE g_hInst;    // the current instance
00052 MYDATA sMyData;     // an instance of a MYDATA
00053
00054 //
00055 //  FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
00056 //
00057 //  PURPOSE: Entry point for the application.
00058 //
00059 //  COMMENTS:
00060 //
00061 //  This function initializes the application and processes the
00062 //  message loop.
00063 //
00064 int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
00065     LPSTR lpCmdLine, int nCmdShow )
00066 {
00067     MSG msg;
00068
00069     if (!InitApplication(hInstance))
00070             return (FALSE);
00071
00072     // Create the main window.
00073     if (!InitInstance(hInstance, nCmdShow))
00074         return (FALSE);
00075
00076     // Acquire and dispatch messages until a WM_QUIT message is received.
00077     while (GetMessage(&msg,NULL,0,0))
00078         {
00079             TranslateMessage(&msg);    // Translates virtual key codes.
00080             DispatchMessage(&msg);     // Dispatches message to window.
00081         }
00082     return (int)(msg.wParam);           // Returns the value from PostQuitMessage.
00083
00084 }
00085
00086 //
00087 //  FUNCTION: InitApplication(HANDLE)
00088 //
00089 //  PURPOSE: Initializes window data and registers window class
00090 //
00091 //  COMMENTS:
00092 //
00093 //       In this function, we initialize a window class by filling out a data
00094 //       structure of type WNDCLASS and calling the Windows RegisterClass()
00095 //       function.
00096 //
00097 BOOL InitApplication(HANDLE hInstance)
00098 {
00099     WNDCLASS  wc;
00100
00101     // Register the window class for my window.                                                           */
00102     wc.style = 0;                       // Class style.
00103     wc.lpfnWndProc = (WNDPROC)MainWndProc; // Window procedure for this class.
00104     wc.cbClsExtra = 0;                  // No per-class extra data.
00105     wc.cbWndExtra = 0;                  // No per-window extra data.
00106     wc.hInstance = hInstance;           // Application that owns the class.
00107     wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
00108     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00109     wc.hbrBackground = GetStockObject(WHITE_BRUSH);
00110     wc.lpszMenuName =  "Comdlg32Menu";   // Name of menu resource in .RC file.
00111     wc.lpszClassName = "Comdlg32WClass"; // Name used in call to CreateWindow.
00112
00113     return (RegisterClass(&wc));
00114 }
00115
00116 //
00117 //   FUNCTION: InitInstance(HANDLE, int)
00118 //
00119 //   PURPOSE: Saves instance handle and creates main window
00120 //
00121 //   COMMENTS:
00122 //
00123 //        In this function, we save the instance handle in a global variable and
00124 //        create and display the main program window.
00125 //
00126 BOOL InitInstance( HANDLE hInstance, int nCmdShow)
00127 {
00128     HWND            hWnd;
00129
00130   // Save off the handle to the current instance.
00131     g_hInst = hInstance;
00132
00133     // Create a main window for this application instance.
00134     hWnd = CreateWindow(
00135         "Comdlg32WClass",
00136         "Common Dialog Sample Application",
00137         WS_OVERLAPPEDWINDOW,            // Window style.
00138         CW_USEDEFAULT,                  // Default horizontal position.
00139         CW_USEDEFAULT,                  // Default vertical position.
00140         CW_USEDEFAULT,                  // Default width.
00141         CW_USEDEFAULT,                  // Default height.
00142         NULL,                           // Overlapped windows have no parent.
00143         NULL,                           // Use the window class menu.
00144         g_hInst,                        // This instance owns this window.
00145         NULL                            // Pointer not needed.
00146     );
00147
00148     // If window could not be created, return "failure".
00149     if (!hWnd)
00150         return (FALSE);
00151
00152     // Register the window messages to receive.
00153     cdmsgShareViolation = RegisterWindowMessage(szmsgSHAREVIOLATION);
00154     cdmsgFileOK         = RegisterWindowMessage(szmsgFILEOK);
00155     cdmsgHelp           = RegisterWindowMessage(szCommdlgHelp);
00156
00157     // Make the window visible; update its client area; and return "success".
00158     ShowWindow(hWnd, nCmdShow);
00159     UpdateWindow(hWnd);
00160     return (TRUE);
00161
00162 }
00163
00164 //
00165 //  FUNCTION: MainWndProc(HWND, unsigned, WPARAM, LPARAM)
00166 //
00167 //  PURPOSE:  Processes messages for the main window.
00168 //
00169 //  MESSAGES:
00170 //
00171 //  WM_CREATE - initialize window and create the MLE
00172 //  WM_COMMAND - process the application menu
00173 //  WM_SIZE - size the MLE in the main window
00174 //  WM_DESTROY - post a quit message and return
00175 //
00176 //
00177
00178 LRESULT CALLBACK MainWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00179 {
00180     static HWND hwndEdit;
00181     CHAR lpszHello[] = "Choose File Open from the Options menu for a demo.";
00182
00183     switch (message) {
00184
00185         case WM_CREATE:
00186       // Create an MLE for the file contents.
00187       hwndEdit = CreateWindow(
00188                 "EDIT",
00189         NULL,
00190                 WS_CHILD | WS_VISIBLE | WS_VSCROLL |
00191                     ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL,
00192                 0, 0, 0, 0,
00193                 hWnd,
00194                 (HMENU) ID_EDITCHILD,
00195                 (HINSTANCE) GetWindowLongPtr(hWnd, GWLP_HINSTANCE),
00196                 NULL);
00197
00198             // Update the MLE.
00199             SendMessage(hwndEdit, WM_SETTEXT, 0, (LPARAM) lpszHello);
00200             return 0;
00201
00202         case WM_SIZE:
00203             // Make the edit control the size of the window's client area.
00204             MoveWindow(hwndEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
00205             return 0;
00206
00207         case WM_COMMAND:           // message: command from application menu
00208             switch( LOWORD( wParam ))
00209             {
00210                 case IDM_FILEOPEN:
00211           // Call the FileOpen common dialog to open the file.
00212                     OpenTheFile( hWnd, hwndEdit );
00213                     break;
00214
00215                 case IDM_EXIT:
00216                     PostQuitMessage(0);
00217                     break;
00218
00219                 case IDM_ABOUT:
00220                     DialogBox(g_hInst,
00221                         MAKEINTRESOURCE(IDD_ABOUT),
00222                         hWnd,
00223                         (DLGPROC)About);
00224                     break;
00225
00226                 default:
00227                     return (DefWindowProc(hWnd, message, wParam, lParam));
00228
00229             }
00230             break;
00231
00232         case WM_DESTROY:                  // message: window being destroyed
00233             PostQuitMessage(0);
00234             break;
00235
00236
00237         default:
00238             return (DefWindowProc(hWnd, message, wParam, lParam));
00239     }
00240     return (0);
00241 }
00242
00243
00244 //
00245 //   FUNCTION: OpenTheFile(HWND hwnd, HWND hwndEdit)
00246 //
00247 //   PURPOSE: Invokes common dialog function to open a file and opens it.
00248 //
00249 //   COMMENTS:
00250 //
00251 //  This function initializes the OPENFILENAME structure and calls
00252 //            the GetOpenFileName() common dialog function.
00253 //
00254 //    RETURN VALUES:
00255 //        TRUE - The file was opened successfully and read into the buffer.
00256 //        FALSE - No files were opened.
00257 //
00258 //
00259 BOOL OpenTheFile( HWND hWnd, HWND hWndEdit )
00260 {
00261     HANDLE hFile;
00262     DWORD dwBytesRead;
00263   DWORD dwFileSize;
00264   OPENFILENAME OpenFileName;
00265   TCHAR         szFile[MAX_PATH]      = "\0";
00266   char *lpBufPtr;
00267
00268     strncpy( szFile, "", ARRAYSIZE(szFile));
00269
00270
00271   // Fill in the OPENFILENAME structure to support a template and hook.
00272   OpenFileName.lStructSize       = sizeof(OPENFILENAME);
00273     OpenFileName.hwndOwner         = hWnd;
00274     OpenFileName.hInstance         = g_hInst;
00275     OpenFileName.lpstrFilter       = NULL;
00276     OpenFileName.lpstrCustomFilter = NULL;
00277     OpenFileName.nMaxCustFilter    = 0;
00278     OpenFileName.nFilterIndex      = 0;
00279     OpenFileName.lpstrFile         = szFile;
00280     OpenFileName.nMaxFile          = sizeof(szFile);
00281     OpenFileName.lpstrFileTitle    = NULL;
00282     OpenFileName.nMaxFileTitle     = 0;
00283     OpenFileName.lpstrInitialDir   = NULL;
00284     OpenFileName.lpstrTitle        = "Open a File";
00285     OpenFileName.nFileOffset       = 0;
00286     OpenFileName.nFileExtension    = 0;
00287     OpenFileName.lpstrDefExt       = NULL;
00288     OpenFileName.lCustData         = (LPARAM)&sMyData;
00289   OpenFileName.lpfnHook        = ComDlg32DlgProc;
00290   OpenFileName.lpTemplateName    = MAKEINTRESOURCE(IDD_COMDLG32);
00291     OpenFileName.Flags             = OFN_SHOWHELP | OFN_EXPLORER | OFN_ENABLEHOOK | OFN_ENABLETEMPLATE;
00292
00293   // Call the common dialog function.
00294     if (GetOpenFileName(&OpenFileName))
00295     {
00296     // Open the file.
00297     if ((hFile = CreateFile((LPCTSTR)OpenFileName.lpstrFile,
00298       GENERIC_READ,
00299       FILE_SHARE_READ,
00300       NULL,
00301       OPEN_EXISTING,
00302       FILE_ATTRIBUTE_NORMAL,
00303       (HANDLE)NULL)) == (HANDLE)-1)
00304     {
00305         MessageBox( hWnd, "File open failed.", NULL, MB_OK );
00306         return FALSE;
00307     }
00308
00309     // Get the size of the file.
00310     dwFileSize = GetFileSize(hFile, NULL);
00311     if (dwFileSize == 0xFFFFFFFF)
00312     {
00313         MessageBox( NULL, "GetFileSize failed!", NULL, MB_OK);
00314         return FALSE;
00315     }
00316
00317     // Allocate a buffer for the file to be read into.
00318     lpBufPtr = (char *)GlobalAlloc( GMEM_FIXED, dwFileSize );
00319     if (lpBufPtr == NULL)
00320     {
00321         MessageBox( NULL, "GlobalAlloc failed!", NULL, MB_OK);
00322         CloseHandle( hFile );
00323         return FALSE;
00324     }
00325
00326     // Read it's contents into a buffer.
00327     ReadFile(hFile,(LPVOID)lpBufPtr, dwFileSize, &dwBytesRead, NULL);
00328
00329     if (dwBytesRead == 0)
00330     {
00331         MessageBox( hWnd, "Zero bytes read.", NULL, MB_OK );
00332           return FALSE;
00333     }
00334
00335         // Update the MLE with the file contents.
00336         SendMessage(hWndEdit, WM_SETTEXT, 0, (LPARAM) lpBufPtr);
00337
00338     // Close the file.
00339     CloseHandle(hFile);
00340
00341     return TRUE;
00342     }
00343     else
00344     {
00345     ProcessCDError(CommDlgExtendedError(), hWnd );
00346     return FALSE;
00347     }
00348
00349 }
00350
00351 //
00352 //   FUNCTION: TestNotify( HWND hDlg, LPOFNOTIFY pofn)
00353 //
00354 //  PURPOSE:  Processes the WM_NOTIFY message notifications that is sent
00355 //    to the hook dialog procedure for the File Open common dialog.
00356 //
00357 //
00358 BOOL NEAR PASCAL TestNotify(HWND hDlg, LPOFNOTIFY pofn)
00359 {
00360   switch (pofn->hdr.code)
00361   {
00362     // The selection has changed.
00363     case CDN_SELCHANGE:
00364     {
00365       char szFile[MAX_PATH];
00366
00367       // Get the file specification from the common dialog.
00368       if (CommDlg_OpenSave_GetSpec(GetParent(hDlg),
00369         szFile, sizeof(szFile)) <= sizeof(szFile))
00370       {
00371         // Set the dialog item to reflect this.
00372         SetDlgItemText(hDlg, IDE_SELECTED, szFile);
00373       }
00374
00375       // Get the path of the selected file.
00376       if (CommDlg_OpenSave_GetFilePath(GetParent(hDlg),
00377         szFile, sizeof(szFile)) <= sizeof(szFile))
00378       {
00379         // Display this path in the appropriate box.
00380         SetDlgItemText(hDlg, IDE_PATH, szFile);
00381       }
00382     }
00383     break;
00384
00385     // A new folder has been opened.
00386     case CDN_FOLDERCHANGE:
00387     {
00388       char szFile[MAX_PATH];
00389
00390       if (CommDlg_OpenSave_GetFolderPath(GetParent(hDlg),
00391         szFile, sizeof(szFile)) <= sizeof(szFile))
00392       {
00393         // Display this new path in the appropriate box.
00394         SetDlgItemText(hDlg, IDE_SELECTED, szFile);
00395       }
00396     }
00397     break;
00398
00399     // The "Help" pushbutton has been pressed.
00400     case CDN_HELP:
00401       MessageBox(hDlg, "Got the Help button notify.", "ComDlg32 Test", MB_OK);
00402       break;
00403
00404     // The 'OK' pushbutton has been pressed.
00405     case CDN_FILEOK:
00406       // Update the appropriate box.
00407       SetDlgItemText(hDlg,IDE_SELECTED, pofn->lpOFN->lpstrFile);
00408       SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1L);
00409       break;
00410
00411     // Received a sharing violation.
00412     case CDN_SHAREVIOLATION:
00413       // Update the appropriate box.
00414       SetDlgItemText(hDlg, IDE_SELECTED, pofn->pszFile);
00415       MessageBox(hDlg, "Got a sharing violation notify.", "ComDlg32 Test", MB_OK);
00416       break;
00417   }
00418
00419   return(TRUE);
00420 }
00421
00422 //
00423 //   FUNCTION: ComDlg32DlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00424 //
00425 //  PURPOSE:  Processes messages for the File Open common dialog box.
00426 //
00427 //    MESSAGES:
00428 //
00429 //  WM_INITDIALOG - save pointer to the OPENFILENAME structure in User data
00430 //  WM_DESTROY - get the text entered and fill in the MyData structure
00431 //  WM_NOTIFY - pass this message onto the TestNotify function
00432 //  default - check for a sharing violation or the OK button and
00433 //      display a message box.
00434 //
00435 //
00436 LRESULT CALLBACK ComDlg32DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00437 {
00438
00439   switch (uMsg)
00440   {
00441     case WM_INITDIALOG:
00442       // Save off the long pointer to the OPENFILENAME structure.
00443       SetWindowLongPtr(hDlg, DWLP_USER, lParam);
00444       break;
00445
00446     case WM_DESTROY:
00447       {
00448       LPOPENFILENAME lpOFN = (LPOPENFILENAME)GetWindowLongPtr(hDlg, DWLP_USER);
00449       LPMYDATA psMyData = (LPMYDATA)lpOFN->lCustData;
00450
00451       GetDlgItemText(hDlg, IDE_PATH, psMyData->szTest1, sizeof(psMyData->szTest1));
00452       GetDlgItemText(hDlg, IDE_SELECTED, psMyData->szTest2, sizeof(psMyData->szTest2));
00453       }
00454       break;
00455
00456     case WM_NOTIFY:
00457       TestNotify(hDlg, (LPOFNOTIFY)lParam);
00458
00459     default:
00460       if (uMsg == cdmsgFileOK)
00461       {
00462         SetDlgItemText(hDlg, IDE_SELECTED, ((LPOPENFILENAME)lParam)->lpstrFile);
00463         if (MessageBox(hDlg, "Got the OK button message.\n\nShould I open it?", "ComDlg32 Test", MB_YESNO)
00464           == IDNO)
00465         {
00466           SetWindowLongPtr(hDlg, DWLP_MSGRESULT, 1L);
00467         }
00468         break;
00469       }
00470       else if (uMsg == cdmsgShareViolation)
00471       {
00472         SetDlgItemText(hDlg, IDE_SELECTED, (LPSTR)lParam);
00473         MessageBox(hDlg, "Got a sharing violation message.", "ComDlg32 Test", MB_OK);
00474         break;
00475       }
00476       return FALSE;
00477   }
00478   return TRUE;
00479 }
00480
00481 //
00482 //  FUNCTION: About(HWND, unsigned, WORD, LONG)
00483 //
00484 //  PURPOSE:  Processes messages for "About" dialog box
00485 //
00486 //  MESSAGES:
00487 //
00488 //  WM_INITDIALOG - initialize dialog box
00489 //  WM_COMMAND    - Input received
00490 //
00491 //
00492 LRESULT CALLBACK About( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
00493 {
00494     switch (message)
00495     {
00496         case WM_INITDIALOG:
00497             return (TRUE);
00498
00499         case WM_COMMAND:
00500             if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
00501             {
00502                 EndDialog(hDlg, TRUE);
00503                 return TRUE;
00504             }
00505             break;
00506     }
00507     return FALSE;
00508
00509 }
00510
00511 //
00512 //  FUNCTION: ProcessCDError(DWORD)
00513 //
00514 //  PURPOSE: Processes errors from the common dialog functions.
00515 //
00516 //  COMMENTS:
00517 //
00518 //        This function is called whenever a common dialog function
00519 //        fails.  The CommonDialogExtendedError() value is passed to
00520 //        the function which maps the error value to a string table.
00521 //        The string is loaded and displayed for the user.
00522 //
00523 //
00524 void ProcessCDError(DWORD dwErrorCode, HWND hWnd)
00525 {
00526    WORD  wStringID;
00527    TCHAR  buf[MAX_PATH];
00528
00529    switch(dwErrorCode)
00530       {
00531    case CDERR_DIALOGFAILURE:   wStringID=IDS_DIALOGFAILURE;   break;
00532    case CDERR_STRUCTSIZE:      wStringID=IDS_STRUCTSIZE;      break;
00533    case CDERR_INITIALIZATION:  wStringID=IDS_INITIALIZATION;  break;
00534    case CDERR_NOTEMPLATE:      wStringID=IDS_NOTEMPLATE;      break;
00535    case CDERR_NOHINSTANCE:     wStringID=IDS_NOHINSTANCE;     break;
00536    case CDERR_LOADSTRFAILURE:  wStringID=IDS_LOADSTRFAILURE;  break;
00537    case CDERR_FINDRESFAILURE:  wStringID=IDS_FINDRESFAILURE;  break;
00538    case CDERR_LOADRESFAILURE:  wStringID=IDS_LOADRESFAILURE;  break;
00539    case CDERR_LOCKRESFAILURE:  wStringID=IDS_LOCKRESFAILURE;  break;
00540    case CDERR_MEMALLOCFAILURE: wStringID=IDS_MEMALLOCFAILURE; break;
00541    case CDERR_MEMLOCKFAILURE:  wStringID=IDS_MEMLOCKFAILURE;  break;
00542    case CDERR_NOHOOK:          wStringID=IDS_NOHOOK;          break;
00543    case PDERR_SETUPFAILURE:    wStringID=IDS_SETUPFAILURE;    break;
00544    case PDERR_PARSEFAILURE:    wStringID=IDS_PARSEFAILURE;    break;
00545    case PDERR_RETDEFFAILURE:   wStringID=IDS_RETDEFFAILURE;   break;
00546    case PDERR_LOADDRVFAILURE:  wStringID=IDS_LOADDRVFAILURE;  break;
00547    case PDERR_GETDEVMODEFAIL:  wStringID=IDS_GETDEVMODEFAIL;  break;
00548    case PDERR_INITFAILURE:     wStringID=IDS_INITFAILURE;     break;
00549    case PDERR_NODEVICES:       wStringID=IDS_NODEVICES;       break;
00550    case PDERR_NODEFAULTPRN:    wStringID=IDS_NODEFAULTPRN;    break;
00551    case PDERR_DNDMMISMATCH:    wStringID=IDS_DNDMMISMATCH;    break;
00552    case PDERR_CREATEICFAILURE: wStringID=IDS_CREATEICFAILURE; break;
00553    case PDERR_PRINTERNOTFOUND: wStringID=IDS_PRINTERNOTFOUND; break;
00554    case CFERR_NOFONTS:         wStringID=IDS_NOFONTS;         break;
00555    case FNERR_SUBCLASSFAILURE: wStringID=IDS_SUBCLASSFAILURE; break;
00556    case FNERR_INVALIDFILENAME: wStringID=IDS_INVALIDFILENAME; break;
00557    case FNERR_BUFFERTOOSMALL:  wStringID=IDS_BUFFERTOOSMALL;  break;
00558
00559    case 0:   //User may have hit CANCEL or we got a *very* random error
00560       return;
00561
00562    default:
00563       wStringID=IDS_UNKNOWNERROR;
00564       }
00565
00566    LoadString(NULL, wStringID, buf, sizeof(buf));
00567    MessageBox(hWnd, buf, NULL, MB_OK);
00568    return;
00569 }
00570
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/cpp/isapiCertPolicy/StdAfx.cpp Source File

  • Security
  • capicom
  • cpp
  • isapiCertPolicy

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  isapiCertPolicy.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007
00008
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/ClUuid/ClUuidp.c Source File

  • NetDS
  • RPC
  • ClUuid

ClUuidp.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                          Cluuid Example
00005
00006     FILE:       cluuidp.c
00007
00008     PURPOSE:    Remote procedures that are linked with the server
00009                 side of RPC distributed application
00010
00011     FUNCTIONS:  HelloProc() - prints "hello, world" or other string
00012                 HelloProc2() - prints string backwards
00013
00014     COMMENTS:   This sample program demonstrates how to supply
00015                 multiple implementations of the remote procedure
00016                 specified in the interface. It also demonstrates
00017                 how the client selects among the implementations
00018                 by providing a client object uuid.
00019
00020                 The server calls RpcObjectSetType to associate a
00021                 client object uuid with the object uuid in the
00022                 Object Registry Table. The server initializes a
00023                 manager entry point vector (manager epv) and
00024                 then calls RpcRegisterIf to associate the interface
00025                 uuid and the object uuid with the manager epv in the
00026                 Interface Registry Table.
00027
00028                 When the client makes a remote procedure call,
00029                 the client object uuid is mapped to the object uuid
00030                 in the Object Registry Table. The resulting
00031                 object uuid and the interface uuid are mapped to
00032                 a manager entry point vector in the Interface
00033                 Registry Table.
00034
00035                 By default, in this example, the server registers
00036                 two implementations of the "hello, world" function
00037                 HelloProc and HelloProc2.  The HelloProc2
00038                 implementation is associated with the object uuid
00039                 "11111111-1111-1111-1111-111111111111". When
00040                 the client makes a procedure call with a null
00041                 uuid, the client's request is mapped to the
00042                 original HelloProc.  When the client makes a
00043                 procedure call with the client object uuid
00044                 "11111111-1111-1111-1111-11111111111", the
00045                 client's request is mapped to HelloProc2 (which
00046                 prints the string in reverse).
00047
00048 ****************************************************************************/
00049
00050 #include <stdlib.h>
00051 #include <stdio.h>
00052 #include <string.h>
00053 #include "cluuid.h"    // header file generated by MIDL compiler
00054
00055 void HelloProc(unsigned char * pszString)
00056 {
00057     printf("%s\n", pszString);
00058 }
00059
00060 void HelloProc2(unsigned char * pszString)
00061 {
00062     printf("%s\n", strrev(pszString));
00063 }
00064
00065 void Shutdown(void)
00066 {
00067     RPC_STATUS status;
00068
00069     printf("Calling RpcMgmtStopServerListening\n");
00070     status = RpcMgmtStopServerListening(NULL);
00071     printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
00072     if (status) {
00073         exit(status);
00074     }
00075
00076     printf("Calling RpcServerUnregisterIf\n");
00077     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
00078     printf("RpcServerUnregisterIf returned 0x%x\n", status);
00079     if (status) {
00080         exit(status);
00081     }
00082 }
00083
00084 /* end of file cluuidp.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/DropSrc.h Source File

  • WinUI
  • Shell
  • SampView

DropSrc.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DropSrc.h
00013
00014    Description:   CDropSource class defintions
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include <windows.h>
00023 #include "Utility.h"
00024
00025 /**************************************************************************
00026    class definitions
00027 **************************************************************************/
00028
00029 class CDropSource : public IDropSource
00030 {
00031 private:
00032    DWORD m_ObjRefCount;
00033
00034 public:
00035    // Contstructor and Destructor
00036    CDropSource();
00037    ~CDropSource();
00038
00039    // IUnknown Interface members
00040    STDMETHODIMP QueryInterface(REFIID, LPVOID*);
00041    STDMETHODIMP_(ULONG) AddRef(void);
00042    STDMETHODIMP_(ULONG) Release(void);
00043
00044    // IDropSource Interface members
00045    STDMETHODIMP QueryContinueDrag(BOOL, DWORD);
00046    STDMETHODIMP GiveFeedback(DWORD);
00047
00048 };
00049
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IWMSContextAdmin Member List

This is the complete list of members for IWMSContextAdmin, including all inherited members.
ContextTypes([out, retval] WMS_CONTEXT_PLUGIN_CONTEXT_TYPE *retval) | IWMSContextAdmin
ContextTypes([in] WMS_CONTEXT_PLUGIN_CONTEXT_TYPE value) | IWMSContextAdmin
OutputPath([out, retval] BSTR *retval) | IWMSContextAdmin
OutputPath([in] BSTR value) | IWMSContextAdmin
Generated on Wed Nov 13 2024 16:57:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/MultiReco/ChildWnds.h Source File

  • TabletPC
  • MultiReco

ChildWnds.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 // Module:
00012 //      ChildWnds.h
00013 //
00014 // Description:
00015 //      This file contains the definitions of the classes CInkInputWnd
00016 //      and CRecoOutputWnd, which are derived from the ATL's CWindowImpl
00017 //      and used for creating the sample's child windows.
00018 //    The methods of the classes are defined in the ChildWnds.cpp file.
00019 //--------------------------------------------------------------------------
00020
00021 #pragma once
00022
00023 /////////////////////////////////////////////////////////
00024 //
00025 // class CInkInputWnd
00026 //
00027 // The CInkInputWnd class allows to create a simple window, that
00028 // may draw itself with lined or boxed guides or with no guides at all.
00029 //
00030 // An object of the class is used in the CAdvRecoApp for pen input.
00031 //
00032 /////////////////////////////////////////////////////////
00033
00034 class CInkInputWnd :
00035     public CWindowImpl<CInkInputWnd>
00036 {
00037   // Data members
00038   POINT   m_ptGridLT;     // the left-top corner of the guide grid
00039     SIZE    m_szWritingBox;   // the size of the guide's writing box
00040     RECT    m_rcDrawnBox;   // the guide's draw box rectangle relative to the writing box
00041     int     m_cRows;      // the number of rows in the guide
00042     int     m_cColumns;     // the number of columns in the guide
00043     int     m_iMidline;     // the position of the midline the writing box
00044
00045 public:
00046
00047   // Constructor
00048     CInkInputWnd();
00049
00050     // Data members access methods
00051     void SetGuide(
00052             const _InkRecoGuide& irg
00053             );
00054     void SetRowsCols(
00055             int iRows,
00056             int iColumns
00057             );
00058
00059 // Declare the objects' window class with NULL background (-1) to avoid flicking
00060 // that happens because of delays between WM_ERASEBKGND and WM_PAINT messages
00061 // sent to the window. The background will be painted in the WM_PAINT handler.
00062 DECLARE_WND_CLASS_EX(NULL, 0, -1)
00063
00064 // ATL macro's to declare which commands/messages the class is interested in
00065 BEGIN_MSG_MAP(CInkInputWnd)
00066     MESSAGE_HANDLER(WM_PAINT, OnPaint)
00067 END_MSG_MAP()
00068
00069     // WM_PAINT message handler
00070   LRESULT OnPaint(
00071             UINT uMsg,
00072             WPARAM wParam,
00073             LPARAM lParam,
00074             BOOL& bHandled
00075             );
00076
00077 };  // class CInkInputWnd
00078
00079
00080
00081 /////////////////////////////////////////////////////////
00082 //
00083 // class CRecoOutputWnd
00084 //
00085 // The CRecoOutputWnd class allows to create a window, that draws
00086 // a few lines of text in it.
00087 //
00088 // An object of the class is used in the CAdvRecoApp to output
00089 // results of the recognition.
00090 //
00091 /////////////////////////////////////////////////////////
00092
00093 class CRecoOutputWnd :
00094     public CWindowImpl<CRecoOutputWnd>
00095 {
00096 public:
00097
00098 // Data members
00099
00100   HMODULE   m_hRichEdit;
00101   int     m_iSelStart;
00102
00103 // Constructor and destructor
00104
00105   CRecoOutputWnd();
00106     ~CRecoOutputWnd();
00107
00108
00109   HWND Create(
00110             HWND hwndParent,
00111             UINT nID
00112             );
00113     void AddString(
00114             COLORREF clr,
00115             BSTR bstr
00116             );
00117     void UpdateString(
00118             BSTR bstr
00119             );
00120   void ResetResults();
00121
00122 // ATL macro's to declare which commands/messages the class is interested in.
00123 BEGIN_MSG_MAP(CRecoOutputWnd)
00124 END_MSG_MAP()
00125
00126 };  // class CRecoOutputWnd
00127
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/CacheIsapi/CacheIsapi.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • CacheIsapi

CacheIsapi.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: CachiIsapi.cpp
00006
00007 Abstract:
00008
00009     ISAPI extension to demonstrate sending a response
00010     that's cacheable by the http.sys response cache.
00011
00012 Author:
00013
00014     ISAPI developer (Microsoft employee), October 2002
00015
00016 --*/
00017
00018 #include <IsapiTools.h>
00019
00020 #define MODULE_NAME             "CacheIsapi"
00021 #define DEFAULT_CACHE_SECONDS   60
00022
00023 #define CACHE_PAGE \
00024         "<html>\r\n"                                   \
00025         "<head><title>CacheIsapi</title></head>\r\n"   \
00026         "<h1> CacheIsapi.dll Sample </h1>\r\n"         \
00027         "<hr>\r\n"                                     \
00028         "This page is cacheable.<br><br>\r\n"          \
00029         "<table border=2 cellspacing=2 padding=0>\r\n" \
00030         "  <tr>\r\n"                                   \
00031         "    <td>User mode request count:</td>\r\n"    \
00032         "    <td>%d</td>\r\n"                          \
00033         "  </tr>\r\n"                                  \
00034         "  <tr>\r\n"                                   \
00035         "    <td>Page generation Time:</td>\r\n"       \
00036         "    <td>%s</td>\r\n"                          \
00037         "  </tr>\r\n"                                  \
00038         "  <tr>\r\n"                                   \
00039         "    <td>Cache Duration:</td>\r\n"             \
00040         "    <td>%d seconds</td>\r\n"                  \
00041         "  </tr>\r\n"                                  \
00042         "</table>\r\n"                                 \
00043         "<br>\r\n"                                     \
00044         "To invalidate the cache before it expires, "  \
00045         "add 'invalidate' to the query string "        \
00046         "and re-request this URL.  To change "         \
00047         "the cache duration, add the desired "         \
00048         "number of seconds to the query string "       \
00049         "and re-request this URL.\r\n"                 \
00050         "</html>"
00051
00052 #define INVALIDATE_PAGE \
00053         "<html>\r\n"                                 \
00054         "<head><title>CacheIsapi</title></head>\r\n" \
00055         "<h1>CacheIsapi.dll</h1>\r\n"                \
00056         "<hr>\r\n"                                   \
00057         "%s"                                         \
00058         "</html>"
00059
00060 #define CHANGE_DURATION_PAGE \
00061         "<html>\r\n"                                 \
00062         "<head><title>CacheIsapi</title></head>\r\n" \
00063         "<h1>CacheIsapi.dll</h1>\r\n"                \
00064         "<hr>\r\n"                                   \
00065         "Cache duration set to %d seconds\r\n"       \
00066         "</html>"
00067
00068 #define HELP_PAGE   \
00069         "<html>\r\n"                                            \
00070         "<head><title>CacheIsapi</title></head>\r\n"            \
00071         "<h1>CacheIsapi.dll</h1>\r\n"                           \
00072         "<hr>\r\n"                                              \
00073         "Request CacheIsapi.dll with no query string "          \
00074         "to generate a cacheable response.  Example:<br>\r\n"   \
00075         "<pre>\r\n"                                             \
00076         "\thttp://server/scripts/cacheisapi.dll\r\n"            \
00077         "</pre><br>\r\n"                                        \
00078         "Request CacheIsapi.dll with 'invalidate' on the "      \
00079         "query string to invalidate the current cached "        \
00080         "response.  Example:<br>\r\n"                           \
00081         "<pre>\r\n"                                             \
00082         "\thttp://server/scripts/cacheisapi.dll?invalidate\r\n" \
00083         "</pre><br>\r\n"                                        \
00084         "Request CacheIsapi.dll with a number on the query "    \
00085         "string, to change the cache duration to that number "  \
00086         "of seconds.  Example:<br>\r\n"                         \
00087         "<pre>\r\n"                                             \
00088         "\thttp://server/scripts/cacheisapi.dll?60\r\n"         \
00089         "</pre><br>\r\n"                                        \
00090         "Anything else returns this page."                      \
00091         "</html>\r\n"
00092
00093 //
00094 // Global ISAPI_EXTENSION object
00095 //
00096
00097 ISAPI_EXTENSION g_Extension;
00098
00099 //
00100 // Cache invalidation URL.  Needs to be Unicode
00101 // so that we can pass it to the below cache invalidation
00102 // function.
00103 //
00104
00105 ISAPI_STRINGW    g_strCacheUrl;
00106
00107 //
00108 // Cache invalidation function pointer
00109 //
00110
00111 PFN_HSE_CACHE_INVALIDATION_CALLBACK g_pfnInvalidateCacheUrl = NULL;
00112
00113 //
00114 // Page counter
00115 //
00116
00117 LONG    g_lRequests = 0;
00118
00119 //
00120 // Cache expiration time
00121 //
00122
00123 DWORD   g_dwCacheSeconds = DEFAULT_CACHE_SECONDS;
00124
00125 //
00126 // Local prototypes
00127 //
00128
00129 BOOL
00130 WINAPI
00131 Initialize(
00132     VOID *  pContext
00133     );
00134
00135 BOOL
00136 DoCacheable(
00137     ISAPI_REQUEST * pRequest
00138     );
00139
00140 BOOL
00141 DoInvalidate(
00142     ISAPI_REQUEST * pRequest
00143     );
00144
00145 BOOL
00146 DoChangeDuration(
00147     ISAPI_REQUEST * pRequest
00148     );
00149
00150 BOOL
00151 DoHelp(
00152     ISAPI_REQUEST * pRequest
00153     );
00154
00155 VOID
00156 WINAPI
00157 HandleCompletion(
00158     EXTENSION_CONTROL_BLOCK *   pecb,
00159     VOID *                      pContext,
00160     DWORD                       cbIo,
00161     DWORD                       dwError
00162     );
00163
00164 BOOL
00165 WINAPI
00166 GetExtensionVersion(
00167     HSE_VERSION_INFO *  pVer
00168     )
00169 /*++
00170
00171 Purpose:
00172
00173     Entry point for ISAPI extension initialization.  Required.
00174
00175     This function will be called exactly once in the lifetime
00176     of the extension, at initialization time.  This function is
00177     a useful point to do complex initialization tasks.  This
00178     function is called outside of the system loader lock, so
00179     it does not have the same restrictions as DllMain.
00180
00181 Arguments:
00182
00183     pVer - points to extension version info structure
00184
00185 Returns:
00186
00187     TRUE on success, FALSE on failure.
00188
00189     Note that in the case of FALSE, IIS will call GetLastError()
00190     and return an error page to the client.  The entity body of
00191     the page may be textual if the FormatMessage API can resolve
00192     it, or it may just be an error number if FormatMessage can't
00193     resolve it.
00194
00195 --*/
00196 {
00197     //
00198     // Tell IIS which version of ISAPI this extension was built from.
00199     //
00200
00201     pVer->dwExtensionVersion = MAKELONG( HSE_VERSION_MINOR,
00202                                          HSE_VERSION_MAJOR);
00203
00204     //
00205     // Report the description string for this extension.  Ensure
00206     // that it does not exceed the maximum length and is NULL
00207     // terminated.
00208     //
00209
00210     strncpy( pVer->lpszExtensionDesc,
00211              "CacheIsapi Sample Extension",
00212              HSE_MAX_EXT_DLL_NAME_LEN );
00213
00214     pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN-1] = '\0';
00215
00216     //
00217     // Initialize the IsapiTools and ISAPI_EXTENSION object
00218     //
00219
00220     InitializeIsapiTools( MODULE_NAME );
00221
00222     if ( g_Extension.Initialize( MODULE_NAME ) == FALSE )
00223     {
00224         goto Failed;
00225     }
00226
00227     //
00228     // Return TRUE if we successfully initialized.
00229     //
00230
00231     return TRUE;
00232
00233 Failed:
00234
00235     WriteDebug( "GetExtensionVersion failed.  Error %d.\r\n",
00236                 GetLastError() );
00237
00238     return FALSE;
00239 }
00240
00241 DWORD
00242 WINAPI
00243 HttpExtensionProc(
00244     EXTENSION_CONTROL_BLOCK *   pecb
00245     )
00246 /*++
00247
00248 Purpose:
00249
00250     Entry point for ISAPI requests.  Required.
00251
00252     This function is called once per request.  The EXTENSION_CONTROL_BLOCK
00253     passed in contains information and function pointers sufficient to
00254     interact with the server during this processing.
00255
00256     Note that, once HttpExtensionProc is called, it is the responsibility
00257     of the extension to send back any data that the client should receive.
00258     IIS will not automatically generate any response, even in the case of
00259     HSE_STATUS_ERROR once the request has progressed to the point where
00260     this function is called.
00261
00262     Also note that you should not make any blocking calls or do long-running
00263     operations within this function.  To allow efficient scaling of your
00264     server, you should consider creating a pool of private threads to handle
00265     the requests.  In that case, the implementation of this function would
00266     be just to add the pecb to a queue and return HSE_STATUS_PENDING.  The
00267     threads in the pool would be responsible for dequeing a pecb and calling
00268     HSE_REQ_DONE_WITH_SESSION when they are finished processing it.
00269
00270 Arguments:
00271
00272     pecb - pointer to the extenstion control block
00273
00274 Returns:
00275
00276     HSE_STATUS_SUCCESS - Indicates successful request.
00277     HSE_STATUS_ERROR   - Indicates failed request.
00278     HSE_STATUS_PENDING - Indicates that processing of the request
00279                          should continue after this function returns.
00280                          It HSE_STATUS_PENDING is used, it is necessary
00281                          that HSE_REQ_DONE_WITH_SESSION is called
00282                          exactly once when processing is completed for
00283                          the request.
00284
00285 --*/
00286 {
00287     ISAPI_REQUEST * pRequest;
00288     DWORD           dwHseStatus;
00289     BOOL            fCacheResponse = FALSE;
00290
00291     //
00292     // Initialize on the first hit
00293     //
00294
00295     if ( g_Extension.InitOnce( Initialize, pecb ) == FALSE )
00296     {
00297         goto Failed;
00298     }
00299
00300     //
00301     // Allocate an ISAPI_REQUEST object and set the status
00302     // and headers.
00303     //
00304
00305     pRequest = new ISAPI_REQUEST( pecb );
00306
00307     if ( !pRequest )
00308     {
00309         goto Failed;
00310     }
00311
00312     if ( pRequest->SetBufferedResponseStatus( "200 OK" ) == FALSE )
00313     {
00314         goto Failed;
00315     }
00316
00317     if ( pRequest->AddHeaderToBufferedResponse( "Content-Type",
00318                                                 "text/html" ) == FALSE )
00319     {
00320         goto Failed;
00321     }
00322
00323     //
00324     // Process the request appropriate for the actual query string
00325     //
00326
00327     if ( *pecb->lpszQueryString == '\0' )
00328     {
00329         dwHseStatus = DoCacheable( pRequest );
00330
00331         if ( dwHseStatus != HSE_STATUS_ERROR )
00332         {
00333             fCacheResponse = TRUE;
00334         }
00335     }
00336     else if ( stricmp( pecb->lpszQueryString, "invalidate" ) == 0 )
00337     {
00338         dwHseStatus = DoInvalidate( pRequest );
00339     }
00340     else if ( isdigit( *pecb->lpszQueryString ) )
00341     {
00342         dwHseStatus = DoChangeDuration( pRequest );
00343     }
00344     else
00345     {
00346         dwHseStatus = DoHelp( pRequest );
00347     }
00348
00349     if ( dwHseStatus == HSE_STATUS_ERROR )
00350     {
00351         goto Failed;
00352     }
00353
00354     //
00355     // Send the response asynchronousle.  Return HSE_STATUS_PENDING
00356     // if successful
00357     //
00358
00359     if ( pRequest->AsyncTransmitBufferedResponse( HandleCompletion,
00360                                                   fCacheResponse?
00361                                                   g_dwCacheSeconds :
00362                                                   0 ) == TRUE )
00363     {
00364         return HSE_STATUS_PENDING;
00365     }
00366
00367     //
00368     // Fall through to the error handler
00369     //
00370
00371 Failed:
00372
00373     WriteDebug( "HttpExtensionProc failed. Error %d\r\n",
00374                 GetLastError() );
00375
00376     return SyncSendGenericServerError( pecb );
00377 }
00378
00379 BOOL
00380 WINAPI
00381 Initialize(
00382     VOID *  pContext
00383     )
00384 /*++
00385
00386 Purpose:
00387
00388     Performs initialization of this extension
00389
00390 Arguments:
00391
00392     pContext - The ISAPI_REQUEST associated with this request
00393
00394 Returns:
00395
00396     TRUE on success, FALSE on failure
00397
00398 --*/
00399 {
00400     EXTENSION_CONTROL_BLOCK *   pecb;
00401     BOOL                        fResult = FALSE;
00402     WCHAR *                     pCursor;
00403
00404     pecb = (EXTENSION_CONTROL_BLOCK*)pContext;
00405
00406     ISAPI_ASSERT( pecb );
00407
00408     ISAPI_REQUEST   Request( pecb );
00409
00410
00411     //
00412     // Get the cache invalidation callback function
00413     //
00414
00415     if ( g_pfnInvalidateCacheUrl == NULL )
00416     {
00417         fResult = pecb->ServerSupportFunction( pecb->ConnID,
00418                                                HSE_REQ_GET_CACHE_INVALIDATION_CALLBACK,
00419                                                &g_pfnInvalidateCacheUrl,
00420                                                NULL,
00421                                                NULL );
00422
00423         if ( !fResult )
00424         {
00425             goto Done;
00426         }
00427     }
00428
00429     //
00430     // Initialize the cache invalidation URL.
00431     //
00432     // Note that that URL comes from represents the key
00433     // that http.sys used to identify the request from the,
00434     // and it includes the URL and query string as sent.
00435     // If we call the cache invalidation function, it will
00436     // invalidate exactly this key.
00437     //
00438     // To keep things simple, we are going to make a few
00439     // assumptions.
00440     //
00441     //   1. We will assume that this extensions will
00442     //      mark its response as cacheable only in the
00443     //      case where there is no query string.
00444     //
00445     //   2. We will assume that this extension was not
00446     //      called via HSE_REQ_EXEC_URL.  In this case,
00447     //      it's possible that the URL from the client
00448     //      looks nothing like the URL that would
00449     //      normally call this extension.  We don't need
00450     //      to worry about the case where a filter has
00451     //      rewritten the client's URL, because IIS would
00452     //      not allow such a modified request to be
00453     //      cached.
00454     //
00455     // As a result of these assumptions, we are just going
00456     // to take the first URL to reach this extension, and
00457     // strip any URL off of it.  This is what we'll pass
00458     // in the cache invalidation function to http.sys.
00459     //
00460     // If a real, production extension chose to use the
00461     // cache invalidation function, it would need to keep
00462     // a list of URLs, representing each request, and then
00463     // invalidate the specific ones desired.
00464     //
00465     // Note also, that IIS will examine the "Expires"
00466     // header in the response and automatically invalidate
00467     // the cache entry at the expiration time.  Because of
00468     // this, most extensions won't need to use the
00469     // invalidation function at all.
00470     //
00471
00472     fResult = Request.GetServerVariable( "UNICODE_CACHE_URL",
00473                                          &g_strCacheUrl );
00474
00475     if ( !fResult )
00476     {
00477         goto Done;
00478     }
00479
00480     //
00481     // Strip any query string
00482     //
00483
00484     pCursor = wcschr( g_strCacheUrl.QueryStr(), L'?' );
00485
00486     if ( pCursor )
00487     {
00488         *pCursor = L'\0';
00489
00490         g_strCacheUrl.CalcLen();
00491     }
00492
00493 Done:
00494
00495     if ( !fResult )
00496     {
00497         WriteDebug( "Initialize failed.  Error %d.\r\n",
00498                     GetLastError() );
00499     }
00500
00501     return fResult;
00502 }
00503
00504 BOOL
00505 DoCacheable(
00506     ISAPI_REQUEST * pRequest
00507     )
00508 /*++
00509
00510 Purpose:
00511
00512     Builds the cacheable response page
00513
00514 Arguments:
00515
00516     pRequest - An ISAPI_REQUEST object for this request
00517
00518 Returns:
00519
00520     TRUE on success, FALSE on failure.
00521
00522 --*/
00523 {
00524     FILETIME        ftCurrent;
00525     ISAPI_STRING    strCurrent;
00526
00527     //
00528     // Get the current time
00529     //
00530
00531     if ( GetCurrentTimeAsFileTime( &ftCurrent ) == FALSE )
00532     {
00533         goto Failed;
00534     }
00535
00536     if ( GetFileTimeAsString( &ftCurrent, &strCurrent ) == FALSE )
00537     {
00538         goto Failed;
00539     }
00540
00541     //
00542     // Bump the request count
00543     //
00544
00545     InterlockedIncrement( &g_lRequests );
00546
00547     if ( pRequest->PrintfToResponseBuffer( CACHE_PAGE,
00548                                            g_lRequests,
00549                                            strCurrent.QueryStr(),
00550                                            g_dwCacheSeconds ) == FALSE )
00551     {
00552         goto Failed;
00553     }
00554
00555     return TRUE;
00556
00557 Failed:
00558
00559     WriteDebug( "DoCacheable failed.  Error %d.\r\n",
00560                 GetLastError() );
00561
00562     return FALSE;
00563 }
00564
00565 BOOL
00566 DoInvalidate(
00567     ISAPI_REQUEST * pRequest
00568     )
00569 /*++
00570
00571 Purpose:
00572
00573     Builds the invalidates the cache entry for
00574     this URL and builds the response page
00575
00576 Arguments:
00577
00578     pRequest - An ISAPI_REQUEST object for this request
00579
00580 Returns:
00581
00582     TRUE on success, FALSE on failure.
00583
00584 --*/
00585 {
00586     ISAPI_STRING    strResult;
00587     HRESULT         hr;
00588
00589     //
00590     // Invalidate the cache
00591     //
00592
00593     ISAPI_ASSERT( g_strCacheUrl.QueryStr() );
00594
00595     hr = g_pfnInvalidateCacheUrl( g_strCacheUrl.QueryStr() );
00596
00597     if ( FAILED( hr ) )
00598     {
00599         SetLastError( hr );
00600
00601         if ( strResult.Printf( "Error %d occurred flushing cache.",
00602                                GetLastError() ) == FALSE )
00603         {
00604             goto Failed;
00605         }
00606     }
00607     else
00608     {
00609         if ( strResult.Printf( "Successfully flushed the cache.") == FALSE )
00610         {
00611             goto Failed;
00612         }
00613     }
00614
00615     //
00616     // Build a page with the results
00617     //
00618
00619     if ( pRequest->PrintfToResponseBuffer( INVALIDATE_PAGE,
00620                                            strResult.QueryStr() ) == FALSE )
00621     {
00622         goto Failed;
00623     }
00624
00625     return TRUE;
00626
00627 Failed:
00628
00629     WriteDebug( "DoCacheable failed.  Error %d.\r\n",
00630                 GetLastError() );
00631
00632     return FALSE;
00633 }
00634
00635 BOOL
00636 DoChangeDuration(
00637     ISAPI_REQUEST * pRequest
00638     )
00639 /*++
00640
00641 Purpose:
00642
00643     Changes the cache lifetime for cacheable responses from this
00644     extension.
00645
00646 Arguments:
00647
00648     pRequest - An ISAPI_REQUEST object for this request
00649
00650 Returns:
00651
00652     TRUE on success, FALSE on failure.
00653
00654 --*/
00655 {
00656     DWORD   dwNewDuration;
00657     HRESULT hr;
00658
00659     dwNewDuration = atol( pRequest->QueryEcb()->lpszQueryString );
00660
00661     g_dwCacheSeconds = dwNewDuration;
00662
00663     //
00664     // Flush the cache
00665     //
00666
00667     hr = g_pfnInvalidateCacheUrl( g_strCacheUrl.QueryStr() );
00668
00669     if ( FAILED( hr ) )
00670     {
00671         SetLastError( hr );
00672
00673         goto Failed;
00674     }
00675
00676     //
00677     // Build the response
00678     //
00679
00680     if ( pRequest->PrintfToResponseBuffer( CHANGE_DURATION_PAGE,
00681                                            g_dwCacheSeconds ) == FALSE )
00682     {
00683         goto Failed;
00684     }
00685
00686     return TRUE;
00687
00688 Failed:
00689
00690     WriteDebug( "DoCacheable failed.  Error %d.\r\n",
00691                 GetLastError() );
00692
00693     return FALSE;
00694 }
00695
00696 BOOL
00697 DoHelp(
00698     ISAPI_REQUEST * pRequest
00699     )
00700 /*++
00701
00702 Purpose:
00703
00704     Builds the help page for this extension
00705
00706 Arguments:
00707
00708     pRequest - An ISAPI_REQUEST object for this request
00709
00710 Returns:
00711
00712     TRUE on success, FALSE on failure.
00713
00714 --*/
00715 {
00716     if ( pRequest->AddDataToResponseBuffer( HELP_PAGE,
00717                                             sizeof(HELP_PAGE) - 1 ) == FALSE )
00718     {
00719         goto Failed;
00720     }
00721
00722     return TRUE;
00723
00724 Failed:
00725
00726     WriteDebug( "DoCacheable failed.  Error %d.\r\n",
00727                 GetLastError() );
00728
00729     return FALSE;
00730 }
00731
00732 VOID
00733 WINAPI
00734 HandleCompletion(
00735     EXTENSION_CONTROL_BLOCK *   pecb,
00736     VOID *                      pContext,
00737     DWORD                       cbIo,
00738     DWORD                       dwError
00739     )
00740 /*++
00741
00742 Purpose:
00743
00744     Handles completion of asynchronous I/O by deleting
00745     the ISAPI_REQUEST associated with the request.  The
00746     destructor for this object takes care of calling
00747     HSE_REQ_DONE_WITH_SESSION as appropriate.
00748
00749 Arguments:
00750
00751     pRequest - An ISAPI_REQUEST object for this request
00752
00753 Returns:
00754
00755     TRUE on success, FALSE on failure.
00756
00757 --*/
00758 {
00759     ISAPI_REQUEST * pRequest = (ISAPI_REQUEST*)pContext;
00760
00761     //
00762     // We just need to delete the ISAPI_REQUEST object
00763     // it's destructor will do the rest.
00764     //
00765
00766     if ( pRequest )
00767     {
00768         delete pRequest;
00769         pRequest = NULL;
00770     }
00771 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/MTXSample/Account.h Source File

  • Web
  • iis
  • Components
  • Cpp
  • MTXSample

Account.h

Go to the documentation of this file.
00001 // Account.h : Declaration of the CAccount
00002
00003 #ifndef __ACCOUNT_H_
00004 #define __ACCOUNT_H_
00005
00006 #include "resource.h"       // main symbols
00007
00008 /////////////////////////////////////////////////////////////////////////////
00009 // CAccount
00010 class ATL_NO_VTABLE CAccount :
00011   public CComObjectRootEx<CComSingleThreadModel>,
00012   public CComCoClass<CAccount, &CLSID_Account>,
00013   public ISupportErrorInfo,
00014   public IDispatchImpl<IAccount, &IID_IAccount, &LIBID_BANKVCLib>
00015 {
00016 public:
00017   CAccount()
00018   {
00019   }
00020
00021 DECLARE_REGISTRY_RESOURCEID(IDR_ACCOUNT)
00022
00023 DECLARE_PROTECT_FINAL_CONSTRUCT()
00024
00025 BEGIN_COM_MAP(CAccount)
00026   COM_INTERFACE_ENTRY(IAccount)
00027   COM_INTERFACE_ENTRY(IDispatch)
00028   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00029 END_COM_MAP()
00030
00031 // ISupportsErrorInfo
00032   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00033
00034 // IAccount
00035 public:
00036   STDMETHOD(Post)(/*[in]*/ long lngAccntNum, /*[in]*/ long lngAmount, /*[out, retval]*/ BSTR* pVal);
00037 };
00038
00039 #endif //__ACCOUNT_H_
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ReadTut/ReadTut.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • ReadTut

ReadTut.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      READTUT.CPP
00003
00004   Summary:   Implementation file for the READTUT.EXE code sample
00005              application. READTUT is a very simple Win32 EXE application
00006              that uses the ReadTutorial function from the APPUTIL library
00007              to launch a web browser to view an accompanying HTML tutorial
00008              file.
00009
00010              For a comprehensive tutorial code tour of READTUT's contents
00011              and offerings see the accompanying READTUT.HTM file. For
00012              more specific technical details on the internal workings see
00013              the comments dispersed throughout the READTUT source code.
00014
00015   Classes:   .
00016
00017   Functions: WinMain.
00018
00019   Origin:    12-18-96: atrent - Created for COM Tutorial Samples.
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is only intended as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 /*---------------------------------------------------------------------------
00037   We include WINDOWS.H for all Win32 applications.
00038   We include OLE2.H because we will be calling the COM/OLE Libraries.
00039   We include APPUTIL.H because we will be building this application using
00040     the utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00041   We include READTUT.H because it has resource definitions specific to
00042     this tutorial application.
00043 ---------------------------------------------------------------------------*/
00044 #include <windows.h>
00045 #include <ole2.h>
00046 #include <apputil.h>
00047 #include "readtut.h"
00048
00049
00050 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00051   Function: WinMain
00052
00053   Summary:  The Windows main entry point function for this application.
00054
00055   Args:     HINSTANCE hInstance,
00056               Instance handle; a new one for each invocation of this app.
00057             HINSTANCE hPrevInstance,
00058               Instance handle of the previous instance. NULL in Win32.
00059             LPSTR lpCmdLine,
00060               Windows passes a pointer to the application's
00061               invocation command line.
00062             int nCmdShow)
00063               Bits telling the show state of the application.
00064
00065   Returns:  int
00066               msg.wParam (upon exit of message loop).
00067               FALSE if this instance couldn't initialize and run.
00068 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00069 extern "C" int PASCAL WinMain(
00070                         HINSTANCE hInstance,
00071                         HINSTANCE hPrevInstance,
00072                         LPSTR pszCmdLine,
00073                         int nCmdShow)
00074 {
00075   int   iFail = FALSE;
00076   LPSTR psz;
00077   char  ch;
00078
00079   if (SUCCEEDED(CoInitialize(NULL)))
00080   {
00081     // Show a message box saying that loading of tutorial is underway.
00082     DelayBox(hInstance, MAKEINTRESOURCE(IDD_LOADING_MSG), NULL);
00083
00084     /*--------------------------------------------------------------------
00085       Walk down the command line looking for an HTML target. The first
00086       non-whitespace character after whitespace is assumed to be the
00087       beginning of the HTML target specification. This can be a fully
00088       qualified internet URL or a path/filename. This is all done in ANSI
00089       because pszCmdLine is in ANSI. Any command line switches are
00090       skipped and ignored.
00091     --------------------------------------------------------------------*/
00092     psz = pszCmdLine;
00093
00094     while (ch = *psz)
00095     {
00096       BOOL bStop = FALSE;
00097
00098       switch (ch)
00099       {
00100         case '\t':
00101         case '\n':
00102         case '\r':
00103         case ' ':
00104           // Skip any white space.
00105           psz = SkipAnsi(psz, TRUE);
00106           continue;
00107
00108         case '/':
00109           // Handle '/' switches here. If '//' then assume it's a URL.
00110           ch = *(++psz);
00111           if ('/' == ch)
00112           {
00113             --psz;
00114             bStop = TRUE;
00115             break;
00116           }
00117           else
00118           {
00119             // If any '/' switches found skip to next white space.
00120             psz = SkipAnsi(psz, FALSE);
00121             continue;
00122           }
00123
00124         case '-':
00125           // If any '-' switches found skip to next white space.
00126           psz = SkipAnsi(psz, FALSE);
00127           continue;
00128
00129         default:
00130           bStop = TRUE;
00131           break;
00132       }
00133
00134       if (bStop)
00135         break;
00136
00137       psz++;
00138     }
00139
00140     if (0 == ch)
00141     {
00142       /*------------------------------------------------------------------
00143         If the command line has no HTML target specified then assume a
00144         file with name <thismodulename>.HTM in the same directory as this
00145         executing EXE. In this case, the assumed file is READTUT.HTM. Call
00146         the APPUTIL ReadTutorial utility function to Browse this HTML
00147         file. If READTUT.EXE is renamed to TUTORIAL.EXE then the assumed
00148         file to browse is TUTORIAL.HTM.
00149       ------------------------------------------------------------------*/
00150       ReadTutorial(hInstance, NULL, NULL);
00151     }
00152     else
00153     {
00154       // If the command line has an HTML target specified then use it
00155       // to call the APPUTIL GoWeb utility function to Browse to the
00156       // specified HTML file on the world wide web.
00157       GoWeb(hInstance, psz);
00158     }
00159
00160     // We're exiting this app so shut down the COM Library.
00161     CoUninitialize();
00162   }
00163   else
00164   {
00165     // Show error message box if we can't initialize the COM libraries.
00166     MessageBox(NULL,
00167                TEXT(NOCOM_ERROR_STR),
00168                TEXT(ERROR_TITLE_STR),
00169                MB_OK | MB_ICONEXCLAMATION);
00170     iFail = TRUE;
00171   }
00172
00173   return iFail;
00174 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/basesnap.Cpp Source File

  • SysMgmt
  • MMC
  • Extens

basesnap.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <olectl.h>
00021 #include <initguid.h>
00022 #include "guids.h"
00023 #include "basesnap.h"
00024 #include "Comp.h"
00025 #include "CompData.h"
00026 #include "About.h"
00027 #include "Registry.h"
00028 #include "Extend.h"
00029
00030 // our globals
00031 HINSTANCE g_hinst;
00032
00033 // list all nodes that are extendable here
00034 // List the GUID and then the description
00035 // terminate with a NULL, NULL set.
00036 NODESTRUCT g_Nodes[] = {
00037     { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 },
00038         _T("People-powered Vehicles Node")},
00039     { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 },
00040         _T("Rocket Node")},
00041     { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 },
00042         _T("Sky-based Vehicle Node")},
00043     {NULL, NULL}
00044 };
00045
00046
00047 BOOL WINAPI DllMain(HINSTANCE hinstDLL,
00048                     DWORD fdwReason,
00049                     void* lpvReserved)
00050 {
00051
00052     if (fdwReason == DLL_PROCESS_ATTACH) {
00053         g_hinst = hinstDLL;
00054     }
00055
00056     return TRUE;
00057 }
00058
00059
00060 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
00061 {
00062     if ((rclsid != CLSID_CComponentData) && (rclsid != CLSID_CSnapinAbout))
00063         return CLASS_E_CLASSNOTAVAILABLE;
00064
00065
00066     if (!ppvObj)
00067         return E_FAIL;
00068
00069     *ppvObj = NULL;
00070
00071     // We can only hand out IUnknown and IClassFactory pointers.  Fail
00072     // if they ask for anything else.
00073     if (!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00074         return E_NOINTERFACE;
00075
00076     CClassFactory *pFactory = NULL;
00077
00078     // make the factory passing in the creation function for the type of object they want
00079     if (rclsid == CLSID_CComponentData)
00080         pFactory = new CClassFactory(CClassFactory::COMPONENT);
00081     else if (rclsid == CLSID_CSnapinAbout)
00082         pFactory = new CClassFactory(CClassFactory::ABOUT);
00083
00084     if (NULL == pFactory)
00085         return E_OUTOFMEMORY;
00086
00087     HRESULT hr = pFactory->QueryInterface(riid, ppvObj);
00088
00089     return hr;
00090 }
00091
00092 STDAPI DllCanUnloadNow(void)
00093 {
00094     if (g_uObjects == 0 && g_uSrvLock == 0)
00095         return S_OK;
00096     else
00097         return S_FALSE;
00098 }
00099
00100
00101 CClassFactory::CClassFactory(FACTORY_TYPE factoryType)
00102 : m_cref(0), m_factoryType(factoryType)
00103 {
00104     OBJECT_CREATED
00105 }
00106
00107 CClassFactory::~CClassFactory()
00108 {
00109     OBJECT_DESTROYED
00110 }
00111
00112 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv)
00113 {
00114     if (!ppv)
00115         return E_FAIL;
00116
00117     *ppv = NULL;
00118
00119     if (IsEqualIID(riid, IID_IUnknown))
00120         *ppv = static_cast<IClassFactory *>(this);
00121     else
00122         if (IsEqualIID(riid, IID_IClassFactory))
00123             *ppv = static_cast<IClassFactory *>(this);
00124
00125         if (*ppv)
00126         {
00127             reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00128             return S_OK;
00129         }
00130
00131         return E_NOINTERFACE;
00132 }
00133
00134 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00135 {
00136     return InterlockedIncrement((LONG *)&m_cref);
00137 }
00138
00139 STDMETHODIMP_(ULONG) CClassFactory::Release()
00140 {
00141     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00142     {
00143         delete this;
00144         return 0;
00145     }
00146     return m_cref;
00147 }
00148
00149 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj)
00150 {
00151     HRESULT  hr;
00152     void* pObj;
00153
00154     if (!ppvObj)
00155         return E_FAIL;
00156
00157     *ppvObj = NULL;
00158
00159     // Our object does does not support aggregation, so we need to
00160     // fail if they ask us to do aggregation.
00161     if (pUnkOuter)
00162         return CLASS_E_NOAGGREGATION;
00163
00164     if (COMPONENT == m_factoryType) {
00165         pObj = new CComponentData();
00166     } else {
00167         pObj = new CSnapinAbout();
00168     }
00169
00170     if (!pObj)
00171         return E_OUTOFMEMORY;
00172
00173     // QueryInterface will do the AddRef() for us, so we do not
00174     // do it in this function
00175     hr = ((LPUNKNOWN)pObj)->QueryInterface(riid, ppvObj);
00176
00177     if (FAILED(hr))
00178         delete pObj;
00179
00180     return hr;
00181 }
00182
00183 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00184 {
00185     if (fLock)
00186         InterlockedIncrement((LONG *)&g_uSrvLock);
00187     else
00188         InterlockedDecrement((LONG *)&g_uSrvLock);
00189
00190     return S_OK;
00191 }
00192
00193 //////////////////////////////////////////////////////////
00194 //
00195 // Exported functions
00196 //
00197
00198
00199 //
00200 // Server registration
00201 //
00202 STDAPI DllRegisterServer()
00203 {
00204     HRESULT hr = SELFREG_E_CLASS;
00205     _TCHAR szName[256];
00206     _TCHAR szSnapInName[256];
00207
00208     LoadString(g_hinst, IDS_NAME, szName, (sizeof szName)/(sizeof szName[0]));
00209     LoadString(g_hinst, IDS_SNAPINNAME, szSnapInName, (sizeof szSnapInName)/(sizeof szSnapInName[0]));
00210
00211     _TCHAR szAboutName[256];
00212
00213     LoadString(g_hinst, IDS_ABOUTNAME, szAboutName, (sizeof szAboutName)/(sizeof szAboutName[0]));
00214
00215     // register our CoClasses
00216     hr = RegisterServer(g_hinst,
00217         CLSID_CComponentData,
00218         szName);
00219
00220     if SUCCEEDED(hr)
00221         hr = RegisterServer(g_hinst,
00222         CLSID_CSnapinAbout,
00223         szAboutName);
00224
00225     // place the registry information for SnapIns
00226     if SUCCEEDED(hr)
00227         hr = RegisterSnapin(CLSID_CComponentData, szSnapInName, CLSID_CSnapinAbout);
00228
00229     return hr;
00230 }
00231
00232
00233 STDAPI DllUnregisterServer()
00234 {
00235     if (UnregisterServer(CLSID_CComponentData) == S_OK)
00236         return UnregisterSnapin(CLSID_CComponentData);
00237     else
00238         return E_FAIL;
00239 }
00240
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • About

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CDelegationBase implementation
00027 //
00028 //
00029 CDelegationBase::CDelegationBase()
00030 {
00031
00032 }
00033
00034 CDelegationBase::~CDelegationBase()
00035 {
00036 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/Adminwrap.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

Adminwrap.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef _ADMINWRAP_H_
00018 #define _ADMINWRAP_H_
00019
00020 #include <comadmin.h>
00021
00022 typedef enum
00023 {
00024   APPLICATION=0,
00025   COMPONENT,
00026   SUBSCRIPTION,
00027   TRANSIENTSUB,
00028   PUBPROP,
00029   TRANSIENTPUBPROP,
00030 } ADMINTYPE, *PADMINTYPE;
00031
00032
00033 HRESULT AddTransientSubscription(ICOMAdminCatalog* pICat, WCHAR* pwzSubName, WCHAR* pwzECID, WCHAR* pwzPubID, WCHAR* pwzIID, IUnknown *punk,
00034                                WCHAR* pwzMethod, WCHAR* pwzCriteria, WCHAR* pwzPubProp, WCHAR* pwzPubVal);
00035 HRESULT RemoveTransientSubscription(ICOMAdminCatalog* pICat, WCHAR* pwzName);
00036
00037 // Catalogue access functions
00038 HRESULT RemoveNamedObjectFromCollection(ICatalogCollection* pICol, BSTR szObjectName, ADMINTYPE type);
00039 HRESULT GetNamedObjectFromCollection(ICatalogCollection* pICol, BSTR szObjName, ICatalogObject** ppICatObj, LONG* plIndex, ADMINTYPE type, BSTR bstrName=NULL);
00040 HRESULT GetCollection(ICOMAdminCatalog* pICat, BSTR szCollName, ICatalogCollection** ppICol);
00041 HRESULT GetCollection(ICatalogCollection* pIParentColl, ICatalogObject* pICatObj, BSTR szCollName, ICatalogCollection** ppICol);
00042 HRESULT GetObjectNameProperty(ADMINTYPE type, BSTR* pbstr);
00043 HRESULT SetStringProperty(ICatalogObject *pcat, BSTR bPROP, WCHAR* pval);
00044 HRESULT SetIUnknownProperty(ICatalogObject *pcat, BSTR bPROP, IUnknown* punk);
00045
00046
00047
00048 #endif
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/rcvall/parser.c Source File

  • NetDS
  • WinSock
  • rcvall

parser.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //    parser.c
00010 //
00011 // Abstract:
00012 //    This sample illustrates how to use the new Winsock 2 ioctls:
00013 //    SIO_RCVALL, SIO_RCVALL_MCAST, and SIO_RCVALL_IGMPMCAST.
00014 //
00015 //    This module includes routines for parsing the IP headers read.
00016 //    Not all protocol headers are parsed, just the most common ones
00017 //    (IPv4, TCP, UDP, and IGMP). You can easily extend this to parse
00018 //    any protocol headers not covered. Additionally, code for parsing
00019 //    IPv6 headers is not provided as the SIO_RCVALL* ioctls are not
00020 //    currently supported by the IPv6 stack.
00021 //
00022 // Usage:
00023 //    See rcvall.c
00024 //
00025 // Build:
00026 //    See rcvall.c
00027 //
00028 //
00029
00030 #include <winsock2.h>
00031 #include <ws2tcpip.h>
00032
00033 #include <stdio.h>
00034 #include <stdlib.h>
00035
00036 #include "parser.h"
00037 #include "resolve.h"
00038 #include "iphdr.h"
00039
00040 //
00041 // A list of protocol types in the IP protocol header
00042 //
00043 char *szProto[] = {"Reserved",     //  0
00044                    "ICMP",         //  1
00045                    "IGMP",         //  2
00046                    "GGP",          //  3
00047                    "IP",           //  4
00048                    "ST",           //  5
00049                    "TCP",          //  6
00050                    "UCL",          //  7
00051                    "EGP",          //  8
00052                    "IGP",          //  9
00053                    "BBN-RCC-MON",  // 10
00054                    "NVP-II",       // 11
00055                    "PUP",          // 12
00056                    "ARGUS",        // 13
00057                    "EMCON",        // 14
00058                    "XNET",         // 15
00059                    "CHAOS",        // 16
00060                    "UDP",          // 17
00061                    "MUX",          // 18
00062                    "DCN-MEAS",     // 19
00063                    "HMP",          // 20
00064                    "PRM",          // 21
00065                    "XNS-IDP",      // 22
00066                    "TRUNK-1",      // 23
00067                    "TRUNK-2",      // 24
00068                    "LEAF-1",       // 25
00069                    "LEAF-2",       // 26
00070                    "RDP",          // 27
00071                    "IRTP",         // 28
00072                    "ISO-TP4",      // 29
00073                    "NETBLT",       // 30
00074                    "MFE-NSP",      // 31
00075                    "MERIT-INP",    // 32
00076                    "SEP",          // 33
00077                    "3PC",          // 34
00078                    "IDPR",         // 35
00079                    "XTP",          // 36
00080                    "DDP",          // 37
00081                    "IDPR-CMTP",    // 38
00082                    "TP++",         // 39
00083                    "IL",           // 40
00084                    "SIP",          // 41
00085                    "SDRP",         // 42
00086                    "SIP-SR",       // 43
00087                    "SIP-FRAG",     // 44
00088                    "IDRP",         // 45
00089                    "RSVP",         // 46
00090                    "GRE",          // 47
00091                    "MHRP",         // 48
00092                    "BNA",          // 49
00093                    "SIPP-ESP",     // 50
00094                    "SIPP-AH",      // 51
00095                    "I-NLSP",       // 52
00096                    "SWIPE",        // 53
00097                    "NHRP",         // 54
00098                    "unassigned",   // 55
00099                    "unassigned",   // 56
00100                    "unassigned",   // 57
00101                    "unassigned",   // 58
00102                    "unassigned",   // 59
00103                    "unassigned",   // 60
00104                    "any host internal protocol",  // 61
00105                    "CFTP",         // 62
00106                    "any local network",           // 63
00107                    "SAT-EXPAK",    // 64
00108                    "KRYPTOLAN",    // 65
00109                    "RVD",          // 66
00110                    "IPPC",         // 67
00111                    "any distributed file system", // 68
00112                    "SAT-MON",    // 69
00113                    "VISA",       // 70
00114                    "IPCV",       // 71
00115                    "CPNX",       // 72
00116                    "CPHB",       // 73
00117                    "WSN",        // 74
00118                    "PVP",        // 75
00119                    "BR-SAT-MON", // 76
00120                    "SUN-ND",     // 77
00121                    "WB-MON",     // 78
00122                    "WB-EXPAK",   // 79
00123                    "ISO-IP",     // 80
00124                    "VMTP",       // 81
00125                    "SECURE-VMTP",// 82
00126                    "VINES",      // 83
00127                    "TTP",        // 84
00128                    "NSFNET-IGP", // 85
00129                    "DGP",        // 86
00130                    "TCF",        // 87
00131                    "IGRP",       // 88
00132                    "OSPFIGP",    // 89
00133                    "Sprite-RPC", // 90
00134                    "LARP",       // 91
00135                    "MTP",        // 92
00136                    "AX.25",      // 93
00137                    "IPIP",       // 94
00138                    "MICP",       // 95
00139                    "SCC-SP",     // 96
00140                    "ETHERIP",    // 97
00141                    "ENCAP",      // 98
00142                    "any private encryption scheme",    // 98
00143                    "GMTP"        // 99
00144                   };
00145
00146 //
00147 // The types of IGMP messages
00148 //
00149 char *szIgmpType[] = {"Invalid - 0",
00150                       "Host Membership Query",
00151                       "Host Membership Report",
00152                       "Invalid - 3",
00153                       "Invalid - 4",
00154                       "Invalid - 5",
00155                       "Version 2 Membership Report",
00156                       "Leave Group"
00157                      };
00158
00159 //
00160 // IGMPv3 Modes
00161 //
00162 char *szIgmpMode[] = {"Invalid-Mode-0",
00163                       "MODE_IS_INCLUDE",
00164                       "MODE_IS_EXCLUDE",
00165                       "CHANGE_TO_INCLUDE_MODE",
00166                       "CHANGE_TO_EXCLUDE_MODE",
00167                       "ALLOW_NEW_SOURCES",
00168                       "BLOCK_OLD_SOURCES"
00169                       "Invalid-Mode-7",
00170                       "Invalid-Mode-8"
00171                      };
00172
00173 //
00174 // Function: PrintIpv4Header
00175 //
00176 // Description:
00177 //    Prints the IPv4 header to the console in a readable form.
00178 //
00179 void
00180 PrintIpv4Header(
00181     IPV4_HDR *v4hdr,
00182     int len
00183     )
00184 {
00185     SOCKADDR_IN sa4 = {0};
00186     char        srcaddr[INET_ADDRSTRLEN] = {'\0'},
00187                 destaddr[INET_ADDRSTRLEN] = {'\0'};
00188
00189     printf("IPv4: Version         %2d : Length     %2d : Type of Service 0x%02x\n",
00190             HI_BYTE(v4hdr->ip_verlen), LO_BYTE(v4hdr->ip_verlen) * 4, v4hdr->ip_tos);
00191     printf("IPv4: Total Length %5d : ID     0x%04x : Time to Live    %d\n",
00192             ntohs(v4hdr->ip_totallength), ntohs(v4hdr->ip_offset), v4hdr->ip_ttl);
00193     // Make sure protocol value is in the array of szProto
00194     if ((v4hdr->ip_protocol >= 0) && (v4hdr->ip_protocol < (sizeof(szProto) / sizeof(char *))))
00195         printf("IPv4: Protocol %9s : Checksum 0x%04x\n",
00196                 szProto[v4hdr->ip_protocol], v4hdr->ip_checksum);
00197     else
00198         printf("IPv4: Protocol %9d : Checksum 0x%04x\n",
00199                 v4hdr->ip_protocol, v4hdr->ip_checksum);
00200
00201     sa4.sin_family = AF_INET;
00202     sa4.sin_port   = 0;
00203     sa4.sin_addr.s_addr = v4hdr->ip_srcaddr;
00204     FormatAddress((SOCKADDR *)&sa4, sizeof(sa4), srcaddr, INET_ADDRSTRLEN);
00205
00206     sa4.sin_addr.s_addr = v4hdr->ip_destaddr;
00207     FormatAddress((SOCKADDR *)&sa4, sizeof(sa4), destaddr, INET_ADDRSTRLEN);
00208
00209     printf("IPv4: Source Address       %s\nIPv4: Destination Address  %s\n",
00210             srcaddr, destaddr);
00211
00212 }
00213
00214 //
00215 // Function: PrintUdpHeader
00216 //
00217 // Description:
00218 //    Prints the UDP header in readable form to the console.
00219 //
00220 void
00221 PrintUdpHeader(
00222     UDP_HDR *udphdr,
00223     int len
00224     )
00225 {
00226     printf("UDP: Source Port  %6d : Destination Port %6d\n",
00227             ntohs(udphdr->src_portno), ntohs(udphdr->dest_portno));
00228     printf("UDP: Length     %8d : Checksum        0x4%x\n",
00229             ntohs(udphdr->udp_length), udphdr->udp_checksum);
00230 }
00231
00232 //
00233 // Function: PrintTcpHeader
00234 //
00235 // Description:
00236 //    Prints the TCP header in readable form to the console.
00237 //
00238 void
00239 PrintTcpHeader(
00240     TCP_HDR *tcphdr,
00241     int len
00242     )
00243 {
00244     USHORT flags = 0;
00245
00246     printf("TCP: Source Port      %6d : Destination Port %6d\n",
00247             ntohs(tcphdr->src_portno), ntohs(tcphdr->dest_portno));
00248     printf("TCP: Sequence Num %10lu : ACK %10lu\n",
00249             ntohl(tcphdr->seq_num), ntohl(tcphdr->ack_num));
00250     printf("TCP: Length           %6d : Flags ",
00251             ((ntohs(tcphdr->lenflags) >> 12) * 4));
00252
00253     flags = (ntohs(tcphdr->lenflags) & 0x3F);
00254     if (flags & 0x20)
00255         printf("URG ");
00256     if (flags & 0x10)
00257         printf("ACK ");
00258     if (flags & 0x08)
00259         printf("PSH ");
00260     if (flags & 0x04)
00261         printf("RST ");
00262     if (flags & 0x02)
00263         printf("SYN ");
00264     if (flags & 0x01)
00265         printf("FIN ");
00266     printf("\n");
00267     printf("TCP: Window Size  %10d : Checksum 0x%04x : Urgent Pointer 0x%04x\n",
00268             ntohs(tcphdr->window_size), ntohs(tcphdr->tcp_checksum),
00269             ntohs(tcphdr->tcp_urgentptr));
00270 }
00271
00272 //
00273 // Function: PrintIgmpHeader
00274 //
00275 // Description:
00276 //    This routine prints an IGMP header to the console. For IGMPv1 and IGMPv2
00277 //    this is fairly trivial as the headers are mostly the same and are the
00278 //    same size. For IGMPv3 this is considerably more difficult as the packets
00279 //    can be variable length which requires many additional checks to make sure
00280 //    the packet lengths are consistent.
00281 //
00282 void
00283 PrintIgmpHeader(
00284     IGMP_HDR *igmphdr,
00285     int len
00286     )
00287 {
00288     SOCKADDR_IN sa4 = {0};
00289     char        addrbuf[INET_ADDRSTRLEN] = {'\0'};
00290     int         i = 0;
00291
00292     if (
00293 #ifdef INEFFICIENT
00294         // In case you need to modify the code, the following conditional will
00295         //    distinguish between individual messages and versions...
00296
00297         // IGMP membership query v1
00298         ( (igmphdr->version_type == 0x11) && (igmphdr->max_resp_time == 0) && (len == sizeof(IGMP_HDR)) ) ||
00299
00300         // IGMP membership report v1
00301         ( (igmphdr->version_type == 0x12) && (igmphdr->max_resp_time == 0) && (len == sizeof(IGMP_HDR)) ) ||
00302
00303         // IGMP membership query v2
00304         ( (igmphdr->version_type == 0x11) && (igmphdr->max_resp_time != 0) && (len == sizeof(IGMP_HDR)) ) ||
00305
00306         // IGMP membership report v2
00307         ( (igmphdr->version_type == 0x16) && (igmphdr->max_resp_time != 0) && (len == sizeof(IGMP_HDR)) ) ||
00308
00309         // IGMP leave group (v2)
00310         ( igmphdr->version_type == 0x17 )
00311 #else
00312         ( len == sizeof(IGMP_HDR) )
00313 #endif
00314        )
00315     {
00316         if ( (LO_BYTE(igmphdr->version_type) >= 0) &&
00317              (LO_BYTE(igmphdr->version_type)  < (sizeof(szIgmpType) / sizeof(char *)))
00318              )
00319             printf("IGMP: Version         %2d : Type %16s : Maximum Response Time %d\n",
00320                     HI_BYTE(igmphdr->version_type), szIgmpType[LO_BYTE(igmphdr->version_type)],
00321                     igmphdr->max_resp_time);
00322         else
00323             printf("IGMP: Version         %2d : Type %16d : Maximum Response Time %d\n",
00324                     HI_BYTE(igmphdr->version_type), LO_BYTE(igmphdr->version_type),
00325                     igmphdr->max_resp_time);
00326
00327         // Print the group address
00328         sa4.sin_family = AF_INET;
00329         sa4.sin_addr.s_addr = igmphdr->group_addr;
00330         FormatAddress((SOCKADDR *)&sa4, sizeof(sa4), addrbuf, INET_ADDRSTRLEN);
00331         printf("IGMP: Checksum    0x%04x : Group      %s\n",
00332                 igmphdr->checksum, addrbuf);
00333     }
00334     else if ( (igmphdr->version_type == 0x11) && (len > sizeof(IGMP_HDR)) )
00335     {
00336         IGMP_HDR_QUERY_V3 *query=NULL;
00337
00338         //
00339         // IGMP membership query v3
00340         //
00341
00342         query = (IGMP_HDR_QUERY_V3 *)igmphdr;
00343
00344         // Verify data is big enough to contain the entire packet
00345         if ( (len < sizeof(IGMP_HDR_QUERY_V3)) ||
00346              (len < (int) (sizeof(IGMP_HDR_QUERY_V3) + (sizeof(ULONG) * (query->num_sources-1))) )
00347            )
00348         {
00349             printf("IGMP: Invalid packet\n");
00350             return;
00351         }
00352
00353         printf("IGMP: Version           3 : Type Membership Query : Maximum Response Time %d\n",
00354                 query->max_resp_time);
00355
00356         // Print the group address
00357         sa4.sin_family = AF_INET;
00358         sa4.sin_addr.s_addr = query->group_addr;
00359         FormatAddress((SOCKADDR *)&sa4, sizeof(sa4), addrbuf, INET_ADDRSTRLEN);
00360         printf("IGMP: Checksum    0x%04x : Group      %s\n",
00361                 query->checksum, addrbuf);
00362
00363         printf("IGMP: Resv 0x%1x : S 0x%1x : QRV 0x%1x : QQIC 0x%02x\n",
00364                 (query->resv_suppr_robust >> 4),
00365                 ((query->resv_suppr_robust >> 3) & 0x1),
00366                 (query->resv_suppr_robust && 0x7),
00367                 query->qqi
00368                 );
00369         printf("IGMP: Source Count: %lu\n",
00370                 ntohl(query->num_sources));
00371
00372         // Print out the array of source addresses
00373         for(i=0; i < (int)ntohl(query->num_sources) ;i++)
00374         {
00375             sa4.sin_addr.s_addr = query->sources[i];
00376             FormatAddress((SOCKADDR *)&sa4, sizeof(sa4), addrbuf, INET_ADDRSTRLEN);
00377             printf("IGMP: Source [%02d] %s\n", i, addrbuf);
00378         }
00379
00380     }
00381     else if ( (igmphdr->version_type == 0x22) && (len > sizeof(IGMP_HDR)) )
00382     {
00383         IGMP_HDR_REPORT_V3   *report=NULL;
00384         IGMP_GROUP_RECORD_V3 *group=NULL;
00385         ULONG                 totalrecordslen = 0,
00386                               recordlen = 0,
00387                               offset = 0;
00388         char                 *ptr=NULL;
00389         int                   j = 0;
00390
00391         //
00392         // IGMP membership report v3
00393         //
00394
00395         report = (IGMP_HDR_REPORT_V3 *)igmphdr;
00396
00397         // Safe to touch these fields as we already know the packet is at least
00398         //    8 bytes in length.
00399         printf("IGMP: Membership Report : Reserved          0x%02x : Checksum 0x%04x\n",
00400                 report->reserved1, report->checksum);
00401         printf("IGMP: Resereved  0x%04x : Number of Records %d\n",
00402                 report->reserved2, ntohs(report->num_records));
00403
00404         // Get a pointer to start of records;
00405         ptr = (char *)report + sizeof(IGMP_HDR_REPORT_V3);
00406         offset = 0;
00407         i = 0;
00408
00409         totalrecordslen = len - sizeof(IGMP_HDR_REPORT_V3);
00410
00411         // Go through each of the IGMP group records
00412         while (offset < totalrecordslen)
00413         {
00414             // Get a pointer to the group record
00415             group = (IGMP_GROUP_RECORD_V3 *) &ptr[offset];
00416
00417             // Make sure we have enough for group record header (note: we subtract
00418             //    off the size of the one source which may or may not be present).
00419             //    The goal is to make sure we can safely read the num_sources field.
00420             if ((offset + sizeof(IGMP_GROUP_RECORD_V3) - sizeof(ULONG)) > totalrecordslen)
00421             {
00422                 printf("IGMP: Invalid packet\n");
00423                 break;
00424             }
00425
00426             // Compute size of this record
00427             recordlen =  sizeof(IGMP_GROUP_RECORD_V3) +
00428                         (sizeof(ULONG) * (ntohs(group->num_sources) - 1)) +
00429                          group->aux_data_len;
00430             offset += recordlen;
00431
00432             // Make sure we have enough for the whole record
00433             if (offset > totalrecordslen)
00434             {
00435                 printf("IGMP: Invalid packet\n");
00436                 break;
00437             }
00438
00439             // Make sure 'type' is in the array of strings if not just print the
00440             //    integer value
00441             if ((group->type >= 0) && (group->type < (sizeof(szIgmpMode) / sizeof(char *))) )
00442                 printf("IGMP RECORD [%02d]: Type %16s : Aux Data Len  %d\n",
00443                         i, szIgmpMode[group->type], group->aux_data_len);
00444             else
00445                 printf("IGMP RECORD [%02d]: Type %16d : Aux Data Len  %d\n",
00446                         i, group->type, group->aux_data_len);
00447
00448             // Print the group address
00449             sa4.sin_family = AF_INET;
00450             sa4.sin_addr.s_addr = group->group_addr;
00451             FormatAddress((SOCKADDR *)&sa4, sizeof(sa4), addrbuf, INET_ADDRSTRLEN);
00452             printf("IGMP RECORD [%02d]: Number of Sources %9d : Group Address %s\n",
00453                     i, ntohs(group->num_sources), addrbuf);
00454
00455             // Print the list of sources
00456             for(j=0; j < ntohs(group->num_sources) ;j++)
00457             {
00458                 sa4.sin_addr.s_addr = group->source_addr[j];
00459                 FormatAddress((SOCKADDR *)&sa4, sizeof(sa4), addrbuf, INET_ADDRSTRLEN);
00460                 printf("IGMP_RECORD [%02d]: Source [%02d] %s\n",
00461                         i, j, addrbuf);
00462             }
00463
00464             i++;
00465         }
00466     }
00467     else
00468     {
00469         printf("IGMP: Invalid packet\n");
00470     }
00471 }
00472
00473 //
00474 // Function: CheckForMatchIPv4
00475 //
00476 // Description:
00477 //    This routine determines whether the received packet matches the filter
00478 //    specified. The source and destination IPv4 addresses as well as the
00479 //    source and destination ports can be filtered on. Note that for protocols
00480 //    that don't contain port numbers (e.g. IGMP) then the port comparison
00481 //    portion of the code will automatically fail.
00482 //
00483 int
00484 CheckForMatchIPv4(
00485     unsigned int filtermask,
00486     SOCKADDR *srcfilter,
00487     SOCKADDR *destfilter,
00488     IPV4_HDR *hdr,
00489     char *nexthdr
00490     )
00491 {
00492     PORT_HDR *ports=NULL;
00493     int      match = 0;
00494
00495     match = 1;
00496     ports = (PORT_HDR *)nexthdr;
00497
00498     // Try to match source address if specified
00499     if ((match) && (filtermask & FILTER_MASK_SOURCE_ADDRESS))
00500     {
00501         match = !memcmp(
00502                &((SOCKADDR_IN *)srcfilter)->sin_addr.s_addr,
00503                &hdr->ip_srcaddr,
00504                 sizeof(unsigned long)
00505                 );
00506     }
00507     // Try to match the destination address if specified
00508     if ((match) && (filtermask & FILTER_MASK_DESTINATION_ADDRESS))
00509     {
00510         match = !memcmp(
00511                &((SOCKADDR_IN *)destfilter)->sin_addr.s_addr,
00512                &hdr->ip_destaddr,
00513                 sizeof(unsigned long)
00514                 );
00515     }
00516     // Try to match source port if specified and ports is not NULL (i.e. its TCP or UDP)
00517     if ((match) && (ports) && (filtermask & FILTER_MASK_SOURCE_PORT))
00518     {
00519         match = ( ((SOCKADDR_IN *)srcfilter)->sin_port == ports->src_portno );
00520     }
00521     else if ((ports == NULL) && (filtermask & FILTER_MASK_SOURCE_PORT))
00522     {
00523         match = 0;
00524     }
00525
00526     // Try to match destination port if specified and ports is not NULL (i.e. its TCP or UDP)
00527     if ((match) && (ports) && (filtermask & FILTER_MASK_DESTINATION_PORT))
00528     {
00529         match = ( ((SOCKADDR_IN *)destfilter)->sin_port == ports->dest_portno );
00530     }
00531     else if ((ports == NULL) && (filtermask & FILTER_MASK_DESTINATION_PORT))
00532     {
00533         match = 0;
00534     }
00535
00536     return match;
00537 }
00538
00539 //
00540 // Function: DecodeIPHeader
00541 //
00542 // Description:
00543 //    This function takes a pointer to an IP header and prints
00544 //    it out in a readable form.
00545 //
00546 int
00547 DecodeIPHeader(
00548     char         *buf,
00549     int           buflen,
00550     unsigned long filtermask,
00551     SOCKADDR     *srcfilter,
00552     SOCKADDR     *destfilter
00553     )
00554 {
00555     IPV4_HDR    *ipv4hdr=NULL;
00556     UDP_HDR     *udphdr=NULL;
00557     TCP_HDR     *tcphdr=NULL;
00558     IGMP_HDR    *igmphdr=NULL;
00559     BOOL         bFilterMatch = FALSE;
00560     int          ip_version = 0,
00561                  ipv4_header_len = 0;
00562     char        *ptr=NULL;
00563
00564     printf("buflen = %d\n", buflen);
00565
00566     // Make sure we can at least extract the IP version
00567     if (buflen < sizeof(char))
00568     {
00569         return SOCKET_ERROR;
00570     }
00571
00572     // Check the IP version
00573     ip_version = HI_BYTE(*buf);
00574
00575     if (ip_version == 4)
00576     {
00577         // Verify the buffer is large enough
00578         if (buflen < sizeof(IPV4_HDR))
00579         {
00580             fprintf(stderr, "Received buffer too small!\n");
00581             return SOCKET_ERROR;
00582         }
00583
00584         // Get length of IPv4 header to determine where next protocol header begins
00585         ipv4_header_len = LO_BYTE(*buf) * 4;
00586
00587         ipv4hdr = (IPV4_HDR *)buf;
00588
00589         bFilterMatch = TRUE;
00590
00591         // Test for match (if filter specified) and get pointer to next protocol header
00592         switch (ipv4hdr->ip_protocol)
00593         {
00594             case IPPROTO_UDP:
00595
00596                 udphdr = (UDP_HDR *) &buf[ipv4_header_len];
00597                 if (filtermask)
00598                     bFilterMatch = CheckForMatchIPv4(filtermask, srcfilter, destfilter, ipv4hdr, (char *)udphdr);
00599                 break;
00600
00601             case IPPROTO_TCP:
00602
00603                 tcphdr = (TCP_HDR *) &buf[ipv4_header_len];
00604                 if (filtermask)
00605                     bFilterMatch = CheckForMatchIPv4(filtermask, srcfilter, destfilter, ipv4hdr, (char *)tcphdr);
00606                 break;
00607
00608             case IPPROTO_IGMP:
00609
00610                 igmphdr = (IGMP_HDR *) &buf[ipv4_header_len];
00611                 if (filtermask)
00612                     bFilterMatch = CheckForMatchIPv4(filtermask, srcfilter, destfilter, ipv4hdr, NULL);
00613                 break;
00614
00615             default:
00616
00617                 // Don't know about this protocol so if we're filtering, don't print it
00618                 if (filtermask)
00619                     bFilterMatch = FALSE;
00620
00621                 break;
00622         }
00623
00624         // If this packet matches, then print it
00625         if (bFilterMatch)
00626         {
00627             PrintIpv4Header(ipv4hdr, buflen);
00628
00629             switch (ipv4hdr->ip_protocol)
00630             {
00631                 case IPPROTO_UDP:
00632
00633                     PrintUdpHeader(udphdr, buflen - ipv4_header_len);
00634                     break;
00635
00636                 case IPPROTO_TCP:
00637
00638                     PrintTcpHeader(tcphdr, buflen - ipv4_header_len);
00639                     break;
00640
00641                 case IPPROTO_IGMP:
00642
00643                     PrintIgmpHeader(igmphdr, buflen - ipv4_header_len);
00644                     break;
00645
00646                 default:
00647
00648                     printf("   No decoder for protocol: %d\n", ipv4hdr->ip_protocol);
00649                     break;
00650
00651             }
00652             printf("\n");
00653         }
00654
00655     }
00656     else if (ip_version == 6)
00657     {
00658         fprintf(stderr, "Currently don't support decoding IPv6 headers\n");
00659         return SOCKET_ERROR;
00660     }
00661
00662     return NO_ERROR;
00663 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/SimpleClient/WbemClientDlg.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • SimpleClient

WbemClientDlg.Cpp

Go to the documentation of this file.
00001 // WbemClientDlg.cpp : implementation file
00002
00003 //
00004
00005 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00006
00007 #include "stdafx.h"
00008 #include "WbemClient.h"
00009 #include "WbemClientDlg.h"
00010
00011 #ifdef _DEBUG
00012 #define new DEBUG_NEW
00013 #undef THIS_FILE
00014 static char THIS_FILE[] = __FILE__;
00015 #endif
00016
00017 // Return error message.
00018 CString ErrorMsg(LPCTSTR str, HRESULT hRes) {
00019     CString s;
00020   s.Format("%s(0x%08lx)", str, hRes);
00021   return s;
00022 }
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CAboutDlg dialog used for App About
00026
00027 class CAboutDlg : public CDialog
00028 {
00029 public:
00030   CAboutDlg();
00031
00032 // Dialog Data
00033   //{{AFX_DATA(CAboutDlg)
00034   enum { IDD = IDD_ABOUTBOX };
00035   //}}AFX_DATA
00036
00037   // ClassWizard generated virtual function overrides
00038   //{{AFX_VIRTUAL(CAboutDlg)
00039   protected:
00040   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00041   //}}AFX_VIRTUAL
00042
00043 // Implementation
00044 protected:
00045   //{{AFX_MSG(CAboutDlg)
00046   //}}AFX_MSG
00047   DECLARE_MESSAGE_MAP()
00048 };
00049
00050 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00051 {
00052   //{{AFX_DATA_INIT(CAboutDlg)
00053   //}}AFX_DATA_INIT
00054 }
00055
00056 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00057 {
00058   CDialog::DoDataExchange(pDX);
00059   //{{AFX_DATA_MAP(CAboutDlg)
00060   //}}AFX_DATA_MAP
00061 }
00062
00063 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00064   //{{AFX_MSG_MAP(CAboutDlg)
00065     // No message handlers
00066   //}}AFX_MSG_MAP
00067 END_MESSAGE_MAP()
00068
00069 /////////////////////////////////////////////////////////////////////////////
00070 // CWbemClientDlg dialog
00071
00072 CWbemClientDlg::CWbemClientDlg(CWnd* pParent /*=NULL*/)
00073   : CDialog(CWbemClientDlg::IDD, pParent)
00074 {
00075   //{{AFX_DATA_INIT(CWbemClientDlg)
00076   m_namespace = _T("\\\\.\\root\\cimv2");
00077   //}}AFX_DATA_INIT
00078   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
00079   m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
00080   m_pIWbemServices = NULL;
00081   m_pOfficeService = NULL;
00082 }
00083
00084 CWbemClientDlg::~CWbemClientDlg()
00085 {
00086   if (m_pIWbemServices)
00087     m_pIWbemServices->Release();
00088   if (m_pOfficeService)
00089     m_pOfficeService->Release();
00090 }
00091
00092 void CWbemClientDlg::DoDataExchange(CDataExchange* pDX)
00093 {
00094   CDialog::DoDataExchange(pDX);
00095   //{{AFX_DATA_MAP(CWbemClientDlg)
00096   DDX_Control(pDX, IDC_DISKINFO, m_diskInfo);
00097   DDX_Control(pDX, IDC_ENUMDISKS, m_enumDisks);
00098   DDX_Control(pDX, IDC_OUTPUTLIST, m_outputList);
00099   DDX_Text(pDX, IDC_NAMESPACE, m_namespace);
00100   //}}AFX_DATA_MAP
00101 }
00102
00103 BEGIN_MESSAGE_MAP(CWbemClientDlg, CDialog)
00104   //{{AFX_MSG_MAP(CWbemClientDlg)
00105   ON_WM_SYSCOMMAND()
00106   ON_WM_PAINT()
00107   ON_WM_QUERYDRAGICON()
00108   ON_BN_CLICKED(IDC_CONNECT, OnConnect)
00109   ON_BN_CLICKED(IDC_ENUMDISKS, OnEnumdisks)
00110   ON_BN_CLICKED(IDC_MAKEOFFICE, OnMakeoffice)
00111   ON_BN_CLICKED(IDC_DISKINFO, OnDiskinfo)
00112   //}}AFX_MSG_MAP
00113 END_MESSAGE_MAP()
00114
00115 /////////////////////////////////////////////////////////////////////////////
00116 // CWbemClientDlg message handlers
00117
00118 BOOL CWbemClientDlg::OnInitDialog()
00119 {
00120   CDialog::OnInitDialog();
00121
00122   // Add "About..." menu item to system menu.
00123
00124   // IDM_ABOUTBOX must be in the system command range.
00125   ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
00126   ASSERT(IDM_ABOUTBOX < 0xF000);
00127
00128   CMenu* pSysMenu = GetSystemMenu(FALSE);
00129   if (pSysMenu != NULL)
00130   {
00131     CString strAboutMenu;
00132     strAboutMenu.LoadString(IDS_ABOUTBOX);
00133     if (!strAboutMenu.IsEmpty())
00134     {
00135       pSysMenu->AppendMenu(MF_SEPARATOR);
00136       pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
00137     }
00138   }
00139
00140   // Set the icon for this dialog.  The framework does this automatically
00141   //  when the application's main window is not a dialog
00142   SetIcon(m_hIcon, TRUE);     // Set big icon
00143   SetIcon(m_hIcon, FALSE);    // Set small icon
00144
00145   // TODO: Add extra initialization here
00146
00147   return TRUE;  // return TRUE  unless you set the focus to a control
00148 }
00149
00150 void CWbemClientDlg::OnSysCommand(UINT nID, LPARAM lParam)
00151 {
00152   if ((nID & 0xFFF0) == IDM_ABOUTBOX)
00153   {
00154     CAboutDlg dlgAbout;
00155     dlgAbout.DoModal();
00156   }
00157   else
00158   {
00159     CDialog::OnSysCommand(nID, lParam);
00160   }
00161 }
00162
00163 // If you add a minimize button to your dialog, you will need the code below
00164 //  to draw the icon.  For MFC applications using the document/view model,
00165 //  this is automatically done for you by the framework.
00166
00167 void CWbemClientDlg::OnPaint()
00168 {
00169   if (IsIconic())
00170   {
00171     CPaintDC dc(this); // device context for painting
00172
00173     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00174
00175     // Center icon in client rectangle
00176     int cxIcon = GetSystemMetrics(SM_CXICON);
00177     int cyIcon = GetSystemMetrics(SM_CYICON);
00178     CRect rect;
00179     GetClientRect(&rect);
00180     int x = (rect.Width() - cxIcon + 1) / 2;
00181     int y = (rect.Height() - cyIcon + 1) / 2;
00182
00183     // Draw the icon
00184     dc.DrawIcon(x, y, m_hIcon);
00185   }
00186   else
00187   {
00188     CDialog::OnPaint();
00189   }
00190 }
00191
00192 // The system calls this to obtain the cursor to display while the user drags
00193 //  the minimized window.
00194 HCURSOR CWbemClientDlg::OnQueryDragIcon()
00195 {
00196   return (HCURSOR) m_hIcon;
00197 }
00198
00199
00200 /////////////////////////////////////////////////////////////////////////////
00201 // CWbemClientDlg connection
00202
00203 void CWbemClientDlg::OnConnect()
00204 {
00205   CWaitCursor wait; // show wait cursor until finished
00206
00207   // Create an instance of the WbemLocator interface.
00208   IWbemLocator *pIWbemLocator = NULL;
00209
00210   BSTR pNamespace = m_namespace.AllocSysString();
00211   if (!pNamespace)
00212   {
00213     AfxMessageBox(_T("AllocSysString() failed. "));
00214     return;
00215   }
00216
00217
00218   UpdateData();
00219
00220   if(CoCreateInstance(CLSID_WbemLocator,
00221     NULL,
00222     CLSCTX_INPROC_SERVER,
00223     IID_IWbemLocator,
00224     (LPVOID *) &pIWbemLocator) == S_OK)
00225   {
00226     // If already connected, release m_pIWbemServices.
00227     if (m_pIWbemServices)  m_pIWbemServices->Release();
00228
00229     // Using the locator, connect to CIMOM in the given namespace.
00230
00231     if(pIWbemLocator->ConnectServer(pNamespace,
00232                 NULL,   //using current account for simplicity
00233                 NULL, //using current password for simplicity
00234                 0L,   // locale
00235                 0L,   // securityFlags
00236                 NULL, // authority (domain for NTLM)
00237                 NULL, // context
00238                 &m_pIWbemServices) == S_OK)
00239     {
00240       // Indicate success.
00241       m_outputList.ResetContent();
00242       m_outputList.AddString(_T("Connected to namespace"));
00243
00244       // It's safe the hit the other buttons now.
00245       m_enumDisks.EnableWindow(TRUE);
00246
00247       //...except Disk Info button
00248       m_diskInfo.EnableWindow(FALSE);
00249
00250
00251     }
00252     else AfxMessageBox(_T("Bad namespace"));
00253
00254     // Done with pNamespace.
00255     SysFreeString(pNamespace);
00256
00257     // Done with pIWbemLocator.
00258     pIWbemLocator->Release();
00259   }
00260   else AfxMessageBox(_T("Failed to create IWbemLocator object"));
00261 }
00262
00263 void CWbemClientDlg::OnEnumdisks()
00264 {
00265   CWaitCursor wait; // show wait cursor until finished
00266
00267   HRESULT hRes = S_OK;
00268   IEnumWbemClassObject *pEnumStorageDevs = NULL;
00269
00270   m_outputList.ResetContent();
00271
00272   // Get the Win32_LogicalDisk class
00273   BSTR className = SysAllocString(L"Win32_LogicalDisk");
00274   if (!className)
00275   {
00276     hRes = WBEM_E_OUT_OF_MEMORY;
00277     m_outputList.AddString( ErrorMsg(_T("OnEnumdisks() failed:"), hRes));
00278     return;
00279   }
00280
00281   // Get the list of logical storage device instances.
00282   hRes = m_pIWbemServices->CreateInstanceEnum(
00283     className,      // name of class
00284     0,
00285     NULL,
00286     &pEnumStorageDevs); // pointer to enumerator
00287
00288   SysFreeString(className);
00289
00290   // For each logical storage device...
00291   if (SUCCEEDED(hRes))
00292   {
00293     ULONG uReturned = 1;
00294     while(uReturned == 1)
00295     {
00296       IWbemClassObject *pStorageDev = NULL;
00297       //---------------------------
00298       // enumerate through the resultset.
00299       hRes = pEnumStorageDevs->Next(
00300         2000,     // timeout in two seconds
00301         1,        // return just one storage device
00302         &pStorageDev, // pointer to storage device
00303         &uReturned);  // number obtained: one or zero
00304
00305       if (SUCCEEDED(hRes) && (uReturned == 1))
00306       {
00307         VARIANT pVal;
00308         VariantClear(&pVal);
00309
00310         // Get the "__RELPATH" system property.
00311         BSTR propName = SysAllocString(L"__RELPATH");
00312         if (!propName)
00313         {
00314           if (pEnumStorageDevs)  pEnumStorageDevs->Release();
00315           if (pStorageDev)  pStorageDev->Release();
00316           hRes = WBEM_E_OUT_OF_MEMORY;
00317           m_outputList.AddString( ErrorMsg(_T("OnEnumdisks() failed:"), hRes));
00318           return;
00319         }
00320
00321         hRes = pStorageDev->Get(
00322           propName, // property name
00323           0L,
00324           &pVal,    // output to this variant
00325           NULL,
00326           NULL);
00327
00328         // Done with this object.
00329         pStorageDev->Release();
00330
00331         // Add the path property to the output listbox.
00332         if (SUCCEEDED(hRes))
00333           m_outputList.AddString(CString(V_BSTR(&pVal)));
00334       }
00335         } // end while
00336
00337     // Done with this enumerator.
00338     if (pEnumStorageDevs)  pEnumStorageDevs->Release();
00339
00340     // Enable disk info button if disk info is available.
00341     if (m_outputList.GetCount() > 0)
00342     {
00343       m_outputList.SetCurSel(0);
00344       m_diskInfo.EnableWindow(TRUE);
00345     }
00346     }
00347   else m_outputList.AddString(
00348     ErrorMsg(_T("CreateInstanceEnum() failed:"), hRes));
00349 }
00350
00351
00352 /////////////////////////////////////////////////////////////////////////////
00353 // Create a namespace
00354
00355 // Save a pointer to the root\cimv2\office namespace
00356 // in m_pOfficeService.
00357 // Create the namespace if it doesn't already exist
00358 void CWbemClientDlg::OnMakeoffice()
00359 {
00360   CWaitCursor wait;
00361   m_outputList.ResetContent();
00362
00363   // If already connected to the namespace, we are done.
00364   if (m_pOfficeService)  return;
00365
00366   // if "Office" namespace doesn't exist...
00367   BSTR Namespace = SysAllocString(L"SAMPLE_Office");
00368   if (!Namespace)
00369   {
00370     m_outputList.AddString( _T("SysAllocString failed"));
00371     return;
00372   }
00373
00374   HRESULT hRes = m_pIWbemServices->OpenNamespace(
00375     Namespace,
00376     0, NULL,
00377     &m_pOfficeService,
00378     NULL);
00379
00380   // Don't SysFreeString(Namespace) here; we'll need it later.
00381
00382   if (FAILED(hRes))
00383   {
00384     // Create __namespace class.
00385     BSTR NamespaceClass = SysAllocString(L"__Namespace");
00386     if (!NamespaceClass)
00387     {
00388       SysFreeString(Namespace);
00389       m_outputList.AddString(_T("SysAllocString failed"));
00390       return;
00391     }
00392
00393     IWbemClassObject *pNSClass = NULL;
00394
00395     hRes = m_pIWbemServices->GetObject(
00396       NamespaceClass, // object path
00397       0L, NULL,
00398       &pNSClass,    // pointer to object
00399       NULL);
00400
00401     SysFreeString(NamespaceClass);
00402
00403     if (SUCCEEDED(hRes))
00404     {
00405       // Spawn a new instance of this class.
00406       IWbemClassObject *pNSInst = NULL;
00407
00408       hRes = pNSClass->SpawnInstance(0, &pNSInst);
00409       if(SUCCEEDED(hRes))
00410       {
00411         // Set the new namespace's name.
00412         VARIANT v;
00413         VariantInit(&v);
00414         V_VT(&v) = VT_BSTR;
00415         V_BSTR(&v) = Namespace;
00416
00417         BSTR Prop = SysAllocString(L"Name");
00418         if (!Prop)
00419         {
00420           pNSClass->Release();
00421           pNSInst->Release();
00422           SysFreeString(Namespace);
00423           m_outputList.AddString( _T("SysAllocString failed"));
00424           return;
00425         }
00426
00427
00428         hRes = pNSInst->Put(
00429           Prop,
00430           0,
00431           &v,
00432           0);
00433
00434         SysFreeString(Prop);
00435         VariantClear(&v);
00436
00437         // Create the instance.
00438         hRes = m_pIWbemServices->PutInstance(
00439           pNSInst,
00440           WBEM_FLAG_CREATE_OR_UPDATE,
00441           NULL, NULL);
00442
00443         pNSInst->Release();
00444         pNSInst = NULL;
00445
00446         if (SUCCEEDED(hRes)) {
00447           m_outputList.AddString(_T("Created office namespace"));
00448
00449           // open the new namespace.
00450           hRes = m_pIWbemServices->OpenNamespace(
00451             Namespace, 0, NULL, &m_pOfficeService, NULL);
00452         }
00453       }
00454       pNSClass->Release();  // Don't need the class any more
00455       pNSClass = NULL;
00456     }
00457   }
00458
00459   SysFreeString(Namespace);
00460
00461   if (m_pOfficeService)
00462   {
00463      // Note: We should always 'try' to create the namespace.  We
00464      // don't use m_pOfficeService for anything else, so it is a good idea to
00465      // Release() and NULL it
00466      m_pOfficeService->Release();
00467      m_pOfficeService = NULL;
00468      m_outputList.AddString(_T("Connected to office"));
00469   }
00470   else m_outputList.AddString(
00471     ErrorMsg(_T("Failed to connect to office"), hRes));
00472
00473   m_diskInfo.EnableWindow(FALSE);
00474 }
00475
00476
00477 // Display the properties of the selected disk.
00478 void CWbemClientDlg::OnDiskinfo()
00479 {
00480   CWaitCursor wait;
00481
00482   BSTR cimType  = SysAllocString(L"CIMTYPE");
00483   if (!cimType)
00484   {
00485     m_outputList.AddString(_T("SysAllocString failed"));
00486     return;
00487   }
00488
00489   // OnEnumDisks must precede next OnDiskInfo.
00490   m_diskInfo.EnableWindow(FALSE);
00491
00492   // Get selected disk from list box as a BSTR
00493   CString sDevice;
00494   int index = m_outputList.GetCurSel();
00495   m_outputList.GetText(index, sDevice);
00496
00497   BSTR sDisk = sDevice.AllocSysString();
00498   if (!sDisk)
00499   {
00500     m_outputList.AddString(_T("SysAllocString failed"));
00501     return;
00502   }
00503
00504   // Get the selected Win32_LogicalDisk instance.
00505   IWbemClassObject *pDisk = NULL;
00506
00507   HRESULT hRes = m_pIWbemServices->GetObject(
00508     sDisk,    // object path
00509     0L, NULL,
00510     &pDisk,   // pointer to object
00511     NULL);
00512
00513   SysFreeString(sDisk);
00514   if (FAILED(hRes))
00515   {
00516     m_outputList.AddString(_T("GetObject() failed"));
00517     return;
00518   }
00519
00520
00521   // Get the property names from this instance.
00522   SAFEARRAY *psaNames = NULL;
00523
00524   hRes = pDisk->GetNames(
00525     NULL,
00526     WBEM_FLAG_ALWAYS | WBEM_FLAG_NONSYSTEM_ONLY,
00527     NULL,
00528     &psaNames);
00529
00530   if (SUCCEEDED(hRes))
00531   {
00532     // Get the number of properties.
00533     long lLower, lUpper;
00534
00535     SafeArrayGetLBound(psaNames, 1, &lLower);
00536     SafeArrayGetUBound(psaNames, 1, &lUpper);
00537     TRACE("SAFEARRAY from %d to %d\n", lLower, lUpper);
00538
00539     // For each property...
00540     BSTR PropName = NULL;
00541
00542     m_outputList.ResetContent();
00543
00544     for (long i = lLower; i <= lUpper; i++)
00545     {
00546       // Get this property.
00547       hRes = SafeArrayGetElement(
00548         psaNames,
00549         &i,
00550         &PropName);
00551       if (SUCCEEDED(hRes))
00552       {
00553         // Format: name (type) ==> value
00554         CString sProp = CString(PropName) + _T(" (");
00555
00556         VARIANT pVal;
00557         VariantClear(&pVal);
00558
00559         // Get qualifier set for this property.
00560         // Note that system properties have no qualifier set.
00561         IWbemQualifierSet *pQualSet = NULL;
00562
00563         hRes = pDisk->GetPropertyQualifierSet(
00564           PropName,   // name of property
00565           &pQualSet);   // qualifier set pointer
00566
00567         if (SUCCEEDED(hRes))
00568         {
00569           hRes = pQualSet->Get(
00570             cimType,  // property name
00571             0L,
00572             &pVal,    // output to this variant
00573             NULL);
00574
00575           if (SUCCEEDED(hRes))
00576           {
00577              sProp += V_BSTR(&pVal);
00578           }
00579         }
00580         sProp += _T(")");
00581         m_outputList.AddString(sProp);
00582       }
00583       SysFreeString(PropName);
00584
00585     }
00586     SafeArrayDestroy(psaNames);
00587   }
00588   pDisk->Release();
00589 }
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/cData.h Source File

  • Web
  • NetMeeting
  • NMUI

cData.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       CDATA.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 //****************************************************************************
00017 //
00018 // CLASS CDataNotify
00019 //
00020 //****************************************************************************
00021
00022 class CDataNotify : public RefCount, public CNotify, public INmChannelDataNotify
00023 {
00024 public:
00025   CDataNotify();
00026   ~CDataNotify();
00027
00028   // INmChannelDataNotify
00029   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00030   HRESULT STDMETHODCALLTYPE MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember * pMember);
00031   HRESULT STDMETHODCALLTYPE DataSent(INmMember *pMember, ULONG uSize, LPBYTE pb);
00032   HRESULT STDMETHODCALLTYPE DataReceived(INmMember *pMember, ULONG uSize, LPBYTE pb, ULONG dwFlags);
00033
00034   // ICNotify methods
00035   HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00036   HRESULT STDMETHODCALLTYPE Disconnect(void);
00037
00038   // IUnknown methods
00039   ULONG STDMETHODCALLTYPE AddRef(void);
00040   ULONG STDMETHODCALLTYPE Release(void);
00041   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
00042 };
00043
00044
00045 //****************************************************************************
00046 //
00047 // Global Variables
00048 //
00049 //****************************************************************************
00050
00051 extern INmChannelData * g_pChannelData;
00052 extern CDataNotify    * g_pNotifyData;
00053
00054
00055 //****************************************************************************
00056 //
00057 // Global Routines
00058 //
00059 //****************************************************************************
00060
00061 HRESULT HookData(INmChannel * pData);
00062 VOID DoCreateDataChannel(INmConference *pConference);
00063 VOID FreeDataChannel(void);
00064
00065
00066 //****************************************************************************
00067 //
00068 // msgType values
00069 //
00070 //****************************************************************************
00071
00072 #define MSG_SENT 1
00073 #define MSG_RECEIVED 2
00074 VOID DisplayChatMsg(INmMember * pMember, PTCHAR pszMsg, int msgType, DWORD dwFlags = 0);
00075 VOID DoSendChatMsg(LPTSTR psz, INmMember * pMember);
00076 VOID DoActivateDataChannel(BOOL fActive);
00077
00078 #ifdef NMUI_CHAT_PROTOCOL
00079 #define CB_NMUI_HDR   8     // NmUI chat protocol has an 8 byte header
00080 #endif
00081
00082
00083
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/CeDebug.Cpp Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

CeDebug.Cpp

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 //  File:   cedebug.cpp
00007 //
00008 //  Contents: Debug support
00009 //
00010 //----------------------------------------------------------------------------
00011
00012 #include <pch.cpp>
00013
00014 #pragma hdrstop
00015
00016 #include <stdio.h>
00017 #include <stdarg.h>
00018
00019
00020 //+-------------------------------------------------------------------------
00021 //
00022 //  Function:  ceDbgPrintf
00023 //
00024 //  Synopsis:  outputs debug info to stdout and debugger
00025 //
00026 //  Returns:   number of chars output
00027 //
00028 //--------------------------------------------------------------------------
00029
00030 int WINAPIV
00031 ceDbgPrintf(
00032     IN BOOL fDebug,
00033     IN LPCSTR lpFmt,
00034     ...)
00035 {
00036     va_list arglist;
00037     CHAR ach[4096];
00038     int cch = 0;
00039     HANDLE hStdOut;
00040     DWORD dwErr;
00041
00042     dwErr = GetLastError();
00043     if (fDebug)
00044     {
00045   _try
00046   {
00047       va_start(arglist, lpFmt);
00048       cch = _vsnprintf(ach, sizeof(ach), lpFmt, arglist);
00049       va_end(arglist);
00050
00051       if (0 > cch)
00052       {
00053     strcpy(&ach[sizeof(ach) - 5], "...\n");
00054       }
00055
00056       if (!IsDebuggerPresent())
00057       {
00058     hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
00059     if (hStdOut != INVALID_HANDLE_VALUE)
00060     {
00061         fputs(ach, stdout);
00062         fflush(stdout);
00063     }
00064       }
00065       OutputDebugStringA(ach);
00066   }
00067   _except(EXCEPTION_EXECUTE_HANDLER)
00068   {
00069       // return failure
00070       cch = 0;
00071   }
00072     }
00073     SetLastError(dwErr);
00074     return(cch);
00075 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/mwclass.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

mwclass.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       mwclass.h
00007 //
00008 //  Contents:   definition of the main window class
00009 //
00010 //  Classes:    CMainWindow
00011 //
00012 //  Functions:  Exists
00013 //
00014 //  History:    6-08-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #ifndef __MWCLASS_H__
00019 #define __MWCLASS_H__
00020
00021 #include <cwindow.h>
00022 #include <commdlg.h>
00023
00024 #ifdef __cplusplus
00025
00026 int Exists(TCHAR *sz);
00027
00028
00029 // List Box Element Structure
00030 struct TAG_LISTBOXELEMENT
00031 {
00032 #define LBE_STORAGE     STGTY_STORAGE
00033 #define LBE_STREAM      STGTY_STREAM
00034     unsigned uType;
00035     BOOL fOpen;
00036     void * pInterface;
00037     union {
00038         ULONG nChildren;
00039         HWND hwndView;
00040     };
00041     unsigned uIndent;
00042     LPOLESTR pwcsName;
00043 };
00044 typedef struct TAG_LISTBOXELEMENT LISTBOXELEMENT;
00045
00046 //+---------------------------------------------------------------------------
00047 //
00048 //  Class:      CMainWindow
00049 //
00050 //  Purpose:    Code for the main docfile viewer window and the main menu.
00051 //
00052 //  Interface:  CMainWindow          -- constructor
00053 //              InitInstance         -- instantiates the docfile viewer window
00054 //              Toggle               -- toggles a selection
00055 //              Expand               -- expands a selection
00056 //              Collapse             -- collapses a selection
00057 //              ExpandAll            -- expands an entire tree
00058 //              OpenFile             -- trys to load the docfile in _szFileName
00059 //
00060 //  History:    6-27-94   stevebl   Created
00061 //
00062 //  Notes:      only the public interface is listed here
00063 //
00064 //----------------------------------------------------------------------------
00065
00066 class CMainWindow: public CHlprWindow
00067 {
00068 public:
00069     CMainWindow();
00070     BOOL InitInstance(HINSTANCE, int);
00071     void Toggle(LONG_PTR lIndex);
00072     void Expand(LONG_PTR lIndex);
00073     void Collapse(LONG_PTR lIndex);
00074     void ExpandAll(LONG_PTR lIndex);
00075     void OpenFile(void);
00076     TCHAR _szFileName[MAX_PATH];
00077 protected:
00078     ~CMainWindow();
00079     LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00080 private:
00081     LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00082     LISTBOXELEMENT * CreateStreamElement(IStream * pstm);
00083     LISTBOXELEMENT * CreateStorageElement(IStorage * pstg);
00084     void DeleteElement(LISTBOXELEMENT * plbe);
00085     BOOL LoadBitmaps(void);
00086
00087     HWND _hlb;
00088     HBITMAP _hbmpStorage;
00089     HBITMAP _hbmpStream;
00090     COLORREF _crTextHigh;
00091     COLORREF _crBkHigh;
00092     COLORREF _crTextNorm;
00093     COLORREF _crBkNorm;
00094     WORD _wWidth;
00095     OPENFILENAME _ofnFile;
00096     TCHAR _szFileTitle[MAX_PATH];
00097     TEXTMETRIC _tm;
00098     UINT _cyBitmap;
00099     TCHAR _szHelpFile[MAX_PATH];
00100 };
00101
00102 #endif // __cplusplus
00103
00104 #endif // __MWCLASS_H__
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows2000/CertXSam.Cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows2000

CertXSam.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        certcli.cpp
00007 //
00008 // Contents:    Cert Server Exit Module implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013
00014 #pragma hdrstop
00015
00016 #include "celibw2k.h"
00017 #include "exit.h"
00018 #include "module.h"
00019
00020 CComModule _Module;
00021
00022 BEGIN_OBJECT_MAP(ObjectMap)
00023     OBJECT_ENTRY(CLSID_CCertExitSample, CCertExitSample)
00024     OBJECT_ENTRY(CLSID_CCertManageExitModuleSample, CCertManageExitModuleSample)
00025 END_OBJECT_MAP()
00026
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // DLL Entry Point
00030
00031 extern "C"
00032 BOOL WINAPI
00033 DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00034 {
00035     switch (dwReason)
00036     {
00037   case DLL_PROCESS_ATTACH:
00038       _Module.Init(ObjectMap, hInstance);
00039       DisableThreadLibraryCalls(hInstance);
00040       break;
00041
00042         case DLL_PROCESS_DETACH:
00043       _Module.Term();
00044             break;
00045     }
00046     return(TRUE);    // ok
00047 }
00048
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // Used to determine whether the DLL can be unloaded by OLE
00052
00053 STDAPI
00054 DllCanUnloadNow(void)
00055 {
00056     return(_Module.GetLockCount() == 0? S_OK : S_FALSE);
00057 }
00058
00059
00060 /////////////////////////////////////////////////////////////////////////////
00061 // Returns a class factory to create an object of the requested type
00062
00063 STDAPI
00064 DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00065 {
00066     return(_Module.GetClassObject(rclsid, riid, ppv));
00067 }
00068
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 // DllRegisterServer - Adds entries to the system registry
00072
00073 STDAPI
00074 DllRegisterServer(void)
00075 {
00076     // registers object, typelib and all interfaces in typelib
00077     return(_Module.RegisterServer(TRUE));
00078 }
00079
00080
00081 /////////////////////////////////////////////////////////////////////////////
00082 // DllUnregisterServer - Removes entries from the system registry
00083
00084 STDAPI
00085 DllUnregisterServer(void)
00086 {
00087     _Module.UnregisterServer();
00088     return(S_OK);
00089 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/SmartCardAPI/SCIntro/SCIntro.Cpp Source File

  • Security
  • SmartCard
  • SmartCardAPI
  • SCIntro

SCIntro.Cpp

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Module:      SCIntro.cpp
00010
00011  Abstract:    Main program of SCIntro sample for Smart Card SDK sample. See
00012               ReadMe.txt for more detail information about this sample.
00013
00014  Environment: Win32 console, C++ w/SEH, UNICODE ready.
00015
00016 ------------------------------------------------------------------------------*/
00017
00018 ////////////////////
00019 //
00020 // INCLUDE
00021 //
00022
00023 #include <tchar.h>
00024 #include <stdio.h>
00025 #include <windows.h>
00026 #include <winscard.h>
00027
00028
00029 ///////////////
00030 //
00031 // Prototype
00032 //
00033
00034 LONG IntroduceReaderGroup(IN SCARDCONTEXT hContext, OUT LPTSTR  lpszReaderGroup, IN DWORD cchReaderGroup);
00035 LONG AddReadersToGroup   (IN SCARDCONTEXT hContext, IN  LPCTSTR lpszReaderGroup);
00036 LONG IntroduceCardType   (IN SCARDCONTEXT hContext, IN  LPCTSTR lpszCardName);
00037
00038 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00039
00040  Function : _tmain
00041
00042  Synopsis : Entry point of SCIntro.
00043
00044  Parameter: Standard ANSI C command line parameters.
00045
00046  Return   : SCARD_S_SUCCESS or error code
00047
00048 ------------------------------------------------------------------------------*/
00049
00050 extern "C" int __cdecl
00051 _tmain (int argc, _TCHAR  * argv[])
00052 {
00053     LONG lResult;
00054     _TCHAR szReaderGroup[_MAX_PATH];
00055     SCARDCONTEXT hContext = NULL;
00056
00057     __try
00058     {
00059         //
00060         // Establish context with the resource manager.
00061         //
00062         lResult = SCardEstablishContext(SCARD_SCOPE_USER,
00063                                         NULL,
00064                                         NULL,
00065                                         &hContext);
00066         if (lResult != SCARD_S_SUCCESS)
00067         {
00068             __leave;
00069         }
00070
00071         //
00072         // Introduce reader group to the system.
00073         //
00074         lResult = IntroduceReaderGroup(hContext, szReaderGroup, sizeof(szReaderGroup) / sizeof(szReaderGroup[0]));
00075         if (lResult != SCARD_S_SUCCESS)
00076         {
00077             __leave;
00078         }
00079
00080         //
00081         // Prompt user to select reader(s) to be added to the reader group.
00082         //
00083         lResult = AddReadersToGroup(hContext, szReaderGroup);
00084         if (lResult != SCARD_S_SUCCESS)
00085         {
00086             __leave;
00087         }
00088
00089         //
00090         // Promt user to select card(s) to be added to the system.
00091         //
00092         lResult = IntroduceCardType(hContext, szReaderGroup);
00093         if (lResult != SCARD_S_SUCCESS)
00094         {
00095             __leave;
00096         }
00097     }
00098
00099     __finally
00100     {
00101         //
00102         // Don't forget to release the context handle if established.
00103         //
00104         if (hContext != NULL)
00105         {
00106             LONG lReturn = SCardReleaseContext(hContext);
00107
00108             //
00109             // If successful so far, then capture return code of
00110             // SCardReleaseContext(); otherwise, don't bother
00111             //
00112             if (lResult == SCARD_S_SUCCESS)
00113             {
00114                 lResult = lReturn;
00115             }
00116         }
00117     }
00118
00119     //
00120     // Inform user if an error had occurred.
00121     //
00122     if (lResult != SCARD_S_SUCCESS)
00123     {
00124         _tprintf(_T("\nError [0x%lx]: Program terminated abnormally.\n"),
00125                  lResult);
00126     }
00127
00128     return((int) lResult);
00129 }
00130
00131
00132 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00133
00134  Function : IntroduceReaderGroup
00135
00136  Synopsis : Prompt user to type in a reader group name to be introduced to the
00137             smart card sub-system.
00138
00139  Parameter: - IN SCARDCONTEXT hContext
00140
00141               Resource manager context returned by SCardEstablishContext(), or
00142               NULL if the query is not directed towards a specific context.
00143
00144             - OUT LPTSTR lpszReaderGroup
00145
00146               Pointer to reader group name to be assigned to the new reader
00147               group.
00148
00149             - IN DWORD cchReaderGroup
00150
00151               # of chars that can fit in lpszReaderGroup.
00152
00153  Return   : SCARD_S_SUCCESS or error code
00154
00155 ------------------------------------------------------------------------------*/
00156
00157 LONG IntroduceReaderGroup (IN SCARDCONTEXT hContext,
00158                            OUT LPTSTR lpszReaderGroup,
00159                IN DWORD cchReaderGroup)
00160 {
00161     LONG   lResult         = SCARD_S_SUCCESS;
00162     LPTSTR lpmszGroupNames = NULL;
00163
00164     //
00165     // Parameter check
00166     //
00167     if (lpszReaderGroup == NULL)
00168     {
00169         return SCARD_E_INVALID_PARAMETER;
00170     }
00171
00172     //
00173     // Print header.
00174     //
00175     _tprintf(_T("\n"));
00176     _tprintf(_T("Introduce Reader Group\n"));
00177     _tprintf(_T("======================\n"));
00178     _tprintf(_T("\n"));
00179
00180     //
00181     // Prompt user for a new reader group name.
00182     //
00183     _tprintf(_T("Type in a new reader group name: "));
00184
00185   *lpszReaderGroup = 0;
00186     _fgetts(lpszReaderGroup, cchReaderGroup, stdin);
00187
00188     _tprintf(_T("\n"));
00189
00190     if (lstrlen(lpszReaderGroup) == 0)
00191     {
00192         return SCARD_E_INVALID_VALUE;
00193     }
00194
00195     __try
00196     {
00197         //
00198         // First make sure the reader group does not exist.
00199         //
00200         DWORD dwAutoAllocate = SCARD_AUTOALLOCATE;
00201
00202         lResult = SCardListReaderGroups(hContext,
00203                                         (LPTSTR) &lpmszGroupNames,
00204                                         &dwAutoAllocate);
00205         if (lResult != SCARD_S_SUCCESS)
00206         {
00207             __leave;
00208         }
00209
00210         for (LPTSTR lpszGroupName = lpmszGroupNames;
00211             *lpszGroupName != _T('\0');
00212             lpszGroupName += lstrlen(lpszGroupName) + 1)
00213         {
00214             //
00215             // All smart card component names are case insensitive.
00216             //
00217             if (lstrcmpi(lpszGroupName, lpszReaderGroup) == 0)
00218             {
00219                 break;
00220             }
00221         }
00222
00223         //
00224         // Introduce the group, if not already exists
00225         //
00226         if (*lpszGroupName == _T('\0'))
00227         {
00228             lResult = SCardIntroduceReaderGroup(hContext, lpszReaderGroup);
00229             if (lResult != SCARD_S_SUCCESS)
00230             {
00231                 __leave;
00232             }
00233
00234             _tprintf(_T("Reader group [%s] successfully added.\n\n"),
00235                      lpszReaderGroup);
00236         }
00237         else
00238         {
00239             _tprintf(_T("Reader group [%s] already exists.\n\n"), lpszReaderGroup);
00240         }
00241     }
00242
00243     __finally
00244     {
00245         LONG lReturn;
00246
00247         //
00248         // Don't forget to release memory, if allocated.
00249         //
00250         if (lpmszGroupNames != NULL)
00251         {
00252             lReturn = SCardFreeMemory(hContext, (LPVOID) lpmszGroupNames);
00253
00254             //
00255             // If successful so far, then capture return code of
00256             // SCardFreeMemory(); otherwise, don't bother.
00257             //
00258             if (lResult == SCARD_S_SUCCESS)
00259             {
00260                 lResult = lReturn;
00261             }
00262         }
00263     }
00264
00265     return lResult;
00266 }
00267
00268
00269 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00270
00271  Function : AddReadersToGroup
00272
00273  Synopsis : Prompt user to select one or more readers to be added to the
00274             specified reader group.
00275
00276  Parameter: - IN SCARDCONTEXT hContext
00277
00278               Resource manager context returned by SCardEstablishContext(), or
00279               NULL if the query is not directed towards a specific context.
00280
00281             - IN LPCTSTR lpszReaderGroup
00282
00283               Pointer to reader group name for which reader(s) will be added.
00284
00285  Return   : SCARD_S_SUCCESS or error code
00286
00287 ------------------------------------------------------------------------------*/
00288
00289 LONG AddReadersToGroup (IN SCARDCONTEXT hContext,
00290                         IN LPCTSTR lpszReaderGroup)
00291 {
00292     LONG   lResult           = SCARD_S_SUCCESS;
00293     LPTSTR lpmszReaderNames  = NULL;
00294     LPTSTR lpmszGroupReaders = NULL;
00295
00296     //
00297     // Parameter check
00298     //
00299     if (lpszReaderGroup == NULL || *lpszReaderGroup == NULL)
00300     {
00301         return SCARD_E_INVALID_PARAMETER;
00302     }
00303
00304     //
00305     // Print header.
00306     //
00307     _tprintf(_T("\n"));
00308     _tprintf(_T("Add Reader(s) To Group\n"));
00309     _tprintf(_T("======================\n"));
00310     _tprintf(_T("\n"));
00311
00312     __try
00313     {
00314         //
00315         // List all readers known to the system.
00316         //
00317         DWORD dwAutoAllocate = SCARD_AUTOALLOCATE;
00318
00319         lResult = SCardListReaders(hContext,
00320                                    NULL,
00321                                    (LPTSTR) &lpmszReaderNames,
00322                                    &dwAutoAllocate);
00323         if (lResult != SCARD_S_SUCCESS)
00324         {
00325             __leave;
00326         }
00327
00328         LPTSTR readers[MAXIMUM_SMARTCARD_READERS];
00329         DWORD  dwNumReaders   = 0;
00330
00331         for (LPTSTR lpszReaderName = lpmszReaderNames;
00332             *lpszReaderName != _T('\0');
00333             lpszReaderName += lstrlen(lpszReaderName) + 1, dwNumReaders++)
00334         {
00335             readers[dwNumReaders] = lpszReaderName;
00336             _tprintf(_T("%02d: %s\n"), dwNumReaders, lpszReaderName);
00337         }
00338
00339         if (dwNumReaders == 0)
00340         {
00341             //
00342             // No registered reader found. However, we should not have gotten so
00343             // far to here, because no reader situation should have been caught
00344             // by the above SCardListReaders() call with an erro code of
00345             // SCARD_E_NO_READERS_AVAILABLE.
00346             //
00347             // Note: Introduction of reader to the system is normally handled
00348             //       by the setup program provided by vendor.
00349             //
00350             lResult = SCARD_E_NO_READERS_AVAILABLE;
00351             __leave;
00352         }
00353
00354         //
00355         // Prompt user to select reader(s) to be added to this reader group.
00356         // Note: The input format is very primitive. It expects one or more
00357         //       reader numbers (listed to the left of the reader name) to be
00358         //       entered and separated by space.
00359         //
00360         _tprintf(_T("Select above reader(s) to be added to this reader group: "));
00361
00362         _TCHAR SelectedReaders[MAXIMUM_SMARTCARD_READERS * 4] = {_T('\0')};;
00363
00364         _fgetts(SelectedReaders, sizeof(SelectedReaders) / sizeof(SelectedReaders[0]), stdin);
00365
00366         _tprintf(_T("\n"));
00367
00368         //
00369         // For each reader selected, add the reader only if the reader
00370         // is not already in this reader group.
00371         //
00372         dwAutoAllocate = SCARD_AUTOALLOCATE;
00373
00374         lResult = SCardListReaders(hContext,
00375                                    lpszReaderGroup,
00376                                    (LPTSTR) &lpmszGroupReaders,
00377                                    &dwAutoAllocate);
00378         if (lResult != SCARD_S_SUCCESS)
00379         {
00380             //
00381             // If no reader in group, treat it as successful.
00382             //
00383             if (lResult != SCARD_E_NO_READERS_AVAILABLE)
00384             {
00385                 __leave;
00386             }
00387
00388             lResult = SCARD_S_SUCCESS;
00389         }
00390
00391         LPTSTR reader = _tcstok(SelectedReaders, _T(" \n"));
00392
00393         while (reader != NULL && lResult == SCARD_S_SUCCESS)
00394         {
00395             //
00396             // Make sure selection is valid.
00397             //
00398             DWORD nReader = (DWORD) _ttoi(reader);
00399
00400             if (nReader < dwNumReaders)
00401             {
00402                 LPTSTR lpszGroupReader = NULL;
00403
00404                 //
00405                 // Make sure reader is not already in this reader group.
00406                 //
00407                 if (lpmszGroupReaders != NULL)
00408                 {
00409                     for (lpszGroupReader = lpmszGroupReaders;
00410                         *lpszGroupReader != _T('\0');
00411                         lpszGroupReader += lstrlen(lpszGroupReader) + 1)
00412                     {
00413                         //
00414                         // All smart card component names are case insensitive.
00415                         //
00416                         if (lstrcmpi(lpszGroupReader, readers[nReader]) == 0)
00417                         {
00418                             break;
00419                         }
00420                     }
00421                 }
00422
00423                 //
00424                 // Only add if reader not already in this reader group.
00425                 //
00426                 if (lpszGroupReader == NULL || *lpszGroupReader == _T('\0'))
00427                 {
00428                     lResult = SCardAddReaderToGroup(hContext,
00429                                                     readers[nReader],
00430                                                     lpszReaderGroup);
00431                     if (lResult != SCARD_S_SUCCESS)
00432                     {
00433                         __leave;
00434                     }
00435
00436                     _tprintf(_T("Reader [%s] is successfully added to "
00437                                 _T("this reader group.\n")), readers[nReader]);
00438                 }
00439                 else
00440                 {
00441                     _tprintf(_T("Reader [%s] already exists in this "
00442                                 _T("reader group.\n")), readers[nReader]);
00443                 }
00444             }
00445
00446             //
00447             // Next reader.
00448             //
00449             reader = _tcstok(NULL, _T(" \n"));
00450         }
00451     }
00452
00453     __finally
00454     {
00455         LONG lReturn;
00456
00457         //
00458         // Don't forget to release memory, if allocated.
00459         //
00460         if (lpmszGroupReaders != NULL)
00461         {
00462             lReturn = SCardFreeMemory(hContext,
00463                                       (LPVOID) lpmszGroupReaders);
00464
00465             //
00466             // If successful so far, then capture return code of
00467             // SCardFreeMemory(); otherwise, don't bother.
00468             //
00469             if (lResult == SCARD_S_SUCCESS)
00470             {
00471                 lResult = lReturn;
00472             }
00473         }
00474
00475         if (lpmszReaderNames != NULL)
00476         {
00477             lReturn = SCardFreeMemory(hContext, (LPVOID) lpmszReaderNames);
00478
00479             //
00480             // If successful so far, then capture return code of
00481             // SCardFreeMemory(); otherwise, don't bother.
00482             //
00483             if (lResult == SCARD_S_SUCCESS)
00484             {
00485                 lResult = lReturn;
00486             }
00487         }
00488     }
00489
00490     return lResult;
00491 }
00492
00493
00494 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00495
00496  Function : IntroduceCardType
00497
00498  Synopsis : Prompt user to insert card into reader(s) of a specified reader
00499             group, and introduce any card found in the selected reader(s) to
00500             the system.
00501
00502  Parameter: - IN SCARDCONTEXT hContext
00503
00504               Resource manager context returned by SCardEstablishContext(), or
00505               NULL if the query is not directed towards a specific context.
00506
00507             - IN LPCTSTR lpszReaderGroup
00508
00509               Pointer to reader group name for which the readers should be
00510               checked for present of card to be introduced.
00511
00512  Return   : SCARD_S_SUCCESS or error code
00513
00514  Remarks  : Card is normally introduced to the system by software provided by
00515             the card manufacturer. Normally, during introduction of card, a SSP
00516             and/or CSP is also specified. For simplicity, no SSP and/or CSP is
00517             specified in this example.
00518
00519 ------------------------------------------------------------------------------*/
00520
00521 LONG IntroduceCardType (IN SCARDCONTEXT hContext,
00522                         IN LPCTSTR lpszReaderGroup)
00523 {
00524     LONG   lResult          = SCARD_S_SUCCESS;
00525     LPTSTR lpmszReaderNames = NULL;
00526     LPTSTR lpmszCardNames   = NULL;
00527
00528     //
00529     // Print header.
00530     //
00531     _tprintf(_T("\n"));
00532     _tprintf(_T("Introduce Card Type\n"));
00533     _tprintf(_T("===================\n"));
00534     _tprintf(_T("\n"));
00535
00536     //
00537     // Parameter check
00538     //
00539     if (lpszReaderGroup == NULL || *lpszReaderGroup == NULL)
00540     {
00541         return SCARD_E_INVALID_PARAMETER;
00542     }
00543
00544     __try
00545     {
00546         //
00547         // List all readers in the specified group.
00548         //
00549         DWORD dwAutoAllocate = SCARD_AUTOALLOCATE;
00550
00551         lResult = SCardListReaders(hContext,
00552                                    lpszReaderGroup,
00553                                    (LPTSTR) &lpmszReaderNames,
00554                                    &dwAutoAllocate);
00555         if (lResult != SCARD_S_SUCCESS)
00556         {
00557             __leave;
00558         }
00559
00560         //
00561         // Note that MAXIMUM_SMARTCARD_READERS (10) only refers to maximum # of
00562         // non-PnP readers. The resource manager is capable of handling any number
00563         // of PnP readers, in addition to the 10 non-PnP readers (your physical
00564         // system is the limiting factor).
00565         //
00566
00567         LPTSTR readers[MAXIMUM_SMARTCARD_READERS];
00568         DWORD  dwNumReaders = 0;
00569
00570         for (LPTSTR lpszReaderName = lpmszReaderNames;
00571             *lpszReaderName != _T('\0') &&
00572             dwNumReaders < MAXIMUM_SMARTCARD_READERS;
00573             lpszReaderName += lstrlen(lpszReaderName) + 1, dwNumReaders++)
00574         {
00575             readers[dwNumReaders] = lpszReaderName;
00576         }
00577
00578         if (dwNumReaders == 0)
00579         {
00580             //
00581             // No registered reader found. However, we should not have gotten so
00582             // far to here, because no reader situation should have been caught
00583             // by the above SCardListReaders() call with an erro code of
00584             // SCARD_E_NO_READERS_AVAILABLE.
00585             //
00586             // Note: Introduction of reader to the system is normally handled
00587             //       by the setup program provided by vendor.
00588             //
00589             lResult = SCARD_E_NO_READERS_AVAILABLE;
00590             __leave;
00591         }
00592
00593         //
00594         // List all cards known to the system.
00595         //
00596         dwAutoAllocate = SCARD_AUTOALLOCATE;
00597
00598         lResult = SCardListCards(hContext,
00599                                  NULL,
00600                                  NULL,
00601                                  0,
00602                                  (LPTSTR) &lpmszCardNames,
00603                                  &dwAutoAllocate);
00604         if (lResult != SCARD_S_SUCCESS)
00605         {
00606             __leave;
00607         }
00608
00609         while (TRUE)
00610         {
00611             //
00612             // Prompt user to select reader for which the card to be introduced
00613             // resides.
00614             // Note: For simplicity, the input format is very primitive. If the
00615             //       user should type something longer than the input buffer
00616             //       length, the program could crash.
00617             //
00618             for (DWORD i = 0; i < dwNumReaders; i++)
00619             {
00620                 _tprintf(_T("%02d: %s\n"), i, readers[i]);
00621             }
00622
00623             _TCHAR SelectedReader[80] = {_T('\0')};
00624
00625             _tprintf(_T("Select reader where the card is [x to exit]: "));
00626
00627             _fgetts(SelectedReader, sizeof(SelectedReader) / sizeof(SelectedReader[0]), stdin);
00628
00629             _tprintf(_T("\n"));
00630
00631             //
00632             // Make sure selection is valid.
00633             //
00634             if (_toupper(SelectedReader[0]) == _T('X'))
00635             {
00636                 break;
00637             }
00638
00639             DWORD nReader = (DWORD) _ttoi(SelectedReader);
00640
00641             if (nReader < dwNumReaders)
00642             {
00643                 _TCHAR szCardName[_MAX_PATH] = {_T('\0')};
00644
00645                 //
00646                 // Prompt user for the card friendly name.
00647                 //
00648                 _tprintf(_T("Type in card name: "));
00649
00650                 _fgetts(szCardName, sizeof(szCardName) / sizeof(szCardName[0]), stdin);
00651
00652                 _tprintf(_T("\n"));
00653
00654                 //
00655                 // Make sure card name is valid.
00656                 //
00657                 if (lstrlen(szCardName))
00658                 {
00659                     //
00660                     // Make sure card name does not already exist.
00661                     //
00662                     for (LPTSTR lpszCardName = lpmszCardNames;
00663                         *lpszCardName != _T('\0');
00664                         lpszCardName += lstrlen(lpszCardName) + 1)
00665                     {
00666                         //
00667                         // All smart card component names are case insensitive.
00668                         //
00669                         if (lstrcmpi(lpszCardName, szCardName) == 0)
00670                         {
00671                             break;
00672                         }
00673                     }
00674
00675                     //
00676                     // Add card only if it does not already exist.
00677                     //
00678                     if (*lpszCardName == _T('\0'))
00679                     {
00680                         //
00681                         // See if a card is in the reader, and find out
00682                         // its ATR, if present.
00683                         //
00684                         SCARD_READERSTATE rsReader;
00685
00686                         ZeroMemory((LPVOID) &rsReader, sizeof(rsReader));
00687                         rsReader.szReader = (LPCTSTR) readers[nReader];
00688                         rsReader.dwCurrentState = SCARD_STATE_UNAWARE;
00689
00690                         lResult = SCardGetStatusChange(hContext,
00691                                                        INFINITE,
00692                                                        &rsReader,
00693                                                        1);
00694                         if (lResult != SCARD_S_SUCCESS)
00695                         {
00696                             __leave;
00697                         }
00698
00699                         //
00700                         // Is the card in the reader.
00701                         //
00702                         if ((rsReader.dwEventState & SCARD_STATE_PRESENT))
00703                         {
00704                             //
00705                             // Add the card!
00706                             //
00707                             lResult = SCardIntroduceCardType(hContext,
00708                                                              szCardName,
00709                                                              NULL,
00710                                                              NULL,
00711                                                              0,
00712                                                              rsReader.rgbAtr,
00713                                                              NULL,
00714                                                              rsReader.cbAtr );
00715                             if (lResult != SCARD_S_SUCCESS)
00716                             {
00717                                 __leave;
00718                             }
00719
00720                             _tprintf(_T("Card [%s] is successfully introduced.\n\n"),
00721                                      szCardName);
00722                         }
00723                         else
00724                         {
00725                             _tprintf(_T("No smart card found in this reader.\n"));
00726                         }
00727                     }
00728                     else
00729                     {
00730                         _tprintf(_T("Card [%s] already exists.\n"), szCardName);
00731                     }
00732                 }
00733                 else
00734                 {
00735                     _tprintf(_T("Invalid card name.\n"));
00736                 }
00737             }
00738
00739             _tprintf(_T("\n"));
00740         }
00741     }
00742
00743     __finally
00744     {
00745         LONG lReturn;
00746
00747         //
00748         // Don't forget to release memory, if allocated.
00749         //
00750         if (lpmszCardNames != NULL)
00751         {
00752             lReturn = SCardFreeMemory(hContext,
00753                                       (LPVOID) lpmszCardNames);
00754
00755             //
00756             // If successful so far, then capture return code of
00757             // SCardFreeMemory(); otherwise, don't bother.
00758             //
00759             if (lResult == SCARD_S_SUCCESS)
00760             {
00761                 lResult = lReturn;
00762             }
00763         }
00764
00765         if (lpmszReaderNames != NULL)
00766         {
00767             lReturn = SCardFreeMemory(hContext, (LPVOID) lpmszReaderNames);
00768
00769             //
00770             // If successful so far, then capture return code of
00771             // SCardFreeMemory(); otherwise, don't bother.
00772             //
00773             if (lResult == SCARD_S_SUCCESS)
00774             {
00775                 lResult = lReturn;
00776             }
00777         }
00778     }
00779
00780     return lResult;
00781 }
00782
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_LOCKED_LIST Member List

This is the complete list of members for _LOCKED_LIST, including all inherited members.
created | _LOCKED_LIST
head | _LOCKED_LIST
lock | _LOCKED_LIST
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/table.h Source File

  • Begin
  • sdkdiff

table.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010 #ifndef __TABLE_H__
00011 #define __TABLE_H__
00012
00013 /*
00014  * table.h
00015  *
00016  * public interface definition for table window class.
00017  *
00018  * include after gutils.h and commdlg.h
00019  */
00020
00021 /*
00022  * The table class communicates with its 'owner' window to
00023  * get the layout info and the data to display. The owner window handle
00024  * can be sent as the lParam in CreateWindow - if not, the parent window will
00025  * be used.
00026  *
00027  * After creating the window, send it a TM_NEWID message, with a 'data id'
00028  * as the lParam. This is any non-zero 32-bit value. The table will then call
00029  * back to its owner window to find out how many rows/columns, then to fetch
00030  * the name/properties of each column, and finally to get the data to display.
00031  *
00032  * Send TM_NEWID of 0 to close (or destroy the window) - wait for TQ_CLOSE
00033  * (in either case) before discarding data. Send
00034  * TM_REFRESH if data or row-count changes; send TM_NEWLAYOUT if column
00035  * properties or nr cols change etc - this is the same as sending TM_NEWID
00036  * except that no TQ_CLOSE happens on TM_NEWLAYOUT.
00037  *
00038  * TQ_SELECT is sent whenever the current selection changes. TQ_ENTER is sent
00039  * when enter or double-click occurs.
00040  */
00041
00042 /* -------class and message names --------------------------------------*/
00043
00044 /* create a window of this class */
00045 #define  TableClassName "GTableClass"
00046
00047
00048 /* all messages to the owner window are sent with this message.
00049  * call RegisterWindowsMessage with this string for the message UINT.
00050  */
00051 #define TableMessage  "GTableQuery"
00052
00053 /* -------- messages to and from table class  --------------------------*/
00054
00055 /* messages to owner window are:
00056  *  message:  TableMessage
00057  *  wParam:   command code (below)
00058  *  lParam:   struct pointer according to code
00059  * below is list of wParam codes & associated lParam struct
00060  */
00061 #define TQ_GETSIZE  1 /* lParam: lpTableHdr */
00062 #define TQ_GETCOLPROPS  2 /* lParam: lpColPropList */
00063 #define TQ_GETDATA  3 /* lParam: lpCellDataList */
00064 #define TQ_PUTDATA  4 /* lParam: lpCellDataList */
00065 #define TQ_SELECT 5 /* lParam: lpTableSelection */
00066 #define TQ_ENTER  6 /* lParam: lpTableSelection */
00067 #define TQ_CLOSE  7 /* lParam: the data id to be closed */
00068
00069 /* optional */
00070 #define TQ_SCROLL 8 /* lParam: the new top row nr */
00071 #define TQ_TABS         9       /* lParam: LONG *, write tab here */
00072 #define TQ_SHOWWHITESPACE  10   /* lParam: LONG *, write show_whitespace value here */
00073
00074 /* messages to Table class */
00075
00076 /* data, or nrows has changed  wParam/lParam null*/
00077 #define TM_REFRESH  (WM_USER)
00078
00079 /* nr cols/props/layout has changed  - wparam/lparam null */
00080 #define TM_NEWLAYOUT  (WM_USER+1)
00081
00082 /* close old id, and display new - wParam null, lParam has new id */
00083 #define TM_NEWID  (WM_USER+2)
00084
00085 /* select and show this area - wParam null, lParam is lpTableSelection */
00086 #define TM_SELECT (WM_USER+3)
00087
00088 /* please print current table - wParam null, lParam either null
00089  * or lpPrintContext.
00090  */
00091 #define TM_PRINT  (WM_USER+4)
00092
00093 /* return the top row in the window. If wParam is TRUE, then set
00094  * lParam to be the new toprow. top row is the number of rows scrolled down
00095  * from the top. Thus the first visible non-fixed row is toprow+fixedrows
00096  */
00097 #define TM_TOPROW (WM_USER+5)
00098
00099
00100 /* return the end row visible. This is the 0-based rownr of the last
00101  * visible row in the window
00102  */
00103 #define TM_ENDROW (WM_USER+6)
00104
00105 /* new rows have been added to the end of the table, but no other
00106  * rows or cols or properties have been changed.
00107  * wParam contains the new total nr of rows. lParam contains the id
00108  * in case this has changed.
00109  */
00110 #define TM_APPEND (WM_USER+7)
00111
00112 /*
00113  * return the current selection - lParam is a lpTableSelection
00114  */
00115 #define TM_GETSELECTION (WM_USER+8)
00116
00117 /*
00118  * set the tab width - wParam null, lParam is new tab width
00119  */
00120 #define TM_SETTABWIDTH (WM_USER+9)
00121
00122 /*-----display properties -------------------------------------------------*/
00123
00124 /*
00125  * display properties struct. can be set for whole table, for
00126  * each column, or for each cell. When looking for
00127  * a property, we search cell->column->table
00128  */
00129 typedef struct {
00130   UINT valid;   /* flags (below) for what props we set */
00131
00132 /* remaining fields only valid when corresponding flag set in valid */
00133
00134   DWORD forecolour; /* RGB colour value */
00135   DWORD forecolourws; /* ditto */
00136   DWORD backcolour; /* ditto */
00137   /* font to use - also set through WM_SETFONT. owner application
00138    * is responsible for DeleteObject call when no longer used
00139    */
00140   HFONT hFont;    /* handle to font  - caller should delete*/
00141   UINT alignment;   /* flags below */
00142   UINT box;   /* whether cell boxed (see below) */
00143
00144   /* width/height settings not valid at cell level - only table or col.*/
00145   int width;    /* pixel width of this cell/column */
00146   int height;   /* pixel cell height */
00147 } Props, FAR * lpProps;
00148
00149 /* valid flags for fields that are changed in this Props struct */
00150 #define P_FCOLOUR 0x01
00151 #define P_FCOLOURWS 0x02
00152 #define P_BCOLOUR 0x04
00153 #define P_FONT    0x08
00154 #define P_ALIGN   0x10
00155 #define P_BOX   0x20
00156 #define P_WIDTH   0x40
00157 #define P_HEIGHT  0x80
00158
00159 /* box settings  or-ed together */
00160 #define P_BOXTOP  1
00161 #define P_BOXBOTTOM 2
00162 #define P_BOXLEFT 4
00163 #define P_BOXRIGHT  8
00164 #define P_BOXALL  0xF
00165
00166 /* alignment settings (expand later to include various tab-align settings */
00167 #define P_LEFT    0
00168 #define P_RIGHT   1
00169 #define P_CENTRE  2
00170
00171 /* default tab width in chars */
00172 #define TABWIDTH_DEFAULT      8
00173
00174 /* --- main header -------------------------------------------------------*/
00175
00176 /* this struct is the master information about a table. It is
00177  * passed to the owner window with the id field filled in; fill in
00178  * all remaining fields and return.
00179  */
00180 typedef struct {
00181     DWORD_PTR id;           /* owner's data id */
00182
00183   /* please fill in rest: */
00184   long nrows;   /* how many rows ? TM_REFRESH to change */
00185   int ncols;    /* how many columns ? TM_NEWLAYOUT to chg */
00186
00187   int fixedrows;    /* for headers - usually 0 or 1 */
00188   int fixedcols;    /* for hdrs - 0 or 1 normally */
00189   BOOL fixedselectable; /* is fixed area selectable ? */
00190   BOOL hseparator;  /* is there a horz. line after fixed rows */
00191   BOOL vseparator;  /* is there a vert. line after fixed rows */
00192
00193   UINT selectmode;  /* multiple/single selection - flags below*/
00194   BOOL sendscroll;  /* TRUE if TQ_SCROLL to be sent on scrolling*/
00195
00196   Props props;
00197 } TableHdr, FAR * lpTableHdr;
00198
00199 /*
00200  * selection mode;
00201  *
00202  * choose TM_CELL or TM_ROW, and TM_SINGLE or TM_MANY, and
00203  * TM_SOLID or TM_FOCUS and or them together.
00204  *
00205  */
00206 #define TM_ROW    1 /* selectable items are rows */
00207 #define TM_CELL   0 /* selectable items are cells */
00208
00209 #define TM_MANY   2 /* multiple selects possible */
00210 #define TM_SINGLE 0 /* single item selectable at once only */
00211
00212 #define TM_SOLID  0 /* (default) use a solid black for selection*/
00213 #define TM_FOCUS  4 /* use a dotted focus rect for selection */
00214
00215
00216 /* --------- column header structs --------------------------------------*/
00217
00218 /*
00219  * this struct is sent to request column width and properties -
00220  * owner window must fill nchars and props.valid, at minimum.
00221  */
00222 typedef struct {
00223   int nchars; /* expected text width in chars */
00224   Props props;
00225 } ColProps, FAR * lpColProps;
00226
00227
00228 /* this is a set of column requests - owner should fill each one*/
00229 typedef struct {
00230     DWORD_PTR id;           /* caller's id for data */
00231   int startcol;   /* zero-based column nr of first request */
00232   int ncols;    /* nr of columns in this set */
00233   lpColProps plist; /* ptr to _array_ of ColProps */
00234 } ColPropsList, FAR * lpColPropsList;
00235
00236
00237 /* --- cell data structs ---------------------------------------------*/
00238
00239 /* this is the per-cell data struct.
00240  * When providing data (responding to TQ_GETDATA), fill out ptext[] and
00241  * props as appropriate. ptext will be pre-allocated with nchars bytes of
00242  * space. This may be larger than ColProps->nchars if the user has
00243  * stretched this column's width on screen
00244  *
00245  * don't re-alloc ptext, or change flags.
00246  */
00247 typedef struct {
00248   int nchars;   /* space in buffer */
00249   LPSTR ptext;    /* ptr to nchars of text space */
00250   Props props;    /* per-cell props */
00251   DWORD flags;    /* private table class flags */
00252   LPWSTR pwzText;   /* ptr to nchars of WCHAR space */
00253 } CellData, FAR * lpCellData;
00254
00255 /* list of cell data structures - please fill out all of these*/
00256 typedef struct {
00257         DWORD_PTR id;           /* caller's id for data */
00258   long row;   /* zero-based row nr to fetch */
00259   int startcell;    /* zero-based cell nr on this row */
00260   int ncells;   /* count of cells to fetch */
00261   lpCellData plist; /* ptr to array CellData[ncells] */
00262 } CellDataList, FAR * lpCellDataList;
00263
00264
00265 /*----- current selection----------------------------------------------*/
00266
00267 /*
00268  * describes the current selection - a rectangular selection area
00269  *
00270  * Note that if the TM_MANY selection mode is used, startrow and startcell will
00271  * be the end-point (most recently selected end) of the selection, and
00272  * nrows, ncells may be positive or negative. +1 and -1 both mean just the
00273  * 1 row startrow, -2 means startrow and the one before, etc. 0 nrows means
00274  * no valid selection.
00275  */
00276 typedef struct {
00277     DWORD_PTR id;           /* caller's id for data */
00278   long startrow;    /* zero-based row nr of start of sel. */
00279   long startcell;   /* zero-based col nr of  start of sel */
00280   long nrows;   /* vertical depth of selection */
00281   long ncells;    /* horz width of selection */
00282   long dyRowsFromTop;   /* -1 means used auto-center logic, otherwise put selection this many rows from top */
00283 } TableSelection, FAR * lpTableSelection;
00284
00285
00286
00287 /*----- print context -----------------------------------------------*/
00288
00289 /* describes the margin settings for the print job - these are in CMs*/
00290 typedef struct {
00291   int left;   /* edge of paper to start of print area */
00292   int right;    /* edge of paper to start of print area */
00293   int top;    /* edge of paper to start of hdr */
00294   int bottom;   /* end of hdr to end of paper */
00295   int topinner;   /* start of hdr to start of data */
00296   int bottominner;  /* end of data to start of hdr */
00297 } Margin, FAR * lpMargin;
00298
00299 /* position and clipping info - only used by table class
00300  */
00301 typedef struct {
00302   int start;    /* co-ord of cell start (left or top) */
00303   int clipstart;    /* start of clipping (vis area) */
00304   int clipend;    /* end of clipping (vis area) */
00305   int size;   /* pixel size of cell (width or height) */
00306 } CellPos, FAR * lpCellPos;
00307
00308
00309 /* one of these for each header lines (top and bottom) */
00310 typedef struct {
00311   CellPos xpos, ypos; /* private: for table-class use only */
00312   Props props;
00313   LPSTR ptext;
00314 } Title, FAR * lpTitle;
00315
00316 /* Print context data structure - any or all 4 pointers may be null */
00317 typedef struct {
00318         DWORD_PTR id;           /* id of table to print */
00319   lpTitle head;
00320   lpTitle foot;
00321   lpMargin margin;
00322   PRINTDLG FAR * pd;
00323 } PrintContext, FAR * lpPrintContext;
00324
00325 #endif
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/MqApiTst.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

MqApiTst.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // Mqapitest.cpp : Defines the class behaviors for the application.
00013
00014
00015
00016
00017 #include "stdafx.h"
00018 #include "MQApitst.h"
00019
00020 #include "MainFrm.h"
00021 #include "testDoc.h"
00022 #include "testView.h"
00023 #include "mq.h"
00024
00025 #ifdef _DEBUG
00026 #define new DEBUG_NEW
00027 #undef THIS_FILE
00028 static char THIS_FILE[] = __FILE__;
00029 #endif
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // CTestApp
00033
00034 BEGIN_MESSAGE_MAP(CTestApp, CWinApp)
00035   //{{AFX_MSG_MAP(CTestApp)
00036   ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00037     // NOTE - the ClassWizard will add and remove mapping macros here.
00038     //    DO NOT EDIT what you see in these blocks of generated code!
00039   //}}AFX_MSG_MAP
00040   // Standard file based document commands
00041   ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
00042   ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00043 END_MESSAGE_MAP()
00044
00045 /////////////////////////////////////////////////////////////////////////////
00046 // CTestApp construction
00047
00048 CTestApp::CTestApp()
00049 {
00050   // TODO: Add construction code here.
00051   // Place all significant initialization in InitInstance.
00052 }
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // The one and only CTestApp object
00056
00057 CTestApp theApp;
00058
00059 /////////////////////////////////////////////////////////////////////////////
00060 // CTestApp initialization
00061
00062 BOOL CTestApp::InitInstance()
00063 {
00064     //
00065     // This application should only be used when the computer is enabled to
00066   // access the directory service (DS-enabled). In workgroup (DS-disabled) mode,
00067   // we should stop execution.
00068     //
00069     if (!IsDsEnabledLocaly())
00070     {
00071         ::MessageBox(NULL,_T("This application is not designed to run in workgroup (DS-disabled) mode."), NULL,MB_OK);
00072         exit(0);
00073     }
00074     //
00075   // Standard initialization.
00076   // If you are not using these features and wish to reduce the size
00077   // of your final executable, remove the specific initialization routines
00078   // that you do not need from the following.
00079
00080 #ifdef _AFXDLL
00081   Enable3dControls();     // Call this function when using MFC in a shared DLL.
00082 #else
00083   Enable3dControlsStatic(); // Call this function when linking to MFC statically.
00084 #endif
00085
00086   LoadStdProfileSettings();  // Load standard INI file options (including MRU).
00087
00088   // Register the application's document templates. Document templates
00089   // serve as the connection between documents, frame windows, and views.
00090
00091   CSingleDocTemplate* pDocTemplate;
00092   pDocTemplate = new CSingleDocTemplate(
00093     IDR_MAINFRAME,
00094     RUNTIME_CLASS(CTestDoc),
00095     RUNTIME_CLASS(CMainFrame),       // main SDI frame window
00096     RUNTIME_CLASS(CTestView));
00097   AddDocTemplate(pDocTemplate);
00098
00099   // Parse command line for standard shell commands, DDE, and open file.
00100   CCommandLineInfo cmdInfo;
00101   ParseCommandLine(cmdInfo);
00102
00103   // Dispatch commands specified on the command line.
00104   if (!ProcessShellCommand(cmdInfo))
00105     return FALSE;
00106
00107   return TRUE;
00108 }
00109
00110 /////////////////////////////////////////////////////////////////////////////
00111 // CAboutDlg dialog box used for App About
00112
00113 class CAboutDlg : public CDialog
00114 {
00115 public:
00116   CAboutDlg();
00117
00118 // Dialog Data
00119   //{{AFX_DATA(CAboutDlg)
00120   enum { IDD = IDD_ABOUTBOX };
00121   //}}AFX_DATA
00122
00123   // ClassWizard generated virtual function overrides
00124   //{{AFX_VIRTUAL(CAboutDlg)
00125   protected:
00126   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00127   //}}AFX_VIRTUAL
00128
00129 // Implementation
00130 protected:
00131   //{{AFX_MSG(CAboutDlg)
00132     // No message handlers
00133   //}}AFX_MSG
00134   DECLARE_MESSAGE_MAP()
00135 };
00136
00137 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00138 {
00139   //{{AFX_DATA_INIT(CAboutDlg)
00140   //}}AFX_DATA_INIT
00141 }
00142
00143 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00144 {
00145   CDialog::DoDataExchange(pDX);
00146   //{{AFX_DATA_MAP(CAboutDlg)
00147   //}}AFX_DATA_MAP
00148 }
00149
00150 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00151   //{{AFX_MSG_MAP(CAboutDlg)
00152     // No message handlers
00153   //}}AFX_MSG_MAP
00154 END_MESSAGE_MAP()
00155
00156 // Application command for running the dialog box
00157 void CTestApp::OnAppAbout()
00158 {
00159   CAboutDlg aboutDlg;
00160   aboutDlg.DoModal();
00161 }
00162
00163 /////////////////////////////////////////////////////////////////////////////
00164 // CTestApp commands
00165
00166
00167 //
00168 // Pointer to hold the main window pointer.
00169 //
00170 CWnd* pMainView;
00171
00172 extern "C" void  PrintToScreen(const TCHAR * Format, ...)
00173 {
00174
00175
00176    TCHAR szText[500];
00177    va_list l;
00178    static len = 0;
00179
00180
00181     // Format the string.
00182     va_start(l, Format);
00183 #ifdef UNICODE
00184     if(_vsnwprintf(szText, 499, Format, l) < 0)
00185   {
00186     ::MessageBox(NULL,_T("The text is too long for the text buffer. Exiting...\n"),NULL,MB_OK);
00187     exit(1);
00188   }
00189
00190   szText[(sizeof(szText)/sizeof(szText[0])) - 1] = L'\0';
00191
00192 #else
00193     if (_vsnprintf(szText,499, Format, l) <0)
00194   {
00195     ::MessageBox(NULL,"The text is too long for the text buffer. Exiting...\n",NULL,MB_OK);
00196     exit(1);
00197   }
00198
00199   szText[(sizeof(szText)/sizeof(szText[0])) - 1] = '\0';
00200
00201 #endif
00202
00203
00204     CEdit& rfMainEdit = ((CTestView*)pMainView)->GetEditCtrl();
00205
00206   int i = rfMainEdit.GetLineCount();
00207
00208   ((CTestView*)pMainView)->GetEditCtrl().SetSel(INT_MAX,INT_MAX);
00209   ((CTestView*)pMainView)->GetEditCtrl().ReplaceSel(szText);
00210   ((CTestView*)pMainView)->GetEditCtrl().ReplaceSel(TEXT("\r\n"));
00211   len += lstrlen(szText) + 2;
00212   ((CTestView*)pMainView)->GetDocument()->SetModifiedFlag(FALSE);
00213 }
00214
00215 BOOL CTestApp::IsDsEnabledLocaly()
00216 /*++
00217
00218 Routine Description:
00219
00220       The routine checks whether the computer is enabled to access the directory service (DS-enabled).
00221
00222 Arguments:
00223
00224       None
00225
00226 Return Value:
00227
00228       TRUE     -  DS-enabled.
00229       FALSE    -  DS-disabled.
00230
00231 --*/
00232
00233 {
00234
00235     MQPRIVATEPROPS PrivateProps;
00236     QMPROPID       aPropId[MAX_VAR];
00237     MQPROPVARIANT  aPropVar[MAX_VAR];
00238     DWORD          cProp;
00239     HRESULT        hr;
00240     //
00241     // Specify the PROPID_PC_DS_ENABLED, which indicates whether
00242   // the computer is DS-enabled.
00243     //
00244     cProp = 0;
00245
00246     aPropId[cProp] = PROPID_PC_DS_ENABLED;
00247     aPropVar[cProp].vt = VT_NULL;
00248     ++cProp;
00249     //
00250     // Create a PRIVATEPROPS structure.
00251     //
00252     PrivateProps.cProp = cProp;
00253   PrivateProps.aPropID = aPropId;
00254   PrivateProps.aPropVar = aPropVar;
00255     PrivateProps.aStatus = NULL;
00256
00257     //
00258     // Retrieve the information.
00259     //
00260
00261
00262     //
00263     // This code detects a DS connection.
00264     // This code is designed to allow the sample to compile on NT 4.0 and on Windows 2000
00265     // and later. The MQGetPrivateComputerInformation() function can be called directly
00266     // on Windows 2000 and later.
00267     //
00268     HINSTANCE hMqrtLibrary = GetModuleHandle(TEXT("mqrt.dll"));
00269   if (hMqrtLibrary == NULL)
00270   {
00271     AfxMessageBox(_T("An incomplete installation of MSMQ was detected. Exiting..."));
00272     exit(1);
00273   }
00274
00275     typedef HRESULT (APIENTRY *MQGetPrivateComputerInformation_ROUTINE)(LPCWSTR , MQPRIVATEPROPS*);
00276     MQGetPrivateComputerInformation_ROUTINE pfMQGetPrivateComputerInformation =
00277           (MQGetPrivateComputerInformation_ROUTINE)GetProcAddress(hMqrtLibrary,
00278                            "MQGetPrivateComputerInformation");
00279     if(pfMQGetPrivateComputerInformation == NULL)
00280     {
00281         //
00282         // There is no entry point in the DLL matching this routine.
00283         // It must be an old version of mqrt.dll (MSMQ 1.0).
00284         // It will be OK to handle this case as a case of DS-enabled mode.
00285         //
00286         return TRUE;
00287     }
00288
00289   hr = pfMQGetPrivateComputerInformation(
00290              NULL,
00291            &PrivateProps);
00292   if(FAILED(hr))
00293   {
00294         //
00295         // We were not able to determine whether the computer is enabled to access the DS.
00296         // Notify the user and assume the worst case, i.e., that the computer is DS-disasbled.
00297         //
00298         AfxMessageBox(_T("No DS connection could be detected."));
00299         return FALSE;
00300     }
00301
00302
00303     if(PrivateProps.aPropVar[0].boolVal == 0)
00304     {
00305         //
00306         // DS-disabled.
00307         //
00308         return FALSE;
00309     }
00310
00311     return TRUE;
00312
00313 }
00314
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CWizard Member List

This is the complete list of members for CWizard, including all inherited members.
CDialogBase(HWND hWnd, HINSTANCE hInst) | CDialogBase |
CWizard(HWND hWnd, HINSTANCE hInst) | CWizard |
Destroy() | CDialogBase | [virtual]
DestroyPrevStep(ULONG iCurStep) | CWizard | [virtual]
Display() | CWizard | [virtual]
DisplayStep(ULONG iStep) | CWizard | [virtual]
m_hInst | CDialogBase |
m_hWnd | CDialogBase |
m_iPrevStep | CWizard |
m_pCProgress | CWizard |
m_pCTableCopy | CWizard |
m_rgDialogSteps | CWizard |
~CDialogBase() | CDialogBase | [virtual]
~CWizard() | CWizard | [virtual]
Generated on Wed Nov 13 2024 16:57:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDataObject Member List

This is the complete list of members for CDataObject, including all inherited members.
AddMultiSelectCookie(LONG_PTR nCookie) | CDataObject |
AddMultiSelectCookie(int nIndexCookies, LPARAM lParam) | CDataObject | [inline]
AddMultiSelectGuid(GUID *pGuid) | CDataObject |
AllocPidlTable(DWORD) | CDataObject | [private]
CDataObject(COleDocument *) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject() | CDataObject |
CDataObject() | CDataObject |
CDataObject() | CDataObject |
CDataObject() | CDataObject |
CDataObject() | CDataObject |
CDataObject() | CDataObject |
CDataObject() | CDataObject |
CDataObject() | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context) | CDataObject |
CDataObject() | CDataObject |
CDataObject(CShellFolder *, LPCITEMIDLIST *, UINT) | CDataObject |
Clone(LPENUMFORMATETC *) | CDataObject |
DAdvise(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD) | CDataObject |
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection) | CDataObject | [inline]
DAdvise(FORMATETC *, DWORD, LPADVISESINK, LPDWORD) | CDataObject |
DAdvise(LPFORMATETC, DWORD, IAdviseSink *, LPDWORD) | CDataObject |
DUnadvise(DWORD) | CDataObject |
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD dwConnection) | CDataObject | [inline]
DUnadvise(DWORD) | CDataObject |
DUnadvise(DWORD dwConnection) | CDataObject |
EnumDAdvise(LPENUMSTATDATA *) | CDataObject |
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *ppEnumAdvise) | CDataObject | [inline]
EnumDAdvise(LPENUMSTATDATA *) | CDataObject |
EnumDAdvise(IEnumSTATDATA **ppEnumAdvise) | CDataObject |
EnumFormatEtc(DWORD, LPENUMFORMATETC *) | CDataObject |
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject |
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC *ppEnumFormatEtc) | CDataObject | [inline]
EnumFormatEtc(DWORD, LPENUMFORMATETC *) | CDataObject |
EnumFormatEtc(DWORD, IEnumFORMATETC **) | CDataObject |
FillPidlTable(LPCITEMIDLIST *, UINT) | CDataObject | [private]
FreePidlTable(VOID) | CDataObject | [private]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetBaseNodeObject() | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC) | CDataObject |
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut) | CDataObject | [inline]
GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC) | CDataObject |
GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC) | CDataObject |
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetContext() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetCookie() | CDataObject | [inline]
GetData(LPFORMATETC, LPSTGMEDIUM) | CDataObject |
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CDataObject |
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CDataObject |
GetData(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CDataObject |
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject |
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium) | CDataObject | [inline]
GetData(LPFORMATETC, LPSTGMEDIUM) | CDataObject |
GetData(LPFORMATETC, LPSTGMEDIUM) | CDataObject |
GetDataHere(LPFORMATETC, LPSTGMEDIUM) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CDataObject |
GetDataHere(FORMATETC *pFormatEtc, STGMEDIUM *pStgMedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) | CDataObject |
GetDataHere(LPFORMATETC, LPSTGMEDIUM) | CDataObject |
GetDataHere(LPFORMATETC, LPSTGMEDIUM) | CDataObject |
GetMultiSelectCookie(int n) | CDataObject | [inline]
m_aPidls | CDataObject | [private]
m_cDataCount | CDataObject | [private]
m_cfEmbedSource | CDataObject | [private]
m_cFormatEtc | CDataObject | [private]
m_cfPrivateData | CDataObject | [private]
m_cfShellIDList | CDataObject | [private]
m_context | CDataObject | [private]
m_CookieList | CDataObject | [private]
m_cref | CDataObject | [private]
m_cRef | CDataObject | [private]
m_cRefCount | CDataObject | [private]
m_GuidList | CDataObject | [private]
m_iCurrent | CDataObject | [private]
m_lCookie | CDataObject | [private]
m_nCookie | CDataObject | [private]
m_ObjRefCount | CDataObject | [private]
m_pDataAdviseHolder | CDataObject | [private]
m_pEnumFormatEtc | CDataObject |
m_pFormatEtc | CDataObject | [private]
m_pMalloc | CDataObject | [private]
m_pOleDoc | CDataObject | [private]
m_pPidlMgr | CDataObject | [private]
m_psfParent | CDataObject | [private]
m_pStgMedium | CDataObject | [private]
m_uContext | CDataObject | [private]
m_uCookie | CDataObject | [private]
m_uCookie | CDataObject | [private]
m_uCookie | CDataObject | [private]
m_uItemCount | CDataObject | [private]
m_uNodeTypeFlg | CDataObject | [private]
MAX_COOKIES enum value | CDataObject | [private]
Next(ULONG, LPFORMATETC, ULONG *) | CDataObject |
pCookies | CDataObject | [private]
QueryGetData(LPFORMATETC) | CDataObject |
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(FORMATETC *pFormatEtc) | CDataObject |
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC lpFormatetc) | CDataObject | [inline]
QueryGetData(LPFORMATETC) | CDataObject |
QueryGetData(LPFORMATETC) | CDataObject |
QueryInterface(REFIID, LPVOID *) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID riid, LPVOID *ppv) | CDataObject |
QueryInterface(REFIID, LPVOID *) | CDataObject |
QueryInterface(REFIID, LPVOID FAR *) | CDataObject |
Reset(void) | CDataObject |
RetrieveBaseNodePtr(IStream *ipStream) | CDataObject | [private]
RetrieveBaseNodePtr(IStream *ipStream) | CDataObject | [private]
RetrieveBaseNodePtr(IStream *ipStream) | CDataObject | [private]
RetrieveBaseNodePtr(IStream *ipStream) | CDataObject | [private]
RetrieveBaseNodePtr(IStream *ipStream) | CDataObject | [private]
RetrieveBaseNodePtr(IStream *ipStream) | CDataObject | [private]
RetrieveDataObjPtr(IStream *ipStream) | CDataObject | [private]
RetrieveDataObjPtr(IStream *ipStream) | CDataObject | [private]
RetrieveDataObjPtr(IStream *ipStream) | CDataObject | [private]
RetrieveDataObjPtr(IStream *ipStream) | CDataObject | [private]
RetrieveDataObjPtr(IStream *ipStream) | CDataObject | [private]
RetrieveDataObjPtr(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveDisplayString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveGuidString(IStream *ipStream) | CDataObject | [private]
RetrieveMultiSelectCookies(STGMEDIUM *pStgMedium) | CDataObject |
RetrieveMultiSelectTypes(STGMEDIUM *pStgMedium) | CDataObject |
RetrieveNodeAttribs(STGMEDIUM *pStgMedium) | CDataObject | [private]
RetrieveNodePropPtr(STGMEDIUM *pStgMedium) | CDataObject | [private]
RetrieveNodeTypeFlg(STGMEDIUM *pStgmedium) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveNodeTypeGuid(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
RetrieveSnapInClassID(IStream *ipStream) | CDataObject | [private]
s_cfDisplayName | CDataObject | [static]
s_cfInternal | CDataObject | [static]
s_cfMultiSelect | CDataObject | [static]
s_cfNodeType | CDataObject | [static]
s_cfSnapinClsid | CDataObject | [static]
s_cfSZNodeType | CDataObject | [static]
SetData(LPFORMATETC, LPSTGMEDIUM, BOOL) | CDataObject |
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease) | CDataObject | [inline]
SetData(LPFORMATETC, LPSTGMEDIUM, BOOL) | CDataObject |
SetData(LPFORMATETC, LPSTGMEDIUM, BOOL) | CDataObject |
SetPrivateData(ULONG uCookie, ULONG uContext) | CDataObject |
SetPrivateData(ULONG uCookie, ULONG uContext) | CDataObject |
SetPrivateData(ULONG uCookie, ULONG uContext) | CDataObject |
SetPrivateData(ULONG_PTR uCookie, ULONG uContext) | CDataObject |
SetPrivateData(INT_PTR nCookie, ULONG uContext) | CDataObject |
SetPrivateData(ULONG uCookie, ULONG uContext) | CDataObject |
SetPrivateData(ULONG_PTR uCookie, ULONG uContext) | CDataObject |
SetPrivateData(LONG_PTR uCookie, ULONG uContext) | CDataObject |
Skip(ULONG) | CDataObject |
STDMETHOD_(ULONG, AddRef)(void) | CDataObject |
STDMETHOD_(ULONG, Release)(void) | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(ULONG) AddRef() | CDataObject |
STDMETHODIMP_(ULONG) Release() | CDataObject |
STDMETHODIMP_(DWORD) AddRef() | CDataObject |
STDMETHODIMP_(DWORD) Release() | CDataObject |
~CDataObject(void) | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
~CDataObject() | CDataObject |
Generated on Wed Nov 13 2024 16:56:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CNewsEvent Member List

This is the complete list of members for CNewsEvent, including all inherited members.
CNewsEvent() | CNewsEvent | [inline]
CNewsEvent() | CNewsEvent | [inline]
InterfaceSupportsErrorInfo(REFIID riid) | CNewsEvent |
LongQuote(BSTR Symbol, double BidPrice, double AskPrice, BSTR LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, long AskSize, long BidSize, double OpenPrice, double ClosePrice, BSTR CloseDate) | CNewsEvent |
NewsFlash(DATE dtTimeStamp, BSTR Symbol, BSTR Headline, BSTR URL) | CNewsEvent |
ShortQuote(BSTR Symbol, double BidPrice, double AskPrice, DATE LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow) | CNewsEvent |
Generated on Wed Nov 13 2024 16:56:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/Printer.h Source File

  • Multimedia
  • Gdi
  • Printer

Printer.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /******************************************************************************\
00013 *
00014 *                                PRINTER.H
00015 *
00016 \******************************************************************************/
00017
00018 #define MAX_MAP_MODES             8    // # items in gaMMLookup
00019 #define MAX_PENWIDTHS             8    // # items in gaPenWidths
00020 #define MAX_PENSTYLES             7    // # items in gaPenStyles
00021 #define MAX_BRUSHSTYLES           6    // # items in gaBrushStyles
00022
00023 #define ERR_MOD_NAME             IDS_ERR_PRINTER
00024
00025 /******************************************************************************\
00026 *                                 TYPEDEFS
00027 \******************************************************************************/
00028
00029 typedef struct tagMAPMODELOOKUP
00030 {
00031   WORD   wMenuItem;
00032   int    iMapMode;
00033
00034 } MAPMODELOOKUP;
00035
00036 typedef struct tagGRAPHICLOOKUP
00037 {
00038   WORD   wMenuItem;
00039   DWORD  dwGraphic;
00040
00041 } GRAPHICLOOKUP;
00042
00043 typedef struct tagPENWIDTHLOOKUP
00044 {
00045   WORD   wMenuItem;
00046   int    iPenWidth;
00047
00048 } PENWIDTHLOOKUP;
00049
00050 typedef struct tagPENSTYLELOOKUP
00051 {
00052   WORD   wMenuItem;
00053   int    iPenStyle;
00054
00055 } PENSTYLELOOKUP;
00056
00057 typedef struct tagBRUSHSTYLELOOKUP
00058 {
00059   WORD   wMenuItem;
00060   int    iBrushStyle;
00061
00062 } BRUSHSTYLELOOKUP;
00063
00064 typedef struct tagSTATUSBARLOOKUP
00065 {
00066   WORD   wMenuItem;
00067   LPCSTR szText;
00068
00069 } STATUSBARLOOKUP;
00070
00071
00072
00073 /******************************************************************************\
00074 *                                GLOBAL VARS
00075 \******************************************************************************/
00076
00077 HANDLE  ghInst;                        // app instance handle
00078 HWND    ghwndMain;                     // main app window handle
00079 HWND    ghwndAbort;                    // Abort dialog handle
00080 LONG    glcyMenu;                      // menu height
00081 DWORD   gdwGraphicsOptions = DRAWAXIS; // current graphic options (to display)
00082 int     giMapMode = MM_TEXT;           // current map mode
00083 HDC     ghdc;                          // device context to print on
00084 BOOL    gbAbort;                       // AbortProc return code
00085
00086 char    gszDeviceName[BUFSIZE];        // current device name
00087 char    gszPort      [BUFSIZE];        // current port
00088 char    gszDriverName[BUFSIZE];        // current driver name
00089
00090 DWORD   gdwPenColor   = 0x00ff00;      // current pen color
00091 DWORD   gdwBrushColor = 0x0000ff;      // current brush color
00092 DWORD   gdwTextColor =  0xff0000;      // current text color
00093
00094 int     giPenStyle   = PS_SOLID;       // current pen style
00095 int     giPenWidth   = 1;              // current pen width
00096 int     giBrushStyle = HS_HORIZONTAL;    // current brush style
00097
00098 MAPMODELOOKUP gaMMLookup[] =
00099
00100     { { IDM_HIENGLISH  , MM_HIENGLISH   },
00101       { IDM_HIMETRIC   , MM_HIMETRIC    },
00102       { IDM_LOENGLISH  , MM_LOENGLISH   },
00103       { IDM_LOMETRIC   , MM_LOMETRIC    },
00104       { IDM_TWIPS      , MM_TWIPS       },
00105       { IDM_ISOTROPIC  , MM_ISOTROPIC   },
00106       { IDM_ANISOTROPIC, MM_ANISOTROPIC },
00107       { IDM_TEXT       , MM_TEXT        } };
00108
00109 GRAPHICLOOKUP gaGraphicLookup[] =
00110
00111     { { IDM_ARC        , ARC         },
00112       { IDM_ELLIPSE    , ELLIPSE     },
00113       { IDM_LINETO     , LINETO      },
00114       { IDM_PIE        , PIE         },
00115       { IDM_PLGBLT     , PLG_BLT     },
00116       { IDM_POLYBEZIER , POLYBEZIER  },
00117       { IDM_POLYGON    , POLYGON     },
00118       { IDM_POLYLINE   , POLYLINE    },
00119       { IDM_POLYPOLYGON, POLYPOLYGON },
00120       { IDM_RECTANGLE  , RECTANGLE   },
00121       { IDM_ROUNDRECT  , ROUNDRECT   },
00122       { IDM_STRETCHBLT , STRETCH_BLT } };
00123
00124 PENWIDTHLOOKUP gaPenWidths[] =
00125
00126     { { IDM_PENWIDTH_1, 1 },
00127       { IDM_PENWIDTH_2, 2 },
00128       { IDM_PENWIDTH_3, 3 },
00129       { IDM_PENWIDTH_4, 4 },
00130       { IDM_PENWIDTH_5, 5 },
00131       { IDM_PENWIDTH_6, 6 },
00132       { IDM_PENWIDTH_7, 7 },
00133       { IDM_PENWIDTH_8, 8 } };
00134
00135 PENSTYLELOOKUP gaPenStyles[] =
00136
00137     { { IDM_PENCOLOR_SOLID      , PS_SOLID      },
00138       { IDM_PENCOLOR_DASH       , PS_DASH       },
00139       { IDM_PENCOLOR_DOT        , PS_DOT        },
00140       { IDM_PENCOLOR_DASHDOT    , PS_DASHDOT    },
00141       { IDM_PENCOLOR_DASHDOTDOT , PS_DASHDOTDOT },
00142       { IDM_PENCOLOR_NULL       , PS_NULL       },
00143       { IDM_PENCOLOR_INSIDEFRAME, PS_INSIDEFRAME} };
00144
00145 BRUSHSTYLELOOKUP gaBrushStyles[] =
00146
00147     { { IDM_BRUSHSTYLE_HORIZONTAL     , HS_HORIZONTAL     },
00148       { IDM_BRUSHSTYLE_VERTICAL       , HS_VERTICAL       },
00149       { IDM_BRUSHSTYLE_FDIAGONAL      , HS_FDIAGONAL      },
00150       { IDM_BRUSHSTYLE_BDIAGONAL      , HS_BDIAGONAL      },
00151       { IDM_BRUSHSTYLE_CROSS          , HS_CROSS          },
00152       { IDM_BRUSHSTYLE_DIAGCROSS      , HS_DIAGCROSS      } };
00153
00154
00155
00156
00157 /******************************************************************************\
00158 *                            FUNCTION PROTOTYPES
00159 \******************************************************************************/
00160
00161 LRESULT CALLBACK MainWndProc   (HWND, UINT, WPARAM, LPARAM);
00162 LRESULT CALLBACK AboutDlgProc  (HWND, UINT, WPARAM, LPARAM);
00163 LRESULT CALLBACK AbortDlgProc  (HWND, UINT, WPARAM, LPARAM);
00164
00165 BOOL    CALLBACK AbortProc     (HDC, int);
00166
00167 void    InvalidateClient       (void);
00168 void    RefreshPrinterCombobox (HWND);
00169 void    PrintThread            (LPVOID);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/StoClien/PAPFILE.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • StoClien

PAPFILE.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PAPFILE.CPP
00003
00004   Summary:   Implementation file for the CPapFile C++ class. A CPapFile is
00005              a C++ object that encapsulates load and save operations on an
00006              COM structured storage compound file.  CPapFile knows about
00007              an underlying server-based COM object, COPaper, that manages
00008              the actual paper drawing data and uses an IStorage provided
00009              to store retrieve that paper data.
00010
00011              For a comprehensive tutorial code tour of PapFile's contents
00012              and offerings see the tutorial STOCLIEN.HTM file. For more
00013              specific technical details on the internal workings see the
00014              comments dispersed throughout the PAPFILE source code.
00015
00016   Classes:   CPapFile.
00017
00018   Functions: .
00019
00020   Origin:    6-13-96: atrent - Created for STOCLIEN Code Sample.
00021
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037 /*--------------------------------------------------------------------------
00038   We include WINDOWS.H for all Win32 applications.
00039   We include OLE2.H because we will be calling the COM/OLE Libraries.
00040   We include APPUTIL.H because we will be building this application using
00041     the convenient Virtual Window and Dialog classes and other
00042     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00043   We include IPAPER.H and PAPGUIDS.H for the common paper-related Interface
00044     class, GUID, and CLSID specifications.
00045   We include PAPFILE.H because it has the C++ class declaration used
00046     for CPapFile.
00047 ---------------------------------------------------------------------------*/
00048 #include <windows.h>
00049 #include <ole2.h>
00050 #include <apputil.h>
00051 #include <ipaper.h>
00052 #include <papguids.h>
00053 #include "papfile.h"
00054
00055
00056 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00057   Method:   CPapFile::CPapFile
00058
00059   Summary:  CPapFile Constructor.
00060
00061   Args:     .
00062
00063   Modifies: .
00064
00065   Returns:  .
00066 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00067 CPapFile::CPapFile()
00068 {
00069   m_szCurFileName[0] = 0;
00070   m_pIPaper = NULL;
00071   m_pIStorage = NULL;
00072 }
00073
00074
00075 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00076   Method:   CPapFile::~CPapFile
00077
00078   Summary:  CPapFile Destructor.
00079
00080   Args:     .
00081
00082   Modifies: .
00083
00084   Returns:  .
00085 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00086 CPapFile::~CPapFile()
00087 {
00088   RELEASE_INTERFACE(m_pIPaper);
00089 }
00090
00091
00092 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00093   Method:   CPapFile::Init
00094
00095   Summary:  Initializes the CPapFile C++ object.
00096
00097   Args:     TCHAR* pszAppFileName
00098               Name/Path of the app's default compound file to open.
00099             IPaper* pIPaper
00100               Interface pointer for a COPaper COM object that manages
00101               a collection of Ink Data in memory and has facilities
00102               for Loading and Saving that data using an IStorage to
00103               a client-provided compound file.
00104
00105   Modifies: ...
00106
00107   Returns:  HRESULT
00108               Standard result code. NOERROR for success.
00109 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00110 HRESULT CPapFile::Init(
00111                     TCHAR* pszAppFileName,
00112                     IPaper* pIPaper)
00113 {
00114   HRESULT hr = E_FAIL;
00115
00116   if (NULL != pIPaper)
00117   {
00118     // Keep CPapFile copy of pIPaper. Thus AddRef it. Released in Destructor.
00119     m_pIPaper = pIPaper;
00120     m_pIPaper->AddRef();
00121
00122     if (NULL != pszAppFileName)
00123     {
00124       // Set the default current file name.
00125       lstrcpyn(m_szCurFileName, pszAppFileName, sizeof(m_szCurFileName)/
00126         sizeof(TCHAR));
00127
00128       hr = NOERROR;
00129     }
00130   }
00131
00132   return (hr);
00133 }
00134
00135
00136 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00137   Method:   CPapFile::Load
00138
00139   Summary:  Load paper data using the specified compound file name.
00140
00141   Args:     SHORT nLockKey
00142               The lock key previously obtained in a IPaper::Lock call.
00143             TCHAR* pszFileName
00144               Name/Path of the compound file to open. If NULL then use
00145               CPapFile's m_szCurFileName as the compound file to load.
00146
00147   Modifies: ...
00148
00149   Returns:  HRESULT
00150               Standard result code. NOERROR for success.
00151 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00152 HRESULT CPapFile::Load(
00153                     SHORT nLockKey,
00154                     TCHAR* pszFileName)
00155 {
00156   HRESULT hr = E_FAIL;
00157   BOOL bNewFile = (NULL != pszFileName);
00158   TCHAR* pszFile;
00159
00160   // If NULL file name passed then use current file name.
00161   pszFile = bNewFile ? pszFileName : m_szCurFileName;
00162
00163   // First check if the file is out there using APPUTIL function.
00164   if (FileExist(pszFile))
00165   {
00166     // Use COM service to next check if the file is actually a valid
00167     // compound file.
00168     hr = StgIsStorageFile(pszFile);
00169     if (SUCCEEDED(hr))
00170     {
00171       // We're go. Use COM service to open the compound file and
00172       // obtain a IStorage interface.
00173       hr = StgOpenStorage(
00174              pszFile,
00175              NULL,
00176              STGM_DIRECT | STGM_READ | STGM_SHARE_EXCLUSIVE,
00177              NULL,
00178              0,
00179              &m_pIStorage);
00180       if (SUCCEEDED(hr))
00181       {
00182         // We have an IStorage. Now ask the COPaper object on the server
00183         // side to load into itself the file's paper data using the
00184         // IStorage for our client-provided compound file.
00185         hr = m_pIPaper->Load(nLockKey, m_pIStorage);
00186         if (SUCCEEDED(hr))
00187         {
00188           // The paper data was loaded and we have a current compound
00189           // file name. Copy it for later use in a saves and loads.
00190           if (bNewFile)
00191             lstrcpyn(m_szCurFileName, pszFileName, sizeof(m_szCurFileName)/
00192               sizeof(TCHAR));
00193         }
00194
00195         // We are done with the Storage for now. We don't hold the file
00196         // open. We re-obtain the IStorage again later (and thus re-open
00197         // the compound file) when we need it for another save or load.
00198         RELEASE_INTERFACE(m_pIStorage);
00199       }
00200     }
00201   }
00202
00203   return (hr);
00204 }
00205
00206
00207 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00208   Method:   CPapFile::Save
00209
00210   Summary:  Save current paper data using the specified compound file name.
00211
00212   Args:     SHORT nLockKey
00213               The lock key previously obtained in a IPaper::Lock call.
00214             TCHAR* pszFileName
00215               Name/Path of the compound file to open. If NULL then use
00216               CPapFile's m_szCurFileName as the compound file to save.
00217
00218   Modifies: ...
00219
00220   Returns:  HRESULT
00221               Standard result code. NOERROR for success.
00222 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00223 HRESULT CPapFile::Save(
00224                     SHORT nLockKey,
00225                     TCHAR* pszFileName)
00226 {
00227   HRESULT hr = E_FAIL;
00228   BOOL bNewFile = (NULL != pszFileName);
00229   TCHAR* pszFile;
00230
00231   // If NULL file name passed then use current file name.
00232   pszFile = bNewFile ? pszFileName : m_szCurFileName;
00233
00234   // Use COM service to re-open (or newly create) the compound file.
00235   hr = StgCreateDocfile(
00236          pszFile,
00237          STGM_CREATE | STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
00238          0,
00239          &m_pIStorage);
00240   if (SUCCEEDED(hr))
00241   {
00242     // We've got the IStorage and the compound file is open.
00243     // Now tell the COPaper object on the server side to save its
00244     // paper data into the compound file using the IStorage of our
00245     // client-provided compound file.
00246     hr = m_pIPaper->Save(nLockKey, m_pIStorage);
00247     if (SUCCEEDED(hr))
00248     {
00249       // The paper data was saved and we have a new current compound
00250       // file name. Copy it for later use in a saves and loads.
00251       if (bNewFile)
00252         lstrcpyn(m_szCurFileName, pszFileName, sizeof(m_szCurFileName)/
00253           sizeof(TCHAR));
00254     }
00255
00256     // We are done with the Storage for now. We don't hold the file
00257     // open. We re-obtain the IStorage again later (and thus re-open
00258     // the compound file) when we need it for another save or load.
00259     RELEASE_INTERFACE(m_pIStorage);
00260   }
00261
00262   return (hr);
00263 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CADsFirstExtApp Member List

This is the complete list of members for CADsFirstExtApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CWinApp() | CWinApp |
ExitInstance() | CADsFirstExtApp | [virtual]
ExitInstance() | CADsFirstExtApp | [virtual]
InitInstance() | CADsFirstExtApp | [virtual]
InitInstance() | CADsFirstExtApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:55:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/comp.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

comp.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #ifndef _CLASS_CCOMPONENT_
00016 #define _CLASS_CCOMPONENT_
00017
00018 #include "Globals.h"
00019
00020
00021 class CComponentData;                  // References
00022
00023
00024 //---------------------------------------------------------------------------
00025 class CComponent : public IComponent2
00026 {
00027   // Construction/Destruction
00028   public:
00029     CComponent( CComponentData* pParent );
00030     ~CComponent();
00031
00032
00033     /////////////////////////////////////////////////////////////////////////
00034     // Interface IUnknown
00035     //
00036     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00037     STDMETHODIMP_(ULONG) AddRef();
00038     STDMETHODIMP_(ULONG) Release();
00039
00040     /////////////////////////////////////////////////////////////////////////
00041     // Interface IComponent
00042     //
00043     HRESULT STDMETHODCALLTYPE Initialize
00044             ( /*[in] */ LPCONSOLE ipConsole );
00045
00046     HRESULT STDMETHODCALLTYPE Notify
00047             ( /*[in] */ LPDATAOBJECT ipDataObject,
00048               /*[in] */ MMC_NOTIFY_TYPE MmcEvent,
00049               /*[in] */ LONG nArg,
00050               /*[in] */ LONG nParam
00051             );
00052
00053     HRESULT STDMETHODCALLTYPE Destroy
00054             ( /*[in] */ MMC_COOKIE nCookie );
00055
00056     HRESULT STDMETHODCALLTYPE QueryDataObject
00057             ( /*[in] */  MMC_COOKIE nCookie,
00058               /*[in] */  DATA_OBJECT_TYPES nEnumType,
00059               /*[out]*/  LPDATAOBJECT __RPC_FAR* ppDataObject
00060             );
00061
00062     HRESULT STDMETHODCALLTYPE GetResultViewType
00063             ( /*[in] */  MMC_COOKIE nCookie,
00064               /*[out]*/  LPOLESTR __RPC_FAR* ppViewType,
00065               /*[out]*/  long __RPC_FAR* pViewOptions
00066             );
00067
00068     HRESULT STDMETHODCALLTYPE GetDisplayInfo
00069             ( /*[in,out]*/ RESULTDATAITEM __RPC_FAR* pResultDataItem );
00070
00071     HRESULT STDMETHODCALLTYPE CompareObjects
00072             ( /*[in] */ LPDATAOBJECT lpDataObjectA,
00073               /*[in] */ LPDATAOBJECT lpDataObjectB
00074             );
00075     HRESULT STDMETHODCALLTYPE QueryDispatch
00076             ( /*[in] */  MMC_COOKIE  nCookie,
00077               /*[in] */  DATA_OBJECT_TYPES eType,
00078               /*[out]*/  LPDISPATCH* pipDispatch
00079             );
00080
00081     HRESULT STDMETHODCALLTYPE GetResultViewType2
00082             ( /*[in] */    MMC_COOKIE nCookie,
00083               /*[in,out]*/ PRESULT_VIEW_TYPE_INFO pRVTinfo
00084             );
00085
00086     HRESULT STDMETHODCALLTYPE RestoreResultView
00087             ( /*[in] */    MMC_COOKIE nCookie,
00088               /*[in,out]*/ PRESULT_VIEW_TYPE_INFO pResultViewType
00089             );
00090
00091   private:
00092     ULONG            m_cRef;
00093     CComponentData*  m_pComponentData;
00094
00095 };
00096
00097 #endif //_CLASS_CCOMPONENT_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMmStream Member List

This is the complete list of members for CMmStream, including all inherited members.
_fWrite | CMmStream | [protected]
_hFile | CMmStream | [protected]
_hMap | CMmStream | [protected]
_sizeHigh | CMmStream | [protected]
_sizeLow | CMmStream | [protected]
Close() | CMmStream | [virtual]
CMmStream() | CMmStream |
CMmStream(WCHAR *wcsPath) | CMmStream |
CMmStreamBuf class | CMmStream | [friend]
Flush(CMmStreamBuf &sbuf, ULONG cb) | CMmStream | [virtual]
PMmStream::Flush() | PMmStream | [inline, virtual]
isEmpty() | CMmStream | [inline, virtual]
isWritable() | CMmStream | [inline, virtual]
Map(CMmStreamBuf &sbuf, ULONG cb=0, ULONG offLow=0, ULONG offHigh=0, BOOL fMapForWrite=FALSE) | CMmStream | [virtual]
MapAll(CMmStreamBuf &sbuf) | CMmStream | [virtual]
Ok() | CMmStream | [inline, virtual]
Open(const WCHAR *wcsPath, ULONG modeAccess, ULONG modeShare, ULONG modeCreate, ULONG modeAttribute=FILE_ATTRIBUTE_NORMAL) | CMmStream |
OpenRorW(WCHAR *wcsPath) | CMmStream |
SetSize(PStorage &storage, ULONG newSizeLow, ULONG newSizeHigh=0) | CMmStream | [virtual]
ShrinkFromFront(ULONG firstPage, ULONG numPages) | PMmStream | [inline, virtual]
Size() const | CMmStream | [inline, virtual]
SizeHigh() | CMmStream | [inline, virtual]
SizeLow() | CMmStream | [inline, virtual]
Unmap(CMmStreamBuf &sbuf) | CMmStream | [virtual]
~CMmStream() | CMmStream | [virtual]
~PMmStream() | PMmStream | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/FreeObject/FreeObject.Cpp Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • FreeObject

FreeObject.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: FreeObject.cpp
00004
00005 Summary: Implementation of DLL Exports
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 // Note: Proxy/Stub Information
00023 //      To build a separate proxy/stub DLL,
00024 //      run nmake -f FreeObjectps.mk in the project directory.
00025
00026 #include "stdafx.h"
00027 #include "resource.h"
00028 #include <initguid.h>
00029 #include "FreeObject.h"
00030
00031 #include "FreeObject_i.c"
00032 #include "FreeTest.h"
00033
00034 CComModule _Module;
00035 CRITICAL_SECTION g_csSync;
00036
00037 BEGIN_OBJECT_MAP(ObjectMap)
00038 OBJECT_ENTRY(CLSID_FreeTest, CFreeTest)
00039 END_OBJECT_MAP()
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // DLL Entry Point
00043
00044 extern "C"
00045 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00046 {
00047     if (dwReason == DLL_PROCESS_ATTACH)
00048     {
00049         _Module.Init(ObjectMap, hInstance, &LIBID_FREEOBJECTLib);
00050         DisableThreadLibraryCalls(hInstance);
00051     // initialize our critsec
00052     DWORD dwSpinCount = 0;
00053     InitializeCriticalSectionAndSpinCount(&g_csSync, dwSpinCount);
00054     }
00055     else if (dwReason == DLL_PROCESS_DETACH) {
00056     DeleteCriticalSection(&g_csSync);
00057         _Module.Term();
00058   }
00059     return TRUE;    // ok
00060 }
00061
00062 /////////////////////////////////////////////////////////////////////////////
00063 // Used to determine whether the DLL can be unloaded by OLE
00064
00065 STDAPI DllCanUnloadNow(void)
00066 {
00067     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00068 }
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 // Returns a class factory to create an object of the requested type
00072
00073 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00074 {
00075     return _Module.GetClassObject(rclsid, riid, ppv);
00076 }
00077
00078 /////////////////////////////////////////////////////////////////////////////
00079 // DllRegisterServer - Adds entries to the system registry
00080
00081 STDAPI DllRegisterServer(void)
00082 {
00083     // registers object, typelib and all interfaces in typelib
00084     return _Module.RegisterServer(TRUE);
00085 }
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 // DllUnregisterServer - Removes entries from the system registry
00089
00090 STDAPI DllUnregisterServer(void)
00091 {
00092     return _Module.UnregisterServer(TRUE);
00093 }
00094
00095
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Intermediate/Resource.h Source File

  • Web
  • iis
  • Components
  • Cpp
  • Intermediate

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by CATLPwr.rc
00004 //
00005 #define IDS_POWER_DESC  1
00006
00007
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NEXT_RESOURCE_VALUE        201
00014 #define _APS_NEXT_COMMAND_VALUE         32768
00015 #define _APS_NEXT_CONTROL_VALUE         201
00016 #define _APS_NEXT_SYMED_VALUE           101
00017 #endif
00018 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/resource.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Data.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_PROXY                       101
00007 #define IDR_ENTITY                      102
00008 #define IDR_DYNAMIC                     103
00009 #define IDR_RESULTSET                   104
00010
00011 // Next default values for new objects
00012 //
00013 #ifdef APSTUDIO_INVOKED
00014 #ifndef APSTUDIO_READONLY_SYMBOLS
00015 #define _APS_NEXT_RESOURCE_VALUE        202
00016 #define _APS_NEXT_COMMAND_VALUE         32768
00017 #define _APS_NEXT_CONTROL_VALUE         201
00018 #define _APS_NEXT_SYMED_VALUE           105
00019 #endif
00020 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/Tst4Wts/Tst4Wts.c Source File

  • WinBase
  • WtsApi
  • Tst4Wts

Tst4Wts.c

Go to the documentation of this file.
00001 /**********************************************************************
00002 *
00003 * tst4wts.c
00004 *
00005 * Test dynamic determination of presence of WTSAPI DLL.
00006 *
00007 * Copyright 1995-1999, Citrix Systems Inc.
00008 * Copyright (c) 1997 - 2000  Microsoft Corporation
00009 *
00010 **********************************************************************/
00011
00012
00013 #include <windows.h>
00014 #include <tchar.h> // for _tprintf()
00015 #include <stdio.h> // for printf() (which _tprintf() calls)
00016 #include <wtsapi32.h>
00017 #include <wctype.h>
00018
00019
00020 typedef BOOL (WINAPI *PWTSENUMERATESERVERSW) (
00021     IN LPWSTR pDomainName,
00022     IN DWORD Reserved,
00023     IN DWORD Version,
00024     OUT PWTS_SERVER_INFOW * ppServerInfo,
00025     OUT DWORD * pCount
00026     );
00027 typedef BOOL (WINAPI *PWTSENUMERATESERVERSA) (
00028     IN LPSTR pDomainName,
00029     IN DWORD Reserved,
00030     IN DWORD Version,
00031     OUT PWTS_SERVER_INFOA * ppServerInfo,
00032     OUT DWORD * pCount
00033     );
00034
00035 #ifdef UNICODE
00036 typedef PWTSENUMERATESERVERSW PWTSENUMERATESERVERS;
00037 char aWTSEnumerateServers[] = "WTSEnumerateServersW";
00038 #else
00039 typedef PWTSENUMERATESERVERSA PWTSENUMERATESERVERS;
00040 char aWTSEnumerateServers[] = "WTSEnumerateServersA";
00041 #endif
00042
00043 PWTSENUMERATESERVERS pWTSEnumerateServers = NULL;
00044
00045
00046 typedef VOID (WINAPI *PWTSFREEMEMORY)(IN PVOID );
00047 char aWTSFreeMemory[] = "WTSFreeMemory";
00048 PWTSFREEMEMORY pWTSFreeMemory = NULL;
00049
00050
00051 /********************************************************************
00052  *
00053  *  EnumerateServers
00054  *
00055  *    Display a list of the Terminal Servers within the specified
00056  *    Windows NT domain
00057  *
00058  *
00059  * ENTRY:
00060  *    pDomainName (input)
00061  *       Pointer to Windows NT domain name (or NULL for current domain)
00062  *
00063  * EXIT:
00064  *    nothing
00065  *
00066  *********************************************************************/
00067
00068 void
00069 EnumerateServers( LPTSTR pDomainName )
00070 {
00071     PWTS_SERVER_INFO pServerInfo;
00072     DWORD Count;
00073     DWORD i;
00074
00075     _tprintf( TEXT("\nWTSEnumerateServers: domain %s\n"), pDomainName );
00076
00077     if ( !( (*pWTSEnumerateServers)( pDomainName,
00078                                     0,
00079                                     1,
00080                                     &pServerInfo,
00081                                     &Count ) ) )
00082     {
00083         _tprintf( TEXT("WTSEnumerateServers failed, error %u\n"),
00084                   GetLastError() );
00085         return;
00086     }
00087
00088     _tprintf( TEXT("WTSEnumerateServers: count %u\n"), Count );
00089
00090     for ( i=0; i < Count; i++ )
00091     {
00092         _tprintf( TEXT("%s "), pServerInfo[i].pServerName );
00093     }
00094     _tprintf( TEXT("\n") );
00095
00096     (*pWTSFreeMemory)( pServerInfo );
00097
00098 } // EnumerateServers()
00099
00100
00101 /**********************************************************************
00102  *
00103  *  LoadWTSAPI
00104  *
00105  *    Attempt to load WTSAPI32.DLL and find the entry point for the
00106  *    WTSEnumerateServers() function call.
00107  *
00108  * ENTRY:
00109  *    nothing
00110  *
00111  * EXIT:
00112  *    TRUE if WTSAPI.DLL loads successfully, FALSE if not.
00113  *
00114  *********************************************************************/
00115
00116 BOOL
00117 LoadWTSAPI(void)
00118 {
00119     HMODULE hWTSAPI = NULL;
00120
00121     /*
00122      *  Get handle to WTSAPI.DLL
00123      */
00124     if ((hWTSAPI = LoadLibrary(TEXT("WTSAPI32"))) == NULL )
00125         return(FALSE);
00126
00127     /*
00128      *  Get entry point for WTSEnumerateServers
00129      */
00130     pWTSEnumerateServers =
00131        (PWTSENUMERATESERVERS)GetProcAddress( hWTSAPI,
00132                                             aWTSEnumerateServers );
00133
00134     /*
00135      *  Get entry point for WTSFreeMemory
00136      */
00137     pWTSFreeMemory =
00138        (PWTSFREEMEMORY)GetProcAddress( hWTSAPI, aWTSFreeMemory );
00139
00140     return(TRUE);
00141 }
00142
00143
00144 /**********************************************************************
00145  *
00146  *  main
00147  *
00148  *********************************************************************/
00149
00150 void main( INT argc, CHAR **argv )
00151 {
00152     /*
00153      *  Attempt to load the WTSAPI32.DLL.  If this fails, the program
00154      *  will exit gracefully.
00155      *
00156      *  If your  application will run on both plain Windows NT and
00157      *  on Terminal Server, you can choose to use a reduced feature
00158      *  set on Windows NT.
00159      */
00160     if ( !LoadWTSAPI() )
00161     {
00162         _tprintf( TEXT("\
00163 Unable to load WTSAPI32.DLL.  This is because the system is running \n\
00164 on a non-Terminal Server system.  This program will now terminate. \n\
00165 (Your application could perform different things based on this result). \n") );
00166     }
00167     else
00168     {
00169         _tprintf( TEXT("\
00170 WTSAPI32.DLL loaded successfully, now enumerating servers...\n\n") );
00171         EnumerateServers( NULL );
00172     }
00173
00174 } // main()
00175
00176
00177
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/MainFrm.h Source File

  • WinBase
  • WtsApi
  • WtsApi

MainFrm.h

Go to the documentation of this file.
00001 // MainFrm.h : interface of the CMainFrame class
00002 //
00003 //  Copyright 1995-1999, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007
00008 #if !defined(AFX_MAINFRM_H__C090CEEE_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
00009 #define AFX_MAINFRM_H__C090CEEE_303B_11D1_8310_00C04FBEFCDA__INCLUDED_
00010
00011 #if _MSC_VER >= 1000
00012 #pragma once
00013 #endif // _MSC_VER >= 1000
00014
00015 #define TM_SERVERDLG 5000
00016 #define TM_SERVER_PROCESS 5001
00017
00018 class CMainFrame : public CFrameWnd
00019 {
00020 protected: // create from serialization only
00021   CMainFrame();
00022   DECLARE_DYNCREATE(CMainFrame)
00023
00024 // Attributes
00025 public:
00026
00027 // Operations
00028 public:
00029
00030 // Overrides
00031   // ClassWizard generated virtual function overrides
00032   //{{AFX_VIRTUAL(CMainFrame)
00033   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00034   //}}AFX_VIRTUAL
00035
00036 // Implementation
00037 public:
00038   virtual ~CMainFrame();
00039 #ifdef _DEBUG
00040   virtual void AssertValid() const;
00041   virtual void Dump(CDumpContext& dc) const;
00042 #endif
00043
00044 protected:  // control bar embedded members
00045   CStatusBar  m_wndStatusBar;
00046
00047 // Generated message map functions
00048 protected:
00049   //{{AFX_MSG(CMainFrame)
00050   afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00051   //afx_msg void OnPaint();
00052   //}}AFX_MSG
00053   DECLARE_MESSAGE_MAP()
00054 };
00055
00056 /////////////////////////////////////////////////////////////////////////////
00057
00058 //{{AFX_INSERT_LOCATION}}
00059 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00060
00061 #endif // !defined(AFX_MAINFRM_H__C090CEEE_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IPSAMPLE_IF_BINDING Member List

This is the complete list of members for _IPSAMPLE_IF_BINDING, including all inherited members.
dwState | _IPSAMPLE_IF_BINDING
ulCount | _IPSAMPLE_IF_BINDING
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/CEnumXXX.h Source File

  • Com
  • async
  • server

CEnumXXX.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #if !defined(__CEnumXXX__)
00019 #define __CEnumXXX__
00020
00021 template<class T, class ELT_T, class IFACE>
00022 class CEnumXXX : public IFACE
00023 {
00024 //private:
00025 public:  //TODO: set back to private after testing
00026         ULONG           m_cRef;         // Object reference count
00027         ULONG           m_iCur;         // Current element.
00028         ULONG           m_cELT;         // Number of element in container
00029         ELT_T*          m_prgELT;       // array of elements
00030     LPUNKNOWN   m_lpunk;    // Back pointer enumeratee
00031     REFIID      m_iid;
00032
00033 /*
00034  * The element list passed to this function will used directly by this class do not ever
00035  * free the list once it's been passed in
00036  */
00037 protected:
00038   virtual bool __stdcall Init(ELT_T *elemlist);
00039   CEnumXXX(LPUNKNOWN lpUnk, REFIID iid, DWORD nCount);
00040
00041 public:
00042   virtual ~CEnumXXX();
00043   static T* __stdcall Create(LPUNKNOWN lpUnk, DWORD nCount, ELT_T* elemlist);
00044
00045 private:
00046   CEnumXXX() :m_iid(CLSID_NULL) {};
00047
00048 public:
00049
00050     // IUnknown
00051   virtual HRESULT __stdcall QueryInterface(REFIID iid, PVOID *ppv);
00052     virtual ULONG __stdcall AddRef();
00053   virtual ULONG __stdcall Release();
00054   virtual void __stdcall FinalRelease();
00055
00056         //IEnumFORMATETC members
00057   virtual HRESULT __stdcall Next(ULONG celt, ELT_T* rgelt, PULONG pceltFetched);
00058   virtual HRESULT __stdcall Skip(ULONG celt);
00059   virtual HRESULT __stdcall Reset(void);
00060   virtual HRESULT __stdcall Clone(IFACE **ppenum);
00061 };
00062
00063
00064 #include "CEnumXXX.cpp"
00065 #endif //__CEnumXXX__
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/DataSource/sdksamplestoragesystem.h Source File

  • Multimedia
  • WindowsMediaServices9
  • DataSource

sdksamplestoragesystem.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            SDKSampleStorageSystem.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #pragma once
00013
00014 #ifndef __SDKSAMPLESTORAGESYSTEM_H_
00015 #define __SDKSAMPLESTORAGESYSTEM_H_
00016
00017 #include "resource.h"       // main symbols
00018
00019 // These are part of the WMS Server SDK.
00020 #include "dataContainer.h"
00021 #include "WMSBasicPlugin.h"
00022
00023 #define URL_SCHEME_LENGTH   9
00024 #define URL_SCHEME          L"sample://"
00025
00026 #define DIR_MASK_LENGTH     2
00027 #define DIR_MASK            L"\\*"
00028
00029 #define MAKEQWORD(a, b)     MAKEULONGLONG((a),(b))
00030 #define LODWORD(l)          ((DWORD)(l))
00031 #define HIDWORD(l)          ((DWORD)(((ULONGLONG)(l) >> 32) & 0xFFFFFFFF))
00032 #define MAKEULONGLONG(a, b) ((ULONGLONG)(((DWORD)(a)) | ((ULONGLONG)((DWORD)(b))) << 32))
00033
00034 class CSDKSampleStorageSystem;
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 // This is a single data container.
00038
00039 class CSampleDataContainer : public IWMSDataContainer
00040 {
00041 public:
00042     // CSampleDataContainer
00043     CSampleDataContainer();
00044     virtual ~CSampleDataContainer();
00045     HRESULT Shutdown();
00046     HRESULT Initialize(
00047                 IWMSContext *pUserContext,
00048                 LPWSTR pszContainerName,
00049                 DWORD dwFlags,
00050                 IWMSBufferAllocator __RPC_FAR *pBufferAllocator,
00051                 CSDKSampleStorageSystem *pOwnerContainer,
00052                 IWMSDataSourcePluginCallback __RPC_FAR *pCallback,
00053                 QWORD qwContext
00054                 );
00055
00056     void OnIoCompletion(
00057                         DWORD dwError,
00058                         DWORD dwIoType,
00059                         QWORD qwOffset,
00060                         DWORD cbTransferred,
00061                         BYTE *pbBuffer,
00062                         IWMSDataContainerCallback __RPC_FAR *pCallback,
00063                         QWORD qwContext
00064                         );
00065
00066     // IUnknown
00067     STDMETHOD_(ULONG, AddRef)();
00068     STDMETHOD_(ULONG, Release)();
00069     STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
00070
00071     // IWMSDataContainer
00072     virtual HRESULT STDMETHODCALLTYPE GetContainerFormat(
00073                     GUID __RPC_FAR *pFormat
00074                     );
00075     virtual HRESULT STDMETHODCALLTYPE GetDataSourcePlugin(
00076                     IWMSDataSourcePlugin __RPC_FAR *__RPC_FAR *ppDataSource
00077                     );
00078     virtual HRESULT STDMETHODCALLTYPE GetInfo(
00079                     DWORD dwInfoValueId,
00080                     IWMSDataContainerCallback __RPC_FAR *pCallback,
00081                     QWORD qwContext
00082                     );
00083     virtual HRESULT STDMETHODCALLTYPE Read(
00084                     BYTE __RPC_FAR *pbBuffer,
00085                     QWORD qwOffset,
00086                     DWORD dwMaxDataSize,
00087                     DWORD dwFlags,
00088                     IWMSDataContainerCallback __RPC_FAR *pCallback,
00089                     QWORD qwContext
00090                     );
00091     virtual HRESULT STDMETHODCALLTYPE Write(
00092                     BYTE __RPC_FAR *pbBuffer,
00093                     DWORD dwDataSize,
00094                     QWORD qwWritePosition,
00095                     IWMSDataContainerCallback __RPC_FAR *pCallback,
00096                     QWORD qwContext
00097                     );
00098     virtual HRESULT STDMETHODCALLTYPE GetTransferParameters(
00099                     QWORD qwDesiredOffset,
00100                     DWORD dwDesiredMinSize,
00101                     DWORD dwDesiredMaxSize,
00102                     QWORD *pqwOffset,
00103                     DWORD *pdwSize,
00104                     DWORD *pdwBufferAlignment
00105                     );
00106     virtual HRESULT STDMETHODCALLTYPE DoDataContainerExtendedCommand(
00107                     LPWSTR szCommandName,
00108                     IWMSCommandContext *pCommand,
00109                     DWORD dwCallFlags,
00110                     IWMSDataContainerCallback __RPC_FAR *pCallback,
00111                     QWORD qwContext
00112                     );
00113     virtual HRESULT STDMETHODCALLTYPE FinishParsingPacketlist(
00114                     IWMSPacketList *pPacketList
00115                     );
00116
00117 protected:
00118     enum { IO_READ, IO_WRITE };
00119     LONG                        m_cRef;
00120     CSDKSampleStorageSystem    *m_pOwnerStorageSystem;
00121     CHAR                       *m_pszPathName;
00122     HANDLE                      m_hFile;
00123     QWORD                       m_qwFileSize;
00124     DWORD                       m_dwAlignmentLog2;
00125     DWORD                       m_dwAlignment;
00126     CRITICAL_SECTION            m_CriticalSection;
00127 }; // End of CSampleDataContainer
00128
00129
00130
00131
00132
00133 /////////////////////////////////////////////////////////////////////////////
00134 // CSDKSampleStorageSystem
00135
00136 class ATL_NO_VTABLE CSDKSampleStorageSystem :
00137   public CComObjectRootEx<CComMultiThreadModel>,
00138   public CComCoClass<CSDKSampleStorageSystem, &CLSID_SDKSampleStorageSystem>,
00139     public IWMSDataSourcePlugin,
00140     public IWMSBasicPlugin
00141 {
00142 public:
00143     CSDKSampleStorageSystem();
00144     virtual ~CSDKSampleStorageSystem();
00145
00146 DECLARE_REGISTRY_RESOURCEID(IDR_SDKSAMPLESTORAGESYSTEM)
00147 DECLARE_GET_CONTROLLING_UNKNOWN()
00148
00149 DECLARE_PROTECT_FINAL_CONSTRUCT()
00150
00151 BEGIN_COM_MAP(CSDKSampleStorageSystem)
00152     COM_INTERFACE_ENTRY(IWMSDataSourcePlugin)
00153     COM_INTERFACE_ENTRY(IWMSBasicPlugin)
00154 END_COM_MAP()
00155
00156     // IWMSDataSourcePlugin
00157     virtual HRESULT STDMETHODCALLTYPE OpenDataContainer(
00158                     IWMSCommandContext *pCommandContext,
00159                     IWMSContext *pUserContext,
00160                     IWMSContext *pPresentationContext,
00161                     LPWSTR pszContainerName,
00162                     DWORD dwFlags,
00163                     IWMSBufferAllocator __RPC_FAR *pBufferAllocator,
00164                     IWMSDataSourcePluginCallback __RPC_FAR *pCallback,
00165                     QWORD qwContext
00166                     );
00167     virtual HRESULT STDMETHODCALLTYPE OpenDirectory(
00168                     IWMSCommandContext *pCommandContext,
00169                     IWMSContext *pUserContext,
00170                     IWMSContext *pPresentationContext,
00171                     LPWSTR pszContainerName,
00172                     DWORD dwFlags,
00173                     IWMSBufferAllocator *pBufferAllocator,
00174                     IWMSDataSourcePluginCallback *pCallback,
00175                     QWORD qwContext
00176                     );
00177     virtual HRESULT STDMETHODCALLTYPE DeleteDataContainer(
00178                     LPWSTR pszContainerName,
00179                     DWORD dwFlags,
00180                     IWMSDataSourcePluginCallback __RPC_FAR *pCallback,
00181                     QWORD qwContext
00182                     );
00183     virtual HRESULT STDMETHODCALLTYPE GetDataContainerVersion(
00184                     IWMSCommandContext __RPC_FAR *pCommandContext,
00185                     IWMSContext __RPC_FAR *pUserContext,
00186                     IWMSContext __RPC_FAR *pPresContext,
00187                     LPWSTR pszContainerName,
00188                     DWORD dwFlags,
00189                     IWMSDataSourcePluginCallback __RPC_FAR *pCallback,
00190                     QWORD qwContext
00191                     );
00192     virtual HRESULT STDMETHODCALLTYPE GetRootDirectories(
00193                     LPWSTR __RPC_FAR *pstrRootDirectoryList,
00194                     DWORD dwMaxRoots,
00195                     IWMSDataSourcePluginCallback __RPC_FAR *pCallback,
00196                     QWORD qwContext
00197                     );
00198     virtual HRESULT STDMETHODCALLTYPE GetDataSourceAttributes(
00199                     DWORD __RPC_FAR *pdwFlags
00200                     );
00201     virtual HRESULT STDMETHODCALLTYPE CreateDataSourceDirectory(
00202                     IWMSCommandContext *pCommandContext,
00203                     LPWSTR pszContainerName,
00204                     DWORD dwFlags,
00205                     IWMSDataSourcePluginCallback *pCallback,
00206                     QWORD qwContext
00207                     );
00208     virtual HRESULT STDMETHODCALLTYPE DeleteDirectory(
00209                     LPWSTR pszContainerName,
00210                     DWORD dwFlags,
00211                     IWMSDataSourcePluginCallback *pCallback,
00212                     QWORD qwContext
00213                     );
00214
00215
00216     // IWMSBasicPlugin
00217     virtual HRESULT STDMETHODCALLTYPE InitializePlugin(
00218                     IWMSContext __RPC_FAR *pServerContext,
00219                     IWMSNamedValues *pNamedValues,
00220                     IWMSClassObject __RPC_FAR *pClassFactory);
00221
00222     virtual HRESULT STDMETHODCALLTYPE GetCustomAdminInterface(
00223                     IDispatch **ppValue
00224                     );
00225     virtual HRESULT STDMETHODCALLTYPE OnHeartbeat();
00226     virtual HRESULT STDMETHODCALLTYPE ShutdownPlugin();
00227
00228     STDMETHOD( EnablePlugin )( long *pdwFlags, long *pdwHeartbeatPeriod );
00229     STDMETHOD( DisablePlugin )();
00230
00231 protected:
00232
00233     IWMSContext                     *m_pServerContext;
00234     IWMSNamedValues                 *m_pNamedValues;
00235     IWMSClassObject                 *m_pClassFactory;
00236     DWORD                            m_dwPageSize;
00237 };
00238
00239
00240 //////////////////////////////////////////////////////////////////////////////
00241 class CSampleDirectoryInfo
00242 {
00243 public:
00244     ///////////////////////////
00245     CSampleDirectoryInfo()
00246     {
00247         m_pszwName = NULL;
00248         m_dwFlags = 0;
00249         m_qwSize = 0;
00250         m_pNext = NULL;
00251     }
00252
00253     ///////////////////////////
00254     virtual ~CSampleDirectoryInfo()
00255     {
00256         if( NULL != m_pszwName )
00257         {
00258             CoTaskMemFree( m_pszwName );
00259             m_pszwName = NULL;
00260         }
00261     }
00262
00263 private:
00264     friend class CSampleDirectory;
00265
00266     LPOLESTR                m_pszwName;
00267     DWORD                   m_dwFlags;
00268     QWORD                   m_qwSize;
00269     CSampleDirectoryInfo    *m_pNext;
00270 }; // CSampleDirectoryInfo
00271
00272 /////////////////////////////////////////////////////////////////////////////
00273 // This is a single directory.
00274 class CSampleDirectory :  public IWMSDirectory
00275 {
00276 public:
00277     // CSampleDirectory
00278     CSampleDirectory();
00279     virtual ~CSampleDirectory();
00280
00281     HRESULT Initialize(
00282                 IWMSContext *pUserContext,
00283                 LPWSTR pszContainerName,
00284                 CSDKSampleStorageSystem *pOwnerStorageSystem,
00285                 IWMSDataSourcePluginCallback *pCallback,
00286                 QWORD qwContext
00287                 );
00288     HRESULT Shutdown();
00289
00290     // IUnknown
00291     STDMETHOD_(ULONG, AddRef)();
00292     STDMETHOD_(ULONG, Release)();
00293     STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
00294
00295     // IWMSDirectory
00296     virtual HRESULT STDMETHODCALLTYPE GetDataSourcePlugin(
00297                     IWMSDataSourcePlugin **ppDataSource
00298                     );
00299     virtual HRESULT STDMETHODCALLTYPE GetName(
00300                     LPOLESTR *pstrValue
00301                     );
00302     virtual HRESULT STDMETHODCALLTYPE GetChildInfo(
00303                     DWORD dwIndex,
00304                     WMSDirectoryEntryInfo *pInfo
00305                     );
00306
00307 protected:
00308     LONG                        m_cRef;
00309     CSDKSampleStorageSystem    *m_pOwnerStorageSystem;
00310     CRITICAL_SECTION            m_CriticalSection;
00311
00312     WCHAR                      *m_pPathName;
00313     DWORD                       m_dwPathNameLength;
00314     WCHAR                      *m_pSearchDirName;
00315     CSampleDirectoryInfo       *m_pChildren;
00316     CSampleDirectoryInfo       *m_pRecentChild;
00317     DWORD                       m_dwItemNum;
00318 }; // CSampleDirectory
00319
00320 #endif //__SDKSAMPLESTORAGESYSTEM_H_
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/Tools.h Source File

  • WinUI
  • Shell
  • SampView

Tools.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Tools.h
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "resource.h"
00023
00024 /**************************************************************************
00025    structure definitions
00026 **************************************************************************/
00027
00028 typedef struct
00029    {
00030    UINT  uImageSet;
00031    UINT  idCommand;
00032    int   iImage;
00033    int   idString;
00034    BYTE  bState;
00035    BYTE  bStyle;
00036    }MYTOOLINFO, *LPMYTOOLINFO;
00037
00038 extern MYTOOLINFO g_Tools[];
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/Dialer/Resource.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • Dialer

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by dialer.RC
00004 //
00005 #define IDI_DIALER                      1
00006 #define IDD_DDIAL                       1
00007 #define IDI_LINEBUSY                    116
00008 #define IDA_DIALER                      117
00009 #define IDM_MENU                        118
00010 #define IDD_DIALER                      200
00011 #define IDD_DCOMBO                      201
00012 #define IDD_DBUTTON1                    202
00013 #define IDD_DBUTTON2                    203
00014 #define IDD_DBUTTON3                    204
00015 #define IDD_DBUTTON4                    205
00016 #define IDD_DBUTTON5                    206
00017 #define IDD_DBUTTON6                    207
00018 #define IDD_DBUTTON7                    208
00019 #define IDD_DBUTTON8                    209
00020 #define IDD_DBUTTON9                    210
00021 #define IDD_DBUTTON0                    211
00022 #define IDD_DBUTTONSTAR                 212
00023 #define IDD_DBUTTONPOUND                213
00024 #define IDD_DSPEEDDIAL1                 214
00025 #define IDD_DSPEEDDIAL2                 215
00026 #define IDD_DSPEEDDIAL3                 216
00027 #define IDD_DSPEEDDIAL4                 217
00028 #define IDD_DSPEEDDIAL5                 218
00029 #define IDD_DSPEEDDIAL6                 219
00030 #define IDD_DSPEEDDIAL7                 220
00031 #define IDD_DSPEEDDIAL8                 221
00032 #define IDD_DSPEEDDIALGRP               222
00033 #define IDD_DNUMTODIAL                  223
00034 #define IDD_DRECTSEPARATOR              224
00035 #define IDD_DSPEEDDIALTEXT1             225
00036 #define IDD_DSPEEDDIALTEXT2             226
00037 #define IDD_DSPEEDDIALTEXT3             227
00038 #define IDD_DSPEEDDIALTEXT4             228
00039 #define IDD_DSPEEDDIALTEXT5             229
00040 #define IDD_DSPEEDDIALTEXT6             230
00041 #define IDD_DSPEEDDIALTEXT7             231
00042 #define IDD_DSPEEDDIALTEXT8             232
00043 #define IDD_SD1                         300
00044 #define IDD_SD1SPEEDDIAL1               301
00045 #define IDD_SD1SPEEDDIAL2               302
00046 #define IDD_SD1SPEEDDIAL3               303
00047 #define IDD_SD1SPEEDDIAL4               304
00048 #define IDD_SD1SPEEDDIAL5               305
00049 #define IDD_SD1SPEEDDIAL6               306
00050 #define IDD_SD1SPEEDDIAL7               307
00051 #define IDD_SD1SPEEDDIAL8               308
00052 #define IDD_SD1EDITNAME                 317
00053 #define IDD_SD1EDITNUMBER               318
00054 #define IDD_SD1TEXTCHOOSE               319
00055 #define IDD_SD1TEXTENTER                320
00056 #define IDD_SD1TEXTNAME                 321
00057 #define IDD_SD1TEXTNUMBER               322
00058 #define IDD_SD1RECTSEPARATOR            323
00059 #define IDD_SD1SPEEDDIALTEXT1           324
00060 #define IDD_SD1SPEEDDIALTEXT2           325
00061 #define IDD_SD1SPEEDDIALTEXT3           326
00062 #define IDD_SD1SPEEDDIALTEXT4           327
00063 #define IDD_SD1SPEEDDIALTEXT5           328
00064 #define IDD_SD1SPEEDDIALTEXT6           329
00065 #define IDD_SD1SPEEDDIALTEXT7           330
00066 #define IDD_SD1SPEEDDIALTEXT8           331
00067 #define IDD_SD2                         400
00068 #define IDD_SD2SAVEANDDIAL              401
00069 #define IDD_SD2EDITNAME                 402
00070 #define IDD_SD2EDITNUMBER               403
00071 #define IDD_SD2TEXTENTER                404
00072 #define IDD_SD2TEXTNAME                 405
00073 #define IDD_SD2TEXTNUMBER               406
00074 #define IDD_CONNECTUSING                500
00075 #define IDD_CULISTLINE                  501
00076 #define IDD_CULISTADDRESS               502
00077 #define IDD_CUSIMPLETAPICHKBOX          503
00078 #define IDD_CUTEXTLINE                  504
00079 #define IDD_CUTEXTADDRESS               505
00080 #define IDD_CUPROPERTIES                506
00081 #define IDD_ABOUT                       700
00082 #define IDD_AICON                       701
00083 #define IDD_ATEXTTITLE                  702
00084 #define IDD_ATEXTVERSION                703
00085 #define IDD_ATEXTWINMODE                704
00086 #define IDD_ATEXTFREEMEM                705
00087 #define IDD_ATEXTRESOURCE               706
00088 #define IDD_ATEXTCOPYRIGHT              707
00089 #define IDD_INUSE                       900
00090 #define IDD_IUICON                      901
00091 #define ikszAppName                     901
00092 #define IDD_IUTEXT1                     902
00093 #define ikszAppFriendlyName             902
00094 #define IDD_IUTEXT2                     903
00095 #define ikszErrDefault                  940
00096 #define ikszErrOOM                      941
00097 #define ikszErrTAPI                     942
00098 #define ikszErrNoVoiceLine              943
00099 #define ikszErrInvalAddress             945
00100 #define ikszErrLineInitWrongDrivers     949
00101 #define ikszErrAddrBlocked              950
00102 #define ikszErrBillingRejected          952
00103 #define ikszErrResUnavail               956
00104 #define ikszWarningTitle                977
00105 #define ikszWarningRegisterSTapi        978
00106 #define ikszWarningFor911               978
00107 #define ikszWarningNewDefault           979
00108 #define IDM_EXIT                        1000
00109 #define IDM_EDIT_CUT                    1001
00110 #define IDM_EDIT_COPY                   1002
00111 #define IDD_DGNUMBERTEXT                1002
00112 #define IDM_EDIT_PASTE                  1003
00113 #define IDM_EDIT_DELETE                 1004
00114 #define IDD_DGNAMETEXT                  1004
00115 #define IDM_EDIT_SPEEDDIAL              1005
00116 #define IDM_CONNECTUSING                1006
00117 #define IDM_LOCATION                    1008
00118 #define IDM_ABOUT                       1011
00119 #define IDM_ACCEL_NUMTODIAL             1012
00120 #define ikszErrLineInitBadIniFile       1013
00121 #define IDM_ACCEL_HELP                  1013
00122 #define ikszErrLineInitNoDriver         1014
00123 #define ikszErrBadTAPIAddr              1015
00124 #define ikszErrLineInitNoDevice         1016
00125 #define ikszErrNoMultipleInstance       1020
00126 #define IDD_CALLFAILED                  1300
00127 #define IDD_CFTEXT                      1301
00128 #define ikszWarning911                  1544
00129 #define ikszDisconnectedReject          1545
00130 #define ikszDisconnectedBusy            1546
00131 #define ikszDisconnectedNoAnswer        1547
00132 #define ikszDisconnectedCantDo          1548
00133 #define ikszDisconnectedNetwork         1549
00134 #define ikszDisconnectedIncompatible    1550
00135 #define ikszErrInvalCallState           1551
00136 #define ikszWarningTapiReInit           1552
00137 #define ikszErrLineClose                1553
00138 #define ikszDisconnectedNoDialTone      1554
00139 #define ikszErrInvalidCountryCode       1555
00140 #define IDD_DIALING                     9115
00141 #define IDD_CUERRORTEXT                 -1
00142 #define IDD_DGNUMBER                    -1
00143
00144 // Next default values for new objects
00145 //
00146 #ifdef APSTUDIO_INVOKED
00147 #ifndef APSTUDIO_READONLY_SYMBOLS
00148 #define _APS_NEXT_RESOURCE_VALUE        9116
00149 #define _APS_NEXT_COMMAND_VALUE         40001
00150 #define _APS_NEXT_CONTROL_VALUE         1005
00151 #define _APS_NEXT_SYMED_VALUE           9101
00152 #endif
00153 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Client/ClientDlg.h Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Client

ClientDlg.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: clientDlg.h
00004
00005 Summary:  Produced and maintained by VS6 MFC Wizards.
00006           Defines Dialogs used in client.exe.
00007
00008 ----------------------------------------------------------------------------
00009
00010 This file is part of the Microsoft COM+ Samples.
00011
00012 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00013
00014 This source code is intended only as a supplement to Microsoft
00015 Development Tools and/or on-line documentation. See these other
00016 materials for detailed information regarding Microsoft code samples.
00017
00018 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00021 PARTICULAR PURPOSE.
00022
00023 ==========================================================================+*/
00024
00025 #if !defined(AFX_CLIENTDLG_H__146DF855_4D72_11D2_9672_00AA00B913AC__INCLUDED_)
00026 #define AFX_CLIENTDLG_H__146DF855_4D72_11D2_9672_00AA00B913AC__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // CClientDlg dialog
00034
00035 class CClientDlg : public CDialog
00036 {
00037 // Construction
00038 public:
00039   CClientDlg(CWnd* pParent = NULL); // standard constructor
00040
00041 // Dialog Data
00042   //{{AFX_DATA(CClientDlg)
00043   enum { IDD = IDD_CLIENT_DIALOG };
00044   CButton m_ctlStart;
00045   CStatic m_cWarning;
00046   CStatic m_cGood;
00047   CStatic m_cBad;
00048   long  m_iData;
00049   long  m_lPings;
00050   long  m_lTimeouts;
00051   long  m_lTries;
00052   BOOL  m_bUsePing;
00053   long  m_lFails;
00054   CString m_cRSN;
00055   long  m_lPingFailures;
00056   //}}AFX_DATA
00057
00058   // ClassWizard generated virtual function overrides
00059   //{{AFX_VIRTUAL(CClientDlg)
00060   protected:
00061   virtual void DoDataExchange(CDataExchange* pDX);  // DDX/DDV support
00062   //}}AFX_VIRTUAL
00063
00064 // Implementation
00065 protected:
00066   HICON m_hIcon;
00067
00068   // Generated message map functions
00069   //{{AFX_MSG(CClientDlg)
00070   virtual BOOL OnInitDialog();
00071   afx_msg void OnPaint();
00072   afx_msg HCURSOR OnQueryDragIcon();
00073   virtual void OnOK();
00074   afx_msg void OnUsePing();
00075   afx_msg void OnStart();
00076   //}}AFX_MSG
00077   DECLARE_MESSAGE_MAP()
00078 };
00079
00080 //{{AFX_INSERT_LOCATION}}
00081 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00082
00083 #endif // !defined(AFX_CLIENTDLG_H__146DF855_4D72_11D2_9672_00AA00B913AC__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/gutils.cpp Source File

  • Begin
  • sdkdiff

gutils.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #include "precomp.h"
00012 #include "gutilsrc.h"
00013
00014 /* dll global data */
00015 HANDLE hLibInst;
00016 extern void gtab_init(void);
00017 extern BOOL StatusInit(HANDLE);
00018
00019 #ifdef WIN32
00020 BOOL WINAPI InitGutils(HANDLE hInstance, DWORD dwReason, LPVOID reserved)
00021 {
00022         if (dwReason == DLL_PROCESS_ATTACH) {
00023                 hLibInst = hInstance;
00024                 gtab_init();
00025                 StatusInit(hLibInst);
00026         }
00027         return(TRUE);
00028 }
00029
00030 #else
00031
00032 WORD wLibDataSeg;
00033
00034
00035 BOOL FAR PASCAL
00036 LibMain(HANDLE hInstance, WORD   wDataSeg, WORD   cbHeap, LPSTR  lpszCmdLine)
00037 {
00038   hLibInst = hInstance;
00039   wLibDataSeg = wDataSeg;
00040
00041   gtab_init();
00042   StatusInit(hLibInst);
00043   return(TRUE);
00044
00045 }
00046 #endif
00047
00048 /* needed for win16 - but does no harm in NT */
00049 int FAR PASCAL
00050 WEP (int bSystemExit)
00051 {
00052     return(TRUE);
00053 }
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Rcmd/Client.c Source File

  • Security
  • Authorization
  • Rcmd

Client.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     client.c
00012
00013 Abstract:
00014
00015     This sample illustrates a simple client side of the DuplicateTokenEx()
00016     server sample.
00017
00018     This client functions correctly on the following platforms:
00019     Windows NT 3.5
00020     Windows NT 3.51
00021     Windows NT 4.0
00022     Windows 95
00023 --*/
00024
00025 #include <windows.h>
00026 #include <stdio.h>
00027
00028 DWORD
00029 WINAPI
00030 ReadFunc(
00031     LPVOID lpParam
00032     );
00033
00034 DWORD
00035 WINAPI
00036 WriteFunc(
00037     LPVOID lpParam
00038     );
00039
00040 void
00041 DisplayWinError(
00042     LPSTR szAPI,    // pointer to Ansi function name
00043     DWORD dwError   // DWORD WinError
00044     );
00045
00046 #define RTN_OK 0
00047 #define RTN_USAGE 1
00048 #define RTN_ERROR 13
00049
00050 int
00051 __cdecl
00052 main(
00053     int argc,
00054     char *argv[]
00055     )
00056 {
00057     HANDLE hFileRead;
00058     HANDLE hFileWrite;
00059
00060     HANDLE hThread;
00061     DWORD dwThreadId;
00062
00063     CHAR PipeIn[255];
00064     CHAR PipeOut[255];
00065
00066     if(argc == 1) {
00067         printf("Usage: %s <\\\\server\n", argv[0]);
00068         printf("  %s \\\\WINBASE (remote server is \\\\winbase)\n", argv[0]);
00069         printf("  %s \\\\. (local server)\n",   argv[0]);
00070         return RTN_USAGE;
00071     }
00072
00073     //
00074     // build Pipe names
00075     //
00076     wsprintf(PipeIn, "%s\\pipe\\rcmd_out", argv[1]);
00077     wsprintf(PipeOut, "%s\\pipe\\rcmd_in", argv[1]);
00078
00079     //
00080     // wait for the outbound (inbound on server-side) pipe to be available
00081     //
00082     WaitNamedPipe(PipeOut, NMPWAIT_WAIT_FOREVER);
00083
00084     hFileWrite = CreateFile(
00085         PipeOut,
00086         GENERIC_WRITE,
00087         0, // exclusive open
00088         NULL,
00089         OPEN_EXISTING,
00090         SECURITY_SQOS_PRESENT | SECURITY_IMPERSONATION, // server can impersonate
00091         NULL
00092         );
00093
00094     if(hFileWrite == INVALID_HANDLE_VALUE) {
00095         DisplayWinError("CreateFile", GetLastError());
00096         return RTN_ERROR;
00097     }
00098
00099     //
00100     // wait for the inbound (outbound on server-side) pipe to be available
00101     // we time-out in 5 seconds because the server should be ready for us
00102     // right-away
00103     //
00104     WaitNamedPipe(PipeIn, 5 * 1000);
00105
00106     hFileRead = CreateFile(
00107         PipeIn,
00108         GENERIC_READ,
00109         0, // exclusive open
00110         NULL,
00111         OPEN_EXISTING,
00112         0,
00113         NULL
00114         );
00115
00116     if(hFileRead == INVALID_HANDLE_VALUE) {
00117         DisplayWinError("CreateFile", GetLastError());
00118         return RTN_ERROR;
00119     }
00120
00121     //
00122     // start a thread to handle stdin redirection to the pipe
00123     //
00124     hThread = CreateThread(
00125         NULL,
00126         0,
00127         WriteFunc,
00128         (LPVOID)hFileWrite, // parm
00129         0,
00130         &dwThreadId
00131         );
00132
00133     if(hThread == NULL) {
00134         DisplayWinError("CreateThread", GetLastError());
00135         return RTN_ERROR;
00136     }
00137
00138     //
00139     // handle stdout redirection
00140     //
00141     ReadFunc((LPVOID)hFileRead);
00142
00143     //
00144     // if the read returned, kill the write, cleanup, and then exit
00145     //
00146     TerminateThread(hThread, 0xFFFFFFFF);
00147     CloseHandle(hThread);
00148
00149     CloseHandle(hFileRead);
00150     CloseHandle(hFileWrite);
00151
00152     return RTN_OK;
00153 }
00154
00155 DWORD
00156 WINAPI
00157 ReadFunc(
00158     LPVOID lpParam
00159     )
00160 {
00161     #define BUFFER_SIZE 4096
00162
00163     HANDLE hFile = (HANDLE)lpParam;
00164     BYTE lpBuffer[BUFFER_SIZE];
00165
00166     DWORD dwBytesRead;
00167     DWORD dwBytesWritten;
00168
00169     HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
00170
00171     DWORD dwLastError;
00172
00173     while (1) {
00174         if(!ReadFile(
00175             hFile,
00176             lpBuffer,
00177             BUFFER_SIZE,
00178             &dwBytesRead,
00179             NULL
00180             )) {
00181             dwLastError = GetLastError();
00182
00183             if(dwLastError == ERROR_NO_DATA) continue;
00184             if(dwLastError != ERROR_MORE_DATA) break;
00185         }
00186
00187         if(!WriteFile(
00188             hStdOut,
00189             lpBuffer,
00190             dwBytesRead,
00191             &dwBytesWritten,
00192             NULL
00193             )) break;
00194     }
00195
00196     return GetLastError();
00197 }
00198
00199 DWORD
00200 WINAPI
00201 WriteFunc(
00202     LPVOID lpParam
00203     )
00204 {
00205     HANDLE hPipe = (HANDLE)lpParam;
00206
00207     BYTE lpBuffer[ 1 ]; // change this later
00208
00209     DWORD dwBytesRead;
00210     DWORD dwBytesWritten;
00211
00212     HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
00213
00214     while (1) {
00215         //
00216         // TODO rework this loop to be line-based.
00217         // this would entail doing the console buffering outselves.
00218         //
00219         if(!ReadFile(
00220             hStdIn,
00221             lpBuffer,
00222             1,
00223             &dwBytesRead,
00224             NULL
00225             )) break;
00226
00227         if(!WriteFile(
00228             hPipe,
00229             lpBuffer,
00230             dwBytesRead,
00231             &dwBytesWritten,
00232             NULL
00233             )) break;
00234     }
00235
00236     return GetLastError();
00237 }
00238
00239 void
00240 DisplayWinError(
00241     LPSTR szAPI,    // pointer to Ansi function name
00242     DWORD dwError   // DWORD WinError
00243     )
00244 {
00245     LPSTR MessageBuffer;
00246     DWORD dwBufferLength;
00247
00248     //
00249     // TODO get this fprintf out of here!
00250     //
00251     fprintf(stderr,"%s error!\n", szAPI);
00252
00253     if(dwBufferLength=FormatMessageA(
00254             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00255             FORMAT_MESSAGE_FROM_SYSTEM,
00256             NULL,
00257             dwError,
00258             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00259             (LPSTR) &MessageBuffer,
00260             0,
00261             NULL
00262             ))
00263     {
00264         DWORD dwBytesWritten; // unused
00265
00266         //
00267         // Output message string on stderr
00268         //
00269         WriteFile(
00270                 GetStdHandle(STD_ERROR_HANDLE),
00271                 MessageBuffer,
00272                 dwBufferLength,
00273                 &dwBytesWritten,
00274                 NULL
00275                 );
00276
00277         //
00278         // free the buffer allocated by the system
00279         //
00280         LocalFree(MessageBuffer);
00281     }
00282 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcBall.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcBall.h

Go to the documentation of this file.
00001 #if !defined(AFX_AGENTCTLBALLOONEX_H__AB8FEBA7_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00002 #define AFX_AGENTCTLBALLOONEX_H__AB8FEBA7_3841_11D2_8512_00C04FA34A14__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00008
00009 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00010 //  Microsoft Visual C++, your modifications will be overwritten.
00011
00012 /////////////////////////////////////////////////////////////////////////////
00013 // CAgentCtlBalloonEx wrapper class
00014
00015 class CAgentCtlBalloonEx : public COleDispatchDriver
00016 {
00017 public:
00018   CAgentCtlBalloonEx() {}   // Calls COleDispatchDriver default constructor
00019   CAgentCtlBalloonEx(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
00020   CAgentCtlBalloonEx(const CAgentCtlBalloonEx& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
00021
00022 // Attributes
00023 public:
00024
00025 // Operations
00026 public:
00027   BOOL GetEnabled();
00028   long GetNumberOfLines();
00029   long GetCharsPerLine();
00030   CString GetFontName();
00031   long GetFontSize();
00032   BOOL GetFontBold();
00033   BOOL GetFontItalic();
00034   BOOL GetFontStrikethru();
00035   BOOL GetFontUnderline();
00036   long GetForeColor();
00037   long GetBackColor();
00038   long GetBorderColor();
00039   void SetVisible(BOOL bNewValue);
00040   BOOL GetVisible();
00041   void SetFontName(LPCTSTR lpszNewValue);
00042   void SetFontSize(long nNewValue);
00043   void SetFontCharSet(short nNewValue);
00044   short GetFontCharSet();
00045   void SetStyle(long nNewValue);
00046   long GetStyle();
00047 };
00048
00049 //{{AFX_INSERT_LOCATION}}
00050 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00051
00052 #endif // !defined(AFX_AGENTCTLBALLOONEX_H__AB8FEBA7_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COLDESC Member List

This is the complete list of members for COLDESC, including all inherited members.
bPrecision | COLDESC
bScale | COLDESC
dwFlags | COLDESC
fIsAutoInc | COLDESC
fIsNullable | COLDESC
fIsPrimaryKey | COLDESC
iOrdinal | COLDESC
ulColumnSize | COLDESC
ulCreateParams | COLDESC
wszColName | COLDESC
wszTypeName | COLDESC
wType | COLDESC
Generated on Wed Nov 13 2024 16:56:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CGroupData Member List

This is the complete list of members for CGroupData, including all inherited members.
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CGroupData | [virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CGroupData | [virtual]
CObjData(void) | CObjData | [inline]
CObjData(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
GetHGroup(void) | CGroupData | [inline]
GetHGroup(void) | CGroupData | [inline]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
HrInitialize(IUnknown *piDataIn) | CGroupData | [protected, virtual]
HrInitialize(IUnknown *piDataIn) | CGroupData | [protected, virtual]
InvokeCommand(ULONG nCommandIDIn) | CGroupData | [virtual]
InvokeCommand(ULONG nCommandIDIn) | CGroupData | [virtual]
m_cot | CObjData | [protected]
m_hGroup | CGroupData | [private]
m_rgprtcPSPages | CObjData | [protected]
m_rgprtcWizPages | CObjData | [protected]
m_strName | CObjData | [protected]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
StrName(void) | CObjData | [inline, virtual]
StrName(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Accept/TestAccept.cpp Source File

  • NetDS
  • WinSock
  • Accept

TestAccept.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: TestAccept.cpp
00009 //
00010 // Description:
00011 //             This file contains the functions for a client that tests
00012 // the accept implementation.
00013
00014 #pragma warning (disable: 4267)
00015
00016 #include <winsock2.h>   // for Winsock API
00017 #include <windows.h>    // for Win32 APIs and types
00018 #include <ws2tcpip.h>   // for IPv6 support
00019 #include <wspiapi.h>    // for IPv6 support
00020 #include <strsafe.h>    // for safe versions of string functions
00021 #include <stdio.h>      // for printing to stdout.
00022
00023
00024 // The following are the default values for the various command-line
00025 // options.
00026 #define DEFAULT_ADDRESS_FAMILY          AF_UNSPEC
00027 #define DEFAULT_SERVER                  "localhost"
00028 #define DEFAULT_PORT                    "7243"
00029 #define DEFAULT_SEND_BUFFER_SIZE        1024
00030 #define DEFAULT_RECV_BUFFER_SIZE        10240
00031 #define DEFAULT_LOOP_COUNT              1
00032 #define DEFAULT_DELAY                   5000
00033 #define DEFAULT_SCENARIO                5
00034
00035
00036 // The following are the different scenarios supported for testing
00037 // the Accept server implementation. The ideal send receive is the
00038 // recommended scenario for real world use. The other scenarios
00039 // are meant to understand the various problems that would be
00040 // caused in the server if the client behaves (or misbehaves) in a
00041 // particular way.
00042 enum
00043 {
00044     SC_SEND_THEN_RECV = 1,
00045     SC_SEND_NO_RECV = 2,
00046     SC_SEND_WAIT_RECV = 3,
00047     SC_WAIT_SEND_RECV = 4,
00048     SC_IDEAL_SEND_RECV = 5,
00049     SC_NUM_SCENARIOS = 5
00050 };
00051
00052
00053 // structure that bundles all the global variables needed between different
00054 // functions into a global context.
00055 typedef struct _ClientContext
00056 {
00057     BYTE    addressFamily;
00058     char    *szServer;
00059     char    *szPort;
00060     LONG    sendBufSize;
00061     LONG    recvBufSize;
00062     LONG    loopCount;
00063     LONG    delay;
00064     BYTE    scenario;
00065     char    *pSendBuf;
00066     char    *pRecvBuf;
00067     int     nBytesRemainingToBeSent;
00068     int     nBytesRecd;
00069     SOCKET  sock;
00070
00071 } ClientContext;
00072
00073 ClientContext g_ClientContext;
00074
00075 /*
00076     This function converts a given address family into its corresponding string
00077     representation for display purposes.
00078 */
00079 const char *AFImage(BYTE addressFamily)
00080 {
00081     char *szRetVal;
00082
00083     // return the corresponding string for the given address family.
00084     switch (addressFamily)
00085     {
00086         case AF_UNSPEC : szRetVal = "AF_UNSPEC";
00087                          break;
00088         case AF_INET   : szRetVal = "AF_INET";
00089                          break;
00090         case AF_INET6  : szRetVal = "AF_INET6";
00091                          break;
00092         default        : szRetVal = "Unrecognized";
00093                          break;
00094     }
00095
00096     return szRetVal;
00097 }
00098
00099
00100 /*
00101     This function prints the available command-line options, the arguments
00102     expected by each of them and the valid input values and the default
00103     values for each them.
00104 */
00105 void PrintUsage(char *szProgramName)
00106 {
00107     printf("\n\n"
00108            "Usage:\n"
00109            "------\n"
00110            "   %s <options> \n\n"
00111            "where <options> is one or more of the following: \n\n"
00112            "   -a <0|4|6>      Address Family: 0 for Either\n"
00113            "                                   4 for IPv4\n"
00114            "                                   6 for IPv6\n"
00115            "                   Default: %d\n\n"
00116            "   -n <server>     Server Name or IP\n"
00117            "                   Default: %s\n\n"
00118            "   -e <endpoint>   Port number\n"
00119            "                   Default: %s\n\n"
00120            "   -b <bytes>      Bytes to send\n"
00121            "                   Default: %d\n\n"
00122            "   -l <count>      Loop count times \n"
00123            "                   Default: %d\n\n"
00124            "   -d <millisecs>  Delay after or before send (see -s 3 & -s 4)\n"
00125            "                   Default: %d\n\n"
00126            "   -s <1..5>       Scenario: \n"
00127            "                      1 : Finish all sends, then recv\n"
00128            "                      2 : Finish all sends, no recv\n"
00129            "                      3 : Finish all sends, wait, then recv\n"
00130            "                      4 : First wait, then send, then recv\n"
00131            "                      5 : Ideal Send and Recv sequence\n"
00132            "                   Default: %d\n\n"
00133            "\n",
00134            szProgramName,
00135            DEFAULT_ADDRESS_FAMILY,
00136            DEFAULT_SERVER,
00137            DEFAULT_PORT,
00138            DEFAULT_SEND_BUFFER_SIZE,
00139            DEFAULT_LOOP_COUNT,
00140            DEFAULT_DELAY,
00141            DEFAULT_SCENARIO
00142            );
00143
00144     return;
00145 }
00146
00147 /*
00148     This function parses the given input arguments and fills up the
00149     corresponding fields in the g_ClientContext structure.
00150 */
00151 BOOL ParseArguments(int argc, char *argv[])
00152 {
00153     // holds the return value from this function.
00154     // TRUE indicates that all the supplied arguments are valid.
00155     // FALSE indicates incorrect or insufficient number of arguments.
00156     BOOL retVal = FALSE;
00157
00158     // loop index to go over the command-line arguments one by one.
00159     int i;
00160
00161     printf("Entering ParseArguments()\n");
00162
00163     // fill up the default arguments and let the user options override these.
00164     g_ClientContext.addressFamily = DEFAULT_ADDRESS_FAMILY;
00165     g_ClientContext.szServer = DEFAULT_SERVER;
00166     g_ClientContext.szPort = DEFAULT_PORT;
00167     g_ClientContext.sendBufSize = DEFAULT_SEND_BUFFER_SIZE;
00168     g_ClientContext.recvBufSize = DEFAULT_RECV_BUFFER_SIZE;
00169     g_ClientContext.loopCount = DEFAULT_LOOP_COUNT;
00170     g_ClientContext.delay = DEFAULT_DELAY;
00171     g_ClientContext.scenario = DEFAULT_SCENARIO;
00172
00173     // process each argument in the argv list.
00174     for (i = 1; i < argc ; i++)
00175     {
00176         char firstChar = argv[i][0];
00177
00178         // make sure the option begins with a - or /
00179         if (!(firstChar == '-' || firstChar == '/'))
00180         {
00181             printf("ERROR: Option has to begin with - or / : %s\n", argv[i]);
00182             PrintUsage(argv[0]);
00183             goto CLEANUP;
00184         }
00185
00186         // process the option.
00187         switch(argv[i][1])
00188         {
00189             case 'a' :
00190
00191                 // Address Family.
00192                 // should be -a 0 or -a 4 or -a 6
00193
00194                 // first check if there's one more argument.
00195                 if (i + 1 >= argc)
00196                 {
00197                     printf("ERROR: Argument 0/4/6 needed for -a option\n");
00198                     PrintUsage(argv[0]);
00199                     goto CLEANUP;
00200                 }
00201
00202                 // extract and validate the AF number.
00203                 switch(atoi(argv[i+1]))
00204                 {
00205                     // Unspecified.
00206                     case 0:
00207                       g_ClientContext.addressFamily = AF_UNSPEC;
00208                       break;
00209
00210                     // IPv4.
00211                     case 4:
00212                       g_ClientContext.addressFamily = AF_INET;
00213                       break;
00214
00215                     // IPv6.
00216                     case 6:
00217                       g_ClientContext.addressFamily = AF_INET6;
00218                       break;
00219
00220                     // Invalid value.
00221                     default:
00222                       printf("ERROR: Invalid address family. Must be 0/4/6\n");
00223                       PrintUsage(argv[0]);
00224                       goto CLEANUP;
00225                 }
00226
00227                 // indicate that we have processed the next argument as well.
00228                 i++;
00229
00230                 // AF was fine. continue.
00231                 break;
00232
00233             case 'n' :
00234
00235                 // Interface to listen on.
00236                 // should be -n <server Name>
00237
00238                 // first check if there's one more argument.
00239                 if (i + 1 >= argc)
00240                 {
00241                     printf("ERROR: Server name needed for -n option\n");
00242                     PrintUsage(argv[0]);
00243                     goto CLEANUP;
00244                 }
00245
00246                 // make sure the input string length is less than
00247                 // the INET6_ADDRSTRLEN, the maximum valid IP address length.
00248                 if (FAILED(StringCchLength(argv[i+1],INET6_ADDRSTRLEN, NULL)))
00249                 {
00250                     printf("ERROR: Server name string too long. "
00251                            "can't exceed %d characters\n",
00252                            INET6_ADDRSTRLEN);
00253                     PrintUsage(argv[0]);
00254                     goto CLEANUP;
00255                 }
00256
00257                 // remember the interface string.
00258                 g_ClientContext.szServer = argv[i+1];
00259
00260                 // indicate that we have processed the next argument as well.
00261                 i++;
00262
00263                 // continue.
00264                 break;
00265
00266             case 'e' :
00267
00268                 // Endpoint or Port.
00269                 // should be -e <port number>
00270
00271                 // first check if there's one more argument.
00272                 if (i + 1 >= argc)
00273                 {
00274                     printf("ERROR: Port number needed for -e option\n");
00275                     PrintUsage(argv[0]);
00276                     goto CLEANUP;
00277                 }
00278
00279                 // make sure the input string length is less than
00280                 // the maximum length for a service name.
00281                 if (FAILED(StringCchLength(argv[i+1], NI_MAXSERV, NULL)))
00282                 {
00283                     printf("ERROR: Port number too long. "
00284                            "can't exceed %d characters\n",
00285                            NI_MAXSERV);
00286
00287                     PrintUsage(argv[0]);
00288                     goto CLEANUP;
00289                 }
00290
00291                 // remember the port number string.
00292                 g_ClientContext.szPort = argv[i+1];
00293
00294                 // indicate that we have processed the next argument as well.
00295                 i++;
00296
00297                 // continue.
00298                 break;
00299
00300             case 'b' :
00301
00302                 // Bytes to Send
00303                 // should be -b <bytes>.
00304
00305                 // first check if there's one more argument.
00306                 if (i + 1 >= argc)
00307                 {
00308                     printf("ERROR: Number of bytes needed for -b option\n");
00309                     PrintUsage(argv[0]);
00310                     goto CLEANUP;
00311                 }
00312
00313                 // extract the bytes value
00314                 g_ClientContext.sendBufSize = atol(argv[i+1]);
00315
00316                 // indicate that we have processed the next argument as well.
00317                 i++;
00318
00319                 // validate the buffer size.
00320                 if (g_ClientContext.sendBufSize < 0)
00321                 {
00322                     printf("ERROR: Number of bytes must be > 0 \n");
00323                     PrintUsage(argv[0]);
00324                     goto CLEANUP;
00325                 }
00326
00327                 // Continue.
00328                 break;
00329
00330             case 'l' :
00331
00332                 // Loop Count
00333                 // should be -l or -l <count>.
00334
00335                 // if there's one more argument, parse it.
00336                 if (i + 1 < argc)
00337                 {
00338                     g_ClientContext.loopCount = atol(argv[i+1]);
00339
00340                     // make sure loop count is 1 or more, if specified.
00341                     if (g_ClientContext.loopCount < 1)
00342                     {
00343                         printf("ERROR: Loop Count must be > 0 : %d\n",
00344                                 g_ClientContext.loopCount);
00345                         PrintUsage(argv[0]);
00346                         goto CLEANUP;
00347                     }
00348
00349                     // indicate that we have processed the next argument
00350                     // as well.
00351                     i++;
00352                 }
00353
00354
00355                 // Continue.
00356                 break;
00357
00358             case 'd' :
00359
00360                 // Delay in milliseconds.
00361                 // should be -d <millisecs>.
00362
00363                 // first check if there's one more argument.
00364                 if (i + 1 >= argc)
00365                 {
00366                     printf("ERROR: Number of milliseconds needed "
00367                            "for -d option\n");
00368                     PrintUsage(argv[0]);
00369                     goto CLEANUP;
00370                 }
00371
00372                 // extract the delay value
00373                 g_ClientContext.delay = atol(argv[i+1]);
00374
00375                 // indicate that we have processed the next argument as well.
00376                 i++;
00377
00378                 // Continue.
00379                 break;
00380
00381             case 's' :
00382
00383                 // Scenario Number.
00384                 // should be -s <scenario number>.
00385
00386                 // first check if there's one more argument.
00387                 if (i + 1 >= argc)
00388                 {
00389                     printf("ERROR: Scenario Number needed for -s option\n");
00390                     PrintUsage(argv[0]);
00391                     goto CLEANUP;
00392                 }
00393
00394                 // extract the scenario value
00395                 g_ClientContext.scenario = (BYTE) atoi(argv[i+1]);
00396
00397                 // indicate that we have processed the next argument as well.
00398                 i++;
00399
00400                 // validate the scenario type.
00401                 if (g_ClientContext.scenario < 1 ||
00402                     g_ClientContext.scenario > SC_NUM_SCENARIOS)
00403                 {
00404                     printf("ERROR: Invalid scenario type: %d. Must be between "
00405                            "1 to %d\n",g_ClientContext.scenario,
00406                            SC_NUM_SCENARIOS);
00407                     PrintUsage(argv[0]);
00408                     goto CLEANUP;
00409                 }
00410
00411                 // Continue.
00412                 break;
00413
00414             case 'h' : // help
00415             case '?' : // help
00416                         PrintUsage(argv[0]);
00417                         goto CLEANUP;
00418             default  :
00419                         printf("ERROR: Unrecognized option: %s\n", argv[i]);
00420                         PrintUsage(argv[0]);
00421                         goto CLEANUP;
00422         }
00423     }
00424
00425     // echo the final list of values that'll be used.
00426     // remember, these need not be the same as the input arguments.
00427     // rather, this is what we'll use inside our program.
00428     printf("Parsed input arguments. The following values will be used : \n");
00429     printf("\tAddress Family = %s\n", AFImage(g_ClientContext.addressFamily));
00430     printf("\tServer = %s\n",g_ClientContext.szServer);
00431     printf("\tPort = %s\n", g_ClientContext.szPort);
00432     printf("\tBytes to Send = %ld\n", g_ClientContext.sendBufSize);
00433     printf("\tReceive buffer size = %ld\n", g_ClientContext.recvBufSize);
00434     printf("\tIterations  = %ld\n", g_ClientContext.loopCount);
00435     printf("\tDelay = %ld\n", g_ClientContext.delay);
00436     printf("\tScenario = %d\n", g_ClientContext.scenario);
00437
00438     // all went well, signal that we can proceed.
00439     retVal = TRUE;
00440
00441 CLEANUP:
00442
00443     printf("Exiting ParseArguments()\n");
00444     return retVal;
00445 }
00446
00447
00448 /*
00449     Prints the given socket address in a printable string format.
00450 */
00451 void PrintAddressString(LPSOCKADDR pSockAddr, DWORD dwSockAddrLen)
00452 {
00453     // INET6_ADDRSTRLEN is the maximum size of a valid IPv6 address
00454     // including port,colons,NULL,etc.
00455     char buf[INET6_ADDRSTRLEN];
00456     DWORD dwBufSize = 0;
00457
00458     memset(buf,0,sizeof(buf));
00459     dwBufSize = sizeof(buf);
00460
00461     // This function converts the pSockAddr to a printable format into buf.
00462     if (WSAAddressToString(pSockAddr,
00463                            dwSockAddrLen,
00464                            NULL,
00465                            buf,
00466                            &dwBufSize) == SOCKET_ERROR)
00467     {
00468         printf("ERROR: WSAAddressToString failed %d \n", WSAGetLastError());
00469         goto CLEANUP;
00470     }
00471
00472     printf("%s\n", buf);
00473
00474 CLEANUP:
00475     return;
00476 }
00477
00478
00479 /*
00480     This function create a socket for the client and connects it to the
00481     server.
00482 */
00483 SOCKET CreateClientSocket()
00484 {
00485     struct addrinfo hints;
00486     struct addrinfo *res;
00487     struct addrinfo *pAddr;
00488     SOCKET clientSock = INVALID_SOCKET;
00489     int i;
00490     int rc;
00491
00492     printf("Entering CreateClientSocket()\n");
00493
00494     memset(&hints, 0, sizeof(hints));
00495
00496     hints.ai_family = g_ClientContext.addressFamily;
00497     hints.ai_protocol = IPPROTO_TCP;
00498     hints.ai_socktype = SOCK_STREAM;
00499
00500     // get the local addresses that are suitable for connecting to the
00501     // given server address.
00502     if (getaddrinfo(g_ClientContext.szServer,
00503                 g_ClientContext.szPort,
00504                 &hints,
00505                 &res) != NO_ERROR)
00506     {
00507         printf("getaddrinfo failed. Error = %d\n", WSAGetLastError());
00508         goto CLEANUP;
00509     }
00510
00511     if (res == NULL)
00512     {
00513         printf("getaddrinfo returned res = NULL\n");
00514         goto CLEANUP;
00515     }
00516
00517     printf("getaddrinfo successful.Enumerating the returned addresses ...\n\n");
00518
00519     for (pAddr = res, i = 1; pAddr != NULL; pAddr = pAddr->ai_next, i++)
00520     {
00521         printf("Processing Address %d returned by getaddrinfo : ", i);
00522         PrintAddressString(pAddr->ai_addr, pAddr->ai_addrlen);
00523         clientSock = WSASocket(pAddr->ai_family,
00524                             pAddr->ai_socktype,
00525                             pAddr->ai_protocol,
00526                             NULL,
00527                             NULL,
00528                             0);
00529         if (clientSock == INVALID_SOCKET)
00530         {
00531             printf("WSASocket failed. Error = %d\n", WSAGetLastError());
00532             printf("Ignoring this address and continuing with the next. \n\n");
00533
00534             // anyway, let's continue with other addresses.
00535             continue;
00536         }
00537
00538         printf("Created client socket with handle = %d\n", clientSock);
00539
00540         rc = connect(clientSock, pAddr->ai_addr, pAddr->ai_addrlen);
00541         if (rc == SOCKET_ERROR)
00542         {
00543             printf("connect failed. Error = %d\n", WSAGetLastError());
00544             closesocket(clientSock);
00545             clientSock = INVALID_SOCKET;
00546             continue;
00547         }
00548
00549         printf("Connected successfully\n");
00550         break;
00551     }
00552
00553
00554 CLEANUP:
00555
00556     // if getaddrinfo succeeded, it would have allocated memory for the
00557     // res structure which we have to free.
00558     if (res)
00559     {
00560         freeaddrinfo(res);
00561         printf("Freed the memory allocated for res by getaddrinfo\n");
00562     }
00563
00564     printf("Exiting CreateClientSocket()\n");
00565     return clientSock;
00566 }
00567
00568
00569 /*
00570     Allocate a buffer to use for sending data and initialize the buffer
00571     with suitable initial values.
00572 */
00573 BOOL PrepareSendBuffer()
00574 {
00575     BOOL bSuccess = FALSE;
00576
00577     printf("Entering PrepareSendBuffer()\n");
00578
00579     g_ClientContext.pSendBuf = (char *) malloc(g_ClientContext.sendBufSize + 1);
00580     if (g_ClientContext.pSendBuf == NULL)
00581     {
00582         printf("malloc failed.\n");
00583         goto CLEANUP;
00584     }
00585
00586     printf("Allocated Send Buffer: %p\n", g_ClientContext.pSendBuf);
00587
00588     // fill up with some info. here we are just sending 1 character.
00589     memset(g_ClientContext.pSendBuf, 'H', g_ClientContext.sendBufSize);
00590     g_ClientContext.pSendBuf[g_ClientContext.sendBufSize] = '\0';
00591     g_ClientContext.nBytesRemainingToBeSent = g_ClientContext.sendBufSize;
00592
00593     bSuccess = TRUE;
00594
00595 CLEANUP:
00596     printf("Exiting PrepareSendBuffer()\n");
00597     return bSuccess;
00598 }
00599
00600
00601 /*
00602     Deallocate the buffer that was used for sending.
00603 */
00604 void FreeSendBuffer()
00605 {
00606     if (g_ClientContext.pSendBuf != NULL)
00607     {
00608         free(g_ClientContext.pSendBuf);
00609         printf("Freed Send Buffer : %p\n", g_ClientContext.pSendBuf);
00610         g_ClientContext.pSendBuf = NULL;
00611     }
00612 }
00613
00614
00615 /*
00616     Allocate a buffer for receiving data from the server.
00617     Currently since we are not using the received data, we'll just receive
00618     all the data in a big one-time buffer for all the receives and overwrite
00619     the same buffer each time. The count of received bytes is what we
00620     are presently interested in.
00621 */
00622 BOOL PrepareRecvBuffer()
00623 {
00624     BOOL bSuccess = FALSE;
00625
00626     printf("Entering PrepareRecvBuffer()\n");
00627
00628     g_ClientContext.pRecvBuf = (char *) malloc(g_ClientContext.recvBufSize + 1);
00629     if (g_ClientContext.pRecvBuf == NULL)
00630     {
00631         printf("malloc failed.\n");
00632         goto CLEANUP;
00633     }
00634
00635     printf("Allocated Recv Buffer: %p\n", g_ClientContext.pRecvBuf);
00636
00637     memset(g_ClientContext.pRecvBuf, 0, g_ClientContext.recvBufSize + 1);
00638     g_ClientContext.nBytesRecd = 0;
00639
00640     bSuccess = TRUE;
00641
00642 CLEANUP:
00643     printf("Exiting PrepareRecvBuffer()\n");
00644     return bSuccess;
00645 }
00646
00647
00648 /*
00649     Deallocate the buffer used for receiving.
00650 */
00651 void FreeRecvBuffer()
00652 {
00653     if (g_ClientContext.pRecvBuf != NULL)
00654     {
00655         free(g_ClientContext.pRecvBuf);
00656         printf("Freed Recv Buffer : %p\n", g_ClientContext.pRecvBuf);
00657         g_ClientContext.pRecvBuf = NULL;
00658     }
00659 }
00660
00661 /*
00662     Try sending data to server once. Return the error, if any.
00663 */
00664 int DoSendOnce()
00665 {
00666     int nBytesSent;
00667     int startPosition;
00668     int err = 0;
00669
00670     printf("Entering DoSendOnce()\n");
00671
00672     // send from the position where we left off last.
00673     startPosition = g_ClientContext.sendBufSize -
00674                     g_ClientContext.nBytesRemainingToBeSent;
00675     nBytesSent = send(g_ClientContext.sock,
00676                       g_ClientContext.pSendBuf + startPosition,
00677                       g_ClientContext.nBytesRemainingToBeSent,
00678                       0);
00679
00680     if (nBytesSent == SOCKET_ERROR)
00681     {
00682         err = WSAGetLastError();
00683         goto CLEANUP;
00684     }
00685
00686     // remember where to begin send next time.
00687     g_ClientContext.nBytesRemainingToBeSent -= nBytesSent;
00688     printf("Sent %d bytes so far\n", startPosition + nBytesSent);
00689
00690 CLEANUP:
00691
00692     printf("Exiting DoSendOnce()\n");
00693     return err;
00694 }
00695
00696
00697 /*
00698     Try receiving from the server. This function returns the number of bytes
00699     received (unlike DoSendOnce which returns the error code).
00700 */
00701 int DoRecvOnce()
00702 {
00703     int nBytesRecd;
00704
00705     printf("Entering DoRecvOnce()\n");
00706
00707     // receive into the same global receive buffer, overwriting the previous
00708     // contents, as we are only interested in the number of bytes received
00709     // for verification.
00710     nBytesRecd = recv(g_ClientContext.sock,
00711                       g_ClientContext.pRecvBuf,
00712                       g_ClientContext.recvBufSize,
00713                       0);
00714
00715     if (nBytesRecd == SOCKET_ERROR)
00716     {
00717         printf("recv returned: %d\n", WSAGetLastError());
00718         goto CLEANUP;
00719     }
00720
00721     // update the stats.
00722     g_ClientContext.nBytesRecd += nBytesRecd;
00723     printf("Recd %d bytes so far\n", g_ClientContext.nBytesRecd);
00724
00725 CLEANUP:
00726
00727     printf("Exiting DoRecvOnce()\n");
00728     return nBytesRecd;
00729 }
00730
00731
00732 /*
00733     Repeat sending the data to the server until all the data has been
00734     completely sent to the server.
00735 */
00736 void DoSendUntilDone()
00737 {
00738     int err;
00739
00740     printf("Entering DoSendUntilDone()\n");
00741     do
00742     {
00743         // Get the job done by callnig DoSendOnce.
00744         err = DoSendOnce();
00745
00746         // handle error cases as appropriate.
00747         switch(err)
00748         {
00749             case 0:
00750                 if (g_ClientContext.nBytesRemainingToBeSent == 0)
00751                 {
00752                     printf("Send completed\n");
00753                     goto CLEANUP;
00754                 }
00755                 break;
00756
00757             case WSAEWOULDBLOCK:
00758                 printf("Got WSAEWOULDBLOCK from send.\n");
00759                 printf("Waiting for 1 second before retrying send ...\n");
00760                 Sleep(1000);
00761                 break;
00762
00763             default:
00764                 // other errors.
00765                 printf("ERROR: send failed: Error = %d\n", err);
00766                 goto CLEANUP;
00767         }
00768     } while (1);
00769
00770 CLEANUP:
00771     printf("Exiting DoSendUntilDone()\n");
00772     return;
00773 }
00774
00775
00776 /*
00777     Receive data on the socket until recv returns 0 or error.
00778 */
00779 void DoRecvUntilDone()
00780 {
00781     int err;
00782
00783     printf("Entering DoRecvUntilDone()\n");
00784     do
00785     {
00786         // get the job done by calling DoRecvOnce.
00787         switch(DoRecvOnce())
00788         {
00789             case 0:
00790                 printf("Recv returned 0. Remote socket must have been "
00791                        "gracefully closed.\n");
00792                 goto CLEANUP;
00793
00794             case SOCKET_ERROR:
00795                 err = WSAGetLastError();
00796                 if (err == WSAEWOULDBLOCK)
00797                 {
00798                     printf("Got WSAEWOULDBLOCK from recv.\n");
00799                     printf("Waiting for 1 second before retrying send ...\n");
00800                     Sleep(1000);
00801                 }
00802                 else
00803                 {
00804                     printf("ERROR: recv returned : %d\n", err);
00805                     goto CLEANUP;
00806                 }
00807                 break;
00808
00809             default:
00810                 // > 0 bytes read. let's continue.
00811                 break;
00812         }
00813     } while (1);
00814
00815 CLEANUP:
00816     printf("Exiting DoRecvUntilDone()\n");
00817     return;
00818 }
00819
00820
00821 /*
00822     This functions shuts down the socket before closing it so that
00823     it would send a FIN packet on the TCP connection to the remote side
00824     to indicate that there won't be any more data sent on this socket.
00825     Only if this side shuts down, the remote side will get a 0 for a
00826     recv and conclude that the client is done with sending data.
00827 */
00828 void DoShutDown()
00829 {
00830     if (shutdown(g_ClientContext.sock, SD_SEND) == SOCKET_ERROR)
00831         printf("shutdown failed. err = %d\n", WSAGetLastError());
00832     else
00833         printf("shutdown successful\n");
00834 }
00835
00836 /*
00837     This function implements the scenario where all the sends are done first
00838     and all the recvs next.
00839 */
00840 void DoSendThenRecv()
00841 {
00842     DoSendUntilDone();
00843     DoShutDown();
00844     DoRecvUntilDone();
00845 }
00846
00847 /*
00848     This function implements the scenario where the client only sends but
00849     doesn't recv the echoed data back. This helps demonstrate possible
00850     deadlocks in the server side for huge sized data buffer.
00851 */
00852 void DoSendNoRecv()
00853 {
00854     DoSendUntilDone();
00855     DoShutDown();
00856 }
00857
00858 /*
00859     This function implements the scenario where the client waits for a certain
00860     time before doing the recv thereby allowing the server code to get
00861     a WSAEWOULDBLOCK on a send, especially when the data buffer is huge.
00862 */
00863 void DoSendWaitRecv()
00864 {
00865     DoSendUntilDone();
00866     DoShutDown();
00867     printf("Waiting before doing recv ...\n");
00868     Sleep(g_ClientContext.delay);
00869     DoRecvUntilDone();
00870 }
00871
00872 /*
00873     This function implements the scenario to test the server to get
00874     a FD_WRITE event before an FD_READ event.
00875 */
00876 void DoWaitSendRecv()
00877 {
00878     printf("Waiting before doing initial send ...\n");
00879     Sleep(g_ClientContext.delay);
00880     DoSendUntilDone();
00881     DoShutDown();
00882     DoRecvUntilDone();
00883 }
00884
00885 /*
00886     This function is supplied as the call back function for CreateThread.
00887     Although it is doing nothing other than calling DoRecvUntilDone, it
00888     needs to have this particular signature to be passed as a valid
00889     call back function for CreateThread.
00890 */
00891 DWORD WINAPI ReceiverThread(LPVOID pv)
00892 {
00893     DoRecvUntilDone();
00894     return 0;
00895 }
00896
00897 /*
00898     This function illustrates the ideal send and recv scenario where
00899     one thread does the recv independently until it gets a 0 or an error
00900     and the other thread (in this case, the current thread) does sends
00901     until all data is sent. This is the truly asynchronous implementation
00902     of the client unlike the earlier scenarios which were mostly meant
00903     for testing specific sequence of events in the server and understanding
00904     the need for different parts of the server code.
00905 */
00906 void DoIdealSendRecv()
00907 {
00908     HANDLE hThread;
00909
00910     // start the receiver thread.
00911     hThread = CreateThread(NULL, 0, ReceiverThread, NULL, 0, NULL);
00912     if (hThread == NULL)
00913     {
00914         printf("ERROR: CreateThread failed. Error = %d\n", GetLastError());
00915         goto CLEANUP;
00916     }
00917
00918     // In this thread, send all data until done.
00919     DoSendUntilDone();
00920     DoShutDown();
00921
00922     // wait till recv thread is done.
00923     if (WaitForSingleObject(hThread, INFINITE) != WAIT_OBJECT_0)
00924     {
00925         printf("ERROR: WaitForSingleObject failed: %d\n", GetLastError());
00926         goto CLEANUP;
00927     }
00928     printf("Recv Thread done.\n");
00929
00930 CLEANUP:
00931
00932     return;
00933 }
00934
00935 /*
00936     This function is the entry point for this program.
00937     Based on the command-line arguments, it invokes the suitable functions.
00938 */
00939 int _cdecl main(int argc, char *argv[])
00940 {
00941     // holds the return value from this function.
00942     // 0 indicates success, non-zero indicates failure.
00943     int retVal;
00944     int i;
00945     BOOL bStartupSuccessful = FALSE;
00946
00947     WSADATA wsaData;
00948
00949     printf("Entering main()\n");
00950
00951     // parse and validate the given arguments and determine if we should
00952     // continue the execution or return error.
00953     if (ParseArguments(argc, argv) == FALSE)
00954     {
00955         // error input. return a non-zero error code.
00956         retVal = 1;
00957         goto CLEANUP;
00958     }
00959
00960     // call WSAStartup to initialize Winsock before calling any of its APIs.
00961     retVal = WSAStartup(MAKEWORD(2,2), &wsaData);
00962     if (retVal != 0)
00963     {
00964         printf("WSAStartup failed. Error = %d\n", retVal);
00965         goto CLEANUP;
00966     }
00967
00968     // remember that the WSAStartup was successful so as to call WSACleanup
00969     // once, correspondingly.
00970     bStartupSuccessful = TRUE;
00971
00972     for(i = 1; i <= g_ClientContext.loopCount; i++)
00973     {
00974         printf("\n\nPerforming Iteration : %d\n"
00975                    "-------------------------\n",i);
00976
00977         // create a socket that's connected to the server.
00978         g_ClientContext.sock = CreateClientSocket();
00979         if (g_ClientContext.sock == INVALID_SOCKET)
00980             goto CLEANUP;
00981
00982         // allocate and initialize the buffer to be sent.
00983         if (PrepareSendBuffer() == FALSE)
00984             goto CLOSE_SOCKET;
00985
00986         // allocate and initialize a buffer for receiving.
00987         if (PrepareRecvBuffer() == FALSE)
00988             goto CLOSE_SOCKET;
00989
00990         // perform the sends/recv according to the requested scenario.
00991         switch(g_ClientContext.scenario)
00992         {
00993             case SC_SEND_THEN_RECV :    DoSendThenRecv();
00994                                         break;
00995             case SC_SEND_NO_RECV :      DoSendNoRecv();
00996                                         break;
00997             case SC_SEND_WAIT_RECV :    DoSendWaitRecv();
00998                                         break;
00999             case SC_WAIT_SEND_RECV :    DoWaitSendRecv();
01000                                         break;
01001             case SC_IDEAL_SEND_RECV:    DoIdealSendRecv();
01002                                         break;
01003             default:                    printf("Unrecognized scenario\n");
01004                                         break;
01005         }
01006
01007 CLOSE_SOCKET:
01008
01009         // free the send and recv buffers.
01010         FreeSendBuffer();
01011         FreeRecvBuffer();
01012
01013         // close the client socket.
01014         closesocket(g_ClientContext.sock);
01015         printf("Closed socket %d. "
01016            "Total Bytes Recd = %d, "
01017            "Total Bytes Sent = %d\n",
01018             g_ClientContext.sock,
01019             g_ClientContext.nBytesRecd,
01020             g_ClientContext.sendBufSize -
01021             g_ClientContext.nBytesRemainingToBeSent);
01022
01023     }
01024
01025
01026 CLEANUP:
01027
01028     // call WSACleanup only if WSAStartup was successful.
01029     if (bStartupSuccessful)
01030     {
01031         // Inform Winsock that we are done with all the APIs.
01032         WSACleanup();
01033     }
01034
01035     printf("Exiting main()\n");
01036     return retVal;
01037 }
01038
01039
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/StoServe/Server.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • StoServe

Server.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.CPP
00003
00004   Summary:   Implementation file for the CServer server control C++
00005              object.  This object encapsulates the server's internal
00006              control of global server object and lock counts. The
00007              CThreaded OwnThis mechanism is used to ensure mutually
00008              exclusive access to this CServer object by multiple threads.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial STOSERVE.HTM
00012              file. For more specific technical details on the internal
00013              workings see the comments dispersed throughout the module's
00014              source code.
00015
00016   Classes:   CServer.
00017
00018   Functions: .
00019
00020   Origin:    6-10-96: atrent - Editor-inheritance from SERVER.CPP in
00021                the CONSERVE Tutorial Code Sample.
00022
00023 ----------------------------------------------------------------------------
00024   This file is part of the Microsoft COM Tutorial Code Samples.
00025
00026   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00027
00028   This source code is intended only as a supplement to Microsoft
00029   Development Tools and/or on-line documentation.  See these other
00030   materials for detailed information regarding Microsoft code samples.
00031
00032   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00033   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00034   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00035   PARTICULAR PURPOSE.
00036 ==========================================================================+*/
00037
00038 /*---------------------------------------------------------------------------
00039   We include WINDOWS.H for all Win32 applications.
00040   We include OLE2.H because we will be calling the COM/OLE Libraries.
00041   We include APPUTIL.H because we will be building this DLL using
00042     the convenient Virtual Window and Dialog classes and other
00043     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00044   We include SERVER.H for the class declarations for the C++ CServer
00045     server control object.
00046 ---------------------------------------------------------------------------*/
00047 #include <windows.h>
00048 #include <ole2.h>
00049 #include <apputil.h>
00050 #include "server.h"
00051
00052
00053 /*---------------------------------------------------------------------------
00054   Implementation the internal CServer C++ object.  Used to encapsulate
00055   some server data and the methods for Lock and Object count incrementing
00056   and decrementing.
00057 ---------------------------------------------------------------------------*/
00058
00059 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00060   Method:   CServer::CServer
00061
00062   Summary:  CServer Constructor.
00063
00064   Args:     void
00065
00066   Modifies: .
00067
00068   Returns:  void
00069 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00070 CServer::CServer(void)
00071 {
00072   // Zero the Object and Lock counts for this attached process.
00073   m_cObjects = 0;
00074   m_cLocks = 0;
00075
00076   return;
00077 }
00078
00079
00080 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00081   Method:   CServer::~CServer
00082
00083   Summary:  CServer Destructor.
00084
00085   Args:     void
00086
00087   Modifies: .
00088
00089   Returns:  void
00090 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00091 CServer::~CServer(void)
00092 {
00093   return;
00094 }
00095
00096
00097 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00098   Method:   CServer::Lock
00099
00100   Summary:  Increment the Server's Lock count.
00101
00102   Args:     void
00103
00104   Modifies: .
00105
00106   Returns:  void
00107 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00108 void CServer::Lock(void)
00109 {
00110   LONG cLocks;
00111
00112   if (OwnThis())
00113   {
00114     cLocks = ++m_cLocks;
00115
00116     UnOwnThis();
00117   }
00118
00119   return;
00120 }
00121
00122
00123 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00124   Method:   CServer::Unlock
00125
00126   Summary:  Decrement the Server's Lock count.
00127
00128   Args:     void
00129
00130   Modifies: .
00131
00132   Returns:  void
00133 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00134 void CServer::Unlock(void)
00135 {
00136   LONG cLocks;
00137
00138   if (OwnThis())
00139   {
00140     cLocks = --m_cLocks;
00141
00142     UnOwnThis();
00143   }
00144
00145   return;
00146 }
00147
00148
00149 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00150   Method:   CServer::ObjectsUp
00151
00152   Summary:  Increment the Server's living Object count.
00153
00154   Args:     void
00155
00156   Modifies: .
00157
00158   Returns:  void
00159 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00160 void CServer::ObjectsUp(void)
00161 {
00162   LONG cObjects;
00163
00164   if (OwnThis())
00165   {
00166     cObjects = ++m_cObjects;
00167
00168     UnOwnThis();
00169   }
00170
00171   return;
00172 }
00173
00174
00175 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00176   Method:   CServer::ObjectsDown
00177
00178   Summary:  Decrement the Server's living object count.
00179
00180   Args:     void
00181
00182   Modifies: .
00183
00184   Returns:  void
00185 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00186 void CServer::ObjectsDown(void)
00187 {
00188   LONG cObjects;
00189
00190   if (OwnThis())
00191   {
00192     cObjects = --m_cObjects;
00193
00194     UnOwnThis();
00195   }
00196
00197   return;
00198 }
00199
00200
00201 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00202   Method:   CServer::CanUnloadNow
00203
00204   Summary:  Check if we can unload the server (ie, if there are no longer
00205             any living COM objects and no locks.
00206
00207   Args:     void
00208
00209   Modifies: .
00210
00211   Returns:  HRESULT
00212               S_OK if this server can be unloaded.
00213               S_FALSE if this server can not be unloaded.
00214 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00215 HRESULT CServer::CanUnloadNow(void)
00216 {
00217   HRESULT hr = S_FALSE;
00218   LONG cObjects, cLocks;
00219
00220   if (OwnThis())
00221   {
00222     cObjects = m_cObjects;
00223     cLocks = m_cLocks;
00224
00225     hr = (0L==cObjects && 0L==cLocks) ? S_OK : S_FALSE;
00226
00227     UnOwnThis();
00228   }
00229
00230   return hr;
00231 }
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/CursorTypeEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

CursorTypeEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: CursorTypeEnum
00019
00020 public class CursorTypeEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adOpenUnspecified = -1;
00023   public static final short adOpenForwardOnly = 0;
00024   public static final short adOpenKeyset = 1;
00025   public static final short adOpenDynamic = 2;
00026   public static final short adOpenStatic = 3;
00027 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step1/ADsFirstExt_p.c Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step1

ADsFirstExt_p.c

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the proxy stub code */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Mon Apr 29 12:44:14 2002
00006  */
00007 /* Compiler settings for C:\sdk\sdkpublic\samples\netds\adsi\samples\Extension\tutorial\Step1\ADsFirstExt.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013 #define USE_STUBLESS_PROXY
00014
00015
00016 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00017 #ifndef __REDQ_RPCPROXY_H_VERSION__
00018 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00019 #endif
00020
00021
00022 #include "rpcproxy.h"
00023 #ifndef __RPCPROXY_H_VERSION__
00024 #error this stub requires an updated version of <rpcproxy.h>
00025 #endif // __RPCPROXY_H_VERSION__
00026
00027
00028 #include "ADsFirstExt.h"
00029
00030 #define TYPE_FORMAT_STRING_SIZE   3
00031 #define PROC_FORMAT_STRING_SIZE   23
00032
00033 typedef struct _MIDL_TYPE_FORMAT_STRING
00034     {
00035     short          Pad;
00036     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00037     } MIDL_TYPE_FORMAT_STRING;
00038
00039 typedef struct _MIDL_PROC_FORMAT_STRING
00040     {
00041     short          Pad;
00042     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00043     } MIDL_PROC_FORMAT_STRING;
00044
00045
00046 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00047 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00048
00049
00050 /* Object interface: IUnknown, ver. 0.0,
00051    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00052
00053
00054 /* Object interface: IDispatch, ver. 0.0,
00055    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IHelloWorld, ver. 0.0,
00059    GUID={0xE1E3EDF7,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}} */
00060
00061
00062 extern const MIDL_STUB_DESC Object_StubDesc;
00063
00064
00065 extern const MIDL_SERVER_INFO IHelloWorld_ServerInfo;
00066
00067 #pragma code_seg(".orpc")
00068
00069 static const MIDL_STUB_DESC Object_StubDesc =
00070     {
00071     0,
00072     NdrOleAllocate,
00073     NdrOleFree,
00074     0,
00075     0,
00076     0,
00077     0,
00078     0,
00079     __MIDL_TypeFormatString.Format,
00080     1, /* -error bounds_check flag */
00081     0x20000, /* Ndr library version */
00082     0,
00083     0x50100a4, /* MIDL Version 5.1.164 */
00084     0,
00085     0,
00086     0,  /* notify & notify_flag routine table */
00087     1,  /* Flags */
00088     0,  /* Reserved3 */
00089     0,  /* Reserved4 */
00090     0   /* Reserved5 */
00091     };
00092
00093 static const unsigned short IHelloWorld_FormatStringOffsetTable[] =
00094     {
00095     (unsigned short) -1,
00096     (unsigned short) -1,
00097     (unsigned short) -1,
00098     (unsigned short) -1,
00099     0
00100     };
00101
00102 static const MIDL_SERVER_INFO IHelloWorld_ServerInfo =
00103     {
00104     &Object_StubDesc,
00105     0,
00106     __MIDL_ProcFormatString.Format,
00107     &IHelloWorld_FormatStringOffsetTable[-3],
00108     0,
00109     0,
00110     0,
00111     0
00112     };
00113
00114 static const MIDL_STUBLESS_PROXY_INFO IHelloWorld_ProxyInfo =
00115     {
00116     &Object_StubDesc,
00117     __MIDL_ProcFormatString.Format,
00118     &IHelloWorld_FormatStringOffsetTable[-3],
00119     0,
00120     0,
00121     0
00122     };
00123
00124 CINTERFACE_PROXY_VTABLE(8) _IHelloWorldProxyVtbl =
00125 {
00126     &IHelloWorld_ProxyInfo,
00127     &IID_IHelloWorld,
00128     IUnknown_QueryInterface_Proxy,
00129     IUnknown_AddRef_Proxy,
00130     IUnknown_Release_Proxy ,
00131     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00132     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00133     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00134     0 /* IDispatch_Invoke_Proxy */ ,
00135     (void *)-1 /* IHelloWorld::Say */
00136 };
00137
00138
00139 static const PRPC_STUB_FUNCTION IHelloWorld_table[] =
00140 {
00141     STUB_FORWARDING_FUNCTION,
00142     STUB_FORWARDING_FUNCTION,
00143     STUB_FORWARDING_FUNCTION,
00144     STUB_FORWARDING_FUNCTION,
00145     NdrStubCall2
00146 };
00147
00148 CInterfaceStubVtbl _IHelloWorldStubVtbl =
00149 {
00150     &IID_IHelloWorld,
00151     &IHelloWorld_ServerInfo,
00152     8,
00153     &IHelloWorld_table[-3],
00154     CStdStubBuffer_DELEGATING_METHODS
00155 };
00156
00157 #pragma data_seg(".rdata")
00158
00159 #if !defined(__RPC_WIN32__)
00160 #error  Invalid build platform for this stub.
00161 #endif
00162
00163 #if !(TARGET_IS_NT40_OR_LATER)
00164 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00165 #error   -Oif or -Oicf, more than 32 methods in the interface.
00166 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00167 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00168 #endif
00169
00170
00171 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00172     {
00173         0,
00174         {
00175
00176   /* Procedure Say */
00177
00178       0x33,   /* FC_AUTO_HANDLE */
00179       0x6c,   /* Old Flags:  object, Oi2 */
00180 /*  2 */  NdrFcLong( 0x0 ), /* 0 */
00181 /*  6 */  NdrFcShort( 0x7 ),  /* 7 */
00182 #ifndef _ALPHA_
00183 /*  8 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00184 #else
00185       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00186 #endif
00187 /* 10 */  NdrFcShort( 0x0 ),  /* 0 */
00188 /* 12 */  NdrFcShort( 0x8 ),  /* 8 */
00189 /* 14 */  0x4,    /* Oi2 Flags:  has return, */
00190       0x1,    /* 1 */
00191
00192   /* Return value */
00193
00194 /* 16 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00195 #ifndef _ALPHA_
00196 /* 18 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00197 #else
00198       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00199 #endif
00200 /* 20 */  0x8,    /* FC_LONG */
00201       0x0,    /* 0 */
00202
00203       0x0
00204         }
00205     };
00206
00207 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00208     {
00209         0,
00210         {
00211       NdrFcShort( 0x0 ),  /* 0 */
00212
00213       0x0
00214         }
00215     };
00216
00217 const CInterfaceProxyVtbl * _ADsFirstExt_ProxyVtblList[] =
00218 {
00219     ( CInterfaceProxyVtbl *) &_IHelloWorldProxyVtbl,
00220     0
00221 };
00222
00223 const CInterfaceStubVtbl * _ADsFirstExt_StubVtblList[] =
00224 {
00225     ( CInterfaceStubVtbl *) &_IHelloWorldStubVtbl,
00226     0
00227 };
00228
00229 PCInterfaceName const _ADsFirstExt_InterfaceNamesList[] =
00230 {
00231     "IHelloWorld",
00232     0
00233 };
00234
00235 const IID *  _ADsFirstExt_BaseIIDList[] =
00236 {
00237     &IID_IDispatch,
00238     0
00239 };
00240
00241
00242 #define _ADsFirstExt_CHECK_IID(n) IID_GENERIC_CHECK_IID( _ADsFirstExt, pIID, n)
00243
00244 int __stdcall _ADsFirstExt_IID_Lookup( const IID * pIID, int * pIndex )
00245 {
00246
00247     if(!_ADsFirstExt_CHECK_IID(0))
00248         {
00249         *pIndex = 0;
00250         return 1;
00251         }
00252
00253     return 0;
00254 }
00255
00256 const ExtendedProxyFileInfo ADsFirstExt_ProxyFileInfo =
00257 {
00258     (PCInterfaceProxyVtblList *) & _ADsFirstExt_ProxyVtblList,
00259     (PCInterfaceStubVtblList *) & _ADsFirstExt_StubVtblList,
00260     (const PCInterfaceName * ) & _ADsFirstExt_InterfaceNamesList,
00261     (const IID ** ) & _ADsFirstExt_BaseIIDList,
00262     & _ADsFirstExt_IID_Lookup,
00263     1,
00264     2,
00265     0, /* table of [async_uuid] interfaces */
00266     0, /* Filler1 */
00267     0, /* Filler2 */
00268     0  /* Filler3 */
00269 };
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::EditModeEnum Member List

This is the complete list of members for msado15::EditModeEnum, including all inherited members.
adEditAdd | msado15::EditModeEnum | [static]
adEditDelete | msado15::EditModeEnum | [static]
adEditInProgress | msado15::EditModeEnum | [static]
adEditNone | msado15::EditModeEnum | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRefCount Member List

This is the complete list of members for CRefCount, including all inherited members.
AddRef(void) | CRefCount |
CRefCount() | CRefCount |
m_cRef | CRefCount | [private]
Release(void) | CRefCount |
~CRefCount() | CRefCount | [virtual]
Generated on Wed Nov 13 2024 16:57:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ARRAYQ Member List

This is the complete list of members for ARRAYQ, including all inherited members.
ARRAYQ() | ARRAYQ | [inline]
bFormatNameOnly | ARRAYQ |
dwAccess | ARRAYQ |
hHandle | ARRAYQ |
szFormatName | ARRAYQ |
szPathName | ARRAYQ |
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFileStream Member List

This is the complete list of members for CFileStream, including all inherited members.
CFileStream() | CFileStream |
Clone(IStream **ppstm) | CFileStream |
CloseFile() | CFileStream |
Commit(DWORD grfCommitFlags) | CFileStream |
CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) | CFileStream |
LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) | CFileStream |
m_cRef | CFileStream | [private]
m_pFile | CFileStream | [protected]
OpenFile(WCHAR *pwszFile, WCHAR *pwszMode) | CFileStream |
QueryInterface(REFIID riid, LPVOID *ppv) | CFileStream |
Read(void *pv, ULONG cb, ULONG *pcbRead) | CFileStream |
Revert() | CFileStream |
Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) | CFileStream |
SetSize(ULARGE_INTEGER libNewSize) | CFileStream |
Stat(STATSTG *pstatstg, DWORD grfStatFlag) | CFileStream |
STDMETHODIMP_(ULONG) AddRef() | CFileStream |
STDMETHODIMP_(ULONG) Release() | CFileStream |
UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) | CFileStream |
Write(const void *pv, ULONG cb, ULONG *pcbWritten) | CFileStream |
~CFileStream() | CFileStream | [virtual]
Generated on Wed Nov 13 2024 16:56:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/OLEDBKB.Cpp Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

OLEDBKB.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: Oledbkb.cpp
00003 //
00004 // Description: Implementation of DLL Exports.
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022 // Note: Proxy/Stub Information
00023 //    To build a separate proxy/stub DLL,
00024 //    run nmake -f Oledbkbps.mk in the project directory.
00025
00026 #include "stdafx.h"
00027 #include "resource.h"
00028 #include "initguid.h"
00029 #include "Oledbkb.h"
00030
00031 #include "Oledbkb_i.c"
00032 #include <initguid.h>
00033 #include "OLEDBComponent.h"
00034
00035
00036 CComModule _Module;
00037
00038 BEGIN_OBJECT_MAP(ObjectMap)
00039   OBJECT_ENTRY(CLSID_OLEDBComponent, COLEDBComponent)
00040 END_OBJECT_MAP()
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // DLL Entry Point
00044
00045 extern "C"
00046 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00047 {
00048   if (dwReason == DLL_PROCESS_ATTACH)
00049   {
00050     _Module.Init(ObjectMap, hInstance);
00051     DisableThreadLibraryCalls(hInstance);
00052   }
00053   else if (dwReason == DLL_PROCESS_DETACH)
00054     _Module.Term();
00055   return TRUE;    // ok
00056 }
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 // Used to determine whether the DLL can be unloaded by OLE
00060
00061 STDAPI DllCanUnloadNow(void)
00062 {
00063   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00064 }
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067 // Returns a class factory to create an object of the requested type
00068
00069 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00070 {
00071   return _Module.GetClassObject(rclsid, riid, ppv);
00072 }
00073
00074 /////////////////////////////////////////////////////////////////////////////
00075 // DllRegisterServer - Adds entries to the system registry
00076
00077 STDAPI DllRegisterServer(void)
00078 {
00079   // registers object, typelib and all interfaces in typelib
00080   return _Module.RegisterServer(TRUE);
00081 }
00082
00083 /////////////////////////////////////////////////////////////////////////////
00084 // DllUnregisterServer - Removes entries from the system registry
00085
00086 STDAPI DllUnregisterServer(void)
00087 {
00088   _Module.UnregisterServer();
00089   return S_OK;
00090 }
00091
00092
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vc/myospobject.h Source File

  • Dataaccess
  • osp
  • vc

myospobject.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample OLEDB Simple Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation.  All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module MyOSPObject.h.H | MyOSPObject implementation
00008 //
00009 //
00010 #ifndef _COSPROVIDER_H_
00011 #define _COSPROVIDER_H_
00012
00013
00014 ////////////////////////////////////////////////////////
00015 // Includes
00016 //
00017 ////////////////////////////////////////////////////////
00018 #include "msdaosp.h"
00019 #include "CExList.h"
00020
00021 ////////////////////////////////////////////////////////
00022 // Defines
00023 //
00024 ////////////////////////////////////////////////////////
00025 #define MAX_INPUT_BUFFER  2048
00026 #define MAX_OUTPUT_BUFFER 4096
00027 #define MAX_WIDE_BUFFER   4096
00028
00029 enum EOSPEVENTS
00030 {
00031   //Change notifcations
00032   CHANGECELL_ABOUTTODO,
00033   CHANGECELL_DIDEVENT,
00034   DELETEROWS_ABOUTTODO,
00035   DELETEROWS_DIDEVENT,
00036   INSERTROWS_ABOUTTODO,
00037   INSERTROWS_DIDEVENT,
00038
00039   //Asynch Notifications
00040   ROWSAVAILABLE_DIDEVENT,
00041   TRANSFERCOMPLETE_DIDEVENT,
00042   TRANSFERCOMPLETE_FAILEDTODO,
00043 };
00044
00045 ////////////////////////////////////////////////////////
00046 // MyOSPObject - Sample OLEDBSimpleProvider
00047 //
00048 ////////////////////////////////////////////////////////
00049 class MyOSPObject : public OLEDBSimpleProvider
00050 {
00051 public:
00052   //constructors
00053   MyOSPObject();
00054   virtual ~MyOSPObject();
00055   virtual HRESULT Init(WCHAR* pwszFilePath);
00056
00057   //IUnknown
00058   virtual inline STDMETHODIMP_(ULONG) AddRef()
00059   {
00060     InterlockedIncrement((LONG*)&m_cRef);
00061     return m_cRef;
00062   }
00063   virtual inline STDMETHODIMP_(ULONG) Release()
00064   {
00065     if(InterlockedDecrement((LONG*)&m_cRef))
00066       return m_cRef;
00067
00068     delete this;
00069     return 0;
00070   }
00071   virtual STDMETHODIMP  QueryInterface(REFIID riid, void** ppv);
00072
00073   //OLEDBSimpleProvider methods
00074   virtual STDMETHODIMP  getRowCount(LONG* pcRows);
00075     virtual STDMETHODIMP  getColumnCount(LONG* pcColumns);
00076   virtual STDMETHODIMP  getRWStatus(LONG iRow, LONG iColumn, OSPRW* prwStatus);
00077
00078   virtual STDMETHODIMP  getVariant(LONG iRow, LONG iColumn, OSPFORMAT format, VARIANT* pVar);
00079     virtual STDMETHODIMP  setVariant(LONG iRow, LONG iColumn, OSPFORMAT format, VARIANT Var);
00080
00081   virtual STDMETHODIMP  getLocale(BSTR* pbstrLocale);
00082
00083     virtual STDMETHODIMP  deleteRows(LONG iRow, LONG cRows, LONG* pcRowsDeleted);
00084     virtual STDMETHODIMP  insertRows(LONG iRow, LONG cRows, LONG* pcRowsInserted);
00085     virtual STDMETHODIMP  find(LONG iRowStart, LONG iColumn, VARIANT val, OSPFIND findFlags, OSPCOMP compType, LONG* piRowFound);
00086
00087     virtual STDMETHODIMP  addOLEDBSimpleProviderListener(OLEDBSimpleProviderListener* pospIListener);
00088     virtual STDMETHODIMP  removeOLEDBSimpleProviderListener(OLEDBSimpleProviderListener* pospIListener);
00089
00090   virtual STDMETHODIMP  isAsync(BOOL* pbAsynch);
00091   virtual STDMETHODIMP  getEstimatedRows(LONG* piRows);
00092     virtual STDMETHODIMP  stopTransfer();
00093
00094   // sample-specific routines:
00095   virtual HRESULT loadData();
00096   virtual HRESULT Notify(EOSPEVENTS eEvent, ULONG iRow, ULONG iColumn, ULONG cRows);
00097
00098 protected:
00099   //data
00100   VARIANT**               m_rvTable;      // Pointer to start of Array
00101   LONG                  m_cRows;      // Row Count
00102   LONG                  m_cColumns;     // Column Count
00103   LPSTR                 m_szFilePath;   // Pathname of *.csv File
00104   CExList<OLEDBSimpleProviderListener*> m_listListeners;  // List of OSP Listeners
00105
00106   //IUnknown
00107   ULONG m_cRef;
00108
00109 private:
00110   // routines:
00111   HRESULT saveData();
00112 };
00113
00114 #endif //_COSPROVIDER_H_
00115
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/WaitSystemDlg.h Source File

  • WinBase
  • WtsApi
  • WtsApi

WaitSystemDlg.h

Go to the documentation of this file.
00001 //  Copyright 1995-1999, Citrix Systems Inc.
00002 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00003 #if !defined(AFX_WAITSYSTEMDLG_H__5D915AC1_3390_11D1_8312_00C04FBEFCDA__INCLUDED_)
00004 #define AFX_WAITSYSTEMDLG_H__5D915AC1_3390_11D1_8312_00C04FBEFCDA__INCLUDED_
00005
00006 #if _MSC_VER >= 1000
00007 #pragma once
00008 #endif // _MSC_VER >= 1000
00009 // WaitSystemDlg.h : header file
00010 //
00011
00012 #define MAXEVENTITEMS 12
00013
00014 typedef struct _Events {
00015   TCHAR EventName[40];
00016   DWORD EventFlag;
00017 } Events;
00018
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // CWaitSystemDlg dialog
00022
00023 class CWaitSystemDlg : public CDialog
00024 {
00025 // Construction
00026 public:
00027   CWaitSystemDlg(CWnd* pParent = NULL);   // standard constructor
00028
00029 // Dialog Data
00030   //{{AFX_DATA(CWaitSystemDlg)
00031   enum { IDD = IDD_WAIT_SYSTEM_EVENT };
00032   CEdit m_serverName;
00033   CListBox  m_eventFlags;
00034   //}}AFX_DATA
00035
00036
00037 // Overrides
00038   // ClassWizard generated virtual function overrides
00039   //{{AFX_VIRTUAL(CWaitSystemDlg)
00040   protected:
00041   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00042   //}}AFX_VIRTUAL
00043
00044 // Implementation
00045 protected:
00046
00047   // Generated message map functions
00048   //{{AFX_MSG(CWaitSystemDlg)
00049   virtual BOOL OnInitDialog();
00050   virtual void OnOK();
00051   //}}AFX_MSG
00052   DECLARE_MESSAGE_MAP()
00053 private:
00054   HANDLE serverHandle;
00055   LPSTR serverName;
00056 };
00057
00058 //{{AFX_INSERT_LOCATION}}
00059 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00060
00061 #endif // !defined(AFX_WAITSYSTEMDLG_H__5D915AC1_3390_11D1_8312_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPCMenuDialog Member List

This is the complete list of members for CSCPCMenuDialog, including all inherited members.
CSCPCMenuDialog(IDataObject *pDataObj) | CSCPCMenuDialog | [inline]
m_cfDsDisplaySpecOptions | CSCPCMenuDialog | [private]
m_cfDsObjectNames | CSCPCMenuDialog | [private]
m_spDataObj | CSCPCMenuDialog | [private]
m_szADsPath | CSCPCMenuDialog | [private]
m_szClass | CSCPCMenuDialog | [private]
m_szPrefix | CSCPCMenuDialog | [private]
m_szServer | CSCPCMenuDialog | [private]
m_szServerConfigPath | CSCPCMenuDialog | [private]
m_szUsername | CSCPCMenuDialog | [private]
OnInitDialog() | CSCPCMenuDialog | [virtual]
RetrieveData() | CSCPCMenuDialog |
SetUIData() | CSCPCMenuDialog |
~CSCPCMenuDialog() | CSCPCMenuDialog | [inline]
Generated on Wed Nov 13 2024 16:57:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/DataSource/resource.h Source File

  • Multimedia
  • WindowsMediaServices9
  • DataSource

resource.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            resource.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #pragma once
00013 //{{NO_DEPENDENCIES}}
00014 // Microsoft Developer Studio generated include file.
00015 // Used by SDKSampleStoragePlugin.rc
00016 //
00017 #define IDS_PROJNAME                    100
00018 #define IDR_SDKSAMPLESTORAGESYSTEM      101
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        201
00025 #define _APS_NEXT_COMMAND_VALUE         32768
00026 #define _APS_NEXT_CONTROL_VALUE         201
00027 #define _APS_NEXT_SYMED_VALUE           102
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/registry.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

registry.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef __Registry_H__
00015 #define __Registry_H__
00016
00017 #include <tchar.h>
00018
00019 // This function will register a component in the Registry.
00020 // The component calls this function from its DllRegisterServer function.
00021 HRESULT RegisterServer( HMODULE hModule,
00022                         const CLSID& clsid,
00023                         const TCHAR* szFriendlyName) ;
00024
00025 // This function will unregister a component.  Components
00026 // call this function from their DllUnregisterServer function.
00027 HRESULT UnregisterServer( const CLSID& clsid ) ;
00028
00029
00030 // This function will register a Snap-In component.  Components
00031 // call this function from their DllRegisterServer function.
00032 HRESULT RegisterSnapin( const CLSID& clsid,            // Class ID
00033                         const TCHAR* szNameString,     // NameString
00034                         const CLSID& clsidAbout,       // Class Id for About Class
00035                         const BOOL fSupportExtensions = FALSE
00036                       );
00037
00038 HRESULT UnregisterSnapin( const CLSID& clsid );        // Class ID
00039
00040 #endif //__Registry_H__
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/basesnap.h Source File

  • SysMgmt
  • MMC
  • Tbarext

basesnap.h

Go to the documentation of this file.
00001
00002 //==============================================================;
00003 //
00004 //  This source code is only intended as a supplement to existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #ifndef _BASESNAP_H_
00020 #define _BASESNAP_H_
00021
00022 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00023 STDAPI DllCanUnloadNow(void);
00024
00025 ULONG g_uObjects = 0;
00026 ULONG g_uSrvLock = 0;
00027
00028 class CClassFactory : public IClassFactory
00029 {
00030 private:
00031     ULONG m_cref;
00032
00033 public:
00034     enum FACTORY_TYPE {TOOLBAREXTENSION = 0, ABOUT = 1};
00035
00036     CClassFactory(FACTORY_TYPE factoryType);
00037     ~CClassFactory();
00038
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00044     STDMETHODIMP LockServer(BOOL);
00045
00046 private:
00047     FACTORY_TYPE m_factoryType;
00048 };
00049
00050 #endif _BASESNAP_H_
00051
00052
00053
00054
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/QueryUsers/vc/queryusers.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • QueryUsers
  • vc

queryusers.cpp

Go to the documentation of this file.
00001 // attributes.cpp : Defines the entry point for the console application.
00002 //
00003 #include <objbase.h>
00004 #include <wchar.h>
00005 #include <activeds.h>
00006 //Make sure you define UNICODE
00007 //Need to define version 5 for Windows 2000
00008 #define _WIN32_WINNT 0x0500
00009
00010
00011 #include <sddl.h>
00012
00013 HRESULT FindUsers(IDirectorySearch *pContainerToSearch,  //IDirectorySearch pointer to the container to search.
00014      LPOLESTR szFilter, //Filter for finding specific users.
00015                             //NULL returns all user objects.
00016          LPOLESTR *pszPropertiesToReturn, //Properties to return for user objects found
00017                               //NULL returns all set properties.
00018      BOOL bIsVerbose //TRUE means display all properties for the found objects are displayed.
00019                      //FALSE means only the RDN
00020               );
00021
00022
00023 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy=-1);
00024
00025 void wmain( int argc, wchar_t *argv[])
00026 {
00027
00028 //Handle the command line arguments.
00029 int maxAlloc = MAX_PATH*2;
00030 LPOLESTR pszBuffer = new OLECHAR[maxAlloc];
00031 wcscpy(pszBuffer, L"");
00032 BOOL bReturnVerbose = FALSE;
00033
00034 for (int i = 1;i<argc;i++)
00035 {
00036     if (_wcsicmp(argv[i],L"/V") == 0)
00037   {
00038     bReturnVerbose = TRUE;
00039   }
00040   else if ((_wcsicmp(argv[i],L"/?") == 0)||
00041              (_wcsicmp(argv[i],L"-?") == 0))
00042   {
00043     wprintf(L"This program queries for users in the current user's domain.\n");
00044     wprintf(L"Syntax: queryusers [/V][querystring]\n");
00045     wprintf(L"where /V specifies that all properties for the found users should be returned.\n");
00046     wprintf(L"      querystring is the query criteria in ldap query format.\n");
00047     wprintf(L"Defaults: If no /V is specified, the query returns only the RDN and DN of the items found.\n");
00048     wprintf(L"          If no querystring is specified, the query returns all users.\n");
00049     wprintf(L"Example: queryusers (sn=Smith)\n");
00050     wprintf(L"Returns all users with surname Smith.\n");
00051     return;
00052   }
00053   else
00054   {
00055     if ( IS_BUFFER_ENOUGH(maxAlloc, pszBuffer, argv[i]) > 0 )
00056     {
00057         wcscpy(pszBuffer,argv[i]);
00058     }
00059     else
00060     {
00061       wprintf(L"Buffer is too small for the argument");
00062       return;
00063     }
00064   }
00065 }
00066 if (_wcsicmp(pszBuffer,L"") == 0)
00067   wprintf(L"\nFinding all user objects...\n\n");
00068 else
00069   wprintf(L"\nFinding user objects based on query: %s...\n\n", pszBuffer);
00070
00071 //Initialize COM
00072 CoInitialize(NULL);
00073 HRESULT hr = S_OK;
00074 //Get rootDSE and the current user's domain container DN.
00075 IADs *pObject = NULL;
00076 IDirectorySearch *pContainerToSearch = NULL;
00077 LPOLESTR szPath = new OLECHAR[MAX_PATH];
00078 VARIANT var;
00079 hr = ADsOpenObject(L"LDAP://rootDSE",
00080          NULL,
00081          NULL,
00082          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00083          IID_IADs,
00084          (void**)&pObject);
00085 if (FAILED(hr))
00086 {
00087    wprintf(L"Could not execute query. Could not bind to LDAP://rootDSE.\n");
00088    if (pObject)
00089      pObject->Release();
00090    return;
00091 }
00092 if (SUCCEEDED(hr))
00093 {
00094   hr = pObject->Get(L"defaultNamingContext",&var);
00095   if (SUCCEEDED(hr))
00096   {
00097     //Build path to the domain container.
00098         wcscpy(szPath,L"LDAP://");
00099     if ( IS_BUFFER_ENOUGH(MAX_PATH, szPath, var.bstrVal) > 0 )
00100     {
00101         wcscat(szPath,var.bstrVal);
00102     }
00103     else
00104     {
00105       wprintf(L"Buffer is too small for the domain DN");
00106       return;
00107     }
00108
00109
00110         hr = ADsOpenObject(szPath,
00111              NULL,
00112              NULL,
00113              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00114              IID_IDirectorySearch,
00115              (void**)&pContainerToSearch);
00116
00117     if (SUCCEEDED(hr))
00118     {
00119       hr = FindUsers(pContainerToSearch, //IDirectorySearch pointer to Partitions container.
00120            pszBuffer,
00121            NULL, //Return all properties
00122            bReturnVerbose
00123          );
00124       if (SUCCEEDED(hr))
00125       {
00126         if (S_FALSE==hr)
00127            wprintf(L"No user object could be found.\n");
00128       }
00129       else if (0x8007203e==hr)
00130         wprintf(L"Could not execute query. An invalid filter was specified.\n");
00131       else
00132         wprintf(L"Query failed to run. HRESULT: %x\n",hr);
00133     }
00134     else
00135     {
00136        wprintf(L"Could not execute query. Could not bind to the container.\n");
00137     }
00138     if (pContainerToSearch)
00139        pContainerToSearch->Release();
00140   }
00141     VariantClear(&var);
00142 }
00143 if (pObject)
00144     pObject->Release();
00145
00146 // Uninitialize COM
00147 CoUninitialize();
00148 return;
00149 }
00150
00151
00152
00153
00154
00155 HRESULT FindUsers(IDirectorySearch *pContainerToSearch,  //IDirectorySearch pointer to Partitions container.
00156      LPOLESTR szFilter, //Filter for finding specific crossrefs.
00157                             //NULL returns all attributeSchema objects.
00158          LPOLESTR *pszPropertiesToReturn, //Properties to return for crossRef objects found
00159                               //NULL returns all set properties.
00160      BOOL bIsVerbose //TRUE means all properties for the found objects are displayed.
00161                      //FALSE means only the RDN
00162               )
00163 {
00164   if (!pContainerToSearch)
00165     return E_POINTER;
00166     //Create search filter
00167   LPOLESTR pszSearchFilter = new OLECHAR[MAX_PATH*2];
00168   wchar_t szFormat[] = L"(&(objectClass=user)(objectCategory=person)%s)";
00169
00170   // Check the buffer first
00171    if ( IS_BUFFER_ENOUGH(MAX_PATH*2, szFormat, szFilter) > 0 )
00172    {
00173      //Add the filter.
00174           wsprintf(pszSearchFilter, szFormat,szFilter);
00175    }
00176    else
00177    {
00178      wprintf(L"The filter is too large for buffer, aborting...");
00179          return FALSE;
00180    }
00181
00182
00183
00184     //Specify subtree search
00185   ADS_SEARCHPREF_INFO SearchPrefs;
00186   SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00187   SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
00188   SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
00189     DWORD dwNumPrefs = 1;
00190
00191   // COL for iterations
00192   LPOLESTR pszColumn = NULL;
00193   ADS_SEARCH_COLUMN col;
00194     HRESULT hr;
00195
00196     // Interface Pointers
00197     IADs    *pObj = NULL;
00198     IADs  * pIADs = NULL;
00199
00200     // Handle used for searching
00201     ADS_SEARCH_HANDLE hSearch = NULL;
00202
00203   // Set the search preference
00204     hr = pContainerToSearch->SetSearchPreference( &SearchPrefs, dwNumPrefs);
00205     if (FAILED(hr))
00206         return hr;
00207
00208   LPOLESTR pszBool = NULL;
00209   DWORD dwBool;
00210   PSID pObjectSID = NULL;
00211   LPOLESTR szSID = NULL;
00212   LPOLESTR szDSGUID = new WCHAR [39];
00213   LPGUID pObjectGUID = NULL;
00214   FILETIME filetime;
00215   SYSTEMTIME systemtime;
00216   DATE date;
00217   VARIANT varDate;
00218   LARGE_INTEGER liValue;
00219   LPOLESTR *pszPropertyList = NULL;
00220   LPOLESTR pszNonVerboseList[] = {L"name",L"distinguishedName"};
00221
00222   LPOLESTR szName = new OLECHAR[MAX_PATH];
00223   LPOLESTR szDN = new OLECHAR[MAX_PATH];
00224
00225   int iCount = 0;
00226   DWORD x = 0L;
00227
00228
00229
00230   if (!bIsVerbose)
00231   {
00232      //Return non-verbose list properties only
00233          hr = pContainerToSearch->ExecuteSearch(pszSearchFilter,
00234                               pszNonVerboseList,
00235                   sizeof(pszNonVerboseList)/sizeof(LPOLESTR),
00236                   &hSearch
00237                   );
00238   }
00239   else
00240   {
00241     if (!pszPropertiesToReturn)
00242     {
00243       //Return all properties.
00244       hr = pContainerToSearch->ExecuteSearch(pszSearchFilter,
00245                               NULL,
00246                   0L,
00247                   &hSearch
00248                   );
00249     }
00250     else
00251     {
00252       //specified subset.
00253         pszPropertyList = pszPropertiesToReturn;
00254        //Return specified properties
00255        hr = pContainerToSearch->ExecuteSearch(pszSearchFilter,
00256                               pszPropertyList,
00257                   sizeof(pszPropertyList)/sizeof(LPOLESTR),
00258                   &hSearch
00259                   );
00260     }
00261   }
00262   if ( SUCCEEDED(hr) )
00263   {
00264     // Call IDirectorySearch::GetNextRow() to retrieve the next row
00265     //of data
00266     hr = pContainerToSearch->GetFirstRow( hSearch);
00267     if (SUCCEEDED(hr))
00268     {
00269         while( hr != S_ADS_NOMORE_ROWS )
00270     {
00271       //Keep track of count.
00272       iCount++;
00273       if (bIsVerbose)
00274         wprintf(L"----------------------------------\n");
00275             // loop through the array of passed column names,
00276             // print the data for each column
00277
00278       while( pContainerToSearch->GetNextColumnName( hSearch, &pszColumn ) != S_ADS_NOMORE_COLUMNS )
00279             {
00280                 hr = pContainerToSearch->GetColumn( hSearch, pszColumn, &col );
00281           if ( SUCCEEDED(hr) )
00282           {
00283                 // Print the data for the column and free the column
00284           if(bIsVerbose)
00285           {
00286               // Get the data for this column
00287             wprintf(L"%s\n",col.pszAttrName);
00288           switch (col.dwADsType)
00289           {
00290             case ADSTYPE_DN_STRING:
00291                           for (x = 0; x< col.dwNumValues; x++)
00292               {
00293                 wprintf(L"  %s\r\n",col.pADsValues[x].DNString);
00294               }
00295               break;
00296             case ADSTYPE_CASE_EXACT_STRING:
00297             case ADSTYPE_CASE_IGNORE_STRING:
00298             case ADSTYPE_PRINTABLE_STRING:
00299             case ADSTYPE_NUMERIC_STRING:
00300             case ADSTYPE_TYPEDNAME:
00301             case ADSTYPE_FAXNUMBER:
00302             case ADSTYPE_PATH:
00303             case ADSTYPE_OBJECT_CLASS:
00304               for (x = 0; x< col.dwNumValues; x++)
00305               {
00306                 wprintf(L"  %s\r\n",col.pADsValues[x].CaseIgnoreString);
00307               }
00308               break;
00309             case ADSTYPE_BOOLEAN:
00310               for (x = 0; x< col.dwNumValues; x++)
00311               {
00312                 dwBool = col.pADsValues[x].Boolean;
00313                 pszBool = dwBool ? L"TRUE" : L"FALSE";
00314                 wprintf(L"  %s\r\n",pszBool);
00315               }
00316               break;
00317             case ADSTYPE_INTEGER:
00318                 for (x = 0; x< col.dwNumValues; x++)
00319               {
00320                 wprintf(L"  %d\r\n",col.pADsValues[x].Integer);
00321               }
00322               break;
00323             case ADSTYPE_OCTET_STRING:
00324                 if ( _wcsicmp(col.pszAttrName,L"objectSID") == 0 )
00325               {
00326                   for (x = 0; x< col.dwNumValues; x++)
00327                 {
00328                   pObjectSID = (PSID)(col.pADsValues[x].OctetString.lpValue);
00329                   //Convert SID to string.
00330                   ConvertSidToStringSid(pObjectSID, &szSID);
00331                   wprintf(L"  %s\r\n",szSID);
00332                   LocalFree(szSID);
00333                 }
00334               }
00335                 else if ( (_wcsicmp(col.pszAttrName,L"objectGUID") == 0) )
00336               {
00337                   for (x = 0; x< col.dwNumValues; x++)
00338                 {
00339                 //Cast to LPGUID
00340                 pObjectGUID = (LPGUID)(col.pADsValues[x].OctetString.lpValue);
00341                 //Convert GUID to string.
00342 								::StringFromGUID2(*pObjectGUID, szDSGUID, 39);
00343                 //Print the GUID
00344                 wprintf(L"  %s\r\n",szDSGUID);
00345                 }
00346               }
00347               else
00348                 wprintf(L"  Value of type Octet String. No Conversion.");
00349                 break;
00350             case ADSTYPE_UTC_TIME:
00351               for (x = 0; x< col.dwNumValues; x++)
00352               {
00353               systemtime = col.pADsValues[x].UTCTime;
00354               if (SystemTimeToVariantTime(&systemtime,
00355                             &date) != 0)
00356               {
00357                 //Pack in variant.vt
00358                 varDate.vt = VT_DATE;
00359                 varDate.date = date;
00360                 VariantChangeType(&varDate,&varDate,VARIANT_NOVALUEPROP,VT_BSTR);
00361                   wprintf(L"  %s\r\n",varDate.bstrVal);
00362                 VariantClear(&varDate);
00363               }
00364               else
00365                 wprintf(L"  Could not convert UTC-Time.\n",pszColumn);
00366               }
00367               break;
00368             case ADSTYPE_LARGE_INTEGER:
00369               for (x = 0; x< col.dwNumValues; x++)
00370               {
00371                 liValue = col.pADsValues[x].LargeInteger;
00372               filetime.dwLowDateTime = liValue.LowPart;
00373               filetime.dwHighDateTime = liValue.HighPart;
00374               if((filetime.dwHighDateTime==0) && (filetime.dwLowDateTime==0))
00375               {
00376                 wprintf(L"  No value set.\n");
00377               }
00378               else
00379               {
00380                 //Check for properties of type LargeInteger that represent time
00381                 //if TRUE, then convert to variant time.
00382                 if ((0==wcscmp(L"accountExpires", col.pszAttrName))|
00383                   (0==wcscmp(L"badPasswordTime", col.pszAttrName))||
00384                   (0==wcscmp(L"lastLogon", col.pszAttrName))||
00385                   (0==wcscmp(L"lastLogoff", col.pszAttrName))||
00386                   (0==wcscmp(L"lockoutTime", col.pszAttrName))||
00387                   (0==wcscmp(L"pwdLastSet", col.pszAttrName))
00388                    )
00389                 {
00390                   //Handle special case for Never Expires where low part is -1
00391                   if (filetime.dwLowDateTime==-1)
00392                   {
00393                     wprintf(L"  Never Expires.\n");
00394                   }
00395                   else
00396                   {
00397                     if (FileTimeToLocalFileTime(&filetime, &filetime) != 0)
00398                     {
00399                       if (FileTimeToSystemTime(&filetime,
00400                                  &systemtime) != 0)
00401                       {
00402                         if (SystemTimeToVariantTime(&systemtime,
00403                                       &date) != 0)
00404                         {
00405                           //Pack in variant.vt
00406                           varDate.vt = VT_DATE;
00407                           varDate.date = date;
00408                           VariantChangeType(&varDate,&varDate,VARIANT_NOVALUEPROP,VT_BSTR);
00409                           wprintf(L"  %s\r\n",varDate.bstrVal);
00410                           VariantClear(&varDate);
00411                         }
00412                         else
00413                         {
00414                           wprintf(L"  FileTimeToVariantTime failed\n");
00415                         }
00416                       }
00417                       else
00418                       {
00419                         wprintf(L"  FileTimeToSystemTime failed\n");
00420                       }
00421
00422                     }
00423                     else
00424                     {
00425                       wprintf(L"  FileTimeToLocalFileTime failed\n");
00426                     }
00427                   }
00428                 }
00429                 else
00430                 {
00431                   //Print the LargeInteger.
00432                   wprintf(L"  high: %d low: %d\r\n",filetime.dwHighDateTime, filetime.dwLowDateTime);
00433                 }
00434               }
00435               }
00436               break;
00437             case ADSTYPE_NT_SECURITY_DESCRIPTOR:
00438               for (x = 0; x< col.dwNumValues; x++)
00439               {
00440                 wprintf(L"  Security descriptor.\n");
00441               }
00442               break;
00443             default:
00444                   wprintf(L"Unknown type %d.\n",col.dwADsType);
00445           }
00446           }
00447             else
00448           {
00449           //Verbose handles only the two single-valued attributes: cn and ldapdisplayname
00450           //so this is a special case.
00451
00452           if (0==wcscmp(L"name", pszColumn))
00453           {
00454             szName[0]=L'\0';
00455             if( IS_BUFFER_ENOUGH(MAX_PATH, szName, col.pADsValues->CaseIgnoreString) > 0 )
00456             {
00457                  wcscpy(szName,col.pADsValues->CaseIgnoreString);
00458             }
00459           }
00460           if (0==wcscmp(L"distinguishedName", pszColumn))
00461           {
00462             szDN[0]=L'\0';
00463             if( IS_BUFFER_ENOUGH(MAX_PATH, szDN, col.pADsValues->CaseIgnoreString) > 0 )
00464             {
00465                  wcscpy(szDN,col.pADsValues->CaseIgnoreString);
00466             }
00467           }
00468           }
00469             pContainerToSearch->FreeColumn( &col );
00470           }
00471         FreeADsMem( pszColumn );
00472             }
00473        if (!bIsVerbose)
00474          wprintf(L"%s\n  DN: %s\n\n",szName,szDN);
00475        //Get the next row
00476        hr = pContainerToSearch->GetNextRow( hSearch);
00477     }
00478
00479     }
00480     // Close the search handle to clean up
00481       pContainerToSearch->CloseSearchHandle(hSearch);
00482   }
00483   if (SUCCEEDED(hr) && 0==iCount)
00484     hr = S_FALSE;
00485
00486     return hr;
00487 }
00488
00489
00490
00491
00492
00493 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy)
00494
00495 {
00496          if (toCopy == -1)
00497
00498           {
00499                toCopy = wcslen(pszSource);
00500           }
00501
00502       return maxAlloc - (wcslen(pszTarget) + toCopy + 1);
00503 }
00504
00505
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/configentry.h Source File

  • NetDS
  • RRas
  • ip

configentry.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\configurationentry.h
00008
00009 Abstract:
00010
00011     The file contains definitions for the configuration entry.
00012
00013 --*/
00014
00015 #ifndef _CONFIGURATIONENTRY_H_
00016 #define _CONFIGURATIONENTRY_H_
00017
00018 //
00019 // type:    EVENT_ENTRY
00020 //
00021 // stores events for the ip router manager
00022 //
00023 // protected by the read-write lock CONFIGURATION_ENTRY::rwlLock
00024 //
00025
00026 typedef struct _EVENT_ENTRY
00027 {
00028     QUEUE_ENTRY             qeEventQueueLink;
00029     ROUTING_PROTOCOL_EVENTS rpeEvent;
00030     MESSAGE                 mMessage;
00031 } EVENT_ENTRY, *PEVENT_ENTRY;
00032
00033
00034
00035 DWORD
00036 EE_Create (
00037     IN  ROUTING_PROTOCOL_EVENTS rpeEvent,
00038     IN  MESSAGE                 mMessage,
00039     OUT PEVENT_ENTRY            *ppeeEventEntry);
00040
00041 DWORD
00042 EE_Destroy (
00043     IN  PEVENT_ENTRY            peeEventEntry);
00044
00045 #ifdef DEBUG
00046 DWORD
00047 EE_Display (
00048     IN  PEVENT_ENTRY            peeEventEntry);
00049 #else
00050 #define EE_Display(peeEventEntry)
00051 #endif // DEBUG
00052
00053 DWORD
00054 EnqueueEvent(
00055     IN  ROUTING_PROTOCOL_EVENTS rpeEvent,
00056     IN  MESSAGE                 mMessage);
00057
00058 DWORD
00059 DequeueEvent(
00060     OUT ROUTING_PROTOCOL_EVENTS  *prpeEvent,
00061     OUT MESSAGE                  *pmMessage);
00062
00063
00064
00065 //
00066 // various codes describing states of IPSAMPLE.
00067 //
00068
00069 typedef enum _IPSAMPLE_STATUS_CODE
00070 {
00071     IPSAMPLE_STATUS_RUNNING     = 101,
00072     IPSAMPLE_STATUS_STOPPING    = 102,
00073     IPSAMPLE_STATUS_STOPPED     = 103
00074 } IPSAMPLE_STATUS_CODE, *PIPSAMPLE_STATUS_CODE;
00075
00076
00077 //
00078 // type:    CONFIGURATION_ENTRY
00079 //
00080 // stores global state.
00081 //
00082 // igsStats is protected through interlocked increments or decrements
00083 // lqEventQueue is protected by its own lock
00084 // rest protected by the read-write lock CONFIGURATION_ENTRY::rwlLock
00085 //
00086
00087
00088 typedef struct _CONFIGURATION_ENTRY
00089 {
00090     //
00091     // Following are PERSISTENT, across Start and Stop Protocol
00092     //
00093
00094     // Lock
00095     READ_WRITE_LOCK         rwlLock;
00096
00097     // Global Heap
00098     HANDLE                  hGlobalHeap;
00099
00100     // Clean Stop (Protocol)
00101     ULONG                   ulActivityCount;
00102     HANDLE                  hActivitySemaphore;
00103
00104     // Logging & Tracing Information
00105     DWORD             dwLogLevel;
00106     HANDLE            hLogHandle;
00107     DWORD         dwTraceID;
00108
00109     // Event Queue
00110     LOCKED_QUEUE            lqEventQueue;
00111
00112     // Protocol State
00113     IPSAMPLE_STATUS_CODE    iscStatus;
00114
00115
00116
00117     //
00118     // Following are INITIALIZE'd and CLEANUP'd every Start & Stop Protocol
00119     //
00120
00121     // Store of Dynamic Locks
00122     DYNAMIC_LOCKS_STORE     dlsDynamicLocksStore;
00123
00124     // Timer Entry
00125     HANDLE                  hTimerQueue;
00126
00127     // Router Manager Information
00128     HANDLE            hMgrNotificationEvent;
00129     SUPPORT_FUNCTIONS       sfSupportFunctions;
00130
00131     // RTMv2 Information
00132     RTM_ENTITY_INFO     reiRtmEntity;
00133     RTM_REGN_PROFILE      rrpRtmProfile;
00134     HANDLE            hRtmHandle;
00135     HANDLE            hRtmNotificationHandle;
00136
00137     // MGM Information
00138     HANDLE            hMgmHandle;
00139
00140     // Network Entry
00141     PNETWORK_ENTRY          pneNetworkEntry;
00142
00143     // Global Statistics
00144     IPSAMPLE_GLOBAL_STATS   igsStats;
00145
00146 } CONFIGURATION_ENTRY, *PCONFIGURATION_ENTRY;
00147
00148
00149
00150 // create all fields on DLL_PROCESS_ATTACH
00151 DWORD
00152 CE_Create (
00153     IN  PCONFIGURATION_ENTRY    pce);
00154
00155 // destroy all fields on DLL_PROCESS_DEATTACH
00156 DWORD
00157 CE_Destroy (
00158     IN  PCONFIGURATION_ENTRY    pce);
00159
00160 // initialize non persistent fields on StartProtocol
00161 DWORD
00162 CE_Initialize (
00163     IN  PCONFIGURATION_ENTRY    pce,
00164     IN  HANDLE                  hMgrNotificationEvent,
00165     IN  PSUPPORT_FUNCTIONS      psfSupportFunctions,
00166     IN  PIPSAMPLE_GLOBAL_CONFIG pigc);
00167
00168 // cleanup non persistent fields on StopProtocol
00169 DWORD
00170 CE_Cleanup (
00171     IN  PCONFIGURATION_ENTRY    pce,
00172     IN  BOOL                    bCleanupWinsock);
00173
00174 #ifdef DEBUG
00175 DWORD
00176 CE_Display (
00177     IN  PCONFIGURATION_ENTRY    pce);
00178 #else
00179 #define CE_Display(pce)
00180 #endif // DEBUG
00181
00182 #endif // _CONFIGURATIONENTRY_H_
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/TapiCode.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

TapiCode.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE: TapiCode.c
00009 //
00010 //  PURPOSE: Handles all the TAPI routines for TapiComm.
00011 //
00012 //
00013 //  EXPORTED FUNCTIONS:  These functions are for use by other modules.
00014 //
00015 //    InitializeTAPI    - Initialize this app with TAPI.
00016 //    ShutdownTAPI      - Shutdown this app from TAPI.
00017 //    DialCall          - Dial a Call.
00018 //    HangupCall        - Hangup an existing Call.
00019 //    PostHangupCall    - Posts a HangupCall message to the main window.
00020 //
00021 //  INTERNAL FUNCTIONS:  These functions are for this module only.
00022 //
00023 //    DialCallInParts           - Actually Dial the call.
00024 //
00025 //    lineCallbackFunc          - TAPI callback for async messages.
00026 //
00027 //    CheckAndReAllocBuffer     - Helper function for I_ wrappers functions.
00028 //
00029 //    I_lineNegotiateAPIVersion - Wrapper for lineNegotiateAPIVersion.
00030 //    I_lineGetDevCaps          - Wrapper for lineGetDevCaps.
00031 //    I_lineGetAddressStatus    - Wrapper for lineGetAddressStatus.
00032 //    I_lineTranslateAddress    - Wrapper for lineTranslateAddress.
00033 //    I_lineGetCallStatus       - Wrapper for lineGetCallStatus.
00034 //    I_lineGetAddressCaps      - Wrapper for lineGetAddressCaps.
00035 //
00036 //    WaitForCallState          - Resynchronize by Waiting for a CallState.
00037 //    WaitForReply              - Resynchronize by Waiting for a LINE_REPLY.
00038 //
00039 //    DoLineReply               - Handle asynchronous LINE_REPLY.
00040 //    DoLineClose               - Handle asynchronous LINE_CLOSE.
00041 //    DoLineDevState            - Handle asynchronous LINE_LINEDEVSTATE.
00042 //    DoLineCallState           - Handle asynchronous LINE_CALLSTATE.
00043 //    DoLineCreate              - Handle asynchronous LINE_CREATE.
00044 //
00045 //    HandleLineErr             - Handler for most LINEERR errors.
00046 //
00047 //    HandleIniFileCorrupt      - LINEERR handler for INIFILECORRUPT.
00048 //    HandleNoDriver            - LINEERR handler for NODRIVER.
00049 //    HandleNoDevicesInstalled  - LINEERR handler for NODEVICE.
00050 //    HandleReInit              - LINEERR handler for REINIT.
00051 //    HandleNoMultipleInstance  - LINEERR handler for NOMULTIPLEINSTANCE.
00052 //    HandleNoMem               - LINEERR handler for NOMEM.
00053 //    HandleOperationFailed     - LINEERR handler for OPERATIONFAILED.
00054 //    HandleResourceUnavail     - LINEERR handler for RESOURCEUNAVAIL.
00055 //
00056 //    LaunchModemControlPanelAdd - Launches the Modem Control Panel.
00057 //
00058 //    WarningBox                - Warn user if a line in use is removed.
00059 //
00060 //    GetAddressToDial          - Launches a GetAddressToDial dialog.
00061 //    DialDialogProc            - Dialog Proc for the GetAddressToDial API.
00062 //
00063 //    I_lineNegotiateLegacyAPIVersion - Wrapper to negoitiate with legacy TSPs
00064 //    VerifyUsableLine          - Verify that a line device is usable
00065 //    FillTAPILine              - Fill a combobox with TAPI Device names
00066 //    VerifyAndWarnUsableLine   - Verify and warn if a line device is usable
00067 //    FillCountryCodeList       - Fill a combobox with country codes
00068 //    FillLocationInfo          - Fill a combobox with current TAPI locations
00069 //    UseDialingRules           - Enable/Disable dialing rules controls
00070 //    DisplayPhoneNumber        - Create and display a valid phone number
00071 //    PreConfigureDevice        - Preconfigure a device line
00072
00073
00074 #include <tapi.h>
00075 #include <windows.h>
00076 #include <string.h>
00077 #include "globals.h"
00078 #include "TapiInfo.h"
00079 #include "TapiCode.h"
00080 #include "CommCode.h"
00081 #include "resource.h"
00082 #include "statbar.h"
00083 #include "toolbar.h"
00084
00085
00086 // All TAPI line functions return 0 for SUCCESS, so define it.
00087 #define SUCCESS 0
00088
00089 // Possible return error for resynchronization functions.
00090 #define WAITERR_WAITABORTED  1
00091 #define WAITERR_WAITTIMEDOUT 2
00092
00093 // Reasons why a line device might not be usable by TapiComm.
00094 #define LINENOTUSEABLE_ERROR            1
00095 #define LINENOTUSEABLE_NOVOICE          2
00096 #define LINENOTUSEABLE_NODATAMODEM      3
00097 #define LINENOTUSEABLE_NOMAKECALL       4
00098 #define LINENOTUSEABLE_ALLOCATED        5
00099 #define LINENOTUSEABLE_INUSE            6
00100 #define LINENOTUSEABLE_NOCOMMDATAMODEM  7
00101
00102 // Constant used in WaitForCallState when any new
00103 // callstate message is acceptable.
00104 #define I_LINECALLSTATE_ANY 0
00105
00106  // Wait up to 30 seconds for an async completion.
00107 #define WAITTIMEOUT 30000
00108
00109 // TAPI version that this sample is designed to use.
00110 #define SAMPLE_TAPI_VERSION 0x00010004
00111
00112
00113 // Global TAPI variables.
00114 HWND     g_hWndMainWindow = NULL;   // Apps main window.
00115 HWND     g_hDlgParentWindow = NULL; // This will be the parent of all dialogs.
00116 HLINEAPP g_hLineApp = (HLINEAPP)((ULONG_PTR)NULL);
00117 DWORD    g_dwNumDevs = 0;
00118
00119 // Global variable that holds the handle to a TAPI dialog
00120 // that needs to be dismissed if line conditions change.
00121 HWND g_hDialog = NULL;
00122
00123 // Global flags to prevent re-entrancy problems.
00124 BOOL g_bShuttingDown = FALSE;
00125 BOOL g_bStoppingCall = FALSE;
00126 BOOL g_bInitializing = FALSE;
00127
00128
00129 // This sample only supports one call in progress at a time.
00130 BOOL g_bTapiInUse = FALSE;
00131
00132
00133 // Data needed per call.  This sample only supports one call.
00134 HCALL g_hCall = (HCALL)((ULONG_PTR)NULL);
00135 HLINE g_hLine = (HLINE)((ULONG_PTR)NULL);
00136 DWORD g_dwDeviceID = 0;
00137 DWORD g_dwAPIVersion = 0;
00138 DWORD g_dwCallState = 0;
00139 char  g_szDisplayableAddress[1024] = "";
00140 char  g_szDialableAddress[1024] = "";
00141 BOOL  g_bConnected = FALSE;
00142 LPVOID g_lpDeviceConfig = NULL;
00143 DWORD g_dwSizeDeviceConfig;
00144
00145 // Global variables to allow us to do various waits.
00146 BOOL  g_bReplyRecieved;
00147 DWORD g_dwRequestedID;
00148 long  g_lAsyncReply;
00149 BOOL  g_bCallStateReceived;
00150
00151 // Structures needed to handle special non-dialable characters.
00152 #define g_sizeofNonDialable (sizeof(g_sNonDialable)/sizeof(g_sNonDialable[0]))
00153
00154 typedef struct {
00155     LONG lError;
00156     DWORD dwDevCapFlag;
00157     LPSTR szToken;
00158     LPSTR szMsg;
00159 } NONDIALTOKENS;
00160
00161 NONDIALTOKENS g_sNonDialable[] = {
00162     {LINEERR_DIALBILLING,  LINEDEVCAPFLAGS_DIALBILLING,  "$",
00163             "Wait for the credit card bong tone" },
00164     {LINEERR_DIALDIALTONE, LINEDEVCAPFLAGS_DIALDIALTONE, "W",
00165             "Wait for the second dial tone" },
00166     {LINEERR_DIALDIALTONE, LINEDEVCAPFLAGS_DIALDIALTONE, "w",
00167             "Wait for the second dial tone" },
00168     {LINEERR_DIALQUIET,    LINEDEVCAPFLAGS_DIALQUIET,    "@",
00169             "Wait for the remote end to answer" },
00170     {LINEERR_DIALPROMPT,   0,                            "?",
00171             "Press OK when you are ready to continue dialing"},
00172 };
00173
00174 // "Dial" dialog controls and their associated help page IDs
00175 DWORD g_adwSampleMenuHelpIDs[] =
00176 {
00177     IDC_COUNTRYCODE          , IDC_COUNTRYCODE,
00178     IDC_STATICCOUNTRYCODE    , IDC_COUNTRYCODE,
00179     IDC_AREACODE             , IDC_AREACODE,
00180     IDC_STATICAREACODE       , IDC_AREACODE,
00181     IDC_PHONENUMBER          , IDC_PHONENUMBER,
00182     IDC_STATICPHONENUMBER    , IDC_PHONENUMBER,
00183     IDC_USEDIALINGRULES      , IDC_USEDIALINGRULES,
00184     IDC_LOCATION             , IDC_LOCATION,
00185     IDC_STATICLOCATION       , IDC_LOCATION,
00186     IDC_CALLINGCARD          , IDC_CALLINGCARD,
00187     IDC_STATICCALLINGCARD    , IDC_CALLINGCARD,
00188     IDC_DIALINGPROPERTIES    , IDC_DIALINGPROPERTIES,
00189     IDC_TAPILINE             , IDC_TAPILINE,
00190     IDC_STATICTAPILINE       , IDC_TAPILINE,
00191     IDC_CONFIGURELINE        , IDC_CONFIGURELINE,
00192     IDC_CANONICALNUMBER      , IDC_CANONICALNUMBER,
00193     IDC_STATICCANONICAL      , IDC_CANONICALNUMBER,
00194     IDC_DIALABLENUMBER       , IDC_DIALABLENUMBER,
00195     IDC_STATICDIALABLE       , IDC_DIALABLENUMBER,
00196     IDC_DISPLAYABLENUMBER    , IDC_DISPLAYABLENUMBER,
00197     IDC_STATICDISPLAYABLE    , IDC_DISPLAYABLENUMBER,
00198     IDC_DIAL                 , IDC_DIAL,
00199     IDC_LINEICON             , IDC_LINEICON,
00200     //IDC_STATICWHERETODIAL    , IDC_STATICWHERETODIAL,
00201     //IDC_STATICHOWTODIAL      , IDC_STATICHOWTODIAL,
00202     //IDC_STATICCONNECTUSING   , IDC_STATICCONNECTUSING,
00203     //IDC_STATICPHONENUMBER    , IDC_PHONENUMBER,
00204     0,0
00205 };
00206
00207 //**************************************************
00208 // Prototypes for functions used only in this module.
00209 //**************************************************
00210
00211 BOOL DialCallInParts (
00212     LPLINEDEVCAPS lpLineDevCaps,
00213     LPCSTR lpszAddress,
00214     LPCSTR lpszDisplayableAddress);
00215
00216 LPLINECALLPARAMS CreateCallParams (
00217     LPLINECALLPARAMS lpCallParams,
00218     LPCSTR lpszDisplayableAddress);
00219
00220 DWORD I_lineNegotiateAPIVersion (
00221     DWORD dwDeviceID);
00222
00223 LPVOID CheckAndReAllocBuffer(
00224     LPVOID lpBuffer, size_t sizeBufferMinimum,
00225     LPCSTR szApiPhrase);
00226
00227 LPLINEDEVCAPS I_lineGetDevCaps (
00228     LPLINEDEVCAPS lpLineDevCaps,
00229     DWORD dwDeviceID,
00230     DWORD dwAPIVersion);
00231
00232 LPLINEADDRESSSTATUS I_lineGetAddressStatus (
00233     LPLINEADDRESSSTATUS lpLineAddressStatus,
00234     HLINE hLine,
00235     DWORD dwAddressID);
00236
00237 LPLINETRANSLATEOUTPUT I_lineTranslateAddress (
00238     LPLINETRANSLATEOUTPUT lpLineTranslateOutput,
00239     DWORD dwDeviceID,
00240     DWORD dwAPIVersion,
00241     LPCSTR lpszDialAddress);
00242
00243 LPLINECALLSTATUS I_lineGetCallStatus (
00244     LPLINECALLSTATUS lpLineCallStatus,
00245     HCALL hCall);
00246
00247 LPLINEADDRESSCAPS I_lineGetAddressCaps (
00248     LPLINEADDRESSCAPS lpLineAddressCaps,
00249     DWORD dwDeviceID, DWORD dwAddressID,
00250     DWORD dwAPIVersion, DWORD dwExtVersion);
00251
00252 long WaitForCallState (DWORD dwNewCallState);
00253
00254 long WaitForReply (long lRequestID);
00255
00256 void CALLBACK lineCallbackFunc(
00257     DWORD hDevice, DWORD dwMsg, DWORD dwCallbackInstance,
00258     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
00259
00260 void DoLineReply(
00261     DWORD dwDevice, DWORD dwMsg, DWORD dwCallbackInstance,
00262     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
00263 void DoLineClose(
00264     DWORD dwDevice, DWORD dwMsg, DWORD dwCallbackInstance,
00265     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
00266 void DoLineDevState(
00267     DWORD dwDevice, DWORD dwsg, DWORD dwCallbackInstance,
00268     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
00269 void DoLineCallState(
00270     DWORD dwDevice, DWORD dwMsg, DWORD dwCallbackInstance,
00271     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
00272 void DoLineCreate(
00273     DWORD dwDevice, DWORD dwMessage, DWORD dwCallbackInstance,
00274     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
00275
00276 BOOL HandleLineErr(long lLineErr);
00277
00278 BOOL HandleIniFileCorrupt();
00279 BOOL HandleNoDriver();
00280 BOOL HandleNoDevicesInstalled();
00281 BOOL HandleReInit();
00282 BOOL HandleNoMultipleInstance();
00283 BOOL HandleNoMem();
00284 BOOL HandleOperationFailed();
00285 BOOL HandleResourceUnavail();
00286
00287 BOOL LaunchModemControlPanelAdd();
00288
00289 void WarningBox(LPCSTR lpszMessage);
00290
00291 INT_PTR CALLBACK DialDialogProc(
00292     HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
00293
00294 BOOL GetAddressToDial();
00295
00296 DWORD I_lineNegotiateLegacyAPIVersion(DWORD dwDeviceID);
00297 long VerifyUsableLine(DWORD dwDeviceID);
00298 void FillTAPILine(HWND hwndDlg);
00299 BOOL VerifyAndWarnUsableLine(HWND hwndDlg);
00300 void FillCountryCodeList(HWND hwndDlg, DWORD dwDefaultCountryID);
00301 void FillLocationInfo(HWND hwndDlg, LPSTR lpszCurrentLocation,
00302     LPDWORD lpdwCountryID, LPSTR lpszAreaCode);
00303 void UseDialingRules(HWND hwndDlg);
00304 void DisplayPhoneNumber(HWND hwndDlg);
00305 void PreConfigureDevice(HWND hwndDlg, DWORD dwDeviceID);
00306
00307
00308 //**************************************************
00309 // Entry points from the UI
00310 //**************************************************
00311
00312
00313 //
00314 //  FUNCTION: BOOL InitializeTAPI(HWND)
00315 //
00316 //  PURPOSE: Initializes TAPI
00317 //
00318 //  PARAMETERS:
00319 //    hWndParent - Window to use as parent of any dialogs.
00320 //
00321 //  RETURN VALUE:
00322 //    Always returns 0 - command handled.
00323 //
00324 //  COMMENTS:
00325 //
00326 //    This is the API that initializes the app with TAPI.
00327 //    If NULL is passed for the hWndParent, then its assumed
00328 //    that re-initialization has occurred and the previous hWnd
00329 //    is used.
00330 //
00331 //
00332
00333 BOOL InitializeTAPI(HWND hWndParent)
00334 {
00335     long lReturn;
00336     BOOL bTryReInit = TRUE;
00337
00338     // If we're already initialized, then initialization succeeds.
00339     if (g_hLineApp)
00340         return TRUE;
00341
00342     // If we're in the middle of initializing, then fail, we're not done.
00343     if (g_bInitializing)
00344         return FALSE;
00345
00346     g_bInitializing = TRUE;
00347
00348     // Initialize TAPI
00349     do
00350     {
00351         lReturn = lineInitialize(&g_hLineApp, hInst,
00352             (LINECALLBACK) lineCallbackFunc, (LPCSTR)"TapiComm", (LPDWORD)&g_dwNumDevs);
00353
00354         // If we get this error, its because some other app has yet
00355         // to respond to the REINIT message.  Wait 5 seconds and try
00356         // again.  If it still doesn't respond, tell the user.
00357         if (lReturn == LINEERR_REINIT)
00358         {
00359             if (bTryReInit)
00360             {
00361                 MSG msg;
00362                 DWORD dwTimeStarted;
00363
00364                 dwTimeStarted = GetTickCount();
00365
00366                 while(GetTickCount() - dwTimeStarted < 5000)
00367                 {
00368                     if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
00369                     {
00370                         TranslateMessage(&msg);
00371                         DispatchMessage(&msg);
00372                     }
00373                 }
00374
00375                 bTryReInit = FALSE;
00376                 continue;
00377             }
00378             else
00379             {
00380                 MessageBox(g_hDlgParentWindow,
00381                     "A change to the system configuration requires that "
00382                     "all Telephony applications relinquish their use of "
00383                     "Telephony before any can progress.  "
00384                     "Some have not yet done so."
00385                     ,"Warning",MB_OK);
00386                 g_bInitializing = FALSE;
00387                 return FALSE;
00388             }
00389         }
00390
00391         if (lReturn == LINEERR_NODEVICE)
00392         {
00393             if (HandleNoDevicesInstalled())
00394                 continue;
00395             else
00396             {
00397                 OutputDebugString("No devices installed.\n");
00398                 g_bInitializing = FALSE;
00399                 return FALSE;
00400             }
00401         }
00402
00403         if (HandleLineErr(lReturn))
00404             continue;
00405         else
00406         {
00407             OutputDebugLineError(lReturn,
00408                 "lineInitialize unhandled error: ");
00409             g_bInitializing = FALSE;
00410             return FALSE;
00411         }
00412     }
00413     while(lReturn != SUCCESS);
00414
00415     // if hWndParent is a valid hWnd, we keep it as the parent for
00416     // all dialogs.
00417     if (IsWindow(hWndParent))
00418     {
00419         g_hDlgParentWindow = g_hWndMainWindow = hWndParent;
00420     }
00421     else
00422     {
00423         // Has the old g_hWndMainWindow gone away?
00424         if (!IsWindow(g_hWndMainWindow))
00425         {
00426             OutputDebugString("Main window unavailable.\n");
00427             g_hDlgParentWindow = g_hWndMainWindow = NULL;
00428         }
00429     }
00430
00431     g_hCall = (HCALL)((ULONG_PTR)NULL);
00432     g_hLine = (HLINE)((ULONG_PTR)NULL);
00433
00434     OutputDebugString("Tapi initialized.\n");
00435     g_bInitializing = FALSE;
00436     return TRUE;
00437 }
00438
00439
00440 //
00441 //  FUNCTION: BOOL ShutdownTAPI()
00442 //
00443 //  PURPOSE: Shuts down all use of TAPI
00444 //
00445 //  PARAMETERS:
00446 //    None
00447 //
00448 //  RETURN VALUE:
00449 //    True if TAPI successfully shut down.
00450 //
00451 //  COMMENTS:
00452 //
00453 //    If ShutdownTAPI fails, then its likely either a problem
00454 //    with the service provider (and might require a system
00455 //    reboot to correct) or the application ran out of memory.
00456 //
00457 //
00458
00459 BOOL ShutdownTAPI()
00460 {
00461     long lReturn;
00462
00463     // If we aren't initialized, then Shutdown is unnecessary.
00464     if (g_hLineApp == (HLINE)((ULONG_PTR)NULL))
00465         return TRUE;
00466
00467     // Prevent ShutdownTAPI re-entrancy problems.
00468     if (g_bShuttingDown)
00469         return TRUE;
00470
00471     g_bShuttingDown = TRUE;
00472
00473     HangupCall();
00474
00475     do
00476     {
00477         lReturn = lineShutdown(g_hLineApp);
00478         if (HandleLineErr(lReturn))
00479             continue;
00480         else
00481         {
00482             OutputDebugLineError(lReturn, "lineShutdown unhandled error: ");
00483             break;
00484         }
00485     }
00486     while(lReturn != SUCCESS);
00487
00488     g_bTapiInUse = FALSE;
00489     g_bConnected = FALSE;
00490     g_hLineApp = (HLINE)((ULONG_PTR)NULL);
00491     g_hCall = (HCALL)((ULONG_PTR)NULL);
00492     g_hLine = (HLINE)((ULONG_PTR)NULL);
00493     g_bShuttingDown = FALSE;
00494     OutputDebugString("TAPI uninitialized.\n");
00495     return TRUE;
00496 }
00497
00498
00499
00500 //
00501 //  FUNCTION: BOOL HangupCall()
00502 //
00503 //  PURPOSE: Hangup the call in progress if it exists.
00504 //
00505 //  PARAMETERS:
00506 //    none
00507 //
00508 //  RETURN VALUE:
00509 //    TRUE if call hung up successfully.
00510 //
00511 //  COMMENTS:
00512 //
00513 //    If HangupCall fails, then its likely either a problem
00514 //    with the service provider (and might require a system
00515 //    reboot to correct) or the application ran out of memory.
00516 //
00517 //
00518
00519 BOOL HangupCall()
00520 {
00521     LPLINECALLSTATUS pLineCallStatus = NULL;
00522     long lReturn;
00523
00524     // Prevent HangupCall re-entrancy problems.
00525     if (g_bStoppingCall)
00526         return TRUE;
00527
00528     // if the 'Call' dialog is up, dismiss it.
00529     if (g_hDialog)
00530         PostMessage(g_hDialog, WM_COMMAND, IDCANCEL, 0);
00531
00532     // If Tapi is not being used right now, then the call is hung up.
00533     if (!g_bTapiInUse)
00534         return TRUE;
00535
00536     g_bStoppingCall = TRUE;
00537     OutputDebugString("Stopping Call in progress\n");
00538
00539     // Disable the 'hangup call' user interface.
00540     EnableHangupCall(g_hWndMainWindow, FALSE);
00541
00542     // Stop any data communications on the comm port.
00543     StopComm();
00544
00545     // If there is a call in progress, drop and deallocate it.
00546     if (g_hCall)
00547     {
00548         // I_lineGetCallStatus returns a LocalAlloc()d buffer
00549         pLineCallStatus = I_lineGetCallStatus(pLineCallStatus, g_hCall);
00550         if (pLineCallStatus == NULL)
00551         {
00552             ShutdownTAPI();
00553             g_bStoppingCall = FALSE;
00554             return FALSE;
00555         }
00556
00557         // Only drop the call when the line is not IDLE.
00558         if (!((pLineCallStatus -> dwCallState) & LINECALLSTATE_IDLE))
00559         {
00560             do
00561             {
00562                 lReturn = WaitForReply(lineDrop(g_hCall, NULL, 0));
00563
00564                 if (lReturn == WAITERR_WAITTIMEDOUT)
00565                 {
00566                     OutputDebugString("Call timed out in WaitForReply.\n");
00567                     break;
00568                 }
00569
00570                 if (lReturn == WAITERR_WAITABORTED)
00571                 {
00572                     OutputDebugString("lineDrop: WAITERR_WAITABORTED.\n");
00573                     break;
00574                 }
00575
00576                 // Was the call already in IDLE?
00577                 if (lReturn == LINEERR_INVALCALLSTATE)
00578                     break;
00579
00580                 if (HandleLineErr(lReturn))
00581                     continue;
00582                 else
00583                 {
00584                     OutputDebugLineError(lReturn,
00585                         "lineDrop unhandled error: ");
00586                     break;
00587                 }
00588             }
00589             while(lReturn != SUCCESS);
00590
00591             // Wait for the dropped call to go IDLE before continuing.
00592             lReturn = WaitForCallState(LINECALLSTATE_IDLE);
00593
00594             if (lReturn == WAITERR_WAITTIMEDOUT)
00595                 OutputDebugString("Call timed out waiting for IDLE state.\n");
00596
00597             if (lReturn == WAITERR_WAITABORTED)
00598                 OutputDebugString(
00599                     "WAITERR_WAITABORTED while waiting for IDLE state.\n");
00600
00601             OutputDebugString("Call Dropped.\n");
00602         }
00603
00604         // The call is now idle.  Deallocate it!
00605         do
00606         {
00607             lReturn = lineDeallocateCall(g_hCall);
00608             if (HandleLineErr(lReturn))
00609                 continue;
00610             else
00611             {
00612                 OutputDebugLineError(lReturn,
00613                     "lineDeallocateCall unhandled error: ");
00614                 break;
00615             }
00616         }
00617         while(lReturn != SUCCESS);
00618
00619         OutputDebugString("Call Deallocated.\n");
00620     }
00621
00622
00623     // if we have a line open, close it.
00624     if (g_hLine)
00625     {
00626         do
00627         {
00628             lReturn = lineClose(g_hLine);
00629             if (HandleLineErr(lReturn))
00630                 continue;
00631             else
00632             {
00633                 OutputDebugLineError(lReturn,
00634                     "lineClose unhandled error: ");
00635                 break;
00636             }
00637         }
00638         while(lReturn != SUCCESS);
00639
00640         OutputDebugString("Line Closed.\n");
00641     }
00642
00643     // Call and Line are taken care of.  Finish cleaning up.
00644
00645     // If there is device configuration information, free the memory.
00646     if (g_lpDeviceConfig)
00647         LocalFree(g_lpDeviceConfig);
00648     g_lpDeviceConfig = NULL;
00649
00650     g_hCall = (HCALL)((ULONG_PTR)NULL);
00651     g_hLine = (HLINE)((ULONG_PTR)NULL);
00652     g_bConnected = FALSE;
00653
00654     g_bTapiInUse = FALSE;
00655     g_bStoppingCall = FALSE; // allow HangupCall to be called again.
00656     OutputDebugString("Call stopped\n");
00657
00658     // Update the user interface.
00659     UpdateStatusBar("Ready to make a call.",1,0);
00660     EnableMakeCall(g_hWndMainWindow, TRUE);
00661
00662     // Need to free LocalAlloc()d buffer returned from I_lineGetCallStatus
00663     if (pLineCallStatus)
00664         LocalFree(pLineCallStatus);
00665
00666     return TRUE;
00667 }
00668
00669
00670 //
00671 //  FUNCTION: PostHangupCall()
00672 //
00673 //  PURPOSE: Posts a message to the main TAPI thread to hangup the call.
00674 //
00675 //  PARAMETERS:
00676 //    none
00677 //
00678 //  RETURN VALUE:
00679 //    none
00680 //
00681 //  COMMENTS:
00682 //
00683 //    TAPI is thread specific, meaning that only the thread that does the
00684 //    lineInitialize can get asynchronous messages through the callback.
00685 //    Since the HangupCall can potentially go into a loop waiting for
00686 //    specific events, any other threads that call HangupCall can cause
00687 //    timing confusion.  Best to just have other threads 'ask' the main thread
00688 //    to hangup the call.
00689 //
00690
00691 void PostHangupCall()
00692 {
00693     PostMessage(g_hWndMainWindow, WM_COMMAND, IDM_HANGUPCALL, 0);
00694 }
00695
00696
00697
00698 //
00699 //  FUNCTION: DialCall()
00700 //
00701 //  PURPOSE: Get a number from the user and dial it.
00702 //
00703 //  PARAMETERS:
00704 //    none
00705 //
00706 //  RETURN VALUE:
00707 //    TRUE if able to get a number, find a line, and dial successfully.
00708 //
00709 //  COMMENTS:
00710 //
00711 //    This function makes several assumptions:
00712 //    - The number dialed will always explicitly come from the user.
00713 //    - There will only be one outgoing address per line.
00714 //
00715
00716 BOOL DialCall()
00717 {
00718     long lReturn;
00719     LPLINEADDRESSSTATUS lpLineAddressStatus = NULL;
00720     LPLINEDEVCAPS lpLineDevCaps = NULL;
00721
00722     if (g_bTapiInUse)
00723     {
00724         OutputDebugString("A call is already being handled\n");
00725         return FALSE;
00726     }
00727
00728     // If TAPI isn't initialized, its either because we couldn't initialize
00729     // at startup (and this might have been corrected by now), or because
00730     // a REINIT event was received.  In either case, try to init now.
00731
00732     if (!g_hLineApp)
00733     {
00734         if (!InitializeTAPI(NULL))
00735             return FALSE;
00736     }
00737
00738     // If there are no line devices installed on the machine, lets give
00739     // the user the opportunity to install one.
00740     if (g_dwNumDevs < 1)
00741     {
00742         if (!HandleNoDevicesInstalled())
00743             return FALSE;
00744     }
00745
00746     // We now have a call active.  Prevent future calls.
00747     g_bTapiInUse = TRUE;
00748     EnableMakeCall(g_hWndMainWindow, FALSE);
00749
00750
00751     // Get a phone number from the user.
00752     // Phone number will be placed in global variables if successful
00753     if (!GetAddressToDial())
00754     {
00755         HangupCall();
00756         goto DeleteBuffers;
00757     }
00758
00759     // Negotiate the API version to use for this device.
00760     g_dwAPIVersion = I_lineNegotiateAPIVersion(g_dwDeviceID);
00761     if (g_dwAPIVersion == 0)
00762     {
00763         MessageBox(g_hDlgParentWindow,
00764             "Line Version unsupported by this Sample",
00765             "Unable to Use Line",MB_OK);
00766         HangupCall();
00767         goto DeleteBuffers;
00768     }
00769
00770     // Need to check the DevCaps to make sure this line is usable.
00771     // The 'Dial' dialog checks also, but better safe than sorry.
00772     lpLineDevCaps = I_lineGetDevCaps(lpLineDevCaps,
00773         g_dwDeviceID, g_dwAPIVersion);
00774     if (lpLineDevCaps == NULL)
00775     {
00776         HangupCall();
00777         MessageBox(g_hDlgParentWindow,
00778             "Error on Requested line",
00779             "Unable to Use Line",MB_OK);
00780         goto DeleteBuffers;
00781     }
00782
00783     if (!(lpLineDevCaps->dwBearerModes & LINEBEARERMODE_VOICE ))
00784     {
00785         HangupCall();
00786         MessageBox(g_hDlgParentWindow,
00787             "Error on Requested line",
00788             "The selected line doesn't support VOICE capabilities",
00789             MB_OK);
00790         goto DeleteBuffers;
00791     }
00792
00793     if (!(lpLineDevCaps->dwMediaModes & LINEMEDIAMODE_DATAMODEM))
00794     {
00795         HangupCall();
00796         MessageBox(g_hDlgParentWindow,
00797             "Error on Requested line",
00798             "The selected line doesn't support DATAMODEM capabilities",
00799             MB_OK);
00800         goto DeleteBuffers;
00801     }
00802
00803     // Does this line have the capability to make calls?
00804     // It is possible that some lines can't make outbound calls.
00805     if (!(lpLineDevCaps->dwLineFeatures & LINEFEATURE_MAKECALL))
00806     {
00807         HangupCall();
00808         MessageBox(g_hDlgParentWindow,
00809             "Error on Requested line",
00810             "The selected line doesn't support MAKECALL capabilities",
00811             MB_OK);
00812         goto DeleteBuffers;
00813     }
00814
00815     // Open the Line for an outgoing DATAMODEM call.
00816     do
00817     {
00818         lReturn = lineOpen(g_hLineApp, g_dwDeviceID, &g_hLine,
00819             g_dwAPIVersion, 0, 0,
00820             LINECALLPRIVILEGE_NONE, LINEMEDIAMODE_DATAMODEM,
00821             0);
00822
00823         if(lReturn == LINEERR_ALLOCATED)
00824         {
00825             HangupCall();
00826             MessageBox(g_hDlgParentWindow,
00827                 "Line is already in use by a non-TAPI application "
00828                 "or by another TAPI Service Provider.",
00829                 "Unable to Use Line",MB_OK);
00830             goto DeleteBuffers;
00831         }
00832
00833         if (HandleLineErr(lReturn))
00834             continue;
00835         else
00836         {
00837             OutputDebugLineError(lReturn, "lineOpen unhandled error: ");
00838             MessageBox(g_hDlgParentWindow,
00839                 "Error on Requested line",
00840                 "Unable to Use Line",MB_OK);
00841             HangupCall();
00842             goto DeleteBuffers;
00843         }
00844     }
00845     while(lReturn != SUCCESS);
00846
00847     // Tell the service provider that we want all notifications that
00848     // have anything to do with this line.
00849     do
00850     {
00851         // Set the messages we are interested in.
00852
00853         // Note that while most applications aren't really interested
00854         // in dealing with all of the possible messages, its interesting
00855         // to see which come through the callback for testing purposes.
00856
00857         lReturn = lineSetStatusMessages(g_hLine,
00858             LINEDEVSTATE_OTHER          |
00859             LINEDEVSTATE_RINGING        |
00860             LINEDEVSTATE_CONNECTED      |  // Important state!
00861             LINEDEVSTATE_DISCONNECTED   |  // Important state!
00862             LINEDEVSTATE_MSGWAITON      |
00863             LINEDEVSTATE_MSGWAITOFF     |
00864             LINEDEVSTATE_INSERVICE      |
00865             LINEDEVSTATE_OUTOFSERVICE   |  // Important state!
00866             LINEDEVSTATE_MAINTENANCE    |  // Important state!
00867             LINEDEVSTATE_OPEN           |
00868             LINEDEVSTATE_CLOSE          |
00869             LINEDEVSTATE_NUMCALLS       |
00870             LINEDEVSTATE_NUMCOMPLETIONS |
00871             LINEDEVSTATE_TERMINALS      |
00872             LINEDEVSTATE_ROAMMODE       |
00873             LINEDEVSTATE_BATTERY        |
00874             LINEDEVSTATE_SIGNAL         |
00875             LINEDEVSTATE_DEVSPECIFIC    |
00876             LINEDEVSTATE_REINIT         |  // Not allowed to disable this.
00877             LINEDEVSTATE_LOCK           |
00878             LINEDEVSTATE_CAPSCHANGE     |
00879             LINEDEVSTATE_CONFIGCHANGE   |
00880             LINEDEVSTATE_COMPLCANCEL    ,
00881
00882             LINEADDRESSSTATE_OTHER      |
00883             LINEADDRESSSTATE_DEVSPECIFIC|
00884             LINEADDRESSSTATE_INUSEZERO  |
00885             LINEADDRESSSTATE_INUSEONE   |
00886             LINEADDRESSSTATE_INUSEMANY  |
00887             LINEADDRESSSTATE_NUMCALLS   |
00888             LINEADDRESSSTATE_FORWARD    |
00889             LINEADDRESSSTATE_TERMINALS  |
00890             LINEADDRESSSTATE_CAPSCHANGE);
00891
00892
00893         if (HandleLineErr(lReturn))
00894             continue;
00895         else
00896         {
00897             // If we do get an unhandled problem, we don't care.
00898             // We just won't get notifications.
00899             OutputDebugLineError(lReturn,
00900                 "lineSetStatusMessages unhandled error: ");
00901             break;
00902         }
00903     }
00904     while(lReturn != SUCCESS);
00905
00906
00907     // Get LineAddressStatus so we can make sure the line
00908     // isn't already in use by a TAPI application.
00909     lpLineAddressStatus =
00910         I_lineGetAddressStatus(lpLineAddressStatus, g_hLine, 0);
00911
00912     if (lpLineAddressStatus == NULL)
00913     {
00914         HangupCall();
00915         MessageBox(g_hDlgParentWindow,
00916             "Error on Requested line",
00917             "Unable to Use Line",MB_OK);
00918         goto DeleteBuffers;
00919     }
00920
00921     // MAKECALL will be set if there are any available call appearances
00922     if ( ! ((lpLineAddressStatus -> dwAddressFeatures) &
00923             LINEADDRFEATURE_MAKECALL) )
00924     {
00925         OutputDebugString("This line is not available to place a call.\n");
00926         HangupCall();
00927         MessageBox(g_hDlgParentWindow,
00928             "Requested line is already in use",
00929             "Unable to Use Line",MB_OK);
00930         goto DeleteBuffers;
00931     }
00932
00933     // If the line was configured in the 'Dial' dialog, then
00934     // we need to actually complete the configuration.
00935     if (g_lpDeviceConfig)
00936         lineSetDevConfig(g_dwDeviceID, g_lpDeviceConfig,
00937             g_dwSizeDeviceConfig, "comm/datamodem");
00938
00939     // Start dialing the number
00940     if (DialCallInParts(lpLineDevCaps, g_szDialableAddress,
00941             g_szDisplayableAddress))
00942     {
00943         OutputDebugString("DialCallInParts succeeded.\n");
00944     }
00945     else
00946     {
00947         OutputDebugString("DialCallInParts failed.\n");
00948         HangupCall();
00949         goto DeleteBuffers;
00950     }
00951
00952 DeleteBuffers:
00953
00954     if (lpLineAddressStatus)
00955         LocalFree(lpLineAddressStatus);
00956     if (lpLineDevCaps)
00957         LocalFree(lpLineDevCaps);
00958     if (g_bTapiInUse)
00959         EnableHangupCall(g_hWndMainWindow, TRUE);
00960
00961     return g_bTapiInUse;
00962 }
00963
00964
00965 //**************************************************
00966 // These APIs are specific to this module
00967 //**************************************************
00968
00969
00970
00971 //
00972 //  FUNCTION: DialCallInParts(LPLINEDEVCAPS, LPCSTR, LPCSTR)
00973 //
00974 //  PURPOSE: Dials the call, handling special characters.
00975 //
00976 //  PARAMETERS:
00977 //    lpLineDevCaps - LINEDEVCAPS for the line to be used.
00978 //    lpszAddress   - Address to Dial.
00979 //    lpszDisplayableAddress - Displayable Address.
00980 //
00981 //  RETURN VALUE:
00982 //    Returns TRUE if we successfully Dial.
00983 //
00984 //  COMMENTS:
00985 //
00986 //    This function dials the Address and handles any
00987 //    special characters in the address that the service provider
00988 //    can't handle.  It requires input from the user to handle
00989 //    these characters; this can cause problems for fully automated
00990 //    dialing.
00991 //
00992 //    Note that we can return TRUE, even if we don't reach a
00993 //    CONNECTED state.  DIalCallInParts returns as soon as the
00994 //    Address is fully dialed or when an error occurs.
00995 //
00996 //
00997
00998 BOOL DialCallInParts(LPLINEDEVCAPS lpLineDevCaps,
00999     LPCSTR lpszAddress, LPCSTR lpszDisplayableAddress)
01000 {
01001     LPLINECALLPARAMS  lpCallParams = NULL;
01002     LPLINEADDRESSCAPS lpAddressCaps = NULL;
01003     LPLINECALLSTATUS  lpLineCallStatus = NULL;
01004
01005     long lReturn;
01006     int i;
01007     DWORD dwDevCapFlags;
01008     char szFilter[1+sizeof(g_sNonDialable)] = "";
01009     BOOL bFirstDial = TRUE;
01010   DWORD dwRemainingLength;
01011
01012     // Variables to handle Dialable Substring dialing.
01013     LPSTR lpDS; // This is just so we can free lpszDialableSubstring later.
01014     LPSTR lpszDialableSubstring;
01015     int nAddressLength = 0;
01016     int nCurrentAddress = 0;
01017     char chUnhandledCharacter;
01018
01019     // Get the capabilities for the line device we're going to use.
01020     lpAddressCaps = I_lineGetAddressCaps(lpAddressCaps,
01021         g_dwDeviceID, 0, g_dwAPIVersion, 0);
01022     if (lpAddressCaps == NULL)
01023         return FALSE;
01024
01025     // Setup our CallParams for DATAMODEM settings.
01026     lpCallParams = CreateCallParams (lpCallParams, lpszDisplayableAddress);
01027     if (lpCallParams == NULL)
01028         return FALSE;
01029
01030     // Determine which special characters the service provider
01031     // does *not* handle so we can handle them manually.
01032     // Keep list of unhandled characters in szFilter.
01033
01034     dwDevCapFlags = lpLineDevCaps -> dwDevCapFlags;  // SP handled characters.
01035     for (i = 0; i < g_sizeofNonDialable ; i++)
01036     {
01037         if ((dwDevCapFlags & g_sNonDialable[i].dwDevCapFlag) == 0)
01038         {
01039       dwRemainingLength = sizeof(g_sNonDialable) - strlen(szFilter);
01040             strncat(szFilter, g_sNonDialable[i].szToken,dwRemainingLength );
01041       szFilter[sizeof(g_sNonDialable)] = '\0';
01042         }
01043     }
01044
01045     // szFilter now contains the set of tokens which delimit dialable substrings
01046
01047     // Setup the strings for substring dialing.
01048
01049     nAddressLength = (int) strlen(lpszAddress);
01050     lpDS = lpszDialableSubstring = (LPSTR) LocalAlloc(LPTR, nAddressLength + 1);
01051     if (lpszDialableSubstring == NULL)
01052     {
01053         OutputDebugLastError(GetLastError(), "LocalAlloc failed: ");
01054         HandleNoMem();
01055         goto errExit;
01056     }
01057
01058     // Lets start dialing substrings!
01059     while (nCurrentAddress < nAddressLength)
01060     {
01061   retryAfterError:
01062
01063         // Find the next undialable character
01064         i = (int) strcspn(&lpszAddress[nCurrentAddress], szFilter);
01065
01066         // Was there one before the end of the Address string?
01067         if (i + nCurrentAddress < nAddressLength)
01068         {
01069             // Make sure this device can handle partial dial.
01070             if (! (lpAddressCaps -> dwAddrCapFlags &
01071                    LINEADDRCAPFLAGS_PARTIALDIAL))
01072             {
01073                 MessageBox(g_hDlgParentWindow,
01074                     "This line doesn't support partial dialing.\n",
01075                     "Warning",MB_OK);
01076                 goto errExit;
01077             }
01078             // Remember what the unhandled character is so we can handle it.
01079             chUnhandledCharacter = lpszAddress[nCurrentAddress+i];
01080
01081             // Copy the dialable string to the Substring.
01082             memcpy(lpszDialableSubstring, &lpszAddress[nCurrentAddress], i);
01083
01084             // Terminate the substring with a ';' to signify the partial dial.
01085             lpszDialableSubstring[i] = ';';
01086             lpszDialableSubstring[i+1] = '\0';
01087
01088             // Increment the address for next iteration.
01089             nCurrentAddress += i + 1;
01090         }
01091         else // No more partial dials.  Dial the rest of the Address.
01092         {
01093             lpszDialableSubstring = (LPSTR) &lpszAddress[nCurrentAddress];
01094             chUnhandledCharacter = 0;
01095             nCurrentAddress = nAddressLength;
01096         }
01097
01098         do
01099         {
01100             if (bFirstDial)
01101                 lReturn = WaitForReply(
01102                     lineMakeCall(g_hLine, &g_hCall, lpszDialableSubstring,
01103                         0, lpCallParams) );
01104             else
01105                 lReturn = WaitForReply(
01106                     lineDial(g_hCall, lpszDialableSubstring, 0) );
01107
01108             switch(lReturn)
01109             {
01110                 // We should not have received these errors because of the
01111                 // prefiltering strategy, but there may be some ill-behaved
01112                 // service providers which do not correctly set their
01113                 // devcapflags.  Add the character corresponding to the error
01114                 // to the filter set and retry dialing.
01115                 //
01116                 case LINEERR_DIALBILLING:
01117                 case LINEERR_DIALDIALTONE:
01118                 case LINEERR_DIALQUIET:
01119                 case LINEERR_DIALPROMPT:
01120                 {
01121                     OutputDebugString("Service Provider incorrectly sets dwDevCapFlags\n");
01122
01123                     for (i = 0; i < g_sizeofNonDialable; i++)
01124                         if (lReturn == g_sNonDialable[i].lError)
01125                         {
01126                            dwRemainingLength = sizeof(g_sNonDialable) - strlen(szFilter);
01127               strncat(szFilter, g_sNonDialable[i].szToken,dwRemainingLength);
01128               szFilter[sizeof(g_sNonDialable)] = '\0';
01129                         }
01130
01131                     goto retryAfterError;
01132                 }
01133
01134                 case WAITERR_WAITABORTED:
01135                     OutputDebugString("While Dialing, WaitForReply aborted.\n");
01136                     goto errExit;
01137
01138             }
01139
01140             if (HandleLineErr(lReturn))
01141                 continue;
01142             else
01143             {
01144                 if (bFirstDial)
01145                     OutputDebugLineError(lReturn, "lineMakeCall unhandled error: ");
01146                 else
01147                     OutputDebugLineError(lReturn, "lineDial unhandled error: ");
01148
01149                 goto errExit;
01150             }
01151
01152         }
01153         while (lReturn != SUCCESS);
01154
01155         bFirstDial = FALSE;
01156
01157         // The dial was successful; now handle characters the service
01158         // provider didn't (if any).
01159         if (chUnhandledCharacter)
01160         {
01161             LPSTR lpMsg = "";
01162
01163             // First, wait until we know we can continue dialing.  While the
01164             // last string is still pending to be dialed, we can't dial another.
01165
01166             while(TRUE)
01167             {
01168
01169                 lpLineCallStatus = I_lineGetCallStatus(lpLineCallStatus, g_hCall);
01170                 if (lpLineCallStatus == NULL)
01171                     goto errExit;
01172
01173                 // Does CallStatus say we can dial now?
01174                 if ((lpLineCallStatus->dwCallFeatures) & LINECALLFEATURE_DIAL)
01175                 {
01176                     OutputDebugString("Ok to continue dialing.\n");
01177                     break;
01178                 }
01179
01180                 // We can't dial yet, so wait for a CALLSTATE message
01181                 OutputDebugString("Waiting for dialing to be enabled.\n");
01182
01183                 if (WaitForCallState(I_LINECALLSTATE_ANY) != SUCCESS)
01184                     goto errExit;
01185             }
01186
01187             for (i = 0; i < g_sizeofNonDialable; i++)
01188                 if (chUnhandledCharacter == g_sNonDialable[i].szToken[0])
01189                     lpMsg = g_sNonDialable[i].szMsg;
01190
01191             MessageBox(g_hDlgParentWindow, lpMsg, "Dialing Paused", MB_OK);
01192         }
01193
01194     } // continue dialing until we dial all Dialable Substrings.
01195
01196     LocalFree(lpCallParams);
01197     LocalFree(lpDS);
01198     LocalFree(lpAddressCaps);
01199     if (lpLineCallStatus)
01200         LocalFree(lpLineCallStatus);
01201
01202     return TRUE;
01203
01204   errExit:
01205         // if lineMakeCall has already been successfully called, there's a call in progress.
01206         // let the invoking routine shut down the call.
01207         // if the invoker did not clean up the call, it should be done here.
01208
01209     if (lpLineCallStatus)
01210         LocalFree(lpLineCallStatus);
01211     if (lpDS)
01212         LocalFree(lpDS);
01213     if (lpCallParams)
01214         LocalFree(lpCallParams);
01215     if (lpAddressCaps)
01216         LocalFree(lpAddressCaps);
01217
01218     return FALSE;
01219 }
01220
01221
01222 //
01223 //  FUNCTION: CreateCallParams(LPLINECALLPARAMS, LPCSTR)
01224 //
01225 //  PURPOSE: Allocates and fills a LINECALLPARAMS structure
01226 //
01227 //  PARAMETERS:
01228 //    lpCallParams -
01229 //    lpszDisplayableAddress -
01230 //
01231 //  RETURN VALUE:
01232 //    Returns a LPLINECALLPARAMS ready to use for dialing DATAMODEM calls.
01233 //    Returns NULL if unable to allocate the structure.
01234 //
01235 //  COMMENTS:
01236 //
01237 //    If a non-NULL lpCallParams is passed in, it must have been allocated
01238 //    with LocalAlloc, and can potentially be freed and reallocated.  It must
01239 //    also have the dwTotalSize field correctly set.
01240 //
01241 //
01242
01243 LPLINECALLPARAMS CreateCallParams (
01244     LPLINECALLPARAMS lpCallParams, LPCSTR lpszDisplayableAddress)
01245 {
01246     size_t sizeDisplayableAddress;
01247   DWORD dwRemainingLength;
01248
01249     if (lpszDisplayableAddress == NULL)
01250         lpszDisplayableAddress = "";
01251
01252     sizeDisplayableAddress = strlen(lpszDisplayableAddress) + 1;
01253
01254     lpCallParams = (LPLINECALLPARAMS) CheckAndReAllocBuffer(
01255         (LPVOID) lpCallParams,
01256         sizeof(LINECALLPARAMS) + sizeDisplayableAddress,
01257         "CreateCallParams: ");
01258
01259     if (lpCallParams == NULL)
01260         return NULL;
01261
01262     // This is where we configure the line for DATAMODEM usage.
01263     lpCallParams -> dwBearerMode = LINEBEARERMODE_VOICE;
01264     lpCallParams -> dwMediaMode  = LINEMEDIAMODE_DATAMODEM;
01265
01266     // This specifies that we want to use only IDLE calls and
01267     // don't want to cut into a call that might not be IDLE (ie, in use).
01268     lpCallParams -> dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
01269
01270     // if there are multiple addresses on line, use first anyway.
01271     // It will take a more complex application than a simple tty app
01272     // to use multiple addresses on a line anyway.
01273     lpCallParams -> dwAddressMode = LINEADDRESSMODE_ADDRESSID;
01274     lpCallParams -> dwAddressID = 0;
01275
01276     // Since we don't know where we originated, leave these blank.
01277     lpCallParams -> dwOrigAddressSize = 0;
01278     lpCallParams -> dwOrigAddressOffset = 0;
01279
01280     // Unimodem ignores these values.
01281     (lpCallParams -> DialParams) . dwDialSpeed = 0;
01282     (lpCallParams -> DialParams) . dwDigitDuration = 0;
01283     (lpCallParams -> DialParams) . dwDialPause = 0;
01284     (lpCallParams -> DialParams) . dwWaitForDialtone = 0;
01285
01286     // Address we are dialing.
01287     lpCallParams -> dwDisplayableAddressOffset = sizeof(LINECALLPARAMS);
01288     lpCallParams -> dwDisplayableAddressSize = (DWORD) sizeDisplayableAddress;
01289   dwRemainingLength = lpCallParams -> dwTotalSize - sizeof(LINECALLPARAMS);
01290     strncpy((LPSTR)lpCallParams + sizeof(LINECALLPARAMS),
01291            lpszDisplayableAddress, dwRemainingLength);
01292   *((LPSTR)lpCallParams + sizeof(LINECALLPARAMS) + (DWORD) sizeDisplayableAddress -1) = '\0';
01293
01294     return lpCallParams;
01295 }
01296
01297
01298 //
01299 //  FUNCTION: long WaitForReply(long)
01300 //
01301 //  PURPOSE: Resynchronize by waiting for a LINE_REPLY
01302 //
01303 //  PARAMETERS:
01304 //    lRequestID - The asynchronous request ID that we're
01305 //                 on a LINE_REPLY for.
01306 //
01307 //  RETURN VALUE:
01308 //    - 0 if LINE_REPLY responded with a success.
01309 //    - LINEERR constant if LINE_REPLY responded with a LINEERR
01310 //    - 1 if the line was shut down before LINE_REPLY is received.
01311 //
01312 //  COMMENTS:
01313 //
01314 //    This function allows us to resynchronize an asynchronous
01315 //    TAPI line call by waiting for the LINE_REPLY message.  It
01316 //    waits until a LINE_REPLY is received or the line is shut down.
01317 //
01318 //    Note that this could cause re-entrancy problems as
01319 //    well as mess with any message preprocessing that might
01320 //    occur on this thread (such as TranslateAccelerator).
01321 //
01322 //    This function should to be called from the thread that did
01323 //    lineInitialize, or the PeekMessage is on the wrong thread
01324 //    and the synchronization is not guaranteed to work.  Also note
01325 //    that if another PeekMessage loop is entered while waiting,
01326 //    this could also cause synchronization problems.
01327 //
01328 //    One more note.  This function can potentially be re-entered
01329 //    if the call is dropped for any reason while waiting.  If this
01330 //    happens, just drop out and assume the wait has been canceled.
01331 //    This is signaled by setting bReentered to FALSE when the function
01332 //    is entered and TRUE when it is left.  If bReentered is ever TRUE
01333 //    during the function, then the function was re-entered.
01334 //
01335 //    This function times out and returns WAITERR_WAITTIMEDOUT
01336 //    after WAITTIMEOUT milliseconds have elapsed.
01337 //
01338 //
01339
01340
01341 long WaitForReply (long lRequestID)
01342 {
01343     static BOOL bReentered;
01344     bReentered = FALSE;
01345
01346     if (lRequestID > SUCCESS)
01347     {
01348         MSG msg;
01349         DWORD dwTimeStarted;
01350
01351         g_bReplyRecieved = FALSE;
01352         g_dwRequestedID = (DWORD) lRequestID;
01353
01354         // Initializing this just in case there is a bug
01355         // that sets g_bReplyRecieved without setting the reply value.
01356         g_lAsyncReply = LINEERR_OPERATIONFAILED;
01357
01358         dwTimeStarted = GetTickCount();
01359
01360         while(!g_bReplyRecieved)
01361         {
01362             if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
01363             {
01364                 TranslateMessage(&msg);
01365                 DispatchMessage(&msg);
01366             }
01367
01368             // This should only occur if the line is shut down while waiting.
01369             if (!g_bTapiInUse || bReentered)
01370             {
01371                 bReentered = TRUE;
01372                 return WAITERR_WAITABORTED;
01373             }
01374
01375             // Its a really bad idea to timeout a wait for a LINE_REPLY.
01376             // If we are execting a LINE_REPLY, we should wait till we get
01377             // it; it might take a long time to dial (for example).
01378
01379             // If 5 seconds go by without a reply, it might be a good idea
01380             // to display a dialog box to tell the user that a
01381             // wait is in progress and to give the user the capability to
01382             // abort the wait.
01383         }
01384
01385         bReentered = TRUE;
01386         return g_lAsyncReply;
01387     }
01388
01389     bReentered = TRUE;
01390     return lRequestID;
01391 }
01392
01393
01394 //
01395 //  FUNCTION: long WaitForCallState(DWORD)
01396 //
01397 //  PURPOSE: Wait for the line to reach a specific CallState.
01398 //
01399 //  PARAMETERS:
01400 //    dwDesiredCallState - specific CallState to wait for.
01401 //
01402 //  RETURN VALUE:
01403 //    Returns 0 (SUCCESS) when we reach the Desired CallState.
01404 //    Returns WAITERR_WAITTIMEDOUT if timed out.
01405 //    Returns WAITERR_WAITABORTED if call was closed while waiting.
01406 //
01407 //  COMMENTS:
01408 //
01409 //    This function allows us to synchronously wait for a line
01410 //    to reach a specific LINESTATE or until the line is shut down.
01411 //
01412 //    Note that this could cause re-entrancy problems as
01413 //    well as mess with any message preprocessing that might
01414 //    occur on this thread (such as TranslateAccelerator).
01415 //
01416 //    One more note.  This function can potentially be re-entered
01417 //    if the call is dropped for any reason while waiting.  If this
01418 //    happens, just drop out and assume the wait has been canceled.
01419 //    This is signaled by setting bReentered to FALSE when the function
01420 //    is entered and TRUE when it is left.  If bReentered is ever TRUE
01421 //    during the function, then the function was re-entered.
01422 //
01423 //    This function should to be called from the thread that did
01424 //    lineInitialize, or the PeekMessage is on the wrong thread
01425 //    and the synchronization is not guaranteed to work.  Also note
01426 //    that if another PeekMessage loop is entered while waiting,
01427 //    this could also cause synchronization problems.
01428 //
01429 //    If the constant value I_LINECALLSTATE_ANY is used for the
01430 //    dwDesiredCallState, then WaitForCallState will return SUCCESS
01431 //    upon receiving any CALLSTATE messages.
01432 //
01433 //
01434 //
01435
01436 long WaitForCallState(DWORD dwDesiredCallState)
01437 {
01438     MSG msg;
01439     DWORD dwTimeStarted;
01440     static BOOL bReentered;
01441
01442     bReentered = FALSE;
01443
01444     dwTimeStarted = GetTickCount();
01445
01446     g_bCallStateReceived = FALSE;
01447
01448     while ((dwDesiredCallState == I_LINECALLSTATE_ANY) ||
01449            (g_dwCallState != dwDesiredCallState))
01450     {
01451         if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
01452         {
01453             TranslateMessage(&msg);
01454             DispatchMessage(&msg);
01455         }
01456
01457         // If we are waiting for any call state and get one, succeed.
01458         if ((dwDesiredCallState == I_LINECALLSTATE_ANY) &&
01459             g_bCallStateReceived)
01460         {
01461             break;
01462         }
01463
01464         // This should only occur if the line is shut down while waiting.
01465         if (!g_bTapiInUse || bReentered)
01466         {
01467             bReentered = TRUE;
01468             OutputDebugString("WAITABORTED\n");
01469             return WAITERR_WAITABORTED;
01470         }
01471
01472         // If we don't get the reply in a reasonable time, we time out.
01473         if (GetTickCount() - dwTimeStarted > WAITTIMEOUT)
01474         {
01475             bReentered = TRUE;
01476             OutputDebugString("WAITTIMEDOUT\n");
01477             return WAITERR_WAITTIMEDOUT;
01478         }
01479
01480     }
01481
01482     bReentered = TRUE;
01483     return SUCCESS;
01484 }
01485
01486 //**************************************************
01487 // lineCallback Function and Handlers.
01488 //**************************************************
01489
01490
01491 //
01492 //  FUNCTION: lineCallbackFunc(..)
01493 //
01494 //  PURPOSE: Receive asynchronous TAPI events
01495 //
01496 //  PARAMETERS:
01497 //    dwDevice  - Device associated with the event, if any
01498 //    dwMsg     - TAPI event that occurred.
01499 //    dwCallbackInstance - User defined data supplied when opening the line.
01500 //    dwParam1  - dwMsg specific information
01501 //    dwParam2  - dwMsg specific information
01502 //    dwParam3  - dwMsg specific information
01503 //
01504 //  RETURN VALUE:
01505 //    none
01506 //
01507 //  COMMENTS:
01508 //    This is the function where all asynchronous events will come.
01509 //    Almost all events will be specific to an open line, but a few
01510 //    will be general TAPI events (such as LINE_REINIT).
01511 //
01512 //    Its important to note that this callback will *ALWAYS* be
01513 //    called in the context of the thread that does the lineInitialize.
01514 //    Even if another thread (such as the COMM threads) calls the API
01515 //    that would result in the callback being called, it will be called
01516 //    in the context of the main thread (since in this sample, the main
01517 //    thread does the lineInitialize).
01518 //
01519 //
01520
01521
01522 void CALLBACK lineCallbackFunc(
01523     DWORD dwDevice, DWORD dwMsg, DWORD dwCallbackInstance,
01524     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
01525 {
01526
01527     OutputDebugLineCallback(
01528         dwDevice, dwMsg, dwCallbackInstance,
01529         dwParam1, dwParam2, dwParam3);
01530
01531     // All we do is dispatch the dwMsg to the correct handler.
01532     switch(dwMsg)
01533     {
01534         case LINE_CALLSTATE:
01535             DoLineCallState(dwDevice, dwMsg, dwCallbackInstance,
01536                 dwParam1, dwParam2, dwParam3);
01537             break;
01538
01539         case LINE_CLOSE:
01540             DoLineClose(dwDevice, dwMsg, dwCallbackInstance,
01541                 dwParam1, dwParam2, dwParam3);
01542             break;
01543
01544         case LINE_LINEDEVSTATE:
01545             DoLineDevState(dwDevice, dwMsg, dwCallbackInstance,
01546                 dwParam1, dwParam2, dwParam3);
01547             break;
01548
01549         case LINE_REPLY:
01550             DoLineReply(dwDevice, dwMsg, dwCallbackInstance,
01551                 dwParam1, dwParam2, dwParam3);
01552             break;
01553
01554         case LINE_CREATE:
01555             DoLineCreate(dwDevice, dwMsg, dwCallbackInstance,
01556                 dwParam1, dwParam2, dwParam3);
01557             break;
01558
01559         default:
01560             OutputDebugString("lineCallbackFunc message ignored\n");
01561             break;
01562
01563     }
01564
01565     return;
01566
01567 }
01568
01569
01570 //
01571 //  FUNCTION: DoLineReply(..)
01572 //
01573 //  PURPOSE: Handle LINE_REPLY asynchronous messages.
01574 //
01575 //  PARAMETERS:
01576 //    dwDevice  - Line Handle associated with this LINE_REPLY.
01577 //    dwMsg     - Should always be LINE_REPLY.
01578 //    dwCallbackInstance - Unused by this sample.
01579 //    dwParam1  - Asynchronous request ID.
01580 //    dwParam2  - success or LINEERR error value.
01581 //    dwParam3  - Unused.
01582 //
01583 //  RETURN VALUE:
01584 //    none
01585 //
01586 //  COMMENTS:
01587 //
01588 //    All line API calls that return an asynchronous request ID
01589 //    will eventually cause a LINE_REPLY message.  Handle it.
01590 //
01591 //    This sample assumes only one call at time, and that we wait
01592 //    for a LINE_REPLY before making any other line API calls.
01593 //
01594 //    The only exception to the above is that we might shut down
01595 //    the line before receiving a LINE_REPLY.
01596 //
01597 //
01598
01599 void DoLineReply(
01600     DWORD dwDevice, DWORD dwMessage, DWORD dwCallbackInstance,
01601     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
01602 {
01603     if ((long) dwParam2 != SUCCESS)
01604         OutputDebugLineError((long) dwParam2, "LINE_REPLY error: ");
01605     else
01606         OutputDebugString("LINE_REPLY: successfully replied.\n");
01607
01608     // If we are currently waiting for this async Request ID
01609     // then set the global variables to acknowledge it.
01610     if (g_dwRequestedID == dwParam1)
01611     {
01612         g_bReplyRecieved = TRUE;
01613         g_lAsyncReply = (long) dwParam2;
01614     }
01615 }
01616
01617
01618 //
01619 //  FUNCTION: DoLineClose(..)
01620 //
01621 //  PURPOSE: Handle LINE_CLOSE asynchronous messages.
01622 //
01623 //  PARAMETERS:
01624 //    dwDevice  - Line Handle that was closed.
01625 //    dwMsg     - Should always be LINE_CLOSE.
01626 //    dwCallbackInstance - Unused by this sample.
01627 //    dwParam1  - Unused.
01628 //    dwParam2  - Unused.
01629 //    dwParam3  - Unused.
01630 //
01631 //  RETURN VALUE:
01632 //    none
01633 //
01634 //  COMMENTS:
01635 //
01636 //    This message is sent when something outside our app shuts
01637 //    down a line in use.
01638 //
01639 //    The hLine (and any hCall on this line) are no longer valid.
01640 //
01641 //
01642
01643 void DoLineClose(
01644     DWORD dwDevice, DWORD dwMessage, DWORD dwCallbackInstance,
01645     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
01646 {
01647     // Line has been shut down.  Clean up our internal variables.
01648     g_hLine = (HLINE)((ULONG_PTR)NULL);
01649     g_hCall = (HCALL)((ULONG_PTR)NULL);
01650     UpdateStatusBar("Call was shut down.",1,0);
01651     MessageBox(g_hDlgParentWindow,
01652         "Call was shut down.","Warning",MB_OK);
01653     HangupCall();
01654 }
01655
01656
01657 //
01658 //  FUNCTION: DoLineDevState(..)
01659 //
01660 //  PURPOSE: Handle LINE_LINEDEVSTATE asynchronous messages.
01661 //
01662 //  PARAMETERS:
01663 //    dwDevice  - Line Handle that was closed.
01664 //    dwMsg     - Should always be LINE_LINEDEVSTATE.
01665 //    dwCallbackInstance - Unused by this sample.
01666 //    dwParam1  - LINEDEVSTATE constant.
01667 //    dwParam2  - Depends on dwParam1.
01668 //    dwParam3  - Depends on dwParam1.
01669 //
01670 //  RETURN VALUE:
01671 //    none
01672 //
01673 //  COMMENTS:
01674 //
01675 //    The LINE_LINEDEVSTATE message is received if the state of the line
01676 //    changes.  Examples are RINGING, MAINTENANCE, MSGWAITON.  Very few of
01677 //    these are relevant to this sample.
01678 //
01679 //    Assuming that any LINEDEVSTATE that removes the line from use by TAPI
01680 //    will also send a LINE_CLOSE message.
01681 //
01682 //
01683
01684 void DoLineDevState(
01685     DWORD dwDevice, DWORD dwMessage, DWORD dwCallbackInstance,
01686     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
01687 {
01688     switch(dwParam1)
01689     {
01690         case LINEDEVSTATE_RINGING:
01691             UpdateStatusBar("Line Ringing",1,0);
01692             OutputDebugString("Line Ringing.\n");
01693             break;
01694
01695         case LINEDEVSTATE_REINIT:
01696         // This is an important case!  Usually means that a service provider
01697         // has changed in such a way that requires TAPI to REINIT.
01698         // Note that there are both 'soft' REINITs and 'hard' REINITs.
01699         // Soft REINITs don't actually require a full shutdown but is instead
01700         // just an informational change that historically required a REINIT
01701         // to force the application to deal with.  TAPI API Version 1.3 apps
01702         // will still need to do a full REINIT for both hard and soft REINITs.
01703
01704             switch(dwParam2)
01705             {
01706                 // This is the hard REINIT.  No reason given, just REINIT.
01707                 // TAPI is waiting for everyone to shutdown.
01708                 // Our response is to immediately shutdown any calls,
01709                 // shutdown our use of TAPI and notify the user.
01710                 case 0:
01711                     ShutdownTAPI();
01712                     WarningBox("Tapi line configuration has changed.");
01713                     break;
01714
01715                 case LINE_CREATE:
01716                     OutputDebugString("Soft REINIT: LINE_CREATE.\n");
01717                     DoLineCreate(dwDevice, dwParam2, dwCallbackInstance,
01718                         dwParam3, 0, 0);
01719                     break;
01720
01721                 case LINE_LINEDEVSTATE:
01722                     OutputDebugString("Soft REINIT: LINE_LINEDEVSTATE.\n");
01723                     DoLineDevState(dwDevice, dwParam2, dwCallbackInstance,
01724                         dwParam3, 0, 0);
01725                     break;
01726
01727                 // There might be other reasons to send a soft reinit.
01728                 // No need to to shutdown for these.
01729                 default:
01730                     OutputDebugString("Ignoring soft REINIT\n");
01731                     break;
01732             }
01733             break;
01734
01735         case LINEDEVSTATE_OUTOFSERVICE:
01736             WarningBox("Line selected is now Out of Service.");
01737             HangupCall();
01738             break;
01739
01740         case LINEDEVSTATE_DISCONNECTED:
01741             WarningBox("Line selected is now disconnected.");
01742             HangupCall();
01743             break;
01744
01745         case LINEDEVSTATE_MAINTENANCE:
01746             WarningBox("Line selected is now out for maintenance.");
01747             HangupCall();
01748             break;
01749
01750         case LINEDEVSTATE_TRANSLATECHANGE:
01751             if (g_hDialog)
01752                 PostMessage(g_hDialog, WM_COMMAND, IDC_CONFIGURATIONCHANGED, 0);
01753             break;
01754
01755         case LINEDEVSTATE_REMOVED:
01756             OutputDebugString("A Line device has been removed;"
01757                 " no action taken.\n");
01758             break;
01759
01760         default:
01761             OutputDebugString("Unhandled LINEDEVSTATE message\n");
01762     }
01763 }
01764
01765
01766 //
01767 //  FUNCTION: DoLineCreate(..)
01768 //
01769 //  PURPOSE: Handle LINE_LINECREATE asynchronous messages.
01770 //
01771 //  PARAMETERS:
01772 //    dwDevice  - Unused.
01773 //    dwMsg     - Should always be LINE_CREATE.
01774 //    dwCallbackInstance - Unused.
01775 //    dwParam1  - dwDeviceID of new Line created.
01776 //    dwParam2  - Unused.
01777 //    dwParam3  - Unused.
01778 //
01779 //  RETURN VALUE:
01780 //    none
01781 //
01782 //  COMMENTS:
01783 //
01784 //    This message is new for Windows 95.  It is sent when a new line is
01785 //    added to the system.  This allows us to handle new lines without having
01786 //    to REINIT.  This allows for much more graceful Plug and Play.
01787 //
01788 //    This sample just changes the number of devices available and can use
01789 //    it next time a call is made.  It also tells the "Dial" dialog.
01790 //
01791 //
01792
01793 void DoLineCreate(
01794     DWORD dwDevice, DWORD dwMessage, DWORD dwCallbackInstance,
01795     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
01796 {
01797     // dwParam1 is the Device ID of the new line.
01798     // Add one to get the number of total devices.
01799     if (g_dwNumDevs <= dwParam1)
01800         g_dwNumDevs = dwParam1+1;
01801     if (g_hDialog)
01802         PostMessage(g_hDialog, WM_COMMAND, IDC_LINECREATE, 0);
01803
01804 }
01805
01806
01807 //
01808 //  FUNCTION: DoLineCallState(..)
01809 //
01810 //  PURPOSE: Handle LINE_CALLSTATE asynchronous messages.
01811 //
01812 //  PARAMETERS:
01813 //    dwDevice  - Handle to Call who's state is changing.
01814 //    dwMsg     - Should always be LINE_CALLSTATE.
01815 //    dwCallbackInstance - Unused by this sample.
01816 //    dwParam1  - LINECALLSTATE constant specifying state change.
01817 //    dwParam2  - Specific to dwParam1.
01818 //    dwParam3  - LINECALLPRIVILEGE change, if any.
01819 //
01820 //  RETURN VALUE:
01821 //    none
01822 //
01823 //  COMMENTS:
01824 //
01825 //    This message is received whenever a call changes state.  Lots of
01826 //    things we do, ranging from notifying the user to closing the line
01827 //    to actually connecting to the target of our phone call.
01828 //
01829 //    What we do is usually obvious based on the call state change.
01830 //
01831
01832 void DoLineCallState(
01833     DWORD dwDevice, DWORD dwMessage, DWORD dwCallbackInstance,
01834     DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
01835 {
01836
01837     // Error if this CALLSTATE doesn't apply to our call in progress.
01838     if ((HCALL) dwDevice != g_hCall)
01839     {
01840         OutputDebugPrintf("LINE_CALLSTATE: Unknown device ID '0x%lx'.",
01841             dwDevice);
01842         return;
01843     }
01844
01845     // This sets the global g_dwCallState variable so if we are waiting
01846     // for a specific call state change, we will know when it happens.
01847     g_dwCallState = dwParam1;
01848     g_bCallStateReceived = TRUE;
01849
01850     // dwParam3 contains changes to LINECALLPRIVILEGE, if there are any.
01851     switch (dwParam3)
01852     {
01853         case 0:
01854             break; // no change to call state
01855
01856          // close line if we are made monitor.  Shouldn't happen!
01857          case LINECALLPRIVILEGE_MONITOR:
01858             OutputDebugString("line given monitor privilege; closing\n");
01859             HangupCall();
01860             return;
01861
01862          // close line if we are made owner.  Shouldn't happen!
01863         case LINECALLPRIVILEGE_OWNER:
01864             OutputDebugString("line given owner privilege; closing\n");
01865             HangupCall();
01866             break;
01867
01868         default: // Shouldn't happen!  All cases handled.
01869             OutputDebugString("Unknown LINECALLPRIVILEGE message: closing\n");
01870             HangupCall();
01871             return;
01872     }
01873
01874     // dwParam1 is the specific CALLSTATE change that is occurring.
01875     switch (dwParam1)
01876     {
01877         case LINECALLSTATE_DIALTONE:
01878             UpdateStatusBar("Dial Tone",1,0);
01879             OutputDebugString("Dial Tone\n");
01880             break;
01881
01882         case LINECALLSTATE_DIALING:
01883             UpdateStatusBar("Dialing Call",1,0);
01884             OutputDebugString("Dialing\n");
01885             break;
01886
01887         case LINECALLSTATE_PROCEEDING:
01888             UpdateStatusBar("Call is Proceeding",1,0);
01889             OutputDebugString("Proceeding\n");
01890             break;
01891
01892         case LINECALLSTATE_RINGBACK:
01893             UpdateStatusBar("RingBack",1,0);
01894             OutputDebugString("RingBack\n");
01895             break;
01896
01897         case LINECALLSTATE_BUSY:
01898             UpdateStatusBar("Line is busy",1,0);
01899             OutputDebugString("Line busy, shutting down\n");
01900             HangupCall();
01901             break;
01902
01903         case LINECALLSTATE_IDLE:
01904             UpdateStatusBar("Line is idle",1,0);
01905             OutputDebugString("Line idle\n");
01906             HangupCall();
01907             break;
01908
01909         case LINECALLSTATE_SPECIALINFO:
01910             UpdateStatusBar(
01911                 "Special Info, probably couldn't dial number",1,0);
01912             OutputDebugString(
01913                 "Special Info, probably couldn't dial number\n");
01914             HangupCall();
01915             break;
01916
01917         case LINECALLSTATE_DISCONNECTED:
01918         {
01919             LPSTR pszReasonDisconnected;
01920
01921             switch (dwParam2)
01922             {
01923                 case LINEDISCONNECTMODE_NORMAL:
01924                     pszReasonDisconnected = "Remote Party Disconnected";
01925                     break;
01926
01927                 case LINEDISCONNECTMODE_UNKNOWN:
01928                     pszReasonDisconnected = "Disconnected: Unknown reason";
01929                     break;
01930
01931                 case LINEDISCONNECTMODE_REJECT:
01932                     pszReasonDisconnected = "Remote Party rejected call";
01933                     break;
01934
01935                 case LINEDISCONNECTMODE_PICKUP:
01936                     pszReasonDisconnected =
01937                         "Disconnected: Local phone picked up";
01938                     break;
01939
01940                 case LINEDISCONNECTMODE_FORWARDED:
01941                     pszReasonDisconnected = "Disconnected: Forwarded";
01942                     break;
01943
01944                 case LINEDISCONNECTMODE_BUSY:
01945                     pszReasonDisconnected = "Disconnected: Busy";
01946                     break;
01947
01948                 case LINEDISCONNECTMODE_NOANSWER:
01949                     pszReasonDisconnected = "Disconnected: No Answer";
01950                     break;
01951
01952                 case LINEDISCONNECTMODE_BADADDRESS:
01953                     pszReasonDisconnected = "Disconnected: Bad Address";
01954                     break;
01955
01956                 case LINEDISCONNECTMODE_UNREACHABLE:
01957                     pszReasonDisconnected = "Disconnected: Unreachable";
01958                     break;
01959
01960                 case LINEDISCONNECTMODE_CONGESTION:
01961                     pszReasonDisconnected = "Disconnected: Congestion";
01962                     break;
01963
01964                 case LINEDISCONNECTMODE_INCOMPATIBLE:
01965                     pszReasonDisconnected = "Disconnected: Incompatible";
01966                     break;
01967
01968                 case LINEDISCONNECTMODE_UNAVAIL:
01969                     pszReasonDisconnected = "Disconnected: Unavail";
01970                     break;
01971
01972                 case LINEDISCONNECTMODE_NODIALTONE:
01973                     pszReasonDisconnected = "Disconnected: No Dial Tone";
01974                     break;
01975
01976                 default:
01977                     pszReasonDisconnected =
01978                         "Disconnected: LINECALLSTATE; Bad Reason";
01979                     break;
01980
01981             }
01982
01983             UpdateStatusBar(pszReasonDisconnected,1,0);
01984             OutputDebugString(pszReasonDisconnected);
01985             OutputDebugString("\n");
01986             HangupCall();
01987             break;
01988         }
01989
01990
01991         case LINECALLSTATE_CONNECTED:  // CONNECTED!!!
01992         {
01993             LPVARSTRING lpVarString = NULL;
01994             DWORD dwSizeofVarString = sizeof(VARSTRING) + 1024;
01995             HANDLE hCommFile = NULL;
01996             long lReturn;
01997
01998             // Very first, make sure this isn't a duplicated message.
01999             // A CALLSTATE message can be sent whenever there is a
02000             // change to the capabilities of a line, meaning that it is
02001             // possible to receive multiple CONNECTED messages per call.
02002             // The CONNECTED CALLSTATE message is the only one in TapiComm
02003             // where it would cause problems if it where sent more
02004             // than once.
02005
02006             if (g_bConnected)
02007                 break;
02008
02009             g_bConnected = TRUE;
02010
02011             // Get the handle to the comm port from the driver so we can start
02012             // communicating.  This is returned in a LPVARSTRING structure.
02013             do
02014             {
02015                 // Allocate the VARSTRING structure
02016                 lpVarString = CheckAndReAllocBuffer((LPVOID) lpVarString,
02017                     dwSizeofVarString,"lineGetID: ");
02018
02019                 if (lpVarString == NULL)
02020                     goto ErrorConnecting;
02021
02022                 // Fill the VARSTRING structure
02023                 lReturn = lineGetID(0, 0, g_hCall, LINECALLSELECT_CALL,
02024                     lpVarString, "comm/datamodem");
02025
02026                 if (HandleLineErr(lReturn))
02027                     ; // Still need to check if structure was big enough.
02028                 else
02029                 {
02030                     OutputDebugLineError(lReturn,
02031                         "lineGetID unhandled error: ");
02032                     goto ErrorConnecting;
02033                 }
02034
02035                 // If the VARSTRING wasn't big enough, loop again.
02036                 if ((lpVarString -> dwNeededSize) > (lpVarString -> dwTotalSize))
02037                 {
02038                     dwSizeofVarString = lpVarString -> dwNeededSize;
02039                     lReturn = -1; // Lets loop again.
02040                 }
02041             }
02042             while(lReturn != SUCCESS);
02043
02044             OutputDebugString("Connected!  Starting communications!\n");
02045
02046             // Again, the handle to the comm port is contained in a
02047             // LPVARSTRING structure.  Thus, the handle is the very first
02048             // thing after the end of the structure.  Note that the name of
02049             // the comm port is right after the handle, but I don't want it.
02050             hCommFile =
02051                 *((LPHANDLE)((LPBYTE)lpVarString +
02052                     lpVarString -> dwStringOffset));
02053
02054             // Started communications!
02055             if (StartComm(hCommFile))
02056             {
02057                 char szBuff[300];
02058
02059                 wsprintf(szBuff,"Connected to '%s'",g_szDisplayableAddress);
02060                 UpdateStatusBar(szBuff, 1, 0);
02061
02062                 LocalFree(lpVarString);
02063                 break;
02064             }
02065
02066             // Couldn't start communications.  Clean up instead.
02067           ErrorConnecting:
02068
02069             // Its very important that we close all Win32 handles.
02070             // The CommCode module is responsible for closing the hCommFile
02071             // handle if it succeeds in starting communications.
02072             if (hCommFile)
02073                 CloseHandle(hCommFile);
02074
02075             HangupCall();
02076             {
02077                 char szBuff[300];
02078                 wsprintf(szBuff,"Failed to Connect to '%s'",
02079                     g_szDisplayableAddress);
02080                 UpdateStatusBar(szBuff, 1, 0);
02081             }
02082
02083             if (lpVarString)
02084                 LocalFree(lpVarString);
02085
02086             break;
02087         }
02088
02089         default:
02090             OutputDebugString("Unhandled LINECALLSTATE message\n");
02091             break;
02092     }
02093 }
02094
02095 //**************************************************
02096 // line API Wrapper Functions.
02097 //**************************************************
02098
02099
02100 //
02101 //  FUNCTION: LPVOID CheckAndReAllocBuffer(LPVOID, size_t, LPCSTR)
02102 //
02103 //  PURPOSE: Checks and ReAllocates a buffer if necessary.
02104 //
02105 //  PARAMETERS:
02106 //    lpBuffer          - Pointer to buffer to be checked.  Can be NULL.
02107 //    sizeBufferMinimum - Minimum size that lpBuffer should be.
02108 //    szApiPhrase       - Phrase to print if an error occurs.
02109 //
02110 //  RETURN VALUE:
02111 //    Returns a pointer to a valid buffer that is guarenteed to be
02112 //    at least sizeBufferMinimum size.
02113 //    Returns NULL if an error occured.
02114 //
02115 //  COMMENTS:
02116 //
02117 //    This function is a helper function intended to make all of the
02118 //    line API Wrapper Functions much simplier.  It allocates (or
02119 //    reallocates) a buffer of the requested size.
02120 //
02121 //    The returned pointer has been allocated with LocalAlloc,
02122 //    so LocalFree has to be called on it when you're finished with it,
02123 //    or there will be a memory leak.
02124 //
02125 //    Similarly, if a pointer is passed in, it *must* have been allocated
02126 //    with LocalAlloc and it could potentially be LocalFree()d.
02127 //
02128 //    If lpBuffer == NULL, then a new buffer is allocated.  It is
02129 //    normal to pass in NULL for this parameter the first time and only
02130 //    pass in a pointer if the buffer needs to be reallocated.
02131 //
02132 //    szApiPhrase is used only for debugging purposes.
02133 //
02134 //    It is assumed that the buffer returned from this function will be used
02135 //    to contain a variable sized structure.  Thus, the dwTotalSize field
02136 //    is always filled in before returning the pointer.
02137 //
02138 //
02139
02140 LPVOID CheckAndReAllocBuffer(
02141     LPVOID lpBuffer, size_t sizeBufferMinimum, LPCSTR szApiPhrase)
02142 {
02143     size_t sizeBuffer;
02144
02145     if (lpBuffer == NULL)  // Allocate the buffer if necessary.
02146     {
02147         sizeBuffer = sizeBufferMinimum;
02148         lpBuffer = (LPVOID) LocalAlloc(LPTR, sizeBuffer);
02149
02150         if (lpBuffer == NULL)
02151         {
02152             OutputDebugString(szApiPhrase);
02153             OutputDebugLastError(GetLastError(),"LocalAlloc : ");
02154             HandleNoMem();
02155             return NULL;
02156         }
02157     }
02158     else // If the structure already exists, make sure its good.
02159     {
02160         sizeBuffer = (size_t)LocalSize((HLOCAL) lpBuffer);
02161
02162         if (sizeBuffer == 0) // Bad pointer?
02163         {
02164             OutputDebugString(szApiPhrase);
02165             OutputDebugLastError(GetLastError(),"LocalSize : ");
02166             return NULL;
02167         }
02168
02169         // Was the buffer big enough for the structure?
02170         if (sizeBuffer < sizeBufferMinimum)
02171         {
02172             OutputDebugString(szApiPhrase);
02173             OutputDebugString("Reallocating structure\n");
02174             LocalFree(lpBuffer);
02175             return CheckAndReAllocBuffer(NULL, sizeBufferMinimum, szApiPhrase);
02176         }
02177
02178         // Lets zero the buffer out.
02179         memset(lpBuffer, 0, sizeBuffer);
02180     }
02181
02182     ((LPVARSTRING) lpBuffer ) -> dwTotalSize = (DWORD) sizeBuffer;
02183     return lpBuffer;
02184 }
02185
02186
02187
02188 //
02189 //  FUNCTION: DWORD I_lineNegotiateAPIVersion(DWORD)
02190 //
02191 //  PURPOSE: Negotiate an API Version to use for a specific device.
02192 //
02193 //  PARAMETERS:
02194 //    dwDeviceID - device to negotiate an API Version for.
02195 //
02196 //  RETURN VALUE:
02197 //    Returns the API Version to use for this line if successful.
02198 //    Returns 0 if negotiations fall through.
02199 //
02200 //  COMMENTS:
02201 //
02202 //    This wrapper function not only negotiates the API, but handles
02203 //    LINEERR errors that can occur while negotiating.
02204 //
02205 //
02206
02207 DWORD I_lineNegotiateAPIVersion(DWORD dwDeviceID)
02208 {
02209     LINEEXTENSIONID LineExtensionID;
02210     long lReturn;
02211     DWORD dwLocalAPIVersion;
02212
02213     do
02214     {
02215         lReturn = lineNegotiateAPIVersion(g_hLineApp, dwDeviceID,
02216             SAMPLE_TAPI_VERSION, SAMPLE_TAPI_VERSION,
02217             &dwLocalAPIVersion, &LineExtensionID);
02218
02219         if (lReturn == LINEERR_INCOMPATIBLEAPIVERSION)
02220         {
02221             OutputDebugString(
02222                 "lineNegotiateAPIVersion, INCOMPATIBLEAPIVERSION.\n");
02223             return 0;
02224         }
02225
02226         if (HandleLineErr(lReturn))
02227             continue;
02228         else
02229         {
02230             OutputDebugLineError(lReturn,
02231                 "lineNegotiateAPIVersion unhandled error: ");
02232             return 0;
02233         }
02234     }
02235     while(lReturn != SUCCESS);
02236
02237     return dwLocalAPIVersion;
02238 }
02239
02240
02241 //
02242 //  FUNCTION: I_lineGetDevCaps(LPLINEDEVCAPS, DWORD , DWORD)
02243 //
02244 //  PURPOSE: Retrieve a LINEDEVCAPS structure for the specified line.
02245 //
02246 //  PARAMETERS:
02247 //    lpLineDevCaps - Pointer to a LINEDEVCAPS structure to use.
02248 //    dwDeviceID    - device to get the DevCaps for.
02249 //    dwAPIVersion  - API Version to use while getting DevCaps.
02250 //
02251 //  RETURN VALUE:
02252 //    Returns a pointer to a LINEDEVCAPS structure if successful.
02253 //    Returns NULL if unsuccessful.
02254 //
02255 //  COMMENTS:
02256 //
02257 //    This function is a wrapper around lineGetDevCaps to make it easy
02258 //    to handle the variable sized structure and any errors received.
02259 //
02260 //    The returned structure has been allocated with LocalAlloc,
02261 //    so LocalFree has to be called on it when you're finished with it,
02262 //    or there will be a memory leak.
02263 //
02264 //    Similarly, if a lpLineDevCaps structure is passed in, it *must*
02265 //    have been allocated with LocalAlloc and it could potentially be
02266 //    LocalFree()d.
02267 //
02268 //    If lpLineDevCaps == NULL, then a new structure is allocated.  It is
02269 //    normal to pass in NULL for this parameter unless you want to use a
02270 //    lpLineDevCaps that has been returned by a previous I_lineGetDevCaps
02271 //    call.
02272 //
02273 //
02274
02275 LPLINEDEVCAPS I_lineGetDevCaps(
02276     LPLINEDEVCAPS lpLineDevCaps,
02277     DWORD dwDeviceID, DWORD dwAPIVersion)
02278 {
02279     size_t sizeofLineDevCaps = sizeof(LINEDEVCAPS) + 1024;
02280     long lReturn;
02281
02282     // Continue this loop until the structure is big enough.
02283     while(TRUE)
02284     {
02285         // Make sure the buffer exists, is valid and big enough.
02286         lpLineDevCaps =
02287             (LPLINEDEVCAPS) CheckAndReAllocBuffer(
02288                 (LPVOID) lpLineDevCaps, // Pointer to existing buffer, if any
02289                 sizeofLineDevCaps,      // Minimum size the buffer should be
02290                 "lineGetDevCaps");      // Phrase to tag errors, if any.
02291
02292         if (lpLineDevCaps == NULL)
02293             return NULL;
02294
02295         // Make the call to fill the structure.
02296         do
02297         {
02298             lReturn =
02299                 lineGetDevCaps(g_hLineApp,
02300                     dwDeviceID, dwAPIVersion, 0, lpLineDevCaps);
02301
02302             if (HandleLineErr(lReturn))
02303                 continue;
02304             else
02305             {
02306                 OutputDebugLineError(lReturn,
02307                     "lineGetDevCaps unhandled error: ");
02308                 LocalFree(lpLineDevCaps);
02309                 return NULL;
02310             }
02311         }
02312         while (lReturn != SUCCESS);
02313
02314         // If the buffer was big enough, then succeed.
02315         if ((lpLineDevCaps -> dwNeededSize) <= (lpLineDevCaps -> dwTotalSize))
02316             return lpLineDevCaps;
02317
02318         // Buffer wasn't big enough.  Make it bigger and try again.
02319         sizeofLineDevCaps = lpLineDevCaps -> dwNeededSize;
02320     }
02321 }
02322
02323
02324 //
02325 //  FUNCTION: I_lineGetAddressStatus(LPLINEADDRESSSTATUS, HLINE, DWORD)
02326 //
02327 //  PURPOSE: Retrieve a LINEADDRESSSTATUS structure for the specified line.
02328
02329
02330 //
02331 //  PARAMETERS:
02332 //    lpLineAddressStatus - Pointer to a LINEADDRESSSTATUS structure to use.
02333 //    hLine       - Handle of line to get the AddressStatus of.
02334 //    dwAddressID - Address ID on the hLine to be used.
02335 //
02336 //  RETURN VALUE:
02337 //    Returns a pointer to a LINEADDRESSSTATUS structure if successful.
02338 //    Returns NULL if unsuccessful.
02339 //
02340 //  COMMENTS:
02341 //
02342 //    This function is a wrapper around lineGetAddressStatus to make it easy
02343 //    to handle the variable sized structure and any errors received.
02344 //
02345 //    The returned structure has been allocated with LocalAlloc,
02346 //    so LocalFree has to be called on it when you're finished with it,
02347 //    or there will be a memory leak.
02348 //
02349 //    Similarly, if a lpLineAddressStatus structure is passed in, it *must*
02350 //    have been allocated with LocalAlloc and it could potentially be
02351 //    LocalFree()d.
02352 //
02353 //    If lpLineAddressStatus == NULL, then a new structure is allocated.  It
02354 //    is normal to pass in NULL for this parameter unless you want to use a
02355 //    lpLineAddressStatus that has been returned by previous
02356 //    I_lineGetAddressStatus call.
02357 //
02358 //
02359
02360 LPLINEADDRESSSTATUS I_lineGetAddressStatus(
02361     LPLINEADDRESSSTATUS lpLineAddressStatus,
02362     HLINE hLine, DWORD dwAddressID)
02363 {
02364     size_t sizeofLineAddressStatus = sizeof(LINEADDRESSSTATUS) + 1024;
02365     long lReturn;
02366
02367     // Continue this loop until the structure is big enough.
02368     while(TRUE)
02369     {
02370         // Make sure the buffer exists, is valid and big enough.
02371         lpLineAddressStatus =
02372             (LPLINEADDRESSSTATUS) CheckAndReAllocBuffer(
02373                 (LPVOID) lpLineAddressStatus,
02374                 sizeofLineAddressStatus,
02375                 "lineGetAddressStatus");
02376
02377         if (lpLineAddressStatus == NULL)
02378             return NULL;
02379
02380         // Make the call to fill the structure.
02381         do
02382         {
02383             lReturn =
02384                 lineGetAddressStatus(hLine, dwAddressID, lpLineAddressStatus);
02385
02386             if (HandleLineErr(lReturn))
02387                 continue;
02388             else
02389             {
02390                 OutputDebugLineError(lReturn,
02391                     "lineGetAddressStatus unhandled error: ");
02392                 LocalFree(lpLineAddressStatus);
02393                 return NULL;
02394             }
02395         }
02396         while (lReturn != SUCCESS);
02397
02398         // If the buffer was big enough, then succeed.
02399         if ((lpLineAddressStatus -> dwNeededSize) <=
02400             (lpLineAddressStatus -> dwTotalSize))
02401         {
02402             return lpLineAddressStatus;
02403         }
02404
02405         // Buffer wasn't big enough.  Make it bigger and try again.
02406         sizeofLineAddressStatus = lpLineAddressStatus -> dwNeededSize;
02407     }
02408 }
02409
02410
02411 //
02412 //  FUNCTION: I_lineGetCallStatus(LPLINECALLSTATUS, HCALL)
02413 //
02414 //  PURPOSE: Retrieve a LINECALLSTATUS structure for the specified line.
02415 //
02416 //  PARAMETERS:
02417 //    lpLineCallStatus - Pointer to a LINECALLSTATUS structure to use.
02418 //    hCall - Handle of call to get the CallStatus of.
02419 //
02420 //  RETURN VALUE:
02421 //    Returns a pointer to a LINECALLSTATUS structure if successful.
02422 //    Returns NULL if unsuccessful.
02423 //
02424 //  COMMENTS:
02425 //
02426 //    This function is a wrapper around lineGetCallStatus to make it easy
02427 //    to handle the variable sized structure and any errors received.
02428 //
02429 //    The returned structure has been allocated with LocalAlloc,
02430 //    so LocalFree has to be called on it when you're finished with it,
02431 //    or there will be a memory leak.
02432 //
02433 //    Similarly, if a lpLineCallStatus structure is passed in, it *must*
02434 //    have been allocated with LocalAlloc and it could potentially be
02435 //    LocalFree()d.
02436 //
02437 //    If lpLineCallStatus == NULL, then a new structure is allocated.  It
02438 //    is normal to pass in NULL for this parameter unless you want to use a
02439 //    lpLineCallStatus that has been returned by previous I_lineGetCallStatus
02440 //    call.
02441 //
02442 //
02443
02444 LPLINECALLSTATUS I_lineGetCallStatus(
02445     LPLINECALLSTATUS lpLineCallStatus,
02446     HCALL hCall)
02447 {
02448     size_t sizeofLineCallStatus = sizeof(LINECALLSTATUS) + 1024;
02449     long lReturn;
02450
02451     // Continue this loop until the structure is big enough.
02452     while(TRUE)
02453     {
02454         // Make sure the buffer exists, is valid and big enough.
02455         lpLineCallStatus =
02456             (LPLINECALLSTATUS) CheckAndReAllocBuffer(
02457                 (LPVOID) lpLineCallStatus,
02458                 sizeofLineCallStatus,
02459                 "lineGetCallStatus");
02460
02461         if (lpLineCallStatus == NULL)
02462             return NULL;
02463
02464         // Make the call to fill the structure.
02465         do
02466         {
02467             lReturn =
02468                 lineGetCallStatus(hCall, lpLineCallStatus);
02469
02470             if (HandleLineErr(lReturn))
02471                 continue;
02472             else
02473             {
02474                 OutputDebugLineError(lReturn,
02475                     "lineGetCallStatus unhandled error: ");
02476                 LocalFree(lpLineCallStatus);
02477                 return NULL;
02478             }
02479         }
02480         while (lReturn != SUCCESS);
02481
02482         // If the buffer was big enough, then succeed.
02483         if ((lpLineCallStatus -> dwNeededSize) <=
02484             (lpLineCallStatus -> dwTotalSize))
02485         {
02486             return lpLineCallStatus;
02487         }
02488
02489         // Buffer wasn't big enough.  Make it bigger and try again.
02490         sizeofLineCallStatus = lpLineCallStatus -> dwNeededSize;
02491     }
02492 }
02493
02494
02495 //
02496 //  FUNCTION: I_lineTranslateAddress
02497 //              (LPLINETRANSLATEOUTPUT, DWORD, DWORD, LPCSTR)
02498 //
02499 //  PURPOSE: Retrieve a LINECALLSTATUS structure for the specified line.
02500 //
02501 //  PARAMETERS:
02502 //    lpLineTranslateOutput - Pointer to a LINETRANSLATEOUTPUT structure.
02503 //    dwDeviceID      - Device that we're translating for.
02504 //    dwAPIVersion    - API Version to use.
02505 //    lpszDialAddress - pointer to the DialAddress string to translate.
02506 //
02507 //  RETURN VALUE:
02508 //    Returns a pointer to a LINETRANSLATEOUTPUT structure if successful.
02509 //    Returns NULL if unsuccessful.
02510 //
02511 //  COMMENTS:
02512 //
02513 //    This function is a wrapper around lineGetTranslateOutput to make it
02514 //    easy to handle the variable sized structure and any errors received.
02515 //
02516 //    The returned structure has been allocated with LocalAlloc,
02517 //    so LocalFree has to be called on it when you're finished with it,
02518 //    or there will be a memory leak.
02519 //
02520 //    Similarly, if a lpLineTranslateOutput structure is passed in, it
02521 //    *must* have been allocated with LocalAlloc and it could potentially be
02522 //    LocalFree()d.
02523 //
02524 //    If lpLineTranslateOutput == NULL, then a new structure is allocated.
02525 //    It is normal to pass in NULL for this parameter unless you want to use
02526 //    a lpLineTranslateOutput that has been returned by previous
02527 //    I_lineTranslateOutput call.
02528 //
02529 //
02530
02531 LPLINETRANSLATEOUTPUT I_lineTranslateAddress(
02532     LPLINETRANSLATEOUTPUT lpLineTranslateOutput,
02533     DWORD dwDeviceID, DWORD dwAPIVersion,
02534     LPCSTR lpszDialAddress)
02535 {
02536     size_t sizeofLineTranslateOutput = sizeof(LINETRANSLATEOUTPUT) + 1024;
02537     long lReturn;
02538
02539     // Continue this loop until the structure is big enough.
02540     while(TRUE)
02541     {
02542         // Make sure the buffer exists, is valid and big enough.
02543         lpLineTranslateOutput =
02544             (LPLINETRANSLATEOUTPUT) CheckAndReAllocBuffer(
02545                 (LPVOID) lpLineTranslateOutput,
02546                 sizeofLineTranslateOutput,
02547                 "lineTranslateOutput");
02548
02549         if (lpLineTranslateOutput == NULL)
02550             return NULL;
02551
02552         // Make the call to fill the structure.
02553         do
02554         {
02555             // Note that CALLWAITING is disabled
02556             // (assuming the service provider can disable it)
02557             lReturn =
02558                 lineTranslateAddress(g_hLineApp, dwDeviceID, dwAPIVersion,
02559                     lpszDialAddress, 0,
02560                     LINETRANSLATEOPTION_CANCELCALLWAITING,
02561                     lpLineTranslateOutput);
02562
02563             // If the address isn't translatable, notify the user.
02564             if (lReturn == LINEERR_INVALADDRESS)
02565                 MessageBox(g_hDlgParentWindow,
02566                     "Unable to translate phone number","Warning",MB_OK);
02567
02568             if (HandleLineErr(lReturn))
02569                 continue;
02570             else
02571             {
02572                 OutputDebugLineError(lReturn,
02573                     "lineTranslateOutput unhandled error: ");
02574                 LocalFree(lpLineTranslateOutput);
02575                 return NULL;
02576             }
02577         }
02578         while (lReturn != SUCCESS);
02579
02580         // If the buffer was big enough, then succeed.
02581         if ((lpLineTranslateOutput -> dwNeededSize) <=
02582             (lpLineTranslateOutput -> dwTotalSize))
02583         {
02584             return lpLineTranslateOutput;
02585         }
02586
02587         // Buffer wasn't big enough.  Make it bigger and try again.
02588         sizeofLineTranslateOutput = lpLineTranslateOutput -> dwNeededSize;
02589     }
02590 }
02591
02592
02593 //
02594 //  FUNCTION: I_lineGetAddressCaps(LPLINEADDRESSCAPS, ..)
02595 //
02596 //  PURPOSE: Retrieve a LINEADDRESSCAPS structure for the specified line.
02597 //
02598 //  PARAMETERS:
02599 //    lpLineAddressCaps - Pointer to a LINEADDRESSCAPS, or NULL.
02600 //    dwDeviceID        - Device to get the address caps for.
02601 //    dwAddressID       - This sample always assumes the first address.
02602 //    dwAPIVersion      - API version negotiated for the device.
02603 //    dwExtVersion      - Always 0 for this sample.
02604 //
02605 //  RETURN VALUE:
02606 //    Returns a pointer to a LINEADDRESSCAPS structure if successful.
02607 //    Returns NULL if unsuccessful.
02608 //
02609 //  COMMENTS:
02610 //
02611 //    This function is a wrapper around lineGetAddressCaps to make it easy
02612 //    to handle the variable sized structure and any errors received.
02613 //
02614 //    The returned structure has been allocated with LocalAlloc,
02615 //    so LocalFree has to be called on it when you're finished with it,
02616 //    or there will be a memory leak.
02617 //
02618 //    Similarly, if a lpLineAddressCaps structure is passed in, it *must*
02619 //    have been allocated with LocalAlloc and it could potentially be
02620 //    LocalFree()d.  It also *must* have the dwTotalSize field set.
02621 //
02622 //    If lpLineAddressCaps == NULL, then a new structure is allocated.  It
02623 //    is normal to pass in NULL for this parameter unless you want to use a
02624 //    lpLineCallStatus that has been returned by previous I_lineGetAddressCaps
02625 //    call.
02626 //
02627 //
02628
02629 LPLINEADDRESSCAPS I_lineGetAddressCaps (
02630     LPLINEADDRESSCAPS lpLineAddressCaps,
02631     DWORD dwDeviceID, DWORD dwAddressID,
02632     DWORD dwAPIVersion, DWORD dwExtVersion)
02633 {
02634     size_t sizeofLineAddressCaps = sizeof(LINEADDRESSCAPS) + 1024;
02635     long lReturn;
02636
02637     // Continue this loop until the structure is big enough.
02638     while(TRUE)
02639     {
02640         // Make sure the buffer exists, is valid and big enough.
02641         lpLineAddressCaps =
02642             (LPLINEADDRESSCAPS) CheckAndReAllocBuffer(
02643                 (LPVOID) lpLineAddressCaps,
02644                 sizeofLineAddressCaps,
02645                 "lineGetAddressCaps");
02646
02647         if (lpLineAddressCaps == NULL)
02648             return NULL;
02649
02650         // Make the call to fill the structure.
02651         do
02652         {
02653             lReturn =
02654                 lineGetAddressCaps(g_hLineApp,
02655                     dwDeviceID, dwAddressID, dwAPIVersion, dwExtVersion,
02656                     lpLineAddressCaps);
02657
02658             if (HandleLineErr(lReturn))
02659                 continue;
02660             else
02661             {
02662                 OutputDebugLineError(lReturn,
02663                     "lineGetAddressCaps unhandled error: ");
02664                 LocalFree(lpLineAddressCaps);
02665                 return NULL;
02666             }
02667         }
02668         while (lReturn != SUCCESS);
02669
02670         // If the buffer was big enough, then succeed.
02671         if ((lpLineAddressCaps -> dwNeededSize) <=
02672             (lpLineAddressCaps -> dwTotalSize))
02673         {
02674             return lpLineAddressCaps;
02675         }
02676
02677         // Buffer wasn't big enough.  Make it bigger and try again.
02678         sizeofLineAddressCaps = lpLineAddressCaps -> dwNeededSize;
02679     }
02680 }
02681
02682
02683
02684 //**************************************************
02685 // LINEERR Error Handlers
02686 //**************************************************
02687
02688
02689 //
02690 //  FUNCTION: HandleLineErr(long)
02691 //
02692 //  PURPOSE: Handle several standard LINEERR errors
02693 //
02694 //  PARAMETERS:
02695 //    lLineErr - Error code to be handled.
02696 //
02697 //  RETURN VALUE:
02698 //    Return TRUE if lLineErr wasn't an error, or if the
02699 //      error was successfully handled and cleared up.
02700 //    Return FALSE if lLineErr was an unhandled error.
02701 //
02702 //  COMMENTS:
02703 //
02704 //    This is the main error handler for all TAPI line APIs.
02705 //    It handles (by correcting or just notifying the user)
02706 //    most of the errors that can occur while using TAPI line APIs.
02707 //
02708 //    Note that many errors still return FALSE (unhandled) even
02709 //    if a dialog is displayed.  Often, the dialog is just notifying
02710 //    the user why the action was canceled.
02711 //
02712 //
02713 //
02714
02715 BOOL HandleLineErr(long lLineErr)
02716 {
02717     // lLineErr is really an async request ID, not an error.
02718     if (lLineErr > SUCCESS)
02719         return FALSE;
02720
02721     // All we do is dispatch the correct error handler.
02722     switch(lLineErr)
02723     {
02724         case SUCCESS:
02725             return TRUE;
02726
02727         case LINEERR_INVALCARD:
02728         case LINEERR_INVALLOCATION:
02729         case LINEERR_INIFILECORRUPT:
02730             return HandleIniFileCorrupt();
02731
02732         case LINEERR_NODRIVER:
02733             return HandleNoDriver();
02734
02735         case LINEERR_REINIT:
02736             return HandleReInit();
02737
02738         case LINEERR_NOMULTIPLEINSTANCE:
02739             return HandleNoMultipleInstance();
02740
02741         case LINEERR_NOMEM:
02742             return HandleNoMem();
02743
02744         case LINEERR_OPERATIONFAILED:
02745             return HandleOperationFailed();
02746
02747         case LINEERR_RESOURCEUNAVAIL:
02748             return HandleResourceUnavail();
02749
02750         // Unhandled errors fail.
02751         default:
02752             return FALSE;
02753     }
02754 }
02755
02756
02757
02758 //
02759 //  FUNCTION: HandleIniFileCorrupt
02760 //
02761 //  PURPOSE: Handle INIFILECORRUPT error.
02762 //
02763 //  PARAMETERS:
02764 //    none
02765 //
02766 //  RETURN VALUE:
02767 //    TRUE  - error was corrected.
02768 //    FALSE - error was not corrected.
02769 //
02770 //  COMMENTS:
02771 //
02772 //    This error shouldn't happen under Windows 95 anymore.  The TAPI.DLL
02773 //    takes care of correcting this problem.  If it does happen, just
02774 //    notify the user.
02775 //
02776
02777 BOOL HandleIniFileCorrupt()
02778 {
02779     if (IDCANCEL == MessageBox(g_hDlgParentWindow,
02780         "Configuration information relating to Telephony "
02781         "services appears to be corrupt.\n"
02782         "This could be the first time you have used the Telephony services.\n"
02783         "Would you like to configure the Telephony services?",
02784         "Warning",MB_OKCANCEL))
02785     {
02786         return FALSE;
02787     }
02788
02789     lineTranslateDialog(g_hLineApp, 0, SAMPLE_TAPI_VERSION,
02790         g_hDlgParentWindow, NULL);
02791
02792     return TRUE;
02793 }
02794
02795
02796 //
02797 //  FUNCTION: HandleNoDriver
02798 //
02799 //  PURPOSE: Handle NODRIVER error.
02800 //
02801 //  PARAMETERS:
02802 //    none
02803 //
02804 //  RETURN VALUE:
02805 //    TRUE  - error was corrected.
02806 //    FALSE - error was not corrected.
02807 //
02808 //  COMMENTS:
02809 //
02810 //
02811
02812 BOOL HandleNoDriver()
02813 {
02814     int mbRet;
02815     mbRet = MessageBox(g_hDlgParentWindow,
02816         "One of the components of the Telephony device driver is missing.\n"
02817             "Use the Control Panel to set up the driver properly.",
02818         "Warning",MB_OK);
02819
02820     return FALSE;
02821 }
02822
02823
02824 //
02825 //  FUNCTION: HandleNoMultipleInstance
02826 //
02827 //  PURPOSE: Handle NOMULTIPLEINSTANCE error.
02828 //
02829 //  PARAMETERS:
02830 //    none
02831 //
02832 //  RETURN VALUE:
02833 //    TRUE  - error was corrected.
02834 //    FALSE - error was not corrected.
02835 //
02836 //  COMMENTS:
02837 //
02838 //
02839
02840 BOOL HandleNoMultipleInstance()
02841 {
02842     MessageBox(g_hDlgParentWindow,
02843         "You have two copies of the same Telephony driver installed.\n"
02844             "Use the Control Panel to remove one of the copies.",
02845         "Warning",MB_OK);
02846
02847     return FALSE;
02848 }
02849
02850
02851 //
02852 //  FUNCTION: HandleReInit
02853 //
02854 //  PURPOSE: Handle REINIT error.
02855 //
02856 //  PARAMETERS:
02857 //    none
02858 //
02859 //  RETURN VALUE:
02860 //    TRUE  - error was corrected.
02861 //    FALSE - error was not corrected.
02862 //
02863 //  COMMENTS:
02864 //
02865 //
02866
02867 BOOL HandleReInit()
02868 {
02869     ShutdownTAPI();
02870     return FALSE;
02871 }
02872
02873
02874 //
02875 //  FUNCTION: HandleNoMem
02876 //
02877 //  PURPOSE: Handle NOMEM error.
02878 //
02879 //  PARAMETERS:
02880 //    none
02881 //
02882 //  RETURN VALUE:
02883 //    TRUE  - error was corrected.
02884 //    FALSE - error was not corrected.
02885 //
02886 //  COMMENTS:
02887 //    This is also called if I run out of memory for LocalAlloc()s
02888 //
02889 //
02890
02891 BOOL HandleNoMem()
02892 {
02893     MessageBox(g_hDlgParentWindow,
02894         "Out of Memory error, canceling action.","Error", MB_OK);
02895     return FALSE;
02896 }
02897
02898
02899 //
02900 //  FUNCTION: HandleOperationFailed
02901 //
02902 //  PURPOSE: Handle OPERATIONFAILED error.
02903 //
02904 //  PARAMETERS:
02905 //    none
02906 //
02907 //  RETURN VALUE:
02908 //    TRUE  - error was corrected.
02909 //    FALSE - error was not corrected.
02910 //
02911 //  COMMENTS:
02912 //
02913 //
02914
02915 BOOL HandleOperationFailed()
02916 {
02917     MessageBox(g_hDlgParentWindow,
02918         "TAPI Operation Failed for unknown reasons.",
02919         "Error", MB_OK);
02920     return FALSE;
02921 }
02922
02923
02924 //
02925 //  FUNCTION: HandleResourceUnavail
02926 //
02927 //  PURPOSE: Handle RESOURCEUNAVAIL error.
02928 //
02929 //  PARAMETERS:
02930 //    none
02931 //
02932 //  RETURN VALUE:
02933 //    TRUE  - error was corrected.
02934 //    FALSE - error was not corrected.
02935 //
02936 //  COMMENTS:
02937 //
02938 //
02939
02940 BOOL HandleResourceUnavail()
02941 {
02942     int mbRet;
02943
02944     mbRet = MessageBox(g_hDlgParentWindow,
02945         "A Telephony resource is temporarily unavaiable.  "
02946         "This could mean a short wait is necessary or "
02947         "that a non-TAPI application is using the line.",
02948         "Warning",MB_RETRYCANCEL);
02949
02950     if (mbRet == IDRETRY)
02951         return TRUE;
02952
02953     return FALSE;
02954 }
02955
02956
02957 //
02958 //  FUNCTION: HandleNoDevicesInstalled
02959 //
02960 //  PURPOSE: Handle cases when we know NODEVICE error
02961 //    is returned because there are no devices installed.
02962 //
02963 //  PARAMETERS:
02964 //    none
02965 //
02966 //  RETURN VALUE:
02967 //    TRUE  - error was corrected.
02968 //    FALSE - error was not corrected.
02969 //
02970 //  COMMENTS:
02971 //
02972 //    This function is not part of standard error handling
02973 //    but is only used when we know that the NODEVICE error
02974 //    means that no devices are installed.
02975 //
02976 //
02977
02978 BOOL HandleNoDevicesInstalled()
02979 {
02980     int mbRet;
02981     mbRet = MessageBox(g_hDlgParentWindow,
02982        "There are no devices configured for Telephony use.\n"
02983        "Would you like to run the Modem Control Panel to add a modem driver?",
02984        "Warning",MB_YESNO);
02985
02986     if (mbRet == IDYES)
02987     {
02988         if (LaunchModemControlPanelAdd())
02989             return TRUE;
02990     }
02991
02992     return FALSE;
02993 }
02994
02995
02996 //
02997 //  FUNCTION: LaunchModemControlPanelAdd
02998 //
02999 //  PURPOSE: Launch Add Modem Control Panel applet.
03000 //
03001 //  PARAMETERS:
03002 //    none
03003 //
03004 //  RETURN VALUE:
03005 //    TRUE  - Control Panel launched successfully.
03006 //    FALSE - It didn't.
03007 //
03008 //  COMMENTS:
03009 //
03010 //
03011
03012 BOOL LaunchModemControlPanelAdd()
03013 {
03014     PROCESS_INFORMATION piProcInfo;
03015     STARTUPINFO siStartupInfo;
03016
03017     siStartupInfo.cb = sizeof(STARTUPINFO);
03018     siStartupInfo.lpReserved = NULL;
03019     siStartupInfo.lpDesktop = NULL;
03020     siStartupInfo.lpTitle = NULL;
03021     siStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
03022     siStartupInfo.wShowWindow = SW_SHOWNORMAL;
03023     siStartupInfo.cbReserved2 = 0;
03024     siStartupInfo.lpReserved2 = NULL;
03025
03026     // The string to launch the modem control panel is *VERY* likely
03027     // to change on NT.  If nothing else, this is 'contrl32' on NT
03028     // instead of 'control'.
03029     if (CreateProcess(
03030             NULL,
03031             "CONTROL.EXE MODEM.CPL,,ADD",
03032             NULL, NULL, FALSE,
03033             NORMAL_PRIORITY_CLASS,
03034             NULL, NULL,
03035             &siStartupInfo,
03036             &piProcInfo))
03037     {
03038         CloseHandle(piProcInfo.hThread);
03039
03040
03041         // Control panel 'Add New Modem' has been launched.  Now we should
03042         // wait for it to go away before continueing.
03043
03044         // If we WaitForSingleObject for the control panel to exit, then we
03045         // get into a deadlock situation if we need to respond to any messages
03046         // from the control panel.
03047
03048         // If we use a PeekMessage loop to wait, we run into
03049         // message re-entrancy problems.  (The user can get back to our UI
03050         // and click 'dial' again).
03051
03052         // Instead, we take the easy way out and return FALSE to abort
03053         // the current operation.
03054
03055         CloseHandle(piProcInfo.hProcess);
03056     }
03057     else
03058     {
03059         OutputDebugLastError(GetLastError(),
03060             "Unable to LaunchModemControlPanelAdd: ");
03061         MessageBox(g_hDlgParentWindow,
03062             "Unable to launch the Modem Control Panel",
03063             "Warning", MB_OK);
03064     }
03065
03066     return FALSE;
03067 }
03068
03069
03070 //
03071 //  FUNCTION: WarningBox(LPCSTR)
03072 //
03073 //  PURPOSE: Prints a warning box when conditions remove a line in use.
03074 //
03075 //  PARAMETERS:
03076 //    lpszMessage - String that specifies why the line was removed form use.
03077 //
03078 //  RETURN VALUE:
03079 //    none
03080 //
03081 //  COMMENTS:
03082 //
03083 //    If there is a call in progress on the line removed, then display a message
03084 //    specifying why the line was removed and that the call is being canceled.
03085 //
03086 //
03087
03088 void WarningBox(LPCSTR lpszMessage)
03089 {
03090     char szBuff[1024];
03091   DWORD dwRemainingLength;
03092
03093     strncpy(szBuff, lpszMessage, 1023);
03094   szBuff[1023] = '\0';
03095
03096    dwRemainingLength = 1023 - strlen(szBuff);
03097
03098     // If there is a call open, tell user we're going to close it.
03099     if (g_hCall)
03100         strncat(szBuff, "\nClosing existing call.", dwRemainingLength);
03101
03102     MessageBox(g_hDlgParentWindow, szBuff, "Warning", MB_OK);
03103   dwRemainingLength = 1023 - strlen(szBuff);
03104     strncat(szBuff, "\r\n",dwRemainingLength );
03105   szBuff[1023] = '\0';
03106     OutputDebugString(szBuff);
03107 }
03108
03109
03110 //**************************************************
03111 //
03112 // All the functions from this point on are used solely by the "Dial" dialog.
03113 // This dialog is used to get both the 'phone number' address,
03114 // the line device to be used as well as allow the user to configure
03115 // dialing properties and the line device.
03116 //
03117 //**************************************************
03118
03119 //
03120 //  FUNCTION: DWORD I_lineNegotiateLegacyAPIVersion(DWORD)
03121 //
03122 //  PURPOSE: Negotiate an API Version to use for a specific device.
03123 //
03124 //  PARAMETERS:
03125 //    dwDeviceID - device to negotiate an API Version for.
03126 //
03127 //  RETURN VALUE:
03128 //    Returns the API Version to use for this line if successful.
03129 //    Returns 0 if negotiations fall through.
03130 //
03131 //  COMMENTS:
03132 //
03133 //    This wrapper is slightly different from the I_lineNegotiateAPIVersion.
03134 //    This wrapper allows TapiComm to negotiate an API version between
03135 //    1.3 and SAMPLE_TAPI_VERSION.  Normally, this sample is specific to
03136 //    API Version SAMPLE_TAPI_VERSION.  However, there are a few times when
03137 //    TapiComm needs to get information from a service provider, but also knows
03138 //    that a lower API Version would be ok.  This allows TapiComm to recognize
03139 //    legacy service providers even though it can't use them.  1.3 is the
03140 //    lowest API Version a legacy service provider should support.
03141 //
03142 //
03143
03144 DWORD I_lineNegotiateLegacyAPIVersion(DWORD dwDeviceID)
03145 {
03146     LINEEXTENSIONID LineExtensionID;
03147     long lReturn;
03148     DWORD dwLocalAPIVersion;
03149
03150     do
03151     {
03152         lReturn = lineNegotiateAPIVersion(g_hLineApp, dwDeviceID,
03153             0x00010003, SAMPLE_TAPI_VERSION,
03154             &dwLocalAPIVersion, &LineExtensionID);
03155
03156         if (lReturn == LINEERR_INCOMPATIBLEAPIVERSION)
03157         {
03158             OutputDebugString("INCOMPATIBLEAPIVERSION in Dial Dialog.\n");
03159             return 0;
03160         }
03161
03162         if (HandleLineErr(lReturn))
03163             continue;
03164         else
03165         {
03166             OutputDebugLineError(lReturn,
03167                 "lineNegotiateAPIVersion in Dial Dialog unhandled error: ");
03168             return 0;
03169         }
03170     }
03171     while(lReturn != SUCCESS);
03172
03173     return dwLocalAPIVersion;
03174 }
03175
03176
03177 //
03178 //  FUNCTION: long VerifyUsableLine(DWORD)
03179 //
03180 //  PURPOSE: Verifies that a specific line device is useable by TapiComm.
03181 //
03182 //  PARAMETERS:
03183 //    dwDeviceID - The ID of the line device to be verified
03184 //
03185 //  RETURN VALUE:
03186 //    Returns SUCCESS if dwDeviceID is a usable line device.
03187 //    Returns a LINENOTUSEABLE_ constant otherwise.
03188 //
03189 //  COMMENTS:
03190 //
03191 //    VerifyUsableLine takes the give device ID and verifies step by step
03192 //    that the device supports all the features that TapiComm requires.
03193 //
03194 //
03195
03196 long VerifyUsableLine(DWORD dwDeviceID)
03197 {
03198     LPLINEDEVCAPS lpLineDevCaps = NULL;
03199     LPLINEADDRESSSTATUS lpLineAddressStatus = NULL;
03200     LPVARSTRING lpVarString = NULL;
03201     DWORD dwAPIVersion;
03202     long lReturn;
03203     long lUsableLine = SUCCESS;
03204     HLINE hLine = 0;
03205
03206     OutputDebugPrintf("Testing Line ID '0x%lx'",dwDeviceID);
03207
03208     // The line device must support an API Version that TapiComm does.
03209     dwAPIVersion = I_lineNegotiateAPIVersion(dwDeviceID);
03210     if (dwAPIVersion == 0)
03211         return LINENOTUSEABLE_ERROR;
03212
03213     lpLineDevCaps = I_lineGetDevCaps(lpLineDevCaps,
03214         dwDeviceID, dwAPIVersion);
03215
03216     if (lpLineDevCaps == NULL)
03217         return LINENOTUSEABLE_ERROR;
03218
03219     // Must support LINEBEARERMODE_VOICE
03220     if (!(lpLineDevCaps->dwBearerModes & LINEBEARERMODE_VOICE ))
03221     {
03222         lUsableLine = LINENOTUSEABLE_NOVOICE;
03223         OutputDebugString("LINEBEARERMODE_VOICE not supported\n");
03224         goto DeleteBuffers;
03225     }
03226
03227     // Must support LINEMEDIAMODE_DATAMODEM
03228     if (!(lpLineDevCaps->dwMediaModes & LINEMEDIAMODE_DATAMODEM))
03229     {
03230         lUsableLine = LINENOTUSEABLE_NODATAMODEM;
03231         OutputDebugString("LINEMEDIAMODE_DATAMODEM not supported\n");
03232         goto DeleteBuffers;
03233     }
03234
03235     // Must be able to make calls
03236     if (!(lpLineDevCaps->dwLineFeatures & LINEFEATURE_MAKECALL))
03237     {
03238         lUsableLine = LINENOTUSEABLE_NOMAKECALL;
03239         OutputDebugString("LINEFEATURE_MAKECALL not supported\n");
03240         goto DeleteBuffers;
03241     }
03242
03243     // It is necessary to open the line so we can check if
03244     // there are any call appearances available.  Other TAPI
03245     // applications could be using all call appearances.
03246     // Opening the line also checks for other possible problems.
03247     do
03248     {
03249         lReturn = lineOpen(g_hLineApp, dwDeviceID, &hLine,
03250             dwAPIVersion, 0, 0,
03251             LINECALLPRIVILEGE_NONE, LINEMEDIAMODE_DATAMODEM,
03252             0);
03253
03254         if(lReturn == LINEERR_ALLOCATED)
03255         {
03256             OutputDebugString(
03257                 "Line is already in use by a non-TAPI app or"
03258                 " another Service Provider.\n");
03259             lUsableLine = LINENOTUSEABLE_ALLOCATED;
03260             goto DeleteBuffers;
03261         }
03262
03263         if (HandleLineErr(lReturn))
03264             continue;
03265         else
03266         {
03267             OutputDebugLineError(lReturn, "lineOpen unhandled error: ");
03268             lUsableLine = LINENOTUSEABLE_ERROR;
03269             goto DeleteBuffers;
03270         }
03271     }
03272     while(lReturn != SUCCESS);
03273
03274     // Get LineAddressStatus to make sure the line isn't already in use.
03275     lpLineAddressStatus =
03276         I_lineGetAddressStatus(lpLineAddressStatus, hLine, 0);
03277
03278     if (lpLineAddressStatus == NULL)
03279     {
03280         lUsableLine = LINENOTUSEABLE_ERROR;
03281         goto DeleteBuffers;
03282     }
03283
03284     // Are there any available call appearances (ie: is it in use)?
03285     if ( !((lpLineAddressStatus -> dwAddressFeatures) &
03286            LINEADDRFEATURE_MAKECALL) )
03287     {
03288         OutputDebugString("LINEADDRFEATURE_MAKECALL not available\n");
03289         lUsableLine = LINENOTUSEABLE_INUSE;
03290         goto DeleteBuffers;
03291     }
03292
03293     // Make sure the "comm/datamodem" device class is supported
03294     // Note that we don't want any of the 'extra' information
03295     // normally returned in the VARSTRING structure.  All we care
03296     // about is if lineGetID succeeds.
03297     do
03298     {
03299         lpVarString = CheckAndReAllocBuffer((LPVOID) lpVarString,
03300             sizeof(VARSTRING),"VerifyUsableLine:lineGetID: ");
03301
03302         if (lpVarString == NULL)
03303         {
03304             lUsableLine = LINENOTUSEABLE_ERROR;
03305             goto DeleteBuffers;
03306         }
03307
03308         lReturn = lineGetID(hLine, 0, 0, LINECALLSELECT_LINE,
03309             lpVarString, "comm/datamodem");
03310
03311         if (HandleLineErr(lReturn))
03312             continue;
03313         else
03314         {
03315             OutputDebugLineError(lReturn,
03316                 "lineGetID unhandled error: ");
03317             lUsableLine = LINENOTUSEABLE_NOCOMMDATAMODEM;
03318             goto DeleteBuffers;
03319         }
03320     }
03321     while(lReturn != SUCCESS);
03322
03323     OutputDebugString("Line is suitable and available for use.\n");
03324
03325   DeleteBuffers:
03326
03327     if (hLine)
03328         lineClose(hLine);
03329     if (lpLineAddressStatus)
03330         LocalFree(lpLineAddressStatus);
03331     if (lpLineDevCaps)
03332         LocalFree(lpLineDevCaps);
03333     if (lpVarString)
03334         LocalFree(lpVarString);
03335
03336     return lUsableLine;
03337 }
03338
03339
03340 //
03341 //  FUNCTION: void FillTAPILine(HWND)
03342 //
03343 //  PURPOSE: Fills the 'TAPI Line' control with the available line devices.
03344 //
03345 //  PARAMETERS:
03346 //    hwndDlg - handle to the current "Dial" dialog
03347 //
03348 //  RETURN VALUE:
03349 //    none
03350 //
03351 //  COMMENTS:
03352 //
03353 //    This function enumerates through all the TAPI line devices and
03354 //    queries each for the device name.  The device name is then put into
03355 //    the 'TAPI Line' control.  These device names are kept in order rather
03356 //    than sorted.  This allows "Dial" to know which device ID the user
03357 //    selected just by the knowing the index of the selected string.
03358 //
03359 //    There are default values if there isn't a device name, if there is
03360 //    an error on the device, or if the device name is an empty string.
03361 //    The device name is also checked to make sure it is null terminated.
03362 //
03363 //    Note that a Legacy API Version is negotiated.  Since the fields in
03364 //    the LINEDEVCAPS structure that we are interested in haven't moved, we
03365 //    can negotiate a lower API Version than this sample is designed for
03366 //    and still be able to access the necessary structure members.
03367 //
03368 //    The first line that is usable by TapiComm is selected as the 'default'
03369 //    line.  Also note that if there was a previously selected line, this
03370 //    remains the default line.  This would likely only occur if this
03371 //    function is called after the dialog has initialized once; for example,
03372 //    if a new line is added.
03373 //
03374 //
03375
03376 void FillTAPILine(HWND hwndDlg)
03377 {
03378     DWORD dwDeviceID;
03379     DWORD dwAPIVersion;
03380     LPLINEDEVCAPS lpLineDevCaps = NULL;
03381     char szLineUnavail[] = "Line Unavailable";
03382     char szLineUnnamed[] = "Line Unnamed";
03383     char szLineNameEmpty[] = "Line Name is Empty";
03384     LPSTR lpszLineName;
03385     long lReturn;
03386     DWORD dwDefaultDevice = MAXDWORD;
03387
03388     // Make sure the control is empty.  If it isn't,
03389     // hold onto the currently selected ID and then reset it.
03390     if (SendDlgItemMessage(hwndDlg, IDC_TAPILINE, CB_GETCOUNT, 0, 0))
03391     {
03392         dwDefaultDevice = (DWORD)SendDlgItemMessage(hwndDlg, IDC_TAPILINE,
03393             CB_GETCURSEL, 0, 0);
03394         SendDlgItemMessage(hwndDlg, IDC_TAPILINE, CB_RESETCONTENT, 0, 0);
03395     }
03396
03397     for (dwDeviceID = 0; dwDeviceID < g_dwNumDevs; dwDeviceID ++)
03398     {
03399         dwAPIVersion = I_lineNegotiateLegacyAPIVersion(dwDeviceID);
03400         if (dwAPIVersion)
03401         {
03402             lpLineDevCaps = I_lineGetDevCaps(lpLineDevCaps,
03403                 dwDeviceID, dwAPIVersion);
03404             if (lpLineDevCaps)
03405             {
03406                 if ((lpLineDevCaps -> dwLineNameSize) &&
03407                     (lpLineDevCaps -> dwLineNameOffset) &&
03408                     (lpLineDevCaps -> dwStringFormat == STRINGFORMAT_ASCII))
03409                 {
03410                     // This is the name of the device.
03411                     lpszLineName = ((char *) lpLineDevCaps) +
03412                         lpLineDevCaps -> dwLineNameOffset;
03413
03414                     if (lpszLineName[0] != '\0')
03415                     {
03416         // Reverse indented to make this fit
03417
03418         // Make sure the device name is null terminated.
03419         if (lpszLineName[lpLineDevCaps->dwLineNameSize -1] != '\0')
03420         {
03421             // If the device name is not null terminated, null
03422             // terminate it.  Yes, this looses the end character.
03423             // Its a bug in the service provider.
03424             lpszLineName[lpLineDevCaps->dwLineNameSize-1] = '\0';
03425             OutputDebugPrintf(
03426                 "Device name for device 0x%lx is not null terminated.\n",
03427                 dwDeviceID);
03428         }
03429                     }
03430                     else // Line name started with a NULL.
03431                         lpszLineName = szLineNameEmpty;
03432                 }
03433                 else  // DevCaps doesn't have a valid line name.  Unnamed.
03434                     lpszLineName = szLineUnnamed;
03435             }
03436             else  // Couldn't GetDevCaps.  Line is unavail.
03437                 lpszLineName = szLineUnavail;
03438         }
03439         else  // Couldn't NegotiateAPIVersion.  Line is unavail.
03440             lpszLineName = szLineUnavail;
03441
03442         // Put the device name into the control
03443         lReturn = (long)SendDlgItemMessage(hwndDlg, IDC_TAPILINE,
03444             CB_ADDSTRING, 0, (LPARAM) (LPCTSTR) lpszLineName);
03445
03446         // If this line is usable and we don't have a default initial
03447         // line yet, make this the initial line.
03448         if ((lpszLineName != szLineUnavail) &&
03449             (dwDefaultDevice == MAXDWORD) &&
03450             (VerifyUsableLine(dwDeviceID) == SUCCESS))
03451         {
03452             dwDefaultDevice = dwDeviceID;
03453         }
03454     }
03455
03456     if (lpLineDevCaps)
03457         LocalFree(lpLineDevCaps);
03458
03459     if (dwDefaultDevice == MAXDWORD)
03460         dwDefaultDevice = 0;
03461
03462     // Set the initial default line
03463     SendDlgItemMessage(hwndDlg, IDC_TAPILINE,
03464         CB_SETCURSEL, dwDefaultDevice, 0);
03465 }
03466
03467
03468 //
03469 //  FUNCTION: BOOL VerifyAndWarnUsableLine(HWND)
03470 //
03471 //  PURPOSE: Verifies the line device selected by the user.
03472 //
03473 //  PARAMETERS:
03474 //    hwndDlg - The handle to the current "Dial" dialog.
03475 //
03476 //  RETURN VALUE:
03477 //    Returns TRUE if the currently selected line device is useable
03478 //      by TapiComm.  Returns FALSE if it isn't.
03479 //
03480 //  COMMENTS:
03481 //
03482 //    This function is very specific to the "Dial" dialog.  It gets
03483 //    the device selected by the user from the 'TAPI Line' control and
03484 //    VerifyUsableLine to make sure this line device is usable.  If the
03485 //    line isn't useable, it notifies the user and disables the 'Dial'
03486 //    button so that the user can't initiate a call with this line.
03487 //
03488 //    This function is also responsible for filling in the line specific
03489 //    icon found on the "Dial" dialog.
03490 //
03491 //
03492
03493 BOOL VerifyAndWarnUsableLine(HWND hwndDlg)
03494 {
03495     DWORD dwDeviceID;
03496     long lReturn;
03497     HICON hIcon = 0;
03498     HWND hControlWnd;
03499
03500     // Get the selected line device.
03501     dwDeviceID = (DWORD)SendDlgItemMessage(hwndDlg, IDC_TAPILINE,
03502                         CB_GETCURSEL, 0, 0);
03503
03504     // Get the "comm" device icon associated with this line device.
03505     lReturn = lineGetIcon(dwDeviceID, "comm", &hIcon);
03506
03507     if (lReturn == SUCCESS)
03508         SendDlgItemMessage(hwndDlg, IDC_LINEICON, STM_SETICON,
03509             (WPARAM) hIcon, 0);
03510     else
03511         // Any failure to get an icon makes us use the default icon.
03512         SendDlgItemMessage(hwndDlg, IDC_LINEICON, WM_SETTEXT,
03513             0, (LPARAM) (LPCTSTR) "TapiComm");
03514
03515 /*  // It turns out that TAPI will always return an icon, even if
03516     // the device class isn't supported by the TSP or even if the TSP
03517     // doesn't return any icons at all.  This code is unnecessary.
03518     // The only reason lineGetIcon would fail is due to resource problems.
03519
03520     else
03521     {
03522         // If the line doesn't have a "comm" device icon, use its default one.
03523         lReturn = lineGetIcon(dwDeviceID, NULL, &hIcon);
03524         if (lReturn == SUCCESS)
03525         {
03526             OutputDebugString("Line doesn't support a \"comm\" icon.\n");
03527             SendDlgItemMessage(hwndDlg, IDC_LINEICON, STM_SETICON,
03528                 (WPARAM) hIcon, 0);
03529         }
03530         else
03531         {
03532             // If lineGetIcon fails, just use TapiComms icon.
03533             OutputDebugLineError(lReturn, "lineGetIcon: ");
03534             SendDlgItemMessage(hwndDlg, IDC_LINEICON, WM_SETTEXT,
03535                 0, (LPARAM) (LPCTSTR) "TapiComm");
03536         }
03537     }
03538 */
03539
03540     // Verify if the device is usable by TapiComm.
03541     lReturn = VerifyUsableLine(dwDeviceID);
03542
03543     // Enable or disable the 'Dial' button, depending on if the line is ok.
03544     // Make sure there is a number to dial before enabling the button.
03545     hControlWnd = GetDlgItem(hwndDlg, IDC_DIAL);
03546     if (SendDlgItemMessage(hwndDlg, IDC_CANONICALNUMBER,
03547         WM_GETTEXTLENGTH, 0, 0) == 0)
03548     {
03549         EnableWindow(hControlWnd, FALSE);
03550     }
03551     else
03552         EnableWindow(hControlWnd, (lReturn == SUCCESS));
03553
03554     // Any errors on this line prevent us from configuring it
03555     // or using dialing properties.
03556     if (lReturn == LINENOTUSEABLE_ERROR)
03557     {
03558         EnableWindow(GetDlgItem(hwndDlg, IDC_CONFIGURELINE), FALSE);
03559         EnableWindow(GetDlgItem(hwndDlg, IDC_DIALINGPROPERTIES), FALSE);
03560     }
03561     else
03562     {
03563         EnableWindow(GetDlgItem(hwndDlg, IDC_CONFIGURELINE), TRUE);
03564         if (SendDlgItemMessage(hwndDlg, IDC_USEDIALINGRULES, BM_GETCHECK, 0, 0))
03565             EnableWindow(GetDlgItem(hwndDlg, IDC_DIALINGPROPERTIES), TRUE);
03566     }
03567
03568     switch(lReturn)
03569     {
03570         case SUCCESS:
03571             g_dwDeviceID = dwDeviceID;
03572             return TRUE;
03573
03574         case LINENOTUSEABLE_ERROR:
03575             MessageBox(hwndDlg,
03576                 "The selected line is incompatible with the TapiComm sample",
03577                 "Warning",MB_OK);
03578             break;
03579         case LINENOTUSEABLE_NOVOICE:
03580             MessageBox(hwndDlg,
03581                 "The selected line doesn't support VOICE capabilities",
03582                 "Warning",MB_OK);
03583             break;
03584         case LINENOTUSEABLE_NODATAMODEM:
03585             MessageBox(hwndDlg,
03586                 "The selected line doesn't support DATAMODEM capabilities",
03587                 "Warning",MB_OK);
03588             break;
03589         case LINENOTUSEABLE_NOMAKECALL:
03590             MessageBox(hwndDlg,
03591                 "The selected line doesn't support MAKECALL capabilities",
03592                 "Warning",MB_OK);
03593             break;
03594         case LINENOTUSEABLE_ALLOCATED:
03595             MessageBox(hwndDlg,
03596                 "The selected line is already in use by a non-TAPI application",
03597                 "Warning",MB_OK);
03598             break;
03599         case LINENOTUSEABLE_INUSE:
03600             MessageBox(hwndDlg,
03601                 "The selected line is already in use by a TAPI application",
03602                 "Warning",MB_OK);
03603             break;
03604
03605         case LINENOTUSEABLE_NOCOMMDATAMODEM:
03606             MessageBox(hwndDlg,
03607                 "The selected line doesn't support the COMM/DATAMODEM device class",
03608                 "Warning",MB_OK);
03609             break;
03610     }
03611
03612     // g_dwDeviceID == MAXDWORD mean the selected device isn't usable.
03613     g_dwDeviceID = MAXDWORD;
03614     return FALSE;
03615 }
03616
03617
03618 //
03619 //  FUNCTION: void FillCountryCodeList(HWND, DWORD)
03620 //
03621 //  PURPOSE: Fill the 'Country Code' control
03622 //
03623 //  PARAMETERS:
03624 //    hwndDlg - handle to the current "Dial" dialog
03625 //    dwDefaultCountryID - ID of the 'default' country to be selected
03626 //
03627 //  RETURN VALUE:
03628 //    none
03629 //
03630 //  COMMENTS:
03631 //
03632 //    This function fills the 'Country Code' control with country names.
03633 //    The country code is appended to the end of the name and the names
03634 //    are added to the control sorted.  Because the country code is
03635 //    embedded in the string along with the country name, there is no need
03636 //    for any of the country information structures to be kept around.  The
03637 //    country code can be extracted from the selected string at any time.
03638 //
03639 //
03640
03641 void FillCountryCodeList(HWND hwndDlg, DWORD dwDefaultCountryID)
03642 {
03643     LPLINECOUNTRYLIST lpLineCountryList = NULL;
03644     DWORD dwSizeofCountryList = sizeof(LINECOUNTRYLIST);
03645     long lReturn;
03646     DWORD dwCountry;
03647     LPLINECOUNTRYENTRY lpLineCountryEntries;
03648     char szRenamedCountry[256];
03649
03650     // Get the country information stored in TAPI
03651     do
03652     {
03653         lpLineCountryList = (LPLINECOUNTRYLIST) CheckAndReAllocBuffer(
03654             (LPVOID) lpLineCountryList, dwSizeofCountryList,
03655             "FillCountryCodeList");
03656
03657         if (lpLineCountryList == NULL)
03658             return;
03659
03660         lReturn = lineGetCountry (0, SAMPLE_TAPI_VERSION, lpLineCountryList);
03661
03662         if (HandleLineErr(lReturn))
03663             ;
03664         else
03665         {
03666             OutputDebugLineError(lReturn, "lineGetCountry unhandled error: ");
03667             LocalFree(lpLineCountryList);
03668             return;
03669         }
03670
03671         if ((lpLineCountryList -> dwNeededSize) >
03672             (lpLineCountryList -> dwTotalSize))
03673         {
03674             dwSizeofCountryList = lpLineCountryList ->dwNeededSize;
03675             lReturn = -1; // Lets loop again.
03676         }
03677     }
03678     while (lReturn != SUCCESS);
03679
03680     // Find the first country entry
03681     lpLineCountryEntries = (LPLINECOUNTRYENTRY)
03682         (((LPBYTE) lpLineCountryList)
03683          + lpLineCountryList -> dwCountryListOffset);
03684
03685     // Now enumerate through all the countries
03686     for (dwCountry = 0;
03687          dwCountry < lpLineCountryList -> dwNumCountries;
03688          dwCountry++)
03689     {
03690         // append the country code to the country name
03691         wsprintf(szRenamedCountry,"%s (%lu)",
03692             (((LPSTR) lpLineCountryList) +
03693                 lpLineCountryEntries[dwCountry].dwCountryNameOffset),
03694             lpLineCountryEntries[dwCountry].dwCountryCode);
03695
03696         // Now put this country name / code string into the combobox
03697         lReturn = (long)SendDlgItemMessage(hwndDlg, IDC_COUNTRYCODE, CB_ADDSTRING,
03698                     0, (LPARAM) (LPCTSTR) szRenamedCountry);
03699
03700         // If this country is the default country, select it.
03701         if (lpLineCountryEntries[dwCountry].dwCountryID
03702             == dwDefaultCountryID)
03703         {
03704             SendDlgItemMessage(hwndDlg, IDC_COUNTRYCODE, CB_SETCURSEL, lReturn, 0);
03705         }
03706     }
03707
03708     LocalFree(lpLineCountryList);
03709     return;
03710 }
03711
03712
03713 //
03714 //  FUNCTION: void FillLocationInfo(HWND, LPSTR, LPDWORD, LPSTR)
03715 //
03716 //  PURPOSE: Fill (or refill) the 'Your Location' control
03717 //
03718 //  PARAMETERS:
03719 //    hwndDlg - handle to the current "Dial" dialog
03720 //    lpszCurrentLocation - Name of current location, or NULL
03721 //    lpdwCountryID - location to store the current country ID or NULL
03722 //    lpszAreaCode - location to store the current area code or NULL
03723 //
03724 //  RETURN VALUE:
03725 //    none
03726 //
03727 //  COMMENTS:
03728 //
03729 //    This function is moderately multipurpose.
03730 //
03731 //    If lpszCurrentLocation is NULL, then the 'Your Location' control
03732 //    is filled with all the locations stored in TAPI and the TAPI 'default'
03733 //    location is selected.  This is done during initialization and
03734 //    also after the 'Dialing Properties' dialog has been displayed.
03735 //    This last is done because the user can change the current location
03736 //    or add and delete locations while in the 'Dialing Properties' dialog.
03737 //
03738 //    If lpszCurrentLocation is a valid string pointer, then it is assumed
03739 //    that the 'Your Location' control is already filled and that the user
03740 //    is selecting a specific location.  In this case, all of the existing
03741 //    TAPI locations are enumerated until the specified location is found.
03742 //    At this point, the specified location is set to the current location.
03743 //
03744 //    In either case, if lpdwCountryID is not NULL, it is filled with the
03745 //    country ID for the current location.  If lpszAreaCode is not NULL, it
03746 //    is filled with the area code defined for the current location.  These
03747 //    values can be used later to initialize other "Dial" controls.
03748 //
03749 //    This function also fills the 'Calling Card' control based on
03750 //    the information stored in the current location.
03751 //
03752 //
03753
03754 void FillLocationInfo(HWND hwndDlg, LPSTR lpszCurrentLocation,
03755     LPDWORD lpdwCountryID, LPSTR lpszAreaCode)
03756 {
03757     LPLINETRANSLATECAPS lpTranslateCaps = NULL;
03758     DWORD dwSizeofTranslateCaps = sizeof(LINETRANSLATECAPS);
03759     long lReturn;
03760     DWORD dwCounter;
03761     LPLINELOCATIONENTRY lpLocationEntry;
03762     LPLINECARDENTRY lpLineCardEntry = NULL;
03763     DWORD dwPreferredCardID = MAXDWORD;
03764   DWORD dwRemainingLength;
03765
03766     // First, get the TRANSLATECAPS
03767     do
03768     {
03769         lpTranslateCaps = (LPLINETRANSLATECAPS) CheckAndReAllocBuffer(
03770             (LPVOID) lpTranslateCaps, dwSizeofTranslateCaps,
03771             "FillLocationInfo");
03772
03773         if (lpTranslateCaps == NULL)
03774             return;
03775
03776         lReturn = lineGetTranslateCaps(g_hLineApp, SAMPLE_TAPI_VERSION,
03777                     lpTranslateCaps);
03778
03779         if (HandleLineErr(lReturn))
03780             ;
03781         else
03782         {
03783             OutputDebugLineError(lReturn,
03784                 "lineGetTranslateCaps unhandled error: ");
03785             LocalFree(lpTranslateCaps);
03786             return;
03787         }
03788
03789         if ((lpTranslateCaps -> dwNeededSize) >
03790             (lpTranslateCaps -> dwTotalSize))
03791         {
03792             dwSizeofTranslateCaps = lpTranslateCaps ->dwNeededSize;
03793             lReturn = -1; // Lets loop again.
03794         }
03795     }
03796     while(lReturn != SUCCESS);
03797
03798     // Find the location information in the TRANSLATECAPS
03799     lpLocationEntry = (LPLINELOCATIONENTRY)
03800         (((LPBYTE) lpTranslateCaps) + lpTranslateCaps->dwLocationListOffset);
03801
03802     // If lpszCurrentLocation, then make that location 'current'
03803     if (lpszCurrentLocation)
03804     {
03805         // loop through all locations, looking for a location match
03806         for(dwCounter = 0;
03807             dwCounter < lpTranslateCaps -> dwNumLocations;
03808             dwCounter++)
03809         {
03810             if (strcmp((((LPSTR) lpTranslateCaps) +
03811                             lpLocationEntry[dwCounter].dwLocationNameOffset),
03812                         lpszCurrentLocation)
03813                 == 0)
03814             {
03815                 // Found it!  Set the current location.
03816                 lineSetCurrentLocation(g_hLineApp,
03817                     lpLocationEntry[dwCounter].dwPermanentLocationID);
03818
03819                 // Set the return values.
03820                 if (lpdwCountryID)
03821                     *lpdwCountryID = lpLocationEntry[dwCounter].dwCountryID;
03822
03823         dwRemainingLength = 255 - lstrlen(lpszAreaCode);
03824
03825                 if (lpszAreaCode)
03826                     strncpy(lpszAreaCode, (((LPSTR) lpTranslateCaps) +
03827                             lpLocationEntry[dwCounter].dwCityCodeOffset),dwRemainingLength);
03828         lpszAreaCode[255] = '\0';
03829
03830                 // Store the preferred card ID for later use.
03831                 dwPreferredCardID = lpLocationEntry[dwCounter].dwPreferredCardID;
03832                 break;
03833             }
03834         }
03835
03836         // Was a match for lpszCurrentLocation found?
03837         if (dwPreferredCardID == MAXDWORD)
03838         {
03839             OutputDebugString("lpszCurrentLocation not found\n");
03840             SendDlgItemMessage(hwndDlg, IDC_CALLINGCARD, WM_SETTEXT, 0,
03841                 (LPARAM) (LPCSTR) "Invalid Location Selected");
03842             LocalFree(lpTranslateCaps);
03843             return;
03844         }
03845     }
03846     else // fill the combobox and use the TAPI 'current' location.
03847     {
03848         // First empty the combobox
03849         SendDlgItemMessage(hwndDlg, IDC_LOCATION, CB_RESETCONTENT, 0, 0);
03850
03851         // enumerate all the locations
03852         for(dwCounter = 0;
03853             dwCounter < lpTranslateCaps -> dwNumLocations;
03854             dwCounter++)
03855         {
03856             // Put each one into the combobox
03857             lReturn = (long)SendDlgItemMessage(hwndDlg, IDC_LOCATION, CB_ADDSTRING,
03858                 0, (LPARAM) (((LPBYTE) lpTranslateCaps) +
03859                     lpLocationEntry[dwCounter].dwLocationNameOffset));
03860
03861             // Is this location the 'current' location?
03862             if (lpLocationEntry[dwCounter].dwPermanentLocationID ==
03863                 lpTranslateCaps->dwCurrentLocationID)
03864             {
03865                 // Return the requested information
03866                 if (lpdwCountryID)
03867                     *lpdwCountryID = lpLocationEntry[dwCounter].dwCountryID;
03868         dwRemainingLength = 255 - lstrlen(lpszAreaCode);
03869                 if (lpszAreaCode)
03870                     strncpy(lpszAreaCode, (((LPSTR) lpTranslateCaps) +
03871                             lpLocationEntry[dwCounter].dwCityCodeOffset),dwRemainingLength);
03872         lpszAreaCode[255] = '\0';
03873
03874                 // Set this to be the active location.
03875                 SendDlgItemMessage(hwndDlg, IDC_LOCATION, CB_SETCURSEL, lReturn, 0);
03876                 dwPreferredCardID = lpLocationEntry[dwCounter].dwPreferredCardID;
03877             }
03878         }
03879     }
03880
03881     // Now locate the prefered card and display it.
03882
03883     lpLineCardEntry = (LPLINECARDENTRY)
03884         (((LPBYTE) lpTranslateCaps) + lpTranslateCaps->dwCardListOffset);
03885
03886     for(dwCounter = 0;
03887         dwCounter < lpTranslateCaps -> dwNumCards;
03888         dwCounter++)
03889     {
03890         if (lpLineCardEntry[dwCounter].dwPermanentCardID == dwPreferredCardID)
03891         {
03892             SendDlgItemMessage(hwndDlg, IDC_CALLINGCARD, WM_SETTEXT, 0,
03893                 (LPARAM) (((LPBYTE) lpTranslateCaps) +
03894                     lpLineCardEntry[dwCounter].dwCardNameOffset));
03895             break;
03896         }
03897     }
03898
03899     LocalFree(lpTranslateCaps);
03900 }
03901
03902
03903
03904 //
03905 //  FUNCTION: void UseDialingRules(HWND)
03906 //
03907 //  PURPOSE: Enable/disable Dialing Rule controls
03908 //
03909 //  PARAMETERS:
03910 //    hwndDlg - handle to the current "Dial" dialog
03911 //
03912 //  RETURN VALUE:
03913 //    none
03914 //
03915 //  COMMENTS:
03916 //
03917 //    The sole purpose of this function is to enable or disable
03918 //    the controls that apply to dialing rules if the
03919 //    "Use Country Code and Area Code" checkbox is checked or unchecked,
03920 //    as appropriate.
03921 //
03922 //
03923
03924 void UseDialingRules(HWND hwndDlg)
03925 {
03926     HWND hControl;
03927     BOOL bEnableWindow;
03928
03929     bEnableWindow = (BOOL)SendDlgItemMessage(hwndDlg,
03930         IDC_USEDIALINGRULES, BM_GETCHECK, 0, 0);
03931
03932     hControl = GetDlgItem(hwndDlg, IDC_STATICCOUNTRYCODE);
03933     EnableWindow(hControl, bEnableWindow);
03934
03935     hControl = GetDlgItem(hwndDlg, IDC_COUNTRYCODE);
03936     EnableWindow(hControl, bEnableWindow);
03937
03938     hControl = GetDlgItem(hwndDlg, IDC_STATICAREACODE);
03939     EnableWindow(hControl, bEnableWindow);
03940
03941     hControl = GetDlgItem(hwndDlg, IDC_AREACODE);
03942     EnableWindow(hControl, bEnableWindow);
03943
03944     hControl = GetDlgItem(hwndDlg, IDC_STATICLOCATION);
03945     EnableWindow(hControl, bEnableWindow);
03946
03947     hControl = GetDlgItem(hwndDlg, IDC_LOCATION);
03948     EnableWindow(hControl, bEnableWindow);
03949
03950     hControl = GetDlgItem(hwndDlg, IDC_STATICCALLINGCARD);
03951     EnableWindow(hControl, bEnableWindow);
03952
03953     hControl = GetDlgItem(hwndDlg, IDC_CALLINGCARD);
03954     EnableWindow(hControl, bEnableWindow);
03955
03956     if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CONFIGURELINE)))
03957     {
03958         hControl = GetDlgItem(hwndDlg, IDC_DIALINGPROPERTIES);
03959         EnableWindow(hControl, bEnableWindow);
03960     }
03961 }
03962
03963
03964 //
03965 //  FUNCTION: void DisplayPhoneNumber(HWND)
03966 //
03967 //  PURPOSE: Create, Translate and Display the Phone Number
03968 //
03969 //  PARAMETERS:
03970 //    hwndDlg - handle to the current "Dial" dialog
03971 //
03972 //  RETURN VALUE:
03973 //    none
03974 //
03975 //  COMMENTS:
03976 //
03977 //    This function uses the information stored in many other controls
03978 //    to build the phone number, translate it, and display it.  Also
03979 //    makes sure the Dial button is enabled or disabled, based on if the
03980 //    number can be dialed or not.
03981 //
03982 //    There are actually three phone numbers generated during this
03983 //    process:  canonical, dialable and displayable.  Normally, only the
03984 //    displayable number is shown to the user; the other two numbers are
03985 //    to be used by the program internally.  However, for demonstration
03986 //    purposes (and because it is cool for developers to see these numbers),
03987 //    all three numbers are displayed.
03988 //
03989
03990 void DisplayPhoneNumber(HWND hwndDlg)
03991 {
03992     char szPreTranslatedNumber[1024] = "";
03993     int  nPreTranslatedSize = 0;
03994     char szTempBuffer[512];
03995     int  i;
03996     DWORD dwDeviceID;
03997     LPLINETRANSLATEOUTPUT lpLineTranslateOutput = NULL;
03998   DWORD dwRemainingLength;
03999
04000     // Disable the 'dial' button if there isn't a number to dial
04001     if (0 == SendDlgItemMessage(hwndDlg, IDC_PHONENUMBER,
04002             WM_GETTEXTLENGTH, 0, 0))
04003     {
04004         SendDlgItemMessage(hwndDlg, IDC_CANONICALNUMBER, WM_SETTEXT, 0,
04005             (LPARAM) NULL);
04006         SendDlgItemMessage(hwndDlg, IDC_DIALABLENUMBER, WM_SETTEXT, 0,
04007             (LPARAM) NULL);
04008         SendDlgItemMessage(hwndDlg, IDC_DISPLAYABLENUMBER, WM_SETTEXT, 0,
04009             (LPARAM) (LPCTSTR) "No Phone Number");
04010
04011         EnableWindow(GetDlgItem(hwndDlg, IDC_DIAL), FALSE);
04012         return;
04013     }
04014
04015     // If we use the dialing rules, lets make canonical format.
04016     // Canonical format is explained in the TAPI documentation and the
04017     // string format needs to be followed very strictly.
04018     if (SendDlgItemMessage(hwndDlg, IDC_USEDIALINGRULES,
04019         BM_GETCHECK, 0, 0))
04020     {
04021         // First character *has* to be the plus sign.
04022         szPreTranslatedNumber[0] = '+';
04023         nPreTranslatedSize = 1;
04024
04025         // The country code *has* to be next.
04026         // Country code was stored in the string with the country
04027         // name and needs to be extracted at this point.
04028         i = (int)SendDlgItemMessage(hwndDlg, IDC_COUNTRYCODE,
04029                 CB_GETCURSEL, 0, 0);
04030         SendDlgItemMessage(hwndDlg, IDC_COUNTRYCODE,
04031             CB_GETLBTEXT, (WPARAM) i, (LPARAM) (LPCTSTR) szTempBuffer);
04032
04033         // Country code is at the end of the string, surounded by parens.
04034         // This makes it easy to identify the country code.
04035         i = (int) strlen(szTempBuffer);
04036         while(szTempBuffer[--i] != '(');
04037
04038         while(szTempBuffer[++i] != ')')
04039             szPreTranslatedNumber[nPreTranslatedSize++] = szTempBuffer[i];
04040
04041         // Next is the area code.
04042         i = (int)SendDlgItemMessage(hwndDlg, IDC_AREACODE, WM_GETTEXT,
04043                 510, (LPARAM) (LPCTSTR) szTempBuffer);
04044
04045         // Note that the area code is optional.  If it is included,
04046         // then it has to be preceeded by *exactly* one space and it
04047         // *has* to be surrounded by parens.
04048         if (i)
04049             nPreTranslatedSize +=
04050                 wsprintf(&szPreTranslatedNumber[nPreTranslatedSize],
04051                     " (%s)", szTempBuffer);
04052
04053         // There has to be *exactly* one space before the rest of the number.
04054         szPreTranslatedNumber[nPreTranslatedSize++] = ' ';
04055
04056         // At this point, the phone number is appended to the
04057         // canonical number.  The next step is the same whether canonical
04058         // format is used or not; just the prepended area code and
04059         // country code are different.
04060     }
04061
04062     SendDlgItemMessage(hwndDlg, IDC_PHONENUMBER, WM_GETTEXT,
04063         510, (LPARAM) (LPCTSTR) szTempBuffer);
04064   dwRemainingLength = 1023 - strlen(szPreTranslatedNumber);
04065     strncat(&szPreTranslatedNumber[nPreTranslatedSize], szTempBuffer,dwRemainingLength );
04066   szPreTranslatedNumber[1023] = '\0';
04067
04068     dwDeviceID = (DWORD)SendDlgItemMessage(hwndDlg, IDC_TAPILINE,
04069                         CB_GETCURSEL, 0, 0);
04070
04071     // Translate the address!
04072     lpLineTranslateOutput = I_lineTranslateAddress(
04073         lpLineTranslateOutput, dwDeviceID, SAMPLE_TAPI_VERSION,
04074         szPreTranslatedNumber);
04075
04076     // Unable to translate it?
04077     if (lpLineTranslateOutput == NULL)
04078     {
04079         SendDlgItemMessage(hwndDlg, IDC_CANONICALNUMBER, WM_SETTEXT, 0,
04080             (LPARAM) NULL);
04081         SendDlgItemMessage(hwndDlg, IDC_DIALABLENUMBER, WM_SETTEXT, 0,
04082             (LPARAM) NULL);
04083         SendDlgItemMessage(hwndDlg, IDC_DISPLAYABLENUMBER, WM_SETTEXT, 0,
04084             (LPARAM) (LPCTSTR) "Invalid Phone Number or Area Code");
04085
04086         EnableWindow(GetDlgItem(hwndDlg, IDC_DIAL), FALSE);
04087         return;
04088     }
04089
04090     // Is the selected device useable with TapiComm?
04091     if (g_dwDeviceID != MAXDWORD)
04092         EnableWindow(GetDlgItem(hwndDlg, IDC_DIAL), TRUE);
04093
04094     // Fill the appropriate phone number controls.
04095     SendDlgItemMessage(hwndDlg, IDC_CANONICALNUMBER, WM_SETTEXT, 0,
04096         (LPARAM) (LPCTSTR) szPreTranslatedNumber);
04097
04098     SendDlgItemMessage(hwndDlg, IDC_DIALABLENUMBER, WM_SETTEXT, 0,
04099         (LPARAM) ((LPSTR) lpLineTranslateOutput +
04100             lpLineTranslateOutput -> dwDialableStringOffset));
04101
04102     SendDlgItemMessage(hwndDlg, IDC_DISPLAYABLENUMBER, WM_SETTEXT, 0,
04103         (LPARAM) ((LPSTR) lpLineTranslateOutput +
04104             lpLineTranslateOutput -> dwDisplayableStringOffset));
04105
04106     LocalFree(lpLineTranslateOutput);
04107
04108 }
04109
04110
04111 //
04112 //  FUNCTION: void PreConfigureDevice(HWND, DWORD)
04113 //
04114 //  PURPOSE:
04115 //
04116 //  PARAMETERS:
04117 //    hwndDlg - handle to the current "Dial" dialog
04118 //    dwDeviceID - line device to be configured
04119 //
04120 //  RETURN VALUE:
04121 //    none
04122 //
04123 //  COMMENTS:
04124 //
04125 //    At one point, PreConfigureDevice used lineConfigDialog to
04126 //    configure the device.  This has the unfortunate effect of configuring
04127 //    the device immediately, even if it is in use by another TAPI app.
04128 //    This can be really bad if data communications are already in
04129 //    progress (like with RAS).
04130 //
04131 //    Now, PreConfigureDevice uses lineConfigDialogEdit to give the
04132 //    user the configuration UI, but it doesn't actually do anything to
04133 //    the line device.  TapiComm stores the configuration information so
04134 //    that it can be set later, just before making the call.
04135 //
04136 //
04137
04138 void PreConfigureDevice(HWND hwndDlg, DWORD dwDeviceID)
04139 {
04140     long lReturn;
04141     LPVARSTRING lpVarString = NULL;
04142     DWORD dwSizeofVarString = sizeof(VARSTRING);
04143
04144     // If there isn't already any device configuration information,
04145     // then we need to get some.
04146     if (g_lpDeviceConfig == NULL)
04147     {
04148         do
04149         {
04150             lpVarString = (LPVARSTRING) CheckAndReAllocBuffer(
04151                 (LPVOID) lpVarString, dwSizeofVarString,
04152                 "PreConfigureDevice - lineGetDevConfig: ");
04153
04154             if (lpVarString == NULL)
04155                 return;
04156
04157             lReturn = lineGetDevConfig(dwDeviceID, lpVarString,
04158                 "comm/datamodem");
04159
04160             if (HandleLineErr(lReturn))
04161                 ;
04162             else
04163             {
04164                 OutputDebugLineError(lReturn,
04165                     "lineGetDevCaps unhandled error: ");
04166                 LocalFree(lpVarString);
04167                 return;
04168             }
04169
04170             if ((lpVarString -> dwNeededSize) > (lpVarString -> dwTotalSize))
04171             {
04172                 dwSizeofVarString = lpVarString -> dwNeededSize;
04173                 lReturn = -1; // Lets loop again.
04174             }
04175         }
04176         while (lReturn != SUCCESS);
04177
04178         g_dwSizeDeviceConfig = lpVarString -> dwStringSize;
04179
04180         // The extra byte allocated is in case dwStringSize is 0.
04181         g_lpDeviceConfig = CheckAndReAllocBuffer(
04182                 g_lpDeviceConfig, g_dwSizeDeviceConfig+1,
04183                 "PreConfigureDevice - Allocate device config: ");
04184
04185         if (!g_lpDeviceConfig)
04186         {
04187             LocalFree(lpVarString);
04188             return;
04189         }
04190
04191         memcpy(g_lpDeviceConfig,
04192             ((LPBYTE) lpVarString + lpVarString -> dwStringOffset),
04193             g_dwSizeDeviceConfig);
04194     }
04195
04196     // Next make the lineConfigDialogEdit call.
04197
04198     // Note that we determine the initial size of the VARSTRING
04199     // structure based on the known size of the existing configuration
04200     // information.  I make the assumption that this configuration
04201     // information is very unlikely to grow by more than 5K or by
04202     // more than 5 times.  This is a *very* conservative number.
04203     // We do *not* want lineConfigDialogEdit to fail just because there
04204     // wasn't enough room to stored the data.  This would require the user
04205     // to go through configuration again and that would be annoying.
04206
04207     dwSizeofVarString = 5 * g_dwSizeDeviceConfig + 5000;
04208
04209     do
04210     {
04211         lpVarString = (LPVARSTRING) CheckAndReAllocBuffer(
04212             (LPVOID) lpVarString, dwSizeofVarString,
04213             "PreConfigureDevice - lineConfigDialogEdit: ");
04214
04215         if (lpVarString == NULL)
04216             return;
04217
04218         lReturn = lineConfigDialogEdit(dwDeviceID, hwndDlg, "comm/datamodem",
04219             g_lpDeviceConfig, g_dwSizeDeviceConfig, lpVarString);
04220
04221         if (HandleLineErr(lReturn))
04222             ;
04223         else
04224         {
04225             OutputDebugLineError(lReturn,
04226                 "lineConfigDialogEdit unhandled error: ");
04227             LocalFree(lpVarString);
04228             return;
04229         }
04230
04231         if ((lpVarString -> dwNeededSize) > (lpVarString -> dwTotalSize))
04232         {
04233             // We had been conservative about making sure the structure was
04234             // big enough.  Unfortunately, not conservative enough.  Hopefully,
04235             // this will not happen a second time because we are *DOUBLING*
04236             // the NeededSize.
04237             MessageBox(hwndDlg,
04238                 "Internal Error: Unable to set line configuration.\n"
04239                 "Please try again.",
04240                 "Oops", MB_OK);
04241             dwSizeofVarString = (lpVarString -> dwNeededSize) * 2;
04242             lReturn = -1; // Lets loop again.
04243         }
04244     }
04245     while (lReturn != SUCCESS);
04246
04247     // Store the configuration information into a global structure
04248     // so it can be set at a later time.
04249     g_dwSizeDeviceConfig = lpVarString -> dwStringSize;
04250     g_lpDeviceConfig = CheckAndReAllocBuffer(
04251             g_lpDeviceConfig, g_dwSizeDeviceConfig+1,
04252             "PreConfigureDevice - Reallocate device config: ");
04253
04254     if (!g_lpDeviceConfig)
04255     {
04256         LocalFree(lpVarString);
04257         return;
04258     }
04259
04260     memcpy(g_lpDeviceConfig,
04261         ((LPBYTE) lpVarString + lpVarString -> dwStringOffset),
04262         g_dwSizeDeviceConfig);
04263
04264     LocalFree(lpVarString);
04265 }
04266
04267
04268 //
04269 //  FUNCTION: BOOL GetAddressToDial
04270 //
04271 //  PURPOSE: Get an address to dial from the user.
04272 //
04273 //  PARAMETERS:
04274 //    none
04275 //
04276 //  RETURN VALUE:
04277 //    TRUE if a valid device and phone number have been entered by
04278 //    the user.  FALSE if the user canceled the dialing process.
04279 //
04280 //  COMMENTS:
04281 //
04282 //    All this function does is launch the "Dial" dialog.
04283 //
04284 //
04285
04286 BOOL GetAddressToDial()
04287 {
04288     BOOL bRet;
04289
04290     UpdateStatusBar("Getting Number to Dial",1,0);
04291     bRet = (BOOL)DialogBoxParam(hInst, "DialDialog", g_hDlgParentWindow,
04292         DialDialogProc, 0);
04293     g_hDialog = NULL;
04294     g_hDlgParentWindow = g_hWndMainWindow;
04295
04296     if (bRet == FALSE)
04297         UpdateStatusBar("Dial aborted",1,0);
04298
04299     return bRet;
04300 }
04301
04302
04303 //
04304 //  FUNCTION: DialDialogProc(HWND, UINT, WPARAM, LPARAM)
04305 //
04306 //  PURPOSE: Dialog callback procedure for the dialing dialog
04307 //
04308 //  PARAMETERS:
04309 //    hwndDlg - Dialog calling the callback.
04310 //    uMsg    - Dialog message.
04311 //    wParam  - uMsg specific.
04312 //    lParam  - uMsg specific.
04313 //
04314 //  RETURN VALUE:
04315 //    returns 0 - command handled.
04316 //    returns non-0 - command unhandled
04317 //
04318 //  COMMENTS:
04319 //
04320 //    This is the dialog to get the phone number and line device
04321 //    from the user.  All the relavent information is stored in global
04322 //    variables to be used later if the dialog returns successfully.
04323 //
04324 //
04325
04326
04327 INT_PTR CALLBACK DialDialogProc(
04328     HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
04329 {
04330     // Static variables to store the information from last time the
04331     // "Dial" dialog was displayed.  That way the phone number can be
04332     // typed once but used several times.
04333
04334     static char szCountryName[512] = "";
04335     static char szAreaCode[256] = "Not Valid";
04336     static char szPhoneNumber[512] = "Not Valid";
04337     static DWORD dwUsedDeviceID = MAXDWORD;
04338     static BOOL bUsedCountryAndArea = FALSE;
04339     static BOOL bHistoryValid = FALSE;
04340
04341     switch(uMsg)
04342     {
04343         case WM_INITDIALOG:
04344         {
04345             DWORD dwCountryID = 0;
04346
04347             // Store the Dialog Window so it can be dismissed if necessary
04348             g_hDialog = hwndDlg;
04349
04350             // This dialog should be parent to all dialogs.
04351             g_hDlgParentWindow = hwndDlg;
04352
04353             // Initialize the Dialog Box. Lots to do here.
04354
04355             FillTAPILine(hwndDlg);
04356             if (g_lpDeviceConfig)
04357             {
04358                 LocalFree(g_lpDeviceConfig);
04359                 g_lpDeviceConfig = NULL;
04360             }
04361
04362             // If there is a valid history, use it to initialize the controls.
04363             if (bHistoryValid)
04364             {
04365                 FillLocationInfo(hwndDlg, NULL, NULL, NULL);
04366                 FillCountryCodeList(hwndDlg, 0);
04367
04368                 SendDlgItemMessage(hwndDlg, IDC_COUNTRYCODE, CB_SELECTSTRING,
04369                     (WPARAM) -1, (LPARAM) (LPCTSTR) szCountryName);
04370
04371                 SendDlgItemMessage(hwndDlg, IDC_PHONENUMBER, WM_SETTEXT, 0,
04372                     (LPARAM) (LPCTSTR) szPhoneNumber);
04373
04374                 SendDlgItemMessage(hwndDlg, IDC_USEDIALINGRULES,
04375                     BM_SETCHECK, (WPARAM) bUsedCountryAndArea, 0);
04376
04377                 SendDlgItemMessage(hwndDlg, IDC_TAPILINE, CB_SETCURSEL,
04378                     g_dwDeviceID, 0);
04379             }
04380             else
04381             {
04382                 FillLocationInfo(hwndDlg, NULL, &dwCountryID, szAreaCode);
04383                 FillCountryCodeList(hwndDlg, dwCountryID);
04384                 SendDlgItemMessage(hwndDlg, IDC_USEDIALINGRULES,
04385                     BM_SETCHECK, 1, 0);
04386             }
04387
04388             SendDlgItemMessage(hwndDlg, IDC_AREACODE, WM_SETTEXT,
04389                 0, (LPARAM) (LPCTSTR) szAreaCode);
04390
04391             UseDialingRules(hwndDlg);
04392             DisplayPhoneNumber(hwndDlg);
04393             VerifyAndWarnUsableLine(hwndDlg);
04394
04395             return TRUE;
04396         }
04397
04398         case WM_COMMAND:
04399         {
04400             switch(LOWORD(wParam))
04401             {
04402                 case IDC_TAPILINE:
04403                     if (HIWORD(wParam) == CBN_SELENDOK)
04404                     {
04405                         if (g_lpDeviceConfig)
04406                         {
04407                             LocalFree(g_lpDeviceConfig);
04408                             g_lpDeviceConfig = NULL;
04409                         }
04410                         DisplayPhoneNumber(hwndDlg);
04411                         VerifyAndWarnUsableLine(hwndDlg);
04412                     }
04413                     return TRUE;
04414
04415                 case IDC_CONFIGURELINE:
04416                 {
04417                     DWORD dwDeviceID;
04418                     dwDeviceID = (DWORD)SendDlgItemMessage(hwndDlg, IDC_TAPILINE,
04419                         CB_GETCURSEL, 0, 0);
04420                     PreConfigureDevice(hwndDlg, dwDeviceID);
04421                     DisplayPhoneNumber(hwndDlg);
04422                     return TRUE;
04423                 }
04424
04425                 case IDC_COUNTRYCODE:
04426                     if (HIWORD(wParam) == CBN_SELENDOK)
04427                         DisplayPhoneNumber(hwndDlg);
04428                     return TRUE;
04429
04430                 case IDC_AREACODE:
04431                 case IDC_PHONENUMBER:
04432                     if (HIWORD(wParam) == EN_CHANGE)
04433                         DisplayPhoneNumber(hwndDlg);
04434                     return TRUE;
04435
04436                 case IDC_USEDIALINGRULES:
04437                     if (HIWORD(wParam) == BN_CLICKED)
04438                     {
04439                         UseDialingRules(hwndDlg);
04440                         DisplayPhoneNumber(hwndDlg);
04441                     }
04442                     return TRUE;
04443
04444                 case IDC_LOCATION:
04445                     if (HIWORD(wParam) == CBN_CLOSEUP)
04446                     {
04447                         char szCurrentLocation[1024];
04448                         int nCurrentSelection;
04449
04450                         nCurrentSelection = (int)SendDlgItemMessage(hwndDlg,
04451                             IDC_LOCATION, CB_GETCURSEL, 0, 0);
04452                         SendDlgItemMessage(hwndDlg, IDC_LOCATION,
04453                             CB_GETLBTEXT, nCurrentSelection,
04454                             (LPARAM) (LPCTSTR) szCurrentLocation);
04455
04456                         // If the user selected a 'location', make it current.
04457                         FillLocationInfo(hwndDlg, szCurrentLocation, NULL, NULL);
04458                         DisplayPhoneNumber(hwndDlg);
04459                     }
04460                     return TRUE;
04461
04462                 case IDC_DIALINGPROPERTIES:
04463                 {
04464                     char szAddress[1024];
04465                     DWORD dwDeviceID;
04466                     long lReturn;
04467
04468                     dwDeviceID = (DWORD)SendDlgItemMessage(hwndDlg, IDC_TAPILINE,
04469                             CB_GETCURSEL, 0, 0);
04470
04471                     SendDlgItemMessage(hwndDlg, IDC_CANONICALNUMBER,
04472                         WM_GETTEXT, 1023, (LPARAM) (LPCTSTR) szAddress);
04473
04474                     lReturn = lineTranslateDialog(g_hLineApp, dwDeviceID,
04475                         SAMPLE_TAPI_VERSION, hwndDlg, szAddress);
04476
04477                     if (lReturn != SUCCESS)
04478                         OutputDebugLineError(lReturn,"lineTranslateDialog: ");
04479
04480                     // The user could have changed the default location, or
04481                     // added or removed a location while in the 'Dialing
04482                     // Properties' dialog.  Refill the Location Info.
04483                     FillLocationInfo(hwndDlg, NULL, NULL, NULL);
04484                     DisplayPhoneNumber(hwndDlg);
04485
04486                     return TRUE;
04487                 }
04488
04489                 case IDCANCEL:
04490                     EndDialog(hwndDlg, FALSE);
04491                     return TRUE;
04492
04493                 case IDC_DIAL:
04494                 {
04495                     // The Dial button has to be enabled and the line has
04496                     // to be currently usable to continue.
04497                     if (!(IsWindowEnabled((HWND)lParam) &&
04498                           VerifyAndWarnUsableLine(hwndDlg)))
04499                         return TRUE;
04500
04501                     DisplayPhoneNumber(hwndDlg);
04502
04503                     // Get the displayable and dialable numbers and store
04504                     // them in global variables to be used while dialing.
04505                     SendDlgItemMessage(hwndDlg, IDC_DISPLAYABLENUMBER,
04506                         WM_GETTEXT, 1023, (LPARAM) (LPCTSTR) g_szDisplayableAddress);
04507
04508                     SendDlgItemMessage(hwndDlg, IDC_DIALABLENUMBER,
04509                         WM_GETTEXT, 1023, (LPARAM) (LPCTSTR) g_szDialableAddress);
04510
04511                     // Store all the relavent information in static
04512                     // variables so they will be available the next time a
04513                     // number is dialed.
04514                     SendDlgItemMessage(hwndDlg, IDC_COUNTRYCODE,
04515                         WM_GETTEXT, 511, (LPARAM) (LPCTSTR) szCountryName);
04516
04517                     SendDlgItemMessage(hwndDlg, IDC_AREACODE,
04518                         WM_GETTEXT, 255, (LPARAM) (LPCTSTR) szAreaCode);
04519
04520                     SendDlgItemMessage(hwndDlg, IDC_PHONENUMBER,
04521                         WM_GETTEXT, 511, (LPARAM) (LPCTSTR) szPhoneNumber);
04522
04523                     bUsedCountryAndArea = (BOOL) SendDlgItemMessage(hwndDlg,
04524                         IDC_USEDIALINGRULES, BM_GETCHECK, 0, 0);
04525
04526                     bHistoryValid = TRUE;
04527
04528                     EndDialog(hwndDlg, TRUE);
04529                     return TRUE;
04530                 }
04531
04532
04533                 // This message is actually posted to the dialog from the
04534                 // lineCallbackFunc when it receives a
04535                 // LINEDEVSTATE_TRANSLATECHANGE message.  Notify the user and
04536                 // retranslate the number.  Also refill the Location Info
04537                 // since this could have been generated by a location change.
04538                 case IDC_CONFIGURATIONCHANGED:
04539                 {
04540                     FillLocationInfo(hwndDlg, NULL, NULL, NULL);
04541                     DisplayPhoneNumber(hwndDlg);
04542
04543                     MessageBox(hwndDlg,
04544                         "Location Configuration has been changed.",
04545                         "Warning",MB_OK);
04546
04547                     return TRUE;
04548                 }
04549
04550                 // If we get a LINE_CREATE message, all that needs to be done
04551                 // is to reset this controls contents.  The selected line
04552                 // won't change and no lines will be removed.
04553                 case IDC_LINECREATE:
04554                 {
04555                     FillTAPILine(hwndDlg);
04556                     return TRUE;
04557                 }
04558
04559                 default:
04560                     break;
04561             }
04562
04563             break;
04564         }
04565
04566         // This dialog has the DS_CONTEXTMENU flag so that the right mouse
04567         // button will send this message.  Bring up the appropriate help page.
04568         case WM_CONTEXTMENU:
04569         {
04570
04571             if (hwndDlg != (HWND) wParam)
04572                 WinHelp ((HWND)wParam,
04573                     "TAPICOMM.HLP",
04574                      HELP_CONTEXTMENU,
04575                     (DWORD_PTR)(LPVOID) g_adwSampleMenuHelpIDs);
04576             break;
04577         }
04578
04579         // Bring up the appropriate help page.
04580         case WM_HELP:
04581         {
04582             LPHELPINFO lphi;
04583
04584             lphi = (LPHELPINFO)lParam;
04585             if ((lphi->iContextType == HELPINFO_WINDOW) &&
04586                 (hwndDlg != lphi->hItemHandle) &&
04587                 (lphi->iCtrlId < IDC_NOHELPCONTROLS))
04588             {
04589                 WinHelp (lphi->hItemHandle,
04590                     "TAPICOMM.HLP",
04591                     HELP_WM_HELP,
04592                     (DWORD_PTR)(LPVOID) g_adwSampleMenuHelpIDs);
04593             }
04594
04595           return TRUE;
04596         }
04597
04598         default:
04599             break;
04600     }
04601
04602     return FALSE;
04603 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ipv4_option_hdr Member List

This is the complete list of members for ipv4_option_hdr, including all inherited members.
opt_addr | ipv4_option_hdr
opt_code | ipv4_option_hdr
opt_len | ipv4_option_hdr
opt_ptr | ipv4_option_hdr
Generated on Wed Nov 13 2024 16:57:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/resource.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resource.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDI_APP_ICON                    108
00012 #define IDB_LGBMP                       112
00013 #define IDB_APPIMG_32                   112
00014 #define IDB_SMBMP                       113
00015 #define IDB_APPIMG_16                   113
00016 #define IDB_SMOPEN                      114
00017 #define IDR_SMICONS                     120
00018 #define IDR_LGICONS                     121
00019 #define IDB_ROCKET                      40004
00020 #define IDB_CAR                         40005
00021 #define IDB_PLANE                       40006
00022 #define IDB_BIKE                        40007
00023 #define IDB_ROCKET2                     40008
00024 #define IDB_CAR2                        40009
00025 #define IDB_PLANE2                      40010
00026 #define IDB_BIKE2                       40011
00027 #define IDB_CLOSED2                     40012
00028 #define IDB_OPEN2                       40013
00029 #define IDB_CLOSED                      40014
00030 #define IDB_OPEN                        40015
00031
00032 // Next default values for new objects
00033 //
00034 #ifdef APSTUDIO_INVOKED
00035 #ifndef APSTUDIO_READONLY_SYMBOLS
00036 #define _APS_NEXT_RESOURCE_VALUE        115
00037 #define _APS_NEXT_COMMAND_VALUE         40016
00038 #define _APS_NEXT_CONTROL_VALUE         1000
00039 #define _APS_NEXT_SYMED_VALUE           101
00040 #endif
00041 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/csharp_draw/assemblyinfo.cs Source File

  • NetDS
  • MessageQueuing
  • csharp_draw

assemblyinfo.cs

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 using System.Reflection;
00013 using System.Runtime.CompilerServices;
00014
00015 //
00016 // General Information about an assembly is controlled through the following
00017 // set of attributes. Change these attribute values to modify the information
00018 // associated with an assembly.
00019 //
00020 [assembly: AssemblyTitle("")]
00021 [assembly: AssemblyDescription("")]
00022 [assembly: AssemblyConfiguration("")]
00023 [assembly: AssemblyCompany("")]
00024 [assembly: AssemblyProduct("")]
00025 [assembly: AssemblyCopyright("")]
00026 [assembly: AssemblyTrademark("")]
00027 [assembly: AssemblyCulture("")]
00028
00029 //
00030 // Version information for an assembly consists of the following four values:
00031 //
00032 //      Major Version
00033 //      Minor Version
00034 //      Build Number
00035 //      Revision
00036 //
00037 // You can specify all the values or you can default the Revision and Build Numbers
00038 // by using the '*' as shown below:
00039
00040 [assembly: AssemblyVersion("1.0.*")]
00041
00042 //
00043 // In order to sign your assembly you must specify a key to use. Refer to the
00044 // Microsoft .NET Framework documentation for more information on assembly signing.
00045 //
00046 // Use the attributes below to control which key is used for signing.
00047 //
00048 // Notes:
00049 //   (*) If no key is specified - the assembly cannot be signed.
00050 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00051 //       Provider (CSP) on your machine.
00052 //   (*) If the key file and a key name attributes are both specified, the
00053 //       following processing occurs:
00054 //       (1) If the KeyName can be found in the CSP - that key is used.
00055 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00056 //           in the file is installed into the CSP and used.
00057 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00058 //       documentation for more information on this.
00059 //
00060 [assembly: AssemblyDelaySign(false)]
00061 [assembly: AssemblyKeyFile("")]
00062 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/tracemacro.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

tracemacro.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  TraceMacro.h : Defines custom tracing helpers.
00014 //
00015
00016
00017 #ifndef _TRACE_MACRO_HEADER_
00018 #define _TRACE_MACRO_HEADER_
00019
00020 //---------------------------------------------------------------------------
00021 //  Function prototypes
00022 //
00023 VOID Trace_Start( LPCTSTR pszClass, LPCTSTR pszFunction );
00024 VOID Trace_HR( LPCTSTR pszClass, LPCTSTR pszFunction, HRESULT hr );
00025 VOID Trace_Value( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszValueName, LONG nValue );
00026 VOID Trace_Pointer( LPCTSTR pszClass, LPCTSTR pszFunction, LPCTSTR pszAction, ULONG ulValue );
00027 VOID Trace_Event( LPCTSTR pszClass, LPCTSTR pszFunction, LONG nEvent );
00028 VOID MapEvent( LONG Event, LPTSTR szEventStr );
00029
00030
00031 // Alternate version provides complete path to the file
00032 // #define TRACE_HRESULT(str,hr)  Trace_HR( _T(__FILE__), (str), (hr) )
00033
00034 #ifdef _DEBUG
00035
00036 #undef  TRACE_HRESULT
00037 #define TRACE_HRESULT(s1,hr) Trace_HR( (MODULESTRING),(s1),(hr) )
00038
00039 #undef  TRACE_VAL
00040 #define TRACE_VAL(s1,s2,val) Trace_Value( (MODULESTRING),(s1),(s2),(val) )
00041
00042 #undef  TRACE_PTR
00043 #define TRACE_PTR(s1,s2,val) Trace_Pointer( (MODULESTRING),(s1),(s2),(val) )
00044
00045 #undef  TRACE_EVENT
00046 #define TRACE_EVENT(s1,val)  Trace_Event( (MODULESTRING),(s1),(val) )
00047
00048 #undef  TRACE_START
00049 #define TRACE_START( s1 )    Trace_Start( (MODULESTRING),(s1) )
00050
00051
00052 #else
00053
00054 #undef  TRACE_HRESULT
00055 #define TRACE_HRESULT
00056
00057 #undef  TRACE_VAL
00058 #define TRACE_VAL
00059
00060 #undef  TRACE_PTR
00061 #define TRACE_PTR
00062
00063 #undef  TRACE_EVENT
00064 #define TRACE_EVENT
00065
00066 #undef  TRACE_START
00067 #define TRACE_START
00068
00069 #endif //_DEBUG
00070
00071
00072 #endif //_TRACE_MACRO_HEADER_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share Sample/ClRes.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share Sample

ClRes.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ClRes.cpp
00007 //
00008 //  Description:
00009 //      Entry point module for resource type DLL.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 //////////////////////////////////////////////////////////////////////////////
00021 // Include Files
00022 //////////////////////////////////////////////////////////////////////////////
00023
00024 #include "ClRes.h"
00025
00026 //
00027 // Global data.
00028 //
00029
00030 HINSTANCE g_hInstance = NULL;
00031
00032 // Event Logging routine.
00033 PLOG_EVENT_ROUTINE g_pfnLogEvent = NULL;
00034
00035 // Resource Status routine for pending Online and Offline calls.
00036 PSET_RESOURCE_STATUS_ROUTINE g_pfnSetResourceStatus = NULL;
00037
00038 //
00039 // Function prototypes.
00040 //
00041
00042 BOOL WINAPI DllMain(
00043       HINSTANCE hInstanceIn
00044     , DWORD     nReasonIn
00045     , LPVOID    ReservedIn
00046     );
00047
00048 DWORD WINAPI Startup(
00049       LPCWSTR                       pwszResourceTypeIn
00050     , DWORD                         nMinVersionSupportedIn
00051     , DWORD                         nMaxVersionSupportedIn
00052     , PSET_RESOURCE_STATUS_ROUTINE  pfnSetResourceStatusIn
00053     , PLOG_EVENT_ROUTINE            pfnLogEventIn
00054     , PCLRES_FUNCTION_TABLE *       pFunctionTableOut
00055     );
00056
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 //++
00060 //
00061 //  DllMain
00062 //
00063 //  Description:
00064 //      Main DLL entry point.
00065 //
00066 //  Arguments:
00067 //      hInstanceIn
00068 //          DLL instance handle.
00069 //
00070 //      nReasonIn
00071 //          Reason for being called.
00072 //
00073 //      ReservedIn
00074 //          Reserved argument.
00075 //
00076 //  Return Value:
00077 //      TRUE
00078 //          Success.
00079 //
00080 //      FALSE
00081 //          Failure.
00082 //
00083 //--
00084 /////////////////////////////////////////////////////////////////////////////
00085 BOOL WINAPI
00086 DllMain(
00087       HINSTANCE   hInstanceIn
00088     , DWORD       nReasonIn
00089     , LPVOID      ReservedIn
00090     )
00091 {
00092     BOOL    fSuccess = TRUE;
00093
00094     //
00095     // Perform global initialization.
00096     //
00097
00098     switch ( nReasonIn )
00099     {
00100         case DLL_PROCESS_ATTACH:
00101             g_hInstance = hInstanceIn;
00102             DisableThreadLibraryCalls( hInstanceIn );
00103             break;
00104
00105         case DLL_PROCESS_DETACH:
00106             break;
00107
00108     } // switch: nReason
00109
00110     //
00111     // Pass this request off to the resource type-specific routines.
00112     //
00113
00114     fSuccess = FileShareSampleDllMain( hInstanceIn, nReasonIn, ReservedIn );
00115
00116     return fSuccess;
00117
00118 } //*** DllMain
00119
00120
00121 /////////////////////////////////////////////////////////////////////////////
00122 //++
00123 //
00124 //  Startup
00125 //
00126 //  Description:
00127 //      Startup the resource DLL. This routine verifies that at least one
00128 //      currently supported version of the resource DLL is between
00129 //      nMinVersionSupported and nMaxVersionSupported. If not, then the
00130 //      resource DLL should return ERROR_REVISION_MISMATCH.
00131 //
00132 //      If more than one version of the resource DLL interface is supported
00133 //      by the resource DLL, then the highest version (up to
00134 //      nMaxVersionSupported) should be returned as the resource DLL's
00135 //      interface. If the returned version is not within range, then startup
00136 //      fails.
00137 //
00138 //      The Resource Type is passed in so that if the resource DLL supports
00139 //      more than one Resource Type, it can pass back the correct function
00140 //      table associated with the Resource Type.
00141 //
00142 //  Arguments:
00143 //      pwszResourceTypeIn
00144 //          Type of resource requesting a function table.
00145 //
00146 //      nMinVersionSupportedIn
00147 //          Minimum resource DLL interface version supported by the cluster
00148 //          software.
00149 //
00150 //      nMaxVersionSupportedIn
00151 //          Maximum resource DLL interface version supported by the cluster
00152 //          software.
00153 //
00154 //      pfnSetResourceStatusIn
00155 //          Pointer to a routine that the resource DLL should call to update
00156 //          the state of a resource after the Online or Offline routine
00157 //          have returned a status of ERROR_IO_PENDING.
00158 //
00159 //      pfnLogEventIn
00160 //          Pointer to a routine that handles the reporting of events from
00161 //          the resource DLL.
00162 //
00163 //      pFunctionTableOut
00164 //          Returns a pointer to the function table defined for the version
00165 //          of the resource DLL interface returned by the resource DLL.
00166 //
00167 //  Return Value:
00168 //      ERROR_SUCCESS
00169 //          The operation was successful.
00170 //
00171 //      ERROR_CLUSTER_RESNAME_NOT_FOUND
00172 //          The resource type name is unknown by this DLL.
00173 //
00174 //      ERROR_REVISION_MISMATCH
00175 //          The version of the cluster service doesn't match the version of
00176 //          the DLL.
00177 //
00178 //      Win32 error code
00179 //          The operation failed.
00180 //
00181 //--
00182 /////////////////////////////////////////////////////////////////////////////
00183 DWORD WINAPI
00184 Startup(
00185       LPCWSTR                         pwszResourceTypeIn
00186     , DWORD                           nMinVersionSupportedIn
00187     , DWORD                           nMaxVersionSupportedIn
00188     , PSET_RESOURCE_STATUS_ROUTINE    pfnSetResourceStatusIn
00189     , PLOG_EVENT_ROUTINE              pfnLogEventIn
00190     , PCLRES_FUNCTION_TABLE *         pFunctionTableOut
00191     )
00192 {
00193     DWORD   sc = ERROR_CLUSTER_RESNAME_NOT_FOUND;
00194
00195     //
00196     // Save the function pointers if they haven't been saved yet.
00197     //
00198
00199     if ( g_pfnLogEvent == NULL )
00200     {
00201         g_pfnLogEvent = pfnLogEventIn;
00202         g_pfnSetResourceStatus = pfnSetResourceStatusIn;
00203     } // if: function pointers specified
00204
00205     //
00206     // Call the resource type-specific Startup routine.
00207     //
00208
00209     if ( NIStringCompareW( pwszResourceTypeIn, RESTYPE_NAME, RTL_NUMBER_OF( RESTYPE_NAME ) ) == 0 )
00210     {
00211         sc = FileShareSampleStartup(
00212                   pwszResourceTypeIn
00213                 , nMinVersionSupportedIn
00214                 , nMaxVersionSupportedIn
00215                 , pfnSetResourceStatusIn
00216                 , pfnLogEventIn
00217                 , pFunctionTableOut
00218                 );
00219     } // if: File Share Sample resource type
00220
00221     return sc;
00222
00223 } //*** Startup
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

util::DatabaseSettings Member List

This is the complete list of members for util::DatabaseSettings, including all inherited members.
DSN | util::DatabaseSettings | [static]
pass | util::DatabaseSettings | [static]
User | util::DatabaseSettings | [static]
Generated on Wed Nov 13 2024 16:58:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows.Net/module.h Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows.Net

module.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 1999
00005 //
00006 // File:        module.h
00007 //
00008 // Contents:    CCertManageExitModuleSample definition
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "certxsam.h"
00013 #include "resource.h"       // main symbols
00014
00015
00016 class CCertManageExitModuleSample:
00017     public CComDualImpl<ICertManageModule, &IID_ICertManageModule, &LIBID_CERTEXITSAMPLELib>,
00018     public CComObjectRoot,
00019     public CComCoClass<CCertManageExitModuleSample, &CLSID_CCertManageExitModuleSample>
00020 {
00021 public:
00022     CCertManageExitModuleSample() {}
00023     ~CCertManageExitModuleSample() {}
00024
00025 BEGIN_COM_MAP(CCertManageExitModuleSample)
00026     COM_INTERFACE_ENTRY(IDispatch)
00027     COM_INTERFACE_ENTRY(ICertManageModule)
00028 END_COM_MAP()
00029
00030 DECLARE_NOT_AGGREGATABLE(CCertManageExitModuleSample)
00031 // Remove the comment from the line above if you don't want your object to
00032 // support aggregation.  The default is to support it
00033
00034 // UNDONE UNDONE
00035 DECLARE_REGISTRY(
00036     CCertManageExitModuleSample,
00037     wszCLASS_CERTMANAGEEXITMODULESAMPLE TEXT(".1"),
00038     wszCLASS_CERTMANAGEEXITMODULESAMPLE,
00039     IDS_CERTMANAGEEXITMODULE_DESC,
00040     THREADFLAGS_BOTH)
00041
00042 // ICertManageModule
00043 public:
00044     STDMETHOD (GetProperty) (
00045             /* [in] */ const BSTR strConfig,
00046             /* [in] */ BSTR strStorageLocation,
00047             /* [in] */ BSTR strPropertyName,
00048             /* [in] */ LONG dwFlags,
00049             /* [retval][out] */ VARIANT __RPC_FAR *pvarProperty);
00050
00051     STDMETHOD (SetProperty)(
00052             /* [in] */ const BSTR strConfig,
00053             /* [in] */ BSTR strStorageLocation,
00054             /* [in] */ BSTR strPropertyName,
00055             /* [in] */ LONG dwFlags,
00056             /* [in] */ VARIANT const __RPC_FAR *pvarProperty);
00057
00058     STDMETHOD (Configure)(
00059             /* [in] */ const BSTR strConfig,
00060             /* [in] */ BSTR strStorageLocation,
00061             /* [in] */ LONG dwFlags);
00062 };
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/Resource.h Source File

  • NetDS
  • MessageQueuing
  • c_draw

Resource.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 //{{NO_DEPENDENCIES}}
00013 // Microsoft Developer Studio generated include file.
00014 // Used by disdraw.rc
00015 //
00016 #define IDC_CONTINUE                    3
00017 #define IDD_DISDRAW_DIALOG              102
00018 #define IDR_MAINFRAME                   128
00019 #define IDD_LOGIN                       129
00020 #define IDC_EDIT_FRIEND                 1000
00021 #define IDC_BUTTON_ATTACH               1001
00022 #define IDC_RADIO_EXPRESS               1002
00023 #define IDC_RADIO_RECOVERABLE           1003
00024 #define IDC_DRAWAREA_SCRIBLLE           1004
00025 #define IDC_EDIT_LOGIN                  1005
00026 #define IDC_EDIT_FRIEND_COMPUTER        1005
00027 #define IDC_RADIO_DS                    1006
00028 #define IDC_RADIO_WORKGROUP             1007
00029 #define IDC_STATIC_CHOOSE_DS            1009
00030 #define IDC_STATIC_Q_LABEL              1010
00031 #define IDC_STATIC_CHOOSE_MESSAGE       1011
00032 #define IDC_STATIC_C_LABEL              1012
00033
00034 // Next default values for new objects
00035 //
00036 #ifdef APSTUDIO_INVOKED
00037 #ifndef APSTUDIO_READONLY_SYMBOLS
00038 #define _APS_NEXT_RESOURCE_VALUE        130
00039 #define _APS_NEXT_COMMAND_VALUE         32771
00040 #define _APS_NEXT_CONTROL_VALUE         1013
00041 #define _APS_NEXT_SYMED_VALUE           101
00042 #endif
00043 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Read/vc/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Read
  • vc

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  Read.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/pstore.cpp Source File

  • WinUI
  • TSFmark

pstore.cpp

Go to the documentation of this file.
00001 //
00002 // pstore.cpp
00003 //
00004 // CCustomPropertyStore implementation, ITfPropertyStore example.
00005 //
00006
00007 #include "globals.h"
00008 #include "pstore.h"
00009 #include "mark.h"
00010
00011 //+---------------------------------------------------------------------------
00012 //
00013 // ctor
00014 //
00015 //----------------------------------------------------------------------------
00016
00017 CCustomPropertyStore::CCustomPropertyStore()
00018 {
00019     // assign some arbitrary state to this object, for demonstration purposes
00020     _dwState = GetTickCount();
00021
00022     DllAddRef();
00023     _cRef = 1;
00024 }
00025
00026 //+---------------------------------------------------------------------------
00027 //
00028 // dtor
00029 //
00030 //----------------------------------------------------------------------------
00031
00032 CCustomPropertyStore::~CCustomPropertyStore()
00033 {
00034     DllRelease();
00035 }
00036
00037 //+---------------------------------------------------------------------------
00038 //
00039 // QueryInterface
00040 //
00041 //----------------------------------------------------------------------------
00042
00043 STDAPI CCustomPropertyStore::QueryInterface(REFIID riid, void **ppvObj)
00044 {
00045     if (ppvObj == NULL)
00046         return E_INVALIDARG;
00047
00048     *ppvObj = NULL;
00049
00050     if (IsEqualIID(riid, IID_IUnknown) ||
00051         IsEqualIID(riid, IID_ITfPropertyStore))
00052     {
00053         *ppvObj = (ITfPropertyStore *)this;
00054     }
00055
00056     if (*ppvObj)
00057     {
00058         AddRef();
00059         return S_OK;
00060     }
00061
00062     return E_NOINTERFACE;
00063 }
00064
00065
00066 //+---------------------------------------------------------------------------
00067 //
00068 // AddRef
00069 //
00070 //----------------------------------------------------------------------------
00071
00072 STDAPI_(ULONG) CCustomPropertyStore::AddRef()
00073 {
00074     return ++_cRef;
00075 }
00076
00077 //+---------------------------------------------------------------------------
00078 //
00079 // Release
00080 //
00081 //----------------------------------------------------------------------------
00082
00083 STDAPI_(ULONG) CCustomPropertyStore::Release()
00084 {
00085     LONG cr = --_cRef;
00086
00087     assert(_cRef >= 0);
00088
00089     if (_cRef == 0)
00090     {
00091         delete this;
00092     }
00093
00094     return cr;
00095 }
00096
00097 //+---------------------------------------------------------------------------
00098 //
00099 // GetType
00100 //
00101 // Returns the GUID of the property this store is assigned to.
00102 //----------------------------------------------------------------------------
00103
00104 STDAPI CCustomPropertyStore::GetType(GUID *pguidType)
00105 {
00106     *pguidType = c_guidCustomProperty;
00107     return S_OK;
00108 }
00109
00110 //+---------------------------------------------------------------------------
00111 //
00112 // GetDataType
00113 //
00114 //----------------------------------------------------------------------------
00115
00116 STDAPI CCustomPropertyStore::GetDataType(DWORD *pdwReserved)
00117 {
00118     // this method is reserved, pdwReserved must be set 0
00119     *pdwReserved = 0;
00120     return S_OK;
00121 }
00122
00123 //+---------------------------------------------------------------------------
00124 //
00125 // GetData
00126 //
00127 // Returns the data held by this store.
00128 //----------------------------------------------------------------------------
00129
00130 STDAPI CCustomPropertyStore::GetData(VARIANT *pvarValue)
00131 {
00132     pvarValue->vt = VT_I4; // dword value for this store
00133     pvarValue->lVal = _dwState;
00134     return S_OK;
00135 }
00136
00137 //+---------------------------------------------------------------------------
00138 //
00139 // OnTextUpdated
00140 //
00141 // Called by TSF when the text covered by this store is modified.
00142 //----------------------------------------------------------------------------
00143
00144 STDAPI CCustomPropertyStore::OnTextUpdated(DWORD dwFlags, ITfRange *pRangeNew, BOOL *pfAccept)
00145 {
00146     // we will throw away this store (give up) anytime the text is modified.
00147     // If we did set pfAccept TRUE, the store would be maintained.
00148     *pfAccept = FALSE;
00149     return S_OK;
00150 }
00151
00152 //+---------------------------------------------------------------------------
00153 //
00154 // Shrink
00155 //
00156 // Called when the text covered by this store is truncated.
00157 //----------------------------------------------------------------------------
00158
00159 STDAPI CCustomPropertyStore::Shrink(ITfRange *pRangeNew, BOOL *pfFree)
00160 {
00161     // give up and free this store
00162     *pfFree = TRUE;
00163     return S_OK;
00164 }
00165
00166 //+---------------------------------------------------------------------------
00167 //
00168 // Divide
00169 //
00170 // Called when text covered by the store is deleted, such that the store is
00171 // split in two.  We have the option of freeing the store, or keeping the
00172 // store which moves to cover just pRangeThis (the leftmost text) in which
00173 // case we must provide a new store for the rightmost text as well.
00174 //----------------------------------------------------------------------------
00175
00176 STDAPI CCustomPropertyStore::Divide(ITfRange *pRangeThis, ITfRange *pRangeNew, ITfPropertyStore **ppPropertyStore)
00177 {
00178     // just give up
00179     // a NULL ppPropertyStore tells TSF to release this store
00180     *ppPropertyStore = NULL;
00181     return S_OK;
00182 }
00183
00184 //+---------------------------------------------------------------------------
00185 //
00186 // Clone
00187 //
00188 // Return a new store with a copy of this store's state.
00189 //----------------------------------------------------------------------------
00190
00191 STDAPI CCustomPropertyStore::Clone(ITfPropertyStore **ppCloneOut)
00192 {
00193     CCustomPropertyStore *pClone;
00194
00195     *ppCloneOut = NULL;
00196
00197     if ((pClone = new CCustomPropertyStore) == NULL)
00198         return E_OUTOFMEMORY;
00199
00200     pClone->_dwState = _dwState;
00201
00202     *ppCloneOut = pClone;
00203
00204     return S_OK;
00205 }
00206
00207 //+---------------------------------------------------------------------------
00208 //
00209 // GetPropertyRangeCreator
00210 //
00211 // Returns the owning text service.  Used by TSF during Unserialization.
00212 //----------------------------------------------------------------------------
00213
00214 STDAPI CCustomPropertyStore::GetPropertyRangeCreator(CLSID *pclsid)
00215 {
00216     *pclsid = c_clsidMarkTextService;
00217     return S_OK;
00218 }
00219
00220 //+---------------------------------------------------------------------------
00221 //
00222 // Serialize
00223 //
00224 // Copy this store's state to a binary stream.  This stream will later be returned
00225 // to this text service to recreate the store in a later session.
00226 //----------------------------------------------------------------------------
00227
00228 STDAPI CCustomPropertyStore::Serialize(IStream *pStream, ULONG *pcb)
00229 {
00230     return pStream->Write(&_dwState, sizeof(_dwState), pcb);
00231 }
00232
00233 //+---------------------------------------------------------------------------
00234 //
00235 // IsStoreSerializable
00236 //
00237 //----------------------------------------------------------------------------
00238
00239 STDAPI CMarkTextService::IsStoreSerializable(REFGUID guidProperty, ITfRange *pRange, ITfPropertyStore *pPropertyStore, BOOL *pfSerializable)
00240 {
00241     // we don't have any complicated logic, we'll let all our custom property values be serialized
00242     *pfSerializable = IsEqualGUID(guidProperty, c_guidCustomProperty);
00243     return S_OK;
00244 }
00245
00246 //+---------------------------------------------------------------------------
00247 //
00248 // CreatePropertyStore
00249 //
00250 // Unserializes a custom property.
00251 //----------------------------------------------------------------------------
00252
00253 STDAPI CMarkTextService::CreatePropertyStore(REFGUID guidProperty, ITfRange *pRange, ULONG cb, IStream *pStream, ITfPropertyStore **ppStore)
00254 {
00255     CCustomPropertyStore *pStore;
00256     DWORD dwState;
00257
00258     *ppStore = NULL;
00259
00260     if (!IsEqualGUID(guidProperty, c_guidCustomProperty))
00261         return E_INVALIDARG;
00262
00263     if (cb != sizeof(DWORD))
00264         return E_INVALIDARG;
00265
00266     if ((pStore = new CCustomPropertyStore) == NULL)
00267         return E_OUTOFMEMORY;
00268
00269     if (pStream->Read(&dwState, sizeof(DWORD), &cb) != S_OK || cb != sizeof(DWORD))
00270     {
00271         pStore->Release();
00272         return E_FAIL;
00273     }
00274
00275     pStore->_SetState(dwState);
00276     *ppStore = pStore;
00277
00278     return S_OK;
00279 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ClientList::_tag_LIST_NODE Member List

This is the complete list of members for ClientList::_tag_LIST_NODE, including all inherited members.
pClient | ClientList::_tag_LIST_NODE
pNext | ClientList::_tag_LIST_NODE
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/virtualfile.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

virtualfile.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Implements our virtual file class derived from CBaseNode.  This
00014 //             class will represent our result items
00015 //
00016
00017 #include "VirtualFile.h"
00018 #include "FolderNode.h"
00019 #include "Globals.h"
00020 #include "CompData.h"
00021 #include "Comp.h"
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CVirtualFile")
00026
00027
00028 // Initialize our static GUID just once
00029 GUID CVirtualFile::thisGUID = CLSID_CVirtualFile;
00030
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // Construction/Destruction
00034
00035 //---------------------------------------------------------------------------
00036 CVirtualFile::CVirtualFile()
00037 {
00038   m_RDI.mask      = DEFAULT_RDI_MASK;
00039   m_RDI.str       = MMC_CALLBACK;
00040   m_RDI.nImage    = IMG_DATA_FILE;
00041   m_RDI.lParam    = reinterpret_cast<LPARAM>(this);
00042
00043   m_dwAttributes  = 0;
00044   m_pParentFolder = NULL;
00045   m_pCompData     = NULL;
00046 }
00047
00048 //---------------------------------------------------------------------------
00049 CVirtualFile::~CVirtualFile()
00050 {
00051 }
00052
00053 //---------------------------------------------------------------------------
00054 HRESULT CVirtualFile::Initialize
00055 (
00056   LPNODEPROPS  pNodeProps    //[in] Properties for this node
00057 )
00058 {
00059   _ASSERT( NULL != pNodeProps );
00060
00061   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00062   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00063   wcscpy( pszTmp, pNodeProps->szNodeName );
00064   if( NULL != m_pwszNodeName )
00065     CoTaskMemFree( m_pwszNodeName );
00066
00067   m_pwszNodeName  = pszTmp;
00068   m_pParentFolder = reinterpret_cast<CFolderNode*>(pNodeProps->pParentObject);
00069   m_pCompData     = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00070   m_dwAttributes  = pNodeProps->dwAttributes;
00071
00072   return S_OK;
00073 }
00074
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // Implementation of virtual methods
00078
00079 //---------------------------------------------------------------------------
00080 //  DRAGDROP:  This method supports the CCF_NODEPROP_PTR clipboard format.
00081 //             The Node Properties struct is allocated in global memory so
00082 //             so that interproccess CUT/COPY/PASTE will work.
00083 //             The caller is responsible for freeing the memory.
00084 //
00085 HRESULT CVirtualFile::GetProperties
00086 (
00087   LPNODEPROPS* ppNodeProps   //[out] Properties of this node
00088 )
00089 {
00090   _ASSERT( NULL == *ppNodeProps );
00091
00092   LONG nBlockSize = sizeof(NODEPROPS);
00093   LPNODEPROPS pTmpProps = NULL;
00094   HGLOBAL hMemory = ::GlobalAlloc( GMEM_SHARE | GMEM_MOVEABLE, nBlockSize );
00095   if( NULL == hMemory )
00096     return E_OUTOFMEMORY;
00097
00098   pTmpProps = (LPNODEPROPS)::GlobalLock( hMemory );
00099   ZeroMemory( pTmpProps, nBlockSize );
00100   wcscpy( pTmpProps->szNodeName,  m_pwszNodeName );
00101   pTmpProps->pComponentData = NULL;    // Pointers not used for DragDrop
00102   pTmpProps->pParentObject  = NULL;
00103   pTmpProps->dwAttributes   = m_dwAttributes;
00104   pTmpProps->nChildCount    = 0;       // Result nodes don't have children
00105   pTmpProps->nBlockSize     = nBlockSize;
00106
00107   ::GlobalUnlock( pTmpProps );
00108   *ppNodeProps = pTmpProps;            // Return the properties
00109
00110   return S_OK;
00111 }
00112
00113 //---------------------------------------------------------------------------
00114 HRESULT CVirtualFile::GetDisplayInfo
00115 (
00116   RESULTDATAITEM* pRDI       //[in-out] RESULTDATAITEM struct
00117 )
00118 {
00119   HRESULT hResult = S_OK;
00120
00121   if( pRDI->mask & RDI_STR )         // Console is requesting strings...
00122   {                                  // for each column
00123     switch( pRDI->nCol )
00124     {
00125       case 0:
00126         pRDI->str = m_pwszNodeName;
00127         break;
00128
00129       case 1:                        // Display attributes as a string
00130         pRDI->str = GetAttributeString();
00131         break;
00132
00133       default:
00134         hResult = S_FALSE;
00135         TRACE_VAL(_T("GetDisplayInfo"), _T("Column"), pRDI->nCol );
00136         break;
00137     }
00138   }
00139
00140   if( pRDI->mask & RDI_IMAGE )       // Looking for an image?
00141   {
00142     pRDI->nImage = m_RDI.nImage;
00143   }
00144
00145   //TRACE_HRESULT(_T("GetDisplayInfo"), hResult );
00146   return hResult;
00147 }
00148
00149
00150 /////////////////////////////////////////////////////////////////////////////
00151 // Implementation of virtual methods
00152
00153
00154 //---------------------------------------------------------------------------
00155 HRESULT CVirtualFile::OnSelect
00156 (
00157   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00158   LPARAM        nArg,          //[in] Bools for context & selection state
00159   LPARAM        nParam,        //[in] Not used
00160   LONG_PTR      pComponent     //[in] Points calling CComponent
00161 )
00162 {
00163   HRESULT hResult = S_FALSE;
00164
00165   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00166
00167   IConsoleVerb* ipConsoleVerb = NULL;
00168   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00169   if( S_OK == hResult )
00170   {
00171     // DRAGDROP: Add MMC_VERB_CUT/COPY/PASTE verbs for this object.
00172     //
00173     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_CUT,   ENABLED, TRUE );
00174     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_COPY,  ENABLED, TRUE );
00175     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_PASTE, ENABLED, TRUE );
00176
00177     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_RENAME, ENABLED, TRUE );
00178   }
00179   //TRACE_HRESULT(_T("OnSelect"), hResult );
00180   return hResult;
00181 }
00182
00183
00184 //---------------------------------------------------------------------------
00185 HRESULT CVirtualFile::OnShow
00186 (
00187   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00188   LPARAM        nArg,          //[in] TRUE if node was selcted
00189   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00190   LONG_PTR      pComponent     //[in] Points calling CComponent
00191 )
00192 {
00193   HRESULT  hResult = S_FALSE;
00194   //TRACE_HRESULT(_T("OnShow"), hResult );
00195   return hResult;
00196 }
00197
00198 //---------------------------------------------------------------------------
00199 //  The parent node just AddRef'd the data object which we don't use,
00200 //  so we can just let MMC release it.
00201 //  We just tell the parent node to remove it's pointer to us from it's
00202 //  list of children, then we can delete ourselves.
00203 //
00204 HRESULT CVirtualFile::OnCutOrMove
00205 (
00206   LPDATAOBJECT ipDataObject, //[in] NULL
00207   LPARAM       nArg,         //[in] Pointer to data object
00208   LPARAM       nParam,       //[in] Not used
00209   LONG_PTR     pComponent    //[in] Points calling CComponent
00210 )
00211 {
00212   _ASSERT( NULL != m_pParentFolder );
00213   HRESULT hResult = S_FALSE;
00214
00215   m_pParentFolder->RemoveChildNode( reinterpret_cast<LONG_PTR>(this) );
00216
00217   LPRESULTDATA ipResultData = NULL;
00218   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00219   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00220   if( S_OK == hResult )
00221   {
00222     hResult = ipResultData->DeleteItem( m_RDI.itemID, 0 );
00223     delete this;
00224   }
00225   return hResult;
00226 }
00227
00228 //---------------------------------------------------------------------------
00229 //  This message must return S_OK to allow the rename.  Anything else will
00230 //  disallow the rename
00231 //
00232 HRESULT CVirtualFile::OnRename
00233 (
00234   LPDATAOBJECT ipDataObject,   //[in] Points to Data Object
00235   LPARAM       nArg,           //[in] Not used
00236   LPARAM       nParam,         //[in] Pointer to the new name
00237   LONG_PTR     pComponent      //[in] Points to calling IComponent
00238 )
00239 {
00240   _ASSERT( NULL != ipDataObject );
00241   HRESULT hResult = S_OK;
00242
00243   LPWSTR pszTmpName = NULL;
00244   LPWSTR pszNewName = (LPWSTR)nParam;  // New name
00245   LONG   nLen = wcslen( pszNewName ) + 1;
00246
00247   pszTmpName = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00248   if( NULL == pszTmpName )
00249   {
00250     hResult = S_FALSE;                 // Can't change the name
00251   }
00252   else
00253   {
00254     wcscpy( pszTmpName, pszNewName );
00255     CoTaskMemFree( m_pwszNodeName );   // Free existing name...
00256     m_pwszNodeName = pszTmpName;       // Assign new name to pointer
00257   }
00258
00259   return hResult;
00260 }
00261
00262 /////////////////////////////////////////////////////////////////////////////
00263 // DRAGDROP:  Support for DragDrop on result pane items.
00264
00265 //---------------------------------------------------------------------------
00266 //  MMC20: nParam has changed to a DWORD* which can be used to specify
00267 //         the default behaviour of DragDrop.
00268 //         We disallow copy/paste to ourself, and only accept other
00269 //         VFiles as source objects.
00270 //
00271 HRESULT CVirtualFile::OnQueryPaste
00272 (
00273   LPDATAOBJECT ipTargetDO,     //[in] Data object of the selected node
00274   LPARAM       nArg,           //[in] Data object of node to be pasted
00275   LPARAM       nParam,         //[in] DWORD* which specifies default operation
00276   LONG_PTR     pComponent      //[in] Points to calling IComponent
00277 )
00278 {
00279   _ASSERT( NULL != nArg );
00280   HRESULT hResult = S_FALSE;
00281
00282   // Make the default operation "Copy Here" as opposed to "Move Here"
00283   //
00284   DWORD* pdwDefaultOperation = reinterpret_cast<DWORD*>(nParam);
00285   *pdwDefaultOperation = MMC_DEFAULT_OPERATION_COPY;
00286
00287   // Disallow pasting on top of ourself
00288   //
00289   CBaseNode* pNode1 = ExtractBaseNodePtr( ipTargetDO );
00290   CBaseNode* pNode2 = ExtractBaseNodePtr( reinterpret_cast<LPDATAOBJECT>(nArg) );
00291   if( pNode1 == pNode2 )
00292     return S_FALSE;
00293
00294   // Only allow other VFiles as source objects
00295   //
00296   ULONG nTypeFlag = ExtractNodeTypeFlg( reinterpret_cast<LPDATAOBJECT>(nArg) );
00297   return (NODETYPE_VFILE == nTypeFlag) ? S_OK : S_FALSE;
00298 }
00299
00300
00301 //---------------------------------------------------------------------------
00302 //  DRAGDROP:  We implement a slightly different behavior for Result Nodes.
00303 //             Since ResultNodes don't have children, we copy the Attributes
00304 //             from the source node to the target node.  The default action
00305 //             is a non destructive copy.  If a right click drag or move
00306 //             was selected the source node is deleted.
00307 //
00308 HRESULT CVirtualFile::OnPaste
00309 (
00310   LPDATAOBJECT ipDataObject,   //[in] Data object of the destination node
00311   LPARAM       nArg,           //[in] Data object of the source node
00312   LPARAM       nParam,         //[in] NULL for copy, DataObject pointer for cut
00313   LONG_PTR     pComponent      //[in] Points to calling IComponent
00314 )
00315 {
00316   _ASSERT( NULL != nArg );
00317   _ASSERT( NULL != pComponent );
00318
00319   HRESULT hResult = S_FALSE;
00320   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00321   LPDATAOBJECT ipSourceDO = reinterpret_cast<LPDATAOBJECT>(nArg);
00322
00323   do
00324   {
00325     // Test to see if the data object supports the clipformat we need
00326     //
00327     FORMATETC NodePropFormatEtc = NP_FORMATETC;
00328     hResult = ipSourceDO->QueryGetData( &NodePropFormatEtc );
00329     BREAK_ON_ERROR( hResult );
00330
00331     STGMEDIUM StgMedium = {TYMED_HGLOBAL, NULL};
00332     hResult = ipSourceDO->GetData( &NodePropFormatEtc, &StgMedium );
00333     BREAK_ON_ERROR( hResult );
00334
00335     NODE_PROPERTIES* pNodeProps = NULL;
00336     pNodeProps = (NODE_PROPERTIES*)::GlobalLock( StgMedium.hGlobal );
00337
00338     // Set variables which must be local
00339     //
00340     pNodeProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00341     pNodeProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00342
00343     // For Virtual Files all we care about are Attributes
00344     //
00345     SetAttribute( pNodeProps->dwAttributes );
00346
00347     // Now do some housekeeping, and test that everything went OK....
00348     //
00349     BOOL    bStatus = ::GlobalUnlock( StgMedium.hGlobal );
00350     HGLOBAL hReturn = ::GlobalFree( StgMedium.hGlobal );
00351     _ASSERT( NULL == hReturn );
00352
00353     if( NULL != nParam )              // Is this a copy or move?
00354     {
00355       // We just AddRef it becuase MMC will release it once when we
00356       // return, and again when CVirtualFile::OnCutOrMove returns.
00357       //
00358       BOOL* pbPasted = reinterpret_cast<BOOL*>(nParam);
00359       ULONG nCount = ipSourceDO->AddRef();
00360       *pbPasted = reinterpret_cast<BOOL>(ipSourceDO);
00361     }
00362
00363     LPCONSOLE3 ipConsole3 = NULL;
00364     hResult = m_pCompData->GetInterface( REQUEST_ICONSOLE, (LONG_PTR*)&ipConsole3 );
00365     hResult = ipConsole3->SelectScopeItem( m_pParentFolder->m_SDI.ID );
00366
00367   }while(0);
00368
00369   return hResult;
00370 }
00371
00372
00373
00374 /////////////////////////////////////////////////////////////////////////////
00375 //  CVirtualFile methods
00376
00377 //---------------------------------------------------------------------------
00378 BOOL CVirtualFile::IsAttributeSet
00379 (
00380   DWORD dwAttribute           //[in] Attribute to set
00381 )
00382 {
00383   return (m_dwAttributes & dwAttribute) ? TRUE : FALSE;
00384 }
00385
00386 //---------------------------------------------------------------------------
00387 VOID CVirtualFile::SetAttribute
00388 (
00389   DWORD dwAttribute           //[in] Attribute to set
00390 )
00391 {
00392   m_dwAttributes |= dwAttribute;
00393 }
00394
00395 //---------------------------------------------------------------------------
00396 VOID CVirtualFile::RemoveAttribute
00397 (
00398   DWORD dwAttribute           //[in] Attribute to remove
00399 )
00400 {
00401   m_dwAttributes &= ~dwAttribute;
00402 }
00403
00404 //---------------------------------------------------------------------------
00405 LPWSTR CVirtualFile::GetAttributeString()
00406 {
00407   *m_pAttributeStr = NULL;
00408
00409   if( IsAttributeSet(ATTRIBUTE_DATA_ARCHIVE) )
00410     wcscat( m_pAttributeStr, L"A " );
00411
00412   if( IsAttributeSet(ATTRIBUTE_DATA_HIDDEN) )
00413     wcscat( m_pAttributeStr, L"H " );
00414
00415   if( IsAttributeSet(ATTRIBUTE_DATA_LOCKED) )
00416     wcscat( m_pAttributeStr, L"L " );
00417
00418   if( IsAttributeSet(ATTRIBUTE_DATA_READONLY) )
00419     wcscat( m_pAttributeStr, L"R " );
00420
00421   return m_pAttributeStr;
00422 }
00423
00424
00425 /////////////////////////////////////////////////////////////////////////////
00426 // IExtendContextMenu
00427
00428 //---------------------------------------------------------------------------
00429 HRESULT CVirtualFile::AddMenuItems
00430 (
00431   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00432   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00433 )
00434 {
00435   HRESULT hResult = E_NOTIMPL;
00436   //TRACE_HRESULT(_T("AddMenuItems"), hResult );
00437   return hResult;
00438 }
00439
00440
00441 //---------------------------------------------------------------------------
00442 HRESULT CVirtualFile::Command
00443 (
00444   long lCommandID          //[in] Indentifier for menu ID
00445 )
00446 {
00447   HRESULT hResult = E_NOTIMPL;
00448   //TRACE_HRESULT(_T("Command"), hResult );
00449   return hResult;
00450 }
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Dib.c Source File

  • WinUI
  • Resource
  • Iconpro

Dib.c

Go to the documentation of this file.
00001 /****************************************************************************\
00002 *
00003 *     FILE:     DIB.C
00004 *
00005 *     PURPOSE:  DIB functions for IconPro Project
00006 *
00007 *     COMMENTS: Icons are stored in a format almost identical to DIBs. For
00008 *               this reason, it is easiest to deal with the individual
00009 *               icon images as DIBs (or DIBSections). This has the added
00010 *               advantage of retaining color depth even on low-end displays.
00011 *
00012 *     FUNCTIONS:
00013 *      EXPORTS:
00014 *               FindDIBBits()      - Locate the image bits in a DIB
00015 *               DIBNumColors()     - Calculate number of color table entries
00016 *               PaletteSize()      - Calculate number of color table bytes
00017 *               BytesPerLine()     - Calculate number of bytes per scan line
00018 *               ConvertDIBFormat() - Converts DIBs between formats
00019 *               SetMonoDIBPixel()  - Sets/Clears a pixel in a 1bpp DIB
00020 *               ReadBMPFile()      - Reads a BMP file into CF_DIB memory
00021 *               WriteBMPFile()     - Write a BMP file from CF_DIB memory
00022 *      LOCALS:
00023 *               CopyColorTable()   - Copies color table from DIB to DIB
00024 *
00025 *     Copyright 1995 - 2000 Microsoft Corp.
00026 *
00027 *
00028 * History:
00029 *                July '95 - Created
00030 *
00031 \****************************************************************************/
00032 #include <Windows.h>
00033 #include <malloc.h>
00034 #include "Dib.H"
00035
00036
00037 /****************************************************************************/
00038 /* Local Function Prototypes */
00039 BOOL CopyColorTable( PBITMAPINFO pTarget, PBITMAPINFO pSource );
00040 /****************************************************************************/
00041
00042
00043
00044 /****************************************************************************
00045 *
00046 *     FUNCTION: FindDIBits
00047 *
00048 *     PURPOSE:  Locate the image bits in a CF_DIB format DIB.
00049 *
00050 *     PARAMS:   PSTR pbi - pointer to the CF_DIB memory block
00051 *
00052 *     RETURNS:  PSTR - pointer to the image bits
00053 *
00054 * History:
00055 *                July '95 - Copied <g>
00056 *
00057 \****************************************************************************/
00058 PSTR FindDIBBits(
00059     PSTR pbi )
00060 {
00061    return ( pbi + *(PDWORD)pbi + PaletteSize( pbi ) );
00062 }
00063 /* End FindDIBits() *********************************************************/
00064
00065
00066
00067 /****************************************************************************
00068 *
00069 *     FUNCTION: DIBNumColors
00070 *
00071 *     PURPOSE:  Calculates the number of entries in the color table.
00072 *
00073 *     PARAMS:   PSTR pbi - pointer to the CF_DIB memory block
00074 *
00075 *     RETURNS:  WORD - Number of entries in the color table.
00076 *
00077 * History:
00078 *                July '95 - Copied <g>
00079 *
00080 \****************************************************************************/
00081 WORD DIBNumColors(
00082     PSTR pbi )
00083 {
00084     WORD wBitCount;
00085     DWORD dwClrUsed;
00086
00087     dwClrUsed = ((PBITMAPINFOHEADER) pbi)->biClrUsed;
00088
00089     if (dwClrUsed)
00090     {
00091         return (WORD) dwClrUsed;
00092     }
00093
00094     wBitCount = ((PBITMAPINFOHEADER) pbi)->biBitCount;
00095
00096     switch (wBitCount)
00097     {
00098         case 1: return 2;
00099         case 4: return 16;
00100         case 8: return 256;
00101         default:return 0;
00102     }
00103     return 0;
00104 }
00105 /* End DIBNumColors() ******************************************************/
00106
00107
00108
00109 /****************************************************************************
00110 *
00111 *     FUNCTION: PaletteSize
00112 *
00113 *     PURPOSE:  Calculates the number of bytes in the color table.
00114 *
00115 *     PARAMS:   PSTR pbi - pointer to the CF_DIB memory block
00116 *
00117 *     RETURNS:  WORD - number of bytes in the color table
00118 *
00119 *
00120 * History:
00121 *                July '95 - Copied <g>
00122 *
00123 \****************************************************************************/
00124 WORD PaletteSize(
00125     PSTR pbi )
00126 {
00127     return (WORD)( DIBNumColors( pbi ) * sizeof( RGBQUAD ) );
00128 }
00129 /* End PaletteSize() ********************************************************/
00130
00131
00132
00133 /****************************************************************************
00134 *
00135 *     FUNCTION: BytesPerLine
00136 *
00137 *     PURPOSE:  Calculates the number of bytes in one scan line.
00138 *
00139 *     PARAMS:   PBITMAPINFOHEADER pBMIH - pointer to the BITMAPINFOHEADER
00140 *                                           that begins the CF_DIB block
00141 *
00142 *     RETURNS:  DWORD - number of bytes in one scan line (DWORD aligned)
00143 *
00144 * History:
00145 *                July '95 - Created
00146 *
00147 \****************************************************************************/
00148 DWORD BytesPerLine(
00149     PBITMAPINFOHEADER pBMIH )
00150 {
00151     return WIDTHBYTES(pBMIH->biWidth * pBMIH->biPlanes * pBMIH->biBitCount);
00152 }
00153 /* End BytesPerLine() ********************************************************/
00154
00155
00156
00157
00158 /****************************************************************************
00159 *
00160 *     FUNCTION: ConvertDIBFormat
00161 *
00162 *     PURPOSE:  Creates a new DIB of the requested format, copies the source
00163 *               image to the new DIB.
00164 *
00165 *     PARAMS:   PBITMAPINFO  pSrcDIB  - the source CF_DIB
00166 *               UINT         nWidth   - width for new DIB
00167 *               UINT         nHeight  - height for new DIB
00168 *               UINT         nbpp     - bpp for new DIB
00169 *               BOOL         bStretch - TRUE to stretch source to dest
00170 *                                       FALSE to take upper left of image
00171 *
00172 *     RETURNS:  PBYTE - pointer to new CF_DIB memory block with new image
00173 *               NULL on failure
00174 *
00175 * History:
00176 *                July '95 - Created
00177 *
00178 \****************************************************************************/
00179 PBYTE ConvertDIBFormat(
00180     PBITMAPINFO pSrcDIB,
00181     UINT nWidth,
00182     UINT nHeight,
00183     UINT nbpp,
00184     BOOL bStretch )
00185 {
00186     PBITMAPINFO    pbmi            = NULL;
00187     PBYTE          pSourceBits     = NULL;
00188     PBYTE          pTargetBits     = NULL;
00189     PBYTE          pResult         = NULL;
00190     HDC            hDC              = NULL;
00191     HDC            hSourceDC        = NULL;
00192     HDC            hTargetDC        = NULL;
00193     HBITMAP        hSourceBitmap    = NULL;
00194     HBITMAP        hTargetBitmap    = NULL;
00195     HBITMAP        hOldTargetBitmap = NULL;
00196     HBITMAP        hOldSourceBitmap = NULL;
00197     DWORD          dwSourceBitsSize, dwTargetBitsSize, dwTargetHeaderSize;
00198
00199     // Allocate and fill out a BITMAPINFO struct for the new DIB
00200     // Allow enough room for a 256-entry color table, just in case
00201     dwTargetHeaderSize = sizeof( BITMAPINFO ) + ( 256 * sizeof( RGBQUAD ) );
00202     pbmi = malloc( dwTargetHeaderSize );
00203     pbmi->bmiHeader.biSize = sizeof( BITMAPINFOHEADER );
00204     pbmi->bmiHeader.biWidth = nWidth;
00205     pbmi->bmiHeader.biHeight = nHeight;
00206     pbmi->bmiHeader.biPlanes = 1;
00207     pbmi->bmiHeader.biBitCount = (WORD)nbpp;
00208     pbmi->bmiHeader.biCompression = BI_RGB;
00209     pbmi->bmiHeader.biSizeImage = 0;
00210     pbmi->bmiHeader.biXPelsPerMeter = 0;
00211     pbmi->bmiHeader.biYPelsPerMeter = 0;
00212     pbmi->bmiHeader.biClrUsed = 0;
00213     pbmi->bmiHeader.biClrImportant = 0;
00214     // Fill in the color table
00215     if( ! CopyColorTable( pbmi, (PBITMAPINFO)pSrcDIB ) )
00216     {
00217         free( pbmi );
00218         return NULL;
00219     }
00220
00221     // Gonna use DIBSections and BitBlt() to do the conversion, so make 'em
00222     hDC = GetDC( NULL );
00223     hTargetBitmap = CreateDIBSection( hDC, pbmi, DIB_RGB_COLORS, &pTargetBits, NULL, 0 );
00224     hSourceBitmap = CreateDIBSection( hDC, pSrcDIB, DIB_RGB_COLORS, &pSourceBits, NULL, 0 );
00225     hSourceDC = CreateCompatibleDC( hDC );
00226     hTargetDC = CreateCompatibleDC( hDC );
00227
00228     // Flip the bits on the source DIBSection to match the source DIB
00229     dwSourceBitsSize = pSrcDIB->bmiHeader.biHeight * BytesPerLine(&(pSrcDIB->bmiHeader));
00230     dwTargetBitsSize = pbmi->bmiHeader.biHeight * BytesPerLine(&(pbmi->bmiHeader));
00231     memcpy( pSourceBits, FindDIBBits((PSTR)pSrcDIB), dwSourceBitsSize );
00232
00233     // Select DIBSections into DCs
00234     hOldSourceBitmap = SelectObject( hSourceDC, hSourceBitmap );
00235     hOldTargetBitmap = SelectObject( hTargetDC, hTargetBitmap );
00236
00237     // Set the color tables for the DIBSections
00238     if( pSrcDIB->bmiHeader.biBitCount <= 8 )
00239     {
00240         SetDIBColorTable( hSourceDC, 0, 1 << pSrcDIB->bmiHeader.biBitCount, pSrcDIB->bmiColors );
00241     }
00242
00243     if( pbmi->bmiHeader.biBitCount <= 8 )
00244     {
00245         SetDIBColorTable( hTargetDC, 0, 1 << pbmi->bmiHeader.biBitCount, pbmi->bmiColors );
00246     }
00247
00248     // If we are asking for a straight copy, do it
00249     if( (pSrcDIB->bmiHeader.biWidth==pbmi->bmiHeader.biWidth) && (pSrcDIB->bmiHeader.biHeight==pbmi->bmiHeader.biHeight) )
00250     {
00251         BitBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, SRCCOPY );
00252     }
00253     else
00254     {
00255         // else, should we stretch it?
00256         if( bStretch )
00257         {
00258             SetStretchBltMode( hTargetDC, COLORONCOLOR );
00259             StretchBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, pSrcDIB->bmiHeader.biWidth, pSrcDIB->bmiHeader.biHeight, SRCCOPY );
00260         }
00261         else
00262         {
00263             // or just take the upper left corner of the source
00264             BitBlt( hTargetDC, 0, 0, pbmi->bmiHeader.biWidth, pbmi->bmiHeader.biHeight, hSourceDC, 0, 0, SRCCOPY );
00265         }
00266     }
00267
00268     // Clean up and delete the DCs
00269     SelectObject( hSourceDC, hOldSourceBitmap );
00270     SelectObject( hSourceDC, hOldTargetBitmap );
00271     DeleteDC( hSourceDC );
00272     DeleteDC( hTargetDC );
00273     ReleaseDC( NULL, hDC );
00274
00275     // Flush the GDI batch, so we can play with the bits
00276     GdiFlush();
00277
00278     // Allocate enough memory for the new CF_DIB, and copy bits
00279     pResult = malloc( dwTargetHeaderSize + dwTargetBitsSize );
00280     memcpy( pResult, pbmi, dwTargetHeaderSize );
00281     memcpy( FindDIBBits( pResult ), pTargetBits, dwTargetBitsSize );
00282
00283     // final cleanup
00284     DeleteObject( hTargetBitmap );
00285     DeleteObject( hSourceBitmap );
00286     free( pbmi );
00287
00288     return pResult;
00289 }
00290 /* End ConvertDIBFormat() ***************************************************/
00291
00292
00293
00294 /****************************************************************************
00295 *
00296 *     FUNCTION: CopyColorTable
00297 *
00298 *     PURPOSE:  Copies the color table from one CF_DIB to another.
00299 *
00300 *     PARAMS:   PBITMAPINFO pTarget - pointer to target DIB
00301 *               PBITMAPINFO pSource - pointer to source DIB
00302 *
00303 *     RETURNS:  BOOL - TRUE for success, FALSE for failure
00304 *
00305 * History:
00306 *                July '95 - Created
00307 *
00308 \****************************************************************************/
00309 BOOL CopyColorTable(
00310     PBITMAPINFO pTarget,
00311     PBITMAPINFO pSource )
00312 {
00313     // What we do depends on the target's color depth
00314     switch( pTarget->bmiHeader.biBitCount )
00315     {
00316         // 8bpp - need 256 entry color table
00317         case 8:
00318             if( pSource->bmiHeader.biBitCount == 8 )
00319             { // Source is 8bpp too, copy color table
00320                 memcpy( pTarget->bmiColors, pSource->bmiColors, 256*sizeof(RGBQUAD) );
00321                 return TRUE;
00322             }
00323             else
00324             { // Source is != 8bpp, use halftone palette
00325                 HPALETTE        hPal;
00326                 HDC             hDC = GetDC( NULL );
00327                 PALETTEENTRY    pe[256];
00328                 UINT            i;
00329
00330                 hPal = CreateHalftonePalette( hDC );
00331                 ReleaseDC( NULL, hDC );
00332                 GetPaletteEntries( hPal, 0, 256, pe );
00333                 DeleteObject( hPal );
00334                 for(i=0;i<256;i++)
00335                 {
00336                     pTarget->bmiColors[i].rgbRed = pe[i].peRed;
00337                     pTarget->bmiColors[i].rgbGreen = pe[i].peGreen;
00338                     pTarget->bmiColors[i].rgbBlue = pe[i].peBlue;
00339                     pTarget->bmiColors[i].rgbReserved = pe[i].peFlags;
00340                 }
00341                 return TRUE;
00342             }
00343             break; // end 8bpp
00344
00345         // 4bpp - need 16 entry color table
00346         case 4:
00347             if( pSource->bmiHeader.biBitCount == 4 )
00348             { // Source is 4bpp too, copy color table
00349                 memcpy( pTarget->bmiColors, pSource->bmiColors, 16*sizeof(RGBQUAD) );
00350                 return TRUE;
00351             }
00352             else
00353             { // Source is != 4bpp, use system palette
00354                 HPALETTE        hPal;
00355                 PALETTEENTRY    pe[256];
00356                 UINT            i;
00357
00358                 hPal = GetStockObject( DEFAULT_PALETTE );
00359                 GetPaletteEntries( hPal, 0, 16, pe );
00360                 for(i=0;i<16;i++)
00361                 {
00362                     pTarget->bmiColors[i].rgbRed = pe[i].peRed;
00363                     pTarget->bmiColors[i].rgbGreen = pe[i].peGreen;
00364                     pTarget->bmiColors[i].rgbBlue = pe[i].peBlue;
00365                     pTarget->bmiColors[i].rgbReserved = pe[i].peFlags;
00366                 }
00367                 return TRUE;
00368             }
00369             break; // end 4bpp
00370
00371         // 1bpp - need 2 entry mono color table
00372         case 1:
00373             pTarget->bmiColors[0].rgbRed = 0;
00374             pTarget->bmiColors[0].rgbGreen = 0;
00375             pTarget->bmiColors[0].rgbBlue = 0;
00376             pTarget->bmiColors[0].rgbReserved = 0;
00377             pTarget->bmiColors[1].rgbRed = 255;
00378             pTarget->bmiColors[1].rgbGreen = 255;
00379             pTarget->bmiColors[1].rgbBlue = 255;
00380             pTarget->bmiColors[1].rgbReserved = 0;
00381             break; // end 1bpp
00382
00383         // no color table for the > 8bpp modes
00384         case 32:    /* fall-through */
00385         case 24:    /* fall-through */
00386         case 16:    /* fall-through */
00387         default:
00388             return TRUE;
00389             break;
00390     }
00391     return TRUE;
00392 }
00393 /* End CopyColorTable() *****************************************************/
00394
00395
00396
00397 /****************************************************************************
00398 *
00399 *     FUNCTION: SetMonoDIBPixel
00400 *
00401 *     PURPOSE:  Sets/Clears a pixel in a 1bpp DIB by directly poking the bits.
00402 *
00403 *     PARAMS:   PBYTE  pANDBits - pointer to the 1bpp image bits
00404 *               DWORD  dwWidth  - width of the DIB
00405 *               DWORD  dwHeight - height of the DIB
00406 *               DWORD  x        - x location of pixel to set/clear
00407 *               DWORD  y        - y location of pixel to set/clear
00408 *               BOOL   bWhite - TRUE to set pixel, FALSE to clear it
00409 *
00410 *     RETURNS:  void
00411 *
00412 * History:
00413 *                July '95 - Created
00414 *
00415 \****************************************************************************/
00416 void SetMonoDIBPixel(
00417     PBYTE pANDBits,
00418     DWORD dwWidth,
00419     DWORD dwHeight,
00420     DWORD x,
00421     DWORD y,
00422     BOOL bWhite )
00423 {
00424     DWORD ByteIndex;
00425     BYTE    BitNumber;
00426
00427     // Find the byte on which this scanline begins
00428     ByteIndex = (dwHeight - y - 1) * WIDTHBYTES(dwWidth);
00429     // Find the byte containing this pixel
00430     ByteIndex += (x >> 3);
00431     // Which bit is it?
00432     BitNumber = (BYTE)( 7 - (x % 8) );
00433
00434     if( bWhite )
00435     {
00436         // Turn it on
00437         pANDBits[ByteIndex] |= (1<<BitNumber);
00438     }
00439     else
00440     {
00441         // Turn it off
00442         pANDBits[ByteIndex] &= ~(1<<BitNumber);
00443     }
00444 }
00445 /* End SetMonoDIBPixel() *****************************************************/
00446
00447
00448
00449 /****************************************************************************
00450 *
00451 *     FUNCTION: ReadBMPFile
00452 *
00453 *     PURPOSE:  Reads a BMP file into CF_DIB format
00454 *
00455 *     PARAMS:   PCTSTR szFileName - the name of the file to read
00456 *
00457 *     RETURNS:  PBYTE - pointer to the CF_DIB, NULL for failure
00458 *
00459 * History:
00460 *                July '95 - Created
00461 *
00462 \****************************************************************************/
00463 PBYTE ReadBMPFile(
00464     PCTSTR szFileName )
00465 {
00466     HANDLE              hFile        = NULL;
00467     BITMAPFILEHEADER    bfh          = {0};
00468     DWORD               dwBytes      = 0;
00469     PBYTE               pDIB        = NULL;
00470     PBYTE               pTemp       = NULL;
00471     WORD                wPaletteSize = 0;
00472     DWORD               dwBitsSize   = 0;
00473
00474     // Open the file
00475     if( (hFile=CreateFile( szFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE )
00476     {
00477         MessageBox( NULL, TEXT("Error opening file"), szFileName, MB_OK );
00478         return NULL;
00479     }
00480     // Read the header
00481     if( ( ! ReadFile( hFile, &bfh, sizeof(BITMAPFILEHEADER), &dwBytes, NULL ) ) || ( dwBytes != sizeof( BITMAPFILEHEADER ) ) )
00482     {
00483         CloseHandle( hFile );
00484         MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
00485         return NULL;
00486     }
00487     // Does it look like a BMP file?
00488     if( ( bfh.bfType != 0x4d42 ) || (bfh.bfReserved1!=0) || (bfh.bfReserved2!=0) )
00489     {
00490         CloseHandle( hFile );
00491         MessageBox( NULL, TEXT("Not a recognised BMP format file"), szFileName, MB_OK );
00492         return NULL;
00493     }
00494     // Allocate some memory
00495     if( (pDIB = malloc( sizeof( BITMAPINFO ) )) == NULL )
00496     {
00497         CloseHandle( hFile );
00498         MessageBox( NULL, TEXT("Failed to allocate memory for DIB"), szFileName, MB_OK );
00499         return NULL;
00500     }
00501     // Read in the BITMAPINFOHEADER
00502     if( (!ReadFile( hFile, pDIB, sizeof(BITMAPINFOHEADER), &dwBytes, NULL )) || (dwBytes!=sizeof(BITMAPINFOHEADER)) )
00503     {
00504         CloseHandle( hFile );
00505         free( pDIB );
00506         MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
00507         return NULL;
00508     }
00509     if( ((PBITMAPINFOHEADER)pDIB)->biSize != sizeof( BITMAPINFOHEADER ) )
00510     {
00511         CloseHandle( hFile );
00512         free( pDIB );
00513         MessageBox( NULL, TEXT("OS/2 style BMPs Not Supported"), szFileName, MB_OK );
00514         return NULL;
00515     }
00516     // How big are the elements?
00517     wPaletteSize = PaletteSize((PSTR)pDIB);
00518     dwBitsSize = ((PBITMAPINFOHEADER)pDIB)->biHeight * BytesPerLine((PBITMAPINFOHEADER)pDIB);
00519     // realloc to account for the total size of the DIB
00520     if( (pTemp = realloc( pDIB, sizeof( BITMAPINFOHEADER ) + wPaletteSize + dwBitsSize )) == NULL )
00521     {
00522         CloseHandle( hFile );
00523         MessageBox( NULL, TEXT("Failed to allocate memory for DIB"), szFileName, MB_OK );
00524         free( pDIB );
00525         return NULL;
00526     }
00527     pDIB = pTemp;
00528     // If there is a color table, read it
00529     if( wPaletteSize != 0 )
00530     {
00531         if( (!ReadFile( hFile, ((PBITMAPINFO)pDIB)->bmiColors, wPaletteSize, &dwBytes, NULL )) || (dwBytes!=wPaletteSize) )
00532         {
00533             CloseHandle( hFile );
00534             free( pDIB );
00535             MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
00536             return NULL;
00537         }
00538     }
00539     // Seek to the bits
00540     // checking against 0 in case some bogus app didn't set this element
00541     if( bfh.bfOffBits != 0 )
00542     {
00543         if( SetFilePointer( hFile, bfh.bfOffBits, NULL, FILE_BEGIN ) == INVALID_SET_FILE_POINTER )
00544         {
00545             CloseHandle( hFile );
00546             free( pDIB );
00547             MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
00548             return NULL;
00549         }
00550     }
00551     // Read the image bits
00552     if( (!ReadFile( hFile, FindDIBBits(pDIB), dwBitsSize, &dwBytes, NULL )) || (dwBytes!=dwBitsSize) )
00553     {
00554         CloseHandle( hFile );
00555         free( pDIB );
00556         MessageBox( NULL, TEXT("Error reading file"), szFileName, MB_OK );
00557         return NULL;
00558     }
00559     // clean up
00560     CloseHandle( hFile );
00561     return pDIB;
00562 }
00563 /* End ReadBMPFile() ********************************************************/
00564
00565
00566 /****************************************************************************
00567 *
00568 *     FUNCTION: WriteBMPFile
00569 *
00570 *     PURPOSE:  Writes a BMP file from CF_DIB format
00571 *
00572 *     PARAMS:   PCTSTR szFileName - the name of the file to read
00573 *               PBYTE - pointer to the CF_DIB, NULL for failure
00574 *
00575 *     RETURNS:  BOOL - TRUE for success, FALSE for Failure
00576 *
00577 * History:
00578 *                July '95 - Created
00579 *
00580 \****************************************************************************/
00581 BOOL WriteBMPFile(
00582     PCTSTR szFileName,
00583     PBYTE pDIB )
00584 {
00585     HANDLE              hFile           = NULL;
00586     BITMAPFILEHEADER    bfh             = {0};
00587     DWORD             dwBytes;
00588     DWORD               dwBytesToWrite;
00589     PBITMAPINFOHEADER pbmih           = NULL;
00590
00591     // Open the file
00592     if( (hFile=CreateFile( szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE )
00593     {
00594         MessageBox( NULL, TEXT("Error opening file"), szFileName, MB_OK );
00595         return FALSE;
00596     }
00597     bfh.bfType = 0x4d42;
00598     bfh.bfReserved1 = 0;
00599     bfh.bfReserved2 = 0;
00600     bfh.bfOffBits = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) + PaletteSize( pDIB );
00601     bfh.bfSize = (bfh.bfOffBits + ((PBITMAPINFOHEADER)pDIB)->biHeight * BytesPerLine((PBITMAPINFOHEADER)pDIB))/4;
00602     // Write the header
00603     if( ( ! WriteFile( hFile, &bfh, sizeof(BITMAPFILEHEADER), &dwBytes, NULL ) ) || ( dwBytes != sizeof( BITMAPFILEHEADER ) ) )
00604     {
00605         CloseHandle( hFile );
00606         MessageBox( NULL, TEXT("Error Writing file"), szFileName, MB_OK );
00607         return FALSE;
00608     }
00609     pbmih = (PBITMAPINFOHEADER)pDIB;
00610     pbmih->biHeight /= 2;
00611     dwBytesToWrite = bfh.bfOffBits + (pbmih->biHeight * BytesPerLine(pbmih));
00612     if( ( ! WriteFile( hFile, pDIB, dwBytesToWrite, &dwBytes, NULL ) ) || ( dwBytes != dwBytesToWrite ) )
00613     {
00614         CloseHandle( hFile );
00615         MessageBox( NULL, TEXT("Error Writing file"), szFileName, MB_OK );
00616         return FALSE;
00617     }
00618     pbmih->biHeight *= 2;
00619     CloseHandle( hFile );
00620     return TRUE;
00621 }
00622 /* End WriteBMPFile() *******************************************************/
00623
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTestDoc Member List

This is the complete list of members for CTestDoc, including all inherited members.
CTestDoc() | CTestDoc | [protected]
OnNewDocument() | CTestDoc | [virtual]
Serialize(CArchive &ar) | CTestDoc | [virtual]
~CTestDoc() | CTestDoc | [virtual]
Generated on Wed Nov 13 2024 16:57:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/compdata.h Source File

  • SysMgmt
  • MMC
  • ActiveX

compdata.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "StatNode.h"
00024 #include "Comp.h"
00025
00026 class CComponentData : public IComponentData, ISnapinHelp
00027 {
00028     friend class CComponent;
00029
00030 private:
00031     ULONG       m_cref;
00032     LPCONSOLE     m_ipConsole;
00033     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00034
00035     CStaticNode     *m_pStaticNode;
00036
00037     WCHAR            m_HelpFile[MAX_PATH];
00038
00039 public:
00040     CComponentData();
00041     ~CComponentData();
00042
00043     ///////////////////////////////
00044     // Interface IUnknown
00045     ///////////////////////////////
00046     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00047     STDMETHODIMP_(ULONG) AddRef();
00048     STDMETHODIMP_(ULONG) Release();
00049
00050     ///////////////////////////////
00051     // Interface IComponentData
00052     ///////////////////////////////
00053     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00054         /* [in] */ LPUNKNOWN pUnknown);
00055
00056         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00057         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00058
00059         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00060         /* [in] */ LPDATAOBJECT lpDataObject,
00061         /* [in] */ MMC_NOTIFY_TYPE event,
00062         /* [in] */ LPARAM arg,
00063         /* [in] */ LPARAM param);
00064
00065         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00066
00067     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00068         /* [in] */ MMC_COOKIE cookie,
00069         /* [in] */ DATA_OBJECT_TYPES type,
00070         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00071
00072         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00073         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00074
00075         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00076         /* [in] */ LPDATAOBJECT lpDataObjectA,
00077         /* [in] */ LPDATAOBJECT lpDataObjectB);
00078
00079         ///////////////////////////////
00080         // Interface ISnapinHelp
00081         ///////////////////////////////
00082         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetHelpTopic(
00083         /* [out] */ LPOLESTR __RPC_FAR *lpCompiledHelpFile);
00084 };
00085
00086 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_BINDING_ENTRY Member List

This is the complete list of members for _BINDING_ENTRY, including all inherited members.
ipAddress | _BINDING_ENTRY
ipMask | _BINDING_ENTRY
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/DDxDDv.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

DDxDDv.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      DDxDDv.cpp
00007 //
00008 //  Description:
00009 //      Implementation of custom dialog data exchange/dialog data validation
00010 //      routines.
00011 //
00012 //  Author:
00013 //      <name> (<e-mail name>) Mmmm DD, 2003
00014 //
00015 //  Revision History:
00016 //
00017 //  Notes:
00018 //      The IDS_REQUIRED_FIELD_EMPTY string resource must be defined in
00019 //      the resource file.
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #include "stdafx.h"
00024 #include "DDxDDv.h"
00025
00026 #include "resource.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00034
00035 /////////////////////////////////////////////////////////////////////////////
00036 //++
00037 //
00038 //  DDX_Number
00039 //
00040 //  Description:
00041 //      Do data exchange between the dialog and the class.
00042 //
00043 //  Arguments:
00044 //      pDXIn
00045 //          Data exchange object.
00046 //
00047 //      nIDCIn
00048 //          Control ID.
00049 //
00050 //      rdwValueInout
00051 //          Value to set or get.
00052 //
00053 //      dwMinIn
00054 //          Minimum value.
00055 //
00056 //      dwMaxIn
00057 //          Maximum value.
00058 //
00059 //      fSignedIn
00060 //          TRUE = value is signed, FALSE = value is unsigned
00061 //
00062 //  Return Value:
00063 //      None.
00064 //
00065 //--
00066 /////////////////////////////////////////////////////////////////////////////
00067 void AFXAPI
00068 DDX_Number(
00069       CDataExchange *   pDXIn
00070     , int               nIDCIn
00071     , DWORD &           rdwValueInout
00072     , DWORD             dwMinIn
00073     , DWORD             dwMaxIn
00074     , BOOL              fSignedIn /* =FALSE */
00075     )
00076 {
00077     HWND    hwndCtrl = NULL;
00078     DWORD   dwValue = 0;
00079     HRESULT hr = S_OK;
00080
00081     ASSERT( pDXIn != NULL );
00082 #ifdef _DEBUG
00083     if ( fSignedIn )
00084     {
00085         ASSERT( static_cast< LONG >( dwMinIn ) < static_cast< LONG >( dwMaxIn ) );
00086     }
00087     else
00088     {
00089         ASSERT( dwMinIn < dwMaxIn );
00090     }
00091 #endif // _DEBUG
00092
00093     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00094
00095     //
00096     //  Get the control window handle.
00097     //
00098
00099     hwndCtrl = pDXIn->PrepareEditCtrl( nIDCIn );
00100
00101     if ( pDXIn->m_bSaveAndValidate )
00102     {
00103         BOOL    bTranslated;
00104
00105         //
00106         //  Get the number from the control.
00107         //
00108
00109         dwValue = GetDlgItemInt( pDXIn->m_pDlgWnd->m_hWnd, nIDCIn, &bTranslated, fSignedIn );
00110
00111         //
00112         // If the retrival failed, it is a signed number, and the minimum
00113         // value is the smallest negative value possible, check the string itself.
00114         //
00115
00116         if ( ! bTranslated && fSignedIn && (dwMinIn == 0x80000000) )
00117         {
00118             UINT    cch = 0;
00119             TCHAR   szNumber[ 20 ];
00120
00121             //
00122             //  See if it is the smallest negative number.
00123             //
00124
00125             cch = GetDlgItemText( pDXIn->m_pDlgWnd->m_hWnd, nIDCIn, szNumber, RTL_NUMBER_OF( szNumber ) );
00126             if ( (cch != 0) && (_tcsnicmp( szNumber, _T("-2147483648"), RTL_NUMBER_OF( szNumber ) ) == 0) )
00127             {
00128                 dwValue = 0x80000000;
00129                 bTranslated = TRUE;
00130             } // if:  text retrieved successfully and is highest negative number
00131         } // if:  error translating number and getting signed number
00132
00133         //
00134         // If the retrieval failed or the specified number is
00135         // out of range, display an error.
00136         //
00137
00138         if (    ! bTranslated
00139             ||  (fSignedIn
00140                 && (    (static_cast< LONG >( dwValue ) < static_cast< LONG >( dwMinIn ))
00141                     ||  (static_cast< LONG >( dwValue ) > static_cast< LONG >( dwMaxIn ))
00142                     )
00143                 )
00144             ||  (!  fSignedIn
00145                 &&  (   (dwValue < dwMinIn)
00146                     ||  (dwValue > dwMaxIn)
00147                     )
00148                 )
00149             )
00150         {
00151             TCHAR   szMin[ 32 ];
00152             TCHAR   szMax[ 32 ];
00153             CString strPrompt;
00154
00155             if ( fSignedIn )
00156             {
00157                 hr = StringCchPrintf( szMin, RTL_NUMBER_OF( szMin ), _T("%d%"), dwMinIn );
00158                 ASSERT( SUCCEEDED( hr ) );
00159                 hr = StringCchPrintf( szMax, RTL_NUMBER_OF( szMax ), _T("%d%"), dwMaxIn );
00160                 ASSERT( SUCCEEDED( hr ) );
00161             } // if:  signed number
00162             else
00163             {
00164                 hr = StringCchPrintf( szMin, RTL_NUMBER_OF( szMin ), _T("%u%"), dwMinIn );
00165                 ASSERT( SUCCEEDED( hr ) );
00166                 hr = StringCchPrintf( szMax, RTL_NUMBER_OF( szMax ), _T("%u%"), dwMaxIn );
00167                 ASSERT( SUCCEEDED( hr ) );
00168             } // else:  unsigned number
00169             AfxFormatString2( strPrompt, AFX_IDP_PARSE_INT_RANGE, szMin, szMax );
00170             AfxMessageBox( strPrompt, MB_ICONEXCLAMATION, AFX_IDP_PARSE_INT_RANGE );
00171             strPrompt.Empty(); // exception prep
00172             pDXIn->Fail();
00173         } // if:  invalid string
00174         else
00175         {
00176             rdwValueInout = dwValue;
00177         } // if:  number is in range
00178     } // if:  saving data
00179     else
00180     {
00181         CString     strMinValue;
00182         CString     strMaxValue;
00183         UINT        cchMax;
00184
00185         //
00186         //  Set the maximum number of characters that can be entered.
00187         //
00188
00189         if ( fSignedIn )
00190         {
00191             strMinValue.Format( _T("%d"), dwMinIn );
00192             strMaxValue.Format( _T("%d"), dwMaxIn );
00193         } // if:  signed value
00194         else
00195         {
00196             strMinValue.Format( _T("%u"), dwMinIn );
00197             strMaxValue.Format( _T("%u"), dwMaxIn );
00198         } // else:  unsigned value
00199         cchMax = max( strMinValue.GetLength(), strMaxValue.GetLength() );
00200         SendMessage( hwndCtrl, EM_LIMITTEXT, cchMax, 0 );
00201
00202         //
00203         //  Set the value into the control.
00204         //
00205
00206         if ( fSignedIn )
00207         {
00208             LONG lValue = static_cast< LONG >( rdwValueInout );
00209             DDX_Text( pDXIn, nIDCIn, lValue );
00210         } // if:  signed value
00211         else
00212         {
00213             DDX_Text( pDXIn, nIDCIn, rdwValueInout );
00214         } // else:
00215     } // else:  setting data onto the dialog
00216
00217 } //*** DDX_Number
00218
00219 /////////////////////////////////////////////////////////////////////////////
00220 //++
00221 //
00222 //  DDV_RequiredText
00223 //
00224 //  Description:
00225 //      Validate that the dialog string is present.
00226 //
00227 //  Arguments:
00228 //      pDXIn
00229 //          Data exchange object.
00230 //
00231 //      nIDCIn
00232 //          Control ID.
00233 //
00234 //      nIDCLabelIn
00235 //          Label control ID.
00236 //
00237 //      rstrValueIn
00238 //          Value to set or get.
00239 //
00240 //  Return Value:
00241 //      None.
00242 //
00243 //--
00244 /////////////////////////////////////////////////////////////////////////////
00245 void AFXAPI
00246 DDV_RequiredText(
00247       CDataExchange *   pDXIn
00248     , int               nIDCIn
00249     , int               nIDCLabelIn
00250     , const CString &   rstrValueIn
00251     )
00252 {
00253     ASSERT( pDXIn != NULL );
00254
00255     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00256
00257     if ( pDXIn->m_bSaveAndValidate )
00258     {
00259         if ( rstrValueIn.GetLength() == 0 )
00260         {
00261             HWND        hwndLabel;
00262             TCHAR       szLabel[ 1024 ];
00263             CString     strPrompt;
00264
00265             // Get the label window handle
00266             hwndLabel = pDXIn->PrepareEditCtrl( nIDCLabelIn );
00267
00268             // Get the text of the label.
00269             GetWindowText( hwndLabel, szLabel, RTL_NUMBER_OF( szLabel ) );
00270
00271             // Remove ampersands (&) and colons (:).
00272             CleanupLabel( szLabel );
00273
00274             // Format and display a message.
00275             strPrompt.FormatMessage( IDS_REQUIRED_FIELD_EMPTY, szLabel );
00276             AfxMessageBox( strPrompt, MB_ICONEXCLAMATION );
00277
00278             // Do this so that the control receives focus.
00279             (void) pDXIn->PrepareEditCtrl( nIDCIn );
00280
00281             // Fail the call.
00282             strPrompt.Empty();  // exception prep
00283             pDXIn->Fail();
00284         } // if:  field not specified
00285     } // if:  saving data
00286
00287 } //*** DDV_RequiredText
00288
00289 /////////////////////////////////////////////////////////////////////////////
00290 //++
00291 //
00292 //  CleanupLabel
00293 //
00294 //  Description:
00295 //      Prepare a label read from a dialog to be used as a string in a
00296 //      message by removing ampersands (&) and colons (:).
00297 //
00298 //  Arguments:
00299 //      pwszLabelIn
00300 //          Label to be cleaned up.
00301 //
00302 //  Return Value:
00303 //      None.
00304 //
00305 //--
00306 /////////////////////////////////////////////////////////////////////////////
00307 void
00308 CleanupLabel( LPTSTR pwszLabelIn )
00309 {
00310     LPTSTR  pin = NULL;
00311     LPTSTR  pout = NULL;
00312     LANGID  langid;
00313     WORD    primarylangid;
00314     BOOL    fFELanguage;
00315
00316     //
00317     //  Get the language ID.
00318     //
00319
00320     langid = GetUserDefaultLangID();
00321     primarylangid = static_cast< WORD >( PRIMARYLANGID( langid ) );
00322     fFELanguage = ((primarylangid == LANG_JAPANESE)
00323                 || (primarylangid == LANG_CHINESE)
00324                 || (primarylangid == LANG_KOREAN) );
00325
00326     //
00327     // Copy the name sans '&' and ':' chars
00328     //
00329
00330     pin = pout = pwszLabelIn;
00331     do
00332     {
00333         //
00334         // Strip FE accelerators with parentheses. e.g. "foo(&F)" -> "foo"
00335         //
00336
00337         if (    fFELanguage
00338             &&  (pin[ 0 ] == _T('('))
00339             &&  (pin[ 1 ] == _T('&'))
00340             &&  (pin[ 2 ] != _T('\0'))
00341             &&  (pin[ 3 ] == _T(')')) )
00342         {
00343             pin += 3;
00344         } // if:  Far East language with accelerator
00345         else if ( (*pin != _T('&')) && (*pin != _T(':')) )
00346         {
00347             *pout++ = *pin;
00348         } // else if:  accelerator found
00349     } while ( *pin++ != _T('\0') );
00350
00351 } //*** CleanupLabel
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/UtilLib/Utils.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • UtilLib

Utils.Cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  utils.cpp
00006 //
00007 // Description:
00008 //    Set of sample routines
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 //#pragma warning(disable:4201)  // nonstandard extension nameless struct (used in windows.h)
00015 //#pragma warning(disable:4514)  // unreferenced inline function has been removed (used in windows.h)
00016
00017 #define STRSAFE_NO_DEPRECATE
00018
00019
00020 #include "precomp.h"
00021 #include <stdio.h>
00022
00023 #include <wbemidl.h>
00024 #include <sys\timeb.h>
00025 #include <strsafe.h>
00026 #include "utillib.h"
00027
00028 //*****************************************************************************
00029 // Function:  WbemErrorString
00030 // Purpose:   Turns sc into a text string
00031 // Note:    The BSTR returned by this method needs to be freed by the caller.
00032 //        If allocation fails, the method will return NULL
00033 //*****************************************************************************
00034 BSTR WbemErrorString(SCODE sc)
00035 {
00036     IWbemStatusCodeTextPtr pStatus;
00037     BSTR bstr = NULL;
00038
00039     SCODE mysc = CoCreateInstance(CLSID_WbemStatusCodeText, 0, CLSCTX_INPROC_SERVER,
00040         IID_IWbemStatusCodeText, (LPVOID *) &pStatus);
00041
00042     if (mysc == S_OK)
00043     {
00044         mysc = pStatus->GetErrorCodeText(sc, 0, 0, &bstr);
00045         if (mysc == S_OK)
00046         {
00047         }
00048         else
00049         {
00050             WCHAR szBuffer2[MAXITOA];
00051             WCHAR szBuffer[sizeof(szBuffer2) + 4];
00052
00053             _ltow(sc, szBuffer2, 16);
00054       StringCbCopyW(szBuffer, sizeof(szBuffer), L"0x");
00055       StringCbCatW(szBuffer, sizeof(szBuffer), szBuffer2);
00056             bstr = SysAllocString(szBuffer);
00057         }
00058     }
00059
00060     return bstr;
00061 }
00062
00063 //***************************************************************************
00064 // Function:  PrintError
00065 // Purpose:   Formats and prints the error message
00066 //***************************************************************************
00067 void PrintError(char *pszFailureReason, SCODE psc, DWORD dwMode)
00068 {
00069     VARIANT varString;
00070     SCODE sc;
00071     IWbemClassObject *pErrorObject = NULL;
00072     IErrorInfo* pEI = NULL;
00073
00074     fprintf(stdout, "%s\n", pszFailureReason);
00075     fprintf(stdout, "FunctionReturn: %S(0x%08lx)\n", WbemErrorString(psc), psc);
00076
00077     if (GetErrorInfo(0, &pEI) == S_OK)
00078     {
00079         pEI->QueryInterface(IID_IWbemClassObject, (void**)&pErrorObject);
00080         pEI->Release();
00081     }
00082
00083     if (pErrorObject != NULL)
00084     {
00085         VariantInit(&varString);
00086
00087         if (dwMode == ERROR_MODE_PRINTFIELDS)
00088         {
00089             if (pErrorObject->InheritsFrom(L"__NotifyStatus") != WBEM_NO_ERROR)
00090             {
00091                 fprintf(stdout, "Unrecognized Error Object type\n");
00092             }
00093             else if (pErrorObject->InheritsFrom(L"__ExtendedStatus") == WBEM_NO_ERROR)
00094             {
00095                 sc = pErrorObject->Get(L"Description", 0L, &varString, NULL, NULL);
00096                 if (sc != S_OK)
00097                 {
00098                     fprintf(stdout, "Can't get Description: %d\n", sc);
00099                 }
00100                 else if (V_VT(&varString) == VT_BSTR)
00101                 {
00102                     FWPRINTF(stdout, L"Description: %wS\n", V_BSTR(&varString));
00103                 }
00104                 VariantClear(&varString);
00105
00106                 pErrorObject->Get(L"Operation", 0L, &varString, NULL, NULL);
00107                 if (sc != S_OK)
00108                 {
00109                     fprintf(stdout, "Can't get Operation: %d\n", sc);
00110                 }
00111                 else if (V_VT(&varString) == VT_BSTR)
00112                 {
00113                     FWPRINTF(stdout, L"Operation: %wS\n", V_BSTR(&varString));
00114                 }
00115                 VariantClear(&varString);
00116
00117                 pErrorObject->Get(L"ParameterInfo", 0L, &varString, NULL, NULL);
00118                 if (sc != S_OK)
00119                 {
00120                     fprintf(stdout, "Can't get ParameterInfo: %d\n", sc);
00121                 }
00122                 else if (V_VT(&varString) == VT_BSTR)
00123                 {
00124                     FWPRINTF(stdout, L"ParameterInfo: %wS\n", V_BSTR(&varString));
00125                 }
00126                 VariantClear(&varString);
00127
00128                 pErrorObject->Get(L"ProviderName", 0L, &varString, NULL, NULL);
00129                 if (sc != S_OK)
00130                 {
00131                     fprintf(stdout, "Can't get ProviderName: %d\n", sc);
00132                 }
00133                 else if (V_VT(&varString) == VT_BSTR)
00134                 {
00135                     FWPRINTF(stdout, L"ProviderName: %wS\n", V_BSTR(&varString));
00136                 }
00137                 VariantClear(&varString);
00138             }
00139         }
00140         else
00141         {
00142             BSTR bstrObjectText = NULL;
00143             if (SUCCEEDED(pErrorObject->GetObjectText(0, &bstrObjectText)))
00144             {
00145                 fprintf(stdout, "%wS", bstrObjectText);
00146                 SysFreeString(bstrObjectText);
00147             }
00148         }
00149
00150         RELEASE(pErrorObject);
00151     }
00152 }
00153
00154 //***************************************************************************
00155 // Function:  PrintErrorAndExit
00156 // Purpose:   Formats an error message & exits program
00157 //***************************************************************************
00158 void PrintErrorAndExit(char *pszFailureReason, SCODE sc, DWORD dwMode)
00159 {
00160     PrintError(pszFailureReason, sc, dwMode);
00161
00162     // Clean up and exit
00163     OleUninitialize();
00164     printf("Abnormal Termination\n");
00165     exit(1);
00166 };
00167
00168 //***************************************************************************
00169 // Function:  PrintErrorAndAsk
00170 // Purpose:   Prints the error message and prompts to continue
00171 //***************************************************************************
00172 void PrintErrorAndAsk(char *pszFailureReason, SCODE sc, DWORD dwMode)
00173 {
00174     int c;
00175
00176     PrintError(pszFailureReason, sc, dwMode);
00177     printf("Continue (Y/N)? ");
00178
00179     c = getchar();
00180     while (getchar() != '\n')
00181     {
00182     }
00183
00184     if ((c != 'Y') && (c != 'y'))
00185     {
00186         // Clean up and exit
00187         OleUninitialize();
00188         exit(1);
00189     }
00190 };
00191
00192 //*****************************************************************************
00193 // Function:   TypeToString
00194 // Purpose:    Takes a variant, returns a pointer to a string that is the variant type
00195 //*****************************************************************************
00196 const WCHAR *TypeToString(VARIANT *p)
00197 {
00198     return TypeToString(p->vt);
00199 }
00200
00201 //*****************************************************************************
00202 // Function:   TypeToString
00203 // Purpose:    Takes a VARTYPE, returns a pointer to a string that is the variant type
00204 //*****************************************************************************
00205 const WCHAR *TypeToString(VARTYPE v)
00206 {
00207     const static WCHAR *pVT_NULL  = L"VT_NULL";
00208     const static WCHAR *pVT_EMTPY = L"VT_EMPTY";
00209     const static WCHAR *pVT_I1    = L"VT_I1";
00210     const static WCHAR *pVT_UI1   = L"VT_UI1";
00211     const static WCHAR *pVT_I2    = L"VT_I2";
00212     const static WCHAR *pVT_UI2   = L"VT_UI2";
00213     const static WCHAR *pVT_I4    = L"VT_I4";
00214     const static WCHAR *pVT_UI4   = L"VT_UI4";
00215     const static WCHAR *pVT_I8    = L"VT_I8";
00216     const static WCHAR *pVT_UI8   = L"VT_UI8";
00217     const static WCHAR *pVT_R4    = L"VT_R4";
00218     const static WCHAR *pVT_R8    = L"VT_R8";
00219     const static WCHAR *pVT_BOOL  = L"VT_BOOL";
00220     const static WCHAR *pVT_BSTR  = L"VT_BSTR";
00221     const static WCHAR *pVT_DISPATCH = L"VT_DISPATCH";
00222     const static WCHAR *pVT_UNKNOWN = L"VT_UNKNOWN";
00223     const static WCHAR *pVT_I1_ARRAY = L"VT_I1 | VT_ARRAY";
00224     const static WCHAR *pVT_UI1_ARRAY  = L"VT_UI1 | VT_ARRAY";
00225     const static WCHAR *pVT_I2_ARRAY   = L"VT_I2 | VT_ARRAY";
00226     const static WCHAR *pVT_UI2_ARRAY  = L"VT_UI2 | VT_ARRAY";
00227     const static WCHAR *pVT_I4_ARRAY   = L"VT_I4 | VT_ARRAY";
00228     const static WCHAR *pVT_UI4_ARRAY  = L"VT_UI4 | VT_ARRAY";
00229     const static WCHAR *pVT_I8_ARRAY   = L"VT_I8 | VT_ARRAY";
00230     const static WCHAR *pVT_UI8_ARRAY  = L"VT_UI8 | VT_ARRAY";
00231     const static WCHAR *pVT_R4_ARRAY   = L"VT_R4 | VT_ARRAY";
00232     const static WCHAR *pVT_R8_ARRAY   = L"VT_R8 | VT_ARRAY";
00233     const static WCHAR *pVT_BOOL_ARRAY = L"VT_BOOL | VT_ARRAY";
00234     const static WCHAR *pVT_BSTR_ARRAY = L"VT_BSTR | VT_ARRAY";
00235     const static WCHAR *pVT_DISPATCH_ARRAY = L"VT_DISPATCH | VT_ARRAY";
00236     const static WCHAR *pVT_UNKNOWN_ARRAY = L"VT_UNKNOWN | VT_ARRAY";
00237
00238     const WCHAR *pRetVal;
00239
00240     switch (v)
00241     {
00242     case VT_NULL: pRetVal = pVT_NULL; break;
00243
00244     case VT_I1: pRetVal = pVT_I1; break;
00245     case VT_UI1: pRetVal = pVT_UI1; break;
00246     case VT_I2: pRetVal = pVT_I2; break;
00247     case VT_UI2: pRetVal = pVT_UI2; break;
00248     case VT_I4: pRetVal = pVT_I4; break;
00249     case VT_UI4: pRetVal = pVT_UI4; break;
00250     case VT_I8: pRetVal = pVT_I8; break;
00251     case VT_UI8: pRetVal = pVT_UI8; break;
00252     case VT_R4: pRetVal = pVT_R4; break;
00253     case VT_R8: pRetVal = pVT_R8; break;
00254     case VT_BOOL: pRetVal = pVT_BOOL; break;
00255     case VT_BSTR: pRetVal = pVT_BSTR; break;
00256     case VT_DISPATCH: pRetVal = pVT_DISPATCH; break;
00257     case VT_UNKNOWN: pRetVal = pVT_UNKNOWN; break;
00258
00259     case VT_I1|VT_ARRAY: pRetVal = pVT_I1_ARRAY; break;
00260     case VT_UI1|VT_ARRAY: pRetVal = pVT_UI1_ARRAY; break;
00261     case VT_I2|VT_ARRAY: pRetVal = pVT_I2_ARRAY; break;
00262     case VT_UI2|VT_ARRAY: pRetVal = pVT_UI2_ARRAY; break;
00263     case VT_I4|VT_ARRAY: pRetVal = pVT_I4_ARRAY; break;
00264     case VT_UI4|VT_ARRAY: pRetVal = pVT_UI4_ARRAY; break;
00265     case VT_I8|VT_ARRAY: pRetVal = pVT_I8_ARRAY; break;
00266     case VT_UI8|VT_ARRAY: pRetVal = pVT_UI8_ARRAY; break;
00267     case VT_R4|VT_ARRAY: pRetVal = pVT_R4_ARRAY; break;
00268     case VT_R8|VT_ARRAY: pRetVal = pVT_R8_ARRAY; break;
00269     case VT_BOOL|VT_ARRAY: pRetVal = pVT_BOOL_ARRAY; break;
00270     case VT_BSTR|VT_ARRAY: pRetVal = pVT_BSTR_ARRAY; break;
00271     case VT_DISPATCH|VT_ARRAY: pRetVal = pVT_DISPATCH_ARRAY; break;
00272     case VT_UNKNOWN|VT_ARRAY: pRetVal = pVT_UNKNOWN_ARRAY; break;
00273
00274     default: pRetVal = L"<unknown>";
00275     }
00276
00277     return pRetVal;
00278 }
00279
00280 //*****************************************************************************
00281 // Function:   TypeToString
00282 // Purpose:    Takes a CIMTYPE, returns a pointer to a string that is the variant type
00283 //*****************************************************************************
00284 const WCHAR *TypeToString(CIMTYPE v)
00285 {
00286     const static WCHAR *pCIM_UNKNOWN = L"CIM_UNKNOWN";
00287
00288     const static WCHAR *pCIM_ILLEGAL = L"CIM_ILLEGAL";
00289     const static WCHAR *pCIM_EMPTY = L"CIM_EMPTY";
00290     const static WCHAR *pCIM_SINT8 = L"CIM_SINT8";
00291     const static WCHAR *pCIM_UINT8 = L"CIM_UINT8";
00292     const static WCHAR *pCIM_SINT16 = L"CIM_SINT16";
00293     const static WCHAR *pCIM_UINT16 = L"CIM_UINT16";
00294     const static WCHAR *pCIM_SINT32 = L"CIM_SINT32";
00295     const static WCHAR *pCIM_UINT32 = L"CIM_UINT32";
00296     const static WCHAR *pCIM_SINT64 = L"CIM_SINT64";
00297     const static WCHAR *pCIM_UINT64 = L"CIM_UINT64";
00298     const static WCHAR *pCIM_REAL32 = L"CIM_REAL32";
00299     const static WCHAR *pCIM_REAL64 = L"CIM_REAL64";
00300     const static WCHAR *pCIM_BOOLEAN = L"CIM_BOOLEAN";
00301     const static WCHAR *pCIM_STRING = L"CIM_STRING";
00302     const static WCHAR *pCIM_DATETIME = L"CIM_DATETIME";
00303     const static WCHAR *pCIM_REFERENCE = L"CIM_REFERENCE";
00304     const static WCHAR *pCIM_OBJECT = L"CIM_OBJECT";
00305
00306     const static WCHAR *pCIM_ILLEGAL_ARRAY = L"CIM_ILLEGAL | CIM_FLAG_ARRAY";
00307     const static WCHAR *pCIM_EMPTY_ARRAY = L"CIM_EMPTY | CIM_FLAG_ARRAY";
00308     const static WCHAR *pCIM_SINT8_ARRAY = L"CIM_SINT8 | CIM_FLAG_ARRAY";
00309     const static WCHAR *pCIM_UINT8_ARRAY = L"CIM_UINT8 | CIM_FLAG_ARRAY";
00310     const static WCHAR *pCIM_SINT16_ARRAY = L"CIM_SINT16 | CIM_FLAG_ARRAY";
00311     const static WCHAR *pCIM_UINT16_ARRAY = L"CIM_UINT16 | CIM_FLAG_ARRAY";
00312     const static WCHAR *pCIM_SINT32_ARRAY = L"CIM_SINT32 | CIM_FLAG_ARRAY";
00313     const static WCHAR *pCIM_UINT32_ARRAY = L"CIM_UINT32 | CIM_FLAG_ARRAY";
00314     const static WCHAR *pCIM_SINT64_ARRAY = L"CIM_SINT64 | CIM_FLAG_ARRAY";
00315     const static WCHAR *pCIM_UINT64_ARRAY = L"CIM_UINT64 | CIM_FLAG_ARRAY";
00316     const static WCHAR *pCIM_REAL32_ARRAY = L"CIM_REAL32 | CIM_FLAG_ARRAY";
00317     const static WCHAR *pCIM_REAL64_ARRAY = L"CIM_REAL64 | CIM_FLAG_ARRAY";
00318     const static WCHAR *pCIM_BOOLEAN_ARRAY = L"CIM_BOOLEAN | CIM_FLAG_ARRAY";
00319     const static WCHAR *pCIM_STRING_ARRAY = L"CIM_STRING | CIM_FLAG_ARRAY";
00320     const static WCHAR *pCIM_DATETIME_ARRAY = L"CIM_DATETIME | CIM_FLAG_ARRAY";
00321     const static WCHAR *pCIM_REFERENCE_ARRAY = L"CIM_REFERENCE | CIM_FLAG_ARRAY";
00322     const static WCHAR *pCIM_OBJECT_ARRAY = L"CIM_OBJECT | CIM_FLAG_ARRAY";
00323
00324     const WCHAR *pRetVal;
00325
00326     switch (v)
00327     {
00328         case CIM_ILLEGAL: pRetVal = pCIM_ILLEGAL; break;
00329         case CIM_EMPTY: pRetVal = pCIM_EMPTY; break;
00330         case CIM_SINT8: pRetVal = pCIM_SINT8; break;
00331         case CIM_UINT8: pRetVal = pCIM_UINT8; break;
00332         case CIM_SINT16: pRetVal = pCIM_SINT16; break;
00333         case CIM_UINT16: pRetVal = pCIM_UINT16; break;
00334         case CIM_SINT32: pRetVal = pCIM_SINT32; break;
00335         case CIM_UINT32: pRetVal = pCIM_UINT32; break;
00336         case CIM_SINT64: pRetVal = pCIM_SINT64; break;
00337         case CIM_UINT64: pRetVal = pCIM_UINT64; break;
00338         case CIM_REAL32: pRetVal = pCIM_REAL32; break;
00339         case CIM_REAL64: pRetVal = pCIM_REAL64; break;
00340         case CIM_BOOLEAN: pRetVal = pCIM_BOOLEAN; break;
00341         case CIM_STRING: pRetVal = pCIM_STRING; break;
00342         case CIM_DATETIME: pRetVal = pCIM_DATETIME; break;
00343         case CIM_REFERENCE: pRetVal = pCIM_REFERENCE; break;
00344         case CIM_OBJECT: pRetVal = pCIM_OBJECT; break;
00345
00346         case CIM_SINT8 | CIM_FLAG_ARRAY: pRetVal = pCIM_SINT8_ARRAY; break;
00347         case CIM_UINT8 | CIM_FLAG_ARRAY: pRetVal = pCIM_UINT8_ARRAY; break;
00348         case CIM_SINT16 | CIM_FLAG_ARRAY: pRetVal = pCIM_SINT16_ARRAY; break;
00349         case CIM_UINT16 | CIM_FLAG_ARRAY: pRetVal = pCIM_UINT16_ARRAY; break;
00350         case CIM_SINT32 | CIM_FLAG_ARRAY: pRetVal = pCIM_SINT32_ARRAY; break;
00351         case CIM_UINT32 | CIM_FLAG_ARRAY: pRetVal = pCIM_UINT32_ARRAY; break;
00352         case CIM_SINT64 | CIM_FLAG_ARRAY: pRetVal = pCIM_SINT64_ARRAY; break;
00353         case CIM_UINT64 | CIM_FLAG_ARRAY: pRetVal = pCIM_UINT64_ARRAY; break;
00354         case CIM_REAL32 | CIM_FLAG_ARRAY: pRetVal = pCIM_REAL32_ARRAY; break;
00355         case CIM_REAL64 | CIM_FLAG_ARRAY: pRetVal = pCIM_REAL64_ARRAY; break;
00356         case CIM_BOOLEAN | CIM_FLAG_ARRAY: pRetVal = pCIM_BOOLEAN_ARRAY; break;
00357         case CIM_STRING | CIM_FLAG_ARRAY: pRetVal = pCIM_STRING_ARRAY; break;
00358         case CIM_DATETIME | CIM_FLAG_ARRAY: pRetVal = pCIM_DATETIME_ARRAY; break;
00359         case CIM_REFERENCE | CIM_FLAG_ARRAY: pRetVal = pCIM_REFERENCE_ARRAY; break;
00360         case CIM_OBJECT | CIM_FLAG_ARRAY: pRetVal = pCIM_OBJECT_ARRAY; break;
00361
00362         default: pRetVal = pCIM_UNKNOWN; break;
00363     }
00364
00365     return pRetVal;
00366 }
00367
00368 //*****************************************************************************
00369 // Function:   ValueToString
00370 // Purpose:    Takes a variant, returns a string representation of that variant
00371 //*****************************************************************************
00372 WCHAR *ValueToString(CIMTYPE dwType, VARIANT *pValue, WCHAR **pbuf, WCHAR *fnHandler(VARIANT *pv))
00373 {
00374     DWORD iTotBufSize;
00375
00376     WCHAR *vbuf = NULL;
00377     WCHAR *buf = NULL;
00378
00379     WCHAR lbuf[BLOCKSIZE];
00380
00381     switch (pValue->vt)
00382     {
00383         case VT_EMPTY:
00384         {
00385             buf = (WCHAR *)malloc(BLOCKSIZE);
00386             if (buf)
00387             {
00388                 StringCbCopyW(buf, BLOCKSIZE, L"<empty>");
00389             }
00390             break;
00391         }
00392
00393         case VT_NULL:
00394         {
00395             buf = (WCHAR *)malloc(BLOCKSIZE);
00396             if (buf)
00397             {
00398                 StringCbCopyW(buf, BLOCKSIZE, L"<null>");
00399             }
00400             break;
00401         }
00402
00403         case VT_BOOL:
00404         {
00405             VARIANT_BOOL b = pValue->boolVal;
00406             buf = (WCHAR *)malloc(BLOCKSIZE);
00407             if (buf)
00408             {
00409                 if (!b)
00410                 {
00411                     StringCbCopyW(buf, BLOCKSIZE, L"FALSE");
00412                 }
00413                 else
00414                 {
00415                     StringCbCopyW(buf, BLOCKSIZE, L"TRUE");
00416                 }
00417             }
00418             break;
00419         }
00420
00421         case VT_I1:
00422         {
00423             char b = pValue->bVal;
00424             buf = (WCHAR *)malloc(BLOCKSIZE);
00425             if (buf)
00426             {
00427                 if (b >= 32)
00428                 {
00429                     StringCbPrintfW(buf, BLOCKSIZE, L"'%c' (%hd, 0x%hX)", b, (signed char)b, b);
00430                 }
00431                 else
00432                 {
00433                     StringCbPrintfW(buf, BLOCKSIZE, L"%hd (0x%hX)", (signed char)b, b);
00434                 }
00435             }
00436             break;
00437         }
00438
00439         case VT_UI1:
00440         {
00441             unsigned char b = pValue->bVal;
00442             buf = (WCHAR *)malloc(BLOCKSIZE);
00443             if (buf)
00444             {
00445                 if (b >= 32)
00446                 {
00447                     StringCbPrintfW(buf, BLOCKSIZE, L"'%c' (%hu, 0x%hX)", b, (unsigned char)b, b);
00448                 }
00449                 else
00450                 {
00451                     StringCbPrintfW(buf, BLOCKSIZE, L"%hu (0x%hX)", (unsigned char)b, b);
00452                 }
00453             }
00454             break;
00455         }
00456
00457         case VT_I2:
00458         {
00459             SHORT i = pValue->iVal;
00460             buf = (WCHAR *)malloc(BLOCKSIZE);
00461             if (buf)
00462             {
00463                 StringCbPrintfW(buf, BLOCKSIZE, L"%hd (0x%hX)", i, i);
00464             }
00465             break;
00466         }
00467
00468         case VT_UI2:
00469         {
00470             USHORT i = pValue->uiVal;
00471             buf = (WCHAR *)malloc(BLOCKSIZE);
00472             if (buf)
00473             {
00474                 StringCbPrintfW(buf, BLOCKSIZE, L"%hu (0x%hX)", i, i);
00475             }
00476             break;
00477         }
00478
00479         case VT_I4:
00480         {
00481             LONG l = pValue->lVal;
00482             buf = (WCHAR *)malloc(BLOCKSIZE);
00483             if (buf)
00484             {
00485                 StringCbPrintfW(buf, BLOCKSIZE, L"%d (0x%X)", l, l);
00486             }
00487             break;
00488         }
00489
00490         case VT_UI4:
00491         {
00492             ULONG l = pValue->ulVal;
00493             buf = (WCHAR *)malloc(BLOCKSIZE);
00494             if (buf)
00495             {
00496                 StringCbPrintfW(buf, BLOCKSIZE, L"%u (0x%X)", l, l);
00497             }
00498             break;
00499         }
00500
00501         case VT_R4:
00502         {
00503             float f = pValue->fltVal;
00504             buf = (WCHAR *)malloc(CVTBUFSIZE * sizeof(WCHAR));
00505             if (buf)
00506             {
00507                 StringCbPrintfW(buf, BLOCKSIZE,  L"%10.4f", f);
00508             }
00509             break;
00510         }
00511
00512         case VT_R8:
00513         {
00514             double d = pValue->dblVal;
00515             buf = (WCHAR *)malloc(CVTBUFSIZE * sizeof(WCHAR));
00516             if (buf)
00517             {
00518                 StringCbPrintfW(buf, BLOCKSIZE, L"%10.4f", d);
00519             }
00520             break;
00521         }
00522
00523         case VT_BSTR:
00524         {
00525             if (dwType == CIM_SINT64)
00526             {
00527                 // a little redundant, but it makes me feel better
00528                 LPWSTR pWStr = pValue->bstrVal;
00529                 __int64 l = _wtoi64(pWStr);
00530
00531                 buf = (WCHAR *)malloc(BLOCKSIZE);
00532                 if (buf)
00533                 {
00534                     StringCbPrintfW(buf, BLOCKSIZE, L"%I64d", l);
00535                 }
00536             }
00537             else if (dwType == CIM_UINT64)
00538             {
00539                 // a little redundant, but it makes me feel better
00540                 LPWSTR pWStr = pValue->bstrVal;
00541                 __int64 l = _wtoi64(pWStr);
00542
00543                 buf = (WCHAR *)malloc(BLOCKSIZE);
00544                 if (buf)
00545                 {
00546                     StringCbPrintfW(buf, BLOCKSIZE,  L"%I64u", l);
00547                 }
00548             }
00549             else // string, datetime, reference
00550             {
00551                 LPWSTR pWStr = pValue->bstrVal;
00552                 buf = (WCHAR *)malloc((wcslen(pWStr) * sizeof(WCHAR)) + sizeof(WCHAR) + (2 * sizeof(WCHAR)));
00553                 if (buf)
00554                 {
00555                     StringCbPrintfW(buf, BLOCKSIZE,  L"\"%wS\"", pWStr);
00556                 }
00557             }
00558             break;
00559         }
00560
00561         case VT_BOOL|VT_ARRAY:
00562         {
00563             SAFEARRAY *pVec = pValue->parray;
00564             long iLBound, iUBound;
00565             BOOL bFirst = TRUE;
00566
00567             SafeArrayGetLBound(pVec, 1, &iLBound);
00568             SafeArrayGetUBound(pVec, 1, &iUBound);
00569             if ((iUBound - iLBound + 1) == 0)
00570             {
00571                 buf = (WCHAR *)malloc(BLOCKSIZE);
00572         if (buf)
00573         {
00574           StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00575         }
00576                 break;
00577             }
00578
00579             buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
00580             if (buf)
00581             {
00582                 StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
00583
00584                 for (long i = iLBound; i <= iUBound; i++)
00585                 {
00586                     if (!bFirst)
00587                     {
00588                         StringCbCatW(buf, (iUBound - iLBound + 1) * BLOCKSIZE, L",");
00589                     }
00590                     else
00591                     {
00592                         bFirst = FALSE;
00593                     }
00594
00595                     VARIANT_BOOL v;
00596                     SafeArrayGetElement(pVec, &i, &v);
00597                     if (v)
00598                     {
00599                         StringCbCatW(buf, (iUBound - iLBound + 1) * BLOCKSIZE, L"TRUE");
00600                     }
00601                     else
00602                     {
00603                         StringCbCatW(buf, (iUBound - iLBound + 1) * BLOCKSIZE, L"FALSE");
00604                     }
00605                 }
00606             }
00607
00608             break;
00609         }
00610
00611         case VT_I1|VT_ARRAY:
00612         {
00613             SAFEARRAY *pVec = pValue->parray;
00614             long iLBound, iUBound;
00615             BOOL bFirst = TRUE;
00616
00617             SafeArrayGetLBound(pVec, 1, &iLBound);
00618             SafeArrayGetUBound(pVec, 1, &iUBound);
00619             if ((iUBound - iLBound + 1) == 0)
00620             {
00621                 buf = (WCHAR *)malloc(BLOCKSIZE);
00622         if (buf)
00623         {
00624           StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00625         }
00626                 break;
00627             }
00628
00629             int bufSize = (iUBound - iLBound + 1) * BLOCKSIZE;
00630             buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
00631             if (buf)
00632             {
00633
00634                 StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
00635                 WCHAR *pos = buf;
00636                 DWORD len;
00637
00638                 BYTE *pbstr;
00639                 SafeArrayAccessData(pVec, (void HUGEP* FAR*)&pbstr);
00640
00641                 for (long i = iLBound; i <= iUBound; i++)
00642                 {
00643                     if (!bFirst)
00644                     {
00645                         StringCbCopyW(pos, bufSize - (pos - buf) * sizeof(WCHAR), L",");
00646                         pos += 1;
00647                     }
00648                     else
00649                     {
00650                         bFirst = FALSE;
00651                     }
00652
00653                     char v;
00654                     //            SafeArrayGetElement(pVec, &i, &v);
00655                     v = pbstr[i];
00656
00657                     if (v < 32)
00658                     {
00659                         len = StringCbPrintfW(lbuf, sizeof(lbuf), L"%hd (0x%X)", v, v);
00660                     }
00661                     else
00662                     {
00663                         len = StringCbPrintfW(lbuf, sizeof(lbuf), L"'%c' %hd (0x%X)", v, v, v);
00664                     }
00665                     StringCbCopyW(pos, bufSize - (pos - buf)*sizeof(WCHAR), lbuf);
00666                     pos += len;
00667                 }
00668             }
00669
00670             SafeArrayUnaccessData(pVec);
00671
00672             break;
00673         }
00674
00675         case VT_UI1|VT_ARRAY:
00676         {
00677             SAFEARRAY *pVec = pValue->parray;
00678             long iLBound, iUBound;
00679             BOOL bFirst = TRUE;
00680
00681             SafeArrayGetLBound(pVec, 1, &iLBound);
00682             SafeArrayGetUBound(pVec, 1, &iUBound);
00683             if ((iUBound - iLBound + 1) == 0)
00684             {
00685                 buf = (WCHAR *)malloc(BLOCKSIZE);
00686         if (buf)
00687         {
00688           StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00689         }
00690                 break;
00691             }
00692
00693       int bufsize = (iUBound - iLBound + 1) * BLOCKSIZE;
00694             buf = (WCHAR *)malloc(bufsize);
00695             if (buf)
00696             {
00697                 StringCbCopyW(buf, bufsize, L"");
00698                 WCHAR *pos = buf;
00699                 DWORD len;
00700
00701                 BYTE *pbstr;
00702                 SafeArrayAccessData(pVec, (void HUGEP* FAR*)&pbstr);
00703
00704                 for (long i = iLBound; i <= iUBound; i++)
00705                 {
00706                     if (!bFirst)
00707                     {
00708                         StringCbCopyW(pos, bufsize - ((pos - buf)*sizeof(WCHAR)), L",");
00709                         pos += 1;
00710                     }
00711                     else
00712                     {
00713                         bFirst = FALSE;
00714                     }
00715
00716                     unsigned char v;
00717                     //            SafeArrayGetElement(pVec, &i, &v);
00718                     v = pbstr[i];
00719
00720                     if (v < 32)
00721                     {
00722                         len = StringCbPrintfW(lbuf, sizeof(lbuf), L"%hu (0x%X)", v, v);
00723                     }
00724                     else
00725                     {
00726                         len = StringCbPrintfW(lbuf, sizeof(lbuf), L"'%c' %hu (0x%X)", v, v, v);
00727                     }
00728
00729                     StringCbCopyW(pos, bufsize - ((pos - buf)*sizeof(WCHAR)), lbuf);
00730                     pos += len;
00731                 }
00732             }
00733
00734             SafeArrayUnaccessData(pVec);
00735
00736             break;
00737         }
00738
00739         case VT_I2|VT_ARRAY:
00740         {
00741             SAFEARRAY *pVec = pValue->parray;
00742             long iLBound, iUBound;
00743             BOOL bFirst = TRUE;
00744
00745             SafeArrayGetLBound(pVec, 1, &iLBound);
00746             SafeArrayGetUBound(pVec, 1, &iUBound);
00747             if ((iUBound - iLBound + 1) == 0)
00748             {
00749                 buf = (WCHAR *)malloc(BLOCKSIZE);
00750         if (buf)
00751         {
00752           StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00753         }
00754                 break;
00755             }
00756
00757             buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
00758             if (buf)
00759             {
00760                 StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
00761
00762                 for (long i = iLBound; i <= iUBound; i++)
00763                 {
00764                     if (!bFirst)
00765                     {
00766                         StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L",");
00767                     }
00768                     else
00769                     {
00770                         bFirst = FALSE;
00771                     }
00772
00773                     SHORT v;
00774                     SafeArrayGetElement(pVec, &i, &v);
00775                     StringCbPrintfW(lbuf, sizeof(lbuf), L"%hd", v);
00776                     StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), lbuf);
00777                 }
00778             }
00779
00780             break;
00781         }
00782
00783         case VT_UI2|VT_ARRAY:
00784         {
00785             SAFEARRAY *pVec = pValue->parray;
00786             long iLBound, iUBound;
00787             BOOL bFirst = TRUE;
00788
00789             SafeArrayGetLBound(pVec, 1, &iLBound);
00790             SafeArrayGetUBound(pVec, 1, &iUBound);
00791             if ((iUBound - iLBound + 1) == 0)
00792             {
00793                 buf = (WCHAR *)malloc(BLOCKSIZE);
00794         if (buf)
00795         {
00796                   StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00797         }
00798                 break;
00799             }
00800
00801             buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
00802             if (buf)
00803             {
00804                 StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
00805
00806                 for (long i = iLBound; i <= iUBound; i++)
00807                 {
00808                     if (!bFirst)
00809                     {
00810                         StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L",");
00811                     }
00812                     else
00813                     {
00814                         bFirst = FALSE;
00815                     }
00816
00817                     USHORT v;
00818                     SafeArrayGetElement(pVec, &i, &v);
00819                     StringCbPrintfW(lbuf, sizeof(lbuf), L"%hu", v);
00820                     StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), lbuf);
00821                 }
00822             }
00823
00824             break;
00825         }
00826
00827         case VT_I4|VT_ARRAY:
00828         {
00829             SAFEARRAY *pVec = pValue->parray;
00830             long iLBound, iUBound;
00831             BOOL bFirst = TRUE;
00832
00833             SafeArrayGetLBound(pVec, 1, &iLBound);
00834             SafeArrayGetUBound(pVec, 1, &iUBound);
00835             if ((iUBound - iLBound + 1) == 0)
00836             {
00837                 buf = (WCHAR *)malloc(BLOCKSIZE);
00838         if (buf)
00839         {
00840                   StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00841         }
00842                 break;
00843             }
00844
00845             buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
00846             if (buf)
00847             {
00848                 StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
00849
00850                 for (long i = iLBound; i <= iUBound; i++)
00851                 {
00852                     if (!bFirst)
00853                     {
00854                         StringCbCatW(buf,((iUBound - iLBound + 1) * BLOCKSIZE), L",");
00855                     }
00856                     else
00857                     {
00858                         bFirst = FALSE;
00859                     }
00860
00861                     LONG v;
00862                     SafeArrayGetElement(pVec, &i, &v);
00863                     _ltow(v, lbuf, 10);
00864                     StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), lbuf);
00865                 }
00866             }
00867
00868             break;
00869         }
00870
00871         case VT_UI4|VT_ARRAY:
00872         {
00873             SAFEARRAY *pVec = pValue->parray;
00874             long iLBound, iUBound;
00875             BOOL bFirst = TRUE;
00876
00877             SafeArrayGetLBound(pVec, 1, &iLBound);
00878             SafeArrayGetUBound(pVec, 1, &iUBound);
00879             if ((iUBound - iLBound + 1) == 0)
00880             {
00881                 buf = (WCHAR *)malloc(BLOCKSIZE);
00882         if (buf)
00883         {
00884                   StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00885         }
00886                 break;
00887             }
00888
00889             buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
00890             if (buf)
00891             {
00892                 StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
00893
00894                 for (long i = iLBound; i <= iUBound; i++)
00895                 {
00896                     if (!bFirst)
00897                     {
00898                         StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L",");
00899                     }
00900                     else
00901                     {
00902                         bFirst = FALSE;
00903                     }
00904
00905                     ULONG v;
00906                     SafeArrayGetElement(pVec, &i, &v);
00907                     _ultow(v, lbuf, 10);
00908                     StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), lbuf);
00909                 }
00910             }
00911
00912             break;
00913         }
00914
00915         case CIM_REAL32|VT_ARRAY:
00916         {
00917             SAFEARRAY *pVec = pValue->parray;
00918             long iLBound, iUBound;
00919             BOOL bFirst = TRUE;
00920
00921             SafeArrayGetLBound(pVec, 1, &iLBound);
00922             SafeArrayGetUBound(pVec, 1, &iUBound);
00923             if ((iUBound - iLBound + 1) == 0)
00924             {
00925                 buf = (WCHAR *)malloc(BLOCKSIZE);
00926         if (buf)
00927         {
00928                   StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00929         }
00930                 break;
00931             }
00932
00933             int bufSize = (iUBound - iLBound + 1) * (CVTBUFSIZE * sizeof(WCHAR));
00934             buf = (WCHAR *)malloc(bufSize);
00935             if (buf)
00936             {
00937                 StringCbCopyW(buf,  bufSize, L"");
00938
00939                 for (long i = iLBound; i <= iUBound; i++)
00940                 {
00941                     if (!bFirst)
00942                     {
00943                         StringCbCatW(buf, bufSize, L",");
00944                     }
00945                     else
00946                     {
00947                         bFirst = FALSE;
00948                     }
00949
00950                     FLOAT v;
00951                     SafeArrayGetElement(pVec, &i, &v);
00952                     StringCbPrintfW(lbuf, sizeof(lbuf), L"%10.4f", v);
00953                     StringCbCatW(buf, bufSize, lbuf);
00954                 }
00955             }
00956
00957             break;
00958         }
00959
00960         case CIM_REAL64|VT_ARRAY:
00961         {
00962             SAFEARRAY *pVec = pValue->parray;
00963             long iLBound, iUBound;
00964             BOOL bFirst = TRUE;
00965
00966             SafeArrayGetLBound(pVec, 1, &iLBound);
00967             SafeArrayGetUBound(pVec, 1, &iUBound);
00968             if ((iUBound - iLBound + 1) == 0)
00969             {
00970                 buf = (WCHAR *)malloc(BLOCKSIZE);
00971         if (buf)
00972         {
00973                   StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
00974         }
00975                 break;
00976             }
00977
00978             int bufSize = (iUBound - iLBound + 1) * (CVTBUFSIZE * sizeof(WCHAR));
00979             buf = (WCHAR *)malloc(bufSize);
00980             if (buf)
00981             {
00982                 StringCbCopyW(buf, bufSize, L"");
00983
00984                 for (long i = iLBound; i <= iUBound; i++)
00985                 {
00986                     if (!bFirst)
00987                     {
00988                         StringCbCatW(buf, bufSize, L",");
00989                     }
00990                     else
00991                     {
00992                         bFirst = FALSE;
00993                     }
00994
00995                     double v;
00996                     SafeArrayGetElement(pVec, &i, &v);
00997                     StringCbPrintfW(lbuf, sizeof(lbuf), L"%10.4f", v);
00998                     StringCbCatW(buf, bufSize, lbuf);
00999                 }
01000             }
01001
01002             break;
01003         }
01004
01005         case VT_BSTR|VT_ARRAY:
01006         {
01007             if (dwType == (CIM_UINT64|VT_ARRAY))
01008             {
01009                 SAFEARRAY *pVec = pValue->parray;
01010                 long iLBound, iUBound;
01011                 BOOL bFirst = TRUE;
01012
01013                 SafeArrayGetLBound(pVec, 1, &iLBound);
01014                 SafeArrayGetUBound(pVec, 1, &iUBound);
01015                 if ((iUBound - iLBound + 1) == 0)
01016                 {
01017                     buf = (WCHAR *)malloc(BLOCKSIZE);
01018           if (buf)
01019           {
01020                       StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
01021           }
01022                     break;
01023                 }
01024
01025                 buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
01026                 if (buf)
01027                 {
01028                     StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
01029
01030                     for (long i = iLBound; i <= iUBound; i++)
01031                     {
01032                         if (!bFirst)
01033                         {
01034                             StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L",");
01035                         }
01036                         else
01037                         {
01038                             bFirst = FALSE;
01039                         }
01040
01041                         BSTR v = NULL;
01042
01043                         SafeArrayGetElement(pVec, &i, &v);
01044
01045                         StringCbPrintfW(lbuf, sizeof(lbuf), L"%I64u", _wtoi64(v));
01046                         StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), lbuf);
01047                     }
01048                 }
01049             }
01050             else if (dwType == (CIM_SINT64|VT_ARRAY))
01051             {
01052                 SAFEARRAY *pVec = pValue->parray;
01053                 long iLBound, iUBound;
01054                 BOOL bFirst = TRUE;
01055
01056                 SafeArrayGetLBound(pVec, 1, &iLBound);
01057                 SafeArrayGetUBound(pVec, 1, &iUBound);
01058                 if ((iUBound - iLBound + 1) == 0)
01059                 {
01060                     buf = (WCHAR *)malloc(BLOCKSIZE);
01061           if (buf)
01062           {
01063                       StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
01064           }
01065                     break;
01066                 }
01067
01068                 buf = (WCHAR *)malloc((iUBound - iLBound + 1) * BLOCKSIZE);
01069                 if (buf)
01070                 {
01071                     StringCbCopyW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L"");
01072
01073                     for (long i = iLBound; i <= iUBound; i++)
01074                     {
01075                         if (!bFirst)
01076                         {
01077                             StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), L",");
01078                         }
01079                         else
01080                         {
01081                             bFirst = FALSE;
01082                         }
01083
01084                         BSTR v = NULL;
01085
01086                         SafeArrayGetElement(pVec, &i, &v);
01087
01088                         StringCbPrintfW(lbuf, sizeof(lbuf), L"%I64d", _wtoi64(v));
01089                         StringCbCatW(buf, ((iUBound - iLBound + 1) * BLOCKSIZE), lbuf);
01090                     }
01091                 }
01092             }
01093             else // string, datetime, reference
01094             {
01095                 SAFEARRAY *pVec = pValue->parray;
01096                 long iLBound, iUBound;
01097                 DWORD iNeed;
01098                 size_t iVSize;
01099                 DWORD iCurBufSize;
01100
01101                 SafeArrayGetLBound(pVec, 1, &iLBound);
01102                 SafeArrayGetUBound(pVec, 1, &iUBound);
01103                 if ((iUBound - iLBound + 1) == 0)
01104                 {
01105                     buf = (WCHAR *)malloc(BLOCKSIZE);
01106           if (buf)
01107           {
01108                       StringCbCopyW(buf, BLOCKSIZE, L"<empty array>");
01109           }
01110                     break;
01111                 }
01112
01113                 iTotBufSize = (iUBound - iLBound + 1) * BLOCKSIZE;
01114                 buf = (WCHAR *)malloc(iTotBufSize);
01115                 if (buf)
01116                 {
01117                     buf[0] = L'\0';
01118                     iCurBufSize = 0;
01119                     iVSize = BLOCKSIZE;
01120                     vbuf = (WCHAR *)malloc(BLOCKSIZE);
01121                     if (vbuf)
01122                     {
01123                         size_t iLen;
01124
01125                         for (long i = iLBound; i <= iUBound; i++)
01126                         {
01127                             BSTR v = NULL;
01128                             SafeArrayGetElement(pVec, &i, &v);
01129                             iLen = (SysStringLen(v) + 1) * sizeof(WCHAR);
01130                             if (iLen > iVSize)
01131                             {
01132                                 vbuf = (WCHAR *)realloc(vbuf, iLen + sizeof(WCHAR));
01133                                 iVSize = iLen;
01134                             }
01135
01136                             // String size + (quotes + comma + null)
01137               if (vbuf)
01138               {
01139                 iNeed = (StringCbPrintfW(vbuf, iVSize, L"%wS", v) + 4) * sizeof(WCHAR);
01140                 if (iNeed + iCurBufSize > iTotBufSize)
01141                 {
01142                   iTotBufSize += (iNeed * 2);  // Room enough for 2 more entries
01143                   buf = (WCHAR *)realloc(buf, iTotBufSize);
01144                 }
01145                 if (buf)
01146                 {
01147                   StringCbCatW(buf, iTotBufSize, L"\"");
01148                   StringCbCatW(buf, iTotBufSize, vbuf);
01149                   if (i + 1 <= iUBound)
01150                   {
01151                     StringCbCatW(buf, iTotBufSize, L"\",");
01152                   }
01153                   else
01154                   {
01155                     StringCbCatW(buf, iTotBufSize, L"\"");
01156                   }
01157                   iCurBufSize += iNeed;
01158                 }
01159               }
01160                             SysFreeString(v);
01161                         }
01162                         free(vbuf);
01163                     }
01164                 }
01165             }
01166
01167             break;
01168         }
01169
01170         default:
01171         {
01172             if (fnHandler != NULL)
01173             {
01174                 buf = fnHandler(pValue);
01175             }
01176             else
01177             {
01178                 buf = (WCHAR *)malloc(BLOCKSIZE);
01179                 if (buf)
01180                 {
01181                     StringCbCopyW(buf, BLOCKSIZE, L"<conversion error>");
01182                 }
01183             }
01184             break;
01185         }
01186    }
01187
01188    if (!buf)
01189    {
01190        PrintErrorAndExit("ValueToString() out of memory", S_OK, 0);
01191    }
01192
01193    *pbuf = buf;
01194    return buf;
01195 }
01196
01197 //*****************************************************************************
01198 // Function:   cvt
01199 // Purpose:    Converts unicode to oem for console output
01200 // Note:       y must be freed by caller. x must be null-terminated.
01201 //*****************************************************************************
01202 char *cvt(WCHAR *x, char **y)
01203 {
01204     int dwRet, i;
01205     i = WideCharToMultiByte( CP_OEMCP,
01206         0,
01207         x,
01208         -1,
01209         NULL,
01210         0,
01211         NULL,
01212         NULL);
01213
01214   if (i == 0)
01215   {
01216         PrintErrorAndExit("cvt() failed", S_OK, 0);
01217     }
01218
01219     *y = (char *)calloc(i, 1);
01220
01221     if (*y)
01222     {
01223         dwRet = WideCharToMultiByte( CP_OEMCP,
01224             0,
01225             x,
01226             -1,
01227             *y,
01228             i,
01229             NULL,
01230             NULL);
01231
01232         if (dwRet == 0)
01233         {
01234             free(*y);
01235             *y = (char *)malloc(sizeof(CVTFAILED));
01236             if (*y)
01237             {
01238                 memcpy(*y, CVTFAILED, sizeof(CVTFAILED));
01239             }
01240       else
01241       {
01242         PrintErrorAndExit("cvt() out of memory", S_OK, 0);
01243       }
01244         }
01245     }
01246     else
01247     {
01248         PrintErrorAndExit("cvt() out of memory", S_OK, 0);
01249     }
01250
01251     return *y;
01252 }
01253
01254 //*****************************************************************************
01255 // Function:   difftime
01256 // Purpose:    Returns the elapsed time between two _timeb structures
01257 // Note:       This is different from the crt routine which works on time_t
01258 //             structures.
01259 //*****************************************************************************
01260 double difftime(struct _timeb finish, struct _timeb start)
01261 {
01262     double dRet;
01263
01264     if (start.millitm > finish.millitm)
01265     {
01266         dRet = ((finish.time - start.time) - 1) + (double)(((1000 + finish.millitm) - start.millitm) / 1000.0);
01267     }
01268     else
01269     {
01270         dRet = (finish.time - start.time) + (double)((finish.millitm - start.millitm) / 1000.0);
01271     }
01272
01273     return dRet;
01274 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/Main.Cpp Source File

  • Web
  • NetMeeting
  • NMShare

Main.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       MAIN.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 //****************************************************************************
00019 //
00020 // Global Variables
00021 //
00022 //****************************************************************************
00023
00024
00025 HINSTANCE ghInst       = NULL;          // Current Instance
00026 HACCEL    ghAccelTable = NULL;          // Menu accelerators
00027 HMENU     ghMenu       = NULL;          // Main Menu
00028 HWND      ghwndMain    = NULL;          // Main Window
00029 HWND      ghwndSbar    = NULL;          // Status Bar
00030 HWND      ghwndMsg     = hwndNil;       // Message window
00031 HWND      ghwndApp     = hwndNil;       // Application List
00032 HWND      ghwndUser    = hwndNil;       // User List
00033 HFONT     ghfontMsg    = hfontNil;      // Font for messages
00034 PREF      gPref;
00035
00036
00037 TCHAR gszAppTitle[]     = TEXT("NetMeeting Sharing Test Application");
00038
00039 // string constants (no change for international)
00040 TCHAR gszAppClassName[] = TEXT("NMSHARE");
00041 TCHAR gszAppName[]      = TEXT("NmShare");
00042
00043 // List column information
00044
00045 typedef struct _tagCol {
00046   UINT  dwWidth;
00047   LPTSTR lpsz;
00048 } COL;
00049 typedef COL * LPCOL;
00050
00051
00052 // See ILV_*
00053 static COL _rgColMsg[] = {
00054   {70,  TEXT("INmApp")},
00055   {70,  TEXT("Hwnd")},
00056   {70,  TEXT("Status")},
00057   {400, TEXT("Name")},
00058 };
00059
00060
00061 //****************************************************************************
00062 //
00063 // BOOL FInitPref(void)
00064 //
00065 // Initialize user preferences
00066 //
00067 //****************************************************************************
00068
00069 BOOL FInitPref(void)
00070 {
00071   ClearStruct(&gPref);
00072   gPref.fMsgWindow = TRUE;
00073   gPref.fUserList = TRUE;
00074   return TRUE;
00075 }
00076
00077
00078 //****************************************************************************
00079 //
00080 // BOOL FCreateAppWindow(void)
00081 //
00082 // Create the application list window
00083 //
00084 //****************************************************************************
00085
00086 BOOL FCreateAppWindow(void)
00087 {
00088   ghwndApp = CreateWindow(TEXT("SysListView32"), NULL,
00089     WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LVS_REPORT,
00090     0, 0, 0, 0,
00091     ghwndMain, (HMENU) IDW_APP, ghInst, NULL);
00092   if (ghwndApp == NULL)
00093     return FALSE;
00094
00095   // Initialize column data
00096   {
00097     int   iCol = 0;
00098     LPCOL lpCol = NULL;
00099     LV_COLUMN lvc;
00100
00101     lpCol = _rgColMsg;
00102     ClearStruct(&lvc);
00103     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00104     lvc.fmt = LVCFMT_LEFT;
00105     for (iCol = 0; iCol < ARRAY_ELEMENTS(_rgColMsg); iCol++)
00106     {
00107       lvc.iSubItem = iCol;
00108       lvc.cx = lpCol->dwWidth;
00109       lvc.pszText = lpCol->lpsz;
00110       if (ListView_InsertColumn(ghwndApp, iCol, &lvc) == -1)
00111         return FALSE;
00112       lpCol++;
00113     }
00114   }
00115
00116   return TRUE;
00117 }
00118
00119
00120 //****************************************************************************
00121 //
00122 // BOOL FCreateUserList(void)
00123 //
00124 // Create a listbox for the users
00125 //
00126 //****************************************************************************
00127
00128 BOOL FCreateUserList(void)
00129 {
00130   ghwndUser = CreateWindow(TEXT("SysListView32"), NULL,
00131     WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LVS_REPORT | LVS_SHOWSELALWAYS,
00132     0, 0, DXP_USER, 0,
00133     ghwndMain, (HMENU) IDW_USER, ghInst, NULL);
00134
00135   if (NULL == ghwndUser)
00136     return FALSE;
00137
00138   // Initialize column data
00139   {
00140     LV_COLUMN lvc;
00141
00142     ClearStruct(&lvc);
00143     lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00144     lvc.fmt = LVCFMT_LEFT;
00145     lvc.iSubItem = 0;
00146     lvc.cx = DXP_USER;
00147     lvc.pszText = TEXT("Users");
00148     if (ListView_InsertColumn(ghwndUser, 0, &lvc) == -1)
00149       return FALSE;
00150   }
00151
00152   return TRUE;
00153 }
00154
00155
00156 //****************************************************************************
00157 //
00158 // BOOL FCreateMsgWindow(void)
00159 //
00160 // Create the main message window
00161 //
00162 //****************************************************************************
00163
00164 BOOL FCreateMsgWindow(void)
00165 {
00166   ghwndMsg = CreateWindow(TEXT("LISTBOX"), NULL,
00167     WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | WS_CLIPSIBLINGS |
00168     LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | LBS_HASSTRINGS,
00169     0, 0, 0, 0,
00170     ghwndMain, (HMENU) IDW_MSG, ghInst, NULL);
00171   if (NULL == ghwndMsg)
00172     return FALSE;
00173
00174   // set the font for the window
00175   ghfontMsg = CreateFontIndirect(&gPref.lf);
00176   if (ghfontMsg == hfontNil)
00177     return TRUE;
00178
00179   SendMessage(ghwndMsg, WM_SETFONT, (WPARAM) ghfontMsg, MAKELPARAM(TRUE, 0));
00180
00181   return TRUE;
00182 }
00183
00184
00185 //****************************************************************************
00186 //
00187 // BOOL FInitMain(void)
00188 //
00189 // Initialize the window data and register the window class
00190 //
00191 //****************************************************************************
00192
00193 BOOL FInitMain(void)
00194 {
00195   TCHAR szTitle[MAX_PATH + 1];
00196   WNDCLASS  wc;
00197
00198   ASSERT(NULL != ghInst);
00199
00200   ZeroMemory(szTitle,(MAX_PATH + 1) * sizeof(TCHAR));
00201
00202   ghAccelTable = LoadAccelerators(ghInst, MAKEINTRESOURCE(ID_APPACCEL));
00203
00204   LoadString(ghInst, IDS_APP_TITLE, szTitle, CCHMAX(szTitle));
00205
00206   wc.style         = CS_HREDRAW | CS_VREDRAW;
00207   wc.lpfnWndProc   = (WNDPROC)WndProc;
00208   wc.cbClsExtra    = 0;
00209   wc.cbWndExtra    = 0;
00210   wc.hInstance     = ghInst;
00211   wc.hIcon         = LoadIcon(ghInst, MAKEINTRESOURCE(ICO_MAIN));
00212   wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00213   wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
00214   wc.lpszMenuName  = MAKEINTRESOURCE(IDM_APP);
00215   wc.lpszClassName = gszAppClassName;
00216
00217   // Register the window class and return FALSE if unsuccesful.
00218   if (!RegisterClass(&wc))
00219     return FALSE;
00220
00221   // Create a main window for this application instance.
00222   ghwndMain = CreateWindow(gszAppClassName, szTitle, WS_OVERLAPPEDWINDOW,
00223     0, 0, 400, 300,
00224     NULL, NULL, ghInst, NULL);
00225   if (ghwndMain == NULL)
00226     return FALSE;
00227
00228   ghMenu = GetMenu(ghwndMain);
00229   return (NULL != ghMenu);
00230 }
00231
00232
00233 //****************************************************************************
00234 //
00235 // BOOL FInitApp(LPSTR lpszCmd, int nCmdShow)
00236 //
00237 // Initialize the application after checking command line, etc.
00238 //
00239 //****************************************************************************
00240
00241 BOOL FInitApp(LPSTR lpszCmd, int nCmdShow)
00242 {
00243   InitCommonControls();
00244
00245   if (FAILED(CoInitialize(NULL)))
00246     return FALSE;
00247
00248   if (!FInitPref())
00249     return FALSE;
00250
00251   if (!FInitMain())
00252     return FALSE;
00253
00254   if (!FCreateMsgWindow())
00255     return FALSE;
00256
00257   if (!FCreateUserList())
00258     return FALSE;
00259
00260   if (!FCreateAppWindow())
00261     return FALSE;
00262
00263   ASSERT(NULL != ghwndMain);
00264   ShowWindow(ghwndMain, nCmdShow);
00265   UpdateWindow(ghwndMain);
00266
00267   return S_OK == InitConfMgr();
00268 }
00269
00270
00271 //****************************************************************************
00272 //
00273 // VOID TerminateApp(void)
00274 //
00275 //****************************************************************************
00276
00277 VOID TerminateApp(void)
00278 {
00279   // Release all objects to which this app has a reference
00280   FreeAllApps();
00281   FreeAppShareChannel();
00282   FreeAllUsers();
00283   FreeConference();
00284   FreeConfMgr();
00285
00286     // Uninitialize OLE
00287     CoUninitialize();
00288 }
00289
00290
00291 //****************************************************************************
00292 //
00293 // int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPSTR  lpszCmd, int nCmdShow)
00294 //
00295 //****************************************************************************
00296
00297 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPSTR  lpszCmd, int nCmdShow)
00298 {
00299   ghInst = hInstance;
00300
00301   if (FInitApp(lpszCmd, nCmdShow))
00302   {
00303     MSG  msg;
00304     while (GetMessage(&msg, NULL, 0, 0))
00305     {
00306       if (!TranslateAccelerator(msg.hwnd, ghAccelTable, &msg))
00307       {
00308         TranslateMessage(&msg);
00309         DispatchMessage(&msg);
00310       }
00311     }
00312   }
00313
00314   TerminateApp();
00315
00316   return 0;
00317 }
00318
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/UtilCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

UtilCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTILCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COUtilityCar COM
00005              object class.
00006
00007              UTILCAR showcases the construction of the COUtilityCar COM
00008              object class with the IUnknown, ICar, and IUtility interfaces.
00009              This is done through Containment reuse of COCar's ICar
00010              interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial DLLSERVE.HTM file.
00014              For more specific technical details on the internal workings
00015              see the comments dispersed throughout the module's source code.
00016
00017   Classes:   COUtilityCar.
00018
00019   Functions: none.
00020
00021   Origin:    9-11-95: atrent - Editor-inheritance from UTILCAR.CPP in
00022                the COMOBJ Tutorial Code Sample.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will be calling the COM/OLE Libraries.
00042   We include APPUTIL.H because we will be building this application using
00043     the convenient Virtual Window and Dialog classes and other
00044     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00045   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00046     class, GUID, and CLSID specifications.
00047   We include SERVER.H because it has internal class declarations and
00048     resource ID definitions specific for this DLL.
00049   We include CAR.H because it has the class COCar declarations.
00050   We include UTILCAR.H because it has the class COUtilityCar declarations.
00051 ---------------------------------------------------------------------------*/
00052 #include <windows.h>
00053 #include <ole2.h>
00054 #include <apputil.h>
00055 #include <icars.h>
00056 #include <carguids.h>
00057 #include "server.h"
00058 #include "car.h"
00059 #include "utilcar.h"
00060
00061
00062 /*---------------------------------------------------------------------------
00063   COUtilityCar's implementation of its main COM object class including
00064   Constructor, Destructor, QueryInterface, AddRef, and Release.
00065 ---------------------------------------------------------------------------*/
00066
00067 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00068   Method:   COUtilityCar::COUtilityCar
00069
00070   Summary:  COUtilityCar Constructor. Note the member initializers:
00071             "m_ImpICar(this, pUnkOuter)" and "m_ImpIUtility(this,
00072             pUnkOuter)" which are used to pass the 'this' and
00073             pUnkOuter pointers of this constructor function to the
00074             constructors that instantiate the implementations of
00075             the CImpICar and CImpIUtility interfaces (which are both
00076             nested inside this present COUtilityCar Object Class.
00077
00078   Args:     IUnknown* pUnkOuter,
00079               Pointer to the the outer Unknown.  NULL means this COM Object
00080               is not being Aggregated.  Non NULL means it is being created
00081               on behalf of an outside COM object that is reusing it via
00082               aggregation.
00083             CServer* pServer)
00084               Pointer to the server's control object.
00085
00086   Modifies: m_cRefs, m_pUnkOuter.
00087
00088   Returns:  void
00089 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00090 COUtilityCar::COUtilityCar(
00091   IUnknown* pUnkOuter,
00092   CServer* pServer) :
00093   m_ImpICar(this, pUnkOuter),
00094   m_ImpIUtility(this, pUnkOuter)
00095 {
00096   // Zero the COM object's reference count.
00097   m_cRefs = 0;
00098
00099   // No AddRef necessary if non-NULL, as we're nested.
00100   m_pUnkOuter = pUnkOuter;
00101
00102   // Zero the pointer to the contained COCar object's ICar interface.
00103   m_pICar = NULL;
00104
00105   // Init the pointer to the server's control object.
00106   m_pServer = pServer;
00107
00108   LOGF1("S: COUtilityCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00109
00110   return;
00111 }
00112
00113
00114 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00115   Method:   COUtilityCar::~COUtilityCar
00116
00117   Summary:  COUtilityCar Destructor.
00118
00119   Args:     void
00120
00121   Returns:  void
00122 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00123 COUtilityCar::~COUtilityCar(void)
00124 {
00125   LOG("S: COUtilityCar::Destructor.");
00126
00127   // Release the contained Car object.
00128   m_pICar->Release();
00129
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   COUtilityCar::Init
00136
00137   Summary:  COUtilityCar Initialization method.
00138
00139   Args:     void
00140
00141   Modifies: m_pUnkCar, m_pICar, m_cRefs.
00142
00143   Returns:  HRESULT
00144               Standard result code. NOERROR for success.
00145 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00146 HRESULT COUtilityCar::Init(void)
00147 {
00148   HRESULT hr;
00149
00150   LOG("S: COUtilityCar::Init.");
00151
00152   // Set up the right pIUnknown for delegation.  If we are being
00153   // aggregated then we pass the pUnkOuter in turn to any COM objects
00154   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00155   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00156
00157   // We create an instance of the COCar object and do this via the
00158   // Containment reuse technique.  We ask for the new COM object's
00159   // ICar interface directly.  We pass NULL for the pUnkOuter
00160   // aggregation pointer because we are not aggregating.  It is here
00161   // that we are reusing the COCar COM Object through the Containment
00162   // technique.  We cache the requested ICar interface pointer in this
00163   // COUtilityCar COM object for later use.  We don't need to AddRef
00164   // this interface because the CoCreateInstance will do this for us.
00165   hr = CoCreateInstance(
00166          CLSID_DllCar,
00167          NULL,
00168          CLSCTX_INPROC_SERVER,
00169          IID_ICar,
00170          (PPVOID)&m_pICar);
00171
00172   if (SUCCEEDED(hr))
00173   {
00174     LOG("S: COUtilityCar::Init (New Containment of COCar) Succeeded.");
00175   }
00176   else
00177   {
00178     LOG("S: COUtilityCar::Init (New Containment of COCar) Failed.");
00179   }
00180
00181   return (hr);
00182 }
00183
00184
00185 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00186   Method:   COUtilityCar::QueryInterface
00187
00188   Summary:  QueryInterface of the COUtilityCar non-delegating
00189             IUnknown implementation.
00190
00191   Args:     REFIID riid,
00192               [in] GUID of the Interface being requested.
00193             PPVOID ppv)
00194               [out] Address of the caller's pointer variable that will
00195               receive the requested interface pointer.
00196
00197   Returns:  HRESULT
00198 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00199 STDMETHODIMP COUtilityCar::QueryInterface(
00200                REFIID riid,
00201                PPVOID ppv)
00202 {
00203   HRESULT hr = E_NOINTERFACE;
00204   *ppv = NULL;
00205
00206   if (IID_IUnknown == riid)
00207   {
00208     *ppv = this;
00209     LOG("S: COUtilityCar::QueryInterface. 'this' pIUnknown returned");
00210   }
00211   else if (IID_ICar == riid)
00212   {
00213     *ppv = &m_ImpICar;
00214     LOG("S: COUtilityCar::QueryInterface. pICar returned");
00215   }
00216   else if (IID_IUtility == riid)
00217   {
00218     *ppv = &m_ImpIUtility;
00219     LOG("S: COUtilityCar::QueryInterface. pIUtility returned");
00220   }
00221
00222   if (NULL != *ppv)
00223   {
00224     // We've handed out a pointer to the interface so obey the COM rules
00225     //   and AddRef the reference count.
00226     ((LPUNKNOWN)*ppv)->AddRef();
00227     hr = NOERROR;
00228   }
00229
00230   return (hr);
00231 }
00232
00233
00234 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00235   Method:   COUtilityCar::AddRef
00236
00237   Summary:  AddRef of the COUtilityCar non-delegating IUnknown implementation.
00238
00239   Args:     void
00240
00241   Modifies: m_cRefs.
00242
00243   Returns:  ULONG
00244               New value of m_cRefs (COM object's reference count).
00245 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00246 STDMETHODIMP_(ULONG) COUtilityCar::AddRef(void)
00247 {
00248   m_cRefs++;
00249
00250   LOGF1("S: COUtilityCar::AddRef. New cRefs=%i.", m_cRefs);
00251
00252   return m_cRefs;
00253 }
00254
00255
00256 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00257   Method:   COUtilityCar::Release
00258
00259   Summary:  Release of the COUtilityCar non-delegating IUnknown implementation.
00260
00261   Args:     void
00262
00263   Modifies: m_cRefs.
00264
00265   Returns:  ULONG
00266               New value of m_cRefs (COM object's reference count).
00267 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00268 STDMETHODIMP_(ULONG) COUtilityCar::Release(void)
00269 {
00270   m_cRefs--;
00271
00272   LOGF1("S: COUtilityCar::Release. New cRefs=%i.", m_cRefs);
00273
00274   if (0 == m_cRefs)
00275   {
00276     // We've reached a zero reference count for this COM object.
00277     // So we tell the server housing to decrement its global object
00278     // count so that the server will be unloaded if appropriate.
00279     if (NULL != m_pServer)
00280       m_pServer->ObjectsDown();
00281
00282     // We artificially bump the main ref count to prevent reentrancy
00283     // via the main object destructor.
00284     m_cRefs++;
00285     delete this;
00286   }
00287
00288   return m_cRefs;
00289 }
00290
00291
00292 /*---------------------------------------------------------------------------
00293   COUtilityCar's nested implementation of the ICar interface including
00294   Constructor, Destructor, QueryInterface, AddRef, Release,
00295   Shift, Clutch, Speed, and Steer.
00296 ---------------------------------------------------------------------------*/
00297
00298 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00299   Method:   COUtilityCar::CImpICar::CImpICar
00300
00301   Summary:  Constructor for the CImpICar interface instantiation.
00302
00303   Args:     COUtilityCar* pBackObj,
00304               Back pointer to the parent outer object.
00305             IUnknown* pUnkOuter,
00306               Pointer to the outer Unknown.  For delegation.
00307
00308   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00309
00310   Returns:  void
00311 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00312 COUtilityCar::CImpICar::CImpICar(
00313   COUtilityCar* pBackObj,
00314   IUnknown* pUnkOuter)
00315 {
00316   // Init the Interface Ref Count (used for debugging only).
00317   m_cRefI = 0;
00318
00319   // Init the Back Object Pointer to point to the outer object.
00320   m_pBackObj = pBackObj;
00321
00322   // Init the CImpICar interface's delegating Unknown pointer.  We use
00323   // the Back Object pointer for IUnknown delegation here if we are not
00324   // being aggregated.  If we are being aggregated we use the supplied
00325   // pUnkOuter for IUnknown delegation.  In either case the pointer
00326   // assignment requires no AddRef because the CImpICar lifetime is
00327   // quaranteed by the lifetime of the parent object in which
00328   // CImpICar is nested.
00329   if (NULL == pUnkOuter)
00330   {
00331     m_pUnkOuter = pBackObj;
00332     LOG("S: COUtilityCar::CImpICar Constructor. Non-Aggregating");
00333   }
00334   else
00335   {
00336     m_pUnkOuter = pUnkOuter;
00337     LOG("S: COUtilityCar::CImpICar Constructor. Aggregating");
00338   }
00339
00340   return;
00341 }
00342
00343
00344 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00345   Method:   COUtilityCar::CImpICar::~CImpICar
00346
00347   Summary:  Destructor for the CImpICar interface instantiation.
00348
00349   Args:     void
00350
00351   Returns:  void
00352 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00353 COUtilityCar::CImpICar::~CImpICar(void)
00354 {
00355   LOG("S: COUtilityCar::CImpICar Destructor.");
00356
00357   return;
00358 }
00359
00360
00361 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00362   Method:   COUtilityCar::CImpICar::QueryInterface
00363
00364   Summary:  The QueryInterface IUnknown member of this ICar interface
00365             implementation that delegates to m_pUnkOuter, whatever it is.
00366
00367   Args:     REFIID riid,
00368               [in] GUID of the Interface being requested.
00369             PPVOID ppv)
00370               [out] Address of the caller's pointer variable that will
00371               receive the requested interface pointer.
00372
00373   Returns:  HRESULT
00374               Returned by the delegated outer QueryInterface call.
00375 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00376 STDMETHODIMP COUtilityCar::CImpICar::QueryInterface(
00377                REFIID riid,
00378                PPVOID ppv)
00379 {
00380   LOG("S: COUtilityCar::CImpICar::QueryInterface. Delegating.");
00381
00382   // Delegate this call to the outer object's QueryInterface.
00383   return m_pUnkOuter->QueryInterface(riid, ppv);
00384 }
00385
00386
00387 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00388   Method:   COUtilityCar::CImpICar::AddRef
00389
00390   Summary:  The AddRef IUnknown member of this ICar interface
00391             implementation that delegates to m_pUnkOuter, whatever it is.
00392
00393   Args:     void
00394
00395   Modifies: m_cRefI.
00396
00397   Returns:  ULONG
00398               Returned by the delegated outer AddRef call.
00399 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00400 STDMETHODIMP_(ULONG) COUtilityCar::CImpICar::AddRef(void)
00401 {
00402   // Increment the Interface Reference Count.
00403   ++m_cRefI;
00404
00405   LOGF1("S: COUtilityCar::CImpICar::Addref. Delegating. New cI=%i.", m_cRefI);
00406
00407   // Delegate this call to the outer object's AddRef.
00408   return m_pUnkOuter->AddRef();
00409 }
00410
00411
00412 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00413   Method:   COUtilityCar::CImpICar::Release
00414
00415   Summary:  The Release IUnknown member of this ICar interface
00416             implementation that delegates to m_pUnkOuter, whatever it is.
00417
00418   Args:     void
00419
00420   Returns:  ULONG
00421               Returned by the delegated outer Release call.
00422 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00423 STDMETHODIMP_(ULONG) COUtilityCar::CImpICar::Release(void)
00424 {
00425   // Decrement the Interface Reference Count.
00426   --m_cRefI;
00427
00428   LOGF1("S: COUtilityCar::CImpICar::Release. Delegating. New cI=%i.", m_cRefI);
00429
00430   // Delegate this call to the outer object's Release.
00431   return m_pUnkOuter->Release();
00432 }
00433
00434
00435 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00436   Method:   COUtilityCar::CImpICar::Shift
00437
00438   Summary:  The Shift member method of this ICar interface implementation.
00439             A simple empty method on a COUtilityCar COM object for tutorial
00440             purposes.  Presumably if this Car object were modeling
00441             a real Car then the Shift method would shift to the specified
00442             gear.
00443
00444   Args:     short nGear
00445               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00446
00447   Returns:  HRESULT
00448               NOERROR
00449 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00450 STDMETHODIMP COUtilityCar::CImpICar::Shift(
00451                short nGear)
00452 {
00453   LOGF1("S: COUtilityCar::CImpICar::Shift. Delegating. nGear=%i.",nGear);
00454
00455   m_pBackObj->m_pICar->Shift(nGear);
00456
00457   return NOERROR;
00458 }
00459
00460
00461 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00462   Method:   COUtilityCar::CImpICar::Clutch
00463
00464   Summary:  The Clutch member method of this ICar interface implementation.
00465             A simple empty method on a COUtilityCar COM object for tutorial
00466             purposes.  Presumably if this Car object were modeling
00467             a real Car then the Clutch method would engage the clutch the
00468             specified amount.
00469
00470   Args:     short nEngaged)
00471               Percent clutch is engaged (0 to 100%).
00472
00473   Returns:  HRESULT
00474               NOERROR
00475 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00476 STDMETHODIMP COUtilityCar::CImpICar::Clutch(
00477                short nEngaged)
00478 {
00479   LOGF1("S: COUtilityCar::CImpICar::Clutch. Delegating. nEngaged=%i.",nEngaged);
00480
00481   m_pBackObj->m_pICar->Clutch(nEngaged);
00482
00483   return NOERROR;
00484 }
00485
00486
00487 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00488   Method:   COUtilityCar::CImpICar::Speed
00489
00490   Summary:  The Propel member method of this ICar interface implementation.
00491             A simple empty method on a COUtilityCar COM object for tutorial
00492             purposes.  Presumably if this Car object were modeling
00493             a real Car then this method would accelerate/brake to bring
00494             the car to the specified speed.
00495
00496   Args:     short nMph
00497               New speed in miles per hour.
00498
00499   Returns:  HRESULT
00500               NOERROR
00501 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00502 STDMETHODIMP COUtilityCar::CImpICar::Speed(
00503                short nMph)
00504 {
00505   LOGF1("S: COUtilityCar::CImpICar::Speed. Delegating. nMph=%i.",nMph);
00506
00507   m_pBackObj->m_pICar->Speed(nMph);
00508
00509   return NOERROR;
00510 }
00511
00512
00513 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00514   Method:   COUtilityCar::CImpICar::Steer
00515
00516   Summary:  The Steer member method of this ICar interface implementation.
00517             A simple empty method on a COUtilityCar COM object for tutorial
00518             purposes.  Presumably if this Car object were modeling
00519             a real Car then the Steer method would set the steering
00520             angle of the Car.
00521
00522   Args:     short nAngle)
00523               0 degrees straight ahead, -45 Full left, +45 Full right.
00524
00525   Returns:  HRESULT
00526               NOERROR
00527 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00528 STDMETHODIMP COUtilityCar::CImpICar::Steer(
00529                short nAngle)
00530 {
00531   LOGF1("S: COUtilityCar::CImpICar::Steer. Delegating. nAngle=%i.",nAngle);
00532
00533   m_pBackObj->m_pICar->Steer(nAngle);
00534
00535   return NOERROR;
00536 }
00537
00538
00539 /*---------------------------------------------------------------------------
00540   COUtilityCar's nested implementation of the IUtility interface including
00541   Constructor, Destructor, QueryInterface, AddRef, Release,
00542   Offroad, and Winch.
00543 ---------------------------------------------------------------------------*/
00544
00545 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00546   Method:   COUtilityCar::CImpIUtility::CImpIUtility
00547
00548   Summary:  Constructor for the CImpIUtility interface instantiation.
00549
00550   Args:     COUtilityCar* pBackObj,
00551               Back pointer to the parent outer object.
00552             IUnknown* pUnkOuter)
00553               Pointer to the outer Unknown.  For delegation.
00554
00555   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00556
00557   Returns:  void
00558 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00559 COUtilityCar::CImpIUtility::CImpIUtility(
00560   COUtilityCar* pBackObj,
00561   IUnknown* pUnkOuter)
00562 {
00563   // Init the Interface Ref Count (used for debugging only).
00564   m_cRefI = 0;
00565
00566   // Init the Back Object Pointer to point to the outer object.
00567   m_pBackObj = pBackObj;
00568
00569   // Init the CImpIUtility interface's delegating Unknown pointer.  We use
00570   // the Back Object pointer for IUnknown delegation here if we are not
00571   // being aggregated.  If we are being aggregated we use the supplied
00572   // pUnkOuter for IUnknown delegation.  In either case the pointer
00573   // assignment requires no AddRef because the CImpIUtility lifetime is
00574   // quaranteed by the lifetime of the parent object in which
00575   // CImpIUtility is nested.
00576   if (NULL == pUnkOuter)
00577   {
00578     m_pUnkOuter = pBackObj;
00579     LOG("S: COUtilityCar::CImpIUtility Constructor. Non-Aggregating.");
00580   }
00581   else
00582   {
00583     m_pUnkOuter = pUnkOuter;
00584     LOG("S: COUtilityCar::CImpIUtility Constructor. Aggregating.");
00585   }
00586
00587   return;
00588 }
00589
00590
00591 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00592   Method:   COUtilityCar::CImpIUtility::~CImpIUtility
00593
00594   Summary:  Destructor for the CImpIUtility interface instantiation.
00595
00596   Args:     void
00597
00598   Returns:  void
00599 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00600 COUtilityCar::CImpIUtility::~CImpIUtility(void)
00601 {
00602   LOG("S: COUtilityCar::CImpIUtility Destructor.");
00603
00604   return;
00605 }
00606
00607
00608 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00609   Method:   COUtilityCar::CImpIUtility::QueryInterface
00610
00611   Summary:  The QueryInterface IUnknown member of this IUtility interface
00612             implementation that delegates to m_pUnkOuter, whatever it is.
00613
00614   Args:     REFIID riid,
00615               [in] GUID of the Interface being requested.
00616             PPVOID ppv)
00617               [out] Address of the caller's pointer variable that will
00618               receive the requested interface pointer.
00619
00620   Returns:  HRESULT
00621               Returned by the delegated outer QueryInterface call.
00622 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00623 STDMETHODIMP COUtilityCar::CImpIUtility::QueryInterface(
00624                REFIID riid,
00625                PPVOID ppv)
00626 {
00627   LOG("S: COUtilityCar::CImpIUtility::QueryInterface. Delegating.");
00628
00629   // Delegate this call to the outer object's QueryInterface.
00630   return m_pUnkOuter->QueryInterface(riid, ppv);
00631 }
00632
00633
00634 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00635   Method:   COUtilityCar::CImpIUtility::AddRef
00636
00637   Summary:  The AddRef IUnknown member of this IUtility interface
00638             implementation that delegates to m_pUnkOuter, whatever it is.
00639
00640   Args:     void
00641
00642   Modifies: m_cRefI.
00643
00644   Returns:  ULONG
00645               Returned by the delegated outer AddRef call.
00646 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00647 STDMETHODIMP_(ULONG) COUtilityCar::CImpIUtility::AddRef(void)
00648 {
00649   // Increment the Interface Reference Count.
00650   ++m_cRefI;
00651
00652   LOGF1("S: COUtilityCar::CImpIUtility::Addref. Delegating. New cI=%i.", m_cRefI);
00653
00654   // Delegate this call to the outer object's AddRef.
00655   return m_pUnkOuter->AddRef();
00656 }
00657
00658
00659 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00660   Method:   COUtilityCar::CImpIUtility::Release
00661
00662   Summary:  The Release IUnknown member of this IUtility interface
00663             implementation that delegates to m_pUnkOuter, whatever it is.
00664
00665   Args:     void
00666
00667   Returns:  ULONG
00668               Returned by the delegated outer Release call.
00669 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00670 STDMETHODIMP_(ULONG) COUtilityCar::CImpIUtility::Release(void)
00671 {
00672   // Decrement the Interface Reference Count.
00673   --m_cRefI;
00674
00675   LOGF1("S: COUtilityCar::CImpIUtility::Release. Delegating. New cI=%i.", m_cRefI);
00676
00677   // Delegate this call to the outer object's Release.
00678   return m_pUnkOuter->Release();
00679 }
00680
00681
00682 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00683   Method:   COUtilityCar::CImpIUtility::Offroad
00684
00685   Summary:  The Offroad member method of this IUtility interface
00686             implementation.  A simple empty method on a COUtilityCar
00687             COM object for tutorial purposes.  Presumably if this
00688             UtilityCar object were modeling a real Car then the Offroad
00689             method would function the 4-wheel drive transfer case and
00690             shift it to the specified 4-wheel drive mode.
00691
00692   Args:     short nGear
00693               0 = 2H or regular 2-wheel drive;
00694               1 = 4H or 4-wheel drive high speed;
00695               2 = neutral; and
00696               3 = 4L or 4-wheel drive low speed).
00697
00698   Returns:  HRESULT
00699               NOERROR
00700 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00701 STDMETHODIMP COUtilityCar::CImpIUtility::Offroad(
00702                short nGear)
00703 {
00704   LOGF1("S: COUtilityCar::CImpIUtility::Offroad. Called. nGear=%i.",nGear);
00705
00706   return NOERROR;
00707 }
00708
00709
00710 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00711   Method:   COUtilityCar::CImpIUtility::Winch
00712
00713   Summary:  The Winch member method of this IUtility interface
00714             implementation.  A simple empty method on a COUtilityCar COM
00715             object for tutorial purposes.  Presumably if this UtilityCar
00716             object were modeling a real Car then the Winch method would
00717             turn on/off the front-mounted Winch to the specified RPMs.
00718
00719   Args:     short nRpm
00720               0 = off; 1 - 50 RPM.
00721
00722   Returns:  HRESULT
00723               NOERROR
00724 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00725 STDMETHODIMP COUtilityCar::CImpIUtility::Winch(
00726                short nRpm)
00727 {
00728   LOGF1("S: COUtilityCar::CImpIUtility::Winch. Called. nRpm=%i.",nRpm);
00729
00730   return NOERROR;
00731 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CVARIANT Member List

This is the complete list of members for CVARIANT, including all inherited members.
Clear() | CVARIANT | [inline]
Clear() | CVARIANT | [inline]
CVARIANT() | CVARIANT | [inline]
CVARIANT(LPWSTR pSrc) | CVARIANT | [inline]
CVARIANT(LONG lSrc) | CVARIANT | [inline]
CVARIANT(BOOL b) | CVARIANT | [inline]
CVARIANT(short i) | CVARIANT | [inline]
CVARIANT(double d) | CVARIANT | [inline]
CVARIANT(BYTE b) | CVARIANT | [inline]
CVARIANT(IDispatch *pDisp) | CVARIANT | [inline]
CVARIANT() | CVARIANT | [inline]
CVARIANT(LPWSTR pSrc) | CVARIANT | [inline]
CVARIANT(LONG lSrc) | CVARIANT | [inline]
CVARIANT(BOOL b) | CVARIANT | [inline]
CVARIANT(short i) | CVARIANT | [inline]
CVARIANT(double d) | CVARIANT | [inline]
CVARIANT(BYTE b) | CVARIANT | [inline]
CVARIANT(IDispatch *pDisp) | CVARIANT | [inline]
GetBool() | CVARIANT | [inline]
GetBool() | CVARIANT | [inline]
GetByte() | CVARIANT | [inline]
GetByte() | CVARIANT | [inline]
GetDispatch() | CVARIANT | [inline]
GetDispatch() | CVARIANT | [inline]
GetDouble() | CVARIANT | [inline]
GetDouble() | CVARIANT | [inline]
GetLONG() | CVARIANT | [inline]
GetLONG() | CVARIANT | [inline]
GetShort() | CVARIANT | [inline]
GetShort() | CVARIANT | [inline]
GetStr() | CVARIANT | [inline]
GetStr() | CVARIANT | [inline]
GetType() | CVARIANT | [inline]
GetType() | CVARIANT | [inline]
GetUnknown() | CVARIANT | [inline]
GetUnknown() | CVARIANT | [inline]
operator BOOL() | CVARIANT | [inline]
operator BOOL() | CVARIANT | [inline]
operator BYTE() | CVARIANT | [inline]
operator BYTE() | CVARIANT | [inline]
operator double() | CVARIANT | [inline]
operator double() | CVARIANT | [inline]
operator LONG() | CVARIANT | [inline]
operator LONG() | CVARIANT | [inline]
operator LPWSTR() | CVARIANT | [inline]
operator LPWSTR() | CVARIANT | [inline]
operator SAFEARRAY *() | CVARIANT | [inline]
operator SAFEARRAY *() | CVARIANT | [inline]
operator short() | CVARIANT | [inline]
operator short() | CVARIANT | [inline]
operator VARIANT *() | CVARIANT | [inline]
operator VARIANT *() | CVARIANT | [inline]
operator&() | CVARIANT | [inline]
operator&() | CVARIANT | [inline]
SetArray(SAFEARRAY *p, VARTYPE vt) | CVARIANT | [inline]
SetArray(SAFEARRAY *p, VARTYPE vt) | CVARIANT | [inline]
SetBool(BOOL b) | CVARIANT | [inline]
SetBool(BOOL b) | CVARIANT | [inline]
SetByte(BYTE bySrc) | CVARIANT | [inline]
SetByte(BYTE bySrc) | CVARIANT | [inline]
SetDispatch(IDispatch *pDisp) | CVARIANT | [inline]
SetDispatch(IDispatch *pDisp) | CVARIANT | [inline]
SetDouble(double dSrc) | CVARIANT | [inline]
SetDouble(double dSrc) | CVARIANT | [inline]
SetLONG(LONG lSrc) | CVARIANT | [inline]
SetLONG(LONG lSrc) | CVARIANT | [inline]
SetShort(short i) | CVARIANT | [inline]
SetShort(short i) | CVARIANT | [inline]
SetStr(LPWSTR pSrc) | CVARIANT | [inline]
SetStr(LPWSTR pSrc) | CVARIANT | [inline]
SetUnknown(IUnknown *pUnk) | CVARIANT | [inline]
SetUnknown(IUnknown *pUnk) | CVARIANT | [inline]
Unbind() | CVARIANT | [inline]
Unbind() | CVARIANT | [inline]
v | CVARIANT | [private]
~CVARIANT() | CVARIANT | [inline]
~CVARIANT() | CVARIANT | [inline]
Generated on Wed Nov 13 2024 16:57:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/updrec.Cpp Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

updrec.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UpdRec.cpp
00003   Summary:   Implementation of Update Receipt component
00004   Classes:   CUpdateReceipt
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #include "Account.h"
00024 #include <comsvcs.h>
00025 #include "UpdRec.h"
00026 #include <transact.h>
00027
00028 HRESULT GetConnection(WCHAR * sDSN, HENV  * phenv, HDBC * phdbc, HSTMT * phstmt, BOOL bUseObjectPool);
00029 extern void GetODBCError(HENV henv, HDBC hdbc, HSTMT hstmt, BSTR * sErr);
00030
00031
00032 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00033   Function: CUpdateReceipt::Construct
00034   Summary:  Called by the constructor activator
00035   Args:     IDispatch *pUnk   Used to obtain construction string
00036   Returns:  HRESULT
00037   Comments: The construct string should look like
00038       "FILEDSN=OPBankSamples;DATABASE=pubs;UID=sa;PWD=;APP=OPBank"
00039       If '/NP' is in the string, COM+ pooling will not be active
00040 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00041 STDMETHODIMP CUpdateReceipt::Construct(IDispatch * pUnk)
00042 {
00043
00044   if (!pUnk)
00045     return E_UNEXPECTED;
00046   HRESULT hr;
00047   IObjectConstructString * pString = NULL;
00048   hr = pUnk -> QueryInterface(IID_IObjectConstructString, (void **)&pString);
00049   if (pString)
00050   {
00051     CComBSTR s;
00052     pString -> get_ConstructString(&s);
00053     WCHAR * p = wcsstr(s.m_str, L"/NP");
00054     if (p)
00055     {
00056       m_bObjectPooled = FALSE;
00057       *p = NULL;
00058     }
00059     else
00060       m_bObjectPooled = TRUE;
00061
00062     m_sDSN = s;
00063     pString -> Release();
00064     hr = GetConnection(m_sDSN.m_str, &m_henv, &m_hdbc, &m_hstmt, m_bObjectPooled);
00065     if (FAILED(hr))
00066     {
00067       BSTR sResult;
00068       GetODBCError(m_henv, m_hdbc, NULL, &sResult);
00069       AtlReportError( CLSID_CUpdateReceipt, sResult, IID_IAccount, hr);
00070       SysFreeString(sResult);
00071       return hr;
00072     }
00073   }
00074
00075   m_bConstructed = TRUE;
00076
00077   return hr;
00078
00079 }
00080
00081
00082 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00083   Function: CUpdateReceipt::InterfaceSupportsErrorInfo
00084   Summary:  Confirms or denies that an error came from IAccount interface
00085   Args:     REFIID riid     Interface ID returned in error
00086   Returns:  HRESULT
00087 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00088 STDMETHODIMP CUpdateReceipt::InterfaceSupportsErrorInfo(REFIID riid)
00089 {
00090   static const IID* arr[] =
00091   {
00092     &IID_IUpdateReceipt,
00093   };
00094
00095   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00096   {
00097     // refer to guiddef.h
00098     if (::InlineIsEqualGUID(*arr[i],riid))
00099       return S_OK;
00100   }
00101   return S_FALSE;
00102 }
00103
00104
00105
00106 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00107   Function: CUpdateReceipt::Update
00108   Summary:  Once GetReceipt has issued 100 receipts, update the database to
00109       preallocate another 100 receipts for use by GetReceipt
00110   Args:     long *plReceiptNo First receipt number in new block
00111   Returns:  HRESULT
00112 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00113 STDMETHODIMP CUpdateReceipt::Update (OUT long* plReceiptNo)
00114 {
00115
00116   HRESULT hr = S_OK;
00117   IObjectContext* pObjectContext = NULL;
00118
00119   RETCODE rc;
00120   BSTR sErr = 0;
00121   long len = 0;
00122   if (!m_bConstructed)
00123   {
00124     m_sDSN = L"FILEDSN=OPBankSamples;DATABASE=pubs;UID=sa;PWD=;APP=OPBank";
00125     hr = GetConnection(m_sDSN.m_str, &m_henv, &m_hdbc, &m_hstmt, m_bObjectPooled);
00126     if (FAILED(hr))
00127     {
00128       BSTR sResult;
00129       GetODBCError(m_henv, m_hdbc, NULL, &sResult);
00130       AtlReportError( CLSID_CAccount, sResult, IID_IAccount, hr);
00131       SysFreeString(sResult);
00132       return hr;
00133     }
00134   }
00135
00136   hr = CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext);
00137   if (!pObjectContext)
00138   {
00139     sErr = SysAllocString(L"No Object Context");
00140     goto end;
00141   }
00142
00143   if (m_bShouldEnlist)
00144   {
00145     //
00146     // NOTE: I know I call SetComplete, so I don't have to set
00147     //       the m_bShouldEnlist flag to FALSE after I enlist
00148     //
00149     hr = Enlist();
00150     if (FAILED(hr))
00151       return hr;
00152   }
00153
00154   *plReceiptNo = 0;
00155
00156   rc = SQLExecDirect(m_hstmt, L"Update Receipt set NextReceipt = NextReceipt + 100", SQL_NTS);
00157   if (SQL_FAILED(rc))
00158   {
00159     GetODBCError(m_henv, m_hdbc, m_hstmt, &sErr);
00160     hr = E_FAIL;
00161     goto end;
00162
00163   }
00164
00165   // Obtain the desired recordset with an SQL query
00166   rc = SQLExecDirect(m_hstmt, L"SELECT NextReceipt FROM Receipt", SQL_NTS);
00167   if (SQL_FAILED(rc))
00168   {
00169     GetODBCError(m_henv, m_hdbc, m_hstmt, &sErr);
00170     hr = E_FAIL;
00171     goto end;
00172
00173   }
00174   while (SQLFetch(m_hstmt) == SQL_SUCCESS) // only get the first one for now
00175   {
00176
00177     rc = SQLGetData(m_hstmt, 1, SQL_C_LONG, plReceiptNo, 0, &len);
00178   }
00179
00180   SQLFreeStmt(m_hstmt, SQL_CLOSE);
00181   pObjectContext -> SetComplete();
00182
00183 end:
00184
00185   if (sErr)
00186   {
00187     AtlReportError( CLSID_CUpdateReceipt, sErr, IID_IUpdateReceipt, hr);
00188     SysFreeString(sErr);
00189     pObjectContext -> SetAbort();
00190   }
00191
00192   // (03.22.00 mdl) Release connection if object is not pooled.
00193   if (!m_bObjectPooled)
00194   {
00195     FinalRelease();
00196   }
00197
00198   SafeRelease(pObjectContext);
00199   return hr;
00200
00201
00202 }
00203
00204
00205 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00206   Function: CUpdateReceipt::FinalRelease
00207   Summary:  Free up ODBC connection
00208   Returns:  void
00209 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00210 void CUpdateReceipt::FinalRelease()
00211 {
00212   if (m_hstmt)
00213     SQLFreeStmt(m_hstmt, SQL_DROP);
00214   if (m_hdbc)
00215   {
00216     SQLDisconnect(m_hdbc);
00217     SQLFreeConnect(m_hdbc);
00218   }
00219   if (m_henv)
00220     SQLFreeEnv(m_henv);
00221
00222   m_hstmt = 0;
00223   m_henv = 0;
00224   m_hdbc = 0;
00225 }
00226
00227
00228 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00229   Function: CUpdateReceipt::Activate
00230   Summary:  On activation, get the transaction (unit of work).  If the same
00231       transaction as before, no need to enlist.  Otherwise, set a flag
00232       to re-enlist in the transaction.  If configured not to use COM+
00233       pooling, immediately return.
00234   Returns:  HRESULT
00235 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00236 STDMETHODIMP CUpdateReceipt::Activate()
00237 {
00238
00239   //
00240   //  should only do this when we are being activated in different
00241   //  tx units of work
00242   m_bShouldEnlist = FALSE;
00243
00244   if (!m_bObjectPooled)
00245     return S_OK;
00246
00247   HRESULT hr;
00248   IObjectContext * pObjectContext = NULL;
00249   hr = CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext);
00250   _ASSERTE(pObjectContext);
00251   GUID txUOW = GUID_NULL;
00252   IObjectContextInfo  * pObjTx = NULL;
00253   pObjectContext -> QueryInterface(IID_IObjectContextInfo, (void **)&pObjTx);
00254   if (pObjTx)
00255   {
00256     pObjTx -> GetTransactionId (&txUOW);
00257     pObjTx -> Release();
00258   }
00259   pObjectContext -> Release();
00260
00261   if (txUOW != m_txuow)
00262   {
00263     m_bShouldEnlist = TRUE;
00264     m_txuow = txUOW;
00265
00266   }
00267
00268   return S_OK;
00269 }
00270
00271
00272 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00273   Function: CUpdateReceipt::Enlist
00274   Summary:  Enlists ODBC in the current transaction
00275   Returns:  HRESULT
00276 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00277 HRESULT CUpdateReceipt::Enlist()
00278 {
00279
00280
00281   HRESULT hr;
00282   IObjectContext * pObjectContext = NULL;
00283   hr = CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext);
00284   _ASSERTE(pObjectContext);
00285
00286   IObjectContextInfo  * pObjTx = NULL;
00287   pObjectContext -> QueryInterface(IID_IObjectContextInfo, (void **)&pObjTx);
00288   pObjectContext -> Release();
00289   if (pObjTx)
00290   {
00291     ITransaction * pTx = NULL;
00292     pObjTx -> GetTransaction ((IUnknown **)&pTx);
00293     RETCODE rc ;
00294     if (pTx)
00295     {
00296       rc = SQLSetConnectOption(m_hdbc, SQL_ATTR_ENLIST_IN_DTC, (UDWORD)pTx);
00297       if (SQL_FAILED(rc))
00298       {
00299 #ifdef _DEBUG
00300         BSTR sErr;
00301         GetODBCError(m_henv, m_hdbc, m_hstmt, &sErr);
00302         AtlTrace(L"Warning! Failed to enlist on caller tx in VCAccount!\n");
00303         AtlTrace(L"ODBC Error: ");
00304         AtlTrace(sErr);
00305         AtlTrace(L"\n");
00306         SysFreeString(sErr);
00307 #endif
00308         hr = E_FAIL;
00309       }
00310
00311       pTx -> Release();
00312     }
00313
00314     pObjTx -> Release();
00315   }
00316
00317   return hr;
00318 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/account.Cpp Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

account.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: Account.cpp
00003 //
00004 //
00005 // Description: Implementation of DLL Exports.
00006 //
00007 //
00008 // This file is part of the Microsoft COM+ Samples
00009 //
00010 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00011 //
00012 // This source code is intended only as a supplement to Microsoft
00013 // Development Tools and/or on-line documentation.  See these other
00014 // materials for detailed information reagrding Microsoft code samples.
00015 //
00016 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 // PARTICULAR PURPOSE.
00020 //
00021 //==============================================================================
00022 //
00023 // You will need the NT SUR Beta 2 SDK or VC 4.2 in order to build this
00024 // project.  This is because you will need MIDL 3.00.15 or higher and new
00025 // headers and libs.  If you have VC 4.2 installed, then everything should
00026 // already be configured correctly.
00027
00028 // Note: Proxy/Stub Information
00029 //    To merge the proxy/stub code into the object DLL, add the file
00030 //    dlldatax.c to the project.  Make sure precompiled headers
00031 //    are turned off for this file, and add _MERGE_PROXYSTUB to the
00032 //    defines for the project.
00033 //
00034 //    Modify the custom build rule for Account.idl by adding the following
00035 //    files to the Outputs.  You can select all of the .IDL files by
00036 //    expanding each project and holding Ctrl while clicking on each of them.
00037 //      Account_p.c
00038 //      dlldata.c
00039 //    To build a separate proxy/stub DLL,
00040 //    run nmake -f Accountps.mak in the project directory.
00041
00042 #include "stdafx.h"
00043 #include "resource.h"
00044 #include "initguid.h"
00045 #include "Account.h"
00046 #include "CAccount.h"
00047 #include "MoveMoney.h"
00048 //
00049 // to merge proxy/stub, uncomment this line
00050 // #include "dlldatax.h"
00051 //
00052 #define IID_DEFINED
00053 #include "Account_i.c"
00054 #include "GetReceipt.h"
00055 #include "UpdateReceipt.h"
00056
00057 #ifdef _MERGE_PROXYSTUB
00058 extern "C" HINSTANCE hProxyDll;
00059 #endif
00060
00061 CComModule _Module;
00062
00063 BEGIN_OBJECT_MAP(ObjectMap)
00064   OBJECT_ENTRY(CLSID_CUpdateReceipt, CUpdateReceipt)
00065   OBJECT_ENTRY(CLSID_CGetReceipt, CGetReceipt)
00066   OBJECT_ENTRY(CLSID_CAccount, CAccount)
00067   OBJECT_ENTRY(CLSID_CMoveMoney, CMoveMoney)
00068 END_OBJECT_MAP()
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 // DLL Entry Point
00072
00073 extern "C"
00074 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00075 {
00076   lpReserved;
00077 #ifdef _MERGE_PROXYSTUB
00078   if (!PrxDllMain(hInstance, dwReason, lpReserved))
00079     return FALSE;
00080 #endif
00081   if (dwReason == DLL_PROCESS_ATTACH)
00082   {
00083     _Module.Init(ObjectMap, hInstance);
00084     DisableThreadLibraryCalls(hInstance);
00085   }
00086   else if (dwReason == DLL_PROCESS_DETACH)
00087     _Module.Term();
00088   return TRUE;    // ok
00089 }
00090
00091 /////////////////////////////////////////////////////////////////////////////
00092 // Used to determine whether the DLL can be unloaded by OLE
00093
00094 STDAPI DllCanUnloadNow(void)
00095 {
00096 #ifdef _MERGE_PROXYSTUB
00097   if (PrxDllCanUnloadNow() != S_OK)
00098     return S_FALSE;
00099 #endif
00100   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00101 }
00102
00103 /////////////////////////////////////////////////////////////////////////////
00104 // Returns a class factory to create an object of the requested type
00105
00106 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00107 {
00108 #ifdef _MERGE_PROXYSTUB
00109   if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
00110     return S_OK;
00111 #endif
00112   return _Module.GetClassObject(rclsid, riid, ppv);
00113 }
00114
00115 /////////////////////////////////////////////////////////////////////////////
00116 // DllRegisterServer - Adds entries to the system registry
00117
00118 STDAPI DllRegisterServer(void)
00119 {
00120 #ifdef _MERGE_PROXYSTUB
00121   HRESULT hRes = PrxDllRegisterServer();
00122   if (FAILED(hRes))
00123     return hRes;
00124 #endif
00125   // registers object, typelib and all interfaces in typelib
00126   return _Module.RegisterServer(TRUE);
00127 }
00128
00129 /////////////////////////////////////////////////////////////////////////////
00130 // DllUnregisterServer - Removes entries from the system registry
00131
00132 STDAPI DllUnregisterServer(void)
00133 {
00134 #ifdef _MERGE_PROXYSTUB
00135   PrxDllUnregisterServer();
00136 #endif
00137   _Module.UnregisterServer();
00138   return S_OK;
00139 }
00140
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/Alloc.Cpp Source File

  • NetDS
  • SyncMgr
  • SyncDir

Alloc.Cpp

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #include "precomp.h"
00013
00014 //+-------------------------------------------------------------------
00015 //
00016 //  Function:    ::operator new
00017 //
00018 //  Synopsis:   Our operator new implementation
00019 //
00020 //  Arguments:  [size] -- Size of memory to allocate
00021 //
00022 //
00023 //  Notes:
00024 //
00025 //--------------------------------------------------------------------
00026
00027 inline void* __cdecl operator new (size_t size)
00028 {
00029     return((void *)ALLOC(size));
00030 }
00031
00032
00033 //+-------------------------------------------------------------------
00034 //
00035 //  Function:    ::operator delete
00036 //
00037 //  Synopsis:   Our operator deleteimplementation
00038 //
00039 //  Arguments:  lpv-- Pointer to memory to free
00040 //
00041 //
00042 //  Notes:
00043 //
00044 //--------------------------------------------------------------------
00045
00046 inline void __cdecl operator delete(void FAR* lpv)
00047 {
00048     FREE(lpv);
00049 }
00050
00051
00052 //+---------------------------------------------------------------------------
00053 //
00054 //  function:   ALLOC, public
00055 //
00056 //  Synopsis:   memory allocator
00057 //
00058 //  Arguments:  [cb] - requested size of memory to alloc.
00059 //
00060 //  Returns:    Pointer to newly allocated memory, NULL on failure
00061 //
00062 //  Modifies:
00063 //
00064 //----------------------------------------------------------------------------
00065
00066 LPVOID ALLOC(ULONG cb)
00067 {
00068 void *pv;
00069
00070     pv = LocalAlloc(LMEM_FIXED,cb);
00071
00072 #ifdef _DEBUG
00073     if (NULL != pv) // under debug always initialize to -1 to catch unitialize errors.
00074     {
00075         memset(pv,MEMINITVALUE,cb);
00076     }
00077 #endif // _DEBUG
00078
00079     return pv;
00080 }
00081
00082
00083 //+---------------------------------------------------------------------------
00084 //
00085 //  function:   FREE, public
00086 //
00087 //  Synopsis:   memory destructor
00088 //
00089 //  Arguments:  [pv] - pointer to memory to be released.
00090 //
00091 //  Returns:
00092 //
00093 //  Modifies:
00094 //
00095 //----------------------------------------------------------------------------
00096
00097
00098 void FREE(void* pv)
00099 {
00100 #ifdef _DEBUG
00101     if (NULL != pv) // under debug always initialize to -1 to catch unitialize errors.
00102     {
00103     UINT cb;
00104
00105         Assert(LMEM_INVALID_HANDLE != LocalFlags(pv));
00106
00107         cb = (UINT)LocalSize(pv); // returns zero on failure
00108         memset(pv,MEMFREEVALUE,cb);
00109     }
00110
00111     Assert(pv);
00112
00113 #endif // _DEBUG
00114
00115     LocalFree(pv);
00116 }
00117
00118
00119 //+---------------------------------------------------------------------------
00120 //
00121 //  function:   REALLOC, public
00122 //
00123 //  Synopsis:   reallocs memory
00124 //
00125 //  Arguments:  [pv] - pointer to memory to be released.
00126 //              [cb] - size to resize the memory to.
00127 //
00128 //  Returns:
00129 //
00130 //  Modifies:
00131 //
00132 //----------------------------------------------------------------------------
00133
00134 LPVOID REALLOC(void *pv,ULONG cb)
00135 {
00136
00137     Assert(pv);
00138
00139     pv =  LocalReAlloc(pv,cb,LMEM_MOVEABLE);
00140
00141     return pv;
00142 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CButtonLite Member List

This is the complete list of members for CButtonLite, including all inherited members.
CButtonLite(HWND hWndParent=NULL, UINT nID=0) | CButtonLite |
CheckButton(UINT uCheck) | CButtonLite | [inline, virtual]
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsButtonChecked() | CButtonLite | [inline, virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CButtonLite() | CButtonLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStartOfFileElement Member List

This is the complete list of members for CStartOfFileElement, including all inherited members.
_aTempBuffer | CHtmlElement | [protected]
_htmlIFilter | CHtmlElement | [protected]
_scanner | CHtmlElement | [protected]
_serialStream | CHtmlElement | [protected]
CHtmlElement(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CHtmlElement |
CStartOfFileElement(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CStartOfFileElement |
GetChunk(STAT_CHUNK *pStat) | CStartOfFileElement | [virtual]
GetText(ULONG *pcwcBuffer, WCHAR *awcBuffer) | CStartOfFileElement | [virtual]
GetValue(PROPVARIANT **ppPropValue) | CHtmlElement | [virtual]
InitFilterRegion(ULONG &idChunkSource, ULONG &cwcStartSource, ULONG &cwcLenSource) | CHtmlElement | [virtual]
InitStatChunk(STAT_CHUNK *pStat) | CStartOfFileElement | [virtual]
SkipRemainingTextAndGotoNextChunk(STAT_CHUNK *pStat) | CHtmlElement | [protected]
SwitchToNextHtmlElement(STAT_CHUNK *pStat) | CHtmlElement | [protected]
~CHtmlElement() | CHtmlElement | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/StdAfx.Cpp Source File

  • Web
  • MSAgent
  • c
  • CapMFC

StdAfx.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 - 2000 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 // stdafx.cpp : source file that includes just the standard includes
00045 //  CapMFC.pch will be the pre-compiled header
00046 //  stdafx.obj will contain the pre-compiled type information
00047
00048 #include "stdafx.h"
00049
00050
00051
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Client/ClientDlg.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Client

ClientDlg.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: clientDlg.cpp
00004
00005 Summary:  Produced and maintained by VS6 MFC Wizards.
00006           Implements responses to Dialog-generate Win32 Events
00007           in client.exe.
00008
00009 ----------------------------------------------------------------------------
00010
00011 This file is part of the Microsoft COM+ Samples.
00012
00013 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00014
00015 This source code is intended only as a supplement to Microsoft
00016 Development Tools and/or on-line documentation. See these other
00017 materials for detailed information regarding Microsoft code samples.
00018
00019 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00020 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00022 PARTICULAR PURPOSE.
00023
00024 ==========================================================================+*/
00025 // clientDlg.cpp : implementation file
00026 //
00027
00028 #include "stdafx.h"
00029 #include "client.h"
00030 #include "clientDlg.h"
00031
00032 #ifdef _DEBUG
00033 #define new DEBUG_NEW
00034 #undef THIS_FILE
00035 static char THIS_FILE[] = __FILE__;
00036 #endif
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CClientDlg dialog
00040
00041 CClientDlg::CClientDlg(CWnd* pParent /*=NULL*/)
00042   : CDialog(CClientDlg::IDD, pParent)
00043 {
00044   //{{AFX_DATA_INIT(CClientDlg)
00045   m_iData = 0;
00046   m_lPings = 0;
00047   m_lTimeouts = 0;
00048   m_lTries = 0;
00049   m_bUsePing = FALSE;
00050   m_lFails = 0;
00051   m_cRSN = _T("");
00052   m_lPingFailures = 0;
00053   //}}AFX_DATA_INIT
00054   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
00055   m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
00056 }
00057
00058 void CClientDlg::DoDataExchange(CDataExchange* pDX)
00059 {
00060   CDialog::DoDataExchange(pDX);
00061   //{{AFX_DATA_MAP(CClientDlg)
00062   DDX_Control(pDX, IDSTART, m_ctlStart);
00063   DDX_Control(pDX, IDC_WARNING, m_cWarning);
00064   DDX_Control(pDX, IDC_GOOD, m_cGood);
00065   DDX_Control(pDX, IDC_BAD, m_cBad);
00066   DDX_Text(pDX, IDC_LASTVALUE, m_iData);
00067   DDX_Text(pDX, IDC_PINGS, m_lPings);
00068   DDX_Text(pDX, IDC_TIMEOUTS, m_lTimeouts);
00069   DDX_Text(pDX, IDC_TRIES, m_lTries);
00070   DDX_Check(pDX, IDC_USEPING, m_bUsePing);
00071   DDX_Text(pDX, IDC_FAILS, m_lFails);
00072   DDX_Text(pDX, IDC_RSN, m_cRSN);
00073   DDX_Text(pDX, IDC_PINGFAILS, m_lPingFailures);
00074   //}}AFX_DATA_MAP
00075 }
00076
00077 BEGIN_MESSAGE_MAP(CClientDlg, CDialog)
00078   //{{AFX_MSG_MAP(CClientDlg)
00079   ON_WM_PAINT()
00080   ON_WM_QUERYDRAGICON()
00081   ON_BN_CLICKED(IDC_USEPING, OnUsePing)
00082   ON_BN_CLICKED(IDSTART, OnStart)
00083   //}}AFX_MSG_MAP
00084 END_MESSAGE_MAP()
00085
00086 /////////////////////////////////////////////////////////////////////////////
00087 // CClientDlg message handlers
00088
00089 BOOL CClientDlg::OnInitDialog()
00090 {
00091   CDialog::OnInitDialog();
00092
00093   // Set the icon for this dialog.  The framework does this automatically
00094   //  when the application's main window is not a dialog
00095   SetIcon(m_hIcon, TRUE);     // Set big icon
00096   SetIcon(m_hIcon, FALSE);    // Set small icon
00097
00098
00099
00100   return TRUE;  // return TRUE  unless you set the focus to a control
00101 }
00102
00103 // If you add a minimize button to your dialog, you will need the code below
00104 //  to draw the icon.  For MFC applications using the document/view model,
00105 //  this is automatically done for you by the framework.
00106
00107 void CClientDlg::OnPaint()
00108 {
00109   if (IsIconic())
00110   {
00111     CPaintDC dc(this); // device context for painting
00112
00113     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00114
00115     // Center icon in client rectangle
00116     int cxIcon = GetSystemMetrics(SM_CXICON);
00117     int cyIcon = GetSystemMetrics(SM_CYICON);
00118     CRect rect;
00119     GetClientRect(&rect);
00120     int x = (rect.Width() - cxIcon + 1) / 2;
00121     int y = (rect.Height() - cyIcon + 1) / 2;
00122
00123     // Draw the icon
00124     dc.DrawIcon(x, y, m_hIcon);
00125   }
00126   else
00127   {
00128     CDialog::OnPaint();
00129   }
00130 }
00131
00132 // The system calls this to obtain the cursor to display while the user drags
00133 //  the minimized window.
00134 HCURSOR CClientDlg::OnQueryDragIcon()
00135 {
00136   return (HCURSOR) m_hIcon;
00137 }
00138
00139
00140 void CClientDlg::OnOK()
00141 {
00142   CDialog::OnOK();
00143
00144   // Exit the monitor loop
00145   DestroyWindow();
00146 }
00147
00148 void CClientDlg::OnUsePing()
00149 {
00150   m_bUsePing = !m_bUsePing;
00151 }
00152
00153 void CClientDlg::OnStart()
00154 {
00155         WCHAR* pTemp = NULL;
00156   HRESULT hr = E_FAIL;
00157
00158
00159
00160   if (theApp.pMonitor){
00161     // Disconnect from the Server
00162     if (theApp.pMonitorCallFactory) {
00163       theApp.pMonitorCallFactory->Release();
00164       theApp.pMonitorCallFactory = NULL;
00165     }
00166
00167     if (theApp.pMonitorResponder){
00168       theApp.pMonitorResponder->Release();
00169       theApp.pMonitorResponder = NULL;
00170     }
00171
00172     theApp.pMonitor->Release();
00173     theApp.pMonitor = NULL;
00174
00175     m_ctlStart.SetWindowText(_T("Start"));
00176   } else {
00177     // Capture Remote Server Name
00178     UpdateData(TRUE);
00179
00180                 // Obtain the Remote Server Name
00181     COSERVERINFO  cos;
00182     cos.dwReserved1 = 0;
00183     cos.dwReserved2 = 0;
00184     cos.pAuthInfo = NULL;
00185 #ifdef _UNICODE
00186                 cos.pwszName = m_cRSN.GetBuffer(0);
00187 #else
00188                 int cchWide = MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,m_cRSN.GetBuffer(0),-1,NULL,0);
00189                 if (cchWide == 0)
00190                 {
00191                   // Error Case
00192                   AfxMessageBox(_T("MultiByteToWideChar Failed on RemoteServer Name getting Length! Using local machine."));
00193
00194                 } else {
00195                   pTemp = new WCHAR[cchWide+1];
00196                   if (pTemp)
00197                   {
00198                     cchWide = MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,m_cRSN.GetBuffer(0),-1,pTemp,cchWide);
00199                     if (cchWide == 0)
00200                     {
00201                       AfxMessageBox(_T("MultiByteToWideChar Failed on RemoteServer Name copying string!"));
00202                       delete pTemp;
00203                       pTemp = NULL;
00204                     }
00205                   }
00206                 }
00207                 cos.pwszName = pTemp;
00208 #endif
00209
00210     // Need MultiQI for CoCreateInstanceEx
00211     MULTI_QI mqi;
00212     mqi.pIID = &IID_IMonitorServer;
00213     mqi.pItf = NULL;
00214     mqi.hr = E_FAIL;
00215
00216     // Connect to server
00217     hr = CoCreateInstanceEx(CLSID_MonitorServer, NULL, CLSCTX_LOCAL_SERVER|CLSCTX_REMOTE_SERVER, &cos, 1, &mqi);
00218     if (FAILED(hr) || FAILED(mqi.hr)){
00219       AfxMessageBox(_T("Please Register Server, proxystub DLL on local machine, and specified Remote Server!"));
00220       OnOK();
00221       if (pTemp) delete pTemp;
00222                         return;
00223     }
00224
00225     theApp.pMonitor = (IMonitorServer*)mqi.pItf;
00226
00227     // Make sure IMonitorServer supports Non-Blocking Calls
00228
00229     hr = theApp.pMonitor->QueryInterface(IID_ICallFactory, (void**)&theApp.pMonitorCallFactory);
00230     if (FAILED(hr)){
00231       AfxMessageBox(_T("IMonitorServer doesn't support Non-Blocking Calls! Executing on Windows 2000?"));
00232       theApp.pMonitor->Release();
00233       theApp.pMonitor = NULL;
00234       OnOK();
00235       if (pTemp) delete pTemp;
00236       return;
00237     }
00238
00239     hr = theApp.pMonitor->GetPingResponder(&theApp.pMonitorResponder);
00240     if (FAILED(hr)){
00241       AfxMessageBox(_T("IMonitorServer doesn't support PingResponder! Please Register PingResp.dll on local system and Remote Server."));
00242       theApp.pMonitorCallFactory->Release();
00243       theApp.pMonitorCallFactory = NULL;
00244
00245       theApp.pMonitor->Release();
00246       theApp.pMonitor = NULL;
00247       OnOK();
00248       if (pTemp) delete pTemp;
00249       return;
00250     }
00251
00252                 if (pTemp) delete pTemp;
00253
00254                 m_ctlStart.SetWindowText(_T("Stop"));
00255
00256     // Reset Statistics
00257     m_iData = 0;
00258     m_lPings = 0;
00259     m_lTimeouts = 0;
00260     m_lTries = 0;
00261     m_lFails = 0;
00262     m_lPingFailures = 0;
00263
00264                 // Start OnIdle processing in CClientApp
00265     SetTimer(47,MONITORPOLLDELAY,NULL);
00266   }
00267 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/ipsamplerm.h Source File

  • NetDS
  • RRas
  • ip

ipsamplerm.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     ipsamplerm.h
00008
00009 Abstract:
00010
00011     The file contains type definitions and declarations for SAMPLE, the
00012     sample ip protocol, used by the IP Router Manager.
00013
00014 --*/
00015
00016 #ifndef _IPSAMPLERM_H_
00017 #define _IPSAMPLERM_H_
00018
00019
00020 // useful for variable sized structs
00021 #undef  ANY_SIZE
00022 #define ANY_SIZE 0
00023
00024
00025
00026 //----------------------------------------------------------------------------
00027 // CONSTANT AND MACRO DECLARATIONS
00028 //----------------------------------------------------------------------------
00029
00030 #define PROTO_IP_SAMPLE 200
00031 #define MS_IP_SAMPLE    \
00032 PROTOCOL_ID(PROTO_TYPE_UCAST, PROTO_VENDOR_MS0, PROTO_IP_SAMPLE)
00033
00034 #define SAMPLE_PROTOCOL_MULTICAST_GROUP ((DWORD)0x640000E0) // 224.0.0.100
00035
00036
00037 //----------------------------------------------------------------------------
00038 // constants identifying IPSAMPLE's MIB tables
00039 //----------------------------------------------------------------------------
00040
00041 #define IPSAMPLE_GLOBAL_STATS_ID        0
00042 #define IPSAMPLE_GLOBAL_CONFIG_ID       1
00043 #define IPSAMPLE_IF_STATS_ID            2
00044 #define IPSAMPLE_IF_CONFIG_ID           3
00045 #define IPSAMPLE_IF_BINDING_ID          4
00046
00047
00048 //----------------------------------------------------------------------------
00049 // constants used for the field IPSAMPLE_GLOBAL_CONFIG::dwLoggingLevel
00050 //----------------------------------------------------------------------------
00051
00052 #define IPSAMPLE_LOGGING_NONE           0
00053 #define IPSAMPLE_LOGGING_ERROR          1
00054 #define IPSAMPLE_LOGGING_WARN           2
00055 #define IPSAMPLE_LOGGING_INFO           3
00056
00057
00058
00059 //----------------------------------------------------------------------------
00060 // constants used for the field IPSAMPLE_IF_CONFIG::ulMetric
00061 //----------------------------------------------------------------------------
00062
00063 #define IPSAMPLE_METRIC_INFINITE        16
00064
00065
00066
00067 //----------------------------------------------------------------------------
00068 // constants used to construct the field IPSAMPLE_IF_BINDING::dwState
00069 //----------------------------------------------------------------------------
00070
00071 #define IPSAMPLE_STATE_ACTIVE           0x00000001
00072 #define IPSAMPLE_STATE_BOUND            0x00000002
00073
00074
00075
00076 //----------------------------------------------------------------------------
00077 // STRUCTURE DEFINITIONS
00078 //----------------------------------------------------------------------------
00079
00080
00081
00082 //----------------------------------------------------------------------------
00083 // struct:      IPSAMPLE_GLOBAL_STATS
00084 //
00085 // This MIB entry stores global statistics for IPSAMPLE;
00086 // There is only one instance, so this entry has no index.
00087 //
00088 // This structure is read-only.
00089 //----------------------------------------------------------------------------
00090
00091 typedef struct _IPSAMPLE_GLOBAL_STATS
00092 {
00093     ULONG       ulNumInterfaces; // # interfaces added
00094 } IPSAMPLE_GLOBAL_STATS, *PIPSAMPLE_GLOBAL_STATS;
00095
00096
00097
00098 //----------------------------------------------------------------------------
00099 // struct:      IPSAMPLE_GLOBAL_CONFIG
00100 //
00101 // This MIB entry stores global configuration for IPSAMPLE
00102 // There is only one instance, so this entry has no index.
00103 //----------------------------------------------------------------------------
00104
00105 typedef struct _IPSAMPLE_GLOBAL_CONFIG
00106 {
00107     DWORD       dwLoggingLevel;
00108 } IPSAMPLE_GLOBAL_CONFIG, *PIPSAMPLE_GLOBAL_CONFIG;
00109
00110
00111
00112 //----------------------------------------------------------------------------
00113 // struct:      IPSAMPLE_IF_STATS
00114 //
00115 // This MIB entry stores per-interface statistics for IPSAMPLE.
00116 //
00117 // This structure is read-only.
00118 //----------------------------------------------------------------------------
00119
00120 typedef struct _IPSAMPLE_IF_STATS
00121 {
00122     ULONG       ulNumPackets;   // # packets sent out this interface
00123 } IPSAMPLE_IF_STATS, *PIPSAMPLE_IF_STATS;
00124
00125
00126
00127 //----------------------------------------------------------------------------
00128 // struct:      IPSAMPLE_IF_CONFIG
00129 //
00130 // This MIB entry describes per-interface configuration.
00131 // All IP address fields must be in network order.
00132 //----------------------------------------------------------------------------
00133
00134 typedef struct _IPSAMPLE_IF_CONFIG
00135 {
00136     ULONG       ulMetric;
00137 } IPSAMPLE_IF_CONFIG, *PIPSAMPLE_IF_CONFIG;
00138
00139
00140
00141 //----------------------------------------------------------------------------
00142 // struct:      IPSAMPLE_IF_BINDING
00143 //
00144 // This MIB entry contains the table of IP addresses to which each
00145 // interface is bound.  All IP addresses are in network order.
00146 //
00147 // THIS STRUCTURE IS VARIABLE LENGTH:
00148 //
00149 //  The base structure contains of the field ulCount, which gives the
00150 //  number of IP addresses to which the indexed interface is bound.  The
00151 //  IP addresses themselves follow the base structure, and are given as
00152 //  IPSAMPLE_IP_ADDRESS structures.
00153 //
00154 // This MIB entry is read-only.
00155 //----------------------------------------------------------------------------
00156
00157 typedef struct _IPSAMPLE_IF_BINDING
00158 {
00159     DWORD       dwState;
00160     ULONG       ulCount;
00161 } IPSAMPLE_IF_BINDING, *PIPSAMPLE_IF_BINDING;
00162
00163
00164
00165
00166 //----------------------------------------------------------------------------
00167 // struct:      IPSAMPLE_IP_ADDRESS
00168 //
00169 // This structure is used for storing interface bindings.  A series of
00170 // structures of this type follows the IPSAMPLE_IF_BINDING structure
00171 // (described above).
00172 //
00173 // Both fields are IP address fields in network-order.
00174 //----------------------------------------------------------------------------
00175
00176 typedef struct _IPSAMPLE_IP_ADDRESS
00177 {
00178     DWORD       dwAddress;
00179     DWORD       dwMask;
00180 } IPSAMPLE_IP_ADDRESS, *PIPSAMPLE_IP_ADDRESS;
00181
00182
00183
00184 //----------------------------------------------------------------------------
00185 // macros for manipulating the variable-length IPSAMPLE_IF_BINDING structure
00186 //
00187 // IPSAMPLE_IF_BINDING_SIZE computes the size of a binding structure.
00188 //
00189 // IPSAMPLE_IF_ADDRESS_TABLE computes the starting address in a binding
00190 //      struct of the series of IPSAMPLE_IP_ADDRESS structures which are
00191 //      the bindings for the interface in question.
00192 //
00193 // e.g.
00194 //      PIPSAMPLE_IF_BINDING piibSource, piibDest;
00195 //
00196 //      piibDest = malloc(IPSAMPLE_IF_BINDING_SIZE(piibSource));
00197 //      memcpy(piibDest, piibSource, IPSAMPLE_IF_BINDING_SIZE(piibSource));
00198 //
00199 // e.g.
00200 //      ULONG                   i;
00201 //      PIPSAMPLE_IF_BINDING    piib;
00202 //      PIPSAMPLE_IP_ADDRESS    *piia;
00203 //
00204 //      piia = IPSAMPLE_IF_ADDRESS_TABLE(piib);
00205 //      for (i = 0; i < piib->ulCount; i++)
00206 //      {
00207 //          printf("%s-", inet_ntoa(*(struct in_addr *)&piia->dwAddress));
00208 //          printf("%s\n", inet_ntoa(*(struct in_addr *)&piia->dwMask));
00209 //      }
00210 //----------------------------------------------------------------------------
00211
00212 #define IPSAMPLE_IF_BINDING_SIZE(bind)                          \
00213     (sizeof(IPSAMPLE_IF_BINDING) +                              \
00214      (bind)->ulCount * sizeof(IPSAMPLE_IP_ADDRESS))
00215
00216 #define IPSAMPLE_IF_ADDRESS_TABLE(bind)                         \
00217     ((PIPSAMPLE_IP_ADDRESS)((bind) + 1))
00218
00219
00220
00221 //----------------------------------------------------------------------------
00222 // The following structures are used to query the MIB and get back a
00223 // response.  The TypeID field is one of the IDs #defined above.  The
00224 // IfIndex is used to reference an interface table entry .  For sample
00225 // it corresponds to an ip address, and hence is a single DWORD for now.
00226 // In general the index could be a variable size array of DWORDs.
00227 //----------------------------------------------------------------------------
00228
00229
00230
00231 //----------------------------------------------------------------------------
00232 // struct:      IPSAMPLE_MIB_SET_INPUT_DATA
00233 //
00234 // This is passed as input data for MibSet.
00235 // Note that only global config and interface config can be set.
00236 //----------------------------------------------------------------------------
00237
00238 typedef struct _IPSAMPLE_MIB_SET_INPUT_DATA
00239 {
00240     DWORD       IMSID_TypeID;
00241     DWORD       IMSID_IfIndex;
00242     DWORD       IMSID_BufferSize;
00243     BYTE        IMSID_Buffer[ANY_SIZE];
00244 } IPSAMPLE_MIB_SET_INPUT_DATA, *PIPSAMPLE_MIB_SET_INPUT_DATA;
00245
00246
00247
00248 //----------------------------------------------------------------------------
00249 // struct:      IPSAMPLE_MIB_GET_INPUT_DATA
00250 //
00251 // This is passed as input data for MibGet, MibGetFirst, MibGetNext.  All
00252 // tables are readable.  All IP addresses must be in network order.
00253 //----------------------------------------------------------------------------
00254
00255 typedef struct _IPSAMPLE_MIB_GET_INPUT_DATA
00256 {
00257     DWORD   IMGID_TypeID;
00258     DWORD   IMGID_IfIndex;
00259 } IPSAMPLE_MIB_GET_INPUT_DATA, *PIPSAMPLE_MIB_GET_INPUT_DATA;
00260
00261
00262
00263 //----------------------------------------------------------------------------
00264 // struct:      IPSAMPLE_MIB_GET_OUTPUT_DATA
00265 //
00266 // This is written into the output data by MibGet, MibGetFirst, MibGetNext.
00267 //----------------------------------------------------------------------------
00268
00269 typedef struct _IPSAMPLE_MIB_GET_OUTPUT_DATA
00270 {
00271     DWORD   IMGOD_TypeID;
00272     DWORD   IMGOD_IfIndex;
00273
00274     BYTE    IMGOD_Buffer[ANY_SIZE];
00275 } IPSAMPLE_MIB_GET_OUTPUT_DATA, *PIPSAMPLE_MIB_GET_OUTPUT_DATA;
00276
00277 #endif // _IPSAMPLERM_H_
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/caccount.h Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

caccount.h

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: CAccount.h
00003 //
00004 // Description: Declaration of CAccount
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022 #include "resource.h"       // main symbols
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // Account
00026
00027 class CAccount :
00028   public IDispatchImpl<IAccount, &IID_IAccount, &LIBID_ACCOUNT>,
00029   public ISupportErrorInfo,
00030   public CComObjectRoot,
00031   public CComCoClass<CAccount,&CLSID_CAccount>
00032 {
00033 public:
00034   CAccount() {}
00035 BEGIN_COM_MAP(CAccount)
00036   COM_INTERFACE_ENTRY(IDispatch)
00037   COM_INTERFACE_ENTRY(IAccount)
00038   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00039 END_COM_MAP()
00040 //DECLARE_NOT_AGGREGATABLE(CAccount)
00041 // Remove the comment from the line above if you don't want your object to
00042 // support aggregation.  The default is to support it
00043
00044 DECLARE_REGISTRY_RESOURCEID(IDR_Account)
00045 // ISupportsErrorInfo
00046   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00047
00048 // IAccount
00049 public:
00050   STDMETHOD(Post)(
00051     IN long lAccount,
00052     IN long lAmount,
00053     OUT BSTR* pbstrResult);
00054 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcNotify/_ShipStatus.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcNotify

_ShipStatus.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc24F.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCNotify.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcnotify;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: _ShipStatus
00019
00020 public class _ShipStatus extends com.ms.wfc.core.Enum
00021 {
00022   public static final short ssUnprocessed = 0;
00023   public static final short ssShipped = 1;
00024   public static final short ssBackOrdered = 2;
00025   public static final short ssNotStocked = 3;
00026   public static final short ssUnrecognizedItem = 4;
00027 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/table.cpp Source File

  • Begin
  • sdkdiff

table.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * standard table class.
00013  *
00014  * main interface functions.
00015  *
00016  * see table.h for interface description
00017  */
00018
00019 #include "precomp.h"
00020
00021 #include "table.h"
00022 #include "tpriv.h"
00023
00024 /* global tools etc */
00025 extern HANDLE hLibInst;
00026 HANDLE hVertCurs;
00027 HANDLE hNormCurs;
00028 HPEN hpenDotted;
00029 UINT gtab_msgcode;
00030
00031 /* function prototypes */
00032 LRESULT gtab_wndproc(HWND, UINT, WPARAM, LPARAM);
00033 void gtab_createtools(void);
00034 void gtab_deltable(HWND hwnd, lpTable ptab);
00035 lpTable gtab_buildtable(HWND hwnd, DWORD_PTR id);
00036 void gtab_setsize(HWND hwnd, lpTable ptab);
00037 void gtab_newsize(HWND hwnd, lpTable ptab);
00038 void gtab_calcwidths(HWND hwnd, lpTable ptab);
00039 BOOL gtab_alloclinedata(HWND hwnd, lpTable ptab);
00040 void gtab_invallines(HWND hwnd, lpTable ptab, int start, int count);
00041 void gtab_append(HWND hwnd, lpTable ptab, int rows, DWORD_PTR id);
00042
00043 /*
00044  * initialise window class - called from DLL main init
00045  */
00046 void
00047 gtab_init(void)
00048 {
00049     WNDCLASS wc;
00050
00051     gtab_createtools();
00052     gtab_msgcode = RegisterWindowMessage(TableMessage);
00053
00054     wc.style = CS_GLOBALCLASS | CS_DBLCLKS;
00055     wc.lpfnWndProc = (WNDPROC)gtab_wndproc;
00056     wc.cbClsExtra = 0;
00057     wc.cbWndExtra = WLTOTAL;
00058     wc.hInstance = (HINSTANCE)hLibInst;
00059     wc.hIcon = NULL;
00060     wc.hCursor = NULL;
00061     wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
00062     wc.lpszClassName = TableClassName;
00063     wc.lpszMenuName = NULL;
00064
00065     RegisterClass(&wc);
00066 }
00067
00068 void
00069 gtab_createtools(void)
00070 {
00071     hVertCurs = LoadCursor((HINSTANCE)hLibInst, "VertLine");
00072     hNormCurs = LoadCursor(NULL, IDC_ARROW);
00073
00074     hpenDotted = CreatePen(PS_DOT, 1, RGB(0, 0, 0));
00075 }
00076
00077 void
00078 gtab_deltools(void)
00079 {
00080     DeleteObject(hpenDotted);
00081 }
00082
00083
00084 LRESULT
00085 gtab_wndproc(
00086             HWND hwnd,
00087             UINT msg,
00088             WPARAM wParam,
00089             LPARAM lParam
00090             )
00091 {
00092     CREATESTRUCT FAR * csp;
00093     HWND hOwner;
00094     lpTable ptab;
00095     lpTableSelection pselect;
00096     long oldtop;
00097     long change;
00098
00099     switch (msg) {
00100
00101         case WM_CREATE:
00102             /* create window. set the wnd extra bytes to
00103              * contain the owner window and a null table.
00104              * Owner window is either in lParam or the parent.
00105              * Then wait for TM_NEWID.
00106              */
00107             csp = (CREATESTRUCT FAR *) lParam;
00108             if (csp->lpCreateParams == NULL) {
00109                 hOwner = GetParent(hwnd);
00110             } else {
00111                 hOwner = (HWND) csp->lpCreateParams;
00112             }
00113             ptab = NULL;
00114
00115             SetWindowLongPtr(hwnd, WL_TABLE, (LONG_PTR) ptab);
00116             SetWindowLongPtr(hwnd, WW_OWNER, (LONG_PTR) hOwner);
00117
00118             SetScrollRange(hwnd, SB_VERT, 0, 0, TRUE);
00119             SetScrollRange(hwnd, SB_HORZ, 0, 0, TRUE);
00120             break;
00121
00122         case TM_NEWID:
00123             /* complete change of table.
00124              * close old table, discard memory and
00125              * build new table
00126              */
00127             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00128             if (ptab != NULL) {
00129                 gtab_sendtq(hwnd, TQ_CLOSE, ptab->hdr.id);
00130                 gtab_deltable(hwnd, ptab);
00131                 SetCursor((HCURSOR)hNormCurs);
00132                 SetWindowLongPtr(hwnd, WL_TABLE, 0);
00133             }
00134             if ( (ptab = gtab_buildtable(hwnd, (DWORD_PTR)lParam)) != NULL) {
00135                 SetWindowLongPtr(hwnd, WL_TABLE, (LONG_PTR) ptab);
00136                 gtab_setsize(hwnd, ptab);
00137             } else {
00138                 SetScrollRange(hwnd, SB_VERT, 0, 0, TRUE);
00139                 SetScrollRange(hwnd, SB_HORZ, 0, 0, TRUE);
00140             }
00141             InvalidateRect(hwnd, NULL, TRUE);
00142             break;
00143
00144         case TM_NEWLAYOUT:
00145             /* change of layout but for same id. no TQ_CLOSE,
00146              * but otherwise same as TM_NEWID
00147              */
00148             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00149             if (ptab != NULL) {
00150                 gtab_deltable(hwnd, ptab);
00151                 SetCursor((HCURSOR)hNormCurs);
00152                 SetWindowLongPtr(hwnd, WL_TABLE, 0);
00153             }
00154             if ( (ptab = gtab_buildtable(hwnd, (DWORD_PTR)lParam)) != NULL) {
00155                 SetWindowLongPtr(hwnd, WL_TABLE, (LONG_PTR) ptab);
00156                 gtab_setsize(hwnd, ptab);
00157             } else {
00158                 SetScrollRange(hwnd, SB_VERT, 0, 0, TRUE);
00159                 SetScrollRange(hwnd, SB_HORZ, 0, 0, TRUE);
00160             }
00161             InvalidateRect(hwnd, NULL, TRUE);
00162             break;
00163
00164         case TM_REFRESH:
00165             /* data in table has changed. nrows may have
00166              * changed. ncols and col types have not changed
00167              */
00168             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00169             if (ptab != NULL) {
00170                 gtab_newsize(hwnd, ptab);
00171                 gtab_sendtq(hwnd, TQ_SHOWWHITESPACE, (LPARAM) &ptab->show_whitespace);
00172             }
00173             InvalidateRect(hwnd, NULL, TRUE);
00174             break;
00175
00176         case TM_SELECT:
00177             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00178             if (ptab != NULL) {
00179                 pselect = (lpTableSelection) lParam;
00180
00181                 gtab_select(hwnd, ptab, pselect->startrow,
00182                             pselect->startcell,
00183                             pselect->nrows,
00184                             pselect->ncells,
00185                             TRUE);
00186                 gtab_showsel_middle(hwnd, ptab, pselect->dyRowsFromTop);
00187             }
00188             break;
00189
00190         case TM_GETSELECTION:
00191             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00192             if (ptab != NULL) {
00193                 pselect = (lpTableSelection) lParam;
00194
00195                 *pselect = ptab->select;
00196             }
00197             break;
00198
00199         case TM_PRINT:
00200             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00201             if (ptab != NULL) {
00202                 return gtab_print(hwnd, ptab, (lpPrintContext) lParam);
00203             }
00204             return FALSE;
00205
00206         case TM_SETTABWIDTH:
00207             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00208             if (!ptab)
00209                 return 0;
00210             ptab->tabchars = (int)lParam;
00211             InvalidateRect(hwnd, NULL, FALSE);
00212             break;
00213
00214         case TM_TOPROW:
00215
00216             /* return top row. if wParam is TRUE, set lParam
00217              * as the new toprow
00218              */
00219             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00220             if (ptab == NULL) {
00221                 return(0);
00222             }
00223             oldtop = ptab->toprow;
00224             if ((wParam) && (lParam < ptab->hdr.nrows)) {
00225                 change = (long)lParam - ptab->toprow;
00226                 change -= ptab->hdr.fixedrows;
00227                 gtab_dovscroll(hwnd, ptab, change);
00228             }
00229             return(oldtop);
00230
00231         case TM_ENDROW:
00232             /* return the last visible row in the window */
00233             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00234             if (ptab == NULL) {
00235                 return(0);
00236             }
00237             return(ptab->nlines + ptab->toprow - 1);
00238
00239
00240         case TM_APPEND:
00241             /* new rows have been added to the end of the
00242              * table, but the rest of the table has not
00243              * been changed. Update without forcing redraw of
00244              * everything.
00245              * lParam contains the new total nr of rows
00246              */
00247             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00248             if (ptab != NULL) {
00249                 gtab_append(hwnd, ptab, (int) wParam, (DWORD_PTR)lParam);
00250                 return(TRUE);
00251             }
00252             break;
00253
00254         case WM_SIZE:
00255             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00256             if (ptab != NULL) {
00257                 gtab_setsize(hwnd, ptab);
00258             }
00259             break;
00260
00261         case WM_ERASEBKGND:
00262             return TRUE;
00263
00264         case WM_DESTROY:
00265             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00266             if (ptab != NULL) {
00267                 gtab_sendtq(hwnd, TQ_CLOSE, ptab->hdr.id);
00268                 gtab_deltable(hwnd, ptab);
00269             }
00270             break;
00271
00272         case WM_SYSCOLORCHANGE:
00273             InvalidateRect(hwnd, NULL, TRUE);
00274             break;
00275
00276         case WM_PAINT:
00277             gtab_paint(hwnd);
00278             break;
00279
00280         case WM_HSCROLL:
00281             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00282             if (ptab != NULL) {
00283                 gtab_msg_hscroll(hwnd, ptab,
00284                                  GET_SCROLL_OPCODE(wParam, lParam),
00285                                  GET_SCROLL_POS(wParam, lParam));
00286             }
00287             break;
00288
00289         case WM_VSCROLL:
00290             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00291             if (ptab != NULL) {
00292                 gtab_msg_vscroll(hwnd, ptab,
00293                                  GET_SCROLL_OPCODE(wParam, lParam),
00294                                  GET_SCROLL_POS(wParam, lParam));
00295             }
00296             break;
00297
00298         case WM_MOUSEMOVE:
00299             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00300             if (ptab != NULL) {
00301                 gtab_move(hwnd, ptab, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam));
00302             } else {
00303                 SetCursor((HCURSOR)hNormCurs);
00304             }
00305             break;
00306
00307         case WM_LBUTTONDOWN:
00308             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00309             if (ptab != NULL) {
00310                 gtab_press(hwnd, ptab, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam));
00311             }
00312             break;
00313
00314         case WM_RBUTTONDOWN:
00315             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00316             if (ptab != NULL) {
00317                 gtab_rightclick(hwnd, ptab, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam));
00318             }
00319             break;
00320
00321         case WM_LBUTTONUP:
00322             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00323             if (ptab != NULL) {
00324                 gtab_release(hwnd, ptab,
00325                              (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam));
00326             }
00327             break;
00328
00329         case WM_LBUTTONDBLCLK:
00330             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00331             if (ptab != NULL) {
00332                 gtab_dblclick(hwnd, ptab,
00333                               (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam));
00334             }
00335             break;
00336
00337         case WM_KEYDOWN:
00338             /* handle key presses for cursor movement about
00339              * the table, and return/space for selection.
00340              * Any key we don't handle is passed to the owner window
00341              * for him to handle.
00342              * The table window should have the focus
00343              */
00344             ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00345             if (ptab != NULL) {
00346                 if (gtab_key(hwnd, ptab, (int)wParam) != 0) {
00347                     hOwner = (HWND) GetWindowLongPtr(hwnd, WW_OWNER);
00348                     return(SendMessage(hOwner, WM_KEYDOWN, wParam, lParam));
00349                 } else {
00350                     return(0);
00351                 }
00352             }
00353             break;
00354
00355 #ifdef WM_MOUSEWHEEL
00356         case WM_MOUSEWHEEL:
00357             ptab = (lpTable)GetWindowLongPtr(hwnd, WL_TABLE);
00358             if (ptab != NULL) {
00359                 if (gtab_mousewheel(hwnd,ptab, LOWORD(wParam), (short)HIWORD(wParam))) {
00360                     hOwner = (HWND)GetWindowLongPtr(hwnd, WW_OWNER);
00361                     return SendMessage(hOwner, WM_MOUSEWHEEL, wParam, lParam);
00362                 }
00363             }
00364             break;
00365 #endif
00366
00367         default:
00368             return(DefWindowProc(hwnd, msg, wParam, lParam));
00369     }
00370     return(TRUE);
00371 }
00372
00373 /*
00374  * send a table-query message to the owner window. returns message
00375  * value.
00376  */
00377 INT_PTR
00378 gtab_sendtq(
00379            HWND hwnd,
00380            UINT cmd,
00381            LPARAM lParam
00382            )
00383 {
00384     HWND hOwner;
00385
00386     hOwner = (HWND) GetWindowLongPtr(hwnd, WW_OWNER);
00387     return (SendMessage(hOwner, gtab_msgcode, cmd, lParam));
00388 }
00389
00390 /*
00391  * free the memory allocated for the array of lines (each containing
00392  * an array of Cells, each containing an array of chars for the actual
00393  * data). Called on any occasion that would change the number of visible lines
00394  */
00395 void
00396 gtab_freelinedata(
00397                  lpTable ptab
00398                  )
00399 {
00400     int i, j, ncols;
00401     lpCellData cd;
00402
00403
00404     ncols = ptab->hdr.ncols;
00405
00406     /* for each line */
00407     for (i = 0; i < ptab->nlines; i++) {
00408         /* for each cell */
00409         for (j = 0; j < ncols; j++) {
00410             /* free up the actual text space */
00411             cd = &ptab->pdata[i].pdata[j];
00412             HeapFree(GetProcessHeap(), NULL, cd->ptext);
00413             HeapFree(GetProcessHeap(), NULL, cd->pwzText);
00414         }
00415         /* dealloc array of CellData */
00416         HeapFree(GetProcessHeap(), NULL, ptab->pdata[i].pdata);
00417     }
00418     /* de-alloc array of linedatas */
00419     HeapFree(GetProcessHeap(), NULL, ptab->pdata);
00420     ptab->pdata = NULL;
00421 }
00422
00423 /* allocate and init array of linedatas (include cell array
00424  * and text for each cell)
00425  */
00426 BOOL
00427 gtab_alloclinedata(
00428                   HWND hwnd,
00429                   lpTable ptab
00430                   )
00431 {
00432     lpLineData pline;
00433     lpCellData cd;
00434     int i, j;
00435
00436     ptab->pdata = (lpLineData) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
00437                                         sizeof(LineData) * ptab->nlines);
00438     if (ptab->pdata == NULL) {
00439         return(FALSE);
00440     }
00441     for (i = 0; i < ptab->nlines; i++) {
00442         pline = &ptab->pdata[i];
00443         pline->linepos.size = ptab->rowheight;
00444         pline->pdata = (lpCellData) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
00445                                              sizeof(CellData) * ptab->hdr.ncols);
00446         if (pline->pdata == NULL) {
00447             return(FALSE);
00448         }
00449         for (j = 0; j < ptab->hdr.ncols; j++) {
00450             cd = &pline->pdata[j];
00451             cd->props.valid = 0;
00452             cd->flags = 0;
00453             cd->nchars = ptab->pcolhdr[j].nchars;
00454             if (cd->nchars > 0) {
00455                 cd->ptext = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cd->nchars);
00456                 if (cd->ptext == NULL) {
00457                     return(FALSE);
00458                 }
00459                 cd->pwzText = 0;
00460             }
00461         }
00462     }
00463     return(TRUE);
00464 }
00465
00466 /*
00467  * free up all table data structures. Called for new layout or new data.
00468  */
00469 void
00470 gtab_deltable(
00471              HWND hwnd,
00472              lpTable ptab
00473              )
00474 {
00475     int ncols;
00476
00477     if (ptab == NULL) {
00478         return;
00479     }
00480     ncols = ptab->hdr.ncols;
00481
00482     if (ptab->pcolhdr != NULL) {
00483         HeapFree(GetProcessHeap(), NULL, ptab->pcolhdr);
00484     }
00485     if (ptab->pcellpos != NULL) {
00486         HeapFree(GetProcessHeap(), NULL, ptab->pcellpos);
00487     }
00488     if (ptab->pdata != NULL) {
00489         gtab_freelinedata(ptab);
00490     }
00491     HeapFree(GetProcessHeap(), NULL, ptab);
00492 }
00493
00494
00495 /*
00496  * build up a Table struct (excluding data allocation and
00497  * anything to do with font or window size).
00498  * return ptr to this or NULL if error
00499  */
00500 lpTable
00501 gtab_buildtable(
00502                HWND hwnd,
00503                DWORD_PTR id
00504                )
00505 {
00506     lpTable ptab;
00507     int ncols, i;
00508     ColPropsList cplist;
00509
00510     ptab = (lpTable) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(Table));
00511     if (ptab == NULL) {
00512         return(NULL);
00513     }
00514
00515     // get the tab width. most clients will not support this
00516     if (gtab_sendtq(hwnd, TQ_TABS, (LPARAM) &ptab->tabchars) == FALSE) {
00517         ptab->tabchars = TABWIDTH_DEFAULT;
00518     }
00519
00520     // get the show whitespace value
00521     if (gtab_sendtq(hwnd, TQ_SHOWWHITESPACE, (LPARAM) &ptab->show_whitespace) == FALSE) {
00522         ptab->show_whitespace = FALSE;
00523     }
00524
00525     /* get the row/column count from owner window */
00526     ptab->hdr.id = id;
00527     ptab->hdr.props.valid = 0;
00528     ptab->hdr.sendscroll = FALSE;
00529     if (gtab_sendtq(hwnd, TQ_GETSIZE, (LPARAM) &ptab->hdr) == FALSE) {
00530         return(NULL);
00531     }
00532
00533     ncols = ptab->hdr.ncols;
00534     ptab->pcolhdr = (lpColProps) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ColProps) * ncols);
00535     if (ptab->pcolhdr == NULL) {
00536         /* should prob send TQ_CLOSE at this point */
00537         return(NULL);
00538     }
00539
00540     /* init col properties to default */
00541     for (i=0; i < ncols; i++) {
00542         ptab->pcolhdr[i].props.valid = 0;
00543         ptab->pcolhdr[i].nchars = 0;
00544     }
00545     /* get the column props from owner */
00546     cplist.plist = ptab->pcolhdr;
00547     cplist.id = id;
00548     cplist.startcol = 0;
00549     cplist.ncols = ncols;
00550     gtab_sendtq(hwnd, TQ_GETCOLPROPS, (LPARAM) &cplist);
00551
00552     /* init remaining fields */
00553     ptab->pcellpos = (lpCellPos) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CellPos) * ncols);
00554     if (ptab->pcellpos == NULL) {
00555         return(NULL);
00556     }
00557
00558     ptab->scrollscale = 1;
00559     ptab->scroll_dx = 0;
00560     ptab->toprow = 0;
00561     ptab->pdata = NULL;
00562     ptab->nlines = 0;
00563     ptab->trackmode = TRACK_NONE;
00564
00565     /* we have to notify owner of the current selection
00566      * whenever it is changed
00567      */
00568     ptab->select.id = id;
00569     gtab_select(hwnd, ptab, 0, 0, 0, 0, TRUE);
00570
00571     /* calc ave height/width, cell widths and min height.
00572      * these change only when cell properties / col count changes -
00573      * ie only on rebuild-header events
00574      */
00575     gtab_calcwidths(hwnd, ptab);
00576     return(ptab);
00577 }
00578
00579 /* set sizes that are based on window size and scroll pos
00580  * set:
00581  *      winwidth
00582  *      nlines
00583  *      cellpos start, clip start/end
00584  * alloc linedata and init
00585  */
00586 void
00587 gtab_setsize(
00588             HWND hwnd,
00589             lpTable ptab
00590             )
00591 {
00592     RECT rc;
00593     int nlines;
00594     long change;
00595     SCROLLINFO si;
00596
00597     GetClientRect(hwnd, &rc);
00598     ptab->winwidth = rc.right - rc.left;
00599     nlines = (rc.bottom - rc.top) / ptab->rowheight;
00600     /* nlines is the number of whole lines - add one extra
00601      * for the partial line at the bottom
00602      */
00603     nlines += 1;
00604
00605     /* alloc space for nlines of data - if nlines has changed */
00606     if (nlines != ptab->nlines) {
00607         gtab_freelinedata(ptab);
00608         ptab->nlines = nlines;
00609         if (!gtab_alloclinedata(hwnd, ptab)) {
00610             ptab->nlines = 0;
00611             return;
00612         }
00613     }
00614
00615     si.cbSize = sizeof(si);
00616     si.fMask = SIF_PAGE|SIF_RANGE;
00617     si.nMin = 0;
00618
00619     /* set scroll vertical range */
00620     si.nMax = ptab->hdr.nrows;
00621     si.nPage = ptab->nlines;
00622     if (si.nMax < 0) {
00623         si.nMax = 0;
00624         change =  -(ptab->toprow);
00625     } else if (ptab->toprow > si.nMax) {
00626         change = si.nMax - ptab->toprow;
00627     } else {
00628         change = 0;
00629     }
00630     /* the scroll range must be 16-bits for Win3
00631      * scale until this is true
00632      */
00633     ptab->scrollscale = 1;
00634     while (si.nMax > 32766) {
00635         ptab->scrollscale *= 16;
00636         si.nMax /= 16;
00637         si.nPage /= 16;
00638     }
00639     if (!si.nPage)
00640         si.nPage = 1;
00641
00642     SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
00643     gtab_dovscroll(hwnd, ptab, change);
00644
00645     /* set horz scroll range */
00646     si.nMax = ptab->rowwidth;
00647     si.nPage = ptab->winwidth;
00648     if (si.nMax < 0) {
00649         si.nMax = 0;
00650         change = -(ptab->scroll_dx);
00651     } else if (ptab->scroll_dx > si.nMax) {
00652         change = si.nMax - ptab->scroll_dx;
00653     } else {
00654         change = 0;
00655     }
00656     /* horz scroll range will always be < 16 bits */
00657     SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);
00658     gtab_dohscroll(hwnd, ptab, change);
00659 }
00660
00661 /* set column widths/height and totals (based on column props)
00662  * - no assumption of window size (see gtab_setsize)
00663  * sets avewidth,rowheight,cellpos.size,rowwidth (total of cellpos.size)
00664  */
00665 void
00666 gtab_calcwidths(
00667                HWND hwnd,
00668                lpTable ptab
00669                )
00670 {
00671     int i, cxtotal, cx, ave;
00672     TEXTMETRIC tm = {0};
00673     TEXTMETRIC tmcol = {0};
00674     HDC hdc;
00675     lpProps hdrprops, cellprops;
00676     HFONT hfont;
00677
00678     hfont = NULL;  /* eliminate spurious diagnostic, make code worse */
00679     hdrprops = &ptab->hdr.props;
00680     hdc = GetDC(hwnd);
00681     if (hdc)
00682     {
00683         GetTextMetrics(hdc, &tm);
00684         ptab->rowheight = tm.tmHeight + tm.tmExternalLeading;
00685         if (hdrprops->valid & P_FONT) {
00686             hfont = (HFONT)SelectObject(hdc, hdrprops->hFont);
00687         }
00688         GetTextMetrics(hdc, &tm);
00689         if (hdrprops->valid & P_FONT) {
00690             SelectObject(hdc, hfont);
00691         }
00692         ReleaseDC(hwnd, hdc);
00693     }
00694     else
00695     {
00696         // arbitrary, whatever...
00697         ptab->rowheight = 14;
00698         tm.tmHeight = 14;
00699         tm.tmAveCharWidth = 5;
00700     }
00701
00702     /* get width and height of average character */
00703     ptab->avewidth = tm.tmAveCharWidth;
00704     if (tm.tmHeight + tm.tmExternalLeading < ptab->rowheight - 2 ||
00705         tm.tmHeight + tm.tmExternalLeading > ptab->rowheight) {
00706         // make sure that the default FixedSys (and anything of similar size)
00707         // doesn't vertically clip the System font used for line numbers,
00708         // filenames, etc.
00709         ptab->rowheight = tm.tmHeight;
00710         if (tm.tmExternalLeading)
00711             ptab->rowheight += tm.tmExternalLeading;
00712         else
00713             ptab->rowheight++;
00714     }
00715     if (hdrprops->valid & P_HEIGHT) {
00716         ptab->rowheight = hdrprops->height;
00717     }
00718
00719     /* set pixel width of each cell (and add up for row total)
00720      * based on ave width * nr chars, unless P_WIDTH set
00721      */
00722     cxtotal = 0;
00723     for (i = 0; i < ptab->hdr.ncols; i++) {
00724         cellprops = &ptab->pcolhdr[i].props;
00725
00726         if (cellprops->valid & P_WIDTH) {
00727             cx = cellprops->width;
00728         } else if (hdrprops->valid & P_WIDTH) {
00729             cx = hdrprops->width;
00730         } else {
00731
00732             if (cellprops->valid & P_FONT) {
00733                 hdc = GetDC(hwnd);
00734                 if (hdc)
00735                 {
00736                     hfont = (HFONT)SelectObject(hdc, cellprops->hFont);
00737                     GetTextMetrics(hdc, &tmcol);
00738                     SelectObject(hdc, hfont);
00739                     ReleaseDC(hwnd, hdc);
00740                     ave = tmcol.tmAveCharWidth;
00741                 }
00742                 else
00743                     ave = 5;
00744             } else {
00745                 ave = ptab->avewidth;
00746             }
00747             /* ave width * nchars */
00748             cx =  ptab->pcolhdr[i].nchars + 1;
00749             cx *= ave;
00750         }
00751         /* add 2 pixels for box lines */
00752         cx += 2;
00753         ptab->pcellpos[i].size = cx;
00754         cxtotal += cx;
00755     }
00756     ptab->rowwidth = cxtotal;
00757 }
00758
00759 /* called when row data + possible nrows changes.
00760  * other changes are ignored
00761  */
00762 void
00763 gtab_newsize(
00764             HWND hwnd,
00765             lpTable ptab
00766             )
00767 {
00768     TableHdr hdr;
00769
00770     /* get new row count */
00771     hdr = ptab->hdr;
00772     gtab_sendtq(hwnd, TQ_GETSIZE, (LPARAM) &hdr);
00773     if (hdr.nrows != ptab->hdr.nrows) {
00774         ptab->hdr.nrows = hdr.nrows;
00775         gtab_setsize(hwnd, ptab);
00776     }
00777
00778     gtab_invallines(hwnd, ptab, 0, ptab->nlines);
00779
00780     InvalidateRect(hwnd, NULL, FALSE);
00781 }
00782
00783 void
00784 gtab_invallines(
00785                HWND hwnd,
00786                lpTable ptab,
00787                int start,
00788                int count
00789                )
00790 {
00791     int i, j;
00792
00793     for (i = start; i < start + count; i++) {
00794         for (j = 0; j < ptab->hdr.ncols; j++) {
00795             ptab->pdata[i].pdata[j].flags = 0;
00796         }
00797     }
00798 }
00799
00800 /* new rows have been added to the table. adjust the scroll range and
00801  * position, and redraw the rows if the end of the table is currently
00802  * visible.
00803  * rows = the new total row count.
00804  */
00805 void
00806 gtab_append(
00807            HWND hwnd,
00808            lpTable ptab,
00809            int rows,
00810            DWORD_PTR id
00811            )
00812 {
00813     long oldrows;
00814     int line, nupdates;
00815     RECT rc;
00816     SCROLLINFO si;
00817
00818
00819     /* change to the new id */
00820     ptab->hdr.id = id;
00821     ptab->select.id = id;
00822
00823     /* update the header, but remember the old nr of rows
00824      * so we know where to start updating
00825      */
00826     oldrows = ptab->hdr.nrows;
00827
00828     /* check that the new nr of rows is not smaller.
00829      */
00830     if (oldrows >= rows) {
00831         return;
00832     }
00833
00834     ptab->hdr.nrows = rows;
00835
00836     si.cbSize = sizeof(si);
00837     si.fMask = SIF_PAGE|SIF_RANGE;
00838     si.nMin = 0;
00839
00840     /* set the vertical scroll range */
00841     si.nMax = rows;
00842     si.nPage = ptab->nlines;
00843     if (si.nMax < 0) {
00844         si.nMax = 0;
00845     }
00846
00847     /* force the scroll range into 16-bits for win 3.1 */
00848     ptab->scrollscale = 1;
00849     while (si.nMax > 32766) {
00850         ptab->scrollscale *= 16;
00851         si.nMax /= 16;
00852         si.nPage /= 16;
00853     }
00854     if (!si.nPage)
00855         si.nPage = 1;
00856
00857     /* now set the scroll bar range and position */
00858     SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
00859     if (si.nMax > 0) {
00860         SetScrollPos(hwnd, SB_VERT,
00861                      (int) (ptab->toprow / ptab->scrollscale), TRUE);
00862     }
00863
00864     /* calculate which screen lines need to be updated - find what
00865      * screen line the start of the new section is at
00866      */
00867     line = gtab_rowtoline(hwnd, ptab, oldrows);
00868     if (line == -1) {
00869         /* not visible -> no more to do */
00870         return;
00871     }
00872
00873     /* how many lines to update - rest of screen or nr of
00874      * new lines if less than rest of screen
00875      */
00876     nupdates = min((ptab->nlines - line), (int)(rows - oldrows));
00877
00878     /* invalidate the screen line buffers to indicate data
00879      * needs to be refetch from parent window
00880      */
00881     gtab_invallines(hwnd, ptab, line, nupdates);
00882
00883     /* calculate the region of the screen to be repainted -
00884      * left and right are same as window. top and bottom
00885      * need to be calculated from screen line height
00886      */
00887
00888     GetClientRect(hwnd, &rc);
00889     rc.top += line * ptab->rowheight;
00890     rc.bottom = rc.top + (nupdates * ptab->rowheight);
00891
00892     /* force a repaint of the updated region */
00893     InvalidateRect(hwnd, &rc, FALSE);
00894 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/resource.h Source File

  • Dataaccess
  • oledb
  • sampprov

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by SampProv.rc
00004 //
00005 #define IDD_DSL_CONNECTION              101
00006 #define IDD_DSL_ADVANCED                102
00007 #define IDE_DATASOURCE                  1000
00008 #define IDB_BROWSE_DIRECTORY            1002
00009 #define IDC_STATIC                      -1
00010
00011 // Next default values for new objects
00012 //
00013 #ifdef APSTUDIO_INVOKED
00014 #ifndef APSTUDIO_READONLY_SYMBOLS
00015 #define _APS_NO_MFC                     1
00016 #define _APS_3D_CONTROLS                     1
00017 #define _APS_NEXT_RESOURCE_VALUE        103
00018 #define _APS_NEXT_COMMAND_VALUE         40001
00019 #define _APS_NEXT_CONTROL_VALUE         1004
00020 #define _APS_NEXT_SYMED_VALUE           101
00021 #endif
00022 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/ProcessDlg.Cpp Source File

  • WinBase
  • WtsApi
  • WtsApi

ProcessDlg.Cpp

Go to the documentation of this file.
00001 // ProcessDlg.cpp : implementation file
00002 //
00003 //  Copyright 1995-1999, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006
00007 #include "stdafx.h"
00008 #include "API.h"
00009 #include "ProcessDlg.h"
00010 //#include <wtsapi32.h>
00011 #include "APIDoc.h"
00012
00013 #ifdef _DEBUG
00014 #define new DEBUG_NEW
00015 #undef THIS_FILE
00016 static char THIS_FILE[] = __FILE__;
00017 #endif
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CProcessDlg dialog
00021
00022
00023 CProcessDlg::CProcessDlg(CWnd* pParent /*=NULL*/)
00024   : CDialog(CProcessDlg::IDD, pParent)
00025 {
00026   //{{AFX_DATA_INIT(CProcessDlg)
00027     // NOTE: the ClassWizard will add member initialization here
00028   //}}AFX_DATA_INIT
00029 }
00030
00031
00032 void CProcessDlg::DoDataExchange(CDataExchange* pDX)
00033 {
00034   CDialog::DoDataExchange(pDX);
00035   //{{AFX_DATA_MAP(CProcessDlg)
00036   DDX_Control(pDX, IDC_SERVER_NAME, m_serverName);
00037   DDX_Control(pDX, IDC_PROCESS, m_processList);
00038   //}}AFX_DATA_MAP
00039 }
00040
00041
00042 BEGIN_MESSAGE_MAP(CProcessDlg, CDialog)
00043   //{{AFX_MSG_MAP(CProcessDlg)
00044   ON_BN_CLICKED(ID_TERMINATE_PROCESS, OnTerminateProcess)
00045   ON_BN_CLICKED(IDC_REFRESH, OnRefresh)
00046   //}}AFX_MSG_MAP
00047 END_MESSAGE_MAP()
00048
00049 /////////////////////////////////////////////////////////////////////////////
00050 // CProcessDlg message handlers
00051
00052
00053
00054 void CProcessDlg::OnTerminateProcess()
00055 {
00056   DWORD        ProcessId;
00057   LPSTR serverName = g_pDoc->GetServerName();
00058   HANDLE serverHandle = WTSOpenServer(serverName);
00059   CString tempName;
00060   int    temp;
00061   PWTS_PROCESS_INFO pProcess = pProcessInfo;
00062
00063   temp = m_processList.GetCurSel();
00064   m_processList.GetText(temp, tempName);
00065
00066   for (DWORD i=0; i < count; i++)
00067   {
00068     if (tempName == (pProcess->pProcessName))
00069     {
00070       ProcessId = pProcess->ProcessId;
00071       if (!WTSTerminateProcess(serverHandle,ProcessId,0x0))
00072         AfxMessageBox("Unable to terminate process");
00073       i = count;
00074     }
00075     pProcess++;
00076   }
00077   Refresh();
00078 }
00079
00080 BOOL CProcessDlg::OnInitDialog()
00081 {
00082   CDialog::OnInitDialog();
00083   serverName = g_pDoc->GetServerName();
00084   serverHandle = WTSOpenServer(serverName);
00085   if (!WTSEnumerateProcesses(serverHandle,0,1,&pProcessInfo,&count))
00086     AfxMessageBox("Unable to enumerate processes");
00087   PWTS_PROCESS_INFO pProcess = pProcessInfo;
00088
00089   CString serverDisplay;
00090   serverDisplay = "List of processes on ";
00091   if (*serverName == NULL)
00092     serverDisplay += "local server";
00093   else
00094     serverDisplay += serverName;
00095   m_serverName.SetWindowText(serverDisplay);
00096
00097
00098   for (DWORD i=0; i < count; i++)
00099   {
00100     m_processList.AddString(pProcess->pProcessName);
00101     pProcess++;
00102   }
00103   m_processList.SetCurSel(0);
00104
00105   return TRUE;
00106 }
00107
00108 void CProcessDlg::Refresh()
00109 {
00110   m_processList.ResetContent();
00111   BOOL result = WTSEnumerateProcesses(serverHandle,0,1,&pProcessInfo,&count);
00112   PWTS_PROCESS_INFO pProcess = pProcessInfo;
00113
00114   for (DWORD i=0; i < count; i++)
00115   {
00116     m_processList.AddString(pProcess->pProcessName);
00117     pProcess++;
00118   }
00119   m_processList.SetCurSel(0);
00120 }
00121
00122 void CProcessDlg::OnCancel()
00123 {
00124   WTSCloseServer(serverHandle);
00125   WTSFreeMemory(pProcessInfo);
00126   CDialog::OnCancel();
00127 }
00128
00129 void CProcessDlg::OnRefresh()
00130 {
00131   Refresh();
00132 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CachePluginAdmin Member List

This is the complete list of members for CachePluginAdmin, including all inherited members.
ArchiveQuotaPerStream | CachePluginAdmin | [private]
ArchiveQuotaPerStream | CachePluginAdmin |
BackendServer | CachePluginAdmin | [private]
BackendServer | CachePluginAdmin |
CacheDirectoryPath | CachePluginAdmin | [private]
CacheDirectoryPath | CachePluginAdmin |
CacheOnDemandCacheMiss | CachePluginAdmin | [private]
CacheOnDemandCacheMiss | CachePluginAdmin |
CachePluginAdmin() | CachePluginAdmin | [inline]
DiskQuota | CachePluginAdmin | [private]
DiskQuota | CachePluginAdmin |
FetchNameValFromServerNamespace(string strKey, object objValue) | CachePluginAdmin | [inline]
g_NamedValues | CachePluginAdmin | [private]
get | IWMSCacheAdmin |
LoadSettingsFromServerNamespace() | CachePluginAdmin | [inline]
LoadSettingsFromXmlFile(string strPath) | CachePluginAdmin | [inline]
ModifySettingsEventHandler(string strName, object objValue) | CachePluginAdmin |
NamedValues | CachePluginAdmin |
PersistChangesToXmlFile(string strPath) | CachePluginAdmin | [inline]
PersistChangesToXmlFile() | CachePluginAdmin | [inline]
PersistNameValToServerNamespace(string strKey, object objValue) | CachePluginAdmin | [inline]
PreferredProtocol | CachePluginAdmin | [private]
PreferredProtocol | CachePluginAdmin |
ProxyOnDemandCacheMiss | CachePluginAdmin | [private]
ProxyOnDemandCacheMiss | CachePluginAdmin |
ProxyRedirectURL | CachePluginAdmin | [private]
ProxyRedirectURL | CachePluginAdmin |
RegisterChange(string strName, object objValue) | CachePluginAdmin | [inline]
RegisterChangeHandler(ModifySettingsEventHandler theHandler) | CachePluginAdmin | [inline]
RegisteredChangeHandler | CachePluginAdmin | [private]
SerializedValues | CachePluginAdmin | [private]
set | IWMSCacheAdmin |
strPathToConfigDoc | CachePluginAdmin | [private]
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/Server.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

Server.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.CPP
00003
00004   Summary:   Implementation file for the CServer server control C++
00005              object.  This object encapsulates the server's internal
00006              control of global server object and lock counts. The
00007              CThreaded OwnThis mechanism is used to ensure mutually
00008              exclusive access to this CServer object by multiple threads.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial DCDSERVE.HTM
00012              file. For more specific technical details on the internal
00013              workings see the comments dispersed throughout the module's
00014              source code.
00015
00016   Classes:   CServer.
00017
00018   Functions: .
00019
00020   Origin:    2-12-98: atrent - Editor-inheritance from SERVER.CPP in
00021                the LOCSERVE Tutorial Code Sample. [Revised]
00022
00023 ----------------------------------------------------------------------------
00024   This file is part of the Microsoft COM Tutorial Code Samples.
00025
00026   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00027
00028   This source code is intended only as a supplement to Microsoft
00029   Development Tools and/or on-line documentation.  See these other
00030   materials for detailed information regarding Microsoft code samples.
00031
00032   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00033   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00034   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00035   PARTICULAR PURPOSE.
00036 ==========================================================================+*/
00037
00038 /*---------------------------------------------------------------------------
00039   We include WINDOWS.H for all Win32 applications.
00040   We include OLE2.H because we will be calling the COM/OLE Libraries.
00041   We include APPUTIL.H because we will be building this EXE using
00042     the convenient Virtual Window and Dialog classes and other
00043     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00044   We include PAPINT.H and PAPGUIDS.H for the common paper-related
00045     Interface class, GUID, and CLSID specifications.
00046   We include SERVER.H for the class declarations for the C++ CServer
00047     server control object.
00048   We include FACTORY.H because it has the necessary internal class factory
00049     declarations for this component server.
00050 ---------------------------------------------------------------------------*/
00051 #include <windows.h>
00052 #include <ole2.h>
00053 #include <apputil.h>
00054 #include <papint.h>
00055 #include <papguids.h>
00056 #include "server.h"
00057 #include "factory.h"
00058
00059
00060 /*---------------------------------------------------------------------------
00061   Implementation the internal CServer C++ object.  Used to encapsulate
00062   some server data and the methods for Lock and Object count incrementing
00063   and decrementing.
00064 ---------------------------------------------------------------------------*/
00065
00066 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00067   Method:   CServer::CServer
00068
00069   Summary:  CServer Constructor.
00070
00071   Args:     void
00072
00073   Returns:  void
00074 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00075 CServer::CServer(void)
00076 {
00077   // Zero the Object and Lock counts.
00078   m_cObjects = 0;
00079   m_cLocks = 0;
00080
00081   // Zero the cached handles.
00082   m_hInstServer = NULL;
00083   m_hWndServer = NULL;
00084
00085   // Zero the Factory references.
00086   m_pCFPaper = NULL;
00087   m_dwCFPaper = 0;
00088
00089   // NULL the shared single object pointers.
00090   m_pCOPaper = NULL;
00091
00092   return;
00093 }
00094
00095
00096 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00097   Method:   CServer::~CServer
00098
00099   Summary:  CServer Destructor.
00100
00101   Args:     void
00102
00103   Returns:  void
00104 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00105 CServer::~CServer(void)
00106 {
00107   return;
00108 }
00109
00110
00111 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00112   Method:   CServer::ObjectsUp
00113
00114   Summary:  Increment the Server's living Object count.
00115
00116   Args:     void
00117
00118   Modifies: m_cObjects.
00119
00120   Returns:  void
00121 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00122 void CServer::ObjectsUp(void)
00123 {
00124   if (OwnThis())
00125   {
00126     ++m_cObjects;
00127
00128     UnOwnThis();
00129   }
00130
00131   return;
00132 }
00133
00134
00135 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00136   Method:   CServer::ObjectsDown
00137
00138   Summary:  Decrement the Server's living object count.
00139
00140   Args:     void
00141
00142   Modifies: m_cObjects.
00143
00144   Returns:  void
00145 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00146 void CServer::ObjectsDown(void)
00147 {
00148   if (OwnThis())
00149   {
00150     --m_cObjects;
00151
00152     // If no more living objects and no locks then shut the server down.
00153     if (0L == m_cObjects && 0L == m_cLocks && IsWindow(m_hWndServer))
00154     {
00155       // Post a message to this local server's message queue requesting
00156       // a close of the application.
00157       PostMessage(m_hWndServer, WM_CLOSE, 0, 0L);
00158     }
00159
00160     UnOwnThis();
00161   }
00162
00163   return;
00164 }
00165
00166
00167 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00168   Method:   CServer::Lock
00169
00170   Summary:  Increment the Server's Lock count.
00171
00172   Args:     void
00173
00174   Modifies: m_cLocks.
00175
00176   Returns:  void
00177 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00178 void CServer::Lock(void)
00179 {
00180   LONG cLocks;
00181
00182   if (OwnThis())
00183   {
00184     cLocks = ++m_cLocks;
00185
00186     UnOwnThis();
00187   }
00188
00189   return;
00190 }
00191
00192
00193 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00194   Method:   CServer::Unlock
00195
00196   Summary:  Decrement the Server's Lock count.
00197
00198   Args:     void
00199
00200   Modifies: m_cLocks.
00201
00202   Returns:  void
00203 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00204 void CServer::Unlock(void)
00205 {
00206   if (OwnThis())
00207   {
00208     --m_cLocks;
00209
00210     // Use ObjectsDown to force a server shutdown if this unlock warrants it.
00211     ++m_cObjects;
00212     ObjectsDown();
00213
00214     UnOwnThis();
00215   }
00216
00217   return;
00218 }
00219
00220
00221 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00222   Method:   CServer::ObjectFirst
00223
00224   Summary:  Returns TRUE if this is the first object created.
00225
00226   Args:     void
00227
00228   Returns:  BOOL
00229               TRUE => First object created; FALSE => Object already exists.
00230 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00231 BOOL CServer::ObjectFirst(void)
00232 {
00233   BOOL bFirst = TRUE;
00234
00235   if (OwnThis())
00236   {
00237     bFirst = (NULL == m_pCOPaper);
00238
00239     UnOwnThis();
00240   }
00241
00242   return bFirst;
00243 }
00244
00245
00246 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00247   Method:   CServer::ObjectSet
00248
00249   Summary:  Tells server that the shared single object has been created.
00250
00251   Args:     void
00252
00253   Modifies: m_pCOPaper.
00254
00255   Returns:  HRESULT
00256               Standard result code. NOERROR for success.
00257 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00258 HRESULT CServer::ObjectSet(IUnknown* pCob)
00259 {
00260   HRESULT hr = NOERROR;
00261
00262   if (OwnThis())
00263   {
00264     m_pCOPaper = pCob;
00265
00266     UnOwnThis();
00267   }
00268
00269   return hr;
00270 }
00271
00272
00273 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00274   Method:   CServer::ObjectQI
00275
00276   Summary:  QueryInterface on the singleton object.
00277
00278   Args:     void
00279
00280   Returns:  HRESULT
00281               Standard result code. NOERROR for success.
00282 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00283 HRESULT CServer::ObjectQI(REFIID riid, PPVOID ppv)
00284 {
00285   HRESULT hr = E_FAIL;
00286
00287   if (OwnThis())
00288   {
00289     hr = m_pCOPaper->QueryInterface(riid, ppv);
00290
00291     UnOwnThis();
00292   }
00293
00294   return hr;
00295 }
00296
00297
00298 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00299   Method:   CServer::OpenFactories
00300
00301   Summary:  Create and register all of this server's class factories.
00302
00303   Args:     void
00304
00305   Modifies: m_pCFPaper, m_dwCFPaper.
00306
00307   Returns:  BOOL
00308               TRUE if success; FALSE if not
00309 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00310 BOOL CServer::OpenFactories(void)
00311 {
00312   BOOL bOk = FALSE;
00313   HRESULT hr;
00314
00315   // Build and register the SharePaper factory.
00316   m_pCFPaper = new CFPaper(NULL, this);
00317   if (NULL != m_pCFPaper)
00318   {
00319     // AddRef this cached pointer to the Class Factory.
00320     m_pCFPaper->AddRef();
00321
00322     // Now register this class factory with COM.
00323     hr = CoRegisterClassObject(
00324            CLSID_SharePaper,
00325            m_pCFPaper,
00326            CLSCTX_LOCAL_SERVER,
00327            REGCLS_MULTIPLEUSE,
00328            &m_dwCFPaper);
00329
00330     bOk = SUCCEEDED(hr);
00331     if (!bOk)
00332     {
00333       // If can't register factory then clean up for server exit.
00334       RELEASE_INTERFACE(m_pCFPaper);
00335     }
00336   }
00337   else
00338     bOk = FALSE;
00339
00340   if (bOk)
00341   {
00342     // Tell COM to AddRef the internal lock count for this process so
00343     // the count can later be used to prevent any object requests
00344     // during shutdown in CloseFactories.
00345     hr = CoAddRefServerProcess();
00346     bOk = SUCCEEDED(hr);
00347   }
00348
00349   return bOk;
00350 }
00351
00352
00353 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00354   Method:   CServer::CloseFactories
00355
00356   Summary:  Revoke (ie, unregister) and delete all the server's class
00357             factories.
00358
00359   Args:     void
00360
00361   Modifies: m_dwCFPaper.
00362
00363   Returns:  BOOL
00364               TRUE if success; FALSE if not
00365 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00366 BOOL CServer::CloseFactories(void)
00367 {
00368   BOOL bOk = TRUE;
00369   HRESULT hr;
00370
00371   // Tell COM to release the last lock on the server process.
00372   // This essentially prevents COM from honoring any new requests for
00373   // objects during this inevitable shutdown.
00374   CoReleaseServerProcess();
00375
00376   // Unregister the SharePaper class factory with COM.
00377   if (0 != m_dwCFPaper)
00378   {
00379     hr = CoRevokeClassObject(m_dwCFPaper);
00380     if (FAILED(hr))
00381       bOk = FALSE;
00382   }
00383
00384   // Release any and all of the Class Factory interface pointers.
00385   RELEASE_INTERFACE(m_pCFPaper);
00386
00387   return bOk;
00388 }
00389
00390 // =============================== END ======================================
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/CascadeEC/stdafx.Cpp Source File

  • Com
  • Services
  • Events
  • EventNews
  • CascadeEC

stdafx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/chainsh/chainsh.cs Source File

  • Security
  • capicom
  • c_sharp
  • chainsh

chainsh.cs

Go to the documentation of this file.
00001 //******************************************************************************
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004 // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005 // WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 1999- 2002.  Microsoft Corporation.  All rights reserved.
00008 //
00009 //******************************************************************************
00010 //
00011 // chainsh.cs
00012 //
00013 // This is a C# sample that illustrates how to use features introduced in
00014 // CAPICOM's bridging support to interop between CAPI and CAPICOM.
00015 //
00016 // Note: for simplicity, this script does not handle exceptions.
00017 //
00018 //******************************************************************************
00019
00020 using System;
00021 using CAPICOM;
00022 using System.Collections;
00023 using System.Runtime.InteropServices;
00024
00025
00026 namespace Sample
00027 {
00028   public class Win32
00029   {
00030
00031     [DllImport("crypt32.dll",CharSet=CharSet.Unicode)]
00032     public static extern uint CertOpenSystemStore(
00033       uint hProv,
00034       String szSubsystemProtocol
00035       );
00036
00037     [DllImport("crypt32.dll",CharSet=CharSet.Unicode)]
00038     public static extern uint  CertFindChainInStore(
00039       uint hCertStore,
00040       uint dwCertEncodingType,
00041       uint dwFindFlags,
00042       uint dwFindType,
00043       ref CERT_CHAIN_FIND_BY_ISSUER_PARA pvFindData,
00044       uint pPrevChainContext
00045       );
00046
00047     public struct CERT_CHAIN_FIND_BY_ISSUER_PARA
00048     {
00049       public int  cbSize;
00050       public String pszUsageIdentifier;
00051       public uint dwKeySpec;
00052       public uint dwAcquirePrivateKeyFlags;
00053       public uint cIssuer;
00054       public uint rgIssuer;
00055       public uint pfnFindCallback;
00056       public uint pvFindArg;
00057       public uint pdwIssuerChainIndex;
00058       public uint pdwIssuerElementIndex;
00059     }
00060   }
00061
00062   class Sample
00063   {
00064     [STAThread]
00065     public static void Main(string[] args)
00066     {
00067       uint pStoreContext  = 0;
00068       uint pChainContext  = 0;
00069       String [] input     = new String[2];
00070       bool done           = false;
00071
00072       displayHelp();
00073
00074       while (!done)
00075       {
00076         Console.Write(">>");
00077         input = Console.ReadLine().Split(' ');
00078
00079         //parse command line
00080         if (input[0].ToLower() == "q" || input[0].ToLower() == "quit")
00081         {
00082           done = true;
00083         }
00084         else if(input[0].ToLower() == "help" || input[0].ToLower() == "h")
00085         {
00086           displayHelp();
00087         }
00088         else if (input[0].ToLower() == "open"  || input[0].ToLower() == "o")
00089         {
00090           if (input.Length == 2)
00091           {
00092             pStoreContext = openStore(input[1]);
00093           }
00094           else
00095           {
00096             displayHelp();
00097           }
00098         }
00099         else if (input[0].ToLower() == "chains" || input[0].ToLower() == "c")
00100         {
00101           showChains(pStoreContext);
00102         }
00103         else if (input[0].ToLower() == "display"  || input[0].ToLower() == "d")
00104         {
00105           if (input.Length == 2)
00106           {
00107             pChainContext = getChainFromStore(pStoreContext, System.Convert.ToInt32(input[1]));
00108
00109             if (pChainContext == 0)
00110             {
00111               Console.WriteLine("Couldn't display chain with indexnvalid chain index.");
00112             }
00113             else
00114             {
00115               displayChain(pChainContext);
00116             }
00117           }
00118           else
00119           {
00120             displayHelp();
00121           }
00122
00123         }
00124         else if (input[0].ToLower() == "verify"  || input[0].ToLower() == "v")
00125         {
00126           if (input.Length == 2)
00127           {
00128             pChainContext = getChainFromStore(pStoreContext, System.Convert.ToInt32(input[1]));
00129
00130             if (pChainContext == 0)
00131             {
00132               Console.WriteLine("Invalid chain index.");
00133             }
00134             else
00135             {
00136               checkValidity(pChainContext);
00137             }
00138           }
00139           else
00140           {
00141             displayHelp();
00142           }
00143         }
00144       }
00145     }
00146
00147     public static uint openStore(String szStoreName)
00148     {
00149
00150       uint  pStoreContext = 0;     // system store handle
00151       ICertStore iStore;
00152       Store oStore;        // CAPICOM object
00153
00154       //verify that valid system store name was passed in
00155       if (szStoreName.ToLower() != "my" &
00156         szStoreName.ToLower() != "ca" &
00157         szStoreName.ToLower() != "root")
00158       {
00159         displayHelp();
00160         return 0;
00161       }
00162
00163       try
00164       {
00165         //open system store, use default CSP
00166         pStoreContext = Win32.CertOpenSystemStore(
00167           0,
00168           szStoreName);
00169
00170         // API bridging
00171         oStore = new StoreClass();
00172         iStore = (ICertStore)oStore;
00173         iStore.StoreHandle = (int)pStoreContext;
00174
00175         Console.WriteLine ("The store has " + oStore.Certificates.Count + " certificates");
00176
00177         return pStoreContext;
00178       }
00179       catch (Exception e)
00180       {
00181         Console.WriteLine("Error in " + e.Source + ": " + e.Message);
00182         return 0;
00183       }
00184     }
00185     public static void showChains(uint pStoreContext)
00186     {
00187       const uint X509_ASN_ENCODING            = 0x00000001;
00188       const uint PKCS_7_ASN_ENCODING            = 0x00010000;
00189       const uint CERT_CHAIN_FIND_BY_ISSUER        = 1;
00190       const uint CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG  =  0x4000;
00191
00192       uint  pChainContext = 0;
00193
00194       if (pStoreContext == 0)
00195       {
00196         Console.WriteLine("No store is currently open.");
00197         return;
00198       }
00199
00200       Win32.CERT_CHAIN_FIND_BY_ISSUER_PARA pvFindPara =
00201                 new Win32.CERT_CHAIN_FIND_BY_ISSUER_PARA();
00202
00203       //get size of CERT_CHAIN_FIND_BY_ISSUER_PARA struct
00204       pvFindPara.cbSize = Marshal.SizeOf(pvFindPara);
00205       try
00206       {
00207         //get first chain
00208         pChainContext = Win32.CertFindChainInStore(
00209           pStoreContext,
00210           X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
00211           CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG,
00212           CERT_CHAIN_FIND_BY_ISSUER,
00213           ref pvFindPara,
00214           0
00215           );
00216
00217         //get the rest
00218         while (pChainContext != 0)
00219         {
00220           displayChain(pChainContext);  // display chains
00221           pChainContext = Win32.CertFindChainInStore(
00222             pStoreContext,
00223             X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
00224             CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG,
00225             CERT_CHAIN_FIND_BY_ISSUER,
00226             ref pvFindPara,
00227             pChainContext);
00228
00229         }
00230         return;
00231       }
00232       catch (Exception e)
00233       {
00234         Console.WriteLine("Error in " + e.Source + ": " + e.Message);
00235         return;
00236       }
00237     }
00238     public static uint getChainFromStore(uint pStoreContext, int index)
00239     {
00240       const uint X509_ASN_ENCODING            = 0x00000001;
00241       const uint PKCS_7_ASN_ENCODING            = 0x00010000;
00242       const uint CERT_CHAIN_FIND_BY_ISSUER        = 1;
00243       const uint CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG  =  0x4000;
00244
00245       uint  pChainContext = 0;
00246
00247       if (pStoreContext == 0)
00248       {
00249         Console.WriteLine("No store is currently open.");
00250         return 0;
00251       }
00252
00253       Win32.CERT_CHAIN_FIND_BY_ISSUER_PARA pvFindPara =
00254         new Win32.CERT_CHAIN_FIND_BY_ISSUER_PARA();
00255
00256       //get size of CERT_CHAIN_FIND_BY_ISSUER_PARA struct
00257       pvFindPara.cbSize = Marshal.SizeOf(pvFindPara);
00258       try
00259       {
00260         //get the chain
00261         while (index > 0)
00262         {
00263           pChainContext = Win32.CertFindChainInStore(
00264             pStoreContext,
00265             X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
00266             CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG,
00267             CERT_CHAIN_FIND_BY_ISSUER,
00268             ref pvFindPara,
00269             pChainContext);
00270
00271           if (pChainContext == 0)
00272           {
00273             Console.WriteLine(" Couldn't find chain with index " + index);
00274             return 0;
00275           }
00276           index--;
00277         }
00278         return pChainContext;
00279       }
00280       catch (Exception e)
00281       {
00282         Console.WriteLine("Error in " + e.Source + ": " + e.Message);
00283         return 0;
00284       }
00285     }
00286     public static void checkValidity(uint pChainContext)
00287     {
00288       IChainContext iChain;
00289       CAPICOM.Chain oChain;
00290       int status;
00291
00292       //API bridging
00293       oChain = new ChainClass();
00294       iChain = (IChainContext)oChain;
00295       iChain.ChainContext = (int)pChainContext;
00296
00297       //get status of the entire chain
00298       status = oChain.get_Status(0);
00299
00300       if (status == 0)
00301       {
00302         Console.Write("The chain appears trustworthy.");
00303         Console.WriteLine();
00304         return;
00305       }
00306
00307       Console.WriteLine("The chain is invalid.");
00308
00309       // display specific chain status
00310       // note: for simplicity, only SOME possible status
00311       // values are presented below
00312       if ((status & Constants.CAPICOM_TRUST_IS_NOT_TIME_VALID) == Constants.CAPICOM_TRUST_IS_NOT_TIME_VALID)
00313         Console.WriteLine("Chain status: not time valid");
00314
00315       if ((status & Constants.CAPICOM_TRUST_IS_NOT_TIME_NESTED) == Constants.CAPICOM_TRUST_IS_NOT_TIME_NESTED)
00316         Console.WriteLine("Chain status: time nested.");
00317
00318       if ((status & Constants.CAPICOM_TRUST_IS_REVOKED) == Constants.CAPICOM_TRUST_IS_REVOKED)
00319         Console.WriteLine("Chain status: is revoked");
00320
00321       if ((status & Constants.CAPICOM_TRUST_IS_NOT_SIGNATURE_VALID) == Constants.CAPICOM_TRUST_IS_REVOKED)
00322         Console.WriteLine("Chain status:  invalid signature");
00323
00324       if ((status & Constants.CAPICOM_TRUST_IS_UNTRUSTED_ROOT) == Constants.CAPICOM_TRUST_IS_UNTRUSTED_ROOT)
00325           Console.WriteLine("Chain status: untrusted root");
00326
00327       if ((status & Constants.CAPICOM_TRUST_REVOCATION_STATUS_UNKNOWN) == Constants.CAPICOM_TRUST_REVOCATION_STATUS_UNKNOWN)
00328           Console.WriteLine("Chain status: revocation status unknown");
00329
00330       if ((status & Constants.CAPICOM_TRUST_INVALID_EXTENSION) == Constants.CAPICOM_TRUST_INVALID_EXTENSION)
00331           Console.WriteLine("Chain status: invalid extension");
00332
00333       if ((status & Constants.CAPICOM_TRUST_INVALID_POLICY_CONSTRAINTS) == Constants.CAPICOM_TRUST_INVALID_POLICY_CONSTRAINTS)
00334           Console.WriteLine("Chain status: invalid policy constraints");
00335
00336       if ((status & Constants.CAPICOM_TRUST_INVALID_BASIC_CONSTRAINTS) == Constants.CAPICOM_TRUST_INVALID_BASIC_CONSTRAINTS)
00337           Console.WriteLine("Chain status: invalid basic constraints");
00338
00339       if ((status & Constants.CAPICOM_TRUST_INVALID_NAME_CONSTRAINTS) == Constants.CAPICOM_TRUST_INVALID_NAME_CONSTRAINTS)
00340           Console.WriteLine("Chain status:  invalid name constraints");
00341
00342       if ((status & Constants.CAPICOM_TRUST_IS_OFFLINE_REVOCATION) == Constants.CAPICOM_TRUST_IS_OFFLINE_REVOCATION)
00343           Console.WriteLine("Chain status: offline revocation");
00344
00345       if ((status & Constants.CAPICOM_TRUST_IS_PARTIAL_CHAIN) == Constants.CAPICOM_TRUST_IS_PARTIAL_CHAIN)
00346           Console.WriteLine("Chain status: partial chain");
00347
00348       Console.WriteLine();
00349
00350     }
00351     public static void displayChain(uint pChainContext)
00352     {
00353       Certificate cert;
00354       IChainContext iChain;
00355       CAPICOM.Chain oChain;
00356
00357       IEnumerator eEnum;
00358       int i = 0;
00359
00360       //API bridging
00361       oChain = new ChainClass();
00362       iChain = (IChainContext)oChain;
00363       iChain.ChainContext = (int)pChainContext;
00364
00365       //get the number of certificates in chain
00366       eEnum = oChain.Certificates.GetEnumerator();
00367
00368       Console.WriteLine();
00369       Console.WriteLine("Chain: ");
00370
00371       //display properties of each certificate in the chain
00372       while (eEnum.MoveNext() == true)
00373       {
00374         i++;
00375         cert = (Certificate) eEnum.Current;
00376         Console.WriteLine("Certificate: " + i);
00377         Console.WriteLine("Subject: " + cert.SubjectName);
00378         Console.WriteLine("Issuer: " + cert.IssuerName);
00379         Console.WriteLine("Hash: " + cert.Thumbprint);
00380         Console.WriteLine("Valid From: " + cert.ValidFromDate);
00381         Console.WriteLine("Valid To: " + cert.ValidToDate);
00382         Console.WriteLine();
00383       }
00384     }
00385
00386     public static void displayHelp()
00387     {
00388       const int HELP_PAD = 30;
00389
00390       Console.WriteLine("Usage:");
00391       Console.WriteLine();
00392       Console.Write("[h]elp".PadRight(HELP_PAD, ' '));
00393       Console.WriteLine("This screen");
00394
00395       Console.WriteLine();
00396       Console.Write("[o]pen <store name>".PadRight(HELP_PAD, ' '));
00397       Console.WriteLine("Open 'my', 'ca', or 'root' system store");
00398
00399       Console.WriteLine();
00400       Console.Write("[c]hains".PadRight(HELP_PAD, ' '));
00401       Console.WriteLine("List all chains found in store");
00402
00403       Console.WriteLine();
00404       Console.Write("[d]isplay <idx>".PadRight(HELP_PAD, ' '));
00405       Console.WriteLine("<idx> is the number of the chain to display");
00406
00407       Console.WriteLine();
00408       Console.Write("[v]erify <idx>".PadRight(HELP_PAD, ' '));
00409       Console.WriteLine("<idx> is the number of the chain to verify");
00410
00411       Console.WriteLine();
00412       Console.Write("[q]uit".PadRight(HELP_PAD, ' '));
00413       Console.WriteLine("Exit this program.");
00414
00415       Console.WriteLine();
00416     }
00417
00418   }
00419 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CellData Member List

This is the complete list of members for CellData, including all inherited members.
flags | CellData
nchars | CellData
props | CellData
ptext | CellData
pwzText | CellData
Generated on Wed Nov 13 2024 16:56:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/CPPClient/stdafx.Cpp Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • CPPClient

stdafx.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016
00017 // stdafx.cpp : source file that includes just the standard includes
00018 //  CppClient.pch will be the pre-compiled header
00019 //  stdafx.obj will contain the pre-compiled type information
00020
00021 #include "stdafx.h"
00022
00023 // TODO: reference any additional headers you need in STDAFX.H
00024 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComObj/UtilCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ComObj

UtilCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTILCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCar COM object class.
00005
00006              UTILCAR showcases the construction of the COUtilityCar COM
00007              object class with the IUnknown, ICar, and IUtility interfaces.
00008              This is done through Containment reuse of COCar's ICar
00009              interface features.
00010
00011              This multiple interface COM Object Class is achieved via
00012              the technique of nested classes: the implementation of the
00013              ICar and IUtility interfaces are nested inside of the
00014              COUtilityCar COM object class.
00015
00016              For a comprehensive tutorial code tour of this module's
00017              contents and offerings see the tutorial COMOBJ.HTM
00018              file.  For more specific technical details on the internal
00019              workings see the comments dispersed throughout the
00020              module's source code.
00021
00022   Classes:   COUtilityCar
00023
00024   Functions: .
00025
00026   Origin:    8-21-95: atrent - Editor inheritance from SUBMAR.H.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 #if !defined(UTILCAR_H)
00044 #define UTILCAR_H
00045
00046 #ifdef __cplusplus
00047
00048 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00049   ObjectClass: COUtilityCar
00050
00051   Summary:     COM Object Class for COUtilityCar COM Objects.  COM objects of
00052                this class augment COCar COM objects (which offer ICar
00053                interface features of Shift, Clutch, Speed, and Steer) with
00054                IUtility interface features (Offroad and Winch).  This
00055                COUtilityCar COM object class is constructed by containment
00056                reuse of the COCar COM object class.  The mulitple
00057                interfaces on this COM object class are constructed via
00058                the nested interface classes technique.
00059
00060   Interfaces:  IUnknown
00061                  Standard interface providing COM object features.
00062                ICar
00063                  Basic Car operation features.
00064                IUtility
00065                  Sport-utility offroad features.
00066
00067   Aggregation: Yes, COUtilityCar COM objects are aggregatable by passing
00068                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00069 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00070 class COUtilityCar : public IUnknown
00071 {
00072   public:
00073     // Main Object Constructor & Destructor.
00074     COUtilityCar(IUnknown* pUnkOuter);
00075     ~COUtilityCar(void);
00076
00077     // A general public method for initializing this newly created
00078     // COUtilityCar object. Creates any subordinate arrays, structures,
00079     // or objects. Not exposed as a method in an interface.
00080     HRESULT Init(void);
00081
00082     // IUnknown methods. Main object, non-delegating.
00083     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00084     STDMETHODIMP_(ULONG) AddRef(void);
00085     STDMETHODIMP_(ULONG) Release(void);
00086
00087     // We get this ICar interface pointer via containment reuse of the
00088     // ICar interface in an instantiated COCar.
00089     ICar*           m_pICar;
00090
00091   private:
00092     // We show nested interface class implementations here.
00093
00094     // We implement the basic ICar interface in this COUtilityCar
00095     // COM object class.
00096     class CImpICar : public ICar
00097     {
00098       public:
00099         // Interface Implementation Constructor & Destructor.
00100         CImpICar(COUtilityCar* pBackObj, IUnknown* pUnkOuter);
00101         ~CImpICar(void);
00102
00103         // IUnknown methods.
00104         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00105         STDMETHODIMP_(ULONG) AddRef(void);
00106         STDMETHODIMP_(ULONG) Release(void);
00107
00108         // ICar methods.
00109         STDMETHODIMP Shift(short nGear);
00110         STDMETHODIMP Clutch(short nEngaged);
00111         STDMETHODIMP Speed(short nMph);
00112         STDMETHODIMP Steer(short nAngle);
00113
00114       private:
00115         // Data private to this COUtilityCar interface implementation of ICar.
00116         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00117         COUtilityCar* m_pBackObj;    // Parent Object back pointer.
00118         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00119     };
00120
00121     // We implement the IUtility interface (ofcourse) in this COUtilityCar
00122     // COM object class.  This is the interface that we are using as an
00123     // augmentation to the existing COCar COM object class.
00124     class CImpIUtility : public IUtility
00125     {
00126       public:
00127         // Interface Implementation Constructor & Destructor.
00128         CImpIUtility(COUtilityCar* pBackObj, IUnknown* pUnkOuter);
00129         ~CImpIUtility(void);
00130
00131         // IUnknown methods.
00132         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00133         STDMETHODIMP_(ULONG) AddRef(void);
00134         STDMETHODIMP_(ULONG) Release(void);
00135
00136         // IUtility methods.
00137         STDMETHODIMP Offroad(short nGear);
00138         STDMETHODIMP Winch(short nRpm);
00139
00140       private:
00141         // Data private to this interface implementation of IUtility.
00142         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00143         COUtilityCar* m_pBackObj;    // Parent Object back pointer.
00144         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00145     };
00146
00147     // Make the otherwise private and nested ICar interface implementation
00148     // a friend to COM object instantiations of this selfsame COUtilityCar
00149     // COM object class.
00150     friend CImpICar;
00151     friend CImpIUtility;
00152
00153     // Private data of COUtilityCar COM objects.
00154
00155     // Nested ICar implementation instantiation.
00156     CImpICar        m_ImpICar;
00157
00158     // Nested IUtility implementation instantiation.
00159     CImpIUtility    m_ImpIUtility;
00160
00161     // Main Object reference count.
00162     ULONG           m_cRefs;
00163
00164     // Outer unknown (aggregation & delegation).
00165     IUnknown*       m_pUnkOuter;
00166 };
00167
00168 typedef COUtilityCar* PCOUtilityCar;
00169
00170 #endif // __cplusplus
00171
00172
00173 #endif // UTILCAR_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropertyTag Member List

This is the complete list of members for CPropertyTag, including all inherited members.
_aTempBuffer | CHtmlElement | [protected]
_cPropChars | CPropertyTag | [protected]
_cPropCharsFiltered | CPropertyTag | [protected]
_eState | CPropertyTag | [protected]
_eTokType | CPropertyTag | [protected]
_htmlIFilter | CHtmlElement | [protected]
_propSpec | CPropertyTag | [protected]
_pwcPropBuf | CPropertyTag | [protected]
_scanner | CHtmlElement | [protected]
_serialStream | CHtmlElement | [protected]
_uLenPropBuf | CPropertyTag | [protected]
_ulIdContentChunk | CPropertyTag | [protected]
CHtmlElement(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CHtmlElement |
ConcatenateProperty(WCHAR *awcPropSuffix, unsigned uLen) | CPropertyTag | [protected]
CPropertyTag(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream, CFullPropSpec &propSpec, HtmlTokenType eTokType) | CPropertyTag |
GetChunk(STAT_CHUNK *pStat) | CPropertyTag | [virtual]
GetText(ULONG *pcwcOutput, WCHAR *awcBuffer) | CPropertyTag | [virtual]
GetValue(PROPVARIANT **ppPropValue) | CHtmlElement | [virtual]
InitFilterRegion(ULONG &idChunkSource, ULONG &cwcStartSource, ULONG &cwcLenSource) | CHtmlElement | [virtual]
InitStatChunk(STAT_CHUNK *pStat) | CPropertyTag | [virtual]
SkipRemainingTextAndGotoNextChunk(STAT_CHUNK *pStat) | CHtmlElement | [protected]
SwitchToNextHtmlElement(STAT_CHUNK *pStat) | CHtmlElement | [protected]
~CHtmlElement() | CHtmlElement | [inline, virtual]
~CPropertyTag() | CPropertyTag |
Generated on Wed Nov 13 2024 16:57:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCOrder/Order.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCOrder

Order.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      Order.h
00003   Summary:   Declaration of COrder class
00004   Classes:   Declared: COrder
00005   Origin:    Implementation of case study in Queued Components specification
00006 ----------------------------------------------------------------------------
00007   Copyright 1992 - 2000 Microsoft Corporation, All rights reserved.
00008
00009     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012     PARTICULAR PURPOSE
00013 ==========================================================================+*/
00014
00015 #ifndef __ORDER_H_
00016 #define __ORDER_H_
00017
00018 #include "resource.h"       // main symbols
00019
00020 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00021   ObjectClass: COrder
00022   Summary:     Writes an order into the Order Entry table.
00023          Sends order to shipping department.
00024   Interfaces:  IUnknown       Standard COM object feature interface
00025                IDispatch      Automation interface
00026              IOrder       Represents an order
00027   Aggregation: Not supported
00028 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00029
00030 class ATL_NO_VTABLE COrder :
00031   public CComObjectRootEx<CComSingleThreadModel>,
00032   public CComCoClass<COrder, &CLSID_Order>,
00033   public IDispatchImpl<IOrder, &IID_IOrder, &LIBID_QCORDERLib>
00034 {
00035 public:
00036   COrder() : m_lCustomerId(0), m_lOrderId(0)
00037   {
00038   }
00039
00040 DECLARE_REGISTRY_RESOURCEID(IDR_ORDER)
00041 DECLARE_NOT_AGGREGATABLE(COrder)
00042
00043 BEGIN_COM_MAP(COrder)
00044   COM_INTERFACE_ENTRY(IOrder)
00045   COM_INTERFACE_ENTRY(IDispatch)
00046 END_COM_MAP()
00047
00048 public: // IOrder methods
00049   STDMETHOD(Process)(long lFlags);
00050   STDMETHOD(LineItem)(long lItemId, long lQuantity);
00051   STDMETHOD(put_OrderId)(long lOrderId);
00052   STDMETHOD(put_CustomerId)(long lCustomerId);
00053
00054 private: // Member data and private helper methods
00055   long        m_lCustomerId;
00056   long        m_lOrderId;
00057   std::vector<long> m_veclItemId;
00058   std::vector<long> m_veclQuantity;
00059
00060   HRESULT WriteOrderDB();
00061   HRESULT InvokeShip(long lFlags);
00062   HRESULT InvokeShipIDispatch(IUnknown * punk, long lFlags);
00063   HRESULT InvokeShipVtable(IUnknown * punk, long lFlags);
00064 };
00065
00066 #endif //__ORDER_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCOrder/QCOrder.Idl Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCOrder

QCOrder.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      QCOrder.idl
00003   Summary:   Interfaces for Queued Components Order Entry Sample 1
00004   Classes:   Declared: Order
00005   Origin:    Implementation of case study in Queued Components specification.
00006 ----------------------------------------------------------------------------
00007   Copyright 1992 - 1998 Microsoft Corporation, All rights reserved.
00008
00009     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012     PARTICULAR PURPOSE
00013 ==========================================================================+*/
00014
00015 #include "mtxattr.h"  // For TRANSACTION_REQUIRED
00016 import "oaidl.idl";   // Automation data types
00017
00018 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00019   Interface: IOrder
00020   Summary:   Represents an order and its line items
00021   Methods:   HRESULT CustomerId - sets Customer Identifier property
00022        HRESULT OrderId - sets Order Identifier property
00023        HRESULT LineItem - adds an item to an order
00024              HRESULT ProcessOrder - Completes order
00025 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00026
00027 [
00028   helpstring("IOrder Interface"), uuid(CB34A1A1-28C2-11D2-B5B6-00C04FC340EE),
00029   object, dual, nonextensible, hidden, pointer_default(unique)
00030 ]
00031 interface IOrder : IDispatch
00032 {
00033   [id(1), propput] HRESULT CustomerId([in] long lCustomerId);
00034   [id(2), propput] HRESULT OrderId([in] long lOrderId);
00035   [id(3)] HRESULT LineItem([in] long lItemId, [in] long lQuantity);
00036   [id(4)] HRESULT Process([in] long lFlags);
00037 };
00038
00039 // Library and classes
00040
00041 [
00042   uuid(6DD1E6C2-28C1-11D2-B5B6-00C04FC340EE),
00043   version(1.0),
00044   helpstring("QCOrder 1.0 Type Library")
00045 ]
00046 library QCORDERLib
00047 {
00048   importlib("stdole2.tlb");
00049
00050 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00051   ObjectClass: Order
00052   Summary:     Order Entry - accept an order and its line items
00053   Interfaces:  IUnknown     Standard COM object interface
00054                IOrder     The order being entered
00055   Aggregation: Not supported
00056 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00057
00058   [
00059     helpstring("Order Class"), uuid(CB34A1A2-28C2-11D2-B5B6-00C04FC340EE),
00060     TRANSACTION_REQUIRED
00061   ]
00062   coclass Order { [default] interface IOrder; };
00063
00064 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CNetInterfaceData Member List

This is the complete list of members for CNetInterfaceData, including all inherited members.
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItem(IWCContextMenuCallback *piCallbackIn, UINT nMenuItem, UINT nMenuItemDesc, UINT nBaseID, ULONG uFlags) | CObjData | [protected, virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CNetInterfaceData | [virtual]
AddContextMenuItems(IWCContextMenuCallback *piCallbackIn) | CNetInterfaceData | [virtual]
CObjData(void) | CObjData | [inline]
CObjData(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
Cot(void) | CObjData | [inline]
GetHNetInterface(void) | CNetInterfaceData | [inline]
GetHNetInterface(void) | CNetInterfaceData | [inline]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetPropertySheetPages(CRuntimeClass ***ppaPropSheetsOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
GetWizardPages(CRuntimeClass ***ppaWizardPagesOut) | CObjData | [inline, virtual]
HrInitialize(IUnknown *piDataIn) | CNetInterfaceData | [protected, virtual]
HrInitialize(IUnknown *piDataIn) | CNetInterfaceData | [protected, virtual]
InvokeCommand(ULONG nCommandIDIn) | CNetInterfaceData | [virtual]
InvokeCommand(ULONG nCommandIDIn) | CNetInterfaceData | [virtual]
m_cot | CObjData | [protected]
m_hNetInterface | CNetInterfaceData | [private]
m_rgprtcPSPages | CObjData | [protected]
m_rgprtcWizPages | CObjData | [protected]
m_strName | CObjData | [protected]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
S_HrCreateObject(IUnknown *piDataIn, CObjData **ppodOut) | CObjData | [static]
StrName(void) | CObjData | [inline, virtual]
StrName(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
~CObjData(void) | CObjData | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/addfolderdlg.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

addfolderdlg.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  AddDeviceDlg.h:  Header for the CAddDeviceDlg class.  This is a
00014 //                   modeless dialog class used to add device nodes.
00015 //
00016
00017
00018 #ifndef _CLASS_ADDFOLDERDLG_
00019 #define _CLASS_ADDFOLDERDLG_
00020
00021
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025
00026
00027 #include "BaseDialog.h"
00028
00029
00030 //---------------------------------------------------------------------------
00031 class CAddFolderDlg : public CBaseDialog
00032 {
00033   public:
00034     CAddFolderDlg( ULONG nTemplate, HWND hParentWnd );
00035     ~CAddFolderDlg();
00036
00037
00038   public:
00039     BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
00040
00041
00042   // Messages we will be handling
00043   private:
00044     LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00045     LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00046
00047   private:
00048     HWND    m_hParentWnd;
00049
00050
00051 };
00052
00053 #endif //_CLASS_ADDFOLDERDLG_
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/plugxprt.cpp Source File

  • Web
  • NetMeeting
  • PlugTransport

plugxprt.cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     PLUGTRANSPORT.EXE
00003 //  File:       PLUGXPRT.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018
00019 //**********************
00020 //FUNCTION DECLARATIONS
00021 //**********************
00022
00023 BSTR LPSTR2BSTR(LPSTR pszString);
00024 BOOL BSTR2LPSTR(BSTR bstrConnID, LPSTR pszConnID);
00025
00026
00027 //**********************************
00028 //
00029 // CLASS CPluggableTransport
00030 //
00031 //**********************************
00032
00033 //****************************************************************************
00034 //
00035 //    FUNCTION:   CPluggableTransport::CPluggableTransport()
00036 //
00037 //    PURPOSE:    Construction
00038
00039 //    COMMENTS:
00040 //
00041 //
00042 //****************************************************************************
00043
00044 CPluggableTransport::CPluggableTransport()
00045 {
00046     m_pIPlugTrans   = NULL;
00047     m_bInConnection = false;
00048     m_pX224         = NULL;
00049     m_pPSTN         = NULL;
00050     m_hEvtRead      = NULL;
00051     m_hEvtWrite     = NULL;
00052     m_hEvtClose     = NULL;
00053     m_szConnID[0]   = '\0';
00054 }
00055
00056
00057 //****************************************************************************
00058 //
00059 //    FUNCTION:   CPluggableTransport::~CPluggableTransport()
00060 //
00061 //    PURPOSE:    Destruction
00062
00063 //    COMMENTS:
00064 //
00065 //
00066 //****************************************************************************
00067
00068 CPluggableTransport::~CPluggableTransport()
00069 {}
00070
00071
00072 //****************************************************************************
00073 //
00074 //    FUNCTION:   HRESULT CPluggableTransport::Initialize(INmManager *pINmManager)
00075 //
00076 //    PURPOSE:    Initializes PluggableTransport and all member variables
00077
00078 //    COMMENTS:
00079 //
00080 //
00081 //****************************************************************************
00082
00083 HRESULT CPluggableTransport::Initialize(INmManager *pINmManager)
00084 {
00085     if (pINmManager)
00086         if (FAILED(pINmManager->QueryInterface(IID_IPluggableTransport, (PVOID *) &m_pIPlugTrans)))
00087             return E_FAIL;
00088
00089
00090     m_pX224 = new CX224();
00091     if (m_pX224 == NULL)
00092     {
00093         return E_OUTOFMEMORY;
00094     }
00095
00096     m_pPSTN = new CPSTN();
00097     if (m_pPSTN == NULL)
00098     {
00099         return E_OUTOFMEMORY;
00100     }
00101
00102     m_hEvtRead = ::CreateEvent(NULL, FALSE, FALSE, NULL);
00103     if (m_hEvtRead == NULL)
00104     {
00105         return HRESULT_FROM_WIN32(GetLastError());
00106     }
00107
00108     m_hEvtWrite = ::CreateEvent(NULL, FALSE, FALSE, NULL);
00109     if (m_hEvtWrite == NULL)
00110     {
00111         return HRESULT_FROM_WIN32(GetLastError());
00112     }
00113
00114     m_hEvtClose = ::CreateEvent(NULL, FALSE, FALSE, NULL);
00115     if (m_hEvtClose == NULL)
00116     {
00117         return HRESULT_FROM_WIN32(GetLastError());
00118     }
00119
00120     return S_OK;
00121 }
00122
00123
00124 //****************************************************************************
00125 //
00126 //    FUNCTION:   HRESULT CPluggableTransport::Uninitialize()
00127 //
00128 //    PURPOSE:    Clean up
00129
00130 //    COMMENTS:
00131 //
00132 //
00133 //****************************************************************************
00134
00135 HRESULT CPluggableTransport::Uninitialize()
00136 {
00137
00138     if (m_pX224)
00139     {
00140         m_pX224->CloseSocket();
00141         m_pX224->CloseListenSocket();
00142         delete m_pX224;
00143     }
00144
00145     if (m_pPSTN)
00146     {
00147         m_pPSTN->CloseComPort();
00148         delete m_pPSTN;
00149     }
00150
00151     if (m_pIPlugTrans)
00152     {
00153         m_pIPlugTrans->Release();
00154     }
00155
00156     if (NULL != m_hEvtRead)
00157     {
00158         ::CloseHandle(m_hEvtRead);
00159     }
00160
00161     if (NULL != m_hEvtWrite)
00162     {
00163         ::CloseHandle(m_hEvtWrite);
00164     }
00165
00166     if (NULL != m_hEvtClose)
00167     {
00168         ::CloseHandle(m_hEvtClose);
00169     }
00170
00171     return S_OK;
00172 }
00173
00174
00175 //****************************************************************************
00176 //
00177 //    FUNCTION:   BOOL CPluggableTransport::InConnection()
00178 //
00179 //    PURPOSE:
00180
00181 //    COMMENTS:
00182 //
00183 //
00184 //****************************************************************************
00185
00186 BOOL CPluggableTransport::InConnection()
00187 {
00188     return m_bInConnection;
00189 }
00190
00191
00192 //****************************************************************************
00193 //
00194 //    FUNCTION:   HRESULT CPluggableTransport::CreateConnection()
00195 //
00196 //    PURPOSE:    Connect the X224 pluggable transport with the T120 (as a caller)
00197
00198 //    COMMENTS:
00199 //
00200 //
00201 //****************************************************************************
00202
00203 HRESULT CPluggableTransport::CreateConnection()
00204 {
00205     HANDLE hCommLink = NULL;
00206     HRESULT hr = S_OK;
00207
00208     if (!m_pX224)
00209         return E_FAIL;
00210
00211     if (m_pX224->GetSocket() == INVALID_SOCKET)
00212         return E_FAIL;
00213
00214     BOOL fRet = DuplicateHandle(GetCurrentProcess(), (HANDLE) m_pX224->GetSocket(),
00215                           GetCurrentProcess(), &hCommLink,
00216                           0, FALSE, DUPLICATE_SAME_ACCESS);
00217
00218     BSTR bstrConnID = NULL;
00219     PLUGXPRT_PARAMETERS Params;
00220
00221     ::ZeroMemory(&Params, sizeof(Params));
00222     Params.cbStructSize = sizeof(Params);
00223
00224     hr = m_pIPlugTrans->CreateConnection(
00225                 &bstrConnID,
00226                 PLUGXPRT_CALLER, // caller
00227                 GetCurrentProcessId(),
00228                 (HCOMMDEV) hCommLink,
00229                 (HEVENT) m_hEvtRead,
00230                 (HEVENT) m_hEvtWrite,
00231                 (HEVENT) m_hEvtClose,
00232                 FRAMING_X224,
00233                 &Params);
00234
00235     if (SUCCEEDED(hr))
00236     {
00237         BSTR2LPSTR(bstrConnID, m_szConnID);
00238         m_bInConnection = true;
00239     }
00240
00241     return hr;
00242 }
00243
00244
00245 //****************************************************************************
00246 //
00247 //    FUNCTION:   HRESULT CPluggableTransport::CreateConnection(LPSTR pszComPort)
00248 //
00249 //    PURPOSE:    Connect the PSTN pluggable transport with the T120 (as a caller)
00250
00251 //    COMMENTS:
00252 //
00253 //
00254 //****************************************************************************
00255
00256 HRESULT CPluggableTransport::CreateConnection(LPTSTR pszComPort)
00257 {
00258     HANDLE hCommLink = NULL;
00259     HRESULT hr = S_OK;
00260     PLUGXPRT_PARAMETERS PluggableParams;
00261     BSTR bstrConnID = NULL;
00262     BOOL fRet = FALSE;
00263
00264     if (NULL == m_pPSTN)
00265         return E_FAIL;
00266
00267     if (NULL == m_pIPlugTrans)
00268         return E_FAIL;
00269
00270     ZeroMemory(&PluggableParams, sizeof(PluggableParams));
00271     PluggableParams.cbStructSize = sizeof(PluggableParams);
00272     PluggableParams.dwFlags = PSTN_PARAM__CALL_CONTROL |
00273                                 PSTN_PARAM__READ_FILE_BUFFER_SIZE |
00274                                 PSTN_PARAM__PHYSICAL_LAYER_SEND_BUFFER_SIZE |
00275                                 PSTN_PARAM__PHSYICAL_LAYER_RECV_BUFFER_SIZE |
00276                                 PSTN_PARAM__MAX_T200_TIMEOUT_COUNT_IN_Q922 |
00277                                 PSTN_PARAM__T203_TIMEOUT_IN_Q922;
00278     PluggableParams.eCallControl = PLUGXPRT_PSTN_CALL_CONTROL_MANUAL;
00279     PluggableParams.cbReadFileBufferSize = 10240; // 10K
00280     PluggableParams.cbPhysicalLayerSendBufferSize = 1024; // 1K
00281     PluggableParams.cbPhysicalLayerReceiveBufferSize = 10240; // 10K
00282     PluggableParams.cMaximumT200TimeoutsInQ922 = 200;
00283     PluggableParams.nT203TimeoutInQ922 = 6000;
00284
00285     // open the com port and get a handle to it
00286     if (FAILED(m_pPSTN->CreateComPort(1, pszComPort)))
00287         return E_FAIL;
00288
00289     if (!m_pPSTN->GetCommLink())
00290         return E_FAIL;
00291
00292     fRet = DuplicateHandle(GetCurrentProcess(), m_pPSTN->GetCommLink(),
00293                           GetCurrentProcess(), &hCommLink,
00294                           0, FALSE, DUPLICATE_SAME_ACCESS);
00295     if (!fRet)
00296         return E_FAIL;
00297
00298     hr = m_pIPlugTrans->CreateConnection(
00299                 &bstrConnID,
00300                 PLUGXPRT_CALLER, // caller
00301                 GetCurrentProcessId(),
00302                 (HCOMMDEV) hCommLink,
00303                 (HEVENT) m_hEvtRead,
00304                 (HEVENT) m_hEvtWrite,
00305                 (HEVENT) m_hEvtClose,
00306                 FRAMING_LEGACY_PSTN,
00307                 &PluggableParams);
00308     if (SUCCEEDED(hr))
00309     {
00310         BSTR2LPSTR(bstrConnID, m_szConnID);
00311         m_bInConnection = true;
00312     }
00313
00314     ::SysFreeString(bstrConnID);
00315     bstrConnID = NULL;
00316
00317     return hr;
00318 }
00319
00320
00321 //****************************************************************************
00322 //
00323 //    FUNCTION:   HRESULT CPluggableTransport::AcceptConnection(HWND hWnd)
00324 //
00325 //    PURPOSE:    Connects the X224 pluggable transport with the T120 (as a callee)
00326
00327 //    COMMENTS:
00328 //
00329 //
00330 //****************************************************************************
00331
00332 HRESULT CPluggableTransport::AcceptConnection(HWND hWnd)
00333 {
00334     PLUGXPRT_PARAMETERS Params;
00335     HRESULT             hr          = S_OK;
00336     HANDLE              hCommLink   = NULL;
00337     BSTR                bstrConnID  = NULL;
00338     BOOL                fRet        = FALSE;
00339
00340     if (NULL == m_pX224)
00341         return E_FAIL;
00342
00343     if (NULL == m_pIPlugTrans)
00344         return E_FAIL;
00345
00346     if (FAILED(m_pX224->CreateAcceptSocket(hWnd)))
00347         return E_FAIL;
00348
00349     if (m_pX224->GetSocket() == INVALID_SOCKET)
00350         return E_FAIL;
00351
00352     fRet = ::DuplicateHandle(::GetCurrentProcess(), (HANDLE) m_pX224->GetSocket(),
00353                      ::GetCurrentProcess(), &hCommLink,
00354                      0, FALSE, DUPLICATE_SAME_ACCESS);
00355     if (!fRet)
00356         return E_FAIL;
00357
00358     ::ZeroMemory(&Params, sizeof(Params));
00359     Params.cbStructSize = sizeof(Params);
00360
00361     hr = m_pIPlugTrans->CreateConnection(
00362             &bstrConnID,
00363             PLUGXPRT_CALLEE, // callee
00364             GetCurrentProcessId(),
00365             (HCOMMDEV) hCommLink,
00366             (HEVENT) m_hEvtRead,
00367             (HEVENT) m_hEvtWrite,
00368             (HEVENT) m_hEvtClose,
00369             FRAMING_X224,
00370             &Params);
00371
00372     if (SUCCEEDED(hr))
00373     {
00374         BSTR2LPSTR(bstrConnID, m_szConnID);
00375         m_bInConnection = true;
00376     }
00377
00378     ::SysFreeString(bstrConnID);
00379     bstrConnID = NULL;
00380
00381     return hr;
00382 }
00383
00384
00385 //****************************************************************************
00386 //
00387 //    FUNCTION:   HRESULT CPluggableTransport::AcceptConnection(LPSTR pszComPort)
00388 //
00389 //    PURPOSE:    Connects the PSTN pluggable transport with the T120 (as a callee)
00390
00391 //    COMMENTS:
00392 //
00393 //
00394 //****************************************************************************
00395
00396 HRESULT CPluggableTransport::AcceptConnection(LPTSTR pszComPort)
00397 {
00398     HANDLE hCommLink = NULL;
00399     HRESULT hr = S_OK;
00400     PLUGXPRT_PARAMETERS PluggableParams;
00401     BSTR bstrConnID = NULL;
00402     BOOL fRet = FALSE;
00403
00404     if (NULL == m_pPSTN)
00405         return E_FAIL;
00406
00407     if (NULL == m_pIPlugTrans)
00408         return E_FAIL;
00409
00410     ZeroMemory(&PluggableParams, sizeof(PluggableParams));
00411     PluggableParams.cbStructSize = sizeof(PluggableParams);
00412     PluggableParams.dwFlags = PSTN_PARAM__CALL_CONTROL |
00413                                 PSTN_PARAM__READ_FILE_BUFFER_SIZE |
00414                                 PSTN_PARAM__PHYSICAL_LAYER_SEND_BUFFER_SIZE |
00415                                 PSTN_PARAM__PHSYICAL_LAYER_RECV_BUFFER_SIZE |
00416                                 PSTN_PARAM__MAX_T200_TIMEOUT_COUNT_IN_Q922 |
00417                                 PSTN_PARAM__T203_TIMEOUT_IN_Q922;
00418     PluggableParams.eCallControl = PLUGXPRT_PSTN_CALL_CONTROL_MANUAL;
00419     PluggableParams.cbReadFileBufferSize = 10240; // 10K
00420     PluggableParams.cbPhysicalLayerSendBufferSize = 1024; // 1K
00421     PluggableParams.cbPhysicalLayerReceiveBufferSize = 10240; // 10K
00422     PluggableParams.cMaximumT200TimeoutsInQ922 = 200;
00423     PluggableParams.nT203TimeoutInQ922 = 6000;
00424
00425     // open the com port and get a handle to it
00426     hr = m_pPSTN->CreateComPort(1, pszComPort);
00427     if (FAILED(hr))
00428         return E_FAIL;
00429
00430     if (!m_pPSTN->GetCommLink())
00431         return E_FAIL;
00432
00433     fRet = DuplicateHandle(GetCurrentProcess(), m_pPSTN->GetCommLink(),
00434                           GetCurrentProcess(), &hCommLink,
00435                           0, FALSE, DUPLICATE_SAME_ACCESS);
00436     if (!fRet)
00437         return E_FAIL;
00438
00439     hr = m_pIPlugTrans->CreateConnection(
00440                 &bstrConnID,
00441                 PLUGXPRT_CALLEE, // caller
00442                 GetCurrentProcessId(),
00443                 (HCOMMDEV) hCommLink,
00444                 (HEVENT) m_hEvtRead,
00445                 (HEVENT) m_hEvtWrite,
00446                 (HEVENT) m_hEvtClose,
00447                 FRAMING_LEGACY_PSTN,
00448                 &PluggableParams);
00449
00450     if (SUCCEEDED(hr))
00451     {
00452         BSTR2LPSTR(bstrConnID, m_szConnID);
00453         m_bInConnection = true;
00454     }
00455
00456     ::SysFreeString(bstrConnID);
00457     bstrConnID = NULL;
00458
00459     return hr;
00460 }
00461
00462
00463 //****************************************************************************
00464 //
00465 //    FUNCTION:   HRESULT CPluggableTransport::CloseConnection(PLUGXPRT_FRAMING eFraming)
00466 //
00467 //    PURPOSE:    Disconnects the pluggable transport from T120
00468
00469 //    COMMENTS:
00470 //
00471 //
00472 //****************************************************************************
00473
00474 HRESULT CPluggableTransport::CloseConnection(PLUGXPRT_FRAMING eFraming)
00475 {
00476     HRESULT hr = S_OK;
00477     BSTR bstrConnID = NULL;
00478
00479     bstrConnID = LPSTR2BSTR(m_szConnID);
00480
00481     if (NULL == m_pIPlugTrans)
00482         return E_FAIL;
00483
00484     if (m_szConnID[0] != '\0')
00485     {
00486         hr = m_pIPlugTrans->CloseConnection(bstrConnID);
00487         m_szConnID[0] = '\0';
00488     }
00489
00490     if ((eFraming == FRAMING_X224) && (NULL != m_pX224))
00491     {
00492         m_pX224->CloseSocket();
00493     }
00494
00495     if ((eFraming == FRAMING_LEGACY_PSTN) && (NULL != m_pPSTN))
00496     {
00497         m_pPSTN->CloseComPort();
00498     }
00499
00500     if (SUCCEEDED(hr))
00501         m_bInConnection = false;
00502
00503     ::SysFreeString(bstrConnID);
00504     bstrConnID = NULL;
00505
00506     return hr;
00507 }
00508
00509
00510 //****************************************************************************
00511 //
00512 //    FUNCTION:   HRESULT CPluggabletransport::EnableWinsock()
00513 //
00514 //    PURPOSE:
00515
00516 //    COMMENTS:
00517 //
00518 //
00519 //****************************************************************************
00520
00521 HRESULT CPluggableTransport::EnableWinsock()
00522 {
00523     HRESULT hr = E_FAIL;
00524
00525     if (m_pIPlugTrans)
00526         hr = m_pIPlugTrans->EnableWinsock();
00527
00528     return hr;
00529 }
00530
00531
00532 //****************************************************************************
00533 //
00534 //    FUNCTION:   HRESULT CPluggabletransport::DisableWinsock()
00535 //
00536 //    PURPOSE:
00537
00538 //    COMMENTS:
00539 //
00540 //
00541 //****************************************************************************
00542
00543 HRESULT CPluggableTransport::DisableWinsock()
00544 {
00545     HRESULT hr = E_FAIL;
00546
00547     if (m_pIPlugTrans)
00548         hr = m_pIPlugTrans->DisableWinsock();
00549
00550     return hr;
00551 }
00552
00553
00554 //****************************************************************************
00555 //
00556 //    FUNCTION:   LPSTR CPluggableTransport::GetConnectionID()
00557 //
00558 //    PURPOSE:
00559
00560 //    COMMENTS:
00561 //
00562 //
00563 //****************************************************************************
00564
00565 LPSTR CPluggableTransport::GetConnectionID()
00566 {
00567     return m_szConnID;
00568 }
00569
00570
00571 //****************************************************************************
00572 //
00573 //    FUNCTION:   HANDLE CPluggableTransport::GetReadEventHandle()
00574 //
00575 //    PURPOSE:
00576
00577 //    COMMENTS:
00578 //
00579 //
00580 //****************************************************************************
00581
00582 HANDLE CPluggableTransport::GetReadEventHandle()
00583 {
00584     return m_hEvtRead;
00585 }
00586
00587
00588 //****************************************************************************
00589 //
00590 //    FUNCTION:   HANDLE CPluggableTransport::GetWriteEventHandle()
00591 //
00592 //    PURPOSE:
00593
00594 //    COMMENTS:
00595 //
00596 //
00597 //****************************************************************************
00598
00599 HANDLE CPluggableTransport::GetWriteEventHandle()
00600 {
00601     return m_hEvtWrite;
00602 }
00603
00604
00605 //****************************************************************************
00606 //
00607 //    FUNCTION:   HANDLE CPluggableTransport::GetCloseEventHandle()
00608 //
00609 //    PURPOSE:
00610
00611 //    COMMENTS:
00612 //
00613 //
00614 //****************************************************************************
00615
00616 HANDLE CPluggableTransport::GetCloseEventHandle()
00617 {
00618     return m_hEvtClose;
00619 }
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Provider/PreComp.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Provider

PreComp.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   Precomp.h
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #define _WIN32_WINNT 0x0400
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include <string.h>
00022 #include <tchar.h>
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CGenerateRC Member List

This is the complete list of members for CGenerateRC, including all inherited members.
CGenerateRC(const TCHAR *szDatabase, const TCHAR *szSavedDatabase) | CGenerateRC | [inline]
CreateResourceFile() | CGenerateRC | [private]
EscapeSlashAndQuoteForRC(TCHAR *szStr) | CGenerateRC | [private]
Initialize() | CGenerateRC | [private]
IsInErrorState() | CGenerateRC | [inline]
m_cWriteFileErr | CGenerateRC | [private]
m_fError | CGenerateRC | [private]
m_fWroteBinary | CGenerateRC | [private]
m_hDatabase | CGenerateRC | [private]
m_hFile | CGenerateRC | [private]
m_iCtrlResID | CGenerateRC | [private]
m_iStrResID | CGenerateRC | [private]
m_szDatabase | CGenerateRC | [private]
m_szOrigDb | CGenerateRC | [private]
OutputControls(TCHAR *szDialog) | CGenerateRC | [private]
OutputDialog(TCHAR *szDialog, BOOL fBinary) | CGenerateRC |
OutputDialogFinalize() | CGenerateRC | [private]
OutputDialogInit(BOOL fBinary) | CGenerateRC | [private]
OutputDialogs(BOOL fBinary) | CGenerateRC |
OutputString(TCHAR *szTable, TCHAR *szColumn) | CGenerateRC |
OutputStringInit() | CGenerateRC | [private]
PrintDimensions(int x, int y, int wd, int ht) | CGenerateRC | [private]
VerifyDatabaseCodepage() | CGenerateRC | [private]
WriteBinaries() | CGenerateRC | [private]
WriteControlToRC(TCHAR *szDialog, TCHAR *szCtrlName, TCHAR *szCtrlType, TCHAR *szCtrlText, TCHAR *szCtrlProperty, int x, int y, int wd, int ht, int attrib) | CGenerateRC | [private]
WriteDialogToRC(TCHAR *szDialog, TCHAR *szTitle, int x, int y, int wd, int ht, int attrib) | CGenerateRC | [private]
WriteRadioButtons(TCHAR *szDialog, TCHAR *szRBGroup, TCHAR *szProperty, int x, int y, int attrib) | CGenerateRC | [private]
WriteStdWinCtrl(int iResId, const TCHAR *resType, TCHAR *szCtrlText, int x, int y, int wd, int ht, int attrib) | CGenerateRC | [private]
WriteWin32Ctrl(int iResId, const TCHAR *szClass, TCHAR *szCtrlText, TCHAR *szAttrib, int x, int y, int wd, int ht, int attrib) | CGenerateRC | [private]
~CGenerateRC() | CGenerateRC |
Generated on Wed Nov 13 2024 16:56:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMSOmniProvSessionTRSchemaRowset Member List

This is the complete list of members for CMSOmniProvSessionTRSchemaRowset, including all inherited members.
Execute(LONG *pcRowsAffected, ULONG, const VARIANT *) | CMSOmniProvSessionTRSchemaRowset | [inline]
GetDBStatus(CSimpleRow *, ATLCOLUMNINFO *pInfo) | CMSOmniProvSessionTRSchemaRowset | [inline]
Generated on Wed Nov 13 2024 16:56:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Command15 Member List

This is the complete list of members for msado15::Command15, including all inherited members.
CreateParameter(String Name, int Type, int Direction, int Size, Variant Value) | msado15::Command15 |
Execute(Variant RecordsAffected, Variant Parameters, int Options) | msado15::Command15 |
getActiveConnection() | msado15::Command15 |
getCommandText() | msado15::Command15 |
getCommandTimeout() | msado15::Command15 |
getCommandType() | msado15::Command15 |
getName() | msado15::Command15 |
getParameters() | msado15::Command15 |
getPrepared() | msado15::Command15 |
getProperties() | msado15::Command15 |
iid | msado15::Command15 | [static]
setActiveConnection(msado15._Connection ppvObject) | msado15::Command15 |
setActiveConnection(Variant ppvObject) | msado15::Command15 |
setCommandText(String pbstr) | msado15::Command15 |
setCommandTimeout(int pl) | msado15::Command15 |
setCommandType(int plCmdType) | msado15::Command15 |
setName(String pbstrName) | msado15::Command15 |
setPrepared(boolean pfPrepared) | msado15::Command15 |
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Dynept/Dyneptp.c Source File

  • NetDS
  • RPC
  • Dynept

Dyneptp.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                           DynEpt Example
00005
00006     FILE:       dyneptp.c
00007
00008     PURPOSE:    Remote procedures that are linked with the server
00009                 side of RPC distributed application
00010
00011     FUNCTIONS:  HelloProc() - prints "What a dynamic world" or other string
00012                 sent by client to server
00013
00014     COMMENTS:   This version of the distributed application that prints
00015                 "What a dynamic world world" (or other string) on the
00016                 server features a client that manages its connection to
00017                 the server.  It uses the binding handle dynept_IfHandle,
00018                 defined in the file dynept.h.
00019
00020 ****************************************************************************/
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include "dynept.h"    // header file generated by MIDL compiler
00025
00026 void HelloProc(unsigned char * pszString)
00027 {
00028     printf("%s\n", pszString);
00029 }
00030
00031 void Shutdown(void)
00032 {
00033     RPC_STATUS status;
00034
00035     printf("Calling RpcMgmtStopServerListening\n");
00036     status = RpcMgmtStopServerListening(NULL);
00037     printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
00038     if (status) {
00039        exit(status);
00040     }
00041 }
00042
00043 /* end file dyneptp.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Custom/SpinCube/SpinTest.c Source File

  • WinUI
  • Controls
  • Custom
  • SpinCube

SpinTest.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *
00003 *  PROGRAM:     SPINTEST.C
00004 *
00005 *  PURPOSE:     Demonstrates the use of the SPINCUBE custom control.
00006 *
00007 *  FUNCTIONS:   WinMain        - standard stuff; also loads the
00008 *                                  SPINCUBE.DLL and creates a couple
00009 *                                  of spincube controls.
00010 *               MainWndProc    - generic window procedure.
00011 *               SpintestDlgProc- generic dialog procedure.
00012 *               AboutDlgProc   - processes about dialog messages
00013 *
00014 *                           Microsoft Developer Support
00015 *                  Copyright 1992 - 2000 Microsoft Corporation
00016 *
00017 \******************************************************************************/
00018
00019 #include <windows.h>
00020 #include <stdio.h>
00021 #include "spintest.h"
00022
00023 //
00024 // The exported variables from SPINCUBE.C.
00025 //
00026 //   Although pointers to these vars are actually exported,
00027 //    the compiler will take care of that for us.
00028 //
00029
00030 extern int __declspec(dllimport) giNumSpincubesThisProcess;
00031 extern int __declspec(dllimport) giNumSpincubesAllProcesses;
00032
00033
00034 //
00035 // function prototype for looking up string resources
00036 //
00037
00038 LPTSTR GetStringRes (int);
00039
00040
00041 /******************************************************************************\
00042 *
00043 *  FUNCTION:    WinMain (standard WinMain INPUTS/RETURNS)
00044 *
00045 \******************************************************************************/
00046
00047 int WINAPI WinMain (HINSTANCE hInstance,HINSTANCE hPrevInstance, LPSTR lpCmdLine,
00048                    int     nCmdShow)
00049 {
00050   WNDCLASS wc;
00051   HWND   hwnd;
00052   MSG    msg;
00053   RECT   rect;
00054   WORD   i;
00055
00056   wc.style         = 0;
00057   wc.lpfnWndProc   = (WNDPROC) MainWndProc;
00058   wc.cbClsExtra    = 0;
00059   wc.cbWndExtra    = 0;
00060   wc.hInstance     = hInstance;
00061   wc.hIcon         = LoadIcon (hInstance, TEXT("spintesticon"));
00062   wc.hCursor       = LoadCursor (NULL, IDC_ARROW);
00063   wc.hbrBackground = GetStockObject (WHITE_BRUSH);
00064   wc.lpszMenuName  = (LPTSTR) TEXT("Menu");
00065   wc.lpszClassName = (LPTSTR) TEXT("Main");
00066
00067   if (!RegisterClass (&wc))
00068   {
00069     MessageBox (NULL,
00070                 GetStringRes (IDS_REGCLASSFAIL),
00071                 TEXT("SPINTEST"), MB_OK | MB_ICONEXCLAMATION);
00072     return(FALSE);
00073   }
00074
00075   ghInst = hInstance;
00076   if (!(hwnd = CreateWindow (TEXT("Main"),
00077                              GetStringRes (IDS_WINDOWTITLE),
00078                              WS_OVERLAPPEDWINDOW,
00079                              CW_USEDEFAULT, CW_USEDEFAULT,
00080                              CW_USEDEFAULT, CW_USEDEFAULT,
00081                              NULL, NULL, ghInst, NULL)))
00082     return 0;
00083
00084
00085   //
00086   // Create a couple of SpinCube custom controls, we'll size them later in
00087   //   the WM_SIZE message handler
00088   //
00089
00090   for (i = 0; i < 4; i++)
00091
00092     gahwndSpin[i] = CreateWindow (TEXT("Spincube"), TEXT(""),
00093                                   WS_VISIBLE | WS_CHILD |
00094                                   SS_INMOTION | SS_ERASE,
00095                                   0, 0, 0, 0, hwnd, NULL, NULL, NULL);
00096
00097
00098   //
00099   // Delete the SS_ERASE to the 1st & 4th controls so we get the
00100   //   trailing cubes effect.
00101   //
00102
00103   SetWindowLongPtr (gahwndSpin[0], GWL_STYLE,
00104                  GetWindowLongPtr (gahwndSpin[0], GWL_STYLE) & ~ SS_ERASE);
00105   SetWindowLongPtr (gahwndSpin[3], GWL_STYLE,
00106                  GetWindowLongPtr (gahwndSpin[3], GWL_STYLE) & ~ SS_ERASE);
00107
00108
00109   //
00110   // Send ourself a WM_SIZE so the controls will get sized appropriately
00111   //
00112
00113   GetClientRect (hwnd, &rect);
00114   SendMessage (hwnd, WM_SIZE, 0,
00115                MAKELONG((WORD)rect.right,(WORD)rect.bottom));
00116
00117   ShowWindow (hwnd, nCmdShow);
00118
00119   while (GetMessage (&msg, NULL, 0, 0))
00120   {
00121     TranslateMessage (&msg);
00122     DispatchMessage  (&msg);
00123   }
00124
00125   return (int)(msg.wParam);
00126 }
00127
00128
00129
00130 /******************************************************************************\
00131 *
00132 *  FUNCTION:    MainWndProc (standard window procedure INPUTS/RETURNS)
00133 *
00134 \******************************************************************************/
00135
00136 LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00137 {
00138   switch (msg)
00139   {
00140     case WM_COMMAND:
00141
00142       switch (LOWORD(wParam))
00143       {
00144         case IDM_DLGEDITDIALOG:
00145
00146           DialogBox (ghInst, (LPCTSTR) TEXT("SpintestDlg"), hwnd, (DLGPROC) DlgProc);
00147           break;
00148
00149         case IDM_SPINTESTSTATS:
00150
00151           DialogBox (ghInst, (LPCTSTR) TEXT("Stats"), hwnd, (DLGPROC) DlgProc);
00152           break;
00153
00154         case IDM_ABOUT:
00155
00156           DialogBox (ghInst, (LPCTSTR) TEXT("About"), hwnd, (DLGPROC) DlgProc);
00157           break;
00158
00159       }
00160       break;
00161
00162     case WM_SIZE:
00163     {
00164       //
00165       // Resize the controls such that each cover half the client area
00166       //   (plus a little border).
00167       //
00168
00169       int width  = (int) LOWORD(lParam);
00170       int height = (int) HIWORD(lParam);
00171
00172       SetWindowPos (gahwndSpin[0], NULL,
00173                     BORDER, BORDER,
00174                     width/2 - BORDER, height/2 - BORDER,
00175                     SWP_SHOWWINDOW);
00176       SetWindowPos (gahwndSpin[1], NULL,
00177                     width/2 + BORDER, BORDER,
00178                     width/2 - 2*BORDER, height/2 - BORDER,
00179                     SWP_SHOWWINDOW);
00180       SetWindowPos (gahwndSpin[2], NULL,
00181                     BORDER, height/2 + BORDER,
00182                     width/2 - BORDER, height/2 - 2*BORDER,
00183                     SWP_SHOWWINDOW);
00184       SetWindowPos (gahwndSpin[3], NULL,
00185                     width/2 + BORDER, height/2 + BORDER,
00186                     width/2 - 2*BORDER, height/2 - 2*BORDER,
00187                     SWP_SHOWWINDOW);
00188       break;
00189     }
00190
00191     case WM_DESTROY:
00192
00193       PostQuitMessage (0);
00194       break;
00195
00196     default:
00197
00198       return (DefWindowProc (hwnd, msg, wParam, lParam));
00199   }
00200   return 0;
00201 }
00202
00203
00204
00205 /******************************************************************************\
00206 *
00207 *  FUNCTION:    DlgProc (standard dialog procedure INPUTS/RETURNS)
00208 *
00209 *  COMMENTS:    Our common dlg proc (why have 3 that do the same thing???)
00210 *
00211 \******************************************************************************/
00212
00213 LRESULT CALLBACK DlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
00214 {
00215   switch (message)
00216   {
00217     case WM_INITDIALOG:
00218
00219       //
00220       // If this dlg the "Stats" dlg fill in the appropriate fields.
00221       //   If not these calls will just fail.
00222       //
00223       // If the references to the giNum* vars are commented out &
00224       //   the program gets rebuilt don't be surprised if no spincubes
00225       //   appear- since no references to spincube.lib the linker will
00226       //   infer that it is not needed, & will not cause it to get
00227       //   loaded. You'll need to make a call to LoadLibrary ("SPINCUBE.DLL")
00228       //   prior to calling CreateWindow ("SPINCUBE"...).
00229       //
00230
00231       SetDlgItemInt (hwnd, 500, giNumSpincubesThisProcess, TRUE);
00232       SetDlgItemInt (hwnd, 501, giNumSpincubesAllProcesses, TRUE);
00233       return (TRUE);
00234
00235     case WM_COMMAND:
00236
00237       if (LOWORD(wParam) == IDOK)
00238
00239         EndDialog (hwnd, TRUE);
00240
00241       return (TRUE);
00242   }
00243   return (FALSE);
00244 }
00245
00246
00247
00248 /******************************************************************************\
00249 *
00250 *  FUNCTION:    GetStringRes (int id INPUT ONLY)
00251 *
00252 *  COMMENTS:    Load the resource string with the ID given, and return a
00253 *               pointer to it.  Notice that the buffer is common memory so
00254 *               the string must be used before this call is made a second time.
00255 *
00256 \******************************************************************************/
00257
00258 LPTSTR   GetStringRes (int id)
00259 {
00260   static TCHAR szBuffer[MAX_PATH];
00261
00262   szBuffer[0]=0;
00263   LoadString (GetModuleHandle (NULL), id, szBuffer, MAX_PATH);
00264   return szBuffer;
00265 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

About Member List

This is the complete list of members for About, including all inherited members.
About() | About | [inline]
components | About | [package]
dispose() | About | [inline]
initForm() | About | [inline, private]
main(String args[]) | About | [inline, static]
nameLabel | About | [package]
okButton | About | [package]
okButton_click(Object sender, Event e) | About | [inline, private]
titleLabel | About | [package]
versionLabel | About | [package]
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       resource.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by SCPProppage.rc
00014 //
00015 #define IDD_SCP_GENERAL_PAGE            102
00016 #define IDD_SCP_BINDING_INFO_PAGE       103
00017 #define IDD_SCP_KEYWORDS_PAGE           107
00018 #define IDC_DNS_NAME_EDIT               1001
00019 #define IDC_DESCRIPTION_EDIT            1003
00020 #define IDC_SERVICE_CLASS_EDIT          1004
00021 #define IDC_KEYWORD_EDIT                1011
00022 #define IDC_KEYWORD_LIST                1012
00023 #define IDC_ADD_BUTTON                  1013
00024 #define IDC_EDIT_BUTTON                 1015
00025 #define IDC_DELETE_BUTTON               1016
00026 #define IDC_NAME_EDIT                   1017
00027 #define IDC_DNS_NAME_TYPE_EDIT          1018
00028
00029 // Next default values for new objects
00030 //
00031 #ifdef APSTUDIO_INVOKED
00032 #ifndef APSTUDIO_READONLY_SYMBOLS
00033 #define _APS_NEXT_RESOURCE_VALUE        104
00034 #define _APS_NEXT_COMMAND_VALUE         40001
00035 #define _APS_NEXT_CONTROL_VALUE         1011
00036 #define _APS_NEXT_SYMED_VALUE           101
00037 #endif
00038 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/iec.h Source File

  • Com
  • Fundamentals
  • SimpSvr

iec.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: iec.h
00003 //
00004 //      Definition of CExternalConnection
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008 #if !defined( _IEC_H_)
00009 #define _IEC_H_
00010
00011
00012 #include <ole2.h>
00013 #include "obj.h"
00014
00015 class CSimpSvrObj;
00016
00017 interface CExternalConnection : public IExternalConnection
00018 {
00019 private:
00020   CSimpSvrObj FAR * m_lpObj;  // Ptr to object
00021   int m_nCount;               // Ref count
00022   DWORD m_dwStrong;           // Connection Count
00023
00024 public:
00025   CExternalConnection::CExternalConnection(CSimpSvrObj FAR * lpSimpSvrObj)
00026     {
00027     m_lpObj = lpSimpSvrObj;
00028     m_nCount = 0;
00029     m_dwStrong = 0;
00030     };
00031
00032   CExternalConnection::~CExternalConnection() {};
00033
00034   // *** IUnknown methods ***
00035   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppvObj);
00036   STDMETHODIMP_(ULONG) AddRef ();
00037   STDMETHODIMP_(ULONG) Release ();
00038
00039   // *** IExternalConnection methods ***
00040   STDMETHODIMP_(DWORD) AddConnection (DWORD extconn, DWORD reserved);
00041   STDMETHODIMP_(DWORD) ReleaseConnection (DWORD extconn, DWORD reserved, BOOL fLastReleaseCloses);
00042 };
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsecure/prof.h Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsecure

prof.h

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     Server Profiling Routines
00005
00006     FILE: Prof.h
00007
00008     PURPOSE: Routines for profiling server system services.
00009
00010     FUNCTIONS:
00011         ProfOpenLog - Opens the profile log file and prepares to
00012     take timings.
00013   ProfRecordTime - Records the time of an event.
00014   ProfCloseLog - Writes the profiling data to the file
00015     and closes it.
00016
00017     COMMENTS: These routines depend on the existence of a high-resolution
00018         performance counter.
00019 */
00020 #pragma once
00021
00022 // Maximum size for the profile log.
00023 // After the log reaches this size new entries "fall off" (threy
00024 // do not get reorded).
00025 #define PROF_LOG_MAX_SIZE (10*1024*1024)
00026
00027 // This mutex is used for mutial exclusion when generating and
00028 // writing the profiling information.  It is also accessible to
00029 // the server routines that may want to use it for syncronising
00030 // their internal operation and creation of profiling info.
00031 // The mutex can only be used between the calls to ProfOpenLog and
00032 // ProfCloseLog.
00033 extern HANDLE hProfMutex;
00034
00035 /*
00036     FUNCTION: ProfOpenLog
00037
00038     PURPOSE: Opens the profile log file and prepares to
00039     take timings.  Also inits the mutex.
00040
00041     PARAMETERS:
00042         LogFileName - Name of the profile log file.
00043
00044     RETURN VALUE:
00045         none
00046
00047     COMMENTS:
00048
00049 */
00050 VOID ProfOpenLog(LPTSTR LogFileName);
00051
00052 /*
00053     FUNCTION: ProfRecordTime
00054
00055     PURPOSE: Creates an entry for the even with identifier id, and
00056         with message msg with a timestamp corresponding to the number of
00057   secods since the start of the program.
00058
00059     PARAMETERS:
00060         id - Id of the event.
00061   msg - Message for the event.
00062
00063     RETURN VALUE:
00064         none
00065
00066     COMMENTS:  If the maximum log size has been exceeded, no action is taken.
00067
00068 */
00069 VOID ProfRecordTime(UINT id, LPTSTR msg);
00070
00071 /*
00072     FUNCTION: ProfCloseLog
00073
00074     PURPOSE: Writes out the acumulated profile data and closes the log file.
00075         Closes the mutex.
00076
00077     PARAMETERS:
00078         none
00079
00080     RETURN VALUE:
00081         none
00082
00083     COMMENTS:
00084
00085 */
00086 VOID ProfCloseLog(VOID);
00087
00088 // end Prof.h
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cbase.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cbase.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CBASE.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CBASE_H_
00012 #define _CBASE_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Forwards
00017 //
00018 ///////////////////////////////////////////////////////////////
00019 class CBase;
00020 class CMainWindow;
00021 class CMDIChild;
00022 class CIntTrace;
00023 class COptionsSheet;
00024
00025
00026 ///////////////////////////////////////////////////////////////
00027 // Defines
00028 //
00029 ///////////////////////////////////////////////////////////////
00030 enum SOURCE
00031 {
00032   eInvalid        = 0,
00033
00034   //Object Source
00035   eCUnknown       = 1,
00036   eCDataSource      = 2,
00037   eCSession       = 3,
00038   eCCommand       = 4,
00039   eCMultipleResults   = 5,
00040   eCRowset        = 6,
00041   eCRow         = 7,
00042   eCStream        = 8,
00043   eCEnumerator      = 9,
00044   eCBinder        =10,
00045   eCServiceComp     =11,
00046   eCDataLinks       =12,
00047   eCDataset       =13,
00048   eCTransaction     =14,
00049   eCTransactionOptions  =15,
00050   eCError         =16,
00051   eCCustomError     =17,
00052   eCRowPosition     =18,
00053   eCConnectionPoint   =19,
00054 };
00055
00056
00057 enum BASE_CLASS
00058 {
00059   eCBase        = 0x0001000,
00060   eCContainerBase   = 0x0002000,
00061   eCAsynchBase    = 0x0004000,
00062   eCPropertiesBase  = 0x0008000,
00063   eCDataAccess    = 0x0010000
00064 };
00065
00066
00067 //Use to quickly implement GetInterfaceAddress
00068 #define HANDLE_GETINTERFACE(interface)      \
00069   if(riid == IID_##interface)         \
00070     return (IUnknown**)&m_p##interface
00071
00072 #define OBTAIN_INTERFACE(interface)       \
00073   if(!m_p##interface)             \
00074     TRACE_QI(m_pIUnknown, IID_##interface, (IUnknown**)&m_p##interface, GetObjectName())
00075
00076 #define RELEASE_INTERFACE(interface)      \
00077   if(m_p##interface)              \
00078     TRACE_RELEASE(m_p##interface, WIDESTRING(#interface))
00079
00080 #define SOURCE_GETINTERFACE(pObject, type)    \
00081   ((pObject) ? (type*)(pObject)->GetInterface(IID_##type) : NULL)
00082
00083 #define SOURCE_GETOBJECT(pObject, source)   \
00084   (((pObject) && (((pObject)->GetObjectType() == e##source) || ((pObject)->GetBaseType() & e##source))) ? (source*)(pObject) : NULL)
00085
00086 #define SOURCE_GETPARENT(pObject, source)   \
00087   ((pObject) ? (source*)(pObject)->GetParent(e##source) : NULL)
00088
00089
00090 ///////////////////////////////////////////////////////////////
00091 // Functions
00092 //
00093 ///////////////////////////////////////////////////////////////
00094 SOURCE    GuidToSourceType(REFGUID guidType);
00095 SOURCE    DetermineObjectType(IUnknown* pIUnknown, SOURCE eSource);
00096
00097
00098 ///////////////////////////////////////////////////////////////
00099 // Includes
00100 //
00101 ///////////////////////////////////////////////////////////////
00102
00103
00104 ///////////////////////////////////////////////////////////////
00105 // Interface
00106 //
00107 ///////////////////////////////////////////////////////////////
00108 extern const IID IID_IAggregate;
00109 interface IAggregate : public IUnknown
00110 {
00111 };
00112
00113
00114 /////////////////////////////////////////////////////////////////
00115 // CBase class
00116 //
00117 /////////////////////////////////////////////////////////////////
00118 class CBase : public IUnknown
00119 {
00120 public:
00121   //Constructors
00122   CBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00123   virtual ~CBase();
00124
00125   //IUnknown
00126   //So we can get referening counting on parent objects...
00127   STDMETHODIMP      QueryInterface(REFIID riid, void** ppvObject);
00128     STDMETHODIMP_(ULONG)  AddRef();
00129     STDMETHODIMP_(ULONG)  Release();
00130
00131   //Base impemented helpers
00132   virtual ULONG     ObjectAddRef();
00133   virtual ULONG     ObjectRelease();
00134   virtual HRESULT     ObjectQI(REFIID riid, IUnknown** ppIUnknown);
00135   virtual HRESULT     CreateObject(CBase* pCSource, REFIID riid, IUnknown* pIUnknown, DWORD dwCreateOpts = -1 /*Default*/);
00136   virtual HRESULT     ReleaseObject(ULONG ulExpectedRefCount = 0);
00137   virtual HRESULT     ReleaseChildren();
00138
00139   virtual HRESULT     SetInterface(REFIID riid, IUnknown* pIUnknown);
00140   virtual IUnknown*   GetInterface(REFIID riid);
00141
00142   virtual BOOL      IsSameObject(IUnknown* pIUnkObject);
00143   virtual CBase*      GetParent(SOURCE eSource);
00144
00145   //Derived Object helpers (Devired Class implements this)
00146   virtual HRESULT     AutoQI(DWORD dwCreateOpts)      = 0;
00147   virtual HRESULT     AutoRelease()           = 0;
00148   virtual IUnknown**    GetInterfaceAddress(REFIID riid)  = 0;
00149
00150   virtual WCHAR*      GetObjectName()     = 0;
00151   virtual UINT      GetObjectMenu()     = 0;
00152   virtual LONG      GetObjectImage()    = 0;
00153   virtual REFIID      GetDefaultInterface() = 0;
00154   virtual void      OnDefOperation();
00155
00156   //UI - Helpers
00157   virtual HRESULT     DisplayObject();
00158   virtual WCHAR*      GetObjectDesc()     { return m_strObjectDesc;       }
00159   virtual void      SetObjectDesc(WCHAR* pwszDescription, BOOL fCopy = TRUE);
00160
00161   //Inlines
00162   inline  SOURCE      GetObjectType()     { return m_eObjectType;         }
00163   inline  BASE_CLASS    GetBaseType()     { return m_eBaseClass;          }
00164
00165   //Interface
00166   virtual COptionsSheet*  GetOptions();
00167
00168   //Common OLE DB Interfaces
00169   IUnknown*       m_pIUnknown;
00170   ISupportErrorInfo*    m_pISupportErrorInfo;
00171   IAggregate*       m_pIAggregate;
00172   IService*       m_pIService;
00173
00174   //Data
00175   HTREEITEM       m_hTreeItem;
00176   DWORD         m_dwCLSCTX;
00177
00178   //Parent Info
00179   CBase*          m_pCParent;
00180   GUID          m_guidSource;
00181
00182   //BackPointers
00183   CMainWindow*      m_pCMainWindow;
00184   CMDIChild*        m_pCMDIChild;
00185
00186 protected:
00187   //Type
00188   SOURCE          m_eObjectType;
00189   BASE_CLASS        m_eBaseClass;
00190   CComWSTR        m_strObjectDesc;
00191
00192   //IUnknown
00193   ULONG         m_cRef;
00194 };
00195
00196
00197
00198 /////////////////////////////////////////////////////////////////
00199 // CUnknown class
00200 //
00201 /////////////////////////////////////////////////////////////////
00202 class CUnknown : public CBase
00203 {
00204 public:
00205   //Constructors
00206   CUnknown(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL)
00207     : CBase(eCUnknown, pCMainWindow, pCMDIChild)
00208   {
00209   }
00210
00211   virtual ~CUnknown()
00212   {
00213     ReleaseObject(0);
00214   }
00215
00216   //Derived Object helpers
00217   //Devired Class implements this...
00218   virtual HRESULT     AutoQI(DWORD dwCreateOpts)            { return CBase::AutoQI(dwCreateOpts); }
00219   virtual HRESULT     AutoRelease()                 { return CBase::AutoRelease();      }
00220   virtual IUnknown**    GetInterfaceAddress(REFIID riid)            { return CBase::GetInterfaceAddress(riid);    }
00221
00222   virtual WCHAR*      GetObjectName()                 { return L"Unknown";          }
00223   virtual UINT      GetObjectMenu()                 { return IDM_UNKNOWNMENU;       }
00224   virtual LONG      GetObjectImage()                { return IMAGE_QUESTION;        }
00225   virtual REFIID      GetDefaultInterface()             { return IID_IUnknown;          }
00226 };
00227
00228
00229 /////////////////////////////////////////////////////////////////
00230 // CContainerBase class
00231 //
00232 /////////////////////////////////////////////////////////////////
00233 class CContainerBase : public CBase
00234 {
00235 public:
00236   //Constructors
00237   CContainerBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00238   virtual ~CContainerBase();
00239
00240   //IUnknown Helpers
00241   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00242   virtual HRESULT     AutoRelease();
00243   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00244
00245   //Members
00246   virtual HRESULT     FindConnectionPoint(REFIID riid, IConnectionPoint** ppIConnectionPoint);
00247   virtual HRESULT     AdviseListener(REFIID riid, DWORD* pdwCookie);
00248   virtual HRESULT     UnadviseListener(REFIID riid, DWORD* pdwCookie);
00249
00250   //OLE DB Interfaces
00251   //[MANADATORY]
00252
00253   //[OPTIONAL]
00254   IConnectionPointContainer*  m_pIConnectionPointContainer;
00255
00256 //protected:
00257   //Data
00258 };
00259
00260
00261 /////////////////////////////////////////////////////////////////
00262 // CConnectionPoint class
00263 //
00264 /////////////////////////////////////////////////////////////////
00265 class CConnectionPoint : public CBase
00266 {
00267 public:
00268   //Constructors
00269   CConnectionPoint(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00270   virtual ~CConnectionPoint();
00271
00272   //IUnknown Helpers
00273   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00274   virtual HRESULT     AutoRelease();
00275   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00276
00277   //Derived Class
00278   virtual WCHAR*      GetObjectName()         { return L"ConnectionPoint";      }
00279   virtual UINT      GetObjectMenu()         { return IDM_CONNECTIONPOINTMENU;   }
00280   virtual LONG      GetObjectImage()        { return IMAGE_FORM;          }
00281   virtual REFIID      GetDefaultInterface()     { return IID_IConnectionPoint;      }
00282   virtual WCHAR*      GetObjectDesc();
00283
00284   //Members
00285   virtual HRESULT     GetConnectionInterface(IID* pIID);
00286
00287   //OLE DB Interfaces
00288   //[MANADATORY]
00289   IConnectionPoint*   m_pIConnectionPoint;
00290
00291   //[OPTIONAL]
00292
00293 //protected:
00294   //Data
00295   DWORD         m_dwCookie;
00296 };
00297
00298
00299 /////////////////////////////////////////////////////////////////
00300 // CAsynchBase class
00301 //
00302 /////////////////////////////////////////////////////////////////
00303 class CAsynchBase : public CContainerBase
00304 {
00305 public:
00306   //Constructors
00307   CAsynchBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00308   virtual ~CAsynchBase();
00309
00310   //IUnknown Helpers
00311   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00312   virtual HRESULT     AutoRelease();
00313   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00314
00315   //Members
00316   virtual BOOL      IsInitialized()   { return m_fInitialized;      }
00317   virtual HRESULT     Initialize();
00318   virtual HRESULT     Uninitialize();
00319
00320   virtual HRESULT     Abort(HCHAPTER hChapter, DBASYNCHOP eOperation);
00321   virtual HRESULT     GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM* pulProgress, DBCOUNTITEM* pulProgressMax, DBASYNCHPHASE* peAsynchPhase, LPOLESTR* ppwszStatusText);
00322
00323   //OLE DB Interfaces
00324   //[MANADATORY]
00325
00326   //[OPTIONAL]
00327   IDBInitialize*      m_pIDBInitialize;       //OLE DB interface
00328   IDBAsynchStatus*    m_pIDBAsynchStatus;       //OLE DB interface
00329
00330   //Extra interfaces
00331
00332 //protected:
00333   //Data
00334   DWORD         m_dwCookieAsynchNotify;
00335   BOOL          m_fInitialized;
00336 };
00337
00338
00339 /////////////////////////////////////////////////////////////////
00340 // CPropertiesBase class
00341 //
00342 /////////////////////////////////////////////////////////////////
00343 class CPropertiesBase : public CAsynchBase
00344 {
00345 public:
00346   //Constructors
00347   CPropertiesBase(SOURCE eObjectType, CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00348   virtual ~CPropertiesBase();
00349
00350   //IUnknown Helpers
00351   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00352   virtual HRESULT     AutoRelease();
00353   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00354
00355   //Members
00356   virtual HRESULT     SetProperties(ULONG cPropSets, DBPROPSET* rgPropSets);
00357
00358   //OLE DB Interfaces
00359   //[MANADATORY]
00360   IDBProperties*      m_pIDBProperties;       //OLE DB interface
00361
00362   //[OPTIONAL]
00363
00364 protected:
00365   //Data
00366 };
00367
00368
00369 ///////////////////////////////////////////////////////////////////////////////
00370 // Class CAggregate
00371 //
00372 ///////////////////////////////////////////////////////////////////////////////
00373 class CAggregate : public IAggregate
00374 {
00375 public:
00376   CAggregate();
00377   virtual ~CAggregate();
00378
00379   //IUnknown
00380   virtual STDMETHODIMP_(ULONG)  AddRef(void);
00381   virtual STDMETHODIMP_(ULONG)  Release(void);
00382   virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00383
00384   //Helpers
00385   virtual HRESULT   HandleAggregation(REFIID riid, IUnknown** ppIUnknown);
00386       HRESULT   SetInner(IUnknown* pIUnkInner);
00387       HRESULT   ReleaseInner();
00388
00389 protected:
00390   //Data
00391   ULONG       m_cRef;
00392   CComPtr<IUnknown> m_spUnkInner;
00393 };
00394
00395
00396 #endif  //_CBASE_H_
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/GridFont/APP.Hxx Source File

  • Multimedia
  • Gdi
  • Fonts
  • GridFont

APP.Hxx

Go to the documentation of this file.
00001 //+--------------------------------------------------------
00002 // File:        App.hxx
00003 //
00004 // Classes:     CController
00005 //
00006 // Functions:   WinMain
00007 //              WndProc
00008 //              MakeWindowClass
00009 //              AboutDlgProc
00010 //
00011 // History:     22-Jan-1993     asmusf  created
00012 //              15-Dec-1993     michelsu
00013 //       - added font content awareness (page and block level)
00014 //       - fix Print All Pages
00015 //        15-Aug-1994   asmusf
00016 //     - added decomposition, property indication
00017 //----------------------------------------------------------
00018
00019 #include <string.h>
00020 #include "app.h"
00021 #include "view.hxx"
00022 #include "grid.hxx"
00023 #include "box.hxx"
00024
00025 //----------------------------------------------------------
00026 //
00027 // Class Hierarchy for Application   --- inheritance
00028 //           (approximate)           (x) contains x
00029 //
00030 //      CGrid
00031 //        |                          CBlockFrame(CFont)
00032 //        |                                     (CLineGrid)
00033 //        +--CTextGrid(CFont)                   (CCodeGrid)
00034 //        |     |                               (CCharGrid)
00035 //        |     |
00036 //        |     +CCharGrid           CPage(CFont,CCodeGrid[])
00037 //   CLineGrid  |                         (CBlockFrame[])
00038 //              +CCodeGrid
00039 //                                   CModel(CPage,CFontRange)
00040 //
00041 //
00042 //
00043 //      CCanvas                       CView
00044 //         |                            |
00045 //         |-- CPaintCanvas             |
00046 //         |                          CScrollableView
00047 //         |-- CScreenCanvas
00048 //         |
00049 //         +-- CPrintCanvas           CPrintRequest
00050 //
00051 //
00052 //     CController(CScrollableView, CModel, CBox)
00053 //
00054 //----------------------------------------------------------
00055
00056 #if 0
00057 #ifndef WPARAM
00058 #define WPARAM WORD
00059 #endif
00060 #ifndef LPARAM
00061 #define LPARAM LONG
00062 #endif
00063 #endif
00064
00065 // procedures called by Windows
00066
00067 extern "C" {
00068
00069 LRESULT CALLBACK WndProc
00070    ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
00071
00072 BOOL CALLBACK AboutDlgProc
00073    ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
00074
00075 BOOL CALLBACK PropDlgProc
00076    ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
00077 }
00078
00079
00080 // Main function and other functions used in App.cxx
00081
00082 int WINAPI WinMain
00083    ( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdParam, int cmdShow );
00084
00085 void MakeWindowClass ( WNDPROC WndProc, LPTSTR szAppName, HINSTANCE hInst );
00086
00087
00088 // ==== Class CWindow =============================
00089
00090 class CWindow
00091 {
00092 public:
00093    CWindow (): _hwnd(0) {}
00094    CWindow ( LPTSTR caption, LPTSTR lpszClassName, HINSTANCE hInstance,
00095             int cx = CW_USEDEFAULT, int cy=CW_USEDEFAULT);
00096    void Show ( int nCmdShow )
00097    {
00098       ShowWindow ( _hwnd, nCmdShow );
00099       UpdateWindow ( _hwnd );
00100    }
00101    operator HWND() { return _hwnd; }
00102 protected:
00103    HWND _hwnd;
00104 };
00105
00106 inline CWindow::CWindow(LPTSTR caption, LPTSTR lpszClassName, HINSTANCE hInstance,
00107 int cx, int cy)
00108 {
00109    _hwnd = CreateWindow (
00110       lpszClassName,
00111       caption,
00112       WS_OVERLAPPEDWINDOW | WS_VSCROLL | WS_HSCROLL,
00113       CW_USEDEFAULT,
00114       CW_USEDEFAULT,
00115       cx,
00116       cy,
00117       NULL,
00118       NULL,
00119       hInstance,
00120       NULL );
00121 }
00122
00123 // ==== Class Controller ==========================
00124
00125 class CController
00126 {
00127 public:
00128    void Init(HWND hwnd);
00129
00130    void Create(HWND hwnd, LPARAM lParam);
00131    void Destroy();
00132    void Size ( LPARAM lParam );
00133    void Paint ( HWND hwnd );
00134    void Command ( HWND hwnd, WPARAM wParam );
00135    void ButtonDown(HWND hwnd, LPARAM lParam );
00136    void ButtonUp(HWND hwnd, LPARAM lParam);
00137    void KeyDown(HWND hwnd, WPARAM wParam, LPARAM lParam);
00138    void KeyUp(HWND hwnd, WPARAM wParam, LPARAM lParam);
00139    void VScroll(HWND hwnd, WPARAM wParam, LPARAM lParam);
00140    void HScroll(HWND hwnd, WPARAM wParam, LPARAM lParam);
00141    void AlertBox(HWND hwnd, UINT ids, UINT fuStyle);
00142
00143 private:
00144    void Page(HWND hwnd, WPARAM wParam);
00145
00146    HINSTANCE  _hInst;
00147    DLGPROC _funAbout;
00148    DLGPROC _funProp;
00149
00150    CScrollableView* _pView;
00151    CModel* _pModel;
00152    CBox *  _pBox;
00153 };
00154
00155
00156 inline void CController::Paint ( HWND hwnd )
00157 {
00158    CPaintCanvas canvas (hwnd);
00159
00160    _pView->Paint(canvas, _pModel, canvas.GetRect());
00161 }
00162
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/ScannedPaperForm/C#/PaperForm.cs Source File

  • TabletPC
  • ScannedPaperForm
  • C#

PaperForm.cs

Go to the documentation of this file.
00001 //
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 //  File: PaperForm.cs
00012 //  PaperForm Ink Controls Sample Application
00013 //
00014 //  This sample program demonstrates how the InkPicture control
00015 //  can be used in conjunction with a DataSet to allow the user
00016 //  to fill in a scanned form.  The DataSet contains a reference
00017 //  to the form image and the location of each element in the form.
00018 //  The InkPicture control uses this information to display the
00019 //  form and calculate recognition results for each form element.
00020 //
00021 //  The features used are: InkPicture used in conjunction with
00022 //  a DataSet to allow the user to write over a scanned form.
00023 //
00024 //--------------------------------------------------------------------------
00025
00026 using System;
00027 using System.Drawing;
00028 using System.Windows.Forms;
00029 using System.Data;
00030 using System.IO;
00031 using System.Text;
00032
00033 // The Ink namespace, which contains the Tablet PC Platform API
00034 using Microsoft.Ink;
00035
00036 namespace PaperForm
00037 {
00038     /// <summary>
00039     /// The PaperForm Sample Application form class
00040     /// </summary>
00041     public class PaperForm : System.Windows.Forms.Form
00042     {
00043         // DataSet containing the form's data
00044         private DataSet formData = null;
00045
00046         // Declare the InkPicture control, which contains the scanned image
00047         private InkPicture inkPicture1 = null;
00048
00049         // The name of the xml file containing the form data
00050         private String formDataFile = "formdata.xml";
00051
00052         #region Standard Template Code
00053
00054         private System.Windows.Forms.MenuItem menuItem4;
00055         private System.Windows.Forms.MainMenu mainMenu;
00056         private System.Windows.Forms.MenuItem miInk;
00057         private System.Windows.Forms.MenuItem miRecognize;
00058         private System.Windows.Forms.MenuItem miClear;
00059         private System.Windows.Forms.MenuItem miExit;
00060         private System.Windows.Forms.MenuItem miMode;
00061         private System.Windows.Forms.MenuItem miPen;
00062         private System.Windows.Forms.MenuItem miEdit;
00063         private System.Windows.Forms.MenuItem miEraser;
00064         private System.ComponentModel.Container components = null;
00065         #endregion
00066
00067         public PaperForm()
00068         {
00069             #region Standard Template Code
00070             //
00071             // Required for Windows Form Designer support
00072             //
00073             InitializeComponent();
00074             #endregion
00075         }
00076
00077         #region Standard Template Code
00078         /// <summary>
00079         /// Clean up any resources being used.
00080         /// </summary>
00081         protected override void Dispose( bool disposing )
00082         {
00083             if( disposing )
00084             {
00085                 if (components != null)
00086                 {
00087                     components.Dispose();
00088                 }
00089             }
00090             base.Dispose( disposing );
00091         }
00092         #endregion
00093
00094         #region Windows Form Designer generated code
00095         /// <summary>
00096         /// Required method for Designer support - do not modify
00097         /// the contents of this method with the code editor.
00098         /// </summary>
00099         private void InitializeComponent()
00100         {
00101             this.inkPicture1 = new Microsoft.Ink.InkPicture();
00102             this.mainMenu = new System.Windows.Forms.MainMenu();
00103             this.miInk = new System.Windows.Forms.MenuItem();
00104             this.miRecognize = new System.Windows.Forms.MenuItem();
00105             this.miClear = new System.Windows.Forms.MenuItem();
00106             this.menuItem4 = new System.Windows.Forms.MenuItem();
00107             this.miExit = new System.Windows.Forms.MenuItem();
00108             this.miMode = new System.Windows.Forms.MenuItem();
00109             this.miPen = new System.Windows.Forms.MenuItem();
00110             this.miEdit = new System.Windows.Forms.MenuItem();
00111             this.miEraser = new System.Windows.Forms.MenuItem();
00112             this.SuspendLayout();
00113             //
00114             // inkPicture1
00115             //
00116             this.inkPicture1.Cursor = System.Windows.Forms.Cursors.Default;
00117             this.inkPicture1.InkEnabled = false;
00118             this.inkPicture1.MarginX = -1;
00119             this.inkPicture1.MarginY = -1;
00120             this.inkPicture1.Name = "inkPicture1";
00121             this.inkPicture1.Size = new System.Drawing.Size(717, 975);
00122             this.inkPicture1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00123             this.inkPicture1.TabIndex = 4;
00124             this.inkPicture1.TabStop = false;
00125             //
00126             // mainMenu
00127             //
00128             this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00129                                                                                      this.miInk,
00130                                                                                      this.miMode});
00131             //
00132             // miInk
00133             //
00134             this.miInk.Index = 0;
00135             this.miInk.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00136                                                                                   this.miRecognize,
00137                                                                                   this.miClear,
00138                                                                                   this.menuItem4,
00139                                                                                   this.miExit});
00140             this.miInk.Text = "&Ink";
00141             //
00142             // miRecognize
00143             //
00144             this.miRecognize.Index = 0;
00145             this.miRecognize.Text = "&Recognize";
00146             this.miRecognize.Click += new System.EventHandler(this.miRecognize_Click);
00147             //
00148             // miClear
00149             //
00150             this.miClear.Index = 1;
00151             this.miClear.Text = "&Clear";
00152             this.miClear.Click += new System.EventHandler(this.miClear_Click);
00153             //
00154             // menuItem4
00155             //
00156             this.menuItem4.Index = 2;
00157             this.menuItem4.Text = "-";
00158             //
00159             // miExit
00160             //
00161             this.miExit.Index = 3;
00162             this.miExit.Text = "&Exit";
00163             this.miExit.Click += new System.EventHandler(this.miExit_Click);
00164             //
00165             // miMode
00166             //
00167             this.miMode.Index = 1;
00168             this.miMode.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00169                                                                                    this.miPen,
00170                                                                                    this.miEdit,
00171                                                                                    this.miEraser});
00172             this.miMode.Text = "&Mode";
00173             //
00174             // miPen
00175             //
00176             this.miPen.Checked = true;
00177             this.miPen.Index = 0;
00178             this.miPen.RadioCheck = true;
00179             this.miPen.Text = "&Pen";
00180             this.miPen.Click += new System.EventHandler(this.miPen_Click);
00181             //
00182             // miEdit
00183             //
00184             this.miEdit.Index = 1;
00185             this.miEdit.RadioCheck = true;
00186             this.miEdit.Text = "&Edit";
00187             this.miEdit.Click += new System.EventHandler(this.miEdit_Click);
00188             //
00189             // miEraser
00190             //
00191             this.miEraser.Index = 2;
00192             this.miEraser.RadioCheck = true;
00193             this.miEraser.Text = "E&raser";
00194             this.miEraser.Click += new System.EventHandler(this.miEraser_Click);
00195             //
00196             // PaperForm
00197             //
00198             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00199             this.AutoScroll = true;
00200             this.ClientSize = new System.Drawing.Size(719, 817);
00201             this.Controls.AddRange(new System.Windows.Forms.Control[] {
00202                                                                           this.inkPicture1});
00203             this.DockPadding.All = 2;
00204             this.Menu = this.mainMenu;
00205             this.Name = "PaperForm";
00206             this.Text = "Scanned Paper Form Demo";
00207             this.Load += new System.EventHandler(this.PaperForm_Load);
00208             this.ResumeLayout(false);
00209
00210         }
00211         #endregion
00212
00213         #region Standard Template Code
00214         /// <summary>
00215         /// The main entry point for the application.
00216         /// </summary>
00217         [STAThread]
00218         static void Main()
00219         {
00220             Application.Run(new PaperForm());
00221         }
00222         #endregion
00223
00224         /// <summary>
00225         /// Event Handler from PaperForm->Load Event
00226         /// </summary>
00227         /// <param name="sender">The control that raised the event.</param>
00228         /// <param name="e">The event arguments.</param>
00229         private void PaperForm_Load(object sender, System.EventArgs e)
00230         {
00231
00232             String applicationPath = Path.GetDirectoryName(Application.ExecutablePath)+"\\";
00233
00234             // Initialize the form's dataset
00235             try
00236             {
00237                 // read the form's data from the given xml file
00238                 formData = new DataSet("FormData");
00239                 formData.ReadXml(applicationPath+formDataFile);
00240
00241                 // The overlay control's background image is referenced in the xml dataset
00242                 inkPicture1.BackgroundImage =
00243                     System.Drawing.Image.FromFile(applicationPath+
00244                     (string) formData.Tables["FormData"].Rows[0]["Image"]);
00245             }
00246             catch(FileNotFoundException error)
00247             {
00248                 // If the xml or the scanned form image file are not available,
00249                 // display an error and exit
00250                 MessageBox.Show("A required data file was not found.  Please verify "+
00251                                 "that the file exists in the same directory as PaperForm.exe "+
00252                                 "and try again.\n\n"+error.ToString(),
00253                                 "PaperForm",
00254                                 MessageBoxButtons.OK);
00255                 Application.Exit();
00256             }
00257             // Enable ink collection for the ink picture control
00258             inkPicture1.InkEnabled = true;
00259         }
00260
00261         /// <summary>
00262         /// Event Handler from Clear Menu Item Click Event
00263         /// </summary>
00264         /// <param name="sender">The control that raised the event.</param>
00265         /// <param name="e">The event arguments.</param>
00266         private void miClear_Click(object sender, System.EventArgs e)
00267         {
00268             // Delete the ink strokes and redraw
00269             inkPicture1.Ink.DeleteStrokes(inkPicture1.Ink.Strokes);
00270             inkPicture1.Invalidate();
00271         }
00272
00273         /// <summary>
00274         /// Event Handler from Recognize Menu Item Click Event
00275         /// </summary>
00276         /// <param name="sender">The control that raised the event.</param>
00277         /// <param name="e">The event arguments.</param>
00278         private void miRecognize_Click(object sender, System.EventArgs e)
00279         {
00280             // Get the handwriting recognition results
00281             Recognize();
00282         }
00283
00284         /// <summary>
00285         /// Event Handler from Exit Menu Item Click Event
00286         /// </summary>
00287         /// <param name="sender">The control that raised the event.</param>
00288         /// <param name="e">The event arguments.</param>
00289         private void miExit_Click(object sender, System.EventArgs e)
00290         {
00291             inkPicture1.Enabled = false;
00292             Application.Exit();
00293         }
00294
00295         /// <summary>
00296         /// Event Handler from Pen Menu Item Click Event
00297         /// </summary>
00298         /// <param name="sender">The control that raised the event.</param>
00299         /// <param name="e">The event arguments.</param>
00300         private void miPen_Click(object sender, System.EventArgs e)
00301         {
00302             UpdateEditMode(InkOverlayEditingMode.Ink);
00303         }
00304
00305         /// <summary>
00306         /// Event Handler from Edit Menu Item Click Event
00307         /// </summary>
00308         /// <param name="sender">The control that raised the event.</param>
00309         /// <param name="e">The event arguments.</param>
00310         private void miEdit_Click(object sender, System.EventArgs e)
00311         {
00312             UpdateEditMode(InkOverlayEditingMode.Select);
00313         }
00314
00315         /// <summary>
00316         /// Event Handler from Eraser Menu Item Click Event
00317         /// </summary>
00318         /// <param name="sender">The control that raised the event.</param>
00319         /// <param name="e">The event arguments.</param>
00320         private void miEraser_Click(object sender, System.EventArgs e)
00321         {
00322             UpdateEditMode(InkOverlayEditingMode.Delete);
00323         }
00324
00325         /// <summary>
00326         /// UpdateEditMode is a helper method to switch the InkPicture's
00327         /// editing mode and update the form accordingly.
00328         /// </summary>
00329         /// <param name="mode">The new editing mode</param>
00330         private void UpdateEditMode(InkOverlayEditingMode mode)
00331         {
00332             // Ink collection must be disabled before modifying the edit mode
00333             inkPicture1.InkEnabled = false;
00334             inkPicture1.EditingMode = mode;
00335             inkPicture1.InkEnabled = true;
00336
00337             // Update the menu UI to the new state
00338             miPen.Checked = InkOverlayEditingMode.Ink == mode;
00339             miEdit.Checked = InkOverlayEditingMode.Select == mode;
00340             miEraser.Checked = InkOverlayEditingMode.Delete == mode;
00341         }
00342
00343         /// <summary>
00344         /// Iterate through each row of the form data and
00345         /// display the recognition results
00346         /// </summary>
00347         private void Recognize()
00348         {
00349
00350             // Check to ensure that the user has at least one recognizer installed
00351             Recognizers inkRecognizers = new Recognizers();
00352             if (0 == inkRecognizers.Count)
00353             {
00354                 MessageBox.Show(this, "There are no handwriting recognizers installed.  You need to have at least one in order to perform the recognition.");
00355             }
00356             else
00357             {
00358                 StringBuilder buffer = new StringBuilder();
00359
00360                 // Iterate through the rows in the "FieldInfo" table
00361                 foreach(DataRow row in formData.Tables["FieldInfo"].Rows)
00362                 {
00363                     // get the metadata for the field
00364                     // Note that the DataSet contains a row for each field
00365                     // in the form.  It is assumed that the rows are in the
00366                     // same order as the fields in the form.  The DataSet
00367                     // has the following columns:
00368                     // Name:  the field's name
00369                     // Left, Top, Right, Bottom:  the coordinates of the field (in pixels)
00370                     string fieldname = (string) row["Name"];
00371                     Point pt1 = new Point((int) row["Left"], (int) row["Top"]);
00372                     Point pt2 = new Point((int) row["Right"], (int) row["Bottom"]);
00373
00374                     // Convert to ink space units
00375                     inkPicture1.Renderer.PixelToInkSpace(Handle, ref pt1);
00376                     inkPicture1.Renderer.PixelToInkSpace(Handle, ref pt2);
00377
00378                     // the rectangle for the region
00379                     Rectangle rc = new Rectangle(pt1.X, pt1.Y, pt2.X-pt1.X, pt2.Y-pt1.Y);
00380
00381                     // find the strokes that intersect and lie inside of the rectangle
00382                     Strokes strokes = inkPicture1.Ink.HitTest(rc,70);
00383
00384                     // recognize the handwriting
00385                     if (strokes.Count > 0)
00386                     {
00387                         buffer.Append(fieldname + " = " + strokes.ToString() + Environment.NewLine);
00388                     }
00389                 }
00390
00391                 // Display the results
00392                 if (buffer.Length > 0)
00393                 {
00394                     MessageBox.Show(this, buffer.ToString());
00395                 }
00396                 else
00397                 {
00398                     MessageBox.Show(this, "There aren't any recognition results.");
00399                 }
00400             }
00401         }
00402     }
00403 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Incoming/Resource.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Incoming

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Script1.rc
00004 //
00005 #define IDD_MAINDLG                     101
00006 #define IDC_STATUS                      1000
00007 #define IDC_ANSWER                      1001
00008 #define IDC_DISCONNECT                  1002
00009 #define IDC_DISCONNECTED                1003
00010 #define IDC_AUTOANSWER                  1004
00011 #define IDC_STATIC                      -1
00012
00013 // Next default values for new objects
00014 //
00015 #ifdef APSTUDIO_INVOKED
00016 #ifndef APSTUDIO_READONLY_SYMBOLS
00017 #define _APS_NEXT_RESOURCE_VALUE        102
00018 #define _APS_NEXT_COMMAND_VALUE         40001
00019 #define _APS_NEXT_CONTROL_VALUE         1004
00020 #define _APS_NEXT_SYMED_VALUE           101
00021 #endif
00022 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFilesTest/CrmFilesTestObj.h Source File

  • Com
  • Services
  • Crm
  • CrmFilesTest

CrmFilesTestObj.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: CrmFilesTestObj.h
00004
00005
00006
00007 Summary:
00008
00009   Test driver component for CrmFiles CRM, VC, VB and VJ versions.
00010
00011   Should be installed in a COM+ application and requires a transaction.
00012
00013   This file is part of the Microsoft COM Technology Samples.
00014
00015
00016 Classes: what classes are in this file
00017
00018
00019
00020 Functions: (optional)
00021
00022 ----------------------------------------------------------------------------
00023
00024 This file is part of the Microsoft COM+ Samples.
00025
00026
00027
00028 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00029
00030
00031
00032 This source code is intended only as a supplement to Microsoft
00033
00034 Development Tools and/or on-line documentation. See these other
00035
00036 materials for detailed information regarding Microsoft code samples.
00037
00038
00039
00040 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00041
00042 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00043
00044 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00045
00046 PARTICULAR PURPOSE.
00047
00048 ==========================================================================+*/
00049 // CrmFilesTestObj.h : Declaration of the CCrmFilesTest
00050
00051
00052 #ifndef __CRMFILESTEST_H_
00053 #define __CRMFILESTEST_H_
00054
00055 #include "resource.h"       // main symbols
00056 #include <comsvcs.h>
00057
00058 #include "comdef.h"     // _bstr_t, etc
00059
00060 // ICrmFilesWorker - interface for the create file/delete file CRM Worker
00061 #include "CrmFiles.h"
00062
00063 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00064
00065 Class: CCrmFilesTest
00066
00067   This is the component that drives the sample. It should be installed into
00068   COM+ explorer as part of it's own application. It requires transactions.
00069   This component creates the worker object and does work on it. Then
00070   commits or aborts its transaction.
00071
00072 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00073
00074 /////////////////////////////////////////////////////////////////////////////
00075 // CCrmFilesTest
00076 class ATL_NO_VTABLE CCrmFilesTest :
00077   public CComObjectRootEx<CComSingleThreadModel>,
00078   public CComCoClass<CCrmFilesTest, &CLSID_CrmFilesTest>,
00079   public IObjectControl,
00080   public IDispatchImpl<ICrmFilesTest, &IID_ICrmFilesTest, &LIBID_CRMFILESTESTLib>
00081 {
00082 public:
00083   CCrmFilesTest() :
00084    m_lLanguage(0)
00085   ,m_pICrmFilesWorkerCurrent(NULL)
00086   {
00087   }
00088
00089 DECLARE_REGISTRY_RESOURCEID(IDR_CRMFILESTEST)
00090 DECLARE_NOT_AGGREGATABLE(CCrmFilesTest)
00091
00092 BEGIN_COM_MAP(CCrmFilesTest)
00093   COM_INTERFACE_ENTRY(ICrmFilesTest)
00094   COM_INTERFACE_ENTRY(IObjectControl)
00095   COM_INTERFACE_ENTRY(IDispatch)
00096 END_COM_MAP()
00097
00098 // IObjectControl
00099 public:
00100   STDMETHOD(Activate)();
00101   STDMETHOD_(BOOL, CanBePooled)();
00102   STDMETHOD_(void, Deactivate)();
00103
00104   CComPtr<IObjectContext> m_spObjectContext;
00105
00106 // ICrmFilesTest
00107 public:
00108   STDMETHOD(put_Language)(/*[in]*/ long newVal);
00109   STDMETHOD(Abort)();
00110   STDMETHOD(Commit)();
00111   STDMETHOD(DeleteFile)();
00112   STDMETHOD(CreateFile)();
00113   STDMETHOD(put_FileName)(/*[in]*/ BSTR newVal);
00114
00115 private:
00116
00117   HRESULT GetCorrectCRM(void);
00118
00119 private:
00120
00121   enum { crm_VC, crm_VB, crm_VJ, crm_Total };
00122
00123   long            m_lLanguage;
00124
00125   _bstr_t           m_bstrFileName;
00126
00127   ICrmFilesWorker       *m_pICrmFilesWorkerCurrent;
00128
00129   ICrmFilesWorker       *m_pICrmFilesWorker[crm_Total];
00130 };
00131
00132 #endif //__CRMFILESTEST_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/csharp_draw/form1.cs Source File

  • NetDS
  • MessageQueuing
  • csharp_draw

form1.cs

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 using System;
00013 using System.Drawing;
00014 using System.Collections;
00015 using System.ComponentModel;
00016 using System.Windows.Forms;
00017 using System.Data;
00018 using System.Messaging;
00019 using Microsoft.Win32;
00020
00021 //
00022 // Line related struct and functions
00023 //
00024 namespace Util
00025 {
00026   public struct line
00027   {
00028     public int XFrom;
00029     public int YFrom;
00030     public int XTo;
00031     public int YTo;
00032   }
00033
00034   public class HelperFunctions
00035   {
00036     public string LineToString(int X1, int Y1, int X2, int Y2)
00037     {
00038       string strX1;
00039       string strY1;
00040       string strX2;
00041       string strY2;
00042       string strResult;
00043       strX1 = X1.ToString().PadLeft(7,'0');
00044       strY1 = Y1.ToString().PadLeft(7,'0');
00045       strX2 = X2.ToString().PadLeft(7,'0');
00046       strY2 = Y2.ToString().PadLeft(7,'0');
00047       strResult=strX1+strY1+strX2+strY2;
00048       return strResult;
00049     }
00050
00051     public void StringToLine(string strLine, ref line lineToDraw)
00052     {
00053       lineToDraw.XFrom = Convert.ToInt32(strLine.Substring(0,7));
00054       lineToDraw.YFrom = Convert.ToInt32(strLine.Substring(7,7));
00055       lineToDraw.XTo = Convert.ToInt32(strLine.Substring(14,7));
00056       lineToDraw.YTo = Convert.ToInt32(strLine.Substring(21,7));
00057     }
00058   }
00059 }
00060
00061 namespace CSharp_Draw
00062 {
00063   /// <summary>
00064   /// Form1 is the main form for sending and receiving Drawing commands using MSMQ
00065   /// </summary>
00066   public class Form1 : System.Windows.Forms.Form
00067   {
00068     /// <summary>
00069     /// Required designer variable.
00070     /// </summary>
00071     ///
00072
00073     //
00074     // The X and Y of the previous Line.
00075     //
00076     private int iLastX;
00077     private int iLastY;
00078
00079
00080
00081     //
00082     // Specify a guid that will be used for the Category property of the queue created
00083     //
00084     const string guidDraw = "{151ceac0-acb5-11cf-8b51-0020af929546}";
00085     public string strName;
00086
00087     //
00088     // Hold the information on the lines that were drawn in the picturebox. This
00089     // is used for refresh purposes.
00090     //
00091
00092     private ArrayList lines = new ArrayList();
00093
00094
00095     //
00096     // Graphics Stuff
00097     //
00098
00099     public System.Drawing.Graphics picture1Graphics;
00100     public System.Drawing.Pen BlackPen;
00101     public System.Drawing.Color Color;
00102     public System.Drawing.Font fontText;
00103     public System.Drawing.Brush brushText;
00104     public System.Drawing.FontFamily fontfamilyText;
00105
00106     //
00107     // Message Queue Stuff
00108     //
00109
00110     private System.Messaging.MessageQueue qFriend;  // The remote drawing queue
00111     private System.Messaging.MessageQueue qMe;    // My drawing queue
00112     private bool bDSEnabled;            // Are we working in a Domain or Workgroup mode.
00113     private bool bDirectMode;           // Connection using Direct Mode
00114
00115
00116     Util.HelperFunctions HP = new Util.HelperFunctions();
00117     private System.Windows.Forms.Button btnAttach;
00118     private System.Windows.Forms.TextBox textFriendName;
00119     private System.Windows.Forms.GroupBox groupSendType;
00120     private System.Windows.Forms.RadioButton radioSendRec;
00121     private System.Windows.Forms.RadioButton radioSendExp;
00122     private System.Windows.Forms.TextBox textFriendComputer;
00123     private System.Windows.Forms.Label lblRemoteQueue;
00124     private System.Windows.Forms.Label lblRemoteComputer;
00125     private System.Windows.Forms.Label lblDSConnection;
00126     private System.Windows.Forms.Button btnConnect;
00127     private System.Windows.Forms.Button btnCancel;
00128     private System.Windows.Forms.GroupBox groupConnectionMode;
00129     private System.Windows.Forms.RadioButton radioDSDisabled;
00130     private System.Windows.Forms.RadioButton radioDSEnabled;
00131     private System.Windows.Forms.TextBox textChars;
00132     private System.Windows.Forms.PictureBox picture1;
00133
00134     private System.ComponentModel.Container components;
00135
00136     public Form1()
00137     {
00138       //
00139       // Required for Windows Form Designer support
00140       //
00141       InitializeComponent();
00142
00143       //
00144       // Prepare the Graphics elements for the drawing
00145       //
00146
00147       picture1Graphics = picture1.CreateGraphics();
00148       Color = new System.Drawing.Color();
00149       BlackPen = new System.Drawing.Pen(Color.Black,1);
00150     }
00151
00152     /// <summary>
00153     /// Clean up any resources being used.
00154     /// </summary>
00155     public override void Dispose()
00156     {
00157       base.Dispose();
00158       if(components != null)
00159         components.Dispose();
00160     }
00161
00162     #region Windows Form Designer generated code
00163     /// <summary>
00164     /// Required method for Designer support - do not modify
00165     /// the contents of this method with the code editor.
00166     /// </summary>
00167     private void InitializeComponent()
00168     {
00169       this.radioDSDisabled = new System.Windows.Forms.RadioButton();
00170       this.textChars = new System.Windows.Forms.TextBox();
00171       this.btnAttach = new System.Windows.Forms.Button();
00172       this.radioSendExp = new System.Windows.Forms.RadioButton();
00173       this.lblDSConnection = new System.Windows.Forms.Label();
00174       this.textFriendName = new System.Windows.Forms.TextBox();
00175       this.groupConnectionMode = new System.Windows.Forms.GroupBox();
00176       this.radioDSEnabled = new System.Windows.Forms.RadioButton();
00177       this.textFriendComputer = new System.Windows.Forms.TextBox();
00178       this.lblRemoteQueue = new System.Windows.Forms.Label();
00179       this.groupSendType = new System.Windows.Forms.GroupBox();
00180       this.radioSendRec = new System.Windows.Forms.RadioButton();
00181       this.btnCancel = new System.Windows.Forms.Button();
00182       this.picture1 = new System.Windows.Forms.PictureBox();
00183       this.btnConnect = new System.Windows.Forms.Button();
00184       this.lblRemoteComputer = new System.Windows.Forms.Label();
00185       this.groupConnectionMode.SuspendLayout();
00186       this.groupSendType.SuspendLayout();
00187       this.SuspendLayout();
00188       //
00189       // radioDSDisabled
00190       //
00191       this.radioDSDisabled.Location = new System.Drawing.Point(8, 56);
00192       this.radioDSDisabled.Name = "radioDSDisabled";
00193       this.radioDSDisabled.Size = new System.Drawing.Size(216, 16);
00194       this.radioDSDisabled.TabIndex = 1;
00195       this.radioDSDisabled.Text = "Private queue";
00196       //
00197       // textChars
00198       //
00199       this.textChars.Location = new System.Drawing.Point(16, 272);
00200       this.textChars.Name = "textChars";
00201       this.textChars.Size = new System.Drawing.Size(384, 20);
00202       this.textChars.TabIndex = 11;
00203       this.textChars.Text = "";
00204       this.textChars.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textChars_KeyPress);
00205       //
00206       // btnAttach
00207       //
00208       this.btnAttach.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
00209       this.btnAttach.Location = new System.Drawing.Point(312, 304);
00210       this.btnAttach.Name = "btnAttach";
00211       this.btnAttach.Size = new System.Drawing.Size(88, 24);
00212       this.btnAttach.TabIndex = 3;
00213       this.btnAttach.Text = "Start Sending";
00214       this.btnAttach.Click += new System.EventHandler(this.btnAttach_Click);
00215       //
00216       // radioSendExp
00217       //
00218       this.radioSendExp.Checked = true;
00219       this.radioSendExp.Location = new System.Drawing.Point(16, 24);
00220       this.radioSendExp.Name = "radioSendExp";
00221       this.radioSendExp.Size = new System.Drawing.Size(104, 16);
00222       this.radioSendExp.TabIndex = 0;
00223       this.radioSendExp.TabStop = true;
00224       this.radioSendExp.Text = "&Express";
00225       //
00226       // lblDSConnection
00227       //
00228       this.lblDSConnection.Location = new System.Drawing.Point(16, 384);
00229       this.lblDSConnection.Name = "lblDSConnection";
00230       this.lblDSConnection.Size = new System.Drawing.Size(100, 16);
00231       this.lblDSConnection.TabIndex = 7;
00232       //
00233       // textFriendName
00234       //
00235       this.textFriendName.Location = new System.Drawing.Point(160, 304);
00236       this.textFriendName.Name = "textFriendName";
00237       this.textFriendName.Size = new System.Drawing.Size(144, 20);
00238       this.textFriendName.TabIndex = 2;
00239       this.textFriendName.Text = "";
00240       this.textFriendName.TextChanged += new System.EventHandler(this.textFriendName_TextChanged);
00241       //
00242       // groupConnectionMode
00243       //
00244       this.groupConnectionMode.Controls.AddRange(new System.Windows.Forms.Control[] {
00245                                                 this.radioDSDisabled,
00246                                                 this.radioDSEnabled});
00247       this.groupConnectionMode.Location = new System.Drawing.Point(96, 304);
00248       this.groupConnectionMode.Name = "groupConnectionMode";
00249       this.groupConnectionMode.Size = new System.Drawing.Size(232, 96);
00250       this.groupConnectionMode.TabIndex = 10;
00251       this.groupConnectionMode.TabStop = false;
00252       this.groupConnectionMode.Text = "Queue Type";
00253       //
00254       // radioDSEnabled
00255       //
00256       this.radioDSEnabled.Checked = true;
00257       this.radioDSEnabled.Location = new System.Drawing.Point(8, 24);
00258       this.radioDSEnabled.Name = "radioDSEnabled";
00259       this.radioDSEnabled.Size = new System.Drawing.Size(208, 16);
00260       this.radioDSEnabled.TabIndex = 0;
00261       this.radioDSEnabled.TabStop = true;
00262       this.radioDSEnabled.Text = "Public queue";
00263       //
00264       // textFriendComputer
00265       //
00266       this.textFriendComputer.Location = new System.Drawing.Point(160, 336);
00267       this.textFriendComputer.Name = "textFriendComputer";
00268       this.textFriendComputer.Size = new System.Drawing.Size(144, 20);
00269       this.textFriendComputer.TabIndex = 6;
00270       this.textFriendComputer.Text = "";
00271       this.textFriendComputer.TextChanged += new System.EventHandler(this.textFriendComputer_TextChanged);
00272       //
00273       // lblRemoteQueue
00274       //
00275       this.lblRemoteQueue.Location = new System.Drawing.Point(16, 304);
00276       this.lblRemoteQueue.Name = "lblRemoteQueue";
00277       this.lblRemoteQueue.Size = new System.Drawing.Size(128, 16);
00278       this.lblRemoteQueue.TabIndex = 1;
00279       this.lblRemoteQueue.Text = "Send drawing to queue:";
00280       //
00281       // groupSendType
00282       //
00283       this.groupSendType.Controls.AddRange(new System.Windows.Forms.Control[] {
00284                                             this.radioSendRec,
00285                                             this.radioSendExp});
00286       this.groupSendType.Location = new System.Drawing.Point(256, 368);
00287       this.groupSendType.Name = "groupSendType";
00288       this.groupSendType.Size = new System.Drawing.Size(136, 72);
00289       this.groupSendType.TabIndex = 4;
00290       this.groupSendType.TabStop = false;
00291       this.groupSendType.Text = "Type of delivery";
00292       //
00293       // radioSendRec
00294       //
00295       this.radioSendRec.Location = new System.Drawing.Point(16, 48);
00296       this.radioSendRec.Name = "radioSendRec";
00297       this.radioSendRec.Size = new System.Drawing.Size(104, 16);
00298       this.radioSendRec.TabIndex = 0;
00299       this.radioSendRec.Text = "Recoverable";
00300       //
00301       // btnCancel
00302       //
00303       this.btnCancel.Location = new System.Drawing.Point(224, 408);
00304       this.btnCancel.Name = "btnCancel";
00305       this.btnCancel.Size = new System.Drawing.Size(104, 32);
00306       this.btnCancel.TabIndex = 9;
00307       this.btnCancel.Text = "Cancel";
00308       this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
00309       //
00310       // picture1
00311       //
00312       this.picture1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
00313       this.picture1.Location = new System.Drawing.Point(16, 8);
00314       this.picture1.Name = "picture1";
00315       this.picture1.Size = new System.Drawing.Size(383, 257);
00316       this.picture1.TabIndex = 0;
00317       this.picture1.TabStop = false;
00318       this.picture1.Paint += new System.Windows.Forms.PaintEventHandler(this.picture1_Paint);
00319       this.picture1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.picture1_MouseUp);
00320       this.picture1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.picture1_MouseMove);
00321       this.picture1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.picture1_MouseDown);
00322       //
00323       // btnConnect
00324       //
00325       this.btnConnect.Location = new System.Drawing.Point(96, 408);
00326       this.btnConnect.Name = "btnConnect";
00327       this.btnConnect.Size = new System.Drawing.Size(104, 32);
00328       this.btnConnect.TabIndex = 8;
00329       this.btnConnect.Text = "OK";
00330       this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
00331       //
00332       // lblRemoteComputer
00333       //
00334       this.lblRemoteComputer.Location = new System.Drawing.Point(16, 336);
00335       this.lblRemoteComputer.Name = "lblRemoteComputer";
00336       this.lblRemoteComputer.Size = new System.Drawing.Size(144, 24);
00337       this.lblRemoteComputer.TabIndex = 5;
00338       this.lblRemoteComputer.Text = "Send drawing to computer:";
00339       //
00340       // Form1
00341       //
00342       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00343       this.ClientSize = new System.Drawing.Size(413, 450);
00344       this.Controls.AddRange(new System.Windows.Forms.Control[] {
00345                                       this.groupConnectionMode,
00346                                       this.textChars,
00347                                       this.btnCancel,
00348                                       this.btnConnect,
00349                                       this.lblDSConnection,
00350                                       this.textFriendComputer,
00351                                       this.groupSendType,
00352                                       this.btnAttach,
00353                                       this.textFriendName,
00354                                       this.lblRemoteQueue,
00355                                       this.picture1,
00356                                       this.lblRemoteComputer});
00357       this.Name = "Form1";
00358       this.Text = "Form1";
00359       this.groupConnectionMode.ResumeLayout(false);
00360       this.groupSendType.ResumeLayout(false);
00361       this.ResumeLayout(false);
00362
00363     }
00364     #endregion
00365
00366     /// <summary>
00367     /// The main entry point for the application.
00368     /// </summary>
00369     [STAThread]
00370     static void Main()
00371     {
00372       string strResult;
00373
00374       //
00375       // Get the name of the local drawing queue
00376       //
00377       InputBox dlg = new InputBox();
00378       dlg.ShowDialog();
00379       //
00380       // strResult holds the name of my drawing queue
00381       //
00382       strResult = dlg.textBoxName.Text.ToString().ToUpper();
00383       if ((!dlg.bResult) || (strResult == "")) return;
00384
00385       Form1 F;
00386       F = new Form1();
00387       F.strName = strResult;
00388       F.Text = "Listening to: " + strResult;
00389
00390       F.textChars.Enabled = false;
00391       F.picture1.Enabled = false;
00392
00393       //
00394       // Check if we are running on a DS Enabled machine. This can be found in the Registry.
00395       //
00396       Microsoft.Win32.RegistryKey hKey;
00397       Int32 iWG;
00398       try
00399       {
00400         hKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MSMQ\Parameters");
00401         iWG = (System.Int32)hKey.GetValue(@"Workgroup");
00402         Registry.LocalMachine.Close();
00403         if (iWG == 0)
00404         {
00405           F.bDSEnabled = true;
00406         }
00407         else
00408         {
00409           F.bDSEnabled = false;
00410         }
00411       }
00412       catch(Exception e)
00413       {
00414         F.bDSEnabled = true;
00415       }
00416
00417       if (F.bDSEnabled)
00418       {
00419         F.btnAttach.Visible = false;
00420         F.groupSendType.Visible = false;
00421         F.lblRemoteComputer.Visible=false;
00422         F.lblRemoteQueue.Visible=false;
00423         F.textFriendComputer.Visible=false;
00424         F.textFriendName.Visible=false;
00425       }
00426       else
00427       {
00428         F.bDirectMode = true;
00429         F.lblDSConnection.Text = "MODE: Workgroup";
00430         F.groupConnectionMode.Visible = false;
00431         F.btnCancel.Visible = false;
00432         F.btnConnect.Visible = false;
00433
00434         try
00435         {
00436           F.qMe=MessageQueue.Create(@".\private$\" + F.strName);
00437           F.qMe.Label = F.strName;
00438           F.qMe.Category = new System.Guid(guidDraw);
00439         }
00440         catch(MessageQueueException MQE)
00441         {
00442           F.qMe = new MessageQueue();
00443           F.qMe.Path = @".\private$\" + strResult;
00444         }
00445         //
00446         // Start Async - Receiving
00447         //
00448         F.qMe.Formatter = new ActiveXMessageFormatter();
00449         F.qMe.ReceiveCompleted  += new ReceiveCompletedEventHandler(F.qMe_ReceiveCompleted);
00450         F.qMe.BeginReceive();
00451       }
00452
00453       Application.Run(F);
00454     }
00455
00456     //
00457     // Picture Box mouse handlers events
00458     //
00459     private void picture1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
00460     {
00461       if ((e.Button!=MouseButtons.Left) || (e.X <= 0) || (e.Y <= 0)) return;
00462
00463       iLastX = e.X;
00464       iLastY = e.Y;
00465     }
00466
00467     private void picture1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
00468     {
00469       if ((e.Button!=MouseButtons.Left) || (e.X <= 0) || (e.Y <= 0)) return;
00470
00471       Util.line lineToDraw = new Util.line();
00472       lineToDraw.XFrom=iLastX;
00473       lineToDraw.YFrom=iLastY;
00474       lineToDraw.XTo=e.X;
00475       lineToDraw.YTo=e.Y;
00476       AddLine(lineToDraw,picture1Graphics);
00477       iLastX=e.X;
00478       iLastY=e.Y;
00479
00480       if (qFriend == null) return;
00481
00482       System.Messaging.Message SendMsg;
00483       SendMsg = new System.Messaging.Message();
00484       SendMsg.Formatter = new ActiveXMessageFormatter();
00485       SendMsg.Priority=MessagePriority.Normal;
00486       SendMsg.Body=HP.LineToString(lineToDraw.XFrom,
00487                      lineToDraw.YFrom,
00488                      lineToDraw.XTo,
00489                      lineToDraw.YTo);
00490       SendMsg.Label=lineToDraw.XFrom.ToString()+","+
00491                   lineToDraw.YFrom.ToString()+" To "+
00492                   lineToDraw.XTo.ToString()+","+
00493                   lineToDraw.YTo.ToString();
00494       SendMsg.Recoverable = radioSendRec.Checked;
00495       qFriend.Send(SendMsg);
00496
00497     }
00498     //
00499     // Clear the display
00500     //
00501     private void picture1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
00502     {
00503       if (e.Button!=MouseButtons.Right) return;
00504
00505       picture1Graphics.Clear(picture1.BackColor);
00506       lines.Clear();
00507       textChars.Text = "";
00508     }
00509
00510     //
00511     // Lines managments functions
00512     //
00513
00514     private void DrawLine(Util.line lineToDraw,System.Drawing.Graphics PG)
00515     {
00516       PG.DrawLine(BlackPen,
00517             lineToDraw.XFrom,
00518             lineToDraw.YFrom,
00519             lineToDraw.XTo,
00520             lineToDraw.YTo);
00521     }
00522
00523     private void AddLine(Util.line lineToDraw,System.Drawing.Graphics PG)
00524     {
00525       DrawLine(lineToDraw,PG);
00526       lines.Add(lineToDraw);
00527     }
00528
00529     //
00530     // Characters drawing
00531     //
00532
00533     private void textChars_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
00534     {
00535             if (qFriend == null) return;
00536
00537       System.Messaging.Message SendMsg;
00538       SendMsg = new System.Messaging.Message();
00539       SendMsg.Formatter = new ActiveXMessageFormatter();
00540       SendMsg.Priority=MessagePriority.AboveNormal;
00541       SendMsg.Body=e.KeyChar.ToString();
00542       SendMsg.Label="Key: "+e.KeyChar.ToString();
00543       SendMsg.Recoverable = radioSendRec.Checked;
00544       qFriend.Send(SendMsg);
00545     }
00546
00547     private void DrawChar(string strCharToDraw)
00548     {
00549       if (strCharToDraw == "\b")
00550       { // backspace
00551         if (textChars.Text.Length>0)
00552         {
00553           textChars.Text = textChars.Text.Substring(0,textChars.Text.Length -1);
00554         }
00555       }
00556       else
00557       {
00558         textChars.Text=textChars.Text+strCharToDraw;
00559       }
00560       return;
00561     }
00562
00563     //
00564     // Start sending messages to a friend
00565     //
00566
00567     private void btnAttach_Click(object sender, System.EventArgs e)
00568     {
00569       MessageQueue[] mqlist;
00570       MessageQueueCriteria mqCriteria;
00571
00572       if (textFriendName.Text == "")
00573       {
00574         MessageBox.Show("Please fill in queue name.","Missing value");
00575         return;
00576       }
00577
00578       textFriendName.Text = textFriendName.Text.ToUpper();
00579
00580       if (!bDirectMode)
00581       {
00582         //
00583         // Standard Connection mode = Working with public queues
00584         //
00585
00586         mqCriteria = new MessageQueueCriteria();
00587         mqCriteria.Label=textFriendName.Text;
00588         mqCriteria.Category = new System.Guid(guidDraw);
00589         try
00590         {
00591           mqlist = MessageQueue.GetPublicQueues(mqCriteria);
00592         }
00593         catch(MessageQueueException MQE)
00594         {
00595           MessageBox.Show("An error occurred in locating the queue. ("+MQE.Message+")","C#_Draw");
00596           this.Close();
00597           return;
00598         }
00599         if (mqlist.Length == 0)
00600         {
00601           MessageBox.Show("Unable to locate queue.","C#_DRAW");
00602           return;
00603         }
00604         qFriend = mqlist[0];
00605         this.Text= strName + " - Connected to " + textFriendName.Text;
00606       }
00607       else
00608       {
00609
00610         if (textFriendComputer.Text == "")
00611         {
00612           MessageBox.Show("Please fill in computer name.","Missing value");
00613           return;
00614         }
00615
00616         textFriendComputer.Text = textFriendComputer.Text.ToUpper();
00617
00618         /*
00619         When working in direct mode, we must use private queues. We are unable
00620         to know whether a given private queue on another computer exists or not,
00621         so here we will just assume that it does. To make the application more robust,
00622         an acknowledgement queue should be created on the local computer, and
00623         a request for acknowledgement messages should be added to the messages sent.
00624         Then the application can notify the user when a negative acknoledgement (NACK)
00625         message is received.
00626         */
00627
00628         qFriend = new MessageQueue("FormatName:DIRECT=OS:" +
00629                        textFriendComputer.Text +
00630                                  @"\PRIVATE$\"+textFriendName.Text);
00631         this.Text = @".\PRIVATE$\"+strName + " - Connected to " +
00632               textFriendComputer.Text + @"\PRIVATE$\"+textFriendName.Text;
00633       }
00634       textChars.Enabled = true;
00635       picture1.Enabled = true;
00636       btnAttach.Enabled = false;
00637       return;
00638     }
00639
00640     //
00641     // Repainting the display
00642     //
00643     private void picture1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
00644     {
00645       int i;
00646       for (i=0;i<lines.Count;i++)
00647       {
00648         DrawLine((Util.line)lines[i],e.Graphics);
00649       }
00650     }
00651     private void btnConnect_Click(object sender, System.EventArgs e)
00652     {
00653       MessageQueue[] mqlist;
00654       MessageQueueCriteria mqCriteria;
00655       Cursor TempCursor;
00656
00657       bDirectMode = radioDSDisabled.Checked;
00658       TempCursor = this.Cursor;
00659       this.Cursor = Cursors.WaitCursor;
00660
00661       if (radioDSDisabled.Checked)
00662       { // User wants to use a private queue (direct connection).
00663         try
00664         {
00665           qMe=MessageQueue.Create(@".\private$\" + strName);
00666           qMe.Label = strName;
00667           qMe.Category = new System.Guid(guidDraw);
00668
00669         }
00670         catch(MessageQueueException MQE)
00671         {
00672           qMe = new MessageQueue();
00673           qMe.Path = @".\private$\" + strName;
00674         }
00675       }
00676       else
00677       { // The user wants to use a public queue (standard mode)
00678         // so query the direcotry service for a public queue with the
00679         // user-specified name.
00680         mqCriteria = new MessageQueueCriteria();
00681         mqCriteria.Label=strName;
00682         mqCriteria.Category = new System.Guid(guidDraw);
00683         try
00684         {
00685           mqlist = MessageQueue.GetPublicQueues(mqCriteria);
00686         }
00687         catch(MessageQueueException MQE)
00688         {
00689           MessageBox.Show("An error occurred in locating the queue. ("+MQE.Message+")","C#_Draw");
00690           this.Close();
00691           return;
00692         }
00693         // If no such queue then create one
00694         if (mqlist.Length == 0)
00695         {
00696           try
00697           {
00698             MessageQueue.Create(@".\"+strName);
00699           }
00700           catch(MessageQueueException MQE)
00701           {
00702             MessageBox.Show("An error occurred in creating the queue. ("+MQE.Message+")","C#_Draw");
00703             this.Close();
00704             return;
00705           }
00706           qMe = new MessageQueue();
00707           qMe.Path = @".\"+strName;
00708           qMe.Label = strName;
00709           qMe.Category = new System.Guid(guidDraw);
00710         }
00711         else
00712         {
00713           qMe=mqlist[0];
00714         }
00715       }
00716
00717       // Start receiving
00718
00719       qMe.Formatter = new ActiveXMessageFormatter();
00720       qMe.ReceiveCompleted  += new ReceiveCompletedEventHandler(this.qMe_ReceiveCompleted);
00721       qMe.BeginReceive();
00722
00723       groupConnectionMode.Visible = false;
00724       btnConnect.Visible=false;
00725       btnCancel.Visible=false;
00726
00727       btnAttach.Visible=true;
00728       groupSendType.Visible=true;
00729       lblRemoteQueue.Visible=true;
00730       textFriendName.Visible=true;
00731
00732       if (radioDSDisabled.Checked)
00733       {
00734         lblRemoteComputer.Visible=true;
00735         textFriendComputer.Visible=true;
00736       }
00737
00738       this.Cursor = TempCursor;
00739       // Anyway, on the local computer, the connection to the Directory
00740       // service remains available
00741       lblDSConnection.Text = "MODE: Domain";
00742     }
00743
00744     //
00745     // Message receiving handler
00746     //
00747     private void qMe_ReceiveCompleted(object sender, System.Messaging.ReceiveCompletedEventArgs e)
00748     {
00749       Util.line lineToDraw = new Util.line();
00750       MessageQueue mq = (MessageQueue)sender;
00751       System.Messaging.Message m = mq.EndReceive(e.AsyncResult);
00752       if (m.Body.ToString().Length==1)
00753       { // Draw a char
00754         DrawChar(m.Body.ToString());
00755       }
00756       else
00757       { // Draw a line
00758         HP.StringToLine(m.Body.ToString(),ref lineToDraw);
00759         AddLine(lineToDraw,picture1Graphics);
00760       }
00761       mq.BeginReceive();
00762     }
00763     private void btnCancel_Click(object sender, System.EventArgs e)
00764     {
00765       this.Close();
00766     }
00767
00768     private void textFriendComputer_TextChanged(object sender, System.EventArgs e)
00769     {
00770       btnAttach.Enabled = true;
00771     }
00772
00773     private void textFriendName_TextChanged(object sender, System.EventArgs e)
00774     {
00775       btnAttach.Enabled = true;
00776     }
00777
00778
00779   }
00780 }
00781
00782
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/staticnode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

staticnode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CStaticNode class.  This is the Snap-in's
00014 //                top level node
00015 //
00016
00017
00018 #ifndef _CLASS_CSTATICNODE_
00019 #define _CLASS_CSTATICNODE_
00020
00021 #include "Globals.h"
00022 #include "BaseNode.h"          // For NODE_PROPERTIES
00023 #include "LListImpl.h"
00024
00025 class CDeviceNode;             // References
00026 class CComponentData;
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CStaticNode : public CBaseNode
00031 {
00032   public:
00033     CStaticNode();
00034     virtual ~CStaticNode();
00035
00036     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00037
00038
00039   // Virtual methods
00040   public:
00041     ULONG   GetNodeType() { return NODETYPE_STATIC; }
00042     GUID&   GetNodeGUID() { return m_thisGUID; }
00043
00044     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00045     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00046     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00047
00048   ///////////////////////////////////////////////////////////////////////////
00049   // Notification handlers
00050   public:
00051     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00052     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00053     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00054     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00055
00056     HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00057             { return E_NOTIMPL; }
00058
00059     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00060             { return E_NOTIMPL; }
00061
00062   /////////////////////////////////////////////////////////////////////////
00063   //  Context Menu methods
00064   //
00065   public:
00066     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00067     HRESULT Command( long lCommandID );
00068
00069
00070   /////////////////////////////////////////////////////////////////////////
00071   //  Toolbar methods
00072   //
00073   public:
00074     HRESULT ControlbarNotify( LPARAM nArg, LPARAM lParam, LONG_PTR pCompData );
00075
00076
00077   ///////////////////////////////////////////////////////////////////////////
00078   // Private helpers
00079   private:
00080     HRESULT  DeleteScopeItems( LPCONSOLENAMESPACE2 ipCNS );
00081     HRESULT  InsertScopeItems( LPCONSOLENAMESPACE2 ipCNS );
00082     HRESULT  RefreshNodeList();
00083     VOID     RemoveNodes();
00084
00085   ///////////////////////////////////////////////////////////////////////////
00086   // Public helpers
00087   public:
00088     HRESULT  AddDeviceNode( NODE_PROPERTIES* pProperties );
00089     VOID     ToggleStatus( LPDATAOBJECT ipDataObject );
00090     HWND     GetMessageWnd() { return m_hMessageWnd; }
00091
00092     static LRESULT CALLBACK StaticNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00093
00094   private:
00095     static GUID      m_thisGUID;
00096     HSCOPEITEM       m_hStaticNode;
00097     CComponentData*  m_pCompData;
00098     HWND             m_hMessageWnd;        // Our message handler
00099
00100     CLListImpl<CDeviceNode*,CDeviceNode*>  m_NodeList;
00101
00102   public:
00103     HWND             m_hAddDeviceDlg;      // Instance of AddDeviceDlg
00104
00105 };
00106
00107 #endif //_CLASS_CSTATICNODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/sdkdiff.h Source File

  • Begin
  • sdkdiff

sdkdiff.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #ifndef __SDKDIFF_H__
00012 #define __SDKDIFF_H__
00013
00014 /*
00015
00016  * sdkdiff - file and directory comparisons
00017  *              FOR INTRODUCTORY NOTES ON IMPLEMENTATION SEE SDKDIFF.C
00018  *
00019  *      sdkdiff.h - user-interface definitions, and application-wide global
00020  *                  declarations.
00021  */
00022
00023 /* application-wide variables -------------------------------------*/
00024
00025 /* this is the section name in the win.ini file to which we
00026  * write profile info
00027  */
00028 #define APPNAME szSdkDiff
00029 extern const CHAR szSdkDiff[];
00030
00031 /* Map profile calls to the registry
00032  */
00033 #include "profile.h"
00034
00035 /* a gmem_init() heap shared by the app. call gmem_get to alloc. */
00036 extern HANDLE hHeap;
00037
00038 /* the instance handle for this app. needed by anyone who uses resources
00039  * such as dialogs
00040  */
00041 extern HINSTANCE hInst;
00042
00043 extern HWND hwndClient;
00044 extern HWND hwndRCD;
00045
00046 /* global option flags-------------------------------------------  */
00047
00048 /* which files do we show in outline mode ? all, changed... */
00049 extern int outline_include;
00050
00051 /* which files do we show in expand mode ? all, different, moved... */
00052 extern int expand_include;
00053
00054 /* outline_include is an OR of the following */
00055 #define INCLUDE_SAME            0x01
00056 #define INCLUDE_DIFFER          0x02
00057 #define INCLUDE_LEFTONLY        0x04
00058 #define INCLUDE_RIGHTONLY       0x08
00059
00060 /* expand_include is an OR of the previous (except for INCLUDE_DIFFER)
00061    AND the following */
00062 #define INCLUDE_MOVEDLEFT       0x10
00063 #define INCLUDE_MOVEDRIGHT      0x20
00064 #define INCLUDE_SIMILARLEFT     0x40
00065 #define INCLUDE_SIMILARRIGHT    0x80
00066
00067 /* bitwise OR of all flags */
00068 #define INCLUDE_ALL             0xFF
00069
00070 /* do we ignore blanks during the line-by-line diff ? */
00071 extern BOOL ignore_blanks;
00072
00073 /* do we show whitespace characters ? */
00074 extern BOOL show_whitespace;
00075
00076 /* which line numbers do we show - left original, right original or none ?*/
00077 extern int line_numbers;
00078
00079 /* what lines do we show in expand mode - all, left only, right only ? */
00080 extern int expand_mode;
00081
00082 /* TRUE if marked compitems are to be excluded from the view */
00083 extern BOOL hide_markedfiles;
00084
00085
00086 // tab expansion width in characters
00087 extern int g_tabwidth;
00088
00089 extern BOOL TrackLeftOnly;
00090 extern BOOL TrackRightOnly;
00091 extern BOOL TrackDifferent;
00092 extern BOOL TrackSame;
00093 extern BOOL TrackReadonly;
00094
00095 /*--- colour scheme ----------------------------------------------  */
00096
00097 /* outline */
00098 extern DWORD rgb_outlinehi;
00099
00100 /* expand view */
00101 extern DWORD rgb_leftfore;
00102 extern DWORD rgb_leftback;
00103 extern DWORD rgb_rightfore;
00104 extern DWORD rgb_rightback;
00105 extern DWORD rgb_mleftfore;
00106 extern DWORD rgb_mleftback;
00107 extern DWORD rgb_mrightfore;
00108 extern DWORD rgb_mrightback;
00109
00110 /* bar window */
00111 extern DWORD rgb_barleft;
00112 extern DWORD rgb_barright;
00113 extern DWORD rgb_barcurrent;
00114
00115 extern BOOL bJapan;  /* TRUE if primary language is Japanese */
00116 extern BOOL bDBCS;   /* TRUE if primary language is Japanese/Korean/Chinese */
00117
00118 /* -- display layout constants---------------------------------------*/
00119
00120 /* percentage of width of window taken by bar display (when visible) */
00121 #define BAR_WIN_WIDTH   10
00122
00123 /* following are horizontal positions within the bar window, expressed
00124  * in percent of the width of the bar window
00125  */
00126 #define L_POS_START     10      /* start of left position marker */
00127 #define L_POS_WIDTH     5       /* width of left position marker */
00128 #define R_POS_START     80      /* start of right position marker */
00129 #define R_POS_WIDTH     5       /* width of right position marker */
00130
00131 #define L_UNMATCH_START 30      /* start of left bar for unmatched section */
00132 #define L_UNMATCH_WIDTH 10      /* width of above */
00133 #define R_UNMATCH_START 60      /* start of right bar for unmatch section */
00134 #define R_UNMATCH_WIDTH 10      /* width of right unmatched section marker */
00135 #define L_MATCH_START   30      /* start of left bar for matched section */
00136 #define L_MATCH_WIDTH   10      /* width of left bar for matched section */
00137 #define R_MATCH_START   60      /* start of right bar for matched section */
00138 #define R_MATCH_WIDTH   10      /* width of right bar for matched section */
00139
00140
00141
00142
00143 /* sdkdiff.c functions */
00144
00145 #ifdef trace
00146 void APIENTRY Trace_File(LPSTR msg);     /* dump msg into Sdkdiff.trc */
00147 #endif
00148
00149
00150 /* if you are about to put up a dialog box or in fact process input in any way
00151    on any thread other than the main thread - or if you MIGHT be on a thread other
00152    than the main thread, then you must call this function with TRUE before doing
00153    it and with FALSE immediately afterwards.  Otherwise you will get one of a
00154    number of flavours of not-very-responsiveness
00155 */
00156 void sdkdiff_UI(BOOL bAttach);
00157
00158 /* peek the message queue. return TRUE if an abort request is pending */
00159 BOOL Poll(void);                /* true if abort pending */
00160
00161 /* set the text for the 'names' field (central box) on the status bar */
00162 void SetNames(LPSTR names);
00163
00164 /* set the status field (left field) on the status bar */
00165 void SetStatus(LPSTR state);
00166
00167 /* dlg procs */
00168 int FAR PASCAL FindDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
00169 int FAR PASCAL GoToLineDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
00170
00171 /* in bar.c */
00172 BOOL InitBarClass(HINSTANCE hInstance);
00173 void BarDrawPosition(HWND hwndBar, HDC hdcIn, BOOL bErase);
00174
00175 /*-- private messages -- */
00176
00177 /* send this to the main window. return value is the VIEW handle */
00178 #define TM_CURRENTVIEW  WM_USER
00179
00180
00181 /* --- synchronisation ----------------------------------------- */
00182
00183 /*
00184  * the WIN32 version spawns worker threads to do time-consuming actions.
00185  * this causes a possible conflict with the UI thread when accessing the
00186  * BUSY flag.
00187  *
00188  * to protect against this we have a critical section. The UI thread
00189  * will get this before checking/changing the Busy flag,
00190  * The worker thread will get this before Busy flag* changes.
00191  *
00192  */
00193
00194 //CRITICAL_SECTION CSSdkdiff;
00195
00196 extern BOOL __BERR;
00197
00198 #define TRACE_ERROR(msg,flag) ( sdkdiff_UI(TRUE),                      \
00199                                 __BERR = Trace_Error(hwndClient, msg, flag),       \
00200                                 sdkdiff_UI(FALSE),                     \
00201                                 __BERR                                 \
00202                               )
00203
00204 #endif
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/CascadeEC/cascadeec.Cpp Source File

  • Com
  • Services
  • Events
  • EventNews
  • CascadeEC

cascadeec.Cpp

Go to the documentation of this file.
00001 // CascadeEC.cpp : Implementation of DLL Exports.
00002
00003
00004 // Note: Proxy/Stub Information
00005 //      To build a separate proxy/stub DLL,
00006 //      run nmake -f CascadeECps.mk in the project directory.
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 #include <initguid.h>
00011 #include "CascadeEC.h"
00012
00013 #include "CascadeEC_i.c"
00014 #include "Cascade.h"
00015
00016
00017 CComModule _Module;
00018
00019 BEGIN_OBJECT_MAP(ObjectMap)
00020 OBJECT_ENTRY(CLSID_CascadeEC, CCascade)
00021 END_OBJECT_MAP()
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // DLL Entry Point
00025
00026 extern "C"
00027 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00028 {
00029     if (dwReason == DLL_PROCESS_ATTACH)
00030     {
00031         _Module.Init(ObjectMap, hInstance, &LIBID_CASCADEECLib);
00032         DisableThreadLibraryCalls(hInstance);
00033     }
00034     else if (dwReason == DLL_PROCESS_DETACH)
00035         _Module.Term();
00036     return TRUE;    // ok
00037 }
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // Used to determine whether the DLL can be unloaded by OLE
00041
00042 STDAPI DllCanUnloadNow(void)
00043 {
00044     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00045 }
00046
00047 /////////////////////////////////////////////////////////////////////////////
00048 // Returns a class factory to create an object of the requested type
00049
00050 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00051 {
00052     return _Module.GetClassObject(rclsid, riid, ppv);
00053 }
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // DllRegisterServer - Adds entries to the system registry
00057
00058 STDAPI DllRegisterServer(void)
00059 {
00060     // registers object, typelib and all interfaces in typelib
00061     return _Module.RegisterServer(TRUE);
00062 }
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // DllUnregisterServer - Removes entries from the system registry
00066
00067 STDAPI DllUnregisterServer(void)
00068 {
00069     return _Module.UnregisterServer(TRUE);
00070 }
00071
00072
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/DirectorySearch.cpp Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

DirectorySearch.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       DirectorySearch.cpp
00008 //
00009 //  Contents:   IDirectorySearch usage
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #include "stdafx.h"
00015 #include "ADQI.h"
00016 #include "DirectorySearch.h"
00017 #include "ads.h"
00018
00019 #ifdef _DEBUG
00020 #define new DEBUG_NEW
00021 #undef THIS_FILE
00022 static char THIS_FILE[] = __FILE__;
00023 #endif
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // CDlgIDirectorySearch dialog
00027
00028
00029 CDlgIDirectorySearch::CDlgIDirectorySearch(LPUNKNOWN pUnk, CWnd* pParent /*=NULL*/)
00030   : CDialog(CDlgIDirectorySearch::IDD, pParent)
00031 {
00032   //{{AFX_DATA_INIT(CDlgIDirectorySearch)
00033   m_sFilter = _T("");
00034   m_bEnableFilter = FALSE;
00035   m_nTimeOut = 0;
00036   m_bCacheResult = FALSE;
00037   m_nPageSize = 0;
00038   m_sSortOn = _T("");
00039   m_nTimeLimit = 0;
00040   m_nSizeLimit = 0;
00041   m_bAsynch = FALSE;
00042   m_bAttrib = FALSE;
00043   m_nDeref = -1;
00044   //}}AFX_DATA_INIT
00045   HRESULT hr;
00046   m_pSearch = NULL;
00047   hr = pUnk->QueryInterface( IID_IDirectorySearch, (void **) &m_pSearch );
00048   if ( !SUCCEEDED(hr) )
00049   {
00050     AfxMessageBox(_T("Fatal Error! QI for IDirectorySearch failed"));
00051     return;
00052   }
00053   pUnk->Release();
00054
00055
00056
00057 }
00058
00059
00060 CDlgIDirectorySearch::~CDlgIDirectorySearch()
00061 {
00062   if ( m_pSearch )
00063   {
00064     m_pSearch->Release();
00065   }
00066 }
00067
00068 void CDlgIDirectorySearch::DoDataExchange(CDataExchange* pDX)
00069 {
00070   CDialog::DoDataExchange(pDX);
00071   //{{AFX_DATA_MAP(CDlgIDirectorySearch)
00072   DDX_Control(pDX, IDC_ATTRIBUTE, m_cAttrList);
00073   DDX_Control(pDX, IDC_LISTVIEW, m_cListView);
00074   DDX_Control(pDX, IDC_CHASEREFERRAL, m_cChaseReferrals);
00075   DDX_Control(pDX, IDC_CACHERESULTS, m_cCacheResult);
00076   DDX_Control(pDX, IDC_SEARCHSCOPE, m_CADsSearchScope);
00077   DDX_Control(pDX, IDC_ENABLED, m_cEnableFilter);
00078   DDX_Control(pDX, IDC_EXECUTE, m_cExecute);
00079   DDX_Control(pDX, IDC_FILTER, m_cFilter);
00080   DDX_Text(pDX, IDC_FILTER, m_sFilter);
00081   DDX_Check(pDX, IDC_ENABLED, m_bEnableFilter);
00082   DDX_Text(pDX, IDC_TIMEOUT, m_nTimeOut);
00083   DDX_Check(pDX, IDC_CACHERESULTS, m_bCacheResult);
00084   DDX_Text(pDX, IDC_PAGESIZE, m_nPageSize);
00085   DDX_Text(pDX, IDC_SORTON, m_sSortOn);
00086   DDX_Text(pDX, IDC_TIMELIMIT, m_nTimeLimit);
00087   DDX_Text(pDX, IDC_SIZELIMIT, m_nSizeLimit);
00088   DDX_Check(pDX, IDC_ASYNCH, m_bAsynch);
00089   DDX_Check(pDX, IDC_ATTRIBONLY, m_bAttrib);
00090   DDX_CBIndex(pDX, IDC_DEREF, m_nDeref);
00091   //}}AFX_DATA_MAP
00092 }
00093
00094
00095 BEGIN_MESSAGE_MAP(CDlgIDirectorySearch, CDialog)
00096   //{{AFX_MSG_MAP(CDlgIDirectorySearch)
00097   ON_BN_CLICKED(IDC_EXECUTE, OnExecute)
00098   ON_EN_CHANGE(IDC_FILTER, OnChangeFilter)
00099   ON_BN_CLICKED(IDC_ENABLED, OnEnabled)
00100   ON_NOTIFY(NM_DBLCLK, IDC_LISTVIEW, OnDblClickListView)
00101   //}}AFX_MSG_MAP
00102 END_MESSAGE_MAP()
00103
00104 /////////////////////////////////////////////////////////////////////////////
00105 // CDlgIDirectorySearch message handlers
00106  //
00107
00108 ////////////////////////////////////////////
00109 // OnExecute
00110 // Demonstrate:
00111 // IDirectorySearch::ExecuteSearch
00112 // IDirectorySearch::GetNextRow
00113 // IDirectorySearch::GetColumn
00114 // IDirectorySearch::SetSearchPreference
00115 //
00116 /////////////////////////////////////////////
00117 void CDlgIDirectorySearch::OnExecute()
00118 {
00119   ASSERT( m_pSearch );
00120   CWaitCursor wait;
00121
00122   UpdateData(TRUE); // Get data from the Dialog Box
00123   HRESULT hr;
00124   ADS_SEARCH_HANDLE hSearch;
00125   ADS_SEARCH_COLUMN col;
00126   CString s;
00127   int idx=0;
00128   int nCount;
00129   LPWSTR *pszAttr=NULL;
00130   POSITION pos;
00131   USES_CONVERSION;
00132
00133
00134
00135
00136
00137   /////////////////////////////////
00138   // Reset the Total Number
00139   //////////////////////////////////
00140   SetDlgItemText( IDC_TOTAL, _T(""));
00141
00142
00143   /////////////////////////////////////////////
00144   // Get the attribute list, and preparing..
00145   ///////////////////////////////////////////
00146   CStringList sAttrList;
00147   m_cListView.DeleteAllItems(); // Reset the UI
00148
00149     while( m_cListView.DeleteColumn(0))
00150   {
00151     ;
00152   }
00153
00154   //////////////////////////////////////////////////
00155   // Preparing for attribute list
00156   // and columns to display
00157   CString sTemp;
00158   m_cAttrList.GetWindowText(s);
00159
00160   // we need to add adspath, so that we can refer to this object later when user dblclk the item
00161   if ( !s.IsEmpty() )
00162   {
00163     sTemp = s;
00164     sTemp.MakeLower();
00165     if ( s.Find(_T("adspath"),0) == -1 )
00166     {
00167       s += _T(",ADsPath");
00168     }
00169   }
00170
00171   // convert to string list for easy manipulation
00172   StringToStringList( s, sAttrList );
00173
00174
00175
00176   nCount = sAttrList.GetCount();
00177   idx=0;
00178   if ( nCount )
00179   {
00180
00181     pszAttr = (LPWSTR*) AllocADsMem( nCount * sizeof(LPWSTR));
00182
00183     pos = sAttrList.GetHeadPosition();
00184     while ( pos != NULL )
00185     {
00186       s = sAttrList.GetAt(pos);
00187       pszAttr[idx] = T2OLE(s);
00188       sAttrList.GetNext(pos );
00189       idx++;
00190     }
00191   }
00192   else
00193   {
00194     nCount = -1;
00195   }
00196
00197
00198
00199
00200
00201
00202   /////////////////////////////////////////
00203   // BEGIN  Set the preferences
00204   ///////////////////////////////////////
00205   DWORD dwCountPref = 0;
00206   ADS_SEARCHPREF_INFO prefInfo[ MAX_SEARCH_PREF ];
00207   ADS_SORTKEY *pSortKey = NULL;
00208
00209   if ( m_bEnableFilter == FALSE )
00210   {
00211     // Reset the preference
00212     m_pSearch->SetSearchPreference( prefInfo, dwCountPref );
00213   }
00214   else // Preferences are specified
00215   {
00216     ////////////////////////
00217     // Timeout Pref
00218     ////////////////////////////
00219     if ( m_nTimeOut != 0 )
00220     {
00221       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_TIMEOUT;
00222       prefInfo[dwCountPref].vValue.dwType = ADSTYPE_INTEGER;
00223       prefInfo[dwCountPref].vValue.Integer = m_nTimeOut;
00224       dwCountPref++;
00225     }
00226
00227     //////////////////////////////
00228     // Search Scope
00229     /////////////////////////////
00230     idx = m_CADsSearchScope.GetCurSel();
00231     if ( idx != CB_ERR )
00232     {
00233       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00234       prefInfo[dwCountPref].vValue.dwType = ADSTYPE_INTEGER;
00235       prefInfo[dwCountPref].vValue.Integer = idx;
00236       dwCountPref++;
00237     }
00238
00239
00240
00241     ///////////////////////////////////////////////////
00242     // Cache Result. The default is to cache the result
00243     /////////////////////////////////////////////////
00244     if ( !m_bCacheResult )
00245     {
00246       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00247       prefInfo[dwCountPref].vValue.dwType = ADSTYPE_BOOLEAN;
00248       prefInfo[dwCountPref].vValue.Boolean = FALSE;
00249       dwCountPref++;
00250     }
00251
00252     //////////////////////////////////////////////////
00253     // Page Size
00254     ///////////////////////////////////////////////////
00255     if ( m_nPageSize > 0 )
00256     {
00257       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_PAGESIZE;
00258       prefInfo[dwCountPref].vValue.dwType = ADSTYPE_INTEGER;;
00259       prefInfo[dwCountPref].vValue.Integer = m_nPageSize;
00260       dwCountPref++;
00261     }
00262
00263
00264     ////////////////////////////////////////////////
00265     // Chase Referrals
00266     ///////////////////////////////////////////////
00267     idx = m_cChaseReferrals.GetCurSel();
00268     if ( idx != CB_ERR )
00269     {
00270       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_CHASE_REFERRALS;
00271       prefInfo[dwCountPref].vValue.dwType = ADSTYPE_INTEGER;
00272       switch( idx )
00273       {
00274       case 0:
00275          prefInfo[dwCountPref].vValue.Integer = ADS_CHASE_REFERRALS_NEVER;
00276          break;
00277       case 1:
00278          prefInfo[dwCountPref].vValue.Integer = ADS_CHASE_REFERRALS_SUBORDINATE;
00279          break;
00280       case 2:
00281          prefInfo[dwCountPref].vValue.Integer = ADS_CHASE_REFERRALS_EXTERNAL;
00282          break;
00283       default:
00284          prefInfo[dwCountPref].vValue.Integer = ADS_CHASE_REFERRALS_EXTERNAL;
00285
00286       }
00287
00288       dwCountPref++;
00289     }
00290
00291
00292     ///////////////////////////////////////////////
00293     // Sort On
00294     ////////////////////////////////////////////////
00295     if ( !m_sSortOn.IsEmpty() )
00296     {
00297       CStringList sList;
00298       UINT nCount;
00299       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_SORT_ON;
00300       prefInfo[dwCountPref].vValue.dwType = ADSTYPE_PROV_SPECIFIC;
00301         StringToStringList( m_sSortOn, sList );
00302
00303       nCount = sList.GetCount();
00304       if ( nCount >  0 )
00305       {
00306         POSITION pos;
00307         pos= sList.GetHeadPosition();
00308         pSortKey = (ADS_SORTKEY *) LocalAlloc( LMEM_FIXED | LMEM_ZEROINIT, sizeof(ADS_SORTKEY) * nCount );
00309         idx = 0;
00310         while( pos != NULL )
00311         {
00312           pSortKey[idx].pszAttrType = T2OLE(sList.GetAt(pos));
00313           pSortKey[idx].pszReserved = NULL;
00314           pSortKey[idx].fReverseorder =0;
00315
00316           // Next
00317           idx++;
00318           sList.GetNext( pos );
00319         }
00320
00321         prefInfo[dwCountPref].vValue.ProviderSpecific.dwLength = sizeof(ADS_SORTKEY) * nCount;
00322         prefInfo[dwCountPref].vValue.ProviderSpecific.lpValue = (LPBYTE) pSortKey;
00323         dwCountPref++;
00324       }
00325
00326     }
00327
00328     //////////////////////////////////////////////
00329     // Size Limit
00330     //////////////////////////////////////////////
00331     if ( m_nSizeLimit > 0 )
00332     {
00333             prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_SIZE_LIMIT;
00334             prefInfo[dwCountPref].vValue.dwType = ADSTYPE_INTEGER;
00335             prefInfo[dwCountPref].vValue.Integer = m_nSizeLimit;
00336       dwCountPref++;
00337     }
00338
00339
00340     //////////////////////////////////////////////////
00341     // A Synchronous
00342     ///////////////////////////////////////////////////
00343     if ( m_bAsynch )
00344     {
00345       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_ASYNCHRONOUS;
00346             prefInfo[dwCountPref].vValue.dwType = ADSTYPE_BOOLEAN;
00347             prefInfo[dwCountPref].vValue.Integer = TRUE;
00348       dwCountPref++;
00349
00350     }
00351
00352     /////////////////////////////////////////////////////
00353     //  Attribute Type Only
00354     //////////////////////////////////////////////////////
00355     if ( m_bAttrib )
00356     {
00357       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_ATTRIBTYPES_ONLY;
00358             prefInfo[dwCountPref].vValue.dwType = ADSTYPE_BOOLEAN;
00359             prefInfo[dwCountPref].vValue.Integer = TRUE;
00360       dwCountPref++;
00361
00362     }
00363
00364
00365     /////////////////////////////////////////////////////
00366     //  Derefence Alias
00367     //////////////////////////////////////////////////////
00368     if ( m_nDeref != CB_ERR )
00369     {
00370       prefInfo[dwCountPref].dwSearchPref = ADS_SEARCHPREF_DEREF_ALIASES;
00371             prefInfo[dwCountPref].vValue.dwType = ADSTYPE_INTEGER;
00372             prefInfo[dwCountPref].vValue.Integer = m_nDeref;
00373       dwCountPref++;
00374
00375
00376     }
00377
00378
00379
00380     ///////////////////////////////////////////////
00381     // Now Set the selected preferences
00382     //////////////////////////////////////////////
00383     hr = m_pSearch->SetSearchPreference( prefInfo, dwCountPref );
00384
00385
00386
00387   }
00388
00389   /////////////////////////////////////////
00390   // END  Set the preferences
00391   ///////////////////////////////////////
00392
00393
00394
00395
00396
00397   ////////////////////////////////////////
00398   // Execute the Search
00399   //////////////////////////////////////
00400   DWORD dwCount=0;
00401
00402   hr = m_pSearch->ExecuteSearch(T2OLE(m_sFilter), pszAttr, nCount, &hSearch );
00403
00404
00405   ////////////////////////////////
00406   //// cleanup
00407   ////////////////////////////////
00408   if ( pszAttr )
00409   {
00410       FreeADsMem( pszAttr );
00411   }
00412
00413   if ( pSortKey )
00414   {
00415     LocalFree( pSortKey );
00416   }
00417
00418
00419
00420
00421   if ( !SUCCEEDED(hr) )
00422   {
00423     AfxMessageBox(GetErrorMessage(hr));
00424     return;
00425   }
00426
00427   ////////////////////////////////////////////////////////
00428   // Enumerate the rows
00429   ////////////////////////////////////////////////////////
00430
00431   sAttrList.RemoveAll();
00432
00433
00434
00435
00436   /////////////////////////////////////////////////////////
00437   // Retrieve the column names returned from the server
00438   ///////////////////////////////////////////////////////////
00439   LPWSTR pszColumn;
00440   hr = m_pSearch->GetFirstRow( hSearch );
00441
00442   if ( !SUCCEEDED(hr) )
00443   {
00444     return;
00445   }
00446
00447
00448
00449   idx=0;
00450   while( (hr=m_pSearch->GetNextColumnName( hSearch, &pszColumn )) != S_ADS_NOMORE_COLUMNS )
00451   {
00452     s = OLE2T( pszColumn );
00453     m_cListView.InsertColumn(idx, s, LVCFMT_LEFT, 150 ); // adding columns to the UI
00454     sAttrList.AddTail(s);
00455     FreeADsMem( pszColumn );
00456     idx++;
00457   }
00458
00459
00460
00461   /////////////////////////////////////////////
00462   // Start iterating the result set
00463   ////////////////////////////////////////////
00464   int nCol;
00465   CStringList sValueList;
00466
00467     do
00468   {
00469     nCol=0;
00470     pos = sAttrList.GetHeadPosition();
00471
00472     while( pos != NULL )
00473     {
00474
00475         s = sAttrList.GetAt(pos); //column name
00476
00477       // Get the Name and display it in the list
00478       hr = m_pSearch->GetColumn( hSearch, T2OLE(s), &col );
00479       if ( SUCCEEDED(hr) )
00480       {
00481         s =_T("");
00482
00483         if ( col.dwADsType != ADSTYPE_INVALID ) // if we request for attrib only, no value will be returned
00484         {
00485           ADsToStringList(col.pADsValues, col.dwNumValues, sValueList );
00486           StringListToString( sValueList, s );
00487         }
00488
00489         if ( nCol )
00490         {
00491           m_cListView.SetItemText(0,nCol, s);
00492         }
00493         else
00494         {
00495            m_cListView.InsertItem(0, s);
00496         }
00497
00498         m_pSearch->FreeColumn( &col );
00499       }
00500
00501
00502
00503
00504       nCol++;
00505       sAttrList.GetNext(pos);
00506
00507     }
00508     dwCount++;
00509     /////////////////////////////
00510     //Display the total so far
00511     ////////////////////////////////
00512     s.Format("%ld object(s)", dwCount );
00513     SetDlgItemText( IDC_TOTAL, s );
00514
00515   }
00516   while( (hr=m_pSearch->GetNextRow( hSearch)) != S_ADS_NOMORE_ROWS );
00517
00518
00519
00520   m_pSearch->CloseSearchHandle( hSearch );
00521
00522
00523
00524
00525
00526
00527 }
00528
00529 void CDlgIDirectorySearch::OnChangeFilter()
00530 {
00531   BOOL bExecEnabled;
00532
00533   bExecEnabled = m_cFilter.GetWindowTextLength() > 0 ? TRUE :FALSE;
00534   m_cExecute.EnableWindow( bExecEnabled );
00535 }
00536
00537 BOOL CDlgIDirectorySearch::OnInitDialog()
00538 {
00539   CDialog::OnInitDialog();
00540
00541   // Initialize to a default search
00542   m_cFilter.SetWindowText(_T("(objectClass=*)"));
00543   m_cAttrList.SetWindowText(_T("cn"));
00544
00545   OnChangeFilter();
00546   OnEnabled();
00547
00548   m_cCacheResult.SetCheck( 1 );
00549
00550
00551
00552
00553
00554   return TRUE;  // return TRUE unless you set the focus to a control
00555                 // EXCEPTION: OCX Property Pages should return FALSE
00556 }
00557
00558 void CDlgIDirectorySearch::OnEnabled()
00559 {
00560    UpdateData(TRUE);
00561
00562    // Enable/Disable Edit Boxes
00563    GetDlgItem( IDC_TIMEOUT )->EnableWindow(m_bEnableFilter);
00564    GetDlgItem( IDC_SEARCHSCOPE )->EnableWindow(m_bEnableFilter);
00565    GetDlgItem( IDC_PAGESIZE )->EnableWindow(m_bEnableFilter);
00566    GetDlgItem( IDC_SORTON )->EnableWindow(m_bEnableFilter);
00567    GetDlgItem( IDC_CHASEREFERRAL )->EnableWindow(m_bEnableFilter);
00568    GetDlgItem( IDC_TIMELIMIT )->EnableWindow(m_bEnableFilter);
00569    GetDlgItem( IDC_SIZELIMIT )->EnableWindow(m_bEnableFilter);
00570    GetDlgItem( IDC_ASYNCH )->EnableWindow(m_bEnableFilter);
00571    GetDlgItem( IDC_CACHERESULTS )->EnableWindow(m_bEnableFilter);
00572    GetDlgItem( IDC_ATTRIBONLY )->EnableWindow(m_bEnableFilter);
00573    GetDlgItem( IDC_DEREF )->EnableWindow(m_bEnableFilter);
00574
00575
00576    // Enabled/Disabled Texts
00577    GetDlgItem( IDC_TIMEOUT_TXT )->EnableWindow(m_bEnableFilter);
00578    GetDlgItem( IDC_SEARCHSCOPE_TXT )->EnableWindow(m_bEnableFilter);
00579    GetDlgItem( IDC_PAGESIZE_TXT )->EnableWindow(m_bEnableFilter);
00580    GetDlgItem( IDC_SORTON_TXT )->EnableWindow(m_bEnableFilter);
00581    GetDlgItem( IDC_CHASEREFERRAL_TXT )->EnableWindow(m_bEnableFilter);
00582    GetDlgItem( IDC_TIMELIMIT_TXT )->EnableWindow(m_bEnableFilter);
00583    GetDlgItem( IDC_SIZELIMIT_TXT )->EnableWindow(m_bEnableFilter);
00584    GetDlgItem( IDC_DEREF_TXT )->EnableWindow(m_bEnableFilter);
00585
00586
00587
00588 }
00589
00590 void CDlgIDirectorySearch::OnOK()
00591 {
00592   CDialog::OnOK();
00593 }
00594
00595
00596
00597
00598 void CDlgIDirectorySearch::OnDblClickListView(NMHDR* pNMHDR, LRESULT* pResult)
00599 {
00600    int idx;
00601    *pResult = 0;
00602
00603
00604    idx = m_cListView.GetNextItem(-1, LVNI_SELECTED);
00605    if ( idx == -1 )
00606    {
00607      return;
00608    }
00609
00610    CHeaderCtrl *pHeader;
00611    int nCount;
00612      pHeader = m_cListView.GetHeaderCtrl();
00613    if ( !pHeader )
00614    {
00615      return;
00616    }
00617    nCount = pHeader->GetItemCount();
00618
00619
00620    // Get the text
00621    CString s;
00622    s = m_cListView.GetItemText( idx, nCount-1 );
00623
00624    if ( !s.GetLength() )
00625    {
00626      return;
00627    }
00628
00629    USES_CONVERSION;
00630    HRESULT hr;
00631    IUnknown *pUnk=NULL;
00632    CString sUserName;
00633
00634
00635     hr = App->ADsOpenObject( T2OLE( s ), IID_IUnknown, (void**) &pUnk );
00636
00637
00638     /////////////////////////////////////
00639     // Bring up the IADs Dialog
00640     ///////////////////////////////////////
00641     if ( SUCCEEDED(hr) )
00642     {
00643       pUnk->AddRef();
00644       CDlgIADs dlg( pUnk );
00645       dlg.DoModal();
00646       pUnk->Release();
00647     }
00648     else
00649     {
00650       AfxMessageBox(GetErrorMessage(hr));
00651     }
00652
00653
00654
00655
00656 }
00657
00658
00659
00660
00661
00662
00663 ////////////////////////////////////////////////////////////////////
00664 //
00665 // CADsSearch
00666 // This is a convient C++ wrapper for IDirectorySearch
00667 //
00668 /////////////////////////////////////////////////////////////////////
00669 CADsSearch::CADsSearch( IADs *pADs )
00670 {
00671   CADsSearch();
00672   SetInterface( pADs );
00673
00674 }
00675
00676 CADsSearch::CADsSearch()
00677 {
00678    m_pSearch = NULL;
00679    m_hSearch = NULL;
00680    m_dwPrefCount = 0;
00681
00682 }
00683
00684
00685
00686 HRESULT CADsSearch::SetInterface( IUnknown *pUnk )
00687 {
00688   if ( pUnk != NULL )
00689   {
00690     HRESULT hr;
00691     //////////////////////////////////////////
00692     // Remove the current search if any
00693     ////////////////////////////////////////
00694     if ( m_pSearch )
00695     {
00696       if ( m_hSearch )
00697       {
00698         m_pSearch->CloseSearchHandle( m_hSearch );
00699       }
00700       m_pSearch->Release();
00701     }
00702
00703
00704     m_pSearch = NULL;
00705     m_hSearch = NULL;
00706     m_dwPrefCount = 0;
00707     hr = pUnk->QueryInterface( IID_IDirectorySearch, (LPVOID*) &m_pSearch );
00708     pUnk->Release();
00709     return hr;
00710   }
00711
00712   return E_UNEXPECTED;
00713
00714 }
00715
00716
00717
00718
00719 CADsSearch::~CADsSearch()
00720 {
00721   if ( m_pSearch )
00722   {
00723     if ( m_hSearch )
00724     {
00725       m_pSearch->CloseSearchHandle( m_hSearch );
00726     }
00727     m_pSearch->Release();
00728   }
00729 }
00730
00731 HRESULT CADsSearch::GetNextRow()
00732 {
00733   HRESULT hr;
00734   if ( !m_pSearch || !m_hSearch)
00735   {
00736     return E_UNEXPECTED;
00737   }
00738   hr = m_pSearch->GetNextRow( m_hSearch );
00739   return hr;
00740 }
00741
00742 void CADsSearch::AddColumn( LPCTSTR pszColumn )
00743 {
00744   ASSERT( pszColumn );
00745
00746   m_sColumnList.AddTail( pszColumn );
00747 }
00748
00749
00750 HRESULT CADsSearch::SetScope( ADS_SCOPEENUM flag )
00751 {
00752
00753   if ( !m_pSearch )
00754   {
00755     return E_UNEXPECTED;
00756   }
00757
00758
00759   ADS_SEARCHPREF_INFO info;
00760
00761   info.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00762   info.vValue.dwType = ADSTYPE_INTEGER;
00763   info.vValue.Integer = flag;
00764   return AddSearchPref( &info );
00765
00766 }
00767
00768
00769 HRESULT CADsSearch::SetAttribOnly( BOOL bAttribOnly )
00770 {
00771   ADS_SEARCHPREF_INFO info;
00772
00773   info.dwSearchPref = ADS_SEARCHPREF_ATTRIBTYPES_ONLY;
00774     info.vValue.dwType = ADSTYPE_BOOLEAN;
00775     info.vValue.Integer = bAttribOnly;
00776
00777   return AddSearchPref( &info );
00778
00779 }
00780
00781 HRESULT CADsSearch::SetPageSize( UINT nPageSize )
00782 {
00783   ADS_SEARCHPREF_INFO info;
00784
00785   info.dwSearchPref = ADS_SEARCHPREF_PAGESIZE;
00786     info.vValue.dwType = ADSTYPE_INTEGER;
00787     info.vValue.Integer = nPageSize;
00788
00789   return AddSearchPref( &info );
00790 }
00791
00792
00793
00794 // TODO: More Options...
00795
00796 HRESULT CADsSearch::AddSearchPref( PADS_SEARCHPREF_INFO pSearchPrefs, DWORD dwNumPref )
00797 {
00798   PADS_SEARCHPREF_INFO pInfo;
00799
00800   for( UINT idx=0; idx < dwNumPref; idx++ )
00801   {
00802     pInfo = FindSearchPrefence( pSearchPrefs->dwSearchPref );
00803     if ( pInfo )
00804     {
00805       *(pInfo) = *(pSearchPrefs);
00806     }
00807     else
00808     {
00809       if ( m_dwPrefCount == MAX_SEARCH_PREF )
00810       {
00811         return E_FAIL;
00812       }
00813
00814       m_srchInfo[m_dwPrefCount] = *(pSearchPrefs);
00815       m_dwPrefCount++;
00816     }
00817
00818     pSearchPrefs++;
00819   }
00820   return S_OK;
00821 }
00822
00823 PADS_SEARCHPREF_INFO CADsSearch::FindSearchPrefence( ADS_SEARCHPREF pref )
00824 {
00825   for(UINT idx=0; idx < MAX_SEARCH_PREF; idx++ )
00826   {
00827       if( m_srchInfo[idx].dwSearchPref == pref )
00828     {
00829        return &m_srchInfo[idx];
00830     }
00831   }
00832
00833   return NULL;
00834 }
00835
00836 HRESULT CADsSearch::Execute( LPCTSTR pszFilter )
00837 {
00838   USES_CONVERSION;
00839   HRESULT hr;
00840
00841
00842   if ( !m_pSearch  )
00843   {
00844     return E_UNEXPECTED;
00845   }
00846
00847   m_hSearch = NULL;
00848
00849   //////////////////////////////////////////////
00850   // Set the search preference if any
00851   ///////////////////////////////////////////////
00852   if ( m_dwPrefCount )
00853   {
00854     hr = m_pSearch->SetSearchPreference( m_srchInfo, m_dwPrefCount);
00855     if ( !SUCCEEDED(hr) )
00856     {
00857       return hr;
00858     }
00859   }
00860
00861   if ( m_sColumnList.IsEmpty() )
00862   {
00863     hr = m_pSearch->ExecuteSearch( T2OLE(pszFilter), NULL, -1, &m_hSearch );
00864   }
00865   else // Columns is specified
00866   {
00867     unsigned int count, xx;
00868     LPWSTR    *pColumns = NULL;
00869     POSITION  pos;
00870     CString   s;
00871
00872     count = m_sColumnList.GetCount();
00873     pColumns = (LPWSTR*)AllocADsMem( sizeof(LPWSTR)*count);
00874     pos = m_sColumnList.GetHeadPosition();
00875     for(xx=0; xx < count; xx++)
00876     {
00877       s = m_sColumnList.GetAt(pos);
00878       pColumns[xx] = T2OLE(s);
00879       m_sColumnList.GetNext(pos);
00880     }
00881
00882     hr = m_pSearch->ExecuteSearch( T2OLE(pszFilter), pColumns, count, &m_hSearch );
00883     if ( pColumns )
00884     {
00885       FreeADsMem( pColumns );
00886     }
00887
00888   }
00889
00890
00891   return hr;
00892
00893 }
00894
00895
00896
00897 HRESULT CADsSearch::GetColumn( UINT nIndex, CStringList &sList )
00898 {
00899   CString s;
00900
00901   if ( m_sColumnList.IsEmpty() )
00902   {
00903     return E_FAIL;
00904   }
00905
00906   POSITION pos;
00907   pos = m_sColumnList.FindIndex( nIndex );
00908
00909   if ( pos == NULL )
00910   {
00911     return E_FAIL;
00912   }
00913
00914   s = m_sColumnList.GetAt(pos);
00915   return GetColumn( s, sList );
00916
00917 }
00918
00919
00920 HRESULT CADsSearch::GetColumn( LPCTSTR pszCol, PADS_SEARCH_COLUMN pCol )
00921 {
00922    LPWSTR pszAttrName;
00923    USES_CONVERSION;
00924
00925    pszAttrName = T2OLE(pszCol);
00926
00927    return m_pSearch->GetColumn( m_hSearch, pszAttrName, pCol );
00928
00929 }
00930
00931 HRESULT CADsSearch::FreeColumn( PADS_SEARCH_COLUMN pCol )
00932 {
00933    return m_pSearch->FreeColumn( pCol );
00934 }
00935
00936
00937
00938 HRESULT CADsSearch::GetColumn(CString &sCol, CStringList &sList )
00939 {
00940    LPWSTR pszAttrName;
00941    ADS_SEARCH_COLUMN col;
00942    HRESULT hr;
00943    USES_CONVERSION;
00944    CString s;
00945
00946
00947    pszAttrName = T2OLE(sCol);
00948
00949    hr = m_pSearch->GetColumn( m_hSearch, pszAttrName, &col );
00950
00951    if ( !SUCCEEDED(hr) )
00952    {
00953      return hr;
00954    }
00955
00956    hr =  FormatColumn( &col, sList );
00957    m_pSearch->FreeColumn( &col );
00958
00959
00960    return hr;
00961
00962 }
00963
00964
00965 HRESULT CADsSearch::FormatColumn(PADS_SEARCH_COLUMN pColumn, CStringList &sList)
00966 {
00967
00968   ADsToStringList( pColumn->pADsValues, pColumn->dwNumValues, sList );
00969     return S_OK;
00970
00971 }
00972
00973
00974
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/DataSource/sdksamplestoragesystem.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • DataSource

sdksamplestoragesystem.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            SDKSampleStorageSystem.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #include "stdafx.h"
00013 #include "SDKSampleStoragePlugin.h"
00014 #include "SDKSampleStorageSystem.h"
00015
00016 #include <float.h>
00017 /////////////////////////////////////////////////////////////////////////////
00018 //
00019 // [CSDKSampleStorageSystem]
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022 CSDKSampleStorageSystem::CSDKSampleStorageSystem()
00023 {
00024     m_pServerContext = NULL;
00025     m_pClassFactory = NULL;
00026 } // End of CSDKSampleStorageSystem.
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 CSDKSampleStorageSystem::~CSDKSampleStorageSystem()
00030 {
00031     if ( m_pServerContext )
00032     {
00033         m_pServerContext->Release();
00034         m_pServerContext = NULL;
00035     }
00036     if ( m_pClassFactory )
00037     {
00038         m_pClassFactory->Release();
00039         m_pClassFactory = NULL;
00040     }
00041 }
00042
00043
00044
00045
00046
00047 /////////////////////////////////////////////////////////////////////////////
00048 //
00049 // [OpenDataContainer]
00050 //
00051 /////////////////////////////////////////////////////////////////////////////
00052 HRESULT STDMETHODCALLTYPE
00053 CSDKSampleStorageSystem::OpenDataContainer(
00054                             IWMSCommandContext *pCommandContext,
00055                             IWMSContext *pUserContext,
00056                             IWMSContext *pPresentationContext,
00057                             LPWSTR pszContainerName,
00058                             DWORD dwFlags,
00059                             IWMSBufferAllocator *pBufferAllocator,
00060                             IWMSDataSourcePluginCallback *pCallback,
00061                             QWORD qwContext
00062                             )
00063 {
00064     HRESULT hr = S_OK;
00065     CSampleDataContainer *pDataContainer = NULL;
00066
00067     if ( ( NULL == pszContainerName )
00068         || ( NULL == pBufferAllocator )
00069         || ( NULL == pCallback ) )
00070     {
00071         // We are returning an error, so we cannot call the callback.
00072         return( E_INVALIDARG );
00073     }
00074
00075     pDataContainer = new CSampleDataContainer;
00076
00077     if ( NULL == pDataContainer )
00078     {
00079         hr = E_OUTOFMEMORY;
00080         goto abort;
00081     }
00082
00083     hr = pDataContainer->Initialize(
00084                             pUserContext,
00085                             pszContainerName,
00086                             dwFlags,
00087                             pBufferAllocator,
00088                             this,
00089                             pCallback,
00090                             qwContext
00091                             );
00092     if ( FAILED( hr ) )
00093     {
00094         goto abort;
00095     }
00096
00097 abort:
00098     if( NULL != pDataContainer )
00099     {
00100         pDataContainer->Release();
00101         pDataContainer = NULL;
00102     }
00103
00104     return( hr );
00105
00106
00107 } // End of OpenDataContainer.
00108
00109
00110
00111
00112
00113
00114 /////////////////////////////////////////////////////////////////////////////
00115 HRESULT STDMETHODCALLTYPE
00116 CSDKSampleStorageSystem::OpenDirectory(
00117                             IWMSCommandContext *pCommandContext,
00118                             IWMSContext *pUserContext,
00119                             IWMSContext *pPresentationContext,
00120                             LPWSTR pszContainerName,
00121                             DWORD dwFlags,
00122                             IWMSBufferAllocator *pBufferAllocator,
00123                             IWMSDataSourcePluginCallback *pCallback,
00124                             QWORD qwContext
00125                             )
00126 {
00127     HRESULT hr = S_OK;
00128     CSampleDirectory *pDirectory = NULL;
00129
00130     if( ( NULL == pszContainerName )
00131         || ( NULL == pCallback ) )
00132     {
00133         hr = E_INVALIDARG;
00134         goto abort;
00135     }
00136
00137     pDirectory = new CSampleDirectory;
00138     if( NULL == pDirectory )
00139     {
00140         hr = E_OUTOFMEMORY;
00141         goto abort;
00142     }
00143
00144     hr = pDirectory->Initialize(
00145                             pUserContext,
00146                             pszContainerName,
00147                             this,
00148                             pCallback,
00149                             qwContext
00150                             );
00151     if( FAILED( hr ) )
00152     {
00153         goto abort;
00154     }
00155
00156 abort:
00157     if( NULL != pDirectory )
00158     {
00159         pDirectory->Release();
00160         pDirectory = NULL;
00161     }
00162
00163     return( hr );
00164 } // OpenDirectory
00165
00166
00167
00168
00169
00170 /////////////////////////////////////////////////////////////////////////////
00171 //
00172 // [DeleteDataContainer]
00173 //
00174 /////////////////////////////////////////////////////////////////////////////
00175 HRESULT STDMETHODCALLTYPE
00176 CSDKSampleStorageSystem::DeleteDataContainer(
00177                         LPWSTR pszContainerName,
00178                         DWORD dwFlags,
00179                         IWMSDataSourcePluginCallback *pCallback,
00180                         QWORD qwContext
00181                         )
00182 {
00183     HRESULT hr = S_OK;
00184     BOOL fSuccess = TRUE;
00185
00186     if ( ( NULL == pszContainerName )
00187         || ( NULL == pCallback ) )
00188     {
00189         hr = E_INVALIDARG;
00190         goto abort;
00191     }
00192
00193     fSuccess = DeleteFile( pszContainerName );
00194     if ( !fSuccess )
00195     {
00196         hr = HRESULT_FROM_WIN32( GetLastError() );
00197         goto abort;
00198     }
00199
00200 abort:
00201     if ( NULL != pCallback )
00202     {
00203         // Ignore any error returned by the callback.
00204         pCallback->OnDeleteDataContainer( hr, qwContext );
00205         hr = S_OK; // any error is passed to the callback
00206     }
00207
00208     return( hr );
00209
00210 } // End of DeleteDataContainer.
00211
00212
00213
00214
00215 /////////////////////////////////////////////////////////////////////////////
00216 //
00217 // [GetDataContainerVersion]
00218 //
00219 /////////////////////////////////////////////////////////////////////////////
00220 HRESULT STDMETHODCALLTYPE
00221 CSDKSampleStorageSystem::GetDataContainerVersion(
00222                         IWMSCommandContext *pCommandContext,
00223                         IWMSContext *pUserContext,
00224                         IWMSContext *pPresContext,
00225                         LPWSTR pszContainerName,
00226                         DWORD dwFlags,
00227                         IWMSDataSourcePluginCallback *pCallback,
00228                         QWORD qwContext
00229                         )
00230 {
00231
00232     HRESULT hr = S_OK;
00233     DATE dateOriginLastModifiedTime;
00234     WIN32_FILE_ATTRIBUTE_DATA FileAttributeData;
00235     WIN32_FILE_ATTRIBUTE_DATA * pFileAttributeData;
00236     SYSTEMTIME stLastModifiedTime;
00237     IWMSDataContainerVersion *pVersion = NULL;
00238     QWORD qwFileSize = 0;
00239     BSTR bstrFileSize = NULL;
00240     WCHAR pszFileSize[65];
00241
00242     if ( ( NULL == pszContainerName )
00243         || ( NULL == pCallback ) )
00244     {
00245         // We are returning an error, so we cannot call the callback.
00246         return( E_INVALIDARG );
00247     }
00248
00249     if( !GetFileAttributesEx( pszContainerName + URL_SCHEME_LENGTH, GetFileExInfoStandard, &FileAttributeData ) )
00250     {
00251
00252         hr = HRESULT_FROM_WIN32( GetLastError() );
00253         goto abort;
00254     }
00255
00256     // can't get the DataContainerVersion for a directory
00257     if( FILE_ATTRIBUTE_DIRECTORY & FileAttributeData.dwFileAttributes )
00258     {
00259         hr = E_FAIL;
00260         goto abort;
00261     }
00262
00263     pFileAttributeData = &FileAttributeData;
00264
00265     //
00266     // Convert the last modified time from FILETIME to DATE format.
00267     //
00268     FileTimeToSystemTime( &pFileAttributeData->ftLastWriteTime, &stLastModifiedTime );
00269     SystemTimeToVariantTime( &stLastModifiedTime, &dateOriginLastModifiedTime );
00270
00271     //
00272     // A null pVersion means (a) we got an error early on or (b) the caller
00273     // only wants to get the current version.
00274     //
00275     hr = m_pClassFactory->CreateInstance( IID_IWMSDataContainerVersion,
00276                                           (void **) &pVersion );
00277     if( FAILED( hr ) )
00278     {
00279         goto abort;
00280     }
00281
00282     hr = pVersion->SetLastModifiedTime( dateOriginLastModifiedTime );
00283     if( FAILED( hr ) )
00284     {
00285         goto abort;
00286     }
00287
00288     hr = pVersion->SetExpirationTime( (double) DBL_MAX );
00289     if( FAILED( hr ) )
00290     {
00291         goto abort;
00292     }
00293
00294     //
00295     // everything allowed (this will be replaced with the VRoot setting)
00296     //
00297     hr = pVersion->SetCacheFlags( 0xffffffff );
00298     if( FAILED( hr ) )
00299     {
00300         goto abort;
00301     }
00302
00303     hr = pVersion->SetContentSize( pFileAttributeData->nFileSizeLow, pFileAttributeData->nFileSizeHigh );
00304     if( FAILED( hr ) )
00305     {
00306         goto abort;
00307     }
00308
00309     qwFileSize = MAKEQWORD( pFileAttributeData->nFileSizeLow, pFileAttributeData->nFileSizeHigh );
00310     _ui64tow( qwFileSize, (LPWSTR) pszFileSize, 10 );
00311     bstrFileSize = SysAllocString( (LPWSTR) pszFileSize );
00312     if( NULL == bstrFileSize )
00313     {
00314         hr = E_OUTOFMEMORY;
00315         goto abort;
00316     }
00317
00318     hr = pVersion->SetEntityTag( bstrFileSize );
00319     if( FAILED(hr) )
00320     {
00321         goto abort;
00322     }
00323 abort:
00324     // The HRESULT returned by the callback should be ignored.
00325     pCallback->OnGetDataContainerVersion(
00326                                         hr,
00327                                         pVersion,
00328                                         qwContext
00329                                         );
00330     hr = S_OK; // any error is passed to the callback
00331
00332     if( NULL != pVersion )
00333     {
00334         pVersion->Release();
00335         pVersion = NULL;
00336     }
00337     if( NULL != bstrFileSize )
00338     {
00339         SysFreeString( bstrFileSize );
00340         bstrFileSize = NULL;
00341     }
00342     // We called the callback, so we MUST return S_OK.
00343     return( S_OK );
00344 } // End of GetDataContainerVersion.
00345
00346
00347
00348
00349
00350
00351 /////////////////////////////////////////////////////////////////////////////
00352 //
00353 /////////////////////////////////////////////////////////////////////////////
00354 HRESULT STDMETHODCALLTYPE
00355 CSDKSampleStorageSystem::GetRootDirectories(
00356                             LPWSTR *pstrRootDirectoryList,
00357                             DWORD dwMaxRoots,
00358                             IWMSDataSourcePluginCallback *pCallback,
00359                             QWORD qwContext
00360                             )
00361 {
00362     HRESULT hr = S_OK;
00363     DWORD dwRootNum = 0;
00364     DWORD dwTotalNumRoots = 0;
00365     DWORD dwBufferSize = 0;
00366     WCHAR tempBuffer[3];
00367     WCHAR *pFullBuffer = NULL;
00368     WCHAR *pEndBuffer;
00369     WCHAR *pStartPath;
00370     WCHAR *pStopPath;
00371     WCHAR *pstrFile;
00372     DWORD dwPathNameLength;
00373     DWORD dwIndex;
00374
00375
00376     if( ( NULL == pstrRootDirectoryList )
00377         || ( NULL == pCallback ) )
00378     {
00379         return( E_INVALIDARG );
00380     }
00381
00382     // Find out how large the buffer should be.
00383     dwBufferSize = GetLogicalDriveStringsW( 1, tempBuffer );
00384     if( 0 == dwBufferSize )
00385     {
00386         hr = E_FAIL;
00387         goto abort;
00388     }
00389
00390     // Allocate a buffer.
00391     pFullBuffer = new WCHAR[ dwBufferSize + 2 ];
00392     if( NULL == pFullBuffer )
00393     {
00394         hr = E_OUTOFMEMORY;
00395         goto abort;
00396     }
00397
00398     ZeroMemory( pFullBuffer, ( dwBufferSize + 2 ) * sizeof( WCHAR ) );
00399
00400     // Get the actual data.
00401     dwBufferSize = GetLogicalDriveStringsW( dwBufferSize, pFullBuffer );
00402     if( 0 == dwBufferSize )
00403     {
00404         hr = E_FAIL;
00405         goto abort;
00406     }
00407
00408     // Each iteration extracts one root pathname.
00409     pStartPath = pFullBuffer;
00410     pEndBuffer = pFullBuffer + dwBufferSize;
00411     dwRootNum = 0;
00412     dwTotalNumRoots = 0;
00413     while ( pStartPath < pEndBuffer )
00414     {
00415         // Find the end of the current path. This is the next
00416         // NULL character.
00417         pStopPath = pStartPath;
00418         while ( ( *pStopPath ) && ( pStopPath < pEndBuffer ) )
00419         {
00420             pStopPath++;
00421         }
00422
00423         // If we found a non-empty path, then record it.
00424         if( pStopPath > pStartPath )
00425         {
00426             if( dwRootNum < dwMaxRoots )
00427             {
00428                 dwPathNameLength = (DWORD)(pStopPath - pStartPath);
00429
00430                 pstrFile = (LPWSTR) CoTaskMemAlloc( sizeof(WCHAR) * ( dwPathNameLength + URL_SCHEME_LENGTH + 1 ) );
00431                 if( NULL == pstrFile )
00432                 {
00433                     hr = E_OUTOFMEMORY;
00434                     goto abort;
00435                 }
00436
00437                 pstrFile[ URL_SCHEME_LENGTH + dwPathNameLength ] = L'\0';
00438
00439                 wcsncpy( pstrFile, URL_SCHEME, URL_SCHEME_LENGTH );
00440                 wcsncpy( pstrFile + URL_SCHEME_LENGTH, pStartPath, dwPathNameLength );
00441
00442                 if( L'\0' != pstrFile[ URL_SCHEME_LENGTH + dwPathNameLength ] )
00443                 {
00444                     hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
00445                     goto abort;
00446                 }
00447
00448                 pstrRootDirectoryList[dwRootNum] = pstrFile;
00449
00450                 dwRootNum++;
00451             } // copying a string.
00452
00453             dwTotalNumRoots++;
00454         } // recording a path.
00455
00456         // The next path starts just after the previous path.
00457         pStartPath = pStopPath + 1;
00458         if( ( NULL == *pStartPath ) || ( pStartPath >= pEndBuffer ) )
00459         {
00460             break;
00461         }
00462     } // extracting every path.
00463
00464
00465     // The HRESULT returned by the callback should be ignored.
00466     ( void ) pCallback->OnGetRootDirectories(
00467                             hr,
00468                             dwRootNum,
00469                             dwTotalNumRoots,
00470                             qwContext
00471                             );
00472     hr = S_OK; // any error is passed to the callback
00473
00474 abort:
00475     if( FAILED( hr ) )
00476     {
00477         for ( dwIndex = 0; dwIndex < dwRootNum; dwIndex++ )
00478         {
00479             if( NULL != pstrRootDirectoryList[dwIndex] )
00480             {
00481                 CoTaskMemFree( pstrRootDirectoryList[dwIndex] );
00482                 pstrRootDirectoryList[dwIndex] = NULL;
00483             }
00484         }
00485     }
00486     if( NULL != pFullBuffer )
00487     {
00488         delete [] pFullBuffer;
00489     }
00490
00491     return( hr );
00492 } // GetRootDirectories
00493
00494
00495
00496
00497
00498
00499 /////////////////////////////////////////////////////////////////////////////
00500 //
00501 /////////////////////////////////////////////////////////////////////////////
00502 HRESULT STDMETHODCALLTYPE
00503 CSDKSampleStorageSystem::GetDataSourceAttributes(
00504                             DWORD *pdwFlags
00505                             )
00506 {
00507     if ( NULL == pdwFlags )
00508     {
00509         return( E_INVALIDARG );
00510     }
00511
00512     *pdwFlags = WMS_DATA_CONTAINER_SUPPORTS_ENUMERATION;
00513     return( S_OK );
00514 } // GetDataSourceAttributes
00515
00516
00517
00518
00519 /////////////////////////////////////////////////////////////////////////////
00520 HRESULT STDMETHODCALLTYPE
00521 CSDKSampleStorageSystem::CreateDataSourceDirectory(
00522                         IWMSCommandContext *pCommandContext,
00523                         LPWSTR pszContainerName,
00524                         DWORD dwFlags,
00525                         IWMSDataSourcePluginCallback *pCallback,
00526                         QWORD qwContext
00527                         )
00528 {
00529     return( E_NOTIMPL );
00530 }
00531
00532
00533
00534
00535 /////////////////////////////////////////////////////////////////////////////
00536 HRESULT STDMETHODCALLTYPE
00537 CSDKSampleStorageSystem::DeleteDirectory(
00538                         LPWSTR pszContainerName,
00539                         DWORD dwFlags,
00540                         IWMSDataSourcePluginCallback *pCallback,
00541                         QWORD qwContext
00542                         )
00543 {
00544     return( E_NOTIMPL );
00545 }
00546
00547
00548
00549
00550
00551 /////////////////////////////////////////////////////////////////////////////
00552 //
00553 // [InitializePlugin]
00554 //
00555 /////////////////////////////////////////////////////////////////////////////
00556 HRESULT STDMETHODCALLTYPE
00557 CSDKSampleStorageSystem::InitializePlugin(
00558                         IWMSContext *pServerContext,
00559                         IWMSNamedValues *pNamedValues,
00560                         IWMSClassObject *pClassFactory
00561                         )
00562 {
00563     HRESULT hr = S_OK;
00564     SYSTEM_INFO sysInfo;
00565
00566     if ( ( NULL == pServerContext )
00567         || ( NULL == pClassFactory ) )
00568     {
00569
00570         return( E_INVALIDARG );
00571     }
00572
00573     // TODO: Initialize all storage system state
00574     GetSystemInfo( &sysInfo );
00575     m_dwPageSize = sysInfo.dwPageSize;
00576
00577
00578     m_pServerContext = pServerContext;
00579     m_pServerContext->AddRef();
00580
00581     m_pNamedValues = pNamedValues;
00582     m_pNamedValues->AddRef();
00583
00584     m_pClassFactory = pClassFactory;
00585     m_pClassFactory->AddRef();
00586
00587     return( hr );
00588 } // End of InitializePlugin.
00589
00590
00591 /////////////////////////////////////////////////////////////////////////////
00592 //
00593 // [ShutdownPlugin]
00594 //
00595 /////////////////////////////////////////////////////////////////////////////
00596 HRESULT STDMETHODCALLTYPE
00597 CSDKSampleStorageSystem::ShutdownPlugin()
00598 {
00599     if( NULL != m_pServerContext )
00600     {
00601         m_pServerContext->Release();
00602         m_pServerContext = NULL;
00603     }
00604
00605     if( NULL != m_pNamedValues )
00606     {
00607         m_pNamedValues->Release();
00608         m_pNamedValues = NULL;
00609     }
00610
00611     if( NULL != m_pClassFactory )
00612     {
00613         m_pClassFactory->Release();
00614         m_pClassFactory = NULL;
00615     }
00616
00617     return( S_OK );
00618 } // End Of ShutdownPlugin
00619
00620
00621 /////////////////////////////////////////////////////////////////////////////
00622 //
00623 // [EnablePlugin]
00624 //
00625 /////////////////////////////////////////////////////////////////////////////
00626 STDMETHODIMP
00627 CSDKSampleStorageSystem::EnablePlugin( long *pdwFlags, long *pdwHeartbeatPeriod )
00628 {
00629     if ( NULL == pdwFlags || NULL == pdwHeartbeatPeriod )
00630     {
00631         return ( E_POINTER );
00632     }
00633
00634     *pdwFlags = 0;
00635     *pdwHeartbeatPeriod = 0;
00636
00637     return ( S_OK );
00638 }
00639
00640
00641
00642 /////////////////////////////////////////////////////////////////////////////
00643 //
00644 // [GetCustomAdminInterface]
00645 //
00646 /////////////////////////////////////////////////////////////////////////////
00647 HRESULT STDMETHODCALLTYPE
00648 CSDKSampleStorageSystem::GetCustomAdminInterface( IDispatch **ppValue )
00649 {
00650     if ( NULL == ppValue )
00651     {
00652         return( E_INVALIDARG );
00653     }
00654
00655     *ppValue = NULL;
00656
00657     return( S_OK );
00658 }
00659
00660
00661
00662 /////////////////////////////////////////////////////////////////////////////
00663 //
00664 // [OnHeartbeat]
00665 //
00666 /////////////////////////////////////////////////////////////////////////////
00667 HRESULT STDMETHODCALLTYPE
00668 CSDKSampleStorageSystem::OnHeartbeat()
00669 {
00670     return( S_OK );
00671 } // End of OnHeartbeat.
00672
00673
00674 /////////////////////////////////////////////////////////////////////////////
00675 //
00676 // [DisablePlugin]
00677 //
00678 /////////////////////////////////////////////////////////////////////////////
00679 STDMETHODIMP
00680 CSDKSampleStorageSystem::DisablePlugin()
00681 {
00682     return ( S_OK );
00683 }
00684
00685
00686
00687
00688
00689
00690
00691 /////////////////////////////////////////////////////////////////////////////
00692 //
00693 //                              DATA CONTAINER
00694 //
00695 /////////////////////////////////////////////////////////////////////////////
00696
00697
00698
00699 /////////////////////////////////////////////////////////////////////////////
00700 //
00701 // [CSampleDataContainer]
00702 //
00703 /////////////////////////////////////////////////////////////////////////////
00704 CSampleDataContainer::CSampleDataContainer()
00705 {
00706     m_cRef = 1;
00707     m_pszPathName = NULL;
00708     m_hFile = INVALID_HANDLE_VALUE;
00709     m_pOwnerStorageSystem = NULL;
00710     InitializeCriticalSection( &m_CriticalSection );
00711 } // End of CSampleDataContainer.
00712
00713
00714
00715
00716 /////////////////////////////////////////////////////////////////////////////
00717 //
00718 // [~CSampleDataContainer]
00719 //
00720 /////////////////////////////////////////////////////////////////////////////
00721 CSampleDataContainer::~CSampleDataContainer()
00722 {
00723     Shutdown();
00724     DeleteCriticalSection( &m_CriticalSection );
00725 } // End of ~CSampleDataContainer.
00726
00727
00728
00729 /////////////////////////////////////////////////////////////////////////////
00730
00731 HRESULT CSampleDataContainer::Initialize(
00732                         IWMSContext *pUserContext,
00733                         LPWSTR pszContainerName,
00734                         DWORD dwFlags,
00735                         IWMSBufferAllocator *pBufferAllocator,
00736                         CSDKSampleStorageSystem *pOwnerStorageSystem,
00737                         IWMSDataSourcePluginCallback *pCallback,
00738                         QWORD qwContext
00739                         )
00740 {
00741
00742     HRESULT hr = S_OK;
00743     DWORD dwSDKSampleStorageSystemFlags = 0;
00744     CHAR *pResult =  NULL;
00745     DWORD cbDriveNameLen = 0;
00746     BOOL fSuccess = TRUE;
00747     DWORD dwOpenStyle = 0;
00748     CHAR *pszSDKSampleStorageSystemPathname = NULL;
00749     DWORD dwFileAccess = 0;
00750     DWORD dwSizeHigh = 0, dwError = 0, dwSizeLow = 0;
00751
00752     EnterCriticalSection( &m_CriticalSection );
00753
00754     // If this data container is already open, then don't open it again.
00755     if ( INVALID_HANDLE_VALUE != m_hFile )
00756     {
00757         hr = E_UNEXPECTED;
00758         goto abort;
00759     }
00760
00761     if ( ( NULL == pszContainerName )
00762         || ( NULL == pCallback )
00763         || ( NULL == pOwnerStorageSystem ) )
00764     {
00765         hr = E_INVALIDARG;
00766         goto abort;
00767     }
00768
00769     int cchNeeded = WideCharToMultiByte(
00770                         CP_ACP,
00771                         0,
00772                         pszContainerName,
00773                         -1,
00774                         NULL,
00775                         0,
00776                         NULL,
00777                         NULL
00778                         );
00779     if( 0 >= cchNeeded )
00780     {
00781         hr = HRESULT_FROM_WIN32( GetLastError() );
00782         goto abort;
00783     }
00784
00785     m_pszPathName = new CHAR[ cchNeeded ];
00786     if( NULL == m_pszPathName )
00787     {
00788         hr = E_OUTOFMEMORY;
00789         goto abort;
00790     }
00791
00792     int cchConverted =  WideCharToMultiByte(
00793                             CP_ACP,
00794                             0,
00795                             pszContainerName,
00796                             -1,
00797                             m_pszPathName,
00798                             cchNeeded,
00799                             NULL,
00800                             NULL
00801                             );
00802     if( cchConverted != cchNeeded )
00803     {
00804         delete [] m_pszPathName;
00805         m_pszPathName = NULL;
00806
00807         hr = E_UNEXPECTED;
00808         goto abort;
00809     }
00810
00811     m_pOwnerStorageSystem = pOwnerStorageSystem;
00812     pOwnerStorageSystem->AddRef();
00813
00814     if ( dwFlags & WMS_DATA_CONTAINER_CREATE_NEW_CONTAINER )
00815     {
00816         dwOpenStyle = OPEN_ALWAYS;
00817     }
00818     else
00819     {
00820         dwOpenStyle = OPEN_EXISTING;
00821     }
00822
00823     dwFileAccess = GENERIC_READ;
00824     if ( ( dwFlags & WMS_DATA_CONTAINER_WRITE_ACCESS )
00825         || ( dwFlags & WMS_DATA_CONTAINER_CREATE_NEW_CONTAINER ) )
00826     {
00827         dwFileAccess |= GENERIC_WRITE;
00828     }
00829
00830     pszSDKSampleStorageSystemPathname = m_pszPathName + URL_SCHEME_LENGTH;
00831
00832     m_hFile = CreateFileA(
00833                     pszSDKSampleStorageSystemPathname,
00834                     dwFileAccess,
00835                     FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
00836                     NULL,
00837                     dwOpenStyle,
00838                     dwSDKSampleStorageSystemFlags,
00839                     NULL
00840                     );
00841     if ( INVALID_HANDLE_VALUE == m_hFile )
00842     {
00843         hr = HRESULT_FROM_WIN32( GetLastError() );
00844         goto abort;
00845     }
00846     else
00847     {
00848         // Get the file type to see if we should open this or not.
00849         DWORD dwFileType = GetFileType( m_hFile );
00850
00851         if( FILE_TYPE_DISK != dwFileType )
00852         {
00853             hr = HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND );
00854             goto abort;
00855         }
00856     }
00857
00858     // Get the file size.
00859     dwSizeLow = GetFileSize( m_hFile, & dwSizeHigh ) ;
00860
00861     // If we failed ...
00862     if( ( dwSizeLow == 0xFFFFFFFF ) &&
00863         ( ( dwError = GetLastError() ) != NO_ERROR ) )
00864     {
00865         hr = HRESULT_FROM_WIN32( dwError );
00866         goto abort;
00867     }
00868     m_qwFileSize = MAKEQWORD( dwSizeLow, dwSizeHigh );
00869
00870     m_dwAlignment = 1;
00871     m_dwAlignmentLog2 = 0;
00872
00873 abort:
00874     if( FAILED(hr) && ( INVALID_HANDLE_VALUE != m_hFile ) )
00875     {
00876         // In a failure condition, ensure the file is closed
00877         CloseHandle( m_hFile );
00878         m_hFile = INVALID_HANDLE_VALUE;
00879     }
00880
00881     LeaveCriticalSection( &m_CriticalSection );
00882
00883     if ( NULL != pCallback )
00884     {
00885         // The HRESULT returned by the callback should be ignored.
00886         pCallback->OnOpenDataContainer( hr, this, qwContext );
00887         hr = S_OK; // any error is passed to the callback
00888     }
00889
00890     return( hr );
00891 }
00892
00893
00894 /////////////////////////////////////////////////////////////////////////////
00895 //
00896 // [Shutdown]
00897 //
00898 /////////////////////////////////////////////////////////////////////////////
00899 HRESULT
00900 CSampleDataContainer::Shutdown()
00901 {
00902     HRESULT hr = S_OK;
00903     BOOL fSuccess;
00904
00905     EnterCriticalSection( &m_CriticalSection );
00906
00907     if ( NULL != m_pszPathName )
00908     {
00909         delete m_pszPathName;
00910         m_pszPathName = NULL;
00911     }
00912
00913     if ( INVALID_HANDLE_VALUE != m_hFile )
00914     {
00915         fSuccess = CloseHandle( m_hFile );
00916         if ( !fSuccess )
00917         {
00918             DWORD nErr = GetLastError();
00919         }
00920
00921         m_hFile = INVALID_HANDLE_VALUE;
00922     }
00923
00924     if( NULL != m_pOwnerStorageSystem )
00925     {
00926         m_pOwnerStorageSystem->Release();
00927         m_pOwnerStorageSystem = NULL;
00928     }
00929
00930     LeaveCriticalSection( &m_CriticalSection );
00931     return( hr );
00932 } // End of Shutdown.
00933
00934
00935
00936
00937
00938
00939 /////////////////////////////////////////////////////////////////////////////
00940 inline
00941 STDMETHODIMP_( ULONG )
00942 CSampleDataContainer::AddRef()
00943 {
00944     return( InterlockedIncrement( &m_cRef ) );
00945 }
00946
00947
00948
00949
00950
00951 /////////////////////////////////////////////////////////////////////////////
00952 inline
00953 STDMETHODIMP_( ULONG )
00954 CSampleDataContainer::Release()
00955 {
00956     if ( 0 == InterlockedDecrement( &m_cRef ) )
00957     {
00958         delete this;
00959         return( 0 );
00960     }
00961
00962     return( 0xbad );
00963 } // End of Release.
00964
00965
00966
00967
00968
00969 /////////////////////////////////////////////////////////////////////////////
00970 /////////////////////////////////////////////////////////////////////////////
00971 STDMETHODIMP
00972 CSampleDataContainer::QueryInterface( REFIID riid, void **ppvObject )
00973 {
00974     if ( IID_IWMSDataContainer == riid )
00975     {
00976         *ppvObject = ( IWMSDataContainer * ) this;
00977         AddRef();
00978         return( S_OK );
00979     }
00980     else if ( IID_IUnknown == riid )
00981     {
00982         *ppvObject = ( IUnknown * ) this;
00983         AddRef();
00984         return( S_OK );
00985     }
00986
00987     *ppvObject = NULL;
00988     return( E_NOINTERFACE );
00989 } // End of QueryInterface.
00990
00991
00992
00993
00994
00995 /////////////////////////////////////////////////////////////////////////////
00996 //
00997 // [GetContainerFormat]
00998 //
00999 /////////////////////////////////////////////////////////////////////////////
01000 HRESULT STDMETHODCALLTYPE
01001 CSampleDataContainer::GetContainerFormat( GUID *pFormat )
01002 {
01003     if ( NULL == pFormat )
01004     {
01005         return( E_INVALIDARG );
01006     }
01007
01008     // Sample never knows the format of a file.
01009     *pFormat = IID_IWMSUnknownFormat;
01010     return( S_OK );
01011 } // End of GetContainerFormat.
01012
01013
01014
01015
01016
01017
01018 /////////////////////////////////////////////////////////////////////////////
01019 //
01020 // [GetDataSourcePlugin]
01021 //
01022 /////////////////////////////////////////////////////////////////////////////
01023 HRESULT STDMETHODCALLTYPE
01024 CSampleDataContainer::GetDataSourcePlugin(
01025                         IWMSDataSourcePlugin **ppDataSource
01026                         )
01027 {
01028     HRESULT hr = S_OK;
01029
01030     if ( NULL == ppDataSource )
01031     {
01032
01033         return( E_INVALIDARG );
01034     }
01035
01036     *ppDataSource = NULL;
01037
01038     EnterCriticalSection( &m_CriticalSection );
01039
01040     if ( NULL != m_pOwnerStorageSystem )
01041     {
01042         *ppDataSource = m_pOwnerStorageSystem;
01043         m_pOwnerStorageSystem->AddRef();
01044     }
01045     else
01046     {
01047         hr = E_UNEXPECTED;
01048     }
01049
01050     LeaveCriticalSection( &m_CriticalSection );
01051
01052     return( hr );
01053 } // End of GetDataSourcePlugin.
01054
01055
01056
01057
01058
01059
01060 /////////////////////////////////////////////////////////////////////////////
01061 //
01062 // [GetInfo]
01063 //
01064 /////////////////////////////////////////////////////////////////////////////
01065 HRESULT STDMETHODCALLTYPE
01066 CSampleDataContainer::GetInfo(
01067                         DWORD dwInfoValueId,
01068                         IWMSDataContainerCallback *pCallback,
01069                         QWORD qwContext
01070                         )
01071 {
01072     HRESULT hr = S_OK;
01073
01074     if ( NULL == pCallback )
01075     {
01076         return( E_INVALIDARG );
01077     }
01078     if ( WMS_DATA_CONTAINER_SIZE != dwInfoValueId )
01079     {
01080         return( E_NOTIMPL );
01081     }
01082
01083     EnterCriticalSection( &m_CriticalSection );
01084
01085     // If this data container is not open, then abort.
01086     if ( INVALID_HANDLE_VALUE != m_hFile )
01087     {
01088         // Ignore any error returned by the callback.
01089         ( void ) pCallback->OnGetInfo(
01090                         S_OK,
01091                         WMS_SEEKABLE_CONTAINER | WMS_LOCAL_DATA_CONTAINER,
01092                         m_qwFileSize,
01093                         qwContext
01094                         );
01095         hr = S_OK; // any error is passed to the callback
01096     }
01097     else
01098     {
01099         hr = E_UNEXPECTED;
01100     }
01101
01102     LeaveCriticalSection( &m_CriticalSection );
01103
01104     return( hr );
01105 } // End of GetInfo.
01106
01107 /////////////////////////////////////////////////////////////////////////////
01108
01109 HRESULT STDMETHODCALLTYPE
01110 CSampleDataContainer::GetTransferParameters(
01111                                 QWORD qwDesiredOffset,
01112                                 DWORD dwDesiredMinSize,
01113                                 DWORD dwDesiredMaxSize,
01114                                 QWORD *pqwOffset,
01115                                 DWORD *pdwSize,
01116                                 DWORD *pdwBufferAlignment
01117                                 )
01118 {
01119     HRESULT hr = S_OK;
01120
01121     if( ( NULL == pqwOffset )
01122         || ( NULL == pdwSize ) )
01123     {
01124         return( E_POINTER );
01125     }
01126
01127     if( ( dwDesiredMaxSize != 0 ) && ( dwDesiredMinSize != 0 ) && ( dwDesiredMaxSize < dwDesiredMinSize ) )
01128     {
01129         return( E_INVALIDARG );
01130     }
01131
01132     if( ( qwDesiredOffset == ~0 ) && ( dwDesiredMinSize == 0 ) )
01133     {
01134         return( E_INVALIDARG );
01135     }
01136
01137     EnterCriticalSection( &m_CriticalSection );
01138
01139     if( pdwBufferAlignment != NULL )
01140     {
01141         *pdwBufferAlignment = m_dwAlignment;
01142     }
01143
01144     if( dwDesiredMinSize != 0 )
01145     {
01146         // Round the offset down to the nearest sector boundary.
01147         *pqwOffset = ( qwDesiredOffset >> m_dwAlignmentLog2 ) << m_dwAlignmentLog2;
01148
01149         // We may have backed the offset up to the nearest sector.
01150         // Make sure we will still read all of the desired bytes.
01151         *pdwSize = dwDesiredMinSize + (DWORD) ( qwDesiredOffset - *pqwOffset );
01152         *pdwSize = ( ( *pdwSize + m_dwAlignment - 1 ) >> m_dwAlignmentLog2 ) << m_dwAlignmentLog2;
01153
01154         if( dwDesiredMaxSize != 0 )
01155         {
01156             if( dwDesiredMaxSize > *pdwSize )
01157             {
01158                 DWORD dwTmp = ( dwDesiredMaxSize >> m_dwAlignmentLog2 ) << m_dwAlignmentLog2;
01159                 *pdwSize = dwTmp;
01160             }
01161             else
01162             {
01163                 *pdwSize = 0;
01164                 hr = E_FAIL;
01165                 goto abort;
01166             }
01167         }
01168     }
01169     else if( dwDesiredMaxSize != 0 ) // and dwDesiredMinSize == 0
01170     {
01171         *pdwSize = ( dwDesiredMaxSize >> m_dwAlignmentLog2 ) << m_dwAlignmentLog2;
01172         if( qwDesiredOffset >= *pdwSize )
01173         {
01174             *pqwOffset = qwDesiredOffset - dwDesiredMaxSize;
01175             *pqwOffset = ( ( *pqwOffset + m_dwAlignment - 1 ) >> m_dwAlignmentLog2 ) << m_dwAlignmentLog2;
01176
01177             if( *pqwOffset > qwDesiredOffset )
01178             {
01179                 *pdwSize = 0;
01180                 hr = E_FAIL;
01181                 goto abort;
01182             }
01183         }
01184         else
01185         {
01186             // we could make pdwSize smaller now if necessary, so that we don't read
01187             // too much information
01188             *pqwOffset = 0;
01189             *pdwSize = ( ( (DWORD) qwDesiredOffset + m_dwAlignment - 1 ) >> m_dwAlignmentLog2 ) << m_dwAlignmentLog2;
01190         }
01191     }
01192     else
01193     {
01194         *pdwSize = 0;
01195         *pqwOffset = ( ( qwDesiredOffset + m_dwAlignment - 1 ) >> m_dwAlignmentLog2 ) << m_dwAlignmentLog2;
01196     }
01197
01198 abort:
01199     LeaveCriticalSection( &m_CriticalSection );
01200
01201     return( hr );
01202 }
01203
01204
01205
01206
01207 /////////////////////////////////////////////////////////////////////////////
01208 //
01209 // [Read]
01210 //
01211 /////////////////////////////////////////////////////////////////////////////
01212 HRESULT STDMETHODCALLTYPE
01213 CSampleDataContainer::Read(
01214                         BYTE *pbBuffer,
01215                         QWORD qwReadPosition,
01216                         DWORD dwMaxDataSize,
01217                         DWORD dwFlags,
01218                         IWMSDataContainerCallback *pCallback,
01219                         QWORD qwContext
01220                         )
01221 {
01222
01223
01224     // The dwChangeType and qwChangeParameter values allow a storage
01225     // system to send stream signals to the server when a read completes.
01226     // For example, a storage system that reads from a network feed or
01227     // a live encoder will use this to pass along stream signals such
01228     // as playlist changes.
01229
01230     // Do some work and eventually call the callback. Remember the rules:
01231     //
01232     // 1. You may call the callback from any thread. You may even call the
01233     //      callback inside this function before this function returns.
01234     //
01235     // 2. If you call the callback, then this method MUST return S_OK.
01236     //       This tells the server that the callback will not be called.
01237     //
01238     //       Similarly, if this function returns S_OK, then you must call
01239     //       the callback eventually, either from inside this method or
01240     //       later as part of an asynchronous action.
01241     //
01242     // 3. If this method returns an error, then it must NOT call the
01243     //       callback. The error tells the server that the callback
01244     //       will not be called.
01245
01246     HRESULT hr = S_OK;
01247     DWORD dwOffsetLow = 0, dwOffsetHigh = 0;
01248     DWORD dwError = NO_ERROR;
01249     BOOL fSuccess = TRUE;
01250     DWORD dwBytesTransferred = 0;
01251
01252
01253     if ( ( NULL == pbBuffer )
01254         || ( NULL == pCallback ) )
01255     {
01256         return( E_INVALIDARG );
01257     }
01258
01259     EnterCriticalSection( &m_CriticalSection );
01260
01261     // If this data container is not open, then abort.
01262     if ( ( INVALID_HANDLE_VALUE == m_hFile )
01263         || ( NULL == m_pOwnerStorageSystem ) )
01264     {
01265         hr = E_UNEXPECTED;
01266         goto abort;
01267     }
01268
01269     dwOffsetLow = LODWORD( qwReadPosition );
01270     dwOffsetHigh = HIDWORD( qwReadPosition );
01271
01272     dwOffsetLow = SetFilePointer( m_hFile, dwOffsetLow, (long*)&dwOffsetHigh, FILE_BEGIN );
01273
01274     if( ( dwOffsetLow == 0xFFFFFFFF ) && ( ( dwError = GetLastError() ) != NO_ERROR ) )
01275     {
01276         hr = HRESULT_FROM_WIN32( dwError );
01277         goto abort;
01278     }
01279
01280     fSuccess = ReadFile(
01281                     m_hFile,
01282                     pbBuffer,
01283                     dwMaxDataSize,
01284                     &dwBytesTransferred,
01285                     NULL
01286                     );
01287     if ( !fSuccess )
01288     {
01289         dwError = GetLastError();
01290         if ( ERROR_HANDLE_EOF != dwError )
01291         {
01292             hr = HRESULT_FROM_WIN32( dwError );
01293             goto abort;
01294         }
01295     }
01296
01297     OnIoCompletion(
01298             dwError,
01299             CSampleDataContainer::IO_READ,
01300             qwReadPosition,
01301             dwBytesTransferred,
01302             pbBuffer,
01303             pCallback,
01304             qwContext
01305             );
01306
01307     // We called the callback, so we MUST return S_OK.
01308     hr = S_OK;
01309
01310 abort:
01311
01312     LeaveCriticalSection( &m_CriticalSection );
01313
01314     return( hr );
01315 } // End of Read.
01316
01317
01318
01319
01320
01321 /////////////////////////////////////////////////////////////////////////////
01322 //
01323 // [Write]
01324 //
01325 /////////////////////////////////////////////////////////////////////////////
01326
01327
01328 /////////////////////////////////////////////////////////////////////////////
01329 HRESULT STDMETHODCALLTYPE CSampleDataContainer::Write(
01330                         BYTE *pbBuffer,
01331                         DWORD dwDataSize,
01332                         QWORD qwWritePosition,
01333                         IWMSDataContainerCallback *pCallback,
01334                         QWORD qwContext
01335                         )
01336 {
01337
01338     HRESULT hr = S_OK;
01339     BOOL fSuccess = TRUE;
01340     DWORD dwOffsetLow = 0, dwOffsetHigh = 0;
01341     DWORD dwError = NO_ERROR;
01342     DWORD dwBytesTransferred = 0;
01343
01344     if ( ( NULL == pbBuffer )
01345         || ( NULL == pCallback ) )
01346     {
01347         return( E_INVALIDARG );
01348     }
01349
01350     EnterCriticalSection( &m_CriticalSection );
01351
01352     // If this data container is not open, then abort.
01353     if ( ( INVALID_HANDLE_VALUE == m_hFile )
01354         || ( NULL == m_pOwnerStorageSystem ) )
01355     {
01356         hr = E_UNEXPECTED;
01357         goto abort;
01358     }
01359
01360     // Do some work and eventually call the callback. Remember the rules:
01361     //
01362     // 1. You may call the callback from any thread. You may even call the
01363     //      callback inside this function before this function returns.
01364     //
01365     // 2. If you call the callback, then this method MUST return S_OK.
01366     //       This tells the server that the callback will not be called.
01367     //
01368     //       Similarly, if this function returns S_OK, then you must call
01369     //       the callback eventually, either from inside this method or
01370     //       later as part of an asynchronous action.
01371     //
01372     // 3. If this method returns an error, then it must NOT call the
01373     //       callback. The error tells the server that the callback
01374     //       will not be called.
01375
01376     dwOffsetLow = LODWORD( qwWritePosition );
01377     dwOffsetHigh = HIDWORD( qwWritePosition );
01378
01379     dwOffsetLow = SetFilePointer( m_hFile, dwOffsetLow, (long*)&dwOffsetHigh, FILE_BEGIN );
01380
01381     if( ( dwOffsetLow == 0xFFFFFFFF ) && ( ( dwError = GetLastError() ) != NO_ERROR ) )
01382     {
01383         hr = HRESULT_FROM_WIN32( dwError );
01384         goto abort;
01385     }
01386
01387     fSuccess = WriteFile(
01388                     m_hFile,
01389                     pbBuffer,
01390                     dwDataSize,
01391                     &dwBytesTransferred,
01392                     NULL
01393                     );
01394     if ( !fSuccess )
01395     {
01396         dwError = GetLastError();
01397         hr = HRESULT_FROM_WIN32( GetLastError() );
01398         goto abort;
01399     }
01400
01401     OnIoCompletion( dwError,
01402             CSampleDataContainer::IO_WRITE,
01403             qwWritePosition,
01404             dwBytesTransferred,
01405             pbBuffer,
01406             pCallback,
01407             qwContext );
01408     hr = S_OK;
01409
01410 abort:
01411
01412     LeaveCriticalSection( &m_CriticalSection );
01413
01414     return( hr );
01415 }
01416
01417
01418 /////////////////////////////////////////////////////////////////////////////
01419 void CSampleDataContainer::OnIoCompletion(
01420                         DWORD dwError,
01421                         DWORD dwIoType,
01422                         QWORD qwOffset,
01423                         DWORD cbTransferred,
01424                         BYTE *pbBuffer,
01425                         IWMSDataContainerCallback *pCallback,
01426                         QWORD qwContext
01427                         )
01428 {
01429     HRESULT hr = HRESULT_FROM_WIN32( dwError );
01430
01431
01432     if ( CSampleDataContainer::IO_READ == dwIoType )
01433     {
01434         if ( ( SUCCEEDED( hr ) )
01435             && ( qwOffset >= m_qwFileSize )
01436             && ( 0 == cbTransferred ) )
01437         {
01438             hr = HRESULT_FROM_WIN32( ERROR_HANDLE_EOF );
01439         }
01440
01441         if ( NULL != pCallback )
01442         {
01443             // The HRESULT returned by the callback should be ignored.
01444             pCallback->OnRead( hr,
01445                                cbTransferred,
01446                                0,
01447                                0,
01448                                qwContext
01449                                );
01450             hr = S_OK; // any error is passed to the callback
01451         }
01452     }
01453     else if ( CSampleDataContainer::IO_WRITE == dwIoType )
01454     {
01455         if ( NULL != pCallback )
01456         {
01457             // The HRESULT returned by the callback should be ignored.
01458             pCallback->OnWrite( hr,
01459                                 cbTransferred,
01460                                 qwContext );
01461             hr = S_OK; // any error is passed to the callback
01462         }
01463     }
01464 }
01465
01466
01467
01468
01469
01470
01471
01472
01473 /////////////////////////////////////////////////////////////////////////////
01474 //
01475 // [DoDataContainerExtendedCommand]
01476 //
01477 /////////////////////////////////////////////////////////////////////////////
01478 HRESULT STDMETHODCALLTYPE
01479 CSampleDataContainer::DoDataContainerExtendedCommand(
01480                         LPWSTR szCommandName,
01481                         IWMSCommandContext *pCommand,
01482                         DWORD dwCallFlags,
01483                         IWMSDataContainerCallback *pCallback,
01484                         QWORD qwContext
01485                         )
01486 {
01487     if ( NULL == pCallback )
01488     {
01489         // We are returning an error, so we cannot call the callback.
01490         return( E_INVALIDARG );
01491     }
01492
01493     // TODO: Implement any special commands that may be sent from the
01494     // client or server to plugins that are not part of the current command
01495     // set. Currently, this method is not used, and is designed for future
01496     // growth.
01497
01498     // Ignore the result.
01499     pCallback->OnDoDataContainerExtendedCommand( S_OK, qwContext );
01500
01501     // We called the callback, so we MUST return S_OK.
01502     return( S_OK );
01503 } // End of DoDataContainerExtendedCommand.
01504
01505
01506
01507
01508
01509 /////////////////////////////////////////////////////////////////////////////
01510 HRESULT STDMETHODCALLTYPE
01511 CSampleDataContainer::FinishParsingPacketlist(
01512                         IWMSPacketList *pPacketList
01513                         )
01514 {
01515     HRESULT hr = S_OK;
01516
01517     if ( NULL == pPacketList )
01518     {
01519         return( E_INVALIDARG );
01520     }
01521
01522     return( S_OK );
01523 } // FinishParsingPacketlist
01524
01525
01526
01527
01528
01529 /////////////////////////////////////////////////////////////////////////////
01530 //
01531 // [CSampleDirectory]
01532 //
01533 /////////////////////////////////////////////////////////////////////////////
01534 CSampleDirectory::CSampleDirectory()
01535 {
01536     m_cRef = 1;
01537     m_pOwnerStorageSystem = NULL;
01538     InitializeCriticalSection( &m_CriticalSection );
01539     m_pPathName = NULL;
01540     m_dwPathNameLength = 0;
01541     m_pSearchDirName = NULL;
01542     m_pChildren = NULL;
01543     m_pRecentChild = NULL;
01544     m_dwItemNum = 0;
01545 } //End of CSampleDirectory
01546
01547 CSampleDirectory::~CSampleDirectory()
01548 {
01549     Shutdown();
01550     DeleteCriticalSection( &m_CriticalSection );
01551 } // End of ~CSampleDirectory
01552
01553 /////////////////////////////////////////////////////////////////////////////
01554 //
01555 // [Initialize]
01556 //
01557 /////////////////////////////////////////////////////////////////////////////
01558 HRESULT
01559 CSampleDirectory::Initialize(
01560                         IWMSContext *pUserContext,
01561                         LPWSTR pszContainerName,
01562                         CSDKSampleStorageSystem *pOwnerStorageSystem,
01563                         IWMSDataSourcePluginCallback *pCallback,
01564                         QWORD qwContext )
01565 {
01566     HRESULT hr = S_OK;
01567     WCHAR *pszNtfsPathname = NULL;
01568     size_t sFileName = 0;
01569     DWORD dwFileAttributes = 0;
01570     DWORD dwIndex = 0;
01571     HANDLE hFileEnum = INVALID_HANDLE_VALUE;
01572     BOOL fSuccess = FALSE;
01573     WIN32_FIND_DATA FileInfo;
01574     CSampleDirectoryInfo *pDirInfo = NULL;
01575     DWORD dwUrlLength = 0;
01576     DWORD dwFileNameLength = 0;
01577     DWORD dwFileNameStartPosition =0;
01578     WCHAR cLastCharInPath = L'\0';
01579
01580     EnterCriticalSection( &m_CriticalSection );
01581
01582     //
01583     // Check arguments
01584     //
01585
01586     if( ( NULL == pszContainerName )||
01587         ( NULL == pCallback ) ||
01588         ( NULL == pOwnerStorageSystem ) )
01589     {
01590         hr = E_INVALIDARG;
01591         goto abort;
01592     }
01593
01594     if( 0 != _wcsnicmp( pszContainerName, URL_SCHEME, URL_SCHEME_LENGTH ) )
01595     {
01596         // The container name doesn't start with the expected scheme
01597         hr = E_INVALIDARG;
01598         goto abort;
01599     }
01600
01601     m_pOwnerStorageSystem = pOwnerStorageSystem;
01602     pOwnerStorageSystem->AddRef();
01603
01604     m_dwItemNum = 0;
01605
01606     //
01607     // Copy the full path
01608     //
01609
01610     m_dwPathNameLength = wcslen( pszContainerName );
01611     m_pPathName = new WCHAR[ m_dwPathNameLength + 1 ];
01612     if( NULL == m_pPathName )
01613     {
01614         hr = E_OUTOFMEMORY;
01615         goto abort;
01616     }
01617
01618     m_pPathName[m_dwPathNameLength] = L'\0';
01619
01620     wcsncpy( m_pPathName, pszContainerName, m_dwPathNameLength );
01621
01622     if( L'\0' != m_pPathName[m_dwPathNameLength] )
01623     {
01624         hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
01625         goto abort;
01626     }
01627
01628     //
01629     // Make an auxiliary copy of the path, without the scheme
01630     //
01631
01632     pszNtfsPathname = pszContainerName + URL_SCHEME_LENGTH;
01633     sFileName = wcslen( pszNtfsPathname );
01634     m_pSearchDirName = new WCHAR[ sFileName + DIR_MASK_LENGTH + 1 ];
01635     if( NULL == m_pSearchDirName )
01636     {
01637         hr = E_OUTOFMEMORY;
01638         goto abort;
01639     }
01640
01641     m_pSearchDirName[sFileName] = L'\0';
01642
01643     wcsncpy( m_pSearchDirName, pszNtfsPathname, sFileName );
01644
01645     if( L'\0' != m_pSearchDirName[sFileName] )
01646     {
01647         hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
01648         goto abort;
01649     }
01650
01651     //
01652     // Remove any trailing '\' or '/' from the working path
01653     //
01654
01655     if( 0 < sFileName )
01656     {
01657         cLastCharInPath = m_pSearchDirName[sFileName - 1];
01658
01659         if( ( L'\\' == cLastCharInPath )
01660             || ( L'/' == cLastCharInPath ) )
01661         {
01662             --sFileName;
01663             m_pSearchDirName[sFileName] = L'\0';
01664         }
01665     }
01666
01667     //
01668     // Check if it's really a directory
01669     //
01670
01671     dwFileAttributes = GetFileAttributes( m_pSearchDirName );
01672     if( -1 == dwFileAttributes )
01673     {
01674         // Unable to get the FileAttributes
01675         hr = HRESULT_FROM_WIN32( GetLastError() );
01676         goto abort;
01677     }
01678     else if( !( FILE_ATTRIBUTE_DIRECTORY & dwFileAttributes ) )
01679     {
01680         // This "file" is not a directory
01681         hr = HRESULT_FROM_WIN32( ERROR_DIRECTORY );
01682         goto abort;
01683     }
01684
01685     //
01686     // Append a '\*' mask to the working path and walk through the directory
01687     //
01688
01689     m_pSearchDirName[ sFileName + DIR_MASK_LENGTH ] = L'\0';
01690
01691     wcsncpy( &m_pSearchDirName[sFileName], DIR_MASK, DIR_MASK_LENGTH );
01692
01693     if( L'\0' != m_pSearchDirName[ sFileName + DIR_MASK_LENGTH ] )
01694     {
01695         hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
01696         goto abort;
01697     }
01698
01699     hFileEnum = FindFirstFileW( m_pSearchDirName, &FileInfo );
01700     if( INVALID_HANDLE_VALUE == hFileEnum )
01701     {
01702         hr = HRESULT_FROM_WIN32( GetLastError() );
01703         if( HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND ) == hr )
01704         {
01705             // This means we hit the end of the directory, which is
01706             // not an error.  Signify S_FALSE for the end of the
01707             // enumeration.
01708             hr = S_FALSE;
01709             goto abort;
01710         }
01711         goto abort;
01712     }
01713
01714     fSuccess = TRUE;
01715
01716     // Advance to the desired position in the directory.
01717     dwIndex = 0;
01718     while ( TRUE )
01719     {
01720         if( !fSuccess )
01721         {
01722             hr = HRESULT_FROM_WIN32( GetLastError() );
01723             if( HRESULT_FROM_WIN32( ERROR_NO_MORE_FILES ) != hr  )
01724             {
01725                 goto abort;
01726             }
01727
01728             // This means we hit the end of the directory, which is
01729             // not an error.
01730             hr = S_OK;
01731             break;
01732         }
01733
01734         if( ( '\0' == FileInfo.cFileName[0] )
01735             || ( ( '.' == FileInfo.cFileName[0] ) && ('\0' == FileInfo.cFileName[1] ) )
01736             || ( ( '.' == FileInfo.cFileName[0] ) && ( '.' == FileInfo.cFileName[1] ) && ( '\0' == FileInfo.cFileName[2] ) )
01737             || ( FileInfo.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN ) )
01738
01739         {
01740             // if the item is empty or '.' or '..' or hidden file then skip it
01741             // and grab the next file and start the loop again
01742             fSuccess = FindNextFileW( hFileEnum, &FileInfo );
01743             continue;
01744         }
01745
01746         pDirInfo = new CSampleDirectoryInfo;
01747         if( NULL == pDirInfo )
01748         {
01749             hr = E_OUTOFMEMORY;
01750             goto abort;
01751         }
01752
01753         //
01754         // Compose the item's URL
01755         //
01756
01757         dwFileNameLength = wcslen( FileInfo.cFileName );
01758         dwUrlLength = m_dwPathNameLength + dwFileNameLength + 1;   // 1 for the '\' separator
01759
01760         pDirInfo->m_pszwName = ( LPOLESTR ) CoTaskMemAlloc( sizeof( OLECHAR ) * ( dwUrlLength + 1 ) );
01761         if( NULL == pDirInfo->m_pszwName )
01762         {
01763             hr = E_OUTOFMEMORY;
01764             goto abort;
01765         }
01766
01767         pDirInfo->m_pszwName[m_dwPathNameLength] = L'\0';
01768
01769         wcsncpy( pDirInfo->m_pszwName, m_pPathName, m_dwPathNameLength );
01770
01771         if( L'\0' != pDirInfo->m_pszwName[m_dwPathNameLength] )
01772         {
01773             hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
01774             goto abort;
01775         }
01776
01777         dwFileNameStartPosition = m_dwPathNameLength;
01778         cLastCharInPath = m_pPathName[m_dwPathNameLength-1];
01779         if( ( L'\\' != cLastCharInPath ) && ( L'/' != cLastCharInPath ) )
01780         {
01781             ( pDirInfo->m_pszwName )[m_dwPathNameLength] = L'\\';
01782             ( pDirInfo->m_pszwName )[m_dwPathNameLength + 1] = L'\0';
01783             dwFileNameStartPosition++;
01784         }
01785
01786         pDirInfo->m_pszwName[ dwFileNameStartPosition + dwFileNameLength ] = L'\0';
01787
01788         wcsncpy( &pDirInfo->m_pszwName[dwFileNameStartPosition], FileInfo.cFileName, dwFileNameLength );
01789
01790         if( L'\0' != pDirInfo->m_pszwName[ dwFileNameStartPosition + dwFileNameLength ] )
01791         {
01792             hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
01793             goto abort;
01794         }
01795
01796         //
01797         // Set the item's flags
01798         //
01799
01800         pDirInfo->m_dwFlags = 0;
01801         if( FileInfo.dwFileAttributes  & FILE_ATTRIBUTE_DIRECTORY )
01802         {
01803             pDirInfo->m_dwFlags |= WMS_DIRECTORY_ENTRY_IS_DIRECTORY;
01804         }
01805         pDirInfo->m_qwSize = MAKEQWORD( FileInfo.nFileSizeLow, FileInfo.nFileSizeHigh );
01806
01807         //
01808         // Insert item's info in list
01809         //
01810
01811         pDirInfo->m_pNext = m_pChildren;
01812         m_pChildren = pDirInfo;
01813         pDirInfo = NULL;
01814
01815         dwIndex++;
01816
01817         fSuccess = FindNextFileW( hFileEnum, &FileInfo );
01818     } // Enumerate every file in the directory.
01819
01820     m_dwItemNum = 1;
01821     m_pRecentChild = m_pChildren;
01822
01823 abort:
01824     LeaveCriticalSection ( &m_CriticalSection );
01825
01826     if( NULL != pDirInfo )
01827     {
01828         delete pDirInfo;
01829     }
01830
01831     if( INVALID_HANDLE_VALUE != hFileEnum )
01832     {
01833         fSuccess = FindClose( hFileEnum );
01834         hFileEnum = INVALID_HANDLE_VALUE;
01835     }
01836
01837     if( NULL != pCallback )
01838     {
01839         // The HRESULT returned by the callback should be ignored.
01840         pCallback->OnOpenDirectory( hr, this, qwContext );
01841         hr = S_OK; // any error is passed to the callback
01842     }
01843
01844     // Any error is passed to the callback.
01845     return( S_OK );
01846 } // End of Initialize
01847
01848
01849 /////////////////////////////////////////////////////////////////////////////
01850 //
01851 // [Shutdown]
01852 //
01853 /////////////////////////////////////////////////////////////////////////////
01854 HRESULT
01855 CSampleDirectory::Shutdown()
01856 {
01857     CSampleDirectoryInfo *pChild = NULL;
01858
01859     if( NULL != m_pOwnerStorageSystem )
01860     {
01861         m_pOwnerStorageSystem->Release();
01862         m_pOwnerStorageSystem = NULL;
01863     }
01864
01865     if( NULL != m_pPathName )
01866     {
01867         delete [] m_pPathName;
01868         m_pPathName = NULL;
01869     }
01870
01871     if( NULL != m_pSearchDirName )
01872     {
01873         delete [] m_pSearchDirName;
01874         m_pSearchDirName = NULL;
01875     }
01876
01877     // delete children
01878     while( NULL != m_pChildren )
01879     {
01880         pChild = m_pChildren;
01881         m_pChildren = m_pChildren->m_pNext;
01882         delete pChild;
01883     }
01884
01885     return( S_OK );
01886 } // End of Shutdown
01887
01888
01889 /////////////////////////////////////////////////////////////////////////////
01890 //
01891 // [AddRef]
01892 //
01893 /////////////////////////////////////////////////////////////////////////////
01894 inline
01895 STDMETHODIMP_( ULONG )
01896 CSampleDirectory::AddRef()
01897 {
01898     return( InterlockedIncrement( &m_cRef ) );
01899 } // End of AddRef
01900
01901
01902 /////////////////////////////////////////////////////////////////////////////
01903 //
01904 // [Release]
01905 //
01906 /////////////////////////////////////////////////////////////////////////////
01907 inline
01908 STDMETHODIMP_( ULONG )
01909 CSampleDirectory::Release()
01910 {
01911     if ( 0 == InterlockedDecrement( &m_cRef ) )
01912     {
01913         delete this;
01914         return( 0 );
01915     }
01916
01917     return( 0xbad );
01918 } // End of Release.
01919
01920
01921 /////////////////////////////////////////////////////////////////////////////
01922 //
01923 // [QueryInterface]
01924 //
01925 /////////////////////////////////////////////////////////////////////////////
01926 STDMETHODIMP
01927 CSampleDirectory::QueryInterface( REFIID riid, void **ppvObject )
01928 {
01929     if ( IID_IWMSDirectory == riid )
01930     {
01931         *ppvObject = ( IWMSDirectory * ) this;
01932         AddRef();
01933         return( S_OK );
01934     }
01935     else if ( IID_IUnknown == riid )
01936     {
01937         *ppvObject = ( IUnknown * ) this;
01938         AddRef();
01939         return( S_OK );
01940     }
01941
01942     *ppvObject = NULL;
01943     return( E_NOINTERFACE );
01944 } // End of QueryInterface.
01945
01946
01947 /////////////////////////////////////////////////////////////////////////////
01948 //
01949 // [GetDataSourcePlugin]
01950 //
01951 /////////////////////////////////////////////////////////////////////////////
01952 HRESULT STDMETHODCALLTYPE
01953 CSampleDirectory::GetDataSourcePlugin(
01954                     IWMSDataSourcePlugin **ppDataSource
01955                     )
01956 {
01957     HRESULT hr = S_OK;
01958
01959     if( NULL == ppDataSource )
01960     {
01961         return( E_INVALIDARG );
01962     }
01963
01964     EnterCriticalSection( &m_CriticalSection );
01965
01966     if( NULL == m_pOwnerStorageSystem )
01967     {
01968         goto abort;
01969     }
01970
01971     *ppDataSource = m_pOwnerStorageSystem;
01972     m_pOwnerStorageSystem->AddRef();
01973
01974 abort:
01975     LeaveCriticalSection( &m_CriticalSection );
01976
01977     return( hr );
01978 } // End of GetDataSourcePlugin
01979
01980 /////////////////////////////////////////////////////////////////////////////
01981 //
01982 // [GetName]
01983 //
01984 /////////////////////////////////////////////////////////////////////////////
01985 HRESULT STDMETHODCALLTYPE
01986 CSampleDirectory::GetName(
01987                     LPOLESTR *pstrValue
01988                     )
01989 {
01990     HRESULT hr = S_OK;
01991
01992     if( NULL == pstrValue )
01993     {
01994         return( E_INVALIDARG );
01995     }
01996
01997     EnterCriticalSection( &m_CriticalSection );
01998
01999     *pstrValue = new WCHAR[ m_dwPathNameLength + 1 ];
02000     if( NULL == *pstrValue )
02001     {
02002         hr = E_OUTOFMEMORY;
02003         goto abort;
02004     }
02005
02006     if( NULL != m_pPathName )
02007     {
02008         *pstrValue[m_dwPathNameLength] = L'\0';
02009
02010         wcsncpy( *pstrValue, m_pPathName, m_dwPathNameLength );
02011
02012         if( L'\0' != *pstrValue[m_dwPathNameLength] )
02013         {
02014             hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
02015             goto abort;
02016         }
02017     }
02018     else
02019     {
02020         ( *pstrValue )[ 0 ] = L'\0';
02021     }
02022
02023 abort:
02024     LeaveCriticalSection( &m_CriticalSection );
02025
02026     return( hr );
02027 } // End of GetName
02028
02029 /////////////////////////////////////////////////////////////////////////////
02030 //
02031 // [GetChildInfo]
02032 //
02033 /////////////////////////////////////////////////////////////////////////////
02034 HRESULT STDMETHODCALLTYPE
02035 CSampleDirectory::GetChildInfo(
02036                     DWORD dwIndex,
02037                     WMSDirectoryEntryInfo *pInfo
02038                     )
02039 {
02040     HRESULT hr = S_OK;
02041     DWORD dwUrlLength = 0;
02042
02043     if( NULL == pInfo )
02044     {
02045         return( E_INVALIDARG );
02046     }
02047
02048     EnterCriticalSection( &m_CriticalSection );
02049
02050     // We cannot go backwards. If the client asked for a previous
02051     // directory entry, then reset the state to the beginning and
02052     // then go forward to the desired position.
02053     if( ( dwIndex < m_dwItemNum ) || ( NULL == m_pRecentChild ) )
02054     {
02055         m_dwItemNum = 1;
02056         m_pRecentChild = m_pChildren;
02057     } // resetting the count.
02058
02059
02060     // Advance to the desired position in the directory.
02061     while ( ( m_dwItemNum < dwIndex ) && ( NULL != m_pRecentChild ) )
02062     {
02063         m_pRecentChild = m_pRecentChild->m_pNext;
02064         m_dwItemNum++;
02065     } // advancing to the desired position.
02066
02067
02068     if( NULL == m_pRecentChild )
02069     {
02070         // This means we hit the end of the directory, which is
02071         // not an error. Signify S_FALSE for the end of the enumeration.
02072         hr = S_FALSE;
02073         goto abort;
02074     }
02075
02076     dwUrlLength = wcslen( m_pRecentChild->m_pszwName );
02077     pInfo->pstrName = ( LPOLESTR ) CoTaskMemAlloc( sizeof(OLECHAR) * ( dwUrlLength + 1 ) );
02078     if( NULL == pInfo->pstrName )
02079     {
02080         hr = E_OUTOFMEMORY;
02081         goto abort;
02082     }
02083
02084     pInfo->pstrName[dwUrlLength] = L'\0';
02085
02086     wcsncpy( pInfo->pstrName, m_pRecentChild->m_pszwName, dwUrlLength );
02087
02088     if( L'\0' != pInfo->pstrName[dwUrlLength] )
02089     {
02090         hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER );
02091         goto abort;
02092     }
02093
02094     pInfo->dwFlags = m_pRecentChild->m_dwFlags;
02095     pInfo->qwSize = m_pRecentChild->m_qwSize;
02096
02097 abort:
02098     LeaveCriticalSection( &m_CriticalSection );
02099
02100     return( hr );
02101 } // End of GetChildInfo
02102
02103
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IBrowserHost Member List

This is the complete list of members for IBrowserHost, including all inherited members.
GetHwnd(long *phwnd) | IBrowserHost
GetHwnd(long *phwnd) | IBrowserHost
GetHwnd(long *phwnd) | IBrowserHost
Run() | IBrowserHost
Run() | IBrowserHost
Run() | IBrowserHost
Run() | IBrowserHost
Stop() | IBrowserHost
Stop() | IBrowserHost
Stop() | IBrowserHost
Stop() | IBrowserHost
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/StdAfx.h Source File

  • Web
  • Browser
  • EditFeatures

StdAfx.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // stdafx.h : include file for standard system include files,
00006 //      or project specific include files that are used frequently,
00007 //      but are changed infrequently
00008
00009 #if !defined(AFX_STDAFX_H__BC7206F5_CB70_47F2_9618_23FA71903CFA__INCLUDED_)
00010 #define AFX_STDAFX_H__BC7206F5_CB70_47F2_9618_23FA71903CFA__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016 #define STRICT
00017 #ifndef _WIN32_WINNT
00018 #define _WIN32_WINNT 0x0400
00019 #endif
00020 #define _ATL_APARTMENT_THREADED
00021
00022 #include <atlbase.h>
00023
00024 //You may derive a class from CComModule and use it if you want to override
00025 //something, but do not change the name of _Module
00026 class CExeModule : public CComModule
00027 {
00028 public:
00029   LONG Unlock();
00030   DWORD dwThreadID;
00031   HANDLE hEventShutdown;
00032   void MonitorShutdown();
00033   bool StartMonitor();
00034   bool bActivity;
00035 };
00036 extern CExeModule _Module;
00037 #include <atlcom.h>
00038
00039 //{{AFX_INSERT_LOCATION}}
00040 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00041
00042 #endif // !defined(AFX_STDAFX_H__BC7206F5_CB70_47F2_9618_23FA71903CFA__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStabilize Member List

This is the complete list of members for CStabilize, including all inherited members.
CStabilize(CSafeRefCount *pObjSafeRefCount) | CStabilize | [inline]
m_pObjSafeRefCount | CStabilize | [private]
~CStabilize() | CStabilize | [inline]
Generated on Wed Nov 13 2024 16:57:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CToolBarExtension Member List

This is the complete list of members for CToolBarExtension, including all inherited members.
ControlbarNotify(MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param) | CToolBarExtension | [virtual]
CToolBarExtension() | CToolBarExtension |
ExtractData(IDataObject *piDataObject, CLIPFORMAT cfClipFormat, BYTE *pbData, DWORD cbData) | CToolBarExtension | [private]
ExtractObjectTypeGUID(IDataObject *piDataObject, GUID *pguidObjectType) | CToolBarExtension | [private]
ExtractSnapInCLSID(IDataObject *piDataObject, CLSID *pclsidSnapin) | CToolBarExtension | [private]
ExtractString(IDataObject *piDataObject, CLIPFORMAT cfClipFormat, WCHAR *pstr, DWORD cchMaxLength) | CToolBarExtension | [private]
getToolbar() | CToolBarExtension | [inline]
iStatus | CToolBarExtension | [private]
m_cref | CToolBarExtension | [private]
m_ipControlBar | CToolBarExtension | [private]
m_ipToolbar | CToolBarExtension | [private]
PAUSED enum value | CToolBarExtension | [private]
QueryInterface(REFIID riid, LPVOID *ppv) | CToolBarExtension |
RUNNING enum value | CToolBarExtension | [private]
s_cfDisplayName | CToolBarExtension | [private, static]
s_cfNodeType | CToolBarExtension | [private, static]
s_cfSnapInCLSID | CToolBarExtension | [private, static]
SetControlbar(LPCONTROLBAR pControlbar) | CToolBarExtension | [virtual]
SetToolbarButtons(STATUS iVehicleStatus) | CToolBarExtension | [private]
STATUS enum name | CToolBarExtension | [private]
STDMETHODIMP_(ULONG) AddRef() | CToolBarExtension |
STDMETHODIMP_(ULONG) Release() | CToolBarExtension |
STOPPED enum value | CToolBarExtension | [private]
~CToolBarExtension() | CToolBarExtension |
Generated on Wed Nov 13 2024 16:57:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CActivitySub Member List

This is the complete list of members for CActivitySub, including all inherited members.
CActivitySub(CComSpy *pSpy) | CActivitySub | [inline]
CActivitySub() | CActivitySub | [inline]
CSysLCESub() | CSysLCESub | [inline]
GetEventClass(LPGUID guid) | CActivitySub | [inline, virtual]
GetEventType(EventEnum *e) | CActivitySub | [inline, virtual]
GetInterface(IID *iid) | CActivitySub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
OnActivityCreate(COMSVCSEVENTINFO *pInfo, REFGUID guidActivity) | CActivitySub | [inline]
OnActivityDestroy(COMSVCSEVENTINFO *pInfo, REFGUID guidActivity) | CActivitySub | [inline]
OnActivityEnter(COMSVCSEVENTINFO *pInfo, REFGUID guidCurrent, REFGUID guidEntered, DWORD dwThread) | CActivitySub | [inline]
OnActivityLeave(COMSVCSEVENTINFO *pInfo, REFGUID guidCurrent, REFGUID guidLeft) | CActivitySub | [inline]
OnActivityLeaveSame(COMSVCSEVENTINFO *pInfo, REFGUID guidCurrent, DWORD dwCallDepth) | CActivitySub | [inline]
OnActivityReenter(COMSVCSEVENTINFO *pInfo, REFGUID guidCurrent, DWORD dwThread, DWORD dwCallDepth) | CActivitySub | [inline]
OnActivityTimeout(COMSVCSEVENTINFO *pInfo, REFGUID guidCurrent, REFGUID guidEntered, DWORD dwThread, DWORD dwTimeout) | CActivitySub | [inline]
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:55:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/compdata.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

compdata.cpp

Go to the documentation of this file.
00001
00002 /////////////////////////////////////////////////////////////////////////////
00003 //
00004 //  This source code is only intended as a supplement to existing
00005 //  Microsoft documentation.
00006 //
00007 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00008 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00009 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00010 //  PURPOSE.
00011 //
00012 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00013 //
00014
00015 #include "Globals.h"
00016 #include "Comp.h"
00017 #include "CompData.h"
00018 #include "DataObj.h"
00019 #include "Resource.h"
00020
00021                              // Tracing stuff
00022 #include "TraceMacro.h"
00023 #undef  MODULESTRING
00024 #define MODULESTRING  _T("CComponentData")
00025
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // Construction/Destruction
00029
00030
00031 //---------------------------------------------------------------------------
00032 //  This constructor is called when the Snap-in is selected from the
00033 //  Add/Remove dialog.  Build our static node and load the required
00034 //  clipformats before MMC calls us.
00035 //
00036 CComponentData::CComponentData()
00037 {
00038   // Do not assume only one instance of IComponentData implementation is created.
00039
00040   m_cRef                = 0;
00041   m_ipConsoleNameSpace2 = NULL;
00042   m_ipConsole2          = NULL;
00043
00044   // Increment this so DllCanUnloadNow works correctly
00045   InterlockedIncrement((long*)&g_uObjectCount);
00046
00047   NODE_PROPERTIES NodeProps;
00048   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(this);
00049   wcscpy( NodeProps.szNodeName, gwszROOT_NODE_NAME );
00050
00051   m_pStaticNode = new CStaticNode;
00052   m_pStaticNode->Initialize( &NodeProps );
00053
00054   InitClipboardFormats();
00055 }
00056
00057 //---------------------------------------------------------------------------
00058 CComponentData::~CComponentData()
00059 {
00060   if( NULL != m_pStaticNode )
00061   {
00062     delete m_pStaticNode;
00063     m_pStaticNode = NULL;
00064   }
00065
00066   // All done, decrement object count so the dll can be unloaded
00067   InterlockedDecrement((long*)&g_uObjectCount);
00068 }
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 // IUnknown implementation
00072
00073 //---------------------------------------------------------------------------
00074 STDMETHODIMP CComponentData::QueryInterface
00075 (
00076   REFIID   riid,       //[in] Identifier of the requested interface
00077   LPVOID   *ppv        //[out] Address of requested interface
00078 )
00079 {
00080   if( !ppv )
00081     return E_FAIL;
00082
00083   *ppv = NULL;
00084
00085   if( IsEqualIID(riid, IID_IUnknown) )
00086     *ppv = static_cast<IComponentData*>(this);
00087   else if( IsEqualIID(riid, IID_IComponentData) )
00088     *ppv = static_cast<IComponentData*>(this);
00089   else if( IsEqualIID(riid, IID_IComponentData2) )
00090     *ppv = static_cast<IComponentData2*>(this);
00091
00092
00093   if( *ppv )
00094   {
00095     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00096     return S_OK;
00097   }
00098
00099   return E_NOINTERFACE;
00100 }
00101
00102 //---------------------------------------------------------------------------
00103 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00104 {
00105   return InterlockedIncrement((LONG*)&m_cRef);
00106 }
00107
00108 //---------------------------------------------------------------------------
00109 STDMETHODIMP_(ULONG) CComponentData::Release()
00110 {
00111   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00112   {
00113     delete this;
00114     return 0;
00115   }
00116
00117   return m_cRef;
00118 }
00119
00120 /////////////////////////////////////////////////////////////////////////////
00121 // Interface IComponentData
00122
00123 //---------------------------------------------------------------------------
00124 //  Called when the user selects the Snap-in from the scope pane.
00125 //  This is where we QI and cache interfaces we will use later.  These
00126 //  interfaces are for future use since they are not used in this sample
00127 //
00128 HRESULT CComponentData::Initialize
00129 (
00130   LPUNKNOWN pUnknown         //[in] Pointer to the console's IUnknown
00131 )
00132 {
00133   HRESULT hResult = S_FALSE;
00134                              // Fail to initialize if we can't get the
00135   do                         // interfaces we need to cache
00136   {
00137     hResult = pUnknown->QueryInterface(IID_IConsoleNameSpace2, (void**)&m_ipConsoleNameSpace2);
00138     BREAK_ON_ERROR( hResult );
00139
00140     hResult = pUnknown->QueryInterface(IID_IConsole2, (void**)&m_ipConsole2);
00141     BREAK_ON_ERROR( hResult );
00142   }
00143   while( 0 );
00144
00145   return hResult;
00146 }
00147
00148 //---------------------------------------------------------------------------
00149 //  Called by the console every time we need to create a new result view.
00150 //  There can be several different result views. Aside from the default one
00151 //  created when the Snap-in initializes, additional ones are created by
00152 //  selecting "New window from here" in MMC's user interface.
00153 //
00154 HRESULT CComponentData::CreateComponent
00155 (
00156   LPCOMPONENT __RPC_FAR* ppComponent   //[out] Points to new IComponent class
00157 )
00158 {
00159   *ppComponent = NULL;
00160
00161   // Pass the new CComponent a pointer to it's parent
00162   CComponent* pComponent = new CComponent( this );
00163
00164   if( NULL == pComponent )
00165     return E_OUTOFMEMORY;
00166
00167   return pComponent->QueryInterface( IID_IComponent, (void**)ppComponent );
00168 }
00169
00170 //---------------------------------------------------------------------------
00171 //  Handles notification events from MMC
00172 //
00173 HRESULT CComponentData::Notify
00174 (
00175   LPDATAOBJECT     ipDataObject,   //[in] Points to the selected data object
00176   MMC_NOTIFY_TYPE  MmcEvent,       //[in] Identifies action taken by user
00177   LONG             nArg,           //[in] Depends on the notification type
00178   LONG             nParam          //[in] Depends on the notification type
00179 )
00180 {
00181   TRACE_EVENT( _T("Notify"), MmcEvent );  // Provides trace output
00182
00183   return S_FALSE;
00184 }
00185
00186 //---------------------------------------------------------------------------
00187 //  This is where we release any cached interface pointers or any
00188 //  allocated resources.
00189 //
00190 HRESULT CComponentData::Destroy( void)
00191 {
00192
00193   SAFE_RELEASE( m_ipConsoleNameSpace2 );
00194   SAFE_RELEASE( m_ipConsole2          );
00195
00196   return S_OK;
00197 }
00198
00199 //---------------------------------------------------------------------------
00200 //  MMC provides a NULL cookie for the static/root node.  In this sample
00201 //  we don't pass that on, instead we use the pointer to our static node
00202 //  object which handles notifications
00203 //
00204 HRESULT CComponentData::QueryDataObject
00205 (
00206   MMC_COOKIE              nCookie,     //[in]  Indentifier of the selected node
00207   DATA_OBJECT_TYPES       nEnumType,   //[in]  Context in which this object was created
00208   LPDATAOBJECT __RPC_FAR* ppDataObject //[out] Points to data object we create
00209 )
00210 {
00211   HRESULT hResult = S_FALSE;
00212   ULONG   uCookie = 0;
00213
00214   CDataObject* pNewObject = new CDataObject();
00215
00216   (0 == nCookie) ? uCookie = (ULONG)m_pStaticNode : uCookie = nCookie;
00217   pNewObject->SetPrivateData( uCookie, (ULONG)nEnumType );
00218
00219   if( NULL == pNewObject )
00220     hResult = E_OUTOFMEMORY;
00221   else
00222     hResult = pNewObject->QueryInterface( IID_IDataObject, (void**)ppDataObject );
00223
00224   return hResult;
00225 }
00226
00227 //---------------------------------------------------------------------------
00228 //  Delegate the call to the static node object
00229 //
00230 HRESULT CComponentData::GetDisplayInfo
00231 (
00232   SCOPEDATAITEM* pScopeDataItem    //[out][in] Points to a SCOPEDATAITEM struct
00233 )
00234 {
00235   _ASSERT( NULL != pScopeDataItem );
00236   HRESULT hResult = S_OK;
00237
00238   // The console will only ask for the name string
00239   if(  pScopeDataItem->mask & SDI_STR )
00240   {
00241     CBaseNode* pNode = reinterpret_cast<CBaseNode*>(pScopeDataItem->lParam);
00242     hResult = pNode->GetDisplayInfo( pScopeDataItem );
00243   }
00244
00245   return hResult;
00246 }
00247
00248 //---------------------------------------------------------------------------
00249 HRESULT CComponentData::CompareObjects
00250 (
00251   LPDATAOBJECT ipDataObjectA,    //[in] First data object to compare
00252   LPDATAOBJECT ipDataObjectB     //[in] Second data object to compare
00253 )
00254 {
00255   return E_NOTIMPL;
00256 }
00257
00258 //---------------------------------------------------------------------------
00259 HRESULT CComponentData::QueryDispatch
00260 (
00261   MMC_COOKIE         nCookie,    //[in]  Item for which IDispatch is requested
00262   DATA_OBJECT_TYPES  eType,      //[in]  Context of item
00263   LPDISPATCH*        pipDispatch //[out] IDispatch pointer
00264 )
00265 {
00266   return E_NOTIMPL;
00267 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyEvictListener/MyEvictListener.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyEvictListener

MyEvictListener.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      MyEvictListener.cpp
00005 //
00006 //  Description:
00007 //      Implementation of CMyEvictListener class.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 #include "stdafx.h"
00012 #include "MyEvictListener.h"
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 //++
00016 //
00017 //  CMyEvictListener::CMyEvictListener
00018 //
00019 //  Description:
00020 //      Constructor of the CMyEvictListener class.
00021 //
00022 //  Arguments:
00023 //      None.
00024 //
00025 //  Return Value:
00026 //      None.
00027 //
00028 //--
00029 //////////////////////////////////////////////////////////////////////////////
00030 CMyEvictListener::CMyEvictListener( void )
00031     : m_lcid( LOCALE_NEUTRAL )
00032     , m_piccCallback( NULL )
00033 {
00034 } //*** CMyEvictListener::CMyEvictListener
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 //++
00038 //
00039 //  CMyEvictListener::~CMyEvictListener
00040 //
00041 //  Description:
00042 //      Destructor of the CMyEvictListener class.
00043 //
00044 //  Arguments:
00045 //      None.
00046 //
00047 //  Return Value:
00048 //      None.
00049 //
00050 //--
00051 //////////////////////////////////////////////////////////////////////////////
00052 CMyEvictListener::~CMyEvictListener( void )
00053 {
00054     // Release the callback interface
00055     if ( m_piccCallback != NULL )
00056     {
00057         m_piccCallback->Release();
00058     } // if: the callback interface pointer is not NULL
00059
00060 } //*** CMyEvictListener::~CMyEvictListener
00061
00062
00063 //***************************************************************************
00064 //
00065 //  IClusCfgEvictListener interface
00066 //
00067 //***************************************************************************
00068
00069 //////////////////////////////////////////////////////////////////////////////
00070 //++
00071 //
00072 //  [IClusCfgEvictListener]
00073 //  CMyEvictListener::EvictNotify
00074 //
00075 //  Description:
00076 //      This function gets called just after a cluster node has been evicted from the cluster.
00077 //
00078 //  Arguments:
00079 //      pcszNodeNameIn
00080 //          [in] Pointer to the name of the node that was evicted.
00081 //
00082 //  Return Value:
00083 //      S_OK
00084 //          Operation completed successfully.
00085 //
00086 //      Other HRESULTs
00087 //          An error occurred.
00088 //
00089 //--
00090 //////////////////////////////////////////////////////////////////////////////
00091 STDMETHODIMP
00092 CMyEvictListener::EvictNotify( LPCWSTR pcszNodeNameIn )
00093 {
00094     //
00095     // TODO: Modify this code to perform your tasks.
00096     //
00097
00098     HRESULT         hr = S_OK;
00099     WCHAR           szMessage[256];
00100
00101     hr = StringCchPrintfW(
00102               szMessage
00103             , RTL_NUMBER_OF( szMessage )
00104             , L"MyEvictListener Message: Node '%ws' has been evicted from the cluster."
00105             , pcszNodeNameIn == NULL ? L"<null>" : pcszNodeNameIn
00106             );
00107
00108     if ( FAILED( hr ) )
00109     {
00110         goto Cleanup;
00111     } // if: StringCchPrintW failed
00112
00113     if ( m_piccCallback != NULL )
00114     {
00115         //
00116         // Log a message to client and server log file informing that a node
00117         // has been evicted from the cluster.
00118         //
00119         hr = m_piccCallback->SendStatusReport(
00120                   NULL      // pcszNodeNameIn - Filled in by cluster config server.
00121                 , TASKID_Major_Client_And_Server_Log
00122                 , IID_NULL
00123                 , 0         // ulMinIn
00124                 , 1         // ulMaxIn
00125                 , 1         // ulCurrentIn
00126                 , hr
00127                 , szMessage
00128                 , NULL      // pftTimeIn - Filled in by cluster config server.
00129                 , NULL      // bstrReferenceIn
00130                 );
00131
00132         if ( FAILED( hr ) )
00133         {
00134             goto Cleanup;
00135         } // if:
00136     } //if: the callback interface pointer is not NULL
00137
00138  Cleanup:
00139
00140     return hr;
00141
00142 } //*** CMyEvictListener::EvictNotify
00143
00144
00145 //***************************************************************************
00146 //
00147 //  IClusCfgInitialize interface
00148 //
00149 //***************************************************************************
00150
00151 //////////////////////////////////////////////////////////////////////////////
00152 //++
00153 //
00154 //  CMyEvictListener::Initialize
00155 //
00156 //  Description:
00157 //      Initialize this component.
00158 //
00159 //  Arguments:
00160 //      punkCallbackIn
00161 //          Pointer to the IUnknown interface of a component that implements
00162 //          the IClusCfgCallback interface.
00163 //
00164 //      lcidIn
00165 //          Locale id for this component.
00166 //
00167 //  Return Value:
00168 //      S_OK
00169 //          If the call succeeded.
00170 //
00171 //      E_POINTER
00172 //          The punkCallbackIn param is NULL.
00173 //
00174 //      Other HRESULTs
00175 //          An error occurred.
00176 //
00177 //--
00178 //////////////////////////////////////////////////////////////////////////////
00179 STDMETHODIMP
00180 CMyEvictListener::Initialize(
00181       IUnknown *   punkCallbackIn
00182     , LCID         lcidIn
00183     )
00184 {
00185     HRESULT hr = S_OK;
00186
00187     m_lcid = lcidIn;
00188
00189     if ( m_piccCallback != NULL )
00190     {
00191         //
00192         // Release the callback interface
00193         //
00194         m_piccCallback->Release();
00195         m_piccCallback = NULL;
00196     } // if: the callback interface pointer is not NULL
00197
00198     if ( punkCallbackIn != NULL )
00199     {
00200         //
00201         // Query for the IClusCfgCallback interface.
00202         //
00203         hr = punkCallbackIn->QueryInterface( __uuidof( IClusCfgCallback ), reinterpret_cast< void ** > ( &m_piccCallback ) );
00204     } // if: the callback punk is not NULL.
00205     else
00206     {
00207         hr = E_POINTER;
00208     } // else: the callback punk is NULL.
00209
00210     return hr;
00211
00212 } //*** CMyEvictListener::Initialize
00213
00214
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/registry.Cpp Source File

  • SysMgmt
  • MMC
  • Ppgeext

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021 #include "Registry.h"
00022 #include "Extend.h"
00023 #include "GUIDs.h"
00024 #include "globals.h"
00025
00026 // if not standalone comment out next line
00027 //#define STANDALONE
00028
00029 // list all nodes that are extendable here
00030 // List the GUID and then the description
00031 // terminate with a NULL, NULL set.
00032 EXTENSION_NODE _ExtendableNodes[] = {
00033     {NULL, NULL}
00034 };
00035
00036 // list all of the nodes that we extend
00037 EXTENDER_NODE _NodeExtensions[] = {
00038     {PropertySheetExtension,
00039     {0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28}},
00040     {0xcfcdc9f3, 0xc50e, 0x11d2, {0x95, 0x2b, 0x0, 0xc0, 0x4f, 0xb9, 0x2e, 0xc2}},
00041     _T("Extension to the Rocket Node")},
00042
00043     {DummyExtension,
00044     NULL,
00045     NULL,
00046     NULL}
00047 };
00048
00049 ////////////////////////////////////////////////////////
00050 //
00051 // Internal helper functions prototypes
00052 //
00053
00054 // Set the given key and its value.
00055 BOOL setKeyAndValue(const _TCHAR* pszPath,
00056                     const _TCHAR* szSubkey,
00057                     const _TCHAR* szValue) ;
00058
00059 // Set the given key and its value in the MMC Snapin location
00060 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00061                           const _TCHAR* szSubkey,
00062                           const _TCHAR* szName,
00063                           const _TCHAR* szValue);
00064
00065 // Set the given valuename under the key to value
00066 BOOL setValue(const _TCHAR* szKey,
00067               const _TCHAR* szValueName,
00068               const _TCHAR* szValue);
00069
00070 BOOL setSnapInExtensionNode(const _TCHAR* szSnapID,
00071                             const _TCHAR* szNodeID,
00072                             const _TCHAR* szDescription);
00073
00074 // Delete szKeyChild and all of its descendents.
00075 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00076
00077 ////////////////////////////////////////////////////////
00078 //
00079 // Constants
00080 //
00081
00082 // Size of a CLSID as a string
00083 //const int CLSID_STRING_SIZE = 39 ;
00084
00085 /////////////////////////////////////////////////////////
00086 //
00087 // Public function implementation
00088 //
00089
00090 //
00091 // Register the component in the registry.
00092 //
00093 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00094                        const CLSID& clsid,         // Class ID
00095                        const _TCHAR* szFriendlyName)       //   IDs
00096 {
00097     // Get server location.
00098     _TCHAR szModule[512] ;
00099     DWORD dwResult =
00100         ::GetModuleFileName(hModule,
00101         szModule,
00102         sizeof(szModule)/sizeof(_TCHAR)) ;
00103
00104     assert(dwResult != 0) ;
00105
00106     // Get CLSID
00107     LPOLESTR wszCLSID = NULL ;
00108     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00109
00110     assert(SUCCEEDED(hr)) ;
00111
00112     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00113
00114     // Build the key CLSID\\{...}
00115     _TCHAR szKey[64] ;
00116     _tcscpy(szKey, _T("CLSID\\")) ;
00117         _tcscat(szKey, pszCLSID) ;
00118
00119     // Add the CLSID to the registry.
00120     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00121
00122     // Add the server filename subkey under the CLSID key.
00123     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00124
00125     // set the threading model
00126     _tcscat(szKey, _T("\\InprocServer32"));
00127     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00128
00129     // Free memory.
00130     CoTaskMemFree(wszCLSID) ;
00131
00132     return S_OK ;
00133 }
00134
00135 //
00136 // Remove the component from the registry.
00137 //
00138 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00139 {
00140     // Get CLSID
00141     LPOLESTR wszCLSID = NULL ;
00142     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00143
00144
00145     // Build the key CLSID\\{...}
00146     _TCHAR szKey[64] ;
00147     _tcscpy(szKey, _T("CLSID\\")) ;
00148
00149     MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00150     _tcscat(szKey, pszT) ;
00151
00152     // Delete the CLSID Key - CLSID\{...}
00153     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00154     assert((lResult == ERROR_SUCCESS) ||
00155                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00156
00157     // Free memory.
00158     CoTaskMemFree(wszCLSID) ;
00159
00160     return S_OK ;
00161 }
00162
00163 //
00164 // Register the snap-in in the registry.
00165 //
00166 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00167                        const _TCHAR* szNameString,   // NameString
00168                        const CLSID& clsidAbout)         // Class Id for About Class
00169
00170 {
00171     // Get CLSID
00172     LPOLESTR wszCLSID = NULL ;
00173     LPOLESTR wszAboutCLSID = NULL;
00174     LPOLESTR wszExtendCLSID = NULL;
00175     LPOLESTR wszNodeCLSID = NULL;
00176     EXTENSION_NODE *pExtensionNode;
00177     EXTENDER_NODE *pNodeExtension;
00178     _TCHAR szKeyBuf[1024] ;
00179     HKEY hKey;
00180
00181     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00182
00183     if (IID_NULL != clsidAbout)
00184         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00185
00186     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00187     MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00188
00189
00190     // Add the CLSID to the registry.
00191     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00192
00193 #ifdef STANDALONE
00194     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00195 #endif
00196
00197     if (IID_NULL != clsidAbout)
00198         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00199
00200     // register each of the node types in _ExtendableNodes as an extendable node
00201     for (pExtensionNode = &(_ExtendableNodes[0]);*pExtensionNode->szDescription;pExtensionNode++)
00202     {
00203         hr = StringFromCLSID(pExtensionNode->GUID, &wszExtendCLSID);
00204         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00205         setSnapInExtensionNode(pszCLSID, pszExtendCLSID, pExtensionNode->szDescription);
00206         CoTaskMemFree(wszExtendCLSID);
00207     }
00208
00209     // register each of the node extensions
00210     for (pNodeExtension = &(_NodeExtensions[0]);*pNodeExtension->szDescription;pNodeExtension++)
00211     {
00212         hr = StringFromCLSID(pNodeExtension->guidNode, &wszExtendCLSID);
00213         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00214         _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00215         _tcscat(szKeyBuf, pszExtendCLSID);
00216
00217         switch (pNodeExtension->eType) {
00218         case NameSpaceExtension:
00219             _tcscat(szKeyBuf, _T("\\Extensions\\NameSpace"));
00220             break;
00221         case ContextMenuExtension:
00222             _tcscat(szKeyBuf, _T("\\Extensions\\ContextMenu"));
00223             break;
00224         case ToolBarExtension:
00225             _tcscat(szKeyBuf, _T("\\Extensions\\ToolBar"));
00226             break;
00227         case PropertySheetExtension:
00228             _tcscat(szKeyBuf, _T("\\Extensions\\PropertySheet"));
00229             break;
00230         case TaskExtension:
00231             _tcscat(szKeyBuf, _T("\\Extensions\\Task"));
00232             break;
00233         case DynamicExtension:
00234             _tcscat(szKeyBuf, _T("\\Dynamic Extensions"));
00235         default:
00236             break;
00237         }
00238
00239         // Create and open key and subkey.
00240         long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00241             szKeyBuf,
00242             0, NULL, REG_OPTION_NON_VOLATILE,
00243             KEY_ALL_ACCESS, NULL,
00244             &hKey, NULL) ;
00245
00246         if (lResult != ERROR_SUCCESS)
00247         {
00248             return FALSE ;
00249         }
00250
00251         hr = StringFromCLSID(pNodeExtension->guidExtension, &wszNodeCLSID);
00252         assert(SUCCEEDED(hr));
00253
00254         MAKE_TSTRPTR_FROMWIDE(pszNodeCLSID, wszNodeCLSID);
00255         // Set the Value.
00256         if (pNodeExtension->szDescription != NULL)
00257         {
00258             RegSetValueEx(hKey, pszNodeCLSID, 0, REG_SZ,
00259                 (BYTE *)pNodeExtension->szDescription,
00260                 (_tcslen(pNodeExtension->szDescription)+1)*sizeof(_TCHAR)) ;
00261         }
00262
00263         RegCloseKey(hKey) ;
00264
00265         CoTaskMemFree(wszExtendCLSID);
00266         CoTaskMemFree(wszNodeCLSID);
00267     }
00268
00269
00270     // Free memory.
00271     CoTaskMemFree(wszCLSID) ;
00272     if (IID_NULL != clsidAbout)
00273         CoTaskMemFree(wszAboutCLSID);
00274
00275     return S_OK ;
00276 }
00277
00278 //
00279 // Unregister the snap-in in the registry.
00280 //
00281 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00282 {
00283     _TCHAR szKeyBuf[1024];
00284     LPOLESTR wszCLSID = NULL;
00285
00286     // Get CLSID
00287     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00288         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00289     // Load the buffer with the Snap-In Location
00290     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00291
00292     // Copy keyname into buffer.
00293     _tcscat(szKeyBuf, _T("\\"));
00294     _tcscat(szKeyBuf, pszCLSID);
00295
00296     // Delete the CLSID Key - CLSID\{...}
00297     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00298     assert((lResult == ERROR_SUCCESS) ||
00299                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00300
00301   //Uncomment following for loop to unregister all extendable node types
00302   //Note that if a snap-in's extendable node types are unregistered,
00303   //any extension snap-ins for these node types will have to be re-registered
00304   //in order to rebuild their entries under the SOFTWARE\Microsoft\MMC\NodeTypes key
00305
00306 /*
00307     // Unregister each of the node types in _ExtendableNodes as an extendable node
00308   // Note that this snap-in does not register any extendable node types
00309
00310     EXTENSION_NODE *pNode;
00311   LPOLESTR wszExtendCLSID = NULL;
00312
00313     for (pNode = &(_ExtendableNodes[0]);*pNode->szDescription;pNode++)
00314     {
00315         hr = StringFromCLSID(pNode->GUID, &wszExtendCLSID);
00316         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00317
00318         // Load the buffer with the Snap-In Location
00319         _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00320         // Copy keyname into buffer.
00321         _tcscat(szKeyBuf, pszExtendCLSID);
00322         recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00323         CoTaskMemFree(wszExtendCLSID);
00324     }
00325
00326 */
00327
00328     // free the memory
00329     CoTaskMemFree(wszCLSID);
00330
00331     return S_OK;
00332 }
00333
00334 //
00335 // Delete a key and all of its descendents.
00336 //
00337 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00338                         const _TCHAR* lpszKeyChild)  // Key to delete
00339 {
00340     // Open the child.
00341     HKEY hKeyChild ;
00342     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00343         KEY_ALL_ACCESS, &hKeyChild) ;
00344     if (lRes != ERROR_SUCCESS)
00345     {
00346         return lRes ;
00347     }
00348
00349     // Enumerate all of the decendents of this child.
00350     FILETIME time ;
00351     _TCHAR szBuffer[256] ;
00352     DWORD dwSize = 256 ;
00353     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00354         NULL, NULL, &time) == S_OK)
00355     {
00356         // Delete the decendents of this child.
00357         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00358         if (lRes != ERROR_SUCCESS)
00359         {
00360             // Cleanup before exiting.
00361             RegCloseKey(hKeyChild) ;
00362             return lRes;
00363         }
00364         dwSize = 256 ;
00365     }
00366
00367     // Close the child.
00368     RegCloseKey(hKeyChild) ;
00369
00370     // Delete this child.
00371     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00372 }
00373
00374 //
00375 // Create a key and set its value.
00376 //   - This helper function was borrowed and modifed from
00377 //     Kraig Brockschmidt's book Inside OLE.
00378 //
00379 BOOL setKeyAndValue(const _TCHAR* szKey,
00380                     const _TCHAR* szSubkey,
00381                     const _TCHAR* szValue)
00382 {
00383     HKEY hKey;
00384     _TCHAR szKeyBuf[1024] ;
00385
00386     // Copy keyname into buffer.
00387     _tcscpy(szKeyBuf, szKey) ;
00388
00389     // Add subkey name to buffer.
00390     if (szSubkey != NULL)
00391     {
00392         _tcscat(szKeyBuf, _T("\\")) ;
00393         _tcscat(szKeyBuf, szSubkey ) ;
00394     }
00395
00396     // Create and open key and subkey.
00397     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00398         szKeyBuf,
00399         0, NULL, REG_OPTION_NON_VOLATILE,
00400         KEY_ALL_ACCESS, NULL,
00401         &hKey, NULL) ;
00402     if (lResult != ERROR_SUCCESS)
00403     {
00404         return FALSE ;
00405     }
00406
00407     // Set the Value.
00408     if (szValue != NULL)
00409     {
00410         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00411             (BYTE *)szValue,
00412             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00413     }
00414
00415     RegCloseKey(hKey) ;
00416     return TRUE ;
00417 }
00418
00419 //
00420 // Open a key value and set it
00421 //
00422 BOOL setValue(const _TCHAR* szKey,
00423               const _TCHAR* szValueName,
00424               const _TCHAR* szValue)
00425 {
00426     HKEY hKey;
00427     _TCHAR szKeyBuf[1024] ;
00428
00429     // Copy keyname into buffer.
00430     _tcscpy(szKeyBuf, szKey) ;
00431
00432     // Create and open key and subkey.
00433     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00434         szKeyBuf,
00435         0, NULL, REG_OPTION_NON_VOLATILE,
00436         KEY_ALL_ACCESS, NULL,
00437         &hKey, NULL) ;
00438     if (lResult != ERROR_SUCCESS)
00439     {
00440         return FALSE ;
00441     }
00442
00443     // Set the Value.
00444     if (szValue != NULL)
00445     {
00446         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00447             (BYTE *)szValue,
00448             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00449     }
00450
00451     RegCloseKey(hKey) ;
00452     return TRUE ;
00453 }
00454
00455 //
00456 // Create a key and set its value.
00457 //   - This helper function was borrowed and modifed from
00458 //     Kraig Brockschmidt's book Inside OLE.
00459 //
00460 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00461                           const _TCHAR* szSubkey,
00462                           const _TCHAR* szName,
00463                           const _TCHAR* szValue)
00464 {
00465     HKEY hKey;
00466     _TCHAR szKeyBuf[1024] ;
00467
00468     // Load the buffer with the Snap-In Location
00469     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00470
00471     // Copy keyname into buffer.
00472     _tcscat(szKeyBuf, _T("\\")) ;
00473     _tcscat(szKeyBuf, szKey) ;
00474
00475     // Add subkey name to buffer.
00476     if (szSubkey != NULL)
00477     {
00478         _tcscat(szKeyBuf, _T("\\")) ;
00479         _tcscat(szKeyBuf, szSubkey ) ;
00480     }
00481
00482     // Create and open key and subkey.
00483     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00484         szKeyBuf,
00485         0, NULL, REG_OPTION_NON_VOLATILE,
00486         KEY_ALL_ACCESS, NULL,
00487         &hKey, NULL) ;
00488     if (lResult != ERROR_SUCCESS)
00489     {
00490         return FALSE ;
00491     }
00492
00493     // Set the Value.
00494     if (szValue != NULL)
00495     {
00496         RegSetValueEx(hKey, szName, 0, REG_SZ,
00497             (BYTE *)szValue,
00498             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00499     }
00500
00501     RegCloseKey(hKey) ;
00502     return TRUE ;
00503 }
00504
00505 BOOL setSnapInExtensionNode(const _TCHAR* szSnapID,
00506                             const _TCHAR* szNodeID,
00507                             const _TCHAR* szDescription)
00508 {
00509     HKEY hKey;
00510     _TCHAR szSnapNodeKeyBuf[1024] ;
00511     _TCHAR szMMCNodeKeyBuf[1024];
00512
00513     // Load the buffer with the Snap-In Location
00514     _tcscpy(szSnapNodeKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns\\"));
00515     // add in the clisid into buffer.
00516     _tcscat(szSnapNodeKeyBuf, szSnapID) ;
00517     _tcscat(szSnapNodeKeyBuf, _T("\\NodeTypes\\"));
00518     _tcscat(szSnapNodeKeyBuf, szNodeID) ;
00519
00520     // Load the buffer with the NodeTypes Location
00521     _tcscpy(szMMCNodeKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00522     _tcscat(szMMCNodeKeyBuf, szNodeID) ;
00523
00524     // Create and open the Snapin Key.
00525     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00526         szSnapNodeKeyBuf,
00527         0, NULL, REG_OPTION_NON_VOLATILE,
00528         KEY_ALL_ACCESS, NULL,
00529         &hKey, NULL) ;
00530     if (lResult != ERROR_SUCCESS)
00531     {
00532         return FALSE ;
00533     }
00534
00535     // Set the Value.
00536     if (szDescription != NULL)
00537     {
00538         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00539             (BYTE *)szDescription,
00540             (_tcslen(szDescription)+1)*sizeof(_TCHAR)) ;
00541     }
00542
00543     RegCloseKey(hKey) ;
00544
00545     // Create and open the NodeTypes Key.
00546     lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00547         szMMCNodeKeyBuf,
00548         0, NULL, REG_OPTION_NON_VOLATILE,
00549         KEY_ALL_ACCESS, NULL,
00550         &hKey, NULL) ;
00551     if (lResult != ERROR_SUCCESS)
00552     {
00553         return FALSE ;
00554     }
00555
00556     // Set the Value.
00557     if (szDescription != NULL)
00558     {
00559         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00560             (BYTE *)szDescription,
00561             (_tcslen(szDescription)+1)*sizeof(_TCHAR)) ;
00562     }
00563
00564     RegCloseKey(hKey) ;
00565
00566     return TRUE ;
00567 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/CascadeEC/cascadeec.Idl Source File

  • Com
  • Services
  • Events
  • EventNews
  • CascadeEC

cascadeec.Idl

Go to the documentation of this file.
00001 // CascadeEC.idl : IDL source for CascadeEC.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (CascadeEC.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009 import "..\include\news.idl";
00010
00011 [
00012   uuid(7508F170-0FC1-11D3-925A-0080C7C30D72),
00013   version(1.0),
00014   helpstring("CascadeEC 1.0 Type Library")
00015 ]
00016 library CASCADEECLib
00017 {
00018   importlib("stdole32.tlb");
00019   importlib("stdole2.tlb");
00020
00021   [
00022     uuid(8CE4A9E0-0FC1-11D3-925A-0080C7C30D72),
00023     helpstring("Cascade Class")
00024   ]
00025   coclass CascadeEC
00026   {
00027     [default] interface INewsEvent;
00028   };
00029 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Check_SD/SecObjects.c Source File

  • Security
  • Authorization
  • Check_SD

SecObjects.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1997 - 2000.  Microsoft Corporation.  All rights reserved
00008
00009 Module Name:
00010
00011     secobjects.c
00012
00013 Abstract:
00014
00015     this module contains the variety of functions to obtain the security
00016     descriptor for a variety of securables objects.
00017
00018     DumpFileKey()      - file or directory
00019     DumpKernelObject() - event, mutex, semaphore, process, process access
00020                          token, file mapping, named pipe, mailslot,
00021     DumpNetShare()     - network share
00022     DumpPrinter()      - printer
00023     DumpRegistryKey()  - registry key
00024     DumpService()      - service
00025     DumpUserObject()   - desktop, window station
00026
00027 --*/
00028
00029 #include "check_sd.h"
00030 #include <lm.h>
00031 #include <tchar.h>
00032 #include <stdio.h>
00033
00034 void DumpFile(LPTSTR pszFile, TCHAR c)
00035 {
00036      DWORD                dwSize = 0;
00037      PSECURITY_DESCRIPTOR psd = NULL;
00038      SECURITY_INFORMATION si  = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION;
00039
00040      //
00041      // enable the privilege
00042      //
00043      Privilege(SE_SECURITY_NAME, TRUE);
00044
00045      //
00046      // get the size
00047      //
00048      if (!GetFileSecurity(pszFile, si, psd, dwSize, &dwSize)){
00049           if (GetLastError() == ERROR_INSUFFICIENT_BUFFER){
00050                psd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, dwSize);
00051                if (psd == NULL)
00052                     DisplayError(GetLastError(), TEXT("LocalAlloc"));
00053
00054           if (!GetFileSecurity(pszFile, si, psd, dwSize, &dwSize))
00055                DisplayError(GetLastError(), TEXT("GetFileSecurity"));
00056           }
00057           else
00058                DisplayError(GetLastError(), TEXT("GetFileSecurity"));
00059      }
00060    else{
00061           printf("GetFileSecurity succeeded when it was expected to fail.\n");
00062       ExitProcess(0);
00063    }
00064
00065      //
00066      // enable the privilege
00067      //
00068      Privilege(SE_SECURITY_NAME, FALSE);
00069
00070      //
00071      // dump security descriptor
00072      //
00073      DumpSD(psd, c);
00074
00075      //
00076      // free the buffer
00077      //
00078    if (NULL != psd)
00079    {
00080           if (LocalFree((HLOCAL)psd))
00081                DisplayError(GetLastError(), TEXT("LocalFree"));
00082    }
00083 }
00084
00085 void DumpKernelObject(LPTSTR pszObject, TCHAR c)
00086 {
00087      DWORD                dwPid;
00088      DWORD                dwSize = 0;
00089      HANDLE               hObject;
00090      HANDLE               hProcess;
00091      PSECURITY_DESCRIPTOR psd = NULL;
00092      SECURITY_INFORMATION si  = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION;
00093
00094      //
00095      // enable the privilege
00096      //
00097      Privilege(SE_SECURITY_NAME, TRUE);
00098
00099      //
00100      // obtain a handle
00101      //
00102      switch (c){
00103           case 'e':
00104                hObject = OpenEvent(READ_CONTROL | ACCESS_SYSTEM_SECURITY, FALSE, pszObject);
00105                if (hObject == NULL)
00106                     DisplayError(GetLastError(), TEXT("OpenEvent"));
00107                break;
00108           case 'm':
00109                hObject = OpenMutex(READ_CONTROL | ACCESS_SYSTEM_SECURITY, FALSE, pszObject);
00110                if (hObject == NULL)
00111                     DisplayError(GetLastError(), TEXT("OpenMutex"));
00112                break;
00113           case 's':
00114                hObject = OpenSemaphore(READ_CONTROL | ACCESS_SYSTEM_SECURITY, FALSE, pszObject);
00115                if (hObject == NULL)
00116                     DisplayError(GetLastError(), TEXT("OpenSemaphore"));
00117                break;
00118           case 'p':
00119                //
00120                // convert name to a pid
00121                //
00122                dwPid = _ttol(pszObject);
00123
00124                hObject = OpenProcess(READ_CONTROL | ACCESS_SYSTEM_SECURITY, FALSE, dwPid);
00125                if (hObject == NULL)
00126                     DisplayError(GetLastError(), TEXT("OpenProcess"));
00127                break;
00128
00129           case 'o':
00130                dwPid = _ttol(pszObject);
00131
00132                //
00133                // SD in access token does not support SACLS
00134                //
00135                si  = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
00136
00137                hProcess= OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwPid);
00138                if (hProcess == NULL)
00139                     DisplayError(GetLastError(), TEXT("OpenProcess"));
00140
00141                if (!OpenProcessToken(hProcess, READ_CONTROL, &hObject))
00142                     DisplayError(GetLastError(), TEXT("OpenProcessToken"));
00143
00144                if (!CloseHandle(hProcess))
00145                     DisplayError(GetLastError(), TEXT("CloseHandle"));
00146                break;
00147           case 'i':
00148                hObject = OpenFileMapping(READ_CONTROL | ACCESS_SYSTEM_SECURITY, FALSE, pszObject);
00149                if (hObject == NULL)
00150                     DisplayError(GetLastError(), TEXT("OpenFileMapping"));
00151                break;
00152           case 'a':
00153           case 'n':
00154                hObject = CreateFile(pszObject, READ_CONTROL | ACCESS_SYSTEM_SECURITY, 0, NULL, OPEN_EXISTING, 0, NULL);
00155                if (hObject == INVALID_HANDLE_VALUE)
00156                     DisplayError(GetLastError(), TEXT("CreateFile"));
00157           default:
00158                break;
00159      }
00160
00161      //
00162      // disable the privilege
00163      //
00164      Privilege(SE_SECURITY_NAME, FALSE);
00165
00166      //
00167      // obtain the size
00168      //
00169      if (!GetKernelObjectSecurity(hObject, si, psd, dwSize, &dwSize)){
00170           if (GetLastError() == ERROR_INSUFFICIENT_BUFFER){
00171                psd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, dwSize);
00172                if (psd == NULL)
00173                     DisplayError(GetLastError(), TEXT("LocalAlloc"));
00174
00175                if (!GetKernelObjectSecurity(hObject, si, psd, dwSize, &dwSize))
00176                     DisplayError(GetLastError(), TEXT("GetKernelObjectSecurity"));
00177           }
00178           else
00179                 DisplayError(GetLastError(), TEXT("GetKernelObjectSecurity"));
00180      }
00181    else{
00182         printf("GetFileSecurity succeeded when it was expected to fail.\n");
00183       ExitProcess(0);
00184    }
00185
00186      //
00187      // dump security descriptor
00188      //
00189      DumpSD(psd, c);
00190
00191      //
00192      // free the buffer
00193      //
00194    if (NULL != psd)
00195           if (LocalFree((HLOCAL)psd))
00196                DisplayError(GetLastError(), TEXT("LocalFree"));
00197
00198      if (!CloseHandle(hObject))
00199           DisplayError(GetLastError(), TEXT("CloseHandle"));
00200 }
00201
00202 void DumpNetShare(LPTSTR pszShare)
00203 {
00204      DWORD                dwSize = 0;
00205      LPTSTR               pszShareAdjusted;
00206      LPTSTR               pszShareName;
00207      NET_API_STATUS       nas;
00208      PSECURITY_DESCRIPTOR psd   = NULL;
00209      PSHARE_INFO_502      psi502;
00210      TCHAR                szServer[CNLEN] = TEXT("");
00211
00212 #ifndef UNICODE
00213      WCHAR                szWServer[CNLEN] = L"";
00214      WCHAR                szWShare[NNLEN]  = L"";
00215 #endif
00216
00217      //
00218      // remove \\ if exists
00219      //
00220      pszShareAdjusted = _tcsstr(pszShare, TEXT("\\\\"));
00221      if (pszShareAdjusted != NULL)
00222           pszShareAdjusted = pszShareAdjusted + 2;
00223      else
00224           pszShareAdjusted = pszShare;
00225
00226      //
00227      // find the subkey
00228      //
00229      pszShareName = _tcschr(pszShareAdjusted, '\\');
00230      if (pszShareName == NULL)
00231           return;
00232      else
00233           pszShareName++;
00234
00235      //
00236      // find the main key
00237      //
00238      if (!_tcsncpy(szServer, pszShareAdjusted, (UINT)(pszShareName - pszShareAdjusted - 1)))
00239           DisplayError(GetLastError(), TEXT("_tcsncpy"));
00240
00241
00242 #ifndef UNICODE
00243
00244      //
00245      // handle ANSI situation
00246      //
00247      if (!MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)szServer, -1, szWServer, sizeof(szWServer)))
00248           DisplayError(GetLastError(), TEXT("MultiByteToWideChar"));
00249
00250      if(!MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)pszShareName, -1, szWShare, sizeof(szWShare)))
00251           DisplayError(GetLastError(), TEXT("MultiByteToWideChar"));
00252
00253      nas = NetShareGetInfo(szWServer, szWShare, 502, (LPBYTE *)&psi502);
00254
00255 #else
00256
00257      nas = NetShareGetInfo(szServer, pszShareName, 502, (LPBYTE *)&psi502);
00258
00259 #endif
00260
00261      if (nas != NERR_Success)
00262           DisplayError(nas, TEXT("NetShareGetInfo"));
00263
00264      //
00265      // obtain the SD
00266      //
00267      psd = psi502->shi502_security_descriptor;
00268
00269      //
00270      // dump security descriptor
00271      //
00272      DumpSD(psd, 't');
00273
00274      //
00275      // free the buffer
00276      //
00277      nas = NetApiBufferFree((LPVOID)psi502);
00278      if (nas != NERR_Success)
00279           DisplayError(nas, TEXT("NetApiBufferFree"));
00280
00281 }
00282
00283 void DumpPrinter(LPTSTR pszPrinter)
00284 {
00285      DWORD                dwSize = 0;
00286      HANDLE               hPrinter;
00287      PRINTER_DEFAULTS     pd;
00288      PRINTER_INFO_3       *ppi3 = NULL;
00289      PSECURITY_DESCRIPTOR psd   = NULL;
00290
00291      ZeroMemory(&pd, sizeof(PRINTER_DEFAULTS));
00292      pd.DesiredAccess = READ_CONTROL;
00293
00294      //
00295      // obtain a handle to the printer
00296      //
00297      if (!OpenPrinter(pszPrinter, &hPrinter, &pd))
00298           DisplayError(GetLastError(), TEXT("OpenPrinter"));
00299
00300      //
00301      // get the size
00302      //
00303      if (!GetPrinter(hPrinter, 3, (LPBYTE)ppi3, dwSize, &dwSize)){
00304           if (GetLastError() == ERROR_INSUFFICIENT_BUFFER){
00305                ppi3 = (PPRINTER_INFO_3)LocalAlloc(LPTR, dwSize);
00306                if (ppi3 == NULL)
00307                     DisplayError(GetLastError(), TEXT("LocalAlloc"));
00308
00309                if (!GetPrinter(hPrinter, 3, (LPBYTE)ppi3, dwSize, &dwSize))
00310                     DisplayError(GetLastError(), TEXT("GetPrinter"));
00311           }
00312      }
00313    else{
00314         printf("GetPrinter succeeded when it was expected to fail.\n");
00315       ExitProcess(0);
00316    }
00317
00318
00319      //
00320      // cast buffer
00321      //
00322      psd = ppi3->pSecurityDescriptor;
00323
00324      //
00325      // dump security descriptor information
00326      //
00327      DumpSDInfo(psd);
00328
00329      //
00330      // dump the control bits
00331      //
00332      DumpControl(psd);
00333
00334      //
00335      // get the owner
00336      //
00337      DumpOwnerGroup(psd, TRUE);
00338
00339      //
00340      // get the group
00341      //
00342      DumpOwnerGroup(psd, FALSE);
00343
00344      //
00345      // get the dacl
00346      //
00347      DumpDacl(psd, 'l', TRUE);
00348
00349      //
00350      // printer object does not have a SACL
00351      //
00352
00353      //
00354      // free the buffer
00355      //
00356      if (!ppi3)
00357       if (LocalFree((HLOCAL)ppi3))
00358                DisplayError(GetLastError(), TEXT("LocalFree"));
00359
00360      if (!ClosePrinter(hPrinter))
00361           DisplayError(GetLastError(), TEXT("ClosePrinter"));
00362 }
00363
00364 void DumpRegistryKey(LPTSTR pszKey)
00365 {
00366      DWORD                dwAccess = READ_CONTROL;
00367      DWORD                dwSize = 0;
00368      HKEY                 hKey;
00369      HKEY                 hMainKey;
00370      LONG                 lErrorCode;
00371      LPTSTR               pszSubKey = NULL;
00372      PSECURITY_DESCRIPTOR psd = NULL;
00373      SECURITY_INFORMATION si;
00374      TCHAR                szMainKey[256] = TEXT("");
00375
00376      //
00377      // find the subkey
00378      //
00379      pszSubKey = _tcschr(pszKey, '\\');
00380      if (pszSubKey == NULL){
00381           if (!lstrcpy(szMainKey, pszKey))
00382            DisplayError(GetLastError(), TEXT("lstrcpy"));
00383
00384           si = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
00385      }
00386      else{
00387           pszSubKey++;
00388
00389           //
00390           // find the main key
00391           //
00392           if(!_tcsncpy(szMainKey, pszKey, (UINT)(pszSubKey - pszKey - 1)))
00393                DisplayError(GetLastError(), TEXT("_tcsncpy"));
00394
00395           si = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION;
00396      }
00397
00398      //
00399      // parse the main key
00400      //
00401      if (!lstrcmp(szMainKey, TEXT("HKEY_LOCAL_MACHINE"))){
00402           hMainKey = HKEY_LOCAL_MACHINE;
00403      }
00404      else if (!lstrcmp(szMainKey, TEXT("HKEY_CLASSES_ROOT"))){
00405           hMainKey = HKEY_CLASSES_ROOT;
00406      }
00407      else if (!lstrcmp(szMainKey, TEXT("HKEY_USERS"))){
00408           hMainKey = HKEY_USERS;
00409      }
00410      else if (!lstrcmp(szMainKey, TEXT("HKEY_CURRENT_USER"))){
00411           hMainKey = HKEY_CURRENT_USER;
00412      }
00413      else if (!lstrcmp(szMainKey, TEXT("HKEY_CLASSES_ROOT"))){
00414           hMainKey = HKEY_CLASSES_ROOT;
00415      }
00416      else
00417           hMainKey = 0;
00418
00419      //
00420      // enable the privilege
00421      //
00422      if (pszSubKey != NULL){
00423           Privilege(SE_SECURITY_NAME, TRUE);
00424           dwAccess |= ACCESS_SYSTEM_SECURITY;
00425      }
00426
00427      //
00428      // open the key
00429      //
00430      lErrorCode = RegOpenKeyEx(hMainKey, pszSubKey, 0, dwAccess, &hKey);
00431      if (lErrorCode != ERROR_SUCCESS)
00432           DisplayError(lErrorCode, TEXT("RegOpenKeyEx"));
00433
00434      //
00435      // disable the privilege
00436      //
00437      if (pszSubKey != NULL)
00438           Privilege(SE_SECURITY_NAME, FALSE);
00439
00440      //
00441      // get key security information
00442      //
00443      lErrorCode = RegGetKeySecurity(hKey, si, psd, &dwSize);
00444      if (lErrorCode == ERROR_INSUFFICIENT_BUFFER){
00445           //
00446           // allocate memory for psd
00447           //
00448           psd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, dwSize);
00449           if (psd == NULL)
00450                DisplayError(GetLastError(), TEXT("LocalAlloc"));
00451
00452           //
00453           // call the api again
00454           //
00455           lErrorCode = RegGetKeySecurity(hKey, si, psd, &dwSize);
00456           if (lErrorCode != ERROR_SUCCESS)
00457                DisplayError(lErrorCode, TEXT("RegGetKeySecurity"));
00458      }
00459      else
00460           DisplayError(lErrorCode, TEXT("RegGetKeySecurity"));
00461
00462      //
00463      // dump security descriptor
00464      //
00465      DumpSD(psd, 'r');
00466
00467      //
00468      // free the buffer
00469      //
00470      if (LocalFree((HLOCAL)psd))
00471           DisplayError(GetLastError(), TEXT("LocalFree"));
00472
00473      //
00474      // close the key
00475      //
00476      lErrorCode = RegCloseKey(hKey);
00477      if (lErrorCode != ERROR_SUCCESS)
00478           DisplayError(lErrorCode, TEXT("RegCloseKey"));
00479 }
00480
00481 void DumpService(LPTSTR pszServer, LPTSTR pszService)
00482 {
00483      DWORD                dwSize = 0;
00484      PSECURITY_DESCRIPTOR psd = (PSECURITY_DESCRIPTOR)1;  // if initialized to NULL, QueryServiceObjectSecurity() returns error code 87
00485      SC_HANDLE            schService;
00486      SC_HANDLE            schManager;
00487      SECURITY_INFORMATION si  = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION;
00488
00489      schManager = OpenSCManager(pszServer, NULL, SC_MANAGER_CONNECT);
00490      if (schManager == NULL)
00491           DisplayError(GetLastError(), TEXT("OpenSCManager"));
00492
00493      //
00494      // enable the privilege
00495      //
00496      Privilege(SE_SECURITY_NAME, TRUE);
00497
00498      schService = OpenService(schManager, pszService, READ_CONTROL | ACCESS_SYSTEM_SECURITY);
00499      if (schService == NULL)
00500           DisplayError(GetLastError(), TEXT("OpenService"));
00501
00502      //
00503      // disable the privilege
00504      //
00505      Privilege(SE_SECURITY_NAME, FALSE);
00506
00507      //
00508      // obtain the size
00509      //
00510      if (!QueryServiceObjectSecurity(schService, si, psd, dwSize, &dwSize)){
00511           if (GetLastError() == ERROR_INSUFFICIENT_BUFFER){
00512                psd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, dwSize);
00513                if (psd == NULL)
00514                     DisplayError(GetLastError(), TEXT("LocalAlloc"));
00515
00516           if (!QueryServiceObjectSecurity(schService, si, psd, dwSize, &dwSize))
00517                DisplayError(GetLastError(), TEXT("QueryServicelObjectSecurity"));
00518           }
00519           else
00520                DisplayError(GetLastError(), TEXT("QueryServiceObjectSecurity"));
00521      }
00522    else{
00523         printf("QueryServiceObjectSecurity succeeded when it was expected to fail.\n");
00524       ExitProcess(0);
00525    }
00526
00527
00528
00529      //
00530      // dump security descriptor
00531      //
00532      DumpSD(psd, 'v');
00533
00534      //
00535      // free the buffer
00536      //
00537      if(LocalFree((HLOCAL)psd))
00538         DisplayError(GetLastError(), TEXT("LocalFree"));
00539
00540      if (!CloseServiceHandle(schService))
00541           DisplayError(GetLastError(), TEXT("CloseServiceHandle"));
00542
00543      if (!CloseServiceHandle(schManager))
00544           DisplayError(GetLastError(), TEXT("CloseServiceHandle"));
00545 }
00546
00547 void DumpUserObject(LPTSTR pszObject, TCHAR c)
00548 {
00549      DWORD                dwSize = 0;
00550      HANDLE               hObject;
00551      HWINSTA              hwinsta;
00552      HWINSTA              hwinstaCurrent;
00553      LPTSTR               pszDesktop;
00554      PSECURITY_DESCRIPTOR psd = NULL;
00555      SECURITY_INFORMATION si  = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION;
00556      TCHAR                szWinsta[256] = TEXT("");
00557
00558      //
00559      // enable the privilege
00560      //
00561      Privilege(SE_SECURITY_NAME, TRUE);
00562
00563      //
00564      // obtain a handle
00565      //
00566      switch (c){
00567           case 'w':
00568                hObject = OpenWindowStation(pszObject, FALSE, READ_CONTROL | ACCESS_SYSTEM_SECURITY);
00569                if (hObject == NULL)
00570                     DisplayError(GetLastError(), TEXT("OpenWindowStation"));
00571                break;
00572
00573           case 'k':
00574                //
00575                // find the desktop
00576                //
00577                pszDesktop = _tcschr(pszObject, '\\');
00578                if (pszDesktop == NULL)
00579                     return;
00580                else
00581                     pszDesktop++;
00582
00583                //
00584                // find the main key
00585                //
00586                if (!_tcsncpy(szWinsta, pszObject, (UINT)(pszDesktop - pszObject - 1)))
00587                     DisplayError(GetLastError(), TEXT("_tcsncpy"));
00588
00589                //
00590                // obtain a handle to the window station
00591                //
00592                hwinsta = OpenWindowStation(szWinsta, FALSE, WINSTA_ENUMDESKTOPS);
00593                if (hwinsta == NULL)
00594                     DisplayError(GetLastError(), TEXT("OpenWindowStation"));
00595
00596                hwinstaCurrent = GetProcessWindowStation();
00597                if (hwinstaCurrent == NULL)
00598                     DisplayError(GetLastError(), TEXT("GetProcessWindowStation"));
00599
00600                if (!SetProcessWindowStation(hwinsta))
00601                     DisplayError(GetLastError(), TEXT("SetProcessWindowStation"));
00602
00603                hObject = OpenDesktop(pszDesktop, 0, FALSE, READ_CONTROL | ACCESS_SYSTEM_SECURITY);
00604                if (hObject == NULL)
00605                     DisplayError(GetLastError(), TEXT("OpenDesktop"));
00606
00607                if (!SetProcessWindowStation(hwinstaCurrent))
00608                     DisplayError(GetLastError(), TEXT("SetProcessWindowStation"));
00609
00610                if (!CloseWindowStation(hwinsta))
00611                     DisplayError(GetLastError(), TEXT("CloseWindowStation"));
00612                break;
00613           default:
00614                break;
00615      }
00616
00617      //
00618      // disable the privilege
00619      //
00620      Privilege(SE_SECURITY_NAME, FALSE);
00621
00622      //
00623      // obtain the size
00624      //
00625      if (!GetUserObjectSecurity(hObject, &si, psd, dwSize, &dwSize)){
00626           if (GetLastError() == ERROR_INSUFFICIENT_BUFFER){
00627                psd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, dwSize);
00628                if (psd == NULL)
00629                     DisplayError(GetLastError(), TEXT("LocalAlloc"));
00630
00631                if (!GetUserObjectSecurity(hObject, &si, psd, dwSize, &dwSize))
00632                     DisplayError(GetLastError(), TEXT("GetUserObjectSecurity"));
00633            }
00634            else
00635                 DisplayError(GetLastError(), TEXT("GetUserObjectSecurity"));
00636      }
00637    else{
00638         printf("GetUserObjectSecurity succeeded when it was expected to fail.\n");
00639       ExitProcess(0);
00640    }
00641
00642      //
00643      // dump security descriptor
00644      //
00645      DumpSD(psd, c);
00646
00647      //
00648      // free the buffer
00649      //
00650      if (LocalFree((HLOCAL)psd))
00651         DisplayError(GetLastError(), TEXT("LocalFree"));
00652
00653      if (!CloseHandle(hObject))
00654           DisplayError(GetLastError(), TEXT("CloseHandle"));
00655 }
00656
00657
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/PermEvents.h Source File

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

PermEvents.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  PermEvents.h
00006 //
00007 // Description:
00008 //    main header file for the PermEvents application
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #if !defined(AFX_PermEvents_H__E8685698_0774_11D1_AD85_00AA00B8E05A__INCLUDED_)
00015 #define AFX_PermEvents_H__E8685698_0774_11D1_AD85_00AA00B8E05A__INCLUDED_
00016
00017 #if _MSC_VER >= 1000
00018 #pragma once
00019 #endif // _MSC_VER >= 1000
00020
00021 #ifndef __AFXWIN_H__
00022   #error include 'stdafx.h' before including this file for PCH
00023 #endif
00024
00025 #include "resource.h"   // main symbols
00026 #include "factory.h"
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CPermEventsApp:
00030 // See PermEvents.cpp for the implementation of this class
00031 //
00032
00033 class CPermEventsApp : public CWinApp
00034 {
00035 public:
00036   CPermEventsApp();
00037
00038 // Overrides
00039   // ClassWizard generated virtual function overrides
00040   //{{AFX_VIRTUAL(CPermEventsApp)
00041   public:
00042   virtual BOOL InitInstance();
00043   //}}AFX_VIRTUAL
00044
00045   int ExitInstance();
00046
00047 // Implementation
00048
00049   //{{AFX_MSG(CPermEventsApp)
00050     // NOTE - the ClassWizard will add and remove member functions here.
00051     //    DO NOT EDIT what you see in these blocks of generated code !
00052   //}}AFX_MSG
00053   DECLARE_MESSAGE_MAP()
00054
00055 private:
00056   DWORD m_clsReg;
00057   CProviderFactory *m_factory;
00058
00059   void RegisterServer(void);
00060   void UnregisterServer(void);
00061 };
00062
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065
00066 //{{AFX_INSERT_LOCATION}}
00067 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00068
00069 #endif // !defined(AFX_PermEvents_H__E8685698_0774_11D1_AD85_00AA00B8E05A__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlElem.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

HtmlElem.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       htmlelem.hxx
00006 //
00007 //  Contents:   Html Element classes
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __HTMLELEM_HXX__ )
00012 #define __HTMLELEM_HXX__
00013
00014 #include <htmlfilt.hxx>
00015 #include <serstrm.hxx>
00016
00017 const TEMP_BUFFER_SIZE = 50;               // Size of temporary GetText buffer
00018 const MAX_PROPSPEC_STRING_LENGTH = 128;    // Size of propspec string for meta and script tags
00019
00020 //+-------------------------------------------------------------------------
00021 //
00022 //  Class:      CHtmlElement
00023 //
00024 //  Purpose:    Abstracts the parsing algorithms for different Html tags
00025 //
00026 //--------------------------------------------------------------------------
00027
00028 class CHtmlElement
00029 {
00030
00031 public:
00032     CHtmlElement( CHtmlIFilter& htmlIFilter, CSerialStream& serialStream );
00033     virtual          ~CHtmlElement()            {}
00034
00035     virtual SCODE    GetChunk( STAT_CHUNK *pStat ) = 0;
00036     virtual SCODE    GetText( ULONG *pcwcOutput, WCHAR *awcBuffer ) = 0;
00037     virtual SCODE    GetValue( PROPVARIANT ** ppPropValue );
00038
00039     virtual void     InitStatChunk( STAT_CHUNK *pStat ) = 0;
00040     virtual void     InitFilterRegion( ULONG& idChunkSource,
00041                                        ULONG& cwcStartSource,
00042                                        ULONG& cwcLenSource );
00043
00044 protected:
00045     SCODE            SwitchToNextHtmlElement( STAT_CHUNK *pStat );
00046     SCODE            SkipRemainingTextAndGotoNextChunk( STAT_CHUNK *pStat );
00047
00048     CHtmlIFilter &        _htmlIFilter;         // Reference to Html IFilter
00049     CSerialStream &       _serialStream;        // Reference to input stream
00050     CHtmlScanner          _scanner;             // Scanner
00051     WCHAR                 _aTempBuffer[TEMP_BUFFER_SIZE];  // Temporary GetText buffer
00052 };
00053
00054
00055 #endif // __HTMLELEM_HXX__
00056
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_RSUMINFO Member List

This is the complete list of members for _RSUMINFO, including all inherited members.
byteOrder | _RSUMINFO
classId | _RSUMINFO
cSections | _RSUMINFO
fileOffset | _RSUMINFO
formatVersion | _RSUMINFO
getOSVersion | _RSUMINFO
osVersion | _RSUMINFO
rgPropSet | _RSUMINFO
section | _RSUMINFO
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/SDKSamplePlaylistParser.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

SDKSamplePlaylistParser.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            SDKSamplePlaylistParser.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #include "stdafx.h"
00013 #include "SDKSamplePlaylistPlugin.h"
00014 #include "SDKSamplePlaylistParser.h"
00015
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 //
00019 // [CSDKSamplePlaylistParserPlugin]
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022 CSDKSamplePlaylistParserPlugin::CSDKSamplePlaylistParserPlugin()
00023 {
00024 } // CSDKSamplePlaylistParserPlugin.
00025
00026
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 //
00030 // [~CSDKSamplePlaylistParserPlugin]
00031 //
00032 /////////////////////////////////////////////////////////////////////////////
00033 CSDKSamplePlaylistParserPlugin::~CSDKSamplePlaylistParserPlugin()
00034 {
00035 } // ~CSDKSamplePlaylistParserPlugin.
00036
00037
00038
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 //
00042 // [InitializePlugin]
00043 //
00044 /////////////////////////////////////////////////////////////////////////////
00045 HRESULT STDMETHODCALLTYPE
00046 CSDKSamplePlaylistParserPlugin::InitializePlugin(
00047                                 IWMSContext *pServerContext,
00048                                 IWMSNamedValues *pNamedValues,
00049                                 IWMSClassObject *pClassFactory
00050                                 )
00051 {
00052     //
00053     // We don't really use any of these parameters later on.
00054     // We are merely illustrating how you would hold a reference to it
00055     // using smart pointers if you did need to use it later on.
00056     //
00057
00058     m_spServerContext = pServerContext;
00059     m_spNamedValues = pNamedValues;
00060     m_spClassFactory = pClassFactory;
00061
00062     return( S_OK );
00063 } // InitializePlugin.
00064
00065
00066
00067 /////////////////////////////////////////////////////////////////////////////
00068 //
00069 // [GetCustomAdminInterface]
00070 //
00071 /////////////////////////////////////////////////////////////////////////////
00072 HRESULT STDMETHODCALLTYPE
00073 CSDKSamplePlaylistParserPlugin::GetCustomAdminInterface(
00074                     IDispatch **ppValue
00075                     )
00076 {
00077     if ( NULL == ppValue )
00078     {
00079         return( E_INVALIDARG );
00080     }
00081
00082     *ppValue = NULL;
00083
00084     //
00085     // Since we have no configuration paramters to edit,
00086     // we expose no administration interface.
00087     //
00088     return( S_OK );
00089 }
00090
00091
00092
00093 /////////////////////////////////////////////////////////////////////////////
00094 //
00095 // [OnHeartbeat]
00096 //
00097 /////////////////////////////////////////////////////////////////////////////
00098 HRESULT STDMETHODCALLTYPE
00099 CSDKSamplePlaylistParserPlugin::OnHeartbeat()
00100 {
00101     return( S_OK );
00102 } // OnHeartbeat.
00103
00104
00105
00106 /////////////////////////////////////////////////////////////////////////////
00107 //
00108 // [EnablePlugin]
00109 //
00110 /////////////////////////////////////////////////////////////////////////////
00111 STDMETHODIMP
00112 CSDKSamplePlaylistParserPlugin::EnablePlugin( long *pdwFlags, long *pdwHeartbeatPeriod )
00113 {
00114     if ( ( NULL == pdwFlags ) || ( NULL == pdwHeartbeatPeriod ) )
00115     {
00116         return ( E_POINTER );
00117     }
00118
00119     *pdwFlags = 0;
00120     // We don't need to get OnHeartbeat() called.
00121     *pdwHeartbeatPeriod = 0;
00122
00123     return ( S_OK );
00124 }
00125
00126
00127 /////////////////////////////////////////////////////////////////////////////
00128 //
00129 // [DisablePlugin]
00130 //
00131 /////////////////////////////////////////////////////////////////////////////
00132 STDMETHODIMP
00133 CSDKSamplePlaylistParserPlugin::DisablePlugin()
00134 {
00135     return ( S_OK );
00136 }
00137
00138
00139
00140
00141 /////////////////////////////////////////////////////////////////////////////
00142 //
00143 // [Shutdown]
00144 //
00145 /////////////////////////////////////////////////////////////////////////////
00146 HRESULT STDMETHODCALLTYPE
00147 CSDKSamplePlaylistParserPlugin::ShutdownPlugin()
00148 {
00149     m_spNamedValues.Release();
00150     m_spServerContext.Release();
00151     m_spClassFactory.Release();
00152     return( S_OK );
00153 } // ShutdownPlugin.
00154
00155
00156
00157
00158 /////////////////////////////////////////////////////////////////////////////
00159 //
00160 // [CreatePlaylistParser]
00161 //
00162 /////////////////////////////////////////////////////////////////////////////
00163 HRESULT STDMETHODCALLTYPE
00164 CSDKSamplePlaylistParserPlugin::CreatePlaylistParser(
00165                             IWMSCommandContext *pCommandContext,
00166                             IWMSContext *pUserContext,
00167                             IWMSContext *pPresentationContext,
00168                             DWORD dwFlags,
00169                             IWMSClassObject *pFactory,
00170                             IWMSBufferAllocator *pBufferAllocator,
00171                             IWMSPlaylistParserPluginCallback *pCallback,
00172                             QWORD qwContext
00173                             )
00174 {
00175     HRESULT hr = S_OK;
00176
00177     CComPtr<CComSDKSamplePlaylistParser> spParser;
00178
00179     if ( NULL == pCallback )
00180     {
00181         return( E_INVALIDARG );
00182     }
00183
00184     spParser = new CComSDKSamplePlaylistParser;
00185     if ( spParser == NULL )
00186     {
00187         return( E_OUTOFMEMORY );
00188     }
00189
00190     hr = spParser->Initialize(
00191                     pCommandContext,
00192                     pUserContext,
00193                     pPresentationContext,
00194                     m_spServerContext,
00195                     m_spNamedValues,
00196                     dwFlags,
00197                     pFactory
00198                     );
00199     if ( FAILED( hr ) )
00200     {
00201         // When we return a failed HRESULT, we should not make the callback
00202         return( hr );
00203     }
00204
00205     pCallback->OnCreatePlaylistParser( hr, spParser, qwContext );
00206
00207     // We called the callback, so we MUST return S_OK here.
00208     return( S_OK );
00209 } // CreatePlaylistParser.
00210
00211
00212
00213
00214
00215
00216 /////////////////////////////////////////////////////////////////////////////
00217 //
00218 //                             PLAYLIST PARSER
00219 //
00220 /////////////////////////////////////////////////////////////////////////////
00221
00222 /////////////////////////////////////////////////////////////////////////////
00223 //
00224 // [CSDKSamplePlaylistParser]
00225 //
00226 /////////////////////////////////////////////////////////////////////////////
00227 CSDKSamplePlaylistParser::CSDKSamplePlaylistParser()
00228 {
00229 } // CSDKSamplePlaylistParser.
00230
00231
00232
00233 /////////////////////////////////////////////////////////////////////////////
00234 //
00235 // [~CSDKSamplePlaylistParser]
00236 //
00237 /////////////////////////////////////////////////////////////////////////////
00238 CSDKSamplePlaylistParser::~CSDKSamplePlaylistParser()
00239 {
00240 } // ~CSDKSamplePlaylistParser.
00241
00242
00243
00244 /////////////////////////////////////////////////////////////////////////////
00245 //
00246 // [Initialize]
00247 //
00248 /////////////////////////////////////////////////////////////////////////////
00249 HRESULT
00250 CSDKSamplePlaylistParser::Initialize(
00251     IWMSCommandContext *pCommandContext,
00252     IWMSContext *pUserContext,
00253     IWMSContext *pPresentationContext,
00254     IWMSContext *pServerContext,
00255     IWMSNamedValues *pNamedValues,
00256     DWORD dwFlags,
00257     IWMSClassObject *pClassFactory
00258     )
00259 {
00260     //
00261     // We don't really use any of these parameters later on.
00262     // We are merely illustrating how you would hold a reference to it
00263     // using smart pointers if you did need to use it later on.
00264     //
00265
00266     m_spCommandContext = pCommandContext;
00267     m_spUserContext = pUserContext;
00268     m_spPresentationContext = pPresentationContext;
00269     m_spServerContext = pServerContext;
00270     m_spNamedValues = pNamedValues;
00271     m_spClassFactory = pClassFactory;
00272
00273     return( S_OK );
00274 } // Initialize.
00275
00276
00277
00278
00279
00280
00281 /////////////////////////////////////////////////////////////////////////////
00282 //
00283 // [Shutdown]
00284 //
00285 /////////////////////////////////////////////////////////////////////////////
00286 HRESULT
00287 CSDKSamplePlaylistParser::Shutdown()
00288 {
00289     m_spCommandContext.Release();
00290     m_spUserContext.Release();
00291     m_spPresentationContext.Release();
00292     m_spServerContext.Release();
00293     m_spNamedValues.Release();
00294     m_spClassFactory.Release();
00295
00296     return( S_OK );
00297 } // Shutdown.
00298
00299
00300
00301
00302
00303
00304 /////////////////////////////////////////////////////////////////////////////
00305 //
00306 // [ReadPlaylist]
00307 //
00308 /////////////////////////////////////////////////////////////////////////////
00309 HRESULT STDMETHODCALLTYPE
00310 CSDKSamplePlaylistParser::ReadPlaylist(
00311                                 INSSBuffer *pIBuffer,
00312                                 IXMLDOMDocument *pPlayList,
00313                                 IWMSPlaylistParserCallback *pCallback,
00314                                 QWORD qwContext
00315                                 )
00316 {
00317     HRESULT hr = S_OK;
00318     BYTE *pbBuffer = NULL;
00319     BYTE *pbEndBuffer = NULL;
00320     BYTE *pbUrl = NULL;
00321     BYTE *pbLineEnd = NULL;
00322     BYTE *pbEndUrl = NULL;
00323
00324     DWORD dwLength = 0;
00325     BYTE bPrevious = '\0';
00326     BSTR bstrUrl = NULL;
00327
00328     CComPtr<IXMLDOMNode> spWsxNode;
00329     CComPtr<IXMLDOMElement> spPlayListMediaEntry;
00330     CComPtr<IXMLDOMElement> spPlayListTopEntry;
00331     CComPtr<IXMLDOMNode> spOldPlayListEntry;
00332
00333     if ( ( NULL == pIBuffer )
00334         || ( NULL == pPlayList )
00335         || ( NULL == pCallback ) )
00336     {
00337         return( E_INVALIDARG );
00338     }
00339
00340     //
00341     // Create the NODE_PROCESSING_INSTRUCTION
00342     // (i.e. "<?wsx version='1.0'?>
00343     //
00344
00345     BSTR bstrWsx = SysAllocString( L"wsx" );
00346     BSTR bstrEmpty = SysAllocString( L"" );
00347     BSTR bstrVersion = SysAllocString( L"version='1.0'" );
00348     BSTR bstrSmil = SysAllocString( L"smil" );
00349     BSTR bstrTagName = SysAllocString( L"media" );
00350     BSTR bstrAttrName = SysAllocString( L"src" );
00351
00352     if ( ( NULL == bstrWsx )
00353         || ( NULL == bstrEmpty )
00354         || ( NULL == bstrVersion )
00355         || ( NULL == bstrSmil )
00356         || ( NULL == bstrTagName )
00357         || ( NULL == bstrAttrName ) )
00358     {
00359         hr = E_OUTOFMEMORY;
00360         goto done;
00361     }
00362
00363     VARIANT varNodeType;
00364     VariantInit( &varNodeType );
00365     V_VT( &varNodeType ) = VT_I4;
00366     V_I4( &varNodeType ) = NODE_PROCESSING_INSTRUCTION;
00367
00368     hr = pPlayList->createNode(
00369                         varNodeType,
00370                         bstrWsx,
00371                         bstrEmpty,
00372                         &spWsxNode
00373                         );
00374
00375     VariantClear( &varNodeType );
00376
00377     if ( FAILED(hr) )
00378     {
00379         goto done;
00380     }
00381
00382     hr = pPlayList->appendChild( spWsxNode, &spOldPlayListEntry );
00383     if ( FAILED(hr) )
00384     {
00385         goto done;
00386     }
00387
00388     hr = spWsxNode->put_text( bstrVersion );
00389     if ( FAILED(hr) )
00390     {
00391         goto done;
00392     }
00393
00394     //
00395     // Create the top level SMIL tag
00396     //
00397
00398     hr = pPlayList->createElement( bstrSmil, &spPlayListTopEntry );
00399     if ( FAILED(hr) )
00400     {
00401         goto done;
00402     }
00403
00404     spOldPlayListEntry = NULL;
00405     hr = pPlayList->appendChild( spPlayListTopEntry, &spOldPlayListEntry );
00406     if ( FAILED(hr) )
00407     {
00408         goto done;
00409     }
00410
00411     //
00412     // Get a pointer to the playlist in preperation for parsing
00413     //
00414
00415     hr = pIBuffer->GetBufferAndLength( &pbBuffer, &dwLength );
00416     if ( FAILED( hr ) )
00417     {
00418         goto done;
00419     }
00420
00421     //
00422     // Walk through the playlist and extract each line
00423     //
00424
00425     pbEndBuffer = pbBuffer + dwLength;
00426     pbUrl = pbBuffer;
00427
00428     while ( pbUrl < pbEndBuffer )
00429     {
00430         //
00431         // Seek the beginning of the next filled line.
00432         // Skip any white spaces or blank lines in the middle.
00433         //
00434         while( ( pbUrl < pbEndBuffer )
00435                 && isspace( *pbUrl ) )
00436         {
00437             ++pbUrl;
00438         }
00439
00440         if( pbUrl >= pbEndBuffer )
00441         {
00442             break;  // end of playlist
00443         }
00444
00445         //
00446         // Seek the end of the current line
00447         //
00448         pbLineEnd = pbUrl + 1;
00449         while( ( pbLineEnd < pbEndBuffer )
00450                 && ( '\n' != *pbLineEnd )
00451                 && ( '\r' != *pbLineEnd ) )
00452         {
00453             ++pbLineEnd;
00454         }
00455
00456         //
00457         // If the line begins with '#', then the entire line is a comment.
00458         // Skip it and continue in the next line.
00459         //
00460         if( '#' == *pbUrl )
00461         {
00462             pbUrl = pbLineEnd;
00463             continue;
00464         }
00465
00466         //
00467         // Find the end of the URL.
00468         // Trailing spaces are not to be considered part of the URL.
00469         // A comma may be used at the end of the line as an optional separator,
00470         // it's not to be considered part of the URL.
00471         //
00472
00473         pbEndUrl = pbLineEnd;
00474
00475         while( ( pbUrl < pbEndUrl )
00476             && isspace( pbEndUrl[-1] ) )
00477         {
00478             --pbEndUrl;
00479         }
00480
00481         if( ( pbUrl < pbEndUrl )
00482             && ( ',' == pbEndUrl[-1] ) )
00483         {
00484             --pbEndUrl;
00485         }
00486
00487         while( ( pbUrl < pbEndUrl )
00488             && isspace( pbEndUrl[-1] ) )
00489         {
00490             --pbEndUrl;
00491         }
00492
00493         //
00494         // If the line contains simply a comma,
00495         // discard it and continue in the next line
00496         //
00497         if( pbUrl == pbEndUrl )
00498         {
00499             pbUrl = pbLineEnd;
00500             continue;
00501         }
00502
00503         //
00504         // Copy the URL to a BSTR
00505         //
00506
00507         int cchNeeded = MultiByteToWideChar(
00508                                 CP_ACP,
00509                                 0,
00510                                 (LPCSTR)pbUrl,
00511                                 (int)( pbEndUrl - pbUrl ),
00512                                 NULL,
00513                                 0
00514                                 );
00515         if( 0 >= cchNeeded )
00516         {
00517             hr = HRESULT_FROM_WIN32( GetLastError() );
00518             goto done;
00519         }
00520
00521         bstrUrl = SysAllocStringLen( NULL, cchNeeded );
00522         if( NULL == bstrUrl )
00523         {
00524             hr = E_OUTOFMEMORY;
00525             goto done;
00526         }
00527
00528         int cchConverted = MultiByteToWideChar(
00529                                     CP_ACP,
00530                                     0,
00531                                     (LPCSTR)pbUrl,
00532                                     (int)( pbEndUrl - pbUrl ),
00533                                     bstrUrl,
00534                                     cchNeeded
00535                                     );
00536         if( cchConverted != cchNeeded )
00537         {
00538             hr = HRESULT_FROM_WIN32( ERROR_NO_UNICODE_TRANSLATION );
00539             goto done;
00540         }
00541
00542         //
00543         // Create the corresponding MEDIA tag in the playlist
00544         //
00545
00546         hr = pPlayList->createElement(
00547                             bstrTagName,
00548                             &spPlayListMediaEntry
00549                             );
00550         if ( FAILED( hr ) )
00551         {
00552             goto done;
00553         }
00554
00555         //
00556         // Set the src attribute on the MEDIA tag to the URL
00557         //
00558
00559         VARIANT varAttribute;
00560         VariantInit( &varAttribute );
00561         V_VT( &varAttribute ) = VT_BSTR;
00562         V_BSTR( &varAttribute ) = bstrUrl;
00563
00564         hr = spPlayListMediaEntry->setAttribute( bstrAttrName, varAttribute );
00565
00566         V_BSTR( &varAttribute ) = NULL;
00567         V_VT( &varAttribute ) = VT_EMPTY;
00568         VariantClear( &varAttribute );
00569
00570         if ( FAILED( hr ) )
00571         {
00572             goto done;
00573         }
00574
00575         //
00576         // Add the MEDIA tag to the playlist
00577         //
00578
00579         spOldPlayListEntry = NULL;
00580         hr = spPlayListTopEntry->appendChild( spPlayListMediaEntry, &spOldPlayListEntry );
00581         if ( FAILED( hr ) )
00582         {
00583             goto done;
00584         }
00585
00586         spPlayListMediaEntry.Release();
00587
00588         //
00589         // Continue in the next line
00590         //
00591
00592         pbUrl = pbLineEnd;
00593     }
00594
00595     //
00596     // Notify the callback the playlist was successfully parsed
00597     //
00598
00599     pCallback->OnReadPlaylist( S_OK, qwContext );
00600
00601 done:
00602
00603     if ( NULL != bstrWsx )
00604     {
00605         SysFreeString( bstrWsx );
00606         bstrWsx = NULL;
00607     }
00608
00609     if ( NULL != bstrEmpty )
00610     {
00611         SysFreeString( bstrEmpty );
00612         bstrEmpty = NULL;
00613     }
00614
00615     if ( NULL != bstrVersion )
00616     {
00617         SysFreeString( bstrVersion );
00618         bstrVersion = NULL;
00619     }
00620
00621     if ( NULL != bstrSmil )
00622     {
00623         SysFreeString( bstrSmil );
00624         bstrSmil = NULL;
00625     }
00626
00627     if ( NULL != bstrTagName )
00628     {
00629         SysFreeString( bstrTagName );
00630         bstrTagName = NULL;
00631     }
00632
00633     if ( NULL != bstrAttrName )
00634     {
00635         SysFreeString( bstrAttrName );
00636         bstrAttrName = NULL;
00637     }
00638
00639     if ( NULL != bstrUrl )
00640     {
00641         SysFreeString( bstrUrl );
00642         bstrUrl = NULL;
00643     }
00644
00645     return( hr );
00646 } // ReadPlaylist.
00647
00648
00649
00650 /////////////////////////////////////////////////////////////////////////////
00651 //
00652 // [WritePlaylist]
00653 //
00654 /////////////////////////////////////////////////////////////////////////////
00655 HRESULT STDMETHODCALLTYPE
00656 CSDKSamplePlaylistParser::WritePlaylist(
00657                         IXMLDOMDocument *pPlayList,
00658                         IWMSPlaylistParserCallback *pCallback,
00659                         QWORD qwContext
00660                         )
00661 {
00662     return( E_NOTIMPL );
00663 } // WritePlaylist.
00664
00665
00666
00667 /////////////////////////////////////////////////////////////////////////////
00668 HRESULT STDMETHODCALLTYPE
00669 CSDKSamplePlaylistParser::ReadPlaylistFromDirectory(
00670                                 IWMSDirectory __RPC_FAR *pDirectory,
00671                                 LPWSTR pszwFilePattern,
00672                                 IXMLDOMDocument __RPC_FAR *pPlaylist,
00673                                 IWMSPlaylistParserCallback __RPC_FAR *pCallback,
00674                                 QWORD qwContext
00675                                 )
00676 {
00677     return( E_NOTIMPL );
00678 } // ReadPlaylistFromDirectory.
00679
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/FontView/FontView.c Source File

  • Multimedia
  • Gdi
  • Fonts
  • FontView

FontView.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 #define NOMINMAX
00013 #include <windows.h>
00014 #include <stdio.h>
00015
00016 #include "FontView.H"
00017
00018 #include <math.h>
00019 #include <stdlib.h>
00020 #include <string.h>
00021 #include <time.h>
00022
00023 char szAppName[] = "FontView";
00024 char szAppTitle[] = "FontView - A Font Examination Utility";
00025
00026 BOOL bZoomed = FALSE;
00027
00028 HWND    hwndMain, hwndClient;
00029 HWND    hwndMenuField, hwndTimeField;
00030 HWND    hwndLabel1, hwndCreateParam, hwndCreateValue, hwndZoom;
00031
00032 LOGFONT lf = {0,0,0,0,0,0,0,0,0,0,0,0,0,""};
00033
00034 HMENU   hSysMenuMain = (HMENU)NULL;
00035 HMENU   hFileMenu    = (HMENU)NULL;
00036 HMENU   hEditMenu    = (HMENU)NULL;
00037 HMENU   hViewMenu    = (HMENU)NULL;
00038 HMENU   hMetricsMenu = (HMENU)NULL;
00039 HMENU   hHelpMenu    = (HMENU)NULL;
00040 HMENU   hSysMenuAdv  = (HMENU)NULL;
00041 HMENU   hMenu        = (HMENU)NULL;
00042
00043 LONG_PTR APIENTRY WndProc         (HWND, UINT, WPARAM, LPARAM);
00044 LONG_PTR APIENTRY ClientProc      (HWND, UINT, WPARAM, LPARAM);
00045 LONG_PTR APIENTRY ClientCharSetProc      (HWND, UINT, WPARAM, LPARAM);
00046 LONG_PTR APIENTRY ClientGlyphProc      (HWND, UINT, WPARAM, LPARAM);
00047
00048 BOOL FillInParam (HWND, int);
00049 BOOL FillInValue (HWND, int);
00050 int FAR PASCAL EnumFontNames (LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM);
00051
00052 WNDPROC fpCharSetProc = 0;
00053 WNDPROC fpGlyphProc = 0;
00054
00055 /* Dialogs.C Prototypes */
00056 BOOL APIENTRY SimpleDlgProc   (HWND, UINT, WPARAM, LPARAM);
00057 BOOL APIENTRY CreateDlgProc   (HWND, UINT, WPARAM, LPARAM);
00058 BOOL APIENTRY MetricsDlgProc   (HWND, UINT, WPARAM, LPARAM);
00059 BOOL APIENTRY EnumDlgProc   (HWND, UINT, WPARAM, LPARAM);
00060
00061 /* Display.C Prototypes */
00062 void DrawAscii (HDC hdc, RECT *pRect, WORD direction);
00063 BYTE FindChar (HDC hdc, RECT *pRect, int x, int y);
00064 void DrawGlyph (HDC hdc, RECT *pRect, BYTE glyph, HFONT hfont);
00065
00066 /* ToolBar.C Prototypes */
00067 BOOL InitToolBar (HANDLE);
00068 BOOL CreateToolBar (HWND, HANDLE, int);
00069 BOOL AdjustToolBar (HWND);
00070 HWND AddToolLabel (HANDLE , int, LPSTR, int, DWORD);
00071 HWND AddToolCombo (HANDLE, int, int, DWORD);
00072 HWND AddToolButton (HANDLE, int, LPSTR, int, int, DWORD);
00073 BOOL AddToolSpace (int, int);
00074 int ToolBarHeight (HWND);
00075
00076 /* StatusBar.C Prototypes */
00077 BOOL InitStatusBar (HANDLE);
00078 BOOL CreateStatusBar (HWND, HANDLE, int);
00079 BOOL AdjustStatusBar (HWND);
00080 HWND AddStatusField (HANDLE, int, int, int, BOOL);
00081 int StatusBarHeight (HWND);
00082
00083
00084 int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
00085 {
00086
00087     MSG         msg;
00088     WNDCLASS    wndclass;
00089     HANDLE      hAccelTable;
00090
00091     if (!hPrevInst) {
00092         wndclass.style         = CS_HREDRAW | CS_VREDRAW;
00093         wndclass.lpfnWndProc   = (WNDPROC)WndProc;
00094         wndclass.cbClsExtra    = 0;
00095         wndclass.cbWndExtra    = 0;
00096         wndclass.hInstance     = hInst;
00097         wndclass.hIcon         = LoadIcon (hInst, szAppName);
00098         wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW);
00099         wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1);
00100         wndclass.lpszMenuName  = szAppName;
00101         wndclass.lpszClassName = szAppName;
00102
00103         if (!RegisterClass (&wndclass)) {
00104             return FALSE;
00105         }
00106
00107         wndclass.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
00108         wndclass.lpfnWndProc   = (WNDPROC)ClientProc;
00109         wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
00110         wndclass.lpszMenuName  = NULL;
00111         wndclass.lpszClassName = "FontClient";
00112
00113         if (!RegisterClass (&wndclass)) {
00114             return FALSE;
00115         }
00116
00117         fpCharSetProc = MakeProcInstance ((WNDPROC)ClientCharSetProc, hInst);
00118         fpGlyphProc   = MakeProcInstance ((WNDPROC)ClientGlyphProc, hInst);
00119
00120         if (!InitToolBar (hInst)) {
00121             return FALSE;
00122         }
00123
00124         if (!InitStatusBar (hInst)) {
00125             return FALSE;
00126         }
00127     }
00128
00129
00130     hwndMain = CreateWindow (szAppName, szAppName,
00131         WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
00132         CW_USEDEFAULT, 0,
00133         CW_USEDEFAULT, 0,
00134         NULL, NULL, hInst, NULL);
00135
00136     if (!hwndMain) {
00137         return FALSE;
00138     }
00139     /* Get handles to the various menus. Some of these we will use later */
00140     /* to display menu descriptions in the status bar */
00141         hSysMenuMain = GetSystemMenu(hwndMain,FALSE);
00142     hMenu = GetMenu(hwndMain);
00143     if (hMenu) {
00144         hFileMenu = GetSubMenu(hMenu,0);
00145         hEditMenu = GetSubMenu(hMenu,1);
00146         hViewMenu = GetSubMenu(hMenu, 2);
00147         hMetricsMenu = GetSubMenu(hMenu,3);
00148         hHelpMenu = GetSubMenu(hMenu,4);
00149     }
00150
00151     if (CreateToolBar (hwndMain, hInst, ID_TOOLBAR)) {
00152         hwndLabel1 = AddToolLabel (hInst, 0, "CreateFont:", 0, SS_RIGHT);
00153         AddToolSpace (6, 0);
00154         hwndCreateParam = AddToolCombo (hInst, ID_CREATEPARAM, -25, CBS_DROPDOWN | WS_VSCROLL);
00155         FillInParam (hwndCreateParam, 0);
00156
00157         AddToolSpace (10, 0);
00158         hwndCreateValue = AddToolCombo (hInst, ID_CREATEVALUE, -30, CBS_DROPDOWN | WS_VSCROLL);
00159         FillInValue (hwndCreateValue, CFP_BASE+0);
00160
00161         AddToolSpace (10, 0);
00162         hwndZoom = AddToolButton (hInst, ID_ZOOM, "ZOOM", 24, 0, BS_OWNERDRAW);
00163
00164     } else {
00165         return FALSE;
00166     }
00167
00168
00169     if (CreateStatusBar (hwndMain, hInst, ID_STATUSBAR)) {
00170         hwndMenuField = AddStatusField (hInst, ID_MENUFIELD, 100, 0, FALSE);
00171         hwndTimeField = AddStatusField (hInst, ID_TIMEFIELD, -13, -13, TRUE);
00172         if (hwndTimeField) {
00173             SetTimer (hwndMain, 1, 1000, NULL);
00174         }
00175     } else {
00176         return FALSE;
00177     }
00178
00179     hwndClient = CreateWindow ("FontClient", "FontClient",
00180         WS_CHILD | WS_CLIPSIBLINGS | WS_BORDER | WS_VISIBLE,
00181         0, 0, 0, 0,
00182         hwndMain,(HMENU)666, hInst, NULL);
00183
00184     SetWindowLongPtr (hwndClient, GWLP_WNDPROC, (DWORD_PTR)fpCharSetProc);
00185     bZoomed = FALSE;
00186
00187     if (!hwndMain) {
00188         return FALSE;
00189     }
00190
00191     ShowWindow (hwndMain, nCmdShow);
00192     InvalidateRect (hwndZoom, NULL, TRUE);
00193
00194     hAccelTable = LoadAccelerators (hInst, szAppName);
00195
00196     while (GetMessage (&msg, NULL, 0, 0)) {
00197         if (!TranslateAccelerator (hwndMain, hAccelTable, &msg)) {
00198             TranslateMessage (&msg);
00199             DispatchMessage (&msg);
00200         }
00201     }
00202
00203
00204     return (int)msg.wParam;
00205
00206     lpCmdLine; // Just to resolve reference
00207 }
00208
00209
00210 /* ================================================================================================ *\
00211     Fill in the first combo box with all the different 'CreateFont' parameters that we can change
00212 \* ================================================================================================ */
00213 BOOL FillInParam (HWND hwnd, int focus)
00214 {
00215     int index;
00216
00217     index = 0;
00218     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"nHeight");
00219     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_HEIGHT);
00220     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"nWidth");
00221     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_WIDTH);
00222     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"nEscapement");
00223     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_ESCAPEMENT);
00224     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"nOrientation");
00225     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_ORIENTATION);
00226     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"nWeight");
00227     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_WEIGHT);
00228     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cItalic");
00229     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_ITALIC);
00230     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cUnderline");
00231     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_UNDERLINE);
00232     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cStrikeOut");
00233     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_STRIKEOUT);
00234     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cCharSet");
00235     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_CHARSET);
00236     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cOutputPrecision");
00237     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_OUTPUTPRECISION);
00238     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cClipPrecision");
00239     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_CLIPPRECISION);
00240     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cQuality");
00241     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_QUALITY);
00242     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"cPitch...");
00243     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_PITCH);
00244     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"c...Family");
00245     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_FAMILY);
00246     SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"lpFacename");
00247     SendMessage (hwnd, CB_SETITEMDATA, index++, CFP_FACENAME);
00248     SendMessage (hwnd, CB_SETCURSEL, focus, 0);
00249     return TRUE;
00250 }
00251
00252 /* ================================================================================================ *\
00253     Fill in the second combo box with valid values, based on the current setting in the first combo
00254 \* ================================================================================================ */
00255 BOOL FillInValue (HWND hwnd, int param)
00256 {
00257     int i, index, focus;
00258     LONG_PTR data;
00259     char szTmp[80];
00260     ATOM atom;
00261     HDC  hdc;
00262     FARPROC lpEnumFonts;
00263     HINSTANCE hInst;
00264
00265     SendMessage (hwnd, CB_RESETCONTENT, 0, 0);
00266     focus = -1;
00267     index = 0;
00268
00269     // Each of the following cases will contain two different 'loops', the first one will fill the
00270     // combo box with values, the second will locate the current setting in the combobox and set
00271     // the focus to it. If the value is not currently in the combobox, then it will be inserted at
00272     // the proper location.
00273
00274     switch (param) {
00275         case CFP_HEIGHT:
00276             // Lets just toss in a range of heights, from -72 to 72, by twos
00277             // If the user wants to enter in a custom value, they need to use
00278             // the 'CreateFont' dialog for now.
00279             for (i=-72; i<72; i+=2) {
00280                 if (i < 0) {
00281                     _snprintf (szTmp, sizeof(szTmp), "%d = cell height = %u", i, abs(i));
00282                 } else if (i == 0) {
00283                     _snprintf (szTmp,sizeof(szTmp), "%u = default", i);
00284                 } else {
00285                     _snprintf (szTmp, sizeof(szTmp), "%u = character height", i);
00286                 }
00287                 SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)szTmp);
00288                 SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD)i);
00289             }
00290
00291             for (i=0; i<index; i++) {
00292                 data = (long)SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00293                 if (data == lf.lfHeight) {
00294                     focus = i;
00295                     break;
00296                 } else if (data > lf.lfHeight) {
00297                     _snprintf (szTmp, sizeof(szTmp), "%u", lf.lfHeight);
00298                     SendMessage (hwnd, CB_INSERTSTRING, i, (DWORD_PTR)(LPSTR)szTmp);
00299                     SendMessage (hwnd, CB_SETITEMDATA, i, (DWORD_PTR)lf.lfHeight);
00300                     focus = i;
00301                     break;
00302                 }
00303             }
00304             if (focus == -1) {
00305                 _snprintf (szTmp, sizeof(szTmp), "%u", lf.lfHeight);
00306                 focus = (int)SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)szTmp);
00307                 SendMessage (hwnd, CB_SETITEMDATA, focus, (DWORD_PTR)lf.lfHeight);
00308             }
00309
00310             break;
00311
00312         case CFP_WIDTH:
00313             // Lets just toss in a range of widths, from 0 to 72, by twos
00314             // If the user wants to enter in a custom value, they need to use
00315             // the 'CreateFont' dialog for now.
00316             for (i=0; i<72; i+=2) {
00317                 if (i==0) {
00318                     _snprintf (szTmp, sizeof(szTmp), "%u = default aspect", i);
00319                 } else {
00320                     _snprintf (szTmp, sizeof(szTmp), "%u", i);
00321                 }
00322                 SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)szTmp);
00323                 SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)i);
00324             }
00325             for (i=0; i<index; i++) {
00326                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00327                 if (data == lf.lfWidth) {
00328                     focus = i;
00329                     break;
00330                 } else if (data > lf.lfWidth) {
00331                     _snprintf (szTmp, sizeof(szTmp), "%u", lf.lfWidth);
00332                     SendMessage (hwnd, CB_INSERTSTRING, i, (DWORD_PTR)(LPSTR)szTmp);
00333                     SendMessage (hwnd, CB_SETITEMDATA, i, (DWORD_PTR)lf.lfWidth);
00334                     focus = i;
00335                     break;
00336                 }
00337             }
00338             break;
00339
00340         case CFP_ESCAPEMENT:
00341             for (i=0; i<4500; i+=10) {
00342                 _snprintf (szTmp, sizeof(szTmp), "%u = (%u/10 degrees)", i, i);
00343                 SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)szTmp);
00344                 SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)i);
00345             }
00346             for (i=0; i<index; i++) {
00347                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00348                 if (data == lf.lfEscapement) {
00349                     focus = i;
00350                     break;
00351                 } else if (data > lf.lfEscapement) {
00352                     _snprintf (szTmp, sizeof(szTmp), "%u = (%u/10 degrees)", lf.lfEscapement, data);
00353                     SendMessage (hwnd, CB_INSERTSTRING, i, (DWORD_PTR)(LPSTR)szTmp);
00354                     SendMessage (hwnd, CB_SETITEMDATA, i, (DWORD_PTR)lf.lfEscapement);
00355                     focus = i;
00356                     break;
00357                 }
00358             }
00359             break;
00360
00361         case CFP_ORIENTATION:
00362             for (i=0; i<4500; i+=10) {
00363                 _snprintf (szTmp, sizeof(szTmp), "%u = (%u/10 degrees)", i, i);
00364                 SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)szTmp);
00365                 SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)i);
00366             }
00367             for (i=0; i<index; i++) {
00368                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00369                 if (data == lf.lfOrientation) {
00370                     focus = i;
00371                     break;
00372                 } else if (data > lf.lfOrientation) {
00373                     _snprintf (szTmp, sizeof(szTmp), "%u = (%u/10 degrees)", lf.lfOrientation, data);
00374                     SendMessage (hwnd, CB_INSERTSTRING, i, (DWORD_PTR)(LPSTR)szTmp);
00375                     SendMessage (hwnd, CB_SETITEMDATA, i, (DWORD_PTR)lf.lfOrientation);
00376                     focus = i;
00377                     break;
00378                 }
00379             }
00380             break;
00381
00382         case CFP_WEIGHT:
00383             index = 0;
00384             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"0 = FW_DONTCARE");
00385             SendMessage (hwnd, CB_SETITEMDATA, index++, 0);
00386             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"100 = FW_THIN");
00387             SendMessage (hwnd, CB_SETITEMDATA, index++, 100);
00388             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"200 = FW_EXTRALIGHT");
00389             SendMessage (hwnd, CB_SETITEMDATA, index++, 200);
00390             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"300 = FW_LIGHT");
00391             SendMessage (hwnd, CB_SETITEMDATA, index++, 300);
00392             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"400 = FW_NORMAL");
00393             SendMessage (hwnd, CB_SETITEMDATA, index++, 400);
00394             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"500 = FW_MEDIUM");
00395             SendMessage (hwnd, CB_SETITEMDATA, index++, 500);
00396             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"600 = FW_SEMIBOLD");
00397             SendMessage (hwnd, CB_SETITEMDATA, index++, 600);
00398             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"700 = FW_BOLD");
00399             SendMessage (hwnd, CB_SETITEMDATA, index++, 700);
00400             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"800 = FW_EXTRABOLD");
00401             SendMessage (hwnd, CB_SETITEMDATA, index++, 800);
00402             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"900 = FW_HEAVY");
00403             SendMessage (hwnd, CB_SETITEMDATA, index++, 900);
00404
00405             for (i=0; i<index; i++) {
00406                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00407                 if (data == lf.lfWeight) {
00408                     focus = i;
00409                     break;
00410                 } else if (data > lf.lfWeight) {
00411                     _snprintf (szTmp, sizeof(szTmp), "%u", lf.lfWeight);
00412                     SendMessage (hwnd, CB_INSERTSTRING, i, (DWORD_PTR)(LPSTR)szTmp);
00413                     focus = i;
00414                     break;
00415                 }
00416             }
00417             break;
00418
00419         case CFP_ITALIC:
00420             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FALSE");
00421             SendMessage (hwnd, CB_SETITEMDATA, 0, (DWORD_PTR)FALSE);
00422             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"TRUE");
00423             SendMessage (hwnd, CB_SETITEMDATA, 1, (DWORD_PTR)TRUE);
00424             focus = (lf.lfItalic?1:0);
00425             break;
00426
00427         case CFP_UNDERLINE:
00428             index=0;
00429             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FALSE");
00430             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)FALSE);
00431             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"TRUE");
00432             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)TRUE);
00433             focus = (lf.lfUnderline?1:0);
00434             break;
00435
00436         case CFP_STRIKEOUT:
00437             index=0;
00438             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FALSE");
00439             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)FALSE);
00440             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"TRUE");
00441             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)TRUE);  \
00442             focus = (lf.lfStrikeOut?1:0);
00443             break;
00444
00445         case CFP_CHARSET:
00446             index = 0;
00447             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"0 = ANSI_CHARSET");
00448             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)ANSI_CHARSET);
00449             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"SYMBOL_CHARSET");
00450             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)SYMBOL_CHARSET);
00451             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"SHIFTJIS_CHARSET");
00452             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)SHIFTJIS_CHARSET);
00453             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"OEM_CHARSET");
00454             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)OEM_CHARSET);
00455             for (i=0; i<index; i++) {
00456                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00457                 if (data == (long)lf.lfCharSet) {
00458                     focus = i;
00459                     break;
00460                 }
00461             }
00462             break;
00463
00464             break;
00465
00466         case CFP_OUTPUTPRECISION:
00467             index=0;
00468             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"0 = OUT_DEFAULT_PRECIS");
00469             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)OUT_DEFAULT_PRECIS);
00470             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"OUT_STRING_PRECIS");
00471             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)OUT_STRING_PRECIS);
00472             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"OUT_CHARACTER_PRECIS");
00473             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)OUT_CHARACTER_PRECIS);
00474             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"OUT_STROKE_PRECIS");
00475             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)OUT_STROKE_PRECIS);
00476             for (i=0; i<index; i++) {
00477                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00478                 if (data == (long)lf.lfOutPrecision) {
00479                     focus = i;
00480                     break;
00481                 }
00482             }
00483             break;
00484
00485         case CFP_CLIPPRECISION:
00486             index=0;
00487             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"0 = CLIP_DEFAULT_PRECIS");
00488             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)CLIP_DEFAULT_PRECIS);
00489             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"CLIP_CHARACTER_PRECIS");
00490             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)CLIP_CHARACTER_PRECIS);
00491             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"CLIP_STROKE_PRECIS");
00492             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)CLIP_STROKE_PRECIS);
00493             for (i=0; i<index; i++) {
00494                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00495                 if (data == (long)lf.lfClipPrecision) {
00496                     focus = i;
00497                     break;
00498                 }
00499             }
00500             break;
00501
00502         case CFP_QUALITY:
00503             index=0;
00504             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"0 = DEFAULT_QUALITY");
00505             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)DEFAULT_QUALITY);
00506             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"DRAFT_QUALITY");
00507             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)DRAFT_QUALITY);
00508             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"PROOF_QUALITY");
00509             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)PROOF_QUALITY);
00510             for (i=0; i<index; i++) {
00511                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00512                 if (data == (long)lf.lfQuality) {
00513                     focus = i;
00514                     break;
00515                 }
00516             }
00517             break;
00518
00519         case CFP_PITCH:
00520             index=0;
00521             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"0 = DEFAULT_PITCH");
00522             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD)DEFAULT_PITCH);
00523             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FIXED_PITCH");
00524             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)FIXED_PITCH);
00525             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"VARIABLE_PITCH");
00526             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)VARIABLE_PITCH);
00527             for (i=0; i<index; i++) {
00528                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00529                 if (data == (long)(0x03&lf.lfPitchAndFamily)) {
00530                     focus = i;
00531                     break;
00532                 }
00533             }
00534             break;
00535
00536         case CFP_FAMILY:
00537             index=0;
00538             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"0 = FF_DONTCARE");
00539             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)FF_DONTCARE);
00540             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FF_ROMAN");
00541             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD)FF_ROMAN);
00542             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FF_SWISS");
00543             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)FF_SWISS);
00544             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FF_MODERN");
00545             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD)FF_MODERN);
00546             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FF_SCRIPT");
00547             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)FF_SCRIPT);
00548             SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"FF_DECORATIVE");
00549             SendMessage (hwnd, CB_SETITEMDATA, index++, (DWORD_PTR)FF_DECORATIVE);
00550             for (i=0; i<index; i++) {
00551                 data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00552                 if (data == (long)(0xFC&lf.lfPitchAndFamily)) {
00553                     focus = i;
00554                     break;
00555                 }
00556             }
00557             break;
00558
00559         case CFP_FACENAME:
00560             index = (int)SendMessage (hwnd, CB_ADDSTRING, 0, (DWORD_PTR)(LPSTR)"(none)");
00561             SendMessage (hwnd, CB_SETITEMDATA, index, 0);
00562             if (lstrcmp(lf.lfFaceName, "(none)") == 0) {
00563                 lf.lfFaceName[0] = 0;
00564             }
00565             hdc = GetDC (hwnd);
00566
00567             hInst = (HINSTANCE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
00568             lpEnumFonts = MakeProcInstance ((FARPROC)EnumFontNames, hInst);
00569             EnumFonts (hdc, NULL, (FONTENUMPROC)lpEnumFonts, (LPARAM)&hwnd);
00570             FreeProcInstance (lpEnumFonts);
00571             ReleaseDC (hwnd, hdc);
00572             atom = GlobalFindAtom ((LPSTR)lf.lfFaceName);
00573             if (atom == (ATOM)0 && (lstrlen (lf.lfFaceName)>0)) {
00574                 index = (int)SendMessage (hwnd, CB_ADDSTRING, 0, (LONG_PTR)(LPSTR)lf.lfFaceName);
00575                 focus = index;
00576             } else if (lstrlen(lf.lfFaceName)==0) {
00577                 index = (int)SendMessage (hwnd, CB_FINDSTRING, (UINT)-1, (LONG_PTR)(LPSTR)"(none)");
00578                 focus = index;
00579             } else {
00580                 index = (int)SendMessage (hwnd, CB_GETCOUNT, 0, 0);
00581                 for (i=0; i<index; i++) {
00582                     data = SendMessage (hwnd, CB_GETITEMDATA, i, 0);
00583                     if ((DWORD)data == (DWORD)atom) {
00584                         focus = i;
00585                         break;
00586                     }
00587                 }
00588             }
00589             break;
00590     }
00591     if (focus >= 0) {
00592         SendMessage (hwnd, CB_SETCURSEL, focus, 0);
00593     } else {
00594         SendMessage (hwnd, CB_SETCURSEL, 0, 0);
00595     }
00596     return TRUE;
00597 }
00598
00599
00600 // Font enumeration callback. This adds the font name to the atom list.
00601 int FAR PASCAL EnumFontNames (LPLOGFONT lpLogFont, LPTEXTMETRIC lpTextMetric, DWORD nFontType, LPARAM lData)
00602 {
00603     HWND hwnd;
00604     FARPROC lpFontEnumProc;
00605     HDC  hdc;
00606     ATOM atom;
00607     HWND hwndCombo;
00608     int  index;
00609
00610     hwnd = GetFocus();
00611     hdc  = GetDC(hwnd);
00612     hwndCombo = (HWND)lData;
00613
00614     atom = GlobalFindAtom ((LPSTR)lpLogFont->lfFaceName);
00615     if (atom == (ATOM)0) {
00616         atom = GlobalAddAtom (lpLogFont->lfFaceName);
00617     }
00618     index = (int) SendMessage(hwndCombo, CB_FINDSTRING, (UINT)-1, (LONG_PTR)(LPSTR)lpLogFont->lfFaceName);
00619     if (index == CB_ERR) {
00620         index = (int)SendMessage (hwndCombo, CB_ADDSTRING, 0, (LONG_PTR)(LPSTR)lpLogFont->lfFaceName);
00621         SendMessage (hwndCombo, CB_SETITEMDATA, index, atom);
00622     }
00623
00624     ReleaseDC(hwnd, hdc);
00625
00626     return TRUE;
00627
00628     lpTextMetric;   // unreferenced formal paramater
00629     nFontType;      // unreferenced formal parameter
00630     lpFontEnumProc; // unreferenced formal parameter
00631 }
00632
00633
00634 // A quick little routine that will center one window over another, handy for dialog boxes.
00635 BOOL CenterWindow (HWND hwndChild, HWND hwndParent)
00636 {
00637     RECT    rChild, rParent;
00638     int     wChild, hChild, wParent, hParent;
00639     int     wScreen, hScreen, xNew, yNew;
00640     HDC     hdc;
00641
00642     GetWindowRect (hwndChild, &rChild);
00643     wChild = rChild.right - rChild.left;
00644     hChild = rChild.bottom - rChild.top;
00645
00646     GetWindowRect (hwndParent, &rParent);
00647     wParent = rParent.right - rParent.left;
00648     hParent = rParent.bottom - rParent.top;
00649
00650     hdc = GetDC (hwndChild);
00651     wScreen = GetDeviceCaps (hdc, HORZRES);
00652     hScreen = GetDeviceCaps (hdc, VERTRES);
00653     ReleaseDC (hwndChild, hdc);
00654
00655     xNew = rParent.left + ((wParent - wChild) /2);
00656     if (xNew < 0) {
00657         xNew = 0;
00658     } else if ((xNew+wChild) > wScreen) {
00659         xNew = wScreen - wChild;
00660     }
00661
00662     yNew = rParent.top  + ((hParent - hChild) /2);
00663     if (yNew < 0) {
00664         yNew = 0;
00665     } else if ((yNew+hChild) > hScreen) {
00666         yNew = hScreen - hChild;
00667     }
00668
00669     return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
00670 }
00671
00672
00673 LONG_PTR APIENTRY WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00674 {
00675     HINSTANCE hInst = 0;
00676     HDC hdc;
00677     PAINTSTRUCT ps;
00678     FARPROC lpDlgFunc;
00679     char    szMsg [80];
00680     time_t  lTime;
00681     struct tm *datetime;
00682
00683 #define HOUR (datetime->tm_hour)
00684 #define MIN (datetime->tm_min)
00685 #define SEC (datetime->tm_sec)
00686
00687     char    szTime [20];
00688     int     index;
00689     RECT rect;
00690
00691 static INT_PTR  idMenuSelect;
00692     INT_PTR     tmp;
00693     LONG_PTR wmEvent, wmId;
00694     HWND    wmhWnd;
00695     POINT   point;
00696     BOOL bRedraw;
00697     INT_PTR wmMenuCmd, wmFlags;
00698     HMENU wmhMenu;
00699
00700         if (hwnd) {
00701         hInst = (HINSTANCE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
00702         }
00703
00704     switch (msg) {
00705     case WM_CREATE:
00706             return DefWindowProc (hwnd, msg, wParam, lParam);
00707             break;
00708
00709         case WM_TIMER:
00710             time (&lTime);
00711             datetime = localtime (&lTime);
00712             _snprintf (szTime, sizeof(szTime), "%02d:%02d:%02d %s",
00713             (HOUR%12?HOUR%12:12), MIN, SEC, (LPSTR)(HOUR/12?"PM":"AM"));
00714             SetWindowText (hwndTimeField, szTime);
00715             break;
00716
00717         case WM_SIZE:
00718             AdjustToolBar (hwnd);
00719             AdjustStatusBar (hwnd);
00720             GetClientRect (hwnd, &rect);
00721             rect.top += ToolBarHeight (hwnd);
00722             rect.bottom -= StatusBarHeight (hwnd);
00723             SetWindowPos (hwndClient, NULL, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, SWP_NOZORDER);
00724             break;
00725
00726         case WM_CHAR:
00727             switch (wParam) {
00728                 case VK_F10:
00729                     wParam = VK_MENU;
00730                     return DefWindowProc (hwnd, msg, wParam, lParam);
00731                     break;
00732             }
00733             break;
00734
00735         case WM_PARENTNOTIFY:
00736             wmEvent = wParam;
00737             point.x = (int)LOWORD(lParam);
00738             point.y = (int)HIWORD(lParam);
00739
00740             ClientToScreen (hwnd, &point);
00741             wmhWnd  = WindowFromPoint(point);
00742             if (wmhWnd) {
00743                 wmId = GetWindowLongPtr (wmhWnd, GWLP_ID);
00744                         } else {
00745                                 break;
00746                         }
00747             switch (wmEvent) {
00748                 case WM_LBUTTONDOWN:
00749                 case WM_MBUTTONDOWN:
00750                 case WM_RBUTTONDOWN:
00751                     if (!LoadString (hInst, (UINT)wmId, szMsg, sizeof(szMsg))) {
00752                         _snprintf ((LPSTR)szMsg, sizeof(szMsg), "Unable to load ParentNotify string #%u", wmId);
00753                     }
00754                     SetWindowText (hwndMenuField, szMsg);
00755                     break;
00756             }
00757             break;
00758
00759         case WM_COMMAND:
00760             wmId = LOWORD(wParam);
00761             wmEvent = HIWORD(wParam);
00762             switch (wmId) {
00763                 case ID_CREATEPARAM:
00764
00765                     switch (wmEvent) {
00766                         case CBN_SETFOCUS: //Indicates that the combo box has received input focus.
00767                         case CBN_DROPDOWN: //Informs the owner of the combo box that its list box is about to be dropped down.
00768                             if (!LoadString (hInst, (UINT) wmId, szMsg, sizeof(szMsg))) {
00769                                 _snprintf ((LPSTR)szMsg, sizeof(szMsg), "Unable to load FontName string #%u", wmId);
00770                             }
00771                             SetWindowText (hwndMenuField, szMsg);
00772                             break;
00773
00774                         case CBN_SELCHANGE: //Sent when the selection has been changed.
00775                             index = (int)SendMessage (hwndCreateParam, CB_GETCURSEL, 0, 0);
00776                             if (index != CB_ERR) {
00777                                 SendMessage (hwndCreateParam, CB_GETLBTEXT, index, (LONG_PTR)(LPSTR)szMsg);
00778                                 FillInValue (hwndCreateValue, CFP_BASE+index);
00779                             } else {
00780                                 _snprintf (szMsg, sizeof(szMsg), "FontName: CB_ERR while retrieving text");
00781                             }
00782                             SetWindowText (hwndMenuField, szMsg);
00783                             break;
00784                     }
00785                     break;
00786
00787                 case ID_CREATEVALUE:
00788                     switch (wmEvent){
00789                         int iCreateParam;
00790                         int iParamValue;
00791
00792                         case CBN_SETFOCUS: //Indicates that the combo box has received input focus.
00793                         case CBN_DROPDOWN: //Informs the owner of the combo box that its list box is about to be dropped down.
00794                             if (!LoadString (hInst, (UINT)wmId, szMsg, sizeof(szMsg))) {
00795                                 _snprintf (szMsg, sizeof(szMsg), "Unable to load FontSize string #%u", wmId);
00796                             }
00797                             break;
00798
00799                         case CBN_SELCHANGE: //Sent when the selection has been changed.
00800                             index = (int)SendMessage (hwndCreateValue, CB_GETCURSEL, 0, 0);
00801                             bRedraw = FALSE;
00802                             if (index != CB_ERR) {
00803                                 SendMessage (hwndCreateValue, CB_GETLBTEXT, index, (LONG_PTR)(LPSTR)szMsg);
00804                                 iCreateParam =
00805                                     (int)SendMessage (hwndCreateParam, CB_GETITEMDATA,
00806                                         (DWORD_PTR)SendMessage (hwndCreateParam, CB_GETCURSEL, 0, (DWORD_PTR)0),
00807                                     (DWORD_PTR)0);
00808                                 iParamValue = (int)SendMessage (hwndCreateValue, CB_GETITEMDATA, index, 0);
00809
00810                                 switch (iCreateParam) {
00811                                     BYTE tmpByte;
00812
00813                                     case CFP_HEIGHT:
00814                                         if (lf.lfHeight != iParamValue) {
00815                                             lf.lfHeight = iParamValue;
00816                                             bRedraw = TRUE;
00817                                         }
00818                                         break;
00819
00820                                     case CFP_WIDTH:
00821                                         if (lf.lfWidth != iParamValue) {
00822                                             lf.lfWidth = iParamValue;
00823                                             bRedraw = TRUE;
00824                                         }
00825                                         break;
00826
00827                                     case CFP_ESCAPEMENT:
00828                                         if (lf.lfEscapement != iParamValue) {
00829                                             lf.lfEscapement= iParamValue;
00830                                             bRedraw = TRUE;
00831                                         }
00832                                         break;
00833
00834                                     case CFP_ORIENTATION:
00835                                         if (lf.lfOrientation!= iParamValue) {
00836                                             lf.lfOrientation= iParamValue;
00837                                             bRedraw = TRUE;
00838                                         }
00839                                         break;
00840
00841                                     case CFP_WEIGHT:
00842                                         if (lf.lfWeight != iParamValue) {
00843                                             lf.lfWeight= iParamValue;
00844                                             bRedraw = TRUE;
00845                                         }
00846                                         break;
00847
00848                                     case CFP_ITALIC:
00849                                         if ((int)lf.lfItalic != iParamValue) {
00850                                             lf.lfItalic = (BYTE)iParamValue;
00851                                             bRedraw = TRUE;
00852                                         }
00853                                         break;
00854
00855                                     case CFP_UNDERLINE:
00856                                         if (lf.lfUnderline != (BYTE)iParamValue) {
00857                                             lf.lfUnderline= (BYTE)iParamValue;
00858                                             bRedraw = TRUE;
00859                                         }
00860                                         break;
00861
00862                                     case CFP_STRIKEOUT:
00863                                         if (lf.lfStrikeOut != (BYTE)iParamValue) {
00864                                             lf.lfStrikeOut= (BYTE)iParamValue;
00865                                             bRedraw = TRUE;
00866                                         }
00867                                         break;
00868
00869                                     case CFP_CHARSET:
00870                                         if (lf.lfCharSet != (BYTE)iParamValue) {
00871                                             lf.lfCharSet= (BYTE)iParamValue;
00872                                             bRedraw = TRUE;
00873                                         }
00874                                         break;
00875
00876                                     case CFP_OUTPUTPRECISION:
00877                                         if (lf.lfOutPrecision != (BYTE)iParamValue) {
00878                                             lf.lfOutPrecision = (BYTE)iParamValue;
00879                                             bRedraw = TRUE;
00880                                         }
00881                                         break;
00882
00883                                     case CFP_CLIPPRECISION:
00884                                         if (lf.lfClipPrecision != (BYTE)iParamValue) {
00885                                             lf.lfClipPrecision = (BYTE)iParamValue;
00886                                             bRedraw = TRUE;
00887                                         }
00888                                         break;
00889
00890                                     case CFP_QUALITY:
00891                                         if (lf.lfQuality != (BYTE)iParamValue) {
00892                                             lf.lfQuality = (BYTE)iParamValue;
00893                                             bRedraw = TRUE;
00894                                         }
00895                                         break;
00896
00897                                     case CFP_PITCH:
00898                                         tmpByte = lf.lfPitchAndFamily;
00899                                         tmpByte &= 0xFC;
00900                                         tmpByte |= iParamValue;
00901                                         if (tmpByte != lf.lfPitchAndFamily) {
00902                                             lf.lfPitchAndFamily = tmpByte;
00903                                             bRedraw = TRUE;
00904                                         }
00905                                         break;
00906
00907                                     case CFP_FAMILY:
00908                                         tmpByte = lf.lfPitchAndFamily;
00909                                         tmpByte &= 0x03;
00910                                         tmpByte |= iParamValue;
00911                                         if (tmpByte != lf.lfPitchAndFamily) {
00912                                             lf.lfPitchAndFamily = tmpByte;
00913                                             bRedraw = TRUE;
00914                                         }
00915                                         break;
00916
00917                                     case CFP_FACENAME:
00918                                         if (lstrcmp (lf.lfFaceName, szMsg)!=0) {
00919                                             if (lstrcmp(lf.lfFaceName, "(none)") == 0) {
00920                                                 lf.lfFaceName[0] = 0;
00921                                             } else {
00922                                                 _snprintf (lf.lfFaceName, sizeof(lf.lfFaceName)/sizeof(TCHAR), "%s",(LPSTR)szMsg);
00923                                                 bRedraw = TRUE;
00924                                             }
00925                                         }
00926                                         break;
00927                                 }
00928                             } else {
00929                                 _snprintf (szMsg, sizeof(szMsg), "CreateValue: CB_ERR while retrieving text");
00930                             }
00931                             if (bRedraw) {
00932                                 InvalidateRect (hwndClient, NULL, TRUE);
00933                             }
00934                             SetWindowText (hwndMenuField, szMsg);
00935                             break;
00936                     }
00937                     break;
00938
00939                 // The Menu Selections
00940                 case IDM_NEW:
00941                 case IDM_OPEN:
00942                 case IDM_CLOSE:
00943                 case IDM_SAVE:
00944                 case IDM_SAVEAS:
00945                 case IDM_PRINT:
00946                 case IDM_PRINTSET:
00947                     SetWindowText (hwndMenuField, "This command is not yet implemented.");
00948                     break;
00949
00950                 case IDM_EXIT:
00951                     DestroyWindow(hwnd);
00952                     break;
00953
00954                 case IDM_UNDO:
00955                 case IDM_CUT:
00956                 case IDM_COPY:
00957                 case IDM_PASTE:
00958                 case IDM_DELETE:
00959                 case IDM_FIND:
00960                 case IDM_REPLACE:
00961                     SetWindowText (hwndMenuField, "This command is not yet implemented.");
00962                     break;
00963
00964
00965                                 case ID_ZOOM:
00966                                         if (bZoomed) {
00967                         SetWindowLongPtr (hwndClient, GWLP_WNDPROC, (LONG_PTR)fpCharSetProc);
00968                         bZoomed = FALSE;
00969                     } else {
00970                         SetWindowLongPtr (hwndClient, GWLP_WNDPROC, (LONG_PTR)fpGlyphProc);
00971                         bZoomed = TRUE;
00972                     }
00973                     InvalidateRect (hwndClient, NULL, TRUE);
00974                     break;
00975
00976                 case IDM_CHARSET: // Display the full characater set
00977                     SetWindowLongPtr (hwndClient, GWLP_WNDPROC, (LONG_PTR)fpCharSetProc);
00978                     InvalidateRect (hwndClient, NULL, TRUE);
00979                     bZoomed = FALSE;
00980                     break;
00981
00982                 case IDM_GLYPH: // Display a single glyph from the font
00983                     SetWindowLongPtr (hwndClient, GWLP_WNDPROC, (LONG_PTR)fpGlyphProc);
00984                     InvalidateRect (hwndClient, NULL, TRUE);
00985                     bZoomed = TRUE;
00986                     break;
00987
00988                     break;
00989
00990                 case IDM_TOOLBAR: // This would hide the tool bar
00991                     SetWindowText (hwndMenuField, "This command is not yet implemented.");
00992                     break;
00993
00994                 case IDM_STATUSBAR: // This would hide the status bar
00995                     SetWindowText (hwndMenuField, "This command is not yet implemented.");
00996                     break;
00997
00998                 case IDM_CREATEFONT:
00999                     lpDlgFunc = MakeProcInstance((FARPROC) CreateDlgProc, hInst);
01000                     DialogBoxParam(hInst, "CreateFont", hwnd, (DLGPROC)lpDlgFunc, (DWORD_PTR)(LPLOGFONT)&lf);
01001                     FreeProcInstance(lpDlgFunc);
01002                     index = (int)SendMessage (hwndCreateParam, CB_GETCURSEL, 0, 0);
01003                     if (index != CB_ERR) {
01004                         FillInValue (hwndCreateValue, CFP_BASE+index);
01005                     } else {
01006                         _snprintf (szMsg, sizeof(szMsg), "CreateFont: CB_ERR while setting values");
01007                     }
01008                     InvalidateRect (hwndClient, NULL, TRUE);
01009
01010                     break;
01011
01012                 case IDM_TEXTMETRIC:
01013                     lpDlgFunc = MakeProcInstance((FARPROC) MetricsDlgProc, hInst);
01014                     DialogBoxParam(hInst, "TextMetric", hwnd, (DLGPROC)lpDlgFunc, (DWORD_PTR)(LPLOGFONT)&lf);
01015                     FreeProcInstance(lpDlgFunc);
01016                     index = (int)SendMessage (hwndCreateParam, CB_GETCURSEL, 0, 0);
01017                     if (index != CB_ERR) {
01018                         FillInValue (hwndCreateValue, CFP_BASE+index);
01019                     } else {
01020                         _snprintf (szMsg, sizeof(szMsg), "CreateFont: CB_ERR while setting values");
01021                     }
01022                     InvalidateRect (hwndClient, NULL, TRUE);
01023                     break;
01024
01025                 case IDM_ENUMFONTS:
01026                     lpDlgFunc = MakeProcInstance((FARPROC) EnumDlgProc, hInst);
01027                     DialogBoxParam(hInst, "EnumFonts", hwnd, (DLGPROC)lpDlgFunc, (DWORD_PTR)(LPLOGFONT)&lf);
01028                     FreeProcInstance(lpDlgFunc);
01029                     index = (int)SendMessage (hwndCreateParam, CB_GETCURSEL, 0, 0);
01030                     if (index != CB_ERR) {
01031                         FillInValue (hwndCreateValue, CFP_BASE+index);
01032                     } else {
01033                         _snprintf (szMsg, sizeof(szMsg), "CreateFont: CB_ERR while setting values");
01034                     }
01035                     InvalidateRect (hwndClient, NULL, TRUE);
01036                     break;
01037
01038                 case IDM_OUTLINEMETRICS:
01039                     SetWindowText (hwndMenuField, "This command is not yet implemented.");
01040                     break;
01041
01042                 case IDM_HELP_CONTENTS:
01043                     WinHelp (hwnd, "FontView.HLP", HELP_KEY, (DWORD_PTR)(LPSTR)"CONTENTS");
01044                     break;
01045                 case IDM_HELP_INDEX:
01046                     WinHelp (hwnd, "FontView.HLP", HELP_KEY, (DWORD_PTR)(LPSTR)"INDEX");
01047                     break;
01048                 case IDM_HELP_OVERVIEW:
01049                     WinHelp (hwnd, "FontView.HLP", HELP_KEY, (DWORD_PTR)(LPSTR)"OVERVIEW");
01050                     break;
01051                 case IDM_HELP_GLOSSARY:
01052                     WinHelp (hwnd, "FontView.HLP", HELP_KEY, (DWORD_PTR)(LPSTR)"GLOSSARY");
01053                     break;
01054                 case IDM_HELP_TUTORIAL:
01055                     WinHelp (hwnd, "FontView.HLP", HELP_KEY, (DWORD_PTR)(LPSTR)"TUTORIAL");
01056                     break;
01057                 case IDM_HELP_DEMO:
01058                     WinHelp (hwnd, "FontView.HLP", HELP_KEY, (DWORD_PTR)(LPSTR)"DEMO");
01059                     break;
01060                 case IDM_HELP_HELP:
01061                     WinHelp (hwnd, "FontView.HLP", HELP_KEY, (DWORD_PTR)(LPSTR)"HELP");
01062                     break;
01063
01064                 case IDM_ABOUT:
01065                     lpDlgFunc = MakeProcInstance((FARPROC) SimpleDlgProc, hInst);
01066                     DialogBox(hInst,
01067                         (wmId==IDM_ABOUT)?"FONTVIEW":"UsageBox",
01068                         hwnd,
01069                         (DLGPROC)lpDlgFunc);
01070                     FreeProcInstance(lpDlgFunc);
01071                     break;
01072
01073
01074
01075             }
01076             break;
01077
01078     case WM_PAINT:
01079         hdc = BeginPaint (hwnd, &ps);
01080         EndPaint (hwnd, &ps);
01081         break;
01082
01083     case WM_MENUSELECT:
01084         /* A menu item is hilited, get description text for status bar */
01085         tmp = idMenuSelect;
01086
01087         wmMenuCmd = LOWORD(wParam);
01088         wmFlags = HIWORD(wParam);
01089         wmhMenu = (HMENU)lParam;
01090
01091         if((wmhMenu == 0) && (wmFlags == -1)) {
01092                 tmp = idMenuSelect = 0;
01093                 SetWindowText(hwndMenuField, "Ready...");
01094         } else if(wmhMenu == 0) {
01095             /* don't do anything for this */
01096         } else if(wmFlags & MF_POPUP) {
01097             if((HMENU)wmMenuCmd == hSysMenuMain)
01098                     idMenuSelect = IDM_SYSMENU;
01099             else if((HMENU)wmMenuCmd == hFileMenu)
01100                     idMenuSelect = IDM_FILE;
01101             else if((HMENU)wmMenuCmd == hEditMenu)
01102                     idMenuSelect = IDM_EDIT;
01103             else if((HMENU)wmMenuCmd == hViewMenu)
01104                     idMenuSelect = IDM_VIEW;
01105             else if((HMENU)wmMenuCmd == hMetricsMenu)
01106                     idMenuSelect = IDM_DIALOG;
01107             else if((HMENU)wmMenuCmd == hHelpMenu)
01108                     idMenuSelect = IDM_HELP;
01109         } else {
01110             if(wmMenuCmd != 0) {            /* separators have wparam of 0 */
01111                 idMenuSelect = wmMenuCmd;
01112             }
01113         }
01114
01115         if (idMenuSelect != tmp) {
01116             if (!LoadString ( hInst, (int)idMenuSelect, szMsg, sizeof(szMsg))) {
01117                 _snprintf ((LPSTR)szMsg, sizeof(szMsg), "Unable to load menu string #%u", idMenuSelect);
01118             }
01119             SetWindowText (hwndMenuField, szMsg);
01120         }
01121         break;
01122
01123         case WM_QUERYENDSESSION:
01124             return (MessageBox (GetFocus(), "Exit Application?", szAppTitle,
01125                 MB_ICONQUESTION | MB_YESNO) == IDYES);
01126
01127         case WM_DESTROY:
01128             if (hwnd == hwndMain) {
01129                 PostQuitMessage (0);
01130             }
01131             break;
01132
01133         default:
01134             return DefWindowProc (hwnd, msg, wParam, lParam);
01135     }
01136     return 0L;
01137 }
01138
01139 LONG_PTR APIENTRY ClientProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01140 {
01141     switch (msg) {
01142         default:
01143             return DefWindowProc (hwnd, msg, wParam, lParam);
01144     }
01145 }
01146
01147
01148 LONG_PTR APIENTRY ClientCharSetProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01149 {
01150     HINSTANCE hInst;
01151     PAINTSTRUCT ps;
01152     HFONT hfont, hfontPrev;
01153     RECT rect;
01154     HDC hdc;
01155     int x, y;
01156     BYTE glyph;
01157
01158         if (hwnd) {
01159         hInst = (HINSTANCE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
01160         }
01161     switch (msg) {
01162         case WM_PAINT:
01163             hdc = BeginPaint (hwnd, &ps);
01164             hfont = CreateFontIndirect (&lf);
01165             hfontPrev = SelectObject (hdc, hfont);
01166             GetClientRect (hwnd, &rect);
01167             DrawAscii (hdc, &rect, 0);
01168             SelectObject (hdc, hfontPrev);
01169             DeleteObject (hfont);
01170             EndPaint (hwnd, &ps);
01171             break;
01172
01173         case WM_LBUTTONDBLCLK:
01174             x = LOWORD(lParam);
01175             y = HIWORD(lParam);
01176             //OutputDebugString ("WM_LBUTTONDOWN\n\r");
01177             hdc = GetWindowDC (hwnd);
01178             hfont = CreateFontIndirect (&lf);
01179             hfontPrev = SelectObject (hdc, hfont);
01180             GetClientRect (hwnd, &rect);
01181
01182             glyph = FindChar (hdc, &rect, x, y);
01183             if (glyph) {
01184                 SetWindowLongPtr (hwndClient, GWLP_WNDPROC, (LONG_PTR)fpGlyphProc);
01185                 bZoomed = TRUE;
01186                 SendMessage (hwndClient, WM_USER, (UINT)glyph, 0);
01187                 InvalidateRect (hwndClient, NULL, TRUE);
01188             }
01189
01190             SelectObject (hdc, hfontPrev);
01191             DeleteObject (hfont);
01192             ReleaseDC (hwnd, hdc);
01193             break;
01194
01195
01196         default:
01197             return DefWindowProc (hwnd, msg, wParam, lParam);
01198     }
01199     return 0L;
01200 }
01201
01202 LONG_PTR APIENTRY ClientGlyphProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01203 {
01204     HINSTANCE hInst;
01205     PAINTSTRUCT ps;
01206     HFONT hfont, hfontPrev;
01207     RECT rect;
01208     HDC hdc;
01209     TEXTMETRIC tm;
01210     static BYTE glyph = 'A';
01211
01212         if (hwnd) {
01213         hInst = (HINSTANCE)GetWindowLongPtr (hwnd, GWLP_HINSTANCE);
01214         }
01215
01216     switch (msg) {
01217         case WM_LBUTTONDBLCLK:
01218         case WM_LBUTTONDOWN:
01219             glyph--;
01220             InvalidateRect (hwnd, NULL, TRUE);
01221             break;
01222
01223         case WM_RBUTTONDBLCLK:
01224         case WM_RBUTTONDOWN:
01225             glyph++;
01226             InvalidateRect (hwnd, NULL, TRUE);
01227             break;
01228
01229         case WM_USER:
01230             glyph = (BYTE)wParam;
01231             break;
01232
01233         case WM_PAINT:
01234             hdc = BeginPaint (hwnd, &ps);
01235             hfont = CreateFontIndirect (&lf);
01236             hfontPrev = SelectObject (hdc, hfont);
01237             GetClientRect (hwnd, &rect);
01238
01239             GetTextMetrics (hdc, &tm);
01240             if (glyph < tm.tmFirstChar) {
01241                 MessageBeep (0);
01242                 glyph = tm.tmFirstChar;
01243             }
01244             if (glyph > tm.tmLastChar) {
01245                 MessageBeep(0);
01246                 glyph = tm.tmLastChar;
01247             }
01248
01249             DrawGlyph (hdc, &rect, glyph, hfont);
01250             SelectObject (hdc, hfontPrev);
01251             DeleteObject (hfont);
01252             EndPaint (hwnd, &ps);
01253             break;
01254
01255         default:
01256             return DefWindowProc (hwnd, msg, wParam, lParam);
01257     }
01258     return 0L;
01259 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/FileTerm/CallNot.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • FileTerm

CallNot.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //
00004 //  Copyright (c) 1998-2001  Microsoft Corporation
00005 //
00006 //
00007 // callnot.cpp
00008 //
00009 // Implementation of the ITTAPIEventNotification interface.
00010 //
00011 // This is an outgoing interface that is defined by TAPI 3.0.  This
00012 // is basically a callback function that TAPI 3.0 calls to inform
00013 // the application of events related to calls (on a specific address)
00014 //
00015 // Please refer to COM documentation for information on outgoing
00016 // interfaces.
00017 //
00018 // An application must implement and register this interface in order
00019 // to receive calls and events related to calls
00020 //
00021 //////////////////////////////////////////////////////////////////////
00022
00023 #include <windows.h>
00024 #include <stdio.h>
00025 #include <tchar.h>
00026 #include <tapi3.h>
00027
00028 #include "callnot.h"
00029 #include "FileTerm.h"
00030 #include "resource.h"
00031
00032 extern ITBasicCallControl * g_pCall;
00033 extern HWND g_hDlg;
00034
00035 extern ITTerminal *g_pPlayFileTerm;
00036 extern ITTerminal *g_pRecordFileTerm;
00037
00038 //
00039 //to keep track of number of messages
00040 //
00041 DWORD g_dwMessages = 0;
00042
00043 //////////////////////////////////////////////////////////////////
00044 //
00045 // GetTerminalFromStreamEvent - get the stream from the event and
00046 // after this get the terminal from stream - if any
00047 //
00048 //////////////////////////////////////////////////////////////////
00049 HRESULT GetTerminalFromStreamEvent(
00050       IN ITCallMediaEvent * pCallMediaEvent,
00051             OUT ITTerminal ** ppTerminal )
00052 {
00053   //
00054   //do not return bogus value
00055   //
00056     *ppTerminal = NULL;
00057
00058     //
00059     // Get the stream for this event.
00060     //
00061     ITStream * pStream = NULL;
00062     HRESULT hr = pCallMediaEvent->get_Stream( &pStream );
00063     if (FAILED(hr))
00064   {
00065         DoMessage( _T("GetTerminalFromStreamEvent: get_Stream failed"));
00066     return E_FAIL;
00067   }
00068
00069     //
00070     // Enumerate the terminals on this stream.
00071     //
00072     IEnumTerminal * pEnumTerminal = NULL;
00073     hr = pStream->EnumerateTerminals( &pEnumTerminal );
00074
00075   //
00076   //not need this anymore
00077   //
00078     pStream->Release();
00079
00080     if ( FAILED(hr) )
00081   {
00082         DoMessage(_T("GetTerminalFromStreamEvent: EnumerateTerminals failed"));
00083     return hr;
00084   }
00085
00086     //
00087     // Get the first terminal -- if there aren't any, return E_FAIL so that
00088     // we skip this event (this happens when the terminal is on the other
00089     // stream).
00090     //
00091     hr = pEnumTerminal->Next(1, ppTerminal, NULL);
00092
00093   //
00094   //clean up
00095   //
00096     pEnumTerminal->Release();
00097
00098   //
00099   //map anything but S_OK to failure - even S_FALSE
00100   //
00101     if ( hr != S_OK )
00102   {
00103         return E_FAIL;
00104   }
00105
00106     return S_OK;
00107
00108 }
00109
00110
00111 ///////////////////////////////////////////////////////////////////
00112 // CallEventNotification
00113 //
00114 // The only method in the ITCallEventNotification interface.  This gets
00115 // called by TAPI 3.0 when there is a call event to report. This just
00116 // posts the message to our UI thread, so that we do as little as
00117 // possible on TAPI's callback thread.
00118 //
00119 ///////////////////////////////////////////////////////////////////
00120
00121 HRESULT
00122 STDMETHODCALLTYPE
00123 CTAPIEventNotification::Event(
00124           IN TAPI_EVENT TapiEvent,
00125           IN IDispatch * pEvent
00126           )
00127 {
00128
00129   //
00130   //sanity check
00131   //
00132   if(NULL == pEvent)
00133   {
00134     return S_OK;
00135   }
00136
00137     //
00138     // Addref the event so it doesn't go away.
00139     //
00140     pEvent->AddRef();
00141
00142     //
00143     // Post a message to our own UI thread.
00144     //
00145
00146     PostMessage(
00147                 g_hDlg,
00148                 WM_PRIVATETAPIEVENT,
00149                 (WPARAM) TapiEvent,
00150                 (LPARAM) pEvent
00151                );
00152
00153     return S_OK;
00154 }
00155
00156 ///////////////////////////////////////////////////////////////////
00157 // OnTapiEvent
00158 //
00159 // This is the real event handler, called on our UI thread when
00160 // the WM_PRIVATETAPIEVENT message is received
00161 //
00162 ///////////////////////////////////////////////////////////////////
00163
00164 HRESULT
00165 OnTapiEvent(
00166             IN TAPI_EVENT TapiEvent,
00167             IN IDispatch * pEvent
00168            )
00169 {
00170     HRESULT hr = E_FAIL;
00171
00172     switch ( TapiEvent )
00173     {
00174         case TE_CALLNOTIFICATION:
00175         {
00176             // TE_CALLNOTIFICATION means that the application is being notified
00177             // of a new call.
00178             //
00179       hr = DoCallNotification(pEvent);
00180             break;
00181         }//TE_CALLNOTIFICATION
00182
00183         case TE_CALLSTATE:
00184         {
00185             //
00186       // TE_CALLSTATE is a call state event.  pEvent is
00187             // an ITCallStateEvent
00188       //
00189       hr = DoCallState(pEvent);
00190             break;
00191         }//TE_CALLSTATE
00192
00193         case TE_CALLMEDIA:
00194         {
00195       //
00196       // TE_CALLMEDIA is a media event.  pEvent is an ITCallMediaEvent
00197       //
00198       hr = DoCallMedia(pEvent);
00199             break;
00200         }//TE_CALLMEDIA
00201
00202
00203     case TE_FILETERMINAL:
00204     {
00205             //
00206       // TE_FILETERMINAL is a file terminal event.  pEvent is an ITFileTerminalEvent
00207       //
00208       hr = DoFileEvent(pEvent);
00209       break;
00210     }//TE_FILETERMINAL
00211
00212     default:
00213       break;
00214     }
00215
00216
00217     pEvent->Release(); // we addrefed CTAPIEventNotification::Event()
00218
00219     return S_OK;
00220 }
00221
00222 ///////////////////////////////////////////////////////////////////
00223 // CheckStreamMT
00224 //
00225 // Helper method - check if pITStream has the requested media type
00226 //
00227 ///////////////////////////////////////////////////////////////////
00228 HRESULT CheckStreamMT(
00229       IN ITStream* pITStream,
00230       IN long mt)
00231 {
00232   long mtStream = TAPIMEDIATYPE_AUDIO;
00233   HRESULT hr = E_FAIL;
00234   if(FAILED(hr=pITStream->get_MediaType(&mtStream)))
00235   {
00236     return hr;
00237   }
00238   if(!(mt&mtStream))
00239   {
00240     return S_FALSE;
00241   }
00242   else
00243   {
00244     return S_OK;
00245   }
00246 }
00247
00248 ///////////////////////////////////////////////////////////////////
00249 // CheckStreamDir
00250 //
00251 // Helper method - check if pITStream has the requested direction
00252 //
00253 ///////////////////////////////////////////////////////////////////
00254 HRESULT CheckStreamDir(
00255       IN ITStream* pITStream,
00256       IN TERMINAL_DIRECTION td)
00257 {
00258   TERMINAL_DIRECTION tdStream = TD_CAPTURE ;
00259   HRESULT hr =E_FAIL;
00260   if(FAILED(hr=pITStream->get_Direction(&tdStream)))
00261   {
00262     return hr;
00263   }
00264   if(td!=tdStream)
00265   {
00266     return S_FALSE;
00267   }
00268   else
00269   {
00270     return S_OK;
00271   }
00272 }
00273
00274
00275 ///////////////////////////////////////////////////////////////////
00276 // CreateAndSelectFileRecordTerminal
00277 //
00278 // Creates FileRecording terminal, add the audio track, put_FileName
00279 // select track on the stream
00280 //
00281 ///////////////////////////////////////////////////////////////////
00282 HRESULT CreateAndSelectFileRecordTerminal()
00283 {
00284
00285   //
00286     // we should already have the call
00287     //
00288     if (NULL == g_pCall)
00289     {
00290         DoMessage( _T("CreateAndSelectFileRecordTerminal: we do not have a call"));
00291         return E_UNEXPECTED;
00292     }
00293
00294     //
00295     // get the ITStreamControl interface for this call
00296     //
00297   ITStreamControl* pStreamControl = NULL;
00298     HRESULT hr = g_pCall->QueryInterface( IID_ITStreamControl, (void**)&pStreamControl );
00299     if (FAILED(hr))
00300     {
00301         DoMessage( _T("CreateAndSelectFileRecordTerminal: QI for ITStreamControl failed"));
00302         return E_FAIL;
00303     }
00304
00305   //
00306   // make sure the record terminal was released
00307   //
00308   if(NULL != g_pRecordFileTerm)
00309   {
00310     g_pRecordFileTerm->Release();
00311     g_pRecordFileTerm = NULL;
00312   }
00313
00314     //
00315   // QI for ITBasicCallControl2 - prepare to request the terminal
00316   //
00317   ITBasicCallControl2* pITBCC2 = NULL;
00318     hr = g_pCall->QueryInterface( IID_ITBasicCallControl2, (void**)&pITBCC2 );
00319   if(FAILED(hr))
00320   {
00321     pStreamControl->Release();
00322     DoMessage( _T("CreateAndSelectFileRecordTerminal: QI for ITBasicCallControl2 failed"));
00323     return hr;
00324   }
00325
00326   //
00327   // get the BSTR CLSID used for ReqestTerminal
00328   //
00329   BSTR bstrCLSID = NULL;
00330   hr = StringFromCLSID(CLSID_FileRecordingTerminal, &bstrCLSID);
00331   if(FAILED(hr))
00332   {
00333     pITBCC2->Release();
00334     pStreamControl->Release();
00335     DoMessage( _T("CreateAndSelectFileRecordTerminal: StringFromCLSID failed"));
00336     return hr;
00337   }
00338   //
00339   // request the record terminal - use the right direction and media type
00340   //
00341   hr = pITBCC2->RequestTerminal(bstrCLSID,
00342                   TAPIMEDIATYPE_AUDIO,
00343                   TD_RENDER,
00344                   &g_pRecordFileTerm);
00345   //
00346   //clean up
00347   //
00348   ::CoTaskMemFree(bstrCLSID);
00349   pITBCC2->Release();
00350   if(FAILED(hr))
00351   {
00352     pStreamControl->Release();
00353     DoMessage( _T("CreateAndSelectFileRecordTerminal: RequestTerminal failed"));
00354     return hr;
00355   }
00356
00357     //
00358     // get to the ITMediaRecord interface so we can put_FileName
00359   // we can NOT select before put_FileName
00360     //
00361   ITMediaRecord* pITMediaRec = NULL;
00362     hr = g_pRecordFileTerm->QueryInterface( IID_ITMediaRecord, (void**)&pITMediaRec );
00363   if(FAILED(hr))
00364   {
00365     pStreamControl->Release();
00366     DoMessage( _T("CreateAndSelectFileRecordTerminal: QI ITMediaRecord failed"));
00367     return hr;
00368   }
00369
00370   //
00371   // we will have a file for each message
00372   //
00373   WCHAR wchFileName[MAX_PATH+1] = {0};
00374   _snwprintf(wchFileName, MAX_PATH,
00375                 _T("%s%ld%s"), REC_FILENAME,
00376                   g_dwMessages, REC_FILEEXT);
00377
00378
00379   wchFileName[MAX_PATH] = 0;
00380   BSTR bstrFileName = ::SysAllocString(wchFileName);
00381   if(NULL == bstrFileName)
00382   {
00383     pStreamControl->Release();
00384     DoMessage( _T("CreateAndSelectFileRecordTerminal: SysAllocString failed"));
00385     return E_OUTOFMEMORY;
00386   }
00387
00388   //
00389   // put_FileName
00390   //
00391   hr = pITMediaRec->put_FileName(bstrFileName);
00392
00393   //
00394   //clean up
00395   //
00396   ::SysFreeString(bstrFileName);
00397   pITMediaRec->Release();
00398
00399   if(FAILED(hr))
00400   {
00401     pStreamControl->Release();
00402     DoMessage( _T("CreateAndSelectFileRecordTerminal: put_FileName failed"));
00403     return hr;
00404   }
00405
00406     //
00407     // get to the ITMultiTrackTerminal interface so we can create tracks
00408     //
00409   ITMultiTrackTerminal* pMTRecTerminal = NULL;
00410     hr = g_pRecordFileTerm->QueryInterface( IID_ITMultiTrackTerminal, (void**)&pMTRecTerminal );
00411   if(FAILED(hr))
00412   {
00413     pStreamControl->Release();
00414     DoMessage( _T("CreateAndSelectFileRecordTerminal: QI IID_ITMultiTrackTerminal failed"));
00415     return hr;
00416   }
00417
00418     //
00419     // enumerate the streams on the call
00420     //
00421     IEnumStream* pEnumStreams = NULL;
00422     hr = pStreamControl->EnumerateStreams(&pEnumStreams);
00423     pStreamControl->Release();
00424
00425     if (FAILED(hr))
00426     {
00427     pMTRecTerminal->Release();
00428     DoMessage( _T("CreateAndSelectFileRecordTerminal: EnumerateStreams failed"));
00429     return hr;
00430     }
00431
00432   //
00433   // only do audio for now
00434   //
00435   long lMediaTypes = TAPIMEDIATYPE_AUDIO;
00436
00437     //
00438     // walk through the list of streams on the call
00439     // create what we need to
00440     //
00441   ITStream* pStream = NULL;
00442     while (S_OK == pEnumStreams->Next(1, &pStream, NULL))
00443     {
00444
00445         if ( (S_OK==CheckStreamMT(pStream,lMediaTypes))
00446         && (S_OK==CheckStreamDir(pStream,TD_RENDER)))
00447         {
00448             //
00449             // if we have a recording terminal, attempt to create a track terminal
00450             //
00451             ITTerminal* pRecordingTrack = NULL;
00452
00453       //
00454       //check stream for media type - when we check we have an &
00455       //
00456       long lStreamMediaType=0;
00457       hr = pStream->get_MediaType(&lStreamMediaType);
00458             if (FAILED(hr))
00459             {
00460         pStream->Release();
00461         pStream=NULL;
00462                 continue;
00463
00464             }
00465
00466       //
00467       // create track terminal
00468       //
00469             hr = pMTRecTerminal->CreateTrackTerminal(lStreamMediaType, TD_RENDER, &pRecordingTrack);
00470       if (FAILED(hr))
00471             {
00472         pStream->Release();
00473         pStream=NULL;
00474         //
00475         //will fail at the end anyway - lMediaTypes!=0 - so break here
00476         //
00477                 break;
00478
00479             }
00480
00481             //
00482       //select it on stream
00483       //
00484       hr = pStream->SelectTerminal(pRecordingTrack);
00485
00486       //
00487       //clean up
00488       //
00489       pStream->Release();
00490       pStream=NULL;
00491             pRecordingTrack->Release();
00492       pRecordingTrack=NULL;
00493
00494             if (FAILED(hr))
00495             {
00496         //
00497         //will fail at the end anyway - lMediaTypes!=0 - so break here
00498         //
00499                 break;
00500             }
00501
00502       lMediaTypes^=lStreamMediaType;
00503
00504       if(lMediaTypes==0)
00505       {
00506               //
00507         //we selected terminals for all media types we needed, we're done
00508         //
00509         break;
00510       }
00511
00512
00513         }
00514     //
00515     // clean up
00516     //
00517     if(pStream!=NULL)
00518     {
00519       pStream->Release();
00520       pStream = NULL;
00521     }
00522
00523     } // while (enumerating streams on the call)
00524
00525
00526   //
00527   //clean up
00528   //
00529     pMTRecTerminal->Release();
00530   pEnumStreams->Release();
00531
00532   //
00533   //check if we were able to select for all media types
00534   //
00535     if (lMediaTypes==0)
00536     {
00537         return S_OK;
00538     }
00539     else
00540     {
00541     DoMessage( _T("CreateAndSelectFileRecordTerminal: no streams available"));
00542         return E_FAIL;
00543     }
00544 }
00545
00546
00547 ///////////////////////////////////////////////////////////////////
00548 // SameCall
00549 //
00550 // check if same call object as g_pCall
00551 //
00552 ///////////////////////////////////////////////////////////////////
00553 bool SameCall(ITCallStateEvent* pCallStateEvent)
00554 {
00555
00556   //
00557   // sanity check
00558   //
00559   if(NULL == pCallStateEvent)
00560   {
00561     return false;
00562   }
00563
00564   //
00565   //get call object
00566   //
00567   ITCallInfo* pCallInfo = NULL;
00568   HRESULT hr = pCallStateEvent->get_Call(&pCallInfo);
00569   //
00570   //check if we have a call and get_Call succeded
00571   //
00572   if(NULL != pCallInfo &&  ( SUCCEEDED(hr) && NULL != g_pCall) )
00573   {
00574     bool bIsEqual = true;
00575     //
00576     //get and compare IUnknown for both objects
00577     //
00578     IUnknown* pIUnkCallInfo = NULL;
00579     IUnknown* pIUnkCallControl = NULL;
00580     pCallInfo->QueryInterface(IID_IUnknown, (void**)&pIUnkCallInfo);
00581     g_pCall->QueryInterface(IID_IUnknown, (void**)&pIUnkCallControl);
00582     //
00583     //compare
00584     //
00585     if(pIUnkCallInfo != pIUnkCallControl)
00586     {
00587       bIsEqual = false;
00588     }
00589
00590     //
00591     //clean up
00592     //
00593     pCallInfo->Release();
00594     if(NULL != pIUnkCallInfo)
00595     {
00596       pIUnkCallInfo->Release();
00597     }
00598     if(NULL != pIUnkCallControl)
00599     {
00600       pIUnkCallControl->Release();
00601     }
00602     return bIsEqual;
00603   }
00604   else
00605   {
00606     return false;
00607   }
00608
00609 }
00610
00611
00612 ///////////////////////////////////////////////////////////////////
00613 // DoCallNotification
00614 //
00615 // TE_CALLNOTIFICATION means that the application is being notified
00616 // of a new call.
00617 //
00618 // Note that we don't answer to call at this point.  The application
00619 // should wait for a CS_OFFERING CallState message before answering
00620 // the call.
00621 //
00622 ///////////////////////////////////////////////////////////////////
00623 HRESULT DoCallNotification(
00624         IN IDispatch * pEvent)
00625 {
00626
00627     ITCallNotificationEvent         * pNotify = NULL;
00628
00629     HRESULT hr = pEvent->QueryInterface( IID_ITCallNotificationEvent, (void **)&pNotify );
00630
00631     if (FAILED(hr))
00632     {
00633         DoMessage( _T("Incoming call, but failed to get the interface"));
00634     return hr;
00635     }
00636
00637     CALL_PRIVILEGE          cp = CP_MONITOR;
00638     ITCallInfo *            pCall = NULL;
00639
00640     //
00641     // get the call
00642     //
00643     hr = pNotify->get_Call( &pCall );
00644
00645     //
00646     // release the event object
00647     //
00648     pNotify->Release();
00649
00650   if(FAILED(hr))
00651   {
00652     DoMessage( _T("Incoming call, but failed to get the call"));
00653     return hr;
00654   }
00655
00656     //
00657     // check to see if we own the call
00658     //
00659
00660     hr = pCall->get_Privilege( &cp );
00661
00662   if(FAILED(hr))
00663   {
00664     pCall->Release();
00665     DoMessage( _T("Incoming call, but failed to get_Privilege"));
00666     return hr;
00667   }
00668
00669     if ( CP_OWNER != cp )
00670     {
00671         //
00672     // just ignore it if we don't own it
00673     //
00674         pCall->Release();
00675     return hr;
00676     }
00677
00678   //
00679   //check if we already have a call - if yes reject it
00680   //
00681   if(NULL != g_pCall)
00682   {
00683     ITBasicCallControl* pITBCC = NULL;
00684
00685       hr = pCall->QueryInterface( IID_ITBasicCallControl, (void**)&pITBCC );
00686         pCall->Release();
00687     //
00688     //sanity check
00689     //
00690     if(SUCCEEDED(hr))
00691     {
00692       //
00693       //disconnect - we'll handle the other events from this call later
00694       //
00695       pITBCC->Disconnect(DC_REJECTED);
00696           pITBCC->Release();
00697     }
00698     return hr;
00699   }
00700
00701   //
00702   //get the call if do not have already one
00703   //
00704     hr = pCall->QueryInterface( IID_ITBasicCallControl, (void**)&g_pCall );
00705   pCall->Release();
00706   if(FAILED(hr))
00707   {
00708     DoMessage( _T("Incoming call, but failed to QI ITBasicCallControl"));
00709   }
00710   else
00711   {
00712     //
00713     // update UI
00714     //
00715     SetStatusMessage(_T("Incoming Owner Call"));
00716   }
00717
00718   //
00719   //clean up
00720   //
00721
00722   return hr;
00723 }
00724
00725 ///////////////////////////////////////////////////////////////////
00726 // DoCallState
00727 //
00728 // TE_CALLSTATE is a call state event.  pEvent is
00729 // an ITCallStateEvent
00730 //
00731 ///////////////////////////////////////////////////////////////////
00732 HRESULT DoCallState(
00733         IN IDispatch * pEvent)
00734 {
00735
00736     CALL_STATE         cs = CS_IDLE;
00737     ITCallStateEvent * pCallStateEvent = NULL;
00738
00739     //
00740   // Get the interface
00741   //
00742     HRESULT hr = pEvent->QueryInterface( IID_ITCallStateEvent, (void **)&pCallStateEvent );
00743   if(FAILED(hr))
00744   {
00745         DoMessage( _T("CallStateEvent, but failed to get the interface"));
00746     return hr;
00747   }
00748
00749   //
00750   //check if same call - if it is not do not process the event
00751   //
00752   if(false == SameCall(pCallStateEvent))
00753   {
00754     pCallStateEvent->Release();
00755     return hr;
00756   }
00757
00758   //
00759     // get the CallState that we are being notified of.
00760   //
00761     hr = pCallStateEvent->get_State( &cs );
00762
00763     pCallStateEvent->Release();
00764
00765   if(FAILED(hr))
00766   {
00767         DoMessage( _T("ITCallStateEvent, but failed to get_State"));
00768     return hr;
00769   }
00770
00771     //
00772   // send messages to main dialog procedure
00773   //
00774     if (CS_OFFERING == cs)
00775     {
00776     PostMessage(g_hDlg, WM_COMMAND, IDC_ANSWER, 0);
00777     }
00778     else if (CS_DISCONNECTED == cs)
00779     {
00780         PostMessage(g_hDlg, WM_COMMAND, IDC_DISCONNECTED, 0);
00781     }
00782     else if (CS_CONNECTED == cs)
00783     {
00784         PostMessage(g_hDlg, WM_COMMAND, IDC_CONNECTED, 0);
00785     }
00786
00787   return hr;
00788 }
00789
00790
00791 ///////////////////////////////////////////////////////////////////
00792 // DoCallMedia
00793 //
00794 //
00795 // TE_CALLMEDIA is a media event.  pEvent is an ITCallMediaEvent
00796 //
00797 //
00798 ///////////////////////////////////////////////////////////////////
00799 HRESULT DoCallMedia(
00800         IN IDispatch * pEvent)
00801 {
00802
00803     CALL_MEDIA_EVENT    cme = CME_STREAM_INACTIVE;
00804     ITCallMediaEvent  * pCallMediaEvent = NULL;
00805
00806   //
00807   // check if we still have a call
00808   //
00809   if(NULL == g_pCall)
00810   {
00811     return E_UNEXPECTED;
00812   }
00813
00814     //
00815   // Get the interface
00816   //
00817     HRESULT hr = pEvent->QueryInterface( IID_ITCallMediaEvent, (void **)&pCallMediaEvent );
00818   if(FAILED(hr))
00819   {
00820         DoMessage( _T("ITCallMediaEvent, but failed to get the interface"));
00821     return hr;
00822   }
00823
00824     //
00825   // get the CALL_MEDIA_EVENT that we are being notified of.
00826   //
00827     hr = pCallMediaEvent->get_Event( &cme );
00828   if(FAILED(hr))
00829   {
00830     pCallMediaEvent->Release();
00831     DoMessage( _T("ITCallMediaEvent, but failed to get_Event"));
00832     return hr;
00833   }
00834
00835     switch ( cme )
00836     {
00837     //
00838     // the only event we process
00839     //
00840         case CME_STREAM_ACTIVE:
00841         {
00842             //
00843             // Get the terminal that's now active.
00844             //
00845             ITTerminal * pTerminal = NULL;
00846             hr = GetTerminalFromStreamEvent(pCallMediaEvent, &pTerminal);
00847
00848             if ( FAILED(hr) )
00849       {
00850         DoMessage(_T("ITCallMediaEvent: GetTerminalFromStreamEvent failed"));
00851         g_pCall->Disconnect(DC_NORMAL);
00852         break;
00853       }
00854
00855             //
00856             // Process this terminal based on the direction.
00857             //
00858             TERMINAL_DIRECTION td;
00859             hr = pTerminal->get_Direction( &td);
00860       //
00861       //clean up
00862       //
00863             pTerminal->Release();
00864
00865             if ( FAILED(hr) )
00866             {
00867               DoMessage(_T("ITCallMediaEvent: get_Direction failed"));
00868         g_pCall->Disconnect(DC_NORMAL);
00869                 break;
00870             }
00871
00872       //
00873       // if TD_CAPTURE and we have playback terminal start streaming
00874       //
00875             if ( TD_CAPTURE == td && NULL != g_pPlayFileTerm)
00876             {
00877         ITMediaControl* pITMC = NULL;
00878
00879         hr = g_pPlayFileTerm->QueryInterface(IID_ITMediaControl, (void**)&pITMC);
00880         //
00881         // get ITMediaControl so we can start streaming
00882         //
00883         if(FAILED(hr))
00884         {
00885           DoMessage(_T("ITCallMediaEvent: g_pPlayFileTerm QI for ITMediaControl failed"));
00886           g_pCall->Disconnect(DC_NORMAL);
00887           break;
00888         }
00889         //
00890         // Start streaming
00891         //
00892         hr = pITMC->Start();
00893         pITMC->Release();
00894         if(SUCCEEDED(hr))
00895         {
00896           SetStatusMessage(_T("File Playback Terminal started "));
00897         }
00898         else
00899         {
00900                 DoMessage(_T("ITCallMediaEvent: ITMediaControl::Start() failed"));
00901           g_pCall->Disconnect(DC_NORMAL);
00902         }
00903       }
00904
00905             break;
00906         }
00907
00908         default:
00909             break;
00910     }
00911
00912     //
00913   // clean up
00914   //
00915     pCallMediaEvent->Release();
00916
00917   return hr;
00918 }
00919
00920 ///////////////////////////////////////////////////////////////////
00921 // DoFileEvent
00922 //
00923 //
00924 // TE_FILETERMINAL is a file terminal event.  pEvent is an ITFileTerminalEvent
00925 //
00926 //
00927 ///////////////////////////////////////////////////////////////////
00928 HRESULT DoFileEvent(
00929         IN IDispatch * pEvent)
00930 {
00931
00932   //
00933   // check if we still have a call
00934   //
00935   if(NULL == g_pCall)
00936   {
00937     return E_UNEXPECTED;
00938   }
00939
00940   ITFileTerminalEvent* pITFTEvent = NULL;
00941   HRESULT hr = pEvent->QueryInterface( IID_ITFileTerminalEvent,
00942                    reinterpret_cast<void **>(&pITFTEvent) );
00943
00944   if (FAILED(hr))
00945   {
00946     //
00947     // fatal error - can not continue - disconnect the call
00948     //
00949         DoMessage( _T("ITFileTerminalEvent, but failed to get the interface"));
00950     g_pCall->Disconnect(DC_NORMAL);
00951     return hr;
00952   }
00953
00954   //
00955   // get the state - we'll make some decision based on this
00956   //
00957   TERMINAL_MEDIA_STATE ftState=TMS_ACTIVE;
00958   hr = pITFTEvent->get_State(&ftState);
00959   if(FAILED(hr))
00960   {
00961     //
00962     // fatal error - can not continue - disconnect the call
00963     //
00964     pITFTEvent->Release();
00965         DoMessage( _T("ITFileTerminalEvent, but failed to get_State"));
00966     g_pCall->Disconnect(DC_NORMAL);
00967     return hr;
00968   }
00969
00970   //
00971   // we are interesred in TMS_IDLE because we will unselect playback and
00972   // select recording
00973   //
00974   if(ftState != TMS_IDLE)
00975   {
00976     pITFTEvent->Release();
00977     return hr;
00978   }
00979   //
00980   // get the terminal
00981   //
00982   ITTerminal *pTerminal = NULL;
00983   hr = pITFTEvent->get_Terminal(&pTerminal);
00984   //
00985   // do not need this anymore
00986   //
00987   pITFTEvent->Release();
00988
00989   if(FAILED(hr))
00990   {
00991     //
00992     // fatal error - can not continue - disconnect the call
00993     //
00994         DoMessage( _T("ITFileTerminalEvent, but failed to get_Terminal"));
00995     g_pCall->Disconnect(DC_NORMAL);
00996     return hr;
00997   }
00998
00999     TERMINAL_DIRECTION td;
01000     hr = pTerminal->get_Direction( &td);
01001     pTerminal->Release();
01002   if(FAILED(hr))
01003   {
01004     //
01005     // fatal error - can not continue - disconnect the call
01006     //
01007         DoMessage( _T("ITFileTerminalEvent, but failed to get_Direction"));
01008     g_pCall->Disconnect(DC_NORMAL);
01009     return hr;
01010   }
01011   if((td == TD_CAPTURE) && (NULL != g_pPlayFileTerm))
01012   {
01013     //
01014     // unselect playback - it is done - we reached the end or an error
01015     //
01016     ITBasicCallControl2 *pITBCC2 = NULL;
01017     hr = g_pCall->QueryInterface(IID_ITBasicCallControl2, (void**)&pITBCC2);
01018     if(FAILED(hr))
01019     {
01020       //
01021       // fatal error - can not continue - disconnect the call
01022       //
01023           DoMessage( _T("ITFileTerminalEvent, but failed to QI for ITBasicCallControl2"));
01024       g_pCall->Disconnect(DC_NORMAL);
01025       return hr;
01026     }
01027     //
01028     // use ITBasicCallControl2 methods - much easier than
01029     // enumerate stream, terminals, etc
01030     //
01031     hr = pITBCC2->UnselectTerminalOnCall(g_pPlayFileTerm);
01032     g_pPlayFileTerm->Release();
01033     g_pPlayFileTerm = NULL;
01034     pITBCC2->Release();
01035     if(FAILED(hr))
01036     {
01037       //
01038       // fatal error - can not continue - disconnect the call
01039       //
01040           DoMessage( _T("ITFileTerminalEvent, but failed to ITBasicCallControl2::UnselectTerminalOnCall"));
01041       g_pCall->Disconnect(DC_NORMAL);
01042       return hr;
01043     }
01044     //
01045     // select record - do not use automatic selection
01046     // we'll see how to use ITMultiTrackTerminal methods
01047     //
01048     hr = CreateAndSelectFileRecordTerminal();
01049     if(FAILED(hr))
01050     {
01051       //
01052       // fatal error - can not continue - disconnect the call
01053       //
01054       g_pCall->Disconnect(DC_NORMAL);
01055       SetStatusMessage(_T("CreateAndSelectFileRecordTerminal failed"));
01056       return hr;
01057     }
01058
01059     //
01060     // get ITMediaControl interface - we need to call Start
01061     //
01062     ITMediaControl* pITMC = NULL;
01063     hr = g_pRecordFileTerm->QueryInterface(IID_ITMediaControl, (void**)&pITMC);
01064     if(FAILED(hr))
01065     {
01066       //
01067       // fatal error - can not continue - disconnect the call
01068       //
01069           DoMessage( _T("ITFileTerminalEvent, but failed to QI ITMediaControl"));
01070       g_pCall->Disconnect(DC_NORMAL);
01071       return hr;
01072     }
01073
01074     hr = pITMC->Start();
01075     pITMC->Release();
01076     if(FAILED(hr))
01077     {
01078       //
01079       // fatal error - can not continue - disconnect the call
01080       //
01081           DoMessage( _T("ITFileTerminalEvent, but ITMediaControl::Start"));
01082       g_pCall->Disconnect(DC_NORMAL);
01083       return hr;
01084     }
01085
01086     SetStatusMessage(_T("File Record Terminal started "));
01087
01088     //
01089     // will stop recording after one minute
01090     //
01091     SetTimer(g_hDlg, TIMER_ID, MAX_REC_TIME, NULL);
01092     g_dwMessages++;
01093
01094   }
01095
01096   return hr;
01097 }
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/staticnode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

staticnode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CStaticNode class.  This is the Snap-in's
00014 //                top level node
00015 //
00016
00017
00018 #ifndef _CLASS_CSTATICNODE_
00019 #define _CLASS_CSTATICNODE_
00020
00021 #include "Globals.h"
00022 #include "BaseNode.h"          // For NODE_PROPERTIES
00023 #include "LListImpl.h"
00024
00025 class CDeviceNode;             // References
00026 class CComponentData;
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CStaticNode : public CBaseNode
00031 {
00032   public:
00033     CStaticNode();
00034     virtual ~CStaticNode();
00035
00036     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00037
00038
00039   // Virtual methods
00040   public:
00041     ULONG   GetNodeType() { return NODETYPE_STATIC; }
00042     GUID&   GetNodeGUID() { return thisGUID; }
00043     HRESULT GetProperty( BSTR bstrPropertyName, PBSTR pbstrProperty ) { return E_NOTIMPL; }
00044
00045
00046     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00047     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00048     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00049
00050   ///////////////////////////////////////////////////////////////////////////
00051   // Notification handlers
00052   public:
00053     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00054     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00055     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00056     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00057     HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00058             { return E_NOTIMPL; }
00059
00060     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00061             { return E_NOTIMPL; }
00062
00063     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00064             { return E_NOTIMPL; }
00065
00066
00067   /////////////////////////////////////////////////////////////////////////
00068   //  Context Menu methods
00069   //
00070   public:
00071     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00072     HRESULT Command( long lCommandID );
00073
00074   ///////////////////////////////////////////////////////////////////////////
00075   // Private helpers
00076   private:
00077     HRESULT  DeleteScopeItems( LPCONSOLENAMESPACE2 ipCNS );
00078     HRESULT  InsertScopeItems( LPCONSOLENAMESPACE2 ipCNS );
00079     HRESULT  RefreshNodeList();
00080     VOID     RemoveChildNodes();
00081
00082   ///////////////////////////////////////////////////////////////////////////
00083   // Public helpers
00084   public:
00085     HRESULT  AddDeviceNode( NODE_PROPERTIES* pProperties );
00086     VOID     ToggleStatus( LPDATAOBJECT ipDataObject );
00087     HWND     GetMessageWnd() { return m_hMessageWnd; }
00088
00089     static LRESULT CALLBACK StaticNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00090
00091   private:
00092     static GUID      thisGUID;
00093     HSCOPEITEM       m_hStaticNode;
00094     CComponentData*  m_pCompData;
00095     HWND             m_hMessageWnd;        // Our message handler
00096
00097     CLListImpl<CDeviceNode*,CDeviceNode*>  m_NodeList;
00098
00099   public:
00100     HWND             m_hAddDeviceDlg;      // Instance of AddDeviceDlg
00101
00102 };
00103
00104 #endif //_CLASS_CSTATICNODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_QOS_OPTIONS Member List

This is the complete list of members for _QOS_OPTIONS, including all inherited members.
bAlternateQos | _QOS_OPTIONS
bConfirmResv | _QOS_OPTIONS
bDisableSignalling | _QOS_OPTIONS
bFineGrainErrorAvail | _QOS_OPTIONS
bFixTemplate | _QOS_OPTIONS
bMustSetQosInAccept | _QOS_OPTIONS
bProviderSpecific | _QOS_OPTIONS
bQosabilityIoctls | _QOS_OPTIONS
bQueryBufferSize | _QOS_OPTIONS
bReceiver | _QOS_OPTIONS
bSetDestaddr | _QOS_OPTIONS
bWaitToSend | _QOS_OPTIONS
qosIoctlSet | _QOS_OPTIONS
SendPriority | _QOS_OPTIONS
szTemplate | _QOS_OPTIONS
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/SCPCMenu.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

SCPCMenu.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       SCPCMenu.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // dsshexten.cpp : Implementation of DLL Exports.
00012
00013
00014 #include "stdafx.h"
00015 #include "resource.h"
00016 #include "initguid.h"
00017
00018 #include <dsadmin.h>
00019 #include "SCPCMenu.h"
00020
00021 #include "dsmenu.h"
00022
00023 /////////////////////////////////////////////////////////////////////////////////
00024
00025 // {2CE182CC-DD9D-11d2-AB28-01C04F68FA4A}
00026 static const CLSID CLSID_SCPContextMenu =
00027   { 0x2ce182cc, 0xdd9d, 0x11d2, { 0xab, 0x28, 0x01, 0xc0, 0x4f, 0x68, 0xfa, 0x4a } };
00028
00029
00030
00031 CSCPContextMenuModule _Module;
00032
00033 BEGIN_OBJECT_MAP(ObjectMap)
00034   OBJECT_ENTRY(CLSID_SCPContextMenu, CContextMenu)
00035 END_OBJECT_MAP()
00036
00037 class CSCPCMenuApp : public CWinApp
00038 {
00039 public:
00040   virtual BOOL InitInstance();
00041   virtual int ExitInstance();
00042 };
00043
00044 CSCPCMenuApp theApp;
00045
00046 BOOL CSCPCMenuApp::InitInstance()
00047 {
00048   _Module.Init(ObjectMap, m_hInstance);
00049   return CWinApp::InitInstance();
00050 }
00051
00052 int CSCPCMenuApp::ExitInstance()
00053 {
00054   _Module.Term();
00055   return CWinApp::ExitInstance();
00056 }
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 // Used to determine whether the DLL can be unloaded by OLE
00060
00061 STDAPI DllCanUnloadNow(void)
00062 {
00063   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00064   return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
00065 }
00066
00067 /////////////////////////////////////////////////////////////////////////////
00068 // Returns a class factory to create an object of the requested type
00069
00070 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00071 {
00072   return _Module.GetClassObject(rclsid, riid, ppv);
00073 }
00074
00075 /////////////////////////////////////////////////////////////////////////////
00076 // DllRegisterServer - Adds entries to the system registry
00077
00078 BOOL x = TRUE;
00079 STDAPI DllRegisterServer(void)
00080 {
00081     return _Module.RegisterServer(FALSE);
00082 }
00083
00084 /////////////////////////////////////////////////////////////////////////////
00085 // DllUnregisterServer - Removes entries from the system registry
00086
00087 STDAPI DllUnregisterServer(void)
00088 {
00089   _Module.UnregisterServer();
00090   return S_OK;
00091 }
00092
00093
00094
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Render_p.c Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Render_p.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /* this ALWAYS GENERATED file contains the proxy stub code */
00006
00007
00008 /* File created by MIDL compiler version 5.01.0164 */
00009 /* at Thu Apr 27 13:08:17 2000
00010  */
00011 /* Compiler settings for Render.idl:
00012     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00013     error checks: allocation ref bounds_check enum stub_data
00014 */
00015 //@@MIDL_FILE_HEADING(  )
00016
00017 #define USE_STUBLESS_PROXY
00018
00019
00020 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00021 #ifndef __REDQ_RPCPROXY_H_VERSION__
00022 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00023 #endif
00024
00025
00026 #include "rpcproxy.h"
00027 #ifndef __RPCPROXY_H_VERSION__
00028 #error this stub requires an updated version of <rpcproxy.h>
00029 #endif // __RPCPROXY_H_VERSION__
00030
00031
00032 #include "Render.h"
00033
00034 #define TYPE_FORMAT_STRING_SIZE   3
00035 #define PROC_FORMAT_STRING_SIZE   1
00036
00037 typedef struct _MIDL_TYPE_FORMAT_STRING
00038     {
00039     short          Pad;
00040     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00041     } MIDL_TYPE_FORMAT_STRING;
00042
00043 typedef struct _MIDL_PROC_FORMAT_STRING
00044     {
00045     short          Pad;
00046     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00047     } MIDL_PROC_FORMAT_STRING;
00048
00049
00050 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00051 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00052
00053
00054 /* Object interface: IUnknown, ver. 0.0,
00055    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IFactory, ver. 0.0,
00059    GUID={0xCFDD0BC0,0x9906,0x11d3,{0x95,0x3D,0x00,0x00,0xF8,0x04,0xE0,0x31}} */
00060
00061
00062 extern const MIDL_STUB_DESC Object_StubDesc;
00063
00064
00065 #pragma code_seg(".orpc")
00066 CINTERFACE_PROXY_VTABLE(3) _IFactoryProxyVtbl =
00067 {
00068     0,
00069     &IID_IFactory,
00070     IUnknown_QueryInterface_Proxy,
00071     IUnknown_AddRef_Proxy,
00072     IUnknown_Release_Proxy
00073 };
00074
00075 const CInterfaceStubVtbl _IFactoryStubVtbl =
00076 {
00077     &IID_IFactory,
00078     0,
00079     3,
00080     0, /* pure interpreted */
00081     CStdStubBuffer_METHODS
00082 };
00083
00084
00085 /* Object interface: IDispatch, ver. 0.0,
00086    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00087
00088
00089 /* Object interface: IBehavior, ver. 0.0,
00090    GUID={0xCFDD0BC1,0x9906,0x11d3,{0x95,0x3D,0x00,0x00,0xF8,0x04,0xE0,0x31}} */
00091
00092
00093 extern const MIDL_STUB_DESC Object_StubDesc;
00094
00095
00096 #pragma code_seg(".orpc")
00097 CINTERFACE_PROXY_VTABLE(7) _IBehaviorProxyVtbl =
00098 {
00099     0,
00100     &IID_IBehavior,
00101     IUnknown_QueryInterface_Proxy,
00102     IUnknown_AddRef_Proxy,
00103     IUnknown_Release_Proxy ,
00104     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00105     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00106     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00107     0 /* IDispatch_Invoke_Proxy */
00108 };
00109
00110
00111 static const PRPC_STUB_FUNCTION IBehavior_table[] =
00112 {
00113     STUB_FORWARDING_FUNCTION,
00114     STUB_FORWARDING_FUNCTION,
00115     STUB_FORWARDING_FUNCTION,
00116     STUB_FORWARDING_FUNCTION
00117 };
00118
00119 CInterfaceStubVtbl _IBehaviorStubVtbl =
00120 {
00121     &IID_IBehavior,
00122     0,
00123     7,
00124     &IBehavior_table[-3],
00125     CStdStubBuffer_DELEGATING_METHODS
00126 };
00127
00128
00129 /* Object interface: IEventSink, ver. 0.0,
00130    GUID={0xCFDD0BC2,0x9906,0x11d3,{0x95,0x3D,0x00,0x00,0xF8,0x04,0xE0,0x31}} */
00131
00132
00133 extern const MIDL_STUB_DESC Object_StubDesc;
00134
00135
00136 #pragma code_seg(".orpc")
00137
00138 static const MIDL_STUB_DESC Object_StubDesc =
00139     {
00140     0,
00141     NdrOleAllocate,
00142     NdrOleFree,
00143     0,
00144     0,
00145     0,
00146     0,
00147     0,
00148     __MIDL_TypeFormatString.Format,
00149     1, /* -error bounds_check flag */
00150     0x20000, /* Ndr library version */
00151     0,
00152     0x50100a4, /* MIDL Version 5.1.164 */
00153     0,
00154     0,
00155     0,  /* notify & notify_flag routine table */
00156     1,  /* Flags */
00157     0,  /* Reserved3 */
00158     0,  /* Reserved4 */
00159     0   /* Reserved5 */
00160     };
00161
00162 CINTERFACE_PROXY_VTABLE(7) _IEventSinkProxyVtbl =
00163 {
00164     0,
00165     &IID_IEventSink,
00166     IUnknown_QueryInterface_Proxy,
00167     IUnknown_AddRef_Proxy,
00168     IUnknown_Release_Proxy ,
00169     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00170     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00171     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00172     0 /* IDispatch_Invoke_Proxy */
00173 };
00174
00175
00176 static const PRPC_STUB_FUNCTION IEventSink_table[] =
00177 {
00178     STUB_FORWARDING_FUNCTION,
00179     STUB_FORWARDING_FUNCTION,
00180     STUB_FORWARDING_FUNCTION,
00181     STUB_FORWARDING_FUNCTION
00182 };
00183
00184 CInterfaceStubVtbl _IEventSinkStubVtbl =
00185 {
00186     &IID_IEventSink,
00187     0,
00188     7,
00189     &IEventSink_table[-3],
00190     CStdStubBuffer_DELEGATING_METHODS
00191 };
00192
00193 #pragma data_seg(".rdata")
00194
00195 #if !defined(__RPC_WIN32__)
00196 #error  Invalid build platform for this stub.
00197 #endif
00198
00199 #if !(TARGET_IS_NT40_OR_LATER)
00200 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00201 #error   -Oif or -Oicf, more than 32 methods in the interface.
00202 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00203 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00204 #endif
00205
00206
00207 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00208     {
00209         0,
00210         {
00211
00212       0x0
00213         }
00214     };
00215
00216 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00217     {
00218         0,
00219         {
00220       NdrFcShort( 0x0 ),  /* 0 */
00221
00222       0x0
00223         }
00224     };
00225
00226 const CInterfaceProxyVtbl * _Render_ProxyVtblList[] =
00227 {
00228     ( CInterfaceProxyVtbl *) &_IFactoryProxyVtbl,
00229     ( CInterfaceProxyVtbl *) &_IBehaviorProxyVtbl,
00230     ( CInterfaceProxyVtbl *) &_IEventSinkProxyVtbl,
00231     0
00232 };
00233
00234 const CInterfaceStubVtbl * _Render_StubVtblList[] =
00235 {
00236     ( CInterfaceStubVtbl *) &_IFactoryStubVtbl,
00237     ( CInterfaceStubVtbl *) &_IBehaviorStubVtbl,
00238     ( CInterfaceStubVtbl *) &_IEventSinkStubVtbl,
00239     0
00240 };
00241
00242 PCInterfaceName const _Render_InterfaceNamesList[] =
00243 {
00244     "IFactory",
00245     "IBehavior",
00246     "IEventSink",
00247     0
00248 };
00249
00250 const IID *  _Render_BaseIIDList[] =
00251 {
00252     0,
00253     &IID_IDispatch,
00254     &IID_IDispatch,
00255     0
00256 };
00257
00258
00259 #define _Render_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _Render, pIID, n)
00260
00261 int __stdcall _Render_IID_Lookup( const IID * pIID, int * pIndex )
00262 {
00263     IID_BS_LOOKUP_SETUP
00264
00265     IID_BS_LOOKUP_INITIAL_TEST( _Render, 3, 2 )
00266     IID_BS_LOOKUP_NEXT_TEST( _Render, 1 )
00267     IID_BS_LOOKUP_RETURN_RESULT( _Render, 3, *pIndex )
00268
00269 }
00270
00271 const ExtendedProxyFileInfo Render_ProxyFileInfo =
00272 {
00273     (PCInterfaceProxyVtblList *) & _Render_ProxyVtblList,
00274     (PCInterfaceStubVtblList *) & _Render_StubVtblList,
00275     (const PCInterfaceName * ) & _Render_InterfaceNamesList,
00276     (const IID ** ) & _Render_BaseIIDList,
00277     & _Render_IID_Lookup,
00278     3,
00279     2,
00280     0, /* table of [async_uuid] interfaces */
00281     0, /* Filler1 */
00282     0, /* Filler2 */
00283     0  /* Filler3 */
00284 };
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/exceptionsub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

exceptionsub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __EXCEPTIONSUB_H__
00018 #define __EXCEPTIONSUB_H__
00019
00020 #include "resource.h"       // main symbols
00021
00022 CComBSTR GuidToBstr(REFGUID guid);
00023
00024 class CComSpy;
00025
00026 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00027 Class:   CExceptionSub
00028 Summary: Exception Event Subscriber
00029 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00030 class ATL_NO_VTABLE CExceptionSub :
00031   public CSysLCESub,
00032   public IComExceptionEvents
00033 {
00034 public:
00035   CExceptionSub(CComSpy * pSpy)
00036   {
00037     m_pSpy = pSpy;
00038   }
00039
00040   CExceptionSub()
00041   {
00042     m_pSpy = NULL;
00043   }
00044
00045   DECLARE_NOT_AGGREGATABLE(CExceptionSub)
00046   DECLARE_GET_CONTROLLING_UNKNOWN()
00047
00048   BEGIN_COM_MAP(CExceptionSub)
00049     COM_INTERFACE_ENTRY(IComExceptionEvents)
00050     COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00051   END_COM_MAP()
00052
00053   STDMETHODIMP GetEventType(EventEnum * e){*e = Exception;return S_OK;}
00054   STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00055   STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComExceptionEvents;return S_OK;}
00056
00057   STDMETHODIMP OnExceptionUser(
00058                COMSVCSEVENTINFO * pInfo,
00059                ULONG code,
00060                ULONG64 addr,
00061                LPCOLESTR pszStackTrace
00062               )
00063   {
00064     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnExceptionUser"), GuidToBstr(pInfo->guidApp));
00065
00066     WCHAR szCode[16];
00067     wsprintfW(szCode, L"0x%08X", code);
00068     m_pSpy -> AddParamValueToList(L"code", szCode);
00069
00070     WCHAR szAddress[32];
00071     wsprintfW(szAddress, L"0x%016X", addr);
00072     m_pSpy -> AddParamValueToList(L"Address", szAddress);
00073
00074     m_pSpy -> AddParamValueToList(L"StackTrace", pszStackTrace);
00075     return S_OK;
00076
00077
00078     IF_AUDIT_DO(OnExceptionUser)(pInfo->perfCount,GuidToBstr(pInfo->guidApp),
00079                     szCode,
00080                     szAddress,
00081                     pszStackTrace
00082                     );
00083   }
00084
00085 };
00086
00087 #endif //__EXCEPTIONSUB_H__
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PROVTYPEINFO Member List

This is the complete list of members for PROVTYPEINFO, including all inherited members.
iMaxScale | PROVTYPEINFO
ulColumnSize | PROVTYPEINFO
wszTypeName | PROVTYPEINFO
wType | PROVTYPEINFO
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/LSAPolicy/LsaPrivs/LsaPrivs.c Source File

  • Security
  • LSAPolicy
  • LsaPrivs

LsaPrivs.c

Go to the documentation of this file.
00001 /*---------------------------------------------------------------
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 LsaSamp.c
00011
00012 This sample demonstrates the use of the Lsa APIs to manage User
00013 Privileges.
00014
00015 This sample is dependant on these import libs
00016
00017    advapi32.lib (for LsaXxx)
00018    user32.lib (for wsprintf)
00019
00020 This sample will work properly compiled ANSI or Unicode.
00021
00022 History:    12-Jul-95 Scott Field (sfield)    Created
00023             08-Jan-99 David Mowers (davemo)   Updated
00024
00025 ---------------------------------------------------------------*/
00026
00027
00028 #ifndef UNICODE
00029 #define UNICODE
00030 #endif // UNICODE
00031
00032 #include <windows.h>
00033 #include <stdio.h>
00034
00035 #include "ntsecapi.h"
00036
00037 NTSTATUS
00038 OpenPolicy(
00039     LPWSTR ServerName,          // machine to open policy on (Unicode)
00040     DWORD DesiredAccess,        // desired access to policy
00041     PLSA_HANDLE PolicyHandle    // resultant policy handle
00042     );
00043
00044 BOOL
00045 GetAccountSid(
00046     LPTSTR SystemName,          // where to lookup account
00047     LPTSTR AccountName,         // account of interest
00048     PSID *Sid                   // resultant buffer containing SID
00049     );
00050
00051 NTSTATUS
00052 SetPrivilegeOnAccount(
00053     LSA_HANDLE PolicyHandle,    // open policy handle
00054     PSID AccountSid,            // SID to grant privilege to
00055     LPWSTR PrivilegeName,       // privilege to grant (Unicode)
00056     BOOL bEnable                // enable or disable
00057     );
00058
00059 void
00060 InitLsaString(
00061     PLSA_UNICODE_STRING LsaString, // destination
00062     LPWSTR String                  // source (Unicode)
00063     );
00064
00065 void
00066 DisplayNtStatus(
00067     LPSTR szAPI,                // pointer to function name (ANSI)
00068     NTSTATUS Status             // NTSTATUS error value
00069     );
00070
00071 void
00072 DisplayWinError(
00073     LPSTR szAPI,                // pointer to function name (ANSI)
00074     DWORD WinError              // DWORD WinError
00075     );
00076
00077 #define RTN_OK 0
00078 #define RTN_USAGE 1
00079 #define RTN_ERROR 13
00080
00081 //
00082 // If you have the ddk, include ntstatus.h.
00083 //
00084 #ifndef STATUS_SUCCESS
00085 #define STATUS_SUCCESS  ((NTSTATUS)0x00000000L)
00086 #endif
00087
00088 int
00089 __cdecl
00090 main(
00091     int argc,
00092     char *argv[]
00093     )
00094 {
00095     LSA_HANDLE PolicyHandle;
00096     WCHAR wComputerName[256]=L"";   // static machine name buffer
00097     TCHAR AccountName[256];         // static account name buffer
00098     PSID pSid;
00099     NTSTATUS Status;
00100     int iRetVal=RTN_ERROR;          // assume error from main
00101
00102     if(argc == 1) {
00103         fprintf(stderr,"Usage: %s <Account> [TargetMachine]\n", argv[0]);
00104         return RTN_USAGE;
00105     }
00106
00107     //
00108     // Pick up account name on argv[1].
00109     // Assumes source is ANSI. Resultant string is ANSI or Unicode
00110     //
00111     _snwprintf(AccountName, 256, TEXT("%hS"), argv[1]);
00112
00113     //
00114     // Pick up machine name on argv[2], if appropriate
00115     // assumes source is ANSI. Resultant string is Unicode.
00116     //
00117     if(argc == 3) _snwprintf(wComputerName, 256, L"%hS", argv[2]);
00118
00119     //
00120     // Open the policy on the target machine.
00121     //
00122     Status = OpenPolicy(
00123                 wComputerName,      // target machine
00124                 POLICY_CREATE_ACCOUNT | POLICY_LOOKUP_NAMES,
00125                 &PolicyHandle       // resultant policy handle
00126                 );
00127
00128     if(Status != STATUS_SUCCESS) {
00129         DisplayNtStatus("OpenPolicy", Status);
00130         return RTN_ERROR;
00131     }
00132
00133     //
00134     // Obtain the SID of the user/group.
00135     // Note that we could target a specific machine, but we don't.
00136     // Specifying NULL for target machine searches for the SID in the
00137     // following order: well-known, Built-in and local, primary domain,
00138     // trusted domains.
00139     //
00140     if(GetAccountSid(
00141             NULL,       // default lookup logic
00142             AccountName,// account to obtain SID
00143             &pSid       // buffer to allocate to contain resultant SID
00144             )) {
00145         //
00146         // We only grant the privilege if we succeeded in obtaining the
00147         // SID. We can actually add SIDs which cannot be looked up, but
00148         // looking up the SID is a good sanity check which is suitable for
00149         // most cases.
00150
00151         //
00152         // Grant the SeServiceLogonRight to users represented by pSid.
00153         //
00154         Status = SetPrivilegeOnAccount(
00155                     PolicyHandle,           // policy handle
00156                     pSid,                   // SID to grant privilege
00157                     L"SeServiceLogonRight", // Unicode privilege
00158                     TRUE                    // enable the privilege
00159                     );
00160
00161         if(Status == STATUS_SUCCESS)
00162             iRetVal=RTN_OK;
00163         else
00164             DisplayNtStatus("SetPrivilegeOnAccount", Status);
00165     }
00166     else {
00167         //
00168         // Error obtaining SID.
00169         //
00170         DisplayWinError("GetAccountSid", GetLastError());
00171     }
00172
00173     //
00174     // Close the policy handle.
00175     //
00176     LsaClose(PolicyHandle);
00177
00178     //
00179     // Free memory allocated for SID.
00180     //
00181     if(pSid != NULL) HeapFree(GetProcessHeap(), 0, pSid);
00182
00183     return iRetVal;
00184 }
00185
00186 /*++
00187 This function attempts to obtain a SID representing the supplied
00188 account on the supplied system.
00189
00190 If the function succeeds, the return value is TRUE. A buffer is
00191 allocated which contains the SID representing the supplied account.
00192 This buffer should be freed when it is no longer needed by calling
00193 HeapFree(GetProcessHeap(), 0, buffer)
00194
00195 If the function fails, the return value is FALSE. Call GetLastError()
00196 to obtain extended error information.
00197
00198 --*/
00199
00200 BOOL
00201 GetAccountSid(
00202     LPTSTR SystemName,
00203     LPTSTR AccountName,
00204     PSID *Sid
00205     )
00206 {
00207     LPTSTR ReferencedDomain=NULL;
00208     DWORD cbSid=128;    // initial allocation attempt
00209     DWORD cchReferencedDomain=16; // initial allocation size
00210     SID_NAME_USE peUse;
00211     BOOL bSuccess=FALSE; // assume this function will fail
00212
00213     __try {
00214
00215     //
00216     // initial memory allocations
00217     //
00218     *Sid = (PSID)HeapAlloc(GetProcessHeap(), 0, cbSid);
00219
00220     if(*Sid == NULL) __leave;
00221
00222     ReferencedDomain = (LPTSTR)HeapAlloc(
00223                     GetProcessHeap(),
00224                     0,
00225                     cchReferencedDomain * sizeof(TCHAR)
00226                     );
00227
00228     if(ReferencedDomain == NULL) __leave;
00229
00230     //
00231     // Obtain the SID of the specified account on the specified system.
00232     //
00233     while(!LookupAccountName(
00234                     SystemName,         // machine to lookup account on
00235                     AccountName,        // account to lookup
00236                     *Sid,               // SID of interest
00237                     &cbSid,             // size of SID
00238                     ReferencedDomain,   // domain account was found on
00239                     &cchReferencedDomain,
00240                     &peUse
00241                     )) {
00242         if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
00243             //
00244             // reallocate memory
00245             //
00246             *Sid = (PSID)HeapReAlloc(
00247                         GetProcessHeap(),
00248                         0,
00249                         *Sid,
00250                         cbSid
00251                         );
00252
00253             if(*Sid == NULL) __leave;
00254
00255             ReferencedDomain = (LPTSTR)HeapReAlloc(
00256                         GetProcessHeap(),
00257                         0,
00258                         ReferencedDomain,
00259                         cchReferencedDomain * sizeof(TCHAR)
00260                         );
00261
00262             if(ReferencedDomain == NULL) __leave;
00263         }
00264         else __leave;
00265     }
00266
00267     //
00268     // Indicate success.
00269     //
00270     bSuccess=TRUE;
00271
00272     } // try
00273     __finally {
00274
00275     //
00276     // Cleanup and indicate failure, if appropriate.
00277     //
00278
00279     HeapFree(GetProcessHeap(), 0, ReferencedDomain);
00280
00281     if(!bSuccess) {
00282         if(*Sid != NULL) {
00283             HeapFree(GetProcessHeap(), 0, *Sid);
00284             *Sid = NULL;
00285         }
00286     }
00287
00288     } // finally
00289
00290     return bSuccess;
00291 }
00292
00293 NTSTATUS
00294 SetPrivilegeOnAccount(
00295     LSA_HANDLE PolicyHandle,    // open policy handle
00296     PSID AccountSid,            // SID to grant privilege to
00297     LPWSTR PrivilegeName,       // privilege to grant (Unicode)
00298     BOOL bEnable                // enable or disable
00299     )
00300 {
00301     LSA_UNICODE_STRING PrivilegeString;
00302
00303     //
00304     // Create a LSA_UNICODE_STRING for the privilege name.
00305     //
00306     InitLsaString(&PrivilegeString, PrivilegeName);
00307
00308     //
00309     // grant or revoke the privilege, accordingly
00310     //
00311     if(bEnable) {
00312         return LsaAddAccountRights(
00313                 PolicyHandle,       // open policy handle
00314                 AccountSid,         // target SID
00315                 &PrivilegeString,   // privileges
00316                 1                   // privilege count
00317                 );
00318     }
00319     else {
00320         return LsaRemoveAccountRights(
00321                 PolicyHandle,       // open policy handle
00322                 AccountSid,         // target SID
00323                 FALSE,              // do not disable all rights
00324                 &PrivilegeString,   // privileges
00325                 1                   // privilege count
00326                 );
00327     }
00328 }
00329
00330 void
00331 InitLsaString(
00332     PLSA_UNICODE_STRING LsaString,
00333     LPWSTR String
00334     )
00335 {
00336     DWORD StringLength;
00337
00338     if(String == NULL) {
00339         LsaString->Buffer = NULL;
00340         LsaString->Length = 0;
00341         LsaString->MaximumLength = 0;
00342         return;
00343     }
00344
00345     StringLength = lstrlenW(String);
00346     LsaString->Buffer = String;
00347     LsaString->Length = (USHORT) StringLength * sizeof(WCHAR);
00348     LsaString->MaximumLength=(USHORT)(StringLength+1) * sizeof(WCHAR);
00349 }
00350
00351 NTSTATUS
00352 OpenPolicy(
00353     LPWSTR ServerName,
00354     DWORD DesiredAccess,
00355     PLSA_HANDLE PolicyHandle
00356     )
00357 {
00358     LSA_OBJECT_ATTRIBUTES ObjectAttributes;
00359     LSA_UNICODE_STRING ServerString;
00360     PLSA_UNICODE_STRING Server;
00361
00362     //
00363     // Always initialize the object attributes to all zeroes.
00364     //
00365     ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
00366
00367     if (ServerName != NULL) {
00368         //
00369         // Make a LSA_UNICODE_STRING out of the LPWSTR passed in
00370         //
00371         InitLsaString(&ServerString, ServerName);
00372         Server = &ServerString;
00373     } else {
00374         Server = NULL;
00375     }
00376
00377     //
00378     // Attempt to open the policy.
00379     //
00380     return LsaOpenPolicy(
00381                 Server,
00382                 &ObjectAttributes,
00383                 DesiredAccess,
00384                 PolicyHandle
00385                 );
00386 }
00387
00388 void
00389 DisplayNtStatus(
00390     LPSTR szAPI,
00391     NTSTATUS Status
00392     )
00393 {
00394     //
00395     // Convert the NTSTATUS to Winerror. Then call DisplayWinError().
00396     //
00397     DisplayWinError(szAPI, LsaNtStatusToWinError(Status));
00398 }
00399
00400 void
00401 DisplayWinError(
00402     LPSTR szAPI,
00403     DWORD WinError
00404     )
00405 {
00406     LPSTR MessageBuffer;
00407     DWORD dwBufferLength;
00408
00409     //
00410     // TODO: Get this fprintf out of here!
00411     //
00412     fprintf(stderr,"%s error!\n", szAPI);
00413
00414     if(dwBufferLength=FormatMessageA(
00415                         FORMAT_MESSAGE_ALLOCATE_BUFFER |
00416                         FORMAT_MESSAGE_FROM_SYSTEM,
00417                         NULL,
00418                         WinError,
00419                         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00420                         (LPSTR) &MessageBuffer,
00421                         0,
00422                         NULL
00423                         ))
00424     {
00425         DWORD dwBytesWritten; // unused
00426
00427         //
00428         // Output message string on stderr.
00429         //
00430         WriteFile(
00431             GetStdHandle(STD_ERROR_HANDLE),
00432             MessageBuffer,
00433             dwBufferLength,
00434             &dwBytesWritten,
00435             NULL
00436             );
00437
00438         //
00439         // Free the buffer allocated by the system.
00440         //
00441         LocalFree(MessageBuffer);
00442     }
00443 }
00444
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRTCIncomingDlg Member List

This is the complete list of members for CRTCIncomingDlg, including all inherited members.
AddRef(void) | CRTCIncomingDlg | [protected]
AddToMediaCapabilities(LONG lMedia, VARIANT_BOOL fPersist) | CRTCIncomingDlg | [protected]
CRTCIncomingDlg(CWnd *pParent=NULL) | CRTCIncomingDlg |
DoDataExchange(CDataExchange *pDX) | CRTCIncomingDlg | [protected, virtual]
Event(RTC_EVENT RTCEvent, IDispatch *pEvent) | CRTCIncomingDlg | [protected]
IDD enum value | CRTCIncomingDlg |
InitializeRTCApp() | CRTCIncomingDlg | [protected]
m_bAutoAnswer | CRTCIncomingDlg | [protected]
m_btnAnswer | CRTCIncomingDlg |
m_btnDisconnect | CRTCIncomingDlg |
m_chkAutoAnswer | CRTCIncomingDlg |
m_ctrlEditStatus | CRTCIncomingDlg |
m_dwEventCookie | CRTCIncomingDlg | [protected]
m_dwRefCount | CRTCIncomingDlg | [protected]
m_hIcon | CRTCIncomingDlg | [protected]
m_pIPrevVideo | CRTCIncomingDlg | [protected]
m_pIRecvVideo | CRTCIncomingDlg | [protected]
m_pIRTCClient | CRTCIncomingDlg | [protected]
m_pIRTCSession | CRTCIncomingDlg | [protected]
OnAnswer() | CRTCIncomingDlg | [protected]
OnCheckauto() | CRTCIncomingDlg | [protected]
OnClose() | CRTCIncomingDlg | [protected]
OnDisconnect() | CRTCIncomingDlg | [protected]
OnInitDialog() | CRTCIncomingDlg | [protected, virtual]
OnPaint() | CRTCIncomingDlg | [protected]
OnQueryDragIcon() | CRTCIncomingDlg | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CRTCIncomingDlg | [protected]
QueryInterface(REFIID iid, void **ppvObject) | CRTCIncomingDlg | [protected]
Release(void) | CRTCIncomingDlg | [protected]
ReleaseStateMachine() | CRTCIncomingDlg | [protected]
RTCClientEvent(IDispatch *pIDispatch) | CRTCIncomingDlg | [protected]
RTCMediaEvent(IDispatch *pIDispatch) | CRTCIncomingDlg | [protected]
RTCSessionStateEvent(IDispatch *pIDispatch) | CRTCIncomingDlg | [protected]
SESSION_OPERATION typedef | CRTCIncomingDlg | [protected]
SetAutoAnswerMode(VARIANT_BOOL bMode) | CRTCIncomingDlg | [protected]
ShutdownRTCApp() | CRTCIncomingDlg | [protected]
StateAnswerIDC(VARIANT_BOOL fEnable) | CRTCIncomingDlg | [protected]
StateCoCreateClient() | CRTCIncomingDlg | [protected]
StateDisconnectIDC(VARIANT_BOOL fEnable) | CRTCIncomingDlg | [protected]
StateInitClient() | CRTCIncomingDlg | [protected]
StateListenMode(RTC_LISTEN_MODE lMode) | CRTCIncomingDlg | [protected]
StateQueryActiveMedia(LONG *plActiveMedia) | CRTCIncomingDlg | [protected]
StateSessionControl(SESSION_OPERATION soType) | CRTCIncomingDlg | [protected]
StateSinkEvent(LONG lEventMask) | CRTCIncomingDlg | [protected]
StateUnSinkEvent() | CRTCIncomingDlg | [protected]
STO_ANSWER enum value | CRTCIncomingDlg | [protected]
STO_TERMINATE enum value | CRTCIncomingDlg | [protected]
tagSESSION_OPERATION enum name | CRTCIncomingDlg | [protected]
WindowProc(UINT message, WPARAM wParam, LPARAM lParam) | CRTCIncomingDlg | [protected, virtual]
Generated on Wed Nov 13 2024 16:57:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSecureObject Member List

This is the complete list of members for CSecureObject, including all inherited members.
CSecureObject() | CSecureObject |
GetColor(COLORREF *pcr) | CSecureObject | [private]
GetUserName(WCHAR szUserName[20]) | CSecureObject | [private]
m_crColor | CSecureObject |
m_cRef | CSecureObject | [private]
m_fDenyPutColor | CSecureObject |
m_fDenyPutUserName | CSecureObject |
m_rgchUserName | CSecureObject |
PutColor(COLORREF cr) | CSecureObject | [private]
PutUserName(WCHAR szUserName[20]) | CSecureObject | [private]
QueryInterface(REFIID iid, void **ppv) | CSecureObject | [private]
STDMETHODIMP_(ULONG) AddRef(void) | CSecureObject | [inline, private]
STDMETHODIMP_(ULONG) Release(void) | CSecureObject | [inline, private]
~CSecureObject() | CSecureObject |
Generated on Wed Nov 13 2024 16:57:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ComObj/CAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ComObj

CAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CAR.H
00003
00004   Summary:   Include file for the aggregatable COCar COM object class.
00005
00006              Of particular interest for an COM application, CAR
00007              showcases a COM Object Class offering a main IUnknown
00008              interface and the ICar interface (Car-related features).
00009              This multiple interface COM Object Class is achieved via
00010              the technique of nested classes.  The implementation of the
00011              ICar interface is nested inside of the COCar Class.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial COMOBJ.HTM
00015              file.  For more specific technical details on the internal
00016              workings see the comments dispersed throughout the
00017              module's source code.
00018
00019   Classes:   COCar
00020
00021   Functions:
00022
00023   Origin:    8-17-95: atrent - Created.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040
00041 #if !defined(CAR_H)
00042 #define CAR_H
00043
00044 #ifdef __cplusplus
00045
00046 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00047   ObjectClass: COCar
00048
00049   Summary:     COM object class for COCar COM objects.  COM objects of
00050                this class offer ICar interface features (Shift, Clutch,
00051                Speed, and Steer).  The mulitple interfaces on this COM
00052                object are constructed via the nested interface classes
00053                technique.
00054
00055   Interfaces:  IUnknown
00056                  Standard interface providing COM object features.
00057                ICar
00058                  Basic Car operation features.
00059
00060   Aggregation: Yes, COCar COM Objects are aggregatable by passing
00061                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00062 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00063 class COCar : public IUnknown
00064 {
00065   public:
00066     // Main Object Constructor & Destructor.
00067     COCar(IUnknown* pUnkOuter);
00068     ~COCar(void);
00069
00070     // IUnknown methods. Main object, non-delegating.
00071     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00072     STDMETHODIMP_(ULONG) AddRef(void);
00073     STDMETHODIMP_(ULONG) Release(void);
00074
00075   private:
00076     // We declare nested class interface implementations here.
00077
00078     class CImpICar : public ICar
00079     {
00080       public:
00081         // Interface Implementation Constructor & Destructor.
00082         CImpICar(COCar* pBackObj, IUnknown* pUnkOuter);
00083         ~CImpICar(void);
00084
00085         // IUnknown methods.
00086         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00087         STDMETHODIMP_(ULONG) AddRef(void);
00088         STDMETHODIMP_(ULONG) Release(void);
00089
00090         // ICar methods.
00091         STDMETHODIMP Shift(short nGear);
00092         STDMETHODIMP Clutch(short nEngaged);
00093         STDMETHODIMP Speed(short nMph);
00094         STDMETHODIMP Steer(short nAngle);
00095
00096       private:
00097         // Data private to this COCar interface implementation of ICar.
00098         ULONG        m_cRefI;        // Interface Ref Count (for debugging).
00099         COCar*       m_pBackObj;     // Parent Object back pointer.
00100         IUnknown*    m_pUnkOuter;    // Outer unknown for Delegation.
00101     };
00102
00103     // Make the otherwise private and nested ICar interface implementation
00104     // a friend to COM object instantiations of this selfsame COCar
00105     // COM object class.
00106     friend CImpICar;
00107
00108     // Private data of COCar COM objects.
00109
00110     // Nested ICar implementation instantiation.  This ICar interface
00111     // is instantiated inside this COCar object as a native interface.
00112     CImpICar         m_ImpICar;
00113
00114     // Main Object reference count.
00115     ULONG            m_cRefs;
00116
00117     // Outer unknown (aggregation & delegation).
00118     IUnknown*        m_pUnkOuter;
00119 };
00120
00121 typedef COCar* PCOCar;
00122
00123 #endif // __cplusplus
00124
00125
00126 #endif // CAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/stdafx.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

stdafx.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       StdAfx.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // stdafx.h : include file for standard system include files,
00012 //      or project specific include files that are used frequently,
00013 //      but are changed infrequently
00014
00015 #if !defined(AFX_STDAFX_H__501092D7_8966_11D1_B93C_00A0C9A06D2D__INCLUDED_)
00016 #define AFX_STDAFX_H__501092D7_8966_11D1_B93C_00A0C9A06D2D__INCLUDED_
00017
00018 #if _MSC_VER >= 1000
00019 #pragma once
00020 #endif // _MSC_VER >= 1000
00021
00022 #define STRICT
00023
00024 #include <afxwin.h>
00025 #include <afxdisp.h>
00026 #include "afxdlgs.h"
00027
00028
00029
00030 #define _ATL_APARTMENT_THREADED
00031
00032
00033 #include <activeds.h>
00034 #include <dsadmin.h>
00035
00036 #include <atlbase.h>
00037
00038 #if ( _ATL_VER >= 0x0300 )
00039 #define _ATL_NO_UUIDOF
00040 #endif
00041
00042
00043
00044
00045 class CMyWizExtModule : public CComModule
00046 {
00047 public:
00048   HRESULT WINAPI UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister);
00049 };
00050
00051 #define DECLARE_REGISTRY_CLSID() \
00052 static HRESULT WINAPI UpdateRegistry(BOOL bRegister) \
00053 { \
00054     return _Module.UpdateRegistryCLSID(GetObjectCLSID(), bRegister); \
00055 }
00056
00057 extern CMyWizExtModule _Module;
00058
00059 #include <atlcom.h>
00060
00061 #include <activeds.h> // Active Directory Services Interfaces
00062
00063 //{{AFX_INSERT_LOCATION}}
00064 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00065
00066 #endif // !defined(AFX_STDAFX_H__501092D7_8966_11D1_B93C_00A0C9A06D2D__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Pipes/LocalServer/component.cxx Source File

  • Com
  • Fundamentals
  • Pipes
  • LocalServer

component.cxx

Go to the documentation of this file.
00001 /* Copyright 1992 - 2000 Microsoft Corporation, All rights reserved.
00002  *
00003  *
00004  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00005  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00006  * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00007 */
00008
00009 #include "component.hxx"
00010 #include "..\include\pipe.hxx"
00011 #include <conio.h>
00012 #include <stdio.h>
00013 #include <tchar.h>
00014
00015 #define PIPE_SIZE 1000;
00016
00017
00018 /******************************************
00019 * Class CSimpleClass Implementation
00020 *******************************************/
00021
00022 CSimpleClass::CSimpleClass()
00023    : m_cRef(1)
00024 {
00025    CoAddRefServerProcess();
00026 };
00027
00028 CSimpleClass::~CSimpleClass()
00029 {
00030    if (0==CoReleaseServerProcess())
00031        PostQuitMessage(0);
00032 };
00033
00034 // IUnknown implementation
00035
00036 STDMETHODIMP CSimpleClass::QueryInterface(REFIID riid, void** ppv)
00037 {
00038    *ppv = NULL;
00039
00040    if (IsEqualIID(IID_IUnknown, riid)) {
00041       *ppv = static_cast<ISimpleInterface*>(this);
00042    }
00043    else if (IsEqualIID(IID_ISimpleInterface, riid)) {
00044          *ppv = static_cast<ISimpleInterface*>(this);
00045    }
00046    else
00047    {
00048       return E_NOINTERFACE;
00049    }
00050
00051    reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00052    return S_OK;
00053
00054 };
00055
00056 STDMETHODIMP_(ULONG) CSimpleClass::AddRef()
00057 {
00058    InterlockedIncrement((LONG *)&m_cRef);
00059    return m_cRef;
00060 };
00061
00062 STDMETHODIMP_(ULONG) CSimpleClass::Release()
00063 {
00064    ULONG cLockedRefs = InterlockedDecrement((LONG *)&m_cRef);
00065    if( cLockedRefs == 0 )
00066    {
00067       delete this;
00068       return 0;
00069    }
00070    else return cLockedRefs;
00071 };
00072
00073 /**********************************************************
00074 * InPipeSample implementation : PIPE_AS_IN_PARAMETER option
00075 **********************************************************/
00076
00077 STDMETHODIMP CSimpleClass::InPipeSample(IPipeLong *pInPipe)
00078 {
00079    HRESULT hr=S_OK;
00080    LONG* buffer1=NULL;
00081    LONG* buffer2=NULL;
00082    ULONG lPulled=0;
00083
00084    AllocConsole();
00085    HANDLE hConsoleOutput;
00086    hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
00087    const TCHAR* lpMessage = __TEXT("\n***** SERVER SIDE CONSOLE *****\n \n");
00088    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00089
00090    /*******************************************
00091    ** DEMONSTRATING MULTIPLE SEQUENCES OF PULLS
00092    *******************************************/
00093
00094    lpMessage = __TEXT("DEMONSTRATING MULTIPLE SEQUENCES OF PULLS \n\n");
00095    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00096
00097    /*
00098    ** PULL one sequence from the InPipe
00099    */
00100
00101    lpMessage = __TEXT("\tOPERATION: PULLing one sequence from the InPipe  \n");
00102    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00103
00104    buffer1 = new LONG[2000 + 1];
00105    lPulled=0;
00106    hr=GenericPull(pInPipe, buffer1, &lPulled, 0);
00107    if (FAILED(hr) || (2000 != lPulled))
00108    {
00109       MessageBox(NULL, TEXT("PULL FAILED ON INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00110       return E_FAIL;
00111    }
00112    else
00113    {
00114       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00115       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00116    }
00117
00118    /*
00119    ** PULL another sequence from the InPipe
00120    */
00121
00122    lpMessage = __TEXT("\tOPERATION: PULLing second sequence from the InPipe  \n");
00123    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00124
00125    lPulled=0;
00126    hr=GenericPull(pInPipe, buffer1, &lPulled, 0);
00127    if (FAILED(hr) || (2000 != lPulled))
00128    {
00129       MessageBox(NULL, TEXT("PULL FAILED ON INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00130       return E_FAIL;
00131    }
00132    else
00133    {
00134       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00135       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00136    }
00137
00138    lpMessage = __TEXT("NOTE: Multiple sequences of PULLs are allowed using DCOM Pipes, each separated by a zero count PULL. \n \n");
00139    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00140
00141    lpMessage = __TEXT("Press any key to continue..\n\n");
00142    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00143    _getch();
00144
00145    /********************************************
00146    ** DEMONSTRATING MULTIPLE SEQUENCES OF PUSHES
00147    ********************************************/
00148
00149    lpMessage = __TEXT("DEMONSTRATING MULTIPLE SEQUENCES OF PUSHES \n\n");
00150    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00151    /*
00152    ** PUSH 500 elements to the pipe.
00153    */
00154
00155    lpMessage = __TEXT("\tOPERATION: PUSHing 500 elements to the InPipe  \n");
00156    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00157    buffer2 = new LONG[2000 + 1];
00158
00159    hr=GenericPush(pInPipe, buffer2, 500);
00160    if (FAILED(hr))
00161    {
00162       MessageBox(NULL, TEXT("PUSH FAILED ON INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00163       return E_FAIL;
00164    }
00165    else
00166    {
00167       lpMessage = __TEXT("\tRESULT: success !\n \n");
00168       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00169    }
00170
00171    /*
00172    ** Push 0 count to close this sequence
00173    */
00174    hr=GenericPush(pInPipe, buffer2, 0);
00175    if (FAILED(hr)) { return E_FAIL; }
00176
00177    /*
00178    ** PUSH another 500 elements to the pipe.
00179    */
00180    lpMessage = __TEXT("\tOPERATION: PUSHing another sequence of 500 elements to the InPipe  \n");
00181    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00182
00183    hr=GenericPush(pInPipe, buffer2, 500);
00184    if (FAILED(hr))
00185    {
00186       MessageBox(NULL, TEXT("PUSH FAILED ON INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00187       return E_FAIL;
00188    }
00189    else
00190    {
00191       lpMessage = __TEXT("\tRESULT: success !\n \n");
00192       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00193    }
00194
00195    /*
00196    ** Push 0 count to close this second sequence
00197    */
00198
00199    hr=GenericPush(pInPipe, buffer2, 0);
00200    if (FAILED(hr)) { return E_FAIL; }
00201
00202    lpMessage = __TEXT("NOTE: Multiple sequences of PUSHes are allowed using DCOM Pipes, each separated by a zero count PUSH. \n \n");
00203    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00204
00205    lpMessage = __TEXT("Press any key to continue..\n \n");
00206    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00207    _getch();
00208
00209    /*******************************************
00210    ** DEMONSTRATING MIX OF PULL AND PUSH
00211    *******************************************/
00212
00213    lpMessage = __TEXT("DEMONSTRATING MIXING OF PULL AND PUSH \n\n");
00214    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00215    /*
00216    ** Pull 1000 elements from the InPipe.
00217    */
00218
00219    lpMessage = __TEXT("\tOPERATION: PULLing 1000 elements from the InPipe  \n");
00220    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00221
00222    lPulled=0;
00223    hr=GenericPull(pInPipe, buffer1, &lPulled, 1000);
00224    if (FAILED(hr))
00225    {
00226       MessageBox(NULL, TEXT("PULL FAILED ON INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00227       return E_FAIL;
00228    }
00229    else
00230    {
00231       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00232       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00233    }
00234
00235
00236    /*
00237    ** PUSH 500 elements to the pipe. Notice how Pull and Push
00238    ** operations can be mixed on the same pipe.
00239    */
00240
00241    lpMessage = __TEXT("\tOPERATION: PUSHing 500 elements to the InPipe  \n");
00242    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00243
00244    hr=GenericPush(pInPipe, buffer2, 500);
00245    if (FAILED(hr))
00246    {
00247       MessageBox(NULL, TEXT("PUSH FAILED ON INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00248       return E_FAIL;
00249    }
00250    else
00251    {
00252       lpMessage = __TEXT("\tRESULT: success !\n \n");
00253       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00254    }
00255
00256    /*
00257    ** Push 0 count to close this sequence
00258    */
00259    hr=GenericPush(pInPipe, buffer2, 0);
00260    if (FAILED(hr)) { return E_FAIL; }
00261
00262
00263    /*
00264    ** Drain in the rest of the InPipe.
00265    */
00266    lpMessage = __TEXT("\tOPERATION: PULLing all the remaining elements from the InPipe  \n");
00267    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00268
00269    hr=GenericPull(pInPipe, buffer1, &lPulled, 2000);
00270    if (FAILED(hr))
00271    {
00272       MessageBox(NULL, TEXT("PULL FAILED ON INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00273       return E_FAIL;
00274    }
00275    else
00276    {
00277       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00278       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00279    }
00280
00281    lpMessage = __TEXT("NOTE: PULLs and PUSHes can be mixed on the same DCOM Pipe. \n \n");
00282    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00283
00284    lpMessage = __TEXT("Press any key to terminate the server console.. \n\n");
00285    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00286    _getch();
00287    FreeConsole();
00288    return S_OK;
00289 };
00290
00291
00292 /************************************************************
00293 * OutPipeSample implementation : PIPE_AS_OUT_PARAMETER option
00294 ************************************************************/
00295
00296 STDMETHODIMP CSimpleClass::OutPipeSample(IPipeLong **ppOutPipe)
00297 {
00298    // Create a pipe on the server side
00299    *ppOutPipe=new CSamplePipe();
00300    if (NULL == *ppOutPipe)
00301    return E_OUTOFMEMORY;
00302    (*ppOutPipe)->AddRef();
00303    return S_OK;
00304 };
00305
00306 /******************************************************************
00307 * InOutPipeSample implementation : PIPE_AS_IN_OUT_PARAMETER option
00308 *****************************************************************/
00309
00310 STDMETHODIMP CSimpleClass::InOutPipeSample(IPipeLong **ppInOutPipe)
00311 {
00312    HRESULT hr=S_OK;
00313    ULONG lPulled=0;
00314
00315    AllocConsole();
00316    HANDLE hConsoleOutput;
00317    hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
00318    const TCHAR* lpMessage = __TEXT("\n***** SERVER SIDE CONSOLE *****\n \n");
00319    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00320
00321    /*******************************************
00322    ** DEMONSTRATING USE OF INOUTPIPE
00323    *******************************************/
00324
00325    lpMessage = __TEXT("DEMONSTRATING USE OF [IN,OUT] PIPE \n\n");
00326    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00327
00328    /*
00329    ** PULL one sequence from the InPipe
00330    */
00331
00332    lpMessage = __TEXT("\tOPERATION: PULLing one sequence from the InOutPipe  \n");
00333    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00334
00335    LONG *buffer1 = new LONG[2000 + 1];
00336
00337    hr=GenericPull(*ppInOutPipe, buffer1, &lPulled, 0);
00338    if (FAILED(hr) || (2000 != lPulled))
00339    {
00340       MessageBox(NULL, TEXT("PULL FAILED ON INOUTPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00341       return E_FAIL;
00342    }
00343    else
00344    {
00345       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00346       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00347    }
00348
00349    (*ppInOutPipe)->Release();
00350
00351    // Create a pipe on the server side
00352
00353    lpMessage = __TEXT("\tOPERATION: Creating a pipe on the server  \n");
00354    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00355    *ppInOutPipe = new CSamplePipe();
00356    if (NULL == *ppInOutPipe)
00357    {
00358       MessageBox(NULL, TEXT("UNABLE TO CREATE PIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00359       return E_OUTOFMEMORY;
00360    }
00361    else
00362    {
00363       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00364       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00365    }
00366    (*ppInOutPipe)->AddRef();
00367
00368     lpMessage = __TEXT("Press any key to return to the client..");
00369    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00370    _getch();
00371    FreeConsole();
00372    return S_OK;
00373 };
00374
00375 /******************************************************************
00376 * InInOutPipesSample implementation : PIPES_AS_IN_IN_OUT_PARAMETERS
00377 *****************************************************************/
00378
00379 STDMETHODIMP CSimpleClass::InInOutPipesSample(IPipeLong *pInPipe1, IPipeLong *pInPipe2,
00380                                    IPipeLong **ppOutPipe)
00381 {
00382    HRESULT hr=S_OK;
00383    ULONG lPulled=0;
00384
00385    AllocConsole();
00386    HANDLE hConsoleOutput;
00387    hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
00388    const TCHAR* lpMessage = __TEXT("\n***** SERVER SIDE CONSOLE *****\n \n");
00389    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00390
00391    /*
00392    ** PROCESS THE SECOND [IN] PARAMETER FIRST
00393    ** DCE Model wouldn't allow to use second 'in' pipe without
00394    ** using the first 'in' pipe.
00395    */
00396
00397    lpMessage = __TEXT("DEMONSTRATING HOW ORDER OF PROCESSING DCOM PIPES IS NOT IMPORTANT \n\n");
00398    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00399
00400    lpMessage = __TEXT("\tOPERATION: PULLing one sequence from the second InPipe  \n");
00401    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00402
00403    LONG *buffer1 = new LONG[2000 + 1];
00404    lPulled=0;
00405    hr=GenericPull(pInPipe2, buffer1, &lPulled, 0);
00406    if (FAILED(hr) || (2000 != lPulled))
00407    {
00408       MessageBox(NULL, TEXT("PULL FAILED ON SECOND INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00409       return E_FAIL;
00410    }
00411    else
00412    {
00413       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00414       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00415    }
00416
00417    /*
00418    ** PUSH 500 elements to the 'out' pipe.
00419    */
00420
00421    lpMessage = __TEXT("\tOPERATION: PUSHing one sequence to the OutPipe  \n");
00422    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00423
00424    // Create an Out pipe on the server side
00425    *ppOutPipe=new CSamplePipe();
00426    (*ppOutPipe)->AddRef();
00427
00428    LONG *buffer2 = new LONG[2000 + 1];
00429
00430    hr=GenericPush(*ppOutPipe, buffer2, 500);
00431    if (FAILED(hr))
00432    {
00433       MessageBox(NULL, TEXT("PUSH FAILED ON OUTPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00434       return E_FAIL;
00435    }
00436    hr=GenericPush(*ppOutPipe, buffer2, 0);
00437    if (FAILED(hr))
00438    {
00439       MessageBox(NULL, TEXT("PUSH FAILED ON OUTPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00440       return E_FAIL;
00441    }
00442    else
00443    {
00444       lpMessage = __TEXT("\tRESULT: success !\n \n");
00445       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00446    }
00447
00448
00449    /*
00450    ** Drain in (PULL) the first 'in' parameter.
00451    */
00452
00453    lpMessage = __TEXT("\tOPERATION: PULLing one sequence from the first InPipe  \n");
00454    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00455
00456    lPulled=0;
00457    hr=GenericPull(pInPipe1, buffer1, &lPulled, 0);
00458    if (FAILED(hr) || (2000 != lPulled))
00459    {
00460       MessageBox(NULL, TEXT("PULL FAILED ON FIRST INPIPE"), TEXT("SERVER: ERROR"), MB_SETFOREGROUND);
00461       return E_FAIL;
00462    }
00463    else
00464    {
00465       lpMessage = __TEXT("\tRESULT: success ! \n \n");
00466       WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00467    }
00468
00469    lpMessage = __TEXT("NOTE: Using DCOM Pipes, it possible to process the parameters in any order. \n \n");
00470    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00471
00472    lpMessage = __TEXT("Press any key to return to the client..\n\n");
00473    WriteConsole(hConsoleOutput, lpMessage, _tcslen(lpMessage), 0, NULL);
00474    _getch();
00475    FreeConsole();
00476    return S_OK;
00477 }
00478
00479
00480 /***********************************
00481 * Class Factory Implementation
00482 ***********************************/
00483
00484 CFactory::CFactory()
00485    : m_cRef(1)
00486 {
00487 };
00488
00489 CFactory::~CFactory()
00490 {
00491 };
00492
00493 STDMETHODIMP CFactory::QueryInterface(REFIID riid, void** ppv)
00494 {
00495    *ppv = NULL;
00496
00497    if (riid == IID_IUnknown) {
00498       *ppv = static_cast<IClassFactory*>(this);
00499    }
00500    else if (riid == IID_IClassFactory) {
00501          *ppv = static_cast<IClassFactory*>(this);
00502    }
00503    else
00504    {
00505       return E_NOINTERFACE;
00506    }
00507
00508    reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00509    return S_OK;
00510
00511 };
00512
00513 STDMETHODIMP_(ULONG) CFactory::AddRef()
00514 {
00515    InterlockedIncrement((LONG *)&m_cRef);
00516    return m_cRef;
00517 };
00518
00519 STDMETHODIMP_(ULONG) CFactory::Release()
00520 {
00521    ULONG cLockedRefs = InterlockedDecrement((LONG *)&m_cRef);
00522
00523    if( cLockedRefs == 0 )
00524    {
00525       delete this;
00526       return 0;
00527    }
00528    return cLockedRefs;
00529 };
00530
00531 STDMETHODIMP CFactory::CreateInstance(IUnknown* pUnkwnOuter, REFIID riid, void** ppv)
00532 {
00533    HRESULT hr;
00534    CSimpleClass* pObject = new CSimpleClass();
00535
00536    hr=pObject->QueryInterface(riid, ppv);
00537    if (FAILED(hr)) {
00538       delete pObject;
00539       return hr;
00540    }
00541    pObject->Release();
00542    return S_OK;
00543 };
00544
00545 STDMETHODIMP CFactory::LockServer(BOOL bLock)
00546 {
00547
00548    if (bLock)
00549   CoAddRefServerProcess();
00550    else
00551    {
00552         if (0==CoReleaseServerProcess())
00553   {
00554       //PostThreadMessage(GetCurrentThreadId(), WM_QUIT, 0, 0);
00555       PostQuitMessage(0);
00556   }
00557    }
00558    return S_OK;
00559 };
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDlgIADsOpenDSObject Member List

This is the complete list of members for CDlgIADsOpenDSObject, including all inherited members.
CDlgIADsOpenDSObject(LPUNKNOWN pUnk, LPUNKNOWN *ppNew, CWnd *pParent=NULL) | CDlgIADsOpenDSObject |
DoDataExchange(CDataExchange *pDX) | CDlgIADsOpenDSObject | [protected, virtual]
IDD enum value | CDlgIADsOpenDSObject |
m_bClearText | CDlgIADsOpenDSObject |
m_bEncrypt | CDlgIADsOpenDSObject |
m_bFastBind | CDlgIADsOpenDSObject |
m_bNoAuthentication | CDlgIADsOpenDSObject |
m_bPrompt | CDlgIADsOpenDSObject |
m_bReadOnly | CDlgIADsOpenDSObject |
m_bSealing | CDlgIADsOpenDSObject |
m_bSecured | CDlgIADsOpenDSObject |
m_bSigning | CDlgIADsOpenDSObject |
m_pOpenDS | CDlgIADsOpenDSObject | [protected]
m_ppUnk | CDlgIADsOpenDSObject | [protected]
m_sADsPath | CDlgIADsOpenDSObject |
m_sPassword | CDlgIADsOpenDSObject |
m_sUserName | CDlgIADsOpenDSObject |
OnChangeADsPath() | CDlgIADsOpenDSObject | [protected]
OnChangeUsername() | CDlgIADsOpenDSObject | [protected]
OnInitDialog() | CDlgIADsOpenDSObject | [protected, virtual]
OnOK() | CDlgIADsOpenDSObject | [protected, virtual]
~CDlgIADsOpenDSObject() | CDlgIADsOpenDSObject |
Generated on Wed Nov 13 2024 16:56:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFileViewer Member List

This is the complete list of members for CFileViewer, including all inherited members.
CFileViewer(LPUNKNOWN, HINSTANCE, PFNDESTROYED) | CFileViewer |
ChildrenResize(void) | CFileViewer | [protected]
CImpIFileViewer class | CFileViewer | [friend]
CImpIPersistFile class | CFileViewer | [friend]
DropFiles(HDROP) | CFileViewer | [protected]
FileLoad(void) | CFileViewer | [protected]
FileShow(LPFVSHOWINFO pvsi) | CFileViewer |
FileShowInit(LPFILEVIEWERSITE lpfsi) | CFileViewer |
FileViewerFrameProc(HWND, UINT, WPARAM, LPARAM) | CFileViewer | [friend]
FInitFrameControls(void) | CFileViewer | [protected]
FontChange(VIEWFONTOPTION) | CFileViewer | [protected]
FOpenAs(void) | CFileViewer | [protected]
Init(void) | CFileViewer |
m_clsID | CFileViewer | [protected]
m_cRef | CFileViewer | [protected]
m_cyPPI | CFileViewer | [protected]
m_cyStatus | CFileViewer | [protected]
m_cyTools | CFileViewer | [protected]
m_fClassReg | CFileViewer | [protected]
m_fLoadCalled | CFileViewer | [protected]
m_fPostQuitMsg | CFileViewer | [protected]
m_fShowInit | CFileViewer | [protected]
m_fStatusVisible | CFileViewer | [protected]
m_fToolsVisible | CFileViewer | [protected]
m_grfMode | CFileViewer | [protected]
m_hAccel | CFileViewer | [protected]
m_hFont | CFileViewer | [protected]
m_hInst | CFileViewer | [protected]
m_hMemText | CFileViewer | [protected]
m_hWnd | CFileViewer | [protected]
m_hWndOld | CFileViewer | [protected]
m_hWndStatus | CFileViewer | [protected]
m_hWndToolbar | CFileViewer | [protected]
m_hWndViewport | CFileViewer | [protected]
m_lpfsi | CFileViewer | [protected]
m_pfnDestroy | CFileViewer | [protected]
m_pIFileViewer | CFileViewer | [protected]
m_pIPersistFile | CFileViewer | [protected]
m_pSH | CFileViewer | [protected]
m_pST | CFileViewer | [protected]
m_pszPath | CFileViewer | [protected]
m_pUnkOuter | CFileViewer | [protected]
m_pvsi | CFileViewer | [protected]
m_xPos | CFileViewer | [protected]
m_yPos | CFileViewer | [protected]
MemAlloc(ULONG) | CFileViewer |
MemFree(LPVOID) | CFileViewer |
OnCommand(WORD, WORD, HWND) | CFileViewer | [protected]
PrintTo(LPSTR, BOOL) | CFileViewer |
PszToolTip(UINT) | CFileViewer | [protected]
QueryInterface(REFIID, PPVOID) | CFileViewer |
ReplaceWindowModeChange(void) | CFileViewer | [protected]
STDMETHODIMP_(ULONG) AddRef(void) | CFileViewer |
STDMETHODIMP_(ULONG) Release(void) | CFileViewer |
String(UINT) | CFileViewer |
ViewportResize(void) | CFileViewer | [protected]
ViewportScrollSet(void) | CFileViewer | [protected]
ViewportWndProc(HWND, UINT, WPARAM, LPARAM) | CFileViewer | [friend]
~CFileViewer(void) | CFileViewer |
Generated on Wed Nov 13 2024 16:56:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropertiesBase Member List

This is the complete list of members for CPropertiesBase, including all inherited members.
Abort(HCHAPTER hChapter, DBASYNCHOP eOperation) | CAsynchBase | [virtual]
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CPropertiesBase | [virtual]
AutoRelease() | CPropertiesBase | [virtual]
CAsynchBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CAsynchBase |
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CPropertiesBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CPropertiesBase |
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface()=0 | CBase | [pure virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CPropertiesBase | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage()=0 | CBase | [pure virtual]
GetObjectMenu()=0 | CBase | [pure virtual]
GetObjectName()=0 | CBase | [pure virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase, LPOLESTR *ppwszStatusText) | CAsynchBase | [virtual]
Initialize() | CAsynchBase | [virtual]
IsInitialized() | CAsynchBase | [inline, virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_dwCookieAsynchNotify | CAsynchBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_fInitialized | CAsynchBase |
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIConnectionPointContainer | CContainerBase |
m_pIDBAsynchStatus | CAsynchBase |
m_pIDBInitialize | CAsynchBase |
m_pIDBProperties | CPropertiesBase |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
SetProperties(ULONG cPropSets, DBPROPSET *rgPropSets) | CPropertiesBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
Uninitialize() | CAsynchBase | [virtual]
~CAsynchBase() | CAsynchBase | [virtual]
~CBase() | CBase | [virtual]
~CContainerBase() | CContainerBase | [virtual]
~CPropertiesBase() | CPropertiesBase | [virtual]
Generated on Wed Nov 13 2024 16:57:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SupportOptList Member List

This is the complete list of members for SupportOptList, including all inherited members.
Option | SupportOptList
Support | SupportOptList
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagITEMCONFIGSETTINGSLPARAM Member List

This is the complete list of members for _tagITEMCONFIGSETTINGSLPARAM, including all inherited members.
fDirty | _tagITEMCONFIGSETTINGSLPARAM
fNewItem | _tagITEMCONFIGSETTINGSLPARAM
hr | _tagITEMCONFIGSETTINGSLPARAM
ItemID | _tagITEMCONFIGSETTINGSLPARAM
pItemSettings | _tagITEMCONFIGSETTINGSLPARAM
pSettings | _tagITEMCONFIGSETTINGSLPARAM
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

FILEDEX Member List

This is the complete list of members for FILEDEX, including all inherited members.
bStatus | FILEDEX
ulOffset | FILEDEX
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/accessor.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

accessor.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991-1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module ACCESSOR.CPP | CImpIAccessor object implementation
00008 //
00009 //
00010 //
00011
00012 // Includes ------------------------------------------------------------------
00013
00014 #include "headers.h"
00015
00016 // Code ----------------------------------------------------------------------
00017
00018 // CImpIAccessor::FInit--------------------------------------------------------------
00019 //
00020 // @mfunc Initialize the Accessor implementation object.
00021 //
00022 // @rdesc Did the Initialization Succeed
00023 //    @flag S_OK      | initialization succeeded,
00024 //    @flag E_OUTOFMEMORY | initialization failed because of memory allocation problem,
00025 //-----------------------------------------------------------------------------------
00026
00027 STDMETHODIMP  CImpIAccessor::FInit
00028   (
00029   BOOL  fUnderRowset    //@parm IN | Is aggregated within Rowset?
00030   )
00031 {
00032   // Create the Extended Buffer array.
00033     // This is an array of pointers to malloc'd accessors.
00034     m_pextbufferAccessor = (LPEXTBUFFER) new CExtBuffer;
00035     if (m_pextbufferAccessor == NULL || FAILED( m_pextbufferAccessor->FInit( 1, sizeof( PACCESSOR ), g_dwPageSize )))
00036         return ResultFromScode( E_OUTOFMEMORY );
00037
00038   // If aggregated under Rowset do the following:
00039   if(fUnderRowset)
00040   {
00041     // For efficiency reasons put a copy of the accessors buffer
00042     // directly on the CRowset object.
00043     ((CRowset *)m_pObj)->m_pextbufferAccessor = m_pextbufferAccessor;
00044
00045     HRESULT     hr;
00046     CCommand      *pCCommand;
00047     CImpIAccessor *pIAccessorCommand;
00048
00049     // See if there are any accessors created on the Command object, and if so
00050     // copy their handles so they can be used on the Rowset.
00051     pCCommand = ((CRowset *)m_pObj)->m_pCreator;
00052     if(pCCommand)
00053     {
00054       if(SUCCEEDED(pCCommand->QueryInterface(IID_IAccessor, (void **)&pIAccessorCommand)) && pIAccessorCommand)
00055       {
00056         // Copy handles.
00057         hr = pIAccessorCommand->CopyAccessors(m_pextbufferAccessor);
00058         pIAccessorCommand->Release();
00059         if(FAILED(hr))
00060           return hr;
00061       }
00062     }
00063   }
00064
00065   return NOERROR;
00066 }
00067
00068 // IAccessor specific methods
00069
00070 // CImpIAccessor::AddRefAccessor -----------------------------------------
00071 //
00072 // @mfunc Adds a reference count to an existing accessor
00073 //
00074 // @rdesc HRESULT
00075 //      @flag S_OK                      | Method Succeeded
00076 //      @flag E_FAIL                    | Provider specific Error
00077 //
00078 STDMETHODIMP CImpIAccessor::AddRefAccessor
00079     (
00080   HACCESSOR hAccessor,    //@parm IN | Accessor Handle
00081   DBREFCOUNT* pcRefCounts   //@parm OUT | Reference Count
00082     )
00083 {
00084     // Retrieve our accessor structure from the client's hAccessor,
00085     // free it, then mark accessor ptr as unused.
00086     // We do not re-use accessor handles.  This way, we hope
00087     // to catch more client errors.  (Also, ExtBuffer doesn't
00088     // maintain a free list, so it doesn't know how to.)
00089
00090     PACCESSOR   pAccessor;
00091
00092     if( pcRefCounts )
00093     *pcRefCounts = 0;
00094
00095   m_pextbufferAccessor->GetItemOfExtBuffer(hAccessor, &pAccessor);
00096     if( !pAccessor )
00097         return DB_E_BADACCESSORHANDLE;
00098
00099   InterlockedIncrement((LONG*)&(pAccessor->cRef));
00100
00101   if( pcRefCounts )
00102     *pcRefCounts = (DBREFCOUNT)(pAccessor->cRef);
00103
00104   return ResultFromScode( S_OK );
00105 }
00106
00107
00108 // CImpIAccessor::CreateAccessor -----------------------------------------
00109 //
00110 // @mfunc Creates a set of bindings that can be used to send data
00111 // to or retrieve data from the data cache.
00112 //
00113 // @rdesc HRESULT
00114 //      @flag S_OK                      | Method Succeeded
00115 //      @flag E_FAIL                    | Provider specific Error
00116 //      @flag E_INVALIDARG              | pHAccessor was NULL, dwAccessorFlags was
00117 //                                        invalid, or cBindings was not 0 and
00118 //                                        rgBindings was NULL
00119 //      @flag E_OUTOFMEMORY             | Out of Memory
00120 //      @flag DB_E_ERRORSOCCURRED   | dwBindPart in an rgBindings element was invalid, OR
00121 //                      | Column number specified was out of range, OR
00122 //                    | Requested coercion is not supported.
00123 //      @flag OTHER                     | Other HRESULTs returned by called functions
00124 //
00125 STDMETHODIMP CImpIAccessor::CreateAccessor
00126     (
00127     DBACCESSORFLAGS dwAccessorFlags,
00128     DBCOUNTITEM     cBindings,      //@parm IN | Number of Bindings
00129     const DBBINDING rgBindings[],   //@parm IN | Array of DBBINDINGS
00130     DBLENGTH        cbRowSize,      //@parm IN | Number of bytes in consumer's buffer
00131     HACCESSOR*      phAccessor,     //@parm OUT | Accessor Handle
00132   DBBINDSTATUS  rgStatus[]    //@parm OUT | Binding status
00133     )
00134 {
00135     PACCESSOR   pAccessor;
00136     HACCESSOR   hAccessor;
00137     DBCOUNTITEM cBind;
00138     DBORDINAL   cCols;
00139     HRESULT     hr;
00140
00141
00142     // Check Parameters
00143     if( (cBindings && !rgBindings) || (phAccessor == NULL) )
00144         return ResultFromScode( E_INVALIDARG );
00145
00146     // init out params
00147     *phAccessor = NULL;
00148
00149   // Check if we have a correct accessor type
00150     if ( dwAccessorFlags & DBACCESSOR_PASSBYREF )
00151         return ResultFromScode( DB_E_BYREFACCESSORNOTSUPPORTED );
00152
00153   // Only allow DBACCESSOR_ROWDATA and DBACCESSOR_OPTIMIZED
00154     if ( (dwAccessorFlags & ~DBACCESSOR_OPTIMIZED ) != DBACCESSOR_ROWDATA )
00155         return ResultFromScode( DB_E_BADACCESSORFLAGS );
00156
00157   // Check for NULL Accessor on the Command Object
00158   // Also check for NULL Accessor on a read only rowset
00159   if( (m_pObj->GetBaseObjectType() == BOT_COMMAND && !cBindings) ||
00160     (m_pObj->GetBaseObjectType() == BOT_ROWSET  && !cBindings && !((CRowset *)m_pObj)->SupportIRowsetChange()) )
00161     return ResultFromScode( DB_E_NULLACCESSORNOTSUPPORTED );
00162
00163   // Check for Optimized Accessor on the Rowset Object after Fetch
00164   if( (dwAccessorFlags & DBACCESSOR_OPTIMIZED) &&
00165     m_pObj->GetBaseObjectType() == BOT_ROWSET && ((CRowset *)m_pObj)->m_cRows )
00166     return ResultFromScode( DB_E_BADACCESSORFLAGS );
00167
00168   // Initialize the status array to DBBINDSTATUS_OK.
00169   // 64 bit TODO
00170   if ( rgStatus )
00171     memset(rgStatus, 0x00, (ULONG)(cBindings * sizeof(DBBINDSTATUS)));
00172
00173     // Check on the bindings the user gave us.
00174     for (cBind=0, hr=NOERROR; cBind < cBindings; cBind++)
00175     {
00176     // other binding problems forbidden by OLE-DB
00177         const DBTYPE currType = rgBindings[cBind].wType;
00178         const DBTYPE currTypePtr = currType &
00179                   (DBTYPE_BYREF|DBTYPE_ARRAY|DBTYPE_VECTOR);
00180     const DBTYPE currTypeBase = currType &
00181               ~(DBTYPE_BYREF|DBTYPE_ARRAY|DBTYPE_VECTOR);
00182         const DWORD  currFlags = rgBindings[cBind].dwFlags;
00183
00184         cCols = rgBindings[cBind].iOrdinal;
00185
00186     // Check for a Bad Ordinal
00187     if( m_pObj->GetBaseObjectType() == BOT_ROWSET )
00188     {
00189       // make sure column number is in range
00190       if ( !(0 < cCols && cCols <= ((CRowset *) m_pObj)->m_cCols) )
00191       {
00192         // Set Bind status to DBBINDSTATUS_BADORDINAL
00193         hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00194         if ( rgStatus )
00195           rgStatus[cBind] = DBBINDSTATUS_BADORDINAL;
00196         continue;
00197       }
00198     }
00199
00200     // At least one of these valid parts has to be set. In SetData I assume it is the case.
00201         if ( !(rgBindings[cBind].dwPart & (DBPART_VALUE|DBPART_LENGTH|DBPART_STATUS)) )
00202     {
00203       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00204             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00205       if ( rgStatus )
00206         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00207         }
00208
00209     // dwPart is something other than value, length, or status
00210     else if ( (rgBindings[cBind].dwPart & ~(DBPART_VALUE|DBPART_LENGTH|DBPART_STATUS)) )
00211     {
00212       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00213             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00214       if ( rgStatus )
00215         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00216         }
00217
00218     // wType was DBTYPE_EMPTY or DBTYPE_NULL
00219     else if ( (currType==DBTYPE_EMPTY || currType==DBTYPE_NULL) )
00220     {
00221       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00222             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00223       if ( rgStatus )
00224         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00225         }
00226
00227     // wType was DBTYPE_BYREF or'ed with DBTYPE_EMPTY, NULL, or RESERVED
00228     else if ( ((currType & DBTYPE_BYREF) &&
00229         (currTypeBase == DBTYPE_EMPTY || currTypeBase == DBTYPE_NULL ||
00230          currType & DBTYPE_RESERVED)) )
00231     {
00232       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00233             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00234       if ( rgStatus )
00235         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00236         }
00237
00238     // dwFlags was DBBINDFLAG_HTML and the type was not a String
00239     else if ( currFlags && (currFlags != DBBINDFLAG_HTML ||
00240          (currTypeBase != DBTYPE_STR  &&
00241           currTypeBase != DBTYPE_WSTR &&
00242           currTypeBase != DBTYPE_BSTR)) )
00243     {
00244       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00245             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00246       if ( rgStatus )
00247         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00248         }
00249
00250     // wType was used with more than one type indicators
00251     else if ( !(currTypePtr == 0 || currTypePtr == DBTYPE_BYREF ||
00252         currTypePtr == DBTYPE_ARRAY || currTypePtr == DBTYPE_VECTOR) )
00253     {
00254       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00255             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00256       if ( rgStatus )
00257         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00258         }
00259
00260     // wType was a non pointer type with provider owned memory
00261     else if ( !currTypePtr &&
00262        rgBindings[cBind].dwMemOwner==DBMEMOWNER_PROVIDEROWNED )
00263     {
00264       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00265             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00266       if ( rgStatus )
00267         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00268         }
00269
00270     // we only support client owned memory
00271     else if ( rgBindings[cBind].dwMemOwner != DBMEMOWNER_CLIENTOWNED )
00272     {
00273       // Set Bind status to DBBINDSTATUS_BADBINDINFO
00274             hr = ResultFromScode( DB_E_ERRORSOCCURRED );
00275       if ( rgStatus )
00276         rgStatus[cBind] = DBBINDSTATUS_BADBINDINFO;
00277         }
00278     }
00279
00280     // Any errors amongst those checks?
00281     if (hr != NOERROR)
00282     {
00283         return hr;
00284     }
00285
00286     // Make a copy of the client's binding array, and the type of binding.
00287   // 64 bit TODO
00288     pAccessor = (ACCESSOR *) new BYTE[sizeof( ACCESSOR ) + ((ULONG)cBindings - 1) *sizeof( DBBINDING )];
00289     if ( pAccessor == NULL )
00290         return ResultFromScode( E_OUTOFMEMORY );
00291
00292     // We store a ptr to the newly created variable-sized ACCESSOR.
00293     // We have an array of ptrs (to ACCESSOR's).
00294     // The handle is the index into the array of ptrs.
00295     // The InsertIntoExtBuffer function appends to the end of the array.
00296     assert( m_pextbufferAccessor );
00297     hr = m_pextbufferAccessor->InsertIntoExtBuffer(&pAccessor, hAccessor);
00298     if ( FAILED( hr ) )
00299   {
00300         SAFE_DELETE( pAccessor );
00301         return ResultFromScode( E_OUTOFMEMORY );
00302   }
00303     assert( hAccessor );
00304
00305     // Copy the client's bindings into the ACCESSOR.
00306     pAccessor->dwAccessorFlags  = dwAccessorFlags;
00307     pAccessor->cBindings    = cBindings;
00308     pAccessor->cRef       = 1;    // Establish Reference count.
00309   // 64 bit TODO
00310   memcpy( &(pAccessor->rgBindings[0]), &rgBindings[0], (ULONG)cBindings*sizeof( DBBINDING ));
00311
00312     // fill out-param and return
00313     *phAccessor = hAccessor;
00314     return ResultFromScode( S_OK );
00315 }
00316
00317
00318 // CImpIAccessor::GetBindings --------------------------------------------------
00319 //
00320 // @mfunc Returns the bindings in an accessor
00321 //
00322 // @rdesc HRESULT
00323 //      @flag S_OK                      | Method Succeeded
00324 //      @flag E_INVALIDARG              | pdwAccessorFlags/pcBinding/prgBinding were NULL
00325 //      @flag E_OUTOFMEMORY             | Out of Memory
00326 //      @flag DB_E_BADACCESSORHANDLE    | Invalid Accessor given
00327 //
00328 STDMETHODIMP CImpIAccessor::GetBindings
00329     (
00330     HACCESSOR        hAccessor,         //@parm IN | Accessor Handle
00331     DBACCESSORFLAGS* pdwAccessorFlags,  //@parm OUT | Binding Type flag
00332     DBCOUNTITEM*     pcBindings,        //@parm OUT | Number of Bindings returned
00333     DBBINDING**      prgBindings        //@parm OUT | Bindings
00334     )
00335 {
00336     // Retrieve our accessor structure from the client's hAccessor,
00337     // make a copy of the bindings for the user, then done.
00338     PACCESSOR   pAccessor;
00339     ULONG       cBindingSize;
00340
00341     // init out-params
00342   if( pdwAccessorFlags )
00343     *pdwAccessorFlags = 0;
00344   if( pcBindings )
00345     *pcBindings = 0;
00346   if ( prgBindings )
00347     *prgBindings = NULL;
00348
00349     // check parameters
00350     if (!pdwAccessorFlags || !pcBindings || !prgBindings)
00351         return ResultFromScode( E_INVALIDARG );
00352
00353     // Validate Accessor Handle
00354     m_pextbufferAccessor->GetItemOfExtBuffer(hAccessor, &pAccessor);
00355     if( !pAccessor )
00356         return DB_E_BADACCESSORHANDLE;
00357
00358     // Allocate and return Array of bindings
00359   // 64 bit TODO
00360     cBindingSize = (ULONG)pAccessor->cBindings * sizeof( DBBINDING );
00361   if ( cBindingSize )
00362     *prgBindings = (DBBINDING *) PROVIDER_ALLOC( cBindingSize );
00363
00364   // Check the Allocation
00365   if ( ( *prgBindings == NULL ) && ( cBindingSize ) )
00366         return ResultFromScode( E_OUTOFMEMORY );
00367
00368     *pdwAccessorFlags = pAccessor->dwAccessorFlags;
00369     *pcBindings = pAccessor->cBindings;
00370     memcpy( *prgBindings, pAccessor->rgBindings, cBindingSize );
00371
00372     // all went well..
00373     return ResultFromScode( S_OK );
00374 }
00375
00376
00377
00378 // CImpIAccessor::ReleaseAccessor ---------------------------------------
00379 //
00380 // @mfunc Releases an Accessor
00381 //
00382 // @rdesc HRESULT
00383 //      @flag S_OK                      | Method Succeeded
00384 //      @flag DB_E_BADACCESSORHANDLE    | hAccessor was invalid
00385 //
00386 STDMETHODIMP CImpIAccessor::ReleaseAccessor
00387     (
00388     HACCESSOR hAccessor,      //@parm IN | Accessor handle to release
00389   DBREFCOUNT* pcRefCounts   //@parm OUT | Reference Count
00390     )
00391 {
00392     // Retrieve our accessor structure from the client's hAccessor,
00393     // free it, then mark accessor ptr as unused.
00394     // We do not re-use accessor handles.  This way, we hope
00395     // to catch more client errors.  (Also, ExtBuffer doesn't
00396     // maintain a free list, so it doesn't know how to.)
00397
00398     PACCESSOR   pAccessor;
00399
00400   if( pcRefCounts )
00401     *pcRefCounts = 0;
00402
00403     m_pextbufferAccessor->GetItemOfExtBuffer(hAccessor, &pAccessor);
00404     if( !pAccessor )
00405         return DB_E_BADACCESSORHANDLE;
00406
00407     // Free the actual structure.
00408   InterlockedDecrement((LONG*)&(pAccessor->cRef));
00409
00410   if( pAccessor->cRef <= 0 )
00411   {
00412     SAFE_DELETE( pAccessor );
00413     if( pcRefCounts )
00414       *pcRefCounts = 0;
00415
00416       // Store a null in our array-of-ptrs,
00417       // so we know next time that it is invalid.
00418       // (operator[] returns a ptr to the space where the ptr is stored.)
00419       *(PACCESSOR*) ((*m_pextbufferAccessor)[hAccessor]) = NULL;
00420   }
00421   else
00422   {
00423     if( pcRefCounts )
00424       *pcRefCounts = (DBREFCOUNT)(pAccessor->cRef);
00425   }
00426
00427     return ResultFromScode( S_OK );
00428 }
00429
00430
00431
00432 // CImpIAccessor::CopyAccessors------------------------------------------------------
00433 //
00434 // @mfunc Copies accessors from one instantiation of the IAccessor to another (e.g.
00435 // from one under ICommand to the one owned by IRowset implementation object).
00436 //
00437 // @rdesc Returns one of the following values:
00438 //    @flag S_OK            | copying of the accessors succeeded,
00439 //    @flag E_OUTOFMEMORY       | copying failed due to memory allocation
00440 //                      failure for a new accessor,
00441 //    @flag OTHER           | other result codes returned by called
00442 //                      functions.
00443 //-----------------------------------------------------------------------------------
00444
00445 STDMETHODIMP CImpIAccessor::CopyAccessors
00446   (
00447   LPEXTBUFFER        pextbufferAccessor//@parm IN  | specifies extended buffer
00448                       // to which accessors should be copied
00449   )
00450 {
00451   HACCESSOR hAccessor, hAccessorFirst, hAccessorLast, hAccessorDup;
00452   ULONG   cbAccessor;
00453   PACCESSOR paccessor=NULL, paccessorNew=NULL, paccessorNull=NULL;
00454   HRESULT   hr;
00455
00456   assert(pextbufferAccessor);
00457
00458   if(pextbufferAccessor)
00459   {
00460     // Get the number of available accessors.
00461     m_pextbufferAccessor->GetFirstLastItemH(hAccessorFirst, hAccessorLast);
00462
00463     for(hAccessor=hAccessorFirst; hAccessor <= hAccessorLast; hAccessor++)
00464     {
00465       hr = m_pextbufferAccessor->GetItemOfExtBuffer(hAccessor, &paccessor );
00466       if( FAILED(hr) )
00467         return hr;
00468
00469       if (paccessor == NULL)
00470         paccessorNew = paccessorNull;
00471       else
00472       {
00473         // Allocate space for the accessor structure.
00474         // 64 bit TODO
00475         cbAccessor = sizeof(ACCESSOR)
00476                 + (ULONG)(paccessor->cBindings ?
00477                   (ULONG)(paccessor->cBindings-1) : 0)
00478                   * sizeof(DBBINDING);
00479
00480         paccessorNew = (PACCESSOR) new BYTE [cbAccessor];
00481         if (paccessorNew == NULL)
00482           return ResultFromScode(E_OUTOFMEMORY);
00483
00484         memcpy( paccessorNew, paccessor, cbAccessor);
00485
00486         paccessorNew->cRef = 1;
00487       }
00488
00489       // Insert accessor ptr into the new buffer.
00490       hr = pextbufferAccessor->InsertIntoExtBuffer(&paccessorNew, hAccessorDup);
00491
00492       // Can fail because of Out-Of-Memory condition.
00493       if(FAILED(hr))
00494       {
00495         SAFE_DELETE(paccessorNew);
00496         return hr;
00497       }
00498     }
00499   }
00500
00501   return NOERROR;
00502 }
00503
00504
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTypesDialog Member List

This is the complete list of members for CTypesDialog, including all inherited members.
CDialogBase(HWND hWnd, HINSTANCE hInst) | CDialogBase |
CTypesDialog(HWND hWnd, HINSTANCE hInst, CTableCopy *pTableCopy) | CTypesDialog |
Destroy() | CDialogBase | [virtual]
Display() | CTypesDialog | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CTypesDialog | [static]
InitControls() | CTypesDialog | [virtual]
m_hInst | CDialogBase |
m_hWnd | CDialogBase |
m_pCTableCopy | CTypesDialog |
RefreshControls() | CTypesDialog | [virtual]
ResetTypeLists() | CTypesDialog | [virtual]
~CDialogBase() | CDialogBase | [virtual]
~CTypesDialog() | CTypesDialog | [virtual]
Generated on Wed Nov 13 2024 16:57:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/CallAs/CallAs.Idl Source File

  • Com
  • Fundamentals
  • Object
  • CallAs

CallAs.Idl

Go to the documentation of this file.
00001 /* file: callas.idl */
00002 [
00003   object,
00004   uuid(a46deb30-9f33-11cd-b23f-00aa00339cce)
00005 ]
00006 interface IHelloCallAs : IUnknown
00007 {
00008     // pull in the definitions for all the standard interfaces
00009   import "unknwn.idl";
00010
00011     typedef     int     MyBoolean;
00012
00013     // this is the local appearance of the HelloProc; it is the
00014     // view that the client and server applications see.  This
00015     // routine can have any signature (including "...") as long as
00016     // it can map to the corresponding remoted version.
00017   [local] MyBoolean HelloProc([in, string] char *pszString);
00018
00019
00020
00021     // this is the remoted appearance of the HelloProc; it is the
00022     // wire contract remoting the interface, and must obey all the
00023     // regular rules about remotable custom interfaces.
00024     //
00025     // the ACF file specifies "[call_as( HelloProc )]"
00026
00027     HRESULT RemoteHelloProc([in, string] char *pszString);
00028
00029 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/BandObjs/Globals.h Source File

  • WinUI
  • Shell
  • BandObjs

Globals.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Globals.h
00013
00014 **************************************************************************/
00015
00016 /**************************************************************************
00017    global variables
00018 **************************************************************************/
00019
00020 extern HINSTANCE  g_hInst;
00021 extern UINT       g_DllRefCount;
00022
00023 #define ARRAYSIZE(a)    (sizeof(a)/sizeof(a[0]))
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_NoAddRefReleaseQIOnSmartPtr< T > Member List

This is the complete list of members for _NoAddRefReleaseQIOnSmartPtr< T >, including all inherited members.
STDMETHOD_(ULONG, AddRef)()=0 | _NoAddRefReleaseQIOnSmartPtr< T > | [private, pure virtual]
STDMETHOD_(ULONG, Release)()=0 | _NoAddRefReleaseQIOnSmartPtr< T > | [private, pure virtual]
STDMETHOD_(HRESULT, QI)(REFIID | _NoAddRefReleaseQIOnSmartPtr< T > | [private]
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • Extens

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120     MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122     // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal) {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/prsample/command.cpp Source File

  • Dataaccess
  • oledb
  • prsample

command.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 // Microsoft OLE DB Programmer's Reference Sample
00003 // Copyright (C) 1998 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module COMMAND.CPP
00008 //
00009 //---------------------------------------------------------------------------
00010
00011
00012 /////////////////////////////////////////////////////////////////
00013 // Includes
00014 //
00015 /////////////////////////////////////////////////////////////////
00016 #include "prsample.h"   // Programmer's Reference Sample includes
00017
00018
00019
00020 /////////////////////////////////////////////////////////////////
00021 // myCreateCommand
00022 //
00023 //  This function takes an IUnknown pointer on a Session object
00024 //  and attempts to create a Command object using the Session's
00025 //  IDBCreateCommand interface. Since this interface is optional,
00026 //  this may fail.
00027 //
00028 /////////////////////////////////////////////////////////////////
00029 HRESULT myCreateCommand
00030   (
00031   IUnknown *        pUnkSession,
00032   IUnknown **       ppUnkCommand
00033   )
00034 {
00035   HRESULT         hr;
00036   IDBCreateCommand *    pIDBCreateCommand     = NULL;
00037
00038   // Attempt to create a Command object from the Session object
00039   XCHECK_HR(hr = pUnkSession->QueryInterface(
00040         IID_IDBCreateCommand, (void**)&pIDBCreateCommand));
00041   XCHECK_HR(hr = pIDBCreateCommand->CreateCommand(
00042         NULL,       //pUnkOuter
00043         IID_ICommand,   //riid
00044         ppUnkCommand    //ppCommand
00045         ));
00046
00047 CLEANUP:
00048   if( pIDBCreateCommand )
00049     pIDBCreateCommand->Release();
00050   return hr;
00051 }
00052
00053
00054
00055
00056 /////////////////////////////////////////////////////////////////
00057 // myExecuteCommand
00058 //
00059 //  This function takes an IUnknown pointer on a Command object
00060 //  and performs the following steps to create a new Rowset
00061 //  object:
00062 //   - sets the given properties on the Command object; these
00063 //     properties will be applied by the provider to any Rowset
00064 //     created by this Command
00065 //   - sets the given command text for the Command
00066 //   - executes the command to create a new Rowset object
00067 //
00068 /////////////////////////////////////////////////////////////////
00069 HRESULT myExecuteCommand
00070   (
00071   IUnknown *        pUnkCommand,
00072   WCHAR *         pwszCommandText,
00073   ULONG         cPropSets,
00074   DBPROPSET*        rgPropSets,
00075   IUnknown **       ppUnkRowset
00076   )
00077 {
00078   HRESULT         hr;
00079   ICommandText *      pICommandText       = NULL;
00080   ICommandProperties *  pICommandProperties     = NULL;
00081
00082   // Set the properties on the Command object
00083   XCHECK_HR(hr = pUnkCommand->QueryInterface(
00084         IID_ICommandProperties, (void**)&pICommandProperties));
00085   XCHECK_HR(hr = pICommandProperties->SetProperties(cPropSets, rgPropSets));
00086
00087   // Set the text for this Command, using the default command text
00088   // dialect. All providers that support commands must support this
00089   // dialect and providers that support SQL must be able to recognize
00090   // an SQL command as SQL when this dialect is specified
00091   XCHECK_HR(hr = pUnkCommand->QueryInterface(
00092         IID_ICommandText, (void**)&pICommandText));
00093   XCHECK_HR(hr = pICommandText->SetCommandText(
00094         DBGUID_DEFAULT,   //guidDialect
00095         pwszCommandText   //pwszCommandText
00096         ));
00097
00098   // And execute the Command. Note that the user could have
00099   // entered a non-row returning command, so we will check for
00100   // that and return failure to prevent the display of the
00101   // non-existant rowset by the caller
00102   XCHECK_HR(hr = pICommandText->Execute(
00103         NULL,     //pUnkOuter
00104         IID_IRowset,  //riid
00105         NULL,     //pParams
00106         NULL,     //pcRowsAffected
00107         ppUnkRowset   //ppRowset
00108         ));
00109
00110   if( !*ppUnkRowset )
00111   {
00112     printf("\nThe command executed successfully, but did not " \
00113          "return a rowset.\nNo rowset will be displayed.\n");
00114     hr = E_FAIL;
00115   }
00116
00117
00118 CLEANUP:
00119   if( pICommandText )
00120     pICommandText->Release();
00121   if( pICommandProperties )
00122     pICommandProperties->Release();
00123   return hr;
00124 }
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/statnode.h Source File

  • SysMgmt
  • MMC
  • Proppage

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038
00039 public:
00040     // virtual functions go here (for MMCN_*)
00041     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00042
00043 private:
00044     enum { NUMBER_OF_CHILDREN = 4 };
00045     CDelegationBase *children[NUMBER_OF_CHILDREN];
00046
00047     // {2974380C-4C4B-11d2-89D8-000021473128}
00048     static const GUID thisGuid;
00049 };
00050
00051
00052
00053 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/Perfmsg.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll

Perfmsg.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1992 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 Module Name:
00011
00012     perfmsg.h
00013
00014 Abstract:
00015
00016     This file provides the macros and definitions used by the extensible
00017     counters for reporting events to the event logging facility
00018
00019 --*/
00020 #ifndef  _PERFMSG_H_
00021 #define  _PERFMSG_H_
00022 //
00023 // Report error message ID's for Counters
00024 //
00025
00026 #define APP_NAME  "appmemry"
00027
00028 //
00029 // The constant below defines how many (if any) messages will be reported
00030 // to the event logger. As the number goes up in value more and more events
00031 // will be reported. The purpose of this is to allow lots of messages during
00032 // development and debugging (e.g. a message level of 3) to a minimum of
00033 // messages (e.g. operational messages with a level of 1) or no messages if
00034 // message logging inflicts too much of a performance penalty. Right now
00035 // this is a compile time constant, but could later become a registry entry.
00036 //
00037 //    Levels:  LOG_NONE = No event log messages ever
00038 //             LOG_USER = User event log messages (e.g. errors)
00039 //             LOG_DEBUG = Minimum Debugging
00040 //             LOG_VERBOSE = Maximum Debugging
00041 //
00042
00043 #define  LOG_NONE     0
00044 #define  LOG_USER     1
00045 #define  LOG_DEBUG    2
00046 #define  LOG_VERBOSE  3
00047
00048 #define  MESSAGE_LEVEL_DEFAULT  LOG_USER
00049
00050 // define macros
00051 //
00052 // Format for event log calls without corresponding insertion strings is:
00053 //    REPORT_xxx (message_value, message_level)
00054 //       where:
00055 //          xxx is the severity to be displayed in the event log
00056 //          message_value is the numeric ID from above
00057 //          message_level is the "filtering" level of error reporting
00058 //             using the error levels above.
00059 //
00060 // if the message has a corresponding insertion string whose symbol conforms
00061 // to the format CONSTANT = numeric value and CONSTANT_S = string constant for
00062 // that message, then the
00063 //
00064 //    REPORT_xxx_STRING (message_value, message_level)
00065 //
00066 // macro may be used.
00067 //
00068
00069 //
00070 // REPORT_SUCCESS was intended to show Success in the error log, rather it
00071 // shows "N/A" so for now it's the same as information, though it could
00072 // (should) be changed  in the future
00073 //
00074
00075
00076 #define REPORT_SUCCESS(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
00077    0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
00078
00079 #define REPORT_INFORMATION(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
00080    0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
00081
00082 #define REPORT_WARNING(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
00083    0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
00084
00085 #define REPORT_ERROR(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
00086    0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
00087
00088 #define REPORT_INFORMATION_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
00089    0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)
00090
00091 #define REPORT_WARNING_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
00092    0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)
00093
00094 #define REPORT_ERROR_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
00095    0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)
00096
00097 // External Variables
00098
00099 extern HANDLE hEventLog;   // handle to event log
00100 extern DWORD  dwLogUsers;  // counter of event log using routines
00101 extern DWORD  MESSAGE_LEVEL; // event logging detail level
00102
00103 #endif //_PERFMSG_H_
00104 
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMultiValuedAttributeEditor Member List

This is the complete list of members for CMultiValuedAttributeEditor, including all inherited members.
CMultiValuedAttributeEditor(CStringList &strrefAttributeList) | CMultiValuedAttributeEditor |
CMultiValuedAttributeEditor(CStringList &strrefAttributeList) | CMultiValuedAttributeEditor |
Initialize(UINT nEditBox, UINT nListBox, UINT nAddButton, UINT nDeleteButton, CWnd *pParentWnd) | CMultiValuedAttributeEditor |
Initialize(UINT nEditBox, UINT nListBox, UINT nAddButton, UINT nDeleteButton, CWnd *pParentWnd) | CMultiValuedAttributeEditor |
m_AddButton | CMultiValuedAttributeEditor | [private]
m_DeleteButton | CMultiValuedAttributeEditor | [private]
m_strrefAttributeList | CMultiValuedAttributeEditor | [private]
m_ValueEditor | CMultiValuedAttributeEditor | [private]
m_ValueList | CMultiValuedAttributeEditor | [private]
OnAddValue() | CMultiValuedAttributeEditor |
OnAddValue() | CMultiValuedAttributeEditor |
OnDeleteValue() | CMultiValuedAttributeEditor |
OnDeleteValue() | CMultiValuedAttributeEditor |
OnEditChange() | CMultiValuedAttributeEditor |
OnEditChange() | CMultiValuedAttributeEditor |
OnValueSelChange() | CMultiValuedAttributeEditor |
OnValueSelChange() | CMultiValuedAttributeEditor |
~CMultiValuedAttributeEditor() | CMultiValuedAttributeEditor | [inline]
~CMultiValuedAttributeEditor() | CMultiValuedAttributeEditor | [inline]
Generated on Wed Nov 13 2024 16:56:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_seq Member List

This is the complete list of members for tag_seq, including all inherited members.
cbBuffer | tag_seq
cbPreroll | tag_seq
cBuffer | tag_seq
cTrk | tag_seq
dwTimeDivision | tag_seq
fdwSeq | tag_seq
hmidi | tag_seq
hSmf | tag_seq
hWnd | tag_seq
lpbAlloc | tag_seq
lpmhFree | tag_seq
lpmhPreroll | tag_seq
mmrcLastErr | tag_seq
pNext | tag_seq
pstrFile | tag_seq
tkBase | tag_seq
tkEnd | tag_seq
tkLength | tag_seq
uBuffersInMMSYSTEM | tag_seq
uDeviceID | tag_seq
uMCIDeviceID | tag_seq
uMCITimeDiv | tag_seq
uMCITimeFormat | tag_seq
uState | tag_seq
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CIsapiCertPolicyFilter Member List

This is the complete list of members for CIsapiCertPolicyFilter, including all inherited members.
CheckCertPolicy(const _bstr_t &bstrCert) | CIsapiCertPolicyFilter | [private, static]
CIsapiCertPolicyFilter() | CIsapiCertPolicyFilter |
GetFilterVersion(PHTTP_FILTER_VERSION pVer) | CIsapiCertPolicyFilter | [virtual]
MatchExtendedKeyUsage(CAPICOM::IEKUPtr EKU, BOOL *pfMatchOid) | CIsapiCertPolicyFilter | [private, static]
MatchExtendedKeyUsage(CAPICOM::ICertificate2Ptr Cert) | CIsapiCertPolicyFilter | [private, static]
MatchIssuerThumbprint(CAPICOM::ICertificate2Ptr Cert) | CIsapiCertPolicyFilter | [private, static]
OnAuthentication(CHttpFilterContext *pCtxt, PHTTP_FILTER_AUTHENT pAuthent) | CIsapiCertPolicyFilter | [virtual]
~CIsapiCertPolicyFilter() | CIsapiCertPolicyFilter |
Generated on Wed Nov 13 2024 16:56:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/staticnode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

staticnode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  StaticNode.h: interface for the CStaticNode class.
00014 //
00015
00016 #ifndef _CLASS_CSTATICNODE_
00017 #define _CLASS_CSTATICNODE_
00018
00019 #if _MSC_VER > 1000
00020 #pragma once
00021 #endif // _MSC_VER > 1000
00022
00023
00024 #include "Globals.h"
00025 #include "BaseNode.h"
00026
00027
00028 class CComponentData;        // References
00029
00030
00031 //---------------------------------------------------------------------------
00032 class CStaticNode : public CBaseNode
00033 {
00034   public:
00035     CStaticNode();
00036     virtual ~CStaticNode();
00037
00038     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00039
00040
00041   // Virtual methods
00042   public:
00043     ULONG   GetNodeType() { return NODETYPE_STATIC; };
00044     GUID*   GetNodeGUID() { return &thisGUID; };
00045
00046     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00047     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00048     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00049
00050
00051   // Notification handlers
00052   public:
00053     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00054             { return E_NOTIMPL; }
00055
00056     HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00057             { return E_NOTIMPL; }
00058
00059   private:
00060     static GUID      thisGUID;
00061     CComponentData*  m_pCompData;
00062
00063 };
00064
00065 #endif //_CLASS_CSTATICNODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditHost/StdAfx.h Source File

  • Web
  • Browser
  • EditHost

StdAfx.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // stdafx.h : include file for standard system include files,
00006 //      or project specific include files that are used frequently,
00007 //      but are changed infrequently
00008
00009 #if !defined(AFX_STDAFX_H__BC7206F5_CB70_47F2_9618_23FA71903CFA__INCLUDED_)
00010 #define AFX_STDAFX_H__BC7206F5_CB70_47F2_9618_23FA71903CFA__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016 #define STRICT
00017 #ifndef _WIN32_WINNT
00018 #define _WIN32_WINNT 0x0400
00019 #endif
00020 #define _ATL_APARTMENT_THREADED
00021
00022 #include <atlbase.h>
00023
00024 //You may derive a class from CComModule and use it if you want to override
00025 //something, but do not change the name of _Module
00026 class CExeModule : public CComModule
00027 {
00028 public:
00029   LONG Unlock();
00030   DWORD dwThreadID;
00031   HANDLE hEventShutdown;
00032   void MonitorShutdown();
00033   bool StartMonitor();
00034   bool bActivity;
00035 };
00036 extern CExeModule _Module;
00037 #include <atlcom.h>
00038
00039 //{{AFX_INSERT_LOCATION}}
00040 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00041
00042 #endif // !defined(AFX_STDAFX_H__BC7206F5_CB70_47F2_9618_23FA71903CFA__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTableCopy Member List

This is the complete list of members for CTableCopy, including all inherited members.
CopyTables() | CTableCopy | [virtual]
CTableCopy(CWizard *pCWizard) | CTableCopy |
m_dwBlobOpt | CTableCopy |
m_dwInsertOpt | CTableCopy |
m_dwRowOpt | CTableCopy |
m_fCopyIndexes | CTableCopy |
m_fCopyPrimaryKeys | CTableCopy |
m_fCopyTables | CTableCopy |
m_fShowQuery | CTableCopy |
m_fTranslate | CTableCopy |
m_pCFromTable | CTableCopy |
m_pCToTable | CTableCopy |
m_pCWizard | CTableCopy |
m_ulBlobSize | CTableCopy |
m_ulMaxRows | CTableCopy |
m_ulParamSets | CTableCopy |
MapTypes() | CTableCopy | [virtual]
~CTableCopy() | CTableCopy | [virtual]
Generated on Wed Nov 13 2024 16:57:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropertyIDs Member List

This is the complete list of members for CPropertyIDs, including all inherited members.
AddElement(DBPROPIDelement) | CVector< DBPROPID > | [virtual]
AddProperty(DBPROPID dwPropertyID, const DBID &colid) | TPropBase< DBPROPID > | [virtual]
Attach(DBPROPIDSET *pPropSet) | CPropertyIDs | [virtual]
TPropBase< DBPROPID >::Attach(CVector &rVector) | CVector< DBPROPID > | [virtual]
TPropBase< DBPROPID >::Attach(ULONGcElements, DBPROPID *rgElements) | CVector< DBPROPID > | [virtual]
CPropertyIDs(DBPROPIDSET *pPropSet=NULL) | CPropertyIDs |
CVector(ULONGulLowerBound=0, ULONGulGrowSize=10) | CVector< DBPROPID > |
Detach(DBPROPIDSET *pPropSet) | CPropertyIDs | [virtual]
TPropBase< DBPROPID >::Detach(ULONG *pcElements, DBPROPID **prgElements) | CVector< DBPROPID > | [virtual]
FindProperty(DBPROPID dwPropertyID, const DBID &colid) | CPropertyIDs | [virtual]
GetCount() | CVector< DBPROPID > | [inline, virtual]
GetElement(ULONGiIndex) | CVector< DBPROPID > | [virtual]
GetElements() const | CVector< DBPROPID > | [inline, virtual]
GetProperties() | TPropBase< DBPROPID > | [inline, virtual]
InsertAt(ULONGiIndex, DBPROPIDelement) | CVector< DBPROPID > | [virtual]
m_cElements | CVector< DBPROPID > | [protected]
m_rgElements | CVector< DBPROPID > | [protected]
m_ulGrowSize | CVector< DBPROPID > | [protected]
m_ulLowerBound | CVector< DBPROPID > | [protected]
m_ulMaxSize | CVector< DBPROPID > | [protected]
operator[](ULONGiIndex) | CVector< DBPROPID > | [inline, virtual]
RemoveAll() | CVector< DBPROPID > | [virtual]
RemoveAt(ULONGiIndex) | CVector< DBPROPID > | [virtual]
SetProperty(DBPROPID dwPropertyID) | CPropertyIDs | [virtual]
TPropBase(ULONG cElements=0, DBPROPID *rgElements=NULL) | TPropBase< DBPROPID > |
~CPropertyIDs() | CPropertyIDs | [virtual]
~CVector() | CVector< DBPROPID > | [virtual]
~TPropBase() | TPropBase< DBPROPID > | [virtual]
Generated on Wed Nov 13 2024 16:57:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDragSource Member List

This is the complete list of members for CDragSource, including all inherited members.
CDragSource() | CDragSource |
GiveFeedback(DWORD) | CDragSource |
m_cRefCount | CDragSource | [private]
QueryContinueDrag(BOOL, DWORD) | CDragSource |
QueryInterface(REFIID, LPVOID *) | CDragSource |
STDMETHOD_(ULONG, AddRef)(void) | CDragSource |
STDMETHOD_(ULONG, Release)(void) | CDragSource |
~CDragSource() | CDragSource |
Generated on Wed Nov 13 2024 16:56:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/fileio.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

fileio.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module FILEIO.CPP | This module contains the File Manipulation code
00008 // for a Comma Seperated Value (CSV) Simple Provider.
00009 //
00010 //
00011 #include "headers.h"
00012 #include "fileio.h"
00013
00014 static const ARRAY_INIT_SIZE = 1000;
00015
00016 // Data Types supported
00017 static const TYPE_CHAR = 1;
00018 static const TYPE_SLONG = 3;
00019
00020 // Data Type Parse strings and lengths
00021 static const char CHAR_STRING[] = "CHAR";
00022 static const CHAR_STRING_SIZE = 4;
00023 static const char SLONG_STRING[] = "SLONG";
00024 static const SLONG_STRING_SIZE = 5;
00025
00026
00027 //--------------------------------------------------------------------
00028 // @mfunc Constructor for this class
00029 //
00030 // @rdesc NONE
00031 //
00032 CFileIO::CFileIO()
00033 {
00034   memset(&m_rgpColumnData, 0, sizeof(PCOLUMNDATA) * MAX_COLUMNS);
00035
00036     m_pColNames        = NULL;
00037     m_pvInput          = NULL;
00038     m_ulDataTypeOffset = 0;
00039     m_cColumns         = 0;
00040     m_cRows            = 0;
00041   m_FileReadOnly     = FALSE;
00042   m_pbHeap         = NULL;
00043   m_cbHeapUsed       = 0;
00044   m_cbRowSize      = 0;
00045 }
00046
00047
00048 //--------------------------------------------------------------------
00049 // @mfunc Destructor for this class
00050 //
00051 // @rdesc NONE
00052 //
00053 CFileIO:: ~CFileIO()
00054 {
00055   // Release buffer for column names (pointed to by m_rgdbcolinfo).
00056     if (m_pbHeap)
00057         VirtualFree((VOID *) m_pbHeap, 0, MEM_RELEASE );
00058
00059     // Close file
00060     if (is_open())
00061         close();
00062
00063     // Delete buffers
00064     SAFE_DELETE( m_pColNames );
00065     SAFE_DELETE( m_pvInput );
00066 }
00067
00068
00069 //--------------------------------------------------------------------
00070 // @mfunc Initialization routine, opens file specified and creates
00071 // buffers
00072 //
00073 // @rdesc HRESULTs
00074 //      @flag S_OK | Succeeded
00075 //      @flag E_FAIL | Failed to Initialize
00076 //    @flag DB_E_NOTABLE | File marked as read only or didn't exist
00077 //
00078 HRESULT CFileIO::fInit
00079     (
00080     LPSTR ptstrFileName         //@parm IN | File Name to Open
00081     )
00082 {
00083     // Allocate Stream Buffer
00084     m_pvInput = new char[MAX_INPUT_BUFFER ];
00085     if (NULL == m_pvInput)
00086         return ResultFromScode( E_FAIL );
00087
00088     // Open the File
00089   open( ptstrFileName, ios::in | ios::out | ios::nocreate, filebuf::sh_read || filebuf::sh_write );
00090     if( !is_open() ) {
00091     open( ptstrFileName, ios::in | ios::nocreate, filebuf::sh_read );
00092     if (!is_open())
00093       return ResultFromScode( DB_E_NOTABLE );
00094
00095     m_FileReadOnly = TRUE;
00096   }
00097
00098     // Obtain the Column Names, Data Types, and Indexes
00099     // for each of the rows
00100     if (FAILED( GenerateFileInfo()))
00101         return ResultFromScode( E_FAIL );
00102
00103     return ResultFromScode( S_OK );
00104 }
00105
00106
00107 //--------------------------------------------------------------------
00108 // @mfunc Retrieve the Name associated with a particular column.  If
00109 // names have not been read from the file yet, retrieve those names.
00110 // If a name does not exist for a column, fabricate one.
00111 //
00112 // @rdesc HRESULT
00113 //      @flag S_OK | Succeeded
00114 //      @flag E_FAIL | Invalid Column Number
00115 //
00116 HRESULT CFileIO::GetColumnName
00117     (
00118     DBORDINAL cCols,         //@parm IN | Column Number
00119     LPSTR*    pptstrName     //@parm OUT | Pointer to Column Name
00120     )
00121 {
00122     // Column number greater than MAX
00123     if (cCols > MAX_COLUMNS)
00124         return ResultFromScode( E_FAIL );
00125
00126     // If Column Names have not been retrieved,
00127     // then retrieve them into the internal array
00128     if (!m_pColNames)
00129         {
00130         // Save Current Position and move to beginning of file
00131         seekg( 0L );
00132         clear();
00133
00134         // Retrieve the column names record
00135         getline( m_pvInput, MAX_INPUT_BUFFER );
00136         if (good() && 0 < gcount())
00137         {
00138       m_pColNames = new char[gcount() ];
00139       memcpy( m_pColNames, m_pvInput, gcount());
00140         }
00141     else
00142     {
00143       //Invalid Table, first line does not contain
00144       //column metadata.
00145       return ResultFromScode( E_FAIL );
00146     }
00147
00148     ParseColumnNames( m_pColNames );
00149
00150         return ResultFromScode( S_FALSE );
00151         }
00152
00153     ASSERT( pptstrName );
00154
00155     // If the column number is in range then return
00156     // the pointer
00157     if ((0 == cCols) || (m_cColumns < cCols))
00158         return ResultFromScode( E_FAIL );
00159     else
00160         {
00161         *pptstrName = m_rgpColNames[cCols];
00162         return ResultFromScode( S_OK );
00163         }
00164 }
00165
00166
00167 //--------------------------------------------------------------------
00168 // @mfunc Tokenize the column names
00169 //
00170 // @rdesc HRESULT
00171 //      @flag S_OK | Parsing yielded no Error
00172 //
00173 HRESULT CFileIO::ParseColumnNames
00174     (
00175     LPTSTR ptstrInput
00176     )
00177 {
00178     LPTSTR  pvInput = ptstrInput;
00179
00180     ASSERT( pvInput );
00181
00182     // Set first column pointer
00183     if ('\0' != *pvInput)
00184         {
00185         m_rgpColNames[++m_cColumns] = pvInput;
00186         }
00187
00188     // Null Terminate each column
00189     while ('\0' != *pvInput)
00190         {
00191         // Check for Comma
00192         if (0 == strncmp( ",", pvInput, sizeof(char)))
00193             {
00194             memcpy( pvInput, "", sizeof(char));
00195
00196             if (0 != strncmp( "", (pvInput+1), sizeof(char)))
00197                 {
00198                 m_rgpColNames[++m_cColumns] = (pvInput+1);
00199                 }
00200             }
00201
00202         pvInput++;
00203         }
00204
00205     return ResultFromScode( S_OK );
00206 }
00207
00208
00209 //--------------------------------------------------------------------
00210 // @mfunc Retrieves the columns data characteristics
00211 //
00212 // @rdesc HRESULT
00213 //      @flag S_OK | Succeeded
00214 //      @flag E_FAIL | Invalid Column Number
00215 //
00216 HRESULT CFileIO::GetDataTypes
00217     (
00218     DBORDINAL cCols,    //@parm IN | Column number
00219     SWORD* pswType,     //@parm OUT | Data Type
00220     UDWORD* pudwColDef, //@parm OUT | Precision of the column
00221     BOOL* pfSigned      //@parm OUT | Is the columns signed
00222     )
00223 {
00224     HRESULT hr;
00225
00226     // Column number greater than MAX
00227     if (cCols > MAX_COLUMNS)
00228         return ResultFromScode( E_FAIL );
00229
00230     // If Data Types have not been retrieved,
00231     // then retrieve them into the internal array
00232     if (0 == m_ulDataTypeOffset)
00233         {
00234         seekg( 0L );
00235         clear();
00236
00237         // To retrieve the Column Data Types, we need
00238         // to skip the first row and get to the 2nd row
00239         getline( m_pvInput, MAX_INPUT_BUFFER );
00240         m_ulDataTypeOffset = tellg();
00241         getline( m_pvInput, MAX_INPUT_BUFFER );
00242
00243         // Check Stream status
00244         if (bad() || 0 == gcount())
00245             return ResultFromScode( E_FAIL );
00246
00247         // Parse the datatypes from the stream.
00248         hr = ParseDataTypes();
00249         if (FAILED( hr ))
00250             return hr;
00251
00252         return ResultFromScode( S_FALSE );
00253         }
00254
00255     assert( pswType || pudwColDef || pfSigned );
00256
00257     // If the column number is in range then return
00258     // the pointer
00259     if ((0 == cCols) || (m_cColumns < cCols))
00260         return ResultFromScode( E_FAIL );
00261     else
00262         {
00263         *pswType = m_rgswColType[cCols];
00264         *pudwColDef = m_rgudwColSize[cCols];
00265         *pfSigned = m_rgfSigned[cCols];
00266         return ResultFromScode( S_OK );
00267         }
00268 }
00269
00270
00271 //--------------------------------------------------------------------
00272 // @mfunc Tokenize the DataTypes and Lengths
00273 // Valid Data Types are CHAR(n), INTEGER, and LONG
00274 //
00275 // CHAR, SLONG
00276 //
00277 // @rdesc HRESULT
00278 //      @flag S_OK | Parsing yielded no Error
00279 //
00280 HRESULT CFileIO::ParseDataTypes()
00281 {
00282     DBORDINAL cColumn = 0;
00283     LPSTR     pVal, pOpen;
00284
00285     assert( m_pvInput );
00286
00287     pVal = strtok( m_pvInput, ",\0" );
00288     if (NULL == pVal)
00289         return ResultFromScode( E_FAIL );
00290
00291     while (NULL != pVal)
00292         {
00293         cColumn++;
00294
00295         if (0 == _strnicmp( pVal, CHAR_STRING, CHAR_STRING_SIZE ))
00296             {
00297             m_rgswColType[cColumn] = TYPE_CHAR;
00298             pOpen = strstr( pVal, "(" );
00299             m_rgudwColSize[cColumn] = atol( ++pOpen );
00300             m_rgfSigned[cColumn] = FALSE;
00301             }
00302         else if (0 == _strnicmp( pVal, SLONG_STRING, SLONG_STRING_SIZE ))
00303             {
00304             m_rgswColType[cColumn] = TYPE_SLONG;
00305             m_rgudwColSize[cColumn] = 4;
00306             m_rgfSigned[cColumn] = TRUE;
00307             }
00308         else
00309             return ResultFromScode( E_FAIL );
00310
00311         pVal = strtok( NULL, ",\0" );
00312         }
00313
00314     // should have exactly the same number of types as we have columns
00315     if (cColumn != m_cColumns)
00316         return ResultFromScode( E_FAIL );
00317
00318     return ResultFromScode( S_OK );
00319 }
00320
00321
00322 //--------------------------------------------------------------------
00323 // @mfunc Obtain the offsets into the file that each row exists at.
00324 // Ignore any deleted rows while reading the file.
00325 //
00326 // @rdesc HRESULT
00327 //      @flag S_OK | Got the offsets, Column Names and Data Types
00328 //      @flag E_FAIL | Could not obtain all the necessary info
00329 //
00330 HRESULT CFileIO::GenerateFileInfo()
00331 {
00332     ULONG ulDex = 0;
00333     ULONG ulSavePos;
00334
00335     // Generate Column Info, if NULL is returned, a problem
00336     // was encountered while reading the Column Names.
00337     if (S_FALSE != GetColumnName( 0, NULL ))
00338         return ResultFromScode( E_FAIL );
00339
00340     // Generate DataType Mapping, if FALSE is returned, a problem
00341     // was encountered while reading the DataTypes
00342     if (S_FALSE != GetDataTypes( 0, NULL, NULL, NULL ))
00343         return ResultFromScode( E_FAIL );
00344
00345     // Create and Initialize the Index Array
00346     if (FALSE == m_FileIdx.fInit())
00347         return ResultFromScode( E_FAIL );
00348
00349   // Cache essentail column metadata
00350   if (FAILED(GatherColumnInfo()))
00351     return ResultFromScode( E_FAIL );
00352
00353     // Obtain the starting offset for each row
00354     seekg( m_ulDataTypeOffset );
00355     ulSavePos = tellg();
00356     getline( m_pvInput, MAX_INPUT_BUFFER );
00357     while (good() && !eof())
00358         {
00359         //Ignore Deleted Lines
00360         if ('@' != *m_pvInput && '\0' != *m_pvInput)
00361             m_FileIdx.SetIndex( ulDex++, ulSavePos );
00362         ulSavePos = tellg();
00363         getline( m_pvInput, MAX_INPUT_BUFFER );
00364         }
00365
00366     // Store the number of rows
00367     m_cRows = ulDex - 1;
00368
00369     return ResultFromScode( S_OK );
00370 }
00371
00372
00373 //--------------------------------------------------------------------
00374 // @mfunc Check if the row has already been deleted
00375 //
00376 // @rdesc HRESULT
00377 //      @flag S_OK | Row already deleted
00378 //      @flag S_FALSE | Row not deleted
00379 //
00380 HRESULT CFileIO::IsDeleted
00381     (
00382     DBCOUNTITEM ulRow                 //@parm IN | Row to Check
00383     )
00384 {
00385     // Already deleted
00386     if (TRUE == m_FileIdx.IsDeleted( ulRow ))
00387         return ResultFromScode( S_OK );
00388     else
00389         return ResultFromScode( S_FALSE );
00390 }
00391
00392
00393 //--------------------------------------------------------------------
00394 // @mfunc Fill the row with '@' characters, the deletion pattern..
00395 // And set the Deletion status flag in the index class.
00396 //
00397 // @rdesc HRESULT
00398 //      @flag S_OK | Deleted Row
00399 //      @flag E_FAIL | Row Number was invalid or problem deleting.
00400 //
00401 HRESULT CFileIO::DeleteRow
00402     (
00403     DBCOUNTITEM ulRow                 //@parm IN | Row to Delete
00404     )
00405 {
00406     assert( is_open());
00407     assert( m_pvInput );
00408
00409     // Check the Row Number
00410     if ((ulRow < 1) || (ulRow > m_cRows))
00411         return ResultFromScode( E_FAIL );
00412
00413     // If already deleted, just ignore.
00414     if (TRUE == m_FileIdx.IsDeleted( ulRow ))
00415         return ResultFromScode( S_OK );
00416
00417     // Set the File Pointer
00418     seekg( m_FileIdx.GetRowOffset( ulRow ));
00419     clear();
00420
00421     // Delete the row in the file and mark the status
00422     // as deleted in the index Array
00423     getline( m_pvInput, MAX_INPUT_BUFFER );
00424     if (good())
00425         {
00426         // Set the number bytes in the stream minus
00427         // the null terminator to this pattern
00428         memset( m_pvInput, '@', gcount() - 1 );
00429         seekp( m_FileIdx.GetRowOffset( ulRow ));
00430         clear();
00431         write( m_pvInput, gcount() - 1 );
00432         if (bad())
00433             return ResultFromScode( E_FAIL );
00434         else
00435             flush();
00436         }
00437     else
00438         return ResultFromScode( E_FAIL );
00439
00440     m_FileIdx.DeleteRow( ulRow );
00441
00442     return ResultFromScode( S_OK );
00443 }
00444
00445
00446 //--------------------------------------------------------------------
00447 // @mfunc Establish the Binding Information for the given file
00448 //
00449 // @rdesc HRESULT
00450 //      @flag S_OK | Binding set
00451 //      @flag E_FAIL | Problem setting the binding
00452 //
00453 HRESULT CFileIO::SetColumnBind
00454     (
00455     DBORDINAL   cCols,      //@parm IN | Column Number
00456     PCOLUMNDATA pColumn   //@parm IN | Pointer to the Data Area
00457     )
00458 {
00459     assert( is_open());
00460     assert( m_rgpColumnData );
00461
00462     // If the column number is in range then return
00463     // the pointer
00464     if ((0 == cCols) || (m_cColumns < cCols))
00465         return ResultFromScode( E_FAIL );
00466
00467     // Expect valid pointer
00468     assert( pColumn );
00469
00470     m_rgpColumnData[cCols] = pColumn;
00471
00472     return ResultFromScode( S_OK );
00473 }
00474
00475
00476 //--------------------------------------------------------------------
00477 // @mfunc Fetch the row data from the stream to the internal data
00478 // buffers
00479 //
00480 // @rdesc HRESULT
00481 //      @flag S_OK    | Row Retrieve successfully
00482 //      @flag S_FALSE | End of Result Set
00483 //      @flag E_FAIL  | Row could not be retrieved
00484 //
00485 HRESULT CFileIO::Fetch
00486     (
00487     DBCOUNTITEM ulRow           //@parm IN | Row to retrieve
00488     )
00489 {
00490     assert( is_open());
00491     assert( m_rgpColumnData );
00492     assert( m_rgsdwMaxLen );
00493
00494     // Check the Row Number
00495     if ((ulRow < 1))
00496         return ResultFromScode( E_FAIL );
00497
00498     //Check end of Result Set
00499     if (ulRow > m_cRows)
00500         return ResultFromScode( S_FALSE );
00501
00502     // Set the File Pointer to the row.
00503     seekg( m_FileIdx.GetRowOffset( ulRow ));
00504     clear();
00505
00506     // If already deleted, just ignore.
00507     if (TRUE == m_FileIdx.IsDeleted( ulRow ))
00508         return ResultFromScode( S_OK );
00509
00510     // Retrieve the column names record
00511     getline( m_pvInput, MAX_INPUT_BUFFER );
00512
00513     if (good() && 0 < gcount())
00514   {
00515         //Flag a Delete from another user
00516         if ( strncmp(m_pvInput, "@", sizeof(char)) == 0 )
00517     {
00518       DeleteRow( ulRow );
00519       return ResultFromScode( S_OK );
00520     }
00521
00522     // Parse the row
00523         return ParseRowValues();
00524   }
00525
00526     return ResultFromScode( E_FAIL );
00527 }
00528
00529
00530 //--------------------------------------------------------------------
00531 // @mfunc Tokenize the Data values and put them into the correct
00532 // binding areas
00533 //
00534 // @rdesc HRESULT
00535 //      @flag S_OK | Parsing yielded no Error
00536 //      @flag E_FAIL | Data value could not be parsed or stored
00537 //
00538 HRESULT CFileIO::ParseRowValues
00539     (
00540     void
00541     )
00542 {
00543     DBORDINAL cColumns = 0;
00544     DWORD     cQuotes = 0;
00545     LPTSTR    pvCopy,
00546               pvInput,
00547               pLastQuote;
00548
00549     pLastQuote = NULL;
00550     pvCopy = NULL;
00551     pvInput = m_pvInput;
00552
00553     assert( pvInput );
00554     assert( m_cColumns > 0 );
00555
00556     while ('\0' != *pvInput)
00557         {
00558
00559         // Check for Quotes
00560         if (0 == strncmp( "\"", pvInput, sizeof( char )))
00561             {
00562             pLastQuote = pvInput;
00563             cQuotes++;
00564             goto TermCheck;
00565             }
00566
00567         // Check for Comma
00568         // NOTE: THIS won't handle """
00569         if (0 == strncmp( ",", pvInput, sizeof( char )) &&
00570              0 == cQuotes % 2)
00571             {
00572             if (pLastQuote)
00573                 memcpy( pLastQuote, "", sizeof( char ));
00574             else
00575                 memcpy( pvInput, "", sizeof( char ));
00576
00577             // Increment Columns processed
00578             cColumns++;
00579
00580             //          TRACE(pvCopy ? pvCopy : "<NULL>");
00581             if (FAILED( FillBinding( cColumns, pvCopy )))
00582                 return ResultFromScode( E_FAIL );
00583
00584             pLastQuote = NULL;
00585             pvCopy = NULL;
00586             cQuotes = 0;
00587             goto TermCheck;
00588             }
00589
00590         //Valid First character for next column
00591         if (NULL == pvCopy)
00592             pvCopy = pvInput;
00593
00594         TermCheck:
00595         // Check for Final Null Terminator
00596         if (0 == strncmp( "", (pvInput+1), sizeof(char)))
00597             {
00598             //If we are to the null terminator and have unbalanced "'s
00599             //then we fail
00600             if (0 != cQuotes % 2)
00601                 return ResultFromScode( E_FAIL );
00602
00603             if (pLastQuote)
00604                 memcpy( pLastQuote, "", sizeof(char));
00605
00606             // Increment Columns processed
00607             cColumns++;
00608
00609             //          TRACE(pvCopy ? pvCopy : "<NULL>");
00610             if (FAILED( FillBinding( cColumns, pvCopy )))
00611                 return ResultFromScode( E_FAIL );
00612             }
00613
00614         pvInput++;
00615         }
00616
00617     // Check that we returned the correct number of columns
00618     if (cColumns < m_cColumns)
00619         return ResultFromScode( E_FAIL );
00620
00621     return ResultFromScode( S_OK );
00622 }
00623
00624 //--------------------------------------------------------------------
00625 // @mfunc Based on the given bindings and column data, put the data
00626 // in the correct area, update the status and length fields
00627 //
00628 // @rdesc HRESULT
00629 //      @flag S_OK | Data copied to the specified location
00630 //
00631 HRESULT CFileIO::FillBinding
00632     (
00633     DBORDINAL cColumn, //@parm IN | Column that value is for
00634     LPTSTR    pvCopy   //@parm IN | Pointer to data value to transfer
00635     )
00636 {
00637     assert( m_rgswColType );
00638     assert( m_rgpColumnData );
00639     assert( m_rgsdwMaxLen );
00640
00641     // Null Value
00642     if (!pvCopy)
00643         {
00644         m_rgpColumnData[cColumn]->dwStatus = DBSTATUS_S_ISNULL;
00645         return ResultFromScode( S_OK );
00646         }
00647
00648     switch (m_rgswColType[cColumn])
00649         {
00650     case TYPE_CHAR:
00651         lstrcpyn((LPTSTR) m_rgpColumnData[cColumn]->bData, pvCopy, m_rgsdwMaxLen[cColumn] + sizeof( char ) );
00652         m_rgpColumnData[cColumn]->dwLength = lstrlen( (LPTSTR) m_rgpColumnData[cColumn]->bData );
00653         m_rgpColumnData[cColumn]->dwStatus = DBSTATUS_S_OK;
00654         break;
00655
00656     case TYPE_SLONG:
00657         *(ULONG*) m_rgpColumnData[cColumn]->bData = atol( pvCopy );
00658         m_rgpColumnData[cColumn]->dwLength = 4;
00659         m_rgpColumnData[cColumn]->dwStatus = DBSTATUS_S_OK;
00660         break;
00661
00662     default:
00663         assert( !"Unknown Data Type" );
00664         break;
00665         }
00666
00667     return ResultFromScode( S_OK );
00668 }
00669
00670
00671 //--------------------------------------------------------------------
00672 // @mfunc Given a pointer to the new data and the row the the data is
00673 // for, write the data to the file.
00674 //
00675 // @rdesc HRESULT
00676 //      @flag S_OK | Record and Indexes updated
00677 //      @flag E_FAIL | Problems updating record
00678 //
00679 HRESULT CFileIO::UpdateRow
00680     (
00681     DBCOUNTITEM ulRow,      //@parm IN | Row to update
00682     BYTE*       pbProvRow,  //@parm IN | Data to update row with.
00683   UPDTYPE   eUpdateType //@parm IN | What type of update
00684     )
00685 {
00686     LPSTR       pvInput = m_pvInput;
00687   CHAR    szTmpBuff[MAX_BIND_LEN+1];
00688     PCOLUMNDATA pColData;
00689     DBORDINAL   cCols;
00690     int         nCnt;
00691
00692   assert( is_open());
00693     assert( m_rgdwDataOffsets );
00694
00695   // Fix up Row count
00696   if( eUpdateType == INSERT )
00697     m_cRows++;
00698
00699   // Delete old Row
00700   if( (eUpdateType == UPDATE) &&
00701     (FAILED( DeleteRow( ulRow ))) )
00702       return ResultFromScode( E_FAIL );
00703
00704   // Fix up Row offset value
00705   seekg( 0, ios::end );
00706   m_FileIdx.SetIndex( ulRow, tellg() );
00707
00708     // Check the Row Number
00709     if ((ulRow < 0) || (ulRow > m_cRows))
00710         return ResultFromScode( E_FAIL );
00711
00712     // Updated Rows are added to the end of the file, the row number will
00713     // remain the same until the rowset is closed, because the old
00714     // offset is deleted and the new is put in it's place.
00715     for (cCols = 1; cCols <= m_cColumns; cCols++)
00716         {
00717         nCnt = 0;
00718
00719         pColData = GetColumnData(cCols, (ROWBUFF *)pbProvRow);
00720
00721         // Handle NULL Data
00722         if (pColData->dwStatus != DBSTATUS_S_ISNULL)
00723             {
00724             switch (m_rgswColType[cCols])
00725                 {
00726             case TYPE_CHAR:
00727         strncpy( szTmpBuff, (LPSTR)pColData->bData, pColData->dwLength );
00728         szTmpBuff[pColData->dwLength] = '\0';
00729                 nCnt = wsprintf( pvInput, "\"%s\"", szTmpBuff );
00730                 break;
00731
00732             case TYPE_SLONG:
00733                 nCnt = wsprintf( pvInput, "%d",
00734                     (signed long) *pColData->bData );
00735                 break;
00736
00737             default:
00738                 assert( !"Unknown Data Type" );
00739                 break;
00740
00741                 }
00742
00743             }
00744
00745         //Calculate the next append area
00746         pvInput = (pvInput + (nCnt * sizeof(char)));
00747
00748         if (cCols == m_cColumns)
00749             lstrcat( pvInput, "\n" );
00750         else
00751             {
00752             lstrcat( pvInput, "," );
00753             pvInput = (pvInput + sizeof(char));
00754             }
00755         }
00756
00757     // Write Stream to File
00758   // If Update change in place or InsertRow add to the end
00759   seekg( m_FileIdx.GetRowOffset( ulRow ) );
00760
00761     clear();
00762     write( m_pvInput, lstrlen( m_pvInput ));
00763     if (bad())
00764         return ResultFromScode( E_FAIL );
00765     else
00766         flush();
00767
00768     return ResultFromScode( S_OK );
00769 }
00770
00771
00772 //--------------------------------------------------------------------
00773 // @mfunc Returns ::GetColumnsInfo data
00774 //
00775 // @rdesc HRESULT
00776 //      @flag S_OK | All output populated correctly
00777 //      @flag E_FAIL | Problems gathering Column Information
00778 //
00779 HRESULT CFileIO::GatherColumnInfo()
00780 {
00781     HRESULT         hr;
00782     LPWSTR          lpwstr;
00783     int             cchFree, cchWide;
00784     DBCOLUMNINFO *  pcolinfo = NULL;
00785     DBLENGTH        dwOffset;
00786     DBORDINAL       cCols;
00787     int             cbName;
00788     SWORD           swCSVType;
00789     UDWORD          cbColDef;
00790     DWORD           dwdbtype;
00791   BOOL      fSigned;
00792   SDWORD *    rgcbLen = NULL;
00793   DBLENGTH *    rgdwOffsets = NULL;
00794
00795   // Heap for column names.
00796     // Commit it all, then de-commit and release once we know size.
00797     m_pbHeap = (BYTE *) VirtualAlloc( NULL,
00798                                       MAX_HEAP_SIZE,
00799                                       MEM_RESERVE | MEM_COMMIT,
00800                                       PAGE_READWRITE );
00801
00802   if( !m_pbHeap )
00803   {
00804     hr = ResultFromScode(E_OUTOFMEMORY);
00805     goto EXIT;
00806   }
00807
00808     //----------------------------------
00809     // Gather column info
00810     //----------------------------------
00811
00812     lpwstr  = (LPWSTR) m_pbHeap;
00813     cchFree = MAX_HEAP_SIZE / 2;
00814
00815     pcolinfo  = &(m_rgdbcolinfo[1]);
00816   rgcbLen   = m_rgsdwMaxLen;
00817   rgdwOffsets = m_rgdwDataOffsets;
00818
00819     dwOffset = offsetof( ROWBUFF, cdData );
00820
00821     for (cCols=1; cCols <= m_cColumns; cCols++, pcolinfo++)
00822         {
00823         LPTSTR ptstrName;
00824
00825         // Get Column Names and Lengths
00826         hr = GetColumnName(cCols, &ptstrName);
00827         if (FAILED( hr ))
00828       {
00829             hr = ResultFromScode( E_FAIL );
00830       goto EXIT;
00831       }
00832
00833         // Store the Column Name in the Heap
00834         if (cchFree)
00835             {
00836             cbName = lstrlen( ptstrName );
00837             if (cbName)
00838                 cchWide = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, ptstrName, (int) cbName, lpwstr, cchFree );
00839             else
00840                 cchWide = 0;
00841             pcolinfo->pwszName = lpwstr;
00842             lpwstr += cchWide;
00843
00844             cchFree -= cchWide;
00845             if (cchFree)
00846                 {
00847                 *lpwstr++ = 0;
00848                 cchFree--;
00849                 }
00850             else
00851                 *(lpwstr - 1) = 0;
00852             }
00853         else
00854             pcolinfo->pwszName = NULL;
00855
00856         // Get DataTypes and Precision
00857         hr = GetDataTypes(cCols,
00858                         &swCSVType, // CSV data type
00859                         &cbColDef,  // Precision
00860                         &fSigned  // Signed or Unsigned
00861                         );
00862         if (FAILED( hr ))
00863             return ResultFromScode( E_FAIL );
00864
00865         // We use ordinal numbers for our columns
00866         pcolinfo->columnid.eKind          = DBKIND_GUID_PROPID;
00867         pcolinfo->columnid.uGuid.guid     = GUID_NULL;
00868         pcolinfo->columnid.uName.ulPropid = (ULONG) cCols;
00869
00870         // Determine the OLE DB type, for binding.
00871         hr = GetInternalTypeFromCSVType( swCSVType,         // in
00872                                          fSigned,         // in
00873                                          &dwdbtype );       // out, DBTYPE to show client
00874         if (FAILED( hr ))
00875       {
00876             hr = ResultFromScode( E_FAIL );
00877       goto EXIT;
00878       }
00879
00880         // Check for overflow of size.
00881         rgcbLen[cCols] = cbColDef;
00882         rgcbLen[cCols] = MIN( rgcbLen[cCols], MAX_BIND_LEN );
00883
00884         pcolinfo->iOrdinal    = cCols;
00885         pcolinfo->wType     = (DBTYPE) dwdbtype;
00886         pcolinfo->pTypeInfo     = NULL;
00887         pcolinfo->ulColumnSize  = rgcbLen[cCols];
00888     pcolinfo->bPrecision  = (BYTE) ~0;
00889     pcolinfo->bScale    = (BYTE) ~0;
00890         pcolinfo->dwFlags       = 0;
00891
00892         // Is it a string datatype
00893     if(pcolinfo->wType != DBTYPE_STR)
00894       pcolinfo->bPrecision = (BYTE)cbColDef;
00895
00896         // Is it a fixed length datatype
00897         if(pcolinfo->wType != DBTYPE_STR)
00898           pcolinfo->dwFlags |= DBCOLUMNFLAGS_ISFIXEDLENGTH;
00899
00900         // We do support nulls
00901         pcolinfo->dwFlags |= DBCOLUMNFLAGS_ISNULLABLE;
00902         pcolinfo->dwFlags |= DBCOLUMNFLAGS_MAYBENULL;
00903
00904         //We should always be able to write to the column
00905         pcolinfo->dwFlags |= DBCOLUMNFLAGS_WRITE;
00906
00907         // Set the offset from the start of the row,
00908         // for this column, then advance past.
00909         dwOffset = ROUND_UP( dwOffset, COLUMN_ALIGNVAL );
00910         rgdwOffsets[cCols] = dwOffset;
00911         dwOffset += offsetof( COLUMNDATA, bData ) + rgcbLen[cCols];
00912         }
00913
00914     m_cbRowSize = ROUND_UP( dwOffset, COLUMN_ALIGNVAL );
00915     m_cbHeapUsed = MAX_HEAP_SIZE - 2*cchFree;
00916
00917     // Decommit unused memory in our column-name buffer.
00918     // We know it will never grow beyond what it is now.
00919     // Decommit all pages past where we currently are.
00920     BYTE  *pDiscardPage;
00921     ptrdiff_t  ulSize;
00922     pDiscardPage = (BYTE *) ROUND_UP( lpwstr, g_dwPageSize );
00923     ulSize       = MAX_HEAP_SIZE - (pDiscardPage - m_pbHeap);
00924     if (ulSize > 0)
00925         VirtualFree( pDiscardPage, ulSize, MEM_DECOMMIT );
00926     assert( '\0' == (*lpwstr = '\0'));  // We shouldn't generate a mem fault.
00927
00928 EXIT:
00929   if( FAILED(hr) )
00930   {
00931     if( m_pbHeap )
00932     {
00933       VirtualFree((VOID *) m_pbHeap, 0, MEM_RELEASE );
00934     }
00935     m_cbRowSize = m_cbHeapUsed = 0;
00936     return hr;
00937   }
00938   else
00939     return ResultFromScode( S_OK );
00940 }
00941
00942 //--------------------------------------------------------------------
00943 // @mfunc Given a ROWBUFF and a column ordinal, this function
00944 // returns a ptr to a particular column's COLUMNDATA
00945 //
00946 //
00947 COLUMNDATA * CFileIO::GetColumnData
00948 (
00949   DBORDINAL cCols,
00950   ROWBUFF * pRowBuff
00951 )
00952 {
00953     assert( is_open());
00954     assert( m_rgdwDataOffsets );
00955
00956     // If the column number is in range then return
00957     // the pointer
00958     if ((0 == cCols) || (m_cColumns < cCols))
00959         return NULL;
00960
00961     return (COLUMNDATA *)((BYTE *)pRowBuff + m_rgdwDataOffsets[cCols]);
00962 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/basedialog.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

basedialog.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  BaseDialog.h:  Interface for the CBaseDialog class.  This is the base
00014 //                 class for modeless dialogs.
00015 //
00016
00017
00018 #ifndef _CLASS_BASEDIALOG_
00019 #define _CLASS_BASEDIALOG_
00020
00021 #include <Windows.h>
00022
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CBaseDialog
00031 {
00032   private:
00033     HWND     m_hWnd;         // Handle from CreateDialogParam
00034     ULONG    m_nTemplate;    // Dialog template ID
00035     DLGPROC  m_DlgProc;      // Points to Dialog Proc
00036     DWORD    m_dwFlags;      // Create flags
00037
00038   public:
00039     CBaseDialog( ULONG nTemplate = 0 );
00040     virtual ~CBaseDialog();
00041
00042     virtual HWND Create( HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags = 0 );
00043
00044   protected:
00045     static BOOL CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00046
00047     virtual LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00048     virtual LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00049     virtual LRESULT OnCancel( HWND hDlg, WPARAM wParam, LPARAM lParam );
00050     virtual LRESULT OnNcDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00051     virtual LRESULT OnDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00052     virtual LRESULT OnClose( HWND hDlg, WPARAM wParam, LPARAM lParam );
00053
00054   public:
00055     virtual BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0;
00056
00057 };
00058
00059
00060 #endif //_CLASS_BASEDIALOG_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/DfV.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

DfV.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       DFV.h
00007 //
00008 //  Contents:   globally defined constants, IDs and structures
00009 //
00010 //  History:    6-08-94   stevebl   Created
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #ifndef __DFV_H__
00015 #define __DFV_H__
00016
00017 #include <windows.h>
00018 #include <ole2.h>
00019 #include "message.h"
00020
00021 // String Constants
00022 #define VER_FILEDESCRIPTION_STR     "Windows NT Docfile Viewer"
00023 #define VER_INTERNALNAME_STR        "DocFile Viewer"
00024 #define VER_ORIGINALFILENAME_STR    "DFVIEW.exe"
00025 #define HELPFILE_STR                "OLETools.hlp"
00026 #define MAIN_WINDOW_CLASS_NAME      "MainDFVWindow"
00027 #define MAIN_WINDOW_CLASS_MENU      MainDFVMenu
00028 #define MAIN_WINDOW_CLASS_MENU_STR  "MainDFVMenu"
00029 #define STREAM_VIEW_CLASS_NAME      "Stream Viewer"
00030
00031 // Menu Command Identifiers
00032 #define IDM_EXIT                    1000
00033 #define IDM_OPEN                    1001
00034 #define IDM_CLOSE                   1002
00035 #define IDM_EXPAND                  1100
00036 #define IDM_EXPANDBRANCH            1101
00037 #define IDM_EXPANDALL               1102
00038 #define IDM_COLLAPSE                1103
00039 #define IDM_COLLAPSEALL             1104
00040 #define IDM_TOGGLE                  1105
00041 #define IDM_HELP                    1200
00042 #define IDM_ABOUT                   1201
00043
00044 // Listbox Identifiers
00045 #define IDC_LISTBOX                 4000
00046 #define IDC_STREAMVIEW              4001
00047
00048 // Bitmap Identifiers
00049 #define BMP_STREAM                  3000
00050 #define BMP_STORAGE                 3001
00051 // String Identifiers
00052 #define IDS_ERROR                   2000
00053 #define IDS_NOHELPFILE              2001
00054 #define IDS_OLEINCOMPATIBLE         2002
00055 #define IDS_OLEINITFAILED           2003
00056 #define IDS_ENUMSTATSTGFAILED       2004
00057 #define IDS_OPENSTORAGEFAILED       2005
00058 #define IDS_OPENSTREAMFAILED        2006
00059 #define IDS_ENUMELEMENTSFAILED      2007
00060 #define IDS_INSERTSTRINGFAILED      2008
00061 #define IDS_LOADBITMAPSFAILED       2009
00062 #define IDS_STGOPENSTORAGEFAILED    2010
00063 #define IDS_STMSTATFAILED           2011
00064 #define IDS_STMSEEKFAILED           2012
00065 #define IDS_STMREADFAILED           2013
00066 #define IDS_STMTITLETEXT            2014
00067 #define IDS_OUTOFMEMORY             2015
00068
00069 #endif // __DFV_H__
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/GenCtrnm.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen

GenCtrnm.h

Go to the documentation of this file.
00001 //
00002 //  genctrnm.h
00003 //
00004 //  Offset definition file for exensible counter objects and counters
00005 //
00006 //  These "relative" offsets must start at 0 and be multiples of 2 (i.e.
00007 //  even numbers). In the Open Procedure, they will be added to the
00008 //  "First Counter" and "First Help" values fo the device they belong to,
00009 //  in order to determine the  absolute location of the counter and
00010 //  object names and corresponding help text in the registry.
00011 //
00012 //  this file is used by the extensible counter DLL code as well as the
00013 //  counter name and help text definition file (.INI) file that is used
00014 //  by LODCTR to load the names into the registry.
00015 //
00016 #define SIGGEN_OBJ      0
00017 #define SINE_WAVE       2
00018 #define TRIANGLE_WAVE   4
00019 #define SQUARE_WAVE     6
00020 #define CONSTANT_VALUE  8
00021 
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBaseNode Member List

This is the complete list of members for CBaseNode, including all inherited members.
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed)=0 | CBaseNode | [pure virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed)=0 | CBaseNode | [pure virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed)=0 | CBaseNode | [pure virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed)=0 | CBaseNode | [pure virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed)=0 | CBaseNode | [pure virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed)=0 | CBaseNode | [pure virtual]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
Command(long lCommandID)=0 | CBaseNode | [pure virtual]
Command(long lCommandID)=0 | CBaseNode | [pure virtual]
Command(long lCommandID)=0 | CBaseNode | [pure virtual]
Command(long lCommandID)=0 | CBaseNode | [pure virtual]
Command(long lCommandID)=0 | CBaseNode | [pure virtual]
Command(long lCommandID)=0 | CBaseNode | [pure virtual]
ControlbarNotify(LPARAM nArg, LPARAM lParam, LONG_PTR pComp)=0 | CBaseNode | [pure virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle)=0 | CBaseNode | [pure virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle)=0 | CBaseNode | [pure virtual]
GetAttributes()=0 | CBaseNode | [pure virtual]
GetAttributeString()=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI)=0 | CBaseNode | [pure virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI)=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeGUID()=0 | CBaseNode | [pure virtual]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetNodeType()=0 | CBaseNode | [pure virtual]
GetObjectPath()=0 | CBaseNode | [pure virtual]
GetProperties(LPNODEPROPS *ppNodeProps)=0 | CBaseNode | [pure virtual]
GetProperty(BSTR szPropertyName, PBSTR pbstrProperty)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo)=0 | CBaseNode | [pure virtual]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch)=0 | CBaseNode | [pure virtual]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch)=0 | CBaseNode | [pure virtual]
Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
Initialize(LPNODEPROPS pNodeProps)=0 | CBaseNode | [pure virtual]
Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
Initialize(NODE_PROPERTIES *pProperties)=0 | CBaseNode | [pure virtual]
IsAttributeSet(DWORD dwAttribute)=0 | CBaseNode | [pure virtual]
m_dwAttributes | CBaseNode |
m_nPropPageCount | CBaseNode | [protected]
m_pAttributeStr | CBaseNode |
m_pwszNodeName | CBaseNode | [protected]
m_RDI | CBaseNode |
m_SDI | CBaseNode |
OnContextHelp(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnCutOrMove(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnDelete(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnQueryPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData)=0 | CBaseNode | [pure virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CBaseNode | [inline, virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CBaseNode | [inline, virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CBaseNode | [inline, virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent)=0 | CBaseNode | [pure virtual]
QueryForPropertyPage()=0 | CBaseNode | [pure virtual]
QueryForPropertyPage()=0 | CBaseNode | [pure virtual]
RemoveAttribute(DWORD dwAttribute)=0 | CBaseNode | [pure virtual]
SetAttribute(DWORD dwAttribute)=0 | CBaseNode | [pure virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
Generated on Wed Nov 13 2024 16:55:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/rcvall/rcvall.c Source File

  • NetDS
  • WinSock
  • rcvall

rcvall.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //    rcvall.c
00010 //
00011 // Abstract:
00012 //    This sample shows how to use the ioctls SIO_RCVALL,
00013 //    SIO_RCVALL_MCAST, and SIO_RCVALL_IGMPMCAST. This sample
00014 //    captures all packets of the given type and also is able
00015 //    to set filters on source and destination IP addresses
00016 //    and ports. This sample is Windows 2000 only.
00017 //
00018 // Usage:
00019 //    rcvall.exe -t ip|igmp|multicast -i address -sa address -sp port
00020 //               -da address -dp port
00021 //           -t string           Filter traffic type
00022 //                 ip            Capture all IP packets
00023 //                 igmp          Capture all IGMP packets only
00024 //                 multicast     Capture all multicast IP packets
00025 //           -i address          Capture on this interface
00026 //           -sa address         Filter on source address
00027 //           -sp port            Filter on source port
00028 //           -da address         Filter on dest address
00029 //           -dp port            Filter on dest port
00030 //
00031 // Build:
00032 //    cl rcvall.c parser.c resolve.c ws2_32.lib
00033 //
00034 //       OR
00035 //
00036 //    nmake.exe
00037 //
00038
00039 #ifdef _IA64_
00040     #pragma warning(disable:4127 4706)
00041 #endif
00042
00043 #include <winsock2.h>
00044 #include <mstcpip.h>
00045 #include <ws2tcpip.h>
00046
00047 #include "parser.h"
00048 #include "resolve.h"
00049
00050 #include <stdio.h>
00051 #include <stdlib.h>
00052
00053 //
00054 // Global Variables
00055 //
00056 SOCKADDR_STORAGE g_saLocalInterface = {0};
00057 DWORD            g_dwIoControlCode=SIO_RCVALL,
00058 g_dwProtocol=IPPROTO_IP;
00059 int              g_iAddressFamily=AF_UNSPEC;
00060
00061 int              g_iFamilyMap[] = {AF_INET, AF_INET6};
00062
00063
00064 //
00065 // Filter Global Variables
00066 //
00067 SOCKADDR_STORAGE g_saSourceAddress = {0},         // Source address to filter
00068 g_saDestinationAddress = {0};    // Destination address to filter
00069 unsigned long    g_ulFilterMask=0;          // Indicates which fields in IP hdr to
00070                                             //    filter on.
00071
00072 //
00073 // Function Prototypes
00074 //
00075 void usage(char *progname);
00076 int  ValidateArgs(int argc, char **argv);
00077 void PrintInterfaceList();
00078
00079 //
00080 // Function: usage
00081 //
00082 // Description:
00083 //    Prints usage information.
00084 //
00085 void usage(char *progname)
00086 {
00087     printf("usage: %s -t traffic-type -i address ...\n\n", progname);
00088     printf("       -t string           Filter traffic type\n");
00089     printf("             Available traffic types:\n");
00090     printf("               ip          Capture all IP packets\n");
00091     printf("               igmp        Capture all IGMP packets only\n");
00092     printf("               multicast   Capture all multicast IP packets\n");
00093     printf("       -i address          Capture on this interface\n");
00094     printf("             Available interfaces:\n");
00095     PrintInterfaceList();
00096     printf("       -sa address         Filter on source address\n");
00097     printf("       -sp Port            Filter on source port\n");
00098     printf("       -da address         Filter on dest address\n");
00099     printf("       -dp Port            Filter on dest port\n");
00100
00101     WSACleanup();
00102     ExitProcess((UINT)-1);
00103 }
00104
00105 //
00106 // Function: ValidateArgs
00107 //
00108 // Description:
00109 //    This function parses the command line arguments and
00110 //    sets global variables to indicate how the app should act.
00111 //
00112 int ValidateArgs(int argc, char **argv)
00113 {
00114     struct addrinfo *resif=NULL,
00115     *ressrc=NULL,
00116     *resdest=NULL;
00117     char  *lpInterface=NULL,
00118     *lpSourceAddress=NULL,
00119     *lpDestinationAddress=NULL,
00120     *lpSourcePort=NULL,
00121     *lpDestinationPort=NULL;
00122     int    rc = 0, i = 0;
00123
00124     rc = NO_ERROR;
00125     memset(&g_saLocalInterface, 0, sizeof(g_saLocalInterface));
00126     memset(&g_saSourceAddress,  0, sizeof(g_saSourceAddress));
00127     memset(&g_saDestinationAddress, 0, sizeof(g_saDestinationAddress));
00128
00129     //
00130     // Parse the command line
00131     //
00132     for (i=1; i < argc ;i++)
00133     {
00134         if ((strlen(argv[i]) >= 2) && ((argv[i][0] == '-') || (argv[i][0] == '/')))
00135         {
00136             switch (tolower(argv[i][1]))
00137             {
00138             case 't':        // traffic type
00139                 if (i+1 >= argc)
00140                     return SOCKET_ERROR;
00141
00142                 if ( _strnicmp(argv[i+1], "ip", 2) == 0 )
00143                 {
00144                     g_dwIoControlCode = SIO_RCVALL;
00145                 } else if ( _strnicmp(argv[i+1], "igmp", 4) == 0 )
00146                 {
00147                     g_dwIoControlCode = SIO_RCVALL_IGMPMCAST;
00148                     g_dwProtocol = IPPROTO_IGMP;
00149                 } else if ( _strnicmp(argv[i+1], "multicast", 9) == 0 )
00150                 {
00151                     g_dwIoControlCode = SIO_RCVALL_MCAST;
00152                 } else
00153                 {
00154                     return SOCKET_ERROR;
00155                 }
00156                 i++;
00157                 break;
00158             case 'i':        // interface number
00159                 lpInterface = argv[++i];
00160                 break;
00161             case 's':        // Filter on source ip or port
00162                 if ((i+1 >= argc) || (strlen(argv[i]) != 3))
00163                     return SOCKET_ERROR;
00164
00165                 if ( tolower(argv[i][2]) == 'a' )
00166                 {
00167                     lpSourceAddress = argv[++i];
00168                     g_ulFilterMask |= FILTER_MASK_SOURCE_ADDRESS;
00169                 } else if ( tolower(argv[i][2]) == 'p' )
00170                 {
00171                     lpSourcePort = argv[++i];
00172                     g_ulFilterMask |= FILTER_MASK_SOURCE_PORT;
00173                 } else
00174                 {
00175                     return SOCKET_ERROR;
00176                 }
00177                 break;
00178             case 'd':        // Filter on dest ip or port
00179                 if ((i+1 >= argc) || (strlen(argv[i]) != 3))
00180                     return SOCKET_ERROR;
00181
00182                 if ( tolower(argv[i][2]) == 'a' )
00183                 {
00184                     lpDestinationAddress = argv[++i];
00185                     g_ulFilterMask |= FILTER_MASK_DESTINATION_ADDRESS;
00186                 } else if ( tolower(argv[i][2]) == 'p' )
00187                 {
00188                     lpDestinationPort = argv[++i];
00189                     g_ulFilterMask |= FILTER_MASK_DESTINATION_PORT;
00190                 } else
00191                 {
00192                     return SOCKET_ERROR;
00193                 }
00194                 break;
00195             default:
00196                 return SOCKET_ERROR;
00197             }
00198         }
00199     }
00200
00201     // Validate required arguments
00202     if (lpInterface == NULL)
00203     {
00204         fprintf(stderr, "\nA local interface must be specified!\n\n");
00205         return SOCKET_ERROR;
00206     }
00207
00208     // Attempt to resolve the local interface
00209     resif = ResolveAddress(lpInterface, "0", g_iAddressFamily, 0, 0);
00210     if (resif == NULL)
00211     {
00212         fprintf(stderr, "\nUnable to resolve address %s, error = %d\n\n",
00213                 lpInterface, WSAGetLastError());
00214         return SOCKET_ERROR;
00215     }
00216
00217     // For SIO_RCVALL we may need to adjust the protocol value
00218     if ((g_dwIoControlCode == SIO_RCVALL) || (g_dwIoControlCode == SIO_RCVALL_MCAST))
00219     {
00220         if (resif->ai_family == AF_INET)
00221             g_dwProtocol = IPPROTO_IP;
00222         else if (resif->ai_family == AF_INET6)
00223             g_dwProtocol = IPPROTO_IPV6;
00224     }
00225
00226     // Copy the interface address
00227     memcpy(&g_saLocalInterface, resif->ai_addr, resif->ai_addrlen);
00228
00229     // Resolve the source address to filter on, if supplied
00230     if ((lpSourceAddress) || (lpSourcePort))
00231     {
00232         ressrc = ResolveAddress(lpSourceAddress, lpSourcePort, resif->ai_family, 0, 0);
00233         if (ressrc == NULL)
00234         {
00235             fprintf(stderr, "\nUnable to resolve source filter: %d\n\n",
00236                     WSAGetLastError());
00237             rc = SOCKET_ERROR;
00238         } else
00239         {
00240             // Copy the source address filter
00241             memcpy(&g_saSourceAddress, ressrc->ai_addr, ressrc->ai_addrlen);
00242
00243             freeaddrinfo(ressrc);
00244         }
00245     }
00246
00247     // Resolve the destination address to filter on, if supplied
00248     if ((lpDestinationAddress) || (lpDestinationPort))
00249     {
00250         resdest = ResolveAddress(lpDestinationAddress, lpDestinationPort, resif->ai_family, 0, 0);
00251         if (resdest == NULL)
00252         {
00253             fprintf(stderr, "\nUnable to resolve destination filter: %d\n\n",
00254                     WSAGetLastError());
00255             rc = SOCKET_ERROR;
00256         } else
00257         {
00258             // Copy the destination address filter
00259             memcpy(&g_saDestinationAddress, resdest->ai_addr, resdest->ai_addrlen);
00260
00261             freeaddrinfo(resdest);
00262         }
00263     }
00264
00265     freeaddrinfo(resif);
00266
00267     return rc;
00268 }
00269
00270 //
00271 // Function: PrintInterfaceList
00272 //
00273 // Description:
00274 //    This function prints all local IP interfaces.
00275 //
00276 void PrintInterfaceList()
00277 {
00278     SOCKET_ADDRESS_LIST *slist=NULL;
00279     SOCKET               s = INVALID_SOCKET;
00280     char                *buf=NULL;
00281     DWORD                dwBytesRet = 0;
00282     int                  rc = 0,
00283     i  = 0, j = 0, k = 0;
00284
00285     k = 0;
00286     for (i=0; i < sizeof(g_iFamilyMap)/sizeof(int) ;i++)
00287     {
00288         s = socket(g_iFamilyMap[i], SOCK_STREAM, 0);
00289         if (s != INVALID_SOCKET)
00290         {
00291             rc = WSAIoctl(
00292                          s,
00293                          SIO_ADDRESS_LIST_QUERY,
00294                          NULL,
00295                          0,
00296                          NULL,
00297                          0,
00298                          &dwBytesRet,
00299                          NULL,
00300                          NULL
00301                          );
00302             if ((rc == SOCKET_ERROR) && (GetLastError() == WSAEFAULT))
00303             {
00304                 char addrbuf[INET6_ADDRSTRLEN] = {'\0'};
00305
00306                 // Allocate the necessary size
00307                 buf = (char *)HeapAlloc(GetProcessHeap(), 0, dwBytesRet);
00308                 if (buf == NULL)
00309                 {
00310                     if(INVALID_SOCKET != s)
00311                     {
00312                         closesocket(s);
00313                         s = INVALID_SOCKET;
00314                     }
00315
00316                     return;
00317                 }
00318
00319                 rc = WSAIoctl(
00320                              s,
00321                              SIO_ADDRESS_LIST_QUERY,
00322                              NULL,
00323                              0,
00324                              buf,
00325                              dwBytesRet,
00326                              &dwBytesRet,
00327                              NULL,
00328                              NULL
00329                              );
00330                 if (rc == SOCKET_ERROR)
00331                 {
00332                     if (buf) HeapFree(GetProcessHeap(), 0, buf);
00333                     if (INVALID_SOCKET != s)
00334                     {
00335                         closesocket(s);
00336                         s = INVALID_SOCKET;
00337                     }
00338                     return;
00339                 }
00340
00341                 // Display the addresses
00342                 slist = (SOCKET_ADDRESS_LIST *)buf;
00343                 for (j=0; j < slist->iAddressCount ;j++)
00344                 {
00345                     FormatAddress(
00346                                  slist->Address[j].lpSockaddr,
00347                                  slist->Address[j].iSockaddrLength,
00348                                  addrbuf,
00349                                  INET6_ADDRSTRLEN
00350                                  );
00351                     printf("               %-2d ........ %s\n",
00352                            ++k, addrbuf);
00353                 }
00354
00355                 if(buf) HeapFree(GetProcessHeap(), 0, buf);
00356
00357             } else
00358             {
00359                 // Unexpected failure
00360                 fprintf(stderr, "WSAIoctl: SIO_ADDRESS_LIST_QUERY failed with unexpected error: %d\n",
00361                         WSAGetLastError());
00362             }
00363             if (INVALID_SOCKET != s)
00364             {
00365                 closesocket(s);
00366                 s = INVALID_SOCKET;
00367             }
00368         } else
00369         {
00370             fprintf(stderr, "socket failed: %d\n", WSAGetLastError());
00371             return;
00372         }
00373     }
00374     return;
00375 }
00376
00377 //
00378 // Function: main
00379 //
00380 // Description:
00381 //    This function loads Winsock, parses the command line, and
00382 //    begins receiving packets. Once a packet is received they
00383 //    are decoded. Because we are receiving IP datagrams, the
00384 //    receive call will return whole datagrams.
00385 //
00386 int __cdecl main(int argc, char **argv)
00387 {
00388     SOCKET        s = INVALID_SOCKET;
00389     WSADATA       wsd;
00390     WSABUF        wbuf = {0};
00391     DWORD         dwBytesRet = 0, dwFlags = 0;
00392     unsigned int  optval = 0;
00393     char         *rcvbuf=NULL;
00394     int           rc = 0, err;
00395
00396     //
00397     // Load Winsock
00398     //
00399     if ((rc = WSAStartup(MAKEWORD(2,2), &wsd)) != 0)
00400     {
00401         printf("WSAStartup() failed: %d\n", rc);
00402         return -1;
00403     }
00404
00405     //
00406     // Parse the command line
00407     //
00408     if (ValidateArgs(argc, argv) == SOCKET_ERROR)
00409     {
00410         usage(argv[0]);
00411     }
00412
00413     if ( g_ulFilterMask & (FILTER_MASK_SOURCE_ADDRESS | FILTER_MASK_SOURCE_PORT) )
00414     {
00415         printf("Source address filter     : ");
00416         PrintAddress((SOCKADDR *)&g_saSourceAddress, sizeof(g_saSourceAddress));
00417         printf("\n");
00418     }
00419     if ( g_ulFilterMask & (FILTER_MASK_DESTINATION_ADDRESS | FILTER_MASK_DESTINATION_PORT) )
00420     {
00421         printf("Destination address filter: ");
00422         PrintAddress((SOCKADDR *)&g_saDestinationAddress, sizeof(g_saDestinationAddress));
00423         printf("\n");
00424     }
00425
00426     //
00427     // Create a raw socket for receiving IP datagrams
00428     //
00429     s = WSASocket(g_saLocalInterface.ss_family, SOCK_RAW, g_dwProtocol, NULL, 0, WSA_FLAG_OVERLAPPED);
00430     if (s == INVALID_SOCKET)
00431     {
00432         printf("WSASocket() failed: %d\n", WSAGetLastError());
00433         return -1;
00434     }
00435
00436     //
00437     // This socket MUST be bound before calling the ioctl
00438     //
00439     rc = bind(s, (SOCKADDR *)&g_saLocalInterface, sizeof(g_saLocalInterface));
00440     if (rc == SOCKET_ERROR)
00441     {
00442         printf("bind() failed: %d\n", WSAGetLastError());
00443         if (INVALID_SOCKET != s)
00444         {
00445             closesocket(s);
00446             s = INVALID_SOCKET;
00447         }
00448         WSACleanup();
00449         return -1;
00450     }
00451     printf("Binding to: ");
00452     PrintAddress((SOCKADDR *)&g_saLocalInterface, sizeof(g_saLocalInterface));
00453     printf("\n");
00454
00455     //
00456     // Set the SIO_RCVALLxxx ioctl
00457     //
00458     optval = 1;
00459     rc = WSAIoctl(s, g_dwIoControlCode, &optval, sizeof(optval),
00460                   NULL, 0, &dwBytesRet, NULL, NULL);
00461     if (rc == SOCKET_ERROR)
00462     {
00463         printf("WSAIotcl(0x%x) failed: %d\n", g_dwIoControlCode,
00464                (err = WSAGetLastError()));
00465         if (err == WSAEINVAL)
00466         {
00467             printf("NOTE: IPv6 does not currently support the SIO_RCVALL* ioctls\n");
00468         }
00469
00470         if (INVALID_SOCKET != s)
00471         {
00472             closesocket(s);
00473             s = INVALID_SOCKET;
00474         }
00475         WSACleanup();
00476         return -1;
00477     }
00478
00479     //
00480     // Allocate a buffer for receiving data
00481     //
00482     rcvbuf = (char *)HeapAlloc(GetProcessHeap(), 0, MAX_IP_SIZE);
00483     if (rcvbuf == NULL)
00484     {
00485         fprintf(stderr, "HeapAlloc failed: %d\n", GetLastError());
00486         if (INVALID_SOCKET != s)
00487         {
00488             closesocket(s);
00489             s = INVALID_SOCKET;
00490         }
00491         WSACleanup();
00492         return -1;
00493     }
00494
00495     //
00496     // Start receiving IP datagrams until interrupted
00497     //
00498     while (1)
00499     {
00500         wbuf.len = MAX_IP_SIZE;
00501         wbuf.buf = rcvbuf;
00502         dwFlags  = 0;
00503
00504         rc = WSARecv(s, &wbuf, 1, &dwBytesRet, &dwFlags, NULL, NULL);
00505         if (rc == SOCKET_ERROR)
00506         {
00507             printf("WSARecv() failed: %d\n", WSAGetLastError());
00508             break;
00509         }
00510         // Decode the IP header
00511         //
00512         rc = DecodeIPHeader(
00513                            rcvbuf,
00514                            dwBytesRet,
00515                            g_ulFilterMask,
00516                            (SOCKADDR *)&g_saSourceAddress,
00517                            (SOCKADDR *)&g_saDestinationAddress
00518                            );
00519         if (rc != NO_ERROR)
00520         {
00521             printf("Error decoding IP header!\n");
00522             break;
00523         }
00524     }
00525     //
00526     // Cleanup
00527     //
00528
00529     if (rcvbuf) HeapFree(GetProcessHeap(), 0, rcvbuf);
00530
00531     if (INVALID_SOCKET != s)
00532     {
00533         closesocket(s);
00534         s = INVALID_SOCKET;
00535     }
00536     WSACleanup();
00537
00538     return 0;
00539 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/StdAfx.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

StdAfx.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #if !defined(AFX_STDAFX_H__A9B39075_AAD0_11D0_B183_00AA00BA3258__INCLUDED_)
00018 #define AFX_STDAFX_H__A9B39075_AAD0_11D0_B183_00AA00BA3258__INCLUDED_
00019
00020 #if _MSC_VER >= 1000
00021 #pragma once
00022 #endif // _MSC_VER >= 1000
00023
00024 #define STRICT
00025
00026
00027 #if !defined(_WIN32_WINNT)
00028 #define _WIN32_WINNT 0x0500
00029 #endif // !defined(_WIN32_WINNT)
00030
00031 #define _ATL_APARTMENT_THREADED
00032
00033
00034 #include <atlbase.h>
00035 #include "commctrl.h"
00036 #include <comsvcs.h>
00037 //You may derive a class from CComModule and use it if you want to override
00038 //something, but do not change the name of _Module
00039 extern CComModule _Module;
00040 #include <atlcom.h>
00041 #include <atlctl.h>
00042 #define SafeRelease(pUnk) {if (pUnk){pUnk -> Release();pUnk = NULL; }}
00043 #pragma warning( disable : 4786) // disable the warning "identifier was truncated to '255' characters in the debug information" generated by STL
00044 #include <list>
00045 #include <map>
00046 #include <string>
00047 #include <ocidl.h>  // Added by ClassView
00048 using namespace std;
00049
00050
00051 class CAppInfo;
00052 interface ICOMSysLCE;
00053
00054 typedef map <string, CAppInfo *> MapStringToAppInfo;
00055 typedef map <int, ICOMSysLCE*> SUBSCRIBERMAP;
00056
00057
00058 #define _ATL_DEBUG_QI
00059 #define _ATL_DEBUG_REFCOUNT
00060
00061
00062 //{{AFX_INSERT_LOCATION}}
00063 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00064
00065 #endif // !defined(AFX_STDAFX_H__A9B39075_AAD0_11D0_B183_00AA00BA3258__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCommand Member List

This is the complete list of members for CCommand, including all inherited members.
Abort(HCHAPTER hChapter, DBASYNCHOP eOperation) | CAsynchBase | [virtual]
AddRefAccessor(HACCESSOR hAccessor) | CDataAccess | [virtual]
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CCommand | [virtual]
AutoRelease() | CCommand | [virtual]
CAsynchBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CAsynchBase |
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CBaseObj(EBaseObjectType botVal) | CBaseObj | [protected]
CCommand(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CCommand |
CCommand(CDBSession *pCSession, LPUNKNOWN pUnkOuter) | CCommand |
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CDataAccess(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CDataAccess |
CheckCanceledHelper() | CCommand |
CImpIAccessor class | CCommand | [friend]
CImpIColumnsInfo class | CCommand | [friend]
CImpICommandProperties class | CCommand | [friend]
CImpICommandText class | CCommand | [friend]
CImpIConvertType class | CCommand | [friend]
CreateAccessor(DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings, const DBBINDING *rgBindings, DBLENGTH cRowSize, HACCESSOR *phAccessor) | CDataAccess | [virtual]
CreateAccessors(BINDCOLS eBindCols) | CDataAccess | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CreateParamAccessor(DB_UPARAMS cParams, DBPARAMINFO *rgParamInfo, DB_UPARAMS cParamSets) | CCommand | [virtual]
DecrementOpenRowsets() | CCommand | [inline]
DisplayObject() | CBase | [virtual]
Execute(CAggregate *pCAggregate, WCHAR *pwszCommandText, REFIID riid, BOOL fUseParams, DBROWCOUNT *pcRowsAffected, IUnknown **ppIUnknown, BOOL fCommandStream=FALSE) | CCommand | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
FInit() | CCommand |
GetBaseObjectType() | CBaseObj | [inline]
GetBaseType() | CBase | [inline]
GetColInfo() | CDataAccess | [virtual]
GetColInfo(DBORDINAL *pcColumns, DBCOLUMNINFO **prgColumnInfo, WCHAR **ppStringBuffer, DBORDINAL *pcHiddenColumns) | CDataAccess | [virtual]
GetColumnData(const DBBINDING *pBinding, void *pData, DBSTATUS *pdbStatus, DBLENGTH *pdbLength, DBTYPE *pwSubType, WCHAR *pwszValue, ULONG ulMaxSize, DWORD dwFlags, DBTYPE wBackendType) | CDataAccess | [virtual]
GetColumnImage(const DBCOLUMNINFO *pColInfo, DBSTATUS dbStatus=DBSTATUS_S_OK) | CDataAccess | [virtual]
GetColumnsRowset(CAggregate *pCAggregate, bool fOptColumns, REFIID riid, ULONG cPropSets, DBPROPSET *rgPropSets, IUnknown **ppIUnknown) | CDataAccess | [virtual]
GetCommandText() | CCommand | [inline]
GetCurrentCommand(DBID **ppCommandID) | CCommand | [virtual]
GetDefaultInterface() | CCommand | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CCommand | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CCommand | [inline, virtual]
GetObjectMenu() | CCommand | [inline, virtual]
GetObjectName() | CCommand | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetOuterUnknown() | CBaseObj | [inline]
GetParameterInfo(DB_UPARAMS *pcParams, DBPARAMINFO **prgParamInfo, OLECHAR **ppwszNamesBuffer) | CCommand | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase, LPOLESTR *ppwszStatusText) | CAsynchBase | [virtual]
IncrementOpenRowsets() | CCommand | [inline]
Initialize() | CAsynchBase | [virtual]
IsCommandSet() | CCommand | [inline]
IsInitialized() | CAsynchBase | [inline, virtual]
IsRowsetOpen() | CCommand | [inline]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_Bindings | CDataAccess |
m_bSchemaRowset | CDataAccess |
m_cbRowSize | CDataAccess |
m_ColumnInfo | CDataAccess |
m_cRef | CCommand | [protected]
m_cRowsetsOpen | CCommand | [protected]
m_dwCLSCTX | CBase |
m_dwCookieAsynchNotify | CAsynchBase |
m_dwStatus | CCommand | [protected]
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_fInitialized | CAsynchBase |
m_guidCmdDialect | CCommand | [protected]
m_guidDialect | CCommand |
m_guidImpersonate | CCommand | [protected]
m_guidSource | CBase |
m_hAccessor | CDataAccess |
m_hBmkAccessor | CDataAccess |
m_hTreeItem | CBase |
m_Parameters | CCommand |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pCSession | CCommand |
m_pData | CDataAccess |
m_pIAccessor | CCommand | [protected]
m_pIAggregate | CBase |
m_pIColumnsInfo | CCommand | [protected]
m_pIColumnsRowset | CDataAccess |
m_pICommand | CCommand |
m_pICommandPersist | CCommand |
m_pICommandPrepare | CCommand |
m_pICommandProperties | CCommand |
m_pICommandProperties | CCommand | [protected]
m_pICommandStream | CCommand |
m_pICommandText | CCommand |
m_pICommandText | CCommand | [protected]
m_pICommandWithParameters | CCommand |
m_pIConnectionPointContainer | CContainerBase |
m_pIConvertType | CCommand | [protected]
m_pIDBAsynchStatus | CAsynchBase |
m_pIDBInitialize | CAsynchBase |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_pUnkOuter | CBaseObj | [protected]
m_pUtilProp | CCommand | [protected]
m_strCmdText | CCommand | [protected]
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
Prepare(ULONG cExpectedRuns) | CCommand | [virtual]
QueryInterface(REFIID, LPVOID *) | CCommand |
CDataAccess::QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseAccessor(HACCESSOR *phAccessor, BOOL fReleaseAlways=FALSE) | CDataAccess | [virtual]
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetColumnData(const DBBINDING *pBinding, void *pData, DBSTATUS dbStatus, DBLENGTH dbLength, WCHAR *pwszValue, DWORD dwFlags, DBTYPE wBackendType) | CDataAccess | [virtual]
SetCommandStream(WCHAR *pwszText, REFIID riid=IID_ISequentialStream, GUID *pGuidDialect=NULL, BOOL fUnicode=TRUE) | CCommand | [virtual]
SetCommandText(WCHAR *pwszText, GUID *pGuidDialect=NULL) | CCommand | [virtual]
SetImpersonateIID(const GUID *pGuid) | CCommand | [inline]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
SetProperties(ULONG cPropSets, DBPROPSET *rgPropSets) | CCommand | [virtual]
SetupBindings(DB_UPARAMS cParams, DBPARAMINFO *rgParamInfo, DBCOUNTITEM *cBindings, DBBINDING **prgBindings, DBLENGTH *pcRowSize=NULL) | CCommand | [virtual]
CDataAccess::SetupBindings(BINDCOLS eBindCols, DBCOUNTITEM *cBindings, DBBINDING **prgBindings, DBLENGTH *pcRowSize=NULL) | CDataAccess | [virtual]
STDMETHODIMP_(DBREFCOUNT) AddRef(void) | CCommand |
STDMETHODIMP_(DBREFCOUNT) Release(void) | CCommand |
CDataAccess::STDMETHODIMP_(ULONG) AddRef() | CBase |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
Uninitialize() | CAsynchBase | [virtual]
ValidateAccessor(HACCESSOR hAccessor, ULONG ulRefCount=1) | CDataAccess | [virtual]
~CAsynchBase() | CAsynchBase | [virtual]
~CBase() | CBase | [virtual]
~CBaseObj() | CBaseObj | [virtual]
~CCommand() | CCommand | [virtual]
~CCommand(void) | CCommand |
~CContainerBase() | CContainerBase | [virtual]
~CDataAccess() | CDataAccess | [virtual]
Generated on Wed Nov 13 2024 16:55:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows.Net/pch.cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows.Net

pch.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 1999
00005 //
00006 // File:        pch.cpp
00007 //
00008 // Contents:    Cert Server precompiled header
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include <windows.h>
00013
00014 #include <atlbase.h>
00015
00016 //You may derive a class from CComModule and use it if you want to override
00017 //something, but do not change the name of _Module
00018 extern CComModule _Module;
00019
00020 #include <atlcom.h>
00021 #include <certsrv.h>
00022
00023 // include this here so managemodule and exitmodule get to see it
00024
00025 #define wszCLASS_CERTEXITSAMPLEPREFIX TEXT("CertAuthority_Sample")
00026
00027 #define wszCLASS_CERTEXITSAMPLE wszCLASS_CERTEXITSAMPLEPREFIX wszCERTEXITMODULE_POSTFIX
00028 #define wszCLASS_CERTMANAGEEXITMODULESAMPLE wszCLASS_CERTEXITSAMPLEPREFIX wszCERTMANAGEEXIT_POSTFIX
00029
00030 #define wsz_SAMPLE_NAME           L"Sample/Test Exit Module"
00031 #define wsz_SAMPLE_DESCRIPTION    L"Sample Exit Module"
00032 #define wsz_SAMPLE_COPYRIGHT      L"(c)1999 Microsoft"
00033 #define wsz_SAMPLE_FILEVER        L"v 1.0"
00034 #define wsz_SAMPLE_PRODUCTVER     L"v 5.00"
00035
00036
00037 #pragma hdrstop
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/CompData.h Source File

  • SysMgmt
  • MMC
  • Help

CompData.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024 #include "StatNode.h"
00025 #include "Comp.h"
00026
00027 class CComponentData : public IComponentData, ISnapinHelp2
00028 {
00029     friend class CComponent;
00030
00031 private:
00032     ULONG       m_cref;
00033     LPCONSOLE     m_ipConsole;
00034     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00035
00036     CStaticNode     *m_pStaticNode;
00037
00038     WCHAR            m_HelpFile[MAX_PATH];
00039
00040 public:
00041     CComponentData();
00042     ~CComponentData();
00043
00044     ///////////////////////////////
00045     // Interface IUnknown
00046     ///////////////////////////////
00047     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00048     STDMETHODIMP_(ULONG) AddRef();
00049     STDMETHODIMP_(ULONG) Release();
00050
00051     ///////////////////////////////
00052     // Interface IComponentData
00053     ///////////////////////////////
00054     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00055         /* [in] */ LPUNKNOWN pUnknown);
00056
00057         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00058         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00059
00060         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00061         /* [in] */ LPDATAOBJECT lpDataObject,
00062         /* [in] */ MMC_NOTIFY_TYPE event,
00063         /* [in] */ LPARAM arg,
00064         /* [in] */ LPARAM param);
00065
00066         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00067
00068     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00069         /* [in] */ MMC_COOKIE cookie,
00070         /* [in] */ DATA_OBJECT_TYPES type,
00071         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00072
00073         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00074         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00075
00076         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00077         /* [in] */ LPDATAOBJECT lpDataObjectA,
00078         /* [in] */ LPDATAOBJECT lpDataObjectB);
00079
00080         ///////////////////////////////
00081         // Interface ISnapinHelp2
00082         ///////////////////////////////
00083         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetHelpTopic(
00084         /* [out] */ LPOLESTR __RPC_FAR *lpCompiledHelpFile);
00085
00086         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLinkedTopics(
00087     /* [out] */ LPOLESTR __RPC_FAR *lpCompiledHelpFiles) { return S_FALSE; }
00088 };
00089
00090 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/statnode.h Source File

  • SysMgmt
  • MMC
  • Multisel

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038
00039 public:
00040     // virtual functions go here (for MMCN_*)
00041     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00042
00043 private:
00044     enum { NUMBER_OF_CHILDREN = 5 };
00045     CDelegationBase *children[NUMBER_OF_CHILDREN];
00046
00047     // {2974380C-4C4B-11d2-89D8-000021473128}
00048     static const GUID thisGuid;
00049 };
00050
00051
00052
00053 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletCapabilityClass Member List

This is the complete list of members for tagAppletCapabilityClass, including all inherited members.
eType | tagAppletCapabilityClass
nMinOrMax | tagAppletCapabilityClass
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/delebase.h Source File

  • SysMgmt
  • MMC
  • Simple

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CDelegationBase {
00030 public:
00031     CDelegationBase();
00032     virtual ~CDelegationBase();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00035     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00036
00037     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00038     virtual const int GetBitmapIndex() = 0;
00039
00040     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00041
00042 public:
00043     // virtual functions go here (for MMCN_*)
00044
00045 private:
00046     // {2974380B-4C4B-11d2-89D8-000021473128}
00047     static const GUID thisGuid;
00048 };
00049
00050 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDialogBase Member List

This is the complete list of members for CDialogBase, including all inherited members.
CDialogBase(HWND hWnd, HINSTANCE hInst) | CDialogBase |
Destroy() | CDialogBase | [virtual]
Display()=0 | CDialogBase | [pure virtual]
m_hInst | CDialogBase |
m_hWnd | CDialogBase |
~CDialogBase() | CDialogBase | [virtual]
Generated on Wed Nov 13 2024 16:56:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/CSSamp/Text.Cpp Source File

  • WinUI
  • GlobalDev
  • CSSamp

Text.Cpp

Go to the documentation of this file.
00001 ////    TEXTREP - Text representation
00002 //
00003 //      For this demonstration, text representation is rather simple.
00004
00005 #include "precomp.hxx"
00006 #include "global.h"
00007
00008 ////    InitText - Initialise text buffer
00009 //
00010 //
00011 void InitText()
00012 {
00013     HMODULE    hmod  = NULL;
00014     HRSRC      hrsrc = NULL;
00015     HGLOBAL    hglob = NULL;
00016     WCHAR     *pwcIt = NULL;  // Initial text
00017     int        i     = 0;
00018
00019     g_iTextLen = 0;
00020     hmod       = GetModuleHandle(NULL);
00021     hrsrc      = FindResourceA(hmod, (LPCSTR)110, "INITIALTEXT");
00022     hglob      = LoadResource(hmod, hrsrc);
00023     g_iTextLen = SizeofResource(hmod, hrsrc) - 2;  // Remove leading byte order mark
00024     pwcIt      = (WCHAR*) LockResource(hglob);
00025
00026     if (!hmod  ||  !hrsrc  ||  !hglob  ||  !pwcIt  ||  !g_iTextLen)
00027     {
00028         ASSERTS(hmod,    "GetModuleHandle(usptest.exe) failed");
00029         ASSERTS(hrsrc,   "FindResource(110, INITIALTEXT) failed");
00030         ASSERTS(hglob,   "LoadResource(110, INITIALTEXT) failed");
00031         ASSERTS(pwcIt,   "LockResource(110, INITIALTEXT) failed");
00032         ASSERTS(g_iTextLen, "INITIALTEXT length zero");
00033
00034         g_iTextLen = 0;
00035     }
00036
00037     if (g_iTextLen >= sizeof(g_wcBuf))
00038     {
00039         g_iTextLen = sizeof(g_wcBuf);
00040     }
00041
00042     _memccpy(g_wcBuf, pwcIt+1,WCHAR('\0'),g_iTextLen);
00043     g_iTextLen <<= 1;  // Bytes to characters
00044
00045     i = 0;
00046     while (i < g_iTextLen  &&  g_wcBuf[i])
00047     {
00048         i++;
00049     }
00050
00051     g_iTextLen = i;
00052
00053     // Construct initial formatting style run covering the entire text
00054     StyleExtendRange(0, g_iTextLen);
00055     ASSERT(StyleCheckRange());
00056 }
00057
00058 ////    textDelete - Delete text from buffer
00059 //
00060 BOOL TextDelete(int iPos, int iLen)
00061 {
00062     BOOL bSucess = TRUE;
00063     if (   iPos < 0
00064         || iLen < 0
00065         || iPos +iLen > g_iTextLen)
00066     {
00067         bSucess = FALSE;
00068         goto RETURN;
00069     }
00070
00071     if (iPos + iLen >= g_iTextLen)
00072     {
00073         g_iTextLen = iPos;
00074         StyleDeleteRange(iPos, iLen);
00075         ASSERT(StyleCheckRange());
00076         goto RETURN;
00077     }
00078
00079     if (iLen == 0)
00080     {
00081         goto RETURN;
00082     }
00083
00084     _memccpy(g_wcBuf + iPos, g_wcBuf + iPos + iLen,WCHAR('\0'),sizeof(WCHAR) * (g_iTextLen - (iPos + iLen)));
00085     g_iTextLen -= iLen;
00086
00087     StyleDeleteRange(iPos, iLen);
00088     ASSERT(StyleCheckRange());
00089
00090 RETURN:
00091     return bSucess;
00092 }
00093
00094 ////    TextInsert - Insert new characters in the buffer at the given insertion point
00095 //
00096 BOOL TextInsert(int iPos, PWCH pwc, int iLen)
00097 {
00098     BOOL bSucess = TRUE;
00099
00100     if (   iPos < 0
00101         || iLen < 0
00102         || iPos + iLen >= MAX_TEXT
00103         || iPos > g_iTextLen
00104         || iLen + g_iTextLen <= MAX_TEXT-1 )
00105     {
00106         bSucess = FALSE;
00107     }
00108     else
00109     {
00110         // Shift text above iPos up the buffer
00111         if (iPos < g_iTextLen)
00112         {
00113             memmove(g_wcBuf+iPos+iLen, g_wcBuf+iPos, sizeof(WCHAR)*(g_iTextLen-iPos));
00114         }
00115
00116         // Copy new text into buffer
00117         memcpy(g_wcBuf+iPos, pwc, sizeof(WCHAR)*iLen);
00118         g_iTextLen += iLen;
00119
00120
00121         // Give the new characters the same style as the original character they follow
00122         StyleExtendRange(iPos, iLen);
00123         ASSERT(StyleCheckRange());
00124     }
00125
00126     return bSucess;
00127 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DataObj.Cpp Source File

  • WinUI
  • Shell
  • DragImg

DataObj.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DataObj.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "DataObj.h"
00023 #include "EnumFE.h"
00024 #include "Render.h"
00025 #include <shlobj.h>
00026
00027 /**************************************************************************
00028    global variables and definitions
00029 **************************************************************************/
00030
00031 extern USHORT  g_cfFileContents;
00032 extern USHORT  g_cfFileGroupDescriptor;
00033
00034 /**************************************************************************
00035
00036    CDataObject::CDataObject()
00037
00038 **************************************************************************/
00039
00040 CDataObject::CDataObject()
00041 {
00042 m_cRefCount = 1;
00043 m_pFormatEtc = NULL;
00044 m_pStgMedium = NULL;
00045 m_cDataCount = 0;
00046 }
00047
00048 /**************************************************************************
00049
00050    CDataObject::~CDataObject()
00051
00052 **************************************************************************/
00053
00054 CDataObject::~CDataObject()
00055 {
00056 if(m_pFormatEtc)
00057    delete m_pFormatEtc;
00058
00059 if(m_pStgMedium)
00060    {
00061    DWORD i;
00062
00063    for(i = 0; i < m_cDataCount; i++)
00064       ReleaseStgMedium(&m_pStgMedium[i]);
00065
00066    delete m_pStgMedium;
00067    }
00068 }
00069
00070 ///////////////////////////////////////////////////////////////////////////
00071 //
00072 // IUnknown Implementation
00073 //
00074
00075 /**************************************************************************
00076
00077    CDataObject::QueryInterface()
00078
00079 **************************************************************************/
00080
00081 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppvOut)
00082 {
00083 *ppvOut = NULL;
00084
00085 //IUnknown
00086 if(IsEqualIID(riid, IID_IUnknown))
00087    {
00088    *ppvOut = this;
00089    }
00090
00091 //IDataObject
00092 else if(IsEqualIID(riid, IID_IDataObject))
00093    {
00094    *ppvOut = (IDataObject*)this;
00095    }
00096
00097 if(*ppvOut)
00098    {
00099    (*(LPUNKNOWN*)ppvOut)->AddRef();
00100    return S_OK;
00101    }
00102
00103 return E_NOINTERFACE;
00104 }
00105
00106 /**************************************************************************
00107
00108    CDataObject::AddRef()
00109
00110 **************************************************************************/
00111
00112 STDMETHODIMP_(ULONG) CDataObject::AddRef(void)
00113 {
00114 return ++m_cRefCount;
00115 }
00116
00117 /**************************************************************************
00118
00119    CDataObject::Release()
00120
00121 **************************************************************************/
00122
00123 STDMETHODIMP_(ULONG) CDataObject::Release(void)
00124 {
00125 if(--m_cRefCount == 0)
00126    {
00127    delete this;
00128    return 0;
00129    }
00130
00131 return m_cRefCount;
00132 }
00133
00134 ///////////////////////////////////////////////////////////////////////////
00135 //
00136 // IDataObject Implementation
00137 //
00138
00139 /**************************************************************************
00140
00141    CDataObject::GetData()
00142
00143 **************************************************************************/
00144
00145 STDMETHODIMP CDataObject::GetData(LPFORMATETC pFE, LPSTGMEDIUM pSM)
00146 {
00147 if(pFE == NULL || pSM == NULL)
00148    return E_INVALIDARG;
00149
00150 ZeroMemory(pSM, sizeof(STGMEDIUM));
00151
00152 DWORD i;
00153
00154 for(i = 0; i < m_cDataCount; i++)
00155    {
00156    if(   (pFE->tymed & m_pFormatEtc[i].tymed) &&
00157          (pFE->dwAspect == m_pFormatEtc[i].dwAspect) &&
00158          (pFE->cfFormat == m_pFormatEtc[i].cfFormat) &&
00159          (pFE->lindex == m_pFormatEtc[i].lindex))
00160       {
00161       HRESULT  hr;
00162
00163       hr = CopyStgMedium(&m_pStgMedium[i], pSM);
00164
00165       if(pSM->tymed == TYMED_HGLOBAL)
00166          {
00167          //this tell's the caller not to free the global memory
00168          QueryInterface(IID_IUnknown, (LPVOID*)&pSM->pUnkForRelease);
00169          }
00170
00171       return hr;
00172       }
00173    }
00174
00175 return DV_E_FORMATETC;
00176 }
00177
00178 /**************************************************************************
00179
00180    CDataObject::GetDataHere()
00181
00182 **************************************************************************/
00183
00184 STDMETHODIMP CDataObject::GetDataHere(LPFORMATETC pFE, LPSTGMEDIUM pSM)
00185 {
00186 return E_NOTIMPL;
00187 }
00188
00189 /**************************************************************************
00190
00191    CDataObject::QueryGetData()
00192
00193 **************************************************************************/
00194
00195 STDMETHODIMP CDataObject::QueryGetData(LPFORMATETC pFE)
00196 {
00197 if(!pFE)
00198    return DV_E_FORMATETC;
00199
00200 if(!(DVASPECT_CONTENT & pFE->dwAspect))
00201    return DV_E_DVASPECT;
00202
00203 //now check for an appropriate TYMED.
00204 DWORD    i;
00205 HRESULT  hr = DV_E_TYMED;
00206
00207 for(i = 0; i < m_cDataCount; i++)
00208    {
00209    if(pFE->tymed & m_pFormatEtc[i].tymed)
00210       {
00211       if(pFE->cfFormat == m_pFormatEtc[i].cfFormat)
00212          return S_OK;
00213       else
00214          hr = DV_E_CLIPFORMAT;
00215       }
00216    else
00217       hr = DV_E_TYMED;
00218    }
00219
00220 return hr;
00221 }
00222
00223 /**************************************************************************
00224
00225    CDataObject::GetCanonicalFormatEtc()
00226
00227 **************************************************************************/
00228
00229 STDMETHODIMP CDataObject::GetCanonicalFormatEtc(LPFORMATETC pFE1, LPFORMATETC pFE2)
00230 {
00231 return DATA_S_SAMEFORMATETC;
00232 }
00233
00234 /**************************************************************************
00235
00236    CDataObject::SetData()
00237
00238 **************************************************************************/
00239
00240 STDMETHODIMP CDataObject::SetData(LPFORMATETC pFE , LPSTGMEDIUM pSM, BOOL fRelease)
00241 {
00242 LPFORMATETC pfeNew;
00243 LPSTGMEDIUM psmNew;
00244
00245 m_cDataCount++;
00246
00247 pfeNew = new FORMATETC[m_cDataCount];
00248 psmNew = new STGMEDIUM[m_cDataCount];
00249
00250 if(pfeNew && psmNew)
00251    {
00252    ZeroMemory(pfeNew, sizeof(FORMATETC) * m_cDataCount);
00253    ZeroMemory(psmNew, sizeof(STGMEDIUM) * m_cDataCount);
00254
00255    //copy the existing data
00256    if(m_pFormatEtc)
00257       {
00258       CopyMemory(pfeNew, m_pFormatEtc, sizeof(FORMATETC) * (m_cDataCount - 1));
00259       }
00260    if(m_pStgMedium)
00261       {
00262       CopyMemory(psmNew, m_pStgMedium, sizeof(STGMEDIUM) * (m_cDataCount - 1));
00263       }
00264
00265    //add the new data
00266    pfeNew[m_cDataCount - 1] = *pFE;
00267    if(fRelease)
00268       {
00269       psmNew[m_cDataCount - 1] = *pSM;
00270       }
00271    else
00272       {
00273       CopyStgMedium(pSM, &psmNew[m_cDataCount - 1]);
00274       }
00275
00276    LPFORMATETC pfeTemp = m_pFormatEtc;
00277    m_pFormatEtc = pfeNew;
00278    pfeNew = pfeTemp;
00279
00280    LPSTGMEDIUM psmTemp = m_pStgMedium;
00281    m_pStgMedium = psmNew;
00282    psmNew = psmTemp;
00283    }
00284
00285 if(pfeNew)
00286    delete [] pfeNew;
00287
00288 if(psmNew)
00289    delete [] psmNew;
00290
00291 if(m_pFormatEtc && m_pStgMedium)
00292    return S_OK;
00293
00294 return E_OUTOFMEMORY;
00295 }
00296
00297 /**************************************************************************
00298
00299    CDataObject::EnumFormatEtc()
00300
00301 **************************************************************************/
00302
00303 STDMETHODIMP CDataObject::EnumFormatEtc(DWORD dwDir, LPENUMFORMATETC *ppEnum)
00304 {
00305 *ppEnum = NULL;
00306
00307 switch(dwDir)
00308    {
00309    case DATADIR_GET:
00310       {
00311       *ppEnum = new CEnumFormatEtc(m_pFormatEtc, m_cDataCount);
00312
00313       if(*ppEnum)
00314          return S_OK;
00315
00316       break;
00317       }
00318
00319    default:
00320       return OLE_S_USEREG;
00321    }
00322
00323 return E_OUTOFMEMORY;
00324 }
00325
00326 /**************************************************************************
00327
00328    CDataObject::DAdvise()
00329
00330 **************************************************************************/
00331
00332 STDMETHODIMP CDataObject::DAdvise(  LPFORMATETC pFE,
00333                                     DWORD advf,
00334                                     LPADVISESINK pAdvSink,
00335                                     LPDWORD pdwConnection)
00336 {
00337 return E_NOTIMPL;
00338 }
00339
00340 /**************************************************************************
00341
00342    CDataObject::DUnadvise()
00343
00344 **************************************************************************/
00345
00346 STDMETHODIMP CDataObject::DUnadvise(DWORD dwConnection)
00347 {
00348 return E_NOTIMPL;
00349 }
00350
00351 /**************************************************************************
00352
00353    CDataObject::EnumDAdvise()
00354
00355 **************************************************************************/
00356
00357 STDMETHODIMP CDataObject::EnumDAdvise(LPENUMSTATDATA *ppenumAdvise)
00358 {
00359 return OLE_E_ADVISENOTSUPPORTED;
00360 }
00361
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Secure/myProp.Idl Source File

  • Com
  • Fundamentals
  • DCom
  • Secure

myProp.Idl

Go to the documentation of this file.
00001 // ===========================================================================
00002 // File: M Y P R O P S . I D L
00003 //
00004 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00005 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007 // PARTICULAR PURPOSE.
00008 //
00009 // Copyright 1996 Microsoft Corporation. All Rights Reserved.
00010 // ===========================================================================
00011
00012 #ifndef DO_NO_IMPORTS
00013 import "unknwn.idl";
00014 #endif
00015
00016 cpp_quote("DEFINE_GUID(CLSID_SecureObject, 0x28f64ee0, 0x4656, 0x11cf, 0x81, 0x10, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);")
00017 cpp_quote("DEFINE_GUID(CLSID_SecureObjectService, 0x28f64ee2, 0x4656, 0x11cf, 0x81, 0x10, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);")
00018 cpp_quote("DEFINE_GUID(IID_IMyProperties, 0x28f64ee1, 0x4656, 0x11cf, 0x81, 0x10, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);")
00019
00020 [
00021   object,
00022   uuid(28f64ee1-4656-11cf-8110-00aa00389b71)
00023 ]
00024 interface IMyProperties : IUnknown
00025 {
00026   typedef [unique] IMyProperties* LPMYPROPERTIES;
00027
00028   HRESULT GetColor
00029   (
00030     [out] COLORREF* pcr
00031   );
00032   HRESULT PutColor
00033   (
00034     [in] COLORREF cr
00035   );
00036   HRESULT GetUserName
00037   (
00038     [in, out] WCHAR szUserName[20]
00039   );
00040   HRESULT PutUserName
00041   (
00042     [in] WCHAR szUserName[20]
00043   );
00044 }
00045
00046 // EOF =======================================================================
00047
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkZoom/C#/AssemblyInfo.cs Source File

  • TabletPC
  • InkZoom
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("Ink Zoom Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2003 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_track Member List

This is the complete list of members for tag_track, including all inherited members.
bRunningStatus | tag_track
cbLeft | tag_track
cbLength | tag_track
fdwTrack | tag_track
hpbImage | tag_track
idxTrack | tag_track
pSmf | tag_track
smti | tag_track
tkLength | tag_track
tkPosition | tag_track
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/irowsetscroll.h Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

irowsetscroll.h

Go to the documentation of this file.
00001 // Start of IRowsetScroll.h
00002 // File: IRowsetScroll.h
00003 //
00004 //  This file contains the information for the IRowsetScrollImpl class.
00005 //
00006 //  IRowsetScrollImpl inherits from IRowsetImpl and IRowsetScroll and does the following:
00007 //
00008 //    1. IRowsetScrollImpl :: GetApproximatePosition - Gets the Approximate position of a row corresponding to a specified bookmark
00009 //    2. IRowsetScrollImpl :: GetRowsAtRatio - Fetches rows starting from a fractional position in the rowset
00010 //    3. IRowsetScrollImpl :: Compare - Compares two bookmark
00011 //    4. IRowsetScrollImpl :: GetRowsAt - Fetches rows starting with the row specified by an offset from a bookmark
00012 //    5. IRowsetScrollImpl :: GetRowsByBookmark - Fetches rows that match the specified bookmark
00013 //    6. IRowsetScrollImpl :: Hash - Returns hash values for the specified bookmarks
00014 //
00015
00016 // Class IRowsetScrollImpl
00017
00018 #ifndef _IROWSETSCROLLIMPL_7F4B3871_6B9C_11d3_AC94_00C04F8DB3D5_H
00019 #define _IROWSETSCROLLIMPL_7F4B3871_6B9C_11d3_AC94_00C04F8DB3D5_H
00020
00021 #include "RNCP.h"  // The ConnectionPoint and IRowsetNotify Proxy class
00022
00023 template <class T,class RowsetInterface=IRowsetScroll>
00024 class ATL_NO_VTABLE IRowsetScrollImpl : public IRowsetImpl<T, IRowsetScroll>
00025 {
00026 public:
00027     STDMETHOD (GetApproximatePosition)(
00028         /* [in] */ HCHAPTER hReserved,
00029         /* [in] */ ULONG cbBookmark,
00030         /* [size_is][in] */ const BYTE __RPC_FAR *pBookmark,
00031         /* [out] */ ULONG __RPC_FAR *pulPosition,
00032         /* [out] */ ULONG __RPC_FAR *pcRows)
00033   {
00034     ATLTRACE2(atlTraceDBProvider, 0, "IRowsetScrollImpl::GetApproximatePosition\n");
00035     HRESULT hr;
00036     T* pT = (T*)this;
00037     T::ObjectLock cab((T*) pT);
00038     if(DB_NULL_HCHAPTER != hReserved)
00039       return DB_E_NOTSUPPORTED;
00040
00041     // DANK: RowsetViewer was getting an error as it would use this function to get the
00042     //       approximate number of rows. I modified to  do the arg checking earlier before the
00043     //       bookmark validation
00044     if(pulPosition == NULL && pcRows == NULL)
00045       return S_OK;
00046
00047     if(cbBookmark == 0)
00048     {
00049       if (*pcRows != NULL)
00050         *pcRows = pT->m_rgRowHandles.GetSize();
00051       return S_OK;
00052     }
00053
00054     // SQLOLEDB does not have this implemented MDAC 2.1 SP2...
00055     // Validate the bookmarks only if a bookmark is specified
00056     // If No-op
00057     hr = ValidateBookmark(cbBookmark, pBookmark);
00058     if(hr != S_OK)
00059       return hr;
00060     // This deals with all the ros inside the rowset after a GetNextRows( )...
00061     // Hence, operations are confined to m_rgRowHandles
00062     // There is no change to the state of the cursor just return the number of rows between m_iRowset and the current bookmark...
00063     // *pcRows should always be greater than *pulPosition !!
00064
00065     // Now if cbBookmark != 0 and pBookmark is valid-> check pBookmark and find the ulPosition and pcRows
00066     if(pBookmark != NULL)
00067     {
00068       ULONG iRowsetTemp = pT->m_iRowset;  // Cache the current rowset
00069       if ((cbBookmark == 1) && (*pBookmark == DBBMK_FIRST))
00070         iRowsetTemp = 1;
00071       if ((cbBookmark == 1) && (*pBookmark == DBBMK_LAST))
00072       //  iRowsetTemp = pT->m_rgRowData.GetSize();
00073         iRowsetTemp = pT->m_DBFile.m_Rows.GetSize();
00074       // m_iRowset - From current cursor get current Bookmark
00075       // Check if iRowsetTemp exists in the current current
00076       // Need to economize this if many rows exist in the cursor....
00077       for(LONG i =0 ; i < pT->m_rgRowHandles.m_nSize && m_rgRowHandles.m_aVal[i]->m_iRowset != (LONG) iRowsetTemp; i++);
00078       if( i >= pT->m_rgRowHandles.m_nSize )
00079         return DB_E_BADBOOKMARK;
00080       //ULONG dwCurBkmrk = pT->m_rgRowData[iRowsetTemp].m_dwBookmark;
00081       ULONG dwCurBkmrk = pT->m_DBFile.m_Rows[iRowsetTemp]->m_bmk;
00082
00083       if( (*pBookmark < dwCurBkmrk) )
00084         return DB_E_BADBOOKMARK;
00085       ULONG ulNumRows = *pBookmark - dwCurBkmrk;
00086       *pulPosition = iRowsetTemp;
00087       *pcRows = ulNumRows;
00088     }
00089     else return DB_E_BADBOOKMARK;
00090     return S_OK;
00091   }
00092
00093     STDMETHOD (GetRowsAtRatio)(
00094         /* [in] */ HWATCHREGION hReserved1,
00095         /* [in] */ HCHAPTER hReserved2,
00096         /* [in] */ ULONG ulNumerator,
00097         /* [in] */ ULONG ulDenominator,
00098         /* [in] */ LONG cRows,
00099         /* [out] */ ULONG __RPC_FAR *pcRowsObtained,
00100         /* [size_is][size_is][out] */ HROW __RPC_FAR *__RPC_FAR *prghRows)
00101   {
00102     ATLTRACE2(atlTraceDBProvider, 0, "IRowsetScrollImpl::GetRowsAtRatio\n");
00103     T* pT = (T*)this;
00104     T::ObjectLock cab((T*) pT);
00105     HRESULT hr = S_OK;
00106     // Validation
00107     if(DB_NULL_HCHAPTER != hReserved2)
00108       return DB_E_NOTSUPPORTED;
00109     if(NULL == pcRowsObtained || NULL == prghRows)
00110       return E_INVALIDARG;
00111     // Check Fetching Backwards
00112     if (cRows < 0 && !pT->m_bCanFetchBack)
00113       return DB_E_CANTFETCHBACKWARDS;
00114     if(ulDenominator == 0 || (ulNumerator > ulDenominator) )
00115       return DB_E_BADRATIO;
00116
00117     // Setting up the Start Position
00118     LONG iRowsetTemp = pT->m_iRowset;  // Cache the current rowset
00119     if(ulNumerator == 0 && cRows >0) // Start Point - First Row
00120       pT->m_iRowset = 0;
00121     else if ( (ulNumerator == 0 && cRows < 0) || (ulNumerator == ulDenominator && cRows > 0))   // DB_S_ENDOFROWSET
00122       hr = DB_S_ENDOFROWSET;
00123     else if (ulNumerator == ulDenominator && cRows < 0)  // Last Row
00124       //pT->m_iRowset = pT->m_rgRowData.GetSize() - 1;
00125       pT->m_iRowset = pT->m_DBFile.m_Rows.GetSize() - 1;
00126     else // All other conditions
00127       //pT->m_iRowset = (ulNumerator /ulDenominator) * pT->m_rgRowData.GetSize();
00128       pT->m_iRowset = (ulNumerator /ulDenominator) * pT->m_DBFile.m_Rows.GetSize();
00129     // Not sure about HOLDROWS optimizations - DB_E_ROWSNOTRELEASED
00130     // Call IRowsetImpl::GetNextRows to actually get the rows.
00131     if(hr == S_OK)
00132       hr = pT->GetNextRows(hReserved2, 0, cRows, pcRowsObtained, prghRows);
00133     pT->m_iRowset = iRowsetTemp; // Return back to orignal cursor position
00134     // Send notification message
00135     if(FAILED(pT->Fire_OnRowChange(this, cRows, *prghRows, DBREASON_ROW_ACTIVATE, DBEVENTPHASE_DIDEVENT, TRUE)))
00136       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_ACTIVATE in DBEVENTPHASE_DIDEVENT phase\n");
00137     return hr;
00138   }
00139
00140   // IROWSETLOCATE Methods
00141   STDMETHOD (Compare)(HCHAPTER hReserved, ULONG cbBookmark1,
00142     const BYTE * pBookmark1, ULONG cbBookmark2, const BYTE * pBookmark2,
00143     DBCOMPARE * pComparison)
00144   {
00145     ATLTRACE("IRowsetLocateImpl::Compare");
00146     T* pT = (T*)this;
00147     T::ObjectLock cab((T*) pT);
00148     if(DB_NULL_HCHAPTER != hReserved)
00149       return DB_E_NOTSUPPORTED;
00150     HRESULT hr = ValidateBookmark(cbBookmark1, pBookmark1);
00151     if (hr != S_OK)
00152       return hr;
00153     hr = ValidateBookmark(cbBookmark2, pBookmark2);
00154     if (hr != S_OK)
00155       return hr;
00156
00157     // Return the value based on the bookmark values
00158     if (*pBookmark1 == *pBookmark2)
00159       *pComparison = DBCOMPARE_EQ;
00160
00161     if (*pBookmark1 < *pBookmark2)
00162       *pComparison = DBCOMPARE_LT;
00163
00164     if (*pBookmark1 > *pBookmark2)
00165       *pComparison = DBCOMPARE_GT;
00166     return S_OK;
00167   }
00168
00169   STDMETHOD (GetRowsAt)(HWATCHREGION hReserved1, HCHAPTER hReserved2,
00170     ULONG cbBookmark, const BYTE * pBookmark, LONG lRowsOffset,
00171     LONG cRows, ULONG * pcRowsObtained, HROW ** prghRows)
00172   {
00173     ATLTRACE("IRowsetScrollImpl::GetRowsAt\n");
00174     T* pT = (T*)this;
00175     T::ObjectLock cab((T*) pT);
00176     if(DB_NULL_HCHAPTER != hReserved2)
00177       return DB_E_NOTSUPPORTED;
00178     // Check bookmark
00179     HRESULT hr = ValidateBookmark(cbBookmark, pBookmark);
00180     if (hr != S_OK)
00181       return hr;
00182
00183     // Check the other pointers
00184     if (pcRowsObtained == NULL || prghRows == NULL)
00185       return E_INVALIDARG;
00186
00187     // Set the current row position to the bookmark.  Handle any
00188     // normal values
00189
00190     // We need to handle the offset as the start position is defined
00191     // as the bookmark + offset.  If the offset is negative, and we
00192     // do not have m_bCanScrollBack then return an error.  The
00193     // GetNextRows function handles the case where cRows is negative
00194     // and we don't have m_bCanFetchBack set.
00195     if (lRowsOffset < 0 && !pT->m_bCanScrollBack)
00196       return DB_E_CANTSCROLLBACKWARDS;
00197     if (cRows < 0 && !pT->m_bCanFetchBack)
00198       return DB_E_CANTFETCHBACKWARDS;
00199
00200     LONG iRowsetTemp = pT->m_iRowset;  // Cache the current rowset
00201     pT->m_iRowset = *pBookmark;
00202     if ((cbBookmark == 1) && (*pBookmark == DBBMK_FIRST))
00203       pT->m_iRowset = 1;
00204
00205     if ((cbBookmark == 1) && (*pBookmark == DBBMK_LAST))
00206 //      pT->m_iRowset = pT->m_rgRowData.GetSize();
00207       pT->m_iRowset = pT->m_DBFile.m_Rows.GetSize();
00208
00209     // Set the start position to m_iRowset + lRowsOffset
00210     pT->m_iRowset += lRowsOffset;
00211     if (lRowsOffset >= 0)
00212       (cRows >= 0) ? pT->m_iRowset -= 1 : pT->m_iRowset +=0;
00213     else
00214       (cRows >= 0) ? pT->m_iRowset -= 1 : pT->m_iRowset +=0;
00215 //      (lRowsOffset >= 0) ? m_iRowset -= 1 : m_iRowset += 1;
00216     // TODO: this is not very generic - perhaps there is something we can do here
00217     if (pT->m_iRowset < 0 || pT->m_iRowset > (DWORD)pT->m_DBFile.m_Rows.GetSize())
00218     {
00219       pT->m_iRowset = iRowsetTemp;
00220       return DB_E_BADSTARTPOSITION; // For 1.x Provider
00221     }
00222
00223     // Call IRowsetImpl::GetNextRows to actually get the rows.
00224     hr = pT->GetNextRows(hReserved2, 0, cRows, pcRowsObtained, prghRows);
00225     pT->m_iRowset = iRowsetTemp;
00226     // Send notification message
00227     if(FAILED(pT->Fire_OnRowChange(this, cRows, *prghRows, DBREASON_ROW_ACTIVATE, DBEVENTPHASE_DIDEVENT, TRUE)))
00228       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_ACTIVATE in DBEVENTPHASE_DIDEVENT phase\n");
00229     return hr;
00230   }
00231
00232
00233   STDMETHOD (GetRowsByBookmark)(HCHAPTER hReserved, ULONG cRows,
00234     const ULONG rgcbBookmarks[], const BYTE * rgpBookmarks[],
00235     HROW rghRows[], DBROWSTATUS rgRowStatus[])
00236   {
00237     HRESULT hr = S_OK;
00238     ATLTRACE("IRowsetLocateImpl::GetRowsByBookmark");
00239
00240     T* pT = (T*)this;
00241     if (rgcbBookmarks == NULL || rgpBookmarks == NULL || rghRows == NULL)
00242       return E_INVALIDARG;
00243
00244     if (cRows == 0)
00245       return S_OK;    // No rows fetched in this case.
00246
00247     bool bErrors = false;
00248     for (ULONG l=0; l<cRows; l++)
00249     {
00250       // Validate each bookmark before fetching the row.  Note, it is
00251       // an error for the bookmark to be one of the standard values
00252       hr = ValidateBookmark(rgcbBookmarks[l], rgpBookmarks[l]);
00253       if (hr != S_OK)
00254       {
00255         bErrors = TRUE;
00256         if (rgRowStatus != NULL)
00257         {
00258           rgRowStatus[l] = DBROWSTATUS_E_INVALID;
00259           continue;
00260         }
00261       }
00262
00263       // Fetch the row, we now that it is a valid row after validation.
00264       ULONG ulRowsObtained = 0;
00265       if (pT->CreateRow((long)*rgpBookmarks[l], ulRowsObtained, &rghRows[l]) != S_OK)
00266       {
00267         bErrors = TRUE;
00268       }
00269       else
00270       {
00271         if (rgRowStatus != NULL)
00272           rgRowStatus[l] = DBROWSTATUS_S_OK;
00273       }
00274     }
00275
00276     if (bErrors)
00277       return DB_S_ERRORSOCCURRED;
00278     if (FAILED(pT->Fire_OnRowChange(this, cRows, rghRows, DBREASON_ROW_ACTIVATE, DBEVENTPHASE_DIDEVENT, TRUE)))
00279       ATLTRACE2(atlTraceDBProvider, 0, "Failed to Fire DBREASON_ROW_ACTIVATE in DBEVENTPHASE_DIDEVENT phase\n");
00280     return hr;
00281   }
00282
00283   STDMETHOD (Hash)(HCHAPTER hReserved, ULONG cBookmarks,
00284     const ULONG rgcbBookmarks[], const BYTE * rgpBookmarks[],
00285     DWORD rgHashedValues[], DBROWSTATUS rgBookmarkStatus[])
00286   {
00287     ATLTRACE("IRowsetScrollImpl::Hash\n");
00288     T* pT = (T*)this;
00289     T::ObjectLock cab((T*) pT);
00290     // Validation
00291     //ROWSET_NOTIFICATION_REENTRANCY_CHECK
00292     if(DB_NULL_HCHAPTER != hReserved)
00293       return DB_E_NOTSUPPORTED;
00294     if (cBookmarks <= 0)
00295       return S_OK;
00296     if((rgHashedValues == NULL) || (cBookmarks != 0 && (rgcbBookmarks == NULL || rgpBookmarks==NULL)) )
00297       return E_INVALIDARG;
00298     // Logic for hashing
00299     ULONG cerrors =0;
00300     if(rgBookmarkStatus)
00301     {
00302       // Loop through the array hashing them and recording their status
00303       for(ULONG i=0;i<cBookmarks; i++)
00304       {
00305         if(SUCCEEDED(HashBmk(rgcbBookmarks[i],rgpBookmarks[i],&(rgHashedValues[i]))) )
00306           rgBookmarkStatus[i] = DBROWSTATUS_S_OK;
00307         else
00308         {
00309           cerrors++;
00310           rgBookmarkStatus[i] = DBROWSTATUS_E_INVALID;
00311         }
00312       }
00313     }
00314     else
00315     {
00316       // Loop through the array hashing them
00317       for(ULONG i=0;i<cBookmarks; i++)
00318       {
00319         if(FAILED(HashBmk(rgcbBookmarks[i],rgpBookmarks[i],&(rgHashedValues[i]))) )
00320           cerrors++;
00321       }
00322     }
00323     if (cerrors == 0) return S_OK;
00324     if (cerrors < cBookmarks)
00325       return DB_S_ERRORSOCCURRED;
00326     else return DB_E_ERRORSOCCURRED;
00327   }
00328
00329   // Implementation
00330   protected:
00331   HRESULT HashBmk(ULONG cbBmk,const BYTE  *pbBmk,ULONG  *pdwHashedValue,ULONG ulTableSize=0xffffffff)
00332   {
00333     if (cbBmk != sizeof(DWORD) || pbBmk == NULL)
00334       return E_INVALIDARG;
00335     ATLASSERT(pdwHashedValue);
00336     *pdwHashedValue = (*(UNALIGNED ULONG*)pbBmk) % ulTableSize;
00337     return S_OK;
00338   }
00339
00340
00341   HRESULT ValidateBookmark(ULONG cbBookmark, const BYTE* pBookmark)
00342   {
00343     T* pT = (T*)this;
00344     T::ObjectLock cab((T*) pT);
00345     if (cbBookmark == 0 || pBookmark == NULL)
00346       return E_INVALIDARG;
00347
00348     if(*pBookmark == DBBMK_INVALID)
00349         return DB_E_BADBOOKMARK;
00350     // All of our bookmarks are DWORDs, if they are anything other than
00351     // sizeof(DWORD) then we have an invalid bookmark
00352     if ((cbBookmark != sizeof(DWORD)) && (cbBookmark != 1))
00353     {
00354       ATLTRACE("Bookmarks are invalid length, should be DWORDs");
00355       return DB_E_BADBOOKMARK;
00356     }
00357
00358     // If the contents of our bookmarks are less than 0 or greater than
00359     // rowcount, then they are invalid
00360     UINT nRows = pT->m_DBFile.m_Rows.GetSize();
00361     if ((*pBookmark <= 0 || *pBookmark > nRows)
00362       && *pBookmark != DBBMK_FIRST && *pBookmark != DBBMK_LAST)
00363     {
00364       ATLTRACE("Bookmark has invalid range");
00365       return DB_E_BADBOOKMARK;
00366     }
00367
00368     return S_OK;
00369   }
00370 };
00371
00372 #endif
00373
00374
00375 // End of IRowsetScroll.h
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SSL/WebClient/WI_SSL_Client.Cpp Source File

  • Security
  • SSPI
  • SSL
  • WebClient

WI_SSL_Client.Cpp

Go to the documentation of this file.
00001
00002 /*++
00003
00004 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00005 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00006 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007 PARTICULAR PURPOSE.
00008
00009 Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00010
00011 Module Name:
00012
00013     WI_SSL_Client.c
00014
00015 Abstract:
00016
00017     Companion module for WebServer/WebClient sample that shows an
00018     alternate method of interacting with the WebServer. This module
00019     demonstrates how to use the WinInet APIs to make a secure
00020     connection with the server application.
00021
00022 Revision History:
00023
00024     4-1-99  davemo     created
00025
00026 Required Libraries:
00027
00028     wininet.lib
00029     user32.lib
00030
00031 --*/
00032
00033 #include <windows.h>
00034 #include <wininet.h>
00035 #include <stdio.h>
00036
00037 void main(int argc, char *argv[])
00038 {
00039
00040     if(argc<2)
00041     {
00042         printf("USAGE: %s [webserver]\n", argv[0]);
00043         return;
00044     }
00045
00046     // Open Internet session.
00047     HINTERNET hSession = InternetOpen(
00048                             "Wininet Client App",
00049                             PRE_CONFIG_INTERNET_ACCESS,
00050                             NULL,
00051                             INTERNET_INVALID_PORT_NUMBER,
00052                             0) ;
00053
00054     // Connect to server\website.
00055     // NOTE: There must be a client authentication certificate
00056     // available that corresponds to the name of the server or
00057     // website that you are connecting to.
00058     // For instance, if I am running WebServer on machine davemo1,
00059     // then I can specify "davemo1" as the webserver. I must have a
00060     // client authentication certificate available
00061     HINTERNET hConnect = InternetConnect(
00062                             hSession,
00063                             argv[1],
00064                             INTERNET_DEFAULT_HTTPS_PORT,
00065                             "",
00066                             "",
00067                             INTERNET_SERVICE_HTTP,
00068                             0,
00069                             0) ;
00070
00071
00072
00073     // Request the file default.htm from the server.
00074     HINTERNET hHttpFile = HttpOpenRequest(
00075                             hConnect,
00076                             "GET",
00077                             "default.htm",
00078                             HTTP_VERSION,
00079                             "",
00080                             NULL,
00081                             INTERNET_FLAG_SECURE,
00082                             0) ;
00083
00084     //
00085     // Send the request and check for success
00086     //
00087     while(!HttpSendRequest(hHttpFile, NULL, 0, 0, 0))
00088     {
00089
00090         // If the server requires a client certificate I'll invoke
00091         // this nifty dialogue to select a certificate and
00092         // reset the options for the request.
00093
00094         printf("HttpSendRequest error : (%lu)\n", GetLastError());
00095
00096         InternetErrorDlg (
00097             GetDesktopWindow(),
00098             hHttpFile,
00099             ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED,
00100             FLAGS_ERROR_UI_FILTER_FOR_ERRORS |
00101             FLAGS_ERROR_UI_FLAGS_GENERATE_DATA |
00102             FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS,
00103             NULL);
00104
00105
00106     }
00107
00108     // Get the length of the file.
00109     char bufQuery[32] ;
00110
00111     DWORD dwLengthBufQuery;
00112     dwLengthBufQuery = sizeof(bufQuery);
00113
00114     DWORD dwIndex;
00115     dwIndex=0;
00116
00117     BOOL bQuery;
00118
00119     bQuery = HttpQueryInfo(
00120                 hHttpFile,
00121                 HTTP_QUERY_CONTENT_LENGTH,
00122                 bufQuery,
00123                 &dwLengthBufQuery,
00124                 &dwIndex) ;
00125
00126     if(!bQuery)
00127         printf("HttpQueryInfo error : <%lu>\n", GetLastError());
00128
00129
00130     // Convert length from ASCII string to a DWORD.
00131     DWORD dwFileSize;
00132
00133     dwFileSize = (DWORD)atol(bufQuery) ;
00134
00135     // Allocate a buffer for the file.
00136     char* buffer;
00137
00138     buffer = new char[dwFileSize+1] ;
00139
00140     printf("Trying to read %lu bytes from the server\n", dwFileSize);
00141
00142     // Read the file into the buffer.
00143     DWORD dwBytesRead ;
00144     BOOL bRead;
00145
00146     bRead = InternetReadFile(
00147                 hHttpFile,
00148                 buffer,
00149                 dwFileSize+1,
00150                 &dwBytesRead);
00151
00152     if(!bRead)
00153     {
00154         printf("InternetReadFile error : <%lu>\n", GetLastError());
00155     }
00156     else
00157     {
00158         // Put a zero on the end of the buffer.
00159         buffer[dwBytesRead] = 0 ;
00160
00161         // Print the buffer contents.
00162         printf("Retrieved %lu data bytes: %s\n", dwBytesRead, buffer) ;
00163     }
00164
00165     // Close all of the Internet handles.
00166     InternetCloseHandle(hHttpFile);
00167     InternetCloseHandle(hConnect) ;
00168     InternetCloseHandle(hSession) ;
00169
00170
00171 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InitOle Member List

This is the complete list of members for InitOle, including all inherited members.
InitOle() | InitOle | [inline]
~InitOle() | InitOle | [inline]
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllClien/DllClien.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllClien

DllClien.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DLLCLIEN.CPP
00003
00004   Summary:   Based largely on the DLLUSER.EXE application code, this
00005              module is meant to use COM to load and access some COM
00006              components in a separate DLL COM Server (DLLSERVE built
00007              in the sibling DLLSERVE directory).  Thus to run DLLCLIEN
00008              you must build DLLSERVE first.  Like DLLUSER, this app
00009              composes its own native composite COM object,
00010              COUtilityCruiseCar, by aggregating an the existing
00011              COCruiseCar COM component (provided by the DLLSERVE.DLL
00012              server) with a native implementation of the IUtility
00013              interface.  Thus, this app showcases nested aggregation
00014              using COM's client/server protocol.
00015
00016              Also like COMUSER this client app also instantiates the other
00017              car-related objects of DLLSERVE and exercises them (ie, for
00018              Car, UtilityCar, CruiseCar, and UtilityCruiseCar).  To this
00019              end, DLLCLIEN provides a set of menus for these Car related
00020              objects with selections for the respective methods of the
00021              Interfaces exposed by those COM Objects.  DLLCLIEN also
00022              exploits DLLSERVE's CarSample component to setup operation of
00023              that server as a code sample that supports the Client's trace
00024              LOGging macros.  After this is set up the server logs to the
00025              Client's logging facility.
00026
00027              For a comprehensive tutorial code tour of DLLCLIEN's
00028              contents and offerings see the tutorial DLLCLIEN.HTM file.
00029              For more specific technical details on the internal workings
00030              see the comments dispersed throughout the DLLCLIEN source code.
00031              For more details on the DLLSERVE.DLL that DLLCLIEN works with
00032              see the DLLSERVE.HTM file in the main tutorial directory.
00033
00034   Classes:   CMainWindow
00035
00036   Functions: InitApplication, WinMain
00037
00038   Origin:    9-20-95: atrent - Editor-inheritance from the DLLUSER source.
00039
00040 ----------------------------------------------------------------------------
00041   This file is part of the Microsoft COM Tutorial Code Samples.
00042
00043   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00044
00045   This source code is intended only as a supplement to Microsoft
00046   Development Tools and/or on-line documentation.  See these other
00047   materials for detailed information regarding Microsoft code samples.
00048
00049   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00050   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00051   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00052   PARTICULAR PURPOSE.
00053 ==========================================================================+*/
00054
00055 /*--------------------------------------------------------------------------
00056   We include WINDOWS.H for all Win32 applications.
00057   We include OLE2.H because we will be calling the COM/OLE libraries.
00058   We include INITGUID.H only once (here) in the entire app because we
00059     will be defining GUIDs and want them as constants in the data segment.
00060   We include COMMDLG.H because we will be using the Open File and
00061     potentially other Common dialogs.
00062   We include APPUTIL.H because we will be building this application using
00063     the convenient Virtual Window and Dialog classes and other
00064     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00065   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00066     class, GUID, and CLSID specifications.
00067   We include DLLCLIEN.H because it has class and resource definitions
00068     specific to this DLLCLIEN application.
00069   We include UTCRUCAR.H because it has COUtilityCar object class.
00070 ---------------------------------------------------------------------------*/
00071 #include <windows.h>
00072 #include <ole2.h>
00073 #include <initguid.h>
00074 #include <commdlg.h>
00075 #include <apputil.h>
00076 #include <icars.h>
00077 #include <carguids.h>
00078 #include "dllclien.h"
00079 #include "utcrucar.h"
00080
00081
00082 // Here is a pointer for use by the global Trace Message logging macros.
00083 CMsgLog* g_pMsgLog = NULL;
00084
00085
00086 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00087   Method:   CMainWindow::CMainWindow
00088
00089   Summary:  CMainWindow Constructor.
00090
00091   Args:     .
00092
00093   Modifies: .
00094
00095   Returns:  .
00096 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00097 CMainWindow::CMainWindow()
00098 {
00099   // Ensure these member variable strings are null strings.
00100   m_szFileName[0] = 0;
00101   m_szFileTitle[0] = 0;
00102
00103   // Fill in the Open File Name Common Dialog's OPENFILENAME structure.
00104   m_ofnFile.lStructSize = sizeof(OPENFILENAME);
00105   m_ofnFile.hwndOwner = m_hWnd;
00106   m_ofnFile.hInstance = m_hInst;
00107   m_ofnFile.lpstrFilter = TEXT(OFN_DEFAULTFILES_STR);
00108   m_ofnFile.lpstrCustomFilter = NULL;
00109   m_ofnFile.nMaxCustFilter = 0;
00110   m_ofnFile.nFilterIndex = 1;
00111   m_ofnFile.lpstrFile = m_szFileName;
00112   m_ofnFile.nMaxFile = MAX_PATH;
00113   m_ofnFile.lpstrInitialDir = TEXT(".");
00114   m_ofnFile.lpstrFileTitle = m_szFileTitle;
00115   m_ofnFile.nMaxFileTitle = MAX_PATH;
00116   m_ofnFile.lpstrTitle = TEXT(OFN_DEFAULTTITLE_STR);
00117   m_ofnFile.lpstrDefExt = NULL;
00118   m_ofnFile.Flags = OFN_HIDEREADONLY;
00119
00120   m_pCar = NULL;
00121   m_pUtilityCar = NULL;
00122   m_pCruiseCar = NULL;
00123   m_pUtilityCruiseCar = NULL;
00124   m_pCarSample = NULL;
00125
00126   // Null the Message object pointers.
00127   m_pMsgBox = NULL;
00128   m_pMsgLog = NULL;
00129 }
00130
00131
00132 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00133   Method:   CMainWindow::~CMainWindow
00134
00135   Summary:  CMainWindow Destructor.  Destruction of the main window
00136             indicates that the application should quit and thus the
00137             PostQuitMessage API is called.
00138
00139   Args:     .
00140
00141   Modifies: .
00142
00143   Returns:  .
00144 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00145 CMainWindow::~CMainWindow()
00146 {
00147   // CMainWindow is derived from CVirWindow which traps the WM_DESTROY
00148   // message and causes a delete of CMainWindow which in turn causes this
00149   // destructor to run. The WM_DESTROY results when the window is destoyed
00150   // after a close of the window. Prior to exiting the main message loop:
00151
00152   // We release any and all of the pointers to instantiated COM objects.
00153   RELEASE_INTERFACE(m_pCar);
00154   RELEASE_INTERFACE(m_pUtilityCar);
00155   RELEASE_INTERFACE(m_pCruiseCar);
00156   RELEASE_INTERFACE(m_pUtilityCruiseCar);
00157   RELEASE_INTERFACE(m_pCarSample);
00158
00159   // We delete the CMsgBox and CMsgLog objects that were made in
00160   // Initinstance.
00161   DELETE_POINTER(m_pMsgBox);
00162   DELETE_POINTER(m_pMsgLog);
00163
00164   // We then post a WM_QUIT message to cause an exit of the main thread's
00165   // message loop and an exit of this instance of the application.
00166   PostQuitMessage(0);
00167 }
00168
00169
00170 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00171   Method:   CMainWindow::InitInstance
00172
00173   Summary:  Instantiates an instance of the main application window.
00174             This method must be called only once, immediately after
00175             window class construction.  We take care to delete 'this'
00176             CMainWindow if we must return the error condition FALSE.
00177
00178   Args:     HINSTANCE hInstance,
00179               Handle of the application instance.
00180             int nCmdShow)
00181               Command to pass to ShowWindow.
00182
00183   Modifies: m_szHelpFile, m_pMsgBox, m_pMsgLog.
00184
00185   Returns:  BOOL.
00186               TRUE if succeeded.
00187               FALSE if failed.
00188 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00189 BOOL CMainWindow::InitInstance(
00190        HINSTANCE hInstance,
00191        int nCmdShow)
00192 {
00193   BOOL bOk = FALSE;
00194   HWND hWnd;
00195
00196   // Create the Message Box and Message Log objects.
00197   m_pMsgBox = new CMsgBox;
00198   m_pMsgLog = new CMsgLog;
00199
00200   if (NULL != m_pMsgBox && NULL != m_pMsgLog)
00201   {
00202     // Note, the Create method sets the m_hWnd member so we don't
00203     // need to set it explicitly here first.
00204
00205     // Here is the create of this window.  Size the window reasonably.
00206     // Create sets both m_hInst and m_hWnd.
00207     hWnd = Create(
00208              TEXT(MAIN_WINDOW_CLASS_NAME_STR),
00209              TEXT(MAIN_WINDOW_TITLE_STR),
00210              WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
00211                | WS_MAXIMIZEBOX | WS_THICKFRAME,
00212              CW_USEDEFAULT,
00213              CW_USEDEFAULT,
00214              ::GetSystemMetrics(SM_CXSCREEN)*3/5,
00215              ::GetSystemMetrics(SM_CYSCREEN)*3/5,
00216              NULL,
00217              NULL,
00218              hInstance);
00219     if (hWnd)
00220     {
00221       // Ensure the new window is shown on screen and its content is painted.
00222       ::ShowWindow(m_hWnd, nCmdShow);
00223       ::UpdateWindow(m_hWnd);
00224
00225       // Build a path to where the help file should be (it should be in
00226       // the same directory as the .EXE but with the .HTM extension.
00227       MakeFamilyPath(hInstance, m_szHelpFile, TEXT(HELP_FILE_EXT));
00228
00229       // Init the Message Box object.
00230       if (m_pMsgBox->Init(m_hInst, m_hWnd))
00231       {
00232         // Create the Trace Message Log ListBox as a child window that
00233         //   fits the client area of the Main Window (the TRUE 3rd argument
00234         //   specifies such an inside child).
00235         // If you want the Trace Message Log in a separate (but owned)
00236         //   window, then pass a FALSE instead for the 3rd argument.
00237         if (m_pMsgLog->Create(m_hInst, m_hWnd, TRUE))
00238         {
00239           HRESULT hr;
00240
00241           // Assign the global MsgLog pointer.
00242           g_pMsgLog = m_pMsgLog;
00243           // Use macro to log an initial start messsage.
00244           LOGID(IDS_START_MESSAGE_LOG);
00245           // Now ask COM for the ISample interface to the server's
00246           // CarSample component.  This effectively loads the Server DLL.
00247           LOG("C: Start DLLSERVE Server Trace Logging.");
00248           hr = CoCreateInstance(
00249                  CLSID_DllCarSample,
00250                  NULL,
00251                  CLSCTX_INPROC_SERVER,
00252                  IID_ISample,
00253                  (PPVOID)&m_pCarSample);
00254           if (SUCCEEDED(hr))
00255           {
00256             hr = m_pCarSample->Init(m_hWnd, (PVOID)g_pMsgLog);
00257             // Signal if we succeeded in initializing the app.
00258             bOk = SUCCEEDED(hr);
00259             if (!bOk)
00260             {
00261               RELEASE_INTERFACE(m_pCarSample);
00262               // We ask COM to unload any unused COM Servers.
00263               CoFreeUnusedLibraries();
00264             }
00265           }
00266           else
00267             m_pMsgBox->ErrorID(IDS_NOSERVER);
00268         }
00269       }
00270     }
00271   }
00272
00273   if (!bOk)
00274   {
00275     DELETE_POINTER(m_pMsgBox);
00276     DELETE_POINTER(m_pMsgLog);
00277   }
00278
00279   return (bOk);
00280 }
00281
00282
00283 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00284   Method:   CMainWindow::GetInterface
00285
00286   Summary:  Convenience method that wraps the QueryInterface call
00287             and accepts a main COM object IUnknown pointer as an argument.
00288
00289   Args:     IUnknown* pObj,
00290               Pointer to the COM Object we are getting an interface on.
00291             REFIID riid,
00292               The GUID for the interface that we are seeking.
00293             PPVOID ppv);
00294               Address of the caller's pointer variable that will
00295               receive the requested interface pointer.
00296
00297   Modifies: .
00298
00299   Returns:  BOOL.
00300               TRUE if succeeded.
00301               FALSE if failed.
00302 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00303 BOOL CMainWindow::GetInterface(
00304        IUnknown* pObj,
00305        REFIID riid,
00306        PPVOID ppv)
00307 {
00308   BOOL bResult = FALSE;
00309   HRESULT hr;
00310
00311   *ppv=NULL;
00312
00313   if (NULL != pObj)
00314   {
00315     LOG("C: --Obtaining Interface Pointer.");
00316     hr=pObj->QueryInterface(riid, ppv);
00317
00318     if (FAILED(hr))
00319     {
00320       LOGERROR("C: ???? QueryInterface", hr);
00321     }
00322     else
00323     {
00324       LOGF1("C: Interface obtained. *ppv=0x%X", *ppv);
00325       bResult = TRUE;
00326     }
00327   }
00328   else
00329   {
00330     LOG("C: ???? Create an object first.");
00331   }
00332
00333   return (bResult);
00334 }
00335
00336
00337 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00338   Method:   CMainWindow::DoMenu
00339
00340   Summary:  Dispatch and handle the main menu commands.
00341
00342   Args:     WPARAM wParam,
00343               First message parameter (word sized).
00344             LPARAM lParam)
00345               Second message parameter (long sized).
00346
00347   Modifies: m_ofnFile, ...
00348
00349   Returns:  LRESULT
00350               Standard Windows WindowProc return value.
00351 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00352 LRESULT CMainWindow::DoMenu(
00353           WPARAM wParam,
00354           LPARAM lParam)
00355 {
00356   LRESULT lResult = FALSE;
00357   HRESULT hr;
00358   HMENU hMenu  = ::GetMenu(m_hWnd);
00359   // Here are some interface pointers used to call methods on
00360   // our COUtilityCar, COCruiseCar, and COUtilityCruiseCar COM objects.
00361   ICar* pICar;
00362   IUtility* pIUtility;
00363   ICruise* pICruise;
00364
00365   switch (LOWORD(wParam))
00366   {
00367     //----------------------------------------------------------------------
00368     // Handle File Menu Commands.
00369     //----------------------------------------------------------------------
00370     case IDM_FILE_EXIT:
00371       // The user commands us to exit this application so we tell the
00372       // Main window to close itself.
00373       ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00374       break;
00375
00376     //----------------------------------------------------------------------
00377     // Handle Car Menu Commands.
00378     //----------------------------------------------------------------------
00379     case IDM_CAR_CREATE:
00380       LOG("C: === Car Menu: Create.");
00381       if (NULL == m_pCar)
00382       {
00383         // Call COM service to create an instance.
00384         hr = CoCreateInstance(
00385                CLSID_DllCar,
00386                NULL,
00387                CLSCTX_INPROC_SERVER,
00388                IID_IUnknown,
00389                (PPVOID)&m_pCar);
00390         if (SUCCEEDED(hr))
00391         {
00392           ::CheckMenuItem(
00393               hMenu,
00394               IDM_CAR_CREATE,
00395               MF_BYCOMMAND | MF_CHECKED);
00396         }
00397         else
00398         {
00399           LOGERROR("C: ???? CoCreateInstance",hr);
00400         }
00401       }
00402       else
00403         LOG("C: ???? Car already exists.");
00404       break;
00405     case IDM_CAR_RELEASE:
00406       LOG("C: === Car Menu: Release.");
00407       if (NULL != m_pCar)
00408       {
00409         RELEASE_INTERFACE(m_pCar);
00410         // We ask COM to unload any unused COM Servers.
00411         CoFreeUnusedLibraries();
00412         ::CheckMenuItem(
00413             hMenu,
00414             IDM_CAR_CREATE,
00415             MF_BYCOMMAND | MF_UNCHECKED);
00416       }
00417       else
00418         LOG("C: ???? No Car to Release.");
00419       break;
00420     case IDM_CAR_SHIFT:
00421       LOG("C: === Car Menu: ICar::Shift");
00422       if (GetInterface(m_pCar, IID_ICar, (PPVOID)&pICar))
00423       {
00424         LOG("C: --Calling pICar->Shift");
00425         pICar->Shift(1);
00426         LOG("C: --Releasing pICar");
00427         pICar->Release();
00428       }
00429       break;
00430     case IDM_CAR_CLUTCH:
00431       LOG("C: === Car Menu: ICar::Clutch");
00432       if (GetInterface(m_pCar, IID_ICar, (PPVOID)&pICar))
00433       {
00434         LOG("C: --Calling pICar->Clutch");
00435         pICar->Clutch(100);
00436         LOG("C: --Releasing pICar");
00437         pICar->Release();
00438       }
00439       break;
00440     case IDM_CAR_SPEED:
00441       LOG("C: === Car Menu: ICar::Speed");
00442       if (GetInterface(m_pCar, IID_ICar, (PPVOID)&pICar))
00443       {
00444         LOG("C: --Calling pICar->Speed");
00445         pICar->Speed(20);
00446         LOG("C: --Releasing pICar");
00447         pICar->Release();
00448       }
00449       break;
00450     case IDM_CAR_STEER:
00451       LOG("C: === Car Menu: ICar::Steer");
00452       if (GetInterface(m_pCar, IID_ICar, (PPVOID)&pICar))
00453       {
00454         LOG("C: --Calling pICar->Steer");
00455         pICar->Steer(0);
00456         LOG("C: --Releasing pICar");
00457         pICar->Release();
00458       }
00459       break;
00460
00461     //----------------------------------------------------------------------
00462     // Handle UtilityCar Menu Commands.
00463     //----------------------------------------------------------------------
00464     case IDM_UCAR_CREATE:
00465       LOG("C: === UtilityCar Menu: Create.");
00466       if (NULL == m_pUtilityCar)
00467       {
00468         // Call COM service to create an instance.
00469         hr = CoCreateInstance(
00470                CLSID_DllUtilityCar,
00471                NULL,
00472                CLSCTX_INPROC_SERVER,
00473                IID_IUnknown,
00474                (PPVOID)&m_pUtilityCar);
00475         if (SUCCEEDED(hr))
00476         {
00477           ::CheckMenuItem(
00478               hMenu,
00479               IDM_UCAR_CREATE,
00480               MF_BYCOMMAND | MF_CHECKED);
00481         }
00482         else
00483         {
00484           LOGERROR("C: ???? CoCreateInstance",hr);
00485         }
00486       }
00487       else
00488         LOG("C: ???? UtilityCar already exists.");
00489       break;
00490     case IDM_UCAR_RELEASE:
00491       LOG("C: === UtilityCar Menu: Release.");
00492       if (NULL != m_pUtilityCar)
00493       {
00494         RELEASE_INTERFACE(m_pUtilityCar);
00495         // We ask COM to unload any unused COM Servers.
00496         CoFreeUnusedLibraries();
00497         ::CheckMenuItem(
00498             hMenu,
00499             IDM_UCAR_CREATE,
00500             MF_BYCOMMAND | MF_UNCHECKED);
00501       }
00502       else
00503         LOG("C: ???? No UtilityCar to Release.");
00504       break;
00505     case IDM_UCAR_SHIFT:
00506       LOG("C: === UtilityCar Menu: ICar::Shift");
00507       if (GetInterface(m_pUtilityCar, IID_ICar, (PPVOID)&pICar))
00508       {
00509         LOG("C: --Calling pICar->Shift");
00510         pICar->Shift(2);
00511         LOG("C: --Releasing pICar");
00512         pICar->Release();
00513       }
00514       break;
00515     case IDM_UCAR_CLUTCH:
00516       LOG("C: === UtilityCar Menu: ICar::Clutch");
00517       if (GetInterface(m_pUtilityCar, IID_ICar, (PPVOID)&pICar))
00518       {
00519         LOG("C: --Calling pICar->Clutch");
00520         pICar->Clutch(100);
00521         LOG("C: --Releasing pICar");
00522         pICar->Release();
00523       }
00524       break;
00525     case IDM_UCAR_SPEED:
00526       LOG("C: === UtilityCar Menu: ICar::Speed");
00527       if (GetInterface(m_pUtilityCar, IID_ICar, (PPVOID)&pICar))
00528       {
00529         LOG("C: --Calling pICar->Speed");
00530         pICar->Speed(30);
00531         LOG("C: --Releasing pICar");
00532         pICar->Release();
00533       }
00534       break;
00535     case IDM_UCAR_STEER:
00536       LOG("C: === UtilityCar Menu: ICar::Steer");
00537       if (GetInterface(m_pUtilityCar, IID_ICar, (PPVOID)&pICar))
00538       {
00539         LOG("C: --Calling pICar->Steer");
00540         pICar->Steer(10);
00541         LOG("C: --Releasing pICar");
00542         pICar->Release();
00543       }
00544       break;
00545     case IDM_UCAR_OFFROAD:
00546       LOG("C: === UtilityCar Menu: IUtility::Offroad");
00547       if (GetInterface(m_pUtilityCar, IID_IUtility, (PPVOID)&pIUtility))
00548       {
00549         LOG("C: --Calling pIUtility->Offroad");
00550         pIUtility->Offroad(1);
00551         LOG("C: --Releasing pIUtility");
00552         pIUtility->Release();
00553       }
00554       break;
00555     case IDM_UCAR_WINCH:
00556       LOG("C: === UtilityCar Menu: IUtility::Winch");
00557       if (GetInterface(m_pUtilityCar, IID_IUtility, (PPVOID)&pIUtility))
00558       {
00559         LOG("C: --Calling pIUtility->Winch");
00560         pIUtility->Winch(0);
00561         LOG("C: --Releasing pIUtility");
00562         pIUtility->Release();
00563       }
00564       break;
00565
00566     //----------------------------------------------------------------------
00567     // Handle CruiseCar Menu Commands.
00568     //----------------------------------------------------------------------
00569     case IDM_CCAR_CREATE:
00570       LOG("C: === CruiseCar Menu: Create.");
00571       if (NULL == m_pCruiseCar)
00572       {
00573         // Call COM service to create an instance.
00574         hr = CoCreateInstance(
00575                CLSID_DllCruiseCar,
00576                NULL,
00577                CLSCTX_INPROC_SERVER,
00578                IID_IUnknown,
00579                (PPVOID)&m_pCruiseCar);
00580         if (SUCCEEDED(hr))
00581         {
00582           ::CheckMenuItem(
00583               hMenu,
00584               IDM_CCAR_CREATE,
00585               MF_BYCOMMAND | MF_CHECKED);
00586         }
00587         else
00588         {
00589           LOGERROR("C: ???? CoCreateInstance",hr);
00590         }
00591       }
00592       else
00593         LOG("C: ???? CruiseCar already exists.");
00594       break;
00595     case IDM_CCAR_RELEASE:
00596       LOG("C: === CruiseCar Menu: Release.");
00597       if (NULL != m_pCruiseCar)
00598       {
00599         RELEASE_INTERFACE(m_pCruiseCar);
00600         // We ask COM to unload any unused COM Servers.
00601         CoFreeUnusedLibraries();
00602         ::CheckMenuItem(
00603             hMenu,
00604             IDM_CCAR_CREATE,
00605             MF_BYCOMMAND | MF_UNCHECKED);
00606       }
00607       else
00608         LOG("C: ???? No CruiseCar to Release.");
00609       break;
00610     case IDM_CCAR_SHIFT:
00611       LOG("C: === CruiseCar Menu: ICar::Shift");
00612       if (GetInterface(m_pCruiseCar, IID_ICar, (PPVOID)&pICar))
00613       {
00614         LOG("C: --Calling pICar->Shift");
00615         pICar->Shift(4);
00616         LOG("C: --Releasing pICar");
00617         pICar->Release();
00618       }
00619       break;
00620     case IDM_CCAR_CLUTCH:
00621       LOG("C: === CruiseCar Menu: ICar::Clutch");
00622       if (GetInterface(m_pCruiseCar, IID_ICar, (PPVOID)&pICar))
00623       {
00624         LOG("C: --Calling pICar->Clutch");
00625         pICar->Clutch(100);
00626         LOG("C: --Releasing pICar");
00627         pICar->Release();
00628       }
00629       break;
00630     case IDM_CCAR_SPEED:
00631       LOG("C: === CruiseCar Menu: ICar::Speed");
00632       if (GetInterface(m_pCruiseCar, IID_ICar, (PPVOID)&pICar))
00633       {
00634         LOG("C: --Calling pICar->Speed");
00635         pICar->Speed(60);
00636         LOG("C: --Releasing pICar");
00637         pICar->Release();
00638       }
00639       break;
00640     case IDM_CCAR_STEER:
00641       LOG("C: === CruiseCar Menu: ICar::Steer");
00642       if (GetInterface(m_pCruiseCar, IID_ICar, (PPVOID)&pICar))
00643       {
00644         LOG("C: --Calling pICar->Steer");
00645         pICar->Steer(0);
00646         LOG("C: --Releasing pICar");
00647         pICar->Release();
00648       }
00649       break;
00650     case IDM_CCAR_ENGAGE:
00651       LOG("C: === CruiseCar Menu: ICruise::Engage");
00652       if (GetInterface(m_pCruiseCar, IID_ICruise, (PPVOID)&pICruise))
00653       {
00654         LOG("C: --Calling pICruise->Engage");
00655         pICruise->Engage(TRUE);
00656         LOG("C: --Releasing pICruise");
00657         pICruise->Release();
00658       }
00659       break;
00660     case IDM_CCAR_ADJUST:
00661       LOG("C: === CruiseCar Menu: ICruise::Adjust");
00662       if (GetInterface(m_pCruiseCar, IID_ICruise, (PPVOID)&pICruise))
00663       {
00664         LOG("C: --Calling pICruise->Adjust");
00665         pICruise->Adjust(FALSE);
00666         LOG("C: --Releasing pICruise");
00667         pICruise->Release();
00668       }
00669       break;
00670
00671     //----------------------------------------------------------------------
00672     // Handle UtilityCruiseCar Menu Commands.
00673     //----------------------------------------------------------------------
00674     case IDM_UCRU_CREATE:
00675       LOG("C: === UtilityCruiseCar Menu: Create.");
00676       if (NULL == m_pUtilityCruiseCar)
00677       {
00678         // Call a create function to create an instance.
00679         hr = CreateUtilityCruiseCar(
00680                NULL,
00681                IID_IUnknown,
00682                (PPVOID)&m_pUtilityCruiseCar);
00683         if (SUCCEEDED(hr))
00684         {
00685           ::CheckMenuItem(
00686               hMenu,
00687               IDM_UCRU_CREATE,
00688               MF_BYCOMMAND | MF_CHECKED);
00689         }
00690         else
00691         {
00692           LOGERROR("C: ???? UtilityCruiseCar creation",hr);
00693         }
00694       }
00695       else
00696         LOG("C: ???? UtilityCruiseCar already exists.");
00697       break;
00698     case IDM_UCRU_RELEASE:
00699       LOG("C: === UtilityCruiseCar Menu: Release.");
00700       if (NULL != m_pUtilityCruiseCar)
00701       {
00702         RELEASE_INTERFACE(m_pUtilityCruiseCar);
00703         // We ask COM to unload any unused COM Servers.
00704         CoFreeUnusedLibraries();
00705         ::CheckMenuItem(
00706             hMenu,
00707             IDM_UCRU_CREATE,
00708             MF_BYCOMMAND | MF_UNCHECKED);
00709       }
00710       else
00711         LOG("C: ???? No UtilityCruiseCar to Release.");
00712       break;
00713     case IDM_UCRU_SHIFT:
00714       LOG("C: === UtilityCruiseCar Menu: ICar::Shift");
00715       if (GetInterface(m_pUtilityCruiseCar, IID_ICar, (PPVOID)&pICar))
00716       {
00717         LOG("C: --Calling pICar->Shift");
00718         pICar->Shift(1);
00719         LOG("C: --Releasing pICar");
00720         pICar->Release();
00721       }
00722       break;
00723     case IDM_UCRU_CLUTCH:
00724       LOG("C: === UtilityCruiseCar Menu: ICar::Clutch");
00725       if (GetInterface(m_pUtilityCruiseCar, IID_ICar, (PPVOID)&pICar))
00726       {
00727         LOG("C: --Calling pICar->Clutch");
00728         pICar->Clutch(80);
00729         LOG("C: --Releasing pICar");
00730         pICar->Release();
00731       }
00732       break;
00733     case IDM_UCRU_SPEED:
00734       LOG("C: === UtilityCruiseCar Menu: ICar::Speed");
00735       if (GetInterface(m_pUtilityCruiseCar, IID_ICar, (PPVOID)&pICar))
00736       {
00737         LOG("C: --Calling pICar->Speed");
00738         pICar->Speed(10);
00739         LOG("C: --Releasing pICar");
00740         pICar->Release();
00741       }
00742       break;
00743     case IDM_UCRU_STEER:
00744       LOG("C: === UtilityCruiseCar Menu: ICar::Steer");
00745       if (GetInterface(m_pUtilityCruiseCar, IID_ICar, (PPVOID)&pICar))
00746       {
00747         LOG("C: --Calling pICar->Steer");
00748         pICar->Steer(10);
00749         LOG("C: --Releasing pICar");
00750         pICar->Release();
00751       }
00752       break;
00753     case IDM_UCRU_ENGAGE:
00754       LOG("C: === UtilityCruiseCar Menu: ICruise::Engage");
00755       if (GetInterface(m_pUtilityCruiseCar, IID_ICruise, (PPVOID)&pICruise))
00756       {
00757         LOG("C: --Calling pICruise->Engage");
00758         pICruise->Engage(FALSE);
00759         LOG("C: --Releasing pICruise");
00760         pICruise->Release();
00761       }
00762       break;
00763     case IDM_UCRU_ADJUST:
00764       LOG("C: === UtilityCruiseCar Menu: ICruise::Adjust");
00765       if (GetInterface(m_pUtilityCruiseCar, IID_ICruise, (PPVOID)&pICruise))
00766       {
00767         LOG("C: --Calling pICruise->Adjust");
00768         pICruise->Adjust(FALSE);
00769         LOG("C: --Releasing pICruise");
00770         pICruise->Release();
00771       }
00772       break;
00773     case IDM_UCRU_OFFROAD:
00774       LOG("C: === UtilityCruiseCar Menu: IUtility::Offroad");
00775       if (GetInterface(m_pUtilityCruiseCar, IID_IUtility, (PPVOID)&pIUtility))
00776       {
00777         LOG("C: --Calling pIUtility->Offroad");
00778         pIUtility->Offroad(3);
00779         LOG("C: --Releasing pIUtility");
00780         pIUtility->Release();
00781       }
00782       break;
00783     case IDM_UCRU_WINCH:
00784       LOG("C: === UtilityCruiseCar Menu: IUtility::Winch");
00785       if (GetInterface(m_pUtilityCruiseCar, IID_IUtility, (PPVOID)&pIUtility))
00786       {
00787         LOG("C: --Calling pIUtility->Winch");
00788         pIUtility->Winch(0);
00789         LOG("C: --Releasing pIUtility");
00790         pIUtility->Release();
00791       }
00792       break;
00793
00794     //----------------------------------------------------------------------
00795     // Handle Log Menu Commands.
00796     //----------------------------------------------------------------------
00797     case IDM_LOG_LOGCLEAR:
00798       // Clear the message log.
00799       m_pMsgLog->Clear();
00800       // Use macro to log messages.
00801       LOGID(IDS_START_MESSAGE_LOG);
00802       break;
00803     case IDM_LOG_LOGGING:
00804       // Toggle the state of the Message Logging.
00805       // Toggle the checkmark indicator on the menu selection as well.
00806       {
00807         HMENU hMenu  = ::GetMenu(m_hWnd);
00808         BOOL bLogging = ::GetMenuState(
00809                             hMenu,
00810                             IDM_LOG_LOGGING,
00811                             MF_BYCOMMAND) & MF_CHECKED;
00812         if (bLogging)
00813         {
00814           m_pMsgLog->Logging(FALSE);
00815           ::CheckMenuItem(
00816               hMenu,
00817               IDM_LOG_LOGGING,
00818               MF_BYCOMMAND | MF_UNCHECKED);
00819         }
00820         else
00821         {
00822           m_pMsgLog->Logging(TRUE);
00823           ::CheckMenuItem(
00824               hMenu,
00825               IDM_LOG_LOGGING,
00826               MF_BYCOMMAND | MF_CHECKED);
00827         }
00828       }
00829       break;
00830     case IDM_LOG_COPYCLIP:
00831       // Copy trace message log to clipboard.
00832       m_pMsgLog->Copy();
00833       break;
00834
00835     //----------------------------------------------------------------------
00836     // Handle Help Menu Commands.
00837     //----------------------------------------------------------------------
00838     case IDM_HELP_CONTENTS:
00839       // We have some stubbed support here for bringing up the online
00840       // Help for this application.
00841       ReadHelp(m_hWnd, m_szHelpFile);
00842       break;
00843     case IDM_HELP_TUTORIAL:
00844       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00845       // tutorial narrative file associated with this tutorial code sample.
00846       ReadTutorial(m_hInst, m_hWnd, TEXT(HTML_FILE_EXT));
00847       break;
00848     case IDM_HELP_TUTSERVER:
00849       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00850       // tutorial narrative file associated with the COM server.
00851       ReadTutorial(m_hInst, m_hWnd, TEXT(SERVER_TUTFILE_STR));
00852       break;
00853     case IDM_HELP_TUTREGISTER:
00854       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00855       // tutorial narrative file associated with the Registration utility.
00856       ReadTutorial(m_hInst, m_hWnd, TEXT(REGISTER_TUTFILE_STR));
00857       break;
00858     case IDM_HELP_READSOURCE:
00859       // Call the APPUTIL utility function ReadSource to allow the
00860       // user to open and read any of the source files of DLLCLIEN.
00861       ReadSource(m_hWnd, &m_ofnFile);
00862       break;
00863     case IDM_HELP_ABOUT:
00864       {
00865         CAboutBox dlgAboutBox;
00866
00867         LOG("C: === Help Menu: About DLLCLIEN.");
00868         // Show the standard About Box dialog for this EXE by telling the
00869         // dialog C++ object to show itself by invoking its ShowDialog
00870         // method.  Pass it this EXE instance and the parent window handle.
00871         // Use a dialog resource ID for the dialog template stored in
00872         // this EXE module's resources.
00873         dlgAboutBox.ShowDialog(
00874           m_hInst,
00875           MAKEINTRESOURCE(IDM_HELP_ABOUT),
00876           m_hWnd);
00877       }
00878       break;
00879     case IDM_HELP_ABOUTSERVER:
00880       // Call the CarSample to show its AboutBox dialog.
00881       LOG("C: === Help Menu: About DLLSERVE.");
00882       m_pCarSample->AboutBox(m_hWnd);
00883       break;
00884
00885     default:
00886       // Defer all messages NOT handled here to the Default Window Proc.
00887       lResult = ::DefWindowProc(m_hWnd, WM_COMMAND, wParam, lParam);
00888       break;
00889   }
00890
00891   return(lResult);
00892 }
00893
00894
00895 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00896   Method:   CMainWindow::WindowProc
00897
00898   Summary:  Main window procedure for this window object.  See CVirWindow
00899             in the APPUTIL library (APPUTIL.CPP) for details on how this
00900             method gets called by the global WindowProc.
00901
00902   Args:     UINT uMsg,
00903               Windows message that is "sent" to this window.
00904             WPARAM wParam,
00905               First message parameter (word sized).
00906             LPARAM lParam)
00907               Second message parameter (long sized).
00908
00909   Modifies: ...
00910
00911   Returns:  LRESULT
00912               Standard Windows WindowProc return value.
00913 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00914 LRESULT CMainWindow::WindowProc(
00915           UINT uMsg,
00916           WPARAM wParam,
00917           LPARAM lParam)
00918 {
00919   LRESULT lResult = FALSE;
00920
00921   switch (uMsg)
00922   {
00923     case WM_CREATE:
00924       {
00925         // Setup for painting text in this window.
00926         HDC hdc = GetDC(m_hWnd);
00927         ::GetTextMetrics(hdc, &m_tm);
00928         ::ReleaseDC(m_hWnd, hdc);
00929       }
00930       break;
00931
00932     case WM_MEASUREITEM:
00933       // Get setup for painting text in this window.
00934       {
00935         LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam;
00936         lpmis->itemHeight = m_tm.tmHeight + m_tm.tmExternalLeading;
00937         lpmis->itemWidth = m_wWidth;
00938         lResult = TRUE;
00939       }
00940
00941     case WM_SIZE:
00942       // Handle a resize of this window.
00943       m_wWidth = LOWORD(lParam);
00944       m_wHeight = HIWORD(lParam);
00945       // Resize the Message Log ListBox
00946       m_pMsgLog->Resize(m_wWidth, m_wHeight);
00947       break;
00948
00949     case WM_COMMAND:
00950       // Dispatch and handle any Menu command messages received.
00951       lResult = DoMenu(wParam, lParam);
00952       break;
00953
00954     case WM_CLOSE:
00955       // The user selected Close on the main window's System menu
00956       // or Exit on the File menu.
00957     case WM_QUIT:
00958       // If the app is being quit then close any associated help windows.
00959     default:
00960       // Defer all messages NOT handled here to the Default Window Proc.
00961       lResult = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
00962       break;
00963   }
00964
00965   return(lResult);
00966 }
00967
00968
00969 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00970   Function: UnicodeOk
00971
00972   Summary:  Checks if the platform will handle unicode versions of
00973             Win32 string API calls.
00974
00975   Args:     void
00976
00977   Returns:  BOOL
00978               TRUE if unicode support; FALSE if not.
00979 ------------------------------------------------------------------------F-F*/
00980 BOOL UnicodeOk(void)
00981 {
00982   BOOL bOk = TRUE;
00983   TCHAR szUserName[MAX_STRING_LENGTH];
00984   DWORD dwSize = MAX_STRING_LENGTH;
00985
00986   if (!GetUserName(szUserName, &dwSize))
00987     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00988
00989   return bOk;
00990 }
00991
00992
00993 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00994   Function: InitApplication
00995
00996   Summary:  Initializes the application and registers its main window
00997             class. InitApplication is called only once (in WinMain).
00998
00999   Args:     HINSTANCE hInstance)
01000               Handle to the first instance of the application.
01001
01002   Returns:  BOOL.
01003               TRUE if success.
01004               FALSE if fail.
01005 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01006 BOOL InitApplication(
01007        HINSTANCE hInstance)
01008 {
01009   BOOL bOk;
01010   // The window class for all instances of the main frame window.
01011   WNDCLASSEX wcf;
01012
01013   // Assign the appropriate values for this main frame window class.
01014   wcf.cbSize        = sizeof(WNDCLASSEX);
01015   wcf.cbClsExtra    = 0;            // No per-class extra data.
01016   wcf.cbWndExtra    = 0;            // No per-window extra data.
01017   wcf.hInstance     = hInstance;    // Application module instance.
01018   wcf.lpfnWndProc   = &WindowProc;  // Global Window Procedure (defined in
01019                                     // APPUTIL for all CVirWindows).
01020   wcf.hCursor       = LoadCursor(NULL, IDC_ARROW); // Load app cursor.
01021   wcf.hIcon         = (HICON) LoadIcon(            // Load app icon.
01022                                 hInstance,
01023                                 TEXT("AppIcon"));
01024   wcf.hIconSm       = (HICON) LoadImage(           // Load small icon.
01025                                 hInstance,
01026                                 TEXT("AppIcon"),
01027                                 IMAGE_ICON,
01028                                 16, 16,
01029                                 0);
01030   wcf.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);  // Default backgnd color.
01031   wcf.style         = CS_HREDRAW | CS_VREDRAW;     // Class style(s).
01032   wcf.lpszClassName = TEXT(MAIN_WINDOW_CLASS_NAME_STR); // Class name.
01033   wcf.lpszMenuName  = TEXT(MAIN_WINDOW_CLASS_MENU_STR); // Menu name.
01034
01035   // Register the window class and return FALSE if unsuccesful.
01036   bOk = RegisterClassEx(&wcf);
01037
01038   return (bOk);
01039 }
01040
01041
01042 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
01043   Function: WinMain
01044
01045   Summary:  The Windows main entry point function for this application.
01046             Initializes the application, the COM Libraries, and starts
01047             the main application message loop.
01048
01049   Args:     HINSTANCE hInstance,
01050               Instance handle; a new one for each invocation of this app.
01051             HINSTANCE hPrevInstance,
01052               Instance handle of the previous instance. NULL in Win32.
01053             LPSTR lpCmdLine,
01054               Windows passes a pointer to the application's
01055               invocation command line.
01056             int nCmdShow)
01057               Bits telling the show state of the application.
01058
01059   Returns:  int
01060               msg.wParam (upon exit of message loop).
01061               FALSE if this instance couldn't initialize and run.
01062 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
01063 extern "C" int PASCAL WinMain(
01064                         HINSTANCE hInstance,
01065                         HINSTANCE hPrevInstance,
01066                         LPSTR lpCmdLine,
01067                         int nCmdShow)
01068 {
01069   CMainWindow* pWin = NULL;
01070   MSG msg;
01071   HACCEL hAccel;
01072   int iRun = FALSE;
01073
01074   // If we were compiled for UNICODE and the platform seems OK with this
01075   // then proceed.  Else we error and exit the app.
01076   if (UnicodeOk())
01077   {
01078     // Call to initialize the COM Library.  Use the SUCCEEDED macro
01079     // to detect success.  If fail then exit app with error message.
01080     if (SUCCEEDED(CoInitialize(NULL)))
01081     {
01082       // If we succeeded in initializing the COM Library we proceed to
01083       // initialize the application.  If we can't init the application
01084       // then we signal shut down with an error message exit.
01085       iRun = InitApplication(hInstance);
01086       if (iRun)
01087       {
01088         // Assume we'll set iRun to TRUE when initialization is done.
01089         iRun = FALSE;
01090         // We are still go for running so we try to create a nifty new
01091         // CMainWindow object for this app instance.
01092         pWin = new CMainWindow;
01093         if (NULL != pWin)
01094         {
01095           // Now we initialize an instance of the new CMainWindow.
01096           // This includes creating the main window.
01097           if (pWin->InitInstance(hInstance, nCmdShow))
01098           {
01099             // Load the keyboard accelerators from the resources.
01100             hAccel = LoadAccelerators(hInstance, TEXT("AppAccel"));
01101             if (NULL != hAccel)
01102             {
01103               // Signal App Initialization is successfully done.
01104               iRun = TRUE;
01105             }
01106           }
01107         }
01108       }
01109
01110       if (iRun)
01111       {
01112         // If we initialized the app instance properly then we are still
01113         // go for running.  We then start up the main message pump for
01114         // the application.
01115         while (GetMessage(&msg, NULL, 0, 0))
01116         {
01117           if (!TranslateAccelerator(
01118                  pWin->GetHwnd(),
01119                  hAccel,
01120                  &msg))
01121           {
01122             TranslateMessage(&msg);
01123             DispatchMessage(&msg);
01124           }
01125         }
01126
01127         // We ask COM to unload any unused COM Servers.
01128         CoFreeUnusedLibraries();
01129
01130         // We'll pass to Windows the reason why we exited the message loop.
01131         iRun = (int) msg.wParam;
01132       }
01133       else
01134       {
01135         // We failed to initialize the application. Put up error message
01136         // box saying that application couldn't be initialized.  Parent
01137         // window is desktop (ie, NULL). Exit the failed application
01138         // (ie, by returning FALSE to WinMain).
01139         ErrorBox(hInstance, NULL, IDS_APPINITFAILED);
01140
01141         // Delete the CMainWindow object.
01142         DELETE_POINTER(pWin);
01143       }
01144
01145       // We're exiting this app (either normally or by init failure) so
01146       // shut down the COM Library.
01147       CoUninitialize();
01148     }
01149     else
01150     {
01151       // We failed to Initialize the COM Library. Put up error message box
01152       // saying that COM Library couldn't be initialized.  Parent window
01153       // is desktop (ie, NULL). Exit the failed application (ie, by
01154       // returning FALSE to WinMain).
01155       ErrorBox(hInstance, NULL, IDS_COMINITFAILED);
01156     }
01157   }
01158   else
01159   {
01160     // If we were compiled for UNICODE but the platform has problems with
01161     // this then indicate an error and exit the app immediately.
01162     CHAR szMsg[MAX_STRING_LENGTH];
01163
01164     if (LoadStringA(
01165           hInstance,
01166           IDS_NOUNICODE,
01167           szMsg,
01168           MAX_STRING_LENGTH))
01169     {
01170       MessageBoxA(
01171         NULL,
01172         szMsg,
01173         ERROR_TITLE_STR,
01174         MB_OK | MB_ICONEXCLAMATION);
01175     }
01176   }
01177
01178   return iRun;
01179 }
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

fullsvr::ICallFactory Member List

This is the complete list of members for fullsvr::ICallFactory, including all inherited members.
CreateCall(com.ms.com._Guid riid, IUnknown pCtrlUnk, com.ms.com._Guid riid2, IUnknown[] ppv) | fullsvr::ICallFactory |
iid | fullsvr::ICallFactory | [static]
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/Provider.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

Provider.Cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  Provider.cpp
00006 //
00007 // Description:
00008 //      Implementation for the command-line event consumer provider class
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include "stdafx.h"
00015 #include "Provider.h"
00016 #include "Consumer.h"
00017 #include <objbase.h>
00018
00019 CProvider::CProvider(CListBox *pOutputList)
00020 {
00021   m_cRef = 0L;
00022   m_pOutputList = pOutputList;
00023 }
00024
00025 CProvider::~CProvider()
00026 {
00027 }
00028
00029 STDMETHODIMP CProvider::QueryInterface(REFIID riid, LPVOID FAR *ppv)
00030 {
00031     *ppv=NULL;
00032
00033     if (riid == IID_IUnknown || riid == IID_IWbemEventConsumerProvider)
00034         *ppv=this;
00035
00036     if (*ppv != NULL)
00037     {
00038         ((LPUNKNOWN)*ppv)->AddRef();
00039         return NOERROR;
00040     }
00041
00042     return E_NOINTERFACE;
00043 }
00044
00045 STDMETHODIMP_(ULONG) CProvider::AddRef(void)
00046 {
00047     return ++m_cRef;
00048 }
00049
00050 STDMETHODIMP_(ULONG) CProvider::Release(void)
00051 {
00052     if (--m_cRef != 0L)
00053         return m_cRef;
00054
00055     delete this;
00056     return 0L;
00057 }
00058
00059 //-----------------------------------------------------------
00060 STDMETHODIMP CProvider::FindConsumer(
00061             IWbemClassObject* pLogicalConsumer,
00062             IWbemUnboundObjectSink** ppConsumer)
00063 {
00064   // create the logical consumer.
00065   CConsumer* pSink = new CConsumer(m_pOutputList);
00066   if (pSink == NULL)
00067     return E_OUTOFMEMORY;
00068
00069   // return it's "sink" interface.
00070   return pSink->QueryInterface(IID_IWbemUnboundObjectSink,
00071                                         (void**)ppConsumer);
00072 }
00073
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/people.h Source File

  • SysMgmt
  • MMC
  • Proppage

people.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _PEOPLE_H
00021 #define _PEOPLE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CBicycle : public CDelegationBase {
00026 public:
00027     CBicycle(int i) : id(i) { }
00028     virtual ~CBicycle() {}
00029
00030     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00031     virtual const GUID & getNodeType() { return thisGuid; }
00032     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00033
00034 private:
00035     // {2974380D-4C4B-11d2-89D8-000021473128}
00036     static const GUID thisGuid;
00037
00038     int id;
00039 };
00040
00041 class CBicycleFolder : public CDelegationBase {
00042 public:
00043     CBicycleFolder();
00044     virtual ~CBicycleFolder();
00045
00046     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Bicycles"); }
00047     virtual const GUID & getNodeType() { return thisGuid; }
00048     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00049
00050 public:
00051     // virtual functions go here (for MMCN_*)
00052     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00053
00054 private:
00055     // {2974380D-4C4B-11d2-89D8-000021473128}
00056     static const GUID thisGuid;
00057
00058     enum { NUMBER_OF_CHILDREN = 20 };
00059     CDelegationBase *children[NUMBER_OF_CHILDREN];
00060 };
00061
00062 class CSkateboard : public CDelegationBase {
00063 public:
00064     CSkateboard(int i) : id(i) { }
00065     virtual ~CSkateboard() {}
00066
00067     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00068     virtual const GUID & getNodeType() { return thisGuid; }
00069     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00070
00071 private:
00072     // {2974380D-4C4B-11d2-89D8-000021473128}
00073     static const GUID thisGuid;
00074
00075     int id;
00076 };
00077
00078 class CSkateboardFolder : public CDelegationBase {
00079 public:
00080     CSkateboardFolder();
00081     virtual ~CSkateboardFolder();
00082
00083     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Skateboards"); }
00084     virtual const GUID & getNodeType() { return thisGuid; }
00085     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00086
00087 public:
00088     // virtual functions go here (for MMCN_*)
00089     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00090
00091 private:
00092     // {2974380D-4C4B-11d2-89D8-000021473128}
00093     static const GUID thisGuid;
00094
00095     enum { NUMBER_OF_CHILDREN = 20 };
00096     CDelegationBase *children[NUMBER_OF_CHILDREN];
00097 };
00098
00099 class CIceSkate : public CDelegationBase {
00100 public:
00101     CIceSkate(int i) : id(i) { }
00102     virtual ~CIceSkate() {}
00103
00104     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00105     virtual const GUID & getNodeType() { return thisGuid; }
00106     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00107
00108 private:
00109     // {2974380D-4C4B-11d2-89D8-000021473128}
00110     static const GUID thisGuid;
00111
00112     int id;
00113 };
00114
00115 class CIceSkateFolder : public CDelegationBase {
00116 public:
00117     CIceSkateFolder();
00118     virtual ~CIceSkateFolder();
00119
00120     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Ice Skates"); }
00121     virtual const GUID & getNodeType() { return thisGuid; }
00122     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00123
00124 public:
00125     // virtual functions go here (for MMCN_*)
00126     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00127
00128 private:
00129     // {2974380D-4C4B-11d2-89D8-000021473128}
00130     static const GUID thisGuid;
00131
00132     enum { NUMBER_OF_CHILDREN = 20 };
00133     CDelegationBase *children[NUMBER_OF_CHILDREN];
00134 };
00135
00136 class CPeoplePoweredVehicle : public CDelegationBase {
00137 public:
00138     CPeoplePoweredVehicle();
00139     virtual ~CPeoplePoweredVehicle();
00140
00141     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("People-powered Vehicles"); }
00142     virtual const GUID & getNodeType() { return thisGuid; }
00143     virtual const int GetBitmapIndex() { return INDEX_PEOPLEICON; }
00144
00145     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00146
00147 private:
00148     enum { IDM_NEW_PEOPLE = 1 };
00149
00150     // {2974380D-4C4B-11d2-89D8-000021473128}
00151     static const GUID thisGuid;
00152
00153     enum { NUMBER_OF_CHILDREN = 3 };
00154     CDelegationBase *children[3];
00155 };
00156
00157 #endif // _PEOPLE_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DEB_THREAD_LIST_INFO_STRUCT Member List

This is the complete list of members for DEB_THREAD_LIST_INFO_STRUCT, including all inherited members.
dwActiveThreads DEB_THREAD_LIST_INFO_STRUCT
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmDebug/StdAfx.Cpp Source File

  • Com
  • Services
  • Crm
  • CrmDebug

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • CMenu

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00025 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00026
00027 //==============================================================
00028 //
00029 // CDelegationBase implementation
00030 //
00031 //
00032 CDelegationBase::CDelegationBase()
00033 : bExpanded(FALSE)
00034 {
00035     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00036         LoadBitmaps();
00037 }
00038
00039 CDelegationBase::~CDelegationBase()
00040 {
00041 }
00042
00043 // CDelegationBase::AddImages sets up the collection of images to be displayed
00044 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00045 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00046 {
00047     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00048         (long *)m_pBMapLg, // pointer to a handle
00049         0, // index of the first image in the strip
00050         RGB(0, 128, 128)  // color of the icon mask
00051         );
00052 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DropExt/DefClsF.C Source File

  • WinUI
  • Shell
  • DropExt

DefClsF.C

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1995 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Development Tools and/or SDK documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \******************************************************************************/
00010
00011 //
00012 // This file contains the implementation of SHCreateDefClassObject
00013 //
00014
00015 #include "priv.h"
00016
00017 //=========================================================================
00018 // CDefClassFactory class
00019 //=========================================================================
00020
00021 STDMETHODIMP CDefClassFactory_QueryInterface(IClassFactory FAR * pcf, REFIID riid, LPVOID FAR* ppvObj);
00022 ULONG STDMETHODCALLTYPE CDefClassFactory_AddRef(IClassFactory FAR * pcf);
00023 ULONG STDMETHODCALLTYPE CDefClassFactory_Release(IClassFactory FAR * pcf);
00024 STDMETHODIMP CDefClassFactory_CreateInstance(IClassFactory FAR * pcf, LPUNKNOWN pUnkOuter,
00025                               REFIID riid,
00026                               LPVOID FAR* ppvObject);
00027 STDMETHODIMP CDefClassFactory_LockServer(IClassFactory FAR * pcf, BOOL fLock);
00028
00029 //
00030 // CDefClassFactory: Class definition
00031 //
00032 /*
00033 #pragma data_seg(".text")
00034 */
00035 IClassFactoryVtbl c_vtblAppUIClassFactory = {
00036             CDefClassFactory_QueryInterface,
00037             CDefClassFactory_AddRef,
00038             CDefClassFactory_Release,
00039             CDefClassFactory_CreateInstance,
00040       CDefClassFactory_LockServer
00041 };
00042 /*
00043 #pragma data_seg()
00044 */
00045
00046 typedef struct
00047 {
00048     IClassFactory      cf;
00049     UINT               cRef;    // Reference count
00050     LPFNCREATEINSTANCE lpfnCI;    // CreateInstance callback entry
00051     UINT FAR *         pcRefDll;  // Reference count of the DLL
00052     const IID FAR *    riidInst;    // Optional interface for instance
00053 } CDefClassFactory;
00054
00055 //
00056 // CDefClassFactory::QueryInterface
00057 //
00058 STDMETHODIMP CDefClassFactory_QueryInterface(IClassFactory FAR * pcf, REFIID riid, LPVOID FAR* ppvObj)
00059 {
00060     CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);
00061     if (IsEqualIID(riid, &IID_IClassFactory)
00062      || IsEqualIID(riid, &IID_IUnknown))
00063     {
00064   (LPCLASSFACTORY)*ppvObj = &this->cf;
00065   this->cRef++;
00066         return NOERROR;
00067     }
00068     return ResultFromScode(E_NOINTERFACE);
00069 }
00070
00071 //
00072 // CDefClassFactory::AddRef
00073 //
00074 ULONG STDMETHODCALLTYPE CDefClassFactory_AddRef(IClassFactory FAR * pcf)
00075 {
00076     CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);
00077     return (++this->cRef);
00078 }
00079
00080 //
00081 // CDefClassFactory::Release
00082 //
00083 ULONG STDMETHODCALLTYPE CDefClassFactory_Release(IClassFactory FAR * pcf)
00084 {
00085     CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);
00086     if (--this->cRef > 0)
00087   return this->cRef;
00088
00089     if (this->pcRefDll) {
00090   (*this->pcRefDll)--;
00091     }
00092     LocalFree((HLOCAL)this);
00093
00094     return 0;
00095 }
00096
00097 //
00098 // CDefClassFactory::CDefClassFactory
00099 //
00100 STDMETHODIMP CDefClassFactory_CreateInstance(IClassFactory FAR * pcf, LPUNKNOWN pUnkOuter,
00101                               REFIID riid,
00102                               LPVOID FAR* ppvObject)
00103 {
00104     CDefClassFactory * this=IToClassN(CDefClassFactory, cf, pcf);
00105
00106     //
00107     // We don't support aggregation at all.
00108     //
00109     if (pUnkOuter)
00110     {
00111   return ResultFromScode(CLASS_E_NOAGGREGATION);
00112     }
00113
00114     //
00115     // if this->riidInst is specified, they should match.
00116     //
00117     if (this->riidInst==NULL
00118      || IsEqualIID(riid, this->riidInst)
00119      || IsEqualIID(riid, &IID_IUnknown))
00120     {
00121   return this->lpfnCI(pUnkOuter, riid, ppvObject);
00122     }
00123
00124     return ResultFromScode(E_NOINTERFACE);
00125 }
00126
00127 //
00128 // CDefClassFactory::LockServer
00129 //
00130 STDMETHODIMP CDefClassFactory_LockServer(IClassFactory FAR * pcf, BOOL fLock)
00131 {
00132     return ResultFromScode(E_NOTIMPL);
00133 }
00134
00135
00136 //
00137 // CDefClassFactory constructor
00138 //
00139 CDefClassFactory * NEAR PASCAL CDefClassFactory_Create(
00140       LPFNCREATEINSTANCE lpfnCI, UINT FAR * pcRefDll, REFIID riidInst)
00141 {
00142     register CDefClassFactory * pacf;
00143     pacf = (CDefClassFactory *)LocalAlloc(LPTR, sizeof(CDefClassFactory));
00144     if (pacf)
00145     {
00146   pacf->cf.lpVtbl = &c_vtblAppUIClassFactory;
00147   pacf->cRef++;  // pacf->cRef=0; (generates smaller code)
00148   pacf->pcRefDll = pcRefDll;
00149   pacf->lpfnCI = lpfnCI;
00150   pacf->riidInst = riidInst;
00151   if (pcRefDll) {
00152       (*pcRefDll)++;
00153   }
00154     }
00155     return pacf;
00156 }
00157
00158
00159 STDAPI Shell_CreateDefClassObject(REFIID riid, LPVOID FAR* ppv,
00160        LPFNCREATEINSTANCE lpfnCI, UINT FAR * pcRefDll,
00161        REFIID riidInst)
00162 {
00163     MessageBeep(0);
00164     // DebugMsg(DM_TRACE, "Shell_CreateDefClassObject: obsolete, use SHCreateDefClassObject");
00165     return SHCreateDefClassObject(riid, ppv, lpfnCI, pcRefDll, riidInst);
00166 }
00167
00168 //
00169 // creates a simple default implementation of IClassFactory
00170 //
00171 // Parameters:
00172 //  riid     -- Specifies the interface to the class object
00173 //  ppv      -- Specifies the pointer to LPVOID where the class object pointer
00174 //               will be returned.
00175 //  lpfnCI   -- Specifies the callback entry for instanciation.
00176 //  pcRefDll -- Specifies the address to the DLL reference count (optional)
00177 //  riidInst -- Specifies the interface to the instance (optional).
00178 //
00179 // Notes:
00180 //   The riidInst will be specified only if the instance of the class
00181 //  support only one interface.
00182 //
00183 STDAPI SHCreateDefClassObject(REFIID riid, LPVOID FAR* ppv,
00184        LPFNCREATEINSTANCE lpfnCI, UINT FAR * pcRefDll,
00185        REFIID riidInst)
00186 {
00187     // The default class factory supports only IClassFactory interface
00188     if (IsEqualIID(riid, &IID_IClassFactory))
00189     {
00190   CDefClassFactory * pacf = CDefClassFactory_Create(lpfnCI, pcRefDll, riidInst);
00191   if (pacf)
00192   {
00193       (IClassFactory FAR *)*ppv = &pacf->cf;
00194       return NOERROR;
00195   }
00196   return ResultFromScode(E_OUTOFMEMORY);
00197     }
00198     return ResultFromScode(E_NOINTERFACE);
00199 }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/MyDevice.idl Source File

  • NetDS
  • upnp
  • StepByStep
  • Step3

MyDevice.idl

Go to the documentation of this file.
00001 // MyDevice.idl : IDL source for MyDevice.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (MyDevice.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009 /*
00010   [
00011     object,
00012     uuid(B620B328-B1ED-4205-8593-08C762C96562),
00013     dual,
00014     helpstring("IDimmer Interface"),
00015     pointer_default(unique)
00016   ]
00017   interface IDimmer : IDispatch
00018   {
00019   };
00020   [
00021     object,
00022     uuid(AEF464AB-75A6-4205-B143-72A43675863F),
00023     dual,
00024     helpstring("IDimmerService Interface"),
00025     pointer_default(unique)
00026   ]
00027   interface IDimmerService : IDispatch
00028   {
00029   };
00030 */
00031 [
00032   uuid(51AC2F4C-3F4F-48B3-A018-910E81677EEF),
00033   version(1.0),
00034   helpstring("MyDevice 1.0 Type Library")
00035 ]
00036 library MYDEVICELib
00037 {
00038   importlib("stdole32.tlb");
00039   importlib("stdole2.tlb");
00040
00041 typedef [v1_enum] enum DIMMINGSERVICE_SCPD_DISPIDS
00042 {
00043    DISPID_POWER = 1,
00044    DISPID_DIMLEVEL,
00045    DISPID_POWERON,
00046    DISPID_POWEROFF,
00047    DISPID_GETPOWERVALUE,
00048    DISPID_SETDIMLEVEL,
00049    DISPID_GETDIMLEVEL,
00050    DISPID_GETCONFIGDETAILS
00051
00052 } DIMMINGSERVICE_SCPD_DISPIDS;
00053
00054 [
00055    uuid(a315fcbd-7f4b-4081-a172-2f534c438957),
00056    oleautomation,
00057    pointer_default(unique)
00058 ]
00059 interface IUPnPService_DimmingService_SCPD : IDispatch {
00060   [propget, id(DISPID_POWER), helpstring("Property Power")]
00061   HRESULT Power(
00062     [out, retval] VARIANT_BOOL *pPower);
00063
00064   [propget, id(DISPID_DIMLEVEL), helpstring("Property dimLevel")]
00065   HRESULT dimLevel(
00066     [out, retval] long *pdimLevel);
00067
00068
00069   [ id(DISPID_POWERON), helpstring("Method PowerOn")]
00070   HRESULT PowerOn();
00071
00072   [ id(DISPID_POWEROFF), helpstring("Method PowerOff")]
00073   HRESULT PowerOff();
00074
00075   [ id(DISPID_GETPOWERVALUE), helpstring("Method GetPowerValue")]
00076   HRESULT GetPowerValue(
00077     [in, out] VARIANT_BOOL *ppowerVall);
00078
00079   [ id(DISPID_SETDIMLEVEL), helpstring("Method SetDimLevel")]
00080   HRESULT SetDimLevel(
00081     [in] long dLevel);
00082
00083   [ id(DISPID_GETDIMLEVEL), helpstring("Method GetDimLevel")]
00084   HRESULT GetDimLevel(
00085     [in, out] long *pdLevel);
00086
00087   [ id(DISPID_GETCONFIGDETAILS), helpstring("Method GetConfigDetails")]
00088   HRESULT GetConfigDetails(
00089     [in, out] VARIANT_BOOL *ppowerVal,
00090     [in, out] long *pdLevel);
00091 };
00092
00093   [
00094     //uuid(433B7962-88CD-48F3-B726-2187A48C7128),
00095     uuid(d31b8f49-367e-41b7-8fc4-50e23d36625d),
00096     helpstring("Dimmer Class")
00097   ]
00098   coclass Dimmer
00099   {
00100     [default] interface IUnknown;
00101   };
00102
00103 /*
00104   [
00105     uuid(67B046DD-6000-4122-9092-0706F1C7C4D8),
00106     helpstring("DimmerService Class")
00107   ]
00108   coclass DimmerService
00109   {
00110     [default] interface IDimmerService;
00111   };
00112 */
00113 };
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/MainDlg.Cpp Source File

  • Web
  • MSAgent
  • c
  • CapMFC

MainDlg.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 #include "stdafx.h"
00045 #include "CapMFC.h"
00046 #include "MainDlg.h"
00047
00048 // NOTE: see stdafx.h for inclusion of ClassWizard generated
00049 // AgentControl headers.
00050
00051
00052 #ifdef _DEBUG
00053 #define new DEBUG_NEW
00054 #undef THIS_FILE
00055 static char THIS_FILE[] = __FILE__;
00056 #endif
00057
00058
00059 // Registry
00060
00061 #define MAX_RECENT_FILES    4
00062 #define MAX_RECENT_FILENAME   32
00063 #define ID_RECENT_FILE_0    900
00064
00065 extern  LPCTSTR kpszRegRoot = _T("Software\\Microsoft\\Microsoft Agent\\Tools\\Character Previewer");
00066 static  LPCTSTR kpszRecentFilesSubkey = _T("Software\\Microsoft\\Microsoft Agent\\Tools\\Character Previewer\\Recent Files");
00067 static  LPCTSTR kpszRecentFilesItem = _T("File");
00068
00069 // Static strings
00070
00071 static  LPCTSTR kpszAgentCharacterTitle = _T("Microsoft Agent");
00072 static  LPCTSTR kpszAgentCharacterOptions = _T("Advanced Character Options");
00073 static  LPCTSTR kpszFileTypes = _T("Agent Character Storage (*.acs)|*.acs|Agent Character File (*.acf)|*.acf||");
00074 static  LPCTSTR kpszID1 = _T("Character1");
00075 static  LPCTSTR kpszID2 = _T("Character2");
00076 static  LPCTSTR kpszCommandProperties = _T("Properties");
00077
00078 extern const LPTSTR kpszAppTitle;
00079
00080
00081 // Standard MFC About Dialog
00082
00083 class CAboutDlg : public CDialog {
00084 public:
00085   CAboutDlg();
00086
00087   //{{AFX_DATA(CAboutDlg)
00088   enum { IDD = IDD_ABOUTBOX };
00089   //}}AFX_DATA
00090
00091   //{{AFX_VIRTUAL(CAboutDlg)
00092   protected:
00093   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00094   //}}AFX_VIRTUAL
00095
00096 protected:
00097   //{{AFX_MSG(CAboutDlg)
00098   virtual BOOL OnInitDialog();
00099   //}}AFX_MSG
00100   DECLARE_MESSAGE_MAP()
00101 };
00102
00103
00104 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) {
00105
00106   //{{AFX_DATA_INIT(CAboutDlg)
00107   //}}AFX_DATA_INIT
00108 }
00109
00110
00111 BOOL CAboutDlg::OnInitDialog() {
00112
00113   _TCHAR  szExe[_MAX_PATH];
00114   _TCHAR  szVersion[256];
00115   DWORD dwVersionSize;
00116   DWORD dwTemp;
00117   void   *pData;
00118   void   *pVerInfo;
00119   UINT  uVerInfoSize;
00120
00121   CDialog::OnInitDialog();
00122
00123   // Add the version number to the dialog
00124
00125   GetModuleFileName(NULL, szExe, _MAX_PATH);
00126
00127   dwVersionSize = GetFileVersionInfoSize(szExe, &dwTemp);
00128
00129   // There better be version data
00130
00131   _ASSERT(dwVersionSize != 0);
00132
00133   try {
00134     pData = _alloca(dwVersionSize);
00135   }
00136   catch (...) {
00137     pData = NULL;
00138   }
00139
00140   if (pData) {
00141
00142     GetFileVersionInfo(szExe, 0, dwVersionSize, pData);
00143
00144     if (VerQueryValue(pData, _T("\\"), &pVerInfo, &uVerInfoSize)) {
00145       wsprintf(szVersion,
00146            _T("%d.%.2d.%d.%d"),
00147            HIWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionMS),
00148            LOWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionMS),
00149            HIWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionLS),
00150            LOWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionLS));
00151       ::SetDlgItemText(m_hWnd, IDC_VERSION, szVersion);
00152     }
00153   }
00154
00155   return TRUE;
00156 }
00157
00158
00159 void CAboutDlg::DoDataExchange(CDataExchange* pDX) {
00160
00161   CDialog::DoDataExchange(pDX);
00162
00163   //{{AFX_DATA_MAP(CAboutDlg)
00164   //}}AFX_DATA_MAP
00165 }
00166
00167
00168 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00169   //{{AFX_MSG_MAP(CAboutDlg)
00170   //}}AFX_MSG_MAP
00171 END_MESSAGE_MAP()
00172
00173
00174
00175 // Main Dialog
00176
00177 CCapMFCDlg::CCapMFCDlg(CWnd* pParent) : CDialog(CCapMFCDlg::IDD, pParent) {
00178
00179   //{{AFX_DATA_INIT(CCapMFCDlg)
00180     // NOTE: the ClassWizard will add member initialization here
00181   //}}AFX_DATA_INIT
00182
00183   m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
00184   m_pszCurCharID = NULL;
00185   m_bHasMRUSeparator = FALSE;
00186 }
00187
00188
00189 void CCapMFCDlg::DoDataExchange(CDataExchange* pDX) {
00190
00191   CDialog::DoDataExchange(pDX);
00192
00193   //{{AFX_DATA_MAP(CCapMFCDlg)
00194   DDX_Control(pDX, IDC_Y_LABEL, m_YLabel);
00195   DDX_Control(pDX, IDC_X_LABEL, m_XLabel);
00196   DDX_Control(pDX, IDC_POSITION_LABEL, m_PositionLabel);
00197   DDX_Control(pDX, IDC_MOVE_Y, m_MoveY);
00198   DDX_Control(pDX, IDC_MOVE_X, m_MoveX);
00199   DDX_Control(pDX, IDC_MOVE, m_Move);
00200   DDX_Control(pDX, IDC_BALLOON_USE, m_BalloonEnabled);
00201   DDX_Control(pDX, IDC_BALLOON_SIZETOTEXT, m_BalloonSizeToText);
00202   DDX_Control(pDX, IDC_BALLOON_AUTOPACE, m_BalloonAutoPace);
00203   DDX_Control(pDX, IDC_BALLOON_AUTOHIDE, m_BalloonAutoHide);
00204   DDX_Control(pDX, IDC_SPEAK, m_Speak);
00205   DDX_Control(pDX, IDC_SPEECHOUTPUT_LABEL, m_SpeechOutputLabel);
00206   DDX_Control(pDX, IDC_SPEAKTEXT, m_SpeakText);
00207   DDX_Control(pDX, IDC_SFX, m_Sfx);
00208   DDX_Control(pDX, IDC_STOP, m_Stop);
00209   DDX_Control(pDX, IDC_STOPBEFOREPLAY, m_StopBeforePlay);
00210   DDX_Control(pDX, IDC_PLAY, m_Play);
00211   DDX_Control(pDX, IDC_ANIMATIONS_LABEL, m_AnimationsLabel);
00212   DDX_Control(pDX, IDC_ANIMATIONS, m_Animations);
00213   DDX_Control(pDX, IDC_AGENT, m_Agent);
00214   //}}AFX_DATA_MAP
00215 }
00216
00217
00218 BEGIN_MESSAGE_MAP(CCapMFCDlg, CDialog)
00219   //{{AFX_MSG_MAP(CCapMFCDlg)
00220   ON_WM_DROPFILES()
00221   ON_WM_ACTIVATEAPP()
00222   ON_WM_INITMENUPOPUP()
00223   ON_WM_SYSCOMMAND()
00224   ON_WM_PAINT()
00225   ON_WM_QUERYDRAGICON()
00226   ON_COMMAND(ID_FILE_EXIT, OnFileExit)
00227   ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
00228   ON_BN_CLICKED(IDC_PLAY, OnPlay)
00229   ON_LBN_DBLCLK(IDC_ANIMATIONS, OnDblclkAnimations)
00230   ON_BN_CLICKED(IDC_STOP, OnStop)
00231   ON_BN_CLICKED(IDC_SFX, OnSfx)
00232   ON_BN_CLICKED(IDC_SPEAK, OnSpeak)
00233   ON_EN_CHANGE(IDC_SPEAKTEXT, OnChangeSpeakText)
00234   ON_EN_SETFOCUS(IDC_SPEAKTEXT, OnSetFocusSpeakText)
00235   ON_BN_CLICKED(IDC_BALLOON_USE, OnBalloonUse)
00236   ON_BN_CLICKED(IDC_MOVE, OnMove)
00237   ON_EN_SETFOCUS(IDC_MOVE_X, OnSetFocusMoveX)
00238   ON_EN_SETFOCUS(IDC_MOVE_Y, OnSetFocusMoveY)
00239   ON_LBN_SETFOCUS(IDC_ANIMATIONS, OnSetFocusAnimations)
00240   ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout)
00241   //}}AFX_MSG_MAP
00242 END_MESSAGE_MAP()
00243
00244
00245 BOOL CCapMFCDlg::OnInitDialog() {
00246
00247   CDialog::OnInitDialog();
00248
00249   SetIcon(m_hIcon, TRUE);
00250   SetIcon(m_hIcon, FALSE);
00251
00252   // We don't want the Agent control to throw exceptions. We'd
00253   // rather have HRESULTs returned. If you want to use exception
00254   // handling instead, remove/comment the next line.
00255
00256   m_Agent.SetRaiseRequestErrors(FALSE);
00257
00258   // Initialize the MRU menu
00259
00260   UpdateRecentFiles(NULL);
00261
00262   return TRUE;
00263 }
00264
00265
00266 void CCapMFCDlg::OnDropFiles(HDROP hDropInfo) {
00267
00268   TCHAR szFilename[_MAX_PATH];
00269
00270   // Handle drag and drop
00271
00272   ::DragQueryFile(hDropInfo, 0, szFilename, _MAX_PATH);
00273   ::DragFinish(hDropInfo);
00274
00275   LoadCharacter(szFilename);
00276 }
00277
00278
00279 void CCapMFCDlg::OnSysCommand(UINT nID, LPARAM lParam) {
00280
00281   COleVariant vFast;
00282
00283   vFast.vt = VT_BOOL;
00284   vFast.boolVal = VARIANT_TRUE;
00285
00286   // If the dialog is getting minimized, hide the character. If it's
00287   // being restore, show it.
00288
00289   switch (nID) {
00290     case SC_MINIMIZE:
00291       if (m_pszCurCharID)
00292         m_Agent.GetCharacters().Character(m_pszCurCharID).Hide(vFast);
00293       break;
00294
00295     case SC_RESTORE:
00296       if (m_pszCurCharID)
00297         m_Agent.GetCharacters().Character(m_pszCurCharID).Show(vFast);
00298       break;
00299   }
00300
00301   CDialog::OnSysCommand(nID, lParam);
00302 }
00303
00304
00305 void CCapMFCDlg::OnInitMenuPopup(CMenu *pPopupMenu, UINT uIndex, BOOL bSysMenu) {
00306
00307   CDialog::OnInitMenuPopup(pPopupMenu, uIndex, bSysMenu);
00308
00309   // We're not going to allow the dialog to be sized or
00310   // maximized, so disable those menu items on the context
00311   // menu.
00312
00313   if (bSysMenu) {
00314     pPopupMenu->EnableMenuItem(SC_MAXIMIZE, MF_GRAYED);
00315     pPopupMenu->EnableMenuItem(SC_MINIMIZE, IsIconic() ? MF_GRAYED : MF_ENABLED);
00316     pPopupMenu->EnableMenuItem(SC_RESTORE, IsIconic() ? MF_ENABLED : MF_GRAYED);
00317     pPopupMenu->EnableMenuItem(SC_SIZE, MF_GRAYED);
00318   }
00319 }
00320
00321
00322 void CCapMFCDlg::OnActivateApp(BOOL bActive, DWORD hTask) {
00323
00324   _TCHAR szText[256];
00325   CAgentCtlCharacterEx Character;
00326   COleVariant vFast;
00327
00328   vFast.vt = VT_BOOL;
00329   vFast.boolVal = VARIANT_TRUE;
00330
00331   // If we don't have a character loaded, we're done
00332
00333   if (m_pszCurCharID == NULL)
00334     return;
00335
00336   Character = m_Agent.GetCharacters().Character(m_pszCurCharID);
00337
00338   // If we're being deactivated, and the foreground
00339   // window is an Agent character, we don't want to
00340   // hide the character.
00341
00342   if (!bActive) {
00343
00344     // Get the window title text for the foreground window.
00345     // NOTE: Microsoft Agent character's window titles are
00346     // always "Microsoft Agent"
00347
00348     if (::GetWindowText(::GetForegroundWindow(), szText, 256) > 0) {
00349
00350       if (lstrcmpi(szText, kpszAgentCharacterTitle) == 0)
00351         return;
00352
00353       // Check to see if it's the Agent Character Property
00354       // Sheet. NOTE: this currently only works on English
00355       // systems. A more robust way to do this would be to
00356       // use the process id of the window that is getting
00357       // focus, and make sure that it's not AgentSvr.exe.
00358
00359       if (lstrcmpi(szText, kpszAgentCharacterOptions) == 0)
00360         return;
00361     }
00362
00363     // If the character has other clients, we're not going
00364     // to hide it.
00365
00366     if (!Character.GetHasOtherClients())
00367       Character.Hide(vFast);
00368   }
00369   else {
00370
00371     // Is the window minimized?
00372
00373     if (!IsIconic()) {
00374
00375       // We want to show the character on activation but there's
00376       // a special case. If the user hid the character we could get
00377       // a WM_ACTIVATEAPP message after the character window hides.
00378       // In that case, we sure don't want to show the character. So
00379       // check the visibility cause of the character. If the user hid
00380       // it, we won't show it.
00381
00382       if ((Character.GetVisibilityCause() == UserHid) ||
00383         (Character.GetVisibilityCause() == UserHidViaCharacterMenu))
00384         return;
00385
00386       Character.Show(vFast);
00387     }
00388   }
00389 }
00390
00391
00392 void CCapMFCDlg::OnPaint() {
00393
00394   // If you add a minimize button to your dialog, you will need the code below
00395   // to draw the icon.  For MFC applications using the document/view model,
00396   // this is automatically done for you by the framework.
00397
00398   if (IsIconic()) {
00399
00400     CPaintDC dc(this);
00401
00402     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00403
00404     int cxIcon = GetSystemMetrics(SM_CXICON);
00405     int cyIcon = GetSystemMetrics(SM_CYICON);
00406
00407     CRect rect;
00408
00409     GetClientRect(&rect);
00410
00411     int x = (rect.Width() - cxIcon + 1) / 2;
00412     int y = (rect.Height() - cyIcon + 1) / 2;
00413
00414     // Draw the icon
00415
00416     dc.DrawIcon(x, y, m_hIcon);
00417   }
00418   else {
00419
00420     CDialog::OnPaint();
00421   }
00422 }
00423
00424
00425 HCURSOR CCapMFCDlg::OnQueryDragIcon() {
00426
00427   return (HCURSOR) m_hIcon;
00428 }
00429
00430
00431 void CCapMFCDlg::OnFileExit() {
00432
00433   ShowWindow(SW_HIDE);
00434   PostQuitMessage(0);
00435 }
00436
00437
00438 void CCapMFCDlg::OnFileOpen() {
00439
00440   CString psz;
00441   psz.Empty();
00442   LoadCharacter(psz);
00443 }
00444
00445
00446 void CCapMFCDlg::OnHelpAbout() {
00447
00448   CAboutDlg dlgAbout;
00449   dlgAbout.DoModal();
00450 }
00451
00452
00453 void CCapMFCDlg::LoadCharacter(CString pszFilename) {
00454
00455   HRESULT         hRes;
00456   BOOL          bHasAnims;
00457   CString         szFilename;
00458   _TCHAR           *pchFilename;
00459   CAgentCtlRequest    AgentRequest;
00460   CAgentCtlCharacterEx  Character;
00461   LPCTSTR         kpszNewID;
00462   _TCHAR          szTemp[256];
00463   UINT          uBalloonStyle;
00464   COleVariant       vEmpty;
00465   DWORD         dwRetrieved;
00466   VARIANT         vAnimName;
00467   IUnknown         *punkAnimNames;
00468   IEnumVARIANT       *pevAnimNames;
00469
00470   // If no filename was specified, bring up the common
00471   // open dialog to get one from the user.
00472
00473   if (pszFilename.IsEmpty()) {
00474
00475     CFileDialog fd(TRUE, _T(".acs"), NULL, OFN_HIDEREADONLY, kpszFileTypes, this);
00476
00477     if (fd.DoModal() == IDCANCEL)
00478       return;
00479
00480     szFilename = fd.GetPathName();
00481     pszFilename = szFilename;
00482   }
00483
00484   SetCursor(LoadCursor(NULL, IDC_WAIT));
00485
00486   // Construct a VARIANT to hold the filename
00487
00488   COleVariant v(pszFilename);
00489
00490   // Load the new character. NOTE: we don't release the
00491   // existing character until we're sure we've successfully
00492   // loaded the new one.
00493
00494   if (m_pszCurCharID == NULL)
00495     kpszNewID = kpszID1;
00496   else if (m_pszCurCharID == kpszID1)
00497     kpszNewID = kpszID2;
00498   else
00499     kpszNewID = kpszID1;
00500
00501   AgentRequest = m_Agent.GetCharacters().Load(kpszNewID, v);
00502
00503   // Did we successfully load the character? NOTE: if it's the
00504   // same character as we already have loaded we'll get the
00505   // error code AGENTERR_CHARACTERALREADYLOADED.
00506
00507   if (AgentRequest.GetStatus() != RequestSuccess) {
00508     SetCursor(LoadCursor(NULL, IDC_ARROW));
00509     return;
00510   }
00511
00512   // Unload the previous character if we have one
00513
00514   if (m_pszCurCharID)
00515     m_Agent.GetCharacters().Unload(m_pszCurCharID);
00516
00517   // Save the new id
00518
00519   m_pszCurCharID = kpszNewID;
00520   Character = m_Agent.GetCharacters().Character(m_pszCurCharID);
00521
00522   // Reset the contents of the animation list box
00523
00524   m_Animations.ResetContent();
00525
00526   // Add it to the MRU menu
00527
00528   UpdateRecentFiles(pszFilename);
00529
00530   // Get the last visibility cause of the character. If
00531   // it's never been shown we'll position it. Otherwise,
00532   // we'll leave it alone and assume it's where the user
00533   // or another app wants it.
00534
00535   if (Character.GetVisibilityCause() == NeverShown) {
00536
00537     CRect rcWindow;
00538
00539     // Get the window rect
00540
00541     GetWindowRect(&rcWindow);
00542
00543     // Make sure we'll fit to the right (NOTE: a production
00544     // quality app would handle multi-monitor!!!)
00545
00546     if ((rcWindow.right + Character.GetWidth()) > GetSystemMetrics(SM_CXSCREEN))
00547       rcWindow.right = rcWindow.left + Character.GetWidth();
00548
00549     // Move it (non-animated)
00550
00551     Character.MoveTo((short)rcWindow.right, (short)rcWindow.top, vEmpty);
00552   }
00553
00554   // Add commands
00555
00556   CString pszCommand;
00557   pszCommand.LoadString(IDS_COMMAND_PROPERTIES);
00558   COleVariant vCommand(pszCommand);
00559
00560   Character.GetCommands().Add(kpszCommandProperties, vCommand, vEmpty, vEmpty, vEmpty);
00561
00562   // Show the character (animated)
00563
00564   Character.Show(vEmpty);
00565
00566   // Populate the listbox with the character's animation names.
00567   // This is a little tricky since MFC does not generate a wrapper
00568   // for the Enum method of IAgentCtlAnimationNames. So we'll have
00569   // to get the IUnknown ourself via GetProperty.
00570
00571   Character.GetAnimationNames().GetProperty(DISPID_NEWENUM, VT_UNKNOWN, (void *)&punkAnimNames);
00572
00573   // We've got the IUnknown, now query for IEnumVARIANT
00574
00575   hRes = punkAnimNames->QueryInterface(IID_IEnumVARIANT, (LPVOID *)&pevAnimNames);
00576
00577   // We're done with the IUnknown no matter what
00578
00579   punkAnimNames->Release();
00580
00581   // Did we get IEnumVARIANT?
00582
00583   if (SUCCEEDED(hRes)) {
00584
00585     while (TRUE) {
00586
00587       // Get the next animation name
00588
00589       if (pevAnimNames->Next(1, &vAnimName, &dwRetrieved) != NOERROR)
00590         break;
00591
00592       // Hmmmm
00593
00594       _ASSERT(dwRetrieved > 0);
00595       _ASSERT(vAnimName.vt == VT_BSTR);
00596       _ASSERT(vAnimName.bstrVal != NULL);
00597
00598       CString pszAnimName(vAnimName.bstrVal);
00599
00600       // Add it to the list box
00601
00602       m_Animations.AddString((LPCTSTR)pszAnimName);
00603
00604       // And clean up
00605
00606       VariantClear(&vAnimName);
00607     }
00608
00609     pevAnimNames->Release();
00610   }
00611
00612   // Do we have any animations?
00613
00614   bHasAnims = (m_Animations.GetCount() > 0);
00615
00616   if (bHasAnims)
00617     m_Animations.SetCurSel(0);
00618
00619   // Enable/Disable controls
00620
00621   m_Play.EnableWindow(bHasAnims);
00622   m_StopBeforePlay.EnableWindow(bHasAnims);
00623   m_Stop.EnableWindow(bHasAnims);
00624   m_Sfx.EnableWindow(bHasAnims);
00625   m_Speak.EnableWindow(bHasAnims && (m_SpeakText.GetWindowTextLength() > 0));
00626   m_SpeakText.EnableWindow(bHasAnims);
00627   m_SpeechOutputLabel.EnableWindow(bHasAnims);
00628   m_BalloonEnabled.EnableWindow(bHasAnims);
00629
00630   m_AnimationsLabel.EnableWindow(bHasAnims);
00631
00632   // Sound Effects
00633
00634   m_Sfx.SetCheck(Character.GetSoundEffectsOn());
00635
00636   // Update the balloon buttons
00637
00638   uBalloonStyle = 0;
00639
00640   if (bHasAnims) {
00641
00642     uBalloonStyle = Character.GetBalloon().GetStyle();
00643
00644     m_BalloonEnabled.SetCheck(uBalloonStyle & BALLOON_STYLE_BALLOON_ON);
00645     m_BalloonSizeToText.SetCheck(uBalloonStyle & BALLOON_STYLE_SIZETOTEXT);
00646     m_BalloonAutoPace.SetCheck(uBalloonStyle & BALLOON_STYLE_AUTOPACE);
00647     m_BalloonAutoHide.SetCheck(uBalloonStyle & BALLOON_STYLE_AUTOHIDE);
00648   }
00649
00650   m_BalloonSizeToText.EnableWindow(bHasAnims && (uBalloonStyle & BALLOON_STYLE_BALLOON_ON));
00651   m_BalloonAutoPace.EnableWindow(bHasAnims && (uBalloonStyle & BALLOON_STYLE_BALLOON_ON));
00652   m_BalloonAutoHide.EnableWindow(bHasAnims && (uBalloonStyle & BALLOON_STYLE_BALLOON_ON));
00653
00654   m_Move.EnableWindow(bHasAnims);
00655   m_MoveX.EnableWindow(bHasAnims);
00656   m_MoveY.EnableWindow(bHasAnims);
00657   m_PositionLabel.EnableWindow(bHasAnims);
00658   m_XLabel.EnableWindow(bHasAnims);
00659   m_YLabel.EnableWindow(bHasAnims);
00660
00661   // Call our OnPropertyChange function. This will sync
00662   // our dialog with Agent properties.
00663
00664   OnAgentPropertyChange();
00665
00666   m_Animations.SetFocus();
00667
00668   // Set the text of the title bar
00669
00670   pchFilename = _tcsrchr(pszFilename, '\\');
00671
00672   if (pchFilename)
00673     pchFilename = _tcsinc(pchFilename);
00674   else
00675     pchFilename = (LPTSTR)(LPCTSTR)pszFilename;
00676
00677     ZeroMemory(szTemp, sizeof(szTemp));
00678     _tcsncpy(szTemp, pchFilename, (sizeof(szTemp) / sizeof(szTemp[0])) - (_tcslen(kpszAppTitle) + 4));
00679     _tcscat(szTemp, _T(" - "));
00680     _tcscat(szTemp, kpszAppTitle);
00681
00682   SetWindowText(szTemp);
00683
00684   // Update the "Animations" group box text with the character's
00685   // name.
00686
00687   CString szTemplate;
00688
00689   szTemplate.LoadString(IDS_ANIMATIONS_LABEL);
00690
00691   _ASSERT(szTemplate.GetLength() + Character.GetName().GetLength() < 256);
00692
00693   wsprintf(szTemp, szTemplate, Character.GetName());
00694
00695   m_AnimationsLabel.SetWindowText(szTemp);
00696
00697   SetCursor(LoadCursor(NULL, IDC_ARROW));
00698 }
00699
00700
00701 void CCapMFCDlg::OnFinalRelease() {
00702
00703   // If we have a character, unload it now
00704
00705   if (m_pszCurCharID)
00706     m_Agent.GetCharacters().Unload(m_pszCurCharID);
00707
00708   CDialog::OnFinalRelease();
00709 }
00710
00711
00712 void CCapMFCDlg::MakeEllipsisPath(LPCTSTR pszPath, LPTSTR pszEllipsisPath, UINT cchMaxEllipsisPath) {
00713
00714   // This function takes a full path and truncates to a fixed
00715   // specified size using ellipses as necessary. It's main goal
00716   // is to keep the first directory in the path and the filename
00717   // intact and use ellipsis in the middle.
00718   //
00719   // NOTE: cchMaxEllipsisPath is NOT the size of the pszEllipsisPath
00720   // buffer (in characters). It is simply the maximum number of
00721   // characters to allow in the path so we'd better have room for at
00722   // least that many.
00723
00724   _ASSERT(!IsBadWritePtr(pszEllipsisPath, (cchMaxEllipsisPath+1) * sizeof(_TCHAR)));
00725   _ASSERT(cchMaxEllipsisPath <= _MAX_PATH);
00726
00727   _TCHAR  szPathCopy[_MAX_PATH];
00728   _TCHAR *pchEndDir;
00729   LPCTSTR pchFilename;
00730   UINT  uPathPartLen;
00731   UINT  uFilenameLen;
00732
00733   // If the specified path fits, then just copy it and return
00734
00735   if ((UINT)lstrlen(pszPath) < cchMaxEllipsisPath) {
00736     lstrcpy(pszEllipsisPath, pszPath);
00737     return;
00738   }
00739
00740   // See if the filename alone is too big
00741
00742   pchFilename = _tcsrchr(pszPath, '\\');
00743
00744   if (pchFilename != NULL)
00745     pchFilename = _tcsinc(pchFilename);
00746   else
00747     pchFilename = pszPath;
00748
00749   _ASSERT(pchFilename);
00750
00751   uFilenameLen = lstrlen(pchFilename);
00752
00753   if (uFilenameLen >= cchMaxEllipsisPath) {
00754     lstrcpyn(pszEllipsisPath, pchFilename, cchMaxEllipsisPath-2);
00755     lstrcat(pszEllipsisPath, _T("..."));
00756     return;
00757   }
00758
00759   // Save a local copy of the specified path
00760
00761   lstrcpy(szPathCopy, pszPath);
00762
00763   pchEndDir = szPathCopy;
00764
00765   // See if it's a UNC name
00766
00767   if (_tcsncmp(pchEndDir, _T("\\\\"), 2) == 0) {
00768     pchEndDir = _tcsinc(pchEndDir);
00769     pchEndDir = _tcsinc(pchEndDir);
00770     pchEndDir = _tcschr(pchEndDir, '\\');
00771   }
00772   else {
00773     pchEndDir = _tcschr(pchEndDir, '\\');
00774     if (pchEndDir) {
00775       pchEndDir = _tcsinc(pchEndDir);
00776       pchEndDir = _tcschr(pchEndDir, '\\');
00777     }
00778   }
00779
00780   if (pchEndDir != NULL)
00781     pchEndDir = _tcsinc(pchEndDir);
00782
00783   // If we couldn't find the first directory component, give up
00784   // and just return the filename only.
00785
00786   if (pchEndDir == NULL) {
00787     lstrcpy(pszEllipsisPath, pchFilename);
00788     return;
00789   }
00790
00791   *pchEndDir = 0;
00792
00793   uPathPartLen = min((UINT)lstrlen(szPathCopy), cchMaxEllipsisPath - uFilenameLen - 4);
00794
00795   lstrcpyn(pszEllipsisPath, szPathCopy, uPathPartLen+1);
00796   lstrcat(pszEllipsisPath, _T("...\\"));
00797   lstrcat(pszEllipsisPath, pchFilename);
00798 }
00799
00800
00801 void CCapMFCDlg::UpdateRecentFiles(LPCTSTR pszFilename) {
00802
00803   // This function updates our recent file list if a filename
00804   // is specified or initializes the file menu with existing
00805   // filenames from the registry.
00806
00807   LONG  lRes;
00808   HKEY  hKeyMRU;
00809   HMENU hMenuFile;
00810   DWORD dwSize;
00811   DWORD dwDisposition;
00812   DWORD dwRetType;
00813   int   iNumExisting = 0;
00814   int   iFind = -1;
00815   int   iCount;
00816   int   iFileExitPos;
00817   _TCHAR  szValueName[256];
00818   _TCHAR  rgszExisting[MAX_RECENT_FILES][_MAX_PATH];
00819   _TCHAR  szEllipsisText[_MAX_PATH];
00820   _TCHAR  szMenuItemText[_MAX_PATH];
00821
00822   // Open/Create the registry key
00823
00824   lRes = RegCreateKeyEx(HKEY_CURRENT_USER,
00825               kpszRecentFilesSubkey,
00826                 0,
00827                 _T(""),
00828                 REG_OPTION_NON_VOLATILE,
00829                 KEY_ALL_ACCESS,
00830                 NULL,
00831                 &hKeyMRU,
00832                 &dwDisposition);
00833
00834   if (lRes != ERROR_SUCCESS)
00835     return;
00836
00837   // Get all of the current entries
00838
00839   for (int i=0; i < MAX_RECENT_FILES; i++) {
00840
00841     // Format the value string
00842
00843     wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, i+1);
00844
00845     // Get the next value
00846
00847     dwSize = _MAX_PATH * sizeof(_TCHAR);
00848
00849     lRes = RegQueryValueEx(hKeyMRU,
00850                  szValueName,
00851                  NULL,
00852                  &dwRetType,
00853                  (LPBYTE)rgszExisting[iNumExisting],
00854                  &dwSize);
00855
00856     // Was it there?
00857
00858     if (lRes == ERROR_SUCCESS) {
00859
00860       // If a filename was specified, see if it matches this one
00861
00862       if (pszFilename) {
00863
00864         if (lstrcmpi(pszFilename, rgszExisting[iNumExisting]) == 0) {
00865
00866           // If the specified file is the first file we find,
00867           // then we're done.
00868
00869           if (iNumExisting == 0) {
00870             RegCloseKey(hKeyMRU);
00871             return;
00872           }
00873
00874           iFind = iNumExisting;
00875         }
00876       }
00877
00878       ++iNumExisting;
00879     }
00880   }
00881
00882   // If no filename was specified, and we don't have any
00883   // existing files, we're done.
00884
00885   if ((pszFilename == NULL) && (iNumExisting == 0))
00886     return;
00887
00888   // If a file was specified, we have to update the registry
00889
00890   if (pszFilename) {
00891
00892     // Write the new filename to the registry
00893
00894     wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, 1);
00895     dwSize = (_tcslen(pszFilename)+1) * sizeof(_TCHAR);
00896     RegSetValueEx(hKeyMRU, szValueName, 0, REG_SZ, (LPBYTE)pszFilename, dwSize);
00897
00898     // If we previously had the maximum number of files, and
00899     // the new one is not one of them, we disregard the last
00900     // one.
00901
00902     if ((iNumExisting == MAX_RECENT_FILES) && (iFind < 0))
00903       --iNumExisting;
00904
00905     // Now, write the remaining items
00906
00907     iCount = 1;
00908
00909     for (i=0; i < iNumExisting; i++) {
00910       if (i != iFind) {
00911         wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, ++iCount);
00912         dwSize = (_tcslen(rgszExisting[i])+1) * sizeof(_TCHAR);
00913         RegSetValueEx(hKeyMRU, szValueName, 0, REG_SZ, (LPBYTE)rgszExisting[i], dwSize);
00914       }
00915     }
00916   }
00917
00918   // Get the File submenu
00919
00920   hMenuFile = GetMenu()->GetSubMenu(0)->m_hMenu;
00921
00922   // Delete any existing recent file entries
00923
00924   for (i=0; i < MAX_RECENT_FILES; i++)
00925     DeleteMenu(hMenuFile, ID_RECENT_FILE_0+i, MF_BYCOMMAND);
00926
00927   // Where's the Exit item?
00928
00929   iFileExitPos = GetMenuItemCount(hMenuFile) - 1;
00930
00931   // Create an ellipsis path from the specified filename and
00932   // insert it into the menu.
00933
00934   if (pszFilename) {
00935     MakeEllipsisPath(pszFilename, szEllipsisText, MAX_RECENT_FILENAME);
00936     wsprintf(szMenuItemText, _T("&%d %s"), 1, szEllipsisText);
00937     InsertMenu(hMenuFile, iFileExitPos-1, MF_BYPOSITION, ID_RECENT_FILE_0, szMenuItemText);
00938     iCount = 1;
00939   }
00940   else {
00941     iCount = 0;
00942   }
00943
00944   // Then do the same for the remaining items
00945
00946   for (i=0; i < iNumExisting; i++) {
00947     if (i != iFind) {
00948       MakeEllipsisPath(rgszExisting[i], szEllipsisText, MAX_RECENT_FILENAME);
00949       wsprintf(szMenuItemText, _T("&%d %s"), iCount+1, szEllipsisText);
00950       InsertMenu(hMenuFile, iFileExitPos-1+iCount, MF_BYPOSITION, ID_RECENT_FILE_0+iCount, szMenuItemText);
00951       ++iCount;
00952     }
00953   }
00954
00955   // Delete/Insert the separator as appropriate
00956
00957   if ((iNumExisting == 0) && (pszFilename == NULL)) {
00958     if (m_bHasMRUSeparator) {
00959       DeleteMenu(hMenuFile, iFileExitPos-2, MF_BYPOSITION);
00960       m_bHasMRUSeparator = FALSE;
00961     }
00962   }
00963   else {
00964     if (!m_bHasMRUSeparator) {
00965       InsertMenu(hMenuFile, ID_RECENT_FILE_0, MF_BYCOMMAND | MF_SEPARATOR, 0, NULL);
00966       m_bHasMRUSeparator = TRUE;
00967     }
00968   }
00969
00970   // We're done with the registry
00971
00972   RegCloseKey(hKeyMRU);
00973 }
00974
00975
00976 void CCapMFCDlg::OnRecentFile(UINT uFile) {
00977
00978   // Hmmm
00979
00980   _ASSERT((uFile >= 1) && (uFile <= MAX_RECENT_FILES));
00981
00982   LONG  lRes;
00983   DWORD dwRetType;
00984   DWORD dwSize;
00985   _TCHAR  szValueName[256];
00986   _TCHAR  szFile[_MAX_PATH];
00987   HKEY  hKeyMRU;
00988
00989   // Open the Recent Files subkey
00990
00991   lRes = RegOpenKeyEx(HKEY_CURRENT_USER,
00992             kpszRecentFilesSubkey,
00993             0,
00994             KEY_ALL_ACCESS,
00995             &hKeyMRU);
00996
00997   if (lRes != ERROR_SUCCESS)
00998     return;
00999
01000   // Query the value for the specified item
01001
01002   wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, uFile);
01003
01004   dwSize = _MAX_PATH * sizeof(_TCHAR);
01005
01006   lRes = RegQueryValueEx(hKeyMRU,
01007                szValueName,
01008                NULL,
01009                &dwRetType,
01010                (LPBYTE)szFile,
01011                &dwSize);
01012
01013   // If we found it, Load the character.
01014
01015   if ((lRes == ERROR_SUCCESS) && (dwRetType == REG_SZ))
01016     LoadCharacter(szFile);
01017
01018   RegCloseKey(hKeyMRU);
01019 }
01020
01021
01022 void CCapMFCDlg::OnPlay() {
01023
01024   // We'd better have a character at this point
01025
01026   _ASSERT(m_pszCurCharID);
01027
01028   int iCurSel;
01029   CAgentCtlCharacterEx Character;
01030   COleVariant vEmpty;
01031
01032   // Get the current selection
01033
01034   iCurSel = m_Animations.GetCurSel();
01035
01036   // Is there one?
01037
01038   if (iCurSel == LB_ERR)
01039     return;
01040
01041   // Shortcut to the character
01042
01043   Character = m_Agent.GetCharacters().Character(m_pszCurCharID);
01044
01045   // Stop the character if the button is checked
01046
01047   if (m_StopBeforePlay.GetCheck())
01048     Character.StopAll(vEmpty);
01049
01050   // Play the animation
01051
01052   CString pszAnim;
01053   m_Animations.GetText(iCurSel, pszAnim);
01054
01055   Character.Play(pszAnim);
01056
01057   m_Animations.SetFocus();
01058 }
01059
01060
01061 void CCapMFCDlg::OnDblclkAnimations() {
01062
01063   OnPlay();
01064 }
01065
01066
01067 void CCapMFCDlg::OnStop() {
01068
01069   _ASSERT(m_pszCurCharID);
01070
01071   COleVariant vEmpty;
01072
01073   m_Agent.GetCharacters().Character(m_pszCurCharID).StopAll(vEmpty);
01074 }
01075
01076
01077 void CCapMFCDlg::OnSfx() {
01078
01079   _ASSERT(m_pszCurCharID);
01080
01081   m_Agent.GetCharacters().Character(m_pszCurCharID).SetSoundEffectsOn(m_Sfx.GetCheck());
01082 }
01083
01084
01085 void CCapMFCDlg::OnSpeak() {
01086
01087   _ASSERT(m_pszCurCharID);
01088
01089   // We should never be in here if there's no text
01090
01091   _ASSERT(m_SpeakText.GetWindowTextLength() > 0);
01092
01093   CAgentCtlCharacterEx Character;
01094   COleVariant vEmpty;
01095   COleVariant vText;
01096   CString pszText;
01097   UINT uBalloonFlags;
01098
01099   // Shortcut to the character
01100
01101   Character = m_Agent.GetCharacters().Character(m_pszCurCharID);
01102
01103   // Set the balloon style if we have the interface
01104
01105   uBalloonFlags = 0;
01106
01107   if (m_BalloonEnabled.GetCheck())
01108     uBalloonFlags |= BALLOON_STYLE_BALLOON_ON;
01109
01110   if (m_BalloonSizeToText.GetCheck())
01111     uBalloonFlags |= BALLOON_STYLE_SIZETOTEXT;
01112
01113   if (m_BalloonAutoPace.GetCheck())
01114     uBalloonFlags |= BALLOON_STYLE_AUTOPACE;
01115
01116   if (m_BalloonAutoHide.GetCheck())
01117     uBalloonFlags |= BALLOON_STYLE_AUTOHIDE;
01118
01119   Character.GetBalloon().SetStyle((long)uBalloonFlags);
01120
01121   // Should we stop the character?
01122
01123   if (m_StopBeforePlay.GetCheck())
01124     Character.StopAll(vEmpty);
01125
01126   // Speak the text
01127
01128   m_SpeakText.GetWindowText(pszText);
01129   vText = pszText;
01130
01131   Character.Speak(vText, vEmpty);
01132
01133   // Reselect the text and set the focus back to the
01134   // edit field.
01135
01136   m_SpeakText.SetSel(0, -1);
01137   m_SpeakText.SetFocus();
01138 }
01139
01140
01141 void CCapMFCDlg::OnChangeSpeakText() {
01142
01143   BOOL bEnable;
01144
01145   // Enable the Speak button if there are animations and text
01146   // in the speak text edit field.
01147
01148   bEnable = (m_Animations.GetCount() > 0) && (m_SpeakText.GetWindowTextLength() > 0);
01149
01150   // If we're enabling and the button isn't already enabled,
01151   // enable it and make it the default button. If we're disabling
01152   // and the button is enabled, disable it and turn off it's
01153   // default button status.
01154
01155   if (bEnable && !m_Speak.IsWindowEnabled()) {
01156     m_Speak.EnableWindow(TRUE);
01157     SendMessage(DM_SETDEFID, IDC_SPEAK, 0);
01158   }
01159   else if (!bEnable && m_Speak.IsWindowEnabled()) {
01160     m_Speak.EnableWindow(FALSE);
01161     SendMessage(DM_SETDEFID, 0, 0);
01162   }
01163 }
01164
01165
01166 void CCapMFCDlg::OnBalloonUse() {
01167
01168   BOOL bCheck;
01169
01170   bCheck = m_BalloonEnabled.GetCheck();
01171
01172   m_BalloonSizeToText.EnableWindow(bCheck);
01173   m_BalloonAutoPace.EnableWindow(bCheck);
01174   m_BalloonAutoHide.EnableWindow(bCheck);
01175 }
01176
01177
01178 void CCapMFCDlg::OnMove() {
01179
01180   _ASSERT(m_pszCurCharID);
01181
01182   int iX;
01183   int iY;
01184   BOOL bConvert;
01185   CAgentCtlCharacterEx Character;
01186   COleVariant vEmpty;
01187
01188   iX = GetDlgItemInt(IDC_MOVE_X, &bConvert, TRUE);
01189
01190   if (!bConvert || (iX > 32767) || (iX < -32767))
01191     return;
01192
01193   iY = GetDlgItemInt(IDC_MOVE_Y, &bConvert, TRUE);
01194
01195   if (!bConvert || (iY > 32767) || (iY < -32767))
01196     return;
01197
01198   // Shortcut to the character
01199
01200   Character = m_Agent.GetCharacters().Character(m_pszCurCharID);
01201
01202   // Should we stop the character?
01203
01204   if (m_StopBeforePlay.GetCheck())
01205     Character.StopAll(vEmpty);
01206
01207   Character.MoveTo((short)iX, (short)iY, vEmpty);
01208 }
01209
01210
01211 void CCapMFCDlg::OnSetFocusSpeakText() {
01212
01213   if (m_SpeakText.GetWindowTextLength() > 0)
01214     SendMessage(DM_SETDEFID, IDC_SPEAK, 0);
01215 }
01216
01217
01218 void CCapMFCDlg::OnSetFocusMoveX() {
01219
01220   SendMessage(DM_SETDEFID, IDC_MOVE, 0);
01221 }
01222
01223
01224 void CCapMFCDlg::OnSetFocusMoveY() {
01225
01226   SendMessage(DM_SETDEFID, IDC_MOVE, 0);
01227 }
01228
01229
01230 void CCapMFCDlg::OnSetFocusAnimations() {
01231
01232   SendMessage(DM_SETDEFID, IDC_PLAY, 0);
01233 }
01234
01235
01236 BOOL CCapMFCDlg::OnCommand(WPARAM wParam, LPARAM lParam) {
01237
01238   WORD wID;
01239
01240   wID = LOWORD(wParam);
01241
01242   // First check for a recent file command
01243
01244   if ((wID >= ID_RECENT_FILE_0) && (wID < ID_RECENT_FILE_0+MAX_RECENT_FILES)) {
01245     OnRecentFile(wID - ID_RECENT_FILE_0 + 1);
01246     return TRUE;
01247   }
01248
01249   return CDialog::OnCommand(wParam, lParam);
01250 }
01251
01252
01253 BEGIN_EVENTSINK_MAP(CCapMFCDlg, CDialog)
01254     //{{AFX_EVENTSINK_MAP(CCapMFCDlg)
01255   ON_EVENT(CCapMFCDlg, IDC_AGENT, 22 /* Move */, OnMoveAgent, VTS_BSTR VTS_I2 VTS_I2 VTS_I2)
01256   ON_EVENT(CCapMFCDlg, IDC_AGENT, 17 /* Command */, OnCommandAgent, VTS_DISPATCH)
01257   ON_EVENT(CCapMFCDlg, IDC_AGENT, 31 /* AgentPropertyChange */, OnAgentPropertyChange, VTS_NONE)
01258   //}}AFX_EVENTSINK_MAP
01259 END_EVENTSINK_MAP()
01260
01261
01262 void CCapMFCDlg::OnMoveAgent(LPCTSTR CharacterID, short x, short y, short Cause) {
01263
01264   // Update the position fields
01265
01266   SetDlgItemInt(IDC_MOVE_X, x, TRUE);
01267   SetDlgItemInt(IDC_MOVE_Y, y, TRUE);
01268 }
01269
01270 void CCapMFCDlg::OnCommandAgent(LPDISPATCH UserInput) {
01271
01272   CAgentCtlUserInput userInput(UserInput);
01273   CAgentCtlCharacterEx Character;
01274   CAgentCtlPropertySheet PropertySheet;
01275   COleVariant vEmpty;
01276
01277   if (userInput.GetName() == kpszCommandProperties) {
01278
01279     // Get the property sheet
01280
01281     PropertySheet = m_Agent.GetPropertySheet();
01282
01283     // Show it
01284
01285     PropertySheet.SetVisible(TRUE);
01286
01287     // Get the character
01288
01289     _ASSERT(m_pszCurCharID);
01290
01291     Character = m_Agent.GetCharacters().Character(m_pszCurCharID);
01292
01293     // Stop it
01294
01295     Character.StopAll(vEmpty);
01296
01297     // Gesture at the property sheet
01298
01299     Character.GestureAt(PropertySheet.GetLeft() + (PropertySheet.GetWidth() / 2),
01300                 PropertySheet.GetTop() + (PropertySheet.GetHeight() / 2));
01301   }
01302 }
01303
01304
01305 void CCapMFCDlg::OnAgentPropertyChange() {
01306
01307   CAgentCtlCharacterEx Character;
01308   BOOL bUseBalloon;
01309
01310   // The user has changed an Agent property via the
01311   // Advanced Characters Property Sheet. Update any
01312   // of our own fields to reflect the change.
01313
01314   m_Sfx.EnableWindow(m_Agent.GetAudioOutput().GetSoundEffects());
01315
01316   Character = m_Agent.GetCharacters().Character(m_pszCurCharID);
01317
01318   m_BalloonEnabled.EnableWindow(Character.GetBalloon().GetEnabled());
01319
01320   bUseBalloon = m_BalloonEnabled.IsWindowEnabled() && m_BalloonEnabled.GetCheck();
01321
01322   m_BalloonSizeToText.EnableWindow(bUseBalloon);
01323   m_BalloonAutoPace.EnableWindow(bUseBalloon);
01324   m_BalloonAutoHide.EnableWindow(bUseBalloon);
01325 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSkyVehicle Member List

This is the complete list of members for CSkyVehicle, including all inherited members.
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
bExpanded | CDelegationBase | [protected]
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
children | CSkyVehicle | [private]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CDelegationBase | [inline, virtual]
CSkyVehicle(int i) | CSkyVehicle |
Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
GetBitmapIndex() | CSkyVehicle | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetDisplayName(int nCol=0) | CSkyVehicle | [virtual]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CDelegationBase | [inline, virtual]
getNodeType() | CSkyVehicle | [inline, virtual]
GetParentScopeItem() | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CDelegationBase | [inline, virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CDelegationBase | [inline, virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CDelegationBase | [inline, virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
HasPropertySheets() | CDelegationBase | [inline, virtual]
id | CSkyVehicle | [private]
IDM_NEW_SKY enum value | CSkyVehicle | [private]
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pComponentData | CDelegationBase |
NUMBER_OF_CHILDREN enum value | CSkyVehicle | [private]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CSkyVehicle | [virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CDelegationBase | [inline, virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CSkyVehicle | [virtual]
CDelegationBase::OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CSkyVehicle | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CDelegationBase | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CDelegationBase | [inline, virtual]
thisGuid | CSkyVehicle | [private, static]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CSkyVehicle() | CSkyVehicle | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/AppExportDlg.h Source File

  • Com
  • Administration
  • Explore.VC

AppExportDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019
00020
00021 #if !defined(AFX_APPEXPORTDLG_H__0B7BB738_B53B_11D2_86A8_000000000000__INCLUDED_)
00022 #define AFX_APPEXPORTDLG_H__0B7BB738_B53B_11D2_86A8_000000000000__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027
00028
00029 /////////////////////////////////////////////////////////////////////////////
00030 // CAppExportDlg dialog
00031
00032 class CAppExportDlg : public CDialog
00033 {
00034 // Construction
00035 public:
00036   void set_Catalog(ICOMAdminCatalog* pCatalog);
00037   CAppExportDlg(CWnd* pParent = NULL);   // standard constructor
00038
00039 // Dialog Data
00040   //{{AFX_DATA(CAppExportDlg)
00041   enum { IDD = IDD_EXPORT_APPLICATION };
00042   CEdit m_edtExportPath;
00043   CEdit m_edtApplicationID;
00044   //}}AFX_DATA
00045
00046
00047 // Overrides
00048   // ClassWizard generated virtual function overrides
00049   //{{AFX_VIRTUAL(CAppExportDlg)
00050   protected:
00051   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00052   //}}AFX_VIRTUAL
00053
00054 // Implementation
00055 protected:
00056   HICON m_hIcon;
00057
00058   // Generated message map functions
00059   //{{AFX_MSG(CAppExportDlg)
00060   afx_msg void OnClose();
00061   virtual void OnOK();
00062   virtual BOOL OnInitDialog();
00063   afx_msg void OnExportWithoutUsers();
00064   afx_msg void OnExportClients();
00065   afx_msg void OnExportUsers();
00066   afx_msg void OnOverwriteFiles();
00067   afx_msg void OnExportPathSearch();
00068   //}}AFX_MSG
00069   DECLARE_MESSAGE_MAP()
00070 private:
00071   bool m_bOverwriteFiles;
00072   int m_nExportType;
00073   void ReleaseCatalog();
00074   ICOMAdminCatalog* m_pCatalog;
00075 };
00076
00077 //{{AFX_INSERT_LOCATION}}
00078 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00079
00080 #endif // !defined(AFX_APPEXPORTDLG_H__0B7BB738_B53B_11D2_86A8_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/csession.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

csession.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CSESSION.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CSESSION_H_
00012 #define _CSESSION_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019 #include "CTransaction.h"
00020
00021
00022 ///////////////////////////////////////////////////////////////
00023 // Defines
00024 //
00025 ///////////////////////////////////////////////////////////////
00026 struct PROVTYPEINFO
00027 {
00028   WCHAR     wszTypeName[MAX_NAME_LEN];
00029   DBTYPE      wType;
00030   DBLENGTH    ulColumnSize;
00031   SHORT     iMaxScale;
00032 };
00033
00034
00035 /////////////////////////////////////////////////////////////////
00036 // CSession class
00037 //
00038 /////////////////////////////////////////////////////////////////
00039 class CSession : public CAsynchBase
00040 {
00041 public:
00042   //Constructors
00043   CSession(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00044   virtual ~CSession();
00045
00046   //IUnknown Helpers
00047   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00048   virtual HRESULT     AutoRelease();
00049   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00050
00051   //Pure Virtual
00052   virtual WCHAR*      GetObjectName()     { return L"Session";    }
00053   virtual UINT      GetObjectMenu()     { return IDM_SESSIONMENU; }
00054   virtual LONG      GetObjectImage()    { return IMAGE_SESSION;   }
00055   virtual REFIID      GetDefaultInterface() { return IID_IOpenRowset; }
00056
00057   //Methods
00058   virtual HRESULT     CreateCommand(CAggregate* pCAggregate, REFIID riid, IUnknown** ppIUnknown);
00059   virtual HRESULT     OpenRowset(CAggregate* pCAggregate, DBID* pTableID, DBID* pIndexID, REFIID riid, ULONG cPropSets, DBPROPSET* rgPropSets, IUnknown** ppIUnknown);
00060   virtual HRESULT     GetSchemaRowset(CAggregate* pCAggregate, REFGUID guidSchema, ULONG cRestrictions, VARIANT* rgRestrictions, REFIID riid, ULONG cPropSets, DBPROPSET* rgPropSets, IUnknown** ppIUnknown);
00061   virtual HRESULT     GetDataSource(REFIID riid, IUnknown** ppIUnknown);
00062   virtual HRESULT     GetProviderTypes();
00063
00064   //OLE DB Interfaces
00065   //[MANDATORY]
00066   IGetDataSource*     m_pIGetDataSource;      //Session interface
00067   IOpenRowset*      m_pIOpenRowset;       //Session interface
00068   ISessionProperties*   m_pISessionProperties;    //Session interface
00069
00070   //[OPTIONAL]
00071   IDBCreateCommand*   m_pIDBCreateCommand;    //Session interface
00072   IDBSchemaRowset*    m_pIDBSchemaRowset;     //Session interface
00073   IIndexDefinition*   m_pIIndexDefinition;    //Session interface
00074   IAlterIndex*      m_pIAlterIndex;       //Session interface
00075   IAlterTable*      m_pIAlterTable;       //Session interface
00076   ITableDefinition*   m_pITableDefinition;    //Session interface
00077   ITableDefinitionWithConstraints *m_pITableDefinitionWithConstraints;  //Session interface
00078
00079   ITransaction*     m_pITransaction;      //Session interface
00080   ITransactionLocal*    m_pITransactionLocal;   //Session interface
00081   ITransactionJoin*   m_pITransactionJoin;    //Session interface
00082   ITransactionObject*   m_pITransactionObject;    //Session interface
00083
00084   IBindResource*      m_pIBindResource;     //Session interface
00085   ICreateRow*       m_pICreateRow;        //Session interface
00086
00087   //Data
00088   ULONG             m_cProvTypes;
00089   PROVTYPEINFO*         m_rgProvTypes;
00090   CList<CPropSets*,CPropSets*>  m_listCPropSets;
00091 };
00092
00093
00094 #endif  //_CSESSION_H_
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/foldernode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

foldernode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CFolderNode class.  This node is a child of
00014 //                CDeviceNode.  It represents a Virtual Storage folder
00015 //
00016 //
00017
00018
00019 #ifndef _CLASS_CFOLDERNODE_
00020 #define _CLASS_CFOLDERNODE_
00021
00022 #include "Globals.h"
00023 #include "BaseNode.h"
00024 #include "VirtualFile.h"     // Result item children of this node
00025 #include "LListImpl.h"       // Linked list class
00026
00027
00028 class CComponentData;        // References
00029
00030 //---------------------------------------------------------------------------
00031 class CFolderNode : public CBaseNode
00032 {
00033   public:
00034     CFolderNode();
00035     virtual ~CFolderNode();
00036
00037     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00038
00039   ///////////////////////////////////////////////////////////////////////////
00040   // Virtual methods
00041   public:
00042     ULONG   GetNodeType() { return NODETYPE_FOLDER; }
00043     GUID&   GetNodeGUID() { return thisGUID; }
00044
00045     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00046     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00047     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00048
00049   ///////////////////////////////////////////////////////////////////////////
00050   // Property Page methods.  This node does not support Property Pages
00051   public:
00052     HRESULT QueryForPropertyPage()
00053             { return E_NOTIMPL; }
00054
00055     HRESULT CreatePropertyPages( LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle )
00056             { return E_NOTIMPL; }
00057
00058     HRESULT GetWatermarks( HBITMAP __RPC_FAR *lphWatermark,
00059                            HBITMAP __RPC_FAR *lphHeader,
00060                            HPALETTE __RPC_FAR *lphPalette,
00061                            BOOL __RPC_FAR *bStretch )
00062             { return E_NOTIMPL; }
00063
00064
00065   ///////////////////////////////////////////////////////////////////////////
00066   //  Notification handlers
00067   public:
00068     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00069     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00070     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00071     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00072     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00073     HRESULT OnContextHelp( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00074     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00075             { return E_NOTIMPL; }
00076
00077   ///////////////////////////////////////////////////////////////////////////
00078   //  Context Menu methods
00079   public:
00080     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00081     HRESULT Command( long lCommandID );
00082
00083   ///////////////////////////////////////////////////////////////////////////
00084   // Private helpers
00085   private:
00086     HRESULT RefreshNodeList();
00087     VOID    RemoveNodes();
00088     HRESULT EnumerateResultItems( LPRESULTDATA ipResultData );
00089     HRESULT AddVirtualFile( NODE_PROPERTIES* pProps = NULL );
00090
00091   private:
00092     static GUID  thisGUID;
00093     DWORD        m_dwAttributes;
00094
00095     CLListImpl<CVirtualFile*,CVirtualFile*>  m_NodeList;
00096     CComponentData* m_pCompData;
00097     HWND            m_hMessageWnd;     // Our message handler
00098
00099   public:
00100     HWND   m_hAddVFileDlg;             // Instance of AddDeviceDlg
00101
00102     VOID   RemoveVirtualFile( CVirtualFile* pDeadNode );
00103
00104     static LRESULT CALLBACK FolderNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00105 };
00106
00107 #endif //_CLASS_CFOLDERNODE_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NewsFlash Member List

This is the complete list of members for NewsFlash, including all inherited members.
admin | NewsFlash | [package]
checkForAppAlreadyInstalled(comadmin.ICatalogCollection appCollec) | NewsFlash | [inline, private]
checkForApplication(comadmin.ICatalogCollection appCollec, boolean processFlag) | NewsFlash | [inline, private]
checkForComponent(comadmin.ICatalogCollection compCollec, boolean processFlag) | NewsFlash | [inline, private]
components | NewsFlash | [package]
dispose() | NewsFlash | [inline]
ecDllNameFT | NewsFlash | [package]
ecDllNameLabel | NewsFlash | [package]
headlineLabel | NewsFlash | [package]
headlineTF | NewsFlash | [package]
initAdminCatlog() | NewsFlash | [inline, private]
initForm() | NewsFlash | [inline, private]
InstallEventBorder | NewsFlash | [package]
installEventButton | NewsFlash | [package]
installEventButton_click(Object source, Event e) | NewsFlash | [inline, private]
main(String args[]) | NewsFlash | [inline, static]
NewsFlash() | NewsFlash | [inline]
parallelCB | NewsFlash | [package]
publishButton | NewsFlash | [package]
publishButton_click(Object source, Event e) | NewsFlash | [inline, private]
PublishEventBorder | NewsFlash | [package]
queuedCB | NewsFlash | [package]
symbolLabel | NewsFlash | [package]
symbolTF | NewsFlash | [package]
updateCollections(boolean processFlag) | NewsFlash | [inline, private]
urlLabel | NewsFlash | [package]
urlTF | NewsFlash | [package]
Generated on Wed Nov 13 2024 16:57:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LicServe/Server.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • LicServe

Server.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.CPP
00003
00004   Summary:   Implementation file for the CServer server-related utility
00005              C++ object.  This object encapsulates the server's internal
00006              control of global server object and lock counts and checks
00007              for the global machine license for this server.
00008
00009              For a comprehensive tutorial code tour of this module's
00010              contents and offerings see the tutorial LICSERVE.HTM
00011              file. For more specific technical details on the internal
00012              workings see the comments dispersed throughout the module's
00013              source code.
00014
00015   Classes:   CServer.
00016
00017   Functions:
00018
00019   Origin:    10-5-95: atrent - Editor-inheritance from SERVER.CPP in
00020                the DLLSERVE Tutorial Code Sample.
00021
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037 /*---------------------------------------------------------------------------
00038   We include WINDOWS.H for all Win32 applications.
00039   We include OLE2.H because we will be calling the COM/OLE Libraries.
00040   We include APPUTIL.H because we will be building this DLL using
00041     the convenient Virtual Window and Dialog classes and other
00042     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00043   We include SERVER.H for the object class declarations for the
00044     C++ CServer server control object.
00045 ---------------------------------------------------------------------------*/
00046 #include <windows.h>
00047 #include <ole2.h>
00048 #include <apputil.h>
00049 #include "server.h"
00050
00051
00052 /*---------------------------------------------------------------------------
00053   Implementation the internal CServer C++ object.  Used to encapsulate
00054   some server data and the methods for Lock and Object count incrementing
00055   and decrementing.
00056 ---------------------------------------------------------------------------*/
00057
00058 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00059   Method:   CServer::CServer
00060
00061   Summary:  CServer Constructor.
00062
00063   Args:     void
00064
00065   Modifies: .
00066
00067   Returns:  void
00068 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00069 CServer::CServer(void)
00070 {
00071   // Init the Server License Key string.
00072   lstrcpynA(
00073     m_szLicenseKey,
00074     "LICSERVE 1.0 - Component Server. Copyright (C) 1995 - 2000 Microsoft Corp.",
00075     MAX_LICENSEKEY);
00076
00077   m_cLicenseLen = 0;
00078   m_bLicensed = FALSE;
00079
00080   m_hDllInst = NULL;
00081   m_hWndParent = NULL;
00082   m_pMsgBox = NULL;
00083
00084   // Zero the Object and Lock counts for this attached process.
00085   m_cObjects = 0;
00086   m_cLocks = 0;
00087
00088   return;
00089 }
00090
00091
00092 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00093   Method:   CServer::~CServer
00094
00095   Summary:  CServer Destructor.
00096
00097   Args:     void
00098
00099   Modifies: .
00100
00101   Returns:  void
00102 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00103 CServer::~CServer(void)
00104 {
00105   return;
00106 }
00107
00108
00109 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00110   Method:   CServer::Lock
00111
00112   Summary:  Increment the Server's Lock count.
00113
00114   Args:     void
00115
00116   Modifies: .
00117
00118   Returns:  void
00119 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00120 void CServer::Lock(void)
00121 {
00122   InterlockedIncrement((PLONG) &m_cLocks);
00123
00124   LOGF1("P: CServer::Lock. New cLocks=%i.", m_cLocks);
00125
00126   return;
00127 }
00128
00129
00130 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00131   Method:   CServer::Unlock
00132
00133   Summary:  Decrement the Server's Lock count.
00134
00135   Args:     void
00136
00137   Modifies: .
00138
00139   Returns:  void
00140 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00141 void CServer::Unlock(void)
00142 {
00143   InterlockedDecrement((PLONG) &m_cLocks);
00144
00145   LOGF1("P: CServer::Unlock. New cLocks=%i.", m_cLocks);
00146
00147   return;
00148 }
00149
00150
00151 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00152   Method:   CServer::ObjectsUp
00153
00154   Summary:  Increment the Server's living Object count.
00155
00156   Args:     void
00157
00158   Modifies: .
00159
00160   Returns:  void
00161 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00162 void CServer::ObjectsUp(void)
00163 {
00164   InterlockedIncrement((PLONG) &m_cObjects);
00165
00166   LOGF1("P: CServer::ObjectsUp. New cObjects=%i.", m_cObjects);
00167
00168   return;
00169 }
00170
00171
00172 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00173   Method:   CServer::ObjectsDown
00174
00175   Summary:  Decrement the Server's living object count.
00176
00177   Args:     void
00178
00179   Modifies: .
00180
00181   Returns:  void
00182 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00183 void CServer::ObjectsDown(void)
00184 {
00185   InterlockedDecrement((PLONG) &m_cObjects);
00186
00187   LOGF1("P: CServer::ObjectsDown. New cObjects=%i.", m_cObjects);
00188
00189   return;
00190 }
00191
00192
00193 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00194   Method:   CServer::CheckLicense
00195
00196   Summary:  Check for global machine license for this server.  Looks for a
00197             LICSERVE.LIC file and compares its first text line with the
00198             expected license key string stored in this server module.
00199
00200   Args:     void
00201
00202   Modifies: .
00203
00204   Returns:  BOOL
00205               TRUE if license verified; FALSE if not.
00206 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00207 BOOL CServer::CheckLicense(void)
00208 {
00209   TCHAR  szPath[MAX_PATH];
00210   CHAR   szLicKeyRead[MAX_LICENSEKEY];
00211   UINT   cbRead;
00212   ULONG  cbWasRead;
00213   UINT   cb;
00214   HANDLE hFile;
00215
00216   // Assume license not verified to start.
00217   m_bLicensed = FALSE;
00218
00219   // Assume the license key string is ASCII and count its length.
00220   m_cLicenseLen = cb = lstrlenA(m_szLicenseKey);
00221
00222   // Get the module path. Then parse and replace DLL extension with LIC.
00223   MakeFamilyPath(m_hDllInst, szPath, TEXT(LICENSE_FILE_EXT));
00224
00225   // Open the xx.LIC file and read in and check the license key for a match.
00226   hFile = CreateFile(
00227             szPath,
00228             GENERIC_READ,
00229             FILE_SHARE_READ,
00230             NULL,
00231             OPEN_EXISTING,
00232             FILE_ATTRIBUTE_NORMAL,
00233             NULL);
00234
00235   if (INVALID_HANDLE_VALUE != hFile)
00236   {
00237     cbRead = cb * sizeof(CHAR);
00238     ReadFile(hFile, szLicKeyRead, cbRead, &cbWasRead, NULL);
00239     CloseHandle(hFile);
00240     if (cbRead == cbWasRead)
00241       if (0 == memcmp(m_szLicenseKey, szLicKeyRead, cb))
00242         m_bLicensed = TRUE;
00243   }
00244
00245   LOGF1("P: CServer::CheckLicense. bLicensed=%i.", m_bLicensed);
00246
00247   return m_bLicensed;
00248 }
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello3/Notify.Cpp Source File

  • Web
  • MSAgent
  • c
  • Hello3

Notify.Cpp

Go to the documentation of this file.
00001 #include "Notify.h"
00002
00003
00004 //==========================================================================
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //--------------------------------------------------------------------------
00014 //
00015 // AgentNotifySink
00016 //
00017 //    Boilerplate IDispatch implementation with stubs for all
00018 //    IAgentNotifySink methods except for RequestComplete.
00019 //
00020 //==========================================================================
00021
00022
00023 extern long g_lDone;
00024
00025
00026 // IUnknown methods
00027
00028 STDMETHODIMP AgentNotifySink::QueryInterface (REFIID riid, LPVOID *ppv) {
00029
00030     *ppv = NULL;
00031
00032     if ((riid == IID_IUnknown) || (riid == IID_IAgentNotifySink))
00033         *ppv = this;
00034
00035     if (*ppv == NULL)
00036         return E_NOINTERFACE;
00037
00038     ((LPUNKNOWN)*ppv)->AddRef();
00039
00040     return NOERROR;
00041 }
00042
00043
00044 STDMETHODIMP_ (ULONG) AgentNotifySink::AddRef() {
00045
00046   return ++m_cRefs;
00047 }
00048
00049
00050 STDMETHODIMP_(ULONG) AgentNotifySink::Release() {
00051
00052   if (--m_cRefs != 0)
00053     return m_cRefs;
00054
00055   delete this;
00056   return 0;
00057 }
00058
00059
00060 // IDispatch methods
00061
00062 STDMETHODIMP AgentNotifySink::GetTypeInfoCount(UINT *pctInfo) {
00063
00064     *pctInfo = 1;
00065     return NOERROR;
00066 }
00067
00068
00069 STDMETHODIMP AgentNotifySink::GetTypeInfo(UINT itInfo, LCID lcid, ITypeInfo **ppTypeInfo) {
00070
00071     HRESULT hRes;
00072     ITypeLib *pLib;
00073
00074     *ppTypeInfo = NULL;
00075
00076   if (itInfo != 0)
00077         return TYPE_E_ELEMENTNOTFOUND;
00078
00079     if (ppTypeInfo == NULL)
00080         return E_POINTER;
00081
00082   if ((PRIMARYLANGID(lcid) != LANG_NEUTRAL) &&
00083     (PRIMARYLANGID(lcid) != LANG_ENGLISH))
00084     return DISP_E_UNKNOWNLCID;
00085
00086     hRes = LoadRegTypeLib(LIBID_AgentServerObjects,
00087               1,
00088               0,
00089               PRIMARYLANGID(lcid),
00090               &pLib);
00091     if (FAILED(hRes))
00092         return hRes;
00093
00094   hRes = pLib->GetTypeInfoOfGuid(IID_IAgentNotifySink, ppTypeInfo);
00095
00096   pLib->Release();
00097
00098     if (FAILED(hRes))
00099         return hRes;
00100
00101     (*ppTypeInfo)->AddRef();
00102
00103     return NOERROR;
00104 }
00105
00106
00107 STDMETHODIMP AgentNotifySink::GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgDispID) {
00108
00109     HRESULT hRes;
00110     ITypeInfo *pInfo;
00111
00112   // REFIID must be NULL
00113
00114   if (riid != IID_NULL)
00115         return ResultFromScode(DISP_E_UNKNOWNINTERFACE);
00116
00117   // Get the TypeInfo for the specified lcid
00118
00119     hRes = GetTypeInfo(0, lcid, &pInfo);
00120
00121   if (FAILED(hRes))
00122     return hRes;
00123
00124   // Use the TypeInfo to get the DISPIDs of the specified names.
00125   // That's the whole point here.  Let TypeInfo do the work so
00126   // we don't have to.
00127
00128   hRes = pInfo->GetIDsOfNames(rgszNames, cNames, rgDispID);
00129
00130   pInfo->Release();
00131
00132     return hRes;
00133 }
00134
00135
00136 STDMETHODIMP AgentNotifySink::Invoke(DISPID dispID, REFIID riid, LCID lcid,
00137                    unsigned short wFlags, DISPPARAMS *pDispParams,
00138                    VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
00139                    UINT *puArgErr) {
00140
00141   HRESULT hRes;
00142   ITypeInfo *pInfo;
00143
00144     // The riid parameter is always supposed to be IID_NULL
00145
00146   if (riid != IID_NULL)
00147         return DISP_E_UNKNOWNINTERFACE;
00148
00149   // Get the type info for the specified lcid
00150
00151     hRes = GetTypeInfo(0, lcid, &pInfo);
00152
00153     if (FAILED(hRes))
00154         return hRes;
00155
00156     // Clear exceptions
00157
00158     SetErrorInfo(0L, NULL);
00159
00160   hRes = pInfo->Invoke(this,
00161              dispID,
00162              wFlags,
00163              pDispParams,
00164              pVarResult,
00165              pExcepInfo,
00166              puArgErr);
00167
00168
00169     pInfo->Release();
00170
00171     return hRes;
00172 }
00173
00174
00175 // IAgentNotifySink methods
00176
00177 STDMETHODIMP AgentNotifySink::Command(long dwCommandID, IUnknown * punkUserInput) {
00178
00179   return NOERROR;
00180 }
00181
00182
00183 STDMETHODIMP AgentNotifySink::ActivateInputState(long dwCharID, long bActivated) {
00184
00185   return NOERROR;
00186 }
00187
00188
00189 STDMETHODIMP AgentNotifySink::Restart() {
00190
00191   return NOERROR;
00192 }
00193
00194
00195 STDMETHODIMP AgentNotifySink::Shutdown() {
00196
00197   return NOERROR;
00198 }
00199
00200
00201 STDMETHODIMP AgentNotifySink::VisibleState(long dwCharID, long bVisible, long lCause) {
00202
00203   return NOERROR;
00204 }
00205
00206
00207 STDMETHODIMP AgentNotifySink::Click(long dwCharID, short fwKeys, long X, long Y) {
00208
00209   return NOERROR;
00210 }
00211
00212
00213 STDMETHODIMP AgentNotifySink::DblClick(long dwCharID, short fwKeys, long X, long Y) {
00214
00215   return NOERROR;
00216 }
00217
00218
00219 STDMETHODIMP AgentNotifySink::DragStart(long dwCharID, short fwKeys, long X, long Y) {
00220
00221   return NOERROR;
00222 }
00223
00224
00225 STDMETHODIMP AgentNotifySink::DragComplete(long dwCharID, short fwKeys, long X, long Y) {
00226
00227   return NOERROR;
00228 }
00229
00230
00231 STDMETHODIMP AgentNotifySink::RequestStart(long dwRequestID) {
00232
00233   return NOERROR;
00234 }
00235
00236
00237 STDMETHODIMP AgentNotifySink::RequestComplete(long dwRequestID, long hrStatus) {
00238
00239   // When we get g_lDone exit the sample app
00240
00241   if (dwRequestID == g_lDone)
00242     PostQuitMessage(0);
00243
00244   return NOERROR;
00245 }
00246
00247
00248 STDMETHODIMP AgentNotifySink::BookMark(long dwBookMarkID) {
00249
00250   return NOERROR;
00251 }
00252
00253
00254 STDMETHODIMP AgentNotifySink::Idle(long dwCharID, long bStart) {
00255
00256   return NOERROR;
00257 }
00258
00259
00260 STDMETHODIMP AgentNotifySink::Move(long dwCharID, long X, long Y, long lCause) {
00261
00262   return NOERROR;
00263 }
00264
00265
00266 STDMETHODIMP AgentNotifySink::Size(long dwCharID, long lWidth, long lHeight) {
00267
00268   return NOERROR;
00269 }
00270
00271
00272 STDMETHODIMP AgentNotifySink::BalloonVisibleState(long dwCharID, long bVisible) {
00273
00274   return NOERROR;
00275 }
00276
00277
00278 STDMETHODIMP AgentNotifySink::HelpComplete(long dwCharID, long dwCommandID, long dwCause) {
00279
00280   return NOERROR;
00281 }
00282
00283
00284 STDMETHODIMP AgentNotifySink::ListeningState(long dwCharacterID, long bListenState, long dwCause) {
00285
00286   return NOERROR;
00287 }
00288
00289
00290 STDMETHODIMP AgentNotifySink::DefaultCharacterChange(BSTR bszGUID) {
00291
00292   return NOERROR;
00293 }
00294
00295
00296 STDMETHODIMP AgentNotifySink::AgentPropertyChange() {
00297
00298   return NOERROR;
00299 }
00300
00301
00302 STDMETHODIMP AgentNotifySink::ActiveClientChange(long dwCharID, long lStatus) {
00303
00304   return NOERROR;
00305 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authentication/AuthenticateContext.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Authentication

AuthenticateContext.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       AuthenticateContext.cpp
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011
00012
00013 #include "stdafx.h"
00014 #include "Authenticate.h"
00015 #include "AuthenticatePlugin.h"
00016 #include "AuthenticateContext.h"
00017
00018 //
00019 // TODO: Change the realm, domain, username, and password here
00020 //
00021 #define REALM_NAME      L"MyRealm"
00022 #define ANON_DOMAIN     L""
00023 #define ANON_USER       L""
00024 #define ANON_PSWD       L""
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // CAuthenticateContext
00028 ///////////////////////////////////////////////////////////////////////////////
00029
00030 CAuthenticateContext::CAuthenticateContext() :
00031     m_hToken( NULL ),
00032     m_bstrUsername( L"" ),
00033     m_State( 0 )
00034 {
00035     InitializeCriticalSection( &m_CritSec );
00036 }
00037
00038
00039 ///////////////////////////////////////////////////////////////////////////////
00040 ///////////////////////////////////////////////////////////////////////////////
00041 CAuthenticateContext::~CAuthenticateContext()
00042 {
00043     DeleteCriticalSection( &m_CritSec );
00044
00045     if( NULL != m_hToken )
00046     {
00047         CloseHandle( m_hToken );
00048     }
00049
00050     if( NULL != m_pWMSAuthenticationPlugin )
00051     {
00052         m_pWMSAuthenticationPlugin->Release();
00053     }
00054 }
00055
00056
00057 ///////////////////////////////////////////////////////////////////////////////
00058 ///////////////////////////////////////////////////////////////////////////////
00059 STDMETHODIMP CAuthenticateContext::Initialize
00060 (
00061     IWMSAuthenticationPlugin* pAuthenticator
00062 )
00063 {
00064     if( NULL == pAuthenticator)
00065     {
00066         return( E_INVALIDARG );
00067     }
00068
00069     HRESULT hr = S_OK;
00070
00071     EnterCriticalSection( &m_CritSec );
00072
00073     m_pWMSAuthenticationPlugin = pAuthenticator;
00074     m_pWMSAuthenticationPlugin->AddRef();
00075
00076     LeaveCriticalSection( &m_CritSec );
00077
00078     return( hr );
00079 }
00080
00081
00082 ///////////////////////////////////////////////////////////////////////////////
00083 ///////////////////////////////////////////////////////////////////////////////
00084 STDMETHODIMP CAuthenticateContext::GetAuthenticationPlugin
00085 (
00086     IWMSAuthenticationPlugin **ppAuthenPlugin
00087 )
00088 {
00089     if( NULL == ppAuthenPlugin)
00090     {
00091         return( E_INVALIDARG );
00092     }
00093
00094     HRESULT hr = S_OK;
00095
00096     EnterCriticalSection( &m_CritSec );
00097
00098     do
00099     {
00100         if( NULL == m_pWMSAuthenticationPlugin )
00101         {
00102             hr = E_UNEXPECTED;
00103             break;
00104         }
00105
00106         hr = m_pWMSAuthenticationPlugin->QueryInterface( IID_IWMSAuthenticationPlugin, (void**)ppAuthenPlugin );
00107
00108     }
00109     while( FALSE );
00110
00111     LeaveCriticalSection( &m_CritSec );
00112
00113     return( hr );
00114 }
00115
00116
00117 ///////////////////////////////////////////////////////////////////////////////
00118 ///////////////////////////////////////////////////////////////////////////////
00119 STDMETHODIMP CAuthenticateContext::Authenticate
00120 (
00121     VARIANT ResponseBlob,
00122     IWMSContext *pUserCtx,
00123     IWMSContext *pPresentationCtx,
00124     IWMSCommandContext *pCommandContext,
00125     IWMSAuthenticationCallback *pCallback,
00126     VARIANT Context
00127 )
00128 {
00129
00130     if( NULL == pCallback )
00131     {
00132         return(E_INVALIDARG);
00133     }
00134
00135     HRESULT hr = S_OK;
00136     EnterCriticalSection( &m_CritSec );
00137
00138     DWORD dwState = WMS_AUTHENTICATION_ERROR;
00139
00140     VARIANT ChallengeBlob;
00141     VariantInit( &ChallengeBlob );
00142
00143     do
00144     {
00145         if( WMS_AUTHENTICATION_SUCCESS == m_State )
00146         {
00147             dwState = m_State;
00148             break;
00149         }
00150
00151         if ( 0 == LogonUserW(
00152                     ANON_USER,
00153                     ANON_DOMAIN,
00154                     ANON_PSWD,
00155                     LOGON32_LOGON_NETWORK,
00156                     LOGON32_PROVIDER_DEFAULT,
00157                     &m_hToken ) )
00158         {
00159             m_hToken = NULL;
00160             m_bstrUsername = L"";
00161             hr = HRESULT_FROM_WIN32( ERROR_LOGON_FAILURE );
00162             dwState = WMS_AUTHENTICATION_DENIED;
00163             break;
00164         }
00165         else
00166         {
00167             m_State = dwState = WMS_AUTHENTICATION_SUCCESS;
00168             m_bstrUsername = ANON_USER;
00169         }
00170
00171     } while( FALSE );
00172
00173     LeaveCriticalSection( &m_CritSec );
00174
00175     pCallback->OnAuthenticateComplete( (WMS_AUTHENTICATION_RESULT) dwState, ChallengeBlob, Context );
00176
00177     VariantClear( &ChallengeBlob );
00178
00179     return( S_OK );
00180
00181 }
00182
00183
00184 ///////////////////////////////////////////////////////////////////////////////
00185 ///////////////////////////////////////////////////////////////////////////////
00186 STDMETHODIMP CAuthenticateContext::GetLogicalUserID
00187 (
00188     BSTR* bstrUserID
00189 )
00190 {
00191     if( NULL == bstrUserID )
00192     {
00193         return( E_POINTER );
00194     }
00195
00196     HRESULT hr = S_OK;
00197     EnterCriticalSection( &m_CritSec );
00198
00199     if( WMS_AUTHENTICATION_SUCCESS == m_State )
00200     {
00201         *bstrUserID = SysAllocString( m_bstrUsername.m_str );
00202
00203         if( NULL == *bstrUserID )
00204         {
00205             hr = E_OUTOFMEMORY;
00206         }
00207     }
00208     else
00209     {
00210         *bstrUserID = NULL;
00211     }
00212
00213     LeaveCriticalSection( &m_CritSec );
00214
00215     return( hr );
00216 }
00217
00218
00219 ///////////////////////////////////////////////////////////////////////////////
00220 ///////////////////////////////////////////////////////////////////////////////
00221 STDMETHODIMP CAuthenticateContext::GetImpersonationAccountName
00222 (
00223     BSTR* bstrAccountName
00224 )
00225 {
00226     if( NULL == bstrAccountName )
00227     {
00228         return( E_POINTER );
00229     }
00230
00231     HRESULT hr = E_NOTIMPL;
00232     EnterCriticalSection( &m_CritSec );
00233
00234     //
00235     // TODO: Add code here to return the Impersonation Account Name
00236     //
00237     // hr = ...
00238
00239     LeaveCriticalSection( &m_CritSec );
00240
00241     return( hr );
00242 }
00243
00244
00245 ///////////////////////////////////////////////////////////////////////////////
00246 ///////////////////////////////////////////////////////////////////////////////
00247 STDMETHODIMP CAuthenticateContext::GetImpersonationToken
00248 (
00249     long* Token
00250 )
00251 {
00252     if( NULL == Token )
00253     {
00254         return( E_POINTER );
00255     }
00256
00257     HRESULT hr = S_OK;
00258
00259     EnterCriticalSection( &m_CritSec );
00260
00261     *Token = HandleToLong(m_hToken);
00262
00263     LeaveCriticalSection( &m_CritSec );
00264
00265     return( hr );
00266 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/guids.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

guids.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Note that the GUIDs for CComponentData and CSnapinAbout are different
00014 //  from the ScopeNode project.  The Node GUIDs can stay the same since
00015 //  they are not really COM objects.
00016
00017
00018 #ifndef _MULTISELECT_PROJECT_GUIDS_
00019 #define _MULTISELECT_PROJECT_GUIDS_
00020
00021 // {17384dc8-ef90-4776-9307-70369f21e99b}
00022 DEFINE_GUID( CLSID_CComponentData,
00023              0x17384dc8, 0xef90, 0x4776, 0x93, 0x07, 0x70, 0x36, 0x9f, 0x21, 0xe9, 0x9b);
00024
00025 // {f54789ff-ad41-42d4-8f2e-a68089f625b1}
00026 DEFINE_GUID( CLSID_CSnapinAbout,
00027              0xf54789ff, 0xad41, 0x42d4, 0x8f, 0x2e, 0xa6, 0x80, 0x89, 0xf6, 0x25, 0xb1);
00028
00029 // {520F23F9-775D-4015-B437-98A24B9D085E}
00030 DEFINE_GUID( CLSID_DeviceNode,
00031              0x520F23f9, 0x775D, 0x4015, 0xB4, 0x37, 0x98, 0xA2, 0x4B, 0x9D, 0x8, 0x5E);
00032
00033 // {520F23FA-775D-4015-B437-98A24B9D085E}
00034 DEFINE_GUID( CLSID_CFolderNode,
00035              0x520F23fA, 0x775D, 0x4015, 0xb4, 0x37, 0x98, 0xA2, 0x4B, 0x9D, 0x8, 0x5E);
00036
00037 // {f0091c49-c869-4941-a81c-c719ad8174cc}
00038 DEFINE_GUID( CLSID_CVirtualFile,
00039              0xf0091c49, 0xc869, 0x4941, 0xa8, 0x1c, 0xc7, 0x19, 0xad, 0x81, 0x74, 0xcc);
00040
00041
00042 #endif //_MULTISELECT_PROJECT_GUIDS_
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/flipsel.cpp Source File

  • WinUI
  • TSFcase

flipsel.cpp

Go to the documentation of this file.
00001 //
00002 // flipsel.cpp
00003 //
00004 // "Flip Selection" menu item handler.
00005 //
00006
00007 #include "globals.h"
00008 #include "case.h"
00009 #include "editsess.h"
00010
00011 class CFlipEditSession : public CEditSessionBase
00012 {
00013 public:
00014     CFlipEditSession(ITfContext *pContext) : CEditSessionBase(pContext) {}
00015
00016     // ITfEditSession
00017     STDMETHODIMP DoEditSession(TfEditCookie ec);
00018 };
00019
00020 //+---------------------------------------------------------------------------
00021 //
00022 // _Menu_FlipSel
00023 //
00024 // Toggle the case of the selected text in the focus context.
00025 //----------------------------------------------------------------------------
00026
00027 void CCaseTextService::_Menu_FlipSel(CCaseTextService *_this)
00028 {
00029     ITfDocumentMgr *pFocusDoc;
00030     ITfContext *pContext;
00031     CFlipEditSession *pFlipEditSession;
00032     HRESULT hr;
00033
00034     // get the focus document
00035     if (_this->_pThreadMgr->GetFocus(&pFocusDoc) != S_OK)
00036         return;
00037
00038     // we want the topmost context, since the main doc context could be
00039     // superceded by a modal tip context
00040     if (pFocusDoc->GetTop(&pContext) != S_OK)
00041     {
00042         pContext = NULL;
00043         goto Exit;
00044     }
00045
00046     if (pFlipEditSession = new CFlipEditSession(pContext))
00047     {
00048         // we need a document write lock to insert text
00049         // the CHelloEditSession will do all the work when the
00050         // CFlipEditSession::DoEditSession method is called by the context
00051         pContext->RequestEditSession(_this->_tfClientId, pFlipEditSession, TF_ES_READWRITE | TF_ES_ASYNCDONTCARE, &hr);
00052
00053         pFlipEditSession->Release();
00054     }
00055
00056 Exit:
00057     SafeRelease(pContext);
00058     pFocusDoc->Release();
00059 }
00060
00061 //+---------------------------------------------------------------------------
00062 //
00063 // DoEditSession
00064 //
00065 //----------------------------------------------------------------------------
00066
00067 STDAPI CFlipEditSession::DoEditSession(TfEditCookie ec)
00068 {
00069     TF_SELECTION tfSelection;
00070     ULONG cFetched;
00071
00072     // get the selection
00073     if (_pContext->GetSelection(ec, TF_DEFAULT_SELECTION, 1, &tfSelection, &cFetched) != S_OK ||
00074         cFetched == 0)
00075     {
00076         // no selection
00077         return S_OK;
00078     }
00079
00080     // do the work
00081     ToggleCase(ec, tfSelection.range, FALSE);
00082
00083     // release the range
00084     tfSelection.range->Release();
00085
00086     return S_OK;
00087 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPrintSDIDoc Member List

This is the complete list of members for CPrintSDIDoc, including all inherited members.
CPrintSDIDoc() | CPrintSDIDoc | [protected]
m_polytype | CPrintSDIDoc |
m_szText | CPrintSDIDoc |
OnNewDocument() | CPrintSDIDoc | [virtual]
Serialize(CArchive &ar) | CPrintSDIDoc | [virtual]
~CPrintSDIDoc() | CPrintSDIDoc | [virtual]
Generated on Wed Nov 13 2024 16:57:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

fullsvr::FullServ Member List

This is the complete list of members for fullsvr::FullServ, including all inherited members.
clsid | fullsvr::FullServ | [static]
CreateCall(com.ms.com._Guid riid, IUnknown pCtrlUnk, com.ms.com._Guid riid2, IUnknown[] ppv) | fullsvr::FullServ |
iid | fullsvr::FullServ | [static]
fullsvr::IFullServ::iid | fullsvr::IFullServ | [static]
Sum(int i, int j) | fullsvr::FullServ |
fullsvr::IFullServ::Sum(int i, int j) | fullsvr::IFullServ |
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Parameters Member List

This is the complete list of members for msado15::Parameters, including all inherited members.
_NewEnum() | msado15::Parameters |
Append(Object Object) | msado15::Parameters |
Delete(Variant Index) | msado15::Parameters |
getCount() | msado15::Parameters |
getItem(Variant Index) | msado15::Parameters |
iid | msado15::Parameters | [static]
Refresh() | msado15::Parameters |
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/tracemacro.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

tracemacro.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "TraceMacro.h"
00017 #include <StdIo.h>             // Needed for sprintf on Win98
00018
00019
00020 //---------------------------------------------------------------------------
00021 //  Function implementations
00022 //
00023
00024 //---------------------------------------------------------------------------
00025 //  Provides trace output for HRESULTs in hex.
00026 //
00027 VOID Trace_HR
00028 (
00029   LPCTSTR pszClass,        //[in] Class name for message
00030   LPCTSTR pszFunction,     //[in] Function name for message
00031   HRESULT hr               //[in] HRESULT to display as a value
00032 )
00033 {
00034 #ifdef _DEBUG
00035
00036   TCHAR  szBuffer[512];
00037   TCHAR  szFormat[] = _T("%s::%s-> Returned 0x%X\n");
00038   INT    nChars     = 0;
00039
00040   nChars = _stprintf( szBuffer, szFormat, pszClass, pszFunction, hr );
00041   _ASSERTE( nChars < sizeof(szBuffer) );
00042
00043   OutputDebugString( szBuffer );
00044
00045 #endif
00046 } //end Trace_HR()
00047
00048
00049 //---------------------------------------------------------------------------
00050 //  Provides trace output for user defined numeric values in the form:
00051 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00052 //
00053 VOID Trace_Value
00054 (
00055   LPCTSTR pszClass,        //[in] Class name for message
00056   LPCTSTR pszFunction,     //[in] Function name for message
00057   LPCTSTR pszValueName,    //[in] Value name for message
00058   LONG    nValue           //[in] Numeric value for message
00059 )
00060 {
00061 #ifdef _DEBUG
00062
00063   TCHAR  szBuffer[512];
00064   TCHAR  szFormat[] = _T("%s::%s-> %s = %u\n");
00065   INT    nChars     = 0;
00066
00067   nChars = _stprintf( szBuffer,
00068                       szFormat,
00069                       pszClass,
00070                       pszFunction,
00071                       pszValueName,
00072                       nValue
00073                     );
00074   _ASSERTE( nChars < sizeof(szBuffer) );
00075
00076   OutputDebugString( szBuffer );
00077
00078 #endif
00079 } //end Trace_Value()
00080
00081 //---------------------------------------------------------------------------
00082 //  Provides trace output for user defined numeric values in the form:
00083 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00084 //
00085 VOID Trace_Pointer
00086 (
00087   LPCTSTR pszClass,        //[in] Class name for message
00088   LPCTSTR pszFunction,     //[in] Function name for message
00089   LPCTSTR pszAction,       //[in] Action which was taken
00090   ULONG   ulValue          //[in] Numeric value for message
00091 )
00092 {
00093 #ifdef _DEBUG
00094
00095   TCHAR  szBuffer[512];
00096   TCHAR  szFormat[] = _T("%s::%s-> %s = 0x%X\n");
00097   INT    nChars     = 0;
00098
00099   nChars = _stprintf( szBuffer,
00100                       szFormat,
00101                       pszClass,
00102                       pszFunction,
00103                       pszAction,
00104                       ulValue
00105                     );
00106   _ASSERTE( nChars < sizeof(szBuffer) );
00107
00108   OutputDebugString( szBuffer );
00109
00110 #endif
00111 } //end Trace_Pointer()
00112
00113
00114 //---------------------------------------------------------------------------
00115 //  Provides trace output which shows the class name, function name, and
00116 //  a string which maps to an MMC notification.
00117 //
00118 VOID Trace_Event
00119 (
00120   LPCTSTR pszClass,        //[in] Class name for message
00121   LPCTSTR pszFunction,     //[in] Event name for message
00122   LONG    nEvent           //[in] Event code to map to string
00123 )
00124 {
00125 #ifdef _DEBUG
00126
00127   TCHAR  szEventStr[64];
00128   TCHAR  szBuffer[512];
00129   TCHAR  szFormat[] = _T("%s::%s-> Event = %s\n");
00130   INT    nChars     = 0;
00131
00132   MapEvent( nEvent, szEventStr );
00133
00134   nChars = _stprintf( szBuffer,
00135                       szFormat,
00136                       pszClass,
00137                       pszFunction,
00138                       szEventStr
00139                     );
00140   _ASSERTE( nChars < sizeof(szBuffer) );
00141
00142   OutputDebugString( szBuffer );
00143
00144 #endif
00145 } //end Trace_Event()
00146
00147 //---------------------------------------------------------------------------
00148 //  Provides trace output which shows the class name and function name
00149 //
00150 VOID Trace_Start
00151 (
00152   LPCTSTR pszClass,        //[in] Class name for message
00153   LPCTSTR pszFunction      //[in] Event name for message
00154 )
00155 {
00156 #ifdef _DEBUG
00157
00158   TCHAR  szBuffer[512];
00159   TCHAR  szFormat[] = _T("%s::%s-> Started \n");
00160   INT    nChars     = 0;
00161
00162   nChars = _stprintf( szBuffer,
00163                       szFormat,
00164                       pszClass,
00165                       pszFunction
00166                     );
00167   _ASSERTE( nChars < sizeof(szBuffer) );
00168
00169   OutputDebugString( szBuffer );
00170
00171 #endif
00172 } //end Trace_Start()
00173
00174
00175
00176 //---------------------------------------------------------------------------
00177 // Provides human readable output for notifications
00178 //
00179 VOID MapEvent( LONG Event, LPTSTR szEventStr )
00180 {
00181 #ifdef _DEBUG
00182
00183   switch( Event )
00184   {
00185     case MMCN_ACTIVATE:
00186       _tcscpy( szEventStr, _T("MMCN_ACTIVATE          ") );
00187       break;
00188
00189     case MMCN_ADD_IMAGES:
00190       _tcscpy( szEventStr, _T("MMCN_ADD_IMAGES        ") );
00191       break;
00192
00193     case MMCN_BTN_CLICK:
00194       _tcscpy( szEventStr, _T("MMCN_BTN_CLICK         ") );
00195       break;
00196
00197     case MMCN_CLICK:
00198       _tcscpy( szEventStr, _T("MMCN_CLICK             ") );
00199       break;
00200
00201     case MMCN_COLUMN_CLICK:
00202       _tcscpy( szEventStr, _T("MMCN_COLUMN_CLICK       ") );
00203       break;
00204
00205     case MMCN_CONTEXTMENU:
00206       _tcscpy( szEventStr, _T("MMCN_CONTEXTMENU        ") );
00207       break;
00208
00209     case MMCN_CUTORMOVE:
00210       _tcscpy( szEventStr, _T("MMCN_CUTORMOVE          ") );
00211       break;
00212
00213     case MMCN_DBLCLICK:
00214       _tcscpy( szEventStr, _T("MMCN_DBLCLICK           ") );
00215       break;
00216
00217     case MMCN_DELETE:
00218       _tcscpy( szEventStr, _T("MMCN_DELETE             ") );
00219       break;
00220
00221     case MMCN_DESELECT_ALL:
00222       _tcscpy( szEventStr, _T("MMCN_DESELECT_ALL       ") );
00223       break;
00224
00225     case MMCN_EXPAND:
00226       _tcscpy( szEventStr, _T("MMCN_EXPAND             ") );
00227       break;
00228
00229     case MMCN_HELP:
00230       _tcscpy( szEventStr, _T("MMCN_HELP               ") );
00231       break;
00232
00233     case MMCN_MENU_BTNCLICK:
00234       _tcscpy( szEventStr, _T("MMCN_MENU_BTNCLICK      ") );
00235       break;
00236
00237     case MMCN_MINIMIZED:
00238       _tcscpy( szEventStr, _T("MMCN_MINIMIZED          ") );
00239       break;
00240
00241     case MMCN_PASTE:
00242       _tcscpy( szEventStr, _T("MMCN_PASTE              ") );
00243       break;
00244
00245     case MMCN_PROPERTY_CHANGE:
00246       _tcscpy( szEventStr, _T("MMCN_PROPERTY_CHANGE    ") );
00247       break;
00248
00249     case MMCN_QUERY_PASTE:
00250       _tcscpy( szEventStr, _T("MMCN_QUERY_PASTE        ") );
00251       break;
00252
00253     case MMCN_REFRESH:
00254       _tcscpy( szEventStr, _T("MMCN_REFRESH            ") );
00255       break;
00256
00257     case MMCN_REMOVE_CHILDREN:
00258       _tcscpy( szEventStr, _T("MMCN_REMOVE_CHILDREN    ") );
00259       break;
00260
00261     case MMCN_RENAME:
00262       _tcscpy( szEventStr, _T("MMCN_RENAME             ") );
00263       break;
00264
00265     case MMCN_SELECT:
00266       _tcscpy( szEventStr, _T("MMCN_SELECT             ") );
00267       break;
00268
00269     case MMCN_SHOW:
00270       _tcscpy( szEventStr, _T("MMCN_SHOW               ") );
00271       break;
00272
00273     case MMCN_VIEW_CHANGE:
00274       _tcscpy( szEventStr, _T("MMCN_VIEW_CHANGE        ") );
00275       break;
00276
00277     case MMCN_SNAPINHELP:
00278       _tcscpy( szEventStr, _T("MMCN_SNAPINHELP         ") );
00279       break;
00280
00281     case MMCN_CONTEXTHELP:
00282       _tcscpy( szEventStr, _T("MMCN_CONTEXTHELP        ") );
00283       break;
00284
00285     case MMCN_INITOCX:
00286       _tcscpy( szEventStr, _T("MMCN_INITOCX            ") );
00287       break;
00288
00289     // MMC Version 1.1 notifications
00290     case MMCN_FILTER_CHANGE:
00291       _tcscpy( szEventStr, _T("MMCN_FILTER_CHANGE      ") );
00292       break;
00293
00294     case MMCN_FILTERBTN_CLICK:
00295       _tcscpy( szEventStr, _T("MMCN_FILTERBTN_CLICK    ") );
00296       break;
00297
00298     case MMCN_RESTORE_VIEW:
00299       _tcscpy( szEventStr, _T("MMCN_RESTORE_VIEW       ") );
00300       break;
00301
00302     case MMCN_PRINT:
00303       _tcscpy( szEventStr, _T("MMCN_PRINT              ") );
00304       break;
00305
00306     case MMCN_PRELOAD:
00307       _tcscpy( szEventStr, _T("MMCN_PRELOAD            ") );
00308       break;
00309
00310     case MMCN_LISTPAD:
00311       _tcscpy( szEventStr, _T("MMCN_LISTPAD            ") );
00312       break;
00313
00314     case MMCN_EXPANDSYNC:
00315       _tcscpy( szEventStr, _T("MMCN_EXPANDSYNC         ") );
00316       break;
00317
00318     // MMC Version 1.2 notifications
00319     case MMCN_COLUMNS_CHANGED:
00320       _tcscpy( szEventStr, _T("MMCN_COLUMNS_CHANGED    ") );
00321       break;
00322
00323     // MMC Version 2.0 notifications
00324     case MMCN_CANPASTE_OUTOFPROC:
00325       _tcscpy( szEventStr, _T("MMCN_CANPASTE_OUTOFPROC ") );
00326       break;
00327
00328     default:
00329       _stprintf( szEventStr, _T("0x%X"), Event );
00330       break;
00331   }
00332
00333 #endif
00334 } //end MapEvent()
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ADQI.rc
00004 //
00005 #define IDM_ABOUTBOX                    0x0010
00006 #define IDD_ABOUTBOX                    100
00007 #define IDS_ABOUTBOX                    101
00008 #define IDD_ADQI_DIALOG                 102
00009 #define IDR_MAINFRAME                   128
00010 #define IDD_IADS                        130
00011 #define IDD_GETINFOEX                   131
00012 #define IDD_IADSCONTAINER               132
00013 #define IDD_RENAME                      133
00014 #define IDD_IDIRECTORYSEARCH            134
00015 #define IDD_IDIRECTORYOBJECT            136
00016 #define IDD_DELETEOBJECT                137
00017 #define IDD_PROPERTYLIST                138
00018 #define IDD_IADSOPENDSOBJECT            141
00019 #define IDD_SECURITY                    142
00020 #define IDD_MOVE                        144
00021 #define IDD_LARGEINTEGER                145
00022 #define IDC_ADSPATH                     1001
00023 #define IDC_INTERFACES                  1002
00024 #define IDC_NAME                        1003
00025 #define IDC_PARENT                      1004
00026 #define IDC_CLASS                       1007
00027 #define IDC_SCHEMA                      1009
00028 #define IDC_GUID                        1010
00029 #define IDC_GETINFO                     1011
00030 #define IDC_GETINFOEX                   1012
00031 #define IDC_SETINFO                     1013
00032 #define IDC_GET                         1014
00033 #define IDC_GETEX                       1015
00034 #define IDC_COPY                        1016
00035 #define IDC_ATTRLIST                    1017
00036 #define IDC_ATTRVALUE                   1018
00037 #define IDC_ATTR                        1019
00038 #define IDC_PUT                         1020
00039 #define IDC_PUTEX                       1021
00040 #define IDC_CHILDRENLIST                1021
00041 #define IDC_VIEW                        1022
00042 #define IDC_CHANGEUSER                  1023
00043 #define IDC_FILTER                      1024
00044 #define IDC_SET                         1025
00045 #define IDC_DELETE                      1026
00046 #define IDC_RENAME                      1027
00047 #define IDC_CREATE                      1028
00048 #define IDC_MOVE                        1029
00049 #define IDC_BROWSE                      1030
00050 #define IDC_TIMEOUT                     1034
00051 #define IDC_SEARCHSCOPE                 1035
00052 #define IDC_PAGESIZE_TXT                1036
00053 #define IDC_PAGESIZE                    1037
00054 #define IDC_CHASEREFERRAL_TXT           1038
00055 #define IDC_CHASEREFERRAL               1039
00056 #define IDC_SORTON                      1040
00057 #define IDC_TIMELIMIT                   1041
00058 #define IDC_EXECUTE                     1042
00059 #define IDC_SIZELIMIT                   1043
00060 #define IDC_ENABLED                     1044
00061 #define IDC_RESULTLIST                  1045
00062 #define IDC_TIMEOUT_TXT                 1047
00063 #define IDC_SEARCHSCOPE_TXT             1048
00064 #define IDC_SORTON_TXT                  1049
00065 #define IDC_PARENTPATH                  1050
00066 #define IDC_TIMELIMIT_TXT               1050
00067 #define IDC_RDN                         1051
00068 #define IDC_SIZELIMIT_TXT               1051
00069 #define IDC_DN                          1052
00070 #define IDC_VALUELIST                   1055
00071 #define IDC_SCHEMAPATH                  1056
00072 #define IDC_CACHERESULTS                1057
00073 #define IDC_ATTRIBUTE                   1058
00074 #define IDC_ADSTYPE                     1061
00075 #define IDC_PURGE                       1063
00076 #define IDC_USERNAME                    1064
00077 #define IDC_PASSWORD                    1065
00078 #define IDC_SECURED                     1066
00079 #define IDC_ENCRYPT                     1067
00080 #define IDC_READONLY                    1068
00081 #define IDC_PROMPTCREDENTIAL            1069
00082 #define IDC_NOAUTHENTICATION            1070
00083 #define IDC_TOTAL                       1072
00084 #define IDC_ATTRIBONLY                  1073
00085 #define IDC_DEREF                       1074
00086 #define IDC_ASYNCH                      1075
00087 #define IDC_DEREF_TXT                   1076
00088 #define IDC_CURRENTCREDENTIAL           1077
00089 #define IDC_USERNAME_TXT                1079
00090 #define IDC_CLEARTEXT                   1080
00091 #define IDC_FASTBIND                    1080
00092 #define IDC_SIGNING                     1081
00093 #define IDC_ACELIST                     1082
00094 #define IDC_SEALING                     1082
00095 #define IDC_CREATE_CHILD                1083
00096 #define IDC_CREATECHILD                 1083
00097 #define IDC_CHECK2                      1084
00098 #define IDC_DELETECHILD                 1084
00099 #define IDC_LISTCONTENT                 1085
00100 #define IDC_LISTOBJECT                  1086
00101 #define IDC_READPROP                    1087
00102 #define IDC_WRITEPROP                   1088
00103 #define IDC_DELETETREE                  1089
00104 #define IDC_CREATECHILD_EDIT            1090
00105 #define IDC_DELETECHILD_EDIT            1091
00106 #define IDC_READPROP_EDIT               1092
00107 #define IDC_WRITEPROP_EDIT              1093
00108 #define IDC_CHANGE_CREATE_CHILD         1094
00109 #define IDC_CHANGE_CREATE_CHILD2        1095
00110 #define IDC_CHANGE_CREATE_CHILD3        1096
00111 #define IDC_CHANGE_CREATE_CHILD4        1097
00112 #define IDC_EXTENDEDRIGHT_EDIT          1098
00113 #define IDC_BUTTON1                     1099
00114 #define IDC_BINDGUID                    1099
00115 #define IDC_ACETYPE                     1100
00116 #define IDC_INHERITANCE                 1101
00117 #define IDC_DELETEOBJECT                1102
00118 #define IDC_READPERMISSION              1103
00119 #define IDC_MODIFYPERMISSION            1104
00120 #define IDC_MODIFYOWNER                 1105
00121 #define IDC_EXTENDEDRIGHT               1106
00122 #define IDC_HIPART                      1110
00123 #define IDC_LOWPART                     1111
00124 #define IDC_LISTVIEW                    1111
00125
00126 // Next default values for new objects
00127 //
00128 #ifdef APSTUDIO_INVOKED
00129 #ifndef APSTUDIO_READONLY_SYMBOLS
00130 #define _APS_NEXT_RESOURCE_VALUE        146
00131 #define _APS_NEXT_COMMAND_VALUE         32771
00132 #define _APS_NEXT_CONTROL_VALUE         1113
00133 #define _APS_NEXT_SYMED_VALUE           101
00134 #endif
00135 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMethodPro Member List

This is the complete list of members for CMethodPro, including all inherited members.
CancelAsyncCall(IWbemObjectSink __RPC_FAR *pSink) | CMethodPro | [inline]
CMethodPro() | CMethodPro |
CreateClassEnum(const BSTR Superclass, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CMethodPro | [inline]
CreateClassEnumAsync(const BSTR Superclass, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
CreateInstanceEnum(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CMethodPro | [inline]
CreateInstanceEnumAsync(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
DeleteClass(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CMethodPro | [inline]
DeleteClassAsync(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
DeleteInstance(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CMethodPro | [inline]
DeleteInstanceAsync(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
ExecMethod(const BSTR, const BSTR, long, IWbemContext *, IWbemClassObject *, IWbemClassObject **, IWbemCallResult **) | CMethodPro | [inline]
ExecMethodAsync(const BSTR, const BSTR, long, IWbemContext *, IWbemClassObject *, IWbemObjectSink *) | CMethodPro |
ExecNotificationQuery(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CMethodPro | [inline]
ExecNotificationQueryAsync(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
ExecQuery(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CMethodPro | [inline]
ExecQueryAsync(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
GetIDsOfNames(THIS_ REFIID riid, OLECHAR FAR *FAR *rgszNames, UINT cNames, LCID lcid, DISPID FAR *rgdispid) | CMethodPro | [inline]
GetObject(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CMethodPro | [inline]
GetObjectAsync(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
GetTypeInfo(THIS_ UINT itinfo, LCID lcid, ITypeInfo FAR *FAR *pptinfo) | CMethodPro | [inline]
GetTypeInfoCount(THIS_ UINT FAR *pctinfo) | CMethodPro | [inline]
Initialize(LPWSTR pszUser, LONG lFlags, LPWSTR pszNamespace, LPWSTR pszLocale, IWbemServices *pNamespace, IWbemContext *pCtx, IWbemProviderInitSink *pInitSink) | CMethodPro |
Invoke(THIS_ DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, EXCEPINFO FAR *pexcepinfo, UINT FAR *puArgErr) | CMethodPro | [inline]
m_cRef | CMethodPro | [protected]
m_pOutClass | CMethodPro | [protected]
m_pWbemSvcs | CMethodPro | [protected]
OpenNamespace(const BSTR Namespace, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace, IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) | CMethodPro | [inline]
PutClass(IWbemClassObject __RPC_FAR *pObject, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CMethodPro | [inline]
PutClassAsync(IWbemClassObject __RPC_FAR *pObject, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
PutInstance(IWbemClassObject __RPC_FAR *pInst, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CMethodPro | [inline]
PutInstanceAsync(IWbemClassObject __RPC_FAR *pInst, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CMethodPro | [inline]
QueryInterface(REFIID, PPVOID) | CMethodPro |
QueryObjectSink(long lFlags, IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) | CMethodPro | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CMethodPro |
STDMETHODIMP_(ULONG) Release(void) | CMethodPro |
~CMethodPro(void) | CMethodPro |
Generated on Wed Nov 13 2024 16:56:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_LOCINFO Member List

This is the complete list of members for _LOCINFO, including all inherited members.
tcAcp | _LOCINFO
tcLcid | _LOCINFO
tcLLang | _LOCINFO
tcNCountry | _LOCINFO
tcNLang | _LOCINFO
tcOem | _LOCINFO
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DEB_PROCESS_LIST_INFO_STRUCT Member List

This is the complete list of members for DEB_PROCESS_LIST_INFO_STRUCT, including all inherited members.
dwActiveProcesses DEB_PROCESS_LIST_INFO_STRUCT
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ObjectStateEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ObjectStateEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: ObjectStateEnum
00019
00020 public class ObjectStateEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adStateClosed = 0;
00023   public static final short adStateOpen = 1;
00024   public static final short adStateConnecting = 2;
00025   public static final short adStateExecuting = 4;
00026   public static final short adStateFetching = 8;
00027 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/QosEvent/Receiver.Cpp Source File

  • NetDS
  • GQos
  • QosEvent

Receiver.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      receiver.cpp
00010 //
00011 // Abstract:
00012 //      Implement receive-side functionality.  The reciever can accept up to
00013 //      MAXCLIENT connections from senders (no limit for UDP).  The receiver
00014 //      uses WSAEventSelect to handle the potential multiple connections as
00015 //      well as to allow the receiver to receive notification of QOS activity
00016 //      via the FD_QOS notification.
00017 //
00018 //      Additionally, the receiver can be setup to receive multicast data for
00019 //      a given group.  This is accomplished by using the -m:Group-IP option
00020 //      which joins thereceiver to that Group-IP multicast group.
00021 //
00022 //      The template used when enabling QOS is specified with the commandline
00023 //      option -q:template.  A value of default for template will result in
00024 //      default values being entered for sending and receiving flowspec (see
00025 //      FillQos). Otherwisethe specified template is used (again see FillQos).
00026 //
00027 //      QOS can be enabled in the receiver in the following manner
00028 //      -i:b    before WSAAccept on the listening socket using WSAIoctl
00029 //      -i:d    during WSAAccept in the condition function
00030 //      -i:a    after WSAAccept on the accepted socket using WSAIoctl
00031 //      -i:q    upon receipt of FD_QOS.  In order to receive FD_QOS (i.e.
00032 //              enable the gqossp) qos is set using WSAIoctl prior to
00033 //              WSAEventSelect
00034 //      For non-multicast UDP QOS tranfers there is no API that gets called
00035 //      prior to initiating the data transfers, therefore QOS is
00036 //      set prior to the data transfers (i.e. -i:b).
00037 //
00038 //      Receipt of RESV confirmation can be requested using the -c commandline
00039 //      option (not yet implemented).
00040 //
00041 // Author:
00042 //      Barry R. Butterklee
00043 //
00044
00045 #include "qosevent.h"
00046
00047 #define MAXCLIENTS 4
00048
00049
00050 // encapsulate socket, events, buffers, and various flags and counters that
00051 // control how/when data is received into a structure
00052 typedef struct _RECV_INFO
00053 {
00054     SOCKET          sd[MAXCLIENTS+1];
00055     WSAEVENT        hEvents[MAXCLIENTS+1];
00056     CHAR *          recvbuf;
00057     int             nTotalClients;
00058 } RECV_INFO;
00059
00060
00061 static SOCKET g_sd;
00062
00063
00064 static BOOL CreateReceivingSocket(RECV_INFO *, OPTIONS *, WSAPROTOCOL_INFO *);
00065 static BOOL fd_accept_func(DWORD, WSANETWORKEVENTS *, RECV_INFO *, OPTIONS *);
00066 static BOOL fd_read_func(DWORD, WSANETWORKEVENTS *, RECV_INFO *, OPTIONS *);
00067 static BOOL fd_qos_func(DWORD, WSANETWORKEVENTS *, RECV_INFO *, OPTIONS *);
00068 static BOOL fd_close_func(DWORD, WSANETWORKEVENTS *, RECV_INFO *, OPTIONS *);
00069 int CALLBACK AcceptCondFunc(
00070     LPWSABUF, LPWSABUF, LPQOS, LPQOS, LPWSABUF,
00071     LPWSABUF, GROUP FAR *, DWORD_PTR);
00072
00073
00074 // Abstract:
00075 //      Main function to create a socket that allows clients to connect and
00076 //      send it data.  Upto MAXCLIENTS can connect and send data.  The data
00077 //      is read in and then tossed (the data is not used).
00078 //
00079 //      When using TCP, the first socket/event in the array of sockets/events
00080 //      (RECV_INFO) is the listening socket and the remaining are to handle the
00081 //      accepted connections.  For UDP, only the first socket/event is used.
00082 //
00083 VOID Receiver(
00084     OPTIONS             *pOptions,
00085     WSAPROTOCOL_INFO    *pProtocolInfo
00086     )
00087 {
00088     WSANETWORKEVENTS NetworkEvents;
00089     long lNetworkEvents;
00090     BOOL bProcessEventsDone;
00091     RECV_INFO RecvInfo;
00092     int i;
00093
00094     printf("Receiver\n");
00095
00096     // initialize data structures
00097     ZeroMemory(&RecvInfo, sizeof(RECV_INFO));
00098     for (i=0; i<MAXCLIENTS+1; i++)
00099     {
00100         RecvInfo.sd[i] = INVALID_SOCKET;
00101
00102         if (WSA_INVALID_EVENT == (RecvInfo.hEvents[i] = WSACreateEvent()))
00103         {
00104             printf("WSACreateEvent(%d): %d\n", i, WSAGetLastError());
00105             goto CLEANUP;
00106         }
00107     }
00108
00109     // create the receiving/listening socket
00110     if (!CreateReceivingSocket(&RecvInfo, pOptions, pProtocolInfo))
00111         goto CLEANUP;
00112
00113
00114     // TCP sockets need to accept a connection prior to receiving data.  ,
00115     // Additionally if we are doing UDP and multicasting, IP Multicasting does
00116     // not support rooted planes and thus a receiving end will not get
00117     // FD_ACCEPT notification
00118     if (IPPROTO_TCP == pOptions->spOptions.iProtocol)
00119         lNetworkEvents = FD_ACCEPT;
00120     else
00121         lNetworkEvents = (FD_READ|FD_QOS|FD_CLOSE);
00122
00123     if (SOCKET_ERROR == WSAEventSelect(RecvInfo.sd[0], RecvInfo.hEvents[0],
00124                                         lNetworkEvents))
00125     {
00126         printf("WSAEventSelect: %d\n", WSAGetLastError());
00127         goto CLEANUP;
00128     }
00129
00130     bProcessEventsDone = FALSE;
00131     do
00132     {
00133         DWORD dwEvent = WSAWaitForMultipleEvents((MAXCLIENTS+1), RecvInfo.hEvents,
00134                                                     FALSE, WSA_INFINITE, FALSE);
00135         switch (dwEvent)
00136         {
00137         case WSA_WAIT_FAILED:
00138             printf("WSAEventSelect: %d\n", WSAGetLastError());
00139             goto CLEANUP;
00140
00141         case WAIT_IO_COMPLETION:
00142         case WSA_WAIT_TIMEOUT:
00143             _assume(0);
00144             break;
00145
00146         default:
00147             // lets see what network activity trigged this event
00148             NetworkEvents.lNetworkEvents = 0;
00149             dwEvent -= WSA_WAIT_EVENT_0;
00150
00151             if (SOCKET_ERROR == WSAEnumNetworkEvents(RecvInfo.sd[dwEvent],
00152                                                      RecvInfo.hEvents[dwEvent],
00153                                                      &NetworkEvents))
00154             {
00155                 printf("WSAEnumNetworkEvent: %d dwEvent %d lNetworkEvent %X\n",
00156                             WSAGetLastError(), dwEvent,
00157                             NetworkEvents.lNetworkEvents);
00158
00159                 goto CLEANUP;
00160             }
00161
00162             // it is possible that more than one notification triggered
00163             //printf("WSAEnumNetworkEvents %X\n", NetworkEvents.lNetworkEvents)
00164             if (FD_ACCEPT & NetworkEvents.lNetworkEvents)
00165                 bProcessEventsDone |= fd_accept_func(dwEvent,
00166                                                      &NetworkEvents,
00167                                                      &RecvInfo,
00168                                                      pOptions);
00169
00170             if (FD_READ & NetworkEvents.lNetworkEvents)
00171                 bProcessEventsDone |= fd_read_func(dwEvent,
00172                                                      &NetworkEvents,
00173                                                      &RecvInfo,
00174                                                      pOptions);
00175
00176             if (FD_QOS     & NetworkEvents.lNetworkEvents)
00177                 bProcessEventsDone |= fd_qos_func(dwEvent,
00178                                                   &NetworkEvents,
00179                                                   &RecvInfo,
00180                                                   pOptions);
00181
00182             if (FD_CLOSE   & NetworkEvents.lNetworkEvents)
00183                 bProcessEventsDone |= fd_close_func(dwEvent,
00184                                                     &NetworkEvents,
00185                                                     &RecvInfo,
00186                                                     pOptions);
00187
00188             break;
00189         }
00190     } while (!bProcessEventsDone);
00191
00192 CLEANUP:
00193     for (i=0; i<MAXCLIENTS+1; i++)
00194     {
00195         if (    (WSA_INVALID_EVENT != RecvInfo.hEvents[i])
00196             &&  (NULL != RecvInfo.hEvents[i]))
00197             WSACloseEvent(RecvInfo.hEvents[i]);
00198
00199         if (    (INVALID_SOCKET != RecvInfo.sd[i])
00200              && (NULL != RecvInfo.sd[i]))
00201             closesocket(RecvInfo.sd[i]);
00202     }
00203
00204     return;
00205 }
00206
00207
00208
00209
00210 // Abstract:
00211 //      Create a socket on which to receive data.  Note that this differs
00212 //      depending upon whether TCP or UDP is used.  Also, please note that
00213 //      WSA_FLAG_OVERLAPPED *MUST* be specified.  Also, note that the
00214 //      parameters for WSASocket and the data to fill in the SOCKADDR_IN
00215 //      structure come from the supplied protocol info structure instead of
00216 //      being hardcoded.
00217 //
00218 //      The listening socket (and thus all accepted sockets) can be made into a
00219 //      QOS socket if the -i:b option is set.  If -i:q is set then we actually
00220 //      need to inform the GQOSSP that we wish to receive FD_QOS if we ask for
00221 //      them. As a consequence we also need to make the socket into a QOS
00222 //      socket before WSAEventSelect is called.  I choose to make the socket a
00223 //      QOS socket (if -i:q) here to accomadate both TCP and UDP sockets
00224 //      instead of in the FD_ACCEPT handler because the FD_ACCEPT handler will
00225 //      not be invoked for UDP.
00226 //
00227 static BOOL CreateReceivingSocket(
00228     RECV_INFO           *pRecvInfo,
00229     OPTIONS             *pOptions,
00230     WSAPROTOCOL_INFO    *pProtocolInfo
00231     )
00232 {
00233     SOCKADDR_IN addr_srv;
00234     int         nRet;
00235     QOS         qos;
00236     QOS         *pQos;
00237     DWORD       cbQosLen;
00238     DWORD       dwSocketFlags = WSA_FLAG_OVERLAPPED;
00239
00240
00241     // If we are multicast enabled set the control and data planes to leafs.
00242     // These flags must be set for IP multicasting.
00243     if (pOptions->spOptions.bMulticast)
00244         dwSocketFlags |=
00245                     (WSA_FLAG_MULTIPOINT_C_LEAF | WSA_FLAG_MULTIPOINT_D_LEAF);
00246
00247     pRecvInfo->sd[0] = WSASocket(FROM_PROTOCOL_INFO,
00248                                  FROM_PROTOCOL_INFO,
00249                                  FROM_PROTOCOL_INFO,
00250                                  pProtocolInfo,
00251                                  0,
00252                                  dwSocketFlags);
00253
00254     if (INVALID_SOCKET == pRecvInfo->sd[0])
00255     {
00256         printf("WSASocket %d", WSAGetLastError());
00257         return(FALSE);
00258     }
00259
00260     ZeroMemory((PVOID)&addr_srv, sizeof(addr_srv));
00261     addr_srv.sin_family      = (USHORT) pProtocolInfo->iAddressFamily;
00262     addr_srv.sin_addr.s_addr = htonl(INADDR_ANY);
00263     addr_srv.sin_port        = htons(pOptions->port);
00264
00265     nRet = bind(pRecvInfo->sd[0], (LPSOCKADDR)&addr_srv, sizeof(addr_srv));
00266     if (SOCKET_ERROR == nRet)
00267     {
00268         printf("bind %d", WSAGetLastError());
00269         return(FALSE);
00270     }
00271
00272     // Set the time-to-live (TTL) option for multicasting if enabled. This
00273     // limits how far data sent to a group will go.
00274     if (pOptions->spOptions.bMulticast)
00275     {
00276         int optval = 64;
00277
00278         if (SOCKET_ERROR ==setsockopt(pRecvInfo->sd[0], IPPROTO_IP,
00279                                       IP_MULTICAST_TTL, (char *)&optval,
00280                                       sizeof(int)))
00281         {
00282             printf("setsockopt(IP_MULTICAST_TTL) %d\n", WSAGetLastError());
00283             return(FALSE);
00284         }
00285     }
00286
00287     // for TCP we need to call listen
00288     if (IPPROTO_TCP == pOptions->spOptions.iProtocol)
00289     {
00290         nRet = listen(pRecvInfo->sd[0], SOMAXCONN);
00291         if (SOCKET_ERROR == nRet)
00292         {
00293             printf("listen %d", WSAGetLastError());
00294             return(FALSE);
00295         }
00296     }
00297
00298     g_sd = pRecvInfo->sd[0];
00299
00300     pQos = NULL;
00301     if (pOptions->spOptions.bQos)
00302     {
00303         switch (pOptions->qosOptions.qosIoctlSet)
00304         {
00305         case QOS_IOCTL_SET_BEFORE:
00306             if (SetQos(pRecvInfo->sd[0], &pOptions->qosOptions,
00307                         TRUE, &qos, &cbQosLen))
00308                 printf("  QOS set before accept\n");
00309             break;
00310
00311         case QOS_IOCTL_SET_QOS:
00312             // this one is tricky.  The intent is to send the RESV after
00313             // receiving FD_QOS notification.  However, unless we somehow
00314             // inform the GQOSSP that we are interested in QOS, it will not
00315             // send us FD_QOS when receiving a RESV.  However, we do not want
00316             // to send out a RESV until we explicitedly set QOS.  We therefore
00317             // do not want QOS signalling (i.e. RSVP messages) to be sent.
00318             pOptions->qosOptions.bDisableSignalling = TRUE;
00319             if (SetQos(pRecvInfo->sd[0], &pOptions->qosOptions,
00320                         TRUE, &qos, &cbQosLen))
00321             {
00322                 printf("  QOS set qos before accept - will be set again in FD_QOS\n");
00323                 pQos = &qos;
00324             }
00325             break;
00326         }
00327     }
00328
00329     // Join the multicast group if specfied.  We may also specify a given QOS
00330     // structure at this time.
00331     if (pOptions->spOptions.bMulticast)
00332     {
00333         SOCKADDR_IN mult_addr;
00334
00335         ZeroMemory((PVOID)&mult_addr, sizeof(mult_addr));
00336         mult_addr.sin_family      = (USHORT) pProtocolInfo->iAddressFamily;
00337         mult_addr.sin_addr.s_addr = inet_addr(pOptions->szHostname);
00338         mult_addr.sin_port        = htons(pOptions->port);
00339
00340         nRet = (int) WSAJoinLeaf(pRecvInfo->sd[0], (LPSOCKADDR)&mult_addr,
00341                                   sizeof(mult_addr), NULL, NULL, pQos,
00342                                    NULL, JL_BOTH);
00343         if (INVALID_SOCKET == nRet)
00344         {
00345             printf("WSAJoinLeaf %d", WSAGetLastError());
00346             return(FALSE);
00347         }
00348
00349         if (    (pOptions->spOptions.bQos)
00350             &&  (QOS_IOCTL_SET_AFTER == pOptions->qosOptions.qosIoctlSet)
00351             &&  (SetQos(pRecvInfo->sd[0], &pOptions->qosOptions, TRUE, &qos, &cbQosLen)))
00352                 printf("    QOS set after WSAJoinLeaf\n");
00353     }
00354
00355     return(TRUE);
00356 }
00357
00358
00359
00360
00361 // Abstract:
00362 //      FD_ACCEPT handler.  Invoked when a client is trying to connect
00363 //      (TCP-only). WSAAccept is called and an Accept Condition function is
00364 //      supplied to allow a connection to be rejected if too many client have
00365 //      already connected.
00366 //
00367 //      The condition function allows the accepted socket to be made into a QOS
00368 //      socket (if -i:d option has been specified).  The socket can also be
00369 //      made into a QOS socket after WSAAccept returns.
00370 //
00371 //      After a successful WSAAccept, the proper notifications for a TCP socket
00372 //      are set with WSAEventSelect.
00373 //
00374 static BOOL fd_accept_func(
00375     DWORD               dwEvent,
00376     WSANETWORKEVENTS    *NetworkEvents,
00377     RECV_INFO           *pRecvInfo,
00378     OPTIONS             *pOptions
00379     )
00380 {
00381     SOCKET  temp_socket;
00382     int     i, nRet;
00383     QOS     qos;
00384     DWORD   cbQosLen;
00385
00386
00387     printf("  FD_ACCEPT: dwEvent=%d error code =%d\n",
00388             dwEvent, NetworkEvents->iErrorCode[FD_ACCEPT_BIT]);
00389
00390     if (NetworkEvents->iErrorCode[FD_ACCEPT_BIT])
00391         return(TRUE);
00392
00393     temp_socket = WSAAccept(pRecvInfo->sd[0], NULL, NULL,
00394                     AcceptCondFunc, (DWORD_PTR)pOptions);
00395
00396     if (INVALID_SOCKET == temp_socket)
00397     {
00398         printf("    WSAAccept %d\n", WSAGetLastError());
00399         return(FALSE);
00400     }
00401
00402     // keep list of connected sockets
00403     printf("    socket connection accepted\n");
00404     for (i = 1; i < MAXCLIENTS; i++)
00405         if (INVALID_SOCKET == pRecvInfo->sd[i])
00406         {
00407             pRecvInfo->sd[i] = temp_socket;
00408             break;
00409         }
00410
00411     _assume(i < MAXCLIENTS);
00412
00413     if (    (pOptions->spOptions.bQos)
00414         &&  (QOS_IOCTL_SET_AFTER == pOptions->qosOptions.qosIoctlSet)
00415         &&  (SetQos(temp_socket, &pOptions->qosOptions, TRUE, &qos, &cbQosLen)))
00416             printf("    QOS set after accept\n");
00417
00418     nRet = WSAEventSelect(temp_socket,
00419                           pRecvInfo->hEvents[i],
00420                           (FD_READ|FD_QOS|FD_CLOSE));
00421
00422     if (SOCKET_ERROR == nRet)
00423     {
00424         printf("    WSAEventSelect: %d\n", WSAGetLastError());
00425         return(TRUE);
00426     }
00427
00428     return(FALSE);
00429 }
00430
00431
00432
00433 // Abstract:
00434 //      FD_READ handler.  Handling FD_READ notifications is pretty
00435 //      straight-forward. Just read the amount of data you are interested in
00436 //      reading at this moment. If there is more data left, you will get
00437 //      another FD_READ.
00438 //
00439 //      *** Currently, I am reusing the same buffer for all reads.  Though note
00440 //       that since I am not really "using" any ofthe data I read it is not a
00441 //      problem.
00442 //
00443 static BOOL fd_read_func(
00444     DWORD               dwEvent,
00445     WSANETWORKEVENTS    *NetworkEvents,
00446     RECV_INFO           *pRecvInfo,
00447     OPTIONS             *pOptions
00448     )
00449 {
00450     int         nRecv;
00451     static CHAR *bufptr = pOptions->buf;
00452     static int  nBytesToRecv = pOptions->nBufSize;
00453
00454     printf("  FD_READ: dwEvent=%d error code =%d bytestorecv=%d\n",
00455         dwEvent, NetworkEvents->iErrorCode[FD_READ_BIT], nBytesToRecv);
00456
00457     if (NetworkEvents->iErrorCode[FD_READ_BIT])
00458         return(TRUE);
00459
00460     // if UDP use recvfrom()
00461     if (IPPROTO_TCP == pOptions->spOptions.iProtocol)
00462         nRecv = recv(pRecvInfo->sd[dwEvent], bufptr, nBytesToRecv, 0);
00463     else
00464         nRecv = recvfrom(pRecvInfo->sd[dwEvent], bufptr,
00465                          nBytesToRecv, 0, NULL, NULL);
00466
00467     if (SOCKET_ERROR == nRecv)
00468         switch (WSAGetLastError())
00469         {
00470             case WSAEWOULDBLOCK:
00471                 printf("    recv[from]: WSAEWOULDBLOCK, wait for next FD_READ\n");
00472                 return(FALSE);
00473
00474             case WSAECONNRESET:
00475                 // FD_CLOSE will follow (sender terminated early)
00476                 return(FALSE);
00477
00478             default:
00479                 // any other read errors will close app
00480                 return(TRUE);
00481         }
00482
00483     // we got data
00484     if (nRecv)
00485         printf("    recv'ed bytes=%d char=<%c>\n", nRecv, *bufptr);
00486     else
00487         printf("    recv'ed 0 bytes\n");
00488
00489     bufptr += nRecv;
00490     nBytesToRecv -= nRecv;
00491     if (0 == nBytesToRecv)
00492     {
00493         bufptr = pOptions->buf;
00494         nBytesToRecv = pOptions->nBufSize;
00495     }
00496
00497     return (FALSE);
00498 }
00499
00500
00501
00502
00503 // Abstract:
00504 //      FD_QOS handler.  This notification indicates that the GQOSSP wants to
00505 //      indicate a change in QOS status (i.e. delivery of an RSVP message).
00506 //      Only a change in QOS will cause FD_QOS notifications to be delivered,
00507 //      periodic RSVP refresh messages will not cause an FD_QOS notification.
00508 //
00509 //      Note that the iErrorCode is not really an errorcode but a status code.
00510 //
00511 //      Also notice that multiple QOS structures may be queued up per FD_QOS
00512 //      notification and should be examined.
00513 //
00514 static BOOL fd_qos_func(
00515     DWORD               dwEvent,
00516     WSANETWORKEVENTS    *NetworkEvents,
00517     RECV_INFO           *pRecvInfo,
00518     OPTIONS             *pOptions
00519     )
00520 {
00521     int     nRet;
00522     DWORD   cbQosLen;
00523     DWORD   dwBytes;
00524     QOS     *pQos = NULL;
00525
00526     // used for looking into provider information
00527     QOS_OBJECT_HDR   *pObjectHdr;
00528     RSVP_STATUS_INFO *pRsvpStatus;
00529
00530     printf("  FD_QOS: dwEvent=%d error/status code =%d\n",
00531     dwEvent, NetworkEvents->iErrorCode[FD_QOS_BIT]);
00532
00533     if (NetworkEvents->iErrorCode[FD_QOS_BIT])
00534         return(TRUE);
00535
00536     do
00537     {
00538         if (pQos != NULL)
00539         {
00540             free(pQos);
00541             pQos = NULL;
00542         }
00543
00544         // Keep going till the getqos call says we are done
00545         if (!GetQos(pRecvInfo->sd[dwEvent],
00546                     pOptions->qosOptions.bQueryBufferSize,
00547                     &pQos))
00548             break;
00549
00550         PrintQos(pQos, "    ");
00551
00552         // Move on if aren't supposed to set qos now
00553         if (    !pOptions->spOptions.bQos
00554             ||  (QOS_IOCTL_SET_QOS != pOptions->qosOptions.qosIoctlSet))
00555             continue;
00556
00557         pQos->SendingFlowspec = default_notraffic;
00558
00559         // Make sure we have a providerspecific buffer
00560         if (pQos->ProviderSpecific.buf == NULL)
00561             continue;
00562
00563         pObjectHdr = (QOS_OBJECT_HDR *) pQos->ProviderSpecific.buf;
00564
00565         // Make sure we have the right object
00566         if (RSVP_OBJECT_STATUS_INFO != pObjectHdr->ObjectType)
00567             continue;
00568
00569         pRsvpStatus = (RSVP_STATUS_INFO *)pObjectHdr;
00570
00571         // check to see if it is a path message and set it
00572         if (WSA_QOS_SENDERS != pRsvpStatus->StatusCode)
00573             continue;
00574
00575         pQos->ProviderSpecific.buf = NULL;
00576         pQos->ProviderSpecific.len = 0;
00577
00578
00579         // Do the SetQos
00580         cbQosLen = sizeof(QOS) + pQos->ProviderSpecific.len;
00581         dwBytes  = 0;
00582         nRet = WSAIoctl(pRecvInfo->sd[dwEvent],
00583                         SIO_SET_QOS, (LPVOID)pQos,
00584                         cbQosLen, NULL, 0,
00585                         &dwBytes, NULL, NULL);
00586
00587         if (SOCKET_ERROR == nRet)
00588             printf("WSAIoctl:SIO_SET_QOS %d\n", WSAGetLastError());
00589         else
00590           printf("    QOS set during FD_QOS\n");
00591
00592     }while (TRUE);
00593
00594     // check for end-to-end qos
00595     if (pOptions->qosOptions.bQosabilityIoctls)
00596     {
00597         DWORD outbuf;
00598         DWORD inbuf = END_TO_END_QOSABILITY;
00599
00600         dwBytes = 0;
00601         nRet = WSAIoctl(pRecvInfo->sd[dwEvent], SIO_CHK_QOS,
00602                         (LPVOID)&inbuf, sizeof(inbuf),
00603                         (LPVOID)&outbuf, sizeof(outbuf),
00604                         &dwBytes, NULL, NULL);
00605
00606         if (SOCKET_ERROR == nRet)
00607             printf("  SIO_CHK_QOS(END_TO_END_QOSABILITY) %d\n", WSAGetLastError());
00608         else
00609         {
00610             printf("  End-toEnd Qosability = ");
00611
00612             switch(outbuf)
00613             {
00614                 case INFO_NOT_AVAILABLE:
00615                     printf("INFO_NOT_AVAILABLE\n");
00616                     break;
00617                 case 1:
00618                     printf("Available\n");
00619                     break;
00620                 case 0:
00621                     printf("Not available\n");
00622                     break;
00623                 default:
00624                     _assume(0);
00625             }
00626         }
00627     }
00628
00629     return(FALSE);
00630 }
00631
00632
00633
00634
00635 // Abstract:
00636 //      FD_CLOSE handler.  When receiving FD_CLOSE, it is still possible for
00637 //      data to be queued up and therefore the socket should be drained of that
00638 //      data so as not to lose that data.  Winsock2 events are manual reset
00639 //      events and FD_CLOSE has no re-enabling function, therefore must reset
00640 //      the event here, otherwise we would get additional FD_CLOSE
00641 //      notifications.
00642 //
00643 static BOOL fd_close_func(
00644     DWORD               dwEvent,
00645     WSANETWORKEVENTS    *NetworkEvents,
00646     RECV_INFO           *pRecvInfo,
00647     OPTIONS             *pOptions
00648     )
00649 {
00650
00651     printf("  FD_CLOSE: dwEvent=%d error code =%d\n",
00652         dwEvent, NetworkEvents->iErrorCode[FD_CLOSE_BIT]);
00653
00654     if (NetworkEvents->iErrorCode[FD_CLOSE_BIT])
00655         return(TRUE);
00656
00657     // drain the socket
00658     printf("    Draining socket\n");
00659
00660     do
00661     {
00662         int nRecv = recv(pRecvInfo->sd[dwEvent], pOptions->buf, pOptions->nBufSize, 0);
00663
00664         printf("     recv: nRecv=%d", nRecv);
00665
00666         if (nRecv <= 0)
00667             break;
00668
00669         printf(" char=<%c>\n", *pOptions->buf);
00670     } while (TRUE);
00671
00672     printf("\n");
00673
00674     WSAResetEvent(pRecvInfo->hEvents[dwEvent]);
00675     closesocket(pRecvInfo->sd[dwEvent]);
00676     pRecvInfo->sd[dwEvent] = INVALID_SOCKET;
00677     pOptions->dwTotalClients--;
00678
00679     return(FALSE);
00680 }
00681
00682
00683
00684
00685 // Abstract:
00686 //      Function called by Winsock to accept or reject a connection.  If more
00687 //      than MAXCLIENTS attempt to connect the connection will be rejected
00688 //      (CF_REJECT) and the connection reset.  Please note that a connect (at
00689 //      the TCP level) can be successful even if the receiving application does
00690 //      not call WSAAccept (or accept).  The the effect of CF_REJECT is to
00691 //      reset an already established connection.
00692 //
00693 //      If lpSQos is supplied, then QOS must be set to valid values for Win98 -
00694 //      NT5 does not have this restriction.  On Windows2000 the contents of
00695 //      lpSQos will be QOS_NOT_SPECIFIED (even if PATH data has arrived prior
00696 //      to executing this function).  This behaviour is by design for the
00697 //      Microsoft GQOSSP.
00698 //
00699 int CALLBACK AcceptCondFunc(
00700     LPWSABUF    lpCallerId,
00701     LPWSABUF    lpCallerData,
00702     LPQOS       lpSQos,
00703     LPQOS       lpGQos,
00704     LPWSABUF    lpCalleeId,
00705     LPWSABUF    lpCalleeData,
00706     GROUP FAR   *Group,
00707     DWORD_PTR   CallbackData
00708     )
00709 {
00710     OPTIONS *pOptions;
00711
00712     UNREFERENCED_PARAMETER(Group);
00713     UNREFERENCED_PARAMETER(lpCalleeData);
00714     UNREFERENCED_PARAMETER(lpGQos);
00715     UNREFERENCED_PARAMETER(lpCallerData);
00716
00717     pOptions = (OPTIONS *)CallbackData;
00718
00719     printf("    AcceptCondFunc\n");
00720     if (lpCallerId)
00721     {
00722         // NOTE:  This program only supports TCP or UDP
00723         SOCKADDR_IN *sockaddr = (SOCKADDR_IN *)lpCallerId->buf;
00724         printf("      lpCallerId address family=%d, port=%d\n",
00725             sockaddr->sin_family, ntohs(sockaddr->sin_port));
00726     }
00727
00728     if (lpSQos)
00729     {
00730         printf("    AcceptCondFunc: lpSQos valid\n");
00731
00732         if (pOptions->spOptions.bQos)
00733             // bMustSetQosInAccept will not be set for Windows2000 but only for
00734             // Win98. Win98 currently requires valid QOS parameters to be set
00735             // here iff lpSQos is a valid pointer.
00736             if (    (QOS_IOCTL_SET_DURING == pOptions->qosOptions.qosIoctlSet)
00737                 ||  pOptions->qosOptions.bMustSetQosInAccept)
00738             {
00739                 DWORD cbQosLen;
00740                 printf("    AcceptCondFunc: filling in Qos\n");
00741
00742                 if (SetQos(g_sd, &pOptions->qosOptions,  FALSE, lpSQos, &cbQosLen))
00743                     PrintQos(lpSQos, "    ");
00744                 else
00745                     printf("    Failed to SetQos\n");
00746             }
00747     }
00748
00749     if (lpCalleeId)
00750     {
00751         // NOTE:  This program only supports TCP or UDP
00752         SOCKADDR_IN *sockaddr = (SOCKADDR_IN *)lpCalleeId->buf;
00753         printf("      lpCalleeId: address family=%d, port=%d\n",
00754                     sockaddr->sin_family, ntohs(sockaddr->sin_port));
00755     }
00756
00757     //
00758     // Determine where to accept or reject the new connection based
00759     // on the number of clients currently connected.
00760     if (MAXCLIENTS == pOptions->dwTotalClients)
00761     {
00762         printf("      Rejecting connection, limit of %d clients reached\n",
00763                     pOptions->dwTotalClients);
00764
00765         // At this point a connection will already have been established,
00766         // this will just cause the connection to be reset.
00767         return(CF_REJECT);
00768     }
00769
00770     pOptions->dwTotalClients++;
00771
00772     return(CF_ACCEPT);
00773 }
00774
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/GINA/GinaHook/GinaDlg.h Source File

  • Security
  • GINA
  • GinaHook

GinaDlg.h

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Module:   GinaDlg.h
00010
00011  Abstract: See ReadMe.txt for more detail information about this sample.
00012
00013  Revision: August 6, 1999.
00014
00015 ------------------------------------------------------------------------------*/
00016
00017 //
00018 // Function prototypes.
00019 //
00020 void HookWlxDialogBoxParam (PVOID pWinlogonFunctions, DWORD dwWlxVersion);
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CacheProxySamplePlugin::CacheProxyPlugin Member List

This is the complete list of members for CacheProxySamplePlugin::CacheProxyPlugin, including all inherited members.
AddCacheItem(string bstrOriginUrl, string bstrPrestuffUrl, int lExpiration, int lBandwidth, int lRemoteEventFlags, IWMSCacheProxyCallback pCallback, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
AddCDLToContext(IWMSContext pContentInfo, ContentInfo ci) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
AddForDownload(ContentInfo ci) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
AdminSettings | CacheProxySamplePlugin::CacheProxyPlugin | [private]
CacheProxyPlugin() | CacheProxySamplePlugin::CacheProxyPlugin | [inline]
CacheProxyServer | CacheProxySamplePlugin::CacheProxyPlugin | [private]
ClassObject | CacheProxySamplePlugin::CacheProxyPlugin | [private]
ConfigPath | CacheProxySamplePlugin::CacheProxyPlugin | [private]
CreateCacheItemCollection(out IWMSCacheItemCollection ppCacheItemCollection) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
CreateCacheTable() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
CreatePlaylistTable() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
CreateReverseProxyTable() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
DatabasePath | CacheProxySamplePlugin::CacheProxyPlugin | [private]
DisablePlugin() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
DS | CacheProxySamplePlugin::CacheProxyPlugin | [private]
EnablePlugin(ref int flags, ref int heartbeat) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
FindCacheItem(string bstrOriginUrl, out IWMSCacheItemDescriptor ppCacheItemDescriptor) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
FindProxyForURL(IWMSContext pUserContext, string bstrUrl, out string pbstrProxyServer, out uint pdwProxyPort) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
GetContentInfo(string OriginUrl, out ContentInfo ci) | CacheProxySamplePlugin::CacheProxyPlugin | [inline]
GetContentInfoContext(ContentInfo ci, out IWMSContext Context) | CacheProxySamplePlugin::CacheProxyPlugin | [inline]
GetContentInfoFromContext(IWMSContext pContentInfo, ref ContentInfo ci) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
GetCredentials(IWMSContext pUserContext, string bstrRealm, string bstrUrl, out string pbstrName, out string pbstrPassword) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
GetCustomAdminInterface() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
GetStringFromNSSBuffer(INSSBuffer NsBuffer) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private, static]
InitializePlugin(IWMSContext pServerContext, WMSNamedValues pNamedValues, IWMSClassObject pClassFactory) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
IsContentCached(string Url, out string ReturnURL, out IWMSContext Context, out int ContentType) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
IsDownloadInProgress(ContentInfo ci) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
LoadConfig() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
MyChangeEventHandler | CacheProxySamplePlugin::CacheProxyPlugin | [private]
OnCacheClientClose(int resultHr, IWMSContext pUserContext, IWMSContext pPresentationContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
OnCancelDownloadContent(int lHr, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
OnCompareContentInformation(int lHr, WMS_CACHE_VERSION_COMPARE_RESPONSE CompareResponse, IWMSContext pNewContentInfo, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
OnDownloadContentFinished(int lHr, object[] psaArchiveContexts, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
OnDownloadContentProgress(int lHr, WMS_RECORD_PROGRESS_OPCODE opCode, IWMSContext pArchiveContext, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
OnGetContentInformation(int lHr, IWMSContext pContentInfo, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
OnHeartbeat() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
PersistSettings(string strName, object objValue) | CacheProxySamplePlugin::CacheProxyPlugin | [inline]
QueryCache(string bstrOriginUrl, IWMSContext pUserContext, IWMSCommandContext pCommandContext, IWMSContext pPresentationContext, int lQueryType, IWMSCacheProxyCallback pCallback, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
QueryCacheMissPolicy(string bstrOriginUrl, IWMSContext pUserContext, IWMSCommandContext pCommandContext, IWMSContext pPresentationContext, object pCachePluginContext, int lQueryType, IWMSCacheProxyCallback pCallback, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
QuerySpaceForCacheItem(int lContentSizeLow, int lContentSizeHigh, out System.Boolean pvarfSpaceAvail) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
RegisterFunction(Type t) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, static]
RemoveAllCacheItems(IWMSCacheProxyCallback pCallback, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
RemoveCacheItem(string stringOriginUrl, IWMSCacheProxyCallback pCallback, object varContext) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
RemoveEntryFromDatabase(ContentInfo ci, bool bDeleteFile) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
RemoveEntryFromDatabase(string OriginUrl, bool bDeleteFile) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
SavePlaylist(ContentInfo ci) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
ShutdownPlugin() | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
strGuid | CacheProxySamplePlugin::CacheProxyPlugin | [private, static]
strPluginName | CacheProxySamplePlugin::CacheProxyPlugin | [private, static]
strSubKey1 | CacheProxySamplePlugin::CacheProxyPlugin | [private, static]
strSubKey2 | CacheProxySamplePlugin::CacheProxyPlugin | [private, static]
UnRegisterFunction(Type t) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, static]
UpdateTable(ContentInfo ci) | CacheProxySamplePlugin::CacheProxyPlugin | [inline, private]
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Field Member List

This is the complete list of members for msado15::Field, including all inherited members.
AppendChunk(Variant Data) | msado15::Field |
getActualSize() | msado15::Field |
getAttributes() | msado15::Field |
GetChunk(int Length) | msado15::Field |
getDataFormat() | msado15::Field |
getDefinedSize() | msado15::Field |
getName() | msado15::Field |
getNumericScale() | msado15::Field |
getOriginalValue() | msado15::Field |
getPrecision() | msado15::Field |
getProperties() | msado15::Field |
getType() | msado15::Field |
getUnderlyingValue() | msado15::Field |
getValue() | msado15::Field |
iid | msado15::Field | [static]
setAttributes(int pl) | msado15::Field |
setDataFormat(IUnknown ppiDF) | msado15::Field |
setDefinedSize(int pl) | msado15::Field |
setNumericScale(byte pbNumericScale) | msado15::Field |
setPrecision(byte pbPrecision) | msado15::Field |
setType(int pDataType) | msado15::Field |
setValue(Variant pvar) | msado15::Field |
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/asyncdemocomplete/AsyncDemo.cpp Source File

  • Web
  • winhttp
  • asyncdemocomplete

AsyncDemo.cpp

Go to the documentation of this file.
00001 /************************************************************
00002 *                                                           *
00003 * AsyncDemo.cpp                                             *
00004 *                                                           *
00005 * Copyright (c) Microsoft Corporation. All Rights Reserved. *
00006 *                                                           *
00007 ************************************************************/
00008
00009 #define UNICODE
00010 #include <windows.h>
00011 #include <winhttp.h>
00012 #include <stdio.h>
00013 #include "resource.h"
00014
00015 //********************************************************************
00016 //                                                  Global Variables
00017 //********************************************************************
00018
00019 // Context value structure.
00020 typedef struct {
00021     HWND        hWindow;        // Handle for the dialog box
00022     HINTERNET   hConnect;       // Connection handle
00023     HINTERNET   hRequest;       // Resource request handle
00024     int         nURL;           // ID of the URL edit box
00025     int         nHeader;        // ID of the header output box
00026     int         nResource;      // ID of the resource output box
00027     DWORD       dwSize;         // Size of the latest data block
00028     DWORD       dwTotalSize;    // Size of the total data
00029     LPSTR       lpBuffer;       // Buffer for storing read data
00030     WCHAR       szMemo[256];    // String providing state information
00031 } REQUEST_CONTEXT;
00032
00033
00034 // Two Instances of the context value structure.
00035 static REQUEST_CONTEXT rcContext1, rcContext2;
00036
00037 // Session handle.
00038 HINTERNET hSession;
00039
00040 CRITICAL_SECTION g_CallBackCritSec;
00041
00042 //********************************************************************
00043 //                                                    Error Messages
00044 //********************************************************************
00045
00046 // This macro returns the constant name in a string.
00047 #define CASE_OF(constant)   case constant: return (L# constant)
00048
00049 LPCWSTR GetApiErrorString(DWORD dwResult)
00050 {
00051     // Return the error result as a string so that the
00052     // name of the function causing the error can be displayed.
00053     switch(dwResult)
00054     {
00055         CASE_OF( API_RECEIVE_RESPONSE );
00056         CASE_OF( API_QUERY_DATA_AVAILABLE );
00057         CASE_OF( API_READ_DATA );
00058         CASE_OF( API_WRITE_DATA );
00059         CASE_OF( API_SEND_REQUEST );
00060     }
00061     return L"Unknown function";
00062
00063 }
00064
00065
00066 //********************************************************************
00067 //                                              Additional Functions
00068 //********************************************************************
00069
00070 void Cleanup (REQUEST_CONTEXT *cpContext)
00071 {
00072     // Set the memo to indicate a closed handle.
00073     swprintf(cpContext->szMemo, L"Closed");
00074
00075     if (cpContext->hRequest)
00076     {
00077         WinHttpSetStatusCallback(cpContext->hRequest,
00078                 NULL,
00079                 NULL,
00080                 NULL);
00081
00082         WinHttpCloseHandle(cpContext->hRequest);
00083     cpContext->hRequest = NULL;
00084     }
00085
00086     if (cpContext->hConnect)
00087     {
00088         WinHttpCloseHandle(cpContext->hConnect);
00089     cpContext->hConnect = NULL;
00090     }
00091
00092     delete [] cpContext->lpBuffer;
00093   cpContext->lpBuffer = NULL;
00094
00095     // note: this function can be called concurrently by differnet threads, therefore any global data
00096     // reference needs to be protected
00097
00098     EnterCriticalSection(&g_CallBackCritSec);
00099
00100     // If both handles are closed, re-enable the download button.
00101     if ((wcsncmp( rcContext1.szMemo, L"Closed",6)==0) &&
00102         (wcsncmp( rcContext2.szMemo, L"Closed",6)==0))
00103     {
00104         EnableWindow( GetDlgItem(cpContext->hWindow, IDC_DOWNLOAD),1);
00105     }
00106
00107     LeaveCriticalSection(&g_CallBackCritSec);
00108
00109 }
00110
00111 // Forward declaration.
00112 void __stdcall AsyncCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
00113
00114 BOOL SendRequest(REQUEST_CONTEXT *cpContext, LPWSTR szURL)
00115 {
00116     WCHAR szHost[256];
00117     DWORD dwOpenRequestFlag = 0;
00118     URL_COMPONENTS urlComp;
00119     BOOL fRet = FALSE;
00120
00121     // Initialize URL_COMPONENTS structure.
00122     ZeroMemory(&urlComp, sizeof(urlComp));
00123     urlComp.dwStructSize = sizeof(urlComp);
00124
00125     // Use allocated buffer to store the Host Name.
00126     urlComp.lpszHostName        = szHost;
00127     urlComp.dwHostNameLength    = sizeof(szHost) / sizeof(szHost[0]);
00128
00129     // Set non zero lengths to obtain pointer to the URL Path.
00130     /* note: if we threat this pointer as a NULL terminated string
00131             this pointer will contain Extra Info as well. */
00132     urlComp.dwUrlPathLength = -1;
00133
00134     // Crack HTTP scheme.
00135     urlComp.dwSchemeLength = -1;
00136
00137     // Set the szMemo string.
00138     swprintf( cpContext->szMemo, L"WinHttpCrackURL (%d)", cpContext->nURL);
00139
00140     // Crack the URL.
00141     if (!WinHttpCrackUrl(szURL, 0, 0, &urlComp))
00142     {
00143         goto cleanup;
00144     }
00145
00146     // Set the szMemo string.
00147     swprintf( cpContext->szMemo, L"WinHttpConnect (%d)", cpContext->nURL);
00148
00149     // Open an HTTP session.
00150     cpContext->hConnect = WinHttpConnect(hSession, szHost,
00151                                     urlComp.nPort, 0);
00152     if (NULL == cpContext->hConnect)
00153     {
00154         goto cleanup;
00155     }
00156
00157     // Prepare OpenRequest flag
00158     dwOpenRequestFlag = (INTERNET_SCHEME_HTTPS == urlComp.nScheme) ?
00159                             WINHTTP_FLAG_SECURE : 0;
00160
00161     // Set the szMemo string.
00162     swprintf( cpContext->szMemo, L"WinHttpOpenRequest (%d)", cpContext->nURL);
00163
00164     // Open a "GET" request.
00165     cpContext->hRequest = WinHttpOpenRequest(cpContext->hConnect,
00166                                         L"GET", urlComp.lpszUrlPath,
00167                                         NULL, WINHTTP_NO_REFERER,
00168                                         WINHTTP_DEFAULT_ACCEPT_TYPES,
00169                                         dwOpenRequestFlag);
00170
00171     if (cpContext->hRequest == 0)
00172     {
00173         goto cleanup;
00174     }
00175
00176     // Set the szMemo string.
00177     swprintf( cpContext->szMemo, L"WinHttpSetStatusCallback (%d)", cpContext->nURL);
00178
00179     // Install the status callback function.
00180     WINHTTP_STATUS_CALLBACK pCallback = WinHttpSetStatusCallback(cpContext->hRequest,
00181                             (WINHTTP_STATUS_CALLBACK)AsyncCallback,
00182                             WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS |
00183                             WINHTTP_CALLBACK_FLAG_REDIRECT,
00184                             NULL);
00185
00186     // note: On success WinHttpSetStatusCallback returns the previously defined callback function.
00187     // Here it should be NULL
00188     if (pCallback != NULL)
00189     {
00190         goto cleanup;
00191     }
00192
00193     // Set the szMemo string.
00194     swprintf( cpContext->szMemo, L"WinHttpSendRequest (%d)", cpContext->nURL);
00195
00196     // Send the request.
00197     if (!WinHttpSendRequest(cpContext->hRequest,
00198                         WINHTTP_NO_ADDITIONAL_HEADERS, 0,
00199                         WINHTTP_NO_REQUEST_DATA, 0, 0,
00200                         (DWORD_PTR)cpContext))
00201     {
00202         goto cleanup;
00203     }
00204
00205     fRet = TRUE;
00206
00207 cleanup:
00208
00209     if (fRet == FALSE)
00210     {
00211         WCHAR szError[256];
00212
00213         // Set the error message.
00214         swprintf(szError, L"%s failed with error %d", cpContext->szMemo, GetLastError());
00215
00216         // Cleanup handles.
00217         Cleanup(cpContext);
00218
00219         // Display the error message.
00220         SetDlgItemText(cpContext->hWindow, cpContext->nResource, szError);
00221
00222     }
00223
00224     return fRet;
00225 }
00226
00227 BOOL Header(REQUEST_CONTEXT *cpContext)
00228 {
00229     DWORD dwSize=0;
00230     LPVOID lpOutBuffer = NULL;
00231
00232     // Set the state memo.
00233     swprintf(cpContext->szMemo, L"WinHttpQueryHeaders (%d)", cpContext->nURL);
00234
00235     // Use HttpQueryInfo to obtain the size of the buffer.
00236     if (!WinHttpQueryHeaders( cpContext->hRequest,
00237                               WINHTTP_QUERY_RAW_HEADERS_CRLF,
00238                               WINHTTP_HEADER_NAME_BY_INDEX, NULL, &dwSize, WINHTTP_NO_HEADER_INDEX))
00239     {
00240         // An ERROR_INSUFFICIENT_BUFFER is expected because you
00241         // are looking for the size of the headers.  If any other
00242         // error is encountered, display error information.
00243         DWORD dwErr = GetLastError();
00244         if (dwErr != ERROR_INSUFFICIENT_BUFFER)
00245         {
00246             WCHAR  szError[256];
00247             swprintf( szError, L"%s: Error %d encountered.",
00248                       cpContext->szMemo, dwErr);
00249             SetDlgItemText( cpContext->hWindow, cpContext->nResource, szError);
00250             return FALSE;
00251         }
00252     }
00253
00254     // Allocate memory for the buffer.
00255     lpOutBuffer = new WCHAR[dwSize];
00256
00257     // Use HttpQueryInfo to obtain the header buffer.
00258     if(WinHttpQueryHeaders( cpContext->hRequest,
00259                             WINHTTP_QUERY_RAW_HEADERS_CRLF,
00260                             WINHTTP_HEADER_NAME_BY_INDEX, lpOutBuffer, &dwSize, WINHTTP_NO_HEADER_INDEX))
00261         SetDlgItemText( cpContext->hWindow, cpContext->nHeader,
00262                         (LPWSTR)lpOutBuffer);
00263
00264     // Free the allocated memory.
00265     delete [] lpOutBuffer;
00266
00267     return TRUE;
00268 }
00269
00270
00271 BOOL QueryData(REQUEST_CONTEXT *cpContext)
00272 {
00273     // Set the state memo.
00274     swprintf( cpContext->szMemo, L"WinHttpQueryDataAvailable (%d)",
00275               cpContext->nURL);
00276
00277     // Chech for available data.
00278     if (WinHttpQueryDataAvailable(cpContext->hRequest, NULL) == FALSE)
00279     {
00280         // If a synchronous error occured, display the error.  Otherwise
00281         // the query is successful or asynchronous.
00282         DWORD dwErr = GetLastError();
00283         WCHAR  szError[256];
00284         swprintf( szError, L"%s: Error %d encountered.",
00285                   cpContext->szMemo, dwErr);
00286         SetDlgItemText( cpContext->hWindow, cpContext->nResource, szError);
00287         return FALSE;
00288     }
00289     return TRUE;
00290 }
00291
00292
00293 void TransferAndDeleteBuffers(REQUEST_CONTEXT *cpContext, LPSTR lpReadBuffer, DWORD dwBytesRead)
00294 {
00295     cpContext->dwSize = dwBytesRead;
00296
00297     if(!cpContext->lpBuffer)
00298     {
00299         // If there is no context buffer, start one with the read data.
00300         cpContext->lpBuffer = lpReadBuffer;
00301     }
00302     else
00303     {
00304         // Store the previous buffer, and create a new one big
00305         // enough to hold the old data and the new data.
00306         LPSTR lpOldBuffer = cpContext->lpBuffer;
00307         cpContext->lpBuffer = new char[cpContext->dwTotalSize + cpContext->dwSize];
00308
00309         // Copy the old and read buffer into the new context buffer.
00310         memcpy(cpContext->lpBuffer, lpOldBuffer, cpContext->dwTotalSize);
00311         memcpy(cpContext->lpBuffer + cpContext->dwTotalSize, lpReadBuffer, cpContext->dwSize);
00312
00313         // Free the memory allocated to the old and read buffers.
00314         delete [] lpOldBuffer;
00315         delete [] lpReadBuffer;
00316     }
00317
00318     // Keep track of the total size.
00319     cpContext->dwTotalSize += cpContext->dwSize;
00320 }
00321
00322
00323 BOOL ReadData(REQUEST_CONTEXT *cpContext)
00324 {
00325     LPSTR lpOutBuffer = new char[cpContext->dwSize+1];
00326     ZeroMemory(lpOutBuffer, cpContext->dwSize+1);
00327
00328     // Set the state memo.
00329     swprintf( cpContext->szMemo, L"WinHttpReadData (%d)",
00330               cpContext->nURL);
00331
00332     // Read the available data.
00333     if (WinHttpReadData( cpContext->hRequest, (LPVOID)lpOutBuffer,
00334                           cpContext->dwSize, NULL) == FALSE)
00335     {
00336         // If a synchronous error occurred, display the error.  Otherwise
00337         // the read is successful or asynchronous.
00338         DWORD dwErr = GetLastError();
00339         WCHAR  szError[256];
00340         swprintf( szError, L"%s: Error %d encountered.",
00341                   cpContext->szMemo, dwErr);
00342         SetDlgItemText( cpContext->hWindow, cpContext->nResource, szError);
00343         delete [] lpOutBuffer;
00344         return FALSE;
00345     }
00346
00347     return TRUE;
00348 }
00349
00350
00351 //********************************************************************
00352 //                                                   Status Callback
00353 //********************************************************************
00354
00355 void __stdcall AsyncCallback( HINTERNET hInternet, DWORD_PTR dwContext,
00356                               DWORD dwInternetStatus,
00357                               LPVOID lpvStatusInformation,
00358                               DWORD dwStatusInformationLength)
00359 {
00360     REQUEST_CONTEXT *cpContext;
00361     WCHAR szBuffer[256];
00362     cpContext = (REQUEST_CONTEXT*)dwContext;
00363     WINHTTP_ASYNC_RESULT *pAR;
00364
00365     if (cpContext == NULL)
00366     {
00367         // this should not happen, but we are being defensive here
00368         return;
00369     }
00370
00371     szBuffer[0] = 0;
00372
00373     // Create a string that reflects the status flag.
00374     switch (dwInternetStatus)
00375     {
00376         case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE:
00377             swprintf(szBuffer,L"%s: SENDREQUEST_COMPLETE (%d)",
00378                 cpContext->szMemo, dwStatusInformationLength);
00379
00380             // Prepare the request handle to receive a response.
00381             if (WinHttpReceiveResponse( cpContext->hRequest, NULL) == FALSE)
00382             {
00383                 Cleanup(cpContext);
00384             }
00385             break;
00386         case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE:
00387             swprintf(szBuffer,L"%s: HEADERS_AVAILABLE (%d)",
00388                 cpContext->szMemo, dwStatusInformationLength);
00389             Header( cpContext);
00390
00391             // Initialize the buffer sizes.
00392             cpContext->dwSize = 0;
00393             cpContext->dwTotalSize = 0;
00394
00395             // Begin downloading the resource.
00396             if (QueryData( cpContext ) == FALSE)
00397             {
00398                 Cleanup(cpContext);
00399             }
00400             break;
00401         case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE:
00402             swprintf(szBuffer,L"%s: DATA_AVAILABLE (%d)",
00403                 cpContext->szMemo, dwStatusInformationLength);
00404
00405             cpContext->dwSize = *((LPDWORD)lpvStatusInformation);
00406
00407             // If there is no data, the process is complete.
00408             if (cpContext->dwSize == 0)
00409             {
00410                 // All of the data has been read.  Display the data.
00411                 if (cpContext->dwTotalSize)
00412                 {
00413                     // Convert the final context buffer to wide characters,
00414                     // and display.
00415                     LPWSTR lpWideBuffer = new WCHAR[cpContext->dwTotalSize + 1];
00416                     MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED,
00417                                          cpContext->lpBuffer,
00418                                          cpContext->dwTotalSize,
00419                                          lpWideBuffer,
00420                                          cpContext->dwTotalSize);
00421                     lpWideBuffer[cpContext->dwTotalSize] = 0;
00422                     /* note: in the case of binary data, only data upto the first null will be displayed */
00423                     SetDlgItemText( cpContext->hWindow, cpContext->nResource,
00424                                     lpWideBuffer);
00425
00426                     // Delete the remaining data buffers.
00427                     delete [] lpWideBuffer;
00428                     delete [] cpContext->lpBuffer;
00429                     cpContext->lpBuffer = NULL;
00430                 }
00431
00432                 // Close the request and connect handles for this context.
00433                 Cleanup(cpContext);
00434
00435             }
00436             else
00437                 // Otherwise, read the next block of data.
00438                 if (ReadData( cpContext ) == FALSE)
00439                 {
00440                     Cleanup(cpContext);
00441                 }
00442             break;
00443         case WINHTTP_CALLBACK_STATUS_READ_COMPLETE:
00444             swprintf(szBuffer,L"%s: READ_COMPLETE (%d)",
00445                 cpContext->szMemo, dwStatusInformationLength);
00446
00447             // Copy the data and delete the buffers.
00448
00449             if (dwStatusInformationLength != 0)
00450             {
00451                 TransferAndDeleteBuffers(cpContext, (LPSTR) lpvStatusInformation, dwStatusInformationLength);
00452
00453                 // Check for more data.
00454                 if (QueryData(cpContext) == FALSE)
00455                 {
00456                     Cleanup(cpContext);
00457                 }
00458             }
00459             break;
00460         case WINHTTP_CALLBACK_STATUS_REDIRECT:
00461             swprintf(szBuffer,L"%s: REDIRECT (%d)",
00462                 cpContext->szMemo, dwStatusInformationLength);
00463             break;
00464         case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR:
00465             pAR = (WINHTTP_ASYNC_RESULT *)lpvStatusInformation;
00466             swprintf( szBuffer,L"%s: REQUEST_ERROR - error %d, result %s",
00467                       cpContext->szMemo, pAR->dwError,
00468                       GetApiErrorString(pAR->dwResult));
00469
00470             Cleanup(cpContext);
00471             break;
00472         default:
00473             swprintf(szBuffer,L"%s: Unknown/unhandled callback - status %d given",
00474                 cpContext->szMemo, dwInternetStatus);
00475             break;
00476     }
00477
00478     // Add the callback information to the listbox.
00479     SendDlgItemMessage( cpContext->hWindow, IDC_CBLIST, LB_ADDSTRING, 0,
00480                         (LPARAM)szBuffer);
00481
00482 }
00483
00484
00485 //********************************************************************
00486 //                                                   Dialog Function
00487 //********************************************************************
00488
00489 BOOL CALLBACK AsyncDialog( HWND hX, UINT message, WPARAM wParam, LPARAM lParam)
00490 {
00491     switch(message)
00492     {
00493     case WM_INITDIALOG:
00494         // Set the default web sites.
00495         SetDlgItemText(hX, IDC_URL1, L"http://www.microsoft.com");
00496         SetDlgItemText(hX, IDC_URL2, L"http://www.msn.com");
00497
00498         // Initialize the first context value.
00499         rcContext1.hWindow = hX;
00500         rcContext1.nURL = IDC_URL1;
00501         rcContext1.nHeader = IDC_HEADER1;
00502         rcContext1.nResource = IDC_RESOURCE1;
00503         rcContext1.hConnect = 0;
00504         rcContext1.hRequest = 0;
00505         rcContext1.lpBuffer = NULL;
00506         rcContext1.szMemo[0] = 0;
00507
00508         // Initialize the second context value.
00509         rcContext2.hWindow = hX;
00510         rcContext2.nURL = IDC_URL2;
00511         rcContext2.nHeader = IDC_HEADER2;
00512         rcContext2.nResource = IDC_RESOURCE2;
00513         rcContext2.hConnect = 0;
00514         rcContext2.hRequest = 0;
00515         rcContext2.lpBuffer = NULL;
00516         rcContext2.szMemo[0] = 0;
00517
00518         return TRUE;
00519   case WM_CLOSE:
00520         EndDialog(hX,0);
00521     return TRUE;
00522     case WM_COMMAND:
00523         switch(LOWORD(wParam))
00524         {
00525             case IDC_EXIT:
00526                 EndDialog(hX,0);
00527                 return TRUE;
00528             case IDC_DOWNLOAD:
00529                 WCHAR szURL[256];
00530
00531                 // Disable the download button.
00532                 EnableWindow( GetDlgItem(hX, IDC_DOWNLOAD), 0);
00533
00534                 // Reset the edit boxes.
00535                 SetDlgItemText( hX, IDC_HEADER1, NULL );
00536                 SetDlgItemText( hX, IDC_HEADER2, NULL );
00537                 SetDlgItemText( hX, IDC_RESOURCE1, NULL );
00538                 SetDlgItemText( hX, IDC_RESOURCE2, NULL );
00539
00540                 // Obtain the URLs from the dialog box and send the requests.
00541                 GetDlgItemText( hX, IDC_URL1, szURL, 256);
00542                 BOOL fRequest1 = SendRequest(&rcContext1, szURL);
00543
00544                 GetDlgItemText( hX, IDC_URL2, szURL, 256);
00545                 BOOL fRequest2 = SendRequest(&rcContext2, szURL);
00546
00547                 if (!fRequest1 && !fRequest2)
00548                 {
00549                     // Enable the download button if both requests are failing.
00550                     EnableWindow( GetDlgItem(hX, IDC_DOWNLOAD), TRUE);
00551                 }
00552
00553                 return (fRequest1 && fRequest2);
00554         }
00555     default:
00556         return FALSE;
00557     }
00558 }
00559
00560
00561 //********************************************************************
00562 //                                                      Main Program
00563 //********************************************************************
00564
00565 int WINAPI WinMain( HINSTANCE hThisInst, HINSTANCE hPrevInst,
00566                     LPSTR lpszArgs, int nWinMode)
00567 {
00568     // Create the session handle using the default settings.
00569     hSession = WinHttpOpen( L"Asynchronous WinHTTP Demo/1.0",
00570                             WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
00571                             WINHTTP_NO_PROXY_NAME,
00572                             WINHTTP_NO_PROXY_BYPASS,
00573                             WINHTTP_FLAG_ASYNC);
00574
00575     // Check to see if the session handle was successfully created.
00576     if(hSession != NULL)
00577     {
00578         InitializeCriticalSection(&g_CallBackCritSec);
00579
00580         // Show the dialog box.
00581         DialogBox( hThisInst, MAKEINTRESOURCE(IDD_DIALOG1),
00582                    HWND_DESKTOP, (DLGPROC)AsyncDialog );
00583
00584         DeleteCriticalSection(&g_CallBackCritSec);
00585
00586         // Close the session handle.
00587         WinHttpCloseHandle(hSession);
00588
00589     }
00590
00591     return 0;
00592 }
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TEXTBUTTON_STRUCT Member List

This is the complete list of members for TEXTBUTTON_STRUCT, including all inherited members.
hWndButton | TEXTBUTTON_STRUCT
idButton | TEXTBUTTON_STRUCT
lpButtonText | TEXTBUTTON_STRUCT
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ADORecordsetConstructionVtbl Member List

This is the complete list of members for ADORecordsetConstructionVtbl, including all inherited members.
cNames | ADORecordsetConstructionVtbl
dispIdMember | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Rowset)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Rowset)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Chapter)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Chapter)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_RowPosition)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_RowPosition)(ADORecordsetConstruction __RPC_FAR *This | ADORecordsetConstructionVtbl
iTInfo | ADORecordsetConstructionVtbl
lChapter | ADORecordsetConstructionVtbl
lcid | ADORecordsetConstructionVtbl
lcid | ADORecordsetConstructionVtbl
lcid | ADORecordsetConstructionVtbl
pctinfo | ADORecordsetConstructionVtbl
pDispParams | ADORecordsetConstructionVtbl
pExcepInfo | ADORecordsetConstructionVtbl
plChapter | ADORecordsetConstructionVtbl
ppRowPos | ADORecordsetConstructionVtbl
ppRowset | ADORecordsetConstructionVtbl
ppTInfo | ADORecordsetConstructionVtbl
ppvObject | ADORecordsetConstructionVtbl
pRowPos | ADORecordsetConstructionVtbl
pRowset | ADORecordsetConstructionVtbl
puArgErr | ADORecordsetConstructionVtbl
pVarResult | ADORecordsetConstructionVtbl
rgDispId | ADORecordsetConstructionVtbl
rgszNames | ADORecordsetConstructionVtbl
riid | ADORecordsetConstructionVtbl
riid | ADORecordsetConstructionVtbl
riid | ADORecordsetConstructionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ADORecordsetConstruction __RPC_FAR *This) | ADORecordsetConstructionVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ADORecordsetConstruction __RPC_FAR *This) | ADORecordsetConstructionVtbl
wFlags | ADORecordsetConstructionVtbl
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/SyncWrite/openf.h Source File

  • Web
  • iis
  • extensions
  • io
  • SyncWrite

openf.h

Go to the documentation of this file.
00001 /* Copyright(c) 1995-2002 Microsoft Corporation
00002
00003   Module Name:
00004
00005     openf.h
00006
00007   Abstract:
00008
00009     This module defines functions for opening and closing files
00010     and provides transparent caching for file handles
00011 */
00012
00013 # ifndef _OPENF_HXX_
00014 # define _OPENF_HXX_
00015
00016 # include <windows.h>
00017 # include <httpext.h>
00018
00019 #define InitializeListHead(ListHead) (\
00020     (ListHead)->Flink = (ListHead)->Blink = (ListHead))
00021
00022 #define IsListEmpty(ListHead) \
00023     ((ListHead)->Flink == (ListHead))
00024
00025 #define RemoveHeadList(ListHead) \
00026     (ListHead)->Flink;\
00027     {RemoveEntryList((ListHead)->Flink)}
00028
00029 #define RemoveTailList(ListHead) \
00030     (ListHead)->Blink;\
00031     {RemoveEntryList((ListHead)->Blink)}
00032
00033 #define RemoveEntryList(Entry) {\
00034     PLIST_ENTRY _EX_Blink;\
00035     PLIST_ENTRY _EX_Flink;\
00036     _EX_Flink = (Entry)->Flink;\
00037     _EX_Blink = (Entry)->Blink;\
00038     _EX_Blink->Flink = _EX_Flink;\
00039     _EX_Flink->Blink = _EX_Blink;\
00040                             }
00041
00042 #define InsertTailList(ListHead,Entry) {\
00043     PLIST_ENTRY _EX_Blink;\
00044     PLIST_ENTRY _EX_ListHead;\
00045     _EX_ListHead = (ListHead);\
00046     _EX_Blink = _EX_ListHead->Blink;\
00047     (Entry)->Flink = _EX_ListHead;\
00048     (Entry)->Blink = _EX_Blink;\
00049     _EX_Blink->Flink = (Entry);\
00050     _EX_ListHead->Blink = (Entry);\
00051                                     }
00052 #define InsertHeadList(ListHead,Entry) {\
00053     PLIST_ENTRY _EX_Flink;\
00054     PLIST_ENTRY _EX_ListHead;\
00055     _EX_ListHead = (ListHead);\
00056     _EX_Flink = _EX_ListHead->Flink;\
00057     (Entry)->Flink = _EX_Flink;\
00058     (Entry)->Blink = _EX_ListHead;\
00059     _EX_Flink->Blink = (Entry);\
00060     _EX_ListHead->Flink = (Entry);\
00061                                     }
00062 /* Initialization and cleanup functions */
00063
00064 DWORD CleanupFileHandleCache(VOID);
00065 HANDLE FcOpenFile(IN EXTENSION_CONTROL_BLOCK *pecb, IN LPCSTR pszFile);
00066 DWORD FcCloseFile(IN HANDLE hFile);
00067 BOOL FcReadFromFile(IN HANDLE hFile, OUT CHAR *pchBuffer, IN  DWORD dwBufferSize, OUT LPDWORD pcbRead, IN OUT LPOVERLAPPED pov);
00068 VOID InitFileHandleCache(VOID);
00069
00070 # endif
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_DSA_SEC_PAGE_INFO Member List

This is the complete list of members for _DSA_SEC_PAGE_INFO, including all inherited members.
dsObjectNames | _DSA_SEC_PAGE_INFO
hwndParentSheet | _DSA_SEC_PAGE_INFO
offsetTitle | _DSA_SEC_PAGE_INFO
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Register/register.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • Register

register.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      REGISTER.H
00003
00004   Summary:   Include file for the REGISTER.EXE utility application.
00005              REGISTER.H contains definitions of the application's string
00006              resource IDs.
00007
00008              For a comprehensive tutorial code tour of REGISTER's
00009              contents and offerings see the tutorial REGISTER.HTM file.
00010              For more specific technical details on the internal workings
00011              see the comments dispersed throughout the REGISTER source code.
00012
00013   Classes:   .
00014
00015   Functions: WinMain
00016
00017   Origin:    9-15-95: atrent - Created based on the EXESKEL code sample.
00018
00019 ----------------------------------------------------------------------------
00020   This file is part of the Microsoft COM Tutorial Code Samples.
00021
00022   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00023
00024   This source code is only intended as a supplement to Microsoft
00025   Development Tools and/or on-line documentation.  See these other
00026   materials for detailed information regarding Microsoft code samples.
00027
00028   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00029   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00030   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00031   PARTICULAR PURPOSE.
00032 ==========================================================================+*/
00033
00034 #if !defined(REGISTER_H)
00035 #define REGISTER_H
00036
00037 #define MAX_STRING 128
00038
00039 // Error-related String Identifiers.
00040 #define IDS_COMINITFAILED           2000
00041 #define IDS_OUTOFMEMORY             2001
00042 #define IDS_DLLUNREG_FAIL           2002
00043 #define IDS_DLLREG_FAIL             2003
00044 #define IDS_LOADLIB_FAIL            2004
00045 #define IDS_EXERUN_FAIL             2005
00046
00047 #define IDS_ASSERT_FAIL             2200
00048
00049 // Notice-related Identifiers.
00050 #define IDS_NOTIMPLEMENTED          2301
00051 #define IDD_SUCCESS_MSG             2350
00052
00053 #define IDS_ERROR_TITLE             2400
00054
00055 #endif
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CExtractIcon Member List

This is the complete list of members for CExtractIcon, including all inherited members.
CExtractIcon(LPCITEMIDLIST) | CExtractIcon |
Extract(LPCTSTR, UINT, HICON *, HICON *, UINT) | CExtractIcon |
GetIconLocation(UINT, LPTSTR, UINT, LPINT, LPUINT) | CExtractIcon |
m_ObjRefCount | CExtractIcon | [private]
m_pidl | CExtractIcon | [private]
m_pPidlMgr | CExtractIcon | [private]
QueryInterface(REFIID riid, LPVOID *ppvObj) | CExtractIcon |
STDMETHOD_(ULONG, AddRef)(VOID) | CExtractIcon |
STDMETHOD_(ULONG, Release)(VOID) | CExtractIcon |
~CExtractIcon() | CExtractIcon |
Generated on Wed Nov 13 2024 16:56:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/land.h Source File

  • SysMgmt
  • MMC
  • Nodes

land.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _LAND_H
00021 #define _LAND_H
00022
00023 #include "DeleBase.h"
00024
00025 class CLandBasedVehicle : public CDelegationBase {
00026 public:
00027     CLandBasedVehicle() { }
00028
00029     virtual ~CLandBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Land-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_LANDICON; }
00034
00035 private:
00036     enum { IDM_NEW_LAND = 2 };
00037
00038     // {2974380E-4C4B-11d2-89D8-000021473128}
00039     static const GUID thisGuid;
00040 };
00041
00042
00043 #endif // _LAND_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello2/Hello2.h Source File

  • Web
  • MSAgent
  • c
  • Hello2

Hello2.h

Go to the documentation of this file.
00001 #ifndef _HelloAgent2_h_
00002 #define _HelloAgent2_h_
00003
00004
00005 #ifndef STRICT
00006 #define STRICT
00007 #endif
00008
00009
00010 #include <windows.h>
00011 #include <tchar.h>
00012 #include "AgtSvr.h"
00013
00014
00015 #endif
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello3/Hello3.Cpp Source File

  • Web
  • MSAgent
  • c
  • Hello3

Hello3.Cpp

Go to the documentation of this file.
00001 #include "Hello3.h"
00002 #include "AgtSvr_i.c"
00003 #include "Notify.h"
00004 #include <malloc.h>
00005
00006
00007 //==========================================================================
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //--------------------------------------------------------------------------
00017 //
00018 // This sample demonstrates loading 2 characters and synchronizing
00019 // their actions.
00020 //
00021 //==========================================================================
00022
00023
00024 // Constant character filenames. Agent 2.0 will look in the %msagent%\chars
00025 // directory for these files.
00026
00027 static const LPWSTR kpwzGenie = L"genie.acs";
00028 static const LPWSTR kpwzMerlin = L"merlin.acs";
00029
00030 // Common version 1.5 path for characters
00031
00032 static const LPWSTR kpwzOldPath = L"\\Program Files\\Microsoft Agent\\characters\\";
00033
00034 // App Title
00035
00036 static const LPTSTR kpszAppTitle = _T("Microsoft Agent Samples");
00037
00038 // Globals
00039
00040 extern long g_lDone = 0;
00041
00042
00043 HRESULT LoadCharacter(IAgentEx *pAgentEx,
00044             LPWSTR pwzFilename,
00045             long *plCharacterID,
00046             IAgentCharacterEx **ppCharacterEx) {
00047
00048   VARIANT vPath;
00049   HRESULT hRes;
00050   long  lRequestID;
00051   LPWSTR  pwzPath;
00052
00053   // Create a VARIANT for the filename/path
00054
00055   VariantInit(&vPath);
00056   vPath.vt = VT_BSTR;
00057   vPath.bstrVal = SysAllocString(pwzFilename);
00058
00059   if (vPath.bstrVal == NULL)
00060     return E_OUTOFMEMORY;
00061
00062   // Load the character using it's filename only. NOTE: Agent 2.0
00063   // will look in the %msagent%\chars directory for these files.
00064
00065   hRes = pAgentEx->Load(vPath, plCharacterID, &lRequestID);
00066
00067   VariantClear(&vPath);
00068
00069   // Did we load it successfully?
00070
00071   if (FAILED(hRes)) {
00072
00073     // Try to load the character from the directory used
00074     // in most version 1.5 applications.
00075
00076     // First, allocate a buffer on the stack for the full pathname.
00077     // NOTE: _alloca does NOT return NULL on failure. It raises an
00078     // exception so be sure to wrap this in a try/catch or __try/__except
00079     // block.
00080
00081     __try {
00082
00083       pwzPath = (LPWSTR)_alloca((wcslen(kpwzOldPath) + wcslen(pwzFilename) + 1) * sizeof(WCHAR));
00084
00085     }
00086     __except(EXCEPTION_EXECUTE_HANDLER) {
00087
00088       return E_OUTOFMEMORY;
00089     }
00090
00091     // Build the pathname
00092
00093     wcscpy(pwzPath, kpwzOldPath);
00094     wcscat(pwzPath, pwzFilename);
00095
00096     vPath.vt = VT_BSTR;
00097     vPath.bstrVal = SysAllocString(pwzPath);
00098
00099     if (vPath.bstrVal == NULL)
00100       return E_OUTOFMEMORY;
00101
00102     // Try to load the character from the common 1.5 path
00103
00104     hRes = pAgentEx->Load(vPath, plCharacterID, &lRequestID);
00105
00106     VariantClear(&vPath);
00107
00108     // Did we load it?
00109
00110     if (FAILED(hRes))
00111       return hRes;
00112   }
00113
00114   // Get the IAgentCharacterEx interface
00115
00116   return pAgentEx->GetCharacterEx(*plCharacterID, ppCharacterEx);
00117 }
00118
00119
00120 extern "C" int PASCAL WinMain(HINSTANCE hInst,
00121                 HINSTANCE hInstPrev,
00122                 LPSTR lpCmdLine,
00123                 int nCmdShow) {
00124
00125   HRESULT       hRes;
00126   _TCHAR        szError[256];
00127   BSTR        bszSpeak;
00128   MSG         msg;
00129   long        lGenieID;
00130   long        lMerlinID;
00131   long        lRequestID;
00132   long        lWaitID;
00133   long        lNotifySinkID = -1;
00134   IAgentEx       *pAgentEx;
00135   IAgentCharacterEx  *pGenie = NULL;
00136   IAgentCharacterEx  *pMerlin = NULL;
00137   AgentNotifySink    *pSink = NULL;
00138
00139   // Initialize COM
00140
00141     if (FAILED(CoInitialize(NULL))) {
00142     MessageBox(NULL,
00143            _T("There was an error initializing COM."),
00144            kpszAppTitle,
00145            MB_OK | MB_ICONERROR);
00146         return -1;
00147   }
00148
00149   // Create an instance of the Agent 2.0 server. NOTE: by
00150   // asking for an IAgentEx interface we know we will get
00151   // at least Agent 2.0. The CLSID also changed between
00152   // 1.5 and 2.0 so we know we won't get the 1.5 server.
00153
00154   hRes = CoCreateInstance(CLSID_AgentServer,
00155               NULL,
00156               CLSCTX_SERVER,
00157               IID_IAgentEx,
00158               (LPVOID *)&pAgentEx);
00159   if (FAILED(hRes)) {
00160
00161     wsprintf(szError, _T("There was an error initializing Microsoft Agent, code = 0x%x"), hRes);
00162
00163     MessageBox(NULL,
00164            szError,
00165            kpszAppTitle,
00166            MB_OK | MB_ICONERROR);
00167
00168     CoUninitialize();
00169
00170     return -1;
00171   }
00172
00173   __try {
00174
00175     // Create a notify sink
00176
00177     pSink = new AgentNotifySink;
00178
00179     if (pSink == NULL) {
00180       hRes = E_OUTOFMEMORY;
00181       __leave;
00182     }
00183
00184     // AddRef it
00185
00186     pSink->AddRef();
00187
00188     // And register it with Microsoft Agent
00189
00190     hRes = pAgentEx->Register((IUnknown *)pSink, &lNotifySinkID);
00191
00192     if (FAILED(hRes))
00193       __leave;
00194
00195     // Load Genie
00196
00197     hRes = LoadCharacter(pAgentEx, kpwzGenie, &lGenieID, &pGenie);
00198
00199     if (FAILED(hRes))
00200       __leave;
00201
00202     // And Merlin
00203
00204     hRes = LoadCharacter(pAgentEx, kpwzMerlin, &lMerlinID, &pMerlin);
00205
00206     if (FAILED(hRes))
00207       __leave;
00208
00209     // Set their language ids
00210
00211     hRes = pGenie->SetLanguageID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
00212
00213     if (FAILED(hRes))
00214       __leave;
00215
00216     hRes = pMerlin->SetLanguageID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
00217
00218     if (FAILED(hRes))
00219       __leave;
00220
00221     // Position them
00222
00223     hRes = pGenie->MoveTo(0, 100, 0, &lRequestID);
00224
00225     if (FAILED(hRes))
00226       __leave;
00227
00228     hRes = pMerlin->MoveTo(200, 100, 0, &lRequestID);
00229
00230     if (FAILED(hRes))
00231       __leave;
00232
00233     // Show them
00234
00235     hRes = pGenie->Show(FALSE, &lRequestID);
00236
00237     if (FAILED(hRes))
00238       __leave;
00239
00240     hRes = pMerlin->Show(FALSE, &lRequestID);
00241
00242     if (FAILED(hRes))
00243       __leave;
00244
00245     // Have Genie gesture towards Merlin
00246
00247     hRes = pGenie->GestureAt(150, 100, &lRequestID);
00248
00249     if (FAILED(hRes))
00250       __leave;
00251
00252     // And have Genie say hello to Merlin
00253
00254     bszSpeak = SysAllocString(L"Hi there Merlin.");
00255
00256     hRes = pGenie->Speak(bszSpeak, NULL, &lWaitID);
00257
00258     SysFreeString(bszSpeak);
00259
00260     if (FAILED(hRes))
00261       __leave;
00262
00263     // Make Merlin wait for Genie to finish speaking
00264
00265     hRes = pMerlin->Wait(lWaitID, &lRequestID);
00266
00267     if (FAILED(hRes))
00268       __leave;
00269
00270     // Have Merlin gesture towards Genie
00271
00272     hRes = pMerlin->GestureAt(0, 100, &lRequestID);
00273
00274     if (FAILED(hRes))
00275       __leave;
00276
00277     // And then speak back to Genie
00278
00279     bszSpeak = SysAllocString(L"Hi Genie. See you later");
00280
00281     hRes = pMerlin->Speak(bszSpeak, NULL, &g_lDone);
00282
00283     SysFreeString(bszSpeak);
00284
00285     if (FAILED(hRes))
00286       __leave;
00287
00288     // Start the message loop.  A WM_QUIT message will be posted
00289     // when we get the RequestComplete notification from Microsoft Agent.
00290
00291     while (GetMessage(&msg, NULL, 0, 0) > 0)
00292       DispatchMessage(&msg);
00293
00294   }
00295   __finally {
00296
00297     if (FAILED(hRes)) {
00298
00299       wsprintf(szError, _T("An error occurred in Microsoft Agent, code = 0x%x"), hRes);
00300
00301       MessageBox(NULL,
00302              szError,
00303              kpszAppTitle,
00304              MB_OK | MB_ICONERROR | MB_TOPMOST);
00305     }
00306   }
00307
00308   // Release the character interfaces.  NOTE:  releasing the character
00309   // interface does NOT make the character go away.  You must
00310   // call Unload.
00311
00312   if (pGenie) {
00313     pGenie->Release();
00314     pAgentEx->Unload(lGenieID);
00315   }
00316
00317   if (pMerlin) {
00318     pMerlin->Release();
00319     pAgentEx->Unload(lMerlinID);
00320   }
00321
00322   // Release objects
00323
00324   if (pSink) {
00325
00326     if (lNotifySinkID != -1)
00327       pAgentEx->Unregister(lNotifySinkID);
00328
00329     pSink->Release();
00330   }
00331
00332   pAgentEx->Release();
00333
00334   CoUninitialize();
00335
00336   return 0;
00337 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/PingResp/Resource.h Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • PingResp

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by PingResp.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_PINGRESP                    101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/STAObject/STATest.h Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • STAObject

STATest.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: STATest.h
00004
00005 Summary: Declaration of the CSTATest
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 #ifndef __STATEST_H_
00023 #define __STATEST_H_
00024
00025 #include "resource.h"       // main symbols
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CSTATest
00029 class ATL_NO_VTABLE CSTATest :
00030   public CComObjectRootEx<CComSingleThreadModel>,
00031   public CComCoClass<CSTATest, &CLSID_STATest>,
00032   public IDispatchImpl<ISyncTest, &IID_ISyncTest, &LIBID_STAOBJECTLib>
00033 {
00034 public:
00035   CSTATest()
00036   {
00037   }
00038
00039 DECLARE_REGISTRY_RESOURCEID(IDR_STATEST)
00040
00041 DECLARE_PROTECT_FINAL_CONSTRUCT()
00042
00043 BEGIN_COM_MAP(CSTATest)
00044   COM_INTERFACE_ENTRY(ISyncTest)
00045   COM_INTERFACE_ENTRY(IDispatch)
00046 END_COM_MAP()
00047
00048 // ISyncTest
00049 public:
00050   STDMETHOD(Exercise)(void);
00051 };
00052
00053 #endif //__STATEST_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Record.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Record.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=00000560-0000-0010-8000-00AA006D2EA4,DynamicCasts)
00019     @com.interface(iid=00000562-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public class Record implements IUnknown,com.ms.com.NoAutoScripting,msado15._Record
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public native msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1, type=PROPGET, name="ActiveConnection", name2="getActiveConnection", addFlagsVtable=4)
00027       @com.parameters([type=VARIANT] return) */
00028   public native Variant getActiveConnection();
00029
00030   /** @com.method(vtoffset=6, dispid=1, type=PROPPUT, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00031       @com.parameters([in,type=STRING] pvar) */
00032   public native void setActiveConnection(String pvar);
00033
00034   /** @com.method(vtoffset=7, dispid=1, type=PROPPUTREF, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00035       @com.parameters([in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pvar) */
00036   public native void setActiveConnection(msado15._Connection pvar);
00037
00038   /** @com.method(vtoffset=8, dispid=2, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00039       @com.parameters([type=I4] return) */
00040   public native int getState();
00041
00042   /** @com.method(vtoffset=9, dispid=3, type=PROPGET, name="Source", name2="getSource", addFlagsVtable=4)
00043       @com.parameters([type=VARIANT] return) */
00044   public native Variant getSource();
00045
00046   /** @com.method(vtoffset=10, dispid=3, type=PROPPUT, name="Source", name2="putSource", addFlagsVtable=4)
00047       @com.parameters([in,type=STRING] pvar) */
00048   public native void setSource(String pvar);
00049
00050   /** @com.method(vtoffset=11, dispid=3, type=PROPPUTREF, name="Source", name2="putSource", addFlagsVtable=4)
00051       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] pvar) */
00052   public native void setSource(Object pvar);
00053
00054   /** @com.method(vtoffset=12, dispid=4, type=PROPGET, name="Mode", name2="getMode", addFlagsVtable=4)
00055       @com.parameters([type=I4] return) */
00056   public native int getMode();
00057
00058   /** @com.method(vtoffset=13, dispid=4, type=PROPPUT, name="Mode", name2="putMode", addFlagsVtable=4)
00059       @com.parameters([in,type=I4] pMode) */
00060   public native void setMode(int pMode);
00061
00062   /** @com.method(vtoffset=14, dispid=5, type=PROPGET, name="ParentURL", name2="getParentURL", addFlagsVtable=4)
00063       @com.parameters([type=STRING] return) */
00064   public native String getParentURL();
00065
00066   /** @com.method(vtoffset=15, dispid=6, type=METHOD, name="MoveRecord", addFlagsVtable=4)
00067       @com.parameters([in,type=STRING] Source, [in,type=STRING] Destination, [in,type=STRING] UserName, [in,type=STRING] Password, [in,type=I4] Options, [in,type=BOOLEAN] Async, [type=STRING] return) */
00068   public native String MoveRecord(String Source, String Destination, String UserName, String Password, int Options, boolean Async);
00069
00070   /** @com.method(vtoffset=16, dispid=7, type=METHOD, name="CopyRecord", addFlagsVtable=4)
00071       @com.parameters([in,type=STRING] Source, [in,type=STRING] Destination, [in,type=STRING] UserName, [in,type=STRING] Password, [in,type=I4] Options, [in,type=BOOLEAN] Async, [type=STRING] return) */
00072   public native String CopyRecord(String Source, String Destination, String UserName, String Password, int Options, boolean Async);
00073
00074   /** @com.method(vtoffset=17, dispid=8, type=METHOD, name="DeleteRecord", addFlagsVtable=4)
00075       @com.parameters([in,type=STRING] Source, [in,type=BOOLEAN] Async) */
00076   public native void DeleteRecord(String Source, boolean Async);
00077
00078   /** @com.method(vtoffset=18, dispid=9, type=METHOD, name="Open", addFlagsVtable=4)
00079       @com.parameters([in,type=VARIANT] Source, [in,type=VARIANT] ActiveConnection, [in,type=I4] Mode, [in,type=I4] CreateOptions, [in,type=I4] Options, [in,type=STRING] UserName, [in,type=STRING] Password) */
00080   public native void Open(Variant Source, Variant ActiveConnection, int Mode, int CreateOptions, int Options, String UserName, String Password);
00081
00082   /** @com.method(vtoffset=19, dispid=10, type=METHOD, name="Close", addFlagsVtable=4)
00083       @com.parameters() */
00084   public native void Close();
00085
00086   /** @com.method(vtoffset=20, dispid=0, type=PROPGET, name="Fields", name2="getFields", addFlagsVtable=4)
00087       @com.parameters([iid=00000564-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00088   public native msado15.Fields getFields();
00089
00090   /** @com.method(vtoffset=21, dispid=11, type=PROPGET, name="RecordType", name2="getRecordType", addFlagsVtable=4)
00091       @com.parameters([type=I4] return) */
00092   public native int getRecordType();
00093
00094   /** @com.method(vtoffset=22, dispid=12, type=METHOD, name="GetChildren", addFlagsVtable=4)
00095       @com.parameters([iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00096   public native msado15._Recordset GetChildren();
00097
00098   /** @com.method(vtoffset=23, dispid=13, type=METHOD, name="Cancel", addFlagsVtable=4)
00099       @com.parameters() */
00100   public native void Cancel();
00101
00102
00103   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x562, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00104
00105   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0x560, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00106 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/configmgr.h Source File

  • NetDS
  • RRas
  • ip

configmgr.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\configurationemanager.h
00008
00009 Abstract:
00010
00011     The file contains the interface to the configuration manager.
00012
00013 --*/
00014
00015 #ifndef _CONFIGURATION_MANAGER_H_
00016 #define _CONFIGURATION_MANAGER_H_
00017
00018 // globals...
00019
00020 extern CONFIGURATION_ENTRY      g_ce;
00021
00022
00023
00024 // functions...
00025
00026 DWORD
00027 CM_StartProtocol (
00028     IN  HANDLE                  hMgrNotificationEvent,
00029     IN  PSUPPORT_FUNCTIONS      psfSupportFunctions,
00030     IN  PVOID                   pvGlobalInfo);
00031
00032 DWORD
00033 CM_StopProtocol (
00034     );
00035
00036 DWORD
00037 CM_GetGlobalInfo (
00038     IN      PVOID               pvGlobalInfo,
00039     IN OUT  PULONG              pulBufferSize,
00040     OUT     PULONG              pulStructureVersion,
00041     OUT     PULONG              pulStructureSize,
00042     OUT     PULONG              pulStructureCount);
00043
00044 DWORD
00045 CM_SetGlobalInfo (
00046     IN      PVOID               pvGlobalInfo);
00047
00048 DWORD
00049 CM_GetEventMessage (
00050     OUT ROUTING_PROTOCOL_EVENTS *prpeEvent,
00051     OUT MESSAGE                 *pmMessage);
00052
00053 #endif // _CONFIGURATION_MANAGER_H_
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/CmdLineConsumer.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

CmdLineConsumer.Cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  CmdLineConsumer.cpp
00006 //
00007 // Description:
00008 //  This file defines the class behaviors for the command-line
00009 //  event consumer application.
00010 //
00011 // History:
00012 //
00013 // **************************************************************************
00014
00015 #include "stdafx.h"
00016 #include "CmdLineConsumer.h"
00017 #include "CmdLineConsumerDlg.h"
00018 #include <objbase.h>
00019 #include <strsafe.h>
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CCmdLineConsumerApp
00029
00030 BEGIN_MESSAGE_MAP(CCmdLineConsumerApp, CWinApp)
00031   //{{AFX_MSG_MAP(CCmdLineConsumerApp)
00032     // NOTE - the ClassWizard will add and remove mapping macros here.
00033     //    DO NOT EDIT what you see in these blocks of generated code!
00034   //}}AFX_MSG
00035   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00036 END_MESSAGE_MAP()
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CCmdLineConsumerApp construction
00040
00041 CCmdLineConsumerApp::CCmdLineConsumerApp()
00042 {
00043   // TODO: add construction code here,
00044   // Place all significant initialization in InitInstance
00045   m_clsReg = 0;
00046 }
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049 // The one and only CCmdLineConsumerApp object
00050
00051 CCmdLineConsumerApp theApp;
00052
00053 // {31704FFF-6B85-11d1-ADAD-00AA00B8E05A}
00054 static const GUID CLSID_CmdLineConsumer =
00055 { 0x31704fff, 0x6b85, 0x11d1, { 0xad, 0xad, 0x0, 0xaa, 0x0, 0xb8, 0xe0, 0x5a } };
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // CCmdLineConsumerApp initialization
00059
00060 BOOL CCmdLineConsumerApp::InitInstance()
00061 {
00062   HRESULT hRes;
00063   BOOL regEmpty = FALSE; // did a self-unregister happen?
00064
00065   // OLE initialization. This is 'lighter' than OleInitialize()
00066   //  which also setups DnD, etc.
00067   if(SUCCEEDED(CoInitialize(NULL)))
00068   {
00069
00070     //  NOTE:
00071     //  When using asynchronous WMI API's remotely in an environment where the "Local System" account
00072     //  has no network identity (such as non-Kerberos domains), the authentication level of
00073     //  RPC_C_AUTHN_LEVEL_NONE is needed. However, lowering the authentication level to
00074     //  RPC_C_AUTHN_LEVEL_NONE makes your application less secure. It is wise to
00075     //  use semi-synchronous API's for accessing WMI data and events instead of the asynchronous ones.
00076
00077
00078     hRes = CoInitializeSecurity( NULL, -1, NULL, NULL,
00079                       RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
00080                       RPC_C_IMP_LEVEL_IMPERSONATE,
00081                       NULL,
00082                       EOAC_SECURE_REFS, //change to EOAC_NONE if you change dwAuthnLevel to RPC_C_AUTHN_LEVEL_NONE
00083                       NULL );
00084     if (FAILED(hRes))
00085     {
00086       AfxMessageBox(_T("CoInitializeSecurity Failed"));
00087       return FALSE;
00088     }
00089   }
00090   else // didnt CoInitialize()
00091   {
00092     AfxMessageBox(_T("CoInitialize Failed"));
00093     return FALSE;
00094   } // endif OleInitialize()
00095
00096   // NOTE: To advertise that we can self-register, put 'OLESelfRegister'
00097   // in the version resource.
00098
00099   // see if this is a self-Unregister call.
00100   TCHAR temp[256];
00101   TCHAR seps[] = _T(" ");
00102   TCHAR *token = NULL;
00103
00104   HRESULT hr = StringCbCopy(temp, sizeof(temp), (LPCTSTR)m_lpCmdLine);
00105   if (FAILED(hr))
00106   {
00107     return FALSE; //command line too long to be valid
00108   }
00109   token = _tcstok( temp, seps );
00110   while( token != NULL )
00111   {
00112     /* While there are tokens in "string" */
00113     if(_tcsicmp(token, _T("/UNREGSERVER")) == 0)
00114     {
00115       UnregisterServer();
00116       return FALSE;   // no use doing any more.
00117     }
00118     /* Get next token: */
00119     token = _tcstok( NULL, seps );
00120   }
00121
00122   // if we got here, the unregister didn't return out and we should
00123   // make sure we're registered now.
00124   RegisterServer();
00125
00126   // creating the dlg earlier than usual so the class factory
00127   //  can pass m_outputList.
00128   CCmdLineConsumerDlg dlg;
00129
00130   m_factory = new CProviderFactory(&(dlg.m_output));
00131   if (!m_factory)
00132   {
00133     return FALSE;  //out of memory
00134   }
00135
00136   if((hRes = CoRegisterClassObject(CLSID_CmdLineConsumer,
00137               (IUnknown *)m_factory,
00138               CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
00139               REGCLS_MULTIPLEUSE,
00140               &m_clsReg)) == S_OK)
00141   {
00142     TRACE(_T("registered\n"));
00143   }
00144   else
00145   {
00146     TRACE(_T("not registered\n"));
00147   }
00148
00149 #ifdef _AFXDLL
00150   Enable3dControls();     // Call this when using MFC in a shared DLL
00151 #else
00152   Enable3dControlsStatic(); // Call this when linking to MFC statically
00153 #endif
00154
00155   m_pMainWnd = &dlg;
00156   INT_PTR nResponse = dlg.DoModal();
00157   if (nResponse == IDOK)
00158   {
00159     // TODO: Place code here to handle when the dialog is
00160     //  dismissed with OK
00161   }
00162   else if (nResponse == IDCANCEL)
00163   {
00164     // TODO: Place code here to handle when the dialog is
00165     //  dismissed with Cancel
00166   }
00167
00168   // Since the dialog has been closed, return FALSE so that we exit the
00169   //  application, rather than start the application's message pump.
00170   return FALSE;
00171 }
00172
00173 //-----------------------------------------------------------
00174 int CCmdLineConsumerApp::ExitInstance()
00175 {
00176   if(m_clsReg)
00177   {
00178     HRESULT hres = CoRevokeClassObject(m_clsReg);
00179
00180     CoUninitialize();
00181   }
00182
00183   return CWinApp::ExitInstance();
00184 }
00185
00186 #define TCHAR_LEN_IN_BYTES(str)  (unsigned long)(_tcslen(str)*sizeof(TCHAR)+sizeof(TCHAR))
00187
00188 //***************************************************************************
00189 //
00190 // DllRegisterServer
00191 //
00192 // Purpose: Called during setup or by regsvr32.
00193 //
00194 // Return:  NOERROR if registration successful, error otherwise.
00195 // Note: Key setups are:
00196 //    HKCR\CLSID\[guid]= friendly name
00197 //    HKCR\CLSID\[guid]\LocalServer32 = exe's path.
00198 //    HKCR\CLSID\AppID = [guid]
00199 //    HKCR\AppID\[guid] = friendly name
00200 //    HKCR\AppID\[guid] = 'RunAs' = "Interactive User"
00201 //      'RunAs' is a value name; not a subkey.
00202 //***************************************************************************
00203 void CCmdLineConsumerApp::RegisterServer(void)
00204 {
00205   HKEY hKey1, hKey2;
00206
00207   const TCHAR       wcConsID[] = _T("{31704FFF-6B85-11d1-ADAD-00AA00B8E05A}");
00208     const TCHAR       wcCLSID[] = _T("CLSID\\{31704FFF-6B85-11d1-ADAD-00AA00B8E05A}");
00209     const TCHAR       wcAppID[] = _T("AppID\\{31704FFF-6B85-11d1-ADAD-00AA00B8E05A}");
00210     TCHAR      wcModule[MAX_PATH + 1];  // this will hold the exe's path.
00211   const TCHAR ConsumerTextForm[] = _T("Microsoft Cmd Line Consumer");
00212
00213   // this will allow the server to display its windows on the active desktop instead
00214   // of the hidden desktop where services run.
00215   const TCHAR Interactive[] = _T("Interactive User");
00216
00217   memset(&wcModule, NULL, sizeof(wcModule)/sizeof(TCHAR));
00218   GetModuleFileName(NULL, wcModule, sizeof(wcModule)/sizeof(TCHAR) - 1);
00219
00220   //Set the "default" text under CLSID
00221   //==========================
00222   RegCreateKeyEx( HKEY_CLASSES_ROOT, wcCLSID, 0, NULL,
00223                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00224                     &hKey1, NULL );
00225   RegSetValueEx(hKey1, NULL, 0, REG_SZ,
00226           (LPBYTE)ConsumerTextForm,
00227           TCHAR_LEN_IN_BYTES(ConsumerTextForm));
00228
00229   // create the LocalServer32 key so the server can be found.
00230   RegCreateKeyEx( hKey1, _T("LocalServer32"), 0, NULL,
00231                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00232                     &hKey2, NULL );
00233   RegSetValueEx(hKey2, NULL, 0, REG_SZ, (LPBYTE)wcModule, TCHAR_LEN_IN_BYTES(wcModule));
00234   RegSetValueEx(hKey1, _T("AppID"), 0, REG_SZ, (LPBYTE)wcConsID, TCHAR_LEN_IN_BYTES(wcConsID));
00235
00236   RegCloseKey(hKey2);
00237   RegCloseKey(hKey1);
00238
00239   // now do the AppID keys.
00240   RegCreateKeyEx( HKEY_CLASSES_ROOT, wcAppID, 0, NULL,
00241                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00242                     &hKey1, NULL );
00243   RegSetValueEx(hKey1, NULL, 0, REG_SZ,
00244           (LPBYTE)ConsumerTextForm,
00245           TCHAR_LEN_IN_BYTES(ConsumerTextForm));
00246
00247   // this makes the local server run on the active desktop (the one you're seeing)
00248   // instead of the hidden desktop that services run on (which doesn't have UI)
00249   RegSetValueEx(hKey1, _T("RunAs"), 0, REG_SZ, (LPBYTE)Interactive, TCHAR_LEN_IN_BYTES(Interactive));
00250   RegCloseKey(hKey1);
00251 }
00252
00253 //***************************************************************************
00254 //
00255 // DllUnregisterServer
00256 //
00257 // Purpose: Called when it is time to remove the registry entries.
00258 //
00259 // Return:  NOERROR if registration successful, error otherwise.
00260 //***************************************************************************
00261 void CCmdLineConsumerApp::UnregisterServer(void)
00262 {
00263
00264   TCHAR       wcConsID[] = _T("{31704FFF-6B85-11d1-ADAD-00AA00B8E05A}");
00265     TCHAR       wcCLSID[] = _T("CLSID\\{31704FFF-6B85-11d1-ADAD-00AA00B8E05A}");
00266     TCHAR       wcAppID[] = _T("AppID\\{31704FFF-6B85-11d1-ADAD-00AA00B8E05A}");
00267     HKEY hKey1;
00268   DWORD dwRet;
00269
00270   // delete the keys under CLSID\[guid]
00271     dwRet = RegOpenKeyEx(HKEY_CLASSES_ROOT, wcCLSID, 0, KEY_WRITE, &hKey1);
00272     if(dwRet == NOERROR)
00273     {
00274         RegDeleteKey(hKey1, _T("LocalServer32"));
00275         RegCloseKey(hKey1);
00276     }
00277
00278
00279   // delete CLSID\[guid] <default>
00280     dwRet = RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("CLSID"), 0, KEY_WRITE, &hKey1);
00281     if(dwRet == NOERROR)
00282     {
00283         RegDeleteKey(hKey1,wcConsID);
00284         RegCloseKey(hKey1);
00285     }
00286
00287   // delete AppID\[guid] <default>
00288     dwRet = RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("AppID"), 0, KEY_WRITE, &hKey1);
00289     if(dwRet == NOERROR)
00290     {
00291         RegDeleteKey(hKey1, wcConsID);
00292         RegCloseKey(hKey1);
00293     }
00294 }
00295
00296
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/RootDSE/VC/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • RootDSE
  • VC

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__AAEF26D7_E0AA_11D2_BC85_00C04FD430AF__INCLUDED_)
00007 #define AFX_STDAFX_H__AAEF26D7_E0AA_11D2_BC85_00C04FD430AF__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00013 #include "stdio.h"
00014 #include "activeds.h"
00015
00016 // TODO: reference additional headers your program requires here
00017
00018 //{{AFX_INSERT_LOCATION}}
00019 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00020
00021 #endif // !defined(AFX_STDAFX_H__AAEF26D7_E0AA_11D2_BC85_00C04FD430AF__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/Obj.Cpp Source File

  • Com
  • Fundamentals
  • SimpSvr

Obj.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: obj.cpp
00003 //
00004 //    Implementation file for the CSimpSvrApp Class
00005 //
00006 // Functions:
00007 //
00008 //    See obj.h for a list of member functions.
00009 //
00010 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "obj.h"
00015 #include "ioo.h"
00016 #include "ido.h"
00017 #include "ips.h"
00018 #include "icf.h"
00019 #include "ioipao.h"
00020 #include "ioipo.h"
00021 #include "app.h"
00022 #include "doc.h"
00023
00024 //**********************************************************************
00025 //
00026 // CSimpSvrObj::QueryInterface
00027 //
00028 // Purpose:
00029 //
00030 //      Used for interface negotiation at the "Object" level.
00031 //
00032 // Parameters:
00033 //
00034 //      REFIID riid         -   A reference to the interface that is
00035 //                              being queried.
00036 //
00037 //      LPVOID FAR* ppvObj  -   An out parameter to return a pointer to
00038 //                              the interface.
00039 //
00040 // Return Value:
00041 //
00042 //      S_OK          -   The interface is supported.
00043 //      E_NOINTERFACE -   The interface is not supported
00044 //
00045 // Function Calls:
00046 //      Function                    Location
00047 //
00048 //      OutputDebugString           Windows API
00049 //                   OLE API
00050 //      IUnknown::AddRef            OBJ.CPP, IOO.CPP, IDO.CPP, IPS.CPP
00051 //                                  IOIPO.CPP, IOIPAO.CPP
00052 //
00053 // Comments:
00054 //
00055 //
00056 //********************************************************************
00057
00058 STDMETHODIMP CSimpSvrObj::QueryInterface ( REFIID riid, LPVOID FAR* ppvObj)
00059 {
00060         OutputDebugString("In CSimpSvrObj::QueryInterface\r\n");
00061
00062         SCODE sc = S_OK;
00063
00064         if (riid == IID_IUnknown)
00065                 *ppvObj = this;
00066         else if (riid == IID_IOleObject)
00067                 *ppvObj = &m_OleObject;
00068         else if (riid == IID_IDataObject)
00069                 *ppvObj = &m_DataObject;
00070         else if ( (riid == IID_IPersistStorage) || (riid == IID_IPersist) )
00071                 *ppvObj = &m_PersistStorage;
00072         else if (riid == IID_IOleInPlaceObject)
00073                 *ppvObj = &m_OleInPlaceObject;
00074         else if (riid == IID_IOleInPlaceActiveObject)
00075                 *ppvObj = &m_OleInPlaceActiveObject;
00076         else if (riid == IID_IExternalConnection)
00077                  *ppvObj = &m_ExternalConnection;
00078         else
00079                 {
00080                 *ppvObj = NULL;
00081                 sc = E_NOINTERFACE;
00082                 }
00083
00084         if (*ppvObj)
00085                 ((LPUNKNOWN)*ppvObj)->AddRef();
00086
00087         return  sc ;
00088 };
00089
00090 //**********************************************************************
00091 //
00092 // CSimpSvrObj::AddRef
00093 //
00094 // Purpose:
00095 //
00096 //      Adds to the reference count at the Object level.
00097 //
00098 // Parameters:
00099 //
00100 //      None
00101 //
00102 // Return Value:
00103 //
00104 //      ULONG   -   The new reference count of the Object.
00105 //
00106 // Function Calls:
00107 //      Function                    Location
00108 //
00109 //      OutputDebugString           Windows API
00110 //
00111 // Comments:
00112 //
00113 //      Due to the reference counting model that is used in this
00114 //      implementation, this reference count is the sum of the
00115 //      reference counts on all interfaces
00116 //
00117 //********************************************************************
00118
00119 STDMETHODIMP_(ULONG) CSimpSvrObj::AddRef ()
00120 {
00121         OutputDebugString("In CSimpSvrObj::AddRef\r\n");
00122
00123         m_lpDoc->AddRef();
00124
00125         return ++m_nCount;
00126 };
00127
00128 //**********************************************************************
00129 //
00130 // CSimpSvrObj::Release
00131 //
00132 // Purpose:
00133 //
00134 //      Decrements the reference count at this level
00135 //
00136 // Parameters:
00137 //
00138 //      None
00139 //
00140 // Return Value:
00141 //
00142 //      ULONG   -   The new reference count of the object.
00143 //
00144 // Function Calls:
00145 //      Function                    Location
00146 //
00147 //      OutputDebugString           Windows API
00148 //
00149 // Comments:
00150 //
00151 //      Due to the reference counting model that is used in this
00152 //      implementation, this reference count is the sum of the
00153 //      reference counts on all interfaces
00154 //
00155 //********************************************************************
00156
00157 STDMETHODIMP_(ULONG) CSimpSvrObj::Release ()
00158 {
00159         OutputDebugString("In CSimpSvrObj::Release\r\n");
00160
00161         // This object's destructor depends on m_lpDoc being valid
00162         // so ensure that our reference on the doc object
00163         // is held across possible destruction
00164
00165         CSimpSvrDoc FAR * lpDoc = m_lpDoc;
00166         int nCount = --m_nCount;
00167
00168         if (nCount == 0) {
00169                 delete this;
00170         }
00171
00172         lpDoc->Release();
00173
00174         return nCount;
00175 };
00176
00177 //**********************************************************************
00178 //
00179 // CSimpSvrObj::CSimpSvrObj
00180 //
00181 // Purpose:
00182 //
00183 //      Constructor for CSimpSvrObj
00184 //
00185 // Parameters:
00186 //
00187 //      CSimpSvrDoc FAR * lpSimpSvrDoc - ptr to the doc object
00188 //
00189 // Return Value:
00190 //
00191 //      None
00192 //
00193 // Function Calls:
00194 //      Function                    Location
00195 //
00196 //
00197 // Comments:
00198 //
00199 //
00200 //********************************************************************
00201 #pragma warning (disable : 4355) // "this" used in base initializer list warning.  This
00202                                                                  // can be disabled because we are not using "this" in
00203                                                                  // the constructor for these objects, rather we are
00204                                                                  // just storing it for future use...
00205 CSimpSvrObj::CSimpSvrObj(CSimpSvrDoc FAR * lpSimpSvrDoc) : m_OleObject(this),
00206                                                                                                                    m_DataObject(this),
00207                                                                                                                    m_PersistStorage(this),
00208                                                                                                                    m_OleInPlaceActiveObject(this),
00209                                                                                                                    m_OleInPlaceObject(this),
00210                                                                                                                    m_ExternalConnection(this)
00211 #pragma warning (default : 4355) // Turn the warning back on
00212
00213 {
00214         m_lpDoc = lpSimpSvrDoc;
00215         m_nCount = 0;
00216         m_fInPlaceActive = FALSE;
00217         m_fInPlaceVisible = FALSE;
00218         m_fUIActive = FALSE;
00219         m_hmenuShared = NULL;
00220         m_hOleMenu = NULL;
00221
00222         m_dwRegister = 0;
00223
00224         m_lpFrame = NULL;
00225         m_lpCntrDoc = NULL;
00226
00227         m_lpStorage = NULL;
00228         m_lpColorStm = NULL;
00229         m_lpSizeStm = NULL;
00230         m_lpOleClientSite = NULL;
00231         m_lpOleAdviseHolder = NULL;
00232         m_lpDataAdviseHolder = NULL;
00233         m_lpIPSite = NULL;
00234
00235         m_red = 128;
00236         m_green = 0;
00237         m_blue = 0;
00238
00239         m_size.x = 100;
00240         m_size.y = 100;
00241
00242         m_xOffset = 0;
00243         m_yOffset = 0;
00244
00245         m_scale = (float) 1.0;
00246
00247         m_fSaveWithSameAsLoad = FALSE;
00248         m_fNoScribbleMode = FALSE;
00249
00250 }
00251
00252 //**********************************************************************
00253 //
00254 // CSimpSvrObj::~CSimpSvrObj
00255 //
00256 // Purpose:
00257 //
00258 //      Destructor for CSimpSvrObj
00259 //
00260 // Parameters:
00261 //
00262 //      None
00263 //
00264 // Return Value:
00265 //
00266 //
00267 //
00268 // Function Calls:
00269 //      Function                    Location
00270 //
00271 //      OutputDebugString           Windows API
00272 //      PostMessage                 Windows API
00273 //      CSimpSvrDoc::GetApp         DOC.H
00274 //      CSimpSvrDoc::GethAppWnd     DOC.H
00275 //      CSimpSvrDoc::ClearObj       DOC.H
00276 //      CSimpSvrApp::IsStartedByOle APP.CPP
00277 //
00278 // Comments:
00279 //
00280 //
00281 //********************************************************************
00282
00283 CSimpSvrObj::~CSimpSvrObj()
00284 {
00285         OutputDebugString("In CSimpSvrObj's Destructor \r\n");
00286
00287         // if we were started by ole, post ourselves a close message
00288         if (m_lpDoc->GetApp()->IsStartedByOle())
00289                 PostMessage(m_lpDoc->GethAppWnd(), WM_SYSCOMMAND, SC_CLOSE, 0L);
00290
00291         // clear the OBJ ptr in the doc class
00292         m_lpDoc->ClearObj();
00293
00294 }
00295
00296 //**********************************************************************
00297 //
00298 // CSimpSvrObj::Draw
00299 //
00300 // Purpose:
00301 //
00302 //      Draws the object into an arbitrary DC
00303 //
00304 // Parameters:
00305 //
00306 //      HDC hDC - DC to draw into
00307 //
00308 // Return Value:
00309 //
00310 //      NONE
00311 //
00312 // Function Calls:
00313 //      Function                    Location
00314 //
00315 //      OutputDebugString           Windows API
00316 //      CreateBrushIndirect         Windows API
00317 //      SelectObject                Windows API
00318 //      Rectangle                   Windows API
00319 //      DeleteObject                Windows API
00320 //
00321 // Comments:
00322 //
00323 //
00324 //********************************************************************
00325
00326 void CSimpSvrObj::Draw (HDC hDC, BOOL m_fMeta)
00327 {
00328         LOGBRUSH lb;
00329
00330         OutputDebugString("In CSimpSvrObj::Draw\r\n");
00331
00332         char szBuffer[255];
00333         wsprintf(szBuffer,"Drawing Scale %3d\r\n",(int)m_scale);
00334         OutputDebugString(szBuffer);
00335
00336         if (!m_fMeta)
00337                 {
00338                 SetMapMode(hDC, MM_ANISOTROPIC);
00339                 //@@WTK WIN32, UNICODE
00340                 //SetWindowOrg(hDC, (int)(m_xOffset/m_scale), (int)(m_yOffset/m_scale));
00341                 SetWindowOrgEx(hDC, (int)(m_xOffset/m_scale),
00342                         (int)(m_yOffset/m_scale), NULL);
00343                 //@@WTK WIN32, UNICODE
00344                 //SetWindowExt(hDC, m_size.x, m_size.y);
00345                 SetWindowExtEx(hDC, m_size.x, m_size.y, NULL);
00346                 //@@WTK WIN32, UNICODE
00347                 //SetViewportExt(hDC, (int)(m_size.x*m_scale), (int)(m_size.y*m_scale));
00348                 SetViewportExtEx(hDC, (int)(m_size.x*m_scale),
00349                         (int)(m_size.y*m_scale), NULL);
00350                 }
00351
00352         // fill out a LOGBRUSH
00353         lb.lbStyle = BS_SOLID;
00354         lb.lbColor = RGB(m_red, m_green, m_blue);
00355         lb.lbHatch = 0;
00356
00357         // create the brush
00358         HBRUSH hBrush = CreateBrushIndirect(&lb);
00359
00360         // select the brush
00361         HBRUSH hOldBrush = (HBRUSH) SelectObject(hDC, hBrush);
00362         HPEN hPen = CreatePen(PS_INSIDEFRAME, 6, RGB(0, 0, 0));
00363
00364         HPEN hOldPen = (HPEN) SelectObject(hDC, hPen);
00365
00366         // draw the rectangle
00367         Rectangle (hDC, 0, 0, m_size.x, m_size.y);
00368
00369         // restore the pen
00370         hPen = (HPEN) SelectObject(hDC, hOldPen);
00371
00372         // free the pen
00373         DeleteObject(hPen);
00374
00375         // restore the old brush
00376         hBrush = (HBRUSH) SelectObject(hDC, hOldBrush);
00377
00378         // free the brush
00379         DeleteObject(hBrush);
00380 }
00381
00382 //**********************************************************************
00383 //
00384 // CSimpSvrObj::GetMetaFilePict
00385 //
00386 // Purpose:
00387 //
00388 //      Returns a handle to a metafile representation of the object.
00389 //
00390 // Parameters:
00391 //
00392 //      None
00393 //
00394 // Return Value:
00395 //
00396 //      Handle to the metafile.
00397 //
00398 // Function Calls:
00399 //      Function                        Location
00400 //
00401 //      OutputDebugString               Windows API
00402 //      GlobalAlloc                     Windows API
00403 //      GlobalLock                      Windows API
00404 //      SetWindowOrg                    Windows API
00405 //      SetWindowExt                    Windows API
00406 //      CreateMetaFile                  Windows API
00407 //      CloseMetaFile                   Windows API
00408 //      GlobalUnlock                    Windows API
00409 //      XformWidthInPixelsToHimetric    OLESTD
00410 //      XformHeightInPixelsToHimetric   OLESTD
00411 //      CSimpSvrObj::Draw               OBJ.CPP
00412 //
00413 // Comments:
00414 //
00415 //
00416 //********************************************************************
00417
00418 HANDLE CSimpSvrObj::GetMetaFilePict()
00419 {
00420         HANDLE hMFP;
00421         METAFILEPICT FAR * lpMFP;
00422         POINT pt;
00423
00424         OutputDebugString("In CSimpSvrObj::GetMetaFilePict\r\n");
00425
00426         // allocate the memory for the METAFILEPICT structure
00427         hMFP = GlobalAlloc (GMEM_SHARE | GHND, sizeof (METAFILEPICT) );
00428         lpMFP = (METAFILEPICT FAR*) GlobalLock(hMFP);
00429
00430         // get the size of the object in HIMETRIC
00431         pt.x = XformWidthInPixelsToHimetric(NULL, m_size.x);
00432         pt.y = XformHeightInPixelsToHimetric(NULL, m_size.y);
00433
00434         // fill out the METAFILEPICT structure
00435         lpMFP->mm = MM_ANISOTROPIC;
00436         lpMFP->xExt = pt.x;
00437         lpMFP->yExt = pt.y;
00438
00439         // Create the metafile
00440         HDC hDC = CreateMetaFile(NULL);
00441
00442         //@@WTK WIN32, UNICODE
00443         //SetWindowOrg (hDC, 0, 0);
00444         SetWindowOrgEx (hDC, 0, 0, NULL);
00445         //@@WTK WIN32, UNICODE
00446         //SetWindowExt (hDC, m_size.x,
00447         SetWindowExtEx (hDC, m_size.x,
00448                                            m_size.y, NULL);
00449
00450         Draw(hDC);
00451
00452         lpMFP->hMF = CloseMetaFile(hDC);
00453
00454         // unlock the metafilepict
00455         GlobalUnlock(hMFP);
00456
00457         return hMFP;
00458 }
00459
00460
00461 //**********************************************************************
00462 //
00463 // CSimpSvrObj::SaveToStorage
00464 //
00465 // Purpose:
00466 //
00467 //      Saves the object to the passed storage
00468 //
00469 // Parameters:
00470 //
00471 //      LPSTORAGE lpStg - Storage in which to save the object
00472 //
00473 // Return Value:
00474 //
00475 //      None
00476 //
00477 // Function Calls:
00478 //      Function                    Location
00479 //
00480 //      OutputDebugString           Windows API
00481 //      IStorage::CreateStream      OLE
00482 //      IStream::Write              OLE
00483 //      IStream::Release            OLE
00484 //
00485 // Comments:
00486 //
00487 //      A real app will want to do better error checking / returning
00488 //
00489 //********************************************************************
00490
00491 void CSimpSvrObj::SaveToStorage (LPSTORAGE lpStg, BOOL fSameAsLoad)
00492 {
00493         OutputDebugString("In CSimpSvrObj::SaveToStorage\r\n");
00494
00495         LPSTREAM lpTempColor, lpTempSize;
00496
00497         if (!fSameAsLoad)
00498                 m_PersistStorage.CreateStreams( lpStg, &lpTempColor, &lpTempSize);
00499         else
00500                 {
00501                 lpTempColor = m_lpColorStm;
00502                 lpTempColor->AddRef();
00503                 lpTempSize = m_lpSizeStm;
00504                 lpTempSize->AddRef();
00505                 }
00506
00507         ULARGE_INTEGER uli;
00508
00509         uli.LowPart = 0;
00510         uli.HighPart = 0;
00511
00512         lpTempColor->SetSize(uli);
00513         lpTempSize->SetSize(uli);
00514
00515         LARGE_INTEGER li;
00516
00517         li.LowPart = 0;
00518         li.HighPart = 0;
00519
00520         lpTempColor->Seek(li, STREAM_SEEK_SET, NULL);
00521         lpTempSize->Seek(li, STREAM_SEEK_SET, NULL);
00522
00523         // write the colors to the stream
00524         lpTempColor->Write(&m_red, sizeof(m_red), NULL);
00525         lpTempColor->Write(&m_green, sizeof(m_green), NULL);
00526         lpTempColor->Write(&m_blue, sizeof(m_blue), NULL);
00527
00528         // write the size to the stream
00529         lpTempSize->Write(&m_size, sizeof(m_size), NULL);
00530
00531         lpTempColor->Release();
00532         lpTempSize->Release();
00533 }
00534
00535 //**********************************************************************
00536 //
00537 // CSimpSvrObj::LoadFromStorage
00538 //
00539 // Purpose:
00540 //
00541 //      Loads the object from the passed storage
00542 //
00543 // Parameters:
00544 //
00545 //      LPSTORAGE lpStg     - Storage in which to load the object from
00546 //
00547 // Return Value:
00548 //
00549 //      None.
00550 //
00551 // Function Calls:
00552 //      Function                    Location
00553 //
00554 //      OutputDebugString           Windows API
00555 //      IStorage::OpenStream        OLE
00556 //      IStream::Read               OLE
00557 //      IStream::Release            OLE
00558 //
00559 // Comments:
00560 //
00561 //
00562 //********************************************************************
00563
00564 void CSimpSvrObj::LoadFromStorage ()
00565 {
00566         OutputDebugString("In CSimpSvrObj::LoadFromStorage\r\n");
00567
00568         // Read the colors
00569         m_lpColorStm->Read(&m_red, sizeof(m_red), NULL);
00570         m_lpColorStm->Read(&m_green, sizeof(m_green), NULL);
00571         m_lpColorStm->Read(&m_blue, sizeof(m_blue), NULL);
00572
00573         // read the size
00574         m_lpSizeStm->Read(&m_size, sizeof(m_size), NULL);
00575
00576 }
00577
00578 //**********************************************************************
00579 //
00580 // CSimpSvrObj::DoInPlaceActivate
00581 //
00582 // Purpose:
00583 //
00584 //      Does the inplace activation for the object
00585 //
00586 // Parameters:
00587 //
00588 //      LONG lVerb  - Verb that caused this function to be called
00589 //
00590 // Return Value:
00591 //
00592 //      TRUE/FALSE depending on success or failure.
00593 //
00594 // Function Calls:
00595 //      Function                                Location
00596 //
00597 //      IOleClientSite::QueryInterface          Container
00598 //      IOleClientSite::ShowObject              Container
00599 //      IOleInPlaceSite::CanInPlaceActivate     Container
00600 //      IOleInPlaceSite::Release                Container
00601 //      IOleInPlaceSite::OnInPlaceActivate      Container
00602 //      IOleInPlaceSite::GetWindow              Container
00603 //      IOleInPlaceSite::GetWindowContext       Container
00604 //      IOleInPlaceSite::OnUIActivate           Container
00605 //      IOleInPlaceSite::Release                Container
00606 //      IOleInPlaceFrame::SetActiveObject       Container
00607 //      IOleInPlaceUIWindow::SetActiveObject    Container
00608 //      OutputDebugString                       Windows API
00609 //      ShowWindow                              Windows API
00610 //      SetParent                               Windows API
00611 //      IntersectRect                           Windows API
00612 //      OffsetRect                              Windows API
00613 //      MoveWindow                              Windows API
00614 //      CopyRect                                Windows API
00615 //      SetFocus                                Windows API
00616 //      SetHatchWindowSize                      OLE2UI
00617 //      CSimpSvrObj::AssembleMenus              OBJ.CPP
00618 //      CSimpSvrObj::AddFrameLevelUI            OBJ.CPP
00619 //
00620 //
00621 // Comments:
00622 //
00623 //      Be sure to read TECHNOTES.WRI included with the OLE SDK
00624 //      for details on implementing inplace activation.
00625 //
00626 //********************************************************************
00627
00628 BOOL CSimpSvrObj::DoInPlaceActivate (LONG lVerb)
00629 {
00630         BOOL retval = FALSE;
00631         RECT posRect, clipRect;
00632
00633
00634         OutputDebugString("In CSimpSvrObj::DoInPlaceActivate\r\n");
00635
00636         // if not currently in place active
00637         if (!m_fInPlaceActive)
00638                 {
00639                 // get the inplace site
00640                 if (m_lpOleClientSite->QueryInterface(IID_IOleInPlaceSite,
00641                                                                                           (LPVOID FAR *)&m_lpIPSite) != NOERROR)
00642                         goto error;
00643
00644
00645                 // if the inplace site could not be obtained, or refuses to inplace
00646                 // activate then goto error.
00647                 if (m_lpIPSite == NULL || m_lpIPSite->CanInPlaceActivate() != NOERROR)
00648                         {
00649                         if (m_lpIPSite)
00650                                 m_lpIPSite->Release();
00651                         m_lpIPSite = NULL;
00652                         goto error;
00653                         }
00654
00655                 // tell the site that we are activating.
00656                 m_lpIPSite->OnInPlaceActivate();
00657                 m_fInPlaceActive = TRUE;
00658                 }
00659
00660         // if not currently inplace visibl
00661         if (!m_fInPlaceVisible)
00662                 {
00663                 m_fInPlaceVisible = TRUE;
00664
00665                 // get the window handle of the site
00666                 m_lpIPSite->GetWindow(&m_hWndParent);
00667
00668                 // get window context from the container
00669                 m_lpIPSite->GetWindowContext ( &m_lpFrame,
00670                                                                          &m_lpCntrDoc,
00671                                                                          &posRect,
00672                                                                          &clipRect,
00673                                                                          &m_FrameInfo);
00674
00675                 // show the hatch window
00676                 m_lpDoc->ShowHatchWnd();
00677
00678                 // Set the parenting
00679                 SetParent (m_lpDoc->GethHatchWnd(), m_hWndParent);
00680                 SetParent (m_lpDoc->GethDocWnd(), m_lpDoc->GethHatchWnd());
00681
00682                 // tell the client site to show the object
00683                 m_lpOleClientSite->ShowObject();
00684
00685                 RECT resRect;
00686
00687                 // figure out the "real" size of the object
00688                 IntersectRect(&resRect, &posRect, &clipRect);
00689                 CopyRect(&m_posRect, &posRect);
00690
00691                 POINT pt;
00692
00693                 // adjust our hatch window size
00694                 SetHatchWindowSize ( m_lpDoc->GethHatchWnd(),
00695                                                          &resRect,
00696                                                          &posRect,
00697                                                          &pt);
00698
00699                 // calculate the actual object rect inside the hatchwnd.
00700                 OffsetRect (&resRect, pt.x, pt.y);
00701
00702                 // move the object window
00703                 MoveWindow(m_lpDoc->GethDocWnd(),
00704                                    resRect.left,
00705                                    resRect.top,
00706                                    resRect.right - resRect.left,
00707                                    resRect.bottom - resRect.top,
00708                                    FALSE);
00709
00710                 // create the combined window
00711                 AssembleMenus();
00712                 }
00713
00714         // if not UIActive
00715         if (!m_fUIActive)
00716                 {
00717                 m_fUIActive = TRUE;
00718
00719                 // tell the inplace site that we are activating
00720                 m_lpIPSite->OnUIActivate();
00721
00722                 // set the focus to our object window
00723                 SetFocus(m_lpDoc->GethDocWnd());
00724
00725                 // set the active object on the frame
00726                 //@@WTK WIN32, UNICODE
00727                 //m_lpFrame->SetActiveObject(&m_OleInPlaceActiveObject, "Simple OLE 2.0 Server");
00728                 m_lpFrame->SetActiveObject(&m_OleInPlaceActiveObject, OLESTR("Simple OLE 2.0 Server"));
00729
00730                 // set the active object on the Doc, if available.
00731                 if (m_lpCntrDoc)
00732                         //@@WTK WIN32, UNICODE
00733                         //m_lpCntrDoc->SetActiveObject(&m_OleInPlaceActiveObject, "Simple OLE 2.0 Server");
00734                         m_lpCntrDoc->SetActiveObject(&m_OleInPlaceActiveObject, OLESTR("Simple OLE 2.0 Server"));
00735
00736                 // add the frame level UI.
00737                 AddFrameLevelUI();
00738                 }
00739
00740         retval = TRUE;
00741 error:
00742         return retval;
00743 }
00744
00745 //**********************************************************************
00746 //
00747 // CSimpSvrObj::AssembleMenus
00748 //
00749 // Purpose:
00750 //
00751 //      Creates the combined menus used during inplace activation.
00752 //
00753 // Parameters:
00754 //
00755 //      None
00756 //
00757 // Return Value:
00758 //
00759 //      None
00760 //
00761 // Function Calls:
00762 //      Function                        Location
00763 //
00764 //      OutputDebugString               Windows API
00765 //      CreateMenu                      Windows API
00766 //      IOleInPlaceFrame::InsertMenus   Container
00767 //      InsertMenu                      Windows API
00768 //      DestroyMenu                     Windows API
00769 //      OleCreateMenuDescriptor         OLE API
00770 //
00771 // Comments:
00772 //
00773 //
00774 //********************************************************************
00775
00776 void CSimpSvrObj::AssembleMenus()
00777 {
00778         OutputDebugString("In CSimpSvrObj::AssembleMenus\r\n");
00779         OLEMENUGROUPWIDTHS menugroupwidths;
00780
00781         m_hmenuShared = NULL;
00782
00783         //  Create the menu resource
00784         m_hmenuShared = CreateMenu();
00785
00786         // have the contaner insert its menus
00787         if (m_lpFrame->InsertMenus (m_hmenuShared, &menugroupwidths) == NOERROR)
00788                 {
00789                 int nFirstGroup = (int) menugroupwidths.width[0];
00790
00791                 // insert the server menus
00792                 //@@WTK WIN32, UNICODE
00793                 //InsertMenu( m_hmenuShared, nFirstGroup, MF_BYPOSITION | MF_POPUP, m_lpDoc->GetApp()->GetColorMenu(), "&Color");
00794                 InsertMenu( m_hmenuShared, nFirstGroup, MF_BYPOSITION | MF_POPUP,
00795                         (UINT)m_lpDoc->GetApp()->GetColorMenu(), "&Color");
00796                 menugroupwidths.width[1] = 1;
00797                 menugroupwidths.width[3] = 0;
00798                 menugroupwidths.width[5] = 0;
00799                 }
00800         else
00801                 {
00802                 // Destroy the menu resource
00803                 DestroyMenu(m_hmenuShared);
00804                 m_hmenuShared = NULL;
00805                 }
00806
00807         // tell OLE to create the menu descriptor
00808         m_hOleMenu = OleCreateMenuDescriptor(m_hmenuShared, &menugroupwidths);
00809 }
00810
00811 //**********************************************************************
00812 //
00813 // CSimpSvrObj::AddFrameLevelUI
00814 //
00815 // Purpose:
00816 //
00817 //      Adds the Frame level user interface
00818 //
00819 // Parameters:
00820 //
00821 //      None
00822 //
00823 // Return Value:
00824 //
00825 //      None
00826 //
00827 // Function Calls:
00828 //      Function                    Location
00829 //
00830 //      OutputDebugString                   Windows API
00831 //      IOleInPlaceFrame::SetMenu           Container
00832 //      IOleInPlaceFrame::SetBorderSpace    Container
00833 //      IOleInPlaceUIWindow::SetBorderSpace Container
00834 //      CSimpSvrDoc::GethDocWnd             DOC.H
00835 //
00836 // Comments:
00837 //
00838 //
00839 //********************************************************************
00840
00841 void CSimpSvrObj::AddFrameLevelUI()
00842 {
00843         OutputDebugString("In CSimpSvrObj::AddFrameLevelUI\r\n");
00844
00845         // add the combined menu
00846         m_lpFrame->SetMenu(m_hmenuShared, m_hOleMenu, m_lpDoc->GethDocWnd());
00847
00848         // do hatched border
00849         SetParent (m_lpDoc->GethHatchWnd(), m_hWndParent);
00850         SetParent (m_lpDoc->GethDocWnd(), m_lpDoc->GethHatchWnd());
00851
00852         // set the border space.  Normally we would negotiate for toolbar
00853         // space at this point.  Since this server doesn't have a toolbar,
00854         // this isn't needed...
00855         if (m_lpFrame)
00856                 m_lpFrame->SetBorderSpace(NULL);
00857
00858         if (m_lpCntrDoc)
00859                 m_lpCntrDoc->SetBorderSpace(NULL);
00860 }
00861
00862 //**********************************************************************
00863 //
00864 // CSimpSvrObj::DoInPlaceHide
00865 //
00866 // Purpose:
00867 //
00868 //      Hides the object while inplace actvie
00869 //
00870 // Parameters:
00871 //
00872 //      None
00873 //
00874 // Return Value:
00875 //
00876 //      None
00877 //
00878 // Function Calls:
00879 //      Function                        Location
00880 //
00881 //      OutputDebugString               Windows API
00882 //      SetParent                       Windows API
00883 //      CSimpSvrDoc::GethDocWnd         DOC.H
00884 //      CSimpSvrDoc::GethAppWnd         DOC.H
00885 //      CSimpSvrDoc::GethHatchWnd       DOC.H
00886 //      CSimpSvrObj::DisassembleMenus   OBJ.CPP
00887 //      IOleInPlaceFrame::Release       Container
00888 //      IOleInPlaceUIWindow::Release    Container
00889 //
00890 //
00891 // Comments:
00892 //
00893 //      Be sure to read TECHNOTES.WRI included with the OLE SDK
00894 //      for details on implementing inplace activation.
00895 //
00896 //********************************************************************
00897
00898 void CSimpSvrObj::DoInPlaceHide()
00899 {
00900         OutputDebugString("In CSimpSvrObj::DoInPlaceHide\r\n");
00901
00902         // if we aren't inplace visible, then this routine is a NOP,
00903         if (!m_fInPlaceVisible)
00904                 return;
00905
00906         m_fInPlaceVisible = FALSE;
00907
00908         // change the parenting
00909         SetParent (m_lpDoc->GethDocWnd(), m_lpDoc->GethAppWnd());
00910         SetParent (m_lpDoc->GethHatchWnd(),m_lpDoc->GethDocWnd());
00911
00912         // rip down the combined menus
00913         DisassembleMenus();
00914
00915         // release the inplace frame
00916         m_lpFrame->Release();
00917
00918         m_lpFrame = NULL;  // only holding one ref. to frame.
00919
00920         // release the UIWindow if it is there.
00921         if (m_lpCntrDoc)
00922                 m_lpCntrDoc->Release();
00923
00924         m_lpCntrDoc = NULL;
00925
00926 }
00927
00928 //**********************************************************************
00929 //
00930 // CSimpSvrObj::DisassembleMenus
00931 //
00932 // Purpose:
00933 //
00934 //      Disassembles the combined menus used in inplace activation
00935 //
00936 // Parameters:
00937 //
00938 //      None
00939 //
00940 // Return Value:
00941 //
00942 //      None
00943 //
00944 // Function Calls:
00945 //      Function                    Location
00946 //
00947 //      OutputDebugString               Windows API
00948 //      OleDestroyMenuDescriptor        OLE API
00949 //      RemoveMenu                      Windows API
00950 //      IOleInPlaceFrame::RemoveMenus   Container
00951 //      DestroyMenu                     Windows API
00952 //
00953 // Comments:
00954 //
00955 //      Be sure to read TECHNOTES.WRI included with the OLE SDK
00956 //      for details on implementing inplace activation.
00957 //
00958 //********************************************************************
00959
00960 void CSimpSvrObj::DisassembleMenus()
00961 {
00962         // destroy the menu descriptor
00963         OleDestroyMenuDescriptor(m_hOleMenu);
00964
00965         if (m_hmenuShared)
00966                 {
00967                 // remove the menus that we added
00968                 RemoveMenu( m_hmenuShared, 1, MF_BYPOSITION);
00969
00970                 // have the container remove its menus
00971                 m_lpFrame->RemoveMenus(m_hmenuShared);
00972
00973                 // Destroy the menu resource
00974                 DestroyMenu(m_hmenuShared);
00975
00976                 m_hmenuShared = NULL;
00977                 }
00978 }
00979
00980 //**********************************************************************
00981 //
00982 // CSimpSvrObj::SendOnDataChange
00983 //
00984 // Purpose:
00985 //
00986 //      Uses the data advise holder to send a data change, then updates
00987 //      the ROT to note the time of change.
00988 //
00989 // Parameters:
00990 //
00991 //      None
00992 //
00993 // Return Value:
00994 //
00995 //      None
00996 //
00997 // Function Calls:
00998 //      Function                                Location
00999 //
01000 //      IDataAdviseHolder::SendOnDataChange     OLE API
01001 //      GetRunningObjectTable                   OLE API
01002 //      CoFileTimeNow                           OLE API
01003 //      IRunningObjectTable::NoteChangeTime     OLE API
01004 //
01005 // Comments:
01006 //
01007 //
01008 //********************************************************************
01009
01010 void CSimpSvrObj::SendOnDataChange()
01011 {
01012         if (m_lpDataAdviseHolder)
01013                 m_lpDataAdviseHolder->SendOnDataChange( (LPDATAOBJECT)&m_DataObject, 0, 0);
01014
01015         LPRUNNINGOBJECTTABLE lpRot;
01016
01017         GetRunningObjectTable(0, &lpRot);
01018
01019         if ( lpRot && m_dwRegister)
01020                 {
01021                 FILETIME ft;
01022                 CoFileTimeNow(&ft);
01023
01024                 lpRot->NoteChangeTime(m_dwRegister, &ft);
01025                 lpRot->Release();
01026                 }
01027 }
01028
01029 //**********************************************************************
01030 //
01031 // CSimpSvrObj::DeactivateUI
01032 //
01033 // Purpose:
01034 //
01035 //      Breaks down the inplace ui
01036 //
01037 // Parameters:
01038 //
01039 //      None
01040 //
01041 // Return Value:
01042 //
01043 //      None
01044 //
01045 // Function Calls:
01046 //      Function                                Location
01047 //
01048 //      SetParent                               Windows API
01049 //      IOleInPlaceUIWindow::SetActiveObject    Container
01050 //      IOleInPlaceFrame::SetActiveObject       Container
01051 //      IOleInPlaceSite::UIDeactivate           Container
01052 //
01053 // Comments:
01054 //
01055 //
01056 //********************************************************************
01057
01058 void CSimpSvrObj::DeactivateUI()
01059 {
01060         // if not UI active, or no pointer to IOleInPlaceFrame, then
01061         // return NOERROR
01062         if (!(m_fUIActive || m_lpFrame))
01063                 return;
01064         else
01065                 {
01066                 m_fUIActive = FALSE;
01067
01068                 // remove hatching
01069                 SetParent (m_lpDoc->GethDocWnd(), m_lpDoc->GethAppWnd());
01070                 SetParent (m_lpDoc->GethHatchWnd(),m_lpDoc->GethDocWnd());
01071
01072                 // if in an MDI container, call SetActiveObject on the DOC.
01073                 if (m_lpCntrDoc)
01074                         m_lpCntrDoc->SetActiveObject(NULL, NULL);
01075
01076                 m_lpFrame->SetActiveObject(NULL, NULL);
01077
01078                 // tell the container that our UI is going away.
01079                 if (m_lpIPSite)
01080                         m_lpIPSite->OnUIDeactivate(FALSE);
01081                 }
01082 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/theprovider.cpp Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

theprovider.cpp

Go to the documentation of this file.
00001 // TheProvider.cpp : Implementation of DLL Exports.
00002
00003
00004 // Note: Proxy/Stub Information
00005 //      To build a separate proxy/stub DLL,
00006 //      run nmake -f TheProviderps.mk in the project directory.
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 #include <initguid.h>
00011 #include "TheProvider.h"
00012
00013 #include "TheProvider_i.c"
00014 #include "MSOmniProvSess.h"
00015 #include "MSOmniProvDS.h"
00016
00017
00018 CComModule _Module;
00019
00020 BEGIN_OBJECT_MAP(ObjectMap)
00021 OBJECT_ENTRY(CLSID_MSOmniProv, CMSOmniProvSource)
00022 END_OBJECT_MAP()
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // DLL Entry Point
00026
00027 extern "C"
00028 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00029 {
00030     if (dwReason == DLL_PROCESS_ATTACH)
00031     {
00032         _Module.Init(ObjectMap, hInstance, &LIBID_THEPROVIDERLib);
00033         DisableThreadLibraryCalls(hInstance);
00034     }
00035     else if (dwReason == DLL_PROCESS_DETACH)
00036         _Module.Term();
00037     return TRUE;    // ok
00038 }
00039
00040 /////////////////////////////////////////////////////////////////////////////
00041 // Used to determine whether the DLL can be unloaded by OLE
00042
00043 STDAPI DllCanUnloadNow(void)
00044 {
00045     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00046 }
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049 // Returns a class factory to create an object of the requested type
00050
00051 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00052 {
00053     return _Module.GetClassObject(rclsid, riid, ppv);
00054 }
00055
00056 /////////////////////////////////////////////////////////////////////////////
00057 // DllRegisterServer - Adds entries to the system registry
00058
00059 STDAPI DllRegisterServer(void)
00060 {
00061     // registers object, typelib and all interfaces in typelib
00062     return _Module.RegisterServer(TRUE);
00063 }
00064
00065 /////////////////////////////////////////////////////////////////////////////
00066 // DllUnregisterServer - Removes entries from the system registry
00067
00068 STDAPI DllUnregisterServer(void)
00069 {
00070     return _Module.UnregisterServer(TRUE);
00071 }
00072
00073
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/land.h Source File

  • SysMgmt
  • MMC
  • Toolbar

land.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _LAND_H
00021 #define _LAND_H
00022
00023 #include "DeleBase.h"
00024
00025 class CLandBasedVehicle : public CDelegationBase {
00026 public:
00027     CLandBasedVehicle(CComponentData *pComponentData = NULL)
00028     { m_pComponentData = pComponentData; }
00029
00030     virtual ~CLandBasedVehicle() {}
00031
00032     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Land-based Vehicles"); }
00033     virtual const GUID & getNodeType() { return thisGuid; }
00034     virtual const int GetBitmapIndex() { return INDEX_LANDICON; }
00035
00036 public:
00037     // virtual functions go here (for MMCN_*)
00038
00039 private:
00040     enum { IDM_NEW_LAND = 2 };
00041
00042     // {2974380E-4C4B-11d2-89D8-000021473128}
00043     static const GUID thisGuid;
00044 };
00045
00046 #endif // _LAND_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Sock_Info Member List

This is the complete list of members for Sock_Info, including all inherited members.
next | Sock_Info
prev | Sock_Info
protocol | Sock_Info
socket | Sock_Info
socket_type | Sock_Info
thread | Sock_Info
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmMonitor/StdAfx.h Source File

  • Com
  • Services
  • Crm
  • CrmMonitor

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__1721CAB8_E9BA_11D1_A8D7_00A0C91EEDE9__INCLUDED_)
00006 #define AFX_STDAFX_H__1721CAB8_E9BA_11D1_A8D7_00A0C91EEDE9__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012 #define STRICT
00013
00014
00015 #if !defined(_WIN32_WINNT)
00016 #define _WIN32_WINNT 0x0500
00017 #endif // !defined(_WIN32_WINNT)
00018
00019 #define _ATL_APARTMENT_THREADED
00020
00021
00022 #include <atlbase.h>
00023 //You may derive a class from CComModule and use it if you want to override
00024 //something, but do not change the name of _Module
00025 extern CComModule _Module;
00026 #include <atlcom.h>
00027
00028 //{{AFX_INSERT_LOCATION}}
00029 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00030
00031 #endif // !defined(AFX_STDAFX_H__1721CAB8_E9BA_11D1_A8D7_00A0C91EEDE9__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/ClipBook Server.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

ClipBook Server.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ClipBook Server.cpp
00007 //
00008 //  Description:
00009 //      Resource DLL for ClipBook Server (ClipBook Server).
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 #include "ClRes.h"
00021
00022 //
00023 // Type and constant definitions.
00024 //
00025
00026 typedef struct _CLIPBOOKSERVER_RESOURCE
00027 {
00028     RESID                   resid;          // For validation.
00029     HCLUSTER                hCluster;
00030     HRESOURCE               hResource;
00031     SC_HANDLE               hService;
00032     DWORD                   dwProcessId;
00033     HKEY                    hkeyParameters;
00034     RESOURCE_HANDLE         hResourceHandle;
00035     LPWSTR                  pwszResourceName;
00036     CLUS_WORKER             cwWorkerThread;
00037     CLUSTER_RESOURCE_STATE  state;
00038 } CLIPBOOKSERVER_RESOURCE, * PCLIPBOOKSERVER_RESOURCE;
00039
00040
00041 ///////////////////////////////////////////////////////////////////////////////
00042 // Global data.
00043 ///////////////////////////////////////////////////////////////////////////////
00044
00045 //
00046 //  Forward reference to our RESAPI function table.
00047 //
00048
00049 extern CLRES_FUNCTION_TABLE g_ClipBookServerFunctionTable;
00050
00051 //
00052 //  Single instance semaphore.
00053 //
00054
00055 #define CLIPBOOKSERVER_SINGLE_INSTANCE_SEMAPHORE L"Cluster_ClipBookServer_Semaphore"
00056 static HANDLE g_hSingleInstanceSemaphoreClipBookServer = NULL;
00057 static PCLIPBOOKSERVER_RESOURCE g_pSingleInstanceResourceClipBookServer = NULL;
00058
00059
00060
00061 //
00062 // Function prototypes.
00063 //
00064
00065 RESID WINAPI
00066 ClipBookServerOpen(
00067       LPCWSTR           pwszResourceNameIn
00068     , HKEY              hkeyResourceKeyIn
00069     , RESOURCE_HANDLE   hResourceHandleIn
00070     );
00071
00072 void WINAPI
00073 ClipBookServerClose(
00074     RESID residIn
00075     );
00076
00077 DWORD WINAPI
00078 ClipBookServerOnline(
00079       RESID     residIn
00080     , PHANDLE   phEventHandleInout
00081     );
00082
00083 DWORD WINAPI
00084 ClipBookServerOnlineThread(
00085       PCLUS_WORKER              pWorkerIn
00086     , PCLIPBOOKSERVER_RESOURCE   pResourceEntryIn
00087     );
00088
00089 DWORD WINAPI
00090 ClipBookServerOffline(
00091     RESID residIn
00092     );
00093
00094 DWORD WINAPI
00095 ClipBookServerOfflineThread(
00096       PCLUS_WORKER              pWorkerIn
00097     , PCLIPBOOKSERVER_RESOURCE   pResourceEntryIn
00098     );
00099
00100 void WINAPI
00101 ClipBookServerTerminate(
00102     RESID residIn
00103     );
00104
00105 BOOL WINAPI
00106 ClipBookServerLooksAlive(
00107     RESID residIn
00108     );
00109
00110 BOOL WINAPI
00111 ClipBookServerIsAlive(
00112     RESID residIn
00113     );
00114
00115 BOOL
00116 ClipBookServerCheckIsAlive(
00117       PCLIPBOOKSERVER_RESOURCE   pResourceEntryIn
00118     , BOOL                      fFullCheckIn
00119     );
00120
00121 DWORD WINAPI
00122 ClipBookServerResourceControl(
00123       RESID     residIn
00124     , DWORD     nControlCodeIn
00125     , PVOID     pInBufferIn
00126     , DWORD     cbInBufferSizeIn
00127     , PVOID     pOutBufferOut
00128     , DWORD     cbOutBufferSizeIn
00129     , LPDWORD   pcbBytesReturnedOut
00130     );
00131
00132 DWORD
00133 ClipBookServerGetRequiredDependencies(
00134       PVOID     pOutBufferOut
00135     , DWORD     cbOutBufferSizeIn
00136     , LPDWORD   pcbBytesReturnedOut
00137     );
00138
00139 DWORD
00140 ClipBookServerVerifyRequiredDependencies(
00141     PCLIPBOOKSERVER_RESOURCE pResourceEntryIn
00142     );
00143
00144 DWORD
00145 ClipBookServerSetNameHandler(
00146       PCLIPBOOKSERVER_RESOURCE   pResourceEntryIn
00147     , LPWSTR                    pwszNameIn
00148     );
00149
00150
00151 /////////////////////////////////////////////////////////////////////////////
00152 //++
00153 //
00154 //  ClipBookServerDllMain
00155 //
00156 //  Description:
00157 //      Main DLL entry point for the ClipBook Server resource type.
00158 //
00159 //  Arguments:
00160 //      hDllHandleIn
00161 //          DLL instance handle.
00162 //
00163 //      nReasonIn
00164 //          Reason for being called.
00165 //
00166 //      ReservedIn
00167 //          Reserved argument.
00168 //
00169 //  Return Value:
00170 //      TRUE
00171 //          Success.
00172 //
00173 //      FALSE
00174 //          Failure.
00175 //
00176 //--
00177 /////////////////////////////////////////////////////////////////////////////
00178 BOOL WINAPI
00179 ClipBookServerDllMain(
00180       HINSTANCE hDllHandleIn
00181     , DWORD     nReasonIn
00182     , LPVOID    ReservedIn
00183     )
00184 {
00185     BOOL    fSuccess = TRUE;
00186     DWORD   sc = ERROR_SUCCESS;
00187
00188     UNREFERENCED_PARAMETER( hDllHandleIn );
00189     UNREFERENCED_PARAMETER( ReservedIn );
00190
00191     switch ( nReasonIn )
00192     {
00193         case DLL_PROCESS_ATTACH:
00194             g_hSingleInstanceSemaphoreClipBookServer = CreateSemaphoreW(
00195                   NULL
00196                 , 0
00197                 , 1
00198                 , CLIPBOOKSERVER_SINGLE_INSTANCE_SEMAPHORE
00199                 );
00200             sc = GetLastError();
00201             if ( g_hSingleInstanceSemaphoreClipBookServer == NULL )
00202             {
00203                 fSuccess = FALSE;
00204                 goto Cleanup;
00205             } // if: error creating semaphore
00206
00207             if ( sc != ERROR_ALREADY_EXISTS )
00208             {
00209                 // If the semaphore didnt exist, set its initial count to 1.
00210                 ReleaseSemaphore( g_hSingleInstanceSemaphoreClipBookServer, 1, NULL );
00211             } // if: semaphore didn't already exist
00212
00213             break;
00214
00215         case DLL_PROCESS_DETACH:
00216             if ( g_hSingleInstanceSemaphoreClipBookServer != NULL )
00217             {
00218                 CloseHandle( g_hSingleInstanceSemaphoreClipBookServer );
00219                 g_hSingleInstanceSemaphoreClipBookServer = NULL;
00220             } // if: single instance semaphore was created
00221
00222             if ( g_schSCMHandle != NULL )
00223             {
00224                 CloseServiceHandle( g_schSCMHandle );
00225                 g_schSCMHandle = NULL;
00226             } // if: global SCM handle was opened
00227
00228             break;
00229
00230     } // switch: nReason
00231
00232 Cleanup:
00233
00234     return fSuccess;
00235
00236 } //*** ClipBookServerDllMain
00237
00238
00239 /////////////////////////////////////////////////////////////////////////////
00240 //++
00241 //
00242 //  ClipBookServerStartup
00243 //
00244 //  Description:
00245 //      Startup the resource DLL for the ClipBook Server resource type.
00246 //      This routine verifies that at least one currently supported version
00247 //      of the resource DLL is between nMinVersionSupported and
00248 //      nMaxVersionSupported. If not, then the resource DLL should return
00249 //      ERROR_REVISION_MISMATCH.
00250 //
00251 //      If more than one version of the resource DLL interface is supported
00252 //      by the resource DLL, then the highest version (up to
00253 //      nMaxVersionSupported) should be returned as the resource DLL's
00254 //      interface. If the returned version is not within range, then startup
00255 //      fails.
00256 //
00257 //      The Resource Type is passed in so that if the resource DLL supports
00258 //      more than one Resource Type, it can pass back the correct function
00259 //      table associated with the Resource Type.
00260 //
00261 //  Arguments:
00262 //      pwszResourceTypeIn
00263 //          Type of resource requesting a function table.
00264 //
00265 //      nMinVersionSupportedIn
00266 //          Minimum resource DLL interface version supported by the cluster
00267 //          software.
00268 //
00269 //      nMaxVersionSupportedIn
00270 //          Maximum resource DLL interface version supported by the cluster
00271 //          software.
00272 //
00273 //      pfnSetResourceStatusIn
00274 //          Pointer to a routine that the resource DLL should call to update
00275 //          the state of a resource after the Online or Offline routine
00276 //          have returned a status of ERROR_IO_PENDING.
00277 //
00278 //      pfnLogEventIn
00279 //          Pointer to a routine that handles the reporting of events from
00280 //          the resource DLL.
00281 //
00282 //      pFunctionTableIn
00283 //          Returns a pointer to the function table defined for the version
00284 //          of the resource DLL interface returned by the resource DLL.
00285 //
00286 //  Return Value:
00287 //      ERROR_SUCCESS
00288 //          The operation was successful.
00289 //
00290 //      ERROR_CLUSTER_RESNAME_NOT_FOUND
00291 //          The resource type name is unknown by this DLL.
00292 //
00293 //      ERROR_REVISION_MISMATCH
00294 //          The version of the cluster service doesn't match the version of
00295 //          the DLL.
00296 //
00297 //      Win32 error code
00298 //          The operation failed.
00299 //
00300 //--
00301 /////////////////////////////////////////////////////////////////////////////
00302 DWORD WINAPI
00303 ClipBookServerStartup(
00304       LPCWSTR                       pwszResourceTypeIn
00305     , DWORD                         nMinVersionSupportedIn
00306     , DWORD                         nMaxVersionSupportedIn
00307     , PSET_RESOURCE_STATUS_ROUTINE  pfnSetResourceStatusIn
00308     , PLOG_EVENT_ROUTINE            pfnLogEventIn
00309     , PCLRES_FUNCTION_TABLE *       pFunctionTableOut
00310     )
00311 {
00312     DWORD sc = ERROR_SUCCESS;
00313
00314     // These are stored in the calling DllMain.
00315     UNREFERENCED_PARAMETER( pfnSetResourceStatusIn );
00316     UNREFERENCED_PARAMETER( pfnLogEventIn );
00317
00318     if (   (nMinVersionSupportedIn > CLRES_VERSION_V1_00)
00319         || (nMaxVersionSupportedIn < CLRES_VERSION_V1_00) )
00320     {
00321         sc = ERROR_REVISION_MISMATCH;
00322     } // if: version not supported
00323     else if ( NIStringCompareW( pwszResourceTypeIn, RESTYPE_NAME, RTL_NUMBER_OF( RESTYPE_NAME ) ) == 0 )
00324     {
00325         *pFunctionTableOut = &g_ClipBookServerFunctionTable;
00326         sc = ERROR_SUCCESS;
00327     } // else if: we support this type of resource
00328     else
00329     {
00330         //
00331         // We don't support this resource type.
00332         //
00333
00334         sc = ERROR_CLUSTER_RESNAME_NOT_FOUND;
00335     } // else: resource type name not supported
00336
00337     return sc;
00338
00339 } //*** ClipBookServerStartup
00340
00341
00342 /////////////////////////////////////////////////////////////////////////////
00343 //++
00344 //
00345 //  ClipBookServerOpen
00346 //
00347 //  Description:
00348 //      Open routine for ClipBook Server resources.
00349 //
00350 //      Open the specified resource (create an instance of the resource).
00351 //      Allocate all structures necessary to bring the specified resource
00352 //      online.
00353 //
00354 //  Arguments:
00355 //      pwszResourceNameIn
00356 //          Supplies the name of the resource to open.
00357 //
00358 //      hkeyResourceKeyIn
00359 //                  Supplies handle to the resource's cluster database key.
00360 //
00361 //      hResourceHandleIn
00362 //          A handle that is passed back to the Resource Monitor when the
00363 //          SetResourceStatus or LogEvent method is called.  See the
00364 //          description of the pfnSetResourceStatus and pfnLogEvent arguments
00365 //          to the ClipBookServerStartup routine.  This handle should never be
00366 //          closed or used for any purpose other than passing it as an
00367 //          argument back to the Resource Monitor in the SetResourceStatus or
00368 //          LogEvent callbacks.
00369 //
00370 //  Return Value:
00371 //      resid
00372 //          RESID of opened resource.
00373 //
00374 //      NULL
00375 //          Error occurred opening the resource.  Resource Monitor may call
00376 //          GetLastError() to get more details on the error.
00377 //
00378 //--
00379 /////////////////////////////////////////////////////////////////////////////
00380 RESID WINAPI
00381 ClipBookServerOpen(
00382       LPCWSTR           pwszResourceNameIn
00383     , HKEY              hkeyResourceKeyIn
00384     , RESOURCE_HANDLE   hResourceHandleIn
00385     )
00386 {
00387     DWORD                   sc = ERROR_SUCCESS;
00388     size_t                  cchBuffer = 0;
00389     RESID                   resid = NULL;
00390     HKEY                    hkeyParameters = NULL;
00391     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
00392     SC_HANDLE               hService = NULL;
00393     HRESULT                 hr = S_OK;
00394
00395     //
00396     // Check if more than one resource of this type.
00397     //
00398
00399     if ( WaitForSingleObject( g_hSingleInstanceSemaphoreClipBookServer, 0 ) == WAIT_TIMEOUT )
00400     {
00401         //
00402         // A resource of this type is already running.
00403         //
00404
00405         (g_pfnLogEvent)(
00406               hResourceHandleIn
00407             , LOG_ERROR
00408             , L"A resource of this type is already running.\n"
00409             );
00410         sc = ERROR_OBJECT_ALREADY_EXISTS;
00411         goto Cleanup;
00412     } // if: semaphore for resources of this type already already locked
00413
00414     if ( g_pSingleInstanceResourceClipBookServer != NULL )
00415     {
00416         (g_pfnLogEvent)(
00417               hResourceHandleIn
00418             , LOG_ERROR
00419             , L"Single instance resource already set!\n"
00420             );
00421         sc = ERROR_OBJECT_ALREADY_EXISTS;
00422         goto Cleanup;
00423     } // if: resource of this type already exists
00424
00425     //
00426     // Get a global handle to the Service Control Manager (SCM).
00427     //
00428
00429     if ( g_schSCMHandle == NULL )
00430     {
00431         g_schSCMHandle = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS );
00432         if ( g_schSCMHandle == NULL )
00433         {
00434             sc = GetLastError();
00435             (g_pfnLogEvent)(
00436                   hResourceHandleIn
00437                 , LOG_ERROR
00438                 , L"Failed to open Service Control Manager. Error: %1!u!.\n"
00439                 , sc
00440                 );
00441             goto Cleanup;
00442         } // if: error opening the Service Control Manager
00443     } // if: Service Control Manager not open yet
00444
00445     //
00446     // Make sure the service is ready to be controlled by the cluster.
00447     //
00448
00449     //
00450     // Note: We do this in Open so that as soon as the resource is created
00451     //       the service is configured for cluster service control.
00452     //
00453
00454     sc = ResUtilSetResourceServiceStartParameters(
00455               CLIPBOOKSERVER_SVCNAME
00456             , g_schSCMHandle
00457             , &hService
00458             , g_pfnLogEvent
00459             , hResourceHandleIn
00460             );
00461     if ( sc != ERROR_SUCCESS )
00462     {
00463         (g_pfnLogEvent)(
00464               hResourceHandleIn
00465             , LOG_ERROR
00466             , L"Failed to set the service start parameters for the '%1!s!' service. Error: %2!u!.\n"
00467             , CLIPBOOKSERVER_SVCNAME
00468             , sc
00469             );
00470         goto Cleanup;
00471     } // if:  error setting service start parameters
00472
00473     if ( hService != NULL )
00474     {
00475         CloseServiceHandle( hService );
00476         hService = NULL;
00477     } // if: hService is not NULL
00478
00479     //
00480     // Make sure the service has been stopped.
00481     //
00482
00483     sc = ResUtilStopResourceService( CLIPBOOKSERVER_SVCNAME );
00484     if ( sc != ERROR_SUCCESS )
00485     {
00486         (g_pfnLogEvent)(
00487               hResourceHandleIn
00488             , LOG_ERROR
00489             , L"Failed to stop the '%1!s!' service. Error: %2!u!.\n"
00490             , CLIPBOOKSERVER_SVCNAME
00491             , sc
00492             );
00493         goto Cleanup;
00494     } // if: error stopping the service
00495
00496     //
00497     // Open the Parameters registry key for this resource.
00498     //
00499
00500     sc = ClusterRegOpenKey(
00501               hkeyResourceKeyIn
00502             , L"Parameters"
00503             , KEY_ALL_ACCESS
00504             , &hkeyParameters
00505             );
00506     if ( sc != ERROR_SUCCESS )
00507     {
00508         (g_pfnLogEvent)(
00509               hResourceHandleIn
00510             , LOG_ERROR
00511             , L"Open: Unable to open Parameters key. Error: %1!u!.\n"
00512             , sc
00513             );
00514         goto Cleanup;
00515     } // if: error creating the Parameters key for the resource
00516
00517     //
00518     // Allocate a resource entry.
00519     //
00520
00521     pResourceEntry = new CLIPBOOKSERVER_RESOURCE;
00522     if ( pResourceEntry == NULL )
00523     {
00524         sc = GetLastError();
00525         (g_pfnLogEvent)(
00526               hResourceHandleIn
00527             , LOG_ERROR
00528             , L"Open: Unable to allocate resource entry structure. Error: %1!u!.\n"
00529             , sc
00530             );
00531         goto Cleanup;
00532     } // if: error allocating memory for the resource
00533
00534     //
00535     // Initialize the resource entry..
00536     //
00537
00538     ZeroMemory( pResourceEntry, sizeof( *pResourceEntry ) );
00539
00540     pResourceEntry->resid = static_cast< RESID >( pResourceEntry ); // for validation
00541     pResourceEntry->hResourceHandle = hResourceHandleIn;
00542     pResourceEntry->hkeyParameters = hkeyParameters;
00543     pResourceEntry->state = ClusterResourceOffline;
00544
00545     //
00546     // Save the name of the resource.
00547     //
00548
00549     cchBuffer = lstrlenW( pwszResourceNameIn ) + 1;
00550     pResourceEntry->pwszResourceName = new WCHAR[ cchBuffer ];
00551     if ( pResourceEntry->pwszResourceName == NULL )
00552     {
00553         sc = GetLastError();
00554         (g_pfnLogEvent)(
00555               hResourceHandleIn
00556             , LOG_ERROR
00557             , L"Open: Unable to allocate the resource name buffer. Error: %1!u!.\n"
00558             , sc
00559             );
00560         goto Cleanup;
00561     } // if: error allocating memory for the name.
00562
00563     hr = StringCchCopyW( pResourceEntry->pwszResourceName, cchBuffer, pwszResourceNameIn );
00564     if ( FAILED( hr ) )
00565     {
00566         sc = HRESULT_CODE( hr );
00567         (g_pfnLogEvent)(
00568               hResourceHandleIn
00569             , LOG_ERROR
00570             , L"Open: Unable to allocate the resource name buffer. Error: %1!u!.\n"
00571             , sc
00572             );
00573         goto Cleanup;
00574     } // if:
00575
00576     //
00577     // Open the cluster.
00578     //
00579
00580     pResourceEntry->hCluster = OpenCluster( NULL );
00581     if ( pResourceEntry->hCluster == NULL )
00582     {
00583         sc = GetLastError();
00584         (g_pfnLogEvent)(
00585               hResourceHandleIn
00586             , LOG_ERROR
00587             , L"Open: Unable to open the cluster. Error: %1!u!.\n"
00588             , sc
00589             );
00590         goto Cleanup;
00591     } // if: error opening the cluster
00592
00593     //
00594     // Open the resource.
00595     //
00596
00597     pResourceEntry->hResource = OpenClusterResource( pResourceEntry->hCluster, pwszResourceNameIn );
00598     if ( pResourceEntry->hResource == NULL )
00599     {
00600         sc = GetLastError();
00601         (g_pfnLogEvent)(
00602               hResourceHandleIn
00603             , LOG_ERROR
00604             , L"Open: Unable to open the resource. Error: %1!u!.\n"
00605             , sc
00606             );
00607         goto Cleanup;
00608     } // if: error opening the resource
00609
00610     //
00611     // Initialization for the resource.
00612     //
00613
00614     //
00615     // TODO: Add your custom resource open code here.
00616     //
00617
00618     resid = static_cast< RESID >( pResourceEntry );
00619     g_pSingleInstanceResourceClipBookServer = pResourceEntry;
00620     sc = ERROR_SUCCESS;
00621
00622 Cleanup:
00623
00624     if ( resid == NULL )
00625     {
00626         assert( sc != ERROR_SUCCESS );
00627
00628         (g_pfnLogEvent)(
00629               hResourceHandleIn
00630             , LOG_ERROR
00631             , L"Open: failed with error %1!u!.\n"
00632             , sc
00633             );
00634
00635         if ( hkeyParameters != NULL )
00636         {
00637             ClusterRegCloseKey( hkeyParameters );
00638         } // if:
00639
00640         if ( pResourceEntry != NULL )
00641         {
00642             if ( pResourceEntry->hResource != NULL )
00643             {
00644                 CloseClusterResource( pResourceEntry->hResource );
00645             } // if:
00646
00647             if ( pResourceEntry->hCluster != NULL )
00648             {
00649                 CloseCluster( pResourceEntry->hCluster );
00650             } // if:
00651
00652             delete [] pResourceEntry->pwszResourceName;
00653             delete pResourceEntry;
00654
00655         } // if: resource entry allocated
00656     } // if: something failed
00657
00658     if ( hService != NULL )
00659     {
00660         CloseServiceHandle( hService );
00661         hService = NULL;
00662     } // if: hService is not NULL
00663
00664     SetLastError( sc );
00665
00666     return resid;
00667
00668 } //*** ClipBookServerOpen
00669
00670
00671 /////////////////////////////////////////////////////////////////////////////
00672 //++
00673 //
00674 //  ClipBookServerClose
00675 //
00676 //  Description:
00677 //      Close routine for ClipBook Server resources.
00678 //
00679 //      Close the specified resource and deallocate all structures, etc.,
00680 //      allocated in the Open call.  If the resource is not in the offline
00681 //      state, then the resource should be taken offline (by calling
00682 //      Terminate) before the close operation is performed.
00683 //
00684 //  Arguments:
00685 //      residIn
00686 //          Supplies the resource ID  of the resource to close.
00687 //
00688 //  Return Value:
00689 //      None.
00690 //
00691 //--
00692 /////////////////////////////////////////////////////////////////////////////
00693 void WINAPI
00694 ClipBookServerClose(
00695     RESID residIn
00696     )
00697 {
00698     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
00699     DWORD                   sc = ERROR_SUCCESS;
00700
00701     //
00702     // Verify we have a valid resource ID.
00703     //
00704
00705     pResourceEntry = static_cast< PCLIPBOOKSERVER_RESOURCE >( residIn );
00706     if ( pResourceEntry == NULL )
00707     {
00708         DBG_PRINT( "ClipBookServer: Close request for a nonexistent resource id.\n" );
00709         sc = ERROR_RESOURCE_NOT_FOUND;
00710         goto Cleanup;
00711     } // if: NULL resource ID
00712
00713     if ( pResourceEntry->resid != residIn )
00714     {
00715         (g_pfnLogEvent)(
00716               pResourceEntry->hResourceHandle
00717             , LOG_ERROR
00718             , L"Close resource sanity check failed! resid = 0x%1!08x!.\n"
00719             , residIn
00720             );
00721         sc = ERROR_RESOURCE_NOT_FOUND;
00722         goto Cleanup;
00723     } // if: invalid resource ID
00724
00725     if ( pResourceEntry->pwszResourceName == NULL )
00726     {
00727         (g_pfnLogEvent)(
00728               pResourceEntry->hResourceHandle
00729             , LOG_INFORMATION
00730             , L"Close request for resource with resid 0x%1!08x!.\n"
00731             , residIn
00732             );
00733     } // if: resource name is null...
00734     else
00735     {
00736         (g_pfnLogEvent)(
00737               pResourceEntry->hResourceHandle
00738             , LOG_INFORMATION
00739             , L"Close request for resource '%1!s!'.\n"
00740             , pResourceEntry->pwszResourceName
00741             );
00742     } // else: resource name is not null...
00743
00744     //
00745     // Close the Parameters key.
00746     //
00747
00748     if ( pResourceEntry->hkeyParameters != NULL )
00749     {
00750         ClusterRegCloseKey( pResourceEntry->hkeyParameters );
00751         pResourceEntry->hkeyParameters = NULL;
00752     } // if: parameters key is open
00753
00754     //
00755     // Close the cluster handle.
00756     //
00757
00758     if ( pResourceEntry->hCluster != NULL )
00759     {
00760         CloseCluster( pResourceEntry->hCluster );
00761         pResourceEntry->hCluster = NULL;
00762     } // if: cluster handle is open
00763
00764     //
00765     // Close the resource handle.
00766     //
00767
00768     if ( pResourceEntry->hResource != NULL )
00769     {
00770         CloseClusterResource( pResourceEntry->hResource );
00771         pResourceEntry->hResource = NULL;
00772     } // if: resource handle is open
00773
00774     //
00775     // Clean up the semaphore if this is the single resource instance.
00776     //
00777
00778     if ( pResourceEntry == g_pSingleInstanceResourceClipBookServer )
00779     {
00780         (g_pfnLogEvent)(
00781               pResourceEntry->hResourceHandle
00782             , LOG_INFORMATION
00783             , L"Close: Setting semaphore '%1!s!'.\n"
00784             , CLIPBOOKSERVER_SINGLE_INSTANCE_SEMAPHORE
00785             );
00786         g_pSingleInstanceResourceClipBookServer = NULL;
00787         ReleaseSemaphore( g_hSingleInstanceSemaphoreClipBookServer, 1 , NULL );
00788     } // if: this is the single resource instance
00789
00790     //
00791     // Release the service handle in case it is still open.
00792     //
00793
00794     if ( pResourceEntry->hService != NULL )
00795     {
00796         CloseServiceHandle( pResourceEntry->hService );
00797         pResourceEntry->hService = NULL;
00798     } // if:
00799
00800     // ADDPARAM: Add new properties here.
00801
00802     //
00803     // The ResUtil API's use LocalAlloc, so use LocalFree on the prop list members.
00804     //
00805
00806
00807     //
00808     // Deallocate the resource entry.
00809     //
00810
00811     delete [] pResourceEntry->pwszResourceName;
00812     delete pResourceEntry;
00813
00814     sc = ERROR_SUCCESS;
00815
00816 Cleanup:
00817
00818     SetLastError( sc );
00819
00820     return;
00821
00822 } //*** ClipBookServerClose
00823
00824
00825 /////////////////////////////////////////////////////////////////////////////
00826 //++
00827 //
00828 //  ClipBookServerOnline
00829 //
00830 //  Description:
00831 //      Online routine for ClipBook Server resources.
00832 //
00833 //      Bring the specified resource online (available for use).  The resource
00834 //      DLL should attempt to arbitrate for the resource if it is present on
00835 //      a shared medium, like a shared SCSI bus.
00836 //
00837 //  Arguments:
00838 //      residIn
00839 //          Supplies the resource ID of the resource to be brought online
00840 //          (available for use).
00841 //
00842 //      phEventHandleOut
00843 //          Returns a signalable handle that is signaled when the resource DLL
00844 //          detects a failure on the resource.  This argument derferences as NULL
00845 //          on input, and the resource DLL returns NULL if asynchronous
00846 //          notification of failurs is not supported.  Otherwise this must be
00847 //          the address of a handle that is signaled on resource failures.
00848 //
00849 //  Return Value:
00850 //      ERROR_SUCCESS
00851 //          The operation was successful, and the resource is now online.
00852 //
00853 //      ERROR_RESOURCE_NOT_FOUND
00854 //          Resource ID is not valid.
00855 //
00856 //      ERROR_RESOURCE_NOT_AVAILABLE
00857 //          If the resource was arbitrated with some other systems and one of
00858 //          the other systems won the arbitration.
00859 //
00860 //      ERROR_IO_PENDING
00861 //          The request is pending.  A thread has been activated to process
00862 //          the online request.  The thread that is processing the online
00863 //          request will periodically report status by calling the
00864 //          SetResourceStatus callback method until the resource is placed
00865 //          into the ClusterResourceOnline state (or the resource monitor
00866 //          decides to timeout the online request and Terminate the resource.
00867 //          This pending timeout value is settable and has a default value of
00868 //          3 minutes.).
00869 //
00870 //      Win32 error code
00871 //          The operation failed.
00872 //
00873 //--
00874 /////////////////////////////////////////////////////////////////////////////
00875 DWORD WINAPI
00876 ClipBookServerOnline(
00877       RESID     residIn
00878     , PHANDLE   phEventHandleOut
00879     )
00880 {
00881     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
00882     DWORD                   sc = ERROR_SUCCESS;
00883
00884     UNREFERENCED_PARAMETER( phEventHandleOut );
00885
00886     //
00887     // Verify we have a valid resource ID.
00888     //
00889
00890     pResourceEntry = static_cast< PCLIPBOOKSERVER_RESOURCE >( residIn );
00891     if ( pResourceEntry == NULL )
00892     {
00893         DBG_PRINT( "ClipBook Server: Online request for a nonexistent resource id.\n" );
00894         return ERROR_RESOURCE_NOT_FOUND;
00895     } // if: NULL resource ID
00896
00897     if ( pResourceEntry->resid != residIn )
00898     {
00899         (g_pfnLogEvent)(
00900               pResourceEntry->hResourceHandle
00901             , LOG_ERROR
00902             , L"Online sanity check failed! resid = 0x%1!08x!.\n"
00903             , residIn
00904             );
00905         return ERROR_RESOURCE_NOT_FOUND;
00906     } // if: invalid resource ID
00907
00908     (g_pfnLogEvent)(
00909           pResourceEntry->hResourceHandle
00910         , LOG_INFORMATION
00911         , L"Online request.\n"
00912         );
00913
00914     //
00915     // Start the Online thread to perform the online operation.
00916     //
00917
00918     pResourceEntry->state = ClusterResourceOnlinePending;
00919     ClusWorkerTerminate( &pResourceEntry->cwWorkerThread );
00920     sc = ClusWorkerCreate(
00921               &pResourceEntry->cwWorkerThread
00922             , reinterpret_cast< PWORKER_START_ROUTINE >( ClipBookServerOnlineThread )
00923             , pResourceEntry
00924             );
00925     if ( sc != ERROR_SUCCESS )
00926     {
00927         pResourceEntry->state = ClusterResourceFailed;
00928         (g_pfnLogEvent)(
00929               pResourceEntry->hResourceHandle
00930             , LOG_ERROR
00931             , L"Online: Unable to start thread. Error: %1!u!.\n"
00932             , sc
00933             );
00934     } // if: error creating the worker thread
00935     else
00936     {
00937         sc = ERROR_IO_PENDING;
00938     } // if: worker thread created successfully
00939
00940     return sc;
00941
00942 } //*** ClipBookServerOnline
00943
00944
00945 /////////////////////////////////////////////////////////////////////////////
00946 //++
00947 //
00948 //  ClipBookServerOnlineThread
00949 //
00950 //  Description:
00951 //      Worker function which brings a resource online.
00952 //      This function is executed in a separate thread.
00953 //
00954 //  Arguments:
00955 //      pWorkerIn
00956 //          Supplies the worker thread structure.
00957 //
00958 //      pResourceEntryIn
00959 //          A pointer to the CLIPBOOKSERVER_RESOURCE block for this resource.
00960 //
00961 //  Return Value:
00962 //      ERROR_SUCCESS
00963 //          The operation completed successfully.
00964 //
00965 //      Win32 error code
00966 //          The operation failed.
00967 //
00968 //--
00969 /////////////////////////////////////////////////////////////////////////////
00970 DWORD WINAPI
00971 ClipBookServerOnlineThread(
00972       PCLUS_WORKER              pWorkerIn
00973     , PCLIPBOOKSERVER_RESOURCE   pResourceEntryIn
00974     )
00975 {
00976     RESOURCE_STATUS         resourceStatus;
00977     DWORD                   sc = ERROR_SUCCESS;
00978     DWORD                   nPrevCheckpoint;
00979     DWORD                   cbBytesNeeded;
00980     SERVICE_STATUS_PROCESS  ServiceStatus = { 0 };
00981     RESOURCE_EXIT_STATE     resExitState;
00982
00983     UNREFERENCED_PARAMETER( pWorkerIn );
00984
00985     ResUtilInitializeResourceStatus( &resourceStatus );
00986
00987     resourceStatus.ResourceState = ClusterResourceFailed;
00988     resourceStatus.WaitHint = 0;
00989     resourceStatus.CheckPoint = 1;
00990
00991     //
00992     // Parameter checking.
00993     //
00994
00995     if ( pResourceEntryIn == NULL )
00996     {
00997         sc = ERROR_INVALID_PARAMETER;
00998         goto Cleanup;
00999     } // if:
01000
01001     //
01002     // If we require dependencies them make sure we have them set.
01003     //
01004
01005     sc = ClipBookServerVerifyRequiredDependencies( pResourceEntryIn );
01006     if ( sc != ERROR_SUCCESS )
01007     {
01008         (g_pfnLogEvent)(
01009               pResourceEntryIn->hResourceHandle
01010             , LOG_ERROR
01011             , L"OnlineThread: Required dependency not found. Error: %1!u!.\n"
01012             , sc
01013             );
01014         goto Cleanup;
01015     } // if: required dependencies are missing
01016
01017     //
01018     // Create the new environment with the simulated net name when the
01019     // services queries GetComputerName.
01020     //
01021
01022     if ( ClusWorkerCheckTerminate( pWorkerIn ) == TRUE )
01023     {
01024         goto Cleanup;
01025     } // if: terminating
01026
01027     sc = ResUtilSetResourceServiceEnvironment(
01028               CLIPBOOKSERVER_SVCNAME
01029             , pResourceEntryIn->hResource
01030             , g_pfnLogEvent
01031             , pResourceEntryIn->hResourceHandle
01032             );
01033     if ( sc != ERROR_SUCCESS )
01034     {
01035         (g_pfnLogEvent)(
01036               pResourceEntryIn->hResourceHandle
01037             , LOG_ERROR
01038             , L"OnlineThread: Failed to set service environment. Error: %1!u!.\n"
01039             , sc
01040             );
01041         goto Cleanup;
01042     } // if: error setting the environment for the service
01043
01044     //
01045     // Stop the service if it's running since we are about to change
01046     // its parameters.
01047     //
01048
01049     sc = ResUtilStopResourceService( CLIPBOOKSERVER_SVCNAME );
01050     if ( sc != ERROR_SUCCESS )
01051     {
01052         (g_pfnLogEvent)(
01053               pResourceEntryIn->hResourceHandle
01054             , LOG_ERROR
01055             , L"OnlineThread: Failed to stop the '%1!s!' service. Error: %2!u!.\n"
01056             , CLIPBOOKSERVER_SVCNAME
01057             , sc
01058             );
01059         goto Cleanup;
01060     } // if: error stopping the service
01061
01062     //
01063     // Make sure the service is ready to be controlled by the cluster.
01064     //
01065
01066     if ( ClusWorkerCheckTerminate( pWorkerIn ) == TRUE )
01067     {
01068         goto Cleanup;
01069     } // if: terminating
01070
01071     sc = ResUtilSetResourceServiceStartParameters(
01072               CLIPBOOKSERVER_SVCNAME
01073             , g_schSCMHandle
01074             , &pResourceEntryIn->hService
01075             , g_pfnLogEvent
01076             , pResourceEntryIn->hResourceHandle
01077             );
01078     if ( sc != ERROR_SUCCESS )
01079     {
01080         (g_pfnLogEvent)(
01081               pResourceEntryIn->hResourceHandle
01082             , LOG_ERROR
01083             , L"OnlineThread: Failed to set service start parameters. Error: %1!u!.\n"
01084             , sc
01085             );
01086         goto Cleanup;
01087     } // if:  error setting service start parameters
01088
01089     //
01090     // Perform resource-specific initialization before starting the service.
01091     //
01092
01093     //
01094     // TODO: Add code to initialize the resource before starting the service.
01095     //
01096
01097     //
01098     // Start the service.
01099     //
01100
01101     if ( ! StartServiceW( pResourceEntryIn->hService, 0, NULL ) )
01102     {
01103         sc = GetLastError();
01104         if ( sc != ERROR_SERVICE_ALREADY_RUNNING )
01105         {
01106             //
01107             //  TODO: Log event to the event log.
01108             //
01109
01110             (g_pfnLogEvent)(
01111                   pResourceEntryIn->hResourceHandle
01112                 , LOG_ERROR
01113                 , L"OnlineThread: Failed to start the '%1!s!' service. Error: %2!u!.\n"
01114                 , CLIPBOOKSERVER_SVCNAME
01115                 , sc
01116                 );
01117             sc = ERROR_SERVICE_NEVER_STARTED;
01118             goto Cleanup;
01119         } // if: error other than service already running occurred
01120     } // if: error starting the service
01121
01122     //
01123     // Query the status of the service in a loop until it leaves
01124     // the pending state.
01125     //
01126
01127     sc = ERROR_SUCCESS;
01128     resourceStatus.ResourceState = ClusterResourceOnlinePending;
01129     nPrevCheckpoint = 0;
01130     while ( ! ClusWorkerCheckTerminate( pWorkerIn ) )
01131     {
01132         //
01133         // Query the service status.
01134         //
01135
01136         if ( ! QueryServiceStatusEx(
01137                   pResourceEntryIn->hService
01138                 , SC_STATUS_PROCESS_INFO
01139                 , reinterpret_cast< LPBYTE >( &ServiceStatus )
01140                 , sizeof( SERVICE_STATUS_PROCESS )
01141                 , &cbBytesNeeded
01142                 )
01143            )
01144         {
01145             sc = GetLastError();
01146             (g_pfnLogEvent)(
01147                   pResourceEntryIn->hResourceHandle
01148                 , LOG_ERROR
01149                 , L"OnlineThread: Failed to query service status for the '%1!s!' service. Error: %2!u!.\n"
01150                 , CLIPBOOKSERVER_SVCNAME
01151                 , sc
01152                 );
01153             resourceStatus.ResourceState = ClusterResourceFailed;
01154             goto Cleanup;
01155         } // if: error querying service status
01156
01157         //
01158         // If the service is no longer pending, we are done.
01159         //
01160
01161         if ( ServiceStatus.dwCurrentState != SERVICE_START_PENDING )
01162         {
01163             break;
01164         } // if: service state is not pending
01165
01166         //
01167         // If the service checkpoint value changed, use it when notifying
01168         // the Resource Monitor of our current status.
01169         //
01170
01171         if ( nPrevCheckpoint != ServiceStatus.dwCheckPoint )
01172         {
01173             nPrevCheckpoint = ServiceStatus.dwCheckPoint;
01174             resourceStatus.CheckPoint++;
01175         } // if:
01176
01177         //
01178         // Notify the Resource Monitor of our current state.
01179         //
01180
01181         resExitState = static_cast< RESOURCE_EXIT_STATE >(
01182             (g_pfnSetResourceStatus)(
01183                   pResourceEntryIn->hResourceHandle
01184                 , &resourceStatus
01185                 )
01186             );
01187         if ( resExitState != ResourceExitStateContinue )
01188         {
01189             goto Cleanup;
01190         } // if: resource is being terminated
01191
01192         //
01193         // Check again in 1/2 second.
01194         //
01195
01196         Sleep( 500 );
01197     } // while: not terminating while querying the status of the service
01198
01199     //
01200     // Assume that we failed.
01201     //
01202
01203     resourceStatus.ResourceState = ClusterResourceFailed;
01204
01205     //
01206     // If we exited the loop before setting ServiceStatus, then return now.
01207     //
01208
01209     if ( ClusWorkerCheckTerminate( pWorkerIn ) == TRUE )
01210     {
01211         goto Cleanup;
01212     } // if: being terminated
01213
01214     if ( ServiceStatus.dwCurrentState != SERVICE_RUNNING )
01215     {
01216         sc = ERROR_SERVICE_NEVER_STARTED;
01217
01218         //
01219         // TODO: Log event to the event log
01220         //
01221
01222         (g_pfnLogEvent)(
01223               pResourceEntryIn->hResourceHandle
01224             , LOG_ERROR
01225             , L"OnlineThread: Failed to start the '%1!s!' service. Error: %2!u!.\n"
01226             , CLIPBOOKSERVER_SVCNAME
01227             , sc
01228             );
01229         goto Cleanup;
01230     } // if: service not running when loop exited
01231
01232     //
01233     // Set status to online and save process ID of the service.
01234     // This is used to enable us to terminate the resource more
01235     // effectively.
01236     //
01237
01238     resourceStatus.ResourceState = ClusterResourceOnline;
01239     if ( ! (ServiceStatus.dwServiceFlags & SERVICE_RUNS_IN_SYSTEM_PROCESS) )
01240     {
01241         pResourceEntryIn->dwProcessId = ServiceStatus.dwProcessId;
01242     } // if: not running in the system process
01243
01244     (g_pfnLogEvent)(
01245           pResourceEntryIn->hResourceHandle
01246         , LOG_INFORMATION
01247         , L"The '%1!s!' service is now online.\n"
01248         , CLIPBOOKSERVER_SVCNAME
01249         );
01250
01251
01252 Cleanup:
01253
01254     if ( sc != ERROR_SUCCESS )
01255     {
01256         (g_pfnLogEvent)(
01257               pResourceEntryIn->hResourceHandle
01258             , LOG_ERROR
01259             , L"OnlineThread: Error %1!u! bringing resource online.\n"
01260             , sc
01261             );
01262
01263         if ( pResourceEntryIn->hService != NULL )
01264         {
01265             CloseServiceHandle( pResourceEntryIn->hService );
01266             pResourceEntryIn->hService = NULL;
01267         } // if: service handle was opened
01268     } // if: error occurred
01269
01270     pResourceEntryIn->state = resourceStatus.ResourceState;
01271     g_pfnSetResourceStatus( pResourceEntryIn->hResourceHandle, &resourceStatus );
01272
01273     return sc;
01274
01275 } //*** ClipBookServerOnlineThread
01276
01277
01278 /////////////////////////////////////////////////////////////////////////////
01279 //++
01280 //
01281 //  ClipBookServerOffline
01282 //
01283 //  Description:
01284 //      Offline routine for ClipBook Server resources.
01285 //
01286 //      Take the specified resource offline (unavailable for use).  Wait
01287 //      for any cleanup operations to complete before returning.
01288 //
01289 //  Arguments:
01290 //      residIn
01291 //          Supplies the resource ID of the resource to be shutdown
01292 //          gracefully.
01293 //
01294 //  Return Value:
01295 //      ERROR_SUCCESS
01296 //          The operation was successful, and the resource is now offline.
01297 //
01298 //      ERROR_RESOURCE_NOT_FOUND
01299 //          Resource ID is not valid.
01300 //
01301 //      ERROR_RESOURCE_NOT_AVAILABLE
01302 //          If the resource was arbitrated with some other systems and one of
01303 //          the other systems won the arbitration.
01304 //
01305 //      ERROR_IO_PENDING
01306 //          The request is still pending.  A thread has been activated to
01307 //          process the offline request.  The thread that is processing the
01308 //          offline request will periodically report status by calling the
01309 //          SetResourceStatus callback method until the resource is placed
01310 //          into the ClusterResourceOffline state (or the resource monitor
01311 //          decides  to timeout the offline request and Terminate the
01312 //          resource).
01313 //
01314 //      Win32 error code
01315 //          The operation failed.  This will cause the Resource Monitor to
01316 //          log an event and call the Terminate routine.
01317 //
01318 //--
01319 /////////////////////////////////////////////////////////////////////////////
01320 DWORD WINAPI
01321 ClipBookServerOffline(
01322     RESID residIn
01323     )
01324 {
01325     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
01326     DWORD                   sc = ERROR_SUCCESS;
01327
01328     //
01329     // Verify we have a valid resource ID.
01330     //
01331
01332     pResourceEntry = static_cast< PCLIPBOOKSERVER_RESOURCE >( residIn );
01333     if ( pResourceEntry == NULL )
01334     {
01335         DBG_PRINT( "ClipBook Server: Offline request for a nonexistent resource id.\n" );
01336         sc = ERROR_RESOURCE_NOT_FOUND;
01337         goto Cleanup;
01338     } // if: NULL resource ID
01339
01340     if ( pResourceEntry->resid != residIn )
01341     {
01342         (g_pfnLogEvent)(
01343               pResourceEntry->hResourceHandle
01344             , LOG_ERROR
01345             , L"Offline resource sanity check failed! resid = 0x%1!08x!.\n"
01346             , residIn
01347             );
01348         sc = ERROR_RESOURCE_NOT_FOUND;
01349         goto Cleanup;
01350     } // if: invalid resource ID
01351
01352     (g_pfnLogEvent)(
01353           pResourceEntry->hResourceHandle
01354         , LOG_INFORMATION
01355         , L"Offline request.\n"
01356         );
01357
01358     //
01359     // Start the Offline thread to perform the offline operation.
01360     //
01361
01362     pResourceEntry->state = ClusterResourceOfflinePending;
01363     ClusWorkerTerminate( &pResourceEntry->cwWorkerThread );
01364     sc = ClusWorkerCreate(
01365               &pResourceEntry->cwWorkerThread
01366             , reinterpret_cast< PWORKER_START_ROUTINE >( ClipBookServerOfflineThread )
01367             , pResourceEntry
01368             );
01369     if ( sc != ERROR_SUCCESS )
01370     {
01371         pResourceEntry->state = ClusterResourceFailed;
01372         (g_pfnLogEvent)(
01373               pResourceEntry->hResourceHandle
01374             , LOG_ERROR
01375             , L"Offline: Unable to start thread. Error: %1!u!.\n"
01376             , sc
01377             );
01378     } // if: error creating the worker thread
01379     else
01380     {
01381         sc = ERROR_IO_PENDING;
01382     } // if: worker thread created successfully
01383
01384 Cleanup:
01385
01386     return sc;
01387
01388 } //*** ClipBookServerOffline
01389
01390
01391 /////////////////////////////////////////////////////////////////////////////
01392 //++
01393 //
01394 //  ClipBookServerOfflineThread
01395 //
01396 //  Description:
01397 //      Worker function which takes a resource offline.
01398 //      This function is executed in a separate thread.
01399 //
01400 //  Arguments:
01401 //      pWorkerIn
01402 //          Supplies the worker thread structure.
01403 //
01404 //      pResourceEntryIn
01405 //          A pointer to the CLIPBOOKSERVER_RESOURCE block for this resource.
01406 //
01407 //  Return Value:
01408 //      ERROR_SUCCESS
01409 //          The operation completed successfully.
01410 //
01411 //      Win32 error code
01412 //          The operation failed.
01413 //
01414 //--
01415 /////////////////////////////////////////////////////////////////////////////
01416 DWORD WINAPI
01417 ClipBookServerOfflineThread(
01418       PCLUS_WORKER              pWorkerIn
01419     , PCLIPBOOKSERVER_RESOURCE   pResourceEntryIn
01420     )
01421 {
01422     RESOURCE_STATUS     resourceStatus;
01423     DWORD               sc = ERROR_SUCCESS;
01424     DWORD               nRetryTime = 300;     // 300 msec at a time
01425     BOOL                fDidStop = FALSE;
01426     SERVICE_STATUS      ServiceStatus;
01427
01428     ResUtilInitializeResourceStatus( &resourceStatus );
01429
01430     resourceStatus.ResourceState = ClusterResourceFailed;
01431     resourceStatus.WaitHint = 0;
01432     resourceStatus.CheckPoint = 1;
01433
01434     //
01435     // If the service has gone offline or was never brought online then we're done.
01436     //
01437
01438     if ( pResourceEntryIn->hService == NULL )
01439     {
01440         resourceStatus.ResourceState = ClusterResourceOffline;
01441         goto Cleanup;
01442     }
01443
01444     //
01445     // Try to stop the service.  Wait for it to terminate as long as we're not asked to terminate.
01446     //
01447
01448     while ( ClusWorkerCheckTerminate( pWorkerIn ) == FALSE )
01449     {
01450         sc = (ControlService(
01451                       pResourceEntryIn->hService
01452                     , (fDidStop
01453                         ? SERVICE_CONTROL_INTERROGATE
01454                         : SERVICE_CONTROL_STOP)
01455                     , &ServiceStatus
01456                     )
01457                 ? ERROR_SUCCESS
01458                 : GetLastError()
01459                 );
01460
01461         if ( sc == ERROR_SUCCESS )
01462         {
01463             fDidStop = TRUE;
01464
01465             if ( ServiceStatus.dwCurrentState == SERVICE_STOPPED )
01466             {
01467                 (g_pfnLogEvent)(
01468                       pResourceEntryIn->hResourceHandle
01469                     , LOG_INFORMATION
01470                     , L"OfflineThread: The '%1!s!' service stopped.\n"
01471                     , CLIPBOOKSERVER_SVCNAME
01472                     );
01473
01474                 //
01475                 // Set the status to offline.
01476                 //
01477
01478                 resourceStatus.ResourceState = ClusterResourceOffline;
01479                 CloseServiceHandle( pResourceEntryIn->hService );
01480                 pResourceEntryIn->hService = NULL;
01481                 pResourceEntryIn->dwProcessId = 0;
01482
01483                 (g_pfnLogEvent)(
01484                       pResourceEntryIn->hResourceHandle
01485                     , LOG_INFORMATION
01486                     , L"OfflineThread: Service is now offline.\n"
01487                     );
01488                 break;
01489             } // if: current service state is STOPPED
01490         } // if: ControlService completed successfully
01491
01492         if (    ( sc == ERROR_EXCEPTION_IN_SERVICE )
01493             ||  ( sc == ERROR_PROCESS_ABORTED )
01494             ||  ( sc == ERROR_SERVICE_NOT_ACTIVE )
01495            )
01496         {
01497             (g_pfnLogEvent)(
01498                   pResourceEntryIn->hResourceHandle
01499                 , LOG_INFORMATION
01500                 , L"OfflineThread: The '%1!s!' service died or is not active any more; status = %2!u!.\n"
01501                 , CLIPBOOKSERVER_SVCNAME
01502                 , sc
01503                 );
01504
01505             //
01506             // Set the status to offline.
01507             //
01508
01509             resourceStatus.ResourceState = ClusterResourceOffline;
01510             CloseServiceHandle( pResourceEntryIn->hService );
01511             pResourceEntryIn->hService = NULL;
01512             pResourceEntryIn->dwProcessId = 0;
01513             (g_pfnLogEvent)(
01514                   pResourceEntryIn->hResourceHandle
01515                 , LOG_INFORMATION
01516                 , L"OfflineThread: Service is now offline.\n"
01517                 );
01518             break;
01519         } // if: service stopped abnormally
01520
01521         (g_pfnLogEvent)(
01522               pResourceEntryIn->hResourceHandle
01523             , LOG_INFORMATION
01524             , L"OfflineThread: retrying...\n"
01525             );
01526
01527         Sleep( nRetryTime );
01528
01529     } // while: not asked to terminate
01530
01531     //
01532     // Undo the temporary changes to the service config.
01533     //
01534
01535     ResUtilRemoveResourceServiceEnvironment(
01536               CLIPBOOKSERVER_SVCNAME
01537             , g_pfnLogEvent
01538             , pResourceEntryIn->hResourceHandle
01539             );
01540
01541 Cleanup:
01542
01543     pResourceEntryIn->state = resourceStatus.ResourceState;
01544     g_pfnSetResourceStatus( pResourceEntryIn->hResourceHandle, &resourceStatus );
01545
01546     return sc;
01547
01548 } //*** ClipBookServerOfflineThread
01549
01550
01551 /////////////////////////////////////////////////////////////////////////////
01552 //++
01553 //
01554 //  ClipBookServerTerminate
01555 //
01556 //  Description:
01557 //      Terminate routine for ClipBook Server resources.
01558 //
01559 //      Take the specified resource offline immediately (the resource is
01560 //      unavailable for use).
01561 //
01562 //  Arguments:
01563 //      residIn
01564 //          Supplies the resource ID of the resource to be shutdown
01565 //          ungracefully.
01566 //
01567 //  Return Value:
01568 //      None.
01569 //
01570 //--
01571 /////////////////////////////////////////////////////////////////////////////
01572 void WINAPI
01573 ClipBookServerTerminate(
01574     RESID residIn
01575     )
01576 {
01577     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
01578     DWORD                   sc = ERROR_SUCCESS;
01579
01580     //
01581     // Verify we have a valid resource ID.
01582     //
01583
01584     pResourceEntry = static_cast< PCLIPBOOKSERVER_RESOURCE >( residIn );
01585     if ( pResourceEntry == NULL )
01586     {
01587         DBG_PRINT( "ClipBook Server: Terminate request for a nonexistent resource id.\n" );
01588         return;
01589     } // if: NULL resource ID
01590
01591     if ( pResourceEntry->resid != residIn )
01592     {
01593         (g_pfnLogEvent)(
01594               pResourceEntry->hResourceHandle
01595             , LOG_ERROR
01596             , L"Terminate resource sanity check failed! resid = 0x%1!08x!.\n"
01597             , residIn
01598             );
01599         return;
01600     } // if: invalid resource ID
01601
01602     (g_pfnLogEvent)(
01603           pResourceEntry->hResourceHandle
01604         , LOG_INFORMATION
01605         , L"Terminate request.\n"
01606         );
01607
01608     //
01609     // Kill off any pending threads.
01610     //
01611
01612     ClusWorkerTerminate( &pResourceEntry->cwWorkerThread );
01613
01614     if ( pResourceEntry->hService != NULL )
01615     {
01616         DWORD           nTotalRetryTime = 30*1000;  // Wait 30 secs for shutdown
01617         DWORD           nRetryTime = 300;           // 300 msec at a time
01618         BOOL            fDidStop = FALSE;
01619         SERVICE_STATUS  ServiceStatus;
01620
01621         for ( ;; )
01622         {
01623             sc = (ControlService(
01624                           pResourceEntry->hService
01625                         , (fDidStop
01626                             ? SERVICE_CONTROL_INTERROGATE
01627                             : SERVICE_CONTROL_STOP)
01628                         , &ServiceStatus
01629                         )
01630                     ? ERROR_SUCCESS
01631                     : GetLastError()
01632                     );
01633
01634             if ( sc == ERROR_SUCCESS )
01635             {
01636                 fDidStop = TRUE;
01637
01638                 if ( ServiceStatus.dwCurrentState == SERVICE_STOPPED )
01639                 {
01640                     (g_pfnLogEvent)(
01641                           pResourceEntry->hResourceHandle
01642                         , LOG_INFORMATION
01643                         , L"Terminate: The '%1!s!' service stopped.\n"
01644                         , CLIPBOOKSERVER_SVCNAME
01645                         );
01646                     break;
01647                 } // if: current service state is STOPPED
01648             } // if: ControlService completed successfully
01649
01650             if (    ( sc == ERROR_EXCEPTION_IN_SERVICE )
01651                 ||  ( sc == ERROR_PROCESS_ABORTED )
01652                 ||  ( sc == ERROR_SERVICE_NOT_ACTIVE )
01653                )
01654             {
01655                 (g_pfnLogEvent)(
01656                       pResourceEntry->hResourceHandle
01657                     , LOG_INFORMATION
01658                     , L"Terminate: Service died; status = %1!u!.\n"
01659                     , sc
01660                     );
01661                 break;
01662             } // if: service stopped abnormally
01663
01664             if ( (nTotalRetryTime -= nRetryTime) == 0 )
01665             {
01666                 (g_pfnLogEvent)(
01667                       pResourceEntry->hResourceHandle
01668                     , LOG_ERROR
01669                     , L"Terminate: Service did not stop; giving up.\n"
01670                     );
01671
01672                 break;
01673             } // if: retried too many times
01674
01675             (g_pfnLogEvent)(
01676                   pResourceEntry->hResourceHandle
01677                 , LOG_INFORMATION
01678                 , L"Terminate: retrying...\n"
01679                 );
01680
01681             Sleep( nRetryTime );
01682         } // for: forever
01683
01684         //
01685         // Declare the service offline.  It may not truly be offline, so
01686         // if there is a pid for this service, try and terminate that process.
01687         // Note that terminating a process doesnt terminate all the child
01688         // processes.
01689         //
01690
01691         if ( pResourceEntry->dwProcessId != 0 )
01692         {
01693             HANDLE hSvcProcess = NULL;
01694
01695             hSvcProcess = OpenProcess(
01696                                   PROCESS_TERMINATE
01697                                 , FALSE
01698                                 , pResourceEntry->dwProcessId
01699                                 );
01700             if ( hSvcProcess != NULL )
01701             {
01702                 (g_pfnLogEvent)(
01703                       pResourceEntry->hResourceHandle
01704                     , LOG_INFORMATION
01705                     , L"Terminate: Terminating processid %1!u!\n"
01706                     , pResourceEntry->dwProcessId
01707                     );
01708                 TerminateProcess( hSvcProcess, 0 );
01709                 CloseHandle( hSvcProcess );
01710             } // if: opened process successfully
01711         } // if: service process ID available
01712
01713         CloseServiceHandle( pResourceEntry->hService );
01714         pResourceEntry->hService = NULL;
01715         pResourceEntry->dwProcessId = 0;
01716     } // if: service was started
01717
01718     //
01719     // Undo the temporary changes to the service config.
01720     //
01721
01722     ResUtilRemoveResourceServiceEnvironment(
01723               CLIPBOOKSERVER_SVCNAME
01724             , g_pfnLogEvent
01725             , pResourceEntry->hResourceHandle
01726             );
01727
01728     pResourceEntry->state = ClusterResourceFailed;
01729
01730     return;
01731
01732 } //*** ClipBookServerTerminate
01733
01734
01735 /////////////////////////////////////////////////////////////////////////////
01736 //++
01737 //
01738 //  ClipBookServerLooksAlive
01739 //
01740 //  Description:
01741 //      LooksAlive routine for ClipBook Server resources.
01742 //
01743 //      Perform a quick check to determine if the specified resource is
01744 //      probably online (available for use).  This call should not block for
01745 //      more than 300 ms, preferably less than 50 ms.
01746 //
01747 //  Arguments:
01748 //      residIn
01749 //          Supplies the resource ID for the resource to be polled.
01750 //
01751 //  Return Value:
01752 //      TRUE
01753 //          The specified resource is probably online and available for use.
01754 //
01755 //      FALSE
01756 //          The specified resource is not functioning normally.  The IsAlive
01757 //          function will be called to perform a more thorough check.
01758 //
01759 //--
01760 /////////////////////////////////////////////////////////////////////////////
01761 BOOL WINAPI
01762 ClipBookServerLooksAlive(
01763     RESID residIn
01764     )
01765 {
01766     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
01767
01768     //
01769     // Verify we have a valid resource ID.
01770     //
01771
01772     pResourceEntry = static_cast< PCLIPBOOKSERVER_RESOURCE >( residIn );
01773     if ( pResourceEntry == NULL )
01774     {
01775         DBG_PRINT( "ClipBook Server: LooksAlive request for a nonexistent resource id.\n" );
01776         return FALSE;
01777     } // if: NULL resource ID
01778
01779     if ( pResourceEntry->resid != residIn )
01780     {
01781         (g_pfnLogEvent)(
01782               pResourceEntry->hResourceHandle
01783             , LOG_ERROR
01784             , L"LooksAlive sanity check failed! resid = 0x%1!08x!.\n"
01785             , residIn
01786             );
01787         return FALSE;
01788     } // if: invalid resource ID
01789
01790 #ifdef LOG_VERBOSE
01791     (g_pfnLogEvent)(
01792           pResourceEntry->hResourceHandle
01793         , LOG_INFORMATION
01794         , L"LooksAlive request.\n"
01795         );
01796 #endif
01797
01798     //
01799     // TODO: LooksAlive code
01800     //
01801
01802     //
01803     // NOTE: LooksAlive should be a quick check to see if the resource is
01804     // available or not, whereas IsAlive should be a thorough check.  If
01805     // there are no differences between a quick check and a thorough check,
01806     // IsAlive can be called for LooksAlive, as it is below.  However, if there
01807     // are differences, replace the call to IsAlive below with your quick
01808     // check code.
01809     //
01810
01811     //
01812     // Check to see if the resource is alive.
01813     //
01814
01815     return ClipBookServerCheckIsAlive( pResourceEntry, FALSE /* fFullCheck */ );
01816
01817 } //*** ClipBookServerLooksAlive
01818
01819
01820 /////////////////////////////////////////////////////////////////////////////
01821 //++
01822 //
01823 //  ClipBookServerIsAlive
01824 //
01825 //  Description:
01826 //      IsAlive routine for ClipBook Server resources.
01827 //
01828 //      Perform a thorough check to determine if the specified resource is
01829 //      online (available for use).  This call should not block for more
01830 //      more than 300 ms, preferably less than 50 ms.  If it must block for
01831 //      longer than this, create a separate thread dedicated to polling for
01832 //      this information and have this routine return the status of the last
01833 //      poll performed.
01834 //
01835 //  Arguments:
01836 //      residIn
01837 //          Supplies the resource ID for the resource to be polled.
01838 //
01839 //  Return Value:
01840 //      TRUE
01841 //          The specified resource is online and functioning normally.
01842 //
01843 //      FALSE
01844 //          The specified resource is not functioning normally.  The resource
01845 //          will be terminated and then Online will be called.
01846 //
01847 //--
01848 /////////////////////////////////////////////////////////////////////////////
01849 BOOL WINAPI
01850 ClipBookServerIsAlive(
01851     RESID residIn
01852     )
01853 {
01854     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
01855
01856     //
01857     // Verify we have a valid resource ID.
01858     //
01859
01860     pResourceEntry = static_cast< PCLIPBOOKSERVER_RESOURCE >( residIn );
01861     if ( pResourceEntry == NULL )
01862     {
01863         DBG_PRINT( "ClipBook Server: IsAlive request for a nonexistent resource id.\n" );
01864         return FALSE;
01865     } // if: NULL resource ID
01866
01867     if ( pResourceEntry->resid != residIn )
01868     {
01869         (g_pfnLogEvent)(
01870               pResourceEntry->hResourceHandle
01871             , LOG_ERROR
01872             , L"IsAlive sanity check failed! resid = 0x%1!08x!.\n"
01873             , residIn
01874             );
01875         return FALSE;
01876     } // if: invalid resource ID
01877
01878 #ifdef LOG_VERBOSE
01879     (g_pfnLogEvent)(
01880           pResourceEntry->hResourceHandle
01881         , LOG_INFORMATION
01882         , L"IsAlive request.\n"
01883         );
01884 #endif
01885
01886     //
01887     // Check to see if the resource is alive.
01888     //
01889
01890     return ClipBookServerCheckIsAlive( pResourceEntry, TRUE /* fFullCheck */ );
01891
01892 } //** ClipBookServerIsAlive
01893
01894
01895 /////////////////////////////////////////////////////////////////////////////
01896 //++
01897 //
01898 //  ClipBookServerCheckIsAlive
01899 //
01900 //  Description:
01901 //      Check to see if the resource is alive for ClipBook Server
01902 //      resources.
01903 //
01904 //  Arguments:
01905 //      pResourceEntryIn
01906 //          Supplies the resource entry for the resource to polled.
01907 //
01908 //      fFullCheckIn
01909 //          TRUE = Perform a full check.
01910 //          FALSE = Perform a cursory check.
01911 //
01912 //  Return Value:
01913 //      TRUE
01914 //          The specified resource is online and functioning normally.
01915 //
01916 //      FALSE
01917 //          The specified resource is not functioning normally.
01918 //
01919 //--
01920 /////////////////////////////////////////////////////////////////////////////
01921 BOOL
01922 ClipBookServerCheckIsAlive(
01923       PCLIPBOOKSERVER_RESOURCE  pResourceEntryIn
01924     , BOOL                     fFullCheckIn
01925     )
01926 {
01927     BOOL    fIsAlive = TRUE;
01928     DWORD   sc;
01929
01930     //
01931     // Check to see if the resource is alive.
01932     //
01933
01934     sc = ResUtilVerifyService( pResourceEntryIn->hService );
01935     if ( sc != ERROR_SUCCESS )
01936     {
01937         (g_pfnLogEvent)(
01938               pResourceEntryIn->hResourceHandle
01939             , LOG_ERROR
01940             , L"CheckIsAlive: Verification of the '%1!s!' service failed. Error: %2!u!.\n"
01941             , CLIPBOOKSERVER_SVCNAME
01942             , sc
01943             );
01944         fIsAlive = FALSE;
01945         goto Cleanup;
01946     } // if: error verifying service
01947
01948     if ( fFullCheckIn )
01949     {
01950         //
01951         // TODO: Add code to perform a full check.
01952         //
01953
01954     } // if: performing a full check
01955
01956 Cleanup:
01957
01958     return fIsAlive;
01959
01960 } //*** ClipBookServerCheckIsAlive
01961
01962
01963 /////////////////////////////////////////////////////////////////////////////
01964 //++
01965 //
01966 //  ClipBookServerResourceControl
01967 //
01968 //  Description:
01969 //      ResourceControl routine for ClipBook Server resources.
01970 //
01971 //      Perform the control request specified by nControlCode on the specified
01972 //      resource.
01973 //
01974 //  Arguments:
01975 //      residIn
01976 //          Supplies the resource ID for the specific resource.
01977 //
01978 //      nControlCodeIn
01979 //          Supplies the control code that defines the action to be performed.
01980 //
01981 //      pInBufferIn
01982 //          Supplies a pointer to a buffer containing input data.
01983 //
01984 //      cbInBufferSizeIn
01985 //          Supplies the size, in bytes, of the data pointed to by pInBufferIn.
01986 //
01987 //      pOutBufferOut
01988 //          Supplies a pointer to the output buffer to be filled in.
01989 //
01990 //      cbOutBufferSizeIn
01991 //          Supplies the size, in bytes, of the available space pointed to by
01992 //          pOutBufferOut
01993 //
01994 //      pcbBytesReturnedOut
01995 //          Returns the number of bytes of pOutBufferOut actually filled in by
01996 //          the resource.  If pOutBufferOut is too small, pcbBytesReturnedOut
01997 //          contains the total number of bytes for the operation to succeed.
01998 //
01999 //  Return Value:
02000 //      ERROR_SUCCESS
02001 //          The function completed successfully.
02002 //
02003 //      ERROR_RESOURCE_NOT_FOUND
02004 //          Resource ID is not valid.
02005 //
02006 //      ERROR_MORE_DATA
02007 //          The output buffer is too small to return the data.
02008 //          pcbBytesReturnedOut contains the required size.
02009 //
02010 //      ERROR_INVALID_FUNCTION
02011 //          The requested control code is not supported.  In some cases,
02012 //          this allows the cluster software to perform the work.
02013 //
02014 //      Win32 error code
02015 //          The function failed.
02016 //
02017 //--
02018 /////////////////////////////////////////////////////////////////////////////
02019 DWORD WINAPI
02020 ClipBookServerResourceControl(
02021       RESID     residIn
02022     , DWORD     nControlCodeIn
02023     , PVOID     pInBufferIn
02024     , DWORD     cbInBufferSizeIn
02025     , PVOID     pOutBufferOut
02026     , DWORD     cbOutBufferSizeIn
02027     , LPDWORD   pcbBytesReturnedOut
02028     )
02029 {
02030     DWORD               sc = ERROR_SUCCESS;
02031     PCLIPBOOKSERVER_RESOURCE pResourceEntry = NULL;
02032
02033     UNREFERENCED_PARAMETER( cbInBufferSizeIn );
02034     //
02035     // Verify we have a valid resource ID.
02036     //
02037     pResourceEntry = static_cast< PCLIPBOOKSERVER_RESOURCE >( residIn );
02038     if ( pResourceEntry == NULL )
02039     {
02040         DBG_PRINT( "ClipBook Server: ResourceControl request for a nonexistent resource id.\n" );
02041         return ERROR_RESOURCE_NOT_FOUND;
02042     } // if: NULL resource ID
02043
02044     if ( pResourceEntry->resid != residIn )
02045     {
02046         (g_pfnLogEvent)(
02047               pResourceEntry->hResourceHandle
02048             , LOG_ERROR
02049             , L"ResourceControl sanity check failed! resid = 0x%1!08x!.\n"
02050             , residIn
02051             );
02052         return ERROR_RESOURCE_NOT_FOUND;
02053     } // if: invalid resource ID
02054
02055     switch ( nControlCodeIn )
02056     {
02057         case CLUSCTL_RESOURCE_UNKNOWN:
02058             *pcbBytesReturnedOut = 0;
02059             sc = ERROR_SUCCESS;
02060             break;
02061
02062         case CLUSCTL_RESOURCE_SET_NAME:
02063             sc = ClipBookServerSetNameHandler( pResourceEntry, static_cast< LPWSTR >( pInBufferIn ) );
02064             break;
02065
02066         case CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES:
02067             sc = ClipBookServerGetRequiredDependencies( pOutBufferOut, cbOutBufferSizeIn, pcbBytesReturnedOut );
02068             break;
02069
02070         case CLUSCTL_RESOURCE_GET_CHARACTERISTICS:
02071         case CLUSCTL_RESOURCE_GET_CLASS_INFO:
02072         case CLUSCTL_RESOURCE_STORAGE_GET_DISK_INFO:
02073         case CLUSCTL_RESOURCE_STORAGE_IS_PATH_VALID:
02074         case CLUSCTL_RESOURCE_DELETE:
02075         case CLUSCTL_RESOURCE_INSTALL_NODE:
02076         case CLUSCTL_RESOURCE_EVICT_NODE:
02077         case CLUSCTL_RESOURCE_ADD_DEPENDENCY:
02078         case CLUSCTL_RESOURCE_REMOVE_DEPENDENCY:
02079         case CLUSCTL_RESOURCE_ADD_OWNER:
02080         case CLUSCTL_RESOURCE_REMOVE_OWNER:
02081         case CLUSCTL_RESOURCE_CLUSTER_NAME_CHANGED:
02082         case CLUSCTL_RESOURCE_CLUSTER_VERSION_CHANGED:
02083         default:
02084             sc = ERROR_INVALID_FUNCTION;
02085             break;
02086     } // switch: nControlCodeIn
02087
02088     return sc;
02089
02090 } //*** ClipBookServerResourceControl
02091
02092
02093 /////////////////////////////////////////////////////////////////////////////
02094 //++
02095 //
02096 //  ClipBookServerGetRequiredDependencies
02097 //
02098 //  Description:
02099 //      Processes the CLUSCTL_RESOURCE_GET_REQUIRED_DEPENDENCIES control
02100 //      function for resources of type ClipBook Server.
02101 //
02102 //  Arguments:
02103 //      pOutBufferOut
02104 //          Supplies a pointer to the output buffer to be filled in.
02105 //
02106 //      cbOutBufferSizeIn
02107 //          Supplies the size, in bytes, of the available space pointed to by
02108 //          pOutBuffer.
02109 //
02110 //      pcbBytesReturnedOut
02111 //          Returns the number of bytes of pOutBufferOut actually filled in by
02112 //          the resource.  If pOutBufferOut is too small, pcbBytesReturnedOut
02113 //          contains the total number of bytes for the operation to succeed.
02114 //
02115 //  Return Value:
02116 //      ERROR_SUCCESS
02117 //          The function completed successfully.
02118 //
02119 //      ERROR_MORE_DATA
02120 //          The output buffer is too small to return the data.
02121 //          pcbBytesReturnedOut contains the required size.
02122 //
02123 //      Win32 error code
02124 //          The function failed.
02125 //
02126 //--
02127 /////////////////////////////////////////////////////////////////////////////
02128 DWORD
02129 ClipBookServerGetRequiredDependencies(
02130       PVOID     pOutBufferOut
02131     , DWORD     cbOutBufferSizeIn
02132     , LPDWORD   pcbBytesReturnedOut
02133     )
02134 {
02135     //
02136     // TODO: Specify your resource's required dependencies here.
02137     // The default is that the resource requires a dependency on a
02138     // network name resource.
02139     //
02140
02141     struct DEP_DATA
02142     {
02143         //
02144         // TODO: Uncomment the following line to enable a dependency on a storage device.
02145         //
02146
02147         //CLUSPROP_RESOURCE_CLASS rcStorage;
02148         CLUSPROP_SZ_DECLARE( netnameEntry, RTL_NUMBER_OF( RESOURCE_TYPE_NETWORK_NAME ) );
02149         CLUSPROP_SYNTAX     endmark;
02150     };
02151
02152     DEP_DATA *  pdepdata = static_cast< DEP_DATA * >( pOutBufferOut );
02153     DWORD       sc = ERROR_SUCCESS;
02154     HRESULT     hr = S_OK;
02155
02156     *pcbBytesReturnedOut = sizeof( *pdepdata );
02157     if ( cbOutBufferSizeIn < sizeof( *pdepdata ) )
02158     {
02159         if ( pOutBufferOut == NULL )
02160         {
02161             sc = ERROR_SUCCESS;
02162         } // if: no buffer specified
02163         else
02164         {
02165             sc = ERROR_MORE_DATA;
02166         } // if: buffer specified
02167     } // if: output buffer is too small
02168     else
02169     {
02170         ZeroMemory( pdepdata, sizeof( *pdepdata ) );
02171
02172         //
02173         // TODO: Uncomment the following lines to enable a dependency on a storage device.
02174         //
02175
02176         //
02177         // Add the storage device entry.
02178         //
02179
02180         //pdepdata->rcStorage.Syntax.dw = CLUSPROP_SYNTAX_RESCLASS;
02181         //pdepdata->rcStorage.cbLength = sizeof( pdepdata->rcStorage.rc );
02182         //pdepdata->rcStorage.rc = CLUS_RESCLASS_STORAGE;
02183
02184         //
02185         // Add the netname entry.
02186         //
02187         pdepdata->netnameEntry.Syntax.dw = CLUSPROP_SYNTAX_NAME;
02188         pdepdata->netnameEntry.cbLength = sizeof( RESOURCE_TYPE_NETWORK_NAME );
02189         hr = StringCchCopyW(
02190                   pdepdata->netnameEntry.sz
02191                 , RTL_NUMBER_OF( pdepdata->netnameEntry.sz )
02192                 , RESOURCE_TYPE_NETWORK_NAME
02193                 );
02194         if ( FAILED( hr ) )
02195         {
02196             sc = HRESULT_CODE( hr );
02197             goto Cleanup;
02198         } // if:
02199
02200         //
02201         // Add the endmark.
02202         //
02203
02204         pdepdata->endmark.dw = CLUSPROP_SYNTAX_ENDMARK;
02205
02206         sc = ERROR_SUCCESS;
02207     } // else: output buffer is large enough
02208
02209 Cleanup:
02210
02211     return sc;
02212
02213 } //*** ClipBookServerGetRequiredDependencies
02214
02215
02216 /////////////////////////////////////////////////////////////////////////////
02217 //++
02218 //
02219 //  ClipBookServerVerifyRequiredDependencies
02220 //
02221 //  Description:
02222 //      Verifies that all of the required dependencies have been set.  Called
02223 //      from OnlineThread.
02224 //
02225 //  Arguments:
02226 //      pResourceEntryIn
02227 //          Supplies the resource entry on which to operate.
02228 //
02229 //  Return Value:
02230 //      ERROR_SUCCESS
02231 //          All required dependencies have been met.
02232 //
02233 //      ERROR_DEPENDENCY_NOT_FOUND
02234 //          A required dependency is missing.
02235 //
02236 //      Win32 error code
02237 //          The function failed.
02238 //
02239 //--
02240 /////////////////////////////////////////////////////////////////////////////
02241 DWORD ClipBookServerVerifyRequiredDependencies(
02242     PCLIPBOOKSERVER_RESOURCE pResourceEntryIn
02243     )
02244 {
02245     DWORD                   sc = ERROR_SUCCESS;
02246     DWORD                   cbBuffer = 0;
02247     PBYTE                   pbBuffer = NULL;
02248     CLUSPROP_BUFFER_HELPER  props;
02249     HRESOURCE               hResource = NULL;
02250
02251     //
02252     // Get the list of required dependencies.
02253     //
02254
02255     sc = ClipBookServerGetRequiredDependencies(
02256                   NULL
02257                 , 0
02258                 , &cbBuffer
02259                 );
02260     if ( sc != ERROR_SUCCESS )
02261     {
02262         (g_pfnLogEvent)(
02263               pResourceEntryIn->hResourceHandle
02264             , LOG_ERROR
02265             , L"VerifyRequiredDependencies: Failed to retrieve list of required dependencies. Error: %1!u!.\n"
02266             , sc
02267             );
02268         goto Cleanup;
02269     } // if:
02270
02271     pbBuffer = new BYTE[ cbBuffer ];
02272     if ( pbBuffer == NULL )
02273     {
02274         sc = ERROR_OUTOFMEMORY;
02275         (g_pfnLogEvent)(
02276               pResourceEntryIn->hResourceHandle
02277             , LOG_ERROR
02278             , L"VerifyRequiredDependencies: Failed to allocate memory. Error: %1!u!.\n"
02279             , sc
02280             );
02281         goto Cleanup;
02282     } // if:
02283
02284     sc = ClipBookServerGetRequiredDependencies(
02285                   pbBuffer
02286                 , cbBuffer
02287                 , &cbBuffer
02288                 );
02289     if ( sc != ERROR_SUCCESS )
02290     {
02291         (g_pfnLogEvent)(
02292               pResourceEntryIn->hResourceHandle
02293             , LOG_ERROR
02294             , L"VerifyRequiredDependencies: Failed to retrieve list of required dependencies. Error: %1!u!.\n"
02295             , sc
02296             );
02297         goto Cleanup;
02298     } // if:
02299
02300     //
02301     // Assign the list.
02302     //
02303
02304     props.pRequiredDependencyValue = (PCLUSPROP_REQUIRED_DEPENDENCY) pbBuffer;
02305
02306     //
02307     // Loop through each required dependency and make sure
02308     // there is a dependency on a resource of that type.
02309     //
02310
02311     while ( props.pSyntax->dw != CLUSPROP_SYNTAX_ENDMARK )
02312     {
02313         //
02314         // Check whether the dependency exists.
02315         //
02316
02317         if ( props.pSyntax->dw == CLUSPROP_SYNTAX_RESCLASS )
02318         {
02319             //
02320             // We have a dependency on a class of resource, such as storage devices.
02321             // This allows us to depend on a storage resource type from any vendor
02322             // and not just on Physical Disk.
02323             //
02324
02325             hResource = ResUtilGetResourceDependencyByClass(
02326                               pResourceEntryIn->hCluster
02327                             , pResourceEntryIn->hResource
02328                             , props.pResourceClassInfoValue
02329                             , TRUE  // bRecurse
02330                             );
02331             if ( hResource == NULL )
02332             {
02333                 sc = GetLastError();
02334                 if ( sc == ERROR_NO_MORE_ITEMS )
02335                 {
02336                     //
02337                     // If we failed with ERROR_NO_MORE_ITEMS then the resource enumeration
02338                     // completed without finding the dependency.  Change sc to reflect the
02339                     // actual meaning of the error.
02340                     //
02341
02342                     sc = ERROR_DEPENDENCY_NOT_FOUND;
02343                 } // if:
02344
02345                 if ( props.pResourceClassInfoValue->rc == CLUS_RESCLASS_STORAGE )
02346                 {
02347                     //
02348                     // We require a storage class resource dependency.
02349                     //
02350
02351                     (g_pfnLogEvent)(
02352                           pResourceEntryIn->hResourceHandle
02353                         , LOG_ERROR
02354                         , L"VerifyRequiredDependencies: Missing storage resource dependency. Error: %1!u!.\n"
02355                         , sc
02356                         );
02357                 } // if: storage resclass dependency
02358                 else
02359                 {
02360                     //
02361                     // We require a custom-defined resource class dependency.
02362                     //
02363
02364                     (g_pfnLogEvent)(
02365                           pResourceEntryIn->hResourceHandle
02366                         , LOG_ERROR
02367                         , L"VerifyRequiredDependencies: Missing resource class dependency. Class: %1!u!. Error: %2!u!.\n"
02368                         , props.pResourceClassInfoValue->rc
02369                         , sc
02370                         );
02371                 } // else: custom resclass dependency
02372                 goto Cleanup;
02373             } // if: hResource == NULL
02374
02375             props.pb += sizeof( *props.pResourceClassValue );
02376         } // if: by resclass
02377         else if ( props.pSyntax->dw == CLUSPROP_SYNTAX_NAME )
02378         {
02379             //
02380             // We have a dependency on a particular resource type.
02381             //
02382
02383             hResource = ResUtilGetResourceDependencyByName(
02384                               pResourceEntryIn->hCluster
02385                             , pResourceEntryIn->hResource
02386                             , props.pStringValue->sz
02387                             , TRUE  // bRecurse
02388                             );
02389             if ( hResource == NULL )
02390             {
02391                 sc = GetLastError();
02392                 if ( sc == ERROR_NO_MORE_ITEMS )
02393                 {
02394                     //
02395                     // If we failed with ERROR_NO_MORE_ITEMS then the resource enumeration
02396                     // completed without finding the dependency.  Change sc to reflect the
02397                     // actual meaning of the error.
02398                     //
02399
02400                     sc = ERROR_DEPENDENCY_NOT_FOUND;
02401                 } // if:
02402
02403                 (g_pfnLogEvent)(
02404                       pResourceEntryIn->hResourceHandle
02405                     , LOG_ERROR
02406                     , L"VerifyRequiredDependencies: Missing a required depencency on '%1!s!'. Error: %2!u!.\n"
02407                     , props.pStringValue->sz
02408                     , sc
02409                     );
02410                 goto Cleanup;
02411             } // if: hResource == NULL
02412
02413             props.pb += sizeof( *props.pStringValue ) + ALIGN_CLUSPROP( props.pStringValue->cbLength );
02414         } // else if: by name
02415         else
02416         {
02417             //
02418             // If we got here then our list of required dependencies contains an invalid entry.
02419             //
02420             //
02421
02422             sc = ERROR_DEPENDENCY_NOT_FOUND;
02423             (g_pfnLogEvent)(
02424                   pResourceEntryIn->hResourceHandle
02425                 , LOG_ERROR
02426                 , L"VerifyRequiredDependencies: Invalid dependency type. Error: %1!u!.\n"
02427                 , sc
02428                 );
02429             goto Cleanup;
02430         } // else: unknown
02431
02432         CloseClusterResource( hResource );
02433         hResource = NULL;
02434
02435         //
02436         // Test to make sure we haven't gone past the end of the buffer.
02437         //
02438
02439         if ( props.pb > (pbBuffer + cbBuffer) )
02440         {
02441             sc = ERROR_INVALID_DATA;
02442             (g_pfnLogEvent)(
02443                   pResourceEntryIn->hResourceHandle
02444                 , LOG_ERROR
02445                 , L"VerifyRequiredDependencies: Invalid property list detected. Error: %1!u!.\n"
02446                 , sc
02447                 );
02448             goto Cleanup;
02449         } // if: we've gone beyond the end of the buffer
02450
02451     } // while: !endmark
02452
02453     sc = ERROR_SUCCESS;
02454
02455 Cleanup:
02456
02457     if ( hResource != NULL )
02458     {
02459         CloseClusterResource( hResource );
02460     } // if:
02461
02462     delete [] pbBuffer;
02463
02464     return sc;
02465
02466 } //*** ClipBookServerVerifyRequiredDependencies
02467
02468
02469 /////////////////////////////////////////////////////////////////////////////
02470 //++
02471 //
02472 //  ClipBookServerSetNameHandler
02473 //
02474 //  Description:
02475 //      Handle the CLUSCTL_RESOURCE_SET_NAME control code by saving the new
02476 //      name of the resource.
02477 //
02478 //  Arguments:
02479 //      pResourceEntryIn
02480 //          Supplies the resource entry on which to operate.
02481 //
02482 //      pwszNameIn
02483 //          The new name of the resource.
02484 //
02485 //  Return Value:
02486 //      ERROR_SUCCESS
02487 //          The function completed successfully.
02488 //
02489 //      Win32 error code
02490 //          The function failed.
02491 //
02492 //--
02493 /////////////////////////////////////////////////////////////////////////////
02494 DWORD
02495 ClipBookServerSetNameHandler(
02496       PCLIPBOOKSERVER_RESOURCE   pResourceEntryIn
02497     , LPWSTR                    pwszNameIn
02498     )
02499 {
02500     DWORD   sc = ERROR_SUCCESS;
02501     DWORD   cchNameBuffer = 0;
02502     HRESULT hr = S_OK;
02503     WCHAR * pwszTemp = NULL;
02504
02505     //
02506     // Allocate a buffer for the new name.
02507     //
02508
02509     cchNameBuffer = lstrlenW( pwszNameIn ) + 1;
02510     pwszTemp = new WCHAR[ cchNameBuffer ];
02511     if ( pwszTemp == NULL )
02512     {
02513         sc = GetLastError();
02514         (g_pfnLogEvent)(
02515               pResourceEntryIn->hResourceHandle
02516             , LOG_ERROR
02517             , L"Failed to allocate memory for the new resource name '%1!s!'. Error: %2!u!.\n"
02518             , pwszNameIn
02519             , sc
02520             );
02521         goto Cleanup;
02522     } // if: error allocating memory for the name.
02523
02524     //
02525     // Copy the new name to the new buffer.
02526     //
02527
02528     hr = StringCchCopyW( pwszTemp, cchNameBuffer, pwszNameIn );
02529     if ( FAILED( hr ) )
02530     {
02531         sc = HRESULT_CODE( hr );
02532         goto Cleanup;
02533     } // if:
02534
02535     //
02536     // All went well, free the old buffer and assign the new one.
02537     //
02538
02539     delete [] pResourceEntryIn->pwszResourceName;
02540     pResourceEntryIn->pwszResourceName = pwszTemp;
02541     pwszTemp = NULL;
02542
02543 Cleanup:
02544
02545     delete [] pwszTemp;
02546
02547     return sc;
02548
02549 } //*** ClipBookServerSetNameHandler
02550
02551
02552 /////////////////////////////////////////////////////////////////////////////
02553 //
02554 // Define Function Table
02555 //
02556 /////////////////////////////////////////////////////////////////////////////
02557
02558 CLRES_V1_FUNCTION_TABLE(
02559     g_ClipBookServerFunctionTable,       // Name
02560     CLRES_VERSION_V1_00,                // Version
02561     ClipBookServer,                      // Prefix
02562     NULL,                               // Arbitrate
02563     NULL,                               // Release
02564     ClipBookServerResourceControl,       // ResControl
02565     NULL                                // ResTypeControl
02566     );
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Main.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

Main.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 // Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 // File:        main.cxx
00006 //
00007 // Contents:    DLL entry point for the filter
00008 //
00009 //----------------------------------------------------------------------------
00010
00011 #include <pch.cxx>
00012 #pragma hdrstop
00013
00014 #define _DECL_DLLMAIN 1
00015 #include <process.h>
00016
00017 #include <osv.hxx>
00018
00019 // global function to find OS platform
00020 #define UNINITIALIZED -1
00021 int g_nOSWinNT = UNINITIALIZED;
00022
00023 //+-------------------------------------------------------------------------
00024 //
00025 //  Function:   GetOSVersion
00026 //
00027 //  Synopsis:   Determine OS version
00028 //
00029 //--------------------------------------------------------------------------
00030
00031 void InitOSVersion()
00032 {
00033     if ( g_nOSWinNT == UNINITIALIZED )
00034     {
00035         OSVERSIONINFOA OSVersionInfo;
00036         OSVersionInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFOA );
00037
00038         if ( GetVersionExA( &OSVersionInfo ) )
00039         {
00040             g_nOSWinNT = OSVersionInfo.dwPlatformId;
00041         }
00042     }
00043 }
00044
00045 //+---------------------------------------------------------------------------
00046 //
00047 //  Function:   DllMain
00048 //
00049 //  Synopsis:   Called from C-Runtime on process/thread attach/detach
00050 //
00051 //  Arguments:  [hInstance]  --
00052 //              [dwReason]   --
00053 //              [lpReserved] --
00054 //
00055 //----------------------------------------------------------------------------
00056
00057 BOOL WINAPI DllMain( HANDLE hInstance, DWORD dwReason , void * lpReserved )
00058 {
00059     if ( DLL_PROCESS_ATTACH == dwReason )
00060     {
00061         DisableThreadLibraryCalls( (HINSTANCE)hInstance );
00062
00063         InitOSVersion();
00064     }
00065
00066     return TRUE;
00067 }
00068
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/STATBAR.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

STATBAR.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE: statbar.c
00009 //
00010 //  PURPOSE: Handles general routines for the TapiComm sample.
00011 //
00012 //  FUNCTIONS:
00013 //    MsgTimer      - Handles the WM_TIMER messages to set the time on
00014 //                    the status bar.
00015 //    MsgMouseMove  - Handles the WM_MOUSEMOVE to display the cursor position.
00016 //    MsgMenuSelect - Handle the WM_MENUSELECT message. This message will
00017 //                    enable the status bar control to update when the user
00018 //                    moves across menu items on the main window.
00019 //    InitializeStatusBar - Sets the pane positions in the statusbar control
00020 //    CreateSBar    - Calls CreateStatusWindow() to create the status bar
00021 //    UpdateStatusBar - Updates the statusbar control with appropriate text
00022 //
00023
00024 #include <windows.h>            // required for all Windows applications
00025 #include <windowsx.h>
00026 #include <commctrl.h>           // prototypes and defs for common controls
00027 #include "globals.h"            // prototypes specific to this application
00028 #include "statbar.h"            // prototypes specific to statbar.c
00029
00030
00031 // Global Variables for the status bar control.
00032
00033 HWND  hWndStatusbar;
00034
00035 //  **TODO**  Add entries to the string table in TapiComm.rc for each menu
00036 //            command.  MsgMenuSelect (below) loads these strings to display
00037 //            information in the status bar.  MsgMenuSelect assumes that the
00038 //            string ID is the same as the command ID and that a string
00039 //            exists for every command.
00040 //
00041 // The following array contains resource string ID's for popup menus
00042 // in the main application menu.  This array is used by MsgMenuSelect
00043 // to display information in the status bar.
00044 //
00045 //  **TODO**  Add entries to this array for each popup menu in the same
00046 //            positions as they appear in the main menu.  Remember to define
00047 //            the ID's in globals.h and add the strings to TapiComm.rc.
00048
00049 UINT idPopup[] =
00050 {
00051     IDS_FILEMENU,
00052     IDS_EDITMENU,
00053     IDS_HELPMENU,
00054 };
00055
00056
00057
00058 //
00059 //  FUNCTION: MsgMenuSelect(HWND, UINT, WPARAM, LPARAM)
00060 //
00061 //  PURPOSE:  Upadates menu selections on the staus bar.
00062 //
00063 //
00064 //  PARAMETERS:
00065 //
00066 //    hwnd      - Window handle  (Used)
00067 //    uMessage  - Message number (Used)
00068 //    wparam    - Extra data     (Used)
00069 //    lparam    - Extra data     (Used)
00070 //
00071 //  RETURN VALUE:
00072 //
00073 //    Always returns 0 - Message handled
00074 //
00075 //  COMMENTS:
00076 //    This message is sent when the user selects menu items by
00077 //    by pulling down  a popup menu move the mouse around to highlite
00078 //    different menu items.
00079 //
00080 //
00081
00082 #define MENUHACK 1              // Menu Select message has a bug..so workaround
00083
00084 LRESULT MsgMenuSelect(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00085 {
00086     static char szBuffer[128];
00087     UINT   nStringID = 0;
00088     UINT   fuFlags = GET_WM_MENUSELECT_FLAGS(wparam, lparam) & 0xffff;
00089     UINT   uCmd    = GET_WM_MENUSELECT_CMD(wparam, lparam);
00090     HMENU  hMenu   = GET_WM_MENUSELECT_HMENU(wparam, lparam);
00091
00092
00093     szBuffer[0] = 0;                            // First reset the buffer
00094
00095
00096     if (fuFlags == 0xffff && hMenu == NULL)     // Menu has been closed
00097         nStringID = IDS_DESCRIPTION;
00098
00099     else if (fuFlags & MFT_SEPARATOR)           // Ignore separators
00100         nStringID = 0;
00101
00102     else if (fuFlags & MF_POPUP)                // Popup menu
00103     {
00104 #ifdef MENUHACK                 // This code shouldn't be necessary...
00105         UINT i;
00106         for (i = 0; i < sizeof(idPopup)/sizeof(idPopup[0]); i++)
00107         {
00108             if(GetSubMenu(hMenu, i) == (HMENU)((UINT_PTR)uCmd))
00109             {
00110                 uCmd = i;
00111                 break;
00112             }
00113         }
00114 #endif
00115         if (fuFlags & MF_SYSMENU)               // System menu
00116             nStringID = IDS_SYSMENU;
00117
00118         else
00119             // Get string ID for popup menu from idPopup array.
00120             nStringID = ((uCmd < sizeof(idPopup)/sizeof(idPopup[0])) ?
00121                             idPopup[uCmd] : 0);
00122     }  // for MF_POPUP
00123
00124     else                                        // Must be a command item
00125         nStringID = uCmd;                       // String ID == Command ID
00126
00127     // Load the string if we have an ID
00128     if (0 != nStringID)
00129         LoadString(hInst, nStringID, szBuffer, sizeof(szBuffer));
00130
00131     // Finally... send the string to the status bar
00132     UpdateStatusBar(szBuffer, 0, 0);
00133
00134     return 0;
00135 }
00136
00137
00138 //
00139 //  FUNCTION: InitializeStatusBar(HWND)
00140 //
00141 //  PURPOSE:  Initialize statusbar control with time and mouse positions.
00142 //
00143 //
00144 //  PARAMETERS:
00145 //
00146 //  hwndParent - Window handle of the status bar's parent
00147 //
00148 //
00149 //  RETURN VALUE:  NONE
00150 //
00151 //
00152 //  COMMENTS:
00153 //
00154 //   This function initializes the time  and mouse positions sections of
00155 //   the statubar window. The Date for the time section is obtained by
00156 //   calling SetTimer API. When the timer messages start comming in,
00157 //   GetSytemTime() to fill the time section.
00158 //   The WPARAM of SB_SETTEXT is divided into 2 parameters. The LOWORD
00159 //   determines which section/part the text goes into, and the HIWORD
00160 //   tells how the bar is drawn (popin or popout).
00161 //
00162
00163 void InitializeStatusBar(HWND hwndParent)
00164 {
00165     const cSpaceInBetween = 8;
00166     int   ptArray[2];   // Array defining the number of parts/sections
00167     SIZE  size = {0,0};         // the Status bar will display.
00168     RECT  rect;
00169     HDC   hDC;
00170
00171    /*
00172     * Fill in the ptArray...
00173     */
00174
00175     hDC = GetDC(hwndParent);
00176     GetClientRect(hwndParent, &rect);
00177     ReleaseDC(hwndParent, hDC);
00178
00179     ptArray[0] = (rect.right) / 2;
00180     ptArray[1] = rect.right;
00181
00182     SendMessage(hWndStatusbar,
00183                 SB_SETPARTS,
00184                 sizeof(ptArray)/sizeof(ptArray[0]),
00185                 (LPARAM)(LPINT)ptArray);
00186
00187     UpdateStatusBar(SZDESCRIPTION, 0, 0);
00188 }
00189
00190
00191 //
00192 //  FUNCTION: CreateSBar(HWND, UINT, WPARAM, LPARAM)
00193 //
00194 //  PURPOSE:  Calls CreateStatusWindow() to create the status bar
00195 //
00196 //
00197 //  PARAMETERS:
00198 //
00199 //  hwndParent - Window handle of the status bar's parent
00200 //
00201 //  RETURN VALUE:
00202 //
00203 //  If both controls were created successfully Return TRUE,
00204 //  else returns FALSE.
00205 //
00206 //  COMMENTS:
00207 //
00208 //
00209
00210 BOOL CreateSBar(HWND hwndParent)
00211 {
00212     hWndStatusbar = CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_BORDER,
00213                                        SZDESCRIPTION,
00214                                        hwndParent,
00215                                        IDM_STATUSBAR);
00216     if(hWndStatusbar)
00217     {
00218         InitializeStatusBar(hwndParent);
00219         return TRUE;
00220     }
00221
00222     return FALSE;
00223 }
00224
00225
00226 //
00227 //  FUNCTION: UpdateStatusBar(HWND)
00228 //
00229 //  PURPOSE:  Updates the statusbar control with appropriate text
00230 //
00231 //
00232 //  PARAMETERS:
00233 //
00234 //  lpszStatusString - text to be displayed
00235 //  partNumber       - which part of the status bar to display text in
00236 //  displayFlags     - display flags
00237 //
00238 //
00239 //  RETURN VALUE: NONE
00240 //
00241 //
00242 //  COMMENTS:
00243 //      None
00244 //
00245 //
00246
00247 void UpdateStatusBar(LPSTR lpszStatusString, WORD partNumber, WORD displayFlags)
00248 {
00249     SendMessage(hWndStatusbar,
00250                 SB_SETTEXT,
00251                 partNumber | displayFlags,
00252                 (LPARAM)lpszStatusString);
00253 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsError/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsError

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authentication/SampSSP/Init.c Source File

  • Security
  • Authentication
  • SampSSP

Init.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     init.c
00012
00013 Abstract:
00014
00015     NT LM Security Support Provider client side initialization.
00016
00017 Environment:  User Mode
00018
00019 Revision History:
00020
00021 --*/
00022
00023
00024 #include "sampssp.h"
00025
00026 CRITICAL_SECTION DllCritSect;    // Serializes access to all globals in module
00027
00028
00029 BOOLEAN
00030 DllInit(
00031     IN PVOID DllHandle,
00032     IN ULONG Reason,
00033     IN PCONTEXT Context OPTIONAL
00034     )
00035
00036 /*++
00037
00038 Routine Description:
00039
00040     This is the Dll initialization routine for ntlmssp.dll
00041
00042 Arguments:
00043
00044     Standard.
00045
00046 Return Status:
00047
00048     TRUE: if initialization succeeded
00049
00050 --*/
00051
00052 {
00053
00054     //
00055     // On process attach,
00056     //      initialize the critical section,
00057     //      defer any additional initialization.
00058     //
00059
00060     switch (Reason) {
00061     case DLL_PROCESS_ATTACH:
00062 #if defined (DEBUG)
00063             DebugBreak();
00064 #endif
00065         InitializeCriticalSection( &DllCritSect );
00066         break;
00067
00068     //
00069     // Handle process detach.
00070     //
00071
00072     case DLL_PROCESS_DETACH:
00073
00074
00075         //
00076         // Shutdown the common routines.
00077         //
00078
00079         EnterCriticalSection( &DllCritSect );
00080         LeaveCriticalSection( &DllCritSect );
00081
00082         //
00083         // Finally, Delete the critical section
00084         //
00085
00086         DeleteCriticalSection( &DllCritSect );
00087
00088         break;
00089
00090     }
00091
00092     return TRUE;
00093     UNREFERENCED_PARAMETER( Context );
00094     UNREFERENCED_PARAMETER( DllHandle );
00095
00096 }
00097
00098
00099
00100 
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/LoginDlg.Cpp Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

LoginDlg.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // logindlg.cpp : implementation file
00013 //
00014
00015
00016 #include "stdafx.h"
00017 #include "Imp_Draw.h"
00018 #include "logindlg.h"
00019
00020 #ifdef _DEBUG
00021 #define new DEBUG_NEW
00022 #undef THIS_FILE
00023 static char THIS_FILE[] = __FILE__;
00024 #endif
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // CLoginDlg dialog
00028
00029
00030 CLoginDlg::CLoginDlg(CWnd* pParent /*=NULL*/)
00031   : CDialog(CLoginDlg::IDD, pParent)
00032 {
00033   //{{AFX_DATA_INIT(CLoginDlg)
00034   m_strLogin = _T("");
00035   //}}AFX_DATA_INIT
00036 }
00037
00038
00039 void CLoginDlg::DoDataExchange(CDataExchange* pDX)
00040 {
00041   CDialog::DoDataExchange(pDX);
00042   //{{AFX_DATA_MAP(CLoginDlg)
00043   DDX_Text(pDX, IDC_EDIT_LOGIN, m_strLogin);
00044   //}}AFX_DATA_MAP
00045 }
00046
00047
00048 BEGIN_MESSAGE_MAP(CLoginDlg, CDialog)
00049   //{{AFX_MSG_MAP(CLoginDlg)
00050     // NOTE: the ClassWizard will add message map macros here
00051   //}}AFX_MSG_MAP
00052 END_MESSAGE_MAP()
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // CLoginDlg message handlers
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/staticnode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

staticnode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CStaticNode class.
00014 //
00015
00016 #include "StaticNode.h"
00017 #include "DeviceNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "AddDeviceDlg.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CStaticNode")
00026
00027
00028 // Initialize our static GUID just once.  We use the GUID for
00029 // CComponentData because this node handles events for the
00030 // Snap-in's namespace
00031 GUID CStaticNode::thisGUID = CLSID_CComponentData;
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Construction/Destruction
00036
00037 //---------------------------------------------------------------------------
00038 CStaticNode::CStaticNode()
00039 {
00040   m_SDI.mask        = DEFAULT_SDI_MASK;
00041   m_SDI.displayname = MMC_CALLBACK;
00042   m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00043   m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00044   m_SDI.cChildren   = 1;              // Determines if the '+' is displayed
00045   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00046
00047   m_hStaticNode     = NULL;
00048   m_pCompData       = NULL;
00049   m_hAddDeviceDlg   = NULL;
00050 }
00051
00052
00053 //---------------------------------------------------------------------------
00054 CStaticNode::~CStaticNode()
00055 {
00056   // Clean up our message window
00057   if( NULL != m_hMessageWnd )
00058     DestroyWindow( m_hMessageWnd );
00059 }
00060
00061 //---------------------------------------------------------------------------
00062 HRESULT CStaticNode::Initialize( NODE_PROPERTIES* pNodeProps )
00063 {
00064   _ASSERT( NULL != pNodeProps );
00065   HRESULT hResult = S_FALSE;
00066
00067   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00068   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00069   wcscpy( pszTmp, pNodeProps->szNodeName );
00070   if( NULL != m_pwszNodeName )
00071     CoTaskMemFree( m_pwszNodeName );
00072
00073   m_pwszNodeName = pszTmp;
00074   m_pCompData = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00075
00076   hResult = RefreshNodeList();         // Initialize scope nodes
00077
00078   // We create a hidden window to allow us to communicate with modeless
00079   // dialogs and other things which run in a seperate thread.
00080
00081   WNDCLASS wc;
00082   ZeroMemory (&wc, sizeof(WNDCLASS));
00083   wc.cbWndExtra    = sizeof(this);
00084   wc.lpfnWndProc   = StaticNodeWndProc;
00085   wc.hInstance     = g_hInst;
00086   wc.lpszClassName = _T("StaticNodeMessageWindow");
00087
00088   RegisterClass( &wc );
00089   m_hMessageWnd = CreateWindow( _T("StaticNodeMessageWindow"), NULL,
00090                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00091
00092   if( NULL == m_hMessageWnd )
00093     hResult = S_FALSE;
00094
00095   return hResult;
00096 }
00097
00098
00099 //---------------------------------------------------------------------------
00100 //  This is our hidden window which is just used for handling messages.  We
00101 //  go to all this trouble so that we don't ever pass interface pointers or
00102 //  other objects across threads.
00103 //
00104 LRESULT CALLBACK CStaticNode::StaticNodeWndProc
00105 (
00106   HWND   hWnd,     //[in] Handle to window
00107   UINT   uMsg,     //[in] Message identifier
00108   WPARAM wParam,   //[in] First message parameter
00109   LPARAM lParam    //[in] Second message parameter
00110 )
00111 {
00112   switch( uMsg )
00113   {
00114     // Since we registered the WndClass in Initialize, our WndProc will be
00115     // called with WM_CREATE right away.  Store our 'hWnd' pointer in the
00116     // CREATESTRUCT so we can retreive it later to get back to the specific
00117     // instance of CComponentData
00118     //
00119     case WM_CREATE:
00120     {
00121       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00122       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00123       break;
00124     }
00125
00126     // This is our custom message which could have been sent from a worker
00127     // thread, or in this case a modeless dialog.  We retrieve our 'this'
00128     // pointer from the WndClass and cast it to a CComponentData pointer.
00129     // WPARAM is cast to a NODE_PROPERTIES struct which can be used to
00130     // call AddDeviceNode()
00131     //
00132     case WM_ADD_DEVICENODE:
00133     {
00134       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00135       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00136       pThisNode->AddDeviceNode( pProps );
00137       break;
00138     }
00139
00140     // This message is sent by the AddDeviceDlg to let us know it's
00141     // being terminated.  Set our member handle to NULL so the item
00142     // will be show on the context menu
00143     //
00144     case WM_DEVICENODE_CLOSED:
00145     {
00146       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00147       pThisNode->m_hAddDeviceDlg = NULL;
00148       break;
00149     }
00150     default:
00151       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00152   }
00153   return 0;
00154 }
00155
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Implementation of virtual methods
00159
00160
00161 //---------------------------------------------------------------------------
00162 HRESULT CStaticNode::GetResultViewType2
00163 (
00164   MMC_COOKIE             nCookie,  //[in] Identifier of object
00165   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00166 )
00167 {
00168   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+1 );
00169   if( NULL == pszDescStr )
00170     return E_OUTOFMEMORY;
00171
00172   wcscpy( pszDescStr, L"DefaultListView" );
00173   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00174
00175   return S_OK;
00176 }
00177
00178 //---------------------------------------------------------------------------
00179 HRESULT CStaticNode::GetDisplayInfo
00180 (
00181   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00182 )
00183 {
00184   _ASSERT( NULL != pSDI );
00185   pSDI->displayname = m_pwszNodeName;
00186
00187   return S_OK;
00188 }
00189
00190 //---------------------------------------------------------------------------
00191 HRESULT CStaticNode::GetDisplayInfo
00192 (
00193   RESULTDATAITEM* pRDI
00194 )
00195 {
00196   // This method will not get called since the static node is never
00197   // displayed in the result pane
00198   return S_FALSE;
00199 }
00200
00201 /////////////////////////////////////////////////////////////////////////////
00202 // Implementation of notification handlers
00203
00204 //---------------------------------------------------------------------------
00205 HRESULT CStaticNode::OnShow
00206 (
00207   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00208   LPARAM        nArg,          //[in] TRUE if node was selcted
00209   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00210   LONG_PTR      pComponent     //[in] Points to calling IComponent
00211 )
00212 {
00213   HRESULT  hResult = S_FALSE;
00214
00215   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00216
00217   LPHEADERCTRL2  ipHeaderCtrl = NULL;
00218   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL, (LONG_PTR*)&ipHeaderCtrl );
00219   if( S_OK != hResult )
00220    return hResult;
00221
00222   LPRESULTDATA  ipResultData = NULL;
00223   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00224   if( S_OK != hResult )
00225    return hResult;
00226
00227   if( TRUE == nArg )  // Selecting a scope node
00228   {
00229     do
00230     {
00231       hResult = ipHeaderCtrl->InsertColumn( 0, L"Device Name", 0, 150 );
00232       BREAK_ON_ERROR( hResult );
00233
00234       hResult = ipHeaderCtrl->InsertColumn( 1, L"Status", 0, 150 );
00235       BREAK_ON_ERROR( hResult );
00236
00237       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00238       BREAK_ON_ERROR( hResult );
00239
00240     }while(0);
00241   }
00242   else // Not handling deselect notifications
00243   {
00244   }
00245
00246   //TRACE_HRESULT(_T("OnShow"), hResult );
00247   return hResult;
00248 }
00249
00250
00251 //---------------------------------------------------------------------------
00252 HRESULT CStaticNode::OnSelect
00253 (
00254   LPDATAOBJECT   ipDataObject,   //[in] Points to the selected data object
00255   LPARAM         nArg,           //[in] Status of selected item
00256   LPARAM         nParam,         //[in] Not used
00257   LONG_PTR       pComponent      //[in] Pointer to parent CComponent
00258 )
00259 {
00260   BOOL    fScopePane = LOWORD(nArg);
00261   BOOL    fSelected  = HIWORD(nArg);
00262   HRESULT hResult    = S_FALSE;
00263
00264   if( NULL == ipDataObject )           // Can get this when closing the SnapIn
00265     return hResult;
00266
00267   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00268   LPCONSOLEVERB  ipConsoleVerb = NULL;
00269   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00270   if( S_OK != hResult )
00271     return hResult;
00272
00273   if( TRUE == fScopePane && TRUE == fSelected )
00274   {
00275     // This is where we will set verbs in later versions
00276   }
00277
00278   //TRACE_HRESULT(_T("OnSelect"), hResult );
00279   return hResult;
00280
00281 }
00282
00283 //---------------------------------------------------------------------------
00284 //  The static node is a special case.  The CComponentData pointer is also
00285 //  our parent so we don't need to use the pCompData parameter
00286 //
00287 HRESULT CStaticNode::OnExpand
00288 (
00289   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00290   LPARAM         nArg,         //[in] TRUE if node was selcted
00291   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00292   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00293 )
00294 {
00295   HRESULT hResult = S_FALSE;
00296
00297   if( NULL == m_hStaticNode )          // Cache the root node handle
00298     m_hStaticNode = static_cast<HSCOPEITEM>(nParam);
00299
00300   if( NULL == m_pCompData )
00301     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00302
00303   // Request an IConsoleNameSpace pointer from CComponentData
00304   LPCONSOLENAMESPACE2 ipCNS = NULL;
00305   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00306   if( S_OK != hResult )
00307     return hResult;
00308
00309   hResult = DeleteScopeItems( ipCNS );
00310   hResult = InsertScopeItems( ipCNS );
00311
00312   return hResult;
00313 }
00314
00315
00316 //---------------------------------------------------------------------------
00317 HRESULT CStaticNode::OnRemoveChildren
00318 (
00319   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00320   LPARAM         nArg,         //[in] TRUE if node was selcted
00321   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00322   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00323 )
00324 {
00325   HRESULT hResult = S_FALSE;
00326
00327   POSITION   Pos   = m_NodeList.GetHeadPosition();
00328   LPBASENODE pNode = NULL;
00329   while( Pos )                         // Delete everything...
00330   {
00331     pNode = m_NodeList.GetNext( Pos );
00332     hResult = pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00333     delete pNode;
00334   }
00335
00336   m_NodeList.RemoveAll();              // Cleanup the list
00337
00338   TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00339   return hResult;
00340 }
00341
00342
00343 /////////////////////////////////////////////////////////////////////////////
00344 // Private helper methods
00345
00346
00347 //---------------------------------------------------------------------------
00348 //  Initializes the node list.
00349 //
00350 HRESULT CStaticNode::RefreshNodeList()
00351 {
00352   NODE_PROPERTIES NodeProps;
00353   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00354   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00355   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00356   NodeProps.dwAttributes   = 0;
00357
00358   WCHAR  szNames[2][32];
00359   wcscpy( szNames[0], L"RamDisk 0" );
00360   wcscpy( szNames[1], L"Archive 0" );
00361
00362   RemoveChildNodes();                  // Clean the node list
00363
00364   CDeviceNode* pNode = NULL;
00365   for( DWORD i = 0; i < 2; i++ )
00366   {
00367     wcscpy( NodeProps.szNodeName, szNames[i] );
00368     pNode = new CDeviceNode;
00369     pNode->Initialize( &NodeProps );
00370     m_NodeList.AddTail( pNode );
00371
00372     // Kind of a hack, make the second device a backup device
00373     NodeProps.dwAttributes |= ATTRIBUTE_BACKUP_DEVICE;
00374   }
00375
00376   return S_OK;
00377 }
00378
00379
00380 //---------------------------------------------------------------------------
00381 //  For these first level nodes the parent is always the static or root
00382 //  node.
00383 //
00384 HRESULT CStaticNode::InsertScopeItems
00385 (
00386   LPCONSOLENAMESPACE2 ipCNS    //[in] Needed to insert items
00387 )
00388 {
00389   _ASSERT( NULL != ipCNS );
00390   _ASSERT( NULL != m_hStaticNode );
00391
00392   HRESULT      hResult = S_FALSE;
00393   POSITION     Pos     = m_NodeList.GetHeadPosition();
00394   CDeviceNode* pNode   = NULL;
00395
00396   while( Pos )
00397   {
00398     pNode   = m_NodeList.GetNext( Pos );
00399     pNode->m_SDI.relativeID = m_hStaticNode;
00400     hResult = ipCNS->InsertItem( &pNode->m_SDI );
00401   }
00402
00403   return hResult;
00404 }
00405
00406
00407 //---------------------------------------------------------------------------
00408 //  Delete the HSCOPEITEMS only, we leave the list of nodes untouched
00409 //
00410 HRESULT CStaticNode::DeleteScopeItems
00411 (
00412   LPCONSOLENAMESPACE2 ipCNS    //[in] Needed to delete items
00413 )
00414 {
00415   _ASSERT( NULL != ipCNS );
00416
00417   POSITION    Pos     = m_NodeList.GetHeadPosition();
00418   HSCOPEITEM  hItem   = NULL;
00419   LPBASENODE  pNode   = NULL;
00420   HRESULT     hResult = S_FALSE;
00421
00422   while( Pos )                         // Delete everything...
00423   {
00424     pNode = m_NodeList.GetNext( Pos );
00425     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00426     if( 0 != hItem )
00427       hResult = ipCNS->DeleteItem( hItem, TRUE );
00428   }
00429
00430   return hResult;
00431
00432 }
00433
00434 //---------------------------------------------------------------------------
00435 //  We do this instead of just calling RemoveAll() because our list contains
00436 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00437 //  the derived class object.
00438 //
00439 VOID CStaticNode::RemoveChildNodes()
00440 {
00441   LPBASENODE pNode = NULL;
00442   POSITION   Pos   = m_NodeList.GetHeadPosition();
00443   while( Pos )
00444   {
00445     pNode = m_NodeList.GetNext( Pos );
00446     delete pNode;
00447   }
00448   m_NodeList.RemoveAll();              // Clean the list
00449 }
00450
00451 //---------------------------------------------------------------------------
00452 HRESULT CStaticNode::AddDeviceNode
00453 (
00454   NODE_PROPERTIES*    pProps   //[in] Properties for the new node
00455 )
00456 {
00457   _ASSERT( NULL != pProps );
00458
00459   CDeviceNode* pNode   = NULL;
00460   HRESULT      hResult = S_FALSE;
00461
00462   pProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00463   pProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00464
00465   pNode = new CDeviceNode;         // Create and initialize the new
00466   pNode->Initialize( pProps );     // node, then add to our linked
00467   m_NodeList.AddTail( pNode );     // list, then insert the node
00468
00469   pNode->m_SDI.relativeID = m_hStaticNode;
00470
00471   LPCONSOLENAMESPACE2 ipCNS = NULL;
00472   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00473   if( S_OK != hResult )
00474     return hResult;
00475
00476   hResult = ipCNS->InsertItem( &pNode->m_SDI );
00477
00478   return hResult;
00479 }
00480
00481 //---------------------------------------------------------------------------
00482 //  Get the selected node and call it's ToggleStatus method
00483 //
00484 VOID CStaticNode::ToggleStatus
00485 (
00486   LPDATAOBJECT ipDataObject
00487 )
00488 {
00489   CDeviceNode* pNode = (CDeviceNode*)ExtractBaseNodePtr( ipDataObject );
00490   if( NULL != pNode )
00491     pNode->ToggleStatus();
00492
00493 }
00494
00495
00496 /////////////////////////////////////////////////////////////////////////////
00497 //  Support for Context Menus
00498
00499 //---------------------------------------------------------------------------
00500 //  NOTE:  Don't AddRef ipCallback.  Check docs.
00501 //
00502 HRESULT CStaticNode::AddMenuItems
00503 (
00504   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00505   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00506 )
00507 {
00508   _ASSERT( NULL != ipCallback );
00509   HRESULT hResult = S_FALSE;
00510
00511   static CONTEXTMENUITEM ctxMenu;
00512     ctxMenu.lCommandID        = IDM_NEW_DEVICE;
00513     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00514     ctxMenu.fSpecialFlags     = 0;
00515     ctxMenu.strName           = L"New Device...";
00516     ctxMenu.strStatusBarText  = L"Add a new device";
00517
00518
00519   if( NULL == m_hAddDeviceDlg )    // If the AddDevice dialog is running
00520     ctxMenu.fFlags = 0;            // gray the menu selection
00521   else
00522     ctxMenu.fFlags = MF_GRAYED;
00523
00524
00525   // Add the 'New Device' option to the New menu if allowed...
00526   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00527   {
00528     hResult = ipCallback->AddItem( &ctxMenu );
00529   }
00530
00531   return hResult;
00532 }
00533
00534
00535 //---------------------------------------------------------------------------
00536 HRESULT CStaticNode::Command
00537 (
00538   long lCommandID          //[in] Indentifier for menu ID
00539 )
00540 {
00541   HRESULT hResult = S_OK;
00542
00543   switch( lCommandID )
00544   {
00545     case IDM_NEW_DEVICE:
00546     {
00547       CAddDeviceDlg* pDlg = new CAddDeviceDlg( IDD_ADDDEVICE_DLG, m_hMessageWnd );
00548       m_hAddDeviceDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00549       break;
00550     }
00551     default:
00552     {
00553       hResult = S_FALSE;
00554       break;
00555     }
00556   }
00557   return hResult;
00558 }
00559
00560
00561
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/people.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include <windows.h>
00021 #include <commctrl.h>
00022 #include <stdio.h>
00023 #include "People.h"
00024
00025 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00026
00027 const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00028 const GUID CSkateboardFolder::thisGuid = { 0xef163733, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00029 const GUID CIceSkateFolder::thisGuid = { 0xf6c660b0, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00030
00031 const GUID CBicycle::thisGuid = { 0xef163734, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00032 const GUID CSkateboard::thisGuid = { 0xef163735, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00033 const GUID CIceSkate::thisGuid = { 0xf6c660b1, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00034
00035
00036 //---------------------------------------------------------------------------
00037 //  Creates a string with the format
00038 //    "res://<Path to this object>/<path to resource>
00039 //
00040 //  It is up to the caller to make sure the memory allocated with
00041 //  CoTaskMemAlloc for the string is freed.
00042 //  If null is passed in the first parameter, the path to MMC.EXE will be
00043 //  returned, if the instance handle is passed the returned path will point
00044 //  the Snap-in dll.
00045 //
00046 LPOLESTR CreateResourcePath
00047 (
00048   HINSTANCE hInst,         //[in] Global instance handle
00049   LPOLESTR szResource      //[in] Path to stored resource
00050 )
00051 {
00052    _TCHAR szBuffer[MAX_PATH];
00053
00054    ZeroMemory(szBuffer, sizeof(szBuffer));
00055
00056    _tcscpy(szBuffer, _T("res://"));
00057
00058    _TCHAR *szTemp = szBuffer + _tcslen(szBuffer);
00059    GetModuleFileName(hInst, szTemp, sizeof(szBuffer) - _tcslen(szBuffer));
00060
00061    _tcscat(szBuffer, _T("/"));
00062    MAKE_TSTRPTR_FROMWIDE(szname, szResource);
00063    _tcscat(szBuffer, szname);
00064
00065    MAKE_WIDEPTR_FROMTSTR(wszname, szBuffer);
00066    LPOLESTR szOutBuffer = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(wszname) + 1)  * sizeof(WCHAR)));
00067
00068    wcscpy(szOutBuffer, wszname);
00069
00070    return szOutBuffer;
00071
00072 } //end CreateResoucePath()
00073
00074
00075 static LPOLESTR OleDuplicateString(LPOLESTR lpStr) {
00076     LPOLESTR tmp = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(lpStr) + 1)  * sizeof(WCHAR)));
00077     wcscpy(tmp, lpStr);
00078
00079     return tmp;
00080 }
00081
00082
00083 //==============================================================
00084 //
00085 // CPeoplePoweredVehicle implementation
00086 //
00087 //
00088 CPeoplePoweredVehicle::CPeoplePoweredVehicle()
00089 {
00090     children[0] = new CBicycleFolder;
00091     children[1] = new CSkateboardFolder;
00092     children[2] = new CIceSkateFolder;
00093 }
00094
00095 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00096 {
00097     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00098         delete children[n];
00099 }
00100
00101 HRESULT CPeoplePoweredVehicle::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00102 {
00103     SCOPEDATAITEM sdi;
00104
00105     if (!bExpanded) {
00106         // create the child nodes, then expand them
00107         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00108             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00109             sdi.mask = SDI_STR       |   // Displayname is valid
00110                 SDI_PARAM     |   // lParam is valid
00111                 SDI_IMAGE     |   // nImage is valid
00112                 SDI_OPENIMAGE |   // nOpenImage is valid
00113                 SDI_PARENT    |   // relativeID is valid
00114                 SDI_CHILDREN;     // cChildren is valid
00115
00116             sdi.relativeID  = (HSCOPEITEM)parent;
00117             sdi.nImage      = children[n]->GetBitmapIndex();
00118             sdi.nOpenImage  = INDEX_OPENFOLDER;
00119             sdi.displayname = MMC_CALLBACK;
00120             sdi.lParam      = (LPARAM)children[n];       // The cookie
00121             sdi.cChildren   = 0;
00122
00123             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00124
00125             _ASSERT( SUCCEEDED(hr) );
00126         }
00127     }
00128
00129     return S_OK;
00130 }
00131
00132 CBicycleFolder::CBicycleFolder()
00133 {
00134     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00135         children[n] = new CBicycle(n + 1);
00136     }
00137 }
00138
00139 CBicycleFolder::~CBicycleFolder()
00140 {
00141     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00142         if (children[n]) {
00143             delete children[n];
00144         }
00145 }
00146
00147 HRESULT CBicycleFolder::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00148 {
00149   TCHAR taskpad[1024];
00150     TCHAR szThis[16];
00151
00152     _ultot((unsigned long)this, szThis, 16);
00153   _tcscpy(taskpad, _T("horizontal.htm#"));
00154     _tcscat(taskpad, szThis);
00155     MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, taskpad);
00156
00157   *ppViewType = CreateResourcePath( NULL, pszW );
00158
00159     *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00160     return S_OK;
00161 }
00162
00163 MMC_TASK *CBicycleFolder::GetTaskList(LPOLESTR szTaskGroup, LONG *nCount)
00164 {
00165     *nCount = 5;
00166
00167     MMC_TASK *tasks = new MMC_TASK[*nCount];
00168
00169     for (int t = 0; t < *nCount; t++) {
00170         tasks[t].sDisplayObject.eDisplayType = MMC_TASK_DISPLAY_TYPE_BITMAP;
00171         tasks[t].sDisplayObject.uBitmap.szMouseOverBitmap = CreateResourcePath(g_hinst, L"buttonover.bmp");
00172         tasks[t].sDisplayObject.uBitmap.szMouseOffBitmap = CreateResourcePath(g_hinst, L"buttonoff.bmp");
00173
00174         switch (t) {
00175         case 0:
00176             tasks[t].szText = OleDuplicateString(L"Tune bicycle");
00177             tasks[t].szHelpString = OleDuplicateString(L"Click here to Tune bicycle");
00178
00179             break;
00180         case 1:
00181             tasks[t].szText = OleDuplicateString(L"Ride bicycle");
00182             tasks[t].szHelpString = OleDuplicateString(L"Click here to ride bicycle");
00183
00184             break;
00185         case 2:
00186             tasks[t].szText = OleDuplicateString(L"Stop riding bicycle");
00187             tasks[t].szHelpString = OleDuplicateString(L"Click here to stop riding bicycle");
00188
00189             break;
00190         case 3:
00191             tasks[t].szText = OleDuplicateString(L"Purchase bicycle");
00192             tasks[t].szHelpString = OleDuplicateString(L"Click here to purchase bicycle");
00193
00194         case 4:
00195             tasks[t].szText = OleDuplicateString(L"Sell bicycle");
00196             tasks[t].szHelpString = OleDuplicateString(L"Click here to sell bicycle");
00197
00198             break;
00199         }
00200
00201         tasks[t].eActionType = MMC_ACTION_ID;
00202         tasks[t].nCommandID = t;
00203     }
00204
00205     return tasks;
00206 }
00207
00208 HRESULT CBicycleFolder::TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2)
00209 {
00210     RESULTDATAITEM rdi;
00211     IResultData *pResultData;
00212
00213     ZeroMemory(&rdi, sizeof(RESULTDATAITEM));
00214
00215     HRESULT hr = S_OK;
00216
00217     hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00218
00219     if (SUCCEEDED(hr)) {
00220
00221         rdi.mask = RDI_STATE | RDI_PARAM;  // Use selected state to get param.
00222         rdi.nState = LVIS_SELECTED | LVIS_FOCUSED;
00223         rdi.nIndex = -1;  // Start looking for selected item from top of list view
00224
00225         hr = pResultData->GetNextItem(&rdi);
00226
00227         pResultData->Release();
00228     }
00229
00230     if (SUCCEEDED(hr)) {
00231         _TCHAR buf[256];
00232
00233         switch (v1->lVal) {
00234         case 0:
00235             wsprintf(buf, _T("Bicycle %d tuned."), rdi.nIndex);
00236
00237             break;
00238         case 1:
00239             wsprintf(buf, _T("Riding bicycle %d."), rdi.nIndex);
00240
00241             break;
00242         case 2:
00243             wsprintf(buf, _T("Not riding bicycle %d."), rdi.nIndex);
00244
00245             break;
00246         case 3:
00247             wsprintf(buf, _T("Bicycle %d purchased."), rdi.nIndex);
00248
00249             break;
00250         case 4:
00251             wsprintf(buf, _T("Bicycle %d sold."), rdi.nIndex);
00252
00253             break;
00254         case 102:
00255             wsprintf(buf, _T("Special bicycle task choosen (%d)."), rdi.nIndex);
00256
00257             break;
00258         }
00259
00260         MessageBox(NULL, buf, _T("Task Notification"), MB_OK | MB_ICONINFORMATION);
00261     }
00262
00263     return hr;
00264 }
00265
00266 HRESULT CBicycleFolder::GetTaskpadTitle(LPOLESTR *pszTitle)
00267 {
00268         *pszTitle = OleDuplicateString(L"Bicycle Tasks");
00269         return S_OK;
00270 }
00271
00272 HRESULT CBicycleFolder::GetTaskpadDescription(LPOLESTR *pszDescription)
00273 {
00274         *pszDescription = OleDuplicateString(L"This is a sample task pad for bicycle nodes");
00275         return S_OK;
00276 }
00277
00278 HRESULT CBicycleFolder::GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO)
00279 {
00280         pTDO->eDisplayType = MMC_TASK_DISPLAY_TYPE_BITMAP;
00281         pTDO->uBitmap.szMouseOverBitmap = CreateResourcePath(g_hinst, L"bicycle.bmp");
00282         return S_OK;
00283 }
00284
00285 HRESULT CBicycleFolder::GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo)
00286 {
00287         lpListPadInfo->szTitle = OleDuplicateString(L"Bicycle");
00288         lpListPadInfo->szButtonText = OleDuplicateString(L"Special");
00289         lpListPadInfo->nCommandID = 102;
00290         return S_OK;
00291 }
00292
00293 HRESULT CBicycleFolder::OnListpad(IConsole *pConsole, BOOL bAttaching)
00294 {
00295     HRESULT      hr = S_OK;
00296
00297     IHeaderCtrl *pHeaderCtrl = NULL;
00298     IResultData *pResultData = NULL;
00299     IImageList  *pImageList  = NULL;
00300
00301     if (bAttaching) {
00302         hr = pConsole->QueryResultImageList(&pImageList);
00303         _ASSERT( SUCCEEDED(hr) );
00304
00305         hr = pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00306                                            (long *)m_pBMapLg, // pointer to a handle
00307                                            0, // index of the first image in the strip
00308                                            RGB(0, 128, 128)  // color of the icon mask
00309             );
00310         _ASSERT( SUCCEEDED(hr) );
00311
00312         pImageList->Release();
00313
00314         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00315         _ASSERT( SUCCEEDED(hr) );
00316
00317         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00318         _ASSERT( SUCCEEDED(hr) );
00319
00320         // Set the column headers in the results pane
00321         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00322         _ASSERT( S_OK == hr );
00323         hr = pHeaderCtrl->InsertColumn( 1, L"Bicycle License      ", 0, MMCLV_AUTO );
00324         _ASSERT( S_OK == hr );
00325
00326         // insert items here
00327         RESULTDATAITEM rdi;
00328
00329         hr = pResultData->DeleteAllRsltItems();
00330         _ASSERT( SUCCEEDED(hr) );
00331
00332         if (!bExpanded) {
00333             // create the child nodes, then expand them
00334             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00335                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00336                 rdi.mask       = RDI_STR       |   // Displayname is valid
00337                     RDI_IMAGE     |
00338                     RDI_PARAM;        // nImage is valid
00339
00340                 rdi.nImage      = children[n]->GetBitmapIndex();
00341                 rdi.str         = MMC_CALLBACK;
00342                 rdi.nCol        = 0;
00343                 rdi.lParam      = (LPARAM)children[n];
00344
00345                 hr = pResultData->InsertItem( &rdi );
00346
00347                 _ASSERT( SUCCEEDED(hr) );
00348             }
00349         }
00350
00351         pHeaderCtrl->Release();
00352         pResultData->Release();
00353     }
00354
00355     return hr;
00356 }
00357
00358 CIceSkateFolder::CIceSkateFolder()
00359 {
00360     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00361         children[n] = new CIceSkate(n + 1);
00362     }
00363 }
00364
00365 CIceSkateFolder::~CIceSkateFolder()
00366 {
00367     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00368         if (children[n]) {
00369             delete children[n];
00370         }
00371 }
00372
00373 HRESULT CIceSkateFolder::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00374 {
00375
00376   TCHAR taskpad[1024];
00377     TCHAR szThis[16];
00378
00379     _ultot((unsigned long)this, szThis, 16);
00380   _tcscpy(taskpad, _T("listpad.htm#"));
00381     _tcscat(taskpad, szThis);
00382     MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, taskpad);
00383
00384   *ppViewType = CreateResourcePath( NULL, pszW );
00385
00386     *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00387     return S_OK;
00388 }
00389
00390 MMC_TASK *CIceSkateFolder::GetTaskList(LPOLESTR szTaskGroup, LONG *nCount)
00391 {
00392     *nCount = 4;
00393
00394     MMC_TASK *tasks = new MMC_TASK[*nCount];
00395
00396     for (int t = 0; t < *nCount; t++) {
00397         tasks[t].sDisplayObject.eDisplayType = MMC_TASK_DISPLAY_TYPE_BITMAP;
00398         tasks[t].sDisplayObject.uBitmap.szMouseOverBitmap = CreateResourcePath(g_hinst, L"buttonover.bmp");
00399         tasks[t].sDisplayObject.uBitmap.szMouseOffBitmap = CreateResourcePath(g_hinst, L"buttonoff.bmp");
00400
00401         switch (t) {
00402         case 0:
00403             tasks[t].szText = OleDuplicateString(L"Sharpen Skate");
00404             tasks[t].szHelpString = OleDuplicateString(L"Click here to Sharpen skate");
00405
00406             break;
00407         case 1:
00408             tasks[t].szText = OleDuplicateString(L"Tighten skate laces");
00409             tasks[t].szHelpString = OleDuplicateString(L"Click here to Tighten skate");
00410
00411             break;
00412         case 2:
00413             tasks[t].szText = OleDuplicateString(L"Wear skate");
00414             tasks[t].szHelpString = OleDuplicateString(L"Click here to Wear skate");
00415
00416             break;
00417         case 3:
00418             tasks[t].szText = OleDuplicateString(L"Remove skate");
00419             tasks[t].szHelpString = OleDuplicateString(L"Click here to Remove skate");
00420
00421             break;
00422         }
00423
00424         tasks[t].eActionType = MMC_ACTION_ID;
00425         tasks[t].nCommandID = t;
00426     }
00427
00428     return tasks;
00429 }
00430
00431 HRESULT CIceSkateFolder::TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2)
00432 {
00433     RESULTDATAITEM rdi;
00434     IResultData *pResultData;
00435
00436     ZeroMemory(&rdi, sizeof(RESULTDATAITEM));
00437
00438     HRESULT hr = S_OK;
00439
00440     hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00441
00442     if (SUCCEEDED(hr)) {
00443
00444         rdi.mask = RDI_STATE | RDI_PARAM;  // Use selected state to get param.
00445         rdi.nState = LVIS_SELECTED | LVIS_FOCUSED;
00446         rdi.nIndex = -1;  // Start looking for selected item from top of list view
00447
00448         hr = pResultData->GetNextItem(&rdi);
00449
00450         pResultData->Release();
00451     }
00452
00453     if (SUCCEEDED(hr)) {
00454         _TCHAR buf[256];
00455
00456         switch (v1->lVal) {
00457         case 0:
00458             wsprintf(buf, _T("Skate %d sharpened."), rdi.nIndex);
00459
00460             break;
00461         case 1:
00462             wsprintf(buf, _T("Skate %d tightened."), rdi.nIndex);
00463
00464             break;
00465         case 2:
00466             wsprintf(buf, _T("Wearing skate %d."), rdi.nIndex);
00467
00468             break;
00469         case 3:
00470             wsprintf(buf, _T("Skate %d removed."), rdi.nIndex);
00471
00472             break;
00473         case 101:
00474             wsprintf(buf, _T("Special skate task choosen (%d)."), rdi.nIndex);
00475
00476             break;
00477         }
00478
00479         MessageBox(NULL, buf, _T("Task Notification"), MB_OK | MB_ICONINFORMATION);
00480     }
00481
00482     return hr;
00483 }
00484
00485 HRESULT CIceSkateFolder::GetTaskpadTitle(LPOLESTR *pszTitle)
00486 {
00487         *pszTitle = OleDuplicateString(L"Iceskate Tasks");
00488         return S_OK;
00489 }
00490
00491 HRESULT CIceSkateFolder::GetTaskpadDescription(LPOLESTR *pszDescription)
00492 {
00493         *pszDescription = OleDuplicateString(L"This is a sample task pad for ice skate nodes");
00494         return S_OK;
00495 }
00496
00497 HRESULT CIceSkateFolder::GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO)
00498 {
00499         pTDO->eDisplayType = MMC_TASK_DISPLAY_TYPE_BITMAP;
00500         pTDO->uBitmap.szMouseOverBitmap = CreateResourcePath(g_hinst, L"iceskate.bmp");
00501         return S_OK;
00502 }
00503
00504 HRESULT CIceSkateFolder::GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo)
00505 {
00506         lpListPadInfo->szTitle = OleDuplicateString(L"Ice Skates");
00507         lpListPadInfo->szButtonText = OleDuplicateString(L"Special");
00508         lpListPadInfo->nCommandID = 101;
00509         return S_OK;
00510 }
00511
00512 HRESULT CIceSkateFolder::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00513 {
00514     IConsole2 *pConsole2;
00515     HRESULT hr = S_OK;
00516
00517     if (TRUE == bSelect) {
00518         hr = pConsole->QueryInterface(IID_IConsole2, (void **)&pConsole2);
00519
00520         if (SUCCEEDED(hr)) {
00521             hr = pConsole2->SetStatusText(L"Hello, you've selected the ice skate folder");
00522             pConsole2->Release();
00523         }
00524     }
00525
00526     return hr;
00527 }
00528
00529 HRESULT CIceSkateFolder::OnListpad(IConsole *pConsole, BOOL bAttaching)
00530 {
00531     HRESULT      hr = S_OK;
00532
00533     IHeaderCtrl *pHeaderCtrl = NULL;
00534     IResultData *pResultData = NULL;
00535     IImageList  *pImageList  = NULL;
00536
00537     if (bAttaching) {
00538         hr = pConsole->QueryResultImageList(&pImageList);
00539         _ASSERT( SUCCEEDED(hr) );
00540
00541         hr = pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00542                                            (long *)m_pBMapLg, // pointer to a handle
00543                                            0, // index of the first image in the strip
00544                                            RGB(0, 128, 128)  // color of the icon mask
00545             );
00546         _ASSERT( SUCCEEDED(hr) );
00547
00548         pImageList->Release();
00549
00550         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00551         _ASSERT( SUCCEEDED(hr) );
00552
00553         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00554         _ASSERT( SUCCEEDED(hr) );
00555
00556         // Set the column headers in the results pane
00557         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00558         _ASSERT( S_OK == hr );
00559         hr = pHeaderCtrl->InsertColumn( 1, L"Sharpness           ", 0, MMCLV_AUTO );
00560         _ASSERT( S_OK == hr );
00561
00562         // insert items here
00563         RESULTDATAITEM rdi;
00564
00565         hr = pResultData->DeleteAllRsltItems();
00566         _ASSERT( SUCCEEDED(hr) );
00567
00568         if (!bExpanded) {
00569             // create the child nodes, then expand them
00570             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00571                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00572                 rdi.mask       = RDI_STR       |   // Displayname is valid
00573                     RDI_IMAGE     |
00574                     RDI_PARAM;        // nImage is valid
00575
00576                 rdi.nImage      = children[n]->GetBitmapIndex();
00577                 rdi.str         = MMC_CALLBACK;
00578                 rdi.nCol        = 0;
00579                 rdi.lParam      = (LPARAM)children[n];
00580
00581                 hr = pResultData->InsertItem( &rdi );
00582
00583                 _ASSERT( SUCCEEDED(hr) );
00584             }
00585         }
00586
00587         pHeaderCtrl->Release();
00588         pResultData->Release();
00589     }
00590
00591     return hr;
00592 }
00593
00594 HRESULT CIceSkate::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00595 {
00596     bSelected = bSelect ? true : false;
00597
00598     return S_FALSE;
00599 }
00600
00601 CSkateboardFolder::CSkateboardFolder()
00602 {
00603     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00604         children[n] = new CSkateboard(n + 1);
00605     }
00606 }
00607
00608 CSkateboardFolder::~CSkateboardFolder()
00609 {
00610     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00611         if (children[n]) {
00612             delete children[n];
00613         }
00614 }
00615
00616 HRESULT CSkateboardFolder::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00617 {
00618   TCHAR taskpad[1024];
00619     TCHAR szThis[16];
00620
00621     _ultot((unsigned long)this, szThis, 16);
00622   _tcscpy(taskpad, _T("default.htm#"));
00623     _tcscat(taskpad, szThis);
00624     MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, taskpad);
00625
00626   *ppViewType = CreateResourcePath( NULL, pszW );
00627
00628     *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00629     return S_OK;
00630 }
00631
00632 MMC_TASK *CSkateboardFolder::GetTaskList(LPOLESTR szTaskGroup, LONG *nCount)
00633 {
00634     *nCount = 4;
00635
00636     _TCHAR buf[256];
00637     MMC_TASK *tasks = new MMC_TASK[*nCount];
00638
00639     for (int t = 0; t < *nCount; t++) {
00640         tasks[t].sDisplayObject.eDisplayType = MMC_TASK_DISPLAY_TYPE_BITMAP;
00641         tasks[t].sDisplayObject.uBitmap.szMouseOverBitmap = CreateResourcePath(g_hinst, L"buttonover.bmp");
00642         tasks[t].sDisplayObject.uBitmap.szMouseOffBitmap = CreateResourcePath(g_hinst, L"buttonoff.bmp");
00643
00644         _stprintf(buf, _T("Task #%d"), t);
00645         MAKE_WIDEPTR_FROMTSTR(wszText, buf);
00646         tasks[t].szText = OleDuplicateString(wszText);
00647
00648         _stprintf(buf, _T("Click here to start task #%d"), t);
00649         MAKE_WIDEPTR_FROMTSTR(wszHelpString, buf);
00650         tasks[t].szHelpString = OleDuplicateString(wszHelpString);
00651
00652         tasks[t].eActionType = MMC_ACTION_ID;
00653         tasks[t].nCommandID = t;
00654     }
00655
00656     return tasks;
00657 }
00658
00659 HRESULT CSkateboardFolder::TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2)
00660 {
00661     _TCHAR buf[256];
00662
00663     wsprintf(buf, _T("Skateboard task %ld has been selected."), v1->lVal);
00664
00665     MessageBox(NULL, buf, _T("Task Notification"), MB_OK | MB_ICONINFORMATION);
00666
00667     return S_OK;
00668 }
00669
00670 HRESULT CSkateboardFolder::GetTaskpadTitle(LPOLESTR *pszTitle)
00671 {
00672         *pszTitle = OleDuplicateString(L"Skateboard Tasks");
00673         return S_OK;
00674 }
00675
00676 HRESULT CSkateboardFolder::GetTaskpadDescription(LPOLESTR *pszDescription)
00677 {
00678         *pszDescription = OleDuplicateString(L"This is a sample task pad for skateboard nodes");
00679         return S_OK;
00680 }
00681
00682 HRESULT CSkateboardFolder::GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO)
00683 {
00684         pTDO->eDisplayType = MMC_TASK_DISPLAY_TYPE_BITMAP;
00685         pTDO->uBitmap.szMouseOverBitmap = CreateResourcePath(g_hinst, L"skateboard.bmp");
00686         return S_OK;
00687 }
00688
00689 HRESULT CSkateboardFolder::GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo)
00690 {
00691         return S_FALSE;
00692 }
00693
00694 const _TCHAR *CBicycle::GetDisplayName(int nCol)
00695 {
00696     static _TCHAR buf[128];
00697
00698     if (nCol == 0) {
00699         _stprintf(buf, _T("Bicycle #%d"), id);
00700     } else if (nCol == 1) {
00701         _stprintf(buf, _T("%ld"), (long)this);
00702     }
00703
00704     return buf;
00705 }
00706
00707 const _TCHAR *CSkateboard::GetDisplayName(int nCol)
00708 {
00709     static _TCHAR buf[128];
00710
00711     _stprintf(buf, _T("Skateboard #%d"), id);
00712
00713     return buf;
00714 }
00715
00716 const _TCHAR *CIceSkate::GetDisplayName(int nCol)
00717 {
00718     static _TCHAR buf[128];
00719
00720     if (nCol == 0) {
00721         _stprintf(buf, _T("Ice Skate #%d"), id);
00722     } else if (nCol == 1) {
00723         _stprintf(buf, _T("Sharpness %ld"), (long)this);
00724     }
00725
00726     return buf;
00727 }
00728
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_htdata Member List

This is the complete list of members for _htdata, including all inherited members.
iRecord | _htdata
point | _htdata
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ASyncRead/areadcli.c Source File

  • Web
  • iis
  • extensions
  • io
  • ASyncRead

areadcli.c

Go to the documentation of this file.
00001 /* Copyright (c) 1997-2002 Microsoft Corporation
00002
00003 Module Name:
00004
00005     AReadCli.c
00006
00007 Abstract:
00008
00009     This module demonstrates using asynchronous ReadClient call
00010     to read data sent from client. On return, this sends the
00011     followings back to client:
00012
00013     1) the number of bytes intended to send
00014     2) the number of bytes actually read.
00015     3) data content
00016 */
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <httpext.h>
00021
00022 #define MAX_BUF_SIZE        (49152)                 /* Max number of bytes for each read - 48K */
00023 #define MEM_ALLOC_THRESHOLD (1024 * 1024)           /* Default heap size is 1M */
00024
00025 typedef struct _IO_WORK_ITEM {
00026
00027     PBYTE                    pbDATAFromClient;   /* Grand read data holder */
00028     DWORD                    cbReadSoFar;        /* Number of bytes read so far */
00029                                                  /* and is used as index for pbDATAFromClient */
00030     EXTENSION_CONTROL_BLOCK *pecb;
00031
00032 }  IO_WORK_ITEM, * PIOWI;
00033
00034 /* Sample Form for doing a POST method */
00035
00036 static CHAR             g_szPostForm[] =
00037                         "<h2>Asychronous ReadClient Sample Post Form</h2><p>\r\n\r\n"
00038                         "This demonstrates a post request being sent by this form to the sample ISAPI - AReadCli.dll<p>\r\n\r\n"
00039                         "AReadCli.dll reads data posted by this form and send it back to the browser.<p>\r\n"
00040                         "<h3>Post Form</h3>\r\n"
00041                         "Please enter data below:<br>\r\n"
00042                         "<form method=POST action=\"areadcli.dll\">\r\n"
00043                         "<textarea name=\"Data\" cols=48 rows=4></textarea>\r\n\r\n"
00044                         "<input type=submit> <input type=reset>\r\n"
00045                         "</form>";
00046
00047 /* Report read data */
00048
00049 static CHAR             g_szReport[] =
00050                         "Bytes count including \"Data=\"  \r\n"
00051                         "ECB Total Bytes:    %d.\r\n"
00052                         "Actual Read Bytes:  %d.\r\n";
00053
00054 DWORD DoInit(IN OUT PIOWI piowi);
00055 VOID DoCleanUp(IN PIOWI piowi);
00056 DWORD DoAsyncReadClient(IN PIOWI piowi);
00057 VOID WINAPI AsyncReadClientIoCompletion(IN LPEXTENSION_CONTROL_BLOCK pecb, IN PVOID pContext, IN DWORD cbIO, IN DWORD dwError);
00058 DWORD SendMSGToClient(IN LPEXTENSION_CONTROL_BLOCK pecb, IN LPCSTR pszErrorMsg);
00059 LPVOID AR_Allocate(IN LPEXTENSION_CONTROL_BLOCK pecb, IN DWORD dwSize);
00060 BOOL AR_Free(IN LPEXTENSION_CONTROL_BLOCK pecb, IN LPVOID pvData);
00061
00062 /*
00063   Description:
00064
00065     This function DllLibMain() is the main initialization function for
00066     this DLL. It initializes local variables and prepares it to be invoked
00067     subsequently.
00068
00069   Arguments:
00070
00071     hinstDll          Instance Handle of the DLL
00072     fdwReason         Reason why NT called this DLL
00073     lpvReserved       Reserved parameter for future use.
00074
00075   Return Value:
00076
00077     fReturns TRUE if successful; otherwise FALSE is fReturned.
00078 */
00079
00080 DllMain(IN HINSTANCE hinstDll, IN DWORD fdwReason, IN LPVOID lpvContext OPTIONAL)
00081 {
00082   BOOL fReturn = TRUE;
00083
00084   switch (fdwReason) {
00085
00086     case DLL_PROCESS_ATTACH :
00087
00088         OutputDebugString("Initializing the global data for areadcli.dll\n");
00089
00090         /* Prevent the system from calling DllMain when threads are created or destroyed. */
00091
00092         DisableThreadLibraryCalls(hinstDll);
00093
00094         /* Initialize various data and modules. */
00095
00096         break;
00097
00098     case DLL_PROCESS_DETACH :
00099
00100         if (lpvContext != NULL)
00101         {
00102         }
00103
00104         break;
00105
00106     default:
00107
00108       break;
00109   }
00110
00111   return fReturn;
00112 }
00113
00114 /*
00115   Description:
00116
00117     Sets the ISAPI extension version information.
00118
00119   Arguments:
00120
00121     Version     pointer to HSE_VERSION_INFO structure
00122
00123   Return Value:
00124
00125     TRUE
00126 */
00127
00128 BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer)
00129 {
00130   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00131
00132   lstrcpyn((LPSTR) pVer->lpszExtensionDesc, "Asynchronous Read Client Sample ISAPI DLL", HSE_MAX_EXT_DLL_NAME_LEN);
00133
00134   return TRUE;
00135 }
00136
00137 /*
00138   Description:
00139
00140     This is the main routine for any ISAPI application. Inside DoASyncReadClient,
00141     proper action will be performed to read data from client asynchronously. Any data
00142     read from client will be sent back to the client by using synchronous WriteClient.
00143
00144   Arguments:
00145
00146     pecb        pointer to ECB containing parameters related to the request.
00147
00148   Return Value:
00149
00150     HSE_STATUS_SUCCESS
00151     HSE_STATUS_PENDING
00152     HSE_STATUS_ERROR
00153 */
00154
00155 DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK pecb)
00156 {
00157   PIOWI   piowi;
00158   DWORD   hseStatus = HSE_STATUS_SUCCESS;
00159
00160   /*
00161     The string length of textarea name "Data=" is 5.
00162     Available bytes <= 5 indicates that no user-
00163     entered data has been sent, and the post form
00164     is shown.
00165   */
00166
00167   if (pecb->cbAvailable <= 5) {
00168
00169       hseStatus = SendMSGToClient(pecb, g_szPostForm);
00170
00171   } else {
00172
00173     piowi  = (PIOWI)LocalAlloc(LMEM_FIXED, sizeof(IO_WORK_ITEM));
00174
00175     if (NULL == piowi) {
00176
00177       SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00178
00179       return HSE_STATUS_ERROR;
00180     }
00181
00182     piowi->pecb = pecb;
00183
00184     /*
00185       Init Grand data holder, assign the first chunk(read-ahead chunk)
00186       and update the index (cbRreadSoFar) of the grand data holder.
00187     */
00188
00189     hseStatus = DoInit(piowi);
00190
00191     if (HSE_STATUS_ERROR != hseStatus) {
00192
00193       /* Now we are ready to do asynchronous readclient here */
00194
00195       hseStatus = DoAsyncReadClient(piowi);
00196
00197       if (hseStatus != HSE_STATUS_PENDING) {
00198
00199         /* When IO finishes, tell IIS we will end the session. Also clean up other resources here */
00200
00201         DoCleanUp(piowi);
00202       }
00203     }
00204   }
00205
00206   return hseStatus;
00207 }
00208
00209 /*
00210   Description:
00211
00212     This function is called when the WWW service is shutdown
00213
00214   Arguments:
00215
00216     dwFlags - HSE_TERM_ADVISORY_UNLOAD or HSE_TERM_MUST_UNLOAD
00217
00218   Return Value:
00219
00220     TRUE
00221 */
00222
00223 BOOL WINAPI TerminateExtension(DWORD dwFlags)
00224 {
00225   return TRUE;
00226 }
00227
00228 /*
00229   Description:
00230
00231     Prepare header, SendHeaderExInfo struct and write whatever
00232     message is intended to send to the client.
00233
00234   Arguments:
00235
00236     pecb        - pointer to ECB containing parameters related to the request.
00237     pszMsg      - pointer to the body of the message that is sent to the content.
00238
00239   Return Value:
00240
00241     HSE_STATUS_SUCCESS
00242     HSE_STATUS_ERROR
00243 */
00244
00245 DWORD SendMSGToClient(IN LPEXTENSION_CONTROL_BLOCK  pecb, IN LPCSTR pszMsg)
00246 {
00247   HSE_SEND_HEADER_EX_INFO SHEI;
00248
00249   BOOL    fReturn;
00250   DWORD   cbText;
00251   DWORD   hseStatus = HSE_STATUS_SUCCESS;
00252   CHAR    *pszText = NULL;
00253
00254   CHAR    szStatus[] = "200 OK";
00255   CHAR    szHeaderBase[] = "Content-type: text/html\r\n\r\n";
00256
00257   /*
00258     Populate SendHeaderExInfo struct
00259
00260     NOTE we must send Content-Length header with correct
00261     byte count in order for keep-alive to work.
00262   */
00263
00264   SHEI.pszStatus = szStatus;
00265   SHEI.pszHeader = szHeaderBase;
00266   SHEI.cchStatus = lstrlen(szStatus);
00267   SHEI.cchHeader = lstrlen(szHeaderBase);
00268   SHEI.fKeepConn = FALSE;
00269
00270   /* Build page */
00271
00272   cbText = strlen("<head><title>Simple Async Read Client Sample</title></head>\n<body></body>\n") + strlen(pszMsg) + 1;
00273
00274   pszText = (PCHAR)AR_Allocate(pecb, cbText);
00275
00276   /* Verify allocation */
00277
00278   if (NULL == pszText) {
00279
00280     SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00281
00282     return HSE_STATUS_ERROR;
00283   }
00284
00285   strcpy(pszText, "<head><title>Simple Async Read Client Sample</title></head>\n");
00286   strcat(pszText, "<body>");
00287   strcat(pszText, pszMsg);
00288   strcat(pszText, "</body>\n");
00289
00290   cbText = (DWORD)strlen(pszText);
00291
00292   /* Send header and body text to client */
00293
00294   fReturn = pecb->ServerSupportFunction(pecb->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SHEI, NULL, NULL);
00295
00296   fReturn &= pecb->WriteClient(pecb->ConnID, pszText, &cbText, 0);
00297
00298   if (!fReturn)
00299     hseStatus = HSE_STATUS_ERROR;
00300
00301   AR_Free(pecb, pszText);
00302
00303   return hseStatus;
00304 }
00305
00306 /*
00307   Description:
00308
00309     The caller of the asynchrnous read client.
00310
00311   Arguments:
00312
00313     piowi       pointer to the work item
00314
00315   Return Value:
00316
00317     HSE_STATUS_SUCCESS
00318     HSE_STATUS_PENDING
00319     HSE_STATUS_ERROR
00320 */
00321
00322 DWORD DoAsyncReadClient(IN PIOWI piowi)
00323 {
00324   BOOL    fReturn;
00325   CHAR    szTmp[MAX_BUF_SIZE];
00326   DWORD   dwFlags;
00327   DWORD   cbTotalToRead = MAX_BUF_SIZE;
00328   DWORD   hseStatus =  HSE_STATUS_PENDING;
00329   BYTE    *pbData = NULL;
00330
00331   /*
00332     Check if cbTotalBytes == cbAvailable if so lpbData contains all the data sent by
00333     the client, and complete the session.
00334   */
00335
00336   if (piowi->pecb->cbTotalBytes == piowi->pecb->cbAvailable) {
00337
00338     /* Construct the report and write it to client */
00339
00340     pbData = (PBYTE)AR_Allocate(piowi->pecb, piowi->pecb->cbAvailable + MAX_BUF_SIZE);
00341
00342     if (NULL == pbData) {
00343
00344       SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00345
00346       return HSE_STATUS_ERROR;
00347     }
00348
00349     wsprintf(pbData, g_szReport, piowi->pecb->cbTotalBytes, piowi->pecb->cbAvailable);
00350
00351     strcat(pbData, piowi->pecb->lpbData);
00352
00353     hseStatus = SendMSGToClient(piowi->pecb, pbData);
00354
00355     AR_Free(piowi->pecb, pbData);
00356
00357     DoCleanUp(piowi);
00358
00359     return hseStatus; // HSE_STATUS_SUCCESS or HSE_STATUS_ERROR;
00360   }
00361
00362   /*
00363     There is more to read. Set a call back function and context that will
00364     be used for handling asynchrnous IO operations. This only needs to set up once.
00365   */
00366
00367   fReturn = piowi->pecb->ServerSupportFunction(piowi->pecb->ConnID, HSE_REQ_IO_COMPLETION, AsyncReadClientIoCompletion, 0, (LPDWORD)piowi);
00368
00369   if (!fReturn) {
00370
00371     wsprintf (szTmp, "Problem occurred at ServerSupportFunction() sending HSE_REQ_IO_COMPLETION request.");
00372
00373     SendMSGToClient(piowi->pecb, szTmp);
00374
00375     return HSE_STATUS_ERROR;
00376   }
00377
00378   /*
00379     Fire off the call to perform an asynchronus read from the client.
00380
00381     We need to first check if the size of the remaining chunk
00382     is less than MAX_BUF_SIZE, if so just read what is available,
00383     otherwise read MAX_BUF_SIZE bytes of data.
00384   */
00385
00386   cbTotalToRead = piowi->pecb->cbTotalBytes - piowi->cbReadSoFar;
00387
00388   if (cbTotalToRead > MAX_BUF_SIZE)
00389     cbTotalToRead = MAX_BUF_SIZE;
00390
00391   dwFlags = HSE_IO_ASYNC;
00392
00393   /* append the new chunk to buffer, cbReadSoFar indexes the byte right after the last written byte in the buffer */
00394
00395   fReturn = piowi->pecb->ServerSupportFunction(piowi->pecb->ConnID, HSE_REQ_ASYNC_READ_CLIENT, piowi->pbDATAFromClient +  piowi->cbReadSoFar, &cbTotalToRead, &dwFlags);
00396
00397   if (!fReturn) {
00398
00399     wsprintf(szTmp, "Problem occurred at ServerSupportFunction() sending HSE_REQ_ASYNC_READ_CLIENT request.");
00400
00401     SendMSGToClient(piowi->pecb, szTmp);
00402
00403     hseStatus = HSE_STATUS_ERROR;
00404   }
00405
00406   return hseStatus;
00407 }
00408
00409 /*
00410   Description:
00411
00412     This is the callback function for handling completions of asynchronous ReadClient.
00413     This function resubmits additional IO to read the next chunk of data from the
00414     client. If there is no more data to read or problem during operation, this function
00415     will inform IIS that it is about to end the request session.
00416
00417   Arguments:
00418
00419     pecb        - extension control block
00420     pContext    - this is a IO_WORK_ITEM
00421     cbIO        - bytes just read
00422     dwError     - Win32 error status code
00423
00424   fReturn Value:
00425
00426     None
00427 */
00428
00429 VOID WINAPI AsyncReadClientIoCompletion(IN LPEXTENSION_CONTROL_BLOCK pECB, IN PVOID pContext, IN DWORD cbIO, IN DWORD dwError)
00430 {
00431   BOOL fReturn;
00432   CHAR szTmp[MAX_BUF_SIZE];
00433   DWORD dwFlags;
00434   DWORD cbTotalToRead;
00435   BYTE *pbData = NULL;
00436   PIOWI piowi = (PIOWI)pContext;
00437   EXTENSION_CONTROL_BLOCK *pecb = piowi->pecb;
00438
00439   if (ERROR_SUCCESS == dwError) {
00440
00441     /* Read successfully, so update current total bytes read (aka index of grand data holder) */
00442
00443     piowi->cbReadSoFar += cbIO;
00444
00445     /* If they are equal, we finish reading all bytes from client */
00446
00447     if (piowi->cbReadSoFar == pecb->cbTotalBytes) {
00448
00449       /* Construct the report and write it to client */
00450
00451       pbData = (PBYTE)AR_Allocate(pecb, piowi->cbReadSoFar + MAX_BUF_SIZE);
00452
00453       if (NULL == pbData) {
00454
00455         SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00456
00457         wsprintf(szTmp, "Failed to allocate memory inside AsyncReadClientIoCompletion().");
00458
00459         SendMSGToClient(pecb, szTmp);
00460
00461         DoCleanUp(piowi);
00462
00463         return;
00464       }
00465
00466       wsprintf(pbData, g_szReport, pecb->cbTotalBytes, piowi->cbReadSoFar);
00467
00468       piowi->pbDATAFromClient[piowi->cbReadSoFar] = 0;
00469
00470       strcat(pbData, piowi->pbDATAFromClient);
00471
00472       SendMSGToClient(pecb, pbData);
00473
00474       AR_Free(piowi->pecb, pbData);
00475
00476       DoCleanUp(piowi);
00477
00478     } else {
00479
00480       /*
00481         Still have more data to read...
00482
00483         We need to first check if the size of the remaining chunk
00484         is less than MAX_BUF_SIZE, if so just read what is available,
00485         otherwise read MAX_BUF_SIZE bytes of data.
00486       */
00487
00488       cbTotalToRead = pecb->cbTotalBytes - piowi->cbReadSoFar;
00489
00490       if (cbTotalToRead > MAX_BUF_SIZE)
00491         cbTotalToRead = MAX_BUF_SIZE;
00492
00493       /* Fire off another call to perform an asynchronus read from the client. */
00494
00495       dwFlags = HSE_IO_ASYNC;
00496
00497       /* append the new chunk to buffer, cbReadSoFar indexes the byte right after the last written byte in the buffer */
00498
00499       fReturn = pecb->ServerSupportFunction(pecb->ConnID, HSE_REQ_ASYNC_READ_CLIENT, piowi->pbDATAFromClient + piowi->cbReadSoFar, &cbTotalToRead, &dwFlags);
00500
00501       if (!fReturn) {
00502
00503         wsprintf(szTmp, "Problem occurred at ServerSupportFunction() sending HSE_REQ_ASYNC_READ_CLIENT request.");
00504
00505         SendMSGToClient(pecb, szTmp);
00506
00507         DoCleanUp(piowi);
00508       }
00509     }
00510
00511   } else {
00512
00513     /* Error on read */
00514
00515     SetLastError(dwError);
00516
00517     DoCleanUp(piowi);
00518   }
00519 }
00520
00521 /*
00522   Description:
00523
00524     Initialize the  Grand data holder, assign the first chunk(read-ahead chunk)
00525     and update the index (cbRreadSoFar) of the grand data holder.
00526
00527   Arguments:
00528
00529     piowi       pointer to the work item
00530
00531   fReturn Value:
00532
00533     HSE_STATUS_SUCCESS or HSE_STATUS_ERROR
00534 */
00535
00536 DWORD DoInit(IN OUT PIOWI piowi)
00537 {
00538   piowi->pbDATAFromClient = (PBYTE)AR_Allocate(piowi->pecb, piowi->pecb->cbTotalBytes + MAX_BUF_SIZE);
00539
00540   if (NULL == piowi->pbDATAFromClient) {
00541
00542     SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00543
00544     return HSE_STATUS_ERROR;
00545   }
00546
00547   /* The first chunk (read-ahead chunk) has arrived. */
00548
00549   strcpy(piowi->pbDATAFromClient, piowi->pecb->lpbData);
00550
00551   piowi->cbReadSoFar = piowi->pecb->cbAvailable;
00552
00553   return HSE_STATUS_SUCCESS;
00554 }
00555
00556 /*
00557   Description:
00558
00559     End the session with IIS and clean up other previous allocated resources.
00560
00561   Arguments:
00562
00563     piowi       pointer to the work item
00564
00565   Return Value:
00566
00567     None
00568 */
00569
00570 VOID DoCleanUp(IN PIOWI piowi)
00571 {
00572   if (piowi->pbDATAFromClient != NULL)
00573     AR_Free( piowi->pecb, piowi->pbDATAFromClient);
00574
00575   piowi->pecb->ServerSupportFunction(piowi->pecb->ConnID, HSE_REQ_DONE_WITH_SESSION, NULL, NULL, NULL);
00576
00577   LocalFree(piowi);
00578
00579   return;
00580 }
00581
00582 /*
00583   Description:
00584
00585     Memory allocation routine. Two different Win32 API's to allocate
00586     bytes in memory, which is based on the number of bytes coming from
00587     the client. If the size is greater than 1 M bytes VirtualAllocate is
00588     used, otherwise HeapAllocate is used.
00589
00590   Arguments:
00591
00592     pecb        - pointer to ECB containing parameters related to the request.
00593     dwSize      - number of bytes to allocate
00594
00595   Return Value:
00596
00597     Pointer to void
00598 */
00599
00600 LPVOID AR_Allocate(IN LPEXTENSION_CONTROL_BLOCK pecb, IN DWORD dwSize)
00601 {
00602   LPVOID pvData = NULL;
00603
00604   if (pecb->cbTotalBytes > MEM_ALLOC_THRESHOLD)
00605     pvData = VirtualAlloc(NULL, dwSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
00606    else
00607     pvData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
00608
00609   return pvData;
00610 }
00611
00612 /*
00613   Description:
00614
00615     Freeing memory routine, a complementary routine to AR_Allocate.
00616     Two different Win32 API's will be used to free up bytes in memory,
00617     which is based on the number of bytes coming from the client. If
00618     the size is greater than 1 M bytes VirtualFree is used. Otherwise,
00619     HeapFree is used.
00620
00621   Arguments:
00622
00623     pecb        - pointer to ECB containing parameters related to the request.
00624     pvData      - pointer to the data to be freed.
00625
00626   Return Value:
00627
00628     TRUE or FALSE
00629 */
00630
00631 BOOL AR_Free( IN LPEXTENSION_CONTROL_BLOCK pecb, IN LPVOID pvData)
00632 {
00633   BOOL fReturn = FALSE;
00634
00635   if (pecb->cbTotalBytes > MEM_ALLOC_THRESHOLD)
00636     fReturn = VirtualFree(pvData, 0, MEM_RELEASE);
00637   else
00638     fReturn = HeapFree(GetProcessHeap(), 0, pvData);
00639
00640   return fReturn;
00641 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/globals.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

globals.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _MMC_GLOBALS_H
00015 #define _MMC_GLOBALS_H
00016
00017 #include <TChar.h>
00018 #include <Mmc.h>
00019 #include <CrtDbg.h>                    // Support for _ASSERT
00020 #include <shlwapi.h>                   // Support for path functions
00021 #include "Guids.h"
00022
00023 #pragma warning(4:4267)   // convertion from size_t to smaller type
00024 #pragma warning(3:4244)   // sizeof returns to INT
00025
00026 class CBaseNode;                       // References
00027 class CDataObject;
00028
00029
00030 //---------------------------------------------------------------------------
00031 extern HINSTANCE g_hInst;              // Global instance handle
00032 extern ULONG     g_uObjectCount;       // Instance count for this object
00033 extern ULONG     g_uServerLocks;       // Server lock count for this object
00034
00035 //---------------------------------------------------------------------------
00036 // Clipformats requiered by MMC
00037
00038 extern CLIPFORMAT g_cfDisplayName;      // DisplayName for our SnapIn node
00039 extern CLIPFORMAT g_cfNodeType;         // GUID of the selected node
00040 extern CLIPFORMAT g_cfSnapinClsid;      // Class ID of this SnapIn
00041 extern CLIPFORMAT g_cfszNodeType;       // String version of namespace GUID
00042
00043 extern CLIPFORMAT g_cfBaseNodePtr;      // Retrieves BaseNode pointer
00044 extern CLIPFORMAT g_cfDataObjPtr;       // Retrieves pointer to CDataObject
00045
00046 //---------------------------------------------------------------------------
00047 //  Global function prototypes
00048
00049 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide );
00050 void _fastcall Ansi2Unicode( CHAR* pszAnsi, WCHAR** ppszWide );
00051 void _fastcall CopyBuffer( WCHAR* pszAnsiPtr, WCHAR** ppszWide );
00052 void _fastcall CopyT2W( LPWSTR strDest, LPCTSTR strSource, size_t count);
00053
00054 void InitClipboardFormats();
00055
00056 HRESULT ExtractFromDataObject( LPDATAOBJECT ipDataObject,CLIPFORMAT cf,ULONG cb,HGLOBAL *phGlobal );
00057
00058 CBaseNode* ExtractBaseNodePtr( LPDATAOBJECT ipDataObject );
00059 CDataObject* ExtractDataObjPtr( LPDATAOBJECT ipDataObject );
00060
00061 LPOLESTR GetHelpFilePath();
00062
00063 //---------------------------------------------------------------------------
00064 //  Global Strings
00065
00066
00067 static TCHAR*  gtszSNAPIN_NAME       = _T("Sample H (MMC 2.0) - MMC Help");
00068 static TCHAR*  gtszABOUT_NAME        = _T("Sample H (MMC 2.0) - ISnapinAbout");
00069
00070
00071 static WCHAR*  gwszROOT_NODE_NAME    = L"MMC Help Sample";
00072 static WCHAR*  gwszABOUT_DESCRIPTION = L"MMC SDK MMC Help Sample";
00073 static WCHAR*  gwszABOUT_PROVIDER    = L"Copyright © 1999 - 2001 Microsoft Corporation";
00074 static WCHAR*  gwszABOUT_VERSION     = L"2.0";
00075
00076 // We need to do this to get around MMC.IDL - it explicitly defines
00077 // the clipboard formats as WCHAR types...
00078 #define T_CCF_DISPLAY_NAME    _T("CCF_DISPLAY_NAME")
00079 #define T_CCF_NODETYPE        _T("CCF_NODETYPE")
00080 #define T_CCF_SZNODETYPE      _T("CCF_SZNODETYPE")
00081 #define T_CCF_SNAPIN_CLASSID  _T("CCF_SNAPIN_CLASSID")
00082
00083 #define T_CCF_BASENODE_PTR    _T("CCF_BASENODE_PTR")
00084 #define T_CCF_DATAOBJ_PTR     _T("CCF_DATAOBJ_PTR")
00085
00086 //---------------------------------------------------------------------------
00087 // Constants
00088
00089 #define NODETYPE_STATIC                100   // Node Types
00090 #define NODETYPE_DEVICE                200
00091 #define NODETYPE_FOLDER                300
00092 #define NODETYPE_VFILE                 400
00093
00094
00095 #define ATTRIBUTE_DATA_ARCHIVE         2     // Node Attributes
00096 #define ATTRIBUTE_DATA_HIDDEN          4
00097 #define ATTRIBUTE_DATA_LOCKED          8
00098 #define ATTRIBUTE_DATA_READONLY        16
00099 #define ATTRIBUTE_BACKUP_DEVICE        2048
00100
00101
00102 #define IMG_DEVICE_DEFAULT             0     // Image Indexes
00103 #define IMG_DEVICE_OFFLINE             1
00104 #define IMG_DATA_FILE                  2
00105 #define IMG_DRIVE_DEFAULT              3
00106 #define IMG_DRIVE_OFFLINE              4
00107 #define IMG_FOLDER_DEFAULT             5
00108 #define IMG_CDROM_DEFAULT              6
00109 #define IMG_REMOVABLE_MEDIA            7
00110
00111 #define IDM_NEW_DEVICE                 100
00112 #define IDM_NEW_FOLDER                 200
00113 #define IDM_TOGGLE_STATUS              300
00114 #define IDM_NEW_VIRTFILE               400
00115
00116 #define STATUS_ONLINE                  1
00117 #define STATUS_OFFLINE                 0
00118
00119 // Define some custom window messages so that objects running in
00120 // different threads can send us commands.
00121 //
00122 #define WM_DEL_DEVICENODES             (WM_USER + 100)
00123 #define WM_ADD_DEVICENODE              (WM_USER + 101)
00124 #define WM_DEVICENODE_CLOSED           (WM_USER + 102)
00125 #define WM_ADD_VIRTUALFILE             (WM_USER + 103)
00126 #define WM_VIRTUALFILE_CLOSED          (WM_USER + 104)
00127
00128
00129 // Defines interfaces which can be requested from IComponentData
00130 // or IComponet's ::GetInterface method
00131 //
00132 #define REQUEST_ICONSOLENAMESPACE2     1000
00133 #define REQUEST_ICONSOLE               1001
00134 #define REQUEST_ICONSOLEVERB           1002
00135 #define REQUEST_IRESULTDATA            1003
00136 #define REQUEST_IHEADERCTRL2           1004
00137 #define REQUEST_IDISPLAYHELP           1005
00138
00139 /////////////////////////////////////////////////////////////////////////////
00140 // Helper classes and macros
00141
00142 #define BYTE_SIZE(string)          ((_tcslen(string)+1) * sizeof(TCHAR))
00143
00144 #define BREAK_ON_ERROR( hResult )  if( S_OK != hResult ) continue
00145
00146 // Useful only for debugging.  Never use modal dialogs in release builds!!
00147 #define MsgBox(wszMsg, wszTitle) ::MessageBox(NULL, wszMsg, wszTitle, MB_OK)
00148
00149
00150 //---------------------------------------------------------------------------
00151 template<class TYPE>
00152 inline void SAFE_RELEASE( TYPE*& pObj )
00153 {
00154   if( NULL != pObj )
00155   {
00156     pObj->Release();
00157     pObj = NULL;
00158   }
00159   else
00160   {
00161     OutputDebugString(_T("Attempted to release NULL Com pointer.\n"));
00162   }
00163 }
00164
00165 //---------------------------------------------------------------------------
00166 template<class TYPE>
00167 inline void SAFE_FREE_BITMAP( TYPE*& pObj )
00168 {
00169   if( NULL != pObj )
00170   {
00171     BOOL bStatus = DeleteObject( pObj );
00172     pObj = NULL;
00173   }
00174   else
00175   {
00176     OutputDebugString(_T("Attempted to delete NULL Bitmap handle.\n"));
00177   }
00178 }
00179
00180 //---------------------------------------------------------------------------
00181 template<class TYPE>
00182 inline void SAFE_FREE_ICON( TYPE*& pObj )
00183 {
00184   if( NULL != pObj )
00185   {
00186     BOOL bStatus = DestroyIcon( pObj );
00187     pObj = NULL;
00188   }
00189   else
00190   {
00191     OutputDebugString(_T("Attempted to delete NULL Icon handle.\n"));
00192   }
00193 }
00194
00195
00196
00197 //---------------------------------------------------------------------------
00198 //  W2T converts a wide character string to unicode if _UNICODE is not
00199 //  defined.  If it is defined then the sting is copied to another buffer.
00200 //
00201 #ifndef _UNICODE
00202 #define W2T( szAnsiPtr, szWide )   Unicode2Ansi( szAnsiPtr, szWide )
00203 #else
00204 #define W2T( szAnsiPtr, szWidePtr )                                 \
00205         *szAnsiPtr = (WCHAR*)CoTaskMemAlloc(BYTE_SIZE(szWidePtr) ); \
00206         CopyMemory( *szAnsiPtr, szWidePtr, BYTE_SIZE(szWidePtr) )
00207
00208 #endif //_UNICODE
00209
00210 //---------------------------------------------------------------------------
00211 //  T2W
00212
00213 #ifndef _UNICODE
00214 #define T2W( szAnsi, szWidePtr )   Ansi2Unicode( szAnsi, szWidePtr )
00215 #else
00216 #define T2W( szAnsi, szWidePtr )   CopyBuffer( szAnsi, szWidePtr )
00217 #endif //_UNICODE
00218
00219 #endif //_MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppagex/basesnap.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppagex

basesnap.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  Abstract: This module provides the basic COM and DLL methods to create
00015 //            and load the Snap-in.  IClassFactory::CreateInstance creates
00016 //            an instance of a class whose type is passed in the constructor
00017 //
00018
00019
00020 #ifndef _BASESNAP_H_
00021 #define _BASESNAP_H_
00022
00023 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj);
00024 STDAPI DllCanUnloadNow(void);
00025
00026 //---------------------------------------------------------------------------
00027 class CClassFactory : public IClassFactory
00028 {
00029   public:
00030     enum FACTORY_TYPE {PROPERTYPAGEX = 0};
00031
00032   public:
00033     CClassFactory(FACTORY_TYPE eFactoryType);
00034     ~CClassFactory();
00035
00036     STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv);
00037     STDMETHODIMP_(ULONG) AddRef();
00038     STDMETHODIMP_(ULONG) Release();
00039
00040     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID*);
00041     STDMETHODIMP LockServer(BOOL);
00042
00043   private:
00044     ULONG         m_cRef;
00045     FACTORY_TYPE  m_FactoryType;
00046
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CXMLTreeDlg Member List

This is the complete list of members for CXMLTreeDlg, including all inherited members.
CXMLTreeDlg(CWnd *pParent=NULL) | CXMLTreeDlg |
DoDataExchange(CDataExchange *pDX) | CXMLTreeDlg | [protected, virtual]
IDD enum value | CXMLTreeDlg |
LoadXML(CString filename) | CXMLTreeDlg |
m_debug | CXMLTreeDlg |
m_filename | CXMLTreeDlg |
m_hIcon | CXMLTreeDlg | [protected]
m_imageList | CXMLTreeDlg |
m_tree | CXMLTreeDlg |
MakeTree(MSXML::IXMLDOMElement *node, HTREEITEM ht) | CXMLTreeDlg |
OnChangeFilename() | CXMLTreeDlg | [protected]
OnInitDialog() | CXMLTreeDlg | [protected, virtual]
OnLoad() | CXMLTreeDlg | [protected]
OnOK() | CXMLTreeDlg | [protected, virtual]
OnOpen() | CXMLTreeDlg | [protected]
OnPaint() | CXMLTreeDlg | [protected]
OnQueryDragIcon() | CXMLTreeDlg | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CXMLTreeDlg | [protected]
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/OLEDBKB.Idl Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

OLEDBKB.Idl

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: Oledbkb.idl
00003 //
00004 // Description: IDL source for Oledbkb.dll
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022
00023 // This file will be processed by the MIDL tool to
00024 // produce the type library (Oledbkb.tlb) and marshalling code.
00025
00026 import "oaidl.idl";
00027 import "ocidl.idl";
00028
00029   [
00030     object,
00031     uuid(1A34A4CE-1C2D-11D1-98C4-00C04FC2C8D5),
00032     dual,
00033     helpstring("IOLEDBComponent Interface"),
00034     pointer_default(unique)
00035   ]
00036   interface IOLEDBComponent : IDispatch
00037   {
00038     [id(1), helpstring("method SimpleQuery")] HRESULT SimpleQuery([in, out] BSTR * returnval);
00039   };
00040 [
00041   uuid(1A34A4C1-1C2D-11D1-98C4-00C04FC2C8D5),
00042   version(1.0),
00043   helpstring("OLEDBKB 1.0 Type Library")
00044 ]
00045 library OLEDBKBLib
00046 {
00047   importlib("stdole32.tlb");
00048   importlib("stdole2.tlb");
00049
00050   [
00051     uuid(1A34A4CF-1C2D-11D1-98C4-00C04FC2C8D5),
00052     helpstring("OLEDBComponent Class")
00053   ]
00054   coclass OLEDBComponent
00055   {
00056     [default] interface IOLEDBComponent;
00057   };
00058 };
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDlgIDirectoryObject Member List

This is the complete list of members for CDlgIDirectoryObject, including all inherited members.
CDlgIDirectoryObject(LPUNKNOWN pUnk, CWnd *pParent=NULL) | CDlgIDirectoryObject |
DoDataExchange(CDataExchange *pDX) | CDlgIDirectoryObject | [protected, virtual]
IDD enum value | CDlgIDirectoryObject |
m_cAttributes | CDlgIDirectoryObject |
m_cValueList | CDlgIDirectoryObject |
m_pDirObject | CDlgIDirectoryObject | [protected]
m_sAttributes | CDlgIDirectoryObject |
m_sClass | CDlgIDirectoryObject |
m_sDN | CDlgIDirectoryObject |
m_sParent | CDlgIDirectoryObject |
m_sRDN | CDlgIDirectoryObject |
m_sSchema | CDlgIDirectoryObject |
OnChangeAttribute() | CDlgIDirectoryObject | [protected]
OnDelete() | CDlgIDirectoryObject | [protected]
OnGet() | CDlgIDirectoryObject | [protected]
OnInitDialog() | CDlgIDirectoryObject | [protected, virtual]
ShowAttributes() | CDlgIDirectoryObject | [protected]
~CDlgIDirectoryObject() | CDlgIDirectoryObject |
Generated on Wed Nov 13 2024 16:56:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/BrowserHost.cpp Source File

  • Web
  • Browser
  • EditGlyphs

BrowserHost.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2000 Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // BrowserHost.cpp : Implementation of CBrowserHost
00006 #include "stdafx.h"
00007 #include "EdGlyphs.h"
00008 #include "BrowserHost.h"
00009 #include "exdispid.h"
00010 #include "mshtmdid.h"
00011 #include "mshtmhst.h"
00012 #include "mshtmcid.h"
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CBrowserHost
00016
00017 CBrowserHost::CBrowserHost() :
00018   m_bEnableCtxMenus(TRUE),
00019   m_dwDLControl(DLCTL_DLIMAGES|DLCTL_VIDEOS|DLCTL_BGSOUNDS),
00020   m_dwCookie((DWORD)0),
00021   m_dwDocHostUIFlags((DWORD)0),
00022   m_dwDocHostUIDblClk((DWORD)0),
00023   m_bInPlaceActive(FALSE),
00024   m_bAtlBrowserHelp(TRUE),
00025   m_wndUrlCombo(_T("ComboBox"), this, 1),
00026   m_bButton2Down(FALSE),
00027   m_bButton3Down(FALSE)
00028 {
00029 }
00030
00031 LRESULT CBrowserHost::OnCreate(UINT, WPARAM, LPARAM, BOOL&) {return 0;}
00032
00033 LRESULT CBrowserHost::OnNCDestroy(UINT, WPARAM, LPARAM, BOOL&)
00034 {
00035   Stop();
00036   return 0;
00037 }
00038
00039 LRESULT CBrowserHost::OnKeydown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00040 {
00041   if (wParam == VK_RETURN)
00042   {
00043     // Stop any previous navigations
00044     m_spWebBrowser->Stop();
00045
00046     USES_CONVERSION;
00047     CComBSTR bstrURL;
00048     CComVariant vtEmpty;
00049
00050     // CODE REVIEW: Add following security comment.
00051     /* The following use of GetWindowText is simplified for illustrative
00052     purposes. This simplified use in production code can expose a
00053     security risk in some situations. In production code you might want
00054     to ensure that the receiving buffer size isn't exceeded by the size
00055     of the source string. */
00056     m_wndUrlCombo.GetWindowText((BSTR&)bstrURL);
00057
00058     if (bstrURL)
00059       m_spWebBrowser->Navigate(bstrURL, &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);
00060
00061     bHandled = TRUE;
00062     return S_OK;
00063   }
00064
00065   MSG msg;
00066   msg.message = uMsg;
00067   msg.wParam = wParam;
00068   msg.lParam = lParam;
00069
00070   // UIActivate the WebBrowser control when the tab key
00071   // is pressed so that focus will be changed to the next
00072   // control in the tabbing order.  If this is not done,
00073   // the WebBrowser control never gets the focus.
00074   if ((uMsg == WM_KEYDOWN || uMsg == WM_KEYUP) && wParam == VK_TAB)
00075   {
00076     CComQIPtr<IOleObject, &IID_IOleObject> spOleObject(m_spWebBrowser);
00077
00078     RECT rect;
00079     GetClientRect(&rect);
00080     spOleObject->DoVerb(OLEIVERB_UIACTIVATE, NULL, this, 0, m_hWnd, &rect);
00081   }
00082
00083   // Call TranslateAccelerator on the in-place active
00084   // object for the delete key so that the accelerator will be passed to the
00085   // hosted WebBrowser control.  This forces the delete key to
00086   // work correctly in design mode.
00087   if (wParam == VK_DELETE)
00088   {
00089     CComQIPtr<IOleInPlaceActiveObject,
00090          &IID_IOleInPlaceActiveObject> spInPlaceActiveObject(m_spWebBrowser);
00091
00092     spInPlaceActiveObject->TranslateAccelerator(&msg);
00093   }
00094
00095   bHandled = TRUE;
00096
00097   return S_FALSE;
00098 }
00099
00100 LRESULT CBrowserHost::OnButton1(WORD, WORD, HWND, BOOL&)
00101 {
00102   _ASSERT(m_spWebBrowser);
00103
00104   if (!m_spDoc)
00105   {
00106      MessageBox(_T("Document object no available."));
00107      return 0;
00108   }
00109
00110   USES_CONVERSION; // Needed for the OLE2A conversion macro
00111   CComBSTR bstrMode;
00112
00113   m_spDoc->get_designMode(&bstrMode);
00114   char* cMode = OLE2A(bstrMode);
00115
00116   if (strcmp(cMode, "On"))
00117   {
00118     m_spDoc->put_designMode(L"On");
00119
00120     // Turn on 2D positioning
00121     VARIANT var;
00122         V_VT(&var) = VT_BOOL;
00123       V_BOOL(&var) = VARIANT_TRUE;
00124     m_spOleCmdTarg->Exec(&CGID_MSHTML,
00125                IDM_2D_POSITION,
00126                MSOCMDEXECOPT_DODEFAULT,
00127                &var,
00128                NULL);
00129
00130     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON1, MAKELONG(TRUE, 0));
00131     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON2, MAKELONG(TRUE, 0));
00132     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON3, MAKELONG(TRUE, 0));
00133     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON4, MAKELONG(TRUE, 0));
00134   }
00135   else
00136   {
00137     m_spDoc->put_designMode(L"Off");
00138     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON1, MAKELONG(FALSE, 0));
00139     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00140     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00141     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON4, MAKELONG(FALSE, 0));
00142     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00143     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00144     m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON4, MAKELONG(FALSE, 0));
00145   }
00146
00147   return 1;
00148 }
00149
00150 LRESULT CBrowserHost::OnButton2(WORD, WORD, HWND, BOOL&)
00151 {
00152   USES_CONVERSION;
00153
00154   HRESULT hr ;
00155     VARIANT var;
00156   CComBSTR bstrTemp;
00157   CComBSTR bstrGlyphTable;
00158
00159   // Turn button on or off
00160   if (m_bButton2Down)
00161   {
00162     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00163     // Turn off button 3 as well
00164     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00165     m_bButton3Down = FALSE;
00166   }
00167   else
00168     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON2, MAKELONG(TRUE, 0));
00169
00170   m_bButton2Down = !m_bButton2Down;
00171
00172   // If button is up, empty glyph table and return
00173   if (!m_bButton2Down)
00174   {
00175     V_VT(&var) = VT_BOOL;
00176     V_BOOL(&var) = VARIANT_TRUE;
00177
00178     hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00179                   IDM_EMPTYGLYPHTABLE,
00180                   MSOCMDEXECOPT_DODEFAULT,
00181                   NULL,
00182                   NULL);
00183
00184     return 0;
00185   }
00186
00187   // Button is down, so add glyphs
00188     // Build Glyph Table
00189   bstrGlyphTable.LoadString(IDS_PBEG_GLYPHSTRING);
00190   bstrTemp.LoadString(IDS_PEND_GLYPHSTRING);
00191   bstrGlyphTable.AppendBSTR(bstrTemp);
00192   bstrTemp.LoadString(IDS_T_GLYPHSTRING);
00193   bstrGlyphTable.AppendBSTR(bstrTemp);
00194   bstrTemp.LoadString(IDS_BR_GLYPHSTRING);
00195   bstrGlyphTable.AppendBSTR(bstrTemp);
00196   bstrTemp.LoadString(IDS_SCRIPT_GLYPHSTRING);
00197   bstrGlyphTable.AppendBSTR(bstrTemp);
00198   bstrTemp.LoadString(IDS_COMMENT_GLYPHSTRING);
00199   bstrGlyphTable.AppendBSTR(bstrTemp);
00200   bstrTemp.LoadString(IDS_STYLE_GLYPHSTRING);
00201   bstrGlyphTable.AppendBSTR(bstrTemp);
00202   bstrTemp.LoadString(IDS_H3BGN_GLYPHSTRING);
00203   bstrGlyphTable.AppendBSTR(bstrTemp);
00204   bstrTemp.LoadString(IDS_H3END_GLYPHSTRING);
00205   bstrGlyphTable.AppendBSTR(bstrTemp);
00206   bstrTemp.LoadString(IDS_H3ABS_GLYPHSTRING);
00207   bstrGlyphTable.AppendBSTR(bstrTemp);
00208   bstrTemp.LoadString(IDS_H4_GLYPHSTRING);
00209   bstrGlyphTable.AppendBSTR(bstrTemp);
00210
00211   //Load Glyph Table into VARIANT
00212   V_VT(&var) = VT_BSTR;
00213   V_BSTR(&var) = bstrGlyphTable;
00214
00215   // Exec IDM_ADDTOGLYPHTABLE
00216   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00217                 IDM_ADDTOGLYPHTABLE,
00218                 MSOCMDEXECOPT_DODEFAULT,
00219                 &var,
00220                 NULL);
00221
00222   return 0;
00223 }
00224
00225 LRESULT CBrowserHost::OnButton3(WORD, WORD, HWND, BOOL&)
00226 {
00227   HRESULT hr ;
00228     VARIANT var;
00229
00230   // Turn button on or off
00231   if (m_bButton3Down)
00232   {
00233     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00234     // Turn off button 2 as well
00235     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00236     m_bButton2Down = FALSE;
00237   }
00238   else
00239     m_wndToolBar.SendMessage(TB_PRESSBUTTON, ID_BUTTON3, MAKELONG(TRUE, 0));
00240
00241   m_bButton3Down = !m_bButton3Down;
00242
00243   V_VT(&var) = VT_BOOL;
00244   V_BOOL(&var) = m_bButton3Down ? VARIANT_TRUE : VARIANT_FALSE;
00245
00246   hr = m_spOleCmdTarg->Exec(&CGID_MSHTML,
00247                 IDM_SHOWALLTAGS,
00248                 MSOCMDEXECOPT_DODEFAULT,
00249                 &var,
00250                 NULL);
00251
00252   return 0;
00253 }
00254
00255 STDMETHODIMP CBrowserHost::Run()
00256 {
00257   // Create and show the window
00258   RECT rcClient = { CW_USEDEFAULT, 0, 0, 0 };
00259
00260   Create(GetDesktopWindow(), rcClient, _T("Editing Glyph Sample App"), WS_VISIBLE | WS_OVERLAPPEDWINDOW,
00261        0, NULL);
00262   ShowWindow(SW_SHOWNORMAL);
00263
00264   // Create the toolbar
00265   CreateToolbar();
00266
00267   // Create the status bar
00268   m_wndStatusBar.Attach(CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | CCS_BOTTOM,
00269                               _T("Ready"), m_hWnd, 2));
00270   _ASSERT(m_wndStatusBar);
00271
00272   // Create the WebBrowser control
00273   CComPtr<IOleObject> spOleObject;
00274   HRESULT hr = CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IOleObject,
00275                       (void**)&spOleObject);
00276   if (hr != S_OK)
00277   {
00278     MessageBox(_T("CoCreateInstance failed"));
00279     return E_FAIL;
00280   }
00281
00282   if (spOleObject->SetClientSite(this) != S_OK)
00283   {
00284     MessageBox(_T("SetClientSite failed"));
00285     return E_FAIL;
00286   }
00287
00288   // In-place activate the WebBrower control
00289   MSG msg;
00290   GetClientRect(&rcClient);
00291
00292   hr = spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, &msg, this, 0, m_hWnd, &rcClient);
00293   if (hr != S_OK)
00294   {
00295     MessageBox(_T("DoVerb failed"));
00296     return E_FAIL;
00297   }
00298
00299   // Get the pointer to the WebBrowser control.  Note that setting a CComQIPtr
00300   // equal to a pointer of another type causes CComQIPtr to call QueryInterface.
00301   m_spWebBrowser = spOleObject;
00302   _ASSERT(m_spWebBrowser);
00303
00304   if (!m_spWebBrowser)
00305     return E_FAIL;
00306
00307   // Set up the connection to the WebBrowser control to receive events
00308   hr = AtlAdvise(m_spWebBrowser, GetUnknown(), DIID_DWebBrowserEvents2, &m_dwCookie);
00309   if (FAILED(hr))
00310     ATLTRACE(_T("Failed to Advise\n"));
00311
00312   // Get the size of the status bar
00313   RECT rcWindow;
00314   m_wndStatusBar.GetWindowRect(&rcWindow);
00315
00316   // Resize the control to accomodate the status bar and toolbar
00317   rcClient.bottom -= (rcWindow.bottom - rcWindow.top);
00318
00319   m_wndToolBar.GetWindowRect(&rcWindow);
00320   rcClient.top += (rcWindow.bottom - rcWindow.top);
00321
00322   // QI for the in-place object to set the size
00323   m_spInPlaceObject = m_spWebBrowser;
00324   _ASSERT(m_spInPlaceObject);
00325
00326   if (m_spInPlaceObject)
00327     m_spInPlaceObject->SetObjectRects(&rcClient, &rcClient);
00328
00329   // QI for the IOleCommandTarget interface that will be used later
00330   m_spOleCmdTarg = m_spWebBrowser;
00331   _ASSERT(m_spOleCmdTarg);
00332
00333   // Load Test Page
00334   m_spWebBrowser->Navigate(L"res://edglyphs.exe/test.html", NULL, NULL, NULL, NULL);
00335
00336   return S_OK;
00337 }
00338
00339 STDMETHODIMP CBrowserHost::Stop()
00340 {
00341   _ASSERT(m_spWebBrowser);
00342
00343   HRESULT hr = AtlUnadvise(m_spWebBrowser, DIID_DWebBrowserEvents2, m_dwCookie);
00344
00345   if (FAILED(hr))
00346     ATLTRACE("Failed to Unadvise\n");
00347
00348   PostQuitMessage(0);
00349
00350   return S_OK;
00351 }
00352
00353 LRESULT CBrowserHost::OnSize(UINT, WPARAM, LPARAM lParam, BOOL&)
00354 {
00355   RECT rcWindow;
00356
00357   // Resize the status bar
00358   if (m_wndStatusBar)
00359   {
00360     int cxParent = LOWORD(lParam);
00361     int cyParent = HIWORD(lParam);
00362     int x = 0, y, cx, cy;
00363
00364     // Keep the status bar height the same.
00365     m_wndStatusBar.GetWindowRect(&rcWindow);
00366     cy = rcWindow.bottom - rcWindow.top;
00367
00368     y = cyParent - cy;
00369     cx = cxParent;
00370     m_wndStatusBar.MoveWindow(x, y, cx, cy, TRUE);
00371   }
00372
00373   // Tell the toolbar to resize itself
00374   if (m_wndToolBar)
00375     m_wndToolBar.SendMessage(TB_AUTOSIZE, 0, 0L);
00376
00377   // Resize the control
00378   if (m_spWebBrowser && m_bInPlaceActive)
00379   {
00380     RECT rcClient;
00381     GetClientRect(&rcClient);
00382
00383     // Resize the control to accomodate the status bar and toolbar
00384     rcClient.bottom -= (rcWindow.bottom - rcWindow.top);
00385
00386     m_wndToolBar.GetWindowRect(&rcWindow);
00387     rcClient.top += (rcWindow.bottom - rcWindow.top);
00388
00389     if (m_spInPlaceObject)
00390       m_spInPlaceObject->SetObjectRects(&rcClient, &rcClient);
00391   }
00392
00393   return 0;
00394 }
00395
00396 // IDispatch Methods
00397 STDMETHODIMP CBrowserHost::Invoke(DISPID dispidMember, REFIID riid,
00398                      LCID lcid, WORD wFlags,
00399                      DISPPARAMS* pDispParams,
00400                      VARIANT* pvarResult, EXCEPINFO*  pExcepInfo,
00401                      UINT* puArgErr)
00402 {
00403   USES_CONVERSION;
00404   CComBSTR bstrURL;
00405   CComPtr<IDispatch> spDisp;
00406   switch (dispidMember)
00407   {
00408     case DISPID_DOCUMENTCOMPLETE:
00409       m_spDoc = (IHTMLDocument2*)NULL;
00410       m_spWebBrowser->get_Document(&spDisp);
00411       spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&m_spDoc);
00412       break;
00413
00414     case DISPID_DOWNLOADCOMPLETE:
00415       // Set the text of the combobox to the current URL
00416       m_spWebBrowser->get_LocationURL(&bstrURL);
00417       m_wndUrlCombo.SetWindowText(OLE2T(bstrURL));
00418       break;
00419
00420     // The parameters for this DISPID:
00421     // [0]: New status bar text - VT_BSTR
00422     case DISPID_STATUSTEXTCHANGE:
00423       m_wndStatusBar.SetWindowText(OLE2T(pDispParams->rgvarg[0].bstrVal));
00424       break;
00425
00426     default:
00427       return DISP_E_MEMBERNOTFOUND;
00428   }
00429
00430   return S_OK;
00431 }
00432
00433 void CBrowserHost::CreateToolbar()
00434 {
00435   TBBUTTON tbb[] =
00436   {
00437     // Add separators to make room for the combo box.
00438     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00439     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00440     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00441     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00442     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00443     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00444     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00445     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00446     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00447     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00448     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00449     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00450     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00451     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00452     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00453     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00454     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00455     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00456     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00457     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00458     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00459     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00460     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00461     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00462     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00463     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00464     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00465     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00466     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00467     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00468     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00469     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00470     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00471     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00472     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00473     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00474     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00475     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00476     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00477     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00478
00479     0, ID_BUTTON1, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00480     0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
00481     1, ID_BUTTON2, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00482     2, ID_BUTTON3, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00483     3, ID_BUTTON4, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, 0,
00484   };
00485
00486   HWND toolbar = CreateToolbarEx(m_hWnd,
00487                    WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | CCS_TOP | TBSTYLE_TOOLTIPS,
00488                    ID_TOOLBARWND,
00489                    4,
00490                    _Module.GetResourceInstance(),
00491                    IDR_TOOLBAR1,
00492                    tbb, 44,
00493                    0, 0,
00494                    86, 30,
00495                    sizeof(TBBUTTON));
00496
00497   m_wndToolBar.Attach(toolbar);
00498   _ASSERT(m_wndToolBar);
00499
00500   // Tell the toolbar to resize itself
00501   m_wndToolBar.SendMessage(TB_AUTOSIZE, 0, 0L);
00502   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON2, MAKELONG(FALSE, 0));
00503   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON3, MAKELONG(FALSE, 0));
00504   m_wndToolBar.SendMessage(TB_ENABLEBUTTON, ID_BUTTON4, MAKELONG(FALSE, 0));
00505
00506   // Create the combo box on the toolbar
00507   RECT rc, rc2;
00508
00509   // Calculate the coordinates for the combo box.
00510   m_wndToolBar.SendMessage(TB_GETITEMRECT, (WPARAM)0, (LPARAM)(LPRECT)&rc);
00511   m_wndToolBar.SendMessage(TB_GETITEMRECT, (WPARAM)38, (LPARAM)(LPRECT)&rc2);
00512
00513   rc.right = rc2.right;
00514   rc.bottom = 100;
00515   m_wndUrlCombo.Create(m_wndToolBar, rc, NULL, WS_CHILD|WS_VISIBLE|CBS_DROPDOWN|CBS_AUTOHSCROLL,
00516                 0, ID_URLBOX);
00517 }
00518
00519
00520 STDMETHODIMP CBrowserHost::GetHwnd(long* phwnd)
00521 {
00522   *phwnd = (long)m_hWnd;
00523    return S_OK;
00524 }
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/Simple/QSample.Hxx Source File

  • WinBase
  • Indexing
  • Simple

QSample.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // PROGRAM:  qsample.hxx
00011 //
00012 // PURPOSE:  Illustrates a minimal query using Indexing Service.
00013 //           Uses CIMakeICommand and CITextToFullTree helper functions.
00014 //
00015 // PLATFORM: Windows 2000
00016 //
00017 //--------------------------------------------------------------------------
00018
00019 #pragma once
00020
00021 #define IDS_QUERYTIMEDOUT        200
00022 #define IDS_QUERYDONE            201
00023 #define IDS_QUERYFAILED          202
00024 #define IDS_CANTOPENFILE         203
00025 #define IDS_CANTGETFILESIZE      204
00026 #define IDS_CANTGETMEMORY        205
00027 #define IDS_CANTREADFROMFILE     206
00028 #define IDS_CANTCONVERTTOUNICODE 207
00029 #define IDS_UNKNOWNERROR         208
00030 #define IDS_CANTFINDCATALOG      209
00031 #define IDS_CANTDISPLAYSTATUS    210
00032
00033 #define IDS_STAT_TOTALDOCUMENTS             220
00034 #define IDS_STAT_FRESHTEST                  221
00035 #define IDS_STAT_FILTEREDDOCUMENTS          222
00036 #define IDS_STAT_DOCUMENTS                  223
00037 #define IDS_STAT_SECQDOCUMENTS              224
00038 #define IDS_STAT_UNIQUEKEYS                 225
00039 #define IDS_STAT_WORDLIST                   226
00040 #define IDS_STAT_PERSISTENTINDEX            227
00041 #define IDS_STAT_PENDINGSCANS               228
00042 #define IDS_STAT_INDEXSIZE                  229
00043 #define IDS_STAT_MERGE_SHADOW               230
00044 #define IDS_STAT_MERGE_ANNEALING            231
00045 #define IDS_STAT_MERGE_INDEX_MIGRATION      232
00046 #define IDS_STAT_MERGE_MASTER               233
00047 #define IDS_STAT_MERGE_MASTER_PAUSED        234
00048 #define IDS_STAT_SCANS                      235
00049 #define IDS_STAT_READ_ONLY                  236
00050 #define IDS_STAT_RECOVERING                 237
00051 #define IDS_STAT_LOW_MEMORY                 238
00052 #define IDS_STAT_HIGH_IO                    239
00053 #define IDS_STAT_BATTERY_POWER              240
00054 #define IDS_STAT_USER_ACTIVE                241
00055 #define IDS_STAT_PROPCACHESIZE              242
00056 #define IDS_STAT_STARTING                   243
00057 #define IDS_STAT_READING_USNS               244
00058 #define IDS_STAT_UP_TO_DATE                 245
00059 #define IDS_STAT_NOT_UP_TO_DATE             246
00060 #define IDS_STAT_QUERIES                    247
00061 #define IDS_STAT_CATALOG                    248
00062 #define IDS_STAT_MACHINE                    249
00063
00064 #define IDS_ROWSET_STAT_ERROR                     250
00065 #define IDS_ROWSET_STAT_REFRESH                   251
00066 #define IDS_ROWSET_STAT_PARTIAL_SCOPE             252
00067 #define IDS_ROWSET_STAT_NOISE_WORDS               253
00068 #define IDS_ROWSET_STAT_CONTENT_OUT_OF_DATE       254
00069 #define IDS_ROWSET_STAT_REFRESH_INCOMPLETE        255
00070 #define IDS_ROWSET_STAT_CONTENT_QUERY_INCOMPLETE  256
00071 #define IDS_ROWSET_STAT_TIME_LIMIT_EXCEEDED       257
00072 #define IDS_ROWSET_STAT_SHARING_VIOLATION         258
00073
00074 #define IDR_USAGE                100
00075
00076
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Outgoing/Outgoing.Cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Outgoing

Outgoing.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00004
00005 --*/
00006
00007 #define UNICODE
00008 #include <windows.h>
00009 #include <tapi3.h>
00010 #include <strmif.h>
00011 #include <control.h>
00012 #include "resource.h"
00013
00014 //////////////////////////////////////////////////////////
00015 // T3OUT.EXE
00016 //
00017 // Example of making an outgoing call with TAPI 3.0
00018 //
00019 // This application will allow a user to make a call
00020 // by using TAPI 3.0.  The application will simply look
00021 // for the first TAPI line that support Audio, and can
00022 // dial a phone number.  It will then use that line to
00023 // make calls.
00024 //
00025 // This application does not handle incoming calls, and
00026 // does not process incoming messages.
00027 //
00028 //////////////////////////////////////////////////////////
00029
00030 //////////////////////////////////////////////////////////
00031 // Constants
00032 //////////////////////////////////////////////////////////
00033
00034 const DWORD ADDRESSLENGTH   = 128;
00035 const DWORD MAXTERMINALS    = 5;
00036
00037 const WCHAR * const gszTapi30           = L"TAPI 3.0 Outgoing Call Sample";
00038
00039 const WCHAR * const gszConferenceName   = L"Conference Name";
00040 const WCHAR * const gszEmailName        = L"Email Name";
00041 const WCHAR * const gszMachineName      = L"Machine Name";
00042 const WCHAR * const gszPhoneNumber      = L"Phone Number";
00043 const WCHAR * const gszIPAddress        = L"IP Address";
00044
00045 //////////////////////////////////////////////////////////
00046 // GLOBALS
00047 //////////////////////////////////////////////////////////
00048 HINSTANCE               ghInst;
00049 HWND                    ghDlg = NULL;
00050 ITTAPI *                gpTapi;
00051 ITAddress *             gpAddress = NULL;
00052 ITBasicCallControl *    gpCall;
00053
00054 //////////////////////////////////////////////////////////
00055 // PROTOTYPES
00056 //////////////////////////////////////////////////////////
00057 INT_PTR
00058 CALLBACK
00059 MainDialogProc(
00060                HWND hDlg,
00061                UINT uMsg,
00062                WPARAM wParam,
00063                LPARAM lParam
00064               );
00065
00066 HRESULT
00067 FindAnAddress(
00068               DWORD dwAddressType,
00069               BSTR  * ppName
00070              );
00071
00072 HRESULT
00073 GetTerminal(
00074             ITStream * pStream,
00075             ITTerminal ** ppTerminal
00076            );
00077
00078 HRESULT
00079 GetVideoRenderTerminal(
00080                    ITTerminal ** ppTerminal
00081                   );
00082
00083 HRESULT
00084 MakeTheCall(
00085             DWORD dwAddressType,
00086             PWCHAR szAddressToCall
00087            );
00088
00089 HRESULT
00090 DisconnectTheCall();
00091
00092 void
00093 DoMessage(
00094           LPWSTR pszMessage
00095          );
00096
00097 HRESULT
00098 InitializeTapi();
00099
00100 void
00101 ShutdownTapi();
00102
00103 void
00104 EnableButton(
00105              HWND hDlg,
00106              int ID
00107             );
00108 void
00109 DisableButton(
00110               HWND hDlg,
00111               int ID
00112              );
00113
00114 BOOL
00115 AddressSupportsMediaType(
00116                          ITAddress * pAddress,
00117                          long        lMediaType
00118                         );
00119
00120 //////////////////////////////////////////////////////////
00121 // WinMain
00122 //////////////////////////////////////////////////////////
00123 int
00124 WINAPI
00125 WinMain(
00126         HINSTANCE hInst,
00127         HINSTANCE hPrevInst,
00128         LPSTR lpCmdLine,
00129         int nCmdShow
00130        )
00131 {
00132     ghInst = hInst;
00133
00134
00135     // need to coinit
00136     if ( FAILED( CoInitialize(NULL) ) )
00137     {
00138         return 0;
00139     }
00140
00141     if ( FAILED( InitializeTapi() ) )
00142     {
00143         return 0;
00144     }
00145
00146     // everything is initialized, so
00147     // start the main dialog box
00148     DialogBox(
00149               ghInst,
00150               MAKEINTRESOURCE(IDD_MAINDLG),
00151               NULL,
00152               MainDialogProc
00153              );
00154
00155
00156     ShutdownTapi();
00157
00158     CoUninitialize();
00159
00160     return 1;
00161 }
00162
00163
00164 //////////////////////////////////////////////////////////////
00165 // InitializeTapi
00166 //
00167 // Various initializations
00168 ///////////////////////////////////////////////////////////////
00169 HRESULT
00170 InitializeTapi()
00171 {
00172     HRESULT         hr;
00173
00174
00175     // cocreate the TAPI object
00176     hr = CoCreateInstance(
00177                           CLSID_TAPI,
00178                           NULL,
00179                           CLSCTX_INPROC_SERVER,
00180                           IID_ITTAPI,
00181                           (LPVOID *)&gpTapi
00182                          );
00183
00184     if ( FAILED(hr) )
00185     {
00186         DoMessage(L"CoCreateInstance on TAPI failed");
00187         return hr;
00188     }
00189
00190     // call initialize.  this must be called before
00191     // any other tapi functions are called.
00192     hr = gpTapi->Initialize();
00193
00194     if (S_OK != hr)
00195     {
00196         DoMessage(L"TAPI failed to initialize");
00197
00198         gpTapi->Release();
00199         gpTapi = NULL;
00200
00201         return hr;
00202     }
00203
00204     return S_OK;
00205 }
00206
00207
00208 ///////////////////////////////////////////////////////////////
00209 // ShutdownTapi
00210 ///////////////////////////////////////////////////////////////
00211 void
00212 ShutdownTapi()
00213 {
00214     // if there is still a call,
00215     // release it
00216     if (NULL != gpCall)
00217     {
00218         gpCall->Release();
00219         gpCall = NULL;
00220     }
00221
00222     // if we have an address object
00223     // release it
00224     if (NULL != gpAddress)
00225     {
00226         gpAddress->Release();
00227         gpAddress = NULL;
00228     }
00229
00230     // release main object.
00231     if (NULL != gpTapi)
00232     {
00233         gpTapi->Shutdown();
00234         gpTapi->Release();
00235         gpTapi = NULL;
00236     }
00237
00238 }
00239
00240 ///////////////////////////////////////////////////////////////////////////
00241 // InitAddressTypeComboBox
00242 //
00243 // Put address type string in the combo box
00244 // and save the addresstype with the string
00245 //
00246 ///////////////////////////////////////////////////////////////////////////
00247 void
00248 InitAddressTypeComboBox(
00249     HWND hComboBox
00250     )
00251 {
00252     int i;
00253
00254     i = (int)SendMessage( hComboBox, CB_ADDSTRING, 0, (LONG_PTR)gszConferenceName );
00255
00256     SendMessage(
00257                 hComboBox,
00258                 CB_SETITEMDATA ,
00259                 i,
00260                 (LONG_PTR)LINEADDRESSTYPE_SDP
00261                );
00262
00263
00264     i = (int)SendMessage( hComboBox, CB_ADDSTRING, 0, (LONG_PTR)gszEmailName );
00265
00266     SendMessage(
00267                 hComboBox,
00268                 CB_SETITEMDATA ,
00269                 i,
00270                 (LONG_PTR)LINEADDRESSTYPE_EMAILNAME
00271                );
00272
00273
00274     i = (int)SendMessage( hComboBox, CB_ADDSTRING, 0, (LONG_PTR)gszMachineName );
00275
00276     SendMessage(
00277                 hComboBox,
00278                 CB_SETITEMDATA ,
00279                 i,
00280                 (LONG_PTR)LINEADDRESSTYPE_DOMAINNAME
00281                );
00282
00283
00284     i = (int)SendMessage( hComboBox, CB_ADDSTRING, 0, (LONG_PTR)gszPhoneNumber );
00285
00286     SendMessage(
00287                 hComboBox,
00288                 CB_SETITEMDATA ,
00289                 i,
00290                 (LONG_PTR)LINEADDRESSTYPE_PHONENUMBER
00291                );
00292
00293
00294     SendMessage( hComboBox, CB_SETCURSEL, i, 0 );
00295
00296     i = (int)SendMessage( hComboBox, CB_ADDSTRING, 0, (LONG_PTR)gszIPAddress );
00297
00298     SendMessage(
00299                 hComboBox,
00300                 CB_SETITEMDATA ,
00301                 i,
00302                 (LONG_PTR)LINEADDRESSTYPE_IPADDRESS
00303                );
00304
00305 }
00306
00307 ///////////////////////////////////////////////////////////////////////////
00308 // MainDlgProc
00309 ///////////////////////////////////////////////////////////////////////////
00310 INT_PTR
00311 CALLBACK
00312 MainDialogProc(
00313                HWND hDlg,
00314                UINT uMsg,
00315                WPARAM wParam,
00316                LPARAM lParam
00317               )
00318 {
00319     switch (uMsg)
00320     {
00321         case WM_INITDIALOG:
00322         {
00323             HWND hComboBox;
00324
00325
00326             // set up dialog
00327             ghDlg = hDlg;
00328
00329             EnableButton( hDlg, IDOK );
00330             DisableButton( hDlg, IDC_DISCONNECT );
00331
00332             hComboBox = GetDlgItem( hDlg, IDC_ADDRESSTYPE );
00333
00334             InitAddressTypeComboBox(hComboBox);
00335
00336             SetFocus( hComboBox );
00337
00338             return 0;
00339         }
00340
00341         case WM_COMMAND:
00342         {
00343             if ( LOWORD(wParam) == IDCANCEL )
00344             {
00345                 // quit
00346                 EndDialog( hDlg, 0 );
00347
00348                 return 1;
00349             }
00350
00351             // dial request
00352             if ( LOWORD(wParam) == IDOK )
00353             {
00354                 HWND hComboBox;
00355                 DWORD dwIndex;
00356                 DWORD dwAddressType;
00357                 WCHAR szAddressToCall[ADDRESSLENGTH];
00358
00359
00360                 // get the address type the user selected.
00361                 hComboBox = GetDlgItem( hDlg, IDC_ADDRESSTYPE );
00362                 dwIndex = (DWORD)SendMessage( hComboBox, CB_GETCURSEL, 0, 0 );
00363
00364                 dwAddressType = (DWORD)SendMessage(
00365                                              hComboBox,
00366                                              CB_GETITEMDATA,
00367                                              dwIndex,
00368                                              0
00369                                            );
00370
00371                 // get the address the user wants to call
00372                 GetDlgItemText(
00373                                hDlg,
00374                                IDC_ADDRESS,
00375                                szAddressToCall,
00376                                ADDRESSLENGTH
00377                               );
00378
00379                 // make the call
00380                 if ( S_OK == MakeTheCall(dwAddressType, szAddressToCall) )
00381                 {
00382                     EnableButton( hDlg, IDC_DISCONNECT );
00383                     DisableButton( hDlg, IDOK );
00384                 }
00385                 else
00386                 {
00387                     DoMessage(L"The call failed to connect");
00388                 }
00389
00390                 return 1;
00391             }
00392
00393             // disconnect request
00394             if ( LOWORD( wParam ) == IDC_DISCONNECT )
00395             {
00396                 // disconnect
00397                 if (S_OK == DisconnectTheCall())
00398                 {
00399                     EnableButton( hDlg, IDOK );
00400                     DisableButton( hDlg, IDC_DISCONNECT );
00401                 }
00402                 else
00403                 {
00404                     DoMessage(L"The call failed to disconnect");
00405                 }
00406
00407                 return 1;
00408             }
00409
00410             return 0;
00411         }
00412         default:
00413
00414             return 0;
00415     }
00416 }
00417
00418
00419 ////////////////////////////////////////////////////////////////////////
00420 // FindAnAddress
00421 //
00422 // Finds an address object that this application will use to make calls on.
00423 //
00424 // This function finds an address that supports the addresstype passed
00425 // in, as well as the audioin and audioout media types.
00426 //
00427 // Return Value
00428 //          S_OK if it finds an address
00429 //          E_FAIL if it does not find an address
00430 ////////////////////////////////////////////////////////////////////////
00431 HRESULT
00432 FindAnAddress(
00433               DWORD dwAddressType,
00434               BSTR  * ppName
00435              )
00436 {
00437     HRESULT                 hr = S_OK;
00438     BOOL                    bFoundAddress = FALSE;
00439     IEnumAddress          * pEnumAddress;
00440     ITAddress             * pAddress;
00441     ITAddressCapabilities * pAddressCaps;
00442     long                    lType = 0;
00443
00444     // if we have an address object
00445     // release it
00446     if (NULL != gpAddress)
00447     {
00448         gpAddress->Release();
00449         gpAddress = NULL;
00450     }
00451
00452     // enumerate the addresses
00453     hr = gpTapi->EnumerateAddresses( &pEnumAddress );
00454
00455     if ( FAILED(hr) )
00456     {
00457         return hr;
00458     }
00459
00460     while ( !bFoundAddress )
00461     {
00462         // get the next address
00463         hr = pEnumAddress->Next( 1, &pAddress, NULL );
00464
00465         if (S_OK != hr)
00466         {
00467             break;
00468         }
00469
00470
00471         hr = pAddress->QueryInterface(IID_ITAddressCapabilities, (void**)&pAddressCaps);
00472
00473         if ( SUCCEEDED(hr) )
00474         {
00475
00476             hr = pAddressCaps->get_AddressCapability( AC_ADDRESSTYPES, &lType );
00477
00478             pAddressCaps->Release();
00479
00480             if ( SUCCEEDED(hr) )
00481             {
00482                 // is the type we are looking for?
00483                 if ( dwAddressType & lType )
00484                 {
00485                     // does it support audio?
00486                     if ( AddressSupportsMediaType(pAddress, TAPIMEDIATYPE_AUDIO) )
00487                     {
00488                         // does it have a name?
00489                         if ( SUCCEEDED( pAddress->get_AddressName(ppName) ) )
00490                         {
00491                             // save it in the global variable
00492                             // since we break out of the loop, this one won't
00493                             // get released
00494
00495                             gpAddress = pAddress;
00496
00497                             bFoundAddress = TRUE;
00498
00499                             break;
00500                         }
00501                     }
00502                 }
00503             }
00504         }
00505
00506         pAddress->Release();
00507
00508     } // end while loop
00509
00510     pEnumAddress->Release();
00511
00512     if (!bFoundAddress)
00513     {
00514         return E_FAIL;
00515     }
00516
00517     return S_OK;
00518 }
00519
00520 /////////////////////////////////////////////////////////////////
00521 // IsVideoCaptureStream
00522 //
00523 // Returns true if the stream is for video capture
00524 /////////////////////////////////////////////////////////////////
00525
00526 BOOL
00527 IsVideoCaptureStream(
00528                      ITStream * pStream
00529                     )
00530 {
00531     TERMINAL_DIRECTION tdStreamDirection;
00532     long               lStreamMediaType;
00533
00534     if ( FAILED( pStream  ->get_Direction(&tdStreamDirection)   ) ) { return FALSE; }
00535     if ( FAILED( pStream  ->get_MediaType(&lStreamMediaType)    ) ) { return FALSE; }
00536
00537     return (tdStreamDirection == TD_CAPTURE) &&
00538            (lStreamMediaType  == TAPIMEDIATYPE_VIDEO);
00539 }
00540
00541 /////////////////////////////////////////////////////////////////
00542 // EnablePreview
00543 //
00544 // Selects a video render terminal on a video capture stream,
00545 // thereby enabling video preview.
00546 /////////////////////////////////////////////////////////////////
00547
00548 HRESULT
00549 EnablePreview(
00550               ITStream * pStream
00551              )
00552 {
00553     ITTerminal * pTerminal;
00554
00555     HRESULT hr = GetVideoRenderTerminal(&pTerminal);
00556
00557     if ( SUCCEEDED(hr) )
00558     {
00559         hr = pStream->SelectTerminal(pTerminal);
00560
00561         pTerminal->Release();
00562     }
00563
00564     return hr;
00565 }
00566
00567 /////////////////////////////////////////////////////////////////
00568 // SelectTerminalsOnCall
00569 //
00570 // Creates and selects terminals for all streams on the given
00571 // call.
00572 /////////////////////////////////////////////////////////////////
00573
00574 HRESULT
00575 SelectTerminalsOnCall(
00576                      ITBasicCallControl * pCall
00577                      )
00578 {
00579     HRESULT hr;
00580
00581     //
00582     // get the ITStreamControl interface for this call
00583     //
00584
00585     ITStreamControl * pStreamControl;
00586
00587     hr = pCall->QueryInterface(IID_ITStreamControl,
00588                                (void **) &pStreamControl);
00589
00590     if ( SUCCEEDED(hr) )
00591     {
00592         //
00593         // enumerate the streams
00594         //
00595
00596         IEnumStream * pEnumStreams;
00597
00598         hr = pStreamControl->EnumerateStreams(&pEnumStreams);
00599
00600         pStreamControl->Release();
00601
00602         if ( SUCCEEDED(hr) )
00603         {
00604             //
00605             // for each stream
00606             //
00607
00608             ITStream * pStream;
00609
00610             while ( S_OK == pEnumStreams->Next(1, &pStream, NULL) )
00611             {
00612                 ITTerminal * pTerminal;
00613
00614                 //
00615                 // Find out the media type and direction of this stream,
00616                 // and create the default terminal for this media type and
00617                 // direction.
00618                 //
00619
00620                 hr = GetTerminal(pStream,
00621                                  &pTerminal);
00622
00623                 if ( SUCCEEDED(hr) )
00624                 {
00625                     //
00626                     // Select the terminal on the stream.
00627                     //
00628
00629                     hr = pStream->SelectTerminal(pTerminal);
00630
00631                     if ( SUCCEEDED(hr) )
00632                     {
00633                         //
00634                         // Also enable preview on the video capture stream.
00635                         //
00636
00637                         if ( IsVideoCaptureStream( pStream ) )
00638                         {
00639                             EnablePreview( pStream );
00640                         }
00641                     }
00642
00643                     pTerminal->Release();
00644                 }
00645
00646                 pStream->Release();
00647
00648             }
00649
00650             pEnumStreams->Release();
00651         }
00652     }
00653
00654     return hr;
00655 }
00656
00657
00658 /////////////////////////////////////////////////////////////////
00659 // MakeTheCall
00660 //
00661 // Sets up and makes a call
00662 /////////////////////////////////////////////////////////////////
00663
00664 HRESULT
00665 MakeTheCall(
00666             DWORD dwAddressType,
00667             PWCHAR szAddressToCall
00668            )
00669 {
00670     HRESULT                 hr = S_OK;
00671     BSTR                    bstrAddressToCall;
00672     BSTR                    pAddressName;
00673
00674
00675     // find an address object that
00676     // we will use to make calls on
00677
00678     hr = FindAnAddress(dwAddressType, &pAddressName);
00679
00680     if ( FAILED(hr) )
00681     {
00682         DoMessage(L"Could not find a TAPI address for making calls.");
00683
00684         return hr;
00685     }
00686
00687     WCHAR pText[200];
00688
00689     wsprintf(pText, L"Using address: %s", pAddressName);
00690
00691     SysFreeString(pAddressName);
00692
00693     DoMessage(pText);
00694
00695     //
00696     // find out which media types this address supports
00697     //
00698
00699     long lMediaTypes = 0;
00700
00701     if ( AddressSupportsMediaType(gpAddress, TAPIMEDIATYPE_AUDIO) )
00702     {
00703         lMediaTypes |= TAPIMEDIATYPE_AUDIO; // we will use audio
00704     }
00705
00706     if ( AddressSupportsMediaType(gpAddress, TAPIMEDIATYPE_VIDEO) )
00707     {
00708         lMediaTypes |= TAPIMEDIATYPE_VIDEO; // we will use video
00709     }
00710
00711     //
00712     // Create the call.
00713     //
00714
00715     bstrAddressToCall = SysAllocString( szAddressToCall );
00716
00717     hr = gpAddress->CreateCall( bstrAddressToCall,
00718                                 dwAddressType,
00719                                 lMediaTypes,
00720                                 &gpCall);
00721
00722     SysFreeString ( bstrAddressToCall );
00723
00724     if ( FAILED(hr) )
00725     {
00726         DoMessage(L"Could not create a call.");
00727
00728         return hr;
00729     }
00730
00731     //
00732     // Select our terminals on the call; if any of the selections fail we
00733     // proceed without that terminal.
00734     //
00735
00736     hr = SelectTerminalsOnCall( gpCall );
00737
00738     //
00739     // We're now ready to call connect.
00740     //
00741     // the VARIANT_TRUE parameter indicates that this
00742     // call is sychronous - that is, it won't
00743     // return until the call is in the connected
00744     // state (or fails to connect)
00745     // Since this is called in the UI thread,
00746     // this means that the app will appear
00747     // to hang until this function returns.
00748     // Some TAPI service providers may take a long
00749     // time for a call to reach the connected state.
00750     //
00751
00752     hr = gpCall->Connect( VARIANT_TRUE );
00753
00754     if ( FAILED(hr) )
00755     {
00756         gpCall->Release();
00757         gpCall = NULL;
00758
00759         DoMessage(L"Could not connect the call.");
00760
00761         return hr;
00762     }
00763
00764     return S_OK;
00765 }
00766
00767
00768 /////////////////////////////////////////////////////////
00769 // GetTerminal
00770 //
00771 // Creates the default terminal for the passed-in stream.
00772 //
00773 /////////////////////////////////////////////////////////
00774 HRESULT
00775 GetTerminal(
00776             ITStream * pStream,
00777             ITTerminal ** ppTerminal
00778            )
00779 {
00780     //
00781     // Determine the media type and direction of this stream.
00782     //
00783
00784     HRESULT            hr;
00785     long               lMediaType;
00786     TERMINAL_DIRECTION dir;
00787
00788     hr = pStream->get_MediaType( &lMediaType );
00789     if ( FAILED(hr) ) return hr;
00790
00791     hr = pStream->get_Direction( &dir );
00792     if ( FAILED(hr) ) return hr;
00793
00794     //
00795     // Since video render is a dynamic terminal, the procedure for creating
00796     // it is different.
00797     //
00798
00799     if ( ( lMediaType == TAPIMEDIATYPE_VIDEO ) &&
00800          ( dir        == TD_RENDER ) )
00801     {
00802         return GetVideoRenderTerminal(ppTerminal);
00803     }
00804
00805     //
00806     // For all other terminals we use GetDefaultStaticTerminal.
00807     // First, get the terminal support interface.
00808     //
00809
00810     ITTerminalSupport * pTerminalSupport;
00811
00812     hr = gpAddress->QueryInterface( IID_ITTerminalSupport,
00813                                     (void **)&pTerminalSupport);
00814
00815     if ( SUCCEEDED(hr) )
00816     {
00817         //
00818         // get the default terminal for this MediaType and direction
00819         //
00820
00821         hr = pTerminalSupport->GetDefaultStaticTerminal(lMediaType,
00822                                                         dir,
00823                                                         ppTerminal);
00824
00825         pTerminalSupport->Release();
00826     }
00827
00828     return hr;
00829
00830 }
00831
00832 /////////////////////////////////////////////////////////
00833 // GetVideoRenderTerminal
00834 //
00835 // Creates a dynamic terminal for the Video Render mediatype / direction
00836 //
00837 /////////////////////////////////////////////////////////
00838 HRESULT
00839 GetVideoRenderTerminal(
00840                    ITTerminal ** ppTerminal
00841                   )
00842 {
00843     //
00844     // Construct a BSTR for the correct IID.
00845     //
00846
00847     LPOLESTR            lpTerminalClass;
00848
00849     HRESULT             hr;
00850
00851     hr = StringFromIID(CLSID_VideoWindowTerm,
00852                        &lpTerminalClass);
00853
00854     if ( SUCCEEDED(hr) )
00855     {
00856         BSTR                bstrTerminalClass;
00857
00858         bstrTerminalClass = SysAllocString ( lpTerminalClass );
00859
00860         CoTaskMemFree( lpTerminalClass );
00861
00862         if ( bstrTerminalClass == NULL )
00863         {
00864             hr = E_OUTOFMEMORY;
00865         }
00866         else
00867         {
00868
00869             //
00870             // Get the terminal support interface
00871             //
00872
00873             ITTerminalSupport * pTerminalSupport;
00874
00875             hr = gpAddress->QueryInterface(IID_ITTerminalSupport,
00876                                            (void **)&pTerminalSupport);
00877
00878             if ( SUCCEEDED(hr) )
00879             {
00880                 //
00881                 // Create the video render terminal.
00882                 //
00883
00884                 hr = pTerminalSupport->CreateTerminal(bstrTerminalClass,
00885                                                       TAPIMEDIATYPE_VIDEO,
00886                                                       TD_RENDER,
00887                                                       ppTerminal);
00888
00889                 pTerminalSupport->Release();
00890
00891                 if ( SUCCEEDED(hr) )
00892                 {
00893                     // Get the video window interface for the terminal
00894                     IVideoWindow *pVideoWindow = NULL;
00895
00896                     hr = (*ppTerminal)->QueryInterface(IID_IVideoWindow,
00897                                                        (void**)&pVideoWindow);
00898
00899                     if ( SUCCEEDED(hr) )
00900                     {
00901                         //
00902                         // Set the AutoShow member to true
00903                         //
00904                         // Note that the AutoShow property is the only one
00905                         // we can use on this terminal's IVideoWindow and
00906                         // IBasicVideo interfaces before the CME_STREAM_ACTIVE
00907                         // event is received for the stream. All other methods
00908                         // will fail until CME_STREAM_ACTIVE has been sent.
00909                         // Applications that need to control more about a video
00910                         // window than just its visibility must listen for the
00911                         // CME_STREAM_ACTIVE event. See the "t3in.exe" sample
00912                         // for how to do this.
00913                         //
00914
00915                         hr = pVideoWindow->put_AutoShow( VARIANT_TRUE );
00916
00917                         pVideoWindow->Release();
00918                     }
00919                 }
00920             }
00921
00922             SysFreeString( bstrTerminalClass );
00923         }
00924     }
00925
00926     return hr;
00927 }
00928
00929
00930 //////////////////////////////////////////////////////////////////////
00931 // DisconnectTheCall
00932 //
00933 // Disconnects the call
00934 //////////////////////////////////////////////////////////////////////
00935 HRESULT
00936 DisconnectTheCall()
00937 {
00938     HRESULT         hr = S_OK;
00939
00940     if (NULL != gpCall)
00941     {
00942         hr = gpCall->Disconnect( DC_NORMAL );
00943
00944         gpCall->Release();
00945         gpCall = NULL;
00946
00947         return hr;
00948     }
00949
00950     return S_FALSE;
00951 }
00952
00953
00954
00955 ///////////////////////////////////////////////////////////////////
00956 //
00957 // HELPER FUNCTIONS
00958 //
00959 ///////////////////////////////////////////////////////////////////
00960
00961
00962 ///////////////////////////////////////////////////////////////////
00963 // DoMessage
00964 ///////////////////////////////////////////////////////////////////
00965 void
00966 DoMessage(
00967           LPWSTR pszMessage
00968          )
00969 {
00970     MessageBox(
00971                ghDlg,
00972                pszMessage,
00973                gszTapi30,
00974                MB_OK
00975               );
00976 }
00977
00978 ///////////////////////////////////////////////////////////////
00979 // EnableButton
00980 //
00981 // Enable, make default, and setfocus to a button
00982 ///////////////////////////////////////////////////////////////
00983 void
00984 EnableButton(
00985              HWND hDlg,
00986              int ID
00987             )
00988 {
00989     SendDlgItemMessage(
00990                        hDlg,
00991                        ID,
00992                        BM_SETSTYLE,
00993                        BS_DEFPUSHBUTTON,
00994                        0
00995                       );
00996     EnableWindow(
00997                  GetDlgItem( hDlg, ID ),
00998                  TRUE
00999                 );
01000     SetFocus(
01001              GetDlgItem( hDlg, ID )
01002             );
01003 }
01004
01005 //////////////////////////////////////////////////////////////
01006 // DisableButton
01007 //
01008 // Disable a button
01009 //////////////////////////////////////////////////////////////
01010 void
01011 DisableButton(
01012               HWND hDlg,
01013               int ID
01014              )
01015 {
01016     SendDlgItemMessage(
01017                        hDlg,
01018                        ID,
01019                        BM_SETSTYLE,
01020                        BS_PUSHBUTTON,
01021                        0
01022                       );
01023     EnableWindow(
01024                  GetDlgItem( hDlg, ID ),
01025                  FALSE
01026                 );
01027 }
01028
01029 //////////////////////////////////////////////////////////////
01030 // AddressSupportsMediaType
01031 //
01032 // Finds out if the given address supports the given media
01033 // type, and returns TRUE if it does.
01034 //////////////////////////////////////////////////////////////
01035
01036 BOOL
01037 AddressSupportsMediaType(
01038                          ITAddress * pAddress,
01039                          long        lMediaType
01040                         )
01041 {
01042     VARIANT_BOOL     bSupport = VARIANT_FALSE;
01043     ITMediaSupport * pMediaSupport;
01044
01045     if ( SUCCEEDED( pAddress->QueryInterface( IID_ITMediaSupport,
01046                                               (void **)&pMediaSupport ) ) )
01047     {
01048         // does it support this media type?
01049         pMediaSupport->QueryMediaType(
01050                                       lMediaType,
01051                                       &bSupport
01052                                      );
01053
01054         pMediaSupport->Release();
01055     }
01056
01057     return (bSupport == VARIANT_TRUE);
01058 }
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDeleteQueueDialog Member List

This is the complete list of members for CDeleteQueueDialog, including all inherited members.
CDeleteQueueDialog(CArray< ARRAYQ *, ARRAYQ * > *, CWnd *pParent=NULL) | CDeleteQueueDialog |
DoDataExchange(CDataExchange *pDX) | CDeleteQueueDialog | [protected, virtual]
GetPathName(TCHAR szPathName[BUFFERSIZE]) | CDeleteQueueDialog | [inline]
IDD enum value | CDeleteQueueDialog |
m_PathNameCB | CDeleteQueueDialog |
m_pStrArray | CDeleteQueueDialog |
m_szPathName | CDeleteQueueDialog |
OnInitDialog() | CDeleteQueueDialog | [protected, virtual]
Generated on Wed Nov 13 2024 16:56:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleSend/Simple.c Source File

  • NetDS
  • fax
  • SampleSend

Simple.c

Go to the documentation of this file.
00001     /*++
00002
00003     Copyright (c) 1998 - 2000  Microsoft Corporation
00004
00005     Module Name:
00006
00007        simple.c
00008
00009     Abstract:
00010
00011         This module implements a simple command line fax-send utility
00012
00013     --*/
00014
00015     #include <windows.h>
00016     #include <winbase.h>
00017     #include <stdio.h>
00018     #include <stdlib.h>
00019     #include <winfax.h>
00020     #include <tchar.h>
00021     #include <assert.h>
00022     #include <shellapi.h>
00023
00024
00025     #ifdef DBG
00026 TCHAR   szDebugBuffer[80]={0};
00027         #define DEBUG_SIMPLE(parm1,parm2) \
00028         {\
00029             _sntprintf(szDebugBuffer, (sizeof(szDebugBuffer)/sizeof(szDebugBuffer[0])-1), parm1, parm2);\
00030             OutputDebugString(szDebugBuffer);\
00031         }
00032     #else
00033         #define DEBUG_SIMPLE(parm1,parm2)
00034     #endif
00035
00036     #define ARR_SIZE(a) (sizeof(a)/sizeof(a[0]))
00037
00038     void GiveUsage(LPTSTR AppName)
00039     {
00040         _tprintf( TEXT("Usage : %s /d <full path to doc> /n <number>\n --send a fax\n"),AppName);
00041         _tprintf( TEXT("Usage : %s /? -- this message\n"),AppName);
00042
00043     }
00044
00045     void PrintDeviceStatus(PFAX_DEVICE_STATUS fds)
00046     {
00047         TCHAR SubmitBuffer[100];
00048         TCHAR StartBuffer[100];
00049         SYSTEMTIME SystemTime;
00050
00051         if (!fds)
00052         {
00053             return;
00054         }
00055
00056         _tprintf(TEXT("Device Id:\t\t%d\n"),fds->DeviceId );
00057         _tprintf(TEXT("Device Name:\t\t%s\n"),fds->DeviceName );
00058         _tprintf(TEXT("CallerId:\t\t%s\n"),fds->CallerId );
00059         _tprintf(TEXT("CSID:\t\t\t%s\n"),fds->Csid );
00060         _tprintf(TEXT("TSID:\t\t\t%s\n"),fds->Tsid );
00061         _tprintf(TEXT("Page:\t\t\t%d of %d\n"),fds->CurrentPage,fds->TotalPages );
00062         _tprintf(TEXT("DocumentName:\t\t%s\n"),fds->DocumentName);
00063         _tprintf(TEXT("JobType:\t\t%d\n"),fds->JobType);
00064         _tprintf(TEXT("PhoneNumber:\t\t%s\n"),fds->PhoneNumber);
00065         _tprintf(TEXT("SenderName:\t\t%s\n"),fds->SenderName);
00066         _tprintf(TEXT("RecipientName:\t\t%s\n"),fds->RecipientName);
00067         _tprintf(TEXT("Size (in bytes):\t%d\n"),fds->Size);
00068         _tprintf(TEXT("Status (see FPS flags):\t0x%x\n"),fds->Status);
00069
00070         FileTimeToSystemTime(&fds->StartTime,&SystemTime);
00071
00072         GetTimeFormat(
00073             LOCALE_SYSTEM_DEFAULT,
00074             LOCALE_NOUSEROVERRIDE,
00075             &SystemTime,
00076             NULL,
00077             StartBuffer,
00078             ARR_SIZE(StartBuffer)
00079             );
00080
00081         FileTimeToSystemTime(&fds->SubmittedTime,&SystemTime);
00082         SystemTimeToTzSpecificLocalTime(NULL,&SystemTime,&SystemTime);
00083
00084         GetTimeFormat(
00085             LOCALE_SYSTEM_DEFAULT,
00086             LOCALE_NOUSEROVERRIDE,
00087             &SystemTime,
00088             NULL,
00089             SubmitBuffer,
00090             ARR_SIZE(SubmitBuffer)
00091             );
00092
00093         _tprintf(TEXT("Job Submited at %s\n"),SubmitBuffer);
00094         _tprintf(TEXT("Job transmission started at %s\n\n"),StartBuffer);
00095     }
00096
00097     int main(int argc,char *argvA[])
00098     /*++
00099
00100     Routine Description:
00101
00102         Entry point to the setup program
00103
00104     Arguments:
00105
00106         argc - Number of args.
00107         argvA - the commandline arguments.
00108
00109
00110     Return Value:
00111
00112
00113     --*/
00114     {
00115         LPTSTR *argv;
00116         int argcount = 0;
00117         TCHAR Document[MAX_PATH] = {0};
00118         TCHAR Number[64] = {0};
00119
00120         HANDLE hFax;
00121         HANDLE hCompletionPort = INVALID_HANDLE_VALUE;
00122         HANDLE hFile;
00123         PFAX_JOB_PARAM JobParam;
00124         PFAX_COVERPAGE_INFO CoverpageInfo;
00125         DWORD JobId;
00126         DWORD dwBytes, CompletionKey;
00127         PFAX_EVENT FaxEvent;
00128         BOOL bTerminate = FALSE;
00129         HANDLE hPort;
00130         PFAX_DEVICE_STATUS DeviceStatus;
00131
00132         //
00133         // do commandline stuff
00134         //
00135     #ifdef UNICODE
00136         argv = CommandLineToArgvW( GetCommandLine(), &argc );
00137     #else
00138         argv = argvA;
00139     #endif
00140
00141         DEBUG_SIMPLE ("Number of arguments = %d\n",argc);
00142         for (argcount=0;argcount<argc;argcount++)
00143         {
00144             DEBUG_SIMPLE ("Arg %d:",argcount);
00145             DEBUG_SIMPLE (" %s\n",argv[argcount]);
00146         }
00147
00148         // check for commandline switches
00149         for (argcount=0; argcount<argc; argcount++)
00150         {
00151             if ((argv[argcount][0] == L'/') || (argv[argcount][0] == L'-'))
00152             {
00153                 switch (towlower(argv[argcount][1]))
00154                 {
00155                 case 'n':
00156                    lstrcpyn(Number, argv[argcount+1],ARR_SIZE(Number));
00157                    break;
00158                 case 'd':
00159                    lstrcpyn(Document, argv[argcount+1],ARR_SIZE(Document));
00160                    //check to see if the file exists and if it is a disk file
00161                    hFile = CreateFile(Document,
00162                                       GENERIC_READ,
00163                                       FILE_SHARE_READ,
00164                                       NULL,
00165                                       OPEN_EXISTING,
00166                                       FILE_ATTRIBUTE_NORMAL,
00167                                       NULL);
00168                    if ((hFile == INVALID_HANDLE_VALUE)||(GetFileType(hFile) != FILE_TYPE_DISK))
00169                    {
00170                         _tprintf( TEXT("Error with file : %s \n"),Document);
00171                         GiveUsage(argv[0]);
00172                         return -1;
00173                    }
00174                    CloseHandle(hFile);
00175                    break;
00176                 case '?':
00177                    GiveUsage(argv[0]);
00178                    return 0;
00179                 default:
00180                    break;
00181                 }
00182             }
00183         }
00184
00185         if (!Number[0] || !Document[0])
00186         {
00187             _tprintf( TEXT("Missing args.\n") );
00188             GiveUsage(argv[0]);
00189             return -1;
00190         }
00191
00192         //
00193         // connect to fax service
00194         //
00195         if (!FaxConnectFaxServer(NULL,&hFax))
00196         {
00197             _tprintf( TEXT("FaxConnectFaxServer failed, ec = %d\n"),GetLastError() );
00198             return -1;
00199         }
00200
00201         assert (hFax != NULL);
00202
00203         hCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE,NULL,0,0);
00204
00205         if (!hCompletionPort)
00206         {
00207             _tprintf( TEXT("CreateIoCompletionPort failed, ec = %d\n"), GetLastError() );
00208             FaxClose( hFax );
00209             return -1;
00210         }
00211
00212         if (!FaxInitializeEventQueue(
00213             hFax,
00214             hCompletionPort,
00215             0,
00216             NULL,
00217             0
00218             ))
00219         {
00220             _tprintf( TEXT("FaxInitializeEventQueue failed, ec = %d\n"), GetLastError() );
00221             FaxClose( hFax );
00222             return -1;
00223         }
00224
00225         FaxCompleteJobParams(&JobParam,&CoverpageInfo);
00226         JobParam->RecipientNumber = Number;
00227         if (!FaxSendDocument( hFax, Document, JobParam, NULL , &JobId) )
00228         {
00229             _tprintf( TEXT("FaxSendDocument failed, ec = %d \n"), GetLastError() );
00230             FaxClose( hFax );
00231             CloseHandle( hCompletionPort );
00232             FaxFreeBuffer(JobParam);
00233             FaxFreeBuffer(CoverpageInfo);
00234             return -1;
00235         }
00236
00237         _tprintf(
00238             TEXT("Queued document %s for transmition to %s, JobID = %d\n"),
00239             Document,
00240             Number,
00241             JobId
00242             );
00243
00244         FaxFreeBuffer( JobParam );
00245         FaxFreeBuffer( CoverpageInfo );
00246
00247         while (
00248             !bTerminate &&
00249             GetQueuedCompletionStatus(
00250                 hCompletionPort,
00251                 &dwBytes,
00252                 &CompletionKey,
00253                 (LPOVERLAPPED *)&FaxEvent,
00254                 INFINITE
00255                 )
00256             )
00257        {
00258
00259             _tprintf( TEXT("Received event 0x%x\n"),FaxEvent->EventId);
00260
00261             switch (FaxEvent->EventId) {
00262                 case FEI_IDLE:
00263                 case FEI_COMPLETED:
00264                 case FEI_MODEM_POWERED_ON:
00265                 case FEI_MODEM_POWERED_OFF:
00266                 case FEI_FAXSVC_ENDED:
00267                     bTerminate = TRUE;
00268                     break;
00269
00270                 case FEI_JOB_QUEUED:
00271                     _tprintf( TEXT("JobId 0x%x queued\n"),FaxEvent->JobId );
00272                     break;
00273
00274                 case FEI_DIALING:
00275                 case FEI_SENDING:
00276                 case FEI_RECEIVING:
00277                 case FEI_BUSY:
00278                 case FEI_NO_ANSWER:
00279                 case FEI_BAD_ADDRESS:
00280                 case FEI_NO_DIAL_TONE:
00281                 case FEI_DISCONNECTED:
00282                 case FEI_FATAL_ERROR:
00283                 if (FaxOpenPort( hFax, FaxEvent->DeviceId,PORT_OPEN_QUERY, &hPort) )
00284                 {
00285                     if (FaxGetDeviceStatus(hPort,&DeviceStatus) )
00286                     {
00287                         PrintDeviceStatus(DeviceStatus);
00288                         FaxFreeBuffer( DeviceStatus );
00289                     }
00290                     FaxClose( hPort );
00291                 }
00292                 break;
00293             }
00294         }
00295
00296         FaxClose( hFax );
00297         CloseHandle( hCompletionPort );
00298         return 1;
00299     }
00300
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/IpxChat/WinMain.c Source File

  • NetDS
  • WinSock
  • IpxChat

WinMain.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   winmain.c
00009 //
00010 //  PURPOSE:   Calls initialization functions and processes the message loop
00011 //
00012 //
00013 //  PLATFORMS: Windows 95, Windows NT
00014 //
00015 //  FUNCTIONS:
00016 //    WinMain() - calls initialization functions, processes message loop
00017 //
00018 //  COMMENTS:
00019 //
00020 //
00021
00022 #include "globals.h"            // prototypes specific to this application
00023 #include <windows.h>            // required for all Windows applications
00024
00025
00026
00027 //
00028 //  FUNCTION: WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
00029 //
00030 //  PURPOSE: calls initialization function, processes message loop
00031 //
00032 //  PARAMETERS:
00033 //
00034 //    hInstance - The handle to the instance of this application that
00035 //          is currently being executed.
00036 //
00037 //    hPrevInstance - This parameter is always NULL in Win32
00038 //          applications.
00039 //
00040 //    lpCmdLine - A pointer to a null terminated string specifying the
00041 //          command line of the application.
00042 //
00043 //    nCmdShow - Specifies how the main window is to be diplayed.
00044 //
00045 //  RETURN VALUE:
00046 //    If the function terminates before entering the message loop,
00047 //    return FALSE.
00048 //    Otherwise, return the WPARAM value sent by the WM_QUIT message.
00049 //
00050 //
00051 //  COMMENTS:
00052 //
00053 //    Windows recognizes this function by name as the initial entry point
00054 //    for the program.  This function calls the initialization routine
00055 //    It then executes a message retrieval and dispatch loop that is the
00056 //    top-level control structure for the remainder of execution.  The
00057 //    loop is terminated when a WM_QUIT  message is received, at which
00058 //    time this function exits the application instance by returning the
00059 //    value passed by PostQuitMessage().
00060 //
00061 //    If this function must abort before entering the message loop, it
00062 //    returns the conventional value NULL.
00063 //
00064
00065 int APIENTRY WinMain(HINSTANCE hInstance,
00066                      HINSTANCE hPrevInstance,
00067                      LPSTR     lpCmdLine,
00068                      int       nCmdShow)
00069 {
00070     MSG msg;
00071     HANDLE hAccelTable;
00072
00073     // Initialize application by setting up the main window.
00074     if (!InitApplication(hInstance, nCmdShow))
00075     {
00076         return FALSE;           // Exits if unable to initialize
00077     }
00078
00079     if(NULL == (hAccelTable = LoadAccelerators(hInstance, szAppName)))
00080         return FALSE;
00081
00082     // Acquire and dispatch messages until a WM_QUIT message is received.
00083     while (GetMessage(&msg, NULL, 0, 0))
00084     {
00085         if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
00086         {
00087             TranslateMessage(&msg);  // Translates virtual key codes
00088             DispatchMessage(&msg);   // Dispatches message to window
00089         }
00090     }
00091     return (int)msg.wParam;  // Returns the value from PostQuitMessage
00092 }
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Event_Provider/Events.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Event_Provider

Events.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   XXXX
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #include "precomp.h"
00017
00018 #include <wbemcli.h>
00019 #include <wbemprov.h>
00020 #include "Globals.h"
00021 #include "Events.h"
00022
00023 /******************************************************************************
00024  *
00025  *  Name:
00026  *
00027  *
00028  *  Description:
00029  *
00030  *
00031  *****************************************************************************/
00032
00033 CProvider_IWbemEventProvider :: CProvider_IWbemEventProvider () :
00034
00035   m_ReferenceCount ( 0 ) ,
00036   m_InternalReferenceCount ( 0 ) ,
00037   m_User ( NULL ) ,
00038   m_Locale ( NULL ) ,
00039   m_Namespace ( NULL ) ,
00040   m_CoreService ( NULL ) ,
00041   m_EventObject ( NULL ) ,
00042   m_EventSink ( NULL ) ,
00043   m_ThreadHandle ( NULL )
00044 {
00045   InitializeCriticalSection ( & m_CriticalSection ) ;
00046
00047   InterlockedIncrement ( & Provider_Globals :: s_ObjectsInProgress ) ;
00048 }
00049
00050 /******************************************************************************
00051  *
00052  *  Name:
00053  *
00054  *
00055  *  Description:
00056  *
00057  *
00058  *****************************************************************************/
00059
00060 CProvider_IWbemEventProvider :: ~CProvider_IWbemEventProvider ()
00061 {
00062   DeleteCriticalSection ( & m_CriticalSection ) ;
00063
00064   if ( m_EventObject )
00065   {
00066     m_EventObject->Release () ;
00067   }
00068
00069   if ( m_EventSink )
00070   {
00071     m_EventSink->Release () ;
00072   }
00073
00074   if ( m_User )
00075   {
00076     SysFreeString ( m_User ) ;
00077   }
00078
00079   if ( m_Locale )
00080   {
00081     SysFreeString ( m_Locale ) ;
00082   }
00083
00084   if ( m_Namespace )
00085   {
00086     SysFreeString ( m_Namespace ) ;
00087   }
00088
00089   if ( m_CoreService )
00090   {
00091     m_CoreService->Release () ;
00092   }
00093
00094   InterlockedDecrement ( & Provider_Globals :: s_ObjectsInProgress ) ;
00095 }
00096
00097 /******************************************************************************
00098  *
00099  *  Name:
00100  *
00101  *
00102  *  Description:
00103  *
00104  *
00105  *****************************************************************************/
00106
00107 STDMETHODIMP_(ULONG) CProvider_IWbemEventProvider :: AddRef ( void )
00108 {
00109   LONG t_Reference ;
00110
00111   if ( ( t_Reference = InterlockedIncrement ( & m_ReferenceCount ) ) == 1 )
00112   {
00113     InternalAddRef () ;
00114   }
00115
00116   return t_Reference ;
00117 }
00118
00119 /******************************************************************************
00120  *
00121  *  Name:
00122  *
00123  *
00124  *  Description:
00125  *
00126  *
00127  *****************************************************************************/
00128
00129 STDMETHODIMP_(ULONG) CProvider_IWbemEventProvider :: Release ( void )
00130 {
00131   LONG t_Reference ;
00132   if ( ( t_Reference = InterlockedDecrement ( & m_ReferenceCount ) ) == 0 )
00133   {
00134     if ( m_ThreadTerminate )
00135     {
00136       SetEvent ( m_ThreadTerminate ) ;
00137     }
00138
00139     if ( m_ThreadHandle )
00140     {
00141       WaitForSingleObject ( m_ThreadHandle , INFINITE ) ;
00142       CloseHandle ( m_ThreadHandle ) ;
00143     }
00144
00145     InternalRelease () ;
00146   }
00147
00148   return t_Reference ;
00149 }
00150
00151 /******************************************************************************
00152  *
00153  *  Name:
00154  *
00155  *
00156  *  Description:
00157  *
00158  *
00159  *****************************************************************************/
00160
00161 STDMETHODIMP_(ULONG) CProvider_IWbemEventProvider :: InternalAddRef ( void )
00162 {
00163   return InterlockedIncrement ( & m_InternalReferenceCount ) ;
00164 }
00165
00166 /******************************************************************************
00167  *
00168  *  Name:
00169  *
00170  *
00171  *  Description:
00172  *
00173  *
00174  *****************************************************************************/
00175
00176 STDMETHODIMP_(ULONG) CProvider_IWbemEventProvider :: InternalRelease ( void )
00177 {
00178   LONG t_Reference ;
00179   if ( ( t_Reference = InterlockedDecrement ( & m_InternalReferenceCount ) ) == 0 )
00180   {
00181     delete this ;
00182   }
00183
00184   return t_Reference ;
00185 }
00186
00187 /******************************************************************************
00188  *
00189  *  Name:
00190  *
00191  *
00192  *  Description:
00193  *
00194  *
00195  *****************************************************************************/
00196
00197 STDMETHODIMP CProvider_IWbemEventProvider :: QueryInterface (
00198
00199   REFIID a_Riid ,
00200   LPVOID FAR *a_Void
00201 )
00202 {
00203   *a_Void = NULL ;
00204
00205   if ( a_Riid == IID_IUnknown )
00206   {
00207     *a_Void = ( LPVOID ) this ;
00208   }
00209   else if ( a_Riid == IID_IWbemEventProvider )
00210   {
00211     *a_Void = ( LPVOID ) ( IWbemEventProvider * ) this ;
00212   }
00213   else if ( a_Riid == IID_IWbemProviderInit )
00214   {
00215     *a_Void = ( LPVOID ) ( IWbemProviderInit * ) this ;
00216   }
00217   else if ( a_Riid == IID_IWbemShutdown )
00218   {
00219     *a_Void = ( LPVOID ) ( IWbemShutdown * ) this ;
00220   }
00221
00222   if ( *a_Void )
00223   {
00224     ( ( LPUNKNOWN ) *a_Void )->AddRef () ;
00225
00226     return ResultFromScode ( S_OK ) ;
00227   }
00228   else
00229   {
00230     return ResultFromScode ( E_NOINTERFACE ) ;
00231   }
00232 }
00233
00234 /******************************************************************************
00235  *
00236  *  Name:
00237  *
00238  *
00239  *  Description:
00240  *
00241  *
00242  *****************************************************************************/
00243
00244 HRESULT CProvider_IWbemEventProvider :: Initialize (
00245
00246   LPWSTR a_User,
00247   LONG a_Flags,
00248   LPWSTR a_Namespace,
00249   LPWSTR a_Locale,
00250   IWbemServices *a_CoreService,         // For anybody
00251   IWbemContext *a_Context,
00252   IWbemProviderInitSink *a_Sink     // For init signals
00253 )
00254 {
00255   HRESULT t_Result = S_OK ;
00256
00257   if ( a_CoreService )
00258   {
00259     m_CoreService = a_CoreService ;
00260     m_CoreService->AddRef () ;
00261   }
00262   else
00263   {
00264     t_Result = WBEM_E_INVALID_PARAMETER ;
00265   }
00266
00267   if ( SUCCEEDED ( t_Result ) )
00268   {
00269     if ( a_User )
00270     {
00271       m_User = SysAllocString ( a_User ) ;
00272       if ( m_User == NULL )
00273       {
00274         t_Result = WBEM_E_OUT_OF_MEMORY ;
00275       }
00276     }
00277   }
00278
00279   if ( SUCCEEDED ( t_Result ) )
00280   {
00281     if ( a_Locale )
00282     {
00283       m_Locale = SysAllocString ( a_Locale ) ;
00284       if ( m_Locale == NULL )
00285       {
00286         t_Result = WBEM_E_OUT_OF_MEMORY ;
00287       }
00288     }
00289   }
00290
00291   if ( SUCCEEDED ( t_Result ) )
00292   {
00293     if ( a_Namespace )
00294     {
00295       m_Namespace = SysAllocString ( a_Namespace ) ;
00296       if ( m_Namespace == NULL )
00297       {
00298         t_Result = WBEM_E_OUT_OF_MEMORY ;
00299       }
00300     }
00301   }
00302
00303   if ( SUCCEEDED ( t_Result ) )
00304   {
00305     BSTR t_Class = SysAllocString ( L"SampleEvent" ) ;
00306     if ( t_Class )
00307     {
00308       t_Result = m_CoreService->GetObject (
00309
00310         t_Class ,
00311         0 ,
00312         a_Context ,
00313         & m_EventObject ,
00314         NULL
00315       ) ;
00316
00317       if ( SUCCEEDED ( t_Result ) )
00318       {
00319       }
00320
00321       SysFreeString ( t_Class ) ;
00322     }
00323     else
00324     {
00325       t_Result = WBEM_E_OUT_OF_MEMORY ;
00326     }
00327   }
00328
00329   m_ThreadTerminate = CreateEvent ( NULL , FALSE , FALSE , NULL ) ;
00330   if ( m_ThreadTerminate == NULL )
00331   {
00332     t_Result = WBEM_E_OUT_OF_MEMORY ;
00333   }
00334
00335   a_Sink->SetStatus ( t_Result , 0 ) ;
00336
00337   return t_Result ;
00338 }
00339
00340 /******************************************************************************
00341  *
00342  *  Name:
00343  *
00344  *
00345  *  Description:
00346  *
00347  *
00348  *****************************************************************************/
00349
00350 HRESULT CProvider_IWbemEventProvider :: Shutdown (
00351
00352   LONG a_Flags ,
00353   ULONG a_MaxMilliSeconds ,
00354   IWbemContext *a_Context
00355 )
00356 {
00357   HRESULT t_Result = S_OK ;
00358
00359   return t_Result ;
00360 }
00361
00362 /******************************************************************************
00363  *
00364  *  Name:
00365  *
00366  *
00367  *  Description:
00368  *
00369  *
00370  *****************************************************************************/
00371
00372 DWORD CProvider_IWbemEventProvider :: ThreadExecutionFunction ( void *a_Context )
00373 {
00374   HRESULT t_Result = S_OK ;
00375
00376   CProvider_IWbemEventProvider *t_This = ( CProvider_IWbemEventProvider * ) a_Context ;
00377   if ( t_This )
00378   {
00379     t_Result = CoInitializeEx (
00380
00381       0,
00382       COINIT_MULTITHREADED
00383     ) ;
00384
00385     if ( SUCCEEDED ( t_Result ) )
00386     {
00387       IWbemClassObject *t_Instance = NULL ;
00388       t_Result = t_This->m_EventObject->SpawnInstance ( 0 , & t_Instance ) ;
00389       if ( SUCCEEDED ( t_Result ) )
00390       {
00391         VARIANT t_Variant ;
00392         VariantInit ( & t_Variant ) ;
00393
00394         t_Variant.vt = VT_BSTR ;
00395         t_Variant.bstrVal = SysAllocString ( L"Steve" ) ;
00396
00397         if (t_Variant.bstrVal)
00398         {
00399           t_Result = t_Instance->Put (
00400
00401             L"Name" ,
00402             0 ,
00403             & t_Variant ,
00404             CIM_EMPTY
00405           ) ;
00406         }
00407         else
00408         {
00409           t_Result = WBEM_E_OUT_OF_MEMORY;
00410         }
00411
00412         VariantClear ( & t_Variant ) ;
00413
00414         if ( SUCCEEDED ( t_Result ) )
00415         {
00416           BOOL t_Continue = TRUE ;
00417           while ( t_Continue )
00418           {
00419             DWORD t_Status = WaitForSingleObject ( t_This->m_ThreadTerminate , 1000 ) ;
00420             switch ( t_Status )
00421             {
00422               case WAIT_TIMEOUT:
00423               {
00424                 t_This->m_EventSink->Indicate ( 1 , & t_Instance ) ;
00425               }
00426               break ;
00427
00428               case WAIT_OBJECT_0:
00429               {
00430                 t_Continue = FALSE ;
00431               }
00432               break ;
00433
00434               default:
00435               {
00436                 t_Continue = FALSE ;
00437               }
00438               break ;
00439             }
00440           }
00441         }
00442
00443         t_Instance->Release () ;
00444       }
00445     }
00446
00447     t_This->InternalRelease () ;
00448   }
00449   else
00450   {
00451     t_Result = WBEM_E_INVALID_PARAMETER ;
00452   }
00453
00454   return t_Result ;
00455 }
00456
00457 /******************************************************************************
00458  *
00459  *  Name:
00460  *
00461  *
00462  *  Description:
00463  *
00464  *
00465  *****************************************************************************/
00466
00467 HRESULT CProvider_IWbemEventProvider :: ProvideEvents (
00468
00469   IWbemObjectSink *a_Sink ,
00470   LONG a_Flags
00471 )
00472 {
00473   HRESULT t_Result = S_OK ;
00474
00475   m_EventSink = a_Sink ;
00476   m_EventSink->AddRef () ;
00477
00478   InternalAddRef () ;
00479
00480   DWORD t_ThreadId = 0 ;
00481   m_ThreadHandle = CreateThread (
00482
00483     NULL ,
00484     0 ,
00485     ( LPTHREAD_START_ROUTINE ) ThreadExecutionFunction ,
00486     this ,
00487     0 ,
00488     & t_ThreadId
00489   ) ;
00490
00491   if ( m_ThreadHandle == NULL )
00492   {
00493     InternalRelease () ;
00494   }
00495
00496   return t_Result ;
00497 }
00498
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/Common.h Source File

  • Multimedia
  • Gdi
  • Printer

Common.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /******************************************************************************\
00013 *
00014 *                             COMMON.H
00015 *
00016 \******************************************************************************/
00017
00018
00019 /******************************************************************************\
00020 *                         SYMBOLIC CONSTANTS
00021 \******************************************************************************/
00022
00023 #define ARC             0x00000001
00024 #define ELLIPSE         0x00000002
00025 #define LINETO          0x00000004
00026 #define PIE             0x00000008
00027 #define PLG_BLT         0x00000010
00028 #define POLYBEZIER      0x00000020
00029 #define POLYGON         0x00000040
00030 #define POLYLINE        0x00000080
00031 #define POLYPOLYGON     0x00000100
00032 #define RECTANGLE       0x00000200
00033 #define ROUNDRECT       0x00000400
00034 #define STRETCH_BLT     0x00000800
00035
00036 #define ALLGRAPHICS     0x00000fff
00037
00038 #define ENUMFONTS       0x40000000
00039 #define DRAWAXIS        0x80000000
00040
00041 #define MAX_GRAPHICS    12
00042
00043 #define BUFSIZE         256
00044
00045 //ERR_MOD_NAME
00046 #define MAIN_MENU_NAME            "MENU"
00047 #define MAIN_CLASS_NAME           "PRINTER"
00048 #define MAIN_WND_TITLE            IDS_MAINWNDTITLE
00049 #define MAIN_CLASS_STYLE          CS_HREDRAW | CS_VREDRAW
00050 #define MAIN_WND_STYLE            WS_OVERLAPPEDWINDOW
00051
00052
00053
00054 /******************************************************************************\
00055 *                            FUNCTION PROTOTYPES
00056 \******************************************************************************/
00057
00058 #define ErrMsgBox(txt,title) MessageBox (ghwndMain, (LPCTSTR) txt,   \
00059                                          (LPCTSTR) title,            \
00060                                          MB_OK | MB_ICONEXCLAMATION);
00061
00062
00063
00064 /******************************************************************************\
00065 *                            FUNCTION PROTOTYPES
00066 \******************************************************************************/
00067
00068 BOOL Paint (HDC, LPRECT);
00069
00070 LRESULT CALLBACK DevCapsXDlgProc           (HWND, UINT, WPARAM, LPARAM);
00071 LRESULT CALLBACK EnumPrintersDlgProc       (HWND, UINT, WPARAM, LPARAM);
00072 LRESULT CALLBACK GetDeviceCapsDlgProc      (HWND, UINT, WPARAM, LPARAM);
00073 LRESULT CALLBACK GetPrinterDriverDlgProc   (HWND, UINT, WPARAM, LPARAM);
00074 LRESULT CALLBACK EnumPrinterDriversDlgProc (HWND, UINT, WPARAM, LPARAM);
00075
00076 LPTSTR   GetStringRes (int id);
00077 LPTSTR   GetStringRes2 (int id);
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/CallAs/Client.c Source File

  • Com
  • Fundamentals
  • Object
  • CallAs

Client.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                        Microsoft RPC
00003                 Copyright Microsoft Corp. 1992-2000
00004                   object call_as Example
00005
00006     FILE:       client.c
00007
00008     USAGE:      client
00009
00010     PURPOSE:    Client side application of remoted custom interface
00011
00012     FUNCTIONS:  main() - binds to server and calls remote procedure
00013
00014     COMMENTS:   This version of the Ole2 distributed application that
00015                 prints "hello, world" (or other string) on the server
00016                 features a non-rpcable custom interface being remoted with
00017                 [call_as].
00018
00019 ****************************************************************************/
00020
00021 #define INC_OLE2
00022 #include <windows.h>
00023 #include <stdio.h>
00024 #include <assert.h>
00025 #include "callas.h"     // generated by MIDL from callas.idl/.acf
00026
00027 // the class ID of the server exe
00028 const
00029 CLSID CLSID_CallAs =
00030     {0xf9246030,0x9f33,0x11cd,{0xb2,0x3f,0x00,0xaa,0x00,0x33,0x9c,0xce}};
00031
00032
00033 /***********************************************************************
00034
00035     set up the following registry keys:
00036
00037     \Registry\Machine\Software\Classes
00038         CLSID
00039             {f9246030-9f33-11cd-b23f-00aa00339cce}
00040                 LocalServer32
00041                     = server.exe
00042             {a46deb30-9f33-11cd-b23f-00aa00339cce}
00043                 InProcServer32
00044                     = callas.dll
00045         Interface
00046             {a46deb30-9f33-11cd-b23f-00aa00339cce}
00047                 ProxyStubClsid32
00048                     = {a46deb30-9f33-11cd-b23f-00aa00339cce}
00049
00050     for the server, the LocalServer32 is the out-of-process server exe
00051     for the proxy, the InProcServer32 is the proxy dll
00052     for the interface, the ProxyStubClsid32 is the class id of the
00053         proxy class factory.
00054
00055 ***********************************************************************/
00056
00057 void InitializeRegistry(char *pszProxyDll, char *pszServer)
00058 {
00059     // the server exe CLSID
00060     const char *pszServerKey = "{f9246030-9f33-11cd-b23f-00aa00339cce}";
00061
00062     // the interface UUID
00063     const char *pszInterfaceKey = "{a46deb30-9f33-11cd-b23f-00aa00339cce}";
00064
00065     // the class factory CLSID ( the same as the interface UUID )
00066     const char *pszProxyDllKey = "{a46deb30-9f33-11cd-b23f-00aa00339cce}";
00067
00068
00069     LONG error          = 0;
00070     HKEY hKeyInterface;     // key for ...\Classes\Interface
00071     HKEY hKeyCLSID;         // key for ...\Classes\CLSID
00072     HKEY hKey;              // current key
00073     DWORD dwDisposition;
00074
00075     //Register the interfaces.
00076
00077     //create ...\Classes\Interface key
00078     error = RegCreateKeyEx(
00079         HKEY_CLASSES_ROOT,
00080         "Interface",
00081         0,
00082         "REG_SZ",
00083         REG_OPTION_NON_VOLATILE,
00084         KEY_ALL_ACCESS,
00085         0,
00086         &hKeyInterface,
00087         &dwDisposition);
00088
00089     // create the ...\Classes\Interface\{ <interface uuid> }  key
00090     error = RegCreateKeyEx(
00091         hKeyInterface,
00092         pszInterfaceKey,
00093         0,
00094         "REG_SZ",
00095         REG_OPTION_NON_VOLATILE,
00096         KEY_ALL_ACCESS,
00097         0,
00098         &hKey,
00099         &dwDisposition);
00100
00101     //create ProxyStubClsid32 key under the interface
00102     error = RegCreateKeyEx(
00103         hKey,
00104         "ProxyStubClsid32",
00105         0,
00106         "REG_SZ",
00107         REG_OPTION_NON_VOLATILE,
00108         KEY_ALL_ACCESS,
00109         0,
00110         &hKey,
00111         &dwDisposition);
00112
00113     //Set the class id for the PSFactoryBuffer for the interface
00114     error = RegSetValueEx(
00115         hKey,
00116         "",
00117         0,
00118         REG_SZ,
00119         pszProxyDllKey,
00120         strlen(pszProxyDllKey) + 1);
00121
00122
00123     //Register the classes.
00124
00125     //create the CLSID key
00126     error = RegCreateKeyEx(
00127         HKEY_CLASSES_ROOT,
00128         "CLSID",
00129         0,
00130         "REG_SZ",
00131         REG_OPTION_NON_VOLATILE,
00132         KEY_ALL_ACCESS,
00133         0,
00134         &hKeyCLSID,
00135         &dwDisposition);
00136
00137     //create key for the server
00138     error = RegCreateKeyEx(
00139         hKeyCLSID,
00140         pszServerKey,
00141         0,
00142         "REG_SZ",
00143         REG_OPTION_NON_VOLATILE,
00144         KEY_ALL_ACCESS,
00145         0,
00146         &hKey,
00147         &dwDisposition);
00148
00149     //create LocalServer32 key.
00150     error = RegCreateKeyEx(
00151         hKey,
00152         "LocalServer32",
00153         0,
00154         "REG_SZ",
00155         REG_OPTION_NON_VOLATILE,
00156         KEY_ALL_ACCESS,
00157         0,
00158         &hKey,
00159         &dwDisposition);
00160
00161     //Set the server name.
00162     error = RegSetValueEx(
00163         hKey,
00164         "",
00165         0,
00166         REG_SZ,
00167         pszServer,
00168         strlen(pszServer) + 1);
00169
00170     error = RegFlushKey(
00171         hKey );
00172
00173
00174     //create key for the proxy dll
00175     error = RegCreateKeyEx(
00176         hKeyCLSID,
00177         pszProxyDllKey,
00178         0,
00179         "REG_SZ",
00180         REG_OPTION_NON_VOLATILE,
00181         KEY_ALL_ACCESS,
00182         0,
00183         &hKey,
00184         &dwDisposition);
00185
00186     //create InProcServer32 key for the proxy dll
00187     error = RegCreateKeyEx(
00188         hKey,
00189         "InProcServer32",
00190         0,
00191         "REG_SZ",
00192         REG_OPTION_NON_VOLATILE,
00193         KEY_ALL_ACCESS,
00194         0,
00195         &hKey,
00196         &dwDisposition);
00197
00198     //register the proxy DLL
00199     error = RegSetValueEx(
00200         hKey,
00201         "",
00202         0,
00203         REG_SZ,
00204         pszProxyDll,
00205         strlen(pszProxyDll) + 1);
00206
00207     error = RegFlushKey(
00208         hKey );
00209
00210     //  printf("waiting for registry to update OLE\n");
00211     Sleep(1000);
00212 }
00213
00214 void Test()
00215 {
00216     IClassFactory *pClassFactory =0;
00217     IUnknown *punk = 0;
00218     IHelloCallAs *pCallAs = 0;
00219     HRESULT hr;
00220
00221     hr = CoInitialize(NULL);
00222     if (FAILED(hr))
00223     {
00224         printf("CoInitialize failed with %lx\n", hr);
00225         return;
00226     }
00227
00228     hr = CoGetClassObject(&CLSID_CallAs, CLSCTX_LOCAL_SERVER, 0, &IID_IClassFactory, &pClassFactory);
00229     if(FAILED(hr))
00230         printf("CoGetClassObject failed with %lx\n", hr);
00231     else
00232     {
00233         assert(pClassFactory);
00234         hr = pClassFactory->lpVtbl->CreateInstance(pClassFactory, 0, &IID_IUnknown, &punk);
00235         if(FAILED(hr))
00236             printf("IClassFactory::CreateInstance failed with %lx\n", hr);
00237         else
00238         {
00239             assert(punk);
00240             hr = punk->lpVtbl->QueryInterface(punk, &IID_IHelloCallAs, &pCallAs);
00241             if(FAILED(hr))
00242                 printf("IUnknown::QueryInterface failed with %lx\n", hr);
00243             else
00244             {
00245                 assert(pCallAs);
00246                 hr = pCallAs->lpVtbl->HelloProc(pCallAs, "Hello World!");
00247                 if(FAILED(hr))
00248                     printf("IHelloCallAs::HelloProc failed with %lx\n", hr);
00249                 else
00250                     printf("IHelloCallAs::HelloProc succeeded");
00251
00252                 pCallAs->lpVtbl->Release(pCallAs);
00253                 pCallAs = 0;
00254             }
00255             punk->lpVtbl->Release(punk);
00256             punk = 0;
00257         }
00258         pClassFactory->lpVtbl->Release(pClassFactory);
00259         pClassFactory = 0;
00260     }
00261     CoUninitialize();
00262 }
00263
00264 void TestDll()
00265 {
00266     // the dll name of the proxy dll
00267     const char *pszProxyDllName = "callas.dll";
00268
00269     char szDrive[_MAX_DRIVE];
00270     char szDirectory[_MAX_DIR];
00271     char szFileName[_MAX_FNAME];
00272
00273     char szClient[_MAX_PATH];
00274     char szProxyDll[_MAX_PATH];
00275     char szServer[_MAX_PATH];
00276
00277     GetModuleFileName(0, szClient, _MAX_PATH);
00278     _splitpath(szClient, szDrive, szDirectory, szFileName, NULL);
00279
00280     //Get the full path name of the server.
00281     _snprintf(szServer, sizeof(szServer)-1, "%s%sserver.exe", szDrive, szDirectory);
00282
00283     //Get the full path name of the proxy dll.
00284     _snprintf(szProxyDll, sizeof(szProxyDll)-1, "%s%s%s", szDrive, szDirectory, pszProxyDllName);
00285
00286     printf("Testing Dll\n");
00287     InitializeRegistry(szProxyDll, szServer);
00288
00289     Test();
00290 }
00291
00292
00293 void __cdecl main(int argc, char *argv[])
00294 {
00295     TestDll();
00296 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims/C#/AutoClaims.cs Source File

  • TabletPC
  • AutoClaims
  • C#

AutoClaims.cs

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 //  This is part of the Microsoft Tablet PC Platform SDK
00004 //  Copyright (C) 2002 Microsoft Corporation
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00009 //  documentation provided with the Software Development Kit.
00010 //  See these sources for more detailed information.
00011 //
00012 //  File: AutoClaims.cs
00013 //  AutoClaims Sample Application
00014 //
00015 //  This sample program simulates an auto insurance claim
00016 //  form. It uses the InkEdit control to allow the user to
00017 //  enter vehicle information and the InkPicture control to
00018 //  illustrate car damage.  The car damage diagram allows
00019 //  the user to select from multiple ink layers;  each layer
00020 //  has its own color and visibility setting.
00021 //
00022 //  The features used are: InkEdit, InkPicture, providing
00023 //  multiple layers of ink within a control.
00024 //
00025 //--------------------------------------------------------------------------
00026
00027 using System;
00028 using System.Data;
00029 using System.Drawing;
00030 using System.Threading;
00031 using System.Windows.Forms;
00032
00033 // The Ink namespace, which contains the Tablet PC Platform API
00034 using Microsoft.Ink;
00035
00036 namespace AutoClaims
00037 {
00038     /// <summary>
00039     /// InkLayer represents a given ink layer, which has a
00040     /// color and visibility setting associated with it.
00041     /// </summary>
00042     struct InkLayer
00043     {
00044         // Declare the ink, color, and visibility for this layer
00045         private Ink myInk;
00046         private Color myColor;
00047         private bool myHidden;
00048
00049         /// <summary>
00050         /// Constructor for InkLayer
00051         /// </summary>
00052         /// <param name="ink">The ink</param>
00053         /// <param name="color">The color of the layer</param>
00054         /// <param name="hidden">True if the layer is hidden</param>
00055         public InkLayer(Ink ink, Color color, bool hidden)
00056         {
00057             myInk = ink;
00058             myColor = color;
00059             myHidden = hidden;
00060         }
00061
00062         /// <summary>
00063         /// The property used to set the ink associated with this layer
00064         /// </summary>
00065         public Ink ActiveInk
00066         {
00067             get
00068             {
00069                 return myInk;
00070             }
00071             set
00072             {
00073                 myInk = value;
00074             }
00075         }
00076
00077         /// <summary>
00078         /// The color associated with this layer
00079         /// </summary>
00080         public Color ActiveColor
00081         {
00082             get
00083             {
00084                 return myColor;
00085             }
00086             set
00087             {
00088                 myColor = value;
00089             }
00090         }
00091
00092         /// <summary>
00093         /// True if this layer is hidden.
00094         /// </summary>
00095         public bool Hidden
00096         {
00097             get
00098             {
00099                 return myHidden;
00100             }
00101             set
00102             {
00103                 myHidden = value;
00104             }
00105         }
00106     }
00107
00108     /// <summary>
00109     /// The AutoClaims Sample Application form class
00110     /// </summary>
00111     public class AutoClaims : System.Windows.Forms.Form
00112     {
00113
00114         // Declare the array of ink layers used the vehicle illustration.
00115         InkLayer[] inkLayers;
00116
00117         // Declare an empty ink object (used when we don't want to draw
00118         // any ink).
00119         Ink emptyInk;
00120
00121         // Declare a value to hold the index of selected ink
00122         int selectedIndex = -1;
00123
00124         // Declare a value to hold whether the selected ink is hidden
00125         bool selectedHidden = false;
00126
00127         #region Standard Template Code
00128         internal System.Windows.Forms.CheckBox chHideLayer;
00129         internal System.Windows.Forms.Label lblVehicleDamage;
00130         internal System.Windows.Forms.Label lblVehicleDescription;
00131         internal System.Windows.Forms.Label lblModel;
00132         internal System.Windows.Forms.Label lblYear;
00133         internal System.Windows.Forms.Label lblMake;
00134         internal System.Windows.Forms.Label lblPolicyNumber;
00135         internal System.Windows.Forms.Label lblInsuredName;
00136         internal System.Windows.Forms.Label lblInstructions;
00137         internal System.Windows.Forms.Label lblTitle;
00138         internal System.Windows.Forms.PictureBox pictVehicleBox;
00139         internal System.Windows.Forms.PictureBox pictPolicyBox;
00140         internal System.Windows.Forms.PictureBox pictHorzontalBar2;
00141         internal System.Windows.Forms.PictureBox pictHorzontalBar3;
00142         internal System.Windows.Forms.PictureBox pictHorzontalBar1;
00143         internal System.Windows.Forms.PictureBox pictCheckmarks;
00144         internal System.Windows.Forms.ListBox lstAnnotationLayer;
00145         private Microsoft.Ink.InkPicture inkPictVehicle;
00146         private Microsoft.Ink.InkEdit inkEdPolicyNumber;
00147         private Microsoft.Ink.InkEdit inkEdName;
00148         private Microsoft.Ink.InkEdit inkEdYear;
00149         private Microsoft.Ink.InkEdit inkEdMake;
00150         private Microsoft.Ink.InkEdit inkEdModel;
00151         private System.ComponentModel.Container components = null;
00152         #endregion
00153
00154         public AutoClaims()
00155         {
00156             #region Standard Template Code
00157             //
00158             // Required for Windows Form Designer support
00159             //
00160             InitializeComponent();
00161             #endregion
00162         }
00163
00164         #region Standard Template Code
00165         /// <summary>
00166         /// Clean up any resources being used.
00167         /// </summary>
00168         protected override void Dispose( bool disposing )
00169         {
00170             if( disposing )
00171             {
00172                 if (components != null)
00173                 {
00174                     components.Dispose();
00175                 }
00176             }
00177             base.Dispose( disposing );
00178         }
00179         #endregion
00180
00181         #region Windows Form Designer generated code
00182         /// <summary>
00183         /// Required method for Designer support - do not modify
00184         /// the contents of this method with the code editor.
00185         /// </summary>
00186         private void InitializeComponent()
00187         {
00188             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AutoClaims));
00189             this.lblVehicleDamage = new System.Windows.Forms.Label();
00190             this.lblVehicleDescription = new System.Windows.Forms.Label();
00191             this.lblModel = new System.Windows.Forms.Label();
00192             this.lblYear = new System.Windows.Forms.Label();
00193             this.lblMake = new System.Windows.Forms.Label();
00194             this.lblPolicyNumber = new System.Windows.Forms.Label();
00195             this.lblInsuredName = new System.Windows.Forms.Label();
00196             this.chHideLayer = new System.Windows.Forms.CheckBox();
00197             this.pictHorzontalBar2 = new System.Windows.Forms.PictureBox();
00198             this.pictVehicleBox = new System.Windows.Forms.PictureBox();
00199             this.pictHorzontalBar3 = new System.Windows.Forms.PictureBox();
00200             this.pictPolicyBox = new System.Windows.Forms.PictureBox();
00201             this.pictHorzontalBar1 = new System.Windows.Forms.PictureBox();
00202             this.lblInstructions = new System.Windows.Forms.Label();
00203             this.lblTitle = new System.Windows.Forms.Label();
00204             this.pictCheckmarks = new System.Windows.Forms.PictureBox();
00205             this.inkPictVehicle = new Microsoft.Ink.InkPicture();
00206             this.lstAnnotationLayer = new System.Windows.Forms.ListBox();
00207             this.inkEdPolicyNumber = new Microsoft.Ink.InkEdit();
00208             this.inkEdName = new Microsoft.Ink.InkEdit();
00209             this.inkEdYear = new Microsoft.Ink.InkEdit();
00210             this.inkEdMake = new Microsoft.Ink.InkEdit();
00211             this.inkEdModel = new Microsoft.Ink.InkEdit();
00212             this.SuspendLayout();
00213             //
00214             // lblVehicleDamage
00215             //
00216             this.lblVehicleDamage.AutoSize = true;
00217             this.lblVehicleDamage.BackColor = System.Drawing.Color.White;
00218             this.lblVehicleDamage.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00219             this.lblVehicleDamage.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00220             this.lblVehicleDamage.Location = new System.Drawing.Point(8, 408);
00221             this.lblVehicleDamage.Name = "lblVehicleDamage";
00222             this.lblVehicleDamage.Size = new System.Drawing.Size(256, 20);
00223             this.lblVehicleDamage.TabIndex = 58;
00224             this.lblVehicleDamage.Text = "Description of vehicle damage";
00225             this.lblVehicleDamage.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00226             //
00227             // lblVehicleDescription
00228             //
00229             this.lblVehicleDescription.AutoSize = true;
00230             this.lblVehicleDescription.BackColor = System.Drawing.Color.White;
00231             this.lblVehicleDescription.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00232             this.lblVehicleDescription.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00233             this.lblVehicleDescription.Location = new System.Drawing.Point(8, 240);
00234             this.lblVehicleDescription.Name = "lblVehicleDescription";
00235             this.lblVehicleDescription.Size = new System.Drawing.Size(386, 20);
00236             this.lblVehicleDescription.TabIndex = 56;
00237             this.lblVehicleDescription.Text = "Enter the involved vehicle listed on the policy ";
00238             this.lblVehicleDescription.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00239             //
00240             // lblModel
00241             //
00242             this.lblModel.AutoSize = true;
00243             this.lblModel.BackColor = System.Drawing.Color.Gainsboro;
00244             this.lblModel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00245             this.lblModel.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00246             this.lblModel.Location = new System.Drawing.Point(112, 360);
00247             this.lblModel.Name = "lblModel";
00248             this.lblModel.Size = new System.Drawing.Size(73, 23);
00249             this.lblModel.TabIndex = 52;
00250             this.lblModel.Text = "Model:";
00251             this.lblModel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00252             //
00253             // lblYear
00254             //
00255             this.lblYear.AutoSize = true;
00256             this.lblYear.BackColor = System.Drawing.Color.Gainsboro;
00257             this.lblYear.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00258             this.lblYear.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00259             this.lblYear.Location = new System.Drawing.Point(48, 280);
00260             this.lblYear.Name = "lblYear";
00261             this.lblYear.Size = new System.Drawing.Size(135, 23);
00262             this.lblYear.TabIndex = 51;
00263             this.lblYear.Text = "Year (YYYY):";
00264             this.lblYear.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00265             //
00266             // lblMake
00267             //
00268             this.lblMake.AutoSize = true;
00269             this.lblMake.BackColor = System.Drawing.Color.Gainsboro;
00270             this.lblMake.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00271             this.lblMake.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00272             this.lblMake.Location = new System.Drawing.Point(112, 320);
00273             this.lblMake.Name = "lblMake";
00274             this.lblMake.Size = new System.Drawing.Size(67, 23);
00275             this.lblMake.TabIndex = 50;
00276             this.lblMake.Text = "Make:";
00277             this.lblMake.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00278             //
00279             // lblPolicyNumber
00280             //
00281             this.lblPolicyNumber.AutoSize = true;
00282             this.lblPolicyNumber.BackColor = System.Drawing.Color.Gainsboro;
00283             this.lblPolicyNumber.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00284             this.lblPolicyNumber.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00285             this.lblPolicyNumber.Location = new System.Drawing.Point(32, 136);
00286             this.lblPolicyNumber.Name = "lblPolicyNumber";
00287             this.lblPolicyNumber.Size = new System.Drawing.Size(157, 23);
00288             this.lblPolicyNumber.TabIndex = 47;
00289             this.lblPolicyNumber.Text = "Policy Number:";
00290             this.lblPolicyNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00291             //
00292             // lblInsuredName
00293             //
00294             this.lblInsuredName.AutoSize = true;
00295             this.lblInsuredName.BackColor = System.Drawing.Color.Gainsboro;
00296             this.lblInsuredName.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00297             this.lblInsuredName.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
00298             this.lblInsuredName.Location = new System.Drawing.Point(32, 176);
00299             this.lblInsuredName.Name = "lblInsuredName";
00300             this.lblInsuredName.Size = new System.Drawing.Size(154, 23);
00301             this.lblInsuredName.TabIndex = 46;
00302             this.lblInsuredName.Text = "Insured Name:";
00303             this.lblInsuredName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
00304             //
00305             // chHideLayer
00306             //
00307             this.chHideLayer.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00308             this.chHideLayer.Location = new System.Drawing.Point(416, 576);
00309             this.chHideLayer.Name = "chHideLayer";
00310             this.chHideLayer.Size = new System.Drawing.Size(144, 24);
00311             this.chHideLayer.TabIndex = 61;
00312             this.chHideLayer.Text = "Hide Layer";
00313             this.chHideLayer.CheckedChanged += new System.EventHandler(this.chHideLayer_CheckedChanged);
00314             //
00315             // pictHorzontalBar2
00316             //
00317             this.pictHorzontalBar2.BackColor = System.Drawing.SystemColors.AppWorkspace;
00318             this.pictHorzontalBar2.Location = new System.Drawing.Point(8, 224);
00319             this.pictHorzontalBar2.Name = "pictHorzontalBar2";
00320             this.pictHorzontalBar2.Size = new System.Drawing.Size(536, 2);
00321             this.pictHorzontalBar2.TabIndex = 57;
00322             this.pictHorzontalBar2.TabStop = false;
00323             //
00324             // pictVehicleBox
00325             //
00326             this.pictVehicleBox.BackColor = System.Drawing.Color.Gainsboro;
00327             this.pictVehicleBox.Location = new System.Drawing.Point(8, 272);
00328             this.pictVehicleBox.Name = "pictVehicleBox";
00329             this.pictVehicleBox.Size = new System.Drawing.Size(184, 120);
00330             this.pictVehicleBox.TabIndex = 49;
00331             this.pictVehicleBox.TabStop = false;
00332             //
00333             // pictHorzontalBar3
00334             //
00335             this.pictHorzontalBar3.BackColor = System.Drawing.SystemColors.AppWorkspace;
00336             this.pictHorzontalBar3.Location = new System.Drawing.Point(8, 400);
00337             this.pictHorzontalBar3.Name = "pictHorzontalBar3";
00338             this.pictHorzontalBar3.Size = new System.Drawing.Size(536, 2);
00339             this.pictHorzontalBar3.TabIndex = 48;
00340             this.pictHorzontalBar3.TabStop = false;
00341             //
00342             // pictPolicyBox
00343             //
00344             this.pictPolicyBox.BackColor = System.Drawing.Color.Gainsboro;
00345             this.pictPolicyBox.Location = new System.Drawing.Point(8, 128);
00346             this.pictPolicyBox.Name = "pictPolicyBox";
00347             this.pictPolicyBox.Size = new System.Drawing.Size(184, 80);
00348             this.pictPolicyBox.TabIndex = 44;
00349             this.pictPolicyBox.TabStop = false;
00350             //
00351             // pictHorzontalBar1
00352             //
00353             this.pictHorzontalBar1.BackColor = System.Drawing.SystemColors.AppWorkspace;
00354             this.pictHorzontalBar1.Location = new System.Drawing.Point(8, 112);
00355             this.pictHorzontalBar1.Name = "pictHorzontalBar1";
00356             this.pictHorzontalBar1.Size = new System.Drawing.Size(536, 2);
00357             this.pictHorzontalBar1.TabIndex = 43;
00358             this.pictHorzontalBar1.TabStop = false;
00359             //
00360             // lblInstructions
00361             //
00362             this.lblInstructions.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00363             this.lblInstructions.Location = new System.Drawing.Point(96, 48);
00364             this.lblInstructions.Name = "lblInstructions";
00365             this.lblInstructions.Size = new System.Drawing.Size(456, 56);
00366             this.lblInstructions.TabIndex = 42;
00367             this.lblInstructions.Text = "Enter the required information for the policy applicable to the auto claim you ar" +
00368                 "e submitting. Enter the vehicle exactly as it appears on the policy or insurance" +
00369                 " card.";
00370             //
00371             // lblTitle
00372             //
00373             this.lblTitle.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00374             this.lblTitle.Location = new System.Drawing.Point(8, 8);
00375             this.lblTitle.Name = "lblTitle";
00376             this.lblTitle.Size = new System.Drawing.Size(288, 32);
00377             this.lblTitle.TabIndex = 41;
00378             this.lblTitle.Text = "Auto Claim";
00379             //
00380             // pictCheckmarks
00381             //
00382             this.pictCheckmarks.BackColor = System.Drawing.Color.White;
00383             this.pictCheckmarks.BackgroundImage = ((System.Drawing.Bitmap)(resources.GetObject("pictCheckmarks.BackgroundImage")));
00384             this.pictCheckmarks.Location = new System.Drawing.Point(32, 40);
00385             this.pictCheckmarks.Name = "pictCheckmarks";
00386             this.pictCheckmarks.Size = new System.Drawing.Size(40, 72);
00387             this.pictCheckmarks.TabIndex = 66;
00388             this.pictCheckmarks.TabStop = false;
00389             //
00390             // inkPictVehicle
00391             //
00392             this.inkPictVehicle.AutoRedraw = false;
00393             this.inkPictVehicle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
00394             this.inkPictVehicle.Image = ((System.Drawing.Bitmap)(resources.GetObject("inkPictVehicle.Image")));
00395             this.inkPictVehicle.Location = new System.Drawing.Point(32, 440);
00396             this.inkPictVehicle.MarginX = -1;
00397             this.inkPictVehicle.MarginY = -1;
00398             this.inkPictVehicle.Name = "inkPictVehicle";
00399             this.inkPictVehicle.Size = new System.Drawing.Size(352, 232);
00400             this.inkPictVehicle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
00401             this.inkPictVehicle.TabIndex = 67;
00402             this.inkPictVehicle.Paint += new System.Windows.Forms.PaintEventHandler(this.inkPictVehicle_Paint);
00403             //
00404             // lstAnnotationLayer
00405             //
00406             this.lstAnnotationLayer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
00407             this.lstAnnotationLayer.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00408             this.lstAnnotationLayer.ItemHeight = 19;
00409             this.lstAnnotationLayer.Items.AddRange(new object[] {
00410                                                                     "Body",
00411                                                                     "Windows",
00412                                                                     "Tires",
00413                                                                     "Headlights"});
00414             this.lstAnnotationLayer.Location = new System.Drawing.Point(416, 432);
00415             this.lstAnnotationLayer.Name = "lstAnnotationLayer";
00416             this.lstAnnotationLayer.Size = new System.Drawing.Size(104, 135);
00417             this.lstAnnotationLayer.TabIndex = 68;
00418             this.lstAnnotationLayer.SelectedIndexChanged += new System.EventHandler(this.lstAnnotationLayer_SelectedIndexChanged);
00419             //
00420             // inkEdPolicyNumber
00421             //
00422             this.inkEdPolicyNumber.Cursor = System.Windows.Forms.Cursors.Default;
00423             this.inkEdPolicyNumber.Location = new System.Drawing.Point(208, 136);
00424             this.inkEdPolicyNumber.Name = "inkEdPolicyNumber";
00425             this.inkEdPolicyNumber.Size = new System.Drawing.Size(312, 32);
00426             this.inkEdPolicyNumber.TabIndex = 69;
00427             this.inkEdPolicyNumber.Text = "";
00428             this.inkEdPolicyNumber.UseMouseForInput = true;
00429             //
00430             // inkEdName
00431             //
00432             this.inkEdName.Cursor = System.Windows.Forms.Cursors.Default;
00433             this.inkEdName.Location = new System.Drawing.Point(208, 176);
00434             this.inkEdName.Name = "inkEdName";
00435             this.inkEdName.Size = new System.Drawing.Size(312, 32);
00436             this.inkEdName.TabIndex = 70;
00437             this.inkEdName.Text = "";
00438             this.inkEdName.UseMouseForInput = true;
00439             //
00440             // inkEdYear
00441             //
00442             this.inkEdYear.Cursor = System.Windows.Forms.Cursors.Default;
00443             this.inkEdYear.Location = new System.Drawing.Point(208, 280);
00444             this.inkEdYear.Name = "inkEdYear";
00445             this.inkEdYear.Size = new System.Drawing.Size(312, 32);
00446             this.inkEdYear.TabIndex = 71;
00447             this.inkEdYear.Text = "";
00448             this.inkEdYear.UseMouseForInput = true;
00449             //
00450             // inkEdMake
00451             //
00452             this.inkEdMake.Cursor = System.Windows.Forms.Cursors.Default;
00453             this.inkEdMake.Location = new System.Drawing.Point(208, 320);
00454             this.inkEdMake.Name = "inkEdMake";
00455             this.inkEdMake.Size = new System.Drawing.Size(312, 32);
00456             this.inkEdMake.TabIndex = 72;
00457             this.inkEdMake.Text = "";
00458             this.inkEdMake.UseMouseForInput = true;
00459             //
00460             // inkEdModel
00461             //
00462             this.inkEdModel.Cursor = System.Windows.Forms.Cursors.Default;
00463             this.inkEdModel.Location = new System.Drawing.Point(208, 360);
00464             this.inkEdModel.Name = "inkEdModel";
00465             this.inkEdModel.Size = new System.Drawing.Size(312, 32);
00466             this.inkEdModel.TabIndex = 73;
00467             this.inkEdModel.Text = "";
00468             this.inkEdModel.UseMouseForInput = true;
00469             //
00470             // AutoClaims
00471             //
00472             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00473             this.AutoScroll = true;
00474             this.BackColor = System.Drawing.Color.White;
00475             this.ClientSize = new System.Drawing.Size(560, 694);
00476             this.Controls.AddRange(new System.Windows.Forms.Control[] {
00477                                                                           this.inkEdModel,
00478                                                                           this.inkEdMake,
00479                                                                           this.inkEdYear,
00480                                                                           this.inkEdName,
00481                                                                           this.inkEdPolicyNumber,
00482                                                                           this.lstAnnotationLayer,
00483                                                                           this.inkPictVehicle,
00484                                                                           this.lblVehicleDamage,
00485                                                                           this.lblVehicleDescription,
00486                                                                           this.lblModel,
00487                                                                           this.lblYear,
00488                                                                           this.lblMake,
00489                                                                           this.lblPolicyNumber,
00490                                                                           this.lblInsuredName,
00491                                                                           this.chHideLayer,
00492                                                                           this.pictHorzontalBar2,
00493                                                                           this.pictVehicleBox,
00494                                                                           this.pictHorzontalBar3,
00495                                                                           this.pictPolicyBox,
00496                                                                           this.pictHorzontalBar1,
00497                                                                           this.lblInstructions,
00498                                                                           this.lblTitle,
00499                                                                           this.pictCheckmarks});
00500             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
00501             this.MaximizeBox = false;
00502             this.Name = "AutoClaims";
00503             this.Text = "AutoClaims";
00504             this.Load += new System.EventHandler(this.AutoClaims_Load);
00505             this.ResumeLayout(false);
00506
00507         }
00508         #endregion
00509
00510         #region Standard Template Code
00511         /// <summary>
00512         /// The main entry point for the application.
00513         /// </summary>
00514         static void Main()
00515         {
00516             // Set the current thread to single-threaded aparment.
00517             Thread.CurrentThread.ApartmentState = ApartmentState.STA;
00518
00519             Application.Run(new AutoClaims());
00520         }
00521         #endregion
00522
00523         /// <summary>
00524         /// This method occurs when the form is loaded.  It
00525         /// configures the insertion mode and the ink used by
00526         /// this application.
00527         /// </summary>
00528         /// <param name="sender">The control that raised the event.</param>
00529         /// <param name="e">The event arguments.</param>
00530         private void AutoClaims_Load(object sender, System.EventArgs e)
00531         {
00532             // Initialize the empty ink
00533             emptyInk = new Ink();
00534
00535             // Initialize the four different layers of ink on the vehicle diagram:
00536             // vehicle body, windows, tires, and headlights.
00537             inkLayers = new InkLayer[4];
00538             inkLayers[0] = new InkLayer(new Ink(), Color.Red, false);
00539             inkLayers[1] = new InkLayer(new Ink(), Color.Violet, false);
00540             inkLayers[2] = new InkLayer(new Ink(), Color.LightGreen, false);
00541             inkLayers[3] = new InkLayer(new Ink(), Color.Aqua, false);
00542
00543             // By default, select the first ink layer
00544             lstAnnotationLayer.SelectedIndex = 0;
00545             inkPictVehicle.DefaultDrawingAttributes.Color = inkLayers[lstAnnotationLayer.SelectedIndex].ActiveColor;
00546
00547             // Currently there are recognizers that do not support regular expression
00548             // input scopes, thus raising exceptions.  This try catch handler copes
00549             // with these differences in the recognizer. For policy numbers, nothing
00550             // is being done in reaction to this exception though since there is no
00551             // factoid that serves the same purpose.
00552             try
00553             {
00554                 inkEdPolicyNumber.Factoid = "(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)-(0|1|2|3|4|5|6|7|" +
00555                     "8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)";
00556             }
00557             catch
00558             {
00559                 // Do nothing
00560             }
00561
00562             // There are also recognizers that do not support common input scopes as
00563             // well.  This try catch handler copes with these differences in the
00564             // recognizer. For year, the NUMBER factoid is being set in reaction to
00565             // this exception.
00566             try
00567             {
00568                 inkEdYear.Factoid = "(!IS_DATE_YEAR)";
00569             }
00570             catch
00571             {
00572                 inkEdYear.Factoid = Factoid.Number;
00573             }
00574         }
00575
00576         /// <summary>
00577         ///  Event Handler from lstAnnotationLayer->SelectedIndexChanged Event
00578         /// </summary>
00579         /// <param name="sender">The control that raised the event.</param>
00580         /// <param name="e">The event arguments.</param>
00581         private void lstAnnotationLayer_SelectedIndexChanged(object sender, System.EventArgs e)
00582         {
00583             // Provided that the new selected index value is different than
00584             // the previous value...
00585             if (lstAnnotationLayer.SelectedIndex != selectedIndex)
00586             {
00587                 if (!inkPictVehicle.CollectingInk)
00588                 {
00589                     // Set the ink and visiblity of the current ink layer
00590                     inkPictVehicle.DefaultDrawingAttributes.Color = inkLayers[lstAnnotationLayer.SelectedIndex].ActiveColor;
00591                     chHideLayer.Checked = inkLayers[lstAnnotationLayer.SelectedIndex].Hidden;
00592
00593                     // Set the active ink object to the selected ink
00594                     // Note that if the current layer is not visible, empty
00595                     // ink is used to prevent flicker.
00596                     inkPictVehicle.InkEnabled = false;
00597                     inkPictVehicle.Ink = chHideLayer.Checked?emptyInk:inkLayers[lstAnnotationLayer.SelectedIndex].ActiveInk;
00598                     inkPictVehicle.InkEnabled = !chHideLayer.Checked;
00599
00600                     selectedIndex = lstAnnotationLayer.SelectedIndex;
00601
00602                     this.Refresh();
00603                 }
00604                 else
00605                 {
00606                     // If ink collection is enabled, the active ink cannot be changed
00607                     // and it is necessary to restore the selection to its previous value.
00608                     lstAnnotationLayer.SelectedIndex = selectedIndex;
00609                     MessageBox.Show("Cannot change active ink while collecting ink.");
00610                 }
00611             }
00612         }
00613
00614         /// <summary>
00615         /// Event Handler from chHideLayer->CheckChanged Event
00616         /// </summary>
00617         /// <param name="sender">The control that raised the event.</param>
00618         /// <param name="e">The event arguments.</param>
00619         private void chHideLayer_CheckedChanged(object sender, System.EventArgs e)
00620         {
00621             // Provided that the new checked hidden value is different than
00622             // the previous value...
00623             if (chHideLayer.Checked != selectedHidden)
00624             {
00625                 if (!inkPictVehicle.CollectingInk)
00626                 {
00627                     // Update the array indicating the visibility of each ink layer
00628                     inkLayers[lstAnnotationLayer.SelectedIndex].Hidden = chHideLayer.Checked;
00629
00630                     // Set the active ink object to the selected ink
00631                     // Note that if the current layer is not visible, empty
00632                     // ink is used to prevent flicker.
00633                     inkPictVehicle.InkEnabled = false;
00634                     inkPictVehicle.Ink = chHideLayer.Checked?emptyInk:inkLayers[lstAnnotationLayer.SelectedIndex].ActiveInk;
00635
00636                     // If the layer is marked hidden, disable ink collections
00637                     inkPictVehicle.InkEnabled = !chHideLayer.Checked;
00638
00639                     // Update the previous checkbox value to reflect the current
00640                     selectedHidden = chHideLayer.Checked;
00641
00642                     this.Refresh();
00643                 }
00644                 else
00645                 {
00646                     // If ink collection is enabled, the active ink cannot be changed
00647                     // and it is necessary to restore the checkbox to its previous value.
00648                     chHideLayer.Checked = selectedHidden;
00649                     MessageBox.Show("Cannot change visiblity while collecting ink.");
00650                 }
00651             }
00652         }
00653
00654         /// <summary>
00655         /// Event Handler from inkPictVehicle->Paint Event
00656         ///
00657         /// It is necessary to draw four different types of ink
00658         /// and the ink picture only has one ink associated with it.
00659         /// As a result, the autoredraw feature is turned off
00660         /// and the paint event is handled.
00661         /// </summary>
00662         /// <param name="sender">The control that raised the event.</param>
00663         /// <param name="e">The event arguments.</param>
00664         private void inkPictVehicle_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
00665         {
00666             // Cycle through each ink layer.  If it is visible, paint it.
00667             // Note that it is necessary to customize the paint
00668             // behavior, since we want to hide/show different ink layers.
00669             foreach (InkLayer layer in inkLayers)
00670             {
00671                 if (!layer.Hidden)
00672                 {
00673                     inkPictVehicle.Renderer.Draw(e.Graphics,layer.ActiveInk.Strokes);
00674                 }
00675             }
00676         }
00677
00678     }
00679 }
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/RegExt.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

RegExt.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      RegExt.cpp
00007 //
00008 //  Description:
00009 //      Implementation of routines for extension registration.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020 #include "stdafx.h"
00021 #include <ole2.h>
00022 #include <StrSafe.h>
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00030 const LPCWSTR REG_VALUE_ADMIN_EXTENSIONS = L"AdminExtensions";
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // Static Function Prototypes
00034 /////////////////////////////////////////////////////////////////////////////
00035
00036 static DWORD
00037 RegisterAnyCluAdminExtension(
00038       HCLUSTER      hClusterIn
00039     , LPCWSTR       pwszKeyNameIn
00040     , const CLSID * pClsidIn
00041     );
00042
00043 static DWORD
00044 RegisterAnyCluAdminExtension(
00045       HKEY          hKeyIn
00046     , const CLSID * pClsidIn
00047     );
00048
00049 static DWORD
00050 UnregisterAnyCluAdminExtension(
00051       HCLUSTER      hClusterIn
00052     , LPCWSTR       pwszKeyNameIn
00053     , const CLSID * pClsidIn
00054     );
00055
00056 static DWORD
00057 UnregisterAnyCluAdminExtension(
00058       HKEY          hKeyIn
00059     , const CLSID * pClsidIn
00060     );
00061
00062 static DWORD
00063 ReadValue(
00064       HKEY      hKeyIn
00065     , LPCWSTR   pwszValueNameIn
00066     , LPWSTR *  ppwszValueOut
00067     , size_t *  pcchValueOut
00068     );
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 //++
00072 //
00073 //  RegisterCluAdminClusterExtension
00074 //
00075 //  Routine Description:
00076 //      Register with the cluster database a Cluster Administrator Extension
00077 //      DLL that extends the cluster object.
00078 //
00079 //  Arguments:
00080 //      hClusterIn      Handle to the cluster to modify.
00081 //      pClsidIn        Extension's CLSID.
00082 //
00083 //  Return Value:
00084 //      ERROR_SUCCESS   Extension registered successfully.
00085 //      Win32 error code if another failure occurred.
00086 //
00087 //--
00088 /////////////////////////////////////////////////////////////////////////////
00089 DWORD
00090 RegisterCluAdminClusterExtension(
00091       HCLUSTER      hClusterIn
00092     , const CLSID * pClsidIn
00093     )
00094 {
00095     DWORD   sc = ERROR_SUCCESS;
00096     HKEY    hKey = NULL;
00097
00098     //
00099     //  Get the cluster registry key.
00100     //
00101
00102     hKey = GetClusterKey( hClusterIn, KEY_ALL_ACCESS );
00103     if ( hKey == NULL )
00104     {
00105         sc = GetLastError();
00106     } // if: error getting cluster key
00107     else
00108     {
00109         //
00110         //  Register the extension.
00111         //
00112
00113         sc = RegisterAnyCluAdminExtension( hKey, pClsidIn );
00114
00115         ClusterRegCloseKey( hKey );
00116     }  // else:  GetClusterKey succeeded
00117
00118     return sc;
00119
00120 }  //*** RegisterCluAdminClusterExtension
00121
00122 /////////////////////////////////////////////////////////////////////////////
00123 //++
00124 //
00125 //  RegisterCluAdminAllNodesExtension
00126 //
00127 //  Routine Description:
00128 //      Register with the cluster database a Cluster Administrator Extension
00129 //      DLL that extends all nodes.
00130 //
00131 //  Arguments:
00132 //      hClusterIn      Handle to the cluster to modify.
00133 //      pClsidIn        Extension's CLSID.
00134 //
00135 //  Return Value:
00136 //      ERROR_SUCCESS   Extension registered successfully.
00137 //      Win32 error code if another failure occurred.
00138 //
00139 //--
00140 /////////////////////////////////////////////////////////////////////////////
00141 DWORD
00142 RegisterCluAdminAllNodesExtension(
00143       HCLUSTER      hClusterIn
00144     , const CLSID * pClsidIn
00145     )
00146 {
00147     DWORD sc = ERROR_SUCCESS;
00148
00149     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Nodes", pClsidIn );
00150
00151     return sc;
00152
00153 }  //*** RegisterCluAdminAllNodesExtension
00154
00155 /////////////////////////////////////////////////////////////////////////////
00156 //++
00157 //
00158 //  RegisterCluAdminAllGroupsExtension
00159 //
00160 //  Routine Description:
00161 //      Register with the cluster database a Cluster Administrator Extension
00162 //      DLL that extends all groups.
00163 //
00164 //  Arguments:
00165 //      hClusterIn      Handle to the cluster to modify.
00166 //      pClsidIn        Extension's CLSID.
00167 //
00168 //  Return Value:
00169 //      ERROR_SUCCESS   Extension registered successfully.
00170 //      Win32 error code if another failure occurred.
00171 //
00172 //--
00173 /////////////////////////////////////////////////////////////////////////////
00174 DWORD
00175 RegisterCluAdminAllGroupsExtension(
00176       HCLUSTER      hClusterIn
00177     , const CLSID * pClsidIn
00178     )
00179 {
00180     DWORD sc = ERROR_SUCCESS;
00181
00182     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Groups", pClsidIn );
00183
00184     return sc;
00185
00186 }  //*** RegisterCluAdminAllGroupsExtension
00187
00188 /////////////////////////////////////////////////////////////////////////////
00189 //++
00190 //
00191 //  RegisterCluAdminAllResourcesExtension
00192 //
00193 //  Routine Description:
00194 //      Register with the cluster database a Cluster Administrator Extension
00195 //      DLL that extends all resources.
00196 //
00197 //  Arguments:
00198 //      hClusterIn      Handle to the cluster to modify.
00199 //      pClsidIn        Extension's CLSID.
00200 //
00201 //  Return Value:
00202 //      ERROR_SUCCESS   Extension registered successfully.
00203 //      Win32 error code if another failure occurred.
00204 //
00205 //--
00206 /////////////////////////////////////////////////////////////////////////////
00207 DWORD
00208 RegisterCluAdminAllResourcesExtension(
00209       HCLUSTER       hClusterIn
00210     , const CLSID * pClsidIn
00211     )
00212 {
00213     DWORD   sc = ERROR_SUCCESS;
00214
00215     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Resources", pClsidIn );
00216
00217     return sc;
00218
00219 }  //*** RegisterCluAdminAllResourcesExtension
00220
00221 /////////////////////////////////////////////////////////////////////////////
00222 //++
00223 //
00224 //  RegisterCluAdminAllResourceTypesExtension
00225 //
00226 //  Routine Description:
00227 //      Register with the cluster database a Cluster Administrator Extension
00228 //      DLL that extends all resource types.
00229 //
00230 //  Arguments:
00231 //      hClusterIn      Handle to the cluster to modify.
00232 //      pClsidIn        Extension's CLSID.
00233 //
00234 //  Return Value:
00235 //      ERROR_SUCCESS   Extension registered successfully.
00236 //      Win32 error code if another failure occurred.
00237 //
00238 //--
00239 /////////////////////////////////////////////////////////////////////////////
00240 DWORD
00241 RegisterCluAdminAllResourceTypesExtension(
00242       HCLUSTER      hClusterIn
00243     , const CLSID * pClsidIn
00244     )
00245 {
00246     DWORD   sc = ERROR_SUCCESS;
00247
00248     sc = RegisterAnyCluAdminExtension( hClusterIn, L"ResourceTypes", pClsidIn );
00249
00250     return sc;
00251
00252 }  //*** RegisterCluAdminAllResourceTypesExtension
00253
00254 /////////////////////////////////////////////////////////////////////////////
00255 //++
00256 //
00257 //  RegisterCluAdminAllNetworksExtension
00258 //
00259 //  Routine Description:
00260 //      Register with the cluster database a Cluster Administrator Extension
00261 //      DLL that extends all networks.
00262 //
00263 //  Arguments:
00264 //      hClusterIn      Handle to the cluster to modify.
00265 //      pClsidIn        Extension's CLSID.
00266 //
00267 //  Return Value:
00268 //      ERROR_SUCCESS   Extension registered successfully.
00269 //      Win32 error code if another failure occurred.
00270 //
00271 //--
00272 /////////////////////////////////////////////////////////////////////////////
00273 DWORD
00274 RegisterCluAdminAllNetworksExtension(
00275       HCLUSTER      hClusterIn
00276     , const CLSID * pClsidIn
00277     )
00278 {
00279     DWORD   sc = ERROR_SUCCESS;
00280
00281     sc = RegisterAnyCluAdminExtension( hClusterIn, L"Networks", pClsidIn );
00282
00283     return sc;
00284
00285 }  //*** RegisterCluAdminAllNetworksExtension
00286
00287 /////////////////////////////////////////////////////////////////////////////
00288 //++
00289 //
00290 //  RegisterCluAdminAllNetInterfacesExtension
00291 //
00292 //  Routine Description:
00293 //      Register with the cluster database a Cluster Administrator Extension
00294 //      DLL that extends all network interfaces.
00295 //
00296 //  Arguments:
00297 //      hClusterIn      Handle to the cluster to modify.
00298 //      pClsidIn        Extension's CLSID.
00299 //
00300 //  Return Value:
00301 //      ERROR_SUCCESS   Extension registered successfully.
00302 //      Win32 error code if another failure occurred.
00303 //
00304 //--
00305 /////////////////////////////////////////////////////////////////////////////
00306 DWORD
00307 RegisterCluAdminAllNetInterfacesExtension(
00308       HCLUSTER      hClusterIn
00309     , const CLSID * pClsidIn
00310     )
00311 {
00312     DWORD   sc = ERROR_SUCCESS;
00313
00314     sc = RegisterAnyCluAdminExtension( hClusterIn, L"NetworkInterfaces", pClsidIn );
00315
00316     return sc;
00317
00318 }  //*** RegisterCluAdminAllNetInterfacesExtension
00319
00320 /////////////////////////////////////////////////////////////////////////////
00321 //++
00322 //
00323 //  RegisterCluAdminResourceTypeExtension
00324 //
00325 //  Routine Description:
00326 //      Register with the cluster database a Cluster Administrator Extension
00327 //      DLL that extends resources of a specific type, or the resource type
00328 //      itself.
00329 //
00330 //  Arguments:
00331 //      hClusterIn        Handle to the cluster to modify.
00332 //      pwszResourceType  Resource type name.
00333 //      pClsidIn          Extension's CLSID.
00334 //
00335 //  Return Value:
00336 //      ERROR_SUCCESS
00337 //                          Extension registered successfully.
00338 //
00339 //      ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND
00340 //                          The resource type has not been registered with
00341 //                          the cluster.
00342 //
00343 //      Other Win32 error code if a failure occurred.
00344 //
00345 //--
00346 /////////////////////////////////////////////////////////////////////////////
00347 DWORD
00348 RegisterCluAdminResourceTypeExtension(
00349       HCLUSTER      hClusterIn
00350     , LPCWSTR       pwszResourceTypeIn
00351     , const CLSID * pClsidIn
00352     )
00353 {
00354     DWORD   sc = ERROR_SUCCESS;
00355     HKEY    hKey = NULL;
00356
00357     //
00358     // Get the resource type registry key.
00359     //
00360
00361     hKey = GetClusterResourceTypeKey( hClusterIn, pwszResourceTypeIn, KEY_ALL_ACCESS );
00362     if ( hKey == NULL )
00363     {
00364         sc = GetLastError();
00365         if ( sc == ERROR_FILE_NOT_FOUND )
00366         {
00367             //
00368             //  If we failed to open the key with 'file not found' that means that
00369             //  the key doesn't exist.  We'll return a 'res type not found' error,
00370             //  which is more accurate.
00371             //
00372
00373             sc = ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND;
00374         } // if:
00375     } // if: error getting resource type key
00376     else
00377     {
00378         //
00379         //  Register the extension.
00380         //
00381
00382         sc = RegisterAnyCluAdminExtension( hKey, pClsidIn );
00383
00384         ClusterRegCloseKey( hKey );
00385     }  // else:  GetClusterResourceTypeKey succeeded
00386
00387     return sc;
00388
00389 }  //*** RegisterCluAdminResourceTypeExtension
00390
00391 /////////////////////////////////////////////////////////////////////////////
00392 //++
00393 //
00394 //  UnregisterCluAdminClusterExtension
00395 //
00396 //  Routine Description:
00397 //      Unregister with the cluster database a Cluster Administrator Extension
00398 //      DLL that extends the cluster object.
00399 //
00400 //  Arguments:
00401 //      hClusterIn      Handle to the cluster to modify.
00402 //      pClsidIn        Extension's CLSID.
00403 //
00404 //  Return Value:
00405 //      ERROR_SUCCESS   Extension registered successfully.
00406 //      Win32 error code if another failure occurred.
00407 //
00408 //--
00409 /////////////////////////////////////////////////////////////////////////////
00410 DWORD
00411 UnregisterCluAdminClusterExtension(
00412       HCLUSTER      hClusterIn
00413     , const CLSID * pClsidIn
00414     )
00415 {
00416     DWORD   sc = ERROR_SUCCESS;
00417     HKEY    hKey = NULL;
00418
00419     //
00420     //  Get the cluster registry key.
00421     //
00422
00423     hKey = GetClusterKey(hClusterIn, KEY_ALL_ACCESS);
00424     if ( hKey == NULL )
00425     {
00426         sc = GetLastError();
00427     } // if: error getting cluster key
00428     else
00429     {
00430         //
00431         //  Unregister the extension.
00432         //
00433
00434         sc = UnregisterAnyCluAdminExtension( hKey, pClsidIn );
00435
00436         ClusterRegCloseKey( hKey );
00437     }  // else:  GetClusterKey succeeded
00438
00439     return sc;
00440
00441 }  //*** UnregisterCluAdminClusterExtension
00442
00443 /////////////////////////////////////////////////////////////////////////////
00444 //++
00445 //
00446 //  UnregisterCluAdminAllNodesExtension
00447 //
00448 //  Routine Description:
00449 //      Unregister with the cluster database a Cluster Administrator Extension
00450 //      DLL that extends all nodes.
00451 //
00452 //  Arguments:
00453 //      hClusterIn      Handle to the cluster to modify.
00454 //      pClsidIn        Extension's CLSID.
00455 //
00456 //  Return Value:
00457 //      ERROR_SUCCESS   Extension registered successfully.
00458 //      Win32 error code if another failure occurred.
00459 //
00460 //--
00461 /////////////////////////////////////////////////////////////////////////////
00462 DWORD
00463 UnregisterCluAdminAllNodesExtension(
00464       HCLUSTER      hClusterIn
00465     , const CLSID * pClsidIn
00466     )
00467 {
00468     DWORD   sc = ERROR_SUCCESS;
00469
00470     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Nodes", pClsidIn );
00471
00472     return sc;
00473
00474 }  //*** UnregisterCluAdminAllNodesExtension
00475
00476 /////////////////////////////////////////////////////////////////////////////
00477 //++
00478 //
00479 //  UnregisterCluAdminAllGroupsExtension
00480 //
00481 //  Routine Description:
00482 //      Unregister with the cluster database a Cluster Administrator Extension
00483 //      DLL that extends all groups.
00484 //
00485 //  Arguments:
00486 //      hClusterIn      Handle to the cluster to modify.
00487 //      pClsidIn        Extension's CLSID.
00488 //
00489 //  Return Value:
00490 //      ERROR_SUCCESS   Extension registered successfully.
00491 //      Win32 error code if another failure occurred.
00492 //
00493 //--
00494 /////////////////////////////////////////////////////////////////////////////
00495 DWORD
00496 UnregisterCluAdminAllGroupsExtension(
00497       HCLUSTER      hClusterIn
00498     , const CLSID * pClsidIn
00499     )
00500 {
00501     DWORD   sc = ERROR_SUCCESS;
00502
00503     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Groups", pClsidIn );
00504
00505     return sc;
00506
00507 }  //*** UnregisterCluAdminAllGroupsExtension
00508
00509 /////////////////////////////////////////////////////////////////////////////
00510 //++
00511 //
00512 //  UnregisterCluAdminAllResourcesExtension
00513 //
00514 //  Routine Description:
00515 //      Unregister with the cluster database a Cluster Administrator Extension
00516 //      DLL that extends all resources.
00517 //
00518 //  Arguments:
00519 //      hClusterIn      Handle to the cluster to modify.
00520 //      pClsidIn        Extension's CLSID.
00521 //
00522 //  Return Value:
00523 //      ERROR_SUCCESS   Extension registered successfully.
00524 //      Win32 error code if another failure occurred.
00525 //
00526 //--
00527 /////////////////////////////////////////////////////////////////////////////
00528 DWORD
00529 UnregisterCluAdminAllResourcesExtension(
00530       HCLUSTER      hClusterIn
00531     , const CLSID * pClsidIn
00532     )
00533 {
00534     DWORD   sc = ERROR_SUCCESS;
00535
00536     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Resources", pClsidIn );
00537
00538     return sc;
00539
00540 }  //*** UnregisterCluAdminAllResourcesExtension
00541
00542 /////////////////////////////////////////////////////////////////////////////
00543 //++
00544 //
00545 //  UnregisterCluAdminAllResourceTypesExtension
00546 //
00547 //  Routine Description:
00548 //      Unregister with the cluster database a Cluster Administrator Extension
00549 //      DLL that extends all resource types.
00550 //
00551 //  Arguments:
00552 //      hClusterIn      Handle to the cluster to modify.
00553 //      pClsidIn        Extension's CLSID.
00554 //
00555 //  Return Value:
00556 //      ERROR_SUCCESS   Extension registered successfully.
00557 //      Win32 error code if another failure occurred.
00558 //
00559 //--
00560 /////////////////////////////////////////////////////////////////////////////
00561 DWORD
00562 UnregisterCluAdminAllResourceTypesExtension(
00563       HCLUSTER      hClusterIn
00564     , const CLSID * pClsidIn
00565     )
00566 {
00567     DWORD   sc = ERROR_SUCCESS;
00568
00569     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"ResourceTypes", pClsidIn );
00570
00571     return sc;
00572
00573 }  //*** UnregisterCluAdminAllResourceTypesExtension
00574
00575 /////////////////////////////////////////////////////////////////////////////
00576 //++
00577 //
00578 //  UnregisterCluAdminAllNetworksExtension
00579 //
00580 //  Routine Description:
00581 //      Unregister with the cluster database a Cluster Administrator Extension
00582 //      DLL that extends all networks.
00583 //
00584 //  Arguments:
00585 //      hClusterIn      Handle to the cluster to modify.
00586 //      pClsidIn        Extension's CLSID.
00587 //
00588 //  Return Value:
00589 //      ERROR_SUCCESS   Extension registered successfully.
00590 //      Win32 error code if another failure occurred.
00591 //
00592 //--
00593 /////////////////////////////////////////////////////////////////////////////
00594 DWORD
00595 UnregisterCluAdminAllNetworksExtension(
00596       HCLUSTER      hClusterIn
00597     , const CLSID * pClsidIn
00598     )
00599 {
00600     DWORD   sc = ERROR_SUCCESS;
00601
00602     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"Networks", pClsidIn );
00603
00604     return sc;
00605
00606 }  //*** UnregisterCluAdminAllNetworksExtension
00607
00608 /////////////////////////////////////////////////////////////////////////////
00609 //++
00610 //
00611 //  UnregisterCluAdminAllNetInterfacesExtension
00612 //
00613 //  Routine Description:
00614 //      Unregister with the cluster database a Cluster Administrator Extension
00615 //      DLL that extends all network interfaces.
00616 //
00617 //  Arguments:
00618 //      hClusterIn      Handle to the cluster to modify.
00619 //      pClsidIn        Extension's CLSID.
00620 //
00621 //  Return Value:
00622 //      ERROR_SUCCESS   Extension registered successfully.
00623 //      Win32 error code if another failure occurred.
00624 //
00625 //--
00626 /////////////////////////////////////////////////////////////////////////////
00627 DWORD
00628 UnregisterCluAdminAllNetInterfacesExtension(
00629       HCLUSTER      hClusterIn
00630     , const CLSID * pClsidIn
00631     )
00632 {
00633     DWORD   sc = ERROR_SUCCESS;
00634
00635     sc = UnregisterAnyCluAdminExtension( hClusterIn, L"NetworkInterfaces", pClsidIn );
00636
00637     return sc;
00638
00639 }  //*** UnregisterCluAdminAllNetInterfacesExtension
00640
00641 /////////////////////////////////////////////////////////////////////////////
00642 //++
00643 //
00644 //  UnregisterCluAdminResourceTypeExtension
00645 //
00646 //  Routine Description:
00647 //      Unregister with the cluster database a Cluster Administrator Extension
00648 //      DLL that extends resources of a specific type, or the resource type
00649 //      itself.
00650 //
00651 //  Arguments:
00652 //      hClusterIn          Handle to the cluster to modify.
00653 //      pwszResourceTypeIn  Resource type name.
00654 //      pClsidIn            Extension's CLSID.
00655 //
00656 //  Return Value:
00657 //      ERROR_SUCCESS   Extension registered successfully.
00658 //      Win32 error code if another failure occurred.
00659 //
00660 //--
00661 /////////////////////////////////////////////////////////////////////////////
00662 DWORD
00663 UnregisterCluAdminResourceTypeExtension(
00664       HCLUSTER      hClusterIn
00665     , LPCWSTR       pwszResourceTypeIn
00666     , const CLSID * pClsidIn
00667     )
00668 {
00669     DWORD   sc = ERROR_SUCCESS;
00670     HKEY    hKey = NULL;
00671
00672     //
00673     //  Get the resource type registry key.
00674     //
00675
00676     hKey = GetClusterResourceTypeKey( hClusterIn, pwszResourceTypeIn, KEY_ALL_ACCESS );
00677     if ( hKey == NULL )
00678     {
00679         sc = GetLastError();
00680         if ( sc == ERROR_FILE_NOT_FOUND )
00681         {
00682             //
00683             //  If we failed to open the key with 'file not found' that means that
00684             //  the key doesn't exist.  We'll return a 'res type not found' error,
00685             //  which is more accurate.
00686             //
00687
00688             sc = ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND;
00689         } // if:
00690     } // if: error getting resource type key
00691     else
00692     {
00693         //
00694         //  Unregister the extension.
00695         //
00696
00697         sc = UnregisterAnyCluAdminExtension( hKey, pClsidIn );
00698
00699         ClusterRegCloseKey( hKey );
00700     }  // else:  GetClusterResourceTypeKey succeeded
00701
00702     return sc;
00703
00704 }  //*** UnregisterCluAdminResourceTypeExtension
00705
00706 /////////////////////////////////////////////////////////////////////////////
00707 //++
00708 //
00709 //  RegisterAnyCluAdminExtension
00710 //
00711 //  Routine Description:
00712 //      Register any Cluster Administrator Extension DLL with the cluster
00713 //      database.
00714 //
00715 //  Arguments:
00716 //      hClusterIn      Handle to the cluster to modify.
00717 //      pwszKeyNameIn   Key name.
00718 //      pClsidIn        Extension's CLSID.
00719 //
00720 //  Return Value:
00721 //      ERROR_SUCCESS   Extension registered successfully.
00722 //      Win32 error code if another failure occurred.
00723 //
00724 //--
00725 /////////////////////////////////////////////////////////////////////////////
00726 static DWORD
00727 RegisterAnyCluAdminExtension(
00728       HCLUSTER      hClusterIn
00729     , LPCWSTR       pwszKeyNameIn
00730     , const CLSID * pClsidIn
00731     )
00732 {
00733     DWORD   sc = ERROR_SUCCESS;
00734     HKEY    hkeyCluster = NULL;
00735     HKEY    hKey = NULL;
00736
00737     //
00738     //  Get the cluster key.
00739     //
00740
00741     hkeyCluster = GetClusterKey( hClusterIn, KEY_ALL_ACCESS );
00742     if ( hkeyCluster == NULL )
00743     {
00744         sc = GetLastError();
00745     } // if: error getting cluster key
00746     else
00747     {
00748         //
00749         //  Get the specified key.
00750         //
00751
00752         sc = ClusterRegOpenKey( hkeyCluster, pwszKeyNameIn, KEY_ALL_ACCESS, &hKey );
00753         if ( sc == ERROR_SUCCESS )
00754         {
00755             //
00756             //  Register the extension.
00757             //
00758
00759             sc = RegisterAnyCluAdminExtension( hKey, pClsidIn );
00760
00761             ClusterRegCloseKey( hKey );
00762         }  // if: ClusterRegOpenKey succeeded
00763
00764         ClusterRegCloseKey( hkeyCluster );
00765     }  // if:  cluster key retrieved successfully
00766
00767     return sc;
00768
00769 }  //*** RegisterAnyCluAdminExtension
00770
00771 /////////////////////////////////////////////////////////////////////////////
00772 //++
00773 //
00774 //  RegisterAnyCluAdminExtension
00775 //
00776 //  Routine Description:
00777 //      Register any Cluster Administrator Extension DLL with the cluster
00778 //      database.
00779 //
00780 //  Arguments:
00781 //      hKeyIn          Cluster database key.
00782 //      pClsidIn        Extension's CLSID.
00783 //
00784 //  Return Value:
00785 //      ERROR_SUCCESS   Extension registered successfully.
00786 //      Win32 error code if another failure occurred.
00787 //
00788 //--
00789 /////////////////////////////////////////////////////////////////////////////
00790 static DWORD
00791 RegisterAnyCluAdminExtension(
00792       HKEY          hKeyIn
00793     , const CLSID * pClsidIn
00794     )
00795 {
00796     HRESULT     hr = S_OK;
00797     LPOLESTR    pwszClsid = NULL;
00798     size_t      cchClsidLen = 0;
00799     size_t      cchSize = 0;
00800     size_t      cchNewSize = 0;
00801     LPWSTR      pwszValue = NULL;
00802     LPWSTR      pwszNewValue = NULL;
00803     BOOL        bAlreadyRegistered = TRUE;
00804     DWORD       sc = ERROR_SUCCESS;
00805
00806     //
00807     //  Convert the CLSID to a string.
00808     //
00809
00810     hr = StringFromCLSID( *pClsidIn, &pwszClsid );
00811     if ( FAILED( hr ) )
00812     {
00813         sc = HRESULT_CODE( hr );
00814         goto Cleanup;
00815     } // if:
00816
00817     //
00818     //  Get the length of the CLSID string.
00819     //
00820
00821     cchClsidLen = lstrlenW( pwszClsid );
00822
00823     //
00824     //  Read the current value.
00825     //
00826
00827     sc = ReadValue( hKeyIn, REG_VALUE_ADMIN_EXTENSIONS, &pwszValue, &cchSize );
00828     if ( (sc == ERROR_FILE_NOT_FOUND) || ( (sc == ERROR_SUCCESS) && (cchSize == 0) ) )
00829     {
00830         //
00831         //  If the value was not found or it was and the length was zero then
00832         //  the extension has not been registered.
00833         //
00834
00835         bAlreadyRegistered = FALSE;
00836     } // if:
00837     else if ( sc == ERROR_SUCCESS )
00838     {
00839         //
00840         //  Check to see if the extension has been registered yet.
00841         //
00842
00843         if ( pwszValue == NULL )
00844         {
00845         } // if: empty value found
00846         else
00847         {
00848             LPCWSTR pwszValueBuf = pwszValue;
00849             size_t  cchValueBuf = cchSize;
00850             size_t  cch = 0;
00851
00852             while ( *pwszValueBuf != L'\0' )
00853             {
00854                 if ( NIStringCompareW( pwszClsid, pwszValueBuf, cchClsidLen ) == 0)
00855                 {
00856                     break;
00857                 } //if: CLSID for this extension already in list
00858
00859                 cch = lstrlenW( pwszValueBuf ) + 1;
00860                 pwszValueBuf += cch;
00861                 cchValueBuf -= cch;
00862             }  // while:  more strings in the extension list
00863
00864             bAlreadyRegistered = ( *pwszValueBuf != L'\0' );
00865         }  // else:  extension value exists
00866     } // else if:
00867     else
00868     {
00869         goto Cleanup;
00870     } // else:
00871
00872     //
00873     //  Register the extension.
00874     //
00875
00876     if ( bAlreadyRegistered == FALSE )
00877     {
00878         //
00879         //  Allocate a new buffer.
00880         //
00881
00882         cchNewSize = cchSize + lstrlenW( pwszClsid ) + 1;
00883         if ( cchSize == 0 ) // Add size of final NULL if first entry.
00884         {
00885             cchNewSize++;
00886         } // if: no previous value
00887
00888         pwszNewValue = new WCHAR[ cchNewSize ];
00889         if ( pwszNewValue == NULL )
00890         {
00891             sc = ERROR_NOT_ENOUGH_MEMORY;
00892             goto Cleanup;
00893         } // if: error allocating memory
00894         else
00895         {
00896             LPCWSTR pwszValueBuf    = pwszValue;
00897             LPWSTR  pwszNewValueBuf = pwszNewValue;
00898             size_t  cchNewValueBuf  = cchNewSize;
00899             size_t  cch = 0;
00900             DWORD   dwType = 0;
00901
00902             //
00903             //  Copy the existing extensions to the new buffer.
00904             //
00905
00906             if ( pwszValue != NULL )
00907             {
00908                 while ( *pwszValueBuf != L'\0' )
00909                 {
00910                     hr = StringCchCopyW( pwszNewValueBuf, cchNewValueBuf, pwszValueBuf );
00911                     if ( FAILED( hr ) )
00912                     {
00913                         sc = HRESULT_CODE( hr );
00914                         goto Cleanup;
00915                     } // if:
00916
00917                     cch = lstrlenW( pwszValueBuf ) + 1;
00918                     pwszValueBuf += cch;
00919                     pwszNewValueBuf += cch;
00920                     cchNewValueBuf -= cch;
00921                 }  // while:  more strings in the extension list
00922             }  // if:  previous value buffer existed
00923
00924             //
00925             //  Add the new CLSID to the list.
00926             //
00927
00928             hr = StringCchCopyW( pwszNewValueBuf, cchNewValueBuf, pwszClsid );
00929             if ( FAILED( hr ) )
00930             {
00931                 sc = HRESULT_CODE( hr );
00932                 goto Cleanup;
00933             } // if:
00934
00935             //
00936             //  Add the double NULL termination.
00937             //
00938
00939             pwszNewValueBuf += lstrlenW( pwszClsid ) + 1;
00940             *pwszNewValueBuf = L'\0';
00941
00942             //
00943             //  Write the value to the cluster database.
00944             //
00945
00946             dwType = REG_MULTI_SZ;
00947             sc = ClusterRegSetValue(
00948                               hKeyIn
00949                             , REG_VALUE_ADMIN_EXTENSIONS
00950                             , dwType
00951                             , (LPBYTE) pwszNewValue
00952                             , static_cast< DWORD >( cchNewSize * sizeof( *pwszNewValue ) )
00953                             );
00954             if ( sc != ERROR_SUCCESS )
00955             {
00956                 goto Cleanup;
00957             }
00958         }  // else:  new buffer allocated successfully
00959     }  // if:  extension not registered yet
00960
00961 Cleanup:
00962
00963     delete [] pwszNewValue;
00964     delete [] pwszValue;
00965
00966     CoTaskMemFree( pwszClsid );
00967
00968     return sc;
00969
00970 }  //*** RegisterAnyCluAdminExtension
00971
00972 /////////////////////////////////////////////////////////////////////////////
00973 //++
00974 //
00975 //  UnregisterAnyCluAdminExtension
00976 //
00977 //  Routine Description:
00978 //      Unregister any Cluster Administrator Extension DLL with the cluster
00979 //      database.
00980 //
00981 //  Arguments:
00982 //      hClusterIn      Handle to the cluster to modify.
00983 //      pwszKeyNameIn   Key name.
00984 //      pClsidIn        Extension's CLSID.
00985 //
00986 //  Return Value:
00987 //      ERROR_SUCCESS   Extension registered successfully.
00988 //      Win32 error code if another failure occurred.
00989 //
00990 //--
00991 /////////////////////////////////////////////////////////////////////////////
00992 static DWORD
00993 UnregisterAnyCluAdminExtension(
00994       HCLUSTER      hClusterIn
00995     , LPCWSTR       pwszKeyNameIn
00996     , const CLSID * pClsidIn
00997     )
00998 {
00999     DWORD   sc = ERROR_SUCCESS;
01000     HKEY    hKeyCluster = NULL;
01001     HKEY    hKey = NULL;
01002
01003     //
01004     //  Get the cluster key.
01005     //
01006
01007     hKeyCluster = GetClusterKey( hClusterIn, KEY_ALL_ACCESS );
01008     if ( hKeyCluster == NULL )
01009     {
01010         sc = GetLastError();
01011     } // if: error getting cluster key
01012     else
01013     {
01014         // Get the specified key.
01015         sc = ClusterRegOpenKey( hKeyCluster, pwszKeyNameIn, KEY_ALL_ACCESS, &hKey );
01016         if (sc == ERROR_SUCCESS)
01017         {
01018             // Unregister the extension.
01019             sc = UnregisterAnyCluAdminExtension( hKey, pClsidIn );
01020
01021             ClusterRegCloseKey( hKey );
01022         }  // else:  GetClusterResourceTypeKey succeeded
01023
01024         ClusterRegCloseKey( hKeyCluster );
01025     }  // if: cluster key retrieved successfully
01026
01027     return sc;
01028
01029 }  //*** UnregisterAnyCluAdminExtension
01030
01031 /////////////////////////////////////////////////////////////////////////////
01032 //++
01033 //
01034 //  UnregisterAnyCluAdminExtension
01035 //
01036 //  Routine Description:
01037 //      Unregister any Cluster Administrator Extension DLL with the cluster
01038 //      database.
01039 //
01040 //  Arguments:
01041 //      hKeyIn          Cluster database key.
01042 //      pClsidIn        Extension's CLSID.
01043 //
01044 //  Return Value:
01045 //      ERROR_SUCCESS   Extension registered successfully.
01046 //      Win32 error code if another failure occurred.
01047 //
01048 //--
01049 /////////////////////////////////////////////////////////////////////////////
01050 static DWORD
01051 UnregisterAnyCluAdminExtension(
01052       HKEY          hKeyIn
01053     , const CLSID * pClsidIn
01054     )
01055 {
01056     HRESULT     hr = S_OK;
01057     LPOLESTR    pwszClsid = NULL;
01058     size_t      cchClsidLen = 0;
01059     size_t      cchSize = 0;
01060     size_t      cchNewSize = 0;
01061     LPWSTR      pwszValue = NULL;
01062     LPWSTR      pwszNewValue = NULL;
01063     BOOL        bAlreadyUnregistered = FALSE;
01064     DWORD       sc = ERROR_SUCCESS;
01065
01066     //
01067     //  Convert the CLSID to a string.
01068     //
01069
01070     hr = StringFromCLSID( *pClsidIn, &pwszClsid );
01071     if ( FAILED( hr ) )
01072     {
01073         sc = HRESULT_CODE( hr );
01074         goto Cleanup;
01075     } // if:
01076
01077     //
01078     //  Get the length of the CLSID string.
01079     //
01080
01081     cchClsidLen = lstrlenW( pwszClsid );
01082
01083     //
01084     //  Read the current value.
01085     //
01086
01087     sc = ReadValue( hKeyIn, REG_VALUE_ADMIN_EXTENSIONS, &pwszValue, &cchSize );
01088     if ( (sc == ERROR_FILE_NOT_FOUND) || ( (sc == ERROR_SUCCESS) && (cchSize == 0) ) )
01089     {
01090         //
01091         //  If the value was not found or it was and the length was zero then
01092         //  the extension has been unregistered.
01093         //
01094
01095         bAlreadyUnregistered = TRUE;
01096     } // if:
01097     else if ( sc == ERROR_SUCCESS )
01098     {
01099         LPCWSTR pwszValueBuf = pwszValue;
01100         size_t  cch = 0;
01101         size_t  cchValueBuf = cchSize;
01102
01103         while ( *pwszValueBuf != L'\0' )
01104         {
01105             if ( NIStringCompareW( pwszClsid, pwszValueBuf, cchClsidLen ) == 0 )
01106             {
01107                 break;
01108             } // if: CLSID for this extension found in the list
01109
01110             cch = lstrlenW( pwszValueBuf ) + 1;
01111             pwszValueBuf += cch;
01112             cchValueBuf -= cch;
01113         }  // while:  more strings in the extension list
01114
01115         bAlreadyUnregistered = (*pwszValueBuf == L'\0');
01116     } // else if:
01117     else
01118     {
01119         goto Cleanup;
01120     } // else:
01121
01122     //
01123     //  Unregister the extension.
01124     //
01125
01126     if ( bAlreadyUnregistered == FALSE )
01127     {
01128         //
01129         //  Allocate a new buffer.
01130         //
01131
01132         cchNewSize = cchSize - lstrlenW(pwszClsid) - 1;
01133         if (cchNewSize == 1) // only the final null left
01134         {
01135             cchNewSize = 0;
01136         } // if:
01137
01138         pwszNewValue = new WCHAR[ cchNewSize ];
01139         if ( pwszNewValue == NULL )
01140         {
01141             sc = ERROR_OUTOFMEMORY;
01142             goto Cleanup;
01143         } // if: error allocating memory
01144         else
01145         {
01146             LPCWSTR pwszValueBuf = pwszValue;
01147             LPWSTR  pwszNewValueBuf = pwszNewValue;
01148             size_t  cchValueBuf = cchSize;
01149             size_t  cchNewValueBuf = cchNewSize;
01150             size_t  cch = 0;
01151             DWORD   dwType = 0;
01152
01153             //
01154             //  Copy the existing extensions to the new buffer.
01155             //
01156
01157             if ( ( cchNewSize > 0 ) && ( pwszValue != NULL ) )
01158             {
01159                 while ( *pwszValueBuf != L'\0' )
01160                 {
01161                     if ( NIStringCompareW( pwszClsid, pwszValueBuf, cchClsidLen ) != 0 )
01162                     {
01163                         hr = StringCchCopyNW( pwszNewValueBuf, cchNewValueBuf, pwszValueBuf, cchValueBuf );
01164                         if ( FAILED( hr ) )
01165                         {
01166                             sc = HRESULT_CODE( hr );
01167                             goto Cleanup;
01168                         } // if:
01169
01170                         cch = lstrlenW( pwszNewValueBuf ) + 1;
01171                         pwszNewValueBuf += cch;
01172                         cchNewValueBuf -= cch;
01173                     }  // if:  not CLSID being removed
01174
01175                     cch = lstrlenW( pwszValueBuf ) + 1;
01176                     pwszValueBuf += cch;
01177                     cchValueBuf -= cch;
01178                 }  // while:  more strings in the extension list
01179
01180                 *pwszNewValueBuf = L'\0';
01181             }  // if:  previous value buffer existed
01182
01183             //
01184             //  Write the value to the cluster database.
01185             //
01186
01187             dwType = REG_MULTI_SZ;
01188             sc = ClusterRegSetValue(
01189                               hKeyIn
01190                             , REG_VALUE_ADMIN_EXTENSIONS
01191                             , dwType
01192                             , (LPBYTE) pwszNewValue
01193                             , static_cast< DWORD >( cchNewSize * sizeof( *pwszNewValue ) )
01194                             );
01195             if ( sc != ERROR_SUCCESS )
01196             {
01197                 goto Cleanup;
01198             } // if:
01199         }  // else:  new buffer allocated successfully
01200     }  // if:  extension not unregistered yet
01201
01202 Cleanup:
01203
01204     delete [] pwszNewValue;
01205     delete [] pwszValue;
01206
01207     CoTaskMemFree( pwszClsid );
01208
01209     return sc;
01210
01211 }  //*** UnregisterAnyCluAdminExtension
01212
01213 /////////////////////////////////////////////////////////////////////////////
01214 //++
01215 //
01216 //  ReadValue
01217 //
01218 //  Routine Description:
01219 //      Reads a value from the cluster database.
01220 //
01221 //  Arguments:
01222 //      hKeyIn          Handle for the key to read from.
01223 //      pwszValueNameIn Name of value to read.
01224 //      ppwszValueOut   Address of pointer in which to return data.
01225 //                      The string is allocated using new [] and must
01226 //                      be deallocated by the calling delete [].
01227 //      pcchValueOut    Size in characters of the allocated value buffer.
01228 //
01229 //  Return Value:
01230 //      Any return values from ClusterRegQueryValue or errors from new.
01231 //
01232 //--
01233 /////////////////////////////////////////////////////////////////////////////
01234 static DWORD
01235 ReadValue(
01236       HKEY      hKeyIn
01237     , LPCWSTR   pwszValueNameIn
01238     , LPWSTR *  ppwszValueOut
01239     , size_t *  pcchValueOut
01240     )
01241 {
01242     DWORD   sc = ERROR_SUCCESS;
01243     DWORD   cbSize = 0;
01244     DWORD   cchSize = 0;
01245     DWORD   dwType = 0;
01246     LPWSTR  pwszValue = NULL;
01247
01248     //
01249     //  Initialize the out parameters...
01250     //
01251
01252     *ppwszValueOut = NULL;
01253     *pcchValueOut = 0;
01254
01255     //
01256     //  Get the length of the value.
01257     //
01258
01259     sc = ClusterRegQueryValue( hKeyIn, pwszValueNameIn, &dwType, NULL, &cbSize );
01260     if (   ( sc != ERROR_SUCCESS )
01261         && ( sc != ERROR_MORE_DATA ) )
01262     {
01263         goto Cleanup;
01264     }  // if:  error occurred
01265
01266     ASSERT( (cbSize % sizeof( WCHAR ) ) == 0 ); // must be even
01267     cchSize = cbSize / sizeof( WCHAR );
01268
01269     if ( cbSize > 0 )
01270     {
01271         //
01272         //  Allocate a value string.
01273         //
01274
01275         pwszValue = new WCHAR[ cchSize ];
01276         if ( pwszValue == NULL )
01277         {
01278             sc =  ERROR_NOT_ENOUGH_MEMORY;
01279             goto Cleanup;
01280         }  // if:  error allocating memory
01281
01282         //
01283         //  Read the the value.
01284         //
01285
01286         sc = ClusterRegQueryValue( hKeyIn, pwszValueNameIn, &dwType, (LPBYTE) pwszValue, &cbSize );
01287         if ( sc != ERROR_SUCCESS )
01288         {
01289             goto Cleanup;
01290         } // if:
01291
01292          ASSERT( cchSize * sizeof( WCHAR ) == cbSize );
01293
01294         *ppwszValueOut = pwszValue;
01295         pwszValue = NULL;                                   // give away ownership...
01296         *pcchValueOut = static_cast< size_t >( cchSize );
01297     }  // if:  value is not empty
01298
01299 Cleanup:
01300
01301     delete [] pwszValue;
01302
01303     return sc;
01304
01305 }  //*** ReadValue
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CScriptTag Member List

This is the complete list of members for CScriptTag, including all inherited members.
_aTempBuffer | CHtmlElement | [protected]
_awszPropSpec | CScriptTag | [private]
_clsidScriptInfo | CScriptTag | [private]
_eState | CScriptTag | [private]
_htmlIFilter | CHtmlElement | [protected]
_scanner | CHtmlElement | [protected]
_serialStream | CHtmlElement | [protected]
CHtmlElement(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CHtmlElement |
CScriptTag(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream, GUID ClsidScriptInfo) | CScriptTag |
GetChunk(STAT_CHUNK *pStat) | CScriptTag | [virtual]
GetText(ULONG *pcwcOutput, WCHAR *awcBuffer) | CScriptTag | [virtual]
GetValue(PROPVARIANT **ppPropValue) | CScriptTag | [virtual]
InitFilterRegion(ULONG &idChunkSource, ULONG &cwcStartSource, ULONG &cwcLenSource) | CHtmlElement | [virtual]
InitStatChunk(STAT_CHUNK *pStat) | CScriptTag | [virtual]
SkipRemainingTextAndGotoNextChunk(STAT_CHUNK *pStat) | CHtmlElement | [protected]
SwitchToNextHtmlElement(STAT_CHUNK *pStat) | CHtmlElement | [protected]
~CHtmlElement() | CHtmlElement | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Cancel/Client/Cancel.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • Cancel
  • Client

Cancel.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define _WIN32_WINNT 0x0400
00018 #define STRICT
00019 #include <Windows.h>
00020 #include <WindowsX.h>
00021 #include <stdio.h>
00022 #include <tchar.h>
00023 #include <initguid.h>
00024 #include "Resource.h"
00025
00026
00027 HWND hWndDialog;
00028
00029 typedef struct params
00030 {
00031   BOOL bInProcess;
00032   DWORD dwThreadType;
00033   DWORD dwObjectType;
00034   TCHAR szMachine[300];
00035 } PARAMS;
00036
00037 HANDLE g_NotifyPrimarySTAEvent;
00038
00039 // {37824810-ADBA-11d1-B6FB-00A024A85A1F}
00040 DEFINE_GUID(CLSID_NoneCancelObject, 0x37824810, 0xadba, 0x11d1, 0xb6, 0xfb, 0x0, 0xa0, 0x24, 0xa8, 0x5a, 0x1f);
00041
00042 // {37824811-ADBA-11d1-B6FB-00A024A85A1F}
00043 DEFINE_GUID(CLSID_STACancelObject, 0x37824811, 0xadba, 0x11d1, 0xb6, 0xfb, 0x0, 0xa0, 0x24, 0xa8, 0x5a, 0x1f);
00044
00045 // {37824812-ADBA-11d1-B6FB-00A024A85A1F}
00046 DEFINE_GUID(CLSID_MTACancelObject, 0x37824812, 0xadba, 0x11d1, 0xb6, 0xfb, 0x0, 0xa0, 0x24, 0xa8, 0x5a, 0x1f);
00047
00048
00049
00050 void
00051 Message(LPTSTR szPrefix, HRESULT hr)
00052 {
00053     LPTSTR   szMessage;
00054   TCHAR szDisplay[1000];
00055
00056     if (hr == S_OK)
00057         {
00058     _stprintf(szDisplay, TEXT("%s"), szPrefix);
00059     MessageBox(hWndDialog, szDisplay, TEXT("Msg"),0);
00060         return;
00061         }
00062
00063     if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
00064         hr = HRESULT_CODE(hr);
00065
00066     FormatMessage(
00067         FORMAT_MESSAGE_ALLOCATE_BUFFER |
00068         FORMAT_MESSAGE_FROM_SYSTEM,
00069         NULL,
00070         hr,
00071         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00072         (LPTSTR)&szMessage,
00073         0,
00074         NULL );
00075
00076     _stprintf(szDisplay, TEXT("%s: %s(%lx)"), szPrefix, szMessage, hr);
00077   MessageBox(hWndDialog, szDisplay, TEXT("Msg"),0);
00078     LocalFree(szMessage);
00079 }  // Message
00080
00081
00082 DWORD WINAPI ThreadProc(LPVOID lp)
00083 {
00084     MULTI_QI    mq;
00085     COSERVERINFO csi, *pcsi=NULL;
00086   HRESULT hr = S_OK;
00087   IPersist *pPersist = NULL;
00088   HWND hwnd1=NULL, hwnd2=NULL, hwnd3=NULL;
00089   DWORD dwCls;
00090   PARAMS p = *(PARAMS*)lp;
00091   CLSID clsid;
00092
00093         if (p.bInProcess)
00094   {
00095     if (COINIT_APARTMENTTHREADED == p.dwThreadType && (p.dwObjectType == 0))
00096     {
00097       hwnd1 = GetDlgItem(hWndDialog, IDC_INPROC_STA2STA);
00098       hwnd2 = GetDlgItem(hWndDialog, IDC_INPROC_STA2STA_CANCELACT);
00099       hwnd3 = GetDlgItem(hWndDialog, IDC_INPROC_STA2STA_CANCELCALL);
00100     }
00101     else if (COINIT_APARTMENTTHREADED == p.dwThreadType && (p.dwObjectType == 2))
00102     {
00103       hwnd1 = GetDlgItem(hWndDialog, IDC_INPROC_STA2MTA);
00104       hwnd2 = GetDlgItem(hWndDialog, IDC_INPROC_STA2MTA_CANCELACT);
00105       hwnd3 = GetDlgItem(hWndDialog, IDC_INPROC_STA2MTA_CANCELCALL);
00106
00107     }
00108     else if (COINIT_MULTITHREADED == p.dwThreadType && (p.dwObjectType == 1))
00109     {
00110       hwnd1 = GetDlgItem(hWndDialog, IDC_INPROC_MTA2STA);
00111       hwnd2 = GetDlgItem(hWndDialog, IDC_INPROC_MTA2STA_CANCELACT);
00112       hwnd3 = GetDlgItem(hWndDialog, IDC_INPROC_MTA2STA_CANCELCALL);
00113     }
00114     dwCls = CLSCTX_INPROC_SERVER;
00115     clsid = (p.dwObjectType == 0) ? CLSID_NoneCancelObject:
00116         ((p.dwObjectType == 2) ? CLSID_MTACancelObject:CLSID_STACancelObject);
00117   }
00118   else
00119   {
00120     if (COINIT_APARTMENTTHREADED == p.dwThreadType && !(p.dwObjectType))
00121     {
00122       hwnd1 = GetDlgItem(hWndDialog, IDC_OUTPROC_STA2STA);
00123       hwnd2 = GetDlgItem(hWndDialog, IDC_OUTPROC_STA2STA_CANCELACT);
00124       hwnd3 = GetDlgItem(hWndDialog, IDC_OUTPROC_STA2STA_CANCELCALL);
00125
00126     }
00127     else if (COINIT_APARTMENTTHREADED == p.dwThreadType && (p.dwObjectType))
00128     {
00129       hwnd1 = GetDlgItem(hWndDialog, IDC_OUTPROC_STA2MTA);
00130       hwnd2 = GetDlgItem(hWndDialog, IDC_OUTPROC_STA2MTA_CANCELACT);
00131       hwnd3 = GetDlgItem(hWndDialog, IDC_OUTPROC_STA2MTA_CANCELCALL);
00132
00133     }
00134     else if (COINIT_MULTITHREADED == p.dwThreadType && !(p.dwObjectType))
00135     {
00136       hwnd1 = GetDlgItem(hWndDialog, IDC_OUTPROC_MTA2STA);
00137       hwnd2 = GetDlgItem(hWndDialog, IDC_OUTPROC_MTA2STA_CANCELACT);
00138       hwnd3 = GetDlgItem(hWndDialog, IDC_OUTPROC_MTA2STA_CANCELCALL);
00139     }
00140     else if (COINIT_MULTITHREADED == p.dwThreadType && (p.dwObjectType))
00141     {
00142       hwnd1 = GetDlgItem(hWndDialog, IDC_OUTPROC_MTA2MTA);
00143       hwnd2 = GetDlgItem(hWndDialog, IDC_OUTPROC_MTA2MTA_CANCELACT);
00144       hwnd3 = GetDlgItem(hWndDialog, IDC_OUTPROC_MTA2MTA_CANCELCALL);
00145
00146     }
00147     if (lstrlen(p.szMachine))
00148     {
00149       memset(&csi, 0, sizeof(COSERVERINFO));
00150       csi.pwszName = p.szMachine;
00151       pcsi = &csi;
00152     }
00153     dwCls = CLSCTX_LOCAL_SERVER;
00154     clsid = (p.dwObjectType) ? CLSID_MTACancelObject:CLSID_STACancelObject;
00155   }
00156
00157   EnableWindow(hwnd1, FALSE);
00158   CoInitializeEx(NULL, p.dwThreadType);
00159   if FAILED(hr)
00160   {
00161     Message(TEXT("CoInitializeEx"), hr);
00162     goto cleanup;
00163   }
00164
00165         hr = CoEnableCallCancellation(NULL);
00166   if FAILED(hr)
00167   {
00168     Message(TEXT("CoEnableCallCancellation"), hr);
00169     goto cleanup;
00170   }
00171
00172         mq.pIID = &IID_IPersist;
00173   mq.pItf = NULL;
00174   mq.hr = S_OK;
00175
00176
00177
00178   EnableWindow(hwnd2, TRUE);
00179   hr = CoCreateInstanceEx(clsid, NULL, dwCls, pcsi, 1, &mq);
00180   if FAILED(hr)
00181   {
00182     Message(TEXT("CoCreateInstanceEx"), hr);
00183     goto cleanup;
00184   }
00185
00186   EnableWindow(hwnd2, FALSE);
00187   pPersist = (IPersist*)mq.pItf;
00188
00189   if (!pPersist)
00190     goto cleanup;
00191   EnableWindow(hwnd3, TRUE);
00192   hr = pPersist->GetClassID(&clsid);
00193   if FAILED(hr)
00194   {
00195     Message(TEXT("Method"), hr);
00196     goto cleanup;
00197   }
00198   EnableWindow(hwnd3, FALSE);
00199   pPersist->Release();
00200
00201         CoDisableCallCancellation(NULL);
00202   CoUninitialize();
00203 cleanup:
00204   EnableWindow(hwnd1, TRUE);
00205   EnableWindow(hwnd2, FALSE);
00206   EnableWindow(hwnd3, FALSE);
00207   return hr;
00208 }
00209
00210 void CANCEL_OnTimer(HWND hwnd, UINT nID)
00211 {
00212   UNREFERENCED_PARAMETER(hwnd);
00213   UNREFERENCED_PARAMETER(nID);
00214   CoFreeUnusedLibraries();
00215 }
00216
00217 //////////////////////////////////////////////////////////////
00218
00219
00220 BOOL CANCEL_OnInitDialog(HWND hwnd,
00221    HWND hwndFocus, LPARAM lParam) {
00222   UNREFERENCED_PARAMETER(lParam);
00223   UNREFERENCED_PARAMETER(hwndFocus);
00224   hWndDialog = hwnd;
00225   EnableWindow(GetDlgItem(hwnd, IDC_INPROC_STA2STA_CANCELACT), FALSE);
00226   EnableWindow(GetDlgItem(hwnd, IDC_INPROC_STA2STA_CANCELCALL), FALSE);
00227   EnableWindow(GetDlgItem(hwnd, IDC_INPROC_STA2MTA_CANCELACT), FALSE);
00228   EnableWindow(GetDlgItem(hwnd, IDC_INPROC_STA2MTA_CANCELCALL), FALSE);
00229   EnableWindow(GetDlgItem(hwnd, IDC_INPROC_MTA2STA_CANCELACT), FALSE);
00230   EnableWindow(GetDlgItem(hwnd, IDC_INPROC_MTA2STA_CANCELCALL), FALSE);
00231   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_STA2STA_CANCELACT), FALSE);
00232   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_STA2MTA_CANCELACT), FALSE);
00233   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_MTA2STA_CANCELACT), FALSE);
00234   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_MTA2MTA_CANCELACT), FALSE);
00235   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_STA2STA_CANCELCALL), FALSE);
00236   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_STA2MTA_CANCELCALL), FALSE);
00237   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_MTA2STA_CANCELCALL), FALSE);
00238   EnableWindow(GetDlgItem(hwnd, IDC_OUTPROC_MTA2MTA_CANCELCALL), FALSE);
00239   SetTimer(hwnd, 1, 5000, NULL);
00240   return(TRUE);
00241 }
00242
00243
00244 void CANCEL_OnCommand(HWND hwnd,
00245    int id, HWND hwndCtl, UINT codeNotify) {
00246
00247   UNREFERENCED_PARAMETER(codeNotify);
00248   UNREFERENCED_PARAMETER(hwndCtl);
00249   static DWORD dwInProcSTA2STA;
00250   HANDLE hInProcSTA2STA;
00251   static DWORD dwInProcSTA2MTA;
00252   HANDLE hInProcSTA2MTA;
00253   static DWORD dwInProcMTA2STA;
00254   HANDLE hInProcMTA2STA;
00255
00256   static DWORD dwOutProcSTA2STA;
00257   HANDLE hOutProcSTA2STA;
00258   static DWORD dwOutProcSTA2MTA;
00259   HANDLE hOutProcSTA2MTA;
00260   static DWORD dwOutProcMTA2STA;
00261   HANDLE hOutProcMTA2STA;
00262   static DWORD dwOutProcMTA2MTA;
00263   HANDLE hOutProcMTA2MTA;
00264
00265   static PARAMS p;
00266   HRESULT hr;
00267
00268   switch (id) {
00269   case IDC_INPROC_STA2STA:
00270     p.bInProcess = TRUE;
00271     p.dwThreadType = COINIT_APARTMENTTHREADED;
00272     p.dwObjectType = 0;
00273     hInProcSTA2STA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc,(LPVOID)&p, 0,
00274       &dwInProcSTA2STA);
00275     if (!hInProcSTA2STA)
00276     {
00277       Message(TEXT("CreateThread"), GetLastError());
00278     }
00279     else
00280       CloseHandle(hInProcSTA2STA);
00281     break;
00282   case IDC_INPROC_STA2MTA:
00283     p.bInProcess = TRUE;
00284     p.dwThreadType = COINIT_APARTMENTTHREADED;
00285     p.dwObjectType = 2;
00286     hInProcSTA2MTA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc,(LPVOID)&p, 0,
00287       &dwInProcSTA2MTA);
00288     if (!hInProcSTA2MTA)
00289     {
00290       Message(TEXT("CreateThread"),  GetLastError());
00291     }
00292     else
00293       CloseHandle(hInProcSTA2MTA);
00294     break;
00295   case IDC_INPROC_MTA2STA:
00296     p.bInProcess = TRUE;
00297     p.dwThreadType = COINIT_MULTITHREADED;
00298     p.dwObjectType = 1;
00299     hInProcMTA2STA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc,(LPVOID)&p, 0,
00300       &dwInProcMTA2STA);
00301     if (!hInProcMTA2STA)
00302     {
00303       Message(TEXT("CreateThread"),  GetLastError());
00304     }
00305     else
00306       CloseHandle(hInProcMTA2STA);
00307     break;
00308   case IDC_OUTPROC_STA2STA:
00309     p.bInProcess = FALSE;
00310     p.dwThreadType = COINIT_APARTMENTTHREADED;
00311     p.dwObjectType = 0;
00312     GetDlgItemText(hwnd, IDC_MACHINE, p.szMachine, sizeof(p.szMachine));
00313     hOutProcSTA2STA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc,(LPVOID)&p, 0,
00314       &dwOutProcSTA2STA);
00315     if (!hOutProcSTA2STA)
00316     {
00317       Message(TEXT("CreateThread"),  GetLastError());
00318     }
00319     else
00320       CloseHandle(hOutProcSTA2STA);
00321     break;
00322   case IDC_OUTPROC_STA2MTA:
00323     p.bInProcess = FALSE;
00324     p.dwThreadType = COINIT_APARTMENTTHREADED;
00325     p.dwObjectType = 1;
00326     GetDlgItemText(hwnd, IDC_MACHINE, p.szMachine, sizeof(p.szMachine));
00327     hOutProcSTA2MTA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc,(LPVOID)&p, 0,
00328       &dwOutProcSTA2MTA);
00329     if (!hOutProcSTA2MTA)
00330     {
00331       Message(TEXT("CreateThread"), GetLastError());
00332     }
00333     else
00334       CloseHandle(hOutProcSTA2MTA);
00335     break;
00336   case IDC_OUTPROC_MTA2STA:
00337     p.bInProcess = FALSE;
00338     p.dwThreadType = COINIT_MULTITHREADED;
00339     p.dwObjectType = 0;
00340     GetDlgItemText(hwnd, IDC_MACHINE, p.szMachine, sizeof(p.szMachine));
00341     hOutProcMTA2STA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc,(LPVOID)&p, 0,
00342       &dwOutProcMTA2STA);
00343     if (!hOutProcMTA2STA)
00344     {
00345       Message(TEXT("CreateThread"), GetLastError());
00346     }
00347     else
00348       CloseHandle(hOutProcMTA2STA);
00349     break;
00350   case IDC_OUTPROC_MTA2MTA:
00351     p.bInProcess = FALSE;
00352     p.dwThreadType = COINIT_MULTITHREADED;
00353     p.dwObjectType = 1;
00354     GetDlgItemText(hwnd, IDC_MACHINE, p.szMachine, sizeof(p.szMachine));
00355     hOutProcMTA2MTA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc,(LPVOID)&p, 0,
00356       &dwOutProcMTA2MTA);
00357     if (!hOutProcMTA2MTA)
00358     {
00359       Message(TEXT("CreateThread"), GetLastError());
00360     }
00361     else
00362       CloseHandle(hOutProcMTA2MTA);
00363     break;
00364   case IDC_INPROC_STA2STA_CANCELACT:
00365   case IDC_INPROC_STA2STA_CANCELCALL:
00366     hr = CoCancelCall(dwInProcSTA2STA, 0);
00367     if (FAILED(hr))
00368         {
00369       Message(TEXT("CoCancelCall"), hr);
00370       return;
00371         }
00372     break;
00373   case IDC_INPROC_STA2MTA_CANCELACT:
00374   case IDC_INPROC_STA2MTA_CANCELCALL:
00375     hr = CoCancelCall(dwInProcSTA2MTA, 0);
00376     if (FAILED(hr))
00377         {
00378       Message(TEXT("CoCancelCall"), hr);
00379       return;
00380         }
00381
00382     break;
00383   case IDC_INPROC_MTA2STA_CANCELACT:
00384   case IDC_INPROC_MTA2STA_CANCELCALL:
00385     hr = CoCancelCall(dwInProcMTA2STA, 0);
00386     if (FAILED(hr))
00387         {
00388       Message(TEXT("CoCancelCall"), hr);
00389       return;
00390         }
00391     break;
00392   case IDC_OUTPROC_STA2STA_CANCELACT:
00393   case IDC_OUTPROC_STA2STA_CANCELCALL:
00394     hr = CoCancelCall(dwOutProcSTA2STA, 0);
00395     if (FAILED(hr))
00396         {
00397       Message(TEXT("CoCancelCall"), hr);
00398       return;
00399         }
00400     break;
00401   case IDC_OUTPROC_STA2MTA_CANCELACT:
00402   case IDC_OUTPROC_STA2MTA_CANCELCALL:
00403     hr = CoCancelCall(dwOutProcSTA2MTA, 0);
00404     if (FAILED(hr))
00405         {
00406       Message(TEXT("CoCancelCall"), hr);
00407       return;
00408         }
00409     break;
00410   case IDC_OUTPROC_MTA2STA_CANCELACT:
00411   case IDC_OUTPROC_MTA2STA_CANCELCALL:
00412     hr = CoCancelCall(dwOutProcMTA2STA, 0);
00413     if (FAILED(hr))
00414         {
00415       Message(TEXT("CoCancelCall"), hr);
00416       return;
00417         }
00418     break;
00419   case IDC_OUTPROC_MTA2MTA_CANCELACT:
00420   case IDC_OUTPROC_MTA2MTA_CANCELCALL:
00421     hr = CoCancelCall(dwOutProcMTA2MTA, 0);
00422     if (FAILED(hr))
00423         {
00424       Message(TEXT("CoCancelCall"), hr);
00425       return;
00426         }
00427     break;
00428
00429   case IDCANCEL:
00430       // If the Escape key is hit, destroy the modeless
00431       // dialog box, terminating the application.
00432       DestroyWindow(hwnd);
00433       break;
00434
00435    }
00436 }
00437
00438
00439 //////////////////////////////////////////////////////////////
00440
00441
00442 INT_PTR WINAPI CANCEL_DlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
00443    switch (uMsg) {
00444       HANDLE_MSG(hwnd, WM_INITDIALOG, CANCEL_OnInitDialog);
00445       HANDLE_MSG(hwnd, WM_COMMAND, CANCEL_OnCommand);
00446       HANDLE_MSG(hwnd, WM_TIMER, CANCEL_OnTimer);
00447    }
00448    return(FALSE);
00449 }
00450
00451
00452 DWORD WINAPI PrimarySTAThreadProc(LPVOID lp)
00453 {
00454   UNREFERENCED_PARAMETER(lp);
00455     HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00456   if FAILED(hr)
00457   {
00458     Message(TEXT("CoInitializeEx"), hr);
00459     return hr;
00460   }
00461   SetEvent(g_NotifyPrimarySTAEvent);
00462
00463   MSG msg;
00464   while (true==true)
00465   {
00466     if (WaitForSingleObject(g_NotifyPrimarySTAEvent, 0) == WAIT_OBJECT_0)
00467     {
00468       break;
00469     }
00470     if (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE))
00471     {
00472       TranslateMessage(&msg);
00473       DispatchMessage(&msg);
00474     }
00475   }
00476   CoUninitialize();
00477     return hr;
00478 }
00479
00480
00481
00482 //////////////////////////////////////////////////////////////
00483
00484
00485
00486 int WINAPI WinMain (HINSTANCE hinstExe,
00487    HINSTANCE hinstExePrev, LPSTR pszCmdLine, int nCmdShow) {
00488
00489   UNREFERENCED_PARAMETER(nCmdShow);
00490   UNREFERENCED_PARAMETER(pszCmdLine);
00491   UNREFERENCED_PARAMETER(hinstExePrev);
00492   g_NotifyPrimarySTAEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
00493   if (g_NotifyPrimarySTAEvent == NULL)
00494   {
00495     Message(TEXT("CreateEvent"), GetLastError());
00496     return -1;
00497   }
00498   DWORD dwPrimarySTA;
00499   HANDLE hPrimarySTA = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)PrimarySTAThreadProc,NULL, 0,
00500     &dwPrimarySTA);
00501   if (!hPrimarySTA)
00502   {
00503     Message(TEXT("CreateThread"), GetLastError());
00504     return -1;
00505   }
00506   WaitForSingleObject(g_NotifyPrimarySTAEvent, INFINITE);
00507
00508   HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
00509   if FAILED(hr)
00510   {
00511     Message(TEXT("CoInitializeEx"), hr);
00512     return hr;
00513   }
00514   hr = CoInitializeSecurity( NULL, -1, NULL, NULL,
00515     RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IDENTIFY,
00516     NULL, EOAC_NONE, NULL );
00517     if (FAILED(hr))
00518         {
00519         Message(TEXT("CoInitializeSecurity"), hr);
00520         return hr;
00521         }
00522
00523   // Create the appication's UI window
00524   DialogBox(hinstExe,
00525       MAKEINTRESOURCE(IDD_CANCEL_DIALOG), NULL, CANCEL_DlgProc);
00526   SetEvent(g_NotifyPrimarySTAEvent);
00527   WaitForSingleObject(hPrimarySTA, INFINITE);
00528   CloseHandle(hPrimarySTA);
00529   CoUninitialize();
00530     return(0);  // End the application
00531 }
00532
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_Shutdown Member List

This is the complete list of members for _Shutdown, including all inherited members.
ShutdownFlag | _Shutdown
ShutdownName | _Shutdown
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CComSpySqlAudit Member List

This is the complete list of members for CComSpySqlAudit, including all inherited members.
CComSpySqlAudit() | CComSpySqlAudit | [inline]
EngineDefined(LONGLONG perfCount, LPCOLESTR pszPropName, VARIANT *varPropValue, LPCOLESTR pszClsidEng) | CComSpySqlAudit |
FinalConstruct() | CComSpySqlAudit | [inline]
FinalRelease() | CComSpySqlAudit | [inline]
GetError(HENV henv, HDBC hdbc, HSTMT hstmt, BSTR *msg) | CComSpySqlAudit |
Init(LPCOLESTR sDSN, LPCOLESTR sUser, LPCOLESTR sPw) | CComSpySqlAudit |
m_hdbc | CComSpySqlAudit | [private]
m_henv | CComSpySqlAudit | [private]
m_hstmt | CComSpySqlAudit | [private]
m_PerformanceFrequency | CComSpySqlAudit | [private]
m_pUnkMarshaler | CComSpySqlAudit |
m_sSQL | CComSpySqlAudit | [private]
OnActivityCreate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivityID) | CComSpySqlAudit |
OnActivityDestroy(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivityID) | CComSpySqlAudit |
OnActivityEnter(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidCurrentApp, LPCOLESTR pszGuidEnteredApp, LPCOLESTR pszW2KThreadID) | CComSpySqlAudit |
OnActivityLeave(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidCurrentApp, LPCOLESTR pszGuidLeftApp) | CComSpySqlAudit |
OnActivityLeaveSame(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidCurrentApp, DWORD dwCallDepth) | CComSpySqlAudit |
OnActivityReenter(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidCurrentApp, LPCOLESTR pszW2KThreadID, DWORD dwCallDepth) | CComSpySqlAudit |
OnActivityTimeout(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidCurrentApp, LPCOLESTR pszGuidEnteredApp, LPCOLESTR pszW2KThreadID, DWORD dwTimeout) | CComSpySqlAudit |
OnAppActivation(LONGLONG perfCount, LPCOLESTR pszGuidApp) | CComSpySqlAudit |
OnAppShutdown(LONGLONG perfCount, LPCOLESTR pszGuidApp) | CComSpySqlAudit |
OnAuthenticate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivity, LPCOLESTR pszObjectID, LPCOLESTR pszGuidIID, LPCOLESTR pszMethod, LPCOLESTR pszOriginalUser, LPCOLESTR pszDirectUser, BOOL bCurrentUserInpersonatingInProc) | CComSpySqlAudit |
OnAuthenticateFail(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivity, LPCOLESTR pszObjectID, LPCOLESTR pszGuidIID, LPCOLESTR pszMethod, LPCOLESTR pszOriginalUser, LPCOLESTR pszDirectUser, BOOL bCurrentUserInpersonatingInProc) | CComSpySqlAudit |
OnCRMAbort(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMAnalyze(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID, LPCOLESTR pszCrmRecordType, DWORD dwRecordSize) | CComSpySqlAudit |
OnCRMBegin(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID, LPCOLESTR pszGuidActivityID, LPCOLESTR pszGuidTxUOWID, LPCOLESTR pszProgIdCompensator, LPCOLESTR pszDescription) | CComSpySqlAudit |
OnCRMCheckpoint(LONGLONG perfCount, LPCOLESTR pszGuidApp) | CComSpySqlAudit |
OnCRMCommit(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMDeliver(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID, BOOL bVariants, DWORD dwRecordSize) | CComSpySqlAudit |
OnCRMDone(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMForce(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMForget(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMIndoubt(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMPrepare(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMRecoveryDone(LONGLONG perfCount, LPCOLESTR pszGuidApp) | CComSpySqlAudit |
OnCRMRecoveryStart(LONGLONG perfCount, LPCOLESTR pszGuidApp) | CComSpySqlAudit |
OnCRMRelease(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID) | CComSpySqlAudit |
OnCRMWrite(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidClerkCLSID, BOOL bVariants, DWORD dwRecordSize) | CComSpySqlAudit |
OnDisableCommit(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszContextID) | CComSpySqlAudit |
OnEnableCommit(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszContextID) | CComSpySqlAudit |
OnExceptionUser(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszCode, LPCOLESTR pszAddress, LPCOLESTR pszStackTrace) | CComSpySqlAudit |
OnIISRequestInfo(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszClientIP, LPCOLESTR pszServerIP, LPCOLESTR pszURL) | CComSpySqlAudit |
OnMethodCall(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszGuidClassID, LPCOLESTR pszGuidInterfaceID, LPCOLESTR pszMethod) | CComSpySqlAudit |
OnMethodException(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszGuidClassID, LPCOLESTR pszGuidInterfaceID, LPCOLESTR pszMethod) | CComSpySqlAudit |
OnMethodReturn(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszGuidClassID, LPCOLESTR pszGuidInterfaceID, LPCOLESTR pszMethod, HRESULT hr, LPCOLESTR pszCallTime) | CComSpySqlAudit |
OnObjectActivate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszContextID, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjectConstruct(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszClassID, LPCOLESTR pszConstructString, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjectCreate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivityID, LPCOLESTR pszClassID, LPCOLESTR pszTSID, LPCOLESTR pszContextID, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjectDeactivate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszContextID, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjectDestroy(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszContextID) | CComSpySqlAudit |
OnObjPoolCreateDecision(LONGLONG perfCount, LPCOLESTR pszGuidApp, DWORD dwThreadsWaiting, DWORD dwAvailableObjs, DWORD dwCreatedObjs, DWORD dwMin, DWORD dwMax) | CComSpySqlAudit |
OnObjPoolCreateObject(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszClassID, DWORD dwAvailableObjs, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjPoolCreatePool(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszClassID, DWORD dwMin, DWORD dwMax, DWORD dwTimeout) | CComSpySqlAudit |
OnObjPoolDestroyObject(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszClassID, DWORD dwAvailableObjs, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjPoolGetFromTx(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivityID, LPCOLESTR pszClassID, LPCOLESTR pszGuidTx, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjPoolGetObject(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivityID, LPCOLESTR pszClassID, DWORD dwAvailableObjs, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjPoolPutObject(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszClassID, int nReason, DWORD dwAvailableObjs, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjPoolRecycleToTx(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivityID, LPCOLESTR pszClassID, LPCOLESTR pszGuidTx, LPCOLESTR pszObjectID) | CComSpySqlAudit |
OnObjPoolTimeout(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszClassID, LPCOLESTR pszGuidActivityID, DWORD dwTimeout) | CComSpySqlAudit |
OnQCMoveToDeadQueue(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidMsgID, LPCOLESTR pszGuidWorkFlowID) | CComSpySqlAudit |
OnQCMoveToReTryQueue(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidMsgID, LPCOLESTR pszGuidWorkFlowID, ULONG RetryIndex) | CComSpySqlAudit |
OnQCPlayback(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszGuidMsgID, LPCOLESTR pszGuidWorkFlowID, HRESULT hr) | CComSpySqlAudit |
OnQCQueueOpen(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszQueueName, LPCOLESTR pszQueueID, HRESULT hr) | CComSpySqlAudit |
OnQCReceive(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszQueueID, LPCOLESTR pszGuidMsgID, LPCOLESTR pszGuidWorkFlowID, HRESULT hr) | CComSpySqlAudit |
OnQCReceiveFail(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszQueueID, HRESULT hr) | CComSpySqlAudit |
OnQCRecord(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszQueueName, LPCOLESTR pszGuidMsgID, LPCOLESTR pszGuidWorkFlowID, HRESULT hr) | CComSpySqlAudit |
OnResourceAllocate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszType, LPCOLESTR pszResId, BOOL bEnlisted, LPCOLESTR pszNumRated, LPCOLESTR pszRating) | CComSpySqlAudit |
OnResourceCreate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszType, LPCOLESTR pszResId, BOOL bEnlisted) | CComSpySqlAudit |
OnResourceDestroy(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, HRESULT hResult, LPCOLESTR pszType, LPCOLESTR pszResId) | CComSpySqlAudit |
OnResourceRecycle(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszType, LPCOLESTR pszResId) | CComSpySqlAudit |
OnResourceTrack(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszObjectID, LPCOLESTR pszType, LPCOLESTR pszResId, BOOL bEnlisted) | CComSpySqlAudit |
OnSetAbort(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszContextID) | CComSpySqlAudit |
OnSetComplete(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszContextID) | CComSpySqlAudit |
OnThreadAssignApartment(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidActivityID, LPCOLESTR pszAptID) | CComSpySqlAudit |
OnThreadBindToApartment(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR pszAptID, DWORD dwActivityCnt) | CComSpySqlAudit |
OnThreadStart(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR pszW2KThreadID, DWORD dwThreadCnt) | CComSpySqlAudit |
OnThreadTerminate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR pszW2KThreadID, DWORD dwThreadCnt) | CComSpySqlAudit |
OnThreadUnassignApartment(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszAptID) | CComSpySqlAudit |
OnThreadUnBind(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR pszAptID, DWORD dwActivityCnt) | CComSpySqlAudit |
OnThreadWorkEnque(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR MsgWorkID, DWORD dwQueueLen) | CComSpySqlAudit |
OnThreadWorkPrivate(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR MsgWorkID) | CComSpySqlAudit |
OnThreadWorkPublic(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR MsgWorkID, DWORD dwQueueLen) | CComSpySqlAudit |
OnThreadWorkRedirect(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR MsgWorkID, DWORD dwQueueLen, LPCOLESTR pszThreadNum) | CComSpySqlAudit |
OnThreadWorkReject(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszThreadID, LPCOLESTR MsgWorkID, DWORD dwQueueLen) | CComSpySqlAudit |
OnTransactionAborted(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidTxID) | CComSpySqlAudit |
OnTransactionCommit(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidTxID) | CComSpySqlAudit |
OnTransactionPrepared(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidTxID, BOOL bVoteYes) | CComSpySqlAudit |
OnTransactionStart(LONGLONG perfCount, LPCOLESTR pszGuidApp, LPCOLESTR pszGuidTxID, LPCOLESTR pszGuidTSID, BOOL bRoot) | CComSpySqlAudit |
PerfCountToTickCount(LONGLONG perfCount) | CComSpySqlAudit | [private]
TargetDown(LONGLONG perfCount, LPCOLESTR pszServerName, LPCOLESTR pszClsidEng) | CComSpySqlAudit |
TargetUp(LONGLONG perfCount, LPCOLESTR pszServerName, LPCOLESTR pszClsidEng) | CComSpySqlAudit |
Generated on Wed Nov 13 2024 16:55:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DEB_DLL_LIST_INFO_STRUCT Member List

This is the complete list of members for DEB_DLL_LIST_INFO_STRUCT, including all inherited members.
dwActiveDlls DEB_DLL_LIST_INFO_STRUCT
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/lrsample/minici.hxx Source File

  • WinBase
  • Indexing
  • lrsample

minici.hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // File:     minici.hxx
00011 //
00012 // PURPOSE:  Helper classes for sample programs
00013 //
00014 // PLATFORM: Windows 2000 and later
00015 //
00016 //--------------------------------------------------------------------------
00017
00018 #pragma once
00019
00020 #include <eh.h>
00021 #include <limits.h>
00022
00023 inline void * __cdecl operator new( size_t st )
00024 {
00025     return (void *) LocalAlloc( LMEM_FIXED, st );
00026 } //new
00027
00028 inline void __cdecl operator delete( void *pv )
00029 {
00030     if ( 0 != pv )
00031         LocalFree( (HLOCAL) pv );
00032 } //delete
00033
00034 //+-------------------------------------------------------------------------
00035 //
00036 //  Template:   XPtr
00037 //
00038 //  Synopsis:   Template for managing ownership of memory
00039 //
00040 //--------------------------------------------------------------------------
00041
00042 template<class T> class XPtr
00043 {
00044 public:
00045     XPtr( unsigned c = 0 ) : _p(0) { if ( 0 != c ) _p = new T [ c ]; }
00046     XPtr( T * p ) : _p( p ) {}
00047     ~XPtr() { Free(); }
00048     void SetSize( unsigned c ) { Free(); _p = new T [ c ]; }
00049     void Set ( T * p ) { _p = p; }
00050     T * Get() const { return _p ; }
00051     void Free() { delete [] Acquire(); }
00052     T & operator[]( unsigned i ) { return _p[i]; }
00053     T const & operator[]( unsigned i ) const { return _p[i]; }
00054     T * Acquire() { T * p = _p; _p = 0; return p; }
00055     BOOL IsNull() const { return ( 0 == _p ); }
00056
00057 private:
00058     T * _p;
00059 };
00060
00061 //+-------------------------------------------------------------------------
00062 //
00063 //  Template:   XInterface
00064 //
00065 //  Synopsis:   Template for managing ownership of interfaces
00066 //
00067 //--------------------------------------------------------------------------
00068
00069 template<class T> class XInterface
00070 {
00071 public:
00072     XInterface( T * p = 0 ) : _p( p ) {}
00073     ~XInterface() { if ( 0 != _p ) _p->Release(); }
00074     T * operator->() { return _p; }
00075     T * GetPointer() const { return _p; }
00076     IUnknown ** GetIUPointer() { return (IUnknown **) &_p; }
00077     T ** GetPPointer() { return &_p; }
00078     void ** GetQIPointer() { return (void **) &_p; }
00079     T * Acquire() { T * p = _p; _p = 0; return p; }
00080     BOOL IsNull() { return ( 0 == _p ); }
00081     void Free() { T * p = Acquire(); if ( 0 != p ) p->Release(); }
00082     void Set( T * p ) { _p = p; }
00083     T & GetReference() { return *_p; }
00084
00085 private:
00086     T * _p;
00087 };
00088
00089 //+-------------------------------------------------------------------------
00090 //
00091 //  Class:      XBStr
00092 //
00093 //  Synopsis:   Class for managing ownership of BSTRings
00094 //
00095 //--------------------------------------------------------------------------
00096
00097 class XBStr
00098 {
00099 public:
00100     XBStr( BSTR p = 0 ) : _p( p ) {}
00101     XBStr( XBStr & x ): _p( x.Acquire() ) {}
00102     ~XBStr() { Free(); }
00103     BOOL IsNull() const { return (0 == _p); }
00104     BSTR SetText( WCHAR const * pStr )
00105     {
00106         _p = SysAllocString( pStr );
00107         return _p;
00108     }
00109
00110     void Set( BSTR pOleStr ) { _p = pOleStr; }
00111     BSTR Acquire() { BSTR p = _p; _p = 0; return p; }
00112     BSTR GetPointer() const { return _p; }
00113     void Free() { SysFreeString(Acquire()); }
00114
00115 private:
00116     BSTR _p;
00117 };
00118
00119 class XWindow
00120 {
00121 public:
00122     XWindow( HWND h = 0 ) : _h( h ) {}
00123     ~XWindow() { Free(); }
00124
00125     void Free() { if ( 0 != _h ) { DestroyWindow( _h ); _h = 0; } }
00126     void Set( HWND h ) { _h = 0; }
00127     HWND Get() { return _h; }
00128 private:
00129     HWND _h;
00130 };
00131
00132 inline ULONG CiPtrToUlong( ULONG_PTR p )
00133 {
00134     return PtrToUlong( (PVOID)p );
00135 }
00136
00137 #define CiPtrToUint( p ) CiPtrToUlong( p )
00138
00139 #define ArraySize( x ) ( sizeof( x ) / sizeof( x[0] ) )
00140
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/complist.cpp Source File

  • Begin
  • sdkdiff

complist.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * complist.cpp
00013  *
00014  * supports a list of compitems, where each compitem represents
00015  * a pair of matching files, or an unmatched file.
00016  *
00017  * We build lists of filenames from two pathnames (using the
00018  * scandir module) and then traverse the two lists comparing names.
00019  * Where the names match, we create a CompItem from the matching
00020  * names. Where there is an unmatched name, we create a compitem for it.
00021  *
00022  * we may also be asked to create a complist for two individual files:
00023  * here we create a single compitem for them as a matched pair even if
00024  * the names don't match.
00025  *
00026  */
00027
00028 #include "precomp.h"
00029
00030 #include "state.h"
00031 #include "sdkdiff.h"
00032 #include "wdiffrc.h"
00033
00034
00035 #include "list.h"
00036 #include "line.h"
00037 #include "scandir.h"
00038 #include "file.h"
00039 #include "section.h"
00040 #include "compitem.h"
00041 #include "complist.h"
00042 #include "view.h"
00043
00044 extern BOOL bAbort;             /* in sdkdiff.cpp  Read only here */
00045 #ifdef trace
00046 extern bTrace;                  /* in sdkdiff.cpp  Read only here */
00047 #endif
00048
00049 /*
00050  * the COMPLIST handle is typedef-ed to be a pointer to one
00051  * of these struct complist
00052  */
00053 struct complist {
00054     DIRLIST left;           /* left list of files */
00055     DIRLIST right;          /* right list of files */
00056     LIST items;             /* list of COMPITEMs */
00057 };
00058
00059 /* ---- module-wide data -------------------------------------*/
00060
00061 /* data for communicating between the SaveList dlg and complist_savelist() */
00062
00063 char dlg_file[MAX_PATH];                /* filename to save to */
00064 BOOL dlg_sums = TRUE;
00065
00066 // have we read the dialog names yet?
00067 BOOL SeenDialogNames = FALSE;
00068
00069 /* checkbox options */
00070 BOOL dlg_identical, dlg_differ, dlg_left, dlg_right;
00071
00072 /* data for Directory, SaveList dialog box */
00073 char dialog_leftname[MAX_PATH];
00074 char dialog_rightname[MAX_PATH];
00075 char dialog_servername[80];
00076 BOOL dialog_recursive;             // do whole tree
00077 BOOL dialog_fastscan;              // times and sizes only, no checksums
00078 BOOL dialog_autocopy;              // copy to update local directory
00079
00080
00081 /*
00082  * data used by dodlg_copyfiles
00083  */
00084 UINT dlg_options;
00085 BOOL dlg_IgnoreMarks;
00086 BOOL dlg_IgnoreAttributes;
00087 char dlg_root[MAX_PATH];
00088
00089 /*------------------------timing for performance measurements-----------------*/
00090 static DWORD TickCount;         /* time operation started, then time taken*/
00091
00092
00093 /* --- forward declaration of internal functions ----------------------------*/
00094 int FAR PASCAL complist_dodlg_savelist(HWND hDlg, UINT message,
00095                                        UINT wParam, long lParam);
00096 int FAR PASCAL complist_dodlg_copyfiles(HWND hDlg, UINT message,
00097                                         UINT wParam, long lParam);
00098 BOOL complist_match(COMPLIST cl, VIEW view, BOOL fDeep, BOOL fExact);
00099 COMPLIST complist_new(void);
00100 int FAR PASCAL complist_dodlg_dir(HWND hDlg, unsigned message,
00101                                   UINT wParam, LONG lParam);
00102
00103
00104 /* --- external functions ----------------------------------- */
00105
00106
00107 /*
00108  * query the user to select two files, then build the list from
00109  * these files.
00110  */
00111 COMPLIST
00112 complist_filedialog(VIEW view)
00113 {
00114     COMPLIST cl = NULL;
00115     char szPath1[MAX_PATH * 2];
00116     char szPath2[MAX_PATH * 2];
00117     char fname[MAX_PATH], FileExt[5], FileOpenSpec[15];
00118   HRESULT hr;
00119
00120     /* ask for the filenames - using gfile standard dialogs */
00121     hr = StringCchCopy(FileExt, 5, ".c");
00122   if (FAILED(hr)) {
00123     OutputError(hr, IDS_SAFE_COPY);
00124     goto LError;
00125   }
00126     hr = StringCchCopy(FileOpenSpec, 5, "*.*");
00127   if (FAILED(hr)) {
00128     OutputError(hr, IDS_SAFE_COPY);
00129     goto LError;
00130   }
00131     if (!gfile_open(hwndClient, LoadRcString(IDS_SELECT_FIRST_FILE), FileExt, FileOpenSpec, szPath1, NUMELMS(szPath1), fname) ){
00132         goto LError;
00133     }
00134
00135     if (!gfile_open(hwndClient, LoadRcString(IDS_SELECT_SECOND_FILE), FileExt, FileOpenSpec, szPath2, NUMELMS(szPath2), fname) ){
00136         goto LError;
00137     }
00138
00139     /* alloc a new structure */
00140     cl = complist_new();
00141
00142     cl->left = dir_buildlist(szPath1, FALSE, TRUE);
00143     cl->right = dir_buildlist(szPath2, FALSE, TRUE);
00144
00145
00146     /* register with the view (must be done after the list is non-null) */
00147     view_setcomplist(view, cl);
00148
00149     complist_match(cl, view, FALSE, TRUE);
00150
00151 LError:
00152     return(cl);
00153 }/* complist_filedialog */
00154
00155
00156 void
00157 complist_setdialogdefault(
00158                          LPSTR left,
00159                          LPSTR right,
00160                          BOOL fDeep)
00161 {
00162   HRESULT hr;
00163     dialog_recursive = fDeep;
00164     hr = StringCchCopy(dialog_leftname, MAX_PATH, left);
00165   if (FAILED(hr))
00166     OutputError(hr, IDS_SAFE_COPY);
00167     hr = StringCchCopy(dialog_rightname, MAX_PATH, right);
00168   if (FAILED(hr))
00169     OutputError(hr, IDS_SAFE_COPY);
00170     SeenDialogNames = TRUE;
00171 }
00172
00173
00174 /* build a new complist by querying the user for two directory
00175  * names and scanning those in parallel.
00176  *
00177  * names that match in the same directory will be paired. unmatched
00178  * names will go in a compitem on their own.
00179  */
00180 COMPLIST
00181 complist_dirdialog(VIEW view)
00182 {
00183     DLGPROC lpProc;
00184     BOOL fOK;
00185
00186     /* put up a dialog for the two pathnames */
00187     lpProc = (DLGPROC)MakeProcInstance((WINPROCTYPE)complist_dodlg_dir, hInst);
00188     sdkdiff_UI(TRUE);
00189     fOK = (BOOL)DialogBox(hInst, "Directory", hwndClient, lpProc);
00190     sdkdiff_UI(FALSE);
00191     FreeProcInstance(lpProc);
00192
00193     if (!fOK) {
00194         return(NULL);
00195     }
00196
00197     return complist_args( dialog_leftname, dialog_rightname
00198                           , view, dialog_recursive );
00199 } /* complist_dirdialog */
00200
00201
00202 /*
00203  * given two pathname strings, scan the directories and traverse them
00204  * in parallel comparing matching names.
00205  */
00206 COMPLIST
00207 complist_args(LPSTR p1, LPSTR p2, VIEW view, BOOL fDeep)
00208 {
00209     COMPLIST cl;
00210     char msg[MAX_PATH+20];
00211   HRESULT hr;
00212
00213     /* alloc a new complist */
00214     cl = complist_new();
00215
00216     //
00217     // accept \\server!path for a checksum server and
00218     // pathname - assumes no \\server\share names have !
00219     // within the server name.
00220     {
00221         cl->left = dir_buildlist(p1, FALSE, TRUE);
00222     }
00223     /* check that we could find the paths, and report if not */
00224     if (cl->left == NULL) {
00225         hr = StringCchPrintf(msg, (MAX_PATH+20), LoadRcString(IDS_COULDNT_FIND), p1);
00226     if (FAILED(hr))
00227       OutputError(hr, IDS_SAFE_PRINTF);
00228         TRACE_ERROR(msg, FALSE);
00229         complist_delete(cl);
00230         cl = NULL;
00231         goto LError;
00232     }
00233     {
00234         cl->right = dir_buildlist(p2, FALSE, TRUE);
00235     }
00236     /* check that we could find the paths, and report if not */
00237     if (cl->right == NULL) {
00238         hr = StringCchPrintf(msg, (MAX_PATH+20), LoadRcString(IDS_COULDNT_FIND), p2);
00239     if (FAILED(hr))
00240       OutputError(hr, IDS_SAFE_PRINTF);
00241         TRACE_ERROR(msg, FALSE);
00242         complist_delete(cl);
00243         cl = NULL;
00244         goto LError;
00245     }
00246
00247     if (!TrackLeftOnly) {
00248         dir_setotherdirlist(cl->left, cl->right);
00249     }
00250     if (!TrackRightOnly) {
00251         dir_setotherdirlist(cl->right, cl->left);
00252     }
00253     {
00254         // remember these paths as defaults for the next dialog -
00255         // get the normalised, absolute paths
00256         LPSTR pleft = dir_getrootdescription(cl->left);
00257         LPSTR pright = dir_getrootdescription(cl->right);
00258         complist_setdialogdefault(pleft, pright, fDeep);
00259         dir_freerootdescription(cl->left, pleft);
00260         dir_freerootdescription(cl->right, pright);
00261     }
00262
00263
00264     /* register with the view (must be done after building lists) */
00265     view_setcomplist(view, cl);
00266
00267     complist_match(cl, view, fDeep, TRUE);
00268
00269 LError:
00270     return(cl);
00271 } /* complist_args */
00272
00273 /*
00274  * given two pathname strings, scan the directories and traverse them
00275  * in parallel comparing matching names.
00276  */
00277 void
00278 complist_append(COMPLIST *pcl, LPCSTR p1, LPCSTR p2, int *psequence)
00279 {
00280     COMPLIST cl;
00281
00282     if (!*pcl)
00283     {
00284         /* alloc a new complist */
00285         *pcl = complist_new();
00286     }
00287     cl = *pcl;
00288
00289     dir_appendlist(&cl->left, p1, FALSE, psequence);
00290     dir_appendlist(&cl->right, p2, FALSE, psequence);
00291 } /* complist_append */
00292
00293 /*
00294  * finished appending files -- set custom descriptions (instead of calculating
00295  * them based on directory names), register with view, and match the left and
00296  * right sides of the complist.
00297  */
00298 BOOL
00299 complist_appendfinished(COMPLIST *pcl, LPCSTR pszLeft, LPCSTR pszRight, VIEW view)
00300 {
00301     BOOL fSuccess = FALSE;
00302     COMPLIST cl;
00303     char msg[MAX_PATH+20] = {0};
00304   HRESULT hr;
00305
00306     if (!*pcl)
00307         goto LError;
00308
00309     cl = *pcl;
00310     if (!cl->left || !cl->right)
00311     {
00312         hr = StringCchCatN(msg, (MAX_PATH+20), LoadRcString(IDS_COULDNT_FIND_ANYTHING), sizeof(msg)-1);
00313     if (FAILED(hr))
00314       OutputError(hr, IDS_SAFE_CAT);
00315         TRACE_ERROR(msg, FALSE);
00316         goto LError;
00317     }
00318
00319     dir_setdescription(cl->left, pszLeft);
00320     dir_setdescription(cl->right, pszRight);
00321
00322     if (!TrackLeftOnly)
00323         dir_setotherdirlist(cl->left, cl->right);
00324     if (!TrackRightOnly)
00325         dir_setotherdirlist(cl->right, cl->left);
00326
00327     /* register with the view (must be done after building lists) */
00328     view_setcomplist(view, cl);
00329
00330     complist_match(cl, view, FALSE, TRUE);
00331
00332     fSuccess = TRUE;
00333
00334 LError:
00335     return fSuccess;
00336 }
00337
00338 /*
00339  * return a handle to the list of compitems in this complist
00340  */
00341 LIST
00342 complist_getitems(COMPLIST cl)
00343 {
00344     if (cl == NULL) {
00345         return(NULL);
00346     }
00347
00348     return(cl->items);
00349 }
00350
00351
00352 /* delete a complist and all associated compitems and dirlists
00353  */
00354 void
00355 complist_delete(COMPLIST cl)
00356 {
00357     COMPITEM item;
00358
00359     if (cl == NULL) {
00360         return;
00361     }
00362
00363     /* delete the two directory scan lists */
00364     dir_delete(cl->left);
00365     dir_delete(cl->right);
00366
00367     /* delete the compitems in the list */
00368   for( item=(COMPITEM)List_First(cl->items);  item!=NULL;  item = (COMPITEM)List_Next((LPVOID)item)) {
00369         compitem_delete(item);
00370     }
00371
00372     /* delete the list itself */
00373     List_Destroy(&cl->items);
00374
00375     HeapFree(GetProcessHeap(), NULL, (LPSTR) cl);
00376
00377 }
00378
00379 /*
00380  * write out to a text file the list of compitems as relative filenames
00381  * one per line.
00382  *
00383  * if savename is non-null, use this as the filename for output. otherwise
00384  * query the user via a dialog for the filename and include options.
00385  *
00386  * There are hidden parameters (dlg_sums etc) from the dialog.
00387  * Note that we never attempt to recalculate sums.
00388  */
00389 void
00390 complist_savelist(COMPLIST cl, LPSTR savename, UINT options)
00391 {
00392     DLGPROC lpProc;
00393     static BOOL done_init = FALSE;
00394     BOOL bOK;
00395     HANDLE fh;
00396     DWORD cbWritten;
00397     int state;
00398     char msg[2*MAX_PATH+100] = {0};
00399     HCURSOR hcurs;
00400     COMPITEM ci;
00401     LPSTR pstr, lhead;
00402     int nFiles = 0;
00403   HRESULT hr;
00404
00405     if (!done_init) {
00406         /* init the options once round - but keep the same options
00407          * for the rest of the session.
00408          */
00409
00410         /* first init default options */
00411         dlg_identical = (outline_include & INCLUDE_SAME);
00412         dlg_differ = (outline_include & INCLUDE_LEFTONLY);
00413         dlg_left = (outline_include & INCLUDE_RIGHTONLY);
00414         dlg_right = (outline_include & INCLUDE_DIFFER);
00415         dlg_IgnoreMarks = hide_markedfiles;
00416
00417         dlg_file[0] = '\0';
00418
00419         done_init = TRUE;
00420     }
00421
00422     if (cl == NULL) {
00423         return;
00424     }
00425
00426     if (savename == NULL) {
00427
00428         /* store the left and right rootnames so that dodlg_savelist
00429          * can display them in the dialog.
00430          */
00431         pstr = dir_getrootdescription(cl->left);
00432         hr = StringCchCopy(dialog_leftname, MAX_PATH, pstr);
00433     if (FAILED(hr))
00434       OutputError(hr, IDS_SAFE_COPY);
00435         dir_freerootdescription(cl->left, pstr);
00436
00437         pstr = dir_getrootdescription(cl->right);
00438         hr = StringCchCopy(dialog_rightname, MAX_PATH, pstr);
00439     if (FAILED(hr))
00440       OutputError(hr, IDS_SAFE_COPY);
00441         dir_freerootdescription(cl->right, pstr);
00442
00443
00444         lpProc = (DLGPROC)MakeProcInstance((WINPROCTYPE)complist_dodlg_savelist, hInst);
00445         sdkdiff_UI(TRUE);
00446         bOK = (BOOL)DialogBox(hInst, "SaveList", hwndClient, lpProc);
00447         sdkdiff_UI(FALSE);
00448         FreeProcInstance(lpProc);
00449
00450         if (!bOK) {
00451             /* user cancelled from dialog box */
00452             return;
00453         }
00454         savename = dlg_file;
00455
00456     } else {
00457         dlg_identical = (options & INCLUDE_SAME);
00458         dlg_differ = (options & INCLUDE_DIFFER);
00459         dlg_left = (options & INCLUDE_LEFTONLY);
00460         dlg_right = (options & INCLUDE_RIGHTONLY);
00461         GetFullPathName(savename, sizeof(dlg_file), dlg_file, NULL);
00462     }
00463
00464
00465     /* try to open the file */
00466     fh = CreateFile(savename, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL);
00467     if (fh == INVALID_HANDLE_VALUE) {
00468         hr = StringCchPrintf(msg, (2*MAX_PATH+100),LoadRcString(IDS_CANT_OPEN), savename);
00469         if (FAILED(hr))
00470       OutputError(hr, IDS_SAFE_PRINTF);
00471     sdkdiff_UI(TRUE);
00472         MessageBox(hwndClient, msg, "Sdkdiff", MB_ICONSTOP|MB_OK);
00473         sdkdiff_UI(FALSE);
00474         return;
00475     }
00476
00477     hcurs = SetCursor(LoadCursor(NULL, IDC_WAIT));
00478
00479     /* write out the header line */
00480     lhead = complist_getdescription(cl);
00481     {
00482         TCHAR szBuf1[20],szBuf2[20],szBuf3[20],szBuf4[20];
00483         hr = StringCchCopy(szBuf1,20,(LPSTR)(dlg_identical ? LoadRcString(IDS_IDENTICAL_COMMA) : ""));
00484     if(FAILED(hr))
00485       OutputError(hr, IDS_SAFE_COPY);
00486         hr = StringCchCopy(szBuf2,20,(LPSTR)(dlg_left ? LoadRcString(IDS_LEFT_ONLY_COMMA) : ""));
00487         if(FAILED(hr))
00488       OutputError(hr, IDS_SAFE_COPY);
00489     hr = StringCchCopy(szBuf3,20,(LPSTR)(dlg_right ? LoadRcString(IDS_RIGHT_ONLY_COMMA) : ""));
00490         if(FAILED(hr))
00491       OutputError(hr, IDS_SAFE_COPY);
00492     hr = StringCchCopy(szBuf4,20,(LPSTR)(dlg_differ ? LoadRcString(IDS_DIFFERING) : ""));
00493         if(FAILED(hr))
00494       OutputError(hr, IDS_SAFE_COPY);
00495     hr = StringCchPrintf(msg, (2*MAX_PATH+100), LoadRcString(IDS_HEADER_LINE_STR),
00496                 lhead, szBuf1, szBuf2, szBuf3, szBuf4);
00497     if(FAILED(hr))
00498       OutputError(hr, IDS_SAFE_PRINTF);
00499     }
00500     WriteFile(fh, msg, lstrlen(msg), &cbWritten, NULL);
00501     complist_freedescription(cl, lhead);
00502
00503
00504     /* traverse the list of compitems looking for the
00505      * ones we are supposed to include
00506      */
00507     for( ci=(COMPITEM)List_First(cl->items);  ci!=NULL;  ci = (COMPITEM)List_Next((LPVOID)ci)) {
00508         /* check if files of this type are to be listed */
00509         state = compitem_getstate(ci);
00510
00511         if ((state == STATE_SAME) && (!dlg_identical)) {
00512             continue;
00513         } else if ((state == STATE_DIFFER) && (!dlg_differ)) {
00514             continue;
00515         } else if ((state == STATE_FILELEFTONLY) && (!dlg_left)) {
00516             continue;
00517         } else if ((state == STATE_FILERIGHTONLY) && (!dlg_right)) {
00518             continue;
00519         }
00520         if (dlg_IgnoreMarks && compitem_getmark(ci)) {
00521             continue;
00522         }
00523
00524         nFiles++;
00525
00526         /* output the list line */
00527         ZeroMemory(msg, sizeof(msg));
00528         hr = StringCchCatN(msg, (2*MAX_PATH+100), compitem_gettext_tag(ci), sizeof(msg) - 1);
00529         if(FAILED(hr))
00530       OutputError(hr, IDS_SAFE_CAT);
00531     WriteFile(fh, msg, lstrlen(msg), &cbWritten, NULL);
00532
00533         /* write out the result of the comparison */
00534         {       LPSTR p;
00535             p = compitem_gettext_result(ci);
00536             hr = StringCchPrintf( msg, (2*MAX_PATH+100), "\t%s"
00537                       , p ? p : "sdkdiff error"
00538                     );
00539       if(FAILED(hr))
00540         OutputError(hr, IDS_SAFE_PRINTF);
00541         }
00542         WriteFile(fh, msg, lstrlen(msg), &cbWritten, NULL);
00543
00544         if (dlg_sums) {
00545             if (compitem_getleftfile(ci) != NULL) {
00546                 BOOL bValid;
00547                 DWORD cksum;
00548                 cksum = file_retrievechecksum(compitem_getleftfile(ci),&bValid);
00549
00550         if (bValid) {
00551           hr = StringCchPrintf(msg, (2*MAX_PATH+100), "\t%8lx", cksum);
00552           if (FAILED(hr))
00553             OutputError(hr, IDS_SAFE_PRINTF);
00554         }
00555         else {
00556           hr = StringCchPrintf(msg, (2*MAX_PATH+100), "\t????????");
00557           if(FAILED(hr))
00558             OutputError(hr, IDS_SAFE_PRINTF);
00559         }
00560             } else {
00561                 hr = StringCchPrintf(msg, (2*MAX_PATH+100), "\t--------");
00562         if(FAILED(hr))
00563           OutputError(hr, IDS_SAFE_PRINTF);
00564             }
00565             WriteFile(fh, msg, lstrlen(msg), &cbWritten, NULL);
00566
00567             if (compitem_getrightfile(ci) != NULL) {
00568                 BOOL bValid;
00569                 DWORD cksum;
00570                 cksum = file_retrievechecksum(compitem_getrightfile(ci),&bValid);
00571         if (bValid) {
00572           hr = StringCchPrintf(msg, (2*MAX_PATH+100), "\t%8lx", cksum);
00573           if(FAILED(hr))
00574             OutputError(hr, IDS_SAFE_PRINTF);
00575         }
00576         else {
00577           hr = StringCchPrintf(msg, (2*MAX_PATH+100), "\t????????");
00578           if(FAILED(hr))
00579             OutputError(hr, IDS_SAFE_PRINTF);
00580         }
00581             } else {
00582                 hr = StringCchPrintf(msg, (2*MAX_PATH+100), "\t--------");
00583         if(FAILED(hr))
00584           OutputError(hr, IDS_SAFE_PRINTF);
00585             }
00586             WriteFile(fh, msg, lstrlen(msg), &cbWritten, NULL);
00587
00588         }
00589
00590         hr = StringCchPrintf(msg, (2*MAX_PATH+100), "\r\n");
00591     if(FAILED(hr))
00592       OutputError(hr, IDS_SAFE_PRINTF);
00593         WriteFile(fh, msg, (DWORD)strlen(msg), &cbWritten, NULL);
00594   }
00595
00596     /* write tail line */
00597     hr = StringCchPrintf(msg, (2*MAX_PATH+100), LoadRcString(IDS_FILES_LISTED), nFiles);
00598   if(FAILED(hr))
00599       OutputError(hr, IDS_SAFE_PRINTF);
00600     WriteFile(fh, msg, (DWORD)lstrlen(msg), &cbWritten, NULL);
00601
00602     /* - close file and we are finished */
00603     CloseHandle(fh);
00604
00605     SetCursor(hcurs);
00606 } /* complist_savelist */
00607
00608 /*
00609  * copy files to a new directory newroot. if newroot is NULL, query the user
00610  * via a dialog to get the new dir name and options.
00611  *
00612  * options are either COPY_FROMLEFT or COPY_FROMRIGHT (indicating which
00613  * tree is to be the source of the files, plus any or all of
00614  * INCLUDE_SAME, INCLUDE_DIFFER and INCLUDE_LEFT (INCLUDE_LEFT
00615  * and INCLUDE_RIGHT are treated the same here since the COPY_FROM* option
00616  * indicates which side to copy from).
00617  */
00618 void
00619 complist_copyfiles(COMPLIST cl, LPSTR newroot, UINT options)
00620 {
00621     int nFiles = 0;
00622     int nFails = 0;
00623     static BOOL done_init = FALSE;
00624     LPSTR pstr;
00625     char buffer[MAX_PATH+20];
00626     DIRITEM diritem;
00627     DLGPROC lpProc;
00628     BOOL bOK;
00629     COMPITEM ci;
00630     int state;
00631     BOOL HitReadOnly = ((options&COPY_HITREADONLY)==COPY_HITREADONLY);
00632     BOOL CopyNoAttributes;
00633   HRESULT hr;
00634
00635     if (!done_init) {
00636         /*
00637          * one-time initialisation of dialog defaults
00638          */
00639         dlg_options = COPY_FROMLEFT|INCLUDE_LEFTONLY|INCLUDE_DIFFER;
00640         dlg_root[0] = '\0';
00641
00642         // set the ignore-marked files option by default the same
00643         // as the hide mark files menu option. If he doesn't want them
00644         // visible, he probably doesn't want them copied.
00645         dlg_IgnoreMarks = hide_markedfiles;
00646
00647         done_init = TRUE;
00648     }
00649
00650     if (cl == NULL) {
00651         return;
00652     }
00653
00654
00655     if (newroot == NULL) {
00656         /*
00657          * put up dialog to query rootname and options
00658          */
00659
00660         /* store the left and right rootnames so that the dlg proc
00661          * can display them in the dialog.
00662          */
00663         pstr = dir_getrootdescription(cl->left);
00664         hr = StringCchCopy(dialog_leftname, MAX_PATH, pstr);
00665     if(FAILED(hr))
00666       OutputError(hr, IDS_SAFE_COPY);
00667         dir_freerootdescription(cl->left, pstr);
00668
00669         pstr = dir_getrootdescription(cl->right);
00670         hr = StringCchCopy(dialog_rightname, MAX_PATH, pstr);
00671         if(FAILED(hr))
00672       OutputError(hr, IDS_SAFE_COPY);
00673     dir_freerootdescription(cl->right, pstr);
00674
00675
00676         do {
00677             lpProc = (DLGPROC)MakeProcInstance((WINPROCTYPE)complist_dodlg_copyfiles, hInst);
00678             sdkdiff_UI(TRUE);
00679             bOK = (BOOL)DialogBox(hInst, "CopyFiles", hwndClient, lpProc);
00680             sdkdiff_UI(FALSE);
00681             FreeProcInstance(lpProc);
00682
00683             if (!bOK) {
00684                 /* user cancelled from dialog box */
00685                 return;
00686             }
00687             if (lstrlen(dlg_root) == 0) {
00688                 sdkdiff_UI(TRUE);
00689                 MessageBox( hwndClient, LoadRcString(IDS_ENTER_DIR_NAME),
00690                             "Sdkdiff", MB_ICONSTOP|MB_OK);
00691                 sdkdiff_UI(FALSE);
00692             }
00693         } while (lstrlen(dlg_root) == 0);
00694
00695     } else {
00696         // no dialog - all options passed in (eg from command line).
00697         // note that in this case the dlg_IgnoreMarks is left as
00698         // whatever the hide_markedfiles menu option is set to.
00699         dlg_options = options;
00700         hr = StringCchCopy(dlg_root, MAX_PATH, newroot);
00701     if(FAILED(hr))
00702       OutputError(hr, IDS_SAFE_COPY);
00703     }
00704
00705     TickCount = GetTickCount();
00706
00707     /* this relies on the sumserver, server and share (if any) being the same for
00708        all the things on the list.  We set up the first one and then just check
00709        that it doesn't change (within ss_client).  If it turns out to be a local
00710        copy these things turn into no-ops somewhere below us.
00711     */
00712     if (dlg_options & COPY_FROMLEFT) {
00713         if (!dir_startcopy(cl->left))
00714             return;
00715     } else {
00716         if (!dir_startcopy(cl->right))
00717             return;
00718     }
00719
00720     CopyNoAttributes = dlg_IgnoreAttributes;
00721
00722     /*
00723      * traverse the list of compitems copying files as necessary
00724      */
00725     for( ci=(COMPITEM)List_First(cl->items);  ci!=NULL;  ci = (COMPITEM)List_Next((LPVOID)ci)) {
00726         if (bAbort) {
00727             break;  /* fall into end_copy processing */
00728         }
00729
00730         // ignore marked files totally if the option was
00731         // set in the dialog.
00732         if (dlg_IgnoreMarks && compitem_getmark(ci)) {
00733             continue;
00734         }
00735
00736         /* check if files of this type are to be copied */
00737         state = compitem_getstate(ci);
00738
00739         if ((state == STATE_SAME) && !(dlg_options & INCLUDE_SAME)) {
00740             continue;
00741         } else if ((state == STATE_DIFFER) && !(dlg_options & INCLUDE_DIFFER)) {
00742             continue;
00743         } else if (state == STATE_FILELEFTONLY) {
00744             if (dlg_options & COPY_FROMRIGHT) {
00745                 continue;
00746             }
00747             if ((dlg_options & (INCLUDE_LEFTONLY | INCLUDE_RIGHTONLY)) == 0) {
00748                 continue;
00749             }
00750         } else if (state == STATE_FILERIGHTONLY) {
00751             if (dlg_options & COPY_FROMLEFT) {
00752                 continue;
00753             }
00754             if ((dlg_options & (INCLUDE_LEFTONLY | INCLUDE_RIGHTONLY)) == 0) {
00755                 continue;
00756             }
00757         }
00758
00759         if (dlg_options & COPY_FROMLEFT) {
00760             diritem = file_getdiritem(compitem_getleftfile(ci));
00761         } else {
00762             diritem = file_getdiritem(compitem_getrightfile(ci));
00763         }
00764
00765         /*
00766          * copy the file to the new root directory
00767          */
00768         if (dir_copy(diritem, dlg_root, HitReadOnly, CopyNoAttributes) == FALSE) {
00769             nFails++;
00770             pstr = dir_getrelname(diritem);
00771             hr = StringCchPrintf(buffer, (MAX_PATH+20), LoadRcString(IDS_FAILED_TO_COPY), pstr);
00772       if(FAILED(hr))
00773         OutputError(hr, IDS_SAFE_PRINTF);
00774             dir_freerelname(diritem, pstr);
00775
00776             if (!TRACE_ERROR(buffer, TRUE)) {
00777                 /* user pressed cancel - abort current operation*/
00778                 /* fall through to end-copy processing */
00779                 break;
00780             }
00781
00782         } else {
00783             nFiles++;
00784         }
00785
00786         hr = StringCchPrintf(buffer, (MAX_PATH+20), LoadRcString(IDS_COPYING), nFiles);
00787     if(FAILED(hr))
00788       OutputError(hr, IDS_SAFE_PRINTF);
00789         SetStatus(buffer);
00790
00791
00792         /*
00793          * allow user interface to continue
00794          */
00795         if (Poll()) {
00796             /* abort requested */
00797             TickCount = GetTickCount()-TickCount;
00798             sdkdiff_UI(TRUE);
00799             MessageBox(hwndClient, LoadRcString(IDS_COPY_ABORTED),
00800                        "SdkDiff", MB_OK|MB_ICONINFORMATION);
00801             sdkdiff_UI(FALSE);
00802             break;
00803         }
00804
00805     } /* traverse */
00806     hr = StringCchPrintf(buffer, (MAX_PATH+20), LoadRcString(IDS_COPYING_NFILES), nFiles);
00807   if(FAILED(hr))
00808     OutputError(hr, IDS_SAFE_PRINTF);
00809     SetStatus(buffer);
00810     if (dlg_options & COPY_FROMLEFT) {
00811         nFails = dir_endcopy(cl->left);
00812     } else {
00813         nFails = dir_endcopy(cl->right);
00814     }
00815     TickCount = GetTickCount()-TickCount;
00816
00817     if (nFails<0) {
00818         hr = StringCchPrintf(buffer, (MAX_PATH+20), LoadRcString(IDS_COPY_FAILED), -nFails);
00819     if(FAILED(hr))
00820       OutputError(hr, IDS_SAFE_PRINTF);
00821     } else {
00822         hr = StringCchPrintf(buffer, (MAX_PATH+20), LoadRcString(IDS_COPY_COMPLETE), nFails);
00823     if(FAILED(hr))
00824       OutputError(hr, IDS_SAFE_PRINTF);
00825     }
00826     sdkdiff_UI(TRUE);
00827     MessageBox(hwndClient, buffer, "SdkDiff", MB_OK|MB_ICONINFORMATION);
00828     sdkdiff_UI(FALSE);
00829
00830     buffer[0] = '\0';
00831     SetStatus(buffer);
00832 } /* complist_copyfiles */
00833
00834
00835 /*
00836  * complist_togglemark
00837  *
00838  * each compitem has a BOOL mark state. This function inverts the value of
00839  * this state for each compitem in the list.
00840  */
00841 void
00842 complist_togglemark(COMPLIST cl)
00843 {
00844     COMPITEM ci;
00845
00846     if (cl == NULL) {
00847         return;
00848     }
00849
00850
00851     /*
00852      * traverse the list of compitems copying files as necessary
00853      */
00854     for( ci=(COMPITEM)List_First(cl->items);  ci!=NULL;  ci = (COMPITEM)List_Next((LPVOID)ci)) {
00855         compitem_setmark(ci, !compitem_getmark(ci));
00856
00857     }
00858 }
00859
00860 /*
00861  * complist_itemcount
00862  *
00863  * return the number of items in the list
00864  */
00865 UINT
00866 complist_itemcount(COMPLIST cl)
00867 {
00868     UINT n = 0;
00869
00870     if (cl == NULL) {
00871         return 0;
00872     }
00873
00874     /*
00875      * return the number of compitems in the list
00876      */
00877     return List_Card(cl->items);
00878 }
00879
00880 #ifdef USE_REGEXP
00881     #include "regexp.h"
00882
00883 /*
00884  * query the user for a pattern to match.
00885  * all compitems with this pattern in their tag string will be
00886  * marked (the mark state will be set to TRUE);
00887  *
00888  * returns TRUE if any states changed
00889  */
00890 BOOL
00891 complist_markpattern(COMPLIST cl)
00892 {
00893     COMPITEM ci;
00894     char achPattern[MAX_PATH];
00895     BOOL bOK = FALSE;
00896     LPSTR ptag;
00897   HRESULT hr;
00898
00899     regexp  *prog;
00900     static  char    previous_pat[256]; /* allow for a big pattern ! */
00901     static  BOOL    fInit = TRUE;
00902     TCHAR   szBuff[40];
00903
00904     hr = StringCchCopy(szBuff, 40, LoadRcString(IDS_MARK_FILES));
00905   if(FAILED(hr))
00906     OutputError(hr, IDS_SAFE_COPY);
00907
00908     sdkdiff_UI(TRUE);
00909     if ( fInit ) {
00910         GetProfileString(APPNAME, "Pattern", "\\.obj$", previous_pat, 256);
00911         fInit = FALSE;
00912     }
00913
00914     bOK = StringInput(achPattern, sizeof(achPattern),
00915                       LoadRcString(IDS_ENTER_SUBSTRING1),
00916                       szBuff, previous_pat );
00917     sdkdiff_UI(FALSE);
00918
00919     if (!bOK) {
00920         return(FALSE);
00921     }
00922
00923     /*
00924     ** Compile the specified regular expression
00925     */
00926     if ((prog = regcomp(achPattern)) == NULL) {
00927         return(FALSE);
00928     }
00929
00930     /*
00931     ** only overwrite previous pattern with a known good pattern
00932     */
00933     hr = StringCchCopy( previous_pat, 256, achPattern );
00934   if(FAILED(hr))
00935     OutputError(hr, IDS_SAFE_COPY);
00936     WriteProfileString(APPNAME, "Pattern", previous_pat);
00937
00938     bOK = FALSE;
00939
00940     if (cl) {
00941     for( ci=(COMPITEM)List_First(cl->items);  ci!=NULL;  ci = (COMPITEM)List_Next((LPVOID)ci)) {
00942             ptag = compitem_gettext_tag(ci);
00943             if ( regexec( prog, ptag, 0 ) ) {  /* got a match */
00944                 if (!compitem_getmark(ci)) {
00945                     bOK = TRUE;
00946                     compitem_setmark(ci, TRUE);
00947                 }
00948             }
00949         }
00950     }
00951
00952     /*
00953     ** regcomp allocates storage with malloc, now is a good time to free
00954     ** this storage as we have finished with the program.
00955     */
00956     free( prog );
00957
00958     return(bOK);
00959 }
00960
00961 /*
00962  * here would go a message box saying that the regexp fail for some reason.
00963  *
00964  */
00965 void regerror( char *err )
00966 {
00967 }
00968
00969 #else
00970
00971 /*
00972  * query the user for a pattern to match.
00973  * all compitems with this pattern in their tag string will be
00974  * marked (the mark state will be set to TRUE);
00975  *
00976  * returns TRUE if any states changed
00977  */
00978 BOOL
00979 complist_markpattern(COMPLIST cl)
00980 {
00981     COMPITEM ci;
00982     char achPattern[MAX_PATH];
00983     BOOL bOK = FALSE;
00984     LPSTR ptag;
00985     TCHAR   szBuff[40];
00986
00987     HRESULT hr = StringCchCopy(szBuff,40, LoadRcString(IDS_MARK_FILES));
00988   if(FAILED(hr))
00989       OutputError(hr, IDS_SAFE_COPY);
00990
00991     sdkdiff_UI(TRUE);
00992     bOK = StringInput(achPattern, sizeof(achPattern), LoadRcString(IDS_ENTER_SUBSTRING2),
00993             szBuff, "obj");
00994     sdkdiff_UI(FALSE);
00995
00996     if (!bOK) {
00997         return(FALSE);
00998     }
00999
01000     bOK = FALSE;
01001
01002
01003   for( ci=(COMPITEM)List_First(cl->items);  ci!=NULL;  ci = (COMPITEM)List_Next((LPVOID)ci)) {
01004         ptag = compitem_gettext_tag(ci);
01005         if (strstr(ptag, achPattern) != NULL) {
01006             if (!compitem_getmark(ci)) {
01007                 bOK = TRUE;
01008                 compitem_setmark(ci, TRUE);
01009             }
01010
01011         }
01012     }
01013
01014     return(bOK);
01015 }
01016 #endif
01017
01018
01019
01020 /*
01021  * return a description string for this complist, using
01022  * the rootdescription for each of the two paths
01023  */
01024 LPSTR
01025 complist_getdescription(COMPLIST cl)
01026 {
01027     LPSTR pl;
01028     LPSTR pr;
01029     LPSTR desc = 0;
01030
01031
01032     pl = dir_getrootdescription(cl->left);
01033     pr = dir_getrootdescription(cl->right);
01034
01035     if (pl && pr)
01036     {
01037         /*
01038          * allow for space-colon-space and null when sizing
01039          */
01040         desc = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lstrlen(pl) + lstrlen(pr) + 4);
01041         if (desc == NULL)
01042       return NULL;
01043     HRESULT hr = StringCchPrintf(desc, (lstrlen(pl)+lstrlen(pr)+4), "%s : %s", pl, pr);
01044     if(FAILED(hr)) {
01045       OutputError(hr, IDS_SAFE_PRINTF);
01046       return NULL;
01047     }
01048     }
01049
01050     dir_freerootdescription(cl->left, pl);
01051     dir_freerootdescription(cl->right, pr);
01052
01053     return(desc);
01054 }
01055
01056
01057 /*
01058  *  free up a description string obtained from complist_getdescription
01059  */
01060 void
01061 complist_freedescription(COMPLIST cl, LPSTR desc)
01062 {
01063     HeapFree(GetProcessHeap(), NULL, desc);
01064 }
01065
01066
01067
01068
01069
01070 /* --- internal functions --------------------------------------------*/
01071
01072 /*
01073  * match up two lists of filenames
01074  *
01075  * we can find out from the DIRLIST handle whether the original list
01076  * was a file or a directory name.
01077  * If the user typed:
01078  *      two file names  - match these two item even if the names differ
01079  *
01080  *      two dirs        - match only those items whose names match
01081  *
01082  *      one file and one dir
01083  *                      - try to find a file of that name in the dir.
01084  *
01085  * returns TRUE if the complist_match was ok, or FALSE if it was
01086  * aborted in some way.
01087  */
01088 BOOL
01089 complist_match(COMPLIST cl, VIEW view, BOOL fDeep, BOOL fExact)
01090 {
01091     LPSTR lname;
01092     LPSTR rname;
01093     DIRITEM leftitem, rightitem;
01094     DIRITEM nextitem;
01095     int cmpvalue;
01096
01097     TickCount = GetTickCount();
01098
01099     if (dir_isfile(cl->left) ) {
01100
01101         if (dir_isfile(cl->right)) {
01102             /* two files */
01103
01104             /* there should be one item in each list - make
01105              * a compitem by matching these two and append it to the
01106              * list
01107              */
01108             compitem_new(dir_firstitem(cl->left),
01109                          dir_firstitem(cl->right),
01110                          cl->items, fExact);
01111
01112             view_newitem(view);
01113
01114             TickCount = GetTickCount() - TickCount;
01115             return TRUE;
01116         }
01117         /* left is file, right is dir */
01118         leftitem = dir_firstitem(cl->left);
01119         rightitem = dir_firstitem(cl->right);
01120         lname = dir_getrelname(leftitem);
01121         while (rightitem != NULL) {
01122             rname = dir_getrelname(rightitem);
01123             cmpvalue = lstrcmpi(lname, rname);
01124             dir_freerelname(rightitem, rname);
01125
01126             if (cmpvalue == 0) {
01127                 /* this is the match */
01128                 compitem_new( leftitem, rightitem
01129                               , cl->items, fExact);
01130                 view_newitem(view);
01131
01132                 dir_freerelname(leftitem, lname);
01133
01134                 TickCount = GetTickCount() - TickCount;
01135                 return(TRUE);
01136             }
01137
01138             rightitem = dir_nextitem(cl->right, rightitem, fDeep);
01139         }
01140         /* not found */
01141         dir_freerelname(leftitem, lname);
01142         compitem_new(leftitem, NULL, cl->items, fExact);
01143         view_newitem(view);
01144         TickCount = GetTickCount() - TickCount;
01145         return(TRUE);
01146
01147     } else if (dir_isfile(cl->right)) {
01148
01149         /* left is dir, right is file */
01150
01151         /* loop through the left dir, looking for
01152          * a file that has the same name as rightitem
01153          */
01154
01155         leftitem = dir_firstitem(cl->left);
01156         rightitem = dir_firstitem(cl->right);
01157         rname = dir_getrelname(rightitem);
01158         while (leftitem != NULL) {
01159             lname = dir_getrelname(leftitem);
01160             cmpvalue = lstrcmpi(lname, rname);
01161             dir_freerelname(leftitem, lname);
01162
01163             if (cmpvalue == 0) {
01164                 /* this is the match */
01165                 compitem_new(leftitem, rightitem
01166                              , cl->items, fExact);
01167                 view_newitem(view);
01168
01169                 dir_freerelname(rightitem, rname);
01170
01171                 TickCount = GetTickCount() - TickCount;
01172                 return(TRUE);
01173             }
01174
01175             leftitem = dir_nextitem(cl->left, leftitem, fDeep);
01176         }
01177         /* not found */
01178         dir_freerelname(rightitem, rname);
01179         compitem_new(NULL, rightitem, cl->items, fExact);
01180         view_newitem(view);
01181         TickCount = GetTickCount() - TickCount;
01182         return(TRUE);
01183     }
01184
01185     /* two directories */
01186
01187     /* traverse the two lists in parallel comparing the relative names*/
01188
01189     leftitem = dir_firstitem(cl->left);
01190     rightitem = dir_firstitem(cl->right);
01191     while ((leftitem != NULL) && (rightitem != NULL)) {
01192
01193         lname = dir_getrelname(leftitem);
01194         rname = dir_getrelname(rightitem);
01195         if (!dir_compsequencenumber(leftitem, rightitem, &cmpvalue))
01196         {
01197             if (dir_iswildcard(cl->left) && dir_iswildcard(cl->right))
01198                 cmpvalue = dir_compwildcard(cl->left, cl->right, lname, rname);
01199             else
01200                 cmpvalue = utils_CompPath(lname, rname);
01201         }
01202
01203 #ifdef trace
01204         {
01205       char msg[2*MAX_PATH+30];
01206             hr = StringCchPrintf( msg, (2*MAX_PATH+30), "complist_match: %s %s %s\n"
01207                       , lname
01208                       , ( cmpvalue<0 ? "<"
01209                           : (cmpvalue==0 ? "=" : ">")
01210                         )
01211                       , rname
01212                     );
01213       if(FAILED(hr))
01214         OutputError(hr, IDS_SAFE_PRINTF);
01215             if (bTrace) Trace_File(msg);
01216         }
01217 #endif
01218         dir_freerelname(leftitem, lname);
01219         dir_freerelname(rightitem, rname);
01220
01221         if (cmpvalue == 0) {
01222             BOOL trackThese = TrackSame || TrackDifferent;
01223             if (!TrackReadonly) {
01224                 BOOL bothReadonly = (BOOL)((dir_getattr(leftitem) &
01225                                             dir_getattr(rightitem) &
01226                                             FILE_ATTRIBUTE_READONLY) != 0);
01227                 if (bothReadonly) {
01228                     trackThese = FALSE;
01229                 }
01230             }
01231             if (trackThese) {
01232                 compitem_new( leftitem, rightitem
01233                               , cl->items, fExact);
01234                 if (view_newitem(view)) {
01235                     TickCount = GetTickCount() - TickCount;
01236                     return(FALSE);
01237                 }
01238                 leftitem = dir_nextitem(cl->left, leftitem, fDeep);
01239                 rightitem = dir_nextitem(cl->right, rightitem, fDeep);
01240             } else {
01241                 nextitem = dir_nextitem(cl->left, leftitem, fDeep);
01242                 List_Delete(leftitem);
01243                 leftitem = nextitem;
01244                 nextitem = dir_nextitem(cl->right, rightitem, fDeep);
01245                 List_Delete(rightitem);
01246                 rightitem = nextitem;
01247             }
01248
01249         } else if (cmpvalue < 0) {
01250             if (TrackLeftOnly) {
01251                 compitem_new(leftitem, NULL, cl->items, fExact);
01252                 if (view_newitem(view)) {
01253                     TickCount = GetTickCount() - TickCount;
01254                     return(FALSE);
01255                 }
01256                 leftitem = dir_nextitem(cl->left, leftitem, fDeep);
01257             } else {
01258                 nextitem = dir_nextitem(cl->left, leftitem, fDeep);
01259                 List_Delete(leftitem);
01260                 leftitem = nextitem;
01261             }
01262         } else {
01263             if (TrackRightOnly) {
01264                 compitem_new(NULL, rightitem, cl->items, fExact);
01265                 if (view_newitem(view)) {
01266                     TickCount = GetTickCount() - TickCount;
01267                     return(FALSE);
01268                 }
01269                 rightitem = dir_nextitem(cl->right, rightitem, fDeep);
01270             } else {
01271                 nextitem = dir_nextitem(cl->right, rightitem, fDeep);
01272                 List_Delete(rightitem);
01273                 rightitem = nextitem;
01274             }
01275         }
01276     }
01277
01278
01279     /* any left over are unmatched */
01280     if (TrackLeftOnly) {
01281         while (leftitem != NULL) {
01282             compitem_new(leftitem, NULL, cl->items, fExact);
01283             if (view_newitem(view)) {
01284                 TickCount = GetTickCount() - TickCount;
01285                 return(FALSE);
01286             }
01287             leftitem = dir_nextitem(cl->left, leftitem, fDeep);
01288         }
01289     }
01290     if (TrackRightOnly) {
01291         while (rightitem != NULL) {
01292             compitem_new(NULL, rightitem, cl->items, fExact);
01293             if (view_newitem(view)) {
01294                 TickCount = GetTickCount() - TickCount;
01295                 return(FALSE);
01296             }
01297             rightitem = dir_nextitem(cl->right, rightitem, fDeep);
01298         }
01299     }
01300     TickCount = GetTickCount() - TickCount;
01301     return(TRUE);
01302 } /* complist_match */
01303
01304 /* return time last operation took in milliseconds */
01305 DWORD complist_querytime(void)
01306 {       return TickCount;
01307 }
01308
01309
01310 /* dialog to query about filename and types of files. Init dlg fields from
01311  * the dlg_* variables, and save state to the dlg_* variables on dialog
01312  * close. return TRUE for OK, or FALSE for cancel (from the dialogbox()
01313  * using EndDialog).
01314  */
01315 int FAR PASCAL
01316 complist_dodlg_savelist(HWND hDlg, UINT message, UINT wParam, long lParam)
01317 {
01318     switch (message) {
01319         case WM_INITDIALOG:
01320             SendDlgItemMessage(hDlg, IDD_IDENTICAL, BM_SETCHECK,
01321                                dlg_identical ? 1 : 0, 0);
01322             SendDlgItemMessage(hDlg, IDD_DIFFER, BM_SETCHECK,
01323                                dlg_differ ? 1 : 0, 0);
01324             SendDlgItemMessage(hDlg, IDD_LEFT, BM_SETCHECK,
01325                                dlg_left ? 1 : 0, 0);
01326             SendDlgItemMessage(hDlg, IDD_RIGHT, BM_SETCHECK,
01327                                dlg_right ? 1 : 0, 0);
01328             SendDlgItemMessage(hDlg, IDD_SUMS, BM_SETCHECK,
01329                                dlg_sums ? 1 : 0, 0);
01330             CheckDlgButton(hDlg, IDD_IGNOREMARK, dlg_IgnoreMarks ? 1 : 0);
01331
01332             SetDlgItemText(hDlg, IDD_FILE, dlg_file);
01333
01334             return(TRUE);
01335
01336         case WM_COMMAND:
01337             switch (GET_WM_COMMAND_ID(wParam, lParam)) {
01338
01339                 case IDOK:
01340                     dlg_identical = (SendDlgItemMessage(hDlg, IDD_IDENTICAL,
01341                                                         BM_GETCHECK, 0, 0) == 1);
01342                     dlg_differ = (SendDlgItemMessage(hDlg, IDD_DIFFER,
01343                                                      BM_GETCHECK, 0, 0) == 1);
01344                     dlg_left = (SendDlgItemMessage(hDlg, IDD_LEFT,
01345                                                    BM_GETCHECK, 0, 0) == 1);
01346                     dlg_right = (SendDlgItemMessage(hDlg, IDD_RIGHT,
01347                                                     BM_GETCHECK, 0, 0) == 1);
01348                     dlg_sums = (SendDlgItemMessage(hDlg, IDD_SUMS,
01349                                                    BM_GETCHECK, 0, 0) == 1);
01350                     dlg_IgnoreMarks =
01351                     (SendDlgItemMessage(
01352                                        hDlg,
01353                                        IDD_IGNOREMARK,
01354                                        BM_GETCHECK, 0, 0) == 1);
01355
01356                     GetDlgItemText(hDlg, IDD_FILE, dlg_file, sizeof(dlg_file));
01357
01358                     EndDialog(hDlg, TRUE);
01359                     break;
01360
01361                 case IDCANCEL:
01362                     EndDialog(hDlg, FALSE);
01363                     break;
01364             }
01365     }
01366     return(FALSE);
01367 } /* complist_dodlg_savelist */
01368
01369 /* dialog to get directory name and inclusion options. Init dlg fields from
01370  * the dlg_* variables, and save state to the dlg_* variables on dialog
01371  * close. return TRUE for OK, or FALSE for cancel (from the dialogbox()
01372  * using EndDialog).
01373  */
01374 int FAR PASCAL
01375 complist_dodlg_copyfiles(HWND hDlg, UINT message, UINT wParam, long lParam)
01376 {
01377     switch (message) {
01378         case WM_INITDIALOG:
01379             /*
01380              * set checkboxes and directory field to defaults
01381              */
01382             CheckDlgButton(hDlg, IDD_IDENTICAL,
01383                            (dlg_options & INCLUDE_SAME) ? 1 : 0);
01384
01385             CheckDlgButton(hDlg, IDD_DIFFER,
01386                            (dlg_options & INCLUDE_DIFFER) ? 1 : 0);
01387
01388             CheckDlgButton(hDlg, IDD_LEFT,
01389                            (dlg_options & (INCLUDE_LEFTONLY|INCLUDE_RIGHTONLY)) ? 1 : 0);
01390
01391             CheckDlgButton(hDlg, IDD_IGNOREMARK, dlg_IgnoreMarks ? 1 : 0);
01392
01393             CheckDlgButton(hDlg, IDD_ATTRIBUTES, dlg_IgnoreAttributes ? 0 : 1);
01394
01395             SetDlgItemText(hDlg, IDD_DIR1, dlg_root);
01396
01397             /*
01398              * set default radio button for copy from
01399              */
01400             CheckRadioButton(hDlg, IDD_FROMLEFT, IDD_FROMRIGHT,
01401                              (dlg_options & COPY_FROMLEFT) ? IDD_FROMLEFT : IDD_FROMRIGHT);
01402
01403             return(TRUE);
01404
01405         case WM_COMMAND:
01406             switch (GET_WM_COMMAND_ID(wParam, lParam)) {
01407
01408                 case IDD_FROMLEFT:
01409                     dlg_options &= ~(COPY_FROMRIGHT);
01410                     dlg_options |= COPY_FROMLEFT;
01411                     break;
01412
01413                 case IDD_FROMRIGHT:
01414                     dlg_options &= ~(COPY_FROMLEFT);
01415                     dlg_options |= COPY_FROMRIGHT;
01416                     break;
01417
01418                 case IDOK:
01419                     if (SendDlgItemMessage(hDlg, IDD_IDENTICAL,
01420                                            BM_GETCHECK, 0, 0) == 1) {
01421                         dlg_options |= INCLUDE_SAME;
01422                     } else {
01423                         dlg_options &= ~INCLUDE_SAME;
01424                     }
01425                     if (SendDlgItemMessage(hDlg, IDD_DIFFER,
01426                                            BM_GETCHECK, 0, 0) == 1) {
01427                         dlg_options |= INCLUDE_DIFFER;
01428                     } else {
01429                         dlg_options &= ~INCLUDE_DIFFER;
01430                     }
01431                     if (SendDlgItemMessage(hDlg, IDD_LEFT,
01432                                            BM_GETCHECK, 0, 0) == 1) {
01433                         dlg_options |= INCLUDE_LEFTONLY;
01434                     } else {
01435                         dlg_options &= ~INCLUDE_LEFTONLY;
01436                     }
01437
01438                     dlg_IgnoreMarks =
01439                     (SendDlgItemMessage(
01440                                        hDlg,
01441                                        IDD_IGNOREMARK,
01442                                        BM_GETCHECK, 0, 0) == 1);
01443
01444                     dlg_IgnoreAttributes =
01445                     (SendDlgItemMessage(
01446                                        hDlg,
01447                                        IDD_ATTRIBUTES,
01448                                        BM_GETCHECK, 0, 0) == 0);
01449
01450                     GetDlgItemText(hDlg, IDD_DIR1, dlg_root, sizeof(dlg_root));
01451
01452                     EndDialog(hDlg, TRUE);
01453                     break;
01454
01455                 case IDCANCEL:
01456                     EndDialog(hDlg, FALSE);
01457                     break;
01458             }
01459     }
01460     return(FALSE);
01461 } /* complist_dodlg_copyfiles */
01462
01463 /* allocate a new complist and initialise it */
01464 COMPLIST
01465 complist_new(void)
01466 {
01467     COMPLIST cl;
01468
01469     cl = (COMPLIST) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct complist));
01470     if (cl == NULL)
01471     return NULL;
01472   cl->left = NULL;
01473     cl->right = NULL;
01474     cl->items = List_Create();
01475
01476     return(cl);
01477 } /* complist_new */
01478
01479
01480 /* dialog box function to ask for two directory names.
01481  * no listing of files etc - just two edit fields  in which the
01482  * user can type a file or a directory name.
01483  *
01484  * initialises the names from win.ini, and stores them to win.ini first.
01485  */
01486 int FAR PASCAL
01487 complist_dodlg_dir(HWND hDlg, unsigned message, UINT wParam, LONG lParam)
01488 {
01489     static char path[MAX_PATH];
01490     static char buffer[MAX_PATH];
01491
01492     /* We write what we find to the ini file, but we only load from the ini file
01493     ** once per instance of the app.  So if you start two sdkdiffs, each remembers
01494     ** what it is doing as long as it is alive
01495     */
01496
01497     int id;
01498
01499     switch (message) {
01500
01501         case WM_INITDIALOG:
01502
01503             /* fill the edit fields with the current
01504              * directory as a good starting point - if there isn't
01505              * already a saved path.
01506              *
01507              * set the current directory as a label so that the
01508              * user can select relative paths such as ..
01509              *
01510              */
01511             _getcwd(path, sizeof(path));
01512             AnsiLowerBuff(path, (DWORD)strlen(path));
01513             SetDlgItemText(hDlg, IDD_LAB3, path);
01514
01515             if (!SeenDialogNames)
01516                 GetProfileString(APPNAME, "NameLeft", path, dialog_leftname, MAX_PATH);
01517             SetDlgItemText(hDlg, IDD_DIR1, dialog_leftname);
01518             if (!SeenDialogNames)
01519                 GetProfileString(APPNAME, "NameRight", path, dialog_rightname, MAX_PATH);
01520             SetDlgItemText(hDlg, IDD_DIR2, dialog_rightname);
01521             if (!SeenDialogNames)
01522                 dialog_recursive = GetProfileInt(APPNAME, "Recursive", 1);
01523             SendDlgItemMessage( hDlg
01524                                 , IDD_RECURSIVE
01525                                 , BM_SETCHECK
01526                                 , (WPARAM)dialog_recursive
01527                                 , 0
01528                               );
01529
01530             SeenDialogNames = TRUE;
01531             return(TRUE);
01532
01533         case WM_COMMAND:
01534             id = GET_WM_COMMAND_ID(wParam, lParam);
01535
01536             switch (id) {
01537                 case IDD_DIR1:
01538                 case IDD_DIR2:
01539                     if (GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE) {
01540
01541                         int idother = (id == IDD_DIR1) ? IDD_DIR2 : IDD_DIR1;
01542
01543                     }
01544                     break;
01545
01546                 case IDCANCEL:
01547                     EndDialog(hDlg, FALSE);
01548                     return(TRUE);
01549
01550                 case IDOK:
01551                     {
01552                         LPSTR pszThis = 0;
01553                         LPSTR pszOther = 0;
01554
01555                         /* fetch the text from the dialog, and remember
01556                          * it in win.ini
01557                          */
01558
01559                         GetDlgItemText(hDlg, IDD_DIR1,
01560                                        dialog_leftname, sizeof(dialog_leftname));
01561                         GetDlgItemText(hDlg, IDD_DIR2,
01562                                        dialog_rightname, sizeof(dialog_rightname));
01563
01564
01565                         WriteProfileString(APPNAME, "NameLeft", dialog_leftname);
01566                         WriteProfileString(APPNAME, "NameRight", dialog_rightname);
01567
01568                         dialog_recursive =  ( 1 == SendDlgItemMessage( hDlg
01569                                                                        , IDD_RECURSIVE
01570                                                                        , BM_GETCHECK
01571                                                                        , 0
01572                                                                        , 0
01573                                                                      )
01574                                             );
01575                         WriteProfileString( APPNAME
01576                                             , "Recursive"
01577                                             , dialog_recursive ? "1" : "0"
01578                                           );
01579                         EndDialog(hDlg, TRUE);
01580                     }
01581                     return(TRUE);
01582             }
01583             break;
01584     }
01585     return(FALSE);
01586 } /* complist_dodlg_dir */
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/PerClien.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

PerClien.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PERCLIEN.CPP
00003
00004   Summary:   Main implementation for the PERCLIEN client application. This
00005              client loads and accesses the connectable COPageList COM
00006              object housed in a separate in-process COM Server (PERSERVE
00007              built in the sibling PERSERVE directory). The COPageList COM
00008              object is persistent and manages the page list data.
00009
00010              Using the data in COPageList, PERCLIEN displays the page list
00011              and allows the user to create, open, and edit various page
00012              types kept in the list. The page editing is done in separate
00013              child windows. Each page type has data that is managed by
00014              appropriate COM servers. The PERTEXT server houses COTextPage
00015              COM objects. The PERDRAW server houses CODrawPage COM
00016              objects. The COPageList, COTextPage, and CODrawPage objects
00017              each use a different kind of COM object persistence.
00018              COPageList exposes IPersistStream for its persistence
00019              features. COTextPage exposes IPersistStreamInit. CODrawPage
00020              exposes IPersistStorage.
00021
00022              All of the data content in the page list, text pages, and
00023              draw pages is stored in one compound file managed by this
00024              PERCLIEN client. Files of this type have the .PAG extension.
00025
00026              To run PERCLIEN you must build the PERSERVE, PERTEXT, and
00027              PERDRAW samples first.
00028
00029              For a comprehensive tutorial code tour of PERCLIEN's contents
00030              and offerings see the tutorial PERCLIEN.HTM file. For
00031              more specific technical details on the internal workings see
00032              the comments dispersed throughout the PERCLIEN source code.
00033              For more details on the PERSERVE.DLL that PERCLIEN works with
00034              see the PERSERVE.HTM file in the main tutorial directory.
00035              For more details on the PERTEXT.DLL that PERCLIEN works with
00036              see the PERTEXT.HTM file in the main tutorial directory.
00037              For more details on the PERDRAW.DLL that PERCLIEN works with
00038              see the PERDRAW.HTM file in the main tutorial directory.
00039
00040   Classes:   CMainWindow.
00041
00042   Functions: InitApplication, WinMain
00043
00044   Origin:    5-24-96: atrent - Editor-inheritance from the STOCLIEN source.
00045
00046 ----------------------------------------------------------------------------
00047   This file is part of the Microsoft COM Tutorial Code Samples.
00048
00049   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00050
00051   This source code is intended only as a supplement to Microsoft
00052   Development Tools and/or on-line documentation.  See these other
00053   materials for detailed information regarding Microsoft code samples.
00054
00055   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00056   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00057   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00058   PARTICULAR PURPOSE.
00059 ==========================================================================+*/
00060
00061 /*--------------------------------------------------------------------------
00062   We include WINDOWS.H for all Win32 applications.
00063   We include OLE2.H because we will be calling the COM/OLE Libraries.
00064   We include OLECTL.H because it has definitions for connectable objects.
00065   We include INITGUID.H only once (here) in the entire app because we
00066     will be defining GUIDs and want them as constants in the data segment.
00067   We include COMMDLG.H because we will be using the Open File
00068     and potentially other Common dialogs.
00069   We include APPUTIL.H because we will be building this application using
00070     the convenient Virtual Window and Dialog classes and other
00071     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00072   We include IPAGES.H and PAGEGUID.H for the common page-related Interface
00073     class, GUID, and CLSID specifications.
00074   We include RESDEF.H because it has the resource definitions specific
00075     to this application.
00076   We include PAGEFILE.H because it has the C++ class used for compound file
00077     storage of page list data.
00078   We include LISTWIN.H because CGuiList creates and uses a CListWin to
00079     encapsulate the standard listbox control window.
00080   We include GUILIST.H because it has the C++ class used for GUI display
00081     of the page list.
00082   We include PERCLIEN.H because it has the CMainWindow class definition.
00083 ---------------------------------------------------------------------------*/
00084 #include <windows.h>
00085 #include <ole2.h>
00086 #include <olectl.h>
00087 #include <initguid.h>
00088 #include <commdlg.h>
00089 #include <apputil.h>
00090 #include <ipages.h>
00091 #include <pageguid.h>
00092 #include "resdef.h"
00093 #include "pagefile.h"
00094 #include "listwin.h"
00095 #include "guilist.h"
00096 #include "perclien.h"
00097
00098
00099 // Work storage for the user-entered page title.
00100 TCHAR g_szPageTitle[PAGE_TITLE_SIZE] = TEXT(PAGE_UNTITLED_STR);
00101
00102
00103 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00104   Method:   CMainWindow::CMainWindow
00105
00106   Summary:  CMainWindow Constructor.
00107
00108   Args:     .
00109
00110   Returns:  .
00111 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00112 CMainWindow::CMainWindow()
00113 {
00114   // Ensure these member variable strings are null strings.
00115   m_szFileName[0] = 0;
00116   m_szFileTitle[0] = 0;
00117
00118   // Fill in the Open File Name Common Dialog's OPENFILENAME structure.
00119   m_ofnFile.lStructSize = sizeof(OPENFILENAME);
00120   m_ofnFile.hwndOwner = m_hWnd;
00121   m_ofnFile.hInstance = m_hInst;
00122   m_ofnFile.lpstrFilter = TEXT(OFN_DEFAULTFILES_STR);
00123   m_ofnFile.lpstrCustomFilter = NULL;
00124   m_ofnFile.nMaxCustFilter = 0;
00125   m_ofnFile.nFilterIndex = 1;
00126   m_ofnFile.lpstrFile = m_szFileName;
00127   m_ofnFile.nMaxFile = MAX_PATH;
00128   m_ofnFile.lpstrInitialDir = TEXT(".");
00129   m_ofnFile.lpstrFileTitle = m_szFileTitle;
00130   m_ofnFile.nMaxFileTitle = MAX_PATH;
00131   m_ofnFile.lpstrTitle = TEXT(OFN_DEFAULTTITLE_STR);
00132   m_ofnFile.lpstrDefExt = NULL;
00133   m_ofnFile.Flags = OFN_HIDEREADONLY;
00134
00135   m_pGuiList = NULL;
00136 }
00137
00138
00139 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00140   Method:   CMainWindow::~CMainWindow
00141
00142   Summary:  CMainWindow Destructor.  Destruction of the main window
00143             indicates that the application should quit and thus the
00144             PostQuitMessage API is called.
00145
00146   Args:     .
00147
00148   Returns:  .
00149 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00150 CMainWindow::~CMainWindow()
00151 {
00152   // CMainWindow is derived from CVirWindow which traps the WM_DESTROY
00153   // message and causes a delete of CMainWindow which in turn causes this
00154   // destructor to run. The WM_DESTROY results when the window is destoyed
00155   // after a close of the window. Prior to exiting the main message loop:
00156
00157   // We delete the CGuiList object that was made in InitInstance.
00158   DELETE_POINTER(m_pGuiList);
00159
00160   // We then post a WM_QUIT message to cause an exit of the main
00161   // message loop and an exit of this instance of the application.
00162   PostQuitMessage(0);
00163 }
00164
00165
00166 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00167   Method:   CMainWindow::InitInstance
00168
00169   Summary:  Instantiates an instance of the main application window.
00170             This method must be called only once, immediately after
00171             window class construction.  We take care to delete 'this'
00172             CMainWindow if we must return the error condition FALSE.
00173
00174   Args:     HINSTANCE hInstance,
00175               Handle of the application instance.
00176             LPSTR pszCmdLine,
00177               Pointer to the application's invocation command line.
00178             int nCmdShow)
00179               Command to pass to ShowWindow.
00180
00181   Modifies: m_szHelpFile
00182
00183   Returns:  BOOL.
00184               TRUE if succeeded.
00185               FALSE if failed.
00186 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00187 BOOL CMainWindow::InitInstance(
00188        HINSTANCE hInstance,
00189        LPSTR pszCmdLine,
00190        int nCmdShow)
00191 {
00192   BOOL bOk = FALSE;
00193   HWND hWnd = NULL;
00194   HRESULT hr = E_FAIL;
00195
00196   // Create the CGuiList C++ object.
00197   m_pGuiList = new CGuiList;
00198
00199   if (NULL != m_pGuiList)
00200   {
00201     // Note, the Create method sets the m_hWnd member so we don't
00202     // need to set it explicitly here first. Here is the create of this
00203     // window.  Size the window reasonably. Create sets both m_hInst and
00204     // m_hWnd. This creates the main client window.
00205     hWnd = Create(
00206              TEXT(MAIN_WINDOW_CLASS_NAME_STR),
00207              TEXT(MAIN_WINDOW_TITLE_STR),
00208              WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
00209                | WS_MAXIMIZEBOX | WS_THICKFRAME,
00210              CW_USEDEFAULT,
00211              CW_USEDEFAULT,
00212              ::GetSystemMetrics(SM_CXSCREEN)*1/3,
00213              ::GetSystemMetrics(SM_CYSCREEN)*1/3,
00214              NULL,
00215              NULL,
00216              hInstance);
00217     if (NULL != hWnd)
00218     {
00219       if (pszCmdLine[0] == 0)
00220         pszCmdLine = NULL;
00221
00222 #if defined(UNICODE)
00223       {
00224         WCHAR wszUc[MAX_PATH];
00225
00226         if (NULL != pszCmdLine)
00227         {
00228           // Convert from Ansi to Unicode.
00229           AnsiToUc(pszCmdLine, wszUc, MAX_PATH);
00230           // Init the new GuiList.
00231           bOk = m_pGuiList->Init(m_hInst, m_hWnd, wszUc);
00232         }
00233         else
00234           bOk = m_pGuiList->Init(m_hInst, m_hWnd, NULL);
00235       }
00236 #else
00237       // Init the new GuiList.
00238       bOk = m_pGuiList->Init(m_hInst, m_hWnd, pszCmdLine);
00239 #endif
00240
00241       if (bOk)
00242       {
00243         // Ensure the new window is shown on screen and content
00244         // is painted.
00245         ::ShowWindow(m_hWnd, nCmdShow);
00246         ::UpdateWindow(m_hWnd);
00247
00248         // Build a path to where the help file should be (it should be in
00249         // the same directory as the .EXE but with the .HTM extension).
00250         MakeFamilyPath(hInstance, m_szHelpFile, TEXT(HELP_FILE_EXT));
00251
00252         // Try to open the page list compound file and populate the
00253         // main page list. Open either the default PERCLIEN.PAG
00254         // or the one specified on the invocation command line.
00255         // Load will create/load the default PERCLIEN.PAG if no specified
00256         // .PAG file is found.
00257         hr = m_pGuiList->Load();
00258         if (SUCCEEDED(hr))
00259         {
00260           // If the COPageList COM object was created and reconstituted
00261           // by loading the .PAG file then show its Page List.
00262           hr = m_pGuiList->Show(0);
00263         }
00264         bOk = SUCCEEDED(hr);
00265         if (!bOk)
00266           HrMsgId(m_hInst, m_hWnd, IDS_NOSERVER, hr);
00267       }
00268     }
00269   }
00270
00271   if (!bOk)
00272   {
00273     DELETE_POINTER(m_pGuiList);
00274   }
00275
00276   return (bOk);
00277 }
00278
00279
00280 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00281   Method:   CMainWindow::DoCommand
00282
00283   Summary:  Dispatch and handle the main menu commands.
00284
00285   Args:     WPARAM wParam,
00286               First message parameter.
00287             LPARAM lParam)
00288               Second message parameter.
00289
00290   Modifies: m_ofnFile, ...
00291
00292   Returns:  LRESULT
00293               Standard Windows WindowProc return value.
00294 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00295 LRESULT CMainWindow::DoCommand(
00296           WPARAM wParam,
00297           LPARAM lParam)
00298 {
00299   LRESULT lResult = FALSE;
00300   HMENU hMenu  = ::GetMenu(m_hWnd);
00301
00302   switch (LOWORD(wParam))
00303   {
00304     //----------------------------------------------------------------------
00305     // Handle File Menu Commands.
00306     //----------------------------------------------------------------------
00307     case IDM_FILE_NEW:
00308       // Create an empty compound file; ask CGuiList to save itself to it.
00309       m_pGuiList->New();
00310       break;
00311     case IDM_FILE_OPEN:
00312       // Open existing compound file; ask CGuiList to load itself from it.
00313       m_pGuiList->Open();
00314       break;
00315     case IDM_FILE_SAVE:
00316       // Ask all pages to save to current compound file.
00317       m_pGuiList->Save();
00318       break;
00319     case IDM_FILE_SAVEAS:
00320       // Create new compound file and ask all pages to save to it.
00321       m_pGuiList->SaveAs();
00322       break;
00323     case IDM_FILE_EXIT:
00324       // The user commands us to exit this application so we tell the
00325       // Main window to close itself.
00326       ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00327       break;
00328
00329     //----------------------------------------------------------------------
00330     // Handle Page Menu Commands.
00331     //----------------------------------------------------------------------
00332     case IDM_PAGE_OPEN:
00333       // Open the selected page in the list.
00334       m_pGuiList->PageOpen();
00335       break;
00336     case IDM_PAGE_TITLE:
00337       // Edit a new title for the selected page in the list.
00338       m_pGuiList->PageTitle();
00339       break;
00340     case IDM_PAGE_NEWTEXT:
00341       // Create new Text page.
00342       m_pGuiList->PageAdd(PAGETYPE_TEXT);
00343       break;
00344     case IDM_PAGE_NEWDRAW:
00345       // Create new Drawing page.
00346       m_pGuiList->PageAdd(PAGETYPE_DRAWING);
00347       break;
00348     case IDM_PAGE_DELETE:
00349       // Delete the selected page in the list.
00350       m_pGuiList->PageDelete();
00351       break;
00352
00353     //----------------------------------------------------------------------
00354     // Handle Help Menu Commands.
00355     //----------------------------------------------------------------------
00356     case IDM_HELP_CONTENTS:
00357       // We have some stubbed support here for bringing up the main online
00358       // Help for this application. Assumed to be in an .HTM file located
00359       // next to the .EXE file of the current executable.
00360       ReadHelp(m_hWnd, m_szHelpFile);
00361       break;
00362     case IDM_HELP_TUTORIAL:
00363       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00364       // tutorial narrative file associated with this tutorial code sample.
00365       ReadTutorial(m_hInst, m_hWnd, TEXT(HTML_FILE_EXT));
00366       break;
00367     case IDM_HELP_PERSERVE:
00368       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00369       // tutorial narrative file associated with the PERSERVE COM server.
00370       ReadTutorial(m_hInst, m_hWnd, TEXT(SERVER_PERSERVE_STR));
00371       break;
00372     case IDM_HELP_PERTEXT:
00373       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00374       // tutorial narrative file associated with the PERTEXT COM server.
00375       ReadTutorial(m_hInst, m_hWnd, TEXT(SERVER_PERTEXT_STR));
00376       break;
00377     case IDM_HELP_PERDRAW:
00378       // Call the APPUTIL utility function, ReadTutorial, to Browse the HTML
00379       // tutorial narrative file associated with the PERDRAW COM server.
00380       ReadTutorial(m_hInst, m_hWnd, TEXT(SERVER_PERDRAW_STR));
00381       break;
00382     case IDM_HELP_READSOURCE:
00383       // Call the APPUTIL utility function ReadSource to allow the
00384       // user to open and read any of the source files of PERCLIEN.
00385       ReadSource(m_hWnd, &m_ofnFile);
00386       break;
00387     case IDM_HELP_ABOUT:
00388       {
00389         CAboutBox dlgAboutBox;
00390
00391         // Show the standard About Box dialog for this EXE by telling the
00392         // dialog C++ object to show itself by invoking its ShowDialog
00393         // method.  Pass it this EXE instance and the parent window handle.
00394         // Use a dialog resource ID for the dialog template stored in
00395         // this EXE module's resources.
00396         dlgAboutBox.ShowDialog(
00397           m_hInst,
00398           MAKEINTRESOURCE(IDM_HELP_ABOUT),
00399           m_hWnd);
00400       }
00401       break;
00402
00403     //----------------------------------------------------------------------
00404     // Handle ListWin Commands (ie, from the child list box control).
00405     //----------------------------------------------------------------------
00406     case IDC_LISTWIN:
00407       switch (HIWORD(wParam))
00408       {
00409         case LBN_DBLCLK:
00410           // User Double Clicked. Open the selected page in the list.
00411           m_pGuiList->PageOpen();
00412           break;
00413         case LBN_SELCHANGE:
00414           // User changed the page selection.
00415           break;
00416         default:
00417           break;
00418       }
00419       break;
00420
00421     default:
00422       // Defer all messages NOT handled here to the Default Window Proc.
00423       lResult = ::DefWindowProc(m_hWnd, WM_COMMAND, wParam, lParam);
00424       break;
00425   }
00426
00427   return(lResult);
00428 }
00429
00430
00431 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00432   Method:   CDlgPageProps::DialogProc
00433
00434   Summary:  Dialog proc for the Page Properties dialog box. This
00435             DialogProc method definition overrides the same-named pure
00436             virtual function in abstract base class CVirDialog thus giving
00437             unique message dispatching behavior to this derivation of
00438             CVirDialog. The remaining behavior of CDlgPageProps is
00439             inherited from CVirDialog and is common to all CVirDialogs.
00440
00441   Args:     HWND hWndDlg,
00442               Handle to the dialog.
00443             UINT uMsg,
00444               Windows message to dialog.
00445             WPARAM wParam,
00446               First message parameter (word sized).
00447             LPARAM lParam)
00448               Second message parameter (long sized).
00449
00450   Returns:  BOOL.  TRUE if message was handled; FALSE otherwise.
00451 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00452 BOOL CDlgPageProps::DialogProc(
00453        HWND hWndDlg,
00454        UINT uMsg,
00455        WPARAM wParam,
00456        LPARAM lParam)
00457 {
00458   BOOL bResult = TRUE;
00459   HWND hCtrl = GetDlgItem(hWndDlg, IDC_EDIT_PGTITLE);
00460
00461   switch (uMsg)
00462   {
00463     case WM_INITDIALOG:
00464       SetDlgItemText(hWndDlg, IDC_EDIT_PGTITLE, g_szPageTitle);
00465       SetFocus(hCtrl);
00466       bResult = FALSE;
00467       break;
00468
00469     case WM_COMMAND:
00470       {
00471         WORD wCmd = LOWORD(wParam);
00472
00473         if (wCmd == IDOK)
00474         {
00475           // Obtain the machine name from the edit control and store
00476           // it where other functions can get it.
00477           GetDlgItemText(
00478             hWndDlg,
00479             IDC_EDIT_PGTITLE,
00480             g_szPageTitle,
00481             PAGE_TITLE_SIZE);
00482           ::EndDialog(hWndDlg, TRUE);
00483         }
00484         else if (wCmd == IDCANCEL)
00485           ::EndDialog(hWndDlg, FALSE);
00486       }
00487       break;
00488
00489     default:
00490       bResult = FALSE;
00491       break;
00492   }
00493
00494   return(bResult);
00495 }
00496
00497
00498 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00499   Method:   CMainWindow::WindowProc
00500
00501   Summary:  Main window procedure for this window object.  See CVirWindow
00502             in the APPUTIL library (APPUTIL.CPP) for details on how this
00503             method gets called by the global WindowProc.
00504
00505   Args:     UINT uMsg,
00506               Windows message that is "sent" to this window.
00507             WPARAM wParam,
00508               First message parameter.
00509             LPARAM lParam)
00510               Second message parameter.
00511
00512   Returns:  LRESULT
00513               Standard Windows WindowProc return value.
00514 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00515 LRESULT CMainWindow::WindowProc(
00516           UINT uMsg,
00517           WPARAM wParam,
00518           LPARAM lParam)
00519 {
00520   LRESULT lResult = FALSE;
00521
00522   switch (uMsg)
00523   {
00524     case WM_CREATE:
00525       break;
00526
00527     case WM_SIZE:
00528       // Handle a resize of this window.
00529       m_wWidth = LOWORD(lParam);
00530       m_wHeight = HIWORD(lParam);
00531       // Inform CGuiList and CListWin of the change.
00532       m_pGuiList->Resize(m_wWidth, m_wHeight);
00533       break;
00534
00535     case WM_COMMAND:
00536       // Dispatch and handle any Menu command messages received.
00537       lResult = DoCommand(wParam, lParam);
00538       break;
00539
00540     case WM_USER_PAGECHANGED:
00541       // An open page was edit/changed.
00542       m_pGuiList->PageChanged((int)lParam);
00543       break;
00544
00545     case WM_USER_PAGECLOSED:
00546       // A separate page edit window was closed.
00547       m_pGuiList->PageClosed((int)lParam);
00548       break;
00549
00550     case WM_CHAR:
00551       if (wParam == 0x1b)
00552       {
00553         // Exit this app if user hits ESC key.
00554         ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00555       }
00556       break;
00557
00558     case WM_CLOSE:
00559       // The user selected Close on the main window's System menu
00560       // or Exit on the File menu.
00561       // If there is data that has not been saved then ask user
00562       // if it should be saved. If user cancels then cancel the exit.
00563       if (IDCANCEL == m_pGuiList->AskSave())
00564         break;
00565     case WM_QUIT:
00566       // If the app is being quit then close any associated help windows.
00567     default:
00568       // Defer all messages NOT handled above to the Default Window Proc.
00569       lResult = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
00570       break;
00571   }
00572
00573   return(lResult);
00574 }
00575
00576
00577 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00578   Function: UnicodeOk
00579
00580   Summary:  Checks if the platform will handle unicode versions of
00581             Win32 string API calls.
00582
00583   Args:     void
00584
00585   Returns:  BOOL
00586               TRUE if unicode support; FALSE if not.
00587 ------------------------------------------------------------------------F-F*/
00588 BOOL UnicodeOk(void)
00589 {
00590   BOOL bOk = TRUE;
00591   TCHAR szUserName[MAX_STRING_LENGTH];
00592   DWORD dwSize = MAX_STRING_LENGTH;
00593
00594   if (!GetUserName(szUserName, &dwSize))
00595     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00596
00597   return bOk;
00598 }
00599
00600
00601 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00602   Function: InitApplication
00603
00604   Summary:  Initializes the application and registers its main window
00605             class. InitApplication is called only once (in WinMain).
00606
00607   Args:     HINSTANCE hInstance)
00608               Handle to the first instance of the application.
00609
00610   Returns:  BOOL.
00611               TRUE if success.
00612               FALSE if fail.
00613 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00614 BOOL InitApplication(
00615        HINSTANCE hInstance)
00616 {
00617   BOOL bOk;
00618   // The window class for all instances of the main frame window.
00619   WNDCLASSEX wcf;
00620
00621   // Assign the appropriate values for this main frame window class.
00622   wcf.cbSize        = sizeof(WNDCLASSEX);
00623   wcf.cbClsExtra    = 0;            // No per-class extra data.
00624   wcf.cbWndExtra    = 0;            // No per-window extra data.
00625   wcf.hInstance     = hInstance;    // Application module instance.
00626   wcf.lpfnWndProc   = &WindowProc;  // Global Window Procedure (defined in
00627                                     // APPUTIL for all CVirWindows).
00628   wcf.hCursor       = LoadCursor(NULL, IDC_ARROW); // Load app cursor.
00629   wcf.hIcon         = (HICON) LoadIcon(            // Load app icon.
00630                                 hInstance,
00631                                 TEXT("AppIcon"));
00632   wcf.hIconSm       = (HICON) LoadImage(           // Load small icon.
00633                                 hInstance,
00634                                 TEXT("AppIcon"),
00635                                 IMAGE_ICON,
00636                                 16, 16,
00637                                 0);
00638   wcf.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);  // Default backgnd color.
00639   wcf.style         = CS_HREDRAW | CS_VREDRAW;          // Class style(s).
00640   wcf.lpszClassName = TEXT(MAIN_WINDOW_CLASS_NAME_STR); // Class name.
00641   wcf.lpszMenuName  = TEXT(MAIN_WINDOW_CLASS_MENU_STR); // Menu name.
00642   // Register the window class and return FALSE if unsuccesful.
00643   bOk = RegisterClassEx(&wcf);
00644
00645   if (bOk)
00646   {
00647     // Assign the appropriate values for the text page window class.
00648     wcf.lpszClassName = TEXT(TEXT_WINDOW_CLASS_NAME_STR); // Class name.
00649     wcf.lpszMenuName  = TEXT(TEXT_WINDOW_CLASS_MENU_STR); // Menu name.
00650     // Register the window class and return FALSE if unsuccesful.
00651     bOk = RegisterClassEx(&wcf);
00652   }
00653
00654   if (bOk)
00655   {
00656     // Assign the appropriate values for the drawing page window class.
00657     wcf.hCursor       = LoadCursor(                  // Load pen cursor.
00658                           hInstance,
00659                           TEXT("PenCursor"));
00660     wcf.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); // Backgnd color.
00661     wcf.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; // Class style(s).
00662     wcf.lpszClassName = TEXT(DRAW_WINDOW_CLASS_NAME_STR);   // Class name.
00663     wcf.lpszMenuName  = TEXT(DRAW_WINDOW_CLASS_MENU_STR);   // Menu name.
00664     // Register the window class and return FALSE if unsuccesful.
00665     bOk = RegisterClassEx(&wcf);
00666   }
00667
00668   return (bOk);
00669 }
00670
00671
00672 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00673   Function: WinMain
00674
00675   Summary:  The Windows main entry point function for this application.
00676             Initializes the application, the COM Libraries, and starts
00677             the main application message loop.
00678
00679   Args:     HINSTANCE hInstance,
00680               Instance handle; a new one for each invocation of this app.
00681             HINSTANCE hPrevInstance,
00682               Instance handle of the previous instance. NULL in Win32.
00683             LPSTR pszCmdLine,
00684               Windows passes a pointer to the application's
00685               invocation command line.
00686             int nCmdShow)
00687               Bits telling the show state of the application.
00688
00689   Returns:  int
00690               msg.wParam (upon exit of message loop).
00691               FALSE if this instance couldn't initialize and run.
00692 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00693 extern "C" int PASCAL WinMain(
00694                         HINSTANCE hInstance,
00695                         HINSTANCE hPrevInstance,
00696                         LPSTR pszCmdLine,
00697                         int nCmdShow)
00698 {
00699   CMainWindow* pWin = NULL;
00700   MSG msg;
00701   HACCEL hAccel;
00702   int iRun = FALSE;
00703
00704   // If we were compiled for UNICODE and the platform seems OK with this
00705   // then proceed.  Else we error and exit the app.
00706   if (UnicodeOk())
00707   {
00708     // Call to initialize the COM Library.  Use the SUCCEEDED macro
00709     // to detect success.  If fail then exit app with error message.
00710     // Tell COM that this client process and all subordinate threads
00711     // will live in an apartment threaded world.
00712     if (SUCCEEDED(CoInitialize(NULL)))
00713     {
00714       // If we succeeded in initializing the COM Library we proceed to
00715       // initialize the application.  If we can't init the application
00716       // then we signal shut down with an error message exit.
00717       iRun = InitApplication(hInstance);
00718       if (iRun)
00719       {
00720         // Assume we'll set iRun to TRUE when initialization is done.
00721         iRun = FALSE;
00722         // We are still go for running so we try to create a nifty new
00723         // CMainWindow object for this app instance.
00724         pWin = new CMainWindow;
00725         if (NULL != pWin)
00726         {
00727           // Now we initialize an instance of the new CMainWindow.
00728           // This includes creating the main window.  Note: if
00729           // InitInstance fails then it would have already deleted
00730           // pWin so we wouldn't need to delete it here.
00731           if (pWin->InitInstance(hInstance, pszCmdLine, nCmdShow))
00732           {
00733             // Load the keyboard accelerators from the resources.
00734             hAccel = LoadAccelerators(hInstance, TEXT("AppAccel"));
00735             if (NULL != hAccel)
00736             {
00737               // Signal App Initialization is successfully done.
00738               iRun = TRUE;
00739             }
00740           }
00741         }
00742       }
00743
00744       if (iRun)
00745       {
00746         // If we initialized the app instance properly then we are still
00747         // go for running.  We then start up the main message pump for
00748         // the application.
00749         while (GetMessage(&msg, NULL, 0, 0))
00750         {
00751           if (!TranslateAccelerator(pWin->GetHwnd(), hAccel, &msg))
00752           {
00753             TranslateMessage(&msg);
00754             DispatchMessage(&msg);
00755           }
00756         }
00757
00758         // We also ask COM to unload any unused COM Servers, including our
00759         // friend, PERSERVE.
00760         CoFreeUnusedLibraries();
00761
00762         // We'll pass to Windows the reason why we exited the message loop.
00763         iRun = (int) msg.wParam;
00764       }
00765       else
00766       {
00767         // We failed to Initialize the application. Put up error message
00768         // box saying that application couldn't be initialized.  Parent
00769         // window is desktop (ie, NULL).
00770         ErrorBox(hInstance, NULL, IDS_APPINITFAILED);
00771         DELETE_POINTER(pWin);
00772       }
00773
00774       // We're exiting this app (either normally or by init failure) so
00775       // shut down the COM Library.
00776       CoUninitialize();
00777     }
00778     else
00779     {
00780       // We failed to Initialize the COM Library. Put up error message box
00781       // saying that COM Library couldn't be initialized.  Parent window
00782       // is desktop (ie, NULL).
00783       ErrorBox(hInstance, NULL, IDS_COMINITFAILED);
00784     }
00785   }
00786   else
00787   {
00788     // If we were compiled for UNICODE but the platform has problems with
00789     // this then indicate an error and exit the app immediately.
00790     CHAR szMsg[MAX_STRING_LENGTH];
00791
00792     if (LoadStringA(
00793           hInstance,
00794           IDS_NOUNICODE,
00795           szMsg,
00796           MAX_STRING_LENGTH))
00797     {
00798       MessageBoxA(
00799         NULL,
00800         szMsg,
00801         ERROR_TITLE_STR,
00802         MB_OK | MB_ICONEXCLAMATION);
00803     }
00804   }
00805
00806   return iRun;
00807 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/DComPerm/DComPerm.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • DComPerm

DComPerm.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <conio.h>
00021 #include <tchar.h>
00022 #include "ntsecapi.h"
00023 #include "dcomperm.h"
00024
00025 /*---------------------------------------------------------------------------*\
00026  * NAME: HandleDefaultLaunchOption                                           *
00027  * --------------------------------------------------------------------------*
00028  * DESCRIPTION:
00029 \*---------------------------------------------------------------------------*/
00030 void ShowUsage (
00031     LPTSTR tszErrorString
00032     )
00033 {
00034
00035     BOOL fLegacy = IsLegacySecurityModel();
00036
00037     _tprintf (_T("%s\n"), tszErrorString);
00038     _tprintf (_T("Syntax: dcomperm <option> [...]\n\n"));
00039
00040     _tprintf (_T("Options:\n"));
00041
00042     if(!fLegacy)
00043     {
00044         _tprintf (_T("   -ma <\"set\" or \"remove\"> <Principal Name> [\"permit\" or \"deny\"] [\"level:l,r\"]\n"));
00045         _tprintf (_T("   -ma list\n"));
00046         _tprintf (_T("       Modify or list the machine access permission list\n\n"));
00047
00048         _tprintf (_T("   -ml <\"set\" or \"remove\"> <Principal Name> [\"permit\" or \"deny\"] [\"level:l,r,ll,la,rl,ra\"]\n"));
00049         _tprintf (_T("   -ml list\n"));
00050         _tprintf (_T("       Modify or list the machine launch permission list\n\n"));
00051     }
00052
00053     _tprintf (_T("   -da <\"set\" or \"remove\"> <Principal Name> [\"permit\" or \"deny\"] "));
00054     if(!fLegacy) _tprintf (_T("[\"level:l,r\"]\n")); else _tprintf (_T("\n"));
00055
00056     _tprintf (_T("   -da list\n"));
00057     _tprintf (_T("       Modify or list the default access permission list\n\n"));
00058
00059     _tprintf (_T("   -dl <\"set\" or \"remove\"> <Principal Name> [\"permit\" or \"deny\"] "));
00060     if(!fLegacy) _tprintf (_T("[\"level:l,r,ll,la,rl,ra\"]\n")); else _tprintf (_T("\n"));
00061     _tprintf (_T("   -dl list\n"));
00062     _tprintf (_T("       Modify or list the default launch permission list\n\n"));
00063
00064     _tprintf (_T("   -aa <AppID> <\"set\" or \"remove\"> <Principal Name> [\"permit\" or \"deny\"] "));
00065     if(!fLegacy) _tprintf (_T("[\"level:l,r\"]\n")); else _tprintf (_T("\n"));
00066     _tprintf (_T("   -aa <AppID> default\n"));
00067     _tprintf (_T("   -aa <AppID> list\n"));
00068     _tprintf (_T("       Modify or list the access permission list for a specific AppID\n\n"));
00069
00070     _tprintf (_T("   -al <AppID> <\"set\" or \"remove\"> <Principal Name> [\"permit\" or \"deny\"] "));
00071     if(!fLegacy) _tprintf (_T("[\"level:l,r,ll,la,rl,ra\"]\n")); else _tprintf (_T("\n"));
00072     _tprintf (_T("   -al <AppID> default\n"));
00073     _tprintf (_T("   -al <AppID> list\n"));
00074     _tprintf (_T("       Modify or list the launch permission list for a specific AppID\n\n"));
00075
00076     if(!fLegacy)
00077     {
00078         _tprintf (_T("level: \n"));
00079         _tprintf (_T("\tll - local launch (only applies to {ml, dl, al} options)  \n"));
00080         _tprintf (_T("\trl - remote launch (only applies to {ml, dl, al} options)  \n"));
00081         _tprintf (_T("\tla - local activate (only applies to {ml, dl, al} options)  \n"));
00082         _tprintf (_T("\tra - remote activate (only applies to {ml, dl, al} options)  \n"));
00083         _tprintf (_T("\tl  - local (local access - means launch and activate when used with {ml, dl, al} options)  \n"));
00084         _tprintf (_T("\tr  - remote (remote access - means launch and activate when used with {ml, dl, al} options)  \n\n"));
00085     }
00086
00087     _tprintf (_T("Press any key to continue. . ."));
00088     _getch();
00089     _tprintf (_T("\r                               \r"));
00090
00091     _tprintf (_T("   -runas <AppID> <Principal Name> <Password>\n"));
00092     _tprintf (_T("   -runas <AppID> \"Interactive User\"\n"));
00093     _tprintf (_T("   -runas <AppID> \"Launching User\"\n"));
00094     _tprintf (_T("       Set the RunAs information for a specific AppID\n\n"));
00095
00096     _tprintf (_T("Examples:\n"));
00097     _tprintf (_T("   dcomperm -da set redmond\\t-miken permit"));
00098     if(!fLegacy) _tprintf (_T(" level:r\n")); else _tprintf (_T("\n"));
00099     _tprintf (_T("   dcomperm -dl set redmond\\jdoe deny"));
00100     if(!fLegacy) _tprintf (_T(" level:rl,ra\n")); else _tprintf (_T("\n"));
00101     _tprintf (_T("   dcomperm -aa {12345678-1234-1234-1234-00aa00bbf7c7} list\n"));
00102     _tprintf (_T("   dcomperm -al {12345678-1234-1234-1234-00aa00bbf7c7} remove redmond\\t-miken\n"));
00103     _tprintf (_T("   dcomperm -runas {12345678-1234-1234-1234-00aa00bbf7c7} redmond\\jdoe password\n"));
00104
00105     exit (0);
00106 }
00107
00108 /*---------------------------------------------------------------------------*\
00109  * NAME: HandleDefaultLaunchOption                                           *
00110  * --------------------------------------------------------------------------*
00111  * DESCRIPTION:
00112 \*---------------------------------------------------------------------------*/
00113 void Error (
00114     LPTSTR tszErrorMessage,
00115     DWORD dwErrorCode
00116     )
00117 {
00118     TCHAR tszMessageBuffer [SIZE_MSG_BUFFER] = {0};
00119
00120     _tprintf (_T("%s\n%s"), tszErrorMessage, SystemMessage (tszMessageBuffer,  sizeof(tszMessageBuffer)/sizeof(*tszMessageBuffer), dwErrorCode));
00121     exit (0);
00122 }
00123
00124
00125 /*---------------------------------------------------------------------------*\
00126  * NAME: HandleDefaultLaunchOption                                           *
00127  * --------------------------------------------------------------------------*
00128  * DESCRIPTION:
00129 \*---------------------------------------------------------------------------*/
00130 void SetAccessMaskFromCommandLine (
00131     LPTSTR ptszArg,
00132     DWORD *pdwAccessMask,
00133     DWORD dwSDType
00134     )
00135 {
00136     LPTSTR ptszToken = NULL;
00137
00138     *pdwAccessMask = 0;
00139
00140     ptszToken = _tcstok(ptszArg, _T(":"));
00141
00142     if(!ptszToken || _tcsicmp (ptszToken, _T("LEVEL")) != 0)
00143     {
00144         ShowUsage(_T("Invalid LEVEL argument"));
00145     }
00146
00147     ptszToken = _tcstok(NULL, _T(","));
00148
00149     if(!ptszToken)
00150     {
00151         ShowUsage(_T("Invalid LEVEL argument"));
00152     }
00153
00154     if(dwSDType & SDTYPE_ACCESS) do
00155     {
00156
00157         if(_tcsicmp (ptszToken, _T("L")) == 0)
00158         {
00159             *pdwAccessMask |= COM_RIGHTS_EXECUTE_LOCAL | COM_RIGHTS_EXECUTE;
00160         }
00161         else if(_tcsicmp (ptszToken, _T("R")) == 0)
00162         {
00163             *pdwAccessMask |= COM_RIGHTS_EXECUTE_REMOTE | COM_RIGHTS_EXECUTE;
00164         }
00165         else
00166         {
00167             ShowUsage(_T("Invalid LEVEL argument"));
00168         }
00169
00170     }while(ptszToken = _tcstok(NULL, _T(",")));
00171     else do
00172     {
00173
00174         if(_tcsicmp (ptszToken, _T("LL")) == 0)
00175         {
00176             *pdwAccessMask |= COM_RIGHTS_EXECUTE_LOCAL | COM_RIGHTS_EXECUTE;
00177         }
00178         else if(_tcsicmp (ptszToken, _T("LA")) == 0)
00179         {
00180             *pdwAccessMask |= COM_RIGHTS_ACTIVATE_LOCAL | COM_RIGHTS_EXECUTE;
00181         }
00182         else if(_tcsicmp (ptszToken, _T("RL")) == 0)
00183         {
00184             *pdwAccessMask |= COM_RIGHTS_EXECUTE_REMOTE | COM_RIGHTS_EXECUTE;
00185         }
00186         else if(_tcsicmp (ptszToken, _T("RA")) == 0)
00187         {
00188             *pdwAccessMask |= COM_RIGHTS_ACTIVATE_REMOTE | COM_RIGHTS_EXECUTE;
00189         }
00190         else if(_tcsicmp (ptszToken, _T("L")) == 0)
00191         {
00192             *pdwAccessMask |= COM_RIGHTS_ACTIVATE_LOCAL | COM_RIGHTS_EXECUTE_LOCAL | COM_RIGHTS_EXECUTE;
00193         }
00194         else if(_tcsicmp (ptszToken, _T("R")) == 0)
00195         {
00196             *pdwAccessMask |= COM_RIGHTS_ACTIVATE_REMOTE | COM_RIGHTS_EXECUTE_REMOTE | COM_RIGHTS_EXECUTE;
00197         }
00198         else
00199         {
00200             ShowUsage(_T("Invalid LEVEL argument"));
00201         }
00202
00203     }while(ptszToken = _tcstok(NULL, _T(",")));
00204
00205 }
00206
00207 /*---------------------------------------------------------------------------*\
00208  * NAME: HandleDefaultLaunchOption                                           *
00209  * --------------------------------------------------------------------------*
00210  * DESCRIPTION:
00211 \*---------------------------------------------------------------------------*/
00212 void HandleMachineAccessOption (
00213     int cArgs,
00214     TCHAR **pptszArgv
00215     )
00216 {
00217
00218     DWORD dwReturnValue = ERROR_SUCCESS;
00219     DWORD dwAccessMask = COM_RIGHTS_EXECUTE;
00220
00221     if (cArgs < 3) ShowUsage (_T("Invalid number of arguments."));
00222
00223     if (_tcsicmp (pptszArgv [2], _T("LIST")) == 0)
00224     {
00225         _tprintf (_T("Machine access permission list:\n\n"));
00226         dwReturnValue = ListMachineAccessACL();
00227         if (dwReturnValue != ERROR_SUCCESS)
00228         {
00229             Error (_T("ERROR: Cannot list default access permission list."), dwReturnValue);
00230         }
00231         return;
00232     }
00233
00234     if (cArgs < 4) ShowUsage (_T("Invalid number of arguments."));
00235
00236     if (_tcsicmp (pptszArgv [2], _T("SET")) == 0)
00237     {
00238         if (cArgs < 5) ShowUsage (_T("Invalid number of arguments."));
00239
00240         if(cArgs == 6)
00241         {
00242             SetAccessMaskFromCommandLine(pptszArgv[5], &dwAccessMask, SDTYPE_MACHINE_ACCESS);
00243         }
00244         else if(!IsLegacySecurityModel())
00245         {
00246             _tprintf (_T("WARNING: Default access flags designated on a system with an enhanced security model.\n"));
00247         }
00248
00249         if (_tcsicmp (pptszArgv [4], _T("PERMIT")) == 0)
00250         {
00251             dwReturnValue = ChangeMachineAccessACL (pptszArgv [3], TRUE, TRUE, dwAccessMask);
00252         }
00253         else if (_tcsicmp (pptszArgv [4], _T("DENY")) == 0)
00254         {
00255             dwReturnValue = ChangeMachineAccessACL (pptszArgv [3], TRUE, FALSE, dwAccessMask);
00256         }
00257         else
00258         {
00259             ShowUsage (_T("You can only set a user's permissions to \"permit\" or \"deny\".\n\n"));
00260         }
00261
00262         if (dwReturnValue != ERROR_SUCCESS)
00263         {
00264             Error (_T("ERROR: Cannot add user to machine access ACL."), dwReturnValue);
00265         }
00266     }
00267     else if (_tcsicmp (pptszArgv [2], _T("REMOVE")) == 0)
00268     {
00269         dwReturnValue = ChangeMachineAccessACL (pptszArgv[3], FALSE, FALSE, dwAccessMask);
00270
00271         if (dwReturnValue != ERROR_SUCCESS)
00272         {
00273             Error (_T("ERROR: Cannot remove user from machine access ACL."), dwReturnValue);
00274         }
00275     }
00276     else
00277     {
00278         ShowUsage (_T("You can only \"set\" or \"remove\" a user."));
00279     }
00280
00281      _tprintf (_T("Successfully set the Machine Access ACL.\n"));
00282
00283     ListMachineAccessACL();
00284
00285 }
00286
00287
00288 /*---------------------------------------------------------------------------*\
00289  * NAME: HandleDefaultLaunchOption                                           *
00290  * --------------------------------------------------------------------------*
00291  * DESCRIPTION:
00292 \*---------------------------------------------------------------------------*/
00293 void HandleMachineLaunchAndActivateOption (
00294     int cArgs,
00295     TCHAR **pptszArgv
00296     )
00297 {
00298     DWORD dwReturnValue = ERROR_SUCCESS;
00299     DWORD dwAccessMask = COM_RIGHTS_EXECUTE;
00300
00301
00302     if (cArgs < 3) ShowUsage (_T("Invalid number of arguments."));
00303
00304     if (_tcsicmp (pptszArgv [2], _T("LIST")) == 0)
00305     {
00306         _tprintf (_T("Machine launch permission list:\n\n"));
00307         dwReturnValue = ListMachineLaunchACL();
00308
00309         if (dwReturnValue != ERROR_SUCCESS)
00310         {
00311             Error (_T("ERROR: Cannot list default launch ACL."), dwReturnValue);
00312         }
00313
00314         return;
00315     }
00316
00317     if (cArgs < 4) ShowUsage (_T("Invalid number of arguments."));
00318
00319     if (_tcsicmp (pptszArgv [2], _T("SET")) == 0)
00320     {
00321         if (cArgs < 5) ShowUsage (_T("Invalid number of arguments."));
00322
00323         if(cArgs == 6)
00324         {
00325             SetAccessMaskFromCommandLine(pptszArgv[5], &dwAccessMask, SDTYPE_MACHINE_LAUNCH);
00326         }
00327         else if(!IsLegacySecurityModel())
00328         {
00329             _tprintf (_T("WARNING: Default access flags designated on a system with an enhanced security model.\n"));
00330         }
00331
00332         if (_tcsicmp (pptszArgv [4], _T("PERMIT")) == 0)
00333         {
00334             dwReturnValue = ChangeMachineLaunchAndActivateACL (pptszArgv [3], TRUE, TRUE, dwAccessMask);
00335         }
00336         else if (_tcsicmp (pptszArgv [4], _T("DENY")) == 0)
00337         {
00338             dwReturnValue = ChangeMachineLaunchAndActivateACL (pptszArgv [3], TRUE, FALSE, dwAccessMask);
00339         }
00340         else
00341         {
00342             ShowUsage (_T("You can only set a user's permissions to \"permit\" or \"deny\".\n\n"));
00343         }
00344
00345         if (dwReturnValue != ERROR_SUCCESS)
00346         {
00347             Error (_T("ERROR: Cannot add user to machine launch ACL."), dwReturnValue);
00348         }
00349
00350     }
00351     else if (_tcsicmp (pptszArgv [2], _T("REMOVE")) == 0)
00352     {
00353         dwReturnValue = ChangeMachineLaunchAndActivateACL (pptszArgv[3], FALSE, FALSE, dwAccessMask);
00354
00355         if (dwReturnValue != ERROR_SUCCESS)
00356         {
00357             Error (_T("ERROR: Cannot remove user from machine launch ACL."), dwReturnValue);
00358         }
00359     }
00360     else
00361     {
00362         ShowUsage (_T("You can only \"set\" or \"remove\" a user."));
00363     }
00364
00365      _tprintf (_T("Successfully set the Machine Launch ACL.\n"));
00366
00367     ListMachineLaunchACL();
00368
00369 }
00370
00371
00372
00373 /*---------------------------------------------------------------------------*\
00374  * NAME: HandleDefaultLaunchOption                                           *
00375  * --------------------------------------------------------------------------*
00376  * DESCRIPTION:
00377 \*---------------------------------------------------------------------------*/
00378 void HandleDefaultAccessOption (
00379     int cArgs,
00380     TCHAR **pptszArgv
00381     )
00382 {
00383     DWORD dwReturnValue = ERROR_SUCCESS;
00384     DWORD dwAccessMask = COM_RIGHTS_EXECUTE;
00385
00386     if (cArgs < 3) ShowUsage (_T("Invalid number of arguments."));
00387
00388     if (_tcsicmp (pptszArgv [2], _T("LIST")) == 0)
00389     {
00390         _tprintf (_T("Default access permission list:\n\n"));
00391         dwReturnValue = ListDefaultAccessACL();
00392         if (dwReturnValue != ERROR_SUCCESS)
00393         {
00394             Error (_T("ERROR: Cannot list default access permission list."), dwReturnValue);
00395         }
00396         return;
00397     }
00398
00399     if (cArgs < 4) ShowUsage (_T("Invalid number of arguments."));
00400
00401     if (_tcsicmp (pptszArgv [2], _T("SET")) == 0)
00402     {
00403         if (cArgs < 5) ShowUsage (_T("Invalid number of arguments."));
00404
00405         if(cArgs == 6)
00406         {
00407             SetAccessMaskFromCommandLine(pptszArgv[5], &dwAccessMask, SDTYPE_DEFAULT_ACCESS);
00408         }
00409         else if(!IsLegacySecurityModel())
00410         {
00411             _tprintf (_T("WARNING: Default access flags designated on a system with an enhanced security model.\n"));
00412         }
00413
00414         if (_tcsicmp (pptszArgv [4], _T("PERMIT")) == 0)
00415         {
00416             dwReturnValue = ChangeDefaultAccessACL (pptszArgv [3], TRUE, TRUE, dwAccessMask);
00417         }
00418         else if (_tcsicmp (pptszArgv [4], _T("DENY")) == 0)
00419         {
00420             dwReturnValue = ChangeDefaultAccessACL (pptszArgv [3], TRUE, FALSE, dwAccessMask);
00421         }
00422         else
00423         {
00424             ShowUsage (_T("You can only set a user's permissions to \"permit\" or \"deny\".\n\n"));
00425         }
00426
00427         if (dwReturnValue != ERROR_SUCCESS)
00428         {
00429             Error (_T("ERROR: Cannot add user to default access ACL."), dwReturnValue);
00430         }
00431     }
00432     else if (_tcsicmp (pptszArgv [2], _T("REMOVE")) == 0)
00433     {
00434         dwReturnValue = ChangeDefaultAccessACL (pptszArgv[3], FALSE, FALSE, dwAccessMask);
00435
00436         if (dwReturnValue != ERROR_SUCCESS)
00437         {
00438             Error (_T("ERROR: Cannot remove user from default access ACL."), dwReturnValue);
00439         }
00440     }
00441     else
00442     {
00443         ShowUsage (_T("You can only \"set\" or \"remove\" a user."));
00444     }
00445
00446      _tprintf (_T("Successfully set the Default Access ACL.\n"));
00447
00448     ListDefaultAccessACL();
00449 }
00450
00451 /*---------------------------------------------------------------------------*\
00452  * NAME: HandleDefaultLaunchOption                                           *
00453  * --------------------------------------------------------------------------*
00454  * DESCRIPTION:
00455 \*---------------------------------------------------------------------------*/
00456 void HandleDefaultLaunchOption (
00457     int cArgs,
00458     TCHAR **pptszArgv
00459     )
00460 {
00461     DWORD dwReturnValue = ERROR_SUCCESS;
00462     DWORD dwAccessMask = COM_RIGHTS_EXECUTE;
00463
00464     if (cArgs < 3) ShowUsage (_T("Invalid number of arguments."));
00465
00466     if (_tcsicmp (pptszArgv [2], _T("LIST")) == 0)
00467     {
00468         _tprintf (_T("Default launch permission list:\n\n"));
00469         dwReturnValue = ListDefaultLaunchACL();
00470
00471         if (dwReturnValue != ERROR_SUCCESS)
00472         {
00473             Error (_T("ERROR: Cannot list default launch ACL."), dwReturnValue);
00474         }
00475
00476         return;
00477     }
00478
00479     if (cArgs < 4) ShowUsage (_T("Invalid number of arguments."));
00480
00481     if (_tcsicmp (pptszArgv [2], _T("SET")) == 0)
00482     {
00483         if (cArgs < 5) ShowUsage (_T("Invalid number of arguments."));
00484
00485         if(cArgs == 6)
00486         {
00487             SetAccessMaskFromCommandLine(pptszArgv[5], &dwAccessMask, SDTYPE_DEFAULT_LAUNCH);
00488         }
00489         else if(!IsLegacySecurityModel())
00490         {
00491             _tprintf (_T("WARNING: Default access flags designated on a system with an enhanced security model.\n"));
00492         }
00493
00494         if (_tcsicmp (pptszArgv [4], _T("PERMIT")) == 0)
00495         {
00496             dwReturnValue = ChangeDefaultLaunchAndActivateACL (pptszArgv [3], TRUE, TRUE, dwAccessMask);
00497         }
00498         else if (_tcsicmp (pptszArgv [4], _T("DENY")) == 0)
00499         {
00500             dwReturnValue = ChangeDefaultLaunchAndActivateACL (pptszArgv [3], TRUE, FALSE, dwAccessMask);
00501         }
00502         else
00503         {
00504             ShowUsage (_T("You can only set a user's permissions to \"permit\" or \"deny\".\n\n"));
00505         }
00506
00507         if (dwReturnValue != ERROR_SUCCESS)
00508         {
00509             Error (_T("ERROR: Cannot add user to default launch ACL."), dwReturnValue);
00510         }
00511
00512     }
00513     else if (_tcsicmp (pptszArgv [2], _T("REMOVE")) == 0)
00514     {
00515         dwReturnValue = ChangeDefaultLaunchAndActivateACL (pptszArgv[3], FALSE, FALSE, dwAccessMask);
00516
00517         if (dwReturnValue != ERROR_SUCCESS)
00518         {
00519             Error (_T("ERROR: Cannot remove user from default launch ACL."), dwReturnValue);
00520         }
00521     }
00522     else
00523     {
00524         ShowUsage (_T("You can only \"set\" or \"remove\" a user."));
00525     }
00526
00527      _tprintf (_T("Successfully set the Default Launch ACL.\n"));
00528
00529     ListDefaultLaunchACL();
00530 }
00531
00532 void HandleApplicationAccessOption (
00533     int cArgs,
00534     TCHAR **pptszArgv
00535     )
00536 {
00537     DWORD dwReturnValue                 = ERROR_SUCCESS;
00538     HKEY  hkeyRegistry                  = NULL;
00539     TCHAR tszAppID [SIZE_NAME_BUFFER]   = {0};
00540     TCHAR tszKeyName [SIZE_NAME_BUFFER] = {0};
00541
00542     DWORD dwAccessMask = COM_RIGHTS_EXECUTE;
00543
00544     if (cArgs < 4)
00545         ShowUsage (_T("Invalid number of arguments."));
00546
00547     if (_tcsicmp (pptszArgv[3], _T("LIST")) == 0)
00548     {
00549         if (cArgs < 4) ShowUsage (_T("Invalid number of arguments."));
00550
00551         _tprintf (_T("Access permission list for AppID %s:\n\n"), pptszArgv[2]);
00552
00553         ListAppIDAccessACL (pptszArgv[2]);
00554
00555         return;
00556     }
00557
00558     if (_tcsicmp (pptszArgv[3], _T("DEFAULT")) == 0)
00559     {
00560
00561         _sntprintf (tszAppID, (sizeof(tszAppID)/sizeof(*tszAppID))-1, pptszArgv [2][0] == '{' ? _T("%s") : _T("{%s}"), pptszArgv [2]);
00562         _sntprintf (tszKeyName, (sizeof(tszKeyName)/sizeof(*tszKeyName))-1, _T("APPID\\%s"), tszAppID);
00563
00564         dwReturnValue = RegOpenKeyEx (HKEY_CLASSES_ROOT, tszKeyName, 0, KEY_ALL_ACCESS, &hkeyRegistry);
00565         if (dwReturnValue != ERROR_SUCCESS && dwReturnValue != ERROR_FILE_NOT_FOUND)
00566         {
00567             Error (_T("ERROR: Cannot open AppID registry key."), dwReturnValue);
00568         }
00569
00570         dwReturnValue = RegDeleteValue (hkeyRegistry, _T("AccessPermission"));
00571         if (dwReturnValue != ERROR_SUCCESS && dwReturnValue != ERROR_FILE_NOT_FOUND)
00572         {
00573             Error (_T("ERROR: Cannot delete AccessPermission value."), dwReturnValue);
00574         }
00575
00576         if(hkeyRegistry) RegCloseKey (hkeyRegistry);
00577
00578         _tprintf (_T("Successfully set the Application Access to the machine default.\n"));
00579
00580         return;
00581     }
00582
00583     if (cArgs < 5) ShowUsage (_T("Invalid number of arguments."));
00584
00585     if (_tcsicmp (pptszArgv [3], _T("SET")) == 0)
00586     {
00587          if (cArgs < 6) ShowUsage (_T("Invalid number of arguments."));
00588
00589         if(cArgs == 7)
00590         {
00591             SetAccessMaskFromCommandLine(pptszArgv[6], &dwAccessMask, SDTYPE_APPLICATION_ACCESS);
00592         }
00593         else if(!IsLegacySecurityModel())
00594         {
00595             _tprintf (_T("WARNING: Default access flags designated on a system with an enhanced security model.\n"));
00596         }
00597
00598         if (_tcsicmp (pptszArgv [5], _T("PERMIT")) == 0)
00599         {
00600             dwReturnValue = ChangeAppIDAccessACL (pptszArgv[2], pptszArgv [4], TRUE, TRUE, dwAccessMask);
00601         }
00602         else if (_tcsicmp (pptszArgv [5], _T("DENY")) == 0)
00603         {
00604             dwReturnValue = ChangeAppIDAccessACL (pptszArgv[2], pptszArgv [4], TRUE, FALSE, dwAccessMask);
00605         }
00606         else
00607         {
00608             ShowUsage (_T("You can only set a user's permissions to \"permit\" or \"deny\".\n\n"));
00609         }
00610
00611         if (dwReturnValue != ERROR_SUCCESS)
00612         {
00613             Error (_T("ERROR: Cannot add user to application access ACL."), dwReturnValue);
00614         }
00615     }
00616     else if (_tcsicmp (pptszArgv [3], _T("REMOVE")) == 0)
00617     {
00618         dwReturnValue = ChangeAppIDAccessACL (pptszArgv[2], pptszArgv[4], FALSE, FALSE, dwAccessMask);
00619
00620         if (dwReturnValue != ERROR_SUCCESS)
00621         {
00622             Error (_T("ERROR: Cannot remove user from application access ACL."), dwReturnValue);
00623         }
00624
00625     }
00626     else
00627     {
00628         ShowUsage (_T("You can only \"set\" or \"remove\" a user."));
00629     }
00630
00631      _tprintf (_T("Successfully set the Application Access ACL.\n"));
00632
00633     ListAppIDAccessACL(pptszArgv[2]);
00634 }
00635
00636 void HandleApplicationLaunchAndActivateOption (
00637     int cArgs,
00638     TCHAR **pptszArgv
00639     )
00640 {
00641     DWORD dwReturnValue                 = ERROR_SUCCESS;
00642     HKEY  hkeyRegistry                  = NULL;
00643     TCHAR tszAppID [SIZE_NAME_BUFFER]   = {0};
00644     TCHAR tszKeyName [SIZE_NAME_BUFFER] = {0};
00645
00646     DWORD dwAccessMask = COM_RIGHTS_EXECUTE;
00647
00648     if (cArgs < 4) ShowUsage (_T("Invalid number of arguments."));
00649
00650     if (_tcsicmp (pptszArgv[3], _T("LIST")) == 0)
00651     {
00652         if (cArgs < 4) ShowUsage (_T("Invalid number of arguments.\n"));
00653
00654         _tprintf (_T("Launch permission list for AppID %s:\n\n"), pptszArgv[2]);
00655         ListAppIDLaunchACL (pptszArgv[2]);
00656         return;
00657     }
00658
00659     if (_tcsicmp (pptszArgv[3], _T("DEFAULT")) == 0)
00660     {
00661
00662
00663         _sntprintf (tszAppID, (sizeof(tszAppID)/sizeof(*tszAppID))-1, pptszArgv [2][0] == '{' ? _T("%s") : _T("{%s}"), pptszArgv [2]);
00664         _sntprintf (tszKeyName, (sizeof(tszKeyName)/sizeof(*tszKeyName))-1, _T("APPID\\%s"), tszAppID);
00665
00666
00667         dwReturnValue = RegOpenKeyEx (HKEY_CLASSES_ROOT, tszKeyName, 0, KEY_ALL_ACCESS, &hkeyRegistry);
00668         if (dwReturnValue != ERROR_SUCCESS && dwReturnValue != ERROR_FILE_NOT_FOUND)
00669         {
00670             Error (_T("ERROR: Cannot open AppID registry key."), dwReturnValue);
00671         }
00672
00673         dwReturnValue = RegDeleteValue (hkeyRegistry, _T("LaunchPermission"));
00674         if (dwReturnValue != ERROR_SUCCESS && dwReturnValue != ERROR_FILE_NOT_FOUND)
00675         {
00676             Error (_T("ERROR: Cannot delete LaunchPermission value."), dwReturnValue);
00677         }
00678
00679         if(hkeyRegistry) RegCloseKey (hkeyRegistry);
00680
00681         _tprintf (_T("Successfully set the Application Launch to the machine default.\n"));
00682
00683         return;
00684     }
00685
00686     if (cArgs < 5) ShowUsage (_T("Invalid number of arguments."));
00687
00688     if (_tcsicmp (pptszArgv [3], _T("SET")) == 0)
00689     {
00690         if (cArgs < 6) ShowUsage (_T("Invalid number of arguments."));
00691
00692         if(cArgs == 7)
00693         {
00694             SetAccessMaskFromCommandLine(pptszArgv[6], &dwAccessMask, SDTYPE_APPLICATION_LAUNCH);
00695         }
00696         else if(!IsLegacySecurityModel())
00697         {
00698             _tprintf (_T("WARNING: Default access flags designated on a system with an enhanced security model.\n"));
00699         }
00700
00701         if (_tcsicmp (pptszArgv [5], _T("PERMIT")) == 0)
00702         {
00703             dwReturnValue = ChangeAppIDLaunchAndActivateACL (pptszArgv[2], pptszArgv [4], TRUE, TRUE, dwAccessMask);
00704         }
00705         else if (_tcsicmp (pptszArgv [5], _T("DENY")) == 0)
00706         {
00707             dwReturnValue = ChangeAppIDLaunchAndActivateACL (pptszArgv[2], pptszArgv [4], TRUE, FALSE, dwAccessMask);
00708         }
00709         else
00710         {
00711             ShowUsage (_T("You can only set a user's permissions to \"permit\" or \"deny\".\n\n"));
00712         }
00713
00714         if (dwReturnValue != ERROR_SUCCESS)
00715             Error (_T("ERROR: Cannot add user to application launch ACL."), dwReturnValue);
00716     }
00717     else if (_tcsicmp (pptszArgv [3], _T("REMOVE")) == 0)
00718     {
00719         dwReturnValue = ChangeAppIDLaunchAndActivateACL (pptszArgv[2], pptszArgv[4], FALSE, FALSE, dwAccessMask);
00720
00721         if (dwReturnValue != ERROR_SUCCESS)
00722         {
00723             Error (_T("ERROR: Cannot remove user from application launch ACL."), dwReturnValue);
00724         }
00725     }
00726     else
00727     {
00728         ShowUsage (_T("You can only \"set\" or \"remove\" a user."));
00729     }
00730
00731      _tprintf (_T("Successfully set the Application Launch ACL.\n"));
00732
00733     ListAppIDLaunchACL(pptszArgv[2]);
00734 }
00735
00736 void HandleRunAsOption (
00737     int cArgs,
00738     TCHAR **pptszArgv
00739     )
00740 {
00741     DWORD dwReturnValue                 = ERROR_SUCCESS;
00742     HKEY  hkeyRegistry                  = NULL;
00743     TCHAR tszAppID [SIZE_NAME_BUFFER]   = {0};
00744     TCHAR tszKeyName [SIZE_NAME_BUFFER] = {0};
00745
00746     if (cArgs < 4) ShowUsage (_T("Invalid number of arguments."));
00747
00748     _sntprintf (tszAppID, (sizeof(tszAppID)/sizeof(*tszAppID))-1, pptszArgv [2][0] == '{' ? _T("%s") : _T("{%s}"), pptszArgv [2]);
00749     _sntprintf (tszKeyName, (sizeof(tszKeyName)/sizeof(*tszKeyName))-1, _T("APPID\\%s"), tszAppID);
00750
00751     dwReturnValue = RegOpenKeyEx (HKEY_CLASSES_ROOT, tszKeyName, 0, KEY_ALL_ACCESS, &hkeyRegistry);
00752     if (dwReturnValue != ERROR_SUCCESS)
00753     {
00754         Error (_T("ERROR: Cannot open AppID registry key."), dwReturnValue);
00755     }
00756
00757     if (_tcsicmp (pptszArgv[3], _T("LAUNCHING USER")) == 0)
00758     {
00759         dwReturnValue = RegDeleteValue(hkeyRegistry, _T("RunAs"));
00760
00761         if(dwReturnValue == ERROR_FILE_NOT_FOUND)
00762         {
00763             dwReturnValue = ERROR_SUCCESS;
00764         }
00765         else if (dwReturnValue != ERROR_SUCCESS)
00766         {
00767             Error (_T("ERROR: Cannot remove RunAs registry value."), dwReturnValue);
00768         }
00769
00770     }
00771     else
00772     {
00773         if (_tcsicmp (pptszArgv[3], _T("INTERACTIVE USER")) != 0)
00774         {
00775             if (cArgs < 5) ShowUsage (_T("Invalid number of arguments."));
00776
00777             dwReturnValue = SetRunAsPassword (pptszArgv[2], pptszArgv[3], pptszArgv[4]);
00778             if (dwReturnValue != ERROR_SUCCESS)
00779             {
00780                 Error (_T("ERROR: Cannot set RunAs password."), dwReturnValue);
00781             }
00782         }
00783
00784         dwReturnValue = RegSetValueEx (hkeyRegistry, _T("RunAs"), 0, REG_SZ, (LPBYTE) pptszArgv [3], (DWORD)_tcslen (pptszArgv[3]) * sizeof (TCHAR));
00785         if (dwReturnValue != ERROR_SUCCESS)
00786         {
00787             Error (_T("ERROR: Cannot set RunAs registry value."), dwReturnValue);
00788         }
00789     }
00790
00791
00792     if(hkeyRegistry) RegCloseKey (hkeyRegistry);
00793
00794 }
00795
00796 extern "C" void _tmain (
00797     int cArgs,
00798     TCHAR **pptszArgv
00799     )
00800 {
00801     if (cArgs < 2) ShowUsage (_T("No option specified."));
00802
00803     if (_tcsicmp (pptszArgv [1], _T("-DA")) == 0)
00804     {
00805         HandleDefaultAccessOption (cArgs, pptszArgv);
00806     }
00807     else if (_tcsicmp (pptszArgv [1], _T("-DL")) == 0)
00808     {
00809         HandleDefaultLaunchOption (cArgs, pptszArgv);
00810     }
00811     else if (_tcsicmp (pptszArgv [1], _T("-AA")) == 0)
00812     {
00813         HandleApplicationAccessOption (cArgs, pptszArgv);
00814     }
00815     else if (_tcsicmp (pptszArgv [1], _T("-AL")) == 0)
00816     {
00817         HandleApplicationLaunchAndActivateOption (cArgs, pptszArgv);
00818     }
00819     else if (_tcsicmp (pptszArgv [1], _T("-MA")) == 0)
00820     {
00821         HandleMachineAccessOption (cArgs, pptszArgv);
00822     }
00823     else if (_tcsicmp (pptszArgv [1], _T("-ML")) == 0)
00824     {
00825         HandleMachineLaunchAndActivateOption (cArgs, pptszArgv);
00826     }
00827     else if (_tcsicmp (pptszArgv [1], _T("-RUNAS")) == 0)
00828     {
00829         HandleRunAsOption (cArgs, pptszArgv);
00830     }
00831     else
00832     {
00833         ShowUsage (_T("Invalid option specified."));
00834     }
00835
00836 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/basenode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

basenode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  Generic base node class.  All nodes are derived from this.
00014
00015
00016 #ifndef _CLASS_CBASENODE_
00017 #define _CLASS_CBASENODE_
00018
00019 #include "Globals.h"
00020 #include "Resource.h"
00021
00022
00023 #define DEFAULT_SDI_MASK  (SDI_STR | SDI_PARAM | SDI_IMAGE | SDI_OPENIMAGE | SDI_PARENT | SDI_CHILDREN)
00024 #define DEFAULT_RDI_MASK  (RDI_STR | RDI_PARAM | RDI_IMAGE)
00025
00026 #define MAX_NAME_LEN     64
00027
00028
00029 class CBaseNode;
00030
00031
00032 //---------------------------------------------------------------------------
00033 //  Data types specific to this object
00034 //
00035 typedef struct tag_BASENODE_PROPERTIES
00036 {
00037   WCHAR      szNodeName[MAX_NAME_LEN];
00038   LONG_PTR   pComponentData;
00039   LONG_PTR   pParentObject;
00040   DWORD      dwAttributes;
00041
00042 }NODE_PROPERTIES;
00043
00044
00045 typedef NODE_PROPERTIES*  LPNODE_PROPERTIES;
00046 typedef CBaseNode*        LPBASENODE;
00047
00048
00049 //---------------------------------------------------------------------------
00050 class CBaseNode
00051 {
00052   public:
00053     CBaseNode()
00054     {
00055       m_pwszNodeName   = NULL;
00056       m_nPropPageCount = 0;
00057       m_dwAttributes   = 0;
00058       *m_pAttributeStr = NULL;
00059
00060       ZeroMemory( &m_SDI, sizeof(SCOPEDATAITEM) );
00061       ZeroMemory( &m_RDI, sizeof(RESULTDATAITEM) );
00062     };
00063
00064     virtual ~CBaseNode()
00065     {
00066       if( NULL != m_pwszNodeName )
00067         CoTaskMemFree( m_pwszNodeName );
00068     };
00069
00070   public:
00071     LPWSTR   GetNodeName()     { return m_pwszNodeName;  };
00072
00073     virtual  HRESULT Initialize( NODE_PROPERTIES* pProperties ) = 0;
00074     virtual  ULONG   GetNodeType() = 0;
00075     virtual  GUID&   GetNodeGUID() = 0;
00076
00077   ///////////////////////////////////////////////////////////////////////////
00078   //  IExtendPropertySheet2 methods
00079   public:
00080     virtual  HRESULT QueryForPropertyPage() = 0;
00081     virtual  HRESULT CreatePropertyPages( LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle ) = 0;
00082     virtual  HRESULT GetWatermarks( HBITMAP __RPC_FAR *lphWatermark,
00083                                     HBITMAP __RPC_FAR *lphHeader,
00084                                     HPALETTE __RPC_FAR *lphPalette,
00085                                     BOOL __RPC_FAR *bStretch ) = 0;
00086
00087   ///////////////////////////////////////////////////////////////////////////
00088   // These virtual methods handle calls from the console
00089   public:
00090     virtual  HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI ) = 0;
00091     virtual  HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI ) = 0;
00092     virtual  HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo ) = 0;
00093
00094   ///////////////////////////////////////////////////////////////////////////
00095   // Context menu methods
00096   public:
00097     virtual  HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed ) = 0;
00098     virtual  HRESULT Command( long lCommandID ) = 0;
00099
00100   ///////////////////////////////////////////////////////////////////////////
00101   // Notification handlers
00102   public:
00103     virtual  HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent ) = 0;
00104     virtual  HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent ) = 0;
00105     virtual  HRESULT OnExpand( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData ) = 0;
00106     virtual  HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData ) = 0;
00107     virtual  HRESULT OnDelete( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent ) = 0;
00108
00109     virtual  HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00110                      { return E_NOTIMPL; };
00111
00112   public:
00113     SCOPEDATAITEM    m_SDI;
00114     RESULTDATAITEM   m_RDI;
00115
00116   protected:
00117     LPWSTR     m_pwszNodeName;
00118     LONG       m_nPropPageCount;       // Added to support Property Pages
00119
00120   ///////////////////////////////////////////////////////////////////////////
00121   // XPROPPAGE:  Data and methods to support node attributes
00122
00123   public:
00124     DWORD      m_dwAttributes;         // Attribute flags
00125     WCHAR      m_pAttributeStr[16];    // Attribute string
00126
00127     virtual BOOL    IsAttributeSet( DWORD dwAttribute ) = 0;
00128     virtual VOID    SetAttribute( DWORD dwAttribute ) = 0;
00129     virtual VOID    RemoveAttribute( DWORD dwAttribute ) = 0;
00130     virtual LPWSTR  GetAttributeString() = 0;
00131     virtual DWORD   GetAttributes() = 0;
00132     virtual LPWSTR  GetObjectPath() = 0;
00133
00134 }; //end class CBaseNode
00135
00136 #endif //_CLASS_CBASENODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLanguageResourceSampleCF Member List

This is the complete list of members for CLanguageResourceSampleCF, including all inherited members.
_lRefs | CLanguageResourceSampleCF | [protected]
AddRef() | CLanguageResourceSampleCF |
CLanguageResourceSampleCF() | CLanguageResourceSampleCF |
CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject) | CLanguageResourceSampleCF |
DllGetClassObject(REFCLSID cid, REFIID iid, void **ppvObj) | CLanguageResourceSampleCF | [friend]
LockServer(BOOL fLock) | CLanguageResourceSampleCF |
QueryInterface(REFIID riid, void **ppvObject) | CLanguageResourceSampleCF |
Release() | CLanguageResourceSampleCF |
~CLanguageResourceSampleCF() | CLanguageResourceSampleCF | [protected]
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CShellExt Member List

This is the complete list of members for CShellExt, including all inherited members.
AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) | CShellExt |
CShellExt() | CShellExt |
DoGAKMenu1(HWND hParent, LPCSTR pszWorkingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd) | CShellExt | [protected]
DoGAKMenu2(HWND hParent, LPCSTR pszWorkingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd) | CShellExt | [protected]
DoGAKMenu3(HWND hParent, LPCSTR pszWorkingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd) | CShellExt | [protected]
DoGAKMenu4(HWND hParent, LPCSTR pszWorkingDir, LPCSTR pszCmd, LPCSTR pszParam, int iShowCmd) | CShellExt | [protected]
dwDestAttribs | CShellExt |
dwSrcAttribs | CShellExt |
Extract(LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) | CShellExt |
GetClassID(LPCLSID lpClassID) | CShellExt |
GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT cchMax) | CShellExt |
GetCurFile(LPOLESTR FAR *lplpszFileName) | CShellExt |
GetIconLocation(UINT uFlags, LPSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags) | CShellExt |
Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, HKEY hKeyID) | CShellExt |
InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) | CShellExt |
IsDirty() | CShellExt |
Load(LPCOLESTR lpszFileName, DWORD grfMode) | CShellExt |
m_cRef | CShellExt | [protected]
m_pDataObj | CShellExt | [protected]
m_szFileUserClickedOn | CShellExt | [protected]
m_szPropSheetFileUserClickedOn | CShellExt |
pszDestFile | CShellExt |
pszSrcFile | CShellExt |
QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) | CShellExt |
QueryInterface(REFIID, LPVOID FAR *) | CShellExt |
ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam) | CShellExt |
Save(LPCOLESTR lpszFileName, BOOL fRemember) | CShellExt |
SaveCompleted(LPCOLESTR lpszFileName) | CShellExt |
STDMETHODIMP_(ULONG) AddRef() | CShellExt |
STDMETHODIMP_(ULONG) Release() | CShellExt |
STDMETHODIMP_(UINT) CopyCallback(HWND hwnd | CShellExt |
wFlags | CShellExt |
wFunc | CShellExt |
~CShellExt() | CShellExt |
Generated on Wed Nov 13 2024 16:57:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/sky.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
00029 HRESULT CSkyBasedVehicle::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00030 {
00031   HRESULT hr;
00032   IUnknown *pUnk = NULL;
00033   IMessageView *pMessageView = NULL;
00034
00035   hr = pConsole->QueryResultView(&pUnk);
00036
00037   if (SUCCEEDED(hr)) {
00038     hr = pUnk->QueryInterface(IID_IMessageView, (void **)&pMessageView);
00039
00040     if (SUCCEEDED(hr)) {
00041       pMessageView->SetIcon(Icon_Information);
00042       pMessageView->SetTitleText(L"Sky-based vehicles");
00043       pMessageView->SetBodyText(L"Sky-based vehicles have no child nodes.");
00044
00045       pMessageView->Release();
00046     }
00047
00048     pUnk->Release();
00049   }
00050
00051   return S_FALSE;
00052 }
00053
00054 HRESULT CSkyBasedVehicle::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00055 {
00056     // error message control
00057   LPOLESTR lpOleStr = NULL;
00058   HRESULT hr = StringFromCLSID(CLSID_MessageView, &lpOleStr);
00059     *ppViewType = lpOleStr;
00060
00061   return hr;
00062 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAppExportDlg Member List

This is the complete list of members for CAppExportDlg, including all inherited members.
CAppExportDlg(CWnd *pParent=NULL) | CAppExportDlg |
DoDataExchange(CDataExchange *pDX) | CAppExportDlg | [protected, virtual]
IDD enum value | CAppExportDlg |
m_bOverwriteFiles | CAppExportDlg | [private]
m_edtApplicationID | CAppExportDlg |
m_edtExportPath | CAppExportDlg |
m_hIcon | CAppExportDlg | [protected]
m_nExportType | CAppExportDlg | [private]
m_pCatalog | CAppExportDlg | [private]
OnClose() | CAppExportDlg | [protected]
OnExportClients() | CAppExportDlg | [protected]
OnExportPathSearch() | CAppExportDlg | [protected]
OnExportUsers() | CAppExportDlg | [protected]
OnExportWithoutUsers() | CAppExportDlg | [protected]
OnInitDialog() | CAppExportDlg | [protected, virtual]
OnOK() | CAppExportDlg | [protected, virtual]
OnOverwriteFiles() | CAppExportDlg | [protected]
ReleaseCatalog() | CAppExportDlg | [private]
set_Catalog(ICOMAdminCatalog *pCatalog) | CAppExportDlg |
Generated on Wed Nov 13 2024 16:55:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Recordset21.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Recordset21.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface Recordset21
00019 /** @com.interface(iid=00000555-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface Recordset21 extends msado15.Recordset20
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1000, type=PROPGET, name="AbsolutePosition", name2="getAbsolutePosition", addFlagsVtable=4)
00027       @com.parameters([type=I4] return) */
00028   public int getAbsolutePosition();
00029
00030   /** @com.method(vtoffset=6, dispid=1000, type=PROPPUT, name="AbsolutePosition", name2="putAbsolutePosition", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] pl) */
00032   public void setAbsolutePosition(int pl);
00033
00034   /** @com.method(vtoffset=7, dispid=1001, type=PROPPUTREF, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00035       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] pvar) */
00036   public void setActiveConnection(Object pvar);
00037
00038   /** @com.method(vtoffset=8, dispid=1001, type=PROPPUT, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00039       @com.parameters([in,type=VARIANT] pvar) */
00040   public void setActiveConnection(Variant pvar);
00041
00042   /** @com.method(vtoffset=9, dispid=1001, type=PROPGET, name="ActiveConnection", name2="getActiveConnection", addFlagsVtable=4)
00043       @com.parameters([type=VARIANT] return) */
00044   public Variant getActiveConnection();
00045
00046   /** @com.method(vtoffset=10, dispid=1002, type=PROPGET, name="BOF", name2="getBOF", addFlagsVtable=4)
00047       @com.parameters([type=BOOLEAN] return) */
00048   public boolean getBOF();
00049
00050   /** @com.method(vtoffset=11, dispid=1003, type=PROPGET, name="Bookmark", name2="getBookmark", addFlagsVtable=4)
00051       @com.parameters([type=VARIANT] return) */
00052   public Variant getBookmark();
00053
00054   /** @com.method(vtoffset=12, dispid=1003, type=PROPPUT, name="Bookmark", name2="putBookmark", addFlagsVtable=4)
00055       @com.parameters([in,type=VARIANT] pvBookmark) */
00056   public void setBookmark(Variant pvBookmark);
00057
00058   /** @com.method(vtoffset=13, dispid=1004, type=PROPGET, name="CacheSize", name2="getCacheSize", addFlagsVtable=4)
00059       @com.parameters([type=I4] return) */
00060   public int getCacheSize();
00061
00062   /** @com.method(vtoffset=14, dispid=1004, type=PROPPUT, name="CacheSize", name2="putCacheSize", addFlagsVtable=4)
00063       @com.parameters([in,type=I4] pl) */
00064   public void setCacheSize(int pl);
00065
00066   /** @com.method(vtoffset=15, dispid=1005, type=PROPGET, name="CursorType", name2="getCursorType", addFlagsVtable=4)
00067       @com.parameters([type=I4] return) */
00068   public int getCursorType();
00069
00070   /** @com.method(vtoffset=16, dispid=1005, type=PROPPUT, name="CursorType", name2="putCursorType", addFlagsVtable=4)
00071       @com.parameters([in,type=I4] plCursorType) */
00072   public void setCursorType(int plCursorType);
00073
00074   /** @com.method(vtoffset=17, dispid=1006, type=PROPGET, name="EOF", name2="getEOF", addFlagsVtable=4)
00075       @com.parameters([type=BOOLEAN] return) */
00076   public boolean getEOF();
00077
00078   /** @com.method(vtoffset=18, dispid=0, type=PROPGET, name="Fields", name2="getFields", addFlagsVtable=4)
00079       @com.parameters([iid=00000564-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00080   public msado15.Fields getFields();
00081
00082   /** @com.method(vtoffset=19, dispid=1008, type=PROPGET, name="LockType", name2="getLockType", addFlagsVtable=4)
00083       @com.parameters([type=I4] return) */
00084   public int getLockType();
00085
00086   /** @com.method(vtoffset=20, dispid=1008, type=PROPPUT, name="LockType", name2="putLockType", addFlagsVtable=4)
00087       @com.parameters([in,type=I4] plLockType) */
00088   public void setLockType(int plLockType);
00089
00090   /** @com.method(vtoffset=21, dispid=1009, type=PROPGET, name="MaxRecords", name2="getMaxRecords", addFlagsVtable=4)
00091       @com.parameters([type=I4] return) */
00092   public int getMaxRecords();
00093
00094   /** @com.method(vtoffset=22, dispid=1009, type=PROPPUT, name="MaxRecords", name2="putMaxRecords", addFlagsVtable=4)
00095       @com.parameters([in,type=I4] plMaxRecords) */
00096   public void setMaxRecords(int plMaxRecords);
00097
00098   /** @com.method(vtoffset=23, dispid=1010, type=PROPGET, name="RecordCount", name2="getRecordCount", addFlagsVtable=4)
00099       @com.parameters([type=I4] return) */
00100   public int getRecordCount();
00101
00102   /** @com.method(vtoffset=24, dispid=1011, type=PROPPUTREF, name="Source", name2="putSource", addFlagsVtable=4)
00103       @com.parameters([in,iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] pvSource) */
00104   public void setSource(Object pvSource);
00105
00106   /** @com.method(vtoffset=25, dispid=1011, type=PROPPUT, name="Source", name2="putSource", addFlagsVtable=4)
00107       @com.parameters([in,type=STRING] pvSource) */
00108   public void setSource(String pvSource);
00109
00110   /** @com.method(vtoffset=26, dispid=1011, type=PROPGET, name="Source", name2="getSource", addFlagsVtable=4)
00111       @com.parameters([type=VARIANT] return) */
00112   public Variant getSource();
00113
00114   /** @com.method(vtoffset=27, dispid=1012, type=METHOD, name="AddNew", addFlagsVtable=4)
00115       @com.parameters([in,type=VARIANT] FieldList, [in,type=VARIANT] Values) */
00116   public void AddNew(Variant FieldList, Variant Values);
00117
00118   /** @com.method(vtoffset=28, dispid=1013, type=METHOD, name="CancelUpdate", addFlagsVtable=4)
00119       @com.parameters() */
00120   public void CancelUpdate();
00121
00122   /** @com.method(vtoffset=29, dispid=1014, type=METHOD, name="Close", addFlagsVtable=4)
00123       @com.parameters() */
00124   public void Close();
00125
00126   /** @com.method(vtoffset=30, dispid=1015, type=METHOD, name="Delete", addFlagsVtable=4)
00127       @com.parameters([in,type=I4] AffectRecords) */
00128   public void Delete(int AffectRecords);
00129
00130   /** @com.method(vtoffset=31, dispid=1016, type=METHOD, name="GetRows", addFlagsVtable=4)
00131       @com.parameters([in,type=I4] Rows, [in,type=VARIANT] Start, [in,type=VARIANT] Fields, [type=VARIANT] return) */
00132   public Variant GetRows(int Rows, Variant Start, Variant Fields);
00133
00134   /** @com.method(vtoffset=32, dispid=1017, type=METHOD, name="Move", addFlagsVtable=4)
00135       @com.parameters([in,type=I4] NumRecords, [in,type=VARIANT] Start) */
00136   public void Move(int NumRecords, Variant Start);
00137
00138   /** @com.method(vtoffset=33, dispid=1018, type=METHOD, name="MoveNext", addFlagsVtable=4)
00139       @com.parameters() */
00140   public void MoveNext();
00141
00142   /** @com.method(vtoffset=34, dispid=1019, type=METHOD, name="MovePrevious", addFlagsVtable=4)
00143       @com.parameters() */
00144   public void MovePrevious();
00145
00146   /** @com.method(vtoffset=35, dispid=1020, type=METHOD, name="MoveFirst", addFlagsVtable=4)
00147       @com.parameters() */
00148   public void MoveFirst();
00149
00150   /** @com.method(vtoffset=36, dispid=1021, type=METHOD, name="MoveLast", addFlagsVtable=4)
00151       @com.parameters() */
00152   public void MoveLast();
00153
00154   /** @com.method(vtoffset=37, dispid=1022, type=METHOD, name="Open", addFlagsVtable=4)
00155       @com.parameters([in,type=VARIANT] Source, [in,type=VARIANT] ActiveConnection, [in,type=I4] CursorType, [in,type=I4] LockType, [in,type=I4] Options) */
00156   public void Open(Variant Source, Variant ActiveConnection, int CursorType, int LockType, int Options);
00157
00158   /** @com.method(vtoffset=38, dispid=1023, type=METHOD, name="Requery", addFlagsVtable=4)
00159       @com.parameters([in,type=I4] Options) */
00160   public void Requery(int Options);
00161
00162   /** @com.method(vtoffset=39, dispid=1610809378, type=METHOD, name="_xResync", addFlagsVtable=4)
00163       @com.parameters([in,type=I4] AffectRecords)
00164       @hidden */
00165   public void _xResync(int AffectRecords);
00166
00167   /** @com.method(vtoffset=40, dispid=1025, type=METHOD, name="Update", addFlagsVtable=4)
00168       @com.parameters([in,type=VARIANT] Fields, [in,type=VARIANT] Values) */
00169   public void Update(Variant Fields, Variant Values);
00170
00171   /** @com.method(vtoffset=41, dispid=1047, type=PROPGET, name="AbsolutePage", name2="getAbsolutePage", addFlagsVtable=4)
00172       @com.parameters([type=I4] return) */
00173   public int getAbsolutePage();
00174
00175   /** @com.method(vtoffset=42, dispid=1047, type=PROPPUT, name="AbsolutePage", name2="putAbsolutePage", addFlagsVtable=4)
00176       @com.parameters([in,type=I4] pl) */
00177   public void setAbsolutePage(int pl);
00178
00179   /** @com.method(vtoffset=43, dispid=1026, type=PROPGET, name="EditMode", name2="getEditMode", addFlagsVtable=4)
00180       @com.parameters([type=I4] return) */
00181   public int getEditMode();
00182
00183   /** @com.method(vtoffset=44, dispid=1030, type=PROPGET, name="Filter", name2="getFilter", addFlagsVtable=4)
00184       @com.parameters([type=VARIANT] return) */
00185   public Variant getFilter();
00186
00187   /** @com.method(vtoffset=45, dispid=1030, type=PROPPUT, name="Filter", name2="putFilter", addFlagsVtable=4)
00188       @com.parameters([in,type=VARIANT] Criteria) */
00189   public void setFilter(Variant Criteria);
00190
00191   /** @com.method(vtoffset=46, dispid=1050, type=PROPGET, name="PageCount", name2="getPageCount", addFlagsVtable=4)
00192       @com.parameters([type=I4] return) */
00193   public int getPageCount();
00194
00195   /** @com.method(vtoffset=47, dispid=1048, type=PROPGET, name="PageSize", name2="getPageSize", addFlagsVtable=4)
00196       @com.parameters([type=I4] return) */
00197   public int getPageSize();
00198
00199   /** @com.method(vtoffset=48, dispid=1048, type=PROPPUT, name="PageSize", name2="putPageSize", addFlagsVtable=4)
00200       @com.parameters([in,type=I4] pl) */
00201   public void setPageSize(int pl);
00202
00203   /** @com.method(vtoffset=49, dispid=1031, type=PROPGET, name="Sort", name2="getSort", addFlagsVtable=4)
00204       @com.parameters([type=STRING] return) */
00205   public String getSort();
00206
00207   /** @com.method(vtoffset=50, dispid=1031, type=PROPPUT, name="Sort", name2="putSort", addFlagsVtable=4)
00208       @com.parameters([in,type=STRING] Criteria) */
00209   public void setSort(String Criteria);
00210
00211   /** @com.method(vtoffset=51, dispid=1029, type=PROPGET, name="Status", name2="getStatus", addFlagsVtable=4)
00212       @com.parameters([type=I4] return) */
00213   public int getStatus();
00214
00215   /** @com.method(vtoffset=52, dispid=1054, type=PROPGET, name="State", name2="getState", addFlagsVtable=4)
00216       @com.parameters([type=I4] return) */
00217   public int getState();
00218
00219   /** @com.method(vtoffset=53, dispid=1610809392, type=METHOD, name="_xClone", addFlagsVtable=4)
00220       @com.parameters([iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return)
00221       @hidden */
00222   public msado15._Recordset _xClone();
00223
00224   /** @com.method(vtoffset=54, dispid=1035, type=METHOD, name="UpdateBatch", addFlagsVtable=4)
00225       @com.parameters([in,type=I4] AffectRecords) */
00226   public void UpdateBatch(int AffectRecords);
00227
00228   /** @com.method(vtoffset=55, dispid=1049, type=METHOD, name="CancelBatch", addFlagsVtable=4)
00229       @com.parameters([in,type=I4] AffectRecords) */
00230   public void CancelBatch(int AffectRecords);
00231
00232   /** @com.method(vtoffset=56, dispid=1051, type=PROPGET, name="CursorLocation", name2="getCursorLocation", addFlagsVtable=4)
00233       @com.parameters([type=I4] return) */
00234   public int getCursorLocation();
00235
00236   /** @com.method(vtoffset=57, dispid=1051, type=PROPPUT, name="CursorLocation", name2="putCursorLocation", addFlagsVtable=4)
00237       @com.parameters([in,type=I4] plCursorLoc) */
00238   public void setCursorLocation(int plCursorLoc);
00239
00240   /** @com.method(vtoffset=58, dispid=1052, type=METHOD, name="NextRecordset", addFlagsVtable=4)
00241       @com.parameters([out,elementType=VARIANT,type=PTR] RecordsAffected, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00242   public msado15._Recordset NextRecordset(Variant RecordsAffected);
00243
00244   /** @com.method(vtoffset=59, dispid=1036, type=METHOD, name="Supports", addFlagsVtable=4)
00245       @com.parameters([in,type=I4] CursorOptions, [type=BOOLEAN] return) */
00246   public boolean Supports(int CursorOptions);
00247
00248   /** @com.method(vtoffset=60, dispid=4294967288, type=PROPGET, name="Collect", name2="getCollect", addFlagsVtable=4)
00249       @com.parameters([in,type=VARIANT] Index, [type=VARIANT] return)
00250       @hidden */
00251   public Variant getCollect(Variant Index);
00252
00253   /** @com.method(vtoffset=61, dispid=4294967288, type=PROPPUT, name="Collect", name2="putCollect", addFlagsVtable=4)
00254       @com.parameters([in,type=VARIANT] Index, [in,type=VARIANT] pvar)
00255       @hidden */
00256   public void setCollect(Variant Index, Variant pvar);
00257
00258   /** @com.method(vtoffset=62, dispid=1053, type=PROPGET, name="MarshalOptions", name2="getMarshalOptions", addFlagsVtable=4)
00259       @com.parameters([type=I4] return) */
00260   public int getMarshalOptions();
00261
00262   /** @com.method(vtoffset=63, dispid=1053, type=PROPPUT, name="MarshalOptions", name2="putMarshalOptions", addFlagsVtable=4)
00263       @com.parameters([in,type=I4] peMarshal) */
00264   public void setMarshalOptions(int peMarshal);
00265
00266   /** @com.method(vtoffset=64, dispid=1058, type=METHOD, name="Find", addFlagsVtable=4)
00267       @com.parameters([in,type=STRING] Criteria, [in,type=I4] SkipRecords, [in,type=I4] SearchDirection, [in,type=VARIANT] Start) */
00268   public void Find(String Criteria, int SkipRecords, int SearchDirection, Variant Start);
00269
00270   /** @com.method(vtoffset=65, dispid=1055, type=METHOD, name="Cancel", addFlagsVtable=4)
00271       @com.parameters() */
00272   public void Cancel();
00273
00274   /** @com.method(vtoffset=66, dispid=1056, type=PROPGET, name="DataSource", name2="getDataSource", addFlagsVtable=4)
00275       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00276   public IUnknown getDataSource();
00277
00278   /** @com.method(vtoffset=67, dispid=1056, type=PROPPUTREF, name="DataSource", name2="putDataSource", addFlagsVtable=4)
00279       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] ppunkDataSource) */
00280   public void setDataSource(IUnknown ppunkDataSource);
00281
00282   /** @com.method(vtoffset=68, dispid=1610874883, type=METHOD, name="_xSave", addFlagsVtable=4)
00283       @com.parameters([in,type=STRING] FileName, [in,type=I4] PersistFormat)
00284       @hidden */
00285   public void _xSave(String FileName, int PersistFormat);
00286
00287   /** @com.method(vtoffset=69, dispid=1061, type=PROPGET, name="ActiveCommand", name2="getActiveCommand", addFlagsVtable=4)
00288       @com.parameters([iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00289   public Object getActiveCommand();
00290
00291   /** @com.method(vtoffset=70, dispid=1063, type=PROPPUT, name="StayInSync", name2="putStayInSync", addFlagsVtable=4)
00292       @com.parameters([in,type=BOOLEAN] pbStayInSync) */
00293   public void setStayInSync(boolean pbStayInSync);
00294
00295   /** @com.method(vtoffset=71, dispid=1063, type=PROPGET, name="StayInSync", name2="getStayInSync", addFlagsVtable=4)
00296       @com.parameters([type=BOOLEAN] return) */
00297   public boolean getStayInSync();
00298
00299   /** @com.method(vtoffset=72, dispid=1062, type=METHOD, name="GetString", addFlagsVtable=4)
00300       @com.parameters([in,type=I4] StringFormat, [in,type=I4] NumRows, [in,type=STRING] ColumnDelimeter, [in,type=STRING] RowDelimeter, [in,type=STRING] NullExpr, [type=STRING] return) */
00301   public String GetString(int StringFormat, int NumRows, String ColumnDelimeter, String RowDelimeter, String NullExpr);
00302
00303   /** @com.method(vtoffset=73, dispid=1064, type=PROPGET, name="DataMember", name2="getDataMember", addFlagsVtable=4)
00304       @com.parameters([type=STRING] return) */
00305   public String getDataMember();
00306
00307   /** @com.method(vtoffset=74, dispid=1064, type=PROPPUT, name="DataMember", name2="putDataMember", addFlagsVtable=4)
00308       @com.parameters([in,type=STRING] pbstrDataMember) */
00309   public void setDataMember(String pbstrDataMember);
00310
00311   /** @com.method(vtoffset=75, dispid=1065, type=METHOD, name="CompareBookmarks", addFlagsVtable=4)
00312       @com.parameters([in,type=VARIANT] Bookmark1, [in,type=VARIANT] Bookmark2, [type=I4] return) */
00313   public int CompareBookmarks(Variant Bookmark1, Variant Bookmark2);
00314
00315   /** @com.method(vtoffset=76, dispid=1034, type=METHOD, name="Clone", addFlagsVtable=4)
00316       @com.parameters([in,type=I4] LockType, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00317   public msado15._Recordset Clone(int LockType);
00318
00319   /** @com.method(vtoffset=77, dispid=1024, type=METHOD, name="Resync", addFlagsVtable=4)
00320       @com.parameters([in,type=I4] AffectRecords, [in,type=I4] ResyncValues) */
00321   public void Resync(int AffectRecords, int ResyncValues);
00322
00323   /** @com.method(vtoffset=78, dispid=1066, type=METHOD, name="Seek", addFlagsVtable=4)
00324       @com.parameters([in,type=VARIANT] KeyValues, [in,type=I4] SeekOption) */
00325   public void Seek(Variant KeyValues, int SeekOption);
00326
00327   /** @com.method(vtoffset=79, dispid=1067, type=PROPPUT, name="Index", name2="putIndex", addFlagsVtable=4)
00328       @com.parameters([in,type=STRING] pbstrIndex) */
00329   public void setIndex(String pbstrIndex);
00330
00331   /** @com.method(vtoffset=80, dispid=1067, type=PROPGET, name="Index", name2="getIndex", addFlagsVtable=4)
00332       @com.parameters([type=STRING] return) */
00333   public String getIndex();
00334
00335
00336   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x555, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00337 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pickle/Picklp/Picklpc.c Source File

  • NetDS
  • RPC
  • Pickle
  • Picklp

Picklpc.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                       picklp Example
00005
00006     FILE:       picklpc.c
00007
00008     USAGE:      picklpc  -f filename  (file to write to/read from)
00009                          -d           (serialization direction: decode)
00010                          -e           (serialization direction: encode)
00011                          -i           (incremental serialization on)
00012
00013     PURPOSE:    The only side of RPC application
00014
00015     FUNCTIONS:  main() - serializes data to or from a file
00016
00017     COMMENTS:   Data procedure serialization is demonstrated here
00018
00019 ****************************************************************************/
00020
00021 #include <stdlib.h>
00022 #include <stdio.h>
00023 #include "picklp.h"    // header file generated by MIDL compiler
00024
00025 #define PURPOSE \
00026 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00027 the use of the [encode,decode] attributes. For more information\n\
00028 about the attributes and RPC API functions, see the RPC programming\n\
00029 guide and reference.\n\n"
00030
00031 /*  Used for incremental style only. */
00032
00033 void __RPC_USER PicAlloc( void * pState, char ** ppBuf, unsigned int * pCount);
00034 void __RPC_USER PicWrite( void * pState, char *  pBuf,  unsigned int Count);
00035 void __RPC_USER PicRead ( void * pState, char ** pBuf,  unsigned int * pCount);
00036
00037 typedef struct PickleControlBlock
00038 {
00039     unsigned char *         pMemBuffer;
00040     unsigned char *         pBufferStart;
00041     unsigned long           LastSize;
00042 } PickleControlBlock;
00043
00044 static PickleControlBlock                 UserState;
00045 static PickleControlBlock * pUserState = &UserState;
00046
00047 void Usage(char * pszProgramName)
00048 {
00049     fprintf(stderr, "%s", PURPOSE);
00050     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00051     fprintf(stderr, " -d\n");
00052     fprintf(stderr, " -e\n");
00053     fprintf(stderr, " -ffilename\n");
00054     fprintf(stderr, " -i \n");
00055     exit(1);
00056 }
00057
00058 void DumpData(
00059     char * pszComment,
00060     char * pszText,
00061     OBJECT1 * pObject1,
00062     OBJECT2 * pObject2 )
00063 {
00064     int i;
00065
00066     printf( "\n%s\n", pszComment );
00067     printf( "\tString\n\t\t%s\n", pszText );
00068
00069     printf( "\tObject1");
00070     for (i=0; i < ARR_SIZE; i++)
00071         {
00072         if ( (i % 5) == 0 )
00073             printf( "\n\t\t");
00074         printf( "%08xl  ", pObject1->al[i] );
00075         }
00076     printf( "\n\t\t%x\n", pObject1->s );
00077
00078     printf( "\tObject2");
00079     printf( "\n\t\t%x", pObject2->sSize );
00080     for (i=0; i < ARR_SIZE; i++)
00081         {
00082         if ( (i % 10) == 0 )
00083             printf( "\n\t\t");
00084         printf( "%04x  ", pObject2->as[i] );
00085         }
00086     printf( "\n" );
00087 }
00088
00089 void WriteDataToFile(
00090     char *          pszFileName,
00091     char *          pbBuffer,
00092     unsigned long   ulSizeToWrite )
00093 {
00094     FILE *      pFile;
00095     size_t      Count;
00096
00097     if ( pszFileName ) {
00098
00099         pFile = fopen( pszFileName, "w+b" );
00100         if ( pFile == NULL ) {
00101             printf("Cannot open the file for writing\n");
00102             exit(1);
00103             }
00104
00105         Count = sizeof(long);
00106         if ( fwrite( &ulSizeToWrite, sizeof(byte), Count, pFile) != Count ) {
00107             printf("Cannot write1 to the file\n");
00108             exit(1);
00109             }
00110
00111         Count = (size_t) ulSizeToWrite;
00112         if ( fwrite( pbBuffer, sizeof(byte), Count, pFile) != Count ) {
00113             printf("Cannot write2 to the file\n");
00114             exit(1);
00115             }
00116
00117         if ( fclose( pFile ) != 0) {
00118             printf("Failed to close the file\n");
00119             exit(1);
00120             }
00121         }
00122 }
00123
00124 void ReadDataFromFile(
00125     char *          pszFileName,
00126     char *          pbBuffer,
00127     unsigned long   ulBufferSize )
00128 {
00129     FILE *          pFile;
00130     size_t          Count;
00131     unsigned long   ulWrittenSize;
00132
00133
00134     if ( pszFileName ) {
00135
00136         pFile = fopen( pszFileName, "r+b" );
00137         if ( pFile == NULL ) {
00138             printf("Cannot open the file for reading\n");
00139             exit(1);
00140             }
00141
00142         Count = sizeof(long);
00143         if ( fread( &ulWrittenSize, sizeof(byte), Count, pFile) != Count ) {
00144             printf("Cannot read1 from the file\n");
00145             exit(1);
00146             }
00147
00148         Count = (size_t)ulWrittenSize;
00149         if ( fread( pbBuffer, sizeof(byte), Count, pFile) != Count ) {
00150             printf("Cannot read2 from the file\n");
00151             exit(1);
00152             }
00153
00154         if ( fclose( pFile ) != 0) {
00155             printf("Failed to close the file\n");
00156             exit(1);
00157             }
00158         }
00159 }
00160
00161 void __cdecl main(int argc, char **argv)
00162 {
00163     RPC_STATUS status;
00164
00165     unsigned char * pbPicklingBuffer = NULL;
00166
00167     char * pszStyle      = NULL;
00168     char * pszFileName   = "pickle.dat";
00169     int i;
00170     int fEncode = 1;
00171     int fFixedStyle = 1;
00172
00173     /* allow the user to override settings with command line switches */
00174     for (i = 1; i < argc; i++) {
00175         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00176             switch (tolower(*(argv[i]+1))) {
00177             case 'd':
00178                 fEncode = 0;
00179                 break;
00180             case 'e':
00181                 fEncode = 1;
00182                 break;
00183             case 'i':
00184                 fFixedStyle = 0;
00185                 break;
00186             case 'f':
00187                 pszFileName = argv[i] + 2;
00188                 break;
00189             case 'h':
00190             case '?':
00191             default:
00192                 Usage(argv[0]);
00193             }
00194         }
00195         else
00196             Usage(argv[0]);
00197     }
00198
00199     /* Fixed buffer style: the buffer should be big enough.  */
00200     /* Please note that the buffer has to be aligned at 8.   */
00201
00202     pbPicklingBuffer = (unsigned char *)
00203             midl_user_allocate( BUFSIZE * sizeof(unsigned char));
00204
00205     if ( pbPicklingBuffer == NULL ) {
00206         printf("Cannot allocate the pickling buffer\n");
00207         exit(1);
00208         }
00209     else
00210         memset( pbPicklingBuffer, 0xdd, BUFSIZE );
00211
00212     /*
00213         Set the pickling handle that will be used for data serialization.
00214         The global ImplicitPicHandle is used, but it has to be set up.
00215     */
00216
00217     if ( fEncode ) {
00218
00219         unsigned char * pszNameId;
00220         OBJECT1         Object1;
00221         OBJECT2   *     pObject2;
00222         unsigned long   ulEncodedSize = 0;
00223
00224         printf("\nEncoding run: use -d for decoding\n\n");
00225
00226         if ( fFixedStyle ) {
00227
00228             printf("Creating a fixed buffer encoding handle\n");
00229             status = MesEncodeFixedBufferHandleCreate( pbPicklingBuffer,
00230                                                        BUFSIZE,
00231                                                        & ulEncodedSize,
00232                                                        & ImplicitPicHandle );
00233             printf("MesEncodeFixedBufferHandleCreate returned 0x%x\n", status);
00234             if (status) {
00235                 exit(status);
00236             }
00237         }
00238         else {
00239
00240             pUserState->LastSize = 0;
00241             pUserState->pMemBuffer = (char *)pbPicklingBuffer;
00242             pUserState->pBufferStart = (char *)pbPicklingBuffer;
00243
00244             printf("Creating an incremental encoding handle\n");
00245             status = MesEncodeIncrementalHandleCreate( pUserState,
00246                                                        PicAlloc,
00247                                                        PicWrite,
00248                                                        & ImplicitPicHandle );
00249             printf("MesEncodeIncrementalHandleCreate returned 0x%x\n", status);
00250             if (status) {
00251                 exit(status);
00252             }
00253         }
00254
00255         /* Creating objects to manipulate */
00256
00257         pszNameId = "Procedure pickling sample";
00258
00259         for (i = 0; i < ARR_SIZE; i++)
00260             Object1.al[i] = 0x37370000 + i;
00261         Object1.s = 0x4646;
00262
00263         pObject2 = midl_user_allocate( sizeof(OBJECT2) + ARR_SIZE*sizeof(short) );
00264         if (pObject2 == NULL ) {
00265             printf("Out of memory for Object2\n");
00266             exit(1);
00267         }
00268
00269         pObject2->sSize = ARR_SIZE;
00270         for (i = 0; i < ARR_SIZE; i++)
00271             pObject2->as[i] = 0x7700 + i;
00272
00273         DumpData( "Data to be encoded", pszNameId, &Object1, pObject2 );
00274
00275         printf("\nEncoding all the arguments to the buffer\n\n");
00276         ProcPickle( pszNameId, & Object1, pObject2 );
00277
00278         printf("Writing the data to the file: %s\n", pszFileName);
00279         WriteDataToFile( pszFileName,
00280                          pbPicklingBuffer,
00281                          fFixedStyle  ? ulEncodedSize
00282                                       : pUserState->LastSize);
00283
00284         midl_user_free( pObject2 );
00285     }
00286     else {
00287         char            acNameBuffer[50];
00288         OBJECT1         Object1;
00289         OBJECT2   *     pObject2;
00290
00291         printf("\nDecoding run: use -e for encoding\n\n");
00292
00293         printf("Reading the data from the file: %s\n\n", pszFileName );
00294         ReadDataFromFile( pszFileName,
00295                           pbPicklingBuffer,
00296                           BUFSIZE );
00297
00298         if ( fFixedStyle ) {
00299
00300             printf("Creating a decoding handle\n");
00301             status = MesDecodeBufferHandleCreate( pbPicklingBuffer,
00302                                                   BUFSIZE,
00303                                                   & ImplicitPicHandle );
00304             printf("MesDecodeFixedBufferHandleCreate returned 0x%x\n", status);
00305             if (status) {
00306                 exit(status);
00307             }
00308         }
00309         else {
00310
00311             pUserState->LastSize = 0;
00312             pUserState->pMemBuffer = (char *)pbPicklingBuffer;
00313             pUserState->pBufferStart = (char *)pbPicklingBuffer;
00314
00315             printf("Creating an incremental decoding handle\n");
00316             status = MesDecodeIncrementalHandleCreate( pUserState,
00317                                                        PicRead,
00318                                                        & ImplicitPicHandle );
00319             printf("MesDecodeIncrementalHandleCreate returned 0x%x\n", status);
00320             if (status) {
00321                 exit(status);
00322             }
00323         }
00324
00325
00326         /* Creating objects to manipulate */
00327
00328         pObject2 = midl_user_allocate( sizeof(OBJECT2) + ARR_SIZE*sizeof(short));
00329         if (pObject2 == NULL ) {
00330             printf("Out of memory for Object2\n");
00331             exit(1);
00332         }
00333
00334         printf("\nDecoding all the arguments from the buffer\n");
00335         ProcPickle( acNameBuffer, & Object1, pObject2 );
00336
00337         DumpData( "Decoded data", acNameBuffer, &Object1, pObject2 );
00338
00339         midl_user_free( pObject2 );
00340     }
00341
00342     printf("\nData serialization done.\n");
00343
00344     midl_user_free( pbPicklingBuffer );
00345
00346     printf("\nFreeing the serialization handle.\n");
00347     status = MesHandleFree( ImplicitPicHandle );
00348     printf("MesHandleFree returned 0x%x\n", status);
00349
00350     exit(0);
00351
00352 }  // end main()
00353
00354 /*********************************************************************/
00355 /*                 MIDL allocate and free                            */
00356 /*********************************************************************/
00357
00358 /* A pickling buffer has to be aligned at 8.
00359    malloc() doesn't guarantee that, so some gimmick has to be done.
00360 */
00361
00362 #define ALIGN_TO8( p)   (char *)((ULONG_PTR)((char *)p + 7) & ~7)
00363
00364 void __RPC_FAR * __RPC_USER  MIDL_user_allocate(size_t s)
00365 {
00366     unsigned char * pcAllocated;
00367     unsigned char * pcUserPtr;
00368
00369     pcAllocated = (unsigned char *) malloc( s + 15 );
00370     pcUserPtr =  ALIGN_TO8( pcAllocated );
00371     if ( pcUserPtr == pcAllocated )
00372         pcUserPtr = pcAllocated + 8;
00373
00374     *(pcUserPtr - 1) = (char) (pcUserPtr - pcAllocated);
00375
00376     return( pcUserPtr );
00377 }
00378
00379 void __RPC_USER  MIDL_user_free(void __RPC_FAR *f)
00380 {
00381     unsigned char * pcAllocated;
00382     unsigned char * pcUserPtr;
00383
00384     pcUserPtr = (unsigned char *) f;
00385     pcAllocated = pcUserPtr - *(pcUserPtr - 1);
00386
00387     free( pcAllocated );
00388 }
00389
00390 /*********************************************************************/
00391 /*                 Incremental style helper routines                 */
00392 /*********************************************************************/
00393
00394 void  __RPC_USER
00395 PicAlloc(
00396     void *          pState,
00397     char **         ppBuf,
00398     unsigned int  * pCount )
00399 {
00400     /* This routines "allocates" the next part from the preallocated
00401        buffer. It could call midl_user_allocate, too.
00402     */
00403
00404     PickleControlBlock * pPic = (PickleControlBlock *)pState;
00405
00406     if ( (pPic->pMemBuffer - pPic->pBufferStart) + *pCount <= BUFSIZE )
00407         *ppBuf = (char *)pPic->pMemBuffer;
00408     else {
00409         printf(" Buffer too small\n");
00410         exit(1);
00411     }
00412 }
00413
00414 void __RPC_USER
00415 PicWrite(
00416     void *          pState,
00417     char *          pBuf,
00418     unsigned int    Count )
00419 {
00420     /* This routine just marks how much of the preallocated buffer is used.
00421     */
00422
00423     PickleControlBlock * pPic = (PickleControlBlock *)pState;
00424
00425
00426     if ( pPic->pMemBuffer != pBuf ) {
00427         printf(" Buffer poiner corrupted\n");
00428         exit(1);
00429     }
00430     pPic->pMemBuffer += Count;
00431     pPic->LastSize += Count;
00432 }
00433
00434 void __RPC_USER
00435 PicRead(
00436     void *          pState,
00437     char **         ppBuf,
00438     unsigned int  * pCount )
00439 {
00440     /* This routine returns another portion of the preread buffer. */
00441
00442     PickleControlBlock * pPic = (PickleControlBlock *)pState;
00443
00444     *ppBuf = (char *)pPic->pMemBuffer;
00445     pPic->pMemBuffer += *pCount;
00446 }
00447
00448 /* end picklpc.c */
00449
00450
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RefCount Member List

This is the complete list of members for RefCount, including all inherited members.
AddRef(void) | RefCount |
AddRef(void) | RefCount |
AddRef(void) | RefCount |
AddRef(void) | RefCount |
AddRef(void) | RefCount |
m_cRef | RefCount | [private]
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
RefCount() | RefCount |
Release(void) | RefCount |
Release(void) | RefCount |
Release(void) | RefCount |
Release(void) | RefCount |
Release(void) | RefCount |
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
~RefCount() | RefCount | [virtual]
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/MyStorageResource.idl Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

MyStorageResource.idl

Go to the documentation of this file.
00001 // MyStorageResource.idl : IDL source for MyStorageResource.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (MyStorageResource.tlb) and marshalling code.
00006
00007 import "wbemcli.idl";
00008 import "ClusCfgServer.idl";
00009
00010
00011 //////////////////////////////////////////////////////////////////////////////
00012 //++
00013 //
00014 //  interface IWMIServices
00015 //
00016 //  Description:
00017 //      The interface IWMIServices is the private interface
00018 //      used by the cluster configuration server to set the WBEM provider
00019 //      in its children.
00020 //
00021 //  Interfaces:
00022 //      None.
00023 //
00024 //--
00025 //////////////////////////////////////////////////////////////////////////////
00026 [
00027     object,
00028     uuid(538972C6-56B9-4240-AF92-ACA165820499),
00029     helpstring( "IWMIServices interface" )
00030 ]
00031 interface IWMIServices : IUnknown
00032 {
00033     HRESULT SetWbemServices( IWbemServices * pIWbemServicesIn );
00034 };
00035
00036
00037 //////////////////////////////////////////////////////////////////////////////
00038 //++
00039 //
00040 //  interface IWMIObject
00041 //
00042 //  Description:
00043 //      The interface IWMIObject is the private interface used by the
00044 //      cluster configuration server to set the WBem object.
00045 //
00046 //  Interfaces:
00047 //      None.
00048 //
00049 //--
00050 //////////////////////////////////////////////////////////////////////////////
00051 [
00052     object,
00053     uuid(DC674A98-FBA0-4f33-9EA3-C3D0AB49AA74),
00054     helpstring( "IWMIObject interface" )
00055 ]
00056 interface IWMIObject : IUnknown
00057 {
00058     HRESULT SetWbemObject( IWbemClassObject * pObjectIn, BOOL * pfRetainObjectOut );
00059 }
00060
00061
00062 //////////////////////////////////////////////////////////////////////////////
00063 //++
00064 //
00065 //  class IStorageProperties
00066 //
00067 //  Description:
00068 //      The interface IStorageProperties is the private
00069 //      interface used by the cluster configuration server to get the
00070 //      SCSI bus number and whether the disk was booted or not.
00071 //
00072 //  Interfaces:
00073 //      None.
00074 //
00075 //--
00076 //////////////////////////////////////////////////////////////////////////////
00077 [
00078     object,
00079     uuid(161969B2-23B6-4172-9150-73DE4C57E314),
00080     helpstring( "IStorageProperties interface" )
00081 ]
00082 interface IStorageProperties : IUnknown
00083 {
00084     HRESULT IsThisLogicalDisk( WCHAR cLogicalDiskIn );
00085     HRESULT HrGetSCSIBus( ULONG * pulSCSIBusOut );
00086     HRESULT HrGetSCSIPort( ULONG * pulSCSIPortOut );
00087     HRESULT CanBeManaged( void );
00088     HRESULT HrGetDeviceID( BSTR * pbstrDeviceIDOut );
00089     HRESULT HrGetSignature( DWORD * pdwSignatureOut );
00090     HRESULT HrSetFriendlyName( LPCWSTR pcszFriendlyNameIn );
00091     HRESULT HrGetDeviceIndex( DWORD * pidxDeviceOut );
00092     HRESULT HrIsDynamicDisk( void );
00093     HRESULT HrIsGPTDisk( void );
00094     HRESULT HrGetDiskNames( BSTR * pbstrDiskNameOut, BSTR * pbstrDeviceNameOut );
00095 }
00096
00097
00098 //////////////////////////////////////////////////////////////////////////////
00099 //++
00100 //
00101 //  class IPartitionProperties
00102 //
00103 //  Description:
00104 //      The interface IPartitionProperties is the private
00105 //      interface used by the cluster configuration server to get the
00106 //      properties of a disk partition.
00107 //
00108 //  Interfaces:
00109 //      None.
00110 //
00111 //--
00112 //////////////////////////////////////////////////////////////////////////////
00113 [
00114     object,
00115     uuid(C7678615-F0C7-4cd1-8E9D-A0A7F4E536DF),
00116     helpstring( "IPartitionProperties interface" )
00117 ]
00118 interface IPartitionProperties : IUnknown
00119 {
00120     HRESULT HrIsThisLogicalDisk( WCHAR cLogicalDiskIn );
00121     HRESULT HrIsNTFS( void );
00122     HRESULT HrGetFriendlyName( BSTR * pbstrNameOut );
00123     HRESULT HrSetDeviceID( BSTR bstDeviceIDIn );
00124 }
00125
00126
00127 [
00128     uuid(359F8AA3-6EE5-40E9-850E-F303056468C9),
00129     version(1.0),
00130     helpstring("MyStorageResource 1.0 Type Library")
00131 ]
00132 library MyStorageResourceLib
00133 {
00134     importlib("stdole32.tlb");
00135     importlib("stdole2.tlb");
00136     import "cluscfgserver.idl";
00137
00138     [
00139         uuid(DFF8522F-C3E1-4b26-BC6F-2E90945BFBE7),
00140         helpstring("CEnumStorageResource Class")
00141     ]
00142     coclass CEnumStorageResource
00143     {
00144         [default] interface IEnumClusCfgManagedResources;
00145         interface IWMIServices;
00146         interface IClusCfgInitialize;
00147     };
00148
00149     [
00150         uuid(B07C16FE-9F4D-4ADD-AAA4-931F501CB9FC),
00151         helpstring("CStorageResource Class")
00152     ]
00153     coclass CStorageResource
00154     {
00155         [default] interface IClusCfgManagedResourceInfo;
00156         interface IClusCfgManagedResourceCfg;
00157         interface IClusCfgVerifyQuorum;
00158         interface IClusCfgManagedResourceData;
00159         interface IEnumClusCfgPartitions;
00160         interface IWMIServices;
00161         interface IWMIObject;
00162         interface IStorageProperties;
00163         interface IClusCfgInitialize;
00164     };
00165
00166     [
00167         uuid(D9E1925C-13BC-4DC5-99EA-89910215FB7F),
00168         helpstring("CStorageResType Class")
00169     ]
00170     coclass CStorageResType
00171     {
00172         [default] interface IClusCfgResourceTypeInfo;
00173         interface IClusCfgStartupListener;
00174         interface IClusCfgInitialize;
00175     };
00176
00177     [
00178         uuid(62F21368-5CB1-4e18-8AA5-E99217E1A63C),
00179         helpstring("CPartitionInfo Class")
00180     ]
00181     coclass CPartitionInfo
00182     {
00183         [default] interface IClusCfgPartitionInfo;
00184         interface IWMIServices;
00185         interface IWMIObject;
00186         interface IPartitionProperties;
00187         interface IClusCfgInitialize;
00188     };
00189 };
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/AuthFilt/cache.c Source File

  • Web
  • iis
  • filters
  • AuthFilt

cache.c

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 1996-2002  Microsoft Corporation
00003
00004 This program is released into the public domain for any purpose.
00005
00006 Module Name:
00007
00008     cache.c
00009
00010 Abstract:
00011
00012     This module implements a simple user cache.  The cached users are kept
00013     in an LRU sorted list.  If there will be a large number of simultaneous
00014     users, then a sorted array would be more appropriate.
00015 */
00016
00017 #include <windows.h>
00018 #include <httpfilt.h>
00019 #include "authfilt.h"
00020
00021 // Constants
00022
00023 // The maximum number of users we will cache.  If there will be a large number
00024 // of simultaneous users, bump this value
00025
00026 #define MAX_CACHED_USERS 100
00027
00028 // The position after which we'll move a cache entry to the front of the list
00029
00030 #define LIST_REORDER_THRESHOLD 6
00031
00032 // Cached user structure
00033
00034 typedef struct _USER_INFO
00035 {
00036   LIST_ENTRY  ListEntry;  // Double linked list entry
00037
00038   CHAR  achUserName[SF_MAX_USERNAME];   // External username and password
00039   CHAR  achPassword[SF_MAX_PASSWORD];
00040   CHAR  achNTUserName[SF_MAX_USERNAME]; // account and password to map user to
00041   CHAR  achNTUserPassword[SF_MAX_PASSWORD];
00042
00043 } USER_INFO, *PUSER_INFO;
00044
00045 // Globals
00046
00047 // Circular double linked list of cached users
00048
00049 LIST_ENTRY CacheListHead;
00050
00051 // Critical section protects cache list
00052
00053 CRITICAL_SECTION csCacheLock;
00054
00055 // Indicates whether we are initialized
00056
00057 BOOL fCacheInitialized = FALSE;
00058
00059 // Number of items in the cache
00060
00061 DWORD cCacheItems = 0;
00062
00063 /*
00064 Description:
00065
00066   Initializes the cache module
00067
00068 Return Value:
00069
00070   TRUE if initialized successfully, FALSE on error
00071 */
00072
00073 BOOL InitializeCache(VOID)
00074 {
00075   if (fCacheInitialized)
00076     return TRUE;
00077
00078   InitializeCriticalSection(&csCacheLock);
00079
00080   CacheListHead.Blink = CacheListHead.Flink = &CacheListHead;
00081
00082   fCacheInitialized = TRUE;
00083
00084   return TRUE;
00085 }
00086
00087 /*
00088 Description:
00089
00090   Checks to see if a user is in the cache and returns the user properties
00091   if found
00092
00093 Arguments:
00094
00095   pszUserName       - Case insensitive username to find
00096   pfFound           - Set to TRUE if the specified user was found
00097   pszPassword       - Receives password for specified user if found
00098   pszNTUser         - Receives the NT Username to map this user to
00099   pszNTUserPassword - Receives the NT Password for pszNTUser
00100
00101   Note: pszPassword and pszNTUserPassword must be at least SF_MAX_PASSWORD
00102   characters.  pszNTUser must be at least SF_MAX_USERNAME characters.
00103
00104 Return Value:
00105
00106   TRUE if no errors occurred.
00107 */
00108
00109 BOOL LookupUserInCache(CHAR *pszUserName, BOOL *pfFound, CHAR *pszPassword, CHAR *pszNTUser, CHAR *pszNTUserPassword)
00110 {
00111   LIST_ENTRY *pEntry;
00112   USER_INFO *pUser;
00113   DWORD cPosition = 0;
00114
00115   /* Search the cache for the specified user */
00116
00117   EnterCriticalSection(&csCacheLock);
00118
00119   for (pEntry = CacheListHead.Flink; pEntry != &CacheListHead; pEntry = pEntry->Flink)
00120   {
00121     pUser = CONTAINING_RECORD(pEntry, USER_INFO, ListEntry);
00122
00123     if (!stricmp( pszUserName, pUser->achUserName))
00124       goto Found;
00125
00126     cPosition++;
00127   }
00128
00129   LeaveCriticalSection(&csCacheLock);
00130
00131   /* Not Found */
00132
00133   *pfFound = FALSE;
00134
00135   return TRUE;
00136
00137 Found:
00138
00139   /* Copy out the user properties */
00140
00141   strcpy(pszPassword,       pUser->achPassword);
00142   strcpy(pszNTUser,         pUser->achNTUserName);
00143   strcpy(pszNTUserPassword, pUser->achNTUserPassword);
00144
00145   /*
00146     Move this user entry to the front of the list as we're probably going
00147     to get subsequent requests for this user.  Note we only move it
00148     if it's not already near the front
00149   */
00150
00151   if (cPosition > LIST_REORDER_THRESHOLD)
00152   {
00153     /* Remove from the old position... */
00154
00155     pEntry->Blink->Flink = pEntry->Flink;
00156     pEntry->Flink->Blink = pEntry->Blink;
00157
00158     /* ...and insert it at the beginning of the list */
00159
00160     pEntry->Blink = &CacheListHead;
00161     pEntry->Flink = CacheListHead.Flink;
00162
00163     CacheListHead.Flink->Blink = pEntry;
00164     CacheListHead.Flink = pEntry;
00165   }
00166
00167   LeaveCriticalSection(&csCacheLock);
00168
00169   *pfFound = TRUE;
00170
00171   return TRUE;
00172 }
00173
00174 /*
00175   Description:
00176
00177     Adds the specified user to the cache
00178
00179   Arguments:
00180
00181     pszUserName - Username to add
00182     pszPassword - Contains the external password for this user
00183     pszNTUser   - Contains the NT user name to use for this user
00184     pszNTUserPassword - Contains the password for NTUser
00185
00186   Return Value:
00187
00188     TRUE if no errors occurred.
00189 */
00190
00191 BOOL AddUserToCache(CHAR *pszUserName, CHAR *pszPassword, CHAR *pszNTUser, CHAR *pszNTUserPassword)
00192 {
00193   LIST_ENTRY *pEntry;
00194   USER_INFO *pUser;
00195
00196   /* Check our parameters before adding them to the cache */
00197
00198   if (strlen(pszUserName) > SF_MAX_USERNAME ||
00199       strlen(pszPassword) > SF_MAX_PASSWORD ||
00200       strlen(pszNTUser) > SF_MAX_USERNAME ||
00201       strlen(pszNTUserPassword) > SF_MAX_PASSWORD)
00202   {
00203       SetLastError(ERROR_INVALID_PARAMETER);
00204       return FALSE;
00205   }
00206
00207   /* Search the cache for the specified user to make sure there are no duplicates */
00208
00209   EnterCriticalSection(&csCacheLock);
00210
00211   for (pEntry = CacheListHead.Flink; pEntry != &CacheListHead; pEntry = pEntry->Flink)
00212   {
00213     pUser = CONTAINING_RECORD(pEntry, USER_INFO, ListEntry);
00214
00215     if (!stricmp(pszUserName, pUser->achUserName))
00216       goto Found;
00217   }
00218
00219   /* Allocate a new cache item and put it at the head of the list */
00220
00221   pUser = (USER_INFO *)LocalAlloc(LPTR, sizeof(USER_INFO));
00222
00223   if (!pUser)
00224   {
00225     LeaveCriticalSection(&csCacheLock);
00226
00227     SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00228     return FALSE;
00229   }
00230
00231   pUser->ListEntry.Flink = CacheListHead.Flink;
00232   pUser->ListEntry.Blink = &CacheListHead;
00233
00234   CacheListHead.Flink->Blink = &pUser->ListEntry;
00235   CacheListHead.Flink = &pUser->ListEntry;
00236
00237 Found:
00238
00239   /* Set the various fields */
00240
00241   strcpy(pUser->achUserName, pszUserName);
00242   strcpy(pUser->achPassword, pszPassword);
00243   strcpy(pUser->achNTUserName, pszNTUser);
00244   strcpy(pUser->achNTUserPassword, pszNTUserPassword);
00245
00246   cCacheItems++;
00247
00248   /* If there are too many cached users, remove the least recently used one now */
00249
00250   if (cCacheItems > MAX_CACHED_USERS)
00251   {
00252     pEntry = CacheListHead.Blink;
00253
00254     pEntry->Blink->Flink = &CacheListHead;
00255     CacheListHead.Blink  = pEntry->Blink;
00256
00257     LocalFree(CONTAINING_RECORD(pEntry, USER_INFO, ListEntry));
00258
00259     cCacheItems--;
00260   }
00261
00262   LeaveCriticalSection(&csCacheLock);
00263
00264   return TRUE;
00265 }
00266
00267 /*
00268   Description:
00269
00270     Terminates the cache module and frees any allocated memory
00271 */
00272
00273 VOID TerminateCache(VOID)
00274 {
00275   LIST_ENTRY *pEntry;
00276   LIST_ENTRY *pEntryNext;
00277   USER_INFO *pUser;
00278
00279   if (!fCacheInitialized)
00280     return;
00281
00282   EnterCriticalSection(&csCacheLock);
00283
00284   /* Free all of the cache entries */
00285
00286   for (pEntry = CacheListHead.Flink; pEntry != &CacheListHead; pEntry  = pEntryNext)
00287   {
00288     pUser = CONTAINING_RECORD(pEntry, USER_INFO, ListEntry);
00289
00290     pEntryNext = pEntry->Flink;
00291
00292     /* Remove this entry from the list and free it */
00293
00294     pEntry->Blink->Flink = pEntry->Flink;
00295     pEntry->Flink->Blink = pEntry->Blink;
00296
00297     LocalFree(pUser);
00298   }
00299
00300   cCacheItems = 0;
00301
00302   LeaveCriticalSection(&csCacheLock);
00303
00304   DeleteCriticalSection(&csCacheLock);
00305
00306   fCacheInitialized = FALSE;
00307 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/CompInstallDlg.h Source File

  • Com
  • Administration
  • Explore.VC

CompInstallDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 #if !defined(AFX_COMPINSTALLDLG_H__0B7BB73B_B53B_11D2_86A8_000000000000__INCLUDED_)
00020 #define AFX_COMPINSTALLDLG_H__0B7BB73B_B53B_11D2_86A8_000000000000__INCLUDED_
00021
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // CCompInstallDlg dialog
00028
00029 class CCompInstallDlg : public CDialog
00030 {
00031 // Construction
00032 public:
00033   void set_Catalog(ICOMAdminCatalog* pCatalog);
00034   CCompInstallDlg(CWnd* pParent = NULL);   // standard constructor
00035
00036 // Dialog Data
00037   //{{AFX_DATA(CCompInstallDlg)
00038   enum { IDD = IDD_INSTALL_COMPONENT };
00039   CComboBox m_cboApplications;
00040   CEdit m_edtTypeLib;
00041   CEdit m_edtProxyStub;
00042   CEdit m_edtComponent;
00043   //}}AFX_DATA
00044
00045
00046 // Overrides
00047   // ClassWizard generated virtual function overrides
00048   //{{AFX_VIRTUAL(CCompInstallDlg)
00049   protected:
00050   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00051   //}}AFX_VIRTUAL
00052
00053 // Implementation
00054 protected:
00055   HICON m_hIcon;
00056
00057   // Generated message map functions
00058   //{{AFX_MSG(CCompInstallDlg)
00059   afx_msg void OnClose();
00060   afx_msg void OnComponentSearch();
00061   afx_msg void OnTypeLibrary();
00062   afx_msg void OnProxyStubDll();
00063   virtual BOOL OnInitDialog();
00064   virtual void OnOK();
00065   //}}AFX_MSG
00066   DECLARE_MESSAGE_MAP()
00067 private:
00068   void ReleaseCatalog();
00069   void LoadAppCombo();
00070   ICOMAdminCatalog* m_pCatalog;
00071 };
00072
00073 //{{AFX_INSERT_LOCATION}}
00074 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00075
00076 #endif // !defined(AFX_COMPINSTALLDLG_H__0B7BB73B_B53B_11D2_86A8_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/SDKSamplePlaylistPlugin.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

SDKSamplePlaylistPlugin.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            SDKSamplePlaylistPlugin.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #include "stdafx.h"
00013 #include "resource.h"
00014 #include <initguid.h>
00015 #include "SDKSamplePlaylistPlugin.h"
00016 #include "dlldatax.h"
00017
00018 #include "SDKSamplePlaylistPlugin_i.c"
00019 #include "SDKSamplePlaylistParser.h"
00020
00021 #ifdef _MERGE_PROXYSTUB
00022 extern "C" HINSTANCE hProxyDll;
00023 #endif
00024
00025 CComModule _Module;
00026
00027 BEGIN_OBJECT_MAP(ObjectMap)
00028 OBJECT_ENTRY(CLSID_SDKSamplePlaylistParser, CSDKSamplePlaylistParserPlugin)
00029 END_OBJECT_MAP()
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // DLL Entry Point
00033
00034 extern "C"
00035 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00036 {
00037     lpReserved;
00038 #ifdef _MERGE_PROXYSTUB
00039     if (!PrxDllMain(hInstance, dwReason, lpReserved))
00040         return FALSE;
00041 #endif
00042     if (dwReason == DLL_PROCESS_ATTACH)
00043     {
00044         _Module.Init(ObjectMap, hInstance, &LIBID_SDKSAMPLEPLAYLISTPLUGINLib);
00045         DisableThreadLibraryCalls(hInstance);
00046     }
00047     else if (dwReason == DLL_PROCESS_DETACH)
00048         _Module.Term();
00049     return TRUE;    // ok
00050 }
00051
00052 /////////////////////////////////////////////////////////////////////////////
00053 // Used to determine whether the DLL can be unloaded by OLE
00054
00055 STDAPI DllCanUnloadNow(void)
00056 {
00057 #ifdef _MERGE_PROXYSTUB
00058     if (PrxDllCanUnloadNow() != S_OK)
00059         return S_FALSE;
00060 #endif
00061     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00062 }
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // Returns a class factory to create an object of the requested type
00066
00067 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00068 {
00069 #ifdef _MERGE_PROXYSTUB
00070     if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
00071         return S_OK;
00072 #endif
00073     return _Module.GetClassObject(rclsid, riid, ppv);
00074 }
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // DllRegisterServer - Adds entries to the system registry
00078
00079 STDAPI DllRegisterServer(void)
00080 {
00081 #ifdef _MERGE_PROXYSTUB
00082     HRESULT hRes = PrxDllRegisterServer();
00083     if (FAILED(hRes))
00084         return hRes;
00085 #endif
00086     // registers object, typelib and all interfaces in typelib
00087     return _Module.RegisterServer(TRUE);
00088 }
00089
00090 /////////////////////////////////////////////////////////////////////////////
00091 // DllUnregisterServer - Removes entries from the system registry
00092
00093 STDAPI DllUnregisterServer(void)
00094 {
00095 #ifdef _MERGE_PROXYSTUB
00096     PrxDllUnregisterServer();
00097 #endif
00098     return _Module.UnregisterServer(TRUE);
00099 }
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_INITDATA Member List

This is the complete list of members for _INITDATA, including all inherited members.
LocalTime | _INITDATA
PID | _INITDATA
TID | _INITDATA
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCShip/Ship.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCShip

Ship.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      Ship.cpp
00003   Summary:   Implementation of COShip class
00004   Classes:   Implemented: COShip
00005        Used: ADO  CLSID_ADOConnection
00006        Used: COM+ ObjectContext
00007   Methods:   put_CustomerId
00008        put_OrderId
00009        LineItem
00010        ProcessOrder
00011 -----------------------------------------------------------------------------
00012
00013 This file is part of the Microsoft COM+ Samples.
00014
00015 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00016
00017 This source code is intended only as a supplement to Microsoft
00018 Development Tools and/or on-line documentation. See these other
00019 materials for detailed information regarding Microsoft code samples.
00020
00021 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00022 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00023 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00024 PARTICULAR PURPOSE.
00025
00026 ==========================================================================+*/
00027
00028 #include "stdafx.h"
00029 #include "..\DataSourceNames.h" // ADO Data Source Names, userid, password
00030 #include <adoid.h>    // OLEDBSDK ADO
00031 #include <adoint.h>   // OLEDBSDK ADO
00032 #include "QCShip.h"   // Generated by MIDL from QCShip.idl
00033 #include "Ship.h"   // Our class header
00034 #include "..\QCOrder\processFlags.h"
00035
00036 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00037   Method:   COShip::put_CustomerId
00038   Summary:  property put for CustomerId property
00039   Args:     long lCustomerId      A customer identifier.
00040   Modifies: class member variable m_lCustomerId
00041   Returns:  HRESULT - Always returns S_OK
00042 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00043
00044 STDMETHODIMP COShip::put_CustomerId(long lCustomerId)
00045 {
00046   m_lCustomerId = lCustomerId;
00047   return S_OK;
00048 }
00049
00050 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00051   Method:   COShip::put_OrderId
00052   Summary:  property put for OrderId property
00053   Args:     long lOrderId     An order identifier.
00054   Modifies: class member variable m_lOrderId
00055   Returns:  HRESULT - Always returns S_OK
00056 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00057
00058 STDMETHODIMP COShip::put_OrderId(long lOrderId)
00059 {
00060   m_lOrderId = lOrderId;
00061   return S_OK;
00062 }
00063
00064 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00065   Method:   COShip::LineItem
00066   Summary:  Adds a single item to an order
00067   Args:     long lItemId      An item identifier (e.g. stock identifier)
00068       long lQuantity      The quantity of the item ordered
00069   Modifies: class members m_veclItemId, m_veclQuantity, m_vecShipStatus
00070   Returns:  HRESULT - Always returns S_OK
00071 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00072
00073 STDMETHODIMP COShip::LineItem(long lItemId, long lQuantity)
00074 {
00075   m_veclItemId.push_back(lItemId);
00076   m_veclQuantity.push_back(lQuantity);
00077   m_vecShipStatus.push_back(RandomShipStatus());  // assign shipping status
00078   return S_OK;
00079 }
00080
00081 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00082   Method:   COShip::Process
00083   Summary:  Writes order to Shipping database.
00084       Creates Notify object to inform requestor of shipping statuses.
00085   Args:     long  lFlags - option flags (see constants in IDL file)
00086   Modifies: Rows in Shipping table (DSN = QCSampOrder)
00087       Issues COM+ SetComplete or SetAbort depending on request success.
00088   Returns:  HRESULT - returns failure from embedded function requests or S_OK.
00089 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00090
00091 STDMETHODIMP COShip::Process(long lFlags)
00092 {
00093   HRESULT hr = S_OK;
00094
00095   _RPT1(_CRT_WARN, "QCSamp1 %d Ship\n", m_lOrderId);
00096
00097   if (lFlags & processFlagWriteDB) hr = WriteShipDB();
00098
00099   if (SUCCEEDED(hr)) hr = NotifyRequestor(lFlags);
00100
00101   // Invoke SetComplete or SetAbort depending on our success
00102
00103   CComPtr<IObjectContext> pIObjectContext;
00104
00105   if (SUCCEEDED(CoGetObjectContext(IID_IObjectContext, (void**)&pIObjectContext)))
00106   {
00107     if (SUCCEEDED(hr))  pIObjectContext->SetComplete();
00108     else        pIObjectContext->SetAbort();
00109   }
00110
00111   return hr;
00112 }
00113
00114 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00115   THIS IS A PRIVATE MEMBER FUNCTION
00116
00117   Method:   COShip::WriteShipDB
00118   Summary:  Writes order to Shipping database.
00119   Args:     None
00120   Modifies: Adds rows in Shipping table (DSN = QCSampleShip)
00121   Returns:  HRESULT - returns failure from embedded function requests or S_OK.
00122 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00123
00124 HRESULT COShip::WriteShipDB()
00125 {
00126   CComPtr<ADOConnection> pADOConnection;
00127
00128   HRESULT hr = CoCreateInstance(  CLSID_CADOConnection, NULL, CLSCTX_INPROC_SERVER,
00129                   IID_IADOConnection, (void **) &pADOConnection);
00130   if (SUCCEEDED(hr))
00131   {
00132     // Connect to the Shipping Database. Names in DataSourceNames.h
00133
00134     hr = pADOConnection->Open(  _bstr_t(pszShipDSN), _bstr_t(pszUserId),
00135                   _bstr_t(pszPassword), adOpenUnspecified);
00136
00137     // Write one row per line item
00138
00139     for (int ix = 0; ix < m_veclItemId.size() && SUCCEEDED(hr); ix++)
00140     {
00141       TCHAR szSQLStmt[1024];  // SQL statement buffer
00142
00143       LPCTSTR pszPrototypeInsertStmt =
00144         _T("insert into QCSampleShip ")
00145         _T(" (order_id, cust_id, line_no, ")
00146         _T("  item_id, quantity, ship_status_enum) ")
00147         _T("values(%ld, %ld, %ld, %ld, %ld, %ld)");
00148
00149       wsprintf( szSQLStmt,
00150             pszPrototypeInsertStmt,
00151             m_lOrderId,
00152             m_lCustomerId,
00153             ix,
00154             m_veclItemId[ix],
00155             m_veclQuantity[ix],
00156             m_vecShipStatus[ix]);
00157
00158       hr = pADOConnection->Execute(_bstr_t(szSQLStmt), NULL, adCmdText, NULL);
00159     }
00160   }
00161
00162   return hr;
00163 }
00164
00165 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00166   THIS IS A PRIVATE MEMBER FUNCTION
00167
00168   Method:   COShip::NotifyRequestor
00169   Summary:  Creates Notify object to return shipping status to requestor.
00170   Args:     long  lFlags - processing option flags
00171   Modifies: None
00172   Returns:  HRESULT - returns failure from embedded function requests or S_OK.
00173 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00174
00175 HRESULT COShip::NotifyRequestor(long lFlags)
00176 {
00177   LPWSTR pszDisplayName;
00178
00179   if (lFlags & processFlagQueuedComponents)
00180     pszDisplayName = L"queue:/new:QCNotify.Notify";
00181   else
00182     pszDisplayName = L"new:QCNotify.Notify";
00183
00184   CComPtr<IUnknown> punkNotify;
00185
00186   HRESULT hr = CoGetObject(pszDisplayName, NULL, IID_IUnknown, (void **) &punkNotify);
00187   if (SUCCEEDED(hr))
00188   {
00189     if (lFlags & processFlagLateBound)
00190       hr = InvokeNotifyIDispatch(punkNotify, lFlags);
00191     else
00192       hr = InvokeNotifyVtable(punkNotify, lFlags);
00193   }
00194   return hr;
00195 }
00196
00197 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00198   THIS IS A PRIVATE MEMBER FUNCTION
00199
00200   Method:   COShip::InvokeNotifyIDispatch
00201   Summary:  Invoke Notify object methods using IDispatch
00202   Args:     IUnknown *  punkShip - IUnknown * to Notify object
00203       long    lFlags  - flag longword with option bits
00204   Modifies: None
00205   Returns:  HRESULT from the underlying requests
00206 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00207
00208 HRESULT COShip::InvokeNotifyIDispatch(IUnknown * punkNotify, long lFlags)
00209 {
00210   HRESULT hr = S_OK;
00211
00212   CComQIPtr<IDispatch, &IID_IDispatch> pIDispatch(punkNotify);
00213
00214   if (!pIDispatch) hr = E_NOINTERFACE;
00215
00216   // Set CustomerId property
00217
00218   if (SUCCEEDED(hr))
00219   {
00220     const int nNames = 1;
00221
00222     OLECHAR * rgszNames[nNames] = { OLESTR("CustomerId") };
00223     DISPID    dispId[nNames];
00224
00225     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00226                     LOCALE_SYSTEM_DEFAULT, dispId);
00227     if (SUCCEEDED(hr))
00228     {
00229       CComVariant varData(m_lCustomerId);
00230       DISPID    dispidPut = DISPID_PROPERTYPUT;
00231       DISPPARAMS  dispparams = {&varData, &dispidPut, 1, 1};
00232
00233       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00234                   DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
00235     }
00236   }
00237
00238   // Set OrderId property
00239
00240   if (SUCCEEDED(hr))
00241   {
00242     const int nNames = 1;
00243
00244     OLECHAR * rgszNames[nNames] = { OLESTR("OrderId") };
00245     DISPID    dispId[nNames];
00246
00247     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00248                     LOCALE_SYSTEM_DEFAULT, dispId);
00249     if (SUCCEEDED(hr))
00250     {
00251       CComVariant varData(m_lOrderId);
00252       DISPID    dispidPut = DISPID_PROPERTYPUT;
00253       DISPPARAMS  dispparams = {&varData, &dispidPut, 1, 1};
00254
00255       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00256                   DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
00257     }
00258   }
00259
00260   // Call LineItem method once for each line item
00261
00262   if (SUCCEEDED(hr))
00263   {
00264     const int nNames = 4;
00265
00266     OLECHAR * rgszNames[nNames] = { OLESTR("LineItem"),   // method name
00267                       OLESTR("lItemId"),    // parm name
00268                       OLESTR("lQuantity"),
00269                       OLESTR("shipStatus") }; // parm name
00270     DISPID    dispId[nNames];
00271
00272     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00273                     LOCALE_SYSTEM_DEFAULT, dispId);
00274
00275     for (int ix = 0; ix < m_veclItemId.size() && SUCCEEDED(hr); ix++)
00276     {
00277       const int nArgs = nNames - 1;
00278
00279       CComVariant varData[nArgs];   // 2 Arguments
00280       varData[0] = m_veclItemId[ix];
00281       varData[1] = m_veclQuantity[ix];
00282       varData[2] = m_vecShipStatus[ix];
00283
00284       DISPPARAMS dispparams = {varData, &dispId[1], nArgs, nArgs};
00285
00286       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00287                   DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
00288     }
00289   }
00290
00291   // Call Process method
00292
00293   if (SUCCEEDED(hr))
00294   {
00295     const int nNames = 2;
00296
00297     OLECHAR * rgszNames[nNames] = { OLESTR("Process"),    // method name
00298                       OLESTR("lFlags") };   // parm name
00299     DISPID    dispId[nNames];
00300
00301     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00302                     LOCALE_SYSTEM_DEFAULT, dispId);
00303     if (SUCCEEDED(hr))
00304     {
00305       const int nArgs = nNames - 1;
00306
00307       CComVariant varData[nArgs]; // just the parameters
00308       varData[0] = lFlags;
00309
00310       DISPPARAMS  dispparams = {varData, &dispId[1], nArgs, 0};
00311
00312       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00313                   DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
00314     }
00315   }
00316   return hr;
00317 }
00318
00319 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00320   THIS IS A PRIVATE MEMBER FUNCTION
00321
00322   Method:   COShip::InvokeNotifyVtable
00323   Summary:  Calls Notify object methods using vtable
00324   Args:     long  lFlags - processing option flags
00325   Modifies: None
00326   Returns:  HRESULT - returns failure from embedded function requests or S_OK.
00327 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00328
00329 HRESULT COShip::InvokeNotifyVtable(IUnknown * punkNotify, long lFlags)
00330 {
00331   HRESULT hr = S_OK;
00332
00333   CComQIPtr<INotify, &IID_INotify> pNotify(punkNotify);
00334
00335   if (!pNotify) hr = E_NOINTERFACE;
00336
00337   if (SUCCEEDED(hr)) hr = pNotify->put_CustomerId(m_lCustomerId);
00338
00339   if (SUCCEEDED(hr)) hr = pNotify->put_OrderId(m_lOrderId);
00340
00341   for (int ix = 0; ix < m_veclItemId.size() && SUCCEEDED(hr); ix++)
00342   {
00343     hr = pNotify->LineItem(m_veclItemId[ix], m_veclQuantity[ix], m_vecShipStatus[ix]);
00344   }
00345
00346   if (SUCCEEDED(hr)) hr = pNotify->Process(lFlags);
00347
00348   return hr;
00349 }
00350
00351 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00352   THIS IS A PRIVATE MEMBER FUNCTION
00353
00354   Method:   COShip::RandomShipStatus
00355   Summary:  Determines shipping status for a particular line item.
00356       The status is derived from a random number, but is skewed
00357       so that most shipments are successful.
00358   Args:     None
00359   Modifies: None
00360   Returns:  ShipStatus - an enumeration declared in QCSamp1.idl
00361 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00362
00363 ShipStatus COShip::RandomShipStatus()
00364 {
00365   const int iRandom = rand() % 100;
00366
00367   if (iRandom < 80) return ssShipped;   // 80% are shipped
00368   if (iRandom < 93) return ssBackOrdered; // 13% are back ordered
00369   if (iRandom < 97) return ssNotStocked;  //  4% are not stocked
00370             return ssUnrecognizedItem;  //  3% have an invalid item number
00371 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/asyncdemotutorial/AsyncDemo.cpp Source File

  • Web
  • winhttp
  • asyncdemotutorial

AsyncDemo.cpp

Go to the documentation of this file.
00001 /************************************************************
00002 *                                                           *
00003 * AsyncDemo.cpp                                             *
00004 *                                                           *
00005 * Copyright (c) Microsoft Corporation. All Rights Reserved. *
00006 *                                                           *
00007 ************************************************************/
00008
00009 #define UNICODE
00010 #include <windows.h>
00011 #include <winhttp.h>
00012 #include <stdio.h>
00013 #include "resource.h"
00014
00015 //********************************************************************
00016 //                                                  Global Variables
00017 //********************************************************************
00018
00019 // Context value structure.
00020 typedef struct {
00021     HWND        hWindow;        // Handle for the dialog box
00022     HINTERNET   hConnect;       // Connection handle
00023     HINTERNET   hRequest;       // Resource request handle
00024     int         nURL;           // ID of the URL edit box
00025     int         nHeader;        // ID of the header output box
00026     int         nResource;      // ID of the resource output box
00027     DWORD       dwSize;         // Size of the latest data block
00028     DWORD       dwTotalSize;    // Size of the total data
00029     LPSTR       lpBuffer;       // Buffer for storing read data
00030     WCHAR       szMemo[512];    // String providing state information
00031 } REQUEST_CONTEXT;
00032
00033
00034 //********************************************************************
00035 //                                              Additional Functions
00036 //********************************************************************
00037
00038
00039
00040
00041 //********************************************************************
00042 //                                                   Status Callback
00043 //********************************************************************
00044
00045 void __stdcall AsyncCallback( HINTERNET hInternet, DWORD dwContext,
00046                               DWORD dwInternetStatus,
00047                               LPVOID lpvStatusInformation,
00048                               DWORD dwStatusInformationLength)
00049 {
00050     REQUEST_CONTEXT *cpContext;
00051     WCHAR szBuffer[256];
00052     cpContext = (REQUEST_CONTEXT*)dwContext;
00053
00054     // Create a string that reflects the status flag.
00055     switch (dwInternetStatus)
00056     {
00057         case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE:
00058             swprintf(szBuffer,L"%s: DATA_AVAILABLE (%d)",
00059                 cpContext->szMemo, dwStatusInformationLength);
00060             break;
00061         case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE:
00062             swprintf(szBuffer,L"%s: HEADERS_AVAILABLE (%d)",
00063                 cpContext->szMemo, dwStatusInformationLength);
00064             break;
00065         case WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE:
00066             swprintf(szBuffer,L"%s: INTERMEDIATE_RESPONSE (%d)",
00067                 cpContext->szMemo, dwStatusInformationLength);
00068             break;
00069         case WINHTTP_CALLBACK_STATUS_READ_COMPLETE:
00070             swprintf(szBuffer,L"%s: READ_COMPLETE (%d)",
00071                 cpContext->szMemo, dwStatusInformationLength);
00072             break;
00073         case WINHTTP_CALLBACK_STATUS_REDIRECT:
00074             swprintf(szBuffer,L"%s: REDIRECT (%d)",
00075                 cpContext->szMemo, dwStatusInformationLength);
00076             break;
00077         case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR:
00078             swprintf(szBuffer,L"%s: REQUEST_ERROR (%d)",
00079                 cpContext->szMemo, dwStatusInformationLength);
00080             break;
00081         case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE:
00082             swprintf(szBuffer,L"%s: SENDREQUEST_COMPLETE (%d)",
00083                 cpContext->szMemo, dwStatusInformationLength);
00084             break;
00085         default:
00086             swprintf(szBuffer,L"%s: Unknown callback - status %d given",
00087                 cpContext->szMemo, dwInternetStatus);
00088             break;
00089     }
00090
00091     // Add the callback information to the listbox.
00092     SendDlgItemMessage( cpContext->hWindow, IDC_CBLIST, LB_ADDSTRING, 0,
00093                         (LPARAM)szBuffer);
00094 }
00095
00096
00097 //********************************************************************
00098 //                                                   Dialog Function
00099 //********************************************************************
00100
00101 BOOL CALLBACK AsyncDialog( HWND hX, UINT message, WPARAM wParam, LPARAM lParam)
00102 {
00103     switch(message)
00104     {
00105     case WM_INITDIALOG:
00106         // Set the default web sites.
00107         SetDlgItemText(hX, IDC_URL1, L"http://www.microsoft.com");
00108         SetDlgItemText(hX, IDC_URL2, L"http://www.msn.com");
00109
00110         return TRUE;
00111     case WM_CLOSE:
00112         EndDialog(hX,0);
00113         return TRUE;
00114     case WM_COMMAND:
00115         switch(LOWORD(wParam))
00116         {
00117             case IDC_EXIT:
00118                 EndDialog(hX,0);
00119                 return TRUE;
00120             case IDC_DOWNLOAD:
00121                 WCHAR szURL1[256], szURL2[256];
00122
00123                 // Reset the edit boxes.
00124                 SetDlgItemText( hX, IDC_HEADER1, NULL );
00125                 SetDlgItemText( hX, IDC_HEADER2, NULL );
00126                 SetDlgItemText( hX, IDC_RESOURCE1, NULL );
00127                 SetDlgItemText( hX, IDC_RESOURCE2, NULL );
00128
00129                 // Obtain the URLs from the dialog box.
00130                 GetDlgItemText( hX, IDC_URL1, szURL1, 256);
00131                 GetDlgItemText( hX, IDC_URL2, szURL2, 256);
00132
00133                 return TRUE;
00134         }
00135     default:
00136         return FALSE;
00137     }
00138 }
00139
00140
00141 //********************************************************************
00142 //                                                      Main Program
00143 //********************************************************************
00144
00145 int WINAPI WinMain( HINSTANCE hThisInst, HINSTANCE hPrevInst,
00146                     LPSTR lpszArgs, int nWinMode)
00147 {
00148     // Show the dialog box.
00149     DialogBox( hThisInst, MAKEINTRESOURCE(IDD_DIALOG1),
00150                HWND_DESKTOP, (DLGPROC)AsyncDialog );
00151
00152     return 0;
00153 }
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/registry.h Source File

  • SysMgmt
  • MMC
  • Tbarext

registry.h

Go to the documentation of this file.
00001
00002 //==============================================================;
00003 //
00004 //  This source code is only intended as a supplement to existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef __Registry_H__
00021 #define __Registry_H__
00022
00023 #include <tchar.h>
00024
00025 // This function will register a component in the Registry.
00026 // The component calls this function from its DllRegisterServer function.
00027 HRESULT RegisterServer(HMODULE hModule,
00028                        const CLSID& clsid,
00029                        const _TCHAR* szFriendlyName) ;
00030
00031 // This function will unregister a component.  Components
00032 // call this function from their DllUnregisterServer function.
00033 HRESULT UnregisterServer(const CLSID& clsid) ;
00034
00035
00036 // This function will register a Snap-In component.  Components
00037 // call this function from their DllRegisterServer function.
00038 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00039                        const _TCHAR* szNameString,   // NameString
00040                        const CLSID& clsidAbout,   // Class Id for About Class
00041                        const BOOL fSupportExtensions = FALSE);
00042
00043 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00044
00045 #endif
00046
00047
00048
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStorageResType Member List

This is the complete list of members for CStorageResType, including all inherited members.
CMgdClusCfgInit(void) | CMgdClusCfgInit |
CMgdClusCfgInit(void) | CMgdClusCfgInit |
CommitChanges(IUnknown *punkClusterInfoIn, IUnknown *punkResTypeServicesIn) | CStorageResType |
CStorageResType(void) | CStorageResType | [inline]
CStorageResType(const CStorageResType &rSrcIn) | CStorageResType | [private]
GetCallback(void) | CMgdClusCfgInit | [inline]
GetCallback(void) | CMgdClusCfgInit | [inline]
GetDisplayName(void) | CMgdClusCfgInit | [inline]
GetDisplayName(void) | CMgdClusCfgInit | [inline]
GetDllName(void) | CMgdClusCfgInit | [inline]
GetDllName(void) | CMgdClusCfgInit | [inline]
GetLCID(void) | CMgdClusCfgInit | [inline]
GetLCID(void) | CMgdClusCfgInit | [inline]
GetNodeName(void) | CMgdClusCfgInit | [inline]
GetNodeName(void) | CMgdClusCfgInit | [inline]
GetResTypeName(void) | CMgdClusCfgInit | [inline]
GetResTypeName(void) | CMgdClusCfgInit | [inline]
GetTypeGUID(GUID *pguidGUIDOut) | CStorageResType |
GetTypeName(BSTR *pbstrTypeNameOut) | CStorageResType |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, UINT idsDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, UINT idsDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
Initialize(IUnknown *punkCallbackIn, LCID lcidIn) | CMgdClusCfgInit |
Initialize(IUnknown *punkCallbackIn, LCID lcidIn) | CMgdClusCfgInit |
Notify(IUnknown *punkIn) | CStorageResType |
operator=(const CStorageResType &rSrcIn) | CStorageResType | [private]
~CMgdClusCfgInit(void) | CMgdClusCfgInit | [virtual]
~CMgdClusCfgInit(void) | CMgdClusCfgInit | [virtual]
~CStorageResType(void) | CStorageResType | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/UserEvents/VCAcct/Resource.h Source File

  • Com
  • Services
  • Events
  • UserEvents
  • VCAcct

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Account.rc
00004 //
00005 #define IDS_ACCOUNT_DESC                1
00006 #define IDR_Account                     1
00007 #define IDS_MOVEMONEY_DESC              2
00008 #define IDR_MoveMoney                   2
00009 #define IDS_UPDATERECEIPT_DESC          114
00010 #define IDR_UpdateReceipt               115
00011 #define IDS_GETRECEIPT_DESC             116
00012 #define IDR_GetReceipt                  117
00013 #define IDS_UPDATERECEIPT_DESC1         118
00014 #define IDR_UpdateReceipt1              119
00015
00016 // Next default values for new objects
00017 //
00018 #ifdef APSTUDIO_INVOKED
00019 #ifndef APSTUDIO_READONLY_SYMBOLS
00020 #define _APS_NEXT_RESOURCE_VALUE        201
00021 #define _APS_NEXT_COMMAND_VALUE         32768
00022 #define _APS_NEXT_CONTROL_VALUE         201
00023 #define _APS_NEXT_SYMED_VALUE           120
00024 #endif
00025 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/registry.h Source File

  • SysMgmt
  • MMC
  • Nameext

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout,   // Class Id for About Class
00040                        const BOOL fSupportExtensions = FALSE);
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyCapabilities/Resource.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyCapabilities

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by MyCapabilities.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_MYCAPABILITIES              101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
00018
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/CursorOptionEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

CursorOptionEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: CursorOptionEnum
00019
00020 public class CursorOptionEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final int adHoldRecords = 256;
00023   public static final int adMovePrevious = 512;
00024   public static final int adAddNew = 16778240;
00025   public static final int adDelete = 16779264;
00026   public static final int adUpdate = 16809984;
00027   public static final int adBookmark = 8192;
00028   public static final int adApproxPosition = 16384;
00029   public static final int adUpdateBatch = 65536;
00030   public static final int adResync = 131072;
00031   public static final int adNotify = 262144;
00032   public static final int adFind = 524288;
00033   public static final int adSeek = 4194304;
00034   public static final int adIndex = 8388608;
00035 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AutoClaims_WebControl/C#/AssemblyInfo.cs Source File

  • TabletPC
  • AutoClaims_WebControl
  • C#

AssemblyInfo.cs

Go to the documentation of this file.
00001 using System.Reflection;
00002 using System.Runtime.CompilerServices;
00003
00004 //
00005 // General Information about an assembly is controlled through the following
00006 // set of attributes. Change these attribute values to modify the information
00007 // associated with an assembly.
00008 //
00009 [assembly: AssemblyTitle("Auto Claims (Web Control) Sample Application")]
00010 [assembly: AssemblyCompany("Microsoft Corporation")]
00011 [assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
00012 [assembly: AssemblyCopyright("Copyright (c) 1998-2003 Microsoft Corporation.")]
00013 [assembly: AssemblyTrademark("Microsoft (R) is a registered trademark of Microsoft Corporation. Windows (R) is a registered trademark of Microsoft Corporation.")]
00014 //[assembly: AssemblyCulture("")]
00015
00016 //
00017 // Version information for an assembly consists of the following four values:
00018 //
00019 //      Major Version
00020 //      Minor Version
00021 //      Build Number
00022 //      Revision
00023 //
00024 // You can specify all the values or you can default the Revision and Build Numbers
00025 // by using the '*' as shown below:
00026
00027 //[assembly: AssemblyVersion("1.0.*")]
00028
00029 //
00030 // In order to sign your assembly you must specify a key to use. Refer to the
00031 // Microsoft .NET Framework documentation for more information on assembly signing.
00032 //
00033 // Use the attributes below to control which key is used for signing.
00034 //
00035 // Notes:
00036 //   (*) If no key is specified, the assembly is not signed.
00037 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00038 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00039 //       a key.
00040 //   (*) If the KeyFile and the KeyName values are both specified, the
00041 //       following processing occurs:
00042 //       (1) If the KeyName can be found in the CSP, that key is used.
00043 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00044 //           in the KeyFile is installed into the CSP and used.
00045 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00046 //       When specifying the KeyFile, the location of the KeyFile should be
00047 //       relative to the project output directory which is
00048 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00049 //       located in the project directory, you would specify the AssemblyKeyFile
00050 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00051 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00052 //       documentation for more information on this.
00053 //
00054 [assembly: AssemblyDelaySign(false)]
00055 [assembly: AssemblyKeyFile("")]
00056 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/basesnap.h Source File

  • SysMgmt
  • MMC
  • Complete

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Error Member List

This is the complete list of members for msado15::Error, including all inherited members.
getDescription() | msado15::Error |
getHelpContext() | msado15::Error |
getHelpFile() | msado15::Error |
getNativeError() | msado15::Error |
getNumber() | msado15::Error |
getSource() | msado15::Error |
getSQLState() | msado15::Error |
iid | msado15::Error | [static]
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/basesnap.Cpp Source File

  • SysMgmt
  • MMC
  • Openserv

basesnap.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <olectl.h>
00021 #include <initguid.h>
00022 #include "guids.h"
00023 #include "basesnap.h"
00024 #include "Comp.h"
00025 #include "CompData.h"
00026 #include "About.h"
00027 #include "Registry.h"
00028
00029 // our globals
00030 HINSTANCE g_hinst;
00031
00032 BOOL WINAPI DllMain(HINSTANCE hinstDLL,
00033                     DWORD fdwReason,
00034                     void* lpvReserved)
00035 {
00036
00037     if (fdwReason == DLL_PROCESS_ATTACH) {
00038         g_hinst = hinstDLL;
00039     }
00040
00041     return TRUE;
00042 }
00043
00044
00045 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
00046 {
00047     if ((rclsid != CLSID_CComponentData) && (rclsid != CLSID_CSnapinAbout))
00048         return CLASS_E_CLASSNOTAVAILABLE;
00049
00050
00051     if (!ppvObj)
00052         return E_FAIL;
00053
00054     *ppvObj = NULL;
00055
00056     // We can only hand out IUnknown and IClassFactory pointers.  Fail
00057     // if they ask for anything else.
00058     if (!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00059         return E_NOINTERFACE;
00060
00061     CClassFactory *pFactory = NULL;
00062
00063     // make the factory passing in the creation function for the type of object they want
00064     if (rclsid == CLSID_CComponentData)
00065         pFactory = new CClassFactory(CClassFactory::COMPONENT);
00066     else if (rclsid == CLSID_CSnapinAbout)
00067         pFactory = new CClassFactory(CClassFactory::ABOUT);
00068
00069     if (NULL == pFactory)
00070         return E_OUTOFMEMORY;
00071
00072     HRESULT hr = pFactory->QueryInterface(riid, ppvObj);
00073
00074     return hr;
00075 }
00076
00077 STDAPI DllCanUnloadNow(void)
00078 {
00079     if (g_uObjects == 0 && g_uSrvLock == 0)
00080         return S_OK;
00081     else
00082         return S_FALSE;
00083 }
00084
00085
00086 CClassFactory::CClassFactory(FACTORY_TYPE factoryType)
00087 : m_cref(0), m_factoryType(factoryType)
00088 {
00089     OBJECT_CREATED
00090 }
00091
00092 CClassFactory::~CClassFactory()
00093 {
00094     OBJECT_DESTROYED
00095 }
00096
00097 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv)
00098 {
00099     if (!ppv)
00100         return E_FAIL;
00101
00102     *ppv = NULL;
00103
00104     if (IsEqualIID(riid, IID_IUnknown))
00105         *ppv = static_cast<IClassFactory *>(this);
00106     else
00107         if (IsEqualIID(riid, IID_IClassFactory))
00108             *ppv = static_cast<IClassFactory *>(this);
00109
00110         if (*ppv)
00111         {
00112             reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00113             return S_OK;
00114         }
00115
00116         return E_NOINTERFACE;
00117 }
00118
00119 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00120 {
00121     return InterlockedIncrement((LONG *)&m_cref);
00122 }
00123
00124 STDMETHODIMP_(ULONG) CClassFactory::Release()
00125 {
00126     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00127     {
00128         delete this;
00129         return 0;
00130     }
00131     return m_cref;
00132 }
00133
00134 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj)
00135 {
00136     HRESULT  hr;
00137     void* pObj;
00138
00139     if (!ppvObj)
00140         return E_FAIL;
00141
00142     *ppvObj = NULL;
00143
00144     // Our object does does not support aggregation, so we need to
00145     // fail if they ask us to do aggregation.
00146     if (pUnkOuter)
00147         return CLASS_E_NOAGGREGATION;
00148
00149     if (COMPONENT == m_factoryType) {
00150         pObj = new CComponentData();
00151     } else {
00152         pObj = new CSnapinAbout();
00153     }
00154
00155     if (!pObj)
00156         return E_OUTOFMEMORY;
00157
00158     // QueryInterface will do the AddRef() for us, so we do not
00159     // do it in this function
00160     hr = ((LPUNKNOWN)pObj)->QueryInterface(riid, ppvObj);
00161
00162     if (FAILED(hr))
00163         delete pObj;
00164
00165     return hr;
00166 }
00167
00168 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00169 {
00170     if (fLock)
00171         InterlockedIncrement((LONG *)&g_uSrvLock);
00172     else
00173         InterlockedDecrement((LONG *)&g_uSrvLock);
00174
00175     return S_OK;
00176 }
00177
00178 //////////////////////////////////////////////////////////
00179 //
00180 // Exported functions
00181 //
00182
00183
00184 //
00185 // Server registration
00186 //
00187 STDAPI DllRegisterServer()
00188 {
00189     HRESULT hr = SELFREG_E_CLASS;
00190     _TCHAR szName[256];
00191     _TCHAR szSnapInName[256];
00192
00193     LoadString(g_hinst, IDS_NAME, szName, (sizeof szName)/(sizeof szName[0]));
00194     LoadString(g_hinst, IDS_SNAPINNAME, szSnapInName, (sizeof szSnapInName)/(sizeof szSnapInName[0]));
00195
00196     _TCHAR szAboutName[256];
00197
00198     LoadString(g_hinst, IDS_ABOUTNAME, szAboutName, (sizeof szAboutName)/(sizeof szAboutName[0]));
00199
00200     // register our CoClasses
00201     hr = RegisterServer(g_hinst,
00202         CLSID_CComponentData,
00203         szName);
00204
00205     if SUCCEEDED(hr)
00206         hr = RegisterServer(g_hinst,
00207         CLSID_CSnapinAbout,
00208         szAboutName);
00209
00210     // place the registry information for SnapIns
00211     if SUCCEEDED(hr)
00212         hr = RegisterSnapin(CLSID_CComponentData, szSnapInName, CLSID_CSnapinAbout, FALSE);
00213
00214     return hr;
00215 }
00216
00217
00218 STDAPI DllUnregisterServer()
00219 {
00220     if (UnregisterServer(CLSID_CComponentData) == S_OK)
00221         return UnregisterSnapin(CLSID_CComponentData);
00222     else
00223         return E_FAIL;
00224 }
00225
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/about.Cpp Source File

  • SysMgmt
  • MMC
  • Nameext

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163   MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164   *lpDest = wszStr;
00165
00166     return S_OK;
00167 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/clntlst.h Source File

  • NetDS
  • RRas
  • rqs
  • server

clntlst.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright   (c) Microsoft Corporation.  All rights reserved.
00004 //
00005 //  File:       ClntLst.h
00006 //
00007 //  Contents:   class to implement a simple Linked list of clients
00008 //
00009 //  Notes:
00010 //
00011 //----------------------------------------------------------------------------
00012 #include <shlwapi.h>
00013 #include "rqs.h"
00014
00015 class ClientList
00016 {
00017     private:
00018         typedef struct _tag_LIST_NODE
00019         {
00020           struct _tag_LIST_NODE* pNext;
00021           RqsClient* pClient;
00022         } LISTNODE;
00023
00024         LISTNODE* m_pHead;
00025         LISTNODE* m_pTail;
00026         int m_iCount;
00027
00028     public:
00029
00030     class Iterator
00031     {
00032     friend ClientList;
00033
00034     public:
00035         Iterator() : m_pHead(NULL), m_pTail(NULL), m_pCurrent(NULL){};
00036         ~Iterator() {};
00037
00038         BOOL Next()
00039         {
00040             BOOL bReturn = TRUE;
00041
00042             if (m_pCurrent)
00043             {
00044                 m_pCurrent = m_pCurrent->pNext;
00045             }
00046             else
00047             {
00048                 bReturn = FALSE;
00049             }
00050
00051             return bReturn;
00052         }
00053
00054         BOOL AtEnd() const
00055         {
00056             return (m_pCurrent == NULL);
00057         }
00058
00059         RqsClient* GetItem() const
00060         {
00061             if (m_pCurrent)
00062             {
00063                 return m_pCurrent->pClient;
00064             }
00065             else
00066             {
00067                 return NULL;
00068             }
00069         }
00070
00071
00072     private:
00073         LISTNODE* m_pHead;
00074         LISTNODE* m_pTail;
00075         LISTNODE* m_pCurrent;
00076     };
00077
00078     ClientList()
00079     {
00080         m_pHead = m_pTail = NULL;
00081         m_iCount = 0;
00082     }
00083
00084     ~ClientList()
00085     {
00086         while (NULL != m_pHead)
00087         {
00088             LISTNODE* pTemp = m_pHead->pNext;
00089             RuFree(m_pHead);
00090             m_pHead = pTemp;
00091         }
00092     }
00093
00094     HRESULT InsertBack(RqsClient* pClient)
00095     {
00096         HRESULT hr = S_OK;
00097
00098         if (m_pTail)
00099         {
00100             m_pTail->pNext = (LISTNODE*)RuAlloc(sizeof(LISTNODE), TRUE);
00101             if(m_pTail->pNext)
00102             {
00103                 m_pTail->pNext->pClient = pClient;
00104                 m_pTail->pNext->pNext = NULL;
00105                 m_pTail = m_pTail->pNext;
00106                 m_iCount++;
00107             }
00108             else
00109             {
00110                 hr = E_OUTOFMEMORY;
00111             }
00112         }
00113         else
00114         {
00115             m_pHead = m_pTail = (LISTNODE*)RuAlloc(sizeof(LISTNODE), TRUE);
00116             if (m_pHead)
00117             {
00118                 m_pHead->pClient = pClient;
00119                 m_pHead->pNext = NULL;
00120                 m_iCount = 1;
00121             }
00122             else
00123             {
00124                 hr = E_OUTOFMEMORY;
00125             }
00126         }
00127
00128         return hr;
00129     }
00130
00131     VOID GetIterator(OUT ClientList::Iterator& It) const
00132     {
00133         if (m_pHead)
00134         {
00135             It.m_pHead = m_pHead;
00136             It.m_pTail = m_pTail;
00137         }
00138         else
00139         {
00140             It.m_pHead = NULL;
00141             It.m_pTail = NULL;
00142         }
00143
00144         It.m_pCurrent = m_pHead;
00145     }
00146
00147     HRESULT RemoveItem(RqsClient* pClient)
00148     {
00149         HRESULT hr = S_FALSE;
00150         //
00151         //  Remove the first node with the given Client pointer.
00152         //
00153         if (m_pHead)
00154         {
00155             LISTNODE* pCurrent = m_pHead;
00156             LISTNODE* pFollower = NULL;
00157
00158       while (pCurrent)
00159       {
00160         if (pCurrent->pClient == pClient)
00161         {
00162           //
00163           //  We have an item to remove
00164           //
00165           if (pFollower)
00166           {
00167             pFollower->pNext = pCurrent->pNext;
00168             if (pCurrent == m_pTail)
00169             {
00170               m_pTail = pFollower;
00171             }
00172           }
00173           else
00174           {
00175             m_pHead = pCurrent->pNext;
00176             if(pCurrent == m_pTail)
00177             {
00178               m_pTail = m_pHead;
00179             }
00180           }
00181
00182           RuFree(pCurrent);
00183           pCurrent = NULL;
00184           m_iCount--;
00185           hr = S_OK;
00186         }
00187         else
00188         {
00189           pFollower = pCurrent;
00190           pCurrent = pCurrent->pNext;
00191         }
00192       }
00193         }
00194
00195         return hr;
00196     }
00197 };
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCmdLineLite Member List

This is the complete list of members for CCmdLineLite, including all inherited members.
CCmdLineLite() | CCmdLineLite |
m_wszLastCmd | CCmdLineLite |
ParseCommandLine() | CCmdLineLite | [virtual]
ParseFile(WCHAR *pwszFileName) | CCmdLineLite | [virtual]
ParseParam(WCHAR *pwszParam, BOOL bFlag, BOOL bLast) | CCmdLineLite | [virtual]
ResetParser() | CCmdLineLite | [virtual]
~CCmdLineLite() | CCmdLineLite | [virtual]
Generated on Wed Nov 13 2024 16:55:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CContextMenu Member List

This is the complete list of members for CContextMenu, including all inherited members.
AllocPidlTable(DWORD) | CContextMenu | [private]
CContextMenu() | CContextMenu |
CContextMenu(CShellFolder *psfParent, LPCITEMIDLIST *aPidls=NULL, UINT uItemCount=0) | CContextMenu |
DoCopyOrCut(HWND, BOOL) | CContextMenu | [private]
DoDelete(VOID) | CContextMenu | [private]
DoExplore(HWND) | CContextMenu | [private]
DoModifyData(HWND) | CContextMenu | [private]
DoNewFolder(HWND) | CContextMenu | [private]
DoNewItem(HWND) | CContextMenu | [private]
DoOpen(HWND) | CContextMenu | [private]
DoPaste(VOID) | CContextMenu | [private]
DoRename(HWND) | CContextMenu | [private]
FillPidlTable(LPCITEMIDLIST *, UINT) | CContextMenu | [private]
FreePidlTable(LPITEMIDLIST *) | CContextMenu | [private]
GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT ccMax) | CContextMenu |
GetCommandString(UINT_PTR, UINT, LPUINT, LPSTR, UINT) | CContextMenu |
Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, HKEY hKeyID) | CContextMenu |
InsertBackgroundItems(HMENU, UINT, UINT) | CContextMenu | [private]
InsertItems(HMENU, UINT, UINT, UINT) | CContextMenu | [private]
InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi) | CContextMenu |
InvokeCommand(LPCMINVOKECOMMANDINFO) | CContextMenu |
m_aPidls | CContextMenu | [private]
m_cfPrivateData | CContextMenu | [private]
m_fBackground | CContextMenu | [private]
m_ObjRefCount | CContextMenu | [private]
m_pMalloc | CContextMenu | [private]
m_pPidlMgr | CContextMenu | [private]
m_psfParent | CContextMenu | [private]
m_spDataObj | CContextMenu | [private]
m_uItemCount | CContextMenu | [private]
QueryContextMenu(HMENU hShellMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) | CContextMenu |
QueryContextMenu(HMENU, UINT, UINT, UINT, UINT) | CContextMenu |
QueryInterface(REFIID, LPVOID FAR *) | CContextMenu |
ShowClipformatInfo() | CContextMenu |
STDMETHODIMP_(DWORD) AddRef() | CContextMenu |
STDMETHODIMP_(DWORD) Release() | CContextMenu |
~CContextMenu() | CContextMenu |
~CContextMenu() | CContextMenu |
Generated on Wed Nov 13 2024 16:55:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropInfoSets Member List

This is the complete list of members for CPropInfoSets, including all inherited members.
AddElement(DBPROPINFOSETelement) | CVector< DBPROPINFOSET > | [virtual]
AddPropSet(REFGUID guidPropertySet) | TPropSetBase< DBPROPINFOSET, CPropertyInfos > | [virtual]
Attach(CVector &rVector) | CVector< DBPROPINFOSET > | [virtual]
Attach(ULONGcElements, DBPROPINFOSET *rgElements) | CVector< DBPROPINFOSET > | [virtual]
CPropInfoSets(ULONG cPropInfoSets=0, DBPROPINFOSET *rgPropInfoSets=NULL) | CPropInfoSets |
CVector(ULONGulLowerBound=0, ULONGulGrowSize=10) | CVector< DBPROPINFOSET > |
Detach(ULONG *pcElements, DBPROPINFOSET **prgElements) | CVector< DBPROPINFOSET > | [virtual]
FindProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet) | CPropInfoSets | [virtual]
FindPropSet(REFGUID guidPropertySet) | TPropSetBase< DBPROPINFOSET, CPropertyInfos > | [virtual]
GetCount() | CVector< DBPROPINFOSET > | [inline, virtual]
GetElement(ULONGiIndex) | CVector< DBPROPINFOSET > | [virtual]
GetElements() const | CVector< DBPROPINFOSET > | [inline, virtual]
GetPropSets() | TPropSetBase< DBPROPINFOSET, CPropertyInfos > | [inline, virtual]
InsertAt(ULONGiIndex, DBPROPINFOSETelement) | CVector< DBPROPINFOSET > | [virtual]
m_cElements | CVector< DBPROPINFOSET > | [protected]
m_rgElements | CVector< DBPROPINFOSET > | [protected]
m_ulGrowSize | CVector< DBPROPINFOSET > | [protected]
m_ulLowerBound | CVector< DBPROPINFOSET > | [protected]
m_ulMaxSize | CVector< DBPROPINFOSET > | [protected]
operator[](ULONGiIndex) | CVector< DBPROPINFOSET > | [inline, virtual]
RemoveAll() | TPropSetBase< DBPROPINFOSET, CPropertyInfos > | [virtual]
RemoveAt(ULONGiIndex) | CVector< DBPROPINFOSET > | [virtual]
TPropSetBase(ULONG cElements=0, DBPROPINFOSET *rgElements=NULL) | TPropSetBase< DBPROPINFOSET, CPropertyInfos > |
~CPropInfoSets() | CPropInfoSets | [virtual]
~CVector() | CVector< DBPROPINFOSET > | [virtual]
~TPropSetBase() | TPropSetBase< DBPROPINFOSET, CPropertyInfos > | [virtual]
Generated on Wed Nov 13 2024 16:57:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAgentCtlAnimationNames Member List

This is the complete list of members for CAgentCtlAnimationNames, including all inherited members.
CAgentCtlAnimationNames() | CAgentCtlAnimationNames | [inline]
CAgentCtlAnimationNames(LPDISPATCH pDispatch) | CAgentCtlAnimationNames | [inline]
CAgentCtlAnimationNames(const CAgentCtlAnimationNames &dispatchSrc) | CAgentCtlAnimationNames | [inline]
Generated on Wed Nov 13 2024 16:55:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkErase::InkErase Member List

This is the complete list of members for InkErase::InkErase, including all inherited members.
components | InkErase::InkErase | [private]
Dispose(bool disposing) | InkErase::InkErase | [inline, protected]
EraseAtCusps(Point pt) | InkErase::InkErase | [inline, private]
EraseAtIntersections(Point pt) | InkErase::InkErase | [inline, private]
EraseStrokes(Point pt, Stroke currentStroke) | InkErase::InkErase | [inline, private]
HitTestRadius | InkErase::InkErase | [private]
InitializeComponent() | InkErase::InkErase | [inline, private]
InkErase() | InkErase::InkErase | [inline]
InkErase_Load(object sender, System.EventArgs e) | InkErase::InkErase | [inline, private]
InkErase_OnMouseMove(object sender, MouseEventArgs e) | InkErase::InkErase | [inline, private]
InkErase_OnPaint(object sender, PaintEventArgs e) | InkErase::InkErase | [inline, private]
Main() | InkErase::InkErase | [inline, private, static]
MediumInkWidth | InkErase::InkErase | [private]
miClear | InkErase::InkErase | [private]
miClear_Click(object sender, System.EventArgs e) | InkErase::InkErase | [inline, private]
miCuspErase | InkErase::InkErase | [private]
miCuspErase_Click(object sender, System.EventArgs e) | InkErase::InkErase | [inline, private]
miExit | InkErase::InkErase | [private]
miExit_Click(object sender, System.EventArgs e) | InkErase::InkErase | [inline, private]
miInk | InkErase::InkErase | [private]
miInk_Click(object sender, System.EventArgs e) | InkErase::InkErase | [inline, private]
miIntersectErase | InkErase::InkErase | [private]
miIntersectErase_Click(object sender, System.EventArgs e) | InkErase::InkErase | [inline, private]
miMain | InkErase::InkErase | [private]
miMainAction | InkErase::InkErase | [private]
miMainMode | InkErase::InkErase | [private]
miSeparator | InkErase::InkErase | [private]
miStrokeErase | InkErase::InkErase | [private]
miStrokeErase_Click(object sender, System.EventArgs e) | InkErase::InkErase | [inline, private]
mode | InkErase::InkErase | [private]
myInkCollector | InkErase::InkErase | [private]
myInkCollector_CursorDown(object sender, InkCollectorCursorDownEventArgs e) | InkErase::InkErase | [inline]
myInkCollector_NewPackets(object sender, InkCollectorNewPacketsEventArgs e) | InkErase::InkErase | [inline, private]
myInkCollector_Stroke(object sender, InkCollectorStrokeEventArgs e) | InkErase::InkErase | [inline]
PaintCusps(Graphics g, Strokes strokesToPaint) | InkErase::InkErase | [inline, private]
PaintIntersections(Graphics g, Strokes strokesToPaint) | InkErase::InkErase | [inline, private]
StrokePointRadius | InkErase::InkErase | [private]
UpdateApplicationMode(ApplicationMode newMode) | InkErase::InkErase | [inline, private]
XPacketIndex | InkErase::InkErase | [private]
YPacketIndex | InkErase::InkErase | [private]
Generated on Wed Nov 13 2024 16:58:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/registry.Cpp Source File

  • SysMgmt
  • MMC
  • Extens

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021 #include "Extend.h"
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 // we need access to our g_nodes
00028 extern NODESTRUCT g_Nodes[];
00029
00030 ////////////////////////////////////////////////////////
00031 //
00032 // Internal helper functions prototypes
00033 //
00034
00035 // Set the given key and its value.
00036 BOOL setKeyAndValue(const _TCHAR* pszPath,
00037                     const _TCHAR* szSubkey,
00038                     const _TCHAR* szValue) ;
00039
00040 // Set the given key and its value in the MMC Snapin location
00041 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00042                           const _TCHAR* szSubkey,
00043                           const _TCHAR* szName,
00044                           const _TCHAR* szValue);
00045
00046 BOOL setSnapInExtensionNode(const _TCHAR* szSnapID,
00047                             const _TCHAR* szNodeID,
00048                             const _TCHAR* szDescription);
00049
00050 // Set the given valuename under the key to value
00051 BOOL setValue(const _TCHAR* szKey,
00052               const _TCHAR* szValueName,
00053               const _TCHAR* szValue);
00054
00055 // Delete szKeyChild and all of its descendents.
00056 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00057
00058 ////////////////////////////////////////////////////////
00059 //
00060 // Constants
00061 //
00062
00063 // Size of a CLSID as a string
00064 //const int CLSID_STRING_SIZE = 39 ;
00065
00066 /////////////////////////////////////////////////////////
00067 //
00068 // Public function implementation
00069 //
00070
00071 //
00072 // Register the component in the registry.
00073 //
00074 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00075                        const CLSID& clsid,         // Class ID
00076                        const _TCHAR* szFriendlyName)       //   IDs
00077 {
00078     // Get server location.
00079     _TCHAR szModule[512] ;
00080     DWORD dwResult =
00081         ::GetModuleFileName(hModule,
00082         szModule,
00083         sizeof(szModule)/sizeof(_TCHAR)) ;
00084
00085     assert(dwResult != 0) ;
00086
00087     // Get CLSID
00088     LPOLESTR wszCLSID = NULL ;
00089     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00090
00091     assert(SUCCEEDED(hr)) ;
00092
00093     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00094
00095     // Build the key CLSID\\{...}
00096     _TCHAR szKey[64] ;
00097     _tcscpy(szKey, _T("CLSID\\")) ;
00098         _tcscat(szKey, pszCLSID) ;
00099
00100     // Add the CLSID to the registry.
00101     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00102
00103     // Add the server filename subkey under the CLSID key.
00104     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00105
00106     // set the threading model
00107     _tcscat(szKey, _T("\\InprocServer32"));
00108     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00109
00110     // Free memory.
00111     CoTaskMemFree(wszCLSID) ;
00112
00113     return S_OK ;
00114 }
00115
00116 //
00117 // Remove the component from the registry.
00118 //
00119 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00120 {
00121     // Get CLSID
00122     LPOLESTR wszCLSID = NULL ;
00123     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00124
00125
00126     // Build the key CLSID\\{...}
00127     _TCHAR szKey[64] ;
00128     _tcscpy(szKey, _T("CLSID\\")) ;
00129
00130         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00131         _tcscat(szKey, pszT) ;
00132
00133     // Delete the CLSID Key - CLSID\{...}
00134     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00135     assert((lResult == ERROR_SUCCESS) ||
00136                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00137
00138     // Free memory.
00139     CoTaskMemFree(wszCLSID) ;
00140
00141     return S_OK ;
00142 }
00143
00144 //
00145 // Register the snap-in in the registry.
00146 //
00147 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00148                        const _TCHAR* szNameString,   // NameString
00149                        const CLSID& clsidAbout)         // Class Id for About Class
00150
00151 {
00152     // Get CLSID
00153     LPOLESTR wszCLSID = NULL ;
00154     LPOLESTR wszAboutCLSID = NULL;
00155     LPOLESTR wszExtendCLSID = NULL;
00156     NODESTRUCT *pNode;
00157
00158     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00159
00160     if (IID_NULL != clsidAbout)
00161         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00162
00163     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00164     MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00165
00166
00167     // Add the CLSID to the registry.
00168     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00169     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00170     if (IID_NULL != clsidAbout)
00171         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00172
00173     // register each of the node types in g_Nodes as an extendable node
00174     for (pNode = &(g_Nodes[0]);*pNode->szDescription;pNode++)
00175     {
00176         hr = StringFromCLSID(pNode->GUID, &wszExtendCLSID);
00177         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00178         setSnapInExtensionNode(pszCLSID, pszExtendCLSID, pNode->szDescription);
00179         CoTaskMemFree(wszExtendCLSID);
00180     }
00181
00182     // Free memory.
00183     CoTaskMemFree(wszCLSID) ;
00184     if (IID_NULL != clsidAbout)
00185         CoTaskMemFree(wszAboutCLSID);
00186
00187     return S_OK ;
00188 }
00189
00190 //
00191 // Unregister the snap-in in the registry.
00192 //
00193 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00194 {
00195     _TCHAR szKeyBuf[1024];
00196     LPOLESTR wszCLSID = NULL;
00197
00198     // Get CLSID
00199     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00200     MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00201
00202     // Load the buffer with the Snap-In Location
00203     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00204
00205     // Copy keyname into buffer.
00206     _tcscat(szKeyBuf, _T("\\"));
00207     _tcscat(szKeyBuf, pszCLSID);
00208
00209     // Delete the CLSID Key - CLSID\{...}
00210     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00211     assert((lResult == ERROR_SUCCESS) ||
00212                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00213
00214   //Uncomment following for loop to unregister all extendable node types
00215   //Note that if a snap-in's extendable node types are unregistered,
00216   //any extension snap-ins for these node types will have to be re-registered
00217   //in order to rebuild their entries under the SOFTWARE\Microsoft\MMC\NodeTypes key
00218
00219 /*
00220     // Unregister each of the node types in g_Nodes as an extendable node
00221
00222     NODESTRUCT *pNode;
00223   LPOLESTR wszExtendCLSID = NULL;
00224
00225     for (pNode = &(g_Nodes[0]);*pNode->szDescription;pNode++)
00226     {
00227         hr = StringFromCLSID(pNode->GUID, &wszExtendCLSID);
00228         // Load the buffer with the Snap-In Location
00229         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00230         _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00231         // Copy keyname into buffer.
00232         _tcscat(szKeyBuf, pszExtendCLSID);
00233         recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00234         CoTaskMemFree(wszExtendCLSID);
00235     }
00236
00237 */
00238
00239     // free the memory
00240     CoTaskMemFree(wszCLSID);
00241
00242     return S_OK;
00243 }
00244
00245 //
00246 // Delete a key and all of its descendents.
00247 //
00248 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00249                         const _TCHAR* lpszKeyChild)  // Key to delete
00250 {
00251     // Open the child.
00252     HKEY hKeyChild ;
00253     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00254         KEY_ALL_ACCESS, &hKeyChild) ;
00255     if (lRes != ERROR_SUCCESS)
00256     {
00257         return lRes ;
00258     }
00259
00260     // Enumerate all of the decendents of this child.
00261     FILETIME time ;
00262     _TCHAR szBuffer[256] ;
00263     DWORD dwSize = 256 ;
00264     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00265         NULL, NULL, &time) == S_OK)
00266     {
00267         // Delete the decendents of this child.
00268         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00269         if (lRes != ERROR_SUCCESS)
00270         {
00271             // Cleanup before exiting.
00272             RegCloseKey(hKeyChild) ;
00273             return lRes;
00274         }
00275         dwSize = 256 ;
00276     }
00277
00278     // Close the child.
00279     RegCloseKey(hKeyChild) ;
00280
00281     // Delete this child.
00282     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00283 }
00284
00285 //
00286 // Create a key and set its value.
00287 //   - This helper function was borrowed and modifed from
00288 //     Kraig Brockschmidt's book Inside OLE.
00289 //
00290 BOOL setKeyAndValue(const _TCHAR* szKey,
00291                     const _TCHAR* szSubkey,
00292                     const _TCHAR* szValue)
00293 {
00294     HKEY hKey;
00295     _TCHAR szKeyBuf[1024] ;
00296
00297     // Copy keyname into buffer.
00298     _tcscpy(szKeyBuf, szKey) ;
00299
00300     // Add subkey name to buffer.
00301     if (szSubkey != NULL)
00302     {
00303         _tcscat(szKeyBuf, _T("\\")) ;
00304         _tcscat(szKeyBuf, szSubkey ) ;
00305     }
00306
00307     // Create and open key and subkey.
00308     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00309         szKeyBuf,
00310         0, NULL, REG_OPTION_NON_VOLATILE,
00311         KEY_ALL_ACCESS, NULL,
00312         &hKey, NULL) ;
00313     if (lResult != ERROR_SUCCESS)
00314     {
00315         return FALSE ;
00316     }
00317
00318     // Set the Value.
00319     if (szValue != NULL)
00320     {
00321         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00322             (BYTE *)szValue,
00323             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00324     }
00325
00326     RegCloseKey(hKey) ;
00327     return TRUE ;
00328 }
00329
00330 //
00331 // Open a key value and set it
00332 //
00333 BOOL setValue(const _TCHAR* szKey,
00334               const _TCHAR* szValueName,
00335               const _TCHAR* szValue)
00336 {
00337     HKEY hKey;
00338     _TCHAR szKeyBuf[1024] ;
00339
00340     // Copy keyname into buffer.
00341     _tcscpy(szKeyBuf, szKey) ;
00342
00343     // Create and open key and subkey.
00344     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00345         szKeyBuf,
00346         0, NULL, REG_OPTION_NON_VOLATILE,
00347         KEY_ALL_ACCESS, NULL,
00348         &hKey, NULL) ;
00349     if (lResult != ERROR_SUCCESS)
00350     {
00351         return FALSE ;
00352     }
00353
00354     // Set the Value.
00355     if (szValue != NULL)
00356     {
00357         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00358             (BYTE *)szValue,
00359             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00360     }
00361
00362     RegCloseKey(hKey) ;
00363     return TRUE ;
00364 }
00365
00366 //
00367 // Create a key and set its value.
00368 //   - This helper function was borrowed and modifed from
00369 //     Kraig Brockschmidt's book Inside OLE.
00370 //
00371 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00372                           const _TCHAR* szSubkey,
00373                           const _TCHAR* szName,
00374                           const _TCHAR* szValue)
00375 {
00376     HKEY hKey;
00377     _TCHAR szKeyBuf[1024] ;
00378
00379     // Load the buffer with the Snap-In Location
00380     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00381
00382     // Copy keyname into buffer.
00383     _tcscat(szKeyBuf, _T("\\")) ;
00384     _tcscat(szKeyBuf, szKey) ;
00385
00386     // Add subkey name to buffer.
00387     if (szSubkey != NULL)
00388     {
00389         _tcscat(szKeyBuf, _T("\\")) ;
00390         _tcscat(szKeyBuf, szSubkey ) ;
00391     }
00392
00393     // Create and open key and subkey.
00394     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00395         szKeyBuf,
00396         0, NULL, REG_OPTION_NON_VOLATILE,
00397         KEY_ALL_ACCESS, NULL,
00398         &hKey, NULL) ;
00399     if (lResult != ERROR_SUCCESS)
00400     {
00401         return FALSE ;
00402     }
00403
00404     // Set the Value.
00405     if (szValue != NULL)
00406     {
00407         RegSetValueEx(hKey, szName, 0, REG_SZ,
00408             (BYTE *)szValue,
00409             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00410     }
00411
00412     RegCloseKey(hKey) ;
00413     return TRUE ;
00414 }
00415
00416 BOOL setSnapInExtensionNode(const _TCHAR* szSnapID,
00417                             const _TCHAR* szNodeID,
00418                             const _TCHAR* szDescription)
00419 {
00420     HKEY hKey;
00421     _TCHAR szSnapNodeKeyBuf[1024] ;
00422     _TCHAR szMMCNodeKeyBuf[1024];
00423
00424     // Load the buffer with the Snap-In Location
00425     _tcscpy(szSnapNodeKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns\\"));
00426     // add in the clisid into buffer.
00427     _tcscat(szSnapNodeKeyBuf, szSnapID) ;
00428     _tcscat(szSnapNodeKeyBuf, _T("\\NodeTypes\\"));
00429     _tcscat(szSnapNodeKeyBuf, szNodeID) ;
00430
00431     // Load the buffer with the NodeTypes Location
00432     _tcscpy(szMMCNodeKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00433     _tcscat(szMMCNodeKeyBuf, szNodeID) ;
00434
00435     // Create and open the Snapin Key.
00436     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00437         szSnapNodeKeyBuf,
00438         0, NULL, REG_OPTION_NON_VOLATILE,
00439         KEY_ALL_ACCESS, NULL,
00440         &hKey, NULL) ;
00441     if (lResult != ERROR_SUCCESS)
00442     {
00443         return FALSE ;
00444     }
00445
00446     // Set the Value.
00447     if (szDescription != NULL)
00448     {
00449         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00450             (BYTE *)szDescription,
00451             (_tcslen(szDescription)+1)*sizeof(_TCHAR)) ;
00452     }
00453
00454     RegCloseKey(hKey) ;
00455
00456     // Create and open the NodeTypes Key.
00457     lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00458         szMMCNodeKeyBuf,
00459         0, NULL, REG_OPTION_NON_VOLATILE,
00460         KEY_ALL_ACCESS, NULL,
00461         &hKey, NULL) ;
00462     if (lResult != ERROR_SUCCESS)
00463     {
00464         return FALSE ;
00465     }
00466
00467     // Set the Value.
00468     if (szDescription != NULL)
00469     {
00470         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00471             (BYTE *)szDescription,
00472             (_tcslen(szDescription)+1)*sizeof(_TCHAR)) ;
00473     }
00474
00475     RegCloseKey(hKey) ;
00476
00477     return TRUE ;
00478 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/doc.h Source File

  • Com
  • Fundamentals
  • SimpDnd

doc.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: doc.h
00003 //
00004 //      Definition of CSimpleDoc
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _DOC_H_ )
00010 #define _DOC_H_
00011
00012 #include "idt.h"
00013 #include "ids.h"
00014 #include <stablize.h>
00015
00016 class CSimpleSite;
00017 class CSimpleApp;
00018
00019 class CSimpleDoc : public IUnknown, public CSafeRefCount
00020 {
00021 public:
00022         LPSTORAGE       m_lpStorage;        // IStorage* pointer for Doc
00023         BOOL            m_fModifiedMenu;    // is object's verb menu on menu
00024
00025         // Drag/Drop related fields
00026         BOOL            m_fRegDragDrop;     // is doc registered as drop target?
00027         BOOL            m_fLocalDrag;       // is doc source of the drag
00028         BOOL            m_fLocalDrop;       // was doc target of the drop
00029         BOOL            m_fCanDropCopy;     // is Drag/Drop copy/move possible?
00030         BOOL            m_fCanDropLink;     // is Drag/Drop link possible?
00031         BOOL            m_fDragLeave;       // has drag left
00032         BOOL            m_fPendingDrag;     // LButtonDown--possible drag pending
00033         POINT           m_ptButDown;        // LButtonDown coordinates
00034
00035         CSimpleSite FAR * m_lpSite;
00036         CSimpleApp FAR * m_lpApp;
00037
00038         HWND m_hDocWnd;
00039
00040         CDropTarget m_DropTarget;
00041         CDropSource m_DropSource;
00042
00043         static CSimpleDoc FAR* Create(CSimpleApp FAR *lpApp, LPRECT lpRect,
00044                         HWND hWnd);
00045
00046         void Close(void);
00047
00048         CSimpleDoc();
00049         CSimpleDoc(CSimpleApp FAR *lpApp, HWND hWnd);
00050         ~CSimpleDoc();
00051
00052         // IUnknown Interface
00053         STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
00054         STDMETHODIMP_(ULONG) AddRef();
00055         STDMETHODIMP_(ULONG) Release();
00056
00057         void InsertObject(void);
00058         void DisableInsertObject(void);
00059         long lResizeDoc(LPRECT lpRect);
00060         long lAddVerbs(void);
00061         void PaintDoc(HDC hDC);
00062
00063         // Drag/Drop and clipboard support methods
00064         void CopyObjectToClip(void);
00065         BOOL QueryDrag(POINT pt);
00066         DWORD DoDragDrop(void);
00067         void Scroll(DWORD dwScrollDir) { /*...scroll Doc here...*/ }
00068 };
00069
00070 #endif  // _DOC_H_
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/DataCallback.h Source File

  • Multimedia
  • wia
  • GetImage

DataCallback.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #ifndef __DATACALLBACK__
00008 #define __DATACALLBACK__
00009
00010 #include "WiaWrap.h"
00011
00012 namespace WiaWrap
00013 {
00014
00015 //////////////////////////////////////////////////////////////////////////
00016 //
00017 // CDataCallback
00018 //
00019
00020 /*++
00021
00022     CDataCallback implements a WIA data callback object that stores the
00023     transferred data in an array of stream objects.
00024
00025 Methods
00026
00027     CDataCallback
00028         Initializes the object
00029
00030     BandedDataCallback
00031         This method is called periodically during data transfers. It can be
00032         called for one of these reasons;
00033
00034         IT_MSG_DATA_HEADER: The method tries to allocate memory for the
00035         image if the size is given in the header
00036
00037         IT_MSG_DATA: The method adjusts the stream size and copies the new
00038         data to the stream.
00039
00040         case IT_MSG_STATUS: The method invoke the progress callback function.
00041
00042         IT_MSG_TERMINATION or IT_MSG_NEW_PAGE: For BMP images, calculates the
00043         image height if it is not given in the image header, fills in the
00044         BITMAPFILEHEADER and stores this stream in the successfully
00045         transferred images array
00046
00047     ReAllocBuffer
00048         Increases the size of the current stream object, or creates a
00049         new stream object if this is the first call.
00050
00051     CopyToBuffer
00052         Copies new data to the current stream.
00053
00054     StoreBuffer
00055         Stores the current stream in the array of successfully transferred
00056         images.
00057
00058 --*/
00059
00060 class CDataCallback : public IWiaDataCallback
00061 {
00062 public:
00063     CDataCallback(
00064         PFNPROGRESSCALLBACK  pfnProgressCallback,
00065         PVOID                pProgressCallbackParam,
00066         LONG                *plCount,
00067         IStream             ***pppStream
00068     );
00069
00070     // IUnknown interface
00071
00072     STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppvObj);
00073     STDMETHOD_(ULONG, AddRef)();
00074     STDMETHOD_(ULONG, Release)();
00075
00076     // IWiaDataCallback interface
00077
00078     STDMETHOD(BandedDataCallback) (
00079         LONG  lReason,
00080         LONG  lStatus,
00081         LONG  lPercentComplete,
00082         LONG  lOffset,
00083         LONG  lLength,
00084         LONG  lReserved,
00085         LONG  lResLength,
00086         PBYTE pbBuffer
00087     );
00088
00089     // CDataCallback methods
00090
00091 private:
00092     HRESULT ReAllocBuffer(ULONG nBufferSize);
00093     HRESULT CopyToBuffer(ULONG nOffset, LPCVOID pBuffer, ULONG nSize);
00094     HRESULT StoreBuffer();
00095
00096 private:
00097     LONG m_cRef;
00098
00099   BOOL              m_bBMP;
00100     LONG              m_nHeaderSize;
00101     LONG              m_nDataSize;
00102     CComPtr<IStream>  m_pStream;
00103
00104     PFNPROGRESSCALLBACK  m_pfnProgressCallback;
00105     PVOID                m_pProgressCallbackParam;
00106
00107     LONG    *m_plCount;
00108     IStream ***m_pppStream;
00109 };
00110
00111 }; // namespace WiaWrap
00112
00113 #endif //__DATACALLBACK__
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/CEnumStorageResource.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

CEnumStorageResource.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      CEnumStorageResource.h
00005 //
00006 //  Implementation Files:
00007 //      CEnumStorageResource.cpp
00008 //
00009 //  Description:
00010 //      This file contains the declaration of the CEnumStorageResource class.
00011 //
00012 //      The class CEnumStorageResource is the enumeration of cluster
00013 //      storage devices. It implements the IEnumClusCfgManagedResources
00014 //      interface.
00015 //
00016 //////////////////////////////////////////////////////////////////////////////
00017
00018 #pragma once
00019
00020
00021 //////////////////////////////////////////////////////////////////////////////
00022 // Include Files
00023 //////////////////////////////////////////////////////////////////////////////
00024
00025 #include "stdafx.h"
00026 #include "CStorageResource.h"
00027 #include "CMgdClusCfgInit.h"
00028 #include "CClusterUtils.h"
00029
00030
00031 //////////////////////////////////////////////////////////////////////////////
00032 // Constant Declarations
00033 //////////////////////////////////////////////////////////////////////////////
00034
00035 const WCHAR   g_szNameSpaceRoot[]             = { L"\\\\?\\GLOBALROOT" };
00036 const WCHAR   g_szPhysicalDriveFormat[]       = { L"\\\\.\\PHYSICALDRIVE%lu\0" };
00037
00038
00039 //////////////////////////////////////////////////////////////////////////////
00040 //++
00041 //
00042 //  class CEnumStorageResource
00043 //
00044 //  Description:
00045 //      The class CEnumStorageResource is the enumeration of the managed
00046 //      phyical disks.  This is an example of finding disks and getting
00047 //      them managed by a cluster.
00048 //
00049 //  Interfaces:
00050 //      IEnumClusCfgManagedResources
00051 //      IWMIService
00052 //      IClusCfgInitialize
00053 //
00054 //--
00055 //////////////////////////////////////////////////////////////////////////////
00056 class CEnumStorageResource
00057     : public IEnumClusCfgManagedResources
00058     , public IWMIServices
00059     , public CClusterUtils
00060     , public CMgdClusCfgInit
00061     , public CComCoClass< CEnumStorageResource, &CLSID_CEnumStorageResource >
00062 {
00063 public:
00064
00065 BEGIN_COM_MAP( CEnumStorageResource )
00066     COM_INTERFACE_ENTRY( IEnumClusCfgManagedResources )
00067     COM_INTERFACE_ENTRY( IClusCfgInitialize )
00068     COM_INTERFACE_ENTRY( IWMIServices )
00069 END_COM_MAP()
00070
00071 BEGIN_CATEGORY_MAP( CEnumStorageResource )
00072     IMPLEMENTED_CATEGORY( CATID_EnumClusCfgManagedResources )
00073 END_CATEGORY_MAP()
00074
00075 DECLARE_NOT_AGGREGATABLE( CEnumStorageResource )
00076
00077 #pragma warning( push, 3 )
00078 #pragma warning( disable : 4995 ) // warning C4995: '<x>': name was marked as #pragma deprecated
00079 DECLARE_REGISTRY_RESOURCEID( IDR_CEnumStorageResource )
00080 #pragma warning( pop )
00081
00082     //
00083     // Constructors and destructors
00084     //
00085
00086     CEnumStorageResource( void );
00087
00088     virtual ~CEnumStorageResource( void );
00089
00090 private:
00091
00092     //
00093     // Private member functions and data
00094     //
00095
00096     BOOL                m_fLoadedDevices;               // Has this enum been loaded?
00097     IWbemServices *     m_pIWbemServices;               // Pointer to the WMI services.
00098     IUnknown *          ((*m_prgDisks)[]);              // Sparse array of punk ponters to hold the disks.
00099     ULONG               m_idxNext;                      // The index of the next open punk pointer in the array.
00100     ULONG               m_idxEnumNext;                  // Then index of the COM enumeration.
00101     BSTR                m_bstrBootDevice;               // Name of the boot device.
00102     BSTR                m_bstrSystemDevice;             // Name of the system device.
00103     BSTR                m_bstrBootLogicalDisk;          // Logical disk ID of the boot device.
00104     BSTR                m_bstrSystemLogicalDisk;        // Logical disk ID of the system device.
00105     BSTR                m_bstrSystemWMIDeviceID;        // Name that of the system device in WMI.
00106     BSTR                m_bstrCrashDumpLogicalDisk;     // Name of the logical disk that has the crash dumps on it.
00107     DWORD               m_cDiskCount;                   // Number of devices (disks) in this enumerator.
00108
00109     //
00110     // Private copy constructor to prevent copying of this COM object.
00111     //
00112
00113     CEnumStorageResource( const CEnumStorageResource & nodeSrc );
00114
00115     //
00116     // Private assignment operator to prevent copying of this COM object.
00117     //
00118
00119     const CEnumStorageResource & operator = ( const CEnumStorageResource & nodeSrc );
00120
00121     //
00122     // All of these private methods are simply to demonstrate finding and
00123     // dealing with physical disks.
00124     //
00125
00126     HRESULT HrGetDisks( void );
00127     HRESULT HrProcessWMIDiskObject( IWbemClassObject * pDiskIn );
00128     HRESULT HrAddObjectToArray( IUnknown * punkIn );
00129     HRESULT HrPruneSystemDisks( void );
00130     HRESULT IsDiskSCSI( IWbemClassObject * pDiskIn );
00131     HRESULT HrFixupDisks( void );
00132     HRESULT HrGetClusterDiskInfo( HRESOURCE hResourceIn, CLUS_SCSI_ADDRESS * pcsaOut, DWORD * pdwSignatureOut );
00133     HRESULT HrSetThisDiskToBeManaged( ULONG ulSCSITidIn, ULONG ulSCSILunIn, BOOL fIsQuorumIn, BSTR bstrResourceNameIn, DWORD dwSignatureIn );
00134     HRESULT HrFindDiskWithLogicalDisk( WCHAR cLogicalDiskIn, ULONG * pidxDiskOut );
00135     HRESULT HrGetSCSIInfo( ULONG idxDiskIn, ULONG * pulSCSIBusOut, ULONG * pulSCSIPortOut );
00136     HRESULT HrPruneDisks( ULONG ulSCSIBusIn, ULONG ulSCSIPortIn, const GUID * pcguidMajorIdIn, int nMsgIdIn, int nRefIdIn, ULONG * pulRemovedOut );
00137     void    LogPrunedDisk( IUnknown * punkIn, ULONG ulSCSIBusIn, ULONG ulSCSIPortIn );
00138     HRESULT HrIsLogicalDiskNTFS( BSTR bstrLogicalDiskIn );
00139     HRESULT HrLogDiskInfo( IWbemClassObject * pDiskIn );
00140     HRESULT HrFindDiskWithWMIDeviceID( BSTR bstrWMIDeviceIDIn, ULONG * pidxDiskOut );
00141     HRESULT HrIsSystemBusManaged( void );
00142     HRESULT HrGetClusterProperties( HRESOURCE hResourceIn, BSTR * pbstrResourceNameOut );
00143     void    RemoveDiskFromArray( ULONG idxDiskIn );
00144     HRESULT HrLoadEnum( void );
00145     HRESULT HrSortDisksByIndex( void );
00146     HRESULT HrPrunePageFileDiskBuses( BOOL fPruneBusIn, ULONG * pcPrunedInout );
00147     HRESULT HrPruneCrashDumpBus( BOOL fPruneBusIn, ULONG * pcPrunedInout );
00148     HRESULT HrPruneDynamicDisks( ULONG * pcPrunedInout );
00149     HRESULT HrPruneGPTDisks( ULONG * pcPrunedInout );
00150     HRESULT HrConvertDeviceVolumeToLogicalDisk( BSTR bstrDeviceVolumeIn, BSTR * pbstrLogicalDiskOut );
00151     HRESULT HrConvertDeviceVolumeToWMIDeviceID( BSTR bstrDeviceVolumeIn, BSTR * pbstrWMIDeviceIDOut );
00152     HRESULT HrGetPageFileLogicalDisks( IClusCfgCallback * picccIn, WCHAR szLogicalDisksOut[ 26 ], int * pcLogicalDisksOut );
00153     HRESULT HrGetSystemDevice( BSTR * pbstrSystemDeviceOut );
00154     HRESULT HrGetBootLogicalDisk( BSTR * pbstrBootDeviceOut );
00155     HRESULT HrGetCrashDumpLogicalDisk( BSTR * pbstrCrashDumpLogicalDiskOut );
00156
00157 public:
00158
00159     //
00160     // CClusterUtils
00161     //
00162
00163     HRESULT HrNodeResourceCallback( HRESOURCE hResourceIn );
00164
00165     //
00166     // IWMIServices Interfaces
00167     //
00168
00169     STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
00170
00171     //
00172     // IClusCfgInitialize is an optional interface.  By not implementing it
00173     // your component will not be able to send status reports to the UIO and
00174     // log files, and it won't know the users locale.
00175     //
00176
00177     //
00178     // IClusCfgInitialize interface (overridden from CMgdClusCfgInit)
00179     //
00180
00181     STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
00182
00183     //
00184     // The following interfaces and methods must be implemented by any
00185     // component that is a ClusCfg plug in component.
00186
00187     //
00188     // IEnumClusCfgManagedResources Interfaces
00189     //
00190
00191     STDMETHOD( Next )( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut );
00192     STDMETHOD( Skip )( ULONG cNumberToSkipIn );
00193     STDMETHOD( Reset )( void );
00194     STDMETHOD( Clone )( IEnumClusCfgManagedResources ** ppEnumClusCfgStorageDevicesOut );
00195     STDMETHOD( Count )( DWORD * pnCountOut );
00196
00197 }; //*** class CEnumStorageResource
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/compdata.h Source File

  • SysMgmt
  • MMC
  • Menubtn

compdata.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024 #include "StatNode.h"
00025 #include "Comp.h"
00026
00027 class CComponentData : public IComponentData,
00028 ISnapinHelp
00029 {
00030     friend class CComponent;
00031
00032 private:
00033     ULONG                               m_cref;
00034     LPCONSOLE                   m_ipConsole;
00035     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00036
00037     CStaticNode     *m_pStaticNode;
00038
00039     WCHAR            m_HelpFile[MAX_PATH];
00040
00041 public:
00042     CComponentData();
00043     ~CComponentData();
00044
00045     ///////////////////////////////
00046     // Interface IUnknown
00047     ///////////////////////////////
00048     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00049     STDMETHODIMP_(ULONG) AddRef();
00050     STDMETHODIMP_(ULONG) Release();
00051
00052     ///////////////////////////////
00053     // Interface IComponentData
00054     ///////////////////////////////
00055     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00056         /* [in] */ LPUNKNOWN pUnknown);
00057
00058         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00059         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00060
00061         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00062         /* [in] */ LPDATAOBJECT lpDataObject,
00063         /* [in] */ MMC_NOTIFY_TYPE event,
00064         /* [in] */ LPARAM arg,
00065         /* [in] */ LPARAM param);
00066
00067         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00068
00069     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00070         /* [in] */ MMC_COOKIE cookie,
00071         /* [in] */ DATA_OBJECT_TYPES type,
00072         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00073
00074         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00075         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00076
00077         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00078         /* [in] */ LPDATAOBJECT lpDataObjectA,
00079         /* [in] */ LPDATAOBJECT lpDataObjectB);
00080
00081         ///////////////////////////////
00082         // Interface ISnapinHelp
00083         ///////////////////////////////
00084         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetHelpTopic(
00085         /* [out] */ LPOLESTR __RPC_FAR *lpCompiledHelpFile);
00086 };
00087
00088 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/DsBrowse/bitmaps/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • DsBrowse
  • bitmaps

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Visual C++ generated include file.
00003 // Used by vbvw.rc
00004 //
00005 #define Computer                        101
00006 #define User                            102
00007 #define Domain                          103
00008 #define Syntax                          104
00009 #define Service                         105
00010 #define Group                           106
00011 #define PrintQueue                      107
00012 #define Ndsou                           108
00013 #define FileShare                       109
00014 #define Organization                    110
00015 #define Country                         111
00016 #define Top                             112
00017 #define Namespace                       113
00018 #define Dummy                           114
00019 #define Namespaces                      115
00020 #define ICON                            116
00021 #define IDI_ICON1                       117
00022
00023 // Next default values for new objects
00024 //
00025 #ifdef APSTUDIO_INVOKED
00026 #ifndef APSTUDIO_READONLY_SYMBOLS
00027 #define _APS_NEXT_RESOURCE_VALUE        118
00028 #define _APS_NEXT_COMMAND_VALUE         40001
00029 #define _APS_NEXT_CONTROL_VALUE         1000
00030 #define _APS_NEXT_SYMED_VALUE           101
00031 #endif
00032 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/addvfiledlg.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

addvfiledlg.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  AddVFileDlg.h:   Header for the CAddVFileDlg class.  This is a
00014 //                   modeless dialog class used to add Virtual Files.
00015 //
00016
00017
00018 #ifndef _CLASS_ADDVFILEDLG_
00019 #define _CLASS_ADDVFILEDLG_
00020
00021
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025
00026
00027 #include "BaseDialog.h"
00028
00029
00030 //---------------------------------------------------------------------------
00031 class CAddVFileDlg : public CBaseDialog
00032 {
00033   public:
00034     CAddVFileDlg( ULONG nTemplate, HWND hParentWnd );
00035     ~CAddVFileDlg();
00036
00037
00038   public:
00039     BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
00040
00041
00042   // Messages we will be handling
00043   private:
00044     LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00045     LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00046
00047   private:
00048     HWND    m_hParentWnd;
00049
00050
00051 };
00052
00053 #endif //_CLASS_ADDVFILEDLG_
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Render.h Source File

  • WinUI
  • Shell
  • DragImg

Render.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Render.h
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 #ifndef RENDERDATA_H
00019 #define RENDERDATA_H
00020
00021 /**************************************************************************
00022    function prototypes
00023 **************************************************************************/
00024
00025 HGLOBAL CreateFileGroupDescriptor(LPCTSTR);
00026 HGLOBAL CreateFileContents(LPCTSTR, int);
00027
00028 #endif   //RENDERDATA_H
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmMonitor/StdAfx.Cpp Source File

  • Com
  • Services
  • Crm
  • CrmMonitor

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

StdAfx.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       StdAfx.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // stdafx.h : include file for standard system include files,
00012 //      or project specific include files that are used frequently,
00013 //      but are changed infrequently
00014
00015 #if !defined(AFX_STDAFX_H__2448D9F3_1829_11D2_97B7_00A0C9A06D2D__INCLUDED_)
00016 #define AFX_STDAFX_H__2448D9F3_1829_11D2_97B7_00A0C9A06D2D__INCLUDED_
00017
00018
00019
00020 #if _MSC_VER >= 1000
00021 #pragma once
00022 #endif // _MSC_VER >= 1000
00023
00024 #define STRICT
00025
00026 #include <afxwin.h>
00027 #include <afxdisp.h>
00028 #include "afxdlgs.h"
00029
00030
00031
00032 #define _ATL_APARTMENT_THREADED
00033
00034 #include <xstring>
00035 #include <vector>
00036 #include <list>
00037
00038 using namespace std;
00039
00040
00041 #include <activeds.h>
00042 #include <dsadmin.h>
00043
00044 #include <atlbase.h>
00045
00046 #if ( _ATL_VER >= 0x0300 )
00047 #define _ATL_NO_UUIDOF
00048 #endif
00049
00050
00051
00052 using namespace ATL;
00053
00054 class CSCPContextMenuModule : public CComModule
00055 {
00056 public:
00057   HRESULT WINAPI UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister);
00058 };
00059
00060 #define DECLARE_REGISTRY_CLSID() \
00061 static HRESULT WINAPI UpdateRegistry(BOOL bRegister) \
00062 { \
00063     return _Module.UpdateRegistryCLSID(GetObjectCLSID(), bRegister); \
00064 }
00065
00066 extern CSCPContextMenuModule _Module;
00067
00068 #include <atlcom.h>
00069
00070 #include <shellapi.h>
00071 #include <dlgs.h>
00072
00073 #if ( _ATL_VER >= 0x0300 )
00074   #include <atlwin.h>
00075 #else
00076   #include <atlwin21.h>
00077   #include <atldlgs.h>
00078 #endif
00079
00080
00081 //{{AFX_INSERT_LOCATION}}
00082 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00083
00084 #endif // !defined(AFX_STDAFX_H__2448D9F3_1829_11D2_97B7_00A0C9A06D2D__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMSOmniProvRowset Member List

This is the complete list of members for CMSOmniProvRowset, including all inherited members.
_OmniProvBaseClass typedef | CMSOmniProvRowset |
AllocateProxyBuffers() | CMSOmniProvRowset |
CheckTable(TCHAR *szTblName) | CMSOmniProvRowset |
CMSOmniProvRowset() | CMSOmniProvRowset | [inline]
CreateColInfo() | CMSOmniProvRowset |
CreateHRow(LONG lRowsOffset, HROW *phRow) | IRowsetChangeImpl< CMSOmniProvRowset, dummyStore > | [inline]
CreateRecord(ULONG &cRowsObtained, HROW *phRow) | IRowsetChangeImpl< CMSOmniProvRowset, dummyStore > | [inline]
DeleteRows(HCHAPTER hReserved, ULONG cRows, const HROW __RPC_FAR rghRows[], DBROWSTATUS __RPC_FAR rgRowStatus[]) | IRowsetChangeImpl< CMSOmniProvRowset, dummyStore > | [inline]
Execute(DBPARAMS *pParams, LONG *pcRowsAffected) | CMSOmniProvRowset |
Fire_OnFieldChange(IRowset *pRowset, HROW hRow, ULONG cColumns, ULONG *rgColumns, ULONG eReason, ULONG ePhase, LONG fCantDeny) | CProxyIRowsetNotify< CMSOmniProvRowset > | [inline]
Fire_OnRowChange(IRowset *pRowset, ULONG cRows, const HROW *rghRows, ULONG eReason, ULONG ePhase, LONG fCantDeny) | CProxyIRowsetNotify< CMSOmniProvRowset > | [inline]
Fire_OnRowsetChange(IRowset *pRowset, ULONG eReason, ULONG ePhase, LONG fCantDeny) | CProxyIRowsetNotify< CMSOmniProvRowset > | [inline]
Fire_RemoteOnFieldChange(IRowset *pRowset, HROW hRow, ULONG cColumns, ULONG *rgColumns, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo **ppErrorInfoRem) | CProxyIRowsetNotify< CMSOmniProvRowset > | [inline]
Fire_RemoteOnRowChange(IRowset *pRowset, ULONG cRows, const HROW *rghRows, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo **ppErrorInfoRem) | CProxyIRowsetNotify< CMSOmniProvRowset > | [inline]
Fire_RemoteOnRowsetChange(IRowset *pRowset, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo **ppErrorInfoRem) | CProxyIRowsetNotify< CMSOmniProvRowset > | [inline]
GetColumnInfo(CMSOmniProvRowset *pv, ULONG *pNumCols) | CMSOmniProvRowset | [static]
GetData(HROW hRow, HACCESSOR hAccessor, void *pDstData) | CMSOmniProvRowset | [inline]
GetDataSource(_bstr_t &m_bstrLoc) | CMSOmniProvRowset |
GetNextRows(HCHAPTER, LONG lRowsOffset, LONG cRows, ULONG *pcRowsObtained, HROW **prghRows) | CMSOmniProvRowset | [inline]
GetSchemaInfo(ULONG *pNumCols) | CMSOmniProvRowset |
InsertRow(HCHAPTER hReserved, HACCESSOR hAccessor, void __RPC_FAR *pData, HROW __RPC_FAR *phRow) | IRowsetChangeImpl< CMSOmniProvRowset, dummyStore > | [inline]
m_cCols | CMSOmniProvRowset |
m_DBFile | CMSOmniProvRowset |
m_prgColInfo | CMSOmniProvRowset |
ReleaseRows(ULONG cRows, const HROW rghRows[], DBROWOPTIONS rgRowOptions[], ULONG rgRefCounts[], DBROWSTATUS rgRowStatus[]) | CMSOmniProvRowset | [inline]
SetData(HROW hRow, HACCESSOR hAccessor, void __RPC_FAR *pData) | IRowsetChangeImpl< CMSOmniProvRowset, dummyStore > | [inline]
SetSchemaInfo(ATLCOLUMNINFO *prgColInfo, int cCols) | CMSOmniProvRowset | [inline]
~CMSOmniProvRowset() | CMSOmniProvRowset | [inline]
Generated on Wed Nov 13 2024 16:56:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/basesnap.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {CONTEXTEXTENSION = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyEvictListener/dll.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyEvictListener

dll.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      Dll.cpp
00005 //
00006 //  Description:
00007 //      Implementation of DLL Exports.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 #include "stdafx.h"
00012 #include "resource.h"
00013 #include <initguid.h>
00014
00015 #include "MyEvictListener.h"
00016
00017 CComModule _Module;
00018
00019 BEGIN_OBJECT_MAP( ObjectMap )
00020 OBJECT_ENTRY( CLSID_MyEvictListener, CMyEvictListener )
00021 END_OBJECT_MAP()
00022
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //++
00026 //
00027 // DllMain
00028 //
00029 // Description:
00030 //      DLL entry point.
00031 //
00032 //--
00033 /////////////////////////////////////////////////////////////////////////////
00034 extern "C"
00035 BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/ )
00036 {
00037     if ( dwReason == DLL_PROCESS_ATTACH )
00038     {
00039         _Module.Init( ObjectMap, hInstance ); // no typelib
00040         DisableThreadLibraryCalls( hInstance );
00041     }
00042     else if ( dwReason == DLL_PROCESS_DETACH )
00043     {
00044         _Module.Term();
00045     }
00046     return TRUE;    // ok
00047
00048 } //*** DllMain
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 //++
00052 //
00053 // DllCanUnloadNow
00054 //
00055 // Description:
00056 //      Used to determine whether the DLL can be unloaded by OLE.
00057 //
00058 //--
00059 /////////////////////////////////////////////////////////////////////////////
00060 STDAPI DllCanUnloadNow( void )
00061 {
00062     return ( _Module.GetLockCount()==0 ) ? S_OK : S_FALSE;
00063
00064 } //*** DllCanUnloadNow
00065
00066 /////////////////////////////////////////////////////////////////////////////
00067 //++
00068 //
00069 // DllGetClassObject
00070 //
00071 // Description:
00072 //      Returns a class factory to create an object of the requested type.
00073 //
00074 //--
00075 /////////////////////////////////////////////////////////////////////////////
00076 STDAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID * ppv )
00077 {
00078     return _Module.GetClassObject( rclsid, riid, ppv );
00079
00080 } //*** DllGetClassObject
00081
00082 /////////////////////////////////////////////////////////////////////////////
00083 //++
00084 //
00085 // DllRegisterServer
00086 //
00087 // Description:
00088 //      Adds entries to the system registry.
00089 //
00090 //--
00091 /////////////////////////////////////////////////////////////////////////////
00092 STDAPI DllRegisterServer( void )
00093 {
00094     // registers object; FALSE => no typelib
00095     return _Module.RegisterServer( FALSE );
00096
00097 } //*** DllRegisterServer
00098
00099 /////////////////////////////////////////////////////////////////////////////
00100 //++
00101 //
00102 // DllUnregisterServer
00103 //
00104 // Description:
00105 //      Removes entries from the system registry.
00106 //
00107 //--
00108 /////////////////////////////////////////////////////////////////////////////
00109 STDAPI DllUnregisterServer( void )
00110 {
00111     return _Module.UnregisterServer( FALSE ); // FALSE => no typelib
00112
00113 } //*** DllUnregisterServer
00114
00115
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/DRAWSINK.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

DRAWSINK.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DRAWSINK.CPP
00003
00004   Summary:   Implementation file for the CODrawPageSink COM Object Class.
00005              Connectable object notifications for drawing-related
00006              events are handled by CODrawPageSink.
00007
00008              CODrawPageSink offers a main IUnknown standard interface and
00009              the IDrawPageSink custom interface (with the DrawPage related
00010              event features). This multiple interface COM Object Class is
00011              achieved via the technique of nested classes.  The
00012              implementation of the various interfaces are nested
00013              inside the CODrawPageSink Class.
00014
00015              For a comprehensive tutorial code tour of this module's
00016              contents and offerings see the tutorial PERCLIEN.HTM
00017              file. For more specific technical details on the internal
00018              workings see the comments dispersed throughout the module's
00019              source code.
00020
00021   Classes:   CODrawPageSink.
00022
00023   Functions: none.
00024
00025   Origin:    5-24-97: atrent - Editor-inheritance from TEXTSINK.CPP in
00026              the PERCLIEN Tutorial Code Sample.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043
00044 /*---------------------------------------------------------------------------
00045   We include WINDOWS.H for all Win32 applications.
00046   We include OLE2.H because we will be calling the COM/OLE Libraries.
00047   We include OLECTL.H because it has definitions for connectable objects.
00048   We include APPUTIL.H because we will be building this application using
00049     the convenient Virtual Window and Dialog classes and other
00050     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00051   We include IPAGES.H and PAGEGUID.H for the common Page-related
00052     Interface class, GUID, and CLSID specifications.
00053   We include GUIDRAW.H because it declares the class for the main C++
00054     object that can service the Sink events.
00055   We include DRAWSINK.H because it has the class CODrawPageSink
00056     declarations.
00057 ---------------------------------------------------------------------------*/
00058 #include <windows.h>
00059 #include <ole2.h>
00060 #include <olectl.h>
00061 #include <apputil.h>
00062 #include <ipages.h>
00063 #include <pageguid.h>
00064 #include "guidraw.h"
00065 #include "drawsink.h"
00066
00067
00068 /*---------------------------------------------------------------------------
00069   CODrawPageSink's implementation of its main COM object class including
00070   Constructor, Destructor, QueryInterface, AddRef, and Release.
00071 ---------------------------------------------------------------------------*/
00072
00073 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00074   Method:   CODrawPageSink::CODrawPageSink
00075
00076   Summary:  CODrawPageSink Constructor. Note the member initializer:
00077             "m_ImpIDrawPageSink(this, pUnkOuter)" which is used to pass
00078             the 'this' and pUnkOuter pointers of this constructor function
00079             to the constructor in the instantiation of the implementation
00080             of the CImpIDrawPageSink interface (which is nested inside
00081             this present CODrawPageSink Object Class).
00082
00083   Args:     IUnknown* pUnkOuter,
00084               Pointer to the the outer Unknown.  NULL means this COM Object
00085               is not being Aggregated.  Non NULL means it is being created
00086               on behalf of an outside COM object that is reusing it via
00087               aggregation.
00088             CGuiDraw* pGuiDraw)
00089               Pointer to the main C++ object that can service the
00090               DrawPageSink events.
00091
00092   Modifies: m_cRefs, m_pUnkOuter, m_pGuiList.
00093
00094   Returns:  void
00095 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00096 CODrawPageSink::CODrawPageSink(
00097   IUnknown* pUnkOuter,
00098   CGuiDraw* pGuiDraw) :
00099   m_ImpIDrawPageSink(this, pUnkOuter)
00100 {
00101   // Zero the COM object's reference count.
00102   m_cRefs = 0;
00103
00104   // No AddRef necessary if non-NULL, as we're nested.
00105   m_pUnkOuter = pUnkOuter;
00106
00107   // Assign the pointer to the Sink service C++ object.
00108   m_pGuiDraw = pGuiDraw;
00109
00110   return;
00111 }
00112
00113
00114 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00115   Method:   CODrawPageSink::~CODrawPageSink
00116
00117   Summary:  CODrawPageSink Destructor.
00118
00119   Args:     void
00120
00121   Returns:  void
00122 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00123 CODrawPageSink::~CODrawPageSink(void)
00124 {
00125   return;
00126 }
00127
00128
00129 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00130   Method:   CODrawPageSink::QueryInterface
00131
00132   Summary:  QueryInterface of the CODrawPageSink non-delegating
00133             IUnknown implementation.
00134
00135   Args:     REFIID riid,
00136               [in] GUID of the Interface being requested.
00137             PPVOID ppv)
00138               [out] Address of the caller's pointer variable that will
00139               receive the requested interface pointer.
00140
00141   Returns:  HRESULT
00142 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00143 STDMETHODIMP CODrawPageSink::QueryInterface(
00144                REFIID riid,
00145                PPVOID ppv)
00146 {
00147   HRESULT hr = E_NOINTERFACE;
00148
00149   *ppv = NULL;
00150
00151   if (IID_IUnknown == riid)
00152     *ppv = this;
00153   else if (IID_IDrawPageSink == riid)
00154     *ppv = &m_ImpIDrawPageSink;
00155
00156   if (NULL != *ppv)
00157   {
00158     // We've handed out a pointer to the interface so obey the COM rules
00159     // and AddRef the reference count.
00160     ((LPUNKNOWN)*ppv)->AddRef();
00161     hr = NOERROR;
00162   }
00163
00164
00165   return (hr);
00166 }
00167
00168
00169 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00170   Method:   CODrawPageSink::AddRef
00171
00172   Summary:  AddRef of the CODrawPageSink non-delegating IUnknown
00173             implementation.
00174
00175   Args:     void
00176
00177   Modifies: m_cRefs.
00178
00179   Returns:  ULONG
00180               New value of m_cRefs (COM object's reference count).
00181 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00182 STDMETHODIMP_(ULONG) CODrawPageSink::AddRef(void)
00183 {
00184   ULONG cRefs;
00185
00186   cRefs = ++m_cRefs;
00187
00188   return cRefs;
00189 }
00190
00191
00192 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00193   Method:   CODrawPageSink::Release
00194
00195   Summary:  Release of the CODrawPageSink non-delegating IUnknown
00196             implementation.
00197
00198   Args:     void
00199
00200   Modifies: m_cRefs.
00201
00202   Returns:  ULONG
00203               New value of m_cRefs (COM object's reference count).
00204 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00205 STDMETHODIMP_(ULONG) CODrawPageSink::Release(void)
00206 {
00207   ULONG cRefs;
00208
00209   cRefs = --m_cRefs;
00210
00211   if (0 == cRefs)
00212   {
00213     // We artificially bump the main ref count to prevent reentrancy
00214     // via the main object destructor.  Not really needed in this
00215     // CODrawPageSink but a good practice because we are aggregatable and
00216     // may at some point in the future add something entertaining like
00217     // some Releases to the CODrawPageSink destructor.
00218     m_cRefs++;
00219     delete this;
00220   }
00221
00222   return cRefs;
00223 }
00224
00225
00226 /*---------------------------------------------------------------------------
00227   CODrawPageSink's nested implementation of the IDrawPageSink interface
00228   including Constructor, Destructor, QueryInterface, AddRef, Release,
00229   Loaded, Saved, Cleared, Resized, InkStart, InkDraw, and InkStop. Methods
00230   in this interface are called by COM objects on the server side to send
00231   notifications to the client.
00232 ---------------------------------------------------------------------------*/
00233
00234 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00235   Method:   CODrawPageSink::CImpIDrawPageSink::CImpIDrawPageSink
00236
00237   Summary:  Constructor for the CImpIDrawPageSink interface instantiation.
00238
00239   Args:     CODrawPageSink* pCO,
00240               Back pointer to the parent outer object.
00241             IUnknown* pUnkOuter
00242               Pointer to the outer Unknown.  For delegation.
00243
00244   Modifies: m_pCO, m_pUnkOuter.
00245
00246   Returns:  void
00247 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00248 CODrawPageSink::CImpIDrawPageSink::CImpIDrawPageSink(
00249   CODrawPageSink* pCO,
00250   IUnknown* pUnkOuter)
00251 {
00252   // Init the main object Pointer to point to the parent object.
00253   m_pCO = pCO;
00254
00255   // Init the CImpIDrawPageSink interface's delegating Unknown pointer. We
00256   // use the main object pointer for IUnknown delegation here if we are
00257   // not being aggregated.  If we are being aggregated we use the supplied
00258   // pUnkOuter for IUnknown delegation.  In either case the pointer
00259   // assignment requires no AddRef because the CImpIDrawPageSink lifetime
00260   // is quaranteed by the lifetime of the parent object in which
00261   // CImpIDrawPageSink is nested.
00262   if (NULL == pUnkOuter)
00263     m_pUnkOuter = pCO;
00264   else
00265     m_pUnkOuter = pUnkOuter;
00266
00267   return;
00268 }
00269
00270
00271 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00272   Method:   CODrawPageSink::CImpIDrawPageSink::~CImpIDrawPageSink
00273
00274   Summary:  Destructor for the CImpIDrawPageSink interface instantiation.
00275
00276   Args:     void
00277
00278   Returns:  void
00279 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00280 CODrawPageSink::CImpIDrawPageSink::~CImpIDrawPageSink(void)
00281 {
00282   return;
00283 }
00284
00285
00286 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00287   Method:   CODrawPageSink::CImpIDrawPageSink::QueryInterface
00288
00289   Summary:  The QueryInterface IUnknown member of this IDrawPageSink
00290             interface implementation that delegates to m_pUnkOuter,
00291             whatever it is.
00292
00293   Args:     REFIID riid,
00294               [in] GUID of the Interface being requested.
00295             PPVOID ppv)
00296               [out] Address of the caller's pointer variable that will
00297               receive the requested interface pointer.
00298
00299   Returns:  HRESULT
00300               Returned by the delegated outer QueryInterface call.
00301 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00302 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::QueryInterface(
00303                REFIID riid,
00304                PPVOID ppv)
00305 {
00306   // Delegate this call to the outer object's QueryInterface.
00307   return m_pUnkOuter->QueryInterface(riid, ppv);
00308 }
00309
00310
00311 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00312   Method:   CODrawPageSink::CImpIDrawPageSink::AddRef
00313
00314   Summary:  The AddRef IUnknown member of this IDrawPageSink interface
00315             implementation that delegates to m_pUnkOuter, whatever it is.
00316
00317   Args:     void
00318
00319   Returns:  ULONG
00320               Returned by the delegated outer AddRef call.
00321 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00322 STDMETHODIMP_(ULONG) CODrawPageSink::CImpIDrawPageSink::AddRef(void)
00323 {
00324   // Delegate this call to the outer object's AddRef.
00325   return m_pUnkOuter->AddRef();
00326 }
00327
00328
00329 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00330   Method:   CODrawPageSink::CImpIDrawPageSink::Release
00331
00332   Summary:  The Release IUnknown member of this IDrawPageSink interface
00333             implementation that delegates to m_pUnkOuter, whatever it is.
00334
00335   Args:     void
00336
00337   Returns:  ULONG
00338               Returned by the delegated outer Release call.
00339 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00340 STDMETHODIMP_(ULONG) CODrawPageSink::CImpIDrawPageSink::Release(void)
00341 {
00342   // Delegate this call to the outer object's Release.
00343   return m_pUnkOuter->Release();
00344 }
00345
00346
00347 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00348   Method:   CODrawPageSink::CImpIDrawPageSink::Loaded
00349
00350   Summary:  The CODrawPage object's ink drawing data was loaded from
00351             its storage.
00352
00353   Args:     void
00354
00355   Returns:  HRESULT
00356               Standard result code. NOERROR for success.
00357 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00358 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::Loaded(
00359                void)
00360 {
00361   HRESULT hr;
00362
00363   // We have been notified that a load was done. Thus, a whole new array
00364   // of ink data must be displayed in a cleared window of this client.
00365   m_pCO->m_pGuiDraw->ClearWin();
00366   hr = m_pCO->m_pGuiDraw->PaintWin();
00367
00368   return hr;
00369 }
00370
00371
00372 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00373   Method:   CODrawPageSink::CImpIDrawPageSink::Saved
00374
00375   Summary:  The CODrawPage object's drawing DrawPage data was saved to
00376             its persistent storage.
00377
00378   Args:     void
00379
00380   Returns:  HRESULT
00381               Standard result code. NOERROR for success.
00382 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00383 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::Saved(
00384                void)
00385 {
00386   HRESULT hr = E_NOTIMPL;
00387
00388   // For future evolution.
00389
00390   return hr;
00391 }
00392
00393
00394 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00395   Method:   CODrawPageSink::CImpIDrawPageSink::Cleared
00396
00397   Summary:  The CODrawPage was cleared of all content.
00398
00399   Args:     void
00400
00401   Returns:  HRESULT
00402               Standard result code. NOERROR for success.
00403 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00404 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::Cleared(
00405                void)
00406 {
00407   HRESULT hr = E_NOTIMPL;
00408
00409   // For future evolution.
00410
00411   return hr;
00412 }
00413
00414
00415 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00416   Method:   CODrawPageSink::CImpIDrawPageSink::Resized
00417
00418   Summary:  CODrawPage's drawing rectangle was resized by a client.
00419
00420   Args:     void
00421
00422   Returns:  HRESULT
00423               Standard result code. NOERROR for success.
00424 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00425 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::Resized(
00426                SHORT nWidth,
00427                SHORT nHeight)
00428 {
00429   HRESULT hr = E_NOTIMPL;
00430
00431   // For future evolution.
00432
00433   return hr;
00434 }
00435
00436
00437 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00438   Method:   CODrawPageSink::CImpIDrawPageSink::InkStart
00439
00440   Summary:  Client is being told to start a display ink drawing sequence.
00441
00442   Args:     SHORT nX,
00443               X coordinate of the start point.
00444             SHORT nY,
00445               Y coordinate of the start point.
00446             SHORT nWidth,
00447               Ink Width in pixels.
00448             COLORREF crInkColor)
00449               RGB Ink color to be used in the subsequent inking sequence.
00450
00451   Returns:  HRESULT
00452               Standard result code. NOERROR for success.
00453 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00454 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::InkStart(
00455                SHORT nX,
00456                SHORT nY,
00457                SHORT nWidth,
00458                COLORREF crInkColor)
00459 {
00460   // Turn off ink saving to the CODrawPage object.
00461   m_pCO->m_pGuiDraw->InkSaving(FALSE);
00462
00463   // Play the data back to the CGuiDraw for display only.
00464   m_pCO->m_pGuiDraw->InkWidth(nWidth);
00465   m_pCO->m_pGuiDraw->InkColor(crInkColor);
00466   m_pCO->m_pGuiDraw->InkStart(nX, nY);
00467
00468   return NOERROR;
00469 }
00470
00471
00472 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00473   Method:   CODrawPageSink::CImpIDrawPageSink::InkDraw
00474
00475   Summary:  Client is being told to draw/display ink drawing sequence data.
00476
00477   Args:     SHORT nX,
00478               X coordinate of the start point.
00479             SHORT nY,
00480               Y coordinate of the start point.
00481
00482   Returns:  HRESULT
00483               Standard result code. NOERROR for success.
00484 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00485 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::InkDraw(
00486                SHORT nX,
00487                SHORT nY)
00488 {
00489   // Play the data back to the CGuiDraw for display only.
00490   m_pCO->m_pGuiDraw->InkDraw(nX, nY);
00491
00492   return NOERROR;
00493 }
00494
00495
00496 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00497   Method:   CODrawPageSink::CImpIDrawPageSink::InkStop
00498
00499   Summary:  Client is being told to stop an ink drawing sequence.
00500
00501   Args:     SHORT nX,
00502               X coordinate of the start point.
00503             SHORT nY,
00504               Y coordinate of the start point.
00505
00506   Returns:  HRESULT
00507               Standard result code. NOERROR for success.
00508 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00509 STDMETHODIMP CODrawPageSink::CImpIDrawPageSink::InkStop(
00510                SHORT nX,
00511                SHORT nY)
00512 {
00513   // Stop the display play back of the data to the CGuiDraw.
00514   m_pCO->m_pGuiDraw->InkStop(nX, nY);
00515
00516   // Turn Ink Data saving back on.
00517   m_pCO->m_pGuiDraw->InkSaving(TRUE);
00518
00519   return NOERROR;
00520 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/profile.cpp Source File

  • Begin
  • sdkdiff

profile.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * profile.cpp
00013  *
00014  * win32/win16 utility functions to read and write profile items
00015  * for VFW
00016  *
00017  * When a profile call
00018  * is made the code looks for an atom to correspond to the appname supplied.
00019  * If an atom is found, then the table of cached registry keys is searched
00020  * for the matching registry handle.  If the handle exists, it is used.
00021  * No handle would mean that someone else registered an atom using this
00022  * name, so we proceed to the next step.
00023  *
00024  * No atom found, or no matching registry handle, means that we have to
00025  * open a registry key.  If successful, and there is space in the cache,
00026  * we AddAtom the appname, and cache the registry key before returning to
00027  * the caller.
00028  */
00029
00030 #include "precomp.h"
00031
00032 #ifdef _WIN32
00033 #include "profile.key"
00034
00035 #include "mmsystem.h"
00036
00037 #include "profile.h"
00038
00039 #ifdef USESTRINGSALSO
00040 #include <stdlib.h>/* for atoi */
00041 #endif
00042
00043 #if MMPROFILECACHE
00044
00045 #ifdef DEBUG
00046 #define KEYSCACHED 3
00047 #else
00048 #define KEYSCACHED 2
00049 #endif
00050
00051 HKEY   ahkey[KEYSCACHED];
00052 ATOM   akeyatoms[KEYSCACHED];
00053 UINT   keyscached = 0;
00054
00055 #else
00056 #define KEYSCACHED 0
00057 #endif
00058
00059
00060 static HKEY GetKeyA(LPCSTR appname, BOOL * closekey, BOOL fCreate)
00061 {
00062     HKEY key = 0;
00063     char achName[MAX_PATH];
00064   HRESULT hr;
00065 #if !MMPROFILECACHE
00066     *closekey = TRUE;
00067 #else
00068     UINT n;
00069     ATOM atm;
00070
00071     *closekey = FALSE;
00072     //
00073     // See if we have already used this key
00074     //
00075     atm = FindAtomA(appname);
00076
00077     if (atm != 0) {
00078   // Atom exists... search the table for it.
00079         for (n=0; n<keyscached; ++n) {
00080             if (akeyatoms[n] == atm) {
00081                 DPF2(("Found existing key for %s\n", appname));
00082                 return ahkey[n];
00083             }
00084         }
00085     }
00086     DPF2(("No key found for %s", appname));
00087 #endif
00088
00089     hr = StringCchCopyA(achName, MAX_PATH, KEYNAMEA);
00090   if (FAILED(hr))
00091     OutputError(hr, IDS_SAFE_COPY);
00092
00093     if ((!fCreate && RegOpenKeyA(ROOTKEY, achName, &key) == ERROR_SUCCESS)
00094         || (fCreate && RegCreateKeyA(ROOTKEY, achName, &key) == ERROR_SUCCESS)) {
00095 #if MMPROFILECACHE
00096         if ((keyscached < KEYSCACHED)
00097     && (atm = AddAtomA(appname))) {
00098             // Add this key to the cache array
00099             akeyatoms[keyscached] = atm;
00100             ahkey[keyscached] = key;
00101             DPF1(("Adding key %s to cache array in position %d\n", appname, keyscached));
00102             ++keyscached;
00103         } else {
00104             DPF2(("Not adding key %s to cache array\n", appname));
00105             *closekey = TRUE;
00106         }
00107 #endif
00108     }
00109
00110     return(key);
00111 }
00112
00113 #ifdef UNICODE
00114 static HKEY GetKeyW(LPCWSTR appname, BOOL * closekey, BOOL fCreate) {
00115
00116     HKEY key = 0;
00117     WCHAR achName[MAX_PATH];
00118 #if !MMPROFILECACHE
00119     *closekey = TRUE;
00120 #else
00121     UINT n;
00122     ATOM atm;
00123
00124     *closekey = FALSE;
00125     //
00126     // See if we have already used this key
00127     //
00128     atm = FindAtomW(appname);
00129
00130     if (atm != 0) {
00131   // Atom exists... search the table for it.
00132         for (n=0; n<keyscached; ++n) {
00133             if (akeyatoms[n] == atm) {
00134                 DPF2(("(W)Found existing key for %ls\n", appname));
00135                 return ahkey[n];
00136             }
00137         }
00138     }
00139     DPF2(("(W)No key found for %ls\n", appname));
00140 #endif
00141
00142     StringCchCopyW(achName, MAX_PATH, KEYNAME );
00143     StrCchCatW(achName, MAX_PATH, appname);
00144
00145     if ((!fCreate && RegOpenKeyW(ROOTKEY, achName, &key) == ERROR_SUCCESS)
00146         || (fCreate && RegCreateKeyW(ROOTKEY, achName, &key) == ERROR_SUCCESS)) {
00147 #if MMPROFILECACHE
00148         if (keyscached < KEYSCACHED
00149     && (atm = AddAtomW(appname))) {
00150             // Add this key to the cache array
00151             akeyatoms[keyscached] = atm;
00152             ahkey[keyscached] = key;
00153             DPF1(("Adding key %ls to cache array in position %d\n", appname, keyscached));
00154             ++keyscached;
00155         } else {
00156             DPF2(("Not adding key to cache array\n"));
00157             *closekey = TRUE;
00158         }
00159 #endif
00160     }
00161
00162     return(key);
00163 }
00164 #define GetKey GetKeyW
00165 #else
00166 #define GetKey GetKeyA
00167 #endif // UNICODE
00168
00169 /*
00170  * read a UINT from the profile, or return default if
00171  * not found.
00172  */
00173 #ifdef _WIN32
00174 UINT
00175 mmGetProfileInt(LPCSTR appname, LPCSTR valuename, INT uDefault)
00176 {
00177     DWORD dwType;
00178     INT value = uDefault;
00179     DWORD dwData;
00180     int cbData;
00181     BOOL fCloseKey;
00182
00183     HKEY key = GetKeyA(appname, &fCloseKey, FALSE);
00184
00185     if (key) {
00186
00187         cbData = sizeof(dwData);
00188         if (RegQueryValueExA(
00189             key,
00190             (LPSTR)valuename,
00191             NULL,
00192             &dwType,
00193             (PBYTE) &dwData,
00194             (LPDWORD)&cbData) == ERROR_SUCCESS) {
00195             if (dwType == REG_DWORD || dwType == REG_BINARY) {
00196                 value = (INT)dwData;
00197 #ifdef USESTRINGSALSO
00198             } else if (dwType == REG_SZ) {
00199     value = atoi((LPSTR) &dwData);
00200 #endif
00201       }
00202   }
00203
00204         // close open key open if we did not cache it
00205         if (fCloseKey) {
00206             RegCloseKey(key);
00207         }
00208     }
00209
00210     return((UINT)value);
00211 }
00212 #endif
00213
00214 /*
00215  * read a string from the profile into pResult.
00216  * result is number of bytes written into pResult
00217  */
00218 #ifdef _WIN32
00219 DWORD
00220 mmGetProfileString(
00221     LPCTSTR appname,
00222     LPCTSTR valuename,
00223     LPCTSTR pDefault,
00224     LPTSTR pResult,
00225     int cbResult
00226 )
00227 {
00228     DWORD dwType;
00229     BOOL fCloseKey;
00230   HRESULT hr;
00231
00232     HKEY key = GetKey(appname, &fCloseKey, FALSE);
00233
00234     if (key) {
00235
00236         cbResult = cbResult * sizeof(TCHAR);
00237         if (RegQueryValueEx(
00238             key,
00239             (LPTSTR)valuename,
00240             NULL,
00241             &dwType,
00242             (LPBYTE)pResult,
00243             (LPDWORD)&cbResult) == ERROR_SUCCESS) {
00244
00245                 if (dwType == REG_SZ) {
00246                     // cbResult is set to the size including null
00247                     // we return the number of characters
00248
00249                     // close key if we did not cache it
00250                     if (fCloseKey) {
00251                         RegCloseKey(key);
00252                     }
00253                     return(cbResult/sizeof(TCHAR) - 1);
00254                 }
00255         }
00256
00257         // close open key if we did not cache it
00258         if (fCloseKey) {
00259             RegCloseKey(key);
00260         }
00261     }
00262
00263     // if we got here, we didn't find it, or it was the wrong type - return
00264     // the default string
00265     hr = StringCchCopy(pResult, cbResult, pDefault);
00266   if (FAILED(hr)) {
00267     OutputError(hr, IDS_SAFE_COPY);
00268     return NULL;
00269   }
00270     return(lstrlen(pDefault));
00271 }
00272 #endif
00273
00274
00275 /*
00276  * write a string to the profile
00277  */
00278 #ifdef _WIN32
00279 BOOL
00280 mmWriteProfileString(LPCTSTR appname, LPCTSTR valuename, LPCTSTR pData)
00281 {
00282     BOOL fCloseKey;
00283     HKEY key = GetKey(appname, &fCloseKey, TRUE);
00284     BOOL fResult = !(ERROR_SUCCESS);
00285
00286     if (key) {
00287         if (pData) {
00288             fResult = RegSetValueEx(
00289                 key,
00290                 (LPTSTR)valuename,
00291                 0,
00292                 REG_SZ,
00293                 (LPBYTE)pData,
00294                 (lstrlen(pData) + 1) * sizeof(TCHAR)
00295             );
00296         } else {
00297             fResult = RegDeleteValue(
00298                 key,
00299                 (LPTSTR)valuename
00300             );
00301         }
00302
00303         if (fCloseKey) {
00304             RegCloseKey(key);
00305         }
00306     }
00307
00308     if (ERROR_SUCCESS == fResult) {
00309         return TRUE;
00310     } else {
00311         return FALSE;
00312     }
00313 }
00314
00315 /*****************************************************************************
00316
00317  functions to help convert wide characters to multibyte & vv. (using
00318  functions to control code size...)
00319
00320  ****************************************************************************/
00321
00322 /*
00323  * convert an Ansi string to Unicode
00324  */
00325 LPWSTR mmAnsiToWide (
00326    LPWSTR lpwsz,  // out: wide char buffer to convert into
00327    LPCSTR lpsz,   // in: ansi string to convert from
00328    UINT   nChars) // in: count of characters in each buffer
00329 {
00330    MultiByteToWideChar(GetACP(), 0, lpsz, nChars, lpwsz, nChars);
00331    return lpwsz;
00332 }
00333
00334 /*
00335  * convert a unicode string to ansi
00336  */
00337 LPSTR mmWideToAnsi (
00338    LPSTR   lpsz,   // out: ansi buffer to convert into
00339    LPCWSTR lpwsz,  // in: wide char buffer to convert from
00340    UINT    nChars) // in: count of characters (not bytes!)
00341 {
00342    WideCharToMultiByte(GetACP(), 0, lpwsz, nChars, lpsz, nChars, NULL, NULL);
00343    return lpsz;
00344 }
00345
00346
00347 /*
00348  * Close all open registry keys
00349  */
00350 #if MMPROFILECACHE
00351 VOID CloseKeys()
00352 {
00353     for (; keyscached--;) {
00354
00355 #ifdef DEBUG
00356         if (!ahkey[keyscached]) {
00357             DPF0(("Closing a null key\n"));
00358         }
00359 #endif
00360         RegCloseKey(ahkey[keyscached]);
00361         DeleteAtom(akeyatoms[keyscached]);
00362     }
00363 }
00364
00365 #endif //MMPROFILECACHE
00366
00367
00368 /*
00369  * write a UINT to the profile, if it is not the
00370  * same as the default or the value already there
00371  */
00372 #ifdef _WIN32
00373 BOOL
00374 mmWriteProfileInt(LPCTSTR appname, LPCTSTR valuename, INT Value)
00375 {
00376     // If we would write the same as already there... return.
00377     if (mmGetProfileInt(appname, valuename, !Value) == ((UINT)Value)) {
00378         return TRUE;
00379     }
00380
00381     {
00382         TCHAR achName[MAX_PATH];
00383         HKEY hkey;
00384
00385         HRESULT hr = StringCchCopy(achName, MAX_PATH, KEYNAME);
00386     if (FAILED(hr))
00387       OutputError(hr, IDS_SAFE_COPY);
00388
00389         if (RegCreateKey(ROOTKEY, achName, &hkey) == ERROR_SUCCESS) {
00390             RegSetValueEx(
00391                 hkey,
00392                 valuename,
00393                 0,
00394                 REG_DWORD,
00395                 (PBYTE) &Value,
00396                 sizeof(Value)
00397             );
00398
00399             RegCloseKey(hkey);
00400         }
00401     }
00402     return TRUE;
00403 }
00404
00405 #endif // _WIN32
00406
00407 #endif
00408 #endif
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpCntr/doc.h Source File

  • Com
  • Fundamentals
  • SimpCntr

doc.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: doc.h
00003 //
00004 //      Definition of CSimpleDoc
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _DOC_H_ )
00010 #define _DOC_H_
00011
00012 #include <stablize.h>
00013
00014 class CSimpleSite;
00015 class CSimpleApp;
00016
00017 class CSimpleDoc : public IUnknown, public CSafeRefCount
00018 {
00019 public:
00020         LPSTORAGE       m_lpStorage;
00021         LPOLEINPLACEACTIVEOBJECT m_lpActiveObject;
00022         BOOL            m_fInPlaceActive;
00023         BOOL            m_fAddMyUI;
00024         BOOL            m_fModifiedMenu;
00025
00026         CSimpleSite FAR * m_lpSite;
00027         CSimpleApp FAR * m_lpApp;
00028
00029         HWND m_hDocWnd;
00030
00031         static CSimpleDoc FAR * Create(CSimpleApp FAR *lpApp, LPRECT lpRect,HWND hWnd);
00032
00033         void Close(void);
00034
00035         CSimpleDoc();
00036         CSimpleDoc(CSimpleApp FAR *lpApp, HWND hWnd);
00037         ~CSimpleDoc();
00038
00039         // IUnknown Interface
00040         STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
00041         STDMETHODIMP_(ULONG) AddRef();
00042         STDMETHODIMP_(ULONG) Release();
00043
00044         void InsertObject(void);
00045         void DisableInsertObject(void);
00046         long lResizeDoc(LPRECT lpRect);
00047         long lAddVerbs(void);
00048         void PaintDoc(HDC hDC);
00049 };
00050
00051 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/SampleMSP/SampCall.Cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • SampleMSP

SampCall.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     sampcall.cpp
00008
00009 Abstract:
00010
00011     This module contains implementation of CSampleMSPCall.
00012
00013 --*/
00014
00015 #include "stdafx.h"
00016
00017 ///////////////////////////////////////////////////////////////////////////////
00018 ///////////////////////////////////////////////////////////////////////////////
00019 //
00020
00021 CSampleMSPCall::CSampleMSPCall() : CMSPCallMultiGraph()
00022 {
00023     LOG((MSP_TRACE, "CSampleMSPCall::CSampleMSPCall entered."));
00024     LOG((MSP_TRACE, "CSampleMSPCall::CSampleMSPCall exited."));
00025 }
00026
00027 ///////////////////////////////////////////////////////////////////////////////
00028 ///////////////////////////////////////////////////////////////////////////////
00029 //
00030
00031 CSampleMSPCall::~CSampleMSPCall()
00032 {
00033     LOG((MSP_TRACE, "CSampleMSPCall::~CSampleMSPCall entered."));
00034     LOG((MSP_TRACE, "CSampleMSPCall::~CSampleMSPCall exited."));
00035 }
00036
00037 ULONG CSampleMSPCall::MSPCallAddRef(void)
00038 {
00039     return MSPAddRefHelper(this);
00040 }
00041
00042 ULONG CSampleMSPCall::MSPCallRelease(void)
00043 {
00044     return MSPReleaseHelper(this);
00045 }
00046
00047 ///////////////////////////////////////////////////////////////////////////////
00048 ///////////////////////////////////////////////////////////////////////////////
00049 //
00050 // We override this to make sure the number of streams we have is constant --
00051 // we create them here. Simple MSPs often do this to make life easier.
00052 //
00053
00054 HRESULT CSampleMSPCall::Init(
00055     IN      CMSPAddress *       pMSPAddress,
00056     IN      MSP_HANDLE          htCall,
00057     IN      DWORD               dwReserved,
00058     IN      DWORD               dwMediaType
00059     )
00060 {
00061     // No need to acquire locks on this call because it is called only
00062     // once when the object is created. No other calls can be made on
00063     // this object at this point.
00064
00065     LOG((MSP_TRACE, "CSampleMSPCall::Init - enter"));
00066
00067     //
00068     // First do the base class method. We are adding to the functionality,
00069     // not replacing it.
00070     //
00071
00072     HRESULT hr;
00073
00074     hr = CMSPCallMultiGraph::Init(pMSPAddress,
00075                                    htCall,
00076                                    dwReserved,
00077                                    dwMediaType);
00078
00079     if (FAILED(hr))
00080     {
00081         LOG((MSP_ERROR, "CSampleMSPCall::Init - "
00082             "base class method failed: %x", hr));
00083
00084         return hr;
00085     }
00086
00087     //
00088     // Our calls always come with two streams. Create them now. Use the base class
00089     // methods, as our overriden methods (exposed to the user) purposely fail in order
00090     // to keep the user from creating or removing streams themselves.
00091     // These methods return a pointer to the ITStream. They get saved in our list of
00092     // ITStreams, and we also save them here as CSampleMSPStream pointers.
00093     //
00094
00095     ITStream * pStream;
00096
00097     //
00098     // Create the capture stream.
00099     //
00100
00101     hr = InternalCreateStream (dwMediaType,
00102                                TD_CAPTURE,
00103                                &pStream);
00104
00105     if (FAILED(hr))
00106     {
00107         LOG((MSP_ERROR, "CSampleMSPCall::Init - "
00108             "couldn't create capture stream: %x", hr));
00109
00110         return hr;
00111     }
00112
00113     m_pCaptureStream = dynamic_cast<CSampleMSPStream *> (pStream);
00114
00115     if ( m_pCaptureStream == NULL )
00116     {
00117         LOG((MSP_ERROR, "CSampleMSPCall::Init - "
00118             "couldn't dynamic_cast capture stream - exit E_FAIL"));
00119
00120         return E_FAIL;
00121     }
00122
00123     pStream->Release();
00124
00125     //
00126     // Create the render stream.
00127     //
00128
00129     hr = InternalCreateStream (dwMediaType,
00130                                TD_RENDER,
00131                                &pStream);
00132
00133     if (FAILED(hr))
00134     {
00135         LOG((MSP_ERROR, "CSampleMSPCall::Init - "
00136             "couldn't create capture stream: %x", hr));
00137
00138         return hr;
00139     }
00140
00141     m_pRenderStream = dynamic_cast<CSampleMSPStream *> (pStream);
00142
00143     if ( m_pRenderStream == NULL )
00144     {
00145         LOG((MSP_ERROR, "CSampleMSPCall::Init - "
00146             "couldn't dynamic_cast render stream - exit E_FAIL"));
00147
00148         return E_FAIL;
00149     }
00150
00151     pStream->Release();
00152
00153     LOG((MSP_TRACE, "CSampleMSPCall::Init - exit S_OK"));
00154
00155     return S_OK;
00156 }
00157
00158 ///////////////////////////////////////////////////////////////////////////////
00159 ///////////////////////////////////////////////////////////////////////////////
00160 //
00161 // We override this to make sure the number of streams we have is constant --
00162 // we disallow any creation of streams after the call is created. Simple MSPs
00163 // often do this to make life easier.
00164 //
00165
00166 STDMETHODIMP CSampleMSPCall::CreateStream (
00167     IN      DWORD               dwMediaType,
00168     IN      TERMINAL_DIRECTION  Direction,
00169     IN OUT  ITStream **         ppStream
00170     )
00171 {
00172     LOG((MSP_TRACE, "CSampleMSPCall::CreateStream entered."));
00173     LOG((MSP_TRACE, "CSampleMSPCall::CreateStream - "
00174         "we have a fixed set of streams - exit TAPI_E_MAXSTREAMS"));
00175
00176     return TAPI_E_MAXSTREAMS;
00177 }
00178
00179 ///////////////////////////////////////////////////////////////////////////////
00180 ///////////////////////////////////////////////////////////////////////////////
00181 //
00182 // We override this to make sure the number of streams we have is constant --
00183 // we disallow any removal of streams after the call is created. Simple MSPs
00184 // often do this to make life easier.
00185 //
00186
00187 STDMETHODIMP CSampleMSPCall::RemoveStream (
00188     IN      ITStream *          pStream
00189     )
00190 {
00191     LOG((MSP_TRACE, "CSampleMSPCall::RemoveStream entered."));
00192     LOG((MSP_TRACE, "CSampleMSPCall::RemoveStream - "
00193         "we have a fixed set of streams - exit TAPI_E_NOTSUPPORTED"));
00194
00195     return TAPI_E_NOTSUPPORTED;
00196 }
00197
00198 ///////////////////////////////////////////////////////////////////////////////
00199 ///////////////////////////////////////////////////////////////////////////////
00200 //
00201 // This is our override to create the right kind of stream on stream creation.
00202 // The base class checks the arguments for us.
00203 //
00204
00205 HRESULT CSampleMSPCall::CreateStreamObject(
00206         IN      DWORD               dwMediaType,
00207         IN      TERMINAL_DIRECTION  Direction,
00208         IN      IMediaEvent *       pGraph,
00209         IN      ITStream **         ppStream
00210         )
00211 {
00212     LOG((MSP_TRACE, "CSampleMSPCall::CreateStreamObject - enter"));
00213
00214     HRESULT hr;
00215     CMSPComObject<CSampleMSPStream> * pStream;
00216
00217     hr = CMSPComObject<CSampleMSPStream>::CreateInstance( &pStream );
00218
00219     if ( FAILED(hr) )
00220     {
00221         LOG((MSP_ERROR, "CSampleMSPCall::CreateStreamObject - "
00222             "can't create stream object - 0x%08x", hr));
00223
00224         return hr;
00225     }
00226
00227     hr = pStream->_InternalQueryInterface( IID_ITStream,
00228                                            (void **) ppStream );
00229
00230     if ( FAILED(hr) )
00231     {
00232         LOG((MSP_ERROR, "CSampleMSPCall::CreateStreamObject - "
00233             "can't get ITStream interface - 0x%08x", hr));
00234
00235         delete pStream;
00236         return hr;
00237     }
00238
00239     hr = pStream->Init( (MSP_HANDLE) m_pMSPAddress,
00240                        this,
00241                        pGraph,
00242                        dwMediaType,
00243                        Direction);
00244
00245     if ( FAILED(hr) )
00246     {
00247         LOG((MSP_ERROR, "CSampleMSPCall::CreateStreamObject - "
00248             "can't Init stream object - 0x%08x", hr));
00249
00250         (*ppStream)->Release();
00251         return hr;
00252     }
00253
00254     LOG((MSP_TRACE, "CSampleMSPCall::CreateStreamObject - exit S_OK"));
00255     return S_OK;
00256 }
00257
00258 ///////////////////////////////////////////////////////////////////////////////
00259 ///////////////////////////////////////////////////////////////////////////////
00260 //
00261 // Here we implement our sample TSP-MSP communication. The key thing to note
00262 // here is that the protocol is arbitrary; it simply must be agreed upon by
00263 // the TSP and MSP involved, and TAPI3.dll enables it by allowing opaque
00264 // buffers to be passed between the TSP and MSP. TAPI3.dll itself knows nothing
00265 // about the contents of the buffers.
00266 //
00267 // To demonstrate we have chosen a very simple protocol, which simply allows
00268 // the TSP to configure the transports used on the streams, and stop and start
00269 // streaming at opportune times. All of these messages are sent by the TSP and
00270 // received by the MSP, with TAPI3.dll implementing the channel across the
00271 // processes. At a minimum, the TSP should send a start message when the call
00272 // connects and a stop message when the call disconnects. This sample does not
00273 // show any communication sent back from the MSP to the TSP, but there is a
00274 // mechanism in place for this as well (see the code for
00275 // CSampleMSPStream::FireEvent in this sample and the file msp.idl in the
00276 // Windows SDK for more information).
00277 //
00278 // Here's what our sample protocol looks like:
00279 //
00280 // First DWORD =  Command            Second DWORD  Third DWORD
00281 // -------------  -------            ------------  -----------
00282 // 0              Config transport   render config capture config
00283 // 1              Start streaming    <ignored>     <ignored>
00284 // 2              Stop streaming     <ignored>     <ignored>
00285 //
00286 // The render config and capture config are not actually used in this
00287 // example; they are just there as a placeholder for some meaningful info
00288 // and to show how to check the length of the buffer, etc.
00289 //
00290 // The method returns S_OK even if an individual stream failed to
00291 // start, stop, or initialize. This is because TAPI 3.0 doesn't need to
00292 // know about streaming failures in this code path. Instead, events are
00293 // generated to inform the application of failures.
00294 //
00295
00296 HRESULT CSampleMSPCall::ReceiveTSPCallData(
00297     IN      PBYTE               pBuffer,
00298     IN      DWORD               dwSize
00299     )
00300 {
00301     LOG((MSP_TRACE, "CSampleMSPCall::ReceiveTSPCallData - enter"));
00302
00303     //
00304     // Check that the buffer is as big as advertised.
00305     //
00306
00307     if ( IsBadWritePtr(pBuffer, sizeof(BYTE) * dwSize) )
00308     {
00309         LOG((MSP_ERROR, "CSampleMSPCall::ReceiveTSPCallData - "
00310             "bad buffer - exit E_POINTER"));
00311
00312         return E_POINTER;
00313     }
00314
00315     //
00316     // Check if we have a command DWORD.
00317     //
00318
00319     if ( dwSize < sizeof(DWORD) )
00320     {
00321         LOG((MSP_ERROR, "CSampleMSPCall::ReceiveTSPCallData - "
00322             "need a DWORD for command - exit E_INVALIDARG"));
00323
00324         return E_INVALIDARG;
00325     }
00326
00327     //
00328     // We are going to access the streams lists -- grab the lock
00329     //
00330
00331     CLock lock(m_lock);
00332
00333     _ASSERTE( m_Streams.GetSize() == 2 );
00334
00335     HRESULT hr;
00336
00337     //
00338     // Based on the command, take action:
00339     //
00340
00341     switch ( ((DWORD *) pBuffer) [0] )
00342     {
00343     case 0: // configure the transports
00344         {
00345             //
00346             // In a real MSP, this sort of command would have meaningful
00347             // arguments that are passed to the streams. For our
00348             // purposes, let's just define this to have two DWORD
00349             // arguments and print what they are when we receive
00350             // the command.
00351             //
00352
00353             if ( dwSize < 3 * sizeof(DWORD) )
00354             {
00355                 LOG((MSP_ERROR, "CSampleMSPCall::ReceiveTSPCallData - "
00356                     "need 3 DWORDs for Config Transports command - "
00357                     "exit E_INVALIDARG"));
00358
00359                 return E_INVALIDARG;
00360             }
00361             LOG((MSP_INFO, "CSampleMSPCall::ReceiveTSPCallData - "
00362                 "configuring transport - dword args %d, %d",
00363                 ((DWORD *) pBuffer) [1],
00364                 ((DWORD *) pBuffer) [2]));
00365
00366             //
00367             // Use our saved class pointers to access the private method,
00368             // and also to conveniently differentiate between render and
00369             // capture. Note that the capture stream is the one with a
00370             // capture terminal, and the render stream is the one with the
00371             // render terminal, so the arguments would have to be matched
00372             // here based on the data from the buffer (if there were any).
00373             //
00374
00375             hr = m_pCaptureStream->ConfigureTransport ( );
00376
00377             if ( FAILED(hr) )
00378             {
00379                 LOG((MSP_ERROR, "CSampleMSPCall::ReceiveTSPCallData - "
00380                     "capture stream ConfigureTransport failed 0x%08x - "
00381                     "firing CALL_STREAM_FAIL", hr));
00382
00383                 m_pCaptureStream->FireEvent(CALL_STREAM_FAIL, hr, CALL_CAUSE_UNKNOWN);
00384             }
00385
00386             hr = m_pRenderStream ->ConfigureTransport( );
00387
00388             if ( FAILED(hr) )
00389             {
00390                 LOG((MSP_ERROR, "CSampleMSPCall::ReceiveTSPCallData - "
00391                     "render stream ConfigureTransport failed 0x%08x - "
00392                     "firing CALL_STREAM_FAIL", hr));
00393
00394                 m_pRenderStream->FireEvent(CALL_STREAM_FAIL, hr, CALL_CAUSE_UNKNOWN);
00395             }
00396
00397         }
00398         break;
00399
00400     case 1: // start streaming
00401         {
00402             hr = m_pCaptureStream ->StartStream();
00403             hr = m_pRenderStream  ->StartStream();
00404         }
00405         break;
00406
00407     case 2: // stop streaming
00408         {
00409             hr = m_pCaptureStream ->StopStream();
00410             hr = m_pRenderStream  ->StopStream();
00411         }
00412         break;
00413
00414     default:
00415         LOG((MSP_ERROR, "CSampleMSPCall::ReceiveTSPCallData - "
00416             "invalid command - exit E_INVALIDARG"));
00417
00418         return E_INVALIDARG;
00419
00420     }
00421
00422     LOG((MSP_TRACE, "CSampleMSPCall::ReceiveTSPCallData - exit S_OK"));
00423     return S_OK;
00424 }
00425
00426 // eof
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Provider_Globals Member List

This is the complete list of members for Provider_Globals, including all inherited members.
CreateInstance(const CLSID &a_ReferenceClsid, LPUNKNOWN a_OuterUnknown, const DWORD &a_ClassContext, const UUID &a_ReferenceInterfaceId, void **a_ObjectInterface) | Provider_Globals | [static]
CreateInstance(const CLSID &a_ReferenceClsid, LPUNKNOWN a_OuterUnknown, const DWORD &a_ClassContext, const UUID &a_ReferenceInterfaceId, void **a_ObjectInterface) | Provider_Globals | [static]
CreateInstance(const CLSID &a_ReferenceClsid, LPUNKNOWN a_OuterUnknown, const DWORD &a_ClassContext, const UUID &a_ReferenceInterfaceId, void **a_ObjectInterface) | Provider_Globals | [static]
Global_Shutdown() | Provider_Globals | [static]
Global_Shutdown() | Provider_Globals | [static]
Global_Shutdown() | Provider_Globals | [static]
Global_Startup() | Provider_Globals | [static]
Global_Startup() | Provider_Globals | [static]
Global_Startup() | Provider_Globals | [static]
s_LocksInProgress | Provider_Globals | [static]
s_ObjectsInProgress | Provider_Globals | [static]
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Child/vc/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Child
  • vc

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__FB2CD070_AFD1_11D2_9A74_0080C7A2DC6B__INCLUDED_)
00007 #define AFX_STDAFX_H__FB2CD070_AFD1_11D2_9A74_0080C7A2DC6B__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00013
00014 // TODO: reference additional headers your program requires here
00015
00016 //{{AFX_INSERT_LOCATION}}
00017 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00018
00019 #endif // !defined(AFX_STDAFX_H__FB2CD070_AFD1_11D2_9A74_0080C7A2DC6B__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/dllmain.cpp Source File

  • WinUI
  • TSFcase

dllmain.cpp

Go to the documentation of this file.
00001 //
00002 // dllmain.cpp
00003 //
00004 // DllMain module entry point.
00005 //
00006
00007 #include "globals.h"
00008 #include "snoop.h"
00009
00010 //+---------------------------------------------------------------------------
00011 //
00012 // DllMain
00013 //
00014 //----------------------------------------------------------------------------
00015
00016 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID pvReserved)
00017 {
00018     switch (dwReason)
00019     {
00020         case DLL_PROCESS_ATTACH:
00021
00022             g_hInst = hInstance;
00023
00024             if (!InitializeCriticalSectionAndSpinCount(&g_cs, 0))
00025                 return FALSE;
00026
00027             CSnoopWnd::_InitClass();
00028
00029             break;
00030
00031         case DLL_PROCESS_DETACH:
00032
00033             CSnoopWnd::_UninitClass();
00034
00035             DeleteCriticalSection(&g_cs);
00036
00037             break;
00038     }
00039
00040     return TRUE;
00041 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/localres.h Source File

  • SysMgmt
  • MMC
  • Toolbar

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmDebug/DllDatax.h Source File

  • Com
  • Services
  • Crm
  • CrmDebug

DllDatax.h

Go to the documentation of this file.
00001 #if !defined(AFX_DLLDATAX_H__FA796170_D8B0_11D1_AB85_00A0C91EEDE9__INCLUDED_)
00002 #define AFX_DLLDATAX_H__FA796170_D8B0_11D1_AB85_00A0C91EEDE9__INCLUDED_
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007
00008 #ifdef _MERGE_PROXYSTUB
00009
00010 extern "C"
00011 {
00012 BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason,
00013   LPVOID lpReserved);
00014 STDAPI PrxDllCanUnloadNow(void);
00015 STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv);
00016 STDAPI PrxDllRegisterServer(void);
00017 STDAPI PrxDllUnregisterServer(void);
00018 }
00019
00020 #endif
00021
00022 //{{AFX_INSERT_LOCATION}}
00023 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00024
00025 #endif // !defined(AFX_DLLDATAX_H__FA796170_D8B0_11D1_AB85_00A0C91EEDE9__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/QosEvent/Findsp.Cpp Source File

  • NetDS
  • GQos
  • QosEvent

Findsp.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      findsp.cpp
00010 //
00011 // Abstract:
00012 //      Implement functionality to find/select a Winsock Service Provider based
00013 //      on selected options.
00014 //
00015 // Entry Points:
00016 //      FindServiceProvider - find a service provider
00017 //
00018 // Author:
00019 //      barry r. butterklee
00020
00021 #include "qosevent.h"
00022
00023 // Abstract:
00024 //      Look for a service provider.  If QoS has been requested, then look for
00025 //      a QoS-enabled IP service provider.  Return TRUE only if a service
00026 //      provider is found that matches all the criteria. Also, if QoS was not
00027 //      requested do not pick a QoS-enabled service provider (even though that
00028 //      should NOT matter).
00029 //
00030 //      Notice that actual service provider names are different on NT and Win9x
00031 //      when searching for a service provider, you should not use the service
00032 //      provider name, but instead use the various flags in the protocol
00033 //      structure.
00034 //
00035 BOOL FindServiceProvider(
00036     int                 iProtocol,
00037     BOOL                bQos,
00038     BOOL                bMulticast,
00039     WSAPROTOCOL_INFO    *pProtocolInfo
00040     )
00041 {
00042     int nRet;
00043     WSAPROTOCOL_INFO *lpProtocolBuf = NULL;
00044     DWORD dwBufLen = 0;
00045     DWORD dwErr;
00046     BOOL bProtocolFound = FALSE;
00047     BOOL bSPQos = FALSE, bSPMulticast=FALSE;
00048     BOOL bQosMatch = FALSE, bMulticastMatch = FALSE;
00049
00050     // first have WSAEnumProtocols tell us how big a buffer is needed
00051     nRet = WSAEnumProtocols(NULL, NULL, &dwBufLen);
00052     if (SOCKET_ERROR != nRet)
00053     {
00054         printf("WSAEnumProtocols: should not have suceeded\n");
00055         goto end;
00056     }
00057
00058     if (WSAENOBUFS != (dwErr = WSAGetLastError()))
00059     {
00060         // WSAEnumProtocols failed for some reason not relating to buffer size
00061         printf("WSAEnumProtocols(1): %d\n", dwErr);
00062         goto end;
00063     }
00064
00065     // WSAEnumProtocols failed for the "expected" reason, allocate a buffer
00066     // of the needed size
00067     lpProtocolBuf = (WSAPROTOCOL_INFO *)malloc(dwBufLen);
00068     if (!lpProtocolBuf)
00069     {
00070         printf("malloc failed in FindServiceProvider\n");
00071         goto end;
00072     }
00073
00074     // now we can call WSAEnumProtocols again with the expectation it will
00075     // succeed because we have allocated a big enough buffer.
00076     nRet = WSAEnumProtocols(NULL, lpProtocolBuf, &dwBufLen);
00077     if (SOCKET_ERROR == nRet)
00078     {
00079         printf("WSAEnumProtocols(3): %d\n", WSAGetLastError());
00080         goto end;
00081     }
00082
00083     // loop thru protocols, looking for a matching service provider
00084     {
00085     for (int i=0; i<nRet; i++)
00086     {
00087         printf("  sp <%s>\n", lpProtocolBuf[i].szProtocol);
00088
00089         // do we have the correct protocol?
00090         if (AF_INET != lpProtocolBuf[i].iAddressFamily
00091                 || iProtocol != lpProtocolBuf[i].iProtocol)
00092             continue; // nope, move on
00093
00094         // Check for Qos and Multicast
00095         bSPQos =
00096             ((XP1_QOS_SUPPORTED & lpProtocolBuf[i].dwServiceFlags1) != 0);
00097         bSPMulticast =
00098             ((XP1_SUPPORT_MULTIPOINT & lpProtocolBuf[i].dwServiceFlags1) != 0);
00099
00100         // Look to see if we got exactly what we wanted
00101         if ((bQos == bSPQos) && (bMulticast == bSPMulticast))
00102         {
00103
00104             memcpy(pProtocolInfo, (void *) &lpProtocolBuf[i],
00105                     sizeof(WSAPROTOCOL_INFO));
00106             bProtocolFound = TRUE;
00107             break;
00108         }
00109     } // for
00110     } // scope resolution for int i on stricter compilers
00111
00112
00113 end:
00114     if (lpProtocolBuf)
00115         free(lpProtocolBuf);
00116
00117     if (bProtocolFound)
00118         printf("  Using service provider <%s>\n\n", pProtocolInfo->szProtocol);
00119
00120     return(bProtocolFound);
00121 }
00122
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CVector< TYPE, IDX > Member List

This is the complete list of members for CVector< TYPE, IDX >, including all inherited members.
AddElement(TYPE element) | CVector< TYPE, IDX > | [virtual]
Attach(CVector &rVector) | CVector< TYPE, IDX > | [virtual]
Attach(IDX cElements, TYPE *rgElements) | CVector< TYPE, IDX > | [virtual]
CVector(IDX ulLowerBound=0, IDX ulGrowSize=10) | CVector< TYPE, IDX > |
Detach(IDX *pcElements, TYPE **prgElements) | CVector< TYPE, IDX > | [virtual]
GetCount() | CVector< TYPE, IDX > | [inline, virtual]
GetElement(IDX iIndex) | CVector< TYPE, IDX > | [virtual]
GetElements() const | CVector< TYPE, IDX > | [inline, virtual]
InsertAt(IDX iIndex, TYPE element) | CVector< TYPE, IDX > | [virtual]
m_cElements | CVector< TYPE, IDX > | [protected]
m_rgElements | CVector< TYPE, IDX > | [protected]
m_ulGrowSize | CVector< TYPE, IDX > | [protected]
m_ulLowerBound | CVector< TYPE, IDX > | [protected]
m_ulMaxSize | CVector< TYPE, IDX > | [protected]
operator[](IDX iIndex) | CVector< TYPE, IDX > | [inline, virtual]
RemoveAll() | CVector< TYPE, IDX > | [virtual]
RemoveAt(IDX iIndex) | CVector< TYPE, IDX > | [virtual]
~CVector() | CVector< TYPE, IDX > | [virtual]
Generated on Wed Nov 13 2024 16:57:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RESULTDATA Member List

This is the complete list of members for RESULTDATA, including all inherited members.
dwThreadId | RESULTDATA
sString | RESULTDATA
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminImpersonationLevelOptions.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminImpersonationLevelOptions.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminImpersonationLevelOptions
00019
00020 public interface COMAdminImpersonationLevelOptions
00021 {
00022   public static final int COMAdminImpersonationAnonymous = 1;
00023   public static final int COMAdminImpersonationIdentify = 2;
00024   public static final int COMAdminImpersonationImpersonate = 3;
00025   public static final int COMAdminImpersonationDelegate = 4;
00026 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/appinfo.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

appinfo.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __APP_INFO_H__
00018 #define __APP_INFO_H__
00019
00020 #include "ComSpyCtl.h"
00021
00022 class CComSpy;
00023
00024 typedef enum FilterType {NoFilter = 0, AppID = 1, ProcessID = 2} FILTERTYPE;
00025
00026
00027 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00028 Class:   CAppInfo
00029 Summary: CAppInfo manages COM+ Event subscriptions for COM+ Applications.
00030      Depending on the flag settings, this can be a COM+ Catalog App,
00031      a running COM+ process, or a special case that represents 'all'
00032      Applications (does not filter by App).
00033      The COM+ Events basically are filtered by AppID or PID (or both) for
00034      a given Event Type.  This SDK example does not support the case
00035      of filtering by both an AppID and a PID at the same time.
00036 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00037 class CAppInfo
00038 {
00039 private:
00040   CComSpy * m_pSpy;
00041   bool m_bReadyForDelete;
00042   SUBSCRIBERMAP * m_EventMap;
00043   CComBSTR m_sAppName;
00044   FILTERTYPE m_FilterType;
00045   CComBSTR m_sAppID;
00046   long m_PID;
00047
00048   // Cannot call Default Constrcutor or Initialze since they are Private
00049   CAppInfo();
00050   void Initialze(CComSpy * pSpy);
00051
00052 public:
00053   CAppInfo(LPTSTR sAppName, CComSpy * pSpy);
00054   CAppInfo(LPTSTR sAppName, CComSpy * pSpy, long nPID);
00055   CAppInfo(LPTSTR sAppName, CComSpy * pSpy, LPTSTR sAppID);
00056
00057   ~CAppInfo();
00058
00059   CComBSTR & AppName() {return m_sAppName;}
00060   FILTERTYPE GetFilterType() {return m_FilterType;}
00061   SUBSCRIBERMAP* GetEvents() {return m_EventMap;}
00062
00063   void SetDeleteFlag(bool bDelete) { m_bReadyForDelete = bDelete; }
00064   bool IsReadyForDelete() { return m_bReadyForDelete; }
00065
00066   // Subscription helpers.
00067   bool RemoveAllSubscriptions();
00068   bool AddSubscription(EventEnum e);
00069   bool RemoveSubscription(EventEnum e);
00070
00071   bool IsSubscribed(EventEnum e);
00072   bool IsSubscribedToAny();
00073 };
00074
00075 #endif
00076
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/delebase.h Source File

  • SysMgmt
  • MMC
  • Complete

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CComponent;
00030 class CComponentData;
00031
00032 class CDelegationBase {
00033 public:
00034     CDelegationBase();
00035     virtual ~CDelegationBase();
00036
00037     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00038     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00039
00040     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00041     virtual const int GetBitmapIndex() = 0;
00042
00043     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00044
00045     virtual void SetScopeItemValue(HSCOPEITEM hscopeitem) { _ASSERT(FALSE); }
00046     virtual HSCOPEITEM GetParentScopeItem() { _ASSERT(FALSE); return 0;}
00047
00048 public:
00049     // virtual functions go here (for MMCN_*)
00050     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
00051     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
00052     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00053     virtual HRESULT OnRename(LPOLESTR pszNewName) { return S_FALSE; }
00054     virtual HRESULT OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) { return S_FALSE; }
00055     virtual HRESULT OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) { return S_FALSE; }
00056     virtual HRESULT OnRefresh(IConsole *pConsole) { return S_FALSE; }
00057     virtual HRESULT     OnDelete(IConsole *pConsoleComp) { return S_FALSE; }
00058
00059     virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider,
00060         LONG_PTR handle) { return S_FALSE; }
00061     virtual HRESULT HasPropertySheets() { return S_FALSE; }
00062     virtual HRESULT GetWatermarks(HBITMAP *lphWatermark,
00063         HBITMAP *lphHeader,
00064         HPALETTE *lphPalette,
00065         BOOL *bStretch) { return S_FALSE; }
00066
00067     virtual HRESULT OnPropertyChange(IConsole *pConsole, CComponent *pComponent) { return S_OK; }
00068
00069     virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) { return S_FALSE; }
00070     virtual HRESULT OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) { return S_FALSE; }
00071
00072     virtual HRESULT OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) { return S_FALSE; }
00073     virtual HRESULT OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) { return S_FALSE; }
00074
00075 public:
00076     static HBITMAP m_pBMapSm;
00077     static HBITMAP m_pBMapLg;
00078
00079 protected:
00080     static void LoadBitmaps() {
00081         m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
00082         m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
00083     }
00084
00085     BOOL bExpanded;
00086
00087 private:
00088     // {786C6F77-6BE7-11d3-9156-00C04F65B3F9}
00089     static const GUID thisGuid;
00090
00091 };
00092
00093 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyCapabilities/MyCapabilities.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyCapabilities

MyCapabilities.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      MyCapabilities.cpp
00005 //
00006 //  Description:
00007 //      Implementation of CMyCapabilities class.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 #include "stdafx.h"
00012 #include "MyCapabilities.h"
00013 #include <winerror.h>
00014 #include <assert.h>
00015
00016 //
00017 // If ALLOW_FAIL is defined, then we will not allow this node to be clustered
00018 // if HrGetApplicationCompatibilityInfo() sets the output parameter to FALSE.
00019 //
00020 // If ALLOW_FAIL is not defined, then we will not prevent this node from being
00021 // clustered if HrGetApplicationCompatibilityInfo() sets the output parameter to FALSE.
00022 //
00023
00024 //
00025 // Uncommenting the "#define ALLOW_FAIL" statement below will cause the Cluster
00026 // Configuration Setup to display an error and fail, otherwise it will display
00027 // a warning and allow to continue.
00028 //
00029
00030 // #define ALLOW_FAIL
00031
00032
00033 //////////////////////////////////////////////////////////////////////////////
00034 //++
00035 //
00036 //  CMyCapabilities::CMyCapabilities
00037 //
00038 //  Description:
00039 //      Constructor of the CMyCapabilities class.
00040 //
00041 //  Arguments:
00042 //      None.
00043 //
00044 //  Return Value:
00045 //      None.
00046 //
00047 //--
00048 //////////////////////////////////////////////////////////////////////////////
00049 CMyCapabilities::CMyCapabilities( void )
00050     : m_lcid( LOCALE_NEUTRAL )
00051     , m_piccCallback( NULL )
00052 {
00053 } //*** CMyCapabilities::CMyCapabilities
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 //++
00057 //
00058 //  CMyCapabilities::~CMyCapabilities
00059 //
00060 //  Description:
00061 //      Destructor of the CMyCapabilities class.
00062 //
00063 //  Arguments:
00064 //      None.
00065 //
00066 //  Return Value:
00067 //      None.
00068 //
00069 //--
00070 //////////////////////////////////////////////////////////////////////////////
00071 CMyCapabilities::~CMyCapabilities( void )
00072 {
00073     // Release the callback interface
00074     if ( m_piccCallback != NULL )
00075     {
00076         m_piccCallback->Release();
00077     } // if: the callback interface pointer is not NULL
00078
00079 } //*** CMyCapabilities::~CMyCapabilities
00080
00081 //////////////////////////////////////////////////////////////////////////////
00082 //++
00083 //
00084 //  CMyCapabilities::HrGetApplicationCompatibilityInfo
00085 //
00086 //  Description:
00087 //      Gets information about the application's compatibility with
00088 //      clustering.
00089 //
00090 //  Arguments:
00091 //      pfIsAppCompatible   - TRUE = Application is compatible with clustering.
00092 //
00093 //  Return Value:
00094 //      S_OK   - Operation completed successfully.
00095 //
00096 //--
00097 //////////////////////////////////////////////////////////////////////////////
00098 HRESULT
00099 CMyCapabilities::HrGetApplicationCompatibilityInfo( BOOL * pfIsAppCompatible )
00100 {
00101     assert( pfIsAppCompatible != NULL );
00102
00103     //
00104     // TODO: Add decision logic here
00105     //
00106     *pfIsAppCompatible = FALSE;
00107
00108     return S_OK;
00109
00110 } //*** CMyCapabilities::HrGetApplicationCompatibilityInfo
00111
00112
00113 //***************************************************************************
00114 //
00115 //  IClusCfgCapabilities interface
00116 //
00117 //***************************************************************************
00118
00119 //////////////////////////////////////////////////////////////////////////////
00120 //++
00121 //
00122 //  [IClusCfgCapabilities]
00123 //  CMyCapabilities::CanNodeBeClustered
00124 //
00125 //  Description:
00126 //      Checks for application compatibility with clustering. This function
00127 //      will decide whether this node can be clustered or not.
00128 //
00129 //  Arguments:
00130 //      None.
00131 //
00132 //  Return Value:
00133 //      S_OK
00134 //          Node can be clustered.
00135 //
00136 //      S_FALSE
00137 //          Node cannot be clustered.
00138 //
00139 //      Other HRESULTs
00140 //          An error occurred.
00141 //
00142 //--
00143 //////////////////////////////////////////////////////////////////////////////
00144 STDMETHODIMP
00145 CMyCapabilities::CanNodeBeClustered( void )
00146 {
00147     HRESULT hr = S_OK;
00148     HRESULT hrCompatibilityInfo = S_OK;
00149     BOOL    fIsAppCompatible = FALSE;
00150
00151     //
00152     // Determine if application is compatible.
00153     //
00154     hrCompatibilityInfo = HrGetApplicationCompatibilityInfo( &fIsAppCompatible );
00155     if ( hrCompatibilityInfo == S_OK )
00156     {
00157         if ( fIsAppCompatible == FALSE )
00158         {
00159             //
00160             // The application is not compatible with clustering.
00161             // Display a warning message in the user interface
00162             // to alert the user to this condition.
00163             //
00164             hr = m_piccCallback->SendStatusReport(
00165                       NULL      // Sender's node name (filled in by server)
00166                     , TASKID_Major_Check_Cluster_Feasibility
00167                     , TASKID_Minor_MyApp_Compat_Info
00168                     , 0         // ulMinIn
00169                     , 1         // ulMaxIn
00170                     , 1         // ulCurrentIn
00171 #if defined( ALLOW_FAIL )
00172                     , HRESULT_FROM_WIN32( ERROR_NODE_CANNOT_BE_CLUSTERED ) // generates an error (red "x")
00173 #else
00174                     , S_FALSE   // S_FALSE generates only a warning in the wizard
00175 #endif
00176                     , L"MyCapabilities message: My application is not compatible with the Cluster Service."
00177                     , NULL      // pftTimeIn (filled in by server)
00178                     , NULL      // pcszReferenceIn
00179                     );
00180             if ( FAILED( hr ) )
00181             {
00182                 goto Cleanup;
00183             } // if:
00184
00185 #if defined( ALLOW_FAIL )
00186             hr = S_FALSE; // if ALLOW_FAIL is defined we return S_FALSE to error out.
00187             goto Cleanup;
00188 #endif
00189         } // if: app is not compatible with clustering
00190     } // if: no error getting application compatibility info
00191     else
00192     {
00193         //
00194         // An error occurred getting application compatibility info.
00195         // Display an error message in the user interface to alert the
00196         // user to this condition.
00197         //
00198
00199         hr = m_piccCallback->SendStatusReport(
00200                   NULL      // Sender's node name (filled in by server)
00201                 , TASKID_Major_Check_Cluster_Feasibility
00202                 , TASKID_Minor_MyApp_Compat_Info
00203                 , 0         // ulMinIn
00204                 , 1         // ulMaxIn
00205                 , 1         // ulCurrentIn
00206                 , hr
00207                 , L"MyCapabilities message: Could not determine whether my application is compatible with the Cluster Service or not."
00208                 , NULL      // pftTimeIn (filled in by server)
00209                 , NULL      // pcszReferenceIn
00210                 );
00211
00212         if ( FAILED( hr ) )
00213         {
00214             goto Cleanup;
00215         } // if:
00216
00217     } // else: error getting application compatibility info.
00218
00219 Cleanup:
00220
00221     //
00222     //  If we only want to warn the user, we can re-set hr to S_OK to allow
00223     //  this node to be clustered anyway, regardless of whether or not this
00224     //  application is cluster-aware.
00225     //
00226 #if ! defined( ALLOW_FAIL )
00227     hr = S_OK;
00228 #endif
00229
00230     return hr;
00231
00232 } //*** CMyCapabilities::CanNodeBeClustered
00233
00234
00235 //***************************************************************************
00236 //
00237 //  IClusCfgInitialize interface
00238 //
00239 //***************************************************************************
00240
00241 //////////////////////////////////////////////////////////////////////////////
00242 //++
00243 //
00244 //  [IClusCfgInitialize]
00245 //  CMyCapabilities::Initialize
00246 //
00247 //  Description:
00248 //      Initialize this component.
00249 //
00250 //  Arguments:
00251 //    IN  IUknown * punkCallbackIn
00252 //    IN  LCID      lcidIn
00253 //
00254 //  Return Value:
00255 //      S_OK
00256 //          If the call succeeded.
00257 //
00258 //      E_POINTER
00259 //          The punkCallbackIn param is NULL.
00260 //
00261 //      Other HRESULTs
00262 //          An error occurred.
00263 //
00264 //--
00265 //////////////////////////////////////////////////////////////////////////////
00266 STDMETHODIMP
00267 CMyCapabilities::Initialize(
00268     IUnknown *  punkCallbackIn,
00269     LCID        lcidIn
00270     )
00271 {
00272     HRESULT hr = S_OK;
00273
00274     m_lcid = lcidIn;
00275
00276     if ( m_piccCallback != NULL )
00277     {
00278         //
00279         // Release the callback interface
00280         //
00281         m_piccCallback->Release();
00282         m_piccCallback = NULL;
00283     } // if: the callback interface pointer is not NULL
00284
00285     if ( punkCallbackIn != NULL )
00286     {
00287         //
00288         // Query for the IClusCfgCallback interface.
00289         //
00290         hr = punkCallbackIn->QueryInterface( __uuidof( IClusCfgCallback ), reinterpret_cast< void ** > ( &m_piccCallback ) );
00291     } // if: the callback punk is not NULL.
00292     else
00293     {
00294         hr = E_POINTER;
00295     } // else: the callback punk is NULL.
00296
00297     return hr;
00298
00299 } //*** CMyCapabilities::Initialize
00300
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Extens

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057
00058     if (*ppv)
00059     {
00060         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00061         return S_OK;
00062     }
00063
00064     return E_NOINTERFACE;
00065 }
00066
00067 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00068 {
00069     return InterlockedIncrement((LONG *)&m_cref);
00070 }
00071
00072 STDMETHODIMP_(ULONG) CComponentData::Release()
00073 {
00074     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00075     {
00076         // we need to decrement our object count in the DLL
00077         delete this;
00078         return 0;
00079     }
00080
00081     return m_cref;
00082 }
00083
00084 ///////////////////////////////
00085 // Interface IComponentData
00086 ///////////////////////////////
00087 HRESULT CComponentData::Initialize(
00088                                    /* [in] */ LPUNKNOWN pUnknown)
00089 {
00090     HRESULT      hr;
00091
00092     //
00093     // Get pointer to name space interface
00094     //
00095     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00096     _ASSERT( S_OK == hr );
00097
00098     //
00099     // Get pointer to console interface
00100     //
00101     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00102     _ASSERT( S_OK == hr );
00103
00104     IImageList *pImageList;
00105     m_ipConsole->QueryScopeImageList(&pImageList);
00106     _ASSERT( S_OK == hr );
00107
00108     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00109         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00110         0, // index of the first image in the strip
00111         RGB(0, 128, 128)  // color of the icon mask
00112         );
00113
00114     pImageList->Release();
00115
00116     return S_OK;
00117 }
00118
00119 HRESULT CComponentData::CreateComponent(
00120                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00121 {
00122     *ppComponent = NULL;
00123
00124     CComponent *pComponent = new CComponent(this);
00125
00126     if (NULL == pComponent)
00127         return E_OUTOFMEMORY;
00128
00129     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00130 }
00131
00132 HRESULT CComponentData::Notify(
00133                                /* [in] */ LPDATAOBJECT lpDataObject,
00134                                /* [in] */ MMC_NOTIFY_TYPE event,
00135                                /* [in] */ LPARAM arg,
00136                                /* [in] */ LPARAM param)
00137 {
00138     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00139
00140     HRESULT hr = S_FALSE;
00141
00142   //Get our data object. If it is NULL, we return with S_FALSE.
00143   //See implementation of GetOurDataObject() to see how to
00144   //handle special data objects.
00145   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00146   if (NULL == pDataObject)
00147     return S_FALSE;
00148
00149   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00150
00151     switch (event)
00152     {
00153     case MMCN_EXPAND:
00154         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00155         break;
00156     }
00157
00158     return hr;
00159 }
00160
00161 HRESULT CComponentData::Destroy( void)
00162 {
00163     // Free interfaces
00164     if (m_ipConsoleNameSpace) {
00165         m_ipConsoleNameSpace->Release();
00166         m_ipConsoleNameSpace = NULL;
00167     }
00168
00169     if (m_ipConsole) {
00170         m_ipConsole->Release();
00171         m_ipConsole = NULL;
00172     }
00173
00174     return S_OK;
00175 }
00176
00177 HRESULT CComponentData::QueryDataObject(
00178                                         /* [in] */ MMC_COOKIE cookie,
00179                                         /* [in] */ DATA_OBJECT_TYPES type,
00180                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00181 {
00182     CDataObject *pObj = NULL;
00183
00184     if (cookie == 0)
00185         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00186     else
00187         pObj = new CDataObject(cookie, type);
00188
00189     if (!pObj)
00190         return E_OUTOFMEMORY;
00191
00192     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00193
00194     return S_OK;
00195 }
00196
00197 HRESULT CComponentData::GetDisplayInfo(
00198                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00199 {
00200     HRESULT hr = S_FALSE;
00201
00202     // if they are asking for the SDI_STR we have one of those to give
00203     if (pScopeDataItem->lParam) {
00204         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00205         if (pScopeDataItem->mask & SDI_STR) {
00206                         LPCTSTR pszT = base->GetDisplayName();
00207                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00208             pScopeDataItem->displayname = pszW;
00209         }
00210
00211         if (pScopeDataItem->mask & SDI_IMAGE) {
00212             pScopeDataItem->nImage = base->GetBitmapIndex();
00213         }
00214     }
00215
00216     return hr;
00217 }
00218
00219 HRESULT CComponentData::CompareObjects(
00220                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00221                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00222 {
00223     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00224     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00225
00226     // compare the object pointers
00227     if (baseA->GetCookie() == baseB->GetCookie())
00228         return S_OK;
00229
00230     return S_FALSE;
00231 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkHitTest::InkHitTest Member List

This is the complete list of members for InkHitTest::InkHitTest, including all inherited members.
activePen | InkHitTest::InkHitTest | [private]
blackPen | InkHitTest::InkHitTest | [private]
clearCheck() | InkHitTest::InkHitTest | [inline, private]
ClearItem | InkHitTest::InkHitTest | [private]
components | InkHitTest::InkHitTest | [private]
Dispose(bool disposing) | InkHitTest::InkHitTest | [inline, protected]
enterHitTestMode(object sender, System.EventArgs e) | InkHitTest::InkHitTest | [inline, private]
enterInkMode(object sender, System.EventArgs e) | InkHitTest::InkHitTest | [inline, private]
enterNearestPointMode(object sender, System.EventArgs e) | InkHitTest::InkHitTest | [inline, private]
FileItem | InkHitTest::InkHitTest | [private]
handleHitTest(System.Windows.Forms.MouseEventArgs e) | InkHitTest::InkHitTest | [inline, private]
handleNearestPoint(System.Windows.Forms.MouseEventArgs e) | InkHitTest::InkHitTest | [inline, private]
HitSize | InkHitTest::InkHitTest | [private]
HitTestItem | InkHitTest::InkHitTest | [private]
ic | InkHitTest::InkHitTest | [private]
InitializeComponent() | InkHitTest::InkHitTest | [inline, private]
InkHitTest() | InkHitTest::InkHitTest | [inline]
InkHitTest_Load(object sender, System.EventArgs e) | InkHitTest::InkHitTest | [inline, private]
InkHitTestForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e) | InkHitTest::InkHitTest | [inline, private]
InkItem | InkHitTest::InkHitTest | [private]
invalidateRect | InkHitTest::InkHitTest | [private]
Main() | InkHitTest::InkHitTest | [inline, private, static]
mainMenu1 | InkHitTest::InkHitTest | [private]
miExit | InkHitTest::InkHitTest | [private]
miExit_Click(object sender, System.EventArgs e) | InkHitTest::InkHitTest | [inline, private]
mode | InkHitTest::InkHitTest | [private]
ModeItem | InkHitTest::InkHitTest | [private]
NearestPointItem | InkHitTest::InkHitTest | [private]
nearestPt | InkHitTest::InkHitTest | [private]
onClearClick(object sender, System.EventArgs e) | InkHitTest::InkHitTest | [inline, private]
onMouseMove(object sender, System.Windows.Forms.MouseEventArgs e) | InkHitTest::InkHitTest | [inline, private]
penPt | InkHitTest::InkHitTest | [private]
redPen | InkHitTest::InkHitTest | [private]
Generated on Wed Nov 13 2024 16:58:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmDebug/CrmDebugCompensator.Cpp Source File

  • Com
  • Services
  • Crm
  • CrmDebug

CrmDebugCompensator.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: CrmDebugCompensator.cpp
00004
00005
00006
00007 Summary:
00008
00009   This is a sample CRM Compensator for the Compensating Resource Manager (CRM).
00010
00011   It can be used as a substitute for your own CRM Compensator while developing your CRM.
00012
00013   It simply outputs debug messages for all CRM Compensator notifications.
00014
00015   It implements both ICrmCompensator and ICrmCompensatorVariants.
00016
00017   This file is part of the Microsoft COM Technology Samples.
00018
00019
00020 Classes:
00021
00022   CCrmDebugCompensator
00023
00024
00025 ----------------------------------------------------------------------------
00026
00027 This file is part of the Microsoft COM+ Samples.
00028
00029
00030
00031 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00032
00033
00034
00035 This source code is intended only as a supplement to Microsoft
00036
00037 Development Tools and/or on-line documentation. See these other
00038
00039 materials for detailed information regarding Microsoft code samples.
00040
00041
00042
00043 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00044
00045 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00046
00047 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00048
00049 PARTICULAR PURPOSE.
00050
00051 ==========================================================================+*/
00052
00053 // CrmDebugCompensator.cpp : Implementation of CCrmDebugCompensator
00054
00055 #include "stdafx.h"
00056 #include "CrmDebug.h"
00057 #include "CrmDebugCompensator.h"
00058
00059
00060 /////////////////////////////////////////////////////////////////////////////
00061 // CCrmDebugCompensator
00062
00063
00064
00065
00066 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00067
00068 Method: CCrmDebugCompensator::InternalAddRef()
00069
00070 Summary: Internal AddRef, uncomment if you want to see InternalAddRef Trace
00071      messages.
00072
00073 Returns: ULONG
00074
00075
00076 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00077
00078
00079 /***** /
00080 ULONG CCrmDebugCompensator::InternalAddRef()
00081 {
00082   DWORD dwBefore = m_dwRef;
00083
00084   DWORD dwAfter = CComObjectRootEx<CComMultiThreadModel>::InternalAddRef();
00085
00086   ATLTRACE(_T("CCrmDebugCompensator::InternalAddRef, b = %d, a = %d\r\n"), dwBefore, dwAfter);
00087
00088   return (ULONG)dwAfter;
00089
00090 } // CCrmDebugCompensator::InternalAddRef
00091
00092
00093 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00094
00095 Method: CCrmDebugCompensator::InternalRelease()
00096
00097 Summary: Internal Release, uncomment if you want to see InternalRelease Trace
00098      messages.
00099
00100 Returns: ULONG
00101
00102 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00103
00104
00105 /***** /
00106 ULONG CCrmDebugCompensator::InternalRelease()
00107 {
00108   DWORD dwBefore = m_dwRef;
00109
00110   DWORD dwAfter = CComObjectRootEx<CComMultiThreadModel>::InternalRelease();
00111
00112   ATLTRACE(_T("CCrmDebugCompensator::InternalRelease, b = %d, a = %d\r\n"), dwBefore, dwAfter);
00113
00114   return (ULONG)dwAfter;
00115
00116 } // CCrmDebugCompensator::InternalRelease
00117
00118
00119 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00120
00121 Method: CCrmDebugCompensator::FinalConstruct()
00122
00123 Summary: Final construct
00124
00125 Returns: HRESULT
00126
00127 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00128
00129
00130 HRESULT CCrmDebugCompensator::FinalConstruct()
00131 {
00132   ATLTRACE(_T("CCrmDebugCompensator::FinalConstruct\n"));
00133
00134   return CoCreateFreeThreadedMarshaler(
00135     GetControllingUnknown(), &m_pUnkMarshaler.p);
00136
00137 } // CCrmDebugCompensator::FinalConstruct
00138
00139
00140 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00141
00142 Method: CCrmDebugCompensator::FinalRelease()
00143
00144 Summary: Final release
00145
00146 Returns: void
00147
00148 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00149
00150
00151 void CCrmDebugCompensator::FinalRelease()
00152 {
00153   ATLTRACE(_T("CCrmDebugCompensator::FinalRelease\n"));
00154
00155   m_pUnkMarshaler.Release();
00156
00157 } // CCrmDebugCompensator::FinalRelease
00158
00159 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00160
00161 Method: CCrmDebugCompensator::SetLogControl()
00162
00163 Summary: Display Trace message.
00164
00165      Delivers an ICrmLogControl Interface to the CRM Compensator so that
00166      it can write further log records during transaction completion.
00167
00168 Returns: HRESULT
00169
00170 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00171
00172 // ICrmCompensator
00173
00174 HRESULT CCrmDebugCompensator::SetLogControl(
00175     /* [in] */ ICrmLogControl __RPC_FAR *pLogControl)
00176 {
00177   ATLTRACE(_T("CCrmDebugCompensator::SetLogControl\n"));
00178
00179   _ASSERTE(pLogControl);
00180
00181   return S_OK;
00182
00183 } // CCrmDebugCompensator::SetLogControl
00184
00185
00186 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00187
00188 Method: CCrmDebugCompensator::BeginPrepare()
00189
00190 Summary: Display Trace message.
00191
00192      Notifies the CRM Compensator of the prepare phase of the transaction
00193      completion and that records are about to be delivered.
00194
00195 Returns: HRESULT
00196
00197 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00198
00199
00200 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::BeginPrepare(void)
00201 {
00202   ATLTRACE(_T("CCrmDebugCompensator::BeginPrepare\n"));
00203
00204   return S_OK;
00205
00206 } // CCrmDebugCompensator::BeginPrepare
00207
00208 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00209
00210 Method: CCrmDebugCompensator::PrepareRecord()
00211
00212 Summary: Display Trace message.
00213
00214      Delivers a log record in forward order during the prepare phase.
00215
00216 Returns: HRESULT
00217
00218 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00219
00220
00221 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::PrepareRecord(
00222     /* [in] */ CrmLogRecordRead crmLogRec,
00223     /* [retval][out] */ BOOL __RPC_FAR *pfForget)
00224 {
00225   ATLTRACE(_T("CCrmDebugCompensator::PrepareRecord\n"));
00226
00227   _ASSERTE(pfForget);
00228
00229   return S_OK;
00230
00231 } // CCrmDebugCompensator::PrepareRecord
00232
00233 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00234
00235 Method: CCrmDebugCompensator::EndPrepare()
00236
00237 Summary: Display Trace message.
00238
00239      Notifies the CRM Compensator that it has had all the log records
00240      available during the prepare phase.
00241
00242 Returns: HRESULT
00243
00244 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00245
00246
00247 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::EndPrepare(
00248     /* [retval][out] */ BOOL __RPC_FAR *pfOkToPrepare)
00249 {
00250   ATLTRACE(_T("CCrmDebugCompensator::EndPrepare\n"));
00251
00252   _ASSERTE(pfOkToPrepare);
00253
00254   *pfOkToPrepare = TRUE;
00255
00256   return S_OK;
00257
00258 } // CCrmDebugCompensator::EndPrepare
00259
00260 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00261
00262 Method: CCrmDebugCompensator::BeginCommit()
00263
00264 Summary: Display Trace message.
00265
00266      Notifies the CRM Compensator of the commit phase of the transaction
00267      completion and that records are about to be delivered.
00268
00269 Returns: HRESULT
00270
00271 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00272
00273
00274
00275 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::BeginCommit(
00276     /* [in] */ BOOL fRecovery)
00277 {
00278   ATLTRACE(_T("CCrmDebugCompensator::BeginCommit\n"));
00279
00280   return S_OK;
00281
00282 } // CCrmDebugCompensator::BeginCommit
00283
00284 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00285
00286 Method: CCrmDebugCompensator::CommitRecord()
00287
00288 Summary: Display Trace message.
00289
00290      Delivers a log record in forward order during the commit phase.
00291
00292 Returns: HRESULT
00293
00294 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00295
00296
00297
00298 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::CommitRecord(
00299     /* [in] */ CrmLogRecordRead crmLogRec,
00300     /* [retval][out] */ BOOL __RPC_FAR *pfForget)
00301 {
00302   ATLTRACE(_T("CCrmDebugCompensator::CommitRecord\n"));
00303
00304   _ASSERTE(pfForget);
00305
00306   return S_OK;
00307
00308 } // CCrmDebugCompensator::CommitRecord
00309
00310 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00311
00312 Method: CCrmDebugCompensator::EndCommit()
00313
00314 Summary: Display Trace message.
00315
00316      Notifies the CRM Compensator that it has delivered all the log
00317      records available during the commit phase.
00318
00319 Returns: HRESULT
00320
00321 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00322
00323
00324
00325 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::EndCommit(void)
00326 {
00327   ATLTRACE(_T("CCrmDebugCompensator::EndCommit\n"));
00328
00329   return S_OK;
00330
00331 } // CCrmDebugCompensator::EndCommit
00332
00333 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00334
00335 Method: CCrmDebugCompensator::BeginAbort()
00336
00337 Summary: Display Trace message.
00338
00339      Notifies the CRM Compensator of the abort phase of the transaction
00340      completion, and that records are about to be delivered.
00341
00342 Returns: HRESULT
00343
00344 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00345
00346
00347 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::BeginAbort(
00348     /* [in] */ BOOL fRecovery)
00349 {
00350   ATLTRACE(_T("CCrmDebugCompensator::BeginAbort\n"));
00351
00352   return S_OK;
00353
00354 } // CCrmDebugCompensator::BeginAbort
00355
00356
00357 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00358
00359 Method: CCrmDebugCompensator::AbortRecord()
00360
00361 Summary: Display Trace message.
00362
00363      Delivers a log record to the CRM Compensator during the abort phase.
00364
00365 Returns: HRESULT
00366
00367 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00368
00369
00370 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::AbortRecord(
00371     /* [in] */ CrmLogRecordRead crmLogRec,
00372     /* [retval][out] */ BOOL __RPC_FAR *pfForget)
00373 {
00374   ATLTRACE(_T("CCrmDebugCompensator::AbortRecord\n"));
00375
00376   _ASSERTE(pfForget);
00377
00378   return S_OK;
00379
00380 } // CCrmDebugCompensator::AbortRecord
00381
00382 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00383
00384 Method: CCrmDebugCompensator::EndAbort()
00385
00386 Summary: Display Trace message.
00387
00388      Notifies the CRM Compensator that it has received all the log
00389      records available during the abort phase.
00390
00391 Returns: HRESULT
00392
00393 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00394
00395
00396
00397 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::EndAbort(void)
00398 {
00399   ATLTRACE(_T("CCrmDebugCompensator::EndAbort\n"));
00400
00401   return S_OK;
00402
00403 } // CCrmDebugCompensator::EndAbort
00404
00405 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00406
00407 Method: CCrmDebugCompensator::SetLogControlVariants()
00408
00409 Summary: Display Trace message.
00410
00411      Delivers an ICrmLogControl interface to the CRM Compensator.
00412
00413 Returns: HRESULT
00414
00415 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00416
00417
00418
00419 // ICrmCompensatorVariants
00420
00421 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::SetLogControlVariants(
00422     /* [in] */ ICrmLogControl __RPC_FAR *pLogControl)
00423 {
00424   ATLTRACE(_T("CCrmDebugCompensator::SetLogControlVariants\n"));
00425
00426   _ASSERTE(pLogControl);
00427
00428   return S_OK;
00429
00430 } // CCrmDebugCompensator::SetLogControlVariants
00431
00432 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00433
00434 Method: CCrmDebugCompensator::BeginPrepareVariants()
00435
00436 Summary: Display Trace message.
00437
00438      Notifies the CRM Compensator of the prepare phase of the transaction
00439      completion and that records are about to be delivered.
00440
00441 Returns: HRESULT
00442
00443 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00444
00445
00446
00447 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::BeginPrepareVariants(void)
00448 {
00449   ATLTRACE(_T("CCrmDebugCompensator::BeginPrepareVariants\n"));
00450
00451   return S_OK;
00452
00453 } // CCrmDebugCompensator::BeginPrepareVariants
00454
00455 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00456
00457 Method: CCrmDebugCompensator::PrepareRecordVariants()
00458
00459 Summary: Display Trace message.
00460
00461      Delivers a log record to the CRM Compensator during the prepare phase.
00462
00463 Returns: HRESULT
00464
00465 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00466
00467
00468
00469 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::PrepareRecordVariants(
00470     /* [in] */ VARIANT __RPC_FAR *pLogRecord,
00471     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbForget)
00472 {
00473   ATLTRACE(_T("CCrmDebugCompensator::PrepareRecordVariants\n"));
00474
00475   _ASSERTE(pbForget);
00476
00477   return S_OK;
00478
00479 } // CCrmDebugCompensator::PrepareRecordVariants
00480
00481 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00482
00483 Method: CCrmDebugCompensator::EndPrepareVariants()
00484
00485 Summary: Display Trace message.
00486
00487      Notifies the CRM Compensator that it has had all the log records
00488      available during the prepare phase.
00489
00490 Returns: HRESULT
00491
00492 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00493
00494
00495
00496 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::EndPrepareVariants(
00497     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbOkToPrepare)
00498 {
00499   ATLTRACE(_T("CCrmDebugCompensator::EndPrepareVariants\n"));
00500
00501   _ASSERTE(pbOkToPrepare);
00502
00503   *pbOkToPrepare = VARIANT_TRUE;
00504
00505   return S_OK;
00506
00507 } // CCrmDebugCompensator::EndPrepareVariants
00508
00509 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00510
00511 Method: CCrmDebugCompensator::BeginCommitVariants()
00512
00513 Summary: Display Trace message.
00514
00515      Notifies the CRM Compensator of the commit phase (phase 2) of the
00516      transaction completion, and that records are about to be delivered.
00517
00518 Returns: HRESULT
00519
00520 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00521
00522
00523
00524 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::BeginCommitVariants(
00525     /* [in] */ VARIANT_BOOL bRecovery)
00526 {
00527   ATLTRACE(_T("CCrmDebugCompensator::BeginCommitVariants\n"));
00528
00529   return S_OK;
00530
00531 } // CCrmDebugCompensator::BeginCommitVariants
00532
00533 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00534
00535 Method: CCrmDebugCompensator::CommitRecordVariants()
00536
00537 Summary: Display Trace message.
00538
00539      Delivers a log record to the CRM Compensator during the commit phase.
00540
00541 Returns: HRESULT
00542
00543 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00544
00545
00546
00547 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::CommitRecordVariants(
00548     /* [in] */ VARIANT __RPC_FAR *pLogRecord,
00549     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbForget)
00550 {
00551   ATLTRACE(_T("CCrmDebugCompensator::CommitRecordVariants\n"));
00552
00553   _ASSERTE(pbForget);
00554
00555   return S_OK;
00556
00557 } // CCrmDebugCompensator::CommitRecordVariants
00558
00559 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00560
00561 Method: CCrmDebugCompensator::EndCommitVariants()
00562
00563 Summary: Display Trace message.
00564
00565      Notifies the CRM Compensator that it has delivered all the log
00566      records available during the commit phase.
00567
00568 Returns: HRESULT
00569
00570 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00571
00572
00573
00574 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::EndCommitVariants(void)
00575 {
00576   ATLTRACE(_T("CCrmDebugCompensator::EndCommitVariants\n"));
00577
00578   return S_OK;
00579
00580 } // CCrmDebugCompensator::EndCommitVariants
00581
00582 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00583
00584 Method: CCrmDebugCompensator::BeginAbortVariants()
00585
00586 Summary: Display Trace message.
00587
00588      Notifies the CRM Compensator of the abort phase of the transaction
00589      completion, and that records are about to be delivered.
00590
00591 Returns: HRESULT
00592
00593 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00594
00595
00596
00597 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::BeginAbortVariants(
00598     /* [in] */ VARIANT_BOOL bRecovery)
00599 {
00600   ATLTRACE(_T("CCrmDebugCompensator::BeginAbortVariants\n"));
00601
00602   return S_OK;
00603
00604 } // CCrmDebugCompensator::BeginAbortVariants
00605
00606 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00607
00608 Method: CCrmDebugCompensator::AbortRecordVariants()
00609
00610 Summary: Display Trace message.
00611
00612      Delivers a log record to the CRM Compensator during the abort phase.
00613
00614 Returns: HRESULT
00615
00616 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00617
00618
00619
00620 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::AbortRecordVariants(
00621     /* [in] */ VARIANT __RPC_FAR *pLogRecord,
00622     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbForget)
00623 {
00624   ATLTRACE(_T("CCrmDebugCompensator::AbortRecordVariants\n"));
00625
00626   _ASSERTE(pbForget);
00627
00628   return S_OK;
00629
00630 } // CCrmDebugCompensator::AbortRecordVariants
00631
00632 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00633
00634 Method: CCrmDebugCompensator::EndAbortVariants()
00635
00636 Summary: Display Trace message.
00637
00638      Notifies the CRM Compensator that it has received all the log
00639      records available during the abort phase.
00640
00641 Returns: HRESULT
00642
00643 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00644
00645
00646
00647 HRESULT STDMETHODCALLTYPE CCrmDebugCompensator::EndAbortVariants(void)
00648 {
00649   ATLTRACE(_T("CCrmDebugCompensator::EndAbortVariants\n"));
00650
00651   return S_OK;
00652
00653 } // CCrmDebugCompensator::EndAbortVariants
00654
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/util.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

util.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       util.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #ifndef _UTIL_H
00012 #define _UTIL_H
00013
00014 #define BYTE_OFFSET(base, offset) (((LPBYTE)base)+offset)
00015
00016 HRESULT SetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, LPCWSTR lpszValue);
00017
00018
00019 /////////////////////////////////////////////////////////////////////////////////
00020 /////////////////////////////////////////////////////////////////////////////////
00021 /////////////////////////////////////////////////////////////////////////////////
00022
00023 //
00024 // Forward Declaration
00025 //
00026 class CMultiValuedAttributeEditor;
00027
00028
00029 class CAttributeValueEditor : public CEdit
00030 {
00031 public:
00032   CAttributeValueEditor(CMultiValuedAttributeEditor* pEditor)
00033   {
00034     ASSERT(pEditor != NULL);
00035     m_pEditor = pEditor;
00036   }
00037
00038   ~CAttributeValueEditor() {}
00039
00040   afx_msg BOOL OnChange();
00041
00042 protected:
00043   CMultiValuedAttributeEditor* m_pEditor;
00044
00045   DECLARE_MESSAGE_MAP()
00046 };
00047
00048 /////////////////////////////////////////////////////////////////////////////////
00049
00050 class CMultiValuedListBox : public CListBox
00051 {
00052 public:
00053   CMultiValuedListBox(CMultiValuedAttributeEditor* pEditor)
00054   {
00055     ASSERT(pEditor != NULL);
00056     m_pEditor = pEditor;
00057   }
00058
00059   ~CMultiValuedListBox() {}
00060
00061   afx_msg BOOL OnSelChange();
00062
00063 protected:
00064   CMultiValuedAttributeEditor* m_pEditor;
00065
00066   DECLARE_MESSAGE_MAP()
00067 };
00068
00069 /////////////////////////////////////////////////////////////////////////////////
00070
00071 class CAttributeValueAddButton : public CButton
00072 {
00073 public:
00074   CAttributeValueAddButton(CMultiValuedAttributeEditor* pEditor)
00075   {
00076     ASSERT(pEditor != NULL);
00077     m_pEditor = pEditor;
00078   }
00079
00080   ~CAttributeValueAddButton() {}
00081
00082   afx_msg BOOL OnAdd();
00083
00084 protected:
00085   CMultiValuedAttributeEditor* m_pEditor;
00086
00087   DECLARE_MESSAGE_MAP()
00088 };
00089
00090 /////////////////////////////////////////////////////////////////////////////////
00091
00092 class CAttributeValueDeleteButton : public CButton
00093 {
00094 public:
00095   CAttributeValueDeleteButton(CMultiValuedAttributeEditor* pEditor)
00096   {
00097     ASSERT(pEditor != NULL);
00098     m_pEditor = pEditor;
00099   }
00100
00101   ~CAttributeValueDeleteButton() {}
00102
00103   afx_msg BOOL OnDelete();
00104
00105 protected:
00106   CMultiValuedAttributeEditor* m_pEditor;
00107
00108   DECLARE_MESSAGE_MAP()
00109 };
00110
00111 /////////////////////////////////////////////////////////////////////////////////
00112
00113 class CAttributeValueEditButton : public CButton
00114 {
00115 public:
00116   CAttributeValueEditButton(CMultiValuedAttributeEditor* pEditor)
00117   {
00118     ASSERT(pEditor != NULL);
00119     m_pEditor = pEditor;
00120   }
00121
00122   ~CAttributeValueEditButton() {}
00123
00124   afx_msg BOOL OnEdit();
00125
00126 protected:
00127   CMultiValuedAttributeEditor* m_pEditor;
00128
00129   DECLARE_MESSAGE_MAP()
00130 };
00131
00132 /////////////////////////////////////////////////////////////////////////////////
00133
00134 class CMultiValuedAttributeEditor
00135 {
00136 public:
00137   CMultiValuedAttributeEditor(CStringList& strrefAttributeList);
00138   ~CMultiValuedAttributeEditor() {}
00139
00140   BOOL Initialize(UINT nEditBox,
00141                   UINT nListBox,
00142                   UINT nAddButton,
00143                   UINT nDeleteButton,
00144                   CWnd* pParentWnd);
00145
00146   //
00147   // Redirected message handlers from subclassed controls
00148   //
00149   void OnEditChange();
00150   void OnValueSelChange();
00151   void OnAddValue();
00152   void OnDeleteValue();
00153
00154 private:
00155   CStringList& m_strrefAttributeList;
00156
00157   //
00158   // Controls to be subclassed
00159   //
00160   CAttributeValueEditor       m_ValueEditor;
00161   CMultiValuedListBox         m_ValueList;
00162   CAttributeValueAddButton    m_AddButton;
00163   CAttributeValueDeleteButton m_DeleteButton;
00164 };
00165 #endif // _UTIL_H
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/ShareMem.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll

ShareMem.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1995 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009     sharemem.c
00010
00011     shared memory functions used by both application and performance
00012     dlls
00013
00014 --*/
00015 //
00016 //  Include Files
00017 //
00018 #include <windows.h>
00019 #include <string.h>
00020 #include <winperf.h>
00021 #include "..\inc\appmemi.h"     // definitions shared with the app. dll
00022 #include "memctrs.h"            // error message definition
00023
00024 LONG
00025 _stdcall
00026 GetSharedMemoryDataHeader(
00027     IN  HANDLE              * phAppMemSharedMemory,
00028     IN  PAPPMEM_DATA_HEADER * pHeader,
00029     IN  BOOL                  bReadOnlyAccess
00030 )
00031 {
00032    LONG             Status, MemStatus;
00033    TCHAR            szMappedObject[] = SHARED_MEMORY_OBJECT_NAME;
00034    PAPPMEM_INSTANCE pLastItem;
00035    PAPPMEM_INSTANCE pAppData;
00036    DWORD            dwInstance;
00037
00038    SetLastError(ERROR_SUCCESS);   // just to clear it out
00039
00040    * phAppMemSharedMemory = CreateFileMapping(
00041                                               (HANDLE) INVALID_HANDLE_VALUE,
00042                                               NULL,                      // no security
00043                                               PAGE_READWRITE,            // to allow read & write access
00044                                               0,
00045                                               SHARED_MEMORY_OBJECT_SIZE, // file size
00046                                               szMappedObject);           // object name
00047
00048    MemStatus = GetLastError();    // to see if this is the first opening
00049
00050    // return error if unsuccessful
00051    if (* phAppMemSharedMemory == NULL)
00052    {
00053       Status = APPMEM_OPEN_FILE_MAPPING_ERROR;
00054       // this is fatal, if we can't get data then there's no
00055       // point in continuing.
00056    }
00057    else
00058    {
00059       if (MemStatus != ERROR_ALREADY_EXISTS)
00060       {
00061          // this is the first access to the file so initialize the
00062          // instance count
00063          * pHeader = (PAPPMEM_DATA_HEADER) MapViewOfFile(
00064                                                       * phAppMemSharedMemory,  // shared mem handle
00065                                                       FILE_MAP_WRITE,          // access desired
00066                                                       0,                       // starting offset
00067                                                       0,
00068                                                       0);                      // map the entire object
00069          if (* pHeader != NULL)
00070          {
00071             // if here, then pdwInstanceCount should be valid
00072             // so initialize the shared memory structure
00073             // clear memory block
00074             memset(* pHeader, 0, SHARED_MEMORY_OBJECT_SIZE);
00075
00076             // initialize application data header
00077             (* pHeader)->dwInstanceCount    = 0;    // no instances
00078             (* pHeader)->dwFirstInUseOffset = 0;    // no busy items yet
00079             (* pHeader)->dwFirstFreeOffset  = (DWORD) ((LPBYTE) & (* pHeader)[1] - (LPBYTE) * pHeader);
00080
00081             pLastItem = FIRST_FREE((* pHeader));
00082
00083             // set pointers in each item of block
00084             pAppData = pLastItem + 1;
00085             for (dwInstance = (SHARED_MEMORY_ITEM_COUNT - 1); dwInstance > 0; dwInstance --)
00086             {
00087                pLastItem->dwOffsetOfNext = (DWORD)((LPBYTE) pAppData - (LPBYTE)(* pHeader));
00088                pLastItem = pAppData;
00089                pAppData ++;
00090             }
00091             pAppData->dwOffsetOfNext = 0; // end of list
00092             Status = ERROR_SUCCESS;
00093          }
00094          else
00095          {
00096             Status = APPMEM_UNABLE_MAP_VIEW_OF_FILE;
00097          }
00098       }
00099       else
00100       {
00101          // the status is ERROR_ALREADY_EXISTS which is successful
00102          Status = ERROR_SUCCESS;
00103       }
00104       // see if Read Only access is required
00105       if (Status == ERROR_SUCCESS)
00106       {
00107          // by now the shared memory has already been initialized so
00108          // we if we don't need write access any more or if it has
00109          // already been opened, then open with the desired access
00110          * pHeader = (PAPPMEM_DATA_HEADER) MapViewOfFile(
00111                          * phAppMemSharedMemory,                             // shared mem handle
00112                          (bReadOnlyAccess ? FILE_MAP_READ : FILE_MAP_WRITE), // access desired
00113                          0,                                                  // starting offset
00114                          0,
00115                          0);                                                 // map the entire object
00116          if (* pHeader == NULL)
00117          {
00118             Status = APPMEM_UNABLE_MAP_VIEW_OF_FILE;
00119             // this is fatal, if we can't get data then there's no
00120             // point in continuing.
00121          }
00122          else
00123          {
00124             Status = ERROR_SUCCESS;
00125          }
00126       }
00127    }
00128    return Status;
00129 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStringException Member List

This is the complete list of members for CStringException, including all inherited members.
CStringException(CSZ cszError) | CStringException | [inline]
m_strError | CStringException | [private]
operator CSZ(VOID) | CStringException | [inline]
Generated on Wed Nov 13 2024 16:57:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/HiPerfProvider/BasicHiPerf.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • HiPerfProvider

BasicHiPerf.Cpp

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////
00002
00003 //
00004
00005 //  BasicHiPerf.cpp
00006
00007 //
00008
00009 //  Module: WMI high performance provider sample code
00010
00011 //
00012
00013 //  This is the skeleton code implementation of a high performance
00014
00015 //  provider.  This file includes the provider and refresher code.
00016
00017 //
00018
00019 //  History:
00020
00021 //
00022
00023 //
00024
00025 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00026 //
00027 ////////////////////////////////////////////////////////////////////////
00028 #define _UNICODE
00029 #define UNICODE
00030
00031 #define STRSAFE_NO_DEPRECATE
00032
00033 #define _WIN32_WINNT 0x0500
00034
00035
00036 #include <windows.h>
00037 #include <stdio.h>
00038 #include <process.h>
00039 #include <strsafe.h>
00040 #include <objbase.h>
00041
00042 #include "BasicHiPerf.h"
00043
00044
00045 //////////////////////////////////////////////////////////////
00046 //
00047 //
00048 //  Global, external and static variables
00049 //
00050 //
00051 //////////////////////////////////////////////////////////////
00052
00053 // This structure quickly defines the properties and types of
00054 // the counters.  It is used for simplicity; actual providers
00055 // should enumerate the property names and types
00056 // ==========================================================
00057
00058 struct tagProperties
00059 {
00060   _TCHAR  m_tcsPropertyName[128];
00061   DWORD m_dwType;
00062 } g_aCounterProps[] =
00063 {
00064   _T("Counter1"), PROP_DWORD,
00065   _T("Counter2"), PROP_DWORD,
00066   _T("Counter3"), PROP_DWORD,
00067   _T("Counter4"), PROP_DWORD,
00068   _T("Counter5"), PROP_DWORD
00069 };
00070
00071 // The access handle for the object's ID
00072 // =====================================
00073
00074 long g_hID;
00075
00076 // The COM object counter (declared in server.cpp)
00077 // ===============================================
00078
00079 extern long g_lObjects;
00080
00081 // The mock data source (declared as static in CHiPerfProvider)
00082 // ============================================================
00083
00084 CSampleDataSource* CHiPerfProvider::m_pSampleDS = NULL;
00085
00086 // The unique ID generator in CCacheMap - values from 0 to
00087 // (MAX_ENUMERATORS - 1) are reserved for the enumerators
00088 // =======================================================
00089
00090 long CCacheMapEl::m_lGenID = MAX_ENUMERATORS;
00091
00092
00093 //////////////////////////////////////////////////////////////
00094 //
00095 //
00096 //  Helper Functions
00097 //
00098 //
00099 //////////////////////////////////////////////////////////////
00100
00101 HRESULT CloneAccess(IWbemObjectAccess* pOriginal, IWbemObjectAccess** ppClone)
00102 //////////////////////////////////////////////////////////////
00103 //
00104 //  Returns a IWbemObjectAccess clone of an IWbemObjectAccess
00105 //  object.
00106 //
00107 //  Parameters:
00108 //    pOriginal - the original object
00109 //    ppClone   - the cloned object
00110 //
00111 //////////////////////////////////////////////////////////////
00112 //ok
00113 {
00114   HRESULT hRes = WBEM_NO_ERROR;
00115
00116   IWbemClassObject* pOurClassObj = NULL;
00117   IWbemClassObject* pClonedClassObj = NULL;
00118   IWbemObjectAccess*  pClonedAccessObj = NULL;
00119
00120   // Get the IWbemClassObject interface for the object
00121   // =================================================
00122
00123   hRes = pOriginal->QueryInterface(IID_IWbemClassObject, (PVOID*)&pOurClassObj);
00124   if (FAILED(hRes))
00125     return hRes;
00126
00127   // Clone the object
00128   // ================
00129
00130   hRes = pOurClassObj->Clone(&pClonedClassObj);
00131   pOurClassObj->Release();
00132   if (FAILED(hRes))
00133     return hRes;
00134
00135   // Get the IWbemObjectAccess interface for the cloned object
00136   // =========================================================
00137
00138   hRes = pClonedClassObj->QueryInterface(IID_IWbemObjectAccess, (PVOID*)&pClonedAccessObj);
00139   pClonedClassObj->Release();
00140   if (FAILED(hRes))
00141     return hRes;
00142
00143   // Copy the cloned object into the returned parameter (refcount == 1)
00144   // ==================================================================
00145
00146   *ppClone = pClonedAccessObj;
00147
00148   return WBEM_NO_ERROR;
00149 }
00150
00151
00152
00153
00154 //////////////////////////////////////////////////////////////
00155 //
00156 //  Name: GetCurrentImpersonationLevel
00157 //
00158 //
00159 //  Description:
00160 //
00161 //      Get COM impersonation level of caller.
00162 //
00163 //////////////////////////////////////////////////////////////
00164
00165 DWORD GetCurrentImpersonationLevel ()
00166 {
00167   DWORD t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00168
00169     HANDLE t_ThreadToken = NULL ;
00170
00171     BOOL t_Status = OpenThreadToken (
00172
00173     GetCurrentThread() ,
00174     TOKEN_QUERY,
00175     TRUE,
00176     &t_ThreadToken
00177   ) ;
00178
00179     if ( t_Status )
00180     {
00181     SECURITY_IMPERSONATION_LEVEL t_Level = SecurityAnonymous ;
00182     DWORD t_Returned = 0 ;
00183
00184     t_Status = GetTokenInformation (
00185
00186       t_ThreadToken ,
00187       TokenImpersonationLevel ,
00188       & t_Level ,
00189       sizeof ( SECURITY_IMPERSONATION_LEVEL ) ,
00190       & t_Returned
00191     ) ;
00192
00193     CloseHandle ( t_ThreadToken ) ;
00194
00195     if ( t_Status == FALSE )
00196     {
00197       t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00198     }
00199     else
00200     {
00201       switch ( t_Level )
00202       {
00203         case SecurityAnonymous:
00204         {
00205           t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00206         }
00207         break ;
00208
00209         case SecurityIdentification:
00210         {
00211           t_ImpersonationLevel = RPC_C_IMP_LEVEL_IDENTIFY ;
00212         }
00213         break ;
00214
00215         case SecurityImpersonation:
00216         {
00217           t_ImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE ;
00218         }
00219         break ;
00220
00221         case SecurityDelegation:
00222         {
00223           t_ImpersonationLevel = RPC_C_IMP_LEVEL_DELEGATE ;
00224         }
00225         break ;
00226
00227         default:
00228         {
00229           t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00230         }
00231         break ;
00232       }
00233     }
00234   }
00235   else
00236   {
00237         ULONG t_LastError = GetLastError () ;
00238
00239         if ( t_LastError == ERROR_NO_IMPERSONATION_TOKEN || t_LastError == ERROR_NO_TOKEN )
00240         {
00241             t_ImpersonationLevel = RPC_C_IMP_LEVEL_DELEGATE ;
00242         }
00243         else
00244     {
00245       if ( t_LastError == ERROR_CANT_OPEN_ANONYMOUS )
00246       {
00247         t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00248       }
00249       else
00250       {
00251         t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00252       }
00253     }
00254     }
00255
00256   return t_ImpersonationLevel ;
00257 }
00258
00259
00260
00261 //////////////////////////////////////////////////////////////
00262 //
00263 //
00264 //  CHiPerfProvider
00265 //
00266 //
00267 //////////////////////////////////////////////////////////////
00268
00269 CHiPerfProvider::CHiPerfProvider() : m_lRef(0), m_pTemplate(NULL)
00270 //////////////////////////////////////////////////////////////
00271 //
00272 //  Constructor
00273 //
00274 //////////////////////////////////////////////////////////////
00275 //ok
00276 {
00277   // Increment the global COM object counter
00278   // =======================================
00279
00280   InterlockedIncrement(&g_lObjects);
00281 }
00282
00283 CHiPerfProvider::~CHiPerfProvider()
00284 //////////////////////////////////////////////////////////////
00285 //
00286 //  Destructor
00287 //
00288 //////////////////////////////////////////////////////////////
00289 //ok
00290 {
00291   long lObjCount = 0;
00292
00293     // Release the template
00294   // ====================
00295
00296   if (NULL != m_pTemplate)
00297             m_pTemplate->Release();
00298
00299   // Decrement the global COM object counter
00300   // =======================================
00301
00302   lObjCount = InterlockedDecrement(&g_lObjects);
00303
00304   // If this is the last object, delete our data source
00305   // ==================================================
00306
00307   if ((0 == lObjCount) && (NULL != m_pSampleDS))
00308   {
00309     delete m_pSampleDS;
00310     m_pSampleDS = NULL;
00311   }
00312 }
00313
00314 //////////////////////////////////////////////////////////////
00315 //
00316 //          COM methods
00317 //
00318 //////////////////////////////////////////////////////////////
00319
00320 STDMETHODIMP CHiPerfProvider::QueryInterface(REFIID riid, void** ppv)
00321 //////////////////////////////////////////////////////////////
00322 //
00323 //  Standard QueryInterface
00324 //
00325 //  Parameters:
00326 //    riid  - the ID of the requested interface
00327 //    ppv   - a pointer to the interface pointer
00328 //
00329 //////////////////////////////////////////////////////////////
00330 //ok
00331 {
00332     if(riid == IID_IUnknown)
00333         *ppv = (LPVOID)(IUnknown*)(IWbemProviderInit*)this;
00334     else if(riid == IID_IWbemProviderInit)
00335         *ppv = (LPVOID)(IWbemProviderInit*)this;
00336   else if (riid == IID_IWbemHiPerfProvider)
00337     *ppv = (LPVOID)(IWbemHiPerfProvider*)this;
00338   else return E_NOINTERFACE;
00339
00340   ((IUnknown*)*ppv)->AddRef();
00341   return WBEM_NO_ERROR;
00342 }
00343
00344 STDMETHODIMP_(ULONG) CHiPerfProvider::AddRef()
00345 //////////////////////////////////////////////////////////////
00346 //
00347 //  Standard COM AddRef
00348 //
00349 //////////////////////////////////////////////////////////////
00350 //ok
00351 {
00352     return InterlockedIncrement(&m_lRef);
00353 }
00354
00355 STDMETHODIMP_(ULONG) CHiPerfProvider::Release()
00356 //////////////////////////////////////////////////////////////
00357 //
00358 //  Standard COM Release
00359 //
00360 //////////////////////////////////////////////////////////////
00361 //ok
00362 {
00363     long lRef = InterlockedDecrement(&m_lRef);
00364     if(lRef == 0)
00365         delete this;
00366
00367     return lRef;
00368 }
00369
00370 STDMETHODIMP CHiPerfProvider::Initialize(
00371     /* [unique][in] */  LPWSTR wszUser,
00372     /* [in] */          long lFlags,
00373     /* [in] */          LPWSTR wszNamespace,
00374     /* [unique][in] */  LPWSTR wszLocale,
00375     /* [in] */          IWbemServices __RPC_FAR *pNamespace,
00376     /* [in] */          IWbemContext __RPC_FAR *pCtx,
00377     /* [in] */          IWbemProviderInitSink __RPC_FAR *pInitSink)
00378 //////////////////////////////////////////////////////////////////////
00379 //
00380 //  Called once during startup for any one-time initialization.  The
00381 //  final call to Release() is for any cleanup.
00382 //
00383 //  The parameters indicate to the provider which namespace it is being
00384 //  invoked for and which User.  It also supplies a back pointer to
00385 //  WINMGMT so that class definitions can be retrieved.
00386 //
00387 //  Initialize will create a single template object that can be used
00388 //  by the provider to spawn instances for QueryInstances.  It will
00389 //  also initialize our mock data source and set the global ID access
00390 //  handle.
00391 //
00392 //  Parameters:
00393 //    wszUser     - The current user.
00394 //    lFlags      - Reserved.
00395 //    wszNamespace  - The namespace for which we are being activated.
00396 //    wszLocale   - The locale under which we are to be running.
00397 //    pNamespace    - An active pointer back into the current namespace
00398 //              from which we can retrieve schema objects.
00399 //    pCtx      - The user's context object.  We simply reuse this
00400 //              during any reentrant operations into WINMGMT.
00401 //    pInitSink   - The sink to which we indicate our readiness.
00402 //
00403 //////////////////////////////////////////////////////////////////////
00404 //ok
00405 {
00406   HRESULT hRes = WBEM_NO_ERROR;
00407
00408     IWbemObjectAccess *pAccess = NULL;
00409   BSTR strObject = NULL;
00410   BSTR strPropName = NULL;
00411
00412   if (wszNamespace == 0 || pNamespace == 0 || pInitSink == 0)
00413   {
00414       pInitSink->SetStatus(WBEM_E_FAILED , 0);
00415       return WBEM_NO_ERROR;
00416   }
00417
00418     // Get a sample class object for initialization purposes
00419   // =====================================================
00420
00421   strObject = SysAllocString(SAMPLE_CLASS);
00422   if (strObject == NULL)
00423   {
00424       pInitSink->SetStatus(WBEM_E_OUT_OF_MEMORY , 0);
00425       return WBEM_NO_ERROR;
00426   }
00427
00428   hRes = pNamespace->GetObject(strObject, 0, pCtx, &m_pTemplate, 0);
00429
00430   SysFreeString(strObject);
00431
00432     if (FAILED(hRes))
00433   {
00434       pInitSink->SetStatus(WBEM_E_FAILED , 0);
00435       return WBEM_NO_ERROR;
00436   }
00437
00438
00439   // Initialize the datasource.  If the static member
00440   // is not null, then it has already been setup.
00441   // ================================================
00442
00443   if (NULL == m_pSampleDS)
00444   {
00445     m_pSampleDS = new CSampleDataSource;
00446
00447     if (NULL == m_pSampleDS)
00448     {
00449       pInitSink->SetStatus(WBEM_E_FAILED , 0);
00450       return WBEM_NO_ERROR;
00451     }
00452
00453     m_pSampleDS->Initialize(m_pTemplate);
00454   }
00455
00456   // Initialize the global access handle for the object ID.
00457   // If it is not null, then it has already been setup.
00458   // ======================================================
00459
00460   if (NULL == g_hID)
00461   {
00462     // Get the IWbemObjectAccess interface to the object
00463     // =================================================
00464
00465     hRes = m_pTemplate->QueryInterface(IID_IWbemObjectAccess, (PVOID*)&pAccess);
00466
00467     if (FAILED(hRes))
00468       return hRes;
00469
00470     // Get the name property access handle
00471     // ===================================
00472
00473     strPropName = SysAllocString(L"Name");
00474     if (strPropName == NULL)
00475     {
00476       pInitSink->SetStatus(WBEM_E_OUT_OF_MEMORY , 0);
00477       return WBEM_NO_ERROR;
00478     }
00479
00480     hRes = pAccess->GetPropertyHandle(strPropName, 0, &g_hID);
00481
00482     pAccess->Release();
00483     SysFreeString(strPropName);
00484
00485     if (FAILED(hRes))
00486     {
00487       pInitSink->SetStatus(WBEM_E_FAILED , 0);
00488       return WBEM_NO_ERROR;
00489     }
00490 }
00491
00492     // We now have all the instances ready to go and the name handle
00493   // stored.  Tell WINMGMT that we're ready to start 'providing'
00494   // =============================================================
00495
00496     pInitSink->SetStatus(WBEM_S_INITIALIZED, 0);
00497
00498     return WBEM_NO_ERROR;
00499 }
00500
00501 STDMETHODIMP CHiPerfProvider::QueryInstances(
00502     /* [in] */          IWbemServices __RPC_FAR *pNamespace,
00503     /* [string][in] */  WCHAR __RPC_FAR *wszClass,
00504     /* [in] */          long lFlags,
00505     /* [in] */          IWbemContext __RPC_FAR *pCtx,
00506     /* [in] */          IWbemObjectSink __RPC_FAR *pSink )
00507 //////////////////////////////////////////////////////////////////////
00508 //
00509 //  Called whenever a complete, fresh list of instances for a given
00510 //  class is required.   The objects are constructed and sent back to the
00511 //  caller through the sink.  The sink can be used in-line as here, or
00512 //  the call can return and a separate thread could be used to deliver
00513 //  the instances to the sink.
00514 //
00515 //  Parameters:
00516 //    pNamespace    - A pointer to the relevant namespace.  This
00517 //              should not be AddRef'ed.
00518 //    wszClass    - The class name for which instances are required.
00519 //    lFlags      - Reserved.
00520 //    pCtx      - The user-supplied context (not used here).
00521 //    pSink     - The sink to which to deliver the objects.  The objects
00522 //              can be delivered synchronously through the duration
00523 //              of this call or asynchronously (assuming we
00524 //              had a separate thread).  A IWbemObjectSink::SetStatus
00525 //              call is required at the end of the sequence.
00526 //
00527 //////////////////////////////////////////////////////////////////////
00528 //ok
00529 {
00530   HRESULT hRes = WBEM_NO_ERROR;
00531
00532   //Impersonate the client
00533   hRes = CoImpersonateClient () ;
00534   if ( FAILED ( hRes ) && hRes != RPC_E_CALL_COMPLETE)
00535   {
00536     return hRes ;
00537   }
00538
00539   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
00540   //  the provider will not be able to impersonate the client to access the protected resources.
00541
00542   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
00543   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
00544   {
00545     //  Revert before we perform any operations
00546     CoRevertToSelf () ;
00547
00548     hRes = WBEM_E_ACCESS_DENIED;
00549     return hRes ;
00550   }
00551
00552   IWbemClassObject* pObjectCopy = NULL;
00553   IWbemObjectAccess*  pAccessCopy = NULL;
00554
00555     if (pNamespace == 0 || wszClass == 0 || pSink == 0)
00556         return WBEM_E_INVALID_PARAMETER;
00557
00558   // Loop through all instances, indicating an updated version
00559   // to the object sink
00560   // =========================================================
00561
00562     for (int i = 0; i < NUM_INSTANCES; i++)
00563     {
00564     // Create a new instance from the template
00565     // =======================================
00566
00567     hRes = m_pTemplate->SpawnInstance(0, &pObjectCopy);
00568     if (FAILED(hRes))
00569       break;
00570
00571     // Obtain the IWbemObjectAccess interface
00572     // ======================================
00573
00574     hRes = pObjectCopy->QueryInterface(IID_IWbemObjectAccess, (PVOID*)&pAccessCopy);
00575     if (FAILED(hRes))
00576     {
00577       pObjectCopy->Release();
00578       break;
00579     }
00580
00581     // Set the ID
00582     // ==========
00583
00584     WCHAR wszName[20];
00585     StringCbPrintfW(wszName, sizeof(wszName), L"%i", i);
00586
00587     pAccessCopy->WritePropertyValue(g_hID, (long)(wcslen(wszName)+1)*sizeof(WCHAR), (byte *)wszName);
00588
00589     // Initialize the counters
00590     // =======================
00591
00592     hRes = m_pSampleDS->UpdateInstance(pAccessCopy);
00593
00594     // Release the IWbemObjectAccess handle (values are maintained in IWbemClassObject interface)
00595     // ==========================================================================================
00596
00597     pAccessCopy->Release();
00598
00599     if (FAILED(hRes))
00600     {
00601       pObjectCopy->Release();
00602       break;
00603     }
00604
00605         // Send a copy back to the caller
00606     // ==============================
00607
00608         pSink->Indicate(1, &pObjectCopy);
00609
00610         pObjectCopy->Release();    // Don't need this any more
00611     }
00612
00613     // Tell WINMGMT we are all finished supplying objects
00614   // ==================================================
00615
00616     pSink->SetStatus(0, WBEM_NO_ERROR, 0, 0);
00617
00618     return WBEM_NO_ERROR;
00619 }
00620
00621 STDMETHODIMP CHiPerfProvider::CreateRefresher(
00622      /* [in] */ IWbemServices __RPC_FAR *pNamespace,
00623      /* [in] */ long lFlags,
00624      /* [out] */ IWbemRefresher __RPC_FAR *__RPC_FAR *ppRefresher )
00625 //////////////////////////////////////////////////////////////////////
00626 //
00627 //  Called whenever a new refresher is needed by the client.
00628 //
00629 //  Parameters:
00630 //    pNamespace    - A pointer to the relevant namespace.  Not used.
00631 //    lFlags      - Reserved.
00632 //    ppRefresher   - Receives the requested refresher.
00633 //
00634 //////////////////////////////////////////////////////////////////////
00635 //ok
00636 {
00637   //Impersonate the client
00638   HRESULT hRes = CoImpersonateClient () ;
00639   if ( FAILED ( hRes ) && hRes != RPC_E_CALL_COMPLETE)
00640   {
00641     return hRes ;
00642   }
00643
00644   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
00645   //  the provider will not be able to impersonate the client to access the protected resources.
00646
00647   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
00648   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
00649   {
00650     //  Revert before we perform any operations
00651     CoRevertToSelf () ;
00652
00653     hRes = WBEM_E_ACCESS_DENIED;
00654     return hRes ;
00655   }
00656
00657     if (pNamespace == 0 || ppRefresher == 0)
00658         return WBEM_E_INVALID_PARAMETER;
00659
00660     // Construct and initialize a new empty refresher
00661   // ==============================================
00662
00663   CRefresher* pNewRefresher = new CRefresher(this, m_pSampleDS);
00664   if (pNewRefresher == NULL)
00665     return WBEM_E_OUT_OF_MEMORY;
00666
00667   pNewRefresher->Initialize(m_pTemplate);
00668
00669     // Follow COM rules and AddRef() the thing before sending it back
00670   // ==============================================================
00671
00672     pNewRefresher->AddRef();
00673     *ppRefresher = pNewRefresher;
00674
00675     return WBEM_NO_ERROR;
00676 }
00677
00678 STDMETHODIMP CHiPerfProvider::CreateRefreshableObject(
00679     /* [in] */ IWbemServices __RPC_FAR *pNamespace,
00680     /* [in] */ IWbemObjectAccess __RPC_FAR *pTemplate,
00681     /* [in] */ IWbemRefresher __RPC_FAR *pRefresher,
00682     /* [in] */ long lFlags,
00683     /* [in] */ IWbemContext __RPC_FAR *pContext,
00684     /* [out] */ IWbemObjectAccess __RPC_FAR *__RPC_FAR *ppRefreshable,
00685     /* [out] */ long __RPC_FAR *plId )
00686 //////////////////////////////////////////////////////////////////////
00687 //
00688 //  Called whenever a user wants to include an object in a refresher.
00689 //
00690 //  Note that the object returned in ppRefreshable is a clone of the
00691 //  actual instance maintained by the provider.  If refreshers shared
00692 //  a copy of the same instance, then a refresh call on one of the
00693 //  refreshers would impact the state of both refreshers.  This would
00694 //  break the refresher rules.  Instances in a refresher are only
00695 //  allowed to be updated when 'Refresh' is called.
00696 //
00697 //  Parameters:
00698 //    pNamespace    - A pointer to the relevant namespace in WINMGMT.
00699 //    pTemplate   - A pointer to a copy of the object which is to be
00700 //              added.  This object itself cannot be used, as
00701 //              it not owned locally.
00702 //    pRefresher    - The refresher to which to add the object.
00703 //    lFlags      - Not used.
00704 //    pContext    - Not used here.
00705 //    ppRefreshable - A pointer to the internal object which was added
00706 //              to the refresher.
00707 //    plId      - The Object Id (for identification during removal).
00708 //
00709 //////////////////////////////////////////////////////////////////////
00710 //ok
00711 {
00712
00713   HRESULT hRes = WBEM_NO_ERROR;
00714
00715   //Impersonate the client
00716   hRes = CoImpersonateClient () ;
00717   if ( FAILED ( hRes ) && hRes != RPC_E_CALL_COMPLETE)
00718   {
00719     return hRes ;
00720   }
00721
00722   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
00723   //  the provider will not be able to impersonate the client to access the protected resources.
00724
00725   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
00726   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
00727   {
00728     //  Revert before we perform any operations
00729     CoRevertToSelf () ;
00730
00731     hRes = WBEM_E_ACCESS_DENIED;
00732     return hRes ;
00733   }
00734
00735  // Find out which instance is being requested for addition
00736   // =======================================================
00737
00738     if (pNamespace == 0 || pTemplate == 0 || pRefresher == 0)
00739         return WBEM_E_INVALID_PARAMETER;
00740
00741     // The refresher being supplied by the caller is actually
00742     // one of our own refreshers, so a simple cast is convenient
00743     // so that we can access private members.
00744   // =========================================================
00745
00746   CRefresher *pOurRefresher = (CRefresher *) pRefresher;
00747
00748   // Add the object to the refresher. The ID is set by AddObject
00749   // ===========================================================
00750
00751     hRes = pOurRefresher->AddObject(pTemplate, ppRefreshable, plId);
00752
00753   if (FAILED(hRes))
00754     return hRes;
00755
00756     return WBEM_NO_ERROR;
00757 }
00758
00759 STDMETHODIMP CHiPerfProvider::CreateRefreshableEnum(
00760   /* [in] */ IWbemServices* pNamespace,
00761   /* [in, string] */ LPCWSTR wszClass,
00762   /* [in] */ IWbemRefresher* pRefresher,
00763   /* [in] */ long lFlags,
00764   /* [in] */ IWbemContext* pContext,
00765   /* [in] */ IWbemHiPerfEnum* pHiPerfEnum,
00766   /* [out] */ long* plId )
00767 //////////////////////////////////////////////////////////////////////
00768 //
00769 //  Called when an enumerator is being added to a refresher.  The
00770 //  enumerator will obtain a fresh set of instances of the specified
00771 //  class every time that refresh is called.
00772 //
00773 //  Since this example provider only provides one class, then any
00774 //  enumerator in this refresher will only return instances from this
00775 //  class.  In the case where there is more than one class, then
00776 //  wszClass must be examined to determine which class the enumerator
00777 //  is being assigned.
00778 //
00779 //  Parameters:
00780 //    pNamespace    - A pointer to the relevant namespace.
00781 //    wszClass    - The class name for the requested enumerator.
00782 //    pRefresher    - The refresher object for which we will add
00783 //              the enumerator
00784 //    lFlags      - Reserved.
00785 //    pContext    - Not used here.
00786 //    pHiPerfEnum   - The enumerator to add to the refresher.
00787 //    plId      - A provider specified ID for the enumerator.
00788 //
00789 //////////////////////////////////////////////////////////////////////
00790 //ok
00791 {
00792
00793   //Impersonate the client
00794   HRESULT hr = CoImpersonateClient () ;
00795   if ( FAILED ( hr ) && hr != RPC_E_CALL_COMPLETE)
00796   {
00797     return hr ;
00798   }
00799
00800   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
00801   //  the provider will not be able to impersonate the client to access the protected resources.
00802
00803   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
00804   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
00805   {
00806     //  Revert before we perform any operations
00807     CoRevertToSelf () ;
00808
00809     hr = WBEM_E_ACCESS_DENIED;
00810     return hr ;
00811   }
00812
00813     // The refresher being supplied by the caller is actually
00814     // one of our own refreshers, so a simple cast is convenient
00815     // so that we can access private members.
00816
00817   CRefresher *pOurRefresher = (CRefresher *) pRefresher;
00818
00819   // Add the enumerator to the refresher
00820   // The ID is generated by AddEnum.
00821   // ===================================
00822
00823   hr = pOurRefresher->AddEnum(pHiPerfEnum, plId);
00824   return hr;
00825 }
00826
00827 STDMETHODIMP CHiPerfProvider::StopRefreshing(
00828     /* [in] */ IWbemRefresher __RPC_FAR *pRefresher,
00829     /* [in] */ long lId,
00830     /* [in] */ long lFlags )
00831 //////////////////////////////////////////////////////////////////////
00832 //
00833 //  Called whenever a user wants to remove an object from a refresher.
00834 //
00835 //  Parameters:
00836 //    pRefresher      - The refresher object from which we are to
00837 //                remove the perf object.
00838 //    lId         - The ID of the object.
00839 //    lFlags        - Not used.
00840 //
00841 //////////////////////////////////////////////////////////////////////
00842 //ok
00843 {
00844   HRESULT hRes = WBEM_NO_ERROR;
00845
00846   //Impersonate the client
00847   hRes = CoImpersonateClient () ;
00848   if ( FAILED ( hRes ) && hRes != RPC_E_CALL_COMPLETE)
00849   {
00850     return hRes ;
00851   }
00852
00853   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
00854   //  the provider will not be able to impersonate the client to access the protected resources.
00855
00856   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
00857   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
00858   {
00859     //  Revert before we perform any operations
00860     CoRevertToSelf () ;
00861
00862     hRes = WBEM_E_ACCESS_DENIED;
00863     return hRes ;
00864   }
00865
00866     // The refresher being supplied by the caller is actually
00867     // one of our own refreshers, so a simple cast is convenient
00868     // so that we can access private members.
00869   // =========================================================
00870
00871     CRefresher *pOurRefresher = (CRefresher *) pRefresher;
00872
00873   // An ID that is less than MAX_ENUMERATORS is an enumerator ID.
00874   // Everything else is an object ID
00875   // ============================================================
00876
00877   if (lId < MAX_ENUMERATORS)
00878     hRes = pOurRefresher->RemoveEnum(lId);
00879   else
00880     hRes = pOurRefresher->RemoveObject(lId);
00881
00882   return hRes;
00883 }
00884
00885 STDMETHODIMP CHiPerfProvider::GetObjects(
00886     /* [in] */ IWbemServices* pNamespace,
00887   /* [in] */ long lNumObjects,
00888   /* [in,size_is(lNumObjects)] */ IWbemObjectAccess** apObj,
00889     /* [in] */ long lFlags,
00890     /* [in] */ IWbemContext* pContext)
00891 //////////////////////////////////////////////////////////////////////
00892 //
00893 //  Called when a request is made to provide all instances currently
00894 //  being managed by the provider in the specified namespace.
00895 //
00896 //  Parameters:
00897 //    pNamespace    - A pointer to the relevant namespace.
00898 //    lNumObjects   - The number of instances being returned.
00899 //    apObj     - The array of instances being returned.
00900 //    lFlags      - Reserved.
00901 //    pContext    - Not used here.
00902 //
00903 //////////////////////////////////////////////////////////////////////
00904 //ok
00905 {
00906   HRESULT hRes = WBEM_NO_ERROR;
00907
00908   //Impersonate the client
00909   hRes = CoImpersonateClient () ;
00910   if ( FAILED ( hRes ) && hRes != RPC_E_CALL_COMPLETE)
00911   {
00912     return hRes ;
00913   }
00914
00915   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
00916   //  the provider will not be able to impersonate the client to access the protected resources.
00917
00918   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
00919   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
00920   {
00921     //  Revert before we perform any operations
00922     CoRevertToSelf () ;
00923
00924     hRes = WBEM_E_ACCESS_DENIED;
00925     return hRes ;
00926   }
00927
00928   int nIndex = 0;
00929   DWORD dwID = 0;
00930
00931   IWbemObjectAccess*  pCurrObj;
00932
00933   // Cycle through the list of objects, updating each one
00934   // ====================================================
00935
00936   for (nIndex = 0; nIndex < lNumObjects; nIndex++)
00937   {
00938     pCurrObj = apObj[nIndex];
00939
00940     hRes = m_pSampleDS->UpdateInstance(pCurrObj);
00941     if (FAILED(hRes))
00942       break;
00943   }
00944
00945   return hRes;
00946 }
00947
00948
00949 //////////////////////////////////////////////////////////////
00950 //
00951 //
00952 //  CRefresher
00953 //
00954 //
00955 //////////////////////////////////////////////////////////////
00956
00957 CRefresher::CRefresher(CHiPerfProvider* pProvider, CSampleDataSource* pDS) : m_lRef(0), m_pDS(pDS)
00958 //////////////////////////////////////////////////////////////////////
00959 //
00960 //  Constructor
00961 //
00962 //////////////////////////////////////////////////////////////////////
00963 //ok
00964 {
00965   int nIndex = 0;
00966
00967   // Retain a copy of the provider
00968   // =============================
00969
00970   m_pProvider = pProvider;
00971   if (m_pProvider)
00972     m_pProvider->AddRef();
00973
00974   // Initialize the instance map
00975   // ===========================
00976
00977   for (nIndex = 0; nIndex < MAX_INSTANCES; nIndex++)
00978     m_apInstMap[nIndex] = NULL;
00979
00980   // Initialize the instance cache
00981   // =============================
00982
00983   for (nIndex = 0; nIndex < NUM_INSTANCES; nIndex++)
00984     m_apInstances[nIndex] = NULL;
00985
00986   // Initialize the enumerator cache
00987   // ===============================
00988
00989   for (nIndex = 0; nIndex < MAX_ENUMERATORS; nIndex++)
00990     m_apEnumerator[nIndex] = NULL;
00991
00992   // Increment the global COM object counter
00993   // =======================================
00994
00995   InterlockedIncrement(&g_lObjects);
00996 }
00997
00998 CRefresher::~CRefresher()
00999 //////////////////////////////////////////////////////////////////////
01000 //
01001 //  Destructor
01002 //
01003 //////////////////////////////////////////////////////////////////////
01004 //ok
01005 {
01006   int nIndex = 0;
01007
01008   // Delete the instance cache
01009   // =========================
01010
01011   for (nIndex = 0; nIndex < MAX_INSTANCES; nIndex++)
01012   {
01013     if (NULL != m_apInstMap[nIndex])
01014       delete m_apInstMap[nIndex];
01015   }
01016
01017     // Release the cached IWbemObjectAccess instances
01018   // ==============================================
01019
01020     for (nIndex = 0; nIndex < NUM_INSTANCES; nIndex++)
01021     {
01022         if (NULL != m_apInstances[nIndex])
01023             m_apInstances[nIndex]->Release();
01024     }
01025
01026   // Release all of the enumerators
01027   // ==============================
01028
01029   for (nIndex = 0; nIndex < MAX_ENUMERATORS; nIndex++)
01030   {
01031     if (NULL != m_apEnumerator[nIndex])
01032       m_apEnumerator[nIndex]->Release();
01033   }
01034
01035   // Release the provider
01036   // ====================
01037
01038   if (m_pProvider)
01039     m_pProvider->Release();
01040
01041   // Decrement the global COM object counter
01042   // =======================================
01043
01044   InterlockedDecrement(&g_lObjects);
01045 }
01046
01047 DWORD CRefresher::Initialize(IWbemClassObject* pSampleClass)
01048 //////////////////////////////////////////////////////////////////////
01049 //
01050 //  Initializes the instances cache.
01051 //
01052 //  Parameters:
01053 //    pSampleClass  - A template of the WMI object from which we
01054 //              will create our instances
01055 //
01056 //////////////////////////////////////////////////////////////////////
01057 //ok
01058 {
01059   DWORD dwRes = WBEM_NO_ERROR;
01060
01061   int nIndex = 0;
01062
01063     // Precreate and initialize 5 instances of our sample class, and store
01064   // them in the m_apInstances array as IWbemObjectAccess pointers
01065   // =====================================================================
01066
01067     for (DWORD dwIndex = 0; dwIndex < NUM_INSTANCES; dwIndex++)
01068     {
01069     IWbemClassObject* pClone = NULL;
01070     IWbemObjectAccess*  pAccess = NULL;
01071
01072     // Create the instance
01073     // ===================
01074
01075     dwRes = pSampleClass->SpawnInstance(0, &pClone);
01076     if (FAILED(dwRes))
01077       return dwRes;
01078
01079     // Get the IWbemObjectAccess interface
01080     // ===================================
01081
01082         dwRes = pClone->QueryInterface(IID_IWbemObjectAccess, (LPVOID *)&pAccess);
01083         pClone->Release();
01084
01085     if (FAILED(dwRes))
01086       return dwRes;
01087
01088     // Set the ID
01089     // ==========
01090
01091     WCHAR wszName[20];
01092     StringCbPrintfW(wszName, sizeof(wszName), L"%i", dwIndex);
01093     dwRes = pAccess->WritePropertyValue(g_hID, (long)(wcslen(wszName)+1)*sizeof(WCHAR), (byte *)wszName);
01094     if (FAILED(dwRes))
01095     {
01096       pAccess->Release();
01097       return dwRes;
01098     }
01099
01100     // Initialize the counters
01101     // =======================
01102
01103     dwRes = m_pDS->UpdateInstance(pAccess);
01104     if (FAILED(dwRes))
01105     {
01106       pAccess->Release();
01107       return dwRes;
01108     }
01109
01110     // Add to the instance array (refcount == 1)
01111     // =========================================
01112
01113         m_apInstances[dwIndex] = pAccess;
01114     }
01115
01116   return WBEM_NO_ERROR;
01117 }
01118
01119 DWORD CRefresher::AddObject(IWbemObjectAccess *pObj, IWbemObjectAccess **ppReturnObj, long *plId)
01120 //////////////////////////////////////////////////////////////////////
01121 //
01122 //  Adds an object to the refresher.   This is a private mechanism
01123 //  used by CHiPerfProvider and not part of the COM interface.
01124 //
01125 //  All of the objects are maintained by the m_apInstances array.  This
01126 //  is set up during a call to Initialize.  Multiple additions of the same
01127 //  object to a refresher is legal, so to optimize the refresh, the
01128 //  same object is passed back but with a different ID.  The ID:object
01129 //  relationships are maintained by m_apInstMap.
01130 //
01131 //  Parameters:
01132 //    pObj    - the object to add
01133 //    lID     - the ID
01134 //
01135 //////////////////////////////////////////////////////////////////////
01136 //ok
01137 {
01138   DWORD dwRes = WBEM_NO_ERROR;
01139
01140   DWORD dwID  = 0;
01141   int   nIndex  = 0;
01142   bool  bDone = false;
01143
01144   if (NULL == pObj)
01145         return WBEM_E_INVALID_PARAMETER;
01146
01147   // Grab the instance ID
01148   // ====================
01149
01150   WCHAR wszName[20];
01151   long lNumBytes = 0;
01152   dwRes = pObj->ReadPropertyValue(g_hID, sizeof(wszName), &lNumBytes, (byte *)wszName);
01153   if (FAILED(dwRes))
01154     return dwRes;
01155   dwID = _wtoi(wszName);
01156
01157   // Search the map array for an empty spot
01158   // ======================================
01159
01160   for (nIndex = 0; (nIndex < MAX_INSTANCES) && !bDone; nIndex++)
01161   {
01162     if (NULL == m_apInstMap[nIndex])
01163     {
01164       // Create a new cache element
01165       // ==========================
01166
01167       CCacheMapEl* pEl = new CCacheMapEl(dwID);
01168       if (pEl == NULL)
01169         return WBEM_E_OUT_OF_MEMORY;
01170
01171       // Set the return parameters
01172       // =========================
01173
01174       *plId = pEl->GetUID();
01175       *ppReturnObj = m_apInstances[dwID];
01176       (*ppReturnObj)->AddRef();
01177
01178       // Set the cache element
01179       // =====================
01180
01181       m_apInstMap[nIndex] = pEl;
01182
01183       bDone = true;
01184     }
01185   }
01186
01187   // If array was full, report an error
01188   // ==================================
01189
01190   if (!bDone)
01191     dwRes = WBEM_E_OUT_OF_MEMORY;
01192
01193   return dwRes;
01194 }
01195
01196 DWORD CRefresher::RemoveObject(long lId)
01197 //////////////////////////////////////////////////////////////////////
01198 //
01199 //  Removes an object from the refresher.  This is a private mechanism
01200 //  used by CHiPerfProvider and not part of the COM interface.
01201 //
01202 //  Removes an object from the refresher by ID.   Use a simple linear
01203 //  search to locate the unique ID in the m_apInstMap.  Leave the
01204 //  cache instance intact until the refrehser is destroyed.
01205 //
01206 //  Parameters:
01207 //    plID    - the unique ID
01208 //
01209 //////////////////////////////////////////////////////////////////////
01210 //ok
01211 {
01212   DWORD dwRes = WBEM_E_NOT_FOUND;
01213
01214   int   nIndex = 0;
01215   bool  bDone = false;
01216
01217   // Loop through the map array looking of the ID
01218   // ============================================
01219
01220   for (nIndex = 0; (nIndex < MAX_INSTANCES) && !bDone; nIndex++)
01221   {
01222     CCacheMapEl* pEl = m_apInstMap[nIndex];
01223
01224     if (NULL != pEl)
01225     {
01226       if (pEl->GetUID() == lId)
01227       {
01228         // Found!  So remove map element
01229         // =============================
01230
01231         delete pEl;
01232         m_apInstMap[nIndex] = NULL;
01233
01234         dwRes = WBEM_NO_ERROR;
01235
01236         break;
01237       }
01238     }
01239   }
01240
01241   return dwRes;
01242 }
01243
01244 DWORD CRefresher::AddEnum(IWbemHiPerfEnum *pHiPerfEnum, long *plId)
01245 //////////////////////////////////////////////////////////////////////
01246 //
01247 //  Adds an enumerator to the refresher.   This is a private mechanism
01248 //  used by CHiPerfProvider and not part of the COM interface.
01249 //
01250 //  The ID we return for future identification is simply
01251 //  the array index.
01252 //
01253 //  Note that the the refresher uses an array of enumerators.  For a
01254 //  hiperf provider that only supports one class, having more than one
01255 //  enumerator does not really make sense since a single enumerator will
01256 //  manage all instances of a single class for a given refresher.
01257 //  NUM_ENUMERATORS may be set to reflect the number of classes if the
01258 //  proper class / enumerator management code is added.  The implementation
01259 //  is up to the provider.
01260 //
01261 //  Parameters:
01262 //    pHiPerfEnum - the enumerator
01263 //    plID    - the ID
01264 //
01265 //////////////////////////////////////////////////////////////////////
01266 //ok
01267 {
01268   DWORD dwRes = WBEM_E_FAILED;
01269
01270   if (NULL == pHiPerfEnum)
01271         return WBEM_E_INVALID_PARAMETER;
01272
01273   // Cycle through the enumerator array, and look for an empty slot
01274   // ==============================================================
01275
01276   for (int nIndex = 0; nIndex < MAX_ENUMERATORS; nIndex++)
01277   {
01278     if (NULL == m_apEnumerator[nIndex])
01279     {
01280       // Add all the objects at once into the enumerator
01281       // ===============================================
01282
01283       long alIDs[NUM_INSTANCES];
01284
01285       for ( int nInst = 0; nInst < NUM_INSTANCES; nInst++ )
01286         alIDs[nInst] = nInst;
01287
01288       dwRes = pHiPerfEnum->AddObjects( 0L, NUM_INSTANCES, alIDs, m_apInstances );
01289       if (FAILED(dwRes))
01290         return dwRes;
01291
01292       // Add the enumerator to the refresher (released by the refresher's destructor)
01293       // ============================================================================
01294
01295       m_apEnumerator[nIndex] = pHiPerfEnum;
01296       pHiPerfEnum->AddRef();
01297
01298       *plId = nIndex;
01299
01300       dwRes = WBEM_NO_ERROR;
01301       break;
01302     }
01303   }
01304   return dwRes;
01305 }
01306
01307 DWORD CRefresher::RemoveEnum(long lId)
01308 //////////////////////////////////////////////////////////////////////
01309 //
01310 //  Removes an enumerator from the refresher.  This is a private mechanism
01311 //  used by CHiPerfProvider and not part of the COM interface.
01312 //
01313 //  Removes an enumerator from the refresher by ID.   In our case, the ID
01314 //  is actually the array index we used internally, so it is simple
01315 //  to locate and remove the object.
01316 //
01317 //  Parameters:
01318 //    plID    - the ID
01319 //
01320 //////////////////////////////////////////////////////////////////////
01321 //ok
01322 {
01323   // Verify the element
01324   // ==================
01325
01326   if (NULL != m_apEnumerator[lId])
01327   {
01328     // And remove the enumerator
01329     // =========================
01330
01331     m_apEnumerator[lId]->Release();
01332     m_apEnumerator[lId] = NULL;
01333
01334     return WBEM_NO_ERROR;
01335   }
01336   return WBEM_E_FAILED;
01337 }
01338
01339 STDMETHODIMP CRefresher::QueryInterface(REFIID riid, void** ppv)
01340 //////////////////////////////////////////////////////////////////////
01341 //
01342 //  Standard COM QueryInterface
01343 //
01344 //////////////////////////////////////////////////////////////////////
01345 //ok
01346 {
01347     if (riid == IID_IUnknown)
01348         *ppv = (LPVOID)(IUnknown*)this;
01349   else if (riid == IID_IWbemRefresher)
01350     *ppv = (LPVOID)(IWbemRefresher*)this;
01351     else return E_NOINTERFACE;
01352
01353     ((IUnknown*)*ppv)->AddRef();
01354     return S_OK;
01355 }
01356
01357 STDMETHODIMP_(ULONG) CRefresher::AddRef()
01358 //////////////////////////////////////////////////////////////////////
01359 //
01360 //  Standard COM AddRef
01361 //
01362 //////////////////////////////////////////////////////////////////////
01363 //ok
01364 {
01365     return InterlockedIncrement(&m_lRef);
01366 }
01367
01368 STDMETHODIMP_(ULONG) CRefresher::Release()
01369 //////////////////////////////////////////////////////////////////////
01370 //
01371 //  Standard COM Release
01372 //
01373 //////////////////////////////////////////////////////////////////////
01374 //ok
01375 {
01376     long lRef = InterlockedDecrement(&m_lRef);
01377     if(lRef == 0)
01378         delete this;
01379
01380     return lRef;
01381 }
01382
01383 STDMETHODIMP CRefresher::Refresh(/* [in] */ long lFlags)
01384 //////////////////////////////////////////////////////////////////////
01385 //
01386 //  Executed to refresh a set of instances bound to the particular
01387 //  refresher.
01388 //
01389 //  In most situations the instance data, such as counter values and
01390 //  the set of current instances within any existing enumerators, would
01391 //  be updated whenever Refresh was called.  For this example, we are
01392 //  going to or data source to update the counter data.  Since we are
01393 //  using a fixed set of instances, we are not adding or removing anything
01394 //  from the enumerator.
01395 //
01396 //  Parameters:
01397 //    lFlags  - not used
01398 //
01399 //////////////////////////////////////////////////////////////////////
01400 //ok
01401 {
01402
01403   HRESULT hRes = WBEM_NO_ERROR;
01404
01405   //Impersonate the client
01406   hRes = CoImpersonateClient () ;
01407   if ( FAILED ( hRes ) && hRes != RPC_E_CALL_COMPLETE)
01408   {
01409     return hRes ;
01410   }
01411
01412   //  Check to see if call is at lower than RPC_C_IMP_LEVEL_IMPERSONATE level. If that's the case,
01413   //  the provider will not be able to impersonate the client to access the protected resources.
01414
01415   DWORD t_CurrentImpersonationLevel = GetCurrentImpersonationLevel () ;
01416   if ( t_CurrentImpersonationLevel < RPC_C_IMP_LEVEL_IMPERSONATE )
01417   {
01418     //  Revert before we perform any operations
01419     CoRevertToSelf () ;
01420
01421     hRes = WBEM_E_ACCESS_DENIED;
01422     return hRes ;
01423   }
01424
01425
01426   IWbemObjectAccess* pObj;
01427   DWORD dwVal = 0;
01428   long  hCtr = 0;
01429
01430   // A simple loop that iterates through all instances that have been
01431   // added to the refresher, and updates their counter values
01432   // ================================================================
01433
01434   for (int nInst = 0; nInst < NUM_INSTANCES; nInst++)
01435   {
01436     pObj = m_apInstances[nInst];
01437     if (NULL != pObj)
01438     {
01439       hRes = m_pDS->UpdateInstance(pObj);
01440       if (FAILED(hRes))
01441         break;
01442     }
01443   }
01444
01445   return hRes;
01446 }
01447
01448 //////////////////////////////////////////////////////////////
01449 //
01450 //
01451 //  CSampleDataSource
01452 //
01453 //
01454 //////////////////////////////////////////////////////////////
01455
01456
01457 CSampleDataSource::CSampleDataSource() : m_hThread(NULL)
01458 //////////////////////////////////////////////////////////////////////
01459 //
01460 //  Constructor
01461 //
01462 //////////////////////////////////////////////////////////////////////
01463 //ok
01464 {
01465   m_hQuit = CreateEvent( NULL, TRUE, FALSE, NULL );
01466 }
01467
01468 CSampleDataSource::~CSampleDataSource()
01469 //////////////////////////////////////////////////////////////////////
01470 //
01471 //  Destructor
01472 //
01473 //////////////////////////////////////////////////////////////////////
01474 //ok
01475 {
01476   if (NULL != m_hThread)
01477   {
01478     // Signal the thread to terminate
01479     // ==============================
01480
01481     SetEvent( m_hQuit );
01482
01483     DWORD dwRet = WaitForSingleObject( m_hThread, 60000 );
01484
01485     switch ( dwRet )
01486     {
01487     case WAIT_OBJECT_0:
01488       {
01489       }break;
01490     case WAIT_TIMEOUT:
01491       {
01492         // Something is wrong - handle appropriately
01493       }break;
01494     }
01495
01496     m_hThread = NULL;
01497   }
01498 }
01499
01500 DWORD CSampleDataSource::Initialize(IWbemClassObject* pSampleClass)
01501 //////////////////////////////////////////////////////////////
01502 //
01503 //  Initializes the data source.
01504 //
01505 //  Set the access handles for the properties of the WMI objects
01506 //  and create a thread that will independantly update the
01507 //  counter values.
01508 //
01509 //  Parameters:
01510 //    pSampleClass  - a template of the class for which
01511 //              handles are required
01512 //
01513 //////////////////////////////////////////////////////////////
01514 //ok
01515 {
01516   DWORD dwRes = WBEM_E_FAILED;
01517   unsigned uThread = 0;
01518
01519   // Set the handles for the object (valid for all instances)
01520   // ========================================================
01521
01522   dwRes = SetHandles(pSampleClass);
01523   if (FAILED(dwRes))
01524     return dwRes;
01525
01526   // Create the simulation thread
01527   // ============================
01528
01529   m_hThread = (PVOID)_beginthreadex(NULL, 0, CSampleDataSource::ThreadEntry, this, 0, &uThread);
01530
01531   if (0 == m_hThread)
01532     return WBEM_E_FAILED;
01533
01534   return WBEM_NO_ERROR;
01535 }
01536
01537 DWORD CSampleDataSource::SetHandles(IWbemClassObject* pSampleClass)
01538 //////////////////////////////////////////////////////////////
01539 //
01540 //  Called by the initialization method.
01541 //
01542 //  Get the access handles for the well-known properties in
01543 //  the WMI object.  These handles are the same for all instances
01544 //  of the object.
01545 //
01546 //  If the method fails, the property handle values may be in
01547 //  an indeterminite state.
01548 //
01549 //  Parameters:
01550 //    pSampleClass  - a template of the class for which
01551 //              handles are required
01552 //
01553 //////////////////////////////////////////////////////////////
01554 //ok
01555 {
01556   DWORD dwRes = WBEM_NO_ERROR;
01557
01558   IWbemObjectAccess *pAccess = NULL;
01559     BSTR strPropName  = NULL;
01560
01561     if (NULL == pSampleClass)
01562         return WBEM_E_FAILED;
01563
01564   // Get the IWbemAccess interface to the class
01565   // ==========================================
01566
01567   dwRes = pSampleClass->QueryInterface(IID_IWbemObjectAccess, (LPVOID *)&pAccess);
01568
01569   if (FAILED(dwRes))
01570     return dwRes;
01571
01572   // Get the counter properties access handles
01573   // =========================================
01574
01575   for (int i = ctr1; i < NumCtrs; i++)
01576   {
01577     strPropName = SysAllocString(g_aCounterProps[i].m_tcsPropertyName);
01578     if (!strPropName)
01579     {
01580       pAccess->Release();
01581       return WBEM_E_OUT_OF_MEMORY;
01582     }
01583
01584
01585     dwRes = pAccess->GetPropertyHandle(strPropName, 0, &m_alHandle[i]);
01586
01587     SysFreeString(strPropName);
01588
01589     if (FAILED(dwRes))
01590     {
01591       pAccess->Release();
01592       return dwRes;
01593     }
01594   }
01595
01596   pAccess->Release();
01597
01598   return WBEM_NO_ERROR;
01599 }
01600
01601
01602 DWORD CSampleDataSource::UpdateInstance(IWbemObjectAccess* pAccess)
01603 //////////////////////////////////////////////////////////////
01604 //
01605 //  Updates a given instance with the stored counter values.
01606 //
01607 //  Fetched the ID of the object, retrieves the corresponding
01608 //  CSampleInstance object, and copies the counter values
01609 //  into the object counter properties.
01610 //
01611 //  Parameters:
01612 //    pAccess   - the object to be updated
01613 //
01614 //////////////////////////////////////////////////////////////
01615 //ok
01616 {
01617   DWORD dwRes = WBEM_E_FAILED;
01618
01619   DWORD dwID = 0;
01620
01621   // Get the ID of the object
01622   // ========================
01623
01624   WCHAR wszName[20];
01625   long lNumBytes = 0;
01626   dwRes = pAccess->ReadPropertyValue(g_hID, sizeof(wszName), &lNumBytes, (byte *)wszName);
01627   if (FAILED(dwRes))
01628     return dwRes;
01629   dwID = _wtoi(wszName);
01630
01631   // Get the counter data
01632   // ====================
01633
01634   CSampleInstance* pInst = &(m_aInstance[dwID]);
01635
01636   // And set the counter properties
01637   // ==============================
01638
01639   pInst->Lock(true);
01640
01641   for (int nProp = ctr1; nProp < NumCtrs; nProp++)
01642   {
01643     DWORD dwVal = 0;
01644     dwRes = pInst->GetCounter(nProp, &dwVal);
01645     if (FAILED(dwRes))
01646       break;
01647     dwRes = pAccess->WriteDWORD(m_alHandle[nProp], dwVal);
01648     if (FAILED(dwRes))
01649       break;
01650   }
01651
01652   pInst->Lock(false);
01653
01654   return dwRes;
01655 }
01656
01657 DWORD CSampleDataSource::Simulate()
01658 //////////////////////////////////////////////////////////////
01659 //
01660 //  This will simulate real changes to the data set.  The
01661 //  thread will periodically cycle through the instances
01662 //  modifying their counter values.  The thread will be killed
01663 //  by the calling thread.
01664 //
01665 //////////////////////////////////////////////////////////////
01666 //ok
01667 {
01668   CSampleInstance* pCurrInst = NULL;
01669   DWORD dwVal = 0;
01670
01671   // Loop until the thread is killed
01672   // ===============================
01673
01674   while ( WaitForSingleObject( m_hQuit, 0 ) == WAIT_TIMEOUT )
01675   {
01676     // Loop through the instances
01677     // ==========================
01678
01679     for (int nInst = 0; nInst < NUM_INSTANCES; nInst++)
01680     {
01681       // Get the current instance and lock it
01682       // ====================================
01683
01684       pCurrInst = &(m_aInstance[nInst]);
01685
01686       pCurrInst->Lock(true);
01687
01688       // Update all of the counters
01689       // ==========================
01690
01691       for (int nCtr = ctr1; nCtr < NumCtrs; nCtr++)
01692       {
01693         dwVal = GetTickCount() / (nCtr + 1);
01694         pCurrInst->SetCounter(nCtr, dwVal);
01695       }
01696
01697       pCurrInst->Lock(false);
01698     }
01699
01700     // Wait a while
01701     // ============
01702
01703     Sleep(100);
01704   }
01705
01706   return WBEM_NO_ERROR;
01707 }
01708
01709 unsigned CSampleDataSource::ThreadEntry(void* pArgs)
01710 //////////////////////////////////////////////////////////////
01711 //
01712 //  The entry point for the simulation.  Calls Simulate.
01713 //
01714 //  Parameters:
01715 //    pArgs - contains the this pointer of the calling
01716 //          object
01717 //
01718 //////////////////////////////////////////////////////////////
01719 //ok
01720 {
01721   CSampleDataSource* pThis = (CSampleDataSource*)pArgs;
01722
01723   pThis->Simulate();
01724
01725   return 0;
01726 }
01727
01728 //////////////////////////////////////////////////////////////
01729 //
01730 //
01731 //  CSampleInstance
01732 //
01733 //
01734 //////////////////////////////////////////////////////////////
01735
01736 CSampleInstance::CSampleInstance()
01737 //////////////////////////////////////////////////////////////
01738 //
01739 //  Constructor
01740 //
01741 //////////////////////////////////////////////////////////////
01742 //ok
01743 {
01744   InitializeCriticalSection(&CS);
01745 }
01746
01747 CSampleInstance::CSampleInstance(const CSampleInstance &aInst)
01748 //////////////////////////////////////////////////////////////
01749 //
01750 //  Copy Constructor
01751 //
01752 //////////////////////////////////////////////////////////////
01753 //ok
01754 {
01755   InitializeCriticalSection(&CS);
01756
01757   for (int i = ctr1; i < NumCtrs; i++)
01758     m_aCounter[i] = aInst.m_aCounter[i];
01759 }
01760
01761 CSampleInstance::~CSampleInstance()
01762 //////////////////////////////////////////////////////////////
01763 //
01764 //  Destructor
01765 //
01766 //////////////////////////////////////////////////////////////
01767 //ok
01768 {
01769   DeleteCriticalSection(&CS);
01770 }
01771
01772 DWORD CSampleInstance::Lock(bool bLock)
01773 //////////////////////////////////////////////////////////////
01774 //
01775 //  Locks or unlocks the instance.
01776 //
01777 //  Parameters:
01778 //    bLock - true = lock; false = unlock
01779 //
01780 //////////////////////////////////////////////////////////////
01781 //ok
01782 {
01783   if (bLock)
01784     EnterCriticalSection(&CS);
01785   else
01786     LeaveCriticalSection(&CS);
01787
01788   return WBEM_NO_ERROR;
01789 }
01790
01791 DWORD CSampleInstance::SetCounter(long lCtrIndex, DWORD dwVal)
01792 //////////////////////////////////////////////////////////////
01793 //
01794 //  Sets the counter value for an indexed counter.
01795 //
01796 //  Parameters:
01797 //    lCtrIndex - the index of the counter
01798 //    dwVal   - the value of the counter
01799 //
01800 //////////////////////////////////////////////////////////////
01801 //ok
01802 {
01803   DWORD dwRes = WBEM_E_FAILED;
01804
01805   // Verify counter index
01806   // ====================
01807
01808   if ((lCtrIndex >= 0) && (lCtrIndex < NumCtrs))
01809   {
01810     // Update the counter value
01811     // ========================
01812     m_aCounter[lCtrIndex] = dwVal;
01813
01814     dwRes = WBEM_NO_ERROR;
01815   }
01816
01817   return dwRes;
01818 }
01819
01820 DWORD CSampleInstance::GetCounter(long lCtrIndex, DWORD* pdwVal)
01821 //////////////////////////////////////////////////////////////
01822 //
01823 //  Returns the counter value for an indexed counter.
01824 //
01825 //  Parameters:
01826 //    lCtrIndex - the index of the counter
01827 //    dwVal   - the return parameter for the value
01828 //
01829 //////////////////////////////////////////////////////////////
01830 //ok
01831 {
01832   DWORD dwRes = WBEM_E_FAILED;
01833
01834   // Verify counter index
01835   // ====================
01836
01837   if ((lCtrIndex >= 0) && (lCtrIndex < NumCtrs))
01838   {
01839     // Set return values
01840     // =================
01841
01842     *pdwVal = m_aCounter[lCtrIndex];
01843     dwRes = WBEM_NO_ERROR;
01844   }
01845
01846   return dwRes;
01847 }
01848
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_ParameterVtbl Member List

This is the complete list of members for _ParameterVtbl, including all inherited members.
bPrecision | _ParameterVtbl
bScale | _ParameterVtbl
bstr | _ParameterVtbl
cNames | _ParameterVtbl
dispIdMember | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Properties)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Name)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Name)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Value)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Value)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Type)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Type)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Direction)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Direction)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Precision)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Precision)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_NumericScale)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_NumericScale)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Size)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Size)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *AppendChunk)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Attributes)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Attributes)(_ADOParameter __RPC_FAR *This | _ParameterVtbl
iTInfo | _ParameterVtbl
l | _ParameterVtbl
lcid | _ParameterVtbl
lcid | _ParameterVtbl
lcid | _ParameterVtbl
lParmAttribs | _ParameterVtbl
lParmDirection | _ParameterVtbl
pbPrecision | _ParameterVtbl
pbScale | _ParameterVtbl
pbstr | _ParameterVtbl
pctinfo | _ParameterVtbl
pDispParams | _ParameterVtbl
pExcepInfo | _ParameterVtbl
pl | _ParameterVtbl
plParmAttribs | _ParameterVtbl
plParmDirection | _ParameterVtbl
ppTInfo | _ParameterVtbl
ppvObject | _ParameterVtbl
ppvObject | _ParameterVtbl
psDataType | _ParameterVtbl
puArgErr | _ParameterVtbl
pvar | _ParameterVtbl
pVarResult | _ParameterVtbl
rgDispId | _ParameterVtbl
rgszNames | _ParameterVtbl
riid | _ParameterVtbl
riid | _ParameterVtbl
riid | _ParameterVtbl
sDataType | _ParameterVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(_ADOParameter __RPC_FAR *This) | _ParameterVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(_ADOParameter __RPC_FAR *This) | _ParameterVtbl
val | _ParameterVtbl
Val | _ParameterVtbl
wFlags | _ParameterVtbl
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/msgfiltr.c Source File

  • Com
  • Fundamentals
  • OleStd

msgfiltr.c

Go to the documentation of this file.
00001 /*
00002  *    MSGFILTR.C
00003  *
00004  *    This file contains a standard implementation of IMessageFilter
00005  *    interface.
00006  *    This file is part of the OLE 2.0 User Interface support library.
00007  *
00008  *    (c) Copyright Microsoft Corp. 1990 - 2000 All Rights Reserved
00009  *
00010  */
00011
00012
00013 #define STRICT  1
00014 #include "olestd.h"
00015 #include "msgfiltr.h"
00016
00017 OLEDBGDATA
00018
00019
00020 typedef struct tagOLESTDMESSAGEFILTER {
00021    IMessageFilterVtbl FAR* m_lpVtbl;
00022    UINT                    m_cRef;
00023    HWND                    m_hWndParent;
00024    DWORD                   m_dwInComingCallStatus; // Status to return from
00025                                        // HandleIncomingCall
00026    HANDLEINCOMINGCALLBACKPROC m_lpfnHandleInComingCallback;
00027                                        // Callback function
00028                                        // to selectively handle
00029                                        // interface method calls
00030    BOOL                    m_fEnableBusyDialog;    // enable RetryRejected
00031                                        //  Call dialog
00032    BOOL                    m_fEnableNotRespondingDialog; // enable
00033                                        // MessagePending dialog
00034    MSGPENDINGPROC          m_lpfnMessagePendingCallback; // MessagePending
00035                                        // Callback function
00036    LPFNOLEUIHOOK           m_lpfnBusyDialogHookCallback; // Busy dialog hook
00037    LPOLESTR                m_lpszAppName;          // Name of application
00038                                        // installing filter
00039    HWND                    m_hWndBusyDialog;       // HWND of busy dialog.  Used
00040                                        // to tear down dialog.
00041    BOOL                    m_bUnblocking;
00042
00043  }OLESTDMESSAGEFILTER, FAR* LPOLESTDMESSAGEFILTER;
00044
00045 /* interface IMessageFilter implementation */
00046 STDMETHODIMP OleStdMsgFilter_QueryInterface(
00047       LPMESSAGEFILTER lpThis, REFIID riid, LPVOID FAR* ppvObj);
00048 STDMETHODIMP_(ULONG) OleStdMsgFilter_AddRef(LPMESSAGEFILTER lpThis);
00049 STDMETHODIMP_(ULONG) OleStdMsgFilter_Release(LPMESSAGEFILTER lpThis);
00050 STDMETHODIMP_(DWORD) OleStdMsgFilter_HandleInComingCall (
00051       LPMESSAGEFILTER     lpThis,
00052       DWORD               dwCallType,
00053       HTASK               htaskCaller,
00054       DWORD               dwTickCount,
00055       LPINTERFACEINFO     dwReserved
00056 );
00057 STDMETHODIMP_(DWORD) OleStdMsgFilter_RetryRejectedCall (
00058       LPMESSAGEFILTER     lpThis,
00059       HTASK               htaskCallee,
00060       DWORD               dwTickCount,
00061       DWORD               dwRejectType
00062 );
00063 STDMETHODIMP_(DWORD) OleStdMsgFilter_MessagePending (
00064       LPMESSAGEFILTER     lpThis,
00065       HTASK               htaskCallee,
00066       DWORD               dwTickCount,
00067       DWORD               dwPendingType
00068 );
00069
00070
00071 static IMessageFilterVtbl g_OleStdMessageFilterVtbl = {
00072    OleStdMsgFilter_QueryInterface,
00073    OleStdMsgFilter_AddRef,
00074    OleStdMsgFilter_Release,
00075    OleStdMsgFilter_HandleInComingCall,
00076    OleStdMsgFilter_RetryRejectedCall,
00077    OleStdMsgFilter_MessagePending
00078 };
00079
00080
00081 /* GetTopWindowInWindowsTask
00082 ** -------------------------
00083 **    Get the top most window that has focus in the given task to be
00084 **    used as the parent for the busy dialog. we do this to handle the
00085 **    case where a dialog window is currently up when we need to give
00086 **    the busy dialog. if we use the current assigned parent window
00087 **    (which typically will be the frame window of the app), then the
00088 **    busy dialog will not be modal to the current active dialog
00089 **    window.
00090 */
00091 static HWND GetTopWindowInWindowsTask(HWND hwnd)
00092 {
00093    HWND hwndActive = GetActiveWindow();
00094    if (!hwndActive)
00095       return hwnd;
00096
00097    if (GetWindowTask(hwnd) == GetWindowTask(hwndActive))
00098       return hwndActive;
00099    else
00100       return hwnd;
00101 }
00102
00103 STDAPI_(LPMESSAGEFILTER) OleStdMsgFilter_Create(
00104       HWND            hWndParent,
00105       LPOLESTR           szAppName,
00106       MSGPENDINGPROC  lpfnCallback,
00107       LPFNOLEUIHOOK   lpfnOleUIHook         // Busy dialog hook callback
00108 )
00109 {
00110    LPOLESTDMESSAGEFILTER lpStdMsgFilter;
00111    LPMALLOC lpMalloc;
00112
00113    if (CoGetMalloc(MEMCTX_TASK, (LPMALLOC FAR*)&lpMalloc) != NOERROR)
00114       return NULL;
00115
00116    lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpMalloc->lpVtbl->Alloc(
00117          lpMalloc, (sizeof(OLESTDMESSAGEFILTER)));
00118    lpMalloc->lpVtbl->Release(lpMalloc);
00119    if (! lpStdMsgFilter) return NULL;
00120
00121    lpStdMsgFilter->m_lpVtbl = &g_OleStdMessageFilterVtbl;
00122    lpStdMsgFilter->m_cRef = 1;
00123    lpStdMsgFilter->m_hWndParent = hWndParent;
00124    lpStdMsgFilter->m_dwInComingCallStatus = SERVERCALL_ISHANDLED;
00125    lpStdMsgFilter->m_lpfnHandleInComingCallback = NULL;
00126    lpStdMsgFilter->m_fEnableBusyDialog = TRUE;
00127    lpStdMsgFilter->m_fEnableNotRespondingDialog = TRUE;
00128    lpStdMsgFilter->m_lpszAppName = szAppName;
00129    lpStdMsgFilter->m_lpfnMessagePendingCallback = lpfnCallback;
00130    lpStdMsgFilter->m_lpfnBusyDialogHookCallback = lpfnOleUIHook;
00131    lpStdMsgFilter->m_hWndBusyDialog = NULL;
00132    lpStdMsgFilter->m_bUnblocking = FALSE;
00133
00134   g_dwObjectCount ++;
00135
00136    return (LPMESSAGEFILTER)lpStdMsgFilter;
00137 }
00138
00139
00140 /* OleStdMsgFilter_SetInComingStatus
00141 ** ---------------------------------
00142 **    This is a private function that allows the caller to control what
00143 **    value is returned from the IMessageFilter::HandleInComing method.
00144 **
00145 **    if a HandleInComingCallbackProc is installed by a call to
00146 **    OleStdMsgFilter_SetHandleInComingCallbackProc, then this
00147 **    overrides the dwIncomingCallStatus established by a call to
00148 **    OleStdMsgFilter_SetInComingStatus.  Using
00149 **    OleStdMsgFilter_SetInComingStatus allows the app to reject or
00150 **    accept ALL in coming calls. Using a HandleInComingCallbackProc
00151 **    allows the app to selectively handle or reject particular method
00152 **    calls.
00153 */
00154
00155 STDAPI_(void) OleStdMsgFilter_SetInComingCallStatus(
00156       LPMESSAGEFILTER lpThis, DWORD dwInComingCallStatus)
00157 {
00158    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00159
00160    if (!IsBadWritePtr((LPVOID)lpStdMsgFilter,  sizeof(OLESTDMESSAGEFILTER)))
00161       lpStdMsgFilter->m_dwInComingCallStatus = dwInComingCallStatus;
00162    else
00163       OleDbgAssert(
00164          "OleStdMsgFilter_SetIncomingCallStatus: Invalid IMessageFilter*");
00165
00166 #if defined( _DEBUG )
00167    {
00168    char szBuf[80];
00169    char *szReturn;
00170
00171    switch(dwInComingCallStatus) {
00172       case SERVERCALL_ISHANDLED:
00173          szReturn = "SERVERCALL_ISHANDLED";
00174          break;
00175       case SERVERCALL_REJECTED:
00176          szReturn = "SERVERCALL_REJECTED";
00177          break;
00178       case SERVERCALL_RETRYLATER:
00179          szReturn = "SERVERCALL_RETRYLATER";
00180          break;
00181       default:
00182          szReturn = "** ERROR: UNKNOWN **";
00183          break;
00184       }
00185    wsprintf(
00186       szBuf,
00187       "OleStdMsgFilter_SetInComingCallStatus: Status set to %s.\r\n",
00188       /*(LPSTR)*/szReturn
00189    );
00190    OleDbgOut3(szBuf);
00191    }
00192 #endif
00193
00194 }
00195
00196
00197 /* OleStdMsgFilter_SetHandleInComingCallbackProc
00198 ** ---------------------------------------------
00199 **    This is a private function that allows the caller to install (or
00200 **    de-install) a special callback function to selectively
00201 **    handle/reject specific incoming method calls on particular
00202 **    interfaces.
00203 **
00204 **    if a HandleInComingCallbackProc is installed by a call to
00205 **    OleStdMsgFilter_SetHandleInComingCallbackProc, then this
00206 **    overrides the dwIncomingCallStatus established by a call to
00207 **    OleStdMsgFilter_SetInComingStatus.  Using
00208 **    OleStdMsgFilter_SetInComingStatus allows the app to reject or
00209 **    accept ALL in coming calls. Using a HandleInComingCallbackProc
00210 **    allows the app to selectively handle or reject particular method
00211 **    calls.
00212 **
00213 **    to de-install the HandleInComingCallbackProc, call
00214 **          OleStdMsgFilter_SetHandleInComingCallbackProc(NULL);
00215 **
00216 **    Returns previous callback proc in effect.
00217 */
00218
00219 STDAPI_(HANDLEINCOMINGCALLBACKPROC)
00220    OleStdMsgFilter_SetHandleInComingCallbackProc(
00221       LPMESSAGEFILTER             lpThis,
00222       HANDLEINCOMINGCALLBACKPROC  lpfnHandleInComingCallback)
00223 {
00224    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00225    HANDLEINCOMINGCALLBACKPROC    lpfnPrevCallback =
00226          lpStdMsgFilter->m_lpfnHandleInComingCallback;
00227
00228    if (!IsBadWritePtr((LPVOID)lpStdMsgFilter, sizeof(OLESTDMESSAGEFILTER))) {
00229       lpStdMsgFilter->m_lpfnHandleInComingCallback =
00230             lpfnHandleInComingCallback;
00231    } else {
00232       OleDbgAssert(
00233          "OleStdMsgFilter_SetIncomingCallStatus: Invalid IMessageFilter*");
00234    }
00235
00236 #if defined( _DEBUG )
00237    {
00238       if (lpfnHandleInComingCallback)
00239          OleDbgOut3(
00240             "OleStdMsgFilter_SetHandleInComingCallbackProc SET\r\n");
00241       else
00242          OleDbgOut3(
00243             "OleStdMsgFilter_SetHandleInComingCallbackProc CLEARED\r\n");
00244
00245    }
00246 #endif  // _DEBUG
00247
00248    return lpfnPrevCallback;
00249 }
00250
00251
00252 /* OleStdMsgFilter_GetInComingStatus
00253 ** ---------------------------------
00254 **    This is a private function that returns the current
00255 **    incoming call status.  Can be used to disable/enable options
00256 **    in the calling application.
00257 **
00258 ** Returns: one of
00259 **
00260 **    SERVERCALL_ISHANDLED
00261 **    SERVERCALL_REJECTED
00262 **    SERVERCALL_RETRYLATER
00263 **    or -1 for ERROR
00264 **
00265 */
00266
00267 STDAPI_(DWORD) OleStdMsgFilter_GetInComingCallStatus(
00268       LPMESSAGEFILTER lpThis)
00269 {
00270    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00271    DWORD dwReturn;
00272
00273    if (!IsBadReadPtr((LPVOID)lpStdMsgFilter,  sizeof(OLESTDMESSAGEFILTER)))
00274       dwReturn = lpStdMsgFilter->m_dwInComingCallStatus;
00275    else
00276       {
00277       OleDbgAssert(
00278          "OleStdMsgFilter_GetIncomingCallStatus: Invalid IMessageFilter*");
00279       dwReturn = (DWORD)-1;
00280       }
00281
00282 #if defined( _DEBUG )
00283    {
00284    char szBuf[80];
00285    char *szReturn;
00286
00287    switch(dwReturn) {
00288       case SERVERCALL_ISHANDLED:
00289          szReturn = "SERVERCALL_ISHANDLED";
00290          break;
00291       case SERVERCALL_REJECTED:
00292          szReturn = "SERVERCALL_REJECTED";
00293          break;
00294       case SERVERCALL_RETRYLATER:
00295          szReturn = "SERVERCALL_RETRYLATER";
00296          break;
00297       default:
00298          szReturn = "-1";
00299          break;
00300       }
00301    wsprintf(
00302       szBuf,
00303       "OleStdMsgFilter_GetInComingCallStatus returns %s.\r\n",
00304       /*(LPSTR)*/szReturn
00305    );
00306    OleDbgOut3(szBuf);
00307    }
00308 #endif
00309
00310    return dwReturn;
00311 }
00312
00313
00314 /* OleStdMsgFilter_EnableBusyDialog
00315 ** --------------------------------
00316 **    This function allows the caller to control whether
00317 **    the busy dialog is enabled. this is the dialog put up when
00318 **    IMessageFilter::RetryRejectedCall is called because the server
00319 **    responded SERVERCALL_RETRYLATER or SERVERCALL_REJECTED.
00320 **
00321 **    if the busy dialog is NOT enabled, then the rejected call is
00322 **    immediately canceled WITHOUT prompting the user. in this situation
00323 **    OleStdMsgFilter_RetryRejectedCall always retuns
00324 **    OLESTDCANCELRETRY canceling the outgoing LRPC call.
00325 **    If the busy dialog is enabled, then the user is given the choice
00326 **    of whether to retry, switch to, or cancel.
00327 **
00328 **    Returns previous dialog enable state
00329 */
00330
00331 STDAPI_(BOOL) OleStdMsgFilter_EnableBusyDialog(
00332       LPMESSAGEFILTER lpThis, BOOL fEnable)
00333 {
00334    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00335    BOOL fPrevEnable = lpStdMsgFilter->m_fEnableBusyDialog;
00336
00337    if (!IsBadWritePtr((LPVOID)lpStdMsgFilter,  sizeof(OLESTDMESSAGEFILTER)))
00338       lpStdMsgFilter->m_fEnableBusyDialog = fEnable;
00339    else
00340       OleDbgAssert(
00341             "OleStdMsgFilter_EnableBusyDialog: Invalid IMessageFilter*");
00342
00343 #if defined( _DEBUG )
00344    {
00345    char szBuf[80];
00346    wsprintf(
00347       szBuf,
00348       "OleStdMsgFilter_EnableBusyDialog: Dialog is %s.\r\n",
00349       fEnable ? /*(LPSTR)*/"ENABLED" : /*(LPSTR)*/"DISABLED"
00350    );
00351    OleDbgOut3(szBuf);
00352    }
00353 #endif
00354
00355    return fPrevEnable;
00356 }
00357
00358
00359 /* OleStdMsgFilter_EnableNotRespondingDialog
00360 ** -----------------------------------------
00361 **    This function allows the caller to control whether
00362 **    the app "NotResponding" (Blocked) dialog is enabled. this is the
00363 **    dialog put up when IMessageFilter::MessagePending is called.
00364 **    If the NotResponding dialog is enabled, then the user is given
00365 **    the choice of whether to retry or switch to, but NOT to cancel.
00366 **
00367 **    Returns previous dialog enable state
00368 */
00369
00370 STDAPI_(BOOL) OleStdMsgFilter_EnableNotRespondingDialog(
00371       LPMESSAGEFILTER lpThis, BOOL fEnable)
00372 {
00373    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00374    BOOL fPrevEnable = lpStdMsgFilter->m_fEnableNotRespondingDialog;
00375
00376    if (!IsBadWritePtr((LPVOID)lpStdMsgFilter,  sizeof(OLESTDMESSAGEFILTER)))
00377       lpStdMsgFilter->m_fEnableNotRespondingDialog = fEnable;
00378    else
00379       OleDbgAssert(
00380             "OleStdMsgFilter_EnableNotRespondingDialog: Invalid IMessageFilter*");
00381
00382 #if defined( _DEBUG )
00383    {
00384    char szBuf[80];
00385    wsprintf(
00386       szBuf,
00387       "OleStdMsgFilter_EnableNotRespondingDialog: Dialog is %s.\r\n",
00388       fEnable ? /*(LPSTR)*/"ENABLED" : /*(LPSTR)*/"DISABLED"
00389    );
00390    OleDbgOut3(szBuf);
00391    }
00392 #endif
00393
00394    return fPrevEnable;
00395 }
00396
00397
00398 /* OleStdMsgFilter_SetParentWindow
00399 ** -------------------------------
00400 **    This function allows caller to set which window will be used as
00401 **    the parent for the busy dialog.
00402 **
00403 **    NOTE: it would be inportant for an in-place active server to
00404 **    reset this to its current in-place frame window when in-place
00405 **    activated. if the hWndParent is set to NULL then the dialogs will
00406 **    be parented to the desktop.
00407 **
00408 **    Returns: previous parent window
00409 */
00410
00411 STDAPI_(HWND) OleStdMsgFilter_SetParentWindow(
00412       LPMESSAGEFILTER lpThis, HWND hWndParent)
00413 {
00414    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00415    HWND hWndPrev = lpStdMsgFilter->m_hWndParent;
00416
00417    lpStdMsgFilter->m_hWndParent = hWndParent;
00418    return hWndPrev;
00419 }
00420
00421
00422 STDMETHODIMP OleStdMsgFilter_QueryInterface(
00423       LPMESSAGEFILTER lpThis, REFIID riid, LPVOID FAR* ppvObj)
00424 {
00425    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00426    SCODE scode;
00427
00428    /* Two interfaces supported: IUnknown, IMessageFilter
00429    */
00430
00431    if (IsEqualIID(riid, &IID_IMessageFilter) || IsEqualIID(riid, &IID_IUnknown)) {
00432       lpStdMsgFilter->m_cRef++;   // A pointer to this object is returned
00433       *ppvObj = lpThis;
00434       scode = S_OK;
00435    }
00436    else {                 // unsupported interface
00437       *ppvObj = NULL;
00438       scode = E_NOINTERFACE;
00439    }
00440
00441    return scode;
00442 }
00443
00444
00445 STDMETHODIMP_(ULONG) OleStdMsgFilter_AddRef(LPMESSAGEFILTER lpThis)
00446 {
00447    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00448    return ++lpStdMsgFilter->m_cRef;
00449 }
00450
00451 STDMETHODIMP_(ULONG) OleStdMsgFilter_Release(LPMESSAGEFILTER lpThis)
00452 {
00453    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00454    LPMALLOC lpMalloc;
00455
00456    if (--lpStdMsgFilter->m_cRef != 0) // Still used by others
00457       return lpStdMsgFilter->m_cRef;
00458
00459    // Free storage
00460    if (CoGetMalloc(MEMCTX_TASK, (LPMALLOC FAR*)&lpMalloc) != NOERROR)
00461       return (ULONG)0;
00462
00463    lpMalloc->lpVtbl->Free(lpMalloc, lpStdMsgFilter);
00464    lpMalloc->lpVtbl->Release(lpMalloc);
00465
00466   g_dwObjectCount --;
00467
00468    return (ULONG)0;
00469 }
00470
00471
00472 STDMETHODIMP_(DWORD) OleStdMsgFilter_HandleInComingCall (
00473       LPMESSAGEFILTER     lpThis,
00474       DWORD               dwCallType,
00475       HTASK               htaskCaller,
00476       DWORD               dwTickCount,
00477       LPINTERFACEINFO     dwReserved
00478 )
00479 {
00480    LPOLESTDMESSAGEFILTER lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00481
00482    /* if a HandleInComingCallbackProc is in effect, then this
00483    **    overrides dwIncomingCallStatus established by a call to
00484    **    OleStdMsgFilter_SetInComingStatus.  we will call this
00485    **    callback to allow the app to selectively handle or reject
00486    **    incoming method calls. the LPINTERFACEINFO parameter
00487    **    describes which method is being called.
00488    */
00489    if (lpStdMsgFilter->m_lpfnHandleInComingCallback &&
00490       !IsBadCodePtr((FARPROC)lpStdMsgFilter->m_lpfnHandleInComingCallback)){
00491       return lpStdMsgFilter->m_lpfnHandleInComingCallback(
00492             dwCallType,
00493             htaskCaller,
00494             dwTickCount,
00495             dwReserved
00496       );
00497    }
00498
00499    switch (dwCallType) {
00500       case CALLTYPE_TOPLEVEL:
00501          /* NOTE: we currently have NO pending outgoing call and
00502          **    there is a new toplevel incoming call.
00503          **    this call may be rejected.
00504          */
00505          return lpStdMsgFilter->m_dwInComingCallStatus;
00506
00507       case CALLTYPE_TOPLEVEL_CALLPENDING:
00508          /* NOTE: we currently HAVE a pending outgoing call and
00509          **    there is a new toplevel incoming call.
00510          **    this call may be rejected.
00511          */
00512          return lpStdMsgFilter->m_dwInComingCallStatus;
00513
00514       case CALLTYPE_NESTED:
00515          /* NOTE: we currently HAVE a pending outgoing call and
00516          **    there callback on behalf of the previous outgoing
00517          **    call. this type of call should ALWAYS be handled.
00518          */
00519          return SERVERCALL_ISHANDLED;
00520
00521       case CALLTYPE_ASYNC:
00522          /* NOTE: we currently have NO pending outgoing call and
00523          **    there is a new asyncronis incoming call.
00524          **    this call can NEVER be rejected. OLE actually ignores
00525          **    the return code in this case and always allows the
00526          **    call through.
00527          */
00528          return SERVERCALL_ISHANDLED;    // value returned does not matter
00529
00530       case CALLTYPE_ASYNC_CALLPENDING:
00531          /* NOTE: we currently HAVE a pending outgoing call and
00532          **    there is a new asyncronis incoming call.
00533          **    this call can NEVER be rejected. OLE ignore the
00534          **    return code in this case.
00535          */
00536          return SERVERCALL_ISHANDLED;    // value returned does not
00537
00538       default:
00539          OleDbgAssert(
00540                "OleStdMsgFilter_HandleInComingCall: Invalid CALLTYPE");
00541          return lpStdMsgFilter->m_dwInComingCallStatus;
00542    }
00543 }
00544
00545 STDMETHODIMP_(DWORD) OleStdMsgFilter_RetryRejectedCall (
00546       LPMESSAGEFILTER     lpThis,
00547       HTASK               htaskCallee,
00548       DWORD               dwTickCount,
00549       DWORD               dwRejectType
00550 )
00551 {
00552    LPOLESTDMESSAGEFILTER   lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00553    DWORD                   dwRet = 0;
00554    UINT                    uRet;
00555    char                    szBuf[80];
00556    OLEDBG_BEGIN2("OleStdMsgFilter_RetryRejectedCall\r\n")
00557
00558    /* NOTE: we should only put up the application busy dialog when
00559    **    the callee has responded SERVERCALL_RETRYLATER. if the
00560    **    dwRejectType is SERVERCALL_REJECTED then there is something
00561    **    seriously wrong with the callee (perhaps a severe low memory
00562    **    situation). we don't want to even try to "Switch To" this app
00563    **    or even try to "Retry".
00564    */
00565    if (dwRejectType == SERVERCALL_RETRYLATER &&
00566          lpStdMsgFilter->m_fEnableBusyDialog) {
00567
00568       OLEUIBUSY bz;
00569
00570       /* NOTE: we do not want to put up the Busy dialog immediately
00571       **    the when an app says RETRYLATER. we should continue retrying
00572       **    for a while in case the app can un-busy itself in a
00573       **    reasonable amount of time.
00574       */
00575       if (dwTickCount <= (DWORD)OLESTDRETRYDELAY) {
00576          dwRet = 500;                  // Retry after .5 sec
00577          OLEDBG_END2
00578          return dwRet;
00579       }
00580
00581       /*
00582       ** Set up structure for calling OLEUIBUSY dialog
00583       */
00584
00585       bz.cbStruct = sizeof(OLEUIBUSY);
00586       bz.dwFlags = 0L;
00587       bz.hWndOwner =GetTopWindowInWindowsTask(lpStdMsgFilter->m_hWndParent);
00588       W2A(lpStdMsgFilter->m_lpszAppName, szBuf, sizeof(szBuf));
00589       bz.lpszCaption = szBuf;
00590       bz.lpfnHook = lpStdMsgFilter->m_lpfnBusyDialogHookCallback;
00591       bz.lCustData = 0;
00592       bz.hInstance = NULL;
00593       bz.lpszTemplate = NULL;
00594       bz.hResource = 0;
00595       bz.hTask = htaskCallee;
00596       bz.lphWndDialog = NULL; // We don't need the hDlg for this call
00597
00598       uRet = OleUIBusy(&bz);
00599
00600       switch (uRet) {
00601          case OLEUI_BZ_RETRYSELECTED:
00602             dwRet = 0;                  // Retry immediately
00603             break;
00604
00605          case OLEUI_CANCEL:
00606             dwRet = OLESTDCANCELRETRY;  // Cancel pending outgoing call
00607             break;
00608
00609          case OLEUI_BZERR_HTASKINVALID:
00610             // Htask was invalid, return OLESTDRETRYDELAY anyway
00611             dwRet = OLESTDRETRYDELAY;   // Retry after <retry delay> msec
00612
00613 #if defined( _DEBUG )
00614             wsprintf(
00615                   szBuf,
00616                   "OleStdMsgFilter_RetryRejectedCall, HTASK 0x%x invalid\r\n",
00617                   htaskCallee
00618             );
00619             OleDbgOut3(szBuf);
00620 #endif
00621             break;
00622       }
00623    } else {
00624       dwRet = OLESTDCANCELRETRY;  // Cancel pending outgoing call
00625    }
00626
00627 #if defined( _DEBUG )
00628    wsprintf(szBuf,
00629           "OleStdMsgFilter_RetryRejectedCall returns %d\r\n",
00630           dwRet);
00631    OleDbgOut3(szBuf);
00632 #endif
00633
00634    OLEDBG_END2
00635    return dwRet;
00636 }
00637
00638
00639
00640 /* a significant message is consider a mouse click or keyboard input. */
00641 #define IS_SIGNIFICANT_MSG(lpmsg)   \
00642    (   \
00643       (PeekMessage((lpmsg), NULL, WM_LBUTTONDOWN, WM_LBUTTONDOWN, \
00644              PM_NOREMOVE | PM_NOYIELD)) \
00645     || (PeekMessage((lpmsg), NULL, WM_LBUTTONDBLCLK, WM_LBUTTONDBLCLK, \
00646              PM_NOREMOVE | PM_NOYIELD)) \
00647     || (PeekMessage((lpmsg), NULL, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN, \
00648              PM_NOREMOVE | PM_NOYIELD)) \
00649     || (PeekMessage((lpmsg), NULL, WM_NCLBUTTONDBLCLK, WM_NCLBUTTONDBLCLK, \
00650              PM_NOREMOVE | PM_NOYIELD)) \
00651     || (PeekMessage((lpmsg), NULL, WM_KEYDOWN, WM_KEYDOWN, \
00652              PM_NOREMOVE | PM_NOYIELD)) \
00653     || (PeekMessage((lpmsg), NULL, WM_SYSKEYDOWN, WM_SYSKEYDOWN, \
00654              PM_NOREMOVE | PM_NOYIELD)) \
00655    )
00656
00657 STDMETHODIMP_(DWORD) OleStdMsgFilter_MessagePending (
00658       LPMESSAGEFILTER     lpThis,
00659       HTASK               htaskCallee,
00660       DWORD               dwTickCount,
00661       DWORD               dwPendingType
00662 )
00663 {
00664    LPOLESTDMESSAGEFILTER   lpStdMsgFilter = (LPOLESTDMESSAGEFILTER)lpThis;
00665    DWORD                   dwReturn = PENDINGMSG_WAITDEFPROCESS;
00666    MSG                     msg;
00667    BOOL                    fIsSignificantMsg = IS_SIGNIFICANT_MSG(&msg);
00668    UINT                    uRet;
00669
00670    char szBuf[128];
00671 #if defined( _DEBUG )
00672    wsprintf(
00673          szBuf,
00674          "OleStdMsgFilter_MessagePending, dwTickCount = 0x%lX\r\n",
00675          (DWORD)dwTickCount
00676    );
00677    OleDbgOut4(szBuf);
00678 #endif
00679
00680    /* NOTE: If our tick count for this call exceeds our standard retry
00681    **      delay, then we need to put up the dialog.  We will only
00682    **      consider putting up the dialog if the user has issued a
00683    **      "significant" event (ie. mouse click or keyboard event). a
00684    **      simple mouse move should NOT trigger this dialog.
00685    **      Since our call to
00686    **      OleUIBusy below enters a DialogBox() message loop, there's a
00687    **      possibility that another call will be initiated during the dialog,
00688    **      and this procedure will be re-entered.  Just so we don't put up
00689    **      two dialogs at a time, we use the m_bUnblocking varable
00690    **      to keep track of this situation.
00691    */
00692
00693    if (dwTickCount > (DWORD)OLESTDRETRYDELAY && fIsSignificantMsg
00694          && !lpStdMsgFilter->m_bUnblocking)
00695    {
00696
00697       if (lpStdMsgFilter->m_fEnableNotRespondingDialog)
00698       {
00699       OLEUIBUSY bz;
00700
00701       lpStdMsgFilter->m_bUnblocking = TRUE;
00702
00703       // Eat messages in our queue that we do NOT want to be dispatched
00704       while (PeekMessage(&msg, NULL, WM_CLOSE, WM_CLOSE, PM_REMOVE | PM_NOYIELD));
00705
00706       /* Set up structure for calling OLEUIBUSY dialog,
00707       ** using the "not responding" variety
00708       */
00709
00710       bz.cbStruct = sizeof(OLEUIBUSY);
00711       bz.dwFlags = BZ_NOTRESPONDINGDIALOG;
00712       bz.hWndOwner =GetTopWindowInWindowsTask(lpStdMsgFilter->m_hWndParent);
00713       W2A(lpStdMsgFilter->m_lpszAppName, szBuf, sizeof(szBuf));
00714       bz.lpszCaption = szBuf;
00715       bz.lpfnHook = lpStdMsgFilter->m_lpfnBusyDialogHookCallback;
00716       bz.lCustData = 0;
00717       bz.hInstance = NULL;
00718       bz.lpszTemplate = NULL;
00719       bz.hResource = 0;
00720       bz.hTask = htaskCallee;
00721
00722       /* Set up the address to the hWnd in our MsgFilter structure.  The
00723       ** call to OleUIBusy will fill this in with the hWnd of the busy
00724       ** dialog box
00725       */
00726
00727       bz.lphWndDialog =  (HWND FAR *)&(lpStdMsgFilter->m_hWndBusyDialog);
00728       uRet = OleUIBusy(&bz);
00729
00730       lpStdMsgFilter->m_bUnblocking = FALSE;
00731
00732       return PENDINGMSG_WAITNOPROCESS;
00733       }
00734 #if defined( _DEBUG )
00735       else {
00736          OleDbgOut3("OleStdMsgFilter_MessagePending: BLOCKED but dialog Disabled\r\n");
00737       }
00738 #endif
00739    }
00740
00741    /* If we're already unblocking, we're being re-entered.  Don't
00742    ** process message
00743    */
00744
00745    if (lpStdMsgFilter->m_bUnblocking)
00746       return PENDINGMSG_WAITDEFPROCESS;
00747
00748    /* NOTE: If we have a callback function set up, call it with the
00749    ** current message.  If not, tell OLE LPRC mechanism to automatically
00750    ** handle all messages.
00751    */
00752    if (lpStdMsgFilter->m_lpfnMessagePendingCallback &&
00753       !IsBadCodePtr((FARPROC)lpStdMsgFilter->m_lpfnMessagePendingCallback)){
00754       MSG msg;
00755
00756       /* NOTE: the app provided a MessagePendingCallback
00757       **    function. we will PeekMessage for the first message in
00758       **    the queue and pass it to the app. the app in its callback
00759       **    function can decide to Dispatch this message or it can
00760       **    PeekMessage on its own giving particular message filter
00761       **    criteria. if the app returns TRUE then we return
00762       **    PENDINGMSG_WAITNOPROCESS to OLE telling OLE to leave the
00763       **    message in the queue. If the app returns FALSE, then we
00764       **    return PENDINGMSG_WAITDEFPROCESS to OLE telling OLE to do
00765       **    its default processing with the message. by default OLE
00766       **    dispatches system messages and eats other messages and
00767       **    beeps.
00768       */
00769       if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE | PM_NOYIELD)) {
00770
00771          if (lpStdMsgFilter->m_lpfnMessagePendingCallback(&msg)) {
00772             /* TRUE return means that the app processed message.
00773             **
00774             ** NOTE: (CHANGE FROM OLE2.0 VERSION) we leave it up to
00775             **    the callback routine to remove the message if it
00776             **    wants.
00777             */
00778             dwReturn = PENDINGMSG_WAITNOPROCESS;
00779          } else {
00780             /* FALSE means that the app did not process the
00781             **    message. we will let OLE take its
00782             **    default action.
00783             **
00784             ** NOTE: (CHANGE FROM OLE2.0 VERSION) we used to return
00785             **    PENDINGMSG_WAITNOPROCESS to leave the message in
00786             **    the queue; now we return PENDINGMSG_WAITDEFPROCESS
00787             **    to let OLE do default processing.
00788             */
00789             dwReturn = PENDINGMSG_WAITDEFPROCESS;
00790
00791 #if defined( _DEBUG )
00792             wsprintf(
00793                   szBuf,
00794                   "Message (0x%x) (wParam=0x%x, lParam=0x%lx) using WAITDEFPROCESS while blocked\r\n",
00795                   msg.message,
00796                   msg.lParam,
00797                   msg.wParam
00798             );
00799             OleDbgOut2(szBuf);
00800 #endif  // _DEBUG
00801          }
00802       }
00803    }
00804
00805    return dwReturn;
00806 }
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminActivationOptions Member List

This is the complete list of members for comadmin::COMAdminActivationOptions, including all inherited members.
COMAdminActivationInproc | comadmin::COMAdminActivationOptions | [static]
COMAdminActivationLocal | comadmin::COMAdminActivationOptions | [static]
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/about.Cpp Source File

  • SysMgmt
  • MMC
  • CMenuExt

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163   MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164   *lpDest = wszStr;
00165
00166     return S_OK;
00167 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/about.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

about.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     This class implements ISnapinAbout
00014
00015
00016
00017 #ifndef _CLASS_CSNAPINABOUT_
00018 #define _CLASS_CSNAPINABOUT_
00019
00020 #include <mmc.h>
00021
00022
00023 //---------------------------------------------------------------------------
00024 class CSnapinAbout : public ISnapinAbout
00025 {
00026   private:
00027     ULONG       m_cRef;
00028     HBITMAP     m_hSmallImage;
00029     HBITMAP     m_hLargeImage;
00030     HBITMAP     m_hOpenImage;
00031     HICON       m_hAppIcon;
00032
00033   public:
00034     CSnapinAbout();
00035     ~CSnapinAbout();
00036
00037     /////////////////////////////////////////////////////////////////////////
00038     // Interface IUnknown
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     /////////////////////////////////////////////////////////////////////////
00044     // Interface ISnapinAbout
00045     STDMETHODIMP GetSnapinDescription(/*[out]*/ LPOLESTR* pszDescription );
00046
00047     STDMETHODIMP GetProvider(/*[out]*/ LPOLESTR* pszProvider );
00048
00049     STDMETHODIMP GetSnapinVersion(/*[out]*/ LPOLESTR* pszVersion);
00050
00051     STDMETHODIMP GetSnapinImage(/*[out]*/ HICON* hAppIcon );
00052
00053     STDMETHODIMP GetStaticFolderImage
00054                  (/*[out]*/ HBITMAP*  hSmallImage,
00055                   /*[out]*/ HBITMAP*  hOpenImage,
00056                   /*[out]*/ HBITMAP*  hLargeImage,
00057                   /*[out]*/ COLORREF* cMask
00058                  );
00059 };
00060
00061 #endif _CLASS_CSNAPINABOUT_
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminApplicationInstallOptions.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminApplicationInstallOptions.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminApplicationInstallOptions
00019
00020 public interface COMAdminApplicationInstallOptions
00021 {
00022   public static final int COMAdminInstallNoUsers = 0;
00023   public static final int COMAdminInstallUsers = 1;
00024   public static final int COMAdminInstallForceOverwriteOfFiles = 2;
00025 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/compitem.h Source File

  • Begin
  • sdkdiff

compitem.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #ifndef __COMPITEM_H__
00012 #define __COMPITEM_H__
00013 /*
00014  * CompItem
00015  *
00016  * a CompItem is a comparison between two files. It keeps track
00017  * of the two files. It knows how to compare two files, and knows the
00018  * results of the comparison: the end result is a list of SECTIONs
00019  * in each of the files, and a composite list of sections.
00020  *
00021  * One or other of the files may not exist.
00022  *
00023  * a compitem has a state - this indicates whether the two
00024  * files are the same, or different, or if only one file of that
00025  * name exists. This state is set on creation of the CompItem
00026  * and may be queried later.
00027  *
00028  */
00029
00030 #ifndef INC_VIEW_COMPLIST
00031 #define INC_VIEW_COMPLIST
00032 typedef struct compitem FAR* COMPITEM;          /* handle to a compitem */
00033 typedef struct view FAR * VIEW;                 /* handle to a VIEW     */
00034 typedef struct complist FAR * COMPLIST;         /* handle to a complist */
00035 #endif // INC_VIEW_COMPLIST
00036
00037 /* build a new compitem from two files. Either (but not both) of the files
00038  * may be NULL.
00039  *
00040  * This operation may cause the files to be read in and compared.
00041  * In any case, this will be done by the time a call to one of
00042  * the query*sections functions completes.
00043  *
00044  * If the LIST parameter is not NULL, the item will be
00045  * appended to the list during initialisation - that is, the
00046  * compitem will do a List_NewLast operation and then initialise the
00047  * resulting object. If LIST is NULL, the compitem will allocate the
00048  * structure using some other memory allocation scheme. in either
00049  * case, the compitem handle will be returned. This also affects
00050  * behaviour of compitem_delete- we only free the compitem itself if
00051  * we allocated it ourself and not through List_NewLast.
00052  */
00053 COMPITEM compitem_new(DIRITEM left, DIRITEM right, LIST list, BOOL fExact);
00054
00055
00056 /* delete a compitem and free all associated data - INCLUDING deleting
00057  * the two FILEDATAs and all associated list of lines and sections.
00058  *
00059  * If the compitem was allocated on a list, it will not be freed, only
00060  * the memory hanging off it.
00061  */
00062 void compitem_delete(COMPITEM item);
00063
00064
00065 /* return a handle to a LIST of SECTIONs representing the compared file.
00066  * this call will cause the list to be created if it hasn't already been.
00067  *
00068  * returned handle will be NULL if either of the files is NULL.
00069  *
00070  * the list of sections can be traversed using the standard list functions.
00071  * the list you have a handle to is still owned by the compitem. to delete
00072  * it, call compitem_delete to delete the whole thing, or
00073  * compitem_discardsections to throw away all of the results of the compare
00074  */
00075 LIST compitem_getcomposite(COMPITEM item);
00076
00077
00078 /*
00079  * discard all compare data - throw away the composite section list and
00080  * any associated data (including the left and right section lists).
00081  * retains the two files. This is used either to free up memory when a
00082  * compitem is no longer being viewed, or to cause a new compare when
00083  * the global compare options flags (such as ignore_blanks) have changed.
00084  */
00085 void compitem_discardsections(COMPITEM item);
00086
00087
00088
00089 /* return the handle to the list of sections in the left, right file.
00090  * These calls will cause the lists to be created if they are not already.
00091  *
00092  * the compitem still owns the list. traverse it with the standard list
00093  * functions, but don't change it or delete it.
00094  */
00095 LIST compitem_getleftsections(COMPITEM item);
00096 LIST compitem_getrightsections(COMPITEM item);
00097
00098
00099 /* return the handle of the left or right file */
00100 FILEDATA compitem_getleftfile(COMPITEM item);
00101 FILEDATA compitem_getrightfile(COMPITEM item);
00102
00103
00104 /* query the compare state of this compitem */
00105 int compitem_getstate(COMPITEM item);
00106
00107 /* get a pointer to a text string describing the item (normally the
00108  * file name or filenames if different. The text pointed to should not
00109  * be changed or freed.
00110  */
00111 LPSTR compitem_gettext_tag(COMPITEM item);
00112
00113 /* return a pointer to a text string describing the compare result - this
00114  * will be a text form of the item's state.
00115  * The text pointed to should not be changed or freed.
00116  */
00117 LPSTR compitem_gettext_result(COMPITEM item);
00118
00119 /*
00120  * options for compitem_getfilename, indicating which name is desired
00121  */
00122 #define CI_LEFT         1       /* name of left file */
00123 #define CI_RIGHT        2       /* name of right file */
00124 #define CI_COMP         3       /* name of composite file */
00125
00126 /*
00127  * return the name of the file associated with this compitem. The option
00128  * argument (one of CI_LEFT, CI_RIGHT, CI_COMP) indicates which file
00129  * is required.
00130  *
00131  * The file may be a temporary file, if the file option specifies a remote
00132  * file, or the composite file.
00133  *
00134  * call compitem_freefilename once the file is finished with.
00135  */
00136 LPSTR compitem_getfilename(VIEW view, COMPITEM item, int option);
00137
00138 /*
00139  * free memory created by a call to compitem_getfilename. if a temporary
00140  * file was created, this may cause it to be deleted. The option argument must
00141  * be the same as passed to the original compitem_getfilename call.
00142  */
00143 void compitem_freefilename(COMPITEM item, int option, LPSTR filename);
00144
00145
00146 /* save the composite file
00147  *
00148  * if savename is not null, write the item out to savename using compopts.
00149  * otherwise, prompt by dialog for filename and options.
00150  */
00151 LPSTR compitem_savecomp(VIEW view, COMPITEM ci, LPSTR savename, int listopts);
00152
00153
00154 /*
00155  * worker function to write the actual composite file
00156  *
00157  * if savename is not null, write the list out to savename using compopts.
00158  * otherwise, prompt by dialog for filename and options.
00159  */
00160 LPSTR compitem_writefile(VIEW view, COMPITEM ci, LPSTR savename, int compopts);
00161
00162
00163 /*
00164  * set the mark state of a file. The only use for this is to retrieve it
00165  * later using compitem_getmark. The state is a bool.
00166  */
00167 void compitem_setmark(COMPITEM item, BOOL bMark);
00168
00169
00170 /*
00171  * return the mark state set by compitem_setmark
00172  */
00173 BOOL compitem_getmark(COMPITEM item);
00174
00175 /* Tell compitem the paths to be used for autocopy.  Copies left to right */
00176 void compitem_SetCopyPaths(LPSTR LeftPath, LPSTR RightPath);
00177
00178 /* Rescan the file, get new checksums etc */
00179 void compitem_rescan(COMPITEM ci);
00180 #endif
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebMain.h Source File

  • WinBase
  • Debug
  • Deb

DebMain.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014 \******************************************************************************/
00015
00016 #ifndef DEBMAIN_H
00017
00018  #define DEBMAIN_H
00019
00020  #ifndef DEB_H
00021   #include "DEB.H"    // resource and message ids
00022  #endif
00023
00024  // ********
00025  // typedefs
00026  // ********
00027  typedef struct PROFILE_STRUCT {
00028    INT       xPos;               // application window's horizontal position
00029    INT       yPos;               // application window's vertical position
00030    INT       nWidth;             // application window's width
00031    INT       nHeight;            // application window's height
00032    BOOL      fMaximized;         // flag: maximized state?
00033    BOOL      fMinimized;         // flag: minimized state?
00034    BOOL      fToolBar;           // flag: display the ToolBar?
00035    BOOL      fSavedDirectory;    // flag: use saved directory for opening files?
00036    TCHAR     szInitialDir[MAX_PATH];  // initial directory for debuggees
00037    LOGFONT   LogFont;            // current logical font
00038    COLORREF  rgbForeColor;       // current listbox text foreground color
00039    COLORREF  rgbBackColor;       // current listbox text foreground color
00040    BOOL      fClearOnNew;        // flag: clears the event listbox on a new debuggee
00041    BOOL      fVerbose;           // flag: verbose event listings
00042    BOOL      fShowSymbols;       // flag: show symbols (limited)
00043    LONG      DebugMode;          // debug mode flag CreateProcess
00044    LONG      DebuggeePriority;   // debuggee priority CreateProcess
00045    DWORD     DebugErrorLevel;    // debugger error level
00046    BOOL      fSavePreferences;   // flag: save the preferences settings
00047    BOOL      fSaveOnExit;        // flag: save settings upon exit?
00048  } PROFILE, *PPROFILE;
00049
00050  typedef struct GLOBAL_STRUCT {
00051    HINSTANCE hInstance;          // current instance
00052    HWND      hWndMain;           // Main window handle
00053    HWND      hWndListBox;        // debug event listbox handle
00054    HWND      hWndToolBar;        // windows handle to the text toolbar
00055    WNDPROC   OldListBoxWndProc;  // original listbox procedure
00056    TCHAR     szAppName[64];      // name of the application
00057    TCHAR     szShortAppName[32]; // short name of the application
00058    TCHAR     szApiFailed[64]; // "A Windows API Failed" message
00059    LONG      MaxStrLen;          // maximum string length in Debug Event listbox
00060    DWORD     dwActiveDebuggees;  // count of active debuggee processes
00061    SIZE      ClientSize;         // client windows size
00062    SIZE      ListBoxSize;        // debug event listbox size
00063    INT       ToolBarHeight;      // text button bar height
00064    INT       xPosOld;            // application window's old horizontal pos
00065    INT       yPosOld;            // application window's old vertical pos
00066    BOOL      fHelpUsed;          // boolean denoting online help invoked
00067  } GLOBAL, *PGLOBAL;
00068
00069  // ***********
00070  // global data
00071  // ***********
00072  extern GLOBAL  Global;          // various global data
00073  extern PROFILE Profile;         // various profile data
00074
00075 #endif // DEBMAIN_H
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/PreComp.h Source File

  • Web
  • NetMeeting
  • NMUI

PreComp.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       PRECOMP.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef _PRECOMP_H
00016 #define _PRECOMP_H
00017
00018 // Build Options
00019 #define NMUI_CHAT_PROTOCOL  // Use the NmUi Chat Protocol for sending text
00020
00021 #define NM_APPID_NETMEETING 0
00022
00023 // System Include files
00024 #include <windows.h>
00025 #include <windowsx.h>
00026 #include <commctrl.h>
00027 #include <tchar.h>
00028 #include <ocidl.h>
00029 #include <stdio.h>
00030
00031 #include "imsconf2.h"
00032
00033 #include "global.h"
00034 #include "clUtil.h"
00035 #include "cMgr.h"
00036 #include "cConf.h"
00037 #include "cCall.h"
00038 #include "cChan.h"
00039 #include "cMemb.h"
00040 #include "cData.h"
00041 #include "cShare.h"
00042 #include "cft.h"
00043
00044 #include "resource.h"
00045
00046
00047
00048 #endif /* _PRECOMP_H */
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/EvHandle.Cpp Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

EvHandle.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // MQEventHandler.cpp : implementation file
00013 //
00014
00015 #include "stdafx.h"
00016 #include <afxdisp.h>
00017 #include "Imp_Draw.h"
00018 #include "Imp_Dlg.h"
00019 #import <mqoa.tlb> no_namespace
00020
00021 // This is actually included in Imp_DrawDlg.h, but left here for reference purposes.
00022 //#include "MQEventHandler.h"
00023
00024
00025 // NOTE: DISP_FUNCTION_ID is a slighly unusual dispatch map macro, chosen because we
00026 // neeed to specify the DispID of the functions we implement as well as the information
00027 // normally given to the DISP_FUNCTION macro.
00028
00029 BEGIN_DISPATCH_MAP(CMSMQEventHandler, CCmdTarget)
00030   DISP_FUNCTION_ID(CMSMQEventHandler, "Arrived", 0, Arrived, VT_EMPTY, VTS_DISPATCH VTS_I4)
00031   DISP_FUNCTION_ID(CMSMQEventHandler, "ArrivedError", 1, ArrivedError, VT_EMPTY, VTS_DISPATCH VTS_I4 VTS_I4)
00032 END_DISPATCH_MAP()
00033
00034
00035 CMSMQEventHandler::CMSMQEventHandler()
00036 {
00037   EnableAutomation();
00038   m_dwMyCookie = 0;
00039   m_pMyCP = NULL;
00040 }
00041
00042 CMSMQEventHandler::~CMSMQEventHandler()
00043 {
00044   if (m_pMyCP)  // If I'm currently connected to a connection point
00045   {
00046     m_pMyCP->Unadvise(m_dwMyCookie);  // Disconnect, giving it the identifier it gave me earlier,
00047     m_pMyCP->Release();         // and release it.
00048   };
00049
00050 }
00051 //=--------------------------------------------------------------------------=
00052 // CMSMQEventHandler::Arrived
00053 // CMSMQEventHandler::ArrivedError
00054 //=--------------------------------------------------------------------------=
00055 // Purpose: These functions forward an "Arrived" or "ArrivedError" event from
00056 //      the queue to the event handler in the dialog code.
00057 //
00058 //
00059 // Parameters:
00060 //    IDispatch*    - The queue sending the event
00061 //    lCursor     - Cursor value sent with the event.  Unused in
00062 //              this function.
00063 //
00064 // Output:
00065 //    none
00066 //
00067 // Notes:
00068 //    These functions act nearly identically.  The only difference is if
00069 //    a normal event arrives, S_OK is sent as the error code; if an
00070 //    error event arrives, that error is passed on to the dialog's event
00071 //    handler.
00072 //
00073
00074 void CMSMQEventHandler::Arrived(IDispatch* pdispQueue, long lCursor)
00075 {
00076   CImp_DrawDlg* pDlg = (CImp_DrawDlg*) AfxGetApp()->m_pMainWnd;
00077   pDlg->Arrived(pdispQueue, S_OK, lCursor);
00078 }
00079
00080 void CMSMQEventHandler::ArrivedError(IDispatch* pdispQueue, long lErrorCode, long lCursor)
00081 {
00082   CImp_DrawDlg* pDlg = (CImp_DrawDlg*) AfxGetApp()->m_pMainWnd;
00083   pDlg->Arrived(pdispQueue, lErrorCode, lCursor);
00084 }
00085
00086
00087 //=--------------------------------------------------------------------------=
00088 // CMSMQEventHandler::AdviseSource
00089 //=--------------------------------------------------------------------------=
00090 // Purpose: This function connects this class to an MSMQ connection point,
00091 //      given an interface pointer to an MSMQ Event object.
00092 //
00093 //
00094 // Parameters:
00095 //    IDispatch*  - An MSMQ Event object to connect to
00096 //
00097 // Output:
00098 //    HRESULT   - S_OK if successful, otherwise any possible result from
00099 //            QueryInterface, FindConnectionPoint, or Advise.
00100 //
00101 // Notes:
00102 //    On the call to Advise, the GetIDispatch function (an MFC function) is
00103 //    called to retrieve the IDispatch pointer of this class in order to give
00104 //    it to the connection point.  The cookie returned by Advise is stored
00105 //    in a member variable, m_dwCookie.  The cookie is used when disconnecting
00106 //    from the connection point, in the destructor.
00107 //
00108
00109 HRESULT CMSMQEventHandler::AdviseSource(IDispatch* pDispatch)
00110 {
00111   LPCONNECTIONPOINTCONTAINER  pCPCont = NULL;
00112   HRESULT           hr;
00113
00114   hr = pDispatch->QueryInterface(IID_IConnectionPointContainer, (void**) &pCPCont);
00115   if (FAILED(hr))
00116     return hr;
00117
00118   hr = pCPCont->FindConnectionPoint(__uuidof(_DMSMQEventEvents), &m_pMyCP);
00119   pCPCont->Release();
00120   if (FAILED(hr))
00121     return hr;
00122
00123   return m_pMyCP->Advise(GetIDispatch(TRUE), &m_dwMyCookie);
00124 };
00125
00126
00127 //=--------------------------------------------------------------------------=
00128 // CMSMQEventHandler::GetInterfaceHook
00129 //=--------------------------------------------------------------------------=
00130 // Purpose: This function is called by MFC's implementation of QueryInterface
00131 //      and allows us to return our IDispatch interface in response to
00132 //      DIID__DMSMQEventEvents
00133 //
00134 //
00135 // Parameters:
00136 //    void*     - IID that was passed to QueryInterface
00137 //
00138 // Output:
00139 //    LPUNKNOWN   - Our IDispatch if the passed iid is DIID__DMSMQEventEvents,
00140 //            otherwise NULL.
00141 //
00142 // Notes:
00143 //    CCmdTarget allows a derived class some control on the behavior of
00144 //    QueryInterface. It calls this virtual function before it starts to
00145 //    search in its map for the requested interface. This allows us to respond
00146 //    with our IDispatch interface when requested for the sink interface
00147 //    DIID__DMSMQEventEvents.
00148 //    For other iid's we return NULL. This tells CCmdTarget to continue
00149 //    the search for the interface in its maps
00150 //
00151
00152 LPUNKNOWN CMSMQEventHandler::GetInterfaceHook(const void* piid)
00153 {
00154   if (IsEqualIID(__uuidof(_DMSMQEventEvents), *(IID*)piid))
00155   {
00156     return GetIDispatch(FALSE);
00157   }
00158   else
00159   {
00160     return NULL;
00161   }
00162 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptServe/CRUCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptServe

CRUCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CRUCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COCruiseCar COM
00005              object class.
00006
00007              CRUCAR showcases the construction of the COCruiseCar COM
00008              object class with the IUnknown, ICar, and ICruise interfaces.
00009              This is done through Containment reuse of COCar's ICar
00010              interface features.  This multiple interface COM Object Class
00011              is achieved via the technique of nested classes.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial APTSERVE.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the module's source code.
00017
00018   Classes:   COCruiseCar.
00019
00020   Functions: none.
00021
00022   Origin:    3-20-96: atrent - Editor-inheritance from CRUCAR.CPP in
00023                the LOCSERVE Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 /*---------------------------------------------------------------------------
00041   We include WINDOWS.H for all Win32 applications.
00042   We include OLE2.H because we will make calls to the COM/OLE Libraries.
00043   We include APPUTIL.H because we will be building this application using
00044     the convenient Virtual Window and Dialog classes and other
00045     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00046   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00047     class, GUID, and CLSID specifications.
00048   We include SERVER.H because it has the necessary internal class and
00049     resource definitions for this DLL.
00050   We include CAR.H because it has the class COCar declarations.
00051   We include CRUCAR.H because it has the class COCruiseCar declarations.
00052 ---------------------------------------------------------------------------*/
00053 #include <windows.h>
00054 #include <ole2.h>
00055 #include <apputil.h>
00056 #include <micars.h>
00057 #include <carguids.h>
00058 #include "server.h"
00059 #include "car.h"
00060 #include "crucar.h"
00061
00062
00063 /*---------------------------------------------------------------------------
00064   COCruiseCar's implementation of its main COM object class including
00065   Constructor, Destructor, QueryInterface, AddRef, and Release.
00066 ---------------------------------------------------------------------------*/
00067
00068 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00069   Method:   COCruiseCar::COCruiseCar
00070
00071   Summary:  COCruiseCar Constructor. Note the member initializer:
00072             "m_ImpICruise(this, pUnkOuter)" which is used to pass the
00073             'this' and pUnkOuter pointers of this constructor function
00074             to the constructor in the instantiation of the implementation
00075             of the CImpICruise interface (which is nested inside this
00076             present COCruiseCar Object Class).
00077
00078   Args:     IUnknown* pUnkOuter,
00079               Pointer to the the outer Unknown.  NULL means this COM Object
00080               is not being Aggregated.  Non NULL means it is being created
00081               on behalf of an outside COM object that is reusing it via
00082               aggregation.
00083             CServer* pServer)
00084               Pointer to the server's control object.
00085
00086   Modifies: m_cRefs, m_pUnkOuter.
00087
00088   Returns:  void
00089 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00090 COCruiseCar::COCruiseCar(
00091   IUnknown* pUnkOuter,
00092   CServer* pServer) :
00093   m_ImpICar(this, pUnkOuter),
00094   m_ImpICruise(this, pUnkOuter)
00095 {
00096   // Zero the COM object's reference count.
00097   m_cRefs = 0;
00098
00099   // No AddRef necessary if non-NULL, as this present COM object's lifetime
00100   // is totally coupled with the controlling Outer object's lifetime.
00101   m_pUnkOuter = pUnkOuter;
00102
00103   // Zero the pointer to the contained COCar object's ICar interface.
00104   m_pICar = NULL;
00105
00106   // Assign the pointer to the server's control object.
00107   m_pServer = pServer;
00108
00109   LOGF2("L<%X>: COCruiseCar Constructor. m_pUnkOuter=0x%X.",TID,m_pUnkOuter);
00110
00111   return;
00112 }
00113
00114
00115 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00116   Method:   COCruiseCar::~COCruiseCar
00117
00118   Summary:  COCruiseCar Destructor.
00119
00120   Args:     void
00121
00122   Modifies: .
00123
00124   Returns:  void
00125 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00126 COCruiseCar::~COCruiseCar(void)
00127 {
00128   LOGF1("L<%X>: COCruiseCar::Destructor.",TID);
00129
00130   // Release the contained Car object.
00131   RELEASE_INTERFACE(m_pICar);
00132
00133   return;
00134 }
00135
00136
00137 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00138   Method:   COCruiseCar::Init
00139
00140   Summary:  COCruiseCar Initialization method.  Creates any subordinate
00141             COM objects.
00142
00143   Args:     void
00144
00145   Modifies: m_pUnkCar, m_pICar, m_cRefs.
00146
00147   Returns:  HRESULT
00148               Standard result code. NOERROR for success.
00149 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00150 HRESULT COCruiseCar::Init(void)
00151 {
00152   HRESULT hr;
00153
00154   LOGF1("L<%X>: COCruiseCar::Init.",TID);
00155
00156   // Set up the right pIUnknown for delegation.  If we are being
00157   // aggregated then we pass the pUnkOuter in turn to any COM objects
00158   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00159   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00160
00161   // We create an instance of the COCar object and do this via the
00162   // Containment reuse technique.  We ask for the new COM object's
00163   // ICar interface directly.  We pass NULL for the pUnkOuter
00164   // aggregation pointer because we are not aggregating.  It is here
00165   // that we are reusing the COCar COM Object through the Containment
00166   // technique.  We cache the requested ICar interface pointer in this
00167   // COCruiseCar COM object for later use.  We don't need to AddRef
00168   // this interface because the CoCreateInstance will do this for us.
00169   hr = CoCreateInstance(
00170          CLSID_AptCar,
00171          NULL,
00172          CLSCTX_LOCAL_SERVER,
00173          IID_ICar,
00174          (PPVOID)&m_pICar);
00175
00176   if (SUCCEEDED(hr))
00177   {
00178     LOGF1("L<%X>: COCruiseCar::Init (New Containment of COCar) Succeeded.",TID);
00179   }
00180   else
00181   {
00182     LOGF2("L<%X>: COCruiseCar::Init (New Containment of COCar) Failed. hr=0x%X.",TID,hr);
00183   }
00184
00185   return (hr);
00186 }
00187
00188
00189 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00190   Method:   COCruiseCar::QueryInterface
00191
00192   Summary:  QueryInterface of the COCruiseCar non-delegating
00193             IUnknown implementation.
00194
00195   Args:     REFIID riid,
00196               [in] GUID of the Interface being requested.
00197             PPVOID ppv)
00198               [out] Address of the caller's pointer variable that will
00199               receive the requested interface pointer.
00200
00201   Modifies: *ppv.
00202
00203   Returns:  HRESULT
00204 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00205 STDMETHODIMP COCruiseCar::QueryInterface(
00206                REFIID riid,
00207                PPVOID ppv)
00208 {
00209   HRESULT hr = E_NOINTERFACE;
00210   *ppv = NULL;
00211
00212   if (IID_IUnknown == riid)
00213   {
00214     *ppv = this;
00215     LOGF1("L<%X>: COCruiseCar::QueryInterface. 'this' pIUnknown returned.",TID);
00216   }
00217   else if (IID_ICar == riid)
00218   {
00219     *ppv = &m_ImpICar;
00220     LOGF1("L<%X>: COCruiseCar::QueryInterface. pICar returned",TID);
00221   }
00222   else if (IID_ICruise == riid)
00223   {
00224     // This ICruise interface is implemented in this COCruiseCar object
00225     // and might be called a native interface of COCruiseCar.
00226     *ppv = &m_ImpICruise;
00227     LOGF1("L<%X>: COCruiseCar::QueryInterface. pICruise returned.",TID);
00228   }
00229
00230   if (NULL != *ppv)
00231   {
00232     // We've handed out a pointer to an interface so obey the COM rules
00233     // and AddRef its reference count.
00234     ((LPUNKNOWN)*ppv)->AddRef();
00235     hr = NOERROR;
00236   }
00237
00238   return (hr);
00239 }
00240
00241
00242 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00243   Method:   COCruiseCar::AddRef
00244
00245   Summary:  AddRef of the COCruiseCar non-delegating IUnknown implementation.
00246
00247   Args:     void
00248
00249   Modifies: m_cRefs.
00250
00251   Returns:  ULONG
00252               New value of m_cRefs (COM object's reference count).
00253 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00254 STDMETHODIMP_(ULONG) COCruiseCar::AddRef(void)
00255 {
00256   m_cRefs++;
00257
00258   LOGF2("L<%X>: COCruiseCar::AddRef. New cRefs=%i.",TID,m_cRefs);
00259
00260   return m_cRefs;
00261 }
00262
00263
00264 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00265   Method:   COCruiseCar::Release
00266
00267   Summary:  Release of the COCruiseCar non-delegating IUnknown
00268             implementation.
00269
00270   Args:     void
00271
00272   Modifies: m_cRefs.
00273
00274   Returns:  ULONG
00275               New value of m_cRefs (COM object's reference count).
00276 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00277 STDMETHODIMP_(ULONG) COCruiseCar::Release(void)
00278 {
00279   ULONG ulCount = --m_cRefs;
00280
00281   LOGF2("L<%X>: COCruiseCar::Release. New cRefs=%i.",TID,m_cRefs);
00282
00283   if (0 == m_cRefs)
00284   {
00285     CServer* pServer = m_pServer;
00286     // We artificially bump the main ref count to ensure that an indirect
00287     // recursive call to this release won't occur because of other
00288     // delegating releases that might happen in our own destructor.
00289     m_cRefs++;
00290     delete this;
00291
00292     // We've reached a zero reference count for this COM object.
00293     // So we tell the server housing to decrement its global object
00294     // count so that the server will be unloaded if appropriate.
00295     if (NULL != pServer)
00296       pServer->ObjectsDown();
00297   }
00298
00299   return ulCount;
00300 }
00301
00302
00303 /*---------------------------------------------------------------------------
00304   COCruiseCar's nested implementation of the ICar interface including
00305   Constructor, Destructor, QueryInterface, AddRef, Release,
00306   Shift, Clutch, Speed, and Steer.
00307 ---------------------------------------------------------------------------*/
00308
00309 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00310   Method:   COCruiseCar::CImpICar::CImpICar
00311
00312   Summary:  Constructor for the CImpICar interface instantiation.
00313
00314   Args:     COCruiseCar* pBackObj,
00315               Back pointer to the parent outer object.
00316             IUnknown* pUnkOuter,
00317               Pointer to the outer Unknown.  For delegation.
00318
00319   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00320
00321   Returns:  void
00322 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00323 COCruiseCar::CImpICar::CImpICar(
00324   COCruiseCar* pBackObj,
00325   IUnknown* pUnkOuter)
00326 {
00327   // Init the Interface Ref Count (used for debugging only).
00328   m_cRefI = 0;
00329
00330   // Init the Back Object Pointer to point to the outer object.
00331   m_pBackObj = pBackObj;
00332
00333   // Init the CImpICar interface's delegating Unknown pointer.  We use
00334   // the Back Object pointer for IUnknown delegation here if we are not
00335   // being aggregated.  If we are being aggregated we use the supplied
00336   // pUnkOuter for IUnknown delegation.  In either case the pointer
00337   // assignment requires no AddRef because the CImpICar lifetime is
00338   // quaranteed by the lifetime of the parent object in which
00339   // CImpICar is nested.
00340   if (NULL == pUnkOuter)
00341   {
00342     m_pUnkOuter = pBackObj;
00343     LOGF1("L<%X>: COCruiseCar::CImpICar Constructor. Non-Aggregating",TID);
00344   }
00345   else
00346   {
00347     m_pUnkOuter = pUnkOuter;
00348     LOGF1("L<%X>: COCruiseCar::CImpICar Constructor. Aggregating",TID);
00349   }
00350
00351   return;
00352 }
00353
00354
00355 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00356   Method:   COCruiseCar::CImpICar::~CImpICar
00357
00358   Summary:  Destructor for the CImpICar interface instantiation.
00359
00360   Args:     void
00361
00362   Modifies: .
00363
00364   Returns:  void
00365 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00366 COCruiseCar::CImpICar::~CImpICar(void)
00367 {
00368   LOGF1("L<%X>: COCruiseCar::CImpICar Destructor.",TID);
00369
00370   return;
00371 }
00372
00373
00374 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00375   Method:   COCruiseCar::CImpICar::QueryInterface
00376
00377   Summary:  The QueryInterface IUnknown member of this ICar interface
00378             implementation that delegates to m_pUnkOuter, whatever it is.
00379
00380   Args:     REFIID riid,
00381               [in] GUID of the Interface being requested.
00382             PPVOID ppv)
00383               [out] Address of the caller's pointer variable that will
00384               receive the requested interface pointer.
00385
00386   Modifies: .
00387
00388   Returns:  HRESULT
00389               Returned by the delegated outer QueryInterface call.
00390 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00391 STDMETHODIMP COCruiseCar::CImpICar::QueryInterface(
00392                REFIID riid,
00393                PPVOID ppv)
00394 {
00395   LOGF1("L<%X>: COCruiseCar::CImpICar::QueryInterface. Delegating.",TID);
00396
00397   // Delegate this call to the outer object's QueryInterface.
00398   return m_pUnkOuter->QueryInterface(riid, ppv);
00399 }
00400
00401
00402 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00403   Method:   COCruiseCar::CImpICar::AddRef
00404
00405   Summary:  The AddRef IUnknown member of this ICar interface
00406             implementation that delegates to m_pUnkOuter, whatever it is.
00407
00408   Args:     void
00409
00410   Modifies: m_cRefI.
00411
00412   Returns:  ULONG
00413               Returned by the delegated outer AddRef call.
00414 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00415 STDMETHODIMP_(ULONG) COCruiseCar::CImpICar::AddRef(void)
00416 {
00417   // Increment the Interface Reference Count.
00418   ++m_cRefI;
00419
00420   LOGF2("L<%X>: COCruiseCar::CImpICar::Addref. Delegating. New cI=%i.",TID,m_cRefI);
00421
00422   // Delegate this call to the outer object's AddRef.
00423   return m_pUnkOuter->AddRef();
00424 }
00425
00426
00427 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00428   Method:   COCruiseCar::CImpICar::Release
00429
00430   Summary:  The Release IUnknown member of this ICar interface
00431             implementation that delegates to m_pUnkOuter, whatever it is.
00432
00433   Args:     void
00434
00435   Modifies: m_cRefI.
00436
00437   Returns:  ULONG
00438               Returned by the delegated outer Release call.
00439 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00440 STDMETHODIMP_(ULONG) COCruiseCar::CImpICar::Release(void)
00441 {
00442   // Decrement the Interface Reference Count.
00443   --m_cRefI;
00444
00445   LOGF2("L<%X>: COCruiseCar::CImpICar::Release. Delegating. New cI=%i.",TID,m_cRefI);
00446
00447   // Delegate this call to the outer object's Release.
00448   return m_pUnkOuter->Release();
00449 }
00450
00451
00452 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00453   Method:   COCruiseCar::CImpICar::Shift
00454
00455   Summary:  The Shift member method of this ICar interface implementation.
00456             A simple empty method on a COCruiseCar COM object for tutorial
00457             purposes.  Presumably if this Car object were modeling
00458             a real Car then the Shift method would shift to the specified
00459             gear.
00460
00461   Args:     short nGear
00462               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00463
00464   Modifies: .
00465
00466   Returns:  HRESULT
00467               NOERROR
00468 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00469 STDMETHODIMP COCruiseCar::CImpICar::Shift(
00470                short nGear)
00471 {
00472   LOGF2("L<%X>: COCruiseCar::CImpICar::Shift. Delegating. nGear=%i.",TID,nGear);
00473
00474   // Delegate to the contained object implementation of ICar.
00475   m_pBackObj->m_pICar->Shift(nGear);
00476
00477   return NOERROR;
00478 }
00479
00480
00481 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00482   Method:   COCruiseCar::CImpICar::Clutch
00483
00484   Summary:  The Clutch member method of this ICar interface implementation.
00485             A simple empty method on a COCruiseCar COM object for tutorial
00486             purposes.  Presumably if this Car object were modeling
00487             a real Car then the Clutch method would engage the clutch the
00488             specified amount.
00489
00490   Args:     short nEngaged)
00491               Percent clutch is engaged (0 to 100%).
00492
00493   Modifies: .
00494
00495   Returns:  HRESULT
00496               NOERROR
00497 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00498 STDMETHODIMP COCruiseCar::CImpICar::Clutch(
00499                short nEngaged)
00500 {
00501   LOGF2("L<%X>: COCruiseCar::CImpICar::Clutch. Delegating. nEngaged=%i.",TID,nEngaged);
00502
00503   // Delegate to the contained object implementation of ICar.
00504   m_pBackObj->m_pICar->Clutch(nEngaged);
00505
00506   return NOERROR;
00507 }
00508
00509
00510 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00511   Method:   COCruiseCar::CImpICar::Speed
00512
00513   Summary:  The Propel member method of this ICar interface implementation.
00514             A simple empty method on a COCruiseCar COM object for tutorial
00515             purposes.  Presumably if this Car object were modeling
00516             a real Car then this method would accelerate/brake to bring
00517             the car to the specified speed.
00518
00519   Args:     short nMph
00520               New speed in miles per hour.
00521
00522   Modifies: .
00523
00524   Returns:  HRESULT
00525               NOERROR
00526 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00527 STDMETHODIMP COCruiseCar::CImpICar::Speed(
00528                short nMph)
00529 {
00530   LOGF2("L<%X>: COCruiseCar::CImpICar::Speed. Delegating. nMph=%i.",TID,nMph);
00531
00532   // Delegate to the contained object implementation of ICar.
00533   m_pBackObj->m_pICar->Speed(nMph);
00534
00535   return NOERROR;
00536 }
00537
00538
00539 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00540   Method:   COCruiseCar::CImpICar::Steer
00541
00542   Summary:  The Steer member method of this ICar interface implementation.
00543             A simple empty method on a COCruiseCar COM object for tutorial
00544             purposes.  Presumably if this Car object were modeling
00545             a real Car then the Steer method would set the steering
00546             angle of the Car.
00547
00548   Args:     short nAngle)
00549               0 degrees straight ahead, -45 Full left, +45 Full right.
00550
00551   Modifies: .
00552
00553   Returns:  HRESULT
00554               NOERROR
00555 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00556 STDMETHODIMP COCruiseCar::CImpICar::Steer(
00557                short nAngle)
00558 {
00559   LOGF2("L<%X>: COCruiseCar::CImpICar::Steer. Delegating. nAngle=%i.",TID,nAngle);
00560
00561   // Delegate to the contained object implementation of ICar.
00562   m_pBackObj->m_pICar->Steer(nAngle);
00563
00564   return NOERROR;
00565 }
00566
00567
00568 /*---------------------------------------------------------------------------
00569   COCruiseCar's nested implementation of the ICruise interface including
00570   Constructor, Destructor, QueryInterface, AddRef, Release,
00571   Engage, and Adjust.
00572 ---------------------------------------------------------------------------*/
00573
00574 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00575   Method:   COCruiseCar::CImpICruise::CImpICruise
00576
00577   Summary:  Constructor for the CImpICruise interface instantiation.
00578
00579   Args:     COCruiseCar* pBackObj,
00580               Back pointer to the parent outer object.
00581             IUnknown* pUnkOuter)
00582               Pointer to the outer Unknown.  For delegation.
00583
00584   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00585
00586   Returns:  void
00587 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00588 COCruiseCar::CImpICruise::CImpICruise(
00589   COCruiseCar* pBackObj,
00590   IUnknown* pUnkOuter)
00591 {
00592   // Init the Interface Ref Count (used for debugging only).
00593   m_cRefI = 0;
00594
00595   // Init the Back Object Pointer to point to the outer object.
00596   m_pBackObj = pBackObj;
00597
00598   // Init the CImpICruise interface's delegating Unknown pointer.  We use
00599   // the Back Object pointer for IUnknown delegation here if we are not
00600   // being aggregated.  If we are being aggregated we use the supplied
00601   // pUnkOuter for IUnknown delegation.  In either case the pointer
00602   // assignment requires no AddRef because the CImpICruise lifetime is
00603   // quaranteed by the lifetime of the parent object in which
00604   // CImpICruise is nested.
00605   if (NULL == pUnkOuter)
00606   {
00607     m_pUnkOuter = pBackObj;
00608     LOGF1("L<%X>: COCruiseCar::CImpICruise Constructor. Non-Aggregating.",TID);
00609   }
00610   else
00611   {
00612     m_pUnkOuter = pUnkOuter;
00613     LOGF1("L<%X>: COCruiseCar::CImpICruise Constructor. Aggregating.",TID);
00614   }
00615
00616   return;
00617 }
00618
00619
00620 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00621   Method:   COCruiseCar::CImpICruise::~CImpICruise
00622
00623   Summary:  Destructor for the CImpICruise interface instantiation.
00624
00625   Args:     void
00626
00627   Modifies: .
00628
00629   Returns:  void
00630 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00631 COCruiseCar::CImpICruise::~CImpICruise(void)
00632 {
00633   LOGF1("L<%X>: COCruiseCar::CImpICruise Destructor.",TID);
00634
00635   return;
00636 }
00637
00638
00639 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00640   Method:   COCruiseCar::CImpICruise::QueryInterface
00641
00642   Summary:  The QueryInterface IUnknown member of this ICruise interface
00643             implementation that delegates to m_pUnkOuter, whatever it is.
00644
00645   Args:     REFIID riid,
00646               [in] GUID of the Interface being requested.
00647             PPVOID ppv)
00648               [out] Address of the caller's pointer variable that will
00649               receive the requested interface pointer.
00650
00651   Modifies: .
00652
00653   Returns:  HRESULT
00654               Returned by the delegated outer QueryInterface call.
00655 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00656 STDMETHODIMP COCruiseCar::CImpICruise::QueryInterface(
00657                REFIID riid,
00658                PPVOID ppv)
00659 {
00660   LOGF1("L<%X>: COCruiseCar::CImpICruise::QueryInterface. Delegating.",TID);
00661
00662   // Delegate this call to the outer object's QueryInterface.
00663   return m_pUnkOuter->QueryInterface(riid, ppv);
00664 }
00665
00666
00667 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00668   Method:   COCruiseCar::CImpICruise::AddRef
00669
00670   Summary:  The AddRef IUnknown member of this ICruise interface
00671             implementation that delegates to m_pUnkOuter, whatever it is.
00672
00673   Args:     void
00674
00675   Modifies: m_cRefI.
00676
00677   Returns:  ULONG
00678               Returned by the delegated outer AddRef call.
00679 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00680 STDMETHODIMP_(ULONG) COCruiseCar::CImpICruise::AddRef(void)
00681 {
00682   // Increment the Interface Reference Count.
00683   ++m_cRefI;
00684
00685   LOGF2("L<%X>: COCruiseCar::CImpICruise::Addref. Delegating. New cI=%i.",TID,m_cRefI);
00686
00687   // Delegate this call to the outer object's AddRef.
00688   return m_pUnkOuter->AddRef();
00689 }
00690
00691
00692 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00693   Method:   COCruiseCar::CImpICruise::Release
00694
00695   Summary:  The Release IUnknown member of this ICruise interface
00696             implementation that delegates to m_pUnkOuter, whatever it is.
00697
00698   Args:     void
00699
00700   Modifies: m_cRefI.
00701
00702   Returns:  ULONG
00703               Returned by the delegated outer Release call.
00704 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00705 STDMETHODIMP_(ULONG) COCruiseCar::CImpICruise::Release(void)
00706 {
00707   // Decrement the Interface Reference Count.
00708   --m_cRefI;
00709
00710   LOGF2("L<%X>: COCruiseCar::CImpICruise::Release. Delegating. New cI=%i.",TID,m_cRefI);
00711
00712   // Delegate this call to the outer object's Release.
00713   return m_pUnkOuter->Release();
00714 }
00715
00716
00717 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00718   Method:   COCruiseCar::CImpICruise::Engage
00719
00720   Summary:  The Engage member method of this ICruise interface
00721             implementation.  A simple empty method on a COCruiseCar COM
00722             object for tutorial purposes.  Presumably if this Car object
00723             were modeling a real Car then the Engage method would turn
00724             the Cruise control system on or off.
00725
00726   Args:     BOOL bOnOff)
00727               TRUE for On; FALSE for Off.
00728
00729   Modifies: .
00730
00731   Returns:  HRESULT
00732               NOERROR
00733 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00734 STDMETHODIMP COCruiseCar::CImpICruise::Engage(
00735                BOOL bOnOff)
00736 {
00737   LOGF2("L<%X>: COCruiseCar::CImpICruise::Engage. Called. bOnOff=%i.",TID,bOnOff);
00738
00739   return NOERROR;
00740 }
00741
00742
00743 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00744   Method:   COCruiseCar::CImpICruise::Adjust
00745
00746   Summary:  The Adjust member method of this ICruise interface
00747             implementation.  A simple empty method on a COCruiseCar COM
00748             object for tutorial purposes.  Presumably if this Car object
00749             were modeling a real Car then the Adjust method would allow
00750             notching the cruise set speed up or down by increments of 3 mph.
00751
00752   Args:     BOOL bUpDown)
00753               TRUE for Up; FALSE for Down.
00754
00755   Modifies: .
00756
00757   Returns:  HRESULT
00758               NOERROR
00759 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00760 STDMETHODIMP COCruiseCar::CImpICruise::Adjust(
00761                BOOL bUpDown)
00762 {
00763   LOGF2("L<%X>: COCruiseCar::CImpICruise::Adjust. Called. bUpDown=%i.",TID,bUpDown);
00764
00765   return NOERROR;
00766 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/DimmerService.cpp Source File

  • NetDS
  • upnp
  • StepByStep
  • Step2

DimmerService.cpp

Go to the documentation of this file.
00001 // DimmerService.cpp : Implementation of CDimmerService
00002 #include "stdafx.h"
00003 #include "MyDevice.h"
00004 #include "DimmerService.h"
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // CDimmerService
00008
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IMoveMoney Member List

This is the complete list of members for IMoveMoney, including all inherited members.
Perform([in]long lngAcnt1,[in] long lngAcnt2,[in]long lngAmount,[in]long lngType,[out, retval]BSTR *pVal) IMoveMoney
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/ui.cpp Source File

  • Web
  • NetMeeting
  • NMChat2

ui.cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       UI.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1999-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 //****************************************************************************
00019 //
00020 // Special resource constants
00021 //
00022 //****************************************************************************
00023
00024 #define IDW_MSG   100
00025 #define IDW_USER  101
00026 #define IDW_EDIT  102
00027
00028 // See _rgColMember
00029 #define ILV_NAME    0
00030 #define ILV_TIME    1
00031 #define ILV_TEXT    2
00032
00033 const int DYP_EDIT   = 30;  // Fixed Height of Edit control
00034 const int DXP_USER   = 80;  // Fixed Width of User List
00035 const int YP_TOP     = 3;
00036 const int XP_LEFT    = 0;
00037
00038
00039 //****************************************************************************
00040 //
00041 // Prototypes
00042 //
00043 //****************************************************************************
00044
00045 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00046
00047 void UiSizeMsgWindow(int dx, int dy);
00048 void UiSendText(void);
00049 void UiClearText(void);
00050 void UiDisplayMessage(LPTSTR pszMsg, LPTSTR pszUser);
00051 CMember * UiGetSelectedMember(void);
00052
00053
00054 //****************************************************************************
00055 //
00056 // Global Variables
00057 //
00058 //****************************************************************************
00059
00060 HINSTANCE g_hInstExe    = NULL;          // Current Instance
00061 HACCEL    g_hAccelTable = NULL;          // Menu accelerators
00062 HMENU     g_hMenu       = NULL;          // Main Menu
00063 HWND      g_hwndMain    = NULL;          // Main Window
00064 HWND      g_hwndMsg     = NULL;          // Message window
00065 HWND      g_hwndEdit    = NULL;          // Edit Control
00066 HWND      g_hwndUser    = NULL;          // User List
00067
00068 // string constants (no change for international)
00069 #define MY_CLASS_NAME       TEXT("MyClassName")
00070
00071 // List column information
00072
00073 typedef struct
00074 {
00075     UINT  dwWidth;
00076     LPTSTR lpsz;
00077 }
00078     COL;
00079
00080
00081 // See ILV_*
00082 static COL _rgColMsg[] =
00083 {
00084     {DXP_USER,  TEXT("Name")},
00085     {80,        TEXT("Time")},
00086     {400,       TEXT("Message")},
00087 };
00088
00089
00090 //****************************************************************************
00091 //
00092 // BOOL CreateMsgWindow(void)
00093 //
00094 // Create the main message listview
00095 //
00096 //****************************************************************************
00097
00098 BOOL CreateMsgWindow(void)
00099 {
00100     g_hwndMsg = ::CreateWindow(TEXT("SysListView32"), NULL,
00101                     WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LVS_REPORT,
00102                     0, 0, 0, 0, g_hwndMain, (HMENU) IDW_USER, g_hInstExe, NULL);
00103     if (NULL != g_hwndMsg)
00104     {
00105         // Initialize column data
00106         int iCol  = 0;
00107     int iRet  = 0;
00108         COL  *lpCol = NULL;
00109         LV_COLUMN lvc;
00110
00111         lpCol = _rgColMsg;
00112         ::ZeroMemory(&lvc, sizeof(lvc));
00113         lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00114         lvc.fmt = LVCFMT_LEFT;
00115         for (iCol = 0; iCol < ARRAY_ELEMENTS(_rgColMsg); iCol++)
00116         {
00117             lvc.iSubItem = iCol;
00118             lvc.cx = lpCol->dwWidth;
00119             lvc.pszText = lpCol->lpsz;
00120
00121             iRet = ListView_InsertColumn(g_hwndMsg, iCol, &lvc);
00122             ASSERT(-1 != iRet);
00123             lpCol++;
00124         }
00125     }
00126     return (BOOL) g_hwndMsg;
00127 }
00128
00129
00130 //****************************************************************************
00131 //
00132 // BOOL CreateUserList(void)
00133 //
00134 // Create a listbox for the users
00135 //
00136 //****************************************************************************
00137
00138 BOOL CreateUserList(void)
00139 {
00140     g_hwndUser = ::CreateWindow(TEXT("SysListView32"), NULL,
00141                         WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LVS_REPORT | LVS_SHOWSELALWAYS,
00142                         0, 0, DXP_USER, 0, g_hwndMain, (HMENU) IDW_MSG, g_hInstExe, NULL);
00143     if (NULL != g_hwndUser)
00144     {
00145         // Initialize column data
00146         int iRet = 0;
00147         LV_COLUMN lvc;
00148         ::ZeroMemory(&lvc, sizeof(lvc));
00149         lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00150         lvc.fmt = LVCFMT_LEFT;
00151         lvc.iSubItem = 0;
00152         lvc.cx = DXP_USER;
00153         lvc.pszText = TEXT("Send To");
00154         iRet = ListView_InsertColumn(g_hwndUser, 0, &lvc);
00155         ASSERT(-1 != iRet);
00156     }
00157     return (BOOL) g_hwndUser;
00158 }
00159
00160
00161 WNDPROC lpProcEdit = NULL;
00162 LRESULT FAR PASCAL SubClsEdit(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00163
00164
00165 //****************************************************************************
00166 //
00167 // LRESULT FAR PASCAL SubClsEdit(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00168 //
00169 //****************************************************************************
00170
00171 LRESULT FAR PASCAL SubClsEdit(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00172 {
00173     if ((uMsg == WM_CHAR) && (VK_RETURN == wParam))
00174     {
00175         ::UiSendText();
00176         return 0L;
00177     }
00178
00179     return ::CallWindowProc(lpProcEdit, hwnd, uMsg, wParam, lParam);
00180 }
00181
00182
00183 //****************************************************************************
00184 //
00185 // BOOL CreateEditWindow(void)
00186 //
00187 //****************************************************************************
00188
00189 BOOL CreateEditWindow(void)
00190 {
00191     g_hwndEdit = ::CreateWindow(TEXT("EDIT"), NULL,
00192                         WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL,
00193                         0, 0, 0, DYP_EDIT, g_hwndMain, (HMENU) IDW_EDIT, g_hInstExe, NULL);
00194     if (NULL != g_hwndEdit)
00195     {
00196         // set the font for the window
00197
00198         lpProcEdit = (WNDPROC) ::GetWindowLong(g_hwndEdit, GWL_WNDPROC);
00199         ::SetWindowLong(g_hwndEdit, GWL_WNDPROC, (LONG)(WNDPROC) SubClsEdit);
00200     }
00201
00202     return (BOOL) g_hwndEdit;
00203 }
00204
00205
00206 //****************************************************************************
00207 //
00208 // BOOL InitMainUI(void)
00209 //
00210 // Initialize the window data and register the window class
00211 //
00212 //****************************************************************************
00213
00214 BOOL InitMainUI(void)
00215 {
00216     TCHAR szTitle[MAX_PATH + 1];
00217     WNDCLASS  wc;
00218
00219   ::ZeroMemory(szTitle, (MAX_PATH + 1) * sizeof(TCHAR));
00220   ::ZeroMemory(&wc, sizeof(WNDCLASS));
00221
00222     ASSERT(NULL != g_hInstExe);
00223
00224     g_hAccelTable = ::LoadAccelerators(g_hInstExe, MAKEINTRESOURCE(ID_APPACCEL));
00225
00226     ::LoadString(g_hInstExe, IDS_APP_TITLE, szTitle, CCHMAX(szTitle));
00227
00228     wc.style         = CS_HREDRAW | CS_VREDRAW;
00229     wc.lpfnWndProc   = (WNDPROC)WndProc;
00230     wc.cbClsExtra    = 0;
00231     wc.cbWndExtra    = 0;
00232     wc.hInstance     = g_hInstExe;
00233     wc.hIcon         = LoadIcon(g_hInstExe, MAKEINTRESOURCE(ICO_MAIN));
00234     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00235     wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
00236     wc.lpszMenuName  = MAKEINTRESOURCE(IDM_APP);
00237     wc.lpszClassName = MY_CLASS_NAME;
00238
00239     // Register the window class and return FALSE if unsuccesful.
00240     ::RegisterClass(&wc);
00241
00242     // Create a main window for this application instance.
00243     g_hwndMain = ::CreateWindow(MY_CLASS_NAME, szTitle, WS_OVERLAPPEDWINDOW,
00244                                 0, 0, 400, 300, NULL, NULL, g_hInstExe, NULL);
00245     ASSERT(NULL != g_hwndMain);
00246
00247     g_hMenu = ::GetMenu(g_hwndMain);
00248     ASSERT(NULL != g_hMenu);
00249
00250     return (NULL != g_hwndMain && NULL != g_hMenu);
00251 }
00252
00253
00254 //****************************************************************************
00255 //
00256 // BOOL ProcessStartup(LPSTR lpszCmd, int nCmdShow)
00257 //
00258 // Initialize the application after checking command line, etc.
00259 //
00260 //****************************************************************************
00261
00262 BOOL ProcessStartup(LPSTR lpszCmd, int nCmdShow)
00263 {
00264     ::GetInvokeInfo(&g_InvokeInfo);
00265     if (g_InvokeInfo.fValid)
00266     {
00267         if (::FindWindow(MY_CLASS_NAME, NULL))
00268         {
00269             return FALSE;
00270         }
00271     }
00272
00273     ::InitCommonControls();
00274
00275     HRESULT hr = ::CoInitialize(NULL);
00276     if (SUCCEEDED(hr))
00277     {
00278         if (::InitMainUI())
00279         {
00280             if (::CreateMsgWindow())
00281             {
00282                 if (::CreateUserList())
00283                 {
00284                     if (::CreateEditWindow())
00285                     {
00286                         ASSERT(NULL != g_hwndMain);
00287                         ::ShowWindow(g_hwndMain, nCmdShow);
00288                         ::UpdateWindow(g_hwndMain);
00289                         ::SetFocus(g_hwndEdit);
00290
00291                         hr = ::InitConfMgr();
00292                         if (SUCCEEDED(hr))
00293                         {
00294                             hr = ::InitApplet();
00295                             if (SUCCEEDED(hr))
00296                             {
00297                                 return TRUE;
00298                             }
00299                         }
00300                     }
00301                 }
00302             }
00303         }
00304     }
00305
00306     return FALSE;
00307 }
00308
00309
00310 //****************************************************************************
00311 //
00312 // void ProcessCleanup(void)
00313 //
00314 //****************************************************************************
00315
00316 void ProcessCleanup(void)
00317 {
00318     // Release all objects to which this app has a reference
00319     ::FreeConference();
00320     ::FreeApplet();
00321     ::FreeConfMgr();
00322
00323     // Uninitialize OLE
00324     ::CoUninitialize();
00325 }
00326
00327
00328 //****************************************************************************
00329 //
00330 // int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPSTR  lpszCmd, int nCmdShow)
00331 //
00332 // Main Windows entrypoint
00333 //
00334 //****************************************************************************
00335
00336 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hInstPrev, LPSTR lpszCmd, int nCmdShow)
00337 {
00338     g_hInstExe = hInstance;
00339
00340     if (::ProcessStartup(lpszCmd, nCmdShow))
00341     {
00342         MSG  msg;
00343         while (::GetMessage(&msg, NULL, 0, 0))
00344         {
00345             if (! ::TranslateAccelerator(msg.hwnd, g_hAccelTable, &msg))
00346             {
00347                 ::TranslateMessage(&msg);
00348                 ::DispatchMessage(&msg);
00349             }
00350         }
00351     }
00352
00353     ::ProcessCleanup();
00354
00355     return 0;
00356 }
00357
00358
00359 //****************************************************************************
00360 //
00361 // void UiDisplayMsg(LPTSTR pszMsg, LPTSTR pszUser)
00362 //
00363 //****************************************************************************
00364
00365 void UiDisplayMsg(LPTSTR pszMsg, LPTSTR pszUser)
00366 {
00367     if (NULL == pszUser)
00368     {
00369         pszUser = TEXT("");
00370     }
00371     ::UiDisplayMessage(pszMsg, pszUser);
00372 }
00373
00374
00375 //****************************************************************************
00376 //
00377 // void UiDisplaySysMsg(LPTSTR pszMsg, LPTSTR pszUser)
00378 //
00379 //****************************************************************************
00380
00381 void UiDisplaySysMsg(LPTSTR pszMsg, LPTSTR pszUser)
00382 {
00383     if (NULL == pszUser)
00384     {
00385         pszUser = TEXT("");
00386     }
00387     ::UiDisplayMessage(pszMsg, pszUser);
00388 }
00389
00390
00391 //****************************************************************************
00392 //
00393 // void UiDisplayMessage(LPTSTR pszMsg, LPTSTR pszUser)
00394 //
00395 //****************************************************************************
00396
00397 void UiDisplayMessage(LPTSTR pszMsg, LPTSTR pszUser)
00398 {
00399     int iItem = 0;
00400     LV_ITEM  lvItem;
00401     SYSTEMTIME sysTime;
00402     TCHAR szTime[MAX_PATH + 1];
00403   ::ZeroMemory(szTime, (MAX_PATH + 1) * sizeof(TCHAR));
00404
00405     ::ZeroMemory(&lvItem, sizeof(lvItem));
00406     lvItem.iItem = 0x0FFFFFFF;
00407     lvItem.mask = LVIF_PARAM | LVIF_TEXT;
00408     lvItem.pszText = pszUser;
00409     lvItem.cchTextMax = ::lstrlen(lvItem.pszText);
00410     iItem = ListView_InsertItem(g_hwndMsg, &lvItem);
00411
00412     // print out the time
00413     ::GetLocalTime(&sysTime);
00414
00415   _sntprintf(szTime,MAX_PATH, TEXT("%02d:%02d:%02d"), sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
00416     ListView_SetItemText(g_hwndMsg, iItem, ILV_TIME, szTime);
00417
00418     // print out the text
00419     ListView_SetItemText(g_hwndMsg, iItem, ILV_TEXT, pszMsg);
00420 }
00421
00422
00423
00424 //****************************************************************************
00425 //
00426 // void UiSendText(void)
00427 //
00428 // Send the line of text in the edit control.
00429 //
00430 //****************************************************************************
00431
00432 void UiSendText(void)
00433 {
00434     UINT  cb = 0;
00435     TCHAR sz[MAX_PATH + 1];
00436
00437   ::ZeroMemory(sz, (MAX_PATH + 1) * sizeof(TCHAR));
00438
00439     // Get the text line
00440     cb = ::SendMessage(g_hwndEdit, WM_GETTEXT, (WPARAM) CCHMAX(sz), (LPARAM) sz);
00441     ::SendMessage(g_hwndEdit, EM_SETSEL, (WPARAM) 0, (LPARAM)-1);
00442     ::SendMessage(g_hwndEdit, WM_SETTEXT, (WPARAM) 0, (LPARAM) "");
00443
00444     if (0 != cb && NULL != g_pSession)
00445     {
00446         CMember * pMember = ::UiGetSelectedMember();
00447         AppletUserID uidReceiver = (NULL != pMember) ? pMember->GetUID() : 0;
00448
00449         g_pSession->SendData(uidReceiver, ++cb, (LPBYTE) sz);
00450     }
00451 }
00452
00453
00454 //****************************************************************************
00455 //
00456 // void UiClearText(void)
00457 //
00458 //****************************************************************************
00459
00460 void UiClearText(void)
00461 {
00462     ListView_DeleteAllItems(g_hwndMsg);
00463 }
00464
00465
00466 //****************************************************************************
00467 //
00468 // void UiSizeMsgWindow(int dx, int dy)
00469 //
00470 //****************************************************************************
00471
00472 void UiSizeMsgWindow(int dx, int dy)
00473 {
00474     ::MoveWindow(g_hwndEdit, XP_LEFT, dy - DYP_EDIT, dx, DYP_EDIT, TRUE);
00475     dy -= (YP_TOP + DYP_EDIT);
00476
00477     ::MoveWindow(g_hwndUser, XP_LEFT, YP_TOP, DXP_USER, dy, TRUE);
00478     dx -= DXP_USER;
00479
00480     ::MoveWindow(g_hwndMsg, XP_LEFT + DXP_USER, YP_TOP, dx, dy, TRUE);
00481 }
00482
00483
00484
00485 //****************************************************************************
00486 //
00487 // void UiAddMember(CMember *pMember)
00488 //
00489 //****************************************************************************
00490
00491 void UiAddMember(CMember *pMember)
00492 {
00493     LPTSTR pszName = NULL;
00494     if (NULL != pMember)
00495     {
00496         pszName = pMember->GetName();
00497     }
00498     else
00499     {
00500         pszName = TEXT("everyone");
00501     }
00502
00503     LV_ITEM  lvItem;
00504     ::ZeroMemory(&lvItem, sizeof(lvItem));
00505     lvItem.iItem = ListView_GetItemCount(g_hwndUser);
00506     lvItem.mask = LVIF_PARAM | LVIF_TEXT;
00507     lvItem.pszText = pszName;
00508     lvItem.cchTextMax = ::lstrlen(pszName);
00509     lvItem.lParam = (LPARAM) pMember;
00510     ListView_InsertItem(g_hwndUser, &lvItem);
00511
00512     if (NULL != pMember)
00513     {
00514         ::UiDisplaySysMsg(TEXT("<joined>"), pszName);
00515     }
00516 }
00517
00518
00519 //****************************************************************************
00520 //
00521 // void UiRemoveMember(CMember *pMember)
00522 //
00523 //****************************************************************************
00524
00525 void UiRemoveMember(CMember *pMember)
00526 {
00527     if (NULL != pMember)
00528     {
00529         ::UiDisplaySysMsg(TEXT("<left>"), pMember->GetName());
00530     }
00531
00532     LV_FINDINFO findInfo;
00533     ::ZeroMemory(&findInfo, sizeof(findInfo));
00534     findInfo.flags = LVFI_PARAM;
00535     findInfo.lParam = (LPARAM) pMember;
00536     int iItem = ListView_FindItem(g_hwndUser, -1, &findInfo);
00537     ListView_DeleteItem(g_hwndUser, iItem);
00538 }
00539
00540
00541 //****************************************************************************
00542 //
00543 // CMember * UiGetSelectedMember(void)
00544 //
00545 //****************************************************************************
00546
00547 CMember * UiGetSelectedMember(void)
00548 {
00549     int iItem = ListView_GetNextItem(g_hwndUser, -1, LVNI_ALL | LVNI_SELECTED);
00550     if (-1 != iItem)
00551     {
00552         LV_ITEM lv;
00553         lv.mask = LVIF_PARAM;
00554         lv.iItem = iItem;
00555         ListView_GetItem(g_hwndUser, &lv);
00556         return (CMember *) lv.lParam;
00557     }
00558     return NULL;
00559 }
00560
00561
00562 //****************************************************************************
00563 //
00564 // void CmdExit(void)
00565 //
00566 // Shutdown the application.
00567 //
00568 //****************************************************************************
00569
00570 void CmdExit(void)
00571 {
00572     ::DestroyWindow(g_hwndMain);
00573 }
00574
00575
00576 //****************************************************************************
00577 //
00578 // void CmdAbout(void)
00579 //
00580 // Display the about box
00581 //
00582 //****************************************************************************
00583
00584 void CmdAbout(void)
00585 {
00586     TCHAR szVersion[MAX_PATH + 1];
00587   ::ZeroMemory(szVersion, (MAX_PATH + 1) * sizeof(TCHAR));
00588
00589     ::LoadString(g_hInstExe, IDS_VERSION, szVersion, CCHMAX(szVersion));
00590
00591     ::ShellAbout(g_hwndMain, szVersion, NULL, LoadIcon(g_hInstExe, MAKEINTRESOURCE(ICO_MAIN)));
00592 }
00593
00594
00595 //****************************************************************************
00596 //
00597 // void CmdRegisterLocal(void)
00598 //
00599 // Register local chat such that in the future NetMeeting knows how to
00600 // invoke this applet.
00601 //
00602 //****************************************************************************
00603
00604 void CmdRegisterLocal(void)
00605 {
00606     HRESULT hr = ::RegisterNonStandardAppletInvokeInfo();
00607     ASSERT(S_OK == hr);
00608 }
00609
00610
00611 //****************************************************************************
00612 //
00613 // void CmdInvokeRemote(void)
00614 //
00615 // Invoke the same applet on all the machines participating in this conference.
00616 //
00617 //****************************************************************************
00618
00619 void CmdInvokeRemote(void)
00620 {
00621     if (NULL != g_pSession)
00622     {
00623         g_pSession->InvokeApplet();
00624     }
00625 }
00626
00627
00628 //****************************************************************************
00629 //
00630 // LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
00631 //
00632 // Handle a WM_COMMAND message
00633 //
00634 //****************************************************************************
00635
00636 LRESULT MsgCmdMain(HWND hwnd, WPARAM wParam, LPARAM lParam)
00637 {
00638     switch (GET_WM_COMMAND_ID(wParam, lParam))
00639     {
00640     case IDM_EXIT:
00641     {
00642 			::CmdExit();
00643       break;
00644     }
00645     case IDM_VIEW_CLEAR:
00646     {
00647 			::UiClearText();
00648       break;
00649     }
00650     case IDM_ABOUT:
00651     {
00652 			::CmdAbout();
00653       break;
00654     }
00655     case IDM_REGISTER_LOCAL:
00656     {
00657 			::CmdRegisterLocal();
00658       break;
00659     }
00660     case IDM_INVOKE_ALL:
00661     {
00662 			::CmdInvokeRemote();
00663       break;
00664     }
00665     }
00666     return 0L;
00667 }
00668
00669
00670 //****************************************************************************
00671 //
00672 // LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00673 //
00674 // Main Window proc
00675 //
00676 //****************************************************************************
00677
00678 LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00679 {
00680     LRESULT lRet = 0;
00681     switch (uMsg)
00682     {
00683     case WM_COMMAND:
00684     {
00685       lRet = ::MsgCmdMain(hwnd, wParam, lParam);
00686       break;
00687     }
00688     case WM_DESTROY:
00689     {
00690       ::PostQuitMessage(0);
00691       break;
00692     }
00693     case WM_CLOSE:
00694     {
00695 			::CmdExit();
00696       break;
00697     }
00698     case WM_SIZE:
00699     {
00700 			::UiSizeMsgWindow(LOWORD(lParam), HIWORD(lParam));
00701       break;
00702     }
00703     case WM_GETMINMAXINFO:
00704     {
00705       ((LPMINMAXINFO) lParam)->ptMinTrackSize.x = 325;
00706       ((LPMINMAXINFO) lParam)->ptMinTrackSize.y = 250;
00707       break;
00708     }
00709     default:
00710     {
00711       lRet = ::DefWindowProc(hwnd, uMsg, wParam, lParam);
00712       break;
00713     }
00714     }
00715     return lRet;
00716 }
00717
00718
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSerialStream Member List

This is the complete list of members for CSerialStream, including all inherited members.
_awcReadAheadBuf | CSerialStream | [private]
_cCharsReadAhead | CSerialStream | [private]
_fUnGotChar | CSerialStream | [private]
_mmInputStream | CSerialStream | [private]
_pCurChar | CSerialStream | [private]
_specialCharHash | CSerialStream | [private, static]
_wch | CSerialStream | [private]
CSerialStream() | CSerialStream |
Eof() | CSerialStream |
GetChar() | CSerialStream |
Init(WCHAR *pwszFileName) | CSerialStream |
IsUnicodeNumber(WCHAR *pwcInputBuf, unsigned uLen, WCHAR &wch) | CSerialStream | [private]
UnGetChar(WCHAR wch) | CSerialStream |
Generated on Wed Nov 13 2024 16:57:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/PropSpec.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

PropSpec.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       propspec.hxx
00006 //
00007 //  Contents:   C++ wrapper(s) for FULLPROPSPEC
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __PRPOSPEC_HXX__ )
00012 #define __PRPOSPEC_HXX__
00013
00014 #include <windows.h>
00015 #include <ole2.h>
00016
00017 //+-------------------------------------------------------------------------
00018 //
00019 //  Class:      CFullPropertySpec
00020 //
00021 //  Purpose:    Describes full (PropertySet\Property) name of a property.
00022 //
00023 //--------------------------------------------------------------------------
00024
00025 class CFullPropSpec
00026 {
00027 public:
00028
00029     //
00030     // Constructors
00031     //
00032
00033     CFullPropSpec();
00034     CFullPropSpec( GUID const & guidPropSet, PROPID pidProperty );
00035     CFullPropSpec( GUID const & guidPropSet, WCHAR const * wcsProperty );
00036
00037     //
00038     // Validity check
00039     //
00040
00041     inline BOOL IsValid() const;
00042
00043     //
00044     // Copy constructors/assignment/clone
00045     //
00046
00047     CFullPropSpec( CFullPropSpec const & Property );
00048     CFullPropSpec & operator=( CFullPropSpec const & Property );
00049
00050     //
00051     // Destructor
00052     //
00053
00054     ~CFullPropSpec();
00055
00056     //
00057     // Memory allocation
00058     //
00059
00060     void * operator new( size_t size );
00061     inline void * operator new( size_t size, void * p );
00062     void   operator delete( void * p );
00063
00064     //
00065     // C/C++ conversion
00066     //
00067
00068     inline FULLPROPSPEC * CastToStruct();
00069     inline FULLPROPSPEC const * CastToStruct() const;
00070
00071
00072     //
00073     // Comparators
00074     //
00075
00076     int operator==( CFullPropSpec const & prop ) const;
00077     int operator!=( CFullPropSpec const & prop ) const;
00078
00079     //
00080     // Member variable access
00081     //
00082
00083     inline void SetPropSet( GUID const & guidPropSet );
00084     inline GUID const & GetPropSet() const;
00085
00086     void SetProperty( PROPID pidProperty );
00087     BOOL SetProperty( WCHAR const * wcsProperty );
00088     inline WCHAR const * GetPropertyName() const;
00089     inline PROPID GetPropertyPropid() const;
00090     inline PROPSPEC GetPropSpec() const;
00091
00092     inline BOOL IsPropertyName() const;
00093     inline BOOL IsPropertyPropid() const;
00094
00095 private:
00096
00097     GUID     _guidPropSet;
00098     PROPSPEC _psProperty;
00099 };
00100
00101
00102
00103 //
00104 // Inline methods for CFullPropSpec
00105 //
00106
00107 inline void * CFullPropSpec::operator new( size_t size )
00108 {
00109     void * p = CoTaskMemAlloc( size );
00110
00111     return( p );
00112 }
00113
00114 inline void * CFullPropSpec::operator new( size_t size, void * p )
00115 {
00116     return( p );
00117 }
00118
00119 inline void CFullPropSpec::operator delete( void * p )
00120 {
00121     if ( p )
00122         CoTaskMemFree( p );
00123 }
00124
00125 inline BOOL CFullPropSpec::IsValid() const
00126 {
00127     return ( _psProperty.ulKind == PRSPEC_PROPID ||
00128              0 != _psProperty.lpwstr );
00129 }
00130
00131 inline void CFullPropSpec::SetPropSet( GUID const & guidPropSet )
00132 {
00133     _guidPropSet = guidPropSet;
00134 }
00135
00136 inline GUID const & CFullPropSpec::GetPropSet() const
00137 {
00138     return( _guidPropSet );
00139 }
00140
00141 inline PROPSPEC CFullPropSpec::GetPropSpec() const
00142 {
00143     return( _psProperty );
00144 }
00145
00146 inline WCHAR const * CFullPropSpec::GetPropertyName() const
00147 {
00148     return( _psProperty.lpwstr );
00149 }
00150
00151 inline PROPID CFullPropSpec::GetPropertyPropid() const
00152 {
00153     return( _psProperty.propid );
00154 }
00155
00156 inline BOOL CFullPropSpec::IsPropertyName() const
00157 {
00158     return( _psProperty.ulKind == PRSPEC_LPWSTR );
00159 }
00160
00161 inline BOOL CFullPropSpec::IsPropertyPropid() const
00162 {
00163     return( _psProperty.ulKind == PRSPEC_PROPID );
00164 }
00165
00166
00167
00168 #endif // __PRPOSPEC_HXX__
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/setup.exe/resource.h Source File

  • SysMgmt
  • Msi
  • setup.exe

resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved.
00004 //
00005 //  File:       resource.h
00006 //
00007 //--------------------------------------------------------------------------
00008
00009 #ifndef _RESOURCE_H_39383913_1926_4E7F_9741_8F454BD9A99C_
00010 #define _RESOURCE_H_39383913_1926_4E7F_9741_8F454BD9A99C_
00011
00012 #define IDS_APP_TITLE                  11
00013 #define IDS_OUTOFMEM                   12
00014 #define IDS_NOMSI                      13
00015 #define IDS_CANCEL                     14
00016 #define IDS_MISSING_RESOURCE           15
00017 #define IDS_BANNER_TEXT                16
00018 #define IDS_DEFAULT_PRODUCT            17
00019 #define IDS_DOWNLOADING_PACKAGE        18
00020 #define IDS_VALIDATING_SIGNATURE       19
00021 #define IDS_REQUIRES_NEWER_VERSION     20
00022 #define IDS_NO_WINTRUST                21
00023 #define IDS_UNTRUSTED                  22
00024 #define IDS_INVALID_PATH               23
00025 #define IDS_USER_CANCELLED             24
00026 #define IDS_INVALID_VER_STR            25
00027 #define IDS_REQUIRES_ADMIN_PRIV        26
00028 #define IDS_DOWNLOADING_UPDATE         27
00029 #define IDS_NOUPDATE                   28
00030 #define IDS_FAILED_TO_UPGRADE_MSI      29
00031 #define IDS_REBOOT_REQUIRED            30
00032 #define IDS_INCORRECT_UPDATE           31
00033 #define IDS_INSTALL_ERROR              32
00034 #define IDS_ALLOW_MSI_UPDATE           33
00035 #define IDS_INVALID_OPERATION          34
00036 #define IDS_USAGE                      35
00037 #define IDS_OS_NOT_SUPPORTED           36
00038
00039 #define IDI_INSTALLER                  99
00040
00041 #define IDC_DOWNLOAD_ICON             101
00042 #define IDC_DOWNLOAD_CANCEL           102
00043 #define IDC_DOWNLOAD_BANNER           103
00044 #define IDC_DOWNLOAD_PROGRESSBAR      104
00045 #define IDC_DOWNLOAD_ACTIONTEXT       105
00046
00047 #define IDD_PROGRESS                 1101
00048
00049 #endif //_RESOURCE_H_39383913_1926_4E7F_9741_8F454BD9A99C_
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/stdafx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

stdafx.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       stdafx.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // stdafx.cpp : source file that includes just the standard includes
00012 //  stdafx.pch will be the pre-compiled header
00013 //  stdafx.obj will contain the pre-compiled type information
00014
00015 #include "stdafx.h"
00016
00017 #include <atlimpl.cpp>
00018
00019 HRESULT WINAPI CMyUIExtModule::UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister)
00020 {
00021   static const WCHAR szIPS32[] = _T("InprocServer32");
00022   static const WCHAR szCLSID[] = _T("CLSID");
00023   static const WCHAR szThreadingModel[] = _T("ThreadingModel");
00024   static const WCHAR szModel[] = _T("Apartment");
00025
00026   HRESULT hRes = S_OK;
00027
00028   LPOLESTR lpOleStrCLSIDValue;
00029   ::StringFromCLSID(clsid, &lpOleStrCLSIDValue);
00030
00031   CRegKey key;
00032   if (bRegister)
00033   {
00034     LONG lRes = key.Open(HKEY_CLASSES_ROOT, szCLSID);
00035     if (lRes == ERROR_SUCCESS)
00036     {
00037       lRes = key.Create(key, lpOleStrCLSIDValue);
00038       if (lRes == ERROR_SUCCESS)
00039       {
00040         WCHAR szModule[_MAX_PATH];
00041         ::GetModuleFileName(m_hInst, szModule, _MAX_PATH);
00042         key.SetKeyValue(szIPS32, szModule);
00043         key.SetKeyValue(szIPS32, szModel, szThreadingModel);
00044       }
00045     }
00046     if (lRes != ERROR_SUCCESS)
00047       hRes = HRESULT_FROM_WIN32(lRes);
00048   }
00049   else
00050   {
00051     key.Attach(HKEY_CLASSES_ROOT);
00052     if (key.Open(key, szCLSID) == ERROR_SUCCESS)
00053       key.RecurseDeleteKey(lpOleStrCLSIDValue);
00054   }
00055   ::CoTaskMemFree(lpOleStrCLSIDValue);
00056   return hRes;
00057 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/InstProv/Utils.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • InstProv

Utils.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  UTILS.CPP
00006
00007 //
00008
00009 //  Module: WMI Instance provider sample code
00010
00011 //
00012
00013 //  Purpose: General purpose utilities.
00014
00015 //
00016
00017 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00018 //
00019 //***************************************************************************
00020
00021 #include <objbase.h>
00022 #include "sample.h"
00023
00024
00025
00026
00027 //***************************************************************************
00028 //
00029 // CreateInst
00030 //
00031 // Purpose: Creates a new instance and sets
00032 //          the inital values of the properties.
00033 //
00034 // Return:   S_OK if all is well, otherwise an error code is returned
00035 //
00036 //***************************************************************************
00037
00038 SCODE CreateInst(IWbemServices * pNamespace, LPWSTR pKey, long lVal,
00039                                         IWbemClassObject ** pNewInst,
00040                                         WCHAR * pwcClassName,
00041                     IWbemContext  *pCtx)
00042 {
00043     SCODE sc;
00044     IWbemClassObject * pClass = NULL;
00045     sc = pNamespace->GetObject(pwcClassName, 0, pCtx, &pClass, NULL);
00046     if(sc != S_OK)
00047         return WBEM_E_FAILED;
00048     sc = pClass->SpawnInstance(0, pNewInst);
00049     pClass->Release();
00050     if(FAILED(sc))
00051         return sc;
00052     VARIANT v;
00053
00054     // Set the key property value.
00055
00056     v.vt = VT_BSTR;
00057     v.bstrVal = SysAllocString(pKey);
00058   if (!v.bstrVal)
00059     return WBEM_E_OUT_OF_MEMORY;
00060
00061     sc = (*pNewInst)->Put(L"MyKey", 0, &v, 0);
00062     VariantClear(&v);
00063   if(FAILED(sc))
00064         return sc;
00065
00066     // Set the number property value.
00067
00068     v.vt = VT_I4;
00069     v.lVal = lVal;
00070     sc = (*pNewInst)->Put(L"MyValue", 0, &v, 0);
00071     return sc;
00072 }
00073
00074
00075 /******************************************************************************
00076  *
00077  *  Name: GetCurrentImpersonationLevel
00078  *
00079  *
00080  *  Description:
00081  *
00082  *      Get COM impersonation level of caller.
00083  *
00084  *****************************************************************************/
00085
00086 DWORD GetCurrentImpersonationLevel ()
00087 {
00088   DWORD t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00089
00090     HANDLE t_ThreadToken = NULL ;
00091
00092     BOOL t_Status = OpenThreadToken (
00093
00094     GetCurrentThread() ,
00095     TOKEN_QUERY,
00096     TRUE,
00097     &t_ThreadToken
00098   ) ;
00099
00100     if ( t_Status )
00101     {
00102     SECURITY_IMPERSONATION_LEVEL t_Level = SecurityAnonymous ;
00103     DWORD t_Returned = 0 ;
00104
00105     t_Status = GetTokenInformation (
00106
00107       t_ThreadToken ,
00108       TokenImpersonationLevel ,
00109       & t_Level ,
00110       sizeof ( SECURITY_IMPERSONATION_LEVEL ) ,
00111       & t_Returned
00112     ) ;
00113
00114     CloseHandle ( t_ThreadToken ) ;
00115
00116     if ( t_Status == FALSE )
00117     {
00118       t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00119     }
00120     else
00121     {
00122       switch ( t_Level )
00123       {
00124         case SecurityAnonymous:
00125         {
00126           t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00127         }
00128         break ;
00129
00130         case SecurityIdentification:
00131         {
00132           t_ImpersonationLevel = RPC_C_IMP_LEVEL_IDENTIFY ;
00133         }
00134         break ;
00135
00136         case SecurityImpersonation:
00137         {
00138           t_ImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE ;
00139         }
00140         break ;
00141
00142         case SecurityDelegation:
00143         {
00144           t_ImpersonationLevel = RPC_C_IMP_LEVEL_DELEGATE ;
00145         }
00146         break ;
00147
00148         default:
00149         {
00150           t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00151         }
00152         break ;
00153       }
00154     }
00155   }
00156   else
00157   {
00158         ULONG t_LastError = GetLastError () ;
00159
00160         if ( t_LastError == ERROR_NO_IMPERSONATION_TOKEN || t_LastError == ERROR_NO_TOKEN )
00161         {
00162             t_ImpersonationLevel = RPC_C_IMP_LEVEL_DELEGATE ;
00163         }
00164         else
00165     {
00166       if ( t_LastError == ERROR_CANT_OPEN_ANONYMOUS )
00167       {
00168         t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00169       }
00170       else
00171       {
00172         t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00173       }
00174     }
00175     }
00176
00177   return t_ImpersonationLevel ;
00178 }
00179
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/SimpDnd.Cpp Source File

  • Com
  • Fundamentals
  • SimpDnd

SimpDnd.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: Simple.cpp
00003 //
00004 //      Main source file for the Simple OLE 2.0 object container
00005 //
00006 // Functions:
00007 //
00008 //      WinMain         - Program entry point
00009 //      MainWndProc     - Processes messages for the frame window
00010 //      About           - Processes messages for the about dialog
00011 //      DocWndProc      - Processes messages for the doc window
00012 //
00013 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00014 //**********************************************************************
00015
00016 #include "pre.h"
00017 #include "iocs.h"
00018 #include "ias.h"
00019 #include "app.h"
00020 #include "site.h"
00021 #include "doc.h"
00022
00023 // This line is needed for the debug utilities in OLESTD
00024 extern "C" {
00025         OLEDBGDATA_MAIN("SIMPDND")
00026 }
00027
00028 CSimpleApp FAR * lpCSimpleApp;
00029
00030 //**********************************************************************
00031 //
00032 // WinMain
00033 //
00034 // Purpose:
00035 //
00036 //      Program entry point
00037 //
00038 // Parameters:
00039 //
00040 //      HANDLE hInstance        - Instance handle for this instance
00041 //
00042 //      HANDLE hPrevInstance    - Instance handle for the last instance
00043 //
00044 //      LPSTR lpCmdLine         - Pointer to the command line
00045 //
00046 //      int nCmdShow            - Window State
00047 //
00048 // Return Value:
00049 //
00050 //      msg.wParam
00051 //
00052 // Function Calls:
00053 //      Function                        Location
00054 //
00055 //      CSimpleApp::CSimpleApp          APP.CPP
00056 //      CSimpleApp::fInitApplication    APP.CPP
00057 //      CSimpleApp::fInitInstance       APP.CPP
00058 //      CSimpleApp::HandleAccelerators  APP.CPP
00059 //      CSimpleApp::~CSimpleApp         APP.CPP
00060 //      OleUIInitialize                 OLESTD
00061 //      OleUIUninitialize               OLESTD
00062 //      GetMessage                      Windows API
00063 //      TranslateMessage                Windows API
00064 //      DispatchMessage                 Windows API
00065 //
00066 // Comments:
00067 //
00068 //********************************************************************
00069
00070 int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
00071
00072 {
00073         MSG msg;
00074
00075         // needed for LRPC to work properly...
00076         SetMessageQueue(96);
00077
00078         lpCSimpleApp = new CSimpleApp;
00079
00080         // we will add one ref count on our App. later when we want to destroy
00081         // the App object we will release this  ref count. when the App's ref
00082         // count goes to 0, it will be deleted.
00083         lpCSimpleApp->AddRef();
00084
00085         // app initialization
00086         if (!hPrevInstance)
00087                 if (!lpCSimpleApp->fInitApplication(hInstance))
00088                         return (FALSE);
00089
00090         // instance initialization
00091         if (!lpCSimpleApp->fInitInstance(hInstance, nCmdShow))
00092                 return (FALSE);
00093
00094         /* Initialization required for OLE 2 UI library.  This call is
00095         **    needed ONLY if we are using the static link version of the UI
00096         **    library. If we are using the DLL version, we should NOT call
00097         **    this function in our application.
00098         */
00099 #if 0
00100         if (!OleUIInitialize(hInstance, hPrevInstance))
00101                 {
00102                 OleDbgOut("Could not initialize OLEUI library\n");
00103                 return FALSE;
00104                 }
00105 #endif
00106         // message loop
00107         while (GetMessage(&msg, NULL, NULL, NULL))
00108                 if (!lpCSimpleApp->HandleAccelerators(&msg))
00109                         {
00110                         TranslateMessage(&msg);    /* Translates virtual key codes */
00111                         DispatchMessage(&msg);     /* Dispatches message to window */
00112                         }
00113
00114         // De-initialization for UI libraries.  Just like OleUIInitialize, this
00115         // funciton is needed ONLY if we are using the static link version of the
00116         // OLE UI library.
00117 #if 0
00118         OleUIUninitialize();
00119 #endif
00120
00121         // Release the ref count added on the App above. this will make
00122         // the App's ref count go to 0, and the App object will be deleted.
00123         lpCSimpleApp->Release();
00124
00125         return (msg.wParam);          /* Returns the value from PostQuitMessage */
00126 }
00127
00128
00129 //**********************************************************************
00130 //
00131 // MainWndProc
00132 //
00133 // Purpose:
00134 //
00135 //      Processes messages for the frame window
00136 //
00137 // Parameters:
00138 //
00139 //      HWND hWnd       - Window handle for frame window
00140 //
00141 //      UINT message    - Message value
00142 //
00143 //      WPARAM wParam   - Message info
00144 //
00145 //      LPARAM lParam   - Message info
00146 //
00147 // Return Value:
00148 //
00149 //      long
00150 //
00151 // Function Calls:
00152 //      Function                        Location
00153 //
00154 //      CSimpleApp::lCommandHandler     APP.CPP
00155 //      CSimpleApp::DestroyDocs         APP.CPP
00156 //      CSimpleApp::lCreateDoc          APP.CPP
00157 //      CSimpleApp::lSizeHandler        APP.CPP
00158 //      CSimpleDoc::lAddVerbs           DOC.CPP
00159 //      PostQuitMessage                 Windows API
00160 //      DefWindowProc                   Windows API
00161 //
00162 // Comments:
00163 //
00164 //********************************************************************
00165
00166 //@@WTK WIN32, UNICODE
00167 //long FAR PASCAL _export MainWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00168 long FAR PASCAL EXPORT MainWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00169
00170 {
00171
00172         switch (message)
00173                 {
00174                 case WM_COMMAND:           // message: command from application menu
00175                         return lpCSimpleApp->lCommandHandler(hWnd, message, wParam, lParam);
00176                         break;
00177
00178                 case WM_CREATE:
00179                         return lpCSimpleApp->lCreateDoc(hWnd, message, wParam, lParam);
00180                         break;
00181
00182                 case WM_DESTROY:                  // message: window being destroyed
00183                         lpCSimpleApp->DestroyDocs();  // need to destroy the doc...
00184                         PostQuitMessage(0);
00185                         break;
00186
00187                 case WM_INITMENUPOPUP:
00188                         // is this the edit menu?
00189                         if ( LOWORD(lParam) == 1)
00190                                 return lpCSimpleApp->m_lpDoc->lAddVerbs();
00191
00192                         break;
00193
00194                 case WM_SIZE:
00195                         return lpCSimpleApp->lSizeHandler(hWnd, message, wParam, lParam);
00196
00197                 default:                          // Passes it on if unproccessed
00198                         return (DefWindowProc(hWnd, message, wParam, lParam));
00199                 }
00200                 return (NULL);
00201 }
00202
00203
00204 //**********************************************************************
00205 //
00206 // About
00207 //
00208 // Purpose:
00209 //
00210 //      Processes dialog box messages
00211 //
00212 // Parameters:
00213 //
00214 //      HWND hWnd       - Window handle for dialog box
00215 //
00216 //      UINT message    - Message value
00217 //
00218 //      WPARAM wParam   - Message info
00219 //
00220 //      LPARAM lParam   - Message info
00221 //
00222 // Return Value:
00223 //
00224 // Function Calls:
00225 //      Function                    Location
00226 //
00227 //      EndDialog                   Windows API
00228 //
00229 // Comments:
00230 //
00231 //********************************************************************
00232
00233 //@@WTK WIN32, UNICODE
00234 //BOOL FAR PASCAL _export About(HWND hDlg,unsigned message,WORD wParam,LONG lParam)
00235 BOOL FAR PASCAL EXPORT About(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
00236
00237 {
00238         switch (message) {
00239         case WM_INITDIALOG:                /* message: initialize dialog box */
00240                 return (TRUE);
00241
00242         case WM_COMMAND:                      /* message: received a command */
00243                 //@@WTK WIN32, UNICODE
00244                 //if (wParam == IDOK                /* "OK" box selected?          */
00245                 if (LOWORD(wParam) == IDOK                /* "OK" box selected?          */
00246                 //@@WTK WIN32, UNICODE
00247                 //|| wParam == IDCANCEL) {      /* System menu close command? */
00248                 || LOWORD(wParam) == IDCANCEL) {      /* System menu close command? */
00249                 EndDialog(hDlg, TRUE);        /* Exits the dialog box        */
00250                 return (TRUE);
00251                 }
00252                 break;
00253         }
00254         return (FALSE);                           /* Didn't process a message    */
00255 }
00256
00257 //**********************************************************************
00258 //
00259 // DocWndProc
00260 //
00261 // Purpose:
00262 //
00263 //      Processes dialog box messages
00264 //
00265 // Parameters:
00266 //
00267 //      HWND hWnd       - Window handle for doc window
00268 //
00269 //      UINT message    - Message value
00270 //
00271 //      WPARAM wParam   - Message info
00272 //
00273 //      LPARAM lParam   - Message info
00274 //
00275 // Return Value:
00276 //
00277 // Function Calls:
00278 //      Function                            Location
00279 //
00280 //      CSimpleApp::PaintApp                APP.CPP
00281 //      BeginPaint                          Windows API
00282 //      EndPaint                            Windows API
00283 //      DefWindowProc                       Windows API
00284 //      IOleObject::QueryInterface          Object
00285 //      IOleObject::DoVerb                  Object
00286 //      CSimpleSite::GetObjRect             SITE.CPP
00287 //      CSimpleDoc::QueryDrag               DOC.CPP
00288 //      CSimpleDoc::DoDragDrop              DOC.CPP
00289 //      SetTimer                            Windows API
00290 //      KillTimer                           Windows API
00291 //      SetCapture                          Windows API
00292 //      ReleaseCapture                      Windows API
00293 //
00294 // Comments:
00295 //
00296 //********************************************************************
00297
00298 //@@WTK WIN32, UNICODE
00299 //long FAR PASCAL _export DocWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00300 long FAR PASCAL EXPORT DocWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
00301 {
00302         HDC hDC;
00303         PAINTSTRUCT ps;
00304
00305         switch (message) {
00306                 case WM_PAINT:
00307
00308                         hDC = BeginPaint(hWnd, &ps);
00309
00310                         if (lpCSimpleApp)
00311                                 lpCSimpleApp->PaintApp (hDC);
00312
00313                         EndPaint(hWnd, &ps);
00314                         break;
00315
00316                 case WM_LBUTTONDBLCLK:
00317                         {
00318                         POINT pt;
00319
00320                         pt.x = (int)(short)LOWORD (lParam );
00321                         pt.y = (int)(short)HIWORD (lParam );
00322
00323                         if (lpCSimpleApp->m_lpDoc->m_lpSite &&
00324                                 lpCSimpleApp->m_lpDoc->m_lpSite->m_lpOleObject)
00325                                 {
00326                                 RECT rect;
00327
00328                                 lpCSimpleApp->m_lpDoc->m_lpSite->GetObjRect(&rect);
00329
00330                                 if ( PtInRect(&rect, pt) )
00331                                         {
00332                                         // Execute object's default verb
00333                                         lpCSimpleApp->m_lpDoc->m_lpSite->m_lpOleObject->DoVerb(
00334                                                         OLEIVERB_PRIMARY, (LPMSG)&message,
00335                                                         &lpCSimpleApp->m_lpDoc->m_lpSite->m_OleClientSite,
00336                                                         -1, hWnd, &rect);
00337                                         }
00338                                 }
00339                         }
00340                         break;
00341
00342                 case WM_LBUTTONDOWN:
00343                         {
00344                         POINT pt;
00345
00346                         pt.x = (int)(short)LOWORD (lParam );
00347                         pt.y = (int)(short)HIWORD (lParam );
00348
00349                         /* OLE2NOTE: check if this is a button down on the region
00350                         **    that is a handle to start a drag operation. for us,
00351                         **    this this is any where in the window. we
00352                         **    do NOT want to start a drag immediately; we want to
00353                         **    wait until the mouse moves a certain threshold. or a
00354                         **    certain amount of time has elapsed. if
00355                         **    LButtonUp comes before the drag is started, then
00356                         **    the fPendingDrag state is cleared. we must capture
00357                         **    the mouse to ensure the modal state is handled
00358                         **    properly.
00359                         */
00360                         if (lpCSimpleApp->m_lpDoc->QueryDrag(pt) )
00361                                 {
00362                                 lpCSimpleApp->m_lpDoc->m_fPendingDrag = TRUE;
00363                                 lpCSimpleApp->m_lpDoc->m_ptButDown = pt;
00364                                 SetTimer(hWnd, 1, lpCSimpleApp->m_nDragDelay, NULL);
00365                                 SetCapture(hWnd);
00366                                 }
00367                         break;
00368                         }
00369
00370                 case WM_LBUTTONUP:
00371
00372                         if (lpCSimpleApp->m_lpDoc->m_fPendingDrag)
00373                                 {
00374                                 /* ButtonUP came BEFORE distance/time threshholds were
00375                                 **    exceeded. clear fPendingDrag state.
00376                                 */
00377                                 ReleaseCapture();
00378                                 KillTimer(hWnd, 1);
00379                                 lpCSimpleApp->m_lpDoc->m_fPendingDrag = FALSE;
00380                                 }
00381                         break;
00382
00383                 case WM_MOUSEMOVE:
00384                         {
00385                         if (lpCSimpleApp->m_lpDoc->m_fPendingDrag)
00386                                 {
00387                                 int  x = (int)(short)LOWORD (lParam );
00388                                 int  y = (int)(short)HIWORD (lParam );
00389                                 POINT pt = lpCSimpleApp->m_lpDoc->m_ptButDown;
00390                                 int nDragMinDist = lpCSimpleApp->m_nDragMinDist;
00391
00392                                 if (! ( ((pt.x - nDragMinDist) <= x)
00393                                                 && (x <= (pt.x + nDragMinDist))
00394                                                 && ((pt.y - nDragMinDist) <= y)
00395                                                 && (y <= (pt.y + nDragMinDist)) ) )
00396                                         {
00397                                         // mouse moved beyond threshhold to start drag
00398                                         ReleaseCapture();
00399                                         KillTimer(hWnd, 1);
00400                                         lpCSimpleApp->m_lpDoc->m_fPendingDrag = FALSE;
00401
00402                                         // perform the modal drag/drop operation.
00403                                         lpCSimpleApp->m_lpDoc->DoDragDrop( );
00404                                         }
00405                                 }
00406                         break;
00407                         }
00408
00409                 case WM_TIMER:
00410                         {
00411                         // drag time delay threshhold exceeded -- start drag
00412                         ReleaseCapture();
00413                         KillTimer(hWnd, 1);
00414                         lpCSimpleApp->m_lpDoc->m_fPendingDrag = FALSE;
00415
00416                         // perform the modal drag/drop operation.
00417                         lpCSimpleApp->m_lpDoc->DoDragDrop( );
00418                         break;
00419                         }
00420
00421                 default:                          /* Passes it on if unproccessed */
00422                         return (DefWindowProc(hWnd, message, wParam, lParam));
00423         }
00424         return (NULL);
00425 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFiles/CrmFiles.Cpp Source File

  • Com
  • Services
  • Crm
  • CrmFiles

CrmFiles.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: CrmFiles.cpp
00004
00005 ----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009
00010
00011 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00012
00013
00014
00015 This source code is intended only as a supplement to Microsoft
00016
00017 Development Tools and/or on-line documentation. See these other
00018
00019 materials for detailed information regarding Microsoft code samples.
00020
00021
00022
00023 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00024
00025 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00026
00027 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00028
00029 PARTICULAR PURPOSE.
00030
00031 ==========================================================================+*/
00032
00033 // CrmFiles.cpp : Implementation of DLL Exports.
00034
00035
00036 // Note: Proxy/Stub Information
00037 //    To merge the proxy/stub code into the object DLL, add the file
00038 //    dlldatax.c to the project.  Make sure precompiled headers
00039 //    are turned off for this file, and add _MERGE_PROXYSTUB to the
00040 //    defines for the project.
00041 //
00042 //    If you are not running WinNT4.0 or Win95 with DCOM, then you
00043 //    need to remove the following define from dlldatax.c
00044 //    #define _WIN32_WINNT 0x0500
00045 //
00046 //    Further, if you are running MIDL without /Oicf switch, you also
00047 //    need to remove the following define from dlldatax.c.
00048
00049 //    #define USE_STUBLESS_PROXY
00050 //
00051 //    Modify the custom build rule for CrmFiles.idl by adding the following
00052 //    files to the Outputs.
00053 //      CrmFiles_p.c
00054 //      dlldata.c
00055 //    To build a separate proxy/stub DLL,
00056 //    run nmake -f CrmFilesps.mk in the project directory.
00057
00058 #include "stdafx.h"
00059 #include "resource.h"
00060 #include "initguid.h"
00061 #include "CrmFiles.h"
00062 #include "dlldatax.h"
00063
00064 #include "CrmFiles_i.c"
00065 #include "CrmFilesWorker.h"
00066 #include "CrmFilesCompensator.h"
00067
00068 #ifdef _MERGE_PROXYSTUB
00069 extern "C" HINSTANCE hProxyDll;
00070 #endif
00071
00072 CComModule _Module;
00073
00074 BEGIN_OBJECT_MAP(ObjectMap)
00075   OBJECT_ENTRY(CLSID_CrmFilesWorker, CCrmFilesWorker)
00076   OBJECT_ENTRY(CLSID_CrmFilesCompensator, CCrmFilesCompensator)
00077 END_OBJECT_MAP()
00078
00079 /////////////////////////////////////////////////////////////////////////////
00080 // DLL Entry Point
00081
00082 extern "C"
00083 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00084 {
00085   lpReserved;
00086 #ifdef _MERGE_PROXYSTUB
00087   if (!PrxDllMain(hInstance, dwReason, lpReserved))
00088     return FALSE;
00089 #endif
00090   if (dwReason == DLL_PROCESS_ATTACH)
00091   {
00092     _Module.Init(ObjectMap, hInstance);
00093     DisableThreadLibraryCalls(hInstance);
00094   }
00095   else if (dwReason == DLL_PROCESS_DETACH)
00096     _Module.Term();
00097   return TRUE;    // ok
00098 }
00099
00100 /////////////////////////////////////////////////////////////////////////////
00101 // Used to determine whether the DLL can be unloaded by OLE
00102
00103 STDAPI DllCanUnloadNow(void)
00104 {
00105 #ifdef _MERGE_PROXYSTUB
00106   if (PrxDllCanUnloadNow() != S_OK)
00107     return S_FALSE;
00108 #endif
00109   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00110 }
00111
00112 /////////////////////////////////////////////////////////////////////////////
00113 // Returns a class factory to create an object of the requested type
00114
00115 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00116 {
00117 #ifdef _MERGE_PROXYSTUB
00118   if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
00119     return S_OK;
00120 #endif
00121   return _Module.GetClassObject(rclsid, riid, ppv);
00122 }
00123
00124 /////////////////////////////////////////////////////////////////////////////
00125 // DllRegisterServer - Adds entries to the system registry
00126
00127 STDAPI DllRegisterServer(void)
00128 {
00129 #ifdef _MERGE_PROXYSTUB
00130   HRESULT hRes = PrxDllRegisterServer();
00131   if (FAILED(hRes))
00132     return hRes;
00133 #endif
00134   // registers object, typelib and all interfaces in typelib
00135   return _Module.RegisterServer(TRUE);
00136 }
00137
00138 /////////////////////////////////////////////////////////////////////////////
00139 // DllUnregisterServer - Removes entries from the system registry
00140
00141 STDAPI DllUnregisterServer(void)
00142 {
00143 #ifdef _MERGE_PROXYSTUB
00144   PrxDllUnregisterServer();
00145 #endif
00146   _Module.UnregisterServer();
00147   return S_OK;
00148 }
00149
00150
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/DrawArea.h Source File

  • NetDS
  • MessageQueuing
  • c_draw

DrawArea.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // drawarea.h : header file
00013 //
00014 //
00015
00016 #define MAX_MSG_BODY_LEN 32
00017
00018 typedef struct tagLINE
00019 {
00020   CPoint ptStart;
00021   CPoint ptEnd;
00022 } LINE;
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CDrawArea window
00026
00027 class CDrawArea : public CEdit
00028 {
00029 // Construction
00030 public:
00031   CDrawArea();
00032
00033 // Attributes
00034 public:
00035
00036 protected:
00037   CPoint m_ptLast;
00038   CList<LINE, LINE &> m_listLines;
00039
00040 // Operations
00041 public:
00042   void AddLine(LINE line);
00043   void AddKeystroke(char *mbsKey);
00044
00045 // Overrides
00046   // ClassWizard generated virtual function overrides
00047   //{{AFX_VIRTUAL(CDrawArea)
00048   //}}AFX_VIRTUAL
00049
00050 // Implementation
00051 public:
00052   virtual ~CDrawArea();
00053
00054   // Generated message map functions
00055 protected:
00056   //{{AFX_MSG(CDrawArea)
00057   afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00058   afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00059   afx_msg void OnPaint();
00060   afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00061   afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
00062   afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00063   afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00064   afx_msg void OnSetFocus(CWnd* pOldWnd);
00065   afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00066   afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00067   //}}AFX_MSG
00068
00069   DECLARE_MESSAGE_MAP()
00070 };
00071
00072 /////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/GraphObj.Cpp Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

GraphObj.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 // GraphObj.cpp : Implementation of DLL Exports.
00013
00014
00015 // Note: Proxy/Stub Information
00016 //    To merge the proxy/stub code into the object DLL, add the file
00017 //    dlldatax.c to the project.  Make sure precompiled headers
00018 //    are turned off for this file, and add _MERGE_PROXYSTUB to the
00019 //    defines for the project.
00020 //
00021 //    If you are not running WinNT4.0 or Win95 with DCOM, then you
00022 //    need to remove the following define from dlldatax.c
00023 //    #define _WIN32_WINNT 0x0400
00024 //
00025 //    Further, if you are running MIDL without /Oicf switch, you also
00026 //    need to remove the following define from dlldatax.c.
00027 //    #define USE_STUBLESS_PROXY
00028 //
00029 //    Modify the custom build rule for GraphObj.idl by adding the following
00030 //    files to the Outputs.
00031 //      GraphObj_p.c
00032 //      dlldata.c
00033 //    To build a separate proxy/stub DLL,
00034 //    run nmake -f GraphObjps.mk in the project directory.
00035
00036 #include "stdafx.h"
00037 #include "resource.h"
00038 #include "initguid.h"
00039 #include "GraphObj.h"
00040 #include "dlldatax.h"
00041
00042 #include "GraphObj_i.c"
00043 #include "Point.h"
00044 #include "Line.h"
00045
00046 #ifdef _MERGE_PROXYSTUB
00047 extern "C" HINSTANCE hProxyDll;
00048 #endif
00049
00050 CComModule _Module;
00051
00052 BEGIN_OBJECT_MAP(ObjectMap)
00053   OBJECT_ENTRY(CLSID_Point, CPoint)
00054   OBJECT_ENTRY(CLSID_Line, CLine)
00055 END_OBJECT_MAP()
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // DLL Entry Point
00059
00060 extern "C"
00061 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00062 {
00063   lpReserved;
00064 #ifdef _MERGE_PROXYSTUB
00065   if (!PrxDllMain(hInstance, dwReason, lpReserved))
00066     return FALSE;
00067 #endif
00068   if (dwReason == DLL_PROCESS_ATTACH)
00069   {
00070     _Module.Init(ObjectMap, hInstance);
00071     DisableThreadLibraryCalls(hInstance);
00072   }
00073   else if (dwReason == DLL_PROCESS_DETACH)
00074     _Module.Term();
00075   return TRUE;    // ok
00076 }
00077
00078 /////////////////////////////////////////////////////////////////////////////
00079 // Used to determine whether the DLL can be unloaded by OLE
00080
00081 STDAPI DllCanUnloadNow(void)
00082 {
00083 #ifdef _MERGE_PROXYSTUB
00084   if (PrxDllCanUnloadNow() != S_OK)
00085     return S_FALSE;
00086 #endif
00087   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00088 }
00089
00090 /////////////////////////////////////////////////////////////////////////////
00091 // Returns a class factory to create an object of the requested type
00092
00093 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00094 {
00095 #ifdef _MERGE_PROXYSTUB
00096   if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
00097     return S_OK;
00098 #endif
00099   return _Module.GetClassObject(rclsid, riid, ppv);
00100 }
00101
00102 /////////////////////////////////////////////////////////////////////////////
00103 // DllRegisterServer - Adds entries to the system registry
00104
00105 STDAPI DllRegisterServer(void)
00106 {
00107 #ifdef _MERGE_PROXYSTUB
00108   HRESULT hRes = PrxDllRegisterServer();
00109   if (FAILED(hRes))
00110     return hRes;
00111 #endif
00112   // registers object, typelib and all interfaces in typelib
00113   return _Module.RegisterServer(TRUE);
00114 }
00115
00116 /////////////////////////////////////////////////////////////////////////////
00117 // DllUnregisterServer - Removes entries from the system registry
00118
00119 STDAPI DllUnregisterServer(void)
00120 {
00121 #ifdef _MERGE_PROXYSTUB
00122   PrxDllUnregisterServer();
00123 #endif
00124   _Module.UnregisterServer();
00125   return S_OK;
00126 }
00127
00128
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/fileidx.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

fileidx.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module FILEIDX.CPP | This module contains the index array code
00008 // for a Comma Seperated Value (CSV) Simple Provider.
00009 //
00010 //
00011 #include "headers.h"
00012 #include "fileidx.h"
00013 #include <stdlib.h>
00014
00015 static const ARRAY_INIT_SIZE = 1000;
00016 static const DELETED_ROW = 1;
00017
00018 //--------------------------------------------------------------------
00019 // @mfunc Constructor for this class
00020 //
00021 // @rdesc NONE
00022 //
00023 CFileIdx::CFileIdx
00024     (
00025     void
00026     )
00027 {
00028     m_rgDex = NULL;
00029     m_ulDexCnt = 0;
00030 }
00031
00032
00033 //--------------------------------------------------------------------
00034 // @mfunc Destructor for this class
00035 //
00036 // @rdesc NONE
00037 //
00038 CFileIdx:: ~CFileIdx()
00039 {
00040   SAFE_FREE(m_rgDex);
00041 }
00042
00043
00044 //--------------------------------------------------------------------
00045 // @mfunc Initialization routine
00046 //
00047 // @rdesc BOOLEAN value
00048 //      @flag TRUE | Succeeded
00049 //      @flag FALSE | Failed to Initialize
00050 //
00051 BOOL CFileIdx::fInit
00052     (
00053     void
00054     )
00055 {
00056     //Allocate Offset Array
00057     m_rgDex = (LPFILEDEX) PROVIDER_ALLOC( ARRAY_INIT_SIZE * sizeof( FILEDEX ) );
00058     if (NULL == m_rgDex)
00059         return FALSE;
00060
00061     m_ulDexCnt = ARRAY_INIT_SIZE;
00062     return TRUE;
00063 }
00064
00065
00066 //--------------------------------------------------------------------
00067 // @mfunc ReAllocation of Current Index Array.  This can be called to
00068 // increase the array of index structures.
00069 //
00070 // @rdesc BOOLEAN value
00071 //      @flag TRUE | Succeeded
00072 //      @flag FALSE | Failed to Initialize
00073 //
00074 BOOL CFileIdx::ReAlloc
00075     (
00076     DBCOUNTITEM ulRows                //@parm IN | Number of rows to increase array for.
00077     )
00078 {
00079     VOID* pDex;
00080
00081     // Change the array size
00082     pDex = PROVIDER_REALLOC( m_rgDex, ((m_ulDexCnt + ulRows) * sizeof( FILEDEX )));
00083     if( !pDex )
00084         return FALSE;
00085
00086   m_ulDexCnt += ulRows;
00087     m_rgDex = (FILEDEX*) pDex;
00088     return TRUE;
00089 }
00090
00091
00092 //--------------------------------------------------------------------
00093 // @mfunc Set the offset into the file in bytes for a particular row.
00094 // If the Index is beyond current allocation, reallocation is attempted.
00095 //
00096 // @rdesc BOOLEAN value
00097 //      @flag TRUE | Succeeded
00098 //      @flag FALSE | Failed to Initialize
00099 //
00100 BOOL CFileIdx::SetIndex
00101     (
00102     DBCOUNTITEM ulDex,        //@parm IN | Row Index value
00103     ULONG       ulOffset      //@parm IN | Offset of Row in the File
00104     )
00105 {
00106     // Check index and realloc if beyond our current range
00107     if (m_ulDexCnt <= ulDex)
00108         if (FALSE == ReAlloc( ARRAY_INIT_SIZE ))
00109             return FALSE;
00110
00111     m_rgDex[ulDex].ulOffset = ulOffset;
00112     m_rgDex[ulDex].bStatus = FALSE;
00113
00114     return TRUE;
00115 }
00116
00117
00118 //--------------------------------------------------------------------
00119 // @mfunc Mark the row as deleted.
00120 //
00121 // @rdesc BOOLEAN value
00122 //      @flag TRUE | Succeeded
00123 //      @flag FALSE | Failed to Initialize
00124 //
00125 BOOL CFileIdx::DeleteRow
00126     (
00127     DBCOUNTITEM ulDex                 //@parm IN | Row Index value
00128     )
00129 {
00130     // Index should alway be valid
00131     assert((0 <= ulDex) && (m_ulDexCnt > ulDex));
00132
00133     // Mark Row
00134     m_rgDex[ulDex].bStatus = DELETED_ROW;
00135
00136     return TRUE;
00137 }
00138
00139
00140 //--------------------------------------------------------------------
00141 // @mfunc Has the row been deleted or not
00142 //
00143 // @rdesc BOOLEAN value
00144 //      @flag TRUE | Row Already Deleted
00145 //      @flag FALSE | Row has not been Deleted
00146 //
00147 BOOL CFileIdx::IsDeleted
00148     (
00149     DBCOUNTITEM ulDex                 //@parm IN | Row Index value
00150     )
00151 {
00152     // Index should alway be valid and Check deletion status
00153     if ( ((ulDex <= 0) || (ulDex > m_ulDexCnt)) ||
00154      (DELETED_ROW != m_rgDex[ulDex].bStatus) )
00155         return FALSE;
00156
00157     return TRUE;
00158 }
00159
00160
00161 //--------------------------------------------------------------------
00162 // @mfunc Return the File Offset that the row starts
00163 //
00164 // @rdesc Offset from Beginning of File
00165 //
00166 ULONG CFileIdx::GetRowOffset
00167     (
00168     DBCOUNTITEM ulDex                 //@parm IN | Row Index value
00169     )
00170 {
00171     // Index should alway be valid
00172     assert((0 <= ulDex) && (m_ulDexCnt > ulDex));
00173
00174     return m_rgDex[ulDex].ulOffset;
00175 }
00176
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_LOCAL_HEAP_INFO_BLOCK Member List

This is the complete list of members for _LOCAL_HEAP_INFO_BLOCK, including all inherited members.
AllocatedBytes | _LOCAL_HEAP_INFO_BLOCK
AllocatedEntries | _LOCAL_HEAP_INFO_BLOCK
FreeBytes | _LOCAL_HEAP_INFO_BLOCK
FreeEntries | _LOCAL_HEAP_INFO_BLOCK
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpwizard/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpwizard

StdAfx.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       StdAfx.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // stdafx.h : include file for standard system include files,
00012 //      or project specific include files that are used frequently,
00013 //      but are changed infrequently
00014
00015 #if !defined(AFX_STDAFX_H__501092D7_8966_11D1_B93C_00A0C9A06D2D__INCLUDED_)
00016 #define AFX_STDAFX_H__501092D7_8966_11D1_B93C_00A0C9A06D2D__INCLUDED_
00017
00018 #if _MSC_VER >= 1000
00019 #pragma once
00020 #endif // _MSC_VER >= 1000
00021
00022 #define STRICT
00023
00024 #include <afxwin.h>
00025 #include <afxdisp.h>
00026 #include "afxdlgs.h"
00027
00028
00029
00030 #define _ATL_APARTMENT_THREADED
00031
00032 #include <activeds.h>
00033 #include <dsadmin.h>
00034
00035 #include <atlbase.h>
00036
00037 #if ( _ATL_VER >= 0x0300 )
00038 #define _ATL_NO_UUIDOF
00039 #endif
00040
00041
00042
00043
00044 class CSCPWizModule : public CComModule
00045 {
00046 public:
00047   HRESULT WINAPI UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister);
00048 };
00049
00050 #define DECLARE_REGISTRY_CLSID() \
00051 static HRESULT WINAPI UpdateRegistry(BOOL bRegister) \
00052 { \
00053     return _Module.UpdateRegistryCLSID(GetObjectCLSID(), bRegister); \
00054 }
00055
00056 extern CSCPWizModule _Module;
00057
00058 #include <atlcom.h>
00059
00060 #include <activeds.h> // Active Directory Services Interfaces
00061
00062 //{{AFX_INSERT_LOCATION}}
00063 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00064
00065 #endif // !defined(AFX_STDAFX_H__501092D7_8966_11D1_B93C_00A0C9A06D2D__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • About

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120     MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122     // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal) {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authorization/dbauthadmin.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Authorization

dbauthadmin.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName: DBAuthAdmin.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011 #pragma once
00012
00013 #if !defined(AFX_DBAUTHADMIN_H__4FA9EA92_4802_416B_8134_11B639C8217D__INCLUDED_)
00014 #define AFX_DBAUTHADMIN_H__4FA9EA92_4802_416B_8134_11B639C8217D__INCLUDED_
00015
00016 #include "resource.h"       // main symbols
00017 #include "DBAuthPlugin.h"
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CDBAuthAdmin
00021 class ATL_NO_VTABLE CDBAuthAdmin :
00022     public IDispatchImpl<IDBAuthAdmin, &IID_IDBAuthAdmin, &LIBID_DBAUTHPLUGINLib, 9, 0 >,
00023     public ISupportErrorInfo,
00024     public CComObjectRootEx<CComMultiThreadModel>,
00025     public CComCoClass<CDBAuthAdmin, &CLSID_DBAuthAdmin>
00026 {
00027 public:
00028     CDBAuthAdmin()
00029     {
00030         m_pDBAuthPlugin = NULL;
00031     }
00032
00033     ~CDBAuthAdmin()
00034     {
00035     }
00036
00037     STDMETHOD( Initialize )( CDBAuthPlugin *pPlugin );
00038
00039
00040 DECLARE_REGISTRY_RESOURCEID( IDR_DBAUTHADMIN )
00041
00042 DECLARE_PROTECT_FINAL_CONSTRUCT()
00043
00044 BEGIN_COM_MAP( CDBAuthAdmin )
00045     COM_INTERFACE_ENTRY( IDispatch )
00046     COM_INTERFACE_ENTRY( ISupportErrorInfo )
00047     COM_INTERFACE_ENTRY( IDBAuthAdmin )
00048 END_COM_MAP()
00049
00050 // ISupportsErrorInfo
00051     STDMETHOD( InterfaceSupportsErrorInfo )( REFIID riid );
00052
00053 // IDBAuthAdmin
00054 public:
00055     STDMETHOD( AddUser )( BSTR bstrUserName );
00056     STDMETHOD( RemoveUser )( BSTR bstrUserName );
00057     STDMETHOD( VerifyUser )( BSTR bstrUserName, /*[out, retval]*/ VARIANT_BOOL *pbFound );
00058     STDMETHOD( GetUsers )( /*[out, retval]*/ BSTR *pbstrUserNames );
00059 private:
00060     CDBAuthPlugin       *m_pDBAuthPlugin;
00061
00062 };
00063
00064 #endif // !defined(AFX_DBAUTHADMIN_H__4FA9EA92_4802_416B_8134_11B639C8217D__INCLUDED_)
00065
00066
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/RemClien/UTCRUCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • RemClien

UTCRUCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCruiseCar COM
00005              object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and
00009              IUtility interfaces.  This is done through Containment reuse
00010              of a COCruiseCar COM object (specifically providing its ICar
00011              and ICruise interface features).  COUtilityCruiseCar adds its
00012              own native implementation of the IUtility interface.  The
00013              contained CruiseCar object is implemented in an outside
00014              APTSERVE.EXE remote server.
00015
00016              This multiple interface COM Object Class is achieved via
00017              the technique of nested classes: the implementation of the
00018              IUtility interface is nested inside of the COUtilityCruiseCar
00019              COM object class.
00020
00021              For a comprehensive tutorial code tour of this module's
00022              contents and offerings see the tutorial REMCLIEN.HTM
00023              file.  For more specific technical details on the internal
00024              workings see the comments dispersed throughout the
00025              module's source code.
00026
00027   Classes:   COUtilityCruiseCar.
00028
00029   Functions: .
00030
00031   Origin:    3-27-96: atrent - Editor inheritance from APTCLIEN source.
00032
00033 ----------------------------------------------------------------------------
00034   This file is part of the Microsoft COM Tutorial Code Samples.
00035
00036   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00037
00038   This source code is intended only as a supplement to Microsoft
00039   Development Tools and/or on-line documentation.  See these other
00040   materials for detailed information regarding Microsoft code samples.
00041
00042   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00043   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00044   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00045   PARTICULAR PURPOSE.
00046 ==========================================================================+*/
00047
00048 #if !defined(UTCRUCAR_H)
00049 #define UTCRUCAR_H
00050
00051 #ifdef __cplusplus
00052
00053 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00054   ObjectClass: COUtilityCruiseCar
00055
00056   Summary:     COM Object Class for COUtilityCruiseCar COM Objects.
00057                COM objects of this class augment COCruiseCar COM objects
00058                with the IUtility interface features of Offroad and Winch.
00059                COCruiseCar is reused to offer this COUtilityCruiseCar COM
00060                Object the ICar interface features of Shift, Clutch, Speed,
00061                Steer and the ICruise interface features of Engage and
00062                Adjust.  This COUtilityCruiseCar COM object class is
00063                constructed by containment reuse of the COCruiseCar COM
00064                object class.  The mulitple interfaces on this COM object
00065                class are constructed via the nested class interfaces
00066                technique.
00067
00068   Interfaces:  IUnknown
00069                  Standard interface providing COM object features.
00070                ICar
00071                  Basic car features.
00072                ICruise
00073                  Cruise control system features.
00074                IUtility
00075                  Sport-utility Car operation features.  Implemented in
00076                  this COM object.
00077
00078   Aggregation: Yes, COUtilityCruiseCar COM objects are aggregatable by
00079                passing a non-NULL pUnkOuter IUnknown pointer into
00080                the constructor.
00081 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00082 class COUtilityCruiseCar : public IUnknown
00083 {
00084   public:
00085     // Main Object Constructor & Destructor.
00086     COUtilityCruiseCar(IUnknown* pUnkOuter);
00087     ~COUtilityCruiseCar(void);
00088
00089     // A general method for initializing a newly created UtilityCruiseCar.
00090     HRESULT Init(void);
00091
00092     // IUnknown members. Main object, non-delegating.
00093     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00094     STDMETHODIMP_(ULONG) AddRef(void);
00095     STDMETHODIMP_(ULONG) Release(void);
00096
00097     // We get this ICar interface pointer via containment reuse of the
00098     // ICar interface in an instantiated COCruiseCar.
00099     ICar*                m_pICar;
00100
00101     // We get this ICruise interface pointer via containment reuse of the
00102     // ICruise interface in an instantiated COCruisecar.
00103     ICruise*             m_pICruise;
00104
00105   private:
00106     // We declare nested class interface implementations here.
00107
00108     // We implement the ICar interface in this COUtilityCruiseCar COM
00109     // object class.  This is a delegating interface for the one
00110     // in the contained COCruiseCar COM object.
00111     class CImpICar : public ICar
00112     {
00113       public:
00114         // Interface Implementation Constructor & Destructor.
00115         CImpICar(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00116         ~CImpICar(void);
00117
00118         // IUnknown methods.
00119         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00120         STDMETHODIMP_(ULONG) AddRef(void);
00121         STDMETHODIMP_(ULONG) Release(void);
00122
00123         // ICar methods.
00124         STDMETHODIMP         Shift(short nGear);
00125         STDMETHODIMP         Clutch(short nEngaged);
00126         STDMETHODIMP         Speed(short nMph);
00127         STDMETHODIMP         Steer(short nAngle);
00128
00129       private:
00130         // Data private to this COUtilityCar interface implementation of ICar.
00131         ULONG                m_cRefI;     // Interface Ref Count (debugging).
00132         COUtilityCruiseCar*  m_pBackObj;  // Parent Object back pointer.
00133         IUnknown*            m_pUnkOuter; // Outer unknown for Delegation.
00134     };
00135
00136     // We implement the ICruise interface in this COUtilityCruiseCar COM
00137     // object class.  This ICruise implementation is a delegating
00138     // interface for the one provided in the contained COCruiseCar COM
00139     // object.
00140     class CImpICruise : public ICruise
00141     {
00142       public:
00143         // Interface Implementation Constructor & Destructor.
00144         CImpICruise(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00145         ~CImpICruise(void);
00146
00147         // IUnknown methods.
00148         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00149         STDMETHODIMP_(ULONG) AddRef(void);
00150         STDMETHODIMP_(ULONG) Release(void);
00151
00152         // ICruise methods.
00153         STDMETHODIMP Engage(BOOL bOnOff);
00154         STDMETHODIMP Adjust(BOOL bUpDown);
00155
00156       private:
00157         // Data private to this interface implementation of ICruise.
00158         ULONG                m_cRefI;     // Interface Ref Count (debugging).
00159         COUtilityCruiseCar*  m_pBackObj;  // Parent Object back pointer.
00160         IUnknown*            m_pUnkOuter; // Outer unknown for Delegation.
00161     };
00162
00163     // We implement the IUtility interface in this COUtilityCruiseCar COM
00164     // object class.  This is the native interface that we are using as an
00165     // augmentation to the existing COCruiseCar COM object class.
00166     class CImpIUtility : public IUtility
00167     {
00168       public:
00169         // Interface Implementation Constructor & Destructor.
00170         CImpIUtility(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00171         ~CImpIUtility(void);
00172
00173         // IUnknown members.
00174         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00175         STDMETHODIMP_(ULONG) AddRef(void);
00176         STDMETHODIMP_(ULONG) Release(void);
00177
00178         // IUtility members.
00179         STDMETHODIMP Offroad(short nGear);
00180         STDMETHODIMP Winch(short nRpm);
00181
00182       private:
00183         // Data private to this interface implementation of IUtility.
00184         ULONG                m_cRefI;     // Interface Ref Count (debugging).
00185         COUtilityCruiseCar*  m_pBackObj;  // Parent Object back pointer.
00186         IUnknown*            m_pUnkOuter; // Outer unknown for Delegation.
00187     };
00188
00189     // Make the otherwise private and nested IUtility, ICruise, and ICar
00190     // interface implementations friend instantiations of this class.
00191     friend CImpICar;
00192     friend CImpICruise;
00193     friend CImpIUtility;
00194
00195     // Private data of COUtilityCruiseCar COM objects.
00196
00197     // Nested ICar implementation instantiation.
00198     CImpICar        m_ImpICar;
00199
00200     // Nested ICruise implementation instantiation.
00201     CImpICruise     m_ImpICruise;
00202
00203     // Nested IUtility implementation instantiation.  This IUtility
00204     // interface is implemented inside this COUtilityCruiseCar object
00205     // as a native interface.
00206     CImpIUtility    m_ImpIUtility;
00207
00208     // Main Object reference count.
00209     ULONG           m_cRefs;
00210
00211     // Outer unknown (aggregation & delegation). Used when this
00212     // COUtilityCruiseCar object is being aggregated.
00213     IUnknown*       m_pUnkOuter;
00214 };
00215
00216 typedef COUtilityCruiseCar* PCOUtilityCruiseCar;
00217
00218 // Here is a prototpye for the UtilityCruiseCar Creation function.
00219 HRESULT CreateUtilityCruiseCar(
00220           IUnknown* pUnkOuter,
00221           REFIID riid,
00222           PPVOID ppv);
00223
00224 #endif // __cplusplus
00225
00226
00227 #endif // UTCRUCAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCNotify/QCNotify.Idl Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCNotify

QCNotify.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      QCNotify.idl
00003   Summary:   Interfaces for Queued Components Order Entry Sample 1
00004   Classes:   Declared: Notify
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1998 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "mtxattr.h"  // For TRANSACTION_REQUIRED
00023
00024 import "oaidl.idl";
00025
00026 // Shipping Status - used between Ship and Notify components
00027
00028 typedef [public] enum _ShipStatus
00029 {
00030   ssUnprocessed   = 0,  // as yet unprocessed
00031   ssShipped     = 1,  // item is on its way
00032   ssBackOrdered   = 2,  // item ordered from supplier
00033   ssNotStocked    = 3,  // we no longer stock this item
00034   ssUnrecognizedItem  = 4   // item identifier not recognized
00035 } ShipStatus;
00036
00037
00038 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00039   Interface: INotify
00040   Summary:   Returns shipping status from Shipping component to requesting client
00041   Methods:   HRESULT CustomerId - sets Customer Identifier property
00042        HRESULT OrderId - sets Order Identifier property
00043        HRESULT LineItem - returns status about one line item
00044              HRESULT ProcessOrder - Completes order
00045 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00046
00047 [
00048   helpstring("INotify Interface"), uuid(6DD1E6EF-28C1-11D2-B5B6-00C04FC340EE),
00049   object, dual, nonextensible, hidden, pointer_default(unique),
00050   QUEUEABLE
00051 ]
00052 interface INotify : IDispatch
00053 {
00054   [id(1), propput] HRESULT CustomerId([in] long lCustomerId);
00055   [id(2), propput] HRESULT OrderId([in] long lOrderId);
00056   [id(3)] HRESULT LineItem([in] long lItemId, [in] long lQuantity, [in] ShipStatus shipStatus);
00057   [id(4)] HRESULT Process([in] long lFlags);
00058 }
00059
00060 [
00061   uuid(6DD1E6DC-28C1-11D2-B5B6-00C04FC340EE),
00062   version(1.0),
00063   helpstring("QCNotify 1.0 Type Library")
00064 ]
00065
00066 // Library and classes
00067
00068 library QCNOTIFYLib
00069 {
00070   importlib("stdole2.tlb");
00071
00072 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00073   Class:       Notify
00074   Summary:     created by shipping department to update shipping status
00075   Interfaces:  IUnknown     Standard COM object interface
00076                INotify      The order being notified
00077   Aggregation: Not supported
00078 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00079
00080   [
00081     helpstring("Notify Class"), uuid(6DD1E6F0-28C1-11D2-B5B6-00C04FC340EE),
00082     TRANSACTION_REQUIRED
00083   ]
00084   coclass Notify { [default] interface INotify; };
00085 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/printjob.c Source File

  • Multimedia
  • Gdi
  • PrintJob

printjob.c

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 *  PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   PrintJob.c
00010 *
00011
00012         PROGRAM: PrintJob
00013
00014         PURPOSE: Demonstrates the Win32 Spooler API for retrieving printer
00015                  and print job status.
00016
00017                  This sample also demonstrates:
00018
00019                     Simple use of the ListView common control.
00020                     Multithreaded programming techniques.
00021
00022         FUNCTIONS:
00023
00024         WinMain() - Calls initialization function, processes message loop
00025
00026         InitApplication() - Initializes window data and registers window.
00027
00028         InitInstance() - Saves instance handle, creates thread synchornization
00029                          objects, and creates main window.
00030
00031         CloseInstance() - Destroys thread synchronizatoin objects and general
00032                           cleanup.
00033         WndProc() - Processes messages and creates threads in response to menu
00034                     items.
00035
00036         CenterWindow() - Used to center the "About" box over application window.
00037
00038         Refresh() - Performs a complete replacement of the applications copy of the
00039                     Printer Queue.
00040
00041         RefreshFromNotification() - Updates the application's copy of the Printer
00042                                     Queue data from Printer Change Notifications.
00043
00044         UpdateWindowTitle() - Sets the Application's Window caption with the name and
00045                               state of the printer.
00046
00047         MakeJobStatusStr() - Compounds the status bits of a DWORD into a string.
00048
00049         MakePrinterStatusStr() - Creats a descriptive string of a printers DWORD status.
00050
00051         UpdateQueue() - Update's the printer queue data structure with data from Printer
00052                         Change Notifications.
00053
00054         GetQueue() - Uses Spooler API's to build a printer queue data structure copy of a
00055                      Printer Queue's current state.
00056
00057         OnSelectPrinter() - Process's a user's printer selection command and starts the
00058                             process of monitoring a new printer queue.
00059
00060         OnPrinterNotificationOption() - Toggles the applications use of Printer Change
00061                                         Notifications.
00062
00063         COMMENTS:
00064
00065                 The PrintJob Application Example is a sample application
00066                 that uses Win32 Spooler API's to monitor Printer Queues in Windows 95
00067                 or Windows NT. This sample demonstrates Multithreading and the Print
00068                 Spooler functions available in the Win32 SDK. Multithreading is used to
00069                 block on system objects that provide timing for or notification of
00070                 system events in the print spooler while maintianing a responsive user
00071                 interface for the user.
00072
00073                 The program uses the following Spooler API's and structures:
00074
00075                 FindFirstPrinterChangeNotification()
00076                 FindNextPrinterChangeNotification()
00077                 FreePrinterNotifyInfo()
00078                 OpenPrinter()
00079                 ClosePrinter()
00080                 GetPrinter()
00081                 EnumJobs()
00082
00083
00084                 PRINTER_NOTIFY_INFO
00085                 PRINTER_NOTIFY_OPTIONS_TYPE
00086                 PRINTER_NOTIFY_OPTIONS
00087                 JOB_INFO_2
00088                 PRINTER_INFO_2
00089
00090
00091                 The following Kernel/Base API's and structures are used for Multithreading:
00092
00093                 CreateThread()
00094                 CreateEvent()
00095                 CloseHandle()
00096                 WaitForSingleObject()
00097                 WaitForMultipleObjects()
00098                 ResetEvent()
00099                 SetEvent()
00100                 PostMessage()
00101
00102                 HANDLE
00103
00104
00105                 This application is compatible with Windows 95 and
00106                 Windows NT. The application customize's its capabilities based on what
00107                 Operating System is in use.
00108
00109 ****************************************************************************/
00110
00111
00112 #define STRICT
00113 #include <windows.h>   /* required for all Windows applications             */
00114 #include "resource.h"  /* Windows resource IDs for this application         */
00115 #include "Queue.h"     /* Custom Printer Queue data structure               */
00116 #include "QueList.h"   /* Module containing the list view common control    */
00117 #include "Dialogs.h"   /* Module with the Windows Dialog code               */
00118 #include "Threads.h"   /* Module of threading code for this sample          */
00119 #include "PrintJob.h"  /* declarations specific to this program             */
00120 #include "QueCore.h"   /* declarations for operations on printer queue data */
00121
00122 /*
00123  * Application globals
00124  */
00125 HINSTANCE g_hInst;     /* current application instance */
00126
00127 char g_szAppName[] = "PrintJob";   // The name of this application
00128 char g_szTitle[]   = "Print Job Viewer"; // The title bar text
00129
00130 static HWND     g_hWndJobList;  /* Window handle of list view control */
00131 static BOOL     g_fUsePrinterChanges = FALSE;   /* Toggle for NT feature, polling by default */
00132
00133 /*
00134  * Macro definitions
00135  */
00136 #define IS_NT           (BOOL)(GetVersion() < 0x80000000)
00137 #define PrinterNameSize 200
00138
00139
00140 /************ Local Function declarations *************/
00141
00142 /*
00143  * application management
00144  */
00145 BOOL    InitApplication(HANDLE);
00146 BOOL    InitInstance(HANDLE, int);
00147 BOOL    CloseInstance(HANDLE);
00148
00149 /* access to Printer Ques */
00150 void    MakePrinterStatusStr(char *pBuffer, short nChars, DWORD dwStatus);
00151 BOOL    GetQueue(QUEUEDATA *pQueueData);
00152
00153 /* Utility */
00154 BOOL IsPrinterHandle( HANDLE hPrinter );
00155
00156 /* message processing */
00157 BOOL OnSelectPrinter(HWND hWnd, char *pszPrinterName, unsigned short cbNameSize, HANDLE *pThreadHandle);
00158 BOOL OnPrinterNotificationOption(HWND hWnd, char *pszPrinterName, HANDLE *pThreadHandle);
00159
00160 /*
00161  * Windows Application Functions
00162  */
00163
00164 /****************************************************************************
00165
00166         FUNCTION: WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
00167
00168         PURPOSE: calls initialization function, processes message loop
00169
00170         COMMENTS:
00171
00172                 Windows recognizes this function by name as the initial entry point
00173                 for the program.  This function calls the application initialization
00174                 routine, if no other instance of the program is running, and always
00175                 calls the instance initialization routine.  It then executes a message
00176                 retrieval and dispatch loop that is the top-level control structure
00177                 for the remainder of execution.  The loop is terminated when a WM_QUIT
00178                 message is received, at which time this function exits the application
00179                 instance by returning the value passed by PostQuitMessage().
00180
00181                 If this function must abort before entering the message loop, it
00182                 returns the conventional value NULL.
00183
00184 ****************************************************************************/
00185 int CALLBACK WinMain(
00186         HINSTANCE hInstance,
00187         HINSTANCE hPrevInstance,
00188         LPSTR lpCmdLine,
00189         int nCmdShow)
00190 {
00191
00192         MSG msg;
00193         HANDLE hAccelTable;
00194
00195         if (!hPrevInstance) {       // Other instances of app running?
00196             if (!InitApplication(hInstance)) { // Initialize shared things
00197                 return (FALSE);     // Exits if unable to initialize
00198             }
00199         }
00200
00201         /* Perform initializations that apply to a specific instance */
00202
00203         if (!InitInstance(hInstance, nCmdShow)) {
00204             return (FALSE);
00205         }
00206
00207         hAccelTable = LoadAccelerators (hInstance, MAKEINTRESOURCE(IDR_PRINTJOB));
00208
00209         /* Acquire and dispatch messages until a WM_QUIT message is received. */
00210
00211         while (GetMessage(&msg, // message structure
00212             NULL,   // handle of window receiving the message
00213             0,      // lowest message to examine
00214             0))     // highest message to examine
00215         {
00216             if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg))
00217             {
00218                 TranslateMessage(&msg);// Translates virtual key codes
00219                 DispatchMessage(&msg); // Dispatches message to window
00220             }
00221         }
00222
00223         CloseInstance(hInstance);
00224
00225         return (int)(msg.wParam); // Returns the value from PostQuitMessage
00226
00227         lpCmdLine; // This will prevent 'unused formal parameter' warnings
00228
00229 } /* end of function WinMain */
00230
00231
00232 /****************************************************************************
00233
00234         FUNCTION: InitApplication(HINSTANCE)
00235
00236         PURPOSE: Initializes window data and registers window class
00237
00238         COMMENTS:
00239
00240                 This function is called at initialization time only if no other
00241                 instances of the application are running.  This function performs
00242                 initialization tasks that can be done once for any number of running
00243                 instances.
00244
00245                 In this case, we initialize a window class by filling out a data
00246                 structure of type WNDCLASS and calling the Windows RegisterClass()
00247                 function.  Since all instances of this application use the same window
00248                 class, we only need to do this when the first instance is initialized.
00249
00250
00251 ****************************************************************************/
00252
00253 BOOL InitApplication(HINSTANCE hInstance)
00254 {
00255         WNDCLASS  wc;
00256
00257         // Fill in window class structure with parameters that describe the
00258         // main window.
00259
00260         wc.style         = 0;                      // Class style(s).
00261         wc.lpfnWndProc   = (WNDPROC)WndProc;       // Window Procedure
00262         wc.cbClsExtra    = 0;                      // No per-class extra data.
00263         wc.cbWndExtra    = 0;                      // No per-window extra data.
00264         wc.hInstance     = hInstance;              // Owner of this class
00265         wc.hIcon         = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_APP)); // Icon name from .RC
00266         wc.hCursor       = LoadCursor(NULL, IDC_ARROW);// Cursor
00267         wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);// Default color
00268         wc.lpszMenuName  = MAKEINTRESOURCE(IDR_PRINTJOB); // Menu from .RC
00269         wc.lpszClassName = g_szAppName;              // Name to register as
00270
00271         // Register the window class and return success/failure code.
00272         return (RegisterClass(&wc));
00273 } /* end of function InitApplication */
00274
00275
00276 /****************************************************************************
00277
00278         FUNCTION:  InitInstance(HINSTANCE, int)
00279
00280         PURPOSE:  Saves instance handle and creates main window
00281
00282         COMMENTS:
00283
00284                 This function is called at initialization time for every instance of
00285                 this application.  This function performs initialization tasks that
00286                 cannot be shared by multiple instances.
00287
00288                 In this case, we save the instance handle in a static variable and
00289                 create and display the main program window.
00290
00291 ****************************************************************************/
00292
00293 BOOL InitInstance(
00294         HINSTANCE       hInstance,
00295         int             nCmdShow)
00296 {
00297         HWND            hWnd; /* Main window handle. */
00298
00299         // Save the instance handle in static variable, which will be used in
00300         // many subsequent calls from this application to Windows.
00301
00302         g_hInst = hInstance; // Store instance handle in our global variable
00303
00304         // This application uses common controls, make sure they are ready
00305         InitCommonControls();
00306
00307         // Create synchronization objects, if not, return "failure"
00308         if (!CreateThreadSyncResources())
00309         {
00310             return (FALSE);
00311         }
00312
00313         // Create a main window for this application instance.
00314         hWnd = CreateWindow(
00315                 g_szAppName,           // See RegisterClass() call.
00316                 g_szTitle,             // Text for window title bar.
00317                 WS_OVERLAPPEDWINDOW, // Window style.
00318                 CW_USEDEFAULT, 0,
00319                 CW_USEDEFAULT, 0,    // Use default positioning but adjusted for size
00320                 NULL,                // Overlapped windows have no parent.
00321                 NULL,                // Use the window class menu.
00322                 hInstance,           // This instance owns this window.
00323                 NULL                 // We don't use any data in our WM_CREATE
00324         );
00325
00326         // If window could not be created, return "failure"
00327         if (!hWnd)
00328         {
00329             DestroyThreadSyncResources();
00330             return (FALSE);
00331         }
00332
00333
00334         // Make the window visible; update its client area; and return "success"
00335         ShowWindow(hWnd, nCmdShow); // Show the window
00336         UpdateWindow(hWnd);         // Sends WM_PAINT message
00337
00338         return (TRUE);              // We succeeded...
00339
00340 } /* end of function InitInstance */
00341
00342 /****************************************************************************
00343
00344         FUNCTION:  CloseInstance(HINSTANCE)
00345
00346         PURPOSE:  Orderly shutdown of this instance of the application
00347
00348         COMMENTS:
00349
00350                 This function is called when the application is shutting down
00351                 after it has exited the message processing loop.
00352
00353                 It is used to destroy application global resources used during
00354                 execution of this instance.
00355
00356 ****************************************************************************/
00357
00358 BOOL CloseInstance(HANDLE hInst)
00359 {
00360
00361     DestroyThreadSyncResources();
00362
00363     return TRUE;
00364
00365 } /* end of function CloseInstance */
00366
00367
00368
00369 /****************************************************************************
00370
00371         FUNCTION:  IsPrinterHandle(HANDLE)
00372
00373         PURPOSE:  Determines if a handle to a printer is to a real printer.
00374
00375         COMMENTS:
00376
00377                 If the handle is bogus or it is a handle to a printer server
00378                 the function will return FALSE.
00379
00380 ****************************************************************************/
00381
00382 BOOL IsPrinterHandle( HANDLE hPrinter )
00383 {
00384     DWORD       cbNeeded;
00385     DWORD       Error;
00386     BOOL        fRet = TRUE;
00387
00388     // Test if the handle is to a printer by asking how big
00389     // a buffer is needed to describe it.
00390     if( !GetPrinter(hPrinter, 2, (LPBYTE)NULL, 0, &cbNeeded ))
00391     {
00392         // The function failed so the handle might not be a printer
00393         Error = GetLastError( );
00394         fRet = FALSE;
00395
00396         if( Error == ERROR_INSUFFICIENT_BUFFER )
00397         {
00398             // Apparently the handle was a printer, but as expected
00399             // We didn't give it a buffer
00400             fRet = TRUE;
00401         }
00402         // Else, the handle is not to a valid printer
00403     }
00404     return fRet;
00405
00406 } /* end of function IsPrinterHandle */
00407
00408
00409 /****************************************************************************
00410
00411         FUNCTION:  OnSelectPrinter(HWND, char *, unsigned short, HANDLE *)
00412
00413         PURPOSE:  Processes user command to select a printer to watch
00414
00415         COMMENTS:
00416
00417                 This function is called by the Window Procedure's command
00418                 processing in response to a user's selection of the
00419                 Printer | Select menu.
00420
00421                 It is used validate the user's entry and start a seperate
00422                 thread which monitors the selected printer's print queue.
00423
00424 ****************************************************************************/
00425
00426 BOOL OnSelectPrinter(HWND hWnd, char *pszPrinterName, unsigned short cbNameSize, HANDLE *pThreadHandle)
00427 {
00428     HANDLE hNewPrinter = NULL;
00429     HANDLE hThread;
00430
00431     /*
00432      * Present the user with Printer Selection Dialog until success or cancel
00433      */
00434
00435     // Loop unless dialog canceled
00436     while (GetPrinterPath(hWnd, pszPrinterName, cbNameSize))
00437     {
00438         // OK button pressed, see if the printer name is recognized.
00439         if (OpenPrinter(pszPrinterName, &hNewPrinter, NULL) && IsPrinterHandle ( hNewPrinter ))
00440         {
00441             /*
00442              * On NT, a valid printer name is the Printer Name or
00443              * a UNC share name. Note that for printer connections, the Printer
00444              * name appears in the printer folder in a parsed form:
00445              * "[PrinterName] on [Server]" corresponds to an actual pPrinterName of
00446              * "\\[Server]\[PrinterName]" - where [PrinterName] is the pPrinterName
00447              * on the Server.
00448              *
00449              * On Windows 95 a valid printer name is the port(e.g. LPTX:),
00450              * Printer name, or UNC share name. Printer Name and share name are
00451              * unambigous, but if a port is given, OpenPrinter returns a handle to
00452              * the first Printer it encounters using that port.
00453              */
00454
00455             if (!g_fUsePrinterChanges)
00456             /* if application not using Printer Change Notification's, use polling */
00457             {
00458                 /*
00459                  * Start a new polling thread to refresh the
00460                  * Job list.
00461                  */
00462                 hThread = StartPolling(hWnd, hNewPrinter, *pThreadHandle);
00463             }
00464             else
00465             {
00466                 /*
00467                  * On Windows NT, the application can use
00468                  * Printer Change Notifications which are more
00469                  * efficient.
00470                  */
00471                 hThread = StartNotifications(hWnd, hNewPrinter, *pThreadHandle);
00472             }
00473
00474             *pThreadHandle = hThread;
00475             return TRUE;
00476         }
00477         else // nope, user typed in something that was wrong
00478         {
00479             if (hNewPrinter)
00480                 ClosePrinter ( hNewPrinter );
00481             /*
00482              * Tell the user we do not recognize their selection.
00483              */
00484             if (MessageBox(hWnd,
00485                 "The printer name you specified cannot be found.",
00486                 "Printer Selection Error", MB_OKCANCEL | MB_ICONSTOP)
00487                 == IDCANCEL)
00488                 // User asked to leave, break out of loop
00489                 break;
00490         }
00491
00492     }
00493
00494     return FALSE;
00495
00496 } /* end of function OnSelecPrinter */
00497
00498
00499 /****************************************************************************
00500
00501         FUNCTION:  OnPrinterNotificationOption(HWND , char *, HANDLE *)
00502
00503         PURPOSE:  Processes user command to switch between polling and Printer
00504                   Change notifications.
00505
00506         COMMENTS:
00507
00508                 This function is called by the Window Procedure's command
00509                 processing in response to a user's selection of the
00510                 "Options | Use Printer Notifications" menu itme.
00511
00512                 This function toggles the menu and application state for using
00513                 polling or Printer Change Notifications as the trigger for
00514                 updating the internal data structures and the displayed ListView
00515                 of the selected printer's print queue.
00516
00517                 If the application was monitoring a printer queue it restarts
00518                 a monitoring thread using the new polling or notification
00519                 method.
00520
00521                 Otherwise it merely toggles the state of the option.
00522
00523                 Notifications and the menu item are disabled by default in the
00524                 resources and are only enabled if the application startup code
00525                 determines that the application is running on Windows NT.
00526
00527 ****************************************************************************/
00528
00529 BOOL OnPrinterNotificationOption(HWND hWnd, char *pszPrinterName, HANDLE *pThreadHandle)
00530 {
00531     HMENU   hOptionsMenu;
00532     HANDLE  hNewPrinter;
00533     HANDLE  hThread = NULL;
00534
00535     hOptionsMenu = GetSubMenu(GetMenu(hWnd), 1);
00536     hNewPrinter = NULL;
00537
00538     /*
00539      * If we are currently running a thread,
00540      * get a new printer handle since the thread owns
00541      * the one we passed it and we are going to start
00542      * a new thread with the same printer.
00543      */
00544     if (ActiveUpdateThread())
00545     {
00546         if (!OpenPrinter(pszPrinterName, &hNewPrinter, NULL))
00547         {
00548             /* Bogus printer name */
00549             hNewPrinter = NULL;
00550
00551             /* Bail */
00552             return FALSE;
00553         }
00554
00555     }
00556
00557     if (g_fUsePrinterChanges)
00558     {
00559         /* Switch back to polling */
00560         g_fUsePrinterChanges = FALSE;
00561         CheckMenuItem(hOptionsMenu, IDM_PRINTERNOTIFICATION, MF_UNCHECKED | MF_BYCOMMAND);
00562         if (hNewPrinter)
00563         {
00564             hThread = StartPolling(hWnd, hNewPrinter, *pThreadHandle);
00565         }
00566
00567     }
00568     else
00569     {
00570         /* Switch to using Printer Change Notifictions on NT */
00571         g_fUsePrinterChanges = TRUE;
00572         CheckMenuItem(hOptionsMenu, IDM_PRINTERNOTIFICATION, MF_CHECKED | MF_BYCOMMAND);
00573         if (hNewPrinter)
00574         {
00575             hThread = StartNotifications(hWnd, hNewPrinter, *pThreadHandle);
00576         }
00577     }
00578
00579     *pThreadHandle = hThread;
00580     return TRUE;
00581
00582 } /* end of function OnPrinterNotificationOption */
00583
00584
00585 /****************************************************************************
00586
00587         FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
00588
00589         PURPOSE:  Processes messages
00590
00591         MESSAGES:
00592
00593         WM_COMMAND    - application menu: About; Select Printer;
00594                         Toggle Printer Notifications; Exit; Refresh
00595         WM_DESTROY    - destroy window
00596         WM_CREATE     - Creates Child Window ListView control,
00597                         Initializes local variables,
00598                         and Enables OS dependent features.
00599         WM_SIZE       - Processed to resize Child ListView control.
00600         WM_ERASEBKGND - Processed to prevent background painting over the
00601                         child ListView Control.
00602         WM_NOTIFY     - Processed as an example.
00603         WM_CLOSE      - Checks for any running worker threads and shuts
00604                         them down before closing the application.
00605         WM_CREATE     - Sets defaults, createst the list child window, and
00606                         enables notifications if running on NT.
00607
00608         COMMENTS:
00609
00610
00611 ****************************************************************************/
00612
00613 LRESULT CALLBACK WndProc(
00614                 HWND hWnd,         // window handle
00615                 UINT message,      // type of message
00616                 WPARAM uParam,     // additional information
00617                 LPARAM lParam)     // additional information
00618 {
00619         int     wmId, wmEvent;
00620 static  char    PrinterName[PrinterNameSize]; // Name of Printer Selected, kept as a convenience to the user
00621 static  HANDLE  hListUpdateThread = NULL;   // handle to thread which updates the job list
00622
00623
00624         switch (message)
00625         {
00626             case WM_CREATE:
00627             {
00628                 HMENU   hOptionsMenu = GetSubMenu(GetMenu(hWnd), 1);
00629
00630                 /* Variable initialization */
00631                 lstrcpyn(PrinterName, "", PrinterNameSize);
00632
00633                 /* Create the control to display printer info */
00634                 g_hWndJobList = CreateQueList(hWnd);
00635
00636                 /*
00637                  * Enable use of the Printer Notifications Option on NT,
00638                  * the option is disabled by default in the resources.
00639                  */
00640                 if (IS_NT)
00641                 {
00642                     EnableMenuItem(hOptionsMenu, IDM_PRINTERNOTIFICATION, MF_ENABLED | MF_BYCOMMAND);
00643                 }
00644
00645                 break;
00646             }
00647
00648             case WM_SIZE:
00649             {
00650                 /* resize list box windows to match main window */
00651                 ResizeQueList(g_hWndJobList, hWnd);
00652                 break;
00653             }
00654             case WM_ERASEBKGND:
00655             {
00656                 /*
00657                  * Don't let the client area be painted since our
00658                  * list view control covers it entirely.
00659                  * This prevents disco flicker.
00660                  */
00661                 break;
00662             }
00663
00664             case WM_COMMAND:  // message: command from application menu
00665             {
00666                 wmId    = LOWORD(uParam);
00667                 wmEvent = HIWORD(uParam);
00668
00669                 switch (wmId)
00670                 {
00671                     case IDM_ABOUT:
00672                     {
00673                         DialogBox(g_hInst,                      // current instance
00674                                 MAKEINTRESOURCE(IDD_ABOUTBOX),  // dlg resource to use
00675                                 hWnd,                           // parent handle
00676                                 (DLGPROC)About);                // About() instance address
00677                         break;
00678                     }
00679
00680                     case IDM_SELECTPRINTER:
00681                     {
00682                         OnSelectPrinter(hWnd, PrinterName, sizeof(PrinterName), &hListUpdateThread);
00683                         break;
00684                     }
00685
00686                     case IDM_PRINTERNOTIFICATION:
00687                     {
00688                         if (IS_NT)
00689                         {
00690                             OnPrinterNotificationOption(hWnd, PrinterName, &hListUpdateThread);
00691                         }
00692                         break;
00693                     }
00694
00695                     case IDM_EXIT:
00696                     {
00697                         PostMessage(hWnd, WM_CLOSE, 0, 0);
00698                         break;
00699                     }
00700
00701                     case ID_FILE_REFRESH:
00702                     {
00703                         TriggerUpdateThreadRefresh();
00704                         break;
00705                     }
00706
00707                     default:
00708                         return (DefWindowProc(hWnd, message, uParam, lParam));
00709                 }
00710                 break;
00711             }
00712
00713             case WM_CLOSE:
00714             {
00715                 /* Close any thread and free its resources */
00716                 if (ActiveUpdateThread())
00717                 {
00718                     /*
00719                      * Can't close down yet because a thread is running,
00720                      * ask the thread to terminate and close the app down
00721                      * when it is done.
00722                      */
00723                     StopUpdateThread(hListUpdateThread, TRUE);
00724                     break;
00725                 }
00726
00727                 /*
00728                  * Otherwise, no thread running
00729                  */
00730                 CloseHandle(hListUpdateThread);
00731                 hListUpdateThread = NULL;
00732                 DestroyWindow (hWnd);
00733                 break;
00734             }
00735
00736             case WM_DESTROY:  // message: window being destroyed
00737             {
00738                 /* Quit the Message Loop */
00739                 PostQuitMessage(0);
00740                 break;
00741             }
00742
00743             default:          // Passes it on if unproccessed
00744                 return (DefWindowProc(hWnd, message, uParam, lParam));
00745         }
00746         return (0);
00747
00748 } /* end of function WndProc */
00749
00750
00751 /****************************************************************************
00752
00753     FUNCTION: CenterWindow (HWND, HWND)
00754
00755     PURPOSE:  Center one window over another
00756
00757     COMMENTS:
00758
00759         Dialog boxes take on the screen position that they were designed at,
00760         which is not always appropriate. Centering the dialog over a particular
00761         window usually results in a better position.
00762
00763 ****************************************************************************/
00764
00765 BOOL CenterWindow (HWND hwndChild, HWND hwndParent)
00766 {
00767         RECT    rChild, rParent;
00768         int     wChild, hChild, wParent, hParent;
00769         int     wScreen, hScreen, xNew, yNew;
00770         HDC     hdc;
00771
00772         // Get the Height and Width of the child window
00773         GetWindowRect (hwndChild, &rChild);
00774         wChild = rChild.right - rChild.left;
00775         hChild = rChild.bottom - rChild.top;
00776
00777         // Get the Height and Width of the parent window
00778         GetWindowRect (hwndParent, &rParent);
00779         wParent = rParent.right - rParent.left;
00780         hParent = rParent.bottom - rParent.top;
00781
00782         // Get the display limits
00783         hdc = GetDC (hwndChild);
00784         wScreen = GetDeviceCaps (hdc, HORZRES);
00785         hScreen = GetDeviceCaps (hdc, VERTRES);
00786         ReleaseDC (hwndChild, hdc);
00787
00788         // Calculate new X position, then adjust for screen
00789         xNew = rParent.left + ((wParent - wChild) /2);
00790         if (xNew < 0)
00791         {
00792             xNew = 0;
00793         } else if ((xNew+wChild) > wScreen)
00794         {
00795             xNew = wScreen - wChild;
00796         }
00797
00798         // Calculate new Y position, then adjust for screen
00799         yNew = rParent.top  + ((hParent - hChild) /2);
00800         if (yNew < 0)
00801         {
00802             yNew = 0;
00803         }
00804         else if ((yNew+hChild) > hScreen)
00805         {
00806             yNew = hScreen - hChild;
00807         }
00808
00809         // Set it, and return
00810         return SetWindowPos (hwndChild,
00811                              NULL,
00812                              xNew,
00813                              yNew,
00814                              0,
00815                              0,
00816                              SWP_NOSIZE | SWP_NOZORDER);
00817
00818 } /* end of function CenterWindow */
00819
00820
00821
00822
00823
00824 /***************************************************************************
00825  *
00826  * Core Application Printer Queue Processing Functions
00827  *
00828  **************************************************************************/
00829
00830 /****************************************************************************
00831
00832     FUNCTION:  Refresh(HWND, QUEUEDATA *)
00833
00834     PURPOSE:   Replaces the contents of the application's custom printer queue
00835                data structure and then updates the ListView control that
00836                displays the contents of the printer queue.
00837
00838     COMMENTS:
00839
00840             This function is called whenever the entire contents of the list
00841             view should be updated.
00842
00843 ****************************************************************************/
00844
00845 void Refresh(HWND hWnd, QUEUEDATA *pQueue)
00846 {
00847     /* retrieve job info from the printer */
00848     if (GetQueue(pQueue))
00849     {
00850         /* update the list boxes */
00851         SetQueListContents(g_hWndJobList, pQueue);
00852
00853         /* update queue status in window caption */
00854         UpdateWindowTitle(hWnd, pQueue);
00855     }
00856
00857 } /* end of function Refresh */
00858
00859
00860 /****************************************************************************
00861
00862     FUNCTION:  MakeJobStatusStr(char *, short, DWORD)
00863
00864     PURPOSE:   Creates a descriptive string in the char * buffer which is of
00865                size short from the Print Job status bits contained in DWORD.
00866
00867     COMMENTS:
00868
00869             One, none, or more than one Status bit can be set in the JOB_INFO_2
00870             structure. This function processes all of the status bits that are
00871             set in the DWORD.
00872
00873             The meanings of the bits in the Status DWORD are documented in
00874             the JOB_INFO_2 documentation in the Win32 SDK. The most recent
00875             status bits are always located in winspool.h.
00876
00877 ****************************************************************************/
00878
00879 void MakeJobStatusStr(char *szBuffer, short cchChars, DWORD dwStatus)
00880 {
00881     DWORD   dwClearBits = 0;
00882     char    szTmp[MAX_PATH];
00883
00884
00885     szTmp[0] = 0;
00886
00887     /*
00888      * Accumulate a status string from the set bits.
00889      * Terminate when we have processed all of the bits.
00890      */
00891     while (dwStatus)
00892     {
00893         /* Seperate multiple status phrases with a hyphen */
00894         if (dwClearBits)
00895             strncat(szTmp, " - ", MAX_PATH - strlen(szTmp));
00896
00897         if (JOB_STATUS_SPOOLING & dwStatus)
00898         {
00899             strncat(szTmp, "Spooling", MAX_PATH - strlen(szTmp));
00900             dwClearBits |= JOB_STATUS_SPOOLING;
00901         }
00902         else if (JOB_STATUS_PRINTING & dwStatus)
00903         {
00904             strncat(szTmp, "Printing", MAX_PATH - strlen(szTmp));
00905             dwClearBits |= JOB_STATUS_PRINTING;
00906         }
00907         else if (JOB_STATUS_DELETING & dwStatus)
00908         {
00909             strncat(szTmp, "Deleting", MAX_PATH - strlen(szTmp));
00910             dwClearBits |= JOB_STATUS_DELETING;
00911         }
00912         else if (JOB_STATUS_PAUSED & dwStatus)
00913         {
00914             strncat(szTmp, "Paused", MAX_PATH - strlen(szTmp));
00915             dwClearBits |= JOB_STATUS_PAUSED;
00916         }
00917         else if (JOB_STATUS_PRINTED & dwStatus)
00918         {
00919             strncat(szTmp, "Printed", MAX_PATH - strlen(szTmp));
00920             dwClearBits |= JOB_STATUS_PRINTED;
00921         }
00922         else if (JOB_STATUS_DELETED & dwStatus)
00923         {
00924             strncat(szTmp, "Deleted", MAX_PATH - strlen(szTmp));
00925             dwClearBits |= JOB_STATUS_DELETED;
00926         }
00927         else if (JOB_STATUS_ERROR & dwStatus)
00928         {
00929             strncat(szTmp, "Error", MAX_PATH - strlen(szTmp));
00930             dwClearBits |= JOB_STATUS_ERROR;
00931         }
00932         else if (JOB_STATUS_OFFLINE & dwStatus)
00933         {
00934             strncat(szTmp, "Offline", MAX_PATH - strlen(szTmp));
00935             dwClearBits |= JOB_STATUS_OFFLINE;
00936         }
00937         else if (JOB_STATUS_PAPEROUT & dwStatus)
00938         {
00939             strncat(szTmp, "Paper Out", MAX_PATH - strlen(szTmp));
00940             dwClearBits |= JOB_STATUS_PAPEROUT;
00941         }
00942         else if (JOB_STATUS_BLOCKED_DEVQ & dwStatus)
00943         {
00944             strncat(szTmp, "Blocked Device", MAX_PATH - strlen(szTmp));
00945             dwClearBits |= JOB_STATUS_BLOCKED_DEVQ;
00946         }
00947         else if (JOB_STATUS_USER_INTERVENTION & dwStatus)
00948         {
00949             strncat(szTmp, "Intervention Required", MAX_PATH - strlen(szTmp));
00950             dwClearBits |= JOB_STATUS_USER_INTERVENTION;
00951         }
00952         else if (JOB_STATUS_RESTART & dwStatus)
00953         {
00954             strncat(szTmp, "Restarting", MAX_PATH - strlen(szTmp));
00955             dwClearBits |= JOB_STATUS_RESTART;
00956         }
00957         else
00958         {
00959             /* if we get here, the OS knows more than us. */
00960             strncat(szTmp, "Unkown", MAX_PATH - strlen(szTmp));
00961             dwClearBits = dwStatus;
00962         }
00963
00964         /* Clear whatever bit we just processed */
00965         dwStatus = dwStatus & ~dwClearBits;
00966     }
00967
00968     lstrcpyn(szBuffer, szTmp, cchChars);
00969     szBuffer[cchChars-1] = 0;
00970
00971 } /* end of function MakeJobStatus */
00972
00973
00974 /****************************************************************************
00975
00976     FUNCTION:  MakePrinterStatusStr(char *, short,  DWORD)
00977
00978     PURPOSE:   Forms a character string description of the status contained
00979                in the DWORD.
00980
00981     COMMENTS:
00982
00983             This function prioritizes the status bits of the DWORD and assigns
00984             only one status string to the pszStr parameter. Note that the
00985             bits of the DWORD Status are documented in the PRINTER_INFO_2
00986             structure in the Platform SDK(Win32 SDK). The most current status
00987             bits are always in the Winspool.h header file.
00988
00989 ****************************************************************************/
00990
00991 void MakePrinterStatusStr(char *pBuffer, short cchChars, DWORD dwStatus)
00992 {
00993     char *  pszStr = NULL;
00994
00995     /* Pick which string to use */
00996     switch(dwStatus)
00997     {
00998         case PRINTER_STATUS_PAUSED:
00999             pszStr = "Paused";
01000             break;
01001         case PRINTER_STATUS_OFFLINE:
01002             pszStr = "Offline";
01003             break;
01004         case PRINTER_STATUS_PAPER_OUT:
01005             pszStr = "Paper Out";
01006             break;
01007         case PRINTER_STATUS_PAPER_JAM:
01008             pszStr = "Paper Jam";
01009             break;
01010         case PRINTER_STATUS_PAPER_PROBLEM:
01011             pszStr = "Paper Problem";
01012             break;
01013         case PRINTER_STATUS_ERROR:
01014             pszStr = "Error";
01015             break;
01016         case PRINTER_STATUS_PRINTING:
01017             pszStr = "Printing";
01018             break;
01019         case PRINTER_STATUS_OUTPUT_BIN_FULL:
01020             pszStr = "Output Bin Full";
01021             break;
01022         case PRINTER_STATUS_USER_INTERVENTION:
01023             pszStr = "User Intervention Required";
01024             break;
01025         case PRINTER_STATUS_MANUAL_FEED:
01026             pszStr = "Manual Feed";
01027             break;
01028         case PRINTER_STATUS_IO_ACTIVE:
01029             pszStr = "IO Active";
01030             break;
01031         case PRINTER_STATUS_BUSY:
01032             pszStr = "Busy";
01033             break;
01034         case PRINTER_STATUS_NOT_AVAILABLE:
01035             pszStr = "Not Available";
01036             break;
01037         case PRINTER_STATUS_PENDING_DELETION:
01038             pszStr = "Deleting";
01039             break;
01040         case PRINTER_STATUS_WAITING:
01041             pszStr = "Waiting";
01042             break;
01043         case PRINTER_STATUS_PROCESSING:
01044             pszStr = "Processing";
01045             break;
01046         case PRINTER_STATUS_INITIALIZING:
01047             pszStr = "Initializing";
01048             break;
01049         case PRINTER_STATUS_WARMING_UP:
01050             pszStr = "Warming Up";
01051             break;
01052         case PRINTER_STATUS_TONER_LOW:
01053             pszStr = "Low Toner";
01054             break;
01055         case PRINTER_STATUS_NO_TONER:
01056             pszStr = "No Toner";
01057             break;
01058         case PRINTER_STATUS_PAGE_PUNT:
01059             pszStr = "Page Punt";
01060             break;
01061         case PRINTER_STATUS_OUT_OF_MEMORY:
01062             pszStr = "Out of Memory";
01063             break;
01064         case PRINTER_STATUS_DOOR_OPEN:
01065             pszStr = "Door Open";
01066             break;
01067         case PRINTER_STATUS_SERVER_UNKNOWN:
01068             pszStr = "Unknown Server";
01069             break;
01070         case PRINTER_STATUS_POWER_SAVE:
01071             pszStr = "Power Save";
01072             break;
01073         default:
01074             /* The OS knows more than us */
01075             pszStr = "Unkown Status";
01076             break;
01077     }
01078
01079     /* Copy the string into the buffer */
01080     lstrcpyn(pBuffer, pszStr, cchChars);
01081     pBuffer[cchChars-1] = 0;
01082
01083 } /* end of function MakePrinterStatusStr */
01084
01085
01086 /****************************************************************************
01087
01088     FUNCTION:  RefreshFromNotification(HWND, QUEUEDATA *, PRINTER_NOTIFY_INFO*)
01089
01090     PURPOSE:   Updates the data in the Printer Queue data structure by applying
01091                the changes to specific fields of the data structures as
01092                specified in the PRINT_NOTIFY_INFO data structure.
01093
01094     COMMENTS:
01095
01096             PRINTER_NOTIFY_INFO contains changes on a per structure field
01097             basis for both the JOB_INFO_* structures and the PRINTER_INFO_*
01098             structures. UpdateQueue uses this list of changes to update the
01099             data saved by the applications custom printer queue structure.
01100             SetQueListContents uses the updated data structure to propagate the
01101             changes to the ListView control. UpdateWindowTitle rewrites the
01102             entire Window caption with data from the updated data structure.
01103
01104 ****************************************************************************/
01105
01106 BOOL RefreshFromNotification(HWND hWnd, QUEUEDATA *pQueue, PRINTER_NOTIFY_INFO *pNotification)
01107 {
01108
01109     if (pNotification)
01110     {
01111         /* Update Our Data */
01112         UpdateQueue(pQueue, pNotification);
01113
01114         /* update the list boxes */
01115         SetQueListContents(g_hWndJobList, pQueue);
01116
01117         /* Always Update the Window Title */
01118         UpdateWindowTitle(hWnd, pQueue);
01119
01120     }
01121
01122     return TRUE;
01123
01124 } /* end of function RefreshFromNotification */
01125
01126
01127
01128 /****************************************************************************
01129
01130     FUNCTION:  UpdateWindowTitle(HWND , QUEUEDATA *)
01131
01132     PURPOSE:   Forms a new Window Caption containing the status of the print
01133                queue and sets the Window Caption.
01134
01135     COMMENTS:
01136
01137             This function concatenates the title of the application with the
01138             name of the printer and the current state of the printer and sets
01139             the resulting string as the new caption in the Window's Title bar.
01140
01141
01142 ****************************************************************************/
01143
01144 void UpdateWindowTitle(HWND hWnd, QUEUEDATA *pQueue)
01145 {
01146     char        WindowTitle[200];
01147     PRINTERDATA *pPd = &pQueue->Printer;
01148
01149     /* Start with application title */
01150     lstrcpyn(WindowTitle, g_szTitle, 200);
01151
01152     /* Append printer queue information */
01153     strncat(WindowTitle, ": ", 200-strlen(WindowTitle));
01154
01155     if (pPd->pszPrinterName && lstrlen(pPd->pszPrinterName) > 0)
01156     {
01157         lstrcat(WindowTitle, pPd->pszPrinterName);
01158     }
01159     else if (pPd->pszServerName && pPd->pszShareName)
01160     {
01161         strncat(WindowTitle, pPd->pszServerName, 200-strlen(WindowTitle));
01162         strncat(WindowTitle, "\\", 200-strlen(WindowTitle));
01163         strncat(WindowTitle, pPd->pszShareName, 200-strlen(WindowTitle));
01164     }
01165     else
01166     {
01167         strncat(WindowTitle, "Unknown", 200-strlen(WindowTitle));
01168     }
01169
01170     /* append status of the printer queue */
01171     if (pPd->dwStatus)
01172     {
01173         strncat(WindowTitle, " - ", 200-strlen(WindowTitle));
01174
01175         /* insert the printer status after the "-" */
01176         MakePrinterStatusStr(&WindowTitle[lstrlen(WindowTitle)],
01177             (short)(sizeof(WindowTitle) - lstrlen(WindowTitle)),
01178             pPd->dwStatus);
01179     }
01180
01181     SetWindowText(hWnd, WindowTitle);
01182
01183
01184 } /* end of function UpdateWindowTitle */
01185
01186
01187 /****************************************************************************
01188
01189     FUNCTION:  UpdateQueue(QUEUEDATA *, PRINTER_NOTIFY_INFO *)
01190
01191     PURPOSE:   Loops over the changes to printer queue data contained in the
01192                PRINTER_NOTIFY_INFO pointer and applies them to the accumulated
01193                queue data contained in the QUEUEDATA pointer.
01194
01195     COMMENTS:
01196
01197             A change contained in the notification list can be either Job data
01198             or Printer data. UpdateQueue first tries to find the change in the
01199             Job data. If it fails it then tries to apply it to the Printer data.
01200             This approach was taken because we are far more likely to receive
01201             more frequent changes to job data then printer data.
01202
01203 ****************************************************************************/
01204
01205 BOOL UpdateQueue(QUEUEDATA *pQueueData, PRINTER_NOTIFY_INFO *pPNI)
01206 {
01207     unsigned int        i;
01208
01209     for (i=0; i < pPNI->Count; i++)
01210     {
01211         if (!UpdateJobData(pQueueData, &pPNI->aData[i]))
01212             UpdatePrinterData(pQueueData, &pPNI->aData[i]);
01213     }
01214
01215     return TRUE;
01216 }
01217
01218
01219 /****************************************************************************
01220
01221     FUNCTION:  GetQueue(QUEUEDATA *)
01222
01223     PURPOSE:   Used to initially, periodically, or upon user request,
01224                completely fill in the data for the printer queue.
01225
01226     COMMENTS:
01227
01228             If Printer Change Notifications are not used this function is
01229             called by the polling thread each time it wakes up to refresh the
01230             data for the Printer Queue.
01231
01232 ****************************************************************************/
01233
01234 BOOL GetQueue(QUEUEDATA *pQueueData)
01235 {
01236     DWORD               cByteNeeded,
01237                         cByteUsed,
01238                         i;
01239     int                 nReturned=0;
01240     JOB_INFO_2          *pJobStorage = NULL;
01241     PRINTER_INFO_2      *pPrinterInfo = NULL;
01242     HANDLE              hPrinter = pQueueData->Printer.hPrinter;
01243
01244
01245     if (hPrinter)
01246     {
01247         /* Get the buffer size needed */
01248         if (!GetPrinter(hPrinter, 2, NULL, 0, &cByteNeeded))
01249         {
01250             if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
01251                 goto Fail;
01252         }
01253
01254         pPrinterInfo = (PRINTER_INFO_2 *)malloc(cByteNeeded);
01255         if (!(pPrinterInfo))
01256             /* failure to allocate memory */
01257             goto Fail;
01258
01259         /* get the printer info */
01260         if (!GetPrinter(hPrinter, 2, (LPBYTE)pPrinterInfo, cByteNeeded, &cByteUsed))
01261         {
01262             /* failure to access the printer */
01263             free(pPrinterInfo);
01264             pPrinterInfo = NULL;
01265             goto Fail;
01266         }
01267
01268         /* Get job storage space */
01269         if (!EnumJobs(hPrinter,
01270                  0,
01271                  (pPrinterInfo)->cJobs,
01272                  2,
01273                  NULL,
01274                  0,
01275                  (LPDWORD)&cByteNeeded,
01276                  (LPDWORD)&nReturned))
01277         {
01278             if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
01279                 goto Fail;
01280         }
01281
01282         pJobStorage = (JOB_INFO_2 *)malloc(cByteNeeded);
01283         if (!pJobStorage)
01284             /* failure to allocate Job storage space */
01285             goto Fail;
01286
01287         ZeroMemory(pJobStorage, cByteNeeded);
01288
01289         /* get the list of jobs */
01290         if (!EnumJobs(hPrinter,
01291                  0,
01292                  (pPrinterInfo)->cJobs,
01293                  2,
01294                  (LPBYTE)pJobStorage,
01295                  cByteNeeded,
01296                  (LPDWORD)&cByteUsed,
01297                  (LPDWORD)&nReturned))
01298         {
01299             goto Fail;
01300         }
01301
01302         /* Update the count of jobs
01303          * It is possible for cJobs != nReturned after this sequence so
01304          * we reset the printer data structure to only reflect what we
01305          * actually retrieved this time around
01306          */
01307         (pPrinterInfo)->cJobs = nReturned;
01308
01309     }
01310     else
01311         goto Fail;
01312
01313     SetPrinterQueueData(pQueueData, pPrinterInfo);
01314
01315     /* Dump the existing data */
01316     FreeJobs(pQueueData);
01317
01318     /* Fill in the Printer Queue with the jobs we retrieved */
01319     for (i = 0; i < pPrinterInfo->cJobs; i++)
01320         AddJobData(pQueueData, &pJobStorage[i]);
01321
01322     free(pJobStorage);
01323     free(pPrinterInfo);
01324
01325     return TRUE;
01326
01327 Fail:
01328
01329     free(pJobStorage);
01330     free(pPrinterInfo);
01331     return FALSE;
01332
01333 } /* end of function GetQueue */
01334
01335 /* end of source file PrintJob.c */
01336
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/DNS/ModifyRecords/ModifyRecords.cpp Source File

  • NetDS
  • DNS
  • ModifyRecords

ModifyRecords.cpp

Go to the documentation of this file.
00001 /************************************************************\
00002     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005     PARTICULAR PURPOSE.
00006
00007   Copyright © 2000  Microsoft Corporation.  All Rights Reserved.
00008
00009 /***************************************************************/
00010
00011
00012 /*
00013    FILE:          ModifyRecords.cpp
00014    DESCRIPTION:   This sample illustrates how to add Host Address( A) and CNAME resource records
00015                    to DNS server using DNSModifyRecordsInSet() API.
00016
00017    PLATFORM:      Windows 2000
00018    WRITTEN BY:    Rashmi Anoop
00019    DATE:          3/22/2000
00020
00021
00022 */
00023
00024 /*
00025   includes
00026 */
00027
00028
00029 #include <windows.h>  //windows
00030 #include <windns.h>   //DNS api's
00031 #include <stdio.h>    //standard i/o
00032 #include <winsock.h>  //winsock
00033
00034 #define BUFFER_LEN 255
00035
00036 //Usage of the program
00037 void Usage(char *progname) {
00038     fprintf(stderr,"Usage\n%s -n [OwnerName] - t [Type] -l [Ttl] -d [Data] -s [DnsServerIp]\n",
00039             progname);
00040     fprintf(stderr,"Where:\n\tOwnerName is the owner field to be added\n");
00041     fprintf(stderr,"\tType is the type of resource record to be added A or CNAME\n");
00042     fprintf(stderr,"\tData is the data corresponding to RR to be added\n");
00043     fprintf(stderr,"\tTtl is the time to live value in seconds \n");
00044     fprintf(stderr,"\tDnsServerIp is the ipaddress of DNS server (in dotted decimal notation)\n");
00045     exit(1);
00046 }
00047
00048 //  the main function
00049 void __cdecl main(int argc, char *argv[])
00050
00051 {
00052
00053     DNS_STATUS status;               // return value of  DnsModifyRecordsInSet() function.
00054     PDNS_RECORD pmyDnsRecord = NULL; //pointer to DNS_RECORD structure
00055     PIP4_ARRAY pSrvList = NULL;      //pinter to IP4_ARRAY structure
00056     LPTSTR pOwnerName = NULL, pNameData = NULL;  //owner name and the data for CNAME resource record
00057     char HostipAddress[BUFFER_LEN];         //Ip address required to add host record
00058     char DnsServIp[BUFFER_LEN];             //DNS server ip address
00059
00060     memset(HostipAddress, 0, sizeof(HostipAddress) );
00061     memset(DnsServIp, 0, sizeof(DnsServIp) );
00062
00063
00064     //Allocate memory for DNS_RECORD structure.
00065
00066     pmyDnsRecord = (PDNS_RECORD) LocalAlloc( LPTR, sizeof( DNS_RECORD ) );
00067
00068     if (!pmyDnsRecord) {
00069         printf("Memory allocaltion failed\n");
00070         exit(1);
00071     }
00072
00073     if (argc > 8) {
00074
00075         for (int i = 1; i < argc ; i++) {
00076
00077             if ( (argv[i][0] == '-') || (argv[i][0] == '/') ) {
00078
00079                 switch (tolower(argv[i][1])) {
00080
00081                 case 'n':
00082                     pOwnerName = argv[++i];
00083                     pmyDnsRecord->pName = pOwnerName; //copy the Owner name information
00084                     break;
00085
00086                 case 't':
00087                     if (!_stricmp(argv[i+1], "A") )
00088                         pmyDnsRecord->wType = DNS_TYPE_A; //add host records
00089                     else if (!_stricmp(argv[i+1], "CNAME") )
00090                         pmyDnsRecord->wType = DNS_TYPE_CNAME; //add CNAME records
00091                     else
00092                         Usage(argv[0]);
00093                     i++;
00094                     break;
00095
00096                 case 'l':
00097                     pmyDnsRecord->dwTtl = atoi(argv[++i]); // time to live value in seconds
00098                     break;
00099                 case 'd':
00100                     if (pmyDnsRecord->wType == DNS_TYPE_A) {
00101                         pmyDnsRecord->wDataLength = sizeof(DNS_A_DATA); //data structure for A records
00102                         strncpy(HostipAddress, argv[++i], sizeof(HostipAddress)-1);
00103                         HostipAddress[sizeof(HostipAddress)-1] = '\0';
00104                         pmyDnsRecord->Data.A.IpAddress = inet_addr(HostipAddress); //convert string to proper address
00105                         if ( pmyDnsRecord->Data.A.IpAddress == INADDR_NONE ) {
00106                             printf("Invalid IP address in A record data \n");
00107                             Usage(argv[0]);
00108                         }
00109                         break;
00110                     }
00111                     else {
00112                         pmyDnsRecord->wDataLength = sizeof(DNS_PTR_DATA); //data structure for CNAME records
00113                         pNameData = argv[++i];
00114                         pmyDnsRecord->Data.Cname.pNameHost = pNameData;
00115                         break;
00116                     }
00117                 case 's':
00118                     // Allocate memory for IP4_ARRAY structure
00119                     pSrvList = (PIP4_ARRAY) LocalAlloc(LPTR,sizeof(IP4_ARRAY));
00120                     if (!pSrvList) {
00121                         printf("Memory allocation failed \n");
00122                         exit(1);
00123                     }
00124                     if (argv[++i]) {
00125                         strncpy(DnsServIp,argv[i],sizeof(DnsServIp)-1);
00126                         DnsServIp[sizeof(DnsServIp)-1] = '\0';
00127                         pSrvList->AddrCount = 1;
00128                         pSrvList->AddrArray[0] = inet_addr(DnsServIp); //DNS server IP address
00129                         if ( pSrvList->AddrArray[0] == INADDR_NONE ) {
00130                             printf("Invalid DNS server IP address\n");
00131                             Usage(argv[0]);
00132                         }
00133                         break;
00134                     }
00135
00136                 default:
00137                     Usage(argv[0]);
00138                     break;
00139                 }
00140             }
00141             else
00142                 Usage(argv[0]);
00143
00144
00145         }
00146
00147     }
00148     else {
00149         Usage(argv[0]);
00150     }
00151
00152
00153
00154     // Calling function DNSModifyRecordsInSet_A to add Host or CNAME records
00155
00156     status = DnsModifyRecordsInSet_A(pmyDnsRecord,                     //pointer to DNS_RECORD
00157                                      NULL,
00158                                      DNS_UPDATE_SECURITY_USE_DEFAULT,  //do not attempt secure dynamic updates
00159                                      NULL,                             //use default credentials
00160                                      pSrvList,                         //contains DNS server IP address
00161                                      NULL);                            //reserved for future use
00162
00163     if (status) {
00164         if (pmyDnsRecord->wType == DNS_TYPE_A)
00165             printf("Failed to add the host record for %s and the error is %d \n", pOwnerName, status);
00166         else
00167             printf("Failed to add the Cname record for %s and the error is %d \n", pOwnerName, status);
00168     }
00169     else {
00170         if (pmyDnsRecord->wType == DNS_TYPE_A)
00171             printf("Successfully added the host record for %s \n", pOwnerName);
00172         else
00173             printf("Successfully added the Cname record for %s \n", pOwnerName);
00174     }
00175
00176
00177     LocalFree(pmyDnsRecord); // Free the memory allocated for DNS_RECORD structure
00178     LocalFree(pSrvList);     // Free the memory allocated for IP4_ARRAY structure
00179
00180
00181 }
00182
00183
00184
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

vcacct::CUpdateReceipt Member List

This is the complete list of members for vcacct::CUpdateReceipt, including all inherited members.
clsid | vcacct::CUpdateReceipt | [static]
iid | vcacct::CUpdateReceipt | [static]
Update() | vcacct::CUpdateReceipt |
Generated on Wed Nov 13 2024 16:58:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/StdAfx.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step2

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__A8BF4DF9_648E_4723_880E_DAB5CBF2B111__INCLUDED_)
00006 #define AFX_STDAFX_H__A8BF4DF9_648E_4723_880E_DAB5CBF2B111__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #define STRICT
00013 #ifndef _WIN32_WINNT
00014 #define _WIN32_WINNT 0x0400
00015 #endif
00016 #define _ATL_APARTMENT_THREADED
00017
00018 #include <atlbase.h>
00019 //You may derive a class from CComModule and use it if you want to override
00020 //something, but do not change the name of _Module
00021 extern CComModule _Module;
00022 #include <atlcom.h>
00023
00024 //{{AFX_INSERT_LOCATION}}
00025 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00026
00027 #endif // !defined(AFX_STDAFX_H__A8BF4DF9_648E_4723_880E_DAB5CBF2B111__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/basedialog.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

basedialog.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  BaseDialog.h:  Interface for the CBaseDialog class.  This is the base
00014 //                 class for modeless dialogs.
00015 //
00016
00017
00018 #ifndef _CLASS_BASEDIALOG_
00019 #define _CLASS_BASEDIALOG_
00020
00021 #include <Windows.h>
00022
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CBaseDialog
00031 {
00032   private:
00033     HWND     m_hWnd;         // Handle from CreateDialogParam
00034     ULONG    m_nTemplate;    // Dialog template ID
00035     DLGPROC  m_DlgProc;      // Points to Dialog Proc
00036     DWORD    m_dwFlags;      // Create flags
00037
00038   public:
00039     CBaseDialog( ULONG nTemplate = 0 );
00040     virtual ~CBaseDialog();
00041
00042     virtual HWND Create( HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags = 0 );
00043
00044   protected:
00045     static BOOL CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00046
00047     virtual LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00048     virtual LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00049     virtual LRESULT OnCancel( HWND hDlg, WPARAM wParam, LPARAM lParam );
00050     virtual LRESULT OnNcDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00051     virtual LRESULT OnDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00052     virtual LRESULT OnClose( HWND hDlg, WPARAM wParam, LPARAM lParam );
00053
00054   public:
00055     virtual BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0;
00056
00057 };
00058
00059
00060 #endif //_CLASS_BASEDIALOG_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Simple/Simple.h Source File

  • Web
  • iis
  • Components
  • Cpp
  • Simple

Simple.h

Go to the documentation of this file.
00001 // Simple.h : Declaration of the CSimple
00002
00003
00004 #include "resource.h"       // main symbols
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007 // CATLSmpl
00008
00009 class CSimple :
00010     public CComDualImpl<ISimple, &IID_ISimple, &LIBID_CATLSmpl>,
00011     public ISupportErrorInfo,
00012     public CComObjectRoot,
00013     public CComCoClass<CSimple,&CLSID_CSimple>
00014 {
00015 public:
00016     CSimple();
00017 BEGIN_COM_MAP(CSimple)
00018     COM_INTERFACE_ENTRY(IDispatch)
00019     COM_INTERFACE_ENTRY(ISimple)
00020     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00021   COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
00022 END_COM_MAP()
00023 //DECLARE_NOT_AGGREGATABLE(CSimple)
00024 // Remove the comment from the line above if you don't want your object to
00025 // support aggregation.  The default is to support it
00026
00027 DECLARE_REGISTRY(CSimple, _T("IISSample.C++ATLSimple.1"), _T("IISSample.C++ATLSimple"), IDS_SIMPLE_DESC, THREADFLAGS_BOTH)
00028 // ISupportsErrorInfo
00029     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00030
00031 // ISimple
00032 public:
00033   // for free-threaded marshalling
00034 DECLARE_GET_CONTROLLING_UNKNOWN()
00035   HRESULT FinalCountruct()
00036   {
00037     return CoCreateFreeThreadedMarshaler(
00038       GetControllingUnknown(), &m_pUnkMarshaler.p );
00039   }
00040   void FinalRelease()
00041   {
00042     m_pUnkMarshaler.Release();
00043   }
00044
00045     STDMETHOD(get_myProperty)(BSTR* pbstrOutValue);
00046     STDMETHOD(put_myProperty)(BSTR bstrInValue);
00047     STDMETHOD(myMethod) (BSTR bstrIn, BSTR* pbstrOut);
00048
00049 private:
00050     CComBSTR      m_bstrMyProperty;
00051   CComPtr<IUnknown> m_pUnkMarshaler;
00052 };
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebMain.c Source File

  • WinBase
  • Debug
  • Deb

DebMain.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014
00015 MODULE    : DEBMain.C
00016 PURPOSE   : A Win32 Application demonstrating the Debug APIs
00017 FUNCTIONS :
00018   WinMain()                 - application entry point
00019   MainWndProc()             - processes messages
00020   ProcessCommandsWndProc()  - processes WM_COMMAND messages
00021   PreferencesDlgProc()      - processes messages for "Preferences" dialog box
00022   AttachDlgProc()           - processes messages for "Attach" dialog box
00023   AboutDlgProc()            - processes messages for "About" dialog box
00024   NewListBoxWndProc()       - subclass procedure to prevent listbox moving
00025   TimerProc()               - timer procedure for animated icon
00026 COMMENTS  :
00027
00028 *************************************************************************/
00029
00030 #define   STRICT               // enable strict typing
00031 #include <Windows.H>           // required for all Windows applications
00032 #include <stdio.h>
00033 #include <tchar.h>
00034 #include <strsafe.h>           // The safe string functions
00035 #include "StdLib.H"            // __argc, __argv
00036
00037 #include "LinkList.H"          // double linked list package (OBJ)
00038 #include "DEBDebug.H"          // debugging support functions
00039 #include "DEBMisc.H"           // misc support functions
00040 #include "DEBMain.H"           // specific to this module
00041
00042 // global data
00043 // ------------------------------------------------------------------------
00044 GLOBAL  Global;                // various global data
00045 PROFILE Profile;               // various profile data
00046
00047 // internal data
00048 // ------------------------------------------------------------------------
00049 #define TIMEOUT_ANIMATED_ICON 150L // animated icon timeout
00050 static TCHAR szSourceFileName[] = TEXT(__FILE__);
00051
00052 // location of various files
00053 // ------------------------------------------------------------------------
00054 TCHAR   szPath[MAX_PATH];         // path where the running application
00055                                   //  resides
00056 TCHAR   szExePathName[MAX_PATH];  // full pathname of the application
00057 TCHAR   szHelpPathName[MAX_PATH]; // full pathname of the application's
00058                                   //  help file
00059 TCHAR   szIniPathName[MAX_PATH];  // full pathname of the application's
00060                                   //  ini file
00061 // internal function prototypes
00062 // ------------------------------------------------------------------------
00063 LRESULT CALLBACK MainWndProc            ( HWND, UINT, WPARAM, LPARAM );
00064 LRESULT CALLBACK ProcessCommandsWndProc ( HWND, UINT, WPARAM, LPARAM );
00065 LRESULT CALLBACK NewListBoxWndProc      ( HWND, UINT, WPARAM, LPARAM );
00066 BOOL    CALLBACK PreferencesDlgProc     ( HWND, UINT, WPARAM, LPARAM );
00067 BOOL    CALLBACK AttachDlgProc          ( HWND, UINT, WPARAM, LPARAM );
00068 BOOL    CALLBACK AboutDlgProc           ( HWND, UINT, WPARAM, LPARAM );
00069 VOID    CALLBACK TimerProc              ( HWND, UINT, UINT_PTR, DWORD );
00070
00071
00072 // ************************************************************************
00073 // FUNCTION : WinMain( HINSTANCE, HINSTANCE, LPSTR, INT )
00074 // PURPOSE  : initialize the window, process the message dispatch loop
00075 // COMMENTS :
00076 //
00077 // ************************************************************************
00078 INT WINAPI
00079 WinMain( HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine,
00080   INT nCmdShow )
00081 {
00082   MSG      Msg;
00083   WNDCLASS WndClass;
00084   HACCEL   hAccel;
00085   OSVERSIONINFO osvi;
00086
00087   LPCTSTR lpszIconName    = TEXT( "DebugIcon"  );
00088   LPCTSTR lpszMenuName    = TEXT( "DebugMenu"  );
00089   LPCTSTR lpszClassName   = TEXT( "DebugClass" );
00090   LPCTSTR lpszAccelName   = TEXT( "DebugAccel" );
00091   LPCTSTR lpszIniFileExt  = TEXT( "INI"        );
00092   LPCTSTR lpszHelpFileExt = TEXT( "HLP"        );
00093
00094   Global.hInstance = hInstance;
00095   Global.dwActiveDebuggees = 0;
00096
00097   //-- Load the "A Windows API Failed" resource string
00098   {
00099     TCHAR szApiFailed[] = TEXT( "A Windows API Failed" );
00100
00101     if( !LoadString( Global.hInstance, IDS_API_FAILED_MSG,
00102           Global.szApiFailed, sizeof(Global.szApiFailed)/sizeof(TCHAR) ) ) {
00103       ErrorMessageBox( TEXT( "First LoadString()" ),
00104         szApiFailed, szSourceFileName, __LINE__ );
00105       StringCbCopy( Global.szApiFailed, sizeof(Global.szApiFailed), szApiFailed );
00106     }
00107   }
00108
00109   //-- Load all other resource strings
00110   if( !LoadString( Global.hInstance, IDS_APPNAME,  Global.szAppName,
00111          sizeof(Global.szAppName)/sizeof(TCHAR) ) )
00112     ErrorMessageBox( TEXT("LoadString()"),
00113       Global.szApiFailed, szSourceFileName, __LINE__ );
00114   if( !LoadString( Global.hInstance, IDS_SHORT_APPNAME,
00115          Global.szShortAppName, sizeof(Global.szShortAppName)/sizeof(TCHAR) ) )
00116     ErrorMessageBox( TEXT("LoadString()"),
00117       Global.szApiFailed, szSourceFileName, __LINE__ );
00118
00119   //-- if compiled for Win32 (Unicode) and not Win32s then display
00120   //    notice and terminate
00121
00122
00123   //
00124   // Detect platform and exit gracefully if unsupported platform.
00125   //
00126
00127   osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
00128   GetVersionEx (&osvi);
00129   if (osvi.dwPlatformId == VER_PLATFORM_WIN32s) {
00130     TCHAR szTitleBuffer[64];
00131     TCHAR szTextBuffer[256];
00132
00133     if( !LoadString( Global.hInstance, IDS_WINDOWS_NT_REQUIRED_TITLE,
00134            szTitleBuffer, sizeof(szTitleBuffer)/sizeof(TCHAR) ) )
00135       ErrorMessageBox( TEXT("LoadString()"),
00136         Global.szApiFailed, szSourceFileName, __LINE__ );
00137
00138     if( !LoadString( Global.hInstance, IDS_WINDOWS_NT_REQUIRED,
00139            szTextBuffer, sizeof(szTextBuffer)/sizeof(TCHAR) ) )
00140       ErrorMessageBox( TEXT("LoadString()"),
00141         Global.szApiFailed, szSourceFileName, __LINE__ );
00142
00143     MessageBox( 0L, szTextBuffer, szTitleBuffer,
00144       MB_APPLMODAL | MB_ICONSTOP | MB_OK );
00145     return( -1 );
00146   }
00147
00148   //-- register the debug event window class
00149   WndClass.style         = CS_DBLCLKS;
00150   WndClass.lpfnWndProc   = (WNDPROC) MainWndProc;
00151   WndClass.cbClsExtra    = 0L;
00152   WndClass.cbWndExtra    = 0L;
00153   WndClass.hInstance     = Global.hInstance;
00154   WndClass.hIcon         = LoadIcon( Global.hInstance, lpszIconName );
00155   WndClass.hCursor       = LoadCursor( 0L, (LPTSTR) IDC_ARROW );
00156   WndClass.hbrBackground = (HBRUSH) (COLOR_APPWORKSPACE+1);
00157   WndClass.lpszMenuName  = lpszMenuName;
00158   WndClass.lpszClassName = lpszClassName;
00159
00160   if( !RegisterClass(&WndClass) ) {
00161     ErrorMessageBox( TEXT("RegisterClass()"),
00162       Global.szApiFailed, szSourceFileName, __LINE__ );
00163     return( FALSE );
00164   }
00165
00166   //-- get application pathname and store the ini and help file pathname
00167   //   (which is located in the same directory as the application)
00168   GetModuleFileName( (HANDLE) 0L, szExePathName,
00169     sizeof(szExePathName)/sizeof(TCHAR) );
00170   GetPathFromFullPathName( szExePathName, szPath,
00171     sizeof(szPath)/sizeof(TCHAR) );
00172   if (StringCchPrintf( szIniPathName, sizeof(szIniPathName)/sizeof(TCHAR),
00173         TEXT( "%s\\%s.%s" ), szPath,
00174         Global.szShortAppName, lpszIniFileExt  ) < 0)
00175   {
00176     ErrorMessageBox( TEXT("_snprintf()"),
00177       Global.szApiFailed, szSourceFileName, __LINE__ );
00178     return( FALSE );
00179   }
00180   if (StringCchPrintf( szHelpPathName, sizeof(szHelpPathName)/sizeof(TCHAR),
00181         TEXT( "%s\\%s.%s" ), szPath,
00182         Global.szShortAppName, lpszHelpFileExt ) < 0)
00183   {
00184     ErrorMessageBox( TEXT("_snprintf()"),
00185       Global.szApiFailed, szSourceFileName, __LINE__ );
00186     return( FALSE );
00187   }
00188
00189   //-- retrieve stored default location from private profile data
00190   GetPrivateProfileSettings( Global.szAppName, szIniPathName, &Profile );
00191
00192   //-- Create a main window for this application instance
00193   Global.hWndMain = CreateWindow( lpszClassName, Global.szAppName,
00194                       WS_OVERLAPPEDWINDOW,
00195                       Profile.xPos, Profile.yPos,
00196                       Profile.nWidth, Profile.nHeight,
00197                       0L, 0L, Global.hInstance, 0L );
00198
00199   //-- If window could not be created, return "failure"
00200   if( !Global.hWndMain ) {
00201     ErrorMessageBox( TEXT("CreateWindow()"),
00202       Global.szApiFailed, szSourceFileName, __LINE__ );
00203     return( FALSE );
00204   }
00205
00206   //-- Load main menu accelerators
00207   if( !(hAccel = LoadAccelerators( Global.hInstance, lpszAccelName) ) ) {
00208     ErrorMessageBox( TEXT("LoadAccelerators()"),
00209       Global.szApiFailed, szSourceFileName, __LINE__ );
00210     return( FALSE );
00211   }
00212
00213   //-- modify the menu to reflect saved settings
00214   UpdateMenuSettings( Global.hWndMain );
00215
00216   //-- Make the window visible; update its client area; and return "success"
00217   if( Profile.fMaximized )
00218     ShowWindow( Global.hWndMain, SW_SHOWMAXIMIZED );
00219   else if ( Profile.fMinimized )
00220     ShowWindow( Global.hWndMain, SW_SHOWMINIMIZED );
00221   else
00222     ShowWindow( Global.hWndMain, SW_SHOWDEFAULT );
00223   UpdateWindow( Global.hWndMain );
00224
00225   //-- Acquire and dispatch messages until a WM_QUIT message is received.
00226   while( GetMessage( &Msg, 0L, 0, 0 ) ) {
00227     if( !TranslateAccelerator( Global.hWndMain, hAccel, &Msg ) ) {
00228       TranslateMessage( &Msg );
00229       DispatchMessage( &Msg );
00230     }
00231   }
00232
00233   return(int)( Msg.wParam );
00234   UNREFERENCED_PARAMETER( lpCmdLine );  // avoid warnings
00235   UNREFERENCED_PARAMETER( hPrevInst );  // always 0L under Windows NT
00236   UNREFERENCED_PARAMETER( nCmdShow  );  //
00237 }
00238
00239
00240 // ************************************************************************
00241 // FUNCTION : MainWndProc( HWND, UINT, WPARAM, LPARAM )
00242 // PURPOSE  : Processes uMsgs
00243 // MESSAGES :
00244 //   WM_COMMAND   - passed to ProcessCommandsWndProc()
00245 //   WM_DESTROY   - destroy window
00246 //    ...
00247 // COMMENTS :
00248 //
00249 // ************************************************************************
00250 LRESULT CALLBACK
00251 MainWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
00252 {
00253   #define TOP_BORDER      4
00254   #define BOTTOM_BORDER   4
00255   #define SIDE_BORDER     4
00256   #define MIN_HEIGHT    128
00257
00258   static HDC hDC;
00259
00260   switch( uMsg ) {
00261
00262     //-- forward all WM_COMMANDS to separate handler function
00263     case WM_COMMAND:
00264       return( ProcessCommandsWndProc( hWnd, uMsg, wParam, lParam) );
00265
00266     //-- create debug event listbox
00267     case UM_CREATE_LISTBOX: {
00268       TCHAR  szWindowName[64];
00269       HFONT  hFont;
00270
00271       LoadString( Global.hInstance, IDS_DEBUG_EVENTS, szWindowName,
00272         sizeof(szWindowName)/sizeof(TCHAR) );
00273
00274       Global.hWndListBox = CreateWindow(
00275                            TEXT( "ListBox" ),
00276                            szWindowName,
00277                            WS_CHILD             | WS_VISIBLE      |
00278                            WS_CAPTION           | WS_VSCROLL      |
00279                            WS_HSCROLL           | LBS_NOTIFY      |
00280                            LBS_DISABLENOSCROLL  | LBS_USETABSTOPS |
00281                            LBS_NOINTEGRALHEIGHT,
00282                            (INT) SIDE_BORDER,
00283                            (INT) (Profile.fToolBar
00284                              ? (Global.ToolBarHeight + TOP_BORDER)
00285                              : TOP_BORDER),
00286                            (INT) Global.ListBoxSize.cx,
00287                            (INT) Global.ListBoxSize.cy,
00288                            hWnd, (HMENU) 0L, Global.hInstance, 0L );
00289
00290       //-- Subclass the listbox so the user cannot move it
00291       Global.OldListBoxWndProc = SubclassWindow( Global.hWndListBox,
00292         (WNDPROC) NewListBoxWndProc );
00293
00294       //-- set listbox font & background color
00295       hDC = GetDC( Global.hWndListBox );
00296       hFont = CreateFontIndirect( &(Profile.LogFont) );
00297       SelectObject( hDC, hFont );
00298       SendMessage( Global.hWndListBox, WM_CTLCOLORLISTBOX, (WPARAM) hDC,
00299         (LPARAM) Global.hWndListBox );
00300       SendMessage( Global.hWndListBox, WM_SETFONT, (WPARAM) hFont, TRUE );
00301       ReleaseDC( Global.hWndListBox, hDC );
00302
00303       //-- if command line contains a debuggee name then
00304       //   start and detach the debug event processing thread
00305       if( __argc == 2 )
00306         StartDebuggee( (LPTSTR) __argv[1], Global.hWndListBox );
00307
00308       return( FALSE );
00309     }
00310
00311     //-- create ToolBar & send message to create the Debug Events listbox
00312     case WM_CREATE:
00313       Global.hWndToolBar = CreateTextButtonBar( hWnd, &Global.ToolBarHeight );
00314       if( Profile.fToolBar )
00315         ShowWindow( Global.hWndToolBar, SW_SHOW );
00316       PostMessage( hWnd, UM_CREATE_LISTBOX, 0, 0 );
00317       return( FALSE );
00318
00319     //-- resize the debug event listbox when the window size changes
00320     case WM_SIZE:
00321       Global.ClientSize.cx = LOWORD( lParam );
00322       Global.ClientSize.cy = HIWORD( lParam );
00323       Global.ListBoxSize.cx = Global.ClientSize.cx - ( 2*SIDE_BORDER );
00324       Global.ListBoxSize.cy = max( Global.ClientSize.cy, MIN_HEIGHT
00325                                 + TOP_BORDER )
00326         - (TOP_BORDER + BOTTOM_BORDER);
00327
00328       if( Profile.fToolBar )
00329         Global.ListBoxSize.cy -= Global.ToolBarHeight;
00330
00331       if( Global.hWndListBox != 0L)
00332         MoveWindow( Global.hWndListBox,
00333           (INT) SIDE_BORDER,
00334           (INT) (Profile.fToolBar ? Global.ToolBarHeight + TOP_BORDER : TOP_BORDER),
00335           (INT) Global.ListBoxSize.cx, (INT) Global.ListBoxSize.cy, TRUE );
00336
00337       switch( wParam ) {
00338
00339         case SIZE_RESTORED: {
00340           RECT rect;
00341
00342           Profile.fMaximized = FALSE;
00343           Profile.fMinimized = FALSE;
00344           GetWindowRect( Global.hWndMain, &rect );
00345           Profile.nWidth  = (INT) (rect.right - rect.left);
00346           Profile.nHeight = (INT) (rect.bottom - rect.top);
00347           return( FALSE );
00348         }
00349
00350         case SIZE_MAXIMIZED:
00351           Profile.fMaximized = TRUE;
00352           Profile.fMinimized = FALSE;
00353           Profile.xPos       = Global.xPosOld;
00354           Profile.yPos       = Global.yPosOld;
00355           return( FALSE );
00356
00357         case SIZE_MINIMIZED:
00358           Profile.fMinimized = TRUE;
00359           Profile.fMaximized = FALSE;
00360           Profile.xPos       = Global.xPosOld;
00361           Profile.yPos       = Global.yPosOld;
00362           return( FALSE );
00363
00364       }
00365       return( DefWindowProc(hWnd, uMsg, wParam, lParam) );
00366
00367     //-- keep track of window position so it can be saved
00368     case WM_MOVE: {
00369       RECT rect;
00370
00371       GetWindowRect( Global.hWndMain, &rect );
00372       Global.xPosOld      = Profile.xPos;
00373       Global.yPosOld      = Profile.yPos;
00374       Profile.xPos = (INT) rect.left;
00375       Profile.yPos = (INT) rect.top;
00376       return( FALSE );
00377     }
00378
00379     //-- colorize the debug event listbox
00380     case WM_CTLCOLORLISTBOX: {
00381       LOGBRUSH LogBrush;
00382
00383       LogBrush.lbStyle = BS_SOLID;
00384       LogBrush.lbColor = Profile.rgbBackColor;
00385       LogBrush.lbHatch = 0L;
00386
00387       SetTextColor( (HDC) wParam, Profile.rgbForeColor );
00388       SetBkColor( (HDC) wParam, Profile.rgbBackColor );
00389
00390       return( (LPARAM) CreateBrushIndirect( &LogBrush ) );
00391     }
00392
00393     //-- check if a debuggee is still active, save profile settings
00394     case WM_CLOSE:
00395       if( Global.dwActiveDebuggees ) {
00396         TCHAR  szExitBoxTitle[64];
00397         TCHAR  szExitBoxText[256];
00398
00399         LoadString( Global.hInstance, IDS_EXIT_BOX_TITLE, szExitBoxTitle,
00400           sizeof(szExitBoxTitle)/sizeof(TCHAR) );
00401         LoadString( Global.hInstance, IDS_EXIT_BOX_TEXT, szExitBoxText,
00402           sizeof(szExitBoxText)/sizeof(TCHAR) );
00403         if ( MessageBox( hWnd, szExitBoxText, szExitBoxTitle,
00404                MB_YESNO | MB_ICONEXCLAMATION ) == IDNO )
00405           return( FALSE );
00406       }
00407
00408       //-- store location information to private profile data
00409       WritePrivateProfileSettings( Global.szAppName, szIniPathName, &Profile );
00410
00411       DestroyWindow( Global.hWndToolBar );
00412       DestroyWindow( Global.hWndListBox );
00413       DestroyWindow( Global.hWndMain );
00414
00415       return( FALSE );
00416
00417     case WM_DESTROY:
00418       if( Global.fHelpUsed )
00419         WinHelp( hWnd, szHelpPathName, (UINT) HELP_QUIT, 0L);
00420       PostQuitMessage( 0 );
00421       return( FALSE );
00422
00423     default:               // Passes it on if unproccessed
00424       return( DefWindowProc(hWnd, uMsg, wParam, lParam) );
00425   }
00426
00427   return( FALSE );
00428 }
00429
00430
00431 // ************************************************************************
00432 // FUNCTION : ProcessCommandsWndProc( HWND, UINT, WPARAM, LPARAM )
00433 // PURPOSE  : Processes WM_COMMAND messages for MainWndProc()
00434 // MESSAGES :
00435 //   WM_COMMAND         - application menu
00436 //     IDM_FILE_EXIT    - exit the application
00437 //     IDM_FILE_ABOUT   - About Dialog Box
00438 //    ...
00439 // COMMENTS :
00440 //
00441 // ************************************************************************
00442 LRESULT CALLBACK
00443 ProcessCommandsWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
00444 {
00445   static LPCTSTR  lpszAboutDlgBox       = TEXT( "AboutDlgBox"       );
00446   static LPCTSTR  lpszAttachDlgBox      = TEXT( "AttachDlgBox"      );
00447   static LPCTSTR  lpszPreferencesDlgBox = TEXT( "PreferencesDlgBox" );
00448
00449   switch( LOWORD(wParam) ) {
00450
00451     //-- user requests to open a new debuggee
00452     case IDM_FILE_OPEN: {
00453       static TCHAR szDebuggeeFileName[MAX_PATH];
00454
00455       if( Global.dwActiveDebuggees ) {
00456         MaxDebuggeesMessageBox( Global.hWndMain );
00457         return( FALSE );
00458       }
00459       if( !GetDebuggeeFileName( szDebuggeeFileName, hWnd ) ) {
00460         return( FALSE );
00461       }
00462       else {
00463         if( Profile.fClearOnNew ) {
00464           SendMessage( Global.hWndListBox, LB_RESETCONTENT, 0, 0 );
00465           Global.MaxStrLen = 0;
00466         }
00467         StartDebuggee( szDebuggeeFileName, Global.hWndListBox );
00468       }
00469       return( FALSE );
00470     }
00471
00472     //-- user requests to attach to an existing process
00473     case IDM_FILE_ATTACH:
00474       if( Global.dwActiveDebuggees ) {
00475         MaxDebuggeesMessageBox( Global.hWndMain );
00476         return( FALSE );
00477       }
00478       if( !DialogBox( Global.hInstance, lpszAttachDlgBox, hWnd,
00479             (DLGPROC) AttachDlgProc ) ) {
00480         // handle cancel condition...
00481       }
00482       else {
00483         if( Profile.fClearOnNew ) {
00484           SendMessage( Global.hWndListBox, LB_RESETCONTENT, 0, 0 );
00485           Global.MaxStrLen = 0;
00486         }
00487       }
00488       return( FALSE );
00489
00490     //-- copy listbox contents to the clipboard and clear the listbox
00491     case IDM_EDIT_CUT:
00492       CopyListBoxToClipboard( Global.hWndListBox, Global.MaxStrLen );
00493       SendMessage( hWnd, WM_COMMAND, IDM_EDIT_DELETE, 0 );
00494       return( FALSE );
00495
00496     //-- copy listbox contents to the clipboard
00497     case IDM_EDIT_COPY: {
00498       CopyListBoxToClipboard( Global.hWndListBox, Global.MaxStrLen );
00499       return( FALSE );
00500     }
00501
00502     //-- clear the contents of the listbox
00503     case IDM_EDIT_DELETE:
00504       SendMessage( Global.hWndListBox, LB_RESETCONTENT, 0, 0 );
00505       Global.MaxStrLen = 0;
00506       return( FALSE );
00507
00508     //-- user requests a new font for the listbox
00509     case IDM_OPTIONS_FONT:
00510       if( !ChooseNewFont( Global.hWndListBox ) ) {
00511         // handle cancel condition...
00512       }
00513       return( FALSE );
00514
00515     //-- user requests a new background color for the listbox
00516     case IDM_OPTIONS_COLOR:
00517       ChooseNewBackColor( Global.hWndListBox );
00518       return( FALSE );
00519
00520     //-- invoke the preferences dialog box
00521     case IDM_OPTIONS_PREFERENCES:
00522       DialogBox( Global.hInstance, lpszPreferencesDlgBox, hWnd,
00523         (DLGPROC) PreferencesDlgProc );
00524       return( FALSE );
00525
00526     //-- toggle the toolbar on or off
00527     case IDM_OPTIONS_TOOLBAR:
00528       if( Profile.fToolBar ) {
00529         Profile.fToolBar = 0;
00530         CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_TOOLBAR,
00531           MF_UNCHECKED );
00532         ShowWindow( Global.hWndToolBar, SW_HIDE );
00533         SendWmSizeMessage( Global.hWndMain );
00534       }
00535       else {
00536         Profile.fToolBar = 1;
00537         CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_TOOLBAR,
00538           MF_CHECKED );
00539         ShowWindow( Global.hWndToolBar, SW_SHOW );
00540         SendWmSizeMessage( Global.hWndMain );
00541       }
00542       return( FALSE );
00543
00544     //-- toggles whether the used directory is used for the 'open' command
00545     case IDM_OPTIONS_SAVEDDIR:
00546       if( Profile.fSavedDirectory ) {
00547         Profile.fSavedDirectory = 0;
00548         CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEDDIR,
00549           MF_UNCHECKED );
00550       }
00551       else {
00552         Profile.fSavedDirectory = 1;
00553         CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEDDIR,
00554           MF_CHECKED );
00555       }
00556       return( FALSE );
00557
00558     //-- toggles the 'save on exit' feature
00559     case IDM_OPTIONS_SAVEONEXIT:
00560       if( Profile.fSaveOnExit ) {
00561         Profile.fSaveOnExit = 0;
00562         CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEONEXIT,
00563           MF_UNCHECKED );
00564       }
00565       else {
00566         Profile.fSaveOnExit = 1;
00567         CheckMenuItem( GetMenu(Global.hWndMain), IDM_OPTIONS_SAVEONEXIT,
00568           MF_CHECKED );
00569       }
00570       return( FALSE );
00571
00572     //-- store location information to private profile data now
00573     case IDM_OPTIONS_SAVENOW: {
00574       BOOL fOldSaveOnExit = Profile.fSaveOnExit;
00575       BOOL fOldSavePreferences = Profile.fSavePreferences;
00576
00577       Profile.fSaveOnExit = TRUE;
00578       Profile.fSavePreferences = TRUE;
00579       WritePrivateProfileSettings( Global.szAppName, szIniPathName, &Profile );
00580       Profile.fSaveOnExit = fOldSaveOnExit;
00581       Profile.fSavePreferences = fOldSavePreferences;
00582       return( FALSE );
00583     }
00584
00585     //-- invoke help and display the contents panel
00586     case IDM_HELP_CONTENTS:
00587       Global.fHelpUsed = TRUE;
00588       WinHelp( hWnd, (LPCTSTR) szHelpPathName, HELP_CONTENTS, 0L );
00589       return( FALSE );
00590
00591     //-- search the help indexes
00592     case IDM_HELP_SEARCH:
00593       Global.fHelpUsed = TRUE;
00594       WinHelp( hWnd, (LPCTSTR) szHelpPathName, HELP_PARTIALKEY,
00595         (DWORD_PTR) TEXT( "" ) );
00596       return( FALSE );
00597
00598     //-- invoke the main 'how to use' help panel
00599     case IDM_HELP_HOWTOUSE:
00600       Global.fHelpUsed = TRUE;
00601       WinHelp( hWnd, (LPTSTR) 0L, HELP_HELPONHELP, 0L );
00602       return( FALSE );
00603
00604     //-- display the product information dialog box
00605     case IDM_HELP_ABOUT:
00606       DialogBox( Global.hInstance, lpszAboutDlgBox, hWnd,
00607         (DLGPROC) AboutDlgProc );
00608       return( FALSE );
00609
00610     //-- the usr requests to terminate the app
00611     case IDM_FILE_EXIT:
00612       SendMessage( Global.hWndMain, WM_CLOSE, 0, 0 );
00613       return( FALSE );
00614
00615     default:
00616       return( DefWindowProc(hWnd, uMsg, wParam, lParam) );
00617   }
00618
00619   return( FALSE );
00620 }
00621
00622
00623 // ************************************************************************
00624 // FUNCTION : PreferencesDlgProc( HWND, UINT, WPARAM, LPARAM )
00625 // PURPOSE  : Processes message for "Preferences" dialog box
00626 // MESSAGES :
00627 //   WM_INITDIALOG - initialize dialog box
00628 //   WM_COMMAND    - Input received
00629 // COMMENTS :
00630 //   Wait for user to click on "Ok" button, then close the dialog box.
00631 // ************************************************************************
00632 BOOL CALLBACK
00633 PreferencesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
00634 {
00635   switch( uMsg ) {
00636
00637     case WM_COMMAND:
00638       switch( LOWORD(wParam) ) {
00639
00640         case IDOK:
00641
00642           //-- Debugger Setting Group
00643           if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_PROCESS),
00644                 BM_GETCHECK, 0, 0 ) )
00645             Profile.DebugMode = DEBUG_PROCESS;
00646           if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_ONLY_THIS_PROCESS),
00647                 BM_GETCHECK, 0, 0 ) )
00648             Profile.DebugMode = DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS;
00649
00650           //-- Debuggee Priority Group
00651           if( SendMessage( GetDlgItem( hDlg, IDC_IDLE_PRIORITY_CLASS),
00652                 BM_GETCHECK, 0, 0 ) )
00653             Profile.DebuggeePriority = IDLE_PRIORITY_CLASS;
00654           if( SendMessage( GetDlgItem( hDlg, IDC_NORMAL_PRIORITY_CLASS),
00655                 BM_GETCHECK, 0, 0 ) )
00656             Profile.DebuggeePriority = NORMAL_PRIORITY_CLASS;
00657           if( SendMessage( GetDlgItem( hDlg, IDC_HIGH_PRIORITY_CLASS),
00658                 BM_GETCHECK, 0, 0 ) )
00659             Profile.DebuggeePriority = HIGH_PRIORITY_CLASS;
00660           if( SendMessage( GetDlgItem( hDlg, IDC_REALTIME_PRIORITY_CLASS),
00661                 BM_GETCHECK, 0, 0 ) )
00662             Profile.DebuggeePriority = REALTIME_PRIORITY_CLASS;
00663
00664           //-- Miscellaneous Options Group
00665           Profile.fClearOnNew  = (BOOL) SendMessage(
00666                                           GetDlgItem( hDlg, IDC_CLEAR_ON_NEW),
00667                                           BM_GETCHECK, 0 , 0 );
00668           Profile.fVerbose     = (BOOL) SendMessage(
00669                                           GetDlgItem( hDlg, IDC_VERBOSE),
00670                                           BM_GETCHECK, 0 , 0 );
00671
00672 #ifdef SHOW_SYMBOLS
00673           Profile.fShowSymbols = (BOOL) SendMessage(
00674                                           GetDlgItem( hDlg, IDC_SHOW_SYMBOLS),
00675                                           BM_GETCHECK, 0 , 0 );
00676 #endif
00677
00678
00679           //- Debug Error Level Group
00680           if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_NONE),
00681                 BM_GETCHECK, 0, 0 ) )
00682             Profile.DebugErrorLevel = 0;
00683           if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_ERROR),
00684                 BM_GETCHECK, 0, 0 ) )
00685             Profile.DebugErrorLevel = SLE_ERROR;
00686           if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_MINORERROR),
00687                 BM_GETCHECK, 0, 0 ) )
00688             Profile.DebugErrorLevel = SLE_MINORERROR;
00689           if( SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_WARNING),
00690                 BM_GETCHECK, 0, 0 ) )
00691             Profile.DebugErrorLevel = SLE_WARNING;
00692
00693           Profile.fSavePreferences = (BOOL) SendMessage(
00694                                               GetDlgItem( hDlg,
00695                                                 IDC_SAVE_PREFERENCES),
00696                                               BM_GETCHECK, 0 , 0 );
00697           EndDialog( hDlg, TRUE );
00698           return( TRUE );
00699
00700         case IDCANCEL:
00701           EndDialog( hDlg, FALSE );
00702           return( TRUE );
00703
00704         case IDHELP:
00705           return( TRUE );
00706
00707       }
00708       break;
00709
00710     case WM_INITDIALOG:
00711
00712       //-- Debugger Setting Group
00713       switch( Profile.DebugMode ) {
00714
00715         case DEBUG_PROCESS:
00716           SendMessage( GetDlgItem( hDlg, IDC_DEBUG_PROCESS),
00717             BM_SETCHECK, 1, 0);
00718           break;
00719
00720         case ( DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS ):
00721           SendMessage( GetDlgItem( hDlg, IDC_DEBUG_ONLY_THIS_PROCESS),
00722             BM_SETCHECK, 1, 0);
00723           break;
00724       }
00725
00726       //-- Debuggee Priority Group
00727       switch( Profile.DebuggeePriority ) {
00728
00729         case IDLE_PRIORITY_CLASS:
00730           SendMessage( GetDlgItem( hDlg, IDC_IDLE_PRIORITY_CLASS),
00731             BM_SETCHECK, 1, 0);
00732           break;
00733
00734         case NORMAL_PRIORITY_CLASS:
00735           SendMessage( GetDlgItem( hDlg, IDC_NORMAL_PRIORITY_CLASS),
00736             BM_SETCHECK, 1, 0);
00737           break;
00738
00739         case HIGH_PRIORITY_CLASS:
00740           SendMessage( GetDlgItem( hDlg, IDC_HIGH_PRIORITY_CLASS),
00741             BM_SETCHECK, 1, 0);
00742           break;
00743
00744         case REALTIME_PRIORITY_CLASS:
00745           SendMessage( GetDlgItem( hDlg, IDC_REALTIME_PRIORITY_CLASS),
00746             BM_SETCHECK, 1, 0);
00747           break;
00748
00749       }
00750
00751       //-- Miscellaneous Options Group
00752       SendMessage( GetDlgItem( hDlg, IDC_CLEAR_ON_NEW),     BM_SETCHECK,
00753         Profile.fClearOnNew, 0 );
00754       SendMessage( GetDlgItem( hDlg, IDC_VERBOSE),          BM_SETCHECK,
00755         Profile.fVerbose, 0 );
00756       SendMessage( GetDlgItem( hDlg, IDC_SAVE_PREFERENCES), BM_SETCHECK,
00757         Profile.fSavePreferences, 0 );
00758
00759 #ifdef SHOW_SYMBOLS
00760       SendMessage( GetDlgItem( hDlg, IDC_SHOW_SYMBOLS),     BM_SETCHECK,
00761         Profile.fShowSymbols, 0 );
00762 #endif
00763
00764       //- Debug Error Level Group
00765       switch( Profile.DebugErrorLevel ) {
00766
00767         case 0:
00768           SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_NONE),
00769             BM_SETCHECK, 1, 0);
00770           break;
00771
00772         case SLE_ERROR:
00773           SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_ERROR),
00774             BM_SETCHECK, 1, 0);
00775           break;
00776
00777         case SLE_MINORERROR:
00778           SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_MINORERROR),
00779             BM_SETCHECK, 1, 0);
00780           break;
00781
00782         case SLE_WARNING:
00783           SendMessage( GetDlgItem( hDlg, IDC_DEBUG_MODE_WARNING),
00784             BM_SETCHECK, 1, 0);
00785           break;
00786
00787       }
00788
00789       return( TRUE );
00790   }
00791
00792   return( FALSE );
00793   UNREFERENCED_PARAMETER( lParam );
00794 }
00795
00796
00797 // ************************************************************************
00798 // FUNCTION : AttachDlgProc( HWND, UINT, WPARAM, LPARAM )
00799 // PURPOSE  : Processes messages for "Attach" dialog box
00800 // MESSAGES :
00801 //   WM_COMMAND    - Input received
00802 //   WM_INITDIALOG - initialize dialog box
00803 // COMMENTS :
00804 //   Wait for user to click on "Ok" button, then close the dialog box.
00805 // ************************************************************************
00806 BOOL CALLBACK
00807 AttachDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
00808 {
00809   static HWND hWndProcessList;
00810
00811   switch( uMsg ) {
00812
00813     case WM_COMMAND:
00814       switch( LOWORD(wParam) ) {
00815
00816         case IDOK: {
00817           LONG  Index;
00818           DWORD dwProcessId;
00819
00820           Index = (UINT) SendMessage( hWndProcessList, LB_GETCURSEL,
00821                          (WPARAM) 0L, (LPARAM) 0L );
00822           dwProcessId = (DWORD) SendMessage( hWndProcessList,
00823                                   LB_GETITEMDATA,
00824                                   (WPARAM) Index, (LPARAM) 0L );
00825           AttachToDebuggee( dwProcessId, Global.hWndListBox );
00826           EndDialog( hDlg, TRUE );
00827           return( TRUE );
00828         }
00829
00830         case IDCANCEL:
00831           EndDialog( hDlg, FALSE );
00832           return( TRUE );
00833
00834         case IDHELP:
00835           return( TRUE );
00836
00837       }
00838       switch( HIWORD( wParam ) ) {
00839         case LBN_DBLCLK:
00840           SendMessage( hDlg, WM_COMMAND, (WPARAM) IDOK, (LPARAM) 0L );
00841           return( TRUE );
00842       }
00843       break;
00844
00845     case WM_INITDIALOG:
00846       hWndProcessList = GetDlgItem( hDlg, IDC_PROCESSLIST );
00847       SendMessage( hWndProcessList, LB_RESETCONTENT, 0 , 0 );
00848       for(; !EnumWindows( (WNDENUMPROC) EnumProcessListFunc,
00849                (LPARAM) hWndProcessList ); )
00850         ; // continue looping until done
00851       return( TRUE );
00852   }
00853
00854   return( FALSE );
00855   UNREFERENCED_PARAMETER( lParam );
00856 }
00857
00858
00859 // **************************************************************************
00860 // FUNCTION : AboutDlgProc( HWND, UINT, WPARAM, LPARAM )
00861 // PURPOSE  : Processes messages for "About" dialog box
00862 // MESSAGES :
00863 //   WM_COMMAND    - Input received
00864 //     IDOK        - OK button selected
00865 //     IDCANCEL    - Cancel button selected
00866 //     ...
00867 //   WM_INITDIALOG - initialize dialog box
00868 //   WM_CLOSE      - close the dialog box
00869 //   ...
00870 // COMMENTS:
00871 //   No initialization is needed for this particular dialog box.
00872 //   In this case, TRUE must be returned to Windows.
00873 //   Wait for user to click on "Ok" button, then close the dialog box.
00874 // **************************************************************************
00875 BOOL CALLBACK
00876 AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
00877 {
00878   switch( uMsg ) {
00879
00880     case WM_COMMAND:
00881       switch( LOWORD(wParam) ) {
00882
00883         case IDOK:
00884           EndDialog( hDlg, TRUE );
00885           return( TRUE );
00886
00887         case IDCANCEL:
00888           EndDialog( hDlg, FALSE );
00889           return( FALSE );
00890
00891       }
00892       break;
00893
00894     case WM_INITDIALOG:
00895       SetTimer( hDlg, 1, TIMEOUT_ANIMATED_ICON, TimerProc );
00896       return( TRUE );
00897
00898     case WM_CLOSE:
00899       EndDialog( hDlg, TRUE );
00900       return( TRUE );
00901
00902     case WM_DESTROY:
00903       KillTimer( hDlg, 1 );
00904       return( TRUE );
00905   }
00906
00907   return( FALSE );
00908   UNREFERENCED_PARAMETER( lParam );
00909 }
00910
00911
00912 // ************************************************************************
00913 // FUNCTION : NewListBoxWndProc( HWND, UINT, WPARAM, LPARAM )
00914 // PURPOSE  : Processes messages for "LISTBOX" class.
00915 // COMMENTS : Prevents the user from moving the window
00916 //            by dragging the titlebar.
00917 // ************************************************************************
00918 LRESULT CALLBACK
00919 NewListBoxWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
00920 {
00921   switch( uMsg ) {
00922
00923     case WM_NCLBUTTONDOWN:
00924       if( wParam == HTCAPTION ) {
00925         SetFocus( hWnd );
00926         return( FALSE );
00927       }
00928       else
00929         break;
00930   }
00931
00932   return( CallWindowProc( Global.OldListBoxWndProc, hWnd, uMsg, wParam, lParam) );
00933 }
00934
00935
00936 // ************************************************************************
00937 // FUNCTION : TimerProc( HWND, UINT, UINT, DWORD )
00938 // PURPOSE  : Timer callback fuction that changes the dialog's icon (thus
00939 //            a animated icon) for each timer message received.
00940 // COMMENTS :
00941 // ************************************************************************
00942 VOID CALLBACK
00943 TimerProc( HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dwTime )
00944 {
00945  #define NUM_ICONS 8
00946
00947  static UINT    uIconNumber = 0;
00948  static HWND    hWndIcon    = 0L;
00949  static HWND    hWndIconOld = 0L;
00950  static LPCTSTR lpszIconNames[NUM_ICONS] = {
00951                   TEXT( "DebugIcon1" ), TEXT( "DebugIcon2" ),
00952                   TEXT( "DebugIcon3" ), TEXT( "DebugIcon4" ),
00953                   TEXT( "DebugIcon5" ), TEXT( "DebugIcon6" ),
00954                   TEXT( "DebugIcon7" ), TEXT( "DebugIcon8" ) };
00955
00956  if( (++uIconNumber) >= NUM_ICONS )
00957    uIconNumber = 0;
00958
00959  hWndIconOld = hWndIcon;
00960  hWndIcon = CreateIconWindow( hDlg, lpszIconNames[uIconNumber] );
00961  if( hWndIcon != 0L )
00962    DestroyWindow( hWndIconOld );
00963
00964  return;
00965  UNREFERENCED_PARAMETER( uMsg );
00966  UNREFERENCED_PARAMETER( idEvent );
00967  UNREFERENCED_PARAMETER( dwTime );
00968 }
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • CutCopy

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00025 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00026
00027
00028 //==============================================================
00029 //
00030 // CDelegationBase implementation
00031 //
00032 //
00033 CDelegationBase::CDelegationBase()
00034 : bExpanded(FALSE), m_handle(NULL)
00035 {
00036     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00037         LoadBitmaps();
00038 }
00039
00040 CDelegationBase::~CDelegationBase()
00041 {
00042 }
00043
00044 // CDelegationBase::AddImages sets up the collection of images to be displayed
00045 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00046 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00047 {
00048     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00049         (long *)m_pBMapLg, // pointer to a handle
00050         0, // index of the first image in the strip
00051         RGB(0, 128, 128)  // color of the icon mask
00052         );
00053 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

fullsvr::ICancelMethodCalls Member List

This is the complete list of members for fullsvr::ICancelMethodCalls, including all inherited members.
Cancel(int ulSeconds) | fullsvr::ICancelMethodCalls |
iid | fullsvr::ICancelMethodCalls | [static]
TestCancel() | fullsvr::ICancelMethodCalls |
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/WiaWrap.h Source File

  • Multimedia
  • wia
  • GetImage

WiaWrap.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #ifndef __WIAWRAP__
00008 #define __WIAWRAP__
00009
00010 namespace WiaWrap
00011 {
00012
00013 //////////////////////////////////////////////////////////////////////////
00014 //
00015 // ProgressCallback
00016 //
00017
00018 /*++
00019
00020     The ProgressCallback function is an application-defined callback function
00021     used with the WiaGetImage function.
00022
00023
00024     HRESULT
00025     CALLBACK
00026     ProgressCallback(
00027         LONG   lStatus,
00028         LONG   lPercentComplete,
00029         PVOID  pParam
00030     );
00031
00032
00033 Parameters
00034
00035     lStatus
00036         [in] Specifies a constant that indicates the status of the WIA device.
00037         Can be set to one of the following values;
00038
00039             IT_STATUS_TRANSFER_FROM_DEVICE: Data is currently being
00040             transferred from the WIA device.
00041
00042             IT_STATUS_PROCESSING_DATA: Data is currently being processed.
00043
00044             IT_STATUS_TRANSFER_TO_CLIENT: Data is currently being transferred
00045             to the client's data buffer.
00046
00047     lPercentComplete
00048         [in] Specifies the percentage of the total data that has been
00049         transferred so far.
00050
00051     pParam
00052         [in] Specifies the application-defined value given in WiaGetImage
00053
00054
00055 Return Values
00056
00057     To continue the data transfer, return S_OK.
00058
00059     To cancel the data transfer, return S_FALSE.
00060
00061     If the method fails, return a standard COM error code.
00062
00063 --*/
00064
00065 typedef HRESULT (CALLBACK *PFNPROGRESSCALLBACK)(
00066     LONG   lStatus,
00067     LONG   lPercentComplete,
00068     PVOID  pParam
00069 );
00070
00071 //////////////////////////////////////////////////////////////////////////
00072 //
00073 // WiaGetImage
00074 //
00075
00076 /*++
00077
00078     The WiaGetImage function displays one or more dialog boxes that enable a
00079     user to acquire multiple images from a WIA device and return them in an
00080     array of IStream interfaces. This method combines the functionality of
00081     SelectDeviceDlg, DeviceDlg and idtGetBandedData API's to completely
00082     encapsulate image acquisition within a single function call.
00083
00084
00085     HRESULT
00086     WiaGetImage(
00087         HWND                 hWndParent,
00088         LONG                 lDeviceType,
00089         LONG                 lFlags,
00090         LONG                 lIntent,
00091         IWiaDevMgr          *pSuppliedWiaDevMgr,
00092         IWiaItem            *pSuppliedItemRoot,
00093         PFNPROGRESSCALLBACK  pfnProgressCallback,
00094         PVOID                pProgressCallbackParam,
00095         GUID                *pguidFormat,
00096         LONG                *plCount,
00097         IStream             ***pppStream
00098     );
00099
00100
00101 Parameters
00102
00103     hwndParent
00104         [in] Handle of the window that will own the dialog boxes.
00105
00106     lDeviceType
00107         [in] Specifies which type of WIA device to use. Can be set to one of
00108         the following values;
00109
00110             StiDeviceTypeDefault
00111             StiDeviceTypeScanner
00112             StiDeviceTypeDigitalCamera
00113             StiDeviceTypeStreamingVideo
00114
00115     lFlags
00116         [in] Specifies dialog box behavior. Can be set to any combination of
00117         the following values;
00118
00119             0: Default behavior.
00120
00121             WIA_SELECT_DEVICE_NODEFAULT: Force this method to display the
00122             Select Device dialog box. If this flag is not present, and if
00123             WiaGetImage finds only one matching device, it will not display
00124             the Select Device dialog box.
00125
00126             WIA_DEVICE_DIALOG_SINGLE_IMAGE: Restrict image selection to a
00127             single image in the device image acquisition dialog box.
00128
00129             WIA_DEVICE_DIALOG_USE_COMMON_UI: Use the system UI, if available,
00130             rather than the vendor-supplied UI. If the system UI is not
00131             available, the vendor UI is used. If neither UI is available,
00132             the function returns E_NOTIMPL.
00133
00134     lIntent
00135         [in] Specifies what type of data the image is intended to represent.
00136
00137     pSuppliedWiaDevMgr
00138         [in] Pointer to the interface of the WIA device manager. This
00139         interface is used when WiaGetImage displays the Select Device dialog
00140         box. If the application passes NULL for this parameter, WiaGetImage
00141         connects to the local WIA device manager.
00142
00143     pSuppliedItemRoot
00144         [in] Pointer to the interface of the hierarchical tree of IWiaItem
00145         objects. If the application passes NULL for this parameter,
00146         WiaGetImage displays the Select Device dialog box that lets the user
00147         select the WIA input device. If the application specifies a WIA input
00148         device by passing a valid pointer to the device's item tree for this
00149         parameter, WiaGetImage does not display the Select Device dialog box,
00150         instead, it will use the specified input device to acquire the image.
00151
00152     pfnProgressCallback
00153         [in] Specifies the address of a callback function of type
00154         PFNPROGRESSCALLBACK that is called periodically to provide data
00155         transfer status notifications. If the application passes NULL
00156         for this parameter, WiaGetImage displays a simple progress dialog
00157         with a status message, a progress bar and a cancel button. If the
00158         application passes a valid function, WiaGetImage does not display
00159         this progress dialog, instead, it calls the specified function with
00160         the status message and the completion percentage values.
00161
00162     pProgressCallbackParam
00163         [in] Specifies an argument to be passed to the callback function.
00164         The value of the argument is specified by the application. This
00165         parameter can be NULL.
00166
00167     pguidFormat
00168         [in, out] On input, contains a pointer to a GUID that specifies the
00169         format to use. On output, holds the format used. If the application
00170         passes GUID_NULL for this parameter, WiaGetImage uses the default
00171         transfer format of the device and returns this format. If the
00172         application passes NULL for this parameter, WiaGetImage uses the
00173         default transfer format of the device but it does not return the
00174         used format.
00175
00176     plCount
00177         [out] Receives the number of items in the array indicated by the
00178         pppStream parameter.
00179
00180     pppStream
00181         [out] Receives the address of an array of pointers to IStream
00182         interfaces. Applications must call the IStream::Release method
00183         for each element in the array of interface pointers they receive.
00184         Applications must also free the pppStream array itself using
00185         CoTaskMemFree.
00186
00187
00188 Return Values
00189
00190     WiaGetImage returns one of the following values or a standard COM error
00191     if it fails for any other reason.
00192
00193     S_OK: if the data is transferred successfully.
00194
00195     S_FALSE: if the user cancels one of the device selection, image selection
00196     or image transfer dialog boxes.
00197
00198     WIA_S_NO_DEVICE_AVAILABLE: if no WIA device is currently available.
00199
00200     E_NOTIMPL: if no UI is available.
00201
00202
00203 Remarks
00204
00205     WiaGetImage returns the transferred images as stream objects in the
00206     pppStream array parameter. The array is created with CoTaskMemAlloc
00207     and the stream objects are created with CreateStreamOnHGlobal. The array
00208     will contain a single entry if the WIA_DEVICE_DIALOG_SINGLE_IMAGE flag
00209     is specified. Otherwise, it may contain one or more entries and the
00210     count will be returned in the plCount parameter.
00211
00212     The stream object will contain the image data. To create a GDI+ image
00213     object from the stream object, use the Gdiplus::Image(IStream* stream)
00214     function. To obtain a pointer to the memory address of the data, use
00215     the GetHGlobalFromStream API to obtain an HGLOBAL and use GlobalLock
00216     to obtain a direct pointer to the data.
00217
00218 --*/
00219
00220 HRESULT
00221 WiaGetImage(
00222     HWND                 hWndParent,
00223     LONG                 lDeviceType,
00224     LONG                 lFlags,
00225     LONG                 lIntent,
00226     IWiaDevMgr          *pSuppliedWiaDevMgr,
00227     IWiaItem            *pSuppliedItemRoot,
00228     PFNPROGRESSCALLBACK  pfnProgressCallback,
00229     PVOID                pProgressCallbackParam,
00230     GUID                *pguidFormat,
00231     LONG                *plCount,
00232     IStream             ***pppStream
00233 );
00234
00235
00236 //////////////////////////////////////////////////////////////////////////
00237 //
00238 // WiaGetNumDevices
00239 //
00240
00241 /*++
00242
00243     The WiaGetNumDevices function returns the number of WIA devices on
00244     the system.
00245
00246
00247     HRESULT
00248     WiaGetNumDevices(
00249         IWiaDevMgr *pSuppliedWiaDevMgr,
00250         ULONG      *pulNumDevices
00251     );
00252
00253
00254 Parameters
00255
00256     pSuppliedWiaDevMgr
00257         [in] Pointer to the interface of the WIA device manager. If the
00258         application passes NULL for this parameter, WiaGetNumDevices
00259         connects to the local WIA device manager.
00260
00261     pulNumDevices
00262         [out] Receives the number of WIA devices on the system.
00263
00264
00265 Return Values
00266
00267     WiaGetNumDevices returns S_OK on success or a standard COM error
00268     if it fails for any reason.
00269
00270 --*/
00271
00272 HRESULT
00273 WiaGetNumDevices(
00274     IWiaDevMgr *pSuppliedWiaDevMgr,
00275     ULONG      *pulNumDevices
00276 );
00277
00278
00279 //////////////////////////////////////////////////////////////////////////
00280 //
00281 // ReadPropertyLong
00282 //
00283
00284 /*++
00285
00286     The ReadPropertyLong function reads a long integer value from a WIA
00287     property storage
00288
00289
00290     HRESULT
00291     ReadPropertyLong(
00292         IWiaPropertyStorage *pWiaPropertyStorage,
00293         const PROPSPEC      *pPropSpec,
00294         LONG                *plResult
00295     );
00296
00297 Parameters
00298
00299     pWiaPropertyStorage
00300         [in] Pointer to the interface of the WIA property storage.
00301
00302     PropSpec
00303         [in] Pointer to a PROPSPEC structure that specifies which
00304         property is to be read.
00305
00306     plResult
00307         [out] Receives the value of the property specified by PropSpec
00308
00309
00310 Return Values
00311
00312     ReadPropertyLong returns S_OK on success or a standard COM error
00313     if it fails for any reason.
00314
00315 --*/
00316
00317 HRESULT
00318 ReadPropertyLong(
00319     IWiaPropertyStorage *pWiaPropertyStorage,
00320     const PROPSPEC      *pPropSpec,
00321     LONG                *plResult
00322 );
00323
00324
00325 //////////////////////////////////////////////////////////////////////////
00326 //
00327 // ReadPropertyGuid
00328 //
00329
00330 /*++
00331
00332     The ReadPropertyGuid function reads a GUID value from a WIA property
00333     storage
00334
00335
00336     HRESULT
00337     ReadPropertyGuid(
00338         IWiaPropertyStorage *pWiaPropertyStorage,
00339         const PROPSPEC      *pPropSpec,
00340         GUID                *pguidResult
00341     );
00342
00343
00344 Parameters
00345
00346     pWiaPropertyStorage
00347         [in] Pointer to the interface of the WIA property storage.
00348
00349     pPropSpec
00350         [in] Pointer to a PROPSPEC structure that specifies which
00351         property is to be read.
00352
00353     plResult
00354         [out] Receives the value of the property specified by PropSpec
00355
00356
00357 Return Values
00358
00359     ReadPropertyGuid returns S_OK on success or a standard COM error
00360     if it fails for any reason.
00361
00362 --*/
00363
00364 HRESULT
00365 ReadPropertyGuid(
00366     IWiaPropertyStorage *pWiaPropertyStorage,
00367     const PROPSPEC      *pPropSpec,
00368     GUID                *pguidResult
00369 );
00370
00371
00372 //////////////////////////////////////////////////////////////////////////
00373 //
00374 // CComPtrArray
00375 //
00376
00377 /*++
00378
00379     CComPtrArray stores an array of COM interface pointers and performs
00380     reference counting through AddRef and Release methods.
00381
00382     CComPtrArray can be used with WiaGetImage and DeviceDlg functions
00383     to provide automatic deallocation of the output arrays.
00384
00385 Methods
00386
00387     CComPtrArray()
00388         Initializes the array pointer and the count to zero.
00389
00390     CComPtrArray(int nCount)
00391         Allocates the array for with CoTaskMemAlloc for nCount items and
00392         initializes the interface pointers to NULL
00393
00394     Copy(const CComPtrArray& rhs)
00395         Allocates a new array with CoTaskMemAlloc, copies the interface
00396         pointers and call AddRef() on the copied pointers.
00397
00398     Clear()
00399         Calls Release on the interface pointers in the array and
00400         deallocates the array with CoTaskMemFree
00401
00402     CComPtrArray(const CComPtrArray& rhs)
00403         Calls the Copy method to copy the new contents.
00404
00405     CComPtrArray &operator =(const CComPtrArray& rhs)
00406         Calls the Clear method to delete the current contents and calls
00407         the Copy method to copy the new contents.
00408
00409     ~CComPtrArray()
00410         Destructor, calls the Clear method
00411
00412     operator T **()
00413         Returns the dereferenced value of the member pointer.
00414
00415     bool operator!()
00416         Returns TRUE or FALSE, depending on whether the member pointer is
00417         NULL or not.
00418
00419     T ***operator&()
00420         Returns the address of the member pointer.
00421
00422     LONG &Count()
00423         Returns a reference to the count.
00424
00425 --*/
00426
00427 template <class T>
00428 class CComPtrArray
00429 {
00430 public:
00431     CComPtrArray()
00432     {
00433         m_pArray = NULL;
00434         m_nCount = 0;
00435     }
00436
00437     explicit CComPtrArray(int nCount)
00438     {
00439         m_pArray = (T **) CoTaskMemAlloc(nCount * sizeof(T *));
00440
00441         m_nCount = m_pArray == NULL ? 0 : nCount;
00442
00443         for (int i = 0; i < m_nCount; ++i)
00444         {
00445             m_pArray[i] = NULL;
00446         }
00447     }
00448
00449     CComPtrArray(const CComPtrArray& rhs)
00450     {
00451         Copy(rhs);
00452     }
00453
00454     ~CComPtrArray()
00455     {
00456         Clear();
00457     }
00458
00459     CComPtrArray &operator =(const CComPtrArray& rhs)
00460     {
00461         if (this != &rhs)
00462         {
00463             Clear();
00464             Copy(rhs);
00465         }
00466
00467         return *this;
00468     }
00469
00470     operator T **()
00471     {
00472         return m_pArray;
00473     }
00474
00475     bool operator!()
00476     {
00477         return m_pArray == NULL;
00478     }
00479
00480     T ***operator&()
00481     {
00482         return &m_pArray;
00483     }
00484
00485     LONG &Count()
00486     {
00487         return m_nCount;
00488     }
00489
00490   void Clear()
00491   {
00492         if (m_pArray != NULL)
00493         {
00494             for (int i = 0; i < m_nCount; ++i)
00495             {
00496                 if (m_pArray[i] != NULL)
00497                 {
00498                     m_pArray[i]->Release();
00499                 }
00500             }
00501
00502             CoTaskMemFree(m_pArray);
00503
00504             m_pArray = NULL;
00505             m_nCount = 0;
00506         }
00507   }
00508
00509     void Copy(const CComPtrArray& rhs)
00510     {
00511         m_pArray = NULL;
00512         m_nCount = 0;
00513
00514         if (rhs.m_pArray != NULL)
00515         {
00516             m_pArray = (T**) CoTaskMemAlloc(rhs.m_nCount * sizeof(T *));
00517
00518             if (m_pArray != NULL)
00519             {
00520                 m_nCount = rhs.m_nCount;
00521
00522                 for (int i = 0; i < m_nCount; ++i)
00523                 {
00524                     m_pArray[i] = rhs.m_pArray[i];
00525
00526                     if (m_pArray[i] != NULL)
00527                     {
00528                         m_pArray[i]->AddRef();
00529                     }
00530                 }
00531             }
00532         }
00533     }
00534
00535 private:
00536     T    **m_pArray;
00537     LONG  m_nCount;
00538 };
00539
00540
00541 }; // namespace WiaWrap
00542
00543 #endif //__WIAWRAP__
00544
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/globals.h Source File

  • SysMgmt
  • MMC
  • Openserv

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025         #define IDM_BUTTON1    0x100
00026         #define IDM_BUTTON2    0x101
00027
00028         extern HINSTANCE g_hinst;
00029         extern ULONG g_uObjects;
00030
00031         #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032         #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034         // uncomment the following #define to enable message cracking
00035         // #define MMC_CRACK_MESSAGES
00036         void MMCN_Crack(BOOL bComponentData,
00037                                         IDataObject *pDataObject,
00038                                         IComponentData *pCompData,
00039                                         IComponent *pComp,
00040                                         MMC_NOTIFY_TYPE event,
00041                                         LPARAM arg,
00042                                         LPARAM param);
00043 #endif
00044
00045 //=--------------------------------------------------------------------------=
00046 // allocates a temporary buffer that will disappear when it goes out of scope
00047 // NOTE: be careful of that -- make sure you use the string in the same or
00048 // nested scope in which you created this buffer. people should not use this
00049 // class directly.  use the macro(s) below.
00050 //
00051 class TempBuffer {
00052   public:
00053     TempBuffer(ULONG cBytes) {
00054         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00055         m_fHeapAlloc = (cBytes > 120);
00056     }
00057     ~TempBuffer() {
00058         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00059     }
00060     void *GetBuffer() {
00061         return m_pBuf;
00062     }
00063
00064   private:
00065     void *m_pBuf;
00066     // we'll use this temp buffer for small cases.
00067     //
00068     char  m_szTmpBuf[120];
00069     unsigned m_fHeapAlloc:1;
00070 };
00071
00072 //=--------------------------------------------------------------------------=
00073 // string helpers.
00074 //
00075 // given a _TCHAR, copy it into a wide buffer.
00076 // be careful about scoping when using this macro!
00077 //
00078 // how to use the below two macros:
00079 //
00080 //  ...
00081 //  LPTSTR pszT;
00082 //  pszT = MyGetTStringRoutine();
00083 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00084 //  MyUseWideStringRoutine(pwsz);
00085 //  ...
00086 #ifdef UNICODE
00087 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00088     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00089     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00090     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00091     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00092 #else // ANSI
00093 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00094     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00095     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00096     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00097     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00098     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00099 #endif
00100
00101 #ifdef UNICODE
00102 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00103     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00104     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00105     lstrcpyW((LPWSTR)ptrname, tstr)
00106 #else // ANSI
00107 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00108     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00109     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00110     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00111     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00112 #endif
00113
00114 //
00115 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00116 // have to be declared, and no clean up must be done.
00117 //
00118 // * 2 for DBCS handling in below length computation
00119 //
00120 #ifdef UNICODE
00121 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00122     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00123     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00124     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00125     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00126 #else // ANSI
00127 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00128     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00129     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00130     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00131     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00132 #endif
00133
00134 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBicycle Member List

This is the complete list of members for CBicycle, including all inherited members.
AddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
bExpanded | CDelegationBase | [protected]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(int i) | CBicycle | [inline]
CBicycle(CBicycleFolder *parent, IWbemClassObject *inst) | CBicycle |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
CDelegationBase() | CDelegationBase |
ConvertSurfaceValue(BYTE val) | CBicycle | [private]
CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle) | CBicycle | [virtual]
DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBicycle | [private, static]
Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetBitmapIndex() | CBicycle | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildColumnInfo(RESULTDATAITEM *rdi) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetChildPtr(int index) | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetCookie() | CDelegationBase | [inline, virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetDisplayName(int nCol=0) | CBicycle | [virtual]
GetGirls(void) | CBicycle | [private]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline]
GetHandle() | CDelegationBase | [inline, virtual]
GetListpadInfo(MMC_LISTPAD_INFO *lpListPadInfo) | CDelegationBase | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
getNodeType() | CBicycle | [inline, virtual]
GetParentScopeItem() | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) | CDelegationBase | [inline, virtual]
GetTaskList(LPOLESTR szTaskGroup, LONG *nCount) | CDelegationBase | [inline, virtual]
GetTaskpadBackground(MMC_TASK_DISPLAY_OBJECT *pTDO) | CDelegationBase | [inline, virtual]
GetTaskpadDescription(LPOLESTR *pszDescription) | CDelegationBase | [inline, virtual]
GetTaskpadTitle(LPOLESTR *pszTitle) | CDelegationBase | [inline, virtual]
GetWatermarks(HBITMAP *lphWatermark, HBITMAP *lphHeader, HPALETTE *lphPalette, BOOL *bStretch) | CBicycle | [virtual]
HasPropertySheets() | CBicycle | [virtual]
id | CBicycle | [private]
InitOCX(IUnknown *pUnknown) | CDelegationBase | [inline, virtual]
LoadBitmaps() | CDelegationBase | [inline, protected]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadBitmaps() | CDelegationBase | [inline, protected, static]
LoadSurfaces(HWND hwndDlg, BYTE iSurface) | CBicycle | [private]
m_inst | CBicycle | [private]
m_iSurface | CBicycle | [private]
m_parent | CBicycle | [private]
m_pBMapLg | CDelegationBase |
m_pBMapLg | CDelegationBase | [static]
m_pBMapSm | CDelegationBase |
m_pBMapSm | CDelegationBase | [static]
m_pComponentData | CDelegationBase |
m_ppHandle | CBicycle | [private]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddImages(IImageList *pImageList, HSCOPEITEM hsi) | CDelegationBase | [virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) | CDelegationBase | [inline, virtual]
OnButtonClicked(CComponent *pComponent) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsoleComp) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDelete(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnDeleteScopeItem(IConsoleNameSpace *pConsoleNameSpace) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) | CDelegationBase | [inline, virtual]
OnListpad(IConsole *pConsole, BOOL bAttaching) | CDelegationBase | [inline, virtual]
OnMenuButtonCommand(IConsole *pConsole, int nMenuId, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, IConsoleNameSpace *pConsoleNameSpace, long lCommandID, IDataObject *piDataObject) | CDelegationBase | [inline, virtual]
OnMenuCommand(IConsole *pConsole, long lCommandID) | CDelegationBase | [inline, virtual]
OnPaste(IConsole *pConsole, CComponentData *pComponentData, CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnPropertyChange() | CBicycle | [virtual]
CDelegationBase::OnPropertyChange(IConsole *pConsole, CComponent *pComponent) | CDelegationBase | [inline, virtual]
CDelegationBase::OnPropertyChange(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnQueryPaste(CDelegationBase *pPasted) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh(IConsole *pConsole) | CDelegationBase | [inline, virtual]
OnRefresh() | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnRename(LPOLESTR pszNewName) | CDelegationBase | [inline, virtual]
OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CBicycle | [virtual]
CDelegationBase::OnSelect(CComponent *pComponent, IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
CDelegationBase::OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetMenuButton(IConsole *pConsole, MENUBUTTONDATA *pmbd) | CDelegationBase | [inline, virtual]
OnSetToolbar(IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [virtual]
OnToolbarCommand(IConsole *pConsole, MMC_CONSOLE_VERB verb, IDataObject *pDataObject) | CDelegationBase | [inline, virtual]
OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype) | CDelegationBase | [inline, virtual]
PutProperty(LPWSTR propName, LPTSTR str) | CBicycle | [private]
PutProperty(LPWSTR propName, BYTE val) | CBicycle | [private]
PutProperty(LPWSTR propName, bool val) | CBicycle | [private]
Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SelectItem(IConsole *pConsole) | CDelegationBase | [inline, virtual]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetComponentData(CComponentData *pComponentData) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline]
SetHandle(HANDLE handle) | CDelegationBase | [inline, virtual]
SetMenuState(IControlbar *pControlbar, IMenuButton *pMenuButton, BOOL bScope, BOOL bSelect) | CDelegationBase | [inline, virtual]
SetScopeItemValue(HSCOPEITEM hscopeitem) | CDelegationBase | [inline, virtual]
Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) | CDelegationBase | [inline, virtual]
ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) | CDelegationBase | [inline, virtual]
TaskNotify(IConsole *pConsole, VARIANT *v1, VARIANT *v2) | CDelegationBase | [inline, virtual]
thisGuid | CBicycle | [private, static]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CBicycle() | CBicycle | [inline, virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
~CDelegationBase() | CDelegationBase | [virtual]
Generated on Wed Nov 13 2024 16:55:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Snmp/TestDll/TestMIB.C Source File

  • NetDS
  • Snmp
  • TestDll

TestMIB.C

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 Copyright (c) 1992 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     testmib.c
00008
00009 Abstract:
00010
00011     Sample SNMP Extension Agent for Windows NT.
00012
00013     These files (testdll.c, testmib.c, and testmib.h) provide an example of
00014     how to structure an Extension Agent DLL which works in conjunction with
00015     the SNMP Extendible Agent for Windows NT.
00016
00017     Extensive comments have been included to describe its structure and
00018     operation.  See also "Microsoft Windows NT SNMP Programmer's Reference".
00019
00020 --*/
00021
00022
00023 // This Extension Agent implements the Internet toaster MIB.  It's
00024 // definition follows here:
00025 //
00026 //
00027 //         TOASTER-MIB DEFINITIONS ::= BEGIN
00028 //
00029 //         IMPORTS
00030 //                 enterprises
00031 //                         FROM RFC1155-SMI
00032 //                 OBJECT-TYPE
00033 //                         FROM RFC-1212
00034 //                 DisplayString
00035 //                         FROM RFC-1213;
00036 //
00037 //         epilogue        OBJECT IDENTIFIER ::= { enterprises 12 }
00038 //         toaster         OBJECT IDENTIFIER ::= { epilogue 2 }
00039 //
00040 //         -- toaster MIB
00041 //
00042 //         toasterManufacturer OBJECT-TYPE
00043 //             SYNTAX  DisplayString
00044 //             ACCESS  read-only
00045 //             STATUS  mandatory
00046 //             DESCRIPTION
00047 //                     "The name of the toaster's manufacturer. For instance,
00048 //                      Sunbeam."
00049 //             ::= { toaster 1 }
00050 //
00051 //         toasterModelNumber OBJECT-TYPE
00052 //             SYNTAX  DisplayString
00053 //             ACCESS  read-only
00054 //             STATUS  mandatory
00055 //             DESCRIPTION
00056 //                     "The name of the toaster's model. For instance,
00057 //                      Radiant Automatic."
00058 //             ::= { toaster 2 }
00059 //
00060 //         toasterControl OBJECT-TYPE
00061 //             SYNTAX  INTEGER  {
00062 //                         up(1),
00063 //                         down(2)
00064 //                     }
00065 //             ACCESS  read-write
00066 //             STATUS  mandatory
00067 //             DESCRIPTION
00068 //                     "This variable controls the current state of the
00069 //                      toaster. To begin toasting, set it to down(2). To
00070 //                      abort toasting (perhaps in the event of an
00071 //                      emergency), set it to up(2)."
00072 //             ::= { toaster 3 }
00073 //
00074 //         toasterDoneness OBJECT-TYPE
00075 //             SYNTAX  INTEGER (1..10)
00076 //             ACCESS  read-write
00077 //             STATUS  mandatory
00078 //             DESCRIPTION
00079 //                     "This variable controls how well done ensuing toast
00080 //                      should be on a scale of 1 to 10. Toast made at 10
00081 //                      is generally considered unfit for human consumption;
00082 //                      toast made at 1 is lightly warmed."
00083 //             ::= { toaster 4 }
00084 //
00085 //         toasterToastType OBJECT-TYPE
00086 //             SYNTAX  INTEGER  {
00087 //                         white-bread(1),
00088 //                         wheat-bread(2),
00089 //                         wonder-bread(3),
00090 //                         frozen-waffle(4),
00091 //                         frozen-bagel(5),
00092 //                         hash-brown(6),
00093 //                         other(7)
00094 //                     }
00095 //             ACCESS  read-write
00096 //             STATUS  mandatory
00097 //             DESCRIPTION
00098 //                     "This variable informs the toaster of the type of
00099 //                      material being toasted. The toaster uses this
00100 //                      information combined with toasterToastDoneness to
00101 //                      compute how long the material must be toasted for
00102 //                      to achieve the desired doneness."
00103 //             ::= { toaster 5 }
00104 //
00105 //         END
00106
00107
00108 // Necessary includes.
00109
00110 #include <windows.h>
00111
00112 #include <snmp.h>
00113
00114
00115 // Contains definitions for the table structure describing the MIB.  This
00116 // is used in conjunction with testmib.c where the MIB requests are resolved.
00117
00118 #include "testmib.h"
00119
00120
00121 // If an addition or deletion to the MIB is necessary, there are several
00122 // places in the code that must be checked and possibly changed.
00123 //
00124 // The last field in each MIB entry is used to point to the NEXT
00125 // leaf variable.  If an addition or deletetion is made, these pointers
00126 // may need to be updated to reflect the modification.
00127
00128
00129 // The prefix to all of these MIB variables is 1.3.6.1.4.1.12
00130
00131 UINT OID_Prefix[] = { 1, 3, 6, 1, 4, 1, 12 };
00132 AsnObjectIdentifier MIB_OidPrefix = { OID_SIZEOF(OID_Prefix), OID_Prefix };
00133
00134
00135
00136 //                         //
00137 // OID definitions for MIB //
00138 //                         //
00139
00140
00141 // Definition of the toaster group
00142
00143 UINT MIB_toaster[]  = { 2 };
00144
00145
00146 // Definition of leaf variables under the toaster group
00147 // All leaf variables have a zero appended to their OID to indicate
00148 // that it is the only instance of this variable and it exists.
00149
00150 UINT MIB_toasterManufacturer[]     = { 2, 1, 0 };
00151 UINT MIB_toasterModelNumber[]      = { 2, 2, 0 };
00152 UINT MIB_toasterControl[]          = { 2, 3, 0 };
00153 UINT MIB_toasterDoneness[]         = { 2, 4, 0 };
00154 UINT MIB_toasterToastType[]        = { 2, 5, 0 };
00155
00156
00157
00158 //                             //
00159 // Storage definitions for MIB //
00160 //                             //
00161
00162 char       MIB_toasterManStor[]     = "Microsoft Corporation";
00163 char       MIB_toasterModelStor[]   =
00164                "Example SNMP Extension Agent for Windows/NT (TOASTER-MIB).";
00165 AsnInteger MIB_toasterControlStor   = 1;
00166 AsnInteger MIB_toasterDonenessStor  = 2;
00167 AsnInteger MIB_toasterToastTypeStor = 3;
00168
00169
00170
00171 // MIB definiton
00172
00173 MIB_ENTRY Mib[] = {
00174       { { OID_SIZEOF(MIB_toasterManufacturer), MIB_toasterManufacturer },
00175         &MIB_toasterManStor, ASN_RFC1213_DISPSTRING,
00176         MIB_ACCESS_READ, MIB_leaf_func, &Mib[1] },
00177
00178       { { OID_SIZEOF(MIB_toasterModelNumber), MIB_toasterModelNumber },
00179         &MIB_toasterModelStor, ASN_RFC1213_DISPSTRING,
00180         MIB_ACCESS_READ, MIB_leaf_func, &Mib[2] },
00181
00182       { { OID_SIZEOF(MIB_toasterControl), MIB_toasterControl },
00183         &MIB_toasterControlStor, ASN_INTEGER,
00184         MIB_ACCESS_READWRITE, MIB_control_func, &Mib[3] },
00185
00186       { { OID_SIZEOF(MIB_toasterDoneness), MIB_toasterDoneness },
00187         &MIB_toasterDonenessStor, ASN_INTEGER,
00188         MIB_ACCESS_READWRITE, MIB_doneness_func, &Mib[4] },
00189
00190       { { OID_SIZEOF(MIB_toasterToastType), MIB_toasterToastType },
00191         &MIB_toasterToastTypeStor, ASN_INTEGER,
00192         MIB_ACCESS_READWRITE, MIB_toasttype_func, NULL }
00193       };
00194
00195 UINT MIB_num_variables = sizeof Mib / sizeof( MIB_ENTRY );
00196
00197
00198
00199 //
00200 // ResolveVarBind
00201 //    Resolves a single variable binding.  Modifies the variable on a GET
00202 //    or a GET-NEXT.
00203 //
00204 // Notes:
00205 //
00206 // Return Codes:
00207 //    Standard PDU error codes.
00208 //
00209 // Error Codes:
00210 //    None.
00211 //
00212 UINT ResolveVarBind(
00213         IN OUT RFC1157VarBind *VarBind, // Variable Binding to resolve
00214   IN UINT PduAction               // Action specified in PDU
00215   )
00216
00217 {
00218 MIB_ENTRY            *MibPtr;
00219 AsnObjectIdentifier  TempOid;
00220 int                  CompResult;
00221 UINT                 I;
00222 UINT                 nResult;
00223
00224
00225    // Search for var bind name in the MIB
00226    I      = 0;
00227    MibPtr = NULL;
00228    while ( MibPtr == NULL && I < MIB_num_variables )
00229       {
00230       // Construct OID with complete prefix for comparison purposes
00231       SnmpUtilOidCpy( &TempOid, &MIB_OidPrefix );
00232       SnmpUtilOidAppend( &TempOid, &Mib[I].Oid );
00233
00234       // Check for OID in MIB - On a GET-NEXT the OID does not have to exactly
00235       // match a variable in the MIB, it must only fall under the MIB root.
00236       CompResult = SnmpUtilOidCmp( &VarBind->name, &TempOid );
00237       if ( 0 > CompResult )
00238    {
00239    // Since there is not an exact match, the only valid action is GET-NEXT
00240    if ( MIB_ACTION_GETNEXT != PduAction )
00241       {
00242       nResult = SNMP_ERRORSTATUS_NOSUCHNAME;
00243       goto Exit;
00244       }
00245
00246    // Since the match was not exact, but var bind name is within MIB,
00247    // we are at the NEXT MIB variable down from the one specified.
00248    PduAction = MIB_ACTION_GET;
00249    MibPtr = &Mib[I];
00250
00251          // Replace var bind name with new name
00252          SnmpUtilOidFree( &VarBind->name );
00253          SnmpUtilOidCpy( &VarBind->name, &MIB_OidPrefix );
00254          SnmpUtilOidAppend( &VarBind->name, &MibPtr->Oid );
00255    }
00256       else
00257          {
00258    // An exact match was found.
00259          if ( 0 == CompResult )
00260             {
00261       MibPtr = &Mib[I];
00262       }
00263    }
00264
00265       // Free OID memory before checking another variable
00266       SnmpUtilOidFree( &TempOid );
00267
00268       I++;
00269       } // while
00270
00271    // If OID not within scope of MIB, then no such name
00272    if ( MibPtr == NULL )
00273       {
00274       nResult = SNMP_ERRORSTATUS_NOSUCHNAME;
00275       goto Exit;
00276       }
00277
00278    // Call function to process request.  Each MIB entry has a function pointer
00279    // that knows how to process its MIB variable.
00280    nResult = (*MibPtr->MibFunc)( PduAction, MibPtr, VarBind );
00281
00282    // Free temp memory
00283    SnmpUtilOidFree( &TempOid );
00284
00285 Exit:
00286    return nResult;
00287 } // ResolveVarBind
00288
00289
00290
00291 //
00292 // MIB_leaf_func
00293 //    Performs generic actions on LEAF variables in the MIB.
00294 //
00295 // Notes:
00296 //
00297 // Return Codes:
00298 //    Standard PDU error codes.
00299 //
00300 // Error Codes:
00301 //    None.
00302 //
00303 UINT MIB_leaf_func(
00304         IN UINT Action,
00305   IN MIB_ENTRY *MibPtr,
00306   IN RFC1157VarBind *VarBind
00307   )
00308
00309 {
00310 UINT   ErrStat;
00311
00312    switch ( Action )
00313       {
00314       case MIB_ACTION_GETNEXT:
00315    // If there is no GET-NEXT pointer, this is the end of this MIB
00316    if ( MibPtr->MibNext == NULL )
00317       {
00318       ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
00319       goto Exit;
00320       }
00321
00322          // Setup var bind name of NEXT MIB variable
00323          SnmpUtilOidFree( &VarBind->name );
00324          SnmpUtilOidCpy( &VarBind->name, &MIB_OidPrefix );
00325          SnmpUtilOidAppend( &VarBind->name, &MibPtr->MibNext->Oid );
00326
00327          // Call function to process request.  Each MIB entry has a function
00328    // pointer that knows how to process its MIB variable.
00329          ErrStat = (*MibPtr->MibNext->MibFunc)( MIB_ACTION_GET,
00330                                           MibPtr->MibNext, VarBind );
00331          break;
00332
00333       case MIB_ACTION_GET:
00334          // Make sure that this variable's ACCESS is GET'able
00335    if ( MibPtr->Access != MIB_ACCESS_READ &&
00336         MibPtr->Access != MIB_ACCESS_READWRITE )
00337       {
00338       ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
00339       goto Exit;
00340       }
00341
00342    // Setup varbind's return value
00343    VarBind->value.asnType = MibPtr->Type;
00344    switch ( VarBind->value.asnType )
00345       {
00346             case ASN_RFC1155_COUNTER:
00347             case ASN_RFC1155_GAUGE:
00348             case ASN_INTEGER:
00349                VarBind->value.asnValue.number = *(AsnInteger *)(MibPtr->Storage);
00350          break;
00351
00352             case ASN_OCTETSTRING: // This entails ASN_RFC1213_DISPSTRING also
00353          VarBind->value.asnValue.string.length =
00354                                  (int)(strlen( (LPSTR)MibPtr->Storage ));
00355
00356          if ( NULL ==
00357                     (VarBind->value.asnValue.string.stream =
00358                     SnmpUtilMemAlloc(VarBind->value.asnValue.string.length *
00359                            sizeof(char))) )
00360             {
00361             ErrStat = SNMP_ERRORSTATUS_GENERR;
00362             goto Exit;
00363             }
00364
00365          memcpy( VarBind->value.asnValue.string.stream,
00366                  (LPSTR)MibPtr->Storage,
00367                  VarBind->value.asnValue.string.length );
00368          VarBind->value.asnValue.string.dynamic = TRUE;
00369
00370          break;
00371
00372       default:
00373          ErrStat = SNMP_ERRORSTATUS_GENERR;
00374          goto Exit;
00375       }
00376
00377    break;
00378
00379       case MIB_ACTION_SET:
00380          // Make sure that this variable's ACCESS is SET'able
00381    if ( MibPtr->Access != MIB_ACCESS_READWRITE &&
00382         MibPtr->Access != MIB_ACCESS_WRITE )
00383       {
00384       ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
00385             goto Exit;
00386       }
00387
00388          // Check for proper type before setting
00389          if ( MibPtr->Type != VarBind->value.asnType )
00390       {
00391       ErrStat = SNMP_ERRORSTATUS_BADVALUE;
00392       goto Exit;
00393       }
00394
00395    // Save value in MIB
00396    switch ( VarBind->value.asnType )
00397       {
00398             case ASN_RFC1155_COUNTER:
00399             case ASN_RFC1155_GAUGE:
00400             case ASN_INTEGER:
00401                *(AsnInteger *)(MibPtr->Storage) = VarBind->value.asnValue.number;
00402          break;
00403
00404             case ASN_OCTETSTRING: // This entails ASN_RFC1213_DISPSTRING also
00405                // The storage must be adequate to contain the new string
00406                // including a NULL terminator.
00407                memcpy( (LPSTR)MibPtr->Storage,
00408                        VarBind->value.asnValue.string.stream,
00409                        VarBind->value.asnValue.string.length );
00410
00411          ((LPSTR)MibPtr->Storage)[VarBind->value.asnValue.string.length] =
00412                                                                           '\0';
00413          break;
00414
00415       default:
00416          ErrStat = SNMP_ERRORSTATUS_GENERR;
00417          goto Exit;
00418       }
00419
00420          break;
00421
00422       default:
00423    ErrStat = SNMP_ERRORSTATUS_GENERR;
00424    goto Exit;
00425       } // switch
00426
00427    // Signal no error occurred
00428    ErrStat = SNMP_ERRORSTATUS_NOERROR;
00429
00430 Exit:
00431    return ErrStat;
00432 } // MIB_leaf_func
00433
00434
00435
00436 //
00437 // MIB_control_func
00438 //    Performs specific actions on the toasterControl MIB variable
00439 //
00440 // Notes:
00441 //
00442 // Return Codes:
00443 //    Standard PDU error codes.
00444 //
00445 // Error Codes:
00446 //    None.
00447 //
00448 UINT MIB_control_func(
00449         IN UINT Action,
00450   IN MIB_ENTRY *MibPtr,
00451   IN RFC1157VarBind *VarBind
00452   )
00453
00454 {
00455 UINT   ErrStat;
00456
00457    switch ( Action )
00458       {
00459       case MIB_ACTION_SET:
00460          // Make sure that this variable's ACCESS is SET'able
00461    if ( MibPtr->Access != MIB_ACCESS_READWRITE &&
00462         MibPtr->Access != MIB_ACCESS_WRITE )
00463       {
00464       ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
00465             goto Exit;
00466       }
00467
00468          // Check for proper type before setting
00469          if ( MibPtr->Type != VarBind->value.asnType )
00470       {
00471       ErrStat = SNMP_ERRORSTATUS_BADVALUE;
00472       goto Exit;
00473       }
00474
00475          // Make sure the value is valid
00476          if ( MIB_TOASTER_UP > VarBind->value.asnValue.number ||
00477               MIB_TOASTER_DOWN < VarBind->value.asnValue.number )
00478             {
00479       ErrStat = SNMP_ERRORSTATUS_BADVALUE;
00480       goto Exit;
00481             }
00482
00483          // Let fall through purposefully for further processing by
00484          // generic leaf function.
00485
00486       case MIB_ACTION_GETNEXT:
00487       case MIB_ACTION_GET:
00488    // Call the more generic function to perform the action
00489          ErrStat = MIB_leaf_func( Action, MibPtr, VarBind );
00490          break;
00491
00492       default:
00493    ErrStat = SNMP_ERRORSTATUS_GENERR;
00494    goto Exit;
00495       } // switch
00496
00497 Exit:
00498    return ErrStat;
00499 } // MIB_control_func
00500
00501
00502
00503 //
00504 // MIB_doneness_func
00505 //    Performs specific actions on the toasterDoneness MIB variable
00506 //
00507 // Notes:
00508 //
00509 // Return Codes:
00510 //    Standard PDU error codes.
00511 //
00512 // Error Codes:
00513 //    None.
00514 //
00515 UINT MIB_doneness_func(
00516         IN UINT Action,
00517   IN MIB_ENTRY *MibPtr,
00518   IN RFC1157VarBind *VarBind
00519   )
00520
00521 {
00522 UINT   ErrStat;
00523
00524    switch ( Action )
00525       {
00526       case MIB_ACTION_SET:
00527          // Make sure that this variable's ACCESS is SET'able
00528    if ( MibPtr->Access != MIB_ACCESS_READWRITE &&
00529         MibPtr->Access != MIB_ACCESS_WRITE )
00530       {
00531       ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
00532             goto Exit;
00533       }
00534
00535          // Check for proper type before setting
00536          if ( MibPtr->Type != VarBind->value.asnType )
00537       {
00538       ErrStat = SNMP_ERRORSTATUS_BADVALUE;
00539       goto Exit;
00540       }
00541
00542          // Make sure the value is valid
00543          if ( MIB_TOASTER_LIGHTLYWARM > VarBind->value.asnValue.number ||
00544               MIB_TOASTER_BURNT < VarBind->value.asnValue.number )
00545             {
00546       ErrStat = SNMP_ERRORSTATUS_BADVALUE;
00547       goto Exit;
00548             }
00549
00550          // Let fall through purposefully for further processing by
00551          // generic leaf function.
00552
00553       case MIB_ACTION_GETNEXT:
00554       case MIB_ACTION_GET:
00555    // Call the more generic function to perform the action
00556          ErrStat = MIB_leaf_func( Action, MibPtr, VarBind );
00557          break;
00558
00559       default:
00560    ErrStat = SNMP_ERRORSTATUS_GENERR;
00561    goto Exit;
00562       } // switch
00563
00564 Exit:
00565    return ErrStat;
00566 } // MIB_doneness_func
00567
00568
00569
00570 //
00571 // MIB_toasttype_func
00572 //    Performs specific actions on the toasterToastType MIB variable
00573 //
00574 // Notes:
00575 //
00576 // Return Codes:
00577 //    Standard PDU error codes.
00578 //
00579 // Error Codes:
00580 //    None.
00581 //
00582 UINT MIB_toasttype_func(
00583         IN UINT Action,
00584   IN MIB_ENTRY *MibPtr,
00585   IN RFC1157VarBind *VarBind
00586   )
00587
00588 {
00589 UINT   ErrStat;
00590
00591    switch ( Action )
00592       {
00593       case MIB_ACTION_SET:
00594          // Make sure that this variable's ACCESS is SET'able
00595    if ( MibPtr->Access != MIB_ACCESS_READWRITE &&
00596         MibPtr->Access != MIB_ACCESS_WRITE )
00597       {
00598       ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
00599             goto Exit;
00600       }
00601
00602          // Check for proper type before setting
00603          if ( MibPtr->Type != VarBind->value.asnType )
00604       {
00605       ErrStat = SNMP_ERRORSTATUS_BADVALUE;
00606       goto Exit;
00607       }
00608
00609          // Make sure the value is valid
00610          if ( MIB_TOASTER_WHITEBREAD > VarBind->value.asnValue.number ||
00611               MIB_TOASTER_OTHERBREAD < VarBind->value.asnValue.number )
00612             {
00613       ErrStat = SNMP_ERRORSTATUS_BADVALUE;
00614       goto Exit;
00615             }
00616
00617          // Let fall through purposefully for further processing by
00618          // generic leaf function.
00619
00620       case MIB_ACTION_GETNEXT:
00621       case MIB_ACTION_GET:
00622    // Call the more generic function to perform the action
00623          ErrStat = MIB_leaf_func( Action, MibPtr, VarBind );
00624          break;
00625
00626       default:
00627    ErrStat = SNMP_ERRORSTATUS_GENERR;
00628    goto Exit;
00629       } // switch
00630
00631 Exit:
00632    return ErrStat;
00633 } // MIB_toasttype_func
00634
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/Server.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

Server.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.CPP
00003
00004   Summary:   Implementation file for the CServer server-related utility
00005              C++ object.  This object encapsulates the server's internal
00006              control of global server object and lock counts.
00007
00008              For a comprehensive tutorial code tour of this module's
00009              contents and offerings see the tutorial LOCSERVE.HTM file.
00010              For more specific technical details on the internal workings
00011              see the comments dispersed throughout the module's source code.
00012
00013   Classes:   CServer.
00014
00015   Functions: .
00016
00017   Origin:    1/29/98: atrent - Editor-inheritance from DLLSERVE.CPP in
00018                the DLLSERVE Tutorial Code Sample [Revised].
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 /*---------------------------------------------------------------------------
00036   We include WINDOWS.H for all Win32 applications.
00037   We include OLE2.H because we will be calling the COM/OLE Libraries.
00038   We include APPUTIL.H because we will be building this EXE using
00039     the convenient Virtual Window and Dialog classes and other
00040     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00041   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00042     class, GUID, and CLSID specifications.
00043   We include SERVER.H for the object class declarations for the
00044     C++ CServer server control object.
00045   We include FACTORY.H because it has the necessary internal class factory
00046     declarations for this component server.
00047 ---------------------------------------------------------------------------*/
00048 #include <windows.h>
00049 #include <ole2.h>
00050 #include <apputil.h>
00051 #include <micars.h>
00052 #include <carguids.h>
00053 #include "server.h"
00054 #include "factory.h"
00055
00056
00057 /*---------------------------------------------------------------------------
00058   Implementation the internal CServer C++ object.  Used to encapsulate
00059   some server data and the methods for Lock and Object count incrementing
00060   and decrementing.
00061 ---------------------------------------------------------------------------*/
00062
00063 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00064   Method:   CServer::CServer
00065
00066   Summary:  CServer Constructor.
00067
00068   Args:     void
00069
00070   Returns:  void
00071 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00072 CServer::CServer(void)
00073 {
00074   // Zero the Object and Lock counts.
00075   m_cObjects = 0;
00076   m_cLocks = 0;
00077
00078   // Zero the cached handles.
00079   m_hInstServer = NULL;
00080   m_hWndServer = NULL;
00081
00082   // Zero the Factory references.
00083   m_pCFCar = NULL;
00084   m_pCFUtilityCar = NULL;
00085   m_pCFCruiseCar = NULL;
00086   m_dwCFCar = 0;
00087   m_dwCFUtilityCar = 0;
00088   m_dwCFCruiseCar = 0;
00089
00090   return;
00091 }
00092
00093
00094 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00095   Method:   CServer::~CServer
00096
00097   Summary:  CServer Destructor.
00098
00099   Args:     void
00100
00101   Returns:  void
00102 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00103 CServer::~CServer(void)
00104 {
00105   return;
00106 }
00107
00108
00109 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00110   Method:   CServer::ObjectsUp
00111
00112   Summary:  Increment the Server's living Object count.
00113
00114   Args:     void
00115
00116   Modifies: m_cObjects.
00117
00118   Returns:  void
00119 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00120 void CServer::ObjectsUp(void)
00121 {
00122   InterlockedIncrement((PLONG) &m_cObjects);
00123
00124   LOGF1("L: CServer::ObjectsUp. New cObjects=%i.", m_cObjects);
00125
00126   return;
00127 }
00128
00129
00130 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00131   Method:   CServer::ObjectsDown
00132
00133   Summary:  Decrement the Server's living object count.
00134
00135   Args:     void
00136
00137   Modifies: m_cObjects.
00138
00139   Returns:  void
00140 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00141 void CServer::ObjectsDown(void)
00142 {
00143   InterlockedDecrement((PLONG) &m_cObjects);
00144
00145   LOGF1("L: CServer::ObjectsDown. New cObjects=%i.", m_cObjects);
00146
00147   // If no more living objects and no locks then shut the server down.
00148   if (0L == m_cObjects && 0L == m_cLocks && IsWindow(m_hWndServer))
00149   {
00150     LOG("L: CServer::ObjectsDown. Closing down LOCSERVE server.");
00151     // Post a message to this local server's message queue requesting
00152     // a close of the application.
00153     PostMessage(m_hWndServer, WM_CLOSE, 0, 0L);
00154   }
00155
00156   return;
00157 }
00158
00159
00160 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00161   Method:   CServer::Lock
00162
00163   Summary:  Increment the Server's Lock count.
00164
00165   Args:     void
00166
00167   Modifies: m_cLocks.
00168
00169   Returns:  void
00170 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00171 void CServer::Lock(void)
00172 {
00173   InterlockedIncrement((PLONG) &m_cLocks);
00174
00175   LOGF1("L: CServer::Lock. New cLocks=%i.", m_cLocks);
00176
00177   return;
00178 }
00179
00180
00181 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00182   Method:   CServer::Unlock
00183
00184   Summary:  Decrement the Server's Lock count.
00185
00186   Args:     void
00187
00188   Modifies: m_cLocks.
00189
00190   Returns:  void
00191 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00192 void CServer::Unlock(void)
00193 {
00194   InterlockedDecrement((PLONG) &m_cLocks);
00195
00196   LOGF1("L: CServer::Unlock. New cLocks=%i.", m_cLocks);
00197
00198   // Use ObjectsDown to force a server shutdown if this unlock warrants it.
00199   InterlockedIncrement((PLONG) &m_cObjects);
00200   ObjectsDown();
00201
00202   return;
00203 }
00204
00205
00206 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00207   Method:   CServer::OpenFactories
00208
00209   Summary:  Create and register all of this server's class factories.
00210
00211   Args:     void
00212
00213   Modifies: m_pCFCar, m_pCFUtilityCar, m_pCFCruiseCar,
00214             m_dwCFCar, m_dwCFUtilityCar, m_dwCFCruiseCar.
00215
00216   Returns:  BOOL
00217               TRUE if success; FALSE if not
00218 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00219 BOOL CServer::OpenFactories(void)
00220 {
00221   BOOL bOk = FALSE;
00222   HRESULT hr;
00223
00224   LOG("L: CServer::OpenFactories. Begin.");
00225
00226   // Build and register the LocCar factory.
00227   m_pCFCar = new CFCar(NULL, this);
00228   if (NULL != m_pCFCar)
00229   {
00230     // AddRef this cached pointer to the Class Factory.
00231     m_pCFCar->AddRef();
00232
00233     // Now register this class factory with COM.
00234     hr = CoRegisterClassObject(
00235            CLSID_LocCar,
00236            m_pCFCar,
00237            CLSCTX_LOCAL_SERVER,
00238            REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED,
00239            &m_dwCFCar);
00240
00241     bOk = SUCCEEDED(hr);
00242     if (!bOk)
00243     {
00244       LOGF1("L: CServer::OpenFactories. CFCar failed. hr=0x%X.", hr);
00245       // If can't register factory then clean up for server exit.
00246       RELEASE_INTERFACE(m_pCFCar);
00247     }
00248   }
00249   else
00250     bOk = FALSE;
00251
00252   // Build and register the LocUtilityCar factory.
00253   if (bOk)
00254   {
00255     m_pCFUtilityCar = new CFUtilityCar(NULL, this);
00256     if (NULL != m_pCFUtilityCar)
00257     {
00258       // AddRef this cached pointer to the Class Factory.
00259       m_pCFUtilityCar->AddRef();
00260
00261       // Now register this class factory with COM.
00262       hr = CoRegisterClassObject(
00263              CLSID_LocUtilityCar,
00264              m_pCFUtilityCar,
00265              CLSCTX_LOCAL_SERVER,
00266              REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED,
00267              &m_dwCFUtilityCar);
00268
00269       bOk = SUCCEEDED(hr);
00270       if (!bOk)
00271       {
00272         LOGF1("L: CServer::OpenFactories. CFUtilityCar failed. hr=0x%X.", hr);
00273         // If can't register factory then clean up for server exit.
00274         RELEASE_INTERFACE(m_pCFUtilityCar);
00275       }
00276     }
00277     else
00278       bOk = FALSE;
00279   }
00280
00281   // Build and register the LocCruiseCar factory.
00282   if (bOk)
00283   {
00284     m_pCFCruiseCar = new CFCruiseCar(NULL, this);
00285     if (NULL != m_pCFCruiseCar)
00286     {
00287       // AddRef this cached pointer to the Class Factory.
00288       m_pCFCruiseCar->AddRef();
00289
00290       // Now register this class factory with COM.
00291       hr = CoRegisterClassObject(
00292              CLSID_LocCruiseCar,
00293              m_pCFCruiseCar,
00294              CLSCTX_LOCAL_SERVER,
00295              REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED,
00296              &m_dwCFCruiseCar);
00297
00298       bOk = SUCCEEDED(hr);
00299       if (!bOk)
00300       {
00301         LOGF1("L: CServer::OpenFactories. CFCruiseCar failed. hr=0x%X.", hr);
00302         // If can't register factory then clean up for server exit.
00303         RELEASE_INTERFACE(m_pCFCruiseCar);
00304       }
00305     }
00306     else
00307       bOk = FALSE;
00308   }
00309
00310   if (bOk)
00311   {
00312     // Now that all the factories exist, open their doors by telling COM
00313     // it can now use the factories registered for this process.
00314     CoResumeClassObjects();
00315     // Tell COM to AddRef the internal lock count for this process so
00316     // the count can later be used to prevent any object requests
00317     // during shutdown in CloseFactories.
00318     hr = CoAddRefServerProcess();
00319     bOk = SUCCEEDED(hr);
00320   }
00321
00322   LOG("L: CServer::OpenFactories. End.");
00323
00324   return bOk;
00325 }
00326
00327
00328 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00329   Method:   CServer::CloseFactories
00330
00331   Summary:  Revoke (ie, unregister) and delete all the server's class
00332             factories.
00333
00334   Args:     void
00335
00336   Modifies: m_pCFCar, m_pCFUtilityCar, m_pCFCruiseCar.
00337
00338   Returns:  BOOL
00339               TRUE if success; FALSE if not
00340 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00341 BOOL CServer::CloseFactories(void)
00342 {
00343   BOOL bOk = TRUE;
00344   HRESULT hr;
00345
00346   LOG("L: CServer::CloseFactories. Begin.");
00347
00348   // Tell COM to release the last lock on the server process.
00349   // This essentially prevents COM from honoring any new requests for
00350   // objects during this inevitable shutdown.
00351   CoReleaseServerProcess();
00352
00353   // Unregister the LocCar class factory with COM.
00354   if (0 != m_dwCFCar)
00355   {
00356     LOG("L: CServer::CloseFactories. Revoke CFCar.");
00357     hr = CoRevokeClassObject(m_dwCFCar);
00358     if (FAILED(hr))
00359       bOk = FALSE;
00360   }
00361
00362   // Unregister the LocUtilityCar class factory with COM.
00363   if (0 != m_dwCFCar)
00364   {
00365     LOG("L: CServer::CloseFactories. Revoke CFUtilityCar.");
00366     hr = CoRevokeClassObject(m_dwCFUtilityCar);
00367     if (FAILED(hr))
00368       bOk = FALSE;
00369   }
00370
00371   // Unregister the LocCruiseCar class factory with COM.
00372   if (0 != m_dwCFCar)
00373   {
00374     LOG("L: CServer::CloseFactories. Revoke CFCruiseCar.");
00375     hr = CoRevokeClassObject(m_dwCFCruiseCar);
00376     if (FAILED(hr))
00377       bOk = FALSE;
00378   }
00379
00380   // Release any and all of the Class Factory interface pointers.
00381   // This causes each factory to delete itself.
00382   LOG("L: CServer::CloseFactories. Release all factory interfaces.");
00383   RELEASE_INTERFACE(m_pCFCar);
00384   RELEASE_INTERFACE(m_pCFUtilityCar);
00385   RELEASE_INTERFACE(m_pCFCruiseCar);
00386
00387   LOG("L: CServer::CloseFactories. End.");
00388
00389   return bOk;
00390 }
00391
00392 // =============================== END ======================================
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/comp.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 CComponent::CComponent(CComponentData *parent)
00029 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL), m_ipConsole2(NULL),
00030 m_bTaskpadView(FALSE), m_bIsTaskpadPreferred(FALSE)
00031 {
00032     OBJECT_CREATED
00033 }
00034
00035 CComponent::~CComponent()
00036 {
00037     OBJECT_DESTROYED
00038 }
00039
00040 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00041 {
00042     if (!ppv)
00043         return E_FAIL;
00044
00045     *ppv = NULL;
00046
00047     if (IsEqualIID(riid, IID_IUnknown))
00048         *ppv = static_cast<IComponent *>(this);
00049     else if (IsEqualIID(riid, IID_IComponent))
00050         *ppv = static_cast<IComponent *>(this);
00051     else if (IsEqualIID(riid, IID_IExtendTaskPad))
00052         *ppv = static_cast<IExtendTaskPad *>(this);
00053
00054     if (*ppv)
00055     {
00056         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00057         return S_OK;
00058     }
00059
00060     return E_NOINTERFACE;
00061 }
00062
00063 STDMETHODIMP_(ULONG) CComponent::AddRef()
00064 {
00065     return InterlockedIncrement((LONG *)&m_cref);
00066 }
00067
00068 STDMETHODIMP_(ULONG) CComponent::Release()
00069 {
00070     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00071     {
00072         delete this;
00073         return 0;
00074     }
00075     return m_cref;
00076
00077 }
00078
00079 ///////////////////////////////
00080 // Interface IComponent
00081 ///////////////////////////////
00082 STDMETHODIMP CComponent::Initialize(
00083                                     /* [in] */ LPCONSOLE lpConsole)
00084 {
00085     HRESULT hr = S_OK;
00086
00087     // Save away all the interfaces we'll need.
00088     // Fail if we can't QI the required interfaces.
00089
00090     m_ipConsole = lpConsole;
00091     m_ipConsole->AddRef();
00092
00093     hr = m_ipConsole->QueryInterface(IID_IConsole2,
00094         reinterpret_cast<void**>(&m_ipConsole2));
00095
00096     _ASSERT( NULL != m_ipConsole2 );
00097
00098     hr = m_ipConsole2->IsTaskpadViewPreferred();
00099     m_bIsTaskpadPreferred = (hr == S_OK) ? TRUE : FALSE;
00100
00101     return hr;
00102 }
00103
00104 STDMETHODIMP CComponent::Notify(
00105                                 /* [in] */ LPDATAOBJECT lpDataObject,
00106                                 /* [in] */ MMC_NOTIFY_TYPE event,
00107                                 /* [in] */ LPARAM arg,
00108                                 /* [in] */ LPARAM param)
00109 {
00110     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00111
00112     HRESULT hr = S_FALSE;
00113
00114   //Get our data object. If it is NULL, we return with S_FALSE.
00115   //See implementation of GetOurDataObject() to see how to
00116   //handle special data objects.
00117   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00118   if (NULL == pDataObject)
00119     return S_FALSE;
00120
00121   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00122
00123     switch (event)
00124   {
00125     case MMCN_SHOW:
00126         hr = base->OnShow(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00127         break;
00128
00129     case MMCN_ADD_IMAGES:
00130         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00131         break;
00132
00133     case MMCN_SELECT:
00134         hr = base->OnSelect(m_ipConsole, (BOOL)LOWORD(arg), (BOOL)HIWORD(arg));
00135         break;
00136
00137     case MMCN_RENAME:
00138         hr = base->OnRename((LPOLESTR)param);
00139         break;
00140
00141     case MMCN_LISTPAD:
00142         hr = base->OnListpad(m_ipConsole, (BOOL)arg);
00143         break;
00144     }
00145
00146     return hr;
00147 }
00148
00149 STDMETHODIMP CComponent::Destroy(
00150                                  /* [in] */ MMC_COOKIE cookie)
00151 {
00152     if (m_ipConsole) {
00153         m_ipConsole->Release();
00154         m_ipConsole = NULL;
00155     }
00156
00157     return S_OK;
00158 }
00159
00160
00161 STDMETHODIMP CComponent::QueryDataObject(
00162                                          /* [in] */ MMC_COOKIE cookie,
00163                                          /* [in] */ DATA_OBJECT_TYPES type,
00164                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00165 {
00166     CDataObject *pObj = NULL;
00167
00168     if (cookie == 0)
00169         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00170     else
00171         pObj = new CDataObject(cookie, type);
00172
00173     if (!pObj)
00174         return E_OUTOFMEMORY;
00175
00176     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00177
00178     return S_OK;
00179 }
00180
00181 STDMETHODIMP CComponent::GetResultViewType(
00182                                            /* [in] */ MMC_COOKIE cookie,
00183                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00184                                            /* [out] */ long __RPC_FAR *pViewOptions)
00185 {
00186     CDelegationBase *base = (CDelegationBase *)cookie;
00187
00188     //
00189     // Ask for default listview.
00190     //
00191     if (base == NULL)
00192     {
00193         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00194         *ppViewType = NULL;
00195     }
00196     else
00197         return base->GetResultViewType(ppViewType, pViewOptions);
00198
00199     return S_OK;
00200 }
00201
00202 STDMETHODIMP CComponent::GetDisplayInfo(
00203                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00204 {
00205     HRESULT hr = S_OK;
00206     CDelegationBase *base = NULL;
00207
00208     // if they are asking for the RDI_STR we have one of those to give
00209
00210     if (pResultDataItem->lParam) {
00211         base = (CDelegationBase *)pResultDataItem->lParam;
00212         if (pResultDataItem->mask & RDI_STR) {
00213                         LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00214                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00215             pResultDataItem->str = pszW;
00216         }
00217
00218         if (pResultDataItem->mask & RDI_IMAGE) {
00219             pResultDataItem->nImage = base->GetBitmapIndex();
00220         }
00221     }
00222
00223     return hr;
00224 }
00225
00226
00227 STDMETHODIMP CComponent::CompareObjects(
00228                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00229                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00230 {
00231     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00232     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00233
00234     // compare the object pointers
00235     if (baseA->GetCookie() == baseB->GetCookie())
00236         return S_OK;
00237
00238     return S_FALSE;
00239 }
00240
00241 ///////////////////////////////
00242 // Interface IComponent
00243 ///////////////////////////////
00244 HRESULT CComponent::TaskNotify(
00245                                /* [in] */ IDataObject __RPC_FAR *pdo,
00246                                /* [in] */ VARIANT __RPC_FAR *arg,
00247                                /* [in] */ VARIANT __RPC_FAR *param)
00248 {
00249     CDelegationBase *base = GetOurDataObject(pdo)->GetBaseNodeObject();
00250
00251     return base->TaskNotify(m_ipConsole, arg, param);
00252 }
00253
00254 HRESULT CComponent::EnumTasks(
00255                               /* [in] */ IDataObject __RPC_FAR *pdo,
00256                               /* [string][in] */ LPOLESTR szTaskGroup,
00257                               /* [out] */ IEnumTASK __RPC_FAR *__RPC_FAR *ppEnumTASK)
00258 {
00259     CDelegationBase *base = GetOurDataObject(pdo)->GetBaseNodeObject();
00260
00261     // GetTaskList will allocate the entire task structure, it's
00262     // up to the enumerator to free the list when destroyed
00263     LONG nCount;
00264     MMC_TASK *tasks = base->GetTaskList(szTaskGroup, &nCount);
00265
00266     if (tasks != NULL) {
00267         CEnumTASK *pTask = new CEnumTASK(tasks, nCount);
00268
00269         if (pTask) {
00270             reinterpret_cast<IUnknown *>(pTask)->AddRef();
00271             HRESULT hr = pTask->QueryInterface (IID_IEnumTASK, (void **)ppEnumTASK);
00272             reinterpret_cast<IUnknown *>(pTask)->Release();
00273
00274             return hr;
00275         }
00276     }
00277
00278     return S_OK;
00279 }
00280
00281
00282 HRESULT CComponent::GetTitle(
00283                              /* [string][in] */ LPOLESTR pszGroup,
00284                              /* [string][out] */ LPOLESTR __RPC_FAR *pszTitle)
00285 {
00286     CDelegationBase *base = (CDelegationBase *)wcstoul(pszGroup, NULL, 16);
00287
00288     if (NULL == base)
00289             return S_FALSE;
00290
00291     return base->GetTaskpadTitle(pszTitle);
00292 }
00293
00294 HRESULT CComponent::GetDescriptiveText(
00295                                        /* [string][in] */ LPOLESTR pszGroup,
00296                                        /* [string][out] */ LPOLESTR __RPC_FAR *pszDescriptiveText)
00297 {
00298         CDelegationBase *base = (CDelegationBase *)wcstoul(pszGroup, NULL, 16);
00299
00300         if (NULL == base)
00301                 return S_FALSE;
00302
00303     return base->GetTaskpadDescription(pszDescriptiveText);
00304 }
00305
00306 HRESULT CComponent::GetBackground(
00307                                   /* [string][in] */ LPOLESTR pszGroup,
00308                                   /* [out] */ MMC_TASK_DISPLAY_OBJECT __RPC_FAR *pTDO)
00309 {
00310         CDelegationBase *base = (CDelegationBase *)wcstoul(pszGroup, NULL, 16);
00311
00312         if (NULL == base)
00313                 return S_FALSE;
00314
00315     return base->GetTaskpadBackground(pTDO);
00316 }
00317
00318 HRESULT CComponent::GetListPadInfo(
00319                                    /* [string][in] */ LPOLESTR pszGroup,
00320                                    /* [out] */ MMC_LISTPAD_INFO __RPC_FAR *lpListPadInfo)
00321 {
00322         CDelegationBase *base = (CDelegationBase *)wcstoul(pszGroup, NULL, 16);
00323
00324         if (NULL == base)
00325                 return S_FALSE;
00326
00327     return base->GetListpadInfo(lpListPadInfo);
00328 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Resource_Dispenser/LDisp.h Source File

  • Com
  • Services
  • Resource_Dispenser

LDisp.h

Go to the documentation of this file.
00001
00002 // LDisp.h : Declaration of the CLDisp
00003
00004 #ifndef __LDISP_H_
00005 #define __LDISP_H_
00006
00007 #include "resource.h"       // main symbols
00008 #include <mtxdm.h>
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CLDisp
00012 class ATL_NO_VTABLE CLDisp :
00013   public IDispenserDriver,
00014   public CComObjectRootEx<CComMultiThreadModel>,  //Should be multi-threaded.
00015   public CComCoClass<CLDisp, &CLSID_LDisp>,
00016   public ILDisp
00017 {
00018 private:
00019   IHolder * m_pHolder;
00020   IDispenserManager* m_pDispMan;
00021   CComAutoCriticalSection m_cs;
00022
00023
00024
00025
00026 public:
00027     DECLARE_PROTECT_FINAL_CONSTRUCT();
00028       DECLARE_CLASSFACTORY_SINGLETON(CLDisp);
00029
00030   CLDisp()
00031   {
00032     m_pUnkMarshaler = NULL;
00033   }
00034
00035 DECLARE_REGISTRY_RESOURCEID(IDR_LDISP)
00036 DECLARE_GET_CONTROLLING_UNKNOWN()
00037
00038 BEGIN_COM_MAP(CLDisp)
00039   COM_INTERFACE_ENTRY(ILDisp)
00040   COM_INTERFACE_ENTRY(IDispenserDriver)
00041   COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
00042 END_COM_MAP()
00043
00044   HRESULT FinalConstruct()
00045   {
00046     //Get a pointer to the dispenser manager, and register
00047     //this dispenser with it.
00048     HRESULT hr;
00049     hr = GetDispenserManager(&m_pDispMan);
00050     IDispenserDriver * pDriver;
00051     hr = GetUnknown()->QueryInterface(IID_IDispenserDriver, (void **)&pDriver);
00052     hr = m_pDispMan->RegisterDispenser(pDriver,L"LDispenser", &m_pHolder);
00053
00054     //aggregate the free threaded marshaler.
00055     return CoCreateFreeThreadedMarshaler(
00056       GetControllingUnknown(), &m_pUnkMarshaler.p);
00057   }
00058
00059   void FinalRelease()
00060   {
00061     //de-aggregate the free threaded marshaller
00062     m_pUnkMarshaler.Release();
00063   }
00064
00065   CComPtr<IUnknown> m_pUnkMarshaler;
00066
00067 // ILDisp
00068 public:
00069   STDMETHOD(DeAlloc)(/*[in]*/long JAustin);
00070   STDMETHOD(Alloc)(/*[in,out]*/ long * pJAustin);
00071
00072 //IDispenserDriver
00073 public:
00074   STDMETHOD(CreateResource)(const RESTYPID ResTypId,
00075                   RESID * pResId,
00076                   TIMEINSECS* SecsFreeBeforeDestroy);
00077   STDMETHOD(RateResource)(const RESTYPID ResTypId,
00078               const RESID ResId,
00079                 const BOOL fRequiresTransactionEnlistment,
00080                 RESOURCERATING* pRating);
00081   STDMETHOD(EnlistResource)(const RESID ResId, const TRANSID TransId);
00082   STDMETHOD(ResetResource)(const RESID ResId);
00083   STDMETHOD(DestroyResource)(const RESID ResId);
00084   STDMETHOD(DestroyResourceS)(constSRESID ResId);
00085 };
00086
00087 #endif //__LDISP_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_DATA_BUFFER Member List

This is the complete list of members for _DATA_BUFFER, including all inherited members.
buf | _DATA_BUFFER
dataSize | _DATA_BUFFER
isNewData | _DATA_BUFFER
sendOffset | _DATA_BUFFER
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Cursor/Cursor.c Source File

  • WinUI
  • Cursor

Cursor.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \******************************************************************************/
00010
00011 /****************************************************************************
00012
00013     PROGRAM: Cursor.c
00014
00015     PURPOSE: Demonstrates how to manipulate a cursor and select a region
00016
00017     FUNCTIONS:
00018
00019         WinMain() - calls initialization function, processes message loop
00020         InitApplication() - initializes window data and registers window
00021         InitInstance() - saves instance handle and creates main window
00022         MainWndProc() - processes messages
00023         About() - processes messages for "About" dialog box
00024         sieve() - time consuming function, generates primes
00025
00026 ****************************************************************************/
00027 #include <windows.h>
00028 #include <string.h>
00029 #include <tchar.h>
00030 #include <stdio.h>
00031 #include "cursor.h"
00032
00033 HANDLE hInst;
00034 TCHAR str[255] = {0};                       /* general-purpose string buffer */
00035
00036 HCURSOR hSaveCursor = NULL;                 /* handle to current cursor      */
00037 HCURSOR hHourGlass = NULL;                  /* handle to hourglass cursor    */
00038
00039 BOOL bTrack = FALSE;                        /* TRUE if left button clicked   */
00040 INT OrgX = 0, OrgY = 0;                     /* original cursor position      */
00041 INT PrevX = 0, PrevY = 0;                   /* current cursor position       */
00042 INT X = 0, Y = 0;                           /* last cursor position          */
00043 RECT Rect;                                  /* selection rectangle           */
00044
00045 MPOINT ptCursor;                            /* x and y coordinates of cursor */
00046 INT repeat = 1;                             /* repeat count of keystroke     */
00047
00048 /****************************************************************************
00049
00050     FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
00051
00052     PURPOSE: calls initialization function, processes message loop
00053
00054 ****************************************************************************/
00055 int WINAPI WinMain (
00056        HINSTANCE hInstance,
00057        HINSTANCE hPrevInstance,
00058        LPSTR lpCmdLine,
00059        int nCmdShow )
00060 {
00061     MSG msg;                                 /* message                      */
00062     BOOL bRet = FALSE;                     /* TRUE if getmessage failed    */
00063
00064     if (!InitApplication(hInstance))
00065     {
00066         return FALSE;
00067     }
00068
00069     if (!InitInstance(hInstance, nCmdShow))
00070     {
00071         return FALSE;
00072     }
00073
00074     MessageBox ( GetFocus (),
00075                  TEXT("Use the mouse button in this program for an example of graphics ")
00076                  TEXT("selection, or the <Enter> key for an example of ")
00077                  TEXT("using a special cursor to reflect a program state."),
00078                  TEXT("Cursor Sample Application"),
00079                  MB_ICONASTERISK | MB_OK );
00080
00081     while ((bRet = GetMessage(&msg, NULL, 0, 0)) !=0)
00082     {
00083         if (bRet == -1)
00084         {
00085             // Possibly handle the error
00086             return FALSE;
00087         }
00088         else
00089         {
00090             TranslateMessage (&msg);
00091             DispatchMessage (&msg);
00092         }
00093     }
00094
00095         return (int) msg.wParam;
00096 }
00097
00098 /****************************************************************************
00099
00100     FUNCTION: InitApplication(HANDLE)
00101
00102     PURPOSE: Initializes window data and registers window class
00103
00104 ****************************************************************************/
00105 BOOL InitApplication (
00106     HANDLE hInstance)
00107 {
00108     WNDCLASS wc = {0};
00109
00110     wc.lpfnWndProc = (WNDPROC) MainWndProc;
00111     wc.hInstance = hInstance;
00112     wc.hIcon = LoadIcon( NULL, IDI_APPLICATION);
00113     wc.hCursor = LoadCursor (hInstance, TEXT("bullseye"));
00114     wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
00115     wc.lpszMenuName =  TEXT("CursorMenu");
00116     wc.lpszClassName = TEXT("CursorWClass");
00117
00118     return (RegisterClass(&wc));
00119 }
00120
00121 /****************************************************************************
00122
00123     FUNCTION:  InitInstance(HANDLE, int)
00124
00125     PURPOSE:  Saves instance handle and creates main window
00126
00127 ****************************************************************************/
00128 BOOL InitInstance(
00129     HANDLE hInstance,
00130     INT nCmdShow)
00131 {
00132     BOOL bSuccess = FALSE;
00133     HWND hWnd = NULL;
00134
00135     hInst = hInstance;
00136
00137     hHourGlass = LoadCursor(NULL, IDC_WAIT);
00138
00139     hWnd = CreateWindow (
00140         TEXT ("CursorWClass"),
00141         TEXT ("Cursor Sample Application"),
00142         WS_OVERLAPPEDWINDOW,
00143         CW_USEDEFAULT, 0,
00144         CW_USEDEFAULT, 0,
00145         NULL, NULL, hInstance, NULL);
00146
00147     if (hWnd)
00148     {
00149         ShowWindow (hWnd, nCmdShow);
00150         bSuccess = UpdateWindow(hWnd);
00151     }
00152
00153     return bSuccess;
00154 }
00155
00156 /****************************************************************************
00157
00158     FUNCTION: MainWndProc(HWND, unsigned, WPARAM, LPARAM)
00159
00160     PURPOSE:  Processes messages
00161
00162     MESSAGES:
00163
00164         WM_COMMAND     - application menu (About dialog box)
00165         WM_CHAR        - ASCII key value received
00166         WM_LBUTTONDOWN - left mouse button
00167         WM_MOUSEMOVE   - mouse movement
00168         WM_LBUTTONUP   - left button released
00169         WM_KEYDOWN     - key pressed
00170         WM_KEYUPS      - key released
00171         WM_PAINT       - update window
00172         WM_DESTROY     - destroy window
00173
00174     COMMENTS:
00175
00176         When the left mouse button is pressed, btrack is set to TRUE so that
00177         the code for WM_MOUSEMOVE will keep track of the mouse and update
00178         the box accordingly.  Once the button is released, btrack is set to
00179         FALSE, and the current position is saved.  Holding the SHIFT key
00180         while pressing the left button will extend the current box rather
00181         then erasing it and starting a new one.
00182
00183         When an arrow key is pressed, the cursor is repositioned in the
00184         direction of the arrow key.  A repeat count is kept so that the
00185         longer the user holds down the arrow key, the faster it will move.
00186         As soon as the key is released, the repeat count is set to 1 for
00187         normal cursor movement.
00188
00189 ****************************************************************************/
00190 LRESULT CALLBACK MainWndProc(
00191     HWND hWnd,
00192     UINT message,
00193     WPARAM wParam,
00194     LPARAM lParam)
00195 {
00196     POINT pt = {0};
00197     HDC hDC = NULL;
00198     BOOL bRetDWP = FALSE; // return DefWindowProc(...)
00199
00200     switch (message)
00201     {
00202         case WM_COMMAND:
00203             // LOWORD added for portability
00204             if (LOWORD(wParam) == IDM_ABOUT)
00205             {
00206                 DialogBox(hInst,
00207                           TEXT("AboutBox"),
00208                           hWnd,
00209                           (DLGPROC)About);
00210                 break;
00211             }
00212             else
00213             {
00214                 bRetDWP = TRUE;
00215                 goto exit_func;
00216                 break;
00217             }
00218
00219         case WM_CHAR:
00220             if (wParam == '\r')
00221             {
00222                 SetCapture(hWnd);
00223
00224                 /* Set the cursor to an hourglass */
00225
00226                 hSaveCursor = SetCursor(hHourGlass);
00227
00228                 // OK now we perform a task that may take a while... We compute Primes
00229                 _tcsncpy (str, TEXT("Calculating prime numbers..."), sizeof(str)/sizeof(str)-1);
00230                 InvalidateRect (hWnd, NULL, TRUE);
00231                 UpdateWindow (hWnd);
00232                 _sntprintf (str, sizeof(str)/sizeof(str)-1, TEXT("Calculated %d primes.       "), sieve());
00233                 InvalidateRect (hWnd, NULL, TRUE);
00234                 UpdateWindow (hWnd);
00235
00236                 SetCursor(hSaveCursor);          /* Restores previous cursor */
00237                 ReleaseCapture();
00238             }
00239             break;
00240
00241         case WM_LBUTTONDOWN:
00242             bTrack = TRUE;
00243             _tcsncpy (str,TEXT(""),sizeof(str)/sizeof(str)-1 );
00244             PrevX = LOWORD(lParam);
00245             PrevY = HIWORD(lParam);
00246             if (!(wParam & MK_SHIFT))
00247             {       /* If shift key is not pressed */
00248                 OrgX = LOWORD(lParam);
00249                 OrgY = HIWORD(lParam);
00250             }
00251             InvalidateRect (hWnd, NULL, TRUE);
00252             UpdateWindow (hWnd);
00253
00254             /* Capture all input even if the mouse goes outside of window */
00255
00256             SetCapture(hWnd);
00257             break;
00258
00259         case WM_MOUSEMOVE:
00260             {
00261                 RECT rectClient = {0};
00262                 INT  NextX = 0;
00263                 INT  NextY = 0;
00264
00265                 if (bTrack)
00266                 {
00267                     NextX = (SHORT)LOWORD(lParam);
00268                     NextY = (SHORT)HIWORD(lParam);
00269
00270                     /* Do not draw outside the window's client area */
00271
00272                     GetClientRect (hWnd, &rectClient);
00273                     if (NextX < rectClient.left)
00274                     {
00275                         NextX = rectClient.left;
00276                     }
00277                     else if (NextX >= rectClient.right)
00278                     {
00279                         NextX = rectClient.right - 1;
00280                     }
00281                     if (NextY < rectClient.top)
00282                     {
00283                         NextY = rectClient.top;
00284                     }
00285                     else if (NextY >= rectClient.bottom)
00286                     {
00287                         NextY = rectClient.bottom - 1;
00288                     }
00289
00290                     /* If the mouse position has changed, then clear the */
00291                     /* previous rectangle and draw the new one.          */
00292
00293                     if ((NextX != PrevX) || (NextY != PrevY))
00294                     {
00295                         hDC = GetDC(hWnd);
00296                         SetROP2(hDC, R2_NOT);          /* Erases the previous box */
00297                         MoveToEx(hDC, OrgX, OrgY, NULL);
00298                         LineTo(hDC, OrgX, PrevY);
00299                         LineTo(hDC, PrevX, PrevY);
00300                         LineTo(hDC, PrevX, OrgY);
00301                         LineTo(hDC, OrgX, OrgY);
00302
00303                         /* Get the current mouse position */
00304
00305                         PrevX = NextX;
00306                         PrevY = NextY;
00307                         MoveToEx(hDC, OrgX, OrgY, NULL); /* Draws the new box */
00308                         LineTo(hDC, OrgX, PrevY);
00309                         LineTo(hDC, PrevX, PrevY);
00310                         LineTo(hDC, PrevX, OrgY);
00311                         LineTo(hDC, OrgX, OrgY);
00312                         ReleaseDC(hWnd, hDC);
00313                     }
00314                 }
00315             }
00316             break;
00317
00318         case WM_LBUTTONUP:
00319             bTrack = FALSE;                 /* No longer creating a selection */
00320             ReleaseCapture();               /* Releases hold on mouse input */
00321
00322             X = LOWORD(lParam);             /* Saves the current value      */
00323             Y = HIWORD(lParam);
00324             break;
00325
00326         case WM_KEYDOWN:
00327             if (wParam != VK_LEFT && wParam != VK_RIGHT
00328                 && wParam != VK_UP && wParam != VK_DOWN)
00329                 break;
00330
00331             MPOINT2POINT(ptCursor, pt);
00332             GetCursorPos(&pt);
00333
00334             /* Convert screen coordinates to client coordinates */
00335
00336             ScreenToClient(hWnd, &pt);
00337             POINT2MPOINT(pt, ptCursor);
00338             repeat++;                           /* Increases the repeat rate */
00339
00340             switch (wParam)
00341             {
00342
00343                 /* Adjust cursor position according to which key was pressed. */
00344
00345                 case VK_LEFT:
00346                     ptCursor.x = ptCursor.x - (SHORT) repeat;
00347                     break;
00348
00349                 case VK_RIGHT:
00350                     ptCursor.x = ptCursor.x + (SHORT) repeat;
00351                     break;
00352
00353                 case VK_UP:
00354                     ptCursor.y = ptCursor.y - (SHORT) repeat;
00355                     break;
00356
00357                 case VK_DOWN:
00358                     ptCursor.y = ptCursor.y + (SHORT) repeat;
00359                     break;
00360             }
00361
00362             /* Get the client boundaries */
00363
00364             GetClientRect(hWnd, &Rect);
00365
00366             /* Do not draw outside the window's client area */
00367
00368             MPOINT2POINT(ptCursor, pt);
00369             if (pt.x >= Rect.right)
00370                 pt.x = Rect.right - 1;
00371             else if (pt.x < Rect.left)
00372                 pt.x = Rect.left;
00373             if (pt.y >= Rect.bottom)
00374                 pt.y = Rect.bottom - 1;
00375             else if (pt.y < Rect.top)
00376                 pt.y = Rect.top;
00377
00378             /* Convert the coordinates to screen coordinates */
00379
00380             ClientToScreen(hWnd, &pt);
00381             SetCursorPos(pt.x, pt.y);
00382             break;
00383
00384         case WM_KEYUP:
00385             repeat = 1;                          /* Clears the repeat count. */
00386             break;
00387
00388         case WM_ACTIVATE:
00389             if (!GetSystemMetrics(SM_MOUSEPRESENT))
00390             {
00391                 if (!HIWORD(wParam))
00392                 {
00393                     // LOWORD added for portability
00394                     if (LOWORD(wParam))
00395                     {
00396                         SetCursor(LoadCursor(hInst, TEXT("bullseye")));
00397                         pt.x = X;
00398                         pt.y = Y;
00399                         ClientToScreen(hWnd, &pt);
00400                         SetCursorPos(pt.x, pt.y);
00401                     }
00402                     if (wParam)
00403                     {
00404                         ShowCursor(TRUE);
00405                     }
00406                     else
00407                     {
00408                         ShowCursor(FALSE);
00409                     }
00410                 }
00411             }
00412             break;
00413
00414         case WM_PAINT:
00415             {
00416                 PAINTSTRUCT ps = {0};
00417
00418                 hDC = BeginPaint (hWnd, &ps);
00419                 if (OrgX != PrevX || OrgY != PrevY)
00420                 {
00421                     MoveToEx(hDC, OrgX, OrgY, NULL);
00422                     LineTo(hDC, OrgX, PrevY);
00423                     LineTo(hDC, PrevX, PrevY);
00424                     LineTo(hDC, PrevX, OrgY);
00425                     LineTo(hDC, OrgX, OrgY);
00426                 }
00427                 TextOut (hDC, 1, 1, str, (INT)_tcslen (str)); // http://swiweb
00428                 EndPaint (hWnd, &ps);
00429             }
00430             break;
00431
00432         case WM_DESTROY:
00433             PostQuitMessage(0);
00434             break;
00435
00436         default:
00437             bRetDWP = TRUE;
00438             goto exit_func;
00439             break;
00440     }
00441
00442 exit_func:
00443     if (bRetDWP)
00444     {
00445         return DefWindowProc(hWnd, message, wParam, lParam);
00446     }
00447     else
00448     {
00449         return 0;
00450     }
00451 }
00452
00453
00454 /****************************************************************************
00455
00456     FUNCTION: About(HWND, unsigned, WPARAM, LPARAM)
00457
00458     PURPOSE:  Processes messages for "About" dialog box
00459
00460     MESSAGES:
00461
00462         WM_INITDIALOG - initialize dialog box
00463         WM_COMMAND    - Input received
00464
00465 ****************************************************************************/
00466 INT_PTR CALLBACK About(
00467     HWND hDlg,
00468     UINT message,
00469     WPARAM wParam,
00470     LPARAM lParam)
00471 {
00472     BOOL bProcessedMsg = FALSE;
00473
00474     switch (message)
00475     {
00476         case WM_INITDIALOG:
00477             bProcessedMsg = TRUE;
00478             break;
00479
00480         case WM_COMMAND:
00481             // LOWORD added for portability
00482             if (LOWORD(wParam) == IDOK
00483                 || LOWORD(wParam) == IDCANCEL) {
00484                 EndDialog(hDlg, TRUE);
00485                 bProcessedMsg = TRUE;
00486             }
00487             break;
00488
00489     }
00490
00491     return bProcessedMsg;
00492 }
00493
00494
00495 /****************************************************************************
00496
00497     FUNCTION: Sieve()
00498
00499     PURPOSE:  Example of time consuming process
00500
00501     COMMENTS:
00502
00503         Sieve of Eratosthenes, BYTE, Volume 8, Number 1, by Jim Gilbreath
00504         and Gary Gilbreath.  Code changed to give correct results.
00505
00506         One could return the count, and after restoring the cursor, use
00507         sprintf() to copy the information to a string which could then be
00508         put up in a MessageBox().
00509
00510 ****************************************************************************/
00511 #define NITER   20                                 /* number of iterations */
00512 #define SIZE    81900
00513
00514 CHAR flags [SIZE+1] = {0};
00515
00516 INT sieve ()
00517 {
00518     INT i,k;
00519     INT iter, count = 0;
00520
00521     for (iter = 1; iter <= NITER; iter++)
00522     {      /* Do sieve NITER times */
00523         count = 0;
00524         for (i = 0; i <= SIZE; i++)              /* Sets all flags TRUE    */
00525             flags[i] = TRUE;
00526
00527         for (i = 2; i <= SIZE; i++)
00528         {
00529             if (flags[i] )
00530             {                        /* Found a prime?       */
00531                 for (k = i + i; k <= SIZE; k += i)
00532                     flags[k] = FALSE;              /* Cancels its multiples */
00533                 count++;
00534             }
00535         }
00536     }
00537     return (count);
00538 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Security/VC/VCSecuritySample.Idl Source File

  • Com
  • Services
  • Security
  • VC

VCSecuritySample.Idl

Go to the documentation of this file.
00001 // VCSecuritySample.idl : IDL source for VCSecuritySample.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (VCSecuritySample.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010   [
00011     object,
00012     uuid(8107B4EE-166C-11D1-98C1-00C04FC2C8D5),
00013     dual,
00014     helpstring("IVCSecuritySampleClass Interface"),
00015     pointer_default(unique)
00016   ]
00017   interface IVCSecuritySampleClass : IDispatch
00018   {
00019     [id(1), helpstring("method AmIAnAdministrator")] HRESULT AmIAnAdministrator([out, retval] short*);
00020     [id(2), helpstring("method WhoAmI")] HRESULT WhoAmI([out, retval] BSTR*);
00021   };
00022 [
00023   uuid(8107B4E1-166C-11D1-98C1-00C04FC2C8D5),
00024   version(1.0),
00025   helpstring("VCSecuritySample 1.0 Type Library")
00026 ]
00027 library VCSECURITYSAMPLELib
00028 {
00029   importlib("stdole32.tlb");
00030   importlib("stdole2.tlb");
00031
00032   [
00033     uuid(8107B4EF-166C-11D1-98C1-00C04FC2C8D5),
00034     helpstring("VCSecuritySampleClass Class")
00035   ]
00036   coclass VCSecuritySampleClass
00037   {
00038     [default] interface IVCSecuritySampleClass;
00039   };
00040 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDisplayAttributeInfo Member List

This is the complete list of members for CDisplayAttributeInfo, including all inherited members.
_c_DefaultDisplayAttribute | CDisplayAttributeInfo | [private, static]
GetAttributeInfo(TF_DISPLAYATTRIBUTE *ptfDisplayAttr) | CDisplayAttributeInfo |
GetDescription(BSTR *pbstrDesc) | CDisplayAttributeInfo |
GetGUID(GUID *pguid) | CDisplayAttributeInfo |
QueryInterface(REFIID riid, void **ppvObj) | CDisplayAttributeInfo |
Reset() | CDisplayAttributeInfo |
SetAttributeInfo(const TF_DISPLAYATTRIBUTE *ptfDisplayAttr) | CDisplayAttributeInfo |
STDMETHODIMP_(ULONG) AddRef(void) | CDisplayAttributeInfo | [inline]
STDMETHODIMP_(ULONG) Release(void) | CDisplayAttributeInfo | [inline]
Generated on Wed Nov 13 2024 16:56:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConServe/BALL.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ConServe

BALL.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      BALL.H
00003
00004   Summary:   Include file for the connectable COBall COM object class.
00005
00006              COBall offers a main standard IUnknown interface (basic COM
00007              object features), an implementation of the standard
00008              IConnectionPointContainer interface (connectable object
00009              features), and an implementation of the custom IBall
00010              interface (moving Ball-related features). This multiple
00011              interface COM Object Class is achieved via the technique of
00012              nested classes.  The implementation of the
00013              IConnectionPointContainer and IBall interfaces are nested
00014              inside of the COBall Class.
00015
00016              This file also declares some internal C++ classes (CXForm and
00017              CBallThread) that provide internal support for the custom
00018              IBall interface.
00019
00020              For a comprehensive tutorial code tour of this module's
00021              contents and offerings see the tutorial CONSERVE.HTM file.
00022              For more specific technical details on the internal workings
00023              see the comments dispersed throughout the module's source code.
00024
00025   Functions:
00026
00027   Classes:   CXForm, CBallThread, COBall.
00028
00029   Origin:    5-30-96: atrent - Editor-inheritance from BALL.H in
00030              the FRESERVE Tutorial Code Sample.
00031
00032 ----------------------------------------------------------------------------
00033   This file is part of the Microsoft COM Tutorial Code Samples.
00034
00035   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00036
00037   This source code is intended only as a supplement to Microsoft
00038   Development Tools and/or on-line documentation.  See these other
00039   materials for detailed information regarding Microsoft code samples.
00040
00041   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00042   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00043   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00044   PARTICULAR PURPOSE.
00045 ==========================================================================+*/
00046
00047 #if !defined(BALL_H)
00048 #define BALL_H
00049
00050 #ifdef __cplusplus
00051
00052 enum
00053 {
00054   MAX_BALLTHREADS = 64,
00055   BALL_MOVE_SKEW = 5
00056 };
00057
00058
00059 // Bounce event constants.
00060 enum
00061 {
00062   BOUNCE_NONE = 0,
00063   BOUNCE_BOTTOM,
00064   BOUNCE_LEFT,
00065   BOUNCE_RIGHT,
00066   BOUNCE_TOP
00067 };
00068
00069
00070 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00071   Class:    CXForm
00072
00073   Summary:  A utility class with methods for performing point
00074             transformations on points that represent space/location in two
00075             dimensions.
00076
00077   Methods:  Clear
00078               Clears the transformation matrix.
00079             Scale
00080               Set transformation to multiply by a scale factor.
00081             Trans
00082               Perform transformation.
00083             Point
00084               Get point.
00085             CXForm
00086               Constructor.
00087             ~CXForm
00088               Destructor.
00089 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00090 class CXForm
00091 {
00092   private:
00093     int XForm[3][3];
00094
00095   public:
00096     CXForm(void) {};
00097     ~CXForm(void) {};
00098     void Clear(void);
00099     void Scale(int xScale, int yScale);
00100     void Trans(int xTrans, int yTrans);
00101     void Point(POINT* pPoint);
00102 };
00103
00104
00105 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00106   Class:    CBallThread
00107
00108   Summary:  A class for simple objects used to store properties of threads.
00109             An array of these is used to remember the threads that came
00110             visiting the COBall object.
00111
00112   Methods:  CBallThread
00113               Constructor.
00114             ~CBallThread
00115               Destructor.
00116 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00117 class CBallThread
00118 {
00119   public:
00120     DWORD Id;
00121     COLORREF Color;
00122
00123     CBallThread(void) {};
00124     ~CBallThread(void) {};
00125 };
00126
00127
00128 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00129   ObjectClass: COBall
00130
00131   Summary:     COM object class for COBall COM objects.  COM objects of
00132                this class offer custom IBall interface features, Reset,
00133                Move, and GetBall. To make COBall objects connectable, the
00134                standard IConnectionPointContainer interface features,
00135                FindConnectionPoint and EnumConnectionPoints are
00136                implemented. The mulitple interfaces on this COM object are
00137                constructed via the nested interface classes technique.
00138
00139   Interfaces:  IUnknown
00140                  Standard interface providing COM object features.
00141                IConnectionPointContainer
00142                  Standard Connection Point container features rendering
00143                  COBall objects connectable objects.
00144                IBall
00145                  Custom interface providing basic Ball operation features.
00146
00147   Aggregation: Yes, COBall COM Objects are aggregatable by passing
00148                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00149 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00150 class COBall : public IUnknown, public CThreaded
00151 {
00152   public:
00153     // Main Object Constructor & Destructor.
00154     COBall(IUnknown* pUnkOuter, CServer* pServer);
00155     ~COBall(void);
00156
00157     // A general method for initializing this newly created object.
00158     // Creates any subordinate arrays, structures, or objects.
00159     HRESULT Init(void);
00160
00161     // IUnknown methods. Main object, non-delegating.
00162     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00163     STDMETHODIMP_(ULONG) AddRef(void);
00164     STDMETHODIMP_(ULONG) Release(void);
00165
00166   private:
00167     // We declare nested class interface implementations here.
00168
00169     class CImpIConnectionPointContainer : public IConnectionPointContainer,
00170                                           public CThreaded
00171     {
00172       public:
00173         // Interface Implementation Constructor & Destructor.
00174         CImpIConnectionPointContainer(COBall* pBackObj, IUnknown* pUnkOuter);
00175         ~CImpIConnectionPointContainer(void);
00176
00177         // IUnknown methods.
00178         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00179         STDMETHODIMP_(ULONG) AddRef(void);
00180         STDMETHODIMP_(ULONG) Release(void);
00181
00182         // IConnectionPointContainer methods.
00183         STDMETHODIMP         FindConnectionPoint(REFIID, IConnectionPoint**);
00184         STDMETHODIMP         EnumConnectionPoints(IEnumConnectionPoints**);
00185
00186       private:
00187         // Data private to this interface implementation.
00188         COBall*       m_pBackObj;     // Parent Object back pointer.
00189         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00190     };
00191
00192     class CImpIBall : public IBall, public CThreaded
00193     {
00194       public:
00195         // Interface Implementation Constructor & Destructor.
00196         CImpIBall(COBall* pBackObj, IUnknown* pUnkOuter);
00197         ~CImpIBall(void);
00198
00199         // IUnknown methods.
00200         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00201         STDMETHODIMP_(ULONG) AddRef(void);
00202         STDMETHODIMP_(ULONG) Release(void);
00203
00204         // IBall methods.
00205         STDMETHODIMP         Reset(RECT* pNewRect, short nBallSize);
00206         STDMETHODIMP         GetBall(
00207                                POINT* pNewOrg,
00208                                POINT* pNewExt,
00209                                COLORREF* pcrColor);
00210         STDMETHODIMP         Move(BOOL bAlive);
00211
00212       private:
00213         // Data private to this interface implementation of IBall.
00214         COBall*       m_pBackObj;     // Parent Object back pointer.
00215         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00216
00217         // The following private data and methods constitute the working
00218         // heart of COBall as an actual application object.
00219         BOOL          m_bAlive;
00220         RECT          m_WinRect;
00221         int           m_nWidth;
00222         int           m_nHeight;
00223         int           m_xDirection;
00224         int           m_yDirection;
00225         BOOL          m_bNewPosition;
00226         int           m_xPosition;
00227         int           m_yPosition;
00228         short         m_xSkew;
00229         short         m_ySkew;
00230         COLORREF      m_crColor;
00231         CXForm        m_XForm;
00232         CBallThread   m_aBallThreads[MAX_BALLTHREADS];
00233
00234         // Private utility methods for internal support of the custom
00235         // IBall semantics.
00236         void GetDimensions(POINT*);
00237         void SetDimensions(int,int);
00238         void GetDirection(POINT*);
00239         void SetDirection(int,int);
00240         void GetPosition(POINT*);
00241         void SetPosition(int,int);
00242         void FindThread(void);
00243         DWORD CheckBounce(void);
00244     };
00245
00246     // Make the otherwise private and nested IBall and
00247     // IConnectionPointContainer interface implementations a friend to
00248     // COM object instantiations of this COBall COM object class.
00249     friend CImpIConnectionPointContainer;
00250     friend CImpIBall;
00251
00252     // Private method of main connectable COBall COM object to broadcast
00253     // event notifications to all connected listening sinks.
00254     HRESULT NotifySinks(DWORD dwEvent);
00255
00256     // Private data of COBall COM objects.
00257
00258     // Nested IBall implementation instantiation.  This IBall interface
00259     // is instantiated inside this COBall object as a native interface.
00260     CImpIBall         m_ImpIBall;
00261
00262     // Nested IConnectionPointContainer implementation instantiation.
00263     CImpIConnectionPointContainer m_ImpIConnectionPointContainer;
00264
00265     // Main Object reference count.
00266     ULONG             m_cRefs;
00267
00268     // Outer unknown (aggregation & delegation).
00269     IUnknown*         m_pUnkOuter;
00270
00271     // Pointer to this component server's control object.
00272     CServer*          m_pServer;
00273
00274     // The array of connection points for this connectable COM object.
00275     IConnectionPoint* m_aConnectionPoints[MAX_CONNECTION_POINTS];
00276 };
00277
00278 typedef COBall* PCOBall;
00279
00280 #endif // __cplusplus
00281
00282
00283 #endif // BALL_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHelloClassFactory Member List

This is the complete list of members for CHelloClassFactory, including all inherited members.
AddRef() | CHelloClassFactory |
CHelloClassFactory() | CHelloClassFactory | [inline]
CreateInstance(IUnknown *punkOuter, REFIID riid, void **ppv) | CHelloClassFactory |
LockServer(BOOL fLock) | CHelloClassFactory |
m_cRef | CHelloClassFactory | [private]
QueryInterface(REFIID iid, void **ppv) | CHelloClassFactory |
Release() | CHelloClassFactory |
~CHelloClassFactory() | CHelloClassFactory | [inline, private]
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

WiaWrap::CDataCallback Member List

This is the complete list of members for WiaWrap::CDataCallback, including all inherited members.
BandedDataCallback(LONG lReason, LONG lStatus, LONG lPercentComplete, LONG lOffset, LONG lLength, LONG lReserved, LONG lResLength, PBYTE pbBuffer) | WiaWrap::CDataCallback |
CDataCallback(PFNPROGRESSCALLBACK pfnProgressCallback, PVOID pProgressCallbackParam, LONG *plCount, IStream ***pppStream) | WiaWrap::CDataCallback |
CopyToBuffer(ULONG nOffset, LPCVOID pBuffer, ULONG nSize) | WiaWrap::CDataCallback | [private]
m_bBMP | WiaWrap::CDataCallback | [private]
m_cRef | WiaWrap::CDataCallback | [private]
m_nDataSize | WiaWrap::CDataCallback | [private]
m_nHeaderSize | WiaWrap::CDataCallback | [private]
m_pfnProgressCallback | WiaWrap::CDataCallback | [private]
m_plCount | WiaWrap::CDataCallback | [private]
m_pppStream | WiaWrap::CDataCallback | [private]
m_pProgressCallbackParam | WiaWrap::CDataCallback | [private]
m_pStream | WiaWrap::CDataCallback | [private]
QueryInterface(REFIID iid, LPVOID *ppvObj) | WiaWrap::CDataCallback |
ReAllocBuffer(ULONG nBufferSize) | WiaWrap::CDataCallback | [private]
STDMETHOD_(ULONG, AddRef)() | WiaWrap::CDataCallback |
STDMETHOD_(ULONG, Release)() | WiaWrap::CDataCallback |
StoreBuffer() | WiaWrap::CDataCallback | [private]
Generated on Wed Nov 13 2024 16:58:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/resource.h Source File

  • SysMgmt
  • MMC
  • Complete

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resource.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDI_PSI_LANDBASED               2
00008 #define IDS_NAME                        3
00009 #define IDS_SNAPINNAME                  6
00010 #define IDS_ABOUTNAME                   9
00011 #define IDS_PST_ROCKET                  10
00012 #define IDS_PST_LANDBASED               11
00013 #define IDD_PROPPAGE_LARGE              107
00014 #define IDI_ICON1                       108
00015 #define IDB_SMOPEN                      111
00016 #define IDB_SMBMP                       112
00017 #define IDB_LGBMP                       113
00018 #define IDI_PSI_ROCKET                  114
00019 #define IDR_SMICONS                     120
00020 #define IDR_LGICONS                     121
00021 #define IDR_TOOLBAR1                    122
00022 #define IDC_ROCKET_NAME                 1000
00023 #define IDC_ROCKET_HEIGHT               1001
00024 #define IDC_ROCKET_WEIGHT               1002
00025 #define IDC_ROCKET_PAYLOAD              1003
00026 #define IDC_ROCKET_STATUS               1005
00027 #define IDB_ROCKET                      40004
00028 #define IDB_CAR                         40005
00029 #define IDB_PLANE                       40006
00030 #define IDB_BIKE                        40007
00031 #define IDB_ROCKET2                     40008
00032 #define IDB_CAR2                        40009
00033 #define IDB_PLANE2                      40010
00034 #define IDB_BIKE2                       40011
00035 #define IDB_CLOSED2                     40012
00036 #define IDB_OPEN2                       40013
00037 #define IDB_CLOSED                      40014
00038 #define IDB_OPEN                        40015
00039 #define ID_BUTTONSTART                  40021
00040 #define ID_BUTTONPAUSE                  40022
00041 #define ID_BUTTONSTOP                   40023
00042
00043
00044 // Next default values for new objects
00045 //
00046 #ifdef APSTUDIO_INVOKED
00047 #ifndef APSTUDIO_READONLY_SYMBOLS
00048 #define _APS_NEXT_RESOURCE_VALUE        116
00049 #define _APS_NEXT_COMMAND_VALUE         40016
00050 #define _APS_NEXT_CONTROL_VALUE         1008
00051 #define _APS_NEXT_SYMED_VALUE           101
00052 #endif
00053 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBlockFrame Member List

This is the complete list of members for CBlockFrame, including all inherited members.
_cCol | CBlockFrame | [protected]
_Char | CCharBlock | [protected]
_Code | CCharBlock | [protected]
_Cols | CBlockFrame | [protected]
_cRow | CBlockFrame | [protected]
_fontHeader | CBlockFrame | [protected]
_Line | CCharBlock | [protected]
_pRows | CBlockFrame | [protected]
_size | CBlockFrame | [protected]
_szHeader | CBlockFrame | [protected]
CBlockFrame(UINT cCol, UINT cRow, POINT pt, UINT iBlockOffset, TCHAR *szHeader, const CFrameFormat &ff) | CBlockFrame |
CCharBlock(UINT cCol, UINT cRow, UINT iBlockOffset, const CBlockFormat &bf) | CCharBlock |
Draw(CCanvas &canvas, POINT pt) | CBlockFrame | [protected]
Hittest(POINT pt, POINT ptTest) | CCharBlock |
Paint(CCanvas &canvas, RECT rc, POINT pt) | CBlockFrame |
SetFont(HFONT font) | CCharBlock |
SetFormat(UINT fuFormat=HEXADECIMAL) | CCharBlock |
~CBlockFrame() | CBlockFrame |
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CClassPro Member List

This is the complete list of members for CClassPro, including all inherited members.
CancelAsyncCall(IWbemObjectSink __RPC_FAR *pSink) | CClassPro | [inline]
CClassPro(BSTR ObjectPath=NULL, BSTR User=NULL, BSTR Password=NULL, IWbemContext *pCtx=NULL) | CClassPro |
CreateClassEnum(const BSTR Superclass, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CClassPro | [inline]
CreateClassEnumAsync(const BSTR Superclass, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro |
CreateInstanceEnum(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CClassPro | [inline]
CreateInstanceEnumAsync(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro |
DeleteClass(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CClassPro | [inline]
DeleteClassAsync(const BSTR Class, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro |
DeleteInstance(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CClassPro | [inline]
DeleteInstanceAsync(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro |
ExecMethod(const BSTR, const BSTR, long, IWbemContext *, IWbemClassObject *, IWbemClassObject **, IWbemCallResult **) | CClassPro | [inline]
ExecMethodAsync(const BSTR, const BSTR, long, IWbemContext *, IWbemClassObject *, IWbemObjectSink *) | CClassPro | [inline]
ExecNotificationQuery(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CClassPro | [inline]
ExecNotificationQueryAsync(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro | [inline]
ExecQuery(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) | CClassPro | [inline]
ExecQueryAsync(const BSTR QueryLanguage, const BSTR Query, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro | [inline]
GetByPath(BSTR Path, IWbemClassObject FAR *FAR *pObj, IWbemContext *pCtx) | CClassPro |
GetObject(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CClassPro | [inline]
GetObjectAsync(const BSTR ObjectPath, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro |
Initialize(LPWSTR pszUser, LONG lFlags, LPWSTR pszNamespace, LPWSTR pszLocale, IWbemServices *pNamespace, IWbemContext *pCtx, IWbemProviderInitSink *pInitSink) | CClassPro |
m_cRef | CClassPro | [protected]
m_pNamespace | CClassPro | [protected]
OpenNamespace(const BSTR Namespace, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace, IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) | CClassPro | [inline]
PutClass(IWbemClassObject __RPC_FAR *pObject, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CClassPro | [inline]
PutClassAsync(IWbemClassObject __RPC_FAR *pObject, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro |
PutInstance(IWbemClassObject __RPC_FAR *pInst, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) | CClassPro | [inline]
PutInstanceAsync(IWbemClassObject __RPC_FAR *pInst, long lFlags, IWbemContext __RPC_FAR *pCtx, IWbemObjectSink __RPC_FAR *pResponseHandler) | CClassPro |
QueryInterface(REFIID, PPVOID) | CClassPro |
QueryObjectSink(long lFlags, IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) | CClassPro | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CClassPro |
STDMETHODIMP_(ULONG) Release(void) | CClassPro |
~CClassPro(void) | CClassPro |
Generated on Wed Nov 13 2024 16:55:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/TakeOwn/TakeOwn.c Source File

  • Security
  • Authorization
  • TakeOwn

TakeOwn.c

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     Takeown.c
00012
00013 Abstract:
00014
00015     Implements a recovery scheme to give an Administrator access to a
00016     file that has been denied to all.
00017
00018 Environment:
00019
00020     Must be run from an Administrator account in order to perform
00021     reliably.
00022
00023 -----------------------------------------------------------------------------*/
00024
00025 #include <windows.h>
00026 #include <stdio.h>
00027 #include <malloc.h>
00028
00029 BOOL
00030 AssertTakeOwnership(
00031     HANDLE TokenHandle
00032     );
00033
00034 BOOL
00035 GetTokenHandle(
00036     PHANDLE TokenHandle
00037     );
00038
00039 BOOL
00040 VariableInitialization();
00041
00042
00043
00044
00045 PSID AliasAdminsSid = NULL;
00046 PSID SeWorldSid;
00047
00048 static SID_IDENTIFIER_AUTHORITY    SepNtAuthority = SECURITY_NT_AUTHORITY;
00049 static SID_IDENTIFIER_AUTHORITY    SepWorldSidAuthority   = SECURITY_WORLD_SID_AUTHORITY;
00050
00051
00052
00053
00054 void main (int argc, char *argv[])
00055 {
00056
00057
00058     BOOL Result;
00059     LPSTR lpFileName;
00060     SECURITY_DESCRIPTOR SecurityDescriptor;
00061     HANDLE TokenHandle;
00062
00063
00064     //
00065     // We expect a file...
00066     //
00067     if (argc <= 1) {
00068
00069         printf("Must specify a file name");
00070         return;
00071     }
00072
00073
00074     lpFileName = argv[1];
00075
00076
00077     Result = VariableInitialization();
00078
00079     if ( !Result ) {
00080         printf("Out of memory\n");
00081         return;
00082     }
00083
00084
00085
00086
00087     Result = GetTokenHandle( &TokenHandle );
00088
00089     if ( !Result ) {
00090
00091         //
00092         // This should not happen
00093         //
00094
00095         printf("Unable to obtain the handle to our token, exiting\n");
00096         return;
00097     }
00098
00099
00100
00101
00102
00103
00104     //
00105     // Attempt to put a NULL Dacl on the object
00106     //
00107
00108     InitializeSecurityDescriptor( &SecurityDescriptor, SECURITY_DESCRIPTOR_REVISION );
00109
00110
00111     Result = SetSecurityDescriptorDacl (
00112                  &SecurityDescriptor,
00113                  TRUE,
00114                  NULL,
00115                  FALSE
00116                  );
00117
00118
00119
00120     if ( !Result ) {
00121         printf("SetSecurityDescriptorDacl failed, error code = %d\n", GetLastError());
00122         printf("Exiting\n");
00123         return;
00124     }
00125
00126     Result = SetFileSecurity(
00127                  lpFileName,
00128                  DACL_SECURITY_INFORMATION,
00129                  &SecurityDescriptor
00130                  );
00131
00132     if ( Result ) {
00133
00134         printf("Successful, protection removed\n");
00135         return;
00136     }
00137
00138
00139     //
00140     // That didn't work.
00141     //
00142
00143
00144     //
00145     // Attempt to make Administrator the owner of the file.
00146     //
00147
00148
00149     Result = SetSecurityDescriptorOwner (
00150                  &SecurityDescriptor,
00151                  AliasAdminsSid,
00152                  FALSE
00153                  );
00154
00155     if ( !Result ) {
00156         printf("SetSecurityDescriptorOwner failed, lasterror = %d\n", GetLastError());
00157         return;
00158     }
00159
00160
00161     Result = SetFileSecurity(
00162                  lpFileName,
00163                  OWNER_SECURITY_INFORMATION,
00164                  &SecurityDescriptor
00165                  );
00166
00167     if ( !Result ) {
00168
00169
00170         //
00171         // That didn't work either.
00172         //
00173
00174
00175
00176         //
00177         // Assert TakeOwnership privilege, then try again.  Note that
00178         // since the privilege is only enabled for the duration of
00179         // this process, we don't have to worry about turning it off
00180         // again.
00181         //
00182
00183         Result = AssertTakeOwnership( TokenHandle );
00184
00185         if ( !Result ) {
00186             printf("Could not enable SeTakeOwnership privilege\n");
00187             printf("Log on as Administrator and try again\n");
00188             return;
00189         }
00190
00191
00192         Result = SetFileSecurity(
00193                      lpFileName,
00194                      OWNER_SECURITY_INFORMATION,
00195                      &SecurityDescriptor
00196                      );
00197
00198         if ( !Result ) {
00199
00200             printf("Unable to assign Administrator as owner\n");
00201             printf("Log on as Administrator and try again\n");
00202             return;
00203
00204         }
00205     }
00206
00207     //
00208     // Try to put a benign DACL onto the file again
00209     //
00210
00211     Result = SetFileSecurity(
00212                  lpFileName,
00213                  DACL_SECURITY_INFORMATION,
00214                  &SecurityDescriptor
00215                  );
00216
00217     if ( !Result ) {
00218
00219         //
00220         // This should not happen.
00221         //
00222
00223         printf("SetFileSecurity unexpectedly failed, error code = %d\n", GetLastError());
00224
00225     } else {
00226
00227         printf("Successful, protection removed\n");
00228         return;
00229     }
00230 }
00231
00232
00233
00234
00235
00236 BOOL
00237 GetTokenHandle(
00238               PHANDLE TokenHandle
00239               )
00240 //
00241 // This routine will open the current process and return
00242 // a handle to its token.
00243 //
00244 // These handles will be closed for us when the process
00245 // exits.
00246 //
00247 {
00248
00249     HANDLE ProcessHandle;
00250     BOOL bResult;
00251
00252     ProcessHandle = OpenProcess(
00253                                PROCESS_QUERY_INFORMATION,
00254                                FALSE,
00255                                GetCurrentProcessId()
00256                                );
00257
00258     if ( ProcessHandle == NULL )
00259     {
00260
00261         //
00262         // This should not happen
00263         //
00264
00265         return( FALSE );
00266     }
00267
00268
00269     bResult = OpenProcessToken (
00270                                ProcessHandle,
00271                                TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
00272                                TokenHandle
00273                                );
00274
00275     // Close the Handle - Don't leak memory
00276     CloseHandle(ProcessHandle);
00277
00278     // OpenProcessToken Returns TRUE or FALSE
00279     return bResult;
00280
00281 }
00282
00283
00284 BOOL
00285 AssertTakeOwnership(
00286     HANDLE TokenHandle
00287     )
00288 //
00289 // This routine turns on SeTakeOwnershipPrivilege in the current
00290 // token.  Once that has been accomplished, we can open the file
00291 // for WRITE_OWNER even if we are denied that access by the ACL
00292 // on the file.
00293
00294 {
00295     LUID TakeOwnershipValue;
00296     BOOL Result;
00297     TOKEN_PRIVILEGES TokenPrivileges;
00298
00299
00300     //
00301     // First, find out the value of TakeOwnershipPrivilege
00302     //
00303
00304
00305     Result = LookupPrivilegeValue(
00306                  NULL,
00307                  "SeTakeOwnershipPrivilege",
00308                  &TakeOwnershipValue
00309                  );
00310
00311     if ( !Result ) {
00312
00313         //
00314         // This should not happen
00315         //
00316
00317         printf("Unable to obtain value of TakeOwnership privilege\n");
00318         printf("Error = %d\n",GetLastError());
00319         printf("Exiting\n");
00320         return FALSE;
00321     }
00322
00323     //
00324     // Set up the privilege set we will need
00325     //
00326
00327     TokenPrivileges.PrivilegeCount = 1;
00328     TokenPrivileges.Privileges[0].Luid = TakeOwnershipValue;
00329     TokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
00330
00331
00332
00333
00334     (VOID) AdjustTokenPrivileges (
00335                 TokenHandle,
00336                 FALSE,
00337                 &TokenPrivileges,
00338                 sizeof( TOKEN_PRIVILEGES ),
00339                 NULL,
00340                 NULL
00341                 );
00342
00343     if ( GetLastError() != NO_ERROR ) {
00344
00345         return( FALSE );
00346
00347     } else {
00348
00349         return( TRUE );
00350     }
00351
00352 }
00353
00354
00355
00356 BOOL
00357 VariableInitialization()
00358
00359 //
00360 // Create some useful SIDs.
00361 //
00362
00363 {
00364
00365     BOOL Result;
00366
00367     Result = AllocateAndInitializeSid(
00368                  &SepNtAuthority,
00369                  2,
00370                  SECURITY_BUILTIN_DOMAIN_RID,
00371                  DOMAIN_ALIAS_RID_ADMINS,
00372                  0,
00373                  0,
00374                  0,
00375                  0,
00376                  0,
00377                  0,
00378                  &AliasAdminsSid
00379                  );
00380
00381     if ( !Result ) {
00382         return( FALSE );
00383     }
00384
00385
00386     Result = AllocateAndInitializeSid(
00387                  &SepWorldSidAuthority,
00388                  1,
00389                  SECURITY_WORLD_RID,
00390                  0,
00391                  0,
00392                  0,
00393                  0,
00394                  0,
00395                  0,
00396                  0,
00397                  &SeWorldSid
00398                  );
00399
00400     if ( !Result ) {
00401         return( FALSE );
00402     }
00403
00404     return( TRUE );
00405 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/people.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "People.h"
00021
00022 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00025 const GUID CSkateboardFolder::thisGuid = { 0xef163733, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00026 const GUID CIceSkateFolder::thisGuid = { 0xf6c660b0, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00027
00028 const GUID CBicycle::thisGuid = { 0xef163734, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00029 const GUID CSkateboard::thisGuid = { 0xef163735, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00030 const GUID CIceSkate::thisGuid = { 0xf6c660b1, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00031
00032
00033 //==============================================================
00034 //
00035 // CPeoplePoweredVehicle implementation
00036 //
00037 //
00038 CPeoplePoweredVehicle::CPeoplePoweredVehicle()
00039 {
00040     children[0] = new CBicycleFolder;
00041     children[1] = new CSkateboardFolder;
00042     children[2] = new CIceSkateFolder;
00043 }
00044
00045 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00046 {
00047     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00048         delete children[n];
00049 }
00050
00051 HRESULT CPeoplePoweredVehicle::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00052 {
00053     SCOPEDATAITEM sdi;
00054
00055     if (!bExpanded) {
00056         // create the child nodes, then expand them
00057         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00058             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00059             sdi.mask = SDI_STR       |   // Displayname is valid
00060                 SDI_PARAM     |   // lParam is valid
00061                 SDI_IMAGE     |   // nImage is valid
00062                 SDI_OPENIMAGE |   // nOpenImage is valid
00063                 SDI_PARENT    |   // relativeID is valid
00064                 SDI_CHILDREN;     // cChildren is valid
00065
00066             sdi.relativeID  = (HSCOPEITEM)parent;
00067             sdi.nImage      = children[n]->GetBitmapIndex();
00068             sdi.nOpenImage  = INDEX_OPENFOLDER;
00069             sdi.displayname = MMC_CALLBACK;
00070             sdi.lParam      = (LPARAM)children[n];       // The cookie
00071             sdi.cChildren   = 0;
00072
00073             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00074
00075             _ASSERT( SUCCEEDED(hr) );
00076         }
00077     }
00078
00079     return S_OK;
00080 }
00081
00082 CBicycleFolder::CBicycleFolder()
00083 {
00084     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00085         children[n] = new CBicycle(n + 1);
00086     }
00087 }
00088
00089 CBicycleFolder::~CBicycleFolder()
00090 {
00091     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00092         if (children[n]) {
00093             delete children[n];
00094         }
00095 }
00096
00097 HRESULT CBicycleFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00098 {
00099     HRESULT      hr = S_OK;
00100
00101     IHeaderCtrl *pHeaderCtrl = NULL;
00102     IResultData *pResultData = NULL;
00103
00104     if (bShow) {
00105         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00106         _ASSERT( SUCCEEDED(hr) );
00107
00108         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00109         _ASSERT( SUCCEEDED(hr) );
00110
00111         // Set the column headers in the results pane
00112         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00113         _ASSERT( S_OK == hr );
00114
00115         // insert items here
00116         RESULTDATAITEM rdi;
00117
00118         hr = pResultData->DeleteAllRsltItems();
00119         _ASSERT( SUCCEEDED(hr) );
00120
00121         if (!bExpanded) {
00122             // create the child nodes, then expand them
00123             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00124                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00125                 rdi.mask       = RDI_STR       |   // Displayname is valid
00126                     RDI_IMAGE     |
00127                     RDI_PARAM;        // nImage is valid
00128
00129                 rdi.nImage      = children[n]->GetBitmapIndex();
00130                 rdi.str         = MMC_CALLBACK;
00131                 rdi.nCol        = 0;
00132                 rdi.lParam      = (LPARAM)children[n];
00133
00134                 hr = pResultData->InsertItem( &rdi );
00135
00136                 _ASSERT( SUCCEEDED(hr) );
00137             }
00138         }
00139
00140         pHeaderCtrl->Release();
00141         pResultData->Release();
00142     }
00143
00144     return hr;
00145 }
00146
00147 CIceSkateFolder::CIceSkateFolder()
00148 {
00149     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00150         children[n] = new CIceSkate(n + 1);
00151     }
00152 }
00153
00154 CIceSkateFolder::~CIceSkateFolder()
00155 {
00156     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00157         if (children[n]) {
00158             delete children[n];
00159         }
00160 }
00161
00162 HRESULT CIceSkateFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00163 {
00164     HRESULT      hr = S_OK;
00165
00166     IHeaderCtrl *pHeaderCtrl = NULL;
00167     IResultData *pResultData = NULL;
00168
00169     if (bShow) {
00170         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00171         _ASSERT( SUCCEEDED(hr) );
00172
00173         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00174         _ASSERT( SUCCEEDED(hr) );
00175
00176         // Set the column headers in the results pane
00177         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00178         _ASSERT( S_OK == hr );
00179
00180         // insert items here
00181         RESULTDATAITEM rdi;
00182
00183         hr = pResultData->DeleteAllRsltItems();
00184         _ASSERT( SUCCEEDED(hr) );
00185
00186         if (!bExpanded) {
00187             // create the child nodes, then expand them
00188             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00189                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00190                 rdi.mask       = RDI_STR       |   // Displayname is valid
00191                     RDI_IMAGE     |
00192                     RDI_PARAM;        // nImage is valid
00193
00194                 rdi.nImage      = children[n]->GetBitmapIndex();
00195                 rdi.str         = MMC_CALLBACK;
00196                 rdi.nCol        = 0;
00197                 rdi.lParam      = (LPARAM)children[n];
00198
00199                 hr = pResultData->InsertItem( &rdi );
00200
00201                 _ASSERT( SUCCEEDED(hr) );
00202             }
00203         }
00204
00205         pHeaderCtrl->Release();
00206         pResultData->Release();
00207     }
00208
00209     return hr;
00210 }
00211
00212 CSkateboardFolder::CSkateboardFolder()
00213 {
00214     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00215         children[n] = new CSkateboard(n + 1);
00216     }
00217 }
00218
00219 CSkateboardFolder::~CSkateboardFolder()
00220 {
00221     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00222         if (children[n]) {
00223             delete children[n];
00224         }
00225 }
00226
00227 HRESULT CSkateboardFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00228 {
00229     HRESULT      hr = S_OK;
00230
00231     IHeaderCtrl *pHeaderCtrl = NULL;
00232     IResultData *pResultData = NULL;
00233
00234     if (bShow) {
00235         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00236         _ASSERT( SUCCEEDED(hr) );
00237
00238         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00239         _ASSERT( SUCCEEDED(hr) );
00240
00241         // Set the column headers in the results pane
00242         hr = pHeaderCtrl->InsertColumn( 0, L"Name                      ", 0, MMCLV_AUTO );
00243         _ASSERT( S_OK == hr );
00244
00245         // insert items here
00246         RESULTDATAITEM rdi;
00247
00248         hr = pResultData->DeleteAllRsltItems();
00249         _ASSERT( SUCCEEDED(hr) );
00250
00251         if (!bExpanded) {
00252             // create the child nodes, then expand them
00253             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00254                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00255                 rdi.mask       = RDI_STR       |   // Displayname is valid
00256                     RDI_IMAGE     |
00257                     RDI_PARAM;        // nImage is valid
00258
00259                 rdi.nImage      = children[n]->GetBitmapIndex();
00260                 rdi.str         = MMC_CALLBACK;
00261                 rdi.nCol        = 0;
00262                 rdi.lParam      = (LPARAM)children[n];
00263
00264                 hr = pResultData->InsertItem( &rdi );
00265
00266                 _ASSERT( SUCCEEDED(hr) );
00267             }
00268         }
00269
00270         pHeaderCtrl->Release();
00271         pResultData->Release();
00272     }
00273
00274     return hr;
00275 }
00276
00277 const _TCHAR *CBicycle::GetDisplayName(int nCol)
00278 {
00279     static _TCHAR buf[128];
00280
00281     _stprintf(buf, _T("Bicycle #%d"), id);
00282
00283     return buf;
00284 }
00285
00286 const _TCHAR *CSkateboard::GetDisplayName(int nCol)
00287 {
00288     static _TCHAR buf[128];
00289
00290     _stprintf(buf, _T("Skateboard #%d"), id);
00291
00292     return buf;
00293 }
00294
00295 const _TCHAR *CIceSkate::GetDisplayName(int nCol)
00296 {
00297     static _TCHAR buf[128];
00298
00299     _stprintf(buf, _T("Ice Skate #%d"), id);
00300
00301     return buf;
00302 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDSLConnectionPage Member List

This is the complete list of members for CDSLConnectionPage, including all inherited members.
Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal) | CPropertyPage |
Apply() | CPropertyPage |
CDSLConnectionPage() | CDSLConnectionPage |
CPropertyPage(REFCLSID clsid, INT iDialogID) | CPropertyPage |
Deactivate() | CPropertyPage |
DEFINE_ADDREF_RELEASE | CPropertyPage |
DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [static]
GetClassID(CLSID __RPC_FAR *pClassID) | CPropertyPage | [inline]
GetPageInfo(PROPPAGEINFO __RPC_FAR *pPageInfo) | CPropertyPage | [inline, virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDSLConnectionPage | [virtual]
Help(LPCOLESTR pszHelpDir) | CPropertyPage | [inline]
InitNew(void) | CPropertyPage | [inline]
IsPageDirty() | CPropertyPage |
Load(IPropertyBag __RPC_FAR *pPropBag, IErrorLog __RPC_FAR *pErrorLog) | CDSLConnectionPage |
m_clsid | CPropertyPage | [protected]
m_cRef | CPropertyPage | [protected]
m_hWnd | CPropertyPage | [protected]
m_iDialogID | CPropertyPage | [protected]
m_pIPropertyPageSite | CPropertyPage | [protected]
m_vDataSource | CDSLConnectionPage | [protected]
Move(LPCRECT pRect) | CPropertyPage |
QueryInterface(REFIID riid, LPVOID *ppv) | CPropertyPage |
Save(IPropertyBag __RPC_FAR *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) | CDSLConnectionPage |
SetObjects(ULONG cObjects, IUnknown __RPC_FAR *__RPC_FAR *ppUnk) | CPropertyPage | [inline]
SetPageSite(IPropertyPageSite *pPageSite) | CPropertyPage |
Show(UINT nCmdShow) | CPropertyPage |
TranslateAccelerator(MSG *pMsg) | CPropertyPage |
~CDSLConnectionPage() | CDSLConnectionPage | [virtual]
~CPropertyPage() | CPropertyPage | [virtual]
Generated on Wed Nov 13 2024 16:56:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/registry.h Source File

  • SysMgmt
  • MMC
  • Extens

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout);    // Class Id for About Class
00040
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/comp.h Source File

  • SysMgmt
  • MMC
  • Openserv

comp.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMP_H_
00020 #define _SAMPCOMP_H_
00021
00022 #include <mmc.h>
00023
00024 class CComponent : public IComponent,
00025 IExtendPropertySheet2
00026 {
00027 private:
00028     ULONG       m_cref;
00029
00030     IConsole*   m_ipConsole;
00031
00032     class CComponentData *m_pComponentData;
00033
00034     public:
00035         CComponent(CComponentData *parent);
00036         ~CComponent();
00037
00038         ///////////////////////////////
00039         // Interface IUnknown
00040         ///////////////////////////////
00041         STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00042         STDMETHODIMP_(ULONG) AddRef();
00043         STDMETHODIMP_(ULONG) Release();
00044
00045         ///////////////////////////////
00046         // Interface IComponent
00047         ///////////////////////////////
00048         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00049             /* [in] */ LPCONSOLE lpConsole);
00050
00051             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00052             /* [in] */ LPDATAOBJECT lpDataObject,
00053             /* [in] */ MMC_NOTIFY_TYPE event,
00054             /* [in] */ LPARAM arg,
00055             /* [in] */ LPARAM param);
00056
00057             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
00058             /* [in] */ MMC_COOKIE cookie);
00059
00060             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00061             /* [in] */ MMC_COOKIE cookie,
00062             /* [in] */ DATA_OBJECT_TYPES type,
00063             /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00064
00065             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
00066             /* [in] */ MMC_COOKIE cookie,
00067             /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00068             /* [out] */ long __RPC_FAR *pViewOptions);
00069
00070             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00071             /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
00072
00073             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00074             /* [in] */ LPDATAOBJECT lpDataObjectA,
00075             /* [in] */ LPDATAOBJECT lpDataObjectB);
00076
00077             //////////////////////////////////
00078             // Interface IExtendPropertySheet2
00079             //////////////////////////////////
00080             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreatePropertyPages(
00081             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00082             /* [in] */ LONG_PTR handle,
00083             /* [in] */ LPDATAOBJECT lpIDataObject);
00084
00085             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryPagesFor(
00086             /* [in] */ LPDATAOBJECT lpDataObject);
00087
00088             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetWatermarks(
00089             /* [in] */ LPDATAOBJECT lpIDataObject,
00090             /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00091             /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00092             /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00093             /* [out] */ BOOL __RPC_FAR *bStretch);
00094 };
00095
00096 #endif _SAMPCOMP_H_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSnoopWnd Member List

This is the complete list of members for CSnoopWnd, including all inherited members.
_achText | CSnoopWnd | [private]
_atomWndClass | CSnoopWnd | [private, static]
_cchText | CSnoopWnd | [private]
_GetThis(HWND hWnd) | CSnoopWnd | [inline, private, static]
_Hide() | CSnoopWnd |
_hWnd | CSnoopWnd | [private]
_Init() | CSnoopWnd |
_InitClass() | CSnoopWnd | [static]
_OnPaint(HWND hWnd, HDC hdc) | CSnoopWnd | [private]
_pCase | CSnoopWnd | [private]
_SetThis(HWND hWnd, LPARAM lParam) | CSnoopWnd | [inline, private, static]
_Show() | CSnoopWnd |
_Uninit() | CSnoopWnd |
_UninitClass() | CSnoopWnd | [static]
_UpdateText(ITfRange *pRange) | CSnoopWnd |
_UpdateText(TfEditCookie ec, ITfContext *pContext, ITfRange *pRange) | CSnoopWnd |
_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CSnoopWnd | [private, static]
CSnoopWnd(CCaseTextService *pCase) | CSnoopWnd |
CUpdateTextEditSession | CSnoopWnd | [private]
Generated on Wed Nov 13 2024 16:57:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step2/resource.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step2

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by MyDevice.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_DIMMER                      101
00007 #define IDR_DIMMERSERVICE               102
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NEXT_RESOURCE_VALUE        201
00014 #define _APS_NEXT_COMMAND_VALUE         32768
00015 #define _APS_NEXT_CONTROL_VALUE         201
00016 #define _APS_NEXT_SYMED_VALUE           103
00017 #endif
00018 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_READ_WRITE_LOCK Member List

This is the complete list of members for _READ_WRITE_LOCK, including all inherited members.
RWL_ReaderCount | _READ_WRITE_LOCK
RWL_ReaderDoneEvent | _READ_WRITE_LOCK
RWL_ReadWriteBlock | _READ_WRITE_LOCK
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SockAuth/Collect.h Source File

  • Security
  • SSPI
  • SockAuth

Collect.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 Module Name:
00006
00007     collect.h
00008
00009 Abstract:
00010
00011     Functions for a simple collection
00012
00013 Revision History:
00014
00015 --*/
00016
00017 BOOL GetEntry (DWORD dwKey, PVOID *ppData);
00018 BOOL AddEntry (DWORD dwKey, PVOID pData);
00019 BOOL DeleteEntry (DWORD dwKey, PVOID *ppData);
00020
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Util::HelperFunctions Member List

This is the complete list of members for Util::HelperFunctions, including all inherited members.
LineToString(int X1, int Y1, int X2, int Y2) | Util::HelperFunctions | [inline]
StringToLine(string strLine, ref line lineToDraw) | Util::HelperFunctions | [inline]
Generated on Wed Nov 13 2024 16:58:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/scpcmenuui.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

scpcmenuui.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       scpcmenuui.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "resource.h"
00013 #include "SCPCMenuUI.h"
00014 #include <dsclient.h> // Clipboard formats
00015
00016 BEGIN_MESSAGE_MAP(CSCPCMenuDialog, CDialog)
00017 END_MESSAGE_MAP()
00018
00019 BOOL CSCPCMenuDialog::OnInitDialog()
00020 {
00021   //
00022   // Register the clipboard formats for retrieving info from the DS object
00023   //
00024   m_cfDsDisplaySpecOptions  = RegisterClipboardFormat(CFSTR_DS_DISPLAY_SPEC_OPTIONS);
00025   m_cfDsObjectNames         = RegisterClipboardFormat(CFSTR_DSOBJECTNAMES);
00026
00027   RetrieveData();
00028   SetUIData();
00029   return TRUE;
00030 }
00031
00032 void CSCPCMenuDialog::RetrieveData()
00033 {
00034   //
00035   // Get display info using CFSTR_DS_DISPLAY_SPEC_OPTIONS
00036   //
00037   PDSDISPLAYSPECOPTIONS pDsSpecOptions = NULL;
00038
00039   //
00040   // Need to get CFSTR_Ds_DISPLAY_SPEC_OPTIONS as HGLOBAL
00041   //
00042   STGMEDIUM stgmedium = { TYMED_HGLOBAL, NULL, NULL };
00043
00044   //
00045   // Initialize formatetc for CFSTR_DS_DISPLAY_SPEC_OPTIONS format.
00046   //
00047   FORMATETC formatetc = { m_cfDsDisplaySpecOptions, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00048
00049   //
00050   // Get the global memory block containing the display option
00051   // info for the selected object
00052   //
00053   HRESULT hr = m_spDataObj->GetData(&formatetc, &stgmedium);
00054   if (FAILED(hr))
00055   {
00056     return;
00057   }
00058
00059   //
00060   // Assign pointer to DSDISPLAYSPECOPTIONS structure
00061   //
00062   pDsSpecOptions = (PDSDISPLAYSPECOPTIONS)GlobalLock(stgmedium.hGlobal);
00063   if (pDsSpecOptions != NULL)
00064   {
00065     m_szPrefix    = (PWSTR)BYTE_OFFSET(pDsSpecOptions, pDsSpecOptions->offsetAttribPrefix);
00066     m_szUsername  = (PWSTR)BYTE_OFFSET(pDsSpecOptions, pDsSpecOptions->offsetUserName);
00067     m_szServer    = (PWSTR)BYTE_OFFSET(pDsSpecOptions, pDsSpecOptions->offsetServer);
00068     m_szServerConfigPath = (PWSTR)BYTE_OFFSET(pDsSpecOptions, pDsSpecOptions->offsetServerConfigPath);
00069   }
00070
00071   //
00072   // Clean up
00073   //
00074   GlobalUnlock(stgmedium.hGlobal);
00075   ReleaseStgMedium(&stgmedium);
00076
00077
00078   //
00079   // Get display info using CFSTR_DSOBJECTNAMES
00080   //
00081   FORMATETC fmte = { m_cfDsObjectNames, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00082   STGMEDIUM objMedium;
00083
00084   hr = m_spDataObj->GetData(&fmte, &objMedium);
00085   if (FAILED(hr))
00086   {
00087     AfxMessageBox(_T("Failed to retrieve data from medium."));
00088     return;
00089   }
00090
00091   LPDSOBJECTNAMES pDsObjectNames;
00092   pDsObjectNames = (LPDSOBJECTNAMES)objMedium.hGlobal;
00093   if (pDsObjectNames->cItems < 1)
00094   {
00095     return;
00096   }
00097
00098   m_szADsPath = (PWSTR)BYTE_OFFSET(pDsObjectNames, pDsObjectNames->aObjects[0].offsetName);
00099   m_szClass = (PWSTR)BYTE_OFFSET(pDsObjectNames, pDsObjectNames->aObjects[0].offsetClass);
00100 }
00101
00102 void CSCPCMenuDialog::SetUIData()
00103 {
00104   GetDlgItem(IDC_PREFIX_EDIT)->SetWindowText(m_szPrefix);
00105   GetDlgItem(IDC_USER_EDIT)->SetWindowText(m_szUsername);
00106   GetDlgItem(IDC_SERVER_EDIT)->SetWindowText(m_szServer);
00107   GetDlgItem(IDC_SERVER_CONFIG_PATH_EDIT)->SetWindowText(m_szServerConfigPath);
00108   GetDlgItem(IDC_PATH_EDIT)->SetWindowText(m_szADsPath);
00109   GetDlgItem(IDC_CLASS_EDIT)->SetWindowText(m_szClass);
00110 }
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/inc/rasutil.h Source File

  • NetDS
  • RRas
  • rqs
  • inc

rasutil.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright   (c) Microsoft Corporation.  All rights reserved.
00004 //
00005 //  File:       RasUtil.h
00006 //
00007 //  Contents:   Master include file for ras utilities.
00008 //
00009 //  Notes:
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #pragma once
00014
00015 #ifndef __RasUtil_h
00016 #define __RasUtil_h
00017
00018 #include "RuSocket.h"
00019 #include "RuMem.h"
00020 #include "RuReg.h"
00021 #include "RuString.h"
00022 #include "RcuSync.h"
00023
00024 #define RU_ELEMENT_COUNT( x )   ( sizeof( x ) / sizeof( *x ) )
00025
00026 #define RU_LEAVE_IF_NOT_OK(x)   if ( S_OK != (x)) __leave;
00027 #define RU_LEAVE_IF_NULL(x)     if ( NULL == (x)) __leave;
00028 #define RU_LEAVE_HR_IF_NULL(x, ret)  if ( NULL == (x) ) { hr = (ret); __leave; }
00029
00030 #define RU_RETURN_IF_NOT_OK(x)        if ( S_OK != (x)) return (x);
00031 #define RU_RETURN_IF_NULL_PARAM(x)    if ( NULL == (x) ) return E_INVALIDARG;
00032
00033 #define RU_BREAK_IF_NOT_OK(x) if (S_OK != (x)) break;
00034 #define RU_BREAK_IF_NULL(x)   if ( NULL == (x)) break;
00035 #define RU_BREAK_HR_IF_NULL( x, ret )  if ( NULL == (x) ) { hr = (ret); break; }
00036
00037 #define S_RU_EQUALS                     ((HRESULT)0x000abc01L)
00038 #define S_RU_GREATER                    ((HRESULT)0x000abc02L)
00039 #define S_RU_LESS                       ((HRESULT)0x000abc03L)
00040
00041 #endif
00042
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/compdata.h Source File

  • SysMgmt
  • MMC
  • Multisel

compdata.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024 #include "StatNode.h"
00025 #include "Comp.h"
00026
00027 class CComponentData : public IComponentData
00028 {
00029     friend class CComponent;
00030
00031 private:
00032     ULONG       m_cref;
00033     LPCONSOLE     m_ipConsole;
00034     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00035
00036     CStaticNode     *m_pStaticNode;
00037
00038 public:
00039     CComponentData();
00040     ~CComponentData();
00041
00042     ///////////////////////////////
00043     // Interface IUnknown
00044     ///////////////////////////////
00045     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00046     STDMETHODIMP_(ULONG) AddRef();
00047     STDMETHODIMP_(ULONG) Release();
00048
00049     ///////////////////////////////
00050     // Interface IComponentData
00051     ///////////////////////////////
00052     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00053         /* [in] */ LPUNKNOWN pUnknown);
00054
00055         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00056         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00057
00058         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00059         /* [in] */ LPDATAOBJECT lpDataObject,
00060         /* [in] */ MMC_NOTIFY_TYPE event,
00061         /* [in] */ LPARAM arg,
00062         /* [in] */ LPARAM param);
00063
00064         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00065
00066     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00067         /* [in] */ MMC_COOKIE cookie,
00068         /* [in] */ DATA_OBJECT_TYPES type,
00069         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00070
00071         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00072         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00073
00074         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00075         /* [in] */ LPDATAOBJECT lpDataObjectA,
00076         /* [in] */ LPDATAOBJECT lpDataObjectB);
00077 };
00078
00079 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by userwizard.rc
00004 //
00005 #define IDD_USER_PAGE_EXT               107
00006 #define IDC_EDIT_PICTURE_PATH           1000
00007 #define IDC_PICTURE_DISPLAY             1001
00008 #define IDC_BUTTON_CHANGE_PICTURE       1002
00009 #define IDC_EDIT_EMPLOYEE_ID            1003
00010 #define IDC_STATIC_ICON                 1005
00011 #define IDC_EDIT_CONTAINER              1006
00012 #define IDC_BUTTON_CLEAR_PICTURE        1007
00013
00014 // Next default values for new objects
00015 //
00016 #ifdef APSTUDIO_INVOKED
00017 #ifndef APSTUDIO_READONLY_SYMBOLS
00018 #define _APS_NEXT_RESOURCE_VALUE        101
00019 #define _APS_NEXT_COMMAND_VALUE         40001
00020 #define _APS_NEXT_CONTROL_VALUE         1008
00021 #define _APS_NEXT_SYMED_VALUE           101
00022 #endif
00023 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEnlistTransaction Member List

This is the complete list of members for CEnlistTransaction, including all inherited members.
CEnlistTransaction() | CEnlistTransaction | [inline]
CreateInstance(BSTR bstrProgId, IDispatch **ppDispatch) | CEnlistTransaction |
EnlistTransaction(BSTR bstrTipUrl) | CEnlistTransaction |
InterfaceSupportsErrorInfo(REFIID riid) | CEnlistTransaction |
m_bstrTipUrl | CEnlistTransaction | [protected]
Generated on Wed Nov 13 2024 16:56:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/extend.h Source File

  • SysMgmt
  • MMC
  • Tbarext

extend.h

Go to the documentation of this file.
00001
00002 //==============================================================;
00003 //
00004 //  This source code is only intended as a supplement to
00005 //  existing Microsoft documentation.
00006 //
00007 //
00008 //
00009 //
00010 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00011 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00012 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00013 //  PURPOSE.
00014 //
00015 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00016 //
00017 //
00018 //
00019 //==============================================================;
00020
00021 #ifndef _EXTEND_H
00022 #define _EXTEND_H
00023
00024 struct EXTENSION_NODE
00025 {
00026     GUID  GUID;
00027     _TCHAR  szDescription[256];
00028 };
00029
00030 enum EXTENSION_TYPE
00031 {
00032     NameSpaceExtension,
00033         ContextMenuExtension,
00034         ToolBarExtension,
00035         PropertySheetExtension,
00036         TaskExtension,
00037         DynamicExtension,
00038     DummyExtension
00039 };
00040
00041 struct EXTENDER_NODE
00042 {
00043     EXTENSION_TYPE  eType;
00044     GUID      guidNode;
00045     GUID      guidExtension;
00046     _TCHAR      szDescription[256];
00047 };
00048
00049 #endif // _EXTEND_H
00050
00051
00052
00053
00054
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAsyncTest Member List

This is the complete list of members for CAsyncTest, including all inherited members.
Begin_Test1(BSTR bstr) | CAsyncTest | [private, virtual]
Begin_Test2(BSTR bstrIn) | CAsyncTest | [private, virtual]
CallDone enum value | CAsyncTest | [protected]
CallNone enum value | CAsyncTest | [protected]
CallPending enum value | CAsyncTest | [protected]
CAsyncTest() | CAsyncTest | [inline, protected]
CAsyncTest(CAsyncXXX< CServer, ITest, CAsyncTest > *pA) | CAsyncTest | [protected]
Finish_Test1(BSTR bstr) | CAsyncTest | [private, virtual]
Finish_Test2(BSTR *lpbstrOut) | CAsyncTest | [private, virtual]
Init() | CAsyncTest |
m_hResult | CAsyncTest | [protected]
m_lpAsyncXXX | CAsyncTest | [protected]
m_state | CAsyncTest | [protected]
Test1 enum value | CAsyncTest | [protected]
Test2 enum value | CAsyncTest | [protected]
ThreadProc(threadParam *pthdParam) | CAsyncTest | [protected, static]
~CAsyncTest() | CAsyncTest | [protected, virtual]
Generated on Wed Nov 13 2024 16:55:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/xmldsig/AboutBox.cs Source File

  • Security
  • capicom
  • c_sharp
  • xmldsig

AboutBox.cs

Go to the documentation of this file.
00001 using System;
00002 using System.Drawing;
00003 using System.Collections;
00004 using System.ComponentModel;
00005 using System.Windows.Forms;
00006 using Sample;
00007
00008 namespace Sample.UI
00009 {
00010   internal class AboutBox : System.Windows.Forms.Form
00011   {
00012         private System.Windows.Forms.PictureBox IconBox;
00013         private System.Windows.Forms.Label TitleLabel;
00014         private System.Windows.Forms.Label CopyrightLabel;
00015         private System.Windows.Forms.Button OkButton;
00016     private System.ComponentModel.Container components = null;
00017
00018     public AboutBox() {
00019       InitializeComponent();
00020     }
00021
00022     protected override void Dispose( bool disposing ) {
00023       if( disposing ) {
00024         if (components != null) {
00025           components.Dispose();
00026         }
00027       }
00028       base.Dispose( disposing );
00029     }
00030
00031     private void InitializeComponent() {
00032             this.Icon = new Icon(GetType().Module.Assembly.GetManifestResourceStream("Traffic.ico"));
00033
00034             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AboutBox));
00035             this.IconBox = new System.Windows.Forms.PictureBox();
00036             this.TitleLabel = new System.Windows.Forms.Label();
00037             this.CopyrightLabel = new System.Windows.Forms.Label();
00038             this.OkButton = new System.Windows.Forms.Button();
00039             this.SuspendLayout();
00040             //
00041             // IconBox
00042             //
00043             this.IconBox.Image = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream("traffic_light.gif"));
00044             this.IconBox.Location = new System.Drawing.Point(8, 8);
00045             this.IconBox.Name = "IconBox";
00046             this.IconBox.Size = new System.Drawing.Size(48, 48);
00047             this.IconBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
00048             this.IconBox.TabIndex = 0;
00049             this.IconBox.TabStop = false;
00050             //
00051             // TitleLabel
00052             //
00053             this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
00054             this.TitleLabel.Location = new System.Drawing.Point(56, 16);
00055             this.TitleLabel.Name = "TitleLabel";
00056             this.TitleLabel.Size = new System.Drawing.Size(328, 32);
00057             this.TitleLabel.TabIndex = 1;
00058             this.TitleLabel.Text = Messages.DemoTitle;
00059             //
00060             // CopyrightLabel
00061             //
00062             this.CopyrightLabel.Location = new System.Drawing.Point(56, 40);
00063             this.CopyrightLabel.Name = "CopyrightLabel";
00064             this.CopyrightLabel.Size = new System.Drawing.Size(328, 50);
00065             this.CopyrightLabel.TabIndex = 2;
00066             this.CopyrightLabel.Text = Messages.CopyrightMessage;
00067             //
00068             // OkButton
00069             //
00070             this.OkButton.Location = new System.Drawing.Point(304, 72);
00071             this.OkButton.Name = "OkButton";
00072             this.OkButton.TabIndex = 3;
00073             this.OkButton.Text = "Ok";
00074             this.OkButton.Click += new System.EventHandler(this.OkButton_Click);
00075             //
00076             // AboutBox
00077             //
00078             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00079             this.ClientSize = new System.Drawing.Size(392, 109);
00080             this.Controls.AddRange(new System.Windows.Forms.Control[] {
00081                                                       this.OkButton,
00082                                                       this.CopyrightLabel,
00083                                                       this.TitleLabel,
00084                                                       this.IconBox});
00085             this.AcceptButton = this.OkButton;
00086             this.CancelButton = this.OkButton;
00087             this.MaximizeBox = false;
00088             this.MaximumSize = new System.Drawing.Size(400, 136);
00089             this.MinimizeBox = false;
00090             this.MinimumSize = new System.Drawing.Size(400, 136);
00091             this.SizeGripStyle = SizeGripStyle.Hide;
00092             this.Name = "AboutBox";
00093             this.Text = "About";
00094             this.ResumeLayout(false);
00095         }
00096
00097         private void OkButton_Click(object sender, System.EventArgs e) {
00098             this.Close();
00099         }
00100
00101   }
00102 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlFilt.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

HtmlFilt.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       htmlfilt.cxx
00006 //
00007 //  Contents:   Html filter
00008 //
00009 //  Classes:    CHtmlIFilter
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <eh.h>
00017 #include <htmlfilt.hxx>
00018 #include <textelem.hxx>
00019 #include <proptag.hxx>
00020 #include <anchor.hxx>
00021 #include <inputtag.hxx>
00022 #include <start.hxx>
00023 #include <titletag.hxx>
00024 #include <imagetag.hxx>
00025 #include <metatag.hxx>
00026 #include <scriptag.hxx>
00027 #include <htmlguid.hxx>
00028 #include <ntquery.h>
00029 #include <limits.h>
00030 #include <regacc32.hxx>
00031
00032 DECLARE_INFOLEVEL(html)
00033
00034
00035 //+-------------------------------------------------------------------------
00036 //
00037 //  Method:     CHtmlIFilter::CHtmlIFilter
00038 //
00039 //  Synopsis:   Constructor
00040 //
00041 //--------------------------------------------------------------------------
00042
00043 CHtmlIFilter::CHtmlIFilter()
00044     : _pHtmlElement(0),
00045       _fNonHtmlFile(FALSE),
00046       _fFilterContent(FALSE),
00047       _fFilterMetaTag(FALSE),
00048       _fFilterScriptTag(FALSE),
00049       _cAttributes(0),
00050       _pAttributes(0),
00051       _pwszFileName(0),
00052       _ulChunkID(0),
00053       _locale(GetSystemDefaultLCID()),
00054       _htmlElementBag( COUNT_OF_HTML_ELEMENTS )
00055 {
00056     //
00057     // Setup various Html elements
00058     //
00059     _htmlElementBag.AddElement( TextToken, newk(mtNewX, NULL) CTextElement( *this, _serialStream ) );
00060
00061     _htmlElementBag.AddElement( StartOfFileToken, newk(mtNewX, NULL) CStartOfFileElement( *this, _serialStream ) );
00062
00063     CFullPropSpec psTitle( CLSID_SummaryInformation, PID_TITLE );
00064     _htmlElementBag.AddElement( TitleToken, newk(mtNewX, NULL) CTitleTag( *this,
00065                                                                           _serialStream,
00066                                                                           psTitle,
00067                                                                           TitleToken ) );
00068
00069     CFullPropSpec psHeading1( CLSID_HtmlInformation, PID_HEADING_1 );
00070     _htmlElementBag.AddElement( Heading1Token, newk(mtNewX, NULL) CPropertyTag( *this,
00071                                                                                 _serialStream,
00072                                                                                 psHeading1,
00073                                                                                 Heading1Token ) );
00074
00075     CFullPropSpec psHeading2( CLSID_HtmlInformation, PID_HEADING_2 );
00076     _htmlElementBag.AddElement( Heading2Token, newk(mtNewX, NULL) CPropertyTag( *this,
00077                                                                                 _serialStream,
00078                                                                                 psHeading2,
00079                                                                                 Heading2Token ) );
00080
00081     CFullPropSpec psHeading3( CLSID_HtmlInformation, PID_HEADING_3 );
00082     _htmlElementBag.AddElement( Heading3Token, newk(mtNewX, NULL) CPropertyTag( *this,
00083                                                                                 _serialStream,
00084                                                                                 psHeading3,
00085                                                                                 Heading3Token ) );
00086
00087     CFullPropSpec psHeading4( CLSID_HtmlInformation, PID_HEADING_4 );
00088     _htmlElementBag.AddElement( Heading4Token, newk(mtNewX, NULL) CPropertyTag( *this,
00089                                                                                 _serialStream,
00090                                                                                 psHeading4,
00091                                                                                 Heading4Token ) );
00092
00093     CFullPropSpec psHeading5( CLSID_HtmlInformation, PID_HEADING_5 );
00094     _htmlElementBag.AddElement( Heading5Token, newk(mtNewX, NULL) CPropertyTag( *this,
00095                                                                                 _serialStream,
00096                                                                                 psHeading5,
00097                                                                                 Heading5Token ) );
00098
00099     CFullPropSpec psHeading6( CLSID_HtmlInformation, PID_HEADING_6 );
00100     _htmlElementBag.AddElement( Heading6Token, newk(mtNewX, NULL) CPropertyTag( *this,
00101                                                                                 _serialStream,
00102                                                                                 psHeading6,
00103                                                                                 Heading6Token ) );
00104
00105     _htmlElementBag.AddElement( AnchorToken, newk(mtNewX, NULL) CAnchorTag( *this, _serialStream ) );
00106
00107     _htmlElementBag.AddElement( InputToken, newk(mtNewX, NULL) CInputTag( *this, _serialStream ) );
00108
00109     _htmlElementBag.AddElement( ImageToken, newk(mtNewX, NULL) CImageTag( *this, _serialStream ) );
00110
00111     //
00112     // Read classid of meta information from registry
00113     //
00114     const WCHAR *pszKey = L"system\\currentcontrolset\\control\\HtmlFilter";
00115     CRegAccess regMetaInfo( HKEY_LOCAL_MACHINE, pszKey );
00116
00117     const MAX_VALUE_LENGTH = 100;
00118     WCHAR wszValue[MAX_VALUE_LENGTH];
00119     _fFilterMetaTag = regMetaInfo.Get( L"MetaTagClsid", wszValue, MAX_VALUE_LENGTH );
00120
00121     if ( _fFilterMetaTag )
00122     {
00123         GUID ClsidMetaInformation;
00124
00125         StringToClsid( wszValue, ClsidMetaInformation );
00126         _htmlElementBag.AddElement( MetaToken, newk(mtNewX, NULL) CMetaTag( *this,
00127                                                                             _serialStream,
00128                                                                             ClsidMetaInformation ) );
00129     }
00130
00131     //
00132     // Read classid of scripts from registry
00133     //
00134     CRegAccess regScriptInfo( HKEY_LOCAL_MACHINE, pszKey );
00135
00136     _fFilterScriptTag = regScriptInfo.Get( L"ScriptTagClsid", wszValue, MAX_VALUE_LENGTH );
00137
00138     if ( _fFilterScriptTag )
00139     {
00140         GUID ClsidScriptInformation;
00141
00142         StringToClsid( wszValue, ClsidScriptInformation );
00143         _htmlElementBag.AddElement( ScriptToken, newk(mtNewX, NULL) CScriptTag( *this,
00144                                                                                 _serialStream,
00145                                                                                 ClsidScriptInformation ) );
00146     }
00147
00148     //
00149     // Set the start state to StartOfFile mode
00150     //
00151     _pHtmlElement = _htmlElementBag.QueryElement( StartOfFileToken );
00152 }
00153
00154 //+-------------------------------------------------------------------------
00155 //
00156 //  Method:     CHtmlIFilter::~CHtmlIFilter
00157 //
00158 //  Synopsis:   Destructor
00159 //
00160 //--------------------------------------------------------------------------
00161
00162 CHtmlIFilter::~CHtmlIFilter()
00163 {
00164     delete[] _pAttributes;
00165     delete[] _pwszFileName;
00166 }
00167
00168
00169 //+---------------------------------------------------------------------------
00170 //
00171 //  Member:     CHtmlIFilter::BindRegion
00172 //
00173 //  Synopsis:   Creates moniker or other interface for text indicated
00174 //
00175 //  Arguments:  [origPos] -- the region of text to be mapped to a moniker
00176 //              [riid]    -- Interface id
00177 //              [ppunk]   -- the interface
00178 //
00179 //----------------------------------------------------------------------------
00180
00181 SCODE STDMETHODCALLTYPE CHtmlIFilter::BindRegion( FILTERREGION origPos,
00182                                                   REFIID riid,
00183                                                   void ** ppunk )
00184 {
00185     return E_NOTIMPL;
00186 }
00187
00188 //+---------------------------------------------------------------------------
00189 //
00190 //  Member:     CHtmlIFilter::GetClassID, public
00191 //
00192 //  Synopsis:   Returns the class id of this class.
00193 //
00194 //  Arguments:  [pClassID] -- the class id
00195 //
00196 //----------------------------------------------------------------------------
00197
00198 SCODE STDMETHODCALLTYPE CHtmlIFilter::GetClassID( CLSID * pClassID )
00199 {
00200     *pClassID = CLSID_HtmlIFilter;
00201     return S_OK;
00202 }
00203
00204 //+---------------------------------------------------------------------------
00205 //
00206 //  Member:     CHtmlIFilter::IsDirty, public
00207 //
00208 //  Synopsis:   Always returns S_FALSE since the filter is read-only
00209 //
00210 //----------------------------------------------------------------------------
00211
00212 SCODE STDMETHODCALLTYPE CHtmlIFilter::IsDirty()
00213 {
00214     return S_FALSE;
00215 }
00216
00217 //+---------------------------------------------------------------------------
00218 //
00219 //  Member:     CHtmlIFilter::Load, public
00220 //
00221 //  Synopsis:   Loads the indicated file
00222 //
00223 //  Arguments:  [pszFileName] -- the file name
00224 //              [dwMode] -- the mode to load the file in
00225 //
00226 //----------------------------------------------------------------------------
00227
00228 SCODE STDMETHODCALLTYPE CHtmlIFilter::Load( LPCWSTR psszFileName, DWORD dwMode )
00229 {
00230     if ( _pwszFileName != 0 )
00231     {
00232         delete _pwszFileName;
00233         _pwszFileName = 0;
00234     }
00235
00236     _se_translator_function tf = _set_se_translator( SystemExceptionTranslator );
00237
00238     SCODE sc = S_OK;
00239     try
00240     {
00241         unsigned cLen = (unsigned) wcslen( psszFileName ) + 1;
00242         _pwszFileName = newk(mtNewX, NULL) WCHAR[cLen];
00243         wcscpy( _pwszFileName, psszFileName );
00244
00245         _fNonHtmlFile = IsNonHtmlFile();
00246     }
00247     catch( CException& e )
00248     {
00249         htmlDebugOut(( DEB_ERROR, "Exception 0x%x caught in CHtmlIFilter::Load", e.GetErrorCode() ));
00250
00251         sc = GetOleError( e );
00252     }
00253
00254     _set_se_translator( tf );
00255
00256     return sc;
00257 }
00258
00259 //+---------------------------------------------------------------------------
00260 //
00261 //  Member:     CHtmlIFilter::Save, public
00262 //
00263 //  Synopsis:   Always returns E_FAIL, since the file is opened read-only
00264 //
00265 //----------------------------------------------------------------------------
00266
00267 SCODE STDMETHODCALLTYPE CHtmlIFilter::Save( LPCWSTR pszFileName, BOOL fRemember )
00268 {
00269     return E_FAIL;
00270 }
00271
00272 //+---------------------------------------------------------------------------
00273 //
00274 //  Member:     CHtmlIFilter::SaveCompleted, public
00275 //
00276 //  Synopsis:   Always returns E_FAIL since the file is opened read-only
00277 //
00278 //----------------------------------------------------------------------------
00279
00280 SCODE STDMETHODCALLTYPE CHtmlIFilter::SaveCompleted( LPCWSTR pszFileName )
00281 {
00282     return E_FAIL;
00283 }
00284
00285 //+---------------------------------------------------------------------------
00286 //
00287 //  Member:     CHtmlIFilter::GetCurFile, public
00288 //
00289 //  Synopsis:   Returns a copy of the current file name
00290 //
00291 //  Arguments:  [ppszFileName] -- where the copied string is returned
00292 //
00293 //----------------------------------------------------------------------------
00294
00295 SCODE STDMETHODCALLTYPE CHtmlIFilter::GetCurFile( LPWSTR * ppwszFileName )
00296 {
00297     if ( _pwszFileName == 0 )
00298         return E_FAIL;
00299
00300     unsigned cLen = (unsigned) wcslen( _pwszFileName ) + 1;
00301     *ppwszFileName = (WCHAR *)CoTaskMemAlloc( cLen*sizeof(WCHAR) );
00302
00303     SCODE sc = S_OK;
00304     if ( *ppwszFileName )
00305         wcscpy( *ppwszFileName, _pwszFileName );
00306     else
00307         sc = E_OUTOFMEMORY;
00308
00309     return sc;
00310 }
00311
00312
00313
00314 //+-------------------------------------------------------------------------
00315 //
00316 //  Method:     CHtmlIFilter::Init
00317 //
00318 //  Synopsis:   Initializes instance of Html filter
00319 //
00320 //  Arguments:  [grfFlags] -- flags for filter behavior
00321 //              [cAttributes] -- number of attributes in array pAttributes
00322 //              [pAttributes] -- array of attributes
00323 //              [pFlags]      -- Set to 0 version 1
00324 //
00325 //--------------------------------------------------------------------------
00326
00327 SCODE STDMETHODCALLTYPE CHtmlIFilter::Init( ULONG grfFlags,
00328                                             ULONG cAttributes,
00329                                             FULLPROPSPEC const * pAttributes,
00330                                             ULONG * pFlags )
00331 {
00332     SCODE sc = S_OK;
00333
00334     *pFlags = 0;  // There are no OLE docfile properties for .htm files.
00335
00336     //
00337     // IE workaround, don't filter non-Html files such as .gif
00338     //
00339     if ( _fNonHtmlFile )
00340         return S_OK;
00341
00342     _se_translator_function tf = _set_se_translator( SystemExceptionTranslator );
00343
00344     try
00345     {
00346
00347
00348         _fFilterContent = FALSE;
00349
00350         if ( _cAttributes > 0 )
00351         {
00352             delete[] _pAttributes;
00353             _pAttributes = 0;
00354             _cAttributes = 0;
00355         }
00356
00357         if ( cAttributes > 0 )
00358         {
00359             //
00360             // Filter properties specified in pAttributes
00361             //
00362             _pAttributes = newk(mtNewX, NULL) CFullPropSpec[cAttributes];
00363             _cAttributes = cAttributes;
00364
00365             CFullPropSpec *pAttrib = (CFullPropSpec *) pAttributes;
00366
00367             for (unsigned i=0; i<cAttributes; i++)
00368             {
00369                 if ( pAttrib[i].IsPropertyPropid()
00370                      && pAttrib[i].GetPropertyPropid() == PID_STG_CONTENTS
00371                      && pAttrib[i].GetPropSet() == CLSID_Storage )
00372                 {
00373                     _fFilterContent = TRUE;
00374                 }
00375
00376                 _pAttributes[i] = pAttrib[i];
00377             }
00378         }
00379         else if ( grfFlags & IFILTER_INIT_APPLY_INDEX_ATTRIBUTES )
00380         {
00381             //
00382             // Filter contents and all pseudo-properties
00383             //
00384             _fFilterContent = TRUE;
00385
00386             const COUNT_ATTRIBUTES = 8;
00387             _pAttributes = newk(mtNewX, NULL) CFullPropSpec[COUNT_ATTRIBUTES];
00388             _cAttributes = COUNT_ATTRIBUTES;
00389
00390             _pAttributes[0].SetPropSet( CLSID_SummaryInformation );
00391             _pAttributes[0].SetProperty( PID_TITLE );
00392
00393             _pAttributes[1].SetPropSet( CLSID_HtmlInformation );
00394             _pAttributes[1].SetProperty( PID_HREF );
00395
00396             _pAttributes[2].SetPropSet( CLSID_HtmlInformation );
00397             _pAttributes[2].SetProperty( PID_HEADING_1 );
00398
00399             _pAttributes[3].SetPropSet( CLSID_HtmlInformation );
00400             _pAttributes[3].SetProperty( PID_HEADING_2 );
00401
00402             _pAttributes[4].SetPropSet( CLSID_HtmlInformation );
00403             _pAttributes[4].SetProperty( PID_HEADING_3 );
00404
00405             _pAttributes[5].SetPropSet( CLSID_HtmlInformation );
00406             _pAttributes[5].SetProperty( PID_HEADING_4 );
00407
00408             _pAttributes[6].SetPropSet( CLSID_HtmlInformation );
00409             _pAttributes[6].SetProperty( PID_HEADING_5 );
00410
00411             _pAttributes[7].SetPropSet( CLSID_HtmlInformation );
00412             _pAttributes[7].SetProperty( PID_HEADING_6 );
00413         }
00414         else if ( grfFlags == 0 )
00415         {
00416             //
00417             // Filter only contents
00418             //
00419             _fFilterContent = TRUE;
00420         }
00421
00422         _pHtmlElement = _htmlElementBag.QueryElement( StartOfFileToken );
00423         _ulChunkID = 0;
00424         _serialStream.Init( _pwszFileName );
00425     }
00426     catch( CException& e)
00427     {
00428         htmlDebugOut(( DEB_ERROR,
00429                        "Exception 0x%x caught in CHtmlIFilter::Init\n",
00430                        e.GetErrorCode() ));
00431         sc = GetOleError( e );
00432     }
00433
00434     _set_se_translator( tf );
00435
00436     return sc;
00437 }
00438
00439
00440
00441 //+-------------------------------------------------------------------------
00442 //
00443 //  Method:     CHtmlIFilter::ChangeState
00444 //
00445 //  Synopsis:   Change the current Html element and hence the parsing algorithm
00446 //
00447 //  Arguments:  [pHtmlElemNewState]  -- New Html element to change to
00448 //
00449 //--------------------------------------------------------------------------
00450
00451 void CHtmlIFilter::ChangeState( CHtmlElement *pHtmlElemNewState )
00452 {
00453     _pHtmlElement = pHtmlElemNewState;
00454 }
00455
00456
00457 //+-------------------------------------------------------------------------
00458 //
00459 //  Method:     CHtmlIFilter::QueryElement
00460 //
00461 //  Synopsis:   Return HtmlElement corresponding to given token type
00462 //
00463 //  Arguments:  [eTokenType]  -- token type
00464 //
00465 //--------------------------------------------------------------------------
00466
00467 CHtmlElement *CHtmlIFilter::QueryHtmlElement( HtmlTokenType eTokType )
00468 {
00469     return _htmlElementBag.QueryElement( eTokType );
00470 }
00471
00472
00473
00474 //+-------------------------------------------------------------------------
00475 //
00476 //  Method:     CHtmlIFilter::GetNextChunkId
00477 //
00478 //  Synopsis:   Return a brand new chunk id
00479 //
00480 //--------------------------------------------------------------------------
00481
00482 ULONG CHtmlIFilter::GetNextChunkId()
00483 {
00484     Win4Assert( _ulChunkID != ULONG_MAX );
00485
00486     return ++_ulChunkID;
00487 }
00488
00489
00490
00491
00492 //+-------------------------------------------------------------------------
00493 //
00494 //  Method:     CHtmlIFilter::GetChunk
00495 //
00496 //  Synopsis:   Gets the next chunk and returns chunk information in ppStat
00497 //
00498 //  Arguments:  [pStat] -- chunk information returned here
00499 //
00500 //--------------------------------------------------------------------------
00501
00502 SCODE STDMETHODCALLTYPE CHtmlIFilter::GetChunk( STAT_CHUNK * pStat )
00503 {
00504     //
00505     // IE workaround, don't filter non-Html files such as .gif
00506     //
00507     if ( _fNonHtmlFile )
00508         return FILTER_E_END_OF_CHUNKS;
00509
00510     SCODE sc = S_OK;
00511
00512     _se_translator_function tf = _set_se_translator( SystemExceptionTranslator );
00513
00514     try
00515     {
00516         sc = _pHtmlElement->GetChunk( pStat );
00517     }
00518     catch( CException& e )
00519     {
00520         htmlDebugOut(( DEB_ERROR,
00521                        "Caught exception 0x%x in CHtmlIFilter::GetChunk\n",
00522                        e.GetErrorCode() ));
00523
00524         sc = GetOleError( e );
00525     }
00526
00527     _set_se_translator( tf );
00528
00529     return sc;
00530 }
00531
00532
00533
00534
00535 //+-------------------------------------------------------------------------
00536 //
00537 //  Method:     CHtmlIFilter::GetText
00538 //
00539 //  Synopsis:   Retrieves text from current chunk
00540 //
00541 //  Arguments:  [pcwcOutput] -- count of UniCode characters in buffer
00542 //              [awcBuffer]  -- buffer for text
00543 //
00544 //--------------------------------------------------------------------------
00545
00546 SCODE STDMETHODCALLTYPE CHtmlIFilter::GetText( ULONG * pcwcOutput, WCHAR * awcOutput )
00547 {
00548     //
00549     // IE workaround, don't filter non-Html files such as .gif
00550     //
00551     if ( _fNonHtmlFile )
00552         return FILTER_E_NO_TEXT;
00553
00554     SCODE sc = S_OK;
00555
00556     _se_translator_function tf = _set_se_translator( SystemExceptionTranslator );
00557
00558     try
00559     {
00560         sc = _pHtmlElement->GetText( pcwcOutput, awcOutput );
00561     }
00562     catch( CException& e )
00563     {
00564         htmlDebugOut(( DEB_ERROR,
00565                        "Caught exception 0x%x in CHtmlIFilter::GetText\n",
00566                        e.GetErrorCode() ));
00567
00568         sc = GetOleError( e );
00569     }
00570
00571     _set_se_translator( tf );
00572
00573     return sc;
00574 }
00575
00576
00577 //+---------------------------------------------------------------------------
00578 //
00579 //  Member:     CHtmlIFilter::GetValue
00580 //
00581 //  Synopsis:   Retrieves value from current chunk
00582 //
00583 //----------------------------------------------------------------------------
00584
00585 SCODE STDMETHODCALLTYPE CHtmlIFilter::GetValue( PROPVARIANT ** ppPropValue )
00586 {
00587     //
00588     // IE workaround, don't filter non-Html files such as .gif
00589     //
00590     if ( _fNonHtmlFile )
00591         return FILTER_E_NO_VALUES;
00592
00593     SCODE sc = S_OK;
00594
00595     _se_translator_function tf = _set_se_translator( SystemExceptionTranslator );
00596
00597     try
00598     {
00599         sc = _pHtmlElement->GetValue( ppPropValue );
00600     }
00601     catch( CException& e )
00602     {
00603         htmlDebugOut(( DEB_ERROR,
00604                        "Caught exception 0x%x in CHtmlIFilter::GetValue\n",
00605                        e.GetErrorCode() ));
00606
00607         sc = GetOleError( e );
00608     }
00609
00610     _set_se_translator( tf );
00611
00612     return sc;
00613 }
00614
00615
00616 //+-------------------------------------------------------------------------
00617 //
00618 //  Method:     CHtmlIFilter::IsStopToken
00619 //
00620 //  Synopsis:   Check if given token is a token that should stop further
00621 //              scanning
00622 //
00623 //  Arguments:  [token]  -- Given token
00624 //
00625 //--------------------------------------------------------------------------
00626
00627 BOOL CHtmlIFilter::IsStopToken( CToken& token )
00628 {
00629     HtmlTokenType tokType = token.GetTokenType();
00630     if ( ( tokType == InputToken || tokType == ImageToken )  && _fFilterContent
00631          || tokType == MetaToken && _fFilterMetaTag
00632          || tokType == ScriptToken && _fFilterScriptTag )
00633     {
00634         return TRUE;
00635     }
00636
00637     if ( token.GetTokenType() == GenericToken
00638          || token.GetTokenType() == BreakToken )
00639         return FALSE;
00640
00641     for ( unsigned i=0; i<_cAttributes; i++ )
00642     {
00643         if ( token.IsMatchProperty( _pAttributes[i] ) )
00644             return TRUE;
00645     }
00646
00647     return FALSE;
00648 }
00649
00650
00651
00652 //+-------------------------------------------------------------------------
00653 //
00654 //  Method:     CHtmlIFilter::IsNonHtmlFile
00655 //
00656 //  Synopsis:   Check if file being filtered has an extension such as .gif,
00657 //              which means that the file is not an Html file
00658 //
00659 //--------------------------------------------------------------------------
00660
00661 BOOL CHtmlIFilter::IsNonHtmlFile()
00662 {
00663     WCHAR *pwszExtension = 0;
00664
00665     for ( int i=(int) ( wcslen(_pwszFileName)-1); i>=0; i-- )
00666     {
00667         if ( _pwszFileName[i] == L'.' )
00668         {
00669             pwszExtension = &_pwszFileName[i+1];
00670             break;
00671         }
00672     }
00673
00674     //
00675     // No extension, then assume it's an html file
00676     //
00677     if ( 0 == pwszExtension )
00678         return FALSE;
00679
00680     switch( pwszExtension[0] )
00681     {
00682     case L'a':
00683     case L'A':
00684         if ( _wcsicmp( pwszExtension, L"aif" ) == 0
00685              || _wcsicmp( pwszExtension, L"aifc" ) == 0
00686              || _wcsicmp( pwszExtension, L"aiff" ) == 0
00687              || _wcsicmp( pwszExtension, L"au" ) == 0 )
00688         {
00689             return TRUE;
00690         }
00691
00692         break;
00693
00694     case L'g':
00695     case L'G':
00696         if ( _wcsicmp( pwszExtension, L"gif" ) == 0 )
00697             return TRUE;
00698
00699         break;
00700
00701     case L'j':
00702     case L'J':
00703         if ( _wcsicmp( pwszExtension, L"jfif" ) == 0
00704              || _wcsicmp( pwszExtension, L"jpe" ) == 0
00705              || _wcsicmp( pwszExtension, L"jpeg" ) == 0
00706              || _wcsicmp( pwszExtension, L"jpg" ) == 0 )
00707         {
00708             return TRUE;
00709         }
00710
00711         break;
00712
00713     case L's':
00714     case L'S':
00715         if ( _wcsicmp( pwszExtension, L"snd" ) == 0 )
00716             return TRUE;
00717
00718         break;
00719
00720     case L'x':
00721     case L'X':
00722         if ( _wcsicmp( pwszExtension, L"xbm" ) == 0 )
00723             return TRUE;
00724
00725         break;
00726
00727     default:
00728         return FALSE;
00729     }
00730
00731     return FALSE;
00732 }
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/StdAfx.h Source File

  • NetDS
  • fax
  • PrintSdi

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__55689545_8B6C_11D1_B7AE_000000000000__INCLUDED_)
00007 #define AFX_STDAFX_H__55689545_8B6C_11D1_B7AE_000000000000__INCLUDED_
00008
00009 #if _MSC_VER >= 1000
00010 #pragma once
00011 #endif // _MSC_VER >= 1000
00012
00013 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00014
00015 #include <afxwin.h>         // MFC core and standard components
00016 #include <afxext.h>         // MFC extensions
00017 #include <afxdisp.h>        // MFC OLE automation classes
00018 #ifndef _AFX_NO_AFXCMN_SUPPORT
00019 #include <afxcmn.h>     // MFC support for Windows Common Controls
00020 #endif // _AFX_NO_AFXCMN_SUPPORT
00021
00022
00023 //{{AFX_INSERT_LOCATION}}
00024 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00025
00026 #endif // !defined(AFX_STDAFX_H__55689545_8B6C_11D1_B7AE_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/ADOVCGEN/datagrid.cpp Source File

  • Dataaccess
  • ADO
  • ADOVCGEN

datagrid.cpp

Go to the documentation of this file.
00001 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00002
00003 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00004 //  Microsoft Visual C++, your modifications will be overwritten.
00005
00006
00007 #include "stdafx.h"
00008 #include "datagrid.h"
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CDataGrid
00012
00013 IMPLEMENT_DYNCREATE(CDataGrid, CWnd)
00014
00015 /////////////////////////////////////////////////////////////////////////////
00016 // CDataGrid properties
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CDataGrid operations
00020
00021 long CDataGrid::GetAddNewMode()
00022 {
00023   long result;
00024   InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00025   return result;
00026 }
00027
00028 BOOL CDataGrid::GetAllowAddNew()
00029 {
00030   BOOL result;
00031   InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00032   return result;
00033 }
00034
00035 void CDataGrid::SetAllowAddNew(BOOL bNewValue)
00036 {
00037   static BYTE parms[] =
00038     VTS_BOOL;
00039   InvokeHelper(0x2, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00040      bNewValue);
00041 }
00042
00043 BOOL CDataGrid::GetAllowArrows()
00044 {
00045   BOOL result;
00046   InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00047   return result;
00048 }
00049
00050 void CDataGrid::SetAllowArrows(BOOL bNewValue)
00051 {
00052   static BYTE parms[] =
00053     VTS_BOOL;
00054   InvokeHelper(0x3, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00055      bNewValue);
00056 }
00057
00058 BOOL CDataGrid::GetAllowDelete()
00059 {
00060   BOOL result;
00061   InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00062   return result;
00063 }
00064
00065 void CDataGrid::SetAllowDelete(BOOL bNewValue)
00066 {
00067   static BYTE parms[] =
00068     VTS_BOOL;
00069   InvokeHelper(0x4, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00070      bNewValue);
00071 }
00072
00073 BOOL CDataGrid::GetAllowRowSizing()
00074 {
00075   BOOL result;
00076   InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00077   return result;
00078 }
00079
00080 void CDataGrid::SetAllowRowSizing(BOOL bNewValue)
00081 {
00082   static BYTE parms[] =
00083     VTS_BOOL;
00084   InvokeHelper(0x5, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00085      bNewValue);
00086 }
00087
00088 BOOL CDataGrid::GetAllowUpdate()
00089 {
00090   BOOL result;
00091   InvokeHelper(0x6, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00092   return result;
00093 }
00094
00095 void CDataGrid::SetAllowUpdate(BOOL bNewValue)
00096 {
00097   static BYTE parms[] =
00098     VTS_BOOL;
00099   InvokeHelper(0x6, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00100      bNewValue);
00101 }
00102
00103 long CDataGrid::GetAppearance()
00104 {
00105   long result;
00106   InvokeHelper(DISPID_APPEARANCE, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00107   return result;
00108 }
00109
00110 void CDataGrid::SetAppearance(long nNewValue)
00111 {
00112   static BYTE parms[] =
00113     VTS_I4;
00114   InvokeHelper(DISPID_APPEARANCE, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00115      nNewValue);
00116 }
00117
00118 long CDataGrid::GetApproxCount()
00119 {
00120   long result;
00121   InvokeHelper(0x8, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00122   return result;
00123 }
00124
00125 unsigned long CDataGrid::GetBackColor()
00126 {
00127   unsigned long result;
00128   InvokeHelper(DISPID_BACKCOLOR, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00129   return result;
00130 }
00131
00132 void CDataGrid::SetBackColor(unsigned long newValue)
00133 {
00134   static BYTE parms[] =
00135     VTS_I4;
00136   InvokeHelper(DISPID_BACKCOLOR, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00137      newValue);
00138 }
00139
00140 VARIANT CDataGrid::GetBookmark()
00141 {
00142   VARIANT result;
00143   InvokeHelper(0x9, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&result, NULL);
00144   return result;
00145 }
00146
00147 void CDataGrid::SetBookmark(const VARIANT& newValue)
00148 {
00149   static BYTE parms[] =
00150     VTS_VARIANT;
00151   InvokeHelper(0x9, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00152      &newValue);
00153 }
00154
00155 long CDataGrid::GetBorderStyle()
00156 {
00157   long result;
00158   InvokeHelper(DISPID_BORDERSTYLE, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00159   return result;
00160 }
00161
00162 void CDataGrid::SetBorderStyle(long nNewValue)
00163 {
00164   static BYTE parms[] =
00165     VTS_I4;
00166   InvokeHelper(DISPID_BORDERSTYLE, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00167      nNewValue);
00168 }
00169
00170 CString CDataGrid::GetCaption()
00171 {
00172   CString result;
00173   InvokeHelper(DISPID_CAPTION, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00174   return result;
00175 }
00176
00177 void CDataGrid::SetCaption(LPCTSTR lpszNewValue)
00178 {
00179   static BYTE parms[] =
00180     VTS_BSTR;
00181   InvokeHelper(DISPID_CAPTION, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00182      lpszNewValue);
00183 }
00184
00185 short CDataGrid::GetCol()
00186 {
00187   short result;
00188   InvokeHelper(0xa, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00189   return result;
00190 }
00191
00192 void CDataGrid::SetCol(short nNewValue)
00193 {
00194   static BYTE parms[] =
00195     VTS_I2;
00196   InvokeHelper(0xa, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00197      nNewValue);
00198 }
00199
00200 BOOL CDataGrid::GetColumnHeaders()
00201 {
00202   BOOL result;
00203   InvokeHelper(0xb, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00204   return result;
00205 }
00206
00207 void CDataGrid::SetColumnHeaders(BOOL bNewValue)
00208 {
00209   static BYTE parms[] =
00210     VTS_BOOL;
00211   InvokeHelper(0xb, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00212      bNewValue);
00213 }
00214
00215 BOOL CDataGrid::GetCurrentCellModified()
00216 {
00217   BOOL result;
00218   InvokeHelper(0xc, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00219   return result;
00220 }
00221
00222 void CDataGrid::SetCurrentCellModified(BOOL bNewValue)
00223 {
00224   static BYTE parms[] =
00225     VTS_BOOL;
00226   InvokeHelper(0xc, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00227      bNewValue);
00228 }
00229
00230 BOOL CDataGrid::GetCurrentCellVisible()
00231 {
00232   BOOL result;
00233   InvokeHelper(0xd, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00234   return result;
00235 }
00236
00237 void CDataGrid::SetCurrentCellVisible(BOOL bNewValue)
00238 {
00239   static BYTE parms[] =
00240     VTS_BOOL;
00241   InvokeHelper(0xd, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00242      bNewValue);
00243 }
00244
00245 BOOL CDataGrid::GetDataChanged()
00246 {
00247   BOOL result;
00248   InvokeHelper(0xe, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00249   return result;
00250 }
00251
00252 void CDataGrid::SetDataChanged(BOOL bNewValue)
00253 {
00254   static BYTE parms[] =
00255     VTS_BOOL;
00256   InvokeHelper(0xe, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00257      bNewValue);
00258 }
00259
00260 LPUNKNOWN CDataGrid::GetDataSource()
00261 {
00262   LPUNKNOWN result;
00263   InvokeHelper(0x2a, DISPATCH_PROPERTYGET, VT_UNKNOWN, (void*)&result, NULL);
00264   return result;
00265 }
00266
00267 void CDataGrid::SetRefDataSource(LPUNKNOWN newValue)
00268 {
00269   static BYTE parms[] =
00270     VTS_UNKNOWN;
00271   InvokeHelper(0x2a, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
00272      newValue);
00273 }
00274
00275 CString CDataGrid::GetDataMember()
00276 {
00277   CString result;
00278   InvokeHelper(0x2b, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00279   return result;
00280 }
00281
00282 void CDataGrid::SetDataMember(LPCTSTR lpszNewValue)
00283 {
00284   static BYTE parms[] =
00285     VTS_BSTR;
00286   InvokeHelper(0x2b, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00287      lpszNewValue);
00288 }
00289
00290 float CDataGrid::GetDefColWidth()
00291 {
00292   float result;
00293   InvokeHelper(0x10, DISPATCH_PROPERTYGET, VT_R4, (void*)&result, NULL);
00294   return result;
00295 }
00296
00297 void CDataGrid::SetDefColWidth(float newValue)
00298 {
00299   static BYTE parms[] =
00300     VTS_R4;
00301   InvokeHelper(0x10, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00302      newValue);
00303 }
00304
00305 BOOL CDataGrid::GetEditActive()
00306 {
00307   BOOL result;
00308   InvokeHelper(0x11, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00309   return result;
00310 }
00311
00312 void CDataGrid::SetEditActive(BOOL bNewValue)
00313 {
00314   static BYTE parms[] =
00315     VTS_BOOL;
00316   InvokeHelper(0x11, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00317      bNewValue);
00318 }
00319
00320 BOOL CDataGrid::GetEnabled()
00321 {
00322   BOOL result;
00323   InvokeHelper(DISPID_ENABLED, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00324   return result;
00325 }
00326
00327 void CDataGrid::SetEnabled(BOOL bNewValue)
00328 {
00329   static BYTE parms[] =
00330     VTS_BOOL;
00331   InvokeHelper(DISPID_ENABLED, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00332      bNewValue);
00333 }
00334
00335 CString CDataGrid::GetErrorText()
00336 {
00337   CString result;
00338   InvokeHelper(0x12, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00339   return result;
00340 }
00341
00342 LPDISPATCH CDataGrid::GetFont()
00343 {
00344   LPDISPATCH result;
00345   InvokeHelper(DISPID_FONT, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
00346   return result;
00347 }
00348
00349 void CDataGrid::SetRefFont(LPDISPATCH newValue)
00350 {
00351   static BYTE parms[] =
00352     VTS_DISPATCH;
00353   InvokeHelper(DISPID_FONT, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
00354      newValue);
00355 }
00356
00357 unsigned long CDataGrid::GetForeColor()
00358 {
00359   unsigned long result;
00360   InvokeHelper(DISPID_FORECOLOR, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00361   return result;
00362 }
00363
00364 void CDataGrid::SetForeColor(unsigned long newValue)
00365 {
00366   static BYTE parms[] =
00367     VTS_I4;
00368   InvokeHelper(DISPID_FORECOLOR, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00369      newValue);
00370 }
00371
00372 VARIANT CDataGrid::GetFirstRow()
00373 {
00374   VARIANT result;
00375   InvokeHelper(0x13, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&result, NULL);
00376   return result;
00377 }
00378
00379 void CDataGrid::SetFirstRow(const VARIANT& newValue)
00380 {
00381   static BYTE parms[] =
00382     VTS_VARIANT;
00383   InvokeHelper(0x13, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00384      &newValue);
00385 }
00386
00387 LPDISPATCH CDataGrid::GetHeadFont()
00388 {
00389   LPDISPATCH result;
00390   InvokeHelper(0x14, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
00391   return result;
00392 }
00393
00394 void CDataGrid::SetRefHeadFont(LPDISPATCH newValue)
00395 {
00396   static BYTE parms[] =
00397     VTS_DISPATCH;
00398   InvokeHelper(0x14, DISPATCH_PROPERTYPUTREF, VT_EMPTY, NULL, parms,
00399      newValue);
00400 }
00401
00402 float CDataGrid::GetHeadLines()
00403 {
00404   float result;
00405   InvokeHelper(0x15, DISPATCH_PROPERTYGET, VT_R4, (void*)&result, NULL);
00406   return result;
00407 }
00408
00409 void CDataGrid::SetHeadLines(float newValue)
00410 {
00411   static BYTE parms[] =
00412     VTS_R4;
00413   InvokeHelper(0x15, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00414      newValue);
00415 }
00416
00417 long CDataGrid::GetHWnd()
00418 {
00419   long result;
00420   InvokeHelper(DISPID_HWND, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00421   return result;
00422 }
00423
00424 long CDataGrid::GetHWndEditor()
00425 {
00426   long result;
00427   InvokeHelper(0x16, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00428   return result;
00429 }
00430
00431 short CDataGrid::GetLeftCol()
00432 {
00433   short result;
00434   InvokeHelper(0x17, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00435   return result;
00436 }
00437
00438 void CDataGrid::SetLeftCol(short nNewValue)
00439 {
00440   static BYTE parms[] =
00441     VTS_I2;
00442   InvokeHelper(0x17, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00443      nNewValue);
00444 }
00445
00446 long CDataGrid::GetMarqueeStyle()
00447 {
00448   long result;
00449   InvokeHelper(0x19, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00450   return result;
00451 }
00452
00453 void CDataGrid::SetMarqueeStyle(long nNewValue)
00454 {
00455   static BYTE parms[] =
00456     VTS_I4;
00457   InvokeHelper(0x19, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00458      nNewValue);
00459 }
00460
00461 BOOL CDataGrid::GetRecordSelectors()
00462 {
00463   BOOL result;
00464   InvokeHelper(0x1a, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00465   return result;
00466 }
00467
00468 void CDataGrid::SetRecordSelectors(BOOL bNewValue)
00469 {
00470   static BYTE parms[] =
00471     VTS_BOOL;
00472   InvokeHelper(0x1a, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00473      bNewValue);
00474 }
00475
00476 BOOL CDataGrid::GetRightToLeft()
00477 {
00478   BOOL result;
00479   InvokeHelper(0xfffffd9d, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00480   return result;
00481 }
00482
00483 void CDataGrid::SetRightToLeft(BOOL bNewValue)
00484 {
00485   static BYTE parms[] =
00486     VTS_BOOL;
00487   InvokeHelper(0xfffffd9d, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00488      bNewValue);
00489 }
00490
00491 short CDataGrid::GetRow()
00492 {
00493   short result;
00494   InvokeHelper(0x1b, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00495   return result;
00496 }
00497
00498 void CDataGrid::SetRow(short nNewValue)
00499 {
00500   static BYTE parms[] =
00501     VTS_I2;
00502   InvokeHelper(0x1b, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00503      nNewValue);
00504 }
00505
00506 long CDataGrid::GetRowDividerStyle()
00507 {
00508   long result;
00509   InvokeHelper(0x1c, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00510   return result;
00511 }
00512
00513 void CDataGrid::SetRowDividerStyle(long nNewValue)
00514 {
00515   static BYTE parms[] =
00516     VTS_I4;
00517   InvokeHelper(0x1c, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00518      nNewValue);
00519 }
00520
00521 float CDataGrid::GetRowHeight()
00522 {
00523   float result;
00524   InvokeHelper(0x1d, DISPATCH_PROPERTYGET, VT_R4, (void*)&result, NULL);
00525   return result;
00526 }
00527
00528 void CDataGrid::SetRowHeight(float newValue)
00529 {
00530   static BYTE parms[] =
00531     VTS_R4;
00532   InvokeHelper(0x1d, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00533      newValue);
00534 }
00535
00536 long CDataGrid::GetScrollBars()
00537 {
00538   long result;
00539   InvokeHelper(0xfffffde9, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00540   return result;
00541 }
00542
00543 void CDataGrid::SetScrollBars(long nNewValue)
00544 {
00545   static BYTE parms[] =
00546     VTS_I4;
00547   InvokeHelper(0xfffffde9, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00548      nNewValue);
00549 }
00550
00551 short CDataGrid::GetSelEndCol()
00552 {
00553   short result;
00554   InvokeHelper(0x1f, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00555   return result;
00556 }
00557
00558 void CDataGrid::SetSelEndCol(short nNewValue)
00559 {
00560   static BYTE parms[] =
00561     VTS_I2;
00562   InvokeHelper(0x1f, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00563      nNewValue);
00564 }
00565
00566 long CDataGrid::GetSelLength()
00567 {
00568   long result;
00569   InvokeHelper(0xfffffddc, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00570   return result;
00571 }
00572
00573 void CDataGrid::SetSelLength(long nNewValue)
00574 {
00575   static BYTE parms[] =
00576     VTS_I4;
00577   InvokeHelper(0xfffffddc, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00578      nNewValue);
00579 }
00580
00581 long CDataGrid::GetSelStart()
00582 {
00583   long result;
00584   InvokeHelper(0xfffffddd, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00585   return result;
00586 }
00587
00588 void CDataGrid::SetSelStart(long nNewValue)
00589 {
00590   static BYTE parms[] =
00591     VTS_I4;
00592   InvokeHelper(0xfffffddd, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00593      nNewValue);
00594 }
00595
00596 short CDataGrid::GetSelStartCol()
00597 {
00598   short result;
00599   InvokeHelper(0x22, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00600   return result;
00601 }
00602
00603 void CDataGrid::SetSelStartCol(short nNewValue)
00604 {
00605   static BYTE parms[] =
00606     VTS_I2;
00607   InvokeHelper(0x22, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00608      nNewValue);
00609 }
00610
00611 CString CDataGrid::GetSelText()
00612 {
00613   CString result;
00614   InvokeHelper(0xfffffdde, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00615   return result;
00616 }
00617
00618 void CDataGrid::SetSelText(LPCTSTR lpszNewValue)
00619 {
00620   static BYTE parms[] =
00621     VTS_BSTR;
00622   InvokeHelper(0xfffffdde, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00623      lpszNewValue);
00624 }
00625
00626 short CDataGrid::GetSplit()
00627 {
00628   short result;
00629   InvokeHelper(0x24, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00630   return result;
00631 }
00632
00633 void CDataGrid::SetSplit(short nNewValue)
00634 {
00635   static BYTE parms[] =
00636     VTS_I2;
00637   InvokeHelper(0x24, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00638      nNewValue);
00639 }
00640
00641 BOOL CDataGrid::GetTabAcrossSplits()
00642 {
00643   BOOL result;
00644   InvokeHelper(0x25, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00645   return result;
00646 }
00647
00648 void CDataGrid::SetTabAcrossSplits(BOOL bNewValue)
00649 {
00650   static BYTE parms[] =
00651     VTS_BOOL;
00652   InvokeHelper(0x25, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00653      bNewValue);
00654 }
00655
00656 long CDataGrid::GetTabAction()
00657 {
00658   long result;
00659   InvokeHelper(0x26, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL);
00660   return result;
00661 }
00662
00663 void CDataGrid::SetTabAction(long nNewValue)
00664 {
00665   static BYTE parms[] =
00666     VTS_I4;
00667   InvokeHelper(0x26, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00668      nNewValue);
00669 }
00670
00671 CString CDataGrid::GetText()
00672 {
00673   CString result;
00674   InvokeHelper(0x0, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL);
00675   return result;
00676 }
00677
00678 void CDataGrid::SetText(LPCTSTR lpszNewValue)
00679 {
00680   static BYTE parms[] =
00681     VTS_BSTR;
00682   InvokeHelper(0x0, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00683      lpszNewValue);
00684 }
00685
00686 short CDataGrid::GetVisibleCols()
00687 {
00688   short result;
00689   InvokeHelper(0x27, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00690   return result;
00691 }
00692
00693 short CDataGrid::GetVisibleRows()
00694 {
00695   short result;
00696   InvokeHelper(0x28, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
00697   return result;
00698 }
00699
00700 BOOL CDataGrid::GetWrapCellPointer()
00701 {
00702   BOOL result;
00703   InvokeHelper(0x29, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL);
00704   return result;
00705 }
00706
00707 void CDataGrid::SetWrapCellPointer(BOOL bNewValue)
00708 {
00709   static BYTE parms[] =
00710     VTS_BOOL;
00711   InvokeHelper(0x29, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
00712      bNewValue);
00713 }
00714
00715 LPDISPATCH CDataGrid::GetDataFormats()
00716 {
00717   LPDISPATCH result;
00718   InvokeHelper(0x2c, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
00719   return result;
00720 }
00721
00722 LPDISPATCH CDataGrid::CaptureImage()
00723 {
00724   LPDISPATCH result;
00725   InvokeHelper(0x65, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, NULL);
00726   return result;
00727 }
00728
00729 void CDataGrid::ClearSelCols()
00730 {
00731   InvokeHelper(0x66, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
00732 }
00733
00734 void CDataGrid::ClearFields()
00735 {
00736   InvokeHelper(0x67, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
00737 }
00738
00739 short CDataGrid::ColContaining(float X)
00740 {
00741   short result;
00742   static BYTE parms[] =
00743     VTS_R4;
00744   InvokeHelper(0x68, DISPATCH_METHOD, VT_I2, (void*)&result, parms,
00745     X);
00746   return result;
00747 }
00748
00749 LPDISPATCH CDataGrid::GetColumns()
00750 {
00751   LPDISPATCH result;
00752   InvokeHelper(0x69, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
00753   return result;
00754 }
00755
00756 VARIANT CDataGrid::GetBookmark(long RowNum)
00757 {
00758   VARIANT result;
00759   static BYTE parms[] =
00760     VTS_I4;
00761   InvokeHelper(0x6a, DISPATCH_METHOD, VT_VARIANT, (void*)&result, parms,
00762     RowNum);
00763   return result;
00764 }
00765
00766 void CDataGrid::HoldFields()
00767 {
00768   InvokeHelper(0x6b, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
00769 }
00770
00771 void CDataGrid::ReBind()
00772 {
00773   InvokeHelper(0x6c, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
00774 }
00775
00776 void CDataGrid::Refresh()
00777 {
00778   InvokeHelper(DISPID_REFRESH, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
00779 }
00780
00781 VARIANT CDataGrid::RowBookmark(short RowNum)
00782 {
00783   VARIANT result;
00784   static BYTE parms[] =
00785     VTS_I2;
00786   InvokeHelper(0x6d, DISPATCH_METHOD, VT_VARIANT, (void*)&result, parms,
00787     RowNum);
00788   return result;
00789 }
00790
00791 short CDataGrid::RowContaining(float Y)
00792 {
00793   short result;
00794   static BYTE parms[] =
00795     VTS_R4;
00796   InvokeHelper(0x6e, DISPATCH_METHOD, VT_I2, (void*)&result, parms,
00797     Y);
00798   return result;
00799 }
00800
00801 float CDataGrid::RowTop(short RowNum)
00802 {
00803   float result;
00804   static BYTE parms[] =
00805     VTS_I2;
00806   InvokeHelper(0x6f, DISPATCH_METHOD, VT_R4, (void*)&result, parms,
00807     RowNum);
00808   return result;
00809 }
00810
00811 void CDataGrid::Scroll(long Cols, long Rows)
00812 {
00813   static BYTE parms[] =
00814     VTS_I4 VTS_I4;
00815   InvokeHelper(0xdc, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
00816      Cols, Rows);
00817 }
00818
00819 LPDISPATCH CDataGrid::GetSelBookmarks()
00820 {
00821   LPDISPATCH result;
00822   InvokeHelper(0x71, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
00823   return result;
00824 }
00825
00826 short CDataGrid::SplitContaining(float X, float Y)
00827 {
00828   short result;
00829   static BYTE parms[] =
00830     VTS_R4 VTS_R4;
00831   InvokeHelper(0x72, DISPATCH_METHOD, VT_I2, (void*)&result, parms,
00832     X, Y);
00833   return result;
00834 }
00835
00836 LPDISPATCH CDataGrid::GetSplits()
00837 {
00838   LPDISPATCH result;
00839   InvokeHelper(0x73, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL);
00840   return result;
00841 }
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_RASHOST_DATA Member List

This is the complete list of members for _RASHOST_DATA, including all inherited members.
Buffer | _RASHOST_DATA
dwSize | _RASHOST_DATA
szUserDomain | _RASHOST_DATA
szUserName | _RASHOST_DATA
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLERK_ENTRY Member List

This is the complete list of members for CLERK_ENTRY, including all inherited members.
m_pICrmMonitorLogRecords | CLERK_ENTRY
m_vIndex | CLERK_ENTRY
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTSFPersistentPropertyLoader Member List

This is the complete list of members for CTSFPersistentPropertyLoader, including all inherited members.
CTSFPersistentPropertyLoader(TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr, IStream *pStream) | CTSFPersistentPropertyLoader |
LoadProperty(const TF_PERSISTENT_PROPERTY_HEADER_ACP *pHdr, IStream **ppStream) | CTSFPersistentPropertyLoader |
m_hdr | CTSFPersistentPropertyLoader | [private]
m_ObjRefCount | CTSFPersistentPropertyLoader | [private]
m_pb | CTSFPersistentPropertyLoader | [private]
QueryInterface(REFIID riid, void **ppvObj) | CTSFPersistentPropertyLoader | [virtual]
STDMETHODIMP_(ULONG) AddRef(void) | CTSFPersistentPropertyLoader | [virtual]
STDMETHODIMP_(ULONG) Release(void) | CTSFPersistentPropertyLoader | [virtual]
~CTSFPersistentPropertyLoader() | CTSFPersistentPropertyLoader |
Generated on Wed Nov 13 2024 16:57:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/STAObject/Resource.h Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • STAObject

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by STAObject.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_STATEST                     101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        202
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSurrogate Member List

This is the complete list of members for CSurrogate, including all inherited members.
CSurrogate() | CSurrogate | [inline]
FreeSurrogate() | CSurrogate |
LoadDllServer(REFCLSID rclsid) | CSurrogate |
m_stkClassFactories | CSurrogate | [private]
QueryInterface(REFIID iid, LPVOID *ppv) | CSurrogate |
STDMETHOD_(ULONG, AddRef)() | CSurrogate |
STDMETHOD_(ULONG, Release)() | CSurrogate |
~CSurrogate() | CSurrogate | [inline, virtual]
Generated on Wed Nov 13 2024 16:57:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/InstProv/ClassFac.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • InstProv

ClassFac.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  CLASSFAC.CPP
00006
00007 //
00008
00009 //  Module: WMI Instance provider sample code
00010
00011 //
00012
00013 //  Purpose: Contains the class factory.  This creates objects when
00014
00015 //           connections are requested.
00016
00017 //
00018
00019 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00020 //
00021 //***************************************************************************
00022
00023 #include <objbase.h>
00024 #include "sample.h"
00025
00026 //***************************************************************************
00027 //
00028 // CProvFactory::CProvFactory
00029 // CProvFactory::~CProvFactory
00030 //
00031 // Constructor Parameters:
00032 //  None
00033 //***************************************************************************
00034
00035 CProvFactory::CProvFactory()
00036 {
00037     m_cRef=0L;
00038     return;
00039 }
00040
00041 CProvFactory::~CProvFactory(void)
00042 {
00043     return;
00044 }
00045
00046 //***************************************************************************
00047 //
00048 // CProvFactory::QueryInterface
00049 // CProvFactory::AddRef
00050 // CProvFactory::Release
00051 //
00052 // Purpose: Standard Ole routines needed for all interfaces
00053 //
00054 //***************************************************************************
00055
00056
00057 STDMETHODIMP CProvFactory::QueryInterface(REFIID riid
00058     , PPVOID ppv)
00059 {
00060     *ppv=NULL;
00061
00062     if (IID_IUnknown==riid || IID_IClassFactory==riid)
00063         *ppv=this;
00064
00065     if (NULL!=*ppv)
00066         {
00067         ((LPUNKNOWN)*ppv)->AddRef();
00068         return NOERROR;
00069         }
00070
00071     return E_NOINTERFACE;
00072 }
00073
00074 STDMETHODIMP_(ULONG) CProvFactory::AddRef(void)
00075 {
00076     return ++m_cRef;
00077 }
00078
00079 STDMETHODIMP_(ULONG) CProvFactory::Release(void)
00080 {
00081     ULONG nNewCount = InterlockedDecrement((long *)&m_cRef);
00082     if (0L == nNewCount)
00083         delete this;
00084
00085     return nNewCount;
00086 }
00087
00088 //***************************************************************************
00089 //
00090 // CProvFactory::CreateInstance
00091 //
00092 // Purpose: Instantiates a Locator object returning an interface pointer.
00093 //
00094 // Parameters:
00095 //  pUnkOuter       LPUNKNOWN to the controlling IUnknown if we are
00096 //                  being used in an aggregation.
00097 //  riid            REFIID identifying the interface the caller
00098 //                  desires to have for the new object.
00099 //  ppvObj          PPVOID in which to store the desired
00100 //                  interface pointer for the new object.
00101 //
00102 // Return Value:
00103 //  HRESULT         NOERROR if successful, otherwise E_NOINTERFACE
00104 //                  if we cannot support the requested interface.
00105 //***************************************************************************
00106
00107 STDMETHODIMP CProvFactory::CreateInstance(LPUNKNOWN pUnkOuter
00108     , REFIID riid, PPVOID ppvObj)
00109 {
00110     CInstPro *   pObj;
00111     HRESULT hr;
00112
00113     *ppvObj=NULL;
00114
00115     // This object doesnt support aggregation.
00116
00117     if (NULL!=pUnkOuter)
00118         return CLASS_E_NOAGGREGATION;
00119
00120     // Create the locator object.
00121
00122     pObj=new CInstPro();
00123     if (NULL==pObj)
00124         return E_OUTOFMEMORY;
00125
00126     hr=pObj->QueryInterface(riid, ppvObj);
00127
00128     //Kill the object if initial creation or Init failed.
00129
00130     if (FAILED(hr))
00131         delete pObj;
00132     return hr;
00133 }
00134
00135 //***************************************************************************
00136 //
00137 // CProvFactory::LockServer
00138 //
00139 // Purpose:
00140 //  Increments or decrements the lock count of the DLL.  If the
00141 //  lock count goes to zero and there are no objects, the DLL
00142 //  is allowed to unload.  See DllCanUnloadNow.
00143 //
00144 // Parameters:
00145 //  fLock           BOOL specifying whether to increment or
00146 //                  decrement the lock count.
00147 //
00148 // Return Value:
00149 //  HRESULT         NOERROR always.
00150 //***************************************************************************
00151
00152
00153 STDMETHODIMP CProvFactory::LockServer(BOOL fLock)
00154 {
00155     if (fLock)
00156         InterlockedIncrement(&g_cLock);
00157     else
00158         InterlockedDecrement(&g_cLock);
00159     return NOERROR;
00160 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/DirectoryObject.cpp Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

DirectoryObject.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       IDirectoryObject.cpp
00008 //
00009 //  Contents:   IDirectoryObject usage
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #include "stdafx.h"
00015 #include "ADQI.h"
00016 #include "DirectoryObject.h"
00017
00018 #ifdef _DEBUG
00019 #undef THIS_FILE
00020 static char THIS_FILE[]=__FILE__;
00021 #define new DEBUG_NEW
00022 #endif
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CDlgIDirectoryObject dialog
00026
00027
00028 CDlgIDirectoryObject::CDlgIDirectoryObject(LPUNKNOWN pUnk, CWnd* pParent /*=NULL*/)
00029   : CDialog(CDlgIDirectoryObject::IDD, pParent)
00030 {
00031   //{{AFX_DATA_INIT(CDlgIDirectoryObject)
00032   m_sDN = _T("");
00033   m_sRDN = _T("");
00034   m_sSchema = _T("");
00035   m_sClass = _T("");
00036   m_sParent = _T("");
00037   m_sAttributes = _T("");
00038   //}}AFX_DATA_INIT
00039
00040   HRESULT hr;
00041   m_pDirObject = NULL;
00042   hr = pUnk->QueryInterface( IID_IDirectoryObject, (void **) &m_pDirObject );
00043   if ( !SUCCEEDED(hr) )
00044   {
00045     AfxMessageBox(_T("Fatal Error! QI for IDirectoryObject failed"));
00046     return;
00047   }
00048   pUnk->Release();
00049
00050   ShowAttributes();
00051
00052 }
00053
00054
00055 CDlgIDirectoryObject::~CDlgIDirectoryObject()
00056 {
00057   if ( m_pDirObject )
00058   {
00059     m_pDirObject->Release();
00060   }
00061 }
00062
00063 void CDlgIDirectoryObject::DoDataExchange(CDataExchange* pDX)
00064 {
00065   CDialog::DoDataExchange(pDX);
00066   //{{AFX_DATA_MAP(CDlgIDirectoryObject)
00067   DDX_Control(pDX, IDC_ATTRIBUTE, m_cAttributes);
00068   DDX_Control(pDX, IDC_VALUELIST, m_cValueList);
00069   DDX_Text(pDX, IDC_DN, m_sDN);
00070   DDX_Text(pDX, IDC_RDN, m_sRDN);
00071   DDX_Text(pDX, IDC_SCHEMA, m_sSchema);
00072   DDX_Text(pDX, IDC_CLASS, m_sClass);
00073   DDX_Text(pDX, IDC_PARENT, m_sParent);
00074   DDX_Text(pDX, IDC_ATTRIBUTE, m_sAttributes);
00075   //}}AFX_DATA_MAP
00076 }
00077
00078
00079 BEGIN_MESSAGE_MAP(CDlgIDirectoryObject, CDialog)
00080   //{{AFX_MSG_MAP(CDlgIDirectoryObject)
00081   ON_BN_CLICKED(IDC_DELETE, OnDelete)
00082   ON_BN_CLICKED(IDC_GET, OnGet)
00083   ON_EN_CHANGE(IDC_ATTRIBUTE, OnChangeAttribute)
00084   //}}AFX_MSG_MAP
00085 END_MESSAGE_MAP()
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 // CDlgIDirectoryObject message handlers
00089 // Demonstrate:
00090 // IDirectoryObject::GetObjectInformation()
00091 //
00092 /////////////////////////////////////////////////////////////////////////////
00093
00094 void CDlgIDirectoryObject::ShowAttributes()
00095 {
00096   ADS_OBJECT_INFO *pInfo;
00097   HRESULT hr;
00098
00099   hr = m_pDirObject->GetObjectInformation(&pInfo);
00100   if (!SUCCEEDED(hr) )
00101   {
00102     return;
00103   }
00104
00105   /////////////////////////////////////////////
00106   // Show the attributes in the UI
00107   /////////////////////////////////////////////
00108   USES_CONVERSION;
00109
00110   m_sRDN    = OLE2T(pInfo->pszRDN);
00111   m_sDN   = OLE2T(pInfo->pszObjectDN);
00112   m_sParent = OLE2T(pInfo->pszParentDN);
00113   m_sClass  = OLE2T(pInfo->pszClassName);
00114   m_sSchema = OLE2T(pInfo->pszSchemaDN);
00115
00116   ///////////////////////////////////////////////////////////
00117   // Do not forget to clean-up the memory using FreeADsMem!
00118   //////////////////////////////////////////////////////////
00119   FreeADsMem( pInfo );
00120
00121 }
00122
00123 //
00124 //  IDirectoryObject::DeleteDSObject();
00125 //
00126 //
00127 void CDlgIDirectoryObject::OnDelete()
00128 {
00129   CDeleteObjectDlg dlg;
00130   CString s, sMsg;
00131   HRESULT hr;
00132
00133   if ( dlg.DoModal() == IDOK )
00134   {
00135      USES_CONVERSION;
00136      // Example: CN=jsmith
00137      s  = dlg.GetObjectName();
00138      hr = m_pDirObject->DeleteDSObject( T2OLE(s) );
00139   }
00140
00141   if ( SUCCEEDED(hr) )
00142   {
00143     sMsg.Format(_T("Object '%s' was sucessfully deleted"), s);
00144     AfxMessageBox( sMsg );
00145   }
00146   else
00147   {
00148     AfxMessageBox(GetErrorMessage(hr));
00149     return;
00150   }
00151
00152 }
00153
00154 ///////////////////////////////////////////////////
00155 //
00156 // Demonstrate:
00157 // IDirectoryObject::GetObjectAttributes
00158 //
00159 //////////////////////////////////////////////////
00160
00161
00162 void CDlgIDirectoryObject::OnGet()
00163 {
00164    CStringList sList;
00165    UINT nCount;
00166    HRESULT hr;
00167
00168
00169    UpdateData(TRUE);
00170
00171    StringToStringList(m_sAttributes, sList );
00172    nCount = sList.GetCount();
00173    if ( nCount == 0 )
00174    {
00175      return;
00176    }
00177
00178
00179
00180    ///////////////////////////////////////
00181    // Now build the Attribute Names List
00182    ///////////////////////////////////////
00183    POSITION     pos;
00184    DWORD      dwNumAttr;
00185    LPWSTR     *pAttrNames=NULL;
00186    ADS_ATTR_INFO  *pAttrInfo;
00187    DWORD      dwReturn;
00188
00189
00190    USES_CONVERSION;
00191
00192
00193    pAttrNames = (LPWSTR*) AllocADsMem( sizeof(LPWSTR) * nCount );
00194    pos = sList.GetHeadPosition();
00195    dwNumAttr = 0;
00196    while( pos != NULL )
00197    {
00198      pAttrNames[dwNumAttr] = T2OLE(sList.GetAt(pos));
00199      dwNumAttr++;
00200      sList.GetNext(pos);
00201    }
00202
00203
00204
00205
00206    /////////////////////////////////////////
00207    // Get attributes value requested
00208    // Note: The order is not necessarily the same as
00209    //       requested via pAttrNames.
00210    ///////////////////////////////////////////
00211    hr = m_pDirObject->GetObjectAttributes( pAttrNames, dwNumAttr, &pAttrInfo, &dwReturn );
00212
00213
00214
00215    if ( SUCCEEDED(hr) )
00216    {
00217     DWORD idx;
00218     CString sDisplay;
00219     CStringList sValueList;
00220     UINT nCount;
00221     POSITION pos;
00222
00223     m_cValueList.ResetContent();
00224
00225     for( idx=0; idx < dwReturn; idx++)
00226     {
00227           ADsToStringList( pAttrInfo[idx].pADsValues, pAttrInfo[idx].dwNumValues, sValueList );
00228       sDisplay = OLE2T(pAttrInfo[idx].pszAttrName);
00229       sDisplay += _T(":");
00230       m_cValueList.AddString( sDisplay );
00231       nCount = sValueList.GetCount();
00232       if ( nCount == 0 ) // can not find/convert the value
00233       {
00234         m_cValueList.AddString(_T(" > [No Value]"));
00235         continue;
00236       }
00237       else
00238       {
00239         pos = sValueList.GetHeadPosition();
00240         while( pos != NULL )
00241         {
00242           sDisplay = _T(" > ");
00243           sDisplay += sValueList.GetAt(pos);
00244           m_cValueList.AddString( sDisplay );
00245           sValueList.GetNext(pos);
00246         }
00247
00248       }
00249
00250     }
00251
00252     sValueList.RemoveAll();
00253    }
00254
00255
00256
00257    ///////////////////////////////////////////////////////////
00258    // Use FreADsMem for all memory obtained from ADSI call
00259    /////////////////////////////////////////////////////////////
00260    FreeADsMem( pAttrInfo );
00261    FreeADsMem( pAttrNames );
00262
00263
00264 }
00265
00266 void CDlgIDirectoryObject::OnChangeAttribute()
00267 {
00268   BOOL bEnabled;
00269   bEnabled = m_cAttributes.GetWindowTextLength() > 0 ? TRUE : FALSE;
00270   GetDlgItem( IDC_GET )->EnableWindow( bEnabled );
00271
00272 }
00273
00274 BOOL CDlgIDirectoryObject::OnInitDialog()
00275 {
00276   CDialog::OnInitDialog();
00277
00278   OnChangeAttribute();
00279   return TRUE;  // return TRUE unless you set the focus to a control
00280                 // EXCEPTION: OCX Property Pages should return FALSE
00281 }
00282 /////////////////////////////////////////////////////////////////////////////
00283 // CDeleteObjectDlg dialog
00284
00285
00286 CDeleteObjectDlg::CDeleteObjectDlg(CWnd* pParent /*=NULL*/)
00287   : CDialog(CDeleteObjectDlg::IDD, pParent)
00288 {
00289   //{{AFX_DATA_INIT(CDeleteObjectDlg)
00290   m_sDelete = _T("");
00291   //}}AFX_DATA_INIT
00292 }
00293
00294
00295 void CDeleteObjectDlg::DoDataExchange(CDataExchange* pDX)
00296 {
00297   CDialog::DoDataExchange(pDX);
00298   //{{AFX_DATA_MAP(CDeleteObjectDlg)
00299   DDX_Text(pDX, IDC_DELETE, m_sDelete);
00300   //}}AFX_DATA_MAP
00301 }
00302
00303
00304 BEGIN_MESSAGE_MAP(CDeleteObjectDlg, CDialog)
00305   //{{AFX_MSG_MAP(CDeleteObjectDlg)
00306   ON_EN_CHANGE(IDC_DELETE, OnChangeDelete)
00307   //}}AFX_MSG_MAP
00308 END_MESSAGE_MAP()
00309
00310 /////////////////////////////////////////////////////////////////////////////
00311 // CDeleteObjectDlg message handlers
00312
00313 void CDeleteObjectDlg::OnOK()
00314 {
00315     UpdateData( TRUE );
00316   m_sRDN = m_sDelete;
00317
00318   CDialog::OnOK();
00319 }
00320
00321 void CDeleteObjectDlg::OnChangeDelete()
00322 {
00323     BOOL bEnabled;
00324   bEnabled = GetDlgItem( IDC_DELETE )->GetWindowTextLength() > 0 ? TRUE : FALSE;
00325   GetDlgItem( IDOK )->EnableWindow( bEnabled );
00326
00327 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/MouseInfo/MousInfo.c Source File

  • WinUI
  • Input
  • MouseInfo

MousInfo.c

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////
00002 //
00003 // MODULE:      MOUSINFO.C
00004 //
00005 // DESCRIPTION: SDK sample for handling the WM_MOUSEWHEEL message and
00006 //              the TrackMouseEvent() API.
00007 //
00008 //              Applet displays MouseButton, MouseWheel, MouseMovement, and
00009 //              any mouse messages in the title bar.
00010 //
00011 // PLATFORMS:   WinNT 4.0 and newer
00012 //
00013 //              Copyright 1995 - 2000 Microsoft Corporation.
00014 //              All rights reserved
00015 //
00016 //
00017 ///////////////////////////////////////////////////////////////////////////
00018 #include <windows.h>
00019 #include <tchar.h>
00020 #include <stdio.h>
00021 #include "mousinfo.h"
00022
00023 // Globals
00024 HINSTANCE ghInst;
00025
00026 //
00027 // Array of Mouse Message Strings
00028 //
00029 TCHAR garMsgStrings[][20] =
00030 {
00031     TEXT("                   "),
00032     TEXT("WM_LBUTTONUP       "),
00033     TEXT("WM_RBUTTONUP       "),
00034     TEXT("WM_MBUTTONUP       "),
00035     TEXT("WM_LBUTTONDOWN     "),
00036     TEXT("WM_RBUTTONDOWN     "),
00037     TEXT("WM_MBUTTONDOWN     "),
00038     TEXT("WM_LBUTTONDBLCLK   "),
00039     TEXT("WM_MBUTTONDBLCLK   "),
00040     TEXT("WM_RBUTTONDBLCLK   "),
00041     TEXT("WM_MOUSEWHEEL      "),
00042     TEXT("WM_MOUSEHOVER      "),
00043     TEXT("WM_MOUSELEAVE      ")
00044 };
00045
00046
00047 //////////////////////////////////////////////////////////////////////////
00048 //
00049 // FUNCTION:  int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int)
00050 //
00051 // DESCRIPTION: Your basic WinMain ()
00052 //
00053 /////////////////////////////////////////////////////////////////////////
00054 int WINAPI WinMain (
00055     HINSTANCE hInstance,
00056     HINSTANCE hPrevInstance,
00057     LPSTR lpCmdLine,
00058     int nCmdShow )
00059 {
00060     MSG msg = {0};
00061     WNDCLASS wc = {0};
00062     HWND hwndMain = NULL;
00063     BOOL bRet = FALSE;
00064     BOOL bRetZero = FALSE;
00065
00066
00067     ghInst = hInstance;
00068
00069     //
00070     // Register our main window
00071     //
00072     wc.style         = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
00073     wc.lpfnWndProc   = (WNDPROC) MainWindowProc;
00074     wc.hInstance     = ghInst;
00075     wc.hIcon         = LoadIcon (hInstance, MAKEINTRESOURCE(MOUSINFO_ICON));
00076     wc.hCursor       = LoadCursor (NULL, IDC_ARROW);
00077     wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
00078     wc.lpszMenuName  = MAKEINTRESOURCE (IDM_MENU);
00079     wc.lpszClassName = szClassName;
00080
00081     if (!RegisterClass(&wc))
00082     {
00083         bRetZero = TRUE;
00084         goto exit_func;
00085     }
00086
00087     //
00088     // Create the main window...
00089     // with an initial size of 0
00090     //
00091     hwndMain = CreateWindow (
00092         szClassName,
00093         szAppName,
00094         WS_OVERLAPPEDWINDOW ^ WS_MAXIMIZEBOX,
00095         0,0,0,0,
00096         NULL, NULL, ghInst, NULL);
00097
00098
00099     //
00100     // Show the window
00101     //
00102     ShowWindow (hwndMain,SW_SHOW);
00103     UpdateWindow (hwndMain);
00104
00105     //
00106     // Message pump
00107     //
00108     while ((bRet = GetMessage (&msg, NULL, 0, 0)) != 0)
00109     {
00110         if (bRet == -1)
00111         {
00112             bRetZero = TRUE;
00113             goto exit_func;
00114         }
00115         else
00116         {
00117             TranslateMessage (&msg);
00118             DispatchMessage (&msg);
00119         }
00120     }
00121
00122 exit_func:
00123     if (bRetZero)
00124     {
00125         return 0;
00126     }
00127     else
00128     {
00129         return (int) msg.wParam;
00130     }
00131 }
00132
00133
00134 //////////////////////////////////////////////////////////////////////////////////
00135 //
00136 // FUNCTION:    LRESULT CALLBACK MainWindowProc (HWND, UINT, WPARAM, LPARAM)
00137 //
00138 // DESCRIPTION: Your standard Window Procedure.
00139 //
00140 // MESSAGE:     Handles the following Windows messages:
00141 //
00142 //                WM_CREATE
00143 //                WM_DESTROY
00144 //                WM_SYSCOMMAND
00145 //                WM_LBUTTONUP
00146 //                WM_RBUTTONUP
00147 //                WM_MBUTTONUP
00148 //                WM_LBUTTONDOWN
00149 //                WM_RBUTTONDOWN
00150 //                WM_MBUTTONDOWN
00151 //                WM_LBUTTONDBLCLK
00152 //                WM_MBUTTONDBLCLK
00153 //                WM_RBUTTONDBLCLK
00154 //                WM_MOUSEMOVE
00155 //
00156 //              And the new mouse message
00157 //
00158 //                WM_MOUSEWHEEL
00159 //
00160 //              And the new TrackMouseEvent() Messages
00161 //
00162 //                WM_MOUSEHOVER       // mouse hovered specified delay over client area
00163 //                WM_MOUSELEAVE       // mouse has left the client area
00164 //
00165 //
00166 //////////////////////////////////////////////////////////////////////////////////
00167 LRESULT CALLBACK MainWindowProc (
00168     HWND hwnd,
00169     UINT message,
00170     WPARAM wParam,
00171     LPARAM lParam )
00172 {
00173     TEXTMETRIC tm = {0};
00174     HDC hDC = NULL;
00175
00176     int MsgIndex = NO_MESSAGE;          // Index into garMsgStrings[] array
00177     TCHAR szBuff[128] = {0};            // String buffer
00178     static int LB = 0, RB = 0, MB = 0;  // State of the mouse buttons
00179     static int X = 0, Y = 0;            // Mouse position
00180     static TCHAR Roller = TEXT(' ');    // State of the mouse wheel. '+' or '-'
00181     static int fHasWheel = FALSE;       // Mouse has a wheel?? TRUE if yes, FALSE if no
00182
00183     switch (message)
00184     {
00185         case WM_CREATE:
00186             //
00187             // See if we have a mouse with a wheel attached to the system.
00188             // Note that SM_MOUSEWHEELPRESENT is a new flag for GetSystemMetrics
00189             //  and returns TRUE if a mouse with a wheel is present, FALSE if not.
00190             //
00191             fHasWheel = GetSystemMetrics (SM_MOUSEWHEELPRESENT);
00192
00193             //
00194             // Size the window so that it will display all the text
00195             //
00196             hDC = GetDC (hwnd);
00197             GetTextMetrics (hDC,&tm);
00198             SetWindowPos (hwnd, HWND_BOTTOM, 0, 0,
00199                           tm.tmMaxCharWidth * MAX_TITLE_LEN,
00200                           100, SWP_SHOWWINDOW);
00201             ReleaseDC (hwnd, hDC);
00202       break;
00203
00204         case WM_DESTROY:
00205             PostQuitMessage (0);
00206             break;
00207
00208         //
00209         // Handle WM_MOUSE messages.
00210         // First we setup up some variables and then let
00211         //   control fall through to the end of the switch
00212         //   construct, where we then update the title bar.
00213         //
00214         case WM_LBUTTONUP:      LB=0; MsgIndex = LBU; break;
00215         case WM_RBUTTONUP:      RB=0; MsgIndex = RBU; break;
00216         case WM_MBUTTONUP:      MB=0; MsgIndex = MBU; break;
00217         case WM_LBUTTONDOWN:    LB=1; MsgIndex = LBD; break;
00218         case WM_RBUTTONDOWN:    RB=1; MsgIndex = RBD; break;
00219         case WM_MBUTTONDOWN:    MB=1; MsgIndex = MBD; break;
00220         case WM_LBUTTONDBLCLK:  LB=0; MsgIndex = LB2; break;
00221         case WM_MBUTTONDBLCLK:  MB=0; MsgIndex = MB2; break;
00222         case WM_RBUTTONDBLCLK:  RB=0; MsgIndex = RB2; break;
00223         case WM_MOUSEHOVER:     MsgIndex = MH;  break;
00224         case WM_MOUSELEAVE:     MsgIndex = ML;  break;
00225         case WM_MOUSEMOVE:      MsgIndex = NO_MESSAGE; Roller = TEXT(' ');  break;
00226
00227         // Handle WM_MOUSEWHEEL message.
00228         // We handle this message a little differently since the
00229         // roller movement info is in the HIWORD of wParam.
00230         //
00231         // The MouseWheel has 18 'detents'. As the wheel is rolled
00232         // and a detent is encountered, the OS will send a WM_MOUSEWHEEL
00233         // message with the HIWORD of wParam set to a value of +/- 120.
00234         // '+' if the wheel is being rolled forward (away from the user),
00235         // '-' if the wheel is being rolled backwards (towards the user).
00236         case WM_MOUSEWHEEL:
00237             //
00238             // Mouse Wheel is being rolled forward
00239             //
00240             if ((short) HIWORD(wParam) > 0)
00241             {
00242                 Roller = TEXT('+');
00243             }
00244
00245             //
00246             // Mouse Wheel is being rolled backward
00247             //
00248             if ((short)HIWORD(wParam) < 0)
00249             {
00250                 Roller = TEXT('-');
00251             }
00252             MsgIndex = MW;
00253             break;
00254
00255         case WM_COMMAND:
00256             switch (wParam)
00257             {
00258                 //
00259                 // Call the TrackMouseEvent() API, and set up a WM_MOUSEHOVER
00260                 // "one-shot" event. Exactly one and only one  WM_MOUSEHOVER
00261                 // message will be sent to the window specified in the hwndTrack
00262                 // member of the TRACKMOUSEEVENT structure, when the mouse has
00263                 // 'hovered' over the client area an amount of time equal to that
00264                 // specified in the dwHoverTime member of TRACKMOUSEEVENT.
00265                 //
00266                 // NOTE that this message will be generated only once. The application
00267                 // must call the TrackMouseEvent() API again in order for the system
00268                 // to generate another WM_MOUSEHOVER message.
00269                 //
00270                 case IDM_HOVER:
00271                 {
00272                     TRACKMOUSEEVENT tme = {0};
00273
00274                     tme.cbSize      = sizeof(TRACKMOUSEEVENT);
00275                     tme.dwFlags     = TME_HOVER;
00276                     tme.hwndTrack   = hwnd;
00277                     tme.dwHoverTime = HOVER_DEFAULT;
00278
00279                     TrackMouseEvent(&tme);
00280                     break;
00281                 }
00282
00283                 //
00284                 // Call the TrackMouseEvent() API, and set up a WM_MOUSELEAVE
00285                 // "one-shot" event. Exactly one and only one  WM_MOUSELEAVE
00286                 // message will be sent to the window specified in the hwndTrack
00287                 // member of the TRACKMOUSEEVENT structure, when the mouse has
00288                 // left the client area.
00289                 //
00290                 // NOTE that this message will be generated only once. The application
00291                 // must call the TrackMouseEvent() API again in order for the system
00292                 // to generate another WM_MOUSELEAVE message. Also note that if the
00293                 // mouse pointer is not over the application, a call to TrackMouseEvent()
00294                 // will result in the immediate posting of a WM_MOUSELEAVE
00295                 // message.
00296                 //
00297                 case IDM_LEAVE:
00298                 {
00299                     TRACKMOUSEEVENT tme = {0};
00300
00301                     tme.cbSize      = sizeof(TRACKMOUSEEVENT);
00302                     tme.dwFlags     = TME_LEAVE;
00303                     tme.hwndTrack   = hwnd;
00304
00305                     TrackMouseEvent(&tme);
00306                     break;
00307                 }
00308
00309                 case IDM_ABOUT:
00310                 {
00311                     TCHAR buff[128] = {0};
00312
00313                     _sntprintf (buff, sizeof(buff)/sizeof(buff[0]) - 1,
00314                                 TEXT("MousInfo.Exe\r\n")
00315                                 TEXT("Copyright 1995 - 2000 Microsoft Corp.\r\n")
00316                                 TEXT("All rights reserved\r\n\r\n") );
00317
00318                     MessageBox (hwnd, buff, szAppName, MB_OK);
00319                     break;
00320                 }
00321             }
00322             break;
00323
00324         default:
00325             goto exit_func;
00326             break;
00327     }  // end switch (message)
00328
00329
00330     //
00331     // If the mouse has a wheel, display the state of the mouse buttons,
00332     // wheel and position in the title bar.
00333     // Else if mouse does not have a wheel, do not display the state
00334     // of the wheel (but do display everything else!)
00335     //
00336     if (fHasWheel)
00337     {
00338         _sntprintf (szBuff, sizeof(szBuff)/sizeof(szBuff[0]) - 1,
00339                     TEXT("L:%d M:%d R:%d W:%c x:%04d y:%04d %s"),
00340                     LB, MB, RB, Roller,
00341                     LOWORD(lParam), HIWORD(lParam),
00342                     garMsgStrings[MsgIndex] );
00343     }
00344     else
00345     {
00346         _sntprintf (szBuff, sizeof(szBuff)/sizeof(szBuff[0]) - 1,
00347                     TEXT("L:%d M:%d R:%d x:%04d y:%04d %s"),
00348                     LB, MB, RB, LOWORD(lParam), HIWORD(lParam),
00349                     garMsgStrings[MsgIndex] );
00350     }
00351
00352     SetWindowText(hwnd,szBuff);
00353
00354 exit_func:
00355     return  DefWindowProc (hwnd, message, wParam, lParam);
00356 }
00357
00358
00359
00360
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CGridIt Member List

This is the complete list of members for CGridIt, including all inherited members.
_cCol | CGridIt | [protected]
_cRow | CGridIt | [protected]
_cx | CGridIt | [protected]
_cy | CGridIt | [protected]
_iCol | CGridIt | [protected]
_iRow | CGridIt | [protected]
_pt | CGridIt | [protected]
_size | CGridIt | [protected]
CGridIt(UINT cCol, UINT cRow, SIZE size, POINT pt) | CGridIt | [inline]
Col() | CGridIt | [inline]
Cx() | CGridIt | [inline]
Cy() | CGridIt | [inline]
Done() | CGridIt | [inline]
operator++() | CGridIt | [inline]
Row() | CGridIt | [inline]
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcShip/IShipDefault.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcShip

IShipDefault.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc1E6.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCShip.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcship;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface IShipDefault
00019 /** @com.interface(iid=00020400-0000-0000-C000-000000000046, thread=AUTO, type=DUAL) */
00020 public interface IShipDefault extends qcship.IShip
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPPUT, name="CustomerId", name2="putCustomerId", addFlagsVtable=4)
00023       @com.parameters([in,type=I4] _jcomparam_0) */
00024   public void setCustomerId(int _jcomparam_0);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=PROPPUT, name="OrderId", name2="putOrderId", addFlagsVtable=4)
00027       @com.parameters([in,type=I4] _jcomparam_0) */
00028   public void setOrderId(int _jcomparam_0);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LineItem", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] lItemId, [in,type=I4] lQuantity) */
00032   public void LineItem(int lItemId, int lQuantity);
00033
00034   /** @com.method(vtoffset=7, dispid=4, type=METHOD, name="Process", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] lFlags) */
00036   public void Process(int lFlags);
00037
00038
00039   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x20400, (short)0x0, (short)0x0, (byte)0xc0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x46);
00040 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/coptions.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

coptions.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module COPTIONS.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _COPTIONS_H_
00012 #define _COPTIONS_H_
00013
00014
00015 /////////////////////////////////////////////////////////////////
00016 // Defines
00017 //
00018 /////////////////////////////////////////////////////////////////
00019 enum CREATE_OPTIONS
00020 {
00021   CREATE_INITIALIZE     = 0x00000001,
00022   CREATE_SETPROPERTIES    = 0x00000002,
00023
00024   CREATE_USESERVICECOMP   = 0x00000010,
00025 //  CREATE_USETRACEPROVIDER   = 0x00000020,
00026
00027   CREATE_NEWWINDOW      = 0x00000100,
00028   CREATE_NEWWINDOW_IFEXISTS = 0x00000200,
00029   CREATE_FINDWINDOW     = 0x00000400,
00030   CREATE_NODISPLAY      = 0x00000800,
00031
00032   CREATE_CURSORENGINE     = 0x00001000,
00033   CREATE_RESTARTPOSITION    = 0x00002000,
00034   CREATE_DETERMINE_TYPE   = 0x00004000,
00035
00036   CREATE_NO_AUTOSAVE      = 0x00010000,
00037   CREATE_QI_MANDATORY     = 0x00100000,
00038   CREATE_QI_OPTIONAL      = 0x00200000
00039 };
00040
00041 enum COMMAND_OPTIONS
00042 {
00043   COMMAND_ROWSAFFECTED    = 0x00000001,
00044   COMMAND_RELEASE_OPENOBJECTS = 0x00000002
00045 };
00046
00047 enum ACCESSOR_OPTIONS
00048 {
00049   ACCESSOR_BIND_VALUE     = 0x00000001, //DBPART_VALUE
00050   ACCESSOR_BIND_LENGTH    = 0x00000002, //DBPART_LENGTH
00051   ACCESSOR_BIND_STATUS    = 0x00000004, //DBPART_STATUS
00052   ACCESSOR_BIND_BOOKMARK    = 0x00000008,
00053
00054   ACCESSOR_BLOB_ISEQSTREAM  = 0x00000010,
00055   ACCESSOR_BLOB_ILOCKBYTES  = 0x00000020,
00056   ACCESSOR_BLOB_ISTORAGE    = 0x00000040,
00057   ACCESSOR_BLOB_ISTREAM   = 0x00000080,
00058
00059   ACCESSOR_OWNED_PROVIDER   = 0x00001000
00060 };
00061
00062 enum ROWSET_OPTIONS
00063 {
00064   ROWSET_SETDEFAULTPROPS    = 0x00000004,
00065   ROWSET_ROWSTOFETCH      = 0x00000100,
00066   ROWSET_NODATA       = 0x00000200,
00067
00068   ROWSET_HIDDENCOLUMNS    = 0x00001000,
00069
00070   ROWSET_ALWAYSRELEASEROWS  = 0x00010000
00071 };
00072
00073 enum NOTIFY_OPTIONS
00074 {
00075   NOTIFY_OLEDB        = 0x00000001,
00076   NOTIFY_ADDREF       = 0x00000008,
00077   NOTIFY_RELEASE        = 0x00000010,
00078   NOTIFY_QI         = 0x00000020,
00079
00080   //Trace Provider
00081   NOTIFY_TRACEPROVIDER    = 0x01000000,
00082
00083   //Notifications
00084   NOTIFY_IDBASYNCHNOTIFY    = 0x00000100,
00085   NOTIFY_IROWSETNOTIFY    = 0x00000200,
00086   NOTIFY_IROWPOSITIONCHANGE = 0x00000400,
00087
00088   NOTIFY_PROMPTVETO     = 0x00010000,
00089   NOTIFY_IPOOLNOTIFY      = 0x00100000,
00090 };
00091
00092
00093 /////////////////////////////////////////////////////////////////////////////
00094 // COptionsDataSource
00095 //
00096 /////////////////////////////////////////////////////////////////////////////
00097 class COptionsDataSource : public CPropPageLite
00098 {
00099 public:
00100   COptionsDataSource();
00101
00102   //Messages
00103   virtual BOOL OnInitDialog();
00104   virtual BOOL OnApply();
00105
00106   virtual BOOL OnCommand(UINT iID, HWND hWndCtrl);
00107 };
00108
00109
00110 /////////////////////////////////////////////////////////////////////////////
00111 // COptionsCommand
00112 //
00113 /////////////////////////////////////////////////////////////////////////////
00114 class COptionsCommand : public CPropPageLite
00115 {
00116 public:
00117   COptionsCommand();
00118
00119   //Messages
00120   virtual BOOL OnInitDialog();
00121   virtual BOOL OnApply();
00122 };
00123
00124
00125 /////////////////////////////////////////////////////////////////////////////
00126 // COptionsAccessor
00127 //
00128 /////////////////////////////////////////////////////////////////////////////
00129 class COptionsAccessor : public CPropPageLite
00130 {
00131 public:
00132   COptionsAccessor();
00133
00134   //Messages
00135   virtual BOOL OnInitDialog();
00136   virtual BOOL OnApply();
00137
00138 protected:
00139   //data
00140   CComboBoxLite m_comboBindingTypes;
00141 };
00142
00143
00144 /////////////////////////////////////////////////////////////////////////////
00145 // COptionsRowset
00146 //
00147 /////////////////////////////////////////////////////////////////////////////
00148 class COptionsRowset : public CPropPageLite
00149 {
00150 public:
00151   COptionsRowset();
00152
00153   //Messages
00154   virtual BOOL OnInitDialog();
00155   virtual BOOL OnApply();
00156
00157   virtual BOOL OnCommand(UINT iID, HWND hWndCtrl);
00158 };
00159
00160
00161 /////////////////////////////////////////////////////////////////////////////
00162 // COptionsNotify
00163 //
00164 /////////////////////////////////////////////////////////////////////////////
00165 class COptionsNotify : public CPropPageLite
00166 {
00167 public:
00168   COptionsNotify();
00169
00170   //Messages
00171   virtual BOOL OnInitDialog();
00172   virtual BOOL OnApply();
00173 };
00174
00175
00176 /////////////////////////////////////////////////////////////////////////////
00177 // COptionsError
00178 //
00179 /////////////////////////////////////////////////////////////////////////////
00180 class COptionsError : public CPropPageLite
00181 {
00182 public:
00183   COptionsError();
00184
00185   //Messages
00186   virtual BOOL OnInitDialog();
00187   virtual BOOL OnApply();
00188
00189   virtual BOOL OnCommand(UINT iID, HWND hWndCtrl);
00190 };
00191
00192
00193 //////////////////////////////////////////////////////////////////////////
00194 // COptionsSheet
00195 //
00196 //////////////////////////////////////////////////////////////////////////
00197 class COptionsSheet : public CPropSheetLite
00198 {
00199 public:
00200   //Constructors
00201   COptionsSheet();
00202
00203   //Helpers
00204   BOOL  LoadOptions();
00205   BOOL  SaveOptions();
00206
00207   //Accessor
00208   DBTYPE  GetBindingType(DBTYPE wNativeType = DBTYPE_UDT);
00209   void  SetBindingType(DBTYPE wType)  { m_wBindingType = wType; }
00210
00211 //protected:
00212   //Data
00213   COptionsDataSource  m_CDataSource;
00214   COptionsCommand   m_CCommand;
00215   COptionsAccessor  m_CAccessor;
00216   COptionsRowset    m_CRowset;
00217   COptionsNotify    m_CNotify;
00218   COptionsError   m_CError;
00219
00220   //DataSource
00221   DWORD       m_dwCLSCTX;
00222   WCHAR       m_wszRemoteServer[MAX_NAME_LEN+1];
00223   DWORD       m_dwCreateOpts;
00224
00225   //Command
00226   DWORD       m_dwCommandOpts;
00227
00228   //Accessor
00229   DWORD       m_dwMaxLength;
00230   DWORD       m_dwAccessorOpts;
00231
00232   //Rowset
00233   DWORD       m_dwConvFlags;
00234   DWORD       m_dwRowsetOpts;
00235   ULONG       m_cRowsToFetch;
00236
00237   //Notify
00238   DWORD       m_dwNotifyOpts;
00239
00240 protected:
00241   //Accessor
00242   DBTYPE        m_wBindingType;
00243 };
00244
00245
00246 #endif  //_COPTIONS_H_
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/FilterGroupEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

FilterGroupEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: FilterGroupEnum
00019
00020 public class FilterGroupEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adFilterNone = 0;
00023   public static final short adFilterPendingRecords = 1;
00024   public static final short adFilterAffectedRecords = 2;
00025   public static final short adFilterFetchedRecords = 3;
00026   public static final short adFilterPredicate = 4;
00027   public static final short adFilterConflictingRecords = 5;
00028 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/HiPerfProvider/Server.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • HiPerfProvider

Server.Cpp

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////
00002
00003 //
00004
00005 //  Server.cpp
00006
00007 //
00008
00009 //  Module: WMI high performance provider sample code
00010
00011 //
00012
00013 //  Generic COM server framework, adapted for the BasicHiPerf provider
00014
00015 //  sample.  This module contains nothing specific to the BasicHiPerf
00016
00017 //  provider except what is defined in the section bracketed by the
00018
00019 //  CLSID SPECIFIC comments below.
00020
00021 //
00022
00023 //
00024
00025 //
00026
00027 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00028 //
00029 ////////////////////////////////////////////////////////////////////////
00030
00031 #include <windows.h>
00032 #include <stdio.h>
00033 #include <time.h>
00034 #include <locale.h>
00035 #include <initguid.h>
00036
00037 #define STRSAFE_NO_DEPRECATE
00038 #include <strsafe.h>
00039
00040
00041 #include "Factory.h"
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 //
00045 //  BEGIN CLSID SPECIFIC SECTION
00046 //
00047 //
00048
00049 // For new providers, this is the only area that needs to be modified in this
00050 // file.  Include any appropriate header files, a unique CLSID and update
00051 // the macros.
00052
00053 #include "wbemprov.h"
00054 #include "BasicHiPerf.h"
00055
00056 // {B56B1D80-AA4F-11d2-B348-00105A1469B7}
00057 DEFINE_GUID(CLSID_BasicHiPerf_v1,
00058 0xb56b1d80, 0xaa4f, 0x11d2, 0xb3, 0x48, 0x0, 0x10, 0x5a, 0x14, 0x69, 0xb7);
00059
00060 #define IMPLEMENTED_CLSID           CLSID_BasicHiPerf_v1
00061 #define SERVER_REGISTRY_COMMENT     L"WMI Basic HiPerf Provider"
00062 #define CPP_CLASS_NAME              CHiPerfProvider
00063 #define INTERFACE_CAST              (IWbemHiPerfProvider*)
00064
00065 //
00066 //  END CLSID SPECIFIC SECTION
00067 //
00068 /////////////////////////////////////////////////////////////////////////////
00069
00070
00071 HINSTANCE g_hInstance;
00072 long g_lLocks = 0;
00073 long g_lObjects = 0;
00074
00075 //***************************************************************************
00076 //
00077 //  DllMain
00078 //
00079 //  Dll entry point.
00080 //
00081 //  PARAMETERS:
00082 //
00083 //      HINSTANCE hinstDLL      The handle to our DLL.
00084 //      DWORD dwReason          DLL_PROCESS_ATTACH on load,
00085 //                              DLL_PROCESS_DETACH on shutdown,
00086 //                              DLL_THREAD_ATTACH/DLL_THREAD_DETACH otherwise.
00087 //      LPVOID lpReserved       Reserved
00088 //
00089 //  RETURN VALUES:
00090 //
00091 //      TRUE is successful, FALSE if a fatal error occured.
00092 //      NT behaves very ugly if FALSE is returned.
00093 //
00094 //***************************************************************************
00095 BOOL WINAPI DllMain(
00096     HINSTANCE hinstDLL,
00097     DWORD dwReason,
00098     LPVOID lpReserved
00099     )
00100 {
00101     if (dwReason == DLL_PROCESS_ATTACH)
00102     {
00103         setlocale(LC_ALL, "");      // Set to the 'current' locale
00104         g_hInstance = hinstDLL;
00105     }
00106
00107     return TRUE;
00108 }
00109
00110
00111
00112 //***************************************************************************
00113 //
00114 //  DllGetClassObject
00115 //
00116 //  Standard OLE In-Process Server entry point to return an class factory
00117 //  instance.
00118 //
00119 //  PARAMETERS:
00120 //
00121 //  RETURNS:
00122 //
00123 //      S_OK                Success
00124 //      E_NOINTERFACE       An interface other that IClassFactory was asked for
00125 //      E_OUTOFMEMORY
00126 //      E_FAILED            Initialization failed, or an unsupported clsid was
00127 //                          asked for.
00128 //
00129 //***************************************************************************
00130
00131 STDAPI DllGetClassObject(
00132     REFCLSID rclsid,
00133     REFIID riid,
00134     LPVOID * ppv
00135     )
00136 {
00137     CClassFactory *pClassFactory = NULL;
00138   HRESULT hRes;
00139
00140     //  Verify the caller is asking for our type of object
00141   // ===================================================
00142
00143     if (IMPLEMENTED_CLSID == rclsid)
00144   {
00145     // Create the class factory
00146     // ========================
00147
00148     pClassFactory = new CClassFactory;
00149
00150     if (!pClassFactory)
00151       return E_OUTOFMEMORY;
00152
00153     hRes = pClassFactory->QueryInterface(riid, ppv);
00154     if (FAILED(hRes))
00155     {
00156       delete pClassFactory;
00157       return hRes;
00158     }
00159     hRes = S_OK;
00160   }
00161   else
00162     hRes = CLASS_E_CLASSNOTAVAILABLE;
00163
00164     return hRes;
00165 }
00166
00167 //***************************************************************************
00168 //
00169 //  DllCanUnloadNow
00170 //
00171 //  Standard OLE entry point for server shutdown request. Allows shutdown
00172 //  only if no outstanding objects or locks are present.
00173 //
00174 //  RETURN VALUES:
00175 //
00176 //      S_OK        May unload now.
00177 //      S_FALSE     May not.
00178 //
00179 //***************************************************************************
00180
00181 STDAPI DllCanUnloadNow(void)
00182 {
00183     HRESULT hRes = S_FALSE;
00184
00185     if (0 == g_lLocks && 0 == g_lObjects)
00186         hRes = S_OK;
00187
00188     return hRes;
00189 }
00190
00191 //***************************************************************************
00192 //
00193 //  DllRegisterServer
00194 //
00195 //  Standard OLE entry point for registering the server.
00196 //
00197 //  RETURN VALUES:
00198 //
00199 //      S_OK        Registration was successful
00200 //      E_FAIL      Registration failed.
00201 //
00202 //***************************************************************************
00203
00204 STDAPI DllRegisterServer(void)
00205 {
00206     wchar_t Path[MAX_PATH + 1];
00207     wchar_t pGuidStr[128];
00208     wchar_t KeyPath[1024];
00209
00210     // Get the dll's filename
00211     // ======================
00212
00213   memset (Path, NULL, sizeof(Path));
00214     GetModuleFileNameW(g_hInstance, Path, sizeof(Path)/sizeof(wchar_t) - 1);
00215
00216     // Convert CLSID to string.
00217     // ========================
00218
00219     StringFromGUID2(IMPLEMENTED_CLSID, pGuidStr, sizeof(pGuidStr));
00220   StringCbPrintfW(KeyPath, sizeof(KeyPath), L"Software\\Classes\\CLSID\\\\%s", pGuidStr);
00221
00222     // Place it in registry.
00223     // CLSID\\CLSID_Nt5PerProvider_v1 : <no_name> : "name"
00224     //      \\CLSID_Nt5PerProvider_v1\\InProcServer32 : <no_name> : "path to DLL"
00225     //                                    : ThreadingModel : "both"
00226     // ==============================================================
00227
00228     HKEY hKey;
00229     LONG lRes = RegCreateKeyExW( HKEY_LOCAL_MACHINE, KeyPath, 0, NULL,
00230                     REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00231                     &hKey, NULL );
00232     if (lRes)
00233         return E_FAIL;
00234
00235     wchar_t *pName = SERVER_REGISTRY_COMMENT;
00236     RegSetValueExW(hKey, 0, 0, REG_SZ, (const BYTE *) pName,
00237     (DWORD)(wcslen(pName) * sizeof(wchar_t) + sizeof(wchar_t)));
00238
00239     HKEY hSubkey;
00240     lRes = RegCreateKeyEx(hKey, "InprocServer32", 0, NULL,
00241                     REG_OPTION_NON_VOLATILE, KEY_WRITE,
00242           NULL, &hSubkey, NULL);
00243
00244     RegSetValueExW(hSubkey, 0, 0, REG_SZ, (const BYTE *) Path,
00245     (DWORD)(wcslen(Path) * sizeof(wchar_t) + sizeof(wchar_t)));
00246     RegSetValueExW(hSubkey, L"ThreadingModel", 0, REG_SZ, (const BYTE *) L"Both",
00247     (DWORD)(wcslen(L"Both") * sizeof(wchar_t) + sizeof(wchar_t)));
00248
00249     RegCloseKey(hSubkey);
00250     RegCloseKey(hKey);
00251
00252
00253     return S_OK;
00254 }
00255
00256 //***************************************************************************
00257 //
00258 //  DllUnregisterServer
00259 //
00260 //  Standard OLE entry point for unregistering the server.
00261 //
00262 //  RETURN VALUES:
00263 //
00264 //      S_OK        Unregistration was successful
00265 //      E_FAIL      Unregistration failed.
00266 //
00267 //***************************************************************************
00268
00269 STDAPI DllUnregisterServer(void)
00270 {
00271     wchar_t pGuidStr[128];
00272     HKEY hKey;
00273     wchar_t KeyPath[256];
00274
00275     StringFromGUID2(IMPLEMENTED_CLSID, pGuidStr, sizeof(pGuidStr));
00276   StringCbPrintfW(KeyPath, sizeof(KeyPath), L"Software\\Classes\\CLSID\\\\%s", pGuidStr);
00277
00278     // Delete InProcServer32 subkey.
00279     // =============================
00280     LONG lRes = RegOpenKeyExW(HKEY_LOCAL_MACHINE, KeyPath, 0, KEY_WRITE, &hKey);
00281     if (lRes)
00282         return E_FAIL;
00283
00284
00285     RegDeleteKeyW(hKey, L"InprocServer32");
00286     RegCloseKey(hKey);
00287
00288     // Delete CLSID GUID key.
00289     // ======================
00290
00291     lRes = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\CLSID", 0, KEY_WRITE, &hKey);
00292     if (lRes)
00293         return E_FAIL;
00294
00295     RegDeleteKeyW(hKey, pGuidStr);
00296     RegCloseKey(hKey);
00297
00298     return S_OK;
00299 }
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/GraphObj/Point.h Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • GraphObj

Point.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 // Point.h : Declaration of the CPoint
00013
00014 #ifndef __POINT_H_
00015 #define __POINT_H_
00016
00017 #include "resource.h"       // main symbols
00018 #include "IPersistStm.h"
00019
00020 /////////////////////////////////////////////////////////////////////////////
00021 // CPoint
00022 //
00023 // This class implements a persistable point object.
00024 //
00025
00026 class ATL_NO_VTABLE CPoint :
00027   public CComObjectRootEx<CComSingleThreadModel>,
00028   public CComCoClass<CPoint, &CLSID_Point>,
00029   public IMyPersistStreamImpl<CPoint>,
00030   public IDispatchImpl<IPoint, &IID_IPoint, &LIBID_GRAPHOBJLib>
00031 {
00032 private:
00033   typedef struct {
00034     long x, y;
00035   } POINT;
00036
00037   POINT m_Point;
00038
00039 public:
00040   CPoint()
00041   {
00042   }
00043
00044 DECLARE_REGISTRY_RESOURCEID(IDR_POINT)
00045 DECLARE_NOT_AGGREGATABLE(CPoint)
00046
00047 BEGIN_COM_MAP(CPoint)
00048   COM_INTERFACE_ENTRY(IPoint)
00049   COM_INTERFACE_ENTRY(IDispatch)
00050   COM_INTERFACE_ENTRY_IMPL_IID(IID_IPersistStream, IMyPersistStream)
00051 END_COM_MAP()
00052
00053
00054 // IMyPersistStream
00055   BOOL  m_bRequiresSave;
00056   STDMETHOD(IMyPersistStreamImpl_Load)(LPSTREAM pStm);
00057   STDMETHOD(IMyPersistStreamImpl_Save)(LPSTREAM pStm, BOOL fClearDirty);
00058   STDMETHOD(IMyPersistStreamImpl_GetSizeMax)(ULARGE_INTEGER FAR* pcbSize);
00059
00060
00061 // IPoint
00062 public:
00063   STDMETHOD(get_y)(/*[out, retval]*/ long *pVal);
00064   STDMETHOD(put_y)(/*[in]*/ long newVal);
00065   STDMETHOD(get_x)(/*[out, retval]*/ long *pVal);
00066   STDMETHOD(put_x)(/*[in]*/ long newVal);
00067 };
00068
00069 #endif //__POINT_H_
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/ExtObjData.h Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

ExtObjData.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ExtObjData.h
00007 //
00008 //  Implementation File:
00009 //      ExtObjData.cpp
00010 //
00011 //  Description:
00012 //      Definition of the context menu, property sheet, and wizard funcitons.
00013 //
00014 //  Author:
00015 //      <name> (<e-mail name>) Mmmm DD, 2003
00016 //
00017 //  Revision History:
00018 //
00019 //  Notes:
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #pragma once
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Include Files
00027 /////////////////////////////////////////////////////////////////////////////
00028
00029 #pragma warning( push )
00030 #include <CluAdmEx.h>   // for IWCContextMenuCallback
00031 #pragma warning( pop )
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // Forward Class Declarations
00035 /////////////////////////////////////////////////////////////////////////////
00036
00037 //class CObjData;
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // Global Function Declarations
00041 /////////////////////////////////////////////////////////////////////////////
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 // class CObjData
00045 /////////////////////////////////////////////////////////////////////////////
00046
00047 class CObjData
00048 {
00049 protected:
00050     CLUADMEX_OBJECT_TYPE    m_cot;
00051     CString                 m_strName;
00052     CRuntimeClass **        m_rgprtcPSPages;    // Property Sheet pages
00053     CRuntimeClass **        m_rgprtcWizPages;   // Wizard pages
00054
00055     virtual HRESULT
00056     AddContextMenuItem(
00057                   IWCContextMenuCallback * piCallbackIn
00058                 , UINT    nMenuItem
00059                 , UINT    nMenuItemDesc
00060                 , UINT    nBaseID
00061                 , ULONG   uFlags
00062                 );
00063
00064     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00065
00066 public:
00067
00068     CObjData( void )
00069     {
00070         m_cot = CLUADMEX_OT_NONE;
00071         m_rgprtcPSPages = NULL;
00072         m_rgprtcWizPages = NULL;
00073     } // *** CObjData
00074
00075     virtual ~CObjData( void ) {}
00076
00077     static HRESULT
00078     S_HrCreateObject(
00079           IUnknown *    piDataIn
00080         , CObjData **   ppodOut
00081         );
00082
00083     virtual HRESULT
00084     AddContextMenuItems(
00085         IWCContextMenuCallback * piCallbackIn
00086         )
00087     {
00088         UNREFERENCED_PARAMETER( piCallbackIn );
00089         return E_NOTIMPL;
00090     } // *** AddContextMenuItems
00091
00092     virtual HRESULT
00093     InvokeCommand(
00094         ULONG nCommandIDIn
00095         )
00096     {
00097         UNREFERENCED_PARAMETER( nCommandIDIn);
00098         return E_NOTIMPL;
00099     } // *** InvokeCommand
00100
00101     virtual HRESULT
00102     GetPropertySheetPages(
00103         CRuntimeClass *** ppaPropSheetsOut
00104         )
00105     {
00106         UNREFERENCED_PARAMETER( ppaPropSheetsOut );
00107         return E_NOTIMPL;
00108     } // *** GetPropertySheetPages
00109
00110     virtual HRESULT
00111     GetWizardPages(
00112         CRuntimeClass *** ppaWizardPagesOut
00113         )
00114     {
00115         UNREFERENCED_PARAMETER( ppaWizardPagesOut );
00116         return E_NOTIMPL;
00117     } // *** GetWizardPages
00118
00119     virtual CString
00120     StrName( void )
00121     {
00122         return m_strName;
00123     } // *** StrName
00124
00125     CLUADMEX_OBJECT_TYPE
00126     Cot( void )
00127     {
00128         return m_cot;
00129     } // *** Cot
00130
00131 };  //*** class CObjData
00132
00133 /////////////////////////////////////////////////////////////////////////////
00134 // class CClusterData
00135 /////////////////////////////////////////////////////////////////////////////
00136
00137 class CClusterData
00138     : public CObjData
00139 {
00140 private:
00141     HCLUSTER    m_hCluster;         // This is a copy, don't free it.
00142     CString     m_strClusterName;
00143
00144 protected:
00145     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00146
00147 public:
00148     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00149     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00150
00151     HCLUSTER GetHCluster( void ) { return m_hCluster; };
00152
00153 };  //*** class CClusterData
00154
00155 /////////////////////////////////////////////////////////////////////////////
00156 // class CNodeData
00157 /////////////////////////////////////////////////////////////////////////////
00158
00159 class CNodeData
00160     : public CObjData
00161 {
00162 private:
00163     HNODE   m_hNode;    // This is a copy, don't free it.
00164
00165 protected:
00166     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00167
00168 public:
00169
00170     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00171     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00172
00173     HNODE GetHNode( void ) { return m_hNode; };
00174
00175 };  //*** class CNodeData
00176
00177 /////////////////////////////////////////////////////////////////////////////
00178 // class CGroupData
00179 /////////////////////////////////////////////////////////////////////////////
00180
00181 class CGroupData
00182     : public CObjData
00183 {
00184 private:
00185     HGROUP  m_hGroup;   // This is a copy, don't free it.
00186
00187 protected:
00188     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00189
00190 public:
00191
00192     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00193     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00194
00195     HGROUP GetHGroup( void ) { return m_hGroup; };
00196
00197 };  //*** class CGroupData
00198
00199 /////////////////////////////////////////////////////////////////////////////
00200 // class CResData
00201 /////////////////////////////////////////////////////////////////////////////
00202
00203 class CResData
00204     : public CObjData
00205 {
00206 private:
00207     HRESOURCE   m_hResource;        // This is a copy, don't free it.
00208     CString     m_strResTypeName;
00209     BOOL        m_fSupportedType;   // Is this resource a type that we explicitly extend?
00210
00211 protected:
00212     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00213
00214 public:
00215     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00216     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00217     virtual HRESULT GetPropertySheetPages( CRuntimeClass *** ppaPropSheetsOut );
00218     virtual HRESULT GetWizardPages( CRuntimeClass *** ppaWizardPagesOut );
00219
00220     HRESOURCE GetHResource( void ) { return m_hResource; };
00221
00222 }; //*** class CResData
00223
00224 /////////////////////////////////////////////////////////////////////////////
00225 // class CResTypeData
00226 /////////////////////////////////////////////////////////////////////////////
00227
00228 class CResTypeData
00229     : public CObjData
00230 {
00231 private:
00232     BOOL        m_fSupportedType;   // Is this restype one that we explicitly extend?
00233
00234 protected:
00235     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00236
00237 public:
00238     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00239     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00240
00241 };  //*** class CResData
00242
00243 /////////////////////////////////////////////////////////////////////////////
00244 // class CNetworkData
00245 /////////////////////////////////////////////////////////////////////////////
00246
00247 class CNetworkData
00248     : public CObjData
00249 {
00250 private:
00251     HNETWORK    m_hNetwork;     // This is a copy, don't free it.
00252
00253 protected:
00254     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00255
00256 public:
00257
00258     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00259     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00260
00261     HNETWORK GetHNetwork( void ) { return m_hNetwork; };
00262
00263 };  //*** class CNetworkData
00264
00265 /////////////////////////////////////////////////////////////////////////////
00266 // class CNetInterfaceData
00267 /////////////////////////////////////////////////////////////////////////////
00268
00269 class CNetInterfaceData
00270     : public CObjData
00271 {
00272 private:
00273     HNETINTERFACE   m_hNetInterface;    // This is a copy, don't free it.
00274
00275 protected:
00276     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00277
00278 public:
00279
00280     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00281     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00282
00283     HNETINTERFACE GetHNetInterface( void ) { return m_hNetInterface; };
00284
00285 };  //*** class CNetInterfaceData
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/ICOMAdminCatalog.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

ICOMAdminCatalog.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface ICOMAdminCatalog
00019 /** @com.interface(iid=DD662187-DFC2-11D1-A2CF-00805FC79235, thread=AUTO, type=DUAL) */
00020 public interface ICOMAdminCatalog extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=METHOD, name="GetCollection", addFlagsVtable=4)
00023       @com.parameters([in,type=STRING] bstrCollName, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00024   public Object GetCollection(String bstrCollName);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=METHOD, name="Connect", addFlagsVtable=4)
00027       @com.parameters([in,type=STRING] bstrConnectString, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00028   public Object Connect(String bstrConnectString);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=PROPGET, name="MajorVersion", addFlagsVtable=4)
00031       @com.parameters([type=I4] return) */
00032   public int getMajorVersion();
00033
00034   /** @com.method(vtoffset=7, dispid=4, type=PROPGET, name="MinorVersion", addFlagsVtable=4)
00035       @com.parameters([type=I4] return) */
00036   public int getMinorVersion();
00037
00038   /** @com.method(vtoffset=8, dispid=5, type=METHOD, name="GetCollectionByQuery", addFlagsVtable=4)
00039       @com.parameters([in,type=STRING] bstrCollName, [in,vt=16396,type=SAFEARRAY] aQuery, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00040   public Object GetCollectionByQuery(String bstrCollName, com.ms.com.SafeArray aQuery);
00041
00042   /** @com.method(vtoffset=9, dispid=6, type=METHOD, name="ImportComponent", addFlagsVtable=4)
00043       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrCLSIDOrProgId) */
00044   public void ImportComponent(String bstrApplIdOrName, String bstrCLSIDOrProgId);
00045
00046   /** @com.method(vtoffset=10, dispid=7, type=METHOD, name="InstallComponent", addFlagsVtable=4)
00047       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrDLL, [in,type=STRING] bstrTLB, [in,type=STRING] bstrPSDLL) */
00048   public void InstallComponent(String bstrApplIdOrName, String bstrDLL, String bstrTLB, String bstrPSDLL);
00049
00050   /** @com.method(vtoffset=11, dispid=8, type=METHOD, name="ShutdownApplication", addFlagsVtable=4)
00051       @com.parameters([in,type=STRING] bstrApplIdOrName) */
00052   public void ShutdownApplication(String bstrApplIdOrName);
00053
00054   /** @com.method(vtoffset=12, dispid=9, type=METHOD, name="ExportApplication", addFlagsVtable=4)
00055       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrApplicationFile, [in,type=I4] lOptions) */
00056   public void ExportApplication(String bstrApplIdOrName, String bstrApplicationFile, int lOptions);
00057
00058   /** @com.method(vtoffset=13, dispid=10, type=METHOD, name="InstallApplication", addFlagsVtable=4)
00059       @com.parameters([in,type=STRING] bstrApplicationFile, [in,type=STRING] bstrDestinationDirectory, [in,type=I4] lOptions, [in,type=STRING] bstrUserId, [in,type=STRING] bstrPassword, [in,type=STRING] bstrRSN) */
00060   public void InstallApplication(String bstrApplicationFile, String bstrDestinationDirectory, int lOptions, String bstrUserId, String bstrPassword, String bstrRSN);
00061
00062   /** @com.method(vtoffset=14, dispid=11, type=METHOD, name="StopRouter", addFlagsVtable=4)
00063       @com.parameters() */
00064   public void StopRouter();
00065
00066   /** @com.method(vtoffset=15, dispid=12, type=METHOD, name="RefreshRouter", addFlagsVtable=4)
00067       @com.parameters() */
00068   public void RefreshRouter();
00069
00070   /** @com.method(vtoffset=16, dispid=13, type=METHOD, name="StartRouter", addFlagsVtable=4)
00071       @com.parameters() */
00072   public void StartRouter();
00073
00074   /** @com.method(vtoffset=17, dispid=14, type=METHOD, name="Reserved1", addFlagsVtable=4)
00075       @com.parameters() */
00076   public void Reserved1();
00077
00078   /** @com.method(vtoffset=18, dispid=15, type=METHOD, name="Reserved2", addFlagsVtable=4)
00079       @com.parameters() */
00080   public void Reserved2();
00081
00082   /** @com.method(vtoffset=19, dispid=16, type=METHOD, name="InstallMultipleComponents", addFlagsVtable=4)
00083       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,vt=16396,type=SAFEARRAY] varFileNames, [in,vt=16396,type=SAFEARRAY] varCLSIDS) */
00084   public void InstallMultipleComponents(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS);
00085
00086   /** @com.method(vtoffset=20, dispid=17, type=METHOD, name="GetMultipleComponentsInfo", addFlagsVtable=4)
00087       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,vt=16396,type=SAFEARRAY] varFileNames, [out,vt=16396,type=SAFEARRAY] varCLSIDS, [out,vt=16396,type=SAFEARRAY] varClassNames, [out,vt=16396,type=SAFEARRAY] varFileFlags, [out,vt=16396,type=SAFEARRAY] varComponentFlags) */
00088   public void GetMultipleComponentsInfo(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS, com.ms.com.SafeArray varClassNames, com.ms.com.SafeArray varFileFlags, com.ms.com.SafeArray varComponentFlags);
00089
00090   /** @com.method(vtoffset=21, dispid=18, type=METHOD, name="RefreshComponents", addFlagsVtable=4)
00091       @com.parameters() */
00092   public void RefreshComponents();
00093
00094   /** @com.method(vtoffset=22, dispid=19, type=METHOD, name="BackupREGDB", addFlagsVtable=4)
00095       @com.parameters([in,type=STRING] bstrBackupFilePath) */
00096   public void BackupREGDB(String bstrBackupFilePath);
00097
00098   /** @com.method(vtoffset=23, dispid=20, type=METHOD, name="RestoreREGDB", addFlagsVtable=4)
00099       @com.parameters([in,type=STRING] bstrBackupFilePath) */
00100   public void RestoreREGDB(String bstrBackupFilePath);
00101
00102   /** @com.method(vtoffset=24, dispid=21, type=METHOD, name="QueryApplicationFile", addFlagsVtable=4)
00103       @com.parameters([in,type=STRING] bstrApplicationFile, [out,size=1,elementType=STRING,type=ARRAY] bstrApplicationName, [out,size=1,elementType=STRING,type=ARRAY] bstrApplicationDescription, [out,size=1,elementType=BOOLEAN,type=ARRAY] bHasUsers, [out,size=1,elementType=BOOLEAN,type=ARRAY] bIsProxy, [out,vt=16396,type=SAFEARRAY] varFileNames) */
00104   public void QueryApplicationFile(String bstrApplicationFile, String[] bstrApplicationName, String[] bstrApplicationDescription, boolean[] bHasUsers, boolean[] bIsProxy, com.ms.com.SafeArray varFileNames);
00105
00106   /** @com.method(vtoffset=25, dispid=22, type=METHOD, name="StartApplication", addFlagsVtable=4)
00107       @com.parameters([in,type=STRING] bstrApplIdOrName) */
00108   public void StartApplication(String bstrApplIdOrName);
00109
00110   /** @com.method(vtoffset=26, dispid=23, type=METHOD, name="ServiceCheck", addFlagsVtable=4)
00111       @com.parameters([in,type=I4] lService, [type=I4] return) */
00112   public int ServiceCheck(int lService);
00113
00114   /** @com.method(vtoffset=27, dispid=24, type=METHOD, name="InstallMultipleEventClasses", addFlagsVtable=4)
00115       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,vt=16396,type=SAFEARRAY] varFileNames, [in,vt=16396,type=SAFEARRAY] varCLSIDS) */
00116   public void InstallMultipleEventClasses(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS);
00117
00118   /** @com.method(vtoffset=28, dispid=25, type=METHOD, name="InstallEventClass", addFlagsVtable=4)
00119       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrDLL, [in,type=STRING] bstrTLB, [in,type=STRING] bstrPSDLL) */
00120   public void InstallEventClass(String bstrApplIdOrName, String bstrDLL, String bstrTLB, String bstrPSDLL);
00121
00122   /** @com.method(vtoffset=29, dispid=26, type=METHOD, name="GetEventClassesForIID", addFlagsVtable=4)
00123       @com.parameters([in,type=STRING] bstrIID, [out,vt=16396,type=SAFEARRAY] varCLSIDS, [out,vt=16396,type=SAFEARRAY] varProgIDs, [out,vt=16396,type=SAFEARRAY] varDescriptions) */
00124   public void GetEventClassesForIID(String bstrIID, com.ms.com.SafeArray varCLSIDS, com.ms.com.SafeArray varProgIDs, com.ms.com.SafeArray varDescriptions);
00125
00126
00127   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xdd662187, (short)0xdfc2, (short)0x11d1, (byte)0xa2, (byte)0xcf, (byte)0x0, (byte)0x80, (byte)0x5f, (byte)0xc7, (byte)0x92, (byte)0x35);
00128 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/RegisterServer.Cpp Source File

  • WinUI
  • Shell
  • ColumnProvider

RegisterServer.Cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  RegisterServer.cpp
00011 //
00012 //      Registers the Column Provider in the registry. The following
00013 //      registry keys will be created to register the column provider.
00014 //
00015 //          HKEY_CLASSES_ROOT\CLSID\{CLSID}
00016 //          HKEY_CLASSES_ROOT\CLSID\{CLSID}\InProcServer32
00017 //          HKEY_CLASSES_ROOT\Folder\ShellEx\ColumnHandlers
00018 //
00019 //////////////////////////////////////////////////////////////////////
00020
00021 #include "ShortName.h"
00022 #include "Resource.h"
00023 #include <sddl.h>
00024
00025 PSECURITY_DESCRIPTOR WINAPI CreateNullDacl ();
00026 VOID WINAPI FreeNullDacl (PSECURITY_DESCRIPTOR psd);
00027
00028 extern HINSTANCE hDllInstance;
00029
00030 STDAPI DllRegisterServer (VOID)
00031 {
00032     TCHAR       szModuleName[MAX_PATH];
00033     HRESULT     hResult = S_OK;
00034     TCHAR       szBuffer[MAX_PATH+10] = TEXT("");
00035     TCHAR       szClsid[MAX_PATH] = TEXT("");
00036     TCHAR       szSubKey[MAX_PATH] = TEXT("");
00037     TCHAR       szColumnProvider[MAX_PATH] = TEXT("");
00038     TCHAR       szDescription[MAX_PATH] = TEXT("");
00039
00040     SECURITY_ATTRIBUTES SA;
00041     SA.nLength = sizeof(SECURITY_ATTRIBUTES);
00042     SA.bInheritHandle = TRUE;
00043     WCHAR *pwszSD=L"D:(A;OICI;GA;;;SY)(A;OICI;GA;;;BA)(A;OICI;GA;;;CO)(A;OICI;GRGWGX;;;IU)";
00044     //
00045     //  Load some necessary string values
00046     //
00047     //
00048     //  Initialize the security attributes structure
00049     //
00050     if (ConvertStringSecurityDescriptorToSecurityDescriptor(pwszSD,
00051                   SDDL_REVISION_1,
00052                   &(SA.lpSecurityDescriptor),
00053                   NULL))
00054       {
00055   LoadString (hDllInstance, IDS_CLSID, szClsid, MAX_PATH);
00056   LoadString (hDllInstance, IDS_DESCRIPTION, szDescription, MAX_PATH);
00057   LoadString (hDllInstance, IDS_REGKEY_COLUMNPROVIDER, szColumnProvider, MAX_PATH);
00058
00059
00060   //
00061   //  Get the name of this module
00062   //
00063   GetModuleFileName (hDllInstance, szModuleName, MAX_PATH);
00064
00065   //
00066   //  Register the component under HKCR\CLSID
00067   //
00068   HKEY    hKey            = NULL;
00069   DWORD   dwDisposition   = 0;
00070   LRESULT lResult         = 0;
00071
00072   wsprintf (szSubKey, TEXT("CLSID\\%s"), szClsid);
00073   lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
00074           0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00075           &SA, &hKey, &dwDisposition);
00076
00077   if (lResult == NOERROR)
00078     {
00079       lResult = RegSetValueEx (hKey, TEXT(""), 0, REG_SZ,
00080              (LPBYTE) szDescription, GetStringByteSize(szDescription));
00081       if (lResult != NOERROR)
00082         hResult = SELFREG_E_CLASS;
00083       RegCloseKey (hKey);
00084       hKey = NULL;
00085     }
00086   else
00087     {
00088       hResult = SELFREG_E_CLASS;
00089     }
00090
00091   //
00092   //  Register component information under HKCR\CLSID\{CLSID}
00093   //
00094   StrCatBuff (szSubKey, TEXT("\\InprocServer32"), ARRAYSIZE(szSubKey));
00095   lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
00096           0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00097           &SA, &hKey, &dwDisposition);
00098
00099   if (lResult == NOERROR)
00100     {
00101       lstrcpyn (szBuffer, TEXT("Apartment"), ARRAYSIZE(szBuffer));
00102       lResult = RegSetValueEx (hKey, TEXT("ThreadingModel"), 0,
00103              REG_SZ, (LPBYTE) szBuffer, GetStringByteSize (szBuffer));
00104       if (lResult != NOERROR)
00105         hResult = SELFREG_E_CLASS;
00106
00107       lResult = RegSetValueEx (hKey, TEXT(""), 0,
00108              REG_SZ, (LPBYTE) szModuleName, GetStringByteSize(szModuleName));
00109       if (lResult != NOERROR)
00110         hResult = SELFREG_E_CLASS;
00111
00112       RegCloseKey (hKey);
00113       hKey = NULL;
00114     }
00115   else
00116     {
00117       hResult = SELFREG_E_CLASS;
00118     }
00119
00120   //
00121   //  Register the component as a column provider extension under
00122   //  HKCR\Folder\shellex\ColumnHandlers
00123   //
00124   wsprintf (szSubKey, TEXT("%s\\%s"), szColumnProvider, szClsid);
00125   lResult = RegCreateKeyEx (HKEY_CLASSES_ROOT, szSubKey,
00126           0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00127           &SA, &hKey, &dwDisposition);
00128
00129   if (lResult != NOERROR)
00130     {
00131       hResult = SELFREG_E_CLASS;
00132     }
00133
00134   LocalFree(SA.lpSecurityDescriptor);
00135       } else {
00136   hResult = E_FAIL;
00137       }
00138
00139     return hResult;
00140 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFont Member List

This is the complete list of members for CFont, including all inherited members.
_fDel | CFont | [protected]
_hfont | CFont | [protected]
CFont(HFONT hfont) | CFont |
CFont(TCHAR *szFace, int iHeight, BOOL fBold=FALSE, BOOL fItalic=FALSE, BOOL fUnder=FALSE) | CFont |
Choose(HWND hwnd) | CFont |
Create(LOGFONT &lf) | CFont |
operator HFONT() const | CFont | [inline]
Update(int iHeight, BOOL fBold=FALSE) | CFont |
~CFont() | CFont |
Generated on Wed Nov 13 2024 16:56:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/hatch.c Source File

  • Com
  • Fundamentals
  • OleStd

hatch.c

Go to the documentation of this file.
00001 /*
00002  * HATCH.C
00003  *
00004  * Miscellaneous API's to generate hatch window for in-place active
00005  * objects. This is part of the OLE 2.0 User Interface Support Library.
00006  *
00007  * Copyright (c)1993 - 2000 Microsoft Corporation, All Right Reserved
00008  */
00009
00010 #define STRICT  1
00011 #include "olestd.h"
00012
00013 // offsets in the extra bytes stored with the hatch window
00014 #define EB_HATCHWIDTH       0
00015 #define EB_HATCHRECT_LEFT   2
00016 #define EB_HATCHRECT_TOP    4
00017 #define EB_HATCHRECT_RIGHT  6
00018 #define EB_HATCHRECT_BOTTOM 8
00019
00020 // class name of hatch window
00021 #define CLASS_HATCH     "Hatch Window"
00022
00023 // local function prototypes
00024 LRESULT FAR PASCAL EXPORT HatchWndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
00025
00026
00027 /*
00028  * HatchRegisterClass
00029  *
00030  * Purpose:
00031  *  Register the hatch window
00032  *
00033  * Parameters:
00034  *  hInst           Process instance
00035  *
00036  * Return Value:
00037  *  TRUE            if successful
00038  *  FALSE           if failed
00039  *
00040  */
00041 STDAPI_(BOOL) RegisterHatchWindowClass(HINSTANCE hInst)
00042 {
00043    WNDCLASS wc;
00044
00045    // Register Hatch Window Class
00046    wc.style = CS_BYTEALIGNWINDOW;
00047    wc.lpfnWndProc = HatchWndProc;
00048    wc.cbClsExtra = 0;
00049    wc.cbWndExtra = 5 * sizeof(int);    // extra bytes stores
00050                               //     uHatchWidth
00051                               //     rcHatchRect
00052    wc.hInstance = hInst;
00053    wc.hIcon = NULL;
00054    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00055    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
00056    wc.lpszMenuName = NULL;
00057    wc.lpszClassName = CLASS_HATCH;
00058
00059    if (!RegisterClass(&wc))
00060       return FALSE;
00061    else
00062       return TRUE;
00063 }
00064
00065
00066 /*
00067  * CreateHatchWindow
00068  *
00069  * Purpose:
00070  *  Create the hatch window
00071  *
00072  * Parameters:
00073  *  hWndParent          parent of hatch window
00074  *  hInst               instance handle
00075  *
00076  * Return Value:
00077  *  pointer to hatch window         if successful
00078  *  NULL                            if failed
00079  *
00080  */
00081 STDAPI_(HWND) CreateHatchWindow(HWND hWndParent, HINSTANCE hInst)
00082 {
00083    HWND         hWnd;
00084
00085    if (!hWndParent || !hInst)
00086       return NULL;
00087
00088    hWnd = CreateWindow(
00089       CLASS_HATCH,
00090       "Hatch Window",
00091       WS_CHILDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
00092       0, 0, 0, 0,
00093       hWndParent,
00094       (HMENU)NULL,
00095       hInst,
00096       0L
00097    );
00098
00099    if (!hWnd)
00100       return NULL;
00101
00102    return hWnd;
00103 }
00104
00105 /*
00106  *  GetHatchWidth
00107  *
00108  *  Purpose:
00109  *      Get width of hatch border
00110  *
00111  *  Parameters:
00112  *      hWndHatch       hatch window handle
00113  *
00114  *  Return Value:
00115  *      width of the hatch border
00116  */
00117 STDAPI_(UINT) GetHatchWidth(HWND hWndHatch)
00118 {
00119    if (!IsWindow(hWndHatch))
00120       return 0;
00121
00122    return (UINT)GetWindowWord(hWndHatch, EB_HATCHWIDTH);
00123 }
00124
00125 /*
00126  *  GetHatchRect
00127  *
00128  *  Purpose:
00129  *      Get hatch rect. this is the size of the hatch window if it were
00130  *      not clipped by the ClipRect.
00131  *
00132  *  Parameters:
00133  *      hWndHatch       hatch window handle
00134  *      lprcHatchRect   hatch rect
00135  *
00136  *  Return Value:
00137  *      none
00138  */
00139 STDAPI_(void) GetHatchRect(HWND hWndHatch, LPRECT lprcHatchRect)
00140 {
00141    if (!IsWindow(hWndHatch)) {
00142       SetRect(lprcHatchRect, 0, 0, 0, 0);
00143       return;
00144    }
00145
00146    lprcHatchRect->left = GetWindowWord(hWndHatch, EB_HATCHRECT_LEFT);
00147    lprcHatchRect->top = GetWindowWord(hWndHatch, EB_HATCHRECT_TOP);
00148    lprcHatchRect->right = GetWindowWord(hWndHatch, EB_HATCHRECT_RIGHT);
00149    lprcHatchRect->bottom = GetWindowWord(hWndHatch, EB_HATCHRECT_BOTTOM);
00150 }
00151
00152
00153 /* SetHatchRect
00154  *
00155  *
00156  *  Purpose:
00157  *      Store hatch rect with HatchRect window.
00158  *      this rect is the size of the hatch window if it were
00159  *      not clipped by the ClipRect.
00160  *
00161  *  Parameters:
00162  *      hWndHatch       hatch window handle
00163  *      lprcHatchRect   hatch rect
00164  *
00165  *  Return Value:
00166  *      none
00167  */
00168 STDAPI_(void) SetHatchRect(HWND hWndHatch, LPRECT lprcHatchRect)
00169 {
00170    if (!IsWindow(hWndHatch))
00171       return;
00172
00173    SetWindowWord(hWndHatch, EB_HATCHRECT_LEFT,  (WORD)lprcHatchRect->left);
00174    SetWindowWord(hWndHatch, EB_HATCHRECT_TOP,   (WORD)lprcHatchRect->top);
00175    SetWindowWord(hWndHatch, EB_HATCHRECT_RIGHT, (WORD)lprcHatchRect->right);
00176    SetWindowWord(hWndHatch, EB_HATCHRECT_BOTTOM,(WORD)lprcHatchRect->bottom);
00177 }
00178
00179
00180 /* SetHatchWindowSize
00181  *
00182  *
00183  *  Purpose:
00184  *      Move/size the HatchWindow correctly given the rect required by the
00185  *      in-place server object window and the lprcClipRect imposed by the
00186  *      in-place container. both rect's are expressed in the client coord.
00187  *      of the in-place container's window (which is the parent of the
00188  *      HatchWindow).
00189  *
00190  *      NOTE: the in-place server must honor the lprcClipRect specified
00191  *      by its in-place container. it must NOT draw outside of the ClipRect.
00192  *      in order to achieve this, the hatch window is sized to be
00193  *      exactly the size that should be visible (rcVisRect). the
00194  *      rcVisRect is defined as the intersection of the full size of
00195  *      the HatchRect window and the lprcClipRect.
00196  *      the ClipRect could infact clip the HatchRect on the
00197  *      right/bottom and/or on the top/left. if it is clipped on the
00198  *      right/bottom then it is sufficient to simply resize the hatch
00199  *      window. but if the HatchRect is clipped on the top/left then
00200  *      in-place server document window (child of HatchWindow) must be moved
00201  *      by the delta that was clipped. the window origin of the
00202  *      in-place server window will then have negative coordinates relative
00203  *      to its parent HatchWindow.
00204  *
00205  *  Parameters:
00206  *      hWndHatch       hatch window handle
00207  *      lprcIPObjRect   full size of in-place server object window
00208  *      lprcClipRect    clipping rect imposed by in-place container
00209  *      lpptOffset      offset required to position in-place server object
00210  *                      window properly. caller should call:
00211  *                          OffsetRect(&rcObjRect,lpptOffset->x,lpptOffset->y)
00212  *
00213  *  Return Value:
00214  *      none
00215  */
00216 STDAPI_(void) SetHatchWindowSize(
00217       HWND        hWndHatch,
00218       LPRECT      lprcIPObjRect,
00219       LPRECT      lprcClipRect,
00220       LPPOINT       lpptOffset
00221 )
00222 {
00223    RECT        rcHatchRect;
00224    RECT        rcVisRect;
00225    UINT        uHatchWidth;
00226    POINT       ptOffset;
00227
00228    if (!IsWindow(hWndHatch))
00229       return;
00230
00231    rcHatchRect = *lprcIPObjRect;
00232    uHatchWidth = GetHatchWidth(hWndHatch);
00233    InflateRect((LPRECT)&rcHatchRect, uHatchWidth + 1, uHatchWidth + 1);
00234
00235    IntersectRect((LPRECT)&rcVisRect, (LPRECT)&rcHatchRect, lprcClipRect);
00236    MoveWindow(
00237          hWndHatch,
00238          rcVisRect.left,
00239          rcVisRect.top,
00240          rcVisRect.right-rcVisRect.left,
00241          rcVisRect.bottom-rcVisRect.top,
00242          TRUE    /* fRepaint */
00243    );
00244    InvalidateRect(hWndHatch, NULL, TRUE);
00245
00246    ptOffset.x = -rcHatchRect.left + (rcHatchRect.left - rcVisRect.left);
00247    ptOffset.y = -rcHatchRect.top + (rcHatchRect.top - rcVisRect.top);
00248
00249    /* convert the rcHatchRect into the client coordinate system of the
00250    **    HatchWindow itself
00251    */
00252    OffsetRect((LPRECT)&rcHatchRect, ptOffset.x, ptOffset.y);
00253
00254    SetHatchRect(hWndHatch, (LPRECT)&rcHatchRect);
00255
00256    // calculate offset required to position in-place server doc window
00257    lpptOffset->x = ptOffset.x;
00258    lpptOffset->y = ptOffset.y;
00259 }
00260
00261
00262 /*
00263  *  HatchWndProc
00264  *
00265  *  Purpose:
00266  *      WndProc for hatch window
00267  *
00268  *  Parameters:
00269  *      hWnd
00270  *      Message
00271  *      wParam
00272  *      lParam
00273  *
00274  *  Return Value:
00275  *      message dependent
00276  */
00277 LRESULT FAR PASCAL EXPORT HatchWndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
00278 {
00279    int nBorderWidth;
00280
00281    switch (Message) {
00282
00283       case WM_CREATE:
00284          nBorderWidth = GetProfileInt(
00285             "windows",
00286             "oleinplaceborderwidth",
00287             DEFAULT_HATCHBORDER_WIDTH
00288          );
00289          SetWindowWord(hWnd, EB_HATCHWIDTH, (WORD)nBorderWidth);
00290          break;
00291
00292       case WM_PAINT:
00293       {
00294          HDC hDC;
00295          PAINTSTRUCT ps;
00296          RECT rcHatchRect;
00297
00298          nBorderWidth = GetHatchWidth(hWnd);
00299          hDC = BeginPaint(hWnd, &ps);
00300          GetHatchRect(hWnd, (LPRECT)&rcHatchRect);
00301          OleUIDrawShading(&rcHatchRect, hDC, OLEUI_SHADE_BORDERIN,
00302                nBorderWidth);
00303          InflateRect((LPRECT)&rcHatchRect, -nBorderWidth, -nBorderWidth);
00304          OleUIDrawHandles(&rcHatchRect, hDC, OLEUI_HANDLES_OUTSIDE,
00305                nBorderWidth+1, TRUE);
00306          EndPaint(hWnd, &ps);
00307          break;
00308       }
00309
00310       /* NOTE: Any window that is used during in-place activation
00311       **    must handle the WM_SETCURSOR message or else the cursor
00312       **    of the in-place parent will be used. if WM_SETCURSOR is
00313       **    not handled, then DefWindowProc sends the message to the
00314       **    window's parent.
00315       */
00316       case WM_SETCURSOR:
00317          SetCursor(LoadCursor( NULL, MAKEINTRESOURCE(IDC_ARROW) ) );
00318          return (LRESULT)TRUE;
00319
00320       default:
00321          return DefWindowProc(hWnd, Message, wParam, lParam);
00322    }
00323
00324    return 0L;
00325 }
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/editsink.cpp Source File

  • WinUI
  • TSFmark

editsink.cpp

Go to the documentation of this file.
00001 //
00002 // editsink.cpp
00003 //
00004 // ITfTextEditSink implementation.
00005 //
00006
00007 #include "globals.h"
00008 #include "mark.h"
00009
00010 //+---------------------------------------------------------------------------
00011 //
00012 // OnEndEdit
00013 //
00014 // Called by the system whenever anyone releases a write-access document lock.
00015 //----------------------------------------------------------------------------
00016
00017 STDAPI CMarkTextService::OnEndEdit(ITfContext *pContext, TfEditCookie ecReadOnly, ITfEditRecord *pEditRecord)
00018 {
00019     ITfRange *pRangeComposition;
00020     IEnumTfRanges *pEnumRanges;
00021     ITfRange *pRange;
00022     ITfContext *pCompositionContext;
00023     TF_SELECTION tfSelection;
00024     BOOL fResult;
00025     BOOL fCancelComposition;
00026     ULONG cFetched;
00027
00028     if (_pComposition == NULL)
00029         return S_OK;
00030
00031     // are we responsible for the edit?
00032     if (pContext->InWriteSession(_tfClientId, &fResult) == S_OK && fResult)
00033         return S_OK;
00034
00035     // is this the context our composition lives in?
00036     if (_pComposition->GetRange(&pRangeComposition) != S_OK)
00037         return S_OK;
00038
00039     if (pRangeComposition->GetContext(&pCompositionContext) != S_OK)
00040         goto Exit;
00041
00042     fResult = IsEqualUnknown(pCompositionContext, pContext);
00043
00044     pCompositionContext->Release();
00045
00046     if (!fResult)
00047         goto Exit; // different context
00048
00049     fCancelComposition = FALSE;
00050
00051     // we're composing in this context, cancel the composition if anything suspicious happened
00052
00053     // did the selection move outside the composition?
00054     if (pEditRecord->GetSelectionStatus(&fResult) == S_OK && fResult)
00055     {
00056         if (pContext->GetSelection(ecReadOnly, TF_DEFAULT_SELECTION, 1, &tfSelection, &cFetched) == S_OK &&
00057             cFetched == 1)
00058         {
00059             if (_pComposition->GetRange(&pRangeComposition) == S_OK)
00060             {
00061                 fResult = IsRangeCovered(ecReadOnly, tfSelection.range, pRangeComposition);
00062
00063                 pRangeComposition->Release();
00064
00065                 if (!fResult)
00066                 {
00067                     fCancelComposition = TRUE;
00068                 }
00069             }
00070             tfSelection.range->Release();
00071         }
00072     }
00073
00074     if (fCancelComposition)
00075         goto CancelComposition;
00076
00077     // did someone else edit the document text?
00078     if (pEditRecord->GetTextAndPropertyUpdates(TF_GTP_INCL_TEXT, NULL, 0, &pEnumRanges) == S_OK)
00079     {
00080         // is the enumerator empty?
00081         if (pEnumRanges->Next(1, &pRange, NULL) == S_OK)
00082         {
00083             pRange->Release();
00084             fCancelComposition = TRUE;
00085         }
00086         pEnumRanges->Release();
00087     }
00088
00089     if (fCancelComposition)
00090     {
00091 CancelComposition:
00092         // we need a write edit session to cancel the composition
00093         _TerminateCompositionInContext(pContext);
00094     }
00095
00096 Exit:
00097     pRangeComposition->Release();
00098     return S_OK;
00099 }
00100
00101 //+---------------------------------------------------------------------------
00102 //
00103 // _InitTextEditSink
00104 //
00105 // Init a text edit sink on the topmost context of the document.
00106 // Always release any previous sink.
00107 //----------------------------------------------------------------------------
00108
00109 BOOL CMarkTextService::_InitTextEditSink(ITfDocumentMgr *pDocMgr)
00110 {
00111     ITfSource *pSource;
00112     BOOL fRet;
00113
00114     // clear out any previous sink first
00115
00116     if (_dwTextEditSinkCookie != TF_INVALID_COOKIE)
00117     {
00118         if (_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
00119         {
00120             pSource->UnadviseSink(_dwTextEditSinkCookie);
00121             pSource->Release();
00122         }
00123
00124         _pTextEditSinkContext->Release();
00125         _pTextEditSinkContext = NULL;
00126         _dwTextEditSinkCookie = TF_INVALID_COOKIE;
00127     }
00128
00129     if (pDocMgr == NULL)
00130         return TRUE; // caller just wanted to clear the previous sink
00131
00132     // setup a new sink advised to the topmost context of the document
00133
00134     if (pDocMgr->GetTop(&_pTextEditSinkContext) != S_OK)
00135         return FALSE;
00136
00137     if (_pTextEditSinkContext == NULL)
00138         return TRUE; // empty document, no sink possible
00139
00140     fRet = FALSE;
00141
00142     if (_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
00143     {
00144         if (pSource->AdviseSink(IID_ITfTextEditSink, (ITfTextEditSink *)this, &_dwTextEditSinkCookie) == S_OK)
00145         {
00146             fRet = TRUE;
00147         }
00148         else
00149         {
00150             _dwTextEditSinkCookie = TF_INVALID_COOKIE;
00151         }
00152         pSource->Release();
00153     }
00154
00155     if (fRet == FALSE)
00156     {
00157         _pTextEditSinkContext->Release();
00158         _pTextEditSinkContext = NULL;
00159     }
00160
00161     return fRet;
00162 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/mqf_draw/stdafx.cpp Source File

  • NetDS
  • MessageQueuing
  • mqf_draw

stdafx.cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 // stdafx.cpp : source file that includes just the standard includes
00013 //  disdraw.pch will be the pre-compiled header
00014 //  stdafx.obj will contain the pre-compiled type information
00015
00016 #include "stdafx.h"
00017
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/netshell/sample.cpp Source File

  • NetDS
  • netshell

sample.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft Netsh Sample.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "nshsamp.h"
00018
00019 extern SAMPLE_HELPER_DATA g_OnlineData;
00020 extern SAMPLE_HELPER_DATA g_OfflineData;
00021 extern PSAMPLE_HELPER_DATA g_CurrentData;
00022 extern HANDLE g_hModule;
00023
00024 DWORD WINAPI
00025 DumpSample(
00026     IN      LPCWSTR     pwszRouter,
00027     IN OUT  LPWSTR     *ppwcArguments,
00028     IN      DWORD       dwArgCount,
00029     IN      LPCVOID     pvData
00030     )
00031 {
00032     //
00033     // Output the string that shows our settings.
00034     // The idea here is to spit out a script that,
00035     // when run from the command line (netsh -f script)
00036     // will cause your component to be configured
00037     // exactly as it is when this dump command was run.
00038     //
00039     PrintMessageFromModule(g_hModule, DUMP_SAMP,
00040                            TOKEN_SET,
00041                            TOKEN_WIDGETS,
00042                            g_CurrentData->WidgetCount,
00043                            TOKEN_SPROCKETS,
00044                            g_CurrentData->SprocketCount);
00045
00046     return NO_ERROR;
00047
00048 }
00049
00050
00051 DWORD WINAPI
00052 HandleAddObjectCommand(
00053 IN      LPCWSTR pwszMachine,
00054 IN OUT  LPWSTR  *ppwcArguments,
00055 IN      DWORD   dwCurrentIndex,
00056 IN      DWORD   dwArgCount,
00057 IN      DWORD   dwFlags,
00058 IN      LPCVOID pvData,
00059 OUT     BOOL    *pbDone)
00060 {
00061     //
00062     // Init the return value to ERROR_SHOW_USAGE.  This value
00063     // if returned, will cause netsh to display the extended
00064     // usage for this command.  (HLP_ADD_OBJECT_EX in this case.)
00065     //
00066     DWORD dwRet = ERROR_SHOW_USAGE;
00067
00068     //
00069     // We know the add xxxx x command has two tokens that we care
00070     // about - the type (widgets, sprockets, all) and the number
00071     // to add after the type.  From that, we know:
00072     // 1.  There should be 4 arguments for a valid command.  No more,
00073     //          no less.
00074     // 2.  The third arg should be one of the three type id's.
00075     // 3.  The fourth arg should be a number.
00076     //
00077
00078     //
00079     // So, for 1, make sure we have 4 args.
00080     //
00081
00082     if (4 == dwArgCount)
00083     {
00084         long lCountToAdd;
00085
00086         //
00087         // We'll take care of 3 first, because we need it converted
00088         // to a number in any case.  CRT function WCSTOL is best to use
00089         // here.
00090         //
00091         if (lCountToAdd = wcstol(ppwcArguments[dwCurrentIndex + 1], NULL, 10))
00092         {
00093             //
00094             // For 2, we'll use MatchToken to match the tokens.
00095             // If we found a match, return ERROR_OKAY so that
00096             // netsh will output an "Ok." string to indicate
00097             // the command was successful.  Returning
00098             // ERROR_SUPPRESS_OUTPUT indicates that the command
00099             // was successful but netsh shouldn't output anything
00100             // to indicate so.
00101             //
00102             if (MatchToken(ppwcArguments[dwCurrentIndex], TOKEN_WIDGETS))
00103             {
00104                 g_CurrentData->WidgetCount += lCountToAdd;
00105                 dwRet = ERROR_OKAY;
00106             }
00107             else if(MatchToken(ppwcArguments[dwCurrentIndex], TOKEN_SPROCKETS))
00108             {
00109                 g_CurrentData->SprocketCount += lCountToAdd;
00110                 dwRet = ERROR_OKAY;
00111             }
00112             else if(MatchToken(ppwcArguments[dwCurrentIndex], TOKEN_ALL))
00113             {
00114                 g_CurrentData->WidgetCount += lCountToAdd;
00115                 g_CurrentData->SprocketCount += lCountToAdd;
00116                 //
00117                 // Since we are returning ERROR_SUPPRESS_OUTPUT
00118                 // to prevent netsh's default "Ok." we will output
00119                 // our own string instead.
00120                 //
00121                 PrintMessageFromModule(g_hModule, GEN_CMD_OKAY);
00122                 dwRet = ERROR_SUPPRESS_OUTPUT;
00123             }
00124         }
00125         else
00126         {
00127             //
00128             // Put a message here telling the user what went wrong.  Note that
00129             // in your .rc file, you need to specify ... (ellipsis) args via
00130             // FormatMessage style, ie %1!s! instead of just %s.
00131             //
00132             PrintMessageFromModule(g_hModule, ERR_NO_VALID_COUNT, ppwcArguments[3]);
00133         }
00134     }
00135     else
00136     {
00137         PrintMessageFromModule(g_hModule, ERR_INVALID_NUM_ARGS, 3);
00138     }
00139
00140     return dwRet;
00141 }
00142
00143 DWORD WINAPI
00144 HandleShowObjectCommand(
00145 IN      LPCWSTR pwszMachine,
00146 IN OUT  LPWSTR  *ppwcArguments,
00147 IN      DWORD   dwCurrentIndex,
00148 IN      DWORD   dwArgCount,
00149 IN      DWORD   dwFlags,
00150 IN      LPCVOID pvData,
00151 OUT     BOOL    *pbDone)
00152 {
00153     //
00154     // Init the return value to ERROR_SHOW_USAGE.  This value
00155     // will cause netsh to display the extended usage for this
00156     // command.
00157     //
00158     DWORD dwRet = ERROR_SHOW_USAGE;
00159
00160     //
00161     // We only need check the first token after the command
00162     // (ppwcArguments[2].  We could use MatchToken like in
00163     // HandleAddObjectCommand, but for the purposes of showing
00164     // examples we'll use MatchEnumTag, though MatchEnumTag
00165     // isn't quite aimed towards this kind of command line
00166     // arrangement.  First, we initialize our valid tokens
00167     // struct.  This is designed to be like a C enum - each
00168     // identifier is associated with a value.  You send it
00169     // a particular argument, it returns you the value
00170     // associated with that argument (if its a valid argument.)
00171     //
00172     //
00173     TOKEN_VALUE ValidTokens[] =
00174     {
00175         {TOKEN_WIDGETS,     WIDGETS},
00176         {TOKEN_SPROCKETS,   SPROCKETS},
00177         {TOKEN_ALL,         ALL}
00178     };
00179
00180     //
00181     // Make sure our arg count is correct.
00182     //
00183     if (3 == dwArgCount)
00184     {
00185         //
00186         // Then call MatchEnumTag with our argument of interest.
00187         // if NO_ERROR is returned, then MatchEnumTag must have
00188         // found a valid match.
00189         //
00190         DWORD dwResult = 0xffffffff;
00191         if (NO_ERROR == MatchEnumTag(0,
00192                                     ppwcArguments[dwCurrentIndex],
00193                                     sizeof(ValidTokens)/sizeof(TOKEN_VALUE),
00194                                     ValidTokens,
00195                                     &dwResult))
00196         {
00197             //
00198             // Since we found a match, assume we can return a success code
00199             // unless dwResult isn't 1, 2, or 3.  That shouldn't happen
00200             // however.
00201             //
00202             dwRet = ERROR_OKAY;
00203             switch(dwResult)
00204             {
00205                 case WIDGETS:
00206                     PrintMessageFromModule(g_hModule, GEN_CURRENT_COUNT, TOKEN_WIDGETS, g_CurrentData->WidgetCount);
00207                     break;
00208                 case SPROCKETS:
00209                     PrintMessageFromModule(g_hModule, GEN_CURRENT_COUNT, TOKEN_SPROCKETS, g_CurrentData->SprocketCount);
00210                     break;
00211                 case ALL:
00212                     PrintMessageFromModule(g_hModule, GEN_CURRENT_COUNT, TOKEN_WIDGETS, g_CurrentData->WidgetCount);
00213                     PrintMessageFromModule(g_hModule, GEN_CURRENT_COUNT, TOKEN_SPROCKETS, g_CurrentData->SprocketCount);
00214                     break;
00215                 default:
00216                     dwRet = ERROR_INVALID_SYNTAX;
00217             }
00218         }
00219     }
00220     return dwRet;
00221 }
00222
00223 DWORD WINAPI
00224 HandleSetObjectCommand(
00225 IN      LPCWSTR pwszMachine,
00226 IN OUT  LPWSTR  *ppwcArguments,
00227 IN      DWORD   dwCurrentIndex,
00228 IN      DWORD   dwArgCount,
00229 IN      DWORD   dwFlags,
00230 IN      LPCVOID pvData,
00231 OUT     BOOL    *pbDone)
00232 {
00233     DWORD dwRet;
00234
00235     //
00236     // This command involves setting something equal to a value
00237     // provided by the user.  The netsh function we will use
00238     // to parse the command line will be PreProcessCommand,
00239     // which the most extensive of the argument handling
00240     // functions netsh offers.  The first thing to note
00241     // about PreprocessCommand is that it removes all identifiers
00242     // from your given command string.  For example, the command
00243     // "set widgets=10 sprockets=2", after being sent through
00244     // PreprocessCommand, will result in a arguments that would read
00245     // "set 10 2" which is much easier to.  Of course, PreprocessCommand
00246     // has a method for telling the caller which commands those
00247     // resulting numbers refer to.
00248     //
00249
00250     //
00251     // First we set up our array of valid commands, note that
00252     // the entries are aligned so that ValidCommands[WIDGETS]
00253     // and ValidCommands[SPROCKETS] makes sense.
00254     //
00255     TAG_TYPE ValidCommands[] =
00256     {
00257         {TOKEN_WIDGETS,     NS_REQ_ZERO, FALSE},
00258         {TOKEN_SPROCKETS,   NS_REQ_ZERO, FALSE},
00259     };
00260
00261     //
00262     // We'll need an array of DWORD's that is equal or larger
00263     // than the total number interesting arguments
00264     // (dwArgCount - dwCurrentIndex).  Rather than allocate memory
00265     // dynamically, we'll just use a stack allocated array of
00266     // DWORD's knowing the largest number of arguments there can be. (2)
00267     // easier.
00268     //
00269     const DWORD MAX_ARGS =       2;
00270
00271     DWORD dwTagType[MAX_ARGS];
00272
00273
00274     //
00275     // Note that if there are too many or too few args for the command
00276     // to be valid, PreprocessCommand returns something other than
00277     // NO_ERROR,
00278     //
00279     dwRet = PreprocessCommand(
00280         0,                                      // This argument is not used; should be 0.
00281         ppwcArguments,                          // Argv style array (netsh passed us this.)
00282         dwCurrentIndex,                         // Means ppwcArguments[dwCurrentIndex] is the first argument of interest.
00283                                                 // PpwcArguments[0] is going to be the context,
00284                                                 // PpwcArguments[1] is the first command, 'add' in this case.
00285                                                 // So ppwcARguments[2] is the first argument of interest.
00286         dwArgCount,                             // Total count of all the args in ppwcArguments.
00287         ValidCommands,                          // Our array of valid commands struct.
00288         sizeof(ValidCommands)/sizeof(TAG_TYPE), // Number of entries in the ValidCommands array.
00289         1,                                      // Minimum number of arguments needed to be a valid command.
00290         MAX_ARGS,                               // Maximum number of arguments allowed to be a valid command.
00291         dwTagType);                             // Array of DWORD's used to indicate which command in ValidCommands.
00292                                                 // The token in the command line referred to.
00293
00294     //
00295     // When the call to PreprocessCommand has returned, the values of ValidCommands[x].bPresent tell you which commands
00296     // were present in the command line.  Generally, you don't need to use the bPresent BOOL to process the results;
00297     // Rather, use bPresent to implement more advanced error handling for commands that have complicated command lines
00298     // (such and such arg was present, but you forgot this other arg.)
00299     //
00300
00301     //
00302     // Each consecutive value in the dwTagType array refers to consecutive args in ppwcArguments starting with
00303     // ppwcArguments[dwCurrentIndex].  So, when PreprocessCommand returns and dwTagType[0] is 1, that means that
00304     // the first arg the user gave netsh was the command referred to by ValidCommands[1], or the "sprockets" command.
00305     // As you'll recall, since PreprocessCommand got rid of the "sprockets=" part of "sprockets=2" token, processing
00306     // all that remains, "2", is easy.
00307     //
00308
00309     if (NO_ERROR == dwRet)
00310     {
00311         //
00312         // Change the return to ERROR_OKAY so netsh spits out confirmation if
00313         // everything goes ok after this point.
00314         //
00315         dwRet = ERROR_OKAY;
00316
00317         //
00318         // For each argument..
00319         //
00320         for (DWORD i = 0; i < (dwArgCount - dwCurrentIndex); i++)
00321         {
00322             //
00323             // Check its corresponding value in the dwTagType array.
00324             //
00325             switch (dwTagType[i])
00326             {
00327                 //
00328                 // This works because i defined these to match with
00329                 // ValidCommands above.
00330                 //
00331                 // #define WIDGETS                         0
00332                 // #define SPROCKETS                       1
00333                 //
00334                 case WIDGETS:
00335                     g_CurrentData->WidgetCount = wcstoul(ppwcArguments[dwCurrentIndex + i], NULL, 10);
00336                     break;
00337                 case SPROCKETS:
00338                     g_CurrentData->SprocketCount = wcstoul(ppwcArguments[dwCurrentIndex + i], NULL, 10);
00339                     break;
00340                 default:
00341                     // Since 0 and 1 are the only valid values, means the arg wasn't recognized.
00342                     // Shouldn't reach this point because PreprocessCommand wouldn't have returned
00343                     // NO_ERROR if this was the case.
00344                     dwRet = ERROR_INVALID_SYNTAX;
00345                     break;
00346             }
00347         }
00348     }
00349     else
00350     {
00351         dwRet = ERROR_SHOW_USAGE;
00352     }
00353
00354     return dwRet;
00355 }
00356
00357 DWORD WINAPI
00358 HandleResetWidgetCommand(
00359 IN      LPCWSTR pwszMachine,
00360 IN OUT  LPWSTR  *ppwcArguments,
00361 IN      DWORD   dwCurrentIndex,
00362 IN      DWORD   dwArgCount,
00363 IN      DWORD   dwFlags,
00364 IN      LPCVOID pvData,
00365 OUT     BOOL    *pbDone)
00366 {
00367
00368     g_CurrentData->WidgetCount = 0;
00369
00370     //
00371     // Carry out the command, but return ERROR_SHOW_USAGE
00372     // to show what happens. netsh should display the
00373     // HLP_RESET_OBJECT_WIDGETS_EX message.  Note that
00374     // the other commands in this group, "sprockets" and
00375     // "all" don't return ERROR_SHOW_USAGE, so there is
00376     // no reason to specify the extended help strings
00377     // (HLP_RESET_OBJECT_SPROCKETS_EX and
00378     // HLP_RESET_OBJECT_ALL_EX) for each command.  They are
00379     // #define'd though, so that the CREATE_CMD_ENTRY macros
00380     // will still work.
00381     //
00382     return ERROR_SHOW_USAGE;
00383 }
00384
00385 DWORD WINAPI
00386 HandleResetSprocketCommand(
00387 IN      LPCWSTR pwszMachine,
00388 IN OUT  LPWSTR  *ppwcArguments,
00389 IN      DWORD   dwCurrentIndex,
00390 IN      DWORD   dwArgCount,
00391 IN      DWORD   dwFlags,
00392 IN      LPCVOID pvData,
00393 OUT     BOOL    *pbDone)
00394 {
00395     g_CurrentData->SprocketCount = 0;
00396
00397     //
00398     // We'll carry out the command, but show what happens when
00399     // ERROR_INVALID_SYNTAX is returned - netsh outputs an error
00400     // message.
00401     //
00402     return ERROR_INVALID_SYNTAX;
00403 }
00404
00405 DWORD WINAPI
00406 HandleResetAllCommand(
00407 IN      LPCWSTR pwszMachine,
00408 IN OUT  LPWSTR  *ppwcArguments,
00409 IN      DWORD   dwCurrentIndex,
00410 IN      DWORD   dwArgCount,
00411 IN      DWORD   dwFlags,
00412 IN      LPCVOID pvData,
00413 OUT     BOOL    *pbDone)
00414 {
00415     g_CurrentData->WidgetCount = 0;
00416     g_CurrentData->SprocketCount = 0;
00417
00418     //
00419     // Carry out the command and return NO_ERROR.  Same behavior as
00420     // returning ERROR_SUPPRESS_OUTPUT.
00421     //
00422     return NO_ERROR;
00423 }
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/LeakyBin/LeakyBin.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • LeakyBin

LeakyBin.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1995 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 LEAKYBIN.H
00010 ---------------------------------------------------------------------------*/
00011
00012
00013 #ifdef SHOW_MEMORY_USAGE
00014 #include "..\appmem\pub\appmem.h"
00015 #define G_ALLOC         GlobalAllocP
00016 #define G_FREE          GlobalFreeP
00017 #define G_REALLOC       GlobalReallocP
00018
00019 #else
00020 #define G_ALLOC         GlobalAlloc
00021 #define G_FREE          GlobalFree
00022 #define G_REALLOC       GlobalRealloc
00023
00024 #endif
00025
00026 typedef struct _MEMORY_ALLOC_BLOCK
00027 {
00028    struct _MEMORY_ALLOC_BLOCK      *pNext;
00029 } MEMORY_ALLOC_BLOCK, *PMEMORY_ALLOC_BLOCK;
00030
00031 #define ALLOCATION_SIZE         (4096*10)
00032 #define TIME_INTERVAL           (100)
00033 #define LEAK_TIMER                      13
00034
00035
00036 #define IDM_EXIT           101
00037 #define IDM_START          201
00038 #define IDM_STOP           202
00039 #define IDM_RESET          203
00040
00041 #define IDM_ABOUT          301
00042 #define IDM_HELPTOPICS     302
00043
00044 #define IDC_STATIC -1
00045
00046 #define DLG_VERFIRST        400
00047 #define IDC_COMPANY         DLG_VERFIRST
00048 #define IDC_FILEDESC        DLG_VERFIRST+1
00049 #define IDC_PRODVER         DLG_VERFIRST+2
00050 #define IDC_COPYRIGHT       DLG_VERFIRST+3
00051 #define IDC_OSVERSION       DLG_VERFIRST+4
00052 #define IDC_TRADEMARK       DLG_VERFIRST+5
00053 #define DLG_VERLAST         DLG_VERFIRST+5
00054
00055 #define IDC_LABEL           DLG_VERLAST+1
00056
00057 #define IDS_APP_TITLE       500
00058 #define IDS_DISPLAYCHANGED  501
00059 #define IDS_VER_INFO_LANG   502
00060 #define IDS_VERSION_ERROR   503
00061 #define IDS_NO_HELP         504
00062 
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/DbgOut.h Source File

  • WinUI
  • Shell
  • FileView

DbgOut.h

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  PROGRAM:DBGOUT.H
00009 //
00010 //  PURPOSE:  Useful debugging output macros that compile to nothing and
00011 //   eliminate ugly #ifdef DEBUGs from source code.
00012 //
00013 //  PLATFORMS:  Windows 95
00014 //
00015 //  SPECIAL INSTRUCTIONS: N/A
00016 //
00017 #ifndef _DBGOUT_H
00018 #define _DBGOUT_H
00019
00020 #ifdef DEBUG
00021
00022 //Basic debug macros
00023 #define D(x)        {x;}
00024
00025 #define ODS(x)      {\
00026                     char        szDebug[128];\
00027                     OutputDebugString(x);\
00028                     wsprintf(szDebug, " %s, %u\r\n", (LPSTR)__FILE__, __LINE__);\
00029                     OutputDebugString(szDebug);\
00030                     }
00031
00032 #define ODSsz(f, s)  {\
00033                      char        szDebug[128];\
00034                      wsprintf(szDebug, f, (LPSTR)s);\
00035                      OutputDebugString(szDebug);\
00036                      wsprintf(szDebug, " %s, %u\r\n", (LPSTR)__FILE__, __LINE__);\
00037                      OutputDebugString(szDebug);\
00038                      }
00039
00040
00041 #define ODSu(f, u)  {\
00042                     char        szDebug[128];\
00043                     wsprintf(szDebug, f, (UINT)u);\
00044                     OutputDebugString(szDebug);\
00045                     wsprintf(szDebug, " %s, %u\r\n", (LPSTR)__FILE__, __LINE__);\
00046                     OutputDebugString(szDebug);\
00047                     }
00048
00049
00050 #define ODSlu(f, lu) {\
00051                      char        szDebug[128];\
00052                      wsprintf(szDebug, f, (DWORD)lu);\
00053                      OutputDebugString(szDebug);\
00054                      wsprintf(szDebug, " %s, %u\r\n", (LPSTR)__FILE__, __LINE__);\
00055                      OutputDebugString(szDebug);\
00056                      }
00057
00058 #define ODSszu(f, s, u) {\
00059                         char        szDebug[128];\
00060                         wsprintf(szDebug, f, (LPSTR)s, (UINT)u);\
00061                         OutputDebugString(szDebug);\
00062                         wsprintf(szDebug, " %s, %u\r\n", (LPSTR)__FILE__, __LINE__);\
00063                         OutputDebugString(szDebug);\
00064                         }
00065
00066
00067 #define ODSszlu(f, s, lu) {\
00068                           char        szDebug[128];\
00069                           wsprintf(szDebug, f, (LPSTR)s, (DWORD)lu);\
00070                           OutputDebugString(szDebug);\
00071                           wsprintf(szDebug, " %s, %u\r\n", (LPSTR)__FILE__, __LINE__);\
00072                           OutputDebugString(szDebug);\
00073                           }
00074
00075 #else   //NO DEBUG
00076
00077 #define D(x)
00078 #define ODS(x)
00079
00080 #define ODSsz(f, s)
00081 #define ODSu(f, u)
00082 #define ODSlu(f, lu)
00083 #define ODSszu(f, s, u)
00084 #define ODSszlu(f, s, lu)
00085
00086
00087 #endif //DEBUG
00088
00089 #endif //_DBGOUT_H
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/snoop.h Source File

  • WinUI
  • TSFcase

snoop.h

Go to the documentation of this file.
00001 //
00002 // snoop.h
00003 //
00004 // CSnoopWnd declaration.
00005 //
00006
00007 #ifndef SNOOP_H
00008 #define SNOOP_H
00009
00010 #define MAX_SNOOP_TEXT  32
00011
00012 class CCaseTextService;
00013 class CUpdateTextEditSession;
00014
00015 class CSnoopWnd
00016 {
00017 public:
00018     CSnoopWnd(CCaseTextService *pCase);
00019
00020     static BOOL _InitClass();
00021     static void _UninitClass();
00022
00023     BOOL _Init();
00024     void _Uninit();
00025
00026     void _Show();
00027     void _Hide();
00028
00029     void _UpdateText(ITfRange *pRange);
00030     void _UpdateText(TfEditCookie ec, ITfContext *pContext, ITfRange *pRange);
00031
00032 private:
00033
00034     friend CUpdateTextEditSession;
00035
00036     static LRESULT CALLBACK _WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00037     void _OnPaint(HWND hWnd, HDC hdc);
00038
00039     static void _SetThis(HWND hWnd, LPARAM lParam)
00040     {
00041         SetWindowLongPtr(hWnd, GWLP_USERDATA,
00042                       (LONG_PTR)((CREATESTRUCT *)lParam)->lpCreateParams);
00043     }
00044
00045     static CSnoopWnd *_GetThis(HWND hWnd)
00046     {
00047         return (CSnoopWnd *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
00048     }
00049
00050     CCaseTextService *_pCase;
00051     HWND _hWnd;
00052     ULONG _cchText;
00053     WCHAR _achText[MAX_SNOOP_TEXT];
00054     static ATOM _atomWndClass;
00055 };
00056
00057 #endif // SNOOP_H
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/string.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

string.h

Go to the documentation of this file.
00001 #ifndef __CSTRING_H
00002 #define __CSTRING_H
00003
00004 struct CStringData
00005 {
00006   long nRefs;             // reference count
00007   int nDataLength;        // length of data (including terminator)
00008   int nAllocLength;       // length of allocation
00009   // WCHAR data[nAllocLength]
00010
00011   WCHAR* data()           // WCHAR* to managed data
00012     { return (WCHAR*)(this+1); }
00013 };
00014
00015 class CString
00016 {
00017   DECLARE_FIXED_ALLOC(CString);
00018
00019 public:
00020
00021 // Constructors
00022
00023   // constructs empty CString
00024   CString();
00025   // copy constructor
00026   CString(const CString& stringSrc);
00027   // from a single character
00028   CString(WCHAR ch, int nRepeat = 1);
00029   // from an ANSI string (converts to WCHAR)
00030   CString(LPCSTR lpsz);
00031   // from a UNICODE string (converts to WCHAR)
00032   CString(LPCWSTR lpsz);
00033   // subset of characters from an ANSI string (converts to WCHAR)
00034   CString(LPCSTR lpch, int nLength);
00035   // subset of characters from a UNICODE string (converts to WCHAR)
00036   CString(LPCWSTR lpch, int nLength);
00037   // from unsigned characters
00038   CString(const unsigned char* psz);
00039
00040 // Attributes & Operations
00041
00042   // get data length
00043   int GetLength() const;
00044   // TRUE if zero length
00045   BOOL IsEmpty() const;
00046   // clear contents to empty
00047   void Empty();
00048
00049   // return single character at zero-based index
00050   WCHAR GetAt(int nIndex) const;
00051   // return single character at zero-based index
00052   WCHAR operator[](int nIndex) const;
00053   // set a single character at zero-based index
00054   void SetAt(int nIndex, WCHAR ch);
00055   // return pointer to const string
00056   operator LPCWSTR() const;
00057
00058   // overloaded assignment
00059
00060   // ref-counted copy from another CString
00061   const CString& operator=(const CString& stringSrc);
00062   // set string content to single character
00063   const CString& operator=(WCHAR ch);
00064 #ifdef _UNICODE
00065   const CString& operator=(char ch);
00066 #endif
00067   // copy string content from ANSI string (converts to WCHAR)
00068   const CString& operator=(LPCSTR lpsz);
00069   // copy string content from UNICODE string (converts to WCHAR)
00070   inline const CString& operator=(LPCWSTR lpsz)
00071   {
00072     AssignCopy(SafeStrlen(lpsz), lpsz);
00073     return *this;
00074   }
00075
00076   // copy string content from unsigned chars
00077   const CString& operator=(const unsigned char* psz);
00078
00079   // string concatenation
00080
00081   // concatenate from another CString
00082   const CString& operator+=(const CString& string);
00083
00084   // concatenate a single character
00085   const CString& operator+=(WCHAR ch);
00086 #ifdef _UNICODE
00087   // concatenate an ANSI character after converting it to WCHAR
00088   const CString& operator+=(char ch);
00089 #endif
00090   // concatenate a UNICODE character after converting it to WCHAR
00091   const CString& operator+=(LPCWSTR lpsz);
00092
00093   friend CString operator+(const CString& string1,
00094       const CString& string2);
00095   friend CString operator+(const CString& string, WCHAR ch);
00096   friend CString operator+(WCHAR ch, const CString& string);
00097 #ifdef _UNICODE
00098   friend CString operator+(const CString& string, char ch);
00099   friend CString operator+(char ch, const CString& string);
00100 #endif
00101   friend CString operator+(const CString& string, LPCWSTR lpsz);
00102   friend CString operator+(LPCWSTR lpsz, const CString& string);
00103
00104   // string comparison
00105
00106   // straight character comparison
00107   int Compare(LPCWSTR lpsz) const;
00108
00109   // Access to string implementation buffer as "C" character array
00110   // get pointer to modifiable buffer at least as long as nMinBufLength
00111   LPWSTR GetBuffer(int nMinBufLength);
00112   // release buffer, setting length to nNewLength (or to first nul if -1)
00113   void ReleaseBuffer(int nNewLength = -1);
00114   // get pointer to modifiable buffer exactly as long as nNewLength
00115   LPWSTR GetBufferSetLength(int nNewLength);
00116   // release memory allocated to but unused by string
00117   void FreeExtra();
00118
00119   // Use LockBuffer/UnlockBuffer to turn refcounting off
00120
00121   // turn refcounting back on
00122   LPWSTR LockBuffer();
00123   // turn refcounting off
00124   void UnlockBuffer();
00125
00126 // Implementation
00127 public:
00128   inline ~CString();
00129   int GetAllocLength() const;
00130   inline void AssignCopy(int nSrcLen, LPCWSTR lpszSrcData)
00131   {
00132     AllocBeforeWrite(nSrcLen);
00133   //  memcpy(m_pchData, lpszSrcData, nSrcLen*sizeof(WCHAR));
00134   //  m_pchData[nSrcLen] = L'\0';
00135     WCSNCPY(m_pchData, lpszSrcData, nSrcLen);
00136     GetData()->nDataLength = nSrcLen;
00137   }
00138
00139   LPWSTR m_pchData;   // pointer to ref counted string data
00140
00141 protected:
00142
00143   // implementation helpers
00144   inline CStringData* GetData() const;
00145   void Init();
00146   void AllocCopy(CString& dest, int nCopyLen, int nCopyIndex, int nExtraLen) const;
00147   void AllocBuffer(int nLen);
00148   void ConcatCopy(int nSrc1Len, LPCWSTR lpszSrc1Data, int nSrc2Len, LPCWSTR lpszSrc2Data);
00149   void ConcatInPlace(int nSrcLen, LPCWSTR lpszSrcData);
00150   void CopyBeforeWrite();
00151   inline void AllocBeforeWrite(int nLen)
00152   {
00153     if (GetData()->nRefs > 1 || nLen > GetData()->nAllocLength)
00154     {
00155       Release();
00156       AllocBuffer(nLen);
00157     }
00158   }
00159
00160   void Release();
00161   static void Release(CStringData* pData);
00162   static int SafeStrlen(LPCWSTR lpsz);
00163   static void FreeData(CStringData* pData);
00164 };
00165
00166 // Compare helpers
00167 bool operator==(const CString& s1, const CString& s2);
00168 bool operator==(const CString& s1, LPCWSTR s2);
00169 bool operator==(LPCWSTR s1, const CString& s2);
00170 bool operator!=(const CString& s1, const CString& s2);
00171 bool operator!=(const CString& s1, LPCWSTR s2);
00172 bool operator!=(LPCWSTR s1, const CString& s2);
00173 bool operator<(const CString& s1, const CString& s2);
00174 bool operator<(const CString& s1, LPCWSTR s2);
00175 bool operator<(LPCWSTR s1, const CString& s2);
00176 bool operator>(const CString& s1, const CString& s2);
00177 bool operator>(const CString& s1, LPCWSTR s2);
00178 bool operator>(LPCWSTR s1, const CString& s2);
00179 bool operator<=(const CString& s1, const CString& s2);
00180 bool operator<=(const CString& s1, LPCWSTR s2);
00181 bool operator<=(LPCWSTR s1, const CString& s2);
00182 bool operator>=(const CString& s1, const CString& s2);
00183 bool operator>=(const CString& s1, LPCWSTR s2);
00184 bool operator>=(LPCWSTR s1, const CString& s2);
00185
00186 // Globals
00187 extern const WCHAR epChNil;
00188 extern LPCWSTR _epPchNil;
00189 inline const CString& EpGetEmptyString()
00190 {
00191   return *(CString*)&_epPchNil;
00192 }
00193 #define epEmptyString EpGetEmptyString()
00194
00195 inline CStringData* CString::GetData() const
00196 {
00197   return ((CStringData*)m_pchData)-1;
00198 }
00199
00200 inline void CString::Init()
00201 {
00202   m_pchData = epEmptyString.m_pchData;
00203 }
00204
00205 inline CString::CString()
00206 {
00207   m_pchData = epEmptyString.m_pchData;
00208 }
00209
00210 inline int CString::GetLength() const
00211   { return GetData()->nDataLength; }
00212 inline int CString::GetAllocLength() const
00213   { return GetData()->nAllocLength; }
00214 inline BOOL CString::IsEmpty() const
00215   { return GetData()->nDataLength == 0; }
00216 inline CString::operator LPCWSTR() const
00217   { return m_pchData; }
00218 inline int CString::SafeStrlen(LPCWSTR lpsz)
00219   { return (lpsz == NULL) ? 0 : wcslen(lpsz); }
00220
00221 // CString support (windows specific)
00222 inline int CString::Compare(LPCWSTR lpsz) const
00223   { return WCSCMP(m_pchData, lpsz); }    // MBCS/Unicode aware
00224
00225 inline WCHAR CString::GetAt(int nIndex) const
00226 {
00227   return m_pchData[nIndex];
00228 }
00229 inline WCHAR CString::operator[](int nIndex) const
00230 {
00231   // same as GetAt
00232   return m_pchData[nIndex];
00233 }
00234 inline bool operator==(const CString& s1, const CString& s2)
00235   { return s1.Compare(s2) == 0; }
00236 inline bool operator==(const CString& s1, LPCWSTR s2)
00237   { return s1.Compare(s2) == 0; }
00238 inline bool operator==(LPCWSTR s1, const CString& s2)
00239   { return s2.Compare(s1) == 0; }
00240 inline bool operator!=(const CString& s1, const CString& s2)
00241   { return s1.Compare(s2) != 0; }
00242 inline bool operator!=(const CString& s1, LPCWSTR s2)
00243   { return s1.Compare(s2) != 0; }
00244 inline bool operator!=(LPCWSTR s1, const CString& s2)
00245   { return s2.Compare(s1) != 0; }
00246 inline bool operator<(const CString& s1, const CString& s2)
00247   { return s1.Compare(s2) < 0; }
00248 inline bool operator<(const CString& s1, LPCWSTR s2)
00249   { return s1.Compare(s2) < 0; }
00250 inline bool operator<(LPCWSTR s1, const CString& s2)
00251   { return s2.Compare(s1) > 0; }
00252 inline bool operator>(const CString& s1, const CString& s2)
00253   { return s1.Compare(s2) > 0; }
00254 inline bool operator>(const CString& s1, LPCWSTR s2)
00255   { return s1.Compare(s2) > 0; }
00256 inline bool operator>(LPCWSTR s1, const CString& s2)
00257   { return s2.Compare(s1) < 0; }
00258 inline bool operator<=(const CString& s1, const CString& s2)
00259   { return s1.Compare(s2) <= 0; }
00260 inline bool operator<=(const CString& s1, LPCWSTR s2)
00261   { return s1.Compare(s2) <= 0; }
00262 inline bool operator<=(LPCWSTR s1, const CString& s2)
00263   { return s2.Compare(s1) >= 0; }
00264 inline bool operator>=(const CString& s1, const CString& s2)
00265   { return s1.Compare(s2) >= 0; }
00266 inline bool operator>=(const CString& s1, LPCWSTR s2)
00267   { return s1.Compare(s2) >= 0; }
00268 inline bool operator>=(LPCWSTR s1, const CString& s2)
00269   { return s2.Compare(s1) <= 0; }
00270
00271
00272 #endif
Generated on Wed Nov 13 2024 16:52:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/cMemb.h Source File

  • Web
  • NetMeeting
  • NMShare

cMemb.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       CMEMB.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 typedef struct tagUser {
00017   INmMember * pMember;
00018   LPTSTR pszName;
00019 } USER;
00020 typedef USER * PUSER;
00021
00022 extern COBLIST * g_pListUser;
00023
00024 // from cMemb.cpp
00025 VOID AddMember(INmMember * pMember);
00026 VOID RemoveMember(INmMember * pMember);
00027 VOID FreeAllUsers(void);
00028 VOID FreeUser(PUSER pUser);
00029 PUSER PUserFromINmMember(INmMember * pMember);
00030
00031
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMmStreamConsecBuf Member List

This is the complete list of members for CMmStreamConsecBuf, including all inherited members.
_liOffset | CMmStreamConsecBuf | [private]
_pMmStream | CMmStreamConsecBuf | [private]
CMmStreamBuf() | CMmStreamBuf | [inline]
CMmStreamConsecBuf() | CMmStreamConsecBuf |
Eof() | CMmStreamConsecBuf |
Get() | CMmStreamBuf | [inline]
Init(PMmStream *pMmStream) | CMmStreamConsecBuf |
Map(ULONG cb) | CMmStreamConsecBuf |
Rewind() | CMmStreamConsecBuf |
SetBuf(void *buf) | CMmStreamBuf | [inline]
SetSize(ULONG cb) | CMmStreamBuf | [inline]
SetStream(PMmStream *pStream) | CMmStreamBuf | [inline]
Size() const | CMmStreamBuf | [inline]
~CMmStreamBuf() | CMmStreamBuf |
Generated on Wed Nov 13 2024 16:56:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Toolbar

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031
00032     TCHAR tmpHelpFile[MAX_PATH];
00033
00034     GetWindowsDirectory(tmpHelpFile, (sizeof tmpHelpFile)/(sizeof tmpHelpFile[0]));
00035     _tcscat(tmpHelpFile, _T("\\HELP\\"));
00036     LoadString(g_hinst, IDS_HELPFILE, &tmpHelpFile[_tcslen(tmpHelpFile)], MAX_PATH - _tcslen(tmpHelpFile));
00037
00038   MAKE_WIDEPTR_FROMTSTR(wszHelpFile, tmpHelpFile);
00039   wcscpy(m_HelpFile, wszHelpFile);
00040 }
00041
00042 CComponentData::~CComponentData()
00043 {
00044     if (m_pStaticNode) {
00045         delete m_pStaticNode;
00046     }
00047
00048     OBJECT_DESTROYED
00049 }
00050
00051 ///////////////////////
00052 // IUnknown implementation
00053 ///////////////////////
00054
00055 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00056 {
00057     if (!ppv)
00058         return E_FAIL;
00059
00060     *ppv = NULL;
00061
00062     if (IsEqualIID(riid, IID_IUnknown))
00063         *ppv = static_cast<IComponentData *>(this);
00064     else if (IsEqualIID(riid, IID_IComponentData))
00065         *ppv = static_cast<IComponentData *>(this);
00066     else if (IsEqualIID(riid, IID_ISnapinHelp))
00067         *ppv = static_cast<ISnapinHelp*>(this);
00068
00069     if (*ppv)
00070     {
00071         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00072         return S_OK;
00073     }
00074
00075     return E_NOINTERFACE;
00076 }
00077
00078 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00079 {
00080     return InterlockedIncrement((LONG *)&m_cref);
00081 }
00082
00083 STDMETHODIMP_(ULONG) CComponentData::Release()
00084 {
00085     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00086     {
00087         // we need to decrement our object count in the DLL
00088         delete this;
00089         return 0;
00090     }
00091
00092     return m_cref;
00093 }
00094
00095 ///////////////////////////////
00096 // Interface IComponentData
00097 ///////////////////////////////
00098 HRESULT CComponentData::Initialize(
00099                                    /* [in] */ LPUNKNOWN pUnknown)
00100 {
00101     HRESULT      hr;
00102
00103     //
00104     // Get pointer to name space interface
00105     //
00106     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00107     _ASSERT( S_OK == hr );
00108
00109     //
00110     // Get pointer to console interface
00111     //
00112     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00113     _ASSERT( S_OK == hr );
00114
00115     IImageList *pImageList;
00116     m_ipConsole->QueryScopeImageList(&pImageList);
00117     _ASSERT( S_OK == hr );
00118
00119     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00120         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00121         0, // index of the first image in the strip
00122         RGB(0, 128, 128)  // color of the icon mask
00123         );
00124
00125     pImageList->Release();
00126
00127     return S_OK;
00128 }
00129
00130 HRESULT CComponentData::CreateComponent(
00131                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00132 {
00133     *ppComponent = NULL;
00134
00135     CComponent *pComponent = new CComponent(this);
00136
00137     if (NULL == pComponent)
00138         return E_OUTOFMEMORY;
00139
00140     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00141 }
00142
00143 HRESULT CComponentData::Notify(
00144                                /* [in] */ LPDATAOBJECT lpDataObject,
00145                                /* [in] */ MMC_NOTIFY_TYPE event,
00146                                /* [in] */ LPARAM arg,
00147                                /* [in] */ LPARAM param)
00148 {
00149     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00150
00151     HRESULT hr = S_FALSE;
00152
00153   //Get our data object. If it is NULL, we return with S_FALSE.
00154   //See implementation of GetOurDataObject() to see how to
00155   //handle special data objects.
00156   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00157   if (NULL == pDataObject)
00158     return S_FALSE;
00159
00160   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00161
00162     switch (event)
00163     {
00164     case MMCN_EXPAND:
00165         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00166         break;
00167     }
00168
00169     return hr;
00170 }
00171
00172 HRESULT CComponentData::Destroy( void)
00173 {
00174     // Free interfaces
00175     if (m_ipConsoleNameSpace) {
00176         m_ipConsoleNameSpace->Release();
00177         m_ipConsoleNameSpace = NULL;
00178     }
00179
00180     if (m_ipConsole) {
00181         m_ipConsole->Release();
00182         m_ipConsole = NULL;
00183     }
00184
00185     return S_OK;
00186 }
00187
00188 HRESULT CComponentData::QueryDataObject(
00189                                         /* [in] */ MMC_COOKIE cookie,
00190                                         /* [in] */ DATA_OBJECT_TYPES type,
00191                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00192 {
00193     CDataObject *pObj = NULL;
00194
00195     if (cookie == 0)
00196         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00197     else
00198         pObj = new CDataObject(cookie, type);
00199
00200     if (!pObj)
00201         return E_OUTOFMEMORY;
00202
00203     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00204
00205     return S_OK;
00206 }
00207
00208 HRESULT CComponentData::GetDisplayInfo(
00209                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00210 {
00211     HRESULT hr = S_FALSE;
00212
00213     // if they are asking for the SDI_STR we have one of those to give
00214     if (pScopeDataItem->lParam) {
00215         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00216         if (pScopeDataItem->mask & SDI_STR) {
00217                         LPCTSTR pszT = base->GetDisplayName();
00218                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00219             pScopeDataItem->displayname = pszW;
00220         }
00221
00222         if (pScopeDataItem->mask & SDI_IMAGE) {
00223             pScopeDataItem->nImage = base->GetBitmapIndex();
00224         }
00225     }
00226
00227     return hr;
00228 }
00229
00230 HRESULT CComponentData::CompareObjects(
00231                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00232                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00233 {
00234     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00235     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00236
00237     // compare the object pointers
00238     if (baseA->GetCookie() == baseB->GetCookie())
00239         return S_OK;
00240
00241     return S_FALSE;
00242 }
00243
00244 ///////////////////////////////
00245 // Interface ISnapinHelp
00246 ///////////////////////////////
00247 HRESULT CComponentData::GetHelpTopic(
00248                                      /* [out] */ LPOLESTR *lpCompiledHelpFile)
00249 {
00250     *lpCompiledHelpFile = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(m_HelpFile) + 1) * sizeof(WCHAR)));
00251
00252     wcscpy(*lpCompiledHelpFile, m_HelpFile);
00253
00254     return S_OK;
00255 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/InkClipboard/InkClipboard.cs Source File

  • TabletPC
  • InkClipboard

InkClipboard.cs

Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 //
00003 //  This is part of the Microsoft Tablet PC Platform SDK
00004 //  Copyright (C) 2002 Microsoft Corporation
00005 //  All rights reserved.
00006 //
00007 //  This source code is only intended as a supplement to the
00008 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00009 //  documentation provided with the Software Development Kit.
00010 //  See these sources for more detailed information.
00011 //
00012 //  File: InkClipboard.cs
00013 //  Simple Ink Clipboard with Selection Sample Application
00014 //
00015 //  This program demonstrates how to copy and paste ink into
00016 //  another application such as Microsoft Word or Microsoft Paint.
00017 //  It also allows the user to copy a selection of strokes and
00018 //  paste the result into this application's existing ink object.
00019 //
00020 //  The following clipboard formats are available:
00021 //
00022 //  Metafile
00023 //  Enhanced Metafile
00024 //  Bitmap
00025 //  Ink Serialized Format
00026 //  Text Ink
00027 //  Sketch Ink
00028
00029 //  TextInk and SketchInk are two flavors of Ink OLE Embeddable Objects
00030 //  that Microsoft Word uses for ink that represents text or drawing
00031 //  respectively.
00032
00033 //  It is possible to paste Ink Serialized Format, Text Ink, and
00034 //  Sketch Ink into existing ink.
00035 //
00036 //  In addition to the clipboard, this sample also illustrates how
00037 //  to select strokes with a lasso.  The user can move selected
00038 //  strokes and modify their drawing attributes.  This functionality
00039 //  is a subset of the selection functionality already provided by
00040 //  the InkOverlay control;  it is implemented here for illustrative
00041 //  purposes.
00042 //
00043 //  The features used are: InkCollector, Ink Clipboard support, and
00044 //  HitTest with lasso.
00045 //
00046 //--------------------------------------------------------------------------
00047
00048 using System;
00049 using System.Drawing;
00050 using System.Drawing.Drawing2D;
00051 using System.Collections;
00052 using System.Windows.Forms;
00053
00054 // The Ink namespace, which contains the Tablet PC Platform API
00055 using Microsoft.Ink;
00056
00057 namespace InkClipboard
00058 {
00059
00060     /// <summary>
00061     /// Enumeration of all possible application modes:
00062     ///
00063     ///   Ink:             The user is drawing new strokes
00064     ///   LassoSelection:  The user is selecting strokes with a lasso
00065     ///   MoveInk:         The user is moving selected strokes (this is not a menu item)
00066     ///
00067     /// </summary>
00068     public enum ApplicationMode
00069     {
00070         Ink,
00071         LassoSelection,
00072         MoveInk
00073     }
00074
00075     /// <summary>
00076     /// The InkClipboard with Selection Sample Application form class
00077     /// </summary>
00078     public class InkClipboard : System.Windows.Forms.Form
00079     {
00080
00081         // --------------- Constants ---------------
00082
00083         // Declare constants for the pen widths used by this application.
00084         // Note that these constants are in high metric units (1 unit = .01mm)
00085         private const float ThinInkWidth = 10;
00086         private const float MediumInkWidth = 100;
00087         private const float ThickInkWidth = 200;
00088
00089         // Declare constant for the size of the border around selected strokes
00090         private const int SelectedInkWidthIncrease = 105;
00091
00092         // Declare constant for the size of a lasso point
00093         private const int DotSize = 6;
00094
00095         // Declare constant for the spacing between lasso points
00096         private const int DotSpacing = 7;
00097
00098         // Declare constant for the padding size of the rectangle that bounds
00099         // the selected strokes.
00100         private const int SelectionRectBuffer = 8;
00101
00102         // Declare constant for the lasso hit test percent (specifies how much
00103         // of the stroke must fall within the lasso in order to be selected).
00104         private const float LassoPercent = 50;
00105
00106         // The index for the x and y packet values.  This index is used
00107         // to retrieve the lasso point data in the Packets event handler.
00108         private const int XPacketIndex = 0;
00109         private const int YPacketIndex = 1;
00110
00111         // --------------- Fields ---------------
00112
00113         // Declare the Ink Collector object
00114         private InkCollector myInkCollector = null;
00115
00116         // The current application mode:  inking, selecting, or moving the selection
00117         private ApplicationMode applicationMode = ApplicationMode.Ink;
00118
00119         // The points in the selection lasso
00120         private ArrayList lassoPoints = null;
00121
00122         // The array of rectangle selection handles
00123         private PictureBox[] selectionHandles;
00124
00125         // The rectangle that bounds the selected strokes
00126         private Rectangle selectionRect = Rectangle.Empty;
00127
00128         // The strokes that have been selected by the lasso
00129         private Strokes selectedStrokes = null;
00130
00131         // The location where the move started (used when moving selected strokes)
00132         private Point startMoveLocation = Point.Empty;
00133
00134         // The coordinates of the last lasso point drawn (empty if no dot has been drawn)
00135         private Point lastDrawnLassoDot = Point.Empty;
00136
00137         // Declare the colors used in the selection lasso
00138         private Color dotEdgeColor = Color.White;
00139         private Color dotColor = SystemColors.Highlight;
00140         private Color connectorColor = Color.Black;
00141
00142         // Declare the pens used to draw the selection lasso
00143         private Pen connectorPen = null;
00144         private Pen dotEdgePen = null;
00145         private Pen dotPen = null;
00146
00147         // --------------- Constructor ---------------
00148
00149         #region Standard Template Code
00150
00151         private System.Windows.Forms.MenuItem miClear;
00152         private System.Windows.Forms.MenuItem miExit;
00153         private System.Windows.Forms.MenuItem miMainEdit;
00154         private System.Windows.Forms.MenuItem miCut;
00155         private System.Windows.Forms.MenuItem miCopy;
00156         private System.Windows.Forms.MenuItem miPaste;
00157         private System.Windows.Forms.MenuItem miInk;
00158         private System.Windows.Forms.MenuItem miMainFormat;
00159         private System.Windows.Forms.MenuItem miISF;
00160         private System.Windows.Forms.MenuItem miMetafile;
00161         private System.Windows.Forms.MenuItem miBMP;
00162         private System.Windows.Forms.MenuItem miEMF;
00163         private System.Windows.Forms.MenuItem miSInk;
00164         private System.Windows.Forms.MenuItem miTInk;
00165         private System.Windows.Forms.MenuItem miNoOLE;
00166         private System.Windows.Forms.MenuItem miThin;
00167         private System.Windows.Forms.MenuItem miMedium;
00168         private System.Windows.Forms.MenuItem miThick;
00169         private System.Windows.Forms.MenuItem miRed;
00170         private System.Windows.Forms.MenuItem miGreen;
00171         private System.Windows.Forms.MenuItem miBlue;
00172         private System.Windows.Forms.MenuItem miBlack;
00173         private System.Windows.Forms.PictureBox rightBottomHandle;
00174         private System.Windows.Forms.PictureBox centerBottomHandle;
00175         private System.Windows.Forms.PictureBox leftBottomHandle;
00176         private System.Windows.Forms.PictureBox rightCenterHandle;
00177         private System.Windows.Forms.PictureBox leftCenterHandle;
00178         private System.Windows.Forms.PictureBox rightTopHandle;
00179         private System.Windows.Forms.PictureBox centerTopHandle;
00180         private System.Windows.Forms.PictureBox leftTopHandle;
00181         private System.Windows.Forms.MenuItem miLassoSelect;
00182         private System.Windows.Forms.MainMenu mainMenu;
00183         private System.Windows.Forms.MenuItem miInkSeparator;
00184         private System.Windows.Forms.MenuItem miEditSeparator;
00185         private System.Windows.Forms.MenuItem miFormatSeparator;
00186         private System.Windows.Forms.MenuItem miStyle;
00187         private System.Windows.Forms.MenuItem miWidth;
00188         private System.Windows.Forms.MenuItem miColor;
00189         private System.Windows.Forms.MenuItem miMainAction;
00190
00191         /// <summary>
00192         /// Required designer variable.
00193         /// </summary>
00194         private System.ComponentModel.Container components = null;
00195         #endregion
00196
00197         public InkClipboard()
00198         {
00199             #region Standard Template Code
00200             //
00201             // Required for Windows Form Designer support
00202             //
00203             InitializeComponent();
00204             #endregion
00205         }
00206
00207         #region Standard Template Code
00208         /// <summary>
00209         /// Clean up any resources being used.
00210         /// </summary>
00211         protected override void Dispose( bool disposing )
00212         {
00213             if( disposing )
00214             {
00215                 if (components != null)
00216                 {
00217                     components.Dispose();
00218                 }
00219             }
00220             base.Dispose( disposing );
00221         }
00222         #endregion
00223
00224     #region Windows Form Designer generated code
00225         /// <summary>
00226         /// Required method for Designer support - do not modify
00227         /// the contents of this method with the code editor.
00228         /// </summary>
00229         private void InitializeComponent()
00230         {
00231             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(InkClipboard));
00232             this.mainMenu = new System.Windows.Forms.MainMenu();
00233             this.miMainAction = new System.Windows.Forms.MenuItem();
00234             this.miClear = new System.Windows.Forms.MenuItem();
00235             this.miInkSeparator = new System.Windows.Forms.MenuItem();
00236             this.miExit = new System.Windows.Forms.MenuItem();
00237             this.miMainEdit = new System.Windows.Forms.MenuItem();
00238             this.miCut = new System.Windows.Forms.MenuItem();
00239             this.miCopy = new System.Windows.Forms.MenuItem();
00240             this.miPaste = new System.Windows.Forms.MenuItem();
00241             this.miEditSeparator = new System.Windows.Forms.MenuItem();
00242             this.miLassoSelect = new System.Windows.Forms.MenuItem();
00243             this.miInk = new System.Windows.Forms.MenuItem();
00244             this.miMainFormat = new System.Windows.Forms.MenuItem();
00245             this.miISF = new System.Windows.Forms.MenuItem();
00246             this.miMetafile = new System.Windows.Forms.MenuItem();
00247             this.miEMF = new System.Windows.Forms.MenuItem();
00248             this.miBMP = new System.Windows.Forms.MenuItem();
00249             this.miFormatSeparator = new System.Windows.Forms.MenuItem();
00250             this.miSInk = new System.Windows.Forms.MenuItem();
00251             this.miTInk = new System.Windows.Forms.MenuItem();
00252             this.miNoOLE = new System.Windows.Forms.MenuItem();
00253             this.miStyle = new System.Windows.Forms.MenuItem();
00254             this.miWidth = new System.Windows.Forms.MenuItem();
00255             this.miThin = new System.Windows.Forms.MenuItem();
00256             this.miMedium = new System.Windows.Forms.MenuItem();
00257             this.miThick = new System.Windows.Forms.MenuItem();
00258             this.miColor = new System.Windows.Forms.MenuItem();
00259             this.miRed = new System.Windows.Forms.MenuItem();
00260             this.miGreen = new System.Windows.Forms.MenuItem();
00261             this.miBlue = new System.Windows.Forms.MenuItem();
00262             this.miBlack = new System.Windows.Forms.MenuItem();
00263             this.rightBottomHandle = new System.Windows.Forms.PictureBox();
00264             this.centerBottomHandle = new System.Windows.Forms.PictureBox();
00265             this.leftBottomHandle = new System.Windows.Forms.PictureBox();
00266             this.rightCenterHandle = new System.Windows.Forms.PictureBox();
00267             this.leftCenterHandle = new System.Windows.Forms.PictureBox();
00268             this.rightTopHandle = new System.Windows.Forms.PictureBox();
00269             this.centerTopHandle = new System.Windows.Forms.PictureBox();
00270             this.leftTopHandle = new System.Windows.Forms.PictureBox();
00271             this.SuspendLayout();
00272             //
00273             // mainMenu
00274             //
00275             this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00276                                                                                      this.miMainAction,
00277                                                                                      this.miMainEdit,
00278                                                                                      this.miMainFormat,
00279                                                                                      this.miStyle});
00280             //
00281             // miMainAction
00282             //
00283             this.miMainAction.Index = 0;
00284             this.miMainAction.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00285                                                                                          this.miClear,
00286                                                                                          this.miInkSeparator,
00287                                                                                          this.miExit});
00288             this.miMainAction.Text = "&Action";
00289             //
00290             // miClear
00291             //
00292             this.miClear.Index = 0;
00293             this.miClear.Text = "&Clear";
00294             this.miClear.Click += new System.EventHandler(this.miClear_Click);
00295             //
00296             // miInkSeparator
00297             //
00298             this.miInkSeparator.Index = 1;
00299             this.miInkSeparator.Text = "-";
00300             //
00301             // miExit
00302             //
00303             this.miExit.Index = 2;
00304             this.miExit.Text = "&Exit";
00305             this.miExit.Click += new System.EventHandler(this.miExit_Click);
00306             //
00307             // miMainEdit
00308             //
00309             this.miMainEdit.Index = 1;
00310             this.miMainEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00311                                                                                        this.miCut,
00312                                                                                        this.miCopy,
00313                                                                                        this.miPaste,
00314                                                                                        this.miEditSeparator,
00315                                                                                        this.miLassoSelect,
00316                                                                                        this.miInk});
00317             this.miMainEdit.Text = "&Edit";
00318             this.miMainEdit.Popup += new System.EventHandler(this.miMainEdit_Popup);
00319             //
00320             // miCut
00321             //
00322             this.miCut.Index = 0;
00323             this.miCut.Shortcut = System.Windows.Forms.Shortcut.CtrlX;
00324             this.miCut.Text = "Cu&t";
00325             this.miCut.Click += new System.EventHandler(this.miCut_Click);
00326             //
00327             // miCopy
00328             //
00329             this.miCopy.Index = 1;
00330             this.miCopy.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
00331             this.miCopy.Text = "&Copy";
00332             this.miCopy.Click += new System.EventHandler(this.miCopy_Click);
00333             //
00334             // miPaste
00335             //
00336             this.miPaste.Index = 2;
00337             this.miPaste.Shortcut = System.Windows.Forms.Shortcut.CtrlV;
00338             this.miPaste.Text = "&Paste";
00339             this.miPaste.Click += new System.EventHandler(this.miPaste_Click);
00340             //
00341             // miEditSeparator
00342             //
00343             this.miEditSeparator.Index = 3;
00344             this.miEditSeparator.Text = "-";
00345             //
00346             // miLassoSelect
00347             //
00348             this.miLassoSelect.Index = 4;
00349             this.miLassoSelect.RadioCheck = true;
00350             this.miLassoSelect.Text = "&Select";
00351             this.miLassoSelect.Click += new System.EventHandler(this.miLassoSelect_Click);
00352             //
00353             // miInk
00354             //
00355             this.miInk.Checked = true;
00356             this.miInk.Index = 5;
00357             this.miInk.RadioCheck = true;
00358             this.miInk.Text = "&Ink";
00359             this.miInk.Click += new System.EventHandler(this.miInk_Click);
00360             //
00361             // miMainFormat
00362             //
00363             this.miMainFormat.Index = 2;
00364             this.miMainFormat.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00365                                                                                          this.miISF,
00366                                                                                          this.miMetafile,
00367                                                                                          this.miEMF,
00368                                                                                          this.miBMP,
00369                                                                                          this.miFormatSeparator,
00370                                                                                          this.miSInk,
00371                                                                                          this.miTInk,
00372                                                                                          this.miNoOLE});
00373             this.miMainFormat.Text = "&Format";
00374             //
00375             // miISF
00376             //
00377             this.miISF.Checked = true;
00378             this.miISF.Index = 0;
00379             this.miISF.Text = "&Ink Serialized Format (ISF)";
00380             this.miISF.Click += new System.EventHandler(this.miISF_Click);
00381             //
00382             // miMetafile
00383             //
00384             this.miMetafile.Checked = true;
00385             this.miMetafile.Index = 1;
00386             this.miMetafile.Text = "&Metafile";
00387             this.miMetafile.Click += new System.EventHandler(this.miMetafile_Click);
00388             //
00389             // miEMF
00390             //
00391             this.miEMF.Checked = true;
00392             this.miEMF.Index = 2;
00393             this.miEMF.Text = "&Enhanced Metafile";
00394             this.miEMF.Click += new System.EventHandler(this.miEMF_Click);
00395             //
00396             // miBMP
00397             //
00398             this.miBMP.Checked = true;
00399             this.miBMP.Index = 3;
00400             this.miBMP.Text = "&Bitmap";
00401             this.miBMP.Click += new System.EventHandler(this.miBMP_Click);
00402             //
00403             // miFormatSeparator
00404             //
00405             this.miFormatSeparator.Index = 4;
00406             this.miFormatSeparator.Text = "-";
00407             //
00408             // miSInk
00409             //
00410             this.miSInk.Index = 5;
00411             this.miSInk.RadioCheck = true;
00412             this.miSInk.Text = "&Sketch Ink";
00413             this.miSInk.Click += new System.EventHandler(this.miSInk_Click);
00414             //
00415             // miTInk
00416             //
00417             this.miTInk.Checked = true;
00418             this.miTInk.Index = 6;
00419             this.miTInk.RadioCheck = true;
00420             this.miTInk.Text = "&Text Ink";
00421             this.miTInk.Click += new System.EventHandler(this.miTInk_Click);
00422             //
00423             // miNoOLE
00424             //
00425             this.miNoOLE.Index = 7;
00426             this.miNoOLE.RadioCheck = true;
00427             this.miNoOLE.Text = "&No OLE Object Format";
00428             this.miNoOLE.Click += new System.EventHandler(this.miNoOLE_Click);
00429             //
00430             // miStyle
00431             //
00432             this.miStyle.Index = 3;
00433             this.miStyle.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00434                                                                                     this.miWidth,
00435                                                                                     this.miColor});
00436             this.miStyle.Text = "&Style";
00437             //
00438             // miWidth
00439             //
00440             this.miWidth.Index = 0;
00441             this.miWidth.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00442                                                                                     this.miThin,
00443                                                                                     this.miMedium,
00444                                                                                     this.miThick});
00445             this.miWidth.Text = "&Width";
00446             //
00447             // miThin
00448             //
00449             this.miThin.Index = 0;
00450             this.miThin.Text = "Thin";
00451             this.miThin.Click += new System.EventHandler(this.miThin_Click);
00452             //
00453             // miMedium
00454             //
00455             this.miMedium.Index = 1;
00456             this.miMedium.Text = "Medium";
00457             this.miMedium.Click += new System.EventHandler(this.miMedium_Click);
00458             //
00459             // miThick
00460             //
00461             this.miThick.Index = 2;
00462             this.miThick.Text = "Thick";
00463             this.miThick.Click += new System.EventHandler(this.miThick_Click);
00464             //
00465             // miColor
00466             //
00467             this.miColor.Index = 1;
00468             this.miColor.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
00469                                                                                     this.miRed,
00470                                                                                     this.miGreen,
00471                                                                                     this.miBlue,
00472                                                                                     this.miBlack});
00473             this.miColor.Text = "&Color";
00474             //
00475             // miRed
00476             //
00477             this.miRed.Index = 0;
00478             this.miRed.Text = "Red";
00479             this.miRed.Click += new System.EventHandler(this.miRed_Click);
00480             //
00481             // miGreen
00482             //
00483             this.miGreen.Index = 1;
00484             this.miGreen.Text = "Green";
00485             this.miGreen.Click += new System.EventHandler(this.miGreen_Click);
00486             //
00487             // miBlue
00488             //
00489             this.miBlue.Index = 2;
00490             this.miBlue.Text = "Blue";
00491             this.miBlue.Click += new System.EventHandler(this.miBlue_Click);
00492             //
00493             // miBlack
00494             //
00495             this.miBlack.Index = 3;
00496             this.miBlack.Text = "Black";
00497             this.miBlack.Click += new System.EventHandler(this.miBlack_Click);
00498             //
00499             // rightBottomHandle
00500             //
00501             this.rightBottomHandle.BackColor = System.Drawing.Color.Gray;
00502             this.rightBottomHandle.Cursor = System.Windows.Forms.Cursors.Default;
00503             this.rightBottomHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("rightBottomHandle.Image")));
00504             this.rightBottomHandle.Location = new System.Drawing.Point(281, 256);
00505             this.rightBottomHandle.Name = "rightBottomHandle";
00506             this.rightBottomHandle.Size = new System.Drawing.Size(11, 11);
00507             this.rightBottomHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00508             this.rightBottomHandle.TabIndex = 20;
00509             this.rightBottomHandle.TabStop = false;
00510             this.rightBottomHandle.Visible = false;
00511             //
00512             // centerBottomHandle
00513             //
00514             this.centerBottomHandle.Cursor = System.Windows.Forms.Cursors.Default;
00515             this.centerBottomHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("centerBottomHandle.Image")));
00516             this.centerBottomHandle.Location = new System.Drawing.Point(137, 256);
00517             this.centerBottomHandle.Name = "centerBottomHandle";
00518             this.centerBottomHandle.Size = new System.Drawing.Size(9, 9);
00519             this.centerBottomHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00520             this.centerBottomHandle.TabIndex = 19;
00521             this.centerBottomHandle.TabStop = false;
00522             this.centerBottomHandle.Visible = false;
00523             //
00524             // leftBottomHandle
00525             //
00526             this.leftBottomHandle.BackColor = System.Drawing.Color.Gray;
00527             this.leftBottomHandle.Cursor = System.Windows.Forms.Cursors.Default;
00528             this.leftBottomHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("leftBottomHandle.Image")));
00529             this.leftBottomHandle.Location = new System.Drawing.Point(1, 256);
00530             this.leftBottomHandle.Name = "leftBottomHandle";
00531             this.leftBottomHandle.Size = new System.Drawing.Size(11, 11);
00532             this.leftBottomHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00533             this.leftBottomHandle.TabIndex = 18;
00534             this.leftBottomHandle.TabStop = false;
00535             this.leftBottomHandle.Visible = false;
00536             //
00537             // rightCenterHandle
00538             //
00539             this.rightCenterHandle.Cursor = System.Windows.Forms.Cursors.Default;
00540             this.rightCenterHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("rightCenterHandle.Image")));
00541             this.rightCenterHandle.Location = new System.Drawing.Point(281, 128);
00542             this.rightCenterHandle.Name = "rightCenterHandle";
00543             this.rightCenterHandle.Size = new System.Drawing.Size(9, 9);
00544             this.rightCenterHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00545             this.rightCenterHandle.TabIndex = 17;
00546             this.rightCenterHandle.TabStop = false;
00547             this.rightCenterHandle.Visible = false;
00548             //
00549             // leftCenterHandle
00550             //
00551             this.leftCenterHandle.Cursor = System.Windows.Forms.Cursors.Default;
00552             this.leftCenterHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("leftCenterHandle.Image")));
00553             this.leftCenterHandle.Location = new System.Drawing.Point(1, 128);
00554             this.leftCenterHandle.Name = "leftCenterHandle";
00555             this.leftCenterHandle.Size = new System.Drawing.Size(9, 9);
00556             this.leftCenterHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00557             this.leftCenterHandle.TabIndex = 16;
00558             this.leftCenterHandle.TabStop = false;
00559             this.leftCenterHandle.Visible = false;
00560             //
00561             // rightTopHandle
00562             //
00563             this.rightTopHandle.BackColor = System.Drawing.Color.Gray;
00564             this.rightTopHandle.Cursor = System.Windows.Forms.Cursors.Default;
00565             this.rightTopHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("rightTopHandle.Image")));
00566             this.rightTopHandle.Location = new System.Drawing.Point(281, 0);
00567             this.rightTopHandle.Name = "rightTopHandle";
00568             this.rightTopHandle.Size = new System.Drawing.Size(11, 11);
00569             this.rightTopHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00570             this.rightTopHandle.TabIndex = 15;
00571             this.rightTopHandle.TabStop = false;
00572             this.rightTopHandle.Visible = false;
00573             //
00574             // centerTopHandle
00575             //
00576             this.centerTopHandle.Cursor = System.Windows.Forms.Cursors.Default;
00577             this.centerTopHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("centerTopHandle.Image")));
00578             this.centerTopHandle.Location = new System.Drawing.Point(137, 0);
00579             this.centerTopHandle.Name = "centerTopHandle";
00580             this.centerTopHandle.Size = new System.Drawing.Size(9, 9);
00581             this.centerTopHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00582             this.centerTopHandle.TabIndex = 14;
00583             this.centerTopHandle.TabStop = false;
00584             this.centerTopHandle.Visible = false;
00585             //
00586             // leftTopHandle
00587             //
00588             this.leftTopHandle.BackColor = System.Drawing.Color.Gray;
00589             this.leftTopHandle.Cursor = System.Windows.Forms.Cursors.Default;
00590             this.leftTopHandle.Image = ((System.Drawing.Bitmap)(resources.GetObject("leftTopHandle.Image")));
00591             this.leftTopHandle.Location = new System.Drawing.Point(1, 0);
00592             this.leftTopHandle.Name = "leftTopHandle";
00593             this.leftTopHandle.Size = new System.Drawing.Size(11, 11);
00594             this.leftTopHandle.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
00595             this.leftTopHandle.TabIndex = 13;
00596             this.leftTopHandle.TabStop = false;
00597             this.leftTopHandle.Visible = false;
00598             //
00599             // InkClipboard
00600             //
00601             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
00602             this.ClientSize = new System.Drawing.Size(292, 266);
00603             this.Controls.AddRange(new System.Windows.Forms.Control[] {
00604                                                                           this.rightBottomHandle,
00605                                                                           this.centerBottomHandle,
00606                                                                           this.leftBottomHandle,
00607                                                                           this.rightCenterHandle,
00608                                                                           this.leftCenterHandle,
00609                                                                           this.rightTopHandle,
00610                                                                           this.centerTopHandle,
00611                                                                           this.leftTopHandle});
00612             this.Menu = this.mainMenu;
00613             this.Name = "InkClipboard";
00614             this.Text = "InkClipboard";
00615             this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.InkClipboard_MouseDown);
00616             this.Load += new System.EventHandler(this.InkClipboard_Load);
00617             this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.InkClipboard_MouseUp);
00618             this.Paint += new System.Windows.Forms.PaintEventHandler(this.InkClipboard_Paint);
00619             this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.InkClipboard_MouseMove);
00620             this.ResumeLayout(false);
00621
00622         }
00623     #endregion
00624
00625         #region Standard Template Code
00626         /// <summary>
00627         /// The main entry point for the application.
00628         /// </summary>
00629         [STAThread]
00630         static void Main()
00631         {
00632             Application.Run(new InkClipboard());
00633         }
00634         #endregion
00635
00636
00637         // --------------- Form Events ---------------
00638
00639         /// <summary>
00640         /// Event Handler from Form Load Event
00641         /// Setup the ink collector for collection
00642         /// </summary>
00643         /// <param name="sender">The control that raised the event.</param>
00644         /// <param name="e">The event arguments.</param>
00645         private void InkClipboard_Load(object sender, System.EventArgs e)
00646         {
00647             // Set the application mode to inking
00648             applicationMode = ApplicationMode.Ink;
00649
00650             // Initialize the selection data
00651             lassoPoints = new ArrayList();
00652             selectionHandles = new PictureBox[] {leftTopHandle,centerTopHandle,rightTopHandle,leftCenterHandle,rightCenterHandle,leftBottomHandle,centerBottomHandle,rightBottomHandle};
00653             selectionRect = new Rectangle();
00654             selectedStrokes = null;
00655
00656             // Create the pens used to draw the lasso selection
00657             connectorPen = new Pen(connectorColor);     // Pen used to draw dotted lasso connector line
00658             connectorPen.DashStyle = DashStyle.Dash;
00659             dotEdgePen = new Pen(dotEdgeColor);         // Pen used to draw the outer edge of the lasso dot
00660             dotPen = new Pen(dotColor);                 // Pen used to draw the center of the lasso dot
00661
00662             // Create a new ink collector and assign it to this form's window
00663             myInkCollector = new InkCollector(this.Handle);
00664
00665             // Set the ink collector's pen width
00666             myInkCollector.DefaultDrawingAttributes.Width = MediumInkWidth;
00667
00668             // Turn the ink collector on
00669             myInkCollector.Enabled = true;
00670
00671         }
00672
00673         /// <summary>
00674         /// Event Handler from Form Paint Event
00675         ///
00676         /// When no ink is selected, autoredrawing is turned on and
00677         /// this method doesn't need to do anything.  However, if
00678         /// there is a selection, autoredrawing is turned off and
00679         /// it is necessary to draw the strokes manually
00680         /// (in order to display the strokes as selected).
00681         ///
00682         /// </summary>
00683         /// <param name="sender">The control that raised the event.</param>
00684         /// <param name="e">The event arguments.</param>
00685         private void InkClipboard_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
00686         {
00687             // If AutoRedraw is turned off, perform the drawing manually.
00688             if (!myInkCollector.AutoRedraw)
00689             {
00690
00691                 DrawStrokes(e.Graphics);
00692
00693                 e.Graphics.DrawRectangle(connectorPen,selectionRect);
00694             }
00695
00696             // If the user is drawing a lasso, repaint the lasso points.
00697             if (ApplicationMode.LassoSelection == applicationMode)
00698             {
00699                 DrawLasso(e.Graphics, 0);
00700             }
00701         }
00702
00703         /// <summary>
00704         /// Event Handler from Form Mouse Down Event
00705         /// </summary>
00706         /// <param name="sender">The control that raised the event.</param>
00707         /// <param name="e">The event arguments.</param>
00708         private void InkClipboard_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
00709         {
00710             // If the mouse button was pressed down within the
00711             // current selection area, update the application mode
00712             // to indicate that the user is moving ink and record
00713             // the starting location of the move.  This value will
00714             // be used in MouseMove to determine how much the selected
00715             // ink should be moved.
00716             if (selectionRect.Contains(e.X,e.Y))
00717             {
00718                 applicationMode = ApplicationMode.MoveInk;
00719
00720                 startMoveLocation = new Point(e.X, e.Y);
00721             }
00722                 // Otherwise, if there is a selection and the mouse
00723                 // is pressed, clear the selection.
00724             else if (HasSelection())
00725             {
00726                 SetSelection(null);
00727             }
00728         }
00729
00730         /// <summary>
00731         /// Event Handler from Form Mouse Move Event
00732         /// </summary>
00733         /// <param name="sender">The control that raised the event.</param>
00734         /// <param name="e">The event arguments.</param>
00735         private void InkClipboard_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
00736         {
00737             // If the selected ink is currently being moved...
00738             if (applicationMode == ApplicationMode.MoveInk && HasSelection())
00739             {
00740                 // Compute the ink space distance the mouse has moved and
00741                 // move the selected strokes correspondingly.
00742                 Point moveAmount = new Point(e.X-startMoveLocation.X,e.Y-startMoveLocation.Y);
00743                 myInkCollector.Renderer.PixelToInkSpace(CreateGraphics(),ref moveAmount);
00744                 selectedStrokes.Move(moveAmount.X, moveAmount.Y);
00745
00746                 // Record the location of the mouse since the next
00747                 // move should be relative to it.
00748                 startMoveLocation.X = e.X;
00749                 startMoveLocation.Y = e.Y;
00750
00751                 // Update the selection rectangle
00752                 SetSelection(selectedStrokes);
00753
00754             }
00755             else
00756             {
00757
00758                 // If the mouse has entered the rectangular selection
00759                 // region, disable ink collection and update the cursor
00760                 // to show that the user can move this region.  It is
00761                 // necessary to disable ink collection since ink should not
00762                 // flow from the pen while the user is moving the selection.
00763                 if ( selectionRect.Contains(e.X,e.Y) )
00764                 {
00765                     if (myInkCollector.Enabled)
00766                     {
00767                         myInkCollector.Enabled = false;
00768                         Cursor = System.Windows.Forms.Cursors.SizeAll;
00769                     }
00770                 }
00771                     // Otherwise, enable ink collection and set the cursor
00772                     // to its default value (if necessary).
00773                 else if (!myInkCollector.Enabled)
00774                 {
00775                     myInkCollector.Enabled = true;
00776                     Cursor = System.Windows.Forms.Cursors.Arrow;
00777                 }
00778             }
00779         }
00780
00781
00782
00783         /// <summary>
00784         /// Event Handler from Form Mouse Up Event
00785         /// </summary>
00786         /// <param name="sender">The control that raised the event.</param>
00787         /// <param name="e">The event arguments.</param>
00788         private void InkClipboard_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
00789         {
00790             // If the user was moving selected ink and the
00791             // mouse is raised, set the application mode back to
00792             // its original value.
00793             if (applicationMode == ApplicationMode.MoveInk)
00794             {
00795                 if (miLassoSelect.Checked)
00796                 {
00797                     applicationMode = ApplicationMode.LassoSelection;
00798                 }
00799                 else
00800                 {
00801                     applicationMode = ApplicationMode.Ink;
00802                 }
00803             }
00804         }
00805
00806         /// <summary>
00807         /// Event Handler from Ink->Clear Menu Item
00808         /// </summary>
00809         /// <param name="sender">The control that raised the event.</param>
00810         /// <param name="e">The event arguments.</param>
00811         private void miClear_Click(object sender, System.EventArgs e)
00812         {
00813             // Clear the selection and delete all strokes from the ink
00814             myInkCollector.Ink.DeleteStrokes();
00815             SetSelection(null);
00816
00817         }
00818
00819         /// <summary>
00820         /// Event Handler from Ink->Exit Menu Item
00821         /// </summary>
00822         /// <param name="sender">The control that raised the event.</param>
00823         /// <param name="e">The event arguments.</param>
00824         private void miExit_Click(object sender, System.EventArgs e)
00825         {
00826             // Although not required, it is good practice to disable
00827             // ink collection before exiting
00828             myInkCollector.Enabled = false;
00829
00830             Application.Exit();
00831         }
00832
00833         /// <summary>
00834         /// Event Handler from Edit Select Event
00835         ///
00836         /// If the Edit menu is selected, check whether the object
00837         /// that is currently on the clipboard can be pasted into
00838         /// the ink.  Disable the Paste item if it can't be pasted.
00839         /// Also, disable Copy and Cut if no ink is selected.
00840         ///
00841         ///
00842         /// Allowable formats:  Ink Serialized Format or Embeddable OLE
00843         /// Object (Text Ink or Sketch Ink).
00844         ///
00845         /// </summary>
00846         /// <param name="sender">The control that raised the event.</param>
00847         /// <param name="e">The event arguments.</param>
00848         private void miMainEdit_Popup(object sender, System.EventArgs e)
00849         {
00850             miPaste.Enabled = myInkCollector.Ink.CanPaste();
00851             miCopy.Enabled = HasSelection();
00852             miCut.Enabled = HasSelection();
00853         }
00854
00855         /// <summary>
00856         /// Event Handler from Edit->Cut Menu Item
00857         /// </summary>
00858         /// <param name="sender">The control that raised the event.</param>
00859         /// <param name="e">The event arguments.</param>
00860         private void miCut_Click(object sender, System.EventArgs e)
00861         {
00862
00863             // Use helper method to cut the selection
00864             CopyInkToClipboard(InkClipboardModes.Cut);
00865
00866             SetSelection(null);
00867
00868         }
00869
00870         /// <summary>
00871         /// Event Handler from Edit->Copy Menu Item
00872         /// </summary>
00873         /// <param name="sender">The control that raised the event.</param>
00874         /// <param name="e">The event arguments.</param>
00875         private void miCopy_Click(object sender, System.EventArgs e)
00876         {
00877
00878             // Use helper method to copy the selection
00879             CopyInkToClipboard(InkClipboardModes.Copy);
00880
00881         }
00882
00883         /// <summary>
00884         /// Event Handler from Edit->Paste Menu Item
00885         /// </summary>
00886         /// <param name="sender">The control that raised the event.</param>
00887         /// <param name="e">The event arguments.</param>
00888         private void miPaste_Click(object sender, System.EventArgs e)
00889         {
00890             if (myInkCollector.Ink.CanPaste())
00891             {
00892                 // Compute the location where the ink should be pasted;
00893                 // this location should be shifted from the origin
00894                 // to account for the width of the selection rectangle's handle.
00895                 Point offset = new Point(leftTopHandle.Width+1,leftTopHandle.Height+1);
00896                 myInkCollector.Renderer.PixelToInkSpace(CreateGraphics(), ref offset);
00897
00898                 // Use Ink API to paste the clipboard data into the Ink
00899                 Strokes pastedStrokes = myInkCollector.Ink.ClipboardPaste(offset);
00900
00901                 // If the contents of the clipboard were a valid format
00902                 // (Ink Serialized Format or Embeddable OLE Object) and at
00903                 // least one stroke was pasted into the ink, use a helper
00904                 // method to update the stroke selection.  Otherwise,
00905                 // the result will be null and this paste becomes a no-op.
00906                 if (null != pastedStrokes)
00907                 {
00908                     SetSelection(pastedStrokes);
00909                 }
00910
00911             }
00912             else
00913             {
00914                 MessageBox.Show("Unable to paste ink.");
00915             }
00916         }
00917
00918         /// <summary>
00919         /// Event Handler from Edit->Select Menu Item
00920         /// </summary>
00921         /// <param name="sender">The control that raised the event.</param>
00922         /// <param name="e">The event arguments.</param>
00923         private void miLassoSelect_Click(object sender, System.EventArgs e)
00924         {
00925             // Set the application mode to lasso selection
00926             applicationMode = ApplicationMode.LassoSelection;
00927
00928             // Lasso strokes should be transparent
00929             myInkCollector.DefaultDrawingAttributes.Transparency = 255;
00930
00931             // Use helper method to clear the selection
00932             SetSelection(null);
00933
00934             // Update menu item state
00935             miLassoSelect.Checked = true;
00936             miInk.Checked = false;
00937
00938             // Hook the new packets and stroke events since
00939             // these events are needed to implement lasso selection.
00940             // These events are only hooked when they are needed to improve
00941             // performance.
00942             myInkCollector.NewPackets += new InkCollectorNewPacketsEventHandler(myInkCollector_NewPackets);
00943             myInkCollector.Stroke += new InkCollectorStrokeEventHandler(myInkCollector_Stroke);
00944
00945         }
00946
00947
00948         /// <summary>
00949         /// Event Handler from Edit->Ink Menu Item
00950         /// </summary>
00951         /// <param name="sender">The control that raised the event.</param>
00952         /// <param name="e">The event arguments.</param>
00953         private void miInk_Click(object sender, System.EventArgs e)
00954         {
00955
00956             // Set the application mode to ink collection
00957             applicationMode = ApplicationMode.Ink;
00958
00959             // Ink strokes should be opaque
00960             myInkCollector.DefaultDrawingAttributes.Transparency = 0;
00961
00962             // Use helper method to clear the selection
00963             SetSelection(null);
00964
00965             // Update menu item state
00966             miLassoSelect.Checked = false;
00967             miInk.Checked = true;
00968
00969             // Unhook the new packets and stroke events since
00970             // these events are only needed to implement lasso selection.
00971             // These events are only hooked when they are needed to improve
00972             // performance.
00973             myInkCollector.NewPackets -= new InkCollectorNewPacketsEventHandler(myInkCollector_NewPackets);
00974             myInkCollector.Stroke -= new InkCollectorStrokeEventHandler(myInkCollector_Stroke);
00975
00976         }
00977
00978         /// <summary>
00979         /// Event Handler from Format->ISF Menu Item
00980         /// </summary>
00981         /// <param name="sender">The control that raised the event.</param>
00982         /// <param name="e">The event arguments.</param>
00983         private void miISF_Click(object sender, System.EventArgs e)
00984         {
00985             miISF.Checked = !miISF.Checked;
00986         }
00987
00988         /// <summary>
00989         /// Event Handler from Metafile->ISF Menu Item
00990         /// </summary>
00991         /// <param name="sender">The control that raised the event.</param>
00992         /// <param name="e">The event arguments.</param>
00993         private void miMetafile_Click(object sender, System.EventArgs e)
00994         {
00995             miMetafile.Checked = !miMetafile.Checked;
00996         }
00997
00998         /// <summary>
00999         /// Event Handler from Format->EMF Menu Item
01000         /// </summary>
01001         /// <param name="sender">The control that raised the event.</param>
01002         /// <param name="e">The event arguments.</param>
01003         private void miEMF_Click(object sender, System.EventArgs e)
01004         {
01005             miEMF.Checked = !miEMF.Checked;
01006         }
01007
01008         /// <summary>
01009         /// Event Handler from Format->BMP Menu Item
01010         /// </summary>
01011         /// <param name="sender">The control that raised the event.</param>
01012         /// <param name="e">The event arguments.</param>
01013         private void miBMP_Click(object sender, System.EventArgs e)
01014         {
01015             miBMP.Checked = !miBMP.Checked;
01016         }
01017
01018         /// <summary>
01019         /// Event Handler from Format->Text Ink Menu Item
01020         /// </summary>
01021         /// <param name="sender">The control that raised the event.</param>
01022         /// <param name="e">The event arguments.</param>
01023         private void miTInk_Click(object sender, System.EventArgs e)
01024         {
01025             miSInk.Checked = false;
01026             miTInk.Checked = true;
01027             miNoOLE.Checked = false;
01028         }
01029
01030         /// <summary>
01031         /// Event Handler from Format->Sketch Ink Menu Item
01032         /// </summary>
01033         /// <param name="sender">The control that raised the event.</param>
01034         /// <param name="e">The event arguments.</param>
01035         private void miSInk_Click(object sender, System.EventArgs e)
01036         {
01037             miSInk.Checked = true;
01038             miTInk.Checked = false;
01039             miNoOLE.Checked = false;
01040         }
01041
01042         /// <summary>
01043         /// Event Handler from Format->No OLE Object Menu Item
01044         /// </summary>
01045         /// <param name="sender">The control that raised the event.</param>
01046         /// <param name="e">The event arguments.</param>
01047         private void miNoOLE_Click(object sender, System.EventArgs e)
01048         {
01049             miSInk.Checked = false;
01050             miTInk.Checked = false;
01051             miNoOLE.Checked = true;
01052         }
01053
01054         /// <summary>
01055         /// Event Handler from Style->Color->Red Menu Item
01056         /// </summary>
01057         /// <param name="sender">The control that raised the event.</param>
01058         /// <param name="e">The event arguments.</param>
01059         private void miRed_Click(object sender, System.EventArgs e)
01060         {
01061
01062             // Use helper method to set the InkCollector and the
01063             // selected strokes to the selected color.
01064             SetColor(Color.Red);
01065
01066         }
01067
01068         /// <summary>
01069         /// Event Handler from Style->Color->Green Menu Item
01070         /// </summary>
01071         /// <param name="sender">The control that raised the event.</param>
01072         /// <param name="e">The event arguments.</param>
01073         private void miGreen_Click(object sender, System.EventArgs e)
01074         {
01075
01076             // Use helper method to set the InkCollector and the
01077             // selected strokes to the selected color.
01078             SetColor(Color.Green);
01079
01080         }
01081
01082         /// <summary>
01083         /// Event Handler from Style->Color->Blue Menu Item
01084         /// </summary>
01085         /// <param name="sender">The control that raised the event.</param>
01086         /// <param name="e">The event arguments.</param>
01087         private void miBlue_Click(object sender, System.EventArgs e)
01088         {
01089
01090             // Use helper method to set the InkCollector and the
01091             // selected strokes to the selected color.
01092             SetColor(Color.Blue);
01093
01094         }
01095
01096         /// <summary>
01097         /// Event Handler from Style->Color->Black Menu Item
01098         /// </summary>
01099         /// <param name="sender">The control that raised the event.</param>
01100         /// <param name="e">The event arguments.</param>
01101         private void miBlack_Click(object sender, System.EventArgs e)
01102         {
01103
01104             // Use helper method to set the InkCollector and the
01105             // selected strokes to the selected color.
01106             SetColor(Color.Black);
01107
01108         }
01109
01110         /// <summary>
01111         /// Event Handler from Style->Width->Thin Menu Item
01112         /// </summary>
01113         /// <param name="sender">The control that raised the event.</param>
01114         /// <param name="e">The event arguments.</param>
01115         private void miThin_Click(object sender, System.EventArgs e)
01116         {
01117
01118             // Use helper method to set the InkCollector and the
01119             // selected strokes to the selected pen width.
01120             SetWidth(ThinInkWidth);
01121
01122         }
01123
01124         /// <summary>
01125         /// Event Handler from Style->Width->Medium Menu Item
01126         /// </summary>
01127         /// <param name="sender">The control that raised the event.</param>
01128         /// <param name="e">The event arguments.</param>
01129         private void miMedium_Click(object sender, System.EventArgs e)
01130         {
01131
01132             // Use helper method to set the InkCollector and the
01133             // selected strokes to the selected pen width.
01134             SetWidth(MediumInkWidth);
01135
01136         }
01137
01138         /// <summary>
01139         /// Event Handler from Style->Width->Thick Menu Item
01140         /// </summary>
01141         /// <param name="sender">The control that raised the event.</param>
01142         /// <param name="e">The event arguments.</param>
01143         private void miThick_Click(object sender, System.EventArgs e)
01144         {
01145
01146             // Use helper method to set the InkCollector and the
01147             // selected strokes to the selected pen width.
01148             SetWidth(ThickInkWidth);
01149
01150         }
01151
01152         // --------------- Ink Collector Events ---------------
01153
01154         /// <summary>
01155         /// Event Handler from Ink Collector's NewPackets event
01156         ///
01157         /// This event is fired when the Ink Collector receives
01158         /// new packet data and the user is drawing a lasso.
01159         /// In this case,  it is necessary to intercept the new packets
01160         /// and use them to draw the selection lasso.
01161         /// </summary>
01162         /// <param name="sender">The control that raised the event.</param>
01163         /// <param name="e">The event arguments.</param>
01164         private void myInkCollector_NewPackets(object sender, InkCollectorNewPacketsEventArgs e)
01165         {
01166
01167             // retrieve the size of each packet
01168             int packetSize = e.Stroke.PacketSize;
01169
01170             // the index where the new lasso points will be added
01171             int newPacketIndex = lassoPoints.Count;
01172
01173             // Add each new packet into the lasso points collection
01174             for (int i = 0; i < e.PacketCount; i++)
01175             {
01176
01177                 // retrieve the x and y packet values
01178                 Point pt = new Point(e.PacketData[i*packetSize+XPacketIndex],
01179                     e.PacketData[i*packetSize+YPacketIndex]);
01180                 myInkCollector.Renderer.InkSpaceToPixel(this.Handle, ref pt);
01181
01182
01183                 // If the x or y packet values fall outside of
01184                 // the drawing area , update them to the nearest
01185                 // location on the drawing area.  This adjustment
01186                 // prevents the lasso's boundaries from going
01187                 // beyond the drawing area.
01188                 if (pt.X<0)
01189                 {
01190                     pt.X = 0;
01191                 }
01192                 if (pt.X>ClientSize.Width)
01193                 {
01194                     pt.X = ClientSize.Width;
01195                 }
01196                 if (pt.Y<0)
01197                 {
01198                     pt.Y = 0;
01199                 }
01200                 if (pt.Y>this.ClientSize.Height)
01201                 {
01202                     pt.Y = ClientSize.Height;
01203                 }
01204
01205                 // Add the new point into the lasso points collection
01206                 lassoPoints.Add(pt);
01207
01208             }
01209
01210             // Draw the updated lasso.  In order to improve performance,
01211             // only the new lasso packets will be drawn.
01212             DrawLasso(CreateGraphics(),newPacketIndex);
01213         }
01214
01215         /// <summary>
01216         /// Event Handler from Ink Collector's Stroke event
01217         ///
01218         /// This event is fired when a new lasso stroke is drawn.
01219         /// In this case, it is necessary to update the selected
01220         /// strokes information.
01221         /// </summary>
01222         /// <param name="sender">The control that raised the event.</param>
01223         /// <param name="e">The event arguments.</param>
01224         private void myInkCollector_Stroke(object sender, InkCollectorStrokeEventArgs e )
01225         {
01226
01227             // This stroke corresponds to the lasso -
01228             // cancel it so that it is not added into the ink
01229             e.Cancel = true;
01230
01231             Strokes hitStrokes = null;
01232
01233             // If there are enough lasso points, perform a hit test
01234             // to determine which strokes were selected.
01235             if (lassoPoints.Count > 2)
01236             {
01237
01238                 // Convert the lasso points from pixels to ink space
01239                 Point[] inkLassoPoints = (Point[])lassoPoints.ToArray(typeof(Point));
01240                 myInkCollector.Renderer.PixelToInkSpace(CreateGraphics(), ref inkLassoPoints);
01241
01242                 // Perform a hit test on this ink collector's ink to
01243                 // determine which points were selected by the lasso stroke.
01244                 //
01245                 // Note that there is a slight inefficiency here since the
01246                 // lasso stroke is part of the ink and, therefore, part of the
01247                 // hit test - even though we don't need it.   It would have
01248                 // been more efficient to remove the stroke from the ink before
01249                 // calling HitTest.  However, it is not good practice to modify
01250                 // the stroke inside of its own event handler.
01251                 hitStrokes = myInkCollector.Ink.HitTest(inkLassoPoints, LassoPercent);
01252                 hitStrokes.Remove(e.Stroke);
01253
01254             }
01255
01256             // Reset the lasso points
01257             lassoPoints.Clear();
01258             lastDrawnLassoDot = Point.Empty;
01259
01260             // Use helper method to set the selection
01261             SetSelection(hitStrokes);
01262
01263         }
01264
01265         // --------------- Helper Methods ---------------
01266
01267         /// <summary>
01268         /// Helper method to convert a rectangle in pixel coordinates
01269         /// to ink space coordinates.  (1 ink space unit = .01mm)
01270         ///
01271         /// Note that this method works since there is guaranteed not
01272         /// to be any rotation in this sample.
01273         /// </summary>
01274         /// <param name="g">The graphics display</param>
01275         /// <param name="r">The rectangle to convert</param>
01276         private void PixelToInkSpace(Graphics g, ref Rectangle r)
01277         {
01278
01279             Point leftTop = new Point(r.X,r.Y);
01280             Point widthHeight = new Point (r.Width, r.Height);
01281             myInkCollector.Renderer.PixelToInkSpace(g, ref leftTop);
01282             myInkCollector.Renderer.PixelToInkSpace(g, ref widthHeight);
01283
01284             r.Location = leftTop;
01285             r.Size = new Size(widthHeight);
01286
01287         }
01288
01289         /// <summary>
01290         /// Helper method to convert a rectangle in ink space
01291         /// coordinates to pixel coordinates.  (1 ink space unit = .01mm)
01292         ///
01293         /// Note that this method works since there is guaranteed not
01294         /// to be any rotation in this sample.
01295         /// </summary>
01296         /// <param name="g">The graphics display</param>
01297         /// <param name="r">The rectangle to convert</param>
01298         private void InkSpaceToPixel(Graphics g, ref Rectangle r)
01299         {
01300             Point leftTop = new Point(r.X,r.Y);
01301             Point widthHeight = new Point (r.Width, r.Height);
01302             myInkCollector.Renderer.InkSpaceToPixel(g, ref leftTop);
01303             myInkCollector.Renderer.InkSpaceToPixel(g, ref widthHeight);
01304
01305             r.Location = leftTop;
01306             r.Size = new Size(widthHeight);
01307
01308         }
01309
01310         /// <summary>
01311         /// This method uses the Ink API to copy ink onto
01312         /// the clipboard.
01313         /// </summary>
01314         /// <param name="clipboardModes">The clipboard modes (such as copy or paste)</param>
01315         private void CopyInkToClipboard(InkClipboardModes clipboardModes)
01316         {
01317
01318             // Declare the ink clipboard formats to put on the clipboard
01319             InkClipboardFormats formats = new InkClipboardFormats();
01320
01321             // Use selected format menu items to set the clipboard formats
01322             if (miISF.Checked)
01323             {
01324                 formats |= InkClipboardFormats.InkSerializedFormat;
01325             }
01326             if (miMetafile.Checked)
01327             {
01328                 formats |= InkClipboardFormats.Metafile;
01329             }
01330             if (miEMF.Checked)
01331             {
01332                 formats |= InkClipboardFormats.EnhancedMetafile;
01333             }
01334             if (miBMP.Checked)
01335             {
01336                 formats |= InkClipboardFormats.Bitmap;
01337             }
01338             if (miSInk.Checked)
01339             {
01340                 formats |= InkClipboardFormats.SketchInk;
01341             }
01342             if (miTInk.Checked)
01343             {
01344                 formats |= InkClipboardFormats.TextInk;
01345             }
01346
01347             // If at least one format was selected, invoke the Ink
01348             // API's ClipboardCopy method.  Note that selectedStrokes
01349             // could be null, but that this is ok - if selectedStrokes
01350             // is null, all of the ink is copied.
01351             if (formats != InkClipboardFormats.None)
01352             {
01353                 myInkCollector.Ink.ClipboardCopy(selectedStrokes,formats,clipboardModes);
01354             }
01355             else
01356             {
01357                 MessageBox.Show("No clipboard formats selected");
01358             }
01359         }
01360
01361         /// <summary>
01362         /// Sets the selected strokes and selection rectangle.
01363         /// </summary>
01364         /// <param name="strokes">The strokes that should be selected.  If null, the selection becomes empty</param>
01365         private void SetSelection(Strokes strokes)
01366         {
01367             // Tracks whether the rectangle that bounds the selected
01368             // strokes should be displayed
01369             bool isSelectionVisible = false;
01370
01371             // Update the selected strokes collection
01372             selectedStrokes = strokes;
01373
01374             // If no strokes are selected, set the selection rectangle
01375             // to empty
01376             if (!HasSelection())
01377             {
01378                 selectionRect = Rectangle.Empty;
01379             }
01380                 // Otherwise, at least one stroke is selected and it is necessary
01381                 // to display the selection rectangle.
01382             else
01383             {
01384                 isSelectionVisible = true;
01385
01386                 // Retrieve the bounding box of the strokes
01387                 selectionRect = selectedStrokes.GetBoundingBox();
01388                 InkSpaceToPixel(CreateGraphics(),ref selectionRect);
01389
01390                 // Pad the selection rectangle so that the selected ink
01391                 // doesn't overlap with the selection rectangle's handles.
01392                 selectionRect.Inflate(SelectionRectBuffer, SelectionRectBuffer);
01393
01394                 // compute the center of the rectangle that bounds the
01395                 // selected strokes
01396                 int xAvg = (selectionRect.Right+selectionRect.Left)/2;
01397                 int yAvg = (selectionRect.Top+selectionRect.Bottom)/2;
01398
01399                 // Draw the resize handles
01400                 // top left
01401                 SetLocation(selectionHandles[0],selectionRect.Left, selectionRect.Top);
01402                 // top
01403                 SetLocation(selectionHandles[1],xAvg, selectionRect.Top);
01404                 // top right
01405                 SetLocation(selectionHandles[2],selectionRect.Right, selectionRect.Top);
01406
01407                 // left
01408                 SetLocation(selectionHandles[3],selectionRect.Left, yAvg);
01409                 // right
01410                 SetLocation(selectionHandles[4],selectionRect.Right, yAvg);
01411
01412                 // bottom left
01413                 SetLocation(selectionHandles[5],selectionRect.Left, selectionRect.Bottom);
01414                 // bottom
01415                 SetLocation(selectionHandles[6],xAvg, selectionRect.Bottom);
01416                 // bottom right
01417                 SetLocation(selectionHandles[7],selectionRect.Right, selectionRect.Bottom);
01418             }
01419
01420             // Set the visibility of each selection handle in the
01421             // selection rectangle.  If there is no selection, all
01422             // handles should be hidden.  Otherwise, all handles should
01423             // be visible.
01424             foreach(PictureBox pb in selectionHandles)
01425             {
01426                 pb.Visible = isSelectionVisible;
01427             }
01428
01429             // Turn off autoredrawing if there is a selection - otherwise,
01430             // the selected ink will not be displayed as selected.
01431             myInkCollector.AutoRedraw = !isSelectionVisible;
01432
01433             // Since the selection has changed, repaint the screen.
01434             Refresh();
01435         }
01436
01437         /// <summary>
01438         /// Helper method to set the location of the selection rectangle
01439         /// handle.
01440         /// </summary>
01441         /// <param name="pb">The handle's picture box</param>
01442         /// <param name="xCenter">The desired x coordinate of the center</param>
01443         /// <param name="yCenter">The desired y coordinate of the center</param>
01444         public void SetLocation(PictureBox pb, int xCenter, int yCenter)
01445         {
01446             Point location = new Point();
01447
01448             location.X = xCenter - pb.Width/2;
01449             location.Y = yCenter - pb.Height/2;
01450
01451             pb.Location = location;
01452         }
01453
01454         /// <summary>
01455         /// Helper method to determine if there is a selection
01456         /// </summary>
01457         /// <returns>True if there is a selection</returns>
01458         public bool HasSelection()
01459         {
01460             return selectedStrokes!=null && selectedStrokes.Count > 0;
01461         }
01462
01463         /// <summary>
01464         /// Draws the selection lasso.
01465         ///
01466         /// Note that this method does NOT draw a point for every piece
01467         /// of packet data.  Instead, it draws evenly spaced dots that
01468         /// fall along the lasso path.
01469         /// </summary>
01470         /// <param name="g">The graphics device</param>
01471         /// <param name="newPacketIndex">The index where the new packets begin</param>
01472         public void DrawLasso(Graphics g, int newPacketIndex)
01473         {
01474
01475             // The distance between the current point and the next point
01476             int     dx, dy;
01477
01478             // The distance and angle of the line connecting the current
01479             // point and the next point
01480             double  lineLength;
01481             double  angle;
01482
01483             // The horizontal and vertical spacing between the dots
01484             double  segSpaceX, segSpaceY;
01485
01486             // The total number of dots to draw
01487             int     totalSegments;
01488
01489             // Undraw the line that connected the first point to the
01490             // last point before the latest packets were added.
01491             DrawLassoConnector(0,newPacketIndex-1);
01492
01493             // For each lasso point, draw the corresponding lasso dots.
01494             // Note that this method does NOT draw a point for every piece
01495             // of packet data.  Instead, it draws evenly spaced dots that
01496             // fall along the lasso path.
01497             for (int i = newPacketIndex; i < lassoPoints.Count; i++)
01498             {
01499                 //  Always draw the first packet...
01500                 if (0 == i)
01501                 {
01502                     // Update the last drawn lasso dot to this packet
01503                     lastDrawnLassoDot.X = ((Point)lassoPoints[i]).X;
01504                     lastDrawnLassoDot.Y = ((Point)lassoPoints[i]).Y;
01505
01506                     // use a helper method to draw the lasso dot
01507                     DrawSelectionInkDot(g, lastDrawnLassoDot.X, lastDrawnLassoDot.Y);
01508                 }
01509                 else
01510                 {
01511                     // Compute the x and y distance between this point and the last drawn
01512                     // lasso dot
01513                     dx = ((Point)lassoPoints[i]).X - lastDrawnLassoDot.X;
01514                     dy = ((Point)lassoPoints[i]).Y - lastDrawnLassoDot.Y;
01515
01516                     // Compute length of the line between this point and the last drawn
01517                     // lasso dot
01518                     lineLength = Math.Sqrt(dx*dx + dy*dy);
01519
01520                     // If the spacing between this packet and the last drawn lasso
01521                     // dot is greater than the desired DotSpacing, draw as many
01522                     // evently spaced lasso points as needed to fill the distance...
01523                     if (DotSpacing <= lineLength)
01524                     {
01525
01526                         // Calculate the angle of the line connecting this point
01527                         // to the last drawn lasso point.
01528                         angle = Math.Atan2(dy, dx);
01529
01530                         // Calculate the x and y components of the dot spacing
01531                         segSpaceX = DotSpacing * Math.Cos(angle);
01532                         segSpaceY = DotSpacing * Math.Sin(angle);
01533
01534                         // Calculate the number of dots we will need to draw.
01535                         totalSegments = (int)(lineLength/ (double)DotSpacing);
01536
01537                         // draw the lasso dots...
01538                         for (int j = 0; j < totalSegments; j++)
01539                         {
01540                             // The coordinates of the lasso dot are determined by the
01541                             // previous lasso dot plus the x and y components of the
01542                             // dot spacing (computed above).
01543                             lastDrawnLassoDot.X = (int)(lastDrawnLassoDot.X + segSpaceX);
01544                             lastDrawnLassoDot.Y = (int)(lastDrawnLassoDot.Y + segSpaceY);
01545
01546                             // use a helper method to draw the lasso dot
01547                             DrawSelectionInkDot(g, lastDrawnLassoDot.X, lastDrawnLassoDot.Y);
01548
01549                         }
01550                     }
01551                 }
01552             }
01553
01554             // draw the line connecting the first point to the last point
01555             DrawLassoConnector(0,lassoPoints.Count-1);
01556         }
01557
01558         /// <summary>
01559         /// Helper method to draw/undraw the lasso connector line
01560         /// </summary>
01561         /// <param name="start">The index of the start point</param>
01562         /// <param name="end">The index of the end point</param>
01563         /// <param name="points">The lasso points</param>
01564         private void DrawLassoConnector(int start, int end)
01565         {
01566             if ((end > start) && (lassoPoints.Count>1) && (end < lassoPoints.Count))
01567             {
01568                 // Draw a reversible line from the point at start
01569                 // to the point at end.
01570                 Point startPoint = (Point)lassoPoints[start];
01571                 Point endPoint = (Point)lassoPoints[end];
01572
01573                 // Convert to screen space
01574                 startPoint = PointToScreen(startPoint);
01575                 endPoint = PointToScreen(endPoint);
01576
01577                 // Reverse the line - this is the .NET way of drawing
01578                 // an XOR line.
01579                 ControlPaint.DrawReversibleLine(startPoint,endPoint,BackColor);
01580             }
01581         }
01582
01583         /// <summary>
01584         /// Helper method to draw a lasso seletion dot
01585         /// </summary>
01586         /// <param name="g">The graphics device</param>
01587         /// <param name="x">The x coordinate of the center of the dot</param>
01588         /// <param name="y">The y coordinate of the center of the dot</param>
01589         private void DrawSelectionInkDot(Graphics g, int x, int y)
01590         {
01591             //
01592             // Offset the x and y by 1/2 the dot size (biasing lower-right)
01593             //
01594             x = x-(DotSize/2);
01595             y = y-(DotSize/2);
01596
01597             // Draw the inside of the lasso dot
01598             g.FillEllipse(dotPen.Brush,x,y,DotSize,DotSize);
01599
01600             // Draw the outside edge of the lasso dot
01601             g.DrawEllipse(dotEdgePen, x,y, DotSize, DotSize);
01602
01603         }
01604
01605         /// <summary>
01606         /// This method is used to render ink when there is
01607         /// a selection.
01608         /// </summary>
01609         /// <param name="g">The graphics device</param>
01610         private void DrawStrokes(Graphics g)
01611         {
01612
01613             // First, draw the strokes that are not part of the
01614             // selection.  These strokes will appear the same
01615             // as the InkCollector would normally draw them.
01616             Strokes unselectedStrokes = myInkCollector.Ink.Strokes;
01617             unselectedStrokes.Remove(selectedStrokes);
01618             myInkCollector.Renderer.Draw(g, unselectedStrokes);
01619
01620             // Next, draw each selected stroke.  A selected stroke
01621             // is rendered in white with a selection border.
01622             foreach (Stroke selectedStroke in selectedStrokes)
01623             {
01624                 DrawingAttributes da = selectedStroke.DrawingAttributes.Clone();
01625                 da.Color = SystemColors.WindowText;
01626                 da.Width = da.Width+SelectedInkWidthIncrease;
01627                 myInkCollector.Renderer.Draw(g, selectedStroke, da);
01628                 da.Color = Color.White;
01629                 da.Width = da.Width-SelectedInkWidthIncrease;
01630                 myInkCollector.Renderer.Draw(g, selectedStroke, da);
01631             }
01632         }
01633
01634         /// <summary>
01635         /// Helper method to set the InkCollector and the
01636         /// selected stroke color.
01637         /// </summary>
01638         /// <param name="newColor">The new color</param>
01639         private void SetColor(Color newColor)
01640         {
01641             myInkCollector.DefaultDrawingAttributes.Color = newColor;
01642
01643             // In addition to updating the ink collector, also update
01644             // the drawing attributes of all selected strokes.
01645             if (HasSelection())
01646             {
01647                 foreach (Stroke s in selectedStrokes)
01648                 {
01649                     s.DrawingAttributes.Color = newColor;
01650                 }
01651             }
01652
01653             Refresh();
01654         }
01655
01656         /// <summary>
01657         /// Helper method to set the InkCollector and the
01658         /// selected stroke pen width.
01659         /// </summary>
01660         /// <param name="newWidth">The new pen width</param>
01661         private void SetWidth(float newWidth)
01662         {
01663             myInkCollector.DefaultDrawingAttributes.Width = newWidth;
01664
01665             // In addition to updating the ink collector, also update
01666             // the drawing attributes of all selected strokes.
01667             if (HasSelection())
01668             {
01669                 foreach (Stroke s in selectedStrokes)
01670                 {
01671                     s.DrawingAttributes.Width = newWidth;
01672                 }
01673             }
01674
01675             Refresh();
01676         }
01677
01678     }
01679 }
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/common.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

common.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module COMMON.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _COMMON_H_
00012 #define _COMMON_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019 #include "Headers.h"
00020 #include "crtdbg.h"   //_ASSERTE
00021
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // Externs
00025 //
00026 //////////////////////////////////////////////////////////////////////////////
00027 extern CComPtr<IDataConvert>  g_spDataConvert;
00028
00029
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // Enums
00033 //
00034 //////////////////////////////////////////////////////////////////////////////
00035 enum CONV_FLAGS
00036 {
00037   CONV_NONE     = 0x00000000,
00038   CONV_VARBOOL    = 0x00000001,
00039   CONV_ALPHABOOL    = 0x00000002,
00040   CONV_HEX      = 0x00000004,
00041   CONV_OCTAL      = 0x00000008,
00042   CONV_DECIMAL    = 0x00000010,
00043   CONV_BINARY     = 0x00000020,
00044
00045   CONV_TYPENAME   = 0x00000100,
00046   CONV_MSDADC_ONLY  = 0x00001000
00047 };
00048
00049
00050
00051 /////////////////////////////////////////////////////////////////////////////
00052 // Defines
00053 //
00054 //////////////////////////////////////////////////////////////////////////////
00055 #define HKEY_ROWSETVIEWER   HKEY_CURRENT_USER
00056 #define wszROWSETVIEWER_KEY   L"Software\\Microsoft\\OLE DB\\RowsetViewer"
00057 #define wszCONFIG_KEY     wszROWSETVIEWER_KEY L"\\Config"
00058 #define wszRECENTCONFIG_KEY   wszROWSETVIEWER_KEY L"\\RecentConfig"
00059 #define wszRECENTFILE_KEY   wszROWSETVIEWER_KEY L"\\RecentFile"
00060 #define wszRECENTINITSTRING_KEY wszROWSETVIEWER_KEY L"\\RecentInitString"
00061 #define wszOPTIONS_KEY      wszROWSETVIEWER_KEY L"\\Options"
00062 #define wszTRACE_KEY      wszROWSETVIEWER_KEY L"\\Trace"
00063 #define wszOBJECTS_KEY      wszROWSETVIEWER_KEY L"\\Objects"
00064 #define wszMDICHILD_KEY     wszROWSETVIEWER_KEY L"\\MDIChild"
00065 #define wszRECENTURL_KEY    wszROWSETVIEWER_KEY L"\\RecentURL"
00066
00067
00068 ///////////////////////////////////////////////////////////////
00069 // Colors
00070 //
00071 ///////////////////////////////////////////////////////////////
00072 //RGB is exact opposite of COLORREF.  COLOREF = 0x00bbggrr, RGB = 0x00RRGGBB
00073 #define RGB_FROM_COLOREF(cref)   (((cref & 0x000000FF) << 16) | ((cref & 0x0000FF00)) | ((cref & 0x00FF0000) >> 16))
00074
00075 const COLORREF  RGB_BLUE    = RGB(0,    0,   0xff);
00076 const COLORREF  RGB_DARK_BLUE = RGB(0,    0,   0x80);
00077 const COLORREF  RGB_GREEN   = RGB(0,   0xff,    0);
00078 const COLORREF  RGB_DARK_GREEN  = RGB(0,   0x80,    0);
00079 const COLORREF  RGB_RED     = RGB(0xff,   0,    0);
00080 const COLORREF  RGB_DARK_RED  = RGB(0x80,   0,    0);
00081 const COLORREF  RGB_BROWN   = RGB(0x80,  0x40,    0);
00082
00083 const COLORREF  RGB_NONE    = 0;
00084
00085
00086 ////////////////////////////////////////////////////////////////////////////
00087 // Windows Defines
00088 //
00089 ////////////////////////////////////////////////////////////////////////////
00090 //Dialog Box procedures want to know if you handled the MSG
00091 //or not.  If you do, thenit just returns, if not then it calls
00092 //the default windialog procedure to try and handle it
00093 const BOOL HANDLED_MSG   = TRUE;
00094 const BOOL UNHANDLED_MSG = FALSE;
00095
00096
00097 #define LVM_ERR     (-1)
00098 #define LV_ALLITEMS   (LVM_ERR)
00099 #define LV_ALLSELITEMS  (LV_ALLITEMS-1)
00100
00101 #define IMAGE_NONE    (-1)
00102 #define PARAM_NONE    (-1)
00103 #define STATE_NONE    (-1)
00104
00105
00106 ///////////////////////////////////////////////////////////////
00107 // Defines
00108 //
00109 ///////////////////////////////////////////////////////////////
00110 #define NUMELE(rgEle) (sizeof(rgEle) / sizeof(rgEle[0]))
00111 #define __WIDESTRING(str) L##str
00112 #define WIDESTRING(str) __WIDESTRING(str)
00113
00114 //FindLeaks
00115 #ifdef _IMALLOC_SPY
00116 #define DISP_FILE_LINE  InternalTraceFmt(L"File '%s', Line '%lu'\n", WIDESTRING(__FILE__), __LINE__)
00117 #else
00118 #define DISP_FILE_LINE
00119 #endif //_IMALLOCSPY
00120
00121 #define CHECK_MEMORY(p)       { if(!(p)) { DisplayAllErrors(hr = E_OUTOFMEMORY, WIDESTRING(__FILE__), __LINE__); goto CLEANUP; }      }
00122 #define SAFE_ALLOC(p, type, cb)   { DISP_FILE_LINE; (p) = (type*)CoTaskMemAlloc(ULONG((cb)*sizeof(type))); CHECK_MEMORY(p);         }
00123 #define SAFE_REALLOC(p, type, cb) { DISP_FILE_LINE; (p) = (type*)CoTaskMemRealloc((type*)p, ULONG((cb)*sizeof(type))); CHECK_MEMORY(p);   }
00124 #define SAFE_BSTRALLOC(p, bstr)   { (p) = SysAllocString(bstr); CHECK_MEMORY(p);                                }
00125
00126 #define SAFE_FREE(p)        if(p) { CoTaskMemFree((void*)p); (p) = NULL;  }
00127 #define SAFE_BSTRFREE(p)      if(p) { SysFreeString(p); (p) = NULL;     }
00128
00129 #define SAFE_ADDREF(p)        if(p) { (p)->AddRef();              }
00130 #define SAFE_RELEASE(p)       if(p) { (p)->Release(); (p) = NULL;       }
00131 #define SAFE_DELETE(p)        if(p) { delete p; p = NULL;           }
00132
00133
00134 //Error Checking
00135 #define TEST(hr)          { (hr);                   }
00136 #define TESTC(hr)         { if(FAILED(hr)) goto CLEANUP;        }
00137 #define TESTC_(hr, hrExpected)    { if((hr) != (hrExpected)) goto CLEANUP;  }
00138
00139 //Error Checking
00140 //These Macros are used for calling all OLE DB Methods...
00141 #define XTEST(hr)         { DisplayAllErrors(hr, WIDESTRING(__FILE__), __LINE__);                     }
00142 #define XTEST_(hr, hrExpected)    { DisplayAllErrors(hr, hrExpected, WIDESTRING(__FILE__), __LINE__);               }
00143 #define XTESTC(hr)          { if(FAILED(DisplayAllErrors(hr, WIDESTRING(__FILE__), __LINE__))) goto CLEANUP;        }
00144 #define XTESTC_(hr, hrExpected)   { if(FAILED(DisplayAllErrors(hr, hrExpected, WIDESTRING(__FILE__), __LINE__))) goto CLEANUP;  }
00145
00146 //Windows Error Checking
00147 #define GETLASTERROR(exp)     { if(!(exp)) { DisplayWinError(GetLastError(), WIDESTRING(__FILE__), __LINE__);         } }
00148 #define GETLASTERRORC(exp)      { if(!(exp)) { DisplayWinError(GetLastError(), WIDESTRING(__FILE__), __LINE__)); goto CLEANUP;  } }
00149
00150
00151 ///////////////////////////////////////////////////////////////
00152 // Defines
00153 //
00154 ///////////////////////////////////////////////////////////////
00155 #define MAX_QUERY_LEN     4096
00156 #define MAX_NAME_LEN      256
00157
00158 #define MAX_COL_SIZE        5000
00159 #define MAX_BLOCK_SIZE      2000
00160 #define MAX_OPENROWS       256
00161
00162 //POINTER_DISPLAYSIZE = 0x00000000 = (1 Byte = 2 Asci Chars + "0x" + NULL Terminator)
00163 #define POINTER_DISPLAYSIZE   (sizeof(INT_PTR)*2+2+1)
00164
00165 //Displays values like VALUE as   VALUE , L"VALUE"
00166 #define VALUE_WCHAR(value)    L#value, value
00167 #define VALUE_CHAR(value)   #value, value
00168 #define VALUE_PWCHAR(value)   L#value, &value
00169 #define VALUE_CHAR_HR(hr)   #hr, HRESULT_FROM_WIN32(hr)
00170
00171 #define EOL    '\0'
00172 #define wEOL  L'\0'
00173 #define WndEOL  "\r\n"
00174 #define wWndEOL L"\r\n"
00175
00176
00177 ///////////////////////////////////////////////////////////////////
00178 // Accessor / Binding
00179 //
00180 ///////////////////////////////////////////////////////////////////
00181 // Constant combination of two DBTYPEs
00182 #define DBTYPE_SRC_DST(dbSrc, dbDst) (((dbSrc) << (sizeof(DBTYPE)*8)) + (dbDst))
00183
00184 //STATUS helpers, for locating obStatus offsets in the bindings
00185 #define STATUS_IS_BOUND(Binding)    ( (Binding).dwPart & DBPART_STATUS )
00186 #define BINDING_STATUS(Binding, p) (*(DBSTATUS*)((BYTE*)(p) + (Binding).obStatus))
00187
00188 //LENGTH helpers, for locating obLength offsets in the bindings
00189 #define LENGTH_IS_BOUND(Binding)    ( (Binding).dwPart & DBPART_LENGTH )
00190 #define BINDING_LENGTH(Binding, p) (*(DBLENGTH*)((BYTE*)(p) + (Binding).obLength))
00191
00192 //VALUE helpers, for locating obValue offsets in the bindings
00193 #define VALUE_IS_BOUND(Binding)     ( (Binding).dwPart & DBPART_VALUE )
00194 #define BINDING_VALUE(Binding, p)  (*(void**)((BYTE*)(p) + (Binding).obValue ))
00195
00196 //ROUNDUP on all platforms pointers must be aligned properly
00197 #define ROUNDUP_AMOUNT  8
00198 #define ROUNDUP_(size,amount)   (((ULONG)(size)+((amount)-1))&~((amount)-1))
00199 #define ROUNDUP(size)       ROUNDUP_(size, ROUNDUP_AMOUNT)
00200
00201 #define BIT_SET(dwValue, dwMask)        (((dwValue) & (dwMask)) == (dwMask))  //All bits set
00202 #define BIT_CLEAR(dwValue, dwMask)        (!((dwValue) & (dwMask)))       //All bits clear
00203 #define ENABLE_BIT(dwValue, dwMask, fEnable)  ((fEnable) ? (dwValue) |= (dwMask) : (dwValue) &= ~(dwMask))
00204 #define IS_EVEN(dwValue)            (((dwValue) & 1) == 0)
00205 #define ABS(value)                ((value) >= 0 ? (value) : -(value))
00206
00207 HRESULT FreeBindings(DBCOUNTITEM* pcBindings, DBBINDING** prgBindings);
00208 HRESULT CopyBinding(DBBINDING* pDest, DBBINDING* pSource);
00209
00210 HRESULT FreeData(DBTYPE wType, DBLENGTH cData, void* rgData);
00211 HRESULT FreeBindingData(DBCOUNTITEM cBindings, const DBBINDING* rgBindings, void* pData, BOOL fSetData = FALSE);
00212 HRESULT FreeColAccess(ULONG* pcColAccess, DBCOLUMNACCESS** prgColAccess, void** ppData);
00213 HRESULT FreeConstraintDesc(DBORDINAL *pcConsDesc, DBCONSTRAINTDESC **prgConsDesc, BOOL fFree = TRUE);
00214
00215
00216 ////////////////////////////////////////////////////////////////////////////
00217 // Window functions
00218 //
00219 ////////////////////////////////////////////////////////////////////////////
00220 BOOL  IsUnicodeOS();
00221
00222
00223 ////////////////////////////////////////////////////////////////////////////
00224 // DBTYPE functions
00225 //
00226 ////////////////////////////////////////////////////////////////////////////
00227 BOOL IsFixedType(DBTYPE wType);
00228 BOOL IsVariableType(DBTYPE wType);
00229 BOOL IsNumericType(DBTYPE wType);
00230
00231 WCHAR*      GetDBTypeName(DBTYPE wType);
00232 DBTYPE      GetDBType(WCHAR* pwszName);
00233 HRESULT     GetDBTypeMaxSize(DBTYPE wType, DBLENGTH* pulMaxSize = NULL, BYTE* pbPrecision = NULL, BYTE* pbScale = NULL);
00234
00235 WCHAR*      GetVariantTypeName(DBTYPE wType);
00236 DBTYPE      GetVariantType(WCHAR* pwszName);
00237
00238 WCHAR*      GetColName(const DBCOLUMNINFO* pColInfo);
00239 DBLENGTH    GetMaxDisplaySize(DBTYPE wBindingType, DBTYPE wBackendType, DBLENGTH ulColumnSize, DBLENGTH ulMaxVarSize);
00240
00241
00242
00243
00244
00245 ////////////////////////////////////////////////////////////////////////////
00246 // OLE DB General Helper functions
00247 //
00248 ////////////////////////////////////////////////////////////////////////////
00249 INT     ConvertToMBCS(LPCWSTR pwsz, CHAR* psz, INT chDst);
00250 INT     ConvertToMBCS(LPCWSTR pwsz, INT cchSrc, CHAR* psz, INT cchDst);
00251 INT     ConvertToWCHAR(LPCSTR psz, WCHAR* pwsz, INT cbDst);
00252 INT     ConvertToWCHAR(LPCSTR psz, INT cchSrc, WCHAR* pwsz, INT ccbDst);
00253
00254 CHAR*   ConvertToMBCS(LPCWSTR pwsz);
00255 WCHAR*    ConvertToWCHAR(LPCSTR psz);
00256 CHAR*   strDuplicate(LPCSTR psz);
00257 WCHAR*    wcsDuplicate(LPCWSTR pwsz);
00258
00259 WCHAR*    StackFormat(LPCWSTR pwszFmt, ...);
00260 WCHAR*    StringFormat(WCHAR* pwszDest, DBLENGTH ulStrLen, LPCWSTR pwszFmt, ...);
00261 WCHAR*    StringCopy(WCHAR* pwszDest, LPCWSTR pwszSource, DBLENGTH cMaxLen);
00262 CHAR*   StringCopy(CHAR* pszDest, LPCSTR pszSource, DBLENGTH cMaxLen);
00263 BOOL    StringCompare(LPCWSTR pwsz1, LPCWSTR pwsz2);
00264 BOOL    StringCompareI(LPCWSTR pwsz1, LPCWSTR pwsz2);
00265
00266 WCHAR*    GetProgID(REFCLSID clsid);
00267 HRESULT   CLSIDFromStringEx(WCHAR* pwszString, CLSID* pCLSID);
00268 HRESULT   CLSIDFromProgIDEx(WCHAR* pwszString, CLSID* pCLSID);
00269 LONG    RunSysCommand(WCHAR* pwszCommand);
00270 HINSTANCE LoadDll(WCHAR* pwszDll);
00271
00272 HRESULT   DBIDToString(const DBID* pDBID, WCHAR* pwsz, ULONG ulMaxLen);
00273 void    DBIDFree(DBID* pDBID);
00274 HRESULT   DBIDCopy(DBID* pDst, const DBID* pSrc);
00275 BOOL    DBIDEqual(const DBID* pDst, const DBID* pSrc);
00276
00277 HRESULT   PostProcessString(WCHAR* pwsz, DBLENGTH ulMaxSize, DWORD dwFlags);
00278
00279 //Conversions
00280 HRESULT DataConvert
00281 (
00282   DBSTATUS     dbSrcStatus,   // @parm IN | source data status
00283   DBLENGTH     cbSrcLength,   // @parm IN | size of source data
00284   DBLENGTH     cbSrcMaxLength,  // @parm IN | max size of input buffer
00285   DBTYPE       wSrcType,      // @parm IN | type of source data
00286   void*      pSrcValue,     // @parm IN | ptr to source data
00287   BYTE       bPrecision,    // @parm IN | precision to use for dst
00288   BYTE       bScale,      // @parm IN | scale to use for dst
00289
00290   DBTYPE       wDstType,      // @parm IN | type of output data
00291   DBSTATUS*    pdbDstStatus,    // @parm OUT | ptr to output data status
00292   DBLENGTH*    pcbDstLength,    // @parm OUT | ptr to size of output data
00293   void*      pDstValue,     // @parm OUT | ptr to output data
00294   DBLENGTH     cbDstMaxLength,  // @parm IN | max size of output buffer
00295   DWORD      dwConvFlags    // @parm IN | Conversion flags
00296 );
00297
00298
00299
00300 ///////////////////////////////////////////////////////////////
00301 // CVariant
00302 //
00303 ///////////////////////////////////////////////////////////////
00304 class CVariant : public tagVARIANT
00305 {
00306 public:
00307   //constructors
00308   CVariant();
00309   ~CVariant();
00310
00311   HRESULT Init();
00312   HRESULT Clear();
00313   HRESULT Attach(VARIANT* pSrc);
00314   HRESULT Detach(VARIANT* pDest);
00315
00316   HRESULT Copy(VARIANT* pSrc);
00317   HRESULT ChangeType(VARTYPE vt, VARIANT* pSrc = NULL);
00318
00319 protected:
00320 };
00321
00322
00323 HRESULT   VariantInitFast(VARIANT* pVariant);
00324 HRESULT   VariantCopyFast(VARIANT* pVarDest, VARIANT* pVarSrc);
00325 HRESULT   VariantClearFast(VARIANT* pVariant);
00326 HRESULT   VariantChangeFast(VARIANT* pVarDest, VARIANT* pVarSrc, LCID lcid, USHORT wFlags, VARTYPE vt);
00327
00328 HRESULT   VariantToString(VARIANT* pVariant, WCHAR* pwsz, DBLENGTH ulMaxSize, DWORD dwFlags);
00329 HRESULT   StringToVariant(WCHAR* pwsz, VARTYPE vt, VARIANT* pVariant, DWORD dwFlags = CONV_ALPHABOOL | CONV_VARBOOL);
00330
00331 HRESULT   SafeArrayToString(SAFEARRAY* pSafeArray, DBTYPE wType, WCHAR* pwsz, DBLENGTH ulMaxSize);
00332 HRESULT   StringToSafeArray(WCHAR* pwsz, DBTYPE wType, SAFEARRAY** ppSafeArray);
00333
00334 HRESULT   StringToVector(WCHAR* pwszBuffer, DBTYPE wType, DBVECTOR* pVector);
00335 HRESULT   VectorToString(DBVECTOR* pVector, DBTYPE wType, WCHAR* pwszBuffer, DBLENGTH ulMaxSize);
00336
00337
00338
00339 ////////////////////////////////////////////////////////////////////////////
00340 // Windows functions
00341 //
00342 ////////////////////////////////////////////////////////////////////////////
00343 void*   SetThis(HWND hWnd, void* pThis);
00344 void*   GetThis(HWND hWnd);
00345
00346 INT     wMessageBox(HWND hDlg, UINT uiStyle, WCHAR* pwszTitle, WCHAR* pwszFmt, ...);
00347 LRESULT   wSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, WCHAR* pwszText);
00348 LRESULT   wSendMessageFmt(HWND hWnd, UINT Msg, WPARAM wParam, WCHAR* pwszFmt, ...);
00349 WCHAR*    wGetWindowText(HWND hWnd);
00350
00351 BOOL    CenterDialog(HWND hDlg);
00352 BOOL    MoveWindow(HWND hWnd, ULONG x, ULONG y);
00353 SIZE    GetClientSize(HWND hWnd);
00354 SIZE    GetWindowSize(HWND hWnd);
00355 BOOL    GetWindowPos(HWND hWnd, POINTS* pPTS);
00356 RECT    GetClientCoords(HWND hWndParent, HWND hWnd);
00357 void    SyncSibling(HWND hwndLstChg,HWND hwndLstSrc);
00358 INT_PTR   WINAPI SynchSubProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00359
00360 BOOL    ConvertToLONG(LPCWSTR pwszText, LONG* plValue, LONG lMin = LONG_MIN, LONG lMax = LONG_MAX, INT iBase = 10);
00361 BOOL    GetEditBoxValue(HWND hEditWnd, LONG* plValue, LONG lMin = LONG_MIN, LONG lMax = LONG_MAX, BOOL fAllowEmpty = FALSE);
00362 ULONG_PTR GetMenuData(HMENU hMenu, UINT uItem, BOOL fByPosition);
00363 BOOL    SetMenuData(HMENU hMenu, UINT uItem, BOOL fByPosition, ULONG_PTR dwItemData);
00364 BOOL    SetSubMenuData(HMENU hMenu, UINT uItem, BOOL fByPosition, ULONG_PTR dwItemData);
00365
00366 HRESULT   BrowseOpenFileName(HINSTANCE hInstance, HWND hWnd, WCHAR* pwszTitle, WCHAR* pwszFileName, ULONG ulMaxSize, WCHAR* pwszExtension = NULL, WCHAR* pwszFilter = L"All Files (*.*)\0*.*\0\0", DWORD* pdwFileOffset = NULL, DWORD dwFlags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_SHAREAWARE);
00367 HRESULT   BrowseSaveFileName(HINSTANCE hInstance, HWND hWnd, WCHAR* pwszTitle, WCHAR* pwszFileName, ULONG ulMaxSize, WCHAR* pwszExtension = NULL, WCHAR* pwszFilter = L"All Files (*.*)\0*.*\0\0", DWORD* pdwFileOffset = NULL, DWORD dwFlags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_SHAREAWARE | OFN_CREATEPROMPT);
00368
00369 HRESULT   CreateDefFileName(LPCWSTR pwszFileName, WCHAR* pwszFullPath, ULONG ulMaxSize, BOOL fCurrentDir = TRUE);
00370
00371
00372 ///////////////////////////////////////////////////////////////
00373 // Registry
00374 //
00375 ///////////////////////////////////////////////////////////////
00376 HRESULT   CreateRegKey(HKEY hRootKey, WCHAR* pwszKeyName, HKEY* phKey, REGSAM samDesired = KEY_READ | KEY_WRITE);
00377 HRESULT   OpenRegKey(HKEY hRootKey, WCHAR* pwszKeyName, DWORD ulOptions, REGSAM samDesired, HKEY* phKey);
00378
00379 HRESULT   GetRegEnumKey(HKEY hRootKey, WCHAR* pwszKeyName, DWORD dwIndex, WCHAR* pwszSubKeyName, ULONG cBytes);
00380 HRESULT   GetRegEnumValue(HKEY hRootKey, WCHAR* pwszKeyName, DWORD dwIndex, WCHAR** ppwszValueName);
00381 HRESULT   GetRegEnumValue(HKEY hRootKey, WCHAR* pwszKeyName, DWORD dwIndex, WCHAR* pwszValueName, ULONG* pcBytes);
00382
00383 HRESULT   GetRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, WCHAR* pwszValueName, WCHAR* pwszValue, ULONG cBytes);
00384 HRESULT   GetRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, WCHAR* pwszValueName, WCHAR** ppwszValue);
00385 HRESULT   GetRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, WCHAR* pwszValueName, ULONG* pulValue);
00386 HRESULT   GetRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, WCHAR* pwszValueName, void* pStruct, ULONG cbSize, ULONG* pcbActualSize, ULONG dwType = REG_BINARY);
00387
00388 HRESULT   SetRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, WCHAR* pwszValueName, WCHAR* pwszValue);
00389 HRESULT   SetRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, WCHAR* pwszValueName, ULONG ulValue);
00390 HRESULT   SetRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, WCHAR* pwszValueName, void* pStruct, ULONG cbSize, ULONG dwType = REG_BINARY);
00391
00392 HRESULT   DelRegEntry(HKEY hRootKey, WCHAR* pwszKeyName);
00393 HRESULT   DelRegEntry(HKEY hRootKey, WCHAR* pwszKeyName, BOOL fSubKeys);
00394
00395 HRESULT   CloseRegKey(HKEY hKey);
00396
00397
00398 /////////////////////////////////////////////////////////////////////
00399 // Memory debugging code
00400 //
00401 /////////////////////////////////////////////////////////////////////
00402 void InternalTrace(LPCWSTR pwszText);
00403 void InternalTraceFmt(LPCWSTR pwszFmt, ...);
00404
00405 #define ASSERT(exp)   _ASSERTE(exp)
00406 #define ASSERTC(exp)  { if(!(exp)) { ASSERT(!#exp); goto CLEANUP;   } }
00407
00408
00409 #ifdef _DEBUG
00410 #define TRACE     InternalTrace
00411 #define TRACEFMT    InternalTraceFmt
00412 #else  //_DEBUG
00413 #define TRACE     if(0) InternalTrace
00414 #define TRACEFMT    if(0) InternalTraceFmt
00415 #endif //_DEBUG
00416
00417 //DebugBreak
00418 //NOTE:  We define this ourselves, instead of just using _CrtDebugBreak, since
00419 //we want this feature to be available for both debug and retail builds...
00420 #ifdef _M_IX86
00421 #define BREAKINTO() __asm { int 3 }
00422 #else
00423 #define BREAKINTO() DebugBreak()
00424 #endif //_M_IX86
00425
00426
00427
00428 ///////////////////////////////////////////////////////////////
00429 // Static Strings Messages
00430 //
00431 ///////////////////////////////////////////////////////////////
00432
00433 //General Status
00434 extern WCHAR wsz_SUCCESS[];
00435 extern WCHAR wsz_WARNING[];
00436 extern WCHAR wsz_INFO[];
00437
00438 extern WCHAR wsz_ERROR[];
00439 extern WCHAR wsz_EXCEPTION[];
00440 extern WCHAR wsz_ERRORINFO[];
00441
00442 //General String Values
00443 extern WCHAR wsz_INVALID_VALUE_[];
00444
00445
00446 #endif //_COMMON_H_
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/globals.h Source File

  • SysMgmt
  • MMC
  • ActiveX

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025         #define IDM_BUTTON1    0x100
00026         #define IDM_BUTTON2    0x101
00027
00028         extern HINSTANCE g_hinst;
00029         extern ULONG g_uObjects;
00030
00031         #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032         #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034         // uncomment the following #define to enable message cracking
00035         // #define MMC_CRACK_MESSAGES
00036         void MMCN_Crack(BOOL bComponentData,
00037                                         IDataObject *pDataObject,
00038                                         IComponentData *pCompData,
00039                                         IComponent *pComp,
00040                                         MMC_NOTIFY_TYPE event,
00041                                         LPARAM arg,
00042                                         LPARAM param);
00043 #endif
00044
00045 //=--------------------------------------------------------------------------=
00046 // allocates a temporary buffer that will disappear when it goes out of scope
00047 // NOTE: be careful of that -- make sure you use the string in the same or
00048 // nested scope in which you created this buffer. people should not use this
00049 // class directly.  use the macro(s) below.
00050 //
00051 class TempBuffer {
00052   public:
00053     TempBuffer(ULONG cBytes) {
00054         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00055         m_fHeapAlloc = (cBytes > 120);
00056     }
00057     ~TempBuffer() {
00058         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00059     }
00060     void *GetBuffer() {
00061         return m_pBuf;
00062     }
00063
00064   private:
00065     void *m_pBuf;
00066     // we'll use this temp buffer for small cases.
00067     //
00068     char  m_szTmpBuf[120];
00069     unsigned m_fHeapAlloc:1;
00070 };
00071
00072 //=--------------------------------------------------------------------------=
00073 // string helpers.
00074 //
00075 // given a _TCHAR, copy it into a wide buffer.
00076 // be careful about scoping when using this macro!
00077 //
00078 // how to use the below two macros:
00079 //
00080 //  ...
00081 //  LPTSTR pszT;
00082 //  pszT = MyGetTStringRoutine();
00083 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00084 //  MyUseWideStringRoutine(pwsz);
00085 //  ...
00086 #ifdef UNICODE
00087 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00088     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00089     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00090     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00091     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00092 #else // ANSI
00093 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00094     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00095     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00096     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00097     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00098     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00099 #endif
00100
00101 #ifdef UNICODE
00102 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00103     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00104     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00105     lstrcpyW((LPWSTR)ptrname, tstr)
00106 #else // ANSI
00107 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00108     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00109     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00110     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00111     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00112 #endif
00113
00114 //
00115 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00116 // have to be declared, and no clean up must be done.
00117 //
00118 // * 2 for DBCS handling in below length computation
00119 //
00120 #ifdef UNICODE
00121 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00122     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00123     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00124     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00125     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00126 #else // ANSI
00127 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00128     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00129     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00130     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00131     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00132 #endif
00133
00134 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/staticnode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

staticnode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CStaticNode class.
00014 //
00015
00016 #include "StaticNode.h"
00017 #include "DeviceNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "AddDeviceDlg.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CStaticNode")
00026
00027
00028 // Initialize our static GUID just once.  We use the GUID for
00029 // CComponentData because this node handles events for the
00030 // Snap-in's namespace
00031 GUID CStaticNode::thisGUID = CLSID_CComponentData;
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Construction/Destruction
00036
00037 //---------------------------------------------------------------------------
00038 CStaticNode::CStaticNode()
00039 {
00040   m_SDI.mask        = DEFAULT_SDI_MASK;
00041   m_SDI.displayname = MMC_CALLBACK;
00042   m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00043   m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00044   m_SDI.cChildren   = 1;              // Determines if the '+' is displayed
00045   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00046
00047   m_hStaticNode     = NULL;
00048   m_pCompData       = NULL;
00049   m_hAddDeviceDlg   = NULL;
00050 }
00051
00052 //---------------------------------------------------------------------------
00053 CStaticNode::~CStaticNode()
00054 {
00055   if( NULL != m_hMessageWnd )
00056     DestroyWindow( m_hMessageWnd );
00057 }
00058
00059 //---------------------------------------------------------------------------
00060 HRESULT CStaticNode::Initialize( NODE_PROPERTIES* pNodeProps )
00061 {
00062   _ASSERT( NULL != pNodeProps );
00063   _ASSERT( NULL != pNodeProps->pComponentData );
00064
00065   HRESULT hResult = S_FALSE;
00066
00067   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00068   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00069   wcscpy( pszTmp, pNodeProps->szNodeName );
00070   if( NULL != m_pwszNodeName )
00071     CoTaskMemFree( m_pwszNodeName );
00072
00073   m_pwszNodeName = pszTmp;
00074   m_pCompData = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00075
00076   hResult = RefreshNodeList();         // Initialize scope nodes
00077
00078   // We create a hidden window to allow us to communicate with modeless
00079   // dialogs and other things which run in a seperate thread.
00080
00081   WNDCLASS wc;
00082   ZeroMemory (&wc, sizeof(WNDCLASS));
00083   wc.cbWndExtra    = sizeof(this);
00084   wc.lpfnWndProc   = StaticNodeWndProc;
00085   wc.hInstance     = g_hInst;
00086   wc.lpszClassName = _T("StaticNodeMessageWindow");
00087
00088   RegisterClass( &wc );
00089   m_hMessageWnd = CreateWindow( _T("StaticNodeMessageWindow"), NULL,
00090                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00091
00092   if( NULL == m_hMessageWnd )
00093     hResult = S_FALSE;
00094
00095   return hResult;
00096 }
00097
00098
00099 //---------------------------------------------------------------------------
00100 //  This is our hidden window which is just used for handling messages.  We
00101 //  go to all this trouble so that we don't ever pass interface pointers or
00102 //  other objects across threads.
00103 //
00104 LRESULT CALLBACK CStaticNode::StaticNodeWndProc
00105 (
00106   HWND   hWnd,     //[in] Handle to window
00107   UINT   uMsg,     //[in] Message identifier
00108   WPARAM wParam,   //[in] First message parameter
00109   LPARAM lParam    //[in] Second message parameter
00110 )
00111 {
00112   switch( uMsg )
00113   {
00114     // Since we registered the WndClass in Initialize, our WndProc will be
00115     // called with WM_CREATE right away.  Store our 'hWnd' pointer in the
00116     // CREATESTRUCT so we can retreive it later to get back to the specific
00117     // instance of CComponentData
00118     //
00119     case WM_CREATE:
00120     {
00121       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00122       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00123       break;
00124     }
00125
00126     // This is our custom message which could have been sent from a worker
00127     // thread, or in this case a modeless dialog.  We retrieve our 'this'
00128     // pointer from the WndClass and cast it to a CComponentData pointer.
00129     // WPARAM is cast to a NODE_PROPERTIES struct which can be used to
00130     // call AddDeviceNode()
00131     //
00132     case WM_ADD_DEVICENODE:
00133     {
00134       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00135       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00136       pThisNode->AddDeviceNode( pProps );
00137       break;
00138     }
00139
00140     // This message is sent by the AddDeviceDlg to let us know it's
00141     // being terminated.  Set our member handle to NULL so the item
00142     // will be show on the context menu
00143     //
00144     case WM_DEVICENODE_CLOSED:
00145     {
00146       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00147       pThisNode->m_hAddDeviceDlg = NULL;
00148       break;
00149     }
00150     default:
00151       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00152   }
00153   return 0;
00154 }
00155
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Implementation of virtual methods
00159
00160
00161 //---------------------------------------------------------------------------
00162 //  The minimum implementation of this method is to return the
00163 //  Persistable View Description string.  This string must be allocated
00164 //  with CoTaskMemAlloc.  The console will free the string.
00165 //
00166 HRESULT CStaticNode::GetResultViewType2
00167 (
00168   MMC_COOKIE             nCookie,  //[in] Identifier of object
00169   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00170 )
00171 {
00172   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+1 );
00173   if( NULL == pszDescStr )
00174     return E_OUTOFMEMORY;
00175
00176   wcscpy( pszDescStr, L"DefaultListView" );
00177   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00178
00179   return S_OK;
00180 }
00181
00182 //---------------------------------------------------------------------------
00183 HRESULT CStaticNode::GetDisplayInfo
00184 (
00185   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00186 )
00187 {
00188   _ASSERT( NULL != pSDI );
00189   pSDI->displayname = m_pwszNodeName;
00190
00191   return S_OK;
00192 }
00193
00194 //---------------------------------------------------------------------------
00195 HRESULT CStaticNode::GetDisplayInfo
00196 (
00197   RESULTDATAITEM* pRDI
00198 )
00199 {
00200   // This method will not get called since the static node is never
00201   // displayed in the result pane
00202   return S_FALSE;
00203 }
00204
00205 /////////////////////////////////////////////////////////////////////////////
00206 // Implementation of notification handlers
00207
00208 //---------------------------------------------------------------------------
00209 HRESULT CStaticNode::OnShow
00210 (
00211   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00212   LONG          nArg,          //[in] TRUE if node was selcted
00213   LONG          nParam,        //[in] HSCOPEITEM of selected/deselected item
00214   LONG_PTR      pComponent     //[in] Points to calling IComponent
00215 )
00216 {
00217   HRESULT  hResult = S_FALSE;
00218
00219   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00220
00221   LPHEADERCTRL2  ipHeaderCtrl2 = NULL;
00222   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL2, (LONG_PTR*)&ipHeaderCtrl2 );
00223   if( S_OK != hResult )
00224    return hResult;
00225
00226   LPRESULTDATA  ipResultData = NULL;
00227   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00228   if( S_OK != hResult )
00229    return hResult;
00230
00231   ipHeaderCtrl2->AddRef();
00232   ipResultData->AddRef();
00233
00234   if( TRUE == nArg )  // Selecting a scope node
00235   {
00236     do
00237     {
00238       hResult = ipHeaderCtrl2->InsertColumn( 0, L"Device Name", 0, 150 );
00239       BREAK_ON_ERROR( hResult );
00240
00241       hResult = ipHeaderCtrl2->InsertColumn( 1, L"Status", 0, 150 );
00242       BREAK_ON_ERROR( hResult );
00243
00244       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00245       BREAK_ON_ERROR( hResult );
00246
00247     }while(0);
00248   }
00249   else // not handling deselect notifications
00250   {
00251   }
00252
00253   ipHeaderCtrl2->Release();
00254   ipResultData->Release();
00255
00256   TRACE_HRESULT(_T("OnShow"), hResult );
00257   return hResult;
00258 }
00259
00260
00261 //---------------------------------------------------------------------------
00262 HRESULT CStaticNode::OnSelect
00263 (
00264   LPDATAOBJECT   ipDataObject,   //[in] Points to the selected data object
00265   LONG           nArg,           //[in] Status of selected item
00266   LONG           nParam,         //[in] Not used
00267   LONG_PTR       pComponent      //[in] Pointer to parent CComponent
00268 )
00269 {
00270   BOOL    fScopePane = LOWORD(nArg);
00271   BOOL    fSelected  = HIWORD(nArg);
00272   HRESULT hResult    = S_FALSE;
00273
00274   if( NULL == ipDataObject )           // Can get this when closing the SnapIn
00275     return hResult;
00276
00277   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00278   LPCONSOLEVERB  ipConsoleVerb = NULL;
00279   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00280   if( S_OK != hResult )
00281     return hResult;
00282
00283   ipConsoleVerb->AddRef();
00284
00285   if( TRUE == fScopePane && TRUE == fSelected )
00286   {
00287     // This is where we will set verbs in later versions
00288   }
00289
00290   ipConsoleVerb->Release();
00291
00292   TRACE_HRESULT(_T("OnSelect"), hResult );
00293   return hResult;
00294
00295 }
00296
00297 //---------------------------------------------------------------------------
00298 //  The static node is a special case.  The CComponentData pointer is also
00299 //  our parent so we don't need to use the pCompData parameter
00300 //
00301 HRESULT CStaticNode::OnExpand
00302 (
00303   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00304   LONG           nArg,         //[in] TRUE if node was selcted
00305   LONG           nParam,       //[in] HSCOPEITEM of selected/deselected item
00306   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00307 )
00308 {
00309   HRESULT hResult = S_FALSE;
00310
00311   if( NULL == m_hStaticNode )          // Cache the root node handle
00312     m_hStaticNode = (HSCOPEITEM)nParam;
00313
00314   if( NULL == m_pCompData )
00315     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00316
00317   // Request an IConsoleNameSpace2 pointer from CComponentData
00318   // The static node is a unique case since it's parent is also IComponentData
00319   //
00320   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00321   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00322   if( S_OK != hResult )
00323     return hResult;
00324
00325   ipCNS2->AddRef();
00326
00327   hResult = DeleteScopeItems( ipCNS2 );
00328   hResult = InsertScopeItems( ipCNS2 );
00329
00330   ipCNS2->Release();
00331   return hResult;
00332 }
00333
00334
00335 //---------------------------------------------------------------------------
00336 HRESULT CStaticNode::OnRemoveChildren
00337 (
00338   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00339   LONG           nArg,         //[in] TRUE if node was selcted
00340   LONG           nParam,       //[in] HSCOPEITEM of selected/deselected item
00341   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00342 )
00343 {
00344   HRESULT hResult = S_FALSE;
00345
00346   if( NULL == m_pCompData )
00347     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00348
00349   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00350   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00351   if( S_OK != hResult )
00352     return hResult;
00353
00354   ipCNS2->AddRef();
00355   hResult = DeleteScopeItems( ipCNS2 );
00356
00357   POSITION   Pos   = m_NodeList.GetHeadPosition();
00358   LPBASENODE pNode = NULL;
00359   while( Pos )                         // Delete everything...
00360   {
00361     pNode = m_NodeList.GetNext( Pos );
00362     pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00363     delete pNode;
00364   }
00365
00366   m_NodeList.RemoveAll();              // Cleanup the list
00367   ipCNS2->Release();
00368
00369   TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00370   return hResult;
00371 }
00372
00373
00374 /////////////////////////////////////////////////////////////////////////////
00375 // Private helper methods
00376
00377
00378 //---------------------------------------------------------------------------
00379 //  Initializes the node list.
00380 //
00381 HRESULT CStaticNode::RefreshNodeList()
00382 {
00383   NODE_PROPERTIES NodeProps;
00384   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00385
00386   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00387   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00388
00389   WCHAR  szNames[2][32];
00390   wcscpy( szNames[0], L"RamDisk 0" );
00391   wcscpy( szNames[1], L"Archive 0" );
00392
00393   RemoveNodes();                       // Clean the node list
00394
00395   CDeviceNode* pNode = NULL;
00396   for( DWORD i = 0; i < 2; i++ )
00397   {
00398     wcscpy( NodeProps.szNodeName, szNames[i] );
00399     pNode = new CDeviceNode;
00400     pNode->Initialize( &NodeProps );
00401     m_NodeList.AddTail( pNode );
00402
00403     // Kind of a hack, make the second device a backup device
00404     NodeProps.dwAttributes |= ATTRIBUTE_BACKUP_DEVICE;
00405   }
00406
00407   return S_OK;
00408 }
00409
00410
00411 //---------------------------------------------------------------------------
00412 //  For these first level nodes the parent is always the static or root
00413 //  node.
00414 //
00415 HRESULT CStaticNode::InsertScopeItems
00416 (
00417   LPCONSOLENAMESPACE2 ipCNS2   //[in] Needed to insert items
00418 )
00419 {
00420   _ASSERT( NULL != ipCNS2 );
00421   _ASSERT( NULL != m_hStaticNode );
00422
00423   HRESULT      hResult = S_FALSE;
00424   POSITION     Pos     = m_NodeList.GetHeadPosition();
00425   CDeviceNode* pNode   = NULL;
00426
00427   while( Pos )
00428   {
00429     pNode   = m_NodeList.GetNext( Pos );
00430     pNode->m_SDI.relativeID = m_hStaticNode;
00431     hResult = ipCNS2->InsertItem( &pNode->m_SDI );
00432   }
00433
00434   return hResult;
00435 }
00436
00437
00438 //---------------------------------------------------------------------------
00439 //  Delete the HSCOPEITEMS only, we leave the list of nodes untouched
00440 //
00441 HRESULT CStaticNode::DeleteScopeItems
00442 (
00443   LPCONSOLENAMESPACE2 ipCNS2   //[in] Needed to delete items
00444 )
00445 {
00446   _ASSERT( NULL != ipCNS2 );
00447
00448   POSITION    Pos     = m_NodeList.GetHeadPosition();
00449   HSCOPEITEM  hItem   = NULL;
00450   LPBASENODE  pNode   = NULL;
00451   HRESULT     hResult = S_FALSE;
00452
00453   while( Pos )                         // Delete everything...
00454   {
00455     pNode = m_NodeList.GetNext( Pos );
00456     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00457     if( 0 != hItem )
00458       hResult = ipCNS2->DeleteItem( hItem, TRUE );
00459   }
00460
00461   return hResult;
00462
00463 }
00464
00465 //---------------------------------------------------------------------------
00466 //  We do this instead of just calling RemoveAll() because our list contains
00467 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00468 //  the derived class object.
00469 //
00470 VOID CStaticNode::RemoveNodes()
00471 {
00472   LPBASENODE pNode = NULL;
00473   POSITION   Pos   = m_NodeList.GetHeadPosition();
00474   while( Pos )
00475   {
00476     pNode = m_NodeList.GetNext( Pos );
00477     delete pNode;
00478   }
00479   m_NodeList.RemoveAll();              // Clean the list
00480 }
00481
00482 //---------------------------------------------------------------------------
00483 HRESULT CStaticNode::AddDeviceNode
00484 (
00485   NODE_PROPERTIES*    pProps   //[in] Properties for the new node
00486 )
00487 {
00488   _ASSERT( NULL != pProps );
00489
00490   CDeviceNode* pNode   = NULL;
00491   HRESULT      hResult = S_FALSE;
00492
00493   // In this case we always have the same parent
00494   pProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00495   pProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00496
00497   pNode = new CDeviceNode;         // Create and initialize the new
00498   pNode->Initialize( pProps );     // node, then add to our linked
00499   m_NodeList.AddTail( pNode );     // list, then insert the node
00500
00501   pNode->m_SDI.relativeID = m_hStaticNode;
00502
00503   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00504   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG*)&ipCNS2 );
00505   if( S_OK != hResult )
00506     return hResult;
00507
00508   hResult = ipCNS2->InsertItem( &pNode->m_SDI );
00509
00510   return hResult;
00511 }
00512
00513 //---------------------------------------------------------------------------
00514 //  Get the selected node and call it's ToggleStatus method
00515 //
00516 VOID CStaticNode::ToggleStatus
00517 (
00518   LPDATAOBJECT ipDataObject
00519 )
00520 {
00521   CDeviceNode* pNode = (CDeviceNode*)ExtractBaseNodePtr( ipDataObject );
00522   if( NULL != pNode )
00523     pNode->ToggleStatus();
00524
00525 }
00526
00527
00528 /////////////////////////////////////////////////////////////////////////////
00529 //  Support for Context Menus
00530
00531 //---------------------------------------------------------------------------
00532 //  NOTE:  Don't AddRef ipCallback.  Check docs.
00533 //
00534 HRESULT CStaticNode::AddMenuItems
00535 (
00536   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00537   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00538 )
00539 {
00540   _ASSERT( NULL != ipCallback );
00541   HRESULT hResult = S_FALSE;
00542
00543   static CONTEXTMENUITEM ctxMenu;
00544     ctxMenu.lCommandID        = IDM_NEW_DEVICE;
00545     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00546     ctxMenu.fSpecialFlags     = 0;
00547     ctxMenu.strName           = L"New Device...";
00548     ctxMenu.strStatusBarText  = L"Add a new device";
00549
00550
00551   if( NULL == m_hAddDeviceDlg )    // If the AddDevice dialog is running
00552     ctxMenu.fFlags = 0;            // gray the menu selection
00553   else
00554     ctxMenu.fFlags = MF_GRAYED;
00555
00556
00557   // Add the 'New Device' option to the New menu if allowed...
00558   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00559   {
00560     hResult = ipCallback->AddItem( &ctxMenu );
00561   }
00562
00563   return hResult;
00564 }
00565
00566
00567 //---------------------------------------------------------------------------
00568 HRESULT CStaticNode::Command
00569 (
00570   long lCommandID          //[in] Indentifier for menu ID
00571 )
00572 {
00573   HRESULT hResult = S_OK;
00574
00575   switch( lCommandID )
00576   {
00577     case IDM_NEW_DEVICE:
00578     {
00579       CAddDeviceDlg* pDlg = new CAddDeviceDlg( IDD_ADDDEVICE_DLG, m_hMessageWnd );
00580       m_hAddDeviceDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00581       break;
00582     }
00583     default:
00584     {
00585       hResult = S_FALSE;
00586       break;
00587     }
00588   }
00589   return hResult;
00590 }
00591
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletProtocolEntity Member List

This is the complete list of members for tagAppletProtocolEntity, including all inherited members.
apExpectedCapabilities | tagAppletProtocolEntity
cExpectedCapabilities | tagAppletProtocolEntity
eStartupChannelType | tagAppletProtocolEntity
fMustBeInvoked | tagAppletProtocolEntity
SessionKey | tagAppletProtocolEntity
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ActiveDirectory/PropSheetHost/PropSheetHost.cpp Source File

  • NetDS
  • ActiveDirectory
  • PropSheetHost

PropSheetHost.cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002 //    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003 //    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 //    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 //    PARTICULAR PURPOSE.
00006 //
00007 //    Copyright Microsoft Corporation. All Rights Reserved.
00008 //***************************************************************************
00009
00010 //***************************************************************************
00011 //
00012 //    File:          PropSheetHost.cpp
00013 //
00014 //    Description:
00015 //
00016 //***************************************************************************
00017
00018 //***************************************************************************
00019 //    #include statements
00020 //***************************************************************************
00021
00022 #include "stdafx.h"
00023
00024 /***************************************************************************
00025
00026     CPropSheetHost::CPropSheetHost()
00027
00028 ***************************************************************************/
00029
00030 CPropSheetHost::CPropSheetHost(HINSTANCE hInstance,
00031                                HWND hwndParent)
00032 {
00033     m_hInst = hInstance;
00034     m_hwndParent = hwndParent;
00035     m_hwndHidden = NULL;
00036     m_ObjRefCount = 0;
00037
00038     m_cfDSPropSheetConfig = RegisterClipboardFormat(CFSTR_DS_PROPSHEETCONFIG);
00039     m_cfDSObjectNames = RegisterClipboardFormat(CFSTR_DSOBJECTNAMES);
00040     m_cfDSDispSpecOptions = RegisterClipboardFormat(CFSTR_DSDISPLAYSPECOPTIONS);
00041
00042     m_szHiddenWindowClass = TEXT("CPropSheetHostHiddenWindowClass");
00043
00044 #if 1
00045     m_pwszPrefix = PROP_SHEET_PREFIX_ADMIN;
00046 #else
00047     m_pwszPrefix = PROP_SHEET_PREFIX_SHELL;
00048 #endif
00049 }
00050
00051 /***************************************************************************
00052
00053     CPropSheetHost::~CPropSheetHost()
00054
00055 ***************************************************************************/
00056
00057 CPropSheetHost::~CPropSheetHost()
00058 {
00059 }
00060
00061 /***************************************************************************
00062
00063     CPropSheetHost::SetObject()
00064
00065 ***************************************************************************/
00066
00067 HRESULT CPropSheetHost::SetObject(LPCWSTR pwszADsPath)
00068 {
00069     CComPtr<IADs> spADsTemp;
00070     HRESULT hr = ADsGetObject(pwszADsPath, IID_IADs, (LPVOID*)&spADsTemp);
00071     if(FAILED(hr))
00072     {
00073         return hr;
00074     }
00075
00076     return SetObject(spADsTemp);
00077 }
00078
00079 /***************************************************************************
00080
00081     CPropSheetHost::SetObject()
00082
00083 ***************************************************************************/
00084
00085 HRESULT CPropSheetHost::SetObject(IADs *pads)
00086 {
00087     HRESULT hr = pads->QueryInterface(IID_IADs, (LPVOID*)&m_spADObject);
00088
00089     return hr;
00090 }
00091
00092 /***************************************************************************
00093
00094     CPropSheetHost::Run()
00095
00096 ***************************************************************************/
00097
00098 void CPropSheetHost::Run()
00099 {
00100     if(!m_spADObject.p)
00101     {
00102         return;
00103     }
00104
00105     // Create the hidden window.
00106     m_hwndHidden = _CreateHiddenWindow();
00107     if(!m_hwndHidden)
00108     {
00109         return;
00110     }
00111
00112     /*
00113     Display the proeprty sheet. This is a modal call and will not return
00114     until the property sheet is dimissed.
00115     */
00116     _CreatePropertySheet();
00117
00118     // Destroy the hidden window.
00119     DestroyWindow(m_hwndHidden);
00120 }
00121
00122 /***************************************************************************
00123
00124     CPropSheetHost::_CreateHiddenWindow()
00125
00126 ***************************************************************************/
00127
00128 HWND CPropSheetHost::_CreateHiddenWindow()
00129 {
00130     WNDCLASS  wc;
00131
00132     if(!GetClassInfo(m_hInst, m_szHiddenWindowClass, &wc))
00133     {
00134         ZeroMemory(&wc, sizeof(wc));
00135
00136         wc.style          = CS_HREDRAW | CS_VREDRAW;
00137         wc.lpfnWndProc    = (WNDPROC)_HiddenWindowProc;
00138         wc.cbClsExtra     = 0;
00139         wc.cbWndExtra     = sizeof(CPropSheetHost*);
00140         wc.hInstance      = m_hInst;
00141         wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00142         wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW + 1);
00143         wc.lpszClassName  = m_szHiddenWindowClass;
00144
00145         if(!RegisterClass(&wc))
00146         {
00147             return NULL;
00148         }
00149     }
00150
00151     m_hwndHidden = CreateWindowEx(  0,
00152                                     m_szHiddenWindowClass,
00153                                     NULL,
00154                                     WS_OVERLAPPED |
00155                                         0,
00156                                     CW_USEDEFAULT,
00157                                     CW_USEDEFAULT,
00158                                     CW_USEDEFAULT,
00159                                     CW_USEDEFAULT,
00160                                     NULL,
00161                                     NULL,
00162                                     m_hInst,
00163                                     (LPVOID)this);
00164
00165     return m_hwndHidden;
00166 }
00167
00168 /***************************************************************************
00169
00170     CPropSheetHost::_HiddenWindowProc()
00171
00172 ***************************************************************************/
00173
00174 LRESULT CALLBACK CPropSheetHost::_HiddenWindowProc( HWND hWnd,
00175                                                     UINT uMessage,
00176                                                     WPARAM wParam,
00177                                                     LPARAM lParam)
00178 {
00179     CPropSheetHost *pThis = (CPropSheetHost*)((LONG_PTR)GetWindowLongPtr(hWnd, VIEW_POINTER_OFFSET));
00180
00181     switch (uMessage)
00182     {
00183     case WM_NCCREATE:
00184         {
00185             LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00186             pThis = (CPropSheetHost*)(lpcs->lpCreateParams);
00187             ::SetWindowLongPtr(hWnd, VIEW_POINTER_OFFSET, (LONG)(LONG_PTR)pThis);
00188         }
00189         break;
00190
00191     case WM_CREATE:
00192         break;
00193
00194     case WM_DESTROY:
00195         break;
00196
00197     case WM_ADSPROP_NOTIFY_CHANGE:
00198         OutputDebugString(TEXT("WM_ADSPROP_NOTIFY_CHANGE\n"));
00199         break;
00200
00201     case WM_DSA_SHEET_CREATE_NOTIFY:
00202         {
00203             PDSA_SEC_PAGE_INFO pSecPageInfo;
00204
00205             // Extract the secondary sheet information from the wParam.
00206             if(S_OK == pThis->_ExtractSecPageInfo(wParam, &pSecPageInfo))
00207             {
00208                 // Create a secondary property sheet.
00209                 pThis->_CreateSecondaryPropertySheet(pSecPageInfo);
00210             }
00211             else
00212             {
00213                 // Even if the extraction failed, the wParam needs to be freed.
00214                 pSecPageInfo = (PDSA_SEC_PAGE_INFO)wParam;
00215             }
00216
00217             /*
00218             The receiver of the  message must free the DSA_SEC_PAGE_INFO
00219             structure when it is no longer needed.
00220             */
00221             LocalFree(pSecPageInfo);
00222         }
00223         return 0;
00224
00225     case WM_DSA_SHEET_CLOSE_NOTIFY:
00226         if(PROP_SHEET_HOST_ID == wParam)
00227         {
00228             OutputDebugString(TEXT("PROP_SHEET_HOST_ID\n"));
00229         }
00230         return 0;
00231
00232     default:
00233         break;
00234     }
00235
00236     return DefWindowProc(hWnd, uMessage, wParam, lParam);
00237 }
00238
00239 /***************************************************************************
00240
00241     CPropSheetHost::_AddPagesForObject()
00242
00243     This method will add all of the property pages for the specified object
00244     by performing the following steps:
00245
00246     1. Create an instance of the CLSID_DsPropertyPages object.
00247
00248     2. Initialize the CLSID_DsPropertyPages object.
00249
00250     3. Call the IShellPropSheetExt::AddPages method of the
00251     CLSID_DsPropertyPages object. The CLSID_DsPropertyPages will enumerate
00252     the admin property sheet extensions, create and initialize each
00253     extension object and call the extension's IShellPropSheetExt::AddPages
00254     method to cause the extension to add its pages to the property sheet.
00255
00256 ***************************************************************************/
00257
00258 HRESULT CPropSheetHost::_AddPagesForObject(IADs *padsObject)
00259 {
00260     HRESULT hr;
00261
00262     // Get a copy of our IDataObject.
00263     CComPtr<IDataObject> spDataObject;
00264     hr = this->QueryInterface(IID_IDataObject, (LPVOID*)&spDataObject);
00265     if(FAILED(hr))
00266     {
00267         return hr;
00268     }
00269
00270     // Create the DS property pages object.
00271     CComPtr<IShellExtInit> spExtInit;
00272     hr = spExtInit.CoCreateInstance(CLSID_DsPropertyPages);
00273     if(FAILED(hr))
00274     {
00275         return hr;
00276     }
00277
00278     // Initialize the  DS property pages object.
00279     hr = spExtInit->Initialize(NULL, spDataObject, NULL);
00280     if(FAILED(hr))
00281     {
00282         return hr;
00283     }
00284
00285     CComPtr<IShellPropSheetExt> spPropSheet;
00286     hr = spExtInit->QueryInterface(IID_IShellPropSheetExt, (LPVOID*)&spPropSheet);
00287     if(FAILED(hr))
00288     {
00289         return hr;
00290     }
00291
00292     hr = spPropSheet->AddPages(_AddPagesCallback, (LPARAM)this);
00293     if(FAILED(hr))
00294     {
00295         return hr;
00296     }
00297
00298     return hr;
00299 }
00300
00301 /***************************************************************************
00302
00303     CPropSheetHost::_CreatePropertySheet()
00304
00305 ***************************************************************************/
00306
00307 void CPropSheetHost::_CreatePropertySheet()
00308 {
00309     if(!m_spADObject.p)
00310     {
00311         return;
00312     }
00313
00314     HRESULT hr;
00315
00316     hr = _AddPagesForObject(m_spADObject);
00317     if(FAILED(hr))
00318     {
00319         return;
00320     }
00321
00322     /*
00323     The property page handle array should have been filled in _AddPagesForObject
00324     when AddPages was called.
00325     */
00326     if(m_rgPageHandles.GetSize() == 0)
00327     {
00328         return;
00329     }
00330
00331     // Create the caption for the property sheet.
00332     CComBSTR sbstrTemp;
00333     hr = m_spADObject->get_Name(&sbstrTemp);
00334     if(S_OK == hr)
00335     {
00336         sbstrTemp += " ";
00337     }
00338     else
00339     {
00340         sbstrTemp = "";
00341     }
00342     sbstrTemp += m_pwszPrefix;
00343     sbstrTemp += " Properties";
00344
00345     // Initialize the property sheet.
00346     PROPSHEETHEADER psh;
00347
00348     ZeroMemory(&psh, sizeof(psh));
00349
00350     USES_CONVERSION;
00351
00352     // Fill out the PROPSHEETHEADER structure.
00353     psh.dwSize           = sizeof(PROPSHEETHEADER);
00354     psh.dwFlags          = PSH_DEFAULT;
00355     psh.hwndParent       = m_hwndParent;
00356     psh.hInstance        = NULL;
00357     psh.pszIcon          = NULL;
00358     psh.pszCaption       = W2T(sbstrTemp);
00359     psh.nPages           = (UINT)m_rgPageHandles.GetSize();
00360     psh.phpage           = m_rgPageHandles.GetData();
00361     psh.pfnCallback      = NULL;
00362
00363     // Display the property sheet.
00364     PropertySheet(&psh);
00365
00366     // Remove all page handles from the array.
00367     m_rgPageHandles.RemoveAll();
00368 }
00369
00370 /***************************************************************************
00371
00372     CPropSheetHost::_AddPagesCallback()
00373
00374 ***************************************************************************/
00375
00376 BOOL CALLBACK CPropSheetHost::_AddPagesCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
00377 {
00378     CPropSheetHost *pThis = (CPropSheetHost*)lParam;
00379
00380     pThis->m_rgPageHandles.Add(hPage);
00381
00382     return TRUE;
00383 }
00384
00385 /***************************************************************************
00386
00387     CPropSheetHost::_ExtractSecPageInfo()
00388
00389 ***************************************************************************/
00390
00391 HRESULT CPropSheetHost::_ExtractSecPageInfo(WPARAM wParam, PDSA_SEC_PAGE_INFO *ppSecPageInfo)
00392 {
00393     if(!wParam || !ppSecPageInfo)
00394     {
00395         return E_INVALIDARG;
00396     }
00397
00398     OSVERSIONINFO osvi;
00399
00400     osvi.dwOSVersionInfoSize = sizeof(osvi);
00401     if(GetVersionEx(&osvi))
00402     {
00403         // This functionality isn't supported prior to Windows 2000.
00404         if((osvi.dwPlatformId != VER_PLATFORM_WIN32_NT) || (osvi.dwMajorVersion < 5))
00405         {
00406             return E_UNEXPECTED;
00407         }
00408
00409         /*
00410         Special case for Windows 2000. Need to insert an HWND member at the front
00411         of the DSA_SEC_PAGE_INFO structure.
00412         */
00413         if((5 == osvi.dwMajorVersion) && (0 == osvi.dwMinorVersion))
00414         {
00415             SIZE_T sizeOldSize = LocalSize((HLOCAL)wParam);
00416             DWORD dwOffset = sizeof(HWND);
00417
00418             *ppSecPageInfo = (PDSA_SEC_PAGE_INFO)LocalAlloc(GPTR, sizeOldSize + sizeof(HWND));
00419             if(!*ppSecPageInfo)
00420             {
00421                 return E_OUTOFMEMORY;
00422             }
00423
00424             LPBYTE pDest = (LPBYTE)*ppSecPageInfo;
00425             LPBYTE pSource = (LPBYTE)wParam;
00426
00427             // Copy the original memory to the new block.
00428             CopyMemory(pDest + dwOffset, pSource, sizeOldSize);
00429
00430             // Need to update the title offset.
00431             (*ppSecPageInfo)->offsetTitle += dwOffset;
00432
00433             // Free the old memory.
00434             LocalFree((HLOCAL)wParam);
00435         }
00436         else
00437         {
00438             // Just return the original memory.
00439             *ppSecPageInfo = (PDSA_SEC_PAGE_INFO)wParam;
00440         }
00441
00442         return S_OK;
00443     }
00444
00445     return E_FAIL;
00446 }
00447
00448 /***************************************************************************
00449
00450     CPropSheetHost::_CreateSecondaryPropertySheet()
00451
00452 ***************************************************************************/
00453
00454 void CPropSheetHost::_CreateSecondaryPropertySheet(DSA_SEC_PAGE_INFO *pDSASecPageInfo)
00455 {
00456     LPDSOBJECT pdsObject = &pDSASecPageInfo->dsObjectNames.aObjects[0];
00457
00458     LPWSTR pwszTitle = (LPWSTR)((LPBYTE)pDSASecPageInfo + pDSASecPageInfo->offsetTitle);
00459     LPWSTR pwszClass = (LPWSTR)((LPBYTE)pdsObject + pdsObject->offsetClass);
00460
00461     // Create a new property sheet host object.
00462     CPropSheetHost *pSecondarySheet = new CPropSheetHost(m_hInst, pDSASecPageInfo->hwndParentSheet);
00463     if(!pSecondarySheet)
00464     {
00465         return;
00466     }
00467
00468     // Hold a reference count for the CPropSheetHost object.
00469     pSecondarySheet->AddRef();
00470
00471     // Build the ADsPath of the object to create the property sheet for.
00472     LPWSTR pwszName = (LPWSTR)((LPBYTE)pdsObject + pdsObject->offsetName);
00473     CComBSTR sbstrTemp = "LDAP://";
00474     sbstrTemp += pwszName;
00475     pSecondarySheet->SetObject(sbstrTemp);
00476
00477     pSecondarySheet->Run();
00478
00479     /*
00480     Release the CPropSheetHost object. Other components may still hold a
00481     reference to the object, so this cannot just be deleted here. Let the object
00482     delete itself when all references are released.
00483     */
00484     pSecondarySheet->Release();
00485 }
00486
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/authz/AuthzCli.c Source File

  • Security
  • Authorization
  • authz

AuthzCli.c

Go to the documentation of this file.
00001 /*++
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1999 - 2001 Microsoft Corporation.  All rights reserved.
00009
00010 Module Name:
00011
00012     AuthzCli.c
00013
00014 Abstract:
00015
00016     Sample client - will connect to sample Resource Manager AuthzSvr.
00017
00018
00019 --*/
00020
00021 #include<windows.h>
00022 #include<stdio.h>
00023 #include<tchar.h>
00024 #include"common.h"
00025
00026
00027 void Usage(LPTSTR AppName)
00028 {
00029    printf(
00030       "Usage: %s <\\\\server> <Personal|Corporate|Transfer> <Ammount (cents)>\n"
00031        ,AppName);
00032    ExitProcess(0);
00033 }
00034
00035
00036
00037 void main (int argc, char *argv[])
00038 {
00039    HANDLE   hPipe;
00040    TCHAR    szPipeName[256];
00041    TCHAR    szServerName[128] = "\\\\.";
00042    EX_BUF   exBuf = {0};
00043    DWORD    dwResponce = ERROR_ACCESS_DENIED;
00044
00045
00046    if (argc < 4)
00047       Usage(argv[0]);
00048
00049    //
00050    // Verify expnese input
00051    //
00052
00053    if (!lstrcmpi(argv[2],TEXT("Personal"))) {
00054       exBuf.dwType = ACCESS_FUND_PERSONAL;
00055    }
00056    else if (!lstrcmpi(argv[2],TEXT("Corporate"))) {
00057       exBuf.dwType = ACCESS_FUND_CORPORATE;
00058    }
00059    else if (!lstrcmpi(argv[2],TEXT("Transfer"))) {
00060       exBuf.dwType = ACCESS_FUND_TRANSFER;
00061    }
00062    else
00063       Usage(argv[0]);
00064
00065    if (!(exBuf.dwAmmount = atoi(argv[3])))
00066        Usage(argv[0]);
00067
00068    printf("expense: %s Ammount: %u\n",ExNames[exBuf.dwType],exBuf.dwAmmount);
00069
00070
00071    wsprintf(szPipeName,"%s\\pipe\\AuthzSamplePipe",szServerName);
00072
00073    // Wait for an instance of the pipe
00074    if (!WaitNamedPipe(szPipeName,NMPWAIT_WAIT_FOREVER) )
00075       HandleError(GetLastError(),TEXT("WaitNamedPipe"),TRUE,TRUE);
00076
00077
00078    // Connect to pipe
00079    hPipe = CreateFile(  szPipeName, GENERIC_READ|GENERIC_WRITE, 0,
00080                         NULL, OPEN_EXISTING, 0, NULL);
00081    if (hPipe == INVALID_HANDLE_VALUE)
00082       HandleError(GetLastError(),TEXT("CreateFile"),TRUE,TRUE);
00083
00084    // Send off request
00085    WriteToPipe(hPipe, (PBYTE)&exBuf, sizeof(EX_BUF));
00086
00087    // wait till server responds with one DWORD
00088    if (!ReadFromPipe(hPipe,(PBYTE)&dwResponce,sizeof(dwResponce))) {
00089       printf("Error reading form Svr\n");
00090       return;
00091    }
00092
00093    switch(dwResponce)
00094    {
00095    case EXPENSE_APPROVED:
00096       printf("Expense Approved.\n");
00097       break;
00098
00099    case ERROR_ACCESS_DENIED:
00100       printf("Expense denied: Access denied.\n");
00101       break;
00102
00103    case ERROR_INSUFFICIENT_FUNDS:
00104       printf("Expense denied: Insufficeint funds.\n");
00105       break;
00106
00107    default:
00108       printf("Expense failed: unexpected error.\n");
00109    }
00110
00111    CloseHandle(hPipe);
00112 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/ADate.h Source File

  • Security
  • CertServices
  • Encode

ADate.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 2000
00006 //
00007 //  File:       adate.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // adate.h: Declaration of the CCertEncodeDateArray
00012
00013
00014 #include "resource.h"       // main symbols
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // certenc
00018
00019 #define wszCLASS_CERTENCODEDATEARRAY wszCLASS_CERTENCODE TEXT("DateArray")
00020
00021 class CCertEncodeDateArray:
00022     public IDispatchImpl<ICertEncodeDateArray, &IID_ICertEncodeDateArray, &LIBID_CERTENCODELib>,
00023     public ISupportErrorInfoImpl<&IID_ICertEncodeDateArray>,
00024     public CComObjectRoot,
00025     public CComCoClass<CCertEncodeDateArray, &CLSID_CCertEncodeDateArray>
00026 {
00027 public:
00028     CCertEncodeDateArray()
00029     {
00030   m_aValue = NULL;
00031   m_fConstructing = FALSE;
00032     }
00033     ~CCertEncodeDateArray();
00034
00035 BEGIN_COM_MAP(CCertEncodeDateArray)
00036     COM_INTERFACE_ENTRY(IDispatch)
00037     COM_INTERFACE_ENTRY(ISupportErrorInfo)
00038     COM_INTERFACE_ENTRY(ICertEncodeDateArray)
00039 END_COM_MAP()
00040
00041 DECLARE_NOT_AGGREGATABLE(CCertEncodeDateArray)
00042 // Remove the comment from the line above if you don't want your object to
00043 // support aggregation.  The default is to support it
00044
00045 DECLARE_REGISTRY(
00046     CCertEncodeDateArray,
00047     wszCLASS_CERTENCODEDATEARRAY TEXT(".1"),
00048     wszCLASS_CERTENCODEDATEARRAY,
00049     IDS_CERTENCODEDATEARRAY_DESC,
00050     THREADFLAGS_BOTH)
00051
00052 // ICertEncodeDateArray
00053 public:
00054     STDMETHOD(Decode)(
00055     /* [in] */ BSTR const strBinary);
00056
00057     STDMETHOD(GetCount)(
00058     /* [out, retval] */ LONG __RPC_FAR *pCount);
00059
00060     STDMETHOD(GetValue)(
00061     /* [in] */ LONG Index,
00062     /* [out, retval] */ DATE __RPC_FAR *pValue);
00063
00064     STDMETHOD(Reset)(
00065     /* [in] */ LONG Count);
00066
00067     STDMETHOD(SetValue)(
00068     /* [in] */ LONG Index,
00069     /* [in] */ DATE Value);
00070
00071     STDMETHOD(Encode)(
00072     /* [out, retval] */ BSTR __RPC_FAR *pstrBinary);
00073 private:
00074     VOID _Cleanup(VOID);
00075
00076     HRESULT _SetErrorInfo(
00077     IN HRESULT hrError,
00078     IN WCHAR const *pwszDescription);
00079
00080     DATE  *m_aValue;
00081     LONG   m_cValue;
00082     LONG   m_cValuesSet;
00083     BOOL   m_fConstructing;
00084 };
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcRDO/RDOKB.Cpp Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcRDO

RDOKB.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: RDOKB.cpp
00003 //
00004 // Description: Implementation of DLL Exports.
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021 // Note: Proxy/Stub Information
00022 //    To build a separate proxy/stub DLL,
00023 //    run nmake -f RDOKBps.mk in the project directory.
00024
00025 #include "stdafx.h"
00026 #include "resource.h"
00027 #include "initguid.h"
00028 #include "RDOKB.h"
00029
00030 #include "RDOKB_i.c"
00031 #include <initguid.h>
00032 #include "RDOComponent.h"
00033
00034
00035 CComModule _Module;
00036
00037 BEGIN_OBJECT_MAP(ObjectMap)
00038   OBJECT_ENTRY(CLSID_RDOComponent, CRDOComponent)
00039 END_OBJECT_MAP()
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // DLL Entry Point
00043
00044 extern "C"
00045 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00046 {
00047   if (dwReason == DLL_PROCESS_ATTACH)
00048   {
00049     _Module.Init(ObjectMap, hInstance);
00050     DisableThreadLibraryCalls(hInstance);
00051   }
00052   else if (dwReason == DLL_PROCESS_DETACH)
00053     _Module.Term();
00054   return TRUE;    // ok
00055 }
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // Used to determine whether the DLL can be unloaded by OLE
00059
00060 STDAPI DllCanUnloadNow(void)
00061 {
00062   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00063 }
00064
00065 /////////////////////////////////////////////////////////////////////////////
00066 // Returns a class factory to create an object of the requested type
00067
00068 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00069 {
00070   return _Module.GetClassObject(rclsid, riid, ppv);
00071 }
00072
00073 /////////////////////////////////////////////////////////////////////////////
00074 // DllRegisterServer - Adds entries to the system registry
00075
00076 STDAPI DllRegisterServer(void)
00077 {
00078   // registers object, typelib and all interfaces in typelib
00079   return _Module.RegisterServer(TRUE);
00080 }
00081
00082 /////////////////////////////////////////////////////////////////////////////
00083 // DllUnregisterServer - Removes entries from the system registry
00084
00085 STDAPI DllUnregisterServer(void)
00086 {
00087   _Module.UnregisterServer();
00088   return S_OK;
00089 }
00090
00091
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/basesnap.h Source File

  • SysMgmt
  • MMC
  • About

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/devicenode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

devicenode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CDeviceNode class.
00014 //
00015
00016
00017 #include "DeviceNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include "FolderNode.h"
00022 #include "StaticNode.h"
00023                              // Tracing stuff
00024 #include "TraceMacro.h"
00025 #undef  MODULESTRING
00026 #define MODULESTRING  _T("CDeviceNode")
00027
00028
00029 // Initialize our static GUID just once
00030 GUID CDeviceNode::thisGUID = CLSID_DeviceNode;
00031
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // Construction/Destruction
00035
00036 //---------------------------------------------------------------------------
00037 CDeviceNode::CDeviceNode()
00038 {
00039   m_SDI.mask        = DEFAULT_SDI_MASK;
00040   m_SDI.displayname = MMC_CALLBACK;
00041   m_SDI.cChildren   = 1;             // Determines if the '+' is displayed
00042   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00043
00044   m_hParentNode     = NULL;          // HSCOPEITEM of parent
00045   m_pParentNode     = NULL;          // Pointer to parent Static Node
00046   m_dwAttributes    = 0;
00047   m_wzStatus        = NULL;
00048   m_pCompData       = NULL;
00049 }
00050
00051 //---------------------------------------------------------------------------
00052 CDeviceNode::~CDeviceNode()
00053 {
00054 }
00055
00056 //---------------------------------------------------------------------------
00057 HRESULT CDeviceNode::Initialize
00058 (
00059   LPNODEPROPS  pNodeProps    //[in] Properties for this node
00060 )
00061 {
00062   _ASSERT( NULL != pNodeProps );
00063
00064   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00065   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00066   wcscpy( pszTmp, pNodeProps->szNodeName );
00067   if( NULL != m_pwszNodeName )
00068     CoTaskMemFree( m_pwszNodeName );
00069
00070   m_pwszNodeName = pszTmp;
00071   m_pCompData    = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00072   m_pParentNode  = reinterpret_cast<CStaticNode*>(pNodeProps->pParentObject);
00073   m_dwAttributes = pNodeProps->dwAttributes;
00074
00075   if( INIT_DEFAULT_NODE == pNodeProps->nChildCount )
00076   {
00077     InitDefaultFolder();
00078   }
00079
00080   // Set images according to device type
00081   //
00082   if( pNodeProps->dwAttributes & ATTRIBUTE_BACKUP_DEVICE )
00083   {
00084     m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00085     m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00086     m_dwAttributes   |= ATTRIBUTE_BACKUP_DEVICE;
00087   }
00088   else
00089   {
00090     m_SDI.nImage      = IMG_DRIVE_DEFAULT;
00091     m_SDI.nOpenImage  = IMG_DRIVE_DEFAULT;
00092     m_dwAttributes   |= ~ATTRIBUTE_BACKUP_DEVICE;
00093   }
00094
00095   m_wzStatus      = L"Online";    // Node successfully initialized
00096   m_bOnlineStatus = STATUS_ONLINE;
00097
00098   return S_OK;
00099 }
00100
00101
00102 /////////////////////////////////////////////////////////////////////////////
00103 // Implementation of virtual methods
00104
00105
00106 //---------------------------------------------------------------------------
00107 //  Can't drag a DeviceNode to another StaticNode so don't implement this
00108 //
00109 HRESULT CDeviceNode::GetProperties
00110 (
00111   LPNODEPROPS* ppNodeProps   //[out] Properties of this node
00112 )
00113 {
00114   _ASSERT( NULL == *ppNodeProps );
00115   return E_NOTIMPL;
00116 }
00117
00118 //---------------------------------------------------------------------------
00119 //  The minimum implementation of this method is to return the
00120 //  Persistable View Description string.  This string must be allocated
00121 //  with CoTaskMemAlloc.  The console will free the string.
00122 //
00123 HRESULT CDeviceNode::GetResultViewType2
00124 (
00125   MMC_COOKIE             nCookie,  //[in] Identifier of object
00126   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00127 )
00128 {
00129   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+1 );
00130   if( NULL == pszDescStr )
00131     return E_OUTOFMEMORY;
00132
00133   wcscpy( pszDescStr, L"DefaultListView" );
00134   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00135
00136   return S_OK;
00137 }
00138
00139 //---------------------------------------------------------------------------
00140 HRESULT CDeviceNode::GetDisplayInfo
00141 (
00142   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00143 )
00144 {
00145   _ASSERT( NULL != pSDI );
00146   pSDI->displayname = m_pwszNodeName;
00147
00148   return S_OK;
00149 }
00150
00151 //---------------------------------------------------------------------------
00152 HRESULT CDeviceNode::GetDisplayInfo
00153 (
00154   RESULTDATAITEM* pRDI
00155 )
00156 {
00157   _ASSERT( NULL != pRDI );
00158
00159   HRESULT hResult = S_OK;
00160
00161   if( pRDI->mask & RDI_STR )         // Console is requesting strings...
00162   {                                  // for each column
00163     switch( pRDI->nCol )
00164     {
00165       case 0:
00166         pRDI->str = m_pwszNodeName;
00167         break;
00168
00169       case 1:                        // Attributes not supported yet
00170         pRDI->str = m_wzStatus;
00171         break;
00172
00173       default:
00174         hResult = S_FALSE;
00175         TRACE_VAL(_T("GetDisplayInfo"), _T("Column"), pRDI->nCol );
00176         break;
00177     }
00178   }
00179   if( pRDI->mask & RDI_IMAGE )       // Looking for an image?
00180   {
00181     pRDI->nImage = m_SDI.nImage;
00182   }
00183
00184   //TRACE_HRESULT(_T("GetDisplayInfo"), hResult );
00185   return hResult;
00186
00187 }
00188
00189 /////////////////////////////////////////////////////////////////////////////
00190 // Implementation of notification handlers
00191
00192
00193 //---------------------------------------------------------------------------
00194 HRESULT CDeviceNode::OnSelect
00195 (
00196   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00197   LPARAM        nArg,          //[in] Bools for context & selection state
00198   LPARAM        nParam,        //[in] Not used
00199   LONG_PTR      pComponent     //[in] Points calling CComponent
00200 )
00201 {
00202   HRESULT hResult = S_FALSE;
00203   BOOL    fScopePane = LOWORD(nArg);
00204   BOOL    fSelected  = HIWORD(nArg);
00205
00206   CComponent* pComp  = reinterpret_cast<CComponent*>(pComponent);
00207
00208   if( TRUE == fSelected )
00209   {
00210     IConsoleVerb* ipConsoleVerb = NULL;
00211     hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00212     if( S_OK != hResult )
00213      return hResult;
00214
00215     // DRAGDROP: Add MMC_VERB_PASTE for this object only
00216     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_PASTE, ENABLED, TRUE );
00217
00218     // Support renaming of device nodes
00219     hResult = ipConsoleVerb->SetVerbState( MMC_VERB_RENAME, ENABLED, TRUE );
00220   }
00221   //TRACE_HRESULT(_T("OnSelect"), hResult );
00222   return hResult;
00223 }
00224
00225
00226 //---------------------------------------------------------------------------
00227 HRESULT CDeviceNode::OnShow
00228 (
00229   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00230   LPARAM        nArg,          //[in] TRUE if node was selcted
00231   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00232   LONG_PTR      pComponent     //[in] Points to calling IComponent
00233 )
00234 {
00235   HRESULT  hResult = S_FALSE;
00236
00237   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00238
00239   LPHEADERCTRL2  ipHeaderCtrl = NULL;
00240   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL, (LONG_PTR*)&ipHeaderCtrl );
00241   if( S_OK != hResult )
00242    return hResult;
00243
00244   LPRESULTDATA  ipResultData = NULL;
00245   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00246   if( S_OK != hResult )
00247    return hResult;
00248
00249   if( TRUE == nArg )  // Selecting a scope node
00250   {
00251     do
00252     {
00253       hResult = ipHeaderCtrl->InsertColumn( 0, L"Folder Name", 0, 150 );
00254       BREAK_ON_ERROR( hResult );
00255
00256       hResult = ipHeaderCtrl->InsertColumn( 1, L"Attributes", 0, 150 );
00257       BREAK_ON_ERROR( hResult );
00258
00259       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00260       BREAK_ON_ERROR( hResult );
00261
00262     }while(0);
00263   }
00264   else // not handling deselect notifications
00265   {
00266   }
00267
00268   //TRACE_HRESULT(_T("OnShow"), hResult );
00269   return hResult;
00270 }
00271
00272 //---------------------------------------------------------------------------
00273 HRESULT CDeviceNode::OnExpand
00274 (
00275   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00276   LPARAM         nArg,         //[in] TRUE if node was selcted
00277   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00278   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00279 )
00280 {
00281   HRESULT hResult = S_FALSE;
00282
00283   // Cache HSCOPEITEM of Parent
00284   m_hParentNode = static_cast<HSCOPEITEM>(nParam);
00285
00286   if( NULL == m_pCompData )
00287     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00288
00289   // Request an IConsoleNameSpace2 pointer from CComponentData
00290   LPCONSOLENAMESPACE2 ipCNS = NULL;
00291   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00292   if( S_OK != hResult )
00293     return hResult;
00294
00295   hResult = DeleteChildItems( ipCNS );
00296   hResult = InsertChildItems( ipCNS );
00297
00298   //TRACE_HRESULT( _T("OnExpand"), hResult );
00299   return hResult;
00300 }
00301
00302
00303 //---------------------------------------------------------------------------
00304 HRESULT CDeviceNode::OnRemoveChildren
00305 (
00306   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00307   LPARAM         nArg,         //[in] TRUE if node was selcted
00308   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00309   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00310 )
00311 {
00312   HRESULT hResult = S_FALSE;
00313
00314   if( NULL == m_pCompData )
00315     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00316
00317   LPCONSOLENAMESPACE2 ipCNS = NULL;
00318   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00319   if( S_OK != hResult )
00320     return hResult;
00321                                        // Deletes HSCOPEITEMS only...
00322   hResult = DeleteChildItems( ipCNS );
00323
00324   POSITION   Pos   = m_NodeList.GetHeadPosition();
00325   LPBASENODE pNode = NULL;
00326   while( Pos )                         // Delete everything...
00327   {
00328     pNode = m_NodeList.GetNext( Pos );
00329     pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00330     delete pNode;
00331   }
00332
00333   m_NodeList.RemoveAll();            // Cleans up the list
00334
00335   //TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00336   return hResult;
00337 }
00338
00339 //---------------------------------------------------------------------------
00340 //  This message must return S_OK to allow the rename.  Anything else will
00341 //  disallow the rename
00342 //
00343 HRESULT CDeviceNode::OnRename
00344 (
00345   LPDATAOBJECT ipDataObject,   //[in] Points to Data Object
00346   LPARAM       nArg,           //[in] Not used
00347   LPARAM       nParam,         //[in] Pointer to the new name
00348   LONG_PTR     pComponent      //[in] Points to calling IComponent
00349 )
00350 {
00351   _ASSERT( NULL != ipDataObject );
00352   HRESULT hResult = S_OK;
00353
00354   LPWSTR pszTmpName = NULL;
00355   LPWSTR pszNewName = (LPWSTR)nParam;  // New name
00356   LONG   nLen = wcslen( pszNewName ) + 1;
00357
00358   pszTmpName = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00359   if( NULL == pszTmpName )
00360   {
00361     hResult = S_FALSE;                 // Can't change the name
00362   }
00363   else
00364   {
00365     wcscpy( pszTmpName, pszNewName );
00366     CoTaskMemFree( m_pwszNodeName );   // Free existing name...
00367     m_pwszNodeName = pszTmpName;       // Assign new name to pointer
00368   }
00369   return hResult;
00370 }
00371
00372 /////////////////////////////////////////////////////////////////////////////
00373 // DRAGDROP: Notifications which support DragDrop
00374
00375 //---------------------------------------------------------------------------
00376 //  MMC20: nParam has changed to a DWORD* which can be used to specify
00377 //         the default behaviour of DragDrop
00378 //
00379 HRESULT CDeviceNode::OnQueryPaste
00380 (
00381   LPDATAOBJECT ipDataObject,   //[in] Data object of the selected node
00382   LPARAM       nArg,           //[in] Data object of node to be pasted
00383   LPARAM       nParam,         //[in] DWORD* which specifies default operation
00384   LONG_PTR     pComponent      //[in] Points to calling IComponent
00385 )
00386 {
00387   _ASSERT( NULL != nArg );
00388   // Make the default operation "Copy Here" as opposed to "Move Here"
00389   DWORD* pdwDefaultOperation = reinterpret_cast<DWORD*>(nParam);
00390   *pdwDefaultOperation = MMC_DEFAULT_OPERATION_COPY;
00391
00392   ULONG nTypeFlag = ExtractNodeTypeFlg( reinterpret_cast<LPDATAOBJECT>(nArg) );
00393   return (NODETYPE_FOLDER == nTypeFlag) ? S_OK : S_FALSE;
00394 }
00395
00396 //---------------------------------------------------------------------------
00397 //  DRAGDROP:  For Device Nodes, we extract the object's properties via
00398 //             the data object.  A new node is created and initialized
00399 //             with the source node's properties.  If the source node had
00400 //             children, the new node is reponsible for reading the data
00401 //             and creating new child nodes.
00402 //
00403 HRESULT CDeviceNode::OnPaste
00404 (
00405   LPDATAOBJECT ipDataObject,   //[in] Data object of the destination node
00406   LPARAM       nArg,           //[in] Data object of the source node
00407   LPARAM       nParam,         //[in] NULL for copy, data object for cut
00408   LONG_PTR     pComponent      //[in] Points to calling IComponent
00409 )
00410 {
00411   _ASSERT( NULL != nArg );
00412   _ASSERT( NULL != pComponent );
00413   HRESULT hResult = S_FALSE;
00414   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00415   LPDATAOBJECT ipSourceDO = reinterpret_cast<LPDATAOBJECT>(nArg);
00416
00417   do
00418   {
00419     // Test to see if the data object supports the clipformat we need
00420     FORMATETC NodePropFormatEtc = NP_FORMATETC;
00421     hResult = ipSourceDO->QueryGetData( &NodePropFormatEtc );
00422     BREAK_ON_ERROR( hResult );
00423
00424     STGMEDIUM StgMedium = {TYMED_HGLOBAL, NULL};
00425     hResult = ipSourceDO->GetData( &NodePropFormatEtc, &StgMedium );
00426     BREAK_ON_ERROR( hResult );
00427
00428     HGLOBAL hMemBlock = ::GlobalLock( StgMedium.hGlobal );
00429     LPNODEPROPS pNodeProps = (LPNODEPROPS)hMemBlock;
00430
00431     // Set variables which must be local
00432     pNodeProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00433     pNodeProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00434
00435     // Now add the new node
00436     CFolderNode* pNode = NULL;
00437     pNode = new CFolderNode;
00438     pNode->Initialize( pNodeProps );
00439     m_NodeList.AddTail( pNode );
00440
00441     // Now do some housekeeping, and test that everything went OK....
00442     BOOL    bStatus = ::GlobalUnlock( StgMedium.hGlobal );
00443     HGLOBAL hReturn = ::GlobalFree( StgMedium.hGlobal );
00444     _ASSERT( NULL == hReturn );
00445
00446     if( NULL != nParam )
00447     {
00448       // We must AddRef it becuase MMC will release it once when we
00449       // return, and again when CFolderNode::OnCutOrMove returns.
00450       //
00451       BOOL* pbPasted = reinterpret_cast<BOOL*>(nParam);
00452       ULONG nCount = ipSourceDO->AddRef();
00453       *pbPasted = reinterpret_cast<BOOL>(ipSourceDO);
00454     }
00455
00456     // Insert the new node and select it
00457     //
00458     LPCONSOLENAMESPACE2 ipCNS = NULL;
00459     hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG_PTR*)&ipCNS );
00460     pNode->m_SDI.relativeID = m_SDI.ID;
00461     hResult = ipCNS->InsertItem( &pNode->m_SDI );
00462
00463     LPCONSOLE3 ipConsole3 = NULL;
00464     hResult = m_pCompData->GetInterface( REQUEST_ICONSOLE, (LONG_PTR*)&ipConsole3 );
00465     hResult = ipConsole3->SelectScopeItem( m_SDI.ID );
00466
00467   }while(0);
00468
00469   return hResult;
00470 }
00471
00472
00473 //---------------------------------------------------------------------------
00474 HRESULT CDeviceNode::OnCutOrMove
00475 (
00476   LPDATAOBJECT ipDataObject,   //[in] NULL
00477   LPARAM       nArg,           //[in] Pointer to the data object
00478   LPARAM       nParam,         //[in] Not used
00479   LONG_PTR     pComponent      //[in] Points to calling IComponent
00480 )
00481 {
00482   // Device nodes can't be Cut/Pasted to other nodes to we don't
00483   // need to handle this notification
00484
00485   return S_FALSE;
00486 }
00487
00488 /////////////////////////////////////////////////////////////////////////////
00489 //  Private Helpers
00490
00491 //---------------------------------------------------------------------------
00492 //  This is called by a child node to have itself removed from the list
00493 //  of child nodes.  The node itself is not deleted, the child node will
00494 //  delete itself when this function returns.
00495 //
00496 VOID CDeviceNode::RemoveChildNode
00497 (
00498   LONG_PTR   pChildNode      //[in] Node to delete from list
00499 )
00500 {
00501   CBaseNode* pNode  = NULL;
00502   CBaseNode* pChild = reinterpret_cast<CBaseNode*>(pChildNode);
00503   POSITION   NewPos = m_NodeList.GetHeadPosition();
00504   POSITION   OldPos = NULL;
00505   while( NewPos )
00506   {
00507     OldPos = NewPos;                   // Need to save this
00508     pNode = m_NodeList.GetNext( NewPos );
00509     if( pNode == pChild )
00510     {
00511       m_NodeList.RemoveAt( OldPos );
00512       continue;                        // Exit, found it
00513     }
00514   }
00515 }
00516
00517 /////////////////////////////////////////////////////////////////////////////
00518 //  Private Helpers
00519
00520 //---------------------------------------------------------------------------
00521 HRESULT CDeviceNode::DeleteChildItems
00522 (
00523   LPCONSOLENAMESPACE2 ipCNS    //[in] Needed to delete scope items
00524 )
00525 {
00526   _ASSERT( NULL != ipCNS );
00527
00528   POSITION    Pos     = m_NodeList.GetHeadPosition();
00529   HSCOPEITEM  hItem   = NULL;
00530   LPBASENODE  pNode   = NULL;
00531   HRESULT     hResult = S_FALSE;
00532
00533   while( Pos )                         // Delete everything...
00534   {
00535     pNode = m_NodeList.GetNext( Pos );
00536     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00537     if( 0 != hItem )
00538       hResult = ipCNS->DeleteItem( hItem, TRUE );
00539   }
00540
00541   return hResult;
00542 }
00543
00544
00545 //---------------------------------------------------------------------------
00546 HRESULT CDeviceNode::InsertChildItems
00547 (
00548   LPCONSOLENAMESPACE2 ipCNS      //[in] Needed to insert scope items
00549 )
00550 {
00551   _ASSERT( NULL != ipCNS );
00552   _ASSERT( NULL != m_hParentNode );
00553
00554   HRESULT    hResult = S_FALSE;
00555   POSITION   Pos     = m_NodeList.GetHeadPosition();
00556   LPBASENODE pNode   = NULL;
00557
00558   Pos = m_NodeList.GetHeadPosition();
00559   while( Pos )
00560   {
00561     pNode   = m_NodeList.GetNext( Pos );
00562     pNode->m_SDI.relativeID = m_hParentNode;
00563     hResult = ipCNS->InsertItem( &pNode->m_SDI );
00564   }
00565
00566   return hResult;
00567 }
00568
00569 //---------------------------------------------------------------------------
00570 //  Only add one default child node in this sample
00571 //
00572 HRESULT CDeviceNode::InitDefaultFolder()
00573 {
00574   NODEPROPS NodeProps;
00575   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00576   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00577   NodeProps.dwAttributes   = 0;
00578   NodeProps.nChildCount    = INIT_DEFAULT_NODE;
00579
00580   RemoveNodes();             // Clean the node list
00581
00582   LPBASENODE pNode = NULL;
00583   wcscpy( NodeProps.szNodeName, gwszFOLDER_NODE_NAME );
00584   pNode = new CFolderNode;
00585   pNode->Initialize( &NodeProps );
00586   m_NodeList.AddTail( pNode );
00587
00588   return S_OK;
00589 }
00590
00591 //---------------------------------------------------------------------------
00592 //  We do this instead of just calling RemoveAll() because our list contains
00593 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00594 //  the derived class object.
00595 //
00596 VOID CDeviceNode::RemoveNodes()
00597 {
00598   LPBASENODE pNode = NULL;
00599   POSITION   Pos   = m_NodeList.GetHeadPosition();
00600   while( Pos )
00601   {
00602     pNode = m_NodeList.GetNext( Pos );
00603     delete pNode;
00604   }
00605   m_NodeList.RemoveAll();              // Clean the list
00606 }
00607
00608 /////////////////////////////////////////////////////////////////////////////
00609 //  Public helpers
00610
00611 //---------------------------------------------------------------------------
00612 VOID CDeviceNode::ToggleStatus()
00613 {
00614   // First we have to set the image indexes according to the Online Status
00615   // and the device type
00616   //
00617   if( STATUS_ONLINE == m_bOnlineStatus )
00618   {
00619     m_bOnlineStatus = STATUS_OFFLINE;
00620     m_wzStatus      = L"Offline";
00621     if( m_dwAttributes & ATTRIBUTE_BACKUP_DEVICE )
00622     {
00623       m_SDI.nImage      = IMG_DEVICE_OFFLINE;
00624       m_SDI.nOpenImage  = IMG_DEVICE_OFFLINE;
00625     }
00626     else
00627     {
00628       m_SDI.nImage      = IMG_DRIVE_OFFLINE;
00629       m_SDI.nOpenImage  = IMG_DRIVE_OFFLINE;
00630     }
00631   }
00632   else
00633   {
00634     m_bOnlineStatus = STATUS_ONLINE;
00635     m_wzStatus      = L"Online";
00636     if( m_dwAttributes & ATTRIBUTE_BACKUP_DEVICE )
00637     {
00638       m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00639       m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00640     }
00641     else
00642     {
00643       m_SDI.nImage      = IMG_DRIVE_DEFAULT;
00644       m_SDI.nOpenImage  = IMG_DRIVE_DEFAULT;
00645     }
00646   }
00647   // This is a scope node, so GetDisplayInfo will only ask for images for
00648   // this node when it is in the Result Pane.  To change the image for the
00649   // the Scope Pane we need to call IConsoleNameSpace2::SetItem().  This
00650   // call forces the scope node to be redrawn.
00651   //
00652   SCOPEDATAITEM  sdi;
00653   ZeroMemory( &sdi, sizeof(SCOPEDATAITEM) );
00654   sdi.mask        = SDI_IMAGE | SDI_OPENIMAGE ;
00655   sdi.ID          = m_SDI.ID;
00656   sdi.nImage      = m_SDI.nImage;
00657   sdi.nOpenImage  = m_SDI.nOpenImage;
00658
00659   // Request an IConsoleNameSpace2 pointer from CComponentData
00660   HRESULT  hResult = S_FALSE;
00661   LPCONSOLENAMESPACE2 ipCNS = NULL;
00662   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE, (LONG*)&ipCNS );
00663   if( S_OK == hResult )
00664     hResult = ipCNS->SetItem( &sdi );
00665
00666 }
00667
00668
00669 /////////////////////////////////////////////////////////////////////////////
00670 //  Support for Context Menus
00671
00672 //---------------------------------------------------------------------------
00673 //  Devices can only add a folder
00674 //
00675 HRESULT CDeviceNode::AddMenuItems
00676 (
00677   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00678   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00679 )
00680 {
00681   _ASSERT( NULL != ipCallback );
00682   HRESULT hResult = S_FALSE;
00683
00684   static CONTEXTMENUITEM ctxMenu[2];
00685     ctxMenu[0].lCommandID        = IDM_NEW_FOLDER;
00686     ctxMenu[0].lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00687     ctxMenu[0].fFlags            = MF_GRAYED;
00688     ctxMenu[0].fSpecialFlags     = 0;
00689     ctxMenu[0].strName           = L"New Folder...";
00690     ctxMenu[0].strStatusBarText  = L"Add a new folder";
00691
00692     ctxMenu[1].lCommandID        = IDM_TOGGLE_STATUS;
00693     ctxMenu[1].lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_TASK;
00694     ctxMenu[1].fFlags            = 0;
00695     ctxMenu[1].fSpecialFlags     = 0;
00696     ctxMenu[1].strName           = L"Toggle Online Status";
00697     ctxMenu[1].strStatusBarText  = L"Toggles the device status";
00698
00699
00700   // Add the Add new folder command
00701   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00702   {
00703     hResult = ipCallback->AddItem( &ctxMenu[0] );
00704   }
00705
00706   // Add the Toggle item to the Task menu if allowed...
00707   if( CCM_INSERTIONALLOWED_TOP & *pInsertionAllowed )
00708   {
00709     hResult = ipCallback->AddItem( &ctxMenu[1] );
00710   }
00711
00712   return hResult;
00713 }
00714
00715 //---------------------------------------------------------------------------
00716 HRESULT CDeviceNode::Command
00717 (
00718   long lCommandID          //[in] Indentifier for menu ID
00719 )
00720 {
00721   HRESULT hResult = S_OK;
00722
00723   switch( lCommandID )
00724   {
00725     case IDM_TOGGLE_STATUS:
00726     {
00727       ToggleStatus();
00728       break;
00729     }
00730     case IDM_NEW_FOLDER:
00731     {
00732       // Not handling this command in this sample
00733       break;
00734     }
00735     default:
00736       hResult = S_FALSE;
00737       break;
00738
00739   }
00740   return hResult;
00741 }
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCreateTable Member List

This is the complete list of members for CCreateTable, including all inherited members.
CCreateTable() | CCreateTable | [inline]
CreateAccount() | CCreateTable |
InterfaceSupportsErrorInfo(REFIID riid) | CCreateTable |
Generated on Wed Nov 13 2024 16:55:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/PersistATL/resource.h Source File

  • Com
  • Services
  • Events
  • EventNews
  • PersistATL

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by PersistATL.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_NEWSEVENT                   101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/ADO/shell/adovbs.inc Source File

  • Dataaccess
  • ADO
  • shell

adovbs.inc

Go to the documentation of this file.
00001 <%
00002 '--------------------------------------------------------------------
00003 ' Microsoft ADO
00004 '
00005 ' Copyright (c) 1996-1998 Microsoft Corporation.
00006 '
00007 '
00008 '
00009 ' ADO constants include file for VBScript
00010 '
00011 '--------------------------------------------------------------------
00012
00013 '---- CursorTypeEnum Values ----
00014 Const adOpenForwardOnly = 0
00015 Const adOpenKeyset = 1
00016 Const adOpenDynamic = 2
00017 Const adOpenStatic = 3
00018
00019 '---- CursorOptionEnum Values ----
00020 Const adHoldRecords = &H00000100
00021 Const adMovePrevious = &H00000200
00022 Const adAddNew = &H01000400
00023 Const adDelete = &H01000800
00024 Const adUpdate = &H01008000
00025 Const adBookmark = &H00002000
00026 Const adApproxPosition = &H00004000
00027 Const adUpdateBatch = &H00010000
00028 Const adResync = &H00020000
00029 Const adNotify = &H00040000
00030 Const adFind = &H00080000
00031 Const adSeek = &H00400000
00032 Const adIndex = &H00800000
00033
00034 '---- LockTypeEnum Values ----
00035 Const adLockReadOnly = 1
00036 Const adLockPessimistic = 2
00037 Const adLockOptimistic = 3
00038 Const adLockBatchOptimistic = 4
00039
00040 '---- ExecuteOptionEnum Values ----
00041 Const adAsyncExecute = &H00000010
00042 Const adAsyncFetch = &H00000020
00043 Const adAsyncFetchNonBlocking = &H00000040
00044 Const adExecuteNoRecords = &H00000080
00045 Const adExecuteStream = &H00000400
00046
00047 '---- ConnectOptionEnum Values ----
00048 Const adAsyncConnect = &H00000010
00049
00050 '---- ObjectStateEnum Values ----
00051 Const adStateClosed = &H00000000
00052 Const adStateOpen = &H00000001
00053 Const adStateConnecting = &H00000002
00054 Const adStateExecuting = &H00000004
00055 Const adStateFetching = &H00000008
00056
00057 '---- CursorLocationEnum Values ----
00058 Const adUseServer = 2
00059 Const adUseClient = 3
00060
00061 '---- DataTypeEnum Values ----
00062 Const adEmpty = 0
00063 Const adTinyInt = 16
00064 Const adSmallInt = 2
00065 Const adInteger = 3
00066 Const adBigInt = 20
00067 Const adUnsignedTinyInt = 17
00068 Const adUnsignedSmallInt = 18
00069 Const adUnsignedInt = 19
00070 Const adUnsignedBigInt = 21
00071 Const adSingle = 4
00072 Const adDouble = 5
00073 Const adCurrency = 6
00074 Const adDecimal = 14
00075 Const adNumeric = 131
00076 Const adBoolean = 11
00077 Const adError = 10
00078 Const adUserDefined = 132
00079 Const adVariant = 12
00080 Const adIDispatch = 9
00081 Const adIUnknown = 13
00082 Const adGUID = 72
00083 Const adDate = 7
00084 Const adDBDate = 133
00085 Const adDBTime = 134
00086 Const adDBTimeStamp = 135
00087 Const adBSTR = 8
00088 Const adChar = 129
00089 Const adVarChar = 200
00090 Const adLongVarChar = 201
00091 Const adWChar = 130
00092 Const adVarWChar = 202
00093 Const adLongVarWChar = 203
00094 Const adBinary = 128
00095 Const adVarBinary = 204
00096 Const adLongVarBinary = 205
00097 Const adChapter = 136
00098 Const adFileTime = 64
00099 Const adPropVariant = 138
00100 Const adVarNumeric = 139
00101 Const adArray = &H2000
00102
00103 '---- FieldAttributeEnum Values ----
00104 Const adFldMayDefer = &H00000002
00105 Const adFldUpdatable = &H00000004
00106 Const adFldUnknownUpdatable = &H00000008
00107 Const adFldFixed = &H00000010
00108 Const adFldIsNullable = &H00000020
00109 Const adFldMayBeNull = &H00000040
00110 Const adFldLong = &H00000080
00111 Const adFldRowID = &H00000100
00112 Const adFldRowVersion = &H00000200
00113 Const adFldCacheDeferred = &H00001000
00114 Const adFldIsChapter = &H00002000
00115 Const adFldNegativeScale = &H00004000
00116 Const adFldKeyColumn = &H00008000
00117 Const adFldIsRowURL = &H00010000
00118 Const adFldIsDefaultStream = &H00020000
00119 Const adFldIsCollection = &H00040000
00120
00121 '---- EditModeEnum Values ----
00122 Const adEditNone = &H0000
00123 Const adEditInProgress = &H0001
00124 Const adEditAdd = &H0002
00125 Const adEditDelete = &H0004
00126
00127 '---- RecordStatusEnum Values ----
00128 Const adRecOK = &H0000000
00129 Const adRecNew = &H0000001
00130 Const adRecModified = &H0000002
00131 Const adRecDeleted = &H0000004
00132 Const adRecUnmodified = &H0000008
00133 Const adRecInvalid = &H0000010
00134 Const adRecMultipleChanges = &H0000040
00135 Const adRecPendingChanges = &H0000080
00136 Const adRecCanceled = &H0000100
00137 Const adRecCantRelease = &H0000400
00138 Const adRecConcurrencyViolation = &H0000800
00139 Const adRecIntegrityViolation = &H0001000
00140 Const adRecMaxChangesExceeded = &H0002000
00141 Const adRecObjectOpen = &H0004000
00142 Const adRecOutOfMemory = &H0008000
00143 Const adRecPermissionDenied = &H0010000
00144 Const adRecSchemaViolation = &H0020000
00145 Const adRecDBDeleted = &H0040000
00146
00147 '---- GetRowsOptionEnum Values ----
00148 Const adGetRowsRest = -1
00149
00150 '---- PositionEnum Values ----
00151 Const adPosUnknown = -1
00152 Const adPosBOF = -2
00153 Const adPosEOF = -3
00154
00155 '---- BookmarkEnum Values ----
00156 Const adBookmarkCurrent = 0
00157 Const adBookmarkFirst = 1
00158 Const adBookmarkLast = 2
00159
00160 '---- MarshalOptionsEnum Values ----
00161 Const adMarshalAll = 0
00162 Const adMarshalModifiedOnly = 1
00163
00164 '---- AffectEnum Values ----
00165 Const adAffectCurrent = 1
00166 Const adAffectGroup = 2
00167 Const adAffectAllChapters = 4
00168
00169 '---- ResyncEnum Values ----
00170 Const adResyncUnderlyingValues = 1
00171 Const adResyncAllValues = 2
00172
00173 '---- CompareEnum Values ----
00174 Const adCompareLessThan = 0
00175 Const adCompareEqual = 1
00176 Const adCompareGreaterThan = 2
00177 Const adCompareNotEqual = 3
00178 Const adCompareNotComparable = 4
00179
00180 '---- FilterGroupEnum Values ----
00181 Const adFilterNone = 0
00182 Const adFilterPendingRecords = 1
00183 Const adFilterAffectedRecords = 2
00184 Const adFilterFetchedRecords = 3
00185 Const adFilterConflictingRecords = 5
00186
00187 '---- SearchDirectionEnum Values ----
00188 Const adSearchForward = 1
00189 Const adSearchBackward = -1
00190
00191 '---- PersistFormatEnum Values ----
00192 Const adPersistADTG = 0
00193 Const adPersistXML = 1
00194
00195 '---- StringFormatEnum Values ----
00196 Const adClipString = 2
00197
00198 '---- ConnectPromptEnum Values ----
00199 Const adPromptAlways = 1
00200 Const adPromptComplete = 2
00201 Const adPromptCompleteRequired = 3
00202 Const adPromptNever = 4
00203
00204 '---- ConnectModeEnum Values ----
00205 Const adModeUnknown = 0
00206 Const adModeRead = 1
00207 Const adModeWrite = 2
00208 Const adModeReadWrite = 3
00209 Const adModeShareDenyRead = 4
00210 Const adModeShareDenyWrite = 8
00211 Const adModeShareExclusive = &Hc
00212 Const adModeShareDenyNone = &H10
00213 Const adModeRecursive = &H400000
00214
00215 '---- RecordCreateOptionsEnum Values ----
00216 Const adCreateCollection = &H00002000
00217 Const adCreateStructDoc = &H80000000
00218 Const adCreateNonCollection = &H00000000
00219 Const adOpenIfExists = &H02000000
00220 Const adCreateOverwrite = &H04000000
00221 Const adFailIfNotExists = -1
00222
00223 '---- RecordOpenOptionsEnum Values ----
00224 Const adOpenRecordUnspecified = -1
00225 Const adOpenSource = &H00800000
00226 Const adOpenAsync = &H00001000
00227 Const adDelayFetchStream = &H00004000
00228 Const adDelayFetchFields = &H00008000
00229 Const adOpenExecuteCommand = &H00010000
00230
00231 '---- IsolationLevelEnum Values ----
00232 Const adXactUnspecified = &Hffffffff
00233 Const adXactChaos = &H00000010
00234 Const adXactReadUncommitted = &H00000100
00235 Const adXactBrowse = &H00000100
00236 Const adXactCursorStability = &H00001000
00237 Const adXactReadCommitted = &H00001000
00238 Const adXactRepeatableRead = &H00010000
00239 Const adXactSerializable = &H00100000
00240 Const adXactIsolated = &H00100000
00241
00242 '---- XactAttributeEnum Values ----
00243 Const adXactCommitRetaining = &H00020000
00244 Const adXactAbortRetaining = &H00040000
00245
00246 '---- PropertyAttributesEnum Values ----
00247 Const adPropNotSupported = &H0000
00248 Const adPropRequired = &H0001
00249 Const adPropOptional = &H0002
00250 Const adPropRead = &H0200
00251 Const adPropWrite = &H0400
00252
00253 '---- ErrorValueEnum Values ----
00254 Const adErrProviderFailed = &Hbb8
00255 Const adErrInvalidArgument = &Hbb9
00256 Const adErrOpeningFile = &Hbba
00257 Const adErrReadFile = &Hbbb
00258 Const adErrWriteFile = &Hbbc
00259 Const adErrNoCurrentRecord = &Hbcd
00260 Const adErrIllegalOperation = &Hc93
00261 Const adErrCantChangeProvider = &Hc94
00262 Const adErrInTransaction = &Hcae
00263 Const adErrFeatureNotAvailable = &Hcb3
00264 Const adErrItemNotFound = &Hcc1
00265 Const adErrObjectInCollection = &Hd27
00266 Const adErrObjectNotSet = &Hd5c
00267 Const adErrDataConversion = &Hd5d
00268 Const adErrObjectClosed = &He78
00269 Const adErrObjectOpen = &He79
00270 Const adErrProviderNotFound = &He7a
00271 Const adErrBoundToCommand = &He7b
00272 Const adErrInvalidParamInfo = &He7c
00273 Const adErrInvalidConnection = &He7d
00274 Const adErrNotReentrant = &He7e
00275 Const adErrStillExecuting = &He7f
00276 Const adErrOperationCancelled = &He80
00277 Const adErrStillConnecting = &He81
00278 Const adErrInvalidTransaction = &He82
00279 Const adErrUnsafeOperation = &He84
00280 Const adwrnSecurityDialog = &He85
00281 Const adwrnSecurityDialogHeader = &He86
00282 Const adErrIntegrityViolation = &He87
00283 Const adErrPermissionDenied = &He88
00284 Const adErrDataOverflow = &He89
00285 Const adErrSchemaViolation = &He8a
00286 Const adErrSignMismatch = &He8b
00287 Const adErrCantConvertvalue = &He8c
00288 Const adErrCantCreate = &He8d
00289 Const adErrColumnNotOnThisRow = &He8e
00290 Const adErrURLIntegrViolSetColumns = &He8f
00291 Const adErrURLDoesNotExist = &He8f
00292 Const adErrTreePermissionDenied = &He90
00293 Const adErrInvalidURL = &He91
00294 Const adErrResourceLocked = &He92
00295 Const adErrResourceExists = &He93
00296 Const adErrCannotComplete = &He94
00297 Const adErrVolumeNotFound = &He95
00298 Const adErrOutOfSpace = &He96
00299 Const adErrResourceOutOfScope = &He97
00300 Const adErrUnavailable = &He98
00301 Const adErrURLNamedRowDoesNotExist = &He99
00302 Const adErrDelResOutOfScope = &He9a
00303 Const adErrPropInvalidColumn = &He9b
00304 Const adErrPropInvalidOption = &He9c
00305 Const adErrPropInvalidValue = &He9d
00306 Const adErrPropConflicting = &He9e
00307 Const adErrPropNotAllSettable = &He9f
00308 Const adErrPropNotSet = &Hea0
00309 Const adErrPropNotSettable = &Hea1
00310 Const adErrPropNotSupported = &Hea2
00311 Const adErrCatalogNotSet = &Hea3
00312 Const adErrCantChangeConnection = &Hea4
00313 Const adErrFieldsUpdateFailed = &Hea5
00314 Const adErrDenyNotSupported = &Hea6
00315 Const adErrDenyTypeNotSupported = &Hea7
00316
00317 '---- ParameterAttributesEnum Values ----
00318 Const adParamSigned = &H0010
00319 Const adParamNullable = &H0040
00320 Const adParamLong = &H0080
00321
00322 '---- ParameterDirectionEnum Values ----
00323 Const adParamUnknown = &H0000
00324 Const adParamInput = &H0001
00325 Const adParamOutput = &H0002
00326 Const adParamInputOutput = &H0003
00327 Const adParamReturnValue = &H0004
00328
00329 '---- CommandTypeEnum Values ----
00330 Const adCmdUnknown = &H0008
00331 Const adCmdText = &H0001
00332 Const adCmdTable = &H0002
00333 Const adCmdStoredProc = &H0004
00334 Const adCmdFile = &H0100
00335 Const adCmdTableDirect = &H0200
00336
00337 '---- EventStatusEnum Values ----
00338 Const adStatusOK = &H0000001
00339 Const adStatusErrorsOccurred = &H0000002
00340 Const adStatusCantDeny = &H0000003
00341 Const adStatusCancel = &H0000004
00342 Const adStatusUnwantedEvent = &H0000005
00343
00344 '---- EventReasonEnum Values ----
00345 Const adRsnAddNew = 1
00346 Const adRsnDelete = 2
00347 Const adRsnUpdate = 3
00348 Const adRsnUndoUpdate = 4
00349 Const adRsnUndoAddNew = 5
00350 Const adRsnUndoDelete = 6
00351 Const adRsnRequery = 7
00352 Const adRsnResynch = 8
00353 Const adRsnClose = 9
00354 Const adRsnMove = 10
00355 Const adRsnFirstChange = 11
00356 Const adRsnMoveFirst = 12
00357 Const adRsnMoveNext = 13
00358 Const adRsnMovePrevious = 14
00359 Const adRsnMoveLast = 15
00360
00361 '---- SchemaEnum Values ----
00362 Const adSchemaProviderSpecific = -1
00363 Const adSchemaAsserts = 0
00364 Const adSchemaCatalogs = 1
00365 Const adSchemaCharacterSets = 2
00366 Const adSchemaCollations = 3
00367 Const adSchemaColumns = 4
00368 Const adSchemaCheckConstraints = 5
00369 Const adSchemaConstraintColumnUsage = 6
00370 Const adSchemaConstraintTableUsage = 7
00371 Const adSchemaKeyColumnUsage = 8
00372 Const adSchemaReferentialConstraints = 9
00373 Const adSchemaTableConstraints = 10
00374 Const adSchemaColumnsDomainUsage = 11
00375 Const adSchemaIndexes = 12
00376 Const adSchemaColumnPrivileges = 13
00377 Const adSchemaTablePrivileges = 14
00378 Const adSchemaUsagePrivileges = 15
00379 Const adSchemaProcedures = 16
00380 Const adSchemaSchemata = 17
00381 Const adSchemaSQLLanguages = 18
00382 Const adSchemaStatistics = 19
00383 Const adSchemaTables = 20
00384 Const adSchemaTranslations = 21
00385 Const adSchemaProviderTypes = 22
00386 Const adSchemaViews = 23
00387 Const adSchemaViewColumnUsage = 24
00388 Const adSchemaViewTableUsage = 25
00389 Const adSchemaProcedureParameters = 26
00390 Const adSchemaForeignKeys = 27
00391 Const adSchemaPrimaryKeys = 28
00392 Const adSchemaProcedureColumns = 29
00393 Const adSchemaDBInfoKeywords = 30
00394 Const adSchemaDBInfoLiterals = 31
00395 Const adSchemaCubes = 32
00396 Const adSchemaDimensions = 33
00397 Const adSchemaHierarchies = 34
00398 Const adSchemaLevels = 35
00399 Const adSchemaMeasures = 36
00400 Const adSchemaProperties = 37
00401 Const adSchemaMembers = 38
00402 Const adSchemaTrustees = 39
00403
00404 '---- FieldStatusEnum Values ----
00405 Const adFieldOK = 0
00406 Const adFieldCantConvertValue = 2
00407 Const adFieldIsNull = 3
00408 Const adFieldTruncated = 4
00409 Const adFieldSignMismatch = 5
00410 Const adFieldDataOverflow = 6
00411 Const adFieldCantCreate = 7
00412 Const adFieldUnavailable = 8
00413 Const adFieldPermissionDenied = 9
00414 Const adFieldIntegrityViolation = 10
00415 Const adFieldSchemaViolation = 11
00416 Const adFieldBadStatus = 12
00417 Const adFieldDefault = 13
00418 Const adFieldIgnore = 15
00419 Const adFieldDoesNotExist = 16
00420 Const adFieldInvalidURL = 17
00421 Const adFieldResourceLocked = 18
00422 Const adFieldResourceExists = 19
00423 Const adFieldCannotComplete = 20
00424 Const adFieldVolumeNotFound = 21
00425 Const adFieldOutOfSpace = 22
00426 Const adFieldCannotDeleteSource = 23
00427 Const adFieldReadOnly = 24
00428 Const adFieldResourceOutOfScope = 25
00429 Const adFieldAlreadyExists = 26
00430 Const adFieldPendingInsert = &H10000
00431 Const adFieldPendingDelete = &H20000
00432 Const adFieldPendingChange = &H40000
00433 Const adFieldPendingUnknown = &H80000
00434 Const adFieldPendingUnknownDelete = &H100000
00435
00436 '---- SeekEnum Values ----
00437 Const adSeekFirstEQ = &H1
00438 Const adSeekLastEQ = &H2
00439 Const adSeekAfterEQ = &H4
00440 Const adSeekAfter = &H8
00441 Const adSeekBeforeEQ = &H10
00442 Const adSeekBefore = &H20
00443
00444 '---- ADCPROP_UPDATECRITERIA_ENUM Values ----
00445 Const adCriteriaKey = 0
00446 Const adCriteriaAllCols = 1
00447 Const adCriteriaUpdCols = 2
00448 Const adCriteriaTimeStamp = 3
00449
00450 '---- ADCPROP_ASYNCTHREADPRIORITY_ENUM Values ----
00451 Const adPriorityLowest = 1
00452 Const adPriorityBelowNormal = 2
00453 Const adPriorityNormal = 3
00454 Const adPriorityAboveNormal = 4
00455 Const adPriorityHighest = 5
00456
00457 '---- ADCPROP_AUTORECALC_ENUM Values ----
00458 Const adRecalcUpFront = 0
00459 Const adRecalcAlways = 1
00460
00461 '---- ADCPROP_UPDATERESYNC_ENUM Values ----
00462
00463 '---- ADCPROP_UPDATERESYNC_ENUM Values ----
00464
00465 '---- MoveRecordOptionsEnum Values ----
00466 Const adMoveUnspecified = -1
00467 Const adMoveOverWrite = 1
00468 Const adMoveDontUpdateLinks = 2
00469 Const adMoveAllowEmulation = 4
00470
00471 '---- CopyRecordOptionsEnum Values ----
00472 Const adCopyUnspecified = -1
00473 Const adCopyOverWrite = 1
00474 Const adCopyAllowEmulation = 4
00475 Const adCopyNonRecursive = 2
00476
00477 '---- StreamTypeEnum Values ----
00478 Const adTypeBinary = 1
00479 Const adTypeText = 2
00480
00481 '---- LineSeparatorEnum Values ----
00482 Const adLF = 10
00483 Const adCR = 13
00484 Const adCRLF = -1
00485
00486 '---- StreamOpenOptionsEnum Values ----
00487 Const adOpenStreamUnspecified = -1
00488 Const adOpenStreamAsync = 1
00489 Const adOpenStreamFromRecord = 4
00490
00491 '---- StreamWriteEnum Values ----
00492 Const adWriteChar = 0
00493 Const adWriteLine = 1
00494
00495 '---- SaveOptionsEnum Values ----
00496 Const adSaveCreateNotExist = 1
00497 Const adSaveCreateOverWrite = 2
00498
00499 '---- FieldEnum Values ----
00500 Const adDefaultStream = -1
00501 Const adRecordURL = -2
00502
00503 '---- StreamReadEnum Values ----
00504 Const adReadAll = -1
00505 Const adReadLine = -2
00506
00507 '---- RecordTypeEnum Values ----
00508 Const adSimpleRecord = 0
00509 Const adCollectionRecord = 1
00510 Const adStructDoc = 2
00511 %>
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditFeatures/EdCommands.idl Source File

  • Web
  • Browser
  • EditFeatures

EdCommands.idl

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // EdCommands.idl : IDL source for EdCommands.dll
00006 //
00007
00008 // This file will be processed by the MIDL tool to
00009 // produce the type library (EdCommands.tlb) and marshalling code.
00010 #define DISPID_GETHWND   500
00011
00012 import "oaidl.idl";
00013 import "ocidl.idl";
00014
00015   [
00016     object,
00017     uuid(5FD6158A-71F6-4F20-B8A9-6EAF5D032D15),
00018     dual,
00019     helpstring("IBrowserHost Interface"),
00020     pointer_default(unique)
00021   ]
00022   interface IBrowserHost : IDispatch
00023   {
00024     HRESULT Run();
00025     HRESULT Stop();
00026     [id(DISPID_GETHWND), helpstring("method GetHWND")] HRESULT GetHwnd(long* phwnd);
00027   };
00028   [
00029     object,
00030     uuid(CCBFDE40-FE5D-4A3C-880B-47839715E3AC),
00031     dual,
00032     helpstring("ISnap Interface"),
00033     pointer_default(unique)
00034   ]
00035   interface ISnap : IDispatch
00036   {
00037     HRESULT GetSnapOn(LONG* lIsOn);
00038     HRESULT SetSnapOn(LONG lIsOn);
00039   };
00040
00041 [
00042   uuid(77562D86-6956-4863-AA6D-2646344624EE),
00043   version(1.0),
00044   helpstring("EdCommands 1.0 Type Library")
00045 ]
00046 library EDCOMMANDSLib
00047 {
00048   importlib("stdole32.tlb");
00049   importlib("stdole2.tlb");
00050
00051   [
00052     uuid(2A2B21D5-F43B-4EA0-9DFA-1EFE9F9E211A),
00053     helpstring("BrowserHost Class")
00054   ]
00055   coclass BrowserHost
00056   {
00057     [default] interface IBrowserHost;
00058   };
00059 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/Simple/Simple.Cpp Source File

  • Web
  • iis
  • Components
  • Cpp
  • Simple

Simple.Cpp

Go to the documentation of this file.
00001 // Simple.cpp : Implementation of CSimple
00002
00003 #include "stdafx.h"
00004 #include "CATLSmpl.h"
00005 #include "Simple.h"
00006
00007 STDMETHODIMP CSimple::InterfaceSupportsErrorInfo(REFIID riid)
00008 {
00009     static const IID* arr[] =
00010     {
00011         &IID_ISimple,
00012     };
00013
00014     for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
00015     {
00016         if (InlineIsEqualGUID(*arr[i],riid))
00017             return S_OK;
00018     }
00019     return S_FALSE;
00020 }
00021
00022 CSimple::CSimple()
00023     : m_bstrMyProperty(OLESTR("C++ ATL Simple Component"))
00024 {}
00025
00026 //Put function for myProperty
00027
00028 STDMETHODIMP CSimple::put_myProperty(BSTR bstrInValue)
00029 {
00030     if (bstrInValue == NULL)
00031         return E_POINTER;
00032
00033     m_bstrMyProperty = bstrInValue;
00034
00035     return S_OK;
00036 }
00037
00038 //Get function for myProperty
00039
00040 STDMETHODIMP CSimple::get_myProperty(BSTR *pbstrOutValue)
00041 {
00042     if (pbstrOutValue == NULL)
00043         return E_POINTER;
00044
00045     // Get Value from Property
00046
00047     *pbstrOutValue = m_bstrMyProperty.Copy();
00048
00049     return S_OK;
00050 }
00051
00052 //Basic Method to convert a string to uppercase
00053
00054 STDMETHODIMP CSimple::myMethod(BSTR bstrIn, BSTR *pbstrOut)
00055 {
00056     if (bstrIn == NULL || pbstrOut == NULL)
00057         return E_POINTER;
00058
00059     // Create a temporary CComBSTR
00060
00061     CComBSTR bstrTemp(bstrIn);
00062
00063     if (!bstrTemp)
00064         return E_OUTOFMEMORY;
00065
00066     // Make string uppercase
00067
00068     wcsupr(bstrTemp);
00069
00070     // Return m_str member of bstrTemp
00071
00072     *pbstrOut = bstrTemp.Detach();
00073
00074     return S_OK;
00075 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/serviceconfig/iplisten.c Source File

  • NetDS
  • http
  • serviceconfig

iplisten.c

Go to the documentation of this file.
00001 /*++
00002  Copyright (c) 2002 - 2002 Microsoft Corporation.  All Rights Reserved.
00003
00004  THIS CODE AND INFORMATION IS PROVIDED "AS-IS" WITHOUT WARRANTY OF
00005  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007  PARTICULAR PURPOSE.
00008
00009  THIS CODE IS NOT SUPPORTED BY MICROSOFT.
00010
00011 --*/
00012
00013 #include "precomp.h"
00014 #pragma hdrstop
00015
00016 //
00017 // Private functions.
00018 //
00019
00020 /***************************************************************************++
00021
00022 Routine Description:
00023     Prints a record in the IP Listen store.
00024
00025 Arguments:
00026     pOutput - A pointer to HTTP_SERVICE_CONFIG_URLACL_SET
00027
00028 Return Value:
00029     None.
00030
00031 --***************************************************************************/
00032 void
00033 PrintIpListenRecords(
00034     IN PUCHAR pOutput
00035     )
00036 {
00037     PHTTP_SERVICE_CONFIG_IP_LISTEN_QUERY pListenQuery;
00038     ULONG                                i;
00039     DWORD                                Status = NO_ERROR;
00040
00041     pListenQuery = (PHTTP_SERVICE_CONFIG_IP_LISTEN_QUERY) pOutput;
00042
00043     for(i=0; i<pListenQuery->AddrCount; i++)
00044     {
00045         DWORD        dwSockAddrLength;
00046         WCHAR        IpAddr[MAX_PATH];
00047         DWORD        dwIpAddrLen;
00048         PSOCKADDR_IN pSockAddrIn;
00049
00050         dwIpAddrLen = MAX_PATH * sizeof(WCHAR);
00051
00052         pSockAddrIn = (PSOCKADDR_IN)
00053                     &pListenQuery->AddrList[i];
00054
00055         // Convert address to string.
00056         //
00057
00058         if(pSockAddrIn->sin_family == AF_INET)
00059         {
00060             dwSockAddrLength = sizeof(SOCKADDR_IN);
00061         }
00062         else if(pSockAddrIn->sin_family == AF_INET6)
00063         {
00064             dwSockAddrLength = sizeof(SOCKADDR_IN6);
00065         }
00066         else
00067         {
00068             Status = ERROR_REGISTRY_CORRUPT;
00069             break;
00070         }
00071
00072         Status = WSAAddressToString(
00073                             (LPSOCKADDR)&pListenQuery->AddrList[i],
00074                             dwSockAddrLength,
00075                             NULL,
00076                             (LPWSTR) IpAddr,
00077                             &dwIpAddrLen
00078                             );
00079
00080         if(SOCKET_ERROR == Status)
00081         {
00082             Status = WSAGetLastError();
00083             break;
00084         }
00085         else
00086         {
00087             NlsPutMsg(
00088                     HTTPCFG_SSL_IP,
00089                     IpAddr
00090                     );
00091
00092             NlsPutMsg(
00093                     HTTPCFG_RECORD_SEPARATOR
00094                     );
00095         }
00096     }
00097
00098     return;
00099 }
00100
00101 /***************************************************************************++
00102
00103 Routine Description:
00104     Sets an IP Listen entry
00105
00106 Arguments:
00107     pIp - IP address to set.
00108
00109 Return Value:
00110     Success/Failure.
00111
00112 --***************************************************************************/
00113 int DoIpSet(
00114     IN PWSTR pIp
00115     )
00116 {
00117     HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM SetParam;
00118     DWORD                               Status;
00119     SOCKADDR_STORAGE                    TempSockAddr;
00120
00121     // convert IP to a SOCKADDR.
00122     if((Status = GetAddress(pIp,
00123                             &TempSockAddr,
00124                             sizeof(TempSockAddr)
00125                             )) != NO_ERROR)
00126     {
00127         NlsPutMsg(HTTPCFG_INVALID_IP, pIp);
00128         return Status;
00129     }
00130
00131     SetParam.AddrLength = sizeof(TempSockAddr);
00132     SetParam.pAddress   = (LPSOCKADDR)&TempSockAddr;
00133
00134     // Call the API
00135     Status = HttpSetServiceConfiguration(
00136                 NULL,
00137                 HttpServiceConfigIPListenList,
00138                 (PVOID)&SetParam,
00139                 sizeof(SetParam),
00140                 NULL
00141                 );
00142
00143     NlsPutMsg(HTTPCFG_SETSERVICE_STATUS, Status);
00144
00145     return Status;
00146 }
00147
00148 /***************************************************************************++
00149
00150 Routine Description:
00151     Queries for a URL ACL entry.
00152
00153 Arguments:
00154     None.
00155
00156 Return Value:
00157     Success/Failure.
00158
00159 --***************************************************************************/
00160 int DoIpQuery(
00161     )
00162 {
00163     DWORD    Status;
00164     PUCHAR   pOutput = NULL;
00165     DWORD    OutputLength = 0;
00166     DWORD    ReturnLength = 0;
00167
00168     for(;;)
00169     {
00170         // First get the size of the output buffer that is required.
00171         //
00172         Status = HttpQueryServiceConfiguration(
00173                     NULL,
00174                     HttpServiceConfigIPListenList,
00175                     NULL,
00176                     0,
00177                     pOutput,
00178                     OutputLength,
00179                     &ReturnLength,
00180                     NULL
00181                     );
00182
00183         if(ERROR_INSUFFICIENT_BUFFER == Status)
00184         {
00185             // If the API completes with ERROR_INSUFFICIENT_BUFFER, we'll
00186             // allocate memory for it & continue with the loop where we'll
00187             // call it again.
00188
00189             if(pOutput)
00190             {
00191                 // If there was an existing buffer, free it.
00192                 LocalFree(pOutput);
00193             }
00194
00195             //
00196             // Allocate a new buffer.
00197             //
00198             pOutput = LocalAlloc(LMEM_FIXED, ReturnLength);
00199             if(!pOutput)
00200             {
00201                 return ERROR_NOT_ENOUGH_MEMORY;
00202             }
00203
00204             OutputLength = ReturnLength;
00205         }
00206         else if(NO_ERROR == Status)
00207         {
00208             PrintIpListenRecords(pOutput);
00209             break;
00210         }
00211         else
00212         {
00213             //
00214             // Some other error, so we are done
00215             //
00216             NlsPutMsg(HTTPCFG_QUERYSERVICE_STATUS, Status);
00217             break;
00218         }
00219     }
00220
00221     if(pOutput)
00222     {
00223         LocalFree(pOutput);
00224     }
00225
00226     return Status;
00227 }
00228
00229 int DoIpDelete(
00230     IN PWSTR pIp
00231     )
00232 {
00233     HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM SetParam;
00234     DWORD                               Status;
00235     SOCKADDR_STORAGE                    TempSockAddr;
00236
00237     if((Status = GetAddress(pIp,
00238                             &TempSockAddr,
00239                             sizeof(TempSockAddr)
00240                             )) != NO_ERROR)
00241     {
00242         NlsPutMsg(HTTPCFG_INVALID_IP, pIp);
00243         return Status;
00244     }
00245
00246     SetParam.AddrLength = sizeof(TempSockAddr);
00247     SetParam.pAddress   = (LPSOCKADDR) &TempSockAddr;
00248
00249     Status = HttpDeleteServiceConfiguration(
00250                 NULL,
00251                 HttpServiceConfigIPListenList,
00252                 (PVOID)&SetParam,
00253                 sizeof(SetParam),
00254                 NULL
00255                 );
00256
00257     NlsPutMsg(HTTPCFG_DELETESERVICE_STATUS, Status);
00258     return Status;
00259 }
00260
00261 //
00262 // Public function.
00263 //
00264
00265 int DoIpListen(
00266     int   argc,
00267     WCHAR **argv,
00268     HTTPCFG_TYPE Type
00269     )
00270 {
00271     PWCHAR   pIp = NULL;
00272
00273     while(argc>=2 && (argv[0][0] == '-' || argv[0][0]== '/'))
00274     {
00275         switch(toupper(argv[0][1]))
00276         {
00277             case 'I':
00278                 pIp = argv[1];
00279                 break;
00280
00281             default:
00282                 NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00283                 return ERROR_INVALID_PARAMETER;
00284         }
00285         argc -=2;
00286         argv +=2;
00287     }
00288
00289     switch(Type)
00290     {
00291         case HttpCfgTypeSet:
00292             return DoIpSet(pIp);
00293
00294         case HttpCfgTypeQuery:
00295             return DoIpQuery();
00296
00297         case HttpCfgTypeDelete:
00298             return DoIpDelete(pIp);
00299
00300         default:
00301             NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00302             return ERROR_INVALID_PARAMETER;
00303     }
00304 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/Resource.h Source File

  • WinUI
  • Resource
  • Iconpro

Resource.h

Go to the documentation of this file.
00001 // Used by ICONPRO.RC
00002 //
00003 #define IDS_PROGNAME                    1
00004 #define IDS_FILTERSTRING                1
00005 #define IDS_EXEFILTERSTRING             2
00006 #define IDS_BMPFILTERSTRING             3
00007 #define ID_F_MENUOPTION1                100
00008 #define ID_F_ABOUT                      101
00009 #define ID_F_EXIT                       102
00010 #define ICONPRO_MENU                    400
00011 #define ICONPRO_ICON                    401
00012 #define ICONPRO_ABOUT_DLG               402
00013 #define ICONPRO_ICON1                   402
00014 #define IDD_EXTRACTDLG                  404
00015 #define IDD_ADDFORMATDLG                409
00016 #define ID_FILE_NEW                     500
00017 #define ID_FILE_OPEN                    501
00018 #define ID_FILE_SAVE                    502
00019 #define ID_FILE_SAVEAS                  503
00020 #define ID_EDIT_COPY                    504
00021 #define ID_EDIT_PASTE                   505
00022 #define ID_EDIT_STRETCHPASTE            506
00023 #define ID_EDIT_ADDFORMAT               507
00024 #define ID_EDIT_REMOVEFORMAT            508
00025 #define ID_WINDOW_ARRANGEICONS          509
00026 #define ID_WINDOW_CASCADE               510
00027 #define ID_WINDOW_TILE                  511
00028 #define ID_HELP_ABOUT                   512
00029 #define ID_HELP_CONTENTS                513
00030 #define ID_FILE_CLOSE                   514
00031 #define ID_WINDOW_TILEVERTICAL          515
00032 #define ID_FILE_EXTRACT                 516
00033 #define ID_EDIT_IMPORTBMP               518
00034 #define ID_EDIT_STRETCHIMPORTBMP        519
00035 #define ID_EDIT_EXPORTBMP               520
00036 #define IDC_LIST1                       603
00037 #define IDC_DISPLAYICON                 605
00038 #define ID_WIDTHSLIDER                  609
00039 #define ID_HEIGHTSLIDER                 610
00040 #define ID_COLORSLIDER                  615
00041 #define ID_WIDTHTEXT                    616
00042 #define ID_HEIGHTTEXT                   617
00043 #define IDC_SQUAREONLY                  618
00044 #define IDM_WINDOWCHILD                 700
00045 #define ID_GETNUMFORMATS                701
00046 #define ID_UPDATETITLE                  703
00047 #define ID_HASFILECHANGED               705
00048 #define ID_COLORTEXT                    710
00049 #define IDC_DISPLAYBOX                  -1
00050 #define IDC_STATIC                      -1
00051
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Metafile/MfEdit/Precomp.h Source File

  • Multimedia
  • Gdi
  • Metafile
  • MfEdit

Precomp.h

Go to the documentation of this file.
00001 /******************************Module*Header*******************************\
00002 * Module Name: precomp.h
00003 *
00004 * Copyright (c) 1996 - 2000 Microsoft Corporation
00005 *
00006 \**************************************************************************/
00007 #include <stdlib.h>
00008 #include <windows.h>
00009 #include <string.h>
00010 #include <stdarg.h>
00011 #include <string.h>
00012 #include <tchar.h>
00013
00014 #ifdef JAPAN
00015 #define _MBCS
00016 #include <mbstring.h>
00017 #include <mbctype.h>
00018 //
00019 // Maybe this needs to be the last include
00020 //
00021 #include <ime.h>
00022 #define My_mbstok _mbstok // This may actually work for English as well
00023 #else
00024 #define My_mbstok strtok  // but just to be sure...
00025 #endif
00026
00027 #include <stdio.h>
00028 #include <commdlg.h>
00029 #include <shellapi.h>
00030 #include <math.h>
00031 #include <gl\glaux.h>
00032 #include <gl\gl.h>
00033 #include <gl\glu.h>
00034 #include "mfedit.h"
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/util.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

util.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       util.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #include "stdafx.h"
00012 #include "util.h"
00013
00014 ////////////////////////////////////////////////////////////////////
00015
00016 HRESULT _ClearAttribute(IADs* pIADs, BSTR bstrAttrName, BOOL bPostCommit)
00017 {
00018   ASSERT(pIADs != NULL);
00019   ASSERT(bstrAttrName != NULL);
00020   HRESULT hr = S_OK;
00021
00022   VARIANT varVal;
00023   ::VariantInit(&varVal);
00024
00025   // see if the attribute is there
00026   HRESULT hrFind = pIADs->Get(bstrAttrName, &varVal);
00027   if (SUCCEEDED(hrFind))
00028   {
00029     // found, need to clear the property
00030     if (bPostCommit)
00031     {
00032       // remove from the committed object
00033       hr = pIADs->PutEx(ADS_PROPERTY_CLEAR, bstrAttrName, varVal);
00034     }
00035     else
00036     {
00037       // remove from the cache of the temporary object
00038       IADsPropertyList* pPropList = NULL;
00039       hr = pIADs->QueryInterface(IID_IADsPropertyList, (void**)&pPropList);
00040       ASSERT(pPropList != NULL);
00041       if (SUCCEEDED(hr))
00042       {
00043         VARIANT v;
00044         ::VariantInit(&v);
00045         v.vt = VT_BSTR;
00046         v.bstrVal = ::SysAllocString(bstrAttrName);
00047         hr = pPropList->ResetPropertyItem(v);
00048         ::VariantClear(&v);
00049         pPropList->Release();
00050       }
00051     }
00052   }
00053
00054   ::VariantClear(&varVal);
00055   return hr;
00056 }
00057
00058
00059 ////////////////////////////////////////////////////////////////////
00060
00061 HRESULT SetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, LPCWSTR lpszVal, BOOL bPostCommit)
00062 {
00063   ASSERT(pIADs != NULL);
00064   ASSERT(lpszAttr != NULL);
00065
00066   TRACE(_T("SetStringAttribute() on bPostCommit = %s\n"), bPostCommit ? L"TRUE" : L"FALSE");
00067   TRACE(_T("\t'%s' = <%s>\n"), lpszAttr, lpszVal);
00068
00069   HRESULT hr = S_OK;
00070   BSTR bstrAttr = ::SysAllocString(lpszAttr);
00071   VARIANT varVal;
00072   ::VariantInit(&varVal);
00073   varVal.vt = VT_BSTR;
00074   varVal.bstrVal = ::SysAllocString(lpszVal);
00075
00076   if ( (lpszVal == NULL) || ((lpszVal != NULL) && (lpszVal[0] == NULL)) )
00077   {
00078     hr = _ClearAttribute(pIADs, bstrAttr, bPostCommit);
00079   }
00080   else
00081   {
00082     // set the value
00083     hr = pIADs->Put(bstrAttr, varVal);
00084   }
00085   ::SysFreeString(bstrAttr);
00086   ::VariantClear(&varVal);
00087   return hr;
00088 }
00089
00090 HRESULT GetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, CString& szVal)
00091 {
00092   ASSERT(pIADs != NULL);
00093   VARIANT varVal;
00094   ::VariantInit(&varVal);
00095
00096   BSTR bstrAttr = ::SysAllocString(lpszAttr);
00097
00098   szVal.Empty();
00099   HRESULT hr = pIADs->Get(bstrAttr, &varVal);
00100   if (SUCCEEDED(hr))
00101   {
00102     if (varVal.vt == VT_BSTR)
00103       szVal = varVal.bstrVal;
00104     else
00105       hr = E_INVALIDARG;
00106   }
00107   VariantClear(&varVal);
00108   ::SysFreeString(bstrAttr);
00109
00110   TRACE(_T("GetStringAttribute()lpszAttr = <%s>, (LPCWSTR)szVal = <%s>\n"), lpszAttr, szVal);
00111   return hr;
00112 }
00113
00114
00115
00116 HRESULT SetByteArrayAsOctetString(IADs* pIADs, LPCWSTR lpszAttr, BYTE* pByteArray, DWORD dwSize)
00117 {
00118   if (pByteArray == NULL)
00119   {
00120     CComBSTR bstrAttr = lpszAttr;
00121     return _ClearAttribute(pIADs, bstrAttr, FALSE);
00122   }
00123
00124   HRESULT hr = S_OK;
00125   SAFEARRAYBOUND rgsabound[1];
00126   rgsabound[0].lLbound = 0;
00127   rgsabound[0].cElements = dwSize;
00128
00129   SAFEARRAY* psa = SafeArrayCreate(VT_UI1, 1, rgsabound);
00130   if (psa == NULL)
00131   {
00132     return E_OUTOFMEMORY;
00133   }
00134
00135   CComVariant var;
00136   V_VT(&var) = VT_UI1|VT_ARRAY;
00137   V_ARRAY(&var) = psa;
00138
00139   for (long idx = 0; (DWORD)idx < dwSize; idx++)
00140   {
00141     hr = SafeArrayPutElement(psa, &idx, (void*)&pByteArray[idx]);
00142     if (FAILED(hr))
00143     {
00144       return hr;
00145     }
00146   }
00147
00148   hr = pIADs->Put((LPWSTR)lpszAttr, var);
00149   //SafeArrayDestroy(psa);
00150
00151   return hr;
00152 }
00153
00154 BOOL LoadFileAsByteArray(PWSTR pszPath, LPBYTE* ppByteArray, DWORD* pdwSize)
00155 {
00156   CFile file;
00157   if (!file.Open(pszPath, CFile::modeRead | CFile::shareDenyNone | CFile::typeBinary))
00158   {
00159     AfxMessageBox(_T("Failed to open file."));
00160     return FALSE;
00161   }
00162
00163   *pdwSize = file.GetLength();
00164   *ppByteArray = new BYTE[*pdwSize];
00165   ASSERT(*ppByteArray != NULL);
00166
00167   UINT uiCount = file.Read(*ppByteArray, *pdwSize);
00168   ASSERT(uiCount == *pdwSize);
00169
00170   return TRUE;
00171 }
00172
00173 ///////////////////////////////////////////////////////////////
00174 // CThumbNailPhotoHolder
00175
00176 static LPCWSTR lpszPhotoInDS = _T("<photo stored in Active-Directory>");
00177
00178
00179
00180 HRESULT CThumbNailPhotoHolder::Read(IADs* pIADs)
00181 {
00182   return E_FAIL;
00183 }
00184
00185 HRESULT CThumbNailPhotoHolder::Read(IDirectoryObject* pDirObj)
00186 {
00187   LPWSTR lpszAttrArray[] = { _T("thumbnailPhoto") };
00188   PADS_ATTR_INFO pAttrInfo;
00189   DWORD dwReturned = 0;
00190
00191   //
00192   // Get the thumbnailPhoto information from the object
00193   //
00194   HRESULT hr = pDirObj->GetObjectAttributes(lpszAttrArray, 1, &pAttrInfo, &dwReturned);
00195   if (FAILED(hr))
00196   {
00197     CString szMsg;
00198     szMsg.Format(_T("Failed to read Thumbnail Photo attribute, with hr = 0x%x\n"), hr);
00199     AfxMessageBox(szMsg);
00200     return hr;
00201   }
00202
00203
00204   if (dwReturned > 0)
00205   {
00206     ASSERT(pAttrInfo != NULL);
00207     //
00208     // Create a temporary bmp file in the temp directory
00209     //
00210
00211     WCHAR szTempPath[MAX_PATH];
00212     ::GetTempPath(MAX_PATH, szTempPath);
00213
00214     CString szPicturePath;
00215     ::GetTempFileName(szTempPath, _T("thumbnail"), 0x0, szPicturePath.GetBuffer(MAX_PATH));
00216     szPicturePath.ReleaseBuffer();
00217
00218     CFile tempPhotoFile;
00219     if (!tempPhotoFile.Open(szPicturePath,
00220         CFile::modeCreate | CFile::modeReadWrite |CFile::shareExclusive | CFile::typeBinary))
00221     {
00222       // Failed to open temp file, display error message
00223       AfxMessageBox(_T("Unable to display thumbnail photo."));
00224       return E_FAIL;
00225     }
00226
00227     ASSERT(pAttrInfo->dwADsType == ADSTYPE_OCTET_STRING);
00228
00229     //
00230     // Delete current picture if one exists
00231     //
00232     _Clear();
00233
00234     //
00235     // Create a new byte array to hold the bitmap
00236     //
00237     m_dwPictureSize = pAttrInfo->pADsValues->OctetString.dwLength;
00238     m_pPictureArray = new BYTE[m_dwPictureSize];
00239     memcpy(m_pPictureArray, pAttrInfo->pADsValues->OctetString.lpValue, m_dwPictureSize);
00240     ASSERT(m_pPictureArray != NULL);
00241
00242     //
00243     // Write the byte array to a temp file
00244     //
00245     tempPhotoFile.Write(m_pPictureArray, m_dwPictureSize);
00246     CString szPath = tempPhotoFile.GetFilePath();
00247     tempPhotoFile.Close();
00248
00249     //
00250     // Show the picture path in the read-only edit box
00251     //
00252     ::SetWindowText(m_hWndFileNameEdit, lpszPhotoInDS);
00253
00254     //
00255     // Display the picture in the static control
00256     //
00257     _DisplayPicture(szPath);
00258
00259     //
00260     // Delete temp file after picture is displayed
00261     //
00262     CFile::Remove(szPath);
00263
00264     //
00265     // Free the attribute memory
00266     //
00267     FreeADsMem(pAttrInfo);
00268   }
00269
00270   return S_OK;
00271 }
00272
00273
00274 HRESULT CThumbNailPhotoHolder::Write(IADs* pIADs)
00275 {
00276   //
00277   // Write the changes to the object
00278   //
00279   HRESULT hr = SetByteArrayAsOctetString(pIADs,
00280                                   _T("thumbnailPhoto"),
00281                                   m_pPictureArray,
00282                                   (m_pPictureArray != NULL) ? m_dwPictureSize : 0);
00283
00284   _WriteHelper(hr);
00285
00286   return hr;
00287 }
00288
00289
00290 HRESULT CThumbNailPhotoHolder::Write(IDirectoryObject* pDirObj)
00291 {
00292   ADS_ATTR_INFO attrInfo[1];
00293   PWSTR rgpwzAttrNames[] = { _T("thumbnailPhoto")};
00294   ADSVALUE Value[1];
00295
00296   //
00297   // Set the update/clear value
00298   //
00299
00300   attrInfo[0].dwADsType = ADSTYPE_OCTET_STRING;
00301   attrInfo[0].pszAttrName = rgpwzAttrNames[0];
00302
00303   Value[0].dwType = ADSTYPE_OCTET_STRING;
00304   Value[0].OctetString.dwLength = (m_pPictureArray != NULL) ? m_dwPictureSize : 0;
00305   Value[0].OctetString.lpValue = m_pPictureArray;
00306
00307   attrInfo[0].pADsValues = &Value[0];
00308   attrInfo[0].dwNumValues = 1;
00309   attrInfo[0].dwControlCode = (m_pPictureArray != NULL) ? ADS_ATTR_UPDATE : ADS_ATTR_CLEAR;
00310
00311   //
00312   // Write the changes to the object
00313   //
00314   DWORD dwModified = 0;
00315   HRESULT hr = pDirObj->SetObjectAttributes(attrInfo, 1, &dwModified);
00316
00317   _WriteHelper(hr);
00318
00319   return hr;
00320 }
00321
00322
00323 void CThumbNailPhotoHolder::_WriteHelper(HRESULT hr)
00324 {
00325   if (FAILED(hr))
00326   {
00327     CString szMsg;
00328     szMsg.Format(_T("Failed to write Thumbnail Photo attribute, with hr = 0x%x\n"), hr);
00329     AfxMessageBox(szMsg);
00330   }
00331   else
00332   {
00333     //
00334     // Show the picture path in the read-only edit box
00335     //
00336     ::SetWindowText(m_hWndFileNameEdit, (m_pPictureArray != NULL) ? lpszPhotoInDS : NULL);
00337   }
00338 }
00339
00340
00341 BOOL CThumbNailPhotoHolder::Change(HWND hWndOwner)
00342 {
00343   TCHAR szFileName[MAX_PATH] = _T("\0");
00344   OPENFILENAME OpenFileName;
00345   memset(&OpenFileName, 0, sizeof(OpenFileName));
00346
00347   //
00348   // Fill in the OPENFILENAME structure
00349   //
00350   OpenFileName.lStructSize        = sizeof(OPENFILENAME);
00351   OpenFileName.hwndOwner          = hWndOwner;
00352   OpenFileName.hInstance          = AfxGetInstanceHandle();
00353   OpenFileName.lpstrFile          = szFileName;
00354   OpenFileName.nMaxFile           = sizeof(szFileName);
00355   OpenFileName.lpstrFilter        = _T("Bitmap Files (*.bmp)\0*.bmp");
00356   OpenFileName.lpstrTitle         = _T("Select bitmap file");
00357   OpenFileName.Flags              = OFN_EXPLORER;
00358
00359   //
00360   // Open file browse dialog and retrieve the path and name of the bitmap to use.
00361   //
00362   if (GetOpenFileName(&OpenFileName))
00363   {
00364     //
00365     // Load the picture into a temporary byte array
00366     //
00367     BYTE* pNewPictureArray = NULL;
00368     DWORD dwNewPictureSize = 0x0;
00369
00370     if (!LoadFileAsByteArray(szFileName, &pNewPictureArray, &dwNewPictureSize))
00371     {
00372       CString szMsg;
00373       szMsg.Format(_T("Failed to open file %s."), szFileName);
00374       AfxMessageBox(szMsg);
00375       return FALSE;
00376     }
00377
00378     ASSERT(pNewPictureArray != NULL);
00379
00380     ::SetWindowText(m_hWndFileNameEdit, szFileName);
00381
00382     //
00383     // Display the picture in the static window
00384     //
00385     if (!_DisplayPicture(szFileName))
00386     {
00387       CString szMsg;
00388       szMsg.Format(_T("Failed to load file %s as a bitmap."), szFileName);
00389       AfxMessageBox(szMsg);
00390
00391       if (pNewPictureArray != NULL)
00392         delete pNewPictureArray;
00393       return FALSE;
00394
00395     }
00396
00397     //
00398     // Update any existing picture information
00399     //
00400     _Clear();
00401     m_pPictureArray = pNewPictureArray;
00402     m_dwPictureSize = dwNewPictureSize;
00403
00404     //
00405     // we have a new one
00406     //
00407     return TRUE;
00408   }
00409
00410   //
00411   // no change
00412   //
00413   return FALSE;
00414 }
00415
00416 BOOL CThumbNailPhotoHolder::Clear()
00417 {
00418   if (m_pPictureArray == NULL)
00419     return FALSE;
00420
00421   //
00422   // clear the picture array info
00423   //
00424   _Clear();
00425
00426   //
00427   // clear the path info
00428   //
00429   ::SetWindowText(m_hWndFileNameEdit, NULL);
00430
00431   //
00432   // clear the picture
00433   //
00434   _SetPictureControl(NULL);
00435
00436   return TRUE;
00437 }
00438
00439 BOOL CThumbNailPhotoHolder::_DisplayPicture(LPCWSTR lpszPath)
00440 {
00441   //
00442   // Load and display the picture
00443   //
00444   HBITMAP hPicture = (HBITMAP)::LoadImage(NULL, lpszPath, IMAGE_BITMAP, 0, 0 , LR_LOADFROMFILE);
00445   if (hPicture == NULL)
00446   {
00447     return FALSE;
00448   }
00449   _SetPictureControl(hPicture);
00450   return TRUE;
00451 }
00452
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/SchemaEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

SchemaEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: SchemaEnum
00019
00020 public class SchemaEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adSchemaProviderSpecific = -1;
00023   public static final short adSchemaAsserts = 0;
00024   public static final short adSchemaCatalogs = 1;
00025   public static final short adSchemaCharacterSets = 2;
00026   public static final short adSchemaCollations = 3;
00027   public static final short adSchemaColumns = 4;
00028   public static final short adSchemaCheckConstraints = 5;
00029   public static final short adSchemaConstraintColumnUsage = 6;
00030   public static final short adSchemaConstraintTableUsage = 7;
00031   public static final short adSchemaKeyColumnUsage = 8;
00032   public static final short adSchemaReferentialContraints = 9;
00033   public static final short adSchemaReferentialConstraints = 9;
00034   public static final short adSchemaTableConstraints = 10;
00035   public static final short adSchemaColumnsDomainUsage = 11;
00036   public static final short adSchemaIndexes = 12;
00037   public static final short adSchemaColumnPrivileges = 13;
00038   public static final short adSchemaTablePrivileges = 14;
00039   public static final short adSchemaUsagePrivileges = 15;
00040   public static final short adSchemaProcedures = 16;
00041   public static final short adSchemaSchemata = 17;
00042   public static final short adSchemaSQLLanguages = 18;
00043   public static final short adSchemaStatistics = 19;
00044   public static final short adSchemaTables = 20;
00045   public static final short adSchemaTranslations = 21;
00046   public static final short adSchemaProviderTypes = 22;
00047   public static final short adSchemaViews = 23;
00048   public static final short adSchemaViewColumnUsage = 24;
00049   public static final short adSchemaViewTableUsage = 25;
00050   public static final short adSchemaProcedureParameters = 26;
00051   public static final short adSchemaForeignKeys = 27;
00052   public static final short adSchemaPrimaryKeys = 28;
00053   public static final short adSchemaProcedureColumns = 29;
00054   public static final short adSchemaDBInfoKeywords = 30;
00055   public static final short adSchemaDBInfoLiterals = 31;
00056   public static final short adSchemaCubes = 32;
00057   public static final short adSchemaDimensions = 33;
00058   public static final short adSchemaHierarchies = 34;
00059   public static final short adSchemaLevels = 35;
00060   public static final short adSchemaMeasures = 36;
00061   public static final short adSchemaProperties = 37;
00062   public static final short adSchemaMembers = 38;
00063   public static final short adSchemaTrustees = 39;
00064 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Controls/Common/VListVw/VListVw.c Source File

  • WinUI
  • Controls
  • Common
  • VListVw

VListVw.c

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011    Include Files
00012 **************************************************************************/
00013
00014 #define STRICT
00015
00016 #include <windows.h>
00017 #include <windowsx.h>
00018 #include <commctrl.h>
00019 #include "VListVw.h"
00020
00021 /**************************************************************************
00022    Local Function Prototypes
00023 **************************************************************************/
00024
00025 #define ErrorHandler() ErrorHandlerEx(__LINE__, __FILE__)
00026 void ErrorHandlerEx(WORD, LPSTR);
00027
00028 LRESULT ListViewNotify(HWND, LPARAM);
00029 void SwitchView(HWND, DWORD);
00030 BOOL DoContextMenu(HWND, WPARAM, LPARAM);
00031 void UpdateMenu(HWND, HMENU);
00032 BOOL InsertListViewItems(HWND);
00033 void PositionHeader(HWND);
00034
00035 /**************************************************************************
00036    Global Variables
00037 **************************************************************************/
00038
00039 HINSTANCE   g_hInst;
00040 TCHAR       g_szClassName[] = TEXT("VListVwClass");
00041
00042 #define ITEM_COUNT   100000
00043
00044 /******************************************************************************
00045
00046    WinMain
00047
00048 ******************************************************************************/
00049
00050 int PASCAL WinMain(  HINSTANCE hInstance,
00051                      HINSTANCE hPrevInstance,
00052                      LPSTR lpCmdLine,
00053                      int nCmdShow)
00054 {
00055 MSG  msg;
00056
00057 g_hInst = hInstance;
00058
00059 if(!hPrevInstance)
00060    if(!InitApplication(hInstance))
00061       return FALSE;
00062
00063 //required to use the common controls
00064 InitCommonControls();
00065
00066 /* Perform initializations that apply to a specific instance */
00067
00068 if (!InitInstance(hInstance, nCmdShow))
00069    return FALSE;
00070
00071 /* Acquire and dispatch messages until a WM_QUIT uMessage is received. */
00072
00073 while(GetMessage( &msg, NULL, 0x00, 0x00))
00074    {
00075    TranslateMessage(&msg);
00076    DispatchMessage(&msg);
00077    }
00078
00079 return (int)msg.wParam;
00080 }
00081
00082
00083 /******************************************************************************
00084
00085    InitApplication
00086
00087 ******************************************************************************/
00088
00089 BOOL InitApplication(HINSTANCE hInstance)
00090 {
00091 WNDCLASSEX  wcex;
00092 ATOM        aReturn;
00093
00094 wcex.cbSize          = sizeof(WNDCLASSEX);
00095 wcex.style           = 0;
00096 wcex.lpfnWndProc     = (WNDPROC)MainWndProc;
00097 wcex.cbClsExtra      = 0;
00098 wcex.cbWndExtra      = 0;
00099 wcex.hInstance       = hInstance;
00100 wcex.hCursor         = LoadCursor(NULL, IDC_ARROW);
00101 wcex.hbrBackground   = (HBRUSH)(COLOR_WINDOW + 1);
00102 wcex.lpszMenuName    = MAKEINTRESOURCE(IDM_MAIN_MENU);
00103 wcex.lpszClassName   = g_szClassName;
00104 wcex.hIcon           = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON));
00105 wcex.hIconSm         = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 16, 16, 0);
00106
00107 aReturn = RegisterClassEx(&wcex);
00108
00109 if(0 == aReturn)
00110    {
00111    WNDCLASS wc;
00112
00113    wc.style          = 0;
00114    wc.lpfnWndProc    = (WNDPROC)MainWndProc;
00115    wc.cbClsExtra     = 0;
00116    wc.cbWndExtra     = 0;
00117    wc.hInstance      = hInstance;
00118    wc.hIcon          = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON));
00119    wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00120    wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW + 1);
00121    wc.lpszMenuName   = MAKEINTRESOURCE(IDM_MAIN_MENU);
00122    wc.lpszClassName  = g_szClassName;
00123
00124    aReturn = RegisterClass(&wc);
00125    }
00126
00127 return aReturn;
00128 }
00129
00130
00131 /******************************************************************************
00132
00133    InitInstance
00134
00135 ******************************************************************************/
00136
00137 BOOL InitInstance(   HINSTANCE hInstance,
00138                      int nCmdShow)
00139 {
00140 HWND     hWnd;
00141 TCHAR    szTitle[MAX_PATH] = TEXT("");
00142
00143 g_hInst = hInstance;
00144
00145 LoadString(g_hInst, IDS_APPTITLE, szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
00146
00147 /* Create a main window for this application instance.  */
00148 hWnd = CreateWindowEx(  0,
00149                         g_szClassName,
00150                         szTitle,
00151                         WS_OVERLAPPEDWINDOW,
00152                         CW_USEDEFAULT,
00153                         CW_USEDEFAULT,
00154                         CW_USEDEFAULT,
00155                         CW_USEDEFAULT,
00156                         NULL,
00157                         NULL,
00158                         hInstance,
00159                         NULL);
00160
00161 /* If window could not be created, return "failure" */
00162
00163 if (!hWnd)
00164    return FALSE;
00165
00166 /* Make the window visible; update its client area; and return "success" */
00167
00168 ShowWindow(hWnd, nCmdShow);
00169 UpdateWindow(hWnd);
00170 return TRUE;
00171
00172 }
00173
00174 /******************************************************************************
00175
00176    MainWndProc
00177
00178 ******************************************************************************/
00179
00180 LRESULT CALLBACK MainWndProc( HWND hWnd,
00181                               UINT uMessage,
00182                               WPARAM wParam,
00183                               LPARAM lParam)
00184 {
00185 static HWND hwndListView;
00186
00187 switch (uMessage)
00188    {
00189    case WM_CREATE:
00190       // create the TreeView control
00191       hwndListView = CreateListView(g_hInst, hWnd);
00192
00193       //initialize the TreeView control
00194       InitListView(hwndListView);
00195
00196       break;
00197
00198    case WM_NOTIFY:
00199       return ListViewNotify(hWnd, lParam);
00200
00201    case WM_SIZE:
00202       ResizeListView(hwndListView, hWnd);
00203       break;
00204
00205    case WM_INITMENUPOPUP:
00206       UpdateMenu(hwndListView, GetMenu(hWnd));
00207       break;
00208
00209    case WM_CONTEXTMENU:
00210       if(DoContextMenu(hWnd, wParam, lParam))
00211          return FALSE;
00212       break;
00213
00214    case WM_COMMAND:
00215       switch (GET_WM_COMMAND_ID(wParam, lParam))
00216          {
00217          case IDM_LARGE_ICONS:
00218             SwitchView(hwndListView, LVS_ICON);
00219             break;
00220
00221          case IDM_SMALL_ICONS:
00222             SwitchView(hwndListView, LVS_SMALLICON);
00223             break;
00224
00225          case IDM_LIST:
00226             SwitchView(hwndListView, LVS_LIST);
00227             break;
00228
00229          case IDM_REPORT:
00230             SwitchView(hwndListView, LVS_REPORT);
00231             break;
00232
00233          case IDM_EXIT:
00234             DestroyWindow(hWnd);
00235             break;
00236
00237          case IDM_ABOUT:
00238             DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUT), hWnd, AboutDlgProc);
00239             break;
00240
00241          }
00242       break;
00243
00244    case WM_DESTROY:
00245       PostQuitMessage(0);
00246       break;
00247
00248    default:
00249       break;
00250    }
00251 return DefWindowProc(hWnd, uMessage, wParam, lParam);
00252 }
00253
00254
00255 /******************************************************************************
00256
00257    AboutDlgProc
00258
00259 ******************************************************************************/
00260
00261 INT_PTR CALLBACK AboutDlgProc(   HWND hDlg,
00262                                  UINT uMessage,
00263                                  WPARAM wParam,
00264                                  LPARAM lParam)
00265 {
00266 switch (uMessage)
00267    {
00268    case WM_INITDIALOG:
00269       return TRUE;
00270
00271    case WM_COMMAND:
00272       switch(wParam)
00273          {
00274          case IDOK:
00275             EndDialog(hDlg, IDOK);
00276             break;
00277
00278          case IDCANCEL:
00279             EndDialog(hDlg, IDOK);
00280             break;
00281          }
00282       return TRUE;
00283     }
00284
00285 return FALSE;
00286 }
00287
00288 /******************************************************************************
00289
00290    CreateListView
00291
00292 ******************************************************************************/
00293
00294 HWND CreateListView(HINSTANCE hInstance, HWND hwndParent)
00295 {
00296 DWORD       dwStyle;
00297 HWND        hwndListView;
00298 HIMAGELIST  himlSmall;
00299 HIMAGELIST  himlLarge;
00300 BOOL        bSuccess = TRUE;
00301
00302 dwStyle =   WS_TABSTOP |
00303             WS_CHILD |
00304             WS_BORDER |
00305             WS_VISIBLE |
00306             LVS_AUTOARRANGE |
00307             LVS_REPORT |
00308             LVS_OWNERDATA;
00309
00310 hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,          // ex style
00311                                  WC_LISTVIEW,               // class name - defined in commctrl.h
00312                                  TEXT(""),                        // dummy text
00313                                  dwStyle,                   // style
00314                                  0,                         // x position
00315                                  0,                         // y position
00316                                  0,                         // width
00317                                  0,                         // height
00318                                  hwndParent,                // parent
00319                                  (HMENU)ID_LISTVIEW,        // ID
00320                                  g_hInst,                   // instance
00321                                  NULL);                     // no extra data
00322
00323 if(!hwndListView)
00324    return NULL;
00325
00326 ResizeListView(hwndListView, hwndParent);
00327
00328 //set the image lists
00329 himlSmall = ImageList_Create(16, 16, ILC_COLORDDB | ILC_MASK, 1, 0);
00330 himlLarge = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 1, 0);
00331
00332 if (himlSmall && himlLarge)
00333    {
00334    HICON hIcon;
00335
00336    //set up the small image list
00337    hIcon = LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DISK), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
00338    ImageList_AddIcon(himlSmall, hIcon);
00339
00340    //set up the large image list
00341    hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_DISK));
00342    ImageList_AddIcon(himlLarge, hIcon);
00343
00344    ListView_SetImageList(hwndListView, himlSmall, LVSIL_SMALL);
00345    ListView_SetImageList(hwndListView, himlLarge, LVSIL_NORMAL);
00346    }
00347
00348 return hwndListView;
00349 }
00350
00351 /******************************************************************************
00352
00353    ResizeListView
00354
00355 ******************************************************************************/
00356
00357 void ResizeListView(HWND hwndListView, HWND hwndParent)
00358 {
00359 RECT  rc;
00360
00361 GetClientRect(hwndParent, &rc);
00362
00363 MoveWindow( hwndListView,
00364             rc.left,
00365             rc.top,
00366             rc.right - rc.left,
00367             rc.bottom - rc.top,
00368             TRUE);
00369
00370 //only call this if we want the LVS_NOSCROLL style
00371 //PositionHeader(hwndListView);
00372 }
00373
00374 /******************************************************************************
00375
00376    PositionHeader
00377
00378    this needs to be called when the ListView is created, resized, the view is
00379    changed or a WM_SYSPARAMETERCHANGE message is received
00380
00381 ******************************************************************************/
00382
00383 void PositionHeader(HWND hwndListView)
00384 {
00385 HWND  hwndHeader = GetWindow(hwndListView, GW_CHILD);
00386 DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
00387
00388 /*To ensure that the first item will be visible, create the control without
00389 the LVS_NOSCROLL style and then add it here*/
00390 dwStyle |= LVS_NOSCROLL;
00391 SetWindowLong(hwndListView, GWL_STYLE, dwStyle);
00392
00393 //only do this if we are in report view and were able to get the header hWnd
00394 if(((dwStyle & LVS_TYPEMASK) == LVS_REPORT) && hwndHeader)
00395    {
00396    RECT        rc;
00397    HD_LAYOUT   hdLayout;
00398    WINDOWPOS   wpos;
00399
00400    GetClientRect(hwndListView, &rc);
00401    hdLayout.prc = &rc;
00402    hdLayout.pwpos = &wpos;
00403
00404    Header_Layout(hwndHeader, &hdLayout);
00405
00406    SetWindowPos(  hwndHeader,
00407                   wpos.hwndInsertAfter,
00408                   wpos.x,
00409                   wpos.y,
00410                   wpos.cx,
00411                   wpos.cy,
00412                   wpos.flags | SWP_SHOWWINDOW);
00413
00414    ListView_EnsureVisible(hwndListView, 0, FALSE);
00415    }
00416 }
00417
00418 /******************************************************************************
00419
00420    InitListView
00421
00422 ******************************************************************************/
00423
00424 BOOL InitListView(HWND hwndListView)
00425 {
00426 LV_COLUMN   lvColumn;
00427 int         i;
00428 TCHAR       szString[5][20] = {TEXT("Main Column"), TEXT("Column 1"), TEXT("Column 2"), TEXT("Column 3"), TEXT("Column 4")};
00429
00430 //empty the list
00431 ListView_DeleteAllItems(hwndListView);
00432
00433 //initialize the columns
00434 lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00435 lvColumn.fmt = LVCFMT_LEFT;
00436 lvColumn.cx = 120;
00437 for(i = 0; i < 5; i++)
00438    {
00439    lvColumn.pszText = szString[i];
00440    ListView_InsertColumn(hwndListView, i, &lvColumn);
00441    }
00442
00443 InsertListViewItems(hwndListView);
00444
00445 return TRUE;
00446 }
00447
00448 /******************************************************************************
00449
00450    InsertListViewItems
00451
00452 ******************************************************************************/
00453
00454 BOOL InsertListViewItems(HWND hwndListView)
00455 {
00456 //empty the list
00457 ListView_DeleteAllItems(hwndListView);
00458
00459 //set the number of items in the list
00460 ListView_SetItemCount(hwndListView, ITEM_COUNT);
00461
00462 return TRUE;
00463 }
00464
00465 /**************************************************************************
00466
00467    ListViewNotify()
00468
00469 **************************************************************************/
00470
00471 LRESULT ListViewNotify(HWND hWnd, LPARAM lParam)
00472 {
00473 LPNMHDR  lpnmh = (LPNMHDR) lParam;
00474 HWND     hwndListView = GetDlgItem(hWnd, ID_LISTVIEW);
00475
00476 switch(lpnmh->code)
00477    {
00478    case LVN_GETDISPINFO:
00479       {
00480       LV_DISPINFO *lpdi = (LV_DISPINFO *)lParam;
00481       TCHAR szString[MAX_PATH];
00482
00483       if(lpdi->item.iSubItem)
00484          {
00485          if(lpdi->item.mask & LVIF_TEXT)
00486             {
00487             wsprintf(szString, TEXT("Item %d - Column %d"), lpdi->item.iItem + 1, lpdi->item.iSubItem);
00488             lstrcpyn(lpdi->item.pszText, szString, lpdi->item.cchTextMax);
00489             }
00490          }
00491       else
00492          {
00493          if(lpdi->item.mask & LVIF_TEXT)
00494             {
00495             wsprintf(szString, TEXT("Item %d"), lpdi->item.iItem + 1);
00496             lstrcpyn(lpdi->item.pszText, szString, lpdi->item.cchTextMax);
00497             }
00498
00499          if(lpdi->item.mask & LVIF_IMAGE)
00500             {
00501             lpdi->item.iImage = 0;
00502             }
00503          }
00504       }
00505       return 0;
00506
00507    case LVN_ODCACHEHINT:
00508       {
00509       LPNMLVCACHEHINT   lpCacheHint = (LPNMLVCACHEHINT)lParam;
00510       /*
00511       This sample doesn't use this notification, but this is sent when the
00512       ListView is about to ask for a range of items. On this notification,
00513       you should load the specified items into your local cache. It is still
00514       possible to get an LVN_GETDISPINFO for an item that has not been cached,
00515       therefore, your application must take into account the chance of this
00516       occurring.
00517       */
00518       }
00519       return 0;
00520
00521    case LVN_ODFINDITEM:
00522       {
00523       LPNMLVFINDITEM lpFindItem = (LPNMLVFINDITEM)lParam;
00524       /*
00525       This sample doesn't use this notification, but this is sent when the
00526       ListView needs a particular item. Return -1 if the item is not found.
00527       */
00528       }
00529       return 0;
00530    }
00531
00532 return 0;
00533 }
00534
00535 /**************************************************************************
00536
00537    ErrorHandlerEx()
00538
00539 **************************************************************************/
00540
00541 void ErrorHandlerEx( WORD wLine, LPSTR lpszFile )
00542 {
00543 LPVOID lpvMessage;
00544 DWORD  dwError;
00545 TCHAR  szBuffer[256];
00546
00547 // Allow FormatMessage() to look up the error code returned by GetLastError
00548 dwError = FormatMessage(   FORMAT_MESSAGE_ALLOCATE_BUFFER |
00549                               FORMAT_MESSAGE_FROM_SYSTEM,
00550                            NULL,
00551                            GetLastError(),
00552                            MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
00553                            (LPTSTR)&lpvMessage,
00554                            0,
00555                            NULL);
00556
00557 // Check to see if an error occurred calling FormatMessage()
00558 if (0 == dwError)
00559    {
00560    wsprintf(   szBuffer,
00561                TEXT("An error occurred calling FormatMessage().")
00562                TEXT("Error Code %d"),
00563                GetLastError());
00564    MessageBox( NULL,
00565                szBuffer,
00566                TEXT("Generic"),
00567                MB_ICONSTOP | MB_ICONEXCLAMATION);
00568    return;
00569    }
00570
00571 // Display the error information along with the place the error happened.
00572 wsprintf(szBuffer, TEXT("Generic, Line=%d, File=%s"), wLine, lpszFile);
00573 MessageBox(NULL, lpvMessage, szBuffer, MB_ICONEXCLAMATION | MB_OK);
00574 }
00575
00576 /**************************************************************************
00577
00578    SwitchView()
00579
00580 **************************************************************************/
00581
00582 void SwitchView(HWND hwndListView, DWORD dwView)
00583 {
00584 DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
00585
00586 SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | dwView);
00587 ResizeListView(hwndListView, GetParent(hwndListView));
00588 }
00589
00590 /**************************************************************************
00591
00592    DoContextMenu()
00593
00594 **************************************************************************/
00595
00596 BOOL DoContextMenu(  HWND hWnd,
00597                      WPARAM wParam,
00598                      LPARAM lParam)
00599 {
00600 HWND  hwndListView = (HWND)wParam;
00601 HMENU hMenuLoad,
00602       hMenu;
00603
00604 if(hwndListView != GetDlgItem(hWnd, ID_LISTVIEW))
00605    return FALSE;
00606
00607 hMenuLoad = LoadMenu(g_hInst, MAKEINTRESOURCE(IDM_CONTEXT_MENU));
00608 hMenu = GetSubMenu(hMenuLoad, 0);
00609
00610 UpdateMenu(hwndListView, hMenu);
00611
00612 TrackPopupMenu(   hMenu,
00613                   TPM_LEFTALIGN | TPM_RIGHTBUTTON,
00614                   LOWORD(lParam),
00615                   HIWORD(lParam),
00616                   0,
00617                   hWnd,
00618                   NULL);
00619
00620 DestroyMenu(hMenuLoad);
00621
00622 return TRUE;
00623 }
00624
00625 /**************************************************************************
00626
00627    UpdateMenu()
00628
00629 **************************************************************************/
00630
00631 void UpdateMenu(HWND hwndListView, HMENU hMenu)
00632 {
00633 UINT  uID = IDM_LIST;
00634 DWORD dwStyle;
00635
00636 //uncheck all of these guys
00637 CheckMenuItem(hMenu, IDM_LARGE_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
00638 CheckMenuItem(hMenu, IDM_SMALL_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
00639 CheckMenuItem(hMenu, IDM_LIST,  MF_BYCOMMAND | MF_UNCHECKED);
00640 CheckMenuItem(hMenu, IDM_REPORT,  MF_BYCOMMAND | MF_UNCHECKED);
00641
00642 //check the appropriate view menu item
00643 dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
00644 switch(dwStyle & LVS_TYPEMASK)
00645    {
00646    case LVS_ICON:
00647       uID = IDM_LARGE_ICONS;
00648       break;
00649
00650    case LVS_SMALLICON:
00651       uID = IDM_SMALL_ICONS;
00652       break;
00653
00654    case LVS_LIST:
00655       uID = IDM_LIST;
00656       break;
00657
00658    case LVS_REPORT:
00659       uID = IDM_REPORT;
00660       break;
00661    }
00662 CheckMenuRadioItem(hMenu, IDM_LARGE_ICONS, IDM_REPORT, uID,  MF_BYCOMMAND | MF_CHECKED);
00663
00664 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/section.h Source File

  • Begin
  • sdkdiff

section.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 #ifndef __SECTION_H__
00012 #define __SECTION_H__
00013
00014 /*
00015  *
00016  * section.h
00017  *
00018  *
00019  * manage sections of lines. These are contiguous blocks of lines that either
00020  * all match a contiguous block in another file, or are unmatched.
00021  *
00022  * a section can maintain a link to a corresponding section in another
00023  * file, and can establish links between matching lines in the two sections.
00024  *
00025  * a section also knows its compare state (defined in state.h). This says
00026  * whether it matches another section, or is matched but out of
00027  * sequence, or is unmatched. These are set during section_makecomposite.
00028  *
00029  * sections are held in LISTs. A list of sections can be built by functions
00030  * here that traverse a LIST of LINEs, or that traverse a list of
00031  * SECTIONs (to produce a composite list). In both cases, the lists used
00032  * are managed by the standard list package
00033  *
00034  *
00035  */
00036
00037 /* handle to a section */
00038 typedef struct section FAR * SECTION;
00039
00040
00041 /* make a section, given a first and last line. We return a handle to
00042  * a section. If the LIST parameter is non-null, we create the section
00043  * at the end of the list. if list is null, we allocate the memory ourselves.
00044  * This affects behaviour of section_delete (we only free memory we alloc
00045  * ourselves).
00046  *
00047  * The first and last lines must be on a LIST, with first coming before last.
00048  */
00049 SECTION section_new(LINE first, LINE last, LIST list);
00050
00051
00052 /* delete a section. free up all associated memory. does NOT delete the
00053  * associated list of lines.
00054  *
00055  *
00056  * If the section was allocated on a list, it will not be deleted here,
00057  * only the memory hanging off it will be freed.
00058  */
00059 void section_delete(SECTION section);
00060
00061
00062 /* match two sections: try to match as many lines as possible between
00063  * the two sections
00064  *
00065  * returns TRUE if any new links between LINEs were made, or FALSE if not.
00066  */
00067 BOOL section_match(SECTION section1, SECTION section2, BOOL ReSynch);
00068
00069 /* return the handle to the first or last line in the section. If the section
00070  * is one line long, these will be the same. they should never be NULL
00071  */
00072 LINE section_getfirstline(SECTION section);
00073 LINE section_getlastline(SECTION section);
00074
00075 /* return the handle to the linked section, if any, or NULL if not linked */
00076 SECTION section_getlink(SECTION section);
00077
00078 /* return a handle to a section that corresponds to this section, but
00079  * does not match. corresponding sections are found in the same
00080  * relative position of the file, but are not identical. At least
00081  * one of section_getlink and section_getcorrespond will return NULL for any
00082  * given section
00083  */
00084 SECTION section_getcorrespond(SECTION section);
00085
00086 /* set the compare state for this section */
00087 void section_setstate(SECTION section, int state);
00088
00089
00090 /* return the compare state for this section. This will be 0 unless
00091  * set by section_getstate, or if the section was built by a call
00092  * to section_makecomposite.
00093  */
00094 int section_getstate(SECTION section);
00095
00096
00097 /* return a count of the number of lines in this section */
00098 int section_getlinecount(SECTION section);
00099
00100
00101 /* return the base line number for this section in the left or
00102  * right files. Base line number is the line number of the
00103  * first line in this section. Return 0 if the line was not in
00104  * the left(or right) file.
00105  *
00106  * This will only be set for sections created in section_makecomposites.
00107  *
00108  * Assumes that lines are numbered incrementally in ascending order.
00109  */
00110 int section_getleftbasenr(SECTION section);
00111 int section_getrightbasenr(SECTION section);
00112
00113
00114
00115 /*--  section list functions -------------------------------------*/
00116
00117
00118 /* make a list of sections by traversing a list of lines. Contiguous
00119  * lines that are all linked to contiguous lines are put in the same section.
00120  * contiguous blocks of lines that are unmatched are put in the same section.
00121  * sections are kept in order in the list such that the first line of
00122  * the first section is the first line of the list of lines.
00123  * left must be TRUE iff the linelist represents a left hand file
00124  */
00125 LIST section_makelist(LIST linelist, BOOL left);
00126
00127 /* free up a list of sections and all data associated with it */
00128 void section_deletelist(LIST sections);
00129
00130
00131 /* make a composite list of sections by traversing two lists of sections.
00132  *
00133  * section are placed in the same order: thus if sec1 is before sec2 in
00134  * list1, it will be before sec2 in the composite list. Sections that
00135  * match and are in the same order in both lists, are inserted only once
00136  * - only one of the two sections will be in the composite list, and the
00137  * section state will be set to SAME.
00138  * sections that match but are different places in the two original
00139  * lists will be inserted twice and the section state will be set to MOVED
00140  * (MOVED_LEFT and MOVED_RIGHT). Sections that are unmatched will be
00141  * inserted in order (relative to sections from the same list) with the
00142  * state set to ONLY_LEFT or ONLY_RIGHT
00143  */
00144
00145 LIST section_makecomposite(LIST secsleft, LIST secsright);
00146
00147
00148 /* match up sections in the two lists. link sections that are the same,
00149  * (whose lines are linked), and make correspondence links for sections
00150  * that are in the same relative position, but not identical.
00151  * when making correspondence links, we attempt to link lines that
00152  * match between the two correponding sections. We return TRUE if at any
00153  * point we increase the number of links - this means that the section
00154  * lists will have to be rebuilt and rematched. This is *not* done here -
00155  * it must be done by caller.
00156  * bDups means allow matching the first occurrence of lines which are not unique.
00157  */
00158 BOOL section_matchlists(LIST secsleft, LIST secsright, BOOL bDups);
00159
00160
00161 #endif
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/StdAfx.Cpp Source File

  • Com
  • Services
  • Concurrency
  • SyncComp

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Resource_Dispenser/StdAfx.Cpp Source File

  • Com
  • Services
  • Resource_Dispenser

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Shared_Property_Manager/TServer/Human.h Source File

  • Com
  • Services
  • Shared_Property_Manager
  • TServer

Human.h

Go to the documentation of this file.
00001 // Filename: Human.h
00002 //
00003 // Description:  Definition of CHuman
00004 //
00005 // This file is provided as part of the Microsoft Transaction Server Samples
00006 //
00007 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
00008 // WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
00009 // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00010 // OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
00011 // PURPOSE.
00012 //
00013 // Copyright (C) 1997 - 2000 Microsoft Corporation, All rights reserved
00014
00015 #if !defined(AFX_HUMAN_H__CAAD7FA2_F22D_11D0_B5CB_00C04FB957D8__INCLUDED_)
00016 #define AFX_HUMAN_H__CAAD7FA2_F22D_11D0_B5CB_00C04FB957D8__INCLUDED_
00017
00018 #if _MSC_VER >= 1000
00019 #pragma once
00020 #endif // _MSC_VER >= 1000
00021
00022 #include "resource.h"       // main symbols
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CHuman
00026
00027 class CHuman :
00028   public CComDualImpl<IHuman, &IID_IHuman, &LIBID_TSERVERLib>,
00029   public ISupportErrorInfo,
00030   public CComObjectRoot,
00031   public CComCoClass<CHuman,&CLSID_Human>
00032 {
00033 public:
00034   CHuman() {}
00035
00036 private:
00037   long plField [3][3];
00038
00039   void inline CHuman::InitArray () {
00040     for (int i = 0; i < 3; i ++)
00041       for (int j = 0; j < 3; j ++)
00042         plField[i][j] = 0;
00043   }
00044
00045   HRESULT CHuman::LoadArray (long lGameID);
00046   HRESULT CHuman::SaveArray (long lGameID);
00047   long CHuman::HowManyTurns ();
00048   bool CHuman::IsWin (long lPlayer);
00049
00050 BEGIN_COM_MAP(CHuman)
00051   COM_INTERFACE_ENTRY(IDispatch)
00052   COM_INTERFACE_ENTRY(IHuman)
00053   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00054 END_COM_MAP()
00055 //DECLARE_NOT_AGGREGATABLE(CHuman)
00056 // Remove the comment from the line above if you don't want your object to
00057 // support aggregation.
00058
00059 DECLARE_REGISTRY_RESOURCEID(IDR_Human)
00060 // ISupportsErrorInfo
00061   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00062
00063 // IHuman
00064
00065 public:
00066   STDMETHODIMP EnterNewGame (IN BSTR bstrLocalName, OUT VARIANT* pvGameID, OUT VARIANT* pvName, OUT VARIANT* pvOrder);
00067   STDMETHODIMP NewMove (IN long lGameID, IN long lOrder, IN long lX, IN long lY, OUT VARIANT* pvWin);
00068   STDMETHODIMP GetNewMove (IN long lGameID, IN long lOrder, OUT VARIANT* pvName, OUT VARIANT* pvFoeX, OUT VARIANT* pvFoeY, OUT VARIANT* pvWin, OUT VARIANT* pvUpdate);
00069 };
00070
00071 #endif // !defined(AFX_HUMAN_H__CAAD7FA2_F22D_11D0_B5CB_00C04FB957D8__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEnumDisplayAttributeInfo Member List

This is the complete list of members for CEnumDisplayAttributeInfo, including all inherited members.
_cRef | CEnumDisplayAttributeInfo | [private]
_iIndex | CEnumDisplayAttributeInfo | [private]
CEnumDisplayAttributeInfo() | CEnumDisplayAttributeInfo |
Clone(IEnumTfDisplayAttributeInfo **ppEnum) | CEnumDisplayAttributeInfo |
Next(ULONG ulCount, ITfDisplayAttributeInfo **rgInfo, ULONG *pcFetched) | CEnumDisplayAttributeInfo |
QueryInterface(REFIID riid, void **ppvObj) | CEnumDisplayAttributeInfo |
Reset() | CEnumDisplayAttributeInfo |
Skip(ULONG ulCount) | CEnumDisplayAttributeInfo |
STDMETHODIMP_(ULONG) AddRef(void) | CEnumDisplayAttributeInfo |
STDMETHODIMP_(ULONG) Release(void) | CEnumDisplayAttributeInfo |
~CEnumDisplayAttributeInfo() | CEnumDisplayAttributeInfo |
Generated on Wed Nov 13 2024 16:56:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/Server.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

Server.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.H
00003
00004   Summary:   Internal include file for the LOCSERVE.DLL server code
00005              sample.  Contains class declarations, resource IDs and string
00006              macros for internal use in constructing this EXE as a local
00007              COM component server.  Declares the CServer server control
00008              object class.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial LOCSERVE.HTM file.
00012              For more specific technical details on the internal workings
00013              see the comments dispersed throughout the module's source code.
00014
00015   Classes:   CServer.
00016
00017   Functions: none
00018
00019   Origin:    8-29-97: atrent - Editor-inheritance from SERVER.H in
00020                the DLLSERVE Tutorial Code Sample. [Revised]
00021
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037
00038 #if !defined(SERVER_H)
00039 #define SERVER_H
00040
00041 #ifdef __cplusplus
00042
00043 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00044   Class:    CServer
00045
00046   Summary:  Class to encapsulate control of this COM server (eg, handle
00047             Lock and Object counting, encapsulate otherwise global data).
00048
00049   Methods:  none
00050 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00051 class CServer
00052 {
00053   public:
00054     CServer(void);
00055     ~CServer(void);
00056
00057     void Lock(void);
00058     void Unlock(void);
00059     void ObjectsUp(void);
00060     void ObjectsDown(void);
00061     BOOL OpenFactories(void);
00062     BOOL CloseFactories(void);
00063
00064     // A place to store the server's instance handle.
00065     HINSTANCE m_hInstServer;
00066
00067     // A place to store the server's main window.
00068     HWND m_hWndServer;
00069
00070     // Global Server living Object count.
00071     LONG m_cObjects;
00072
00073     // Global Server Client Lock count.
00074     LONG m_cLocks;
00075
00076     // Some member variables to store pointers to Class Factories.
00077     IUnknown* m_pCFCar;
00078     IUnknown* m_pCFUtilityCar;
00079     IUnknown* m_pCFCruiseCar;
00080
00081     // Some member variables to store Class Factory registration keys.
00082     DWORD m_dwCFCar;
00083     DWORD m_dwCFUtilityCar;
00084     DWORD m_dwCFCruiseCar;
00085 };
00086
00087 #endif // __cplusplus
00088
00089 // Allow other internal LOCSERVE modules to get at the globals.
00090 extern CServer*  g_pServer;
00091 extern CSendLog* g_pMsgLog;
00092
00093 #endif // SERVER_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello3/Notify.h Source File

  • Web
  • MSAgent
  • c
  • Hello3

Notify.h

Go to the documentation of this file.
00001 #ifndef _AgentNotifySink_h_
00002 #define _AgentNotifySink_h_
00003
00004
00005 #include "Hello3.h"
00006
00007
00008 class AgentNotifySink : public IAgentNotifySinkEx {
00009 public:
00010   AgentNotifySink() : m_cRefs(0) {}
00011    ~AgentNotifySink() {}
00012
00013     STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
00014     STDMETHODIMP_(ULONG) AddRef();
00015     STDMETHODIMP_(ULONG) Release();
00016
00017   STDMETHODIMP GetTypeInfoCount(UINT *);
00018   STDMETHODIMP GetTypeInfo(UINT, LCID, ITypeInfo **);
00019   STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR **, UINT, LCID, DISPID *);
00020   STDMETHODIMP Invoke(DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
00021
00022     STDMETHODIMP Command(long dwCommandID, IUnknown * punkUserInput);
00023     STDMETHODIMP ActivateInputState(long dwCharID, long bActivated);
00024     STDMETHODIMP Restart();
00025     STDMETHODIMP Shutdown();
00026     STDMETHODIMP VisibleState(long dwCharID, long bVisible, long lCause);
00027   STDMETHODIMP Click(long dwCharID, short fwKeys, long X, long Y);
00028   STDMETHODIMP DblClick(long dwCharID, short fwKeys, long X, long Y);
00029   STDMETHODIMP DragStart(long dwCharID, short fwKeys, long X, long Y);
00030   STDMETHODIMP DragComplete(long dwCharID, short fwKeys, long X, long Y);
00031   STDMETHODIMP RequestStart(long dwRequestID);
00032   STDMETHODIMP RequestComplete(long dwRequestID, long hrStatus);
00033   STDMETHODIMP BookMark(long dwBookMarkID);
00034     STDMETHODIMP Idle(long dwCharID, long bStart);
00035   STDMETHODIMP Move(long dwCharID, long X, long Y, long lCause);
00036   STDMETHODIMP Size(long dwCharID, long lWidth, long lHeight);
00037   STDMETHODIMP BalloonVisibleState(long dwCharID, long bVisible);
00038
00039   STDMETHODIMP HelpComplete(long dwCharID, long dwCommandID, long dwCause);
00040   STDMETHODIMP ListeningState(long dwCharacterID, long bListenState, long dwCause);
00041   STDMETHODIMP DefaultCharacterChange(BSTR bszGUID);
00042   STDMETHODIMP AgentPropertyChange();
00043   STDMETHODIMP ActiveClientChange(long dwCharID, long lStatus);
00044
00045
00046 private:
00047   ULONG m_cRefs;
00048 };
00049
00050
00051 #endif
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/Dt.h Source File

  • NetDS
  • WinSock
  • Dt_Dll

Dt.h

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c) 1995 Intel Corp
00004   Copyright (c) 1996 - 2000 Microsoft Corporation
00005
00006   Module Name:
00007
00008     dt.h
00009
00010   Abstract:
00011
00012     Header file containing definitions, function prototypes, and other
00013     stuff for internal use of the debug/trace dll.
00014
00015 --*/
00016
00017
00018 #define NO_OUTPUT       0
00019 #define FILE_ONLY       1
00020 #define WINDOW_ONLY     2
00021 #define FILE_AND_WINDOW 3
00022 #define DEBUGGER 4
00023 #define EC_CHILD 1
00024 #define TEXT_LEN 2048
00025 #define MAX_FP   128
00026
00027 // structure to hold init data
00028 typedef struct _INITDATA {
00029
00030     SYSTEMTIME LocalTime;
00031     DWORD      TID;
00032     DWORD      PID;
00033
00034 } INITDATA, *PINITDATA;
00035
00036 BOOL
00037 DTTextOut(
00038     IN HANDLE FileHandle,
00039     IN char   *String,
00040     IN DWORD  Style);
00041
00042 extern HANDLE LogFileHandle;
00043 extern DWORD  OutputStyle;
00044 extern char   Buffer[TEXT_LEN];
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_MOF_INFO Member List

This is the complete list of members for _MOF_INFO, including all inherited members.
Entry | _MOF_INFO
EventCount | _MOF_INFO
Guid | _MOF_INFO
ItemHeader | _MOF_INFO
Level | _MOF_INFO
strDescription | _MOF_INFO
strType | _MOF_INFO
TypeIndex | _MOF_INFO
Version | _MOF_INFO
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/RecordStatusEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

RecordStatusEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: RecordStatusEnum
00019
00020 public class RecordStatusEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final int adRecOK = 0;
00023   public static final int adRecNew = 1;
00024   public static final int adRecModified = 2;
00025   public static final int adRecDeleted = 4;
00026   public static final int adRecUnmodified = 8;
00027   public static final int adRecInvalid = 16;
00028   public static final int adRecMultipleChanges = 64;
00029   public static final int adRecPendingChanges = 128;
00030   public static final int adRecCanceled = 256;
00031   public static final int adRecCantRelease = 1024;
00032   public static final int adRecConcurrencyViolation = 2048;
00033   public static final int adRecIntegrityViolation = 4096;
00034   public static final int adRecMaxChangesExceeded = 8192;
00035   public static final int adRecObjectOpen = 16384;
00036   public static final int adRecOutOfMemory = 32768;
00037   public static final int adRecPermissionDenied = 65536;
00038   public static final int adRecSchemaViolation = 131072;
00039   public static final int adRecDBDeleted = 262144;
00040 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/dlgsrc.cpp Source File

  • Multimedia
  • Audio
  • multichan

dlgsrc.cpp

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) Microsoft Corportation. All rights reserved.
00003 */
00004
00005 // DlgSrc.cpp : implementation file
00006 //
00007
00008 /*
00009  *  preprocessor section
00010  */
00011
00012 #include <guiddef.h>
00013 #include "stdafx.h"
00014 #include "multichan.h"
00015 #include "childview.h"
00016 #include "DlgSrc.h"
00017 #include <ks.h>
00018 #include <ksmedia.h>
00019
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027
00028 /*
00029  *  definition section
00030  */
00031
00032 CONST_DWORD_REP cdrSpeakers[] =
00033 {
00034     {SPEAKER_FRONT_LEFT,                "SPEAKER_FRONT_LEFT" } ,
00035     {SPEAKER_FRONT_RIGHT,               "SPEAKER_FRONT_RIGHT" } ,
00036     {SPEAKER_FRONT_CENTER,              "SPEAKER_FRONT_CENTER" } ,
00037     {SPEAKER_LOW_FREQUENCY,             "SPEAKER_LOW_FREQUENCY" } ,
00038     {SPEAKER_BACK_LEFT,                 "SPEAKER_BACK_LEFT" } ,
00039     {SPEAKER_BACK_RIGHT,                "SPEAKER_BACK_RIGHT" } ,
00040     {SPEAKER_FRONT_LEFT_OF_CENTER,      "SPEAKER_FRONT_LEFT_OF_CENTER" } ,
00041     {SPEAKER_FRONT_RIGHT_OF_CENTER,     "SPEAKER_FRONT_RIGHT_OF_CENTER" } ,
00042     {SPEAKER_BACK_CENTER,               "SPEAKER_BACK_CENTER" } ,
00043     {SPEAKER_SIDE_LEFT,                 "SPEAKER_SIDE_LEFT" } ,
00044     {SPEAKER_SIDE_RIGHT,                "SPEAKER_SIDE_RIGHT" } ,
00045     {SPEAKER_TOP_CENTER,                "SPEAKER_TOP_CENTER" } ,
00046     {SPEAKER_TOP_FRONT_LEFT,            "SPEAKER_TOP_FRONT_LEFT" } ,
00047     {SPEAKER_TOP_FRONT_CENTER,          "SPEAKER_TOP_FRONT_CENTER" } ,
00048     {SPEAKER_TOP_FRONT_RIGHT,           "SPEAKER_TOP_FRONT_RIGHT" } ,
00049     {SPEAKER_TOP_BACK_LEFT,             "SPEAKER_TOP_BACK_LEFT" } ,
00050     {SPEAKER_TOP_BACK_CENTER,           "SPEAKER_TOP_BACK_CENTER" } ,
00051     {SPEAKER_TOP_BACK_RIGHT,            "SPEAKER_TOP_BACK_RIGHT" } ,
00052     {SPEAKER_NOT_SPECIFIED,             "No specified speaker" }
00053 };
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // CDlgSrc dialog
00057
00058 /*
00059  *  MFC mechanisms
00060  */
00061 void
00062 CDlgSrc::DoDataExchange
00063 (
00064     CDataExchange*  pDX
00065 )
00066 {
00067   CDialog::DoDataExchange(pDX);
00068   //{{AFX_DATA_MAP(CDlgSrc)
00069   DDX_Control(pDX, IDOK, m_butClose);
00070     DDX_Control( pDX, IDC_PLAY, m_butPlay );
00071     DDX_Control( pDX, IDC_STOP, m_butStop );
00072   DDX_Control(pDX, IDC_INPUT, m_cInput);
00073   DDX_Control(pDX, IDC_COMBO_SPEAKER, m_comboSpeaker);
00074   DDX_Check(pDX, IDC_USE, m_fUse);
00075   DDX_CBIndex(pDX, IDC_COMBO_SPEAKER, m_nSpeaker);
00076   DDX_Text(pDX, IDC_INPUT, m_strName);
00077   //}}AFX_DATA_MAP
00078 }
00079
00080
00081 BEGIN_MESSAGE_MAP(CDlgSrc, CDialog)
00082   //{{AFX_MSG_MAP(CDlgSrc)
00083   ON_CBN_SELENDOK(IDC_COMBO_SPEAKER, OnComboSpeaker)
00084   ON_BN_CLICKED(IDC_PLAY, OnPlay)
00085     ON_BN_CLICKED(IDC_STOP, OnStop)
00086   ON_WM_CTLCOLOR()
00087   ON_WM_LBUTTONDOWN()
00088   ON_WM_LBUTTONUP()
00089   ON_WM_MOUSEMOVE()
00090   //}}AFX_MSG_MAP
00091 END_MESSAGE_MAP()
00092
00093 /////////////////////////////////////////////////////////////////////////////
00094
00095 /*
00096  *  Constructors
00097  */
00098
00099 // ----------------------------------------------------------------------------------
00100 // CDlgSrc::CDlgSrc
00101 //  constructor
00102 // ----------------------------------------------------------------------------------
00103 CDlgSrc::CDlgSrc
00104 (
00105     CWnd* pParent /*=NULL*/
00106 )
00107   : CDialog(CDlgSrc::IDD, pParent),
00108     m_strName(TEXT("")),
00109     m_pwndParent(pParent),
00110     m_cSamples(0),
00111     m_cbData(0),
00112     m_nChannel(0),
00113     m_dwChannelMask(SPEAKER_FRONT_LEFT),
00114     m_fDragging(FALSE),
00115     m_fPlayable( FALSE ),
00116     m_lpwhdr( 0 )
00117 {
00118   //{{AFX_DATA_INIT(CDlgSrc)
00119   m_fUse = TRUE;
00120   m_nSpeaker = 0;
00121   m_strName = _T("");
00122   //}}AFX_DATA_INIT
00123
00124     ZeroMemory( &m_wfx, sizeof( WAVEFORMATEX ) );
00125 }
00126
00127 // ----------------------------------------------------------------------------------
00128 // CDlgSrc::~CDlgSrc
00129 //  destructor
00130 // ----------------------------------------------------------------------------------
00131 CDlgSrc::~CDlgSrc
00132 ()
00133 {
00134   //
00135   //  update speaker mask
00136   //
00137   if( g_pdlgDest )
00138     g_pdlgDest->m_wfExt.dwChannelMask ^= m_dwChannelMask;
00139
00140   //
00141   //  release memory
00142   //
00143   SafeLocalFree( m_pvData );
00144   SafeLocalFree( m_lpwhdr );
00145 }
00146
00147 // ----------------------------------------------------------------------------------
00148 // CDlgSrc::Create
00149 //  creates an SRC dialog whose title is strName, position is sizeInitPos, and
00150 //  channel mask is dwChannelMask
00151 // ----------------------------------------------------------------------------------
00152 void
00153 CDlgSrc::Create
00154 (
00155     LPCSTR  strName,
00156     SIZE    sizeInitPos,
00157     DWORD   dwChannelMask
00158 )
00159 {
00160     CDialog::Create( CDlgSrc::IDD, m_pwndParent );
00161
00162     //
00163     //  position the dialog for that nice cascade effect
00164     //
00165     CRect rect;
00166
00167     GetClientRect( &rect );
00168
00169     rect.OffsetRect( *(LPPOINT(&sizeInitPos)) );
00170     rect.right += 4;
00171     rect.bottom += 4;
00172     MoveWindow( &rect, TRUE );
00173
00174     //
00175     //  set window text
00176     //
00177     m_strName = strName;
00178
00179     //
00180     //  populate the speakers combo
00181     //  speaker positions are defined in KSMedia.h or in MMReg.h
00182     //
00183     int i;
00184     int c;
00185     for( c = 0; c < ARRAY_ELEMENTS( cdrSpeakers ); c++ )
00186     {
00187         i = m_comboSpeaker.AddString( cdrSpeakers[c].pstrRep );         //  friendly name
00188         m_comboSpeaker.SetItemData( i, cdrSpeakers[c].dwConstant );     //  index
00189         if( cdrSpeakers[c].dwConstant == dwChannelMask )                //  check out of range
00190             m_nSpeaker = c;
00191     }
00192
00193     m_dwChannelMask = dwChannelMask;                                    //  overall channel mask
00194
00195     //
00196     //  make playable
00197     //
00198     m_fPlayable = TRUE;
00199   m_butPlay.EnableWindow( m_fPlayable );
00200   m_butStop.EnableWindow( !m_fPlayable );
00201
00202     //
00203     // update controls
00204     //
00205     UpdateData( FALSE );
00206 }   //  CDglSrc::Create
00207
00208 /*
00209  *  Accessors
00210  */
00211
00212 // ----------------------------------------------------------------------------------
00213 // AquireData
00214 //  This fn extracts a single channel (nChannelFrom) from the wave data specified by
00215 //  pwfx, pvData, and cbData
00216 // ----------------------------------------------------------------------------------
00217 BOOL
00218 CDlgSrc::AquireData
00219 (
00220     WAVEFORMATEX*   pwfx,
00221     PVOID           pvData,
00222     ULONG           cbData,
00223     UINT            nChannelFrom
00224 )
00225 {
00226     ASSERT( pwfx );
00227
00228     if (! (pwfx && (pwfx->cbSize == 0) && pvData && cbData))
00229         return FALSE;
00230
00231     CopyMemory(&m_wfx, pwfx, sizeof(m_wfx));
00232
00233   GUID  guid = (( WAVEFORMATEXTENSIBLE * )pwfx)->SubFormat;
00234
00235   if( IS_VALID_WAVEFORMATEX_GUID( &guid ) )
00236   {
00237     m_wfx.wFormatTag = EXTRACT_WAVEFORMATEX_ID( &guid );
00238   }
00239   //
00240   //  else no op
00241   //
00242     m_wfx.nChannels = 1;
00243     m_wfx.nBlockAlign = m_wfx.wBitsPerSample / 8;
00244     m_wfx.nAvgBytesPerSec = m_wfx.nBlockAlign * m_wfx.nSamplesPerSec;
00245
00246     // a little more UI
00247     char sz[100];
00248     _snprintf(sz, 100, "%d", pwfx->wBitsPerSample);
00249     SetDlgItemText(IDC_BITDEPTH, sz);
00250     _snprintf(sz, 100, "%d", pwfx->nSamplesPerSec);
00251     SetDlgItemText(IDC_SAMPLERATE, sz);
00252
00253     //
00254     // extract nChannelFrom-th channel from the data
00255     // should be pretty much a no-op for already-mono formats
00256     //
00257     ULONG   nSample;
00258   USHORT  nBytes = pwfx->wBitsPerSample / 8;
00259
00260     m_cSamples = cbData / pwfx->nBlockAlign;
00261     m_cbData = m_wfx.nBlockAlign * m_cSamples;
00262     m_pvData = LocalAlloc(LPTR, m_cbData);
00263     if( 0 == m_pvData)
00264   {
00265     MessageBox( "Insufficient memory to complete the task.", "MultiChan : Error", MB_OK | MB_ICONSTOP );
00266     return( FALSE );
00267   }
00268
00269   //
00270   //  Adding support for multi-channel input
00271   //
00272   if( 1 == pwfx->nChannels )
00273   {
00274     //
00275     //  trivial copy
00276     //
00277         ASSERT(m_cbData == cbData);
00278     CopyMemory( m_pvData, pvData, m_cbData );
00279   }
00280   else
00281   {
00282     //
00283     //  m channels, n bit depth
00284     //  extract out every other m-th group of n bits
00285     //  repeat for m_cSamples
00286     //
00287     BYTE * pbDest = (BYTE * )m_pvData;
00288     BYTE * pbSrc = ( BYTE * )pvData;
00289
00290     //
00291     //  start with the appropriate channel; channels are 0-based
00292     //
00293     pbSrc+= nChannelFrom * ( pwfx->wBitsPerSample / 8 );
00294
00295     for( nSample = 0; nSample < m_cSamples; nSample++ )
00296     {
00297       USHORT  nCount = nBytes;
00298       while( nCount-- )
00299         *pbDest++ = *pbSrc++;
00300
00301       pbSrc+= (pwfx->nChannels - 1) * nBytes;
00302     }
00303   }
00304
00305   return( TRUE );
00306 }   //  CDglSrc::AcquireData
00307
00308 /*
00309  *  UI triggered procedures
00310  */
00311
00312 // ----------------------------------------------------------------------------------
00313 // OnComboSpeaker
00314 //  update speaker mask of dst
00315 // ----------------------------------------------------------------------------------
00316 void CDlgSrc::OnComboSpeaker()
00317 {
00318     //
00319     //  prepare
00320     //
00321     int     nSpeaker = m_nSpeaker;
00322
00323     UpdateData(TRUE);
00324
00325     //
00326     //  make selection
00327     //
00328     m_dwChannelMask = ( DWORD )m_comboSpeaker.GetItemData(m_nSpeaker);
00329
00330     //
00331     //  validate selection
00332     //
00333     if(! ((CChildView*)m_pwndParent)->UpdateDialogs())
00334     {
00335         MessageBox("There is already a channel with that speaker config", "MultiChan : Error!", MB_ICONSTOP | MB_OK);
00336         m_nSpeaker = nSpeaker;
00337         UpdateData( FALSE );
00338     }
00339 }
00340
00341 // ----------------------------------------------------------------------------------
00342 // OnPlay
00343 //  preview button
00344 // ----------------------------------------------------------------------------------
00345 void CDlgSrc::OnPlay()
00346 {
00347   MMRESULT  mmRes = MMSYSERR_NOERROR;
00348
00349     //
00350     //  ensure validity
00351     //
00352   ASSERT( 0 == g_hwo );
00353     ASSERT( m_fPlayable );
00354
00355     //
00356     //  first usage ?
00357     //
00358     if( 0 == m_lpwhdr )
00359     {
00360         m_lpwhdr = ( LPWAVEHDR )LocalAlloc( LPTR, sizeof( WAVEHDR ) );
00361         if( 0 == m_lpwhdr )
00362         {
00363             MessageBox( "Insufficient memory for rendering !", "MultiChan : Error", MB_ICONEXCLAMATION | MB_OK );
00364             return;
00365         }
00366     }
00367
00368     m_lpwhdr->dwBufferLength = m_cbData;
00369     m_lpwhdr->lpData = (char*)m_pvData;
00370
00371     //
00372     //  using a callback mechanism to allow synch playback
00373     //
00374     mmRes = waveOutOpen(    &g_hwo,
00375                             WAVE_MAPPER,
00376                             &m_wfx,
00377                             ( DWORD_PTR )WavePlayFileCB,
00378                             ( DWORD_PTR )this,
00379                             CALLBACK_FUNCTION
00380                         );
00381   if( TrapMMError(mmRes, "waveOutOpen") )
00382   {
00383     mmRes = waveOutPrepareHeader( g_hwo, m_lpwhdr, sizeof(WAVEHDR) );
00384     if( TrapMMError(mmRes, "waveOutPrepareHeader") )
00385     {
00386             //
00387             //  revert playable state
00388       //  disable any other dialog
00389             //
00390       WaveTogglePlayback( this, WAVE_TOGGLE_DISABLE );
00391
00392             //
00393             //  start singing
00394             //
00395       mmRes = waveOutWrite( g_hwo, m_lpwhdr, sizeof(WAVEHDR));
00396       TrapMMError(mmRes, "waveOutWrite");
00397         }   //  prepare header
00398     }       //  open
00399 }           //  CDlgSrc::OnPlay
00400
00401 //  -------------------------------------------------------------------------------------
00402 //  OnStop
00403 //
00404 //  -------------------------------------------------------------------------------------
00405 inline
00406 void
00407 CDlgSrc::OnStop
00408 ()
00409 {
00410     MMRESULT    mmRes = MMSYSERR_NOERROR;
00411
00412     //
00413     //  ensure validity
00414     //
00415     ASSERT( g_hwo );
00416     ASSERT( !m_fPlayable );
00417
00418     //
00419     //  stop playback
00420     //
00421     mmRes = waveOutReset( g_hwo );
00422     TrapMMError( mmRes, "waveOutReset" );
00423
00424 }   //  CDglSrc::OnStop
00425
00426 // ----------------------------------------------------------------------------------
00427 // dummy implementations to prevent dlgs from disappearing when user hits enter or esc
00428 // ----------------------------------------------------------------------------------
00429 inline
00430 void
00431 CDlgSrc::OnOK
00432 ()
00433 {
00434     POSITION pos = g_listSources.Find(this, NULL);
00435     g_listSources.RemoveAt(pos);
00436     g_pChildView->UpdateDialogs();
00437     delete this;
00438 }   //  CDglSrc::OnOK
00439
00440 //
00441 //
00442 //
00443 inline
00444 void
00445 CDlgSrc::OnCancel
00446 ()
00447 {
00448     POSITION pos = g_listSources.Find(this, NULL);
00449     g_listSources.RemoveAt(pos);
00450     g_pChildView->UpdateDialogs();
00451     delete this;
00452 }   //  CDglSrc::OnCancel
00453
00454 //
00455 //
00456 //
00457 HBRUSH
00458 CDlgSrc::OnCtlColor
00459 (
00460     CDC* pDC,
00461     CWnd* pWnd,
00462     UINT nCtlColor
00463 )
00464 {
00465   HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
00466
00467     if((nCtlColor == CTLCOLOR_STATIC))
00468     {
00469         if(pWnd->m_hWnd == m_cInput.m_hWnd)
00470         {
00471             pDC->SetTextColor(GetSysColor(COLOR_CAPTIONTEXT));
00472             pDC->SetBkMode(TRANSPARENT);  //BkColor(GetSysColor(COLOR_ACTIVECAPTION));
00473             return GetSysColorBrush(COLOR_ACTIVECAPTION);
00474         }
00475     }
00476
00477   return hbr;
00478 }   //  CDglSrc::OnCtlColor
00479
00480 //
00481 //
00482 //
00483 void
00484 CDlgSrc::OnLButtonDown
00485 (
00486     UINT nFlags,
00487     CPoint point
00488 )
00489 {
00490   RECT    rcClient;
00491
00492     m_cInput.GetClientRect(&rcClient);
00493     m_cInput.MapWindowPoints(this, &rcClient);
00494     m_fDragging = PtInRect(&rcClient, point);
00495
00496     if(m_fDragging)
00497     {
00498         SetCapture();
00499         m_fDragging = TRUE;
00500         m_ptPosInCaption = point;
00501     }
00502
00503     CDialog::OnLButtonDown(nFlags, point);
00504
00505     SetFocus();
00506     SetWindowPos(&wndTop, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
00507 }   //  CDglSrc::OnLButtonDown
00508
00509 //
00510 //
00511 //
00512 void
00513 CDlgSrc::OnLButtonUp
00514 (
00515     UINT nFlags,
00516     CPoint point
00517 )
00518 {
00519   m_fDragging = FALSE;
00520     ReleaseCapture();
00521
00522   CDialog::OnLButtonUp(nFlags, point);
00523 }   //  CDglSrc::OnLButtonUp
00524
00525 //
00526 //
00527 //
00528 void
00529 CDlgSrc::OnMouseMove
00530 (
00531     UINT nFlags,
00532     CPoint point
00533 )
00534 {
00535   RECT    rcClientParent;
00536
00537     GetParent()->GetClientRect(&rcClientParent);
00538     GetParent()->MapWindowPoints(this, &rcClientParent);
00539     if(PtInRect(&rcClientParent, point))
00540     {
00541         if(m_fDragging)
00542         {
00543             CRect   rcWindow;
00544             CRect   rcParent;
00545             CPoint  pt(point.x - m_ptPosInCaption.x, point.y - m_ptPosInCaption.y);
00546
00547             GetWindowRect(&rcWindow);
00548             GetParent()->GetWindowRect(&rcParent);
00549
00550             rcWindow.OffsetRect(pt);
00551             rcWindow -= rcParent.TopLeft();
00552
00553             SetWindowPos(NULL, rcWindow.left, rcWindow.top, 0,0, SWP_NOZORDER | SWP_NOSIZE);
00554         }
00555     }
00556     else
00557     {
00558         ReleaseCapture();
00559         m_fDragging = FALSE;
00560     }
00561 }   //  CDglSrc::OnMouseMove
00562
00563 //
00564 //
00565 //
00566 BOOL
00567 CDlgSrc::OnInitDialog
00568 ()
00569 {
00570   CDialog::OnInitDialog();
00571
00572     HICON hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_CHECK));
00573     m_butClose.SetIcon(hIcon);
00574   return TRUE;  // return TRUE unless you set the focus to a control
00575                 // EXCEPTION: OCX Property Pages should return FALSE
00576 }   //  CDlgSrc::OnInitDialog
00577
00578
00579 //
00580 //
00581 //
00582 LRESULT
00583 CDlgSrc::WindowProc
00584 (
00585     UINT    nMessage,
00586     WPARAM  wParam,
00587     LPARAM  lParam
00588 )
00589 {
00590     MMRESULT    mmRes = MMSYSERR_NOERROR;
00591
00592     switch( nMessage )
00593     {
00594     case    WM_START_PLAYBACK:
00595         {
00596             break;
00597         }
00598     case    WM_STOP_PLAYBACK:
00599         {
00600             //
00601             //  revert playable state
00602             //
00603             WaveTogglePlayback( this, WAVE_TOGGLE_ALLOW );
00604
00605             //
00606             //  unprepare and release
00607             //
00608             mmRes = waveOutUnprepareHeader( g_hwo, m_lpwhdr, sizeof( WAVEHDR ) );
00609             if( TrapMMError( mmRes, "waveOutUnprepareHeader" ) )
00610             {
00611                 mmRes = waveOutClose( g_hwo );
00612                 TrapMMError( mmRes, "waveOutClose" );
00613
00614                 g_hwo = 0;
00615             }
00616             break;
00617         }
00618     }
00619     return( CDialog::WindowProc( nMessage, wParam, lParam ) );
00620 }   //  CDlgSrc::WindowProc
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/UtilCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

UtilCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTILCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCar COM object class.
00005
00006              UTILCAR showcases the construction of the COUtilityCar COM
00007              object class with the IUnknown, ICar, and IUtility interfaces.
00008              This is done through Containment reuse of COCar's ICar
00009              interface features.
00010
00011              This multiple interface COM Object Class is achieved via
00012              the technique of nested classes: the implementation of the
00013              ICar and IUtility interfaces are nested inside of the
00014              COUtilityCar COM object class.
00015
00016              For a comprehensive tutorial code tour of this module's
00017              contents and offerings see the tutorial DLLSERVE.HTM file.
00018              For more specific technical details on the internal workings
00019              see the comments dispersed throughout the module's source code.
00020
00021   Classes:   COUtilityCar
00022
00023   Functions: .
00024
00025   Origin:    9-11-95: atrent - Editor-inheritance from UTILCAR.H in
00026                the COMOBJ Tutorial Code Sample.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 #if !defined(UTILCAR_H)
00044 #define UTILCAR_H
00045
00046 #ifdef __cplusplus
00047
00048 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00049   ObjectClass: COUtilityCar
00050
00051   Summary:     COM Object Class for COUtilityCar COM Objects.  COM objects
00052                of this class augment COCar COM objects (which offer ICar
00053                interface features of Shift, Clutch, Speed, and Steer) with
00054                IUtility interface features (Offroad and Winch).  This
00055                COUtilityCar COM object class is constructed by containment
00056                reuse of the COCar COM object class.  The mulitple
00057                interfaces on this COM object class are constructed via
00058                the nested interface classes technique.
00059
00060   Interfaces:  IUnknown
00061                  Standard interface providing COM object features.
00062                ICar
00063                  Basic Car operation features.
00064                IUtility
00065                  Sport-utility vehicle offroad features.
00066
00067   Aggregation: Yes, COUtilityCar COM objects are aggregatable by passing
00068                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00069 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00070 class COUtilityCar : public IUnknown
00071 {
00072   public:
00073     // Main Object Constructor & Destructor.
00074     COUtilityCar(IUnknown* pUnkOuter, CServer* pServer);
00075     ~COUtilityCar(void);
00076
00077     // A general method for initializing a newly created COUtilityCar.
00078     HRESULT Init(void);
00079
00080     // IUnknown methods. Main object, non-delegating.
00081     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00082     STDMETHODIMP_(ULONG) AddRef(void);
00083     STDMETHODIMP_(ULONG) Release(void);
00084
00085     // We get this ICar interface pointer via containment reuse of the
00086     // ICar interface in an instantiated COCar.
00087     ICar*           m_pICar;
00088
00089   private:
00090     // We show nested interface class implementations here.
00091
00092     // We implement the basic ICar interface in this COUtilityCar
00093     // COM object class.
00094     class CImpICar : public ICar
00095     {
00096       public:
00097         // Interface Implementation Constructor & Destructor.
00098         CImpICar(COUtilityCar* pBackObj, IUnknown* pUnkOuter);
00099         ~CImpICar(void);
00100
00101         // IUnknown methods.
00102         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00103         STDMETHODIMP_(ULONG) AddRef(void);
00104         STDMETHODIMP_(ULONG) Release(void);
00105
00106         // ICar methods.
00107         STDMETHODIMP Shift(short nGear);
00108         STDMETHODIMP Clutch(short nEngaged);
00109         STDMETHODIMP Speed(short nMph);
00110         STDMETHODIMP Steer(short nAngle);
00111
00112       private:
00113         // Data private to this COUtilityCar interface implementation of ICar.
00114         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00115         COUtilityCar* m_pBackObj;    // Parent Object back pointer.
00116         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00117     };
00118
00119     // We implement the IUtility interface (ofcourse) in this COUtilityCar
00120     // COM object class.  This is the interface that we are using as an
00121     // augmentation to the existing COCar COM object class.
00122     class CImpIUtility : public IUtility
00123     {
00124       public:
00125         // Interface Implementation Constructor & Destructor.
00126         CImpIUtility(COUtilityCar* pBackObj, IUnknown* pUnkOuter);
00127         ~CImpIUtility(void);
00128
00129         // IUnknown methods.
00130         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00131         STDMETHODIMP_(ULONG) AddRef(void);
00132         STDMETHODIMP_(ULONG) Release(void);
00133
00134         // IUtility methods.
00135         STDMETHODIMP Offroad(short nGear);
00136         STDMETHODIMP Winch(short nRpm);
00137
00138       private:
00139         // Data private to this interface implementation of IUtility.
00140         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00141         COUtilityCar* m_pBackObj;    // Parent Object back pointer.
00142         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00143     };
00144
00145     // Make the otherwise private and nested ICar interface implementation
00146     // a friend to COM object instantiations of this selfsame COUtilityCar
00147     // COM object class.
00148     friend CImpICar;
00149     friend CImpIUtility;
00150
00151     // Private data of COUtilityCar COM objects.
00152
00153     // Nested ICar implementation instantiation.
00154     CImpICar        m_ImpICar;
00155
00156     // Nested IUtility implementation instantiation.
00157     CImpIUtility    m_ImpIUtility;
00158
00159     // Main Object reference count.
00160     ULONG           m_cRefs;
00161
00162     // Outer unknown (aggregation & delegation).
00163     IUnknown*       m_pUnkOuter;
00164
00165     // Pointer to this component server's control object.
00166     CServer*        m_pServer;
00167 };
00168
00169 typedef COUtilityCar* PCOUtilityCar;
00170
00171 #endif // __cplusplus
00172
00173
00174 #endif // UTILCAR_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/StdAfx.h Source File

  • Multimedia
  • wia
  • GetImage

StdAfx.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #ifndef __STDAFX__
00008 #define __STDAFX__
00009
00010 #if _MSC_VER > 1000
00011 #pragma once
00012 #endif // _MSC_VER > 1000
00013
00014 #ifndef WIN32_LEAN_AND_MEAN
00015 #define WIN32_LEAN_AND_MEAN
00016 #endif //WIN32_LEAN_AND_MEAN
00017
00018 #include <tchar.h>
00019 #include <stdio.h>
00020 #include <windows.h>
00021 #include <commctrl.h>
00022 #include <shellapi.h>
00023 #include <objbase.h>
00024 #include <atlbase.h>
00025 #include <wia.h>
00026 #include <sti.h>
00027 #include <gdiplus.h>
00028
00029 #define COUNTOF(x) ( sizeof(x) / sizeof(*x) )
00030
00031 #define DEFAULT_STRING_SIZE 256
00032
00033 extern HINSTANCE g_hInstance;
00034
00035 //{{AFX_INSERT_LOCATION}}
00036
00037 #endif //__STDAFX__
00038
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminCatalog.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminCatalog.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=F618C514-DFB8-11D1-A2CF-00805FC79235,DynamicCasts)
00019     @com.interface(iid=DD662187-DFC2-11D1-A2CF-00805FC79235, thread=AUTO, type=DUAL) */
00020 public class COMAdminCatalog implements IUnknown,com.ms.com.NoAutoScripting,comadmin.ICOMAdminCatalog
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=METHOD, name="GetCollection", addFlagsVtable=4)
00023       @com.parameters([in,type=STRING] bstrCollName, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00024   public native Object GetCollection(String bstrCollName);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=METHOD, name="Connect", addFlagsVtable=4)
00027       @com.parameters([in,type=STRING] bstrConnectString, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00028   public native Object Connect(String bstrConnectString);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=PROPGET, name="MajorVersion", addFlagsVtable=4)
00031       @com.parameters([type=I4] return) */
00032   public native int getMajorVersion();
00033
00034   /** @com.method(vtoffset=7, dispid=4, type=PROPGET, name="MinorVersion", addFlagsVtable=4)
00035       @com.parameters([type=I4] return) */
00036   public native int getMinorVersion();
00037
00038   /** @com.method(vtoffset=8, dispid=5, type=METHOD, name="GetCollectionByQuery", addFlagsVtable=4)
00039       @com.parameters([in,type=STRING] bstrCollName, [in,vt=16396,type=SAFEARRAY] aQuery, [iid=00020400-0000-0000-C000-000000000046,thread=AUTO,type=DISPATCH] return) */
00040   public native Object GetCollectionByQuery(String bstrCollName, com.ms.com.SafeArray aQuery);
00041
00042   /** @com.method(vtoffset=9, dispid=6, type=METHOD, name="ImportComponent", addFlagsVtable=4)
00043       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrCLSIDOrProgId) */
00044   public native void ImportComponent(String bstrApplIdOrName, String bstrCLSIDOrProgId);
00045
00046   /** @com.method(vtoffset=10, dispid=7, type=METHOD, name="InstallComponent", addFlagsVtable=4)
00047       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrDLL, [in,type=STRING] bstrTLB, [in,type=STRING] bstrPSDLL) */
00048   public native void InstallComponent(String bstrApplIdOrName, String bstrDLL, String bstrTLB, String bstrPSDLL);
00049
00050   /** @com.method(vtoffset=11, dispid=8, type=METHOD, name="ShutdownApplication", addFlagsVtable=4)
00051       @com.parameters([in,type=STRING] bstrApplIdOrName) */
00052   public native void ShutdownApplication(String bstrApplIdOrName);
00053
00054   /** @com.method(vtoffset=12, dispid=9, type=METHOD, name="ExportApplication", addFlagsVtable=4)
00055       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrApplicationFile, [in,type=I4] lOptions) */
00056   public native void ExportApplication(String bstrApplIdOrName, String bstrApplicationFile, int lOptions);
00057
00058   /** @com.method(vtoffset=13, dispid=10, type=METHOD, name="InstallApplication", addFlagsVtable=4)
00059       @com.parameters([in,type=STRING] bstrApplicationFile, [in,type=STRING] bstrDestinationDirectory, [in,type=I4] lOptions, [in,type=STRING] bstrUserId, [in,type=STRING] bstrPassword, [in,type=STRING] bstrRSN) */
00060   public native void InstallApplication(String bstrApplicationFile, String bstrDestinationDirectory, int lOptions, String bstrUserId, String bstrPassword, String bstrRSN);
00061
00062   /** @com.method(vtoffset=14, dispid=11, type=METHOD, name="StopRouter", addFlagsVtable=4)
00063       @com.parameters() */
00064   public native void StopRouter();
00065
00066   /** @com.method(vtoffset=15, dispid=12, type=METHOD, name="RefreshRouter", addFlagsVtable=4)
00067       @com.parameters() */
00068   public native void RefreshRouter();
00069
00070   /** @com.method(vtoffset=16, dispid=13, type=METHOD, name="StartRouter", addFlagsVtable=4)
00071       @com.parameters() */
00072   public native void StartRouter();
00073
00074   /** @com.method(vtoffset=17, dispid=14, type=METHOD, name="Reserved1", addFlagsVtable=4)
00075       @com.parameters() */
00076   public native void Reserved1();
00077
00078   /** @com.method(vtoffset=18, dispid=15, type=METHOD, name="Reserved2", addFlagsVtable=4)
00079       @com.parameters() */
00080   public native void Reserved2();
00081
00082   /** @com.method(vtoffset=19, dispid=16, type=METHOD, name="InstallMultipleComponents", addFlagsVtable=4)
00083       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,vt=16396,type=SAFEARRAY] varFileNames, [in,vt=16396,type=SAFEARRAY] varCLSIDS) */
00084   public native void InstallMultipleComponents(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS);
00085
00086   /** @com.method(vtoffset=20, dispid=17, type=METHOD, name="GetMultipleComponentsInfo", addFlagsVtable=4)
00087       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,vt=16396,type=SAFEARRAY] varFileNames, [out,vt=16396,type=SAFEARRAY] varCLSIDS, [out,vt=16396,type=SAFEARRAY] varClassNames, [out,vt=16396,type=SAFEARRAY] varFileFlags, [out,vt=16396,type=SAFEARRAY] varComponentFlags) */
00088   public native void GetMultipleComponentsInfo(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS, com.ms.com.SafeArray varClassNames, com.ms.com.SafeArray varFileFlags, com.ms.com.SafeArray varComponentFlags);
00089
00090   /** @com.method(vtoffset=21, dispid=18, type=METHOD, name="RefreshComponents", addFlagsVtable=4)
00091       @com.parameters() */
00092   public native void RefreshComponents();
00093
00094   /** @com.method(vtoffset=22, dispid=19, type=METHOD, name="BackupREGDB", addFlagsVtable=4)
00095       @com.parameters([in,type=STRING] bstrBackupFilePath) */
00096   public native void BackupREGDB(String bstrBackupFilePath);
00097
00098   /** @com.method(vtoffset=23, dispid=20, type=METHOD, name="RestoreREGDB", addFlagsVtable=4)
00099       @com.parameters([in,type=STRING] bstrBackupFilePath) */
00100   public native void RestoreREGDB(String bstrBackupFilePath);
00101
00102   /** @com.method(vtoffset=24, dispid=21, type=METHOD, name="QueryApplicationFile", addFlagsVtable=4)
00103       @com.parameters([in,type=STRING] bstrApplicationFile, [out,size=1,elementType=STRING,type=ARRAY] bstrApplicationName, [out,size=1,elementType=STRING,type=ARRAY] bstrApplicationDescription, [out,size=1,elementType=BOOLEAN,type=ARRAY] bHasUsers, [out,size=1,elementType=BOOLEAN,type=ARRAY] bIsProxy, [out,vt=16396,type=SAFEARRAY] varFileNames) */
00104   public native void QueryApplicationFile(String bstrApplicationFile, String[] bstrApplicationName, String[] bstrApplicationDescription, boolean[] bHasUsers, boolean[] bIsProxy, com.ms.com.SafeArray varFileNames);
00105
00106   /** @com.method(vtoffset=25, dispid=22, type=METHOD, name="StartApplication", addFlagsVtable=4)
00107       @com.parameters([in,type=STRING] bstrApplIdOrName) */
00108   public native void StartApplication(String bstrApplIdOrName);
00109
00110   /** @com.method(vtoffset=26, dispid=23, type=METHOD, name="ServiceCheck", addFlagsVtable=4)
00111       @com.parameters([in,type=I4] lService, [type=I4] return) */
00112   public native int ServiceCheck(int lService);
00113
00114   /** @com.method(vtoffset=27, dispid=24, type=METHOD, name="InstallMultipleEventClasses", addFlagsVtable=4)
00115       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,vt=16396,type=SAFEARRAY] varFileNames, [in,vt=16396,type=SAFEARRAY] varCLSIDS) */
00116   public native void InstallMultipleEventClasses(String bstrApplIdOrName, com.ms.com.SafeArray varFileNames, com.ms.com.SafeArray varCLSIDS);
00117
00118   /** @com.method(vtoffset=28, dispid=25, type=METHOD, name="InstallEventClass", addFlagsVtable=4)
00119       @com.parameters([in,type=STRING] bstrApplIdOrName, [in,type=STRING] bstrDLL, [in,type=STRING] bstrTLB, [in,type=STRING] bstrPSDLL) */
00120   public native void InstallEventClass(String bstrApplIdOrName, String bstrDLL, String bstrTLB, String bstrPSDLL);
00121
00122   /** @com.method(vtoffset=29, dispid=26, type=METHOD, name="GetEventClassesForIID", addFlagsVtable=4)
00123       @com.parameters([in,type=STRING] bstrIID, [out,vt=16396,type=SAFEARRAY] varCLSIDS, [out,vt=16396,type=SAFEARRAY] varProgIDs, [out,vt=16396,type=SAFEARRAY] varDescriptions) */
00124   public native void GetEventClassesForIID(String bstrIID, com.ms.com.SafeArray varCLSIDS, com.ms.com.SafeArray varProgIDs, com.ms.com.SafeArray varDescriptions);
00125
00126
00127   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xdd662187, (short)0xdfc2, (short)0x11d1, (byte)0xa2, (byte)0xcf, (byte)0x0, (byte)0x80, (byte)0x5f, (byte)0xc7, (byte)0x92, (byte)0x35);
00128
00129   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0xf618c514, (short)0xdfb8, (short)0x11d1, (byte)0xa2, (byte)0xcf, (byte)0x0, (byte)0x80, (byte)0x5f, (byte)0xc7, (byte)0x92, (byte)0x35);
00130 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/Debug.Cpp Source File

  • Web
  • NetMeeting
  • NMChat

Debug.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       DEBUG.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 #ifdef DEBUG /* The whole file! */
00019
00020 //****************************************************************************
00021 //
00022 // VOID FAR PASCAL AssertProc(LPSTR lpszMsg, LPSTR lpszAssert, LPSTR lpszFile, UINT line)
00023 //
00024 //****************************************************************************
00025
00026 VOID FAR PASCAL AssertProc(LPSTR lpszMsg, LPSTR lpszAssert, LPSTR lpszFile, UINT line)
00027 {
00028   int  id = 0;
00029   TCHAR szBuffer[1024]; // a big buffer
00030   ZeroMemory(szBuffer, 1024 * sizeof(TCHAR));
00031
00032   _sntprintf(szBuffer, 1023, TEXT("Assert: %s\nFile %s, Line %d"),
00033     (lpszMsg && *lpszMsg) ? lpszMsg  : lpszAssert,
00034     lpszFile ? lpszFile : TEXT(""), line);
00035
00036   OutputDebugString(szBuffer);
00037
00038   do
00039   {
00040     id = MessageBox(NULL, (LPSTR)szBuffer, TEXT("NmChat Assert"),
00041           MB_ICONHAND | MB_ABORTRETRYIGNORE | MB_SYSTEMMODAL);
00042
00043     switch (id)
00044     {
00045       case IDRETRY:
00046       {
00047         DebugBreak();
00048         break;
00049       }
00050       case IDABORT:
00051       {
00052         FatalAppExit(0, (LPSTR)szBuffer);
00053         break;
00054       }
00055       case IDIGNORE:
00056       default:
00057       {
00058         break;
00059       }
00060     }
00061   }while (id == IDRETRY);
00062 }
00063
00064
00065
00066 #endif /* DEBUG - the whole file! */
00067
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/dataobj.h Source File

  • SysMgmt
  • MMC
  • Nameext

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097
00098 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/helper.h Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

helper.h

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: Helper.h
00003 //
00004 // Description: HRESULT Helper Macros
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022 #define __LONGSTRING(string) L##string
00023 #define LONGSTRING(string) __LONGSTRING(string)
00024
00025
00026 #define CHECK_HR(hr)                                      \
00027 {                                                 \
00028    if(FAILED(hr))                                       \
00029       goto error;                                       \
00030 }
00031
00032
00033
00034 #define XCHECK_HR(hr)                                   \
00035 {                                                 \
00036    if(FAILED(myHandleResult(hr, LONGSTRING(__FILE__), __LINE__))) \
00037       goto error;                                       \
00038 }
00039
00040
00041
00042 HRESULT myHandleResult(HRESULT hrReturned, LPCWSTR pwszFile, ULONG ulLine);
00043 HRESULT myDisplayErrorRecord(HRESULT hrReturned, ULONG iRecord, IErrorRecords* pIErrorRecords, LPCWSTR pwszFile, ULONG ulLine);
00044 HRESULT myDisplayErrorInfo(HRESULT hrReturned, IErrorInfo* pIErrorInfo, LPCWSTR pwszFile, ULONG ulLine);
00045 HRESULT myGetSqlErrorInfo(ULONG iRecord, IErrorRecords* pIErrorRecords, BSTR* pBstr, LONG* plNativeError);
00046
00047
00048 ////////////////////////////////////////////////////////////////////////
00049 // myHandleResult
00050 //
00051 // This function is called as part of the XCHECK_HR macro; it takes an
00052 // HRESULT, which is returned by the method called in the XCHECK_HR
00053 // macro, and the file and line number where the method call was made.
00054 // If the method call failed, this function attempts to get and display
00055 // the extended error information for the call from the IErrorInfo,
00056 // IErrorRecords, and ISQLErrorInfo interfaces.
00057 //
00058 ////////////////////////////////////////////////////////////////////////
00059 HRESULT myHandleResult
00060    (
00061    HRESULT           hrReturned,
00062    LPCWSTR           pwszFile,
00063    ULONG             ulLine
00064    )
00065 {
00066    HRESULT           hr;
00067    IErrorInfo *      pIErrorInfo      = NULL;
00068    IErrorRecords *   pIErrorRecords   = NULL;
00069    ULONG             cRecords;
00070    ULONG             iErr;
00071
00072    // If the method called as part of the XCHECK_HR macro failed,
00073    // we will attempt to get extended error information for the call
00074    if( FAILED(hrReturned) )
00075    {
00076       // Obtain the current error object, if any, by using the
00077       // Automation GetErrorInfo function, which will give
00078       // us back an IErrorInfo interface pointer if successful
00079       hr = GetErrorInfo(0, &pIErrorInfo);
00080
00081       // We've got the IErrorInfo interface pointer on the error object
00082       if( SUCCEEDED(hr) && pIErrorInfo )
00083       {
00084          // OLE DB extends the Automation error model by allowing
00085          // error objects to support the IErrorRecords interface. This
00086          // interface can expose information on multiple errors.
00087          hr = pIErrorInfo->QueryInterface(IID_IErrorRecords,
00088                   (void**)&pIErrorRecords);
00089          if( SUCCEEDED(hr) )
00090          {
00091             // Get the count of error records from the object
00092             CHECK_HR(hr = pIErrorRecords->GetRecordCount(&cRecords));
00093
00094             // Loop through the set of error records, and
00095             // display the error information for each one
00096             for( iErr = 0; iErr < cRecords; iErr++ )
00097             {
00098                myDisplayErrorRecord(hrReturned, iErr, pIErrorRecords,
00099                   pwszFile, ulLine);
00100             }
00101          }
00102          // The object didn't support IErrorRecords; display
00103          // the error information for this single error
00104          else
00105          {
00106             myDisplayErrorInfo(hrReturned, pIErrorInfo, pwszFile, ulLine);
00107          }
00108       }
00109       // There was no error object, so just display the HRESULT
00110       // to the user
00111       else
00112       {
00113          wprintf(L"\nNo Error Info posted; HResult: 0x%08x\n"
00114             L"File: %s, Line: %d\n", hrReturned, pwszFile, ulLine);
00115       }
00116    }
00117
00118 error:
00119    if( pIErrorInfo )
00120       pIErrorInfo->Release();
00121    if( pIErrorRecords )
00122       pIErrorRecords->Release();
00123    return hrReturned;
00124 }
00125
00126
00127 ////////////////////////////////////////////////////////////////////////
00128 // myDisplayErrorRecord
00129 //
00130 // This function displays the error information for a single error
00131 // record, including information from ISQLErrorInfo, if supported
00132 //
00133 ////////////////////////////////////////////////////////////////////////
00134 HRESULT myDisplayErrorRecord
00135    (
00136    HRESULT           hrReturned,
00137    ULONG             iRecord,
00138    IErrorRecords *   pIErrorRecords,
00139    LPCWSTR           pwszFile,
00140    ULONG             ulLine
00141    )
00142 {
00143    HRESULT           hr;
00144    IErrorInfo *      pIErrorInfo       = NULL;
00145    BSTR              bstrDescription   = NULL;
00146    BSTR              bstrSource        = NULL;
00147    BSTR              bstrSQLInfo       = NULL;
00148
00149    static LCID       lcid              = GetUserDefaultLCID();
00150
00151    LONG              lNativeError      = 0;
00152    ERRORINFO         ErrorInfo;
00153    WCHAR       szBuff[1024];
00154
00155    // Get the IErrorInfo interface pointer for this error record
00156    CHECK_HR(hr = pIErrorRecords->GetErrorInfo(iRecord, lcid, &pIErrorInfo));
00157
00158    // Get the description of this error
00159    CHECK_HR(hr = pIErrorInfo->GetDescription(&bstrDescription));
00160
00161    // Get the source of this error
00162    CHECK_HR(hr = pIErrorInfo->GetSource(&bstrSource));
00163
00164    // Get the basic error information for this record
00165    CHECK_HR(hr = pIErrorRecords->GetBasicErrorInfo(iRecord, &ErrorInfo));
00166
00167    // If the error object supports ISQLErrorInfo, get this information
00168    myGetSqlErrorInfo(iRecord, pIErrorRecords, &bstrSQLInfo, &lNativeError);
00169
00170    // Display the error information to the user
00171    if( bstrSQLInfo )
00172    {
00173       _snwprintf(szBuff, 1024, L"\nErrorRecord:  HResult: 0x%08x\nDescription: %s\n"
00174          L"SQLErrorInfo: %s\nSource: %s\nFile: %s, Line: %d\n",
00175          ErrorInfo.hrError,
00176          bstrDescription,
00177          bstrSQLInfo,
00178          bstrSource,
00179          pwszFile,
00180          ulLine);
00181    }
00182    else
00183    {
00184       _snwprintf(szBuff, 1024, L"\nErrorRecord:  HResult: 0x%08x\nDescription: %s\n"
00185          L"Source: %s\nFile: %s, Line: %d\n",
00186          ErrorInfo.hrError,
00187          bstrDescription,
00188          bstrSource,
00189          pwszFile,
00190          ulLine);
00191    }
00192    // Display the formatter buffer
00193   wsprintf(szBuff);
00194
00195 error:
00196    if( pIErrorInfo )
00197       pIErrorInfo->Release();
00198    SysFreeString(bstrDescription);
00199    SysFreeString(bstrSource);
00200    SysFreeString(bstrSQLInfo);
00201    return hr;
00202 }
00203
00204
00205 ////////////////////////////////////////////////////////////////////////
00206 // myDisplayErrorInfo
00207 //
00208 // This function displays basic error information for an error object
00209 // that doesn't support the IErrorRecords interface
00210 //
00211 ////////////////////////////////////////////////////////////////////////
00212 HRESULT myDisplayErrorInfo
00213    (
00214    HRESULT        hrReturned,
00215    IErrorInfo *   pIErrorInfo,
00216    LPCWSTR        pwszFile,
00217    ULONG          ulLine
00218    )
00219 {
00220    HRESULT        hr;
00221    BSTR           bstrDescription   = NULL;
00222    BSTR           bstrSource        = NULL;
00223
00224    // Get the description of the error
00225    CHECK_HR(hr = pIErrorInfo->GetDescription(&bstrDescription));
00226
00227    // Get the source of the error -- this will be the window title
00228    CHECK_HR(hr = pIErrorInfo->GetSource(&bstrSource));
00229
00230    // Display this error information
00231    wprintf(L"\nErrorInfo:  HResult: 0x%08x, Description: %s\nSource: %s\n"
00232             L"File: %s, Line: %d\n",
00233             hrReturned,
00234             bstrDescription,
00235             bstrSource,
00236             pwszFile,
00237             ulLine);
00238
00239 error:
00240    SysFreeString(bstrDescription);
00241    SysFreeString(bstrSource);
00242    return hr;
00243 }
00244
00245
00246 ////////////////////////////////////////////////////////////////////////
00247 // myGetSqlErrorInfo
00248 //
00249 // If the error object supports ISQLErrorInfo, get the SQL error
00250 // string and native error code for this error
00251 //
00252 ////////////////////////////////////////////////////////////////////////
00253 HRESULT myGetSqlErrorInfo
00254    (
00255    ULONG             iRecord,
00256    IErrorRecords *   pIErrorRecords,
00257    BSTR *            pBstr,
00258    LONG *            plNativeError
00259    )
00260 {
00261    HRESULT           hr;
00262    ISQLErrorInfo *   pISQLErrorInfo   = NULL;
00263    LONG              lNativeError     = 0;
00264
00265    // Attempt to get the ISQLErrorInfo interface for this error
00266    // record through GetCustomErrorObject. Note that ISQLErrorInfo
00267    // is not mandatory, so failure is acceptable here.
00268    CHECK_HR(hr = pIErrorRecords->GetCustomErrorObject(
00269             iRecord,                               // iRecord
00270             IID_ISQLErrorInfo,                     // riid
00271             (IUnknown**)&pISQLErrorInfo            // ppISQLErrorInfo
00272             ));
00273
00274    // If we obtained the ISQLErrorInfo interface, get the SQL
00275    // error string and native error code for this error
00276    if( pISQLErrorInfo )
00277       hr = pISQLErrorInfo->GetSQLInfo(pBstr, &lNativeError);
00278
00279 error:
00280    if( plNativeError )
00281       *plNativeError = lNativeError;
00282    if( pISQLErrorInfo )
00283       pISQLErrorInfo->Release();
00284    return hr;
00285 }
00286
00287
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ExeSkel/ExeSkel.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ExeSkel

ExeSkel.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      EXESKEL.H
00003
00004   Summary:   Include file for the EXESKEL skeleton code sample application.
00005              In addition to a main window class definition, this EXESKEL.H
00006              file contains definitions of the application's menu, string,
00007              and other resource IDs.
00008
00009              For a comprehensive tutorial code tour of EXESKEL's
00010              contents and offerings see the tutorial EXESKEL.HTM file.
00011              For more specific technical details on the internal workings
00012              see the comments dispersed throughout the EXESKEL source code.
00013
00014   Classes:   CMainWindow
00015
00016   Functions: WinMain
00017
00018   Origin:    7-27-95: atrent - Created based on DFVIEW by stevebl.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 #if !defined(EXESKEL_H)
00036 #define EXESKEL_H
00037
00038 #if defined(__cplusplus)
00039
00040 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00041   Class:    CMainWindow
00042
00043   Summary:  Class to encapsulate the application's main window, menu, and
00044             message dispatching behavior.
00045
00046   Methods:  CMainWindow
00047               Constructor.
00048             InitInstance
00049               Creates a new instance of the main window.
00050 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00051 class CMainWindow: public CVirWindow
00052 {
00053 public:
00054   CMainWindow();
00055   ~CMainWindow();
00056   BOOL InitInstance(HINSTANCE, int);
00057
00058   TCHAR m_szFileName[MAX_PATH];
00059   CMsgBox* m_pMsgBox;
00060
00061 protected:
00062   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00063
00064 private:
00065   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00066
00067   WORD m_wWidth;
00068   WORD m_wHeight;
00069   TCHAR m_szHelpFile[MAX_PATH];
00070   TCHAR m_szFileTitle[MAX_PATH];
00071   TEXTMETRIC m_tm;
00072   OPENFILENAME m_ofnFile;
00073 };
00074
00075 #endif // __cplusplus
00076
00077 // Window Class String Macros.
00078 #define MAIN_WINDOW_TITLE_STR       "EXESKEL: Tutorial Code Sample"
00079 #define MAIN_WINDOW_CLASS_NAME_STR  "EXESKELWindow"
00080 #define MAIN_WINDOW_CLASS_MENU_STR  "EXESKELMenu"
00081
00082 // OpenFile-related String Macros.
00083 #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
00084 #define OFN_DEFAULTTITLE_STR "Open File"
00085
00086 // File Menu Command Identifiers.
00087 #define IDM_FILE_EXIT               1000
00088
00089 // Help Menu Command Identifiers.
00090 #define IDM_HELP_CONTENTS           1900
00091 #define IDM_HELP_TUTORIAL           1901
00092 #define IDM_HELP_READSOURCE         1902
00093 #define IDM_HELP_ABOUT              1903
00094
00095 // Error-related String Identifiers.
00096 #define IDS_COMINITFAILED           2000
00097 #define IDS_APPINITFAILED           2001
00098 #define IDS_OUTOFMEMORY             2002
00099 #define IDS_UNICODEFAIL             2003
00100
00101 #define IDS_ASSERT_FAIL             2200
00102
00103 // Notice-related String Identifiers.
00104 #define IDS_NOTIMPLEMENTED          2301
00105
00106 #endif
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ADORecordsetConstruction.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ADORecordsetConstruction.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ADORecordsetConstruction
00019 /** @com.interface(iid=00000283-0000-0010-8000-00AA006D2EA4, thread=AUTO) */
00020 public interface ADORecordsetConstruction extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, addFlagsVtable=4)
00023       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00024   public IUnknown getRowset();
00025
00026   /** @com.method(vtoffset=5, addFlagsVtable=4)
00027       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] ppRowset) */
00028   public void setRowset(IUnknown ppRowset);
00029
00030   /** @com.method(vtoffset=6, addFlagsVtable=4)
00031       @com.parameters([type=I4] return) */
00032   public int getChapter();
00033
00034   /** @com.method(vtoffset=7, addFlagsVtable=4)
00035       @com.parameters([in,type=I4] plChapter) */
00036   public void setChapter(int plChapter);
00037
00038   /** @com.method(vtoffset=8, addFlagsVtable=4)
00039       @com.parameters([iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] return) */
00040   public IUnknown getRowPosition();
00041
00042   /** @com.method(vtoffset=9, addFlagsVtable=4)
00043       @com.parameters([in,iid=00000000-0000-0000-C000-000000000046,thread=AUTO,type=OBJECT] ppRowPos) */
00044   public void setRowPosition(IUnknown ppRowPos);
00045
00046
00047   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x283, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00048 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/Secure/Resource.h Source File

  • Com
  • Fundamentals
  • DCom
  • Secure

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by secsvr.rc
00004 //
00005 #define IDC_COLOR                       1003
00006 #define IDC_CHOOSECOLOR                 1004
00007 #define IDC_COLORTEXT                   1005
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NO_MFC                     1
00014 #define _APS_NEXT_RESOURCE_VALUE        102
00015 #define _APS_NEXT_COMMAND_VALUE         40001
00016 #define _APS_NEXT_CONTROL_VALUE         1006
00017 #define _APS_NEXT_SYMED_VALUE           101
00018 #endif
00019 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/resource.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by MyDevice.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_DIMMER                      101
00007 #define IDR_DIMMERSERVICE               102
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NEXT_RESOURCE_VALUE        201
00014 #define _APS_NEXT_COMMAND_VALUE         32768
00015 #define _APS_NEXT_CONTROL_VALUE         201
00016 #define _APS_NEXT_SYMED_VALUE           103
00017 #endif
00018 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • Openserv

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120                 MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122                 // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal)     {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::COMAdminApplicationInstallOptions Member List

This is the complete list of members for comadmin::COMAdminApplicationInstallOptions, including all inherited members.
COMAdminInstallForceOverwriteOfFiles | comadmin::COMAdminApplicationInstallOptions | [static]
COMAdminInstallNoUsers | comadmin::COMAdminApplicationInstallOptions | [static]
COMAdminInstallUsers | comadmin::COMAdminApplicationInstallOptions | [static]
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/ComSyncObject/ComSyncObject.Cpp Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • ComSyncObject

ComSyncObject.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: ComSyncObject.cpp
00004
00005 Summary: Implementation of DLL Exports.
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 // Note: Proxy/Stub Information
00023 //      To build a separate proxy/stub DLL,
00024 //      run nmake -f ComSyncObjectps.mk in the project directory.
00025
00026 #include "stdafx.h"
00027 #include "resource.h"
00028 #include <initguid.h>
00029 #include "ComSyncObject.h"
00030
00031 #include "ComSyncObject_i.c"
00032 #include "ComSyncTest.h"
00033
00034
00035 CComModule _Module;
00036
00037 BEGIN_OBJECT_MAP(ObjectMap)
00038 OBJECT_ENTRY(CLSID_ComSyncTest, CComSyncTest)
00039 END_OBJECT_MAP()
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 // DLL Entry Point
00043
00044 extern "C"
00045 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00046 {
00047     if (dwReason == DLL_PROCESS_ATTACH)
00048     {
00049         _Module.Init(ObjectMap, hInstance, &LIBID_COMSYNCOBJECTLib);
00050         DisableThreadLibraryCalls(hInstance);
00051     }
00052     else if (dwReason == DLL_PROCESS_DETACH)
00053         _Module.Term();
00054     return TRUE;    // ok
00055 }
00056
00057 /////////////////////////////////////////////////////////////////////////////
00058 // Used to determine whether the DLL can be unloaded by OLE
00059
00060 STDAPI DllCanUnloadNow(void)
00061 {
00062     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00063 }
00064
00065 /////////////////////////////////////////////////////////////////////////////
00066 // Returns a class factory to create an object of the requested type
00067
00068 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00069 {
00070     return _Module.GetClassObject(rclsid, riid, ppv);
00071 }
00072
00073 /////////////////////////////////////////////////////////////////////////////
00074 // DllRegisterServer - Adds entries to the system registry
00075
00076 STDAPI DllRegisterServer(void)
00077 {
00078     // registers object, typelib and all interfaces in typelib
00079     return _Module.RegisterServer(TRUE);
00080 }
00081
00082 /////////////////////////////////////////////////////////////////////////////
00083 // DllUnregisterServer - Removes entries from the system registry
00084
00085 STDAPI DllUnregisterServer(void)
00086 {
00087     return _Module.UnregisterServer(TRUE);
00088 }
00089
00090
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/CharHash.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

CharHash.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       charhash.cxx
00006 //
00007 //  Contents:   Hash table that maps special characters to Unicode
00008 //
00009 //  Classes:    CSpecialCharHashTable
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <charhash.hxx>
00017 #include <htmlfilt.hxx>
00018
00019
00020 //+-------------------------------------------------------------------------
00021 //
00022 //  Method:     CSpecialCharHashEntry::CSpecialCharHashEntry
00023 //
00024 //  Synopsis:   Constructor
00025 //
00026 //--------------------------------------------------------------------------
00027
00028 CSpecialCharHashEntry::CSpecialCharHashEntry( WCHAR *pwszName, WCHAR wch )
00029     : _wch(wch),
00030       _pHashEntryNext(0)
00031 {
00032     Win4Assert( wcslen(pwszName) + 1 < MAX_TAG_LENGTH );
00033     wcscpy( _wszName, pwszName );
00034 }
00035
00036
00037
00038
00039 //+-------------------------------------------------------------------------
00040 //
00041 //  Method:     CSpecialCharHashTable::~CSpecialCharHashTable
00042 //
00043 //  Synopsis:   Destructor
00044 //
00045 //--------------------------------------------------------------------------
00046
00047 CSpecialCharHashTable::~CSpecialCharHashTable()
00048 {
00049     for ( unsigned i=0; i<SPECIAL_CHAR_HASH_TABLE_SIZE; i++)
00050     {
00051         CSpecialCharHashEntry *pHashEntry = _aHashTable[i];
00052         while ( pHashEntry != 0 )
00053         {
00054             CSpecialCharHashEntry *pHashEntryNext = pHashEntry->GetNextHashEntry();
00055             delete pHashEntry;
00056             pHashEntry = pHashEntryNext;
00057         }
00058     }
00059 }
00060
00061
00062
00063 //+-------------------------------------------------------------------------
00064 //
00065 //  Method:     CSpecialCharHashTable::Add
00066 //
00067 //  Synopsis:   Add a special char -> Unicode char mapping
00068 //
00069 //  Arguments:  [pwszName] -- the special char
00070 //              [wch]      -- the corresponding Unicode char
00071 //
00072 //--------------------------------------------------------------------------
00073
00074 void CSpecialCharHashTable::Add( WCHAR *pwszName, WCHAR wch )
00075 {
00076 #if DBG == 1
00077     //
00078     // Check for duplicate entries
00079     //
00080     WCHAR wchExisting;
00081
00082     BOOL fFound = Lookup( pwszName, wcslen(pwszName), wchExisting );
00083     Win4Assert( !fFound );
00084 #endif
00085
00086     CSpecialCharHashEntry *pHashEntry = newk(mtNewX, NULL) CSpecialCharHashEntry( pwszName,
00087                                                                                   wch );
00088     unsigned uHashValue = Hash( pwszName, (unsigned) wcslen(pwszName) );
00089     pHashEntry->SetNextHashEntry( _aHashTable[uHashValue] );
00090     _aHashTable[uHashValue] = pHashEntry;
00091 }
00092
00093
00094 //+-------------------------------------------------------------------------
00095 //
00096 //  Method:     CSpecialCharHashTable::Lookup
00097 //
00098 //  Synopsis:   Return the Unicode mapping corresponding to given special char
00099 //
00100 //  Arguments:  [pwcInputBuf] -- input buffer
00101 //              [uLen]      -- Length of input (not \0 terminated)
00102 //              [wch]       -- Unicode mapping returned here
00103 //
00104 //  Returns:    True if a mapping was found in the hash table
00105 //
00106 //--------------------------------------------------------------------------
00107
00108 BOOL CSpecialCharHashTable::Lookup( WCHAR *pwcInputBuf,
00109                                     unsigned uLen,
00110                                     WCHAR& wch )
00111 {
00112     unsigned uHashValue = Hash( pwcInputBuf, uLen );
00113
00114     Win4Assert( uHashValue < SPECIAL_CHAR_HASH_TABLE_SIZE );
00115
00116     for ( CSpecialCharHashEntry *pHashEntry = _aHashTable[uHashValue];
00117           pHashEntry != 0;
00118           pHashEntry = pHashEntry->GetNextHashEntry() )
00119     {
00120         if ( wcsncmp( pwcInputBuf, pHashEntry->GetName(), uLen ) == 0 )
00121         {
00122             wch  = pHashEntry->GetWideChar();
00123             return TRUE;
00124         }
00125     }
00126
00127     return FALSE;
00128 }
00129
00130
00131
00132 //+-------------------------------------------------------------------------
00133 //
00134 //  Method:     CSpecialCharHashTable::Hash
00135 //
00136 //  Synopsis:   Implements the hash function
00137 //
00138 //  Arguments:  [pwszName]  -- name to hash
00139 //              [cLen]     -- length of pszName (it is not null terminated)
00140 //
00141 //  Returns:    Position of chained list in hash table
00142 //
00143 //--------------------------------------------------------------------------
00144
00145 unsigned CSpecialCharHashTable::Hash( WCHAR *pwszName, unsigned cLen )
00146 {
00147     for ( ULONG uHashValue=0; cLen>0; pwszName++ )
00148     {
00149         uHashValue = *pwszName + 31 * uHashValue;
00150         cLen--;
00151     }
00152
00153     return uHashValue % SPECIAL_CHAR_HASH_TABLE_SIZE;
00154 }
00155
00156
00157 //+-------------------------------------------------------------------------
00158 //
00159 //  Method:     CSpecialCharHashTable::CSpecialCharHashTable
00160 //
00161 //  Synopsis:   Constructor
00162 //
00163 //--------------------------------------------------------------------------
00164
00165 CSpecialCharHashTable::CSpecialCharHashTable()
00166 {
00167     for (unsigned i=0; i<SPECIAL_CHAR_HASH_TABLE_SIZE; i++)
00168         _aHashTable[i] = 0;
00169
00170     //
00171     // Initialize the table with various Ascii string->Unicode mappings
00172     //
00173
00174     //
00175     // For lt and gt, use Unicode chars from private use area to avoid
00176     // collision with '<' and '>' chars in Html tags. These will be
00177     // mapped back to '<' and '>' by the scanner.
00178     //
00179     Add(L"lt",      PRIVATE_USE_MAPPING_FOR_LT);
00180     Add(L"gt",      PRIVATE_USE_MAPPING_FOR_GT);
00181
00182     Add(L"amp",     0x26);
00183     Add(L"quot",    0x22);
00184     Add(L"nbsp",    0xa0);
00185     Add(L"shy",     0xad);
00186     Add(L"Agrave",  0xc0);
00187     Add(L"agrave",  0xe0);
00188     Add(L"Aacute",  0xc1);
00189     Add(L"aacute",  0xe1);
00190     Add(L"Acirc",   0xc2);
00191     Add(L"acirc",   0xe2);
00192     Add(L"Atilde",  0xc3);
00193     Add(L"atilde",  0xe3);
00194     Add(L"Auml",    0xc4);
00195     Add(L"auml",    0xe4);
00196     Add(L"Aring",   0xc5);
00197     Add(L"aring",   0xe5);
00198     Add(L"AElig",   0xc6);
00199     Add(L"aelig",   0xe6);
00200     Add(L"Ccedil",  0xc7);
00201     Add(L"ccedil",  0xe7);
00202     Add(L"Egrave",  0xc8);
00203     Add(L"egrave",  0xe8);
00204     Add(L"Eacute",  0xc9);
00205     Add(L"eacute",  0xe9);
00206     Add(L"Ecirc",   0xca);
00207     Add(L"ecirc",   0xea);
00208     Add(L"Euml",    0xcb);
00209     Add(L"euml",    0xeb);
00210     Add(L"Igrave",  0xcc);
00211     Add(L"igrave",  0xec);
00212     Add(L"Iacute",  0xcd);
00213     Add(L"iacute",  0xed);
00214     Add(L"Icirc",   0xce);
00215     Add(L"icirc",   0xee);
00216     Add(L"Iuml",    0xcf);
00217     Add(L"iuml",    0xef);
00218     Add(L"ETH",     0xd0);
00219     Add(L"eth",     0xf0);
00220     Add(L"Ntilde",  0xd1);
00221     Add(L"ntilde",  0xf1);
00222     Add(L"Ograve",  0xd2);
00223     Add(L"ograve",  0xf2);
00224     Add(L"Oacute",  0xd3);
00225     Add(L"oacute",  0xf3);
00226     Add(L"Ocirc",   0xd4);
00227     Add(L"ocirc",   0xf4);
00228     Add(L"Otilde",  0xd5);
00229     Add(L"otilde",  0xf5);
00230     Add(L"Ouml",    0xd6);
00231     Add(L"ouml",    0xf6);
00232     Add(L"Oslash",  0xd8);
00233     Add(L"oslash",  0xf8);
00234     Add(L"Ugrave",  0xd9);
00235     Add(L"ugrave",  0xf9);
00236     Add(L"Uacute",  0xda);
00237     Add(L"uacute",  0xfa);
00238     Add(L"Ucirc",   0xdb);
00239     Add(L"ucirc",   0xfb);
00240     Add(L"Uuml",    0xdc);
00241     Add(L"uuml",    0xfc);
00242     Add(L"Yacute",  0xdd);
00243     Add(L"yacute",  0xfd);
00244     Add(L"THORN",   0xde);
00245     Add(L"thorn",   0xfe);
00246     Add(L"szlig",   0xdf);
00247     Add(L"yuml",    0xff);
00248     Add(L"iexcl",   0xa1);
00249     Add(L"cent",    0xa2);
00250     Add(L"pound",   0xa3);
00251     Add(L"curren",  0xa4);
00252     Add(L"yen",     0xa5);
00253     Add(L"brvbar",  0xa6);
00254     Add(L"sect",    0xa7);
00255     Add(L"die",     0xa8);
00256     Add(L"copy",    0xa9);
00257     Add(L"laquo",   0xab);
00258     Add(L"reg",     0xae);
00259     Add(L"macron",  0xaf);
00260     Add(L"deg",     0xb0);
00261     Add(L"plusmn",  0xb1);
00262     Add(L"sup2",    0xb2);
00263     Add(L"sup3",    0xb3);
00264     Add(L"acute",   0xb4);
00265     Add(L"micro",   0xb5);
00266     Add(L"para",    0xb6);
00267     Add(L"middot",  0xb7);
00268     Add(L"cedil",   0xb8);
00269     Add(L"supl",    0xb9);
00270     Add(L"raquo",   0xbb);
00271     Add(L"frac14",  0xbc);
00272     Add(L"frac12",  0xbd);
00273     Add(L"frac34",  0xbe);
00274     Add(L"iquest",  0xbf);
00275     Add(L"times",   0xd7);
00276     Add(L"divide",  0xf7);
00277 }
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_BASENODE_PROPERTIES Member List

This is the complete list of members for tag_BASENODE_PROPERTIES, including all inherited members.
dwAttributes | tag_BASENODE_PROPERTIES
pComponentData | tag_BASENODE_PROPERTIES
pParentObject | tag_BASENODE_PROPERTIES
szNodeName | tag_BASENODE_PROPERTIES
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authentication/resource.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Authentication

resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       Resource.h
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 //{{NO_DEPENDENCIES}}
00013 // Microsoft Developer Studio generated include file.
00014 //
00015 #define IDS_PROJNAME                    100
00016 #define IDR_AUTHENTICATEPLUGIN         101
00017 #define IDR_AUTHENTICATEADMIN          102
00018 #define IDR_AUTHENTICATECONTEXT        103
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        201
00025 #define _APS_NEXT_COMMAND_VALUE         32768
00026 #define _APS_NEXT_CONTROL_VALUE         201
00027 #define _APS_NEXT_SYMED_VALUE           104
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/basesnap.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

basesnap.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:  This file contains implementations for CComponentData's
00014 //             class factory and the Snap-in DLL exported functions
00015
00016
00017 #include <ObjBase.h>
00018 #include <InitGuid.h>
00019 #include "Guids.h"
00020 #include "BaseSnap.h"
00021 #include "Comp.h"
00022 #include "CompData.h"
00023 #include "Registry.h"
00024 #include "Globals.h"
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 //  Implementation of IClassFactory for CComponentData
00028
00029 //---------------------------------------------------------------------------
00030 CClassFactory::CClassFactory()
00031              : m_cRef(0)
00032 {
00033   InterlockedIncrement((long*)&g_uObjectCount);
00034 }
00035
00036
00037 //---------------------------------------------------------------------------
00038 CClassFactory::~CClassFactory()
00039 {
00040   InterlockedDecrement((long*)&g_uObjectCount);
00041 }
00042
00043
00044 //---------------------------------------------------------------------------
00045 STDMETHODIMP CClassFactory::QueryInterface
00046 (
00047   REFIID   riid,             //[in] Identifier of the requested interface
00048   LPVOID*  ppv               //[out] Address of requested interface
00049 )
00050 {
00051   if( NULL == ppv )
00052     return E_FAIL;
00053
00054   HRESULT hResult = E_NOINTERFACE;
00055   *ppv = NULL;
00056
00057   if( IsEqualIID(riid, IID_IUnknown) )
00058   {
00059     *ppv = static_cast<IClassFactory *>(this);
00060   }
00061   else if( IsEqualIID(riid, IID_IClassFactory) )
00062   {
00063     *ppv = static_cast<IClassFactory *>(this);
00064   }
00065
00066   if( *ppv )
00067   {
00068     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00069     hResult = S_OK;
00070   }
00071
00072   return hResult;
00073 }
00074
00075
00076 //---------------------------------------------------------------------------
00077 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00078 {
00079   return InterlockedIncrement( (long*)&m_cRef );
00080 }
00081
00082
00083 //---------------------------------------------------------------------------
00084 STDMETHODIMP_(ULONG) CClassFactory::Release()
00085 {
00086   if( 0 == InterlockedDecrement( (long*)&m_cRef) )
00087   {
00088     delete this;
00089     return 0;
00090   }
00091   return m_cRef;
00092 }
00093
00094 //---------------------------------------------------------------------------
00095 //  Creates an instance of CComponentData
00096 //
00097 STDMETHODIMP CClassFactory::CreateInstance
00098 (
00099   LPUNKNOWN  pUnkOuter,      //[in] NULL unless object is part of aggregate
00100   REFIID     riid,           //[in] Reference to interface indentifier
00101   LPVOID*    ppvObj          //[out] Address of requested interface pointer
00102 )
00103 {
00104   HRESULT  hResult = E_FAIL;
00105   void*    pObject = NULL;
00106
00107   if( NULL == ppvObj )
00108     return hResult;
00109
00110   *ppvObj = NULL;
00111
00112   // Our object does does not support aggregation, so we need to
00113   // fail if they ask us to do aggregation.
00114   if( pUnkOuter )
00115     return CLASS_E_NOAGGREGATION;
00116
00117   pObject = new CComponentData();
00118   if( NULL == pObject )                // Fail to create CComponentData
00119     return E_OUTOFMEMORY;
00120
00121   // QueryInterface will do the AddRef() for us, don't do it here
00122   hResult = ( (LPUNKNOWN)pObject)->QueryInterface( riid, ppvObj );
00123
00124   if( S_OK != hResult )
00125     delete pObject;
00126
00127   return hResult;
00128 }
00129
00130
00131 //---------------------------------------------------------------------------
00132 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00133 {
00134   if( TRUE == fLock )
00135     InterlockedIncrement((long*)&g_uServerLocks);
00136   else
00137     InterlockedDecrement((long*)&g_uServerLocks);
00138
00139   return S_OK;
00140 }
00141
00142
00143 /////////////////////////////////////////////////////////////////////////////
00144 //  Our Snap-in's exported functions
00145 //
00146
00147 //---------------------------------------------------------------------------
00148 //  Entry point into our Snap-in DLL
00149 //
00150 BOOL WINAPI DllMain
00151 (
00152   HINSTANCE  hInstDLL,         //[in] Handle to DLL module
00153   DWORD      fdwReason,        //[in] Reason for calling function
00154   void*      lpvReserved       //[in] Reserved
00155 )
00156 {
00157   if( DLL_PROCESS_ATTACH == fdwReason )
00158   {
00159      g_hInst = hInstDLL;
00160   }
00161
00162   return TRUE;
00163 }
00164
00165
00166 //---------------------------------------------------------------------------
00167 STDAPI DllGetClassObject
00168 (
00169   REFCLSID   rclsid,         //[in] CLSID for the class object
00170   REFIID     riid,           //[in] Reference to interface identifier
00171   LPVOID     *ppvObj         //[out] Object which recieves interface pointer
00172 )
00173 {
00174   if( rclsid != CLSID_CComponentData )
00175     return CLASS_E_CLASSNOTAVAILABLE;
00176
00177   if( !ppvObj )
00178     return E_FAIL;
00179
00180   *ppvObj = NULL;
00181
00182   // We can only hand out IUnknown and IClassFactory pointers.  Fail
00183   // if they ask for anything else.
00184   if( !IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory) )
00185     return E_NOINTERFACE;
00186
00187   CClassFactory *pFactory = new CClassFactory();
00188   if( NULL == pFactory )
00189     return E_OUTOFMEMORY;
00190
00191   HRESULT hResult = pFactory->QueryInterface( riid, ppvObj );
00192
00193   return hResult;
00194 }
00195
00196
00197 //---------------------------------------------------------------------------
00198 STDAPI DllCanUnloadNow(void)
00199 {
00200   if( 0 == g_uObjectCount && 0 == g_uServerLocks )
00201     return S_OK;
00202   else
00203     return S_FALSE;
00204 }
00205
00206
00207 //---------------------------------------------------------------------------
00208 STDAPI DllRegisterServer()
00209 {
00210   if( S_OK == RegisterServer( g_hInst, CLSID_CComponentData, gtszSNAPIN_NAME) )
00211     return RegisterSnapin( CLSID_CComponentData, gtszSNAPIN_NAME, IID_NULL, FALSE );
00212   else
00213     return E_FAIL;
00214 }
00215
00216
00217 //---------------------------------------------------------------------------
00218 STDAPI DllUnregisterServer()
00219 {
00220   if( S_OK == UnregisterServer(CLSID_CComponentData) )
00221     return UnregisterSnapin(CLSID_CComponentData);
00222   else
00223     return E_FAIL;
00224 }
00225
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/enumdesk.cpp Source File

  • WinUI
  • Shell
  • EnumDesk

enumdesk.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          EnumDesk.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include <windows.h>
00023 #include <windowsx.h>
00024 #include <commctrl.h>
00025 #include <shlobj.h>
00026 #include "EnumDesk.h"
00027 #include "Tree.h"
00028 #include "List.h"
00029 #include "resource.h"
00030
00031 /**************************************************************************
00032    function prototypes
00033 **************************************************************************/
00034
00035 int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
00036 BOOL Main_InitApplication(HINSTANCE);
00037 BOOL Main_InitInstance(HINSTANCE, int);
00038 LRESULT CALLBACK Main_WndProc(HWND, UINT, WPARAM, LPARAM);
00039 HIMAGELIST Main_CreateImageList(BOOL);
00040 void Main_SizeChildren(HWND);
00041 void Main_UpdateMenu(HWND, HMENU);
00042 LRESULT Main_OnCommand(HWND, WPARAM, LPARAM);
00043
00044 /**************************************************************************
00045    global variables and definitions
00046 **************************************************************************/
00047
00048 HINSTANCE      g_hInst;
00049 TCHAR          g_szClassName[] = TEXT("EnumDeskWndClass");
00050 HWND           g_hwndMain;
00051 LPMALLOC       g_pMalloc;
00052 UINT           g_uPosition;
00053 IContextMenu2  *g_pcm2;
00054
00055 #define GAP_SIZE    2
00056 #define MIN_SIZE    10
00057
00058 /******************************************************************************
00059
00060    WinMain
00061
00062 ******************************************************************************/
00063
00064 int PASCAL WinMain(  HINSTANCE hInstance,
00065                      HINSTANCE hPrevInstance,
00066                      LPSTR lpCmdLine,
00067                      int nCmdShow)
00068 {
00069 UNREFERENCED_PARAMETER(lpCmdLine);
00070
00071 MSG  msg;
00072
00073 g_hInst = hInstance;
00074
00075 if(!hPrevInstance)
00076    if(!Main_InitApplication(hInstance))
00077       return FALSE;
00078
00079 CoInitialize(NULL);
00080
00081 //required to use the common controls
00082 InitCommonControls();
00083
00084 /* Perform initializations that apply to a specific instance */
00085
00086 if (!Main_InitInstance(hInstance, nCmdShow))
00087    return FALSE;
00088
00089 /* Acquire and dispatch messages until a WM_QUIT uMessage is received. */
00090
00091 HACCEL   hAccels = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELS));
00092
00093 while(GetMessage( &msg, NULL, 0x00, 0x00))
00094    {
00095    if(!TranslateAccelerator(g_hwndMain, hAccels, &msg))
00096       {
00097       TranslateMessage(&msg);
00098       DispatchMessage(&msg);
00099       }
00100    }
00101
00102 CoUninitialize();
00103
00104 return (int)msg.wParam;
00105 }
00106
00107 /******************************************************************************
00108
00109    Main_InitApplication
00110
00111 ******************************************************************************/
00112
00113 BOOL Main_InitApplication(HINSTANCE hInstance)
00114 {
00115 WNDCLASS  wc;
00116
00117 /* Fill in window class structure with parameters that describe the main window. */
00118
00119 wc.style          = 0;
00120 wc.lpfnWndProc    = (WNDPROC)Main_WndProc;
00121 wc.cbClsExtra     = 0;
00122 wc.cbWndExtra     = 0;
00123 wc.hInstance      = hInstance;
00124 wc.hIcon          = LoadIcon(NULL, IDI_WINLOGO);
00125 wc.hCursor        = LoadCursor(hInstance, MAKEINTRESOURCE(IDC_SPLIT_CURSOR));
00126 wc.hbrBackground  = GetSysColorBrush(COLOR_3DFACE);
00127 wc.lpszMenuName   = MAKEINTRESOURCE(IDM_MAIN_MENU);
00128 wc.lpszClassName  = g_szClassName;
00129
00130 /* Register the window class and return success/failure code. */
00131
00132 return RegisterClass(&wc);
00133 }
00134
00135
00136 /******************************************************************************
00137
00138    Main_InitInstance
00139
00140 ******************************************************************************/
00141
00142 BOOL Main_InitInstance( HINSTANCE hInstance,
00143                         int nCmdShow)
00144 {
00145 /* Create a main window for this application instance.  */
00146
00147 g_hwndMain = CreateWindowEx(  0,
00148                               g_szClassName,
00149                               TEXT("New EnumDesk Sample"),
00150                               WS_OVERLAPPEDWINDOW,
00151                               CW_USEDEFAULT,
00152                               CW_USEDEFAULT,
00153                               CW_USEDEFAULT,
00154                               CW_USEDEFAULT,
00155                               NULL,
00156                               NULL,
00157                               hInstance,
00158                               NULL);
00159
00160 /* If window could not be created, return "failure" */
00161
00162 if(!g_hwndMain)
00163    return FALSE;
00164
00165 /* Make the window visible; update its client area; and return "success" */
00166
00167 ShowWindow(g_hwndMain, nCmdShow);
00168 UpdateWindow(g_hwndMain);
00169 return TRUE;
00170
00171 }
00172
00173 /******************************************************************************
00174
00175    Main_WndProc
00176
00177 ******************************************************************************/
00178
00179 LRESULT CALLBACK Main_WndProc(HWND hWnd,
00180                               UINT uMessage,
00181                               WPARAM wParam,
00182                               LPARAM lParam)
00183 {
00184 switch (uMessage)
00185    {
00186    case WM_NCCREATE:
00187       SHGetMalloc(&g_pMalloc);
00188       break;
00189
00190    case WM_CREATE:
00191       {
00192       HIMAGELIST  himlLarge;
00193       HIMAGELIST  himlSmall;
00194       HWND        hwndTree;
00195       HWND        hwndList;
00196
00197       g_uPosition = 0;
00198
00199       //get the system image lists
00200       himlLarge = Main_CreateImageList(TRUE);
00201       himlSmall = Main_CreateImageList(FALSE);
00202
00203       // create the TreeView control
00204       hwndTree = Tree_Create(g_hInst, hWnd, himlSmall);
00205
00206       // create the ListView control
00207       hwndList = List_Create(g_hInst, hWnd, himlLarge, himlSmall);
00208
00209       //initialize the TreeView control
00210       Tree_Init(hwndTree);
00211
00212       SetFocus(hwndTree);
00213       }
00214       break;
00215
00216    case WM_NOTIFY:
00217       {
00218       LPNMHDR  pnmh = (LPNMHDR) lParam;
00219
00220       switch(pnmh->idFrom)
00221          {
00222          case IDC_TREEVIEW:
00223             return Tree_Notify(hWnd, lParam);
00224
00225          case IDC_LISTVIEW:
00226             return List_Notify(hWnd, lParam);
00227          }
00228       }
00229       return 0;
00230
00231    case WM_SIZE:
00232       {
00233       Main_SizeChildren(hWnd);
00234       }
00235       break;
00236
00237    case WM_LBUTTONDOWN:
00238       SetCapture(hWnd);
00239       return 0;
00240
00241    case WM_LBUTTONUP:
00242       ReleaseCapture();
00243       return 0;
00244
00245    case WM_MOUSEMOVE:
00246       //if the left button is down
00247       if(GetKeyState(VK_LBUTTON) & 0x8000)
00248          {
00249          RECT  rc;
00250
00251          GetClientRect(hWnd, &rc);
00252
00253          //don't do anything if we are already at the minimum size
00254          if((g_uPosition == MIN_SIZE) && (LOWORD(lParam) <= MIN_SIZE))
00255             break;
00256
00257          //don't do anything if we are already at the maximum size
00258          if(((rc.right - g_uPosition) == MIN_SIZE) && (LOWORD(lParam) >= g_uPosition))
00259             break;
00260
00261          g_uPosition = LOWORD(lParam);
00262
00263          //check for min and max
00264          if(g_uPosition < MIN_SIZE)
00265             g_uPosition = MIN_SIZE;
00266
00267          if((rc.right - g_uPosition) < MIN_SIZE)
00268             g_uPosition = rc.right - MIN_SIZE;
00269
00270          Main_SizeChildren(hWnd);
00271          }
00272       break;
00273
00274    case WM_COMMAND:
00275       return Main_OnCommand(hWnd, wParam, lParam);
00276
00277    case WM_DESTROY:
00278       //tell the list to release its current folder
00279       List_ReleaseCurrentFolder();
00280
00281       PostQuitMessage(0);
00282       break;
00283
00284    case WM_NCDESTROY:
00285       g_pMalloc->Release();
00286       g_pMalloc = NULL;
00287       break;
00288
00289    case WM_SYSCOLORCHANGE:
00290       {
00291       HBRUSH   hbr = GetSysColorBrush(COLOR_3DFACE);
00292
00293       hbr = (HBRUSH)SetClassLongPtr(hWnd, GCLP_HBRBACKGROUND, (LONG_PTR)hbr);
00294
00295       if(hbr)
00296          DeleteObject(hbr);
00297       }
00298       break;
00299
00300    case WM_INITMENUPOPUP:
00301       Main_UpdateMenu(hWnd, (HMENU)wParam);
00302       //fall through
00303
00304    case WM_DRAWITEM:
00305    case WM_MENUCHAR:
00306    case WM_MEASUREITEM:
00307       if(g_pcm2)
00308          {
00309          g_pcm2->HandleMenuMsg(uMessage, wParam, lParam);
00310          }
00311       break;
00312
00313    case WM_CONTEXTMENU:
00314       {
00315       POINT ptScreen;
00316       POINT ptClient;
00317
00318       ptScreen.x = GET_X_LPARAM(lParam);
00319       ptScreen.y = GET_Y_LPARAM(lParam);
00320       ptClient = ptScreen;
00321       ScreenToClient(hWnd, &ptClient);
00322       HWND  hwndOver = ChildWindowFromPoint(hWnd, ptClient);
00323
00324       if(GetDlgItem(hWnd, IDC_TREEVIEW) == hwndOver)
00325          {
00326          Tree_DoContextMenu(hwndOver, &ptScreen);
00327          }
00328       else if(GetDlgItem(hWnd, IDC_LISTVIEW) == hwndOver)
00329          {
00330          List_DoContextMenu(hwndOver, &ptScreen);
00331          }
00332       }
00333       break;
00334
00335    default:
00336       break;
00337    }
00338 return DefWindowProc(hWnd, uMessage, wParam, lParam);
00339 }
00340
00341 /******************************************************************************
00342
00343    Main_CreateImageList
00344
00345 ******************************************************************************/
00346
00347 HIMAGELIST Main_CreateImageList(BOOL fLarge)
00348 {
00349 HIMAGELIST hImageList;
00350 SHFILEINFO  sfi;
00351
00352 //get the system image list
00353 hImageList = (HIMAGELIST)SHGetFileInfo(   TEXT("C:\\"),
00354                                           0,
00355                                           &sfi,
00356                                           sizeof(SHFILEINFO),
00357                                           SHGFI_SYSICONINDEX | (fLarge ? 0 : SHGFI_SMALLICON));
00358
00359 return hImageList;
00360 }
00361
00362 /******************************************************************************
00363
00364    Main_SizeChildren
00365
00366 ******************************************************************************/
00367
00368 void Main_SizeChildren(HWND hwndParent)
00369 {
00370 RECT  rc;
00371
00372 GetClientRect(hwndParent, &rc);
00373
00374 if(!g_uPosition)
00375    {
00376    g_uPosition = rc.right/3;
00377    }
00378
00379 //resize the TreeView control
00380 MoveWindow( GetDlgItem(hwndParent, IDC_TREEVIEW),
00381             0,
00382             0,
00383             g_uPosition - GAP_SIZE,
00384             rc.bottom,
00385             TRUE);
00386
00387 //resize the ListView
00388 MoveWindow( GetDlgItem(hwndParent, IDC_LISTVIEW),
00389             g_uPosition,
00390             0,
00391             rc.right - g_uPosition,
00392             rc.bottom,
00393             TRUE);
00394 }
00395
00396 /******************************************************************************
00397
00398    Main_UpdateMenu
00399
00400 ******************************************************************************/
00401
00402 void Main_UpdateMenu(HWND hWnd, HMENU hMenu)
00403 {
00404 UINT  uID = 0;
00405 DWORD dwStyle;
00406
00407 //uncheck all of these guys
00408 CheckMenuItem(hMenu, IDM_LARGE_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
00409 CheckMenuItem(hMenu, IDM_SMALL_ICONS,  MF_BYCOMMAND | MF_UNCHECKED);
00410 CheckMenuItem(hMenu, IDM_LIST,  MF_BYCOMMAND | MF_UNCHECKED);
00411
00412 //check the appropriate view menu item
00413 dwStyle = GetWindowLong(GetDlgItem(hWnd, IDC_LISTVIEW), GWL_STYLE);
00414 switch(dwStyle & LVS_TYPEMASK)
00415    {
00416    case LVS_ICON:
00417       uID = IDM_LARGE_ICONS;
00418       break;
00419
00420    case LVS_SMALLICON:
00421       uID = IDM_SMALL_ICONS;
00422       break;
00423
00424    case LVS_LIST:
00425       uID = IDM_LIST;
00426       break;
00427    }
00428 CheckMenuRadioItem(hMenu, IDM_LARGE_ICONS, IDM_LIST, uID,  MF_BYCOMMAND | MF_CHECKED);
00429 }
00430
00431 /**************************************************************************
00432
00433    Main_OnCommand()
00434
00435 **************************************************************************/
00436
00437 LRESULT Main_OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
00438 {
00439 UNREFERENCED_PARAMETER(lParam);
00440
00441 switch (GET_WM_COMMAND_ID(wParam, lParam))
00442    {
00443    case IDM_EXIT:
00444       DestroyWindow(hWnd);
00445       break;
00446
00447    case IDM_LARGE_ICONS:
00448       {
00449       HWND  hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);
00450       DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
00451       SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_ICON);
00452       }
00453       break;
00454
00455    case IDM_SMALL_ICONS:
00456       {
00457       HWND  hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);
00458       DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
00459       SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_SMALLICON);
00460       }
00461       break;
00462
00463    case IDM_LIST:
00464       {
00465       HWND  hwndListView = GetDlgItem(hWnd, IDC_LISTVIEW);
00466       DWORD dwStyle = GetWindowLong(hwndListView, GWL_STYLE);
00467       SetWindowLong(hwndListView, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_LIST);
00468       }
00469       break;
00470
00471
00472    case IDM_REFRESH:
00473       List_Refresh(GetDlgItem(hWnd, IDC_LISTVIEW));
00474       break;
00475    }
00476
00477 return 0;
00478 }
00479
00480 /**************************************************************************
00481
00482    Pidl_GetNextItem()
00483
00484 **************************************************************************/
00485
00486 inline LPITEMIDLIST Pidl_GetNextItem(LPCITEMIDLIST pidl)
00487 {
00488 if(pidl)
00489    return (LPITEMIDLIST)(LPBYTE)(((LPBYTE)pidl) + pidl->mkid.cb);
00490 else
00491    return NULL;
00492 }
00493
00494 /**************************************************************************
00495
00496    Pidl_Create()
00497
00498 **************************************************************************/
00499
00500 LPITEMIDLIST Pidl_Create(UINT cbSize)
00501 {
00502 LPITEMIDLIST pidl = NULL;
00503
00504 pidl = (LPITEMIDLIST) g_pMalloc->Alloc(cbSize);
00505 if(pidl)
00506    ZeroMemory(pidl, cbSize);
00507
00508 return pidl;
00509 }
00510
00511 /**************************************************************************
00512
00513    Pidl_GetSize()
00514
00515 **************************************************************************/
00516
00517 UINT Pidl_GetSize(LPCITEMIDLIST pidl)
00518 {
00519 UINT           cbTotal = 0;
00520 LPITEMIDLIST   pidlTemp = (LPITEMIDLIST) pidl;
00521
00522 if(pidlTemp)
00523    {
00524    while(pidlTemp->mkid.cb)
00525       {
00526       cbTotal += pidlTemp->mkid.cb;
00527       pidlTemp = Pidl_GetNextItem(pidlTemp);
00528       }
00529
00530    // Requires a 16 bit zero value for the NULL terminator
00531    cbTotal += 2 * sizeof(BYTE);
00532    }
00533
00534 return cbTotal;
00535 }
00536
00537 /**************************************************************************
00538
00539    Pidl_Copy()
00540
00541 **************************************************************************/
00542
00543 LPITEMIDLIST Pidl_Copy(LPCITEMIDLIST pidlSource)
00544 {
00545 LPITEMIDLIST   pidlTarget = NULL;
00546 UINT           cbSource = 0;
00547
00548 if(NULL == pidlSource)
00549    return NULL;
00550
00551 //
00552 // Allocate the new ITEMIDLIST
00553 //
00554 cbSource = Pidl_GetSize(pidlSource);
00555 pidlTarget = (LPITEMIDLIST) g_pMalloc->Alloc(cbSource);
00556 if(!pidlTarget)
00557    return NULL;
00558
00559 //
00560 // Copy the source to the target
00561 //
00562 CopyMemory(pidlTarget, pidlSource, cbSource);
00563
00564 return pidlTarget;
00565 }
00566
00567 /**************************************************************************
00568
00569    Pidl_Concatenate()
00570
00571 **************************************************************************/
00572
00573 LPITEMIDLIST Pidl_Concatenate(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
00574 {
00575 LPITEMIDLIST   pidlNew;
00576 UINT           cb1 = 0,
00577                cb2 = 0;
00578
00579 //
00580 // Pidl1 can possibly be NULL if it points to the desktop.  Since we only
00581 // need a single NULL terminator, we remove the extra 2 bytes from the
00582 // size of the first ITEMIDLIST.
00583 //
00584 if(pidl1)
00585    cb1 = Pidl_GetSize(pidl1) - (2 * sizeof(BYTE));
00586
00587 cb2 = Pidl_GetSize(pidl2);
00588
00589 //
00590 // Create a new ITEMIDLIST that is the size of both pidl1 and pidl2, then
00591 // copy pidl1 and pidl2 to the new list.
00592 //
00593 pidlNew = Pidl_Create(cb1 + cb2);
00594 if(pidlNew)
00595    {
00596    if(pidl1)
00597       CopyMemory(pidlNew, pidl1, cb1);
00598
00599    CopyMemory(((LPBYTE)pidlNew) + cb1, pidl2, cb2);
00600    }
00601
00602 return pidlNew;
00603 }
00604
00605 /**************************************************************************
00606
00607    Pidl_Free()
00608
00609 **************************************************************************/
00610
00611 void Pidl_Free(LPITEMIDLIST pidl)
00612 {
00613 if(pidl)
00614    g_pMalloc->Free(pidl);
00615 }
00616
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • Openserv

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030         static TCHAR error[64];
00031
00032         switch (verb) {
00033     case MMC_VERB_NONE:
00034                 return _T("NONE");
00035     case MMC_VERB_OPEN:
00036                 return _T("OPEN");
00037     case MMC_VERB_COPY:
00038                 return _T("COPY");
00039     case MMC_VERB_PASTE:
00040                 return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042                 return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044                 return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046                 return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048                 return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050                 return _T("PRINT");
00051     case MMC_VERB_CUT:
00052                 return _T("CUT");
00053         default:
00054                 wsprintf(error, _T("Unknown verb id %d"), verb);
00055                 return error;
00056         }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061                                 IComponentData *pCompData,
00062                                 IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064                                 LPARAM arg,
00065                                 LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069         TCHAR message[cchMessage] = {0};
00070
00071         if (bComponentData == TRUE)
00072                 OutputDebugString(_T("IComponentData::Notify( "));
00073         else
00074                 OutputDebugString(_T("IComponent::Notify( "));
00075
00076         wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077         OutputDebugString(message);
00078
00079     switch (event)      {
00080                 case MMCN_ACTIVATE:
00081                         wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082                         break;
00083
00084                 case MMCN_ADD_IMAGES:
00085                         wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086                         break;
00087
00088                 case MMCN_BTN_CLICK:
00089                         wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090                         break;
00091
00092                 case MMCN_COLUMN_CLICK:
00093                         wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,       param);
00094                         break;
00095
00096                 case MMCN_COLUMNS_CHANGED:
00097                         wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098                         break;
00099
00100                 case MMCN_CONTEXTHELP:
00101                         wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102                         break;
00103
00104                 case MMCN_CONTEXTMENU:
00105                         wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106                         break;
00107
00108                 case MMCN_CUTORMOVE:
00109                         wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110                         break;
00111
00112                 case MMCN_DBLCLICK:
00113                         wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114                         break;
00115
00116                 case MMCN_DELETE:
00117                         wsprintf(message, _T("MMCN_DELETE\n"));
00118                         break;
00119
00120                 case MMCN_DESELECT_ALL:
00121                         wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122                         break;
00123
00124                 case MMCN_EXPAND:
00125                         wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126                         break;
00127
00128                 case MMCN_EXPANDSYNC:
00129                         wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130                         break;
00131
00132                 case MMCN_FILTERBTN_CLICK:
00133                         wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134                         break;
00135
00136                 case MMCN_FILTER_CHANGE:
00137                         wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138                         break;
00139
00140                 case MMCN_HELP:
00141                         wsprintf(message, _T("MMCN_HELP\n"));
00142                         break;
00143
00144                 case MMCN_INITOCX:
00145                         wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146                         break;
00147
00148                 case MMCN_LISTPAD:
00149                         wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150                         break;
00151
00152                 case MMCN_MENU_BTNCLICK:
00153                         wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154                         break;
00155
00156                 case MMCN_MINIMIZED:
00157                         wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158                         break;
00159
00160                 case MMCN_PASTE:
00161                         wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162                         break;
00163
00164                 case MMCN_PRELOAD:
00165                         wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166                         break;
00167
00168                 case MMCN_PRINT:
00169                         wsprintf(message, _T("MMCN_PRINT\n"));
00170                         break;
00171
00172                 case MMCN_PROPERTY_CHANGE:
00173                         wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174                         break;
00175
00176                 case MMCN_QUERY_PASTE:
00177                         wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178                         break;
00179
00180                 case MMCN_REFRESH:
00181                         wsprintf(message, _T("MMCN_REFRESH\n"));
00182                         break;
00183
00184                 case MMCN_REMOVE_CHILDREN:
00185                         wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186                         break;
00187
00188                 case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192                         StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193                         break;
00194
00195                 case MMCN_RESTORE_VIEW:
00196                         wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197                         break;
00198
00199                 case MMCN_SELECT:
00200                         wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201                         break;
00202
00203                 case MMCN_SHOW:
00204                         wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205                         break;
00206
00207                 case MMCN_SNAPINHELP:
00208                         wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209                         break;
00210
00211                 case MMCN_VIEW_CHANGE:
00212                         wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213                         break;
00214         }
00215
00216         if (message[0] != 0)
00217                 OutputDebugString(message);
00218         else
00219                 OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222         return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/statnode.h Source File

  • SysMgmt
  • MMC
  • CMenu

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256];
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034         return szDisplayName;
00035     }
00036     virtual const GUID & getNodeType() { return thisGuid; }
00037     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00038
00039 public:
00040     // virtual functions go here (for MMCN_*)
00041     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00042     virtual HRESULT OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile);
00043
00044 private:
00045     enum { NUMBER_OF_CHILDREN = 4 };
00046     CDelegationBase *children[NUMBER_OF_CHILDREN];
00047
00048     // {2974380C-4C4B-11d2-89D8-000021473128}
00049     static const GUID thisGuid;
00050 };
00051
00052 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/mqf_draw/connectdlg.h Source File

  • NetDS
  • MessageQueuing
  • mqf_draw

connectdlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // connectdlg.h : header file
00014 //
00015
00016
00017 // CConnectDlg dialog
00018
00019 class CConnectDlg : public CDialog
00020 {
00021 // Construction
00022 public:
00023   CConnectDlg(CWnd* pParent = NULL);   // standard constructor
00024
00025 //Data
00026   CString m_strLogin;
00027
00028
00029 // Dialog Data
00030   //{{AFX_DATA(CConnectDlg)
00031   enum { IDD = IDD_DS};
00032   CButton m_CancelButton;
00033   CButton m_cRadioDS;
00034   CButton m_cContinueButton;
00035   int   m_iRadioDS;
00036   CButton m_cRadioWorkgroup;
00037   //}}AFX_DATA
00038
00039 // Overrides
00040   // ClassWizard generated virtual function overrides
00041   //{{AFX_VIRTUAL(CLoginDlg)
00042   protected:
00043   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00044   //}}AFX_VIRTUAL
00045
00046 // Implementation
00047 protected:
00048
00049   // Generated message map functions
00050   //{{AFX_MSG(CConnectDlg)
00051     // NOTE: the ClassWizard will add member functions here
00052   virtual BOOL OnInitDialog();
00053   afx_msg void OnConnect();
00054   //}}AFX_MSG
00055   DECLARE_MESSAGE_MAP()
00056
00057 private:
00058
00059
00060 };
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IPSAMPLE_MIB_SET_INPUT_DATA Member List

This is the complete list of members for _IPSAMPLE_MIB_SET_INPUT_DATA, including all inherited members.
IMSID_Buffer | _IPSAMPLE_MIB_SET_INPUT_DATA
IMSID_BufferSize | _IPSAMPLE_MIB_SET_INPUT_DATA
IMSID_IfIndex | _IPSAMPLE_MIB_SET_INPUT_DATA
IMSID_TypeID | _IPSAMPLE_MIB_SET_INPUT_DATA
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextSamplePropPage/stdafx.h Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification
  • ContextSamplePropPage

stdafx.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       StdAfx.h
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011 #if !defined(AFX_STDAFX_H__61AFBBF7_3FF6_4F41_AF97_6F37C6890019__INCLUDED_)
00012 #define AFX_STDAFX_H__61AFBBF7_3FF6_4F41_AF97_6F37C6890019__INCLUDED_
00013
00014 #if _MSC_VER > 1000
00015 #pragma once
00016 #endif // _MSC_VER > 1000
00017
00018 #define STRICT
00019 #ifndef _WIN32_WINNT
00020 #define _WIN32_WINNT 0x0400
00021 #endif
00022 #define _ATL_APARTMENT_THREADED
00023
00024 #include <atlbase.h>
00025 //You may derive a class from CComModule and use it if you want to override
00026 //something, but do not change the name of _Module
00027 extern CComModule _Module;
00028 #include <uxtheme.h>
00029 #include <atlcom.h>
00030 #include <atlctl.h>
00031
00032 //{{AFX_INSERT_LOCATION}}
00033 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00034
00035 #endif // !defined(AFX_STDAFX_H__61AFBBF7_3FF6_4F41_AF97_6F37C6890019__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/about.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163         MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164         *lpDest = wszStr;
00165
00166
00167     return S_OK;
00168 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::FieldAttributeEnum Member List

This is the complete list of members for msado15::FieldAttributeEnum, including all inherited members.
adFldCacheDeferred | msado15::FieldAttributeEnum | [static]
adFldFixed | msado15::FieldAttributeEnum | [static]
adFldIsNullable | msado15::FieldAttributeEnum | [static]
adFldKeyColumn | msado15::FieldAttributeEnum | [static]
adFldLong | msado15::FieldAttributeEnum | [static]
adFldMayBeNull | msado15::FieldAttributeEnum | [static]
adFldMayDefer | msado15::FieldAttributeEnum | [static]
adFldNegativeScale | msado15::FieldAttributeEnum | [static]
adFldRowID | msado15::FieldAttributeEnum | [static]
adFldRowVersion | msado15::FieldAttributeEnum | [static]
adFldUnknownUpdatable | msado15::FieldAttributeEnum | [static]
adFldUnspecified | msado15::FieldAttributeEnum | [static]
adFldUpdatable | msado15::FieldAttributeEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/Global.h Source File

  • Web
  • NetMeeting
  • NMFT

Global.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMFT.EXE
00003 //  File:       GLOBAL.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef GLOBAL_H
00016 #define GLOBAL_H
00017
00018 #ifdef DEBUG
00019 VOID FAR PASCAL AssertProc(LPTSTR lpszMsg, LPTSTR lpszAssert, LPTSTR lpszFile, UINT line);
00020
00021 #define DEBASSERT(exp,szMsg)  \
00022   if (!(exp))                                                      \
00023   {                                                                \
00024     static TCHAR _szAssert[] = TEXT(#exp) ;   \
00025     static TCHAR _szMsg[]    = szMsg;   \
00026     AssertProc(_szMsg,_szAssert,TEXT(__FILE__),__LINE__); \
00027   }
00028
00029 #define ASSERT(f)       DEBASSERT(f, TEXT("(") TEXT(#f) TEXT(")"))
00030 #define AssertSz(f,sz)  DEBASSERT(f, sz)
00031 #define NotReached()    DEBASSERT(FALSE, TEXT("NotReached declaration was reached!"))
00032 #else
00033 #define ASSERT(f)
00034 #define AssertSz(f, sz)
00035 #define NotReached()
00036 #endif
00037
00038
00039
00040 //****************************************************************************
00041 //
00042 // Global Function Prototypes.
00043 //
00044 //****************************************************************************
00045
00046 // from msg.cpp
00047 LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00048 VOID CmdClose(void);
00049
00050 // from util.cpp
00051 BOOL FGetFileName(LPTSTR szFileName);
00052 BOOL FFileExists(LPCTSTR szFile);
00053 LPVOID LpvAlloc(int cb);
00054 LPTSTR PszAlloc(int cch);
00055 VOID FreePlpv(LPVOID plpv);
00056 LPCTSTR StrChr(LPCTSTR pcsz, TCHAR ch);
00057
00058
00059 //****************************************************************************
00060 //
00061 // Global variables.
00062 //
00063 //****************************************************************************
00064
00065 extern HINSTANCE ghInst;          // The current instance handle
00066 extern HWND   ghwndMain;          // Main Window
00067 extern const GUID g_guidApp;      // Our NmFt Guid
00068 extern TCHAR  g_szFile[MAX_PATH + 1]; //
00069 extern BOOL   g_fQuiet;           // if TRUE, no progress dialog
00070
00071 #endif /* GLOBAL_H */
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cbinder.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cbinder.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CBINDER.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CBINDER_H_
00012 #define _CBINDER_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019
00020
00021
00022 /////////////////////////////////////////////////////////////////
00023 // CBinder class
00024 //
00025 /////////////////////////////////////////////////////////////////
00026 class CBinder : public CBase
00027 {
00028 public:
00029   //Constructors
00030   CBinder(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00031   virtual ~CBinder();
00032
00033   //IUnknown Helpers
00034   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00035   virtual HRESULT     AutoRelease();
00036   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00037   virtual void      OnDefOperation();
00038
00039   //Pure Virtual
00040   virtual WCHAR*  GetObjectName()     { return L"Binder";     }
00041   virtual UINT  GetObjectMenu()     { return IDM_BINDERMENU;  }
00042   virtual LONG  GetObjectImage()    { return IMAGE_CHAPTER;   }
00043   virtual REFIID  GetDefaultInterface() { return IID_IBindResource; }
00044   virtual WCHAR*  GetObjectDesc();
00045
00046   //Methods
00047   virtual HRESULT CreateBinder(REFCLSID clsidProv);
00048   virtual HRESULT SetProperties(ULONG cPropSets, DBPROPSET* rgPropSets);
00049
00050   //OLE DB Interfaces
00051   //[MANDATORY]
00052   IBindResource*      m_pIBindResource;     //Binder interface
00053   ICreateRow*       m_pICreateRow;        //Binder interface
00054   IDBProperties*      m_pIDBProperties;     //Binder interface
00055   IDBBinderProperties*  m_pIDBBinderProperties;   //Binder interface
00056
00057   //[OPTIONAL]
00058   IRegisterProvider*    m_pIRegisterProvider;   //Binder interface
00059
00060   //Saved URL
00061   WCHAR*          m_pwszURL;
00062 };
00063
00064
00065
00066
00067 #endif  //_CBINDER_H_
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/PropList.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

PropList.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      PropList.h
00007 //
00008 //  Implementation File:
00009 //      PropList.cpp
00010 //
00011 //  Description:
00012 //      Definition of the CClusPropList class.
00013 //
00014 //  Author:
00015 //      <name> (<e-mail name>) Mmmm DD, 2003
00016 //
00017 //  Revision History:
00018 //
00019 //  Notes:
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #pragma once
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Include Files
00027 /////////////////////////////////////////////////////////////////////////////
00028 #include <windows.h>
00029 #include <clusapi.h>
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // Forward Class Declarations
00033 /////////////////////////////////////////////////////////////////////////////
00034
00035 class CObjectProperty;
00036 class CClusPropValueList;
00037 class CClusPropList;
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // External Class Declarations
00041 /////////////////////////////////////////////////////////////////////////////
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 // Type Definitions
00045 /////////////////////////////////////////////////////////////////////////////
00046
00047 #if !defined( ASSERT )
00048 #include <crtdbg.h>
00049 #define ASSERT _ASSERTE
00050 #endif // !defined( ASSERT )
00051
00052 #pragma warning( push, 3 )
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // Custom string compare function declarations. Used to replace lstrcmp*
00056 /////////////////////////////////////////////////////////////////////////////
00057
00058 //
00059 // Full string compares.
00060 //
00061
00062 int
00063 IBSTRCompareW(
00064       BSTR  bstrString1In
00065     , BSTR  bstrString2In
00066     );
00067
00068 int
00069 BSTRCompareW(
00070       BSTR  bstrString1In
00071     , BSTR  bstrString2In
00072     );
00073
00074 int
00075 IStringCompareW(
00076       LPCWSTR pcwszString1In
00077     , LPCWSTR pcwszString2In
00078     );
00079
00080 int
00081 StringCompareW(
00082       LPCWSTR pcwszString1In
00083     , LPCWSTR pcwszString2In
00084     );
00085
00086 int
00087 IStringCompareW(
00088       LPCWSTR   pcwszString1In
00089     , size_t    cch1In
00090     , LPCWSTR   pcwszString2In
00091     , size_t    cch2In
00092     );
00093
00094 int
00095 StringCompareW(
00096       LPCWSTR   pcwszString1In
00097     , size_t    cch1In
00098     , LPCWSTR   pcwszString2In
00099     , size_t    cch2In
00100     );
00101
00102 //
00103 // Partial string compares.  They use whichever one's length is shortest
00104 // if both are specified or the NBSTR routines are used.
00105 //
00106
00107 int
00108 NIBSTRCompareW(
00109       BSTR  bstrString1In
00110     , BSTR  bstrString2In
00111     );
00112
00113 int
00114 NBSTRCompareW(
00115       BSTR  bstrString1In
00116     , BSTR  bstrString2In
00117     );
00118
00119 int
00120 NIStringCompareW(
00121       LPCWSTR   pcwszString1In
00122     , LPCWSTR   pcwszString2In
00123     , size_t    cchIn
00124     );
00125
00126 int
00127 NStringCompareW(
00128       LPCWSTR   pcwszString1In
00129     , LPCWSTR   pcwszString2In
00130     , size_t    cchIn
00131     );
00132
00133 int
00134 NIStringCompareW(
00135       LPCWSTR   pcwszString1In
00136     , size_t    cch1In
00137     , LPCWSTR   pcwszString2In
00138     , size_t    cch2In
00139     );
00140
00141 int
00142 NStringCompareW(
00143       LPCWSTR   pcwszString1In
00144     , size_t    cch1In
00145     , LPCWSTR   pcwszString2In
00146     , size_t    cch2In
00147     );
00148
00149 /////////////////////////////////////////////////////////////////////////////
00150 //++
00151 //
00152 //  class CObjectProperty
00153 //
00154 //  Description:
00155 //      Describes a property in a cluster property list.
00156 //
00157 //  Inheritance:
00158 //      CObjectProperty
00159 //
00160 //--
00161 /////////////////////////////////////////////////////////////////////////////
00162
00163 #if defined( __AFX_H__ ) || ( defined( __ATLTMP_H__ ) && !defined( _ATL_TMP_NO_CSTRING ) )
00164
00165 class CObjectProperty
00166 {
00167 public:
00168
00169     LPCWSTR                 m_pwszName;
00170     CLUSTER_PROPERTY_FORMAT m_propFormat;
00171
00172     union CValue
00173     {
00174         CString *   pstr;
00175         LONG *      pl;
00176         DWORD *     pdw;
00177         BOOL *      pb;
00178         struct
00179         {
00180             PBYTE * ppb;
00181             DWORD * pcb;
00182         };
00183     };
00184
00185     CValue  m_value;
00186     CValue  m_valuePrev;
00187     CValue  m_valueEx;      // expand_sz value (if any)
00188
00189     DWORD   m_dwFlags;
00190
00191     enum ObjPropFlags
00192     {
00193         opfNew = 1
00194     };
00195
00196     CObjectProperty::CObjectProperty( void )
00197     {
00198         m_value.pstr = NULL;
00199         m_value.pcb = NULL;
00200         m_valuePrev.pstr = NULL;
00201         m_valuePrev.pcb = NULL;
00202         m_valueEx.pstr = NULL;
00203         m_valueEx.pcb = NULL;
00204     };
00205
00206     void
00207     Set(
00208           LPCWSTR   pwszNameIn
00209         , CString & rstrValueInout
00210         , CString & rstrPrevValueInout
00211         , DWORD     dwFlagsIn = 0
00212         )
00213     {
00214         m_pwszName = pwszNameIn;
00215         m_propFormat = CLUSPROP_FORMAT_SZ;
00216         m_value.pstr = &rstrValueInout;
00217         m_value.pcb = NULL;
00218         m_valuePrev.pstr = &rstrPrevValueInout;
00219         m_valuePrev.pcb = NULL;
00220         m_valueEx.pstr = NULL;
00221         m_valueEx.pcb = NULL;
00222         m_dwFlags = dwFlagsIn;
00223
00224     } //*** Set( CString & )
00225
00226     void
00227     SetExpandSz(
00228           LPCWSTR   pwszNameIn
00229         , CString & rstrValueInout
00230         , CString & rstrPrevValueInout
00231         , DWORD     dwFlagsIn = 0
00232         )
00233     {
00234         m_pwszName = pwszNameIn;
00235         m_propFormat = CLUSPROP_FORMAT_EXPAND_SZ;
00236         m_value.pstr = &rstrValueInout;
00237         m_value.pcb = NULL;
00238         m_valuePrev.pstr = &rstrPrevValueInout;
00239         m_valuePrev.pcb = NULL;
00240         m_valueEx.pstr= NULL;
00241         m_valueEx.pcb = NULL;
00242         m_dwFlags = dwFlagsIn;
00243
00244     } //*** Set( CString & )
00245
00246     // Set() to get extra EXPANDED_SZ value
00247     void
00248     Set(
00249           LPCWSTR   pwszNameIn
00250         , CString & rstrValueInout
00251         , CString & rstrPrevValueInout
00252         , CString & rstrValueEx
00253         , DWORD     dwFlagsIn = 0
00254         )
00255     {
00256         m_pwszName = pwszNameIn;
00257         m_propFormat = CLUSPROP_FORMAT_SZ;
00258         m_value.pstr = &rstrValueInout;
00259         m_value.pcb = NULL;
00260         m_valuePrev.pstr = &rstrPrevValueInout;
00261         m_valuePrev.pcb = NULL;
00262         m_valueEx.pstr = &rstrValueEx;
00263         m_valueEx.pcb = NULL;
00264         m_dwFlags = dwFlagsIn;
00265
00266     } //*** Set( CString & )
00267
00268     // Set() to get extra EXPANDED_SZ value
00269     void
00270     SetExpandSz(
00271           LPCWSTR   pwszNameIn
00272         , CString & rstrValueInout
00273         , CString & rstrPrevValueInout
00274         , CString & rstrValueEx
00275         , DWORD     dwFlagsIn = 0
00276         )
00277     {
00278         m_pwszName = pwszNameIn;
00279         m_propFormat = CLUSPROP_FORMAT_EXPAND_SZ;
00280         m_value.pstr = &rstrValueInout;
00281         m_value.pcb = NULL;
00282         m_valuePrev.pstr = &rstrPrevValueInout;
00283         m_valuePrev.pcb = NULL;
00284         m_valueEx.pstr = &rstrValueEx;
00285         m_valueEx.pcb = NULL;
00286         m_dwFlags = dwFlagsIn;
00287
00288     } //*** Set( CString & )
00289
00290     void
00291     Set(
00292           LPCWSTR   pwszNameIn
00293         , LONG &    rnValueInout
00294         , LONG &    rnPrevValueInout
00295         , DWORD     dwFlagsIn = 0
00296         )
00297     {
00298         m_pwszName = pwszNameIn;
00299         m_propFormat = CLUSPROP_FORMAT_LONG;
00300         m_value.pl = &rnValueInout;
00301         m_value.pcb = NULL;
00302         m_valuePrev.pl = &rnPrevValueInout;
00303         m_valuePrev.pcb = NULL;
00304         m_valueEx.pstr = NULL;
00305         m_valueEx.pcb = NULL;
00306         m_dwFlags = dwFlagsIn;
00307
00308     } //*** Set( LONG & )
00309
00310     void
00311     Set(
00312           LPCWSTR   pwszNameIn
00313         , DWORD &   rdwValueInout
00314         , DWORD &   rdwPrevValueInout
00315         , DWORD     dwFlagsIn = 0
00316         )
00317     {
00318         m_pwszName = pwszNameIn;
00319         m_propFormat = CLUSPROP_FORMAT_DWORD;
00320         m_value.pdw = &rdwValueInout;
00321         m_value.pcb = NULL;
00322         m_valuePrev.pdw = &rdwPrevValueInout;
00323         m_valuePrev.pcb = NULL;
00324         m_valueEx.pstr = NULL;
00325         m_valueEx.pcb = NULL;
00326         m_dwFlags = dwFlagsIn;
00327
00328     } //*** Set( DWORD & )
00329
00330     void
00331     Set(
00332           LPCWSTR   pwszNameIn
00333         , BOOL &    rbValueInout
00334         , BOOL &    rbPrevValueInout
00335         , DWORD     dwFlagsIn = 0
00336         )
00337     {
00338         m_pwszName = pwszNameIn;
00339         m_propFormat = CLUSPROP_FORMAT_DWORD;
00340         m_value.pb = &rbValueInout;
00341         m_value.pcb = NULL;
00342         m_valuePrev.pb = &rbPrevValueInout;
00343         m_valuePrev.pcb = NULL;
00344         m_valueEx.pstr = NULL;
00345         m_valueEx.pcb = NULL;
00346         m_dwFlags = dwFlagsIn;
00347
00348     } //*** Set( BOOL & )
00349
00350     void
00351     Set(
00352           LPCWSTR   pwszNameIn
00353         , PBYTE &   rpbValueInoout
00354         , DWORD &   rcbValueInout
00355         , PBYTE &   rpbPrevValueInout
00356         , DWORD &   rcbPrevValueInout
00357         , DWORD     dwFlagsIn = 0
00358         )
00359     {
00360         m_pwszName = pwszNameIn;
00361         m_propFormat = CLUSPROP_FORMAT_BINARY;
00362         m_value.ppb = &rpbValueInoout;
00363         m_value.pcb = &rcbValueInout;
00364         m_valuePrev.ppb = &rpbPrevValueInout;
00365         m_valuePrev.pcb = &rcbPrevValueInout;
00366         m_valueEx.pstr = NULL;
00367         m_valueEx.pcb = NULL;
00368         m_dwFlags = dwFlagsIn;
00369
00370     } //*** Set( PBYTE & )
00371
00372     void
00373     Set(
00374           LPCWSTR   pwszNameIn
00375         , LPWSTR &  rpwszValue
00376         , DWORD &   rcbValueInout
00377         , LPWSTR &  rpwszPrevValue
00378         , DWORD &   rcbPrevValueInout
00379         , DWORD     dwFlagsIn = 0
00380         )
00381     {
00382         m_pwszName = pwszNameIn;
00383         m_propFormat = CLUSPROP_FORMAT_MULTI_SZ;
00384         m_value.ppb = reinterpret_cast< PBYTE * >( &rpwszValue );
00385         m_value.pcb = &rcbValueInout;
00386         m_valuePrev.ppb = reinterpret_cast< PBYTE * >( &rpwszPrevValue );
00387         m_valuePrev.pcb = &rcbPrevValueInout;
00388         m_valueEx.pstr = NULL;
00389         m_valueEx.pcb = NULL;
00390         m_dwFlags = dwFlagsIn;
00391
00392     } //*** Set( LPWSTR & )
00393
00394 }; //*** class CObjectProperty
00395
00396 #endif  // defined( __AFX_H__ ) || ( defined( __ATLTMP_H__ ) && !defined( _ATL_TMP_NO_CSTRING ) )
00397
00398 /////////////////////////////////////////////////////////////////////////////
00399 //++
00400 //
00401 //  class CClusPropValueList
00402 //
00403 //  Description:
00404 //      Describes a cluster property list.
00405 //
00406 //  Inheritance:
00407 //      CClusPropValueList
00408 //      CObject (MFC only)
00409 //
00410 //--
00411 /////////////////////////////////////////////////////////////////////////////
00412
00413 class CClusPropValueList
00414 #ifdef __AFX_H__
00415     : public CObject
00416 #endif // __AFX_H__
00417 {
00418 #ifdef __AFX_H__
00419     DECLARE_DYNAMIC( CClusPropValueList );
00420 #endif // __AFX_H__
00421
00422 public:
00423
00424     //
00425     // Construction.
00426     //
00427
00428     // Default constructor
00429     CClusPropValueList( void )
00430         : m_cbDataSize( 0 )
00431         , m_cbDataLeft( 0 )
00432         , m_cbBufferSize( 0 )
00433         , m_fAtEnd( FALSE )
00434     {
00435         m_cbhValueList.pb = NULL;
00436         m_cbhCurrentValue.pb = NULL;
00437
00438     } //*** CClusPropValueList
00439
00440     //  Copy constructor.
00441     CClusPropValueList(
00442         const CClusPropValueList & rcpvlInout
00443         )
00444         : m_cbBufferSize( 0 )
00445         , m_fAtEnd( FALSE )
00446     {
00447         Init( rcpvlInout );
00448
00449     } //*** CClusPropValueList
00450
00451     //  Buffer helper constructor.
00452     CClusPropValueList(
00453           CLUSPROP_BUFFER_HELPER    cbhValueListIn
00454         , size_t                    cbDataSizeIn
00455         )
00456         : m_cbBufferSize( 0 )
00457         , m_fAtEnd( FALSE )
00458     {
00459         Init( cbhValueListIn, cbDataSizeIn );
00460
00461     } //*** CClusPropValueList
00462
00463     //  Destructor
00464     ~CClusPropValueList( void )
00465     {
00466         DeleteValueList();
00467
00468     } //*** ~CClusPropValueList
00469
00470     //  Initialize the value list
00471     void
00472     Init(
00473         const CClusPropValueList & rcpvlInout
00474         )
00475     {
00476         ASSERT( m_cbBufferSize == 0 );
00477
00478         m_cbhValueList      = rcpvlInout.m_cbhValueList;
00479         m_cbhCurrentValue   = rcpvlInout.m_cbhCurrentValue;
00480         m_cbDataSize        = rcpvlInout.m_cbDataSize;
00481         m_cbDataLeft        = rcpvlInout.m_cbDataLeft;
00482         m_fAtEnd            = rcpvlInout.m_fAtEnd;
00483
00484     } //*** Init
00485
00486     //  Initialize the value list from a buffer helper
00487     void
00488     Init(
00489           const CLUSPROP_BUFFER_HELPER  cbhValueListIn
00490         , size_t                        cbDataSizeIn
00491         )
00492     {
00493         ASSERT( m_cbBufferSize == 0 );
00494
00495         m_cbhValueList      = cbhValueListIn;
00496         m_cbhCurrentValue   = cbhValueListIn;
00497         m_cbDataSize        = cbDataSizeIn;
00498         m_cbDataLeft        = cbDataSizeIn;
00499         m_fAtEnd            = FALSE;
00500
00501     } //*** Init
00502
00503     //  Assignment operator
00504     void operator=( const CClusPropValueList & rcpvlInout )
00505     {
00506         ASSERT( m_cbBufferSize == 0 );
00507
00508         m_cbhValueList      = rcpvlInout.m_cbhValueList;
00509         m_cbhCurrentValue   = rcpvlInout.m_cbhCurrentValue;
00510         m_cbDataSize        = rcpvlInout.m_cbDataSize;
00511         m_cbDataLeft        = rcpvlInout.m_cbDataLeft;
00512         m_fAtEnd            = rcpvlInout.m_fAtEnd;
00513
00514     } //*** operator=
00515
00516     //
00517     // Accessor methods.
00518     //
00519
00520     // Buffer helper cast operator to access the current value
00521     operator const CLUSPROP_BUFFER_HELPER( void ) const
00522     {
00523         return m_cbhCurrentValue;
00524
00525     } //*** operator CLUSPROP_BUFFER_HELPER
00526
00527     // Access the value list
00528     CLUSPROP_BUFFER_HELPER CbhValueList( void ) const
00529     {
00530         return m_cbhValueList;
00531
00532     } //*** CbhValueList
00533
00534     // Access the current value
00535     CLUSPROP_BUFFER_HELPER CbhCurrentValue( void ) const
00536     {
00537         return m_cbhCurrentValue;
00538
00539     } //*** CbhCurrentValue
00540
00541     // Access the format of the current value
00542     CLUSTER_PROPERTY_FORMAT CpfCurrentValueFormat( void ) const
00543     {
00544         return static_cast< CLUSTER_PROPERTY_FORMAT >( m_cbhCurrentValue.pValue->Syntax.wFormat );
00545
00546     } //*** CpfCurrentValueFormat
00547
00548     // Access the type of the current value
00549     CLUSTER_PROPERTY_TYPE CptCurrentValueType( void ) const
00550     {
00551         return static_cast< CLUSTER_PROPERTY_TYPE >( m_cbhCurrentValue.pValue->Syntax.wType );
00552
00553     } //*** CptCurrentValueType
00554
00555     // Access the syntax of the current value
00556     CLUSTER_PROPERTY_SYNTAX CpsCurrentValueSyntax( void ) const
00557     {
00558         return static_cast< CLUSTER_PROPERTY_SYNTAX >( m_cbhCurrentValue.pValue->Syntax.dw );
00559
00560     } //*** CpsCurrentValueSyntax
00561
00562     // Access the length of the data of the current value
00563     DWORD CbCurrentValueLength( void ) const
00564     {
00565         DWORD cbLength = 0;
00566
00567         if ( m_cbhCurrentValue.pb == NULL )
00568         {
00569             cbLength = 0;
00570         } // if: no value list allocated yet
00571         else
00572         {
00573             cbLength = m_cbhCurrentValue.pValue->cbLength;
00574         } // else: value list allocated
00575
00576         return cbLength;
00577
00578     } //*** CbCurrentValueLength
00579
00580     // Access size of the data in the buffer.
00581     DWORD CbDataSize( void ) const
00582     {
00583         return m_cbDataSize;
00584
00585     } //*** CbDataSize
00586
00587     // Access amount of data left in buffer after current value
00588     DWORD CbDataLeft( void ) const
00589     {
00590         return m_cbDataLeft;
00591
00592     } //*** CbDataLeft
00593
00594     //
00595     // Parsing methods.
00596     //
00597
00598     // Move to the first value in the list
00599     DWORD ScMoveToFirstValue( void );
00600
00601     // Move the value after the current one in the list
00602     DWORD ScMoveToNextValue( void );
00603
00604     // Query whether we are at the last value in the list or not
00605     DWORD ScCheckIfAtLastValue( void );
00606
00607     //
00608     // Methods for building a value list.
00609     //
00610
00611     DWORD ScAllocValueList( size_t cbMinimumIn );
00612
00613     // Delete the value list buffer and cleanup support variables
00614     void DeleteValueList( void )
00615     {
00616         //
00617         // If m_cbBufferSize is greater then 0 then we allocated the value list.
00618         // If it's zero then the value list is a part of the property list in
00619         // CClusPropList.
00620         //
00621
00622         if ( m_cbBufferSize > 0 )
00623         {
00624             delete [] m_cbhValueList.pb;
00625
00626             m_cbhValueList.pb = NULL;
00627             m_cbhCurrentValue.pb = NULL;
00628             m_cbBufferSize = 0;
00629             m_cbDataSize = 0;
00630             m_cbDataLeft = 0;
00631             m_fAtEnd = FALSE;
00632         } // if: we allocated anything
00633
00634     } //*** DeleteValueList
00635
00636     // Get a value list from a resource
00637     DWORD
00638     ScGetResourceValueList(
00639           HRESOURCE hResourceIn
00640         , DWORD     dwControlCodeIn
00641         , HNODE     hHostNodeIn = NULL
00642         , LPVOID    lpBufferIn = NULL
00643         , size_t    cbBufferIn = 0
00644         );
00645
00646     // Get a value list from a resource type
00647     DWORD ScGetResourceTypeValueList(
00648           HCLUSTER  hClusterIn
00649         , LPCWSTR   pwszResTypeNameIn
00650         , DWORD     dwControlCodeIn
00651         , HNODE     hHostNodeIn = NULL
00652         , LPVOID    lpBufferIn = NULL
00653         , size_t    cbBufferIn = 0
00654         );
00655
00656 private:
00657     CLUSPROP_BUFFER_HELPER  m_cbhValueList;     // Pointer to the value list for parsing.
00658     CLUSPROP_BUFFER_HELPER  m_cbhCurrentValue;  // Pointer to the current value for parsing.
00659     DWORD                   m_cbDataSize;       // Amount of data in the buffer.
00660     DWORD                   m_cbDataLeft;       // Amount of data left in buffer after current value.
00661     DWORD                   m_cbBufferSize;     // Size of the buffer if we allocated it.
00662     BOOL                    m_fAtEnd;           // Indicates whether at last value in list.
00663
00664 }; //*** class CClusPropValueList
00665
00666 /////////////////////////////////////////////////////////////////////////////
00667 //++
00668 //
00669 //  class CClusPropList
00670 //
00671 //  Description:
00672 //      Describes a cluster property list.
00673 //
00674 //  Inheritance:
00675 //      CClusPropList
00676 //      CObject (MFC only)
00677 //
00678 //--
00679 /////////////////////////////////////////////////////////////////////////////
00680 class CClusPropList
00681 #ifdef __AFX_H__
00682     : public CObject
00683 #endif // __AFX_H__
00684 {
00685 #ifdef __AFX_H__
00686     DECLARE_DYNAMIC( CClusPropList );
00687 #endif // __AFX_H__
00688
00689 public:
00690
00691     //
00692     // Construction.
00693     //
00694
00695     // Default constructor
00696     CClusPropList(
00697         BOOL bAlwaysAddPropIn = FALSE
00698         )
00699         : m_fAlwaysAddProp( bAlwaysAddPropIn )
00700         , m_cbBufferSize( 0 )
00701         , m_cbDataSize( 0 )
00702         , m_cbDataLeft( 0 )
00703         , m_nPropsRemaining( 0 )
00704     {
00705         m_cbhPropList.pList     = NULL;
00706         m_cbhCurrentProp.pb     = NULL;
00707         m_cbhCurrentPropName.pb = NULL;
00708
00709     } //*** CClusPropList
00710
00711     // Destructor
00712     ~CClusPropList( void )
00713     {
00714         DeletePropList();
00715
00716     } //*** ~CClusPropList
00717
00718     // Copy list into this list (like assignment operator)
00719     DWORD ScCopy( const PCLUSPROP_LIST pcplPropListIn, size_t cbListSizeIn );
00720
00721     // Append list into this list
00722     DWORD ScAppend( const CClusPropList & rclPropListIn );
00723
00724     // Delete the property list buffer and cleanup support variables
00725     void DeletePropList( void )
00726     {
00727         delete [] m_cbhPropList.pb;
00728
00729         m_cbhPropList.pb = NULL;
00730         m_cbhCurrentProp.pb = NULL;
00731         m_cbhCurrentPropName.pb = NULL;
00732         m_cbBufferSize = 0;
00733         m_cbDataSize = 0;
00734         m_cbDataLeft = 0;
00735
00736     } //*** DeletePropList
00737
00738 protected:
00739
00740     //
00741     // Attributes.
00742     //
00743
00744     BOOL                    m_fAlwaysAddProp;       // Indicate if properties should be added even if not different.
00745     CLUSPROP_BUFFER_HELPER  m_cbhPropList;          // Pointer to the beginning of the list.
00746     CLUSPROP_BUFFER_HELPER  m_cbhCurrentProp;       // Pointer to the current property.
00747     DWORD                   m_cbBufferSize;         // Allocated size of the buffer.
00748     DWORD                   m_cbDataSize;           // Amount of data in the buffer.
00749     DWORD                   m_cbDataLeft;           // Amount of data left in buffer after current value.
00750
00751 private:
00752     CLUSPROP_BUFFER_HELPER  m_cbhCurrentPropName;   // Pointer to the current name for parsing
00753     DWORD                   m_nPropsRemaining;      // Used by BMoveToNextProperty() to track end of list.
00754     CClusPropValueList      m_pvlValues;            // Helper class for value list of current property.
00755
00756 public:
00757
00758     //
00759     // Accessor methods.
00760     //
00761
00762     // Access the values of the current property
00763     const CClusPropValueList & RPvlPropertyValue( void )
00764     {
00765         return m_pvlValues;
00766
00767     } //*** RPvlPropertyValue
00768
00769     // Access the property list
00770     operator PCLUSPROP_LIST( void ) const
00771     {
00772         return m_cbhPropList.pList;
00773
00774     } //*** operator PCLUSPROP_LIST
00775
00776     // Access allocated size of the buffer
00777     DWORD CbBufferSize( void ) const
00778     {
00779         return m_cbBufferSize;
00780
00781     } //*** CbBufferSize
00782
00783     // Access the name of the current property
00784     LPCWSTR PszCurrentPropertyName( void ) const
00785     {
00786         return m_cbhCurrentPropName.pName->sz;
00787
00788     } //*** PszCurrentPropertyName
00789
00790     // Access the current property name as a buffer helper
00791     const CLUSPROP_BUFFER_HELPER CbhCurrentPropertyName( void )
00792     {
00793         return m_cbhCurrentPropName;
00794
00795     } //*** CbhCurrentPropertyName
00796
00797     // Access value list of the current property as a buffer helper
00798     const CLUSPROP_BUFFER_HELPER CbhCurrentValueList( void )
00799     {
00800         return m_pvlValues.CbhValueList();
00801
00802     } //*** CbhCurrentValueList
00803
00804     // Access current value of the current property as a buffer helper
00805     const CLUSPROP_BUFFER_HELPER CbhCurrentValue( void )
00806     {
00807         return m_pvlValues.CbhCurrentValue();
00808
00809     } //*** CbhCurrentValue
00810
00811     // Access the format of the current value of the current property
00812     CLUSTER_PROPERTY_FORMAT CpfCurrentValueFormat( void ) const
00813     {
00814         return m_pvlValues.CpfCurrentValueFormat();
00815
00816     } //*** CpfCurrentValueFormat
00817
00818     // Access the type of the current value of the current property
00819     CLUSTER_PROPERTY_TYPE CptCurrentValueType( void ) const
00820     {
00821         return m_pvlValues.CptCurrentValueType();
00822
00823     } //*** CptCurrentValueType
00824
00825     // Access the syntax of the current value of the current property
00826     CLUSTER_PROPERTY_SYNTAX CpsCurrentValueSyntax( void ) const
00827     {
00828         return m_pvlValues.CpsCurrentValueSyntax();
00829
00830     } //*** CpsCurrentValueSyntax
00831
00832     // Access the length of the current value of the current property
00833     DWORD CbCurrentValueLength( void ) const
00834     {
00835         return m_pvlValues.CbCurrentValueLength();
00836
00837     } //*** CbCurrentValueLength
00838
00839     PCLUSPROP_LIST Plist( void )
00840     {
00841         return m_cbhPropList.pList;
00842
00843     } //*** Plist
00844
00845     const CLUSPROP_BUFFER_HELPER CbhPropList( void ) const
00846     {
00847         return m_cbhPropList;
00848
00849     } //*** CbhPropList
00850
00851     PBYTE PbPropList( void ) const
00852     {
00853         return m_cbhPropList.pb;
00854
00855     } //*** PbPropList
00856
00857     DWORD CbPropList( void ) const
00858     {
00859         return m_cbDataSize + sizeof( CLUSPROP_SYNTAX ); /*endmark*/
00860
00861     } //*** CbPropList
00862
00863     // Access amount of data left in buffer after current value
00864     DWORD CbDataLeft( void ) const
00865     {
00866         return m_cbDataLeft;
00867
00868     } //*** CbDataLeft
00869
00870     DWORD Cprops( void ) const
00871     {
00872         if ( m_cbhPropList.pb == NULL )
00873         {
00874             return 0;
00875         } // if:  no buffer yet
00876
00877         return m_cbhPropList.pList->nPropertyCount;
00878
00879     } //*** Cprops
00880
00881 public:
00882     //
00883     // Parsing methods.
00884     //
00885
00886     // Initialize the size after getting properties from an external source
00887     void InitSize( size_t cbSizeIn )
00888     {
00889         ASSERT( m_cbhPropList.pb != NULL );
00890         ASSERT( m_cbBufferSize > 0 );
00891
00892         m_cbDataSize = cbSizeIn;
00893         m_cbDataLeft = cbSizeIn;
00894
00895     } //*** InitSize
00896
00897     // Move to the first property in the list
00898     DWORD ScMoveToFirstProperty( void );
00899
00900     // Move the property after the current one in the list
00901     DWORD ScMoveToNextProperty( void );
00902
00903     // Move to a property by specifying its name
00904     DWORD ScMoveToPropertyByName( LPCWSTR pwszPropNameIn );
00905
00906     // Move to the first value in the current property
00907     DWORD ScMoveToFirstPropertyValue( void )
00908     {
00909         return m_pvlValues.ScMoveToFirstValue();
00910
00911     } //*** ScMoveToFirstPropertyValue
00912
00913     // Move the the value after the current on in the current property
00914     DWORD ScMoveToNextPropertyValue( void )
00915     {
00916         return m_pvlValues.ScMoveToNextValue();
00917
00918     } //*** ScMoveToNextPropertyValue
00919
00920     // Query whether we are at the last property in the list or not
00921     DWORD ScCheckIfAtLastProperty( void ) const
00922     {
00923         DWORD sc;
00924
00925         if ( m_nPropsRemaining <= 1 )
00926         {
00927             sc = ERROR_NO_MORE_ITEMS;
00928         } // if:  at the last property
00929         else
00930         {
00931             sc = ERROR_SUCCESS;
00932         } // else:  not at the last property
00933
00934         return sc;
00935
00936     } //*** ScCheckIfAtLastProperty
00937
00938     // Query whether the list is empty or not
00939     BOOL BIsListEmpty( void ) const
00940     {
00941         ASSERT( m_cbhPropList.pb != NULL );
00942         ASSERT( m_cbDataSize >= sizeof( m_cbhPropList.pList->nPropertyCount ) );
00943
00944         return m_cbhPropList.pList->nPropertyCount == 0;
00945
00946     } //*** BIsListEmpty
00947
00948 public:
00949     //
00950     // Methods for building a property list.
00951     //
00952
00953     // Allocate a property list
00954     DWORD ScAllocPropList( size_t cbMinimumIn );
00955
00956     void ClearPropList( void )
00957     {
00958         m_cbDataSize = 0;
00959         m_cbDataLeft = 0;
00960
00961         if ( m_cbBufferSize != 0 )
00962         {
00963             ZeroMemory( m_cbhPropList.pb, m_cbBufferSize );
00964             m_cbhCurrentProp.pb = m_cbhPropList.pb + sizeof( m_cbhPropList.pList->nPropertyCount );
00965             m_cbhCurrentPropName = m_cbhCurrentProp;
00966         } // if:  buffer already allocated
00967
00968     } //*** ClearPropList
00969
00970     DWORD ScAddProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn );
00971
00972     DWORD ScAddExpandSzProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn );
00973
00974     DWORD ScAddMultiSzProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn );
00975
00976     DWORD ScAddProp( LPCWSTR pwszNameIn, DWORD nValueIn, DWORD nPrevValueIn );
00977
00978     DWORD ScAddProp( LPCWSTR pwszNameIn, LONG nValueIn, LONG nPrevValueIn );
00979
00980     DWORD ScAddProp( LPCWSTR pwszNameIn, ULONGLONG ullValueIn, ULONGLONG ullPrevValueIn );
00981
00982     DWORD ScAddProp( LPCWSTR pwszNameIn, LONGLONG llValueIn, LONGLONG llPrevValueIn );
00983
00984     DWORD ScSetPropToDefault( LPCWSTR pwszNameIn, CLUSTER_PROPERTY_FORMAT propFormatIn );
00985
00986     DWORD ScAddProp(
00987               LPCWSTR               pwszNameIn
00988             , const unsigned char * pbValueIn
00989             , size_t                cbValueIn
00990             , const unsigned char * pbPrevValueIn
00991             , size_t                cbPrevValueIn
00992             );
00993
00994     DWORD ScAddProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn )
00995     {
00996         return ScAddProp( pwszNameIn, pwszValueIn, NULL );
00997
00998     } //*** ScAddProp
00999
01000     DWORD ScAddExpandSzProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn )
01001     {
01002         return ScAddExpandSzProp( pwszNameIn, pwszValueIn, NULL );
01003
01004     } //*** ScAddExpandSzProp
01005
01006 public:
01007
01008     //
01009     // Get Property methods.
01010     //
01011
01012     DWORD ScGetNodeProperties(
01013           HNODE     hNodeIn
01014         , DWORD     dwControlCodeIn
01015         , HNODE     hHostNodeIn = NULL
01016         , LPVOID    lpBufferIn = NULL
01017         , size_t    cbBufferIn = 0
01018         );
01019
01020     DWORD ScGetGroupProperties(
01021           HGROUP   hGroupIn
01022         , DWORD    dwControlCodeIn
01023         , HNODE    hHostNodeIn = NULL
01024         , LPVOID   lpBufferIn = NULL
01025         , size_t   cbBufferIn = 0
01026         );
01027
01028     DWORD ScGetResourceProperties(
01029           HRESOURCE    hResourceIn
01030         , DWORD        dwControlCodeIn
01031         , HNODE        hHostNodeIn = NULL
01032         , LPVOID       lpBufferIn = NULL
01033         , size_t       cbBufferIn = 0
01034         );
01035
01036     DWORD ScGetResourceTypeProperties(
01037           HCLUSTER hClusterIn
01038         , LPCWSTR  pwszResTypeNameIn
01039         , DWORD    dwControlCodeIn
01040         , HNODE    hHostNodeIn = NULL
01041         , LPVOID   lpBufferIn = NULL
01042         , size_t   cbBufferIn = 0
01043         );
01044
01045     DWORD ScGetNetworkProperties(
01046           HNETWORK hNetworkIn
01047         , DWORD    dwControlCodeIn
01048         , HNODE    hHostNodeIn = NULL
01049         , LPVOID   lpBufferIn = NULL
01050         , size_t   cbBufferIn = 0
01051         );
01052
01053     DWORD ScGetNetInterfaceProperties(
01054           HNETINTERFACE    hNetInterfaceIn
01055         , DWORD            dwControlCodeIn
01056         , HNODE            hHostNodeIn  = NULL
01057         , LPVOID           lpBufferIn = NULL
01058         , size_t           cbBufferIn = 0
01059         );
01060
01061     DWORD ScGetClusterProperties(
01062           HCLUSTER hClusterIn
01063         , DWORD    dwControlCodeIn
01064         , HNODE    hHostNodeIn = NULL
01065         , LPVOID   lpBufferIn = NULL
01066         , size_t   cbBufferIn = 0
01067         );
01068
01069 // Implementation
01070 protected:
01071     void CopyProp(
01072           PCLUSPROP_SZ             ppropIn
01073         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
01074         , LPCWSTR                  pszIn
01075         , size_t                   cbszIn = 0
01076         );
01077
01078     void CopyExpandSzProp(
01079           PCLUSPROP_SZ             ppropIn
01080         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
01081         , LPCWSTR                  pszIn
01082         , size_t                   cbszIn = 0
01083         );
01084
01085     void CopyMultiSzProp(
01086           PCLUSPROP_MULTI_SZ       ppropIn
01087         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
01088         , LPCWSTR                  pszIn
01089         , size_t                   cbszIn = 0
01090         );
01091
01092     void CopyProp(
01093           PCLUSPROP_DWORD          ppropIn
01094         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
01095         , DWORD                    nValueIn
01096         );
01097
01098     void CopyProp(
01099           PCLUSPROP_LONG           ppropIn
01100         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
01101         , LONG                     nValueIn
01102         );
01103
01104     void CopyProp(
01105           PCLUSPROP_ULARGE_INTEGER  ppropOut
01106         , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
01107         , ULONGLONG                 ullValueIn
01108         );
01109
01110     void CopyProp(
01111           PCLUSPROP_LARGE_INTEGER  ppropOut
01112         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
01113         , LONGLONG                 llValueIn
01114         );
01115
01116     void CopyProp(
01117           PCLUSPROP_ULARGE_INTEGER  ppropOut
01118         , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
01119         , LONGLONG                  llValueIn
01120         );
01121     void CopyProp(
01122           PCLUSPROP_BINARY      ppropOut
01123         , CLUSTER_PROPERTY_TYPE cptPropTypeIn
01124         , const unsigned char * pbValueIn
01125         , size_t                cbValueIn
01126         );
01127
01128     void CopyEmptyProp(
01129           PCLUSPROP_VALUE           ppropOut
01130         , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
01131         , CLUSTER_PROPERTY_FORMAT   propFormatIn
01132         );
01133
01134 }; //*** class CClusPropList
01135
01136 #pragma warning( pop )
01137
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcRDO/RDOKB.Idl Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcRDO

RDOKB.Idl

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: RDOKB.idl
00003 //
00004 // Description: IDL source for RDOKB.dll
00005 //
00006 //
00007 // This file is part of the Microsoft COM+ Samples
00008 //
00009 // Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved
00010 //
00011 // This source code is intended only as a supplement to Microsoft
00012 // Development Tools and/or on-line documentation.  See these other
00013 // materials for detailed information reagrding Microsoft code samples.
00014 //
00015 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 // PARTICULAR PURPOSE.
00019 //
00020 //==============================================================================
00021
00022
00023 // This file will be processed by the MIDL tool to
00024 // produce the type library (RDOKB.tlb) and marshalling code.
00025
00026 import "oaidl.idl";
00027 import "ocidl.idl";
00028
00029   [
00030     object,
00031     uuid(DB28BB7E-D3C1-11D0-8233-00AA00A3F13E),
00032     dual,
00033     helpstring("IRDOComponent Interface"),
00034     pointer_default(unique)
00035   ]
00036   interface IRDOComponent : IDispatch
00037   {
00038     [id(1), helpstring("method SimpleQuery")] HRESULT SimpleQuery([in, out] VARIANT * returnval);
00039   };
00040 [
00041   uuid(DB28BB71-D3C1-11D0-8233-00AA00A3F13E),
00042   version(1.0),
00043   helpstring("RDOKB 1.0 Type Library")
00044 ]
00045 library RDOKBLib
00046 {
00047   importlib("stdole32.tlb");
00048   importlib("stdole2.tlb");
00049
00050   [
00051     uuid(DB28BB7F-D3C1-11D0-8233-00AA00A3F13E),
00052     helpstring("RDOComponent Class")
00053   ]
00054   coclass RDOComponent
00055   {
00056     [default] interface IRDOComponent;
00057   };
00058 };
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/tablecopy/wizard.cpp Source File

  • Dataaccess
  • oledb
  • tablecopy

wizard.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB TABLECOPY Sample
00003 // Copyright (C) 1991-2000 Microsoft Corporation
00004 //
00005 // @doc
00006 //
00007 // @module WIZARD.CPP
00008 //
00009 //-----------------------------------------------------------------------------
00010
00011
00012 /////////////////////////////////////////////////////////////////
00013 // Includes
00014 //
00015 /////////////////////////////////////////////////////////////////
00016 #include "common.h"
00017 #include "tablecopy.h"
00018 #include "wizard.h"
00019 #include "progress.h"
00020
00021
00022
00023 /////////////////////////////////////////////////////////////////////
00024 // CDialogBase::CDialogBase
00025 //
00026 /////////////////////////////////////////////////////////////////////
00027 CDialogBase::CDialogBase(HWND hWnd, HINSTANCE hInst)
00028 {
00029   ASSERT(hInst);
00030
00031   m_hWnd  = hWnd;
00032   m_hInst = hInst;
00033 }
00034
00035 /////////////////////////////////////////////////////////////////////
00036 // CDialogBase::~CDialogBase
00037 //
00038 /////////////////////////////////////////////////////////////////////
00039 CDialogBase::~CDialogBase()
00040 {
00041   Destroy();
00042 }
00043
00044
00045 /////////////////////////////////////////////////////////////////////
00046 // ULONG CDialogBase::Destroy
00047 //
00048 /////////////////////////////////////////////////////////////////////
00049 ULONG CDialogBase::Destroy()
00050 {
00051   if(m_hWnd)
00052   {
00053     EndDialog(m_hWnd, 0);
00054     m_hWnd = NULL;
00055   }
00056
00057   return 0;
00058 }
00059
00060
00061 ////////////////////////////////////////////////////////////////
00062 // CWizard::CWizard
00063 //
00064 /////////////////////////////////////////////////////////////////
00065 CWizard::CWizard(HWND hWnd, HINSTANCE hInst)
00066   : CDialogBase(hWnd, hInst)
00067 {
00068   m_pCTableCopy = new CTableCopy(this);
00069   m_pCProgress = new CProgress(hWnd, hInst);
00070
00071   m_iPrevStep = WIZ_STEP1;
00072   m_rgDialogSteps[WIZ_STEP1] = new CS1Dialog(hWnd, hInst, m_pCTableCopy);
00073   m_rgDialogSteps[WIZ_STEP2] = new CS2Dialog(hWnd, hInst, m_pCTableCopy);
00074   m_rgDialogSteps[WIZ_STEP3] = new CS3Dialog(hWnd, hInst, m_pCTableCopy);
00075   m_rgDialogSteps[WIZ_STEP4] = new CS4Dialog(hWnd, hInst, m_pCTableCopy);
00076   m_rgDialogSteps[WIZ_TYPES] = new CTypesDialog(hWnd, hInst, m_pCTableCopy);
00077 }
00078
00079
00080 ////////////////////////////////////////////////////////////////
00081 // CWizard::~CWizard
00082 //
00083 /////////////////////////////////////////////////////////////////
00084 CWizard::~CWizard()
00085 {
00086   delete m_pCTableCopy;
00087   delete m_pCProgress;
00088
00089   delete m_rgDialogSteps[WIZ_STEP1];
00090   delete m_rgDialogSteps[WIZ_STEP2];
00091   delete m_rgDialogSteps[WIZ_STEP3];
00092   delete m_rgDialogSteps[WIZ_STEP4];
00093   delete m_rgDialogSteps[WIZ_TYPES];
00094 }
00095
00096
00097 ////////////////////////////////////////////////////////////////
00098 // CWizard::Display
00099 //
00100 /////////////////////////////////////////////////////////////////
00101 ULONG CWizard::Display()
00102 {
00103   return DisplayStep(WIZ_STEP1);
00104 }
00105
00106
00107 ////////////////////////////////////////////////////////////////
00108 // ULONG CWizard::DisplayStep
00109 //
00110 /////////////////////////////////////////////////////////////////
00111 ULONG CWizard::DisplayStep(ULONG iStep)
00112 {
00113   ASSERT(iStep >= WIZ_STEP1 && iStep < END_WIZ);
00114   return m_rgDialogSteps[iStep]->Display();
00115 }
00116
00117
00118 ////////////////////////////////////////////////////////////////
00119 // ULONG CWizard::DestroyPrevStep
00120 //
00121 /////////////////////////////////////////////////////////////////
00122 ULONG CWizard::DestroyPrevStep(ULONG iCurStep)
00123 {
00124   if(iCurStep != m_iPrevStep)
00125     m_rgDialogSteps[m_iPrevStep]->Destroy();
00126   m_iPrevStep = iCurStep;
00127   return 0;
00128 }
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_Query Member List

This is the complete list of members for _Query, including all inherited members.
InfoClass | _Query
QueryName | _Query
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step1/dlldata.c Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step1

dlldata.c

Go to the documentation of this file.
00001 /*********************************************************
00002    DllData file -- generated by MIDL compiler
00003
00004         DO NOT ALTER THIS FILE
00005
00006    This file is regenerated by MIDL on every IDL file compile.
00007
00008    To completely reconstruct this file, delete it and rerun MIDL
00009    on all the IDL files in this DLL, specifying this file for the
00010    /dlldata command line option
00011
00012 *********************************************************/
00013
00014 #define PROXY_DELEGATION
00015
00016 #include <rpcproxy.h>
00017
00018 #ifdef __cplusplus
00019 extern "C"   {
00020 #endif
00021
00022 EXTERN_PROXY_FILE( ADsFirstExt )
00023
00024
00025 PROXYFILE_LIST_START
00026 /* Start of list */
00027   REFERENCE_PROXY_FILE( ADsFirstExt ),
00028 /* End of list */
00029 PROXYFILE_LIST_END
00030
00031
00032 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00033
00034 #ifdef __cplusplus
00035 }  /*extern "C" */
00036 #endif
00037
00038 /* end of generated dlldata file */
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/AdvReco/ChildWnds.cpp Source File

  • TabletPC
  • AdvReco

ChildWnds.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 // Module:
00012 //      ChildWnds.cpp
00013 //
00014 // Description:
00015 //      The file contains the definitions of the methods of the classes
00016 //    CInkInputWnd and CRecoOutputWnd.
00017 //    See the file ChildWnds.h for the definitions of the classes.
00018 //--------------------------------------------------------------------------
00019
00020 #ifndef _WIN32_WINNT
00021 #define _WIN32_WINNT 0x0500
00022 #endif
00023
00024 // Windows header file
00025 #include <windows.h>
00026
00027 // ATL header files:
00028 #include <atlbase.h>        // defines CComModule, CComPtr, CComVariant
00029 extern CComModule _Module;
00030 #include <atlwin.h>         // defines CWindowImpl
00031
00032 // Tablet PC Automation interfaces header file
00033 #include <msinkaut.h>
00034
00035 // The application header files
00036 #include "resource.h"       // main symbols, including command ID's
00037 #include "ChildWnds.h"    // contains the CInkInputWnd and CRecoOutputWnd definitions
00038
00039 #define CLR_BLUE    RGB(0x00,0x00,0x80)
00040 #define CLR_GRAY    RGB(0x80,0x80,0x80)
00041
00042 ////////////////////////////////////////////////////////
00043 // CInkInputWnd methods
00044 ////////////////////////////////////////////////////////
00045
00046 /////////////////////////////////////////////////////////
00047 //
00048 // CInkInputWnd::CInkInputWnd
00049 //
00050 // Constructor.
00051 //
00052 // Parameters:
00053 //    none
00054 //
00055 /////////////////////////////////////////////////////////
00056 CInkInputWnd::CInkInputWnd() : m_cRows(0), m_cColumns(0), m_iMidline(-1)
00057 {
00058     m_ptGridLT.x = m_ptGridLT.y = 0;
00059     m_szWritingBox.cx = m_szWritingBox.cy = 0;
00060     ::SetRectEmpty(&m_rcDrawnBox);
00061 }
00062
00063 /////////////////////////////////////////////////////////
00064 //
00065 // CInkInputWnd::SetGuide
00066 //
00067 // Data members access method for setting the guide
00068 // drawing parameters.
00069 //
00070 // Parameters:
00071 //    _InkRecoGuide& irg  : see the Tablet PC Automation API
00072 //                            reference for the description
00073 //                            of the structure
00074 //
00075 // Return Values (void):
00076 //      none
00077 //
00078 /////////////////////////////////////////////////////////
00079 void CInkInputWnd::SetGuide(const _InkRecoGuide& irg)
00080 {
00081     // Initialize the data members with values from the recognition guide structure
00082     m_ptGridLT.x = irg.rectWritingBox.left;
00083     m_ptGridLT.y = irg.rectWritingBox.top;
00084     m_szWritingBox.cx = irg.rectWritingBox.right - irg.rectWritingBox.left;
00085     m_szWritingBox.cy = irg.rectWritingBox.bottom - irg.rectWritingBox.top;
00086     m_rcDrawnBox = irg.rectDrawnBox;
00087     m_iMidline = irg.midline;
00088     m_cRows = irg.cRows;
00089     m_cColumns = irg.cColumns;
00090
00091     // Update the window
00092     if (IsWindow())
00093     {
00094         Invalidate();
00095     }
00096 }
00097
00098 /////////////////////////////////////////////////////////
00099 //
00100 // CInkInputWnd::SetGuide
00101 //
00102 // Data members access method for setting the number
00103 // of the guide's rows and columns.
00104 //
00105 // Parameters:
00106 //    int iRows       : the number of rows
00107 //    int iColumns    : the number of columns
00108 //
00109 // Return Values (void):
00110 //      none
00111 //
00112 /////////////////////////////////////////////////////////
00113 void CInkInputWnd::SetRowsCols(int iRows, int iColumns)
00114 {
00115     m_cRows = iRows;
00116     m_cColumns = iColumns;
00117
00118     // Update the window
00119     if (IsWindow())
00120     {
00121         Invalidate();
00122     }
00123 }
00124
00125 /////////////////////////////////////////////////////////
00126 //
00127 // CInkInputWnd::OnPaint
00128 //
00129 // The WM_PAINT message handler. The ATL calls this member
00130 // function when Windows or an application makes a request
00131 // to repaint a portion of the CInkInputWnd object's window.
00132 // The method paints the window's background and draws
00133 // the guide if necessary.
00134 //
00135 // Parameters:
00136 //      defined in the ATL's MESSAGE_HANDLER macro,
00137 //    none is used here
00138 //
00139 // Return Value (LRESULT):
00140 //    always 0
00141 //
00142 /////////////////////////////////////////////////////////
00143 LRESULT CInkInputWnd::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/,
00144                 LPARAM /*lParam*/, BOOL& /*bHandled*/)
00145 {
00146     RECT rcClip;
00147     if (FALSE == GetUpdateRect(&rcClip))
00148         return 0;   // there's no update region, so no painting is needed
00149
00150     PAINTSTRUCT ps;
00151     HDC hdc = BeginPaint(&ps);
00152     if (hdc == NULL)
00153         return 0;
00154
00155     // Get the rectangle to paint.
00156     GetClipBox(hdc, &rcClip);
00157
00158     // Paint the background.
00159     ::FillRect(hdc, &rcClip, (HBRUSH)::GetStockObject(DC_BRUSH));
00160
00161     // Calculate the grid rectangle. Assume that if there are any guides,
00162     // they are either boxes or horizontal lines.
00163     RECT rcGrid = {m_ptGridLT.x, m_ptGridLT.y, 0,
00164                    m_ptGridLT.y + m_szWritingBox.cy * m_cRows};
00165     if (0 == m_cColumns && 0 != m_cRows)
00166     {
00167         rcGrid.right = rcClip.right;
00168     }
00169     else
00170     {
00171         rcGrid.right = m_ptGridLT.x + m_szWritingBox.cx * m_cColumns;
00172     }
00173
00174     // Draw the guide grid, if it's visible and not empty.
00175     RECT rcVisible;
00176     if (FALSE == ::IsRectEmpty(&rcGrid)
00177          && TRUE == ::IntersectRect(&rcVisible, &rcGrid, &rcClip))
00178     {
00179
00180         // Create a thin lightgray pen to draw the guides.
00181         HPEN hPen = ::CreatePen(PS_SOLID, 1, RGB(192, 192, 192));
00182         HGDIOBJ hOldPen = ::SelectObject(hdc, hPen);
00183
00184         if (0 == m_cColumns)
00185         {
00186              // Draw horizontal lines at the bottom side of the guide's DrawnBox
00187             int iY = rcClip.top - ((rcClip.top - m_ptGridLT.y) % m_szWritingBox.cy) + m_rcDrawnBox.bottom;
00188             for (int iRow = (rcClip.top - m_ptGridLT.y) / m_szWritingBox.cy;
00189                  (iRow < m_cRows) && (iY < rcClip.bottom);
00190                  iRow++, iY += m_szWritingBox.cy)
00191             {
00192                 ::MoveToEx(hdc, rcClip.left, iY, NULL);
00193                 ::LineTo(hdc, rcClip.right, iY);
00194             }
00195         }
00196         else
00197         {
00198             // Draw boxes
00199             int iY = rcClip.top - ((rcClip.top - m_ptGridLT.y) % m_szWritingBox.cy);
00200             for (int iRow = (rcClip.top - m_ptGridLT.y) / m_szWritingBox.cy;
00201                  (iRow < m_cRows) && (iY < rcClip.bottom);
00202                  iRow++, iY += m_szWritingBox.cy)
00203             {
00204                 int iX = rcClip.left - ((rcClip.left - m_ptGridLT.x) % m_szWritingBox.cx);
00205                 RECT rcBox = m_rcDrawnBox;
00206                 ::OffsetRect(&rcBox, iX, iY);
00207                 for (int iCol = (rcClip.left - m_ptGridLT.x) / m_szWritingBox.cx;
00208                      (iCol < m_cColumns) && (rcBox.left < rcClip.right);
00209                      iCol++)
00210                 {
00211                     ::Rectangle(hdc, rcBox.left, rcBox.top, rcBox.right, rcBox.bottom);
00212                     ::OffsetRect(&rcBox, m_szWritingBox.cx, 0);
00213                 }
00214             }
00215         }
00216
00217         // Restore the dc and delete the pen
00218         ::SelectObject(hdc, hOldPen);
00219         ::DeleteObject(hPen);
00220     }
00221
00222     EndPaint(&ps);
00223     return 0;
00224 }
00225
00226
00227 ////////////////////////////////////////////////////////
00228 // CRecoOutputWnd methods
00229 ////////////////////////////////////////////////////////
00230
00231 /////////////////////////////////////////////////////////
00232 //
00233 // CRecoOutputWnd::CRecoOutputWnd
00234 //
00235 // Constructor.
00236 //
00237 // Parameters:
00238 //    none
00239 //
00240 /////////////////////////////////////////////////////////
00241 CRecoOutputWnd::CRecoOutputWnd()
00242         : m_hFont(NULL), m_iFontName(-1), m_nGesture(0), m_bNewGesture(false)
00243 {
00244     UpdateFont(::GetUserDefaultLangID());
00245 }
00246
00247 /////////////////////////////////////////////////////////
00248 //
00249 // CRecoOutputWnd::~CRecoOutputWnd
00250 //
00251 // Destructor.
00252 //
00253 /////////////////////////////////////////////////////////
00254 CRecoOutputWnd::~CRecoOutputWnd()
00255 {
00256     if (NULL != m_hFont)
00257     {
00258         ::DeleteObject(m_hFont);
00259     }
00260 }
00261
00262 // Message handlers
00263
00264 /////////////////////////////////////////////////////////
00265 //
00266 // CRecoOutputWnd::OnPaint
00267 //
00268 // The WM_PAINT message handler. The ATL calls this member
00269 // function when Windows or an application makes a request
00270 // to repaint a portion of the CRecoOutputWnd object's window.
00271 //
00272 // Parameters:
00273 //      defined in the ATL's MESSAGE_HANDLER macro,
00274 //    none is used here
00275 //
00276 // Return Value (void):
00277 //    none
00278 //
00279 /////////////////////////////////////////////////////////
00280 LRESULT CRecoOutputWnd::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/,
00281                 LPARAM /*lParam*/, BOOL& /*bHandled*/)
00282 {
00283     RECT rc;
00284     if (FALSE == GetUpdateRect(&rc))
00285         return 0;   // there's no update region, so no painting is needed
00286
00287     PAINTSTRUCT ps;
00288     HDC hdc = BeginPaint(&ps);
00289     if (hdc == NULL)
00290         return 0;
00291
00292     GetClientRect(&rc);
00293
00294     // Paint the background
00295     ::FillRect(hdc, &rc, (HBRUSH)::GetStockObject(WHITE_BRUSH));
00296
00297     // Use blue color to draw the latest results, and gray for the old ones
00298     COLORREF clrGesture, clrText;
00299     if (true == m_bNewGesture)
00300     {
00301         clrGesture = CLR_BLUE;
00302         clrText = CLR_GRAY;
00303     }
00304     else
00305     {
00306         clrGesture = CLR_GRAY;
00307         clrText = CLR_BLUE;
00308     }
00309
00310     COLORREF clrOld = ::SetTextColor(hdc, clrGesture);
00311
00312     // Output the name of the last gesture
00313     if (0 != m_nGesture)
00314     {
00315         TCHAR buffer[100];
00316         if (::LoadString(_Module.GetResourceInstance(),
00317                          m_nGesture, buffer, sizeof(buffer)) != 0)
00318         {
00319             ::TextOut(hdc, mc_iMarginX, mc_iMarginY, buffer, _tcslen(buffer));
00320         }
00321     }
00322
00323     // Output the handwriting recognition results
00324     HGDIOBJ hOldFont;
00325     if (NULL != m_hFont)
00326     {
00327         hOldFont = ::SelectObject(hdc, m_hFont);
00328     }
00329     ::SetTextColor(hdc, clrText);
00330     for (int i = 0; i < mc_iNumResults; i++)
00331     {
00332         int iLength = m_bstrResults[i].Length();
00333         if (iLength)
00334         {
00335             ::TextOutW(hdc, mc_iMarginX, mc_iMarginY + (i + 1) * mc_iFontHeight,
00336                        m_bstrResults[i], iLength);
00337         }
00338     }
00339
00340     // Restore the dc
00341     ::SetTextColor(hdc, clrOld);
00342     if (NULL != m_hFont)
00343     {
00344         ::SelectObject(hdc, hOldFont);
00345     }
00346
00347     EndPaint(&ps);
00348     return 0;
00349 }
00350
00351 // Helper methods
00352
00353 /////////////////////////////////////////////////////////
00354 //
00355 // CRecoOutputWnd::ResetResults
00356 //
00357 // Empties the output strings.
00358 //
00359 // Parameters:
00360 //      none
00361 //
00362 // Return Value (void):
00363 //    none
00364 //
00365 /////////////////////////////////////////////////////////
00366 void CRecoOutputWnd::ResetResults()
00367 {
00368     m_bNewGesture = false;
00369     m_nGesture = 0;
00370     for (int i = 0; i < mc_iNumResults; i++)
00371         m_bstrResults[i].Empty();
00372 }
00373
00374 /////////////////////////////////////////////////////////
00375 //
00376 // CRecoOutputWnd::GetBestHeight
00377 //
00378 //      Returns a height of the window the best to show all
00379 //      the strings (the mc_iNumResults result strings and
00380 //      the name of the last geesture).
00381 //
00382 //      This method is called by CAdvRecoApp object when it updates
00383 //      the layouts of its child windows.
00384 //
00385 /////////////////////////////////////////////////////////
00386 int CRecoOutputWnd::GetBestHeight()
00387 {
00388     return (mc_iMarginX * 2 + mc_iFontHeight * (mc_iNumResults + 1));
00389 }
00390
00391 /////////////////////////////////////////////////////////
00392 //
00393 // CRecoOutputWnd::UpdateFont
00394 //
00395 //      The method creates an appropriate font for text output
00396 //      based on the language id. It's called by the application
00397 //      when user selects a recognizer.
00398 //
00399 // Parameters:
00400 //      LANGID wLangId      : [in] the id of the language of the text
00401 //
00402 // Return Value (bool):
00403 //    true, if succeded to create a font appropriate for the language
00404 //      false otherwise
00405 //
00406 /////////////////////////////////////////////////////////
00407 bool CRecoOutputWnd::UpdateFont(LANGID wLangId)
00408 {
00409     static LPCTSTR pszFontNames[] = { TEXT("MS Shell Dlg"), TEXT("MS Mincho"),
00410                                       TEXT("Mingliu"), TEXT("Gullim") };
00411     bool bOk = true;
00412     int i;
00413     DWORD dwCharSet;
00414     // Select a font by the primary language id (the lower byte)
00415     switch(wLangId & 0xFF)
00416     {
00417         default:
00418             i = 0;
00419             dwCharSet = DEFAULT_CHARSET;
00420             break;
00421
00422         case LANG_JAPANESE:
00423             i = 1;
00424             dwCharSet = SHIFTJIS_CHARSET;
00425             break;
00426
00427         case LANG_CHINESE:
00428             i = 2;
00429             dwCharSet = CHINESEBIG5_CHARSET;
00430             break;
00431
00432         case LANG_KOREAN:
00433             i = 3;
00434             dwCharSet = JOHAB_CHARSET;
00435             break;
00436     }
00437     if (i != m_iFontName)
00438     {
00439         HFONT hFont = ::CreateFont(mc_iFontHeight, 0, 0, 0, 0, 0, 0, 0,
00440                                    dwCharSet,
00441                                    0, 0, 0, 0,
00442                                    pszFontNames[i] // typeface name
00443                                    );
00444         if (NULL != hFont)
00445         {
00446             if (NULL != m_hFont)
00447                 ::DeleteObject(m_hFont);
00448             m_hFont = hFont;
00449             m_iFontName = i;
00450         }
00451         else
00452         {
00453             bOk = false;
00454         }
00455     }
00456
00457     return bOk;
00458 }
00459
00460
00461 /////////////////////////////////////////////////////////
00462 //
00463 // CRecoOutputWnd::SetGesture
00464 //
00465 //      The method is called by the application from OnGesture
00466 //      event handler. It accepts the id if the recognized gesture
00467 //      and converts it to a string for output.
00468 //
00469 // Parameters:
00470 //      InkGestureType idGesture : [in] the id of the language of the text
00471 //
00472 // Return Value (bool):
00473 //    true - the name of the gesture is known to this application
00474 //      false - otherwise
00475 //
00476 /////////////////////////////////////////////////////////
00477 void CRecoOutputWnd::SetGestureName(UINT nGesture)
00478 {
00479     m_nGesture = nGesture;
00480     m_bNewGesture = true;
00481 }
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/registry.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091         _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124         _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,         // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154         MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpy/StdAfx.h Source File

  • Com
  • Administration
  • Spy
  • ComSpy

StdAfx.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #if !defined(AFX_STDAFX_H__CBFE257B_B030_11D0_B188_00AA00BA3258__INCLUDED_)
00018 #define AFX_STDAFX_H__CBFE257B_B030_11D0_B188_00AA00BA3258__INCLUDED_
00019
00020 #if _MSC_VER >= 1000
00021 // stdafx.h : include file for standard system include files,
00022 //      or project specific include files that are used frequently,
00023 //      but are changed infrequently
00024 #define STRICT
00025
00026
00027 #if !defined(_WIN32_WINNT)
00028 #define _WIN32_WINNT 0x0500
00029 #endif // !defined(_WIN32_WINNT)
00030
00031 #define _ATL_APARTMENT_THREADED
00032
00033
00034 #include <atlbase.h>
00035 //You may derive a class from CComModule and use it if you want to override
00036 //something, but do not change the name of _Module
00037 class CExeModule : public CComModule
00038 {
00039 public:
00040   LONG Unlock();
00041   DWORD dwThreadID;
00042 };
00043 extern CExeModule _Module;
00044 #include <atlcom.h>
00045 #include <atlctl.h>
00046 #include <atlwin.h>
00047 #define SafeRelease(pUnk) {if (pUnk){pUnk -> Release();pUnk = NULL; }}
00048
00049 #endif // _MSC_VER >= 1000
00050 //{{AFX_INSERT_LOCATION}}
00051 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00052
00053 #endif // !defined(AFX_STDAFX_H__CBFE257B_B030_11D0_B188_00AA00BA3258__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/Help source/mmcsample.h Source File

  • SysMgmt
  • MMC
  • Toolbar
  • Help source

mmcsample.h

Go to the documentation of this file.
00001 //
00002 // MMCSample.h
00003 //
00004 //   Contains header information for HTML API calls
00005 //  so that our sample MMC snap-ins can find help information
00006 //
00007 #define HELP_STEPONE    101
00008 #define HELP_STEPTWO    102
00009 #define HELP_STEPTHREE  103
00010 #define HELP_STEPFOUR   104
00011
00012 #define HELP_DEFAULT    0
00013 #define HELP_INTRO      1
00014
00015
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/PropList.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

PropList.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      PropList.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the CClusPropList class.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 /////////////////////////////////////////////////////////////////////////////
00019
00020
00021 #include "stdafx.h"
00022 #include "PropList.h"
00023 #include <StrSafe.h>
00024
00025 #ifdef _DEBUG
00026 #ifdef __AFX_H__
00027 #define new DEBUG_NEW
00028 #undef THIS_FILE
00029 static char THIS_FILE[] = __FILE__;
00030 #endif // __AFX_H__
00031 #endif
00032
00033 #ifndef __AFX_H__
00034 class CMemoryException
00035 {
00036 public:
00037     void Delete( void ) { }
00038
00039 }; //*** class CMemoryException
00040 #endif // __AFX_H__
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // Constant Definitions
00044 /////////////////////////////////////////////////////////////////////////////
00045
00046 const int BUFFER_GROWTH_FACTOR = 256;
00047
00048 //////////////////////////////////////////////////////////////////////////////
00049 // Globals
00050 //////////////////////////////////////////////////////////////////////////////
00051
00052
00053 //////////////////////////////////////////////////////////////////////////////
00054 // String comparison routines
00055 //////////////////////////////////////////////////////////////////////////////
00056
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 //++
00060 //
00061 //  WrapCompareString
00062 //
00063 //  Description:
00064 //      Wraps the call to CompareString
00065 //
00066 //  Arguments:
00067 //      fCaseSensitive      TRUE for a case sensitive compare
00068 //                          FALSE for a case insensitive compare
00069 //      pcwszString1In      The first string.
00070 //      cch1In              The count of characters in the first string.
00071 //                          If -1 then it's assumed to be null-terminated.
00072 //      pcwszString2In      The second string.
00073 //      cchIn               The count of characters in the second string.
00074 //                          If -1 then it's assumed to be null-terminated.
00075 //
00076 //  Return Value:
00077 //       0  Strings are equal.
00078 //     > 0  String1 greater than String2.
00079 //     < 0  String1 less than String2.
00080 //
00081 //--
00082 /////////////////////////////////////////////////////////////////////////////
00083 int
00084 WrapCompareString(
00085       BOOL      fCaseSensitive
00086     , LPCWSTR   pcwszString1In
00087     , size_t    cch1In
00088     , LPCWSTR   pcwszString2In
00089     , size_t    cch2In
00090     )
00091 {
00092     int nRet;
00093
00094     nRet = CompareStringW(
00095               LOCALE_SYSTEM_DEFAULT
00096             , fCaseSensitive ? 0 : NORM_IGNORECASE
00097             , pcwszString1In
00098             , static_cast< DWORD >( cch1In )
00099             , pcwszString2In
00100             , static_cast< DWORD >( cch2In )
00101             );
00102
00103     return nRet - CSTR_EQUAL; // CSTR_LT < CSTR_EQUAL < CSTR_GT
00104
00105 } // *** WrapCompareString
00106
00107 //
00108 // Full string compares.
00109 //
00110
00111 int
00112 IBSTRCompareW(
00113       BSTR  bstrString1In
00114     , BSTR  bstrString2In
00115     )
00116 {
00117     return WrapCompareString(
00118                   FALSE
00119                 , static_cast< LPCWSTR >( bstrString1In )
00120                 , SysStringLen( bstrString1In )
00121                 , static_cast< LPCWSTR >( bstrString2In )
00122                 , SysStringLen( bstrString2In )
00123                 );
00124 } //*** IBSTRCompareW
00125
00126 int
00127 BSTRCompareW(
00128       BSTR  bstrString1In
00129     , BSTR  bstrString2In
00130     )
00131 {
00132     return WrapCompareString(
00133                   TRUE
00134                 , static_cast< LPCWSTR >( bstrString1In )
00135                 , SysStringLen( bstrString1In )
00136                 , static_cast< LPCWSTR >( bstrString2In )
00137                 , SysStringLen( bstrString2In )
00138                 );
00139 } //*** BSTRCompareW
00140
00141 int
00142 IStringCompareW(
00143       LPCWSTR pcwszString1In
00144     , LPCWSTR pcwszString2In
00145     )
00146 {
00147     return WrapCompareString(
00148                   FALSE
00149                 , pcwszString1In
00150                 , static_cast< size_t >( -1 )
00151                 , pcwszString2In
00152                 , static_cast< size_t >( -1 )
00153             );
00154 } //*** IStringCompareW
00155
00156 int
00157 StringCompareW(
00158       LPCWSTR pcwszString1In
00159     , LPCWSTR pcwszString2In
00160     )
00161 {
00162     return WrapCompareString(
00163                   TRUE
00164                 , pcwszString1In
00165                 , static_cast< size_t >( -1 )
00166                 , pcwszString2In
00167                 , static_cast< size_t >( -1 )
00168                 );
00169 } //*** StringCompareW
00170
00171 int
00172 IStringCompareW(
00173       LPCWSTR   pcwszString1In
00174     , size_t    cch1In
00175     , LPCWSTR   pcwszString2In
00176     , size_t    cch2In
00177     )
00178 {
00179     return WrapCompareString(
00180                   FALSE
00181                 , pcwszString1In
00182                 , cch1In
00183                 , pcwszString2In
00184                 , cch2In
00185                 );
00186 } //*** IStringCompareW
00187
00188 int
00189 StringCompareW(
00190       LPCWSTR   pcwszString1In
00191     , size_t    cch1In
00192     , LPCWSTR   pcwszString2In
00193     , size_t    cch2In
00194     )
00195 {
00196     return WrapCompareString(
00197                   TRUE
00198                 , pcwszString1In
00199                 , cch1In
00200                 , pcwszString2In
00201                 , cch2In
00202                 );
00203 } //*** StringCompareW
00204
00205 //
00206 // Partial string compares.  They use whichever one's length is shortest
00207 // if both are specified or the NBSTR routines are used.
00208 //
00209
00210 int
00211 NIBSTRCompareW(
00212       BSTR  bstrString1In
00213     , BSTR  bstrString2In
00214     )
00215 {
00216     size_t cchMin;
00217
00218     cchMin = min( SysStringLen( bstrString1In ), SysStringLen( bstrString2In ) );
00219
00220     return WrapCompareString(
00221                   FALSE
00222                 , static_cast< LPCWSTR >( bstrString1In )
00223                 , cchMin
00224                 , static_cast< LPCWSTR >( bstrString2In )
00225                 , cchMin
00226                 );
00227 } //*** NIBSTRCompareW
00228
00229 int
00230 NBSTRCompareW(
00231       BSTR  bstrString1In
00232     , BSTR  bstrString2In
00233     )
00234 {
00235     size_t cchMin;
00236
00237     cchMin = min( SysStringLen( bstrString1In ), SysStringLen( bstrString2In ) );
00238
00239     return WrapCompareString(
00240                   TRUE
00241                 , static_cast< LPCWSTR >( bstrString1In )
00242                 , cchMin
00243                 , static_cast< LPCWSTR >( bstrString2In )
00244                 , cchMin
00245                 );
00246 } //*** NBSTRCompareW
00247
00248 int
00249 NIStringCompareW(
00250       LPCWSTR   pcwszString1In
00251     , LPCWSTR   pcwszString2In
00252     , size_t    cchIn
00253     )
00254 {
00255     return WrapCompareString(
00256                   FALSE
00257                 , pcwszString1In
00258                 , cchIn
00259                 , pcwszString2In
00260                 , cchIn
00261                 );
00262 } //*** NIStringCompareW
00263
00264 int
00265 NStringCompareW(
00266       LPCWSTR   pcwszString1In
00267     , LPCWSTR   pcwszString2In
00268     , size_t    cchIn
00269     )
00270 {
00271     return WrapCompareString(
00272                   TRUE
00273                 , pcwszString1In
00274                 , cchIn
00275                 , pcwszString2In
00276                 , cchIn
00277                 );
00278 } //*** NIStringCompareW
00279
00280 int
00281 NIStringCompareW(
00282       LPCWSTR   pcwszString1In
00283     , size_t    cch1In
00284     , LPCWSTR   pcwszString2In
00285     , size_t    cch2In
00286     )
00287 {
00288     return WrapCompareString(
00289                   FALSE
00290                 , pcwszString1In
00291                 , min( cch1In, cch2In )
00292                 , pcwszString2In
00293                 , min( cch1In, cch2In )
00294                 );
00295 } //*** NIStringCompareW
00296
00297 int
00298 NStringCompareW(
00299       LPCWSTR   pcwszString1In
00300     , size_t    cch1In
00301     , LPCWSTR   pcwszString2In
00302     , size_t    cch2In
00303     )
00304 {
00305     return WrapCompareString(
00306                   TRUE
00307                 , pcwszString1In
00308                 , min( cch1In, cch2In )
00309                 , pcwszString2In
00310                 , min( cch1In, cch2In )
00311                 );
00312 } //*** NStringCompareW
00313
00314 /////////////////////////////////////////////////////////////////////////////
00315 //++
00316 //
00317 //  CchMultiSz
00318 //
00319 //  Description:
00320 //      Length of all of the substrings of a multisz string minus the final NULL.
00321 //
00322 //      (i.e., includes the nulls of the substrings, excludes the final null)
00323 //      multiszlen( "abcd\0efgh\0\0" => 5 + 5 = 10
00324 //
00325 //  Arguments:
00326 //      pszIn     The string to get the length of.
00327 //
00328 //  Return Value:
00329 //      Count of characters in the multisz or 0 if empty.
00330 //
00331 //--
00332 /////////////////////////////////////////////////////////////////////////////
00333 static size_t
00334 CchMultiSz(
00335     LPCWSTR pszIn
00336     )
00337 {
00338     ASSERT( pszIn != NULL );
00339
00340     size_t  cchTotal = 0;
00341     size_t  cchChars = 0;
00342
00343     while ( *pszIn != L'\0' )
00344     {
00345         cchChars = lstrlenW( pszIn ) + 1;
00346
00347         cchTotal += cchChars;
00348         pszIn += cchChars;
00349     } // while: pointer not stopped on EOS
00350
00351     return cchTotal;
00352
00353 } //*** CchMultiSz
00354
00355 /////////////////////////////////////////////////////////////////////////////
00356 //++
00357 //
00358 //  NCompareMultiSz
00359 //
00360 //  Description:
00361 //      Compare two MULTI_SZ buffers.
00362 //
00363 //  Arguments:
00364 //      pszSourceIn   The source string.
00365 //      pszTargetIn   The target string.
00366 //
00367 //  Return Value:
00368 //      If the string pointed to by pszSource is less than the string pointed
00369 //      to by pszTarget, the return value is negative. If the string pointed
00370 //      to by pszSource is greater than the string pointed to by pszTarget,
00371 //      the return value is positive. If the strings are equal, the return value
00372 //      is zero.
00373 //
00374 //--
00375 /////////////////////////////////////////////////////////////////////////////
00376 static int NCompareMultiSz(
00377       LPCWSTR pszSourceIn
00378     , LPCWSTR pszTargetIn
00379     )
00380 {
00381     ASSERT( pszSourceIn != NULL );
00382     ASSERT( pszTargetIn != NULL );
00383
00384     while ( ( *pszSourceIn != L'\0' ) && ( *pszTargetIn != L'\0') )
00385     {
00386         //
00387         // Move to end of strings.
00388         //
00389
00390         while ( ( *pszSourceIn != L'\0' ) && ( *pszTargetIn != L'\0') && ( *pszSourceIn == *pszTargetIn ) )
00391         {
00392             ++pszSourceIn;
00393             ++pszTargetIn;
00394         } // while: pointer not stopped on EOS
00395
00396         //
00397         // If strings are the same, skip past terminating NUL.
00398         // Otherwise exit the loop.
00399
00400         if ( ( *pszSourceIn == L'\0' ) && ( *pszTargetIn == L'\0') )
00401         {
00402             ++pszSourceIn;
00403             ++pszTargetIn;
00404         } // if: both stopped on EOS
00405         else
00406         {
00407             break;
00408         } // else: stopped because something is not equal -- we are done.
00409
00410     } // while: pointer not stopped on EOS
00411
00412     return *pszSourceIn - *pszTargetIn;
00413
00414 } //*** NCompareMultiSz
00415
00416 /////////////////////////////////////////////////////////////////////////////
00417 // CClusPropValueList class
00418 /////////////////////////////////////////////////////////////////////////////
00419
00420 #ifdef __AFX_H__
00421 IMPLEMENT_DYNAMIC( CClusPropValueList, CObject );
00422 #endif // __AFX_H__
00423
00424 /////////////////////////////////////////////////////////////////////////////
00425 //++
00426 //
00427 //  CClusPropValueList::ScMoveToFirstValue
00428 //
00429 //  Description:
00430 //      Move the cursor to the first value in the value list.
00431 //
00432 //  Arguments:
00433 //      None.
00434 //
00435 //  Return Value:
00436 //      ERROR_SUCCESS   Position moved to the first value successfully.
00437 //
00438 //--
00439 /////////////////////////////////////////////////////////////////////////////
00440 DWORD
00441 CClusPropValueList::ScMoveToFirstValue( void )
00442 {
00443     ASSERT( m_cbhValueList.pb != NULL );
00444
00445     DWORD   sc;
00446
00447     m_cbhCurrentValue = m_cbhValueList;
00448     m_cbDataLeft = m_cbDataSize;
00449     m_fAtEnd = FALSE;
00450
00451     if ( m_cbhCurrentValue.pSyntax->dw == CLUSPROP_SYNTAX_ENDMARK )
00452     {
00453         sc = ERROR_NO_MORE_ITEMS;
00454     } // if: no items in the value list
00455     else
00456     {
00457         sc = ERROR_SUCCESS;
00458     } // else: items exist in the value list
00459
00460     return sc;
00461
00462 } //*** CClusPropValueList::ScMoveToFirstValue
00463
00464 /////////////////////////////////////////////////////////////////////////////
00465 //++
00466 //
00467 //  CClusPropValueList::ScMoveToNextValue
00468 //
00469 //  Description:
00470 //      Move the cursor to the next value in the list.
00471 //
00472 //  Arguments:
00473 //      None.
00474 //
00475 //  Return Value:
00476 //      ERROR_SUCCESS       Position moved to the next value successfully.
00477 //      ERROR_NO_MORE_ITEMS Already at the end of the list.
00478 //      ERROR_INVALID_DATA  Not enough data in the buffer.
00479 //
00480 //--
00481 /////////////////////////////////////////////////////////////////////////////
00482 DWORD
00483 CClusPropValueList::ScMoveToNextValue( void )
00484 {
00485     ASSERT( m_cbhCurrentValue.pb != NULL );
00486
00487     DWORD                   sc     = ERROR_NO_MORE_ITEMS;
00488     size_t                  cbDataSize;
00489     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
00490
00491     cbhCurrentValue = m_cbhCurrentValue;
00492
00493     //
00494     // Don't try to move if we're already at the end.
00495     //
00496
00497     if ( m_fAtEnd )
00498     {
00499         goto Cleanup;
00500     } // if: already at the end of the list
00501
00502     //
00503     // Make sure the buffer is big enough for the value header.
00504     //
00505
00506     if ( m_cbDataLeft < sizeof( *cbhCurrentValue.pValue ) )
00507     {
00508         sc = ERROR_INVALID_DATA;
00509         goto Cleanup;
00510     } // if: not enough data left
00511
00512     //
00513     // Calculate how much to advance buffer pointer.
00514     //
00515
00516     cbDataSize = sizeof( *cbhCurrentValue.pValue )
00517                 + ALIGN_CLUSPROP( cbhCurrentValue.pValue->cbLength );
00518
00519     //
00520     // Make sure the buffer is big enough for the value header,
00521     // the data itself, and the endmark.
00522     //
00523
00524     if ( m_cbDataLeft < cbDataSize + sizeof( CLUSPROP_SYNTAX ) )
00525     {
00526         sc = ERROR_INVALID_DATA;
00527         goto Cleanup;
00528     } // if: not enough data left
00529
00530     //
00531     // Move past the current value to the next value's syntax.
00532     //
00533
00534     cbhCurrentValue.pb += cbDataSize;
00535
00536     //
00537     // This test will ensure that the value is always valid since we won't
00538     // advance if the next thing is the endmark.
00539     //
00540
00541     if ( cbhCurrentValue.pSyntax->dw != CLUSPROP_SYNTAX_ENDMARK )
00542     {
00543         m_cbhCurrentValue = cbhCurrentValue;
00544         m_cbDataLeft -= cbDataSize;
00545         sc = ERROR_SUCCESS;
00546     } // if: next value's syntax is not the endmark
00547     else
00548     {
00549         m_fAtEnd = TRUE;
00550     } // else: next value's syntax is the endmark
00551
00552 Cleanup:
00553
00554     return sc;
00555
00556 } //*** CClusPropValueList::ScMoveToNextValue
00557
00558 /////////////////////////////////////////////////////////////////////////////
00559 //++
00560 //
00561 //  CClusPropValueList::ScCheckIfAtLastValue
00562 //
00563 //  Description:
00564 //      Indicate whether we are on the last value in the list or not.
00565 //
00566 //  Arguments:
00567 //      None.
00568 //
00569 //  Return Value:
00570 //      ERROR_SUCCESS       Not currently at the last value in the list.
00571 //      ERROR_NO_MORE_ITEMS Currently at the last value in the list.
00572 //      ERROR_INVALID_DATA  Not enough data in the buffer.
00573 //
00574 //--
00575 /////////////////////////////////////////////////////////////////////////////
00576 DWORD
00577 CClusPropValueList::ScCheckIfAtLastValue( void )
00578 {
00579     ASSERT( m_cbhCurrentValue.pb != NULL );
00580
00581     DWORD                   sc = ERROR_SUCCESS;
00582     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
00583     size_t                  cbDataSize = 0;
00584
00585     cbhCurrentValue = m_cbhCurrentValue;
00586
00587     //
00588     // Don't try to recalculate if we already know
00589     // we're at the end of the list.
00590     //
00591
00592     if ( m_fAtEnd )
00593     {
00594         goto Cleanup;
00595     } // if: already at the end of the list
00596
00597     //
00598     // Make sure the buffer is big enough for the value header.
00599     //
00600
00601     if ( m_cbDataLeft < sizeof( *cbhCurrentValue.pValue ) )
00602     {
00603         sc = ERROR_INVALID_DATA;
00604         goto Cleanup;
00605     } // if: not enough data left
00606
00607     //
00608     // Calculate how much to advance buffer pointer.
00609     //
00610
00611     cbDataSize = sizeof( *cbhCurrentValue.pValue )
00612                 + ALIGN_CLUSPROP( cbhCurrentValue.pValue->cbLength );
00613
00614     //
00615     // Make sure the buffer is big enough for the value header,
00616     // the data itself, and the endmark.
00617     //
00618
00619     if ( m_cbDataLeft < cbDataSize + sizeof( CLUSPROP_SYNTAX ) )
00620     {
00621         sc = ERROR_INVALID_DATA;
00622         goto Cleanup;
00623     } // if: not enough data left
00624
00625     //
00626     // Move past the current value to the next value's syntax.
00627     //
00628
00629     cbhCurrentValue.pb += cbDataSize;
00630
00631     //
00632     // We are on the last value if the next thing after this value
00633     // is an endmark.
00634     //
00635
00636     if ( cbhCurrentValue.pSyntax->dw == CLUSPROP_SYNTAX_ENDMARK )
00637     {
00638         sc = ERROR_NO_MORE_ITEMS;
00639     } // if: next value's syntax is the endmark
00640
00641 Cleanup:
00642
00643     return sc;
00644
00645 } //*** CClusPropValueList::ScCheckIfAtLastValue
00646
00647 /////////////////////////////////////////////////////////////////////////////
00648 //++
00649 //
00650 //  CClusPropValueList::ScAllocValueList
00651 //
00652 //  Description:
00653 //      Allocate a value list buffer that's big enough to hold the next
00654 //      value.
00655 //
00656 //  Arguments:
00657 //      cbMinimumIn   Minimum size of the value list.
00658 //
00659 //  Return Value:
00660 //      None.
00661 //
00662 //--
00663 /////////////////////////////////////////////////////////////////////////////
00664 DWORD
00665 CClusPropValueList::ScAllocValueList(
00666     size_t cbMinimumIn
00667     )
00668 {
00669     ASSERT( cbMinimumIn > 0 );
00670
00671     DWORD   sc = ERROR_SUCCESS;
00672     size_t  cbTotal = 0;
00673
00674     //
00675     // Add the size of the item count and final endmark.
00676     //
00677
00678     cbMinimumIn += sizeof( CLUSPROP_VALUE );
00679     cbTotal = m_cbDataSize + cbMinimumIn;
00680
00681     if ( m_cbBufferSize < cbTotal )
00682     {
00683         PBYTE   _pbNewValuelist = NULL;
00684
00685         cbMinimumIn = max( BUFFER_GROWTH_FACTOR, cbMinimumIn );
00686         cbTotal = m_cbDataSize + cbMinimumIn;
00687
00688         //
00689         // Allocate and zero a new buffer.
00690         //
00691
00692         _pbNewValuelist = new BYTE[ cbTotal ];
00693         if ( _pbNewValuelist != NULL )
00694         {
00695             ZeroMemory( _pbNewValuelist, cbTotal );
00696
00697             //
00698             // If there was a previous buffer, copy it and the delete it.
00699             //
00700
00701             if ( m_cbhValueList.pb != NULL )
00702             {
00703                 if ( m_cbDataSize != 0 )
00704                 {
00705                     CopyMemory( _pbNewValuelist, m_cbhValueList.pb, m_cbDataSize );
00706                 } // if: data already exists in buffer
00707
00708                 delete [] m_cbhValueList.pb;
00709                 m_cbhCurrentValue.pb = _pbNewValuelist + (m_cbhCurrentValue.pb - m_cbhValueList.pb);
00710             } // if: there was a previous buffer
00711             else
00712             {
00713                 m_cbhCurrentValue.pb = _pbNewValuelist + sizeof( DWORD ); // move past prop count
00714             } // else: no previous buffer
00715
00716             //
00717             // Save the new buffer.
00718             //
00719
00720             m_cbhValueList.pb = _pbNewValuelist;
00721             m_cbBufferSize = cbTotal;
00722         } // if: allocation succeeded
00723         else
00724         {
00725             sc = ERROR_NOT_ENOUGH_MEMORY;
00726         } // else: allocation failed
00727     } // if: buffer isn't big enough
00728
00729     return sc;
00730
00731 } //*** CClusPropValueList::ScAllocValueList
00732
00733 /////////////////////////////////////////////////////////////////////////////
00734 //++
00735 //
00736 //  CClusPropValueList::ScGetResourceValueList
00737 //
00738 //  Description:
00739 //      Get value list of a resource.
00740 //
00741 //  Arguments:
00742 //      hResourceIn     Handle for the resource to get properties from.
00743 //      dwControlCodeIn Control code for the request.
00744 //      hHostNodeIn     Handle for the node to direct this request to.
00745 //                      Defaults to NULL.
00746 //      lpBufferIn      Input buffer for the request.  Defaults to NULL.
00747 //      cbBufferIn      Size of the input buffer.  Defaults to 0.
00748 //
00749 //  Return Value:
00750 //      None.
00751 //
00752 //--
00753 /////////////////////////////////////////////////////////////////////////////
00754 DWORD
00755 CClusPropValueList::ScGetResourceValueList(
00756       HRESOURCE hResourceIn
00757     , DWORD     dwControlCodeIn
00758     , HNODE     hHostNodeIn
00759     , LPVOID    lpBufferIn
00760     , size_t    cbBufferIn
00761     )
00762 {
00763     ASSERT( hResourceIn != NULL );
00764     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
00765             == ( CLUS_OBJECT_RESOURCE << CLUSCTL_OBJECT_SHIFT ) );
00766
00767     DWORD   sc = ERROR_SUCCESS;
00768     DWORD   cb = 512;
00769
00770     //
00771     // Overwrite anything that may be in the buffer.
00772     // Allows this class instance to be reused.
00773     //
00774
00775     m_cbDataSize = 0;
00776
00777     //
00778     // Get values.
00779     //
00780
00781     sc = ScAllocValueList( cb );
00782     if ( sc == ERROR_SUCCESS )
00783     {
00784         sc = ClusterResourceControl(
00785                         hResourceIn,
00786                         hHostNodeIn,
00787                         dwControlCodeIn,
00788                         lpBufferIn,
00789                         static_cast< DWORD >( cbBufferIn ),
00790                         m_cbhValueList.pb,
00791                         static_cast< DWORD >( m_cbBufferSize ),
00792                         &cb
00793                         );
00794         if ( sc == ERROR_MORE_DATA )
00795         {
00796             sc = ScAllocValueList( cb );
00797             if ( sc == ERROR_SUCCESS )
00798             {
00799                 sc = ClusterResourceControl(
00800                                 hResourceIn,
00801                                 hHostNodeIn,
00802                                 dwControlCodeIn,
00803                                 lpBufferIn,
00804                                 static_cast< DWORD >( cbBufferIn ),
00805                                 m_cbhValueList.pb,
00806                                 static_cast< DWORD >( m_cbBufferSize ),
00807                                 &cb
00808                                 );
00809             } // if: ScAllocValueList succeeded
00810         } // if: buffer too small
00811     } // if: ScAllocValueList succeeded
00812
00813     if ( sc != ERROR_SUCCESS )
00814     {
00815         DeleteValueList();
00816     } // if: error getting properties.
00817     else
00818     {
00819         m_cbDataSize = static_cast< size_t >( cb );
00820         m_cbDataLeft = static_cast< size_t >( cb );
00821     } // else: no errors
00822
00823     return sc;
00824
00825 } //*** CClusPropValueList::ScGetResourceValueList
00826
00827 /////////////////////////////////////////////////////////////////////////////
00828 //++
00829 //
00830 //  CClusPropValueList::ScGetResourceTypeValueList
00831 //
00832 //  Description:
00833 //      Get value list of a resource type.
00834 //
00835 //  Arguments:
00836 //      hClusterIn          Handle for the cluster in which the resource
00837 //                          type resides.
00838 //      pwszResTypeNameIn   Name of the resource type.
00839 //      dwControlCodeIn     Control code for the request.
00840 //      hHostNodeIn         Handle for the node to direct this request to.
00841 //                          Defaults to NULL.
00842 //      lpBufferIn          Input buffer for the request.  Defaults to NULL.
00843 //      cbBufferIn          Size of the input buffer.  Defaults to 0.
00844 //
00845 //  Return Value:
00846 //      None.
00847 //
00848 //--
00849 /////////////////////////////////////////////////////////////////////////////
00850 DWORD
00851 CClusPropValueList::ScGetResourceTypeValueList(
00852       HCLUSTER  hClusterIn
00853     , LPCWSTR   pwszResTypeNameIn
00854     , DWORD     dwControlCodeIn
00855     , HNODE     hHostNodeIn
00856     , LPVOID    lpBufferIn
00857     , size_t    cbBufferIn
00858     )
00859 {
00860     ASSERT( hClusterIn != NULL );
00861     ASSERT( pwszResTypeNameIn != NULL );
00862     ASSERT( *pwszResTypeNameIn != L'\0' );
00863     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
00864             == ( CLUS_OBJECT_RESOURCE_TYPE << CLUSCTL_OBJECT_SHIFT ) );
00865
00866     DWORD   sc = ERROR_SUCCESS;
00867     DWORD   cb = 512;
00868
00869     //
00870     // Overwrite anything that may be in the buffer.
00871     // Allows this class instance to be reused.
00872     //
00873
00874     m_cbDataSize = 0;
00875
00876     //
00877     // Get values.
00878     //
00879
00880     sc = ScAllocValueList( cb );
00881     if ( sc == ERROR_SUCCESS )
00882     {
00883         sc = ClusterResourceTypeControl(
00884                         hClusterIn,
00885                         pwszResTypeNameIn,
00886                         hHostNodeIn,
00887                         dwControlCodeIn,
00888                         lpBufferIn,
00889                         static_cast< DWORD >( cbBufferIn ),
00890                         m_cbhValueList.pb,
00891                         static_cast< DWORD >( m_cbBufferSize ),
00892                         &cb
00893                         );
00894         if ( sc == ERROR_MORE_DATA )
00895         {
00896             sc = ScAllocValueList( cb );
00897             if ( sc == ERROR_SUCCESS )
00898             {
00899                 sc = ClusterResourceTypeControl(
00900                                 hClusterIn,
00901                                 pwszResTypeNameIn,
00902                                 hHostNodeIn,
00903                                 dwControlCodeIn,
00904                                 lpBufferIn,
00905                                 static_cast< DWORD >( cbBufferIn ),
00906                                 m_cbhValueList.pb,
00907                                 static_cast< DWORD >( m_cbBufferSize ),
00908                                 &cb
00909                                 );
00910             } // if: ScAllocValueList succeeded
00911         } // if: buffer too small
00912     } // if: ScAllocValueList succeeded
00913
00914     if ( sc != ERROR_SUCCESS )
00915     {
00916         DeleteValueList();
00917     } // if: error getting properties.
00918     else
00919     {
00920         m_cbDataSize = static_cast< size_t >( cb );
00921         m_cbDataLeft = static_cast< size_t >( cb );
00922     } // else: no errors
00923
00924     return sc;
00925
00926 } //*** CClusPropValueList::ScGetResourceTypeValueList
00927
00928
00929 //*************************************************************************//
00930
00931
00932 /////////////////////////////////////////////////////////////////////////////
00933 // CClusPropList class
00934 /////////////////////////////////////////////////////////////////////////////
00935
00936 #ifdef __AFX_H__
00937 IMPLEMENT_DYNAMIC( CClusPropList, CObject );
00938 #endif // __AFX_H__
00939
00940 /////////////////////////////////////////////////////////////////////////////
00941 //++
00942 //
00943 //  CClusPropList::ScCopy
00944 //
00945 //  Description:
00946 //      Copy a property list.  This function is equivalent to an assignment
00947 //      operator.  Since this operation can fail, no assignment operator is
00948 //      provided.
00949 //
00950 //  Arguments:
00951 //      pcplPropListIn    The proplist to copy into this instance.
00952 //      cbPropListIn      The total size of the prop list.
00953 //
00954 //  Return Value:
00955 //      Win32 status code.
00956 //
00957 //--
00958 /////////////////////////////////////////////////////////////////////////////
00959 DWORD
00960 CClusPropList::ScCopy(
00961       const PCLUSPROP_LIST  pcplPropListIn
00962     , size_t                cbPropListIn
00963     )
00964 {
00965     ASSERT( pcplPropListIn != NULL );
00966
00967     DWORD   sc = ERROR_SUCCESS;
00968
00969     //
00970     // Clean up any vestiges of a previous prop list.
00971     //
00972
00973     if ( m_cbhPropList.pb != NULL )
00974     {
00975         DeletePropList();
00976     } // if: the current list is not empty
00977
00978     //
00979     // Allocate the new property list buffer.  If successful,
00980     // copy the source list.
00981     //
00982
00983     m_cbhPropList.pb = new BYTE[ cbPropListIn ];
00984     if ( m_cbhPropList.pb != NULL )
00985     {
00986         CopyMemory( m_cbhPropList.pList, pcplPropListIn, cbPropListIn );
00987         m_cbBufferSize = cbPropListIn;
00988         m_cbDataSize   = cbPropListIn;
00989         m_cbDataLeft   = cbPropListIn;
00990         sc = ScMoveToFirstProperty();
00991     } // if: new succeeded
00992     else
00993     {
00994         sc = ERROR_NOT_ENOUGH_MEMORY;
00995     } // else:
00996
00997     return sc;
00998
00999 } //*** CClusPropList::ScCopy
01000
01001 /////////////////////////////////////////////////////////////////////////////
01002 //++
01003 //
01004 //  CClusPropList::ScAppend
01005 //
01006 //  Description:
01007 //      Append to a property list.
01008 //
01009 //  Arguments:
01010 //      rclPropListIn    The proplist to append onto this instance.
01011 //
01012 //  Return Value:
01013 //      Win32 status code.
01014 //
01015 //--
01016 /////////////////////////////////////////////////////////////////////////////
01017 DWORD
01018 CClusPropList::ScAppend(
01019     const CClusPropList & rclPropListIn
01020     )
01021 {
01022     DWORD   sc = ERROR_SUCCESS;
01023     size_t  cbPropertyCountOffset = 0;
01024     size_t  cbIncrement = 0;
01025     size_t  cbDataLeft = 0;
01026     PBYTE   pbsrc = NULL;
01027     PBYTE   pbdest = NULL;
01028
01029     //
01030     //  Compute the number of bytes to get past the count of properties that
01031     //  is at the head of the list.  This is typically sizeof DWORD.
01032     //
01033
01034     cbPropertyCountOffset = sizeof( m_cbhPropList.pList->nPropertyCount );
01035
01036     //
01037     //  Compute the allocation increment.  This is used when growing our buffer
01038     //  and is the amount of data to copy from the passed in list.  This includes
01039     //  the trailing endmark.  m_cbDataSize does not include the leading property
01040     //  count DWORD.
01041     //
01042
01043     cbIncrement = rclPropListIn.m_cbDataSize;
01044
01045     //
01046     //  How much space remains in our current buffer?
01047     //
01048
01049     cbDataLeft = m_cbBufferSize - m_cbDataSize;
01050
01051     //
01052     //  If the size of the list to append is larger than what we have remaining
01053     //  then we need to grow the list.
01054     //
01055
01056     if ( cbIncrement > cbDataLeft )
01057     {
01058         sc = ScAllocPropList( m_cbDataSize + cbIncrement );
01059         if ( sc != ERROR_SUCCESS )
01060         {
01061             goto Cleanup;
01062         } // if:
01063     } // if:
01064
01065     pbdest = (PBYTE) &m_cbhPropList.pb[ cbPropertyCountOffset + m_cbDataSize ];
01066
01067     pbsrc = (PBYTE) &rclPropListIn.m_cbhPropList.pList->PropertyName;
01068
01069     CopyMemory( pbdest, pbsrc, cbIncrement );
01070
01071     //
01072     //  Grow our data size to match our new size.
01073     //
01074
01075     m_cbDataSize += cbIncrement;
01076
01077     //
01078     //  Increment our property count to include the count of properties appended to the end
01079     //  of our buffer.
01080     //
01081
01082     m_cbhPropList.pList->nPropertyCount += rclPropListIn.m_cbhPropList.pList->nPropertyCount;
01083
01084 Cleanup:
01085
01086     return sc;
01087
01088 } //*** CClusPropList::ScAppend
01089
01090 ////////////////////////////////////////////////////////////////////////////
01091 //++
01092 //
01093 //  CClusPropList::ScMoveToFirstProperty
01094 //
01095 //  Description:
01096 //      Move the cursor to the first propery in the list.
01097 //
01098 //  Arguments:
01099 //      None.
01100 //
01101 //  Return Value:
01102 //      ERROR_SUCCESS       Position moved to the first property successfully.
01103 //      ERROR_NO_MORE_ITEMS There are no properties in the list.
01104 //      ERROR_INVALID_DATA  Not enough data in the buffer.
01105 //
01106 //--
01107 /////////////////////////////////////////////////////////////////////////////
01108 DWORD
01109 CClusPropList::ScMoveToFirstProperty( void )
01110 {
01111     ASSERT( m_cbhPropList.pb != NULL );
01112     ASSERT( m_cbDataSize >= sizeof( m_cbhPropList.pList->nPropertyCount ) );
01113
01114     DWORD                   sc;
01115     size_t                  cbDataLeft;
01116     size_t                  cbDataSize;
01117     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
01118
01119     //
01120     // Make sure the buffer is big enough for the list header.
01121     //
01122
01123     if ( m_cbDataSize < sizeof( m_cbhPropList.pList->nPropertyCount ) )
01124     {
01125         sc = ERROR_INVALID_DATA;
01126         goto Cleanup;
01127     } // if: not enough data
01128
01129     //
01130     // Set the property counter to the number of properties in the list.
01131     //
01132
01133     m_nPropsRemaining = m_cbhPropList.pList->nPropertyCount;
01134
01135     //
01136     // Point the name pointer to the first name in the list.
01137     //
01138
01139     m_cbhCurrentPropName.pName = &m_cbhPropList.pList->PropertyName;
01140     m_cbDataLeft = m_cbDataSize - sizeof( m_cbhPropList.pList->nPropertyCount );
01141
01142     //
01143     // Check to see if there are any properties in the list.
01144     //
01145
01146     if ( m_nPropsRemaining == 0 )
01147     {
01148         sc = ERROR_NO_MORE_ITEMS;
01149         goto Cleanup;
01150     } // if: no properties in the list
01151
01152     //
01153     // Make sure the buffer is big enough for the first property name.
01154     //
01155
01156     if ( m_cbDataLeft < sizeof( *m_cbhCurrentPropName.pName ) )
01157     {
01158         sc = ERROR_INVALID_DATA;
01159         goto Cleanup;
01160     } // if: not enough data left
01161
01162     //
01163     // Calculate how much to advance the buffer pointer.
01164     //
01165
01166     cbDataSize = sizeof( *m_cbhCurrentPropName.pName )
01167                 + ALIGN_CLUSPROP( m_cbhCurrentPropName.pName->cbLength );
01168
01169     //
01170     // Make sure the buffer is big enough for the name header
01171     // and the data itself.
01172     //
01173
01174     if ( m_cbDataLeft < cbDataSize )
01175     {
01176         sc = ERROR_INVALID_DATA;
01177         goto Cleanup;
01178     } // if: not enough data left
01179
01180     //
01181     // Point the value buffer to the first value in the list.
01182     //
01183
01184     cbhCurrentValue.pb = m_cbhCurrentPropName.pb + cbDataSize;
01185     cbDataLeft = m_cbDataLeft - cbDataSize;
01186     m_pvlValues.Init( cbhCurrentValue, cbDataLeft );
01187
01188     //
01189     // Indicate we are successful.
01190     //
01191
01192     sc = ERROR_SUCCESS;
01193
01194 Cleanup:
01195
01196     return sc;
01197
01198 } //*** CClusPropList::ScMoveToFirstProperty
01199
01200 /////////////////////////////////////////////////////////////////////////////
01201 //++
01202 //
01203 //  CClusPropList::ScMoveToNextProperty
01204 //
01205 //  Description:
01206 //      Move the cursor to the next property in the list.
01207 //
01208 //  Arguments:
01209 //      None.
01210 //
01211 //  Return Value:
01212 //      ERROR_SUCCESS       Position moved to the next property successfully.
01213 //      ERROR_NO_MORE_ITEMS Already at the end of the list.
01214 //      ERROR_INVALID_DATA  Not enough data in the buffer.
01215 //
01216 //--
01217 /////////////////////////////////////////////////////////////////////////////
01218 DWORD
01219 CClusPropList::ScMoveToNextProperty( void )
01220 {
01221     ASSERT( m_cbhPropList.pb != NULL );
01222     ASSERT( m_pvlValues.CbhValueList().pb != NULL );
01223
01224     DWORD                   sc = ERROR_SUCCESS;
01225     size_t                  cbNameSize = 0;
01226     size_t                  cbDataLeft = 0;
01227     size_t                  cbDataSize = 0;
01228     CLUSPROP_BUFFER_HELPER  cbhCurrentValue;
01229     CLUSPROP_BUFFER_HELPER  cbhPropName;
01230
01231     cbhCurrentValue = m_pvlValues;
01232     cbDataLeft = m_pvlValues.CbDataLeft();
01233
01234     //
01235     // If we aren't already at the last property, attempt to move to the next one.
01236     //
01237
01238     sc = ScCheckIfAtLastProperty();
01239     if ( sc != ERROR_SUCCESS )
01240     {
01241         goto Cleanup;
01242     } // if: already at the last property (probably)
01243
01244     //
01245     // Make sure the buffer is big enough for the value header.
01246     //
01247
01248     if ( cbDataLeft < sizeof( *cbhCurrentValue.pValue ) )
01249     {
01250         sc = ERROR_INVALID_DATA;
01251         goto Cleanup;
01252     } // if: not enough data left
01253
01254     //
01255     // Careful!  Add offset only to cbhCurrentValue.pb.  Otherwise
01256     // pointer arithmetic will give undesirable results.
01257     //
01258
01259     while ( cbhCurrentValue.pSyntax->dw != CLUSPROP_SYNTAX_ENDMARK )
01260     {
01261         //
01262         // Make sure the buffer is big enough for the value
01263         // and an endmark.
01264         //
01265
01266         cbDataSize = sizeof( *cbhCurrentValue.pValue )
01267                     + ALIGN_CLUSPROP( cbhCurrentValue.pValue->cbLength );
01268         if ( cbDataLeft < cbDataSize + sizeof( *cbhCurrentValue.pSyntax ) )
01269         {
01270             sc = ERROR_INVALID_DATA;
01271             goto Cleanup;
01272         } // if: not enough data left
01273
01274         //
01275         // Advance past the value.
01276         //
01277
01278         cbhCurrentValue.pb += cbDataSize;
01279         cbDataLeft -= cbDataSize;
01280     } // while: not at endmark
01281
01282     if ( sc != ERROR_SUCCESS )
01283     {
01284         goto Cleanup;
01285     } // if: error occurred in loop
01286
01287     //
01288     // Advanced past the endmark.
01289     // Size check already performed in above loop.
01290     //
01291
01292     cbDataSize = sizeof( *cbhCurrentValue.pSyntax );
01293     cbhCurrentValue.pb += cbDataSize;
01294     cbDataLeft -= cbDataSize;
01295
01296     //
01297     // Point the name pointer to the next name in the list.
01298     //
01299
01300     cbhPropName = cbhCurrentValue;
01301     ASSERT( cbDataLeft == m_cbDataSize - (cbhPropName.pb - m_cbhPropList.pb) );
01302
01303     //
01304     // Calculate the size of the name with header.
01305     // Make sure the buffer is big enough for the name and an endmark.
01306     //
01307
01308     if ( cbDataLeft < sizeof( *cbhPropName.pName ) )
01309     {
01310         sc = ERROR_INVALID_DATA;
01311         goto Cleanup;
01312     } // if: not enough data
01313
01314     cbNameSize = sizeof( *cbhPropName.pName )
01315                 + ALIGN_CLUSPROP( cbhPropName.pName->cbLength );
01316
01317     if ( cbDataLeft < cbNameSize + sizeof( CLUSPROP_SYNTAX ) )
01318     {
01319         sc = ERROR_INVALID_DATA;
01320         goto Cleanup;
01321     } // if: not enough data
01322
01323     //
01324     // Point the value buffer to the first value in the list.
01325     //
01326
01327     cbhCurrentValue.pb = cbhPropName.pb + cbNameSize;
01328     m_cbhCurrentPropName = cbhPropName;
01329     m_cbDataLeft = cbDataLeft - cbNameSize;
01330     m_pvlValues.Init( cbhCurrentValue, m_cbDataLeft );
01331
01332     //
01333     // We've successfully advanced to the next property,
01334     // so there is now one fewer property remaining.
01335     //
01336
01337     --m_nPropsRemaining;
01338     ASSERT( m_nPropsRemaining >= 1 );
01339
01340     sc = ERROR_SUCCESS;
01341
01342 Cleanup:
01343
01344     return sc;
01345
01346 } //*** CClusPropList::ScMoveToNextProperty
01347
01348 /////////////////////////////////////////////////////////////////////////////
01349 //++
01350 //
01351 //  CClusPropList::ScMoveToPropertyByName
01352 //
01353 //  Description:
01354 //      Find the passed in property name in the proplist.  Note that the
01355 //      cursor is reset to the beginning at the beginning of the routine and
01356 //      the current state of the cursor is lost.
01357 //
01358 //  Arguments:
01359 //      pwszPropNameIn    Name of the property
01360 //
01361 //  Return Value:
01362 //      ERROR_SUCCESS if the property was found, other Win32 code if not.
01363 //
01364 //--
01365 /////////////////////////////////////////////////////////////////////////////
01366 DWORD
01367 CClusPropList::ScMoveToPropertyByName(
01368     LPCWSTR pwszPropNameIn
01369     )
01370 {
01371     ASSERT( m_cbhPropList.pb != NULL );
01372
01373     DWORD   sc = ERROR_SUCCESS;
01374
01375     sc = ScMoveToFirstProperty();
01376     if ( sc == ERROR_SUCCESS )
01377     {
01378         do
01379         {
01380             //
01381             // See if this is the specified property.  If so, we're done.
01382             //
01383
01384             if ( IStringCompareW( m_cbhCurrentPropName.pName->sz, pwszPropNameIn ) == 0 )
01385             {
01386                 break;
01387             } // if: property found
01388
01389             //
01390             // Advance to the next property.
01391             //
01392
01393             sc = ScMoveToNextProperty();   // No because we expect an error when at the d
01394
01395         } while ( sc == ERROR_SUCCESS );   // do-while: not end of list
01396     } // if: successfully moved to the first property
01397
01398     return sc;
01399
01400 } //*** ClusPropList::ScMoveToPropertyByName( LPCWSTR )
01401
01402 /////////////////////////////////////////////////////////////////////////////
01403 //++
01404 //
01405 //  CClusPropList::ScAllocPropList
01406 //
01407 //  Description:
01408 //      Allocate a property list buffer that's big enough to hold the next
01409 //      property.
01410 //
01411 //  Arguments:
01412 //      cbMinimumIn   Minimum size of the property list.
01413 //
01414 //  Return Value:
01415 //      ERROR_SUCCESS
01416 //      ERROR_NOT_ENOUGH_MEMORY
01417 //      Other Win32 error codes
01418 //
01419 //--
01420 /////////////////////////////////////////////////////////////////////////////
01421 DWORD
01422 CClusPropList::ScAllocPropList(
01423     size_t cbMinimumIn
01424     )
01425 {
01426     ASSERT( cbMinimumIn > 0 );
01427
01428     DWORD   sc = ERROR_SUCCESS;
01429     size_t  cbTotal = 0;
01430
01431     //
01432     // Add the size of the item count and final endmark.
01433     //
01434
01435     cbMinimumIn += sizeof( CLUSPROP_VALUE );
01436     cbTotal = m_cbDataSize + cbMinimumIn;
01437
01438     if ( m_cbBufferSize < cbTotal )
01439     {
01440         PBYTE   pbNewProplist = NULL;
01441
01442         cbMinimumIn = max( BUFFER_GROWTH_FACTOR, cbMinimumIn );
01443         cbTotal = m_cbDataSize + cbMinimumIn;
01444
01445         //
01446         // Allocate and zero a new buffer.
01447         //
01448
01449         pbNewProplist = new BYTE[ cbTotal ];
01450         if ( pbNewProplist != NULL )
01451         {
01452             ZeroMemory( pbNewProplist, cbTotal );
01453
01454             //
01455             // If there was a previous buffer, copy it and the delete it.
01456             //
01457
01458             if ( m_cbhPropList.pb != NULL )
01459             {
01460                 if ( m_cbDataSize != 0 )
01461                 {
01462                     CopyMemory( pbNewProplist, m_cbhPropList.pb, m_cbDataSize );
01463                 } // if: data already exists in buffer
01464
01465                 delete [] m_cbhPropList.pb;
01466                 m_cbhCurrentProp.pb = pbNewProplist + (m_cbhCurrentProp.pb - m_cbhPropList.pb);
01467             } // if: there was a previous buffer
01468             else
01469             {
01470                 m_cbhCurrentProp.pb = pbNewProplist + sizeof( DWORD ); // move past prop count
01471             } // else: no previous buffer
01472
01473             //
01474             // Save the new buffer.
01475             //
01476
01477             m_cbhPropList.pb = pbNewProplist;
01478             m_cbBufferSize = cbTotal;
01479         } // if: allocation succeeded
01480         else
01481         {
01482             sc = ERROR_NOT_ENOUGH_MEMORY;
01483         } // else: allocation failed
01484     } // if: buffer isn't big enough
01485
01486     return sc;
01487
01488 } //*** CClusPropList::ScAllocPropList
01489
01490 /////////////////////////////////////////////////////////////////////////////
01491 //++
01492 //
01493 //  CClusPropList::ScAddProp
01494 //
01495 //  Description:
01496 //      Add a string property to a property list if it has changed.
01497 //
01498 //  Arguments:
01499 //      pwszNameIn        Name of the property.
01500 //      pwszValueIn       Value of the property to set in the list.
01501 //      pwszPrevValueIn   Previous value of the property.
01502 //
01503 //  Return Value:
01504 //      ERROR_SUCCESS or other Win32 error code.
01505 //
01506 //--
01507 /////////////////////////////////////////////////////////////////////////////
01508 DWORD
01509 CClusPropList::ScAddProp(
01510       LPCWSTR   pwszNameIn
01511     , LPCWSTR   pwszValueIn
01512     , LPCWSTR   pwszPrevValueIn
01513     )
01514 {
01515     ASSERT( pwszNameIn != NULL );
01516
01517     DWORD                   sc = ERROR_SUCCESS;
01518     BOOL                    fValuesDifferent = TRUE;
01519     PCLUSPROP_PROPERTY_NAME pName = NULL;
01520     PCLUSPROP_SZ            pValue = NULL;
01521
01522     if ( ( pwszPrevValueIn != NULL ) && ( IStringCompareW( pwszValueIn, pwszPrevValueIn ) == 0 ) )
01523     {
01524         fValuesDifferent = FALSE;
01525     } // if: we have a prev value and the values are the same
01526
01527     //
01528     // If we should always add, or if the new value and the previous value
01529     // are not equal, add the property to the property list.
01530     //
01531
01532     if ( m_fAlwaysAddProp || fValuesDifferent )
01533     {
01534         size_t  cbNameSize;
01535         size_t  cbDataSize;
01536         size_t  cbValueSize = 0;
01537
01538         //
01539         // Calculate sizes and make sure we have a property list.
01540         //
01541
01542         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01543                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01544
01545         cbDataSize = (lstrlenW( pwszValueIn ) + 1) * sizeof( *pwszValueIn );
01546
01547         cbValueSize = sizeof( CLUSPROP_SZ )
01548                     + ALIGN_CLUSPROP( cbDataSize )
01549                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01550
01551         sc = ScAllocPropList( cbNameSize + cbValueSize );
01552         if ( sc == ERROR_SUCCESS )
01553         {
01554             //
01555             // Set the property name.
01556             //
01557
01558             pName = m_cbhCurrentProp.pName;
01559             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01560             m_cbhCurrentProp.pb += cbNameSize;
01561
01562             //
01563             // Set the property value.
01564             //
01565
01566             pValue = m_cbhCurrentProp.pStringValue;
01567             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pwszValueIn, cbDataSize );
01568             m_cbhCurrentProp.pb += cbValueSize;
01569
01570             //
01571             // Increment the property count and buffer size.
01572             //
01573
01574             m_cbhPropList.pList->nPropertyCount++;
01575             m_cbDataSize += cbNameSize + cbValueSize;
01576         } // if: ScAllocPropList successfully grew the proplist
01577
01578     } // if: the value has changed
01579
01580     return sc;
01581
01582 } //*** CClusPropList::ScAddProp( LPCWSTR )
01583
01584 /////////////////////////////////////////////////////////////////////////////
01585 //++
01586 //
01587 //  CClusPropList::ScAddMultiSzProp
01588 //
01589 //  Description:
01590 //      Add a string property to a property list if it has changed.
01591 //
01592 //  Arguments:
01593 //      pwszNameIn        Name of the property.
01594 //      pwszValueIn       Value of the property to set in the list.
01595 //      pwszPrevValueIn   Previous value of the property.
01596 //
01597 //  Return Value:
01598 //      ERROR_SUCCESS or other Win32 error code.
01599 //
01600 //--
01601 /////////////////////////////////////////////////////////////////////////////
01602 DWORD
01603 CClusPropList::ScAddMultiSzProp(
01604       LPCWSTR   pwszNameIn
01605     , LPCWSTR   pwszValueIn
01606     , LPCWSTR   pwszPrevValueIn
01607     )
01608 {
01609     ASSERT( pwszNameIn != NULL );
01610
01611     DWORD                   sc = ERROR_SUCCESS;
01612     BOOL                    fValuesDifferent = TRUE;
01613     PCLUSPROP_PROPERTY_NAME pName = NULL;
01614     PCLUSPROP_MULTI_SZ      pValue = NULL;
01615
01616     if ( ( pwszPrevValueIn != NULL ) && ( NCompareMultiSz( pwszValueIn, pwszPrevValueIn ) == 0 ) )
01617     {
01618         fValuesDifferent = FALSE;
01619     } // if: we have a prev value and the values are the same
01620
01621     //
01622     // If we should always add, or if the new value and the previous value
01623     // are not equal, add the property to the property list.
01624     //
01625
01626     if ( m_fAlwaysAddProp || fValuesDifferent )
01627     {
01628         size_t  cbNameSize;
01629         size_t  cbDataSize;
01630         size_t  cbValueSize;
01631
01632         //
01633         // Calculate sizes and make sure we have a property list.
01634         //
01635
01636         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01637                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01638
01639         cbDataSize = static_cast< DWORD >( (CchMultiSz( pwszValueIn ) + 1) * sizeof( *pwszValueIn ) );
01640
01641         cbValueSize = sizeof( CLUSPROP_SZ )
01642                     + ALIGN_CLUSPROP( cbDataSize )
01643                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01644
01645         sc = ScAllocPropList( cbNameSize + cbValueSize );
01646         if ( sc == ERROR_SUCCESS )
01647         {
01648             //
01649             // Set the property name.
01650             //
01651
01652             pName = m_cbhCurrentProp.pName;
01653             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01654             m_cbhCurrentProp.pb += cbNameSize;
01655
01656             //
01657             // Set the property value.
01658             //
01659
01660             pValue = m_cbhCurrentProp.pMultiSzValue;
01661             CopyMultiSzProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pwszValueIn, cbDataSize );
01662             m_cbhCurrentProp.pb += cbValueSize;
01663
01664             //
01665             // Increment the property count and buffer size.
01666             //
01667
01668             m_cbhPropList.pList->nPropertyCount++;
01669             m_cbDataSize += cbNameSize + cbValueSize;
01670         } // if: ScAllocPropList successfully grew the proplist
01671     } // if: the value has changed
01672
01673     return sc;
01674
01675 } //*** CClusPropList::ScAddMultiSzProp( LPCWSTR )
01676
01677 /////////////////////////////////////////////////////////////////////////////
01678 //++
01679 //
01680 //  CClusPropList::ScAddExpandSzProp
01681 //
01682 //  Description:
01683 //      Add an EXPAND_SZ string property to a property list if it has changed.
01684 //
01685 //  Arguments:
01686 //      pwszNameIn        Name of the property.
01687 //      pwszValueIn       Value of the property to set in the list.
01688 //      pwszPrevValueIn   Previous value of the property.
01689 //
01690 //  Return Value:
01691 //      None.
01692 //
01693 //--
01694 /////////////////////////////////////////////////////////////////////////////
01695 DWORD
01696 CClusPropList::ScAddExpandSzProp(
01697       LPCWSTR   pwszNameIn
01698     , LPCWSTR   pwszValueIn
01699     , LPCWSTR   pwszPrevValueIn
01700     )
01701 {
01702     ASSERT( pwszNameIn != NULL );
01703
01704     DWORD                   sc = ERROR_SUCCESS;
01705     BOOL                    fValuesDifferent = TRUE;
01706     PCLUSPROP_PROPERTY_NAME pName = NULL;
01707     PCLUSPROP_SZ            pValue = NULL;
01708
01709     if ( ( pwszPrevValueIn != NULL ) && ( IStringCompareW( pwszValueIn, pwszPrevValueIn ) == 0 ) )
01710     {
01711         fValuesDifferent = FALSE;
01712     } // if: we have a prev value and the values are the same
01713
01714     //
01715     // If we should always add, or if the new value and the previous value
01716     // are not equal, add the property to the property list.
01717     //
01718
01719     if ( m_fAlwaysAddProp || fValuesDifferent )
01720     {
01721         size_t  cbNameSize = 0;
01722         size_t  cbDataSize = 0;
01723         size_t  cbValueSize = 0;
01724
01725         //
01726         // Calculate sizes and make sure we have a property list.
01727         //
01728
01729         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01730                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01731
01732         cbDataSize = (lstrlenW( pwszValueIn ) + 1) * sizeof( *pwszValueIn );
01733
01734         cbValueSize = sizeof( CLUSPROP_SZ )
01735                     + ALIGN_CLUSPROP( cbDataSize )
01736                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01737
01738         sc = ScAllocPropList( cbNameSize + cbValueSize );
01739         if ( sc == ERROR_SUCCESS )
01740         {
01741             //
01742             // Set the property name.
01743             //
01744
01745             pName = m_cbhCurrentProp.pName;
01746             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01747             m_cbhCurrentProp.pb += cbNameSize;
01748
01749             //
01750             // Set the property value.
01751             //
01752
01753             pValue = m_cbhCurrentProp.pStringValue;
01754             CopyExpandSzProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pwszValueIn, cbDataSize );
01755             m_cbhCurrentProp.pb += cbValueSize;
01756
01757             //
01758             // Increment the property count and buffer size.
01759             //
01760
01761             m_cbhPropList.pList->nPropertyCount++;
01762             m_cbDataSize += cbNameSize + cbValueSize;
01763         } // if: ScAllocPropList successfully grew the proplist
01764     } // if: the value has changed
01765
01766     return sc;
01767
01768 } //*** CClusPropList::ScAddExpandSzProp( LPCWSTR )
01769
01770 /////////////////////////////////////////////////////////////////////////////
01771 //++
01772 //
01773 //  CClusPropList::ScAddProp
01774 //
01775 //  Description:
01776 //      Add a DWORD property to a property list if it has changed.
01777 //
01778 //  Arguments:
01779 //      pwszNameIn        Name of the property.
01780 //      nValueIn          Value of the property to set in the list.
01781 //      nPrevValueIn      Previous value of the property.
01782 //
01783 //  Return Value:
01784 //      None.
01785 //
01786 //--
01787 /////////////////////////////////////////////////////////////////////////////
01788 DWORD
01789 CClusPropList::ScAddProp(
01790       LPCWSTR   pwszNameIn
01791     , DWORD     nValueIn
01792     , DWORD     nPrevValueIn
01793     )
01794 {
01795     ASSERT( pwszNameIn != NULL );
01796
01797     DWORD                   sc = ERROR_SUCCESS;
01798     PCLUSPROP_PROPERTY_NAME pName = NULL;
01799     PCLUSPROP_DWORD         pValue = NULL;
01800
01801     if ( m_fAlwaysAddProp || ( nValueIn != nPrevValueIn ) )
01802     {
01803         size_t  cbNameSize = 0;
01804         size_t  cbValueSize = 0;
01805
01806         //
01807         // Calculate sizes and make sure we have a property list.
01808         //
01809
01810         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01811                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01812
01813         cbValueSize = sizeof( CLUSPROP_DWORD )
01814                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01815
01816         sc = ScAllocPropList( cbNameSize + cbValueSize );
01817         if ( sc == ERROR_SUCCESS )
01818         {
01819             //
01820             // Set the property name.
01821             //
01822
01823             pName = m_cbhCurrentProp.pName;
01824             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01825             m_cbhCurrentProp.pb += cbNameSize;
01826
01827             //
01828             // Set the property value.
01829             //
01830
01831             pValue = m_cbhCurrentProp.pDwordValue;
01832             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, nValueIn );
01833             m_cbhCurrentProp.pb += cbValueSize;
01834
01835             //
01836             // Increment the property count and buffer size.
01837             //
01838
01839             m_cbhPropList.pList->nPropertyCount++;
01840             m_cbDataSize += cbNameSize + cbValueSize;
01841         } // if: ScAllocPropList successfully grew the proplist
01842     } // if: the value has changed
01843
01844     return sc;
01845
01846 } //*** CClusPropList::ScAddProp( DWORD )
01847
01848 /////////////////////////////////////////////////////////////////////////////
01849 //++
01850 //
01851 //  CClusPropList::ScAddProp
01852 //
01853 //  Description:
01854 //      Add a LONG property to a property list if it has changed.
01855 //
01856 //  Arguments:
01857 //      pwszNameIn        Name of the property.
01858 //      nValueIn          Value of the property to set in the list.
01859 //      nPrevValueIn      Previous value of the property.
01860 //
01861 //  Return Value:
01862 //      None.
01863 //
01864 //--
01865 /////////////////////////////////////////////////////////////////////////////
01866 DWORD CClusPropList::ScAddProp(
01867       LPCWSTR  pwszNameIn
01868     , LONG     nValueIn
01869     , LONG     nPrevValueIn
01870     )
01871 {
01872     ASSERT( pwszNameIn != NULL );
01873
01874     DWORD                   sc = ERROR_SUCCESS;
01875     PCLUSPROP_PROPERTY_NAME pName = NULL;
01876     PCLUSPROP_LONG          pValue = NULL;
01877
01878     if ( m_fAlwaysAddProp || ( nValueIn != nPrevValueIn ) )
01879     {
01880         size_t  cbNameSize = 0;
01881         size_t  cbValueSize = 0;
01882
01883         //
01884         // Calculate sizes and make sure we have a property list.
01885         //
01886
01887         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01888                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01889
01890         cbValueSize = sizeof( CLUSPROP_LONG )
01891                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01892
01893         sc = ScAllocPropList( cbNameSize + cbValueSize );
01894         if ( sc == ERROR_SUCCESS )
01895         {
01896             //
01897             // Set the property name.
01898             //
01899
01900             pName = m_cbhCurrentProp.pName;
01901             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01902             m_cbhCurrentProp.pb += cbNameSize;
01903
01904             //
01905             // Set the property value.
01906             //
01907
01908             pValue = m_cbhCurrentProp.pLongValue;
01909             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, nValueIn );
01910             m_cbhCurrentProp.pb += cbValueSize;
01911
01912             //
01913             // Increment the property count and buffer size.
01914             //
01915
01916             m_cbhPropList.pList->nPropertyCount++;
01917             m_cbDataSize += cbNameSize + cbValueSize;
01918         } // if: ScAllocPropList successfully grew the proplist
01919     } // if: the value has changed
01920
01921     return sc;
01922
01923 } //*** CClusPropList::ScAddProp( LONG )
01924
01925 /////////////////////////////////////////////////////////////////////////////
01926 //++
01927 //
01928 //  CClusPropList::ScAddProp
01929 //
01930 //  Description:
01931 //      Add a binary property to a property list if it has changed.
01932 //
01933 //  Arguments:
01934 //      pwszNameIn        Name of the property.
01935 //      pbValueIn         Value of the property to set in the list.
01936 //      cbValueIn         Count of bytes in pbValueIn.
01937 //      pbPrevValueIn     Previous value of the property.
01938 //      cbPrevValueIn     Count of bytes in pbPrevValueIn.
01939 //
01940 //  Return Value:
01941 //      None.
01942 //
01943 //--
01944 /////////////////////////////////////////////////////////////////////////////
01945 DWORD
01946 CClusPropList::ScAddProp(
01947       LPCWSTR               pwszNameIn
01948     , const unsigned char * pbValueIn
01949     , size_t                cbValueIn
01950     , const unsigned char * pbPrevValueIn
01951     , size_t                cbPrevValueIn
01952     )
01953 {
01954     ASSERT( pwszNameIn != NULL );
01955
01956     DWORD                   sc = ERROR_SUCCESS;
01957     BOOL                    _fChanged = FALSE;
01958     PCLUSPROP_PROPERTY_NAME pName = NULL;
01959     PCLUSPROP_BINARY        pValue = NULL;
01960
01961     //
01962     // Determine if the buffer has changed.
01963     //
01964
01965     if ( m_fAlwaysAddProp || (cbValueIn != cbPrevValueIn) )
01966     {
01967         _fChanged = TRUE;
01968     } // if: always adding the property or the value size changed
01969     else if ( ( cbValueIn != 0 ) && ( cbPrevValueIn != 0 ) )
01970     {
01971         _fChanged = memcmp( pbValueIn, pbPrevValueIn, cbValueIn ) != 0;
01972     } // else if: value length changed
01973
01974     if ( _fChanged )
01975     {
01976         size_t  cbNameSize = 0;
01977         size_t  cbValueSize = 0;
01978
01979         //
01980         // Calculate sizes and make sure we have a property list.
01981         //
01982
01983         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
01984                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
01985
01986         cbValueSize = sizeof( CLUSPROP_BINARY )
01987                     + ALIGN_CLUSPROP( cbValueIn )
01988                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
01989
01990         sc = ScAllocPropList( cbNameSize + cbValueSize );
01991         if ( sc == ERROR_SUCCESS )
01992         {
01993             //
01994             // Set the property name.
01995             //
01996
01997             pName = m_cbhCurrentProp.pName;
01998             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
01999             m_cbhCurrentProp.pb += cbNameSize;
02000
02001             //
02002             // Set the property value.
02003             //
02004
02005             pValue = m_cbhCurrentProp.pBinaryValue;
02006             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, pbValueIn, cbValueIn );
02007             m_cbhCurrentProp.pb += cbValueSize;
02008
02009             //
02010             // Increment the property count and buffer size.
02011             //
02012
02013             m_cbhPropList.pList->nPropertyCount++;
02014             m_cbDataSize += cbNameSize + cbValueSize;
02015         } // if: ScAllocPropList successfully grew the proplist
02016     } // if: the value has changed
02017
02018     return sc;
02019
02020 } //*** CClusPropList::ScAddProp( const unsigned char * )
02021
02022 /////////////////////////////////////////////////////////////////////////////
02023 //++
02024 //
02025 //  CClusPropList::ScAddProp
02026 //
02027 //  Routine Description:
02028 //      Add a ULONGLONG property to a property list if it has changed.
02029 //
02030 //  Arguments:
02031 //      pwszNameIn        Name of the property.
02032 //      ullValueIn        Value of the property to set in the list.
02033 //      ullPrevValueIn    Previous value of the property.
02034 //
02035 //  Return Value:
02036 //      ERROR_SUCCESS or other Win32 error codes.
02037 //
02038 //--
02039 /////////////////////////////////////////////////////////////////////////////
02040 DWORD
02041 CClusPropList::ScAddProp(
02042       LPCWSTR   pwszNameIn
02043     , ULONGLONG ullValueIn
02044     , ULONGLONG ullPrevValueIn
02045     )
02046 {
02047     ASSERT( pwszNameIn != NULL );
02048
02049     DWORD                       sc = ERROR_SUCCESS;
02050     PCLUSPROP_PROPERTY_NAME     pName = NULL;
02051     PCLUSPROP_ULARGE_INTEGER    pValue = NULL;
02052
02053     if ( m_fAlwaysAddProp || ( ullValueIn != ullPrevValueIn ) )
02054     {
02055         size_t  cbNameSize = 0;
02056         size_t  cbValueSize = 0;
02057
02058         //
02059         // Calculate sizes and make sure we have a property list.
02060         //
02061
02062         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
02063                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
02064
02065         cbValueSize = sizeof( CLUSPROP_ULARGE_INTEGER )
02066                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
02067
02068         sc = ScAllocPropList( cbNameSize + cbValueSize );
02069         if ( sc == ERROR_SUCCESS )
02070         {
02071             //
02072             // Set the property name.
02073             //
02074
02075             pName = m_cbhCurrentProp.pName;
02076             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
02077             m_cbhCurrentProp.pb += cbNameSize;
02078
02079             //
02080             // Set the property value.
02081             //
02082
02083             pValue = m_cbhCurrentProp.pULargeIntegerValue;
02084             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, ullValueIn );
02085             m_cbhCurrentProp.pb += cbValueSize;
02086
02087             //
02088             // Increment the property count and buffer size.
02089             //
02090
02091             m_cbhPropList.pList->nPropertyCount++;
02092             m_cbDataSize += cbNameSize + cbValueSize;
02093         } // if: ScAllocPropList successfully grew the proplist
02094     } // if: the value has changed
02095
02096     return sc;
02097
02098 } //*** CClusPropList::ScAddProp( ULONGLONG )
02099
02100 /////////////////////////////////////////////////////////////////////////////
02101 //++
02102 //
02103 //  CClusPropList::ScAddProp
02104 //
02105 //  Routine Description:
02106 //      Add a LONGLONG property to a property list if it has changed.
02107 //
02108 //  Arguments:
02109 //      pwszNameIn        Name of the property.
02110 //      llValueIn         Value of the property to set in the list.
02111 //      llPrevValueIn     Previous value of the property.
02112 //
02113 //  Return Value:
02114 //      ERROR_SUCCESS or other Win32 status codes.
02115 //
02116 //--
02117 /////////////////////////////////////////////////////////////////////////////
02118 DWORD
02119 CClusPropList::ScAddProp(
02120       LPCWSTR      pwszNameIn
02121     , LONGLONG     llValueIn
02122     , LONGLONG     llPrevValueIn
02123     )
02124 {
02125     ASSERT( pwszNameIn != NULL );
02126
02127     DWORD                       sc = ERROR_SUCCESS;
02128     PCLUSPROP_PROPERTY_NAME     pName = NULL;
02129     PCLUSPROP_LARGE_INTEGER     pValue = NULL;
02130
02131     if ( m_fAlwaysAddProp || ( llValueIn != llPrevValueIn ) )
02132     {
02133         size_t  cbNameSize = 0;
02134         size_t  cbValueSize = 0;
02135
02136         //
02137         // Calculate sizes and make sure we have a property list.
02138         //
02139
02140         cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
02141                     + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
02142
02143         cbValueSize = sizeof( CLUSPROP_LARGE_INTEGER )
02144                     + sizeof( CLUSPROP_SYNTAX ); // value list endmark
02145
02146         sc = ScAllocPropList( cbNameSize + cbValueSize );
02147         if ( sc == ERROR_SUCCESS )
02148         {
02149             //
02150             // Set the property name.
02151             //
02152
02153             pName = m_cbhCurrentProp.pName;
02154             CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
02155             m_cbhCurrentProp.pb += cbNameSize;
02156
02157             //
02158             // Set the property value.
02159             //
02160
02161             pValue = m_cbhCurrentProp.pLargeIntegerValue;
02162             CopyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, llValueIn );
02163             m_cbhCurrentProp.pb += cbValueSize;
02164
02165             //
02166             // Increment the property count and buffer size.
02167             //
02168
02169             m_cbhPropList.pList->nPropertyCount++;
02170             m_cbDataSize += cbNameSize + cbValueSize;
02171         } // if: ScAllocPropList successfully grew the proplist
02172     } // if: the value has changed
02173
02174     return sc;
02175
02176 } //*** CClusPropList::ScAddProp( LONGLONG )
02177
02178 /////////////////////////////////////////////////////////////////////////////
02179 //++
02180 //
02181 //  CClusPropList::ScSetPropToDefault
02182 //
02183 //  Description:
02184 //      Add a property to the property list so that it will revert to its
02185 //      default value.
02186 //
02187 //  Arguments:
02188 //      pwszNameIn          Name of the property.
02189 //      cpfPropFormatIn     Format of property
02190 //
02191 //  Return Value:
02192 //      ERROR_SUCCESS or other Win32 status codes.
02193 //
02194 //--
02195 /////////////////////////////////////////////////////////////////////////////
02196 DWORD
02197 CClusPropList::ScSetPropToDefault(
02198       LPCWSTR                   pwszNameIn
02199     , CLUSTER_PROPERTY_FORMAT   cpfPropFormatIn
02200     )
02201 {
02202     ASSERT( pwszNameIn != NULL );
02203
02204     DWORD                   sc = ERROR_SUCCESS;
02205     size_t                  cbNameSize = 0;
02206     size_t                  cbValueSize = 0;
02207     PCLUSPROP_PROPERTY_NAME pName = NULL;
02208     PCLUSPROP_VALUE         pValue = NULL;
02209
02210     //
02211     //  Calculate sizes and make sure we have a property list.
02212     //
02213
02214     cbNameSize = sizeof( CLUSPROP_PROPERTY_NAME )
02215                 + ALIGN_CLUSPROP( (lstrlenW( pwszNameIn ) + 1) * sizeof( *pwszNameIn ) );
02216
02217     cbValueSize = sizeof( CLUSPROP_BINARY )
02218                 + sizeof( CLUSPROP_SYNTAX ); // value list endmark
02219
02220     sc = ScAllocPropList( cbNameSize + cbValueSize );
02221     if ( sc == ERROR_SUCCESS )
02222     {
02223         //
02224         // Set the property name.
02225         //
02226
02227         pName = m_cbhCurrentProp.pName;
02228         CopyProp( pName, CLUSPROP_TYPE_NAME, pwszNameIn );
02229         m_cbhCurrentProp.pb += cbNameSize;
02230
02231         //
02232         // Set the property value.
02233         //
02234
02235         pValue = m_cbhCurrentProp.pValue;
02236         CopyEmptyProp( pValue, CLUSPROP_TYPE_LIST_VALUE, cpfPropFormatIn );
02237         m_cbhCurrentProp.pb += cbValueSize;
02238
02239         //
02240         // Increment the property count and buffer size.
02241         //
02242
02243         m_cbhPropList.pList->nPropertyCount++;
02244         m_cbDataSize += cbNameSize + cbValueSize;
02245     } // if:
02246
02247     return sc;
02248
02249 } //*** CClusPropList::ScSetPropToDefault
02250
02251 /////////////////////////////////////////////////////////////////////////////
02252 //++
02253 //
02254 //  CClusPropList::CopyProp
02255 //
02256 //  Description:
02257 //      Copy a string property to a property structure.
02258 //
02259 //  Arguments:
02260 //      ppropOut      Property structure to fill.
02261 //      cptPropTypeIn Type of string.
02262 //      pszIn         String to copy.
02263 //      cbSzIn        Count of bytes in pwsz string.  If specified as 0,
02264 //                    the the length will be determined by a call to strlen.
02265 //
02266 //  Return Value:
02267 //      None.
02268 //
02269 //--
02270 /////////////////////////////////////////////////////////////////////////////
02271 void
02272 CClusPropList::CopyProp(
02273       PCLUSPROP_SZ          ppropOut
02274     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02275     , LPCWSTR               pszIn
02276     , size_t                cbSzIn        // = 0
02277     )
02278 {
02279     ASSERT( ppropOut != NULL );
02280     ASSERT( pszIn != NULL );
02281
02282     CLUSPROP_BUFFER_HELPER  cbhProps;
02283     HRESULT                 hr = S_OK;
02284
02285     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_SZ;
02286     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02287
02288     if ( cbSzIn == 0 )
02289     {
02290         cbSzIn = (lstrlenW( pszIn ) + 1) * sizeof( *pszIn );
02291     } // if: zero size specified
02292
02293     ASSERT( cbSzIn == (lstrlenW( pszIn ) + 1) * sizeof( *pszIn ) );
02294
02295     ppropOut->cbLength = static_cast< DWORD >( cbSzIn );
02296
02297     hr = StringCbCopyW( ppropOut->sz, cbSzIn, pszIn );
02298     if ( SUCCEEDED( hr ) )
02299     {
02300         //
02301         // Set an endmark.
02302         //
02303
02304         cbhProps.pStringValue = ppropOut;
02305         cbhProps.pb += sizeof( *cbhProps.pStringValue ) + ALIGN_CLUSPROP( cbSzIn );
02306         cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02307     } // if:
02308
02309 } //*** CClusPropList::CopyProp
02310
02311 /////////////////////////////////////////////////////////////////////////////
02312 //++
02313 //
02314 //  CClusPropList::CopyMultiSzProp
02315 //
02316 //  Description:
02317 //      Copy a MULTI_SZ string property to a property structure.
02318 //
02319 //  Arguments:
02320 //      ppropOut      Property structure to fill.
02321 //      cptPropTypeIn Type of string.
02322 //      pszIn         String to copy.
02323 //      cbSzIn        Count of bytes in pszIn string.  If specified as 0,
02324 //                    the the length will be determined by calls to strlen.
02325 //
02326 //  Return Value:
02327 //      None.
02328 //
02329 //--
02330 /////////////////////////////////////////////////////////////////////////////
02331 void
02332 CClusPropList::CopyMultiSzProp(
02333       PCLUSPROP_MULTI_SZ    ppropOut
02334     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02335     , LPCWSTR               pszIn
02336     , size_t                cbSzIn
02337     )
02338 {
02339     ASSERT( ppropOut != NULL );
02340     ASSERT( pszIn != NULL );
02341
02342     CLUSPROP_BUFFER_HELPER  cbhProps;
02343
02344     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_MULTI_SZ;
02345     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02346
02347     if ( cbSzIn == 0 )
02348     {
02349         cbSzIn = (CchMultiSz( pszIn ) + 1) * sizeof( *pszIn );
02350     } // if: zero size specified
02351
02352     ASSERT( cbSzIn == (CchMultiSz( pszIn ) + 1) * sizeof( *pszIn ) );
02353
02354     ppropOut->cbLength = static_cast< DWORD >( cbSzIn );
02355     CopyMemory( ppropOut->sz, pszIn, cbSzIn );
02356
02357     //
02358     // Set an endmark.
02359     //
02360
02361     cbhProps.pMultiSzValue = ppropOut;
02362     cbhProps.pb += sizeof( *cbhProps.pMultiSzValue ) + ALIGN_CLUSPROP( cbSzIn );
02363     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02364
02365 } //*** CClusPropList::CopyMultiSzProp
02366
02367 /////////////////////////////////////////////////////////////////////////////
02368 //++
02369 //
02370 //  CClusPropList::CopyExpandSzProp
02371 //
02372 //  Description:
02373 //      Copy an EXPAND_SZ string property to a property structure.
02374 //
02375 //  Arguments:
02376 //      ppropOut      Property structure to fill.
02377 //      cptPropTypeIn Type of string.
02378 //      pszIn         String to copy.
02379 //      cbSzIn        Count of bytes in pszIn string.
02380 //
02381 //  Return Value:
02382 //      None.
02383 //
02384 //--
02385 /////////////////////////////////////////////////////////////////////////////
02386 void
02387 CClusPropList::CopyExpandSzProp(
02388       PCLUSPROP_SZ          ppropOut
02389     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02390     , LPCWSTR               pszIn
02391     , size_t                cbSzIn
02392     )
02393 {
02394     ASSERT( ppropOut != NULL );
02395     ASSERT( pszIn != NULL );
02396
02397     CLUSPROP_BUFFER_HELPER  cbhProps;
02398     HRESULT                 hr = S_OK;
02399
02400     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_EXPAND_SZ;
02401     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02402
02403     if ( cbSzIn == 0 )
02404     {
02405         cbSzIn = (lstrlenW( pszIn ) + 1) * sizeof( *pszIn );
02406     } // if: cbSzIn == 0
02407
02408     ASSERT( cbSzIn == (lstrlenW( pszIn ) + 1) * sizeof( *pszIn ) );
02409
02410     ppropOut->cbLength = static_cast< DWORD >( cbSzIn );
02411
02412     hr = StringCbCopyW( ppropOut->sz, cbSzIn, pszIn );
02413     if ( SUCCEEDED( hr ) )
02414     {
02415         //
02416         // Set an endmark.
02417         //
02418
02419         cbhProps.pStringValue = ppropOut;
02420         cbhProps.pb += sizeof( *cbhProps.pStringValue ) + ALIGN_CLUSPROP( cbSzIn );
02421         cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02422     } // if:
02423
02424 } //*** CClusPropList::CopyExpandSzProp
02425
02426 /////////////////////////////////////////////////////////////////////////////
02427 //++
02428 //
02429 //  CClusPropList::CopyProp
02430 //
02431 //  Description:
02432 //      Copy a DWORD property to a property structure.
02433 //
02434 //  Arguments:
02435 //      ppropOut      Property structure to fill.
02436 //      cptPropTypeIn Type of DWORD.
02437 //      nValueIn      Property value to copy.
02438 //
02439 //  Return Value:
02440 //      None.
02441 //
02442 //--
02443 /////////////////////////////////////////////////////////////////////////////
02444 void
02445 CClusPropList::CopyProp(
02446       PCLUSPROP_DWORD       ppropOut
02447     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02448     , DWORD                 nValueIn
02449     )
02450 {
02451     ASSERT( ppropOut != NULL );
02452
02453     CLUSPROP_BUFFER_HELPER  cbhProps;
02454
02455     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_DWORD;
02456     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02457     ppropOut->cbLength = sizeof( DWORD );
02458     ppropOut->dw = nValueIn;
02459
02460     //
02461     // Set an endmark.
02462     //
02463
02464     cbhProps.pDwordValue = ppropOut;
02465     cbhProps.pb += sizeof( *cbhProps.pDwordValue );
02466     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02467
02468 } //*** CClusPropList::CopyProp( DWORD )
02469
02470 /////////////////////////////////////////////////////////////////////////////
02471 //++
02472 //
02473 //  CClusPropList::CopyProp
02474 //
02475 //  Description:
02476 //      Copy a LONG property to a property structure.
02477 //
02478 //  Arguments:
02479 //      ppropOut      Property structure to fill.
02480 //      cptPropTypeIn Type of LONG.
02481 //      nValueIn      Property value to copy.
02482 //
02483 //  Return Value:
02484 //      None.
02485 //
02486 //--
02487 /////////////////////////////////////////////////////////////////////////////
02488 void
02489 CClusPropList::CopyProp(
02490       PCLUSPROP_LONG        ppropOut
02491     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02492     , LONG                  nValueIn
02493     )
02494 {
02495     ASSERT( ppropOut != NULL );
02496
02497     CLUSPROP_BUFFER_HELPER  cbhProps;
02498
02499     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_LONG;
02500     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02501     ppropOut->cbLength = sizeof( DWORD );
02502     ppropOut->l = nValueIn;
02503
02504     //
02505     // Set an endmark.
02506     //
02507
02508     cbhProps.pLongValue = ppropOut;
02509     cbhProps.pb += sizeof( *cbhProps.pLongValue );
02510     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02511
02512 } //*** CClusPropList::CopyProp( LONG )
02513
02514 /////////////////////////////////////////////////////////////////////////////
02515 //++
02516 //
02517 //  CClusPropList::CopyProp
02518 //
02519 //  Description:
02520 //      Copy a ULONGLONG property to a property structure.
02521 //
02522 //  Arguments:
02523 //      ppropOut        Property structure to fill.
02524 //      cptPropTypeIn   Type of LONG.
02525 //      ullValueIn      Property value to copy.
02526 //
02527 //  Return Value:
02528 //      None.
02529 //
02530 //--
02531 /////////////////////////////////////////////////////////////////////////////
02532 void
02533 CClusPropList::CopyProp(
02534       PCLUSPROP_ULARGE_INTEGER  ppropOut
02535     , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
02536     , ULONGLONG                 ullValueIn
02537     )
02538 {
02539     ASSERT( ppropOut != NULL );
02540
02541     CLUSPROP_BUFFER_HELPER  cbhProps;
02542
02543     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_ULARGE_INTEGER;
02544     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02545     ppropOut->cbLength = sizeof( ULONGLONG );
02546
02547     //
02548     // ppropOut may not have the correct alignment for large ints; copy as two
02549     // DWORDs to be safe
02550     //
02551
02552     ppropOut->li.u = ((ULARGE_INTEGER *)&ullValueIn)->u;
02553
02554     //
02555     // Set an endmark.
02556     //
02557
02558     cbhProps.pULargeIntegerValue = ppropOut;
02559     cbhProps.pb += sizeof( *cbhProps.pULargeIntegerValue );
02560     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02561
02562 } //*** CClusPropList::CopyProp( ULONGLONG )
02563
02564 /////////////////////////////////////////////////////////////////////////////
02565 //++
02566 //
02567 //  CClusPropList::CopyProp
02568 //
02569 //  Description:
02570 //      Copy a LONGLONG property to a property structure.
02571 //
02572 //  Arguments:
02573 //      ppropOut        Property structure to fill.
02574 //      cptPropTypeIn   Type of LONG.
02575 //      llValueIn       Property value to copy.
02576 //
02577 //  Return Value:
02578 //      None.
02579 //
02580 //--
02581 /////////////////////////////////////////////////////////////////////////////
02582 void
02583 CClusPropList::CopyProp(
02584       PCLUSPROP_LARGE_INTEGER   ppropOut
02585     , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
02586     , LONGLONG                  llValueIn
02587     )
02588 {
02589     ASSERT( ppropOut != NULL );
02590
02591     CLUSPROP_BUFFER_HELPER  cbhProps;
02592
02593     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_LARGE_INTEGER;
02594     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02595     ppropOut->cbLength = sizeof( LONGLONG );
02596
02597     //
02598     // ppropOut may not have the correct alignment for large ints; copy as two
02599     // DWORDs to be safe
02600     //
02601
02602     ppropOut->li.u = ((LARGE_INTEGER *)&llValueIn)->u;
02603
02604     //
02605     // Set an endmark.
02606     //
02607
02608     cbhProps.pLargeIntegerValue = ppropOut;
02609     cbhProps.pb += sizeof( *cbhProps.pLargeIntegerValue );
02610     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02611
02612 } //*** CClusPropList::CopyProp( LONGLONG )
02613
02614 /////////////////////////////////////////////////////////////////////////////
02615 //++
02616 //
02617 //  CClusPropList::CopyProp
02618 //
02619 //  Description:
02620 //      Copy a binary property to a property structure.
02621 //
02622 //  Arguments:
02623 //      ppropOut        Property structure to fill.
02624 //      cptPropTypeIn   Type of string.
02625 //      pbValueIn       Block to copy.
02626 //      cbValueIn       Count of bytes in pb buffer.
02627 //
02628 //  Return Value:
02629 //      None.
02630 //
02631 //--
02632 /////////////////////////////////////////////////////////////////////////////
02633 void
02634 CClusPropList::CopyProp(
02635       PCLUSPROP_BINARY      ppropOut
02636     , CLUSTER_PROPERTY_TYPE cptPropTypeIn
02637     , const unsigned char * pbValueIn
02638     , size_t                cbValueIn
02639     )
02640 {
02641     ASSERT( ppropOut != NULL );
02642
02643     CLUSPROP_BUFFER_HELPER  cbhProps;
02644
02645     ppropOut->Syntax.wFormat = CLUSPROP_FORMAT_BINARY;
02646     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02647     ppropOut->cbLength = static_cast< DWORD >( cbValueIn );
02648
02649     if ( cbValueIn > 0 )
02650     {
02651         CopyMemory( ppropOut->rgb, pbValueIn, cbValueIn );
02652     } // if: non-zero data length
02653
02654     //
02655     // Set an endmark.
02656     //
02657
02658     cbhProps.pBinaryValue = ppropOut;
02659     cbhProps.pb += sizeof( *cbhProps.pStringValue ) + ALIGN_CLUSPROP( cbValueIn );
02660     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02661
02662 } //*** CClusPropList::CopyProp( PBYTE )
02663
02664 /////////////////////////////////////////////////////////////////////////////
02665 //++
02666 //
02667 //  CClusPropList::CopyEmptyProp
02668 //
02669 //  Description:
02670 //      Copy an empty property to a property structure.
02671 //
02672 //  Arguments:
02673 //      ppropOut            Property structure to fill.
02674 //      cptPropTypeIn       Type of property.
02675 //      cpfPropFormatIn     Format of property.
02676 //
02677 //  Return Value:
02678 //      None.
02679 //
02680 //--
02681 /////////////////////////////////////////////////////////////////////////////
02682 void
02683 CClusPropList::CopyEmptyProp(
02684       PCLUSPROP_VALUE           ppropOut
02685     , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
02686     , CLUSTER_PROPERTY_FORMAT   cptPropFmt
02687     )
02688 {
02689     ASSERT( ppropOut != NULL );
02690
02691     CLUSPROP_BUFFER_HELPER  cbhProps;
02692
02693     ppropOut->Syntax.wFormat = static_cast< WORD >( cptPropFmt );
02694     ppropOut->Syntax.wType = static_cast< WORD >( cptPropTypeIn );
02695     ppropOut->cbLength = 0;
02696
02697     //
02698     // Set an endmark.
02699     //
02700
02701     cbhProps.pValue = ppropOut;
02702     cbhProps.pb += sizeof( *cbhProps.pValue );
02703     cbhProps.pSyntax->dw = CLUSPROP_SYNTAX_ENDMARK;
02704
02705 } //*** CClusPropList::CopyEmptyProp
02706
02707 /////////////////////////////////////////////////////////////////////////////
02708 //++
02709 //
02710 //  CClusPropList::ScGetNodeProperties
02711 //
02712 //  Description:
02713 //      Get properties on a node.
02714 //
02715 //  Arguments:
02716 //      hNodeIn           Handle for the node to get properties from.
02717 //      dwControlCodeIn   Control code for the request.
02718 //      hHostNodeIn       Handle for the node to direct this request to.
02719 //                        Defaults to NULL.
02720 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02721 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02722 //
02723 //  Return Value:
02724 //      None.
02725 //
02726 //--
02727 /////////////////////////////////////////////////////////////////////////////
02728 DWORD
02729 CClusPropList::ScGetNodeProperties(
02730       HNODE     hNodeIn
02731     , DWORD     dwControlCodeIn
02732     , HNODE     hHostNodeIn
02733     , LPVOID    lpBufferIn              // = NULL
02734     , size_t    cbBufferIn              // = 0
02735     )
02736 {
02737     ASSERT( hNodeIn != NULL );
02738     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02739             == ( CLUS_OBJECT_NODE << CLUSCTL_OBJECT_SHIFT ) );
02740
02741     DWORD   sc = ERROR_SUCCESS;
02742     DWORD   cbProps = 256;
02743
02744     //
02745     // Overwrite anything that may be in the buffer.
02746     // Allows this class instance to be reused.
02747     //
02748
02749     m_cbDataSize = 0;
02750
02751     //
02752     // Get properties.
02753     //
02754
02755     sc = ScAllocPropList( cbProps );
02756     if ( sc == ERROR_SUCCESS )
02757     {
02758         sc = ClusterNodeControl(
02759                           hNodeIn
02760                         , hHostNodeIn
02761                         , dwControlCodeIn
02762                         , lpBufferIn
02763                         , static_cast< DWORD >( cbBufferIn )
02764                         , m_cbhPropList.pb
02765                         , static_cast< DWORD >( m_cbBufferSize )
02766                         , &cbProps
02767                         );
02768         if ( sc == ERROR_MORE_DATA )
02769         {
02770             sc = ScAllocPropList( cbProps );
02771             if ( sc == ERROR_SUCCESS )
02772             {
02773                 sc = ClusterNodeControl(
02774                                   hNodeIn
02775                                 , hHostNodeIn
02776                                 , dwControlCodeIn
02777                                 , lpBufferIn
02778                                 , static_cast< DWORD >( cbBufferIn )
02779                                 , m_cbhPropList.pb
02780                                 , static_cast< DWORD >( m_cbBufferSize )
02781                                 , &cbProps
02782                                 );
02783             } // if: ScAllocPropList succeeded
02784         } // if: buffer too small
02785     } // if: ScAllocPropList succeeded
02786
02787     if ( sc != ERROR_SUCCESS )
02788     {
02789         DeletePropList();
02790     } // if: error getting properties.
02791     else
02792     {
02793         m_cbDataSize = static_cast< size_t >( cbProps );
02794         m_cbDataLeft = static_cast< size_t >( cbProps );
02795     } // else: no errors
02796
02797     return sc;
02798
02799 } //*** CClusPropList::ScGetNodeProperties
02800
02801 /////////////////////////////////////////////////////////////////////////////
02802 //++
02803 //
02804 //  CClusPropList::ScGetGroupProperties
02805 //
02806 //  Description:
02807 //      Get properties on a group.
02808 //
02809 //  Arguments:
02810 //      hGroupIn          Handle for the group to get properties from.
02811 //      dwControlCodeIn   Control code for the request.
02812 //      hHostNodeIn       Handle for the node to direct this request to.
02813 //                        Defaults to NULL.
02814 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02815 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02816 //
02817 //  Return Value:
02818 //      None.
02819 //
02820 //--
02821 /////////////////////////////////////////////////////////////////////////////
02822 DWORD
02823 CClusPropList::ScGetGroupProperties(
02824       HGROUP    hGroupIn
02825     , DWORD     dwControlCodeIn
02826     , HNODE     hHostNodeIn
02827     , LPVOID    lpBufferIn          // = NULL
02828     , size_t    cbBufferIn          // = 0
02829     )
02830 {
02831     ASSERT( hGroupIn != NULL );
02832     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02833             == ( CLUS_OBJECT_GROUP << CLUSCTL_OBJECT_SHIFT ) );
02834
02835     DWORD   sc = ERROR_SUCCESS;
02836     DWORD   cbProps = 256;
02837
02838     //
02839     // Overwrite anything that may be in the buffer.
02840     // Allows this class instance to be reused.
02841     //
02842
02843     m_cbDataSize = 0;
02844
02845     //
02846     // Get properties.
02847     //
02848
02849     sc = ScAllocPropList( cbProps );
02850     if ( sc == ERROR_SUCCESS )
02851     {
02852         sc = ClusterGroupControl(
02853                           hGroupIn
02854                         , hHostNodeIn
02855                         , dwControlCodeIn
02856                         , lpBufferIn
02857                         , static_cast< DWORD >( cbBufferIn )
02858                         , m_cbhPropList.pb
02859                         , static_cast< DWORD >( m_cbBufferSize )
02860                         , &cbProps
02861                         );
02862         if ( sc == ERROR_MORE_DATA )
02863         {
02864             sc = ScAllocPropList( cbProps );
02865             if ( sc == ERROR_SUCCESS )
02866             {
02867                 sc = ClusterGroupControl(
02868                                   hGroupIn
02869                                 , hHostNodeIn
02870                                 , dwControlCodeIn
02871                                 , lpBufferIn
02872                                 , static_cast< DWORD >( cbBufferIn )
02873                                 , m_cbhPropList.pb
02874                                 , static_cast< DWORD >( m_cbBufferSize )
02875                                 , &cbProps
02876                                 );
02877             } // if: ScAllocPropList succeeded
02878         } // if: buffer too small
02879     } // if: ScAllocPropList succeeded
02880
02881     if ( sc != ERROR_SUCCESS )
02882     {
02883         DeletePropList();
02884     } // if: error getting properties.
02885     else
02886     {
02887         m_cbDataSize = static_cast< size_t >( cbProps );
02888         m_cbDataLeft = static_cast< size_t >( cbProps );
02889     } // else: no errors
02890
02891     return sc;
02892
02893 } //*** CClusPropList::ScGetGroupProperties
02894
02895 /////////////////////////////////////////////////////////////////////////////
02896 //++
02897 //
02898 //  CClusPropList::ScGetResourceProperties
02899 //
02900 //  Description:
02901 //      Get properties on a resource.
02902 //
02903 //  Arguments:
02904 //      hResourceIn       Handle for the resource to get properties from.
02905 //      dwControlCodeIn   Control code for the request.
02906 //      hHostNodeIn       Handle for the node to direct this request to.
02907 //                        Defaults to NULL.
02908 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
02909 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
02910 //
02911 //  Return Value:
02912 //      None.
02913 //
02914 //--
02915 /////////////////////////////////////////////////////////////////////////////
02916 DWORD
02917 CClusPropList::ScGetResourceProperties(
02918       HRESOURCE hResourceIn
02919     , DWORD     dwControlCodeIn
02920     , HNODE     hHostNodeIn
02921     , LPVOID    lpBufferIn          // = NULL
02922     , size_t    cbBufferIn          // = 0
02923     )
02924 {
02925     ASSERT( hResourceIn != NULL );
02926     ASSERT( ( dwControlCodeIn & (CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
02927             == ( CLUS_OBJECT_RESOURCE << CLUSCTL_OBJECT_SHIFT ) );
02928
02929     DWORD   sc = ERROR_SUCCESS;
02930     DWORD   cbProps = 256;
02931
02932     //
02933     // Overwrite anything that may be in the buffer.
02934     // Allows this class instance to be reused.
02935     //
02936
02937     m_cbDataSize = 0;
02938
02939     //
02940     // Get properties.
02941     //
02942
02943     sc = ScAllocPropList( cbProps );
02944     if ( sc == ERROR_SUCCESS )
02945     {
02946         sc = ClusterResourceControl(
02947                           hResourceIn
02948                         , hHostNodeIn
02949                         , dwControlCodeIn
02950                         , lpBufferIn
02951                         , static_cast< DWORD >( cbBufferIn )
02952                         , m_cbhPropList.pb
02953                         , static_cast< DWORD >( m_cbBufferSize )
02954                         , &cbProps
02955                         );
02956         if ( sc == ERROR_MORE_DATA )
02957         {
02958             sc = ScAllocPropList( cbProps );
02959             if ( sc == ERROR_SUCCESS )
02960             {
02961                 sc = ClusterResourceControl(
02962                                   hResourceIn
02963                                 , hHostNodeIn
02964                                 , dwControlCodeIn
02965                                 , lpBufferIn
02966                                 , static_cast< DWORD >( cbBufferIn )
02967                                 , m_cbhPropList.pb
02968                                 , static_cast< DWORD >( m_cbBufferSize )
02969                                 , &cbProps
02970                                 );
02971             } // if: ScAllocPropList succeeded
02972         } // if: buffer too small
02973     } // if: ScAllocPropList succeeded
02974
02975     if ( sc != ERROR_SUCCESS )
02976     {
02977         DeletePropList();
02978     } // if: error getting properties.
02979     else
02980     {
02981         m_cbDataSize = static_cast< size_t >( cbProps );
02982         m_cbDataLeft = static_cast< size_t >( cbProps );
02983     } // else: no errors
02984
02985     return sc;
02986
02987 } //*** CClusPropList::ScGetResourceProperties
02988
02989 /////////////////////////////////////////////////////////////////////////////
02990 //++
02991 //
02992 //  CClusPropList::ScGetResourceTypeProperties
02993 //
02994 //  Description:
02995 //      Get properties on a resource type.
02996 //
02997 //  Arguments:
02998 //      hClusterIn        Handle for the cluster in which the resource
02999 //                        type resides.
03000 //      pwszResTypeNameIn Name of the resource type.
03001 //      dwControlCodeIn   Control code for the request.
03002 //      hHostNodeIn       Handle for the node to direct this request to.
03003 //                        Defaults to NULL.
03004 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
03005 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
03006 //
03007 //  Return Value:
03008 //      None.
03009 //
03010 //--
03011 /////////////////////////////////////////////////////////////////////////////
03012 DWORD
03013 CClusPropList::ScGetResourceTypeProperties(
03014       HCLUSTER  hClusterIn
03015     , LPCWSTR   pwszResTypeNameIn
03016     , DWORD     dwControlCodeIn
03017     , HNODE     hHostNodeIn
03018     , LPVOID    lpBufferIn          // = NULL
03019     , size_t    cbBufferIn          // = 0
03020     )
03021 {
03022     ASSERT( hClusterIn != NULL );
03023     ASSERT( pwszResTypeNameIn != NULL );
03024     ASSERT( *pwszResTypeNameIn != L'\0' );
03025     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
03026             == ( CLUS_OBJECT_RESOURCE_TYPE << CLUSCTL_OBJECT_SHIFT ) );
03027
03028     DWORD   sc = ERROR_SUCCESS;
03029     DWORD   cbProps = 256;
03030
03031     //
03032     // Overwrite anything that may be in the buffer.
03033     // Allows this class instance to be reused.
03034     //
03035
03036     m_cbDataSize = 0;
03037
03038     //
03039     // Get properties.
03040     //
03041
03042     sc = ScAllocPropList( cbProps );
03043     if ( sc == ERROR_SUCCESS )
03044     {
03045         sc = ClusterResourceTypeControl(
03046                           hClusterIn
03047                         , pwszResTypeNameIn
03048                         , hHostNodeIn
03049                         , dwControlCodeIn
03050                         , lpBufferIn
03051                         , static_cast< DWORD >( cbBufferIn )
03052                         , m_cbhPropList.pb
03053                         , static_cast< DWORD >( m_cbBufferSize )
03054                         , &cbProps
03055                         );
03056         if ( sc == ERROR_MORE_DATA )
03057         {
03058             sc = ScAllocPropList( cbProps );
03059             if ( sc == ERROR_SUCCESS )
03060             {
03061                 sc = ClusterResourceTypeControl(
03062                                   hClusterIn
03063                                 , pwszResTypeNameIn
03064                                 , hHostNodeIn
03065                                 , dwControlCodeIn
03066                                 , lpBufferIn
03067                                 , static_cast< DWORD >( cbBufferIn )
03068                                 , m_cbhPropList.pb
03069                                 , static_cast< DWORD >( m_cbBufferSize )
03070                                 , &cbProps
03071                                 );
03072             } // if: ScAllocPropList succeeded
03073         } // if: buffer too small
03074     } // if: ScAllocPropList succeeded
03075
03076     if ( sc != ERROR_SUCCESS )
03077     {
03078         DeletePropList();
03079     } // if: error getting properties.
03080     else
03081     {
03082         m_cbDataSize = static_cast< size_t >( cbProps );
03083         m_cbDataLeft = static_cast< size_t >( cbProps );
03084     } // else: no errors
03085
03086     return sc;
03087
03088 } //*** CClusPropList::ScGetResourceTypeProperties
03089
03090 /////////////////////////////////////////////////////////////////////////////
03091 //++
03092 //
03093 //  CClusPropList::ScGetNetworkProperties
03094 //
03095 //  Description:
03096 //      Get properties on a network.
03097 //
03098 //  Arguments:
03099 //      hNetworkIn        Handle for the network to get properties from.
03100 //      dwControlCodeIn   Control code for the request.
03101 //      hHostNodeIn       Handle for the node to direct this request to.
03102 //                        Defaults to NULL.
03103 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
03104 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
03105 //
03106 //  Return Value:
03107 //      None.
03108 //
03109 //--
03110 /////////////////////////////////////////////////////////////////////////////
03111 DWORD
03112 CClusPropList::ScGetNetworkProperties(
03113       HNETWORK  hNetworkIn
03114     , DWORD     dwControlCodeIn
03115     , HNODE     hHostNodeIn
03116     , LPVOID    lpBufferIn              // = NULL
03117     , size_t    cbBufferIn              // = 0
03118     )
03119 {
03120     ASSERT( hNetworkIn != NULL );
03121     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
03122             == ( CLUS_OBJECT_NETWORK << CLUSCTL_OBJECT_SHIFT ) );
03123
03124     DWORD   sc = ERROR_SUCCESS;
03125     DWORD   cbProps = 256;
03126
03127     //
03128     // Overwrite anything that may be in the buffer.
03129     // Allows this class instance to be reused.
03130     //
03131
03132     m_cbDataSize = 0;
03133
03134     //
03135     // Get properties.
03136     //
03137     sc = ScAllocPropList( cbProps );
03138     if ( sc == ERROR_SUCCESS )
03139     {
03140         sc = ClusterNetworkControl(
03141                           hNetworkIn
03142                         , hHostNodeIn
03143                         , dwControlCodeIn
03144                         , lpBufferIn
03145                         , static_cast< DWORD >( cbBufferIn )
03146                         , m_cbhPropList.pb
03147                         , static_cast< DWORD >( m_cbBufferSize )
03148                         , &cbProps
03149                         );
03150         if ( sc == ERROR_MORE_DATA )
03151         {
03152             sc = ScAllocPropList( cbProps );
03153             if ( sc == ERROR_SUCCESS )
03154             {
03155                 sc = ClusterNetworkControl(
03156                                   hNetworkIn
03157                                 , hHostNodeIn
03158                                 , dwControlCodeIn
03159                                 , lpBufferIn
03160                                 , static_cast< DWORD >( cbBufferIn )
03161                                 , m_cbhPropList.pb
03162                                 , static_cast< DWORD >( m_cbBufferSize )
03163                                 , &cbProps
03164                                 );
03165             } // if: ScAllocPropList succeeded
03166         } // if: buffer too small
03167     } // if: ScAllocPropList succeeded
03168
03169     if ( sc != ERROR_SUCCESS )
03170     {
03171         DeletePropList();
03172     } // if: error getting private properties.
03173     else
03174     {
03175         m_cbDataSize = static_cast< size_t >( cbProps );
03176         m_cbDataLeft = static_cast< size_t >( cbProps );
03177     } // else: no errors
03178
03179     return sc;
03180
03181 } //*** CClusPropList::ScGetNetworkProperties
03182
03183 /////////////////////////////////////////////////////////////////////////////
03184 //++
03185 //
03186 //  CClusPropList::ScGetNetInterfaceProperties
03187 //
03188 //  Description:
03189 //      Get properties on a network interface.
03190 //
03191 //  Arguments:
03192 //      hNetInterfaceIn   Handle for the network interface to get properties from.
03193 //      dwControlCodeIn   Control code for the request.
03194 //      hHostNodeIn       Handle for the node to direct this request to.
03195 //                        Defaults to NULL.
03196 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
03197 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
03198 //
03199 //  Return Value:
03200 //      None.
03201 //
03202 //--
03203 /////////////////////////////////////////////////////////////////////////////
03204 DWORD
03205 CClusPropList::ScGetNetInterfaceProperties(
03206       HNETINTERFACE hNetInterfaceIn
03207     , DWORD         dwControlCodeIn
03208     , HNODE         hHostNodeIn
03209     , LPVOID        lpBufferIn              // = NULL
03210     , size_t        cbBufferIn              // = 0
03211     )
03212 {
03213     ASSERT( hNetInterfaceIn != NULL );
03214     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
03215             == ( CLUS_OBJECT_NETINTERFACE << CLUSCTL_OBJECT_SHIFT ) );
03216
03217     DWORD   sc = ERROR_SUCCESS;
03218     DWORD   cbProps = 256;
03219
03220     //
03221     // Overwrite anything that may be in the buffer.
03222     // Allows this class instance to be reused.
03223     //
03224
03225     m_cbDataSize = 0;
03226
03227     //
03228     // Get properties.
03229     //
03230
03231     sc = ScAllocPropList( cbProps );
03232     if ( sc == ERROR_SUCCESS )
03233     {
03234         sc = ClusterNetInterfaceControl(
03235                           hNetInterfaceIn
03236                         , hHostNodeIn
03237                         , dwControlCodeIn
03238                         , lpBufferIn
03239                         , static_cast< DWORD >( cbBufferIn )
03240                         , m_cbhPropList.pb
03241                         , static_cast< DWORD >( m_cbBufferSize )
03242                         , &cbProps
03243                         );
03244         if ( sc == ERROR_MORE_DATA )
03245         {
03246             sc = ScAllocPropList( cbProps );
03247             if ( sc == ERROR_SUCCESS )
03248             {
03249                 sc = ClusterNetInterfaceControl(
03250                                   hNetInterfaceIn
03251                                 , hHostNodeIn
03252                                 , dwControlCodeIn
03253                                 , lpBufferIn
03254                                 , static_cast< DWORD >( cbBufferIn )
03255                                 , m_cbhPropList.pb
03256                                 , static_cast< DWORD >( m_cbBufferSize )
03257                                 , &cbProps
03258                                 );
03259             } // if: ScAllocPropList succeeded
03260         } // if: buffer too small
03261     } // if: ScAllocPropList succeeded
03262
03263     if ( sc != ERROR_SUCCESS )
03264     {
03265         DeletePropList();
03266     } // if: error getting private properties.
03267     else
03268     {
03269         m_cbDataSize = static_cast< size_t >( cbProps );
03270         m_cbDataLeft = static_cast< size_t >( cbProps );
03271     } // else: no errors
03272
03273     return sc;
03274
03275 } //*** CClusPropList::ScGetNetInterfaceProperties
03276
03277
03278 /////////////////////////////////////////////////////////////////////////////
03279 //++
03280 //
03281 //  CClusPropList::ScGetClusterProperties
03282 //
03283 //  Description:
03284 //      Get properties on a cluster.
03285 //
03286 //  Arguments:
03287 //      hClusterIn        Handle for the cluster to get properties from.
03288 //      dwControlCodeIn   Control code for the request.
03289 //      hHostNodeIn       Handle for the node to direct this request to.
03290 //                        Defaults to NULL.
03291 //      lpBufferIn        Input buffer for the request.  Defaults to NULL.
03292 //      cbBufferIn        Size of the input buffer.  Defaults to 0.
03293 //
03294 //  Return Value:
03295 //      None.
03296 //
03297 //--
03298 /////////////////////////////////////////////////////////////////////////////
03299 DWORD
03300 CClusPropList::ScGetClusterProperties(
03301       HCLUSTER  hClusterIn
03302     , DWORD     dwControlCodeIn
03303     , HNODE     hHostNodeIn
03304     , LPVOID    lpBufferIn              // = NULL
03305     , size_t    cbBufferIn              // = 0
03306     )
03307 {
03308     ASSERT( hClusterIn != NULL );
03309     ASSERT( ( dwControlCodeIn & ( CLUSCTL_OBJECT_MASK << CLUSCTL_OBJECT_SHIFT ) )
03310             == ( CLUS_OBJECT_CLUSTER << CLUSCTL_OBJECT_SHIFT ) );
03311
03312     DWORD   sc = ERROR_SUCCESS;
03313     DWORD   cbProps = 256;
03314
03315     //
03316     // Overwrite anything that may be in the buffer.
03317     // Allows this class instance to be reused.
03318     //
03319
03320     m_cbDataSize = 0;
03321
03322     //
03323     // Get properties.
03324     //
03325
03326     sc = ScAllocPropList( cbProps );
03327     if ( sc == ERROR_SUCCESS )
03328     {
03329         sc = ClusterControl(
03330                           hClusterIn
03331                         , hHostNodeIn
03332                         , dwControlCodeIn
03333                         , lpBufferIn
03334                         , static_cast< DWORD >( cbBufferIn )
03335                         , m_cbhPropList.pb
03336                         , static_cast< DWORD >( m_cbBufferSize )
03337                         , &cbProps
03338                         );
03339         if ( sc == ERROR_MORE_DATA )
03340         {
03341             sc = ScAllocPropList( cbProps );
03342             if ( sc == ERROR_SUCCESS )
03343             {
03344                 sc = ClusterControl(
03345                                   hClusterIn
03346                                 , hHostNodeIn
03347                                 , dwControlCodeIn
03348                                 , lpBufferIn
03349                                 , static_cast< DWORD >( cbBufferIn )
03350                                 , m_cbhPropList.pb
03351                                 , static_cast< DWORD >( m_cbBufferSize )
03352                                 , &cbProps
03353                                 );
03354             } // if: ScAllocPropList succeeded
03355         } // if: buffer too small
03356     } // if: ScAllocPropList succeeded
03357
03358     if ( sc != ERROR_SUCCESS )
03359     {
03360         DeletePropList();
03361     } // if: error getting private properties.
03362     else
03363     {
03364         m_cbDataSize = static_cast< size_t >( cbProps );
03365         m_cbDataLeft = static_cast< size_t >( cbProps );
03366     } // else: no errors
03367
03368     return sc;
03369
03370 } //*** CClusPropList::ScGetClusterProperties
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAppLite Member List

This is the complete list of members for CAppLite, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
ExitInstance() | CAppLite | [virtual]
InitInstance() | CAppLite | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
Generated on Wed Nov 13 2024 16:55:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/Resource.h Source File

  • Security
  • CertServices
  • Encode

Resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 2000
00006 //
00007 //  File:       resource.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by certenc.rc
00014 //
00015 #define IDS_CERTENCODEDATEARRAY_DESC    1
00016 #define IDS_CERTENCODELONGARRAY_DESC    2
00017 #define IDS_CERTENCODEALTNAME_DESC    3
00018 #define IDS_CERTENCODESTRINGARRAY_DESC    4
00019 #define IDS_CERTENCODEBITSTRING_DESC    5
00020 #define IDS_CERTENCODECRLDIST_DESC    6
00021 #define IDS_E_UNEXPECTED      7
00022 #define IDS_UNKNOWN_ERROR_CODE      8
00023
00024
00025 // Next default values for new objects
00026 //
00027 #ifdef APSTUDIO_INVOKED
00028 #ifndef APSTUDIO_READONLY_SYMBOLS
00029 #define _APS_NEXT_RESOURCE_VALUE        201
00030 #define _APS_NEXT_COMMAND_VALUE         32768
00031 #define _APS_NEXT_CONTROL_VALUE         201
00032 #define _APS_NEXT_SYMED_VALUE           101
00033 #endif
00034 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CClassFactory Member List

This is the complete list of members for CClassFactory, including all inherited members.
_pfnCreateInstance | CClassFactory |
_rclsid | CClassFactory |
ABOUT enum value | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory() | CClassFactory | [inline]
CClassFactory() | CClassFactory | [inline]
CClassFactory() | CClassFactory | [inline]
CClassFactory() | CClassFactory | [inline]
CClassFactory() | CClassFactory | [inline]
CClassFactory() | CClassFactory | [inline]
CClassFactory() | CClassFactory | [inline]
CClassFactory(REFCLSID clsid) | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory(FACTORY_TYPE eFactoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory(FACTORY_TYPE factoryType) | CClassFactory |
CClassFactory() | CClassFactory | [inline]
CClassFactory(CLSID) | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory() | CClassFactory |
CClassFactory(REFCLSID rclsid, HRESULT(*pfnCreateInstance)(IUnknown *pUnkOuter, REFIID riid, void **ppvObj)) | CClassFactory | [inline]
CClassFactory(REFCLSID rclsid, HRESULT(*pfnCreateInstance)(IUnknown *pUnkOuter, REFIID riid, void **ppvObj)) | CClassFactory | [inline]
COMPONENT enum value | CClassFactory |
COMPONENTDATA enum value | CClassFactory |
CONTEXTEXTENSION enum value | CClassFactory |
CONTEXTMENUX enum value | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(IUnknown FAR *punkOuter, REFIID riid, void FAR *FAR *ppv) | CClassFactory |
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv) | CClassFactory |
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv) | CClassFactory |
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv) | CClassFactory |
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv) | CClassFactory |
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, LPVOID FAR *ppv) | CClassFactory | [private]
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, LPVOID FAR *ppv) | CClassFactory | [private]
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv) | CClassFactory |
CreateInstance(LPUNKNOWN punkOuter, REFIID iid, LPVOID FAR *ppv) | CClassFactory | [private]
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(IUnknown *pUnknownOuter, REFIID iid, LPVOID *ppv) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject) | CClassFactory |
CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID *) | CClassFactory |
CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *) | CClassFactory |
CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObj) | CClassFactory |
CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObj) | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
FACTORY_TYPE enum name | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL fLock) | CClassFactory |
LockServer(BOOL fLock) | CClassFactory | [inline]
LockServer(BOOL fLock) | CClassFactory | [inline]
LockServer(BOOL fLock) | CClassFactory | [inline]
LockServer(BOOL fLock) | CClassFactory |
LockServer(BOOL fLock) | CClassFactory | [private]
LockServer(BOOL fLock) | CClassFactory | [private]
LockServer(BOOL fLock) | CClassFactory | [inline]
LockServer(BOOL fLock) | CClassFactory | [private]
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL bLock) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL bLock) | CClassFactory |
LockServer(BOOL bLock) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL) | CClassFactory |
LockServer(BOOL fLock) | CClassFactory |
LockServer(BOOL fLock) | CClassFactory |
m_clsid | CClassFactory | [protected]
m_clsidObject | CClassFactory | [private]
m_cRef | CClassFactory | [private]
m_cRef | CClassFactory | [private]
m_cRef | CClassFactory | [protected]
m_cref | CClassFactory | [private]
m_FactoryType | CClassFactory | [private]
m_factoryType | CClassFactory | [private]
m_lRef | CClassFactory | [protected]
m_nRefCount | CClassFactory | [private]
m_ObjRefCount | CClassFactory | [protected]
mcRef | CClassFactory | [private]
NAMESPACEEXTENSION enum value | CClassFactory |
PROPERTYPAGEX enum value | CClassFactory |
QueryInterface(REFIID, LPVOID *) | CClassFactory |
QueryInterface(REFIID riid, LPVOID FAR *ppvObj) | CClassFactory |
QueryInterface(REFIID riid, void **ppv) | CClassFactory |
QueryInterface(REFIID riid, void **ppv) | CClassFactory |
QueryInterface(REFIID riid, void **ppv) | CClassFactory |
QueryInterface(REFIID iid, void **ppv) | CClassFactory |
QueryInterface(REFIID iid, void **ppv) | CClassFactory | [private]
QueryInterface(REFIID iid, void **ppv) | CClassFactory | [private]
QueryInterface(REFIID riid, void **ppv) | CClassFactory |
QueryInterface(REFIID iid, void **ppv) | CClassFactory | [private]
QueryInterface(REFIID, LPVOID *) | CClassFactory |
QueryInterface(REFIID, LPVOID FAR *) | CClassFactory |
QueryInterface(REFIID, LPVOID FAR *) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppv) | CClassFactory |
QueryInterface(REFIID riid, void **ppv) | CClassFactory |
QueryInterface(REFIID, LPVOID *) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppvObject) | CClassFactory |
QueryInterface(REFIID riid, LPVOID *ppvObject) | CClassFactory |
QueryInterface(REFIID, LPVOID *) | CClassFactory |
QueryInterface(REFIID, LPVOID FAR *) | CClassFactory |
QueryInterface(REFIID riid, void **ppvObj) | CClassFactory |
QueryInterface(REFIID riid, void **ppvObj) | CClassFactory |
STDMETHOD_(ULONG, AddRef)(void) | CClassFactory |
STDMETHOD_(ULONG, Release)(void) | CClassFactory |
STDMETHODIMP_(DWORD) AddRef() | CClassFactory |
STDMETHODIMP_(DWORD) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline, private]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline, private]
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline, private]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline, private]
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory | [inline, private]
STDMETHODIMP_(ULONG) Release(void) | CClassFactory | [inline, private]
STDMETHODIMP_(DBREFCOUNT) AddRef(void) | CClassFactory |
STDMETHODIMP_(DBREFCOUNT) Release(void) | CClassFactory |
STDMETHODIMP_(DWORD) AddRef() | CClassFactory |
STDMETHODIMP_(DWORD) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(DWORD) AddRef() | CClassFactory |
STDMETHODIMP_(DWORD) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef() | CClassFactory |
STDMETHODIMP_(ULONG) Release() | CClassFactory |
STDMETHODIMP_(DWORD) AddRef() | CClassFactory |
STDMETHODIMP_(DWORD) Release() | CClassFactory |
STDMETHODIMP_(DWORD) AddRef() | CClassFactory |
STDMETHODIMP_(DWORD) Release() | CClassFactory |
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory |
STDMETHODIMP_(ULONG) Release(void) | CClassFactory |
STDMETHODIMP_(ULONG) AddRef(void) | CClassFactory |
STDMETHODIMP_(ULONG) Release(void) | CClassFactory |
TOOLBAREXTENSION enum value | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory | [inline]
~CClassFactory(void) | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory | [virtual]
~CClassFactory() | CClassFactory | [virtual]
~CClassFactory() | CClassFactory |
~CClassFactory() | CClassFactory |
Generated on Wed Nov 13 2024 16:55:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/Msg.Cpp Source File

  • Web
  • NetMeeting
  • NMChat

Msg.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       MSG.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 // from cmd.cpp
00018 VOID CmdExit(void);
00019 LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00020
00021
00022 //****************************************************************************
00023 //
00024 // LRESULT MsgDestroy(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00025 //
00026 // Handle a WM_DESTROY message
00027 //
00028 //****************************************************************************
00029
00030 LRESULT MsgDestroy(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00031 {
00032   PostQuitMessage(0);
00033   return 0;
00034 }
00035
00036
00037 //****************************************************************************
00038 //
00039 // LRESULT MsgClose(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00040 //
00041 // Handle a WM_CLOSE message
00042 //
00043 //****************************************************************************
00044
00045 LRESULT MsgClose(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00046 {
00047   CmdExit();
00048   return 0;
00049 }
00050
00051
00052 //****************************************************************************
00053 //
00054 // LRESULT MsgSize(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00055 //
00056 // Handle a WM_SIZE message
00057 //
00058 //****************************************************************************
00059
00060 LRESULT MsgSize(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00061 {
00062   int dxClient = LOWORD(lParam);  // width of client area
00063   int dyClient = HIWORD(lParam);  // height of client area
00064
00065   SizeMsgWindow(dxClient, dyClient);
00066   return 0;
00067 }
00068
00069
00070 //****************************************************************************
00071 //
00072 // LRESULT MsgActivate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00073 //
00074 //****************************************************************************
00075
00076 LRESULT MsgActivate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00077 {
00078   return 0L;
00079 }
00080
00081
00082 //****************************************************************************
00083 //
00084 // LRESULT MsgGetMinMax(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00085 //
00086 // Handle a WM_GETMINMAXINFO message
00087 //
00088 //****************************************************************************
00089
00090 LRESULT MsgGetMinMax(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00091 {
00092   LPMINMAXINFO lpminmax = (LPMINMAXINFO) lParam;
00093
00094   lpminmax->ptMinTrackSize.x = 325;
00095   lpminmax->ptMinTrackSize.y = 250;
00096
00097   return 0;
00098 }
00099
00100
00101 //****************************************************************************
00102 //
00103 // Main window message table definition.
00104 //
00105 //****************************************************************************
00106
00107 static MSD _rgmsdMain[] =
00108 {
00109   {WM_COMMAND,       MsgCmdMain},
00110   {WM_DESTROY,       MsgDestroy},
00111   {WM_CLOSE,         MsgClose},
00112   {WM_SIZE,          MsgSize},
00113   {WM_ACTIVATEAPP,   MsgActivate},
00114   {WM_GETMINMAXINFO, MsgGetMinMax},
00115
00116   {0, NULL}  // MUST be the last entry
00117 };
00118
00119
00120 //****************************************************************************
00121 //
00122 // LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00123 //
00124 // Main Window proc
00125 //
00126 //****************************************************************************
00127
00128 LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00129 {
00130   for (LPMSD lpmsd = _rgmsdMain; 0 != lpmsd->uMsg; lpmsd++)
00131   {
00132     if (lpmsd->uMsg == uMsg)
00133     {
00134       return lpmsd->pfnmsg(hwnd, uMsg, wParam, lParam);
00135     }
00136   }
00137
00138   return DefWindowProc(hwnd, uMsg, wParam, lParam);
00139 }
00140
00141
00142
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/cMenuext.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

cMenuext.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _CContextMenuExtension_H_
00020 #define _CContextMenuExtension_H_
00021
00022 #include <tchar.h>
00023 #include <mmc.h>
00024
00025 class CContextMenuExtension : public IExtendContextMenu
00026 {
00027
00028 private:
00029     ULONG       m_cref;
00030
00031     HRESULT ExtractObjectTypeGUID( IDataObject* piDataObject, GUID* pguidObjectType );
00032     HRESULT ExtractSnapInCLSID( IDataObject* piDataObject, CLSID* pclsidSnapin );
00033     HRESULT ExtractString( IDataObject *piDataObject,
00034         CLIPFORMAT   cfClipFormat,
00035         WCHAR        *pstr,
00036         DWORD        cchMaxLength);
00037     HRESULT ExtractData( IDataObject* piDataObject,
00038         CLIPFORMAT   cfClipFormat,
00039         BYTE*        pbData,
00040         DWORD        cbData );
00041
00042     // clipboard format
00043     static UINT s_cfDisplayName;
00044     static UINT s_cfSnapInCLSID;
00045     static UINT s_cfNodeType;
00046
00047 public:
00048     CContextMenuExtension();
00049     ~CContextMenuExtension();
00050
00051     ///////////////////////////////
00052     // Interface IUnknown
00053     ///////////////////////////////
00054     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00055     STDMETHODIMP_(ULONG) AddRef();
00056     STDMETHODIMP_(ULONG) Release();
00057
00058     ///////////////////////////////
00059     // Interface IExtendContextMenu
00060     ///////////////////////////////
00061     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddMenuItems(
00062         /* [in] */ LPDATAOBJECT piDataObject,
00063         /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
00064         /* [out][in] */ long __RPC_FAR *pInsertionAllowed);
00065
00066         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Command(
00067         /* [in] */ long lCommandID,
00068         /* [in] */ LPDATAOBJECT piDataObject);
00069 };
00070
00071 #endif _CContextMenuExtension_H_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Redirect/Redirect.cpp Source File

  • Web
  • iis
  • extensions
  • Redirect

Redirect.cpp

Go to the documentation of this file.
00001 //  Copyright (c) 1997-2002  Microsoft Corporation
00002 //
00003 //  Module Name:
00004 //
00005 //    redirect.cpp
00006 //
00007 //  Abstract:
00008 //
00009 //  Redirect is a sample ISAPI extension to demonstrate redirecting
00010 //  a request.  It redirects requests to a URL specified on the
00011 //  query string.
00012
00013 #define WIN32_LEAN_AND_MEAN
00014 #include <windows.h>
00015 #include <httpext.h>
00016 #include <stdio.h>
00017
00018 #define BUFF_SIZE 2048
00019
00020 // local prototypes
00021
00022 DWORD SendInstructionPage(EXTENSION_CONTROL_BLOCK *pECB);
00023
00024 //  Description:
00025 //
00026 //    This is required ISAPI Extension DLL entry point.
00027 //
00028 //  Arguments:
00029 //
00030 //    pVer - poins to extension version info structure
00031 //
00032 //  Returns:
00033 //
00034 //    Always returns TRUE
00035
00036 BOOL WINAPI GetExtensionVersion(OUT HSE_VERSION_INFO *pVer)
00037 {
00038   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00039
00040   lstrcpyn(pVer->lpszExtensionDesc, "Redirect ISAPI Sample", HSE_MAX_EXT_DLL_NAME_LEN);
00041
00042   return TRUE;
00043 }
00044
00045 //  Description:
00046 //
00047 //    If no query string is present, or if the query string is not identified as a
00048 //    legal target for redirection, Redirect.dll will return a page to the client
00049 //    with brief instructions for its use.
00050 //
00051 //    Redirections to a resource on the same server as the dll will be handled by
00052 //    IIS and will be transparent to the browser (HSE_REQ_SEND_URL).
00053 //
00054 //    Redirections to a resource on a different server will result in an HTTP 302
00055 //    response instructing the browser to obtain the resource from another location
00056 //    (HSE_REQ_SEND_URL_REDIRECT_RESP).
00057 //
00058 //  Arguments:
00059 //
00060 //    pECB - pointer to the extenstion control block
00061 //
00062 //  Returns:
00063 //
00064 //    HSE_STATUS_SUCCESS on successful completion
00065 //    HSE_STATUS_ERROR on failure
00066
00067 DWORD WINAPI HttpExtensionProc(IN EXTENSION_CONTROL_BLOCK *pECB)
00068 {
00069   // If no query string is present, return the instruction page
00070
00071   if (!strlen(pECB->lpszQueryString))
00072     return SendInstructionPage(pECB);
00073
00074   // Check to see if the redirect URL is on another server. If it is, use
00075   // HSE_REQ_SEND_URL_REDIRECT_RESP.  If it's on this local server, use
00076   // HSE_REQ_SEND_URL to return the specified URL without using an HTTP 302
00077   // status code.
00078
00079   DWORD dwBuffSize = strlen(pECB->lpszQueryString);
00080
00081   if (!strnicmp(pECB->lpszQueryString, "http://", 7)) {
00082
00083     pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_URL_REDIRECT_RESP, pECB->lpszQueryString, &dwBuffSize, NULL);
00084
00085   } else {
00086
00087     // Check to make sure that query string begins with a '/'.
00088
00089     if (*(pECB->lpszQueryString) != '/')
00090       return SendInstructionPage( pECB );
00091
00092     pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_URL, pECB->lpszQueryString, &dwBuffSize, NULL);
00093   }
00094
00095   return HSE_STATUS_SUCCESS;
00096 }
00097
00098 //  Description:
00099 //
00100 //    Send short http usage description to the user.
00101 //
00102 //  Arguments:
00103 //
00104 //    pECB - pointer to the extenstion control block
00105 //
00106 //  Returns:
00107 //
00108 //    HSE_STATUS_SUCCESS on successful completion
00109 //    HSE_STATUS_ERROR on failure
00110
00111 DWORD SendInstructionPage(IN EXTENSION_CONTROL_BLOCK *pECB)
00112 {
00113   char szStatus[] = "200 OK";
00114   char szContent[] =
00115   "<html>"
00116   "<head><title>Redirect URL</title></head>"
00117   "<body>"
00118   "<h1>Redirect.dll</h1>\r\n<hr>\r\n"
00119   "Redirect.dll returns the resource specified on the query string.<br>\r\n<br>\r\n"
00120   "To specify a resource on the same server as Redirect.dll, use the following form:<br>\r\n<br>\r\n"
00121   "<code> http://server/scripts/Redirect.dll?/virtualdir/file.htm </code><br>\r\n<br>\r\n"
00122   "To specify a resource on another server, use the following form:<br>\r\n<br>\r\n"
00123   "<code> http://server/scripts/Redirect.dll?http://server/virtualdir/file.htm </code>"
00124   "</body>"
00125   "</html>";
00126
00127   char szHeaderBase[] = "Content-Length: %lu\r\nContent-type: text/html\r\n\r\n";
00128   char szHeader[BUFF_SIZE];
00129
00130   // Fill in byte count in Content-Length header
00131
00132   DWORD cchContent = strlen(szContent);
00133
00134   sprintf(szHeader, szHeaderBase, cchContent);
00135
00136   // Populate SendHeaderExInfo struct
00137
00138   HSE_SEND_HEADER_EX_INFO SendHeaderExInfo;
00139
00140   SendHeaderExInfo.pszStatus = szStatus;
00141   SendHeaderExInfo.pszHeader = szHeader;
00142   SendHeaderExInfo.cchStatus = strlen(szStatus);
00143   SendHeaderExInfo.cchHeader = strlen(szHeader);
00144   SendHeaderExInfo.fKeepConn = FALSE;
00145
00146   // Send header
00147
00148   if (!pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SendHeaderExInfo, NULL, NULL))
00149     return HSE_STATUS_ERROR;
00150
00151   //  Send content
00152
00153   if (!pECB->WriteClient(pECB->ConnID, szContent, &cchContent, 0))
00154     return HSE_STATUS_ERROR;
00155
00156   return HSE_STATUS_SUCCESS;
00157 }
00158
00159 //  Description:
00160 //
00161 //    This function is called when the WWW service is shutdown
00162 //
00163 //  Arguments:
00164 //
00165 //    dwFlags - HSE_TERM_ADVISORY_UNLOAD or HSE_TERM_MUST_UNLOAD
00166 //
00167 //  Return Value:
00168 //
00169 //    TRUE if extension is ready to be unloaded, FALSE otherwise
00170
00171 BOOL WINAPI TerminateExtension(IN DWORD dwFlags)
00172 {
00173   return TRUE;
00174 }
00175
00176
00177
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/networking/asyncdemo/AsyncDemo.cpp Source File

  • Web
  • networking
  • asyncdemo

AsyncDemo.cpp

Go to the documentation of this file.
00001 /* Microsoft Corporation Copyright 1999 - 2000 */
00002 /********************************************************************
00003
00004   ProjectName : AsyncDemo
00005
00006   Purpose   : This sample demonstrates how to submit two
00007           WinInet requests, using InternentOpenUrl,
00008           asynchronously.
00009
00010   Notes   : This sample does not handle any authentication.
00011           To properly handle authentication, the
00012           functions that handle specific protocols (like
00013           HttpOpenRequest/HttpSendRequest) would need to
00014           be used instead of InternetOpenUrl.
00015
00016   Last Updated: February 2, 1998
00017
00018
00019
00020 *********************************************************************/
00021
00022
00023 #include <windows.h>
00024 #include <iostream.h>
00025 #include <string.h>
00026 #include <stdio.h>
00027 #include <wininet.h>
00028 #include "resource.h"
00029
00030 //*******************************************************************
00031 //          Global Variable Declarations
00032 //*******************************************************************
00033
00034 LPSTR lpszAgent = "Asynchronous WinInet Demo Program";
00035
00036 //root HINTERNET handle
00037 HINTERNET hOpen;
00038
00039 //instance of the callback function
00040 INTERNET_STATUS_CALLBACK iscCallback;
00041
00042 //structure to be passed as the dwContext value
00043 typedef struct {
00044   HWND    hWindow;  //main window handle
00045   int     nURL;   //ID of the Edit Box w/ the URL
00046   int     nHeader;  //ID of the Edit Box for the header info
00047   int     nResource;  //ID of the Edit Box for the resource
00048   HINTERNET hOpen;    //HINTERNET handle created by InternetOpen
00049   HINTERNET hResource;  //HINTERNET handle created by InternetOpenUrl
00050   char    szMemo[512];//string to store status memo
00051   HANDLE    hThread;  //thread handle
00052   DWORD   dwThreadID; //thread ID
00053 } REQUEST_CONTEXT;
00054
00055
00056 //two instances of the structure
00057 static REQUEST_CONTEXT rcContext1, rcContext2;
00058
00059 HWND hButton;
00060
00061 //*******************************************************************
00062 //            Function Declarations
00063 //*******************************************************************
00064
00065 //dialog box functions
00066 BOOL CALLBACK AsyncURL(HWND, UINT, WPARAM, LPARAM);
00067
00068 //callback function
00069 void __stdcall Juggler(HINTERNET, DWORD , DWORD , LPVOID, DWORD);
00070
00071 //thread function
00072 DWORD Threader(LPVOID);
00073
00074 //functions
00075 int WINAPI Dump(HWND, int, HINTERNET);
00076 int WINAPI Header(HWND,int, int, HINTERNET);
00077 void AsyncDirect (REQUEST_CONTEXT*, HINTERNET);
00078
00079
00080
00081
00082 //*******************************************************************
00083 //                Main Program
00084 //*******************************************************************
00085 int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst,
00086            LPSTR lpszArgs, int nWinMode)
00087 {
00088
00089   //create the root HINTERNET handle using the systems default
00090   //settings.
00091   hOpen = InternetOpen(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG,
00092             NULL, NULL, INTERNET_FLAG_ASYNC);
00093
00094   //check if the root HINTERNET handle has been created
00095   if (hOpen == NULL)
00096   {
00097     return FALSE;
00098   }
00099   else
00100   {
00101     //sets the callback function
00102     iscCallback = InternetSetStatusCallback(hOpen, (INTERNET_STATUS_CALLBACK)Juggler);
00103
00104     //creates the dialog box
00105     DialogBox(hThisInst,"DB_ASYNCDEMO", HWND_DESKTOP,(DLGPROC)AsyncURL);
00106
00107     //closes the root HINTERNET handle
00108     return InternetCloseHandle(hOpen);
00109   }
00110
00111
00112 }
00113
00114
00115 //*******************************************************************
00116 //                 Dialog Functions
00117 //*******************************************************************
00118
00119 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00120 //
00121 //
00122 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00123 BOOL CALLBACK AsyncURL(HWND hX, UINT message, WPARAM wParam,
00124              LPARAM lParam)
00125 {
00126
00127
00128   switch(message)
00129   {
00130     case WM_INITDIALOG:
00131       //change the cursor to indicate something is happening
00132       SetCursor(LoadCursor(NULL,IDC_WAIT));
00133
00134       //set the default web sites
00135       SetDlgItemText(hX,IDC_URL1,
00136         LPSTR("http://www.microsoft.com"));
00137       SetDlgItemText(hX,IDC_URL2,
00138         LPSTR("http://home.microsoft.com"));
00139
00140       //initialize the first context value
00141       rcContext1.hWindow = hX;
00142       rcContext1.nURL = IDC_URL1;
00143       rcContext1.nHeader = IDC_Header1;
00144       rcContext1.nResource = IDC_Resource1;
00145       sprintf(rcContext1.szMemo, "AsyncURL(%d)",
00146         rcContext2.nURL);
00147
00148       //initialize the second context value
00149       rcContext2.hWindow = hX;
00150       rcContext2.nURL = IDC_URL2;
00151       rcContext2.nHeader = IDC_Header2;
00152       rcContext2.nResource = IDC_Resource2;
00153       sprintf(rcContext2.szMemo, "AsyncURL(%d)",
00154         rcContext2.nURL);
00155
00156       //change the cursor back to normal
00157       SetCursor(LoadCursor(NULL,IDC_ARROW));
00158       return TRUE;
00159     case WM_COMMAND:
00160       switch(LOWORD(wParam))
00161       {
00162         case IDC_EXIT:
00163           //change the cursor
00164           SetCursor(LoadCursor(NULL,IDC_WAIT));
00165
00166           //close the dialog box
00167           EndDialog(hX,0);
00168
00169           //return the cursor to normal
00170           SetCursor(LoadCursor(NULL,IDC_ARROW));
00171           return TRUE;
00172         case IDC_Download:
00173
00174           hButton = GetDlgItem(hX, IDC_Download);
00175           EnableWindow(hButton,0);
00176
00177           //reset the edit boxes
00178           SetDlgItemText(hX,IDC_Resource1,LPSTR(""));
00179           SetDlgItemText(hX,IDC_Resource2,LPSTR(""));
00180           SetDlgItemText(hX,IDC_Header1,LPSTR(""));
00181           SetDlgItemText(hX,IDC_Header2,LPSTR(""));
00182
00183           //start the downloads
00184           AsyncDirect(&rcContext1, hOpen);
00185           AsyncDirect(&rcContext2, hOpen);
00186           return TRUE;
00187       }
00188       return FALSE;
00189     case WM_DESTROY:
00190       //change the cursor
00191       SetCursor(LoadCursor(NULL,IDC_WAIT));
00192
00193       //close the dialog box
00194       EndDialog(hX,0);
00195
00196       //return the cursor to normal
00197       SetCursor(LoadCursor(NULL,IDC_ARROW));
00198       return TRUE;
00199     default:
00200       return FALSE;
00201
00202   }
00203
00204 }
00205
00206 //*******************************************************************
00207 //                  Other Functions
00208 //*******************************************************************
00209
00210 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00211
00212   AsyncDirect handles the initial download request using
00213   InternetOpenUrl.
00214
00215 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
00216 void AsyncDirect (REQUEST_CONTEXT *prcContext, HINTERNET hOpen)
00217 {
00218   //dim a buffer to hold the URL
00219   char szURL[256];
00220
00221   //retrieve the URL from the designated edit box
00222   GetDlgItemText(prcContext->hWindow,prcContext->nURL,szURL,256);
00223
00224   //update the memo in the REQUEST_CONTEXT structure
00225   sprintf(prcContext->szMemo, "AsyncDirect(%s)(%d):", szURL, prcContext->nURL);
00226
00227   //call InternetOpenUrl
00228   prcContext->hResource = InternetOpenUrl(hOpen, szURL, NULL, 0, 0, (DWORD)prcContext);
00229
00230   //check the HINTERNET handle for errors
00231   if (prcContext->hResource == NULL)
00232   {
00233     if (GetLastError() != ERROR_IO_PENDING)
00234     {
00235       //reuse the URL buffer for the error information
00236       sprintf(szURL,"Error %d encountered.",GetLastError());
00237
00238       //write error to resource edit box
00239       SetDlgItemText(prcContext->hWindow, prcContext->nResource,
00240         szURL);
00241     }
00242   }
00243
00244 }
00245
00246
00247 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00248
00249   Juggler is the callback function that is registered using
00250   InternetSetStatusCallback.
00251
00252   Juggler displays the current callback in a list box with the ID,
00253   IDC_CallbackList.  The information displayed uses szMemo (which
00254   contains the last function that was called), the
00255   dwStatusInformationLength (to monitor the size of the information
00256   being returned),
00257
00258 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
00259 void __stdcall Juggler  (HINTERNET hInternet, DWORD dwContext,
00260                DWORD dwInternetStatus,
00261                LPVOID lpvStatusInformation,
00262                DWORD dwStatusInformationLength)
00263 {
00264   REQUEST_CONTEXT *cpContext;
00265   char szBuffer[256];
00266   cpContext= (REQUEST_CONTEXT*)dwContext;
00267
00268
00269
00270
00271   switch (dwInternetStatus)
00272   {
00273     case INTERNET_STATUS_CLOSING_CONNECTION:
00274       //write the callback information to the buffer
00275       sprintf(szBuffer,"%s: CLOSING_CONNECTION (%d)",
00276         cpContext->szMemo, dwStatusInformationLength);
00277       break;
00278     case INTERNET_STATUS_CONNECTED_TO_SERVER:
00279       //write the callback information to the buffer
00280       sprintf(szBuffer,"%s: CONNECTED_TO_SERVER (%d)",
00281         cpContext->szMemo, dwStatusInformationLength);
00282       break;
00283     case INTERNET_STATUS_CONNECTING_TO_SERVER:
00284       //write the callback information to the buffer
00285       sprintf(szBuffer,"%s: CONNECTING_TO_SERVER (%d)",
00286         cpContext->szMemo, dwStatusInformationLength);
00287       break;
00288     case INTERNET_STATUS_CONNECTION_CLOSED:
00289       //write the callback information to the buffer
00290       sprintf(szBuffer,"%s: CONNECTION_CLOSED (%d)",
00291         cpContext->szMemo, dwStatusInformationLength);
00292       break;
00293     case INTERNET_STATUS_HANDLE_CLOSING:
00294       //write the callback information to the buffer
00295       sprintf(szBuffer,"%s: HANDLE_CLOSING (%d)",
00296         cpContext->szMemo, dwStatusInformationLength);
00297
00298       sprintf(cpContext->szMemo, "Closed");
00299
00300       //check if the both resource handles are closing
00301       //if so, enable the download button.
00302       if ((strcmp(rcContext1.szMemo,"Closed")) ||
00303         (strcmp(rcContext2.szMemo,"Closed")))
00304       {
00305         hButton = GetDlgItem(cpContext->hWindow, IDC_Download);
00306         EnableWindow(hButton,1);
00307       }
00308       break;
00309     case INTERNET_STATUS_HANDLE_CREATED:
00310       //write the callback information to the buffer
00311       sprintf(szBuffer,"%s: HANDLE_CREATED (%d)",
00312         cpContext->szMemo, dwStatusInformationLength);
00313       break;
00314     case INTERNET_STATUS_INTERMEDIATE_RESPONSE:
00315       //write the callback information to the buffer
00316       sprintf(szBuffer,"%s: INTERMEDIATE_RESPONSE (%d)",
00317         cpContext->szMemo, dwStatusInformationLength);
00318       break;
00319     case INTERNET_STATUS_NAME_RESOLVED:
00320       //write the callback information to the buffer
00321       sprintf(szBuffer,"%s: NAME_RESOLVED (%d)",
00322         cpContext->szMemo, dwStatusInformationLength);
00323       break;
00324     case INTERNET_STATUS_RECEIVING_RESPONSE:
00325       //write the callback information to the buffer
00326       sprintf(szBuffer,"%s: RECEIVEING_RESPONSE (%d)",
00327         cpContext->szMemo, dwStatusInformationLength);
00328       break;
00329     case INTERNET_STATUS_RESPONSE_RECEIVED:
00330       //write the callback information to the buffer
00331       sprintf(szBuffer,"%s: RESPONSE_RECEIVED (%d)",
00332         cpContext->szMemo, dwStatusInformationLength);
00333       break;
00334     case INTERNET_STATUS_REDIRECT:
00335       //write the callback information to the buffer
00336       sprintf(szBuffer,"%s: REDIRECT (%d)",
00337         cpContext->szMemo, dwStatusInformationLength);
00338       break;
00339     case INTERNET_STATUS_REQUEST_COMPLETE:
00340
00341       //check for errors
00342       if (LPINTERNET_ASYNC_RESULT(lpvStatusInformation)->dwError == 0)
00343       {
00344         //check if the completed request is from AsyncDirect
00345         if (strcmp(cpContext->szMemo, "AsyncDirect"))
00346         {
00347           //set the resource handle to the HINTERNET handle
00348           //returned in the callback
00349           cpContext->hResource = HINTERNET(
00350             LPINTERNET_ASYNC_RESULT(lpvStatusInformation)->dwResult);
00351
00352           //write the callback information to the buffer
00353           sprintf(szBuffer,"%s: REQUEST_COMPLETE (%d)",
00354             cpContext->szMemo, dwStatusInformationLength);
00355
00356           //create a thread to handle the header and
00357           //resource download
00358           cpContext->hThread = CreateThread(NULL, 0,
00359             (LPTHREAD_START_ROUTINE)Threader,LPVOID(cpContext), 0,
00360             &cpContext->dwThreadID);
00361
00362         }
00363         else
00364         {
00365           sprintf(szBuffer,"%s(%d): REQUEST_COMPLETE (%d)",
00366             cpContext->szMemo,
00367             cpContext->nURL, dwStatusInformationLength);
00368         }
00369
00370       }
00371       else
00372       {
00373         sprintf(szBuffer,
00374           "%s: REQUEST_COMPLETE (%d) Error (%d) encountered",
00375           cpContext->szMemo, dwStatusInformationLength,
00376           GetLastError());
00377       }
00378       break;
00379     case INTERNET_STATUS_REQUEST_SENT:
00380       //write the callback information to the buffer
00381       sprintf(szBuffer,"%s: REQUEST_SENT (%d)",
00382         cpContext->szMemo, dwStatusInformationLength);
00383       break;
00384     case INTERNET_STATUS_RESOLVING_NAME:
00385       //write the callback information to the buffer
00386       sprintf(szBuffer,"%s: RESOLVING_NAME (%d)",
00387         cpContext->szMemo, dwStatusInformationLength);
00388       break;
00389     case INTERNET_STATUS_SENDING_REQUEST:
00390       //write the callback information to the buffer
00391       sprintf(szBuffer,"%s: SENDING_REQUEST (%d)",
00392         cpContext->szMemo, dwStatusInformationLength);
00393       break;
00394     case INTERNET_STATUS_STATE_CHANGE:
00395       //write the callback information to the buffer
00396       sprintf(szBuffer,"%s: STATE_CHANGE (%d)",
00397         cpContext->szMemo, dwStatusInformationLength);
00398       break;
00399     default:
00400       //write the callback information to the buffer
00401       sprintf(szBuffer,"%s: Unknown: Status %d Given", dwInternetStatus);
00402       break;
00403   }
00404
00405   //add the callback information to the callback list box
00406   SendDlgItemMessage(cpContext->hWindow,IDC_CallbackList,
00407     LB_ADDSTRING,0,(LPARAM)szBuffer);
00408
00409 }
00410
00411
00412
00413 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00414
00415   Threader is a thread function to handle the retrieval of the header
00416   and resource information.  Since the WinInet functions involved in
00417   both of these operations work synchronously, using a separate
00418   thread will help avoid any blocking.
00419
00420 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
00421 DWORD Threader(LPVOID lpvContext)
00422 {
00423   REQUEST_CONTEXT *cpContext;
00424
00425   //copy the pointer to a REQUEST_CONTEXT pointer to ease calls
00426   cpContext= (REQUEST_CONTEXT*)lpvContext;
00427
00428   //set szMemo to the name of the function to be called
00429   sprintf(cpContext->szMemo, "Header(%d)", cpContext->nURL);
00430
00431   //call the header function
00432   Header(cpContext->hWindow, cpContext->nHeader, -1, cpContext->hResource);
00433
00434   //set szMemo to the name of the function to be called
00435   sprintf(cpContext->szMemo, "Dump(%d)", cpContext->nURL);
00436
00437   //call the dump function
00438   Dump(cpContext->hWindow, cpContext->nResource, cpContext->hResource);
00439
00440   return S_OK;
00441
00442 }
00443
00444
00445 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00446
00447   Header handles the retrieval of the HTTP header information.
00448
00449 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
00450 int WINAPI Header(HWND hX,int intControl, int intCustom, HINTERNET hHttp)
00451 {
00452   DWORD dwHeaderType=-1;
00453   DWORD dwSize=0;
00454   LPVOID lpOutBuffer = NULL;
00455
00456   char szError[80];
00457
00458   //change the cursor
00459   SetCursor(LoadCursor(NULL,IDC_WAIT));
00460
00461
00462   //set the header type to be requested, which is all headers in
00463   //this case
00464   dwHeaderType = HTTP_QUERY_RAW_HEADERS_CRLF;
00465
00466
00467
00468 retry:
00469
00470   //call HttpQueryInfo.
00471   //first time with a zero buffer size to get the size of the buffer
00472   //needed and to check if the header exists
00473   if(!HttpQueryInfo(hHttp,dwHeaderType,(LPVOID)lpOutBuffer,&dwSize,NULL))
00474   {
00475     //check if the header was not found
00476     if (GetLastError()==ERROR_HTTP_HEADER_NOT_FOUND)
00477     {
00478       sprintf(szError,"Error %d encountered", GetLastError());
00479       SetDlgItemText(hX,intControl, szError);
00480       SetCursor(LoadCursor(NULL,IDC_ARROW));
00481       return TRUE;
00482     }
00483     else
00484     {
00485       //check if the buffer was insufficient
00486       if (GetLastError()==ERROR_INSUFFICIENT_BUFFER)
00487       {
00488         //allocate the buffer
00489         lpOutBuffer = new char[dwSize+1];
00490         goto retry;
00491       }
00492       else
00493       {
00494         //display other errors in header edit box
00495         sprintf(szError,"Error %d encountered", GetLastError());
00496         SetDlgItemText(hX,intControl, szError);
00497         SetCursor(LoadCursor(NULL,IDC_ARROW));
00498         return FALSE;
00499       }
00500     }
00501   }
00502
00503
00504   SetDlgItemText(hX,intControl,(LPSTR)lpOutBuffer);
00505   delete[]lpOutBuffer;
00506   SetCursor(LoadCursor(NULL,IDC_ARROW));
00507   return 1;
00508
00509 }
00510
00511
00512 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00513
00514 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
00515 int WINAPI Dump(HWND hX, int intCtrlID, HINTERNET hResource)
00516 {
00517
00518   LPSTR lpszData;   // buffer for the data
00519   DWORD dwSize;     // size of the data available
00520   DWORD dwDownloaded; // size of the downloaded data
00521   DWORD dwSizeSum=0;  // size of the data in the textbox
00522   LPSTR lpszHolding;  // buffer to merge the textbox data and buffer
00523
00524   char  szError[80];  // buffer for error information
00525   // Set the cursor to an hourglass.
00526   SetCursor(LoadCursor(NULL,IDC_WAIT));
00527
00528   int   nCounter;   // counter used to display something while
00529               // I/O is pending.
00530
00531
00532   // This loop handles reading the data.
00533   do
00534   {
00535
00536 try_again:
00537     // The call to InternetQueryDataAvailable determines the amount of
00538     // data available to download.
00539     if (!InternetQueryDataAvailable(hResource,&dwSize,0,0))
00540     {
00541       if (GetLastError()== ERROR_IO_PENDING)
00542       {
00543         nCounter = 0;
00544
00545         while(GetLastError()==ERROR_IO_PENDING)
00546         {
00547           nCounter++;
00548
00549           if (nCounter==2000)
00550             break;
00551         }
00552         goto try_again;
00553       }
00554       sprintf(szError,"Error %d encountered by InternetQueryDataAvailable",
00555         GetLastError());
00556       SetDlgItemText(hX,intCtrlID, szError);
00557       SetCursor(LoadCursor(NULL,IDC_ARROW));
00558       break;
00559     }
00560     else
00561     {
00562       // Allocates a buffer of the size returned by InternetQueryDataAvailable
00563       lpszData = new char[dwSize+1];
00564
00565       // Reads the data from the HINTERNET handle.
00566       if(!InternetReadFile(hResource,(LPVOID)lpszData,dwSize,&dwDownloaded))
00567       {
00568         if (GetLastError()== ERROR_IO_PENDING)
00569         {
00570           nCounter = 0;
00571
00572           while(GetLastError()==ERROR_IO_PENDING)
00573           {
00574             nCounter++;
00575           }
00576           goto keep_going;
00577         }
00578         sprintf(szError,"Error %d encountered by InternetReadFile",
00579           GetLastError());
00580         SetDlgItemText(hX,intCtrlID, szError);
00581         delete[] lpszData;
00582         break;
00583       }
00584       else
00585       {
00586
00587 keep_going:
00588         // Adds a null terminator to the end of the data buffer
00589         lpszData[dwDownloaded]='\0';
00590
00591         // Allocates the holding buffer
00592         lpszHolding = new char[dwSizeSum + dwDownloaded + 1];
00593
00594         // Checks if there has been any data written to the textbox
00595         if (dwSizeSum != 0)
00596         {
00597           // Retrieves the data stored in the textbox if any
00598           GetDlgItemText(hX,intCtrlID,(LPSTR)lpszHolding,dwSizeSum);
00599
00600           // Adds a null terminator at the end of the textbox data
00601           lpszHolding[dwSizeSum]='\0';
00602         }
00603         else
00604         {
00605           // Make the holding buffer an empty string.
00606           lpszHolding[0]='\0';
00607         }
00608
00609         // Adds the new data to the holding buffer
00610         strcat(lpszHolding,lpszData);
00611
00612         // Writes the holding buffer to the textbox
00613         SetDlgItemText(hX,intCtrlID,(LPSTR)lpszHolding);
00614
00615         // Delete the two buffers
00616         delete[] lpszHolding;
00617         delete[] lpszData;
00618
00619         // Add the size of the downloaded data to the textbox data size
00620         dwSizeSum = dwSizeSum + dwDownloaded + 1;
00621
00622         // Check the size of the remaining data.  If it is zero, break.
00623         if (dwDownloaded == 0)
00624           break;
00625       }
00626     }
00627   }
00628   while(TRUE);
00629
00630   // Close the HINTERNET handle
00631   InternetCloseHandle(hResource);
00632
00633   // Set the cursor back to an arrow
00634   SetCursor(LoadCursor(NULL,IDC_ARROW));
00635
00636   // Return
00637   return TRUE;
00638 }
00639
00640
00641
00642
00643 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00644 //
00645 //
00646 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CExceptionSub Member List

This is the complete list of members for CExceptionSub, including all inherited members.
CExceptionSub(CComSpy *pSpy) | CExceptionSub | [inline]
CExceptionSub() | CExceptionSub | [inline]
CSysLCESub() | CSysLCESub | [inline]
GetEventClass(LPGUID guid) | CExceptionSub | [inline, virtual]
GetEventType(EventEnum *e) | CExceptionSub | [inline, virtual]
GetInterface(IID *iid) | CExceptionSub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
OnExceptionUser(COMSVCSEVENTINFO *pInfo, ULONG code, ULONG64 addr, LPCOLESTR pszStackTrace) | CExceptionSub | [inline]
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:56:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/StdAfx.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__A8BF4DF9_648E_4723_880E_DAB5CBF2B111__INCLUDED_)
00006 #define AFX_STDAFX_H__A8BF4DF9_648E_4723_880E_DAB5CBF2B111__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #define STRICT
00013 #ifndef _WIN32_WINNT
00014 #define _WIN32_WINNT 0x0400
00015 #endif
00016 #define _ATL_APARTMENT_THREADED
00017
00018 #include <atlbase.h>
00019 //You may derive a class from CComModule and use it if you want to override
00020 //something, but do not change the name of _Module
00021 extern CComModule _Module;
00022 #include <atlcom.h>
00023
00024 //{{AFX_INSERT_LOCATION}}
00025 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00026
00027 #endif // !defined(AFX_STDAFX_H__A8BF4DF9_648E_4723_880E_DAB5CBF2B111__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/Connect.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

Connect.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CONNECT.CPP
00003
00004   Summary:   Implementation file for the connection points (and their
00005              connections) offered by the connectable objects in the
00006              DCDSERVE server sample. COM objects are implemented for
00007              Connection Point Enumerators, Connection Points, and
00008              Connection Enumerators.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial DCDSERVE.HTM
00012              file. For more specific technical details on the internal
00013              workings see the comments dispersed throughout the module's
00014              source code.
00015
00016   Classes:   COEnumConnectionPoints, COConnectionPoint, and
00017              COEnumConnections.
00018
00019   Functions: none.
00020
00021   Origin:    6-10-96: atrent - Editor inheritance from CONSERVE COM
00022              Tutorial Code Sample. Very little change was required.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039
00040 /*---------------------------------------------------------------------------
00041   We include WINDOWS.H for all Win32 applications.
00042   We include OLE2.H because we will be calling the COM/OLE Libraries.
00043   We include OLECTL.H because it has definitions for connectable objects.
00044   We include APPUTIL.H because we will be building this application using
00045     the convenient Virtual Window and Dialog classes and other
00046     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00047   We include PAPINT.H and PAPGUIDS.H for the common paper-related
00048     Interface class, GUID, and CLSID specifications.
00049   We include SERVER.H because it has internal class declarations and
00050     resource ID definitions specific for this server.
00051   We include CONNECT.H for object class declarations for the various
00052     connection point and connection COM objects used in CONSERVE.
00053   We include PAPER.H because it has the class COEnumConnectionPoints
00054     declarations as well as the COPaper class declaration.
00055 ---------------------------------------------------------------------------*/
00056 #include <windows.h>
00057 #include <ole2.h>
00058 #include <olectl.h>
00059 #include <apputil.h>
00060 #include <papint.h>
00061 #include <papguids.h>
00062 #include "server.h"
00063 #include "connect.h"
00064 #include "paper.h"
00065
00066
00067 /*---------------------------------------------------------------------------
00068   COEnumConnectionPoints's implementation of its main COM object class
00069   including Constructor, Destructor, QueryInterface, AddRef, Release,
00070   Next, Skip, Reset, and Clone.
00071 ---------------------------------------------------------------------------*/
00072
00073 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00074   Method:   COEnumConnectionPoints::COEnumConnectionPoints
00075
00076   Summary:  COEnumConnectionPoints Constructor.
00077
00078   Args:     IUnknown* pHostobj
00079               Pointer to the host object whose connection points are
00080               being enumerated.
00081
00082   Modifies: m_cRefs, m_pHostObj, m_iEnumIndex, m_cConnPts, and m_paConnPts.
00083
00084   Returns:  void
00085 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00086 COEnumConnectionPoints::COEnumConnectionPoints(
00087   IUnknown* pHostObj)
00088 {
00089   // Zero the COM object's reference count.
00090   m_cRefs = 0;
00091
00092   // Assign the Host Object pointer.
00093   m_pHostObj = pHostObj;
00094
00095   // Initialize the Connection Point enumerator variables.
00096   m_iEnumIndex = 0;
00097   m_cConnPts = 0;
00098   m_paConnPts = NULL;
00099
00100   return;
00101 }
00102
00103
00104 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00105   Method:   COEnumConnectionPoints::~COEnumConnectionPoints
00106
00107   Summary:  COEnumConnectionPoints Destructor.
00108
00109   Args:     void
00110
00111   Modifies: m_paConnPts.
00112
00113   Returns:  void
00114 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00115 COEnumConnectionPoints::~COEnumConnectionPoints(void)
00116 {
00117   if (NULL != m_paConnPts)
00118   {
00119     UINT i;
00120
00121     // Release all the connection point interface pointers.
00122     for (i=0; i<m_cConnPts; i++)
00123       if (NULL != m_paConnPts[i])
00124         m_paConnPts[i]->Release();
00125
00126     // Delete the array of interface pointers.
00127     delete [] m_paConnPts;
00128   }
00129
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   COEnumConnectionPoints::Init
00136
00137   Summary:  COEnumConnectionPoints Initialization method.  Create any
00138             necessary arrays, structures, and objects.
00139
00140   Args:     ULONG cConnPts,
00141               Number of Connections Points.
00142             IConnectionPoint** paConnPts,
00143               Pointer to array of connection point interface pointers.
00144             ULONG iEnumIndex
00145               The initial Enumerator index value.
00146
00147   Modifies: m_cConnPts, m_paConnPts, m_iEnumIndex.
00148
00149   Returns:  HRESULT
00150               Standard result code. NOERROR for success.
00151 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00152 HRESULT COEnumConnectionPoints::Init(
00153           ULONG cConnPts,
00154           IConnectionPoint** paConnPts,
00155           ULONG iEnumIndex)
00156 {
00157   HRESULT hr = NOERROR;
00158   UINT i;
00159
00160   // Remember the number of Connection points.
00161   m_cConnPts = cConnPts;
00162
00163   // Remember the initial enumerator index.
00164   m_iEnumIndex = iEnumIndex;
00165
00166   // Create a copy of the array of connection points and keep it inside
00167   // this enumerator COM object.
00168   m_paConnPts = new IConnectionPoint* [(UINT) cConnPts];
00169
00170   // Fill the array copy with the IConnectionPoint interface pointers from
00171   // the array passed. AddRef for each new Interface pointer copy made.
00172   if (NULL != m_paConnPts)
00173   {
00174     for (i=0; i<cConnPts; i++)
00175     {
00176       m_paConnPts[i] = paConnPts[i];
00177       m_paConnPts[i]->AddRef();
00178     }
00179   }
00180   else
00181     hr = E_OUTOFMEMORY;
00182
00183   return (hr);
00184 }
00185
00186
00187 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00188   Method:   COEnumConnectionPoints::QueryInterface
00189
00190   Summary:  QueryInterface of the COEnumConnectionPoints non-delegating
00191             IUnknown implementation.
00192
00193   Args:     REFIID riid,
00194               [in] GUID of the Interface being requested.
00195             PPVOID ppv)
00196               [out] Address of the caller's pointer variable that will
00197               receive the requested interface pointer.
00198
00199   Returns:  HRESULT
00200               Standard result code. NOERROR for success.
00201 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00202 STDMETHODIMP COEnumConnectionPoints::QueryInterface(
00203                REFIID riid,
00204                PPVOID ppv)
00205 {
00206   HRESULT hr = E_NOINTERFACE;
00207
00208   *ppv = NULL;
00209
00210   // The IEnumConnectionPoints interface is implemented directly in
00211   // this COM object rather than being a nested interface implementation.
00212   if (IID_IUnknown == riid || IID_IEnumConnectionPoints == riid)
00213     *ppv = (LPVOID)this;
00214
00215   if (NULL != *ppv)
00216   {
00217     // We've handed out a pointer to the interface so obey the COM rules
00218     // and AddRef the reference count.
00219     ((LPUNKNOWN)*ppv)->AddRef();
00220     hr = NOERROR;
00221   }
00222
00223   return (hr);
00224 }
00225
00226
00227 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00228   Method:   COEnumConnectionPoints::AddRef
00229
00230   Summary:  AddRef of the COEnumConnectionPoints non-delegating IUnknown
00231             implementation.
00232
00233   Args:     void
00234
00235   Modifies: m_cRefs.
00236
00237   Returns:  ULONG
00238               New value of m_cRefs (COM object's reference count).
00239 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00240 STDMETHODIMP_(ULONG) COEnumConnectionPoints::AddRef(void)
00241 {
00242   ULONG cRefs;
00243
00244   cRefs = ++m_cRefs;
00245
00246   // Also AddRef the host object to ensure it stays around as long as
00247   // this enumerator.
00248   m_pHostObj->AddRef();
00249
00250   return cRefs;
00251 }
00252
00253
00254 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00255   Method:   COEnumConnectionPoints::Release
00256
00257   Summary:  Release of the COEnumConnectionPoints non-delegating IUnknown
00258             implementation.
00259
00260   Args:     void
00261
00262   Modifies: m_cRefs.
00263
00264   Returns:  ULONG
00265               New value of m_cRefs (COM object's reference count).
00266 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00267 STDMETHODIMP_(ULONG) COEnumConnectionPoints::Release(void)
00268 {
00269   ULONG cRefs;
00270
00271   // Pass this release along to the Host object being enumerated.
00272   m_pHostObj->Release();
00273
00274   cRefs = --m_cRefs;
00275
00276   if (0 == cRefs)
00277   {
00278     // We artificially bump the main ref count to prevent reentrancy via
00279     // the main object destructor.
00280     m_cRefs++;
00281     delete this;
00282   }
00283
00284   return cRefs;
00285 }
00286
00287
00288 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00289   Method:   COEnumConnectionPoints::Next
00290
00291   Summary:  The Next member method of this IEnumConnectionPoints interface
00292             implementation. Called by outside clients of a
00293             COEnumConnectionPoints object to request that a number of next
00294             connection point interface pointers be deposited into an array
00295             supplied by the caller.
00296
00297   Args:     ULONG cReq
00298               Number of connection points requested for return (starting at
00299               the current Enumerator index).
00300             IConnectionPoint** paConnPts,
00301               Pointer to a caller's output array that will receive the
00302               enumerated IConnectionPoint interface pointers.
00303             ULONG* cEnumerated)
00304               Pointer to a ULONG variable that will contain the number of
00305               connection points actually enumerated by this call.
00306
00307   Returns:  HRESULT
00308               Standard result code. NOERROR for success.
00309 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00310 STDMETHODIMP COEnumConnectionPoints::Next(
00311                ULONG cReq,
00312                IConnectionPoint** paConnPts,
00313                ULONG* pcEnumerated)
00314 {
00315   HRESULT hr = NOERROR;
00316   ULONG cRet = 0;
00317
00318   // Make sure the argument values passed are valid.
00319   if (NULL != m_paConnPts)
00320   {
00321     if (NULL != paConnPts)
00322     {
00323       if (NULL != *paConnPts && m_iEnumIndex < m_cConnPts)
00324       {
00325         if (NULL != pcEnumerated)
00326           *pcEnumerated = 0L;
00327         else
00328           if (1L != cReq)
00329             hr = E_POINTER;
00330       }
00331       else
00332         hr = S_FALSE;
00333     }
00334     else
00335       hr = E_POINTER;
00336   }
00337   else
00338     hr = S_FALSE;
00339
00340   if (SUCCEEDED(hr))
00341   {
00342     // Starting at the current Enumerator index, loop to assign the
00343     // requested number of output connection point interface pointers.
00344     for (; m_iEnumIndex < m_cConnPts && cReq > 0;
00345            paConnPts++, cRet++, cReq--)
00346     {
00347       // Assign from the inside Enumerator array to the specified receiving
00348       // array.
00349       *paConnPts = m_paConnPts[m_iEnumIndex++];
00350       // After assigning a copy of an IConnectionPoint pointer, AddRef it.
00351       if (NULL != *paConnPts)
00352         (*paConnPts)->AddRef();
00353     }
00354
00355     // Assign the output number of connection points enumerated.
00356     if (NULL != pcEnumerated)
00357       *pcEnumerated = cRet;
00358   }
00359
00360   return hr;
00361 }
00362
00363
00364 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00365   Method:   COEnumConnectionPoints::Skip
00366
00367   Summary:  The Skip member method of this IEnumConnectionPoints interface
00368             implementation. Starting at the current Enumerator index, skip
00369             the specified number of connection point items.
00370
00371   Args:     ULONG cSkip
00372               Number of Connection Point items to skip.
00373
00374   Returns:  HRESULT
00375               Standard result code. NOERROR for success.
00376 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00377 STDMETHODIMP COEnumConnectionPoints::Skip(
00378                ULONG cSkip)
00379 {
00380   HRESULT hr = NOERROR;
00381
00382   // If there really is a connection point array and the requested
00383   // amount of skip does not exceed the number of connection points,
00384   // then bump the index by the requested skip amount.
00385   if (NULL != m_paConnPts && (m_iEnumIndex + cSkip) < m_cConnPts)
00386     m_iEnumIndex += cSkip;
00387   else
00388     hr = S_FALSE;
00389
00390   return hr;
00391 }
00392
00393
00394 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00395   Method:   COEnumConnectionPoints::Reset
00396
00397   Summary:  The Reset member method of the IEnumConnectionPoints interface
00398             implementation. Resets the Enumeration index to the first
00399             connection point item in the array.
00400
00401   Args:     void.
00402
00403   Returns:  HRESULT
00404               Standard result code. NOERROR for success.
00405 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00406 STDMETHODIMP COEnumConnectionPoints::Reset(
00407                void)
00408 {
00409   // Zero the main Enumerator index.
00410   m_iEnumIndex = 0;
00411
00412   return NOERROR;
00413 }
00414
00415
00416 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00417   Method:   COEnumConnectionPoints::Clone
00418
00419   Summary:  The Clone member method of this IEnumConnectionPoints
00420             interface implementation. Creates a new clone of this entire
00421             Connection Point enumerator COM object.
00422
00423   Args:     IEnumConnectionPoints** ppIEnum
00424               Address of the caller's output pointer variable that will
00425               receive the IEnumConnectionPoints interface pointer of the
00426               new enumerator clone.
00427
00428   Returns:  HRESULT
00429               Standard result code. NOERROR for success.
00430 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00431 STDMETHODIMP COEnumConnectionPoints::Clone(
00432                IEnumConnectionPoints** ppIEnum)
00433 {
00434   HRESULT hr;
00435   COEnumConnectionPoints* pCOEnum;
00436
00437   // NULL the output variable first.
00438   *ppIEnum = NULL;
00439
00440   // Create the Clone Enumerator COM object.
00441   pCOEnum = new COEnumConnectionPoints(m_pHostObj);
00442   if (NULL != pCOEnum)
00443   {
00444     // Initialize it with same values as in this existing enumerator.
00445     hr = pCOEnum->Init(m_cConnPts, m_paConnPts, m_iEnumIndex);
00446     if (SUCCEEDED(hr))
00447     {
00448       // QueryInterface to return the requested interface pointer.
00449       // An AddRef will be conveniently done by the QI.
00450       if (SUCCEEDED(hr))
00451         hr = pCOEnum->QueryInterface(
00452                         IID_IEnumConnectionPoints,
00453                         (PPVOID)ppIEnum);
00454     }
00455   }
00456   else
00457     hr = E_OUTOFMEMORY;
00458
00459   return hr;
00460 }
00461
00462
00463 /*---------------------------------------------------------------------------
00464   COConnectionPoint's implementation of its main COM object class
00465   including Constructor, Destructor, QueryInterface, AddRef, Release,
00466   GetConnectionInterface, GetConnectionPointContainer, Advise, Unadvise,
00467   and EnumConnections.
00468 ---------------------------------------------------------------------------*/
00469
00470 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00471   Method:   COConnectionPoint::COConnectionPoint
00472
00473   Summary:  COConnectionPoint Constructor.
00474
00475   Args:     IUnknown* pHostObj
00476               Pointer to IUnknown of the connectable object offering this
00477               connection point.
00478
00479   Returns:  void
00480 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00481 COConnectionPoint::COConnectionPoint(
00482   IUnknown* pHostObj)
00483 {
00484   // Zero the COM object's reference count.
00485   m_cRefs = 0;
00486
00487   // Remember an IUnknown pointer to the connectable object that offers
00488   // this connection point. Since this connection point object's lifetime
00489   // is geared to that of the connectable object there is no need to
00490   // AddRef the following copied pointer to the connectable object.
00491   m_pHostObj = pHostObj;
00492
00493   // Initialize the Connection Point variables.
00494   m_dwNextCookie = COOKIE_START_VALUE;
00495   m_uiMaxIndex = 0;
00496   m_cConnections = 0;
00497   m_paConnections = NULL;
00498
00499   return;
00500 }
00501
00502
00503 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00504   Method:   COConnectionPoint::~COConnectionPoint
00505
00506   Summary:  COConnectionPoint Destructor.
00507
00508   Args:     void
00509
00510   Modifies: m_paConnections.
00511
00512   Returns:  void
00513 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00514 COConnectionPoint::~COConnectionPoint(void)
00515 {
00516   UINT i;
00517   IUnknown* pUnk;
00518
00519   if (NULL != m_paConnections)
00520   {
00521     // Release all the connection sink interface pointers.
00522     for (i=0; i<m_uiMaxIndex; i++)
00523     {
00524       pUnk = m_paConnections[i].pUnk;
00525       if (NULL != pUnk)
00526         pUnk->Release();
00527     }
00528
00529     // Delete the array of interface pointers.
00530     delete [] m_paConnections;
00531   }
00532
00533   return;
00534 }
00535
00536
00537 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00538   Method:   COConnectionPoint::Init
00539
00540   Summary:  COConnectionPoint Initialization method.  Create any
00541             necessary arrays, structures, and subordinate objects.
00542
00543   Args:     REFIID riid
00544               Reference to the IID of the Sink interface associated with
00545               this connection point.
00546
00547   Returns:  HRESULT
00548               Standard result code. NOERROR for success.
00549 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00550 HRESULT COConnectionPoint::Init(
00551           REFIID riid)
00552 {
00553   HRESULT hr = NOERROR;
00554   CONNECTDATA* paConns;
00555
00556   // Keep a copy of the reference to the IID of the sink interface
00557   // associated with this connection point. Needed for later
00558   // use by the GetConnectionInterface method.
00559   m_iidSink = riid;
00560
00561   // Build the initial dynamic array for connections.
00562   paConns = new CONNECTDATA[ALLOC_CONNECTIONS];
00563   if (NULL != paConns)
00564   {
00565     // Zero the array.
00566     memset(paConns, 0, ALLOC_CONNECTIONS * sizeof(CONNECTDATA));
00567
00568     // Rig this connection point object so that it will use the
00569     // new internal array of connections.
00570     m_uiMaxIndex = ALLOC_CONNECTIONS;
00571     m_paConnections = paConns;
00572   }
00573   else
00574     hr = E_OUTOFMEMORY;
00575
00576   return (hr);
00577 }
00578
00579
00580 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00581   Method:   COConnectionPoint::QueryInterface
00582
00583   Summary:  QueryInterface of the COConnectionPoint non-delegating
00584             IUnknown implementation.
00585
00586   Args:     REFIID riid,
00587               [in] GUID of the Interface being requested.
00588             PPVOID ppv)
00589               [out] Address of the caller's pointer variable that will
00590               receive the requested interface pointer.
00591
00592   Returns:  HRESULT
00593               Standard result code. NOERROR for success.
00594 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00595 STDMETHODIMP COConnectionPoint::QueryInterface(
00596                REFIID riid,
00597                PPVOID ppv)
00598 {
00599   HRESULT hr = E_NOINTERFACE;
00600
00601   *ppv = NULL;
00602
00603   // The IConnectionPoint interface is implemented directly in this
00604   // COM object rather than being a nested interface implementation.
00605   if (IID_IUnknown == riid || IID_IConnectionPoint == riid)
00606     *ppv = (LPVOID)this;
00607
00608   if (NULL != *ppv)
00609   {
00610     // We've handed out a pointer to the interface so obey the COM rules
00611     // and AddRef the reference count.
00612     ((LPUNKNOWN)*ppv)->AddRef();
00613     hr = NOERROR;
00614   }
00615
00616   return (hr);
00617 }
00618
00619
00620 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00621   Method:   COConnectionPoint::AddRef
00622
00623   Summary:  AddRef of the COConnectionPoint non-delegating IUnknown
00624             implementation.
00625
00626   Args:     void
00627
00628   Modifies: m_cRefs.
00629
00630   Returns:  ULONG
00631               New value of m_cRefs (COM object's reference count).
00632 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00633 STDMETHODIMP_(ULONG) COConnectionPoint::AddRef(void)
00634 {
00635   ULONG cRefs;
00636
00637   if (OwnThis())
00638   {
00639     cRefs = ++m_cRefs;
00640
00641     UnOwnThis();
00642   }
00643
00644   return cRefs;
00645 }
00646
00647
00648 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00649   Method:   COConnectionPoint::Release
00650
00651   Summary:  Release of the COConnectionPoint non-delegating IUnknown
00652             implementation.
00653
00654   Args:     void
00655
00656   Modifies: m_cRefs.
00657
00658   Returns:  ULONG
00659               New value of m_cRefs (COM object's reference count).
00660 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00661 STDMETHODIMP_(ULONG) COConnectionPoint::Release(void)
00662 {
00663   ULONG cRefs;
00664
00665   if (OwnThis())
00666   {
00667     cRefs = --m_cRefs;
00668
00669     if (0 == cRefs)
00670     {
00671       // We artificially bump the main ref count to prevent reentrancy via
00672       // the main object destructor. We relinquish thread ownership of this
00673       // object prior to deleting it--a good practice.
00674       m_cRefs++;
00675       UnOwnThis();
00676       delete this;
00677     }
00678     else
00679       UnOwnThis();
00680   }
00681
00682   return cRefs;
00683 }
00684
00685
00686 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00687   Method:   COConnectionPoint::GetSlot
00688
00689   Summary:  An internal private utility member method to obtain a free
00690             slot in the dynamic connections array. GetSlot will expand the
00691             dynamic array for more entries if needed. To guarantee thread
00692             safety, this private method should always be called within the
00693             protection of a bracketed OwnThis, UnOwnThis pair.
00694
00695   Args:     UINT* puiFreeSlot
00696               Address of an output variable to receive the free slot index.
00697
00698   Modifies: m_uiMaxIndex, m_paConnections.
00699
00700   Returns:  HRESULT
00701               Standard result code. NOERROR for success.
00702 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00703 HRESULT COConnectionPoint::GetSlot(
00704           UINT* puiFreeSlot)
00705 {
00706   HRESULT hr = NOERROR;
00707   BOOL bOpen = FALSE;
00708   UINT i;
00709   CONNECTDATA* paConns;
00710
00711   // Zero the output variable.
00712   *puiFreeSlot = 0;
00713
00714   // Loop to find an empty slot.
00715   for (i=0; i<m_uiMaxIndex; i++)
00716   {
00717     if (m_paConnections[i].dwCookie == 0)
00718     {
00719       // We found an open empty slot.
00720       *puiFreeSlot = i;
00721       bOpen = TRUE;
00722       break;
00723     }
00724   }
00725
00726   if (!bOpen)
00727   {
00728     // We didn't find an existing open slot in the array--it's full.
00729     // Expand the array by ALLOC_CONNECTIONS entries and assign the
00730     // appropriate output index.
00731     paConns = new CONNECTDATA[m_uiMaxIndex + ALLOC_CONNECTIONS];
00732     if (NULL != paConns)
00733     {
00734       // Copy the content of the old full array to the new larger array.
00735       for (i=0; i<m_uiMaxIndex; i++)
00736       {
00737         paConns[i].pUnk = m_paConnections[i].pUnk;
00738         paConns[i].dwCookie = m_paConnections[i].dwCookie;
00739       }
00740
00741       // Zero (ie mark as empty) the expanded portion of the new array.
00742       for (i=m_uiMaxIndex; i<m_uiMaxIndex+ALLOC_CONNECTIONS; i++)
00743       {
00744         paConns[i].pUnk = NULL;
00745         paConns[i].dwCookie = 0;
00746       }
00747
00748       // New larger array is ready--delete the old array.
00749       delete [] m_paConnections;
00750
00751       // Rig the connection point to use the new larger array.
00752       m_paConnections = paConns;
00753
00754       // Assign the output free slot as first entry in new expanded area.
00755       *puiFreeSlot = m_uiMaxIndex;
00756
00757       // Calculate the new max index.
00758       m_uiMaxIndex += ALLOC_CONNECTIONS;
00759     }
00760     else
00761       hr = E_OUTOFMEMORY;
00762   }
00763
00764   return hr;
00765 }
00766
00767
00768 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00769   Method:   COConnectionPoint::FindSlot
00770
00771   Summary:  An internal private utility member method to find an existing
00772             slot (identified by the specified dwCookie value) in the
00773             dynamic connections array.
00774
00775   Args:     DWORD dwCookie,
00776               The connection key (cookie) to find.
00777             UINT* puiSlot)
00778               Address of an output variable to receive the slot index.
00779
00780   Returns:  HRESULT
00781               Standard result code. NOERROR for success.
00782 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00783 HRESULT COConnectionPoint::FindSlot(
00784           DWORD dwCookie,
00785           UINT* puiSlot)
00786 {
00787   HRESULT hr = CONNECT_E_NOCONNECTION;
00788   UINT i;
00789
00790   // Loop to find the Cookie.
00791   for (i=0; i<m_uiMaxIndex; i++)
00792   {
00793     if (dwCookie == m_paConnections[i].dwCookie)
00794     {
00795       // If a cookie match is found, assign the output slot index.
00796       *puiSlot = i;
00797       hr = NOERROR;
00798       break;
00799     }
00800   }
00801
00802   return hr;
00803 }
00804
00805
00806 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00807   Method:   COConnectionPoint::GetConnectionInterface
00808
00809   Summary:  The GetConnectionInterface member method of this
00810             IConnectionPoint interface implementation. Called to get the
00811             IID of the Sink interface associated with this connection
00812             point.
00813
00814   Args:     IID* piidSink
00815               Pointer to the IID of the associated sink interface.
00816
00817   Returns:  HRESULT
00818               Standard result code. NOERROR for success.
00819 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00820 STDMETHODIMP COConnectionPoint::GetConnectionInterface(
00821                IID* piidSink)
00822 {
00823   HRESULT hr = NOERROR;
00824
00825   if (NULL != piidSink)
00826     *piidSink = m_iidSink;
00827   else
00828     hr = E_POINTER;
00829
00830   return hr;
00831 }
00832
00833
00834 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00835   Method:   COConnectionPoint::GetConnectionPointContainer
00836
00837   Summary:  The GetConnectionPointContainer member method of this
00838             IConnectionPoint interface implementation. Called to get the
00839             connection point container that contains this connection
00840             point.
00841
00842   Args:     IConnectionPointContainer** ppConnPtCon
00843               Address of the pointer variable that will recieve the
00844               IConnectionPointContainer interface pointer.
00845
00846   Returns:  HRESULT
00847               Standard result code. NOERROR for success.
00848 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00849 STDMETHODIMP COConnectionPoint::GetConnectionPointContainer(
00850                IConnectionPointContainer** ppConnPtCon)
00851 {
00852   HRESULT hr;
00853
00854   // Use QueryInterface to get the interface pointer and to perform the
00855   // needed AddRef on the returned pointer.
00856   hr = m_pHostObj->QueryInterface(
00857                      IID_IConnectionPointContainer,
00858                      (PPVOID) ppConnPtCon);
00859
00860   return hr;
00861 }
00862
00863
00864 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00865   Method:   COConnectionPoint::Advise
00866
00867   Summary:  The Advise member method of this IConnectionPoint interface
00868             implementation. Called by clients to establish a connection of
00869             their sink to this connection point. Uses the CThreaded
00870             OwnThis mechanism to provide mutually exclusive access by
00871             multiple threads.
00872
00873   Args:     IUnknown* pUnkSink
00874               IUnknown interface pointer of the Sink object in the client.
00875             DWORD* pdwCookie
00876               Pointer to a DWORD in the client that will receive a unique
00877               key used by the client to refer to the connection established
00878               by this Advise call.
00879
00880   Returns:  HRESULT
00881               Standard result code. NOERROR for success.
00882 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00883 STDMETHODIMP COConnectionPoint::Advise(
00884                IUnknown* pUnkSink,
00885                DWORD* pdwCookie)
00886 {
00887   HRESULT hr = NOERROR;
00888   UINT uiFreeSlot = 0;
00889   IUnknown* pISink = NULL;
00890
00891   if (OwnThis())
00892   {
00893     // Zero the output connection key.
00894     *pdwCookie = 0;
00895
00896     // Get the specific associated client Sink interface that this
00897     // connection point expects to use for notifications.
00898     hr = pUnkSink->QueryInterface(m_iidSink, (PPVOID)&pISink);
00899     if (SUCCEEDED(hr))
00900     {
00901       // Store the specific sink interface in this connection point's
00902       // array of live connections. First find a free slot (expand the
00903       // array if needed).
00904       hr = GetSlot(&uiFreeSlot);
00905       if (SUCCEEDED(hr))
00906       {
00907         // Assign the new slot with the connection entry.
00908         m_paConnections[uiFreeSlot].pUnk = pISink;
00909         m_paConnections[uiFreeSlot].dwCookie = m_dwNextCookie;
00910
00911         // Assign the output Cookie value.
00912         *pdwCookie = m_dwNextCookie;
00913
00914         // Increment the Cookie counter.
00915         m_dwNextCookie++;
00916
00917         // Increment the number of live connections.
00918         m_cConnections++;
00919       }
00920     }
00921     else if (hr == E_NOINTERFACE)
00922     {
00923        // The sink does not support m_iidSink.
00924        hr = CONNECT_E_CANNOTCONNECT;
00925     }
00926
00927     UnOwnThis();
00928   }
00929
00930   return hr;
00931 }
00932
00933
00934 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00935   Method:   COConnectionPoint::Unadvise
00936
00937   Summary:  The Unadvise member method of this IConnectionPoint interface
00938             implementation. Called by clients to disconnect a connection
00939             of their sink to this connection point. The connection is
00940             identified by the dwCookie argument (obtained by a previous
00941             Advise call). Uses the CThreaded OwnThis mechanism to provide
00942             mutually exclusive access by multiple threads.
00943
00944   Args:     DWORD dwCookie
00945               Connection key that was obtained by a previous Advise call.
00946
00947   Returns:  HRESULT
00948               Standard result code. NOERROR for success.
00949 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00950 STDMETHODIMP COConnectionPoint::Unadvise(
00951                DWORD dwCookie)
00952 {
00953   HRESULT hr = NOERROR;
00954   UINT uiSlot;
00955
00956   if (0 != dwCookie)
00957   {
00958     if (OwnThis())
00959     {
00960       hr = FindSlot(dwCookie, &uiSlot);
00961       if (SUCCEEDED(hr))
00962       {
00963         // Release the sink interface.
00964         RELEASE_INTERFACE(m_paConnections[uiSlot].pUnk);
00965
00966         // Mark the array entry as empty.
00967         m_paConnections[uiSlot].dwCookie = 0;
00968
00969         // Decrement the number of live connections.
00970         m_cConnections--;
00971       }
00972
00973       UnOwnThis();
00974     }
00975   }
00976   else
00977     hr = E_INVALIDARG;
00978
00979   return hr;
00980 }
00981
00982
00983 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00984   Method:   COConnectionPoint::EnumConnections
00985
00986   Summary:  The EnumConnections member method of this IConnectionPoint
00987             interface implementation. Called to obtain an IEnumConnections
00988             enumerator interface that can be used to enumerate the
00989             connections of this connection point. Uses the CThreaded
00990             OwnThis mechanism to ensure mutually exclusive access by
00991             multiple threads.
00992
00993   Args:     IEnumConnections** ppIEnum
00994               Address of the caller's output pointer variable that will
00995               receive the enumerator IEnumConnections interface pointer.
00996
00997   Returns:  HRESULT
00998               Standard result code. NOERROR for success.
00999 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01000 STDMETHODIMP COConnectionPoint::EnumConnections(
01001                IEnumConnections** ppIEnum)
01002 {
01003   HRESULT hr = OLE_E_NOCONNECTION;
01004   CONNECTDATA* paConns;
01005   COEnumConnections* pCOEnum;
01006   UINT i,j;
01007
01008   if (OwnThis())
01009   {
01010     // Zero the output enumerator interface pointer.
01011     *ppIEnum = NULL;
01012
01013     if (0 != m_cConnections)
01014     {
01015       // Create an array of CONNECTDATA structures.
01016       paConns = new CONNECTDATA[(UINT)m_cConnections];
01017       if (NULL != paConns)
01018       {
01019         for (i=0, j=0; i<m_uiMaxIndex && j<m_cConnections; i++)
01020         {
01021           // Copy non-empty entries only.
01022           if (0 != m_paConnections[i].dwCookie)
01023           {
01024             // Assign the occupied entry.
01025             paConns[j].pUnk = (IUnknown*)m_paConnections[i].pUnk;
01026             paConns[j].dwCookie = m_paConnections[i].dwCookie;
01027             j++;
01028           }
01029         }
01030
01031         // Create a new COM object for enumerating connections. Pass
01032         // 'this' as a pHostObj pointer used later to ensure the host
01033         // connection point object stays alive as long as the enumerator
01034         // that enumerates connections to that connection point.
01035         pCOEnum = new COEnumConnections(this);
01036         if (NULL != pCOEnum)
01037         {
01038           // Use the previously constructed (paConns) array of connections
01039           // to init the new COEnumConnections COM object. The Init will
01040           // build yet another internal copy of this array. Set the
01041           // initial enumerator index to 0.
01042           hr = pCOEnum->Init(m_cConnections, paConns, 0);
01043
01044           // QueryInterface to return the requested interface pointer.
01045           // An AddRef will be conveniently done by the QI.
01046           if (SUCCEEDED(hr))
01047             hr = pCOEnum->QueryInterface(
01048                             IID_IEnumConnections,
01049                             (PPVOID)ppIEnum);
01050         }
01051         else
01052           hr = E_OUTOFMEMORY;
01053
01054         // We're done with the locally constructed array copy--delete it.
01055         delete [] paConns;
01056       }
01057       else
01058         hr = E_OUTOFMEMORY;
01059     }
01060
01061     UnOwnThis();
01062   }
01063
01064   return hr;
01065 }
01066
01067
01068 /*---------------------------------------------------------------------------
01069   COEnumConnections's implementation of its main COM object class
01070   including Constructor, Destructor, QueryInterface, AddRef, Release,
01071   Next, Skip, Reset, and Clone.
01072 ---------------------------------------------------------------------------*/
01073
01074 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01075   Method:   COEnumConnections::COEnumConnections
01076
01077   Summary:  COEnumConnections Constructor.
01078
01079   Args:     IUnknown* pHostObj
01080               Pointer to IUnknown interface of the host Connection Point
01081               COM object whose connections are being enumerated.
01082
01083   Modifies: m_cRefs, m_pHostObj, m_iEnumIndex, m_cConnections,
01084             and m_paConnections.
01085
01086   Returns:  void
01087 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01088 COEnumConnections::COEnumConnections(
01089   IUnknown* pHostObj)
01090 {
01091   // Zero the COM object's reference count.
01092   m_cRefs = 0;
01093
01094   // Assign the Host Object pointer.
01095   m_pHostObj = pHostObj;
01096
01097   // Initialize the Connection Point enumerator variables.
01098   m_iEnumIndex = 0;
01099   m_cConnections = 0;
01100   m_paConnections = NULL;
01101
01102   return;
01103 }
01104
01105
01106 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01107   Method:   COEnumConnections::~COEnumConnections
01108
01109   Summary:  COEnumConnections Destructor.
01110
01111   Args:     void
01112
01113   Modifies: m_paConnections.
01114
01115   Returns:  void
01116 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01117 COEnumConnections::~COEnumConnections(void)
01118 {
01119   if (NULL != m_paConnections)
01120   {
01121     UINT i;
01122
01123     // Release all the connected sink interface pointers.
01124     for (i=0; i<m_cConnections; i++)
01125       m_paConnections[i].pUnk->Release();
01126
01127     // Delete the array of connections.
01128     delete [] m_paConnections;
01129   }
01130
01131   return;
01132 }
01133
01134
01135 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01136   Method:   COEnumConnections::Init
01137
01138   Summary:  COEnumConnections Initialization method.  Create any
01139             necessary arrays, structures, and objects.
01140
01141   Args:     ULONG cConnections
01142               Number of Connections.
01143             CONNECTDATA* paConnections,
01144               Pointer to array of connections.
01145             ULONG iEnumIndex
01146               The Enumerator index initial value.
01147
01148   Modifies: m_cConnections, m_paConnections, m_pHostObj, m_iEnumIndex.
01149
01150   Returns:  HRESULT
01151               Standard result code. NOERROR for success.
01152 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01153 HRESULT COEnumConnections::Init(
01154           ULONG cConnections,
01155           CONNECTDATA* paConnections,
01156           ULONG iEnumIndex)
01157 {
01158   HRESULT hr = NOERROR;
01159   UINT i;
01160
01161   // Remember the number of live Connections.
01162   m_cConnections = cConnections;
01163
01164   // Remember the initial enumerator index.
01165   m_iEnumIndex = iEnumIndex;
01166
01167   // Create a copy of the array of connections and keep it inside
01168   // this enumerator COM object.
01169   m_paConnections = new CONNECTDATA [(UINT) cConnections];
01170
01171   // Fill the array copy with the connection data from the connections
01172   // array passed. AddRef for each new sink Interface pointer copy made.
01173   if (NULL != m_paConnections)
01174   {
01175     for (i=0; i<cConnections; i++)
01176     {
01177       m_paConnections[i] = paConnections[i];
01178       m_paConnections[i].pUnk->AddRef();
01179     }
01180   }
01181   else
01182     hr = E_OUTOFMEMORY;
01183
01184   return (hr);
01185 }
01186
01187
01188 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01189   Method:   COEnumConnections::QueryInterface
01190
01191   Summary:  QueryInterface of the COEnumConnections non-delegating
01192             IUnknown implementation.
01193
01194   Args:     REFIID riid,
01195               [in] GUID of the Interface being requested.
01196             PPVOID ppv)
01197               [out] Address of the caller's pointer variable that will
01198               receive the requested interface pointer.
01199
01200   Returns:  HRESULT
01201               Standard result code. NOERROR for success.
01202 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01203 STDMETHODIMP COEnumConnections::QueryInterface(
01204                REFIID riid,
01205                PPVOID ppv)
01206 {
01207   HRESULT hr = E_NOINTERFACE;
01208
01209   *ppv = NULL;
01210
01211   // The IEnumConnections interface is implemented directly in
01212   // this COM object rather than being a nested interface implementation.
01213   if (IID_IUnknown == riid || IID_IEnumConnections == riid)
01214     *ppv = (LPVOID)this;
01215
01216   if (NULL != *ppv)
01217   {
01218     // We've handed out a pointer to the interface so obey the COM rules
01219     // and AddRef the reference count.
01220     ((LPUNKNOWN)*ppv)->AddRef();
01221     hr = NOERROR;
01222   }
01223
01224   return (hr);
01225 }
01226
01227
01228 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01229   Method:   COEnumConnections::AddRef
01230
01231   Summary:  AddRef of the COEnumConnections non-delegating IUnknown
01232             implementation.
01233
01234   Args:     void
01235
01236   Modifies: m_cRefs.
01237
01238   Returns:  ULONG
01239               New value of m_cRefs (COM object's reference count).
01240 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01241 STDMETHODIMP_(ULONG) COEnumConnections::AddRef(void)
01242 {
01243   ULONG cRefs;
01244
01245   cRefs = ++m_cRefs;
01246
01247   // Also AddRef the host object to ensure it stays around as long as
01248   // this enumerator.
01249   m_pHostObj->AddRef();
01250
01251   return cRefs;
01252 }
01253
01254
01255 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01256   Method:   COEnumConnections::Release
01257
01258   Summary:  Release of the COEnumConnections non-delegating IUnknown
01259             implementation.
01260
01261   Args:     void
01262
01263   Modifies: m_cRefs.
01264
01265   Returns:  ULONG
01266               New value of m_cRefs (COM object's reference count).
01267 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01268 STDMETHODIMP_(ULONG) COEnumConnections::Release(void)
01269 {
01270   ULONG cRefs;
01271
01272   // Pass this release along to the Host object being enumerated.
01273   m_pHostObj->Release();
01274
01275   cRefs = --m_cRefs;
01276
01277   if (0 == cRefs)
01278   {
01279     // We artificially bump the main ref count to prevent reentrancy via
01280     // the main object destructor.
01281     m_cRefs++;
01282     delete this;
01283   }
01284
01285   return cRefs;
01286 }
01287
01288
01289 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01290   Method:   COEnumConnections::Next
01291
01292   Summary:  The Next member method of this IEnumConnections interface
01293             implementation. Called by outside clients of a
01294             COEnumConnections object to request a number of next
01295             connections be returned in an array supplied by the caller.
01296
01297   Args:     ULONG cReq
01298               Number of connection points requested for return (starting at
01299               the current Enumerator index).
01300             CONNECTDATA* paConnections,
01301               Pointer to a caller's output array that will receive the
01302               enumerated connection data structures.
01303             ULONG* pcEnumerated)
01304               Pointer to a ULONG variable that will contain the number of
01305               connection points actually enumerated by this call.
01306
01307   Returns:  HRESULT
01308               Standard result code. NOERROR for success.
01309 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01310 STDMETHODIMP COEnumConnections::Next(
01311                ULONG cReq,
01312                CONNECTDATA* paConnections,
01313                ULONG* pcEnumerated)
01314 {
01315   HRESULT hr = NOERROR;
01316   ULONG cRet = 0;
01317
01318   // Make sure the argument values passed are valid.
01319   if (NULL != m_paConnections)
01320   {
01321     if (NULL != paConnections)
01322     {
01323       if (m_iEnumIndex < m_cConnections)
01324       {
01325         if (NULL != pcEnumerated)
01326           *pcEnumerated = 0L;
01327         else
01328           if (1L != cReq)
01329             hr = E_POINTER;
01330       }
01331       else
01332         hr = S_FALSE;
01333     }
01334     else
01335       hr = E_POINTER;
01336   }
01337   else
01338     hr = S_FALSE;
01339
01340   if (SUCCEEDED(hr))
01341   {
01342     // Starting at the current Enumerator index, loop to assign the
01343     // requested number of output connection data structures.
01344     for (; m_iEnumIndex < m_cConnections && cReq > 0;
01345            paConnections++, m_iEnumIndex++, cRet++, cReq--)
01346     {
01347       // Because we are assigning a copy of a connection's data, AddRef
01348       // its sink interface pointer.
01349       if (NULL != m_paConnections[m_iEnumIndex].pUnk)
01350         m_paConnections[m_iEnumIndex].pUnk->AddRef();
01351
01352       // Assign a connection's data from the inside Enumerator array to
01353       // the specified output receiving array.
01354       *paConnections = m_paConnections[m_iEnumIndex];
01355     }
01356
01357     // Assign the output number of connections enumerated.
01358     if (NULL != pcEnumerated)
01359       *pcEnumerated = cRet;
01360   }
01361
01362   return hr;
01363 }
01364
01365
01366 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01367   Method:   COEnumConnections::Skip
01368
01369   Summary:  The Skip member method of this IEnumConnections interface
01370             implementation. Starting at the current Enumerator index, skip
01371             the specified number of connection items.
01372
01373   Args:     ULONG cSkip
01374               Number of Connection items to skip.
01375
01376   Returns:  HRESULT
01377               Standard result code. NOERROR for success.
01378 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01379 STDMETHODIMP COEnumConnections::Skip(
01380                ULONG cSkip)
01381 {
01382   HRESULT hr = NOERROR;
01383
01384   // If there really is a connection array and the requested
01385   // amount of skip does not exceed the number of connections,
01386   // then bump the index by the requested skip amount.
01387   if (NULL != m_paConnections && (m_iEnumIndex + cSkip) < m_cConnections)
01388     m_iEnumIndex += cSkip;
01389   else
01390     hr = S_FALSE;
01391
01392   return hr;
01393 }
01394
01395
01396 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01397   Method:   COEnumConnections::Reset
01398
01399   Summary:  The Reset member method of the IEnumConnections interface
01400             implementation. Resets the Enumeration index to the first
01401             connection item in the array.
01402
01403   Args:     void.
01404
01405   Returns:  HRESULT
01406               Standard result code. NOERROR for success.
01407 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01408 STDMETHODIMP COEnumConnections::Reset(
01409                void)
01410 {
01411   // Zero the main Enumerator index.
01412   m_iEnumIndex = 0;
01413
01414   return NOERROR;
01415 }
01416
01417
01418 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01419   Method:   COEnumConnections::Clone
01420
01421   Summary:  The Clone member method of this IEnumConnections interface
01422             implementation. Creates a new clone of this entire Connection
01423             enumerator COM object and returns a pointer to its
01424             IEnumConnections interface.
01425
01426   Args:     IEnumConnections** ppIEnum
01427               Address of the caller's output pointer variable that will
01428               receive the IEnumConnections interface pointer of the
01429               new enumerator clone.
01430
01431   Returns:  HRESULT
01432               Standard result code. NOERROR for success.
01433 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01434 STDMETHODIMP COEnumConnections::Clone(
01435                IEnumConnections** ppIEnum)
01436 {
01437   HRESULT hr;
01438   COEnumConnections* pCOEnum;
01439
01440   // NULL the output variable first.
01441   *ppIEnum = NULL;
01442
01443   // Create the Clone Enumerator COM object.
01444   pCOEnum = new COEnumConnections(m_pHostObj);
01445   if (NULL != pCOEnum)
01446   {
01447     // Initialize it with same values as in this existing enumerator.
01448     hr = pCOEnum->Init(m_cConnections, m_paConnections, m_iEnumIndex);
01449     if (SUCCEEDED(hr))
01450     {
01451       // QueryInterface to return the requested interface pointer.
01452       // An AddRef will be conveniently done by the QI.
01453       if (SUCCEEDED(hr))
01454         hr = pCOEnum->QueryInterface(
01455                         IID_IEnumConnections,
01456                         (PPVOID)ppIEnum);
01457     }
01458   }
01459   else
01460     hr = E_OUTOFMEMORY;
01461
01462   return hr;
01463 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::LineSeparatorEnum Member List

This is the complete list of members for msado15::LineSeparatorEnum, including all inherited members.
adCR | msado15::LineSeparatorEnum | [static]
adCRLF | msado15::LineSeparatorEnum | [static]
adLF | msado15::LineSeparatorEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COLORPICKSTATE Member List

This is the complete list of members for COLORPICKSTATE, including all inherited members.
fDone | COLORPICKSTATE
hwndOwner | COLORPICKSTATE
iResult | COLORPICKSTATE
iSel | COLORPICKSTATE
Generated on Wed Nov 13 2024 16:57:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/Paint.c Source File

  • Multimedia
  • Gdi
  • Printer

Paint.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /******************************************************************************\
00013 *
00014 *  MODULE:      PAINT.C
00015 *
00016 *  PURPOSE:     Given an HDC and a pointer to a bounding rectangle
00017 *               draw all graphics/fonts based on the flags set in
00018 *               the dwGraphicsOptions global variable.
00019 *
00020 *  FUNTIONS:    Paint              - main painting routine
00021 *               GetFirstGraphicSlot- computes bounding rect of 1st
00022 *                                      graphic
00023 *               GetNextGraphicSlot - computes bounding rect of next
00024 *                                      graphic
00025 *               DrawFonts          - draws enumerated fonts
00026 *               BuildFontList      - builds a list of fonts of fonts
00027 *                                      supported by a given DC
00028 *               MyEnumFaces        - enumerates the font facenames
00029 *                                      supported by a given DC
00030 *               MyEnumCopy         - copies LOGFONT & TEXTMETRIC info
00031 *                                      to a global variable
00032 *               MyEnumCount        - counts total number of fonts
00033 *                                      supported by a given DC
00034 *               FreeFontList       - frees a (BuildFontList-) font list
00035 *
00036 *  COMMENTS:    Most of the font-enumeration code "lifted" from NTF.EXE
00037 *               sample. For more complete documentation have a look a
00038 *               that.
00039 *
00040 \******************************************************************************/
00041
00042 #include <windows.h>
00043 #include <string.h>
00044 #include "common.h"
00045 #include "paint.h"
00046 #include "resource.h"
00047
00048
00049 /******************************************************************************\
00050 *
00051 *  FUNCTION:    Paint
00052 *
00053 *  INPUTS:      hdc    - device context to paint
00054 *               lpRect - bounding rectangle of device to paint
00055 *
00056 *  RETURNS:     TRUE if painting went ok, or
00057 *               FALSE if error while painting
00058 *
00059 \******************************************************************************/
00060
00061 BOOL Paint (HDC hdc, LPRECT lpRect)
00062 {
00063   RECT  rect;
00064   HPEN  hpenSave;
00065   RECTI ri;
00066
00067   if (gdwGraphicsOptions & DRAWAXIS)
00068   {
00069     //
00070     // draw axis
00071     //
00072
00073     rect = *lpRect;
00074
00075     hpenSave = SelectObject (hdc, GetStockObject (BLACK_PEN));
00076
00077     //
00078     // if giMapMode == MM_TEXT, MM_ANISOTROPIC then (0,0) is upper left corner
00079     //
00080
00081     if (giMapMode == MM_TEXT || giMapMode == MM_ANISOTROPIC)
00082     {
00083       MoveToEx (hdc, rect.left - glcyMenu/2, rect.bottom, NULL);
00084       LineTo   (hdc, rect.left,  rect.bottom + glcyMenu/2);
00085       LineTo   (hdc, rect.left + glcyMenu/2,  rect.bottom);
00086
00087       MoveToEx (hdc, rect.left,  rect.bottom + glcyMenu/2, NULL);
00088       LineTo   (hdc, rect.left,  rect.top);
00089       LineTo   (hdc, rect.right + glcyMenu/2, rect.top);
00090
00091       MoveToEx (hdc, rect.right, rect.top - glcyMenu/2, NULL);
00092       LineTo   (hdc, rect.right + glcyMenu/2,  rect.top);
00093       LineTo   (hdc, rect.right,  rect.top + glcyMenu/2);
00094     }
00095
00096     //
00097     // else (0,0) is lower left corner
00098     //
00099
00100     else
00101     {
00102       MoveToEx (hdc, rect.left - glcyMenu/2, rect.bottom, NULL);
00103       LineTo   (hdc, rect.left,  rect.bottom + glcyMenu/2);
00104       LineTo   (hdc, rect.left + glcyMenu/2,  rect.bottom);
00105
00106       MoveToEx (hdc, rect.left,  rect.bottom + glcyMenu/2, NULL);
00107       LineTo   (hdc, rect.left,  rect.top);
00108       LineTo   (hdc, rect.right + glcyMenu/2, rect.top);
00109
00110       MoveToEx (hdc, rect.right, rect.top + glcyMenu/2, NULL);
00111       LineTo   (hdc, rect.right + glcyMenu/2, rect.top);
00112       LineTo   (hdc, rect.right, rect.top - glcyMenu/2);
00113     }
00114
00115     SelectObject (hdc, hpenSave);
00116   }
00117
00118   //
00119   // look at bits in gdwGraphicsOptions & determine which graphics to draw
00120   //
00121
00122   if (gdwGraphicsOptions & ENUMFONTS)
00123   {
00124     DrawFonts (hdc, lpRect);
00125     return TRUE;
00126   }
00127
00128   giDeltaX = (int) ((lpRect->right - BORDER) / NUM_GRAPHICS_XSLOTS);
00129   giDeltaY = (int) ((lpRect->bottom - lpRect->top - BORDER)
00130     / NUM_GRAPHICS_YSLOTS);
00131
00132   GetFirstGraphicSlot (lpRect, &ri);
00133
00134   if (gdwGraphicsOptions & ARC)
00135   {
00136     Arc (hdc, ri.left, ri.top, ri.right, ri.bottom,
00137       ri.left, ri.top, ri.right-10, ri.bottom-10);
00138     GetNextGraphicSlot (&ri);
00139   }
00140
00141   if (gdwGraphicsOptions & ELLIPSE)
00142   {
00143     Ellipse (hdc, ri.left, ri.top, ri.right, ri.bottom);
00144     GetNextGraphicSlot (&ri);
00145   }
00146
00147   if (gdwGraphicsOptions & LINETO)
00148   {
00149     int i;
00150
00151     for (i = PS_SOLID; i <= PS_DASHDOTDOT; i++)
00152     {
00153       MoveToEx (hdc, ri.left, ri.top + (i+1)*giDeltaY/7, NULL);
00154       LineTo   (hdc, ri.right, ri.top + (i+1)*giDeltaY/7);
00155     }
00156     GetNextGraphicSlot (&ri);
00157   }
00158
00159   if (gdwGraphicsOptions & PIE)
00160   {
00161     Pie (hdc, ri.left, ri.top, ri.right, ri.bottom,
00162       ri.left, ri.top, ri.right-10, ri.bottom-10);
00163     GetNextGraphicSlot (&ri);
00164   }
00165
00166   if (gdwGraphicsOptions & PLG_BLT)
00167   {
00168     HBITMAP hbm;
00169     BITMAP  bm;
00170     HDC     hdcMem;
00171     POINT   ap[3];
00172
00173     hbm = LoadBitmap (ghInst, "printer");
00174     hdcMem = CreateCompatibleDC (hdc);
00175     SelectObject (hdcMem, hbm);
00176
00177     GetObject (hbm, sizeof(BITMAP), (LPSTR)&bm);
00178
00179     //
00180     // special case here because PlgBlt requires coordinates
00181     //   of upper left, upper right, & lower left
00182     //
00183
00184     ap[0].x = (LONG) (ri.left + (ri.right - ri.left)/4);
00185     ap[0].y = (LONG) (ri.top + (ri.bottom - ri.top)/4);
00186     ap[1].x = (LONG) ri.right;
00187     ap[1].y = (LONG) ri.top;
00188     ap[2].x = (LONG) ri.left;
00189     ap[2].y = (LONG) ri.bottom;
00190
00191     PlgBlt (hdc, ap, hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, NULL, 0, 0);
00192
00193     DeleteDC(hdcMem);
00194     DeleteObject(hbm);
00195     GetNextGraphicSlot (&ri);
00196
00197   }
00198
00199   if (gdwGraphicsOptions & POLYBEZIER)
00200   {
00201     POINT ap[4];
00202
00203     ap[0].x  = (LONG) ri.left;    ap[0].y = (LONG) ri.top;
00204     ap[1].x  = (LONG) ri.left;    ap[1].y = (LONG) ri.bottom;
00205     ap[2].x  = (LONG) ri.right;   ap[2].y = (LONG) ri.top;
00206     ap[3].x  = (LONG) ri.right;   ap[3].y = (LONG) ri.bottom;
00207
00208     PolyBezier (hdc, ap, 4);
00209     GetNextGraphicSlot (&ri);
00210   }
00211
00212   if (gdwGraphicsOptions & POLYGON)
00213   {
00214     POINT ap[5];
00215
00216     ap[0].x  = (LONG) ri.left;    ap[0].y = (LONG) ri.top;
00217     ap[1].x  = (LONG) ri.right;   ap[1].y = (LONG) ri.bottom;
00218     ap[2].x  = (LONG) ri.right;   ap[2].y = (LONG) ri.top;
00219     ap[3].x  = (LONG) ri.left;    ap[3].y = (LONG) ri.bottom;
00220     ap[4].x  = (LONG) ri.left;    ap[4].y = (LONG) ri.top;
00221
00222     Polygon (hdc, ap, 4);
00223     GetNextGraphicSlot (&ri);
00224   }
00225
00226   if (gdwGraphicsOptions & POLYLINE)
00227   {
00228     POINT ap[4];
00229
00230     ap[0].x  = (LONG) ri.left;    ap[0].y = (LONG) ri.top;
00231     ap[1].x  = (LONG) ri.left;    ap[1].y = (LONG) ri.bottom;
00232     ap[2].x  = (LONG) ri.right;   ap[2].y = (LONG) ri.top;
00233     ap[3].x  = (LONG) ri.right;   ap[3].y = (LONG) ri.bottom;
00234
00235     Polyline (hdc, ap, 4);
00236     GetNextGraphicSlot (&ri);
00237   }
00238
00239   if (gdwGraphicsOptions & POLYPOLYGON)
00240   {
00241     POINT ap[8];
00242     int ai[2] = { 4, 4 };
00243
00244     ap[0].x = (LONG)  ri.left;
00245     ap[0].y = (LONG)  ri.top;
00246     ap[1].x = (LONG) (ri.left + giDeltaX/4);
00247     ap[1].y = (LONG)  ri.top;
00248     ap[2].x = (LONG) (ri.left + giDeltaX/4);
00249     ap[2].y = (LONG) (ri.top  + giDeltaY/4);
00250     ap[3].x = (LONG)  ri.left;
00251     ap[3].y = (LONG) (ri.top  + giDeltaY/4);
00252     ap[4].x = (LONG) (ri.right  - 2*giDeltaX/3);
00253     ap[4].y = (LONG) (ri.bottom - 2*giDeltaY/3);
00254     ap[5].x = (LONG)  ri.right;
00255     ap[5].y = (LONG) (ri.bottom - 2*giDeltaY/3);
00256     ap[6].x = (LONG)  ri.right;
00257     ap[6].y = (LONG)  ri.bottom;
00258     ap[7].x = (LONG) (ri.right  - 2*giDeltaX/3);
00259     ap[7].y = (LONG)  ri.bottom;
00260
00261     PolyPolygon (hdc, ap, ai, 2);
00262     GetNextGraphicSlot (&ri);
00263   }
00264
00265   if (gdwGraphicsOptions & RECTANGLE)
00266   {
00267     Rectangle (hdc, ri.left, ri.top, ri.right, ri.bottom);
00268     GetNextGraphicSlot (&ri);
00269   }
00270
00271   if (gdwGraphicsOptions & ROUNDRECT)
00272   {
00273     RoundRect (hdc, ri.left, ri.top, ri.right, ri.bottom, 15, 25);
00274     GetNextGraphicSlot (&ri);
00275   }
00276
00277   if (gdwGraphicsOptions & STRETCH_BLT)
00278   {
00279     HBITMAP hbm;
00280     BITMAP  bm;
00281     HDC     hdcMem;
00282
00283     hbm = LoadBitmap (ghInst, "printer");
00284     hdcMem = CreateCompatibleDC (hdc);
00285     SelectObject (hdcMem, hbm);
00286
00287     GetObject (hbm, sizeof(BITMAP), (LPSTR)&bm);
00288
00289     StretchBlt (hdc, ri.left, ri.top, ri.right-ri.left,
00290       ri.bottom - ri.top, hdcMem, 0, 0,
00291       bm.bmWidth, bm.bmHeight, SRCCOPY);
00292
00293     DeleteDC(hdcMem);
00294     DeleteObject(hbm);
00295     GetNextGraphicSlot (&ri);
00296   }
00297
00298   return TRUE;
00299 }
00300
00301
00302
00303 /******************************************************************************\
00304 *
00305 *  FUNCTION:    GetFirstGraphicSlot
00306 *
00307 *  INPUTS:      pri - pointer to a RECTI
00308 *
00309 \******************************************************************************/
00310
00311 void GetFirstGraphicSlot (LPRECT lpRect, PRECTI pri)
00312 {
00313   pri->left   = BORDER;
00314   pri->top    = lpRect->top + BORDER;
00315   pri->right  = giDeltaX;
00316   pri->bottom = giDeltaY;
00317
00318   giColumn = 1;
00319 }
00320
00321
00322
00323 /******************************************************************************\
00324 *
00325 *  FUNCTION:    GetNextGraphicSlot
00326 *
00327 *  INPUTS:      pri - pointer to a RECTI
00328 *
00329 \******************************************************************************/
00330
00331 void GetNextGraphicSlot (PRECTI pri)
00332 {
00333   if (++giColumn <= NUM_GRAPHICS_XSLOTS)
00334   {
00335     pri->left  += giDeltaX;
00336     pri->right += giDeltaX;
00337   }
00338   else
00339   {
00340     giColumn = 1;
00341
00342     pri->left   =  BORDER;
00343     pri->top    += giDeltaY;
00344     pri->right  =  giDeltaX;
00345     pri->bottom += giDeltaY;
00346   }
00347 }
00348
00349
00350
00351 /******************************************************************************\
00352 *
00353 *  FUNCTION:    DrawFonts
00354 *
00355 *  INPUTS:      hdc   - device context to enumerate from & draw on
00356 *               pRect - pointer to bounding rect to draw fonts in
00357 *
00358 *  LOCAL VARS:  i, j       - loop variables
00359 *               xText      - starting x position to draw text
00360 *               yText      - starting y position to draw text
00361 *               iMaxStrLen - length in pels of string to draw
00362 *
00363 \******************************************************************************/
00364
00365 void DrawFonts (HDC hdc, LPRECT lpRect)
00366 {
00367   int      i, j, xText, yText, iMaxStrLen = 0;
00368   PARFONTS paf;
00369
00370   paf = BuildFontList (hdc);
00371
00372   xText = yText = 2;
00373
00374   //
00375   // set the appropriate text align mode depending on
00376   //   whether we're drawing from top down or bottom up
00377   //
00378
00379   if ((giMapMode == MM_TEXT) || (giMapMode == MM_ANISOTROPIC))
00380
00381     SetTextAlign (hdc, TA_TOP);
00382
00383   else
00384
00385     SetTextAlign (hdc, TA_BOTTOM);
00386
00387   for (i = 0; i < nFaces; i++)
00388   {
00389     for (j = 0; j < (paf + i)->nFonts; j++)
00390     {
00391       HFONT      hFont, hSaveFont;
00392       SIZE       size;
00393       POINT      LogPtExtent;
00394
00395       LogPtExtent.x = lpRect->right;
00396       LogPtExtent.y = lpRect->bottom;
00397
00398       hFont = CreateFontIndirect ((paf + i)->lf + j);
00399
00400       hSaveFont = SelectObject (hdc, hFont);
00401
00402       TextOut (hdc, xText, yText, ((paf + i)->lf + j)->lfFaceName,
00403                (int) (strlen(((paf + i)->lf + j)->lfFaceName)));
00404
00405       GetTextExtentPoint (hdc, ((paf + i)->lf + j)->lfFaceName,
00406                           (int) (strlen(((paf+i)->lf+j)->lfFaceName)),
00407                           &size);
00408       size.cx += 2;
00409       iMaxStrLen = iMaxStrLen > (int)size.cx ? iMaxStrLen: (int) size.cx;
00410
00411       if (!(i == (nFaces - 1) && j == ((paf + i)->nFonts - 1)))
00412       {
00413         TEXTMETRIC *pNextTM;
00414
00415         pNextTM = j < ((paf+i)->nFonts-1) ?
00416                           (paf+i)->tm+j+1 : (paf+i+1)->tm;
00417
00418         //
00419         // add in the height of the face name we just drew
00420         //
00421
00422         yText += (int) ((paf + i)->tm + j)->tmHeight;
00423
00424         //
00425         // if the next facename will be drawn outside the bounding rect then
00426         //   start at first line of next column
00427         //
00428
00429         if (yText + (int) pNextTM->tmHeight > (int) LogPtExtent.y)
00430         {
00431           yText = 2;
00432           xText += iMaxStrLen + 2;
00433           iMaxStrLen = 0;
00434         }
00435       }
00436
00437       SelectObject (hdc, hSaveFont);
00438       DeleteObject (hFont);
00439
00440       if (xText > (int) LogPtExtent.x)
00441       {
00442         if (GetDeviceCaps (hdc, TECHNOLOGY) & DT_RASDISPLAY)
00443         {
00444           //
00445           // If we're drawing to the screen & have run out of
00446           //   room then tell user how many fonts there are left
00447           //   (that we haven't displayed)
00448           //
00449
00450           int   k;
00451           int   iFontsLeft = (paf + i)->nFonts - j - 1;
00452           char  buf[40];
00453           SIZE  size;
00454
00455
00456           for (k = i + 1; k < nFaces; k++)
00457
00458             iFontsLeft += (paf + k)->nFonts;
00459
00460           wsprintf (buf, GetStringRes(IDS_FMT_MOREDSPFNTNL),
00461                     iFontsLeft);
00462
00463           GetTextExtentPoint (hdc, buf, (int) strlen(buf), &size);
00464
00465           if ((xText = lpRect->right - size.cx) < glcyMenu + 1)
00466
00467             xText = glcyMenu/2 + 1;
00468
00469           TextOut (hdc, xText, lpRect->bottom, buf, (int) strlen(buf));
00470
00471           goto done_enumfonts;
00472         }
00473
00474         else
00475         {
00476           //
00477           // Else we're drawing to a printer & have filled up
00478           //   the first page. If there's any fonts left to draw
00479           //   then start a new page.
00480           //
00481
00482           if (!(i == nFaces - 1 && j == (paf + i)->nFonts - 1))
00483           {
00484             EndPage   (hdc);
00485             xText = yText = 2;
00486             StartPage (hdc);
00487           }
00488         }
00489       }
00490     }
00491   }
00492
00493 done_enumfonts:
00494
00495   FreeFontList (paf);
00496 }
00497
00498
00499
00500
00501 /*  In the callback functions for the enumerations, there is a limited
00502  *  ability to pass in parameters.  For that reason, declare the following
00503  *  global variables to be used by any of the call back functions.
00504  *
00505  *        HDC      hdcGlobal;
00506  *        PARFONTS parFontsGlobal;
00507  *        int      iFace,jFont;
00508  *        int      nFaces;
00509  *
00510  *
00511  * General call structure:
00512  *
00513  *        BuildFontList
00514  *            EnumFonts
00515  *                MyEnumCount
00516  *            LocalAlloc
00517  *            EnumFonts
00518  *                MyEnumFaces
00519  *                    EnumFonts
00520  *                        MyEnumCount
00521  *                    LocalAlloc
00522  *                    LocalAlloc
00523  *                    LocalAlloc
00524  *                    EnumFonts
00525  *                        MyEnumCopy
00526  */
00527
00528
00529
00530 /******************************************************************************\
00531 *
00532 *  FUNCTION:    BuildFontList
00533 *
00534 *  GLOBAL VARS: (see above)
00535 *
00536 \******************************************************************************/
00537
00538 PARFONTS BuildFontList (HDC hdcIn)
00539 {
00540   nFaces = 0;
00541
00542   hdcGlobal = hdcIn;
00543
00544   //
00545   // count the total number of face names.
00546   //
00547
00548   EnumFonts (hdcGlobal, NULL, (FONTENUMPROC)MyEnumCount, (LPARAM)&nFaces);
00549
00550   //
00551   // allocate the pointer to the array of PArFont structures.
00552   //
00553
00554   parFontsGlobal = (PARFONTS) LocalAlloc (LPTR, sizeof(ARFONTS) * (nFaces+1));
00555
00556   //
00557   // step through all fonts again.  For each one fill a LOGFONT and
00558   //   a TEXTMETRIC stucture.
00559   //
00560
00561   iFace = 0;
00562   EnumFonts (hdcGlobal, NULL, (FONTENUMPROC)MyEnumFaces, 0);
00563
00564   return parFontsGlobal;
00565 }
00566
00567
00568
00569 /******************************************************************************\
00570 *
00571 *  FUNCTION:    MyEnumFaces
00572 *
00573 *  GLOBAL VARS: (see above)
00574 *
00575 \******************************************************************************/
00576
00577 int CALLBACK MyEnumFaces (LPLOGFONT lpLogFont, LPTEXTMETRIC lpTEXTMETRICs,
00578                           DWORD fFontType, LPVOID  lpData)
00579 {
00580   int nFonts;
00581
00582   nFonts = 0;
00583   EnumFonts (hdcGlobal, lpLogFont->lfFaceName, (FONTENUMPROC)MyEnumCount,
00584              (LPARAM)&nFonts);
00585
00586   parFontsGlobal[iFace].lf   = (LOGFONT *)    LocalAlloc (LPTR,
00587                                                           sizeof(LOGFONT) *
00588                                                             nFonts);
00589   parFontsGlobal[iFace].tm   = (TEXTMETRIC *) LocalAlloc (LPTR,
00590                                                           sizeof(TEXTMETRIC) *
00591                                                             nFonts);
00592   parFontsGlobal[iFace].Type = (int *)        LocalAlloc (LPTR,
00593                                                           sizeof(int) *
00594                                                             nFonts);
00595
00596   if ((parFontsGlobal[iFace].lf   == NULL) ||
00597       (parFontsGlobal[iFace].tm   == NULL) ||
00598       (parFontsGlobal[iFace].Type == NULL))
00599   {
00600     ErrMsgBox (GetStringRes(IDS_LALLOCFAIL), ERR_MOD_NAME);
00601     return FALSE;
00602   }
00603
00604   parFontsGlobal[iFace].nFonts = nFonts;
00605
00606   jFont = 0;
00607   EnumFonts (hdcGlobal, lpLogFont->lfFaceName, (FONTENUMPROC)MyEnumCopy, 0);
00608
00609   iFace++;
00610
00611   return TRUE;
00612 }
00613
00614
00615
00616 /******************************************************************************\
00617 *
00618 *  FUNCTION:    MyEnumCopy
00619 *
00620 *  GLOBAL VARS: (see above)
00621 *
00622 \******************************************************************************/
00623
00624 int CALLBACK MyEnumCopy (LPLOGFONT lpLogFont, LPTEXTMETRIC lpTEXTMETRICs,
00625                          DWORD fFontType, LPVOID  lpData)
00626 {
00627   LOGFONT    *lplf;
00628   TEXTMETRIC *lptm;
00629   int        *pType;
00630
00631   lplf  = parFontsGlobal[iFace].lf;
00632   lptm  = parFontsGlobal[iFace].tm;
00633   pType = parFontsGlobal[iFace].Type;
00634
00635   lplf[jFont]  = *lpLogFont;
00636   lptm[jFont]  = *lpTEXTMETRICs;
00637   pType[jFont] = fFontType;
00638
00639   jFont++;
00640   return TRUE;
00641 }
00642
00643
00644
00645 /******************************************************************************\
00646 *
00647 *  FUNCTION:    MyEnumCount
00648 *
00649 *  GLOBAL VARS: (see above)
00650 *
00651 \******************************************************************************/
00652
00653 int CALLBACK MyEnumCount (LPLOGFONT lpLogFont, LPTEXTMETRIC lpTEXTMETRICs,
00654                           DWORD fFontType, LPVOID lpData)
00655 {
00656   (*(LPINT)lpData)++;
00657   return TRUE;
00658 }
00659
00660
00661
00662 /******************************************************************************\
00663 *
00664 *  FUNCTION:    FreeFontList
00665 *
00666 *  INPUTS:      paf - pointer to ARFONTS struct to free
00667 *
00668 \******************************************************************************/
00669
00670 void FreeFontList (PARFONTS paf)
00671 {
00672   int i;
00673
00674   for (i = 0; i < nFaces; i++)
00675   {
00676     LocalFree (LocalHandle ((LPSTR) ((paf + i)->lf  )));
00677     LocalFree (LocalHandle ((LPSTR) ((paf + i)->tm  )));
00678     LocalFree (LocalHandle ((LPSTR) ((paf + i)->Type)));
00679   }
00680   LocalFree (LocalHandle ((LPSTR) paf));
00681 }
00682
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepmultiuser/dbgmsg.h Source File

  • NetDS
  • RPC
  • FileRep
  • filerepmultiuser

dbgmsg.h

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     Debugging Routines
00005
00006     FILE: DbgMsg.h
00007
00008     PURPOSE: Routines for debugging system services
00009
00010     FUNCTIONS:
00011         DbgMsgOpenLog - Opens the profile log.
00012         DbgMsgRecord - Records and event.
00013         DbgMsgCloseLog - Closes the profile log.
00014
00015 */
00016 #pragma once
00017
00018 // Maximum size for the debug log.
00019 // After the log reaches this size new entries "fall off" (threy
00020 // do not get reorded).
00021 #define DEBUG_LOG_MAX_SIZE (10*1024*1024)
00022
00023 // Used for mutial exclusion when generating and
00024 // writing the debug information.
00025 extern CRITICAL_SECTION DbgMsgCriticalSection;
00026
00027 /*
00028     FUNCTION: DbgMsgOpenLog
00029
00030     COMMENTS:
00031
00032 */
00033 VOID DbgMsgOpenLog(LPTSTR LogFileName);
00034
00035 /*
00036     FUNCTION: DbgMsgRecordTime
00037
00038     COMMENTS:  If the maximum log size has been exceeded, no action is taken.
00039
00040 */
00041 VOID DbgMsgRecord(LPTSTR msg);
00042
00043 /*
00044     FUNCTION: DbgMsgCloseLog
00045
00046     COMMENTS:
00047
00048 */
00049 VOID DbgMsgCloseLog(VOID);
00050
00051 // end DbgMsg.h
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/comp.Cpp Source File

  • SysMgmt
  • MMC
  • Openserv

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 CComponent::CComponent(CComponentData *parent)
00029 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL)
00030 {
00031     OBJECT_CREATED
00032 }
00033
00034 CComponent::~CComponent()
00035 {
00036     OBJECT_DESTROYED
00037 }
00038
00039 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00040 {
00041     if (!ppv)
00042         return E_FAIL;
00043
00044     *ppv = NULL;
00045
00046     if (IsEqualIID(riid, IID_IUnknown))
00047         *ppv = static_cast<IComponent *>(this);
00048     else if (IsEqualIID(riid, IID_IComponent))
00049         *ppv = static_cast<IComponent *>(this);
00050     else if (IsEqualIID(riid, IID_IExtendPropertySheet) ||
00051         IsEqualIID(riid, IID_IExtendPropertySheet2))
00052         *ppv = static_cast<IExtendPropertySheet2 *>(this);
00053
00054     if (*ppv)
00055     {
00056         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00057         return S_OK;
00058     }
00059
00060     return E_NOINTERFACE;
00061 }
00062
00063 STDMETHODIMP_(ULONG) CComponent::AddRef()
00064 {
00065     return InterlockedIncrement((LONG *)&m_cref);
00066 }
00067
00068 STDMETHODIMP_(ULONG) CComponent::Release()
00069 {
00070     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00071     {
00072         delete this;
00073         return 0;
00074     }
00075     return m_cref;
00076
00077 }
00078
00079 ///////////////////////////////
00080 // Interface IComponent
00081 ///////////////////////////////
00082 STDMETHODIMP CComponent::Initialize(
00083                                     /* [in] */ LPCONSOLE lpConsole)
00084 {
00085     HRESULT hr = S_OK;
00086
00087     // Save away all the interfaces we'll need.
00088     // Fail if we can't QI the required interfaces.
00089
00090     m_ipConsole = lpConsole;
00091     m_ipConsole->AddRef();
00092
00093     return hr;
00094 }
00095
00096 STDMETHODIMP CComponent::Notify(
00097                                 /* [in] */ LPDATAOBJECT lpDataObject,
00098                                 /* [in] */ MMC_NOTIFY_TYPE event,
00099                                 /* [in] */ LPARAM arg,
00100                                 /* [in] */ LPARAM param)
00101 {
00102     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00103
00104     HRESULT hr = S_FALSE;
00105
00106   //Get our data object. If it is NULL, we return with S_FALSE.
00107   //See implementation of GetOurDataObject() to see how to
00108   //handle special data objects.
00109   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00110   if (NULL == pDataObject)
00111     return S_FALSE;
00112
00113   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00114
00115     switch (event)      {
00116     case MMCN_SHOW:
00117         hr = base->OnShow(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00118         break;
00119
00120     case MMCN_ADD_IMAGES:
00121         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00122         break;
00123
00124     case MMCN_SELECT:
00125         hr = base->OnSelect(m_ipConsole, (BOOL)LOWORD(arg), (BOOL)HIWORD(arg));
00126         break;
00127
00128     case MMCN_RENAME:
00129         hr = base->OnRename((LPOLESTR)param);
00130         break;
00131     }
00132
00133     return hr;
00134 }
00135
00136 STDMETHODIMP CComponent::Destroy(
00137                                  /* [in] */ MMC_COOKIE cookie)
00138 {
00139     if (m_ipConsole) {
00140         m_ipConsole->Release();
00141         m_ipConsole = NULL;
00142     }
00143
00144     return S_OK;
00145 }
00146
00147
00148 STDMETHODIMP CComponent::QueryDataObject(
00149                                          /* [in] */ MMC_COOKIE cookie,
00150                                          /* [in] */ DATA_OBJECT_TYPES type,
00151                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00152 {
00153     CDataObject *pObj = NULL;
00154
00155     if (cookie == 0)
00156         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00157     else
00158         pObj = new CDataObject(cookie, type);
00159
00160     if (!pObj)
00161         return E_OUTOFMEMORY;
00162
00163     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00164
00165     return S_OK;
00166 }
00167
00168 STDMETHODIMP CComponent::GetResultViewType(
00169                                            /* [in] */ MMC_COOKIE cookie,
00170                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00171                                            /* [out] */ long __RPC_FAR *pViewOptions)
00172 {
00173     CDelegationBase *base = (CDelegationBase *)cookie;
00174
00175     //
00176     // Ask for default listview.
00177     //
00178     if (base == NULL)
00179     {
00180         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00181         *ppViewType = NULL;
00182     }
00183     else
00184         return base->GetResultViewType(ppViewType, pViewOptions);
00185
00186     return S_OK;
00187 }
00188
00189 STDMETHODIMP CComponent::GetDisplayInfo(
00190                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00191 {
00192     HRESULT hr = S_OK;
00193     CDelegationBase *base = NULL;
00194
00195     // if they are asking for the RDI_STR we have one of those to give
00196
00197     if (pResultDataItem->lParam) {
00198         base = (CDelegationBase *)pResultDataItem->lParam;
00199         if (pResultDataItem->mask & RDI_STR) {
00200                         LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00201                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00202             pResultDataItem->str = pszW;
00203         }
00204
00205         if (pResultDataItem->mask & RDI_IMAGE) {
00206             pResultDataItem->nImage = base->GetBitmapIndex();
00207         }
00208     }
00209
00210     return hr;
00211 }
00212
00213
00214 STDMETHODIMP CComponent::CompareObjects(
00215                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00216                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00217 {
00218     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00219     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00220
00221     // compare the object pointers
00222     if (baseA->GetCookie() == baseB->GetCookie())
00223         return S_OK;
00224
00225     return S_FALSE;
00226 }
00227
00228 ///////////////////////////////////
00229 // Interface IExtendPropertySheet2
00230 ///////////////////////////////////
00231 HRESULT CComponent::CreatePropertyPages(
00232                                         /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00233                                         /* [in] */ LONG_PTR handle,
00234                                         /* [in] */ LPDATAOBJECT lpIDataObject)
00235 {
00236     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00237
00238     return base->CreatePropertyPages(lpProvider, handle);
00239 }
00240
00241 HRESULT CComponent::QueryPagesFor(
00242                                   /* [in] */ LPDATAOBJECT lpDataObject)
00243 {
00244     CDelegationBase *base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00245
00246     return base->HasPropertySheets();
00247 }
00248
00249 HRESULT CComponent::GetWatermarks(
00250                                   /* [in] */ LPDATAOBJECT lpIDataObject,
00251                                   /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00252                                   /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00253                                   /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00254                                   /* [out] */ BOOL __RPC_FAR *bStretch)
00255 {
00256     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00257
00258     return base->GetWatermarks(lphWatermark, lphHeader, lphPalette, bStretch);
00259 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/basedialog.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

basedialog.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  BaseDialog.h:  Interface for the CBaseDialog class.  This is the base
00014 //                 class for modeless dialogs.
00015 //
00016
00017
00018 #ifndef _CLASS_BASEDIALOG_
00019 #define _CLASS_BASEDIALOG_
00020
00021 #include <Windows.h>
00022
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CBaseDialog
00031 {
00032   private:
00033     HWND     m_hWnd;         // Handle from CreateDialogParam
00034     ULONG    m_nTemplate;    // Dialog template ID
00035     DLGPROC  m_DlgProc;      // Points to Dialog Proc
00036     DWORD    m_dwFlags;      // Create flags
00037
00038   public:
00039     CBaseDialog( ULONG nTemplate = 0 );
00040     virtual ~CBaseDialog();
00041
00042     virtual HWND Create( HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags = 0 );
00043
00044   protected:
00045     static BOOL CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00046
00047     virtual LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00048     virtual LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00049     virtual LRESULT OnCancel( HWND hDlg, WPARAM wParam, LPARAM lParam );
00050     virtual LRESULT OnNcDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00051     virtual LRESULT OnDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam );
00052     virtual LRESULT OnClose( HWND hDlg, WPARAM wParam, LPARAM lParam );
00053
00054   public:
00055     virtual BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0;
00056
00057 };
00058
00059
00060 #endif //_CLASS_BASEDIALOG_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/ImageTag.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

ImageTag.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       imagetag.hxx
00006 //
00007 //  Contents:   Parsing algorithm for image tags
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __IMAGETAG_HXX__ )
00012 #define __IMAGETAG_HXX__
00013
00014 #include <htmlelem.hxx>
00015
00016
00017 //+-------------------------------------------------------------------------
00018 //
00019 //  Class:      CImageTag
00020 //
00021 //  Purpose:    Parsing algorithm for image tag in Html
00022 //
00023 //--------------------------------------------------------------------------
00024
00025 class CImageTag : public CHtmlElement
00026 {
00027
00028 public:
00029     CImageTag( CHtmlIFilter& htmlIFilter, CSerialStream& serialStream );
00030
00031     virtual SCODE    GetChunk( STAT_CHUNK *pStat );
00032     virtual SCODE    GetText( ULONG *pcwcOutput, WCHAR *awcBuffer );
00033
00034     virtual void     InitStatChunk( STAT_CHUNK *pStat );
00035
00036 private:
00037     WCHAR *          _pwcValueBuf;            // Buffer for value field
00038     unsigned         _cValueChars;            // # chars in value buffer
00039     unsigned         _cValueCharsFiltered;    // # chars in value buffer already filtered
00040 };
00041
00042
00043 #endif // __IMAGETAG_HXX__
00044
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::PersistFormatEnum Member List

This is the complete list of members for msado15::PersistFormatEnum, including all inherited members.
adPersistADTG | msado15::PersistFormatEnum | [static]
adPersistXML | msado15::PersistFormatEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

viewline Member List

This is the complete list of members for viewline, including all inherited members.
line | viewline
nr_left | viewline
nr_right | viewline
section | viewline
Generated on Wed Nov 13 2024 16:58:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/basesnap.h Source File

  • SysMgmt
  • MMC
  • Simple

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     CClassFactory();
00034     ~CClassFactory();
00035
00036     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00037     STDMETHODIMP_(ULONG) AddRef();
00038     STDMETHODIMP_(ULONG) Release();
00039
00040     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00041     STDMETHODIMP LockServer(BOOL);
00042 };
00043
00044 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cerror.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cerror.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CERROR.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CERROR_H_
00012 #define _CERROR_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019
00020
00021 /////////////////////////////////////////////////////////////////
00022 // CError class
00023 //
00024 /////////////////////////////////////////////////////////////////
00025 class CError : public CBase
00026 {
00027 public:
00028   //Constructors
00029   CError(CMainWindow* pCMainwindow);
00030   virtual ~CError();
00031
00032   //IUnknown Helpers
00033   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00034   virtual HRESULT     AutoRelease();
00035   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00036
00037   //Pure Virtual
00038   virtual WCHAR*      GetObjectName()     { return L"Error Object"; }
00039   virtual UINT      GetObjectMenu()     { return IDM_ERRORMENU;   }
00040   virtual LONG      GetObjectImage()    { return IMAGE_ERROR;   }
00041   virtual REFIID      GetDefaultInterface() { return IID_IErrorInfo;  }
00042   virtual WCHAR*      GetObjectDesc();
00043
00044   //IErrorInfo
00045   virtual HRESULT     GetDescription(BSTR* pbstrDescription);
00046   virtual HRESULT     GetGUID(GUID* pGuid);
00047   virtual HRESULT     GetHelpFile(BSTR* pbstrHelpFile);
00048   virtual HRESULT     GetSource(BSTR* pbstrSource);
00049   virtual HRESULT     GetHelpContext(DWORD* pdwHelpContext);
00050
00051   //IErrorRecords
00052   virtual HRESULT     GetRecordCount(ULONG* pulCount);
00053   virtual HRESULT     GetCustomErrorObject(ULONG ulRecordNum, REFIID riid, IUnknown** ppObject);
00054   virtual HRESULT     GetErrorInfo(ULONG ulRecordNum, LCID lcid, IErrorInfo** ppErrorInfo);
00055
00056   //Helpers
00057
00058   //OLE DB Interfaces
00059   //[MANDATORY]
00060   IErrorInfo*       m_pIErrorInfo;        //Error interface
00061   IErrorRecords*      m_pIErrorRecords;     //Error interface
00062
00063   //[OPTIONAL]
00064 };
00065
00066
00067
00068 /////////////////////////////////////////////////////////////////
00069 // CCustomError class
00070 //
00071 /////////////////////////////////////////////////////////////////
00072 class CCustomError : public CBase
00073 {
00074 public:
00075   //Constructors
00076   CCustomError(CMainWindow* pCMainwindow);
00077   virtual ~CCustomError();
00078
00079   //IUnknown Helpers
00080   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00081   virtual HRESULT     AutoRelease();
00082   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00083
00084   //Pure Virtual
00085   virtual WCHAR*      GetObjectName()     { return L"Custom Error Object";  }
00086   virtual UINT      GetObjectMenu()     { return IDM_CUSTOMERRORMENU;   }
00087   virtual LONG      GetObjectImage()    { return IMAGE_ERROR;       }
00088   virtual REFIID      GetDefaultInterface() { return IID_ISQLErrorInfo;     }
00089   virtual WCHAR*      GetObjectDesc();
00090
00091   //ISQLErrorInfo
00092   virtual HRESULT     GetSQLInfo(BSTR* pbstrSQLState, LONG* plNativeError);
00093
00094   //Helpers
00095
00096   //OLE DB Interfaces
00097   //[MANDATORY]
00098
00099   //[OPTIONAL]
00100   ISQLErrorInfo*      m_pISQLErrorInfo;     //Error interface
00101 };
00102
00103
00104 #endif  //_CERROR_H_
Generated on Wed Nov 13 2024 16:52:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CUtilBSTR Member List

This is the complete list of members for CUtilBSTR, including all inherited members.
CUtilBSTR(WCHAR *s) | CUtilBSTR | [inline]
m_bstr | CUtilBSTR | [private]
operator BSTR() | CUtilBSTR | [inline]
~CUtilBSTR() | CUtilBSTR | [inline]
Generated on Wed Nov 13 2024 16:57:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfcompart/monitor.cpp Source File

  • WinUI
  • tsfcompart

monitor.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation. All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Monitor.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019   #include statements
00020 **************************************************************************/
00021
00022 #include "Monitor.h"
00023
00024 /**************************************************************************
00025   global variables and definitions
00026 **************************************************************************/
00027
00028 /**************************************************************************
00029
00030   CCompartmentMonitor::CCompartmentMonitor()
00031
00032 **************************************************************************/
00033
00034 CCompartmentMonitor::CCompartmentMonitor(void)
00035 {
00036     m_dwRef = 1;
00037     m_dwCookie = 0;
00038     m_pCompartment = NULL;
00039     m_guidCompartment = GUID_NULL;
00040     m_pCallback = NULL;
00041 }
00042
00043 /**************************************************************************
00044
00045   CCompartmentMonitor::~CCompartmentMonitor()
00046
00047 **************************************************************************/
00048
00049 CCompartmentMonitor::~CCompartmentMonitor()
00050 {
00051     Uninitialize();
00052 }
00053
00054 /**************************************************************************
00055
00056   CCompartmentMonitor::Initialize()
00057
00058 **************************************************************************/
00059
00060 HRESULT CCompartmentMonitor::Initialize(    const GUID *pguidCompartment,
00061                                             PCOMPARTMENTMONITORPROC pCallback,
00062                                             LPARAM lParam)
00063 {
00064     if(!IsEqualGUID(m_guidCompartment, GUID_NULL))
00065     {
00066         //Initialize() has already been called
00067         return E_UNEXPECTED;
00068     }
00069
00070     m_guidCompartment = *pguidCompartment;
00071     m_pCallback = pCallback;
00072     m_lParam = lParam;
00073
00074     HRESULT         hr;
00075     ITfThreadMgr    *pThreadMgr;
00076
00077     //create a thread manager object
00078     hr = CoCreateInstance(CLSID_TF_ThreadMgr,
00079         NULL,
00080         CLSCTX_INPROC_SERVER,
00081         IID_ITfThreadMgr,
00082         (void**)&pThreadMgr);
00083
00084     if(SUCCEEDED(hr))
00085     {
00086         ITfCompartmentMgr   *pCompMgr;
00087
00088         //get the global compartment manager
00089         hr = pThreadMgr->GetGlobalCompartment(&pCompMgr);
00090         if(SUCCEEDED(hr))
00091         {
00092             //get the Speech UI compartment
00093             hr = pCompMgr->GetCompartment(m_guidCompartment,
00094                 &m_pCompartment);
00095             if(SUCCEEDED(hr))
00096             {
00097                 ITfSource   *pSource;
00098
00099                 //install the advise sink
00100                 hr = m_pCompartment->QueryInterface(IID_ITfSource,
00101                     (LPVOID*)&pSource);
00102                 if(SUCCEEDED(hr))
00103                 {
00104                     hr = pSource->AdviseSink(IID_ITfCompartmentEventSink,
00105                         (ITfCompartmentEventSink*)this,
00106                         &m_dwCookie);
00107                 }
00108
00109                 //if something went wrong, release the member interface
00110                 if(FAILED(hr))
00111                 {
00112                     m_pCompartment->Release();
00113                     m_pCompartment = NULL;
00114                 }
00115             }
00116
00117             //release the compartment manager
00118             pCompMgr->Release();
00119         }
00120
00121         //release the thread manager
00122         pThreadMgr->Release();
00123     }
00124
00125     return hr;
00126 }
00127
00128 /**************************************************************************
00129
00130   CCompartmentMonitor::Uninitialize()
00131
00132 **************************************************************************/
00133
00134 HRESULT CCompartmentMonitor::Uninitialize(void)
00135 {
00136     HRESULT     hr = S_OK;
00137
00138     if(m_pCompartment)
00139     {
00140         ITfSource   *pSource;
00141
00142         hr = m_pCompartment->QueryInterface(IID_ITfSource, (void **)&pSource);
00143
00144         if(SUCCEEDED(hr))
00145         {
00146             hr = pSource->UnadviseSink(m_dwCookie);
00147
00148             pSource->Release();
00149         }
00150
00151         m_pCompartment->Release();
00152         m_pCompartment = NULL;
00153     }
00154
00155     m_guidCompartment = GUID_NULL;
00156
00157     return hr;
00158 }
00159
00160 //
00161 // IUnknown
00162 //
00163
00164 /**************************************************************************
00165
00166   CCompartmentMonitor::QueryInterface()
00167
00168 **************************************************************************/
00169
00170 STDAPI CCompartmentMonitor::QueryInterface(REFIID riid, void **ppvObj)
00171 {
00172     *ppvObj = NULL;
00173
00174     if (IsEqualIID(riid, IID_IUnknown) ||
00175         IsEqualIID(riid, IID_ITfCompartmentEventSink))
00176     {
00177         *ppvObj = (ITfCompartmentEventSink*)this;
00178     }
00179
00180     if (*ppvObj)
00181     {
00182         AddRef();
00183         return S_OK;
00184     }
00185
00186     return E_NOINTERFACE;
00187 }
00188
00189 /**************************************************************************
00190
00191   CCompartmentMonitor::AddRef()
00192
00193 **************************************************************************/
00194
00195 STDAPI_(ULONG) CCompartmentMonitor::AddRef()
00196 {
00197     return ++m_dwRef;
00198 }
00199
00200 /**************************************************************************
00201
00202   CCompartmentMonitor::Release()
00203
00204 **************************************************************************/
00205
00206 STDAPI_(ULONG) CCompartmentMonitor::Release()
00207 {
00208     m_dwRef--;
00209
00210     if(0 == m_dwRef)
00211     {
00212         delete this;
00213         return 0;
00214     }
00215
00216     return m_dwRef;
00217 }
00218
00219 //
00220 // ITfCompartmentEventSink
00221 //
00222
00223 /**************************************************************************
00224
00225   CCompartmentMonitor::OnChange()
00226
00227 **************************************************************************/
00228
00229 STDAPI CCompartmentMonitor::OnChange(REFGUID rguid)
00230 {
00231     HRESULT hr = S_OK;
00232
00233     if(IsEqualGUID(rguid, m_guidCompartment))
00234     {
00235         GUID guid = m_guidCompartment;
00236         BOOL fStatus;
00237
00238         GetStatus(&fStatus);
00239
00240         //notify the status of this compartment has changed
00241         hr = (*m_pCallback)(&guid, fStatus, m_lParam);
00242     }
00243
00244     return hr;
00245 }
00246
00247 /**************************************************************************
00248
00249   CCompartmentMonitor::GetStatus()
00250
00251 **************************************************************************/
00252
00253 HRESULT CCompartmentMonitor::GetStatus(BOOL *pfEnabled)
00254 {
00255     if(IsBadWritePtr(pfEnabled, sizeof(BOOL)))
00256     {
00257         return E_INVALIDARG;
00258     }
00259
00260     if(!m_pCompartment)
00261     {
00262         return E_UNEXPECTED;
00263     }
00264
00265     HRESULT hr;
00266     VARIANT var;
00267
00268     VariantInit(&var);
00269     hr = m_pCompartment->GetValue(&var);
00270     if(S_OK == hr)
00271     {
00272         switch(var.vt)
00273         {
00274         case VT_I4:
00275             *pfEnabled = var.lVal;
00276             break;
00277         }
00278
00279         VariantClear(&var);
00280     }
00281     else
00282     {
00283         //this usually means the text service is not installed
00284         return E_UNEXPECTED;
00285     }
00286
00287
00288     return S_OK;
00289 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/globals.cpp Source File

  • WinUI
  • TSFmark

globals.cpp

Go to the documentation of this file.
00001 //
00002 // globals.cpp
00003 //
00004 // Global variables.
00005 //
00006
00007 #include "globals.h"
00008
00009 HINSTANCE g_hInst;
00010
00011 LONG g_cRefDll = -1; // -1 /w no refs, for win95 InterlockedIncrement/Decrement compat
00012
00013 CRITICAL_SECTION g_cs;
00014
00015 /* 23e97bc9-f2d3-4b25-8ef3-d78391bf2150 */
00016 const CLSID c_clsidMarkTextService = { 0x23e97bc9, 0xf2d3, 0x4b25, {0x8e, 0xf3, 0xd7, 0x83, 0x91, 0xbf, 0x21, 0x50} };
00017
00018 /* a2767f97-e735-461a-84ba-7a7ecad24827 */
00019 const GUID c_guidMarkProfile = { 0xa2767f97, 0xe735, 0x461a, {0x84, 0xba, 0x7a, 0x7e, 0xca, 0xd2, 0x48, 0x27} };
00020
00021 /* c74a88d5-6614-439b-8880-2dd8e6cd91a7 */
00022 const GUID c_guidLangBarItemButton = { 0xc74a88d5, 0x6614, 0x439b, {0x88, 0x80, 0x2d, 0xd8, 0xe6, 0xcd, 0x91, 0xa7} };
00023
00024 /* d81face6-845c-45e7-a2af-1c5fc7adf667 */
00025 const GUID c_guidMarkDisplayAttribute = { 0xd81face6, 0x845c, 0x45e7, {0xa2, 0xaf, 0x1c, 0x5f, 0xc7, 0xad, 0xf6, 0x67} };
00026
00027 /* eadc084c-6130-4222-82e5-c528c1f4abbb */
00028 const GUID c_guidMarkContextCompartment = { 0xeadc084c, 0x6130, 0x4222, {0x82, 0xe5, 0xc5, 0x28, 0xc1, 0xf4, 0xab, 0xbb} };
00029
00030 /* 947d9d1c-7a4c-4392-b37c-34017c6c7fe1 */
00031 const GUID c_guidMarkGlobalCompartment = { 0x947d9d1c, 0x7a4c, 0x4392, {0xb3, 0x7c, 0x34, 0x01, 0x7c, 0x6c, 0x7f, 0xe1} };
00032
00033 /* 3042ae6a-4697-4f7d-acdf-20a972fee027 */
00034 const GUID c_guidCaseProperty = { 0x3042ae6a, 0x4697, 0x4f7d, {0xac, 0xdf, 0x20, 0xa9, 0x72, 0xfe, 0xe0, 0x27} };
00035
00036 /* d05a182a-7782-4e61-a2ea-6a4794ab7aaa */
00037 const GUID c_guidCustomProperty = { 0xd05a182a, 0x7782, 0x4e61, {0xa2, 0xea, 0x6a, 0x47, 0x94, 0xab, 0x7a, 0xaa} };
00038
00039 //+---------------------------------------------------------------------------
00040 //
00041 // AdviseSink
00042 //
00043 //----------------------------------------------------------------------------
00044
00045 BOOL AdviseSink(IUnknown *pSourceIn, IUnknown *pSink, REFIID riid, DWORD *pdwCookie)
00046 {
00047     ITfSource *pSource;
00048     HRESULT hr;
00049
00050     if (pSourceIn->QueryInterface(IID_ITfSource, (void **)&pSource) != S_OK)
00051         return FALSE;
00052
00053     hr = pSource->AdviseSink(riid, pSink, pdwCookie);
00054
00055     pSource->Release();
00056
00057     if (hr != S_OK)
00058     {
00059         // make sure we don't try to Unadvise pdwCookie later
00060         *pdwCookie = TF_INVALID_COOKIE;
00061         return FALSE;
00062     }
00063
00064     return TRUE;
00065 }
00066
00067 //+---------------------------------------------------------------------------
00068 //
00069 // UnadviseSink
00070 //
00071 //----------------------------------------------------------------------------
00072
00073 void UnadviseSink(IUnknown *pSourceIn, DWORD *pdwCookie)
00074 {
00075     ITfSource *pSource;
00076
00077     if (*pdwCookie == TF_INVALID_COOKIE)
00078         return; // never Advised
00079
00080     if (pSourceIn->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
00081     {
00082         pSource->UnadviseSink(*pdwCookie);
00083         pSource->Release();
00084     }
00085
00086     *pdwCookie = TF_INVALID_COOKIE;
00087 }
00088
00089 //+---------------------------------------------------------------------------
00090 //
00091 // AdviseSingleSink
00092 //
00093 //----------------------------------------------------------------------------
00094
00095 BOOL AdviseSingleSink(TfClientId tfClientId, IUnknown *pSourceIn, IUnknown *pSink, REFIID riid)
00096 {
00097     ITfSourceSingle *pSource;
00098     HRESULT hr;
00099
00100     if (pSourceIn->QueryInterface(IID_ITfSourceSingle, (void **)&pSource) != S_OK)
00101         return FALSE;
00102
00103     hr = pSource->AdviseSingleSink(tfClientId, riid, pSink);
00104
00105     pSource->Release();
00106
00107     return (hr == S_OK);
00108 }
00109
00110 //+---------------------------------------------------------------------------
00111 //
00112 // UnadviseSingleSink
00113 //
00114 //----------------------------------------------------------------------------
00115
00116 void UnadviseSingleSink(TfClientId tfClientId, IUnknown *pSourceIn, REFIID riid)
00117 {
00118     ITfSourceSingle *pSource;
00119
00120     if (pSourceIn->QueryInterface(IID_ITfSourceSingle, (void **)&pSource) == S_OK)
00121     {
00122         pSource->UnadviseSingleSink(tfClientId, riid);
00123         pSource->Release();
00124     }
00125 }
00126
00127 //+---------------------------------------------------------------------------
00128 //
00129 // IsRangeCovered
00130 //
00131 // Returns TRUE if pRangeTest is entirely contained within pRangeCover.
00132 //----------------------------------------------------------------------------
00133
00134 BOOL IsRangeCovered(TfEditCookie ec, ITfRange *pRangeTest, ITfRange *pRangeCover)
00135 {
00136     LONG lResult;
00137
00138     if (pRangeCover->CompareStart(ec, pRangeTest, TF_ANCHOR_START, &lResult) != S_OK ||
00139         lResult > 0)
00140     {
00141         return FALSE;
00142     }
00143
00144     if (pRangeCover->CompareEnd(ec, pRangeTest, TF_ANCHOR_END, &lResult) != S_OK ||
00145         lResult < 0)
00146     {
00147         return FALSE;
00148     }
00149
00150     return TRUE;
00151 }
00152
00153 //+---------------------------------------------------------------------------
00154 //
00155 // IsEqualUnknown
00156 //
00157 // Returns TRUE if punk1 and punk2 refer to the same object.  We must QI for
00158 // IUnknown to be guarenteed a reliable test, per the COM rules.
00159 //----------------------------------------------------------------------------
00160
00161 BOOL IsEqualUnknown(IUnknown *interface1, IUnknown *interface2)
00162 {
00163     IUnknown *punk1;
00164     IUnknown *punk2;
00165
00166     if (interface1->QueryInterface(IID_IUnknown, (void **)&punk1) != S_OK)
00167         return FALSE;
00168
00169     punk1->Release(); // we don't actually need to dereference these guys, just want to compare them
00170
00171     if (interface2->QueryInterface(IID_IUnknown, (void **)&punk2) != S_OK)
00172         return FALSE;
00173
00174     punk2->Release();
00175
00176     return (punk1 == punk2);
00177 }
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/ErrorOut.cpp Source File

  • Begin
  • sdkdiff

ErrorOut.cpp

Go to the documentation of this file.
00001 // simple function for outputting an error, given a string and error code.
00002 #include "precomp.h"
00003
00004 void OutputError(HRESULT hr, LPCSTR operation) {
00005   TCHAR error_string[ERROR_MAX];
00006   TCHAR error_code[ERROR_LENGTH];
00007
00008   memset(error_string, 0, ERROR_MAX);
00009   memset(error_code, 0, ERROR_LENGTH);
00010
00011   switch(hr) {
00012     case STRSAFE_E_INSUFFICIENT_BUFFER:
00013       if (FAILED(StringCchCopy(error_code, ERROR_LENGTH, "insufficient buffer")))
00014         return;
00015       break;
00016     case STRSAFE_E_INVALID_PARAMETER:
00017       if (FAILED(StringCchCopy(error_code, ERROR_LENGTH, "invalid parameter")))
00018         return;
00019       break;
00020     case STRSAFE_E_END_OF_FILE:
00021       if (FAILED(StringCchCopy(error_code, ERROR_LENGTH, "encountering end of file")))
00022         return;
00023       break;
00024   }
00025
00026   if (0 != error_code[0]) {
00027     if (FAILED(StringCchPrintf(error_string, ERROR_MAX, "Unable to perform %s due to %s.\n", operation, error_code)))
00028       return;
00029   }
00030   else
00031     if (FAILED(StringCchPrintf(error_string, ERROR_MAX, "Unable to perform %s.\n", operation)))
00032       return;
00033
00034   OutputDebugString(error_string);
00035   return;
00036 }
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/TrayNot/App32.C Source File

  • WinUI
  • Shell
  • TrayNot

App32.C

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 //---------------------------------------------------------------------------
00003 #include "app32.h"
00004 #include <windowsx.h>
00005
00006 #include "resource.h"
00007
00008 #define MYWM_NOTIFYICON   (WM_APP+100)
00009
00010 //---------------------------------------------------------------------------
00011 // Global
00012 HINSTANCE g_hinst;
00013
00014 #ifndef ARRAYSIZE
00015 #define ARRAYSIZE(a)    (sizeof(a)/sizeof(a[0]))
00016 #endif
00017
00018 struct _DLGITEMS
00019 {
00020   DWORD dwStart;
00021   UINT uNotify;
00022   UINT uDelayID;
00023   UINT uState1;
00024   UINT uTip1;
00025   UINT uState2;
00026   UINT uTip2;
00027 } g_sDlgItems [] =
00028 {
00029   {
00030     0, IDC_NOTIFY1, IDC_DELAY1, IDC_STATE11, IDC_TIP11, IDC_STATE12, IDC_TIP12,
00031   },
00032   {
00033     0, IDC_NOTIFY2, IDC_DELAY2, IDC_STATE21, IDC_TIP21, IDC_STATE22, IDC_TIP22,
00034   },
00035   {
00036     0, IDC_NOTIFY3, IDC_DELAY3, IDC_STATE31, IDC_TIP31, IDC_STATE32, IDC_TIP32,
00037   },
00038 } ;
00039
00040
00041 BOOL TrayMessage(HWND hDlg, DWORD dwMessage, UINT uID, HICON hIcon, PSTR pszTip)
00042 {
00043     BOOL res;
00044
00045   NOTIFYICONDATA tnd;
00046
00047   tnd.cbSize    = sizeof(tnd);
00048   tnd.hWnd    = hDlg;
00049   tnd.uID     = uID;
00050
00051   tnd.uFlags    = NIF_MESSAGE|NIF_ICON|NIF_TIP;
00052   tnd.uCallbackMessage  = MYWM_NOTIFYICON;
00053   tnd.hIcon   = hIcon;
00054   if (pszTip)
00055   {
00056     lstrcpyn(tnd.szTip, pszTip, ARRAYSIZE(tnd.szTip));
00057   }
00058   else
00059   {
00060     tnd.szTip[0] = '\0';
00061   }
00062
00063   res = Shell_NotifyIcon(dwMessage, &tnd);
00064
00065   if (hIcon)
00066       DestroyIcon(hIcon);
00067
00068   return res;
00069 }
00070
00071
00072 LRESULT IconDrawItem(LPDRAWITEMSTRUCT lpdi)
00073 {
00074   HICON hIcon;
00075
00076   hIcon = (HICON)LoadImage(g_hinst, MAKEINTRESOURCE(lpdi->CtlID), IMAGE_ICON,
00077     16, 16, 0);
00078   if (!hIcon)
00079   {
00080     return(FALSE);
00081   }
00082
00083   DrawIconEx(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top, hIcon,
00084     16, 16, 0, NULL, DI_NORMAL);
00085
00086   return(TRUE);
00087 }
00088
00089
00090 void StateChange(HWND hDlg, UINT_PTR uIndex, UINT uSelect)
00091 {
00092   UINT uState1, uState2;
00093   HWND hwndIcon;
00094   LPCSTR pszIDIcon;
00095   UINT uTip;
00096   char szTip[64];
00097
00098   uState1 = g_sDlgItems[uIndex].uState1;
00099   uState2 = g_sDlgItems[uIndex].uState2;
00100
00101   // if !uSelect, find out which button is selected
00102   if (!uSelect)
00103   {
00104     uSelect = IsDlgButtonChecked(hDlg, uState2) ? uState2 : uState1;
00105   }
00106   // if uSelect<0, find out shich button is NOT selected
00107   else if ((int)uSelect < 0)
00108   {
00109     uSelect = IsDlgButtonChecked(hDlg, uState2) ? uState1 : uState2;
00110   }
00111
00112   CheckRadioButton(hDlg, uState1, uState2, uSelect);
00113
00114   // If there is a tip specified, use it, otherwise use the default
00115   uTip = (uSelect==uState1) ? g_sDlgItems[uIndex].uTip1 : g_sDlgItems[uIndex].uTip2;
00116
00117   if (!GetDlgItemText(hDlg, uTip, szTip, ARRAYSIZE(szTip))
00118     && !LoadString(g_hinst, uSelect, szTip, ARRAYSIZE(szTip)))
00119   {
00120     *szTip = '\0';
00121   }
00122
00123   // The ID of window after the radio button is the ID of the icon
00124   hwndIcon = GetWindow(GetDlgItem(hDlg, uSelect), GW_HWNDNEXT);
00125   pszIDIcon = MAKEINTRESOURCE(GetDlgCtrlID(hwndIcon));
00126
00127   TrayMessage(hDlg, NIM_MODIFY, g_sDlgItems[uIndex].uNotify,
00128     LoadImage(g_hinst, pszIDIcon, IMAGE_ICON, 16, 16, 0), szTip);
00129 }
00130
00131
00132 void NotifyDelete(HWND hDlg, UINT uIndex)
00133 {
00134   TrayMessage(hDlg, NIM_DELETE, g_sDlgItems[uIndex].uNotify, NULL, NULL);
00135 }
00136
00137
00138 void NotifyAdd(HWND hDlg, UINT_PTR uIndex)
00139 {
00140   TrayMessage(hDlg, NIM_ADD, g_sDlgItems[uIndex].uNotify, NULL, NULL);
00141
00142   StateChange(hDlg, uIndex, 0);
00143 }
00144
00145
00146 void NotifyChange(HWND hDlg, UINT uIndex)
00147 {
00148   UINT uDelay;
00149   BOOL bTranslated;
00150   BOOL bEnable = FALSE;
00151
00152   if (IsDlgButtonChecked(hDlg, g_sDlgItems[uIndex].uNotify))
00153   {
00154     uDelay = GetDlgItemInt(hDlg, g_sDlgItems[uIndex].uDelayID, &bTranslated, FALSE);
00155
00156     if (uDelay)
00157     {
00158       g_sDlgItems[uIndex].dwStart = GetTickCount() + uDelay*60000;
00159       SetTimer(hDlg, uIndex, 60000, NULL);
00160     }
00161     else
00162     {
00163       NotifyAdd(hDlg, uIndex);
00164     }
00165   }
00166   else
00167   {
00168     NotifyDelete(hDlg, uIndex);
00169   }
00170
00171   for (uIndex=0; uIndex<ARRAYSIZE(g_sDlgItems); ++uIndex)
00172   {
00173     if (IsDlgButtonChecked(hDlg, g_sDlgItems[uIndex].uNotify))
00174     {
00175       bEnable = TRUE;
00176     }
00177   }
00178
00179   EnableWindow(GetDlgItem(hDlg, IDABORT), bEnable);
00180 }
00181
00182
00183 LRESULT CALLBACK TestAppDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00184 {
00185   switch (uMsg)
00186   {
00187   case WM_INITDIALOG:
00188     break;
00189
00190   case WM_DRAWITEM:
00191     return(IconDrawItem((LPDRAWITEMSTRUCT)lParam));
00192     break;
00193
00194   case WM_DESTROY:
00195     NotifyDelete(hDlg, 0);
00196     NotifyDelete(hDlg, 1);
00197     NotifyDelete(hDlg, 2);
00198     break;
00199
00200   case WM_TIMER:
00201     if (wParam >= ARRAYSIZE(g_sDlgItems))
00202     {
00203       break;
00204     }
00205
00206     if ((int)(GetTickCount() - g_sDlgItems[wParam].dwStart) < 0)
00207     {
00208       break;
00209     }
00210
00211     KillTimer(hDlg, wParam);
00212     NotifyAdd(hDlg, wParam);
00213     break;
00214
00215   case WM_COMMAND:
00216     switch (GET_WM_COMMAND_ID(wParam, lParam))
00217     {
00218     case IDCANCEL:
00219       EndDialog(hDlg, TRUE);
00220       break;
00221
00222     case IDABORT:
00223       ShowWindow(hDlg, SW_HIDE);
00224       break;
00225
00226     case IDC_NOTIFY1:
00227       NotifyChange(hDlg, 0);
00228       break;
00229
00230     case IDC_NOTIFY2:
00231       NotifyChange(hDlg, 1);
00232       break;
00233
00234     case IDC_NOTIFY3:
00235       NotifyChange(hDlg, 2);
00236       break;
00237
00238     case IDC_STATE11:
00239     case IDC_STATE12:
00240       StateChange(hDlg, 0, GET_WM_COMMAND_ID(wParam, lParam));
00241       break;
00242
00243     case IDC_STATE21:
00244     case IDC_STATE22:
00245       StateChange(hDlg, 1, GET_WM_COMMAND_ID(wParam, lParam));
00246       break;
00247
00248     case IDC_STATE31:
00249     case IDC_STATE32:
00250       StateChange(hDlg, 2, GET_WM_COMMAND_ID(wParam, lParam));
00251       break;
00252     }
00253     break;
00254
00255   case MYWM_NOTIFYICON:
00256     switch (lParam)
00257     {
00258     case WM_LBUTTONDOWN:
00259       switch (wParam)
00260       {
00261       case IDC_NOTIFY1:
00262         StateChange(hDlg, 0, (UINT)-1);
00263         break;
00264
00265       case IDC_NOTIFY2:
00266         StateChange(hDlg, 1, (UINT)-1);
00267         break;
00268
00269       case IDC_NOTIFY3:
00270         StateChange(hDlg, 2, (UINT)-1);
00271         break;
00272
00273       default:
00274         break;
00275       }
00276       break;
00277
00278     case WM_RBUTTONDOWN:
00279       ShowWindow(hDlg, SW_SHOW);
00280       SetForegroundWindow(hDlg);  // make us come to the front
00281       break;
00282
00283     default:
00284       break;
00285     }
00286     break;
00287
00288   default:
00289     return(FALSE);
00290   }
00291
00292   return(TRUE);
00293 }
00294
00295
00296 //---------------------------------------------------------------------------
00297 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
00298 {
00299   g_hinst = hInstance;
00300
00301   DialogBox(hInstance, MAKEINTRESOURCE(IDD_APP32), NULL, TestAppDlgProc);
00302
00303   return(FALSE);
00304 }
00305
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/LeakyBin/LeakyBin.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • LeakyBin

LeakyBin.c

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00008
00009 PROGRAM: Leakybin.c
00010
00011 PURPOSE: Illustrates the use of Windows NT application performance
00012              counters to measure GlobalAlloc usage
00013
00014 PLATFORMS:  Windows NT only
00015
00016 FUNCTIONS:
00017    WinMain() - calls initialization function, processes message loop
00018    InitApplication() - Initializes window data nd registers window
00019    InitInstance() -saves instance handle and creates main window
00020    WindProc() Processes messages
00021    About() - Process menssages for "About" dialog box
00022    MyRegisterClass() - Registers the application's window class
00023    CenterWindow() -  Centers one window over another
00024
00025 -----------------------------------------------------------------------*/
00026 #define APPNAME "Leakybin"
00027
00028 // Windows Header Files:
00029 #include <windows.h>
00030
00031 // C RunTime Header Files
00032 #include <stdlib.h>
00033 #include <malloc.h>
00034 #include <memory.h>
00035 #include <stdio.h>
00036
00037 // Local Header Files
00038 #include "leakybin.h"
00039
00040 // Makes it easier to determine appropriate code paths:
00041 #define IS_WIN32    TRUE
00042 #define IS_NT       IS_WIN32 && (BOOL)(GetVersion() < 0x80000000)
00043
00044 // Global Variables:
00045
00046 HINSTANCE hInst;      // current instance
00047 char szAppName[100];  // Name of the app
00048 char szTitle[100];    // The title bar text
00049
00050 static UINT_PTR TimerID = 0;
00051 static BOOL     TimerRunning = FALSE;
00052 static HMENU    hAppMenu, hTestMenu;
00053 static MEMORY_ALLOC_BLOCK   mabListHead = {NULL};
00054
00055 // Foward declarations of functions included in this code module:
00056
00057 ATOM MyRegisterClass(CONST WNDCLASS*);
00058 BOOL InitApplication(HINSTANCE);
00059 BOOL InitInstance(HINSTANCE, int);
00060 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00061 LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
00062 BOOL CenterWindow (HWND, HWND);
00063 LPTSTR   GetStringRes (int id);
00064
00065
00066 //
00067 //  FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
00068 //
00069 //  PURPOSE: Entry point for the application.
00070 //
00071 //  COMMENTS:
00072 //
00073 // This function initializes the application and processes the
00074 // message loop.
00075 //
00076 int APIENTRY WinMain(HINSTANCE hInstance,
00077                      HINSTANCE hPrevInstance,
00078                      LPSTR     lpCmdLine,
00079                      int       nCmdShow
00080 )
00081 {
00082    MSG msg;
00083    HANDLE hAccelTable;
00084
00085    // Initialize global strings
00086    lstrcpynA(szAppName, APPNAME, 100);
00087    LoadString (hInstance, IDS_APP_TITLE, szTitle, 100);
00088
00089    if (! hPrevInstance)
00090    {
00091       // Perform instance initialization:
00092       if (! InitApplication(hInstance))
00093       {
00094          return (FALSE);
00095       }
00096    }
00097
00098    // Perform application initialization:
00099    if (! InitInstance(hInstance, nCmdShow))
00100    {
00101       return (FALSE);
00102    }
00103
00104    hAccelTable = LoadAccelerators(hInstance, szAppName);
00105
00106    // Main message loop:
00107    while (GetMessage(& msg, NULL, 0, 0))
00108    {
00109       if (! TranslateAccelerator(msg.hwnd, hAccelTable, & msg))
00110       {
00111          TranslateMessage(& msg);
00112          DispatchMessage(& msg);
00113       }
00114    }
00115
00116    return (int) (msg.wParam);
00117
00118    lpCmdLine; // This will prevent 'unused formal parameter' warnings
00119 }
00120
00121 //
00122 //  FUNCTION: MyRegisterClass(CONST WNDCLASS*)
00123 //
00124 //  PURPOSE: Registers the window class.
00125 //
00126 //  COMMENTS:
00127 //
00128 //    This function and its usage is only necessary if you want this code
00129 //    to be compatible with Win32 systems prior to the 'RegisterClassEx'
00130 // function that was added to Windows 95. It is important to call this function
00131 //    so that the application will get 'well formed' small icons associated
00132 //    with it.
00133 //
00134 ATOM MyRegisterClass(CONST WNDCLASS *lpwc)
00135 {
00136    HANDLE  hMod;
00137    FARPROC proc;
00138    WNDCLASSEX wcex;
00139
00140    hMod = GetModuleHandle ("USER32");
00141    if (hMod != NULL)
00142    {
00143
00144 #if defined (UNICODE)
00145       proc = GetProcAddress (hMod, "RegisterClassExW");
00146 #else
00147       proc = GetProcAddress (hMod, "RegisterClassExA");
00148 #endif
00149
00150       if (proc != NULL)
00151       {
00152
00153          wcex.style         = lpwc->style;
00154          wcex.lpfnWndProc   = lpwc->lpfnWndProc;
00155          wcex.cbClsExtra    = lpwc->cbClsExtra;
00156          wcex.cbWndExtra    = lpwc->cbWndExtra;
00157          wcex.hInstance     = lpwc->hInstance;
00158          wcex.hIcon         = lpwc->hIcon;
00159          wcex.hCursor       = lpwc->hCursor;
00160          wcex.hbrBackground = lpwc->hbrBackground;
00161          wcex.lpszMenuName  = lpwc->lpszMenuName;
00162          wcex.lpszClassName = lpwc->lpszClassName;
00163
00164          // Added elements for Windows 95:
00165          wcex.cbSize = sizeof(WNDCLASSEX);
00166          wcex.hIconSm = LoadIcon(wcex.hInstance, "SMALL");
00167
00168          return (ATOM)((*proc)(&wcex));//return RegisterClassEx(&wcex) with type ATOM;
00169       }
00170    }
00171    return (RegisterClass(lpwc));
00172 }
00173
00174
00175 //
00176 //  FUNCTION: InitApplication(HANDLE)
00177 //
00178 //  PURPOSE: Initializes window data and registers window class
00179 //
00180 //  COMMENTS:
00181 //
00182 //       In this function, we initialize a window class by filling out a data
00183 //       structure of type WNDCLASS and calling either RegisterClass or
00184 //       the internal MyRegisterClass.
00185 //
00186 BOOL InitApplication(HINSTANCE hInstance)
00187 {
00188    WNDCLASS  wc;
00189
00190    // Fill in window class structure with parameters that describe
00191    // the main window.
00192    wc.style         = CS_HREDRAW | CS_VREDRAW;
00193    wc.lpfnWndProc   = (WNDPROC)WndProc;
00194    wc.cbClsExtra    = 0;
00195    wc.cbWndExtra    = 0;
00196    wc.hInstance     = hInstance;
00197    wc.hIcon         = LoadIcon (hInstance, szAppName);
00198    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00199    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
00200    wc.lpszMenuName  = szAppName;
00201    wc.lpszClassName = szAppName;
00202
00203    // Register the window class and return success/failure code.
00204    return RegisterClass(&wc);
00205 }
00206
00207 //
00208 //   FUNCTION: InitInstance(HANDLE, int)
00209 //
00210 //   PURPOSE: Saves instance handle and creates main window
00211 //
00212 //   COMMENTS:
00213 //
00214 //        In this function, we save the instance handle in a global variable and
00215 //        create and display the main program window.
00216 //
00217 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
00218 {
00219    HWND hWnd;
00220
00221    hInst = hInstance; // Store instance handle in our global variable
00222
00223    hWnd = CreateWindow(szAppName, szTitle, WS_OVERLAPPEDWINDOW,
00224                        CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
00225                        NULL, NULL, hInstance, NULL);
00226
00227    if (!hWnd)
00228    {
00229       return (FALSE);
00230    }
00231
00232    ShowWindow(hWnd, nCmdShow);
00233    UpdateWindow(hWnd);
00234
00235    return (TRUE);
00236 }
00237 void FreeAllocatedMemory()
00238 {
00239    {
00240       PMEMORY_ALLOC_BLOCK pNextMab, pMab;
00241
00242       pMab = mabListHead.pNext;
00243
00244       while (pMab != NULL)
00245       {
00246          pNextMab = pMab->pNext;
00247          G_FREE (pMab);
00248          pMab = pNextMab;
00249       }
00250
00251       mabListHead.pNext = NULL;
00252    }
00253 }
00254 //
00255 //  FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
00256 //
00257 //  PURPOSE:  Processes messages for the main window.
00258 //
00259 //  MESSAGES:
00260 //
00261 // WM_COMMAND - process the application menu
00262 // WM_PAINT - Paint the main window
00263 // WM_DESTROY - post a quit message and return
00264 //    WM_DISPLAYCHANGE - message sent to Plug & Play systems when the display changes
00265 //    WM_RBUTTONDOWN - Right mouse click -- put up context menu here if appropriate
00266 //    WM_NCRBUTTONUP - User has clicked the right button on the application's system menu
00267 //
00268 //
00269 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00270 {
00271    int wmId, wmEvent;
00272    PAINTSTRUCT ps;
00273    HDC hdc;
00274    POINT pnt;
00275    HMENU hMenu;
00276    BOOL bGotHelp;
00277
00278    switch (message)
00279    {
00280    case WM_CREATE:
00281       // clear timer flags
00282       TimerID = 0;
00283       TimerRunning = FALSE;
00284
00285       // enable "Start" menu selection
00286       hAppMenu = GetMenu (hWnd);
00287       hTestMenu  = GetSubMenu (hAppMenu, 1);
00288       EnableMenuItem (hTestMenu, IDM_STOP, MF_BYCOMMAND | MF_GRAYED);
00289       EnableMenuItem (hTestMenu, IDM_START, MF_BYCOMMAND | MF_ENABLED);
00290       break;
00291
00292    case WM_COMMAND:
00293       wmId    = LOWORD(wParam); // Remember, these are...
00294       wmEvent = HIWORD(wParam); // ...different for Win32!
00295
00296       //Parse the menu selections:
00297       switch (wmId)
00298       {
00299
00300       case IDM_EXIT:
00301          DestroyWindow (hWnd);
00302          break;
00303
00304       case IDM_START:
00305          if (!TimerRunning)
00306          {
00307             TimerID = SetTimer (hWnd, LEAK_TIMER, TIME_INTERVAL, NULL);
00308             if (TimerID != 0)
00309             {
00310                TimerRunning = TRUE;
00311                EnableMenuItem (hTestMenu, IDM_START,
00312                                MF_BYCOMMAND | MF_GRAYED);
00313                EnableMenuItem (hTestMenu, IDM_STOP,
00314                                MF_BYCOMMAND | MF_ENABLED);
00315             }
00316             else
00317             {
00318                //unable to start timer
00319                MessageBeep (MB_ICONEXCLAMATION);
00320             }
00321          }
00322          InvalidateRect (hWnd, NULL, TRUE);
00323          break;
00324
00325       case IDM_STOP:
00326          if (TimerRunning)
00327          {
00328             KillTimer (hWnd, LEAK_TIMER);
00329             TimerID = 0;
00330             TimerRunning = FALSE;
00331             EnableMenuItem (hTestMenu, IDM_STOP,
00332                             MF_BYCOMMAND | MF_GRAYED);
00333             EnableMenuItem (hTestMenu, IDM_START,
00334                             MF_BYCOMMAND | MF_ENABLED);
00335          }
00336          InvalidateRect (hWnd, NULL, TRUE);
00337          break;
00338
00339       case IDM_RESET:
00340          FreeAllocatedMemory();
00341          InvalidateRect (hWnd, NULL, TRUE);
00342          break;
00343
00344       case IDM_ABOUT:
00345          DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)About);
00346          break;
00347
00348       case IDM_HELPTOPICS: // Only called in Windows 95
00349          bGotHelp = WinHelp (hWnd, APPNAME".HLP", HELP_FINDER,(DWORD)0);
00350          if (!bGotHelp)
00351          {
00352             MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP),
00353                         szAppName, MB_OK|MB_ICONHAND);
00354          }
00355          break;
00356
00357       default:
00358          return (DefWindowProc(hWnd, message, wParam, lParam));
00359       }
00360       break;
00361
00362    case WM_TIMER:
00363       {
00364          PMEMORY_ALLOC_BLOCK     pMab, pNewMab;
00365
00366          pNewMab = (PMEMORY_ALLOC_BLOCK)G_ALLOC (GPTR, ALLOCATION_SIZE);
00367
00368          if (pNewMab != NULL)
00369          {
00370             // save this pointer
00371             pNewMab->pNext = NULL;
00372             if (mabListHead.pNext == NULL)
00373             {
00374                // this is the first entry
00375                mabListHead.pNext = pNewMab;
00376             }
00377             else
00378             {
00379                // go to end of list
00380                pMab = mabListHead.pNext;
00381                while (pMab->pNext != NULL) pMab = pMab->pNext;
00382                pMab->pNext = pNewMab;
00383             }
00384             InvalidateRect (hWnd, NULL, TRUE);
00385          }
00386       }
00387       break;
00388
00389    case WM_RBUTTONDOWN: // RightClick in windows client area...
00390       pnt.x = LOWORD(lParam);
00391       pnt.y = HIWORD(lParam);
00392       ClientToScreen(hWnd, (LPPOINT) &pnt);
00393       // This is where you would determine the appropriate 'context'
00394       // menu to bring up. Since this app has no real functionality,
00395       // we will just bring up the 'Help' menu:
00396       hMenu = GetSubMenu (GetMenu (hWnd), 2);
00397       if (hMenu)
00398       {
00399          TrackPopupMenu (hMenu, 0, pnt.x, pnt.y, 0, hWnd, NULL);
00400       }
00401       else
00402       {
00403          // Couldn't find the menu...
00404          MessageBeep(0);
00405       }
00406       break;
00407
00408
00409    case WM_DISPLAYCHANGE: // Only comes through on plug'n'play systems
00410       {
00411          SIZE  szScreen;
00412          DWORD dwBitsPerPixel = (DWORD)wParam;
00413
00414          szScreen.cx = LOWORD(lParam);
00415          szScreen.cy = HIWORD(lParam);
00416
00417          MessageBox (GetFocus(), GetStringRes(IDS_DISPLAYCHANGED),
00418                      szAppName, 0);
00419       }
00420       break;
00421
00422    case WM_PAINT:
00423       {
00424          MEMORYSTATUS    MemoryStatusData;
00425          LONGLONG            llInUse;
00426          DWORD                   dwPercentUsed;
00427
00428          int     nX, nY;
00429          LONG    lTextOutReturn;
00430          int     nStringLength;
00431          CHAR            szOutputString[100];
00432
00433          hdc = BeginPaint (hWnd, &ps);
00434          // Add any drawing code here...
00435          GlobalMemoryStatus (& MemoryStatusData);
00436
00437          llInUse = (LONGLONG)(MemoryStatusData.dwTotalPageFile -
00438                               MemoryStatusData.dwAvailPageFile + 5 );
00439          llInUse *= 1000;
00440          llInUse /= MemoryStatusData.dwTotalPageFile;
00441          llInUse /= 10;
00442
00443          dwPercentUsed = (DWORD)llInUse;
00444
00445          nX = 0;
00446          nY = 0;
00447          _snprintf(szOutputString, 100, "Reported Memory Load: \t%3.1d%%",
00448                   MemoryStatusData.dwMemoryLoad);
00449          nStringLength = lstrlen (szOutputString) * sizeof (CHAR);
00450          lTextOutReturn = TabbedTextOut (hdc, nX, nY,
00451                                          szOutputString, nStringLength, 0, NULL, 0);
00452          nY += HIWORD (lTextOutReturn);
00453
00454          _snprintf(szOutputString, 100, "Page file in use:  \t%3.1d%%",
00455                   dwPercentUsed);
00456          nStringLength = lstrlen (szOutputString) * sizeof (CHAR);
00457          lTextOutReturn = TabbedTextOut(hdc, nX, nY,
00458                                          szOutputString, nStringLength, 0, NULL, 0);
00459          nY += HIWORD(lTextOutReturn);
00460
00461          EndPaint (hWnd, &ps);
00462       }
00463       break;
00464
00465    case WM_DESTROY:
00466       FreeAllocatedMemory();
00467       // Tell WinHelp we don't need it any more...
00468       WinHelp(hWnd, APPNAME".HLP", HELP_QUIT,(DWORD)0);
00469       PostQuitMessage(0);
00470       break;
00471
00472    default:
00473       return (DefWindowProc(hWnd, message, wParam, lParam));
00474    }
00475    return (0);
00476 }
00477
00478 //
00479 //  FUNCTION: About(HWND, unsigned, WORD, LONG)
00480 //
00481 //  PURPOSE:  Processes messages for "About" dialog box
00482 //       This version allows greater flexibility over the contents of the 'About' box,
00483 //       by pulling out values from the 'Version' resource.
00484 //
00485 //  MESSAGES:
00486 //
00487 // WM_INITDIALOG - initialize dialog box
00488 // WM_COMMAND    - Input received
00489 //
00490 //
00491 LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
00492 {
00493    static  HFONT hfontDlg;    // Font for dialog text
00494    static   HFONT hFinePrint; // Font for 'fine print' in dialog
00495    DWORD   dwVerInfoSize;     // Size of version information block
00496    LPSTR   lpVersion;         // String pointer to 'version' text
00497    DWORD   dwVerHnd=0;        // An 'ignored' parameter, always '0'
00498    UINT    uVersionLen;
00499    BOOL    bRetCode;
00500    int     i;
00501    char    szFullPath[256];
00502    char    szResult[256];
00503    char    szGetName[256];
00504    DWORD dwVersion;
00505    char  szVersion[40];
00506    DWORD dwResult;
00507
00508    switch (message)
00509    {
00510    case WM_INITDIALOG:
00511       ShowWindow (hDlg, SW_HIDE);
00512
00513       if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
00514       {
00515          hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
00516                                VARIABLE_PITCH | FF_DONTCARE, "");
00517          hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0,
00518                                  VARIABLE_PITCH | FF_DONTCARE, "");
00519       }
00520       else
00521       {
00522          hfontDlg = CreateFont(14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00523                                VARIABLE_PITCH | FF_SWISS, "");
00524          hFinePrint = CreateFont(11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00525                                  VARIABLE_PITCH | FF_SWISS, "");
00526       }
00527
00528       CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
00529       GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));
00530
00531       // Now lets dive in and pull out the version information:
00532       dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
00533       if (dwVerInfoSize)
00534       {
00535          LPSTR   lpstrVffInfo;
00536          HANDLE  hMem;
00537          hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
00538          lpstrVffInfo  = GlobalLock(hMem);
00539          GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
00540          // The below 'hex' value looks a little confusing, but
00541          // essentially what it is, is the hexidecimal representation
00542          // of a couple different values that represent the language
00543          // and character set that we are wanting string values for.
00544          // 040904E4 is a very common one, because it means:
00545          //   US English, Windows MultiLingual characterset
00546          // Or to pull it all apart:
00547          // 04------        = SUBLANG_ENGLISH_USA
00548          // --09----        = LANG_ENGLISH
00549          // --11----        = LANG_JAPANESE
00550          // ----04E4 = 1252 = Codepage for Windows:Multilingual
00551
00552          _snprintf(szGetName, 256, "%sProductName", GetStringRes(IDS_VER_INFO_LANG));
00553
00554          // Set the title of the dialog:
00555          bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
00556                                   (LPSTR)szGetName,
00557                                   (LPVOID)&lpVersion,
00558                                   (UINT *)&uVersionLen);
00559
00560          // Notice order of version and string...
00561          if (PRIMARYLANGID(GetUserDefaultLangID()) == LANG_JAPANESE)
00562          {
00563             _snprintf(szResult, 256, "%s ‚Ìƒo[ƒWƒ‡ƒ“î•ñ", lpVersion);
00564          }
00565          else
00566          {
00567             _snprintf(szResult, 256, "About %s", lpVersion);
00568          }
00569
00570          // -----------------------------------------------------
00571
00572          SetWindowText (hDlg, szResult);
00573
00574          // Walk through the dialog items that we want to replace:
00575          for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)
00576          {
00577             GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
00578             _snprintf(szGetName, 256, "%s%s", GetStringRes(IDS_VER_INFO_LANG), szResult);
00579             uVersionLen   = 0;
00580             lpVersion     = NULL;
00581             bRetCode      =  VerQueryValue((LPVOID)lpstrVffInfo,
00582                                            (LPSTR)szGetName,
00583                                            (LPVOID)&lpVersion,
00584                                            (UINT *)&uVersionLen);
00585
00586             if ( bRetCode && uVersionLen && lpVersion)
00587             {
00588                // Replace dialog item text with version info
00589                lstrcpynA(szResult, lpVersion, 256);
00590                SetDlgItemText(hDlg, i, szResult);
00591             }
00592             else
00593             {
00594                dwResult = GetLastError();
00595
00596                _snprintf(szResult, 256, GetStringRes(IDS_VERSION_ERROR), dwResult);
00597                SetDlgItemText (hDlg, i, szResult);
00598             }
00599             SendMessage (GetDlgItem (hDlg, i), WM_SETFONT,
00600                          (UINT_PTR)((i==DLG_VERLAST)?hFinePrint:hfontDlg),
00601                          TRUE);
00602          } // for (i = DLG_VERFIRST; i <= DLG_VERLAST; i++)
00603
00604
00605          GlobalUnlock(hMem);
00606          GlobalFree(hMem);
00607
00608       }
00609       else
00610       {
00611          // No version information available.
00612
00613       } // if (dwVerInfoSize)
00614
00615       SendMessage (GetDlgItem (hDlg, IDC_LABEL), WM_SETFONT,
00616                    (WPARAM)hfontDlg,(LPARAM)TRUE);
00617
00618       // We are  using GetVersion rather then GetVersionEx
00619       // because earlier versions of Windows NT and Win32s
00620       // didn't include GetVersionEx:
00621       dwVersion = GetVersion();
00622
00623       if (dwVersion < 0x80000000)
00624       {
00625          // Windows NT
00626          _snprintf(szVersion, 40, "Microsoft Windows NT %u.%u (Build: %u)",
00627                    (DWORD)(LOBYTE(LOWORD(dwVersion))),
00628                    (DWORD)(HIBYTE(LOWORD(dwVersion))),
00629                    (DWORD)(HIWORD(dwVersion)) );
00630       }
00631       else if (LOBYTE(LOWORD(dwVersion))<4)
00632       {
00633          // Win32s
00634          _snprintf(szVersion, 40, "Microsoft Win32s %u.%u (Build: %u)",
00635                    (DWORD)(LOBYTE(LOWORD(dwVersion))),
00636                    (DWORD)(HIBYTE(LOWORD(dwVersion))),
00637                    (DWORD)(HIWORD(dwVersion) & ~0x8000) );
00638       }
00639       else
00640       {
00641          // Windows 95
00642          _snprintf(szVersion, 40, "Microsoft Windows 95 %u.%u",
00643                    (DWORD)(LOBYTE(LOWORD(dwVersion))),
00644                    (DWORD)(HIBYTE(LOWORD(dwVersion))) );
00645       }
00646
00647       SetWindowText (GetDlgItem(hDlg, IDC_OSVERSION), szVersion);
00648       ShowWindow (hDlg, SW_SHOW);
00649       return (TRUE);
00650
00651    case WM_COMMAND:
00652       if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
00653       {
00654          EndDialog(hDlg, TRUE);
00655          DeleteObject (hfontDlg);
00656          DeleteObject (hFinePrint);
00657          return (TRUE);
00658       }
00659       break;
00660    }
00661
00662    return FALSE;
00663 }
00664
00665 //
00666 //   FUNCTION: CenterWindow(HWND, HWND)
00667 //
00668 //   PURPOSE: Centers one window over another.
00669 //
00670 //   COMMENTS:
00671 //
00672 //        In this function, we save the instance handle in a global variable and
00673 //        create and display the main program window.
00674 //
00675 //       This functionwill center one window over another ensuring that
00676 //    the placement of the window is within the 'working area', meaning
00677 //    that it is both within the display limits of the screen, and not
00678 //    obscured by the tray or other framing elements of the desktop.
00679 BOOL CenterWindow (HWND hwndChild, HWND hwndParent)
00680 {
00681    RECT    rChild, rParent, rWorkArea;
00682    int     wChild, hChild, wParent, hParent;
00683    int     xNew, yNew;
00684    BOOL  bResult;
00685
00686    // Get the Height and Width of the child window
00687    GetWindowRect (hwndChild, &rChild);
00688    wChild = rChild.right - rChild.left;
00689    hChild = rChild.bottom - rChild.top;
00690
00691    // Get the Height and Width of the parent window
00692    GetWindowRect (hwndParent, &rParent);
00693    wParent = rParent.right - rParent.left;
00694    hParent = rParent.bottom - rParent.top;
00695
00696    // Get the limits of the 'workarea'
00697    bResult = SystemParametersInfo(
00698                                  SPI_GETWORKAREA,  // system parameter to query or set
00699                                  sizeof(RECT),
00700                                  &rWorkArea,
00701                                  0);
00702    if (!bResult)
00703    {
00704       rWorkArea.left = rWorkArea.top = 0;
00705       rWorkArea.right = GetSystemMetrics(SM_CXSCREEN);
00706       rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
00707    }
00708
00709    // Calculate new X position, then adjust for workarea
00710    xNew = rParent.left + ((wParent - wChild) /2);
00711    if (xNew < rWorkArea.left)
00712    {
00713       xNew = rWorkArea.left;
00714    }
00715    else if ((xNew+wChild) > rWorkArea.right)
00716    {
00717       xNew = rWorkArea.right - wChild;
00718    }
00719
00720    // Calculate new Y position, then adjust for workarea
00721    yNew = rParent.top  + ((hParent - hChild) /2);
00722    if (yNew < rWorkArea.top)
00723    {
00724       yNew = rWorkArea.top;
00725    }
00726    else if ((yNew+hChild) > rWorkArea.bottom)
00727    {
00728       yNew = rWorkArea.bottom - hChild;
00729    }
00730
00731    // Set it, and return
00732    return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
00733 }
00734
00735
00736 //---------------------------------------------------------------------------
00737 //
00738 // FUNCTION:    GetStringRes (int id INPUT ONLY)
00739 //
00740 // COMMENTS:    Load the resource string with the ID given, and return a
00741 //              pointer to it.  Notice that the buffer is common memory so
00742 //              the string must be used before this call is made a second time.
00743 //
00744 //---------------------------------------------------------------------------
00745
00746 LPTSTR   GetStringRes (int id)
00747 {
00748    static TCHAR buffer[MAX_PATH];
00749
00750    buffer[0]=0;
00751    LoadString (GetModuleHandle (NULL), id, buffer, MAX_PATH);
00752    return buffer;
00753 }
00754
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Instance_Provider/Include/Service.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Instance_Provider
  • Include

Service.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   ProvResv.H
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #ifndef _CProvider_IWbemServices_H
00017 #define _CProvider_IWbemServices_H
00018
00019 #include <wbemcli.h>
00020 #include <wbemprov.h>
00021
00022 /******************************************************************************
00023  *
00024  *  Name: Object_Property
00025  *
00026  *
00027  *  Description:
00028  *
00029  *      Structure to encode static object data.
00030  *
00031  *****************************************************************************/
00032
00033 struct Object_Property
00034 {
00035   ULONG m_State ;
00036   CIMTYPE m_Type ;
00037   wchar_t *m_Name ;
00038   wchar_t *m_Value ;
00039 } ;
00040
00041
00042
00043 /******************************************************************************
00044  *
00045  *  Name: CProvider_IWbemServices
00046  *
00047  *
00048  *  Description:
00049  *
00050  *      Instance provider implementation of WMI provider interfaces.
00051  *      Implementation allows WMI to query for instances, execute methods, etc.
00052  *
00053  *****************************************************************************/
00054
00055 class CProvider_IWbemServices : public IWbemServices ,
00056                 public IWbemPropertyProvider ,
00057                 public IWbemProviderInit ,
00058                 public IWbemShutdown
00059 {
00060 private:
00061
00062 // Private Variables
00063
00064 // Reference count for com object garbage collection.
00065
00066   LONG m_ReferenceCount ;         //Object reference count
00067
00068   CRITICAL_SECTION m_CriticalSection ;
00069
00070 // Pointer passed during provider initialization allowing call to WMI.
00071
00072   IWbemServices *m_CoreService ;
00073
00074 // User/Local/Namespace information passed during initialization.
00075
00076   BSTR m_Namespace ;
00077   BSTR m_Locale ;
00078   BSTR m_User ;
00079
00080 // Useful information
00081
00082   BSTR m_ComputerName ;
00083   BSTR m_OperatingSystemVersion ;
00084
00085 // Cached object representing process class.
00086
00087   IWbemClassObject *m_Win32_ProcessEx_Object ;
00088   IWbemClassObject *m_ContactInfo_Object ;
00089
00090
00091 private:
00092
00093   HRESULT CreateInstanceEnumAsync_Process (
00094
00095     IWbemClassObject *a_ClassObject ,
00096     long a_Flags ,
00097     IWbemContext *a_Context,
00098     IWbemObjectSink *a_Sink
00099   ) ;
00100
00101   HRESULT CreateInstanceEnumAsync_Contacts (
00102
00103   IWbemClassObject *a_ClassObject ,
00104   long a_Flags ,
00105   IWbemContext __RPC_FAR *a_Context,
00106   IWbemObjectSink FAR *a_Sink
00107 );
00108
00109 public:
00110
00111 // Constructor/Destructor
00112
00113   CProvider_IWbemServices () ;
00114     ~CProvider_IWbemServices () ;
00115
00116 public:
00117
00118   //Non-delegating object IUnknown
00119
00120     STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
00121     STDMETHODIMP_( ULONG ) AddRef () ;
00122     STDMETHODIMP_( ULONG ) Release () ;
00123
00124     /* IWbemServices methods */
00125
00126     HRESULT STDMETHODCALLTYPE OpenNamespace (
00127
00128         const BSTR a_Namespace ,
00129         long a_Flags ,
00130         IWbemContext *a_Context ,
00131         IWbemServices **a_Service ,
00132         IWbemCallResult **a_CallResult
00133   )
00134   {
00135     return WBEM_E_NOT_AVAILABLE ;
00136   }
00137
00138     HRESULT STDMETHODCALLTYPE QueryObjectSink (
00139
00140         long a_Flags ,
00141         IWbemObjectSink **a_Sink
00142   )
00143   {
00144     return WBEM_E_NOT_AVAILABLE ;
00145   }
00146
00147     HRESULT STDMETHODCALLTYPE GetObject (
00148
00149     const BSTR a_ObjectPath ,
00150         long a_Flags ,
00151         IWbemContext *a_Context ,
00152         IWbemClassObject **ppObject ,
00153         IWbemCallResult **a_CallResult
00154   )
00155   {
00156     return WBEM_E_NOT_AVAILABLE ;
00157   }
00158
00159     HRESULT STDMETHODCALLTYPE PutClass (
00160
00161         IWbemClassObject *a_Object ,
00162         long a_Flags ,
00163         IWbemContext *a_Context ,
00164         IWbemCallResult **a_CallResult
00165   )
00166   {
00167     return WBEM_E_NOT_AVAILABLE ;
00168   }
00169
00170     HRESULT STDMETHODCALLTYPE DeleteClass (
00171
00172         const BSTR a_Class ,
00173         long a_Flags ,
00174         IWbemContext *a_Context ,
00175         IWbemCallResult **a_CallResult
00176   )
00177   {
00178     return WBEM_E_NOT_AVAILABLE ;
00179   }
00180
00181     HRESULT STDMETHODCALLTYPE CreateClassEnum (
00182
00183         const BSTR a_Superclass ,
00184         long a_Flags ,
00185         IWbemContext *a_Context ,
00186         IEnumWbemClassObject **a_Enum
00187   )
00188   {
00189     return WBEM_E_NOT_AVAILABLE ;
00190   }
00191
00192     HRESULT STDMETHODCALLTYPE PutInstance (
00193
00194     IWbemClassObject *a_Instance ,
00195     long a_Flags ,
00196     IWbemContext *a_Context ,
00197     IWbemCallResult **a_CallResult
00198   )
00199   {
00200     return WBEM_E_NOT_AVAILABLE ;
00201   }
00202
00203     HRESULT STDMETHODCALLTYPE DeleteInstance (
00204
00205     const BSTR a_ObjectPath ,
00206     long a_Flags ,
00207     IWbemContext *a_Context ,
00208     IWbemCallResult **a_CallResult
00209   )
00210   {
00211     return WBEM_E_NOT_AVAILABLE ;
00212   }
00213
00214     HRESULT STDMETHODCALLTYPE CreateInstanceEnum (
00215
00216     const BSTR a_Class ,
00217     long a_Flags ,
00218     IWbemContext *a_Context ,
00219     IEnumWbemClassObject **a_Enum
00220   )
00221   {
00222     return WBEM_E_NOT_AVAILABLE ;
00223   }
00224
00225     HRESULT STDMETHODCALLTYPE ExecQuery (
00226
00227     const BSTR a_QueryLanguage,
00228     const BSTR a_Query,
00229     long a_Flags ,
00230     IWbemContext *a_Context ,
00231     IEnumWbemClassObject **a_Enum
00232   )
00233   {
00234     return WBEM_E_NOT_AVAILABLE ;
00235   }
00236
00237
00238     HRESULT STDMETHODCALLTYPE ExecNotificationQuery (
00239
00240     const BSTR a_QueryLanguage ,
00241     const BSTR a_Query ,
00242     long a_Flags ,
00243     IWbemContext *a_Context ,
00244     IEnumWbemClassObject **a_Enum
00245   )
00246   {
00247     return WBEM_E_NOT_AVAILABLE ;
00248   }
00249
00250   HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync (
00251
00252         const BSTR a_QueryLanguage ,
00253         const BSTR a_Query ,
00254         long a_Flags ,
00255         IWbemContext *a_Context ,
00256         IWbemObjectSink *a_Sink
00257   )
00258   {
00259     return WBEM_E_NOT_AVAILABLE ;
00260   }
00261
00262     HRESULT STDMETHODCALLTYPE ExecMethod (
00263
00264         const BSTR a_ObjectPath ,
00265         const BSTR a_MethodName ,
00266         long a_Flags ,
00267         IWbemContext *a_Context ,
00268         IWbemClassObject *a_InParams ,
00269         IWbemClassObject **a_OutParams ,
00270         IWbemCallResult **a_CallResult
00271   )
00272   {
00273     return WBEM_E_NOT_AVAILABLE ;
00274   }
00275
00276     HRESULT STDMETHODCALLTYPE CancelAsyncCall (
00277
00278         IWbemObjectSink *a_Sink
00279   ) ;
00280
00281     HRESULT STDMETHODCALLTYPE GetObjectAsync (
00282
00283     const BSTR a_ObjectPath ,
00284         long a_Flags ,
00285         IWbemContext *a_Context ,
00286         IWbemObjectSink *a_Sink
00287   ) ;
00288
00289     HRESULT STDMETHODCALLTYPE PutClassAsync (
00290
00291         IWbemClassObject *a_Object ,
00292         long a_Flags ,
00293         IWbemContext *a_Context ,
00294         IWbemObjectSink *a_Sink
00295   ) ;
00296
00297     HRESULT STDMETHODCALLTYPE DeleteClassAsync (
00298
00299         const BSTR a_Class ,
00300         long a_Flags ,
00301         IWbemContext *a_Context ,
00302         IWbemObjectSink *a_Sink
00303   ) ;
00304
00305     HRESULT STDMETHODCALLTYPE CreateClassEnumAsync (
00306
00307     const BSTR a_Superclass ,
00308     long a_Flags ,
00309     IWbemContext *a_Context ,
00310     IWbemObjectSink *a_Sink
00311   ) ;
00312
00313     HRESULT STDMETHODCALLTYPE PutInstanceAsync (
00314
00315     IWbemClassObject *a_Instance ,
00316     long a_Flags ,
00317     IWbemContext *a_Context ,
00318     IWbemObjectSink *a_Sink
00319   ) ;
00320
00321     HRESULT STDMETHODCALLTYPE DeleteInstanceAsync (
00322
00323     const BSTR a_ObjectPath,
00324     long a_Flags,
00325     IWbemContext *a_Context ,
00326     IWbemObjectSink *a_Sink
00327   ) ;
00328
00329     HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync (
00330
00331     const BSTR a_Class ,
00332     long a_Flags ,
00333     IWbemContext *a_Context ,
00334     IWbemObjectSink *a_Sink
00335   ) ;
00336
00337     HRESULT STDMETHODCALLTYPE ExecQueryAsync (
00338
00339     const BSTR a_QueryLanguage ,
00340     const BSTR a_Query ,
00341     long a_Flags ,
00342     IWbemContext *a_Context ,
00343     IWbemObjectSink *a_Sink
00344   ) ;
00345
00346     HRESULT STDMETHODCALLTYPE ExecMethodAsync (
00347
00348     const BSTR a_ObjectPath ,
00349     const BSTR a_MethodName ,
00350     long a_Flags ,
00351     IWbemContext *a_Context ,
00352     IWbemClassObject *a_InParams ,
00353     IWbemObjectSink *a_Sink
00354   ) ;
00355
00356   /* IWbemPropertyProvider methods */
00357
00358     HRESULT STDMETHODCALLTYPE GetProperty (
00359
00360         long a_Flags ,
00361         const BSTR a_Locale ,
00362         const BSTR a_ClassMapping ,
00363         const BSTR a_InstanceMapping ,
00364         const BSTR a_PropertyMapping ,
00365         VARIANT *a_Value
00366   ) ;
00367
00368     HRESULT STDMETHODCALLTYPE PutProperty (
00369
00370         long a_Flags ,
00371         const BSTR a_Locale ,
00372         const BSTR a_ClassMapping ,
00373         const BSTR a_InstanceMapping ,
00374         const BSTR a_PropertyMapping ,
00375         const VARIANT *a_Value
00376   ) ;
00377
00378   /* IWbemProviderInit methods */
00379
00380   HRESULT STDMETHODCALLTYPE Initialize (
00381
00382     LPWSTR a_User ,
00383     LONG a_Flags ,
00384     LPWSTR a_Namespace ,
00385     LPWSTR a_Locale ,
00386     IWbemServices *a_Core ,
00387     IWbemContext *a_Context ,
00388     IWbemProviderInitSink *a_Sink
00389   ) ;
00390
00391   /* IWbemShutdown methods */
00392
00393   HRESULT STDMETHODCALLTYPE Shutdown (
00394
00395     LONG a_Flags ,
00396     ULONG a_MaxMilliSeconds ,
00397     IWbemContext *a_Context
00398   ) ;
00399 } ;
00400
00401
00402 #endif // _CProvider_IWbemServices_H
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CByotTransObj Member List

This is the complete list of members for CByotTransObj, including all inherited members.
AbortTransaction() | CByotTransObj |
BeginTransaction() | CByotTransObj |
CByotTransObj() | CByotTransObj | [inline]
CommitTransaction() | CByotTransObj |
get_TipURL(BSTR *pVal) | CByotTransObj |
InterfaceSupportsErrorInfo(REFIID riid) | CByotTransObj |
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/LogWriter/DllDatax.c Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest
  • LogWriter

DllDatax.c

Go to the documentation of this file.
00001 // wrapper for dlldata.c
00002
00003 #ifdef _MERGE_PROXYSTUB // merge proxy stub DLL
00004
00005 #define REGISTER_PROXY_DLL //DllRegisterServer, etc.
00006
00007 #define _WIN32_WINNT 0x0500 //for WinNT 4.0 or Win95 with DCOM
00008 #define USE_STUBLESS_PROXY  //defined only with MIDL switch /Oicf
00009
00010 #pragma comment(lib, "rpcndr.lib")
00011 #pragma comment(lib, "rpcns4.lib")
00012 #pragma comment(lib, "rpcrt4.lib")
00013
00014 #define DllMain       PrxDllMain
00015 #define DllRegisterServer PrxDllRegisterServer
00016 #define DllUnregisterServer PrxDllUnregisterServer
00017 #define DllGetClassObject   PrxDllGetClassObject
00018 #define DllCanUnloadNow     PrxDllCanUnloadNow
00019
00020 #include "dlldata.c"
00021 #include "LogWriter_p.c"
00022
00023 #ifdef _NOPROXY //no midl generated dlldata.c
00024
00025 #define STRICT 1
00026 #include <ole2.h>
00027
00028 BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00029 {return TRUE;}
00030
00031 STDAPI PrxDllCanUnloadNow(void){return S_OK;}
00032
00033 STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00034 {return CLASS_E_CLASSNOTAVAILABLE;}
00035
00036 STDAPI PrxDllRegisterServer(void){return S_OK;}
00037
00038 STDAPI PrxDllUnregisterServer(void){return S_OK;}
00039
00040 #endif //!PROXY_DELEGATION
00041
00042 #endif //_MERGE_PROXYSTUB
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/dataobj.h Source File

  • SysMgmt
  • MMC
  • Multisel

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium);
00048
00049     // The rest are not implemented
00050     //  STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00051   //  { return E_NOTIMPL; };
00052
00053     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00054     { return E_NOTIMPL; };
00055
00056     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00057     { return E_NOTIMPL; };
00058
00059     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00060     { return E_NOTIMPL; };
00061
00062     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00063     { return E_NOTIMPL; };
00064
00065     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00066     { return E_NOTIMPL; };
00067
00068     STDMETHODIMP DUnadvise (DWORD dwConnection)
00069     { return E_NOTIMPL; };
00070
00071     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00072     { return E_NOTIMPL; };
00073
00074     ///////////////////////////////
00075     // Custom Methods and Data
00076     ///////////////////////////////
00077
00078     CDelegationBase *GetBaseNodeObject() {
00079         return (CDelegationBase *)m_lCookie;
00080     }
00081
00082     DATA_OBJECT_TYPES GetContext() {
00083         return m_context;
00084     }
00085
00086   MMC_COOKIE GetCookie() { return m_lCookie; }
00087
00088   void AddMultiSelectCookie(int nIndexCookies, LPARAM lParam ) { pCookies[nIndexCookies] = (MMC_COOKIE)lParam; }
00089   MMC_COOKIE GetMultiSelectCookie(int n) { return pCookies[n]; }
00090
00091 private:
00092     enum { MAX_COOKIES = 20 }; // MAX_COOKIES == MAX_CHILDREN declared
00093                  // in CSpaceStation class
00094     MMC_COOKIE* pCookies;
00095
00096 public:
00097     // clipboard formats
00098     static UINT s_cfSZNodeType;
00099     static UINT s_cfDisplayName;
00100     static UINT s_cfNodeType;
00101     static UINT s_cfSnapinClsid;
00102     static UINT s_cfInternal;
00103   static UINT s_cfMultiSelect;
00104
00105 };
00106
00107 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00108 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00109 BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
00110
00111 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/FreeObject/Resource.h Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • FreeObject

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by FreeObject.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_FREETEST                    101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/resource.h Source File

  • SysMgmt
  • MMC
  • About

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDB_LGBMP                       112
00012 #define IDB_SMBMP                       113
00013 #define IDB_SMOPEN                      114
00014 #define IDR_SMICONS                     120
00015 #define IDR_LGICONS                     121
00016 #define IDB_ROCKET                      40004
00017 #define IDB_CAR                         40005
00018 #define IDB_PLANE                       40006
00019 #define IDB_BIKE                        40007
00020 #define IDB_ROCKET2                     40008
00021 #define IDB_CAR2                        40009
00022 #define IDB_PLANE2                      40010
00023 #define IDB_BIKE2                       40011
00024 #define IDB_CLOSED2                     40012
00025 #define IDB_OPEN2                       40013
00026 #define IDB_CLOSED                      40014
00027 #define IDB_OPEN                        40015
00028
00029 // Next default values for new objects
00030 //
00031 #ifdef APSTUDIO_INVOKED
00032 #ifndef APSTUDIO_READONLY_SYMBOLS
00033 #define _APS_NEXT_RESOURCE_VALUE        115
00034 #define _APS_NEXT_COMMAND_VALUE         40016
00035 #define _APS_NEXT_CONTROL_VALUE         1000
00036 #define _APS_NEXT_SYMED_VALUE           101
00037 #endif
00038 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/comp.h Source File

  • SysMgmt
  • MMC
  • Extens

comp.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMP_H_
00020 #define _SAMPCOMP_H_
00021
00022 #include <mmc.h>
00023
00024 class CComponent : public IComponent, IExtendPropertySheet2
00025 {
00026 private:
00027     ULONG       m_cref;
00028
00029     IConsole*   m_ipConsole;
00030
00031     class CComponentData *m_pComponentData;
00032
00033     public:
00034         CComponent(CComponentData *parent);
00035         ~CComponent();
00036
00037         ///////////////////////////////
00038         // Interface IUnknown
00039         ///////////////////////////////
00040         STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00041         STDMETHODIMP_(ULONG) AddRef();
00042         STDMETHODIMP_(ULONG) Release();
00043
00044         ///////////////////////////////
00045         // Interface IComponent
00046         ///////////////////////////////
00047         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00048             /* [in] */ LPCONSOLE lpConsole);
00049
00050             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00051             /* [in] */ LPDATAOBJECT lpDataObject,
00052             /* [in] */ MMC_NOTIFY_TYPE event,
00053             /* [in] */ LPARAM arg,
00054             /* [in] */ LPARAM param);
00055
00056             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
00057             /* [in] */ MMC_COOKIE cookie);
00058
00059             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00060             /* [in] */ MMC_COOKIE cookie,
00061             /* [in] */ DATA_OBJECT_TYPES type,
00062             /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00063
00064             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
00065             /* [in] */ MMC_COOKIE cookie,
00066             /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00067             /* [out] */ long __RPC_FAR *pViewOptions);
00068
00069             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00070             /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
00071
00072             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00073             /* [in] */ LPDATAOBJECT lpDataObjectA,
00074             /* [in] */ LPDATAOBJECT lpDataObjectB);
00075
00076             //////////////////////////////////
00077             // Interface IExtendPropertySheet2
00078             //////////////////////////////////
00079             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreatePropertyPages(
00080             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00081             /* [in] */ LONG_PTR handle,
00082             /* [in] */ LPDATAOBJECT lpIDataObject);
00083
00084             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryPagesFor(
00085             /* [in] */ LPDATAOBJECT lpDataObject);
00086
00087             virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetWatermarks(
00088             /* [in] */ LPDATAOBJECT lpIDataObject,
00089             /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00090             /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00091             /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00092             /* [out] */ BOOL __RPC_FAR *bStretch);
00093 };
00094
00095 #endif _SAMPCOMP_H_
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • Nameext

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x98015ff3, 0x6a2d, 0x11d3, {0x91, 0x54, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} };
00023
00024
00025 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00026 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00027
00028 //==============================================================
00029 //
00030 // CDelegationBase implementation
00031 //
00032 //
00033 CDelegationBase::CDelegationBase()
00034 : bExpanded(FALSE)
00035 {
00036   if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00037     LoadBitmaps();
00038 }
00039
00040 CDelegationBase::~CDelegationBase()
00041 {
00042 }
00043
00044 // CDelegationBase::AddImages sets up the collection of images to be displayed
00045 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00046 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00047 {
00048     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00049         (long *)m_pBMapLg, // pointer to a handle
00050         0, // index of the first image in the strip
00051         RGB(0, 128, 128)  // color of the icon mask
00052         );
00053 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDataset Member List

This is the complete list of members for CDataset, including all inherited members.
Abort(HCHAPTER hChapter, DBASYNCHOP eOperation) | CAsynchBase | [virtual]
AddRefAccessor(HACCESSOR hAccessor) | CDataAccess | [virtual]
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CDataset | [virtual]
AutoRelease() | CDataset | [virtual]
CAsynchBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CAsynchBase |
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CDataAccess(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CDataAccess |
CDataset(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CDataset |
CreateAccessor(DBACCESSORFLAGS dwAccessorFlags, DBCOUNTITEM cBindings, const DBBINDING *rgBindings, DBLENGTH cRowSize, HACCESSOR *phAccessor) | CDataAccess | [virtual]
CreateAccessors(BINDCOLS eBindCols) | CDataAccess | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CDataset | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
FreeAxisInfo(DBCOUNTITEM *pcAxis, MDAXISINFO **prgAxisInfo) | CDataset | [virtual]
GetAxisInfo(DBCOUNTITEM *pcAxis, MDAXISINFO **prgAxisInfo) | CDataset | [virtual]
GetAxisRowset(CAggregate *pCAggregate, DBCOUNTITEM iAxis, REFIID riid, ULONG cPropSets, DBPROPSET *rgPropSets, IUnknown **ppIUnknown) | CDataset | [virtual]
GetBaseType() | CBase | [inline]
GetCellData(DBORDINAL ulStartCell, DBORDINAL ulEndCell) | CDataset | [virtual]
GetColInfo() | CDataAccess | [virtual]
GetColInfo(DBORDINAL *pcColumns, DBCOLUMNINFO **prgColumnInfo, WCHAR **ppStringBuffer, DBORDINAL *pcHiddenColumns) | CDataAccess | [virtual]
GetColumnData(const DBBINDING *pBinding, void *pData, DBSTATUS *pdbStatus, DBLENGTH *pdbLength, DBTYPE *pwSubType, WCHAR *pwszValue, ULONG ulMaxSize, DWORD dwFlags, DBTYPE wBackendType) | CDataAccess | [virtual]
GetColumnImage(const DBCOLUMNINFO *pColInfo, DBSTATUS dbStatus=DBSTATUS_S_OK) | CDataAccess | [virtual]
GetColumnsRowset(CAggregate *pCAggregate, bool fOptColumns, REFIID riid, ULONG cPropSets, DBPROPSET *rgPropSets, IUnknown **ppIUnknown) | CDataAccess | [virtual]
GetDefaultInterface() | CDataset | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CDataset | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CDataset | [inline, virtual]
GetObjectMenu() | CDataset | [inline, virtual]
GetObjectName() | CDataset | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase, LPOLESTR *ppwszStatusText) | CAsynchBase | [virtual]
Initialize() | CAsynchBase | [virtual]
IsInitialized() | CAsynchBase | [inline, virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_Bindings | CDataAccess |
m_bSchemaRowset | CDataAccess |
m_cAxis | CDataset |
m_cbRowSize | CDataAccess |
m_ColumnInfo | CDataAccess |
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_dwCookieAsynchNotify | CAsynchBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_fInitialized | CAsynchBase |
m_guidSource | CBase |
m_hAccessor | CDataAccess |
m_hBmkAccessor | CDataAccess |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pData | CDataAccess |
m_pIAccessor | CDataAccess |
m_pIAggregate | CBase |
m_pIColumnsInfo | CDataAccess |
m_pIColumnsRowset | CDataAccess |
m_pIConnectionPointContainer | CContainerBase |
m_pIConvertType | CDataAccess |
m_pIDBAsynchStatus | CAsynchBase |
m_pIDBInitialize | CAsynchBase |
m_pIMDDataset | CDataset |
m_pIMDFind | CDataset |
m_pIMDRangeRowset | CDataset |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_rgAxisInfo | CDataset |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseAccessor(HACCESSOR *phAccessor, BOOL fReleaseAlways=FALSE) | CDataAccess | [virtual]
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetColumnData(const DBBINDING *pBinding, void *pData, DBSTATUS dbStatus, DBLENGTH dbLength, WCHAR *pwszValue, DWORD dwFlags, DBTYPE wBackendType) | CDataAccess | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
SetupBindings(BINDCOLS eBindCols, DBCOUNTITEM *cBindings, DBBINDING **prgBindings, DBLENGTH *pcRowSize=NULL) | CDataAccess | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
Uninitialize() | CAsynchBase | [virtual]
ValidateAccessor(HACCESSOR hAccessor, ULONG ulRefCount=1) | CDataAccess | [virtual]
~CAsynchBase() | CAsynchBase | [virtual]
~CBase() | CBase | [virtual]
~CContainerBase() | CContainerBase | [virtual]
~CDataAccess() | CDataAccess | [virtual]
~CDataset() | CDataset |
Generated on Wed Nov 13 2024 16:56:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/RecordsetEventsVt.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

RecordsetEventsVt.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface RecordsetEventsVt
00019 /** @com.interface(iid=00000403-0000-0010-8000-00AA006D2EA4, thread=AUTO) */
00020 public interface RecordsetEventsVt extends IUnknown
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([in,type=I4] cFields, [in,type=VARIANT] Fields, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00024   public void WillChangeField(int cFields, Variant Fields, int[] adStatus, msado15._Recordset pRecordset);
00025
00026   /** @com.method(vtoffset=1, addFlagsVtable=4)
00027       @com.parameters([in,type=I4] cFields, [in,type=VARIANT] Fields, [in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00028   public void FieldChangeComplete(int cFields, Variant Fields, msado15.Error pError, int[] adStatus, msado15._Recordset pRecordset);
00029
00030   /** @com.method(vtoffset=2, addFlagsVtable=4)
00031       @com.parameters([in,type=I4] adReason, [in,type=I4] cRecords, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00032   public void WillChangeRecord(int adReason, int cRecords, int[] adStatus, msado15._Recordset pRecordset);
00033
00034   /** @com.method(vtoffset=3, addFlagsVtable=4)
00035       @com.parameters([in,type=I4] adReason, [in,type=I4] cRecords, [in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00036   public void RecordChangeComplete(int adReason, int cRecords, msado15.Error pError, int[] adStatus, msado15._Recordset pRecordset);
00037
00038   /** @com.method(vtoffset=4, addFlagsVtable=4)
00039       @com.parameters([in,type=I4] adReason, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00040   public void WillChangeRecordset(int adReason, int[] adStatus, msado15._Recordset pRecordset);
00041
00042   /** @com.method(vtoffset=5, addFlagsVtable=4)
00043       @com.parameters([in,type=I4] adReason, [in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00044   public void RecordsetChangeComplete(int adReason, msado15.Error pError, int[] adStatus, msado15._Recordset pRecordset);
00045
00046   /** @com.method(vtoffset=6, addFlagsVtable=4)
00047       @com.parameters([in,type=I4] adReason, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00048   public void WillMove(int adReason, int[] adStatus, msado15._Recordset pRecordset);
00049
00050   /** @com.method(vtoffset=7, addFlagsVtable=4)
00051       @com.parameters([in,type=I4] adReason, [in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00052   public void MoveComplete(int adReason, msado15.Error pError, int[] adStatus, msado15._Recordset pRecordset);
00053
00054   /** @com.method(vtoffset=8, addFlagsVtable=4)
00055       @com.parameters([in,out,size=1,type=ARRAY] fMoreData, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00056   public void EndOfRecordset(boolean[] fMoreData, int[] adStatus, msado15._Recordset pRecordset);
00057
00058   /** @com.method(vtoffset=9, addFlagsVtable=4)
00059       @com.parameters([in,type=I4] Progress, [in,type=I4] MaxProgress, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00060   public void FetchProgress(int Progress, int MaxProgress, int[] adStatus, msado15._Recordset pRecordset);
00061
00062   /** @com.method(vtoffset=10, addFlagsVtable=4)
00063       @com.parameters([in,iid=00000500-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pError, [in,out,type=PTR] adStatus, [in,iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] pRecordset) */
00064   public void FetchComplete(msado15.Error pError, int[] adStatus, msado15._Recordset pRecordset);
00065
00066
00067   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x403, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00068 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll2/DtHandler.Cpp Source File

  • NetDS
  • WinSock
  • Dt_Dll2

DtHandler.Cpp

Go to the documentation of this file.
00001 // Filename  : DTHandler.cpp
00002 // Abstract  : This object implements a mechanism for hooking Winsock
00003 //             API calls via the 'DT hooks' present in the checked-build
00004 //             version of the ws2_32.dll. (See the Winsock DT sample on
00005 //             on the Platform SDK for specifications.)  Through invoking
00006 //             the DTHandler::dispatch() method, this object translates
00007 //             the hook's code ordinal and calls the appropriate virtual
00008 //             member function of the same Winsock API name, which you can
00009 //             overload through inheritance, with the proper API parameters
00010 //             expanded from DT's variable argument list call, making it
00011 //             possible for you to easily trace your Winsock application
00012 //             in a debug setting.
00013 // Author    : Jeffrey C. Venable, Sr.
00014 // Copyright : THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
00015 //             WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
00016 //             INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
00017 //             MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00018 //             Copyright (C) 1998 - 2002,  Microsoft Corporation.
00019 //             All rights reserved.
00020
00021 #pragma warning(disable: 4100 4512)
00022
00023 #include "DTHandler.hpp"
00024 #include "dt_dll.hpp"
00025
00026
00027 bool (* DTHandler::_dispatchTable[MAX_DTCODE + 1])(DTHandler *, APIHook<void> &, va_list) = {
00028
00029     NULL,
00030     DTHandler::_accept,
00031     DTHandler::_bind,
00032     DTHandler::_closesocket,
00033     DTHandler::_connect,
00034     DTHandler::_getpeername,
00035     DTHandler::_getsockname,
00036     DTHandler::_getsockopt,
00037     DTHandler::_htonl,
00038     DTHandler::_htons,
00039     DTHandler::_ioctlsocket,
00040     DTHandler::_listen,
00041     DTHandler::_ntohl,
00042     DTHandler::_ntohs,
00043     DTHandler::_recv,
00044     DTHandler::_recvfrom,
00045     DTHandler::_select,
00046     DTHandler::_send,
00047     DTHandler::_sendto,
00048     DTHandler::_setsockopt,
00049     DTHandler::_shutdown,
00050     DTHandler::_socket,
00051     DTHandler::_WSAAccept,
00052     DTHandler::_WSAAsyncSelect,
00053     DTHandler::_WSACancelBlockingCall,
00054     DTHandler::_WSACleanup,
00055     DTHandler::_WSACloseEvent,
00056     DTHandler::_WSAConnect,
00057     DTHandler::_WSACreateEvent,
00058     DTHandler::_WSADuplicateSocketA,
00059     DTHandler::_WSAEnumNetworkEvents,
00060     DTHandler::_WSAEnumProtocolsA,
00061     DTHandler::_WSAEventSelect,
00062     DTHandler::_WSAGetLastError,
00063     DTHandler::_WSAGetOverlappedResult,
00064     DTHandler::_WSAGetQOSByName,
00065     DTHandler::_WSAHtonl,
00066     DTHandler::_WSAHtons,
00067     DTHandler::_WSAIoctl,
00068     DTHandler::_WSAIsBlocking,
00069     DTHandler::_WSAJoinLeaf,
00070     DTHandler::_WSANtohl,
00071     DTHandler::_WSANtohs,
00072     DTHandler::_WSARecv,
00073     DTHandler::_WSARecvDisconnect,
00074     DTHandler::_WSARecvFrom,
00075     DTHandler::_WSAResetEvent,
00076     DTHandler::_WSASend,
00077     DTHandler::_WSASendDisconnect,
00078     DTHandler::_WSASendTo,
00079     DTHandler::_WSASetBlockingHook,
00080     DTHandler::_WSASetEvent,
00081     DTHandler::_WSASetLastError,
00082     DTHandler::_WSASocketA,
00083     DTHandler::_WSAStartup,
00084     DTHandler::_WSAUnhookBlockingHook,
00085     DTHandler::_WSAWaitForMultipleEvents,
00086     DTHandler::_gethostbyaddr,
00087     DTHandler::_gethostbyname,
00088     DTHandler::_gethostname,
00089     DTHandler::_getprotobyname,
00090     DTHandler::_getprotobynumber,
00091     DTHandler::_getservbyname,
00092     DTHandler::_getservbyport,
00093     DTHandler::_inet_addr,
00094     DTHandler::_inet_ntoa,
00095     DTHandler::_WSAAsyncGetHostByAddr,
00096     DTHandler::_WSAAsyncGetHostByName,
00097     DTHandler::_WSAAsyncGetProtoByName,
00098     DTHandler::_WSAAsyncGetProtoByNumber,
00099     DTHandler::_WSAAsyncGetServByName,
00100     DTHandler::_WSAAsyncGetServByPort,
00101     DTHandler::_WSACancelAsyncRequest,
00102     DTHandler::_WSPAccept,
00103     DTHandler::_WSPAsyncSelect,
00104     DTHandler::_WSPBind,
00105     DTHandler::_WSPCancelBlockingCall,
00106     DTHandler::_WSPCleanup,
00107     DTHandler::_WSPCloseSocket,
00108     DTHandler::_WSPConnect,
00109     DTHandler::_WSPDuplicateSocket,
00110     DTHandler::_WSPEnumNetworkEvents,
00111     DTHandler::_WSPEventSelect,
00112     DTHandler::_WSPGetOverlappedResult,
00113     DTHandler::_WSPGetPeerName,
00114     NULL, // DTHandler::_WSPGetProcTable
00115     DTHandler::_WSPGetSockName,
00116     DTHandler::_WSPGetSockOpt,
00117     DTHandler::_WSPGetQOSByName,
00118     DTHandler::_WSPIoctl,
00119     DTHandler::_WSPJoinLeaf,
00120     DTHandler::_WSPListen,
00121     DTHandler::_WSPRecv,
00122     DTHandler::_WSPRecvDisconnect,
00123     DTHandler::_WSPRecvFrom,
00124     DTHandler::_WSPSelect,
00125     DTHandler::_WSPSend,
00126     DTHandler::_WSPSendDisconnect,
00127     DTHandler::_WSPSendTo,
00128     DTHandler::_WSPSetSockOpt,
00129     DTHandler::_WSPShutdown,
00130     DTHandler::_WSPSocket,
00131     DTHandler::_WSPStartup,
00132     DTHandler::_WPUCloseEvent,
00133     DTHandler::_WPUCloseSocketHandle,
00134     DTHandler::_WPUCreateEvent,
00135     DTHandler::_WPUCreateSocketHandle,
00136     DTHandler::_WSCDeinstallProvider,
00137     DTHandler::_WSCInstallProvider,
00138     DTHandler::_WPUModifyIFSHandle,
00139     DTHandler::_WPUQueryBlockingCallback,
00140     DTHandler::_WPUQuerySocketHandleContext,
00141     DTHandler::_WPUQueueApc,
00142     DTHandler::_WPUResetEvent,
00143     DTHandler::_WPUSetEvent,
00144     DTHandler::_WSCEnumProtocols,
00145     DTHandler::_WPUGetProviderPath,
00146     DTHandler::_WPUPostMessage,
00147     DTHandler::_WPUFDIsSet,
00148     DTHandler::_WSADuplicateSocketW,
00149     DTHandler::_WSAEnumProtocolsW,
00150     DTHandler::_WSASocketW,
00151     DTHandler::___WSAFDIsSet,
00152     DTHandler::_WSAAddressToStringA,
00153     DTHandler::_WSAAddressToStringW,
00154     DTHandler::_WSAStringToAddressA,
00155     DTHandler::_WSAStringToAddressW,
00156     DTHandler::_WSALookupServiceBeginA,
00157     DTHandler::_WSALookupServiceBeginW,
00158     DTHandler::_WSALookupServiceNextA,
00159     DTHandler::_WSALookupServiceNextW,
00160     DTHandler::_WSALookupServiceEnd,
00161     NULL, // DTHandler::_WSAGetAddressByNameA
00162     NULL, // DTHandler::_WSAGetAddressByNameW
00163     DTHandler::_WSAInstallServiceClassA,
00164     DTHandler::_WSAInstallServiceClassW,
00165     DTHandler::_WSASetServiceA,
00166     DTHandler::_WSASetServiceW,
00167     DTHandler::_WSARemoveServiceClass,
00168     DTHandler::_WSAGetServiceClassInfoA,
00169     DTHandler::_WSAGetServiceClassInfoW,
00170     DTHandler::_WSAEnumNameSpaceProvidersA,
00171     DTHandler::_WSAEnumNameSpaceProvidersW,
00172     DTHandler::_WSAGetServiceClassNameByClassIdA,
00173     DTHandler::_WSAGetServiceClassNameByClassIdW,
00174     DTHandler::_NSPAddressToString,
00175     DTHandler::_NSPStringToAddress,
00176     DTHandler::_NSPLookupServiceBegin,
00177     DTHandler::_NSPLookupServiceNext,
00178     DTHandler::_NSPLookupServiceEnd,
00179     DTHandler::_NSPGetAddressByName,
00180     DTHandler::_NSPInstallServiceClass,
00181     DTHandler::_NSPSetService,
00182     DTHandler::_NSPRemoveServiceClass,
00183     DTHandler::_NSPGetServiceClassInfo,
00184     NULL, // DTHandler::_NSPEnumNameSpaceProviders
00185     DTHandler::_NSPGetServiceClassNameByClassId,
00186     DTHandler::_WSCGetProviderPath,
00187     DTHandler::_WSCInstallNameSpace,
00188     DTHandler::_WSCUnInstallNameSpace,
00189     DTHandler::_WSCEnableNSProvider,
00190     DTHandler::_WSPAddressToString,
00191     DTHandler::_WSPStringToAddress,
00192 #if (WINVER >= 0x0501)
00193     DTHandler::_WSANSPIoctl,
00194     DTHandler::_NSPIoctl,
00195     DTHandler::_WPUCompleteOverlappedRequest,
00196     DTHandler::_WSAProviderConfigChange,
00197     DTHandler::_WSCWriteProviderOrder,
00198     DTHandler::_WSCWriteNameSpaceOrder,
00199     DTHandler::_WSCUpdateProvider,
00200     DTHandler::_getaddrinfo,
00201     DTHandler::_getnameinfo,
00202     DTHandler::_freeaddrinfo,
00203     DTHandler::_NSPStartup,
00204     DTHandler::_WPUOpenCurrentThread,
00205     DTHandler::_WPUCloseThread,
00206 #if defined(_WIN64)
00207     DTHandler::_WSCEnumProtocols32,
00208     DTHandler::_WSCInstallProvider64_32,
00209     DTHandler::_WSCDeinstallProvider32,
00210     DTHandler::_WSCGetProviderPath32,
00211     DTHandler::_WSCUpdateProvider32,
00212     DTHandler::_WSCWriteProviderOrder32,
00213     DTHandler::_WSCEnumNameSpaceProviders32,
00214     DTHandler::_WSCInstallNameSpace32,
00215     DTHandler::_WSCUnInstallNameSpace32,
00216     DTHandler::_WSCEnableNSProvider32,
00217     DTHandler::_WSCWriteNameSpaceOrder32,
00218 #endif // defined(_WIN64)
00219 #endif // (WINVER >= 0x0501)
00220
00221 }; // DTHandler::_dispatchTable
00222
00223
00224 bool
00225 DTHandler::dispatch(int notificationCode, void *returnCode, char *LibraryName, bool preAPI, va_list vl) {
00226
00227     if ((notificationCode >= 1) && (notificationCode <= MAX_DTCODE) && (_dispatchTable[notificationCode] != NULL)) {
00228
00229         APIHook<void> hook(returnCode, LibraryName, preAPI);
00230
00231         return (_dispatchTable[notificationCode](this, hook, vl));
00232
00233     }
00234
00235     return (false);
00236
00237 } // DTHandler::dispatch()
00238
00239
00240 bool
00241 DTHandler::accept(SOCKET s, struct sockaddr *addr, int *addrlen, APIHook<SOCKET> &hook) {
00242
00243     return (false);
00244
00245 } // DTHandler::accept()
00246
00247
00248 bool
00249 DTHandler::_accept(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00250
00251     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00252     struct sockaddr *addr = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
00253     int *addrlen = (int *)*va_arg(vList, int **);
00254
00255     return (handler->accept(s, addr, addrlen, (APIHook<SOCKET> &)hook));
00256
00257 } // DTHandler::_accept()
00258
00259
00260 bool
00261 DTHandler::bind(SOCKET s, const struct sockaddr *name, int namelen, APIHook<int> &hook) {
00262
00263     return (false);
00264
00265 } // DTHandler::bind()
00266
00267
00268 bool
00269 DTHandler::_bind(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00270
00271     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00272     const struct sockaddr *name = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
00273     int namelen = (int)*va_arg(vList, int *);
00274
00275     return (handler->bind(s, name, namelen, (APIHook<int> &)hook));
00276
00277 } // DTHandler::_bind()
00278
00279
00280 bool
00281 DTHandler::closesocket(SOCKET s, APIHook<int> &hook) {
00282
00283     return (false);
00284
00285 } // DTHandler::closesocket()
00286
00287
00288 bool
00289 DTHandler::_closesocket(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00290
00291     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00292
00293     return (handler->closesocket(s, (APIHook<int> &)hook));
00294
00295 } // DTHandler::_closesocket()
00296
00297
00298 bool
00299 DTHandler::connect(SOCKET s, const struct sockaddr *name, int namelen, APIHook<int> &hook) {
00300
00301     return (false);
00302
00303 } // DTHandler::connect()
00304
00305
00306 bool
00307 DTHandler::_connect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00308
00309     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00310     const struct sockaddr *name = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
00311     int namelen = (int)*va_arg(vList, int *);
00312
00313     return (handler->connect(s, name, namelen, (APIHook<int> &)hook));
00314
00315 } // DTHandler::_connect()
00316
00317
00318 bool
00319 DTHandler::getpeername(SOCKET s, struct sockaddr *name, int *namelen, APIHook<int> &hook) {
00320
00321     return (false);
00322
00323 } // DTHandler::getpeername()
00324
00325
00326 bool
00327 DTHandler::_getpeername(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00328
00329     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00330     struct sockaddr *name = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
00331     int *namelen = (int *)*va_arg(vList, int **);
00332
00333     return (handler->getpeername(s, name, namelen, (APIHook<int> &)hook));
00334
00335 } // DTHandler::_getpeername()
00336
00337
00338 bool
00339 DTHandler::getsockname(SOCKET s, struct sockaddr *name, int *namelen, APIHook<int> &hook) {
00340
00341     return (false);
00342
00343 } // DTHandler::getsockname()
00344
00345
00346 bool
00347 DTHandler::_getsockname(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00348
00349     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00350     struct sockaddr *name = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
00351     int *namelen = (int *)*va_arg(vList, int **);
00352
00353     return (handler->getsockname(s, name, namelen, (APIHook<int> &)hook));
00354
00355 } // DTHandler::_getsockname()
00356
00357
00358 bool
00359 DTHandler::getsockopt(SOCKET s, int level, int optname, char *optval, int *optlen, APIHook<int> &hook) {
00360
00361     return (false);
00362
00363 } // DTHandler::getsockopt()
00364
00365
00366 bool
00367 DTHandler::_getsockopt(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00368
00369     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00370     int level = (int)*va_arg(vList, int *);
00371     int optname = (int)*va_arg(vList, int *);
00372     char *optval = (char *)*va_arg(vList, char **);
00373     int *optlen = (int *)*va_arg(vList, int **);
00374
00375     return (handler->getsockopt(s, level, optname, optval, optlen, (APIHook<int> &)hook));
00376
00377 } // DTHandler::_getsockopt()
00378
00379
00380 bool
00381 DTHandler::htonl(DWORD hostlong, APIHook<DWORD> &hook) {
00382
00383     return (false);
00384
00385 } // DTHandler::htonl()
00386
00387
00388 bool
00389 DTHandler::_htonl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00390
00391     DWORD hostlong = (DWORD)*va_arg(vList, DWORD *);
00392
00393     return (handler->htonl(hostlong, (APIHook<DWORD> &)hook));
00394
00395 } // DTHandler::_htonl()
00396
00397
00398 bool
00399 DTHandler::htons(unsigned short hostshort, APIHook<unsigned short> &hook) {
00400
00401     return (false);
00402
00403 } // DTHandler::htons()
00404
00405
00406 bool
00407 DTHandler::_htons(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00408
00409     unsigned short hostshort = (unsigned short)*va_arg(vList, unsigned short *);
00410
00411     return (handler->htons(hostshort, (APIHook<unsigned short> &)hook));
00412
00413 } // DTHandler::_htons()
00414
00415
00416 bool
00417 DTHandler::ioctlsocket(SOCKET s, long cmd, unsigned long *argp, APIHook<int> &hook) {
00418
00419     return (false);
00420
00421 } // DTHandler::ioctlsocket()
00422
00423
00424 bool
00425 DTHandler::_ioctlsocket(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00426
00427     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00428     long cmd = (long)*va_arg(vList, long *);
00429     unsigned long *argp = (unsigned long *)*va_arg(vList, unsigned long **);
00430
00431     return (handler->ioctlsocket(s, cmd, argp, (APIHook<int> &)hook));
00432
00433 } // DTHandler::_ioctlsocket()
00434
00435
00436 bool
00437 DTHandler::listen(SOCKET s, int backlog, APIHook<int> &hook) {
00438
00439     return (false);
00440
00441 } // DTHandler::listen()
00442
00443
00444 bool
00445 DTHandler::_listen(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00446
00447     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00448     int backlog = (int)*va_arg(vList, int *);
00449
00450     return (handler->listen(s, backlog, (APIHook<int> &)hook));
00451
00452 } // DTHandler::_listen()
00453
00454
00455 bool
00456 DTHandler::ntohl(unsigned long netlong, APIHook<DWORD> &hook) {
00457
00458     return (false);
00459
00460 } // DTHandler::ntohl()
00461
00462
00463 bool
00464 DTHandler::_ntohl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00465
00466     unsigned long netlong = (unsigned long)*va_arg(vList, unsigned long *);
00467
00468     return (handler->ntohl(netlong, (APIHook<DWORD> &)hook));
00469
00470 } // DTHandler::_ntohl()
00471
00472
00473 bool
00474 DTHandler::ntohs(unsigned short netshort, APIHook<unsigned short> &hook) {
00475
00476     return (false);
00477
00478 } // DTHandler::ntohs()
00479
00480
00481 bool
00482 DTHandler::_ntohs(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00483
00484     unsigned short netshort = (unsigned short)*va_arg(vList, unsigned short *);
00485
00486     return (handler->ntohs(netshort, (APIHook<WORD> &)hook));
00487
00488 } // DTHandler::_ntohs()
00489
00490
00491 bool
00492 DTHandler::recv(SOCKET s, char *buf, int len, int flags, APIHook<int> &hook) {
00493
00494     return (false);
00495
00496 } // DTHandler::recv()
00497
00498
00499 bool
00500 DTHandler::_recv(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00501
00502     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00503     char *buf = (char *)*va_arg(vList, char **);
00504     int len = (int)*va_arg(vList, int *);
00505     int flags = (int)*va_arg(vList, int *);
00506
00507     return (handler->recv(s, buf, len, flags, (APIHook<int> &)hook));
00508
00509 } // DTHandler::_recv()
00510
00511
00512 bool
00513 DTHandler::recvfrom(SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen, APIHook<int> &hook) {
00514
00515     return (false);
00516
00517 } // DTHandler::recvfrom()
00518
00519
00520 bool
00521 DTHandler::_recvfrom(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00522
00523     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00524     char *buf = (char *)*va_arg(vList, char **);
00525     int len = (int)*va_arg(vList, int *);
00526     int flags = (int)*va_arg(vList, int *);
00527     struct sockaddr *from = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
00528     int *fromlen = (int *)*va_arg(vList, int **);
00529
00530     return (handler->recvfrom(s, buf, len, flags, from, fromlen, (APIHook<int> &)hook));
00531
00532 } // DTHandler::_recvfrom()
00533
00534
00535 bool
00536 DTHandler::select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
00537                   const struct timeval *timeout, APIHook<int> &hook) {
00538
00539     return (false);
00540
00541 } // DTHandler::select()
00542
00543
00544 bool
00545 DTHandler::_select(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00546
00547     int nfds = (int)*va_arg(vList, int *);
00548     fd_set *readfds = (fd_set *)*va_arg(vList, fd_set **);
00549     fd_set *writefds = (fd_set *)*va_arg(vList, fd_set **);
00550     fd_set *exceptfds = (fd_set *)*va_arg(vList, fd_set **);
00551     const struct timeval *timeout = (const struct timeval *)*va_arg(vList, const struct timeval **);
00552
00553     return (handler->select(nfds, readfds, writefds, exceptfds, timeout, (APIHook<int> &)hook));
00554
00555 } // DTHandler::_select()
00556
00557
00558 bool
00559 DTHandler::send(SOCKET s, const char *buf, int len, int flags, APIHook<int> &hook) {
00560
00561     return (false);
00562
00563 } // DTHandler::send()
00564
00565
00566 bool
00567 DTHandler::_send(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00568
00569     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00570     const char *buf = (const char *)*va_arg(vList, const char **);
00571     int len = (int)*va_arg(vList, int *);
00572     int flags = (int)*va_arg(vList, int *);
00573
00574     return (handler->send(s, buf, len, flags, (APIHook<int> &)hook));
00575
00576 } // DTHandler::_send()
00577
00578
00579 bool
00580 DTHandler::sendto(SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen, APIHook<int> &hook) {
00581
00582     return (false);
00583
00584 } // DTHandler::sendto()
00585
00586
00587 bool
00588 DTHandler::_sendto(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00589
00590     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00591     const char *buf = (const char *)*va_arg(vList, const char **);
00592     int len = (int)*va_arg(vList, int *);
00593     int flags = (int)*va_arg(vList, int *);
00594     const struct sockaddr *to = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
00595     int tolen = (int)*va_arg(vList, int *);
00596
00597     return (handler->sendto(s, buf, len, flags, to, tolen, (APIHook<int> &)hook));
00598
00599 } // DTHandler::_sendto()
00600
00601
00602 bool
00603 DTHandler::setsockopt(SOCKET s, int level, int optname, const char *optval, int optlen, APIHook<int> &hook) {
00604
00605     return (false);
00606
00607 } // DTHandler::setsockopt()
00608
00609
00610 bool
00611 DTHandler::_setsockopt(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00612
00613     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00614     int level = (int)*va_arg(vList, int *);
00615     int optname = (int)*va_arg(vList, int *);
00616     const char *optval = (const char *)*va_arg(vList, const char **);
00617     int optlen = (int)*va_arg(vList, int *);
00618
00619     return (handler->setsockopt(s, level, optname, optval, optlen, (APIHook<int> &)hook));
00620
00621 } // DTHandler::_setsockopt()
00622
00623
00624 bool
00625 DTHandler::shutdown(SOCKET s, int how, APIHook<int> &hook) {
00626
00627     return (false);
00628
00629 } // DTHandler::shutdown()
00630
00631
00632 bool
00633 DTHandler::_shutdown(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00634
00635     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00636     int how = (int)*va_arg(vList, int *);
00637
00638     return (handler->shutdown(s, how, (APIHook<int> &)hook));
00639
00640 } // DTHandler::_shutdown()
00641
00642
00643 bool
00644 DTHandler::socket(int af, int type, int protocol, APIHook<SOCKET> &hook) {
00645
00646     return (false);
00647
00648 } // DTHandler::socket()
00649
00650
00651 bool
00652 DTHandler::_socket(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00653
00654     int af = (int)*va_arg(vList, int *);
00655     int type = (int)*va_arg(vList, int *);
00656     int protocol = (int)*va_arg(vList, int *);
00657
00658     return (handler->socket(af, type, protocol, (APIHook<SOCKET> &)hook));
00659
00660 } // DTHandler::_socket()
00661
00662
00663 bool
00664 DTHandler::WSAAccept(SOCKET s, struct sockaddr *addr, int *addrlen, LPCONDITIONPROC lpfnCondition,
00665                      unsigned long dwCallbackData, APIHook<SOCKET> &hook) {
00666
00667     return (false);
00668
00669 } // DTHandler::WSAAccept()
00670
00671
00672 bool
00673 DTHandler::_WSAAccept(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00674
00675     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00676     struct sockaddr *addr = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
00677     int *addrlen = (int *)*va_arg(vList, int **);
00678     LPCONDITIONPROC lpfnCondition = (LPCONDITIONPROC)*va_arg(vList, LPCONDITIONPROC *);
00679     unsigned long dwCallbackData = (unsigned long)*va_arg(vList, unsigned long *);
00680
00681     return (handler->WSAAccept(s, addr, addrlen, lpfnCondition, dwCallbackData, (APIHook<SOCKET> &)hook));
00682
00683 } // DTHandler::_WSAAccept()
00684
00685
00686 bool
00687 DTHandler::WSAAsyncSelect(SOCKET s, HWND hWnd, unsigned int wMsg, long lEvent, APIHook<int> &hook) {
00688
00689     return (false);
00690
00691 } // DTHandler::WSAAsyncSelect()
00692
00693
00694 bool
00695 DTHandler::_WSAAsyncSelect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00696
00697     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00698     HWND hWnd = (HWND)*va_arg(vList, HWND *);
00699     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
00700     long lEvent = (long)*va_arg(vList, long *);
00701
00702     return (handler->WSAAsyncSelect(s, hWnd, wMsg, lEvent, (APIHook<int> &)hook));
00703
00704 } // DTHandler::_WSAAsyncSelect()
00705
00706
00707 bool
00708 DTHandler::WSACancelBlockingCall(APIHook<int> &hook) {
00709
00710     return (false);
00711
00712 } // DTHandler::WSACancelBlockingCall()
00713
00714
00715 bool
00716 DTHandler::_WSACancelBlockingCall(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00717
00718     return (handler->WSACancelBlockingCall((APIHook<int> &)hook));
00719
00720 } // DTHandler::_WSACancelBlockingCall()
00721
00722
00723 bool
00724 DTHandler::WSACleanup(APIHook<int> &hook) {
00725
00726     return (false);
00727
00728 } // DTHandler::WSACleanup()
00729
00730
00731 bool
00732 DTHandler::_WSACleanup(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00733
00734     return (handler->WSACleanup((APIHook<int> &)hook));
00735
00736 } // DTHandler::_WSACleanup()
00737
00738
00739 bool
00740 DTHandler::WSACloseEvent(WSAEVENT hEvent, APIHook<int> &hook) {
00741
00742     return (false);
00743
00744 } // DTHandler::WSACloseEvent()
00745
00746
00747 bool
00748 DTHandler::_WSACloseEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00749
00750     WSAEVENT hEvent = (WSAEVENT)*va_arg(vList, WSAEVENT *);
00751
00752     return (handler->WSACloseEvent(hEvent, (APIHook<int> &)hook));
00753
00754 } // DTHandler::_WSACloseEvent()
00755
00756
00757 bool
00758 DTHandler::WSAConnect(SOCKET s, const struct sockaddr *name, int namelen, LPWSABUF lpCallerData,
00759                       LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, APIHook<int> &hook) {
00760
00761     return (false);
00762
00763 } // DTHandler::WSAConnect()
00764
00765
00766 bool
00767 DTHandler::_WSAConnect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00768
00769     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00770     const struct sockaddr *name = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
00771     int namelen = (int)*va_arg(vList, int *);
00772     LPWSABUF lpCallerData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
00773     LPWSABUF lpCalleeData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
00774     LPQOS lpSQOS = (LPQOS)*va_arg(vList, LPQOS *);
00775     LPQOS lpGQOS = (LPQOS)*va_arg(vList, LPQOS *);
00776
00777     return (handler->WSAConnect(s, name, namelen, lpCallerData, lpCalleeData, lpSQOS, lpGQOS, (APIHook<int> &)hook));
00778
00779 } // DTHandler::_WSAConnect()
00780
00781
00782 bool
00783 DTHandler::WSACreateEvent(APIHook<WSAEVENT> &hook) {
00784
00785     return (false);
00786
00787 } // DTHandler::WSACreateEvent()
00788
00789
00790 bool
00791 DTHandler::_WSACreateEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00792
00793     return (handler->WSACreateEvent((APIHook<WSAEVENT> &)hook));
00794
00795 } // DTHandler::_WSACreateEvent()
00796
00797
00798 bool
00799 DTHandler::WSADuplicateSocketA(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOA lpProtocolInfo, APIHook<int> &hook) {
00800
00801     return (false);
00802
00803 } // DTHandler::WSADuplicateSocketA()
00804
00805
00806 bool
00807 DTHandler::_WSADuplicateSocketA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00808
00809     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00810     DWORD dwProcessId = (DWORD)*va_arg(vList, DWORD *);
00811     LPWSAPROTOCOL_INFOA lpProtocolInfo = (LPWSAPROTOCOL_INFOA)*va_arg(vList, LPWSAPROTOCOL_INFOA *);
00812
00813     return (handler->WSADuplicateSocketA(s, dwProcessId, lpProtocolInfo, (APIHook<int> &)hook));
00814
00815 } // DTHandler::_WSADuplicateSocketA()
00816
00817
00818 bool
00819 DTHandler::WSADuplicateSocketW(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOW lpProtocolInfo, APIHook<int> &hook) {
00820
00821     return (false);
00822
00823 } // DTHandler::WSADuplicateSocketW()
00824
00825
00826 bool
00827 DTHandler::_WSADuplicateSocketW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00828
00829     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00830     DWORD dwProcessId = (DWORD)*va_arg(vList, DWORD *);
00831     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOA *);
00832
00833     return (handler->WSADuplicateSocketW(s, dwProcessId, lpProtocolInfo, (APIHook<int> &)hook));
00834
00835 } // DTHandler::_WSADuplicateSocketW()
00836
00837
00838 bool
00839 DTHandler::WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents, APIHook<int> &hook) {
00840
00841     return (false);
00842
00843 } // DTHandler::WSAEnumNetworkEvents()
00844
00845
00846 bool
00847 DTHandler::_WSAEnumNetworkEvents(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00848
00849     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00850     WSAEVENT hEventObject = (WSAEVENT)*va_arg(vList, WSAEVENT *);
00851     LPWSANETWORKEVENTS lpNetworkEvents = (LPWSANETWORKEVENTS)*va_arg(vList, LPWSANETWORKEVENTS *);
00852
00853     return (handler->WSAEnumNetworkEvents(s, hEventObject, lpNetworkEvents, (APIHook<int> &)hook));
00854
00855 } // DTHandler::_WSAEnumNetworkEvents()
00856
00857
00858 bool
00859 DTHandler::WSAEnumProtocolsA(LPINT lpiProtocols, LPWSAPROTOCOL_INFOA lpProtocolBuffer,
00860                              LPDWORD lpdwBufferLength, APIHook<int> &hook) {
00861
00862     return (false);
00863
00864 } // DTHandler::WSAEnumProtocolsA()
00865
00866
00867 bool
00868 DTHandler::_WSAEnumProtocolsA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00869
00870     LPINT lpiProtocols = (LPINT)*va_arg(vList, LPINT *);
00871     LPWSAPROTOCOL_INFOA lpProtocolBuffer = (LPWSAPROTOCOL_INFOA)*va_arg(vList, LPWSAPROTOCOL_INFOA *);
00872     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
00873
00874     return (handler->WSAEnumProtocolsA(lpiProtocols, lpProtocolBuffer, lpdwBufferLength, (APIHook<int> &)hook));
00875
00876 } // DTHandler::_WSAEnumProtocolsA()
00877
00878
00879 bool
00880 DTHandler::WSAEnumProtocolsW(LPINT lpiProtocols, LPWSAPROTOCOL_INFOW lpProtocolBuffer,
00881                              LPDWORD lpdwBufferLength, APIHook<int> &hook) {
00882
00883     return (false);
00884
00885 } // DTHandler::WSAEnumProtocolsW()
00886
00887
00888 bool
00889 DTHandler::_WSAEnumProtocolsW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00890
00891     LPINT lpiProtocols = (LPINT)*va_arg(vList, LPINT *);
00892     LPWSAPROTOCOL_INFOW lpProtocolBuffer = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOA *);
00893     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
00894
00895     return (handler->WSAEnumProtocolsW(lpiProtocols, lpProtocolBuffer, lpdwBufferLength, (APIHook<int> &)hook));
00896
00897 } // DTHandler::_WSAEnumProtocolsW()
00898
00899
00900 bool
00901 DTHandler::WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents, APIHook<int> &hook) {
00902
00903     return (false);
00904
00905 } // DTHandler::WSAEventSelect()
00906
00907
00908 bool
00909 DTHandler::_WSAEventSelect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00910
00911     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00912     WSAEVENT hEventObject = (WSAEVENT)*va_arg(vList, WSAEVENT *);
00913     long lNetworkEvents = (long)*va_arg(vList, long *);
00914
00915     return (handler->WSAEventSelect(s, hEventObject, lNetworkEvents, (APIHook<int> &)hook));
00916
00917 } // DTHandler::_WSAEventSelect()
00918
00919
00920 bool
00921 DTHandler::WSAGetLastError(APIHook<int> &hook) {
00922
00923     return (false);
00924
00925 } // DTHandler::WSAGetLastError()
00926
00927
00928 bool
00929 DTHandler::_WSAGetLastError(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00930
00931     return (handler->WSAGetLastError((APIHook<int> &)hook));
00932
00933 } // DTHandler::_WSAGetLastError()
00934
00935
00936 bool
00937 DTHandler::WSAGetOverlappedResult(SOCKET s, LPWSAOVERLAPPED lpOverlapped, LPDWORD lpcbTransfer,
00938                                   BOOL fWait, LPDWORD lpdwFlags, APIHook<int> &hook) {
00939
00940     return (false);
00941
00942 } // DTHandler::WSAGetOverlappedResult()
00943
00944
00945 bool
00946 DTHandler::_WSAGetOverlappedResult(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00947
00948     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00949     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
00950     LPDWORD lpcbTransfer = (LPDWORD)*va_arg(vList, LPDWORD *);
00951     BOOL fWait = (BOOL)*va_arg(vList, BOOL *);
00952     LPDWORD lpdwFlags = (LPDWORD)*va_arg(vList, LPDWORD *);
00953
00954     return (handler->WSAGetOverlappedResult(s, lpOverlapped, lpcbTransfer, fWait, lpdwFlags, (APIHook<int> &)hook));
00955
00956 } // DTHandler::_WSAGetOverlappedResult()
00957
00958
00959 bool
00960 DTHandler::WSAGetQOSByName(SOCKET s, LPWSABUF lpQOSName, LPQOS lpQOS, APIHook<int> &hook) {
00961
00962     return (false);
00963
00964 } // DTHandler::WSAGetQOSByName()
00965
00966
00967 bool
00968 DTHandler::_WSAGetQOSByName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00969
00970     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00971     LPWSABUF lpQOSName = (LPWSABUF)*va_arg(vList, LPWSABUF *);
00972     LPQOS lpQOS = (LPQOS)*va_arg(vList, LPQOS *);
00973
00974     return (handler->WSAGetQOSByName(s, lpQOSName, lpQOS, (APIHook<int> &)hook));
00975
00976 } // DTHandler::_WSAGetQOSByName()
00977
00978
00979 bool
00980 DTHandler::WSAHtonl(SOCKET s, unsigned long hostlong, unsigned long *lpnetlong, APIHook<int> &hook) {
00981
00982     return (false);
00983
00984 } // DTHandler::WSAHtonl()
00985
00986
00987 bool
00988 DTHandler::_WSAHtonl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
00989
00990     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
00991     unsigned long hostlong = (unsigned long)*va_arg(vList, unsigned long *);
00992     unsigned long *lpnetlong = (unsigned long *)*va_arg(vList, unsigned long **);
00993
00994     return (handler->WSAHtonl(s, hostlong, lpnetlong, (APIHook<int> &)hook));
00995
00996 } // DTHandler::_WSAHtonl()
00997
00998
00999 bool
01000 DTHandler::WSAHtons(SOCKET s, unsigned short hostshort, unsigned short *lpnetshort, APIHook<int> &hook) {
01001
01002     return (false);
01003
01004 } // DTHandler::WSAHtons()
01005
01006
01007 bool
01008 DTHandler::_WSAHtons(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01009
01010     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01011     unsigned short hostshort = (unsigned short)*va_arg(vList, unsigned short *);
01012     unsigned short *lpnetshort = (unsigned short *)*va_arg(vList, unsigned short **);
01013
01014     return (handler->WSAHtons(s, hostshort, lpnetshort, (APIHook<int> &)hook));
01015
01016 } // DTHandler::_WSAHtons()
01017
01018
01019 bool
01020 DTHandler::WSAIoctl(SOCKET s, DWORD dwIoControlCode,
01021                     LPVOID lpvInBuffer, DWORD cbInBuffer,
01022                     LPVOID lpvOutBuffer, DWORD cbOutBuffer,
01023                     LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped,
01024                     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook<int> &hook) {
01025
01026     return (false);
01027
01028 } // DTHandler::WSAIoctl()
01029
01030
01031 bool
01032 DTHandler::_WSAIoctl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01033
01034     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01035     DWORD dwIoControlCode = (DWORD)*va_arg(vList, DWORD *);
01036     LPVOID lpvInBuffer = (LPVOID)*va_arg(vList, LPVOID *);
01037     DWORD cbInBuffer = (DWORD)*va_arg(vList, DWORD *);
01038     LPVOID lpvOutBuffer = (LPVOID)*va_arg(vList, LPVOID *);
01039     DWORD cbOutBuffer = (DWORD)*va_arg(vList, DWORD *);
01040     LPDWORD lpcbBytesReturned = (LPDWORD)*va_arg(vList, LPDWORD *);
01041     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
01042     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
01043     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01044
01045     return (handler->WSAIoctl(s, dwIoControlCode, lpvInBuffer, cbInBuffer, lpvOutBuffer, cbOutBuffer,
01046                               lpcbBytesReturned, lpOverlapped, lpCompletionRoutine, (APIHook<int> &)hook));
01047
01048 } // DTHandler::_WSAIoctl()
01049
01050
01051 bool
01052 DTHandler::WSAIsBlocking(APIHook<int> &hook) {
01053
01054     return (false);
01055
01056 } // DTHandler::WSAIsBlocking()
01057
01058
01059 bool
01060 DTHandler::_WSAIsBlocking(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01061
01062     return (handler->WSAIsBlocking((APIHook<int> &)hook));
01063
01064 } // DTHandler::_WSAIsBlocking()
01065
01066
01067 bool
01068 DTHandler::WSAJoinLeaf(SOCKET s, const struct sockaddr *name, int namelen,
01069                        LPWSABUF lpCallerData, LPWSABUF lpCalleeData,
01070                        LPQOS lpSQOS, LPQOS lpGQOS, DWORD dwFlags,
01071                        APIHook<SOCKET> &hook) {
01072
01073     return (false);
01074
01075 } // DTHandler::WSAJoinLeaf()
01076
01077
01078 bool
01079 DTHandler::_WSAJoinLeaf(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01080
01081     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01082     const struct sockaddr *name = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
01083     int namelen = (int)*va_arg(vList, int *);
01084     LPWSABUF lpCallerData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01085     LPWSABUF lpCalleeData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01086     LPQOS lpSQOS = (LPQOS)*va_arg(vList, LPQOS *);
01087     LPQOS lpGQOS = (LPQOS)*va_arg(vList, LPQOS *);
01088     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
01089
01090     return (handler->WSAJoinLeaf(s, name, namelen, lpCallerData, lpCalleeData,
01091                                  lpSQOS, lpGQOS, dwFlags, (APIHook<SOCKET> &)hook));
01092
01093 } // DTHandler::_WSAJoinLeaf()
01094
01095
01096 bool
01097 DTHandler::WSANtohl(SOCKET s, unsigned long netlong, unsigned long *lphostlong, APIHook<int> &hook) {
01098
01099     return (false);
01100
01101 } // DTHandler::WSANtohl()
01102
01103
01104 bool
01105 DTHandler::_WSANtohl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01106
01107     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01108     unsigned long netlong = (unsigned long)*va_arg(vList, unsigned long *);
01109     unsigned long *lphostlong = (unsigned long *)*va_arg(vList, unsigned long **);
01110
01111     return (handler->WSANtohl(s, netlong, lphostlong, (APIHook<int> &)hook));
01112
01113 } // DTHandler::_WSANtohl()
01114
01115
01116 bool
01117 DTHandler::WSANtohs(SOCKET s, unsigned short netshort, unsigned short *lphostshort, APIHook<int> &hook) {
01118
01119     return (false);
01120
01121 } // DTHandler::WSANtohs()
01122
01123
01124 bool
01125 DTHandler::_WSANtohs(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01126
01127     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01128     unsigned short netshort = (unsigned short)*va_arg(vList, unsigned short *);
01129     unsigned short *lphostshort = (unsigned short *)*va_arg(vList, unsigned short **);
01130
01131     return (handler->WSANtohs(s, netshort, lphostshort, (APIHook<int> &)hook));
01132
01133 } // DTHandler::_WSANtohs()
01134
01135
01136 bool
01137 DTHandler::WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
01138                    LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags,
01139                    LPWSAOVERLAPPED lpOverlapped,
01140                    LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
01141                    APIHook<int> &hook) {
01142
01143     return (false);
01144
01145 } // DTHandler::WSARecv()
01146
01147
01148 bool
01149 DTHandler::_WSARecv(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01150
01151     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01152     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01153     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
01154     LPDWORD lpNumberOfBytesRecvd = (LPDWORD)*va_arg(vList, LPDWORD *);
01155     LPDWORD lpFlags = (LPDWORD)*va_arg(vList, LPDWORD *);
01156     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
01157     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
01158     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01159
01160     return (handler->WSARecv(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,
01161                              lpOverlapped, lpCompletionRoutine, (APIHook<int> &)hook));
01162
01163 } // DTHandler::_WSARecv()
01164
01165
01166 bool
01167 DTHandler::WSARecvDisconnect(SOCKET s, LPWSABUF lpInboundDisconnectData, APIHook<int> &hook) {
01168
01169     return (false);
01170
01171 } // DTHandler::WSARecvDisconnect()
01172
01173
01174 bool
01175 DTHandler::_WSARecvDisconnect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01176
01177     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01178     LPWSABUF lpInboundDisconnectData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01179
01180     return (handler->WSARecvDisconnect(s, lpInboundDisconnectData, (APIHook<int> &)hook));
01181
01182 } // DTHandler::_WSARecvDisconnect()
01183
01184
01185 bool
01186 DTHandler::WSARecvFrom(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
01187                        LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags,
01188                        struct sockaddr *lpFrom, LPINT lpFromlen,
01189                        LPWSAOVERLAPPED lpOverlapped,
01190                        LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
01191                        APIHook<int> &hook) {
01192
01193     return (false);
01194
01195 } // DTHandler::WSARecvFrom()
01196
01197
01198 bool
01199 DTHandler::_WSARecvFrom(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01200
01201     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01202     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01203     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
01204     LPDWORD lpNumberOfBytesRecvd = (LPDWORD)*va_arg(vList, LPDWORD *);
01205     LPDWORD lpFlags = (LPDWORD)*va_arg(vList, LPDWORD *);
01206     struct sockaddr *lpFrom = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
01207     LPINT lpFromlen = (LPINT)*va_arg(vList, LPINT *);
01208     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
01209     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
01210     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01211
01212     return (handler->WSARecvFrom(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,
01213                                  lpFrom, lpFromlen, lpOverlapped, lpCompletionRoutine, (APIHook<int> &)hook));
01214
01215 } // DTHandler::_WSARecvFrom()
01216
01217
01218 bool
01219 DTHandler::WSAResetEvent(WSAEVENT hEvent, APIHook<int> &hook) {
01220
01221     return (false);
01222
01223 } // DTHandler::WSAResetEvent()
01224
01225
01226 bool
01227 DTHandler::_WSAResetEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01228
01229     WSAEVENT hEvent = (WSAEVENT)*va_arg(vList, WSAEVENT *);
01230
01231     return (handler->WSAResetEvent(hEvent, (APIHook<int> &)hook));
01232
01233 } // DTHandler::_WSAResetEvent()
01234
01235
01236 bool
01237 DTHandler::WSASend(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent,
01238                    DWORD dwFlags, LPWSAOVERLAPPED lpOverlapped,
01239                    LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
01240                    APIHook<int> &hook) {
01241
01242     return (false);
01243
01244 } // DTHandler::WSASend()
01245
01246
01247 bool
01248 DTHandler::_WSASend(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01249
01250     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01251     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01252     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
01253     LPDWORD lpNumberOfBytesSent = (LPDWORD)*va_arg(vList, LPDWORD *);
01254     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
01255     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
01256     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
01257     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01258
01259     return (handler->WSASend(s, lpBuffers, dwBufferCount, lpNumberOfBytesSent, dwFlags,
01260                              lpOverlapped, lpCompletionRoutine, (APIHook<int> &)hook));
01261
01262 } // DTHandler::_WSASend()
01263
01264
01265 bool
01266 DTHandler::WSASendDisconnect(SOCKET s, LPWSABUF lpOutboundDisconnectData, APIHook<int> &hook) {
01267
01268     return (false);
01269
01270 } // DTHandler::WSASendDisconnect()
01271
01272
01273 bool
01274 DTHandler::_WSASendDisconnect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01275
01276     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01277     LPWSABUF lpOutboundDisconnectData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01278
01279     return (handler->WSASendDisconnect(s, lpOutboundDisconnectData, (APIHook<int> &)hook));
01280
01281 } // DTHandler::_WSASendDisconnect()
01282
01283
01284 bool
01285 DTHandler::WSASendTo(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent,
01286                      DWORD dwFlags, const struct sockaddr *lpTo, int iTolen, LPWSAOVERLAPPED lpOverlapped,
01287                      LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
01288                      APIHook<int> &hook) {
01289
01290     return (false);
01291
01292 } // DTHandler::WSASendTo()
01293
01294
01295 bool
01296 DTHandler::_WSASendTo(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01297
01298     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01299     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01300     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
01301     LPDWORD lpNumberOfBytesSent = (LPDWORD)*va_arg(vList, LPDWORD *);
01302     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
01303     const struct sockaddr *lpTo = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
01304     int iTolen = (int)*va_arg(vList, int *);
01305     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
01306     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
01307     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
01308
01309     return (handler->WSASendTo(s, lpBuffers, dwBufferCount, lpNumberOfBytesSent, dwFlags,
01310                                lpTo, iTolen, lpOverlapped, lpCompletionRoutine, (APIHook<int> &)hook));
01311
01312 } // DTHandler::_WSASendTo()
01313
01314
01315 bool
01316 DTHandler::WSASetBlockingHook(FARPROC lpBlockFunc, APIHook<FARPROC> &hook) {
01317
01318     return (false);
01319
01320 } // DTHandler::WSASetBlockingHook()
01321
01322
01323 bool
01324 DTHandler::_WSASetBlockingHook(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01325
01326     FARPROC lpBlockFunc = (FARPROC)*va_arg(vList, FARPROC *);
01327
01328     return (handler->WSASetBlockingHook(lpBlockFunc, (APIHook<FARPROC> &)hook));
01329
01330 } // DTHandler::_WSASetBlockingHook()
01331
01332
01333 bool
01334 DTHandler::WSASetEvent(WSAEVENT hEvent, APIHook<int> &hook) {
01335
01336     return (false);
01337
01338 } // DTHandler::WSASetEvent()
01339
01340
01341 bool
01342 DTHandler::_WSASetEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01343
01344     WSAEVENT hEvent = (WSAEVENT)*va_arg(vList, WSAEVENT *);
01345
01346     return (handler->WSASetEvent(hEvent, (APIHook<int> &)hook));
01347
01348 } // DTHandler::_WSASetEvent()
01349
01350
01351 bool
01352 DTHandler::WSASetLastError(int iError, APIHook<void> &hook) {
01353
01354     return (false);
01355
01356 } // DTHandler::WSASetLastError()
01357
01358
01359 bool
01360 DTHandler::_WSASetLastError(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01361
01362     int iError = (int)*va_arg(vList, int *);
01363
01364     return (handler->WSASetLastError(iError, hook));
01365
01366 } // DTHandler::_WSASetLastError()
01367
01368
01369 bool
01370 DTHandler::WSASocketA(int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocolInfo,
01371                       GROUP g, DWORD dwFlags, APIHook<SOCKET> &hook) {
01372
01373     return (false);
01374
01375 } // DTHandler::WSASocketA()
01376
01377
01378 bool
01379 DTHandler::_WSASocketA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01380
01381     int af = (int)*va_arg(vList, int *);
01382     int type = (int)*va_arg(vList, int *);
01383     int protocol = (int)*va_arg(vList, int *);
01384     LPWSAPROTOCOL_INFOA lpProtocolInfo = (LPWSAPROTOCOL_INFOA)*va_arg(vList, LPWSAPROTOCOL_INFOA *);
01385     GROUP g = (GROUP)*va_arg(vList, GROUP *);
01386     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
01387
01388     return (handler->WSASocketA(af, type, protocol, lpProtocolInfo, g, dwFlags, (APIHook<SOCKET> &)hook));
01389
01390 } // DTHandler::_WSASocketA()
01391
01392
01393 bool
01394 DTHandler::WSASocketW(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo,
01395                       GROUP g, DWORD dwFlags, APIHook<SOCKET> &hook) {
01396
01397     return (false);
01398
01399 } // DTHandler::WSASocketW()
01400
01401
01402 bool
01403 DTHandler::_WSASocketW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01404
01405     int af = (int)*va_arg(vList, int *);
01406     int type = (int)*va_arg(vList, int *);
01407     int protocol = (int)*va_arg(vList, int *);
01408     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
01409     GROUP g = (GROUP)*va_arg(vList, GROUP *);
01410     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
01411
01412     return (handler->WSASocketW(af, type, protocol, lpProtocolInfo, g, dwFlags, (APIHook<SOCKET> &)hook));
01413
01414 } // DTHandler::_WSASocketW()
01415
01416
01417 bool
01418 DTHandler::WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData, APIHook<int> &hook) {
01419
01420     return (false);
01421
01422 } // DTHandler::WSAStartup()
01423
01424
01425 bool
01426 DTHandler::_WSAStartup(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01427
01428     WORD wVersionRequested = (WORD)*va_arg(vList, LPDWORD);
01429     LPWSADATA lpWSAData = (LPWSADATA)*va_arg(vList, LPWSADATA *);
01430
01431     return (handler->WSAStartup(wVersionRequested, lpWSAData, (APIHook<int> &)hook));
01432
01433 } // DTHandler::_WSAStartup()
01434
01435
01436 bool
01437 DTHandler::WSAUnhookBlockingHook(APIHook<int> &hook) {
01438
01439     return (false);
01440
01441 } // DTHandler::WSAUnhookBlockingHook()
01442
01443
01444 bool
01445 DTHandler::_WSAUnhookBlockingHook(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01446
01447     return (handler->WSAUnhookBlockingHook((APIHook<int> &)hook));
01448
01449 } // DTHandler::_WSAUnhookBlockingHook()
01450
01451
01452 bool
01453 DTHandler::WSAWaitForMultipleEvents(DWORD cEvents, const WSAEVENT *lphEvents,
01454                                     BOOL fWaitAll, DWORD dwTimeout, BOOL fAlertable,
01455                                     APIHook<DWORD> &hook) {
01456
01457     return (false);
01458
01459 } // DTHandler::WSAWaitForMultipleEvents()
01460
01461
01462 bool
01463 DTHandler::_WSAWaitForMultipleEvents(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01464
01465     DWORD cEvents = (DWORD)*va_arg(vList, DWORD *);
01466     const WSAEVENT *lphEvents = (const WSAEVENT *)*va_arg(vList, const WSAEVENT **);
01467     BOOL fWaitAll = (BOOL)*va_arg(vList, BOOL *);
01468     DWORD dwTimeout = (DWORD)*va_arg(vList, DWORD *);
01469     BOOL fAlertable = (BOOL)*va_arg(vList, BOOL *);
01470
01471     return (handler->WSAWaitForMultipleEvents(cEvents, lphEvents, fWaitAll, dwTimeout, fAlertable, (APIHook<DWORD> &)hook));
01472
01473 } // DTHandler::_WSAWaitForMultipleEvents()
01474
01475
01476 bool
01477 DTHandler::gethostbyaddr(const char *addr, int len, int type, APIHook<HOSTENT> &hook) {
01478
01479     return (false);
01480
01481 } // DTHandler::gethostbyaddr()
01482
01483
01484 bool
01485 DTHandler::_gethostbyaddr(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01486
01487     const char *addr = (const char *)*va_arg(vList, const char **);
01488     int len = (int)*va_arg(vList, int *);
01489     int type = (int)*va_arg(vList, int *);
01490
01491     return (handler->gethostbyaddr(addr, len, type, (APIHook<HOSTENT> &)hook));
01492
01493 } // DTHandler::_gethostbyaddr()
01494
01495
01496 bool
01497 DTHandler::gethostbyname(const char *name, APIHook<HOSTENT> &hook) {
01498
01499     return (false);
01500
01501 } // DTHandler::gethostbyname()
01502
01503
01504 bool
01505 DTHandler::_gethostbyname(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01506
01507     const char *name = (const char *)*va_arg(vList, const char **);
01508
01509     return (handler->gethostbyname(name, (APIHook<HOSTENT> &)hook));
01510
01511 } // DTHandler::_gethostbyname()
01512
01513
01514 bool
01515 DTHandler::gethostname(char *name, int namelen, APIHook<int> &hook) {
01516
01517     return (false);
01518
01519 } // DTHandler::gethostname()
01520
01521
01522 bool
01523 DTHandler::_gethostname(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01524
01525     char *name = (char *)*va_arg(vList, char **);
01526     int namelen = (int)*va_arg(vList, int *);
01527
01528     return (handler->gethostname(name, namelen, (APIHook<int> &)hook));
01529
01530 } // DTHandler::_gethostname()
01531
01532
01533 bool
01534 DTHandler::getprotobyname(const char *name, APIHook<PROTOENT> &hook) {
01535
01536     return (false);
01537
01538 } // DTHandler::getprotobyname()
01539
01540
01541 bool
01542 DTHandler::_getprotobyname(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01543
01544     const char *name = (const char *)*va_arg(vList, const char **);
01545
01546     return (handler->getprotobyname(name, (APIHook<PROTOENT> &)hook));
01547
01548 } // DTHandler::_getprotobyname()
01549
01550
01551 bool
01552 DTHandler::getprotobynumber(int number, APIHook<PROTOENT> &hook) {
01553
01554     return (false);
01555
01556 } // DTHandler::getprotobynumber()
01557
01558
01559 bool
01560 DTHandler::_getprotobynumber(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01561
01562     int number = (int)*va_arg(vList, int *);
01563
01564     return (handler->getprotobynumber(number, (APIHook<PROTOENT> &)hook));
01565
01566 } // DTHandler::_getprotobynumber()
01567
01568
01569 bool
01570 DTHandler::getservbyname(const char *name, const char *proto, APIHook<SERVENT> &hook) {
01571
01572     return (false);
01573
01574 } // DTHandler::getservbyname()
01575
01576
01577 bool
01578 DTHandler::_getservbyname(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01579
01580     const char *name = (const char *)*va_arg(vList, const char **);
01581     const char *proto = (const char *)*va_arg(vList, const char **);
01582
01583     return (handler->getservbyname(name, proto, (APIHook<SERVENT> &)hook));
01584
01585 } // DTHandler::_getservbyname()
01586
01587
01588 bool
01589 DTHandler::getservbyport(int port, const char *proto, APIHook<SERVENT> &hook) {
01590
01591     return (false);
01592
01593 } // DTHandler::getservbyport()
01594
01595
01596 bool
01597 DTHandler::_getservbyport(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01598
01599     int port = (int)*va_arg(vList, int *);
01600     const char *proto = (const char *)*va_arg(vList, const char **);
01601
01602     return (handler->getservbyport(port, proto, (APIHook<SERVENT> &)hook));
01603
01604 } // DTHandler::_getservbyport()
01605
01606
01607 bool
01608 DTHandler::inet_addr(const char *cp, APIHook<unsigned long> &hook) {
01609
01610     return (false);
01611
01612 } // DTHandler::inet_addr()
01613
01614
01615 bool
01616 DTHandler::_inet_addr(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01617
01618     const char *cp = (const char *)*va_arg(vList, const char **);
01619
01620     return (handler->inet_addr(cp, (APIHook<unsigned long> &)hook));
01621
01622 } // DTHandler::_inet_addr()
01623
01624
01625 bool
01626 DTHandler::inet_ntoa(struct in_addr in, APIHook<char *> &hook) {
01627
01628     return (false);
01629
01630 } // DTHandler::inet_ntoa()
01631
01632
01633 bool
01634 DTHandler::_inet_ntoa(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01635
01636     struct in_addr in = (struct in_addr)*va_arg(vList, struct in_addr *);
01637
01638     return (handler->inet_ntoa(in, (APIHook<char *> &)hook));
01639
01640 } // DTHandler::_inet_ntoa()
01641
01642
01643 bool
01644 DTHandler::WSAAsyncGetHostByAddr(HWND hWnd, unsigned int wMsg, const char *addr,
01645                                  int len, int type, char *buf, int buflen,
01646                                  APIHook<HANDLE> &hook) {
01647
01648     return (false);
01649
01650 } // DTHandler::WSAAsyncGetHostByAddr()
01651
01652
01653 bool
01654 DTHandler::_WSAAsyncGetHostByAddr(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01655
01656     HWND hWnd = (HWND)*va_arg(vList, HWND *);
01657     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
01658     const char *addr = (const char *)*va_arg(vList, const char **);
01659     int len = (int)*va_arg(vList, int *);
01660     int type = (int)*va_arg(vList, int *);
01661     char *buf = (char *)*va_arg(vList, char **);
01662     int buflen = (int)*va_arg(vList, int *);
01663
01664     return (handler->WSAAsyncGetHostByAddr(hWnd, wMsg, addr, len, type, buf, buflen, (APIHook<HANDLE> &)hook));
01665
01666 } // DTHandler::_WSAAsyncGetHostByAddr()
01667
01668
01669 bool
01670 DTHandler::WSAAsyncGetHostByName(HWND hWnd, unsigned int wMsg, const char *name,
01671                                  char *buf, int buflen, APIHook<HANDLE> &hook) {
01672
01673     return (false);
01674
01675 } // DTHandler::WSAAsyncGetHostByName()
01676
01677
01678 bool
01679 DTHandler::_WSAAsyncGetHostByName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01680
01681     HWND hWnd = (HWND)*va_arg(vList, HWND *);
01682     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
01683     const char *name = (const char *)*va_arg(vList, const char **);
01684     char *buf = (char *)*va_arg(vList, char **);
01685     int buflen = (int)*va_arg(vList, int *);
01686
01687     return (handler->WSAAsyncGetHostByName(hWnd, wMsg, name, buf, buflen, (APIHook<HANDLE> &)hook));
01688
01689 } // DTHandler::_WSAAsyncGetHostByName()
01690
01691
01692 bool
01693 DTHandler::WSAAsyncGetProtoByName(HWND hWnd, unsigned int wMsg, const char *name,
01694                                   char *buf, int buflen, APIHook<HANDLE> &hook) {
01695
01696     return (false);
01697
01698 } // DTHandler::WSAAsyncGetProtoByName()
01699
01700
01701 bool
01702 DTHandler::_WSAAsyncGetProtoByName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01703
01704     HWND hWnd = (HWND)*va_arg(vList, HWND *);
01705     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
01706     const char *name = (const char *)*va_arg(vList, const char **);
01707     char *buf = (char *)*va_arg(vList, char **);
01708     int buflen = (int)*va_arg(vList, int *);
01709
01710     return (handler->WSAAsyncGetProtoByName(hWnd, wMsg, name, buf, buflen, (APIHook<HANDLE> &)hook));
01711
01712 } // DTHandler::_WSAAsyncGetProtoByName()
01713
01714
01715 bool
01716 DTHandler::WSAAsyncGetProtoByNumber(HWND hWnd, unsigned int wMsg, int number, char *buf,
01717                                     int buflen, APIHook<HANDLE> &hook) {
01718
01719     return (false);
01720
01721 } // DTHandler::WSAAsyncGetProtoByNumber()
01722
01723
01724 bool
01725 DTHandler::_WSAAsyncGetProtoByNumber(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01726
01727     HWND hWnd = (HWND)*va_arg(vList, HWND *);
01728     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
01729     int number = (int)*va_arg(vList, int *);
01730     char *buf = (char *)*va_arg(vList, char **);
01731     int buflen = (int)*va_arg(vList, int *);
01732
01733     return (handler->WSAAsyncGetProtoByNumber(hWnd, wMsg, number, buf, buflen, (APIHook<HANDLE> &)hook));
01734
01735 } // DTHandler::_WSAAsyncGetProtoByNumber()
01736
01737
01738 bool
01739 DTHandler::WSAAsyncGetServByName(HWND hWnd, unsigned int wMsg, const char *name,
01740                                  const char *proto, char *buf, int buflen,
01741                                  APIHook<HANDLE> &hook) {
01742
01743     return (false);
01744
01745 } // DTHandler::WSAAsyncGetServByName()
01746
01747
01748 bool
01749 DTHandler::_WSAAsyncGetServByName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01750
01751     HWND hWnd = (HWND)*va_arg(vList, HWND *);
01752     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
01753     const char *name = (const char *)*va_arg(vList, const char **);
01754     const char *proto = (const char *)*va_arg(vList, const char **);
01755     char *buf = (char *)*va_arg(vList, char **);
01756     int buflen = (int)*va_arg(vList, int *);
01757
01758     return (handler->WSAAsyncGetServByName(hWnd, wMsg, name, proto, buf, buflen, (APIHook<HANDLE> &)hook));
01759
01760 } // DTHandler::_WSAAsyncGetServByName()
01761
01762
01763 bool
01764 DTHandler::WSAAsyncGetServByPort(HWND hWnd, unsigned int wMsg, int port,
01765                                  const char *proto, char *buf, int buflen,
01766                                  APIHook<HANDLE> &hook) {
01767
01768     return (false);
01769
01770 } // DTHandler::WSAAsyncGetServByPort()
01771
01772
01773 bool
01774 DTHandler::_WSAAsyncGetServByPort(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01775
01776     HWND hWnd = (HWND)*va_arg(vList, HWND *);
01777     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
01778     int port = (int)*va_arg(vList, int *);
01779     char *proto = (char *)*va_arg(vList, char **);
01780     char *buf = (char *)*va_arg(vList, char **);
01781     int buflen = (int)*va_arg(vList, int *);
01782
01783     return (handler->WSAAsyncGetServByPort(hWnd, wMsg, port, proto, buf, buflen, (APIHook<HANDLE> &)hook));
01784
01785 } // DTHandler::_WSAAsyncGetServByPort()
01786
01787
01788 bool
01789 DTHandler::WSACancelAsyncRequest(HANDLE hAsyncTaskHandle, APIHook<int> &hook) {
01790
01791     return (false);
01792
01793 } // DTHandler::WSACancelAsyncRequest()
01794
01795
01796 bool
01797 DTHandler::_WSACancelAsyncRequest(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01798
01799     HANDLE hAsyncTaskHandle = (HANDLE)*va_arg(vList, HANDLE *);
01800
01801     return (handler->WSACancelAsyncRequest(hAsyncTaskHandle, (APIHook<int> &)hook));
01802
01803 } // DTHandler::_WSACancelAsyncRequest()
01804
01805
01806 bool
01807 DTHandler::WSPAccept(SOCKET s, struct sockaddr *addr, LPINT addrlen,
01808                      LPCONDITIONPROC lpfnCondition, DWORD dwCallbackData,
01809                      LPINT lpErrno, APIHook<SOCKET> &hook) {
01810
01811     return (false);
01812
01813 } // DTHandler::WSPAccept()
01814
01815
01816 bool
01817 DTHandler::_WSPAccept(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01818
01819     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01820     struct sockaddr *addr = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
01821     LPINT addrlen = (LPINT)*va_arg(vList, LPINT *);
01822     LPCONDITIONPROC lpfnCondition = (LPCONDITIONPROC)*va_arg(vList, LPCONDITIONPROC *);
01823     DWORD dwCallbackData = (DWORD)*va_arg(vList, DWORD *);
01824     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01825
01826     return (handler->WSPAccept(s, addr, addrlen, lpfnCondition, dwCallbackData, lpErrno, (APIHook<SOCKET> &)hook));
01827
01828 } // DTHandler::_WSPAccept()
01829
01830
01831 bool
01832 DTHandler::WSPAsyncSelect(SOCKET s, HWND hWnd, unsigned int wMsg,
01833                           long lEvent, LPINT lpErrno, APIHook<int> &hook) {
01834
01835     return (false);
01836
01837 } // DTHandler::WSPAsyncSelect()
01838
01839
01840 bool
01841 DTHandler::_WSPAsyncSelect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01842
01843     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01844     HWND hWnd = (HWND)*va_arg(vList, HWND *);
01845     unsigned int wMsg = (unsigned int)*va_arg(vList, unsigned int *);
01846     long lEvent = (long)*va_arg(vList, long *);
01847     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01848
01849     return (handler->WSPAsyncSelect(s, hWnd, wMsg, lEvent, lpErrno, (APIHook<int> &)hook));
01850
01851 } // DTHandler::_WSPAsyncSelect()
01852
01853
01854 bool
01855 DTHandler::WSPBind(SOCKET s, const struct sockaddr *name, int namelen,
01856                    LPINT lpErrno, APIHook<int> &hook) {
01857
01858     return (false);
01859
01860 } // DTHandler::WSPBind()
01861
01862
01863 bool
01864 DTHandler::_WSPBind(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01865
01866     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01867     const struct sockaddr *name = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
01868     int namelen = (int)*va_arg(vList, int *);
01869     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01870
01871     return (handler->WSPBind(s, name, namelen, lpErrno, (APIHook<int> &)hook));
01872
01873 } // DTHandler::_WSPBind()
01874
01875
01876 bool
01877 DTHandler::WSPCancelBlockingCall(LPINT lpErrno, APIHook<int> &hook) {
01878
01879     return (false);
01880
01881 } // DTHandler::WSPCancelBlockingCall()
01882
01883
01884 bool
01885 DTHandler::_WSPCancelBlockingCall(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01886
01887     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01888
01889     return (handler->WSPCancelBlockingCall(lpErrno, (APIHook<int> &)hook));
01890
01891 } // DTHandler::_WSPCancelBlockingCall()
01892
01893
01894 bool
01895 DTHandler::WSPCleanup(LPINT lpErrno, APIHook<int> &hook) {
01896
01897     return (false);
01898
01899 } // DTHandler::WSPCleanup()
01900
01901
01902 bool
01903 DTHandler::_WSPCleanup(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01904
01905     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01906
01907     return (handler->WSPCleanup(lpErrno, (APIHook<int> &)hook));
01908
01909 } // DTHandler::_WSPCleanup()
01910
01911
01912 bool
01913 DTHandler::WSPCloseSocket(SOCKET s, LPINT lpErrno, APIHook<int> &hook) {
01914
01915     return (false);
01916
01917 } // DTHandler::WSPCloseSocket()
01918
01919
01920 bool
01921 DTHandler::_WSPCloseSocket(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01922
01923     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01924     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01925
01926     return (handler->WSPCloseSocket(s, lpErrno, (APIHook<int> &)hook));
01927
01928 } // DTHandler::_WSPCloseSocket()
01929
01930
01931 bool
01932 DTHandler::WSPConnect(SOCKET s, const struct sockaddr *name, int namelen,
01933                       LPWSABUF lpCallerData, LPWSABUF lpCalleeData,
01934                       LPQOS lpSQOS, LPQOS lpGQOS, LPINT lpErrno,
01935                       APIHook<int> &hook) {
01936
01937     return (false);
01938
01939 } // DTHandler::WSPConnect()
01940
01941
01942 bool
01943 DTHandler::_WSPConnect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01944
01945     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01946     const struct sockaddr *name = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
01947     int namelen = (int)*va_arg(vList, int *);
01948     LPWSABUF lpCallerData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01949     LPWSABUF lpCalleeData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
01950     LPQOS lpSQOS = (LPQOS)*va_arg(vList, LPQOS *);
01951     LPQOS lpGQOS = (LPQOS)*va_arg(vList, LPQOS *);
01952     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01953
01954     return (handler->WSPConnect(s, name, namelen, lpCallerData, lpCalleeData,
01955                            lpSQOS, lpGQOS, lpErrno, (APIHook<int> &)hook));
01956
01957 } // DTHandler::_WSPConnect()
01958
01959
01960 bool
01961 DTHandler::WSPDuplicateSocket(SOCKET s, DWORD dwProcessId,
01962                               LPWSAPROTOCOL_INFOW lpProtocolInfo, LPINT lpErrno,
01963                               APIHook<int> &hook) {
01964
01965     return (false);
01966
01967 } // DTHandler::WSPDuplicateSocket()
01968
01969
01970 bool
01971 DTHandler::_WSPDuplicateSocket(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01972
01973     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01974     DWORD dwProcessId = (DWORD)*va_arg(vList, DWORD *);
01975     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
01976     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
01977
01978     return (handler->WSPDuplicateSocket(s, dwProcessId, lpProtocolInfo, lpErrno, (APIHook<int> &)hook));
01979
01980 } // DTHandler::_WSPDuplicateSocket()
01981
01982
01983 bool
01984 DTHandler::WSPEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject,
01985                                 LPWSANETWORKEVENTS lpNetworkEvents, LPINT lpErrno,
01986                                 APIHook<int> &hook) {
01987
01988     return (false);
01989
01990 } // DTHandler::WSPEnumNetworkEvents()
01991
01992
01993 bool
01994 DTHandler::_WSPEnumNetworkEvents(DTHandler *handler, APIHook<void> &hook, va_list vList) {
01995
01996     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
01997     WSAEVENT hEventObject = (WSAEVENT)*va_arg(vList, WSAEVENT *);
01998     LPWSANETWORKEVENTS lpNetworkEvents = (LPWSANETWORKEVENTS)*va_arg(vList, LPWSANETWORKEVENTS *);
01999     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02000
02001     return (handler->WSPEnumNetworkEvents(s, hEventObject, lpNetworkEvents, lpErrno, (APIHook<int> &)hook));
02002
02003 } // DTHandler::_WSPEnumNetworkEvents()
02004
02005
02006 bool
02007 DTHandler::WSPEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents,
02008                           LPINT lpErrno, APIHook<int> &hook) {
02009
02010     return (false);
02011
02012 } // DTHandler::WSPEventSelect()
02013
02014
02015 bool
02016 DTHandler::_WSPEventSelect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02017
02018     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02019     WSAEVENT hEventObject = (WSAEVENT)*va_arg(vList, WSAEVENT *);
02020     long lNetworkEvents = (long)*va_arg(vList, long *);
02021     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02022
02023     return (handler->WSPEventSelect(s, hEventObject, lNetworkEvents, lpErrno, (APIHook<int> &)hook));
02024
02025 } // DTHandler::_WSPEventSelect()
02026
02027
02028 bool
02029 DTHandler::WSPGetOverlappedResult(SOCKET s, LPWSAOVERLAPPED lpOverlapped,
02030                                   LPDWORD lpcbTransfer, BOOL fWait, LPDWORD lpdwFlags,
02031                                   LPINT lpErrno, APIHook<BOOL> &hook) {
02032
02033     return (false);
02034
02035 } // DTHandler::WSPGetOverlappedResult()
02036
02037
02038 bool
02039 DTHandler::_WSPGetOverlappedResult(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02040
02041     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02042     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
02043     LPDWORD lpcbTransfer = (LPDWORD)*va_arg(vList, LPDWORD *);
02044     BOOL fWait = (BOOL)*va_arg(vList, BOOL *);
02045     LPDWORD lpdwFlags = (LPDWORD)*va_arg(vList, LPDWORD *);
02046     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02047
02048     return (handler->WSPGetOverlappedResult(s, lpOverlapped, lpcbTransfer, fWait,
02049                                             lpdwFlags, lpErrno, (APIHook<BOOL> &)hook));
02050
02051 } // DTHandler::_WSPGetOverlappedResult()
02052
02053
02054 bool
02055 DTHandler::WSPGetPeerName(SOCKET s, struct sockaddr *name, LPINT namelen,
02056                           LPINT lpErrno, APIHook<int> &hook) {
02057
02058     return (false);
02059
02060 } // DTHandler::WSPGetPeerName()
02061
02062
02063 bool
02064 DTHandler::_WSPGetPeerName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02065
02066     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02067     struct sockaddr *name = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
02068     LPINT namelen = (LPINT)*va_arg(vList, LPINT *);
02069     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02070
02071     return (handler->WSPGetPeerName(s, name, namelen, lpErrno, (APIHook<int> &)hook));
02072
02073 } // DTHandler::_WSPGetPeerName()
02074
02075
02076 bool
02077 DTHandler::WSPGetSockName(SOCKET s, struct sockaddr *name, LPINT namelen,
02078                           LPINT lpErrno, APIHook<int> &hook) {
02079
02080     return (false);
02081
02082 } // DTHandler::WSPGetSockName()
02083
02084
02085 bool
02086 DTHandler::_WSPGetSockName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02087
02088     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02089     struct sockaddr *name = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
02090     LPINT namelen = (LPINT)*va_arg(vList, LPINT *);
02091     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02092
02093     return (handler->WSPGetSockName(s, name, namelen, lpErrno, (APIHook<int> &)hook));
02094
02095 } // DTHandler::_WSPGetSockName()
02096
02097
02098 bool
02099 DTHandler::WSPGetSockOpt(SOCKET s, int level, int optname, char *optval,
02100                          LPINT optlen, LPINT lpErrno, APIHook<int> &hook) {
02101
02102     return (false);
02103
02104 } // DTHandler::WSPGetSockOpt()
02105
02106
02107 bool
02108 DTHandler::_WSPGetSockOpt(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02109
02110     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02111     int level = (int)*va_arg(vList, int *);
02112     int optname = (int)*va_arg(vList, int *);
02113     char *optval = (char *)*va_arg(vList, char **);
02114     LPINT optlen = (LPINT)*va_arg(vList, LPINT *);
02115     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02116
02117     return (handler->WSPGetSockOpt(s, level, optname, optval, optlen, lpErrno, (APIHook<int> &)hook));
02118
02119 } // DTHandler::_WSPGetSockOpt()
02120
02121
02122 bool
02123 DTHandler::WSPGetQOSByName(SOCKET s, LPWSABUF lpQOSName, LPQOS lpQOS,
02124                            LPINT lpErrno, APIHook<BOOL> &hook) {
02125
02126     return (false);
02127
02128 } // DTHandler::WSPGetQOSByName()
02129
02130
02131 bool
02132 DTHandler::_WSPGetQOSByName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02133
02134     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02135     LPWSABUF lpQOSName = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02136     LPQOS lpQOS = (LPQOS)*va_arg(vList, LPQOS *);
02137     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02138
02139     return (handler->WSPGetQOSByName(s, lpQOSName, lpQOS, lpErrno, (APIHook<BOOL> &)hook));
02140
02141 } // DTHandler::_WSPGetQOSByName()
02142
02143
02144 bool
02145 DTHandler::WSPIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer,
02146                     DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer,
02147                     LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped,
02148                     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
02149                     LPWSATHREADID lpThreadId, LPINT lpErrno,
02150                     APIHook<int> &hook) {
02151
02152     return (false);
02153
02154 } // DTHandler::WSPIoctl()
02155
02156
02157 bool
02158 DTHandler::_WSPIoctl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02159
02160     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02161     DWORD dwIoControlCode = (DWORD)*va_arg(vList, DWORD *);
02162     LPVOID lpvInBuffer = (LPVOID)*va_arg(vList, LPVOID *);
02163     DWORD cbInBuffer = (DWORD)*va_arg(vList, DWORD *);
02164     LPVOID lpvOutBuffer = (LPVOID)*va_arg(vList, LPVOID *);
02165     DWORD cbOutBuffer = (DWORD)*va_arg(vList, DWORD *);
02166     LPDWORD lpcbBytesReturned = (LPDWORD)*va_arg(vList, LPDWORD *);
02167     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
02168     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
02169     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02170     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
02171     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02172
02173     return (handler->WSPIoctl(s, dwIoControlCode, lpvInBuffer, cbInBuffer, lpvOutBuffer,
02174                               cbOutBuffer, lpcbBytesReturned, lpOverlapped,
02175                               lpCompletionRoutine, lpThreadId, lpErrno, (APIHook<int> &)hook));
02176
02177 } // DTHandler::_WSPIoctl()
02178
02179
02180 bool
02181 DTHandler::WSPJoinLeaf(SOCKET s, const struct sockaddr *name, int namelen,
02182                        LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS,
02183                        LPQOS lpGQOS, DWORD dwFlags, LPINT lpErrno,
02184                        APIHook<SOCKET> &hook) {
02185
02186     return (false);
02187
02188 } // DTHandler::WSPJoinLeaf()
02189
02190
02191 bool
02192 DTHandler::_WSPJoinLeaf(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02193
02194     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02195     const struct sockaddr *name = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
02196     int namelen = (int)*va_arg(vList, int *);
02197     LPWSABUF lpCallerData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02198     LPWSABUF lpCalleeData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02199     LPQOS lpSQOS = (LPQOS)*va_arg(vList, LPQOS *);
02200     LPQOS lpGQOS = (LPQOS)*va_arg(vList, LPQOS *);
02201     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
02202     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02203
02204     return (handler->WSPJoinLeaf(s, name, namelen, lpCallerData, lpCalleeData,
02205                                  lpSQOS, lpGQOS, dwFlags, lpErrno, (APIHook<SOCKET> &)hook));
02206
02207 } // DTHandler::_WSPJoinLeaf()
02208
02209
02210 bool
02211 DTHandler::WSPListen(SOCKET s, int backlog, LPINT lpErrno, APIHook<int> &hook) {
02212
02213     return (false);
02214
02215 } // DTHandler::WSPListen()
02216
02217
02218 bool
02219 DTHandler::_WSPListen(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02220
02221     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02222     int backlog = (int)*va_arg(vList, int *);
02223     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02224
02225     return (handler->WSPListen(s, backlog, lpErrno, (APIHook<int> &)hook));
02226
02227 } // DTHandler::_WSPListen()
02228
02229
02230 bool
02231 DTHandler::WSPRecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
02232                    LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags,
02233                    LPWSAOVERLAPPED lpOverlapped,
02234                    LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
02235                    LPWSATHREADID lpThreadId, LPINT lpErrno,
02236                    APIHook<int> &hook) {
02237
02238     return (false);
02239
02240 } // DTHandler::WSPRecv()
02241
02242
02243 bool
02244 DTHandler::_WSPRecv(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02245
02246     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02247     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02248     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
02249     LPDWORD lpNumberOfBytesRecvd = (LPDWORD)*va_arg(vList, LPDWORD *);
02250     LPDWORD lpFlags = (LPDWORD)*va_arg(vList, LPDWORD *);
02251     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
02252     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
02253     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02254     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
02255     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02256
02257     return (handler->WSPRecv(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,
02258                              lpOverlapped, lpCompletionRoutine, lpThreadId, lpErrno, (APIHook<int> &)hook));
02259
02260 } // DTHandler::_WSPRecv()
02261
02262
02263 bool
02264 DTHandler::WSPRecvDisconnect(SOCKET s, LPWSABUF lpInboundDisconnectData,
02265                              LPINT lpErrno, APIHook<int> &hook) {
02266
02267     return (false);
02268
02269 } // DTHandler::WSPRecvDisconnect()
02270
02271
02272 bool
02273 DTHandler::_WSPRecvDisconnect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02274
02275     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02276     LPWSABUF lpInboundDisconnectData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02277     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02278
02279     return (handler->WSPRecvDisconnect(s, lpInboundDisconnectData, lpErrno, (APIHook<int> &)hook));
02280
02281 } // DTHandler::_WSPRecvDisconnect()
02282
02283
02284 bool
02285 DTHandler::WSPRecvFrom(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
02286                        LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags,
02287                        struct sockaddr *lpFrom, LPINT lpFromlen,
02288                        LPWSAOVERLAPPED lpOverlapped,
02289                        LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
02290                        LPWSATHREADID lpThreadId, LPINT lpErrno,
02291                        APIHook<int> &hook) {
02292
02293     return (false);
02294
02295 } // DTHandler::WSPRecvFrom()
02296
02297
02298 bool
02299 DTHandler::_WSPRecvFrom(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02300
02301     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02302     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02303     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
02304     LPDWORD lpNumberOfBytesRecvd = (LPDWORD)*va_arg(vList, LPDWORD *);
02305     LPDWORD lpFlags = (LPDWORD)*va_arg(vList, LPDWORD *);
02306     struct sockaddr *lpFrom = (struct sockaddr *)*va_arg(vList, struct sockaddr **);
02307     LPINT lpFromlen = (LPINT)*va_arg(vList, LPINT *);
02308     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
02309     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
02310     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02311     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
02312     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02313
02314     return (handler->WSPRecvFrom(s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags,
02315                                  lpFrom, lpFromlen, lpOverlapped, lpCompletionRoutine,
02316                                  lpThreadId, lpErrno, (APIHook<int> &)hook));
02317
02318 } // DTHandler::_WSPRecvFrom()
02319
02320
02321 bool
02322 DTHandler::WSPSelect(int nfds, fd_set *readfds, fd_set *writefds,
02323                      fd_set *exceptfds, const struct timeval *timeout,
02324                      LPINT lpErrno, APIHook<int> &hook) {
02325
02326     return (false);
02327
02328 } // DTHandler::WSPSelect()
02329
02330
02331 bool
02332 DTHandler::_WSPSelect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02333
02334     int nfds = (int)*va_arg(vList, int *);
02335     fd_set *readfds = (fd_set *)*va_arg(vList, fd_set **);
02336     fd_set *writefds = (fd_set *)*va_arg(vList, fd_set **);
02337     fd_set *exceptfds = (fd_set *)*va_arg(vList, fd_set **);
02338     const struct timeval *timeout = (const struct timeval *)*va_arg(vList, const struct timeval **);
02339     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02340
02341     return (handler->WSPSelect(nfds, readfds, writefds, exceptfds, timeout, lpErrno, (APIHook<int> &)hook));
02342
02343 } // DTHandler::_WSPSelect()
02344
02345
02346 bool
02347 DTHandler::WSPSend(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
02348                    LPDWORD lpNumberOfBytesSent, DWORD dwFlags,
02349                    LPWSAOVERLAPPED lpOverlapped,
02350                    LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
02351                    LPWSATHREADID lpThreadId, LPINT lpErrno,
02352                    APIHook<int> &hook) {
02353
02354     return (false);
02355
02356 } // DTHandler::WSPSend()
02357
02358
02359 bool
02360 DTHandler::_WSPSend(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02361
02362     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02363     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02364     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
02365     LPDWORD lpNumberOfBytesSent = (LPDWORD)*va_arg(vList, LPDWORD *);
02366     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
02367     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
02368     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
02369     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02370     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
02371     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02372
02373     return (handler->WSPSend(s, lpBuffers, dwBufferCount, lpNumberOfBytesSent, dwFlags,
02374                              lpOverlapped, lpCompletionRoutine, lpThreadId, lpErrno, (APIHook<int> &)hook));
02375
02376 } // DTHandler::_WSPSend()
02377
02378
02379 bool
02380 DTHandler::WSPSendDisconnect(SOCKET s, LPWSABUF lpOutboundDisconnectData,
02381                              LPINT lpErrno, APIHook<int> &hook) {
02382
02383     return (false);
02384
02385 } // DTHandler::WSPSendDisconnect()
02386
02387
02388 bool
02389 DTHandler::_WSPSendDisconnect(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02390
02391     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02392     LPWSABUF lpOutboundDisconnectData = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02393     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02394
02395     return (handler->WSPSendDisconnect(s, lpOutboundDisconnectData, lpErrno, (APIHook<int> &)hook));
02396
02397 } // DTHandler::_WSPSendDisconnect()
02398
02399
02400 bool
02401 DTHandler::WSPSendTo(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
02402                      LPDWORD lpNumberOfBytesSent, DWORD dwFlags,
02403                      const struct sockaddr *lpTo, int iTolen,
02404                      LPWSAOVERLAPPED lpOverlapped,
02405                      LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
02406                      LPWSATHREADID lpThreadId, LPINT lpErrno,
02407                      APIHook<int> &hook) {
02408
02409     return (false);
02410
02411 } // DTHandler::WSPSendTo()
02412
02413
02414 bool
02415 DTHandler::_WSPSendTo(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02416
02417     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02418     LPWSABUF lpBuffers = (LPWSABUF)*va_arg(vList, LPWSABUF *);
02419     DWORD dwBufferCount = (DWORD)*va_arg(vList, DWORD *);
02420     LPDWORD lpNumberOfBytesSent = (LPDWORD)*va_arg(vList, LPDWORD *);
02421     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
02422     const struct sockaddr *lpTo = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
02423     int iTolen = (int)*va_arg(vList, int *);
02424     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
02425     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine =
02426     (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
02427     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
02428     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02429
02430     return (handler->WSPSendTo(s, lpBuffers, dwBufferCount, lpNumberOfBytesSent, dwFlags,
02431                                lpTo, iTolen, lpOverlapped, lpCompletionRoutine,
02432                                lpThreadId, lpErrno, (APIHook<int> &)hook));
02433
02434 } // DTHandler::_WSPSendTo()
02435
02436
02437 bool
02438 DTHandler::WSPSetSockOpt(SOCKET s, int level, int optname, const char *optval,
02439                          int optlen, LPINT lpErrno, APIHook<int> &hook) {
02440
02441     return (false);
02442
02443 } // DTHandler::WSPSetSockOpt()
02444
02445
02446 bool
02447 DTHandler::_WSPSetSockOpt(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02448
02449     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02450     int level = (int)*va_arg(vList, int *);
02451     int optname = (int)*va_arg(vList, int *);
02452     const char *optval = (const char *)*va_arg(vList, const char **);
02453     int optlen = (int)*va_arg(vList, int *);
02454     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02455
02456     return (handler->WSPSetSockOpt(s, level, optname, optval, optlen, lpErrno, (APIHook<int> &)hook));
02457
02458 } // DTHandler::_WSPSetSockOpt()
02459
02460
02461 bool
02462 DTHandler::WSPShutdown(SOCKET s, int how, LPINT lpErrno, APIHook<int> &hook) {
02463
02464     return (false);
02465
02466 } // DTHandler::WSPShutdown()
02467
02468
02469 bool
02470 DTHandler::_WSPShutdown(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02471
02472     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02473     int how = (int)*va_arg(vList, int *);
02474     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02475
02476     return (handler->WSPShutdown(s, how, lpErrno, (APIHook<int> &)hook));
02477
02478 } // DTHandler::_WSPShutdown()
02479
02480
02481 bool
02482 DTHandler::WSPSocket(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo,
02483                      GROUP g, DWORD dwFlags, LPINT lpErrno, APIHook<SOCKET> &hook) {
02484
02485     return (false);
02486
02487 } // DTHandler::WSPSocket()
02488
02489
02490 bool
02491 DTHandler::_WSPSocket(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02492
02493     int af = (int)*va_arg(vList, int *);
02494     int type = (int)*va_arg(vList, int *);
02495     int protocol = (int)*va_arg(vList, int *);
02496     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
02497     GROUP g = (GROUP)*va_arg(vList, GROUP *);
02498     DWORD dwFlags = (DWORD)*va_arg(vList, DWORD *);
02499     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02500
02501     return (handler->WSPSocket(af, type, protocol, lpProtocolInfo, g, dwFlags, lpErrno, (APIHook<SOCKET> &)hook));
02502
02503 } // DTHandler::_WSPSocket()
02504
02505
02506 bool
02507 DTHandler::WSPStartup(WORD wVersionRequested, LPWSPDATA lpWSPData,
02508                       LPWSAPROTOCOL_INFOW lpProtocolInfo, WSPUPCALLTABLE UpcallTable,
02509                       LPWSPPROC_TABLE lpProcTable, APIHook<int> &hook) {
02510
02511     return (false);
02512
02513 } // DTHandler::WSPStartup()
02514
02515
02516 bool
02517 DTHandler::_WSPStartup(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02518
02519     WORD wVersionRequested = (WORD)*va_arg(vList, WORD *);
02520     LPWSPDATA lpWSPData = (LPWSPDATA)*va_arg(vList, LPWSPDATA *);
02521     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
02522     WSPUPCALLTABLE UpcallTable = (WSPUPCALLTABLE)*va_arg(vList, WSPUPCALLTABLE *);
02523     LPWSPPROC_TABLE lpProcTable = (LPWSPPROC_TABLE)*va_arg(vList, LPWSPPROC_TABLE *);
02524
02525     return (handler->WSPStartup(wVersionRequested, lpWSPData, lpProtocolInfo,
02526                                 UpcallTable, lpProcTable, (APIHook<int> &)hook));
02527
02528 } // DTHandler::_WSPStartup()
02529
02530
02531 bool
02532 DTHandler::WPUCloseEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook<BOOL> &hook) {
02533
02534     return (false);
02535
02536 } // DTHandler::WPUCloseEvent()
02537
02538
02539 bool
02540 DTHandler::_WPUCloseEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02541
02542     WSAEVENT hEvent = (WSAEVENT)*va_arg(vList, WSAEVENT *);
02543     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02544
02545     return (handler->WPUCloseEvent(hEvent, lpErrno, (APIHook<BOOL> &)hook));
02546
02547 } // DTHandler::_WPUCloseEvent()
02548
02549
02550 bool
02551 DTHandler::WPUCloseSocketHandle(SOCKET s, LPINT lpErrno, APIHook<int> &hook) {
02552
02553     return (false);
02554
02555 } // DTHandler::WPUCloseSocketHandle()
02556
02557
02558 bool
02559 DTHandler::_WPUCloseSocketHandle(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02560
02561     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02562     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02563
02564     return (handler->WPUCloseSocketHandle(s, lpErrno, (APIHook<int> &)hook));
02565
02566 } // DTHandler::_WPUCloseSocketHandle()
02567
02568
02569 bool
02570 DTHandler::WPUCreateEvent(LPINT lpErrno, APIHook<WSAEVENT> &hook) {
02571
02572     return (false);
02573
02574 } // DTHandler::WPUCreateEvent()
02575
02576
02577 bool
02578 DTHandler::_WPUCreateEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02579
02580     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02581
02582     return (handler->WPUCreateEvent(lpErrno, (APIHook<WSAEVENT> &)hook));
02583
02584 } // DTHandler::_WPUCreateEvent()
02585
02586
02587 bool
02588 DTHandler::WPUCreateSocketHandle(DWORD dwCatalogEntryId, DWORD dwContext,
02589                                  LPINT lpErrno, APIHook<SOCKET> &hook) {
02590
02591     return (false);
02592
02593 } // DTHandler::WPUCreateSocketHandle()
02594
02595
02596 bool
02597 DTHandler::_WPUCreateSocketHandle(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02598
02599     DWORD dwCatalogEntryId = (DWORD)*va_arg(vList, DWORD *);
02600     DWORD dwContext = (DWORD)*va_arg(vList, DWORD *);
02601     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02602
02603     return (handler->WPUCreateSocketHandle(dwCatalogEntryId, dwContext, lpErrno, (APIHook<SOCKET> &)hook));
02604
02605 } // DTHandler::_WPUCreateSocketHandle()
02606
02607
02608 bool
02609 DTHandler::WSCDeinstallProvider(LPGUID lpProviderId, LPINT lpErrno, APIHook<int> &hook) {
02610
02611     return (false);
02612
02613 } // DTHandler::WSCDeinstallProvider()
02614
02615
02616 bool
02617 DTHandler::_WSCDeinstallProvider(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02618
02619     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
02620     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02621
02622     return (handler->WSCDeinstallProvider(lpProviderId, lpErrno, (APIHook<int> &)hook));
02623
02624 } // DTHandler::_WSCDeinstallProvider()
02625
02626
02627 bool
02628 DTHandler::WSCInstallProvider(const LPGUID lpProviderId, const LPWSTR lpszProviderDllPath,
02629                               const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
02630                               DWORD dwNumberOfEntries, LPINT lpErrno, APIHook<int> &hook) {
02631
02632     return (false);
02633
02634 } // DTHandler::WSCInstallProvider()
02635
02636
02637 bool
02638 DTHandler::_WSCInstallProvider(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02639
02640     const LPGUID lpProviderId = (const LPGUID)*va_arg(vList, const LPGUID *);
02641     const LPWSTR lpszProviderDllPath = (const LPWSTR)*va_arg(vList, const LPWSTR *);
02642     const LPWSAPROTOCOL_INFOW lpProtocolInfoList = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
02643     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
02644     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02645
02646     return (handler->WSCInstallProvider(lpProviderId, lpszProviderDllPath, lpProtocolInfoList,
02647                                         dwNumberOfEntries, lpErrno, (APIHook<int> &)hook));
02648
02649 } // DTHandler::_WSCInstallProvider()
02650
02651
02652 bool
02653 DTHandler::WPUModifyIFSHandle(DWORD dwCatalogEntryId, SOCKET ProposedHandle,
02654                               LPINT lpErrno, APIHook<SOCKET> &hook) {
02655
02656     return (false);
02657
02658 } // DTHandler::WPUModifyIFSHandle()
02659
02660
02661 bool
02662 DTHandler::_WPUModifyIFSHandle(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02663
02664     DWORD dwCatalogEntryId = (DWORD)*va_arg(vList, DWORD *);
02665     SOCKET ProposedHandle = (SOCKET)*va_arg(vList, SOCKET *);
02666     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02667
02668     return (handler->WPUModifyIFSHandle(dwCatalogEntryId, ProposedHandle, lpErrno, (APIHook<SOCKET> &)hook));
02669
02670 } // DTHandler::_WPUModifyIFSHandle()
02671
02672
02673 bool
02674 DTHandler::WPUQueryBlockingCallback(DWORD dwCatalogEntryId,
02675                                     LPBLOCKINGCALLBACK *lplpfnCallback,
02676                                     LPDWORD lpdwContext, LPINT lpErrno,
02677                                     APIHook<int> &hook) {
02678
02679     return (false);
02680
02681 } // DTHandler::WPUQueryBlockingCallback()
02682
02683
02684 bool
02685 DTHandler::_WPUQueryBlockingCallback(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02686
02687     DWORD dwCatalogEntryId = (DWORD)*va_arg(vList, DWORD *);
02688     LPBLOCKINGCALLBACK *lplpfnCallback = (LPBLOCKINGCALLBACK *)*va_arg(vList, LPBLOCKINGCALLBACK **);
02689     LPDWORD lpdwContext = (LPDWORD)*va_arg(vList, LPDWORD *);
02690     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02691
02692     return (handler->WPUQueryBlockingCallback(dwCatalogEntryId, lplpfnCallback, lpdwContext, lpErrno, (APIHook<int> &)hook));
02693
02694 } // DTHandler::_WPUQueryBlockingCallback()
02695
02696
02697 bool
02698 DTHandler::WPUQuerySocketHandleContext(SOCKET s, LPDWORD lpContext,
02699                                        LPINT lpErrno, APIHook<int> &hook) {
02700
02701     return (false);
02702
02703 } // DTHandler::WPUQuerySocketHandleContext()
02704
02705
02706 bool
02707 DTHandler::_WPUQuerySocketHandleContext(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02708
02709     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02710     LPDWORD lpContext = (LPDWORD)*va_arg(vList, LPDWORD *);
02711     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02712
02713     return (handler->WPUQuerySocketHandleContext(s, lpContext, lpErrno, (APIHook<int> &)hook));
02714
02715 } // DTHandler::_WPUQuerySocketHandleContext()
02716
02717
02718 bool
02719 DTHandler::WPUQueueApc(LPWSATHREADID lpThreadId, LPWSAUSERAPC lpfnUserApc,
02720                        DWORD dwContext, LPINT lpErrno, APIHook<int> &hook) {
02721
02722     return (false);
02723
02724 } // DTHandler::WPUQueueApc()
02725
02726
02727 bool
02728 DTHandler::_WPUQueueApc(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02729
02730     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
02731     LPWSAUSERAPC lpfnUserApc = (LPWSAUSERAPC)*va_arg(vList, LPWSAUSERAPC *);
02732     DWORD dwContext = (DWORD)*va_arg(vList, DWORD *);
02733     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02734
02735     return (handler->WPUQueueApc(lpThreadId, lpfnUserApc, dwContext, lpErrno, (APIHook<int> &)hook));
02736
02737 } // DTHandler::_WPUQueueApc()
02738
02739
02740 bool
02741 DTHandler::WPUResetEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook<BOOL> &hook) {
02742
02743     return (false);
02744
02745 } // DTHandler::WPUResetEvent()
02746
02747
02748 bool
02749 DTHandler::_WPUResetEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02750
02751     WSAEVENT hEvent = (WSAEVENT)*va_arg(vList, WSAEVENT *);
02752     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02753
02754     return (handler->WPUResetEvent(hEvent, lpErrno, (APIHook<BOOL> &)hook));
02755
02756 } // DTHandler::_WPUResetEvent()
02757
02758
02759 bool
02760 DTHandler::WPUSetEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook<BOOL> &hook) {
02761
02762     return (false);
02763
02764 } // DTHandler::WPUSetEvent()
02765
02766
02767 bool
02768 DTHandler::_WPUSetEvent(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02769
02770     WSAEVENT hEvent = (WSAEVENT)*va_arg(vList, WSAEVENT *);
02771     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02772
02773     return (handler->WPUSetEvent(hEvent, lpErrno, (APIHook<BOOL> &)hook));
02774
02775 } // DTHandler::_WPUSetEvent()
02776
02777
02778 bool
02779 DTHandler::WPUFDIsSet(SOCKET s, FD_SET *set, APIHook<int> &hook) {
02780
02781     return (false);
02782
02783 } // DTHandler::WPUFDIsSet()
02784
02785
02786 bool
02787 DTHandler::_WPUFDIsSet(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02788
02789     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02790     FD_SET *set = (FD_SET *)*va_arg(vList, FD_SET **);
02791
02792     return (handler->WPUFDIsSet(s, set, (APIHook<int> &)hook));
02793
02794 } // DTHandler::_WPUFDIsSet()
02795
02796
02797 bool
02798 DTHandler::WPUGetProviderPath(LPGUID lpProviderId, LPWSTR lpszProviderDllPath,
02799                               LPINT lpProviderDllPathLen, LPINT lpErrno,
02800                               APIHook<int> &hook) {
02801
02802     return (false);
02803
02804 } // DTHandler::WPUGetProviderPath()
02805
02806
02807 bool
02808 DTHandler::_WPUGetProviderPath(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02809
02810     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
02811     LPWSTR lpszProviderDllPath = (LPWSTR)*va_arg(vList, LPWSTR *);
02812     LPINT lpProviderDllPathLen = (LPINT)*va_arg(vList, LPINT *);
02813     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02814
02815     return (handler->WPUGetProviderPath(lpProviderId, lpszProviderDllPath, lpProviderDllPathLen,
02816                                         lpErrno, (APIHook<int> &)hook));
02817
02818 } // DTHandler::_WPUGetProviderPath()
02819
02820
02821 bool
02822 DTHandler::WPUPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, APIHook<BOOL> &hook) {
02823
02824     return (false);
02825
02826 } // DTHandler::WPUPostMessage()
02827
02828
02829 bool
02830 DTHandler::_WPUPostMessage(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02831
02832     HWND hWnd = (HWND)*va_arg(vList, HWND *);
02833     UINT Msg = (UINT)*va_arg(vList, UINT *);
02834     WPARAM wParam = (WPARAM)*va_arg(vList, WPARAM *);
02835     LPARAM lParam = (LPARAM)*va_arg(vList, LPARAM *);
02836
02837     return (handler->WPUPostMessage(hWnd, Msg, wParam, lParam, (APIHook<BOOL> &)hook));
02838
02839 } // DTHandler::_WPUPostMessage()
02840
02841
02842 bool
02843 DTHandler::__WSAFDIsSet(SOCKET s, FD_SET *set, APIHook<int> &hook) {
02844
02845     return (false);
02846
02847 } // DTHandler::__WSAFDIsSet()
02848
02849
02850 bool
02851 DTHandler::___WSAFDIsSet(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02852
02853     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
02854     FD_SET *set = (FD_SET *)*va_arg(vList, FD_SET **);
02855
02856     return (handler->WPUFDIsSet(s, set, (APIHook<int> &)hook));
02857
02858 } // DTHandler::___WSAFDIsSet()
02859
02860
02861 bool
02862 DTHandler::WSCEnumProtocols(LPINT lpiProtocols, LPWSAPROTOCOL_INFOW lpProtocolBuffer,
02863                             LPDWORD lpdwBufferLength, LPINT lpErrno, APIHook<int> &hook) {
02864
02865     return (false);
02866
02867 } // DTHandler::WSCEnumProtocols()
02868
02869
02870 bool
02871 DTHandler::_WSCEnumProtocols(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02872
02873     LPINT lpiProtocols = (LPINT)*va_arg(vList, LPINT *);
02874     LPWSAPROTOCOL_INFOW lpProtocolBuffer = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
02875     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
02876     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
02877
02878     return (handler->WSCEnumProtocols(lpiProtocols, lpProtocolBuffer, lpdwBufferLength,
02879                                       lpErrno, (APIHook<int> &)hook));
02880
02881 } // DTHandler::_WSCEnumProtocols()
02882
02883
02884 bool
02885 DTHandler::WSAAddressToStringA(LPSOCKADDR lpsaAddress, DWORD dwAddressLength,
02886                                LPWSAPROTOCOL_INFOA lpProtocolInfo, OUT LPTSTR lpszAddressString,
02887                                IN OUT LPDWORD lpdwAddressStringLength, APIHook<INT> &hook) {
02888
02889     return (false);
02890
02891 } // DTHandler::WSAAddressToStringA()
02892
02893
02894 bool
02895 DTHandler::_WSAAddressToStringA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02896
02897     LPSOCKADDR lpsaAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
02898     DWORD dwAddressLength = (DWORD)*va_arg(vList, DWORD *);
02899     LPWSAPROTOCOL_INFOA lpProtocolInfo = (LPWSAPROTOCOL_INFOA)*va_arg(vList, LPWSAPROTOCOL_INFOA *);
02900     LPTSTR lpszAddressString = (LPTSTR)*va_arg(vList, LPTSTR *);
02901     LPDWORD lpdwAddressStringLength = (LPDWORD)*va_arg(vList, LPDWORD *);
02902
02903     return (handler->WSAAddressToStringA(lpsaAddress, dwAddressLength, lpProtocolInfo,
02904                                          lpszAddressString, lpdwAddressStringLength, (APIHook<INT> &)hook));
02905
02906 } // DTHandler::_WSAAddressToStringA()
02907
02908
02909 bool
02910 DTHandler::WSAAddressToStringW(LPSOCKADDR lpsaAddress, DWORD dwAddressLength,
02911                                LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPTSTR lpszAddressString,
02912                                IN OUT LPDWORD lpdwAddressStringLength, APIHook<INT> &hook) {
02913
02914     return (false);
02915
02916 } // DTHandler::WSAAddressToStringW()
02917
02918
02919 bool
02920 DTHandler::_WSAAddressToStringW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02921
02922     LPSOCKADDR lpsaAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
02923     DWORD dwAddressLength = (DWORD)*va_arg(vList, DWORD *);
02924     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
02925     LPTSTR lpszAddressString = (LPTSTR)*va_arg(vList, LPTSTR *);
02926     LPDWORD lpdwAddressStringLength = (LPDWORD)*va_arg(vList, LPDWORD *);
02927
02928     return (handler->WSAAddressToStringW(lpsaAddress, dwAddressLength, lpProtocolInfo,
02929                                          lpszAddressString, lpdwAddressStringLength, (APIHook<INT> &)hook));
02930
02931 } // DTHandler::_WSAAddressToStringW()
02932
02933
02934 bool
02935 DTHandler::WSAStringToAddressA(LPTSTR AddressString, INT AddressFamily,
02936                                LPWSAPROTOCOL_INFOA lpProtocolInfo, LPSOCKADDR lpAddress,
02937                                LPINT lpAddressLength, APIHook<INT> &hook) {
02938
02939     return (false);
02940
02941 } // DTHandler::WSAStringToAddressA()
02942
02943
02944 bool
02945 DTHandler::_WSAStringToAddressA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02946
02947     LPTSTR AddressString = (LPTSTR)*va_arg(vList, LPTSTR *);
02948     INT AddressFamily = (INT)*va_arg(vList, INT *);
02949     LPWSAPROTOCOL_INFOA lpProtocolInfo = (LPWSAPROTOCOL_INFOA)*va_arg(vList, LPWSAPROTOCOL_INFOA *);
02950     LPSOCKADDR lpAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
02951     LPINT lpAddressLength = (LPINT)*va_arg(vList, LPINT *);
02952
02953     return (handler->WSAStringToAddressA(AddressString, AddressFamily, lpProtocolInfo,
02954                                          lpAddress, lpAddressLength, (APIHook<INT> &)hook));
02955
02956 } // DTHandler::_WSAStringToAddressA()
02957
02958
02959 bool
02960 DTHandler::WSAStringToAddressW(LPTSTR AddressString, INT AddressFamily,
02961                            LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress,
02962                            LPINT lpAddressLength, APIHook<INT> &hook) {
02963
02964     return (false);
02965
02966 } // DTHandler::WSAStringToAddressW()
02967
02968
02969 bool
02970 DTHandler::_WSAStringToAddressW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02971
02972     LPTSTR AddressString = (LPTSTR)*va_arg(vList, LPTSTR *);
02973     INT AddressFamily = (INT)*va_arg(vList, INT *);
02974     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
02975     LPSOCKADDR lpAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
02976     LPINT lpAddressLength = (LPINT)*va_arg(vList, LPINT *);
02977
02978     return (handler->WSAStringToAddressW(AddressString, AddressFamily, lpProtocolInfo,
02979                                          lpAddress, lpAddressLength, (APIHook<INT> &)hook));
02980
02981 } // DTHandler::_WSAStringToAddressW()
02982
02983
02984 bool
02985 DTHandler::WSALookupServiceBeginA(LPWSAQUERYSETA lpqsRestrictions, DWORD dwControlFlags,
02986                                   LPHANDLE lphLookup, APIHook<INT> &hook) {
02987
02988     return (false);
02989
02990 } // DTHandler::WSALookupServiceBeginA()
02991
02992
02993 bool
02994 DTHandler::_WSALookupServiceBeginA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
02995
02996     LPWSAQUERYSETA lpqsRestrictions = (LPWSAQUERYSETA)*va_arg(vList, LPWSAQUERYSETA *);
02997     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
02998     LPHANDLE lphLookup = (LPHANDLE)*va_arg(vList, LPHANDLE *);
02999
03000     return (handler->WSALookupServiceBeginA(lpqsRestrictions, dwControlFlags, lphLookup, (APIHook<INT> &)hook));
03001
03002 } // DTHandler::_WSALookupServiceBeginA()
03003
03004
03005 bool
03006 DTHandler::WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions, DWORD dwControlFlags,
03007                                   LPHANDLE lphLookup, APIHook<INT> &hook) {
03008
03009     return (false);
03010
03011 } // DTHandler::WSALookupServiceBeginW()
03012
03013
03014 bool
03015 DTHandler::_WSALookupServiceBeginW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03016
03017     LPWSAQUERYSETW lpqsRestrictions = (LPWSAQUERYSETW)*va_arg(vList, LPWSAQUERYSETW *);
03018     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03019     LPHANDLE lphLookup = (LPHANDLE)*va_arg(vList, LPHANDLE *);
03020
03021     return (handler->WSALookupServiceBeginW(lpqsRestrictions, dwControlFlags, lphLookup, (APIHook<INT> &)hook));
03022
03023 } // DTHandler::_WSALookupServiceBeginW()
03024
03025
03026 bool
03027 DTHandler::WSALookupServiceNextA(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength,
03028                                  LPWSAQUERYSETA lpqsResults, APIHook<INT> &hook) {
03029
03030     return (false);
03031
03032 } // DTHandler::WSALookupServiceNextA()
03033
03034
03035 bool
03036 DTHandler::_WSALookupServiceNextA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03037
03038     HANDLE hLookup = (HANDLE)*va_arg(vList, HANDLE *);
03039     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03040     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03041     LPWSAQUERYSETA lpqsResults = (LPWSAQUERYSETA)*va_arg(vList, LPWSAQUERYSETA *);
03042
03043     return (handler->WSALookupServiceNextA(hLookup, dwControlFlags, lpdwBufferLength,
03044                                            lpqsResults, (APIHook<INT> &)hook));
03045
03046 } // DTHandler::_WSALookupServiceNextA()
03047
03048
03049 bool
03050 DTHandler::WSALookupServiceNextW(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength,
03051                                  LPWSAQUERYSETW lpqsResults, APIHook<INT> &hook) {
03052
03053     return (false);
03054
03055 } // DTHandler::WSALookupServiceNextW()
03056
03057
03058 bool
03059 DTHandler::_WSALookupServiceNextW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03060
03061     HANDLE hLookup = (HANDLE)*va_arg(vList, HANDLE *);
03062     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03063     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03064     LPWSAQUERYSETW lpqsResults = (LPWSAQUERYSETW)*va_arg(vList, LPWSAQUERYSETW *);
03065
03066     return (handler->WSALookupServiceNextW(hLookup, dwControlFlags, lpdwBufferLength,
03067                                            lpqsResults, (APIHook<INT> &)hook));
03068
03069 } // DTHandler::_WSALookupServiceNextW()
03070
03071
03072 bool
03073 DTHandler::WSALookupServiceEnd(HANDLE hLookup, APIHook<INT> &hook) {
03074
03075     return (false);
03076
03077 } // DTHandler::WSALookupServiceEnd()
03078
03079
03080 bool
03081 DTHandler::_WSALookupServiceEnd(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03082
03083     HANDLE hLookup = (HANDLE)*va_arg(vList, HANDLE *);
03084
03085     return (handler->WSALookupServiceEnd(hLookup, (APIHook<INT> &)hook));
03086
03087 } // DTHandler::_WSALookupServiceEnd()
03088
03089
03090 bool
03091 DTHandler::WSAInstallServiceClassA(LPWSASERVICECLASSINFOA lpServiceClassInfo, APIHook<INT> &hook) {
03092
03093     return (false);
03094
03095 } // DTHandler::WSAInstallServiceClassA()
03096
03097
03098 bool
03099 DTHandler::_WSAInstallServiceClassA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03100
03101     LPWSASERVICECLASSINFOA lpServiceClassInfo = (LPWSASERVICECLASSINFOA)*va_arg(vList, LPWSASERVICECLASSINFOA *);
03102
03103     return (handler->WSAInstallServiceClassA(lpServiceClassInfo, (APIHook<INT> &)hook));
03104
03105 } // DTHandler::_WSAInstallServiceClassA()
03106
03107
03108 bool
03109 DTHandler::WSAInstallServiceClassW(LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook<INT> &hook) {
03110
03111     return (false);
03112
03113 } // DTHandler::WSAInstallServiceClassW()
03114
03115
03116 bool
03117 DTHandler::_WSAInstallServiceClassW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03118
03119     LPWSASERVICECLASSINFOW lpServiceClassInfo = (LPWSASERVICECLASSINFOW)*va_arg(vList, LPWSASERVICECLASSINFOW *);
03120
03121     return (handler->WSAInstallServiceClassW(lpServiceClassInfo, (APIHook<INT> &)hook));
03122
03123 } // DTHandler::_WSAInstallServiceClassW()
03124
03125
03126 bool
03127 DTHandler::WSASetServiceA(LPWSAQUERYSETA lpqsRegInfo, WSAESETSERVICEOP essOperation,
03128                           DWORD dwControlFlags, APIHook<INT> &hook) {
03129
03130     return (false);
03131
03132 } // DTHandler::WSASetServiceA()
03133
03134
03135 bool
03136 DTHandler::_WSASetServiceA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03137
03138     LPWSAQUERYSETA lpqsRegInfo = (LPWSAQUERYSETA)*va_arg(vList, LPWSAQUERYSETA *);
03139     WSAESETSERVICEOP essOperation = (WSAESETSERVICEOP)*va_arg(vList, LPWSAESETSERVICEOP);
03140     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03141
03142     return (handler->WSASetServiceA(lpqsRegInfo, essOperation, dwControlFlags, (APIHook<INT> &)hook));
03143
03144 } // DTHandler::_WSASetServiceA()
03145
03146
03147 bool
03148 DTHandler::WSASetServiceW(LPWSAQUERYSETW lpqsRegInfo, WSAESETSERVICEOP essOperation,
03149                           DWORD dwControlFlags, APIHook<INT> &hook) {
03150
03151     return (false);
03152
03153 } // DTHandler::WSASetServiceW()
03154
03155
03156 bool
03157 DTHandler::_WSASetServiceW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03158
03159     LPWSAQUERYSETW lpqsRegInfo = (LPWSAQUERYSETW)*va_arg(vList, LPWSAQUERYSETW *);
03160     WSAESETSERVICEOP essOperation = (WSAESETSERVICEOP)*va_arg(vList, LPWSAESETSERVICEOP);
03161     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03162
03163     return (handler->WSASetServiceW(lpqsRegInfo, essOperation, dwControlFlags, (APIHook<INT> &)hook));
03164
03165 } // DTHandler::_WSASetServiceW()
03166
03167
03168 bool
03169 DTHandler::WSARemoveServiceClass(LPGUID lpServiceClassId, APIHook<INT> &hook) {
03170
03171     return (false);
03172
03173 } // DTHandler::WSARemoveServiceClass()
03174
03175
03176 bool
03177 DTHandler::_WSARemoveServiceClass(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03178
03179     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03180
03181     return (handler->WSARemoveServiceClass(lpServiceClassId, (APIHook<INT> &)hook));
03182
03183 } // DTHandler::_WSARemoveServiceClass()
03184
03185
03186 bool
03187 DTHandler::WSAGetServiceClassInfoA(LPGUID lpProviderId, LPGUID lpServiceClassId,
03188                                    LPDWORD lpdwBufferLength, LPWSASERVICECLASSINFOA lpServiceClassInfo,
03189                                    APIHook<INT> &hook) {
03190
03191     return (false);
03192
03193 } // DTHandler::WSAGetServiceClassInfoA()
03194
03195
03196 bool
03197 DTHandler::_WSAGetServiceClassInfoA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03198
03199     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03200     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03201     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03202     LPWSASERVICECLASSINFOA lpServiceClassInfo = (LPWSASERVICECLASSINFOA)*va_arg(vList, LPWSASERVICECLASSINFOA *);
03203
03204     return (handler->WSAGetServiceClassInfoA(lpProviderId, lpServiceClassId, lpdwBufferLength,
03205                                              lpServiceClassInfo, (APIHook<INT> &)hook));
03206
03207 } // DTHandler::_WSAGetServiceClassInfoA()
03208
03209
03210 bool
03211 DTHandler::WSAGetServiceClassInfoW(LPGUID lpProviderId, LPGUID lpServiceClassId,
03212                                    LPDWORD lpdwBufferLength, LPWSASERVICECLASSINFOW lpServiceClassInfo,
03213                                    APIHook<INT> &hook) {
03214
03215     return (false);
03216
03217 } // DTHandler::WSAGetServiceClassInfoW()
03218
03219
03220 bool
03221 DTHandler::_WSAGetServiceClassInfoW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03222
03223     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03224     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03225     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03226     LPWSASERVICECLASSINFOW lpServiceClassInfo = (LPWSASERVICECLASSINFOW)*va_arg(vList, LPWSASERVICECLASSINFOW *);
03227
03228     return (handler->WSAGetServiceClassInfoW(lpProviderId, lpServiceClassId, lpdwBufferLength,
03229                                              lpServiceClassInfo, (APIHook<INT> &)hook));
03230
03231 } // DTHandler::_WSAGetServiceClassInfoW()
03232
03233
03234 bool
03235 DTHandler::WSAEnumNameSpaceProvidersA(IN OUT LPDWORD lpdwBufferLength,
03236                                       OUT LPWSANAMESPACE_INFOA lpnspBuffer,
03237                                       APIHook<INT> &hook) {
03238
03239     return (false);
03240
03241 } // DTHandler::WSAEnumNameSpaceProvidersA()
03242
03243
03244 bool
03245 DTHandler::_WSAEnumNameSpaceProvidersA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03246
03247     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03248     LPWSANAMESPACE_INFOA lpnspBuffer = (LPWSANAMESPACE_INFOA)*va_arg(vList, LPWSANAMESPACE_INFOA *);
03249
03250     return (handler->WSAEnumNameSpaceProvidersA(lpdwBufferLength, lpnspBuffer, (APIHook<INT> &)hook));
03251
03252 } // DTHandler::_WSAEnumNameSpaceProvidersA()
03253
03254
03255 bool
03256 DTHandler::WSAEnumNameSpaceProvidersW(IN OUT LPDWORD lpdwBufferLength,
03257                                       OUT LPWSANAMESPACE_INFOW lpnspBuffer,
03258                                       APIHook<INT> &hook) {
03259
03260     return (false);
03261
03262 } // DTHandler::WSAEnumNameSpaceProvidersW()
03263
03264
03265 bool
03266 DTHandler::_WSAEnumNameSpaceProvidersW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03267
03268     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03269     LPWSANAMESPACE_INFOW lpnspBuffer = (LPWSANAMESPACE_INFOW)*va_arg(vList, LPWSANAMESPACE_INFOW *);
03270
03271     return (handler->WSAEnumNameSpaceProvidersW(lpdwBufferLength, lpnspBuffer, (APIHook<INT> &)hook));
03272
03273 } // DTHandler::_WSAEnumNameSpaceProvidersW()
03274
03275
03276 bool
03277 DTHandler::WSAGetServiceClassNameByClassIdA(LPGUID lpServiceClassId, LPSTR lpszServiceClassName,
03278                                             LPDWORD lpdwBufferLength, APIHook<int> &hook) {
03279
03280     return (false);
03281
03282 } // DTHandler::WSAGetServiceClassNameByClassIdA()
03283
03284
03285 bool
03286 DTHandler::_WSAGetServiceClassNameByClassIdA(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03287
03288     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03289     LPSTR lpszServiceClassName = (LPSTR)*va_arg(vList, LPSTR *);
03290     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03291
03292     return (handler->WSAGetServiceClassNameByClassIdA(lpServiceClassId, lpszServiceClassName,
03293                                                       lpdwBufferLength, (APIHook<int> &)hook));
03294
03295 } // DTHandler::_WSAGetServiceClassNameByClassIdA()
03296
03297
03298 bool
03299 DTHandler::WSAGetServiceClassNameByClassIdW(LPGUID lpServiceClassId, LPWSTR lpszServiceClassName,
03300                                             LPDWORD lpdwBufferLength, APIHook<int> &hook) {
03301
03302     return (false);
03303
03304 } // DTHandler::WSAGetServiceClassNameByClassIdW()
03305
03306
03307 bool
03308 DTHandler::_WSAGetServiceClassNameByClassIdW(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03309
03310     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03311     LPWSTR lpszServiceClassName = (LPWSTR)*va_arg(vList, LPWSTR *);
03312     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03313
03314     return (handler->WSAGetServiceClassNameByClassIdW(lpServiceClassId, lpszServiceClassName,
03315                                                       lpdwBufferLength, (APIHook<int> &)hook));
03316
03317 } // DTHandler::_WSAGetServiceClassNameByClassIdW()
03318
03319
03320 bool
03321 DTHandler::NSPAddressToString(LPSOCKADDR lpsaAddress, DWORD dwAddressLength,
03322                               LPWSAPROTOCOL_INFOW lpProtocolInfo, LPWSTR lpszAddressString,
03323                               LPDWORD lpdwAddressStringLength, APIHook<int> &hook) {
03324
03325     return (false);
03326
03327 } // DTHandler::NSPAddressToString()
03328
03329
03330 bool
03331 DTHandler::_NSPAddressToString(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03332
03333     LPSOCKADDR lpsaAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
03334     DWORD dwAddressLength = (DWORD)*va_arg(vList, DWORD *);
03335     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
03336     LPWSTR lpszAddressString = (LPWSTR)*va_arg(vList, LPWSTR *);
03337     LPDWORD lpdwAddressStringLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03338
03339     return (handler->NSPAddressToString(lpsaAddress, dwAddressLength, lpProtocolInfo,
03340                                         lpszAddressString, lpdwAddressStringLength, (APIHook<int> &)hook));
03341
03342 } // DTHandler::_NSPAddressToString()
03343
03344
03345 bool
03346 DTHandler::NSPStringToAddress(LPWSTR AddressString, INT AddressFamily,
03347                               LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress,
03348                               LPINT lpAddressLength, APIHook<int> &hook) {
03349
03350     return (false);
03351
03352 } // DTHandler::NSPStringToAddress()
03353
03354
03355 bool
03356 DTHandler::_NSPStringToAddress(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03357
03358     LPWSTR AddressString = (LPWSTR)*va_arg(vList, LPWSTR *);
03359     INT AddressFamily = (INT)*va_arg(vList, INT *);
03360     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
03361     LPSOCKADDR lpAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
03362     LPINT lpAddressLength = (LPINT)*va_arg(vList, LPINT *);
03363
03364     return (handler->NSPStringToAddress(AddressString, AddressFamily, lpProtocolInfo,
03365                                         lpAddress, lpAddressLength, (APIHook<int> &)hook));
03366
03367 } // DTHandler::_NSPStringToAddress()
03368
03369
03370 bool
03371 DTHandler::NSPLookupServiceBegin(LPGUID lpProviderId, LPWSAQUERYSETW lpqsRestrictions,
03372                                  LPWSASERVICECLASSINFOW lpServiceClassInfo,
03373                                  DWORD dwControlFlags, LPHANDLE lphLookup,
03374                                  APIHook<int> &hook) {
03375
03376     return (false);
03377
03378 } // DTHandler::NSPLookupServiceBegin()
03379
03380
03381 bool
03382 DTHandler::_NSPLookupServiceBegin(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03383
03384     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03385     LPWSAQUERYSETW lpqsRestrictions = (LPWSAQUERYSETW)*va_arg(vList, LPWSAQUERYSETW *);
03386     LPWSASERVICECLASSINFOW lpServiceClassInfo = (LPWSASERVICECLASSINFOW)*va_arg(vList, LPWSASERVICECLASSINFOW *);
03387     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03388     LPHANDLE lphLookup = (LPHANDLE)*va_arg(vList, LPHANDLE *);
03389
03390     return (handler->NSPLookupServiceBegin(lpProviderId, lpqsRestrictions, lpServiceClassInfo,
03391                                            dwControlFlags, lphLookup, (APIHook<int> &)hook));
03392
03393 } // DTHandler::_NSPLookupServiceBegin()
03394
03395
03396 bool
03397 DTHandler::NSPLookupServiceNext(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength,
03398                                 LPWSAQUERYSET lpqsResults, APIHook<int> &hook) {
03399
03400     return (false);
03401
03402 } // DTHandler::NSPLookupServiceNext()
03403
03404
03405 bool
03406 DTHandler::_NSPLookupServiceNext(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03407
03408     HANDLE hLookup = (HANDLE)*va_arg(vList, HANDLE *);
03409     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03410     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03411     LPWSAQUERYSET lpqsResults = (LPWSAQUERYSET)*va_arg(vList, LPWSAQUERYSET *);
03412
03413     return (handler->NSPLookupServiceNext(hLookup, dwControlFlags, lpdwBufferLength,
03414                                           lpqsResults, (APIHook<int> &)hook));
03415
03416 } // DTHandler::_NSPLookupServiceNext()
03417
03418
03419 bool
03420 DTHandler::NSPLookupServiceEnd(HANDLE hLookup, APIHook<int> &hook) {
03421
03422     return (false);
03423
03424 } // DTHandler::NSPLookupServiceEnd()
03425
03426
03427 bool
03428 DTHandler::_NSPLookupServiceEnd(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03429
03430     HANDLE hLookup = (HANDLE)*va_arg(vList, HANDLE *);
03431
03432     return (handler->NSPLookupServiceEnd(hLookup, (APIHook<int> &)hook));
03433
03434 } // DTHandler::_NSPLookupServiceEnd()
03435
03436
03437 bool
03438 DTHandler::NSPGetAddressByName(LPWSTR lpszServiceInstanceName, LPGUID lpServiceClassId,
03439                                DWORD dwNameSpace, LPDWORD lpdwBufferLength,
03440                                LPWSAQUERYSETW lpqsResults, DWORD dwResolution,
03441                                LPWSTR lpszAliasBuffer, LPDWORD lpdwAliasBufferLength,
03442                                APIHook<int> &hook) {
03443
03444     return (false);
03445
03446 } // DTHandler::NSPGetAddressByName()
03447
03448
03449 bool
03450 DTHandler::_NSPGetAddressByName(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03451
03452     LPWSTR lpszServiceInstanceName = (LPWSTR)*va_arg(vList, LPWSTR *);
03453     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03454     DWORD dwNameSpace = (DWORD)*va_arg(vList, DWORD *);
03455     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03456     LPWSAQUERYSETW lpqsResults = (LPWSAQUERYSETW)*va_arg(vList, LPWSAQUERYSETW *);
03457     DWORD dwResolution = (DWORD)*va_arg(vList, DWORD *);
03458     LPWSTR lpszAliasBuffer = (LPWSTR)*va_arg(vList, LPWSTR *);
03459     LPDWORD lpdwAliasBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03460
03461     return (handler->NSPGetAddressByName(lpszServiceInstanceName, lpServiceClassId, dwNameSpace,
03462                                          lpdwBufferLength, lpqsResults, dwResolution,
03463                                          lpszAliasBuffer, lpdwAliasBufferLength, (APIHook<int> &)hook));
03464
03465 } // DTHandler::_NSPGetAddressByName()
03466
03467
03468 bool
03469 DTHandler::NSPInstallServiceClass(LPGUID lpProviderId, LPWSASERVICECLASSINFOW lpServiceClassInfo,
03470                                   APIHook<int> &hook) {
03471
03472     return (false);
03473
03474 } // DTHandler::NSPInstallServiceClass()
03475
03476
03477 bool
03478 DTHandler::_NSPInstallServiceClass(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03479
03480     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03481     LPWSASERVICECLASSINFOW lpServiceClassInfo = (LPWSASERVICECLASSINFOW)*va_arg(vList, LPWSASERVICECLASSINFOW *);
03482
03483     return (handler->NSPInstallServiceClass(lpProviderId, lpServiceClassInfo, (APIHook<int> &)hook));
03484
03485 } // DTHandler::_NSPInstallServiceClass()
03486
03487
03488 bool
03489 DTHandler::NSPSetService(LPGUID lpProviderId, LPWSASERVICECLASSINFOW lpServiceClassInfo,
03490                          LPWSAQUERYSETW lpqsRegInfo, WSAESETSERVICEOP essOperation,
03491                          DWORD dwControlFlags, APIHook<int> &hook) {
03492
03493     return (false);
03494
03495 } // DTHandler::NSPSetService()
03496
03497
03498 bool
03499 DTHandler::_NSPSetService(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03500
03501     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03502     LPWSASERVICECLASSINFOW lpServiceClassInfo = (LPWSASERVICECLASSINFOW)*va_arg(vList, LPWSASERVICECLASSINFOW *);
03503     LPWSAQUERYSETW lpqsRegInfo = (LPWSAQUERYSETW)*va_arg(vList, LPWSAQUERYSETW *);
03504     WSAESETSERVICEOP essOperation = (WSAESETSERVICEOP)*va_arg(vList, WSAESETSERVICEOP *);
03505     DWORD dwControlFlags = (DWORD)*va_arg(vList, DWORD *);
03506
03507     return (handler->NSPSetService(lpProviderId, lpServiceClassInfo, lpqsRegInfo, essOperation,
03508                                    dwControlFlags, (APIHook<int> &)hook));
03509
03510 } // DTHandler::_NSPSetService()
03511
03512
03513 bool
03514 DTHandler::NSPRemoveServiceClass(IN LPGUID lpProviderId, IN LPGUID lpServiceClassId,
03515                                  APIHook<int> &hook) {
03516
03517     return (false);
03518
03519 } // DTHandler::NSPRemoveServiceClass()
03520
03521
03522 bool
03523 DTHandler::_NSPRemoveServiceClass(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03524
03525     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03526     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03527
03528     return (handler->NSPRemoveServiceClass(lpProviderId, lpServiceClassId, (APIHook<int> &)hook));
03529
03530 } // DTHandler::_NSPRemoveServiceClass()
03531
03532
03533 bool
03534 DTHandler::NSPGetServiceClassInfo(IN LPGUID lpProviderId, IN OUT LPDWORD lpdwBufSize,
03535                                   IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo,
03536                                   APIHook<int> &hook) {
03537
03538     return (false);
03539
03540 } // DTHandler::NSPGetServiceClassInfo()
03541
03542
03543 bool
03544 DTHandler::_NSPGetServiceClassInfo(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03545
03546     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03547     LPDWORD lpdwBufSize = (LPDWORD)*va_arg(vList, LPDWORD *);
03548     LPWSASERVICECLASSINFOW lpServiceClassInfo = (LPWSASERVICECLASSINFOW)*va_arg(vList, LPWSASERVICECLASSINFOW *);
03549
03550     return (handler->NSPGetServiceClassInfo(lpProviderId, lpdwBufSize, lpServiceClassInfo, (APIHook<int> &)hook));
03551
03552 } // DTHandler::_NSPGetServiceClassInfo()
03553
03554
03555 bool
03556 DTHandler::NSPGetServiceClassNameByClassId(LPGUID lpServiceClassId, LPWSTR lpszServiceClassName,
03557                                            LPDWORD lpdwBufferLength, APIHook<int> &hook) {
03558
03559     return (false);
03560
03561 } // DTHandler::NSPGetServiceClassNameByClassId()
03562
03563
03564 bool
03565 DTHandler::_NSPGetServiceClassNameByClassId(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03566
03567     LPGUID lpServiceClassId = (LPGUID)*va_arg(vList, LPGUID *);
03568     LPWSTR lpszServiceClassName = (LPWSTR)*va_arg(vList, LPWSTR *);
03569     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03570
03571     return (handler->NSPGetServiceClassNameByClassId(lpServiceClassId, lpszServiceClassName,
03572                                                      lpdwBufferLength, (APIHook<int> &)hook));
03573
03574 } // DTHandler::_NSPGetServiceClassNameByClassId()
03575
03576
03577 bool
03578 DTHandler::WSCGetProviderPath(LPGUID lpProviderId, LPWSTR lpszProviderDllPath,
03579                               LPINT lpProviderDllPathLen, LPINT lpErrno,
03580                               APIHook<int> &hook) {
03581
03582     return (false);
03583
03584 } // DTHandler::WSCGetProviderPath()
03585
03586
03587 bool
03588 DTHandler::_WSCGetProviderPath(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03589
03590     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03591     LPWSTR lpszProviderDllPath = (LPWSTR)*va_arg(vList, LPWSTR *);
03592     LPINT lpProviderDllPathLen = (LPINT)*va_arg(vList, LPINT *);
03593     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
03594
03595     return (handler->WSCGetProviderPath(lpProviderId, lpszProviderDllPath, lpProviderDllPathLen,
03596                                         lpErrno, (APIHook<int> &)hook));
03597
03598 } // DTHandler::_WSCGetProviderPath()
03599
03600
03601 bool
03602 DTHandler::WSCInstallNameSpace(LPWSTR lpszIdentifier, LPWSTR lpszPathName,
03603                                DWORD dwNameSpace, DWORD dwVersion,
03604                                LPGUID lpProviderId, APIHook<int> &hook) {
03605
03606     return (false);
03607
03608 } // DTHandler::WSCInstallNameSpace()
03609
03610
03611 bool
03612 DTHandler::_WSCInstallNameSpace(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03613
03614     LPWSTR lpszIdentifier = (LPWSTR)*va_arg(vList, LPWSTR *);
03615     LPWSTR lpszPathName = (LPWSTR)*va_arg(vList, LPWSTR *);
03616     DWORD dwNameSpace = (DWORD)*va_arg(vList, DWORD *);
03617     DWORD dwVersion = (DWORD)*va_arg(vList, DWORD *);
03618     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03619
03620     return (handler->WSCInstallNameSpace(lpszIdentifier, lpszPathName, dwNameSpace,
03621                                          dwVersion, lpProviderId, (APIHook<int> &)hook));
03622
03623 } // DTHandler::_WSCInstallNameSpace()
03624
03625
03626 bool
03627 DTHandler::WSCUnInstallNameSpace(LPGUID lpProviderId, APIHook<int> &hook) {
03628
03629     return (false);
03630
03631 } // DTHandler::WSCUnInstallNameSpace()
03632
03633
03634 bool
03635 DTHandler::_WSCUnInstallNameSpace(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03636
03637     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03638
03639     return (handler->WSCUnInstallNameSpace(lpProviderId, (APIHook<int> &)hook));
03640
03641 } // DTHandler::_WSCUnInstallNameSpace()
03642
03643
03644 bool
03645 DTHandler::WSCEnableNSProvider(LPGUID lpProviderId, BOOL fEnable, APIHook<int> &hook) {
03646
03647     return (false);
03648
03649 } // DTHandler::WSCEnableNSProvider()
03650
03651
03652 bool
03653 DTHandler::_WSCEnableNSProvider(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03654
03655     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03656     BOOL fEnable = (BOOL)*va_arg(vList, BOOL *);
03657
03658     return (handler->WSCEnableNSProvider(lpProviderId, fEnable, (APIHook<int> &)hook));
03659
03660 } // DTHandler::_WSCEnableNSProvider()
03661
03662 bool
03663 DTHandler::WSPAddressToString(LPSOCKADDR lpsaAddress, DWORD dwAddressLength,
03664                               LPWSAPROTOCOL_INFOW lpProtocolInfo,
03665                               LPWSTR lpszAddressString, LPDWORD lpdwAddressStringLength,
03666                               LPINT lpErrno, APIHook<int> &hook) {
03667
03668     return (false);
03669
03670 } // DTHandler::WSPAddressToString()
03671
03672
03673 bool
03674 DTHandler::_WSPAddressToString(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03675
03676     LPSOCKADDR lpsaAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
03677     DWORD dwAddressLength = (DWORD)*va_arg(vList, DWORD *);
03678     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
03679     LPWSTR lpszAddressString = (LPWSTR)*va_arg(vList, LPWSTR *);
03680     LPDWORD lpdwAddressStringLength = (LPDWORD)*va_arg(vList, LPDWORD *);
03681     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
03682
03683     return (handler->WSPAddressToString(lpsaAddress, dwAddressLength, lpProtocolInfo, lpszAddressString,
03684                                         lpdwAddressStringLength, lpErrno, (APIHook<int> &)hook));
03685
03686 } // DTHandler::_WSPAddressToString()
03687
03688
03689 bool
03690 DTHandler::WSPStringToAddress(LPWSTR AddressString, INT AddressFamily,
03691                               LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress,
03692                               LPINT lpAddressLength, LPINT lpErrno,
03693                               APIHook<int> &hook) {
03694
03695     return (false);
03696
03697 } // DTHandler::WSPStringToAddress()
03698
03699
03700 bool
03701 DTHandler::_WSPStringToAddress(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03702
03703     LPWSTR AddressString = (LPWSTR)*va_arg(vList, LPWSTR *);
03704     INT AddressFamily = (INT)*va_arg(vList, INT *);
03705     LPWSAPROTOCOL_INFOW lpProtocolInfo = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
03706     LPSOCKADDR lpAddress = (LPSOCKADDR)*va_arg(vList, LPSOCKADDR *);
03707     LPINT lpAddressLength = (LPINT)*va_arg(vList, LPINT *);
03708     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
03709
03710     return (handler->WSPStringToAddress(AddressString, AddressFamily, lpProtocolInfo, lpAddress,
03711                                         lpAddressLength, lpErrno, (APIHook<int> &)hook));
03712
03713 } // DTHandler::_WSPStringToAddress()
03714
03715
03716 #if (WINVER >= 0x0501)
03717
03718 bool
03719 DTHandler::WSANSPIoctl(IN HANDLE hLookup, IN DWORD dwControlCode, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, IN DWORD cbOutBuffer, OUT LPDWORD lpcbBytesReturned, IN LPWSACOMPLETION lpCompletion, APIHook<INT> &hook) {
03720
03721     return (false);
03722
03723 } // DTHandler::WSANSPIoctl()
03724
03725
03726 bool
03727 DTHandler::_WSANSPIoctl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03728
03729     HANDLE hLookup = (HANDLE)*va_arg(vList, HANDLE *);
03730     DWORD dwControlCode = (DWORD)*va_arg(vList, DWORD *);
03731     LPVOID lpvInBuffer = (LPVOID)*va_arg(vList, LPVOID *);
03732     DWORD cbInBuffer = (DWORD)*va_arg(vList, DWORD *);
03733     LPVOID lpvOutBuffer = (LPVOID)*va_arg(vList, LPVOID *);
03734     DWORD cbOutBuffer = (DWORD)*va_arg(vList, DWORD *);
03735     LPDWORD lpcbBytesReturned = (LPDWORD)*va_arg(vList, LPDWORD *);
03736     LPWSACOMPLETION lpCompletion = (LPWSACOMPLETION)*va_arg(vList, LPWSACOMPLETION *);
03737
03738     return (handler->WSANSPIoctl(hLookup, dwControlCode, lpvInBuffer, cbInBuffer, lpvOutBuffer, cbOutBuffer, lpcbBytesReturned, lpCompletion, (APIHook<INT> &)hook));
03739
03740 } // DTHandler::_WSANSPIoctl()
03741
03742
03743 bool
03744 DTHandler::NSPIoctl(HANDLE hLookup, DWORD dwControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSACOMPLETION lpCompletion, LPWSATHREADID lpThreadId, APIHook<INT> &hook) {
03745
03746     return (false);
03747
03748 } // DTHandler::NSPIoctl()
03749
03750
03751 bool
03752 DTHandler::_NSPIoctl(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03753
03754     HANDLE hLookup = (HANDLE)*va_arg(vList, HANDLE *);
03755     DWORD dwControlCode = (DWORD)*va_arg(vList, DWORD *);
03756     LPVOID lpvInBuffer = (LPVOID)*va_arg(vList, LPVOID *);
03757     DWORD cbInBuffer = (DWORD)*va_arg(vList, DWORD *);
03758     LPVOID lpvOutBuffer = (LPVOID)*va_arg(vList, LPVOID *);
03759     DWORD cbOutBuffer = (DWORD)*va_arg(vList, DWORD *);
03760     LPDWORD lpcbBytesReturned = (LPDWORD)*va_arg(vList, LPDWORD *);
03761     LPWSACOMPLETION lpCompletion = (LPWSACOMPLETION)*va_arg(vList, LPWSACOMPLETION *);
03762     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
03763
03764     return (handler->NSPIoctl(hLookup, dwControlCode, lpvInBuffer, cbInBuffer, lpvOutBuffer, cbOutBuffer, lpcbBytesReturned, lpCompletion, lpThreadId, (APIHook<INT> &)hook));
03765
03766 } // DTHandler::_NSPIoctl()
03767
03768
03769 bool
03770 DTHandler::WPUCompleteOverlappedRequest(SOCKET s, LPWSAOVERLAPPED lpOverlapped, DWORD dwError, DWORD cbTransferred, LPINT lpErrno, APIHook<int> &hook) {
03771
03772     return (false);
03773
03774 } // DTHandler::WPUCompleteOverlappedRequest()
03775
03776
03777 bool
03778 DTHandler::_WPUCompleteOverlappedRequest(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03779
03780     SOCKET s = (SOCKET)*va_arg(vList, SOCKET *);
03781     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
03782     DWORD dwError = (DWORD)*va_arg(vList, DWORD *);
03783     DWORD cbTransferred = (DWORD)*va_arg(vList, DWORD *);
03784     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
03785
03786     return (handler->WPUCompleteOverlappedRequest(s, lpOverlapped, dwError, cbTransferred, lpErrno, (APIHook<int> &)hook));
03787
03788 } // DTHandler::_WPUCompleteOverlappedRequest()
03789
03790
03791 bool
03792 DTHandler::WSAProviderConfigChange(IN OUT LPHANDLE lpNotificationHandle, IN LPWSAOVERLAPPED lpOverlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook<int> &hook) {
03793
03794     return (false);
03795
03796 } // DTHandler::WSAProviderConfigChange()
03797
03798
03799 bool
03800 DTHandler::_WSAProviderConfigChange(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03801
03802     LPHANDLE lpNotifcationHandle = (LPHANDLE)*va_arg(vList, LPHANDLE *);
03803     LPWSAOVERLAPPED lpOverlapped = (LPWSAOVERLAPPED)*va_arg(vList, LPWSAOVERLAPPED *);
03804     LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine = (LPWSAOVERLAPPED_COMPLETION_ROUTINE)*va_arg(vList, LPWSAOVERLAPPED_COMPLETION_ROUTINE *);
03805
03806     return (handler->WSAProviderConfigChange(lpNotifcationHandle, lpOverlapped, lpCompletionRoutine, (APIHook<int> &)hook));
03807
03808 } // DTHandler::_WSAProviderConfigChange()
03809
03810
03811 bool
03812 DTHandler::WSCWriteProviderOrder(IN LPDWORD lpwdCatalogEntryId, IN DWORD dwNumberOfEntries, APIHook<int> &hook) {
03813
03814     return (false);
03815
03816 } // DTHandler::WSCWriteProviderOrder()
03817
03818
03819 bool
03820 DTHandler::_WSCWriteProviderOrder(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03821
03822     LPDWORD lpwdCatalogEntryId = (LPDWORD)*va_arg(vList, LPDWORD *);
03823     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
03824
03825     return (handler->WSCWriteProviderOrder(lpwdCatalogEntryId, dwNumberOfEntries, (APIHook<int> &)hook));
03826
03827 } // DTHandler::_WSCWriteProviderOrder()
03828
03829
03830 bool
03831 DTHandler::WSCWriteNameSpaceOrder(IN LPGUID lpProviderId, IN DWORD dwNumberOfEntries, APIHook<int> &hook) {
03832
03833     return (false);
03834
03835 } // DTHandler::WSCWriteNameSpaceOrder()
03836
03837
03838 bool
03839 DTHandler::_WSCWriteNameSpaceOrder(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03840
03841     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03842     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
03843
03844     return (handler->WSCWriteNameSpaceOrder(lpProviderId, dwNumberOfEntries, (APIHook<int> &)hook));
03845
03846 } // DTHandler::_WSCWriteNameSpaceOrder()
03847
03848
03849 bool
03850 DTHandler::WSCUpdateProvider(IN LPGUID lpProviderId, IN const WCHAR FAR *lpszProviderDllPath, IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList, IN DWORD dwNumberOfEntries, OUT LPINT lpErrno, APIHook<int> &hook) {
03851
03852     return (false);
03853
03854 } // DTHandler::WSCUpdateProvider()
03855
03856
03857 bool
03858 DTHandler::_WSCUpdateProvider(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03859
03860     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03861     const WCHAR FAR *lpszProviderDllPath = (const WCHAR FAR *)*va_arg(vList, const WCHAR FAR **);
03862     const LPWSAPROTOCOL_INFOW lpProtocolInfoList = (const LPWSAPROTOCOL_INFOW)*va_arg(vList, const LPWSAPROTOCOL_INFOW *);
03863     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
03864     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
03865
03866     return (handler->WSCUpdateProvider(lpProviderId, lpszProviderDllPath, lpProtocolInfoList, dwNumberOfEntries, lpErrno, (APIHook<int> &)hook));
03867
03868 } // DTHandler::_WSCUpdateProvider()
03869
03870
03871 bool
03872 DTHandler::getaddrinfo(IN const char FAR *NodeName, IN const char FAR *ServiceName, IN const struct addrinfo FAR *Hints, OUT struct addrinfo FAR * FAR *Result, APIHook<INT> &hook) {
03873
03874     return (false);
03875
03876 } // DTHandler::getaddrinfo()
03877
03878
03879 bool
03880 DTHandler::_getaddrinfo(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03881
03882     const char FAR *NodeName = (const char FAR *)*va_arg(vList, const char FAR **);
03883     const char FAR *ServiceName = (const char FAR *)*va_arg(vList, const char FAR **);
03884     const struct addrinfo FAR *Hints = (const struct addrinfo FAR *)*va_arg(vList, const struct addrinfo FAR **);
03885     struct addrinfo FAR * FAR *Result = (struct addrinfo FAR * FAR *)*va_arg(vList, struct addrinfo FAR * FAR **);
03886
03887     return (handler->getaddrinfo(NodeName, ServiceName, Hints, Result, (APIHook<INT> &)hook));
03888
03889 } // DTHandler::_getaddrinfo()
03890
03891
03892 bool
03893 DTHandler::getnameinfo(IN const struct sockaddr *SocketAddress, IN socklen_t SocketAddressLength, OUT PCHAR NodeName, IN DWORD NodeBufferSize, OUT PCHAR ServiceName, IN DWORD ServiceBufferSize, IN INT Flags, APIHook<INT> &hook) {
03894
03895     return (false);
03896
03897 } // DTHandler::getnameinfo()
03898
03899
03900 bool
03901 DTHandler::_getnameinfo(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03902
03903     const struct sockaddr *SocketAddress = (const struct sockaddr *)*va_arg(vList, const struct sockaddr **);
03904     socklen_t SocketAddressLength = (socklen_t)*va_arg(vList, socklen_t *);
03905     PCHAR NodeName = (PCHAR)*va_arg(vList, PCHAR *);
03906     DWORD NodeBufferSize = (DWORD)*va_arg(vList, DWORD *);
03907     PCHAR ServiceName = (PCHAR)*va_arg(vList, PCHAR *);
03908     DWORD ServiceBufferSize = (DWORD)*va_arg(vList, DWORD *);
03909     INT Flags = (INT)*va_arg(vList, INT *);
03910
03911     return (handler->getnameinfo(SocketAddress, SocketAddressLength, NodeName, NodeBufferSize, ServiceName, ServiceBufferSize, Flags, (APIHook<INT> &)hook));
03912
03913 } // DTHandler::_getnameinfo()
03914
03915
03916 bool
03917 DTHandler::freeaddrinfo(IN OUT struct addrinfo *Free, APIHook<void> &hook) {
03918
03919     return (false);
03920
03921 } // DTHandler::freeaddrinfo()
03922
03923
03924 bool
03925 DTHandler::_freeaddrinfo(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03926
03927     struct addrinfo *Free = (struct addrinfo *)*va_arg(vList, struct addrinfo **);
03928
03929     return (handler->freeaddrinfo(Free, (APIHook<void> &)hook));
03930
03931 } // DTHandler::_freeaddrinfo()
03932
03933
03934 bool
03935 DTHandler::NSPStartup(LPGUID lpProviderId, LPNSP_ROUTINE lpnspRoutines, APIHook<INT> &hook) {
03936
03937     return (false);
03938
03939 } // DTHandler::NSPStartup()
03940
03941
03942 bool
03943 DTHandler::_NSPStartup(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03944
03945     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
03946     LPNSP_ROUTINE lpnspRoutines = (LPNSP_ROUTINE)*va_arg(vList, LPNSP_ROUTINE *);
03947
03948     return (handler->NSPStartup(lpProviderId, lpnspRoutines, (APIHook<INT> &)hook));
03949
03950 } // DTHandler::_NSPStartup()
03951
03952
03953 bool
03954 DTHandler::WPUOpenCurrentThread(OUT LPWSATHREADID lpThreadId, OUT LPINT lpErrno, APIHook<int> &hook) {
03955
03956     return (false);
03957
03958 } // DTHandler::WPUOpenCurrentThread()
03959
03960
03961 bool
03962 DTHandler::_WPUOpenCurrentThread(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03963
03964     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
03965     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
03966
03967     return (handler->WPUOpenCurrentThread(lpThreadId, lpErrno, (APIHook<int> &)hook));
03968
03969 } // DTHandler::_WPUOpenCurrentThread()
03970
03971
03972 bool
03973 DTHandler::WPUCloseThread(IN LPWSATHREADID lpThreadId, OUT LPINT lpErrno, APIHook<int> &hook) {
03974
03975     return (false);
03976
03977 } // DTHandler::WPUCloseThread()
03978
03979
03980 bool
03981 DTHandler::_WPUCloseThread(DTHandler *handler, APIHook<void> &hook, va_list vList) {
03982
03983     LPWSATHREADID lpThreadId = (LPWSATHREADID)*va_arg(vList, LPWSATHREADID *);
03984     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
03985
03986     return (handler->WPUCloseThread(lpThreadId, lpErrno, (APIHook<int> &)hook));
03987
03988 } // DTHandler::_WPUCloseThread()
03989
03990
03991 #if defined(_WIN64)
03992
03993 bool
03994 DTHandler::WSCEnumProtocols32(IN LPINT lpiProtocols, OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer, IN OUT LPDWORD lpdwBufferLength, LPINT lpErrno, APIHook<int> &hook) {
03995
03996     return (false);
03997
03998 } // DTHandler::WSCEnumProtocols32()
03999
04000
04001 bool
04002 DTHandler::_WSCEnumProtocols32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04003
04004     LPINT lpiProtocols = (LPINT)*va_arg(vList, LPINT *);
04005     LPWSAPROTOCOL_INFOW lpProtocolBuffer = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
04006     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
04007     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
04008
04009     return (handler->WSCEnumProtocols32(lpiProtocols, lpProtocolBuffer, lpdwBufferLength, lpErrno, (APIHook<int> &)hook));
04010
04011 } // DTHandler::_WSCEnumProtocols32()
04012
04013
04014 bool
04015 DTHandler::WSCInstallProvider64_32(const LPGUID lpProviderId, const LPWSTR lpszProviderDllPath, const LPWSAPROTOCOL_INFOW lpProtocolInfoList, DWORD dwNumberOfEntries, LPINT lpErrno, APIHook<int> &hook) {
04016
04017     return (false);
04018
04019 } // DTHandler::WSCInstallProvider64_32()
04020
04021
04022 bool
04023 DTHandler::_WSCInstallProvider64_32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04024
04025     const LPGUID lpProviderId = (const LPGUID)*va_arg(vList, const LPGUID *);
04026     const LPWSTR lpszProviderDllPath = (const LPWSTR)*va_arg(vList, const LPWSTR *);
04027     const LPWSAPROTOCOL_INFOW lpProtocolInfoList = (LPWSAPROTOCOL_INFOW)*va_arg(vList, LPWSAPROTOCOL_INFOW *);
04028     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
04029     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
04030
04031     return (handler->WSCInstallProvider64_32(lpProviderId, lpszProviderDllPath, lpProtocolInfoList, dwNumberOfEntries, lpErrno, (APIHook<int> &)hook));
04032
04033 } // DTHandler::_WSCInstallProvider64_32()
04034
04035
04036 bool
04037 DTHandler::WSCDeinstallProvider32(LPGUID lpProviderId, LPINT lpErrno, APIHook<int> &hook) {
04038
04039     return (false);
04040
04041 } // DTHandler::WSCDeinstallProvider32()
04042
04043
04044 bool
04045 DTHandler::_WSCDeinstallProvider32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04046
04047     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
04048     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
04049
04050     return (handler->WSCDeinstallProvider32(lpProviderId, lpErrno, (APIHook<int> &)hook));
04051
04052 } // DTHandler::_WSCDeinstallProvider32()
04053
04054
04055 bool
04056 DTHandler::WSCGetProviderPath32(IN LPGUID lpProviderId, OUT WCHAR FAR *lpszProviderDllPath, IN OUT LPINT ProviderDLLPathLen, OUT LPINT lpErrno, APIHook<int> &hook) {
04057
04058     return (false);
04059
04060 } // DTHandler::WSCGetProviderPath32()
04061
04062
04063 bool
04064 DTHandler::_WSCGetProviderPath32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04065
04066     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
04067     LPWSTR lpszProviderDllPath = (LPWSTR)*va_arg(vList, LPWSTR *);
04068     LPINT lpProviderDllPathLen = (LPINT)*va_arg(vList, LPINT *);
04069     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
04070
04071     return (handler->WSCGetProviderPath32(lpProviderId, lpszProviderDllPath, lpProviderDllPathLen, lpErrno, (APIHook<int> &)hook));
04072
04073 } // DTHandler::_WSCGetProviderPath32()
04074
04075
04076 bool
04077 DTHandler::WSCUpdateProvider32(IN LPGUID lpProviderId, IN const WCHAR FAR *lpszProviderDllPath, IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList, IN DWORD dwNumberOfEntries, OUT LPINT lpErrno, APIHook<int> &hook) {
04078
04079     return (false);
04080
04081 } // DTHandler::WSCUpdateProvider32()
04082
04083
04084 bool
04085 DTHandler::_WSCUpdateProvider32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04086
04087     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
04088     const WCHAR FAR *lpszProviderDllPath = (const WCHAR FAR *)*va_arg(vList, const WCHAR FAR **);
04089     const LPWSAPROTOCOL_INFOW lpProtocolInfoList = (const LPWSAPROTOCOL_INFOW)*va_arg(vList, const LPWSAPROTOCOL_INFOW *);
04090     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
04091     LPINT lpErrno = (LPINT)*va_arg(vList, LPINT *);
04092
04093     return (handler->WSCUpdateProvider32(lpProviderId, lpszProviderDllPath, lpProtocolInfoList, dwNumberOfEntries, lpErrno, (APIHook<int> &)hook));
04094
04095 } // DTHandler::_WSCUpdateProvider32()
04096
04097
04098 bool
04099 DTHandler::WSCWriteProviderOrder32(IN LPDWORD lpwdCatalogEntryId, IN DWORD dwNumberOfEntries, APIHook<int> &hook) {
04100
04101     return (false);
04102
04103 } // DTHandler::WSCWriteProviderOrder32()
04104
04105
04106 bool
04107 DTHandler::_WSCWriteProviderOrder32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04108
04109     LPDWORD lpwdCatalogEntryId = (LPDWORD)*va_arg(vList, LPDWORD *);
04110     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
04111
04112     return (handler->WSCWriteProviderOrder32(lpwdCatalogEntryId, dwNumberOfEntries, (APIHook<int> &)hook));
04113
04114 } // DTHandler::_WSCWriteProviderOrder32()
04115
04116
04117 bool
04118 DTHandler::WSCEnumNameSpaceProviders32(IN OUT LPDWORD lpdwBufferLength, IN OUT LPWSANAMESPACE_INFOW lpnspBuffer, APIHook<INT> &hook) {
04119
04120     return (false);
04121
04122 } // DTHandler::WSCEnumNameSpaceProviders32()
04123
04124
04125 bool
04126 DTHandler::_WSCEnumNameSpaceProviders32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04127
04128     LPDWORD lpdwBufferLength = (LPDWORD)*va_arg(vList, LPDWORD *);
04129     LPWSANAMESPACE_INFOW lpnspBuffer = (LPWSANAMESPACE_INFOW)*va_arg(vList, LPWSANAMESPACE_INFOW *);
04130
04131     return (handler->WSCEnumNameSpaceProviders32(lpdwBufferLength, lpnspBuffer, (APIHook<INT> &)hook));
04132
04133 } // DTHandler::_WSCEnumNameSpaceProviders32()
04134
04135
04136 bool
04137 DTHandler::WSCInstallNameSpace32(LPWSTR lpszIdentifier, LPWSTR lpszPathName, DWORD dwNameSpace, DWORD dwVersion, LPGUID lpProviderId, APIHook<int> &hook) {
04138
04139     return (false);
04140
04141 } // DTHandler::WSCInstallNameSpace32()
04142
04143
04144 bool
04145 DTHandler::_WSCInstallNameSpace32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04146
04147     LPWSTR lpszIdentifier = (LPWSTR)*va_arg(vList, LPWSTR *);
04148     LPWSTR lpszPathName = (LPWSTR)*va_arg(vList, LPWSTR *);
04149     DWORD dwNameSpace = (DWORD)*va_arg(vList, DWORD *);
04150     DWORD dwVersion = (DWORD)*va_arg(vList, DWORD *);
04151     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
04152
04153     return (handler->WSCInstallNameSpace32(lpszIdentifier, lpszPathName, dwNameSpace, dwVersion, lpProviderId, (APIHook<int> &)hook));
04154
04155 } // DTHandler::_WSCInstallNameSpace32()
04156
04157
04158 bool
04159 DTHandler::WSCUnInstallNameSpace32(LPGUID lpProviderId, APIHook<int> &hook) {
04160
04161     return (false);
04162
04163 } // DTHandler::WSCUnInstallNameSpace32()
04164
04165
04166 bool
04167 DTHandler::_WSCUnInstallNameSpace32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04168
04169     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
04170
04171     return (handler->WSCUnInstallNameSpace32(lpProviderId, (APIHook<int> &)hook));
04172
04173 } // DTHandler::_WSCUnInstallNameSpace32()
04174
04175
04176 bool
04177 DTHandler::WSCEnableNSProvider32(LPGUID lpProviderId, BOOL fEnable, APIHook<int> &hook) {
04178
04179     return (false);
04180
04181 } // DTHandler::WSCEnableNSProvider32()
04182
04183
04184 bool
04185 DTHandler::_WSCEnableNSProvider32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04186
04187     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
04188     BOOL fEnable = (BOOL)*va_arg(vList, BOOL *);
04189
04190     return (handler->WSCEnableNSProvider32(lpProviderId, fEnable, (APIHook<int> &)hook));
04191
04192 } // DTHandler::_WSCEnableNSProvider32()
04193
04194
04195 bool
04196 DTHandler::WSCWriteNameSpaceOrder32(IN LPGUID lpProviderId, IN DWORD dwNumberOfEntries, APIHook<int> &hook) {
04197
04198     return (false);
04199
04200 } // DTHandler::WSCWriteNameSpaceOrder32()
04201
04202
04203 bool
04204 DTHandler::_WSCWriteNameSpaceOrder32(DTHandler *handler, APIHook<void> &hook, va_list vList) {
04205
04206     LPGUID lpProviderId = (LPGUID)*va_arg(vList, LPGUID *);
04207     DWORD dwNumberOfEntries = (DWORD)*va_arg(vList, DWORD *);
04208
04209     return (handler->WSCWriteNameSpaceOrder32(lpProviderId, dwNumberOfEntries, (APIHook<int> &)hook));
04210
04211 } // DTHandler::_WSCWriteNameSpaceOrder32()
04212
04213
04214 #endif // defined(_WIN64)
04215 #endif // (WINVER >= 0x0501)
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/Commands.Cpp Source File

  • WinBase
  • IO
  • DiskQuota

Commands.Cpp

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1999 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009
00010 Commands.cpp
00011
00012 Description:
00013 Implements the functions called when the user selects a valid menu choice
00014 ----------------------------------------------------------------------------*/
00015
00016 #define WIN32_LEAN_AND_MEAN
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <dskquota.h>
00021 #include "Commands.h"
00022
00023 static void WaitForKeyPress();
00024
00025 /*-----------------------------------------------------------------------------
00026 GetDefaultQuota(IDiskQuotaControl* lpDiskQuotaControl)
00027     Gets the state of quota tracking on the current volume
00028
00029 Parameters
00030     lpDiskQuotaControl - Pointer to an object that implements the
00031                          IDiskQuotaControl interface
00032
00033 Return Value
00034     TRUE - Success
00035     FALSE - Failure
00036 -----------------------------------------------------------------------------*/
00037 BOOL GetDefaultQuota(IDiskQuotaControl* lpDiskQuotaControl)
00038 {
00039     HRESULT hr;
00040     DWORD   dwState;
00041
00042     // Get the default quota state
00043     hr = lpDiskQuotaControl->GetQuotaState(&dwState);
00044
00045     if (FAILED(hr))
00046     {
00047         PrintError(hr);
00048         return FALSE;
00049     }
00050
00051     wprintf(L"\n\nDefault Disk Quota State:\n");
00052
00053     // Switch on the state of disk quota tracking
00054     switch(dwState & DISKQUOTA_STATE_MASK)
00055     {
00056     case DISKQUOTA_STATE_DISABLED:
00057         wprintf(L"Quota's are not enabled on the volume.\n");
00058         break;
00059     case DISKQUOTA_STATE_TRACK:
00060         wprintf(L"Quotas are enabled but the limit value is not being ");
00061         wprintf(L"enforced.\nUsers may exceed their quota limit.\n");
00062         break;
00063     case DISKQUOTA_STATE_ENFORCE:
00064         wprintf(L"Quotas are enabled and the limit value is enforced.");
00065         wprintf(L"\nUsers cannot exceed their quota limit.\n");
00066         break;
00067     default:
00068         wprintf(L"Unknown.\n");
00069         break;
00070     }
00071
00072     wprintf(L"\nDefault Disk Quota File State:\n");
00073
00074     switch(dwState & DISKQUOTA_FILESTATE_MASK)
00075     {
00076     case DISKQUOTA_FILESTATE_INCOMPLETE:
00077         wprintf(L"The volume's quota information is out of date.\n");
00078         wprintf(L"Quotas are probably disabled.\n");
00079         break;
00080     case DISKQUOTA_FILESTATE_REBUILDING:
00081         wprintf(L"The volume is rebuilding its quota information.\n");
00082         break;
00083     default:
00084         wprintf(L"Unknown.\n");
00085         break;
00086     }
00087
00088     WaitForKeyPress();
00089
00090     return TRUE;
00091 }
00092
00093 /*-----------------------------------------------------------------------------
00094 GetQuotaLogFlags(IDiskQuotaControl* lpDiskQuotaControl)
00095     Gets the state of the quota log flags
00096
00097 Parameters
00098     lpDiskQuotaControl - Pointer to an object that implements the
00099                          IDiskQuotaControl interface
00100
00101 Return Value
00102     TRUE - Success
00103     FALSE - Failure
00104 -----------------------------------------------------------------------------*/
00105 BOOL GetQuotaLogFlags(IDiskQuotaControl* lpDiskQuotaControl)
00106 {
00107     HRESULT hr;
00108     DWORD   dwQuotaLogFlags;
00109
00110     // Get the state log the quota log flags
00111     hr = lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);
00112
00113     if (FAILED(hr))
00114     {
00115         PrintError(hr);
00116         return FALSE;
00117     }
00118
00119     wprintf(L"\n\nDisk Quota Log State:\n");
00120
00121     // Check if the system creates a log entry when a threshold limit
00122     // is exceeded
00123     if (DISKQUOTA_IS_LOGGED_USER_THRESHOLD(dwQuotaLogFlags))
00124     {
00125         wprintf(L"\nAn event log entry will be created when the user");
00126         wprintf(L"\nexceeds his assigned warning threshold.\n");
00127     }
00128     else
00129     {
00130         wprintf(L"\nAn event log entry will NOT be created when the");
00131         wprintf(L"\nuser exceeds his assigned warning threshold.\n");
00132     }
00133
00134     // Check if the system creates a log entry when a hard limit
00135     // is exceeded
00136     if (DISKQUOTA_IS_LOGGED_USER_LIMIT(dwQuotaLogFlags))
00137     {
00138         wprintf(L"\nAn event log entry will be created when the user");
00139         wprintf(L"\nexceeds his assigned hard quota limit.\n");
00140     }
00141     else
00142     {
00143         wprintf(L"\nAn event log entry will NOT be created when the");
00144         wprintf(L"\nuser exceeds his assigned hard quota limit.\n");
00145     }
00146     WaitForKeyPress();
00147
00148     return TRUE;
00149 }
00150
00151 /*-----------------------------------------------------------------------------
00152 GetDefaultHardLimit(IDiskQuotaControl* lpDiskQuotaControl)
00153     Get the default hard limit of the volume.
00154
00155 Parameters
00156     lpDiskQuotaControl - Pointer to an object that implements the
00157                          IDiskQuotaControl interface
00158
00159 Return Value
00160     TRUE - Success
00161     FALSE - Failure
00162 -----------------------------------------------------------------------------*/
00163 BOOL GetDefaultHardLimit(IDiskQuotaControl* lpDiskQuotaControl)
00164 {
00165     HRESULT hr;
00166     WCHAR   szDefaultHardLimitText[MAX_PATH];
00167
00168     // Get the default hard quota limit in text format
00169     hr = lpDiskQuotaControl->
00170         GetDefaultQuotaLimitText(szDefaultHardLimitText, MAX_PATH);
00171
00172     if (FAILED(hr))
00173     {
00174         PrintError(hr);
00175         return FALSE;
00176     }
00177
00178     szDefaultHardLimitText[MAX_PATH - 1] = L'\0'; // Make sure szDefaultHardLimitText is NULL terminated
00179
00180     wprintf(L"\n\nDefault Quota Hard Limit: %s\n", szDefaultHardLimitText);
00181
00182     WaitForKeyPress();
00183
00184     return TRUE;
00185 }
00186
00187 /*-----------------------------------------------------------------------------
00188 GetDefaultThreshold(IDiskQuotaControl* lpDiskQuotaControl)
00189     Get the default threshold of the volume.
00190
00191 Parameters
00192     lpDiskQuotaControl - Pointer to an object that implements the
00193                          IDiskQuotaControl interface
00194
00195 Return Value
00196     TRUE - Success
00197     FALSE - Failure
00198 -----------------------------------------------------------------------------*/
00199 BOOL GetDefaultThreshold(IDiskQuotaControl* lpDiskQuotaControl)
00200 {
00201     HRESULT hr;
00202     WCHAR   szDefaultThresholdText[MAX_PATH];
00203
00204     // Get the default threshold
00205     hr = lpDiskQuotaControl->
00206         GetDefaultQuotaThresholdText(szDefaultThresholdText, MAX_PATH);
00207
00208     if (FAILED(hr))
00209     {
00210         PrintError(hr);
00211         return FALSE;
00212     }
00213
00214     szDefaultThresholdText[MAX_PATH - 1] = L'\0'; // Make sure szDefaultThresholdText is NULL terminated
00215
00216     wprintf(L"\n\nDefault Quota Threshold: %s\n", szDefaultThresholdText);
00217
00218     WaitForKeyPress();
00219
00220     return TRUE;
00221 }
00222
00223 /*-----------------------------------------------------------------------------
00224 SetDefaultHardLimit(IDiskQuotaControl* lpDiskQuotaControl)
00225     Set the default hard limit of the volume.
00226
00227 Parameters
00228     lpDiskQuotaControl - Pointer to an object that implements the
00229                          IDiskQuotaControl interface
00230
00231 Return Value
00232     TRUE - Success
00233     FALSE - Failure
00234 -----------------------------------------------------------------------------*/
00235 BOOL SetDefaultHardLimit(IDiskQuotaControl* lpDiskQuotaControl)
00236 {
00237     HRESULT  hr;
00238     DWORD    dwCharsRead;
00239     LONGLONG llLimit = 0;
00240     WCHAR    szLimit[MAX_PATH] = {0};
00241     HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);
00242
00243     wprintf(L"\n\nEnter the new default hard limit in Bytes ");
00244     wprintf(L"(-1 == No Limit): ");
00245
00246     // Get the limit from the command prompt
00247     ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
00248     LfcrToNull(szLimit);
00249     llLimit = _wtoi64(szLimit);
00250
00251     if (llLimit < -1)
00252     {
00253         wprintf(L"\nInvalid limit!");
00254         return FALSE;
00255     }
00256
00257     // Set the default hard quota limit
00258     hr = lpDiskQuotaControl->SetDefaultQuotaLimit(llLimit);
00259
00260     if (FAILED(hr))
00261     {
00262         PrintError(hr);
00263         return FALSE;
00264     }
00265
00266     return TRUE;
00267 }
00268
00269 /*-----------------------------------------------------------------------------
00270 SetDefaultThreshold(IDiskQuotaControl* lpDiskQuotaControl)
00271     Set the default warning threshold of the volume.
00272
00273 Parameters
00274     lpDiskQuotaControl - Pointer to an object that implements the
00275                          IDiskQuotaControl interface
00276
00277 Return Value
00278     TRUE - Success
00279     FALSE - Failure
00280 -----------------------------------------------------------------------------*/
00281 BOOL SetDefaultThreshold(IDiskQuotaControl* lpDiskQuotaControl)
00282 {
00283     HRESULT  hr;
00284     LONGLONG llLimit = 0;
00285     WCHAR    szLimit[MAX_PATH] = {0};
00286     DWORD    dwCharsRead;
00287     HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);
00288
00289     wprintf(L"\n\nEnter the new default threshold in Bytes ");
00290     wprintf(L"(-1 == No Limit): ");
00291
00292     // Get the limit from the command prompt
00293     ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
00294     LfcrToNull(szLimit);
00295     llLimit = _wtoi64(szLimit);
00296
00297     if (llLimit < -1)
00298     {
00299         wprintf(L"\nInvalid limit!");
00300         return FALSE;
00301     }
00302
00303     // Set the default warning threshold
00304     hr = lpDiskQuotaControl->SetDefaultQuotaThreshold(llLimit);
00305
00306     if (FAILED(hr))
00307     {
00308         PrintError(hr);
00309         return FALSE;
00310     }
00311
00312     return TRUE;
00313 }
00314
00315 /*-----------------------------------------------------------------------------
00316 SetUserHardLimit(IDiskQuotaControl* lpDiskQuotaControl)
00317     Set the hard quota limit for a specific user
00318
00319 Parameters
00320     lpDiskQuotaControl - Pointer to an object that implements the
00321                          IDiskQuotaControl interface
00322
00323 Return Value
00324     TRUE - Success
00325     FALSE - Failure
00326 -----------------------------------------------------------------------------*/
00327 BOOL SetUserHardLimit(IDiskQuotaControl* lpDiskQuotaControl)
00328 {
00329     HRESULT  hr;
00330     IDiskQuotaUser* lpDiskQuotaUser;
00331     WCHAR    szUser[MAX_PATH] = {0};
00332     WCHAR    szLimit[MAX_PATH] = {0};
00333     DWORD    dwCharsRead;
00334     LONGLONG llLimit = 0;
00335     HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);
00336
00337     wprintf(L"\n\nEnter the logon name of the user ");
00338     wprintf(L"(ie. DOMAIN\\USERNAME): ");
00339
00340     // Get the user for which to set a hard limit
00341     ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
00342     szUser[MAX_PATH-1] = L'\0'; // make sure szUSer is NULL terminated
00343
00344     // Strip the line feed and carriage return
00345     LfcrToNull(szUser);
00346
00347     // Check if the name is valid
00348     hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);
00349
00350     if (SUCCEEDED(hr))
00351     {
00352         wprintf(L"\nEnter the new hard limit in bytes (-1 == No Limit): ");
00353
00354         // Read the new hard limit from the console
00355         ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
00356         LfcrToNull(szLimit);
00357         llLimit = _wtoi64(szLimit);
00358
00359         if (llLimit >= -1)
00360         {
00361             // Set the hard quota limit for the user
00362             hr = lpDiskQuotaUser->SetQuotaLimit(llLimit, TRUE);
00363
00364             if (FAILED(hr))
00365             {
00366                 wprintf(L"\nCould not set the quota limit for ");
00367                 wprintf(L"%s to %i64 bytes\n", szUser, llLimit);
00368             }
00369         }
00370         else
00371         {
00372             wprintf(L"\nInvalid limit!");
00373         }
00374
00375         lpDiskQuotaUser->Release();
00376     }
00377     else
00378     {
00379         wprintf(L"\nCould not find quota data for %s\n", szUser);
00380     }
00381
00382     return SUCCEEDED(hr);
00383 }
00384
00385 /*-----------------------------------------------------------------------------
00386 SetUserThreshold(IDiskQuotaControl* lpDiskQuotaControl)
00387     Set the warning threshold limit for a specific user
00388
00389 Parameters
00390     lpDiskQuotaControl - Pointer to an object that implements the
00391                          IDiskQuotaControl interface
00392
00393 Return Value
00394     TRUE - Success
00395     FALSE - Failure
00396 -----------------------------------------------------------------------------*/
00397 BOOL SetUserThreshold(IDiskQuotaControl* lpDiskQuotaControl)
00398 {
00399     HRESULT  hr;
00400     IDiskQuotaUser* lpDiskQuotaUser;
00401     WCHAR    szUser[MAX_PATH] = {0};
00402     DWORD    dwCharsRead;
00403     LONGLONG llLimit = 0;
00404     HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);
00405
00406     wprintf(L"\n\nEnter the logon name of the user ");
00407     wprintf(L"(ie. DOMAIN\\USERNAME): ");
00408
00409     // Get the user for which to set a hard limit
00410     ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
00411
00412     szUser[MAX_PATH-1] = L'\0'; // make sure szUSer is NULL terminated
00413
00414     // Strip the line feed and carriage return
00415     LfcrToNull(szUser);
00416
00417     // Check if the name is valid
00418     hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);
00419
00420     if (SUCCEEDED(hr))
00421     {
00422         WCHAR    szLimit[MAX_PATH] = {0};
00423         wprintf(L"\nEnter the new hard limit in bytes (-1 == No Limit): ");
00424
00425         // Read the threshold from the console
00426         ReadConsole(hStdIn, szLimit, MAX_PATH, &dwCharsRead, NULL);
00427         LfcrToNull(szLimit);
00428         llLimit = _wtoi64(szLimit);
00429
00430         if (llLimit >= -1)
00431         {
00432             // Set the warning threshold for the user
00433             hr = lpDiskQuotaUser->SetQuotaThreshold(llLimit, TRUE);
00434
00435             if (FAILED(hr))
00436             {
00437                 wprintf(L"\nCould not set the quota limit for %s", szUser);
00438                 wprintf(L"to %i64 bytes\n", llLimit);
00439             }
00440         }
00441         else
00442         {
00443             wprintf(L"\nInvalid limit!");
00444         }
00445         lpDiskQuotaUser->Release();
00446     }
00447     else
00448     {
00449         PrintError(hr);
00450     }
00451
00452     return SUCCEEDED(hr);
00453 }
00454
00455 /*-----------------------------------------------------------------------------
00456 GetUserQuotaInfo(IDiskQuotaControl* lpDiskQuotaControl)
00457     Get quota information for a specific user
00458
00459 Parameters
00460     lpDiskQuotaControl - Pointer to an object that implements the
00461                          IDiskQuotaControl interface
00462
00463 Return Value
00464     TRUE - Success
00465     FALSE - Failure
00466 -----------------------------------------------------------------------------*/
00467 BOOL GetUserQuotaInfo(IDiskQuotaControl* lpDiskQuotaControl)
00468 {
00469     WCHAR    szUser[MAX_PATH] = {0};
00470     IDiskQuotaUser* lpDiskQuotaUser;
00471     DWORD    dwCharsRead;
00472     HANDLE   hStdIn  = GetStdHandle(STD_INPUT_HANDLE);
00473     HRESULT  hr;
00474
00475     wprintf(L"\n\nEnter the logon name of the user");
00476     wprintf(L"(ie. DOMAIN\\USERNAME): ");
00477
00478     // Get the user for which to get quota information
00479     ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
00480     szUser[MAX_PATH-1] = L'\0'; // make sure szUser is NULL terminated
00481     LfcrToNull(szUser);
00482
00483     // Check if the name is valid
00484     hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);
00485     if (SUCCEEDED(hr))
00486     {
00487         WCHAR    szQuotaUsedText[MAX_PATH] = {0};
00488         WCHAR    szQuotaLimitText[MAX_PATH] = {0};
00489         WCHAR    szQuotaThresholdText[MAX_PATH] = {0};
00490
00491         if (SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaThresholdText(
00492                                     szQuotaThresholdText, MAX_PATH))         &&
00493             SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaLimitText(
00494                                     szQuotaLimitText, MAX_PATH))             &&
00495             SUCCEEDED(hr = lpDiskQuotaUser->GetQuotaUsedText(
00496                                     szQuotaUsedText, MAX_PATH)))
00497         {
00498             szQuotaUsedText[MAX_PATH-1] = L'\0'; // make sure szQuotaUsedText is NULL terminated
00499             szQuotaLimitText[MAX_PATH-1] = L'\0'; // make sure szQuotaLimitText is NULL terminated
00500             szQuotaThresholdText[MAX_PATH-1] = L'\0'; // make sure szQuotaThresholdText is NULL terminated
00501
00502             wprintf(L"Amount Used        Limit    Threshold\n");
00503             wprintf(L"-----------        -----    ---------\n");
00504             wprintf(L"   %10s", szQuotaUsedText);
00505             wprintf(L"   %10s", szQuotaLimitText);
00506             wprintf(L"   %10s", szQuotaThresholdText);
00507             wprintf(L"\n");
00508         }
00509         else
00510         {
00511             wprintf(L"\nCould not get the quota information for %s", szUser);
00512         }
00513
00514         lpDiskQuotaUser->Release();
00515     }
00516     else
00517     {
00518         wprintf(L"\nCould not find quota data for %s\n", szUser);
00519     }
00520
00521     WaitForKeyPress();
00522
00523     return SUCCEEDED(hr);
00524 }
00525
00526 /*-----------------------------------------------------------------------------
00527 AddUser(IDiskQuotaControl* lpDiskQuotaControl)
00528     Add a user for which to track quota data
00529
00530 Parameters
00531     lpDiskQuotaControl - Pointer to an object that implements the
00532                          IDiskQuotaControl interface
00533
00534 Return Value
00535     TRUE - Success
00536     FALSE - Failure
00537 -----------------------------------------------------------------------------*/
00538 BOOL AddUser(IDiskQuotaControl* lpDiskQuotaControl)
00539 {
00540     HRESULT  hr;
00541     IDiskQuotaUser* lpDiskQuotaUser;
00542     WCHAR    szUser[MAX_PATH] = {0};
00543     DWORD    dwCharsRead;
00544     HANDLE   hStdIn = GetStdHandle(STD_INPUT_HANDLE);
00545
00546     wprintf(L"\n\nEnter the logon name of the user (ie. DOMAIN\\USERNAME): ");
00547
00548     // Get the user for which to track quota information
00549     ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
00550     LfcrToNull(szUser);
00551
00552     // Add the user
00553     hr = lpDiskQuotaControl->AddUserName(szUser,
00554                                 DISKQUOTA_USERNAME_RESOLVE_SYNC,
00555                                 &lpDiskQuotaUser);
00556
00557     if (FAILED(hr))
00558     {
00559         PrintError(hr);
00560         return FALSE;
00561     }
00562     lpDiskQuotaUser->Release();
00563
00564     return TRUE;
00565 }
00566
00567 /*-----------------------------------------------------------------------------
00568 DeleteUser(IDiskQuotaControl* lpDiskQuotaControl)
00569     Add a user for which to track quota data
00570
00571 Parameters
00572     lpDiskQuotaControl - Pointer to an object that implements the
00573                          IDiskQuotaControl interface
00574
00575 Return Value
00576     TRUE - Success
00577     FALSE - Failure
00578 -----------------------------------------------------------------------------*/
00579 BOOL DeleteUser(IDiskQuotaControl* lpDiskQuotaControl)
00580 {
00581     HRESULT         hr;
00582     IDiskQuotaUser* lpDiskQuotaUser;
00583     WCHAR           szUser[MAX_PATH] = {0};
00584     DWORD           dwCharsRead;
00585     HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
00586
00587     wprintf(L"\n\nEnter the logon name of the user (ie. DOMAIN\\USERNAME): ");
00588
00589     // Get the user for which to track quota information
00590     ReadConsole(hStdIn, szUser, MAX_PATH, &dwCharsRead, NULL);
00591     LfcrToNull(szUser);
00592
00593     // Check if the name is valid
00594     hr = lpDiskQuotaControl->FindUserName((LPCWSTR)szUser, &lpDiskQuotaUser);
00595
00596     if (SUCCEEDED(hr))
00597     {
00598         // Delete the user
00599         hr = lpDiskQuotaControl->DeleteUser(lpDiskQuotaUser);
00600
00601         if (FAILED(hr))
00602         {
00603             wprintf(L"\nCould not delete the user.");
00604         }
00605
00606         lpDiskQuotaUser->Release();
00607     }
00608     else
00609     {
00610         PrintError(hr);
00611     }
00612
00613     return SUCCEEDED(hr);
00614 }
00615
00616 /*-----------------------------------------------------------------------------
00617 EnumerateUsers(IDiskQuotaControl* lpDiskQuotaControl)
00618     Enumerate through all of the disk quota users
00619
00620 Parameters
00621     lpDiskQuotaControl - Pointer to an object that implements the
00622                          IDiskQuotaControl interface
00623
00624 Return Value
00625     TRUE - Success
00626     FALSE - Failure
00627 -----------------------------------------------------------------------------*/
00628 BOOL EnumerateUsers(IDiskQuotaControl* lpDiskQuotaControl)
00629 {
00630     HRESULT              hr;
00631     IEnumDiskQuotaUsers* lpEnumDiskQuotaUsers;
00632     IDiskQuotaUser*      lpDiskQuotaUser;
00633     DWORD                dwUsersFetched;
00634
00635     // Create an enumerator object to enumerate quota users on the volume.
00636     hr = lpDiskQuotaControl->CreateEnumUsers(NULL, 0,
00637                                              DISKQUOTA_USERNAME_RESOLVE_SYNC,
00638                                              &lpEnumDiskQuotaUsers);
00639     if (SUCCEEDED(hr))
00640     {
00641         WCHAR szLogonName[MAX_PATH];
00642
00643         wprintf(L"\n\nLogon name\n");
00644         wprintf(L"----------\n");
00645
00646         // Enumerate through all of the quota users
00647         while(SUCCEEDED(hr) &&
00648               S_OK == lpEnumDiskQuotaUsers->
00649                       Next(1, &lpDiskQuotaUser, &dwUsersFetched))
00650         {
00651             // Retrieve the name strings associated with this disk quota user.
00652             if (SUCCEEDED(hr = lpDiskQuotaUser->GetName(NULL, 0, szLogonName,
00653                                                         MAX_PATH, NULL, 0)))
00654             {
00655                 szLogonName[MAX_PATH-1] = L'\0'; // make sure szLogonName is NULL terminated
00656                 wprintf(L"%s\n", szLogonName);
00657                 lpDiskQuotaUser->Release();
00658             }
00659         }
00660         lpEnumDiskQuotaUsers->Release();
00661     }
00662
00663     if (FAILED(hr)) PrintError(hr);
00664     WaitForKeyPress();
00665
00666     return SUCCEEDED(hr);
00667 }
00668
00669 /*-----------------------------------------------------------------------------
00670 EnumerateUserQuotas(IDiskQuotaControl* lpDiskQuotaControl)
00671     Enumerate through all user's and their quota's
00672
00673 Parameters
00674     lpDiskQuotaControl - Pointer to an object that implements the
00675                          IDiskQuotaControl interface
00676
00677 Return Value
00678     TRUE - Success
00679     FALSE - Failure
00680 -----------------------------------------------------------------------------*/
00681 BOOL EnumerateUserQuotas(IDiskQuotaControl* lpDiskQuotaControl)
00682 {
00683     HRESULT              hr;
00684     IEnumDiskQuotaUsers* lpEnumDiskQuotaUsers;
00685
00686     // Create an enumerator object to enumerate quota users on the volume.
00687     hr = lpDiskQuotaControl->CreateEnumUsers(NULL, 0,
00688                                              DISKQUOTA_USERNAME_RESOLVE_SYNC,
00689                                              &lpEnumDiskQuotaUsers);
00690     if (SUCCEEDED(hr))
00691     {
00692         IDiskQuotaUser*      lpDiskQuotaUser;
00693         DWORD                dwUsersFetched;
00694         WCHAR                szLogonName[MAX_PATH];
00695         WCHAR                szQuotaUsedText[MAX_PATH];
00696         WCHAR                szQuotaLimitText[MAX_PATH];
00697         WCHAR                szQuotaThresholdText[MAX_PATH];
00698         DISKQUOTA_USER_INFORMATION dqUserInfo;
00699
00700         wprintf(L"\n\nStatus               Logon Name  ");
00701         wprintf(L"Amount Used        Limit    Threshold\n");
00702         wprintf(L"------               ----------  ");
00703         wprintf(L"-----------        -----    ---------\n");
00704
00705         // Enumerate through all of the quota users
00706         while(SUCCEEDED(hr) &&
00707               S_OK == lpEnumDiskQuotaUsers->
00708                         Next(1, &lpDiskQuotaUser, &dwUsersFetched))
00709         {
00710             if (SUCCEEDED(hr = lpDiskQuotaUser->
00711                     GetName(NULL, 0, szLogonName, MAX_PATH, NULL, 0))      &&
00712                 SUCCEEDED(hr = lpDiskQuotaUser->
00713                     GetQuotaThresholdText(szQuotaThresholdText, MAX_PATH)) &&
00714                 SUCCEEDED(hr = lpDiskQuotaUser->
00715                     GetQuotaLimitText(szQuotaLimitText, MAX_PATH))         &&
00716                 SUCCEEDED(hr = lpDiskQuotaUser->
00717                     GetQuotaUsedText(szQuotaUsedText, MAX_PATH))           &&
00718                 SUCCEEDED(hr = lpDiskQuotaUser->
00719                     GetQuotaInformation((LPVOID)&dqUserInfo,
00720                         sizeof(DISKQUOTA_USER_INFORMATION))))
00721             {
00722                 szLogonName[MAX_PATH - 1] = L'\0'; // Make sure szLogonName is NULL terminated
00723                 szQuotaUsedText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaUsedText is NULL terminated
00724                 szQuotaLimitText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaLimitText is NULL terminated
00725                 szQuotaThresholdText[MAX_PATH - 1] = L'\0'; // Make sure szQuotaThresholdText is NULL terminated
00726
00727                 // Check if the user is exceeding their threshold
00728                 if ((dqUserInfo.QuotaUsed > dqUserInfo.QuotaThreshold) &&
00729                     (dqUserInfo.QuotaThreshold >= 0))
00730                 {
00731                     wprintf(L"Warning ");
00732                 }
00733                 else
00734                 {
00735                     wprintf(L"OK      ");
00736                 }
00737
00738                 wprintf(L"%23s", szLogonName);
00739                 wprintf(L"   %10s", szQuotaUsedText);
00740                 wprintf(L"   %10s", szQuotaLimitText);
00741                 wprintf(L"   %10s", szQuotaThresholdText);
00742                 wprintf(L"\n");
00743             }
00744             else
00745             {
00746                 szLogonName[MAX_PATH - 1] = L'\0'; // Make sure szLogonName is NULL terminated
00747
00748                 wprintf(L"Could not retrieve %s's quota information\n",
00749                          szLogonName);
00750             }
00751             lpDiskQuotaUser->Release();
00752         }
00753         lpEnumDiskQuotaUsers->Release();
00754     }
00755     else
00756     {
00757         PrintError(hr);
00758     }
00759
00760     WaitForKeyPress();
00761
00762     return SUCCEEDED(hr);
00763 }
00764
00765 /*-----------------------------------------------------------------------------
00766 PrintError(HRESULT hr)
00767     Print out the error message that corresponds to the error code
00768
00769 Parameters
00770     hr - Error code
00771
00772 Return Value
00773     None
00774 -----------------------------------------------------------------------------*/
00775 void PrintError(HRESULT hr)
00776 {
00777     LPVOID lpMsgBuf;
00778
00779     // Format the error message
00780     if (!FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
00781                   FORMAT_MESSAGE_FROM_SYSTEM     |
00782                   FORMAT_MESSAGE_IGNORE_INSERTS,
00783                   NULL,
00784                   hr,
00785                   MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Defaut lang
00786                   (LPWSTR) &lpMsgBuf,
00787                   0,
00788                   NULL ))
00789     {
00790         wprintf(L"Unknown error occured\n");
00791         return;
00792     }
00793
00794     // Display the string
00795     wprintf(L"\n%s", (LPCWSTR)lpMsgBuf);
00796
00797     // Free the buffer
00798     LocalFree( lpMsgBuf );
00799
00800     WaitForKeyPress();
00801 }
00802
00803 /*-----------------------------------------------------------------------------
00804 LfcrToNull(LPWSTR szString)
00805     Replace the line feed/carriage return on a string w/ a terminating NULL
00806
00807 Parameters
00808     szString - String that contains a LFCR
00809
00810 Return Value
00811     None
00812 -----------------------------------------------------------------------------*/
00813 void LfcrToNull(LPWSTR szString)
00814 {
00815     WCHAR* szLfcr;
00816
00817     szLfcr = wcsstr(szString, L"\r\n");
00818
00819     if (szLfcr) *szLfcr = L'\0';
00820 }
00821
00822 /*-----------------------------------------------------------------------------
00823 WaitForKeyPress()
00824     Prompt the user to press a key before continuing
00825
00826 Parameters
00827     None
00828
00829 Return Value
00830     None
00831 -----------------------------------------------------------------------------*/
00832 void WaitForKeyPress()
00833 {
00834     HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
00835     INPUT_RECORD sInputRecord;
00836     DWORD        dwInputEvents;
00837
00838     wprintf(L"\nPress any key to continue: ");
00839     ReadConsoleInput(hStdIn,&sInputRecord,1 ,&dwInputEvents);
00840     while (!((sInputRecord.EventType == KEY_EVENT) &&             (sInputRecord.Event.KeyEvent.bKeyDown)))
00841     {
00842         FlushConsoleInputBuffer(hStdIn);
00843         ReadConsoleInput(hStdIn,&sInputRecord,1 ,&dwInputEvents);
00844     }
00845 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/prsample/resource.h Source File

  • Dataaccess
  • oledb
  • prsample

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by PRSample.rc
00004 //
00005
00006 // Next default values for new objects
00007 //
00008 #ifdef APSTUDIO_INVOKED
00009 #ifndef APSTUDIO_READONLY_SYMBOLS
00010 #define _APS_NEXT_RESOURCE_VALUE        101
00011 #define _APS_NEXT_COMMAND_VALUE         40006
00012 #define _APS_NEXT_CONTROL_VALUE         1000
00013 #define _APS_NEXT_SYMED_VALUE           101
00014 #endif
00015 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/xml/mfc_tree/resource.h Source File

  • Web
  • xml
  • mfc_tree

resource.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 // resource.h
00011
00012 //{{NO_DEPENDENCIES}}
00013 // Microsoft Developer Studio generated include file.
00014 // Used by XMLTree.rc
00015 //
00016 #define IDM_ABOUTBOX                    0x0010
00017 #define IDD_ABOUTBOX                    100
00018 #define IDS_ABOUTBOX                    101
00019 #define IDD_XMLTREE_DIALOG              102
00020 #define IDR_XMLTREE                     128
00021 #define IDB_TREEICON                    129
00022 #define IDC_DEBUG                       1000
00023 #define IDC_TREE                        1001
00024 #define IDC_LOAD                        1002
00025 #define IDC_FILENAME                    1003
00026 #define IDC_OPEN                        1004
00027
00028 // Next default values for new objects
00029 //
00030 #ifdef APSTUDIO_INVOKED
00031 #ifndef APSTUDIO_READONLY_SYMBOLS
00032 #define _APS_NEXT_RESOURCE_VALUE        130
00033 #define _APS_NEXT_COMMAND_VALUE         32771
00034 #define _APS_NEXT_CONTROL_VALUE         1005
00035 #define _APS_NEXT_SYMED_VALUE           101
00036 #endif
00037 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/HttpAuth/HttpAuth.c Source File

  • Security
  • SSPI
  • HttpAuth

HttpAuth.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009
00010 Module Name:
00011
00012     httpauth.c
00013
00014 Abstract:
00015
00016     Handles authentication sequence ( Basic & SSPI )
00017
00018 --*/
00019
00020 /************************************************************
00021  *    Include Headers
00022  ************************************************************/
00023
00024 #include <windows.h>
00025 #include <rpc.h>
00026 #include <winsock.h>
00027 #include <lm.h>
00028
00029 #include <stdio.h>
00030 #include <stdarg.h>
00031 #include <stdlib.h>
00032 #include <string.h>
00033 #include <tchar.h>
00034 #include <fcntl.h>
00035
00036 #define SECURITY_WIN32
00037 #include "sspi.h"
00038
00039 // declaration for this module
00040
00041 #include "httpauth.h"
00042
00043 #define SEC_SUCCESS(Status) ((Status) >= 0)
00044 #define STATUS_SUCCESS 0
00045
00046
00047 // Target name for the security package
00048
00049 #define TOKEN_SOURCE_NAME       "InetSvcs"
00050
00051
00052 // general purpose dynamic buffer structure
00053
00054 typedef struct _BUFFER {
00055     PBYTE pBuf;
00056     DWORD cLen;
00057 } BUFFER ;
00058
00059
00060 // structure storing the state of the authentication sequence
00061
00062 typedef struct _AUTH_SEQ {
00063     BOOL _fNewConversation;
00064     CredHandle _hcred;
00065     BOOL _fHaveCredHandle;
00066     DWORD _cbMaxToken;
00067     BOOL _fHaveCtxtHandle;
00068     struct _SecHandle  _hctxt;
00069     BOOL _fUUEncodeData;
00070 } AUTH_SEQ;
00071
00072 // entry points in the security DLL
00073
00074 typedef struct _SEC_FUNC {
00075     FREE_CREDENTIALS_HANDLE_FN pFreeCredentialsHandle;
00076     ACQUIRE_CREDENTIALS_HANDLE_FN pAcquireCredentialsHandle;
00077     QUERY_SECURITY_PACKAGE_INFO_FN pQuerySecurityPackageInfo;   // A
00078     FREE_CONTEXT_BUFFER_FN pFreeContextBuffer;
00079     INITIALIZE_SECURITY_CONTEXT_FN pInitializeSecurityContext;  // A
00080     COMPLETE_AUTH_TOKEN_FN pCompleteAuthToken;
00081     ENUMERATE_SECURITY_PACKAGES_FN pEnumerateSecurityPackages;  // A
00082     DELETE_SECURITY_CONTEXT_FN pDeleteSecurityContext;
00083 } SEC_FUNC;
00084
00085 // local functions
00086
00087 BOOL CrackUserAndDomain(
00088     CHAR *   pszDomainAndUser,
00089     CHAR * * ppszUser,
00090     CHAR * * ppszDomain
00091     );
00092
00093 BOOL AuthConverse(
00094     AUTH_SEQ *pAS,
00095     VOID   * pBuffIn,
00096     DWORD    cbBuffIn,
00097     BUFFER * pbuffOut,
00098     DWORD  * pcbBuffOut,
00099     BOOL   * pfNeedMoreData,
00100     CHAR   * pszPackage,
00101     CHAR   * pszUser,
00102     CHAR   * pszPassword
00103     );
00104
00105 BOOL AuthInit( AUTH_SEQ *pAS );
00106
00107 void AuthTerminate( AUTH_SEQ *pAS );
00108
00109
00110 // uuencode/decode routines declaration
00111 // used to code the authentication blob
00112
00113 BOOL uudecode(char   * bufcoded,
00114               BUFFER * pbuffdecoded,
00115               DWORD  * pcbDecoded );
00116 BOOL uuencode( BYTE *   bufin,
00117                DWORD    nbytes,
00118                BUFFER * pbuffEncoded );
00119
00120
00121 /************************************************************
00122  *    Globals for this module
00123  ************************************************************/
00124
00125 static BOOL g_fAuth = FALSE;
00126 static BOOL g_fBasic = FALSE;
00127 static AUTH_SEQ g_Auth;
00128 static HINSTANCE g_hSecLib = NULL;
00129 static SEC_FUNC sfProcs;
00130
00131
00132 /************************************************************
00133  *    Helper functions
00134  ************************************************************/
00135
00136 BOOL BufferInit( BUFFER *pB )
00137 {
00138     pB->pBuf = NULL;
00139     pB->cLen = 0;
00140
00141     return TRUE;
00142 }
00143
00144
00145 void BufferTerminate( BUFFER *pB )
00146 {
00147     if ( pB->pBuf != NULL )
00148     {
00149         free( pB->pBuf );
00150         pB->pBuf = NULL;
00151         pB->cLen = 0;
00152     }
00153 }
00154
00155
00156 PBYTE BufferQueryPtr( BUFFER * pB )
00157 {
00158     return pB->pBuf;
00159 }
00160
00161
00162 BOOL BufferResize( BUFFER *pB, DWORD cNewL )
00163 {
00164     PBYTE pN;
00165     if ( cNewL > pB->cLen )
00166     {
00167         pN = malloc( cNewL );
00168         if ( pB->pBuf )
00169         {
00170             memcpy( pN, pB->pBuf, pB->cLen );
00171             free( pB->pBuf );
00172         }
00173         pB->pBuf = pN;
00174         pB->cLen = cNewL;
00175     }
00176
00177     return TRUE;
00178 }
00179
00180
00181 /************************************************************
00182  *    Authentication functions
00183  ************************************************************/
00184
00185
00186 BOOL
00187 InitAuthorizationHeader(
00188     )
00189 /*++
00190
00191  Routine Description:
00192
00193     Initialize the authentication package
00194
00195  Arguments:
00196
00197     None
00198
00199  Return Value:
00200
00201     Returns TRUE is successful; otherwise FALSE is returned.
00202
00203 --*/
00204 {
00205     OSVERSIONINFO   VerInfo;
00206     UCHAR lpszDLL[MAX_PATH];
00207
00208     //
00209     //  Find out which security DLL to use, depending on
00210     //  whether we are on NT or Win95
00211     //
00212     VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
00213     if (!GetVersionEx (&VerInfo))   // If this fails, something has gone wrong
00214     {
00215         return FALSE;
00216     }
00217
00218     if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
00219     {
00220         strcpy (lpszDLL, "security.dll" );
00221     }
00222     else if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
00223     {
00224         strcpy (lpszDLL, "secur32.dll" );
00225     }
00226     else
00227     {
00228         return FALSE;
00229     }
00230
00231     //
00232     //  Load Security DLL
00233     //
00234
00235     g_hSecLib = LoadLibrary (lpszDLL);
00236     if (g_hSecLib == NULL)
00237     {
00238         return FALSE;
00239     }
00240
00241     // Get all entry points we care about
00242
00243     sfProcs.pFreeCredentialsHandle
00244             = (FREE_CREDENTIALS_HANDLE_FN) GetProcAddress(
00245                     g_hSecLib,
00246                     "FreeCredentialsHandle" );
00247
00248     sfProcs.pQuerySecurityPackageInfo
00249             = (QUERY_SECURITY_PACKAGE_INFO_FN) GetProcAddress(
00250                     g_hSecLib,
00251                     "QuerySecurityPackageInfoA" );
00252
00253     sfProcs.pAcquireCredentialsHandle
00254             = (ACQUIRE_CREDENTIALS_HANDLE_FN) GetProcAddress(
00255                     g_hSecLib,
00256                     "AcquireCredentialsHandleA" );
00257
00258     sfProcs.pFreeContextBuffer
00259             = (FREE_CONTEXT_BUFFER_FN) GetProcAddress(
00260                     g_hSecLib,
00261                     "FreeContextBuffer" );
00262
00263     sfProcs.pInitializeSecurityContext
00264             = (INITIALIZE_SECURITY_CONTEXT_FN) GetProcAddress(
00265                     g_hSecLib,
00266                     "InitializeSecurityContextA" );
00267
00268     sfProcs.pCompleteAuthToken
00269             = (COMPLETE_AUTH_TOKEN_FN) GetProcAddress(
00270                     g_hSecLib,
00271                     "CompleteAuthToken" );
00272
00273     sfProcs.pEnumerateSecurityPackages
00274             = (ENUMERATE_SECURITY_PACKAGES_FN) GetProcAddress(
00275                     g_hSecLib,
00276                     "EnumerateSecurityPackagesA" );
00277
00278     sfProcs.pDeleteSecurityContext
00279             = (DELETE_SECURITY_CONTEXT_FN) GetProcAddress(
00280                     g_hSecLib,
00281                     "DeleteSecurityContext" );
00282
00283     if ( sfProcs.pFreeCredentialsHandle == NULL
00284             || sfProcs.pQuerySecurityPackageInfo == NULL
00285             || sfProcs.pAcquireCredentialsHandle == NULL
00286             || sfProcs.pFreeContextBuffer == NULL
00287             || sfProcs.pInitializeSecurityContext == NULL
00288             || sfProcs.pEnumerateSecurityPackages == NULL )
00289     {
00290         FreeLibrary( g_hSecLib );
00291         g_hSecLib = NULL;
00292         return FALSE;
00293     }
00294
00295     g_fAuth = g_fBasic = FALSE;
00296
00297     return TRUE;
00298 }
00299
00300
00301 void
00302 TerminateAuthorizationHeader(
00303     )
00304 /*++
00305
00306  Routine Description:
00307
00308     Terminate the authentication package
00309
00310  Arguments:
00311
00312     None
00313
00314  Return Value:
00315
00316     None
00317
00318 --*/
00319 {
00320     if ( g_fAuth )
00321     {
00322         AuthTerminate( &g_Auth );
00323         g_fAuth = FALSE;
00324     }
00325
00326     g_fBasic = FALSE;
00327
00328     if ( g_hSecLib != NULL )
00329     {
00330         FreeLibrary( g_hSecLib );
00331         g_hSecLib = NULL;
00332     }
00333 }
00334
00335
00336 BOOL
00337 IsInAuthorizationSequence(
00338     )
00339 /*++
00340
00341  Routine Description:
00342
00343     Indicates if in authentication sequence
00344
00345  Arguments:
00346
00347     None
00348
00349  Return Value:
00350
00351     Returns TRUE is successful; otherwise FALSE is returned.
00352
00353 --*/
00354 {
00355     return g_fAuth || g_fBasic;
00356 }
00357
00358
00359 BOOL
00360 ValidateAuthenticationMethods(
00361     PSTR pszMet,
00362     PSTR pszPreferedMet )
00363 /*++
00364
00365  Routine Description:
00366
00367     Filter the supplied authentication list for supported
00368     methods ( Basic and all local security packages )
00369
00370  Arguments:
00371
00372     None
00373
00374  Return Value:
00375
00376     Returns TRUE if at least one authentication method supported,
00377     otherwise FALSE is returned.
00378
00379 --*/
00380 {
00381     PSecPkgInfo pSec=NULL;
00382     ULONG cSec, iS;
00383     BOOL fValid;
00384     PSTR p,t;
00385     SECURITY_STATUS ss;
00386
00387
00388     // access local security packages list
00389
00390     if ( (ss = sfProcs.pEnumerateSecurityPackages( &cSec, &pSec ))
00391             == STATUS_SUCCESS )
00392     {
00393         for ( t = p = pszMet ; *p ; )
00394         {
00395             // Valid methods are "Basic" and all security packages
00396
00397             if ( !_stricmp( p , "Basic" ) )
00398                 fValid = TRUE;
00399             else for ( iS = 0 ; iS < cSec ; ++iS )
00400                 if ( !_stricmp( pSec[iS].Name, p ) )
00401                     break;
00402
00403             if ( fValid )
00404             {
00405                 if ( t != p )
00406                     memmove( t, p, strlen(p)+1 );
00407                 p += strlen( p ) + 1;
00408                 t += strlen( t ) + 1;
00409             }
00410         }
00411         *t = '\0';
00412     }
00413
00414     // free up the info buffer
00415     if(pSec)
00416         sfProcs.pFreeContextBuffer(pSec);
00417
00418     // check for prefered method
00419
00420     if ( pszPreferedMet != NULL )
00421     {
00422         PSTR pP;
00423
00424         for ( pP = strtok( pszPreferedMet, "," ) ;
00425                 pP != NULL ;
00426                 pP = strtok( NULL, "," ) )
00427         {
00428             // scan list of validated methods for the current
00429             // prefered method
00430
00431             for ( p = pszMet ; *p ; )
00432             {
00433                 if ( !_stricmp( pP, p ) )
00434                 {
00435                     memmove( pszMet, p, strlen(p) + 1 );
00436                     return TRUE;
00437                 }
00438                 p += strlen( p ) + 1;
00439             }
00440         }
00441
00442         // no method in the prefered method list is supported
00443
00444         return FALSE;
00445     }
00446
00447     // no prefered method list supplied
00448
00449     return *pszMet ? TRUE : FALSE;
00450 }
00451
00452
00453 BOOL
00454 AddAuthorizationHeader(
00455     PSTR pch,
00456     PSTR pchSchemes,
00457     PSTR pchAuthData,
00458     PSTR pchUserName,
00459     PSTR pchPassword,
00460     BOOL *pfNeedMoreData
00461     )
00462 /*++
00463
00464  Routine Description:
00465
00466     Generates an authentication header to be sent to the server.
00467     An authentication sequence will be initiated if none is in
00468     use and at least one of the authentication scheme specified
00469     in pchSchemes is recognized.
00470     Otherwise the current authentication sequence will proceed.
00471
00472  Arguments:
00473
00474     pch                 where to append authentication header
00475     pchSchemes          list of null-delimited authentication methods
00476     pchAuthData         incoming blob from server
00477     pchUserName         user name ( possibly prefixed with domain )
00478     pchPassword         password
00479     pfNeedMoreData      Out: TRUE if authentication sequence to continue
00480
00481  Return Value:
00482
00483     Returns TRUE is successful; otherwise FALSE is returned.
00484
00485 --*/
00486 {
00487     CHAR   achUserAndPass[256];
00488     BUFFER buff;
00489     BOOL fSt = TRUE;
00490     DWORD cbOut;
00491
00492
00493     BufferInit( &buff );
00494
00495     while ( *pchSchemes )
00496     {
00497         if ( !stricmp( pchSchemes, "Basic" ))
00498         {
00499             // if already in authentication sequence, it failed.
00500
00501             if ( g_fBasic )
00502             {
00503                 SetLastError( ERROR_ACCESS_DENIED );
00504                 fSt = FALSE;
00505                 break;
00506             }
00507
00508             strcpy( achUserAndPass, pchUserName );
00509             strcat( achUserAndPass, ":" );
00510             strcat( achUserAndPass, pchPassword );
00511
00512             uuencode( (BYTE *) achUserAndPass,
00513                       (DWORD)strlen( achUserAndPass ),
00514                       &buff );
00515             strcat( pch, "Authorization: " );
00516             strcat( pch, "Basic " );
00517             strcat( pch, BufferQueryPtr( &buff ));
00518             strcat( pch, "\r\n");
00519             g_fBasic = TRUE;
00520             break;
00521         }
00522         else
00523         {
00524             // SSPI package ( assuming methods list have been validated )
00525
00526             if ( !g_fAuth )
00527             {
00528                 if ( !AuthInit( &g_Auth ) )
00529                 {
00530                     fSt = FALSE;
00531                     goto ex;
00532                 }
00533             }
00534             else if ( pchAuthData == NULL || *pchAuthData == '\0' )
00535             {
00536                 // no blob while in authentication sequence : it failed
00537
00538                 SetLastError( ERROR_ACCESS_DENIED );
00539                 fSt = FALSE;
00540                 break;
00541             }
00542
00543             if ( !AuthConverse( &g_Auth,
00544                   (void *) pchAuthData,
00545                   0,
00546                   &buff,
00547                   &cbOut,
00548                   pfNeedMoreData,
00549                   pchSchemes,
00550                   pchUserName,
00551                   pchPassword ))
00552             {
00553                 fSt = FALSE;
00554                 goto ex;
00555             }
00556
00557             strcat( pch, "Authorization: " );
00558             strcat( pch, pchSchemes );
00559             strcat( pch, " " );
00560             strcat( pch, (CHAR *) BufferQueryPtr( &buff ) );
00561             strcat( pch, "\r\n" );
00562             break;
00563         }
00564
00565         pchSchemes += strlen(pchSchemes) + 1;
00566     }
00567 ex:
00568     BufferTerminate( &buff );
00569
00570     return fSt;
00571 }
00572
00573
00574 BOOL
00575 AuthInit(
00576     AUTH_SEQ *pAS )
00577 /*++
00578
00579  Routine Description:
00580
00581     Initialize a SSP authentication sequence
00582
00583  Arguments:
00584
00585     None
00586
00587  Return Value:
00588
00589     Returns TRUE is successful; otherwise FALSE is returned.
00590
00591 --*/
00592 {
00593     pAS->_fNewConversation = TRUE;
00594     pAS->_fHaveCredHandle = FALSE;
00595     pAS->_fHaveCtxtHandle = FALSE;
00596     pAS->_fUUEncodeData = TRUE;
00597
00598     g_fAuth = TRUE;
00599
00600     return TRUE;
00601 }
00602
00603
00604 void
00605 AuthTerminate(
00606     AUTH_SEQ *pAS )
00607 /*++
00608
00609  Routine Description:
00610
00611     Terminate a SSP authentication sequence
00612
00613  Arguments:
00614
00615     None
00616
00617  Return Value:
00618
00619     None
00620
00621 --*/
00622 {
00623     if ( pAS->_fHaveCredHandle )
00624         sfProcs.pFreeCredentialsHandle( &pAS->_hcred );
00625
00626     pAS->_fHaveCredHandle = FALSE;
00627
00628     if ( pAS->_fHaveCtxtHandle )
00629         sfProcs.pDeleteSecurityContext( &pAS->_hctxt );
00630
00631     pAS->_fHaveCtxtHandle = FALSE;
00632 }
00633
00634
00635 BOOL
00636 AuthConverse(
00637     AUTH_SEQ *pAS,
00638     VOID   * pBuffIn,
00639     DWORD    cbBuffIn,
00640     BUFFER * pbuffOut,
00641     DWORD  * pcbBuffOut,
00642     BOOL   * pfNeedMoreData,
00643     CHAR   * pszPackage,
00644     CHAR   * pszUser,
00645     CHAR   * pszPassword
00646     )
00647 /*++
00648
00649 Routine Description:
00650
00651     Initiates or continues a previously initiated authentication conversation
00652
00653     Client calls this first to get the negotiation message which
00654     it then sends to the server.  The server calls this with the
00655     client result and sends back the result.  The conversation
00656     continues until *pfNeedMoreData is FALSE.
00657
00658     On the first call, pszPackage must point to the zero terminated
00659     authentication package name to be used and pszUser and pszPassword
00660     should point to the user name and password to authenticated with
00661     on the client side (server side will always be NULL).
00662
00663 Arguments:
00664
00665     pBuffIn - Points to SSP message received from the
00666         client.  If UUENCODE is used, then this must point to a
00667         zero terminated uuencoded string (except for the first call).
00668     cbBuffIn - Number of bytes in pBuffIn or zero if pBuffIn points to a
00669         zero terminated, uuencoded string.
00670     pbuffOut - If *pfDone is not set to TRUE, this buffer contains the data
00671         that should be sent to the other side.  If this is zero, then no
00672         data needs to be sent.
00673     pcbBuffOut - Number of bytes in pbuffOut
00674     pfNeedMoreData - Set to TRUE while this side of the conversation is
00675         expecting more data from the remote side.
00676     pszPackage - On the first call points to a zero terminate string indicating
00677         the security package to use
00678     pszUser - Specifies user or domain\user the first time the client calls
00679         this method (client side only)
00680     pszPassword - Specifies the password for pszUser the first time the
00681         client calls this method (client side only)
00682
00683 Return Value:
00684
00685     TRUE if successful, FALSE otherwise (call GetLastError).  Access is
00686     denied if FALSE is returned and GetLastError is ERROR_ACCESS_DENIED.
00687
00688 --*/
00689 {
00690     SECURITY_STATUS       ss;
00691     TimeStamp             Lifetime;
00692     SecBufferDesc         OutBuffDesc;
00693     SecBuffer             OutSecBuff;
00694     SecBufferDesc         InBuffDesc;
00695     SecBuffer             InSecBuff;
00696     ULONG                 ContextAttributes;
00697     BUFFER                buffData;
00698     BUFFER                buff;
00699     BOOL                  fSt;
00700     BOOL                  fReply;
00701
00702     BufferInit( &buffData );
00703     BufferInit( &buff );
00704
00705     //
00706     //  Decode the data if there's something to decode
00707     //
00708
00709     if ( pAS->_fUUEncodeData && pBuffIn )
00710     {
00711         if ( !uudecode( (CHAR *) pBuffIn,
00712                         &buffData,
00713                         &cbBuffIn ))
00714         {
00715             fSt = FALSE;
00716             goto ex;
00717         }
00718
00719         pBuffIn = BufferQueryPtr( &buffData );
00720     }
00721
00722     //
00723     //  If this is a new conversation, then we need to get the credential
00724     //  handle and find out the maximum token size
00725     //
00726
00727     if ( pAS->_fNewConversation )
00728     {
00729         SecPkgInfo *              pspkg;
00730         SEC_WINNT_AUTH_IDENTITY   AuthIdentity;
00731         SEC_WINNT_AUTH_IDENTITY * pAuthIdentity;
00732         CHAR *                    pszDomain = NULL;
00733         CHAR                      szDomainAndUser[DNLEN+UNLEN+2];
00734
00735
00736         //
00737         //  fill out the authentication information
00738         //
00739
00740         if ( ((pszUser != NULL) ||
00741               (pszPassword != NULL)) )
00742         {
00743             pAuthIdentity = &AuthIdentity;
00744
00745             //
00746             //  Break out the domain from the username if one was specified
00747             //
00748
00749             if ( pszUser != NULL )
00750             {
00751                 strcpy( szDomainAndUser, pszUser );
00752                 if ( !CrackUserAndDomain( szDomainAndUser,
00753                                           &pszUser,
00754                                           &pszDomain ))
00755                 {
00756                     return FALSE;
00757                 }
00758             }
00759
00760             memset( &AuthIdentity,
00761                     0,
00762                     sizeof( AuthIdentity ));
00763
00764             if ( pszUser != NULL )
00765             {
00766                 AuthIdentity.User       = (unsigned char *) pszUser;
00767                 AuthIdentity.UserLength = (ULONG)strlen( pszUser );
00768             }
00769
00770             if ( pszPassword != NULL )
00771             {
00772                 AuthIdentity.Password       = (unsigned char *) pszPassword;
00773                 AuthIdentity.PasswordLength = (ULONG)strlen( pszPassword );
00774             }
00775
00776             if ( pszDomain != NULL )
00777             {
00778                 AuthIdentity.Domain       = (unsigned char *) pszDomain;
00779                 AuthIdentity.DomainLength = (ULONG)strlen( pszDomain );
00780             }
00781
00782             AuthIdentity.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
00783         }
00784         else
00785         {
00786             pAuthIdentity = NULL;
00787         }
00788
00789         ss = sfProcs.pAcquireCredentialsHandle( NULL,    // New principal
00790                                        pszPackage,       // Package name
00791                                        SECPKG_CRED_OUTBOUND,
00792                                        NULL,             // Logon ID
00793                                        pAuthIdentity,    // Auth Data
00794                                        NULL,             // Get key func
00795                                        NULL,             // Get key arg
00796                                        &pAS->_hcred,
00797                                        &Lifetime );
00798
00799         //
00800         //  Need to determine the max token size for this package
00801         //
00802
00803         if ( ss == STATUS_SUCCESS )
00804         {
00805             pAS->_fHaveCredHandle = TRUE;
00806             ss = sfProcs.pQuerySecurityPackageInfo(
00807                         (char *) pszPackage,
00808                         &pspkg );
00809         }
00810
00811         if ( ss != STATUS_SUCCESS )
00812         {
00813             SetLastError( ss );
00814             return FALSE;
00815         }
00816
00817         pAS->_cbMaxToken = pspkg->cbMaxToken;
00818
00819         sfProcs.pFreeContextBuffer( pspkg );
00820
00821     }
00822
00823     //
00824     //  Prepare our output buffer.  We use a temporary buffer because
00825     //  the real output buffer will most likely need to be uuencoded
00826     //
00827
00828     if ( !BufferResize( &buff, pAS->_cbMaxToken ))
00829     {
00830         fSt = FALSE;
00831         goto ex;
00832     }
00833
00834     OutBuffDesc.ulVersion = 0;
00835     OutBuffDesc.cBuffers  = 1;
00836     OutBuffDesc.pBuffers  = &OutSecBuff;
00837
00838     OutSecBuff.cbBuffer   = pAS->_cbMaxToken;
00839     OutSecBuff.BufferType = SECBUFFER_TOKEN;
00840     OutSecBuff.pvBuffer   = BufferQueryPtr( &buff );
00841
00842     //
00843     //  Prepare our Input buffer - Note the server is expecting the client's
00844     //  negotiation packet on the first call
00845     //
00846
00847     if ( pBuffIn )
00848     {
00849         InBuffDesc.ulVersion = 0;
00850         InBuffDesc.cBuffers  = 1;
00851         InBuffDesc.pBuffers  = &InSecBuff;
00852
00853         InSecBuff.cbBuffer   = cbBuffIn;
00854         InSecBuff.BufferType = SECBUFFER_TOKEN;
00855         InSecBuff.pvBuffer   = pBuffIn;
00856     }
00857
00858     {
00859         //
00860         //  will return success when its done but we still
00861         //  need to send the out buffer if there are bytes to send
00862         //
00863
00864         ss = sfProcs.pInitializeSecurityContext(
00865                                         &pAS->_hcred,
00866                                         pAS->_fNewConversation ? NULL :
00867                                                 &pAS->_hctxt,
00868                                         TOKEN_SOURCE_NAME,
00869                                         0,
00870                                         0,
00871                                         SECURITY_NATIVE_DREP,
00872                                         pAS->_fNewConversation ? NULL :
00873                                                 &InBuffDesc,
00874                                         0,
00875                                         &pAS->_hctxt,
00876                                         &OutBuffDesc,
00877                                         &ContextAttributes,
00878                                         &Lifetime );
00879     }
00880
00881     if ( !SEC_SUCCESS( ss ) )
00882     {
00883         if ( ss == SEC_E_LOGON_DENIED )
00884             ss = ERROR_LOGON_FAILURE;
00885
00886         SetLastError( ss );
00887         fSt = FALSE;
00888         goto ex;
00889     }
00890
00891     pAS->_fHaveCtxtHandle = TRUE;
00892
00893     //
00894     //  Now we just need to complete the token (if requested) and prepare
00895     //  it for shipping to the other side if needed
00896     //
00897
00898     fReply = !!OutSecBuff.cbBuffer;
00899
00900     if ( (ss == SEC_I_COMPLETE_NEEDED) ||
00901          (ss == SEC_I_COMPLETE_AND_CONTINUE) )
00902     {
00903         if ( sfProcs.pCompleteAuthToken != NULL )
00904         {
00905             ss = sfProcs.pCompleteAuthToken( &pAS->_hctxt,
00906                                     &OutBuffDesc );
00907
00908             if ( !SEC_SUCCESS( ss ))
00909             {
00910                 fSt = FALSE;
00911                 goto ex;
00912             }
00913         }
00914         else
00915         {
00916             // if not supported
00917
00918             fSt = FALSE;
00919             goto ex;
00920         }
00921     }
00922
00923     //
00924     //  Format or copy to the output buffer if we need to reply
00925     //
00926
00927     if ( fReply )
00928     {
00929         if ( pAS->_fUUEncodeData )
00930         {
00931             if ( !uuencode( (BYTE *) OutSecBuff.pvBuffer,
00932                             OutSecBuff.cbBuffer,
00933                             pbuffOut ))
00934             {
00935                 fSt = FALSE;
00936                 goto ex;
00937             }
00938
00939             *pcbBuffOut = (ULONG)strlen( (CHAR *) BufferQueryPtr(pbuffOut) );
00940         }
00941         else
00942         {
00943             if ( !BufferResize( pbuffOut, OutSecBuff.cbBuffer ))
00944             {
00945                 fSt = FALSE;
00946                 goto ex;
00947             }
00948
00949             memcpy( BufferQueryPtr(pbuffOut),
00950                     OutSecBuff.pvBuffer,
00951                     OutSecBuff.cbBuffer );
00952
00953             *pcbBuffOut = OutSecBuff.cbBuffer;
00954         }
00955     }
00956
00957     if ( pAS->_fNewConversation )
00958         pAS->_fNewConversation = FALSE;
00959
00960     *pfNeedMoreData = ((ss == SEC_I_CONTINUE_NEEDED) ||
00961                        (ss == SEC_I_COMPLETE_AND_CONTINUE));
00962
00963     fSt = TRUE;
00964
00965 ex:
00966     BufferTerminate( &buffData );
00967     BufferTerminate( &buff );
00968
00969     if(ContextAttributes)
00970         printf("some attributes %lx\n",ContextAttributes);
00971
00972     if(ContextAttributes & ISC_RET_ALLOCATED_MEMORY)
00973         printf("allocated memory\n");
00974
00975     return fSt;
00976 }
00977
00978
00979 BOOL CrackUserAndDomain(
00980     CHAR *   pszDomainAndUser,
00981     CHAR * * ppszUser,
00982     CHAR * * ppszDomain
00983     )
00984 /*++
00985
00986 Routine Description:
00987
00988     Given a user name potentially in the form domain\user, zero terminates
00989     the domain name and returns pointers to the domain name and the user name
00990
00991 Arguments:
00992
00993     pszDomainAndUser - Pointer to user name or domain and user name
00994     ppszUser - Receives pointer to user portion of name
00995     ppszDomain - Receives pointer to domain portion of name
00996
00997 Return Value:
00998
00999     TRUE if successful, FALSE otherwise (call GetLastError)
01000
01001 --*/
01002 {
01003     static CHAR szDefaultDomain[MAX_COMPUTERNAME_LENGTH+1];
01004     DWORD cbN;
01005
01006     //
01007     //  Crack the name into domain/user components.
01008     //
01009
01010     *ppszDomain = pszDomainAndUser;
01011     *ppszUser   = strpbrk( pszDomainAndUser, "/\\" );
01012
01013     if( *ppszUser == NULL )
01014     {
01015         //
01016         //  No domain name specified, just the username so we assume the
01017         //  user is on the local machine
01018         //
01019
01020         if ( !*szDefaultDomain )
01021         {
01022             cbN = sizeof(szDefaultDomain);
01023             GetComputerName( szDefaultDomain, &cbN );
01024         }
01025
01026         *ppszDomain = szDefaultDomain;
01027         *ppszUser   = pszDomainAndUser;
01028     }
01029     else
01030     {
01031         //
01032         //  Both domain & user specified, skip delimiter.
01033         //
01034
01035         **ppszUser = '\0';
01036         (*ppszUser)++;
01037
01038         if( ( **ppszUser == '\0' ) ||
01039             ( **ppszUser == '\\' ) ||
01040             ( **ppszUser == '/' ) )
01041         {
01042             //
01043             //  Name is of one of the following (invalid) forms:
01044             //
01045             //      "domain\"
01046             //      "domain\\..."
01047             //      "domain/..."
01048             //
01049
01050             SetLastError( ERROR_INVALID_PARAMETER );
01051             return FALSE;
01052         }
01053     }
01054
01055     return TRUE;
01056 }
01057
01058
01059 /************************************************************
01060  *    uuencode/decode functions
01061  ************************************************************/
01062
01063 //
01064 //  Taken from NCSA HTTP and wwwlib.
01065 //
01066 //  NOTE: These conform to RFC1113, which is slightly different then the Unix
01067 //        uuencode and uudecode!
01068 //
01069
01070 const int pr2six[256]={
01071     64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
01072     64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62,64,64,64,63,
01073     52,53,54,55,56,57,58,59,60,61,64,64,64,64,64,64,64,0,1,2,3,4,5,6,7,8,9,
01074     10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,64,64,64,64,64,64,26,27,
01075     28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,
01076     64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
01077     64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
01078     64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
01079     64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
01080     64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
01081     64,64,64,64,64,64,64,64,64,64,64,64,64
01082 };
01083
01084 char six2pr[64] = {
01085     'A','B','C','D','E','F','G','H','I','J','K','L','M',
01086     'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
01087     'a','b','c','d','e','f','g','h','i','j','k','l','m',
01088     'n','o','p','q','r','s','t','u','v','w','x','y','z',
01089     '0','1','2','3','4','5','6','7','8','9','+','/'
01090 };
01091
01092
01093 BOOL
01094 uudecode(
01095     char   * bufcoded,
01096     BUFFER * pbuffdecoded,
01097     DWORD  * pcbDecoded )
01098 /*++
01099
01100  Routine Description:
01101
01102     uudecode a string of data
01103
01104  Arguments:
01105
01106     bufcoded            pointer to uuencoded data
01107     pbuffdecoded        pointer to output BUFFER structure
01108     pcbDecoded          number of decode bytes
01109
01110  Return Value:
01111
01112     Returns TRUE is successful; otherwise FALSE is returned.
01113
01114 --*/
01115 {
01116     int nbytesdecoded;
01117     char *bufin = bufcoded;
01118     unsigned char *bufout;
01119     int nprbytes;
01120
01121     /* Strip leading whitespace. */
01122
01123     while(*bufcoded==' ' || *bufcoded == '\t') bufcoded++;
01124
01125     /* Figure out how many characters are in the input buffer.
01126      * If this would decode into more bytes than would fit into
01127      * the output buffer, adjust the number of input bytes downwards.
01128      */
01129     bufin = bufcoded;
01130     while(pr2six[*(bufin++)] <= 63);
01131     nprbytes = (int)(INT_PTR)(bufin - bufcoded - 1);
01132     nbytesdecoded = ((nprbytes+3)/4) * 3;
01133
01134     if ( !BufferResize( pbuffdecoded, nbytesdecoded + 4 ))
01135         return FALSE;
01136
01137     if ( pcbDecoded )
01138         *pcbDecoded = nbytesdecoded;
01139
01140     bufout = (unsigned char *) BufferQueryPtr(pbuffdecoded);
01141
01142     bufin = bufcoded;
01143
01144     while (nprbytes > 0) {
01145         *(bufout++) =
01146             (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
01147         *(bufout++) =
01148             (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
01149         *(bufout++) =
01150             (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
01151         bufin += 4;
01152         nprbytes -= 4;
01153     }
01154
01155     if(nprbytes & 03) {
01156         if(pr2six[bufin[-2]] > 63)
01157             nbytesdecoded -= 2;
01158         else
01159             nbytesdecoded -= 1;
01160     }
01161
01162     ((CHAR *)BufferQueryPtr(pbuffdecoded))[nbytesdecoded] = '\0';
01163
01164     return TRUE;
01165 }
01166
01167
01168 BOOL
01169 uuencode(
01170     BYTE *   bufin,
01171     DWORD    nbytes,
01172     BUFFER * pbuffEncoded )
01173 /*++
01174
01175  Routine Description:
01176
01177     uuencode a string of data
01178
01179  Arguments:
01180
01181     bufin           pointer to data to encode
01182     nbytes          number of bytes to encode
01183     pbuffEncoded    pointer to output BUFFER structure
01184
01185  Return Value:
01186
01187     Returns TRUE is successful; otherwise FALSE is returned.
01188
01189 --*/
01190 {
01191    unsigned char *outptr;
01192    unsigned int i;
01193
01194    //
01195    //  Resize the buffer to 133% of the incoming data
01196    //
01197
01198    if ( !BufferResize( pbuffEncoded, nbytes + ((nbytes + 3) / 3) + 4))
01199         return FALSE;
01200
01201    outptr = (unsigned char *) BufferQueryPtr(pbuffEncoded);
01202
01203    for (i=0; i<nbytes; i += 3) {
01204       *(outptr++) = six2pr[*bufin >> 2];            /* c1 */
01205       *(outptr++) = six2pr[((*bufin << 4) & 060) | ((bufin[1] >> 4) & 017)]; /*c2*/
01206       *(outptr++) = six2pr[((bufin[1] << 2) & 074) | ((bufin[2] >> 6) & 03)];/*c3*/
01207       *(outptr++) = six2pr[bufin[2] & 077];         /* c4 */
01208
01209       bufin += 3;
01210    }
01211
01212    /* If nbytes was not a multiple of 3, then we have encoded too
01213     * many characters.  Adjust appropriately.
01214     */
01215    if(i == nbytes+1) {
01216       /* There were only 2 bytes in that last group */
01217       outptr[-1] = '=';
01218    } else if(i == nbytes+2) {
01219       /* There was only 1 byte in that last group */
01220       outptr[-1] = '=';
01221       outptr[-2] = '=';
01222    }
01223
01224    *outptr = '\0';
01225
01226    return TRUE;
01227 }
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/DataObj.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

DataObj.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          DataObj.cpp
00021
00022   Description:   CDataObject and CEnumForamtEtc implementation.
00023
00024 **************************************************************************/
00025
00026 /**************************************************************************
00027 #include statements
00028 **************************************************************************/
00029
00030 #include "DataObj.h"
00031
00032 /**************************************************************************
00033
00034   CDataObject::CDataObject()
00035
00036 **************************************************************************/
00037
00038 CDataObject::CDataObject(COleDocument *pOleDoc)
00039 {
00040   OutputDebugString(TEXT("CDataObject's constructor\n"));
00041
00042   m_pOleDoc = pOleDoc;
00043
00044   m_pDataAdviseHolder = NULL;
00045
00046   m_cfEmbedSource = RegisterClipboardFormat(CF_EMBEDSOURCE);
00047 }
00048
00049 /**************************************************************************
00050
00051   CDataObject::~CDataObject()
00052
00053 **************************************************************************/
00054
00055 CDataObject::~CDataObject(void)
00056 {
00057   if(m_pDataAdviseHolder)
00058     m_pDataAdviseHolder->Release();
00059
00060   OutputDebugString(TEXT("CDataObject's destructor\n"));
00061 }
00062
00063 /**************************************************************************
00064
00065   CDataObject::QueryInterface()
00066
00067 **************************************************************************/
00068
00069 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppReturn)
00070 {
00071   OutputDebugString(TEXT("CDataObject::QueryInterface\n"));
00072
00073   return m_pOleDoc->QueryInterface(riid, ppReturn);
00074 }
00075
00076 /**************************************************************************
00077
00078   CDataObject::AddRef()
00079
00080 **************************************************************************/
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084   OutputDebugString(TEXT("CDataObject::AddRef\n"));
00085
00086   return m_pOleDoc->AddRef();
00087 }
00088
00089 /**************************************************************************
00090
00091   CDataObject::Release()
00092
00093 **************************************************************************/
00094
00095 STDMETHODIMP_(ULONG) CDataObject::Release()
00096 {
00097   OutputDebugString(TEXT("CDataObject::Release\n"));
00098
00099   return m_pOleDoc->Release();
00100 }
00101
00102 /**************************************************************************
00103
00104   CDataObject::QueryGetData()
00105
00106 **************************************************************************/
00107
00108 STDMETHODIMP CDataObject::QueryGetData(LPFORMATETC pformatetc)
00109 {
00110   OutputDebugString(TEXT("CDataObject::QueryGetData\n"));
00111
00112   HRESULT  hr = DATA_E_FORMATETC;
00113
00114   // check the validity of the formatetc.
00115   if( (pformatetc->cfFormat == m_cfEmbedSource)  &&
00116     (pformatetc->dwAspect == DVASPECT_CONTENT) &&
00117     (pformatetc->tymed == TYMED_ISTORAGE))
00118   {
00119     hr = S_OK;
00120   }
00121
00122   return hr;
00123 }
00124
00125 /**************************************************************************
00126
00127   CDataObject::DAdvise()
00128
00129 **************************************************************************/
00130
00131 STDMETHODIMP CDataObject::DAdvise(  LPFORMATETC pFormatetc,
00132                   DWORD advf,
00133                   LPADVISESINK pAdvSink,
00134                   LPDWORD pdwConnection)
00135 {
00136   OutputDebugString(TEXT("CDataObject::DAdvise\n"));
00137
00138   // if no DataAdviseHolder has been created, then create one.
00139   if(!m_pDataAdviseHolder)
00140     CreateDataAdviseHolder(&m_pDataAdviseHolder);
00141
00142   if(m_pDataAdviseHolder)
00143   {
00144     // pass on to the DataAdviseHolder
00145     return m_pDataAdviseHolder->Advise(this, pFormatetc, advf, pAdvSink, pdwConnection);
00146   }
00147
00148   return E_FAIL;
00149 }
00150
00151 /**************************************************************************
00152
00153   CDataObject::DUnadvise()
00154
00155 **************************************************************************/
00156
00157 STDMETHODIMP CDataObject::DUnadvise(DWORD dwConnection)
00158 {
00159   OutputDebugString(TEXT("CDataObject::DUnadvise\n"));
00160
00161   if(m_pDataAdviseHolder)
00162   {
00163     // pass on to the DataAdviseHolder
00164     return m_pDataAdviseHolder->Unadvise(dwConnection);
00165   }
00166
00167   return E_FAIL;
00168 }
00169
00170 /**************************************************************************
00171
00172   CDataObject::GetData()
00173
00174 **************************************************************************/
00175
00176 STDMETHODIMP CDataObject::GetData(LPFORMATETC pFE, LPSTGMEDIUM pStgMedium)
00177 {
00178   UNREFERENCED_PARAMETER(pFE);
00179   UNREFERENCED_PARAMETER(pStgMedium);
00180   OutputDebugString(TEXT("CDataObject::GetData\n"));
00181
00182   HRESULT  hr = E_NOTIMPL;
00183
00184   return hr;
00185 }
00186
00187 /**************************************************************************
00188
00189   CDataObject::GetDataHere()
00190
00191 **************************************************************************/
00192
00193 STDMETHODIMP CDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pStgMedium)
00194 {
00195   OutputDebugString(TEXT("CDataObject::GetDataHere\n"));
00196
00197   HRESULT  hr = DATA_E_FORMATETC;
00198
00199   if(pFormatEtc->cfFormat == m_cfEmbedSource)
00200   {
00201     hr = GetOleObjectDataHere( m_pOleDoc->m_pPersistStorage,
00202       pFormatEtc,
00203       pStgMedium);
00204   }
00205
00206   return hr;
00207 }
00208
00209 /**************************************************************************
00210
00211   CDataObject::GetCanonicalFormatEtc()
00212
00213 **************************************************************************/
00214
00215 STDMETHODIMP CDataObject::GetCanonicalFormatEtc(LPFORMATETC pformatetc, LPFORMATETC pformatetcOut)
00216 {
00217   OutputDebugString(TEXT("CDataObject::GetCanonicalFormatEtc\n"));
00218
00219   HRESULT hr;
00220
00221   if(!pformatetcOut)
00222     return E_INVALIDARG;
00223
00224   //set all out parameters to NULL.
00225   pformatetcOut->ptd = NULL;
00226
00227   if(!pformatetc)
00228     return E_INVALIDARG;
00229
00230   // OLE2NOTE: we must validate that the format requested is supported
00231   if(NOERROR != (hr = QueryGetData(pformatetc)))
00232     return hr;
00233
00234     /* OLE2NOTE: an app that is insensitive to target device (as
00235     **    SimpSvr is) should fill in the lpformatOut parameter
00236     **    but NULL out the "ptd" field; it should return NOERROR if the
00237     **    input formatetc->ptd what non-NULL. this tells the caller
00238     **    that it is NOT necessary to maintain a separate screen
00239     **    rendering and printer rendering. if should return
00240     **    DATA_S_SAMEFORMATETC if the input and output formatetc's are
00241     **    identical.
00242   */
00243
00244   *pformatetcOut = *pformatetc;
00245
00246   if(NULL == pformatetc->ptd)
00247     return DATA_S_SAMEFORMATETC;
00248
00249   pformatetcOut->ptd = NULL;
00250
00251   return NOERROR;
00252 }
00253
00254 /**************************************************************************
00255
00256   CDataObject::SetData()
00257
00258 **************************************************************************/
00259
00260 STDMETHODIMP CDataObject::SetData(  LPFORMATETC pformatetc,
00261                   LPSTGMEDIUM pmedium,
00262                   BOOL fRelease)
00263 {
00264   UNREFERENCED_PARAMETER(pformatetc);
00265   UNREFERENCED_PARAMETER(pmedium);
00266   UNREFERENCED_PARAMETER(fRelease);
00267   OutputDebugString(TEXT("CDataObject::SetData\n"));
00268
00269   return DATA_E_FORMATETC;
00270 }
00271
00272 /**************************************************************************
00273
00274   CDataObject::EnumFormatEtc()
00275
00276 **************************************************************************/
00277
00278 STDMETHODIMP CDataObject::EnumFormatEtc(  DWORD dwDirection,
00279                     LPENUMFORMATETC *ppenumFormatEtc)
00280 {
00281   OutputDebugString(TEXT("CDataObject::EnumFormatEtc\n"));
00282
00283   // need to NULL the out parameter
00284   *ppenumFormatEtc = NULL;
00285
00286   if(DATADIR_SET == dwDirection)
00287     return E_NOTIMPL;
00288
00289   *ppenumFormatEtc = new CEnumFormatEtc();
00290
00291   if(*ppenumFormatEtc)
00292   {
00293     (*ppenumFormatEtc)->AddRef();
00294     return S_OK;
00295   }
00296
00297   return E_OUTOFMEMORY;
00298 }
00299
00300 /**************************************************************************
00301
00302   CDataObject::EnumDAdvise()
00303
00304 **************************************************************************/
00305
00306 STDMETHODIMP CDataObject::EnumDAdvise(LPENUMSTATDATA *ppenumAdvise)
00307 {
00308   OutputDebugString(TEXT("CDataObject::EnumDAdvise\n"));
00309
00310   // need to NULL the out parameter
00311   *ppenumAdvise = NULL;
00312
00313   return m_pDataAdviseHolder->EnumAdvise(ppenumAdvise);
00314 }
00315
00316 //////////////////////////////////////////////////////////////////////////////
00317 //
00318 // CEnumFormatEtc Implementation
00319 //
00320
00321 /**************************************************************************
00322
00323   CEnumFormatEtc::CEnumFormatEtc()
00324
00325 **************************************************************************/
00326
00327 CEnumFormatEtc::CEnumFormatEtc()
00328 {
00329   OutputDebugString(TEXT("CEnumFormatEtc's constructor\n"));
00330
00331   m_ObjRefCount = 0;
00332
00333   m_iCur = 0;
00334
00335   m_cfEmbedSource = RegisterClipboardFormat(CF_EMBEDSOURCE);
00336 }
00337
00338 /**************************************************************************
00339
00340   CEnumFormatEtc::~CEnumFormatEtc()
00341
00342 **************************************************************************/
00343
00344 CEnumFormatEtc::~CEnumFormatEtc(void)
00345 {
00346   OutputDebugString(TEXT("CEnumFormatEtc's destructor\n"));
00347 }
00348
00349 /**************************************************************************
00350
00351   CEnumFormatEtc::QueryInterface()
00352
00353 **************************************************************************/
00354
00355 STDMETHODIMP CEnumFormatEtc::QueryInterface(REFIID riid, LPVOID *ppReturn)
00356 {
00357   OutputDebugString(TEXT("CEnumFormatEtc::QueryInterface\n"));
00358
00359   *ppReturn = NULL;
00360
00361   if(IsEqualIID(riid, IID_IUnknown))
00362   {
00363     *ppReturn = (LPVOID)this;
00364   }
00365   else if(IsEqualIID(riid, IID_IEnumFORMATETC))
00366   {
00367     *ppReturn = (LPVOID)this;
00368   }
00369
00370   if(NULL != *ppReturn)
00371   {
00372     ((LPUNKNOWN)*ppReturn)->AddRef();
00373     return NOERROR;
00374   }
00375
00376   return E_NOINTERFACE;
00377 }
00378
00379 /**************************************************************************
00380
00381   CEnumFormatEtc::AddRef()
00382
00383 **************************************************************************/
00384
00385 STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef(void)
00386 {
00387   OutputDebugString(TEXT("CEnumFormatEtc::AddRef\n"));
00388
00389   return ++m_ObjRefCount;
00390 }
00391
00392 /**************************************************************************
00393
00394   CEnumFormatEtc::Release()
00395
00396 **************************************************************************/
00397
00398 STDMETHODIMP_(ULONG) CEnumFormatEtc::Release(void)
00399 {
00400   TCHAR szText[MAX_PATH];
00401   wsprintf(szText, TEXT("CEnumFormatEtc::Release - ref count will be %d\n"), m_ObjRefCount - 1);
00402   OutputDebugString(szText);
00403
00404   if(0 == --m_ObjRefCount)
00405   {
00406     delete this;
00407     return 0;
00408   }
00409
00410   return m_ObjRefCount;
00411 }
00412
00413 /**************************************************************************
00414
00415   CEnumFormatEtc::Next()
00416
00417 **************************************************************************/
00418
00419 STDMETHODIMP CEnumFormatEtc::Next(ULONG cRequested, LPFORMATETC pFE, ULONG* puFetched)
00420 {
00421   UNREFERENCED_PARAMETER(cRequested);
00422   OutputDebugString(TEXT("CEnumFormatEtc::Next\n"));
00423
00424   if(m_iCur > 0)
00425   {
00426     *puFetched = 0;
00427     return S_FALSE;
00428   }
00429
00430   // CLIPFORMAT is a WORD
00431   pFE->cfFormat = (WORD)m_cfEmbedSource;
00432   pFE->dwAspect = DVASPECT_CONTENT;
00433   pFE->tymed = TYMED_ISTORAGE;
00434
00435   *puFetched = 1;
00436
00437   m_iCur++;
00438
00439   return S_OK;
00440 }
00441
00442 /**************************************************************************
00443
00444   CEnumFormatEtc::Skip()
00445
00446 **************************************************************************/
00447
00448 STDMETHODIMP CEnumFormatEtc::Skip(ULONG cSkip)
00449 {
00450   OutputDebugString(TEXT("CEnumFormatEtc::Skip\n"));
00451
00452   if((m_iCur + cSkip) > 1)
00453     return S_FALSE;
00454
00455   m_iCur += cSkip;
00456
00457   return S_OK;
00458 }
00459
00460 /**************************************************************************
00461
00462   CEnumFormatEtc::Reset()
00463
00464 **************************************************************************/
00465
00466 STDMETHODIMP CEnumFormatEtc::Reset(void)
00467 {
00468   OutputDebugString(TEXT("CEnumFormatEtc::Reset\n"));
00469
00470   m_iCur = 0;
00471
00472   return S_OK;
00473 }
00474
00475 /**************************************************************************
00476
00477   CEnumFormatEtc::Clone()
00478
00479 **************************************************************************/
00480
00481 STDMETHODIMP CEnumFormatEtc::Clone(LPENUMFORMATETC* ppEnum)
00482 {
00483   OutputDebugString(TEXT("CEnumFormatEtc::Clone\n"));
00484
00485   CEnumFormatEtc* pNew;
00486
00487   *ppEnum = NULL;
00488
00489   // Create the clone.
00490   pNew = new CEnumFormatEtc();
00491   if (NULL == pNew)
00492     return (ResultFromScode(E_OUTOFMEMORY));
00493
00494   pNew->AddRef();
00495   pNew->m_iCur = m_iCur;
00496
00497   *ppEnum = pNew;
00498
00499   return S_OK;
00500 }
00501
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/LocServe.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

LocServe.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      LOCSERVE.CPP
00003
00004   Summary:   Based largely on the DLLCLIEN.EXE source code, this
00005              module implements the main framework for an Win32 .EXE
00006              application.  This application is meant to run hidden as a
00007              local COM server that offers the Car, UtilityCar, and
00008              CruiseCar components.  Though this local server offers a
00009              simple main window and menu system these are not seen during
00010              normal operation.  This server can be run stand-alone for
00011              debugging purposes by explicitly using the -embedding command
00012              line switch and invoking LOCSERVE prior to the client.
00013
00014              This local server supports self-registration and this module
00015              recognizes the -RegServer and -UnregServer command line
00016              switches and has the appropriate functions (RegisterServer
00017              and UnregisterServer) to register this local server in the
00018              system Registry.
00019
00020              For a comprehensive tutorial code tour of LOCSERVE's
00021              contents and offerings see the tutorial LOCSERVE.HTM file.
00022              For more specific technical details on the internal workings
00023              see the comments dispersed throughout the LOCSERVE source code.
00024              For more details on the LOCCLIEN.EXE that LOCSERVE works with
00025              see the LOCCLIEN.HTM file in the main tutorial directory.
00026
00027   Classes:   CMainWindow
00028
00029   Functions: InitApplication, WinMain
00030
00031   Origin:    2-17-98: atrent - Based on DLLCLIEN source. [Revised]
00032
00033 ----------------------------------------------------------------------------
00034   This file is part of the Microsoft COM Tutorial Code Samples.
00035
00036   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00037
00038   This source code is intended only as a supplement to Microsoft
00039   Development Tools and/or on-line documentation.  See these other
00040   materials for detailed information regarding Microsoft code samples.
00041
00042   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00043   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00044   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00045   PARTICULAR PURPOSE.
00046 ==========================================================================+*/
00047
00048 /*--------------------------------------------------------------------------
00049   We include WINDOWS.H for all Win32 applications.
00050   We include OLE2.H because we will be calling the COM/OLE Libraries.
00051   We include INITGUID.H only once (here) in the entire app because we
00052     will be defining GUIDs and want them as constants in the data segment.
00053   We include APPUTIL.H because we will be building this application using
00054     the convenient Virtual Window and Dialog classes and other
00055     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00056   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00057     class, GUID, and CLSID specifications.
00058   We include LOCSERVE.H because it has class and resource definitions
00059     specific to this LOCSERVE application.
00060   We include SERVER.H because it has the necessary internal class and
00061     resource definitions for this server.
00062   We include FACTORY.H because it has the necessary internal class factory
00063     declarations for this component server.
00064 ---------------------------------------------------------------------------*/
00065 #include <windows.h>
00066 #include <ole2.h>
00067 #include <initguid.h>
00068 #include <apputil.h>
00069 #include <micars.h>
00070 #include <carguids.h>
00071 #include "locserve.h"
00072 #include "server.h"
00073 #include "factory.h"
00074
00075
00076 // We encapsulate the control of this COM server (eg, lock and object
00077 // counting) in a server control C++ object.  Here is it's pointer.
00078 CServer*  g_pServer = NULL;
00079
00080 // Here is a pointer for use by the global Trace Message logging macros.
00081 CSendLog* g_pMsgLog = NULL;
00082
00083
00084 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00085   Method:   CMainWindow::CMainWindow
00086
00087   Summary:  CMainWindow Constructor.
00088
00089   Args:     .
00090
00091   Modifies: m_pMsgBox, m_pMsgLog.
00092
00093   Returns:  .
00094 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00095 CMainWindow::CMainWindow()
00096 {
00097   // Null the Message object pointers.
00098   m_pMsgBox = NULL;
00099   m_pMsgLog = NULL;
00100 }
00101
00102
00103 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00104   Method:   CMainWindow::~CMainWindow
00105
00106   Summary:  CMainWindow Destructor.  Destruction of the main window
00107             indicates that the application should quit and thus the
00108             PostQuitMessage API is called.
00109
00110   Args:     .
00111
00112   Returns:  .
00113 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00114 CMainWindow::~CMainWindow()
00115 {
00116   // CMainWindow is derived from CVirWindow which traps the WM_DESTROY
00117   // message and causes a delete of CMainWindow which in turn causes this
00118   // destructor to run. The WM_DESTROY results when the window is destoyed
00119   // after a close of the window. Prior to exiting the main message loop:
00120
00121   // Close down the factories (ie, Revoke and release the Class Factories).
00122   if (NULL != g_pServer)
00123     g_pServer->CloseFactories();
00124
00125   LOG("L: Exiting LOCSERVE local server application.");
00126
00127   // We delete the CMsgBox and CMsgLog objects that were made in
00128   // Initinstance and the server control object, CServer.
00129   DELETE_POINTER(g_pServer);
00130   DELETE_POINTER(m_pMsgBox);
00131   DELETE_POINTER(m_pMsgLog);
00132
00133   // We then post a WM_QUIT message to cause an exit of the main thread's
00134   // message loop and an exit of this instance of the application.
00135   PostQuitMessage(0);
00136 }
00137
00138
00139 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00140   Method:   CMainWindow::RegisterServer
00141
00142   Summary:  Member function used by this server to register itself in the
00143             system registry.
00144
00145   Args:     void.
00146
00147   Returns:  BOOL
00148               TRUE => Success; FALSE => Failed.
00149 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00150 BOOL CMainWindow::RegisterServer(void)
00151 {
00152   BOOL  bOk = TRUE;
00153   TCHAR szID[GUID_SIZE+1];
00154   TCHAR szAID[GUID_SIZE+1];
00155   TCHAR szCLSID[GUID_SIZE+32];
00156   TCHAR szAPPID[GUID_SIZE+32];
00157   TCHAR szModulePath[MAX_PATH];
00158   TCHAR szExeName[MAX_PATH];
00159
00160   // Be safe with null strings in these stack-allocated strings.
00161   szID[0] = 0;
00162   szAID[0] = 0;
00163   szCLSID[0] = 0;
00164   szAPPID[0] = 0;
00165   szModulePath[0] = 0;
00166   szExeName[0] = 0;
00167
00168   // Obtain the path to this module's executable file for later use.
00169   // GetModuleFileName is an APPUTIL convenience function.
00170   GetModuleFileName(
00171     g_pServer->m_hInstServer,
00172     szModulePath,
00173     sizeof(szModulePath)/sizeof(TCHAR));
00174
00175   // Obtain the file name of this module's executable for later use.
00176   // GetExeName is an APPUTIL convenience function.
00177   GetExeName(
00178     g_pServer->m_hInstServer,
00179     szExeName);
00180
00181   /*-------------------------------------------------------------------------
00182     Create registry entries for the LocCar Component.
00183   -------------------------------------------------------------------------*/
00184   // Create some base key strings.
00185   StringFromGUID2(CLSID_LocCar, szID, GUID_SIZE);
00186   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00187   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00188   // Use the ClassID of this first component as the AppID for all
00189   // of the server's components.
00190   lstrcpyn(szAPPID, TEXT("AppID\\"), sizeof(szAPPID)/sizeof(TCHAR));
00191   lstrncat(szAPPID, szID, sizeof(szAPPID)/sizeof(TCHAR) - lstrlen(szAPPID));
00192   lstrcpyn(szAID, szID, sizeof(szAID)/sizeof(TCHAR));
00193
00194   // Create ProgID keys.
00195   SetRegKeyValue(
00196     TEXT("CTS.LocCar.1"),
00197     NULL,
00198     TEXT("LocCar Component - LOCSERVE Code Sample"));
00199   SetRegKeyValue(
00200     TEXT("CTS.LocCar.1"),
00201     TEXT("CLSID"),
00202     szID);
00203
00204   // Create VersionIndependentProgID keys.
00205   SetRegKeyValue(
00206     TEXT("CTS.LocCar"),
00207     NULL,
00208     TEXT("LocCar Component - LOCSERVE Code Sample"));
00209   SetRegKeyValue(
00210     TEXT("CTS.LocCar"),
00211     TEXT("CurVer"),
00212     TEXT("CTS.LocCar.1"));
00213   SetRegKeyValue(
00214     TEXT("CTS.LocCar"),
00215     TEXT("CLSID"),
00216     szID);
00217
00218   // Create entries under CLSID.
00219   SetRegKeyValue(
00220     szCLSID,
00221     NULL,
00222     TEXT("LocCar Component - LOCSERVE Code Sample"));
00223   SetRegKeyValue(
00224     szCLSID,
00225     TEXT("ProgID"),
00226     TEXT("CTS.LocCar.1"));
00227   SetRegKeyValue(
00228     szCLSID,
00229     TEXT("VersionIndependentProgID"),
00230     TEXT("CTS.LocCar"));
00231   SetRegKeyValue(
00232     szCLSID,
00233     TEXT("NotInsertable"),
00234     NULL);
00235   SetRegKeyValue(
00236     szCLSID,
00237     TEXT("LocalServer32"),
00238     szModulePath);
00239   AddRegNamedValue(
00240     szCLSID,
00241     NULL,
00242     TEXT("AppID"),
00243     szAID);
00244
00245   /*-------------------------------------------------------------------------
00246     Create registry entries for the LocUtilityCar Component.
00247   -------------------------------------------------------------------------*/
00248   // Create some base key strings.
00249   StringFromGUID2(CLSID_LocUtilityCar, szID, GUID_SIZE);
00250   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00251   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00252
00253   // Create ProgID keys.
00254   SetRegKeyValue(
00255     TEXT("CTS.LocUtilityCar.1"),
00256     NULL,
00257     TEXT("LocUtilityCar Component - LOCSERVE Code Sample"));
00258   SetRegKeyValue(
00259     TEXT("CTS.LocUtilityCar.1"),
00260     TEXT("CLSID"),
00261     szID);
00262
00263   // Create VersionIndependentProgID keys.
00264   SetRegKeyValue(
00265     TEXT("CTS.LocUtilityCar"),
00266     NULL,
00267     TEXT("LocUtilityCar Component - LOCSERVE Code Sample"));
00268   SetRegKeyValue(
00269     TEXT("CTS.LocUtilityCar"),
00270     TEXT("CurVer"),
00271     TEXT("CTS.LocUtilityCar.1"));
00272   SetRegKeyValue(
00273     TEXT("CTS.LocUtilityCar"),
00274     TEXT("CLSID"),
00275     szID);
00276
00277   // Create entries under CLSID.
00278   SetRegKeyValue(
00279     szCLSID,
00280     NULL,
00281     TEXT("LocUtilityCar Component - LOCSERVE Code Sample"));
00282   SetRegKeyValue(
00283     szCLSID,
00284     TEXT("ProgID"),
00285     TEXT("CTS.LocUtilityCar.1"));
00286   SetRegKeyValue(
00287     szCLSID,
00288     TEXT("VersionIndependentProgID"),
00289     TEXT("CTS.LocUtilityCar"));
00290   SetRegKeyValue(
00291     szCLSID,
00292     TEXT("NotInsertable"),
00293     NULL);
00294   SetRegKeyValue(
00295     szCLSID,
00296     TEXT("LocalServer32"),
00297     szModulePath);
00298   AddRegNamedValue(
00299     szCLSID,
00300     NULL,
00301     TEXT("AppID"),
00302     szAID);
00303
00304   /*-------------------------------------------------------------------------
00305     Create registry entries for the LocCruiseCar Component.
00306   -------------------------------------------------------------------------*/
00307   // Create some base key strings.
00308   StringFromGUID2(CLSID_LocCruiseCar, szID, GUID_SIZE);
00309   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00310   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00311
00312   // Create ProgID keys.
00313   SetRegKeyValue(
00314     TEXT("CTS.LocCruiseCar.1"),
00315     NULL,
00316     TEXT("LocCruiseCar Component - LOCSERVE Code Sample"));
00317   SetRegKeyValue(
00318     TEXT("CTS.LocCruiseCar.1"),
00319     TEXT("CLSID"),
00320     szID);
00321
00322   // Create VersionIndependentProgID keys.
00323   SetRegKeyValue(
00324     TEXT("CTS.LocCruiseCar"),
00325     NULL,
00326     TEXT("LocCruiseCar Component - LOCSERVE Code Sample"));
00327   SetRegKeyValue(
00328     TEXT("CTS.LocCruiseCar"),
00329     TEXT("CurVer"),
00330     TEXT("CTS.LocCruiseCar.1"));
00331   SetRegKeyValue(
00332     TEXT("CTS.LocCruiseCar"),
00333     TEXT("CLSID"),
00334     szID);
00335
00336   // Create entries under CLSID.
00337   SetRegKeyValue(
00338     szCLSID,
00339     NULL,
00340     TEXT("LocCruiseCar Component - LOCSERVE Code Sample"));
00341   SetRegKeyValue(
00342     szCLSID,
00343     TEXT("ProgID"),
00344     TEXT("CTS.LocCruiseCar.1"));
00345   SetRegKeyValue(
00346     szCLSID,
00347     TEXT("VersionIndependentProgID"),
00348     TEXT("CTS.LocCruiseCar"));
00349   SetRegKeyValue(
00350     szCLSID,
00351     TEXT("NotInsertable"),
00352     NULL);
00353   SetRegKeyValue(
00354     szCLSID,
00355     TEXT("LocalServer32"),
00356     szModulePath);
00357   AddRegNamedValue(
00358     szCLSID,
00359     NULL,
00360     TEXT("AppID"),
00361     szAID);
00362
00363   /*-------------------------------------------------------------------------
00364     Create Server AppID entries.
00365   -------------------------------------------------------------------------*/
00366   SetRegKeyValue(
00367     szAPPID,
00368     NULL,
00369     TEXT("CTS.LOCSERVE(Cars).1"));
00370   SetRegKeyValue(
00371     TEXT("AppID"),
00372     szExeName,
00373     NULL);
00374   AddRegNamedValue(
00375     TEXT("AppID"),
00376     szExeName,
00377     TEXT("AppID"),
00378     szAID);
00379
00380   return bOk;
00381 }
00382
00383
00384 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00385   Method:   CMainWindow::UnregisterServer
00386
00387   Summary:  Member function used by this server to unregister itself from
00388             the system Registry.
00389
00390   Args:     void.
00391
00392   Returns:  BOOL
00393               TRUE => Success; FALSE => Failed.
00394 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00395 BOOL CMainWindow::UnregisterServer(void)
00396 {
00397   BOOL  bOk = TRUE;
00398   TCHAR szID[GUID_SIZE+1];
00399   TCHAR szCLSID[GUID_SIZE+32];
00400   TCHAR szAPPID[GUID_SIZE+32];
00401   TCHAR szExeName[MAX_PATH];
00402   TCHAR szTemp[MAX_PATH+GUID_SIZE];
00403
00404   // Obtain the file name of this module's executable for later use.
00405   GetExeName(
00406     g_pServer->m_hInstServer,
00407     szExeName);
00408
00409   /*-------------------------------------------------------------------------
00410     Delete registry entries for the LocCar Component.
00411   -------------------------------------------------------------------------*/
00412   //Create some base key strings.
00413   StringFromGUID2(CLSID_LocCar, szID, GUID_SIZE);
00414   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00415   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00416   lstrcpyn(szAPPID, TEXT("AppID\\"), sizeof(szAPPID)/sizeof(TCHAR));
00417   lstrncat(szAPPID, szID, sizeof(szAPPID)/sizeof(TCHAR) - lstrlen(szAPPID));
00418
00419   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCar\\CurVer"));
00420   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCar\\CLSID"));
00421   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCar"));
00422
00423   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCar.1\\CLSID"));
00424   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCar.1"));
00425
00426   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00427   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00428
00429   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00430   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00431
00432   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00433   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00434
00435   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("LocalServer32"));
00436   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00437
00438   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00439
00440   /*-------------------------------------------------------------------------
00441     Delete registry entries for the LocUtilityCar Component.
00442   -------------------------------------------------------------------------*/
00443   //Create some base key strings.
00444   StringFromGUID2(CLSID_LocUtilityCar, szID, GUID_SIZE);
00445   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00446   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00447
00448   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocUtilityCar\\CurVer"));
00449   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocUtilityCar\\CLSID"));
00450   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocUtilityCar"));
00451
00452   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocUtilityCar.1\\CLSID"));
00453   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocUtilityCar.1"));
00454
00455   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00456   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00457
00458   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00459   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00460
00461   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00462   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00463
00464   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("LocalServer32"));
00465   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00466
00467   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00468
00469   /*-------------------------------------------------------------------------
00470     Delete registry entries for the LocCruiseCar Component.
00471   -------------------------------------------------------------------------*/
00472   //Create some base key strings.
00473   StringFromGUID2(CLSID_LocCruiseCar, szID, GUID_SIZE);
00474   lstrcpyn(szCLSID, TEXT("CLSID\\"), sizeof(szCLSID)/sizeof(TCHAR));
00475   lstrncat(szCLSID, szID, sizeof(szCLSID)/sizeof(TCHAR) - lstrlen(szCLSID));
00476
00477   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCruiseCar\\CurVer"));
00478   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCruiseCar\\CLSID"));
00479   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCruiseCar"));
00480
00481   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCruiseCar.1\\CLSID"));
00482   RegDeleteKey(HKEY_CLASSES_ROOT, TEXT("CTS.LocCruiseCar.1"));
00483
00484   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("ProgID"));
00485   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00486
00487   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("VersionIndependentProgID"));
00488   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00489
00490   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("NotInsertable"));
00491   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00492
00493   wsprintf(szTemp, TEXT("%s\\%s"), szCLSID, TEXT("LocalServer32"));
00494   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00495
00496   RegDeleteKey(HKEY_CLASSES_ROOT, szCLSID);
00497
00498   /*-------------------------------------------------------------------------
00499     Delete registry entries for the AppID of this server.
00500   -------------------------------------------------------------------------*/
00501   wsprintf(szTemp, TEXT("%s\\%s"), TEXT("AppID"), szExeName);
00502   RegDeleteKey(HKEY_CLASSES_ROOT, szTemp);
00503
00504   RegDeleteKey(HKEY_CLASSES_ROOT, szAPPID);
00505
00506   return bOk;
00507 }
00508
00509
00510 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00511   Method:   CMainWindow::DoMenu
00512
00513   Summary:  Dispatch and handle the main menu commands.
00514
00515   Args:     WPARAM wParam,
00516               First message parameter (word sized).
00517             LPARAM lParam)
00518               Second message parameter (long sized).
00519
00520   Returns:  LRESULT
00521               Standard Windows WindowProc return value.
00522 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00523 LRESULT CMainWindow::DoMenu(
00524           WPARAM wParam,
00525           LPARAM lParam)
00526 {
00527   LRESULT lResult = FALSE;
00528   HMENU hMenu  = ::GetMenu(m_hWnd);
00529
00530   switch (LOWORD(wParam))
00531   {
00532     //----------------------------------------------------------------------
00533     // Handle File Menu Commands.
00534     //----------------------------------------------------------------------
00535     case IDM_FILE_EXIT:
00536       // The user commands us to exit this application so we tell the
00537       // Main window to close itself.
00538       ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00539       break;
00540
00541     //----------------------------------------------------------------------
00542     // Handle Log Menu Commands.
00543     //----------------------------------------------------------------------
00544     case IDM_LOG_LOGCLEAR:
00545       // Clear the message log.
00546       g_pMsgLog->Clear();
00547       // Use macro to log messages.
00548       LOGID(IDS_LOGTO_SERVER);
00549       break;
00550     case IDM_LOG_COPYCLIP:
00551       // Copy trace message log to clipboard.
00552       g_pMsgLog->Copy();
00553       break;
00554
00555     //----------------------------------------------------------------------
00556     // Handle Help Menu Commands.
00557     //----------------------------------------------------------------------
00558     case IDM_HELP_ABOUT:
00559       {
00560         CAboutBox dlgAboutBox;
00561         HWND hWnd = FindWindow(NULL, TEXT(CLIENT_WINDOW_TITLE));
00562         if (NULL == hWnd)
00563           hWnd = m_hWnd;
00564
00565         LOG("L: === Help Menu: About LOCSERVE.");
00566         // Show the standard About Box dialog for this EXE by telling the
00567         // dialog C++ object to show itself by invoking its ShowDialog
00568         // method.  Pass it this EXE instance and the parent window handle.
00569         // Use a dialog resource ID for the dialog template stored in
00570         // this EXE module's resources.
00571         dlgAboutBox.ShowDialog(
00572           m_hInst,
00573           MAKEINTRESOURCE(IDM_HELP_ABOUT),
00574           hWnd);
00575       }
00576       break;
00577
00578     default:
00579       // Defer all messages NOT handled here to the Default Window Proc.
00580       lResult = ::DefWindowProc(m_hWnd, WM_COMMAND, wParam, lParam);
00581       break;
00582   }
00583
00584   return(lResult);
00585 }
00586
00587
00588 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00589   Method:   CMainWindow::InitInstance
00590
00591   Summary:  Instantiates an instance of the main application window.
00592             This method must be called only once, immediately after
00593             window class construction.  We take care to delete 'this'
00594             CMainWindow if we must return the error condition FALSE.
00595
00596   Args:     HINSTANCE hInstance,
00597               Handle of the application instance.
00598             int nShow)
00599               Command to pass to ShowWindow.
00600
00601   Modifies: m_pMsgBox, m_pMsgLog.
00602
00603   Returns:  BOOL.
00604               TRUE => Success; FALSE => Failed.
00605 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00606 BOOL CMainWindow::InitInstance(
00607        HINSTANCE hInstance,
00608        int nShow)
00609 {
00610   BOOL bOk = FALSE;
00611   HWND hWnd;
00612
00613   // Create the Message Box object.
00614   m_pMsgBox = new CMsgBox;
00615   m_pMsgLog = new CSendLog;
00616
00617   if (NULL != m_pMsgBox && NULL != m_pMsgLog)
00618   {
00619     // Note, the Create method sets the m_hWnd member so we don't
00620     // need to set it explicitly here first.
00621
00622     // Here is the create of this window.  Size the window reasonably.
00623     // Create sets both m_hInst and m_hWnd.
00624     hWnd = Create(
00625              TEXT(MAIN_WINDOW_CLASS_NAME_STR),
00626              TEXT(MAIN_WINDOW_TITLE_STR),
00627              WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
00628                | WS_MAXIMIZEBOX | WS_THICKFRAME,
00629              CW_USEDEFAULT,
00630              CW_USEDEFAULT,
00631              ::GetSystemMetrics(SM_CXSCREEN)*3/5,
00632              ::GetSystemMetrics(SM_CYSCREEN)*3/5,
00633              NULL,
00634              NULL,
00635              hInstance);
00636     if (hWnd)
00637     {
00638       // Assign the server's copy of the main window handle.
00639       g_pServer->m_hWndServer = m_hWnd;
00640
00641       // Init the Message Box object.
00642       if (m_pMsgBox->Init(m_hInst, m_hWnd))
00643       {
00644         bOk = TRUE;
00645         // If the Client's Main window is found then set up logging to it.
00646         hWnd = FindWindow(NULL, TEXT(CLIENT_WINDOW_TITLE));
00647         if (NULL != hWnd)
00648         {
00649           // Tell the CSendLog object that we are logging to client.
00650           m_pMsgLog->LogToServer(FALSE);
00651           // Assign the global MsgLog pointer.
00652           g_pMsgLog = m_pMsgLog;
00653           m_pMsgLog->SetClient(m_hInst, m_hWnd, hWnd);
00654           LOGID(IDS_LOGTO_CLIENT);
00655         }
00656         else
00657         {
00658           // If the client window can't be found then create and show the
00659           // log display in this local server.
00660
00661           // Indicate we are logging to our own server log facility.
00662           m_pMsgLog->LogToServer(TRUE);
00663
00664           // Ensure the new window is shown on screen and its content
00665           // is painted.
00666           ::ShowWindow(m_hWnd, nShow);
00667           ::UpdateWindow(m_hWnd);
00668
00669           // Create the Trace Message Log ListBox as a child window that
00670           // fits the client area of the Main Window (the TRUE 3rd argument
00671           // specifies such an inside child). If you want the Trace Message
00672           // Log in a separate (but owned) window, then pass a FALSE
00673           // instead for the 3rd argument.
00674           if (m_pMsgLog->CreateServerLog(m_hInst, m_hWnd, TRUE))
00675           {
00676             // Assign the global MsgLog pointer.
00677             g_pMsgLog = m_pMsgLog;
00678             // Use macro to log an initial start messsage.
00679             LOGID(IDS_LOGTO_SERVER);
00680           }
00681           else
00682             bOk = FALSE;
00683         }
00684       }
00685     }
00686   }
00687
00688   if (!bOk)
00689   {
00690     DELETE_POINTER(m_pMsgBox);
00691     DELETE_POINTER(m_pMsgLog);
00692   }
00693
00694   return (bOk);
00695 }
00696
00697
00698 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00699   Method:   CMainWindow::WindowProc
00700
00701   Summary:  Main window procedure for this window object.  See CVirWindow
00702             in the APPUTIL library (APPUTIL.CPP) for details on how this
00703             method gets called by the global WindowProc.
00704
00705   Args:     UINT uMsg,
00706               Windows message that is "sent" to this window.
00707             WPARAM wParam,
00708               First message parameter (word sized).
00709             LPARAM lParam)
00710               Second message parameter (long sized).
00711
00712   Returns:  LRESULT
00713               Standard Windows WindowProc return value.
00714 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00715 LRESULT CMainWindow::WindowProc(
00716           UINT uMsg,
00717           WPARAM wParam,
00718           LPARAM lParam)
00719 {
00720   LRESULT lResult = FALSE;
00721
00722   switch (uMsg)
00723   {
00724     case WM_CREATE:
00725       break;
00726
00727     case WM_COMMAND:
00728       // Dispatch and handle any Menu command messages received.
00729       lResult = DoMenu(wParam, lParam);
00730       break;
00731
00732     case WM_CLOSE:
00733       // The user selected Close on the main window's System menu
00734       // or Exit on the File menu.
00735     case WM_QUIT:
00736       // If the app is being quit then close any associated help windows.
00737     default:
00738       // Defer all messages NOT handled here to the Default Window Proc.
00739       lResult = ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
00740       break;
00741   }
00742
00743   return(lResult);
00744 }
00745
00746
00747 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00748   Function: UnicodeOk
00749
00750   Summary:  Checks if the platform will handle unicode versions of
00751             Win32 string API calls.
00752
00753   Args:     void
00754
00755   Returns:  BOOL
00756               TRUE if unicode support; FALSE if not.
00757 ------------------------------------------------------------------------F-F*/
00758 BOOL UnicodeOk(void)
00759 {
00760   BOOL bOk = TRUE;
00761   TCHAR szUserName[MAX_STRING_LENGTH];
00762   DWORD dwSize = MAX_STRING_LENGTH;
00763
00764   if (!GetUserName(szUserName, &dwSize))
00765     bOk = ERROR_CALL_NOT_IMPLEMENTED == GetLastError() ? FALSE : TRUE;
00766
00767   return bOk;
00768 }
00769
00770
00771 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00772   Function: InitApplication
00773
00774   Summary:  Initializes the application and registers its main window
00775             class. InitApplication is called only once (in WinMain).
00776
00777   Args:     HINSTANCE hInstance)
00778               Handle to the first instance of the application.
00779
00780   Returns:  BOOL.
00781               TRUE => Success; FALSE => Failed.
00782 ------------------------------------------------------------------------F-F*/
00783 BOOL InitApplication(
00784        HINSTANCE hInstance)
00785 {
00786   BOOL bOk;
00787   // The window class for all instances of the main frame window.
00788   WNDCLASSEX wcf;
00789
00790   // Assign the appropriate values for this main frame window class.
00791   wcf.cbSize        = sizeof(WNDCLASSEX);
00792   wcf.cbClsExtra    = 0;            // No per-class extra data.
00793   wcf.cbWndExtra    = 0;            // No per-window extra data.
00794   wcf.hInstance     = hInstance;    // Application module instance.
00795   wcf.lpfnWndProc   = &WindowProc;  // Global Window Procedure (defined in
00796                                     // APPUTIL for all CVirWindows).
00797   wcf.hCursor       = LoadCursor(NULL, IDC_ARROW); // Load app cursor.
00798   wcf.hIcon         = (HICON) LoadIcon(            // Load app icon.
00799                                 hInstance,
00800                                 TEXT("AppIcon"));
00801   wcf.hIconSm       = (HICON) LoadImage(           // Load small icon.
00802                                 hInstance,
00803                                 TEXT("AppIcon"),
00804                                 IMAGE_ICON,
00805                                 16, 16,
00806                                 0);
00807   wcf.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);  // Default backgnd color.
00808   wcf.style         = CS_HREDRAW | CS_VREDRAW;     // Class style(s).
00809   wcf.lpszClassName = TEXT(MAIN_WINDOW_CLASS_NAME_STR); // Class name.
00810   wcf.lpszMenuName  = TEXT(MAIN_WINDOW_CLASS_MENU_STR); // Menu name.
00811
00812   // Register the window class and return FALSE if unsuccesful.
00813   bOk = RegisterClassEx(&wcf);
00814
00815   return (bOk);
00816 }
00817
00818
00819 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00820   Function: WinMain
00821
00822   Summary:  The Windows main entry point function for this application.
00823             Initializes the application, the COM Libraries, and starts
00824             the main application message loop.
00825
00826   Args:     HINSTANCE hInstance,
00827               Instance handle; a new one for each invocation of this app.
00828             HINSTANCE hPrevInstance,
00829               Instance handle of the previous instance. NULL in Win32.
00830             LPSTR lpCmdLine,
00831               Windows passes a pointer to the application's
00832               invocation command line.
00833             int nCmdShow)
00834               Bits telling the show state of the application.
00835
00836   Returns:  int
00837               msg.wParam (upon exit of message loop).
00838               FALSE if this instance couldn't initialize and run.
00839 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00840 extern "C" int WINAPI WinMain(
00841                         HINSTANCE hInstance,
00842                         HINSTANCE hPrevInstance,
00843                         LPSTR lpCmdLine,
00844                         int nCmdShow)
00845 {
00846   CMainWindow* pWin = NULL;
00847   int iRun = TRUE;
00848   MSG msg;
00849
00850   // If we were compiled for UNICODE and the platform seems OK with this
00851   // then proceed.  Else we error and exit the app.
00852   if (UnicodeOk())
00853   {
00854     // Call to initialize the COM Library.  Use the SUCCEEDED macro
00855     // to detect success.  If fail then exit app with error message.
00856     if (SUCCEEDED(CoInitialize(NULL)))
00857     {
00858       // If we succeeded in initializing the COM Library we proceed to
00859       // initialize the application.  If we can't init the application
00860       // then we signal shut down with an error message exit.
00861       iRun = InitApplication(hInstance);
00862       if (iRun)
00863       {
00864         // Assume we'll set iRun to TRUE when initialization is done.
00865         iRun = FALSE;
00866
00867         // We are still go for running so we try to create a nifty new
00868         // CMainWindow object for this app instance.
00869         pWin = new CMainWindow;
00870         if (NULL != pWin)
00871         {
00872           // Setup the server control object.
00873           g_pServer = new CServer;
00874           if (NULL != g_pServer)
00875           {
00876             // Assign the server's instance handle.
00877             g_pServer->m_hInstServer = hInstance;
00878
00879             // Check command line for switches to register or unregister
00880             // this server's managed components.   iRun will be set to 2
00881             // to signal an immediate and quiet exit of this application
00882             // if such registration or unregistration is requested.
00883             if (0 == lstrcmpiA(lpCmdLine, "-RegServer")
00884                 || 0 == lstrcmpiA(lpCmdLine, "/RegServer"))
00885             {
00886               if (pWin->RegisterServer())
00887                 iRun = 2;
00888             }
00889             else if (0 == lstrcmpiA(lpCmdLine, "-UnregServer")
00890                      || 0 == lstrcmpiA(lpCmdLine, "/UnregServer"))
00891             {
00892               if (pWin->UnregisterServer())
00893                 iRun = 2;
00894             }
00895
00896             if (FALSE == iRun)
00897             {
00898               // If we did not process a command line switch that
00899               // requires immediate exit, then initialize an instance of
00900               // the new CMainWindow. This entails creating the main window.
00901               if (pWin->InitInstance(hInstance, nCmdShow))
00902               {
00903                 LOGF1("L: CmdLine Switches= %s", lpCmdLine);
00904                 // Create and register the Class Factories.  But only do so
00905                 // if this application has been launched by COM as indicated
00906                 // by the -Embedding command line switch.
00907                 if (0 == lstrcmpiA(lpCmdLine, "-Embedding")
00908                     || 0 == lstrcmpiA(lpCmdLine, "/Embedding"))
00909                   iRun = g_pServer->OpenFactories();
00910               }
00911             }
00912           }
00913         }
00914       }
00915
00916       switch (iRun)
00917       {
00918         case TRUE:
00919           {
00920             // If we initialized the app instance properly then we are still
00921             // go for running.  We then start up the main message pump for
00922             // the application.  The application will live hidden as a local
00923             // server.
00924             while (GetMessage(&msg, NULL, 0, 0))
00925             {
00926               TranslateMessage(&msg);
00927               DispatchMessage(&msg);
00928             }
00929
00930             // We'll pass to the OS the reason why we exited the message
00931             // loop.
00932             iRun = (int) msg.wParam;
00933           }
00934           break;
00935
00936         case FALSE:
00937           // We failed to initialize the application--issue an error
00938           // messagebox.  Can't initialize or can't run stand-alone.
00939           ErrorBox(hInstance, NULL, IDS_APPINITFAILED);
00940
00941           // Delete the CMainWindow object.
00942           DELETE_POINTER(pWin);
00943
00944           // Pass the OS an error code of 1.
00945           iRun = 1;
00946           break;
00947
00948         default:
00949           // Pass the OS an error code of 0.
00950           iRun = 0;
00951           break;
00952       }
00953
00954       // We're exiting this app (either normally or by init failure) so
00955       // shut down the COM Library.
00956       CoUninitialize();
00957     }
00958     else
00959     {
00960       // We failed to Initialize the COM Library. Put up error message box
00961       // saying that COM Library couldn't be initialized.  Parent window
00962       // is desktop (ie, NULL). Exit the failed application (ie, by
00963       // returning FALSE to WinMain).
00964       ErrorBox(hInstance, NULL, IDS_COMINITFAILED);
00965     }
00966   }
00967   else
00968   {
00969     // If we were compiled for UNICODE but the platform has problems with
00970     // this then indicate an error and exit the app immediately.
00971     CHAR szMsg[MAX_STRING_LENGTH];
00972
00973     if (LoadStringA(
00974           hInstance,
00975           IDS_NOUNICODE,
00976           szMsg,
00977           MAX_STRING_LENGTH))
00978     {
00979       MessageBoxA(
00980         NULL,
00981         szMsg,
00982         ERROR_TITLE_STR,
00983         MB_OK | MB_ICONEXCLAMATION);
00984     }
00985   }
00986
00987   return iRun;
00988 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/ioipao.Cpp Source File

  • Com
  • Fundamentals
  • SimpSvr

ioipao.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: IOIPAO.CPP
00003 //
00004 //    Implementation file for the CClassFactory Class
00005 //
00006 // Functions:
00007 //
00008 //    See ioipao.h for a list of member functions.
00009 //
00010 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "obj.h"
00015 #include "ioipao.h"
00016 #include "app.h"
00017 #include "doc.h"
00018
00019 //**********************************************************************
00020 //
00021 // COleInPlaceActiveObject::QueryInterface
00022 //
00023 // Purpose:
00024 //
00025 //
00026 // Parameters:
00027 //
00028 //      REFIID riid         -   Interface being queried for.
00029 //
00030 //      LPVOID FAR *ppvObj  -   Out pointer for the interface.
00031 //
00032 // Return Value:
00033 //
00034 //      S_OK            - Success
00035 //      E_NOINTERFACE   - Failure
00036 //
00037 // Function Calls:
00038 //      Function                    Location
00039 //
00040 //      CSimpSvrObj::QueryInterface OBJ.CPP
00041 //
00042 // Comments:
00043 //
00044 //
00045 //********************************************************************
00046
00047 STDMETHODIMP COleInPlaceActiveObject::QueryInterface ( REFIID riid, LPVOID FAR* ppvObj)
00048 {
00049   OutputDebugString("In COleInPlaceActiveObject::QueryInterface\r\n");
00050   // need to NULL the out parameter
00051   return m_lpObj->QueryInterface(riid, ppvObj);
00052 }
00053
00054 //**********************************************************************
00055 //
00056 // COleInPlaceActiveObject::AddRef
00057 //
00058 // Purpose:
00059 //
00060 //      Increments the reference count on COleInPlaceActiveObject and the
00061 //      "object" object.
00062 //
00063 // Parameters:
00064 //
00065 //      None
00066 //
00067 // Return Value:
00068 //
00069 //      The Reference count on the "object" object.
00070 //
00071 // Function Calls:
00072 //      Function                    Location
00073 //
00074 //      OuputDebugString            Windows API
00075 //      CSimpSvrObj::AddRef         OBJ.CPP
00076 //
00077 // Comments:
00078 //
00079 //
00080 //********************************************************************
00081
00082 STDMETHODIMP_(ULONG) COleInPlaceActiveObject::AddRef ()
00083 {
00084   OutputDebugString("In COleInPlaceActiveObject::AddRef\r\n");
00085
00086   ++m_nCount;
00087
00088   return m_lpObj->AddRef();
00089 }
00090
00091 //**********************************************************************
00092 //
00093 // COleInPlaceActiveObject::Release
00094 //
00095 // Purpose:
00096 //
00097 //      Decrements the reference count of COleInPlaceActiveObject.
00098 //
00099 // Parameters:
00100 //
00101 //      None
00102 //
00103 // Return Value:
00104 //
00105 //      The new reference count
00106 //
00107 // Function Calls:
00108 //      Function                    Location
00109 //
00110 //      OutputDebugString           Windows API
00111 //      CSimpSvrObj::Release        OBJ.CPP
00112 //
00113 // Comments:
00114 //
00115 //
00116 //********************************************************************
00117
00118 STDMETHODIMP_(ULONG) COleInPlaceActiveObject::Release ()
00119 {
00120   OutputDebugString("In COleInPlaceActiveObject::Release\r\n");
00121
00122   --m_nCount;
00123
00124   return m_lpObj->Release();
00125 }
00126
00127 //**********************************************************************
00128 //
00129 // COleInPlaceActiveObject::OnDocWindowActivate
00130 //
00131 // Purpose:
00132 //
00133 //      Called when the doc window (in an MDI App) is (de)activated.
00134 //
00135 // Parameters:
00136 //
00137 //      BOOL fActivate  - TRUE if activating, FALSE if deactivating
00138 //
00139 // Return Value:
00140 //
00141 //      S_OK
00142 //
00143 // Function Calls:
00144 //      Function                            Location
00145 //
00146 //      OutputDebugString                   Windows API
00147 //      IOleInPlaceFrame::SetActiveObject   Container
00148 //      CSimpSvrObject::AddFrameLevelUI     OBJ.CPP
00149 //
00150 //
00151 // Comments:
00152 //
00153 //
00154 //********************************************************************
00155
00156 STDMETHODIMP COleInPlaceActiveObject::OnDocWindowActivate  ( BOOL fActivate )
00157 {
00158   OutputDebugString("In COleInPlaceActiveObject::OnDocWindowActivate\r\n");
00159
00160   // Activating?
00161   if (fActivate)
00162     m_lpObj->AddFrameLevelUI();
00163
00164   // No frame level tools to remove...
00165
00166   return S_OK;
00167 };
00168
00169 //**********************************************************************
00170 //
00171 // COleInPlaceActiveObject::OnFrameWindowActivate
00172 //
00173 // Purpose:
00174 //
00175 //      Called when the Frame window is (de)activating
00176 //
00177 // Parameters:
00178 //
00179 //      BOOL fActivate  - TRUE if activating, FALSE if Deactivating
00180 //
00181 // Return Value:
00182 //
00183 //      S_OK
00184 //
00185 // Function Calls:
00186 //      Function                    Location
00187 //
00188 //      OutputDebugString           Windows API
00189 //      SetFocus                    Windows API
00190 //
00191 //
00192 // Comments:
00193 //
00194 //
00195 //********************************************************************
00196
00197 STDMETHODIMP COleInPlaceActiveObject::OnFrameWindowActivate  ( BOOL fActivate)
00198 {
00199   OutputDebugString("In COleInPlaceActiveObject::OnFrameWindowActivate\r\n");
00200
00201   // set the focus to the object window if we are activating.
00202 /*    if (fActivate)
00203     SetFocus(m_lpObj->m_lpDoc->GethDocWnd()); */
00204
00205   return  S_OK ;
00206 };
00207
00208 //**********************************************************************
00209 //
00210 // COleInPlaceActiveObject::GetWindow
00211 //
00212 // Purpose:
00213 //
00214 //      Gets the objects Window Handle.
00215 //
00216 // Parameters:
00217 //
00218 //      HWND FAR* lphwnd    - Location to return the window handle.
00219 //
00220 // Return Value:
00221 //
00222 //      S_OK
00223 //
00224 // Function Calls:
00225 //      Function                    Location
00226 //
00227 //      OutputDebugString           Windows API
00228 //      CSimpSvrDoc::GethDocWnd     DOC.H
00229 //
00230 //
00231 // Comments:
00232 //
00233 //
00234 //********************************************************************
00235
00236 STDMETHODIMP COleInPlaceActiveObject::GetWindow  ( HWND FAR* lphwnd)
00237 {
00238   OutputDebugString("In COleInPlaceActiveObject::GetWindow\r\n");
00239   // need to NULL the out parameter
00240   *lphwnd = m_lpObj->m_lpDoc->GethDocWnd();
00241   return  S_OK ;
00242 };
00243
00244 //**********************************************************************
00245 //
00246 // COleInPlaceActiveObject::ContextSensitiveHelp
00247 //
00248 // Purpose:
00249 //
00250 //      Used to implement Context Sensitive help
00251 //
00252 // Parameters:
00253 //
00254 //      None
00255 //
00256 // Return Value:
00257 //
00258 //      E_NOTIMPL
00259 //
00260 // Function Calls:
00261 //      Function                    Location
00262 //
00263 //      OutputDebugString           Windows API
00264 //
00265 //
00266 // Comments:
00267 //
00268 //      See TECHNOTES.WRI include with the OLE SDK for proper
00269 //      implementation of this function.
00270 //
00271 //********************************************************************
00272
00273 STDMETHODIMP COleInPlaceActiveObject::ContextSensitiveHelp  ( BOOL fEnterMode )
00274 {
00275   OutputDebugString("In COleInPlaceActiveObject::ContextSensitiveHelp\r\n");
00276   return  E_NOTIMPL;
00277 };
00278
00279 //**********************************************************************
00280 //
00281 // COleInPlaceActiveObject::TranslateAccelerator
00282 //
00283 // Purpose:
00284 //
00285 //      Used for translating accelerators in .DLL objects.
00286 //
00287 // Parameters:
00288 //
00289 //      LPMSG lpmsg - Pointer to a message
00290 //
00291 // Return Value:
00292 //
00293 //      S_FALSE
00294 //
00295 // Function Calls:
00296 //      Function                    Location
00297 //
00298 //      OutputDebugString           Windows API
00299 //
00300 //
00301 // Comments:
00302 //
00303 //      This method should never be called since we are implemented
00304 //      in an executable.
00305 //
00306 //********************************************************************
00307
00308 STDMETHODIMP COleInPlaceActiveObject::TranslateAccelerator  ( LPMSG lpmsg)
00309 {
00310   OutputDebugString("In COleInPlaceActiveObject::TranslateAccelerator\r\n");
00311   // no accelerator table, return FALSE
00312   return  S_FALSE ;
00313 };
00314
00315 //**********************************************************************
00316 //
00317 // COleInPlaceActiveObject::ResizeBorder
00318 //
00319 // Purpose:
00320 //
00321 //      Called when the border changes size.
00322 //
00323 // Parameters:
00324 //
00325 //      LPCRECT lprectBorder                - New Border
00326 //
00327 //      LPOLEINPLACEUIWINDOW lpUIWindow     - Pointer to UIWindow
00328 //
00329 //      BOOL fFrameWindow                   - True if lpUIWindow is the
00330 //                                            frame window.
00331 //
00332 // Return Value:
00333 //
00334 //      S_OK
00335 //
00336 // Function Calls:
00337 //      Function                    Location
00338 //
00339 //      OutputDebugString           Windows API
00340 //
00341 //
00342 // Comments:
00343 //
00344 //      Need to call SetBorderSpace again...
00345 //
00346 //********************************************************************
00347
00348 STDMETHODIMP COleInPlaceActiveObject::ResizeBorder  ( LPCRECT lprectBorder,
00349                             LPOLEINPLACEUIWINDOW lpUIWindow,
00350                             BOOL fFrameWindow)
00351 {
00352   OutputDebugString("In COleInPlaceActiveObject::ResizeBorder\r\n");
00353
00354   // should always have an inplace frame...
00355   m_lpObj->GetInPlaceFrame()->SetBorderSpace(NULL);
00356
00357   // There will only be a UIWindow if in an MDI container
00358   if (m_lpObj->GetUIWindow())
00359     m_lpObj->GetUIWindow()->SetBorderSpace(NULL);
00360
00361   return  S_OK ;
00362 };
00363
00364 //**********************************************************************
00365 //
00366 // COleInPlaceActiveObject::EnableModeless
00367 //
00368 // Purpose:
00369 //
00370 //      Called to enable/disable modeless dialogs.
00371 //
00372 // Parameters:
00373 //
00374 //      BOOL fEnable    - TRUE to enable, FALSE to disable
00375 //
00376 // Return Value:
00377 //
00378 //      S_OK
00379 //
00380 // Function Calls:
00381 //      Function                    Location
00382 //
00383 //      OutputDebugString           Windows API
00384 //
00385 //
00386 // Comments:
00387 //
00388 //      Called by the container when a model dialog box is added/removed
00389 //      from the screen.  The appropriate action for a server application
00390 //      is to disable/enable any modeless dialogs currently being displayed.
00391 //      Since this application doesn't display any modeless dialogs,
00392 //      this method is essentially ignored.
00393 //
00394 //********************************************************************
00395
00396 STDMETHODIMP COleInPlaceActiveObject::EnableModeless  ( BOOL fEnable)
00397 {
00398   OutputDebugString("In COleInPlaceActiveObject::EnableModeless\r\n");
00399   return  S_OK ;
00400 };
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows2000/Pch.Cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows2000

Pch.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        pch.cpp
00007 //
00008 // Contents:    Cert Server precompiled header
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include <windows.h>
00013
00014 #include <atlbase.h>
00015
00016 //You may derive a class from CComModule and use it if you want to override
00017 //something, but do not change the name of _Module
00018 extern CComModule _Module;
00019
00020 #include <atlcom.h>
00021 #include <certsrv.h>
00022
00023 #pragma hdrstop
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/compdata.h Source File

  • SysMgmt
  • MMC
  • CutCopy

compdata.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPCOMPDATA_H_
00020 #define _SAMPCOMPDATA_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024 #include "StatNode.h"
00025 #include "Comp.h"
00026
00027 class CComponentData : public IComponentData
00028 {
00029     friend class CComponent;
00030
00031 private:
00032     ULONG       m_cref;
00033     LPCONSOLE     m_ipConsole;
00034     LPCONSOLENAMESPACE  m_ipConsoleNameSpace;
00035
00036     CStaticNode     *m_pStaticNode;
00037
00038 public:
00039     CComponentData();
00040     ~CComponentData();
00041
00042     LPCONSOLENAMESPACE GetConsoleNameSpace()
00043     {
00044         return m_ipConsoleNameSpace;
00045     }
00046
00047     ///////////////////////////////
00048     // Interface IUnknown
00049     ///////////////////////////////
00050     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00051     STDMETHODIMP_(ULONG) AddRef();
00052     STDMETHODIMP_(ULONG) Release();
00053
00054     ///////////////////////////////
00055     // Interface IComponentData
00056     ///////////////////////////////
00057     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
00058         /* [in] */ LPUNKNOWN pUnknown);
00059
00060         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
00061         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
00062
00063         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
00064         /* [in] */ LPDATAOBJECT lpDataObject,
00065         /* [in] */ MMC_NOTIFY_TYPE event,
00066         /* [in] */ LPARAM arg,
00067         /* [in] */ LPARAM param);
00068
00069         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
00070
00071     virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
00072         /* [in] */ MMC_COOKIE cookie,
00073         /* [in] */ DATA_OBJECT_TYPES type,
00074         /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
00075
00076         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
00077         /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
00078
00079         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
00080         /* [in] */ LPDATAOBJECT lpDataObjectA,
00081         /* [in] */ LPDATAOBJECT lpDataObjectB);
00082 };
00083
00084 #endif _SAMPCOMPDATA_H_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/StdAfx.Cpp Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

StdAfx.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 //
00013 // stdafx.cpp : source file that includes just the standard includes
00014 //  Imp_Draw.pch will be the pre-compiled header
00015 //  stdafx.obj will contain the pre-compiled type information
00016
00017 #include "stdafx.h"
00018
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsCmd/main.cxx Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsCmd

main.cxx

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       main.cxx
00008 //
00009 //  Contents:   Main for adscmd
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014
00015 #include "main.hxx"
00016
00017
00018 //-------------------------------------------------------------------------
00019 //
00020 // main
00021 //
00022 //-------------------------------------------------------------------------
00023
00024 int __cdecl
00025 main(int argc, char * argv[])
00026 {
00027     HRESULT hr;
00028     int exitcode;
00029
00030     if (argc != 3) {
00031         PrintUsage() ;
00032         exit(1);
00033     }
00034
00035     hr = CoInitialize(NULL);
00036
00037     if (FAILED(hr)) {
00038         printf("CoInitialize failed\n");
00039         exit(1);
00040     }
00041
00042     if (_stricmp(argv[1],"list") == 0) {
00043
00044         //
00045         // Call the List helper function
00046         //
00047
00048         exitcode = DoList(argv[2]) ;
00049     }
00050     else if (_stricmp(argv[1],"dump") == 0) {
00051
00052         //
00053         // Call the Dump helper function
00054         //
00055
00056         exitcode = DoDump(argv[2]) ;
00057     }
00058     else {
00059
00060         //
00061         // Unknown command
00062         //
00063
00064         PrintUsage() ;
00065         exitcode = 1 ;
00066     }
00067     CoUninitialize();
00068     exit(exitcode) ;
00069     return 0;
00070 }
00071 
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerText/Server.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerText

Server.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.CPP
00003
00004   Summary:   Implementation file for the C++ CServer server control
00005              object.  This object encapsulates the server's internal
00006              control of global server object and lock counts. The
00007              CThreaded OwnThis mechanism is used to ensure mutually
00008              exclusive access to this CServer object by multiple threads.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial PERTEXT.HTM
00012              file. For more specific technical details on the internal
00013              workings see the comments dispersed throughout the module's
00014              source code.
00015
00016   Classes:   CServer.
00017
00018   Functions: .
00019
00020   Origin:    5-12-97: atrent - Editor-inheritance from SERVER.CPP in
00021                the STOSERVE Tutorial Code Sample. [Revised]
00022
00023 ----------------------------------------------------------------------------
00024   This file is part of the Microsoft COM Tutorial Code Samples.
00025
00026   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00027
00028   This source code is intended only as a supplement to Microsoft
00029   Development Tools and/or on-line documentation.  See these other
00030   materials for detailed information regarding Microsoft code samples.
00031
00032   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00033   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00034   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00035   PARTICULAR PURPOSE.
00036 ==========================================================================+*/
00037
00038 /*---------------------------------------------------------------------------
00039   We include WINDOWS.H for all Win32 applications.
00040   We include OLE2.H because we will be calling the COM/OLE Libraries.
00041   We include APPUTIL.H because we will be building this DLL using
00042     the convenient Virtual Window and Dialog classes and other
00043     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00044   We include SERVER.H for the class declarations for the C++ CServer
00045     server control object.
00046 ---------------------------------------------------------------------------*/
00047 #include <windows.h>
00048 #include <ole2.h>
00049 #include <apputil.h>
00050 #include "server.h"
00051
00052
00053 /*---------------------------------------------------------------------------
00054   Implementation the internal CServer C++ object.  Used to encapsulate
00055   some server data and the methods for Lock and Object count incrementing
00056   and decrementing.
00057 ---------------------------------------------------------------------------*/
00058
00059 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00060   Method:   CServer::CServer
00061
00062   Summary:  CServer Constructor.
00063
00064   Args:     void
00065
00066   Modifies: m_hDllInst, m_hWndParent, m_cObjects, m_cLocks.
00067
00068   Returns:  void
00069 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00070 CServer::CServer(void)
00071 {
00072   m_hDllInst = NULL;
00073   m_hWndParent = NULL;
00074
00075   // Zero the Object and Lock counts for this attached process.
00076   m_cObjects = 0;
00077   m_cLocks = 0;
00078
00079   return;
00080 }
00081
00082
00083 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00084   Method:   CServer::~CServer
00085
00086   Summary:  CServer Destructor.
00087
00088   Args:     void
00089
00090   Returns:  void
00091 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00092 CServer::~CServer(void)
00093 {
00094   return;
00095 }
00096
00097
00098 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00099   Method:   CServer::Lock
00100
00101   Summary:  Increment the Server's Lock count.
00102
00103   Args:     void
00104
00105   Modifies: m_cLocks.
00106
00107   Returns:  void
00108 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00109 void CServer::Lock(void)
00110 {
00111   InterlockedIncrement((PLONG) &m_cLocks);
00112
00113   return;
00114 }
00115
00116
00117 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00118   Method:   CServer::Unlock
00119
00120   Summary:  Decrement the Server's Lock count.
00121
00122   Args:     void
00123
00124   Modifies: m_cLocks.
00125
00126   Returns:  void
00127 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00128 void CServer::Unlock(void)
00129 {
00130   InterlockedDecrement((PLONG) &m_cLocks);
00131
00132   return;
00133 }
00134
00135
00136 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00137   Method:   CServer::ObjectsUp
00138
00139   Summary:  Increment the Server's living Object count.
00140
00141   Args:     void
00142
00143   Modifies: m_cObjects.
00144
00145   Returns:  void
00146 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00147 void CServer::ObjectsUp(void)
00148 {
00149   InterlockedIncrement((PLONG) &m_cObjects);
00150
00151   return;
00152 }
00153
00154
00155 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00156   Method:   CServer::ObjectsDown
00157
00158   Summary:  Decrement the Server's living object count.
00159
00160   Args:     void
00161
00162   Modifies: m_cObjects.
00163
00164   Returns:  void
00165 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00166 void CServer::ObjectsDown(void)
00167 {
00168   InterlockedDecrement((PLONG) &m_cObjects);
00169
00170   return;
00171 }
00172
00173
00174 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00175   Method:   CServer::CanUnloadNow
00176
00177   Summary:  Check if we can unload the server (ie, if there are no longer
00178             any living COM objects and no locks.
00179
00180   Args:     void
00181
00182   Returns:  HRESULT
00183               S_OK if this server can be unloaded.
00184               S_FALSE if this server can not be unloaded.
00185 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00186 HRESULT CServer::CanUnloadNow(void)
00187 {
00188   HRESULT hr = S_FALSE;
00189   LONG cObjects, cLocks;
00190
00191   if (OwnThis())
00192   {
00193     cObjects = m_cObjects;
00194     cLocks = m_cLocks;
00195
00196     hr = (0L==cObjects && 0L==cLocks) ? S_OK : S_FALSE;
00197
00198     UnOwnThis();
00199   }
00200
00201   return hr;
00202 }
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Snmp/SnmpUtil/SnmpUtil.C Source File

  • NetDS
  • Snmp
  • SnmpUtil

SnmpUtil.C

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 Copyright 1991-2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     snmputil.c
00008
00009 Abstract:
00010
00011     Sample SNMP Management API usage for Windows NT.
00012
00013     This file is an example of how to code management applications using
00014     the SNMP Management API for Windows NT.  It is similar in operation to
00015     the other commonly available SNMP command line utilities.
00016
00017     Extensive comments have been included to describe its structure and
00018     operation.  See also "Microsoft Windows/NT SNMP Programmer's Reference".
00019
00020 Created:
00021
00022     28-Jun-1991
00023
00024 Revision History:
00025
00026
00027 --*/
00028
00029
00030 // General notes:
00031 //   Microsoft's SNMP Management API for Windows NT is implemented as a DLL
00032 // that is linked with the developer's code.  These APIs (examples follow in
00033 // this file) allow the developer's code to generate SNMP queries and receive
00034 // SNMP traps.  A simple MIB compiler and related APIs are also available to
00035 // allow conversions between OBJECT IDENTIFIERS and OBJECT DESCRIPTORS.
00036
00037
00038 // Necessary includes.
00039
00040 #include <windows.h>
00041
00042 #include <stdio.h>
00043 #include <string.h>
00044
00045 #include <snmp.h>
00046 #include <mgmtapi.h>
00047
00048
00049 // Constants used in this example.
00050
00051 #define GET     1
00052 #define GETNEXT 2
00053 #define WALK    3
00054 #define TRAP    4
00055
00056 #define TIMEOUT 6000 /* milliseconds */
00057 #define RETRIES 3
00058
00059
00060 // Main program.
00061 INT _CRTAPI1 main(
00062     IN int  argumentCount,
00063     IN char *argumentVector[])
00064     {
00065     INT                operation;
00066     LPSTR              agent;
00067     LPSTR              community;
00068     RFC1157VarBindList variableBindings;
00069     LPSNMP_MGR_SESSION session;
00070
00071     INT        timeout = TIMEOUT;
00072     INT        retries = RETRIES;
00073
00074     BYTE       requestType;
00075     AsnInteger errorStatus;
00076     AsnInteger errorIndex;
00077
00078
00079     // Parse command line arguments to determine requested operation.
00080
00081     // Verify number of arguments...
00082     if      (argumentCount < 5 && argumentCount != 2)
00083         {
00084         printf("Error:  Incorrect number of arguments specified.\n");
00085         printf(
00086 "\nusage:  snmputil [get|getnext|walk] agent community oid [oid ...]\n");
00087         printf(
00088   "        snmputil trap\n");
00089
00090         return 1;
00091         }
00092
00093     // Get/verify operation...
00094     argumentVector++;
00095     argumentCount--;
00096     if      (!strcmp(*argumentVector, "get"))
00097         operation = GET;
00098     else if (!strcmp(*argumentVector, "getnext"))
00099         operation = GETNEXT;
00100     else if (!strcmp(*argumentVector, "walk"))
00101         operation = WALK;
00102     else if (!strcmp(*argumentVector, "trap"))
00103         operation = TRAP;
00104     else
00105         {
00106         printf("Error:  Invalid operation, '%s', specified.\n",
00107                *argumentVector);
00108
00109         return 1;
00110         }
00111
00112     if (operation != TRAP)
00113         {
00114         if (argumentCount < 4)
00115             {
00116             printf("Error:  Incorrect number of arguments specified.\n");
00117             printf(
00118 "\nusage:  snmputil [get|getnext|walk] agent community oid [oid ...]\n");
00119             printf(
00120   "        snmputil trap\n");
00121
00122             return 1;
00123             }
00124
00125         // Get agent address...
00126         argumentVector++;
00127         argumentCount--;
00128         agent = (LPSTR)SnmpUtilMemAlloc((UINT)(strlen(*argumentVector) + 1));
00129         if (agent != NULL)
00130             strcpy(agent, *argumentVector);
00131         else
00132             {
00133             printf("Error: SnmpUtilMemAlloc failed to allocate memory.\n");
00134             return 1;
00135             }
00136
00137         // Get agent community...
00138         argumentVector++;
00139         argumentCount--;
00140         community = (LPSTR)SnmpUtilMemAlloc((UINT)(strlen(*argumentVector) + 1));
00141         if (community != NULL)
00142             strcpy(community, *argumentVector);
00143         else
00144             {
00145             printf("Error: SnmpUtilMemAlloc failed to allocate memory.\n");
00146             SnmpUtilMemFree(agent);
00147             return 1;
00148             }
00149
00150         // Get oid's...
00151         variableBindings.list = NULL;
00152         variableBindings.len = 0;
00153
00154         while(--argumentCount)
00155             {
00156             AsnObjectIdentifier reqObject;
00157             RFC1157VarBind * tmpVb;
00158
00159             argumentVector++;
00160
00161             // Convert the string representation to an internal representation.
00162             if (!SnmpMgrStrToOid(*argumentVector, &reqObject))
00163                 {
00164                 printf("Error: Invalid oid, %s, specified.\n", *argumentVector);
00165                 SnmpUtilMemFree(agent);
00166                 SnmpUtilMemFree(community);
00167                 SnmpUtilVarBindListFree(&variableBindings);
00168                 return 1;
00169                 }
00170             else
00171                 {
00172                 // Since sucessfull, add to the variable bindings list.
00173                 variableBindings.len++;
00174                 if ((tmpVb = (RFC1157VarBind *)SnmpUtilMemReAlloc(
00175                     variableBindings.list, sizeof(RFC1157VarBind) *
00176                     variableBindings.len)) == NULL)
00177                     {
00178                     printf("Error: Error allocating oid, %s.\n",
00179                            *argumentVector);
00180                     SnmpUtilMemFree(agent);
00181                     SnmpUtilMemFree(community);
00182                     SnmpUtilOidFree(&reqObject);
00183                     variableBindings.len--;
00184                     SnmpUtilVarBindListFree(&variableBindings);
00185
00186                     return 1;
00187                     }
00188                 variableBindings.list = tmpVb;
00189
00190                 variableBindings.list[variableBindings.len - 1].name =
00191                     reqObject; // NOTE!  structure copy
00192                 variableBindings.list[variableBindings.len - 1].value.asnType =
00193                     ASN_NULL;
00194                 }
00195             } // end while()
00196
00197         // Make sure only one variable binding was specified if operation
00198         // is WALK.
00199         if (operation == WALK && variableBindings.len != 1)
00200             {
00201             printf("Error: Multiple oids specified for WALK.\n");
00202             SnmpUtilMemFree(agent);
00203             SnmpUtilMemFree(community);
00204             SnmpUtilVarBindListFree(&variableBindings);
00205             return 1;
00206             }
00207
00208         // Establish a SNMP session to communicate with the remote agent.  The
00209         // community, communications timeout, and communications retry count
00210         // for the session are also required.
00211
00212         if ((session = SnmpMgrOpen(agent, community, timeout, retries)) == NULL)
00213             {
00214             printf("error on SnmpMgrOpen %d\n", GetLastError());
00215             SnmpUtilMemFree(agent);
00216             SnmpUtilMemFree(community);
00217             SnmpUtilVarBindListFree(&variableBindings);
00218
00219             return 1;
00220             }
00221
00222         } // end if(TRAP)
00223
00224
00225     // Determine and perform the requested operation.
00226
00227     if      (operation == GET || operation == GETNEXT)
00228         {
00229         // Get and GetNext are relatively simple operations to perform.
00230         // Simply initiate the request and process the result and/or
00231         // possible error conditions.
00232
00233
00234         if (operation == GET)
00235             requestType = ASN_RFC1157_GETREQUEST;
00236         else
00237             requestType = ASN_RFC1157_GETNEXTREQUEST;
00238
00239
00240         // Request that the API carry out the desired operation.
00241
00242         if (!SnmpMgrRequest(session, requestType, &variableBindings,
00243                             &errorStatus, &errorIndex))
00244             {
00245             // The API is indicating an error.
00246
00247             printf("error on SnmpMgrRequest %d\n", GetLastError());
00248             }
00249         else
00250             {
00251             // The API succeeded, errors may be indicated from the remote
00252             // agent.
00253
00254             if (errorStatus > 0)
00255                 {
00256                 printf("Error: errorStatus=%d, errorIndex=%d\n",
00257                        errorStatus, errorIndex);
00258                 }
00259             else
00260                 {
00261                 // Display the resulting variable bindings.
00262
00263                 UINT i;
00264
00265                 for(i=0; i < variableBindings.len; i++)
00266                     {
00267                     char *string = NULL;
00268
00269                     if (SnmpMgrOidToStr(&variableBindings.list[i].name, &string))
00270                         {
00271                         printf("Variable = %s\n", string);
00272                         if (string) SnmpUtilMemFree(string);
00273                         }
00274                     printf("Value    = ");
00275                     SnmpUtilPrintAsnAny(&variableBindings.list[i].value);
00276
00277                     printf("\n");
00278                     } // end for()
00279                 }
00280             }
00281
00282         // Free the variable bindings that have been allocated.
00283
00284         SnmpUtilVarBindListFree(&variableBindings);
00285
00286         // Free other allocated resources
00287
00288         SnmpUtilMemFree(agent);
00289         SnmpUtilMemFree(community);
00290
00291
00292         }
00293     else if (operation == WALK)
00294         {
00295         // Walk is a common term used to indicate that all MIB variables
00296         // under a given OID are to be traversed and displayed.  This is
00297         // a more complex operation requiring tests and looping in addition
00298         // to the steps for get/getnext above.
00299
00300
00301         AsnObjectIdentifier root;
00302         AsnObjectIdentifier tempOid;
00303
00304
00305         if (!SnmpUtilOidCpy(&root, &variableBindings.list[0].name))
00306             {
00307             printf("error on SnmpUtilOidCpy\n");
00308             SnmpUtilMemFree(agent);
00309             SnmpUtilMemFree(community);
00310             SnmpUtilVarBindListFree(&variableBindings);
00311             return 1;
00312             }
00313
00314         requestType = ASN_RFC1157_GETNEXTREQUEST;
00315
00316
00317         while(1)
00318             {
00319             if (!SnmpMgrRequest(session, requestType, &variableBindings,
00320                 &errorStatus, &errorIndex))
00321                 {
00322                 // The API is indicating an error.
00323
00324                 printf("error on SnmpMgrRequest %d\n", GetLastError());
00325
00326                 break;
00327                 }
00328             else
00329                 {
00330                 // The API succeeded, errors may be indicated from the remote
00331                 // agent.
00332
00333
00334                 // Test for end of subtree or end of MIB.
00335
00336                 if (errorStatus == SNMP_ERRORSTATUS_NOSUCHNAME ||
00337                     SnmpUtilOidNCmp(&variableBindings.list[0].name,
00338                     &root, root.idLength))
00339                     {
00340                     printf("End of MIB subtree.\n\n");
00341
00342                     break;
00343                     }
00344
00345
00346                 // Test for general error conditions or sucesss.
00347
00348                 if (errorStatus > 0)
00349                     {
00350                     printf("Error: errorStatus=%d, errorIndex=%d \n",
00351                         errorStatus, errorIndex);
00352
00353                     break;
00354                     }
00355                 else
00356                     {
00357                     // Display resulting variable binding for this iteration.
00358
00359                     char *string = NULL;
00360
00361                     if (SnmpMgrOidToStr(&variableBindings.list[0].name, &string))
00362                         {
00363                         printf("Variable = %s\n", string);
00364                         if (string) SnmpUtilMemFree(string);
00365                         }
00366                     printf("Value    = ");
00367                     SnmpUtilPrintAsnAny(&variableBindings.list[0].value);
00368
00369                     printf("\n");
00370                     }
00371                 } // end if()
00372
00373
00374             // Prepare for the next iteration.  Make sure returned oid is
00375             // preserved and the returned value is freed.
00376
00377             if (!SnmpUtilOidCpy(&tempOid, &variableBindings.list[0].name))
00378                 {
00379                 printf("error on SnmpUtilOidCpy\n");
00380                 SnmpUtilOidFree(&root);
00381                 SnmpUtilMemFree(agent);
00382                 SnmpUtilMemFree(community);
00383                 SnmpUtilVarBindListFree(&variableBindings);
00384                 return 1;
00385                 }
00386
00387             SnmpUtilVarBindFree(&variableBindings.list[0]);
00388
00389             if (!SnmpUtilOidCpy(&variableBindings.list[0].name, &tempOid))
00390                 {
00391                 printf("error on SnmpUtilOidCpy\n");
00392                 SnmpUtilOidFree(&tempOid);
00393                 SnmpUtilOidFree(&root);
00394                 SnmpUtilMemFree(agent);
00395                 SnmpUtilMemFree(community);
00396                 SnmpUtilVarBindListFree(&variableBindings);
00397                 return 1;
00398                 }
00399             variableBindings.list[0].value.asnType = ASN_NULL;
00400
00401             SnmpUtilOidFree(&tempOid);
00402
00403         } // end while()
00404
00405
00406         // Free the variable bindings that have been allocated.
00407
00408         SnmpUtilVarBindListFree(&variableBindings);
00409
00410         // Free other allocated resources
00411
00412         SnmpUtilOidFree(&root);
00413         SnmpUtilMemFree(agent);
00414         SnmpUtilMemFree(community);
00415
00416
00417     }
00418     else if (operation == TRAP)
00419         {
00420         // Trap handling can be done two different ways: event driven or
00421         // polled.  The following code illustrates the steps to use event
00422         // driven trap reception in a management application.
00423
00424
00425         HANDLE hNewTraps = NULL;
00426
00427
00428         if (!SnmpMgrTrapListen(&hNewTraps))
00429             {
00430             printf("error on SnmpMgrTrapListen %d\n", GetLastError());
00431             return 1;
00432             }
00433         else
00434             {
00435             printf("snmputil: listening for traps...\n");
00436             }
00437
00438
00439         while(1)
00440             {
00441             DWORD dwResult;
00442
00443             if ((dwResult = WaitForSingleObject(hNewTraps, INFINITE))
00444                 == WAIT_FAILED)
00445                 {
00446                 printf("error on WaitForSingleObject %d\n",
00447                        GetLastError());
00448                 }
00449             else if (dwResult != WAIT_OBJECT_0)
00450                 {
00451                     printf("hNewTraps is not signaled\n");
00452                 }
00453             else if (!ResetEvent(hNewTraps))
00454                 {
00455                 printf("error on ResetEvent %d\n", GetLastError());
00456                 }
00457             else
00458                 {
00459                 AsnObjectIdentifier enterprise;
00460                 AsnNetworkAddress   agentAddress;
00461                 AsnNetworkAddress   sourceAddress;
00462                 AsnInteger          genericTrap;
00463                 AsnInteger          specificTrap;
00464                 AsnOctetString      communityTrap;
00465                 AsnTimeticks        timeStamp;
00466                 RFC1157VarBindList  variableBindingsTrap;
00467
00468                 UINT i;
00469
00470                 while(SnmpMgrGetTrapEx(
00471                         &enterprise,
00472                         &agentAddress,
00473                         &sourceAddress,
00474                         &genericTrap,
00475                         &specificTrap,
00476                         &communityTrap,
00477                         &timeStamp,
00478                         &variableBindingsTrap))
00479                     {
00480
00481                     LPSTR string = NULL;
00482
00483                     printf("Incoming Trap:\n"
00484                            "  generic    = %d\n"
00485                            "  specific   = %d\n"
00486                            "  timeStamp  = %u\n",
00487                            genericTrap,
00488                            specificTrap,
00489                            timeStamp);
00490
00491                     if (SnmpMgrOidToStr(&enterprise, &string))
00492                         {
00493                         printf ("  enterprise = %s\n", string);
00494                         if (string)
00495                             SnmpUtilMemFree(string);
00496                         }
00497                     SnmpUtilOidFree(&enterprise);
00498
00499                     if (agentAddress.length == 4)
00500                         {
00501                         printf ("  agent      = %d.%d.%d.%d\n",
00502                              (int)agentAddress.stream[0],
00503                              (int)agentAddress.stream[1],
00504                              (int)agentAddress.stream[2],
00505                              (int)agentAddress.stream[3]);
00506                         }
00507                     if (agentAddress.dynamic)
00508                         {
00509                         SnmpUtilMemFree(agentAddress.stream);
00510                         }
00511
00512                     if (sourceAddress.length == 4)
00513                         {
00514                         printf ("  source IP  = %d.%d.%d.%d\n",
00515                              (int)sourceAddress.stream[0],
00516                              (int)sourceAddress.stream[1],
00517                              (int)sourceAddress.stream[2],
00518                              (int)sourceAddress.stream[3]);
00519                         }
00520                     else if (sourceAddress.length == 10)
00521                         {
00522                         printf ("  source IPX = %.2x%.2x%.2x%.2x."
00523                                 "%.2x%.2x%.2x%.2x%.2x%.2x\n",
00524                              (int)sourceAddress.stream[0],
00525                              (int)sourceAddress.stream[1],
00526                              (int)sourceAddress.stream[2],
00527                              (int)sourceAddress.stream[3],
00528                              (int)sourceAddress.stream[4],
00529                              (int)sourceAddress.stream[5],
00530                              (int)sourceAddress.stream[6],
00531                              (int)sourceAddress.stream[7],
00532                              (int)sourceAddress.stream[8],
00533                              (int)sourceAddress.stream[9]);
00534                         }
00535                     if (sourceAddress.dynamic)
00536                         {
00537                         SnmpUtilMemFree(sourceAddress.stream);
00538                         }
00539
00540                     if (communityTrap.length)
00541                         {
00542                         string = (LPSTR)SnmpUtilMemAlloc (communityTrap.length + 1);
00543                         if (string)
00544                             {
00545                             memcpy (string, communityTrap.stream, communityTrap.length);
00546                             string[communityTrap.length] = '\0';
00547                             printf ("  community  = %s\n", string);
00548                             SnmpUtilMemFree(string);
00549                             }
00550                         }
00551                     if (communityTrap.dynamic)
00552                         {
00553                         SnmpUtilMemFree(communityTrap.stream);
00554                         }
00555
00556                     for(i=0; i < variableBindingsTrap.len; i++)
00557                         {
00558
00559                         string = NULL;
00560                         if (SnmpMgrOidToStr(&variableBindingsTrap.list[i].name, &string))
00561                             {
00562                             printf("  variable   = %s\n", string);
00563                             if (string) SnmpUtilMemFree(string);
00564                             }
00565
00566                         printf("  value      = ");
00567                         SnmpUtilPrintAsnAny(&variableBindingsTrap.list[i].value);
00568                         } // end for()
00569                     printf("\n");
00570
00571
00572                     SnmpUtilVarBindListFree(&variableBindingsTrap);
00573                     }
00574
00575                 dwResult = GetLastError(); // check for errors...
00576
00577                 if ((dwResult != NOERROR) && (dwResult != SNMP_MGMTAPI_NOTRAPS))
00578                     {
00579                     printf("error on SnmpMgrGetTrap %d\n", dwResult);
00580                     }
00581                 }
00582
00583             } // end while()
00584
00585
00586         } // end if(operation)
00587
00588     if (operation != TRAP)
00589         {
00590         // Close SNMP session with the remote agent.
00591
00592         if (!SnmpMgrClose(session))
00593             {
00594             printf("error on SnmpMgrClose %d\n", GetLastError());
00595
00596             return 1;
00597             }
00598         }
00599
00600
00601     // Let the command interpreter know things went ok.
00602
00603     return 0;
00604
00605     } // end main()
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCShip/StdAfx.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCShip

StdAfx.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      stdafx.cpp
00003
00004   Summary:   source file that includes just the standard includes
00005              stdafx.pch will be the pre-compiled header
00006              stdafx.obj will contain the pre-compiled type information
00007
00008   Classes:   None
00009 -----------------------------------------------------------------------------
00010
00011 This file is part of the Microsoft COM+ Samples.
00012
00013 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00014
00015 This source code is intended only as a supplement to Microsoft
00016 Development Tools and/or on-line documentation. See these other
00017 materials for detailed information regarding Microsoft code samples.
00018
00019 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00020 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00022 PARTICULAR PURPOSE.
00023
00024 ==========================================================================+*/
00025
00026 #include "stdafx.h"
00027
00028 #ifdef _ATL_STATIC_REGISTRY
00029 #include <statreg.h>
00030 #include <statreg.cpp>
00031 #endif
00032
00033 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocClien/LocClien.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocClien

LocClien.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      LOCCLIEN.H
00003
00004   Summary:   Main include file for the LOCCLIEN executable. In addition to
00005              class definitions, this LOCCLIEN.H file contains definitions
00006              of the application's menu, string, and other resource IDs.
00007
00008              Based largely on the DLLCLIEN.EXE source code, this include
00009              file adds resource IDs for the set of menus for exercising
00010              the several COM Components manipulated in this code sample
00011              as a COM Client of those components housed the the LOCSERVE
00012              local server.
00013
00014              For a comprehensive tutorial code tour of LOCCLIEN's
00015              contents and offerings see the tutorial LOCCLIEN.HTM file.
00016              For more specific technical details on the internal workings
00017              see the comments dispersed throughout the LOCCLIEN source code.
00018
00019   Classes:   CMainWindow
00020
00021   Functions: WinMain
00022
00023   Origin:    11-20-95: atrent - Editor-inheritance from the DLLCLIEN source.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 #if !defined(LOCCLIEN_H)
00041 #define LOCCLIEN_H
00042
00043 #ifdef __cplusplus
00044
00045 extern CMsgLog* g_pMsgLog;
00046
00047 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00048   Class:    CMainWindow
00049
00050   Summary:  Class to encapsulate the application's main window, menu, and
00051             message dispatching behavior.
00052
00053   Methods:  CMainWindow
00054               Constructor.
00055             InitInstance
00056               Creates a new instance of the main window.
00057 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00058 class CMainWindow: public CVirWindow
00059 {
00060 public:
00061   CMainWindow();
00062   ~CMainWindow();
00063   BOOL InitInstance(HINSTANCE, int);
00064
00065   TCHAR m_szFileName[MAX_PATH];
00066   CMsgBox*  m_pMsgBox;
00067   CMsgLog*  m_pMsgLog;
00068
00069   // A method for getting an interface on a COM object.
00070   BOOL GetInterface(IUnknown* pObj, REFIID riid, PPVOID ppv);
00071   // Some member variables to store pointers to Car-like COM Objects.
00072   // We save pointers to each COM objects controlling IUnknown.
00073   IUnknown* m_pCar;
00074   IUnknown* m_pUtilityCar;
00075   IUnknown* m_pCruiseCar;
00076   IUnknown* m_pUtilityCruiseCar;
00077
00078 protected:
00079   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00080
00081 private:
00082   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00083
00084   WORD m_wWidth;
00085   WORD m_wHeight;
00086   TCHAR m_szHelpFile[MAX_PATH];
00087   TCHAR m_szFileTitle[MAX_PATH];
00088   TEXTMETRIC m_tm;
00089   OPENFILENAME m_ofnFile;
00090 };
00091
00092 #endif // __cplusplus
00093
00094 // Window Class String Macros.
00095 #define MAIN_WINDOW_TITLE_STR       "LOCCLIEN: Tutorial Code Sample"
00096 #define MAIN_WINDOW_CLASS_NAME_STR  "LOCCLIENWindow"
00097 #define MAIN_WINDOW_CLASS_MENU_STR  "LOCCLIENMenu"
00098 #define SERVER_WINDOW_TITLE_STR     "LOCSERVE: Tutorial Code Sample"
00099
00100 // File Name String Macros.
00101 #define SERVER_TUTFILE_STR          "locserve.htm"
00102 #define MARSHAL_TUTFILE_STR         "marshal.htm"
00103
00104 // OpenFile-related String Macros.
00105 #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
00106 #define OFN_DEFAULTTITLE_STR "Open File"
00107
00108 // File Menu Command Identifiers.
00109 #define IDM_FILE_EXIT               1000
00110
00111 // Car Menu Command Identifiers.
00112 #define IDM_CAR_CREATE              1100
00113 #define IDM_CAR_RELEASE             1101
00114 #define IDM_CAR_SHIFT               1102
00115 #define IDM_CAR_CLUTCH              1103
00116 #define IDM_CAR_SPEED               1104
00117 #define IDM_CAR_STEER               1105
00118
00119 // UtilityCar Menu Command Identifiers.
00120 #define IDM_UCAR_CREATE             1200
00121 #define IDM_UCAR_RELEASE            1201
00122 #define IDM_UCAR_SHIFT              1202
00123 #define IDM_UCAR_CLUTCH             1203
00124 #define IDM_UCAR_SPEED              1204
00125 #define IDM_UCAR_STEER              1205
00126 #define IDM_UCAR_OFFROAD            1206
00127 #define IDM_UCAR_WINCH              1207
00128
00129 // CruiseCar Menu Command Identifiers.
00130 #define IDM_CCAR_CREATE             1300
00131 #define IDM_CCAR_RELEASE            1301
00132 #define IDM_CCAR_SHIFT              1302
00133 #define IDM_CCAR_CLUTCH             1303
00134 #define IDM_CCAR_SPEED              1304
00135 #define IDM_CCAR_STEER              1305
00136 #define IDM_CCAR_ENGAGE             1306
00137 #define IDM_CCAR_ADJUST             1307
00138
00139 // UtilityCruiseCar Menu Command Identifiers.
00140 #define IDM_UCRU_CREATE             1400
00141 #define IDM_UCRU_RELEASE            1401
00142 #define IDM_UCRU_SHIFT              1402
00143 #define IDM_UCRU_CLUTCH             1403
00144 #define IDM_UCRU_SPEED              1404
00145 #define IDM_UCRU_STEER              1405
00146 #define IDM_UCRU_ENGAGE             1406
00147 #define IDM_UCRU_ADJUST             1407
00148 #define IDM_UCRU_OFFROAD            1408
00149 #define IDM_UCRU_WINCH              1409
00150
00151 // Log Menu Command Identifiers.
00152 #define IDM_LOG_LOGCLEAR            1890
00153 #define IDM_LOG_LOGGING             1891
00154 #define IDM_LOG_COPYCLIP            1892
00155
00156 // Help Menu Command Identifiers.
00157 #define IDM_HELP_CONTENTS           1900
00158 #define IDM_HELP_TUTORIAL           1901
00159 #define IDM_HELP_TUTSERVER          1902
00160 #define IDM_HELP_TUTMARSHAL         1903
00161 #define IDM_HELP_READSOURCE         1904
00162 #define IDM_HELP_ABOUT              1905
00163 #define IDM_HELP_ABOUTSERVER        1906
00164
00165 // Error-related String Identifiers.
00166 #define IDS_COMINITFAILED           2000
00167 #define IDS_APPINITFAILED           2001
00168 #define IDS_OUTOFMEMORY             2002
00169 #define IDS_NOUNICODE               2003
00170 #define IDS_NOSERVER                2004
00171
00172 #define IDS_ASSERT_FAIL             2200
00173
00174 // Notice-related String Identifiers.
00175 #define IDS_NOTIMPLEMENTED          2301
00176
00177 // Log Message String Identifiers.
00178 #define IDS_START_MESSAGE_LOG       2400
00179
00180 #endif
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/sky.h Source File

  • SysMgmt
  • MMC
  • WMI

sky.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SKY_H
00021 #define _SKY_H
00022
00023 #include "DeleBase.h"
00024
00025 class CSkyBasedVehicle : public CDelegationBase {
00026 public:
00027     CSkyBasedVehicle() { }
00028
00029     virtual ~CSkyBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Sky-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_SKYICON; }
00034
00035 private:
00036     enum { IDM_NEW_SKY = 3 };
00037
00038     // {2974380F-4C4B-11d2-89D8-000021473128}
00039     static const GUID thisGuid;
00040 };
00041
00042
00043 #endif // _SKY_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/tsfcompart/compart.cpp Source File

  • WinUI
  • tsfcompart

compart.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2001 Microsoft Corporation. All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          Compart.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019   #include statements
00020 **************************************************************************/
00021
00022 #include <windows.h>
00023 #include <windowsx.h>
00024 #include "resource.h"
00025 #include "Monitor.h"
00026
00027 /**************************************************************************
00028   function prototypes
00029 **************************************************************************/
00030
00031 INT_PTR CALLBACK DialogProc(HWND hWnd,
00032                             UINT uMessage,
00033                             WPARAM wParam,
00034                             LPARAM lParam);
00035 HRESULT CALLBACK MonitorCallback(   const GUID* pguidCompartment,
00036                                     BOOL fStatus,
00037                                     LPARAM lParam);
00038
00039 /**************************************************************************
00040   global variables and definitions
00041 **************************************************************************/
00042
00043 /**************************************************************************
00044
00045   WinMain()
00046
00047 **************************************************************************/
00048
00049 int WINAPI WinMain( HINSTANCE hInstance,
00050                     HINSTANCE hPrevInstance,
00051                     LPSTR lpCmdLine,
00052                     int nCmdShow)
00053 {
00054     CoInitialize(NULL);
00055
00056     DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG), NULL, DialogProc);
00057
00058     CoUninitialize();
00059
00060     return 0;
00061 }
00062
00063 /**************************************************************************
00064
00065   DialogProc()
00066
00067 **************************************************************************/
00068
00069 INT_PTR CALLBACK DialogProc(    HWND hWnd,
00070                                 UINT uMessage,
00071                                 WPARAM wParam,
00072                                 LPARAM lParam)
00073 {
00074     static CCompartmentMonitor *s_pCompartmentMonitor;
00075
00076     switch(uMessage)
00077     {
00078     case WM_INITDIALOG:
00079         s_pCompartmentMonitor = new CCompartmentMonitor();
00080         if(s_pCompartmentMonitor)
00081         {
00082             HRESULT hr;
00083
00084             hr = s_pCompartmentMonitor->Initialize(&GUID_COMPARTMENT_SPEECH_OPENCLOSE, MonitorCallback, (LPARAM)hWnd);
00085             if(FAILED(hr))
00086             {
00087                 s_pCompartmentMonitor->Release();
00088                 s_pCompartmentMonitor = NULL;
00089             }
00090             else
00091             {
00092                 //update the status text
00093                 BOOL    fStatus;
00094
00095                 s_pCompartmentMonitor->GetStatus(&fStatus);
00096
00097                 MonitorCallback(&GUID_COMPARTMENT_SPEECH_OPENCLOSE, fStatus, (LPARAM)hWnd);
00098             }
00099         }
00100         break;
00101
00102     case WM_COMMAND:
00103         switch(GET_WM_COMMAND_ID(wParam, lParam))
00104         {
00105         case IDC_CLOSE:
00106             PostMessage(hWnd, WM_CLOSE, 0, 0);
00107             break;
00108         }
00109         break;
00110
00111     case WM_CLOSE:
00112         EndDialog(hWnd, 0);
00113         break;
00114
00115     case WM_DESTROY:
00116         if(s_pCompartmentMonitor)
00117         {
00118             s_pCompartmentMonitor->Uninitialize();
00119             s_pCompartmentMonitor->Release();
00120             s_pCompartmentMonitor = NULL;
00121         }
00122         break;
00123     }
00124
00125     return FALSE;
00126 }
00127
00128 /**************************************************************************
00129
00130   MonitorCallback()
00131
00132 **************************************************************************/
00133
00134 HRESULT CALLBACK MonitorCallback(   const GUID* pguidCompartment,
00135                                     BOOL fStatus,
00136                                     LPARAM lParam)
00137 {
00138     TCHAR   szSpeechStatus[MAX_PATH];
00139
00140     //get the status of the speech text service
00141     if(fStatus)
00142     {
00143         lstrcpy(szSpeechStatus, TEXT("Speech Is Active"));
00144     }
00145     else
00146     {
00147         lstrcpy(szSpeechStatus, TEXT("Speech Is Inactive"));
00148     }
00149
00150     SetDlgItemText((HWND)lParam, IDC_TEXT, szSpeechStatus);
00151
00152     return S_OK;
00153 }
00154
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFmark/dap.cpp Source File

  • WinUI
  • TSFmark

dap.cpp

Go to the documentation of this file.
00001 //
00002 // dap.cpp
00003 //
00004 // ITfDisplayAttributeProvider implementation.
00005 //
00006
00007 #include "globals.h"
00008 #include "mark.h"
00009
00010 static const TCHAR c_szAttributeInfoKey[] = TEXT("Software\\Mark Text Service");
00011 static const TCHAR c_szAttributeInfoValueName[] = TEXT("DisplayAttr");
00012
00013 // this text service has only a single display attribute so we'll use
00014 // a single static object.
00015 class CDisplayAttributeInfo : public ITfDisplayAttributeInfo
00016 {
00017 public:
00018     // IUnknown
00019     STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
00020     STDMETHODIMP_(ULONG) AddRef(void)
00021     {
00022         return DllAddRef();
00023     }
00024     STDMETHODIMP_(ULONG) Release(void)
00025     {
00026         return DllRelease();
00027     }
00028
00029     // ITfDisplayAttributeInfo
00030     STDMETHODIMP GetGUID(GUID *pguid);
00031     STDMETHODIMP GetDescription(BSTR *pbstrDesc);
00032     STDMETHODIMP GetAttributeInfo(TF_DISPLAYATTRIBUTE *ptfDisplayAttr);
00033     STDMETHODIMP SetAttributeInfo(const TF_DISPLAYATTRIBUTE *ptfDisplayAttr);
00034     STDMETHODIMP Reset();
00035
00036 private:
00037     static const TF_DISPLAYATTRIBUTE _c_DefaultDisplayAttribute;
00038 }
00039 g_DisplayAttributeInfo;
00040
00041 const TF_DISPLAYATTRIBUTE CDisplayAttributeInfo::_c_DefaultDisplayAttribute =
00042 {
00043     { TF_CT_COLORREF, RGB(255, 0, 0) },     // text color
00044     { TF_CT_NONE, 0 },                      // background color (TF_CT_NONE => app default)
00045     TF_LS_SOLID,                            // underline style
00046     FALSE,                                  // underline boldness
00047     { TF_CT_COLORREF, RGB(255, 0, 0) },     // underline color
00048     TF_ATTR_INPUT                           // attribute info
00049 };
00050
00051 //+---------------------------------------------------------------------------
00052 //
00053 // QueryInterface
00054 //
00055 //----------------------------------------------------------------------------
00056
00057 STDAPI CDisplayAttributeInfo::QueryInterface(REFIID riid, void **ppvObj)
00058 {
00059     if (ppvObj == NULL)
00060         return E_INVALIDARG;
00061
00062     *ppvObj = NULL;
00063
00064     if (IsEqualIID(riid, IID_IUnknown) ||
00065         IsEqualIID(riid, IID_ITfDisplayAttributeInfo))
00066     {
00067         *ppvObj = (ITfDisplayAttributeInfo *)this;
00068     }
00069
00070     if (*ppvObj)
00071     {
00072         AddRef();
00073         return S_OK;
00074     }
00075
00076     return E_NOINTERFACE;
00077 }
00078
00079 //+---------------------------------------------------------------------------
00080 //
00081 // GetGUID
00082 //
00083 //----------------------------------------------------------------------------
00084
00085 STDAPI CDisplayAttributeInfo::GetGUID(GUID *pguid)
00086 {
00087     if (pguid == NULL)
00088         return E_INVALIDARG;
00089
00090     *pguid = c_guidMarkDisplayAttribute;
00091
00092     return S_OK;
00093 }
00094
00095 //+---------------------------------------------------------------------------
00096 //
00097 // GetDescription
00098 //
00099 //----------------------------------------------------------------------------
00100
00101 STDAPI CDisplayAttributeInfo::GetDescription(BSTR *pbstrDesc)
00102 {
00103     BSTR bstrDesc;
00104
00105     if (pbstrDesc == NULL)
00106         return E_INVALIDARG;
00107
00108     *pbstrDesc = NULL;
00109
00110     if ((bstrDesc = SysAllocString(L"Mark Display Attribute")) == NULL)
00111         return E_OUTOFMEMORY;
00112
00113     *pbstrDesc = bstrDesc;
00114
00115     return S_OK;
00116 }
00117
00118 //+---------------------------------------------------------------------------
00119 //
00120 // GetAttributeInfo
00121 //
00122 //----------------------------------------------------------------------------
00123
00124 STDAPI CDisplayAttributeInfo::GetAttributeInfo(TF_DISPLAYATTRIBUTE *ptfDisplayAttr)
00125 {
00126     HKEY hKeyAttributeInfo;
00127     LONG lResult;
00128     DWORD cbData;
00129
00130     if (ptfDisplayAttr == NULL)
00131         return E_INVALIDARG;
00132
00133     lResult = E_FAIL;
00134
00135     if (RegOpenKeyEx(HKEY_CURRENT_USER, c_szAttributeInfoKey, 0, KEY_READ, &hKeyAttributeInfo) == ERROR_SUCCESS)
00136     {
00137         cbData = sizeof(*ptfDisplayAttr);
00138
00139         lResult = RegQueryValueEx(hKeyAttributeInfo, c_szAttributeInfoValueName,
00140                                   NULL, NULL,
00141                                   (LPBYTE)ptfDisplayAttr, &cbData);
00142
00143         RegCloseKey(hKeyAttributeInfo);
00144     }
00145
00146     if (lResult != ERROR_SUCCESS || cbData != sizeof(*ptfDisplayAttr))
00147     {
00148         // go with the defaults
00149         *ptfDisplayAttr = _c_DefaultDisplayAttribute;
00150     }
00151
00152     return S_OK;
00153 }
00154
00155 //+---------------------------------------------------------------------------
00156 //
00157 // SetAttributeInfo
00158 //
00159 //----------------------------------------------------------------------------
00160
00161 STDAPI CDisplayAttributeInfo::SetAttributeInfo(const TF_DISPLAYATTRIBUTE *ptfDisplayAttr)
00162 {
00163     HKEY hKeyAttributeInfo;
00164     LONG lResult;
00165
00166     lResult = RegCreateKeyEx(HKEY_CURRENT_USER, c_szAttributeInfoKey, 0, TEXT(""),
00167                              REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00168                              &hKeyAttributeInfo, NULL);
00169
00170     if (lResult != ERROR_SUCCESS)
00171         return E_FAIL;
00172
00173     lResult = RegSetValueEx(hKeyAttributeInfo, c_szAttributeInfoValueName,
00174                             0, REG_BINARY, (const BYTE *)ptfDisplayAttr,
00175                             sizeof(*ptfDisplayAttr));
00176
00177     RegCloseKey(hKeyAttributeInfo);
00178
00179     return (lResult == ERROR_SUCCESS) ? S_OK : E_FAIL;
00180 }
00181
00182 //+---------------------------------------------------------------------------
00183 //
00184 // Reset
00185 //
00186 //----------------------------------------------------------------------------
00187
00188 STDAPI CDisplayAttributeInfo::Reset()
00189 {
00190     return SetAttributeInfo(&_c_DefaultDisplayAttribute);
00191 }
00192
00193 class CEnumDisplayAttributeInfo : public IEnumTfDisplayAttributeInfo
00194 {
00195 public:
00196     CEnumDisplayAttributeInfo();
00197     ~CEnumDisplayAttributeInfo();
00198
00199     // IUnknown
00200     STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
00201     STDMETHODIMP_(ULONG) AddRef(void);
00202     STDMETHODIMP_(ULONG) Release(void);
00203
00204     // IEnumTfDisplayAttributeInfo
00205     STDMETHODIMP Clone(IEnumTfDisplayAttributeInfo **ppEnum);
00206     STDMETHODIMP Next(ULONG ulCount, ITfDisplayAttributeInfo **rgInfo, ULONG *pcFetched);
00207     STDMETHODIMP Reset();
00208     STDMETHODIMP Skip(ULONG ulCount);
00209
00210 private:
00211     LONG _iIndex; // next display attribute to enum
00212     LONG _cRef; // COM ref count
00213 };
00214
00215 //+---------------------------------------------------------------------------
00216 //
00217 // ctor
00218 //
00219 //----------------------------------------------------------------------------
00220
00221 CEnumDisplayAttributeInfo::CEnumDisplayAttributeInfo()
00222 {
00223     DllAddRef();
00224
00225     _iIndex = 0;
00226     _cRef = 1;
00227 }
00228
00229 //+---------------------------------------------------------------------------
00230 //
00231 // dtor
00232 //
00233 //----------------------------------------------------------------------------
00234
00235 CEnumDisplayAttributeInfo::~CEnumDisplayAttributeInfo()
00236 {
00237     DllRelease();
00238 }
00239
00240 //+---------------------------------------------------------------------------
00241 //
00242 // QueryInterface
00243 //
00244 //----------------------------------------------------------------------------
00245
00246 STDAPI CEnumDisplayAttributeInfo::QueryInterface(REFIID riid, void **ppvObj)
00247 {
00248     if (ppvObj == NULL)
00249         return E_INVALIDARG;
00250
00251     *ppvObj = NULL;
00252
00253     if (IsEqualIID(riid, IID_IUnknown) ||
00254         IsEqualIID(riid, IID_IEnumTfDisplayAttributeInfo))
00255     {
00256         *ppvObj = (IEnumTfDisplayAttributeInfo *)this;
00257     }
00258
00259     if (*ppvObj)
00260     {
00261         AddRef();
00262         return S_OK;
00263     }
00264
00265     return E_NOINTERFACE;
00266 }
00267
00268
00269 //+---------------------------------------------------------------------------
00270 //
00271 // AddRef
00272 //
00273 //----------------------------------------------------------------------------
00274
00275 STDAPI_(ULONG) CEnumDisplayAttributeInfo::AddRef()
00276 {
00277     return ++_cRef;
00278 }
00279
00280 //+---------------------------------------------------------------------------
00281 //
00282 // Release
00283 //
00284 //----------------------------------------------------------------------------
00285
00286 STDAPI_(ULONG) CEnumDisplayAttributeInfo::Release()
00287 {
00288     LONG cr = --_cRef;
00289
00290     assert(_cRef >= 0);
00291
00292     if (_cRef == 0)
00293     {
00294         delete this;
00295     }
00296
00297     return cr;
00298 }
00299
00300 //+---------------------------------------------------------------------------
00301 //
00302 // Clone
00303 //
00304 // Returns a copy of the object.
00305 //----------------------------------------------------------------------------
00306
00307 STDAPI CEnumDisplayAttributeInfo::Clone(IEnumTfDisplayAttributeInfo **ppEnum)
00308 {
00309     CEnumDisplayAttributeInfo *pClone;
00310
00311     if (ppEnum == NULL)
00312         return E_INVALIDARG;
00313
00314     *ppEnum = NULL;
00315
00316     if ((pClone = new CEnumDisplayAttributeInfo) == NULL)
00317         return E_OUTOFMEMORY;
00318
00319     // the clone should match this object's state
00320     pClone->_iIndex = _iIndex;
00321
00322     *ppEnum = pClone;
00323
00324     return S_OK;
00325 }
00326
00327 //+---------------------------------------------------------------------------
00328 //
00329 // Next
00330 //
00331 // Returns an array of display attribute info objects supported by this service.
00332 //----------------------------------------------------------------------------
00333
00334 STDAPI CEnumDisplayAttributeInfo::Next(ULONG ulCount, ITfDisplayAttributeInfo **rgInfo, ULONG *pcFetched)
00335 {
00336     ULONG cFetched;
00337
00338     if (pcFetched == NULL)
00339     {
00340         // technically this is only legal if ulCount == 1, but we won't check
00341         pcFetched = &cFetched;
00342     }
00343
00344     *pcFetched = 0;
00345
00346     if (ulCount == 0)
00347         return S_OK;
00348
00349     // we only have a single display attribute to enum, so this is trivial
00350
00351     if (_iIndex == 0)
00352     {
00353         *rgInfo = &g_DisplayAttributeInfo;
00354         (*rgInfo)->AddRef();
00355         *pcFetched = 1;
00356         _iIndex++;
00357     }
00358
00359     return (*pcFetched == ulCount) ? S_OK : S_FALSE;
00360 }
00361
00362 //+---------------------------------------------------------------------------
00363 //
00364 // Reset
00365 //
00366 // Resets the enumeration.
00367 //----------------------------------------------------------------------------
00368
00369 STDAPI CEnumDisplayAttributeInfo::Reset()
00370 {
00371     _iIndex = 0;
00372     return S_OK;
00373 }
00374
00375 //+---------------------------------------------------------------------------
00376 //
00377 // Skip
00378 //
00379 // Skips past objects in the enumeration.
00380 //----------------------------------------------------------------------------
00381
00382 STDAPI CEnumDisplayAttributeInfo::Skip(ULONG ulCount)
00383 {
00384     // we have only a single item to enum
00385     // so we can just skip it and avoid any overflow errors
00386     if (ulCount > 0 && _iIndex == 0)
00387     {
00388         _iIndex++;
00389     }
00390     return S_OK;
00391 }
00392
00393 //+---------------------------------------------------------------------------
00394 //
00395 // EnumDisplayAttributeInfo
00396 //
00397 //----------------------------------------------------------------------------
00398
00399 STDAPI CMarkTextService::EnumDisplayAttributeInfo(IEnumTfDisplayAttributeInfo **ppEnum)
00400 {
00401     CEnumDisplayAttributeInfo *pAttributeEnum;
00402
00403     if (ppEnum == NULL)
00404         return E_INVALIDARG;
00405
00406     *ppEnum = NULL;
00407
00408     if ((pAttributeEnum = new CEnumDisplayAttributeInfo) == NULL)
00409         return E_OUTOFMEMORY;
00410
00411     *ppEnum = pAttributeEnum;
00412
00413     return S_OK;
00414 }
00415
00416 //+---------------------------------------------------------------------------
00417 //
00418 // GetDisplayAttributeInfo
00419 //
00420 //----------------------------------------------------------------------------
00421
00422 STDAPI CMarkTextService::GetDisplayAttributeInfo(REFGUID guidInfo, ITfDisplayAttributeInfo **ppInfo)
00423 {
00424     if (ppInfo == NULL)
00425         return E_INVALIDARG;
00426
00427     *ppInfo = NULL;
00428
00429     // unsupported GUID?
00430     if (!IsEqualGUID(guidInfo, c_guidMarkDisplayAttribute))
00431         return E_INVALIDARG;
00432
00433     *ppInfo = &g_DisplayAttributeInfo;
00434     (*ppInfo)->AddRef();
00435
00436     return S_OK;
00437 }
Generated on Wed Nov 13 2024 16:52:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/Error.h Source File

  • Web
  • MSAgent
  • c
  • Cap

Error.h

Go to the documentation of this file.
00001 #ifndef _Error_h_
00002 #define _Error_h_
00003
00004
00005 void SystemError(HWND hWndParent, HRESULT hRes, BOOL bWarning);
00006
00007
00008 #endif
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IStorageProperties Member List

This is the complete list of members for IStorageProperties, including all inherited members.
CanBeManaged(void) | IStorageProperties
HrGetDeviceID(BSTR *pbstrDeviceIDOut) | IStorageProperties
HrGetDeviceIndex(DWORD *pidxDeviceOut) | IStorageProperties
HrGetDiskNames(BSTR *pbstrDiskNameOut, BSTR *pbstrDeviceNameOut) | IStorageProperties
HrGetSCSIBus(ULONG *pulSCSIBusOut) | IStorageProperties
HrGetSCSIPort(ULONG *pulSCSIPortOut) | IStorageProperties
HrGetSignature(DWORD *pdwSignatureOut) | IStorageProperties
HrIsDynamicDisk(void) | IStorageProperties
HrIsGPTDisk(void) | IStorageProperties
HrSetFriendlyName(LPCWSTR pcszFriendlyNameIn) | IStorageProperties
IsThisLogicalDisk(WCHAR cLogicalDiskIn) | IStorageProperties
Generated on Wed Nov 13 2024 16:57:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vc/mydatasource.cpp Source File

  • Dataaccess
  • osp
  • vc

mydatasource.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample OLEDB Simple Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation.  All Rights Reserved.
00004 //
00005 // module MyDataSource.cpp | MyDataSource (OLEDBSimpleProvider) object implementation
00006 //
00007 //
00008
00009 ////////////////////////////////////////////////////////
00010 // Includes
00011 //
00012 ////////////////////////////////////////////////////////
00013 #include "Common.h"
00014 #include "MyDataSource.h"
00015
00016
00017 ////////////////////////////////////////////////////////
00018 // MyDataSource
00019 //
00020 ////////////////////////////////////////////////////////
00021
00022 MyDataSource::MyDataSource()
00023 {
00024   //IUnknown
00025   m_cRef = 0;
00026
00027   //OLEDBSimpleProvider
00028   m_pMyOSPObject = NULL;
00029
00030   //DataMembers (tables)
00031   m_cTables = 1;
00032   m_rgpwszTableName[0] = L"";
00033 }
00034
00035 MyDataSource::~MyDataSource()
00036 {
00037   // Remove all Listeners:
00038   while (!m_listListeners.IsEmpty())
00039     m_listListeners.RemoveHead()->Release();
00040
00041   // Remove the Simple provider instance:
00042   SAFE_RELEASE(m_pMyOSPObject);
00043 }
00044
00045 HRESULT MyDataSource::Init()
00046 {
00047   //Create a new Simple Provider instance:
00048   m_pMyOSPObject = new MyOSPObject;
00049   if (!m_pMyOSPObject)
00050     return E_OUTOFMEMORY;
00051   SAFE_ADDREF(m_pMyOSPObject);
00052   return S_OK;
00053 }
00054
00055 HRESULT MyDataSource::QueryInterface(REFIID riid, void** ppv)
00056 {
00057   if (ppv == NULL)
00058     return E_INVALIDARG;
00059
00060   // IUnknown:
00061   if (riid == IID_IUnknown)
00062     *ppv = (IUnknown*)this;
00063
00064   // DataSource:
00065   else if (riid == IID_DataSource)
00066     *ppv = (IDataSource*)this;
00067
00068   // Unsupported:
00069   else
00070   {
00071     *ppv = NULL;
00072     return E_NOINTERFACE;
00073   }
00074
00075   SAFE_ADDREF((IUnknown*)*ppv);
00076   return S_OK;
00077 }
00078
00079
00080 ////////////////////////////////////////////////////////
00081 // IDataSource implementation
00082 //
00083 ////////////////////////////////////////////////////////
00084 HRESULT MyDataSource::getDataMember(BSTR bstrDM, REFIID riid, IUnknown** ppUnk)
00085 {
00086   HRESULT hr = S_OK;
00087
00088   if (ppUnk==NULL)
00089     return E_INVALIDARG;
00090
00091   if (bstrDM == NULL || bstrDM[0] == L'\0')
00092   {
00093     hr = m_pMyOSPObject->Init(m_rgpwszTableName[0]);
00094   }
00095   else
00096   {
00097     hr = m_pMyOSPObject->Init(bstrDM);
00098   }
00099   if (hr != S_OK)
00100     return hr;
00101
00102   hr = m_pMyOSPObject->QueryInterface(riid, (void**)ppUnk);
00103   return hr;
00104 }
00105
00106 HRESULT MyDataSource::getDataMemberName(LONG lIndex, BSTR* pbstrDM)
00107 {
00108   if (lIndex < 0 || lIndex >= (LONG)m_cTables || pbstrDM==NULL)
00109     return E_INVALIDARG;
00110
00111   //Return indexed TableName
00112   *pbstrDM = SysAllocString(m_rgpwszTableName[lIndex]);
00113   return S_OK;
00114 }
00115
00116 HRESULT MyDataSource::getDataMemberCount(LONG* plCount)
00117 {
00118   if(plCount==NULL)
00119     return E_INVALIDARG;
00120
00121   //Return number of tables
00122   *plCount = m_cTables;
00123   return S_OK;
00124 }
00125
00126
00127 HRESULT MyDataSource::addDataSourceListener(IDataSourceListener* pIDataSourceListener)
00128 {
00129   if (pIDataSourceListener == NULL)
00130     return E_INVALIDARG;
00131
00132   // Add the Listener:
00133   pIDataSourceListener->AddRef();
00134   m_listListeners.AddTail(pIDataSourceListener);
00135   return S_OK;
00136 }
00137
00138 HRESULT MyDataSource::removeDataSourceListener(IDataSourceListener* pIDataSourceListener)
00139 {
00140   if (pIDataSourceListener == NULL)
00141     return E_INVALIDARG;
00142
00143   // Find the Listener in the list and release it:
00144   POS pos = m_listListeners.Find(pIDataSourceListener);
00145   if (pos == NULL)
00146     return E_FAIL;
00147   SAFE_RELEASE(pIDataSourceListener);
00148   m_listListeners.RemoveAt(pos);
00149   return S_OK;
00150 }
00151
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCShip2/QCShip2.Idl Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCShip2

QCShip2.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      QCShip.idl
00003   Summary:   Interfaces for Queued Components Order Entry Sample 2
00004   Classes:   Declared: Ship2
00005   Origin:    Implementation of case study in Queued Components specification.
00006 ----------------------------------------------------------------------------
00007   Copyright 1992 - 1998 Microsoft Corporation, All rights reserved.
00008
00009     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012     PARTICULAR PURPOSE
00013 ==========================================================================+*/
00014
00015 #include "mtxattr.h"  // For TRANSACTION_REQUIRED
00016
00017 import "oaidl.idl";   // Automation data types
00018
00019 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00020   Interface: IShip
00021   Summary:   Represents an order and its line items to the shipping department
00022   Methods:   HRESULT CustomerId - sets Customer Identifier property
00023        HRESULT OrderId - sets Order Identifier property
00024        HRESULT LineItem - adds an item to an order
00025              HRESULT ProcessOrder - Completes order
00026 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00027
00028 [
00029   helpstring("IShip2 Interface"), uuid(481EEAE0-C471-11d2-BA65-00C04F8EEE36),
00030   object, dual, nonextensible, hidden, pointer_default(unique),
00031   QUEUEABLE
00032 ]
00033 interface IShip2 : IDispatch
00034 {
00035   [id(1), propput] HRESULT CustomerId([in] long lCustomerId);
00036   [id(2), propput] HRESULT OrderId([in] long lOrderId);
00037   [id(3)] HRESULT LineItem([in] long lItemId, [in] long lQuantity);
00038   [id(4)] HRESULT Process([in] long lFlags, [in] IUnknown *punkNotify);
00039 }
00040
00041 [
00042   uuid(6DD1E6CF-28C1-11D2-B5B6-00C04FC340EE),
00043   version(1.0),
00044   helpstring("QCShip2 1.0 Type Library")
00045 ]
00046
00047 // Library and classes
00048
00049 library QCSHIP2Lib
00050 {
00051   importlib("stdole2.tlb");
00052
00053 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00054   ObjectClass: Ship2
00055   Summary:     presented order to shipping department, get shipping status
00056   Interfaces:  IUnknown     Standard COM object interface
00057                IShip2     The order to be shipped
00058   Aggregation: Not supported
00059 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00060
00061   [
00062     helpstring("Ship2 Class"), uuid(E0750B65-C471-11d2-BA65-00C04F8EEE36),
00063     TRANSACTION_REQUIRED
00064   ]
00065   coclass Ship2 { [default] interface IShip2; };
00066 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/tracemacro.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

tracemacro.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "TraceMacro.h"
00017 #include <StdIo.h>             // Needed for sprintf on Win98
00018
00019
00020 //---------------------------------------------------------------------------
00021 //  Function implementations
00022 //
00023
00024 //---------------------------------------------------------------------------
00025 //  Provides trace output for HRESULTs in hex.
00026 //
00027 VOID Trace_HR
00028 (
00029   LPCTSTR pszClass,        //[in] Class name for message
00030   LPCTSTR pszFunction,     //[in] Function name for message
00031   HRESULT hr               //[in] HRESULT to display as a value
00032 )
00033 {
00034 #ifdef _DEBUG
00035
00036   TCHAR  szBuffer[512];
00037   TCHAR  szFormat[] = _T("%s::%s-> Returned 0x%X\n");
00038   INT    nChars     = 0;
00039
00040   nChars = _stprintf( szBuffer, szFormat, pszClass, pszFunction, hr );
00041   _ASSERTE( nChars < sizeof(szBuffer) );
00042
00043   OutputDebugString( szBuffer );
00044
00045 #endif
00046 } //end Trace_HR()
00047
00048
00049 //---------------------------------------------------------------------------
00050 //  Provides trace output for user defined numeric values in the form:
00051 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00052 //
00053 VOID Trace_Value
00054 (
00055   LPCTSTR pszClass,        //[in] Class name for message
00056   LPCTSTR pszFunction,     //[in] Function name for message
00057   LPCTSTR pszValueName,    //[in] Value name for message
00058   LONG    nValue           //[in] Numeric value for message
00059 )
00060 {
00061 #ifdef _DEBUG
00062
00063   TCHAR  szBuffer[512];
00064   TCHAR  szFormat[] = _T("%s::%s-> %s = %u\n");
00065   INT    nChars     = 0;
00066
00067   nChars = _stprintf( szBuffer,
00068                       szFormat,
00069                       pszClass,
00070                       pszFunction,
00071                       pszValueName,
00072                       nValue
00073                     );
00074   _ASSERTE( nChars < sizeof(szBuffer) );
00075
00076   OutputDebugString( szBuffer );
00077
00078 #endif
00079 } //end Trace_Value()
00080
00081 //---------------------------------------------------------------------------
00082 //  Provides trace output for user defined numeric values in the form:
00083 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00084 //
00085 VOID Trace_Pointer
00086 (
00087   LPCTSTR pszClass,        //[in] Class name for message
00088   LPCTSTR pszFunction,     //[in] Function name for message
00089   LPCTSTR pszAction,       //[in] Action which was taken
00090   ULONG   ulValue          //[in] Numeric value for message
00091 )
00092 {
00093 #ifdef _DEBUG
00094
00095   TCHAR  szBuffer[512];
00096   TCHAR  szFormat[] = _T("%s::%s-> %s = 0x%X\n");
00097   INT    nChars     = 0;
00098
00099   nChars = _stprintf( szBuffer,
00100                       szFormat,
00101                       pszClass,
00102                       pszFunction,
00103                       pszAction,
00104                       ulValue
00105                     );
00106   _ASSERTE( nChars < sizeof(szBuffer) );
00107
00108   OutputDebugString( szBuffer );
00109
00110 #endif
00111 } //end Trace_Pointer()
00112
00113
00114 //---------------------------------------------------------------------------
00115 //  Provides trace output which shows the class name, function name, and
00116 //  a string which maps to an MMC notification.
00117 //
00118 VOID Trace_Event
00119 (
00120   LPCTSTR pszClass,        //[in] Class name for message
00121   LPCTSTR pszFunction,     //[in] Event name for message
00122   LONG    nEvent           //[in] Event code to map to string
00123 )
00124 {
00125 #ifdef _DEBUG
00126
00127   TCHAR  szEventStr[64];
00128   TCHAR  szBuffer[512];
00129   TCHAR  szFormat[] = _T("%s::%s-> Event = %s\n");
00130   INT    nChars     = 0;
00131
00132   MapEvent( nEvent, szEventStr );
00133
00134   nChars = _stprintf( szBuffer,
00135                       szFormat,
00136                       pszClass,
00137                       pszFunction,
00138                       szEventStr
00139                     );
00140   _ASSERTE( nChars < sizeof(szBuffer) );
00141
00142   OutputDebugString( szBuffer );
00143
00144 #endif
00145 } //end Trace_Event()
00146
00147 //---------------------------------------------------------------------------
00148 //  Provides trace output which shows the class name and function name
00149 //
00150 VOID Trace_Start
00151 (
00152   LPCTSTR pszClass,        //[in] Class name for message
00153   LPCTSTR pszFunction      //[in] Event name for message
00154 )
00155 {
00156 #ifdef _DEBUG
00157
00158   TCHAR  szBuffer[512];
00159   TCHAR  szFormat[] = _T("%s::%s-> Started \n");
00160   INT    nChars     = 0;
00161
00162   nChars = _stprintf( szBuffer,
00163                       szFormat,
00164                       pszClass,
00165                       pszFunction
00166                     );
00167   _ASSERTE( nChars < sizeof(szBuffer) );
00168
00169   OutputDebugString( szBuffer );
00170
00171 #endif
00172 } //end Trace_Start()
00173
00174
00175
00176 //---------------------------------------------------------------------------
00177 // Provides human readable output for notifications
00178 //
00179 VOID MapEvent( LONG Event, LPTSTR szEventStr )
00180 {
00181 #ifdef _DEBUG
00182
00183   switch( Event )
00184   {
00185     case MMCN_ACTIVATE:
00186       _tcscpy( szEventStr, _T("MMCN_ACTIVATE          ") );
00187       break;
00188
00189     case MMCN_ADD_IMAGES:
00190       _tcscpy( szEventStr, _T("MMCN_ADD_IMAGES        ") );
00191       break;
00192
00193     case MMCN_BTN_CLICK:
00194       _tcscpy( szEventStr, _T("MMCN_BTN_CLICK         ") );
00195       break;
00196
00197     case MMCN_CLICK:
00198       _tcscpy( szEventStr, _T("MMCN_CLICK             ") );
00199       break;
00200
00201     case MMCN_COLUMN_CLICK:
00202       _tcscpy( szEventStr, _T("MMCN_COLUMN_CLICK       ") );
00203       break;
00204
00205     case MMCN_CONTEXTMENU:
00206       _tcscpy( szEventStr, _T("MMCN_CONTEXTMENU        ") );
00207       break;
00208
00209     case MMCN_CUTORMOVE:
00210       _tcscpy( szEventStr, _T("MMCN_CUTORMOVE          ") );
00211       break;
00212
00213     case MMCN_DBLCLICK:
00214       _tcscpy( szEventStr, _T("MMCN_DBLCLICK           ") );
00215       break;
00216
00217     case MMCN_DELETE:
00218       _tcscpy( szEventStr, _T("MMCN_DELETE             ") );
00219       break;
00220
00221     case MMCN_DESELECT_ALL:
00222       _tcscpy( szEventStr, _T("MMCN_DESELECT_ALL       ") );
00223       break;
00224
00225     case MMCN_EXPAND:
00226       _tcscpy( szEventStr, _T("MMCN_EXPAND             ") );
00227       break;
00228
00229     case MMCN_HELP:
00230       _tcscpy( szEventStr, _T("MMCN_HELP               ") );
00231       break;
00232
00233     case MMCN_MENU_BTNCLICK:
00234       _tcscpy( szEventStr, _T("MMCN_MENU_BTNCLICK      ") );
00235       break;
00236
00237     case MMCN_MINIMIZED:
00238       _tcscpy( szEventStr, _T("MMCN_MINIMIZED          ") );
00239       break;
00240
00241     case MMCN_PASTE:
00242       _tcscpy( szEventStr, _T("MMCN_PASTE              ") );
00243       break;
00244
00245     case MMCN_PROPERTY_CHANGE:
00246       _tcscpy( szEventStr, _T("MMCN_PROPERTY_CHANGE    ") );
00247       break;
00248
00249     case MMCN_QUERY_PASTE:
00250       _tcscpy( szEventStr, _T("MMCN_QUERY_PASTE        ") );
00251       break;
00252
00253     case MMCN_REFRESH:
00254       _tcscpy( szEventStr, _T("MMCN_REFRESH            ") );
00255       break;
00256
00257     case MMCN_REMOVE_CHILDREN:
00258       _tcscpy( szEventStr, _T("MMCN_REMOVE_CHILDREN    ") );
00259       break;
00260
00261     case MMCN_RENAME:
00262       _tcscpy( szEventStr, _T("MMCN_RENAME             ") );
00263       break;
00264
00265     case MMCN_SELECT:
00266       _tcscpy( szEventStr, _T("MMCN_SELECT             ") );
00267       break;
00268
00269     case MMCN_SHOW:
00270       _tcscpy( szEventStr, _T("MMCN_SHOW               ") );
00271       break;
00272
00273     case MMCN_VIEW_CHANGE:
00274       _tcscpy( szEventStr, _T("MMCN_VIEW_CHANGE        ") );
00275       break;
00276
00277     case MMCN_SNAPINHELP:
00278       _tcscpy( szEventStr, _T("MMCN_SNAPINHELP         ") );
00279       break;
00280
00281     case MMCN_CONTEXTHELP:
00282       _tcscpy( szEventStr, _T("MMCN_CONTEXTHELP        ") );
00283       break;
00284
00285     case MMCN_INITOCX:
00286       _tcscpy( szEventStr, _T("MMCN_INITOCX            ") );
00287       break;
00288
00289     // MMC Version 1.1 notifications
00290     case MMCN_FILTER_CHANGE:
00291       _tcscpy( szEventStr, _T("MMCN_FILTER_CHANGE      ") );
00292       break;
00293
00294     case MMCN_FILTERBTN_CLICK:
00295       _tcscpy( szEventStr, _T("MMCN_FILTERBTN_CLICK    ") );
00296       break;
00297
00298     case MMCN_RESTORE_VIEW:
00299       _tcscpy( szEventStr, _T("MMCN_RESTORE_VIEW       ") );
00300       break;
00301
00302     case MMCN_PRINT:
00303       _tcscpy( szEventStr, _T("MMCN_PRINT              ") );
00304       break;
00305
00306     case MMCN_PRELOAD:
00307       _tcscpy( szEventStr, _T("MMCN_PRELOAD            ") );
00308       break;
00309
00310     case MMCN_LISTPAD:
00311       _tcscpy( szEventStr, _T("MMCN_LISTPAD            ") );
00312       break;
00313
00314     case MMCN_EXPANDSYNC:
00315       _tcscpy( szEventStr, _T("MMCN_EXPANDSYNC         ") );
00316       break;
00317
00318     // MMC Version 1.2 notifications
00319     case MMCN_COLUMNS_CHANGED:
00320       _tcscpy( szEventStr, _T("MMCN_COLUMNS_CHANGED    ") );
00321       break;
00322
00323     // MMC Version 2.0 notifications
00324     case MMCN_CANPASTE_OUTOFPROC:
00325       _tcscpy( szEventStr, _T("MMCN_CANPASTE_OUTOFPROC ") );
00326       break;
00327
00328     default:
00329       _stprintf( szEventStr, _T("0x%X"), Event );
00330       break;
00331   }
00332
00333 #endif
00334 } //end MapEvent()
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ASyncWrite/openf.c Source File

  • Web
  • iis
  • extensions
  • io
  • ASyncWrite

openf.c

Go to the documentation of this file.
00001 /* Copyright (c) 1995-2002 Microsoft Corporation
00002
00003   Module Name:
00004
00005     openf.c
00006
00007   Abstract:
00008
00009     This module implements a simple open file handle cache
00010 */
00011
00012 #include "openf.h"
00013
00014 /* internal data structure for maintaining the list of open file handles. */
00015
00016 typedef struct _OPEN_FILE {
00017
00018   HANDLE  hFile;
00019   struct _OPEN_FILE * pNext;
00020   LONG    nHits;
00021   LONG    nRefs;
00022   CHAR    rgchFile[MAX_PATH + 1];
00023
00024 } OPEN_FILE, *LPOPEN_FILE;
00025
00026 LPOPEN_FILE g_pOpenFiles = NULL;
00027 CRITICAL_SECTION g_csOpenFiles;
00028
00029 /* Set up global variables containing the flags for CreateFile. The flags can be masked for Windows 95 system */
00030
00031 DWORD  g_dwCreateFileShareMode = (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE);
00032 DWORD  g_dwCreateFileFlags = (FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_OVERLAPPED);
00033
00034 VOID InitFileHandleCache(VOID)
00035 {
00036   InitializeCriticalSection(&g_csOpenFiles);
00037 }
00038
00039 DWORD CleanupFileHandleCache(VOID)
00040 {
00041   LPOPEN_FILE  pFileScan;
00042
00043   while (g_pOpenFiles != NULL) {
00044
00045     pFileScan = g_pOpenFiles;
00046
00047     g_pOpenFiles = g_pOpenFiles->pNext;
00048
00049     if (pFileScan->hFile != INVALID_HANDLE_VALUE)
00050       CloseHandle( pFileScan->hFile);
00051
00052     LocalFree(pFileScan);
00053   }
00054
00055   DeleteCriticalSection(&g_csOpenFiles);
00056
00057   return NO_ERROR;
00058 }
00059
00060 /*
00061   Description:
00062
00063     This function opens the file specified in the 'pszFile'.
00064     If the file name starts with a '/' we use the ECB to map
00065     the given path into a physical file path.
00066
00067   Arguments:
00068
00069     pecb - pointer to the ECB block
00070     pszFile - pointer to file name
00071
00072   Returns:
00073
00074     valid File handle on success
00075 */
00076
00077 HANDLE FcOpenFile(IN EXTENSION_CONTROL_BLOCK *pecb, IN LPCSTR pszFile)
00078 {
00079   LPOPEN_FILE pFileScan;
00080   HANDLE hFile = INVALID_HANDLE_VALUE;
00081
00082   EnterCriticalSection(&g_csOpenFiles);
00083
00084   for (pFileScan =  g_pOpenFiles; NULL != pFileScan; pFileScan = pFileScan->pNext) {
00085
00086     if (0 == lstrcmpi(pFileScan->rgchFile, pszFile)) {
00087
00088       /* there is a file match. */
00089
00090       break;
00091     }
00092   }
00093
00094   if (NULL == pFileScan) {
00095
00096     /* File was not found. Create a new file handle */
00097
00098     CHAR rgchFileName[ MAX_PATH]; /* local copy */
00099     LPCSTR pszInputPath = pszFile;
00100
00101     lstrcpyn(rgchFileName, pszFile, MAX_PATH);
00102
00103     if (*pszFile == '/') {
00104
00105       DWORD cbSize = sizeof(rgchFileName);
00106       BOOL fRet;
00107
00108       /* reset the file pointer, so subsequent use will fail */
00109
00110       pszFile = NULL;
00111
00112       /* Using the ECB map the Virtual path to the Physical path */
00113
00114       fRet = pecb->ServerSupportFunction(pecb->ConnID, HSE_REQ_MAP_URL_TO_PATH, rgchFileName, &cbSize, NULL);
00115
00116       if (fRet) {
00117
00118           /* we got the mapping. Use it. */
00119
00120           pszFile = rgchFileName;
00121       }
00122     }
00123
00124     if (NULL != pszFile) {
00125
00126       pFileScan = LocalAlloc(LPTR, sizeof(*pFileScan));
00127
00128       if (NULL != pFileScan) {
00129
00130         SECURITY_ATTRIBUTES sa;
00131
00132         sa.nLength = sizeof(sa);
00133         sa.lpSecurityDescriptor = NULL;
00134         sa.bInheritHandle = FALSE;
00135
00136         pFileScan->hFile = CreateFile(pszFile, GENERIC_READ, g_dwCreateFileShareMode, &sa, OPEN_EXISTING, g_dwCreateFileFlags, NULL);
00137
00138         if (INVALID_HANDLE_VALUE == pFileScan->hFile) {
00139
00140           LocalFree(pFileScan);
00141
00142           pFileScan = NULL;
00143
00144         } else {
00145
00146           /* insert this into the list at the top */
00147
00148           lstrcpyn(pFileScan->rgchFile, pszInputPath, MAX_PATH);
00149
00150           pFileScan->pNext = g_pOpenFiles;
00151
00152           g_pOpenFiles = pFileScan;
00153
00154           pFileScan->nRefs = 1;
00155           pFileScan->nHits = 0;
00156         }
00157       }
00158     }
00159   }
00160
00161   if (NULL != pFileScan) {
00162
00163     hFile = pFileScan->hFile;
00164
00165     pFileScan->nHits++;
00166     pFileScan->nRefs++;
00167   }
00168
00169   LeaveCriticalSection(&g_csOpenFiles);
00170
00171   return hFile;
00172 }
00173
00174 DWORD FcCloseFile(IN HANDLE hFile)
00175 {
00176   LPOPEN_FILE pFileScan;
00177   DWORD dwError = NO_ERROR;
00178
00179   EnterCriticalSection(&g_csOpenFiles);
00180
00181   /* Look for the handle and decrement the ref count. */
00182
00183   for (pFileScan = g_pOpenFiles; NULL != pFileScan; pFileScan = pFileScan->pNext) {
00184
00185     if ( hFile == pFileScan->hFile) {
00186
00187       /*  there is a file match. */
00188
00189       pFileScan->nRefs--;
00190
00191       /*
00192         Note: This is example code. Do not use for production, as there
00193         is no freeing of the file when Ref hits 0
00194       */
00195
00196       break;
00197     }
00198   }
00199
00200   if (NULL == pFileScan) {
00201
00202     /* file handle not found */
00203
00204     dwError = (ERROR_INVALID_HANDLE);
00205   }
00206
00207   LeaveCriticalSection(&g_csOpenFiles);
00208
00209   return dwError;
00210 }
00211
00212 /*
00213   Description:
00214
00215     Reads contents of file [hFile] from the specified offset in the overlapped
00216     structure. The contents are read into the buffer supplied.
00217
00218   Arguments:
00219
00220     hFile        - handle for the File from which to read data
00221     pchBuffer    - pointer to the buffer into which the data is to be read
00222     dwBufferSize - DWORD containing the max size of the buffer supplied
00223     pcbRead      - number of bytes read from the file
00224     pov          - pointer to an overlapped structure that contains the
00225                     offset from where to read the contents. The
00226                     overlapped structure also is used for Overlapped
00227                     IO in NT.
00228
00229   Notes:
00230
00231     This function automatically handles both Windows 95 and NT
00232
00233   Returns:
00234
00235     TRUE on success and FALSE if there is a failure.
00236     Use GetLastError() to get the last error code on failure.
00237 */
00238
00239 BOOL FcReadFromFile(IN HANDLE hFile, OUT CHAR *pchBuffer, IN DWORD dwBufferSize, OUT LPDWORD pcbRead, IN OUT LPOVERLAPPED pov)
00240 {
00241   BOOL fRet = TRUE;
00242
00243   *pcbRead = 0;
00244
00245   ResetEvent(pov->hEvent);
00246
00247   /* read data from file */
00248
00249   if (!ReadFile(hFile, pchBuffer, dwBufferSize, pcbRead, pov)) {
00250
00251     DWORD err = GetLastError();
00252
00253     if ((err != ERROR_IO_PENDING) || !GetOverlappedResult(hFile, pov, pcbRead, TRUE))
00254       fRet = FALSE;
00255   }
00256
00257   if (fRet)
00258     pov->Offset += *pcbRead;
00259
00260   return fRet;
00261 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagHeader Member List

This is the complete list of members for tagHeader, including all inherited members.
cbSize | tagHeader
uiTag | tagHeader
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/netshell/nshsamp.h Source File

  • NetDS
  • netshell

nshsamp.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft Netsh Sample.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #define UNICODE
00018 #include <windows.h>
00019 #include <guiddef.h>
00020 #include <netsh.h>
00021 #include <stdlib.h>
00022
00023
00024 #define SAMPLE_HELPER_VERSION       1
00025
00026 //
00027 // We need separate GUID's for each context we are registering,
00028 // because each context has a different parent.  Contexts that
00029 // have identical parents need not have differing GUID's
00030 //
00031 const GUID g_ObjectGuid   =   {0xf7e0bc27, 0xba6e, 0x4145, {0xa1, 0x23, 0x01, 0x2f, 0x19, 0x22, 0xf3, 0xf1}};
00032 const GUID g_SubContext     =   {0xf7e0bc28, 0xba6e, 0x4145, {0xa1, 0x23, 0x01, 0x2f, 0x19, 0x22, 0xf3, 0xf1}};
00033 const GUID g_SampleInterface=   {0xf7e0bc29, 0xba6e, 0x4145, {0xa1, 0x23, 0x01, 0x2f, 0x19, 0x22, 0xf3, 0xf1}};
00034
00035 //
00036 // We also need to know the GUID's of the "interface" and the
00037 // root netsh context, so that we can register under them.
00038 //
00039 const GUID g_Interface      =   {0x0705eca1, 0x7aac, 0x11d2, {0x89, 0xdc, 0x00, 0x60, 0x08, 0xb0, 0xe5, 0xb9}};
00040 const GUID g_RootGuid       =   NETSH_ROOT_GUID;
00041
00042
00043 //
00044 // We'll use these declarations to keep track of
00045 // the data the our helpers use.
00046 //
00047 enum ePOTENTIAL
00048 {
00049     LOW =       0,
00050     MEDIUM =    1,
00051     HIGH =      2
00052 };
00053
00054 typedef struct _SAMPLE_HELPER_DATA_
00055 {
00056     DWORD           WidgetCount;
00057     DWORD           SprocketCount;
00058     DWORD           GatewayUserData;
00059     DWORD           InterfaceID;
00060     BOOL            bEnabled;
00061     DWORD           Supermetric;
00062     ePOTENTIAL      Potential;
00063 } SAMPLE_HELPER_DATA, *PSAMPLE_HELPER_DATA;
00064
00065 //
00066 // Function prototypes.
00067 //
00068 DWORD WINAPI
00069 InitHelperDll(
00070   IN      DWORD           dwNetshVersion,
00071   OUT     PVOID         pReserved
00072     );
00073
00074 DWORD WINAPI
00075 StartHelpers(
00076     IN      CONST GUID *    pguidParent,
00077     IN      DWORD           dwVersion
00078     );
00079
00080 BOOL WINAPI
00081 CheckRunningOnWhistler(
00082     IN      UINT            CIMOSType,
00083     IN      UINT            CIMOSProductSuite,
00084     IN      LPCWSTR         CIMOSVersion,
00085     IN      LPCWSTR         CIMOSBuildNumber,
00086     IN      LPCWSTR         CIMServicePackMajorVersion,
00087     IN      LPCWSTR         CIMServicePackMinorVersion,
00088     IN      UINT            CIMProcessorArchitecture,
00089     IN      DWORD           dwReserved
00090     );
00091
00092 DWORD WINAPI
00093 HandleAddObjectCommand(
00094     IN      LPCWSTR         pwszMachine,
00095     IN OUT  LPWSTR          *ppwcArguments,
00096     IN      DWORD           dwCurrentIndex,
00097     IN      DWORD           dwArgCount,
00098     IN      DWORD           dwFlags,
00099     IN      LPCVOID         pvData,
00100     OUT     BOOL            *pbDone
00101     );
00102
00103 DWORD WINAPI
00104 HandleShowObjectCommand(
00105     IN      LPCWSTR         pwszMachine,
00106     IN OUT  LPWSTR          *ppwcArguments,
00107     IN      DWORD           dwCurrentIndex,
00108     IN      DWORD           dwArgCount,
00109     IN      DWORD           dwFlags,
00110     IN      LPCVOID         pvData,
00111     OUT     BOOL            *pbDone
00112     );
00113
00114 DWORD WINAPI
00115 HandleSetObjectCommand(
00116     IN      LPCWSTR         pwszMachine,
00117     IN OUT  LPWSTR          *ppwcArguments,
00118     IN      DWORD           dwCurrentIndex,
00119     IN      DWORD           dwArgCount,
00120     IN      DWORD           dwFlags,
00121     IN      LPCVOID         pvData,
00122     OUT     BOOL            *pbDone
00123     );
00124
00125 DWORD WINAPI
00126 HandleResetWidgetCommand(
00127     IN      LPCWSTR         pwszMachine,
00128     IN OUT  LPWSTR          *ppwcArguments,
00129     IN      DWORD           dwCurrentIndex,
00130     IN      DWORD           dwArgCount,
00131     IN      DWORD           dwFlags,
00132     IN      LPCVOID         pvData,
00133     OUT     BOOL            *pbDone
00134     );
00135
00136 DWORD WINAPI
00137 HandleResetSprocketCommand(
00138     IN      LPCWSTR         pwszMachine,
00139     IN OUT  LPWSTR          *ppwcArguments,
00140     IN      DWORD           dwCurrentIndex,
00141     IN      DWORD           dwArgCount,
00142     IN      DWORD           dwFlags,
00143     IN      LPCVOID         pvData,
00144     OUT     BOOL            *pbDone
00145     );
00146
00147 DWORD WINAPI
00148 HandleResetAllCommand(
00149     IN      LPCWSTR         pwszMachine,
00150     IN OUT  LPWSTR          *ppwcArguments,
00151     IN      DWORD           dwCurrentIndex,
00152     IN      DWORD           dwArgCount,
00153     IN      DWORD           dwFlags,
00154     IN      LPCVOID         pvData,
00155     OUT     BOOL            *pbDone
00156     );
00157
00158 DWORD WINAPI
00159 HandleShowErrorCommand(
00160     IN      LPCWSTR         pwszMachine,
00161     IN OUT  LPWSTR          *ppwcArguments,
00162     IN      DWORD           dwCurrentIndex,
00163     IN      DWORD           dwArgCount,
00164     IN      DWORD           dwFlags,
00165     IN      LPCVOID         pvData,
00166     OUT     BOOL            *pbDone
00167     );
00168
00169 DWORD WINAPI
00170 HandleSetInterfaceCommand(
00171     IN      LPCWSTR         pwszMachine,
00172     IN OUT  LPWSTR          *ppwcArguments,
00173     IN      DWORD           dwCurrentIndex,
00174     IN      DWORD           dwArgCount,
00175     IN      DWORD           dwFlags,
00176     IN      LPCVOID         pvData,
00177     OUT     BOOL            *pbDone
00178     );
00179
00180 DWORD WINAPI
00181 HandleSetGatewayCommand(
00182     IN      LPCWSTR         pwszMachine,
00183     IN OUT  LPWSTR          *ppwcArguments,
00184     IN      DWORD           dwCurrentIndex,
00185     IN      DWORD           dwArgCount,
00186     IN      DWORD           dwFlags,
00187     IN      LPCVOID         pvData,
00188     OUT     BOOL            *pbDone
00189     );
00190
00191 DWORD WINAPI
00192 HandleShowRandomSettingsCommand(
00193     IN      LPCWSTR         pwszMachine,
00194     IN OUT  LPWSTR          *ppwcArguments,
00195     IN      DWORD           dwCurrentIndex,
00196     IN      DWORD           dwArgCount,
00197     IN      DWORD           dwFlags,
00198     IN      LPCVOID         pvData,
00199     OUT     BOOL            *pbDone
00200     );
00201
00202 DWORD WINAPI
00203 DumpSampleInterface(
00204     IN      LPCWSTR         pwszRouter,
00205     IN OUT  LPWSTR          *ppwcArguments,
00206     IN      DWORD           dwArgCount,
00207     IN      LPCVOID         pvData
00208     );
00209
00210 DWORD WINAPI
00211 DumpSample(
00212     IN      LPCWSTR         pwszRouter,
00213     IN OUT  LPWSTR          *ppwcArguments,
00214     IN      DWORD           dwArgCount,
00215     IN      LPCVOID         pvData
00216     );
00217
00218 //
00219 // Common defs..
00220 //
00221
00222 //
00223 // These are context names.
00224 //
00225 #define TOKEN_SAMPLE                    L"sample"
00226 #define TOKEN_SUBCONTEXT                L"subcontext"
00227 #define TOKEN_SAMPLEINTERFACE           L"sampleinterface"
00228
00229 //
00230 // These are all command names, group or otherwise.
00231 //
00232 #define TOKEN_ADD                       L"add"
00233 #define TOKEN_WIDGETS                   L"widgets"
00234 #define TOKEN_SPROCKETS                 L"sprockets"
00235 #define TOKEN_ALL                       L"all"
00236 #define TOKEN_SHOW                      L"show"
00237 #define TOKEN_SET                       L"set"
00238 #define TOKEN_RESET                     L"reset"
00239 #define TOKEN_SHOWERROR                 L"showerror"
00240 #define TOKEN_INTERFACE                 L"interface"
00241 #define TOKEN_GATEWAY                   L"gateway"
00242 #define TOKEN_USERDATA                  L"userdata"
00243 #define TOKEN_ID                        L"id"
00244 #define TOKEN_ENABLED                   L"enabled"
00245 #define TOKEN_DISABLED                  L"disabled"
00246 #define TOKEN_SUPERMETRIC               L"supermetric"
00247 #define TOKEN_POTENTIAL                 L"potential"
00248 #define TOKEN_HIGH                      L"high"
00249 #define TOKEN_MEDIUM                    L"medium"
00250 #define TOKEN_LOW                       L"low"
00251 #define TOKEN_X86                       L"x86"
00252 #define TOKEN_IA64                      L"ia64"
00253 #define TOKEN_UNKNOWN                   L"unknown"
00254
00255 //
00256 // We'll associate some of our commands with numbers.
00257 // This isn't necessary, just done to show how some netsh
00258 // functionality easily works with respect to enumeration-type
00259 // structures.
00260 //
00261 #define WIDGETS                         0
00262 #define SPROCKETS                       1
00263 #define ALL                             2
00264
00265 #define ID                              0
00266 #define ENABLED                         1
00267 #define DISABLED                        2
00268 #define SUPERMETRIC                     3
00269 #define POTENTIAL                       4
00270
00271 //
00272 // Set up some sort of system to keep track help
00273 // id's.  This is just to make the code more
00274 // readable, as there are quite a few help id's.
00275 //
00276 #define HLP_SAMP_BASE                   10000
00277
00278 #define HLP_ADD_OBJECT_BASE             0
00279 #define HLP_SHOW_OBJECT_BASE            100
00280 #define HLP_SET_OBJECT_BASE             200
00281 #define HLP_RESET_OBJECT_BASE           300
00282 #define HLP_SHOWERROR_BASE              400
00283 #define HLP_RANDOM_BASE                 500
00284
00285 //
00286 // Command groups - we're creating two 'set' command groups
00287 // so we can have different help strings for each in different
00288 // contexts.
00289 //
00290 #define CMD_RESET_OBJECT                TOKEN_RESET
00291 #define HLP_RESET_OBJECT                HLP_SAMP_BASE + HLP_RESET_OBJECT_BASE
00292
00293 #define CMD_SET_RANDOM_STUFF            TOKEN_SET
00294 #define HLP_SET_RANDOM_STUFF            HLP_SAMP_BASE + HLP_RANDOM_BASE
00295
00296
00297 //
00298 // Commands - top level commands listed first.
00299 //
00300
00301 //////////
00302 //
00303 // Commands in the "sample" context.
00304 //
00305 #define CMD_ADD_OBJECT                  TOKEN_ADD
00306 #define HLP_ADD_OBJECT                  HLP_SAMP_BASE + HLP_ADD_OBJECT_BASE + 10
00307 #define HLP_ADD_OBJECT_EX               HLP_SAMP_BASE + HLP_ADD_OBJECT_BASE + 11
00308
00309 //////////
00310
00311 #define CMD_SHOW_OBJECT                 TOKEN_SHOW
00312 #define HLP_SHOW_OBJECT                 HLP_SAMP_BASE + HLP_SHOW_OBJECT_BASE + 10
00313 #define HLP_SHOW_OBJECT_EX              HLP_SAMP_BASE + HLP_SHOW_OBJECT_BASE + 11
00314
00315 //////////
00316
00317 #define CMD_SET_OBJECT                  TOKEN_SET
00318 #define HLP_SET_OBJECT                  HLP_SAMP_BASE + HLP_SET_OBJECT_BASE + 10
00319 #define HLP_SET_OBJECT_EX               HLP_SAMP_BASE + HLP_SET_OBJECT_BASE + 11
00320
00321 //
00322 // These commands will be grouped together, which is why there is a
00323 // entry for each possible group name, ie "reset widgets" instead
00324 // of one top level command that just handles "reset" and parses
00325 // what comes after "reset" on its own.
00326 //
00327 #define CMD_RESET_OBJECT_WIDGETS        TOKEN_WIDGETS
00328 #define HLP_RESET_OBJECT_WIDGETS        HLP_SAMP_BASE + HLP_RESET_OBJECT_BASE + 10
00329 #define HLP_RESET_OBJECT_WIDGETS_EX     HLP_SAMP_BASE + HLP_RESET_OBJECT_BASE + 11
00330
00331 #define CMD_RESET_OBJECT_SPROCKETS      TOKEN_SPROCKETS
00332 #define HLP_RESET_OBJECT_SPROCKETS      HLP_SAMP_BASE + HLP_RESET_OBJECT_BASE + 20
00333 #define HLP_RESET_OBJECT_SPROCKETS_EX   HLP_SAMP_BASE + HLP_RESET_OBJECT_BASE + 21
00334
00335 #define CMD_RESET_OBJECT_ALL            TOKEN_ALL
00336 #define HLP_RESET_OBJECT_ALL            HLP_SAMP_BASE + HLP_RESET_OBJECT_BASE + 30
00337 #define HLP_RESET_OBJECT_ALL_EX         HLP_SAMP_BASE + HLP_RESET_OBJECT_BASE + 31
00338
00339 //////////
00340 //
00341 // Commands in the "subcontext" context (only one.)
00342 //
00343 #define CMD_SHOWERROR                   TOKEN_SHOWERROR
00344 #define HLP_SHOWERROR                   HLP_SAMP_BASE + HLP_SHOWERROR_BASE + 10
00345 #define HLP_SHOWERROR_EX                HLP_SAMP_BASE + HLP_SHOWERROR_BASE + 11
00346
00347 //////////
00348 //
00349 // Commands in the "subinterface" context.
00350 //
00351 #define CMD_SET_INTERFACE               TOKEN_INTERFACE
00352 #define HLP_SET_INTERFACE               HLP_SAMP_BASE + HLP_RANDOM_BASE + 10
00353 #define HLP_SET_INTERFACE_EX            HLP_SAMP_BASE + HLP_RANDOM_BASE + 11
00354
00355 #define CMD_SET_GATEWAY                 TOKEN_GATEWAY
00356 #define HLP_SET_GATEWAY                 HLP_SAMP_BASE + HLP_RANDOM_BASE + 20
00357 #define HLP_SET_GATEWAY_EX              HLP_SAMP_BASE + HLP_RANDOM_BASE + 21
00358
00359 #define CMD_SHOW_RANDOM                 TOKEN_SHOW
00360 #define HLP_SHOW_RANDOM                 HLP_SAMP_BASE + HLP_RANDOM_BASE + 30
00361 #define HLP_SHOW_RANDOM_EX              HLP_SAMP_BASE + HLP_RANDOM_BASE + 31
00362
00363 //
00364 // Error messages.
00365 //
00366 #define ERR_SAMP_BASE                   20000
00367 #define ERR_NO_VALID_COUNT              ERR_SAMP_BASE + 1
00368 #define ERR_INVALID_NUM_ARGS            ERR_NO_VALID_COUNT + 1
00369 #define ERR_INVALID_ERROR_CODE          ERR_INVALID_NUM_ARGS + 1
00370
00371 //
00372 // General messages.
00373 //
00374 #define GEN_SAMP_BASE                   30000
00375 #define GEN_CMD_OKAY                    GEN_SAMP_BASE + 1
00376 #define GEN_CURRENT_COUNT               GEN_CMD_OKAY + 1
00377 #define GEN_SAMPLEINTERFACE_SETTINGS    GEN_CURRENT_COUNT + 1
00378 #define GEN_SAMPLEGATEWAY_SETTINGS      GEN_SAMPLEINTERFACE_SETTINGS + 1
00379 #define GEN_CONNECT_SHOWSTRING          GEN_SAMPLEGATEWAY_SETTINGS + 1
00380
00381 //
00382 // Dump related string ids.
00383 //
00384 #define DUMP_SAMP_BASE                  40000
00385 #define DUMP_SAMP                       DUMP_SAMP_BASE + 1
00386 #define DUMP_SAMPINTERFACE              DUMP_SAMP + 1
00387
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/FileShareSample/File Share SampleEx/ExtObjID.idl Source File

  • WinBase
  • Cluster
  • Win2003
  • FileShareSample
  • File Share SampleEx

ExtObjID.idl

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ExtObjID.idl
00007 //
00008 //  Description:
00009 //      Definition of COM interfaces for the Cluster Administrator
00010 //      FileShareSampleEx Extension DLL.
00011 //
00012 //  Author:
00013 //      <name> (<e-mail name>) Mmmm DD, 2003
00014 //
00015 //  Revision History:
00016 //
00017 //  Notes:
00018 //      This file will be processed by the MIDL tool to
00019 //      produce the type library (ExtObj.tlb) and marshalling code.
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 [
00024     uuid(14ACD802-BCC3-4116-9FB6-7FA3EAA2A837),
00025     version(1.0),
00026     helpstring("FileShareSampleEx 1.0 Type Library")
00027 ]
00028 library CLUADMEXLib
00029 {
00030     importlib("stdole2.tlb");
00031     import "CluAdmEx.idl";
00032
00033     [
00034         uuid(52C191F6-27F4-4F1C-840D-AB3A91C9DEAB),
00035         helpstring("CoFileShareSampleEx Class")
00036     ]
00037     coclass CoFileShareSampleEx
00038     {
00039         interface IWEExtendPropertySheet;
00040         interface IWEExtendWizard;
00041         interface IWEExtendContextMenu;
00042         interface IWEInvokeCommand;
00043     };
00044
00045 };
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_QueueHashNode Member List

This is the complete list of members for _QueueHashNode, including all inherited members.
pKey | _QueueHashNode
pValue | _QueueHashNode
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/staticnode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

staticnode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CStaticNode class.  This is the Snap-in's
00014 //                top level node
00015 //
00016
00017
00018 #ifndef _CLASS_CSTATICNODE_
00019 #define _CLASS_CSTATICNODE_
00020
00021 #include "Globals.h"
00022 #include "BaseNode.h"          // For NODE_PROPERTIES
00023 #include "LListImpl.h"
00024
00025 class CDeviceNode;             // References
00026 class CComponentData;
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CStaticNode : public CBaseNode
00031 {
00032   public:
00033     CStaticNode();
00034     virtual ~CStaticNode();
00035
00036     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00037
00038   ///////////////////////////////////////////////////////////////////////////
00039   // Virtual methods
00040   public:
00041     ULONG   GetNodeType() { return NODETYPE_STATIC; }
00042     GUID&   GetNodeGUID() { return thisGUID; }
00043
00044     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00045     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00046     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00047
00048   ///////////////////////////////////////////////////////////////////////////
00049   // Property Page methods
00050   public:
00051     HRESULT QueryForPropertyPage()
00052             { return E_NOTIMPL; }
00053
00054     HRESULT CreatePropertyPages( LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle )
00055             { return E_NOTIMPL; }
00056
00057     HRESULT GetWatermarks( HBITMAP __RPC_FAR *lphWatermark,
00058                            HBITMAP __RPC_FAR *lphHeader,
00059                            HPALETTE __RPC_FAR *lphPalette,
00060                            BOOL __RPC_FAR *bStretch )
00061             { return E_NOTIMPL; }
00062
00063   ///////////////////////////////////////////////////////////////////////////
00064   // Notification handlers
00065   public:
00066     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00067     HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00068     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00069     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00070     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent )
00071             { return E_NOTIMPL; }
00072
00073   /////////////////////////////////////////////////////////////////////////
00074   //  Context Menu methods
00075   public:
00076     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00077     HRESULT Command( long lCommandID );
00078
00079   ///////////////////////////////////////////////////////////////////////////
00080   // Private helpers
00081   private:
00082     HRESULT  DeleteScopeItems( LPCONSOLENAMESPACE2 ipCNS2 );
00083     HRESULT  InsertScopeItems( LPCONSOLENAMESPACE2 ipCNS2 );
00084     HRESULT  RefreshNodeList();
00085     VOID     RemoveNodes();
00086
00087   ///////////////////////////////////////////////////////////////////////////
00088   // Public helpers
00089   public:
00090     HRESULT  AddDeviceNode( NODE_PROPERTIES* pProperties );
00091     VOID     ToggleStatus( LPDATAOBJECT ipDataObject );
00092     HWND     GetMessageWnd() { return m_hMessageWnd; }
00093
00094     static LRESULT CALLBACK StaticNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00095
00096   private:
00097     static GUID      thisGUID;
00098     HSCOPEITEM       m_hStaticNode;
00099     CComponentData*  m_pCompData;
00100     HWND             m_hMessageWnd;        // Our message handler
00101
00102     CLListImpl<CDeviceNode*,CDeviceNode*>  m_NodeList;
00103
00104   public:
00105     HWND             m_hAddDeviceDlg;      // Instance of AddDeviceDlg
00106
00107   // XPROPPAGE: Support for attributes
00108   public:
00109     BOOL    IsAttributeSet( DWORD dwAttribute ) { return FALSE; }
00110     VOID    SetAttribute( DWORD dwAttribute ) {}
00111     VOID    RemoveAttribute( DWORD dwAttribute ) {}
00112     LPWSTR  GetAttributeString() { return m_pAttributeStr; }
00113     DWORD   GetAttributes() { return 0; }
00114     LPWSTR  GetObjectPath() { return NULL; }
00115 };
00116
00117 #endif //_CLASS_CSTATICNODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/ReMapUrl/ReMapUrl.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • ReMapUrl

ReMapUrl.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: ReMapUrl.cpp
00006
00007 Abstract:
00008
00009     ISAPI extension to run as a wildcard script map and
00010     remap URLs
00011
00012 Author:
00013
00014     ISAPI developer (Microsoft employee), October 2002
00015
00016 --*/
00017
00018 #include <IsapiTools.h>
00019
00020 #define MODULE_NAME             "ReMapUrl"
00021 #define MAX_CONFIG_LINE         1024
00022 #define DEFAULT_ALLOW_UNMAPPED  1
00023
00024 #define REDIRECT_ENTITY \
00025     "<head><title>Document Moved</title></head>\r\n" \
00026     "<body><h1>Object Moved</h1>This document may "  \
00027     "be found <a HREF=\"%s\">here</a></body>"
00028
00029
00030 ISAPI_STRING    g_strIniFile;
00031
00032 VOID
00033 WINAPI
00034 HandleCompletion(
00035     EXTENSION_CONTROL_BLOCK *   pecb,
00036     VOID *                      pContext,
00037     DWORD                       cbIo,
00038     DWORD                       dwError
00039     );
00040
00041 VOID
00042 TrimCommentAndTrailingWhitespace(
00043     CHAR *  szString
00044     );
00045
00046 BOOL
00047 GetMapping(
00048     CHAR *          szUrl,
00049     ISAPI_STRING *  pstrMapping
00050     );
00051
00052 DWORD
00053 DoCustomError(
00054     EXTENSION_CONTROL_BLOCK *   pecb,
00055     CHAR *                      szConfigLine
00056     );
00057
00058 BOOL
00059 SendRedirectResponse(
00060     EXTENSION_CONTROL_BLOCK *   pecb,
00061     CHAR *                      szLocation
00062     );
00063
00064 BOOL
00065 WINAPI
00066 GetExtensionVersion(
00067     HSE_VERSION_INFO *  pVer
00068     )
00069 /*++
00070
00071 Purpose:
00072
00073     Entry point for ISAPI extension initialization.  Required.
00074
00075     This function will be called exactly once in the lifetime
00076     of the extension, at initialization time.  This function is
00077     a useful point to do complex initialization tasks.  This
00078     function is called outside of the system loader lock, so
00079     it does not have the same restrictions as DllMain.
00080
00081 Arguments:
00082
00083     pVer - points to extension version info structure
00084
00085 Returns:
00086
00087     TRUE on success, FALSE on failure.
00088
00089     Note that in the case of FALSE, IIS will call GetLastError()
00090     and return an error page to the client.  The entity body of
00091     the page may be textual if the FormatMessage API can resolve
00092     it, or it may just be an error number if FormatMessage can't
00093     resolve it.
00094
00095 --*/
00096 {
00097     ISAPI_EXTENSION Extension;
00098     //
00099     // Tell IIS which version of ISAPI this extension was built from.
00100     //
00101
00102     pVer->dwExtensionVersion = MAKELONG( HSE_VERSION_MINOR,
00103                                          HSE_VERSION_MAJOR);
00104
00105     //
00106     // Report the description string for this extension.  Ensure
00107     // that it does not exceed the maximum length and is NULL
00108     // terminated.
00109     //
00110
00111     strncpy( pVer->lpszExtensionDesc,
00112              "ReMapUrl ISAPI Sample",
00113              HSE_MAX_EXT_DLL_NAME_LEN );
00114
00115     pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN-1] = '\0';
00116
00117     //
00118     // Get the INI filename
00119     //
00120
00121     InitializeIsapiTools( MODULE_NAME );
00122
00123     if ( Extension.Initialize( MODULE_NAME ) == FALSE )
00124     {
00125         goto Failed;
00126     }
00127
00128     if ( g_strIniFile.Printf( "%s\\%s.ini",
00129                               Extension.QueryModulePath(),
00130                               MODULE_NAME ) == FALSE )
00131     {
00132         goto Failed;
00133     }
00134
00135     //
00136     // Return TRUE if we successfully initialized.
00137     //
00138
00139     return TRUE;
00140
00141 Failed:
00142
00143     WriteDebug( "GetExtensionVersion failed. Error %d.\r\n",
00144                 GetLastError() );
00145
00146     return FALSE;
00147 }
00148
00149 DWORD
00150 WINAPI
00151 HttpExtensionProc(
00152     EXTENSION_CONTROL_BLOCK *   pecb
00153     )
00154 /*++
00155
00156 Purpose:
00157
00158     Entry point for ISAPI requests.  Required.
00159
00160     This function is called once per request.  The EXTENSION_CONTROL_BLOCK
00161     passed in contains information and function pointers sufficient to
00162     interact with the server during this processing.
00163
00164     Note that, once HttpExtensionProc is called, it is the responsibility
00165     of the extension to send back any data that the client should receive.
00166     IIS will not automatically generate any response, even in the case of
00167     HSE_STATUS_ERROR once the request has progressed to the point where
00168     this function is called.
00169
00170     Also note that you should not make any blocking calls or do long-running
00171     operations within this function.  To allow efficient scaling of your
00172     server, you should consider creating a pool of private threads to handle
00173     the requests.  In that case, the implementation of this function would
00174     be just to add the pecb to a queue and return HSE_STATUS_PENDING.  The
00175     threads in the pool would be responsible for dequeing a pecb and calling
00176     HSE_REQ_DONE_WITH_SESSION when they are finished processing it.
00177
00178 Arguments:
00179
00180     pecb - pointer to the extenstion control block
00181
00182 Returns:
00183
00184     HSE_STATUS_SUCCESS - Indicates successful request.
00185     HSE_STATUS_ERROR   - Indicates failed request.
00186     HSE_STATUS_PENDING - Indicates that processing of the request
00187                          should continue after this function returns.
00188                          It HSE_STATUS_PENDING is used, it is necessary
00189                          that HSE_REQ_DONE_WITH_SESSION is called
00190                          exactly once when processing is completed for
00191                          the request.
00192
00193 --*/
00194 {
00195     HSE_EXEC_URL_INFO   ExecUrlInfo = {0};
00196     ISAPI_STRING        strUrl;
00197     ISAPI_STRING        strMapping;
00198     ISAPI_REQUEST       Request( pecb );
00199
00200     //
00201     // Get the current URL and check to see if we have a
00202     // mapping for it.
00203     //
00204
00205     if ( Request.GetServerVariable( "SCRIPT_NAME",
00206                                     &strUrl ) == FALSE )
00207     {
00208         goto Failed;
00209     }
00210
00211     if ( GetMapping( strUrl.QueryStr(), &strMapping ) == FALSE )
00212     {
00213         goto Failed;
00214     }
00215
00216     //
00217     // Ok, so there are 4 scenarios here:
00218     //
00219     //  1 - The mapping is an empty string.  In that
00220     //      case, we should just run the original URL
00221     //  2 - The mapping starts with a numeric, in which
00222     //      case, we should parse it as a custom error
00223     //      mapping
00224     //  3 - The mapping starts with "http", in which
00225     //      case, we should redirect via a 302 response
00226     //  4 - Else, the mapping is a URL on this site
00227     //
00228
00229     if ( strMapping.QueryCCH() == 0 )
00230     {
00231         goto CallExecUrl;
00232     }
00233     else if ( isdigit( *(strMapping.QueryStr()) ) )
00234     {
00235         return DoCustomError( pecb, strMapping.QueryStr() );
00236     }
00237
00238     //
00239     // Ok, so we know that we will be doing some kind of redirect.
00240     //
00241     // If there is a query string on this request, append it to
00242     // the mapping data
00243     //
00244
00245     if ( pecb->lpszQueryString[0] != '\0' )
00246     {
00247         if ( strMapping.Append( "?" ) == FALSE )
00248         {
00249             goto Failed;
00250         }
00251
00252         if ( strMapping.Append( pecb->lpszQueryString ) == FALSE )
00253         {
00254             goto Failed;
00255         }
00256     }
00257
00258     //
00259     // Do the appropriate redirect
00260     //
00261
00262     if ( strnicmp( strMapping.QueryStr(), "http", 4 ) == 0 )
00263     {
00264         //
00265         // Do a 302.
00266         //
00267
00268         if ( SendRedirectResponse( pecb, strMapping.QueryStr() ) == FALSE )
00269         {
00270             goto Failed;
00271         }
00272
00273         return HSE_STATUS_SUCCESS;
00274     }
00275
00276     //
00277     // Finally, if we fall through to here, then we are going to redirect
00278     // this request to another URL on this site.  We just need to point
00279     // at the new URL and call HSE_REQ_EXEC_URL.
00280     //
00281
00282     ExecUrlInfo.pszUrl = strMapping.QueryStr();
00283
00284     //
00285     // Fall through to CallExecUrl
00286     //
00287
00288 CallExecUrl:
00289
00290     //
00291     // Set up the IO completion (passing TRUE as the context
00292     // will notify the completion routine that this is an
00293     // ExecUrl call.
00294     //
00295
00296     if ( pecb->ServerSupportFunction( pecb->ConnID,
00297                                       HSE_REQ_IO_COMPLETION,
00298                                       HandleCompletion,
00299                                       NULL,
00300                                       (DWORD*)TRUE ) == FALSE )
00301     {
00302         goto Failed;
00303     }
00304
00305     ExecUrlInfo.dwExecUrlFlags = HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR;
00306
00307     if ( pecb->ServerSupportFunction( pecb->ConnID,
00308                                       HSE_REQ_EXEC_URL,
00309                                       &ExecUrlInfo,
00310                                       NULL,
00311                                       NULL ) == TRUE )
00312     {
00313         return HSE_STATUS_PENDING;
00314     }
00315
00316     //
00317     // Fall through to error handler
00318     //
00319
00320 Failed:
00321
00322     WriteDebug( "HttpExtensionProc failed.  Error %d.\r\n",
00323                 GetLastError() );
00324
00325     return SyncSendGenericServerError( pecb );
00326 }
00327
00328 VOID
00329 WINAPI
00330 HandleCompletion(
00331     EXTENSION_CONTROL_BLOCK *   pecb,
00332     VOID *                      pContext,
00333     DWORD                       cbIo,
00334     DWORD                       dwError
00335     )
00336 {
00337     HSE_EXEC_URL_STATUS ExecUrlStatus;
00338     BOOL                fIsExecCompletion = (DWORD)pContext;
00339     BOOL                fResult = TRUE;
00340
00341     //
00342     // If this is not an EXEC_URL completion, then we can just
00343     // skip to calling DONE_WITH_SESSION.  Otherwise, we need
00344     // to check the result of the child.
00345     //
00346
00347     if ( !fIsExecCompletion )
00348     {
00349         goto Done;
00350     }
00351
00352     fResult = pecb->ServerSupportFunction( pecb->ConnID,
00353                                            HSE_REQ_GET_EXEC_URL_STATUS,
00354                                            &ExecUrlStatus,
00355                                            NULL,
00356                                            NULL );
00357
00358     if ( !fResult )
00359     {
00360         goto Done;
00361     }
00362
00363     //
00364     // If the status is 403.18, then that means that we tried to
00365     // redirect to another URL on this site, but in another
00366     // app pool.  In that case. the best we can do is to try a
00367     // 302 redirect.
00368     //
00369     // Note that we are rebuilding the remapping information here.
00370     // The reason for this is that we are optimizing for the case
00371     // when the EXEC_URL call works.  We don't want to do a heap
00372     // allocation in that case if we can avoid it, so we aren't
00373     // passing it as context to this completion routine.
00374     //
00375
00376     if ( ExecUrlStatus.uHttpStatusCode == 403 &&
00377          ExecUrlStatus.uHttpSubStatus == 18 )
00378     {
00379         ISAPI_REQUEST   Request( pecb );
00380         ISAPI_STRING    strUrl;
00381         ISAPI_STRING    strMapping;
00382
00383         fResult = Request.GetServerVariable( "SCRIPT_NAME",
00384                                              &strUrl );
00385
00386         if ( !fResult )
00387         {
00388             goto Done;
00389         }
00390
00391         fResult = GetMapping( strUrl.QueryStr(), &strMapping );
00392
00393         if ( !fResult )
00394         {
00395             goto Done;
00396         }
00397
00398         if ( pecb->lpszQueryString[0] != '\0' )
00399         {
00400             fResult = strMapping.Append( "?" );
00401
00402             if ( !fResult )
00403             {
00404                 goto Done;
00405             }
00406
00407             fResult = strMapping.Append( pecb->lpszQueryString );
00408
00409             if ( !fResult )
00410             {
00411                 goto Done;
00412             }
00413         }
00414
00415         fResult = SendRedirectResponse( pecb,
00416                                         strMapping.QueryStr() );
00417
00418         if ( !fResult )
00419         {
00420             SyncSendGenericServerError( pecb );
00421         }
00422     }
00423     else
00424     {
00425         //
00426         // Just set the ECB's status member to match the child's
00427         // result
00428         //
00429
00430         pecb->dwHttpStatusCode = ExecUrlStatus.uHttpStatusCode;
00431     }
00432
00433 Done:
00434
00435     if ( !fResult )
00436     {
00437         WriteDebug( "Error processing I/O completion.  Error %d.\r\n",
00438                     GetLastError() );
00439     }
00440
00441     //
00442     // Notify IIS that we are done with the request
00443     //
00444
00445     pecb->ServerSupportFunction( pecb->ConnID,
00446                                  HSE_REQ_DONE_WITH_SESSION,
00447                                  NULL,
00448                                  NULL,
00449                                  NULL );
00450 }
00451
00452 VOID
00453 TrimCommentAndTrailingWhitespace(
00454     CHAR *  szString
00455     )
00456 /*++
00457
00458 Purpose:
00459
00460     This function trims a text line from an INI file
00461     such that it's truncated at the first instance of
00462     a ';'. Any trailing whitespace is also removed.
00463
00464 Arguments:
00465
00466     szString - The string to trim
00467
00468 Returns:
00469
00470     None
00471
00472 --*/
00473 {
00474     LPSTR   pCursor = szString;
00475     LPSTR   pWhite = NULL;
00476
00477     while ( *pCursor )
00478     {
00479         if ( *pCursor == ';' )
00480         {
00481             *pCursor = '\0';
00482             break;
00483         }
00484
00485         if ( *pCursor == ' ' || *pCursor == '\t' )
00486         {
00487             if ( !pWhite )
00488             {
00489                 pWhite = pCursor;
00490             }
00491         }
00492         else
00493         {
00494             pWhite = NULL;
00495         }
00496
00497         pCursor++;
00498     }
00499
00500     if ( pWhite )
00501     {
00502         *pWhite = '\0';
00503     }
00504
00505     return;
00506 }
00507
00508
00509 BOOL
00510 GetMapping(
00511     CHAR *          szUrl,
00512     ISAPI_STRING *  pstrMapping
00513     )
00514 {
00515     //
00516     // Make sure that the output string is
00517     // at least as big as our config line
00518     //
00519
00520     if ( pstrMapping->ResizeBuffer( MAX_CONFIG_LINE ) == FALSE )
00521     {
00522         goto Failed;
00523     }
00524
00525     GetPrivateProfileString( "Mappings",
00526                              szUrl,
00527                              "",
00528                              pstrMapping->QueryStr(),
00529                              pstrMapping->QueryBufferSize(),
00530                              g_strIniFile.QueryStr() );
00531
00532     if ( *pstrMapping->QueryStr() == 0 )
00533     {
00534         //
00535         // If we didn't get a mapping the first time, try
00536         // to get the default
00537         //
00538
00539         GetPrivateProfileString( "Mappings",
00540                                  "Default",
00541                                  "",
00542                                  pstrMapping->QueryStr(),
00543                                  pstrMapping->QueryBufferSize(),
00544                                  g_strIniFile.QueryStr() );
00545     }
00546
00547     TrimCommentAndTrailingWhitespace( pstrMapping->QueryStr() );
00548
00549     pstrMapping->CalcLen();
00550
00551     return TRUE;
00552
00553 Failed:
00554
00555     WriteDebug( "GetMapping failed. Error %d.\r\n",
00556                 GetLastError() );
00557
00558     return FALSE;
00559 }
00560
00561 DWORD
00562 DoCustomError(
00563     EXTENSION_CONTROL_BLOCK *   pecb,
00564     CHAR *                      szConfigLine
00565     )
00566 {
00567     HSE_CUSTOM_ERROR_INFO   CustomError;
00568     ISAPI_REQUEST           Request( pecb );
00569     ISAPI_STRING            strStatus;
00570     ISAPI_STRING            strAlternateEntity;
00571     USHORT                  uSubStatus;
00572     CHAR *                  pCursor;
00573
00574     //
00575     // We expect the config line to be in the
00576     // form:
00577     //
00578     //   500,13,Server Too Busy
00579     //
00580
00581     if ( strStatus.Copy( szConfigLine ) == FALSE )
00582     {
00583         goto Failed;
00584     }
00585
00586     pCursor = strchr( strStatus.QueryStr(), ',' );
00587
00588     if ( !pCursor )
00589     {
00590         SetLastError( ERROR_INVALID_PARAMETER );
00591
00592         goto Failed;
00593     }
00594
00595     *pCursor = '\0';
00596
00597     strStatus.CalcLen();
00598
00599     pCursor++;
00600
00601     uSubStatus = atoi( pCursor );
00602
00603     pCursor = strchr( pCursor, ',' );
00604
00605     if ( !pCursor )
00606     {
00607         SetLastError( ERROR_INVALID_PARAMETER );
00608
00609         goto Failed;
00610     }
00611
00612     if ( strAlternateEntity.Copy( pCursor+1 ) == FALSE )
00613     {
00614         goto Failed;
00615     }
00616
00617     //
00618     // Set up for an asynchronous call to HSE_REQ_SEND_CUSTOM_ERROR
00619     //
00620
00621     if ( strStatus.Append( " " ) == FALSE ||
00622          strStatus.Append( strAlternateEntity.QueryStr() ) == FALSE )
00623     {
00624         goto Failed;
00625     }
00626
00627     CustomError.pszStatus = strStatus.QueryStr();
00628     CustomError.uHttpSubError = uSubStatus;
00629     CustomError.fAsync = TRUE;
00630
00631     if ( pecb->ServerSupportFunction( pecb->ConnID,
00632                                       HSE_REQ_IO_COMPLETION,
00633                                       &HandleCompletion,
00634                                       NULL,
00635                                       NULL ) == FALSE )
00636     {
00637         goto Failed;
00638     }
00639
00640     if ( pecb->ServerSupportFunction( pecb->ConnID,
00641                                       HSE_REQ_SEND_CUSTOM_ERROR,
00642                                       &CustomError,
00643                                       NULL,
00644                                       NULL ) == TRUE )
00645     {
00646         //
00647         // The async call succeeded.  We need to return STATUS_PENDING
00648         // without doing anything else to the ECB.
00649         //
00650
00651         return HSE_STATUS_PENDING;
00652     }
00653
00654     //
00655     // If we get here, then the asynchronous call failed. We'll go
00656     // ahead and send back a synchronous error manually.
00657     //
00658
00659     if ( Request.SyncWriteCompleteResponse( strStatus.QueryStr(),
00660                                             "Content-Type: text/plain\r\n\r\n",
00661                                             strAlternateEntity.QueryStr() ) == FALSE )
00662     {
00663         goto Failed;
00664     }
00665
00666     return HSE_STATUS_SUCCESS;
00667
00668 Failed:
00669
00670     WriteDebug( "DoCustomError failed.  Error %d.\r\n",
00671                 GetLastError() );
00672
00673     return SyncSendGenericServerError( pecb );
00674 }
00675
00676 BOOL
00677 SendRedirectResponse(
00678     EXTENSION_CONTROL_BLOCK *   pecb,
00679     CHAR *                      szLocation
00680     )
00681 {
00682     ISAPI_REQUEST   Request( pecb );
00683     ISAPI_STRING    strEscapedLocation;
00684     ISAPI_STRING    strHeaders;
00685
00686     //
00687     // Since this redirect might go to another machine,
00688     // we should be conscious of certain client behaviors.
00689     // Specifically, we want to make sure that the client
00690     // doesn't try and run any part of szLocation as a
00691     // script, especially the query string, since the query
00692     // string was originally submitted from an untrusted
00693     // source (the client).  To deal with this, we will
00694     // escape encode the instance of the location data that
00695     // appears in the entity body of the redirect response
00696     //
00697
00698     if ( strEscapedLocation.Copy( szLocation ) == FALSE )
00699     {
00700         goto Failed;
00701     }
00702
00703     if ( strEscapedLocation.Escape() == FALSE )
00704     {
00705         goto Failed;
00706     }
00707
00708     if ( strHeaders.Printf( "Content-Type: text/html\r\n"
00709                             "Location: %s\r\n\r\n",
00710                             szLocation ) == FALSE )
00711     {
00712         goto Failed;
00713     }
00714
00715     if ( Request.SyncWriteCompleteResponse( "302 Object Moved",
00716                                             strHeaders.QueryStr(),
00717                                             REDIRECT_ENTITY,
00718                                             strEscapedLocation.QueryStr() ) == FALSE )
00719     {
00720         goto Failed;
00721     }
00722
00723     return TRUE;
00724
00725 Failed:
00726
00727     WriteDebug( "SendRedirectResponse failed.  Error %d.\r\n",
00728                 GetLastError() );
00729
00730     return FALSE;
00731 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/GINA/GinaHook/GinaDlg.c Source File

  • Security
  • GINA
  • GinaHook

GinaDlg.c

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Module:   GinaDlg.c
00010
00011  Abstract: See ReadMe.txt for more detail information about this sample.
00012
00013  Revision: August 6, 1999.
00014
00015 -------------------------------------------------------------------------------*/
00016
00017 #define _WIN32_WINNT 0x0400
00018
00019 #include <windows.h>
00020 #include <winwlx.h>
00021 #include <assert.h>
00022 #include <lm.h>
00023
00024 #include "Ginahook.h"
00025
00026 //
00027 // MSGINA dialog box IDs.
00028 //
00029 #define IDD_WLXDIAPLAYSASNOTICE_DIALOG    1400
00030 #define IDD_WLXLOGGEDOUTSAS_DIALOG        1450
00031 #define IDD_CHANGE_PASSWORD_DIALOG        1550
00032 #define IDD_WLXLOGGEDONSAS_DIALOG         1650
00033 #define IDD_WLXWKSTALOCKEDSAS_DIALOG      1850
00034
00035 //
00036 // MSGINA control IDs
00037 //
00038 #define IDC_WLXLOGGEDOUTSAS_USERNAME      1453
00039 #define IDC_WLXLOGGEDOUTSAS_PASSWORD      1454
00040 #define IDC_WLXLOGGEDOUTSAS_DOMAIN        1455
00041 #define IDC_WLXWKSTALOCKEDSAS_DOMAIN      1856
00042
00043 //
00044 // Pointers to redirected functions.
00045 //
00046
00047 static PWLX_DIALOG_BOX_PARAM pfWlxDialogBoxParam = NULL;
00048
00049 //
00050 // Pointers to redirected dialog box.
00051 //
00052
00053 static DLGPROC pfWlxLoggedOutSASDlgProc   = NULL;
00054 static DLGPROC pfWlxWkstaLockedSASDlgProc = NULL;
00055 static DLGPROC pfChangePasswordDlgProc    = NULL;
00056
00057 //
00058 // Local functions.
00059 //
00060
00061 int WINAPI MyWlxDialogBoxParam (HANDLE, HANDLE, LPWSTR, HWND, DLGPROC, LPARAM);
00062
00063 //
00064 // Local variables.
00065 //
00066
00067 static char g_szLocalMachineName[256] = "";
00068
00069
00070 //
00071 // Hook WlxDialogBoxParam() dispatch function.
00072 //
00073 void HookWlxDialogBoxParam (PVOID pWinlogonFunctions, DWORD dwWlxVersion)
00074 {
00075    //
00076    // Hook WlxDialogBoxParam(). Note that we chould cheat here by always
00077    // casting to (PWLX_DISPATCH_VERSION_1_0) since WlxDialogBoxParam()
00078    // exists in all versions and is always in the same location of the
00079    // dispatch table. But, we will do it the hard way!
00080    //
00081    switch (dwWlxVersion)
00082    {
00083       case WLX_VERSION_1_0:
00084       {
00085          pfWlxDialogBoxParam =
00086             ((PWLX_DISPATCH_VERSION_1_0) pWinlogonFunctions)->WlxDialogBoxParam;
00087          ((PWLX_DISPATCH_VERSION_1_0) pWinlogonFunctions)->WlxDialogBoxParam =
00088             MyWlxDialogBoxParam;
00089          break;
00090       }
00091
00092       case WLX_VERSION_1_1:
00093       {
00094          pfWlxDialogBoxParam =
00095             ((PWLX_DISPATCH_VERSION_1_1) pWinlogonFunctions)->WlxDialogBoxParam;
00096          ((PWLX_DISPATCH_VERSION_1_1) pWinlogonFunctions)->WlxDialogBoxParam =
00097             MyWlxDialogBoxParam;
00098          break;
00099       }
00100
00101       case WLX_VERSION_1_2:
00102       {
00103          pfWlxDialogBoxParam =
00104             ((PWLX_DISPATCH_VERSION_1_2) pWinlogonFunctions)->WlxDialogBoxParam;
00105          ((PWLX_DISPATCH_VERSION_1_2) pWinlogonFunctions)->WlxDialogBoxParam =
00106             MyWlxDialogBoxParam;
00107          break;
00108       }
00109
00110       default:
00111       {
00112          pfWlxDialogBoxParam =
00113             ((PWLX_DISPATCH_VERSION_1_3) pWinlogonFunctions)->WlxDialogBoxParam;
00114          ((PWLX_DISPATCH_VERSION_1_3) pWinlogonFunctions)->WlxDialogBoxParam =
00115             MyWlxDialogBoxParam;
00116          break;
00117       }
00118    }
00119 }
00120
00121
00122 //
00123 // Redirected WlxLoggedOutSASDlgProc().
00124 //
00125
00126 BOOL
00127 CALLBACK
00128 MyWlxLoggedOutSASDlgProc (HWND   hwndDlg,  // handle to dialog box
00129                           UINT   uMsg,     // message
00130                           WPARAM wParam,   // first message parameter
00131                           LPARAM lParam)   // second message parameter
00132 {
00133    BOOL bResult;
00134
00135    //
00136    // Sanity check.
00137    //
00138    assert(pfWlxLoggedOutSASDlgProc != NULL);
00139
00140    //
00141    // Pass on to MSGINA first.
00142    //
00143    bResult = pfWlxLoggedOutSASDlgProc(hwndDlg, uMsg, wParam, lParam);
00144
00145    //
00146    // We are only interested in WM_INITDIALOG message.
00147    //
00148    if (uMsg == WM_INITDIALOG)
00149    {
00150       DWORD dwIndex;
00151       HWND hwndDomain;
00152       NET_API_STATUS netstatus;
00153       LPWKSTA_INFO_100 lpWkstaInfo;
00154
00155       //
00156       // Get local machine name.
00157       //
00158       netstatus = NetWkstaGetInfo(NULL, 100, (LPBYTE *) &lpWkstaInfo);
00159       if (netstatus != NERR_Success)
00160       {
00161          return bResult;
00162       }
00163
00164       //
00165       // Convert to ANSI.
00166       //
00167       wcstombs(g_szLocalMachineName, lpWkstaInfo->wki100_computername,
00168                sizeof(g_szLocalMachineName));
00169
00170       //
00171       // and free the buffer.
00172       //
00173       NetApiBufferFree((LPVOID) lpWkstaInfo);
00174
00175       //
00176       // Manipulate the domain combo box so that only some predetermined
00177       // trusted domains are included in the list.
00178       //
00179       // In our case, we restrict logon to local machine only.
00180       //
00181       hwndDomain = GetDlgItem(hwndDlg, IDC_WLXLOGGEDOUTSAS_DOMAIN);
00182       if (hwndDomain == NULL)
00183       {
00184          return bResult;
00185       }
00186
00187       dwIndex = (DWORD) SendMessage(hwndDomain, CB_FINDSTRING,
00188                                     0, (LPARAM) g_szLocalMachineName);
00189       if (dwIndex != CB_ERR)
00190       {
00191          SendMessage(hwndDomain, CB_SETCURSEL, (WPARAM) dwIndex, 0);
00192          EnableWindow(hwndDomain, FALSE);
00193       }
00194    }
00195
00196    return bResult;
00197 }
00198
00199
00200 //
00201 // Redirected WlxWkstaLockedSASDlgProc().
00202 //
00203
00204 BOOL
00205 CALLBACK
00206 MyWlxWkstaLockedSASDlgProc (HWND   hwndDlg,  // handle to dialog box
00207                             UINT   uMsg,     // message
00208                             WPARAM wParam,   // first message parameter
00209                             LPARAM lParam)   // second message parameter
00210 {
00211    BOOL bResult;
00212
00213    //
00214    // Sanity check.
00215    //
00216    assert(pfWlxWkstaLockedSASDlgProc != NULL);
00217
00218    //
00219    // Pass on to MSGINA first.
00220    //
00221    bResult = pfWlxWkstaLockedSASDlgProc(hwndDlg, uMsg, wParam, lParam);
00222
00223    //
00224    // We are only interested in WM_INITDIALOG message.
00225    //
00226    if (uMsg == WM_INITDIALOG)
00227    {
00228       DWORD dwIndex;
00229
00230       //
00231       // Make sure to cover this hole.
00232       //
00233       HWND hwndDomain = GetDlgItem(hwndDlg, IDC_WLXWKSTALOCKEDSAS_DOMAIN);
00234       if (hwndDomain == NULL)
00235       {
00236          return bResult;
00237       }
00238
00239       dwIndex = (DWORD) SendMessage(hwndDomain, CB_FINDSTRING,
00240                                     0, (LPARAM) g_szLocalMachineName);
00241       if (dwIndex != CB_ERR)
00242       {
00243          SendMessage(hwndDomain, CB_SETCURSEL, (WPARAM) dwIndex, 0);
00244          EnableWindow(hwndDomain, FALSE);
00245       }
00246    }
00247
00248    return bResult;
00249 }
00250
00251
00252 //
00253 // Redirected ChangePasswordDlgProc().
00254 //
00255
00256 BOOL
00257 CALLBACK
00258 MyChangePasswordDlgProc (HWND   hwndDlg,  // handle to dialog box
00259                          UINT   uMsg,     // message
00260                          WPARAM wParam,   // first message parameter
00261                          LPARAM lParam)   // second message parameter
00262 {
00263    BOOL bResult;
00264
00265    //
00266    // Sanity check.
00267    //
00268    assert(pfChangePasswordDlgProc != NULL);
00269
00270    //
00271    // Pass on to MSGINA first.
00272    //
00273    bResult = pfChangePasswordDlgProc(hwndDlg, uMsg, wParam, lParam);
00274
00275    //
00276    // We are only interested in WM_INITDIALOG message.
00277    //
00278    if (uMsg == WM_INITDIALOG)
00279    {
00280       //
00281       // Manipulate the dialog box to match your needs here. For example,
00282       // you can add a static control to the dialog box or display another
00283       // message to clearly explain the rules for composing a valid password.
00284       //
00285    }
00286
00287    return bResult;
00288 }
00289
00290
00291 //
00292 // Redirected WlxDialogBoxParam() function.
00293 //
00294
00295 int
00296 WINAPI
00297 MyWlxDialogBoxParam (HANDLE  hWlx,
00298                      HANDLE  hInst,
00299                      LPWSTR  lpszTemplate,
00300                      HWND    hwndOwner,
00301                      DLGPROC dlgprc,
00302                      LPARAM  dwInitParam)
00303 {
00304    //
00305    // Sanity check.
00306    //
00307    assert(pfWlxDialogBoxParam != NULL);
00308
00309    //
00310    // We only know MSGINA dialogs by identifiers.
00311    //
00312    if (!HIWORD(lpszTemplate))
00313    {
00314       //
00315       // Hook appropriate dialog boxes as necessary.
00316       //
00317       switch ((DWORD) lpszTemplate)
00318       {
00319          case IDD_WLXLOGGEDOUTSAS_DIALOG:
00320          {
00321             pfWlxLoggedOutSASDlgProc = dlgprc;
00322             return pfWlxDialogBoxParam(hWlx, hInst, lpszTemplate, hwndOwner,
00323                                        MyWlxLoggedOutSASDlgProc, dwInitParam);
00324          }
00325
00326          case IDD_WLXWKSTALOCKEDSAS_DIALOG:
00327          {
00328             pfWlxWkstaLockedSASDlgProc = dlgprc;
00329             return pfWlxDialogBoxParam(hWlx, hInst, lpszTemplate, hwndOwner,
00330                                        MyWlxWkstaLockedSASDlgProc, dwInitParam);
00331          }
00332
00333          case IDD_CHANGE_PASSWORD_DIALOG:
00334          {
00335             pfChangePasswordDlgProc = dlgprc;
00336             return pfWlxDialogBoxParam(hWlx, hInst, lpszTemplate, hwndOwner,
00337                                        MyChangePasswordDlgProc, dwInitParam);
00338          }
00339       }
00340    }
00341
00342    //
00343    // The rest will not be redirected.
00344    //
00345    return pfWlxDialogBoxParam(hWlx, hInst, lpszTemplate,
00346                               hwndOwner, dlgprc, dwInitParam);
00347 }
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapirecv/common.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapirecv

common.h

Go to the documentation of this file.
00001 /*
00002
00003 Copyright (c) 1999 - 2000  Microsoft Corporation
00004
00005
00006 Module Name:
00007
00008     common.h
00009
00010
00011 Abstract:
00012
00013     include files, definitions and declarations used in the app
00014
00015 */
00016
00017
00018 #define _WIN32_DCOM
00019
00020 #define WM_PRIVATETAPIEVENT   WM_USER+101
00021
00022 #include <stdio.h>
00023 #include <windows.h>
00024 #include <tapi3.h>
00025 #include <crtdbg.h>
00026
00027 #include <control.h>
00028 #include <strmif.h>
00029
00030 #include <uuids.h>
00031 #include <mmsystem.h>
00032 #include <amstream.h>
00033
00034 #include <vfw.h>
00035 #include <Mtype.h>
00036 #include <strsafe.h>
00037
00038
00039 #include "WorkerThread.h"
00040
00041
00042 //
00043 // the event to signal when it's time to exit
00044 //
00045
00046 extern HANDLE g_hExitEvent;
00047
00048
00049 //
00050 // the tapi object
00051 //
00052
00053 extern ITTAPI *g_pTapi;
00054
00055
00056 //
00057 // The current call. We only process one call at a time
00058 //
00059
00060 extern ITBasicCallControl *g_pCurrentCall;
00061
00062
00063 //
00064 // critical section for protecting the global current call
00065 //
00066
00067 extern  CRITICAL_SECTION g_CurrentCallCritSection;
00068
00069
00070 //
00071 // thread for asynchronous message processing
00072 //
00073
00074 extern CWorkerThread g_WorkerThread;
00075
00076
00077 //
00078 // logging functions
00079 //
00080
00081 void LogMessage(CHAR *pszFormat, ... );
00082
00083 #define LogError LogMessage
00084
00085 void LogFormat(const WAVEFORMATEX *pWaveFormat);
00086
00087
00088 //
00089 // tapi event handler
00090 //
00091
00092 HRESULT OnTapiEvent(TAPI_EVENT TapiEvent, IDispatch *pEvent);
00093
00094
00095 //
00096 // memory allocation routines
00097 //
00098
00099 void *AllocateMemory(SIZE_T nMemorySize);
00100
00101 void FreeMemory(void* pMemory);
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Complete

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057
00058     // first things first, make sure that when MMC
00059     // asks if we do property sheets, that we actually
00060     // say "yes"
00061     else if (IsEqualIID(riid, IID_IExtendPropertySheet) ||
00062         IsEqualIID(riid, IID_IExtendPropertySheet2))
00063         *ppv = static_cast<IExtendPropertySheet2 *>(this);
00064     // ditto for context menus
00065     else if (IsEqualIID(riid, IID_IExtendContextMenu))
00066         *ppv = static_cast<IExtendContextMenu *>(this);
00067
00068     if (*ppv)
00069     {
00070         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00071         return S_OK;
00072     }
00073
00074     return E_NOINTERFACE;
00075 }
00076
00077 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00078 {
00079     return InterlockedIncrement((LONG *)&m_cref);
00080 }
00081
00082 STDMETHODIMP_(ULONG) CComponentData::Release()
00083 {
00084     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00085     {
00086         // we need to decrement our object count in the DLL
00087         delete this;
00088         return 0;
00089     }
00090
00091     return m_cref;
00092 }
00093
00094 ///////////////////////////////
00095 // Interface IComponentData
00096 ///////////////////////////////
00097 HRESULT CComponentData::Initialize(
00098                                    /* [in] */ LPUNKNOWN pUnknown)
00099 {
00100     HRESULT      hr;
00101
00102     //
00103     // Get pointer to name space interface
00104     //
00105     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00106     _ASSERT( S_OK == hr );
00107
00108     //
00109     // Get pointer to console interface
00110     //
00111     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00112     _ASSERT( S_OK == hr );
00113
00114     IImageList *pImageList;
00115     m_ipConsole->QueryScopeImageList(&pImageList);
00116     _ASSERT( S_OK == hr );
00117
00118     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00119         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00120         0, // index of the first image in the strip
00121         RGB(0, 128, 128)  // color of the icon mask
00122         );
00123
00124     pImageList->Release();
00125
00126     return S_OK;
00127 }
00128
00129 HRESULT CComponentData::CreateComponent(
00130                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00131 {
00132     *ppComponent = NULL;
00133
00134     CComponent *pComponent = new CComponent(this);
00135
00136     if (NULL == pComponent)
00137         return E_OUTOFMEMORY;
00138
00139     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00140 }
00141
00142 HRESULT CComponentData::Notify(
00143                                /* [in] */ LPDATAOBJECT lpDataObject,
00144                                /* [in] */ MMC_NOTIFY_TYPE event,
00145                                /* [in] */ LPARAM arg,
00146                                /* [in] */ LPARAM param)
00147 {
00148     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00149
00150     HRESULT hr = S_FALSE;
00151
00152   //Get our data object. If it is NULL, we return with S_FALSE.
00153   //See implementation of GetOurDataObject() to see how to
00154   //handle special data objects.
00155   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00156   if (NULL == pDataObject)
00157     return S_FALSE;
00158
00159   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00160
00161     switch (event)
00162     {
00163     case MMCN_EXPAND:
00164         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00165         break;
00166
00167     case MMCN_DELETE:
00168         hr = S_FALSE;
00169         break;
00170     }
00171
00172     return hr;
00173 }
00174
00175 HRESULT CComponentData::Destroy( void)
00176 {
00177     // Free interfaces
00178     if (m_ipConsoleNameSpace) {
00179         m_ipConsoleNameSpace->Release();
00180         m_ipConsoleNameSpace = NULL;
00181     }
00182
00183     if (m_ipConsole) {
00184         m_ipConsole->Release();
00185         m_ipConsole = NULL;
00186     }
00187
00188     return S_OK;
00189 }
00190
00191 HRESULT CComponentData::QueryDataObject(
00192                                         /* [in] */ MMC_COOKIE cookie,
00193                                         /* [in] */ DATA_OBJECT_TYPES type,
00194                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00195 {
00196     CDataObject *pObj = NULL;
00197
00198     if (cookie == 0)
00199         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00200     else
00201         pObj = new CDataObject(cookie, type);
00202
00203     if (!pObj)
00204         return E_OUTOFMEMORY;
00205
00206     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00207
00208     return S_OK;
00209 }
00210
00211 HRESULT CComponentData::GetDisplayInfo(
00212                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00213 {
00214     HRESULT hr = S_FALSE;
00215
00216     // if they are asking for the SDI_STR we have one of those to give
00217     if (pScopeDataItem->lParam) {
00218         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00219         if (pScopeDataItem->mask & SDI_STR) {
00220                         LPCTSTR pszT = base->GetDisplayName();
00221                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00222             pScopeDataItem->displayname = pszW;
00223         }
00224
00225         if (pScopeDataItem->mask & SDI_IMAGE) {
00226             pScopeDataItem->nImage = base->GetBitmapIndex();
00227         }
00228     }
00229
00230     return hr;
00231 }
00232
00233 HRESULT CComponentData::CompareObjects(
00234                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00235                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00236 {
00237     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00238     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00239
00240     // compare the object pointers
00241     if (baseA->GetCookie() == baseB->GetCookie())
00242         return S_OK;
00243
00244     return S_FALSE;
00245 }
00246
00247 ///////////////////////////////////
00248 // Interface IExtendPropertySheet2
00249 ///////////////////////////////////
00250 HRESULT CComponentData::CreatePropertyPages(
00251                                             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00252                                             /* [in] */ LONG_PTR handle,
00253                                             /* [in] */ LPDATAOBJECT lpIDataObject)
00254 {
00255     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00256
00257     return base->CreatePropertyPages(lpProvider, handle);
00258 }
00259
00260 HRESULT CComponentData::QueryPagesFor(
00261                                       /* [in] */ LPDATAOBJECT lpDataObject)
00262 {
00263     CDelegationBase *base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00264
00265     return base->HasPropertySheets();
00266 }
00267
00268 HRESULT CComponentData::GetWatermarks(
00269                                       /* [in] */ LPDATAOBJECT lpIDataObject,
00270                                       /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00271                                       /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00272                                       /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00273                                       /* [out] */ BOOL __RPC_FAR *bStretch)
00274 {
00275     CDelegationBase *base = GetOurDataObject(lpIDataObject)->GetBaseNodeObject();
00276
00277     return base->GetWatermarks(lphWatermark, lphHeader, lphPalette, bStretch);
00278 }
00279
00280 ///////////////////////////////
00281 // Interface IExtendContextMenu
00282 ///////////////////////////////
00283 HRESULT CComponentData::AddMenuItems(
00284                                      /* [in] */ LPDATAOBJECT piDataObject,
00285                                      /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
00286                                      /* [out][in] */ long __RPC_FAR *pInsertionAllowed)
00287 {
00288     CDelegationBase *base = GetOurDataObject(piDataObject)->GetBaseNodeObject();
00289
00290     return base->OnAddMenuItems(piCallback, pInsertionAllowed);
00291 }
00292
00293 HRESULT CComponentData::Command(
00294                                 /* [in] */ long lCommandID,
00295                                 /* [in] */ LPDATAOBJECT piDataObject)
00296 {
00297     CDelegationBase *base = GetOurDataObject(piDataObject)->GetBaseNodeObject();
00298
00299     return base->OnMenuCommand(m_ipConsole, m_ipConsoleNameSpace, lCommandID, piDataObject);
00300 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/vb/mmcsample.h Source File

  • SysMgmt
  • MMC
  • ActiveX
  • vb

mmcsample.h

Go to the documentation of this file.
00001 interface _VBComponent;
00002
00003 DEFINE_GUID(IID__VBComponent,0xC224F73FL,0x8D72,0x11D2,0x8A,0x0B,0x00,0x00,0x21,0x47,0x31,0x28);
00004 DECLARE_INTERFACE_(_VBComponent, IDispatch)
00005 {
00006     STDMETHOD(StartAnimation)(THIS) PURE;
00007     STDMETHOD(StopAnimation)(THIS) PURE;
00008 };
00009
00010 DEFINE_GUID(CLSID_VBComponent,0xCD3A5DAAL,0x8CA5,0x11D2,0x8A,0x0B,0x00,0x00,0x21,0x47,0x31,0x28);
00011 class CWrapVBComponent : public _VBComponent
00012 {
00013 public:
00014     STDMETHOD(QueryInterface)(THIS_ REFIID riid, void FAR* FAR* ppvObj){ return m_pInternal->QueryInterface(riid, ppvObj); }
00015     STDMETHOD_(unsigned long, AddRef)(THIS){ return m_pInternal->AddRef(); }
00016     STDMETHOD_(unsigned long, Release)(THIS){ return m_pInternal->Release(); }
00017     STDMETHOD(GetTypeInfoCount)(THIS_ unsigned int FAR* pctinfo){ return m_pInternal->GetTypeInfoCount(pctinfo); }
00018     STDMETHOD(GetTypeInfo)(THIS_ unsigned int itinfo, unsigned long lcid, ITypeInfo FAR* FAR* pptinfo){ return m_pInternal->GetTypeInfo(itinfo, lcid, pptinfo); }
00019     STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, unsigned short FAR* FAR* rgszNames, unsigned int cNames, unsigned long lcid, long FAR* rgdispid){ return m_pInternal->GetIDsOfNames(riid,
00020         rgszNames, cNames, lcid, rgdispid); }
00021     STDMETHOD(Invoke)(THIS_ long dispidMember, REFIID riid, unsigned long lcid, unsigned short wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult, EXCEPINFO
00022         FAR* pexcepinfo, unsigned int FAR* puArgErr){ return m_pInternal->Invoke(dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr); }
00023     STDMETHOD(StartAnimation)(THIS){ return m_pInternal->StartAnimation(); }
00024     STDMETHOD(StopAnimation)(THIS){ return m_pInternal->StopAnimation(); }
00025     CWrapVBComponent()
00026     {
00027       m_pInternal = NULL;
00028       IUnknown FAR* pUnk;
00029       if SUCCEEDED(m_hrLaunch = CoCreateInstance(CLSID_VBComponent, NULL, CLSCTX_SERVER,
00030                                                IID_IUnknown, (void FAR* FAR*) &pUnk)) {
00031         m_hrLaunch = pUnk->QueryInterface(IID__VBComponent, (void FAR* FAR*) &m_pInternal);
00032         pUnk->Release();
00033       }
00034     }
00035     CWrapVBComponent(IUnknown *pUnk)
00036     {
00037       m_pInternal = NULL;
00038       m_hrLaunch = pUnk->QueryInterface(IID__VBComponent, (void FAR* FAR*) &m_pInternal);
00039     }
00040     virtual ~CWrapVBComponent(){if (m_pInternal) m_pInternal->Release();}
00041     HRESULT LaunchError(){return m_hrLaunch;}
00042 private:
00043     _VBComponent FAR* m_pInternal;
00044     HRESULT m_hrLaunch;
00045 };
00046
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/Obj.h Source File

  • Com
  • Fundamentals
  • SimpSvr

Obj.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: obj.h
00003 //
00004 //      Definition of CSimpSvrObj
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _OBJ_H_)
00010 #define _OBJ_H_
00011
00012 #include "ioipao.h"
00013 #include "ioipo.h"
00014 #include "ioo.h"
00015 #include "ips.h"
00016 #include "ido.h"
00017 #include "iec.h"
00018
00019 class CSimpSvrDoc;
00020 interface COleObject;
00021 interface CPersistStorage;
00022 interface CDataObject;
00023 interface COleInPlaceActiveObject;
00024 interface COleInPlaceObject;
00025 interface CExternalConnection;
00026
00027 class CSimpSvrObj : public IUnknown
00028 {
00029 private:
00030   CSimpSvrDoc FAR * m_lpDoc;      // Back pointer
00031   int m_nCount;                   // reference count
00032   BOOL m_fInPlaceActive;          // Used during InPlace Negotiation
00033   BOOL m_fInPlaceVisible;         // "  "  "  "   "   "   "   "   "
00034   BOOL m_fUIActive;               // "  "  "  "   "   "   "   "   "
00035   HMENU m_hmenuShared;            // "  "  "  "   "   "   "   "   "
00036   HOLEMENU m_hOleMenu;            // "  "  "  "   "   "   "   "   "
00037   RECT m_posRect;                 // "  "  "  "   "   "   "   "   "
00038   OLEINPLACEFRAMEINFO m_FrameInfo;
00039   BOOL m_fSaveWithSameAsLoad;
00040   BOOL m_fNoScribbleMode;
00041
00042   DWORD m_dwRegister;             // Registered in ROT
00043
00044   int m_red, m_green, m_blue;     // current color
00045   POINT m_size;                   // current size
00046   int m_xOffset;
00047   int m_yOffset;
00048   float m_scale;
00049
00050   HWND m_hWndParent;              // parent window handle
00051
00052   // interfaces used
00053   LPSTORAGE m_lpStorage;
00054   LPSTREAM m_lpColorStm, m_lpSizeStm;
00055   LPOLECLIENTSITE m_lpOleClientSite;          // IOleClientSite
00056   LPOLEADVISEHOLDER m_lpOleAdviseHolder;      // IOleAdviseHolder
00057   LPDATAADVISEHOLDER m_lpDataAdviseHolder;    // IDataAdviseHolder
00058   LPOLEINPLACEFRAME m_lpFrame;                // IOleInPlaceFrame
00059   LPOLEINPLACEUIWINDOW m_lpCntrDoc;           // IOleInPlaceUIWindow
00060   LPOLEINPLACESITE m_lpIPSite;                // IOleInPlaceSite
00061
00062   // interface implemented
00063   COleObject m_OleObject;                             // IOleObject
00064   CPersistStorage m_PersistStorage;                   // IPersistStorage
00065   CDataObject m_DataObject;                           // IDataObject
00066   COleInPlaceActiveObject m_OleInPlaceActiveObject;   // IOleInPlaceActiveObject
00067   COleInPlaceObject m_OleInPlaceObject;               // IOleInPlaceObject
00068   CExternalConnection m_ExternalConnection;
00069
00070 public:
00071   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppvObj);
00072   STDMETHODIMP_(ULONG) AddRef ();
00073   STDMETHODIMP_(ULONG) Release ();
00074
00075 // construction/destruction
00076   CSimpSvrObj(CSimpSvrDoc FAR * lpSimpSvrDoc);
00077   ~CSimpSvrObj();
00078
00079 // utility functions
00080   void Draw(HDC hDC, BOOL fMetaDC = TRUE);
00081   void PaintObj(HDC hDC);
00082   void lButtonDown(WPARAM wParam,LPARAM lParam);
00083   HANDLE GetMetaFilePict();
00084   void SaveToStorage (LPSTORAGE lpStg, BOOL fSameAsLoad);
00085   void LoadFromStorage ();
00086
00087 // visual editing helper functions
00088   BOOL DoInPlaceActivate (LONG lVerb);
00089   void AssembleMenus();
00090   void AddFrameLevelUI();
00091   void DoInPlaceHide();
00092   void DisassembleMenus();
00093   void SendOnDataChange();
00094   void DeactivateUI();
00095
00096 // member variable access
00097   inline BOOL IsInPlaceActive() { return m_fInPlaceActive; };
00098   inline BOOL IsInPlaceVisible() { return m_fInPlaceVisible; };
00099   inline BOOL IsUIActive() { return m_fUIActive; };
00100   inline HWND GetParent() { return m_hWndParent; };
00101   inline LPSTORAGE GetStorage() { return m_lpStorage; };
00102   inline LPOLECLIENTSITE GetOleClientSite() { return m_lpOleClientSite; };
00103   inline LPDATAADVISEHOLDER GetDataAdviseHolder() { return m_lpDataAdviseHolder; };
00104   inline LPOLEADVISEHOLDER GetOleAdviseHolder() { return m_lpOleAdviseHolder; };
00105   inline LPOLEINPLACEFRAME GetInPlaceFrame() { return m_lpFrame; };
00106   inline LPOLEINPLACEUIWINDOW GetUIWindow() { return m_lpCntrDoc; };
00107   inline LPOLEINPLACESITE GetInPlaceSite() { return m_lpIPSite; };
00108   inline COleObject FAR * GetOleObject() { return &m_OleObject; };
00109   inline CPersistStorage FAR * GetPersistStorage() { return &m_PersistStorage; };
00110   inline CDataObject FAR * GetDataObject() { return &m_DataObject; };
00111   inline COleInPlaceActiveObject FAR * GetOleInPlaceActiveObject() { return &m_OleInPlaceActiveObject; };
00112   inline COleInPlaceObject FAR * GetOleInPlaceObject() { return &m_OleInPlaceObject; };
00113   inline void ClearOleClientSite() { m_lpOleClientSite = NULL; };
00114   inline void ClearDataAdviseHolder() { m_lpDataAdviseHolder = NULL; };
00115   inline void ClearOleAdviseHolder() { m_lpOleAdviseHolder = NULL; };
00116   inline LPRECT GetPosRect() { return &m_posRect; };
00117   inline LPPOINT GetSize() { return &m_size; };
00118   inline LPOLEINPLACEFRAMEINFO GetFrameInfo() {return &m_FrameInfo;};
00119   inline DWORD GetRotRegister() { return m_dwRegister; };
00120
00121
00122
00123   // member manipulation
00124   inline void SetColor (int nRed, int nGreen, int nBlue)
00125     { m_red = nRed; m_green = nGreen; m_blue = nBlue; };
00126
00127   inline void RotateColor()
00128     { m_red+=10; m_green+=10; m_blue+=10;};
00129
00130
00131 // all of the interface implementations should be friends of this
00132 // class
00133 friend interface COleObject;
00134 friend interface CPersistStorage;
00135 friend interface CDataObject;
00136 friend interface COleInPlaceActiveObject;
00137 friend interface COleInPlaceObject;
00138 friend interface CExternalConnection;
00139
00140 };
00141 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/Msg.Cpp Source File

  • Web
  • NetMeeting
  • NMShare

Msg.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       MSG.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 // from cmd.cpp
00018 VOID CmdExit(void);
00019 LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00020
00021
00022
00023 //****************************************************************************
00024 //
00025 // LRESULT MsgDestroy(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00026 //
00027 // Handle a WM_DESTROY message
00028 //
00029 //****************************************************************************
00030
00031 LRESULT MsgDestroy(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00032 {
00033   PostQuitMessage(0);
00034   return 0;
00035 }
00036
00037
00038 //****************************************************************************
00039 //
00040 // LRESULT MsgClose(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00041 //
00042 // Handle a WM_CLOSE message
00043 //
00044 //****************************************************************************
00045
00046 LRESULT MsgClose(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00047 {
00048   FreeAllUsers();
00049   CmdExit();
00050   return 0;
00051 }
00052
00053
00054 //****************************************************************************
00055 //
00056 // LRESULT MsgSize(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00057 //
00058 // Handle a WM_SIZE message
00059 //
00060 //****************************************************************************
00061
00062 LRESULT MsgSize(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00063 {
00064   int dxClient = LOWORD(lParam);  // width of client area
00065   int dyClient = HIWORD(lParam);  // height of client area
00066
00067   SizeMsgWindow(dxClient, dyClient);
00068   return 0;
00069 }
00070
00071
00072 //****************************************************************************
00073 //
00074 // LRESULT MsgGetMinMax(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00075 //
00076 //****************************************************************************
00077
00078 LRESULT MsgGetMinMax(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00079 {
00080   LPMINMAXINFO lpminmax = (LPMINMAXINFO) lParam;
00081
00082   lpminmax->ptMinTrackSize.x = 325;
00083   lpminmax->ptMinTrackSize.y = 250;
00084
00085   return 0;
00086 }
00087
00088
00089 //****************************************************************************
00090 //
00091 // LRESULT MsgNotify(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00092 //
00093 //****************************************************************************
00094
00095 LRESULT MsgNotify(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00096 {
00097     switch (((LPNMHDR) lParam)->idFrom)
00098     {
00099     case IDW_APP:
00100       return MsgNotifyAppList(hwnd, uMsg, wParam, lParam);
00101     default:
00102         break;
00103     }
00104
00105     return 0;
00106 }
00107
00108
00109 ////////////////////////////////////////////////////////////////////////////
00110 // Main window message table definition.
00111 static MSD _rgmsdMain[] =
00112 {
00113   {WM_COMMAND,       MsgCmdMain},
00114   {WM_DESTROY,       MsgDestroy},
00115   {WM_CLOSE,         MsgClose},
00116   {WM_SIZE,          MsgSize},
00117   {WM_GETMINMAXINFO, MsgGetMinMax},
00118   {WM_NOTIFY,        MsgNotify},
00119
00120   {0, NULL}  // MUST be the last entry
00121 };
00122
00123
00124 //****************************************************************************
00125 //
00126 // LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00127 //
00128 // Main Window proc
00129 //
00130 //****************************************************************************
00131
00132 LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00133 {
00134   for (LPMSD lpmsd = _rgmsdMain; 0 != lpmsd->uMsg; lpmsd++)
00135   {
00136     if (lpmsd->uMsg == uMsg)
00137     {
00138       return lpmsd->pfnmsg(hwnd, uMsg, wParam, lParam);
00139     }
00140   }
00141
00142   return DefWindowProc(hwnd, uMsg, wParam, lParam);
00143 }
00144
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/DDxDDv.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

DDxDDv.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      DDxDDv.h
00007 //
00008 //  Implementation File:
00009 //      DDxDDv.cpp
00010 //
00011 //  Description:
00012 //      Definition of custom dialog data exchange/dialog data validation
00013 //      routines.
00014 //
00015 //  Author:
00016 //      <name> (<e-mail name>) Mmmm DD, 2003
00017 //
00018 //  Revision History:
00019 //
00020 //  Notes:
00021 //
00022 /////////////////////////////////////////////////////////////////////////////
00023
00024 #pragma once
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // Include Files
00028 /////////////////////////////////////////////////////////////////////////////
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 // Global Function Prototypes
00032 /////////////////////////////////////////////////////////////////////////////
00033
00034 void AFXAPI
00035 DDX_Number(
00036       CDataExchange *   pDXIn
00037     , int               nIDCIn
00038     , DWORD &           rdwValueInout
00039     , DWORD             dwMinIn
00040     , DWORD             dwMaxIn
00041     , BOOL              fSignedIn = FALSE
00042     );
00043
00044 void AFXAPI
00045 DDV_RequiredText(
00046       CDataExchange *   pDXIn
00047     , int               nIDCIn
00048     , int               nIDCLabelIn
00049     , const CString &   rstrValueIn
00050     );
00051
00052 inline void AFXAPI
00053 DDX_Number(
00054       CDataExchange *  pDXIn
00055     , int              nIDCIn
00056     , LONG &           rnValueInout
00057     , LONG             nMinIn
00058     , LONG             nMaxIn
00059     , BOOL             fSignedIn
00060     )
00061 {
00062     DDX_Number(
00063           pDXIn
00064         , nIDCIn
00065         , reinterpret_cast< DWORD & >( rnValueInout )
00066         , static_cast< DWORD >( nMinIn )
00067         , static_cast< DWORD >( nMaxIn )
00068         , fSignedIn
00069         );
00070
00071 } //*** DDXNumber
00072
00073 void
00074 CleanupLabel( LPTSTR pwszIn );
00075
00076 /////////////////////////////////////////////////////////////////////////////
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/cplusplus/StdAfx.h Source File

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • cplusplus

StdAfx.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            StdAfx.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #if !defined(AFX_STDAFX_H__A0A27F9F_B09D_11D2_BEF1_00A0C95EC343__INCLUDED_)
00013 #define AFX_STDAFX_H__A0A27F9F_B09D_11D2_BEF1_00A0C95EC343__INCLUDED_
00014
00015 #if _MSC_VER > 1000
00016 #pragma once
00017 #endif // _MSC_VER > 1000
00018
00019 #define STRICT
00020 #ifndef _WIN32_WINNT
00021 #define _WIN32_WINNT 0x0400
00022 #endif
00023 #define _ATL_APARTMENT_THREADED
00024
00025 #include <atlbase.h>
00026 //You may derive a class from CComModule and use it if you want to override
00027 //something, but do not change the name of _Module
00028 extern CComModule _Module;
00029 #include <atlcom.h>
00030
00031 //{{AFX_INSERT_LOCATION}}
00032 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00033
00034 #endif // !defined(AFX_STDAFX_H__A0A27F9F_B09D_11D2_BEF1_00A0C95EC343__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authentication/Authenticate.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Authentication

Authenticate.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       Authenticate.cpp
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011
00012
00013
00014 // Note: Proxy/Stub Information
00015 //      To build a separate proxy/stub DLL,
00016 //      run nmake -f Authenticateps.mk in the project directory.
00017
00018 #include "stdafx.h"
00019 #include "resource.h"
00020 #include <initguid.h>
00021 #include "Authenticate.h"
00022
00023 #include "AuthenticatePlugin.h"
00024
00025
00026 CComModule _Module;
00027
00028 BEGIN_OBJECT_MAP(ObjectMap)
00029 OBJECT_ENTRY(CLSID_AuthenticatePlugin, CAuthenticatePlugin)
00030 END_OBJECT_MAP()
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 // DLL Entry Point
00034
00035 extern "C"
00036 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00037 {
00038     if (dwReason == DLL_PROCESS_ATTACH)
00039     {
00040         _Module.Init(ObjectMap, hInstance, &LIBID_AUTHENTICATEPLUGINLib);
00041         DisableThreadLibraryCalls(hInstance);
00042     }
00043     else if (dwReason == DLL_PROCESS_DETACH)
00044         _Module.Term();
00045     return TRUE;    // ok
00046 }
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049 // Used to determine whether the DLL can be unloaded by OLE
00050
00051 STDAPI DllCanUnloadNow(void)
00052 {
00053     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00054 }
00055
00056 /////////////////////////////////////////////////////////////////////////////
00057 // Returns a class factory to create an object of the requested type
00058
00059 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00060 {
00061     return _Module.GetClassObject(rclsid, riid, ppv);
00062 }
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // DllRegisterServer - Adds entries to the system registry
00066
00067 STDAPI DllRegisterServer(void)
00068 {
00069     // registers object, typelib and all interfaces in typelib
00070     return _Module.RegisterServer(TRUE);
00071 }
00072
00073 /////////////////////////////////////////////////////////////////////////////
00074 // DllUnregisterServer - Removes entries from the system registry
00075
00076 STDAPI DllUnregisterServer(void)
00077 {
00078     return _Module.UnregisterServer(TRUE);
00079 }
00080
00081
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IO_WORK_ITEM Member List

This is the complete list of members for _IO_WORK_ITEM, including all inherited members.
cbReadSoFar | _IO_WORK_ITEM
pbDATAFromClient | _IO_WORK_ITEM
pecb | _IO_WORK_ITEM
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

comadmin::ICatalogCollection Member List

This is the complete list of members for comadmin::ICatalogCollection, including all inherited members.
Add() | comadmin::ICatalogCollection |
get_NewEnum() | comadmin::ICatalogCollection |
getAddEnabled() | comadmin::ICatalogCollection |
GetCollection(String bstrCollName, Variant varObjectKey) | comadmin::ICatalogCollection |
getCount() | comadmin::ICatalogCollection |
getDataStoreMajorVersion() | comadmin::ICatalogCollection |
getDataStoreMinorVersion() | comadmin::ICatalogCollection |
getItem(int lIndex) | comadmin::ICatalogCollection |
getName() | comadmin::ICatalogCollection |
getRemoveEnabled() | comadmin::ICatalogCollection |
GetUtilInterface() | comadmin::ICatalogCollection |
iid | comadmin::ICatalogCollection | [static]
Populate() | comadmin::ICatalogCollection |
PopulateByKey(com.ms.com.SafeArray aKeys) | comadmin::ICatalogCollection |
PopulateByQuery(String bstrQueryString, int lQueryType) | comadmin::ICatalogCollection |
Remove(int lIndex) | comadmin::ICatalogCollection |
SaveChanges() | comadmin::ICatalogCollection |
Generated on Wed Nov 13 2024 16:58:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/about.Cpp Source File

  • SysMgmt
  • MMC
  • Nodes

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163   MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164   *lpDest = wszStr;
00165
00166     return S_OK;
00167 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/globals.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

globals.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _MMC_GLOBALS_H
00015 #define _MMC_GLOBALS_H
00016
00017 #include <TChar.h>
00018 #include <Mmc.h>
00019 #include <CrtDbg.h>
00020 #include "Guids.h"
00021
00022
00023 class CBaseNode;                       // References
00024 class CDataObject;
00025
00026
00027 //---------------------------------------------------------------------------
00028 extern HINSTANCE g_hInst;              // Global instance handle
00029 extern ULONG     g_uObjectCount;       // Instance count for this object
00030 extern ULONG     g_uServerLocks;       // Server lock count for this object
00031
00032 //---------------------------------------------------------------------------
00033 // Clipformats requiered by MMC
00034
00035 extern UINT g_cfDisplayName;      // DisplayName for our SnapIn node
00036 extern UINT g_cfNodeType;         // GUID of the selected node
00037 extern UINT g_cfSnapinClsid;      // Class ID of this SnapIn
00038 extern UINT g_cfszNodeType;       // String version of namespace GUID
00039
00040 extern UINT g_cfBaseNodePtr;      // Retrieves BaseNode pointer
00041 extern UINT g_cfDataObjPtr;       // Retrieves pointer to CDataObject
00042
00043 //---------------------------------------------------------------------------
00044 //  Global function prototypes
00045
00046 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide );
00047 void _fastcall CopyT2W( LPWSTR strDest, LPCTSTR strSource, size_t count);
00048
00049 void InitClipboardFormats();
00050
00051 HRESULT ExtractFromDataObject( LPDATAOBJECT ipDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal );
00052
00053 CBaseNode* ExtractBaseNodePtr( LPDATAOBJECT ipDataObject );
00054 CDataObject* ExtractDataObjPtr( LPDATAOBJECT ipDataObject );
00055
00056 //---------------------------------------------------------------------------
00057 //  Global Strings
00058
00059
00060 static TCHAR*  gtszSNAPIN_NAME       = _T("Sample D (MMC 2.0) - ContextMenu");
00061 static TCHAR*  gtszABOUT_NAME        = _T("Sample D (MMC 2.0) - ISnapinAbout");
00062
00063
00064 static WCHAR*  gwszROOT_NODE_NAME    = L"Context Menu Sample";
00065 static WCHAR*  gwszABOUT_DESCRIPTION = L"MMC SDK ContextMenu Sample";
00066 static WCHAR*  gwszABOUT_PROVIDER    = L"Copyright © 1999 - 2001 Microsoft Corporation";
00067 static WCHAR*  gwszABOUT_VERSION     = L"2.0";
00068
00069 static TCHAR*  gtszCLSID_DEVICENODE  = _T("{520F23F9-775D-4015-B437-98A24B9D085E}");
00070
00071
00072 // We need to do this to get around MMC.IDL - it explicitly defines
00073 // the clipboard formats as WCHAR types...
00074 #define T_CCF_DISPLAY_NAME    _T("CCF_DISPLAY_NAME")
00075 #define T_CCF_NODETYPE        _T("CCF_NODETYPE")
00076 #define T_CCF_SZNODETYPE      _T("CCF_SZNODETYPE")
00077 #define T_CCF_SNAPIN_CLASSID  _T("CCF_SNAPIN_CLASSID")
00078
00079 #define T_CCF_BASENODE_PTR    _T("CCF_BASENODE_PTR")
00080 #define T_CCF_DATAOBJ_PTR     _T("CCF_DATAOBJ_PTR")
00081
00082 //---------------------------------------------------------------------------
00083 // Constants
00084
00085 #define NODETYPE_STATIC                100   // Node Types
00086 #define NODETYPE_DEVICE                200
00087 #define NODETYPE_FOLDER                300
00088 #define NODETYPE_RESULT                400   // Not used in this sample
00089
00090
00091 #define ATTRIBUTE_DATA_ARCHIVE         2     // Node Attributes
00092 #define ATTRIBUTE_DATA_HIDDEN          4
00093 #define ATTRIBUTE_DATA_LOCKED          8
00094 #define ATTRIBUTE_DATA_READONLY        16
00095 #define ATTRIBUTE_BACKUP_DEVICE        2048
00096
00097
00098 #define IMG_DEVICE_DEFAULT             0     // Image Indexes
00099 #define IMG_DEVICE_OFFLINE             1
00100 #define IMG_DATA_FILE                  2
00101 #define IMG_DRIVE_DEFAULT              3
00102 #define IMG_DRIVE_OFFLINE              4
00103 #define IMG_FOLDER_DEFAULT             5
00104 #define IMG_CDROM_DEFAULT              6
00105 #define IMG_REMOVABLE_MEDIA            7
00106
00107 #define IDM_NEW_DEVICE                 100   // CONTEXTMENU:  Menu defines
00108 #define IDM_NEW_FOLDER                 200
00109 #define IDM_TOGGLE_STATUS              300
00110
00111 #define STATUS_ONLINE                  1
00112 #define STATUS_OFFLINE                 0
00113
00114 // Define some custom window messages so that objects running in
00115 // different threads can send us commands.
00116 //
00117 #define WM_DEL_DEVICENODES             (WM_USER + 100)
00118 #define WM_ADD_DEVICENODE              (WM_USER + 101)
00119 #define WM_DEVICENODE_CLOSED           (WM_USER + 102)
00120
00121 // Defines interfaces which can be requested from IComponentData
00122 // or IComponet's ::GetInterface method
00123 //
00124 #define REQUEST_ICONSOLENAMESPACE2     1000
00125 #define REQUEST_ICONSOLE               1001
00126 #define REQUEST_ICONSOLEVERB           1002
00127 #define REQUEST_IRESULTDATA            1003
00128 #define REQUEST_IHEADERCTRL2           1004
00129
00130
00131 /////////////////////////////////////////////////////////////////////////////
00132 // Helper classes and macros
00133
00134 #define BYTE_SIZE(string)          ((_tcslen(string)+1) * sizeof(TCHAR))
00135
00136 #define BREAK_ON_ERROR( hResult )  if( S_OK != hResult ) continue
00137
00138 // Useful only for debugging.  Never use modal dialogs in release builds!!
00139 #define MsgBox(wszMsg, wszTitle) ::MessageBox(NULL, wszMsg, wszTitle, MB_OK)
00140
00141
00142 //---------------------------------------------------------------------------
00143 template<class TYPE>
00144 inline void SAFE_RELEASE( TYPE*& pObj )
00145 {
00146   if( NULL != pObj )
00147   {
00148     pObj->Release();
00149     pObj = NULL;
00150   }
00151   else
00152   {
00153     OutputDebugString(_T("Attempted to release NULL Com pointer.\n"));
00154   }
00155 }
00156
00157 //---------------------------------------------------------------------------
00158 template<class TYPE>
00159 inline void SAFE_FREE_BITMAP( TYPE*& pObj )
00160 {
00161   if( NULL != pObj )
00162   {
00163     BOOL bStatus = DeleteObject( pObj );
00164     pObj = NULL;
00165   }
00166   else
00167   {
00168     OutputDebugString(_T("Attempted to delete NULL Bitmap handle.\n"));
00169   }
00170 }
00171
00172 //---------------------------------------------------------------------------
00173 template<class TYPE>
00174 inline void SAFE_FREE_ICON( TYPE*& pObj )
00175 {
00176   if( NULL != pObj )
00177   {
00178     BOOL bStatus = DestroyIcon( pObj );
00179     pObj = NULL;
00180   }
00181   else
00182   {
00183     OutputDebugString(_T("Attempted to delete NULL Icon handle.\n"));
00184   }
00185 }
00186
00187
00188
00189 //---------------------------------------------------------------------------
00190 //  W2T converts a wide character string to unicode if _UNICODE is not
00191 //  defined.  If it is defined then the sting is copied to another buffer.
00192 //
00193 #ifndef _UNICODE
00194 #define W2T( szAnsiPtr, szWide )   Unicode2Ansi( szAnsiPtr, szWide )
00195 #else
00196 #define W2T( szAnsiPtr, szWide )                                 \
00197         *szAnsiPtr = (WCHAR*)CoTaskMemAlloc(BYTE_SIZE(szWide) ); \
00198         CopyMemory( *szAnsiPtr, szWide, BYTE_SIZE(szWide) )
00199
00200 #endif //_UNICODE
00201
00202
00203 #endif //_MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/cunknown.cpp Source File

  • Com
  • async
  • server

cunknown.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "CUnknown.h"
00018 #include "CFactory.h"
00019 #include "Debug.h"
00020 ///////////////////////////////////////////////////////////
00021 //
00022 // Static variables
00023 //
00024 long CUnknown::s_cActiveComponents = 0; // Count of active objects
00025
00026
00027
00028 ///////////////////////////////////////////////////////////
00029 //
00030 // Constructor
00031 //
00032 CUnknown::CUnknown(LPUNKNOWN pUnknownOuter, LPCSTR className)
00033 : m_cRef(0), m_lpstrClass(className)
00034 {
00035   DEBUGTRACE(_T("In CUnknown ctor"));
00036   // Set m_pUnknownOuter pointer.
00037   if (pUnknownOuter == NULL)
00038   {
00039     DEBUGTRACE(_T("Not aggregating; delegate to nondelegating IUnknown")) ;
00040     m_pUnknownOuter = reinterpret_cast<IUnknown*>
00041                          (static_cast<INondelegatingUnknown*>
00042                          (this)) ;
00043   }
00044   else
00045   {
00046     DEBUGTRACE(_T("Aggregating; delegate to outer IUnknown")) ;
00047     m_pUnknownOuter = pUnknownOuter ;
00048   }
00049
00050   // Increment count of active components.
00051   ::InterlockedIncrement(&s_cActiveComponents) ;
00052 }
00053
00054 //
00055 // Destructor
00056 //
00057 CUnknown::~CUnknown()
00058 {
00059   DEBUGTRACE(_T("In CUnknown dtor"));
00060   InterlockedDecrement(&s_cActiveComponents) ;
00061 }
00062
00063 //
00064 // FinalRelease - called by Release before it deletes the component
00065 //
00066 void CUnknown::FinalRelease()
00067 {
00068   DEBUGTRACE(_T("Increment reference count for final release")) ;
00069   m_cRef = 1 ;
00070 }
00071
00072 //
00073 // Nondelegating IUnknown
00074 //   - Override to handle custom interfaces.
00075 //
00076 HRESULT __stdcall
00077   CUnknown::NondelegatingQueryInterface(const IID& iid, void** ppv)
00078 {
00079   // CUnknown supports only IUnknown.
00080 #if defined(_DEBUG)
00081   LPWSTR lpstrIID;
00082   StringFromIID(iid, &lpstrIID);
00083   DEBUGTRACE(_T("%s::QueryInterface has been asked for %S returning %s"), m_lpstrClass, lpstrIID,
00084     iid == IID_IUnknown ? "S_OK" : "E_NOINTERFACE");
00085   CoTaskMemFree(lpstrIID);
00086 #endif
00087
00088   CHECKPOINTER(ppv);
00089
00090   if (iid == IID_IUnknown)
00091   {
00092     return FinishQI(reinterpret_cast<LPUNKNOWN>
00093                        (static_cast<INondelegatingUnknown*>(this)), iid, ppv) ;
00094   }
00095   else
00096   {
00097     *ppv = NULL ;
00098     return E_NOINTERFACE ;
00099   }
00100 }
00101
00102 //
00103 // AddRef
00104 //
00105 ULONG __stdcall CUnknown::NondelegatingAddRef()
00106 {
00107   DEBUGTRACE(_T("In %s::NondelegatingAddRef refcounts = %i"), m_lpstrClass, m_cRef+1);
00108   return ::InterlockedIncrement(&m_cRef) ;
00109 }
00110
00111 //
00112 // Release
00113 //
00114 ULONG __stdcall CUnknown::NondelegatingRelease()
00115 {
00116   _ASSERT(m_cRef > 0); // not thread safe
00117   DEBUGTRACE(_T("In %s::NondelegatingRelease refcounts = %i"), m_lpstrClass, m_cRef-1);
00118   if (InterlockedDecrement(&m_cRef) == 0)
00119   {
00120     FinalRelease() ;
00121     delete this ;
00122     return 0 ;
00123   }
00124   return m_cRef ;
00125 }
00126
00127 //
00128 // FinishQI
00129 //   - Helper function to simplify overriding
00130 //     NondelegatingQueryInterface
00131 //
00132 HRESULT _stdcall CUnknown::FinishQI(IUnknown* pI, REFIID iid, void** ppv)
00133 {
00134 #if defined(_DEBUG)
00135   LPWSTR lpstrIID;
00136   StringFromIID(iid, &lpstrIID);
00137   DEBUGTRACE(_T("%s::QueryInterface has been asked for %S returning S_OK"), m_lpstrClass, lpstrIID);
00138   CoTaskMemFree(lpstrIID);
00139 #endif
00140
00141   *ppv = pI ;
00142   pI->AddRef() ;
00143   return S_OK ;
00144 }
00145
00146
00147 HRESULT _stdcall CUnknown::Quit()
00148 {
00149   // clean up any outstanding interfaces including those which have been aggregated
00150   m_cRef = 1;
00151   CFactory::s_cServerLocks = 0;
00152   // the reason the count is 1 is to keep the proxy alive till the client has time to call CUnknown::Release()
00153   return S_OK;
00154 }
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/Nideque.h Source File

  • NetDS
  • WinSock
  • Dt_Dll

Nideque.h

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright 1996 - 2000 Microsoft Corporation.
00004
00005   Copyright (c) 1995 Intel Corp
00006
00007   File Name:
00008
00009     nideque.h
00010
00011   Abstract:
00012
00013     Implements Deque structures.  These are double linked lists  that
00014     can place and remove data from the beginning and end. This file
00015     also contains an iterator for Deques.  Important to notice is that
00016     these are non-intrusive deques.  Meaning the use of these classes
00017     does not need to insert pointers into there classes to use these.
00018
00019 --*/
00020
00021 #ifndef _NIDEQUE_H_
00022 #define _NIDEQUE_H_
00023
00024 #include "nowarn.h"  /* turn off benign warnings */
00025 #ifndef _WINSOCKAPI_
00026 #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
00027 #endif
00028 #include <windows.h>
00029 #include "nowarn.h"  /* some warnings may have been turned back on */
00030 #include "huerror.h"
00031
00032 template<class T> class NIDeque_c;
00033 template<class T> class NIDequeIter_c;
00034
00035 // Class Name:     NILNode_c
00036 // Purpose:  Simply holds data and pointer to form a double linked
00037 // list.
00038 // Context:  Can be used anywhere.
00039 template<class T> class NILNode_c {
00040     friend class NIDeque_c<T>;
00041     friend class NIDequeIter_c<T>;
00042
00043     private:
00044         T           Data;
00045         NILNode_c   *Next,
00046                     *Back;
00047
00048     public:
00049         NILNode_c();
00050 };
00051
00052 template<class T> NILNode_c<T>::NILNode_c()
00053 {
00054     // Make sure the members are correctly initialized.
00055     Next = NULL;
00056     Back = NULL;
00057 } // NILNode_c::NILNode_c
00058
00059
00060
00061 // Class Name:     NIDeque_c
00062 // Purpose:  Non-intrusize deque
00063 // Context:  Can be used anywhere.
00064 template<class T> class NIDeque_c {
00065     friend class NIDequeIter_c<T>;
00066
00067     private:
00068       NILNode_c<T>  *Root,
00069                     *Tail;
00070     public:
00071                 NIDeque_c();
00072             ~NIDeque_c();
00073         BOOL    RemoveFromFront(T &data);
00074         BOOL    RemoveFromBack(T &data);
00075         BOOL    InsertIntoFront(T data);
00076         BOOL    InsertIntoBack(T data);
00077         BOOL    GetFromFront(T &data);
00078     BOOL    GetFromBack(T &data);
00079     BOOL    IsEmpty();
00080 };
00081
00082
00083
00084
00085 /*++
00086
00087   NIDeque_c::NIDeque_c()
00088
00089   Function Description:
00090
00091       Constructor
00092
00093   Arguments:
00094
00095       None.
00096
00097   Return Value:
00098
00099       None.
00100
00101 --*/
00102 template<class T> NIDeque_c<T>::NIDeque_c()
00103 {
00104     Root = NULL;
00105     Tail = NULL;
00106 } // End of NINIDeque_c::NIDeque_c
00107
00108
00109
00110
00111
00112 /*++
00113
00114   NIDeque_c::~NIDeque_c()
00115
00116   Function Description:
00117
00118       Destructor
00119
00120   Arguments:
00121
00122       None.
00123
00124   Return Value:
00125
00126       None.
00127
00128 --*/
00129 template<class T> NIDeque_c<T>::~NIDeque_c()
00130 {
00131     NILNode_c<T>    *bptr    = NULL,
00132                     *cptr    = NULL;
00133
00134     for(bptr=NULL,cptr=Root;cptr;bptr=cptr,cptr=cptr->Next){
00135         delete bptr;
00136     }
00137     delete bptr;
00138 }
00139
00140
00141
00142
00143 /*++
00144
00145   NIDeque_c::InsertIntoFront()
00146
00147   Function Description:
00148
00149       Inserts a piece of data onto the linked list.
00150
00151   Arguments:
00152
00153       Data -- Data to put on the linked list.
00154
00155   Return Value:
00156
00157       None.
00158
00159 --*/
00160 template<class T> BOOL NIDeque_c<T>::InsertIntoFront(T Data)
00161 {
00162     NILNode_c<T>    *nptr    = NULL;
00163
00164     /*  If the list contains something then move the root pointer down.
00165     //  Otherwise, put this new object on the root.
00166     */
00167     nptr = new NILNode_c<T>;
00168     if(!nptr){
00169          HUSetLastError(ALLOCERROR);
00170          return FALSE;
00171     }
00172
00173     nptr->Data = Data;
00174
00175     if(Root){
00176         nptr->Next = Root;
00177         Root->Back = nptr;
00178         Root = nptr;
00179     }else{
00180         Root = nptr;
00181         Tail = nptr;
00182     }
00183     return TRUE;
00184 } // End of NIDeque_c::InsFront
00185
00186
00187
00188
00189 /*++
00190
00191   NIDeque_c::RemoveFromFront()
00192
00193   Function Description:
00194
00195       Removes a piece of data from the front of the linked list.
00196
00197   Arguments:
00198
00199       Data -- Data to be taken off of the linked list.
00200
00201   Return Value:
00202
00203       None.
00204
00205 --*/
00206 template<class T> BOOL NIDeque_c<T>::RemoveFromFront(T &Data)
00207 {
00208     NILNode_c<T>    *nptr    = NULL;
00209
00210     if(Root){
00211         nptr = Root;
00212         Root = Root->Next;
00213         if(Root){
00214             Root->Back = NULL;
00215         }else{
00216             Tail = NULL;
00217         }
00218         nptr->Next = NULL;
00219         nptr->Back = NULL;
00220         Data = nptr->Data;
00221         delete nptr;
00222         return TRUE;
00223     }else{
00224         Data = NULL;
00225         return FALSE;
00226     }
00227 } // End of NIDeque_c::RemFront
00228
00229
00230
00231
00232 /*++
00233
00234   NIDeque_c::InsertIntoBack()
00235
00236   Function Description:
00237
00238       Inserts a piece of data onto the back of the linked list.
00239
00240   Arguments:
00241
00242       Data -- Data to be taken off of the linked list.
00243
00244   Return Value:
00245
00246       None.
00247
00248 --*/
00249 template<class T> BOOL NIDeque_c<T>::InsertIntoBack(T Data)
00250 {
00251     NILNode_c<T>    *nptr    = NULL;
00252
00253     nptr = new NILNode_c<T>;
00254     if(!nptr){
00255         HUSetLastError(ALLOCERROR);
00256         return FALSE;
00257     }
00258
00259     nptr->Data = Data;
00260
00261     if(Root){
00262         nptr->Back = Tail;
00263         Tail->Next = nptr;
00264         Tail = nptr;
00265     }else{
00266         Root = nptr;
00267         Tail = nptr;
00268     }
00269     return TRUE;
00270 } // End of NIDeque_c::InsBack
00271
00272
00273
00274
00275 /*++
00276
00277   NIDeque_c::RemoveFromBack()
00278
00279   Function Description:
00280
00281       Removes a piece of data from the back of the linked list.
00282
00283   Arguments:
00284
00285       Data -- Data to be taken off of the linked list.
00286
00287   Return Value:
00288
00289       None.
00290
00291 --*/
00292 template<class T> BOOL NIDeque_c<T>::RemoveFromBack(T &Data)
00293 {
00294     NILNode_c<T>    *nptr    = NULL;
00295
00296     if(Tail){
00297         nptr = Tail;
00298         Tail = Tail->Back;
00299         if(Tail){
00300             Tail->Next = NULL;
00301         }else{
00302         Root = NULL;
00303     }
00304         nptr->Next = NULL;
00305         nptr->Back = NULL;
00306         Data = nptr->Data;
00307         delete nptr;
00308         return TRUE;
00309     }else{
00310         Data = NULL;
00311         return FALSE;
00312     }
00313 }
00314
00315
00316
00317
00318 /*++
00319
00320   NIDeque_c::GetFromFront()
00321
00322   Function Description:
00323
00324       Gets a piece of data from the front of the linked list.
00325
00326   Arguments:
00327
00328       Data -- Data to be taken off of the linked list.
00329
00330   Return Value:
00331
00332       None.
00333
00334 --*/
00335 template<class T> BOOL NIDeque_c<T>::GetFromFront(T &Data)
00336 {
00337     NILNode_c<T>    *nptr    = NULL;
00338
00339     if(Root){
00340         Data = Root->Data;
00341         return TRUE;
00342     }else{
00343         Data = NULL;
00344         return FALSE;
00345     }
00346 } // End of NIDeque_c::GetFromFront
00347
00348
00349
00350
00351 /*++
00352
00353   NIDeque_c::GetFromBack()
00354
00355   Function Description:
00356
00357       Gets a piece of data from the back of the linked list.
00358
00359   Arguments:
00360
00361       Data -- Data to be taken off of the linked list.
00362
00363   Return Value:
00364
00365       None.
00366
00367 --*/
00368 template<class T> BOOL NIDeque_c<T>::GetFromBack(T &Data)
00369 {
00370     NILNode_c<T>    *nptr    = NULL;
00371
00372     if(Tail){
00373         Data = Tail->Data;
00374         return TRUE;
00375     }else{
00376         Data = NULL;
00377         return FALSE;
00378     }
00379 } // End of NIDeque_c::RemFront
00380
00381
00382
00383
00384 /*++
00385
00386   NIDeque_c::IsEmpty()
00387
00388   Function Description:
00389
00390       Determines whether a deques is empty
00391
00392   Arguments:
00393
00394       None.
00395
00396   Return Value:
00397
00398       None.
00399
00400 --*/
00401 template<class T> BOOL NIDeque_c<T>::IsEmpty()
00402 {
00403
00404     if(Root){
00405         return FALSE;
00406     }else{
00407         return TRUE;
00408     }
00409 } // End of NIDeque_c::IsEmpty
00410
00411
00412 // Name:     NIDequeIter_c
00413 // Purpose:  An iterator for the Deque_c class.
00414 // Context:  Of course only with Deque_c
00415 template<class T> class NIDequeIter_c {
00416     private:
00417         NIDeque_c<T>  *NIDeque;
00418         NILNode_c<T>  *Current;
00419
00420     private:
00421         void    RemoveData(NILNode_c<T> *cptr,T &data);
00422
00423     protected: // Derived class interface
00424     inline NILNode_c<T> *GetCurrent();
00425     inline NIDeque_c<T> *GetNIDeque();
00426
00427     public:
00428                 NIDequeIter_c();
00429                 NIDequeIter_c(NIDeque_c<T> &ANIDeque);
00430                 ~NIDequeIter_c();
00431         BOOL    Initialize(NIDeque_c<T> &ANIDeque);
00432         BOOL    First(T &data);
00433         BOOL    Next(T &data);
00434         BOOL    Last(T &data);
00435         BOOL    Back(T &data);
00436         BOOL    Remove(T &data);
00437         BOOL    Replace(T &src,T chg);
00438 };
00439
00440 //
00441 // Private members
00442 //
00443
00444
00445 /*++
00446
00447   NIDequeIter_c::RemoveData()
00448
00449   Function Description:
00450
00451       To remove all of the data from the linked list.
00452
00453   Arguments:
00454
00455       cptr -- Current pointer in the linked list.
00456
00457       ret_data -- Return the data before deleting.
00458
00459   Return Value:
00460
00461       None.
00462
00463 --*/
00464 template<class T> void NIDequeIter_c<T>::RemoveData(NILNode_c<T> *cptr,
00465                                                     T &ret_data)
00466 {
00467     NILNode_c<T>  *bptr    = NULL,
00468                   *nptr    = NULL,
00469                   *fptr    = NULL;
00470
00471     if(Current == cptr){
00472         Current = cptr->Next;
00473     }
00474     fptr = cptr;
00475     bptr = cptr->Back;
00476     nptr = cptr->Next;
00477     if(bptr != NULL){
00478         bptr->Next = nptr;
00479     }
00480     if(nptr != NULL){
00481         nptr->Back = bptr;
00482     }
00483     if(fptr == NIDeque->Root){
00484         NIDeque->Root = nptr;
00485     }
00486     if(fptr == NIDeque->Tail){
00487         NIDeque->Tail = bptr;
00488     }
00489     if(ret_data){
00490         ret_data = fptr->Data;
00491     }
00492     delete fptr;
00493 } // End of NINIDeque_c::RemoveData
00494
00495
00496 //
00497 // Public members
00498 //
00499
00500
00501 /*++
00502
00503   NIDequeIter_c::NIDequeIter_c()
00504
00505   Function Description:
00506
00507       Constructor.
00508
00509   Arguments:
00510
00511       ANIDeque -- The deque to iterate over.
00512
00513   Return Value:
00514
00515       None.
00516
00517 --*/
00518 template<class T> NIDequeIter_c<T>::NIDequeIter_c(NIDeque_c<T> &ANIDeque)
00519 {
00520     NIDeque = &ANIDeque;
00521     Current = NULL;
00522 }
00523
00524
00525
00526 template<class T> NIDequeIter_c<T>::NIDequeIter_c()
00527 {
00528     NIDeque = NULL;
00529     Current = NULL;
00530 }
00531
00532
00533
00534
00535 /*++
00536
00537   NIDequeIter_c::~NIDequeIter_c()
00538
00539   Function Description:
00540
00541       Destructor.
00542
00543   Arguments:
00544
00545       None.
00546
00547   Return Value:
00548
00549       None.
00550
00551 --*/
00552 template<class T> NIDequeIter_c<T>::~NIDequeIter_c()
00553 {
00554 }
00555
00556
00557
00558 /*++
00559
00560   NIDequeIter_c::Initialize()
00561
00562   Function Description:
00563
00564       Initializes the iterator.
00565
00566   Arguments:
00567
00568       ANIDeque -> The deque to iterate over.
00569
00570   Return Value:
00571
00572       None.
00573
00574 --*/
00575 template<class T> BOOL NIDequeIter_c<T>::Initialize(NIDeque_c<T> &ANIDeque)
00576 {
00577     NIDeque = &ANIDeque;
00578     Current = NULL;
00579     return TRUE;
00580 }
00581
00582
00583
00584
00585 /*++
00586
00587   NIDequeIter_c::First()
00588
00589   Function Description:
00590
00591       Returns the First data in the linked list.  This primes the
00592       current pointer so that next time the Next method is used to get
00593       more linked list data.
00594
00595   Arguments:
00596
00597       data -- The data from the linked list.
00598
00599   Return Value:
00600
00601       TRUE -- If data is valid.
00602
00603       FALSE -- If data is not valid.
00604
00605 --*/
00606 template<class T> BOOL NIDequeIter_c<T>::First(T &Data)
00607 {
00608     Current = NIDeque->Root;
00609     if(Current != NULL){
00610         Data = Current->Data;
00611         return TRUE;
00612     }else{
00613         return FALSE;
00614     }
00615 } // End of NIDeque_c::First
00616
00617
00618
00619
00620 /*++
00621
00622   NIDequeIter_c::Next()
00623
00624   Function Description:
00625
00626       Returns the Next data in the linked list.
00627
00628   Arguments:
00629
00630       data -- The data from the linked list.
00631
00632   Return Value:
00633
00634       TRUE -- If data is valid.
00635
00636       FALSE -- If data is not valid.
00637
00638 --*/
00639 template<class T> BOOL NIDequeIter_c<T>::Next(T &Data)
00640 {
00641     if(Current){
00642         Current = Current->Next;
00643         if(Current){
00644             Data = Current->Data;
00645             return TRUE;
00646         }
00647     }
00648     Data = NULL;
00649     return FALSE;
00650 } // End of NIDeque_c::Next
00651
00652
00653
00654
00655 /*++
00656
00657   NIDequeIter_c::Last()
00658
00659   Function Description:
00660
00661       Returns the Last data in the linked list.
00662
00663   Arguments:
00664
00665       data -- The data from the linked list.
00666
00667   Return Value:
00668
00669       TRUE -- If data is valid.
00670
00671       FALSE -- If data is not valid.
00672
00673 --*/
00674 template<class T> BOOL NIDequeIter_c<T>::Last(T &Data)
00675 {
00676     Current = NIDeque->Tail;
00677     if(Current != NULL){
00678         Data = Current->Data;
00679         return TRUE;
00680     }else{
00681         return FALSE;
00682     }
00683 } // End of NIDeque_c::First
00684
00685
00686
00687
00688 /*++
00689
00690   NIDequeIter_c::Back()
00691
00692   Function Description:
00693
00694       Returns the previous data in the linked list.
00695
00696   Arguments:
00697
00698       data -- The data from the linked list.
00699
00700   Return Value:
00701
00702       TRUE -- If data is valid.
00703
00704       FALSE -- If data is not valid.
00705
00706 --*/
00707 template<class T> BOOL NIDequeIter_c<T>::Back(T &Data)
00708 {
00709     if(Current && (Current = Current->Back)){
00710         Data = Current->Data;
00711         return TRUE;
00712     }else{
00713         Data = NULL;
00714         return FALSE;
00715     }
00716 } // End of NIDeque_c::Next
00717
00718
00719
00720
00721 /*++
00722
00723   NIDequeIter_c::Replace()
00724
00725   Function Description:
00726
00727       Replaces src by chg.
00728
00729   Arguments:
00730
00731       src -- Data to search for.
00732
00733       chg -- The new data.
00734
00735   Return Value:
00736
00737       TRUE -- If data is valid.
00738
00739       FALSE -- If data is not valid.
00740
00741 --*/
00742 template<class T> BOOL NIDequeIter_c<T>::Replace(T &src,T chg)
00743 {
00744     NILNode_c<T> *cptr    = NULL;
00745
00746     if(Current != NULL){
00747         src = Current->Data;
00748         Current->Data = chg;
00749         return TRUE;
00750     }
00751     return FALSE;
00752 } // End of NIDeque_c::Replace
00753
00754
00755
00756
00757 /*++
00758
00759   NIDequeIter_c::Remove()
00760
00761   Function Description:
00762
00763       Removes whatever the current pointer is pointing at.
00764
00765   Arguments:
00766
00767       data -- Data removed.
00768
00769   Return Value:
00770
00771       TRUE -- If data is valid.
00772
00773       FALSE -- If data is not valid.
00774
00775 --*/
00776 template<class T> BOOL NIDequeIter_c<T>::Remove(T &data)
00777 {
00778     NILNode_c<T>    *cptr   = NULL;
00779     T               *vdata  = NULL;
00780
00781     if(Current != NULL){
00782         RemoveData(Current,data);
00783         return TRUE;
00784     }
00785     return FALSE;
00786 } // End of NIDeque_c<T>::Remove
00787
00788 #endif
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBlockFormat Member List

This is the complete list of members for CBlockFormat, including all inherited members.
_fontChar | CBlockFormat |
_fontCode | CBlockFormat |
_fuFormat | CBlockFormat |
_size | CBlockFormat |
CBlockFormat() | CBlockFormat | [protected]
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/SampleFSP/Resource.h Source File

  • NetDS
  • fax
  • SampleFSP

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by newfsp.rc
00004 //
00005
00006 // Next default values for new objects
00007 //
00008 #ifdef APSTUDIO_INVOKED
00009 #ifndef APSTUDIO_READONLY_SYMBOLS
00010 #define _APS_NO_MFC                     1
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/foldernode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

foldernode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CFolderNode class.  This node is a child of
00014 //                CDeviceNode.  It represents a Virtual Storage folder
00015 //
00016 //
00017
00018
00019 #ifndef _CLASS_CFOLDERNODE_
00020 #define _CLASS_CFOLDERNODE_
00021
00022 #include "Globals.h"
00023 #include "BaseNode.h"
00024 #include "VirtualFile.h"     // Result item children of this node
00025 #include "LListImpl.h"       // Linked list class
00026
00027
00028 class CComponentData;        // References
00029
00030 //---------------------------------------------------------------------------
00031 class CFolderNode : public CBaseNode
00032 {
00033   public:
00034     CFolderNode();
00035     virtual ~CFolderNode();
00036
00037     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00038
00039   ///////////////////////////////////////////////////////////////////////////
00040   // Virtual methods
00041   public:
00042     ULONG   GetNodeType() { return NODETYPE_FOLDER; }
00043     GUID&   GetNodeGUID() { return thisGUID; }
00044     HRESULT GetProperty( BSTR bstrPropertyName, PBSTR pbstrProperty ) { return E_NOTIMPL; }
00045
00046     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00047     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00048     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00049
00050   ///////////////////////////////////////////////////////////////////////////
00051   //  Notification handlers
00052   //
00053   public:
00054     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00055     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00056     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00057     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00058     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00059     HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00060             { return E_NOTIMPL; }
00061
00062     HRESULT OnDelete( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00063             { return E_NOTIMPL; }
00064
00065   ///////////////////////////////////////////////////////////////////////////
00066   //  Context Menu methods
00067   //
00068   public:
00069     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00070     HRESULT Command( long lCommandID );
00071
00072   ///////////////////////////////////////////////////////////////////////////
00073   // Private helpers
00074   private:
00075     HRESULT RefreshNodeList();
00076     VOID    RemoveChildNodes();
00077     HRESULT EnumerateResultItems( LPRESULTDATA ipResultData );
00078     HRESULT AddVirtualFile( NODE_PROPERTIES* pProps = NULL );
00079
00080   private:
00081     static GUID  thisGUID;
00082     DWORD        m_dwAttributes;
00083
00084     CLListImpl<CVirtualFile*,CVirtualFile*>  m_NodeList;
00085     CComponentData* m_pCompData;
00086     HWND            m_hMessageWnd;     // Our message handler
00087
00088   public:
00089     HWND   m_hAddVFileDlg;             // Instance of AddDeviceDlg
00090
00091     VOID   RemoveVirtualFile( CVirtualFile* pDeadNode );
00092     static LRESULT CALLBACK FolderNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00093 };
00094
00095 #endif //_CLASS_CFOLDERNODE_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Filter/vc/Filter.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Filter
  • vc

Filter.cpp

Go to the documentation of this file.
00001 // Filter.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "stdio.h"
00006 #include "activeds.h"
00007
00008
00009 int main(int argc, char* argv[])
00010 {
00011   HRESULT hr;
00012   IADsContainer *pCont=NULL;
00013
00014   CoInitialize(NULL);
00015   ///////////////////////////////////
00016   // Bind to the object
00017   /////////////////////////////////
00018   hr = ADsGetObject(L"WinNT://INDEPENDENCE", IID_IADsContainer, (void**) &pCont );
00019   if ( !SUCCEEDED(hr) )
00020   {
00021     return hr;
00022   }
00023
00024   ///////////////////////////////////
00025   // Build variant filter
00026   /////////////////////////////////
00027   LPWSTR pszFilter[] = { L"user", L"group" };
00028   DWORD dwNumber = sizeof( pszFilter ) /sizeof(LPWSTR);
00029   VARIANT var;
00030
00031   hr = ADsBuildVarArrayStr( pszFilter, dwNumber, &var );
00032
00033   if ( !SUCCEEDED(hr) )
00034   {
00035     pCont->Release();
00036     return hr;
00037   }
00038
00039   ///////////////////////////////////
00040   // Set the filter
00041   /////////////////////////////////
00042
00043   hr = pCont->put_Filter(var);
00044   VariantClear(&var);
00045
00046   if (!SUCCEEDED(hr) )
00047   {
00048     pCont->Release();
00049     return hr;
00050   }
00051
00052   ////////////////////////////////////////////
00053   // Enumerate the result
00054   ///////////////////////////////////////////////
00055   IEnumVARIANT *pEnum = NULL;
00056   hr = ADsBuildEnumerator( pCont, &pEnum );
00057   pCont->Release(); // no longer needed, since we have the enumerator already
00058
00059   if ( SUCCEEDED(hr) )
00060   {
00061     VARIANT var;
00062     ULONG lFetch;
00063     IADs *pChild=NULL;
00064     VariantInit(&var);
00065
00066     while( SUCCEEDED(ADsEnumerateNext( pEnum, 1, &var, &lFetch )) && lFetch == 1 )
00067     {
00068       hr = V_DISPATCH(&var)->QueryInterface( IID_IADs, (void**) &pChild );
00069       if ( SUCCEEDED(hr) )
00070       {
00071         BSTR bstrName;
00072         BSTR bstrClass;
00073         // Get more information on the child classes
00074         pChild->get_Name(&bstrName);
00075         pChild->get_Class(&bstrClass);
00076
00077         printf("%S\t\t(%S)\n", bstrName, bstrClass );
00078
00079         // Clean-up
00080         SysFreeString(bstrName);
00081         SysFreeString(bstrClass);
00082
00083         pChild->Release();
00084       }
00085       VariantClear(&var);
00086     }
00087   }
00088
00089
00090               if ( pEnum )
00091   {
00092     ADsFreeEnumerator( pEnum );
00093   }
00094
00095   CoUninitialize();
00096
00097   return 0;
00098 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/SDKSamplePlaylistParser.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

SDKSamplePlaylistParser.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            SDKSamplePlaylistParser.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #pragma once
00013
00014 #ifndef __SDKSAMPLEPLAYLISTPARSER_H_
00015 #define __SDKSAMPLEPLAYLISTPARSER_H_
00016
00017 #include "resource.h"       // main symbols
00018
00019 // Windows Media Server SDK
00020 #include "WMSBasicPlugin.h"
00021 #include "WMSPlaylistParser.h"
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 class ATL_NO_VTABLE CSDKSamplePlaylistParser :
00025     public CComObjectRootEx<CComMultiThreadModel>,
00026     public IWMSPlaylistParser
00027 {
00028 public:
00029
00030 BEGIN_COM_MAP(CSDKSamplePlaylistParser)
00031     COM_INTERFACE_ENTRY(IWMSPlaylistParser)
00032 END_COM_MAP()
00033
00034     // CSDKSamplePlaylistParser
00035     CSDKSamplePlaylistParser();
00036     virtual ~CSDKSamplePlaylistParser();
00037     HRESULT Initialize(
00038         IWMSCommandContext *pCommandContext,
00039         IWMSContext *pUserContext,
00040         IWMSContext *pPresentationContext,
00041         IWMSContext *pServerContext,
00042         IWMSNamedValues *pNamedValues,
00043         DWORD dwFlags,
00044         IWMSClassObject *pClassFactory
00045         );
00046     HRESULT Shutdown();
00047
00048     // IWMSPlaylistParser
00049     virtual HRESULT STDMETHODCALLTYPE ReadPlaylist(
00050             INSSBuffer __RPC_FAR *pBuffer,
00051             IXMLDOMDocument __RPC_FAR *pPlayList,
00052             IWMSPlaylistParserCallback __RPC_FAR *pCallback,
00053             QWORD qwContext
00054             );
00055     virtual HRESULT STDMETHODCALLTYPE WritePlaylist(
00056             IXMLDOMDocument __RPC_FAR *pPlayList,
00057             IWMSPlaylistParserCallback __RPC_FAR *pCallback,
00058             QWORD qwContext
00059             );
00060     virtual HRESULT STDMETHODCALLTYPE ReadPlaylistFromDirectory(
00061             IWMSDirectory __RPC_FAR *pDirectory,
00062             LPWSTR pszwFilePattern,
00063             IXMLDOMDocument __RPC_FAR *pPlaylist,
00064             IWMSPlaylistParserCallback __RPC_FAR *pCallback,
00065             QWORD qwContext
00066             );
00067
00068 protected:
00069
00070     CComPtr<IWMSCommandContext> m_spCommandContext;
00071     CComPtr<IWMSContext>         m_spUserContext;
00072     CComPtr<IWMSContext>         m_spPresentationContext;
00073     CComPtr<IWMSContext>         m_spServerContext;
00074     CComPtr<IWMSNamedValues>     m_spNamedValues;
00075     CComPtr<IWMSClassObject>     m_spClassFactory;
00076
00077 }; // End of CSDKSamplePlaylistParser
00078
00079 typedef CComObject< CSDKSamplePlaylistParser > CComSDKSamplePlaylistParser;
00080
00081
00082
00083
00084 /////////////////////////////////////////////////////////////////////////////
00085 // CSDKSamplePlaylistParserPlugin
00086 class ATL_NO_VTABLE CSDKSamplePlaylistParserPlugin :
00087     public CComObjectRootEx<CComMultiThreadModel>,
00088     public CComCoClass<CSDKSamplePlaylistParserPlugin, &CLSID_SDKSamplePlaylistParser>,
00089     public IWMSBasicPlugin,
00090     public IWMSPlaylistParserPlugin
00091 {
00092 public:
00093     CSDKSamplePlaylistParserPlugin();
00094     ~CSDKSamplePlaylistParserPlugin();
00095
00096
00097 DECLARE_REGISTRY_RESOURCEID(IDR_SDKSAMPLEPLAYLISTPARSER)
00098 DECLARE_PROTECT_FINAL_CONSTRUCT()
00099
00100 BEGIN_COM_MAP(CSDKSamplePlaylistParserPlugin)
00101     COM_INTERFACE_ENTRY(IWMSBasicPlugin)
00102     COM_INTERFACE_ENTRY(IWMSPlaylistParserPlugin)
00103 END_COM_MAP()
00104
00105 public:
00106     // IWMSBasicPlugin
00107     virtual HRESULT STDMETHODCALLTYPE InitializePlugin(
00108                     IWMSContext *pServerContext,
00109                     IWMSNamedValues *pNamedValues,
00110                     IWMSClassObject *pClassFactory
00111                     );
00112     virtual HRESULT STDMETHODCALLTYPE GetCustomAdminInterface(
00113                     IDispatch **ppValue
00114                     );
00115     virtual HRESULT STDMETHODCALLTYPE OnHeartbeat();
00116
00117     STDMETHOD( ShutdownPlugin )();
00118     STDMETHOD( EnablePlugin )( long *pdwFlags, long *pdwHeartbeatPeriod );
00119     STDMETHOD( DisablePlugin )();
00120
00121     // IWMSPlaylistParserPlugin
00122     virtual HRESULT STDMETHODCALLTYPE CreatePlaylistParser(
00123                     IWMSCommandContext *pCommandContext,
00124                     IWMSContext *pUser,
00125                     IWMSContext *pPresentation,
00126                     DWORD dwFlags,
00127                     IWMSClassObject *pFactory,
00128                     IWMSBufferAllocator *pBufferAllocator,
00129                     IWMSPlaylistParserPluginCallback *pCallback,
00130                     QWORD qwContext
00131                     );
00132
00133 protected:
00134
00135     CComPtr<IWMSNamedValues>      m_spNamedValues;
00136     CComPtr<IWMSContext>          m_spServerContext;
00137     CComPtr<IWMSClassObject>      m_spClassFactory;
00138 };
00139
00140 #endif //__SDKSAMPLEPLAYLISTPARSER_H_
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCNotify/Notify.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCNotify

Notify.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      Notify.h
00003   Summary:   Declaration of CONotify class
00004   Classes:   Declared: CONotify
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #ifndef __NOTIFY_H_
00023 #define __NOTIFY_H_
00024
00025 #include "resource.h"       // main symbols
00026
00027 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00028   Class:       CONotify
00029   Summary:     Updates shipping status column of Order Entry database
00030   Interfaces:  IUnknown       Standard COM object feature interface
00031                IDispatch      Automation interface
00032              INotify        Represents an order
00033   Aggregation: Not supported
00034 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00035
00036 class ATL_NO_VTABLE CONotify :
00037   public CComObjectRootEx<CComSingleThreadModel>,
00038   public CComCoClass<CONotify, &CLSID_Notify>,
00039   public IDispatchImpl<INotify, &IID_INotify, &LIBID_QCNOTIFYLib>
00040 {
00041 public:
00042   CONotify() : m_lCustomerId(0), m_lOrderId(0)  // ctor
00043   {
00044   }
00045
00046 DECLARE_REGISTRY_RESOURCEID(IDR_NOTIFY)
00047 DECLARE_NOT_AGGREGATABLE(CONotify)
00048
00049 BEGIN_COM_MAP(CONotify)
00050   COM_INTERFACE_ENTRY(INotify)
00051   COM_INTERFACE_ENTRY(IDispatch)
00052 END_COM_MAP()
00053
00054 public: // IOrder interface
00055   STDMETHOD(Process)(long lFlags);
00056   STDMETHOD(LineItem)(long lItemId, long lQuantity, ShipStatus shipStatus);
00057   STDMETHOD(put_OrderId)(long lOrderId);
00058   STDMETHOD(put_CustomerId)(long lCustomerId);
00059
00060 private: // Member variables
00061   long          m_lCustomerId;
00062   long          m_lOrderId;
00063   std::vector<long>   m_veclItemId;
00064   std::vector<long>   m_veclQuantity;
00065   std::vector<ShipStatus> m_vecShipStatus;
00066 };
00067
00068 #endif //__NOTIFY_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CUpdateTextEditSession Member List

This is the complete list of members for CUpdateTextEditSession, including all inherited members.
_pContext | CEditSessionBase | [protected]
_pRange | CUpdateTextEditSession | [private]
_pSnoopWnd | CUpdateTextEditSession | [private]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CUpdateTextEditSession(ITfContext *pContext, ITfRange *pRange, CSnoopWnd *pSnoopWnd) | CUpdateTextEditSession | [inline]
DoEditSession(TfEditCookie ec) | CUpdateTextEditSession | [virtual]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
~CUpdateTextEditSession() | CUpdateTextEditSession | [inline]
Generated on Wed Nov 13 2024 16:57:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/dbinit.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

dbinit.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module DBINIT.CPP | IDBInitialize interface implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012 #include "headers.h"
00013 #include <msdasc.h>   //IDBPromptInitialize
00014
00015 // IDBInitialize specific interface methods
00016
00017
00018 // CImpIDBInitialize::Initialize ---------------------------------------------
00019 //
00020 // @mfunc Initializes the DataSource object.. For this provider it requires
00021 // that a valid path is given to where the file will be located.
00022 //
00023 // @rdesc HRESULT
00024 //      @flag S_OK          | Path exists
00025 //      @flag E_FAIL        | Invalid path
00026 //      @flag E_INVALIDARG  | Invalid Parameters passed in
00027 //    @flag DB_E_ALREADYINITIALIZED | Datasource Object already initialized
00028 //
00029 STDMETHODIMP CImpIDBInitialize::Initialize
00030     (
00031   )
00032 {
00033     ASSERT( m_pObj );
00034   CHAR szDataSource[MAX_PATH + MAX_PATH + 1] = {0};
00035
00036   HRESULT   hr;
00037   ULONG   cPropSets = 0;
00038   DBPROPSET*  rgPropSets = NULL;
00039
00040   WCHAR* pwszDataSource = NULL;
00041     int  nPrompt = DBPROMPT_NOPROMPT;
00042   HWND hWnd = NULL;
00043
00044   IDBPromptInitialize* pIDBPromptInitialize = NULL;
00045   IDBProperties*     pIDBProperties       = NULL;
00046
00047     if(m_pObj->m_fDSOInitialized)
00048         return ResultFromScode( DB_E_ALREADYINITIALIZED );
00049
00050   //Setup Properties
00051   const ULONG cProperties   = 3;
00052   DBPROPID  rgProperties[cProperties] = { DBPROP_INIT_DATASOURCE, DBPROP_INIT_PROMPT, DBPROP_INIT_HWND };
00053
00054   const ULONG cPropertyIDSets = 1;
00055   DBPROPIDSET rgPropertyIDSets[cPropertyIDSets];
00056   rgPropertyIDSets[0].guidPropertySet   = DBPROPSET_DBINIT;
00057   rgPropertyIDSets[0].rgPropertyIDs   = rgProperties;
00058   rgPropertyIDSets[0].cPropertyIDs    = cProperties;
00059
00060     //Get the property values
00061     hr = m_pObj->m_pUtilProp->GetProperties(PROPSET_DSO, cPropertyIDSets, rgPropertyIDSets, &cPropSets, &rgPropSets );
00062   if(SUCCEEDED(hr))
00063   {
00064     pwszDataSource  = V_BSTR(&rgPropSets[0].rgProperties[0].vValue);
00065     nPrompt     = V_I2(&rgPropSets[0].rgProperties[1].vValue);
00066
00067 #ifdef _WIN64
00068     hWnd      = (HWND)V_I8(&rgPropSets[0].rgProperties[2].vValue);
00069 #else
00070     hWnd      = (HWND)V_I4(&rgPropSets[0].rgProperties[2].vValue);
00071 #endif
00072     //Convert Directory to MBCS
00073     ConvertToMBCS(pwszDataSource, szDataSource, sizeof(szDataSource));
00074   }
00075
00076   // if caller didn't supply a directory path, ask the user
00077     if ((nPrompt == DBPROMPT_PROMPT) ||
00078     ((nPrompt == DBPROMPT_COMPLETE || nPrompt == DBPROMPT_COMPLETEREQUIRED) && (!SetCurrentDirectory(szDataSource))) )
00079     {
00080       //Use our current DataSource as defaults for properties
00081     TESTC(hr = QueryInterface(IID_IDBProperties, (void**)&pIDBProperties));
00082
00083     //Use the Data Links Dialog to prompt...
00084     TESTC(hr = CoCreateInstance(CLSID_DataLinks, NULL, CLSCTX_ALL, IID_IDBPromptInitialize, (void**)&pIDBPromptInitialize));
00085     TESTC(hr = pIDBPromptInitialize->PromptDataSource(NULL, hWnd, DBPROMPTOPTIONS_PROPERTYSHEET | DBPROMPTOPTIONS_DISABLE_PROVIDER_SELECTION, 0, NULL, NULL, IID_IDBProperties, (IUnknown**)&pIDBProperties));
00086
00087     //Free the Previous Properties
00088     FreeProperties(&cPropSets, &rgPropSets);
00089     pwszDataSource = NULL;
00090
00091     //Now Data Links has put the user choosen properties onto our data source, we just need to
00092     //reobtain the property values...
00093     hr = m_pObj->m_pUtilProp->GetProperties(PROPSET_DSO, cPropertyIDSets, rgPropertyIDSets, &cPropSets, &rgPropSets );
00094     if(SUCCEEDED(hr))
00095     {
00096       pwszDataSource  = V_BSTR(&rgPropSets[0].rgProperties[0].vValue);
00097       nPrompt     = V_I2(&rgPropSets[0].rgProperties[1].vValue);
00098
00099 #ifdef _WIN64
00100       hWnd      = (HWND)V_I8(&rgPropSets[0].rgProperties[2].vValue);
00101 #else
00102       hWnd      = (HWND)V_I4(&rgPropSets[0].rgProperties[2].vValue);
00103 #endif
00104       //Convert Directory to MBCS
00105       ConvertToMBCS(pwszDataSource, szDataSource, sizeof(szDataSource));
00106     }
00107   }
00108
00109   //NOTE:  We don't require DBPROP_INIT_DATASOURCE.  If the DataSource property is passed
00110   //in then we will use that to represent the current directory.  This will allow the user
00111   //to only have to specify the filename in OpenRowset, and not the full path...
00112   if(szDataSource[0])
00113   {
00114     // Get the current Directory
00115     CHAR szCurrentDir[MAX_PATH];
00116     GetCurrentDirectory( MAX_PATH, szCurrentDir );
00117
00118     //See if the directory passed is valid...
00119     if(!SetCurrentDirectory( szDataSource ))
00120     {
00121       hr = DB_E_ERRORSOCCURRED;
00122       goto CLEANUP;
00123     }
00124
00125     // Restore to the original directory.
00126     SetCurrentDirectory( szCurrentDir );
00127     wcsncpy( m_pObj->m_wszPath, pwszDataSource, MAX_PATH);
00128   }
00129   else
00130   {
00131     m_pObj->m_wszPath[0] = wEOL;
00132   }
00133
00134   //We are now initialized...
00135   m_pObj->m_fDSOInitialized = TRUE;
00136   hr = S_OK;
00137
00138 CLEANUP:
00139   FreeProperties(&cPropSets, &rgPropSets);
00140   SAFE_RELEASE(pIDBPromptInitialize);
00141   SAFE_RELEASE(pIDBProperties);
00142   return hr;
00143 }
00144
00145
00146
00147 // CImpIDBInitialize::Uninitialize ---------------------------------------------
00148 //
00149 // @mfunc Returns the Data Source Object to an uninitialized state
00150 //
00151 // @rdesc HRESULT
00152 //      @flag S_OK            | The method succeeded
00153 //      @flag DB_E_OBJECTOPEN | A DBSession object was already created
00154 //
00155 STDMETHODIMP CImpIDBInitialize::Uninitialize
00156     (
00157     void
00158     )
00159 {
00160     assert( m_pObj );
00161
00162     if (!m_pObj->m_fDSOInitialized)
00163         {
00164         // data source object is not initialized; do nothing
00165         return ResultFromScode( S_OK );
00166         }
00167     else
00168         {
00169         if (!m_pObj->m_fDBSessionCreated)
00170             {
00171             // DSO initialized, but no DBSession has been created.
00172             // So, reset DSO to uninitialized state
00173             m_pObj->m_fDSOInitialized = FALSE;
00174             return ResultFromScode( S_OK );
00175             }
00176         else
00177             {
00178             // DBSession has already been created; trying to uninit
00179             // the DSO now is an error
00180             return ResultFromScode( DB_E_OBJECTOPEN );
00181             }
00182         }
00183 }
00184
00185
00186
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll2/Socketmon.Hpp Source File

  • NetDS
  • WinSock
  • Dt_Dll2

Socketmon.Hpp

Go to the documentation of this file.
00001 // Filename  : SocketMon.hpp
00002 // Abstract  : This object is inherited from DTHandler and implements
00003 //             our custom DT Winsock API hooking.
00004 // Author    : Jeffrey C. Venable, Sr.
00005 // Copyright : THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
00006 //             WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
00007 //             INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
00008 //             MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00009 //             Copyright (C) 1998 - 2001,  Microsoft Corporation.
00010 //             All rights reserved.
00011
00012 #ifndef SOCKET_MONITOR_HPP
00013 #define SOCKET_MONITOR_HPP
00014
00015 #pragma warning(disable: 4512)
00016
00017 #include "DTHandler.hpp"
00018
00019 class SocketMonitor : public DTHandler {
00020
00021 protected :
00022
00023   bool WSAStartup (WORD wVersionRequested, LPWSADATA lpWSAData, APIHook<int> &hook);
00024   bool WSACleanup (APIHook<int> &hook);
00025   bool send       (SOCKET s, const char FAR *buf, int len, int flags, APIHook<int> &hook);
00026   bool recv       (SOCKET s, char FAR *buf, int len, int flags, APIHook<int> &hook);
00027
00028 }; // class SocketMonitor
00029
00030 #endif
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/EventConsumer/Factory.h Source File

  • SysMgmt
  • WMI
  • VC
  • EventConsumer

Factory.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  factory.h
00006 //
00007 // Description: Event consumer provider class factory definition
00008 //
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include <wbemcli.h>
00015
00016 class CProviderFactory : public IClassFactory
00017 {
00018 public:
00019
00020   CProviderFactory(CListBox *pOutputList);
00021   virtual ~CProviderFactory();
00022
00023     // IUnknown members
00024     STDMETHODIMP         QueryInterface(REFIID, LPVOID *);
00025     STDMETHODIMP_(ULONG) AddRef(void);
00026     STDMETHODIMP_(ULONG) Release(void);
00027
00028     STDMETHOD_(SCODE, CreateInstance)(IUnknown * pUnkOuter,
00029                   REFIID riid,
00030                   void ** ppvObject);
00031
00032     STDMETHOD_(SCODE, LockServer)(BOOL fLock);
00033
00034 private:
00035   LONG m_cRef;
00036   CListBox  *m_pOutputList;
00037
00038 };
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/Dog/cDog.h Source File

  • Com
  • Fundamentals
  • CustomSurrogate
  • Dog

cDog.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include "idog.h"
00018
00019 extern LONG g_cObjects;
00020 class CDog : public IDog
00021 {
00022 public:
00023     // IUnknown
00024     STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR* ppvObj);
00025     STDMETHOD_(ULONG, AddRef)(void);
00026     STDMETHOD_(ULONG, Release)(void);
00027
00028     // IDog
00029     STDMETHOD(Bark)();
00030     STDMETHOD(Scratch)();
00031
00032     CDog() { m_cRef = 0; InterlockedIncrement(&g_cObjects); }
00033     ~CDog() { InterlockedDecrement(&g_cObjects); }
00034 private:
00035     LONG m_cRef;                   // Reference count
00036 };
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RealTimeStylusPluginApp::RealTimeStylusPluginApp Member List

This is the complete list of members for RealTimeStylusPluginApp::RealTimeStylusPluginApp, including all inherited members.
btnMove_Click(object sender, System.EventArgs e) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
btnMoveDown | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
btnMoveUp | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
chklbPlugins | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
chklbPlugins_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
chklbPlugins_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
Clear() | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
components | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
customDynamicRendererGraphics | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
DataInterest | RealTimeStylusPluginApp::RealTimeStylusPluginApp |
Dispose(bool disposing) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, protected]
Error(RealTimeStylus sender, ErrorData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
FindPrecedingPlugin(int index) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
gbTestArea | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
InAirPackets(RealTimeStylus sender, InAirPacketsData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
InitializeComponent() | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
InsertIntoPluginCollection(int index) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
lastMouseDownEventArgs | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
lblPluginList | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
Main() | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private, static]
miAction | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
miClear | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
miClear_Click(object sender, System.EventArgs e) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
miExit | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
miExit_Click(object sender, System.EventArgs e) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
miMain | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
miSeparator | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
myRealTimeStylus | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
Packets(RealTimeStylus sender, PacketsData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
pnlPlugins | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
RealTimeStylusDisabled(RealTimeStylus sender, RealTimeStylusDisabledData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
RealTimeStylusEnabled(RealTimeStylus sender, RealTimeStylusEnabledData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
RealTimeStylusPlugin_Load(object sender, System.EventArgs e) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
RealTimeStylusPluginApp() | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
RemoveFromPluginCollection(int index) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline, private]
sbGesture | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
StylusButtonDown(RealTimeStylus sender, StylusButtonDownData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
StylusButtonUp(RealTimeStylus sender, StylusButtonUpData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
StylusDown(RealTimeStylus sender, StylusDownData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
StylusInRange(RealTimeStylus sender, StylusInRangeData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
StylusOutOfRange(RealTimeStylus sender, StylusOutOfRangeData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
StylusUp(RealTimeStylus sender, StylusUpData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
SystemGesture(RealTimeStylus sender, SystemGestureData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
TabletAdded(RealTimeStylus sender, TabletAddedData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
TabletRemoved(RealTimeStylus sender, TabletRemovedData data) | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [inline]
txtPluginDescription | RealTimeStylusPluginApp::RealTimeStylusPluginApp | [private]
Generated on Wed Nov 13 2024 16:58:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

cascadeec::INewsEvent Member List

This is the complete list of members for cascadeec::INewsEvent, including all inherited members.
iid | cascadeec::INewsEvent | [static]
LongQuote(String Symbol, double BidPrice, double AskPrice, String LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow, int AskSize, int BidSize, double OpenPrice, double ClosePrice, String CloseDate) | cascadeec::INewsEvent |
NewsFlash(double dtTimeStamp, String Symbol, String Headline, String URL) | cascadeec::INewsEvent |
ShortQuote(String Symbol, double BidPrice, double AskPrice, double LastTradeTime, double LastTradePrice, double NetChange, double DailyHigh, double DailyLow) | cascadeec::INewsEvent |
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows2000/CeError.Cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows2000

CeError.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        ceerror.cpp
00007 //
00008 // Contents:    Cert Server error wrapper routines
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include <pch.cpp>
00013
00014 #pragma hdrstop
00015
00016 #include "celibw2k.h"
00017 #include <assert.h>
00018 #include <stdio.h>
00019 #include <ntdsbmsg.h>
00020
00021
00022 #define CERTLIB_12BITERRORMASK  0x00000fff
00023 #define CERTLIB_WIN32ERRORMASK  0x0000ffff
00024
00025
00026 //+--------------------------------------------------------------------------
00027 // Jet errors:
00028
00029 #define HRESULT_FROM_JETWARNING(jerr) \
00030   ((STATUS_SEVERITY_WARNING << 30) | (FACILITY_NTDSB << 16) | jerr)
00031
00032 #define HRESULT_FROM_JETERROR(jerr) \
00033   ((STATUS_SEVERITY_ERROR << 30) | (FACILITY_NTDSB << 16) | -jerr)
00034
00035 #define JETERROR_FROM_HRESULT(hr) \
00036   (-(LONG) (CERTLIB_WIN32ERRORMASK & (hr)))
00037
00038 #define ISJETERROR(hr) \
00039     ((~CERTLIB_WIN32ERRORMASK & (hr)) == ~CERTLIB_WIN32ERRORMASK)
00040
00041 #define ISJETHRESULT(hr) \
00042     ((~CERTLIB_WIN32ERRORMASK & (hr)) == ((STATUS_SEVERITY_ERROR << 30) | \
00043             (FACILITY_NTDSB << 16)))
00044
00045 #define wszJETERRORPREFIX L"EDB"
00046
00047
00048 //+--------------------------------------------------------------------------
00049 // Win32 errors:
00050
00051 #define ISWIN32ERROR(hr) \
00052     ((~CERTLIB_WIN32ERRORMASK & (hr)) == 0)
00053
00054 #define ISWIN32HRESULT(hr) \
00055     ((~CERTLIB_WIN32ERRORMASK & (hr)) == ((STATUS_SEVERITY_WARNING << 30) | \
00056             (FACILITY_WIN32 << 16)))
00057
00058 #define WIN32ERROR_FROM_HRESULT(hr) \
00059     (CERTLIB_WIN32ERRORMASK & (hr))
00060
00061 #define wszWIN32ERRORPREFIX L"WIN32"
00062
00063
00064 //+--------------------------------------------------------------------------
00065 // Delayload errors:
00066
00067 #define FACILITY_DELAYLOAD  109
00068 #define DELAYLOAD_FROM_WIN32(hr) \
00069     ((HRESULT) ((STATUS_SEVERITY_ERROR << 30) | \
00070     (FACILITY_DELAYLOAD << 16) | \
00071     (hr)))
00072
00073 #define WIN32ERROR_FROM_DELAYLOAD(hr) \
00074     (CERTLIB_WIN32ERRORMASK & (hr))
00075
00076 #define ISDELAYLOADHRESULTFACILITY(hr) \
00077     ((~CERTLIB_WIN32ERRORMASK & (hr)) == ((STATUS_SEVERITY_ERROR << 30) | \
00078             (FACILITY_DELAYLOAD << 16)))
00079
00080 // E_DELAYLOAD_MOD_NOT_FOUND  0xc06d007e
00081 #define E_DELAYLOAD_MOD_NOT_FOUND   DELAYLOAD_FROM_WIN32(ERROR_MOD_NOT_FOUND)
00082
00083 // E_DELAYLOAD_PROC_NOT_FOUND 0xc06d007f
00084 #define E_DELAYLOAD_PROC_NOT_FOUND  DELAYLOAD_FROM_WIN32(ERROR_PROC_NOT_FOUND)
00085
00086 #define ISDELAYLOADHRESULT(hr) \
00087     (E_DELAYLOAD_MOD_NOT_FOUND == (hr) || \
00088      E_DELAYLOAD_PROC_NOT_FOUND == (hr) || \
00089      HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND) == (hr) || \
00090      HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND) == (hr))
00091
00092
00093 //+--------------------------------------------------------------------------
00094 // ASN encoding errors:
00095
00096 #define ISOSSERROR(hr) \
00097     ((~CERTLIB_12BITERRORMASK & (hr)) == CRYPT_E_OSS_ERROR)
00098
00099 #define OSSERROR_FROM_HRESULT(hr) \
00100     (CERTLIB_12BITERRORMASK & (hr))
00101
00102 #define wszOSSERRORPREFIX L"ASN"
00103
00104
00105
00106
00107 HRESULT
00108 ceJetHResult(
00109     IN HRESULT hr)
00110 {
00111 #if DBG_CERTSRV
00112     HRESULT hrIn = hr;
00113 #endif
00114     if (S_OK != hr)
00115     {
00116         if (SUCCEEDED(hr))
00117         {
00118 #if 0
00119       hr = HRESULT_FROM_JETWARNING(hr);
00120 #else
00121             if (S_FALSE != hr)
00122       {
00123     ceERRORPRINTLINE("JetHResult: mapping to S_FALSE", hr);
00124       }
00125             assert(S_FALSE == hr);
00126             hr = S_FALSE;
00127 #endif
00128         }
00129         else if (ISJETERROR(hr))
00130         {
00131       hr = HRESULT_FROM_JETERROR(hr);
00132         }
00133     }
00134     assert(S_OK == hr || S_FALSE == hr || FAILED(hr));
00135     return(hr);
00136 }
00137
00138
00139 HRESULT
00140 ceHExceptionCode(
00141     IN EXCEPTION_POINTERS const *pep)
00142 {
00143     HRESULT hr = pep->ExceptionRecord->ExceptionCode;
00144
00145     return(ceHError(hr));
00146 }
00147
00148
00149 BOOL
00150 ceIsDelayLoadHResult(
00151     IN HRESULT hr)
00152 {
00153     return(ISDELAYLOADHRESULT(hr));
00154 }
00155
00156
00157 #define wszCOLONSPACE L": "
00158
00159 WCHAR const *
00160 ceHResultToStringEx(
00161     IN OUT WCHAR *awchr,
00162     IN HRESULT hr,
00163     IN BOOL fRaw)
00164 {
00165     HRESULT hrd;
00166     WCHAR const *pwszType;
00167
00168     hrd = hr;
00169     pwszType = L"";
00170     if (ISJETERROR(hr))
00171     {
00172   pwszType = wszJETERRORPREFIX wszCOLONSPACE;
00173     }
00174     else if (ISJETHRESULT(hr))
00175     {
00176   hrd = JETERROR_FROM_HRESULT(hr);
00177   pwszType = wszJETERRORPREFIX wszCOLONSPACE;
00178     }
00179     else if (ISWIN32HRESULT(hr))
00180     {
00181   hrd = WIN32ERROR_FROM_HRESULT(hr);
00182   pwszType = wszWIN32ERRORPREFIX wszCOLONSPACE;
00183     }
00184     else if (ISDELAYLOADHRESULTFACILITY(hr))
00185     {
00186   hrd = WIN32ERROR_FROM_DELAYLOAD(hr);
00187   pwszType = wszWIN32ERRORPREFIX wszCOLONSPACE;
00188     }
00189     else if (ISOSSERROR(hr))
00190     {
00191   hrd = OSSERROR_FROM_HRESULT(hr);
00192   pwszType = wszOSSERRORPREFIX wszCOLONSPACE;
00193     }
00194     if (fRaw)
00195     {
00196   pwszType = L"";
00197     }
00198
00199     _snwprintf(
00200   awchr,
00201   cwcHRESULTSTRING,
00202   L"0x%x (%ws%d)",
00203   hr,
00204   pwszType,
00205   hrd);
00206     return(awchr);
00207 }
00208
00209
00210 WCHAR const *
00211 ceHResultToString(
00212     IN OUT WCHAR *awchr,
00213     IN HRESULT hr)
00214 {
00215     return(ceHResultToStringEx(awchr, hr, FALSE));
00216 }
00217
00218
00219 WCHAR const *
00220 ceHResultToStringRaw(
00221     IN OUT WCHAR *awchr,
00222     IN HRESULT hr)
00223 {
00224     return(ceHResultToStringEx(awchr, hr, TRUE));
00225 }
00226
00227
00228 static DWORD s_idsUnexpected = 0;
00229 static DWORD s_idsUnknownErrorCode = 0; // L"Error %ws %ws"
00230
00231 VOID
00232 ceInitErrorMessageText(
00233     IN DWORD idsUnexpected,
00234     IN DWORD idsUnknownErrorCode) // L"Error %ws %ws"
00235 {
00236     s_idsUnexpected = idsUnexpected;
00237     s_idsUnknownErrorCode = idsUnknownErrorCode;
00238 }
00239
00240
00241 // Alloc and return error message string
00242
00243 WCHAR *
00244 ceGetErrorMessageText(
00245     IN HRESULT hr,
00246     IN BOOL fHResultString)
00247 {
00248     static WCHAR s_wszUknownDefault[] = L"Error %ws %ws";
00249     WCHAR *pwszRet = NULL;
00250     WCHAR *pwszMsgT;
00251     WCHAR const *pwszUnknown;
00252     WCHAR wszUnknown[10 * ARRAYSIZE(s_wszUknownDefault)];
00253     WCHAR wszUnexpected[512];
00254     WCHAR awchr[cwcHRESULTSTRING];
00255     DWORD cwc;
00256     DWORD cwcUnexpected = 0;
00257     HMODULE hMod = NULL;
00258
00259     wszUnexpected[0] = L'\0';
00260     if (E_UNEXPECTED == hr && 0 != s_idsUnexpected)
00261     {
00262   cwcUnexpected = LoadString(
00263         NULL,
00264         s_idsUnexpected,  // L"Unexpected method call sequence."
00265         wszUnknown,
00266         ARRAYSIZE(wszUnknown));
00267     }
00268     cwc = FormatMessage(
00269                 FORMAT_MESSAGE_ALLOCATE_BUFFER |
00270         FORMAT_MESSAGE_FROM_SYSTEM |
00271         FORMAT_MESSAGE_IGNORE_INSERTS,
00272                 NULL,
00273                 hr,
00274                 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00275                 (WCHAR *) &pwszRet,
00276                 0,
00277                 NULL);
00278     if (0 == cwc)
00279     {
00280   hMod = LoadLibrary(L"ntdsbmsg.dll");
00281   if (NULL != hMod)
00282   {
00283       cwc = FormatMessage(
00284         FORMAT_MESSAGE_ALLOCATE_BUFFER |
00285       FORMAT_MESSAGE_FROM_HMODULE |
00286       FORMAT_MESSAGE_IGNORE_INSERTS,
00287         hMod,
00288         hr,
00289         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00290         (WCHAR *) &pwszRet,
00291         0,
00292         NULL);
00293   }
00294     }
00295     if (0 == cwc)
00296     {
00297   // couldn't find error, _snwprintf it instead
00298
00299   if (0 != s_idsUnknownErrorCode)
00300   {
00301       cwc = LoadString(
00302       NULL,
00303       s_idsUnknownErrorCode,  // L"Error %ws %ws"
00304       wszUnknown,
00305       ARRAYSIZE(wszUnknown));
00306   }
00307   if (0 == cwc)
00308   {
00309       pwszUnknown = s_wszUknownDefault;
00310   }
00311   else
00312   {
00313       pwszUnknown = wszUnknown;
00314   }
00315   cwc = (DWORD)(wcslen(pwszUnknown) + cwcUnexpected + ARRAYSIZE(awchr) + 1);
00316         pwszRet = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
00317   if (NULL == pwszRet)
00318   {
00319       ceERRORPRINTLINE("LocalAlloc", E_OUTOFMEMORY);
00320       goto error;
00321   }
00322         _snwprintf(
00323     pwszRet,
00324     cwc,
00325     pwszUnknown,
00326     wszUnexpected,
00327     ceHResultToString(awchr, hr));
00328     }
00329     else
00330     {
00331         // strip trailing \r\n
00332
00333         cwc = (DWORD)wcslen(pwszRet);
00334
00335         if (2 <= cwc &&
00336       L'\r' == pwszRet[cwc - 2] &&
00337       L'\n' == pwszRet[cwc - 1])
00338   {
00339             pwszRet[cwc - 2] = L'\0';
00340   }
00341   awchr[0] = L'\0';
00342   if (fHResultString)
00343   {
00344       ceHResultToString(awchr, hr);
00345   }
00346   if (fHResultString || 0 != cwcUnexpected)
00347   {
00348       cwc = (DWORD)(wcslen(pwszRet) + 1 + cwcUnexpected + 1 + wcslen(awchr) + 1);
00349       pwszMsgT = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
00350       if (NULL == pwszMsgT)
00351       {
00352     ceERRORPRINTLINE("LocalAlloc", E_OUTOFMEMORY);
00353     goto error;
00354       }
00355       _snwprintf(
00356         pwszMsgT,
00357         cwc,
00358         L"%ws %ws %ws",
00359         pwszRet,
00360         wszUnexpected,
00361         awchr);
00362       LocalFree(pwszRet);
00363       pwszRet = pwszMsgT;
00364   }
00365     }
00366
00367 error:
00368     if (NULL != hMod)
00369     {
00370   FreeLibrary(hMod);
00371     }
00372     return(pwszRet);
00373 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IIDLookUp Member List

This is the complete list of members for IIDLookUp, including all inherited members.
id | IIDLookUp |
IIDLookUp(GUID iNewID, char *pNewIDName) | IIDLookUp | [inline]
pIDName | IIDLookUp |
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/Rcv/StdAfx.Cpp Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • Rcv

StdAfx.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 #include "stdafx.h"
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/command.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

command.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module COMMAND.CPP | CCommand object implementation
00008 //
00009 //
00010
00011 // Includes ------------------------------------------------------------------
00012
00013 #include "headers.h"
00014
00015 // Code ----------------------------------------------------------------------
00016
00017 // CCommand::CCommand --------------------------------------------------------
00018 //
00019 // @mfunc Constructor for this class
00020 //
00021 // @rdesc NONE
00022 //
00023 CCommand::CCommand
00024   (
00025   CDBSession* pCSession,    //@parm IN | Parent Session Object
00026   LPUNKNOWN   pUnkOuter   //@parm IN | Outer Unkown Pointer
00027   ) // invoke ctor for base class
00028   : CBaseObj( BOT_COMMAND )
00029 {
00030   assert( pCSession );
00031
00032   //  Initialize simple member vars
00033   m_pUnkOuter         = pUnkOuter ? pUnkOuter : this;
00034   m_dwStatus          = 0L;
00035   m_cRowsetsOpen        = 0;
00036   m_cRef            = 0L;
00037
00038   // Establish the parent object
00039   m_pCSession         = pCSession;
00040
00041   //  Initially, NULL all contained interfaces
00042   m_pIAccessor        = NULL;
00043   m_pICommandText       = NULL;
00044   m_pICommandProperties   = NULL;
00045   m_pIColumnsInfo       = NULL;
00046   m_pIConvertType       = NULL;
00047
00048   m_pUtilProp         = NULL;
00049
00050   m_guidCmdDialect      = DBGUID_DBSQL;
00051   m_guidImpersonate     = GUID_NULL;
00052
00053   m_strCmdText        = NULL;
00054
00055   // Increment global object count.
00056     OBJECT_CONSTRUCTED();
00057   return;
00058 }
00059
00060
00061 // CCommand::~CCommand -------------------------------------------------------
00062 //
00063 // @mfunc Destructor for this class
00064 //
00065 // @rdesc NONE
00066 //
00067 CCommand::~CCommand (void)
00068 {
00069   //  Free contained interfaces
00070     SAFE_DELETE( m_pIAccessor );
00071     SAFE_DELETE( m_pICommandText );
00072     SAFE_DELETE( m_pICommandProperties );
00073     SAFE_DELETE( m_pIColumnsInfo );
00074     SAFE_DELETE( m_pIConvertType );
00075
00076   SAFE_DELETE( m_pUtilProp );
00077
00078   // Since Command Object is going away, we can decrement
00079   // our count on the session object.
00080   // Note that this typically deletes our hdbc, DataSource, Session.
00081   // (So do this last.)
00082   if( m_pCSession )
00083     m_pCSession->GetOuterUnknown()->Release();
00084
00085   // Decrement global object count.
00086     OBJECT_DESTRUCTED();
00087 }
00088
00089
00090 // CCommand::FInit -----------------------------------------------------------
00091 //
00092 // @mfunc Initialize the command Object.  This FInit routine should be used by
00093 // CreateCommand and also be called as a secondary initialization routine for
00094 // for the other FInit on the command object.
00095 //
00096 // @side If this initialization routine fails, it is the callers responsibility
00097 // to delete this object.  The destructor will then clean up any allocated
00098 // resources
00099 //
00100 // @rdesc Did the Initialization Succeed
00101 //      @flag  S_OK | Initialization succeeded
00102 //    @flag  E_OUTOFMEMORY | Could not allocate enough memory
00103 //    @flag  E_FAIL | Initializtion failed
00104 //
00105 HRESULT CCommand::FInit()
00106 {
00107   assert( m_pUnkOuter );    // Set in constructor
00108   assert( m_pCSession );    // Set in constructor
00109
00110   LPUNKNOWN   pIUnknown = (LPUNKNOWN) this;
00111
00112   if (m_pUnkOuter)
00113         pIUnknown = m_pUnkOuter;
00114
00115   if (m_pCSession && m_pCSession->GetOuterUnknown())
00116     m_pCSession->GetOuterUnknown()->AddRef();
00117
00118   // Allocate Property Utility object
00119   m_pUtilProp = new CUtilProp();
00120   if( !m_pUtilProp )
00121     return ResultFromScode(E_OUTOFMEMORY);
00122
00123   //  Allocate contained interface objects
00124   m_pIAccessor                = new CImpIAccessor( this, pIUnknown );
00125   m_pICommandText       = new CImpICommandText( this, pIUnknown );
00126   m_pICommandProperties   = new CImpICommandProperties( this, pIUnknown );
00127   m_pIColumnsInfo       = new CImpIColumnsInfo( this, pIUnknown );
00128   m_pIConvertType       = new CImpIConvertType( this, pIUnknown );
00129
00130   if ( m_pIAccessor )
00131     {
00132     if( FAILED(m_pIAccessor->FInit(FALSE)))
00133       return ResultFromScode(E_OUTOFMEMORY);
00134     }
00135
00136   if( m_pIAccessor &&
00137     m_pICommandText &&
00138     m_pICommandProperties &&
00139     m_pIColumnsInfo &&
00140     m_pIConvertType
00141     )
00142     return ResultFromScode(S_OK);
00143   else
00144     return ResultFromScode(E_FAIL);
00145 }
00146
00147
00148 // CCommand::QueryInterface --------------------------------------------------
00149 //
00150 // @mfunc Returns a pointer to a specified interface. Callers use
00151 // QueryInterface to determine which interfaces the called object
00152 // supports.
00153 //
00154 // @rdesc HResult indicating the status of the method
00155 //    @flag S_OK | Interface is supported and ppvObject is set.
00156 //    @flag E_NOINTERFACE | Interface is not supported by the object
00157 //    @flag E_INVALIDARG | One or more arguments are invalid.
00158 //
00159 STDMETHODIMP CCommand::QueryInterface
00160   (
00161   REFIID riid,        //@parm IN | Interface ID of the interface being queried for.
00162   LPVOID * ppv        //@parm OUT | Pointer to interface that was instantiated
00163   )
00164 {
00165   if( ppv == NULL )
00166     return ResultFromScode(E_INVALIDARG);
00167
00168   //  This is the non-delegating IUnknown implementation
00169   if( riid == IID_IAccessor )
00170     *ppv = (LPVOID)m_pIAccessor;
00171   else if( riid == IID_ICommand )
00172     *ppv = (LPVOID)m_pICommandText;
00173   else if( riid == IID_ICommandText )
00174     *ppv = (LPVOID)m_pICommandText;
00175   else if( riid == IID_ICommandProperties )
00176     *ppv = (LPVOID)m_pICommandProperties;
00177   else if( riid == IID_IColumnsInfo )
00178     *ppv = (LPVOID)m_pIColumnsInfo;
00179   else if( riid == IID_IConvertType )
00180     *ppv = (LPVOID)m_pIConvertType;
00181   else if( riid == IID_IUnknown )
00182     *ppv = (LPVOID)this;
00183   else
00184     *ppv = NULL;
00185
00186   //  If we're going to return an interface, AddRef it first
00187   if( *ppv )
00188   {
00189     ((LPUNKNOWN)*ppv)->AddRef();
00190     return NOERROR;
00191   }
00192
00193   return ResultFromScode(E_NOINTERFACE);
00194 }
00195
00196
00197 // CCommand::AddRef ----------------------------------------------------------
00198 //
00199 // @mfunc Increments a persistence count for the object
00200 //
00201 // @rdesc Current reference count
00202 //
00203 STDMETHODIMP_(DBREFCOUNT) CCommand::AddRef (void)
00204 {
00205     return ++m_cRef;
00206 }
00207
00208
00209 // CCommand::Release -------------------------------------------------------------------
00210 //
00211 // @mfunc Decrements a persistence count for the object and if
00212 // persistence count is 0, the object destroys itself.
00213 //
00214 // @rdesc Current reference count
00215 //
00216 STDMETHODIMP_(DBREFCOUNT) CCommand::Release (void)
00217 {
00218     if (!--m_cRef)
00219         {
00220         delete this;
00221         return 0;
00222         }
00223
00224     return m_cRef;
00225 }
00226
00227
00228 //  UTILITY FUNCTIONS   UTILITY FUNCTIONS
00229
00230 //  ICommandText specific interfaces
00231
00232 //-----------------------------------------------------------------------------------
00233 // CImpICommandText::GetCommandText
00234 //
00235 // @mfunc Echos the current command as text, including all post-processing
00236 //      operations added.
00237 //
00238 // @rdesc HResult
00239 //    @flag S_OK          | Method Succeeded
00240 //    @flag DB_S_DIALECTIGNORED | Method succeeded, but dialect ignored
00241 //    @flag E_INVALIDARG      | ppwszCommand was a null pointer
00242 //    @flag E_OUTOFMEMORY     | Out of Memory
00243 //
00244 STDMETHODIMP CImpICommandText::GetCommandText
00245   (
00246   GUID    *pguidDialect,  //@parm INOUT | Guid denoting the dialect of sql
00247   LPOLESTR  *ppwszCommand //@parm OUT   | Pointer for the command text
00248   )
00249 {
00250   HRESULT   hr;
00251
00252   // Check Function Arguments
00253   if( ppwszCommand == NULL )
00254   {
00255     hr = ResultFromScode(E_INVALIDARG);
00256     goto exit;
00257   }
00258
00259   *ppwszCommand = NULL;
00260
00261   // If the command has not been set, make sure the buffer
00262   // contains an empty stringt to return to the consumer
00263   if( !m_pObj->IsCommandSet() )
00264   {
00265     hr = ResultFromScode(DB_E_NOCOMMAND);
00266     goto exit;
00267   }
00268
00269   assert( m_pObj->m_strCmdText );
00270
00271   hr = NOERROR;
00272
00273   if(  pguidDialect != NULL &&
00274     *pguidDialect != DBGUID_DEFAULT &&
00275     *pguidDialect != DBGUID_SAMPLEDIALECT )
00276   {
00277     hr = DB_S_DIALECTIGNORED;
00278     *pguidDialect = DBGUID_DEFAULT;
00279   }
00280
00281   // Allocate memory for the string we're going to return to the caller
00282   *ppwszCommand = (LPWSTR) PROVIDER_ALLOC(
00283           (wcslen(m_pObj->m_strCmdText) + 1) * sizeof(WCHAR));
00284
00285   if( !(*ppwszCommand) )
00286   {
00287     hr = ResultFromScode(E_OUTOFMEMORY);
00288     goto exit;
00289   }
00290
00291   // Copy our saved text into the newly allocated string
00292   wcscpy(*ppwszCommand, m_pObj->m_strCmdText);
00293
00294 exit:
00295
00296   if( FAILED(hr) && pguidDialect )
00297     memset(pguidDialect, 0, sizeof(GUID));
00298
00299   return hr;
00300 }
00301
00302 //-----------------------------------------------------------------------------------
00303 // CImpICommandText::SetCommandText
00304 //
00305 // @mfunc Sets the current command text
00306 //
00307 // @rdesc HResult
00308 //    @flag S_OK | Method Succeeded
00309 //    @flag E_FAIL | A provider-specific error occurred
00310 //    @flag DB_E_DIALECTNOTSUPPORTED | The dialect given was not supported
00311 //    @flag DB_E_OBJECTOPEN | A rowset was already open on the command object
00312 //
00313 STDMETHODIMP CImpICommandText::SetCommandText
00314   (
00315   REFGUID   rguidDialect, //@parm IN | Guid denoting the dialect of sql
00316   LPCOLESTR pwszCommand   //@parm IN | Command Text
00317   )
00318 {
00319   HRESULT hr = S_OK;
00320
00321   // Don't allow text to be set if we've got a rowset open
00322   if( m_pObj->IsRowsetOpen() )
00323     return ResultFromScode(DB_E_OBJECTOPEN);
00324
00325   // Check Dialect
00326   if( rguidDialect != DBGUID_SAMPLEDIALECT &&
00327     rguidDialect != DBGUID_DEFAULT )
00328     return ResultFromScode(DB_E_DIALECTNOTSUPPORTED);
00329
00330   if( !pwszCommand || *pwszCommand == L'\0' )
00331   {
00332     // Free the current string
00333     SAFE_DELETE_ARRAY(m_pObj->m_strCmdText);
00334     m_pObj->m_dwStatus &= ~CMD_TEXT_SET;
00335     return NOERROR;
00336   }
00337
00338   WCHAR * pwszCMD = new WCHAR[wcslen(pwszCommand)+1];
00339
00340   if ( !pwszCMD )
00341     hr = ResultFromScode(E_OUTOFMEMORY);
00342
00343   // Free the old memory and set the text
00344   SAFE_DELETE_ARRAY(m_pObj->m_strCmdText);
00345   m_pObj->m_strCmdText = pwszCMD;
00346   wcscpy(m_pObj->m_strCmdText, pwszCommand);
00347
00348   // Set status flag that we have set text
00349   m_pObj->m_dwStatus |= CMD_TEXT_SET;
00350
00351   return NOERROR;
00352 }
00353
00354
00355 //---------------------------------------------------------------------------
00356 // CImpICommandText::Cancel
00357 //
00358 // @mfunc The consumer can allocate a secondary thread in which to cancel
00359 // the currently executing thread.  This cancel will only succeed if
00360 // the result set is still being generated.  If the rowset object is being
00361 // created, then it will be to late to cancel.
00362 //
00363 // @rdesc Status of Method
00364 //    @flag S_OK | Cancel Succeeded
00365 //    @flag DB_E_CANTCANCEL | Execution could not be canceled.
00366 //    @flag OTHER | other result codes returned by called functions.
00367 //---------------------------------------------------------------------------
00368 STDMETHODIMP CImpICommandText::Cancel
00369   (
00370   void
00371   )
00372 {
00373   if( m_pObj->m_dwStatus & CMD_EXECUTING )
00374     return DB_E_CANTCANCEL;
00375
00376   return S_OK;
00377 }
00378
00379
00380
00381 //---------------------------------------------------------------------------
00382 // CImpICommandText::Execute
00383 //
00384 // @mfunc Execute the command.  But before execution, it sets the ODBC
00385 // statement and connection options based on the current properties.
00386 //
00387 // @rdesc Status of Execution
00388 //    @flag S_OK | Execution succeeded
00389 //    @flag E_INVALIDARG | Invalid parameter passed in.
00390 //    @flag E_FAIL | Provider specific error
00391 //    @flag E_OUTOFMEMORY | Not enough resources
00392 //    @flag E_NOINTERFACE | RIID specified was not supported
00393 //    @flag DB_E_NOCOMMAND | No Text or Tree set
00394 //    @flag DB_E_INTERFACECONFLICT | Interface conflict with previous properties
00395 //    @flag OTHER | other result codes returned by called functions.
00396 //
00397 STDMETHODIMP CImpICommandText::Execute
00398   (
00399   IUnknown*   pUnkOuter,    //@parm IN | Outer Unknown
00400   REFIID      riid,     //@parm IN | Interface ID of the interface being queried for.
00401   DBPARAMS*   pParams,    //@parm INOUT | Parameter Array
00402   DBROWCOUNT*   pcRowsAffected, //@parm OUT | count of rows affected by command
00403   IUnknown**    ppRowset    //@parm OUT | Pointer to interface that was instantiated
00404   )
00405 {
00406   HRESULT   hr, hrProp = S_OK;
00407   UDWORD    dwFlags = 0;
00408   UDWORD    dwStatus=0;
00409   ULONG   cPropSets = 0;
00410   ULONG   ul;
00411   ULONG   ul2;
00412   DBPROPSET *rgPropSets = NULL;
00413   const IID*  pIID = &IID_ICommand;
00414
00415     CFileIO*    pFileio = NULL;
00416     CRowset*    pRowset = NULL;
00417
00418   BOOL    fCreateRowObject = FALSE;
00419   DBCOUNTITEM cRowsObtained = 0;
00420   HROW *    phRow = NULL;
00421   IRowset * pIRowset = NULL;
00422   IGetRow * pIGetRow = NULL;
00423
00424   assert( m_pObj->m_pUtilProp );
00425
00426   // Initialize Return Buffers
00427   if( ppRowset )
00428     *ppRowset = NULL;
00429
00430   if( pcRowsAffected )
00431     *pcRowsAffected = -1;
00432
00433   if( riid != IID_NULL && !ppRowset )
00434     return ResultFromScode( E_INVALIDARG );
00435
00436   // Only 1 ParamSet if ppRowset is non-Null
00437   if( pParams && (pParams->cParamSets > 1) && ppRowset )
00438     return ResultFromScode( E_INVALIDARG );
00439
00440   // Check that a command has been set
00441   if( !m_pObj->IsCommandSet() )
00442     return DB_E_NOCOMMAND;
00443
00444   // We do not allow the riid to be anything other than IID_IUnknown for aggregation
00445   if( pUnkOuter && riid != IID_IUnknown )
00446     return ResultFromScode( DB_E_NOAGGREGATION );
00447
00448   // Set Status
00449   m_pObj->m_dwStatus |= CMD_EXECUTING;
00450
00451   // Check to see if IID_IOpenRowset is calling Execute to
00452   // open a rowset.
00453   if( m_pObj->m_guidImpersonate != GUID_NULL )
00454   {
00455     assert(m_pObj->m_guidImpersonate == IID_IOpenRowset);
00456     pIID = &m_pObj->m_guidImpersonate;
00457   }
00458
00459   hr = m_pObj->m_pUtilProp->GetProperties(
00460           PROPSET_ROWSET,
00461           0,
00462           NULL,
00463           &cPropSets,
00464           &rgPropSets);
00465
00466   if( hr != S_OK )
00467   {
00468     // The only valid reason to fail is out of memory case
00469     assert( hr == E_OUTOFMEMORY );
00470     goto exit;
00471   }
00472
00473   // Traverse the properties to see if a ROW object is requested.
00474   for(ul=0;ul<cPropSets; ul++)
00475   {
00476     for(ul2=0;ul2<rgPropSets[ul].cProperties; ul2++)
00477     {
00478       // Check if a row object was requested.
00479       // DBPROP_IRow, DBPROP_IRowChange, and DBPROP_IRowSchemaChange indicate
00480       // that a ROW object is desired.
00481       // Sample Provider does not support IRowSchemaChange so no need to check for that
00482       // property
00483       if( (rgPropSets[ul].rgProperties[ul2].dwPropertyID == DBPROP_IRow ||
00484          rgPropSets[ul].rgProperties[ul2].dwPropertyID == DBPROP_IRowChange) &&
00485         rgPropSets[ul].rgProperties[ul2].dwStatus == DBPROPSTATUS_OK &&
00486         V_BOOL(&rgPropSets[ul].rgProperties[ul2].vValue) == VARIANT_TRUE )
00487         fCreateRowObject = TRUE;
00488     }
00489   }
00490
00491   //Try to open the file...
00492   if(FAILED(hr = m_pObj->m_pCSession->m_pCDataSource->OpenFile(m_pObj->m_strCmdText, &pFileio)))
00493     goto exit;
00494
00495     // open and initialize a rowset\cursor object
00496     pRowset = new CRowset( fCreateRowObject ? NULL : pUnkOuter );
00497     if (!pRowset)
00498   {
00499         SAFE_DELETE( pFileio );
00500         hr = E_OUTOFMEMORY;
00501     goto exit;
00502   }
00503
00504   // Initialize the rowset\cursor.
00505     // For now, since don't yet support "settable" properties, so no properties to pass.
00506     // The rowset will always create all of its interfaces.
00507     // This is all-or-nothing.
00508
00509   //Assign creator pointer. Used to keep track of open rowsets
00510     pRowset->m_pCreator = m_pObj;
00511   pRowset->m_pCreator->m_pUnkOuter->AddRef();
00512
00513     if( !pRowset->FInit(
00514             pFileio,
00515             (*pIID == IID_IOpenRowset) ? (CBaseObj *) m_pObj->m_pCSession : (CBaseObj *) m_pObj,
00516             m_pObj->m_strCmdText,
00517             m_pObj->m_pCSession->m_pCDataSource->GetFilePath()
00518             ) )
00519   {
00520         SAFE_DELETE( pRowset );
00521         hr = DB_E_NOTABLE;
00522     goto exit;
00523   }
00524
00525   // set the properties
00526   if ( cPropSets )
00527     hr = pRowset->GetCUtilProp()->SetProperties(PROPSET_ROWSET, cPropSets, rgPropSets);
00528
00529   // If all the properties set were OPTIONAL then we return
00530   // DB_S_ERRORSOCCURRED and continue.
00531   for(ul=0;ul<cPropSets; ul++)
00532   {
00533     for(ul2=0;ul2<rgPropSets[ul].cProperties; ul2++)
00534     {
00535       // Check for a required property that failed, if found, we must return
00536       // DB_E_ERRORSOCCURRED
00537       if( (rgPropSets[ul].rgProperties[ul2].dwStatus != DBPROPSTATUS_OK) &&
00538         (rgPropSets[ul].rgProperties[ul2].dwOptions != DBPROPOPTIONS_OPTIONAL) )
00539       {
00540           SAFE_DELETE( pRowset );
00541           hr = DB_E_ERRORSOCCURRED;
00542           goto exit;
00543       }
00544     }
00545   }
00546
00547   // Optional property failure is still a success
00548   if( hr == DB_E_ERRORSOCCURRED )
00549     hrProp = DB_S_ERRORSOCCURRED;
00550
00551   // if properties failed or ppRowset NULL
00552   if( (FAILED(hr) && (hrProp==S_OK)) ||
00553     (!ppRowset) )
00554     {
00555         SAFE_DELETE( pRowset );
00556     goto exit;
00557     }
00558
00559     // get requested interface pointer on rowset\cursor
00560   if( fCreateRowObject || riid == IID_IRow || riid == IID_IRowChange )
00561   {
00562     hr = E_FAIL;
00563
00564     if( FAILED(pRowset->QueryInterface(IID_IRowset, (LPVOID *)&pIRowset)) )
00565       goto exit;
00566
00567     if( FAILED(pIRowset->GetNextRows(DB_NULL_HCHAPTER, 0, 1, &cRowsObtained, &phRow)) )
00568       goto exit;
00569
00570     assert( cRowsObtained == 1);
00571     if( FAILED(pRowset->QueryInterface(IID_IGetRow, (LPVOID *)&pIGetRow)) )
00572       goto exit;
00573
00574     if( FAILED(hr = pIGetRow->GetRowFromHROW(pUnkOuter, phRow[0], riid, ppRowset)) )
00575       goto exit;
00576
00577     // Sample Provider does not support selection using a critera.
00578     // Hence, DB_S_NOTSINGLETON is reported simply if the target file
00579     // contains more than one row.
00580     if( pRowset->GetFileObj()->GetRowCnt() > 1 )
00581       hr = DB_S_NOTSINGLETON;
00582     else
00583       hr = S_OK;
00584   }
00585   else
00586   {
00587     hr = pRowset->QueryInterface( riid, (void **) ppRowset );
00588     if( FAILED(hr) )
00589     {
00590       // Special case IID_NULL
00591       if( riid == IID_NULL )
00592         hr = S_OK;
00593
00594       SAFE_DELETE( pRowset );
00595       goto exit;
00596     }
00597   }
00598
00599   if (SUCCEEDED(hr))
00600     m_pObj->IncrementOpenRowsets();
00601
00602   SAFE_RELEASE(pIRowset);
00603   SAFE_RELEASE(pIGetRow);
00604
00605 exit:
00606
00607   if( FAILED(hr) )
00608     SAFE_DELETE(pRowset);
00609
00610   // Free the RowHandle
00611   SAFE_FREE(phRow);
00612
00613   // Exiting the execution state
00614   m_pObj->m_dwStatus &= ~CMD_EXECUTING;
00615
00616   for (ul=0; ul < cPropSets; ul++)
00617     SAFE_FREE(rgPropSets[ul].rgProperties);
00618
00619   SAFE_FREE(rgPropSets);
00620
00621   return hr;
00622 }
00623
00624
00625 //---------------------------------------------------------------------------
00626 // CImpICommandText::GetDBSession
00627 //
00628 // @mfunc Return an interface from the session object that created
00629 // this command object
00630 //
00631 // @rdesc Status of Method
00632 //    @flag S_OK | Interface pointer returned
00633 //    @flag E_INVALIDARG | ppSession was invalid
00634 //    @flag OTHER | other result codes returned by called functions.
00635 //
00636 STDMETHODIMP CImpICommandText::GetDBSession
00637   (
00638   REFIID    riid,     //@parm IN | IID of the interface
00639   IUnknown**  ppSession   //@parm OUT | Interface pointer
00640   )
00641 {
00642   HRESULT hr;
00643
00644   assert( m_pObj->m_pCSession );
00645
00646   // Check Arguments
00647   if( ppSession == NULL )
00648     return ResultFromScode(E_INVALIDARG);
00649
00650   // Query for the interface on the session object.  If failure,
00651   // return the error from QueryInterface.
00652   hr = m_pObj->m_pCSession->GetOuterUnknown()->QueryInterface(riid, (VOID**)ppSession);
00653   if( FAILED(hr) )
00654   {
00655     *ppSession = NULL;
00656     return hr;
00657   }
00658
00659   return ResultFromScode(S_OK);
00660 }
00661
00662
00663
00664 //  ICommandProperties specific interfaces
00665
00666 //---------------------------------------------------------------------------
00667 // CImpICommandProperties::GetProperties
00668 //
00669 // @mfunc Retrieve the Properties
00670 //
00671 // @rdesc HRESULT indicating the status of the method
00672 //    @flag OTHER | other result codes returned by called functions.
00673 //
00674 STDMETHODIMP CImpICommandProperties::GetProperties
00675   (
00676   const ULONG     cPropertySets,    //@parm IN | Number of property sets
00677   const DBPROPIDSET rgPropertySets[], //@parm IN | Property Sets
00678   ULONG*        pcProperties,   //@parm OUT | Count of structs returned
00679   DBPROPSET**     prgProperties   //@parm OUT | Array of Properties
00680   )
00681 {
00682   HRESULT hr;
00683
00684   assert( m_pObj );
00685   assert( m_pObj->m_pUtilProp );
00686
00687   //NOTE: Since we are non-chaptered, we just ignore the
00688   // rowset name argument.
00689
00690
00691   hr = m_pObj->m_pUtilProp->GetPropertiesArgChk(
00692         PROPSET_ROWSET,
00693         cPropertySets,
00694         rgPropertySets,
00695         pcProperties,
00696         prgProperties);
00697   if( SUCCEEDED(hr) )
00698   {
00699     hr = m_pObj->m_pUtilProp->GetProperties(
00700           PROPSET_ROWSET,
00701           cPropertySets,
00702           rgPropertySets,
00703           pcProperties,
00704           prgProperties);
00705   }
00706
00707   // Just return the HResult
00708   return hr;
00709 }
00710
00711
00712 //---------------------------------------------------------------------------
00713 // CImpICommandProperties::SetProperties
00714 //
00715 // @mfunc Set the Properties
00716 //
00717 // @rdesc HRESULT indicating the status of the method
00718 //    @flag DB_E_OPENOBJECT | Can't prepare w/ open rowset
00719 //    @flag OTHER | other result codes returned by called functions.
00720 //
00721 STDMETHODIMP CImpICommandProperties::SetProperties
00722   (
00723   ULONG   cPropertySets,    //@parm IN | Count of structs returned
00724   DBPROPSET rgPropertySets[]    //@parm IN | Array of Properties
00725   )
00726 {
00727     HRESULT hr = E_FAIL;
00728
00729     //
00730   // Asserts
00731     //
00732   assert( m_pObj );
00733     assert( m_pObj->m_pUtilProp );
00734
00735     //
00736   // Quick return if the Count of Properties is 0
00737     //
00738   if( cPropertySets == 0 )
00739     return S_OK;
00740
00741     //
00742     // Check in-params and NULL out-params in case of error
00743     //
00744   hr=m_pObj->m_pUtilProp->SetPropertiesArgChk(cPropertySets, rgPropertySets);
00745
00746   if( FAILED(hr) )
00747     return hr;
00748
00749     //
00750   // Don't allow properties to be set if we've got a rowset open
00751     //
00752   if( m_pObj->IsRowsetOpen() )
00753     return DB_E_OBJECTOPEN;
00754
00755   return m_pObj->m_pUtilProp->SetProperties(PROPSET_ROWSET,
00756                         cPropertySets, rgPropertySets);
00757 }
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/utilprop.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

utilprop.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module UTILPROP.CPP | Properties utility object implementation
00008 //
00009 //
00010 // Notes - there are two main methods in this module:
00011 //     - CUtilProps::GetPropertyInfo, a helper function for IDBInfo::GetPropertyInfo
00012 //     - CUtilProps::GetProperties, a helper function for IRowsetInfo::GetProperties
00013 //
00014 // Our property implementation is simplified considerably by the fact that we
00015 // only support reading\getting the properties, we do not support
00016 // writing\setting them. This makes sense because we are a simple provider,
00017 // and our rowset object always creates all the interfaces it exposes. In
00018 // other words, there are really no properties the consumer could set.
00019 //
00020 // The implementation is very simple - we keep a global table of the
00021 // properties we support in s_rgprop. We search this table sequentially.
00022 //
00023 // Note that a full-featured provider would probably need to use a more
00024 // sophisticated implementation. We keep the entire GUID for each property in
00025 // our struct, which would become a waste of space if we had a lot more
00026 // properties. Similarly, with large numbers of properties some sort of
00027 // hashing would be better than the sequential search used here.
00028 //
00029 // Includes ------------------------------------------------------------------
00030
00031 #include "headers.h"
00032 #include "sampver.h"
00033 #define __T(x)      L ## x
00034 #define _TEXT(x)      __T(x)
00035
00036 // Struct containing the properties we know about. The GUID and string fields are
00037 // initialized in the constructor, because C++ makes it awkward to do so at declaration
00038 // time. So, if you change this table, be sure to make parallel changes in CUtilProp::CUtilProp.
00039 PROPSTRUCT s_rgprop[] =
00040    {
00041 /* 0 */ {DBPROP_IAccessor,          DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IAccessor"},
00042 /* 1 */ {DBPROP_IColumnsInfo,       DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IColumnsInfo"},
00043 /* 2 */ {DBPROP_IConvertType,       DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IConvertType"},
00044 /* 3 */ {DBPROP_IRowset,          DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IRowset"},
00045 /* 4 */ {DBPROP_IRowsetChange,        DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_BOOL, TRUE,    0,              NULL,     L"IRowsetChange"},
00046 /* 5 */ {DBPROP_IRowsetInfo,        DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IRowsetInfo"},
00047 /* 6 */ {DBPROP_IRowsetIdentity,      DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IRowsetIdentity"},
00048 /* 7 */ {DBPROP_CANHOLDROWS,        DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_BOOL, TRUE,    0,              NULL,     L"Hold Rows"},
00049 /* 8 */ {DBPROP_LITERALIDENTITY,      DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_BOOL, TRUE,    0,              NULL,     L"Literal Row Identity"},
00050 /* 9 */ {DBPROP_UPDATABILITY,       DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_I4,   TRUE,    DBPROPVAL_UP_CHANGE|DBPROPVAL_UP_DELETE|DBPROPVAL_UP_INSERT, NULL,L"Updatability"},
00051 /* 10*/ {DBPROP_IRow,           DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_BOOL, FALSE,   0,              NULL,     L"IRow"},
00052 /* 11*/ {DBPROP_IRowChange,         DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_BOOL, FALSE,   0,              NULL,     L"IRowChange"},
00053 /* 12*/ {DBPROP_IGetRow,          DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IGetRow"},
00054 /* 13*/ {DBPROP_IGetSession,        DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, TRUE,    0,              NULL,     L"IGetSession"},
00055 /* 14*/ {DBPROP_QUICKRESTART,       DBPROPFLAGS_ROWSET | DBPROPFLAGS_READ,            VT_BOOL, FALSE,   0,              NULL,     L"Quick Restart"},
00056 /* 15*/ {DBPROP_SESS_AUTOCOMMITISOLEVELS, DBPROPFLAGS_SESSION | DBPROPFLAGS_READ,           VT_I4,   FALSE,   0,              NULL,     L"Autocommit Isolation Levels"},
00057 /* 16*/ {DBPROP_ACTIVESESSIONS,       DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_I4,   FALSE,   1,              NULL,     L"Active Sessions"},
00058 /* 17*/ {DBPROP_PERSISTENTIDTYPE,     DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_I4,   FALSE,   DBPROPVAL_PT_GUID_PROPID, NULL,     L"Persistent ID Type"},
00059 /* 18*/ {DBPROP_PROVIDERFILENAME,     DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_BSTR, FALSE,   0,              L"SAMPPROV.DLL",L"Provider Name"},
00060 /* 19*/ {DBPROP_PROVIDERFRIENDLYNAME,   DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_BSTR, FALSE,   0,              L"Microsoft OLE DB Sample Provider",  L"Provider Friendly Name"},
00061 /* 20*/ {DBPROP_PROVIDEROLEDBVER,     DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_BSTR, FALSE,   0,              L"02.00",   L"OLE DB Version"},
00062 /* 21*/ {DBPROP_PROVIDERVER,        DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_BSTR, FALSE,   0,              _TEXT(VER_PRODUCTVERSION_STR),      L"Provider Version"},
00063 /* 22*/ {DBPROP_ROWSETCONVERSIONSONCOMMAND, DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_BOOL, TRUE,    0,              NULL,     L"Rowset Conversions on Command"},
00064 /* 23*/ {DBPROP_OLEOBJECTS,         DBPROPFLAGS_DATASOURCEINFO | DBPROPFLAGS_READ,        VT_I4,   FALSE,   DBPROPVAL_OO_DIRECTBIND|DBPROPVAL_OO_ROWOBJECT|DBPROPVAL_OO_SINGLETON,  NULL, L"OLE Object Support"},
00065 /* 24*/ {DBPROP_INIT_DATASOURCE,      DBPROPFLAGS_DBINIT | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_BSTR, FALSE,   0,              L"",      L"Data Source"},
00066 #ifdef _WIN64
00067 /* 25*/ {DBPROP_INIT_HWND,          DBPROPFLAGS_DBINIT | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_I8,   FALSE,   0,              NULL,     L"Window Handle"},
00068 #else
00069 /* 25*/ {DBPROP_INIT_HWND,          DBPROPFLAGS_DBINIT | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_I4,   FALSE,   0,              NULL,     L"Window Handle"},
00070 #endif
00071 /* 26*/ {DBPROP_INIT_PROMPT,        DBPROPFLAGS_DBINIT | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE,  VT_I2,   FALSE,   4,              NULL,     L"Prompt"}
00072     };
00073
00074
00075 // Code ----------------------------------------------------------------------
00076
00077 // CUtilProp::CUtilProp ----------------------------------------------------------
00078 //
00079 // @mfunc Constructor for this class
00080 //
00081 // @rdesc NONE
00082 //
00083 CUtilProp::CUtilProp
00084     (
00085     void
00086     )
00087 {
00088   memcpy(m_rgproperties, s_rgprop, sizeof(s_rgprop));
00089   memset(m_wszFilePath,0,sizeof(m_wszFilePath));
00090     return;
00091 }
00092
00093
00094 // CUtilProp::~CUtilProp ---------------------------------------------------------
00095 //
00096 // @mfunc Destructor for this class
00097 //
00098 // @rdesc NONE
00099 //
00100 CUtilProp:: ~CUtilProp
00101     (
00102   void
00103     )
00104 {
00105   return;
00106 }
00107
00108
00109
00110 // CUtilProp::GetPropIndex ----------------------------------------------------
00111 //
00112 // @mfunc Returns index of the given property in our global table of properties
00113 //
00114 // @rdesc BOOL
00115 //      @flag TRUE      | found match, copied it to pulIndex out-param
00116 //      @flag FALSE     | no match. In this case, pulIndex has no meaning
00117 //
00118 BOOL CUtilProp::GetPropIndex
00119     (
00120     DBPROPID dwPropertyID,  //@parm IN  | PROPID of desired property
00121       ULONG *  pulIndex   //@parm OUT | index of desired property if return was TRUE
00122     )
00123 {
00124     //
00125   // asserts
00126   //
00127     assert(pulIndex);
00128
00129     for (ULONG cNumberOfProperties = 0;
00130      cNumberOfProperties < NUMBER_OF_SUPPORTED_PROPERTIES;
00131      cNumberOfProperties++)
00132     {
00133         if( dwPropertyID == m_rgproperties[cNumberOfProperties].dwPropertyID )
00134         {
00135             // found a match
00136             *pulIndex = cNumberOfProperties;
00137             return TRUE;
00138          }
00139     }
00140
00141   // found no matches
00142     return FALSE;
00143 }
00144
00145
00146
00147 // CUtilProp::LoadDBPROPINFO  ----------------------------------------------------
00148 //
00149 // @mfunc Helper for GetPropertyInfo. Loads field of DBPROPINFO structure.
00150 //
00151 // @rdesc BOOL
00152 //      @flag TRUE          | Method succeeded
00153 //      @flag FALSE         | Method failed (couldn't allocate memory)
00154 //
00155 void CUtilProp::LoadDBPROPINFO
00156     (
00157     PROPSTRUCT * pPropStruct,
00158     DBPROPINFO * pPropInfo
00159     )
00160 {
00161     //
00162   // asserts
00163   //
00164     assert(pPropStruct);
00165     assert(pPropInfo);
00166
00167     //
00168   // set the easy fields..
00169   //
00170     pPropInfo->dwPropertyID = pPropStruct->dwPropertyID;
00171     pPropInfo->dwFlags    = pPropStruct->dwFlags;
00172     pPropInfo->vtType   = pPropStruct->vtType;
00173
00174     //
00175   // init the variant
00176   //
00177     VariantInit(&pPropInfo->vValues);
00178
00179   //
00180   // fill in the description
00181   //
00182   if( pPropInfo->pwszDescription )
00183     wcscpy(pPropInfo->pwszDescription, pPropStruct->pwstrDescBuffer);
00184
00185   return;
00186 }
00187
00188
00189 // CUtilProp::LoadDBPROP  ----------------------------------------------------
00190 //
00191 // @mfunc Helper for GetProperties. Loads field of DBPROP structure.
00192 //
00193 // @rdesc HRESULT
00194 //      @flag TRUE          | Method succeeded
00195 //      @flag FALSE         | Method failed (couldn't allocate memory)
00196 //
00197 HRESULT CUtilProp::LoadDBPROP
00198     (
00199     PROPSTRUCT* pPropStruct,
00200     DBPROP*   pPropSupport
00201     )
00202 {
00203     HRESULT hr = S_OK;
00204
00205   //
00206   // asserts
00207   //
00208     assert(pPropStruct);
00209     assert(pPropSupport);
00210
00211     //
00212   // set the easy fields..
00213   //
00214     pPropSupport->dwPropertyID = pPropStruct->dwPropertyID;
00215     pPropSupport->colid      = DB_NULLID;
00216   pPropSupport->dwStatus     = DBPROPSTATUS_OK;
00217
00218     //
00219   // init the variant
00220   //
00221     VariantInit(&pPropSupport->vValue);
00222
00223   //
00224     // set pPropSupport->vValue based on Variant type
00225   //
00226     switch (pPropStruct->vtType)
00227     {
00228       case VT_BOOL:
00229       V_VT(&pPropSupport->vValue) = VT_BOOL;
00230       V_BOOL(&pPropSupport->vValue) =
00231           (pPropStruct->boolVal ? VARIANT_TRUE : VARIANT_FALSE);
00232       break;
00233
00234       case VT_I2:
00235         V_VT(&pPropSupport->vValue) = VT_I2;
00236       V_I2(&pPropSupport->vValue) = (SHORT)pPropStruct->longVal;
00237       break;
00238
00239     case VT_I4:
00240         V_VT(&pPropSupport->vValue) = VT_I4;
00241       V_I4(&pPropSupport->vValue) = (LONG)pPropStruct->longVal;
00242       break;
00243
00244 #ifdef _WIN64
00245       case VT_I8:
00246         V_VT(&pPropSupport->vValue) = VT_I8;
00247       V_I8(&pPropSupport->vValue) = (LONGLONG)pPropStruct->longVal;
00248       break;
00249 #endif
00250
00251       case VT_BSTR:
00252       V_VT(&pPropSupport->vValue) = VT_BSTR;
00253       SAFE_SYSALLOC(V_BSTR(&pPropSupport->vValue), pPropStruct->pwstrVal);
00254       break;
00255
00256     default:
00257       assert( !"LoadDBPROP unknown variant type!\n\r" );
00258       hr = E_FAIL;
00259       break;
00260     }
00261
00262 CLEANUP:
00263
00264   return hr;
00265 }
00266
00267
00268
00269 //---------------------------------------------------------------------------
00270 // CUtilProp::GetPropertiesArgChk
00271 //
00272 // @mfunc Initialize the buffers and check for E_INVALIDARG cases
00273 //
00274 // NOTE: This routine is used by RowsetInfo and IDBProperties
00275 //
00276 // @rdesc HRESULT indicating the status of the method
00277 //    @flag S_OK | Properties gathered
00278 //    @flag E_INVALIDARG | Invalid parameter values
00279 //
00280 HRESULT CUtilProp::GetPropertiesArgChk
00281   (
00282   DWORD       dwBitMask,      //@parm IN  | Mask for object
00283   const ULONG     cPropertySets,    //@parm IN | Number of property Sets
00284   const DBPROPIDSET rgPropertySets[], //@parm IN | Property Classes and Ids
00285   ULONG*        pcProperties,   //@parm OUT | Count of structs returned
00286   DBPROPSET**     prgProperties   //@parm OUT | Array of Properties
00287   )
00288 {
00289   //
00290   // Initialize values
00291   //
00292   if( pcProperties )
00293     *pcProperties = 0;
00294
00295   if( prgProperties )
00296     *prgProperties = NULL;
00297
00298   //
00299   // Check Arguments
00300   //
00301   if( (cPropertySets && !rgPropertySets) || !pcProperties || !prgProperties )
00302     return E_INVALIDARG;
00303
00304   //
00305   // New argument check for > 1 cPropertyIDs and NULL pointer for the array.
00306   //
00307   for(ULONG ul=0; ul < cPropertySets; ul++)
00308   {
00309     if( rgPropertySets[ul].cPropertyIDs && !rgPropertySets[ul].rgPropertyIDs )
00310       return E_INVALIDARG;
00311
00312     //
00313     // Check for propper formation of DBPROPSET_PROPERTIESINERROR
00314     //
00315     if( (dwBitMask & PROPSET_DSO || dwBitMask & PROPSET_ROWSET) &&
00316       (rgPropertySets[ul].guidPropertySet == DBPROPSET_PROPERTIESINERROR) )
00317     {
00318       if( (cPropertySets > 1) ||
00319         rgPropertySets[ul].cPropertyIDs ||
00320         rgPropertySets[ul].rgPropertyIDs )
00321         return E_INVALIDARG;
00322     }
00323   }
00324
00325   return S_OK;
00326 }
00327
00328
00329 // CUtilProp::IsValidValue  -----------------------------------------
00330 // @mfunc Validate that the variant contains legal values for it's particalur
00331 // type and for the particular PROPID in this propset.
00332 //
00333 // @rdesc HRESULT indicating status
00334 //
00335 HRESULT CUtilProp::IsValidValue
00336   (
00337   DBPROP* pDBProp
00338   )
00339 {
00340   //
00341   // Switch on the vt type first.
00342   //
00343   switch (V_VT(&pDBProp->vValue))
00344   {
00345     case VT_BOOL:
00346       if( V_BOOL(&pDBProp->vValue) != VARIANT_TRUE &&
00347         V_BOOL(&pDBProp->vValue) != VARIANT_FALSE )
00348         return S_FALSE;
00349       break;
00350
00351     case VT_I2:
00352       if( V_I2(&pDBProp->vValue) < 0 )
00353         return S_FALSE;
00354
00355       //
00356       // Switch on the property ID for VT_I2.
00357       //
00358       switch( pDBProp->dwPropertyID )
00359       {
00360         case DBPROP_INIT_PROMPT:
00361
00362           if( V_I2(&pDBProp->vValue) != DBPROMPT_PROMPT &&
00363             V_I2(&pDBProp->vValue) != DBPROMPT_COMPLETE &&
00364             V_I2(&pDBProp->vValue) != DBPROMPT_COMPLETEREQUIRED &&
00365             V_I2(&pDBProp->vValue) != DBPROMPT_NOPROMPT )
00366             return S_FALSE;
00367       }
00368
00369       break;
00370
00371     case VT_I4:
00372       if( V_I4(&pDBProp->vValue) < 0 )
00373         return S_FALSE;
00374
00375       //
00376       // Switch on the property ID for VT_I4.
00377       //
00378       switch( pDBProp->dwPropertyID )
00379       {
00380         case DBPROP_SESS_AUTOCOMMITISOLEVELS:
00381
00382         if( V_I4(&pDBProp->vValue) != 0 &&
00383           V_I4(&pDBProp->vValue) != DBPROPVAL_TI_CHAOS &&
00384           V_I4(&pDBProp->vValue) != DBPROPVAL_TI_READUNCOMMITTED &&
00385           V_I4(&pDBProp->vValue) != DBPROPVAL_TI_READCOMMITTED &&
00386           V_I4(&pDBProp->vValue) != DBPROPVAL_TI_REPEATABLEREAD &&
00387           V_I4(&pDBProp->vValue) != DBPROPVAL_TI_SERIALIZABLE )
00388           return S_FALSE;
00389       }
00390
00391       break;
00392
00393     default:
00394       break;
00395   }
00396
00397   return S_OK;
00398 }
00399
00400
00401 // CUtilProp::GetPropertyInfo  -----------------------------------------
00402 //
00403 // @mfunc Returns information about rowset and data source properties
00404 //      supported by the provider
00405 //
00406 // @rdesc HRESULT
00407 //      @flag S_OK          | The method succeeded
00408 //      @flag E_INVALIDARG  | pcPropertyIDSets or prgPropertyInfo was NULL
00409 //      @flag E_OUTOFMEMORY | Out of memory
00410 //
00411
00412 STDMETHODIMP CUtilProp::GetPropertyInfo
00413     (
00414   BOOL        fDSOInitialized,  //@parm IN  | if Initialized
00415     ULONG       cPropertyIDSets,  //@parm IN  | # properties
00416     const DBPROPIDSET rgPropertyIDSets[], //@parm IN  | Array of property sets
00417   ULONG*        pcPropertyInfoSets, //@parm OUT | # DBPROPSET structures
00418   DBPROPINFOSET**   prgPropertyInfoSets,//@parm OUT | DBPROPSET structures property
00419                       //      | information returned
00420   WCHAR**       ppDescBuffer    //@parm OUT | Property descriptions
00421     )
00422 {
00423     HRESULT     hr          = S_OK;
00424   BOOL      fPropsinError   = FALSE;
00425   BOOL      fPropsSucceed   = FALSE;
00426   BOOL      fIsSpecialGUID    = FALSE;
00427   BOOL      fIsNotSpecialGUID = FALSE;
00428     ULONG     cProps        = 0;
00429   ULONG     cCount        = 0;
00430     ULONG     ulPropertySets    = 0;
00431   ULONG     cBuffer       = NUMBER_OF_SUPPORTED_PROPERTIES;
00432
00433     DBPROPINFOSET*  pPropInfoSet = NULL;
00434     DBPROPINFO*   pPropInfo  = NULL;
00435   WCHAR*      pDescBuffer  = NULL;
00436
00437   //
00438   // Initialize values
00439   //
00440   if( pcPropertyInfoSets )
00441     *pcPropertyInfoSets  = 0;
00442
00443   if( prgPropertyInfoSets )
00444     *prgPropertyInfoSets = NULL;
00445
00446   if( ppDescBuffer )
00447     *ppDescBuffer = NULL;
00448
00449   //
00450   // Check Arguments
00451   //
00452   if( ((cPropertyIDSets > 0) && !rgPropertyIDSets) ||
00453     !pcPropertyInfoSets || !prgPropertyInfoSets )
00454         return E_INVALIDARG;
00455
00456   //
00457   // New argument check for > 1 cPropertyIDs and NULL pointer for the array.
00458   //
00459   for(ULONG ul=0; ul < cPropertyIDSets; ul++)
00460   {
00461     if( rgPropertyIDSets[ul].cPropertyIDs && !(rgPropertyIDSets[ul].rgPropertyIDs) )
00462       return E_INVALIDARG;
00463
00464     if( DBPROPSET_VIEWALL == rgPropertyIDSets[ul].guidPropertySet     ||
00465       DBPROPSET_TRUSTEEALL == rgPropertyIDSets[ul].guidPropertySet    ||
00466       DBPROPSET_TABLEALL == rgPropertyIDSets[ul].guidPropertySet      ||
00467       DBPROPSET_SESSIONALL == rgPropertyIDSets[ul].guidPropertySet    ||
00468       DBPROPSET_ROWSETALL == rgPropertyIDSets[ul].guidPropertySet     ||
00469       DBPROPSET_INDEXALL == rgPropertyIDSets[ul].guidPropertySet      ||
00470       DBPROPSET_DBINITALL == rgPropertyIDSets[ul].guidPropertySet     ||
00471       DBPROPSET_DATASOURCEINFOALL == rgPropertyIDSets[ul].guidPropertySet ||
00472       DBPROPSET_DATASOURCEALL == rgPropertyIDSets[ul].guidPropertySet   ||
00473       DBPROPSET_CONSTRAINTALL == rgPropertyIDSets[ul].guidPropertySet   ||
00474       DBPROPSET_COLUMNALL == rgPropertyIDSets[ul].guidPropertySet )
00475       fIsSpecialGUID = TRUE;
00476     else
00477       fIsNotSpecialGUID = TRUE;
00478
00479     if( fIsSpecialGUID && fIsNotSpecialGUID )
00480       return E_INVALIDARG;
00481
00482     // figure out the nuber of property descriptions
00483     if( !rgPropertyIDSets[ul].cPropertyIDs )
00484       cBuffer += NUMBER_OF_SUPPORTED_PROPERTIES;
00485     else
00486       cBuffer += rgPropertyIDSets[ul].cPropertyIDs;
00487   }
00488
00489   // save the count of PropertyIDSets
00490   cProps = cPropertyIDSets;
00491
00492   // If the consumer does not restrict the property sets
00493   // by specify an array of property sets and a cPropertySets
00494   // greater than 0, then we need to make sure we
00495   // have some to return
00496   if( cPropertyIDSets == 0 )
00497   {
00498     if( fDSOInitialized )
00499       cProps = NUMBER_OF_SUPPORTED_PROPERTY_SETS;
00500     else
00501       cProps = 1;
00502   }
00503
00504     // use task memory allocater to alloc a DBPROPINFOSET struct
00505     SAFE_ALLOC(pPropInfoSet, DBPROPINFOSET, cProps);
00506     memset(pPropInfoSet, 0, cProps * sizeof(DBPROPINFOSET));
00507
00508   // Alloc memory for ppDescBuffer
00509   if( ppDescBuffer )
00510   {
00511     SAFE_ALLOC(pDescBuffer, WCHAR,
00512            cProps * cBuffer * CCH_GETPROPERTYINFO_DESCRIP_BUFFER_SIZE);
00513     memset(pDescBuffer, 0, (cProps * cBuffer * sizeof(WCHAR) *
00514                    CCH_GETPROPERTYINFO_DESCRIP_BUFFER_SIZE));
00515     *ppDescBuffer = pDescBuffer;
00516   }
00517
00518   // For each supported Property Set
00519   for(ulPropertySets=0; ulPropertySets < cProps; ulPropertySets++)
00520   {
00521     BOOL fGetAllProps = FALSE;
00522
00523     // If no restrictions return all properties from the three supported property sets
00524     if( cPropertyIDSets == 0 )
00525     {
00526       fGetAllProps = TRUE;
00527
00528       // only do this once
00529       if( ulPropertySets == 0 )
00530       {
00531         pPropInfoSet[0].guidPropertySet = DBPROPSET_DBINIT;
00532         pPropInfoSet[0].cPropertyInfos  = NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES;
00533
00534         if( fDSOInitialized )
00535         {
00536           pPropInfoSet[1].guidPropertySet = DBPROPSET_DATASOURCEINFO;
00537           pPropInfoSet[1].cPropertyInfos  = NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES;
00538           pPropInfoSet[2].guidPropertySet = DBPROPSET_SESSION;
00539           pPropInfoSet[2].cPropertyInfos  = NUMBER_OF_SUPPORTED_SESSION_PROPERTIES;
00540           pPropInfoSet[3].guidPropertySet = DBPROPSET_ROWSET;
00541           pPropInfoSet[3].cPropertyInfos  = NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES;
00542         }
00543       }
00544     }
00545     else
00546     {
00547       pPropInfoSet[ulPropertySets].guidPropertySet = rgPropertyIDSets[ulPropertySets].guidPropertySet;
00548       pPropInfoSet[ulPropertySets].cPropertyInfos  = rgPropertyIDSets[ulPropertySets].cPropertyIDs;
00549
00550       if( (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DBINITALL) ||
00551         (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DBINIT   &&
00552          rgPropertyIDSets[ulPropertySets].cPropertyIDs == 0) )
00553       {
00554         fGetAllProps = TRUE;
00555         pPropInfoSet[ulPropertySets].guidPropertySet = DBPROPSET_DBINIT;
00556         pPropInfoSet[ulPropertySets].cPropertyInfos  = NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES;
00557       }
00558       else if( fDSOInitialized )
00559       {
00560         if( (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCEINFOALL) ||
00561           ((rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCEINFO)   &&
00562            (rgPropertyIDSets[ulPropertySets].cPropertyIDs == 0)) )
00563         {
00564           fGetAllProps = TRUE;
00565           pPropInfoSet[ulPropertySets].guidPropertySet = DBPROPSET_DATASOURCEINFO;
00566           pPropInfoSet[ulPropertySets].cPropertyInfos  = NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES;
00567         }
00568         else if( (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_SESSIONALL) ||
00569              ((rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_SESSION)   &&
00570               (rgPropertyIDSets[ulPropertySets].cPropertyIDs == 0)) )
00571         {
00572           fGetAllProps = TRUE;
00573           pPropInfoSet[ulPropertySets].guidPropertySet = DBPROPSET_SESSION;
00574           pPropInfoSet[ulPropertySets].cPropertyInfos  = NUMBER_OF_SUPPORTED_SESSION_PROPERTIES;
00575         }
00576         else if( (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_ROWSETALL) ||
00577              ((rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_ROWSET)   &&
00578               (rgPropertyIDSets[ulPropertySets].cPropertyIDs == 0)) )
00579         {
00580           fGetAllProps = TRUE;
00581           pPropInfoSet[ulPropertySets].guidPropertySet = DBPROPSET_ROWSET;
00582           pPropInfoSet[ulPropertySets].cPropertyInfos  = NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES;
00583         }
00584         else if( rgPropertyIDSets[ulPropertySets].cPropertyIDs == 0 )
00585           fPropsinError = TRUE;
00586       }
00587       else if( rgPropertyIDSets[ulPropertySets].cPropertyIDs == 0 )
00588       {
00589         // Since we do not support it should return a error with 0 & NULL
00590         fPropsinError = TRUE;
00591       }
00592     }
00593
00594     if( pPropInfoSet[ulPropertySets].cPropertyInfos )
00595     {
00596         // use task memory allocater to alloc array of DBPROPINFO structs
00597       SAFE_ALLOC(pPropInfo, DBPROPINFO,
00598                   pPropInfoSet[ulPropertySets].cPropertyInfos);
00599       memset(pPropInfo, 0,
00600         pPropInfoSet[ulPropertySets].cPropertyInfos * sizeof(DBPROPINFO));
00601
00602       pPropInfoSet[ulPropertySets].rgPropertyInfos = &pPropInfo[0];
00603     }
00604
00605       // for each prop in our table..
00606     for (cCount=0; cCount < pPropInfoSet[ulPropertySets].cPropertyInfos; cCount++)
00607     {
00608       // init the Variant right up front
00609       // that way we can VariantClear with no worried (if we need to)
00610       VariantInit( &pPropInfo[cCount].vValues );
00611
00612       // set the description pointer
00613       pPropInfo[cCount].pwszDescription = pDescBuffer;
00614
00615       // Check supported property sets
00616       if( fGetAllProps )
00617       {
00618         if( pPropInfoSet[ulPropertySets].guidPropertySet == DBPROPSET_DBINIT )
00619         {
00620           // load up their DBPROPINFO from our table
00621           fPropsSucceed = TRUE;
00622           LoadDBPROPINFO(&m_rgproperties[START_OF_SUPPORTED_DBINIT_PROPERTIES + cCount],
00623                    &pPropInfo[cCount]);
00624         }
00625         else if( pPropInfoSet[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCEINFO )
00626         {
00627           // load up their DBPROPINFO from our table
00628           fPropsSucceed = TRUE;
00629           LoadDBPROPINFO(&m_rgproperties[START_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES + cCount],
00630                    &pPropInfo[cCount] );
00631         }
00632         else if( pPropInfoSet[ulPropertySets].guidPropertySet == DBPROPSET_SESSION )
00633         {
00634           // load up their DBPROPINFO from our table
00635           fPropsSucceed = TRUE;
00636           LoadDBPROPINFO(&m_rgproperties[START_OF_SUPPORTED_SESSION_PROPERTIES + cCount],
00637                    &pPropInfo[cCount] );
00638         }
00639         else
00640         {
00641           // load up their DBPROPINFO from our table
00642           fPropsSucceed = TRUE;
00643           LoadDBPROPINFO(&m_rgproperties[START_OF_SUPPORTED_ROWSET_PROPERTIES + cCount],
00644                    &pPropInfo[cCount] );
00645         }
00646       }
00647       else
00648       {
00649         ULONG ulIndex;
00650
00651         pPropInfo[cCount].dwPropertyID = rgPropertyIDSets[ulPropertySets].rgPropertyIDs[cCount];
00652         pPropInfo[cCount].dwFlags    = DBPROPFLAGS_NOTSUPPORTED;
00653
00654         if( (GetPropIndex(rgPropertyIDSets[ulPropertySets].rgPropertyIDs[cCount], &ulIndex)) &&
00655           (pPropInfoSet[ulPropertySets].guidPropertySet == DBPROPSET_DBINIT ||
00656            pPropInfoSet[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCEINFO && fDSOInitialized ||
00657            pPropInfoSet[ulPropertySets].guidPropertySet == DBPROPSET_SESSION && fDSOInitialized ||
00658            pPropInfoSet[ulPropertySets].guidPropertySet == DBPROPSET_ROWSET && fDSOInitialized) )
00659         {
00660           fPropsSucceed = TRUE;
00661           LoadDBPROPINFO( &m_rgproperties[ulIndex], &pPropInfo[cCount] );
00662         }
00663         else
00664         {
00665           fPropsinError = TRUE;
00666           pPropInfo[cCount].pwszDescription = NULL;
00667         }
00668       }
00669
00670       // move the description pointer to the next
00671       if( pPropInfo[cCount].pwszDescription )
00672         pDescBuffer += (wcslen(pPropInfo[cCount].pwszDescription) + sizeof(CHAR));
00673     }
00674     // Set local back to FALSE
00675     fGetAllProps = FALSE;
00676   }
00677
00678   // set count of properties and property information
00679     *pcPropertyInfoSets  = cProps;
00680     *prgPropertyInfoSets = pPropInfoSet;
00681
00682 CLEANUP:
00683
00684   if( FAILED(hr) )
00685   {
00686     SAFE_FREE(pPropInfo);
00687     SAFE_FREE(pPropInfoSet);
00688     if( ppDescBuffer )
00689       SAFE_FREE(*ppDescBuffer);
00690   }
00691
00692   if( fPropsSucceed && fPropsinError )
00693     return DB_S_ERRORSOCCURRED;
00694   else if( fPropsinError )
00695   {
00696     if( ppDescBuffer )
00697       SAFE_FREE(*ppDescBuffer);
00698     return DB_E_ERRORSOCCURRED;
00699   }
00700   else
00701     return hr;
00702 }
00703
00704 // CUtilProp::GetProperties ----------------------------------------------------
00705 //
00706 // @mfunc Returns current settings of all properties supported by the DSO/rowset
00707 //
00708 // @rdesc HRESULT
00709 //      @flag S_OK          | The method succeeded
00710 //      @flag E_INVALIDARG  | pcProperties or prgPropertyInfo was NULL
00711 //      @flag E_OUTOFMEMORY | Out of memory
00712 //
00713 STDMETHODIMP CUtilProp::GetProperties
00714     (
00715     DWORD       dwBitMask,      //@parm IN  | Mask if Initialized
00716     ULONG       cPropertyIDSets,  //@parm IN | # of restiction property IDs
00717     const DBPROPIDSET rgPropertyIDSets[], //@parm IN | restriction guids
00718     ULONG*              pcPropertySets,   //@parm OUT | count of properties returned
00719     DBPROPSET**     prgPropertySets   //@parm OUT | property information returned
00720     )
00721 {
00722     HRESULT     hr            = S_OK;
00723   BOOL      fPropsinError = FALSE;
00724   BOOL      fPropsSucceed = FALSE;
00725     ULONG     cProps      = 0;
00726   ULONG     cCount      = 0;
00727     ULONG     ulPropertySets= 0;
00728     DBPROP*     pProp;
00729     DBPROPSET*    pPropSet;
00730
00731   // save the count of PropertyIDSets
00732   cProps = cPropertyIDSets;
00733
00734   // If the consumer does not restrict the property sets
00735   // by specify an array of property sets and a cPropertySets
00736   // greater than 0, then we need to make sure we
00737   // have some to return
00738   if( cPropertyIDSets == 0 )
00739   {
00740     // only allow the DBINIT, DATASOURCE and DATASOURCEINFO if Initialized
00741     if( dwBitMask & PROPSET_INIT )
00742       cProps = 2;
00743     else
00744       cProps = 1;
00745   }
00746
00747     // use task memory allocater to alloc a DBPROPSET struct
00748     SAFE_ALLOC(pPropSet, DBPROPSET, cProps);
00749     memset(pPropSet, 0, cProps * sizeof(DBPROPSET));
00750
00751   // For each supported Property Set
00752   for (ulPropertySets=0; ulPropertySets < cProps; ulPropertySets++)
00753   {
00754     BOOL fGetAllProps = FALSE;
00755
00756     // If no restrictions return all properties from the three supported property sets
00757     if( cPropertyIDSets == 0 )
00758     {
00759         fGetAllProps = TRUE;
00760
00761         // only do this once
00762         if( ulPropertySets == 0 )
00763         {
00764           if( !(dwBitMask & PROPSET_SESSION) )
00765           {
00766             if( !(dwBitMask & PROPSET_ROWSET) )
00767             {
00768                 pPropSet[0].guidPropertySet = DBPROPSET_DBINIT;
00769                 pPropSet[0].cProperties  = NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES;
00770
00771               if( dwBitMask & PROPSET_INIT )
00772               {
00773                 pPropSet[1].guidPropertySet = DBPROPSET_DATASOURCEINFO;
00774                 pPropSet[1].cProperties  = NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES;
00775               }
00776             }
00777             else
00778             {
00779               pPropSet[0].guidPropertySet = DBPROPSET_ROWSET;
00780               pPropSet[0].cProperties  = NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES;
00781             }
00782           }
00783           else
00784           {
00785             pPropSet[0].guidPropertySet = DBPROPSET_SESSION;
00786             pPropSet[0].cProperties  = NUMBER_OF_SUPPORTED_SESSION_PROPERTIES;
00787           }
00788         }
00789     }
00790     else
00791     {
00792       pPropSet[ulPropertySets].guidPropertySet = rgPropertyIDSets[ulPropertySets].guidPropertySet;
00793       pPropSet[ulPropertySets].cProperties  = rgPropertyIDSets[ulPropertySets].cPropertyIDs;
00794
00795       if( rgPropertyIDSets[ulPropertySets].cPropertyIDs == 0 )
00796       {
00797         fGetAllProps = TRUE;
00798
00799         if( rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DBINIT &&
00800           dwBitMask & PROPSET_DSO )
00801         {
00802           pPropSet[ulPropertySets].cProperties  = NUMBER_OF_SUPPORTED_DBINIT_PROPERTIES;
00803         }
00804         else if( (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCEINFO) &&
00805              ((dwBitMask & PROPSET_DSOINIT) == PROPSET_DSOINIT) )
00806         {
00807           pPropSet[ulPropertySets].cProperties  = NUMBER_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES;
00808         }
00809         else if( (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_SESSION) &&
00810              (dwBitMask & PROPSET_SESSION))
00811         {
00812           pPropSet[ulPropertySets].cProperties  = NUMBER_OF_SUPPORTED_SESSION_PROPERTIES;
00813         }
00814         else if( (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_ROWSET) &&
00815              (dwBitMask & PROPSET_ROWSET))
00816         {
00817           pPropSet[ulPropertySets].cProperties  = NUMBER_OF_SUPPORTED_ROWSET_PROPERTIES;
00818         }
00819         else if( rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_PROPERTIESINERROR )
00820         {
00821           if( dwBitMask & PROPSET_DSO ) {
00822             pPropSet[ulPropertySets].guidPropertySet = DBPROPSET_DBINIT;
00823             fPropsSucceed = TRUE;
00824           }
00825           else if( dwBitMask & PROPSET_ROWSET ) {
00826             pPropSet[ulPropertySets].guidPropertySet = DBPROPSET_ROWSET;
00827             fPropsSucceed = TRUE;
00828           }
00829           else
00830             fPropsinError = TRUE;
00831         }
00832         else
00833         {
00834           fGetAllProps = FALSE;
00835           fPropsinError = TRUE;
00836         }
00837       }
00838     }
00839
00840     if( pPropSet[ulPropertySets].cProperties )
00841     {
00842         // use task memory allocater to alloc array of DBPROP structs
00843       pProp = (DBPROP*) PROVIDER_ALLOC(sizeof( DBPROP ) *
00844                      pPropSet[ulPropertySets].cProperties);
00845
00846       if (!pProp)
00847       {
00848         for(ULONG ul=0; ul<ulPropertySets; ul++)
00849         {
00850           for(ULONG ul2=0; ul2<pPropSet[ul].cProperties; ul2++)
00851             VariantClear( &pPropSet[ul].rgProperties[ul2].vValue );
00852
00853           SAFE_FREE( pPropSet[ul].rgProperties );
00854         }
00855         SAFE_FREE( pPropSet );
00856
00857         return ResultFromScode( E_OUTOFMEMORY );
00858       }
00859
00860       pPropSet[ulPropertySets].rgProperties = &pProp[0];
00861
00862       memset( pProp, 0,
00863         (pPropSet[ulPropertySets].cProperties * sizeof( DBPROP )));
00864     }
00865
00866       // for each prop in our table..
00867     for (cCount=0; cCount < pPropSet[ulPropertySets].cProperties; cCount++)
00868     {
00869       // init the Variant right up front
00870       // that way we can VariantClear with no worried (if we need to)
00871       VariantInit( &pProp[cCount].vValue );
00872
00873       // Check supported property sets
00874       if ( pPropSet[ulPropertySets].guidPropertySet == DBPROPSET_DBINIT &&
00875          fGetAllProps )
00876       {
00877         fPropsSucceed = TRUE;
00878         // load up their DBPROP from our table
00879         hr = LoadDBPROP( &m_rgproperties[START_OF_SUPPORTED_DBINIT_PROPERTIES + cCount],
00880               &pProp[cCount] );
00881       }
00882       else if ( pPropSet[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCEINFO &&
00883             fGetAllProps )
00884       {
00885         fPropsSucceed = TRUE;
00886         // load up their DBPROPINFO from our table
00887         hr = LoadDBPROP( &m_rgproperties[START_OF_SUPPORTED_DATASOURCEINFO_PROPERTIES + cCount],
00888               &pProp[cCount] );
00889       }
00890       else if ( pPropSet[ulPropertySets].guidPropertySet == DBPROPSET_SESSION &&
00891             fGetAllProps )
00892       {
00893         fPropsSucceed = TRUE;
00894         // load up their DBPROPINFO from our table
00895         hr = LoadDBPROP( &m_rgproperties[START_OF_SUPPORTED_SESSION_PROPERTIES + cCount],
00896               &pProp[cCount] );
00897       }
00898       else if ( pPropSet[ulPropertySets].guidPropertySet == DBPROPSET_ROWSET &&
00899             fGetAllProps )
00900       {
00901         fPropsSucceed = TRUE;
00902         // load up their DBPROPINFO from our table
00903         hr = LoadDBPROP( &m_rgproperties[START_OF_SUPPORTED_ROWSET_PROPERTIES + cCount],
00904               &pProp[cCount] );
00905       }
00906       else
00907       {
00908         ULONG ulIndex;
00909
00910         pProp[cCount].dwPropertyID  = rgPropertyIDSets[ulPropertySets].rgPropertyIDs[cCount];
00911         pProp[cCount].dwStatus    = DBPROPSTATUS_NOTSUPPORTED;
00912
00913         if(  (GetPropIndex(rgPropertyIDSets[ulPropertySets].rgPropertyIDs[cCount], &ulIndex)) &&
00914            (((dwBitMask & PROPSET_DSO) &&
00915              (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DBINIT)) ||
00916             (((dwBitMask & PROPSET_DSOINIT) == PROPSET_DSOINIT) &&
00917              ((rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCE) ||
00918             (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_DATASOURCEINFO))) ||
00919             ((dwBitMask & PROPSET_SESSION) &&
00920              (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_SESSION)) ||
00921             ((dwBitMask & PROPSET_ROWSET) &&
00922              (rgPropertyIDSets[ulPropertySets].guidPropertySet == DBPROPSET_ROWSET))) )
00923         {
00924           fPropsSucceed = TRUE;
00925           hr = LoadDBPROP( &m_rgproperties[ulIndex], &pProp[cCount] );
00926         }
00927         else
00928           fPropsinError = TRUE;
00929       }
00930     }
00931     // Set local back to FALSE
00932     fGetAllProps = FALSE;
00933   }
00934
00935   // set count of properties and property information
00936     *pcPropertySets  = cProps;
00937     *prgPropertySets = pPropSet;
00938
00939 CLEANUP:
00940
00941   if( FAILED(hr) )
00942   {
00943     // clear all variants used so far..
00944     for (ULONG ulFor=0; ulFor < cCount; ulFor++)
00945       VariantClear(&pProp[ulFor].vValue);
00946
00947     // delete the pProp array, return failure
00948     SAFE_FREE(pProp);
00949     SAFE_FREE(pPropSet);
00950   }
00951
00952   if ( (!fPropsSucceed && cPropertyIDSets) || (!fPropsSucceed && fPropsinError) )
00953     return ResultFromScode( DB_E_ERRORSOCCURRED );
00954   else if ( fPropsSucceed && fPropsinError )
00955     return ResultFromScode( DB_S_ERRORSOCCURRED );
00956   else
00957     return ResultFromScode( hr );
00958 }
00959
00960
00961 // CUtilProp::SetPropertiesArgChk -------------------------------------------
00962 //
00963 // @mfunc Initialize the buffers and check for E_INVALIDARG cases
00964 //
00965 // @rdesc HRESULT indicating the status of the method
00966 //    @flag S_OK | Properties gathered
00967 //    @flag E_INVALIDARG | Invalid parameter values
00968 //
00969 HRESULT CUtilProp::SetPropertiesArgChk
00970   (
00971   const ULONG   cPropertySets,    //@parm IN | Count of structs returned
00972   const DBPROPSET rgPropertySets[]  //@parm IN | Array of Properties Sets
00973   )
00974 {
00975   // Argument Checking
00976   if( !rgPropertySets )
00977     return ResultFromScode( E_INVALIDARG );
00978
00979   // New argument check for > 1 cPropertyIDs and NULL pointer for
00980   // array of property ids.
00981   for(ULONG ul=0; ul<cPropertySets; ul++)
00982   {
00983     if( rgPropertySets[ul].cProperties && !(rgPropertySets[ul].rgProperties) )
00984       return ResultFromScode( E_INVALIDARG );
00985   }
00986
00987   return ResultFromScode( S_OK );
00988 }
00989
00990
00991 // CUtilProp::SetProperties ----------------------------------------------------
00992 //
00993 // @mfunc Set current settings of properties supported by the DSO/rowset
00994 //
00995 // @rdesc HRESULT
00996 //      @flag S_OK          | The method succeeded
00997 //      @flag E_INVALIDARG  | pcProperties or prgPropertyInfo was NULL
00998 //      @flag E_OUTOFMEMORY | Out of memory
00999 //
01000 STDMETHODIMP CUtilProp::SetProperties
01001     (
01002     DWORD   dwBitMask,      //@parm IN    Type of PropSet
01003     ULONG   cPropertyIDSets,  //@parm IN    # of DBPROPSET
01004     DBPROPSET rgPropertyIDSets[]  //@parm INOUT Array of property sets
01005   )
01006 {
01007   ULONG cCountProps = 0;
01008   ULONG cValidProps = 0;
01009   ULONG ulIndex     = 0;
01010
01011   // For each supported Property Set
01012   for (ULONG cPropSets=0; cPropSets < cPropertyIDSets; cPropSets++)
01013   {
01014       // for each prop in the propset
01015     for (ULONG cCnt=0; cCnt < rgPropertyIDSets[cPropSets].cProperties; cCnt++)
01016     {
01017       //Keep track of the number
01018       cCountProps++;
01019
01020       // Check Check to see if valid
01021       switch( dwBitMask )
01022       {
01023         case PROPSET_DSO:
01024           if( rgPropertyIDSets[cPropSets].guidPropertySet == DBPROPSET_DBINIT &&
01025             GetPropIndex(rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwPropertyID, &ulIndex) )
01026             break;
01027
01028           rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSUPPORTED;
01029           continue;
01030
01031         case PROPSET_DSOINIT:
01032           if( (rgPropertyIDSets[cPropSets].guidPropertySet == DBPROPSET_DATASOURCEINFO ||
01033              rgPropertyIDSets[cPropSets].guidPropertySet == DBPROPSET_DATASOURCE)  &&
01034             GetPropIndex(rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwPropertyID, &ulIndex) )
01035             break;
01036
01037           if( rgPropertyIDSets[cPropSets].guidPropertySet == DBPROPSET_DBINIT )
01038             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSETTABLE;
01039           else
01040             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSUPPORTED;
01041           continue;
01042
01043         case PROPSET_SESSION:
01044           if( rgPropertyIDSets[cPropSets].guidPropertySet == DBPROPSET_SESSION  &&
01045             GetPropIndex(rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwPropertyID, &ulIndex) )
01046             break;
01047
01048           rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSUPPORTED;
01049           continue;
01050
01051         case PROPSET_ROWSET:
01052           if( rgPropertyIDSets[cPropSets].guidPropertySet == DBPROPSET_ROWSET  &&
01053             GetPropIndex(rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwPropertyID, &ulIndex) )
01054             break;
01055
01056           rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSUPPORTED;
01057           continue;
01058
01059         default:
01060           assert("Unsupported dwBitMask");
01061       }
01062
01063       // arg checking for the prop
01064       if( rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwOptions != DBPROPOPTIONS_OPTIONAL &&
01065         rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwOptions != DBPROPOPTIONS_REQUIRED )
01066       {
01067         rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_BADOPTION;
01068         continue;
01069       }
01070
01071       if( (V_VT(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) != VT_EMPTY) &&
01072         (V_VT(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) != m_rgproperties[ulIndex].vtType ||
01073          IsValidValue(&rgPropertyIDSets[cPropSets].rgProperties[cCnt]) == S_FALSE) )
01074       {
01075         rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_BADVALUE;
01076         continue;
01077       }
01078
01079       switch( V_VT(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) )
01080       {
01081         case VT_BOOL:
01082           if( m_rgproperties[ulIndex].dwFlags & DBPROPFLAGS_WRITE ) {
01083             m_rgproperties[ulIndex].boolVal = !!(V_BOOL(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue));
01084             break;
01085           }
01086
01087           if( !!(V_BOOL(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue)) == m_rgproperties[ulIndex].boolVal )
01088             break;
01089
01090           if( rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwOptions == DBPROPOPTIONS_OPTIONAL)
01091             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSET;
01092           else
01093             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSETTABLE;
01094           continue;
01095
01096         case VT_I2:
01097           if( m_rgproperties[ulIndex].dwFlags & DBPROPFLAGS_WRITE ) {
01098             m_rgproperties[ulIndex].longVal = V_I2(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue);
01099             break;
01100           }
01101
01102           if( V_I2(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) == (SHORT)m_rgproperties[ulIndex].longVal )
01103             break;
01104
01105           if( rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwOptions == DBPROPOPTIONS_OPTIONAL)
01106             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSET;
01107           else
01108             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSETTABLE;
01109           continue;
01110
01111         case VT_I4:
01112           if( m_rgproperties[ulIndex].dwFlags & DBPROPFLAGS_WRITE ) {
01113             m_rgproperties[ulIndex].longVal = V_I4(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue);
01114             break;
01115           }
01116
01117           if( (V_I4(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) == (LONG)m_rgproperties[ulIndex].longVal) ||
01118             (rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwPropertyID == DBPROP_UPDATABILITY &&
01119              V_I4(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) & m_rgproperties[ulIndex].longVal) )
01120             break;
01121
01122           if( rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwOptions == DBPROPOPTIONS_OPTIONAL)
01123             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSET;
01124           else
01125             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSETTABLE;
01126           continue;
01127
01128 #ifdef _WIN64
01129                 case VT_I8:
01130           if( m_rgproperties[ulIndex].dwFlags & DBPROPFLAGS_WRITE ) {
01131             m_rgproperties[ulIndex].longVal = V_I8(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue);
01132             break;
01133           }
01134
01135           if( (V_I8(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) == (LONG)m_rgproperties[ulIndex].longVal) ||
01136             (rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwPropertyID == DBPROP_UPDATABILITY &&
01137              V_I8(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue) & m_rgproperties[ulIndex].longVal) )
01138             break;
01139
01140           if( rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwOptions == DBPROPOPTIONS_OPTIONAL)
01141             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSET;
01142           else
01143             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSETTABLE;
01144           continue;
01145 #endif
01146
01147         case VT_BSTR:
01148           if( m_rgproperties[ulIndex].dwFlags & DBPROPFLAGS_WRITE ) {
01149             if( m_rgproperties[ulIndex].dwPropertyID == DBPROP_INIT_DATASOURCE ) {
01150               wcscpy(m_wszFilePath, V_BSTR(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue));
01151               m_rgproperties[ulIndex].pwstrVal = m_wszFilePath;
01152             }
01153             break;
01154           }
01155
01156           if( !(wcscmp(V_BSTR(&rgPropertyIDSets[cPropSets].rgProperties[cCnt].vValue), m_rgproperties[ulIndex].pwstrVal)) )
01157             break;
01158
01159           if( rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwOptions == DBPROPOPTIONS_OPTIONAL)
01160             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSET;
01161           else
01162             rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_NOTSETTABLE;
01163           continue;
01164
01165         case VT_EMPTY:
01166           if( m_rgproperties[ulIndex].dwFlags & DBPROPFLAGS_WRITE )
01167             memcpy(&m_rgproperties[ulIndex], &s_rgprop[ulIndex], sizeof(PROPSTRUCT));
01168           break;
01169       }
01170
01171       // Initialize dwStatus
01172       rgPropertyIDSets[cPropSets].rgProperties[cCnt].dwStatus = DBPROPSTATUS_OK;
01173       cValidProps++;
01174     }
01175   }
01176
01177   // Figure out the retcode
01178   if( cValidProps == cCountProps )
01179     return ResultFromScode( S_OK );
01180   else if( cValidProps )
01181     return ResultFromScode( DB_S_ERRORSOCCURRED );
01182   else
01183     return ResultFromScode( DB_E_ERRORSOCCURRED );
01184 }
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COleClient Member List

This is the complete list of members for COleClient, including all inherited members.
CanInPlaceActivate(void) | COleClient | [inline]
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
COleClient(HWND hWndParent=NULL, UINT nID=0) | COleClient | [inline]
ContextSensitiveHelp(BOOL fEnterMode) | COleClient | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DeactivateAndUndo(void) | COleClient | [inline]
DestroyWindow() | CWndLite | [virtual]
DiscardUndoState(void) | COleClient | [inline]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetContainer(IOleContainer **ppContainer) | COleClient | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid) | COleClient | [inline]
GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) | COleClient | [inline]
GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo) | COleClient | [inline]
GetTypeInfoCount(UINT *pctinfo) | COleClient | [inline]
GetWindow(HWND *phwnd) | COleClient | [inline]
GetWindowContext(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) | COleClient | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pvarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) | COleClient | [inline]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_cRef | COleClient | [protected]
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnInPlaceActivate(void) | COleClient | [inline]
OnInPlaceDeactivate(void) | COleClient | [inline]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnPosRectChange(LPCRECT lprcPosRect) | COleClient | [inline]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnShowWindow(BOOL fShow) | COleClient | [inline]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUIActivate(void) | COleClient | [inline]
OnUIDeactivate(BOOL fUndoable) | COleClient | [inline]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | COleClient | [inline]
RequestNewObjectLayout(void) | COleClient | [inline]
SaveObject(void) | COleClient | [inline]
Scroll(SIZE scrollExtant) | COleClient | [inline]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowObject(void) | COleClient | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
STDMETHOD_(ULONG, AddRef)() | COleClient | [inline]
STDMETHOD_(ULONG, Release)() | COleClient | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~COleClient() | COleClient | [inline, virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/PersistFormatEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

PersistFormatEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: PersistFormatEnum
00019
00020 public class PersistFormatEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adPersistADTG = 0;
00023   public static final short adPersistXML = 1;
00024 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ICONRESOURCE Member List

This is the complete list of members for ICONRESOURCE, including all inherited members.
bHasChanged | ICONRESOURCE
IconImages | ICONRESOURCE
nNumImages | ICONRESOURCE
szOriginalDLLFileName | ICONRESOURCE
szOriginalICOFileName | ICONRESOURCE
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

NODESTRUCT Member List

This is the complete list of members for NODESTRUCT, including all inherited members.
GUID | NODESTRUCT
szDescription | NODESTRUCT
Generated on Wed Nov 13 2024 16:57:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/Command15.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

Command15.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface Command15
00019 /** @com.interface(iid=00000508-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DUAL) */
00020 public interface Command15 extends msado15._ADO
00021 {
00022   /** @com.method(vtoffset=4, dispid=500, type=PROPGET, name="Properties", name2="getProperties", addFlagsVtable=4)
00023       @com.parameters([iid=00000504-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00024   public msado15.Properties getProperties();
00025
00026   /** @com.method(vtoffset=5, dispid=1610809344, type=PROPGET, name="ActiveConnection", name2="getActiveConnection", addFlagsVtable=4)
00027       @com.parameters([iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00028   public msado15._Connection getActiveConnection();
00029
00030   /** @com.method(vtoffset=6, dispid=1610809344, type=PROPPUTREF, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00031       @com.parameters([in,iid=00000550-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] ppvObject) */
00032   public void setActiveConnection(msado15._Connection ppvObject);
00033
00034   /** @com.method(vtoffset=7, dispid=1610809344, type=PROPPUT, name="ActiveConnection", name2="putActiveConnection", addFlagsVtable=4)
00035       @com.parameters([in,type=VARIANT] ppvObject) */
00036   public void setActiveConnection(Variant ppvObject);
00037
00038   /** @com.method(vtoffset=8, dispid=1610809347, type=PROPGET, name="CommandText", name2="getCommandText", addFlagsVtable=4)
00039       @com.parameters([type=STRING] return) */
00040   public String getCommandText();
00041
00042   /** @com.method(vtoffset=9, dispid=1610809347, type=PROPPUT, name="CommandText", name2="putCommandText", addFlagsVtable=4)
00043       @com.parameters([in,type=STRING] pbstr) */
00044   public void setCommandText(String pbstr);
00045
00046   /** @com.method(vtoffset=10, dispid=1610809349, type=PROPGET, name="CommandTimeout", name2="getCommandTimeout", addFlagsVtable=4)
00047       @com.parameters([type=I4] return) */
00048   public int getCommandTimeout();
00049
00050   /** @com.method(vtoffset=11, dispid=1610809349, type=PROPPUT, name="CommandTimeout", name2="putCommandTimeout", addFlagsVtable=4)
00051       @com.parameters([in,type=I4] pl) */
00052   public void setCommandTimeout(int pl);
00053
00054   /** @com.method(vtoffset=12, dispid=1610809351, type=PROPGET, name="Prepared", name2="getPrepared", addFlagsVtable=4)
00055       @com.parameters([type=BOOLEAN] return) */
00056   public boolean getPrepared();
00057
00058   /** @com.method(vtoffset=13, dispid=1610809351, type=PROPPUT, name="Prepared", name2="putPrepared", addFlagsVtable=4)
00059       @com.parameters([in,type=BOOLEAN] pfPrepared) */
00060   public void setPrepared(boolean pfPrepared);
00061
00062   /** @com.method(vtoffset=14, dispid=1610809353, type=METHOD, name="Execute", addFlagsVtable=4)
00063       @com.parameters([out,elementType=VARIANT,type=PTR] RecordsAffected, [in,elementType=VARIANT,type=PTR] Parameters, [in,type=I4] Options, [iid=00000556-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00064   public msado15._Recordset Execute(Variant RecordsAffected, Variant Parameters, int Options);
00065
00066   /** @com.method(vtoffset=15, dispid=1610809354, type=METHOD, name="CreateParameter", addFlagsVtable=4)
00067       @com.parameters([in,type=STRING] Name, [in,type=I4] Type, [in,type=I4] Direction, [in,type=I4] Size, [in,type=VARIANT] Value, [iid=0000050C-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00068   public msado15._Parameter CreateParameter(String Name, int Type, int Direction, int Size, Variant Value);
00069
00070   /** @com.method(vtoffset=16, dispid=0, type=PROPGET, name="Parameters", name2="getParameters", addFlagsVtable=4)
00071       @com.parameters([iid=0000050D-0000-0010-8000-00AA006D2EA4,thread=AUTO,type=DISPATCH] return) */
00072   public msado15.Parameters getParameters();
00073
00074   /** @com.method(vtoffset=17, dispid=1610809356, type=PROPPUT, name="CommandType", name2="putCommandType", addFlagsVtable=4)
00075       @com.parameters([in,type=I4] plCmdType) */
00076   public void setCommandType(int plCmdType);
00077
00078   /** @com.method(vtoffset=18, dispid=1610809356, type=PROPGET, name="CommandType", name2="getCommandType", addFlagsVtable=4)
00079       @com.parameters([type=I4] return) */
00080   public int getCommandType();
00081
00082   /** @com.method(vtoffset=19, dispid=1610809358, type=PROPGET, name="Name", name2="getName", addFlagsVtable=4)
00083       @com.parameters([type=STRING] return) */
00084   public String getName();
00085
00086   /** @com.method(vtoffset=20, dispid=1610809358, type=PROPPUT, name="Name", name2="putName", addFlagsVtable=4)
00087       @com.parameters([in,type=STRING] pbstrName) */
00088   public void setName(String pbstrName);
00089
00090
00091   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x508, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00092 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/dballoc.Cpp Source File

  • Com
  • Fundamentals
  • OleStd

dballoc.Cpp

Go to the documentation of this file.
00001 /***
00002 *dballoc.cpp
00003 *
00004 *  Copyright 1992 - 2000 Microsoft Corporation.  All Rights Reserved.
00005 *
00006 *Purpose:
00007 *  This file contains a debug implementation of the IMalloc interface.
00008 *
00009 *  This implementation is basically a simple wrapping of the C runtime,
00010 *  with additional work to detect memory leakage, and memory overwrite.
00011 *
00012 *  Leakage is detected by tracking each allocation in an address
00013 *  instance table, and then checking to see if the table is empty
00014 *  when the last reference to the allocator is released.
00015 *
00016 *  Memory overwrite is detected by placing a signature at the end
00017 *  of every allocated block, and checking to make sure the signature
00018 *  is unchanged when the block is freed.
00019 *
00020 *  This implementation also has additional param validation code, as
00021 *  well as additional check make sure that instances that are passed
00022 *  to Free() were actually allocated by the corresponding instance
00023 *  of the allocator.
00024 *
00025 *
00026 *  Creating an instance of this debug allocator that uses the default
00027 *  output interface would look like the following,
00028 *
00029 *
00030 *  BOOL init_application_instance()
00031 *  {
00032 *    HRESULT hresult;
00033 *    IMalloc FAR* pmalloc;
00034 *
00035 *    pmalloc = NULL;
00036 *
00037 *    if((hresult = OleStdCreateDbAlloc(0,&pmalloc))!=NOERROR)
00038 *      goto LReturn;
00039 *
00040 *    hresult = OleInitialize(pmalloc);
00041 *
00042 *    // release pmalloc to let OLE hold the only ref to the it. later
00043 *    // when OleUnitialize is called, memory leaks will be reported.
00044 *    if(pmalloc != NULL)
00045 *      pmalloc->Release();
00046 *
00047 *  LReturn:
00048 *
00049 *    return (hresult == NOERROR) ? TRUE : FALSE;
00050 *  }
00051 *
00052 *
00053 *  CONSIDER: could add an option to force error generation, something
00054 *   like DBALLOC_ERRORGEN
00055 *
00056 *  CONSIDER: add support for heap-checking. say for example,
00057 *   DBALLOC_HEAPCHECK would do a heapcheck every free? every 'n'
00058 *   calls to free? ...
00059 *
00060 *
00061 *Implementation Notes:
00062 *
00063 *  The method IMalloc::DidAlloc() is allowed to always return
00064 *  "Dont Know" (-1).  This method is called by Ole, and they take
00065 *  some appropriate action when they get this answer.
00066 *
00067 *****************************************************************************/
00068
00069
00070 // Note: this file is designed to be stand-alone; it includes a
00071 // carefully chosen, minimal set of headers.
00072 //
00073 // For conditional compilation we use the ole2 conventions,
00074 //    _MAC      = mac
00075 //    WIN32     = Win32 (NT really)
00076 //    <nothing> = defaults to Win16
00077
00078
00079 // REVIEW: the following needs to modified to handle _MAC
00080 #define STRICT
00081
00082 #include <windows.h>
00083
00084 #include <ole2.h>
00085
00086 #if defined( __TURBOC__)
00087 #define __STDC__ (1)
00088 #endif
00089
00090 #define WINDLL  1           // make far pointer version of stdargs.h
00091 #include <stdarg.h>
00092
00093 #if defined( __TURBOC__)
00094 #undef __STDC__
00095 #endif
00096
00097 #include <stdio.h>
00098 #include <malloc.h>
00099 #include <string.h>
00100 #include <limits.h>
00101
00102 #include "dballoc.h"
00103
00104 extern "C" DWORD g_dwObjectCount; // since we don't include ole2ui.h
00105
00106 #define DIM(X) (sizeof(X)/sizeof((X)[0]))
00107
00108 #define UNREACHED 0
00109
00110 #if defined(WIN32)
00111 # define MEMCMP(PV1, PV2, CB)   memcmp((PV1), (PV2), (CB))
00112 # define MEMCPY(PV1, PV2, CB)   memcpy((PV1), (PV2), (CB))
00113 # define MEMSET(PV,  VAL, CB)   memset((PV),  (VAL), (CB))
00114 # define MALLOC(CB)     malloc(CB)
00115 # define REALLOC(PV, CB)    realloc((PV), (CB))
00116 # define FREE(PV)       free(PV)
00117 # define HEAPMIN()      _heapmin()
00118 #elif defined(_MAC)
00119 # define MEMCMP(PV1, PV2)   ERROR -- NYI
00120 # define MEMCPY(PV1, PV2, CB)   ERROR -- NYI
00121 # define MEMSET(PV,  VAL, CB)   ERROR -- NYI
00122 # define MALLOC(CB)     ERROR -- NYI
00123 # define REALLOC(PV, CB)    ERROR -- NYI
00124 # define FREE(PV)       ERROR -- NYI
00125 # define HEAPMIN()      ERROR -- NYI
00126 #else
00127 # define MEMCMP(PV1, PV2, CB)   _fmemcmp((PV1), (PV2), (CB))
00128 # define MEMCPY(PV1, PV2, CB)   _fmemcpy((PV1), (PV2), (CB))
00129 # define MEMSET(PV,  VAL, CB)   _fmemset((PV),  (VAL), (CB))
00130 # define MALLOC(CB)     _fmalloc(CB)
00131 # define REALLOC(PV, CB)    _frealloc(PV, CB)
00132 # define FREE(PV)       _ffree(PV)
00133 # define HEAPMIN()      _fheapmin()
00134 #endif
00135
00136 /*************************************************************************
00137 ** DEBUG ASSERTION ROUTINES
00138 *************************************************************************/
00139
00140 #if DBG
00141 #include <assert.h>
00142 #define FnAssert(lpstrExpr, lpstrMsg, lpstrFileName, iLine)     \
00143         (_assert(lpstrMsg ? lpstrMsg : lpstrExpr,               \
00144                  lpstrFileName,                                 \
00145                  iLine), NOERROR)
00146 #endif //DBG
00147
00148 #if defined( __TURBOC__ )
00149 #define classmodel _huge
00150 #else
00151 #define classmodel FAR
00152 #endif
00153
00154 class classmodel CStdDbOutput : public IDbOutput {
00155 public:
00156    static IDbOutput FAR* Create();
00157
00158    // IUnknown methods
00159
00160    STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppv);
00161    STDMETHOD_(ULONG, AddRef)(void);
00162    STDMETHOD_(ULONG, Release)(void);
00163
00164
00165    // IDbOutput methods
00166
00167    virtual void _cdecl  Printf (char FAR* szFmt, ...);
00168
00169    STDMETHOD_(void, Assertion)(
00170      BOOL cond,
00171      char FAR* szExpr,
00172      char FAR* szFile,
00173      UINT uLine,
00174      char FAR* szMsg);
00175
00176
00177    void FAR* operator new(size_t cb){
00178      return MALLOC(cb);
00179    }
00180    void operator delete(void FAR* pv){
00181      FREE(pv);
00182    }
00183
00184    CStdDbOutput(){
00185      g_dwObjectCount++ ;
00186      m_refs = 0;
00187    }
00188
00189    ~CStdDbOutput() { g_dwObjectCount-- ; }
00190
00191
00192 private:
00193    ULONG m_refs;
00194
00195    char m_rgch[128]; // buffer for output formatting
00196 };
00197
00198
00199 //---------------------------------------------------------------------
00200 //                implementation of the debug allocator
00201 //---------------------------------------------------------------------
00202
00203 class FAR CAddrNode
00204 {
00205 public:
00206    void FAR*      m_pv;    // instance
00207    ULONG      m_cb;    // size of allocation in BYTES
00208    ULONG          m_nAlloc;    // the allocation pass count
00209    CAddrNode FAR* m_next;
00210
00211    void FAR* operator new(size_t cb){
00212      return MALLOC(cb);
00213    }
00214    void operator delete(void FAR* pv){
00215      FREE(pv);
00216    }
00217 };
00218
00219
00220 class classmodel CDbAlloc : public IMalloc
00221 {
00222 public:
00223    static HRESULT Create(
00224      ULONG options, IDbOutput FAR* pdbout, IMalloc FAR* FAR* ppmalloc);
00225
00226    // IUnknown methods
00227
00228    STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppv);
00229    STDMETHOD_(ULONG, AddRef)(void);
00230    STDMETHOD_(ULONG, Release)(void);
00231
00232    // IMalloc methods
00233
00234    STDMETHOD_(void FAR*, Alloc)(ULONG cb);
00235    STDMETHOD_(void FAR*, Realloc)(void FAR* pv, ULONG cb);
00236    STDMETHOD_(void, Free)(void FAR* pv);
00237    STDMETHOD_(ULONG, GetSize)(void FAR* pv);
00238    STDMETHOD_(int, DidAlloc)(void FAR* pv);
00239    STDMETHOD_(void, HeapMinimize)(void);
00240
00241
00242    void FAR* operator new(size_t cb){
00243      return MALLOC(cb);
00244    }
00245    void operator delete(void FAR* pv){
00246      FREE(pv);
00247    }
00248
00249    CDbAlloc(){
00250      m_refs = 1;
00251      m_pdbout = NULL;
00252      m_cAllocCalls = 0;
00253      m_nBreakAtNthAlloc = 0;
00254      m_nBreakAtAllocSize = 0;
00255      MEMSET(m_rganode, 0, sizeof(m_rganode));
00256
00257      g_dwObjectCount++ ;
00258
00259    }
00260
00261    ~CDbAlloc() {   g_dwObjectCount-- ; }
00262
00263
00264 private:
00265
00266    ULONG m_refs;
00267    ULONG m_cAllocCalls;        // total count of allocation calls
00268    ULONG m_nBreakAtNthAlloc;   // allocation number to break to debugger
00269                         //  this value should be set typically in the
00270                         //  debugger.
00271    ULONG m_nBreakAtAllocSize;  // allocation size to break to debugger
00272                         //  this value should be set typically in the
00273                         //  debugger.
00274    IDbOutput FAR* m_pdbout;        // output interface
00275    CAddrNode FAR* m_rganode[64];   // address instance table
00276
00277
00278    // instance table methods
00279
00280    BOOL IsEmpty(void);
00281
00282    void AddInst(void FAR* pv, ULONG nAlloc, ULONG cb);
00283    void DelInst(void FAR* pv);
00284    CAddrNode FAR* GetInst(void FAR* pv);
00285
00286    void DumpInst(CAddrNode FAR* pn);
00287    void DumpInstTable(void);
00288
00289    inline UINT HashInst(void FAR* pv) const {
00290      return ((UINT)((ULONG)pv >> 4)) % DIM(m_rganode);
00291    }
00292
00293
00294    // output method(s)
00295
00296    inline void Assertion(
00297      BOOL cond,
00298      char FAR* szExpr,
00299      char FAR* szFile,
00300      UINT uLine,
00301      char FAR* szMsg)
00302    {
00303      m_pdbout->Assertion(cond, szExpr, szFile, uLine, szMsg);
00304    }
00305
00306    #define ASSERT(X) Assertion(X, #X, __FILE__, __LINE__, NULL)
00307
00308    #define ASSERTSZ(X, SZ) Assertion(X, #X, __FILE__, __LINE__, SZ)
00309
00310    static const unsigned char m_rgchSig[4];
00311 };
00312
00313
00314 const unsigned char CDbAlloc::m_rgchSig[] = { 0xDE, 0xAD, 0xBE, 0xEF };
00315
00316
00317 /***
00318 *HRESULT OleStdCreateDbAlloc(ULONG reserved, IMalloc** ppmalloc)
00319 * Purpose:
00320 *  Create an instance of CDbAlloc -- a debug implementation
00321 *  of IMalloc.
00322 *
00323 * Parameters:
00324 *   ULONG reserved              - reserved for future use. must be 0.
00325 *   IMalloc FAR* FAR* ppmalloc  - (OUT) pointer to an IMalloc interface
00326 *                                   of new debug allocator object
00327 * Returns:
00328 *   HRESULT
00329 *       NOERROR         - if no error.
00330 *       E_OUTOFMEMORY   - allocation failed.
00331 *
00332 ***********************************************************************/
00333 STDAPI OleStdCreateDbAlloc(ULONG reserved,IMalloc FAR* FAR* ppmalloc)
00334 {
00335    return CDbAlloc::Create(reserved, NULL, ppmalloc);
00336 }
00337
00338
00339 HRESULT
00340 CDbAlloc::Create(
00341    ULONG options,
00342    IDbOutput FAR* pdbout,
00343    IMalloc FAR* FAR* ppmalloc)
00344 {
00345    HRESULT hresult;
00346    CDbAlloc FAR* pmalloc;
00347
00348
00349    // default the instance of IDbOutput if the user didn't supply one
00350    if(pdbout == NULL && ((pdbout = CStdDbOutput::Create()) == NULL)){
00351      hresult = E_OUTOFMEMORY;
00352      goto LError0;
00353    }
00354
00355    pdbout->AddRef();
00356
00357    if((pmalloc = new FAR CDbAlloc()) == NULL){
00358      hresult = E_OUTOFMEMORY;
00359      goto LError1;
00360    }
00361
00362    pmalloc->m_pdbout = pdbout;
00363
00364    *ppmalloc = pmalloc;
00365
00366    return NOERROR;
00367
00368 LError1:;
00369    pdbout->Release();
00370    pmalloc->Release();
00371
00372 LError0:;
00373    return hresult;
00374 }
00375
00376 STDMETHODIMP
00377 CDbAlloc::QueryInterface(REFIID riid, void FAR* FAR* ppv)
00378 {
00379    if(riid == IID_IUnknown || riid == IID_IMalloc){
00380      *ppv = this;
00381      AddRef();
00382      return NOERROR;
00383    }
00384    return E_NOINTERFACE;
00385 }
00386
00387 STDMETHODIMP_(ULONG)
00388 CDbAlloc::AddRef()
00389 {
00390    return ++m_refs;
00391 }
00392
00393 STDMETHODIMP_(ULONG)
00394 CDbAlloc::Release()
00395 {
00396    if(--m_refs == 0){
00397
00398      // check for memory leakage
00399      if(IsEmpty()){
00400         m_pdbout->Printf("No Memory Leaks.\n");
00401      }else{
00402         m_pdbout->Printf("Memory Leak Detected,\n");
00403         DumpInstTable();
00404      }
00405
00406      m_pdbout->Release();
00407      delete this;
00408      return 0;
00409    }
00410    return m_refs;
00411 }
00412
00413 STDMETHODIMP_(void FAR*)
00414 CDbAlloc::Alloc(ULONG cb)
00415 {
00416    size_t size;
00417    void FAR* pv;
00418
00419    ++m_cAllocCalls;
00420
00421    if (m_nBreakAtNthAlloc && m_cAllocCalls == m_nBreakAtNthAlloc) {
00422       ASSERTSZ(FALSE, "DBALLOC: NthAlloc Break target reached\r\n");
00423    } else if (m_nBreakAtAllocSize && cb == m_nBreakAtAllocSize) {
00424       ASSERTSZ(FALSE, "DBALLOC: AllocSize Break target reached\r\n");
00425    }
00426
00427    // REVIEW: need to add support for huge allocations (on win16)
00428    if((cb + sizeof(m_rgchSig)) > UINT_MAX)
00429      return NULL;
00430
00431    size = (size_t)cb;
00432
00433    if((pv = MALLOC(size + sizeof(m_rgchSig))) == NULL)
00434      return NULL;
00435
00436    // set allocated block to some non-zero value
00437    MEMSET(pv, -1, size);
00438
00439    // put signature at end of allocated block
00440    MEMCPY((char FAR*)pv + size, m_rgchSig, sizeof(m_rgchSig));
00441
00442    AddInst(pv, m_cAllocCalls, size);
00443
00444    return pv;
00445 }
00446
00447 STDMETHODIMP_(void FAR*)
00448 CDbAlloc::Realloc(void FAR* pv, ULONG cb)
00449 {
00450    size_t size;
00451
00452    // REVIEW: need to add support for huge realloc
00453    if((cb + sizeof(m_rgchSig)) > UINT_MAX)
00454      return NULL;
00455
00456    if(pv == NULL){
00457      return Alloc(cb);
00458    }
00459
00460    ++m_cAllocCalls;
00461
00462    ASSERT(GetInst(pv) != NULL);
00463
00464    DelInst(pv);
00465
00466    if(cb == 0){
00467      Free(pv);
00468      return NULL;
00469    }
00470
00471    size = (size_t)cb;
00472
00473    if((pv = REALLOC(pv, size + sizeof(m_rgchSig))) == NULL)
00474      return NULL;
00475
00476    // put signature at end of allocated block
00477    MEMCPY((char FAR*)pv + size, m_rgchSig, sizeof(m_rgchSig));
00478
00479    AddInst(pv, m_cAllocCalls, size);
00480
00481    return pv;
00482 }
00483
00484 STDMETHODIMP_(void)
00485 CDbAlloc::Free(void FAR* pv)
00486 {
00487    CAddrNode FAR* pn;
00488 static char szSigMsg[] = "Signature Check Failed";
00489
00490    if (pv == NULL) return;
00491
00492    pn = GetInst(pv);
00493
00494    // check for attempt to free an instance we didnt allocate
00495    if(pn == NULL){
00496      ASSERTSZ(FALSE, "pointer freed by wrong allocator");
00497      return;
00498    }
00499
00500    // verify the signature
00501    if(MEMCMP((char FAR*)pv + pn->m_cb, m_rgchSig, sizeof(m_rgchSig)) != 0){
00502      m_pdbout->Printf(szSigMsg); m_pdbout->Printf("\n");
00503      DumpInst(GetInst(pv));
00504      ASSERTSZ(FALSE, szSigMsg);
00505    }
00506
00507    // stomp on the contents of the block
00508    MEMSET(pv, 0xCC, (size_t)pn->m_cb + sizeof(m_rgchSig));
00509
00510    DelInst(pv);
00511
00512    FREE(pv);
00513 }
00514
00515
00516 STDMETHODIMP_(ULONG)
00517 CDbAlloc::GetSize(void FAR* pv)
00518 {
00519    CAddrNode FAR* pn;
00520
00521    pn = GetInst(pv);
00522
00523    if (pn == NULL) {
00524       return (ULONG)-1;
00525    }
00526
00527    return pn->m_cb;
00528 }
00529
00530
00531 /***
00532 *PUBLIC HRESULT CDbAlloc::DidAlloc
00533 *Purpose:
00534 *  Answer if the given address belongs to a block allocated by
00535 *  this allocator.
00536 *
00537 *Entry:
00538 *  pv = the instance to lookup
00539 *
00540 *Exit:
00541 *  return value = int
00542 *    1 - did alloc
00543 *    0 - did *not* alloc
00544 *   -1 - dont know (according to the ole2 spec it is always legal
00545 *        for the allocator to answer "dont know")
00546 *
00547 ***********************************************************************/
00548 STDMETHODIMP_(int)
00549 CDbAlloc::DidAlloc(void FAR* pv)
00550 {
00551    return -1; // answer "I dont know"
00552 }
00553
00554
00555 STDMETHODIMP_(void)
00556 CDbAlloc::HeapMinimize()
00557 {
00558 #ifdef WIN32
00559    ASSERTSZ (FALSE,"In HeapMinimize () - heapmin not defined in 32bit version.");
00560 #else
00561    HEAPMIN();
00562 #endif
00563 }
00564
00565
00566 //---------------------------------------------------------------------
00567 //                      instance table methods
00568 //---------------------------------------------------------------------
00569
00570 /***
00571 *PRIVATE CDbAlloc::AddInst
00572 *Purpose:
00573 *  Add the given instance to the address instance table.
00574 *
00575 *Entry:
00576 *  pv = the instance to add
00577 *  nAlloc = the allocation passcount of this instance
00578 *
00579 *Exit:
00580 *  None
00581 *
00582 ***********************************************************************/
00583 void
00584 CDbAlloc::AddInst(void FAR* pv, ULONG nAlloc, ULONG cb)
00585 {
00586    UINT hash;
00587    CAddrNode FAR* pn;
00588
00589
00590    ASSERT(pv != NULL);
00591
00592    pn = (CAddrNode FAR*)new FAR CAddrNode();
00593
00594    if (pn == NULL) {
00595       ASSERT(pn != NULL);
00596       return;
00597    }
00598
00599    pn->m_pv = pv;
00600    pn->m_cb = cb;
00601    pn->m_nAlloc = nAlloc;
00602
00603    hash = HashInst(pv);
00604    pn->m_next = m_rganode[hash];
00605    m_rganode[hash] = pn;
00606 }
00607
00608
00609 /***
00610 *UNDONE
00611 *Purpose:
00612 *  Remove the given instance from the address instance table.
00613 *
00614 *Entry:
00615 *  pv = the instance to remove
00616 *
00617 *Exit:
00618 *  None
00619 *
00620 ***********************************************************************/
00621 void
00622 CDbAlloc::DelInst(void FAR* pv)
00623 {
00624    CAddrNode FAR* FAR* ppn, FAR* pnDead;
00625
00626    for(ppn = &m_rganode[HashInst(pv)]; *ppn != NULL; ppn = &(*ppn)->m_next){
00627      if((*ppn)->m_pv == pv){
00628    pnDead = *ppn;
00629    *ppn = (*ppn)->m_next;
00630    delete pnDead;
00631    // make sure it doesnt somehow appear twice
00632    ASSERT(GetInst(pv) == NULL);
00633    return;
00634      }
00635    }
00636
00637    // didnt find the instance
00638    ASSERT(UNREACHED);
00639 }
00640
00641
00642 CAddrNode FAR*
00643 CDbAlloc::GetInst(void FAR* pv)
00644 {
00645    CAddrNode FAR* pn;
00646
00647    for(pn = m_rganode[HashInst(pv)]; pn != NULL; pn = pn->m_next){
00648      if(pn->m_pv == pv)
00649       return pn;
00650    }
00651    return NULL;
00652 }
00653
00654
00655 void
00656 CDbAlloc::DumpInst(CAddrNode FAR* pn)
00657 {
00658    if (pn == NULL)
00659       return;
00660
00661    m_pdbout->Printf("[0x%lx]  nAlloc=%ld  size=%ld\n",
00662      pn->m_pv, pn->m_nAlloc, GetSize(pn->m_pv));
00663 }
00664
00665
00666 /***
00667 *PRIVATE BOOL IsEmpty
00668 *Purpose:
00669 *  Answer if the address instance table is empty.
00670 *
00671 *Entry:
00672 *  None
00673 *
00674 *Exit:
00675 *  return value = BOOL, TRUE if empty, FALSE otherwise
00676 *
00677 ***********************************************************************/
00678 BOOL
00679 CDbAlloc::IsEmpty()
00680 {
00681    UINT u;
00682
00683    for(u = 0; u < DIM(m_rganode); ++u){
00684      if(m_rganode[u] != NULL)
00685    return FALSE;
00686    }
00687
00688    return TRUE;
00689 }
00690
00691
00692 /***
00693 *PRIVATE CDbAlloc::Dump
00694 *Purpose:
00695 *  Print the current contents of the address instance table,
00696 *
00697 *Entry:
00698 *  None
00699 *
00700 *Exit:
00701 *  None
00702 *
00703 ***********************************************************************/
00704 void
00705 CDbAlloc::DumpInstTable()
00706 {
00707    UINT u;
00708    CAddrNode FAR* pn;
00709
00710    for(u = 0; u < DIM(m_rganode); ++u){
00711      for(pn = m_rganode[u]; pn != NULL; pn = pn->m_next){
00712         DumpInst(pn);
00713      }
00714    }
00715 }
00716
00717
00718 //---------------------------------------------------------------------
00719 //                implementation of CStdDbOutput
00720 //---------------------------------------------------------------------
00721
00722 IDbOutput FAR*
00723 CStdDbOutput::Create()
00724 {
00725    return (IDbOutput FAR*)new FAR CStdDbOutput();
00726 }
00727
00728 STDMETHODIMP
00729 CStdDbOutput::QueryInterface(REFIID riid, void FAR* FAR* ppv)
00730 {
00731    if(riid == IID_IUnknown){
00732      *ppv = this;
00733      AddRef();
00734      return NOERROR;
00735    }
00736    return E_NOINTERFACE;
00737 }
00738
00739 STDMETHODIMP_(ULONG)
00740 CStdDbOutput::AddRef()
00741 {
00742    return ++m_refs;
00743 }
00744
00745 STDMETHODIMP_(ULONG)
00746 CStdDbOutput::Release()
00747 {
00748    if(--m_refs == 0){
00749      delete this;
00750      return 0;
00751    }
00752    return m_refs;
00753 }
00754
00755 void _cdecl
00756 CStdDbOutput::Printf(char FAR* lpszFmt, ...)
00757 {
00758    va_list args;
00759    char szBuf[256];
00760 #if defined( OBSOLETE )
00761    char *pn, FAR* pf;
00762 static char rgchFmtBuf[128];
00763 static char rgchOutputBuf[128];
00764
00765    // copy the 'far' format string to a near buffer so we can use
00766    // a medium model vsprintf, which only supports near data pointers.
00767    //
00768    pn = rgchFmtBuf, pf=szFmt;
00769    while(*pf != '\0')
00770      *pn++ = *pf++;
00771    *pn = '\0';
00772 #endif
00773
00774    va_start(args, lpszFmt);
00775
00776 //    wvsprintf(rgchOutputBuf, rgchFmtBuf, args);
00777    wvsprintf(szBuf, lpszFmt, args);
00778
00779    OutputDebugString(szBuf);
00780 }
00781
00782 STDMETHODIMP_(void)
00783 CStdDbOutput::Assertion(
00784    BOOL cond,
00785    char FAR* szExpr,
00786    char FAR* szFile,
00787    UINT uLine,
00788    char FAR* szMsg)
00789 {
00790    if(cond)
00791      return;
00792
00793 #ifdef _DEBUG
00794    // following is from compobj.dll (ole2)
00795    FnAssert(szExpr, szMsg, szFile, uLine);
00796 #else
00797    // REVIEW: should be able to do something better that this...
00798    DebugBreak();
00799 #endif
00800 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/extend.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

extend.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _EXTEND_H
00021 #define _EXTEND_H
00022
00023 struct EXTENSION_NODE
00024 {
00025     GUID  GUID;
00026     _TCHAR  szDescription[256];
00027 };
00028
00029 enum EXTENSION_TYPE
00030 {
00031     NameSpaceExtension,
00032         ContextMenuExtension,
00033         ToolBarExtension,
00034         PropertySheetExtension,
00035         TaskExtension,
00036         DynamicExtension,
00037   DummyExtension
00038 };
00039
00040 struct EXTENDER_NODE
00041 {
00042     EXTENSION_TYPE  eType;
00043     GUID      guidNode;
00044     GUID      guidExtension;
00045     _TCHAR      szDescription[256];
00046 };
00047
00048 #endif // _EXTEND_H
00049
00050
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DTHandler Member List

This is the complete list of members for DTHandler, including all inherited members.
___WSAFDIsSet(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
__WSAFDIsSet(SOCKET s, FD_SET FAR *set, APIHook< int > &hook) | DTHandler | [protected, virtual]
_accept(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_bind(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_closesocket(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_connect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_dispatchTable | DTHandler | [private, static]
_gethostbyaddr(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_gethostbyname(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_gethostname(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_getpeername(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_getprotobyname(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_getprotobynumber(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_getservbyname(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_getservbyport(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_getsockname(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_getsockopt(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_htonl(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_htons(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_inet_addr(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_inet_ntoa(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_ioctlsocket(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_listen(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPAddressToString(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPCleanup(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPGetAddressByName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPGetServiceClassInfo(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPGetServiceClassNameByClassId(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPInstallServiceClass(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPLookupServiceBegin(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPLookupServiceEnd(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPLookupServiceNext(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPRemoveServiceClass(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPSetService(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_NSPStringToAddress(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_ntohl(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_ntohs(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_recv(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_recvfrom(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_select(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_send(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_sendto(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_setsockopt(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_shutdown(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_socket(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUCloseEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUCloseSocketHandle(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUCreateEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUCreateSocketHandle(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUFDIsSet(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUGetProviderPath(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUModifyIFSHandle(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUPostMessage(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUQueryBlockingCallback(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUQuerySocketHandleContext(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUQueueApc(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUResetEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WPUSetEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAccept(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAddressToStringA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAddressToStringW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAsyncGetHostByAddr(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAsyncGetHostByName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAsyncGetProtoByName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAsyncGetProtoByNumber(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAsyncGetServByName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAsyncGetServByPort(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAAsyncSelect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSACancelAsyncRequest(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSACancelBlockingCall(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSACleanup(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSACloseEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAConnect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSACreateEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSADuplicateSocketA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSADuplicateSocketW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAEnumNameSpaceProvidersA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAEnumNameSpaceProvidersW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAEnumNetworkEvents(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAEnumProtocolsA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAEnumProtocolsW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAEventSelect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAGetLastError(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAGetOverlappedResult(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAGetQOSByName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAGetServiceClassInfoA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAGetServiceClassInfoW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAGetServiceClassNameByClassIdA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAGetServiceClassNameByClassIdW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAHtonl(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAHtons(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAInstallServiceClassA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAInstallServiceClassW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAIoctl(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAIsBlocking(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAJoinLeaf(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSALookupServiceBeginA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSALookupServiceBeginW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSALookupServiceEnd(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSALookupServiceNextA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSALookupServiceNextW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSANtohl(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSANtohs(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSARecv(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSARecvDisconnect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSARecvFrom(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSARemoveServiceClass(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAResetEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASend(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASendDisconnect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASendTo(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASetBlockingHook(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASetEvent(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASetLastError(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASetServiceA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASetServiceW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASocketA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSASocketW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAStartup(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAStringToAddressA(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAStringToAddressW(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAUnhookBlockingHook(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSAWaitForMultipleEvents(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSCDeinstallProvider(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSCEnableNSProvider(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSCEnumProtocols(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSCGetProviderPath(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSCInstallNameSpace(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSCInstallProvider(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSCUnInstallNameSpace(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPAccept(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPAddressToString(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPAsyncSelect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPBind(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPCancelBlockingCall(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPCleanup(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPCloseSocket(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPConnect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPDuplicateSocket(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPEnumNetworkEvents(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPEventSelect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPGetOverlappedResult(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPGetPeerName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPGetQOSByName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPGetSockName(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPGetSockOpt(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPIoctl(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPJoinLeaf(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPListen(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPRecv(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPRecvDisconnect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPRecvFrom(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPSelect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPSend(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPSendDisconnect(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPSendTo(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPSetSockOpt(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPShutdown(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPSocket(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPStartup(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
_WSPStringToAddress(DTHandler *, APIHook< void > &, va_list) | DTHandler | [private, static]
accept(SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
bind(SOCKET s, const struct sockaddr FAR *name, int namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
closesocket(SOCKET s, APIHook< int > &hook) | DTHandler | [protected, virtual]
connect(SOCKET s, const struct sockaddr FAR *name, int namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
dispatch(int notificationCode, void *returnCode, char *LibraryName, bool preAPI, va_list vl) | DTHandler |
gethostbyaddr(const char FAR *addr, int len, int type, APIHook< HOSTENT > &hook) | DTHandler | [protected, virtual]
gethostbyname(const char FAR *name, APIHook< HOSTENT > &hook) | DTHandler | [protected, virtual]
gethostname(char FAR *name, int namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
getpeername(SOCKET s, struct sockaddr FAR *name, int FAR *namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
getprotobyname(const char FAR *name, APIHook< PROTOENT > &hook) | DTHandler | [protected, virtual]
getprotobynumber(int number, APIHook< PROTOENT > &hook) | DTHandler | [protected, virtual]
getservbyname(const char FAR *name, const char FAR *proto, APIHook< SERVENT > &hook) | DTHandler | [protected, virtual]
getservbyport(int port, const char FAR *proto, APIHook< SERVENT > &hook) | DTHandler | [protected, virtual]
getsockname(SOCKET s, struct sockaddr FAR *name, int FAR *namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
getsockopt(SOCKET s, int level, int optname, char FAR *optval, int FAR *optlen, APIHook< int > &hook) | DTHandler | [protected, virtual]
htonl(unsigned long hostlong, APIHook< unsigned long > &hook) | DTHandler | [protected, virtual]
htons(unsigned short hostshort, APIHook< unsigned short > &hook) | DTHandler | [protected, virtual]
inet_addr(const char FAR *cp, APIHook< unsigned long > &hook) | DTHandler | [protected, virtual]
inet_ntoa(struct in_addr in, APIHook< char FAR * > &hook) | DTHandler | [protected, virtual]
ioctlsocket(SOCKET s, long cmd, unsigned long FAR *argp, APIHook< int > &hook) | DTHandler | [protected, virtual]
listen(SOCKET s, int backlog, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPAddressToString(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPWSTR lpszAddressString, LPDWORD lpdwAddressStringLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPGetAddressByName(LPWSTR lpszServiceInstanceName, LPGUID lpServiceClassId, DWORD dwNameSpace, LPDWORD lpdwBufferLength, LPWSAQUERYSETW lpqsResults, DWORD dwResolution, LPWSTR lpszAliasBuffer, LPDWORD lpdwAliasBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPGetServiceClassInfo(IN LPGUID lpProviderId, IN OUT LPDWORD lpdwBufSize, IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPGetServiceClassNameByClassId(LPGUID lpServiceClassId, LPWSTR lpszServiceClassName, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPInstallServiceClass(LPGUID lpProviderId, LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPLookupServiceBegin(LPGUID lpProviderId, LPWSAQUERYSETW lpqsRestrictions, LPWSASERVICECLASSINFOW lpServiceClassInfo, DWORD dwControlFlags, LPHANDLE lphLookup, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPLookupServiceEnd(HANDLE hLookup, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPLookupServiceNext(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSET lpqsResults, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPRemoveServiceClass(IN LPGUID lpProviderId, IN LPGUID lpServiceClassId, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPSetService(LPGUID lpProviderId, LPWSASERVICECLASSINFOW lpServiceClassInfo, LPWSAQUERYSETW lpqsRegInfo, WSAESETSERVICEOP essOperation, DWORD dwControlFlags, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPStringToAddress(LPWSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
ntohl(unsigned long netlong, APIHook< unsigned long > &hook) | DTHandler | [protected, virtual]
ntohs(unsigned short netshort, APIHook< unsigned short > &hook) | DTHandler | [protected, virtual]
recv(SOCKET s, char FAR *buf, int len, int flags, APIHook< int > &hook) | DTHandler | [protected, virtual]
recvfrom(SOCKET s, char FAR *buf, int len, int flags, struct sockaddr FAR *from, int FAR *fromlen, APIHook< int > &hook) | DTHandler | [protected, virtual]
select(int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, const struct timeval FAR *timeout, APIHook< int > &hook) | DTHandler | [protected, virtual]
send(SOCKET s, const char FAR *buf, int len, int flags, APIHook< int > &hook) | DTHandler | [protected, virtual]
sendto(SOCKET s, const char FAR *buf, int len, int flags, const struct sockaddr FAR *to, int tolen, APIHook< int > &hook) | DTHandler | [protected, virtual]
setsockopt(SOCKET s, int level, int optname, const char FAR *optval, int optlen, APIHook< int > &hook) | DTHandler | [protected, virtual]
shutdown(SOCKET s, int how, APIHook< int > &hook) | DTHandler | [protected, virtual]
socket(int af, int type, int protocol, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WPUCloseEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WPUCloseSocketHandle(SOCKET s, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUCreateEvent(LPINT lpErrno, APIHook< WSAEVENT > &hook) | DTHandler | [protected, virtual]
WPUCreateSocketHandle(DWORD dwCatalogEntryId, DWORD dwContext, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WPUFDIsSet(SOCKET s, FD_SET FAR *set, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUGetProviderPath(LPGUID lpProviderId, LPWSTR lpszProviderDllPath, LPINT lpProviderDllPathLen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUModifyIFSHandle(DWORD dwCatalogEntryId, SOCKET ProposedHandle, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WPUPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WPUQueryBlockingCallback(DWORD dwCatalogEntryId, LPBLOCKINGCALLBACK FAR *lplpfnCallback, LPDWORD lpdwContext, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUQuerySocketHandleContext(SOCKET s, LPDWORD lpContext, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUQueueApc(LPWSATHREADID lpThreadId, LPWSAUSERAPC lpfnUserApc, DWORD dwContext, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUResetEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WPUSetEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WSAAccept(SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen, LPCONDITIONPROC lpfnCondition, unsigned long dwCallbackData, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSAAddressToStringA(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOA lpProtocolInfo, OUT LPTSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAAddressToStringW(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPTSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetHostByAddr(HWND hWnd, unsigned int wMsg, const char FAR *addr, int len, int type, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetHostByName(HWND hWnd, unsigned int wMsg, const char FAR *name, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetProtoByName(HWND hWnd, unsigned int wMsg, const char FAR *name, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetProtoByNumber(HWND hWnd, unsigned int wMsg, int number, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetServByName(HWND hWnd, unsigned int wMsg, const char FAR *name, const char FAR *proto, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetServByPort(HWND hWnd, unsigned int wMsg, int port, const char FAR *proto, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncSelect(SOCKET s, HWND hWnd, unsigned int wMsg, long lEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACancelAsyncRequest(HANDLE hAsyncTaskHandle, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACancelBlockingCall(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACleanup(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACloseEvent(WSAEVENT hEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAConnect(SOCKET s, const struct sockaddr FAR *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACreateEvent(APIHook< WSAEVENT > &hook) | DTHandler | [protected, virtual]
WSADuplicateSocketA(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOA lpProtocolInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSADuplicateSocketW(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOW lpProtocolInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEnumNameSpaceProvidersA(IN OUT LPDWORD lpdwBufferLength, OUT LPWSANAMESPACE_INFOA lpnspBuffer, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAEnumNameSpaceProvidersW(IN OUT LPDWORD lpdwBufferLength, OUT LPWSANAMESPACE_INFOW lpnspBuffer, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEnumProtocolsA(LPINT lpiProtocols, LPWSAPROTOCOL_INFOA lpProtocolBuffer, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEnumProtocolsW(LPINT lpiProtocols, LPWSAPROTOCOL_INFOW lpProtocolBuffer, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetLastError(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetOverlappedResult(SOCKET s, LPWSAOVERLAPPED lpOverlapped, LPDWORD lpcbTransfer, BOOL fWait, unsigned long *lpdwFlags, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetQOSByName(SOCKET s, LPWSABUF lpQOSName, LPQOS lpQOS, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassInfoA(LPGUID lpProviderId, LPGUID lpServiceClassId, LPDWORD lpdwBufferLength, LPWSASERVICECLASSINFOA lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassInfoW(LPGUID lpProviderId, LPGUID lpServiceClassId, LPDWORD lpdwBufferLength, LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassNameByClassIdA(LPGUID lpServiceClassId, LPSTR lpszServiceClassName, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassNameByClassIdW(LPGUID lpServiceClassId, LPWSTR lpszServiceClassName, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAHtonl(SOCKET s, unsigned long hostlong, unsigned long FAR *lpnetlong, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAHtons(SOCKET s, unsigned short hostshort, unsigned short FAR *lpnetshort, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAInstallServiceClassA(LPWSASERVICECLASSINFOA lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAInstallServiceClassW(LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAIsBlocking(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAJoinLeaf(SOCKET s, const struct sockaddr *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, DWORD dwFlags, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSALookupServiceBeginA(LPWSAQUERYSETA lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceEnd(HANDLE hLookup, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceNextA(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETA lpqsResults, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceNextW(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETW lpqsResults, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSANtohl(SOCKET s, unsigned long netlong, unsigned long *lphostlong, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSANtohs(SOCKET s, unsigned short netshort, unsigned short *lphostshort, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARecvDisconnect(SOCKET s, LPWSABUF lpInboundDisconnectData, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARecvFrom(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, struct sockaddr *lpFrom, LPINT lpFromlen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARemoveServiceClass(LPGUID lpServiceClassId, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAResetEvent(WSAEVENT hEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASend(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASendDisconnect(SOCKET s, LPWSABUF lpOutboundDisconnectData, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASendTo(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, const struct sockaddr *lpTo, int iTolen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASetBlockingHook(FARPROC lpBlockFunc, APIHook< FARPROC > &hook) | DTHandler | [protected, virtual]
WSASetEvent(WSAEVENT hEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASetLastError(int iError, APIHook< void > &hook) | DTHandler | [protected, virtual]
WSASetServiceA(LPWSAQUERYSETA lpqsRegInfo, WSAESETSERVICEOP essOperation, DWORD dwControlFlags, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSASetServiceW(LPWSAQUERYSETW lpqsRegInfo, WSAESETSERVICEOP essOperation, DWORD dwControlFlags, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSASocketA(int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocolInfo, GROUP g, DWORD dwFlags, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSASocketW(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAStringToAddressA(LPTSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOA lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAStringToAddressW(LPTSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAUnhookBlockingHook(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAWaitForMultipleEvents(DWORD cEvents, const WSAEVENT FAR *lphEvents, BOOL fWaitAll, DWORD dwTimeout, BOOL fAlertable, APIHook< DWORD > &hook) | DTHandler | [protected, virtual]
WSCDeinstallProvider(LPGUID lpProviderId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCEnableNSProvider(LPGUID lpProviderId, BOOL fEnable, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCEnumProtocols(LPINT lpiProtocols, LPWSAPROTOCOL_INFOW lpProtocolBuffer, LPDWORD lpdwBufferLength, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCGetProviderPath(LPGUID lpProviderId, LPWSTR lpszProviderDllPath, LPINT lpProviderDllPathLen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCInstallNameSpace(LPWSTR lpszIdentifier, LPWSTR lpszPathName, DWORD dwNameSpace, DWORD dwVersion, LPGUID lpProviderId, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCInstallProvider(const LPGUID lpProviderId, const LPWSTR lpszProviderDllPath, const LPWSAPROTOCOL_INFOW lpProtocolInfoList, DWORD dwNumberOfEntries, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCUnInstallNameSpace(LPGUID lpProviderId, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPAccept(SOCKET s, struct sockaddr FAR *addr, LPINT addrlen, LPCONDITIONPROC lpfnCondition, DWORD dwCallbackData, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSPAddressToString(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPWSTR lpszAddressString, LPDWORD lpdwAddressStringLength, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPAsyncSelect(SOCKET s, HWND hWnd, unsigned int wMsg, long lEvent, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPBind(SOCKET s, const struct sockaddr FAR *name, int namelen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPCancelBlockingCall(LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPCleanup(LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPCloseSocket(SOCKET s, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPConnect(SOCKET s, const struct sockaddr FAR *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPDuplicateSocket(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPGetOverlappedResult(SOCKET s, LPWSAOVERLAPPED lpOverlapped, LPDWORD lpcbTransfer, BOOL fWait, LPDWORD lpdwFlags, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WSPGetPeerName(SOCKET s, struct sockaddr FAR *name, LPINT namelen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPGetQOSByName(SOCKET s, LPWSABUF lpQOSName, LPQOS lpQOS, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WSPGetSockName(SOCKET s, struct sockaddr FAR *name, LPINT namelen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPGetSockOpt(SOCKET s, int level, int optname, char FAR *optval, LPINT optlen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPJoinLeaf(SOCKET s, const struct sockaddr FAR *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, DWORD dwFlags, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSPListen(SOCKET s, int backlog, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPRecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPRecvDisconnect(SOCKET s, LPWSABUF lpInboundDisconnectData, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPRecvFrom(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, struct sockaddr FAR *lpFrom, LPINT lpFromlen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSelect(int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, const struct timeval FAR *timeout, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSend(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSendDisconnect(SOCKET s, LPWSABUF lpOutboundDisconnectData, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSendTo(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, const struct sockaddr FAR *lpTo, int iTolen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSetSockOpt(SOCKET s, int level, int optname, const char FAR *optval, int optlen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPShutdown(SOCKET s, int how, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSocket(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSPStartup(WORD wVersionRequested, LPWSPDATA lpWSPData, LPWSAPROTOCOL_INFOW lpProtocolInfo, WSPUPCALLTABLE UpcallTable, LPWSPPROC_TABLE lpProcTable, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPStringToAddress(LPWSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
Generated on Wed Nov 13 2024 16:57:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCertEncodeAltName Member List

This is the complete list of members for CCertEncodeAltName, including all inherited members.
_Cleanup(VOID) | CCertEncodeAltName | [private]
_enumNameType enum name | CCertEncodeAltName | [private]
_MapName(IN BOOL fEncode, IN LONG NameIndex, OUT CERT_ALT_NAME_ENTRY **ppName) | CCertEncodeAltName | [private]
_NameType(IN DWORD NameChoice) | CCertEncodeAltName | [private]
_SetErrorInfo(IN HRESULT hrError, IN WCHAR const *pwszDescription) | CCertEncodeAltName | [private]
_VerifyName(IN LONG NameIndex) | CCertEncodeAltName | [private]
CCertEncodeAltName() | CCertEncodeAltName |
Encode(BSTR *pstrBinary) | CCertEncodeAltName |
enumAnsi enum value | CCertEncodeAltName | [private]
enumBlob enum value | CCertEncodeAltName | [private]
enumNameType typedef | CCertEncodeAltName | [private]
enumOther enum value | CCertEncodeAltName | [private]
enumUnicode enum value | CCertEncodeAltName | [private]
enumUnknown enum value | CCertEncodeAltName | [private]
GetName(LONG NameIndex, BSTR __RPC_FAR *pstrName) | CCertEncodeAltName |
GetNameChoice(LONG NameIndex, LONG __RPC_FAR *pNameChoice) | CCertEncodeAltName |
m_aValue | CCertEncodeAltName | [private]
m_cValue | CCertEncodeAltName | [private]
m_DecodeInfo | CCertEncodeAltName | [private]
m_DecodeLength | CCertEncodeAltName | [private]
m_fConstructing | CCertEncodeAltName | [private]
Reset(LONG NameCount) | CCertEncodeAltName |
SetNameEntry(LONG NameIndex, LONG NameChoice, BSTR const strName) | CCertEncodeAltName |
~CCertEncodeAltName() | CCertEncodeAltName |
Generated on Wed Nov 13 2024 16:55:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/Copy.c Source File

  • Multimedia
  • Gdi
  • WinCap32

Copy.c

Go to the documentation of this file.
00001 //**********************************************************************
00002 //
00003 //  copy.c
00004 //
00005 //  Source file for Device-Independent Bitmap (DIB) API.  Provides
00006 //  the following functions:
00007 //
00008 //  CopyWindowToDIB()   - Copies a window to a DIB
00009 //  CopyScreenToDIB()   - Copies entire screen to a DIB
00010 //  CopyWindowToBitmap()- Copies a window to a standard Bitmap
00011 //  CopyScreenToBitmap()- Copies entire screen to a standard Bitmap
00012 //  PaintDIB()          - Displays DIB in the specified DC
00013 //  PaintBitmap()       - Displays bitmap in the specified DC
00014 //
00015 //  The following functions are called from DIBUTIL.C:
00016 //
00017 //  DIBToBitmap()       - Creates a bitmap from a DIB
00018 //  BitmapToDIB()       - Creates a DIB from a bitmap
00019 //  DIBWidth()          - Gets the width of the DIB
00020 //  DIBHeight()         - Gets the height of the DIB
00021 //  CreateDIBPalette()  - Gets the DIB's palette
00022 //  GetSystemPalette()  - Gets the current palette
00023 //
00024 // Written by Microsoft Product Support Services, Developer Support.
00025 // Copyright 1991 - 2000 Microsoft Corporation. All rights reserved.
00026 //**********************************************************************
00027
00028 #define     STRICT      // enable strict type checking
00029
00030 #include <WINDOWS.H>
00031 #include "DIBUTIL.H"
00032 #include "DIBAPI.H"
00033
00034 /*************************************************************************
00035  *
00036  * CopyWindowToDIB()
00037  *
00038  * Parameters:
00039  *
00040  * HWND hWnd        - specifies the window
00041  *
00042  * WORD fPrintArea  - specifies the window area to copy into the device-
00043  *                    independent bitmap
00044  *
00045  * Return Value:
00046  *
00047  * HDIB             - identifies the device-independent bitmap
00048  *
00049  * Description:
00050  *
00051  * This function copies the specified part(s) of the window to a device-
00052  * independent bitmap.
00053  *
00054  ************************************************************************/
00055
00056
00057 HDIB CopyWindowToDIB(HWND hWnd, WORD fPrintArea)
00058 {
00059    HDIB     hDIB = NULL;  // handle to DIB
00060
00061    // check for a valid window handle
00062
00063     if (!hWnd)
00064         return NULL;
00065
00066     switch (fPrintArea)
00067     {
00068         case PW_WINDOW: // copy entire window
00069         {
00070             RECT    rectWnd;
00071
00072             // get the window rectangle
00073
00074             GetWindowRect(hWnd, &rectWnd);
00075
00076             // get the DIB of the window by calling
00077             // CopyScreenToDIB and passing it the window rect
00078
00079             hDIB = CopyScreenToDIB(&rectWnd);
00080             break;
00081         }
00082
00083         case PW_CLIENT: // copy client area
00084         {
00085             RECT    rectClient;
00086             POINT   pt1, pt2;
00087
00088             // get the client area dimensions
00089
00090             GetClientRect(hWnd, &rectClient);
00091
00092             // convert client coords to screen coords
00093
00094             pt1.x = rectClient.left;
00095             pt1.y = rectClient.top;
00096             pt2.x = rectClient.right;
00097             pt2.y = rectClient.bottom;
00098             ClientToScreen(hWnd, &pt1);
00099             ClientToScreen(hWnd, &pt2);
00100             rectClient.left = pt1.x;
00101             rectClient.top = pt1.y;
00102             rectClient.right = pt2.x;
00103             rectClient.bottom = pt2.y;
00104
00105             // get the DIB of the client area by calling
00106             // CopyScreenToDIB and passing it the client rect
00107
00108             hDIB = CopyScreenToDIB(&rectClient);
00109             break;
00110         }
00111
00112         default:    // invalid print area
00113             return NULL;
00114     }
00115
00116    // return the handle to the DIB
00117
00118    return hDIB;
00119 }
00120
00121
00122 /*************************************************************************
00123  *
00124  * CopyScreenToDIB()
00125  *
00126  * Parameter:
00127  *
00128  * LPRECT lpRect    - specifies the window
00129  *
00130  * Return Value:
00131  *
00132  * HDIB             - identifies the device-independent bitmap
00133  *
00134  * Description:
00135  *
00136  * This function copies the specified part of the screen to a device-
00137  * independent bitmap.
00138  *
00139  ************************************************************************/
00140
00141 HDIB CopyScreenToDIB(LPRECT lpRect)
00142 {
00143     HBITMAP     hBitmap;        // handle to device-dependent bitmap
00144     HPALETTE    hPalette;       // handle to palette
00145     HDIB        hDIB = NULL;    // handle to DIB
00146
00147     // get the device-dependent bitmap in lpRect by calling
00148     //  CopyScreenToBitmap and passing it the rectangle to grab
00149
00150   // Check for a valid rect
00151   if (!lpRect)
00152     return NULL;
00153
00154     hBitmap = CopyScreenToBitmap(lpRect);
00155
00156     // check for a valid bitmap handle
00157
00158     if (!hBitmap)
00159       return NULL;
00160
00161     // get the current palette
00162
00163     hPalette = GetSystemPalette();
00164
00165     // convert the bitmap to a DIB
00166
00167     hDIB = BitmapToDIB(hBitmap, hPalette);
00168
00169     // clean up
00170
00171     DeleteObject(hPalette);
00172     DeleteObject(hBitmap);
00173
00174     // return handle to the packed-DIB
00175     return hDIB;
00176 }
00177
00178
00179 /*************************************************************************
00180  *
00181  * CopyWindowToBitmap()
00182  *
00183  * Parameters:
00184  *
00185  * HWND hWnd        - specifies the window
00186  *
00187  * WORD fPrintArea  - specifies the window area to copy into the device-
00188  *                    dependent bitmap
00189  *
00190  * Return Value:
00191  *
00192  * HDIB         - identifies the device-dependent bitmap
00193  *
00194  * Description:
00195  *
00196  * This function copies the specified part(s) of the window to a device-
00197  * dependent bitmap.
00198  *
00199  *
00200  ************************************************************************/
00201
00202 HBITMAP CopyWindowToBitmap(HWND hWnd, WORD fPrintArea)
00203 {
00204     HBITMAP     hBitmap = NULL;  // handle to device-dependent bitmap
00205
00206     // check for a valid window handle
00207
00208     if (!hWnd)
00209         return NULL;
00210
00211     switch (fPrintArea)
00212     {
00213         case PW_WINDOW: // copy entire window
00214         {
00215             RECT    rectWnd;
00216
00217             // get the window rectangle
00218
00219             GetWindowRect(hWnd, &rectWnd);
00220
00221             // get the bitmap of that window by calling
00222             // CopyScreenToBitmap and passing it the window rect
00223
00224             hBitmap = CopyScreenToBitmap(&rectWnd);
00225             break;
00226         }
00227
00228
00229         case PW_CLIENT: // copy client area
00230         {
00231             RECT rectClient;
00232             POINT pt1, pt2;
00233
00234             // get client dimensions
00235
00236             GetClientRect(hWnd, &rectClient);
00237
00238             // convert client coords to screen coords
00239
00240             pt1.x = rectClient.left;
00241             pt1.y = rectClient.top;
00242             pt2.x = rectClient.right;
00243             pt2.y = rectClient.bottom;
00244             ClientToScreen(hWnd, &pt1);
00245             ClientToScreen(hWnd, &pt2);
00246             rectClient.left = pt1.x;
00247             rectClient.top = pt1.y;
00248             rectClient.right = pt2.x;
00249             rectClient.bottom = pt2.y;
00250
00251             // get the bitmap of the client area by calling
00252             // CopyScreenToBitmap and passing it the client rect
00253
00254             hBitmap = CopyScreenToBitmap(&rectClient);
00255             break;
00256         }
00257
00258         default:    // invalid print area
00259             return NULL;
00260     }
00261
00262     // return handle to the bitmap
00263
00264    return hBitmap;
00265 }
00266
00267
00268 /*************************************************************************
00269  *
00270  * CopyScreenToBitmap()
00271  *
00272  * Parameter:
00273  *
00274  * LPRECT lpRect    - specifies the window
00275  *
00276  * Return Value:
00277  *
00278  * HDIB             - identifies the device-dependent bitmap
00279  *
00280  * Description:
00281  *
00282  * This function copies the specified part of the screen to a device-
00283  * dependent bitmap.
00284  *
00285  *
00286  ************************************************************************/
00287
00288 HBITMAP CopyScreenToBitmap(LPRECT lpRect)
00289 {
00290     HDC         hScrDC, hMemDC;         // screen DC and memory DC
00291     HBITMAP     hBitmap, hOldBitmap;    // handles to deice-dependent bitmaps
00292     int         nX, nY, nX2, nY2;       // coordinates of rectangle to grab
00293     int         nWidth, nHeight;        // DIB width and height
00294     int         xScrn, yScrn;           // screen resolution
00295
00296     // check for an empty rectangle
00297
00298     if (IsRectEmpty(lpRect))
00299       return NULL;
00300
00301     // create a DC for the screen and create
00302     // a memory DC compatible to screen DC
00303
00304     hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL);
00305     hMemDC = CreateCompatibleDC(hScrDC);
00306
00307     // get points of rectangle to grab
00308
00309     nX = lpRect->left;
00310     nY = lpRect->top;
00311     nX2 = lpRect->right;
00312     nY2 = lpRect->bottom;
00313
00314     // get screen resolution
00315
00316     xScrn = GetDeviceCaps(hScrDC, HORZRES);
00317     yScrn = GetDeviceCaps(hScrDC, VERTRES);
00318
00319     //make sure bitmap rectangle is visible
00320
00321     if (nX < 0)
00322         nX = 0;
00323     if (nY < 0)
00324         nY = 0;
00325     if (nX2 > xScrn)
00326         nX2 = xScrn;
00327     if (nY2 > yScrn)
00328         nY2 = yScrn;
00329
00330     nWidth = nX2 - nX;
00331     nHeight = nY2 - nY;
00332
00333     // create a bitmap compatible with the screen DC
00334     hBitmap = CreateCompatibleBitmap(hScrDC, nWidth, nHeight);
00335
00336     // select new bitmap into memory DC
00337     hOldBitmap = (HBITMAP) SelectObject(hMemDC, hBitmap);
00338
00339     // bitblt screen DC to memory DC
00340     BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, nX, nY, SRCCOPY);
00341
00342     // select old bitmap back into memory DC and get handle to
00343     // bitmap of the screen
00344
00345     hBitmap = (HBITMAP)  SelectObject(hMemDC, hOldBitmap);
00346
00347     // clean up
00348
00349     DeleteDC(hScrDC);
00350     DeleteDC(hMemDC);
00351
00352     // return handle to the bitmap
00353
00354     return hBitmap;
00355 }
00356
00357
00358 /*************************************************************************
00359  *
00360  * PaintDIB()
00361  *
00362  * Parameters:
00363  *
00364  * HDC hDC          - DC to do output to
00365  *
00366  * LPRECT lpDCRect  - rectangle on DC to do output to
00367  *
00368  * HDIB hDIB        - handle to global memory with a DIB spec
00369  *                    in it followed by the DIB bits
00370  *
00371  * LPRECT lpDIBRect - rectangle of DIB to output into lpDCRect
00372  *
00373  * Return Value:
00374  *
00375  * BOOL             - TRUE if DIB was drawn, FALSE otherwise
00376  *
00377  * Description:
00378  *   Painting routine for a DIB.  Calls StretchDIBits() or
00379  *   SetDIBitsToDevice() to paint the DIB.  The DIB is
00380  *   output to the specified DC, at the coordinates given
00381  *   in lpDCRect.  The area of the DIB to be output is
00382  *   given by lpDIBRect.
00383  *
00384  * NOTE: This function always selects the palette as background. Before
00385  * calling this function, be sure your palette is selected to desired
00386  * priority (foreground or background).
00387  *
00388  *
00389  ************************************************************************/
00390
00391 BOOL PaintDIB(HDC hDC, LPRECT lpDCRect, HDIB hDIB, LPRECT lpDIBRect,
00392         HPALETTE hPal)
00393 {
00394     LPSTR        lpDIBHdr;           // Pointer to BITMAPINFOHEADER
00395     LPSTR        lpDIBBits;          // Pointer to DIB bits
00396     BOOL         bSuccess=FALSE;     // Success/fail flag
00397     HPALETTE     hOldPal=NULL;       // Previous palette
00398
00399     // Check for valid DIB handle
00400
00401     if (!hDIB)
00402         return FALSE;
00403
00404     // Lock down the DIB, and get a pointer to the beginning of the bit
00405     // buffer
00406
00407     lpDIBHdr  = (LPSTR) GlobalLock(hDIB);
00408     lpDIBBits = FindDIBBits(lpDIBHdr);
00409
00410     // Select and realize our palette as background
00411
00412     if (hPal)
00413     {
00414         hOldPal = SelectPalette(hDC, hPal, TRUE);
00415         RealizePalette(hDC);
00416     }
00417
00418     // Make sure to use the stretching mode best for color pictures
00419
00420     SetStretchBltMode(hDC, COLORONCOLOR);
00421
00422     // Determine whether to call StretchDIBits() or SetDIBitsToDevice()
00423
00424     if ((RECTWIDTH(lpDCRect)  == RECTWIDTH(lpDIBRect)) &&
00425             (RECTHEIGHT(lpDCRect) == RECTHEIGHT(lpDIBRect)))
00426     {
00427         bSuccess = SetDIBitsToDevice(hDC, lpDCRect->left, lpDCRect->top,
00428                 RECTWIDTH(lpDCRect), RECTHEIGHT(lpDCRect), lpDIBRect->left,
00429                 (int)DIBHeight(lpDIBHdr) - lpDIBRect->top -
00430                 RECTHEIGHT(lpDIBRect), 0, DIBHeight(lpDIBHdr), lpDIBBits,
00431                 (LPBITMAPINFO)lpDIBHdr, DIB_RGB_COLORS);
00432     }
00433     else
00434         bSuccess = StretchDIBits(hDC, lpDCRect->left, lpDCRect->top,
00435                 RECTWIDTH(lpDCRect), RECTHEIGHT(lpDCRect), lpDIBRect->left,
00436                 lpDIBRect->top, RECTWIDTH(lpDIBRect), RECTHEIGHT(lpDIBRect),
00437                 lpDIBBits, (LPBITMAPINFO)lpDIBHdr, DIB_RGB_COLORS, SRCCOPY);
00438
00439     // Unlock the memory block
00440
00441     GlobalUnlock(hDIB);
00442
00443     // Reselect old palette
00444
00445     if (hOldPal)
00446      SelectPalette(hDC, hOldPal, FALSE);
00447
00448     // Return with success/fail flag
00449     return bSuccess;
00450 }
00451
00452
00453 /*************************************************************************
00454  *
00455  * PaintBitmap()
00456  *
00457  * Parameters:
00458  *
00459  * HDC hDC          - DC to do output to
00460  *
00461  * LPRECT lpDCRect  - rectangle on DC to do output to
00462  *
00463  * HBITMAP hDDB     - handle to device-dependent bitmap (DDB)
00464  *
00465  * LPRECT lpDDBRect - rectangle of DDB to output into lpDCRect
00466  *
00467  * HPALETTE hPalette - handle to the palette to use with hDDB
00468  *
00469  * Return Value:
00470  *
00471  * BOOL             - TRUE if bitmap was drawn, FLASE otherwise
00472  *
00473  * Description:
00474  *
00475  * Painting routine for a DDB.  Calls BitBlt() or
00476  * StretchBlt() to paint the DDB.  The DDB is
00477  * output to the specified DC, at the coordinates given
00478  * in lpDCRect.  The area of the DDB to be output is
00479  * given by lpDDBRect.  The specified palette is used.
00480  *
00481  * NOTE: This function always selects the palette as background. Before
00482  * calling this function, be sure your palette is selected to desired
00483  * priority (foreground or background).
00484  *
00485  ************************************************************************/
00486
00487 BOOL PaintBitmap(HDC hDC, LPRECT lpDCRect, HBITMAP hDDB,  LPRECT lpDDBRect,
00488         HPALETTE hPal)
00489 {
00490     HDC         hMemDC;            // Handle to memory DC
00491     HBITMAP     hOldBitmap;        // Handle to previous bitmap
00492     HPALETTE    hOldPal1 = NULL;   // Handle to previous palette
00493     HPALETTE    hOldPal2 = NULL;   // Handle to previous palette
00494     BOOL        bSuccess = FALSE;  // Success/fail flag
00495
00496     // Create a memory DC
00497
00498     hMemDC = CreateCompatibleDC (hDC);
00499
00500     // If this failed, return FALSE
00501
00502     if (!hMemDC)
00503         return FALSE;
00504
00505     // If we have a palette, select and realize it
00506
00507     if (hPal)
00508     {
00509         hOldPal1 = SelectPalette(hMemDC, hPal, TRUE);
00510         hOldPal2 = SelectPalette(hDC, hPal, TRUE);
00511         RealizePalette(hDC);
00512     }
00513
00514     // Select bitmap into the memory DC
00515
00516     hOldBitmap = (HBITMAP) SelectObject (hMemDC, hDDB);
00517
00518     // Make sure to use the stretching mode best for color pictures
00519
00520     SetStretchBltMode (hDC, COLORONCOLOR);
00521
00522     // Determine whether to call StretchBlt() or BitBlt()
00523     if ((RECTWIDTH(lpDCRect)  == RECTWIDTH(lpDDBRect)) &&
00524             (RECTHEIGHT(lpDCRect) == RECTHEIGHT(lpDDBRect)))
00525         bSuccess = BitBlt(hDC, lpDCRect->left, lpDCRect->top,
00526                 lpDCRect->right - lpDCRect->left,
00527                 lpDCRect->bottom - lpDCRect->top, hMemDC, lpDDBRect->left,
00528                 lpDDBRect->top, SRCCOPY);
00529     else
00530         bSuccess = StretchBlt(hDC, lpDCRect->left,  lpDCRect->top,
00531                 lpDCRect->right - lpDCRect->left,
00532                 lpDCRect->bottom - lpDCRect->top, hMemDC, lpDDBRect->left,
00533                 lpDDBRect->top,  lpDDBRect->right - lpDDBRect->left,
00534                 lpDDBRect->bottom - lpDDBRect->top, SRCCOPY);
00535
00536     // Clean up
00537
00538     SelectObject(hMemDC, hOldBitmap);
00539
00540     if (hOldPal1)
00541         SelectPalette (hMemDC, hOldPal1, FALSE);
00542
00543     if (hOldPal2)
00544         SelectPalette (hDC, hOldPal2, FALSE);
00545
00546     DeleteDC (hMemDC);
00547
00548     // Return with success/fail flag
00549
00550     return bSuccess;
00551 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/guids.h Source File

  • SysMgmt
  • MMC
  • Multisel

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019
00020 // {C3D863FF-5135-4cfc-8C11-E7396DA15D03}
00021 DEFINE_GUID(CLSID_CComponentData,
00022 0xc3d863ff, 0x5135, 0x4cfc, 0x8c, 0x11, 0xe7, 0x39, 0x6d, 0xa1, 0x5d, 0x3);
00023
00024 // {7F5AAE1A-0021-46b7-96E3-FE5D16304BE9}
00025 DEFINE_GUID(CLSID_CSnapinAbout,
00026 0x7f5aae1a, 0x21, 0x46b7, 0x96, 0xe3, 0xfe, 0x5d, 0x16, 0x30, 0x4b, 0xe9);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/BitStr.Cpp Source File

  • Security
  • CertServices
  • Encode

BitStr.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        crldist.cpp
00007 //
00008 // Contents:    Cert Server Extension Encoding/Decoding implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013
00014 #pragma hdrstop
00015
00016 #include <assert.h>
00017 #include "resource.h"
00018 #include "bitstr.h"
00019 #include "celib.h"
00020
00021
00022 //+--------------------------------------------------------------------------
00023 // CCertEncodeBitString::~CCertEncodeBitString -- destructor
00024 //
00025 // free memory associated with this instance
00026 //+--------------------------------------------------------------------------
00027
00028 CCertEncodeBitString::~CCertEncodeBitString()
00029 {
00030     _Cleanup();
00031 }
00032
00033
00034 //+--------------------------------------------------------------------------
00035 // CCertEncodeBitString::_Cleanup -- release all resources
00036 //
00037 // free memory associated with this instance
00038 //+--------------------------------------------------------------------------
00039
00040 VOID
00041 CCertEncodeBitString::_Cleanup()
00042 {
00043     if (NULL != m_DecodeInfo)
00044     {
00045   LocalFree(m_DecodeInfo);
00046   m_DecodeInfo = NULL;
00047     }
00048 }
00049
00050
00051 //+--------------------------------------------------------------------------
00052 // CCertEncodeBitString::Decode -- Decode BitString
00053 //
00054 // Returns S_OK on success.
00055 //+--------------------------------------------------------------------------
00056
00057 STDMETHODIMP
00058 CCertEncodeBitString::Decode(
00059     /* [in] */ BSTR const strBinary)
00060 {
00061     HRESULT hr = S_OK;
00062     DWORD cbBitString;
00063
00064     _Cleanup();
00065
00066     if (NULL == strBinary)
00067     {
00068   hr = E_POINTER;
00069   ceERRORPRINTLINE("NULL parm", hr);
00070   goto error;
00071     }
00072
00073     // Decode CRYPT_BIT_BLOB:
00074
00075     if (!ceDecodeObject(
00076         X509_ASN_ENCODING,
00077         X509_BITS,
00078         (BYTE *) strBinary,
00079         SysStringByteLen(strBinary),
00080         FALSE,
00081         (VOID **) &m_DecodeInfo,
00082         &cbBitString))
00083     {
00084   hr = ceHLastError();
00085   ceERRORPRINTLINE("ceDecodeObject", hr);
00086   goto error;
00087     }
00088
00089 error:
00090     if (S_OK != hr)
00091     {
00092   _Cleanup();
00093     }
00094     return(_SetErrorInfo(hr, L"CCertEncodeBitString::Decode"));
00095 }
00096
00097
00098 //+--------------------------------------------------------------------------
00099 // CCertEncodeBitString::GetBitCount -- Get the Distribution Name Count
00100 //
00101 // Returns S_OK on success.
00102 //+--------------------------------------------------------------------------
00103
00104 STDMETHODIMP
00105 CCertEncodeBitString::GetBitCount(
00106     /* [out, retval] */ LONG __RPC_FAR *pBitCount)
00107 {
00108     HRESULT hr = E_INVALIDARG;
00109
00110     if (NULL == pBitCount)
00111     {
00112   hr = E_POINTER;
00113   ceERRORPRINTLINE("NULL parm", hr);
00114   goto error;
00115     }
00116     if (NULL == m_DecodeInfo)
00117     {
00118   ceERRORPRINTLINE("bad parameter", hr);
00119   goto error;
00120     }
00121     *pBitCount = m_DecodeInfo->cbData * 8 - m_DecodeInfo->cUnusedBits;
00122     hr = S_OK;
00123
00124 error:
00125     return(_SetErrorInfo(hr, L"CCertEncodeBitString::GetBitCount"));
00126 }
00127
00128
00129 //+--------------------------------------------------------------------------
00130 // CCertEncodeBitString::GetBitString -- Get the bits
00131 //
00132 // Returns S_OK on success.
00133 //+--------------------------------------------------------------------------
00134
00135 STDMETHODIMP
00136 CCertEncodeBitString::GetBitString(
00137     /* [out, retval] */ BSTR __RPC_FAR *pstrBitString)
00138 {
00139     HRESULT hr = E_INVALIDARG;
00140
00141     if (NULL == pstrBitString)
00142     {
00143   hr = E_POINTER;
00144   ceERRORPRINTLINE("NULL parm", hr);
00145   goto error;
00146     }
00147     ceFreeBstr(pstrBitString);
00148
00149     if (NULL == m_DecodeInfo)
00150     {
00151   ceERRORPRINTLINE("bad parameter", hr);
00152   goto error;
00153     }
00154
00155     hr = E_OUTOFMEMORY;
00156     if (!ceConvertWszToBstr(
00157       pstrBitString,
00158       (WCHAR const *) m_DecodeInfo->pbData,
00159       m_DecodeInfo->cbData))
00160     {
00161   ceERRORPRINTLINE("no memory", hr);
00162   goto error;
00163     }
00164     hr = S_OK;
00165
00166 error:
00167     return(_SetErrorInfo(hr, L"CCertEncodeBitString::GetBitString"));
00168 }
00169
00170
00171 //+--------------------------------------------------------------------------
00172 // CCertEncodeBitString::Encode -- Encode BitString
00173 //
00174 // Returns S_OK on success.
00175 //+--------------------------------------------------------------------------
00176
00177 STDMETHODIMP
00178 CCertEncodeBitString::Encode(
00179     /* [in] */ LONG BitCount,
00180     /* [in] */ BSTR strBitString,
00181     /* [out, retval] */ BSTR __RPC_FAR *pstrBinary)
00182 {
00183     HRESULT hr = S_OK;
00184     CRYPT_BIT_BLOB BitString;
00185     LONG cbData;
00186     BYTE *pbEncoded = NULL;
00187     DWORD cbEncoded;
00188
00189     if (NULL != pstrBinary)
00190     {
00191   ceFreeBstr(pstrBinary);
00192     }
00193     if (NULL == strBitString || NULL == pstrBinary)
00194     {
00195   hr = E_POINTER;
00196   ceERRORPRINTLINE("NULL parm", hr);
00197   goto error;
00198     }
00199     if (CENCODEMAX < BitCount || 0 > BitCount)
00200     {
00201   hr = E_INVALIDARG;
00202   ceERRORPRINTLINE("bad count parameter", hr);
00203   goto error;
00204     }
00205
00206     cbData = SysStringByteLen(strBitString);
00207     if (BitCount > cbData * 8 || BitCount <= (cbData - 1) * 8)
00208     {
00209   hr = E_INVALIDARG;
00210   ceERRORPRINTLINE("bad BitCount parameter", hr);
00211   goto error;
00212     }
00213     BitString.cbData = cbData;
00214     BitString.pbData = (BYTE *) strBitString;
00215     BitString.cUnusedBits = cbData * 8 - BitCount;
00216
00217     // Encode CRYPT_BIT_BLOB:
00218     // If cUnusedBits is 0, encode as X509_KEY_USAGE to ensure that trailing
00219     // zero bytes are stripped, and trailing zero bits in the last byte are
00220     // counted and that count is encoded into the CRYPT_BIT_BLOB.
00221
00222     if (!ceEncodeObject(
00223         X509_ASN_ENCODING,
00224         0 == BitString.cUnusedBits? X509_KEY_USAGE : X509_BITS,
00225         &BitString,
00226         0,
00227         FALSE,
00228         &pbEncoded,
00229         &cbEncoded))
00230     {
00231   hr = ceHLastError();
00232   ceERRORPRINTLINE("ceEncodeObject", hr);
00233   goto error;
00234     }
00235     if (!ceConvertWszToBstr(pstrBinary, (WCHAR const *) pbEncoded, cbEncoded))
00236     {
00237   hr = E_OUTOFMEMORY;
00238   ceERRORPRINTLINE("ceConvertWszToBstr", hr);
00239   goto error;
00240     }
00241
00242 error:
00243     if (NULL != pbEncoded)
00244     {
00245   LocalFree(pbEncoded);
00246     }
00247     return(_SetErrorInfo(hr, L"CCertEncodeBitString::Encode"));
00248 }
00249
00250
00251 //+--------------------------------------------------------------------------
00252 // CCertEncodeStringArray::_SetErrorInfo -- set error object information
00253 //
00254 // Returns passed HRESULT
00255 //+--------------------------------------------------------------------------
00256
00257 HRESULT
00258 CCertEncodeBitString::_SetErrorInfo(
00259     IN HRESULT hrError,
00260     IN WCHAR const *pwszDescription)
00261 {
00262     assert(FAILED(hrError) || S_OK == hrError || S_FALSE == hrError);
00263     if (FAILED(hrError))
00264     {
00265   HRESULT hr;
00266
00267   hr = ceDispatchSetErrorInfo(
00268           hrError,
00269           pwszDescription,
00270           wszCLASS_CERTENCODEBITSTRING,
00271           &IID_ICertEncodeBitString);
00272   assert(hr == hrError);
00273     }
00274     return(hrError);
00275 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/space.h Source File

  • SysMgmt
  • MMC
  • CMenu

space.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SPACE_H
00021 #define _SPACE_H
00022
00023 #include "DeleBase.h"
00024 #include "CompData.h"
00025
00026 class CRocket : public CDelegationBase {
00027 public:
00028     CRocket();
00029
00030     virtual ~CRocket();
00031
00032     virtual const _TCHAR *GetDisplayName(int nCol = 0);
00033     virtual const GUID & getNodeType() { return thisGuid; }
00034     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00035
00036 public:
00037     // virtual functions go here (for MMCN_*)
00038     virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed);
00039     virtual HRESULT OnMenuCommand(IConsole *pConsole, long lCommandID);
00040
00041     void Initialize(_TCHAR *szName, LONG lWeight, LONG lHeight, LONG lPayload);
00042
00043 private:
00044     // {29743810-4C4B-11d2-89D8-000021473128}
00045     static const GUID thisGuid;
00046
00047     _TCHAR *szName;
00048     LONG   lWeight;
00049     LONG   lHeight;
00050     LONG   lPayload;
00051     enum {RUNNING, PAUSED, STOPPED} iStatus;
00052     enum { IDM_START_SPACE = 100, IDM_PAUSE_SPACE, IDM_STOP_SPACE };
00053 };
00054
00055 class CSpaceVehicle : public CDelegationBase {
00056 public:
00057     CSpaceVehicle();
00058
00059     virtual ~CSpaceVehicle();
00060
00061     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Future Vehicles"); }
00062     virtual const GUID & getNodeType() { return thisGuid; }
00063     virtual const int GetBitmapIndex() { return INDEX_SPACEICON; }
00064
00065 public:
00066     // virtual functions go here (for MMCN_*)
00067     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00068     virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed);
00069     virtual HRESULT OnMenuCommand(IConsole *pConsole, long lCommandID);
00070
00071 private:
00072     enum { IDM_NEW_SPACE = 4 };
00073
00074     // {29743810-4C4B-11d2-89D8-000021473128}
00075     static const GUID thisGuid;
00076
00077 private:
00078     enum { NUMBER_OF_CHILDREN = 4 };
00079     CRocket *children[NUMBER_OF_CHILDREN];
00080 };
00081
00082 #endif // _SPACE_H
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/Updatereceipt.Cpp Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

Updatereceipt.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: UpdateReceipt.cpp
00003 //
00004 // Description: Implementation of CUpdateReceipt
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022 #include "stdafx.h"
00023 #include "Account.h"
00024 #include "UpdateReceipt.h"
00025
00026 #include <comsvcs.h>
00027 #include <adoid.h>
00028 #include <adoint.h>
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 //
00032
00033 STDMETHODIMP CUpdateReceipt::InterfaceSupportsErrorInfo(REFIID riid)
00034 {
00035   static const IID* arr[] =
00036   {
00037     &IID_IUpdateReceipt,
00038   };
00039
00040   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00041   {
00042     if (::InlineIsEqualGUID(*arr[i],riid))
00043       return S_OK;
00044   }
00045   return S_FALSE;
00046 }
00047
00048 //F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++
00049 //
00050 // Function: Update
00051 //
00052 // Update the database next receipt number when 100 receipts have been issued
00053 // by GetReceipt
00054 //
00055 // Args:  plReceiptNo:  Receipt Number
00056 //
00057 // Returns:  S_OK or E_FAIL
00058 //
00059 //F-F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---
00060
00061 STDMETHODIMP CUpdateReceipt::Update (OUT long* plReceiptNo) {
00062
00063   HRESULT hr = S_OK;
00064
00065   IObjectContext* pObjectContext = NULL;
00066
00067   ADOConnection* adoCoConnection = NULL;
00068   ADORecordset* adoRsReceipt = NULL;
00069   ADOFields* pFields = NULL;
00070   ADOField* pField = NULL;
00071
00072   long lErrFlag = 0;
00073   TCHAR* pErrMsg = NULL;
00074
00075   *plReceiptNo = 0;
00076
00077   try {
00078
00079     // First of all, get the object context
00080     THROW_ERR (CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext), "GetObjectContext" );
00081
00082     // Create ADOConnection object and initialize the connection
00083     THROW_ERR ( CoCreateInstance (CLSID_CADOConnection, NULL, CLSCTX_INPROC_SERVER,
00084       IID_IADOConnection, (LPVOID *) &adoCoConnection), "CoCreateInstance(CLSID_CADOConnection)" );
00085
00086     BSTR bstrDSN = ::SysAllocString (L"FILEDSN=BankSample");
00087     hr = adoCoConnection->Open(bstrDSN, NULL, NULL, adCmdUnspecified);
00088     ::SysFreeString (bstrDSN);
00089     RETHROW_ERR ( hr );
00090
00091     // Update the next receipt record
00092     CComVariant vAdoNull;
00093     TCHAR szBuffer [512];
00094     wsprintf (szBuffer, _T("Update Receipt set NextReceipt = NextReceipt + 100"));
00095     BSTR bstrSQL = TCHAR2BSTR (szBuffer);
00096     hr = adoCoConnection->Execute(bstrSQL, &vAdoNull, -1, NULL);
00097     ::SysFreeString (bstrSQL);
00098     RETHROW_ERR ( hr );
00099
00100     // Obtain the desired recordset with an SQL query
00101     bstrSQL = ::SysAllocString (L"SELECT NextReceipt FROM Receipt");
00102     hr = adoCoConnection->Execute (bstrSQL, &vAdoNull, -1, &adoRsReceipt);
00103     ::SysFreeString (bstrSQL);
00104     RETHROW_ERR ( hr );
00105
00106     // Get the appropriate fields
00107     RETHROW_ERR( adoRsReceipt->get_Fields(&pFields) );
00108
00109     // Get the appropriate field
00110     CComVariant vField = L"NextReceipt";
00111     RETHROW_ERR ( pFields->get_Item (vField, &pField) );
00112     CComVariant vNextReceipt;
00113     RETHROW_ERR ( pField->get_Value (&vNextReceipt) );
00114
00115
00116     // Cleanup resources
00117     if (pField) pField->Release();
00118     if (pFields) pFields->Release();
00119     if (adoRsReceipt) adoRsReceipt->Release();
00120     if (adoCoConnection) adoCoConnection->Release();
00121
00122     // We are finished and happy
00123     pObjectContext->SetComplete();
00124
00125     // Prepare return value
00126     *plReceiptNo = vNextReceipt.lVal;
00127     hr = S_OK;
00128
00129   } catch (HRESULT hr) {
00130
00131     //
00132     //  ErrorInfo is saved here because the following ADO cleanup code
00133     //  may clear it.
00134     //
00135     IErrorInfo * pErrorInfo = NULL;
00136     GetErrorInfo(NULL, &pErrorInfo);
00137
00138     if (pField) pField->Release();
00139     if (pFields) pFields->Release();
00140     if (adoRsReceipt) adoRsReceipt->Release();
00141     if (adoCoConnection) adoCoConnection->Release();
00142
00143     // Fill in error information
00144     switch (lErrFlag) {
00145
00146     // Unknown error occurred in this object
00147     case (0):
00148       TCHAR szErr [512];
00149       wsprintf (szErr, _T("Error 0x%x from CUpdateReceipt calling %s."), hr, pErrMsg);
00150       pErrMsg = szErr;
00151       // Fall through
00152
00153     // An application error occurred in this object
00154     case (1):
00155       //
00156       //  we are going to put our own error in TLS, so if there is one there, clear it
00157       //
00158       if (pErrorInfo)
00159         pErrorInfo -> Release();
00160
00161       AtlReportError( CLSID_CUpdateReceipt, pErrMsg, IID_IUpdateReceipt, hr);
00162       break;
00163
00164     case (2): // An error occurred in a called object
00165       //
00166       //  put the error back in TLS
00167       //
00168       SetErrorInfo(NULL, pErrorInfo);
00169       break;
00170
00171     // Will never reach here
00172     default:
00173       break;
00174     }
00175
00176     // Indicate our unhappiness
00177     if (pObjectContext)
00178       pObjectContext->SetAbort();
00179   }
00180
00181   // Resource cleanup
00182   if (pObjectContext) pObjectContext->Release();
00183
00184   return hr;
00185 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/proxy.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

proxy.Cpp

Go to the documentation of this file.
00001 // Proxy.cpp : Implementation of CProxy
00002 #include "stdafx.h"
00003 #include "Data.h"
00004 #include "Entity.h"
00005 #include "Dynamic.h"
00006 #include "Resultset.h"
00007 #include "odbcdata.h"
00008 #include "Proxy.h"
00009 #include <wchar.h>
00010
00011 /////////////////////////////////////////////////////////////////////////////
00012
00013 // CProxy
00014
00015 STDMETHODIMP CProxy::InterfaceSupportsErrorInfo(REFIID riid)
00016 {
00017   static const IID* arr[] =
00018   {
00019     &IID_IDataProxy
00020   };
00021   for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
00022   {
00023     if (::InlineIsEqualGUID(*arr[i],riid))
00024       return S_OK;
00025   }
00026   return S_FALSE;
00027 }
00028
00029 HRESULT CProxy::Activate()
00030 {
00031   HRESULT hr = GetObjectContext(&m_spObjectContext);
00032   ActivateData(m_spObjectContext.p);
00033   return hr;
00034 }
00035
00036 BOOL CProxy::CanBePooled()
00037 {
00038   return CanConnectionBePooled();
00039 }
00040
00041 void CProxy::Deactivate()
00042 {
00043   DeactivateData();
00044 }
00045
00046 STDMETHODIMP CProxy::Construct(IDispatch * pUnk)
00047 {
00048   return ConstructData(pUnk);
00049 }
00050
00051 STDMETHODIMP CProxy::Execute(BSTR SQLString, long *pResult)
00052 {
00053   HRESULT hr = S_OK;
00054   WCHAR wszSQL[MAX_FIELD_DATA_SIZE];
00055
00056   CloseCurrentStatement();
00057   hr = QueryEnlist(CLSID_Proxy, IID_IDataProxy);
00058
00059   if (SUCCEEDED(hr))
00060   {
00061     WCSNCPY(wszSQL, SQLString, SysStringLen(SQLString));
00062     hr = ExecuteSQL(wszSQL, pResult);
00063   }
00064   return hr;
00065 }
00066
00067 STDMETHODIMP CProxy::ManualConstruct(BSTR ConstructString)
00068 {
00069   HRESULT hr = E_FAIL;
00070
00071   hr = ManualConstructData(ConstructString);
00072
00073   return hr;
00074 }
00075
00076 STDMETHODIMP CProxy::EntityDelete(IEntityData *pEntity, long *Result)
00077 {
00078   HRESULT hr = S_OK;
00079   long nResult;
00080   CComBSTR bstrCommand;
00081
00082   hr = pEntity->get_DeleteCommand(&bstrCommand);
00083
00084   if (SUCCEEDED(hr))
00085     hr = Execute(bstrCommand, &nResult);
00086
00087   if (SUCCEEDED(hr))
00088   {
00089     hr = pEntity->put_EditMode(colEditDeleted);
00090     *Result = nResult;
00091   }
00092   return hr;
00093 }
00094
00095 STDMETHODIMP CProxy::EntityInsert(IEntityData *pEntity, long *Result)
00096 {
00097   HRESULT hr = S_OK;
00098   long nResult;
00099   CComBSTR bstrCommand;
00100
00101   hr = pEntity->get_InsertCommand(&bstrCommand);
00102
00103   if (SUCCEEDED(hr))
00104     hr = Execute(bstrCommand, &nResult);
00105
00106   if (SUCCEEDED(hr))
00107   {
00108     hr = pEntity->put_EditMode(colEditNone);
00109     *Result = nResult;
00110   }
00111   return hr;
00112 }
00113
00114 STDMETHODIMP CProxy::EntityUpdate(IEntityData *pEntity, long *Result)
00115 {
00116   HRESULT hr = S_OK;
00117   long nResult;
00118   CComBSTR bstrCommand;
00119   ColEditModeEnum mode = colEditNone;
00120
00121   hr = pEntity->get_EditMode(&mode);
00122
00123   if (SUCCEEDED(hr))
00124   {
00125     if (mode == colEditDelete)
00126     {
00127       hr = pEntity->get_DeleteCommand(&bstrCommand);
00128       if (SUCCEEDED(hr))
00129         hr = pEntity->put_EditMode(colEditDeleted);
00130     }
00131     else if (mode == colEditAdd)
00132     {
00133       hr = pEntity->get_InsertCommand(&bstrCommand);
00134       if (SUCCEEDED(hr) && bstrCommand.m_str != NULL)
00135       {
00136         hr = pEntity->put_EditMode(colEditNone);
00137       }
00138       else
00139       {
00140         hr = pEntity->get_UpdateCommand(&bstrCommand);
00141         if (SUCCEEDED(hr))
00142           hr = pEntity->put_EditMode(colEditNone);
00143       }
00144     }
00145     else
00146     {
00147       hr = pEntity->get_UpdateCommand(&bstrCommand);
00148       if (SUCCEEDED(hr))
00149         hr = pEntity->put_EditMode(colEditNone);
00150     }
00151
00152     hr = Execute(bstrCommand, &nResult);
00153     if (SUCCEEDED(hr))
00154       *Result = nResult;
00155   }
00156
00157   return hr;
00158 }
00159
00160 STDMETHODIMP CProxy::EntityRead(IEntityData *pEntity, long *Results)
00161 {
00162   HRESULT hr = S_OK;
00163   long nRowsAffected = 0;
00164   short nsCount = 0;
00165
00166   if (pEntity == NULL)
00167   {
00168     return E_INVALIDARG;
00169   }
00170
00171   if (SUCCEEDED(hr))
00172   {
00173     HRESULT hr = E_FAIL;
00174     CComPtr<IEntityData> spEntity(pEntity);
00175     CComBSTR bstr;
00176     FieldMetaData *pMetaData = NULL;
00177
00178     CloseCurrentStatement();
00179     hr = QueryEnlist(CLSID_Proxy, IID_IDataProxy);
00180     if (SUCCEEDED(hr))
00181     {
00182       spEntity->get_ReadCommand(&bstr);
00183
00184       hr = ExecuteSQL(bstr);
00185       if (SUCCEEDED(hr))
00186       {
00187         hr = BindResultMetaData(&pMetaData, &nsCount);
00188         if (SUCCEEDED(hr))
00189         {
00190           hr = PopulateStaticEntity(pMetaData, spEntity);
00191           if (SUCCEEDED(hr))
00192             hr = spEntity->put_EditMode(colEditNone);
00193         }
00194         delete [] pMetaData;
00195       }
00196     }
00197   }
00198   return hr;
00199 }
00200
00201 STDMETHODIMP CProxy::EntityQuery(BSTR SQLString, long *Result, BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField, IResultset **ppResults)
00202 {
00203   HRESULT hr = S_OK;
00204
00205   CloseCurrentStatement();
00206
00207   hr = InternalLookup(SQLString, Result, ReadStoredProc, UpdateStoredProc, DeleteStoredProc, InsertStoredProc, KeyField);
00208
00209   if (SUCCEEDED(hr))
00210   {
00211     hr = CollectResultRows(ppResults);
00212   }
00213
00214   return hr;
00215 }
00216
00217 HRESULT CProxy::CollectResultRows(IResultset **ppResults)
00218 {
00219   HRESULT hr = S_OK;
00220   CDynamicResultset* spResults = NULL;
00221   CStaticEntity* spEntity = NULL;
00222   long nEntity = 0;
00223
00224   spResults = new CDynamicResultset;
00225   spResults->Initialise(m_nRows);
00226
00227   spEntity = spResults->GetEntity(nEntity);
00228
00229   hr = InternalBindLookup(spEntity);
00230
00231   if (SUCCEEDED(hr))
00232   {
00233     spResults->m_wszReadStoredProc = m_wszReadStoredProc;
00234     spResults->m_wszUpdateStoredProc = m_wszUpdateStoredProc;
00235     spResults->m_wszDeleteStoredProc = m_wszDeleteStoredProc;
00236     spResults->m_wszInsertStoredProc = m_wszInsertStoredProc;
00237     spResults->m_wszKeyField = m_wszKeyField;
00238
00239     if (SUCCEEDED(hr) && spEntity != NULL)
00240     {
00241       do
00242       {
00243         spEntity->put_EditMode(colEditNone);
00244         nEntity += 1;
00245         spEntity = spResults->GetEntity(nEntity);
00246       } while ((nEntity < (ENTITY_BANKS * ENTITY_PER_BANK) - 1) && SUCCEEDED(InternalNextEntity(spEntity)));
00247       spResults->DeleteEntity(nEntity);
00248       spResults->SetCount(nEntity);
00249     }
00250     else if (FAILED(hr))
00251     {
00252       spResults->DeleteEntity(0);
00253       spResults->SetCount(0);
00254     }
00255   }
00256   else
00257   {
00258     spResults->DeleteEntity(0);
00259     spResults->SetCount(0);
00260   }
00261   hr = spResults->QueryInterface(IID_IResultset, (void**)ppResults);
00262   if (FAILED(hr))
00263   {
00264     delete spResults;
00265     *ppResults = NULL;
00266   }
00267   ClearArray();
00268
00269   return hr;
00270 }
00271
00272 HRESULT CProxy::BindStaticEntity(FieldMetaData *pMetaData, short nCount, CStaticEntity* spEntity)
00273 {
00274   HRESULT hr = S_OK;
00275   RETCODE rc = 0;
00276   int nCol;
00277
00278   hr = FetchData();
00279
00280   if (SUCCEEDED(hr))
00281   {
00282     spEntity->Initialize(nCount);
00283
00284     for (nCol = 1; nCol <= nCount; nCol++)
00285     {
00286       long nIndex = nCol-1;
00287       FieldMetaData *pMeta = &pMetaData[nIndex];
00288
00289       if (pMeta->nDataBindLen <= 0)
00290       {
00291         *(long*)pMeta->pData = 0;
00292         if (pMeta->nNullable > 0)
00293         {
00294           pMeta->bNull = true;
00295         }
00296       }
00297       else
00298       {
00299         pMeta->bNull = false;
00300       }
00301
00302       if (pMeta->nDataLen > 0)
00303       {
00304         if (pMeta->bNull == true)
00305         {
00306           hr = spEntity->InternalInsert(nCol, pMeta->wszName, &vtNull, pMeta->vt);
00307         }
00308         else if (pMeta->vt == VT_BSTR)
00309         {
00310           hr = spEntity->InternalInsert(nCol, pMeta->wszName, (WCHAR*)pMeta->pData);
00311         }
00312         else if (pMeta->vt == VT_I2)// || vt == VT_I4 || vt == VT_UI1)
00313         {
00314           hr = spEntity->InternalInsert(nCol, pMeta->wszName, &_variant_t(*(short*)pMeta->pData), pMeta->vt);
00315         }
00316         else if (pMeta->vt == VT_I4)// || vt == VT_I4 || vt == VT_UI1)
00317         {
00318           hr = spEntity->InternalInsert(nCol, pMeta->wszName, (long*)pMeta->pData);
00319         }
00320         else if (pMeta->vt == VT_UI1)// || vt == VT_I4 || vt == VT_UI1)
00321         {
00322           hr = spEntity->InternalInsert(nCol, pMeta->wszName, &_variant_t(*(BYTE*)pMeta->pData), pMeta->vt);
00323         }
00324         else if (pMeta->vt == VT_DATE)
00325         {
00326           WCHAR* pStr = wcsstr(pMeta->pData, L".");
00327           pStr[0] = L'\0';
00328           CFastVariant varval(pMeta->pData);
00329           if (SUCCEEDED(varval.ChangeType(VT_DATE)))
00330           {
00331             hr = spEntity->InternalInsert(nCol, pMeta->wszName, &varval, pMeta->vt);
00332           }
00333         }
00334         else if (pMeta->vt == VT_DECIMAL)
00335         {
00336           CFastVariant varval((WCHAR*)pMeta->pData);
00337           if (SUCCEEDED(varval.ChangeType(VT_DECIMAL)))
00338           {
00339             hr = spEntity->InternalInsert(nCol, pMeta->wszName, &varval, pMeta->vt);
00340           }
00341         }
00342         else if (pMeta->vt == VT_CY)
00343         {
00344           CFastVariant varval((WCHAR*)pMeta->pData);
00345           if (SUCCEEDED(varval.ChangeType(VT_CY)))
00346           {
00347             hr = spEntity->InternalInsert(nCol, pMeta->wszName, &varval, pMeta->vt);
00348           }
00349         }
00350         else if (pMeta->vt == VT_BOOL)
00351         {
00352           hr = spEntity->InternalInsert(nCol, pMeta->wszName, &_variant_t(*(bool*)pMeta->pData), pMeta->vt);
00353         }
00354         else if (pMeta->vt == VT_NULL)
00355         {
00356           hr = spEntity->InternalInsert(nCol, pMeta->wszName, &vtNull, pMeta->vt);
00357         }
00358         else
00359         {
00360           hr = spEntity->InternalInsert(nCol, pMeta->wszName, (WCHAR*)pMeta->pData);
00361         }
00362       }
00363       if (FAILED(hr))
00364         return AtlReportError(CLSID_Proxy, (LPCSTR)"Failed to bind entity data", IID_IDataProxy, hr);
00365     }
00366   }
00367   return hr;
00368 }
00369
00370 HRESULT CProxy::PopulateStaticEntity(FieldMetaData *pMetaData, IEntityData *pEntity)
00371 {
00372   HRESULT hr = S_OK;
00373   RETCODE rc = 0;
00374   int nCol;
00375   long nCount = 0;
00376
00377   hr = FetchData();
00378
00379   if (SUCCEEDED(hr))
00380   {
00381     pEntity->Count(&nCount);
00382
00383     for (nCol = 1; nCol <= nCount; nCol++)
00384     {
00385       long nIndex = nCol-1;
00386       FieldMetaData *pMeta = &pMetaData[nIndex];
00387
00388       if (pMeta->nDataBindLen <= 0)
00389       {
00390         *(long*)pMeta->pData = 0;
00391         if (pMeta->nNullable > 0)
00392           pMeta->vt = VT_NULL;
00393       }
00394
00395       if (pMeta->nDataLen > 0)
00396       {
00397         if (pMeta->vt == VT_BSTR)
00398         {
00399           hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &_variant_t((WCHAR*)pMeta->pData));
00400         }
00401         else if (pMeta->vt == VT_I2)// || vt == VT_I4 || vt == VT_UI1)
00402         {
00403           hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &_variant_t(*(short*)pMeta->pData));
00404         }
00405         else if (pMeta->vt == VT_I4)// || vt == VT_I4 || vt == VT_UI1)
00406         {
00407           hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &_variant_t(*(long*)pMeta->pData));
00408         }
00409         else if (pMeta->vt == VT_UI1)// || vt == VT_I4 || vt == VT_UI1)
00410         {
00411           hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &_variant_t(*(BYTE*)pMeta->pData));
00412         }
00413         else if (pMeta->vt == VT_DATE)
00414         {
00415           WCHAR* pStr = wcsstr(pMeta->pData, L".");
00416           pStr[0] = L'\0';
00417           CFastVariant varval(pMeta->pData);
00418           if (SUCCEEDED(varval.ChangeType(VT_DATE)))
00419           {
00420             hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &varval);
00421           }
00422         }
00423         else if (pMeta->vt == VT_DECIMAL)
00424         {
00425           CFastVariant varval((WCHAR*)pMeta->pData);
00426           if (SUCCEEDED(varval.ChangeType(VT_DECIMAL)))
00427           {
00428             hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &varval);
00429           }
00430         }
00431         else if (pMeta->vt == VT_CY)
00432         {
00433           CFastVariant varval((WCHAR*)pMeta->pData);
00434           if (SUCCEEDED(varval.ChangeType(VT_CY)))
00435           {
00436             hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &varval);
00437           }
00438         }
00439         else if (pMeta->vt == VT_BOOL)
00440         {
00441           hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &_variant_t(*(bool*)pMeta->pData));
00442         }
00443         else if (pMeta->vt == VT_NULL)
00444         {
00445           hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &vtNull);
00446         }
00447         else
00448         {
00449           hr = pEntity->put_Field(&_variant_t(pMeta->wszName), &_variant_t((WCHAR*)pMeta->pData));
00450         }
00451       }
00452     }
00453     if (FAILED(hr))
00454       hr = AtlReportError(CLSID_Proxy, (LPCSTR)"Failed to populate entity", IID_IDataProxy, hr);
00455   }
00456   return hr;
00457 }
00458
00459 STDMETHODIMP CProxy::EntityLoad(BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField, VARIANT KeyValue, long *Result, IEntityData **ppEntity)
00460 {
00461   HRESULT hr = S_OK;
00462   long nRowsAffected;
00463   short nsCount = 0;
00464   WCHAR wszSQL[MAX_FIELD_DATA_SIZE];
00465   CStaticEntity *spEntity = NULL;
00466   FieldMetaData* pMetaData = NULL;
00467
00468   CloseCurrentStatement();
00469   hr = QueryEnlist(CLSID_Proxy, IID_IDataProxy);
00470   if (SUCCEEDED(hr))
00471   {
00472     SETCOMPLETE;
00473
00474     BuildExecCommand(wszSQL, ReadStoredProc, KeyField, &KeyValue);
00475
00476     hr = ExecuteSQL(wszSQL);
00477
00478     if (SUCCEEDED(hr))
00479     {
00480       spEntity = new CStaticEntity;
00481
00482       hr = BindResultMetaData(&pMetaData, &nsCount);
00483       if (SUCCEEDED(hr))
00484       {
00485         hr = BindStaticEntity(pMetaData, nsCount, spEntity);
00486
00487         if (SUCCEEDED(hr))
00488         {
00489           spEntity->put_ReadStoredProcedure(ReadStoredProc);
00490           spEntity->put_UpdateStoredProcedure(UpdateStoredProc);
00491           spEntity->put_DeleteStoredProcedure(DeleteStoredProc);
00492           spEntity->put_InsertStoredProcedure(InsertStoredProc);
00493           spEntity->put_KeyField(KeyField);
00494
00495           nRowsAffected = 1;
00496           hr = spEntity->put_EditMode(colEditNone);
00497           if (SUCCEEDED(hr))
00498             hr = spEntity->QueryInterface(IID_IEntityData, (void**)ppEntity);
00499           *Result = nRowsAffected;
00500         }
00501       }
00502       if (FAILED(hr))
00503       {
00504         delete spEntity;
00505         *ppEntity = NULL;
00506       }
00507     }
00508     delete [] pMetaData;
00509   }
00510   return hr;
00511 }
00512
00513 STDMETHODIMP CProxy::EntityLookup(BSTR SQLString, long *Result, BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField, IEntityData **ppEntity)
00514 {
00515   HRESULT hr = S_OK;
00516   CStaticEntity *spEntity = new CStaticEntity;
00517
00518   CloseCurrentStatement();
00519
00520   hr = InternalLookup(SQLString, Result, ReadStoredProc, UpdateStoredProc, DeleteStoredProc, InsertStoredProc, KeyField);
00521   if (SUCCEEDED(hr))
00522   {
00523     hr = InternalBindLookup(spEntity);
00524
00525     if (SUCCEEDED(hr) && m_nCount > 0)
00526     {
00527       spEntity->m_wszReadStoredProc = m_wszReadStoredProc;
00528       spEntity->m_wszUpdateStoredProc = m_wszUpdateStoredProc;
00529       spEntity->m_wszDeleteStoredProc = m_wszDeleteStoredProc;
00530       spEntity->m_wszInsertStoredProc = m_wszInsertStoredProc;
00531       spEntity->m_wszKeyField = m_wszKeyField;
00532       hr = spEntity->put_EditMode(colEditNone);
00533       if (SUCCEEDED(hr))
00534         hr = spEntity->QueryInterface(IID_IEntityData, (void**)ppEntity);
00535     }
00536   }
00537   if (FAILED(hr) || m_nCount <= 0)
00538   {
00539     delete spEntity;
00540     *ppEntity = NULL;
00541   }
00542   return hr;
00543 }
00544
00545 HRESULT CProxy::InternalLookup(BSTR SQLString, long *Result, BSTR ReadStoredProc, BSTR UpdateStoredProc, BSTR DeleteStoredProc, BSTR InsertStoredProc, BSTR KeyField)
00546 {
00547   HRESULT hr = S_OK;
00548   WCHAR wszSQL[MAX_FIELD_DATA_SIZE];
00549
00550   hr = QueryEnlist(CLSID_Proxy, IID_IDataProxy);
00551
00552   if (SUCCEEDED(hr))
00553   {
00554     SETCOMPLETE;
00555
00556     if (ReadStoredProc != NULL)
00557       m_wszReadStoredProc.AssignCopy(SysStringLen(ReadStoredProc), ReadStoredProc);
00558     else
00559       m_wszReadStoredProc.Empty();
00560
00561     if (UpdateStoredProc != NULL)
00562       m_wszUpdateStoredProc.AssignCopy(SysStringLen(UpdateStoredProc), UpdateStoredProc);
00563     else
00564       m_wszUpdateStoredProc.Empty();
00565
00566     if (DeleteStoredProc != NULL)
00567       m_wszDeleteStoredProc.AssignCopy(SysStringLen(DeleteStoredProc), DeleteStoredProc);
00568     else
00569       m_wszDeleteStoredProc.Empty();
00570
00571     if (InsertStoredProc != NULL)
00572       m_wszInsertStoredProc.AssignCopy(SysStringLen(InsertStoredProc), InsertStoredProc);
00573     else
00574       m_wszInsertStoredProc.Empty();
00575
00576     if (KeyField != NULL)
00577       m_wszKeyField.AssignCopy(SysStringLen(KeyField), KeyField);
00578     else
00579       m_wszKeyField.Empty();
00580
00581     WCSNCPY(wszSQL, SQLString, SysStringLen(SQLString));
00582
00583     hr = ExecuteSQL(wszSQL);
00584     if (SUCCEEDED(hr))
00585     {
00586       *Result = 1;
00587     }
00588   }
00589   return hr;
00590 }
00591
00592 HRESULT CProxy::InternalBindLookup(CStaticEntity *spEntity)
00593 {
00594   HRESULT hr = S_OK;
00595
00596   hr = BindResultMetaData(&m_MetaData, &m_nCount);
00597   if (m_nCount > 0)
00598   {
00599     hr = BindStaticEntity(m_MetaData, m_nCount, spEntity);
00600   }
00601   return hr;
00602 }
00603
00604 HRESULT CProxy::InternalNextEntity(CStaticEntity *spEntity)
00605 {
00606   HRESULT hr = S_OK;
00607
00608   hr = BindStaticEntity(m_MetaData, m_nCount, spEntity);
00609
00610   return hr;
00611 }
00612
00613 STDMETHODIMP CProxy::NextEntity(IEntityData **ppEntity)
00614 {
00615   HRESULT hr = S_OK;
00616   CStaticEntity *spEntity = new CStaticEntity;
00617   hr = InternalNextEntity(spEntity);
00618   if (SUCCEEDED(hr))
00619   {
00620     spEntity->m_wszReadStoredProc = m_wszReadStoredProc;
00621     spEntity->m_wszUpdateStoredProc = m_wszUpdateStoredProc;
00622     spEntity->m_wszDeleteStoredProc = m_wszDeleteStoredProc;
00623     spEntity->m_wszInsertStoredProc = m_wszInsertStoredProc;
00624     spEntity->m_wszKeyField = m_wszKeyField;
00625     hr = spEntity->put_EditMode(colEditNone);
00626     if (SUCCEEDED(hr))
00627       hr = spEntity->QueryInterface(IID_IEntityData, (void**)ppEntity);
00628   }
00629   else
00630   {
00631     delete spEntity;
00632     *ppEntity = NULL;
00633   }
00634   return hr;
00635 }
00636
00637 STDMETHODIMP CProxy::LookupFree()
00638 {
00639   CloseCurrentStatement();
00640   m_nCount = -1;
00641   return S_OK;
00642 }
00643
00644 STDMETHODIMP CProxy::NextResultset(long *pResult, IResultset **ppResults)
00645 {
00646   HRESULT hr = S_OK;
00647
00648   hr = NextResultsetData(pResult);
00649
00650   if (SUCCEEDED(hr))
00651   {
00652     hr = CollectResultRows(ppResults);
00653   }
00654
00655   if (FAILED(hr))
00656     return AtlReportError(CLSID_Proxy, (LPCSTR)"Failed to retrieve data", IID_IDataProxy, hr);
00657   else
00658     return hr;
00659 }
00660
00661 STDMETHODIMP CProxy::NextLookup(long *pResult, IEntityData **ppEntity)
00662 {
00663   HRESULT hr = S_OK;
00664   CStaticEntity *spEntity = new CStaticEntity;
00665
00666   hr = NextResultsetData(pResult);
00667
00668   if (SUCCEEDED(hr))
00669   {
00670     hr = InternalBindLookup(spEntity);
00671
00672     if (SUCCEEDED(hr))
00673     {
00674       spEntity->m_wszReadStoredProc = m_wszReadStoredProc;
00675       spEntity->m_wszUpdateStoredProc = m_wszUpdateStoredProc;
00676       spEntity->m_wszDeleteStoredProc = m_wszDeleteStoredProc;
00677       spEntity->m_wszInsertStoredProc = m_wszInsertStoredProc;
00678       spEntity->m_wszKeyField = m_wszKeyField;
00679       hr = spEntity->put_EditMode(colEditNone);
00680       if (SUCCEEDED(hr))
00681         hr = spEntity->QueryInterface(IID_IEntityData, (void**)ppEntity);
00682     }
00683   }
00684   if (FAILED(hr))
00685   {
00686     delete spEntity;
00687     *ppEntity = NULL;
00688     return AtlReportError(CLSID_Proxy, (LPCSTR)"Failed to bind entity data", IID_IDataProxy, hr);
00689   }
00690   return hr;
00691 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMyUIExtModule Member List

This is the complete list of members for CMyUIExtModule, including all inherited members.
UpdateRegistryCLSID(const CLSID &clsid, BOOL bRegister) | CMyUIExtModule
UpdateRegistryCLSID(const CLSID &clsid, BOOL bRegister) | CMyUIExtModule
Generated on Wed Nov 13 2024 16:56:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/AppExportDlg.Cpp Source File

  • Com
  • Administration
  • Explore.VC

AppExportDlg.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 #include "stdafx.h"
00020 #include "VCExplore.h"
00021 #include "AppExportDlg.h"
00022
00023 #include <comdef.h>
00024
00025 #ifdef _DEBUG
00026 #define new DEBUG_NEW
00027 #undef THIS_FILE
00028 static char THIS_FILE[] = __FILE__;
00029 #endif
00030
00031
00032 #define EXPORT_TYPE_UNDEFINED   -1
00033 #define EXPORT_TYPE_WITHOUT_USERS 0
00034 #define EXPORT_TYPE_WITH_USERS    1
00035 #define EXPORT_TYPE_WITH_CLIENTS  2
00036
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CAppExportDlg dialog
00040
00041
00042 CAppExportDlg::CAppExportDlg(CWnd* pParent /*=NULL*/)
00043   : CDialog(CAppExportDlg::IDD, pParent)
00044 {
00045   //{{AFX_DATA_INIT(CAppExportDlg)
00046     // NOTE: the ClassWizard will add member initialization here
00047   //}}AFX_DATA_INIT
00048
00049   // Load the dialog's icon resource
00050   m_hIcon = AfxGetApp()->LoadIcon(IDI_EXPORT);
00051
00052   // Initialize the members
00053   m_pCatalog = NULL;
00054   m_nExportType = EXPORT_TYPE_UNDEFINED;
00055   m_bOverwriteFiles = false;
00056 }
00057
00058
00059 void CAppExportDlg::DoDataExchange(CDataExchange* pDX)
00060 {
00061   CDialog::DoDataExchange(pDX);
00062   //{{AFX_DATA_MAP(CAppExportDlg)
00063   DDX_Control(pDX, IDC_EDIT_EXPORT_PATH, m_edtExportPath);
00064   DDX_Control(pDX, IDC_EDIT_APPLICATION_ID, m_edtApplicationID);
00065   //}}AFX_DATA_MAP
00066 }
00067
00068
00069 BEGIN_MESSAGE_MAP(CAppExportDlg, CDialog)
00070   //{{AFX_MSG_MAP(CAppExportDlg)
00071   ON_WM_CLOSE()
00072   ON_BN_CLICKED(IDC_RADIO_DO_NOT_EXPORT_USERS, OnExportWithoutUsers)
00073   ON_BN_CLICKED(IDC_RADIO_EXPORT_CLIENTS, OnExportClients)
00074   ON_BN_CLICKED(IDC_RADIO_EXPORT_USERS, OnExportUsers)
00075   ON_BN_CLICKED(IDC_CHECK_OVERWRITE_FILES, OnOverwriteFiles)
00076   ON_BN_CLICKED(IDC_BUTTON_EXPORT_PATH_SEARCH, OnExportPathSearch)
00077   //}}AFX_MSG_MAP
00078 END_MESSAGE_MAP()
00079
00080 /////////////////////////////////////////////////////////////////////////////
00081 // CAppExportDlg message handlers
00082
00083 void CAppExportDlg::set_Catalog(ICOMAdminCatalog *pCatalog)
00084 {
00085   // Only can have one Catalog object reference... release all prior references before assignment
00086   ReleaseCatalog();
00087
00088   m_pCatalog = pCatalog;
00089 }
00090
00091 void CAppExportDlg::OnClose()
00092 {
00093   // Release the reference to the Catalog object if needed
00094   ReleaseCatalog();
00095
00096   CDialog::OnClose();
00097 }
00098
00099 void CAppExportDlg::ReleaseCatalog()
00100 {
00101   // Release the reference to the Catalog object if needed
00102   if (NULL != m_pCatalog)
00103     m_pCatalog->Release();
00104 }
00105
00106 void CAppExportDlg::OnOK()
00107 {
00108   if (NULL != m_pCatalog)
00109   {
00110     // Determine the export options
00111     long lOptions = 0;
00112     switch (m_nExportType)
00113     {
00114     case EXPORT_TYPE_WITHOUT_USERS:
00115       lOptions = COMAdminExportNoUsers;
00116       break;
00117     case EXPORT_TYPE_WITH_USERS:
00118       lOptions = COMAdminExportUsers;
00119       break;
00120     case EXPORT_TYPE_WITH_CLIENTS:
00121       lOptions = COMAdminExportApplicationProxy;
00122       break;
00123     }
00124
00125     if (m_bOverwriteFiles)
00126       lOptions = lOptions | COMAdminExportForceOverwriteOfFiles;
00127
00128     // Extract method parameters from the UI
00129     int nAppIDLength = m_edtApplicationID.GetWindowTextLength() + 1;
00130     char* pAppIDBuf = new char[nAppIDLength];
00131     m_edtApplicationID.GetWindowText(pAppIDBuf, nAppIDLength);
00132     _bstr_t bstrAppID = pAppIDBuf;
00133     delete [] pAppIDBuf;
00134
00135     int nExportPathLength = m_edtExportPath.GetWindowTextLength() + 1;
00136     char* pExportPathBuf = new char[nExportPathLength];
00137     m_edtExportPath.GetWindowText(pExportPathBuf, nExportPathLength);
00138     _bstr_t bstrExportPath = pExportPathBuf;
00139     delete [] pExportPathBuf;
00140
00141     // Attempt to export the application
00142     HRESULT hr = m_pCatalog->ExportApplication(bstrAppID,
00143                           bstrExportPath,
00144                           lOptions);
00145
00146     // Validate success/fail
00147     if FAILED(hr)
00148       MessageBox("Failed to export the application.\n\nNo processing performed.\n\nPress OK to continue.",
00149             "Error",
00150             (MB_OK | MB_ICONERROR));
00151
00152   }
00153   else
00154     MessageBox("Invalid Catalog reference.\n\nNo processing will be performed.\n\nPress OK to continue.",
00155           "Error",
00156           (MB_OK | MB_ICONERROR));
00157
00158   // Release the Catalog reference
00159   ReleaseCatalog();
00160
00161   CDialog::OnOK();
00162 }
00163
00164 BOOL CAppExportDlg::OnInitDialog()
00165 {
00166   CDialog::OnInitDialog();
00167
00168   // Set the dialog's icon resource
00169   SetIcon(m_hIcon, true);     // 32x32 icon
00170   SetIcon(m_hIcon, true);     // 16x16 icon
00171
00172   // Select and set default export type
00173   CheckRadioButton(IDC_RADIO_DO_NOT_EXPORT_USERS, IDC_RADIO_EXPORT_CLIENTS, IDC_RADIO_DO_NOT_EXPORT_USERS);
00174
00175   // Set the import type and description to match the current selection
00176   OnExportWithoutUsers();
00177
00178
00179   return TRUE;  // return TRUE unless you set the focus to a control
00180                 // EXCEPTION: OCX Property Pages should return FALSE
00181 }
00182
00183 void CAppExportDlg::OnExportWithoutUsers()
00184 {
00185   m_nExportType = EXPORT_TYPE_WITHOUT_USERS;
00186 }
00187
00188 void CAppExportDlg::OnExportClients()
00189 {
00190   m_nExportType = EXPORT_TYPE_WITH_CLIENTS;
00191 }
00192
00193 void CAppExportDlg::OnExportUsers()
00194 {
00195   m_nExportType = EXPORT_TYPE_WITH_USERS;
00196 }
00197
00198 void CAppExportDlg::OnOverwriteFiles()
00199 {
00200   m_bOverwriteFiles = !m_bOverwriteFiles;
00201 }
00202
00203 void CAppExportDlg::OnExportPathSearch()
00204 {
00205   OPENFILENAME ofn;
00206   char pFilePath[256];
00207   char pFileTitle[256];
00208
00209   // Setup of OPENFILENAME structure
00210   ofn.lStructSize = sizeof(OPENFILENAME);
00211     ofn.hwndOwner = m_hWnd;
00212     ofn.hInstance = NULL;
00213     ofn.lpstrFilter = "All Files (*.*)\0*.*\0\0";
00214     ofn.lpstrCustomFilter = (LPSTR) NULL;
00215     ofn.nMaxCustFilter = 0;
00216     ofn.nFilterIndex = 1;
00217     pFilePath[0] = '\0';
00218     ofn.lpstrFile = pFilePath;
00219     ofn.nMaxFile = sizeof(pFilePath);
00220     ofn.lpstrFileTitle = pFileTitle;
00221     ofn.nMaxFileTitle = sizeof(pFileTitle);
00222     ofn.lpstrInitialDir = NULL;
00223   ofn.lpstrTitle = "Select the export directory";
00224     ofn.Flags = (OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST);
00225     ofn.lpstrDefExt = "DLL";
00226     ofn.nFileOffset = 0;
00227     ofn.nFileExtension = 0;
00228     ofn.lCustData = 0;
00229
00230   // Invoke the file open common dialog
00231   GetOpenFileName(&ofn);
00232
00233   // Update the value in the control
00234   m_edtExportPath.SetWindowText(ofn.lpstrFile);
00235 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DComDraw/GUIPAPER.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • DComDraw

GUIPAPER.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GUIPAPER.CPP
00003
00004   Summary:   Implementation file for the CGuiPaper C++ class. A GuiPaper
00005              is a C++ object that displays mouse movement as free-form
00006              drawing in the client area of a designated window (much like
00007              common scribble sample programs except that COM technology is
00008              used throughout to construct this functionality). CGuiPaper
00009              is anchored to the Windows GUI (Graphical User Interface)
00010              environment--it retains knowledge of window handles and
00011              device contexts on the local machine. This GuiPaper object
00012              relies on a virtual paper object for storage of the drawing
00013              data. This virtual Paper object (a COPaper) is instantiated
00014              as a COM object in a separate thread-safe out-of-process
00015              server, DCDSERVE.
00016
00017              For a comprehensive tutorial code tour of GUIPAPER's contents
00018              and offerings see the tutorial DCOMDRAW.HTM file. For more
00019              specific technical details on the internal workings see the
00020              comments dispersed throughout the GUIPAPER source code.
00021
00022   Classes:   CGuiPaper.
00023
00024   Origin:    8-23-97: atrent - Editor inheritance from GUIBALL.CPP in the
00025              CONCLIEN source. [Revised]
00026
00027 ----------------------------------------------------------------------------
00028   This file is part of the Microsoft COM Tutorial Code Samples.
00029
00030   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00031
00032   This source code is intended only as a supplement to Microsoft
00033   Development Tools and/or on-line documentation.  See these other
00034   materials for detailed information regarding Microsoft code samples.
00035
00036   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00037   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00038   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00039   PARTICULAR PURPOSE.
00040 ==========================================================================+*/
00041
00042 /*--------------------------------------------------------------------------
00043   We include WINDOWS.H for all Win32 applications.
00044   We include OLE2.H because we will be calling the COM/OLE Libraries.
00045   We include OLECTL.H because it has definitions for connectable objects.
00046   We include COMMDLG.H because we will be using the Open File,
00047     Choose Color, and potentially other Common dialogs.
00048   We include TCHAR.H for general Unicode/Ansi prototype of utility
00049     functions like _tsplitpath, etc.
00050   We include APPUTIL.H because we will be building this application using
00051     the convenient Virtual Window and Dialog classes and other
00052     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00053   We include PAPINT.H and PAPGUIDS.H for the common Paper-related Interface
00054     class, GUID, and CLSID specifications.
00055   We include GUIPAPER.H because it has the C++ class used for GUI display
00056     of the drawing Paper.
00057   We include SINK.H because it has the C++ class used for the sink that
00058     receives event notifications from the COPaper object in the server.
00059   We include DCOMDRAW.H because it has class and resource definitions
00060     specific to this DCOMDRAW application.
00061 ---------------------------------------------------------------------------*/
00062 #include <windows.h>
00063 #include <ole2.h>
00064 #include <olectl.h>
00065 #include <commdlg.h>
00066 #include <tchar.h>
00067 #include <apputil.h>
00068 #include <papint.h>
00069 #include <papguids.h>
00070 #include "guipaper.h"
00071 #include "sink.h"
00072 #include "dcomdraw.h"
00073
00074
00075 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00076   Method:   CGuiPaper::CGuiPaper
00077
00078   Summary:  Constructor.
00079
00080   Args:     void
00081
00082   Returns:  void
00083 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00084 CGuiPaper::CGuiPaper(void)
00085 {
00086   m_hWnd       = NULL;
00087   m_hInst      = NULL;
00088   m_hDC        = NULL;
00089   m_pISharePaper = NULL;
00090   m_hPen       = NULL;
00091   m_nInkWidth  = INK_THIN;
00092   m_crInkColor = RGB(0,0,0);
00093   m_bLocked    = FALSE;
00094   m_bInkSaving = FALSE;
00095   m_bInking    = FALSE;
00096   m_bPainting  = FALSE;
00097   m_OldPos.x   = 0;
00098   m_OldPos.y   = 0;
00099   m_pCOPaperSink = NULL;
00100   m_dwPaperSink = 0;
00101   m_bDirty     = FALSE;
00102
00103   m_PenCur = PENCUR_OFF | PENCUR_THIN;
00104   m_hPenCurN = NULL;
00105   m_hPenCurT = NULL;
00106   m_hPenCurM = NULL;
00107   m_hPenCurF = NULL;
00108 }
00109
00110
00111 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00112   Method:   CGuiPaper::~CGuiPaper
00113
00114   Summary:  Destructor.
00115
00116   Args:     void
00117
00118   Returns:  void
00119 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00120 CGuiPaper::~CGuiPaper(void)
00121 {
00122   BOOL bOk = TRUE;
00123
00124   if (m_pISharePaper)
00125   {
00126     // Just to make sure, turn off Ink Saving.
00127     m_bInkSaving = FALSE;
00128
00129     // Make sure we unlock the paper object.
00130     m_pISharePaper->Lock(FALSE);
00131
00132     // Disconnect all Sinks--currently only one: PaperSink. This officially
00133     // stops all PaperSink notifications.
00134     DisconnectPaperSink();
00135
00136     // Delete the Pen object.
00137     if (m_hPen)
00138       DeleteObject(m_hPen);
00139
00140     // Release the reference to the PaperSink object.
00141     RELEASE_INTERFACE(m_pCOPaperSink);
00142
00143     // Release the main interface pointer copy held in CGuiPaper.
00144     RELEASE_INTERFACE(m_pISharePaper);
00145   }
00146 }
00147
00148
00149 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00150   Method:   CGuiPaper::Init
00151
00152   Summary:  Get CGuiPaper started. Make any subordinate objects, like
00153             COPaper and CPapFile, and get them started.
00154
00155   Args:     HINSTANCE hInst
00156               Handle to the application instance.
00157             HWND hWnd
00158               Handle of the display window. Part of what makes CGuiPaper
00159               a GUI kind of thing.
00160
00161   Returns:  BOOL
00162               TRUE for success; FALSE for fail.
00163 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00164 BOOL CGuiPaper::Init(
00165        HINSTANCE hInst,
00166        HWND hWnd)
00167 {
00168   BOOL bOk = FALSE;
00169   HRESULT hr;
00170   BOOL bFirst;
00171   COPaperSink* pCobSink = NULL;
00172   HCURSOR hCurPrev;
00173   HCURSOR hCurWait = LoadCursor(NULL, IDC_WAIT);
00174
00175   if (hInst && hWnd)
00176   {
00177     m_hInst = hInst;
00178     m_hWnd = hWnd;
00179
00180     // Load the pen cursors.
00181     m_hPenCurN = LoadCursor(m_hInst, TEXT("PenCurN"));
00182     m_hPenCurT = LoadCursor(m_hInst, TEXT("PenCurT"));
00183     m_hPenCurM = LoadCursor(m_hInst, TEXT("PenCurM"));
00184     m_hPenCurF = LoadCursor(m_hInst, TEXT("PenCurF"));
00185
00186     // Get and save our private display Device Context.
00187     m_hDC = GetDC(m_hWnd);
00188
00189     // Change cursor to the hour glass. Init could take awhile.
00190     hCurPrev = SetCursor(hCurWait);
00191
00192     // Call COM service to create a COPaper instance. We are not
00193     // aggregating it so we ask for its ISharePaper interface directly.
00194     hr = CoCreateInstance(
00195            CLSID_SharePaper,
00196            NULL,
00197            CLSCTX_LOCAL_SERVER,
00198            IID_ISharePaper,
00199            (PPVOID)&m_pISharePaper);
00200     if (SUCCEEDED(hr))
00201     {
00202       // Init the COPaper object.
00203       GetClientRect(hWnd, &m_WinRect);
00204       hr = m_pISharePaper->InitPaper(&m_WinRect, &bFirst);
00205       if (SUCCEEDED(hr))
00206       {
00207         // Resize this client's window to match what the COPaper
00208         // object returned for its size.
00209         ResizeWin(m_WinRect.right, m_WinRect.bottom);
00210
00211         // Create the COPaperSink object to receive COPaper events.
00212         pCobSink = new COPaperSink(NULL, this);
00213         if (NULL != pCobSink)
00214         {
00215           // Save a pointer to the COPaperSink IUnknown interface.
00216           // AddRef because of this saved copy.
00217           m_pCOPaperSink = pCobSink;
00218           m_pCOPaperSink->AddRef();
00219         }
00220         else
00221           hr = E_OUTOFMEMORY;
00222       }
00223
00224       bOk = SUCCEEDED(hr);
00225     }
00226     else
00227       HrMsg(hWnd, TEXT(LOCAL_CREATE_ERR_STR), hr);
00228
00229     // Set Cursor back to what it was.
00230     SetCursor(hCurPrev);
00231   }
00232
00233   return (bOk);
00234 }
00235
00236
00237 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00238   Method:   CGuiPaper::SetPenCur
00239
00240   Summary:  Set the pen cursor.
00241
00242   Args:     USHORT usPenCurNew
00243               Or'd bits for the pen cursor.
00244
00245   Returns:  HRESULT
00246               Standard result code. NOERROR for success.
00247 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00248 HRESULT CGuiPaper::SetPenCur(
00249           USHORT usPenCurNew)
00250 {
00251   HRESULT hr = E_FAIL;
00252   USHORT usPenCurW;
00253
00254   usPenCurW = m_PenCur & (PENCUR_THIN | PENCUR_MEDIUM | PENCUR_THICK);
00255
00256   switch (usPenCurNew)
00257   {
00258     case PENCUR_OFF:
00259      hr = (m_PenCur & PENCUR_ON) ? NOERROR : E_FAIL;
00260      m_PenCur = usPenCurW;
00261      SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (INT_PTR)m_hPenCurN);
00262      break;
00263     case PENCUR_ON:
00264      hr = (m_PenCur & PENCUR_ON) ? E_FAIL: NOERROR;
00265      m_PenCur = PENCUR_ON | usPenCurW;
00266      switch (usPenCurW)
00267      {
00268        case PENCUR_THICK:
00269          SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (INT_PTR)m_hPenCurF);
00270          break;
00271        case PENCUR_MEDIUM:
00272          SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (INT_PTR)m_hPenCurM);
00273          break;
00274        case PENCUR_THIN:
00275        default:
00276          SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (INT_PTR)m_hPenCurT);
00277          break;
00278      }
00279      break;
00280     case PENCUR_THICK:
00281      hr = (usPenCurW & PENCUR_THICK) ? E_FAIL: NOERROR;
00282      m_PenCur = (m_PenCur & PENCUR_ON);
00283      m_PenCur |= PENCUR_THICK;
00284      SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (INT_PTR)m_hPenCurF);
00285      break;
00286     case PENCUR_MEDIUM:
00287      hr = (usPenCurW & PENCUR_MEDIUM) ? E_FAIL: NOERROR;
00288      m_PenCur = (m_PenCur & PENCUR_ON);
00289      m_PenCur |= PENCUR_MEDIUM;
00290      SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (INT_PTR)m_hPenCurM);
00291      break;
00292     case PENCUR_THIN:
00293      hr = (usPenCurW & PENCUR_THIN) ? E_FAIL: NOERROR;
00294      m_PenCur = (m_PenCur & PENCUR_ON);
00295      m_PenCur |= PENCUR_THIN;
00296      SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (INT_PTR)m_hPenCurT);
00297      break;
00298     default:
00299      break;
00300   }
00301
00302   return hr;
00303 }
00304
00305
00306 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00307   Method:   CGuiPaper::Lock
00308
00309   Summary:  Lock the paper object for drawing by this client.
00310
00311   Args:     BOOL bLock
00312               TRUE => lock the paper. FALSE => unlock the paper.
00313
00314   Returns:  HRESULT
00315               Standard result code. NOERROR for success.
00316 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00317 HRESULT CGuiPaper::Lock(
00318           BOOL bLock)
00319 {
00320   HRESULT hr = NOERROR;
00321   HMENU hMenu = ::GetMenu(m_hWnd);
00322
00323   if (bLock)
00324   {
00325     // If we are not already locked for drawing then do so.
00326     if (!m_bLocked)
00327     {
00328       hr = m_pISharePaper->Lock(TRUE);
00329       if (SUCCEEDED(hr))
00330       {
00331         // Set Main Window Title.
00332         SetWindowText(m_hWnd, TEXT(MAIN_WINDOW_MASTER_STR));
00333         // Set the menu check marks.
00334         ::CheckMenuItem(
00335             hMenu,
00336             IDM_DRAW_MASTER,
00337             MF_BYCOMMAND | MF_CHECKED);
00338         ::CheckMenuItem(
00339             hMenu,
00340             IDM_DRAW_SLAVE,
00341             MF_BYCOMMAND | MF_UNCHECKED);
00342         // Set the Pen cursor on.
00343         SetPenCur(PENCUR_ON);
00344         m_bLocked = TRUE;
00345         // We have siezed control of the pen and can now allow ink saving.
00346         m_bInkSaving = TRUE;
00347         m_bDirty = TRUE;
00348       }
00349       else
00350       {
00351         // Set Main Window Title.
00352         SetWindowText(m_hWnd, TEXT(MAIN_WINDOW_SLAVE_STR));
00353         // Set the menu check marks.
00354         ::CheckMenuItem(
00355             hMenu,
00356             IDM_DRAW_MASTER,
00357             MF_BYCOMMAND | MF_UNCHECKED);
00358         ::CheckMenuItem(
00359             hMenu,
00360             IDM_DRAW_SLAVE,
00361             MF_BYCOMMAND | MF_CHECKED);
00362         // Set the Pen cursor off.
00363         SetPenCur(PENCUR_OFF);
00364       }
00365     }
00366   }
00367   else
00368   {
00369     // If we are not already unlocked for drawing then do so.
00370     if (m_bLocked)
00371     {
00372       // AskSave();
00373       hr = m_pISharePaper->Lock(FALSE);
00374       if (SUCCEEDED(hr))
00375       {
00376         // Set Main Window Title.
00377         SetWindowText(m_hWnd, TEXT(MAIN_WINDOW_SLAVE_STR));
00378         // Set the menu check marks.
00379         ::CheckMenuItem(
00380             hMenu,
00381             IDM_DRAW_MASTER,
00382             MF_BYCOMMAND | MF_UNCHECKED);
00383         ::CheckMenuItem(
00384             hMenu,
00385             IDM_DRAW_SLAVE,
00386             MF_BYCOMMAND | MF_CHECKED);
00387         // Set the Pen cursor off.
00388         SetPenCur(PENCUR_OFF);
00389         m_bLocked = FALSE;
00390         m_bInkSaving = FALSE;
00391         m_bDirty = FALSE;
00392       }
00393     }
00394   }
00395
00396   return hr;
00397 }
00398
00399
00400 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00401   Method:   CGuiPaper::Master
00402
00403   Summary:  Return TRUE if this client is the master client that owns
00404             the drawing paper.
00405
00406   Args:     void.
00407
00408   Returns:  BOOL
00409               TRUE => This client is master.  FALSE => Not master.
00410 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00411 BOOL CGuiPaper::Master(void)
00412 {
00413   BOOL bMaster = m_bLocked && m_bInkSaving;
00414
00415   return bMaster;
00416 }
00417
00418
00419 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00420   Method:   CGuiPaper::ClearWin
00421
00422   Summary:  Clear display window but don't erase drawn data.
00423
00424   Args:     void.
00425
00426   Returns:  HRESULT
00427               Standard result code. NOERROR for success.
00428 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00429 HRESULT CGuiPaper::ClearWin(void)
00430 {
00431   HRESULT hr = E_FAIL;
00432   RECT  WinRect;
00433
00434   if(!m_bInking)
00435   {
00436     // Get our window's client area rectangle.
00437     GetClientRect(m_hWnd, &WinRect);
00438
00439     // Fill that rectangle with pixels of default white paint.
00440     FillRect(m_hDC, &WinRect, GETCLASSBRUSH(m_hWnd));
00441
00442     hr = NOERROR;
00443   }
00444
00445   return hr;
00446 }
00447
00448
00449 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00450   Method:   CGuiPaper::ResizeWin
00451
00452   Summary:  Resize display window.
00453
00454   Args:     LONG lWidth
00455               New window width. Max X coord.
00456             LONG lHeight
00457               New window height. Max Y coord.
00458
00459   Returns:  HRESULT
00460               Standard result code. NOERROR for success.
00461 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00462 HRESULT CGuiPaper::ResizeWin(
00463                      LONG lWidth,
00464                      LONG lHeight)
00465 {
00466   HRESULT hr = NOERROR;
00467
00468   if(!m_bInking)
00469   {
00470     SetWindowPos(
00471       m_hWnd,
00472       HWND_TOP,
00473       0,
00474       0,
00475       6+lWidth,
00476       50+lHeight,
00477       SWP_NOMOVE | SWP_NOZORDER);
00478   }
00479
00480   return hr;
00481 }
00482
00483
00484 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00485   Method:   CGuiPaper::PaintWin
00486
00487   Summary:  Repaints the current drawing in the drawing window.
00488
00489   Args:     void
00490
00491   Returns:  HRESULT
00492               Standard result code. NOERROR for success.
00493 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00494 HRESULT CGuiPaper::PaintWin(void)
00495 {
00496   HRESULT hr = E_FAIL;
00497   COLORREF crInkColorTmp;
00498   SHORT nInkWidthTmp;
00499   BOOL bInkSavingTmp;
00500   LONG i;
00501   SHORT nInkType;
00502   SHORT nX;
00503   SHORT nY;
00504   SHORT nInkWidth;
00505   COLORREF crInkColor;
00506
00507   if (m_pISharePaper && !m_bPainting && !m_bInking)
00508   {
00509     hr = NOERROR;
00510     m_bPainting = TRUE;
00511     // Save and restore ink color and width since redraw otherwise
00512     // ends up changing these values in CGuiPaper.
00513     crInkColorTmp = m_crInkColor;
00514     nInkWidthTmp = m_nInkWidth;
00515     bInkSavingTmp = m_bInkSaving;
00516     m_bInkSaving = FALSE;
00517     for (i = 0; SUCCEEDED(hr); i++)
00518     {
00519       hr = m_pISharePaper->GetInk(
00520              i,
00521              &nInkType,
00522              &nX,
00523              &nY,
00524              &nInkWidth,
00525              &crInkColor);
00526       if (SUCCEEDED(hr))
00527       {
00528         switch (nInkType)
00529         {
00530           case INKTYPE_START:
00531             m_nInkWidth = nInkWidth;
00532             m_crInkColor = crInkColor;
00533             InkStart(nX, nY);
00534             break;
00535           case INKTYPE_DRAW:
00536             InkDraw(nX, nY);
00537             break;
00538           case INKTYPE_STOP:
00539             InkStop(nX, nY);
00540             break;
00541           default:
00542             break;
00543         }
00544       }
00545     }
00546     m_nInkWidth = nInkWidthTmp;
00547     m_crInkColor = crInkColorTmp;
00548     m_bInkSaving = bInkSavingTmp;
00549     m_bPainting = FALSE;
00550     hr = NOERROR;
00551   }
00552
00553   return hr;
00554 }
00555
00556
00557 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00558   Method:   CGuiPaper::Erase
00559
00560   Summary:  Erase content of the drawing paper and clear display window.
00561
00562   Args:     void.
00563
00564   Returns:  HRESULT
00565               Standard result code. NOERROR for success.
00566 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00567 HRESULT CGuiPaper::Erase(void)
00568 {
00569   HRESULT hr = E_FAIL;
00570
00571   if (Master())
00572   {
00573     if (m_pISharePaper)
00574       hr = m_pISharePaper->Erase();
00575     if (SUCCEEDED(hr))
00576     {
00577       ClearWin();
00578       m_bDirty = TRUE;
00579     }
00580   }
00581   else
00582     ClearWin();
00583
00584   return hr;
00585 }
00586
00587
00588 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00589   Method:   CGuiPaper::Resize
00590
00591   Summary:  Resizes current drawing paper rectangle.
00592
00593   Args:     LONG lWidth
00594               New window width. Max X coord.
00595             LONG lHeight
00596               New window height. Max Y coord.
00597
00598   Returns:  HRESULT
00599               Standard result code. NOERROR for success.
00600 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00601 HRESULT CGuiPaper::Resize(
00602                      LONG lWidth,
00603                      LONG lHeight)
00604 {
00605   HRESULT hr = NOERROR;
00606
00607   if (Master())
00608   {
00609     if (m_pISharePaper)
00610     {
00611       hr = m_pISharePaper->Resize(lWidth, lHeight);
00612       if (SUCCEEDED(hr))
00613         m_bDirty = TRUE;
00614     }
00615   }
00616   else
00617     ResizeWin(lWidth, lHeight);
00618
00619   if (SUCCEEDED(hr))
00620   {
00621     // Store the new window size.
00622     m_WinRect.right = lWidth;
00623     m_WinRect.bottom = lHeight;
00624   }
00625
00626   return hr;
00627 }
00628
00629
00630 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00631   Method:   CGuiPaper::InkWidth
00632
00633   Summary:  Changes current ink width and sets the visable pen cursor
00634             based on the width.
00635
00636   Args:     SHORT nInkWidth
00637               New ink width in pixels.
00638
00639   Returns:  HRESULT
00640               Standard result code. NOERROR for success.
00641 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00642 HRESULT CGuiPaper::InkWidth(
00643                      SHORT nInkWidth)
00644 {
00645   HRESULT hr = E_FAIL;
00646
00647   switch (nInkWidth)
00648   {
00649     case INK_THIN:
00650       if (!(m_PenCur & (PENCUR_THIN)))
00651         hr = SetPenCur(PENCUR_THIN);
00652       break;
00653     case INK_MEDIUM:
00654       if (!(m_PenCur & (PENCUR_MEDIUM)))
00655         hr = SetPenCur(PENCUR_MEDIUM);
00656       break;
00657     case INK_THICK:
00658       if (!(m_PenCur & (PENCUR_THICK)))
00659         hr = SetPenCur(PENCUR_THICK);
00660       break;
00661     default:
00662       break;
00663   }
00664
00665   if (SUCCEEDED(hr))
00666     m_nInkWidth = nInkWidth;
00667
00668   return hr;
00669 }
00670
00671
00672 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00673   Method:   CGuiPaper::InkColor
00674
00675   Summary:  Changes current ink color.
00676
00677   Args:     COLORREF crInkColor
00678               RGB color ref value (eg, RGB(0,0,0) is black).
00679
00680   Returns:  HRESULT
00681               Standard result code. NOERROR for success.
00682 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00683 HRESULT CGuiPaper::InkColor(
00684                      COLORREF crInkColor)
00685 {
00686   m_crInkColor = crInkColor;
00687
00688   return NOERROR;
00689 }
00690
00691
00692 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00693   Method:   CGuiPaper::InkStart
00694
00695   Summary:  Starts an ink drawing sequence in the current color.
00696
00697   Args:     SHORT nX,
00698               X coordinate in window rectangle of start point.
00699             SHORT nY
00700               Y coordinate in window rectangle of start point.
00701
00702   Returns:  HRESULT
00703               Standard result code. NOERROR for success.
00704 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00705 HRESULT CGuiPaper::InkStart(
00706                      SHORT nX,
00707                      SHORT nY)
00708 {
00709   HRESULT hr = E_FAIL;
00710
00711   // Start an ink drawing sequence only if one is not in progress.
00712   if (!m_bInking)
00713   {
00714     // Remember start position.
00715     m_OldPos.x = nX;
00716     m_OldPos.y = nY;
00717
00718     // Delete old pen.
00719     if (m_hPen)
00720       DeleteObject(m_hPen);
00721
00722     // Create and select the new drawing pen.
00723     m_hPen = CreatePen(PS_SOLID, m_nInkWidth, m_crInkColor);
00724     SelectObject(m_hDC, m_hPen);
00725
00726     hr = NOERROR;
00727
00728     // Ask the Paper object to mark the start of the ink drawing
00729     // sequence in the current ink color.
00730     if (m_pISharePaper && m_bInkSaving)
00731     {
00732       hr = m_pISharePaper->InkStart(
00733               nX,
00734               nY,
00735               m_nInkWidth,
00736               m_crInkColor);
00737       // Capture the Mouse.
00738       SetCapture(m_hWnd);
00739
00740       // We've modified the ink data--it is now "dirty" with
00741       // respect to the compound file image. Set dirty flag.
00742       m_bDirty = TRUE;
00743     }
00744
00745     // Set inking flag to TRUE.
00746     m_bInking = TRUE;
00747   }
00748
00749   return hr;
00750 }
00751
00752
00753 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00754   Method:   CGuiPaper::InkDraw
00755
00756   Summary:  Draws and saves ink data during the currently active ink
00757             drawing sequence.
00758
00759   Args:     SHORT nX,
00760               X coordinate in window rectangle of start point.
00761             SHORT nY
00762               Y coordinate in window rectangle of start point.
00763
00764   Returns:  HRESULT
00765               Standard result code. NOERROR for success.
00766 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00767 HRESULT CGuiPaper::InkDraw(
00768                      SHORT nX,
00769                      SHORT nY)
00770 {
00771   if (m_bInking)
00772   {
00773     // Start this ink line at previous old position.
00774     MoveToEx(m_hDC, m_OldPos.x, m_OldPos.y, NULL);
00775
00776     // Assign new old position and draw the new line.
00777     LineTo(m_hDC, m_OldPos.x = nX, m_OldPos.y = nY);
00778
00779     // Ask the Paper object to save this data.
00780     if (m_bInkSaving)
00781       m_pISharePaper->InkDraw(nX, nY);
00782   }
00783
00784   return NOERROR;
00785 }
00786
00787
00788 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00789   Method:   CGuiPaper::InkStop
00790
00791   Summary:  Stops the currently active ink drawing sequence.
00792
00793   Args:     SHORT nX,
00794               X coordinate in window rectangle of start point.
00795             SHORT nY
00796               Y coordinate in window rectangle of start point.
00797
00798   Returns:  HRESULT
00799               Standard result code. NOERROR for success.
00800 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00801 HRESULT CGuiPaper::InkStop(
00802                      SHORT nX,
00803                      SHORT nY)
00804 {
00805   if (m_bInking)
00806   {
00807     // Start this ink line at previous old position.
00808     MoveToEx(m_hDC, m_OldPos.x, m_OldPos.y, NULL);
00809
00810     // Draw the last line.
00811     LineTo(m_hDC, nX, nY);
00812
00813     // Turn off inking.
00814     m_bInking = FALSE;
00815
00816     // Ask the Paper object to mark the stop of the ink drawing sequence.
00817     if (m_bInkSaving)
00818     {
00819       m_pISharePaper->InkStop(nX, nY);
00820       // Free the mouse.
00821       ReleaseCapture();
00822     }
00823   }
00824
00825   return NOERROR;
00826 }
00827
00828
00829 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00830   Method:   CGuiPaper::GetConnectionPoint
00831
00832   Summary:  Internal private method to obtain a connection point interface.
00833
00834   Args:     REFIID riid
00835               IID of the requested connection point Interface.
00836
00837   Returns:  IConnectionPoint*
00838               Requested IConnectionPoint interface pointer. NULL if none.
00839 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00840 IConnectionPoint* CGuiPaper::GetConnectionPoint(
00841                     REFIID riid)
00842 {
00843   IConnectionPoint* pConnPoint = NULL;
00844   IConnectionPointContainer* pConnPointContainer = NULL;
00845   IConnectionPoint* pConnPt;
00846   HRESULT hr;
00847
00848   // First query the object for its Connection Point Container. This
00849   // essentially asks the object in the server if it is connectable.
00850   hr = m_pISharePaper->QueryInterface(
00851          IID_IConnectionPointContainer,
00852          (PPVOID)&pConnPointContainer);
00853   if SUCCEEDED(hr)
00854   {
00855     // Find the requested Connection Point. This AddRef's the
00856     // returned pointer.
00857     hr = pConnPointContainer->FindConnectionPoint(riid, &pConnPt);
00858     if (SUCCEEDED(hr))
00859       pConnPoint = pConnPt;
00860
00861     RELEASE_INTERFACE(pConnPointContainer);
00862   }
00863
00864   return pConnPoint;
00865 }
00866
00867
00868 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00869   Method:   CGuiPaper::ConnectPaperSink
00870
00871   Summary:  Connect the PaperSink to the server COPaper source.
00872
00873   Args:     void
00874
00875   Returns:  HRESULT
00876               Standard result code. NOERROR for success.
00877 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00878 HRESULT CGuiPaper::ConnectPaperSink(void)
00879 {
00880   HRESULT hr = E_FAIL;
00881   DWORD dwKey;
00882   IConnectionPoint* pConnPoint;
00883
00884   if (!m_dwPaperSink)
00885   {
00886     // Get the Paper Sink connection point.
00887     pConnPoint = GetConnectionPoint(IID_IPaperSink);
00888     if (NULL != pConnPoint)
00889     {
00890       // Connect the object in the server to the Paper Sink in this client.
00891       hr = pConnPoint->Advise(m_pCOPaperSink, &dwKey);
00892       if (SUCCEEDED(hr))
00893         m_dwPaperSink = dwKey;
00894
00895       RELEASE_INTERFACE(pConnPoint);
00896     }
00897   }
00898
00899   return hr;
00900 }
00901
00902
00903 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00904   Method:   CGuiPaper::DisconnectPaperSink
00905
00906   Summary:  Disconnect the PaperSink from the server COPaper source.
00907
00908   Args:     void.
00909
00910   Returns:  HRESULT
00911               Standard result code. NOERROR for success.
00912 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00913 HRESULT CGuiPaper::DisconnectPaperSink(void)
00914 {
00915   HRESULT hr = E_FAIL;
00916   IConnectionPoint* pConnPoint;
00917
00918   if (m_dwPaperSink)
00919   {
00920     // Get the Paper Sink connection point.
00921     pConnPoint = GetConnectionPoint(IID_IPaperSink);
00922     if (NULL != pConnPoint)
00923     {
00924       // Disconnect the object in the server from the Paper Sink in
00925       // this client.
00926       hr = pConnPoint->Unadvise(m_dwPaperSink);
00927       if (SUCCEEDED(hr))
00928         m_dwPaperSink = 0;
00929
00930       RELEASE_INTERFACE(pConnPoint);
00931     }
00932   }
00933
00934   return hr;
00935 }
00936
00937
00938 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00939   Method:   CGuiPaper::Load
00940
00941   Summary:  Load drawing data from the current compound file (local
00942             or remote).
00943
00944   Args:     void.
00945
00946   Returns:  HRESULT
00947               Standard result code. NOERROR for success.
00948 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00949 HRESULT CGuiPaper::Load(void)
00950 {
00951   HRESULT hr = E_FAIL;
00952   HCURSOR hCurWait = LoadCursor(NULL, IDC_WAIT);
00953   HCURSOR hCurPrev;
00954   RECT WinRect;
00955
00956   if (NULL != m_pISharePaper)
00957   {
00958     // Change cursor to the hour glass.
00959     hCurPrev = SetCursor(hCurWait);
00960
00961     // Ask the COPaper object to load the paper data from its
00962     // current compound file.
00963     m_bPainting = TRUE;
00964     hr = m_pISharePaper->Load(&WinRect);
00965     m_bPainting = FALSE;
00966     if (SUCCEEDED(hr))
00967     {
00968       if (WinRect.right == m_WinRect.right
00969           || WinRect.bottom == m_WinRect.bottom)
00970         PaintWin();
00971       else
00972       {
00973         m_WinRect.right = WinRect.right;
00974         m_WinRect.bottom = WinRect.bottom;
00975         hr = ResizeWin(m_WinRect.right, m_WinRect.bottom);
00976       }
00977       m_bDirty = FALSE;
00978     }
00979
00980     // Set Cursor back to what it was.
00981     SetCursor(hCurPrev);
00982   }
00983
00984   return hr;
00985 }
00986
00987
00988 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00989   Method:   CGuiPaper::LoadLocal
00990
00991   Summary:  Load drawing data from the local DCDSERVE server.
00992
00993   Args:     void.
00994
00995   Returns:  HRESULT
00996               Standard result code. NOERROR for success.
00997 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00998 HRESULT CGuiPaper::LoadLocal(void)
00999 {
01000   HRESULT hr;
01001   BOOL bFirst;
01002
01003   // Make sure we unlock the paper object.
01004   Lock(FALSE);
01005
01006   // Disconnect all Sinks--currently only one: PaperSink. This
01007   // officially stops all PaperSink notifications.
01008   hr = DisconnectPaperSink();
01009
01010   // Release the main interface pointer copy held in CGuiPaper.
01011   // This causes destruction (in the server) of the current
01012   // COPaper object.
01013   RELEASE_INTERFACE(m_pISharePaper);
01014
01015   // Call COM service to create a new COPaper instance. We are
01016   // not aggregating it so we ask for its IShare Paper interface
01017   // directly.
01018   hr = CoCreateInstance(
01019          CLSID_SharePaper,
01020          NULL,
01021          CLSCTX_LOCAL_SERVER,
01022          IID_ISharePaper,
01023          (PPVOID)&m_pISharePaper);
01024   if (SUCCEEDED(hr))
01025   {
01026     // Init the COPaper object.
01027     GetClientRect(m_hWnd, &m_WinRect);
01028     hr = m_pISharePaper->InitPaper(&m_WinRect, &bFirst);
01029     if (SUCCEEDED(hr))
01030     {
01031       // Reconnect all Sinks--currently only one: PaperSink.
01032       // This restores all PaperSink notifications.
01033       hr = ConnectPaperSink();
01034       if (SUCCEEDED(hr))
01035       {
01036         if (bFirst)
01037         {
01038           // Lock and load.
01039           Lock(TRUE);
01040           hr = Load();
01041         }
01042         else
01043         {
01044           Lock(FALSE);
01045           // If this is not first init then resize this client's window
01046           // to match what the COPaper object is using for its size.
01047           hr = ResizeWin(m_WinRect.right, m_WinRect.bottom);
01048           PaintWin();
01049         }
01050       }
01051     }
01052   }
01053
01054   return hr;
01055 }
01056
01057
01058 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01059   Method:   CGuiPaper::LoadRemote
01060
01061   Summary:  Load the shared drawing from a DCDSERVE server on a remote
01062             machine that the user specifies by name in a dialog.
01063
01064   Args:     void
01065
01066   Returns:  HRESULT
01067               Standard result code. NOERROR for success.
01068 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01069 HRESULT CGuiPaper::LoadRemote(void)
01070 {
01071   HRESULT hr = NOERROR;
01072   BOOL bFirst;
01073   COPaperSink* pCobSink = NULL;
01074   HCURSOR hCurPrev;
01075   HCURSOR hCurWait = LoadCursor(NULL, IDC_WAIT);
01076   COSERVERINFO* pServerInfo = &g_ServerInfo;
01077   MULTI_QI qiRes;
01078   int iAns;
01079   CDlgLoadRemote dlgLoadRemote;
01080
01081   // Ask user for the remote machine name. Cancel this whole load if
01082   // he cancels the dialog.
01083   iAns = dlgLoadRemote.ShowDialog(
01084            m_hInst,
01085            MAKEINTRESOURCE(IDD_LOAD_REMOTE),
01086            m_hWnd);
01087   // Ensure a remote machine name was specified by user.
01088   if (IDOK == iAns && pServerInfo->pwszName[0])
01089   {
01090     hr = E_FAIL;
01091     // Unload the existing COPaper object.
01092     if (m_pISharePaper)
01093     {
01094       // Ask User if save is desired.
01095       AskSave();
01096
01097       // Change cursor to the hour glass.
01098       hCurPrev = SetCursor(hCurWait);
01099
01100       // Clear the window of the previous drawing.
01101       ClearWin();
01102
01103       // Make sure we unlock the paper object.
01104       Lock(FALSE);
01105
01106       // Disconnect all Sinks--currently only one: PaperSink. This
01107       // officially stops all PaperSink notifications.
01108       hr = DisconnectPaperSink();
01109
01110       // Release the main interface pointer copy held in CGuiPaper.
01111       // This causes destruction (in the server) of the current
01112       // COPaper object.
01113       RELEASE_INTERFACE(m_pISharePaper);
01114     }
01115
01116     // Load a new COPaper from the server on a user-specifed remote machine.
01117
01118     // Call COM service to create an instance of the remote COPaper
01119     // COM object. We are not aggregating this new object (viz, the
01120     // NULL parameter), so we ask for its IShareDraw interface directly.
01121     qiRes.pIID = &IID_ISharePaper;
01122     qiRes.pItf = NULL;
01123     qiRes.hr = 0;
01124     hr = CoCreateInstanceEx(
01125            CLSID_SharePaper,
01126            NULL,
01127            CLSCTX_REMOTE_SERVER,
01128            pServerInfo,
01129            1,
01130            &qiRes);
01131     if (SUCCEEDED(hr))
01132     {
01133       hr = qiRes.hr;
01134       if (SUCCEEDED(hr))
01135       {
01136         // Grab our copy of the returned interface pointer. An AddRef was
01137         // done by CoCreateInstanceEx on this interface pointer.
01138         m_pISharePaper = (ISharePaper*)qiRes.pItf;
01139
01140         // Init the newly created COPaper object.
01141         GetClientRect(m_hWnd, &m_WinRect);
01142         hr = m_pISharePaper->InitPaper(&m_WinRect, &bFirst);
01143         if (SUCCEEDED(hr))
01144         {
01145           // Reconnect all Sinks--currently only one: PaperSink.
01146           // This restores all PaperSink notifications.
01147           hr = ConnectPaperSink();
01148           if (SUCCEEDED(hr))
01149           {
01150             if (bFirst)
01151             {
01152               // Lock and load.
01153               Lock(TRUE);
01154               hr = Load();
01155             }
01156             else
01157             {
01158               Lock(FALSE);
01159               // If this is not first init then resize this client's
01160               // window to match what the remote COPaper object is
01161               // using for its window size.
01162               hr = ResizeWin(m_WinRect.right, m_WinRect.bottom);
01163             }
01164           }
01165         }
01166       }
01167     }
01168
01169     if (FAILED(hr))
01170     {
01171       HrMsg(m_hWnd, TEXT(REMOTE_CREATE_ERR_STR), hr);
01172
01173       // If error with remote load then restore local drawing.
01174       hr = LoadLocal();
01175     }
01176
01177     // Set Cursor back to what it was.
01178     SetCursor(hCurPrev);
01179   }
01180
01181   return hr;
01182 }
01183
01184
01185 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01186   Method:   CGuiPaper::Save
01187
01188   Summary:  Calls on COPaper to save the current drawing's paper data in
01189             its current compound file.
01190
01191   Args:     void.
01192
01193   Returns:  HRESULT
01194               Standard result code. NOERROR for success.
01195 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01196 HRESULT CGuiPaper::Save(void)
01197 {
01198   HRESULT hr = E_FAIL;
01199   HCURSOR hCurWait = LoadCursor(NULL, IDC_WAIT);
01200   HCURSOR hCurPrev;
01201
01202   if (NULL != m_pISharePaper)
01203   {
01204     // Change cursor to the hour glass.
01205     hCurPrev = SetCursor(hCurWait);
01206
01207     // Ask the COPaper object to save itself to its current compound file.
01208     hr = m_pISharePaper->Save();
01209     if (SUCCEEDED(hr))
01210       m_bDirty = FALSE;
01211
01212     // Set Cursor back to what it was.
01213     SetCursor(hCurPrev);
01214   }
01215
01216   return hr;
01217 }
01218
01219
01220 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01221   Method:   CGuiPaper::AskSave
01222
01223   Summary:  Checks dirty flag (ie, if current displayed paper data was
01224             modified and is out of sync with the paper data stored in a
01225             compound file). If dirty, then ask user in simple dialog if he
01226             wants to save new data. If he says yes, then save the current
01227             paper data into the current compound file.
01228
01229   Args:     void.
01230
01231   Returns:  INT
01232               Value returned from the Win32 MessageBox function.
01233 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01234 INT CGuiPaper::AskSave(void)
01235 {
01236   int iAns = IDNO;
01237   TCHAR szTitle[MAX_STRING_LENGTH];
01238   TCHAR szAsk[MAX_STRING_LENGTH];
01239   TCHAR szMsg[MAX_PATH + MAX_STRING_LENGTH];
01240
01241   // If current data is dirty then ask user if he wants to save it.
01242   if (m_bDirty)
01243   {
01244     if (LoadString(m_hInst, IDS_DRAWING_CHANGED, szTitle, MAX_STRING_LENGTH)
01245         && LoadString(m_hInst, IDS_ASK_SAVE, szAsk, MAX_STRING_LENGTH))
01246     {
01247       lstrcpyn(szMsg, TEXT(MAIN_WINDOW_TITLE_STR), sizeof(szMsg)/
01248         sizeof(TCHAR));
01249       lstrncat(szMsg, szAsk, sizeof(szMsg)/sizeof(TCHAR) - lstrlen(szMsg));
01250       // Display AskSaveDlg to user. Ask if he wants to save.
01251       iAns = MessageBox(
01252                m_hWnd,
01253                szMsg,
01254                szTitle,
01255                MB_YESNOCANCEL | MB_ICONEXCLAMATION);
01256       if (IDYES == iAns)
01257       {
01258         // Tell COPaper to save itself to its current compound file.
01259         Save();
01260       }
01261     }
01262   }
01263
01264   return iAns;
01265 }
01266
01267
01268 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
01269   Method:   CGuiPaper::PickColor
01270
01271   Summary:  Uses the Choose Color common dialog to ask user for new
01272             Pen color. Return that new color.
01273
01274   Args:     void.
01275
01276   Returns:  COLORREF
01277               New chosen color.
01278 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
01279 COLORREF CGuiPaper::PickColor(void)
01280 {
01281   COLORREF crNewColor = m_crInkColor;
01282   SHORT i;
01283
01284   // Init the custom color array with gray colors.
01285   for (i=0; i<16; i++)
01286     m_acrCustColors[i] = RGB(i*16, i*16, i*16);
01287
01288   // Init the Choose Color structure.
01289   m_ChooseColor.lStructSize = sizeof(CHOOSECOLOR);
01290   m_ChooseColor.hwndOwner = m_hWnd;
01291   m_ChooseColor.hInstance = (HWND) m_hInst;
01292   m_ChooseColor.rgbResult = m_crInkColor;
01293   m_ChooseColor.lpCustColors = (DWORD*) m_acrCustColors;
01294   m_ChooseColor.Flags = CC_PREVENTFULLOPEN | CC_RGBINIT;
01295   m_ChooseColor.lCustData = 0L;
01296   m_ChooseColor.lpfnHook = NULL;
01297   m_ChooseColor.lpTemplateName = NULL;
01298
01299   if (ChooseColor(&m_ChooseColor))
01300     crNewColor = m_ChooseColor.rgbResult;
01301
01302   return crNewColor;
01303 }
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Server/Server.Idl Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Server

Server.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: server.idl
00004
00005 Summary:  Produced by VS6 ATL Wizard. Defines IMonitorServer interface and
00006     coclass that implements it.
00007
00008 ----------------------------------------------------------------------------
00009
00010 This file is part of the Microsoft COM+ Samples.
00011
00012 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00013
00014 This source code is intended only as a supplement to Microsoft
00015 Development Tools and/or on-line documentation. See these other
00016 materials for detailed information regarding Microsoft code samples.
00017
00018 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00021 PARTICULAR PURPOSE.
00022
00023 ==========================================================================+*/
00024
00025 // This file will be processed by the MIDL tool to
00026 // produce the type library (server.tlb) and marshalling code.
00027
00028 import "oaidl.idl";
00029 import "ocidl.idl";
00030
00031 interface IPingResponder;
00032
00033 import "..\PingResp\PingResp.idl";
00034
00035   [
00036     object,
00037     async_uuid(F159BD5D-4DA8-11D2-9672-00AA00B913AC),
00038     uuid(F159BD5C-4DA8-11D2-9672-00AA00B913AC),
00039     helpstring("IMonitorServer Interface"),
00040     pointer_default(unique)
00041   ]
00042   interface IMonitorServer : IUnknown
00043   {
00044     HRESULT GetData([out] LONG *pData);
00045     HRESULT GetPingResponder([out] IPingResponder **ppPing);
00046   };
00047
00048
00049 [
00050   uuid(F159BD4F-4DA8-11D2-9672-00AA00B913AC),
00051   version(1.0),
00052   helpstring("server 1.0 Type Library")
00053 ]
00054 library SERVERLib
00055 {
00056   importlib("stdole32.tlb");
00057   importlib("stdole2.tlb");
00058
00059
00060   [
00061     uuid(F159BD5E-4DA8-11D2-9672-00AA00B913AC),
00062     helpstring("MonitorServer Class")
00063   ]
00064   coclass MonitorServer
00065   {
00066     [default] interface IMonitorServer;
00067   };
00068
00069 };
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

KEY_HEADER Member List

This is the complete list of members for KEY_HEADER, including all inherited members.
blob | KEY_HEADER
rsa | KEY_HEADER
Generated on Wed Nov 13 2024 16:57:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/DComPerm/UtilS.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • DComPerm

UtilS.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <conio.h>
00021 #include <tchar.h>
00022 #include "ntsecapi.h"
00023 #include "dcomperm.h"
00024
00025 #define VERSION_MAJOR_W2K_XP_W2K3 5
00026 #define VERSION_MINOR_W2K         0
00027 #define VERSION_MINOR_XP          1
00028 #define VERSION_MINOR_W2K3        2
00029
00030
00031 /*---------------------------------------------------------------------------*\
00032  * NAME: GetCurrentUserSID                                                   *
00033  * --------------------------------------------------------------------------*
00034  * DESCRIPTION: Returns a SID for the current user.                          *
00035 \*---------------------------------------------------------------------------*/
00036 DWORD GetCurrentUserSID (
00037     PSID *pSid
00038     )
00039 {
00040     TOKEN_USER  *ptokenUser = NULL;
00041     HANDLE      hToken = NULL;
00042     DWORD       cbToken = 0;
00043     DWORD       cbSid = 0;
00044     DWORD       dwReturnValue = ERROR_SUCCESS;
00045
00046     if (!OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken))
00047     {
00048             dwReturnValue = GetLastError();
00049             goto CLEANUP;
00050     }
00051
00052
00053     GetTokenInformation (hToken,
00054                          TokenUser,
00055                          ptokenUser,
00056                          0,
00057                          &cbToken);
00058
00059     ptokenUser = (TOKEN_USER *) malloc (cbToken);
00060
00061     if (!GetTokenInformation (hToken,
00062                              TokenUser,
00063                              ptokenUser,
00064                              cbToken,
00065                              &cbToken))
00066     {
00067             dwReturnValue = GetLastError();
00068             goto CLEANUP;
00069     }
00070
00071
00072     cbSid = GetLengthSid (ptokenUser->User.Sid);
00073     *pSid = (PSID) malloc (cbSid);
00074
00075     memcpy (*pSid, ptokenUser->User.Sid, cbSid);
00076     CloseHandle (hToken);
00077
00078
00079 CLEANUP:
00080
00081     free (ptokenUser);
00082
00083     return dwReturnValue;
00084 }
00085
00086 /*---------------------------------------------------------------------------*\
00087  * NAME: ConstructWellKnownSID                                               *
00088  * --------------------------------------------------------------------------*
00089  * DESCRIPTION: This method converts some designated well-known identities   *
00090  * to a SID.                                                                 *
00091 \*---------------------------------------------------------------------------*/
00092 BOOL ConstructWellKnownSID(
00093     LPTSTR tszPrincipal,
00094     PSID *pSid
00095     )
00096 {
00097
00098     BOOL fRetVal = FALSE;
00099     PSID psidTemp = NULL;
00100     BOOL fUseWorldAuth = FALSE;
00101
00102     SID_IDENTIFIER_AUTHORITY SidAuthorityNT = SECURITY_NT_AUTHORITY;
00103     SID_IDENTIFIER_AUTHORITY SidAuthorityWorld = SECURITY_WORLD_SID_AUTHORITY;
00104
00105     DWORD dwSubAuthority;
00106
00107     // Look for well-known English names
00108     if (_tcsicmp (tszPrincipal, _T("Administrators")) == 0)
00109     {
00110         dwSubAuthority = DOMAIN_ALIAS_RID_ADMINS;
00111     }
00112     else if (_tcsicmp (tszPrincipal, _T("Power Users")) == 0)
00113     {
00114         dwSubAuthority = DOMAIN_ALIAS_RID_POWER_USERS;
00115     }
00116     else if (_tcsicmp (tszPrincipal, _T("Everyone")) == 0)
00117     {
00118         dwSubAuthority = SECURITY_WORLD_RID;
00119         fUseWorldAuth = TRUE;
00120     }
00121     else if (_tcsicmp (tszPrincipal, _T("System")) == 0)
00122     {
00123         dwSubAuthority = SECURITY_LOCAL_SYSTEM_RID;
00124     }
00125     else if (_tcsicmp (tszPrincipal, _T("Self")) == 0)
00126     {
00127         dwSubAuthority = SECURITY_PRINCIPAL_SELF_RID;
00128     }
00129     else if (_tcsicmp (tszPrincipal, _T("Anonymous")) == 0)
00130     {
00131         dwSubAuthority = SECURITY_ANONYMOUS_LOGON_RID;
00132     }
00133     else if (_tcsicmp (tszPrincipal, _T("Interactive")) == 0)
00134     {
00135         dwSubAuthority = SECURITY_INTERACTIVE_RID;
00136     }
00137     else
00138     {
00139         return FALSE;
00140     }
00141
00142
00143     if(dwSubAuthority == DOMAIN_ALIAS_RID_ADMINS ||
00144        dwSubAuthority == DOMAIN_ALIAS_RID_POWER_USERS)
00145     {
00146         if(!AllocateAndInitializeSid (
00147             &SidAuthorityNT,
00148             2,
00149             SECURITY_BUILTIN_DOMAIN_RID,
00150             dwSubAuthority,
00151             0, 0, 0, 0, 0, 0,
00152             &psidTemp
00153             )) return FALSE;
00154     }
00155     else
00156     {
00157
00158         if(!AllocateAndInitializeSid (
00159             fUseWorldAuth ? &SidAuthorityWorld : &SidAuthorityNT,
00160             1,
00161             dwSubAuthority,
00162             0, 0, 0, 0, 0, 0, 0,
00163             &psidTemp
00164             )) return FALSE;
00165
00166     }
00167
00168     if(IsValidSid(psidTemp))
00169     {
00170         DWORD cbSid = GetLengthSid(psidTemp);
00171         *pSid = (PSID) malloc(cbSid);
00172         if(pSid)
00173         {
00174             if(!CopySid(cbSid, *pSid, psidTemp))
00175             {
00176                 free(*pSid);
00177                 *pSid = NULL;
00178             }
00179             else
00180             {
00181                 fRetVal = TRUE;
00182             }
00183         }
00184         FreeSid(psidTemp);
00185     }
00186
00187
00188     return fRetVal;
00189 }
00190
00191 /*---------------------------------------------------------------------------*\
00192  * NAME: GetPrincipalSID                                                     *
00193  * --------------------------------------------------------------------------*
00194  * DESCRIPTION: Creates a SID for the supplied principal.                    *
00195 \*---------------------------------------------------------------------------*/
00196 DWORD GetPrincipalSID (
00197     LPTSTR tszPrincipal,
00198     PSID *pSid
00199     )
00200 {
00201     DWORD        cbSid              = 0;
00202     TCHAR        tszRefDomain [256] = {0};
00203     DWORD        cbRefDomain        = 0;
00204     DWORD        dwReturnValue      = ERROR_SUCCESS;
00205     SID_NAME_USE snu;
00206
00207     cbSid = 0;
00208     cbRefDomain = 255;
00209
00210     if(ConstructWellKnownSID(tszPrincipal, pSid)) return ERROR_SUCCESS;
00211
00212     LookupAccountName (NULL,
00213                        tszPrincipal,
00214                        *pSid,
00215                        &cbSid,
00216                        tszRefDomain,
00217                        &cbRefDomain,
00218                        &snu);
00219
00220     dwReturnValue = GetLastError();
00221     if (dwReturnValue != ERROR_INSUFFICIENT_BUFFER) goto CLEANUP;
00222
00223     dwReturnValue = ERROR_SUCCESS;
00224
00225     *pSid = (PSID) malloc (cbSid);
00226     if(!pSid)
00227     {
00228         dwReturnValue = ERROR_OUTOFMEMORY;
00229         goto CLEANUP;
00230     }
00231
00232     cbRefDomain = 255;
00233
00234     if (!LookupAccountName (NULL,
00235                             tszPrincipal,
00236                             *pSid,
00237                             &cbSid,
00238                             tszRefDomain,
00239                             &cbRefDomain,
00240                             &snu))
00241     {
00242         dwReturnValue = GetLastError();
00243         goto CLEANUP;
00244     }
00245
00246 CLEANUP:
00247
00248     return dwReturnValue;
00249 }
00250
00251 /*---------------------------------------------------------------------------*\
00252  * NAME: SystemMessage                                                       *
00253  * --------------------------------------------------------------------------*
00254  * DESCRIPTION: Configures a system message for the given error code.        *
00255 \*---------------------------------------------------------------------------*/
00256 LPTSTR SystemMessage (
00257     LPTSTR tszBuffer,
00258     DWORD cbBuffer,
00259     HRESULT hr
00260     )
00261 {
00262     LPTSTR   tszMessage = NULL;
00263
00264     FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
00265                    FORMAT_MESSAGE_FROM_SYSTEM,
00266                    NULL,
00267                    hr,
00268                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00269                    (LPTSTR) &tszMessage,
00270                    0,
00271                    NULL);
00272
00273     _sntprintf (tszBuffer, cbBuffer-1, _T("%s(%lx)\n"), tszMessage, hr);
00274
00275     LocalFree (tszMessage);
00276     return tszBuffer;
00277 }
00278
00279 /*---------------------------------------------------------------------------*\
00280  * NAME: IsLegacySecurityModel                                               *
00281  * --------------------------------------------------------------------------*
00282  * DESCRIPTION: Returns a boolean value of TRUE if this system is running    *
00283  * a legacy security model.                                                  *
00284 \*---------------------------------------------------------------------------*/
00285 BOOL IsLegacySecurityModel ()
00286 {
00287     BOOL fReturnValue = FALSE;
00288     OSVERSIONINFOEX VersionInfo = {sizeof(VersionInfo)};
00289
00290     if(GetVersionEx ((LPOSVERSIONINFO)&VersionInfo))
00291     {
00292
00293         if(VersionInfo.dwMajorVersion == VERSION_MAJOR_W2K_XP_W2K3)
00294         {
00295             if(VersionInfo.dwMinorVersion < VERSION_MINOR_XP)
00296             {
00297                 fReturnValue = TRUE;
00298             }
00299             else if(VersionInfo.dwMinorVersion == VERSION_MINOR_XP)
00300             {
00301                 if(VersionInfo.wServicePackMajor < 2)
00302                 {
00303                     fReturnValue = TRUE;
00304                 }
00305             }
00306             else if(VersionInfo.dwMinorVersion == VERSION_MINOR_W2K3)
00307             {
00308                 if(VersionInfo.wServicePackMajor < 1)
00309                 {
00310                     fReturnValue = TRUE;
00311                 }
00312             }
00313
00314         }
00315         else if(VersionInfo.dwMajorVersion < VERSION_MAJOR_W2K_XP_W2K3)
00316         {
00317             fReturnValue = TRUE;
00318         }
00319
00320     }
00321
00322     return fReturnValue;
00323 }
00324
00325
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • CMenu

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120                 MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122                 // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal)     {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ConnectOptionEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ConnectOptionEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: ConnectOptionEnum
00019
00020 public class ConnectOptionEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adConnectUnspecified = -1;
00023   public static final short adAsyncConnect = 16;
00024 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_NAMEMAP Member List

This is the complete list of members for _NAMEMAP, including all inherited members.
lItem | _NAMEMAP
pszName | _NAMEMAP
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/app.h Source File

  • Com
  • Fundamentals
  • SimpDnd

app.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: app.h
00003 //
00004 //      Definition of CSimpleApp
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _APP_H_)
00010 #define _APP_H_
00011
00012 #include <ole2.h>
00013 #include <stablize.h>
00014
00015 class CSimpleDoc;
00016
00017 class CSimpleApp : public IUnknown, public CSafeRefCount
00018 {
00019 public:
00020
00021         HWND m_hAppWnd;         // main window handle
00022         HINSTANCE m_hInst;      // application instance
00023         CSimpleDoc FAR * m_lpDoc;   // pointer to document object
00024         BOOL m_fInitialized;    // OLE initialization flag
00025         BOOL m_fOleStdInit;     // OleStd library initialization flag
00026         HMENU           m_hMainMenu;
00027         HMENU           m_hFileMenu;
00028         HMENU           m_hEditMenu;
00029         HMENU           m_hHelpMenu;
00030         HMENU           m_hCascadeMenu;     // OLE object's verb
00031
00032
00033         // Drag/Drop related fields
00034         int m_nDragDelay;       // time delay (in msec) before drag should start
00035         int m_nDragMinDist;     // min. distance (radius) before drag should start
00036         int m_nScrollDelay;     // time delay (in msec) before scroll should start
00037         int m_nScrollInset;     // Border inset distance to start drag scroll
00038         int m_nScrollInterval;  // scroll interval time (in msec)
00039
00040         CSimpleApp();           // Constructor
00041         ~CSimpleApp();          // Destructor
00042
00043         // IUnknown Interfaces
00044         STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
00045         STDMETHODIMP_(ULONG) AddRef();
00046         STDMETHODIMP_(ULONG) Release();
00047
00048         // Initialization methods
00049
00050         BOOL fInitApplication (HANDLE hInstance);
00051         BOOL fInitInstance (HANDLE hInstance, int nCmdShow);
00052
00053         // Message handling methods
00054
00055         long lCommandHandler (HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
00056         long lSizeHandler (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00057         long lCreateDoc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00058         BOOL HandleAccelerators (LPMSG lpMsg);
00059         void PaintApp(HDC hDC);
00060         void DestroyDocs();
00061 };
00062
00063 #endif  // _APP_H_
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerServe/Factory.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerServe

Factory.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.CPP
00003
00004   Summary:   Implementation file for the class factories of the PERSERVE
00005              server.  This server provides the PageList COM component.
00006              For this component, IClassFactory is implemented in an
00007              appropriate class factory COM object: CFPageList. The COM
00008              component that can be manufactured by this server is known
00009              outside the server by its CLSID: CLSID_PageList.
00010
00011              The class factories in this server use the CThreaded
00012              OwnThis mechanism to ensure mutually exclusive access by
00013              contending multiple threads.
00014
00015              For a comprehensive tutorial code tour of this module's
00016              contents and offerings see the tutorial PERSERVE.HTM
00017              file. For more specific technical details on the internal
00018              workings see the comments dispersed throughout the module's
00019              source code.
00020
00021   Classes:   CFPageList.
00022
00023   Functions: .
00024
00025   Origin:    5-20-97: atrent - Editor-inheritance from FACTORY.CPP in
00026                the STOSERVE Tutorial Code Sample.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 /*---------------------------------------------------------------------------
00044   We include WINDOWS.H for all Win32 applications.
00045   We include OLE2.H because we will be calling the COM/OLE Libraries.
00046   We include OLECTL.H because it has definitions for connectable objects.
00047   We include APPUTIL.H because we will be building this DLL using
00048     the convenient Virtual Window and Dialog classes and other
00049     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00050   We include IPAGES.H and PAGEGUID.H for the common PageList-related
00051     Interface class, GUID, and CLSID specifications.
00052   We include SERVER.H because it has the necessary internal class and
00053     resource definitions for this DLL.
00054   We include FACTORY.H because it has the necessary internal class factory
00055     declarations for this DLL component server.  Those factories we will be
00056     implementing in this module.
00057   We include CONNECT.H for object class declarations for the various
00058     connection point and connection COM objects used in PERSERVE.
00059   We include PAGELIST.H, for the object class declarations for the
00060     COPageList COM object.
00061 ---------------------------------------------------------------------------*/
00062 #include <windows.h>
00063 #include <ole2.h>
00064 #include <olectl.h>
00065 #include <apputil.h>
00066 #include <ipages.h>
00067 #include <pageguid.h>
00068 #include "server.h"
00069 #include "factory.h"
00070 #include "connect.h"
00071 #include "pagelist.h"
00072
00073 /*---------------------------------------------------------------------------
00074   Implementation the CFPageList Class Factory.  CFPageList is the COM
00075   object class for the Class Factory that can manufacture COPageList
00076   COM Components.
00077 ---------------------------------------------------------------------------*/
00078
00079 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00080   Method:   CFPageList::CFPageList
00081
00082   Summary:  CFPageList Constructor. Note the member initializer:
00083             "m_ImpIClassFactory(this, pUnkOuter, pServer)" which is used
00084             to pass the 'this', pUnkOuter, and pServer pointers of this
00085             constructor function to the constructor executed in the
00086             instantiation of the CImpIClassFactory interface whose
00087             implementation is nested inside this present object class.
00088
00089   Args:     IUnknown* pUnkOuter,
00090               Pointer to the the outer Unknown.  NULL means this COM Object
00091               is not being Aggregated.  Non NULL means it is being created
00092               on behalf of an outside COM object that is reusing it via
00093               aggregation.
00094             CServer* pServer)
00095               Pointer to the server's control object.
00096
00097   Modifies: m_cRefs, m_pUnkOuter.
00098
00099   Returns:  void
00100 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00101 CFPageList::CFPageList(
00102   IUnknown* pUnkOuter,
00103   CServer* pServer) :
00104   m_ImpIClassFactory(this, pUnkOuter, pServer)
00105 {
00106   // Zero the COM object's reference count.
00107   m_cRefs = 0;
00108
00109   // No AddRef necessary if non-NULL, as we're nested.
00110   m_pUnkOuter = pUnkOuter;
00111
00112   // Init the pointer to the server control object.
00113   m_pServer = pServer;
00114
00115   return;
00116 }
00117
00118
00119 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00120   Method:   CFPageList::~CFPageList
00121
00122   Summary:  CFPageList Destructor.
00123
00124   Args:     void
00125
00126   Returns:  void
00127 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00128 CFPageList::~CFPageList(void)
00129 {
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   CFPageList::QueryInterface
00136
00137   Summary:  QueryInterface of the CFPageList non-delegating
00138             IUnknown implementation.
00139
00140   Args:     REFIID riid,
00141               [in] GUID of the Interface being requested.
00142             PPVOID ppv)
00143               [out] Address of the caller's pointer variable that will
00144               receive the requested interface pointer.
00145
00146   Returns:  HRESULT
00147               Standard result code. NOERROR for success.
00148 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00149 STDMETHODIMP CFPageList::QueryInterface(
00150                REFIID riid,
00151                PPVOID ppv)
00152 {
00153   HRESULT hr = E_NOINTERFACE;
00154
00155   if (OwnThis())
00156   {
00157     *ppv = NULL;
00158
00159     if (IID_IUnknown == riid)
00160       *ppv = this;
00161     else if (IID_IClassFactory == riid)
00162       *ppv = &m_ImpIClassFactory;
00163
00164     if (NULL != *ppv)
00165     {
00166       // We've handed out a pointer to the interface so obey the COM rules
00167       // and AddRef the reference count.
00168       ((LPUNKNOWN)*ppv)->AddRef();
00169       hr = NOERROR;
00170     }
00171
00172     UnOwnThis();
00173   }
00174
00175   return (hr);
00176 }
00177
00178
00179 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00180   Method:   CFPageList::AddRef
00181
00182   Summary:  AddRef of the CFPageList non-delegating IUnknown implementation.
00183
00184   Args:     void
00185
00186   Modifies: m_cRefs.
00187
00188   Returns:  ULONG
00189               New value of m_cRefs (COM object's reference count).
00190 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00191 STDMETHODIMP_(ULONG) CFPageList::AddRef(void)
00192 {
00193   ULONG cRefs;
00194
00195   if (OwnThis())
00196   {
00197     cRefs = ++m_cRefs;
00198
00199     UnOwnThis();
00200   }
00201
00202   return cRefs;
00203 }
00204
00205
00206 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00207   Method:   CFPageList::Release
00208
00209   Summary:  Release of the CFPageList non-delegating IUnknown implementation.
00210
00211   Args:     void
00212
00213   Modifies: m_cRefs.
00214
00215   Returns:  ULONG
00216               New value of m_cRefs (COM object's reference count).
00217 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00218 STDMETHODIMP_(ULONG) CFPageList::Release(void)
00219 {
00220   ULONG cRefs;
00221
00222   if (OwnThis())
00223   {
00224     cRefs = --m_cRefs;
00225
00226     if (0 == cRefs)
00227     {
00228       // We've reached a zero reference count for this COM object.
00229       // So we tell the server housing to decrement its global object
00230       // count so that the server will be unloaded if appropriate.
00231       if (NULL != m_pServer)
00232         m_pServer->ObjectsDown();
00233
00234       // We artificially bump the main ref count to prevent reentrancy
00235       // via the main object destructor.  Not really needed in this
00236       // CFPageList but a good practice because we are aggregatable and
00237       // may at some point in the future add something entertaining like
00238       // some Releases to the CFPageList destructor.
00239       m_cRefs++;
00240       UnOwnThis();
00241       delete this;
00242     }
00243     else
00244       UnOwnThis();
00245   }
00246
00247   return cRefs;
00248 }
00249
00250
00251 /*---------------------------------------------------------------------------
00252   CFPageList's nested implementation of the IClassFactory interface
00253   including Constructor, Destructor, QueryInterface, AddRef, Release,
00254   CreateInstance, and LockServer methods.
00255 ---------------------------------------------------------------------------*/
00256
00257 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00258   Method:   CFPageList::CImpIClassFactory::CImpIClassFactory
00259
00260   Summary:  Constructor for the CImpIClassFactory interface instantiation.
00261
00262   Args:     CFPageList* pCO,
00263               Back pointer to the parent outer object.
00264             IUnknown* pUnkOuter,
00265               Pointer to the outer Unknown.  For delegation.
00266             CServer* pServer)
00267               Pointer to the server's control object.
00268
00269   Modifies: m_pCO, m_pUnkOuter, m_pServer.
00270
00271   Returns:  void
00272 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00273 CFPageList::CImpIClassFactory::CImpIClassFactory(
00274   CFPageList* pCO,
00275   IUnknown* pUnkOuter,
00276   CServer* pServer)
00277 {
00278   // Init the Back Object Pointer to point to the parent object.
00279   m_pCO = pCO;
00280
00281   // Init the pointer to the server control object.
00282   m_pServer = pServer;
00283
00284   // Init the CImpIClassFactory interface's delegating Unknown pointer.
00285   // We use a pointer to the main COM object for later IUnknown delegation
00286   // here if we are not being aggregated. If we are being aggregated we
00287   // use the supplied pUnkOuter for IUnknown delegation. In either case
00288   // the pointer assignment requires no AddRef because the
00289   // CImpIClassFactory lifetime is quaranteed by the lifetime of the
00290   //  parent object in which CImpIClassFactory is nested.
00291   if (NULL == pUnkOuter)
00292     m_pUnkOuter = pCO;
00293   else
00294     m_pUnkOuter = pUnkOuter;
00295
00296   return;
00297 }
00298
00299
00300 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00301   Method:   CFPageList::CImpIClassFactory::~CImpIClassFactory
00302
00303   Summary:  Destructor for the CImpIClassFactory interface instantiation.
00304
00305   Args:     void
00306
00307   Returns:  void
00308 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00309 CFPageList::CImpIClassFactory::~CImpIClassFactory(void)
00310 {
00311   return;
00312 }
00313
00314
00315 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00316   Method:   CFPageList::CImpIClassFactory::QueryInterface
00317
00318   Summary:  The QueryInterface IUnknown member of this IClassFactory
00319             interface implementation that delegates to m_pUnkOuter,
00320             whatever it is.
00321
00322   Args:     REFIID riid,
00323               [in] GUID of the Interface being requested.
00324             PPVOID ppv)
00325               [out] Address of the caller's pointer variable that will
00326               receive the requested interface pointer.
00327
00328   Returns:  HRESULT
00329               Standard result code. NOERROR for success.
00330               Returned by the delegated outer QueryInterface call.
00331 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00332 STDMETHODIMP CFPageList::CImpIClassFactory::QueryInterface(
00333                REFIID riid,
00334                PPVOID ppv)
00335 {
00336   // Delegate this call to the outer object's QueryInterface.
00337   return m_pUnkOuter->QueryInterface(riid, ppv);
00338 }
00339
00340
00341 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00342   Method:   CFPageList::CImpIClassFactory::AddRef
00343
00344   Summary:  The AddRef IUnknown member of this IClassFactory interface
00345             implementation that delegates to m_pUnkOuter, whatever it is.
00346
00347   Args:     void
00348
00349   Returns:  ULONG
00350               Returned by the delegated outer AddRef call.
00351 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00352 STDMETHODIMP_(ULONG) CFPageList::CImpIClassFactory::AddRef(void)
00353 {
00354   // Delegate this call to the outer object's AddRef.
00355   return m_pUnkOuter->AddRef();
00356 }
00357
00358
00359 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00360   Method:   CFPageList::CImpIClassFactory::Release
00361
00362   Summary:  The Release IUnknown member of this IClassFactory interface
00363             implementation that delegates to m_pUnkOuter, whatever it is.
00364
00365   Args:     void
00366
00367   Returns:  ULONG
00368               Returned by the delegated outer Release call.
00369 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00370 STDMETHODIMP_(ULONG) CFPageList::CImpIClassFactory::Release(void)
00371 {
00372   // Delegate this call to the outer object's Release.
00373   return m_pUnkOuter->Release();
00374 }
00375
00376
00377 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00378   Method:   CFPageList::CImpIClassFactory::CreateInstance
00379
00380   Summary:  The CreateInstance member method of this IClassFactory
00381             interface implementation.  Creates an instance of the
00382             COPageList COM component.
00383
00384   Args:     IUnknown* pUnkOuter,
00385               [in] Pointer to the controlling IUnknown.
00386             REFIID riid,
00387               [in] GUID of the Interface being requested.
00388             PPVOID ppv)
00389               [out] Address of the caller's pointer variable that will
00390               receive the requested interface pointer.
00391
00392   Returns:  HRESULT
00393               Standard result code. NOERROR for success.
00394 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00395 STDMETHODIMP CFPageList::CImpIClassFactory::CreateInstance(
00396                IUnknown* pUnkOuter,
00397                REFIID riid,
00398                PPVOID ppv)
00399 {
00400   HRESULT hr = E_FAIL;
00401   COPageList* pCO = NULL;
00402
00403   // NULL the output pointer.
00404   *ppv = NULL;
00405
00406   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00407   // the COM rules state the IUnknown interface MUST also be concomitantly
00408   // be requested.  If it is not so requested (riid != IID_IUnknown) then
00409   // an error must be returned indicating that no aggregate creation of
00410   // the CFPageList COM Object can be performed.
00411   if (NULL != pUnkOuter && riid != IID_IUnknown)
00412     hr = CLASS_E_NOAGGREGATION;
00413   else
00414   {
00415     // Instantiate a COPageList COM Object.
00416     pCO = new COPageList(pUnkOuter, m_pServer);
00417     if (NULL != pCO)
00418     {
00419       // Create and initialize any subordinate objects.
00420       hr = pCO->Init();
00421       if (SUCCEEDED(hr))
00422       {
00423         // We successfully created the new COM object so tell the server
00424         // to increment its global server object count to help ensure
00425         // that the server remains loaded until this partial creation
00426         // of a COM component is completed.
00427         m_pServer->ObjectsUp();
00428
00429         // We QueryInterface this new COM Object not only to deposit the
00430         // main interface pointer to the caller's pointer variable, but to
00431         // also automatically bump the Reference Count on the new COM
00432         // Object after handing out this reference to it.
00433         hr = pCO->QueryInterface(riid, (PPVOID)ppv);
00434         if (FAILED(hr))
00435         {
00436           m_pServer->ObjectsDown();
00437           delete pCO;
00438         }
00439       }
00440       else
00441         delete pCO;
00442     }
00443     else
00444       hr = E_OUTOFMEMORY;
00445   }
00446
00447   return hr;
00448 }
00449
00450
00451 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00452   Method:   CFPageList::CImpIClassFactory::LockServer
00453
00454   Summary:  The LockServer member method of this IClassFactory interface
00455             implementation.
00456
00457   Args:     BOOL bLock)
00458               [in] Flag determining whether to Lock or Unlock the server.
00459
00460   Returns:  HRESULT
00461               Standard result code. NOERROR for success.
00462 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00463 STDMETHODIMP CFPageList::CImpIClassFactory::LockServer(
00464                BOOL bLock)
00465 {
00466   HRESULT hr = NOERROR;
00467
00468   if (bLock)
00469     m_pServer->Lock();
00470   else
00471     m_pServer->Unlock();
00472
00473   return hr;
00474 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConServe/Server.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ConServe

Server.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.H
00003
00004   Summary:   Internal include file for the CONSERVE.DLL server code
00005              sample.  Contains class declarations, resource IDs and
00006              string macros for internal use in constructing this DLL
00007              as a COM component server.  Declares the CServer server
00008              control object class.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial CONSERVE.HTM
00012              file. For more specific technical details on the internal
00013              workings see the comments dispersed throughout the module's
00014              source code.
00015
00016   Classes:   CServer.
00017
00018   Functions: none
00019
00020   Origin:    5-30-96: atrent - Editor-inheritance from SERVER.H in
00021                the FRESERVE Tutorial Code Sample.
00022
00023 ----------------------------------------------------------------------------
00024   This file is part of the Microsoft COM Tutorial Code Samples.
00025
00026   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00027
00028   This source code is intended only as a supplement to Microsoft
00029   Development Tools and/or on-line documentation.  See these other
00030   materials for detailed information regarding Microsoft code samples.
00031
00032   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00033   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00034   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00035   PARTICULAR PURPOSE.
00036 ==========================================================================+*/
00037
00038
00039 #if !defined(SERVER_H)
00040 #define SERVER_H
00041
00042 // Error-related String Identifiers.
00043 #define IDS_ASSERT_FAIL             2200
00044
00045
00046 #ifdef __cplusplus
00047
00048 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00049   Class:    CServer
00050
00051   Summary:  Class to encapsulate control of this COM server (eg, handle
00052             Lock and Object counting, encapsulate otherwise global data).
00053
00054   Methods:  none
00055 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00056 class CServer : public CThreaded
00057 {
00058   public:
00059     CServer(void);
00060     ~CServer(void);
00061
00062     // Methods for server lifetime control: object counts and lock counts.
00063     void Lock(void);
00064     void Unlock(void);
00065     void ObjectsUp(void);
00066     void ObjectsDown(void);
00067     HRESULT CanUnloadNow(void);
00068
00069     // A place to store the handle to loaded instance of this DLL module.
00070     HINSTANCE m_hDllInst;
00071
00072     // A place to store a client's parent window.
00073     HWND m_hWndParent;
00074
00075     // Global DLL Server living Object count.
00076     LONG m_cObjects;
00077
00078     // Global DLL Server Client Lock count.
00079     LONG m_cLocks;
00080 };
00081
00082 #endif // __cplusplus
00083
00084 // Allow other internal CONSERVE modules to get at the globals.
00085 extern CServer* g_pServer;
00086
00087
00088 #endif // SERVER_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MSDFHDL::IDataFactoryHandler Member List

This is the complete list of members for MSDFHDL::IDataFactoryHandler, including all inherited members.
GetRecordset([in] BSTR conn,[in] BSTR args,[in] BSTR query,[out, retval] _Recordset **ppRS) | MSDFHDL::IDataFactoryHandler
OpenConnection([in] BSTR conn,[in] BSTR args,[in] long lFlags,[in, out] BSTR *pQuery,[out, retval] _Connection **ppConnection) | MSDFHDL::IDataFactoryHandler
Reconnect([in] BSTR conn,[in] BSTR args,[in] _Recordset *pRS) | MSDFHDL::IDataFactoryHandler
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/StdAfx.Cpp Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/adevent/ADEvent.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • adevent

ADEvent.cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 2002 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ADEvent.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include <olectl.h>
00023 #include <shlobj.h>
00024 #include <dsclient.h>
00025 #include "ADEvent.h"
00026
00027 #include <initguid.h>
00028 #include <dsadmin.h>
00029
00030 /**************************************************************************
00031    private function prototypes
00032 **************************************************************************/
00033
00034 int WideCharToLocal(LPTSTR pLocal, LPWSTR pWide, DWORD dwChars);
00035 int LocalToWideChar(LPWSTR pWide, LPTSTR pLocal, DWORD dwChars);
00036 BOOL DeleteEntireKey(HKEY hKey, LPTSTR pszSubKey);
00037
00038 /**************************************************************************
00039    global variables and definitions
00040 **************************************************************************/
00041
00042 // {08698521-653C-4386-B206-DFA3C0F904E5}
00043 DEFINE_GUID(CLSID_AdminEventHandler,
00044 0x8698521, 0x653c, 0x4386, 0xb2, 0x6, 0xdf, 0xa3, 0xc0, 0xf9, 0x4, 0xe5);
00045
00046 HINSTANCE   g_hInst;
00047 UINT        g_DllRefCount;
00048 TCHAR       g_szMainTitle[] = TEXT("Sample AD Admin Notification Handler");
00049
00050 #define ARRAYSIZE(a)    (sizeof(a)/sizeof(a[0]))
00051
00052
00053 /**************************************************************************
00054
00055     DllMain
00056
00057 **************************************************************************/
00058
00059 extern "C" BOOL WINAPI DllMain(  HINSTANCE hInstance,
00060                                  DWORD dwReason,
00061                                  LPVOID lpReserved)
00062 {
00063     switch(dwReason)
00064     {
00065     case DLL_PROCESS_ATTACH:
00066         g_hInst = hInstance;
00067         break;
00068     }
00069
00070     return TRUE;
00071 }
00072
00073 /**************************************************************************
00074
00075     DllCanUnloadNow
00076
00077 **************************************************************************/
00078
00079 STDAPI DllCanUnloadNow(void)
00080 {
00081     return (g_DllRefCount == 0) ? S_OK : S_FALSE;
00082 }
00083
00084 /**************************************************************************
00085
00086     DllGetClassObject
00087
00088 **************************************************************************/
00089
00090 STDAPI DllGetClassObject(   REFCLSID rclsid,
00091                             REFIID riid,
00092                             LPVOID *ppReturn)
00093 {
00094     *ppReturn = NULL;
00095
00096     //if we don't support this classid, return the proper error code
00097     if(!IsEqualCLSID(rclsid, CLSID_AdminEventHandler))
00098     {
00099         return CLASS_E_CLASSNOTAVAILABLE;
00100     }
00101
00102     //create a CClassFactory object and check it for validity
00103     CClassFactory *pClassFactory = new CClassFactory();
00104     if(NULL == pClassFactory)
00105     {
00106         return E_OUTOFMEMORY;
00107     }
00108
00109     //get the QueryInterface return for our return value
00110     HRESULT hr = pClassFactory->QueryInterface(riid, ppReturn);
00111
00112     //call Release to decement the ref count - creating the object set it to one
00113     //and QueryInterface incremented it - since its being used externally (not by
00114     //us), we only want the ref count to be 1
00115     pClassFactory->Release();
00116
00117     //return the result from QueryInterface
00118     return hr;
00119 }
00120
00121 /**************************************************************************
00122
00123     DllRegisterServer
00124
00125 **************************************************************************/
00126
00127 typedef struct _REGSTRUCT
00128 {
00129     HKEY  hRootKey;
00130     LPTSTR lpszSubKey;
00131     LPTSTR lpszValueName;
00132     LPTSTR lpszData;
00133 }REGSTRUCT, *LPREGSTRUCT;
00134
00135 STDAPI DllRegisterServer(void)
00136 {
00137     int      i;
00138     HKEY     hKey;
00139     LRESULT  lResult;
00140     DWORD    dwDisp;
00141     TCHAR    szSubKey[MAX_PATH];
00142     TCHAR    szCLSID[MAX_PATH];
00143     TCHAR    szModule[MAX_PATH];
00144     LPWSTR   pwsz;
00145
00146     //get the CLSID in string form
00147     StringFromIID(CLSID_AdminEventHandler, &pwsz);
00148
00149     if(pwsz)
00150     {
00151         WideCharToLocal(szCLSID, pwsz, ARRAYSIZE(szCLSID));
00152
00153         //free the string
00154         LPMALLOC pMalloc;
00155         CoGetMalloc(1, &pMalloc);
00156         if(pMalloc)
00157         {
00158             pMalloc->Free(pwsz);
00159             pMalloc->Release();
00160         }
00161     }
00162
00163     //get this DLL's path and file name
00164     GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule));
00165
00166     //register the CLSID entries
00167     REGSTRUCT ClsidEntries[] = {HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s"),                                   NULL,                   g_szMainTitle,
00168                                 HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),                   NULL,                   TEXT("%s"),
00169                                 HKEY_CLASSES_ROOT,   TEXT("CLSID\\%s\\InprocServer32"),                   TEXT("ThreadingModel"), TEXT("Apartment"),
00170                                 NULL,                NULL,                                                NULL,                   NULL};
00171
00172     for(i = 0; ClsidEntries[i].hRootKey; i++)
00173     {
00174         //Create the sub key string.
00175         wsprintf(szSubKey, ClsidEntries[i].lpszSubKey, szCLSID);
00176
00177         lResult = RegCreateKeyEx(   ClsidEntries[i].hRootKey,
00178                                     szSubKey,
00179                                     0,
00180                                     NULL,
00181                                     REG_OPTION_NON_VOLATILE,
00182                                     KEY_WRITE,
00183                                     NULL,
00184                                     &hKey,
00185                                     &dwDisp);
00186
00187         if(NOERROR == lResult)
00188         {
00189             TCHAR szData[MAX_PATH] = TEXT("");
00190
00191             //if necessary, create the value string
00192             wsprintf(szData, ClsidEntries[i].lpszData, szModule);
00193
00194             lResult = RegSetValueEx(    hKey,
00195                                         ClsidEntries[i].lpszValueName,
00196                                         0,
00197                                         REG_SZ,
00198                                         (LPBYTE)szData,
00199                                         lstrlen(szData) + 1);
00200
00201             RegCloseKey(hKey);
00202         }
00203         else
00204         {
00205             return SELFREG_E_CLASS;
00206         }
00207     }
00208
00209     return S_OK;
00210 }
00211
00212 /**************************************************************************
00213
00214    DllUnregisterServer()
00215
00216 **************************************************************************/
00217
00218 STDAPI DllUnregisterServer(VOID)
00219 {
00220     LPWSTR   pwsz;
00221     TCHAR    szCLSID[MAX_PATH];
00222     TCHAR    szSubKey[MAX_PATH];
00223
00224     //get the CLSID in string form
00225     StringFromIID(CLSID_AdminEventHandler, &pwsz);
00226
00227     if(pwsz)
00228     {
00229         WideCharToLocal(szCLSID, pwsz, ARRAYSIZE(szCLSID));
00230
00231         //free the string
00232         CoTaskMemFree(pwsz);
00233     }
00234     else
00235     {
00236         return E_FAIL;
00237     }
00238
00239     //delete the object's registry entries
00240     wsprintf(szSubKey, TEXT("CLSID\\%s"), szCLSID);
00241     DeleteEntireKey(HKEY_CLASSES_ROOT, szSubKey);
00242
00243     return S_OK;
00244 }
00245
00246 ///////////////////////////////////////////////////////////////////////////
00247 //
00248 // IClassFactory implementation
00249 //
00250
00251 /**************************************************************************
00252
00253     CClassFactory::CClassFactory
00254
00255 **************************************************************************/
00256
00257 CClassFactory::CClassFactory()
00258 {
00259     m_ObjRefCount = 1;
00260     g_DllRefCount++;
00261 }
00262
00263 /**************************************************************************
00264
00265     CClassFactory::~CClassFactory
00266
00267 **************************************************************************/
00268
00269 CClassFactory::~CClassFactory()
00270 {
00271     g_DllRefCount--;
00272 }
00273
00274 /**************************************************************************
00275
00276     CClassFactory::QueryInterface
00277
00278 **************************************************************************/
00279
00280 STDMETHODIMP CClassFactory::QueryInterface(  REFIID riid,
00281                                              LPVOID FAR * ppReturn)
00282 {
00283     *ppReturn = NULL;
00284
00285     if(IsEqualIID(riid, IID_IUnknown))
00286     {
00287         *ppReturn = (LPUNKNOWN)(LPCLASSFACTORY)this;
00288     }
00289
00290     if(IsEqualIID(riid, IID_IClassFactory))
00291     {
00292         *ppReturn = (LPCLASSFACTORY)this;
00293     }
00294
00295     if(*ppReturn)
00296     {
00297         (*(LPUNKNOWN*)ppReturn)->AddRef();
00298         return S_OK;
00299     }
00300
00301     return E_NOINTERFACE;
00302 }
00303
00304 /**************************************************************************
00305
00306     CClassFactory::AddRef
00307
00308 **************************************************************************/
00309
00310 STDMETHODIMP_(DWORD) CClassFactory::AddRef()
00311 {
00312     return ++m_ObjRefCount;
00313 }
00314
00315
00316 /**************************************************************************
00317
00318     CClassFactory::Release
00319
00320 **************************************************************************/
00321
00322 STDMETHODIMP_(DWORD) CClassFactory::Release()
00323 {
00324     if(--m_ObjRefCount == 0)
00325     {
00326         delete this;
00327         return 0;
00328     }
00329
00330     return m_ObjRefCount;
00331 }
00332
00333 /**************************************************************************
00334
00335     CClassFactory::CreateInstance
00336
00337 **************************************************************************/
00338
00339 STDMETHODIMP CClassFactory::CreateInstance(  LPUNKNOWN pUnknown,
00340                                              REFIID riid,
00341                                              LPVOID FAR * ppObject)
00342 {
00343     *ppObject = NULL;
00344
00345     if(pUnknown != NULL)
00346     {
00347         return CLASS_E_NOAGGREGATION;
00348     }
00349
00350     //add implementation specific code here
00351
00352     CAdminNotifyHandler *pAdminNotifyHandler = new CAdminNotifyHandler;
00353     if(NULL == pAdminNotifyHandler)
00354     {
00355         return E_OUTOFMEMORY;
00356     }
00357
00358     //get the QueryInterface return for our return value
00359     HRESULT hr = pAdminNotifyHandler->QueryInterface(riid, ppObject);
00360
00361     //call Release to decement the ref count
00362     pAdminNotifyHandler->Release();
00363
00364     //return the result from QueryInterface
00365     return hr;
00366 }
00367
00368 /**************************************************************************
00369
00370     CClassFactory::LockServer
00371
00372 **************************************************************************/
00373
00374 STDMETHODIMP CClassFactory::LockServer(BOOL)
00375 {
00376     return E_NOTIMPL;
00377 }
00378
00379
00380 ///////////////////////////////////////////////////////////////////////////
00381 //
00382 // CAdminNotifyHandler implementation
00383 //
00384
00385 /**************************************************************************
00386
00387     CAdminNotifyHandler::CAdminNotifyHandler()
00388
00389 **************************************************************************/
00390
00391 CAdminNotifyHandler::CAdminNotifyHandler()
00392 {
00393     m_ObjRefCount = 1;
00394     g_DllRefCount++;
00395     m_pdoFrom = NULL;
00396     m_pdoTo = NULL;
00397 }
00398
00399 /**************************************************************************
00400
00401     CAdminNotifyHandler::~CAdminNotifyHandler()
00402
00403 **************************************************************************/
00404
00405 CAdminNotifyHandler::~CAdminNotifyHandler()
00406 {
00407     g_DllRefCount--;
00408
00409     End();
00410 }
00411
00412 ///////////////////////////////////////////////////////////////////////////
00413 //
00414 // IUnknown Implementation
00415 //
00416
00417 /**************************************************************************
00418
00419     CAdminNotifyHandler::QueryInterface
00420
00421 **************************************************************************/
00422
00423 STDMETHODIMP CAdminNotifyHandler::QueryInterface( REFIID riid,
00424                                             LPVOID FAR * ppReturn)
00425 {
00426     *ppReturn = NULL;
00427
00428     //IUnknown
00429     if(IsEqualIID(riid, IID_IUnknown))
00430     {
00431         *ppReturn = (LPVOID)this;
00432     }
00433
00434     //IDsAdminNotifyHandler
00435     if(IsEqualIID(riid, IID_IDsAdminNotifyHandler))
00436     {
00437         *ppReturn = (IDsAdminNotifyHandler*)this;
00438     }
00439
00440     if(*ppReturn)
00441     {
00442         (*(LPUNKNOWN*)ppReturn)->AddRef();
00443         return S_OK;
00444     }
00445
00446     return E_NOINTERFACE;
00447 }
00448
00449 /**************************************************************************
00450
00451     CAdminNotifyHandler::AddRef
00452
00453 **************************************************************************/
00454
00455 STDMETHODIMP_(DWORD) CAdminNotifyHandler::AddRef()
00456 {
00457     return ++m_ObjRefCount;
00458 }
00459
00460
00461 /**************************************************************************
00462
00463     CAdminNotifyHandler::Release
00464
00465 **************************************************************************/
00466
00467 STDMETHODIMP_(DWORD) CAdminNotifyHandler::Release()
00468 {
00469     if(--m_ObjRefCount == 0)
00470     {
00471         delete this;
00472         return 0;
00473     }
00474
00475     return m_ObjRefCount;
00476 }
00477
00478 ///////////////////////////////////////////////////////////////////////////
00479 //
00480 // IDsAdminNotifyHandler Implementation
00481 //
00482
00483 /**************************************************************************
00484
00485     CAdminNotifyHandler::Initialize()
00486
00487 **************************************************************************/
00488
00489 STDMETHODIMP CAdminNotifyHandler::Initialize(IDataObject* pExtraInfo,
00490                                              ULONG* puEventFlags)
00491 {
00492     OutputDebugString(TEXT("CAdminNotifyHandler::Initialize\n"));
00493
00494     if(IsBadWritePtr(puEventFlags, sizeof(ULONG)))
00495     {
00496         return E_INVALIDARG;
00497     }
00498
00499     //Tell the host which events the handler wants to receive.
00500     *puEventFlags = DSA_NOTIFY_ALL;
00501
00502     return S_OK;
00503 }
00504
00505 /**************************************************************************
00506
00507     CAdminNotifyHandler::Begin()
00508
00509 **************************************************************************/
00510
00511 STDMETHODIMP CAdminNotifyHandler::Begin(ULONG uEvent,
00512                                         IDataObject* pArg1,
00513                                         IDataObject* pArg2,
00514                                         ULONG* puFlags,
00515                                         BSTR* pBstr)
00516 {
00517     OutputDebugString(TEXT("CAdminNotifyHandler::Begin\n"));
00518
00519     if(NULL == pArg1)
00520     {
00521         return E_INVALIDARG;
00522     }
00523     if(IsBadWritePtr(puFlags, sizeof(ULONG)))
00524     {
00525         return E_INVALIDARG;
00526     }
00527     if(IsBadWritePtr(pBstr, sizeof(BSTR)))
00528     {
00529         return E_INVALIDARG;
00530     }
00531
00532     //release any data objects this handler may already have
00533     End();
00534
00535     //save the data objects
00536     pArg1->QueryInterface(IID_IDataObject, (LPVOID*)&m_pdoFrom);
00537
00538     if(NULL != pArg2)
00539     {
00540         pArg2->QueryInterface(IID_IDataObject, (LPVOID*)&m_pdoTo);
00541     }
00542
00543     STGMEDIUM   stm;
00544     FORMATETC   fe;
00545     HRESULT     hr;
00546
00547     fe.cfFormat = (CLIPFORMAT)RegisterClipboardFormat(CFSTR_DSOBJECTNAMES);
00548     fe.ptd = NULL;
00549     fe.dwAspect = DVASPECT_CONTENT;
00550     fe.lindex = -1;
00551     fe.tymed = TYMED_HGLOBAL;
00552     hr = pArg1->GetData(&fe, &stm);
00553     if(SUCCEEDED(hr))
00554     {
00555         LPDSOBJECTNAMES pdson = (LPDSOBJECTNAMES)GlobalLock(stm.hGlobal);
00556
00557         if(pdson)
00558         {
00559             LPWSTR  pwszName = (LPWSTR)((LPBYTE)pdson + pdson->aObjects[0].offsetName);
00560             LPWSTR  pwszClass = (LPWSTR)((LPBYTE)pdson + pdson->aObjects[0].offsetClass);
00561
00562             OutputDebugString(TEXT("\t"));
00563             OutputDebugStringW(pwszClass);
00564             OutputDebugString(TEXT(" - "));
00565             OutputDebugStringW(pwszName);
00566             OutputDebugString(TEXT("\n"));
00567
00568             GlobalUnlock(stm.hGlobal);
00569         }
00570
00571         ReleaseStgMedium(&stm);
00572     }
00573
00574     if(pArg2)
00575     {
00576         fe.cfFormat = (CLIPFORMAT)RegisterClipboardFormat(CFSTR_DSOBJECTNAMES);
00577         fe.ptd = NULL;
00578         fe.dwAspect = DVASPECT_CONTENT;
00579         fe.lindex = -1;
00580         fe.tymed = TYMED_HGLOBAL;
00581         hr = pArg2->GetData(&fe, &stm);
00582         if(SUCCEEDED(hr))
00583         {
00584             LPDSOBJECTNAMES pdson = (LPDSOBJECTNAMES)GlobalLock(stm.hGlobal);
00585
00586             if(pdson)
00587             {
00588                 LPWSTR  pwszName = (LPWSTR)((LPBYTE)pdson + pdson->aObjects[0].offsetName);
00589                 LPWSTR  pwszClass = (LPWSTR)((LPBYTE)pdson + pdson->aObjects[0].offsetClass);
00590
00591                 OutputDebugString(TEXT("\t"));
00592                 OutputDebugStringW(pwszClass);
00593                 OutputDebugString(TEXT(" - "));
00594                 OutputDebugStringW(pwszName);
00595                 OutputDebugString(TEXT("\n"));
00596
00597                 GlobalUnlock(stm.hGlobal);
00598             }
00599
00600             ReleaseStgMedium(&stm);
00601         }
00602     }
00603
00604     *puFlags = DSA_NOTIFY_FLAG_ADDITIONAL_DATA |
00605                 DSA_NOTIFY_FLAG_FORCE_ADDITIONAL_DATA;
00606
00607     WCHAR   wszTitle[MAX_PATH];
00608     LocalToWideChar(wszTitle, g_szMainTitle, MAX_PATH);
00609     *pBstr = SysAllocString(wszTitle);
00610
00611     return *pBstr ? S_OK : E_OUTOFMEMORY;
00612 }
00613
00614 /**************************************************************************
00615
00616     CAdminNotifyHandler::Notify()
00617
00618 **************************************************************************/
00619
00620 STDMETHODIMP CAdminNotifyHandler::Notify(ULONG nItem, ULONG uFlags)
00621 {
00622     OutputDebugString(TEXT("CAdminNotifyHandler::Notify\n"));
00623
00624     return S_OK;
00625 }
00626
00627 /**************************************************************************
00628
00629     CAdminNotifyHandler::End()
00630
00631 **************************************************************************/
00632
00633 STDMETHODIMP CAdminNotifyHandler::End(void)
00634 {
00635     OutputDebugString(TEXT("CAdminNotifyHandler::End\n"));
00636
00637     if(m_pdoFrom)
00638     {
00639         m_pdoFrom->Release();
00640         m_pdoFrom = NULL;
00641     }
00642     if(m_pdoTo)
00643     {
00644         m_pdoTo->Release();
00645         m_pdoTo = NULL;
00646     }
00647
00648     return S_OK;
00649 }
00650
00651
00652 /**************************************************************************
00653
00654     WideCharToLocal()
00655
00656 **************************************************************************/
00657
00658 int WideCharToLocal(LPTSTR pLocal, LPWSTR pWide, DWORD dwChars)
00659 {
00660     *pLocal = 0;
00661
00662     #ifdef UNICODE
00663     lstrcpyn(pLocal, pWide, dwChars);
00664     #else
00665     WideCharToMultiByte(    CP_ACP,
00666                             0,
00667                             pWide,
00668                             -1,
00669                             pLocal,
00670                             dwChars,
00671                             NULL,
00672                             NULL);
00673     #endif
00674
00675     return lstrlen(pLocal);
00676 }
00677
00678 /**************************************************************************
00679
00680     LocalToWideChar()
00681
00682 **************************************************************************/
00683
00684 int LocalToWideChar(LPWSTR pWide, LPTSTR pLocal, DWORD dwChars)
00685 {
00686     *pWide = 0;
00687
00688     #ifdef UNICODE
00689     lstrcpyn(pWide, pLocal, dwChars);
00690     #else
00691     MultiByteToWideChar(    CP_ACP,
00692                             0,
00693                             pLocal,
00694                             -1,
00695                             pWide,
00696                             dwChars);
00697     #endif
00698
00699     return lstrlenW(pWide);
00700 }
00701
00702 /**************************************************************************
00703
00704    DeleteEntireKey()
00705
00706 **************************************************************************/
00707
00708 BOOL DeleteEntireKey(HKEY hKey, LPTSTR pszSubKey)
00709 {
00710     LRESULT  lResult;
00711     HKEY     hEnumKey;
00712
00713     lResult = RegOpenKeyEx( hKey,
00714                             pszSubKey,
00715                             0,
00716                             KEY_ENUMERATE_SUB_KEYS,
00717                             &hEnumKey);
00718
00719     if(NOERROR == lResult)
00720     {
00721         TCHAR szKey[MAX_PATH];
00722         DWORD dwSize = MAX_PATH;
00723
00724         while(ERROR_SUCCESS == RegEnumKeyEx(hEnumKey, 0, szKey, &dwSize, NULL, NULL, NULL, NULL))
00725         {
00726             DeleteEntireKey(hEnumKey, szKey);
00727
00728             dwSize = MAX_PATH;
00729         }
00730
00731         RegCloseKey(hEnumKey);
00732     }
00733     else
00734     {
00735         return FALSE;
00736     }
00737
00738     RegDeleteKey(hKey, pszSubKey);
00739
00740     return TRUE;
00741 }
00742
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/Upload/cmonitor.h Source File

  • Web
  • bits
  • Upload

cmonitor.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //
00006 //  BITS Upload sample
00007 //  ==================
00008 //
00009 //  Module name:
00010 //  cdialog.h
00011 //
00012 //  Purpose:
00013 //  Defines the class CSimpleDialog, which implements the
00014 //  IBackgroundCopyCallback interface.
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #pragma once
00019
00020 #include <bits.h>
00021
00022 class CMonitor : public IBackgroundCopyCallback
00023 {
00024     LONG m_lRefCount;
00025
00026 public:
00027     CMonitor() { m_lRefCount = 0;};
00028     ~CMonitor() {};
00029
00030     // IUnknown
00031     HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, LPVOID *ppvObj);
00032     ULONG   STDMETHODCALLTYPE AddRef();
00033     ULONG   STDMETHODCALLTYPE Release();
00034
00035     // IBackgroundCopyCallback methods
00036     HRESULT STDMETHODCALLTYPE JobTransferred(IBackgroundCopyJob* pJob);
00037     HRESULT STDMETHODCALLTYPE JobError(IBackgroundCopyJob* pJob, IBackgroundCopyError* pError);
00038     HRESULT STDMETHODCALLTYPE JobModification(IBackgroundCopyJob* pJob, DWORD dwReserved);
00039
00040 private:
00041     HRESULT ProcessReply(IBackgroundCopyJob* pJob);
00042 };
00043
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFullPropSpec Member List

This is the complete list of members for CFullPropSpec, including all inherited members.
_guidPropSet | CFullPropSpec | [private]
_psProperty | CFullPropSpec | [private]
CastToStruct() | CFullPropSpec | [inline]
CastToStruct() const | CFullPropSpec | [inline]
CFullPropSpec() | CFullPropSpec |
CFullPropSpec(GUID const &guidPropSet, PROPID pidProperty) | CFullPropSpec |
CFullPropSpec(GUID const &guidPropSet, WCHAR const *wcsProperty) | CFullPropSpec |
CFullPropSpec(CFullPropSpec const &Property) | CFullPropSpec |
GetPropertyName() const | CFullPropSpec | [inline]
GetPropertyPropid() const | CFullPropSpec | [inline]
GetPropSet() const | CFullPropSpec | [inline]
GetPropSpec() const | CFullPropSpec | [inline]
IsPropertyName() const | CFullPropSpec | [inline]
IsPropertyPropid() const | CFullPropSpec | [inline]
IsValid() const | CFullPropSpec | [inline]
operator delete(void *p) | CFullPropSpec | [inline]
operator new(size_t size) | CFullPropSpec | [inline]
operator new(size_t size, void *p) | CFullPropSpec | [inline]
operator!=(CFullPropSpec const &prop) const | CFullPropSpec |
operator=(CFullPropSpec const &Property) | CFullPropSpec |
operator==(CFullPropSpec const &prop) const | CFullPropSpec |
SetProperty(PROPID pidProperty) | CFullPropSpec |
SetProperty(WCHAR const *wcsProperty) | CFullPropSpec |
SetPropSet(GUID const &guidPropSet) | CFullPropSpec | [inline]
~CFullPropSpec() | CFullPropSpec |
Generated on Wed Nov 13 2024 16:56:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/OHello/Server.Cxx Source File

  • Com
  • Fundamentals
  • Object
  • OHello

Server.Cxx

Go to the documentation of this file.
00001 /*+----------------------------------------------------------------------------
00002
00003 Microsoft Windows Sample Program
00004 Copyright 1994 - 2000 Microsoft Corporation.  All rights reserved.
00005
00006 FILE:       server.cxx
00007
00008 USAGE:      server /REGSERVER   - Installs registry entries for the server.
00009             server /UNREGSERVER - Removes registry entries for the server.
00010             server -Embedding   - Server was auto-started by OLE.
00011
00012 PURPOSE:    Example of an OLE local server using a custom interface.
00013             This program illustrates the correct reference counting and
00014             shutdown behavior for a multiple-use local server.
00015
00016             The sample code is safe for multiple threads.  This is not
00017             really necessary, but it makes it easy to convert this program
00018             to a multi-threaded server for a future version of Windows.
00019
00020             This sample also provides an example of how to use the
00021             Win32 registry functions to install a local server and a
00022             proxy DLL in the registry.
00023
00024
00025 FUNCTIONS:  DecrementLockCount  - Decrement the server's lock count.
00026             IncrementLockCount  - Increment the server's lock count.
00027             main                - Main entry point.
00028             ObjectCreated       - Called when object is created.
00029             ObjectDestroyed     - Called when object is destroyed.
00030             RegisterLocalServer - Create a registry entry for a local server.
00031             RegisterProxyDll    - Create a registry entry for a proxy DLL.
00032             UnregisterLocalServer - Remove a registry entry for a local server.
00033             UnregisterProxyDll  - Remove a registry entry for a proxy DLL.
00034
00035 COMMENTS:   The server program must be installed before running the client.
00036             Run server.exe /REGSERVER to install the server program.
00037
00038 -----------------------------------------------------------------------------*/
00039 #include <windows.h>
00040 #include <stdio.h>
00041 #include "ohello.h"
00042
00043 void    PrintErrorMessage(HRESULT hr);
00044 HRESULT RegisterClassFactory();
00045 HRESULT RevokeClassFactory();
00046
00047 //Prototypes for local functions
00048 HRESULT RegisterLocalServer(REFCLSID rclsid);
00049 HRESULT RegisterProxyDll(const char *pszProxyDll);
00050 HRESULT UnregisterLocalServer(REFCLSID rclsid);
00051 HRESULT UnregisterProxyDll(const char *pszProxyDll);
00052
00053 //CLSID for the server object
00054 extern "C" const CLSID CLSID_OHello
00055     = {0xf9246031,0x9f33,0x11cd,{0xb2,0x3f,0x00,0xaa,0x00,0x33,0x9c,0xce}};
00056
00057 long    g_LockCount   = 0;
00058 long    g_ObjectCount = 0;
00059
00060 //+---------------------------------------------------------------------------
00061 //
00062 //  Function:   DecrementLockCount
00063 //
00064 //  Synopsis:   Decrements the lock count.  The lock count controls the
00065 //              registration of the class factory in the class table.
00066 //              DecrementLockCount revokes the class factory when the
00067 //              lock count is zero.
00068 //
00069 //  Called By:  ~CHello, IClassFactory::LockServer(FALSE).
00070 //
00071 //  See Also:   ObjectCreated, ObjectDestroyed, IncrementLockCount.
00072 //
00073 //----------------------------------------------------------------------------
00074 void DecrementLockCount()
00075 {
00076     //Decrement the lock count.
00077     if(InterlockedDecrement(&g_LockCount) == 0)
00078     {
00079         //When the lock count is decremented to zero,
00080         //revoke the class factory.
00081         RevokeClassFactory();
00082     }
00083 }
00084
00085 //+---------------------------------------------------------------------------
00086 //
00087 //  Function:   IncrementLockCount
00088 //
00089 //  Synopsis:   Increments the lock count.  The lock count controls the
00090 //              registration of the class factory in the class table.
00091 //              If necessary, IncrementLockCount will reregister the class
00092 //              factory in the class table.
00093 //
00094 //  Called By:  CHello, IClassFactory::LockServer(TRUE).
00095 //
00096 //  See Also:   DecrementLockCount, ObjectCreated, ObjectDestroyed.
00097 //
00098 //----------------------------------------------------------------------------
00099 void IncrementLockCount()
00100 {
00101     if(g_LockCount == 0)
00102     {
00103         //Increment the lock count.
00104         InterlockedIncrement(&g_LockCount);
00105
00106         //Reregister the class factory if necessary.
00107         RegisterClassFactory();
00108     }
00109     else
00110     {
00111         //Increment the lock count.
00112         InterlockedIncrement(&g_LockCount);
00113     }
00114 }
00115
00116
00117 //+---------------------------------------------------------------------------
00118 //
00119 //  Function:   main
00120 //
00121 //  Synopsis:   Main entry point for the server application.  This function
00122 //              initializes the server and processes the message loop.
00123 //
00124 //----------------------------------------------------------------------------
00125 int _cdecl main(int argc, char *argv[])
00126 {
00127     HRESULT hr = S_OK;
00128     int i;
00129     BOOL fRegisterServer = FALSE;
00130     BOOL fUnregisterServer = FALSE;
00131     BOOL fEmbedding = FALSE;
00132     BOOL fHelp = FALSE;
00133     MSG msg;
00134
00135     // Parse each item, skip the command name
00136     for (i = 1; i < argc; i++)
00137     {
00138         if (stricmp( argv[i], "-Embedding" ) == 0)
00139         {
00140             //This server has been activated by OLE.
00141             fEmbedding = TRUE;
00142         }
00143         else if (stricmp( argv[i], "/REGSERVER" ) == 0)
00144         {
00145             fRegisterServer = TRUE;
00146         }
00147         else if (stricmp( argv[i], "/UNREGSERVER" ) == 0)
00148         {
00149             fUnregisterServer = TRUE;
00150         }
00151         else
00152         {
00153             fHelp = TRUE;
00154         }
00155     }
00156
00157     if(fHelp == TRUE)
00158         {
00159         printf("USAGE: server /REGSERVER   - Installs server in the registry.\n");
00160         printf("       server /UNREGSERVER - Removes server from the registry.\n");
00161         printf("       server -Embedding   - Server was auto-started by OLE.\n");
00162         return 0;
00163     }
00164     else if(fUnregisterServer == TRUE)
00165     {
00166         hr = UnregisterLocalServer(CLSID_OHello);
00167         if(FAILED(hr))
00168         {
00169             printf("Failed to remove local server from the registry.\n");
00170             PrintErrorMessage(hr);
00171         }
00172
00173         hr = UnregisterProxyDll("ohello.dll");
00174         if(FAILED(hr))
00175         {
00176             printf("Failed to remove proxy DLL from the registry.\n");
00177             PrintErrorMessage(hr);
00178         }
00179         return 0;
00180     }
00181
00182
00183     //Install the local server in the registry.
00184     hr = RegisterLocalServer(CLSID_OHello);
00185     if(FAILED(hr))
00186     {
00187         printf("Failed to install local server in the registry.\n");
00188         PrintErrorMessage(hr);
00189     }
00190
00191     //Install the proxy DLL in the registry.
00192     hr = RegisterProxyDll("ohello.dll");
00193     if(FAILED(hr))
00194     {
00195         printf("Failed to install proxy DLL in the registry.\n");
00196         PrintErrorMessage(hr);
00197     }
00198
00199     if(fRegisterServer == TRUE)
00200         return 0;
00201
00202
00203     //
00204     // Initialize OLE before calling any other OLE functions.
00205     //
00206
00207     hr = CoInitialize(NULL);
00208
00209     if(SUCCEEDED(hr))
00210     {
00211         hr = RegisterClassFactory();
00212
00213         if(SUCCEEDED(hr))
00214         {
00215             printf("Waiting for client to connect...\n");
00216             // Main message loop.  We will remain in the message loop
00217             // until we get a WM_QUIT message.
00218           while (GetMessage(&msg, NULL, 0, 0))
00219           {
00220               TranslateMessage(&msg);
00221               DispatchMessage(&msg);
00222           }
00223
00224             //If the class factory is still registered in the
00225             //class table, revoke it before we shut down.
00226             RevokeClassFactory();
00227       }
00228         else
00229         {
00230             printf("Failed to register class factory.\n");
00231             PrintErrorMessage(hr);
00232         }
00233         CoUninitialize();
00234     }
00235     else
00236     {
00237         printf("CoInitialize failed.\n");
00238         PrintErrorMessage(hr);
00239     }
00240
00241     return 0;
00242 }
00243
00244
00245 //+---------------------------------------------------------------------------
00246 //
00247 //  Function:   ObjectCreated
00248 //
00249 //  Synopsis:   Increments the object count controlling the main message loop
00250 //              of the server process.
00251 //
00252 //  Called By:  CHello, CHelloFactory.
00253 //
00254 //  See Also:   DecrementLockCount, IncrementLockCount, ObjectDestroyed.
00255 //
00256 //----------------------------------------------------------------------------
00257 void ObjectCreated()
00258 {
00259     InterlockedIncrement(&g_ObjectCount);
00260 }
00261
00262
00263 //+---------------------------------------------------------------------------
00264 //
00265 //  Function:   ObjectDestroyed
00266 //
00267 //  Synopsis:   Decrements the object count controlling the main message loop
00268 //              of the server process.  When the object count is decremented
00269 //              to zero, we post a WM_QUIT message.  The main message loop will
00270 //              exit and terminate the server process.
00271 //
00272 //  Called By:  ~CHello, ~CHelloFactory.
00273 //
00274 //  See Also:   DecrementLockCount, IncrementLockCount, ObjectCreated.
00275 //
00276 //----------------------------------------------------------------------------
00277 void ObjectDestroyed()
00278 {
00279     if(InterlockedDecrement(&g_ObjectCount) == 0)
00280     {
00281         //When the last object is released, post a quit message.
00282         PostQuitMessage(0);
00283     }
00284 }
00285
00286
00287 //+---------------------------------------------------------------------------
00288 //
00289 //  Function:   RegisterLocalServer
00290 //
00291 //  Synopsis:   Creates a registry key for a local server.
00292 //
00293 //  Parameters: rclsid - Supplies the class ID of the local server.
00294 //
00295 //----------------------------------------------------------------------------
00296 HRESULT RegisterLocalServer(REFCLSID rclsid)
00297 {
00298     HRESULT hr;
00299     LONG error;
00300     HKEY hKeyCLSID;         // key for ...\Classes\CLSID
00301     HKEY hKeyClassID;
00302     HKEY hKey;              // current key
00303     DWORD dwDisposition;
00304     char szServer[MAX_PATH];
00305     char szClassID[39];
00306     unsigned long length;
00307
00308     length = GetModuleFileNameA(0, szServer, sizeof(szServer));
00309
00310     if(length == 0)
00311     {
00312         hr = HRESULT_FROM_WIN32(GetLastError());
00313         return hr;
00314     }
00315
00316     //create the CLSID key
00317     error = RegCreateKeyExA(
00318             HKEY_CLASSES_ROOT,
00319             "CLSID",
00320             0,
00321             "REG_SZ",
00322             REG_OPTION_NON_VOLATILE,
00323             KEY_ALL_ACCESS,
00324             0,
00325             &hKeyCLSID,
00326             &dwDisposition);
00327
00328     if(!error)
00329     {
00330         //convert the class ID to a registry key name.
00331         _snprintf(szClassID, sizeof(szClassID)-1,
00332         "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
00333                 rclsid.Data1, rclsid.Data2, rclsid.Data3,
00334                 rclsid.Data4[0], rclsid.Data4[1],
00335                 rclsid.Data4[2], rclsid.Data4[3],
00336                 rclsid.Data4[4], rclsid.Data4[5],
00337                 rclsid.Data4[6], rclsid.Data4[7]);
00338
00339         //create key for the server class
00340         error = RegCreateKeyExA(hKeyCLSID,
00341                                 szClassID,
00342                                 0,
00343                                 "REG_SZ",
00344                                 REG_OPTION_NON_VOLATILE,
00345                                 KEY_ALL_ACCESS,
00346                                 0,
00347                                 &hKeyClassID,
00348                                 &dwDisposition);
00349
00350         if(!error)
00351         {
00352             //create LocalServer32 key.
00353             error = RegCreateKeyExA(hKeyClassID,
00354                                     "LocalServer32",
00355                                     0,
00356                                     "REG_SZ",
00357                                     REG_OPTION_NON_VOLATILE,
00358                                     KEY_ALL_ACCESS,
00359                                     0,
00360                                     &hKey,
00361                                     &dwDisposition);
00362
00363             if(!error)
00364             {
00365                 //Set the server name.
00366                 error = RegSetValueExA(hKey,
00367                                        "",
00368                                        0,
00369                                        REG_SZ,
00370                                        (const unsigned char *)szServer,
00371                                        (DWORD) (strlen(szServer) + 1));
00372
00373                 RegFlushKey(hKey);
00374                 RegCloseKey(hKey);
00375             }
00376             RegCloseKey(hKeyClassID);
00377         }
00378         RegCloseKey(hKeyCLSID);
00379     }
00380
00381     if(!error)
00382         hr = S_OK;
00383     else
00384         hr = HRESULT_FROM_WIN32(error);
00385
00386     return hr;
00387 }
00388
00389
00390 //+---------------------------------------------------------------------------
00391 //
00392 //  Function:   RegisterProxyDll
00393 //
00394 //  Synopsis:   Creates registry entries for the interfaces contained in a
00395 //              proxy DLL.
00396 //
00397 //  Parameters: pszProxyDll - Supplies the filename of the proxy DLL.
00398 //
00399 //  Notes:      RegisterProxyDll calls the DllRegisterServer function
00400 //              exported from the proxy DLL.
00401 //
00402 //----------------------------------------------------------------------------
00403 HRESULT RegisterProxyDll(const char *pszProxyDll)
00404 {
00405     HRESULT hr;
00406     HINSTANCE hProxyDll;
00407     HRESULT (STDAPICALLTYPE *pfnDllRegisterServer)();
00408
00409     hProxyDll = LoadLibraryA(pszProxyDll);
00410
00411     if(hProxyDll != 0)
00412     {
00413         pfnDllRegisterServer = (HRESULT (STDAPICALLTYPE *)())
00414             GetProcAddress(hProxyDll, "DllRegisterServer");
00415
00416         if(pfnDllRegisterServer != 0)
00417             hr = (*pfnDllRegisterServer)();
00418         else
00419             hr = HRESULT_FROM_WIN32(GetLastError());
00420
00421         FreeLibrary(hProxyDll);
00422     }
00423     else
00424     {
00425         hr = HRESULT_FROM_WIN32(GetLastError());
00426     }
00427
00428     return hr;
00429 }
00430
00431
00432
00433 //+---------------------------------------------------------------------------
00434 //
00435 //  Function:   UnregisterLocalServer
00436 //
00437 //  Synopsis:   Removes the registry key for a local server.
00438 //
00439 //  Parameters: rclsid - Supplies the class ID of the local server.
00440 //
00441 //----------------------------------------------------------------------------
00442 HRESULT UnregisterLocalServer(REFCLSID rclsid)
00443 {
00444     HRESULT hr;
00445     HKEY hKeyCLSID;
00446     HKEY hKeyClassID;
00447     long error;
00448     char szClassID[39];
00449
00450     //open the CLSID key
00451     error = RegOpenKeyExA(
00452         HKEY_CLASSES_ROOT,
00453         "CLSID",
00454         0,
00455         KEY_ALL_ACCESS,
00456         &hKeyCLSID);
00457
00458     if(!error)
00459     {
00460     //convert the class ID to a registry key name.
00461     _snprintf(szClassID, sizeof(szClassID)-1,
00462       "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
00463             rclsid.Data1, rclsid.Data2, rclsid.Data3,
00464             rclsid.Data4[0], rclsid.Data4[1],
00465             rclsid.Data4[2], rclsid.Data4[3],
00466             rclsid.Data4[4], rclsid.Data4[5],
00467             rclsid.Data4[6], rclsid.Data4[7]);
00468
00469         //open registry key for class ID string
00470         error = RegOpenKeyExA(
00471             hKeyCLSID,
00472             szClassID,
00473             0,
00474             KEY_ALL_ACCESS,
00475             &hKeyClassID);
00476
00477         if(!error)
00478         {
00479             //delete LocalServer32 key.
00480             error = RegDeleteKeyA(hKeyClassID, "LocalServer32");
00481             RegCloseKey(hKeyClassID);
00482         }
00483
00484         error = RegDeleteKeyA(hKeyCLSID, szClassID);
00485         RegCloseKey(hKeyCLSID);
00486     }
00487
00488     if(!error)
00489         hr = S_OK;
00490     else
00491         hr = HRESULT_FROM_WIN32(error);
00492
00493     return hr;
00494 }
00495
00496
00497 //+---------------------------------------------------------------------------
00498 //
00499 //  Function:   UnregisterProxyDll
00500 //
00501 //  Synopsis:   Removes registry entries for the interfaces contained in a
00502 //              proxy DLL.
00503 //
00504 //  Parameters: pszProxyDll - Supplies the filename of the proxy DLL.
00505 //
00506 //  Notes:      UnregisterProxyDll calls the DllUnregisterServer function
00507 //              exported from the proxy DLL.
00508 //
00509 //----------------------------------------------------------------------------
00510 HRESULT UnregisterProxyDll(const char *pszProxyDll)
00511 {
00512     HRESULT hr;
00513     HINSTANCE hProxyDll;
00514     HRESULT (STDAPICALLTYPE *pfnDllUnregisterServer)();
00515
00516     hProxyDll = LoadLibraryA(pszProxyDll);
00517
00518     if(hProxyDll != 0)
00519     {
00520         pfnDllUnregisterServer = (HRESULT (STDAPICALLTYPE *)())
00521             GetProcAddress(hProxyDll, "DllUnregisterServer");
00522
00523         if(pfnDllUnregisterServer != 0)
00524             hr = (*pfnDllUnregisterServer)();
00525         else
00526             hr = HRESULT_FROM_WIN32(GetLastError());
00527
00528         FreeLibrary(hProxyDll);
00529     }
00530     else
00531     {
00532         hr = HRESULT_FROM_WIN32(GetLastError());
00533     }
00534
00535     return hr;
00536 }
00537
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_STREAM_FIND_DATA Member List

This is the complete list of members for _STREAM_FIND_DATA, including all inherited members.
cStreamName | _STREAM_FIND_DATA
Size | _STREAM_FIND_DATA
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllClien/UTCRUCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllClien

UTCRUCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCruiseCar COM
00005              object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and
00009              IUtility interfaces.  This is done through Aggregation reuse
00010              of a COCruiseCar COM object (specifically providing its ICar
00011              and ICruise interface features).  COUtilityCruiseCar adds its
00012              own native implementation of the IUtility interface.  The
00013              aggregated CruiseCar object is implemented and provided in an
00014              outside COMOBJ.DLL.
00015
00016              This multiple interface COM Object Class is achieved via
00017              the technique of nested classes: the implementation of the
00018              IUtility interface is nested inside of the COUtilityCruiseCar
00019              COM object class.
00020
00021              For a comprehensive tutorial code tour of this module's
00022              contents and offerings see the tutorial DLLCLIEN.HTM
00023              file.  For more specific technical details on the internal
00024              workings see the comments dispersed throughout the
00025              module's source code.
00026
00027   Classes:   COUtilityCruiseCar.
00028
00029   Functions: .
00030
00031   Origin:    9-20-95: atrent - Editor inheritance from COMUSER source.
00032
00033 ----------------------------------------------------------------------------
00034   This file is part of the Microsoft COM Tutorial Code Samples.
00035
00036   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00037
00038   This source code is intended only as a supplement to Microsoft
00039   Development Tools and/or on-line documentation.  See these other
00040   materials for detailed information regarding Microsoft code samples.
00041
00042   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00043   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00044   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00045   PARTICULAR PURPOSE.
00046 ==========================================================================+*/
00047
00048 #if !defined(UTCRUCAR_H)
00049 #define UTCRUCAR_H
00050
00051 #ifdef __cplusplus
00052
00053 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00054   ObjectClass: COUtilityCruiseCar
00055
00056   Summary:     COM Object Class for COUtilityCruiseCar COM Objects.
00057                COM objects of this class augment COCruiseCar COM objects
00058                with the IUtility interface features of Offroad and Winch.
00059                COCruiseCar is reused to offer this COUtilityCruiseCar COM
00060                Object the ICar interface features of Shift, Clutch, Speed,
00061                Steer and the ICruise interface features of Engage and
00062                Adjust.  This COUtilityCruiseCar COM object class is
00063                constructed by aggregation reuse of the COCruiseCar COM
00064                object class.  The mulitple interfaces on this COM object
00065                class are constructed via the nested class interfaces
00066                technique.
00067
00068   Interfaces:  IUnknown
00069                  Standard interface providing COM object features.
00070                ICar
00071                  Basic car features.
00072                ICruise
00073                  Cruise control system features.
00074                IUtility
00075                  Sport-utility Car operation features.  Implemented in
00076                  this COM object.
00077
00078   Aggregation: Yes, COUtilityCruiseCar COM objects are aggregatable by
00079                passing a non-NULL pUnkOuter IUnknown pointer into
00080                the constructor.
00081 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00082 class COUtilityCruiseCar : public IUnknown
00083 {
00084   public:
00085     // Main Object Constructor & Destructor.
00086     COUtilityCruiseCar(IUnknown* pUnkOuter);
00087     ~COUtilityCruiseCar(void);
00088
00089     // A general method for initializing a newly created UtilityCruiseCar.
00090     HRESULT Init(void);
00091
00092     // IUnknown members. Main object, non-delegating.
00093     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00094     STDMETHODIMP_(ULONG) AddRef(void);
00095     STDMETHODIMP_(ULONG) Release(void);
00096
00097   private:
00098     // We declare nested class interface implementations here.
00099
00100     // We implement the IUtility interface (ofcourse) in this
00101     // COUtilityCruiseCar COM object class.  This is the native interface
00102     // that we are using as an augmentation to the existing COCruiseCar
00103     // COM object class.
00104     class CImpIUtility : public IUtility
00105     {
00106       public:
00107         // Interface Implementation Constructor & Destructor.
00108         CImpIUtility(COUtilityCruiseCar* pBackObj, IUnknown* pUnkOuter);
00109         ~CImpIUtility(void);
00110
00111         // IUnknown members.
00112         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00113         STDMETHODIMP_(ULONG) AddRef(void);
00114         STDMETHODIMP_(ULONG) Release(void);
00115
00116         // IUtility members.
00117         STDMETHODIMP Offroad(short nGear);
00118         STDMETHODIMP Winch(short nRpm);
00119
00120       private:
00121         // Data private to this interface implementation of IUtility.
00122         ULONG               m_cRefI;     // Interface Ref Count (debugging).
00123         COUtilityCruiseCar* m_pBackObj;  // Parent Object back pointer.
00124         IUnknown*           m_pUnkOuter; // Outer unknown for Delegation.
00125     };
00126
00127     // Make the otherwise private and nested IUtility interface
00128     // implementation a friend to COM object instantiations of this
00129     // selfsame COUtilityCruiseCar COM object class.
00130     friend CImpIUtility;
00131
00132     // Private data of COUtilityCruiseCar COM objects.
00133
00134     // Nested IUtility implementation instantiation.  This IUtility
00135     // interface is instantiated inside this COUtilityCruiseCar object
00136     // as a native interface.
00137     CImpIUtility    m_ImpIUtility;
00138
00139     // Main Object reference count.
00140     ULONG           m_cRefs;
00141
00142     // Outer unknown (aggregation delegation). Used when this
00143     // COUtilityCruiseCar object is being aggregated.
00144     IUnknown*       m_pUnkOuter;
00145
00146     // We need to save the IUnknown interface pointer on the COCruiseCar
00147     // object that we aggregate.  We use this when we need to delegate
00148     // IUnknown calls to this aggregated inner object.
00149     IUnknown*       m_pUnkCruiseCar;
00150 };
00151
00152 typedef COUtilityCruiseCar* PCOUtilityCruiseCar;
00153
00154 // Here is a prototpye for the UtilityCruiseCar Creation function.
00155 HRESULT CreateUtilityCruiseCar(
00156           IUnknown* pUnkOuter,
00157           REFIID riid,
00158           PPVOID ppv);
00159
00160 #endif // __cplusplus
00161
00162
00163 #endif // UTCRUCAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/PageFILE.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

PageFILE.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      PAGEFILE.H
00003
00004   Summary:   Include file for the CPageFile C++ class. A CPageFile is a
00005              C++ object that encapsulates load and save operations on an
00006              COM structured storage compound file. CPageFile knows about
00007              an underlying server-based persistent COM object, COPageList,
00008              that manages the actual page list data. COPageList supports
00009              persistence of its page list data by exposing the
00010              IPersistStream interface.
00011
00012              For a comprehensive tutorial code tour of PAGEFILE's contents
00013              and offerings see the tutorial PERCLIEN.HTM file. For
00014              more specific technical details on the internal workings see
00015              the comments dispersed throughout the PAGEFILE source code.
00016
00017   Classes:   CPageFile.
00018
00019   Origin:    5-25-96: atrent - Created for PERCLIEN Code Sample.
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(PAGEFILE_H)
00037 #define PAGEFILE_H
00038
00039 #if defined(__cplusplus)
00040
00041
00042 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00043   Class:    CPageFile
00044
00045   Summary:  Class to encapsulate operations on the page list's data
00046             compound file.
00047
00048   Methods:  CPageFile
00049               Constructor.
00050             ~CPageFile
00051               Destructor.
00052             HRESULT Init(
00053                       TCHAR* pszAppFileName);
00054               Initialize the CPageFile C++ object.
00055             HRESULT New(
00056                       TCHAR* pszFileName,
00057                       IStorage** ppIStorage,
00058                       IPageList** ppIPageList);
00059               Create a new empty Page List compound file.
00060             HRESULT Load(
00061                       TCHAR* pszFileName,
00062                       IStorage** ppIStorage,
00063                       IPageList** ppIPageList);
00064               Load Page List data using the specified compound file name.
00065             HRESULT Save(
00066                       IStorage* pIStorage,
00067                       IPageList* pIPageList);
00068               Save current page list under specified root storage.
00069             HRESULT SaveAs(
00070                       TCHAR* pszFileName,
00071                       IPageList* pIPageList,
00072                       IStorage** ppIStorage);
00073               Create a new page list compound file of specified file name.
00074 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00075 class CPageFile
00076 {
00077   public:
00078     CPageFile(void);
00079    ~CPageFile(void);
00080     HRESULT Init(
00081               TCHAR* pszAppFileName);
00082     HRESULT New(
00083               TCHAR* pszFileName,
00084               IStorage** ppIStorage,
00085               IPageList** ppIPageList);
00086     HRESULT Load(
00087               TCHAR* pszFileName,
00088               IStorage** ppIStorage,
00089               IPageList** ppIPageList);
00090     HRESULT Save(
00091               IStorage* pIStorage,
00092               IPageList* pIPageList);
00093     HRESULT SaveAs(
00094               TCHAR* pszFileName,
00095               IPageList* pIPageList,
00096               IStorage** ppIStorage);
00097
00098   private:
00099     TCHAR          m_szCurFileName[MAX_PATH];
00100     CLSID          m_CidPageList;
00101 };
00102
00103
00104 #endif // __cplusplus
00105
00106 #endif
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Snmp/TestDll/TestMIB.h Source File

  • NetDS
  • Snmp
  • TestDll

TestMIB.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001    // Increment this if a change has global effects
00002
00003 Copyright (c) 1992 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     testmib.h
00008
00009 Abstract:
00010
00011     Sample SNMP Extension Agent for Windows NT.
00012
00013     These files (testdll.c, testmib.c, and testmib.h) provide an example of
00014     how to structure an Extension Agent DLL which works in conjunction with
00015     the SNMP Extendible Agent for Windows NT.
00016
00017     Extensive comments have been included to describe its structure and
00018     operation.  See also "Microsoft Windows NT SNMP Programmer's Reference".
00019
00020 --*/
00021
00022 #ifndef testmib_h
00023 #define testmib_h
00024
00025 // Necessary includes.
00026
00027 #include <snmp.h>
00028
00029
00030 // MIB Specifics.
00031
00032 #define MIB_PREFIX_LEN            MIB_OidPrefix.idLength
00033 #define MAX_STRING_LEN            255
00034
00035
00036 // Ranges and limits for specific MIB variables.
00037
00038 #define MIB_TOASTER_UP            1
00039 #define MIB_TOASTER_DOWN          2
00040
00041 #define MIB_TOASTER_LIGHTLYWARM   1
00042 #define MIB_TOASTER_BURNT         10
00043
00044 #define MIB_TOASTER_WHITEBREAD    1
00045 #define MIB_TOASTER_OTHERBREAD    7
00046
00047
00048 // MIB function actions.
00049
00050 #define MIB_ACTION_GET         ASN_RFC1157_GETREQUEST
00051 #define MIB_ACTION_SET         ASN_RFC1157_SETREQUEST
00052 #define MIB_ACTION_GETNEXT     ASN_RFC1157_GETNEXTREQUEST
00053
00054
00055 // MIB Variable access privileges.
00056
00057 #define MIB_ACCESS_READ        0
00058 #define MIB_ACCESS_WRITE       1
00059 #define MIB_ACCESS_READWRITE   2
00060
00061
00062 // Macro to determine number of sub-oid's in array.
00063
00064 #define OID_SIZEOF( Oid )      ( sizeof Oid / sizeof(UINT) )
00065
00066
00067 // MIB variable ENTRY definition.  This structure defines the format for
00068 // each entry in the MIB.
00069
00070 typedef struct mib_entry
00071            {
00072      AsnObjectIdentifier Oid;
00073      void *              Storage;
00074      BYTE                Type;
00075      UINT                Access;
00076      UINT                (*MibFunc)( UINT, struct mib_entry *,
00077                                      RFC1157VarBind * );
00078      struct mib_entry *  MibNext;
00079      } MIB_ENTRY;
00080
00081
00082 // Internal MIB structure.
00083
00084 extern MIB_ENTRY Mib[];
00085 extern UINT      MIB_num_variables;
00086
00087
00088 // Prefix to every variable in the MIB.
00089
00090 extern AsnObjectIdentifier MIB_OidPrefix;
00091
00092
00093 // Function Prototypes.
00094
00095 UINT ResolveVarBind(
00096         IN OUT RFC1157VarBind *VarBind, // Variable Binding to resolve
00097   IN UINT PduAction               // Action specified in PDU
00098   );
00099
00100 UINT MIB_leaf_func(
00101         IN UINT Action,
00102   IN MIB_ENTRY *MibPtr,
00103   IN RFC1157VarBind *VarBind
00104   );
00105
00106 UINT MIB_control_func(
00107         IN UINT Action,
00108   IN MIB_ENTRY *MibPtr,
00109   IN RFC1157VarBind *VarBind
00110   );
00111
00112 UINT MIB_doneness_func(
00113         IN UINT Action,
00114   IN MIB_ENTRY *MibPtr,
00115   IN RFC1157VarBind *VarBind
00116   );
00117
00118 UINT MIB_toasttype_func(
00119         IN UINT Action,
00120   IN MIB_ENTRY *MibPtr,
00121   IN RFC1157VarBind *VarBind
00122   );
00123
00124
00125 #endif /* testmib_h */
00126
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Security/VC/Resource.h Source File

  • Com
  • Services
  • Security
  • VC

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by VCSecuritySample.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_VCSECURITYSAMPLECLASS       101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/utils.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

utils.Cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002
00003 static WCHAR * const month[] = {L"January ", L"February ", L"March ", L"April ", L"May ", L"June ", L"July ", L"August ", L"September ", L"October ", L"November ", L"December "};
00004
00005 long WriteNamedParam(WCHAR* wszParamStart, LPCWSTR wszName, VARIANT* pVal)
00006 {
00007   long length;
00008
00009   if (pVal->vt == VT_BSTR)
00010   {
00011     int slen = SysStringLen(pVal->bstrVal);
00012
00013     if (slen > 0)
00014       length = WriteChars(wszParamStart, wszName, (LPCWSTR)pVal->bstrVal, slen, true);
00015     else
00016       length = WriteChars(wszParamStart, wszName, L"\'\'", 0, false);
00017   }
00018   else if (pVal->vt == VT_I2)
00019   {
00020     length = WriteChars(wszParamStart, wszName, (short)pVal->iVal);
00021   }
00022   else if (pVal->vt == VT_DATE)
00023   {
00024     SYSTEMTIME systime;
00025     VariantTimeToSystemTime(pVal->date, &systime);
00026     length = WriteChars(wszParamStart, wszName, (LPCWSTR)month[systime.wMonth-1], (short)systime.wDay, (short)systime.wYear);
00027   }
00028   else if (pVal->vt == VT_NULL)
00029   {
00030     length = WriteChars(wszParamStart, wszName, L"NULL", 0, false);
00031   }
00032   else if (pVal->vt == VT_I4)
00033   {
00034     length = WriteChars(wszParamStart, wszName, (long)pVal->lVal);
00035   }
00036   else if (pVal->vt == VT_BOOL)
00037   {
00038     long bVal;
00039     if (pVal->boolVal == VARIANT_TRUE)
00040       bVal = 1;
00041     else
00042       bVal = 0;
00043     length = WriteChars(wszParamStart, wszName, (long)bVal);
00044   }
00045   else if (pVal->vt == VT_EMPTY)
00046   {
00047     length = WriteChars(wszParamStart, wszName, (long)0);
00048   }
00049   else if (pVal->vt == VT_UI1)
00050   {
00051     length = WriteChars(wszParamStart, wszName, (BYTE)pVal->bVal);
00052   }
00053   else if (pVal->vt == VT_DECIMAL)
00054   {
00055     CFastVariant data;
00056     VariantChangeType(&data, pVal, 0, VT_BSTR);
00057     length = WriteChars(wszParamStart, wszName, (LPCWSTR)data.bstrVal, SysStringLen(data.bstrVal), false);
00058   }
00059   else if (pVal->vt == VT_CY)
00060   {
00061     CFastVariant data;
00062     VariantChangeType(&data, pVal, 0, VT_BSTR);
00063     length = WriteChars(wszParamStart, wszName, (LPCWSTR)data.bstrVal, SysStringLen(data.bstrVal), false);
00064   }
00065   else if (pVal->vt == VT_R4)
00066   {
00067     CFastVariant data;
00068     VariantChangeType(&data, pVal, 0, VT_BSTR);
00069     length = WriteChars(wszParamStart, wszName, (LPCWSTR)data.bstrVal, SysStringLen(data.bstrVal), false);
00070   }
00071   else if (pVal->vt == VT_R8)
00072   {
00073     CFastVariant data;
00074     VariantChangeType(&data, pVal, 0, VT_BSTR);
00075     length = WriteChars(wszParamStart, wszName, (LPCWSTR)data.bstrVal, SysStringLen(data.bstrVal), false);
00076   }
00077   else
00078   {
00079     CFastVariant data;
00080     VariantChangeType(&data, pVal, 0, VT_BSTR);
00081     length = WriteChars(wszParamStart, wszName, (LPCWSTR)data.bstrVal, SysStringLen(data.bstrVal), false);
00082   }
00083   return length;
00084 }
00085
00086 WCHAR* BuildExecCommand(WCHAR* wszSQLStart, LPCWSTR wszStoredProc, LPCWSTR wszKeyField, VARIANT* pVal)
00087 {
00088   WCHAR *wszSQL = wszSQLStart;
00089
00090   if (wszStoredProc[0] != L'\0')
00091   {
00092     wszSQL += WriteChars(wszSQL, L"EXEC ");
00093     wszSQL += WriteChars(wszSQL, wszStoredProc);
00094     wszSQL[0] = L' ';
00095     wszSQL[1] = L'@';
00096     wszSQL += 2;
00097     wszSQL += WriteNamedParam(wszSQL, wszKeyField, pVal);
00098   }
00099   // WriteChars as used in WriteNamedParam automatically adds a comma and a space
00100   // since the most used case requires it.
00101   // We don't need it here, so just insert a terminator.
00102   wszSQL[-2] = L'\0';
00103   return wszSQLStart;
00104 }
00105
00106 IMPLEMENT_FIXED_ALLOC(CFastVariant, ENTITY_PER_BANK);
00107
00108
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/dataobj.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

dataobj.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "DataObj.h"
00020 #include "guids.h"
00021 #include "DeleBase.h"
00022
00023 //
00024 // This is the minimum set of clipboard formats we must implement.
00025 // MMC uses these to get necessary information from our snapin about
00026 // our nodes.
00027 //
00028
00029 // we need to do this to get around MMC.IDL - it explicitly defines
00030 // the clipboard formats as WCHAR types...
00031 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00032 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00033 #define _T_CCF_SZNODETYPE _T("CCF_SZNODETYPE")
00034 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00035
00036 #define _T_CCF_INTERNAL_SNAPIN _T("{2479DB32-5276-11d2-94F5-00C04FB92EC2}")
00037
00038     // These are the clipboard formats that we must supply at a minimum.
00039     // mmc.h actually defined these. We can make up our own to use for
00040     // other reasons. We don't need any others at this time.
00041 UINT CDataObject::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00042 UINT CDataObject::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00043 UINT CDataObject::s_cfSZNodeType  = RegisterClipboardFormat(_T_CCF_SZNODETYPE);
00044 UINT CDataObject::s_cfSnapinClsid = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00045 UINT CDataObject::s_cfInternal    = RegisterClipboardFormat(_T_CCF_INTERNAL_SNAPIN);
00046
00047
00048 CDataObject::CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context)
00049 : m_lCookie(cookie), m_context(context), m_cref(0)
00050 {
00051 }
00052
00053 CDataObject::~CDataObject()
00054 {
00055 }
00056
00057 ///////////////////////
00058 // IUnknown implementation
00059 ///////////////////////
00060
00061 STDMETHODIMP CDataObject::QueryInterface(REFIID riid, LPVOID *ppv)
00062 {
00063     if (!ppv)
00064         return E_FAIL;
00065
00066     *ppv = NULL;
00067
00068     if (IsEqualIID(riid, IID_IUnknown))
00069         *ppv = static_cast<IDataObject *>(this);
00070     else if (IsEqualIID(riid, IID_IDataObject))
00071         *ppv = static_cast<IDataObject *>(this);
00072
00073     if (*ppv)
00074     {
00075         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00076         return S_OK;
00077     }
00078
00079     return E_NOINTERFACE;
00080 }
00081
00082 STDMETHODIMP_(ULONG) CDataObject::AddRef()
00083 {
00084     return InterlockedIncrement((LONG *)&m_cref);
00085 }
00086
00087 STDMETHODIMP_(ULONG) CDataObject::Release()
00088 {
00089     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00090     {
00091         delete this;
00092         return 0;
00093     }
00094     return m_cref;
00095
00096 }
00097
00098 /////////////////////////////////////////////////////////////////////////////
00099 // IDataObject implementation
00100 //
00101 HRESULT CDataObject::GetDataHere(
00102                                  FORMATETC *pFormatEtc,     // [in]  Pointer to the FORMATETC structure
00103                                  STGMEDIUM *pMedium         // [out] Pointer to the STGMEDIUM structure
00104                                  )
00105 {
00106     const   CLIPFORMAT cf = pFormatEtc->cfFormat;
00107     IStream *pStream = NULL;
00108
00109     CDelegationBase *base = GetBaseNodeObject();
00110
00111     HRESULT hr = CreateStreamOnHGlobal( pMedium->hGlobal, FALSE, &pStream );
00112     if ( FAILED(hr) )
00113         return hr;                       // Minimal error checking
00114
00115     hr = DV_E_FORMATETC;                 // Unknown format
00116
00117     if (cf == s_cfDisplayName) {
00118         const _TCHAR *pszName = base->GetDisplayName();
00119
00120                 MAKE_WIDEPTR_FROMTSTR(wszName, pszName);
00121
00122                 // get length of original string and convert it accordingly
00123         ULONG ulSizeofName = lstrlen(pszName);
00124         ulSizeofName++;                      // Count null character
00125         ulSizeofName *= sizeof(WCHAR);
00126
00127         hr = pStream->Write(wszName, ulSizeofName, NULL);
00128     } else if (cf == s_cfNodeType) {
00129         const GUID *pGUID = (const GUID *)&base->getNodeType();
00130
00131         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00132     } else if (cf == s_cfSZNodeType) {
00133         LPOLESTR szGuid;
00134         hr = StringFromCLSID(base->getNodeType(), &szGuid);
00135
00136         if (SUCCEEDED(hr)) {
00137             hr = pStream->Write(szGuid, wcslen(szGuid), NULL);
00138             CoTaskMemFree(szGuid);
00139         }
00140     } else if (cf == s_cfSnapinClsid) {
00141         const GUID *pGUID = NULL;
00142         pGUID = &CLSID_CComponentData;
00143
00144         hr = pStream->Write(pGUID, sizeof(GUID), NULL);
00145     } else if (cf == s_cfInternal) {
00146         // we are being asked to get our this pointer from the IDataObject interface
00147         // only our own snap-in objects will know how to do this.
00148         CDataObject *pThis = this;
00149         hr = pStream->Write( &pThis, sizeof(CDataObject*), NULL );
00150     }
00151
00152     pStream->Release();
00153
00154     return hr;
00155 }
00156
00157 /////////////////////////////////////////////////////////////////////////////
00158 // Global helper functions to help work with dataobjects and
00159 // clipboard formats
00160
00161
00162 //---------------------------------------------------------------------------
00163 //  Returns the current object based on the s_cfInternal clipboard format
00164 //
00165 CDataObject* GetOurDataObject (
00166                                LPDATAOBJECT lpDataObject      // [in] IComponent pointer
00167                                )
00168 {
00169     HRESULT       hr      = S_OK;
00170     CDataObject *pSDO     = NULL;
00171
00172   // check to see if the data object is a special data object.
00173   if ( IS_SPECIAL_DATAOBJECT (lpDataObject) )
00174   {
00175     //Code for handling a special data object goes here.
00176
00177     //Note that the MMC SDK samples do not handle
00178     //special data objects, so we exit if we get one.
00179     return NULL;
00180   }
00181
00182     STGMEDIUM stgmedium = { TYMED_HGLOBAL,  NULL  };
00183     FORMATETC formatetc = { CDataObject::s_cfInternal, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00184
00185     // Allocate memory for the stream
00186     stgmedium.hGlobal = GlobalAlloc( GMEM_SHARE, sizeof(CDataObject *));
00187
00188     if (!stgmedium.hGlobal)     {
00189         hr = E_OUTOFMEMORY;
00190     }
00191
00192     if SUCCEEDED(hr)
00193         // Attempt to get data from the object
00194         hr = lpDataObject->GetDataHere( &formatetc, &stgmedium );
00195
00196     // stgmedium now has the data we need
00197     if (SUCCEEDED(hr))  {
00198         pSDO = *(CDataObject **)(stgmedium.hGlobal);
00199     }
00200
00201     // if we have memory free it
00202     if (stgmedium.hGlobal)
00203         GlobalFree(stgmedium.hGlobal);
00204
00205     return pSDO;
00206
00207 } // end GetOurDataObject()
00208
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello2/Notify.Cpp Source File

  • Web
  • MSAgent
  • c
  • Hello2

Notify.Cpp

Go to the documentation of this file.
00001 #include "Notify.h"
00002
00003
00004 //==========================================================================
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //--------------------------------------------------------------------------
00014 //
00015 // AgentNotifySink
00016 //
00017 //    Boilerplate IDispatch implementation with stubs for all
00018 //    IAgentNotifySink methods except for RequestComplete.
00019 //
00020 //==========================================================================
00021
00022
00023 extern long g_lDone;
00024
00025
00026 // IUnknown methods
00027
00028 STDMETHODIMP AgentNotifySink::QueryInterface (REFIID riid, LPVOID *ppv) {
00029
00030     *ppv = NULL;
00031
00032     if ((riid == IID_IUnknown) || (riid == IID_IAgentNotifySink))
00033         *ppv = this;
00034
00035     if (*ppv == NULL)
00036         return E_NOINTERFACE;
00037
00038     ((LPUNKNOWN)*ppv)->AddRef();
00039
00040     return NOERROR;
00041 }
00042
00043
00044 STDMETHODIMP_ (ULONG) AgentNotifySink::AddRef() {
00045
00046   return ++m_cRefs;
00047 }
00048
00049
00050 STDMETHODIMP_(ULONG) AgentNotifySink::Release() {
00051
00052   if (--m_cRefs != 0)
00053     return m_cRefs;
00054
00055   delete this;
00056   return 0;
00057 }
00058
00059
00060 // IDispatch methods
00061
00062 STDMETHODIMP AgentNotifySink::GetTypeInfoCount(UINT *pctInfo) {
00063
00064     *pctInfo = 1;
00065     return NOERROR;
00066 }
00067
00068
00069 STDMETHODIMP AgentNotifySink::GetTypeInfo(UINT itInfo, LCID lcid, ITypeInfo **ppTypeInfo) {
00070
00071     HRESULT hRes;
00072     ITypeLib *pLib;
00073
00074     *ppTypeInfo = NULL;
00075
00076   if (itInfo != 0)
00077         return TYPE_E_ELEMENTNOTFOUND;
00078
00079     if (ppTypeInfo == NULL)
00080         return E_POINTER;
00081
00082   if ((PRIMARYLANGID(lcid) != LANG_NEUTRAL) &&
00083     (PRIMARYLANGID(lcid) != LANG_ENGLISH))
00084     return DISP_E_UNKNOWNLCID;
00085
00086     hRes = LoadRegTypeLib(LIBID_AgentServerObjects,
00087               1,
00088               0,
00089               PRIMARYLANGID(lcid),
00090               &pLib);
00091     if (FAILED(hRes))
00092         return hRes;
00093
00094   hRes = pLib->GetTypeInfoOfGuid(IID_IAgentNotifySink, ppTypeInfo);
00095
00096   pLib->Release();
00097
00098     if (FAILED(hRes))
00099         return hRes;
00100
00101     (*ppTypeInfo)->AddRef();
00102
00103     return NOERROR;
00104 }
00105
00106
00107 STDMETHODIMP AgentNotifySink::GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgDispID) {
00108
00109     HRESULT hRes;
00110     ITypeInfo *pInfo;
00111
00112   // REFIID must be NULL
00113
00114   if (riid != IID_NULL)
00115         return ResultFromScode(DISP_E_UNKNOWNINTERFACE);
00116
00117   // Get the TypeInfo for the specified lcid
00118
00119     hRes = GetTypeInfo(0, lcid, &pInfo);
00120
00121   if (FAILED(hRes))
00122     return hRes;
00123
00124   // Use the TypeInfo to get the DISPIDs of the specified names.
00125   // That's the whole point here.  Let TypeInfo do the work so
00126   // we don't have to.
00127
00128   hRes = pInfo->GetIDsOfNames(rgszNames, cNames, rgDispID);
00129
00130   pInfo->Release();
00131
00132     return hRes;
00133 }
00134
00135
00136 STDMETHODIMP AgentNotifySink::Invoke(DISPID dispID, REFIID riid, LCID lcid,
00137                    unsigned short wFlags, DISPPARAMS *pDispParams,
00138                    VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
00139                    UINT *puArgErr) {
00140
00141   HRESULT hRes;
00142   ITypeInfo *pInfo;
00143
00144     // The riid parameter is always supposed to be IID_NULL
00145
00146   if (riid != IID_NULL)
00147         return DISP_E_UNKNOWNINTERFACE;
00148
00149   // Get the type info for the specified lcid
00150
00151     hRes = GetTypeInfo(0, lcid, &pInfo);
00152
00153     if (FAILED(hRes))
00154         return hRes;
00155
00156     // Clear exceptions
00157
00158     SetErrorInfo(0L, NULL);
00159
00160   hRes = pInfo->Invoke(this,
00161              dispID,
00162              wFlags,
00163              pDispParams,
00164              pVarResult,
00165              pExcepInfo,
00166              puArgErr);
00167
00168
00169     pInfo->Release();
00170
00171     return hRes;
00172 }
00173
00174
00175 // IAgentNotifySink methods
00176
00177 STDMETHODIMP AgentNotifySink::Command(long dwCommandID, IUnknown * punkUserInput) {
00178
00179   return NOERROR;
00180 }
00181
00182
00183 STDMETHODIMP AgentNotifySink::ActivateInputState(long dwCharID, long bActivated) {
00184
00185   return NOERROR;
00186 }
00187
00188
00189 STDMETHODIMP AgentNotifySink::Restart() {
00190
00191   return NOERROR;
00192 }
00193
00194
00195 STDMETHODIMP AgentNotifySink::Shutdown() {
00196
00197   return NOERROR;
00198 }
00199
00200
00201 STDMETHODIMP AgentNotifySink::VisibleState(long dwCharID, long bVisible, long lCause) {
00202
00203   return NOERROR;
00204 }
00205
00206
00207 STDMETHODIMP AgentNotifySink::Click(long dwCharID, short fwKeys, long X, long Y) {
00208
00209   return NOERROR;
00210 }
00211
00212
00213 STDMETHODIMP AgentNotifySink::DblClick(long dwCharID, short fwKeys, long X, long Y) {
00214
00215   return NOERROR;
00216 }
00217
00218
00219 STDMETHODIMP AgentNotifySink::DragStart(long dwCharID, short fwKeys, long X, long Y) {
00220
00221   return NOERROR;
00222 }
00223
00224
00225 STDMETHODIMP AgentNotifySink::DragComplete(long dwCharID, short fwKeys, long X, long Y) {
00226
00227   return NOERROR;
00228 }
00229
00230
00231 STDMETHODIMP AgentNotifySink::RequestStart(long dwRequestID) {
00232
00233   return NOERROR;
00234 }
00235
00236
00237 STDMETHODIMP AgentNotifySink::RequestComplete(long dwRequestID, long hrStatus) {
00238
00239   // When we get g_lDone exit the sample app
00240
00241   if (dwRequestID == g_lDone)
00242     PostQuitMessage(0);
00243
00244   return NOERROR;
00245 }
00246
00247
00248 STDMETHODIMP AgentNotifySink::BookMark(long dwBookMarkID) {
00249
00250   return NOERROR;
00251 }
00252
00253
00254 STDMETHODIMP AgentNotifySink::Idle(long dwCharID, long bStart) {
00255
00256   return NOERROR;
00257 }
00258
00259
00260 STDMETHODIMP AgentNotifySink::Move(long dwCharID, long X, long Y, long lCause) {
00261
00262   return NOERROR;
00263 }
00264
00265
00266 STDMETHODIMP AgentNotifySink::Size(long dwCharID, long lWidth, long lHeight) {
00267
00268   return NOERROR;
00269 }
00270
00271
00272 STDMETHODIMP AgentNotifySink::BalloonVisibleState(long dwCharID, long bVisible) {
00273
00274   return NOERROR;
00275 }
00276
00277
00278 STDMETHODIMP AgentNotifySink::HelpComplete(long dwCharID, long dwCommandID, long dwCause) {
00279
00280   return NOERROR;
00281 }
00282
00283
00284 STDMETHODIMP AgentNotifySink::ListeningState(long dwCharacterID, long bListenState, long dwCause) {
00285
00286   return NOERROR;
00287 }
00288
00289
00290 STDMETHODIMP AgentNotifySink::DefaultCharacterChange(BSTR bszGUID) {
00291
00292   return NOERROR;
00293 }
00294
00295
00296 STDMETHODIMP AgentNotifySink::AgentPropertyChange() {
00297
00298   return NOERROR;
00299 }
00300
00301
00302 STDMETHODIMP AgentNotifySink::ActiveClientChange(long dwCharID, long lStatus) {
00303
00304   return NOERROR;
00305 }
00306
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::StringFormatEnum Member List

This is the complete list of members for msado15::StringFormatEnum, including all inherited members.
adClipString msado15::StringFormatEnum [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/dsmenu.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

dsmenu.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright (C) Microsoft Corporation, 1992 - 2000
00005 //
00006 //  File:      dsmenu.cpp
00007 //
00008 //  Contents:  object to implement context menu extensions
00009 //
00010 //  History:   3-august-99 jeffjon    Created
00011 //
00012 //
00013 //--------------------------------------------------------------------------
00014
00015 #include "stdafx.h"
00016 #include "resource.h"
00017 #include "SCPCMenu.h"
00018 #include "dsmenu.h"
00019 #include "SCPCMenuUI.h"
00020 #include <dsclient.h>
00021
00022 #define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
00023
00024
00025
00026 ///////////////////////////////////////////////////////////////////////////
00027 // CContextMenu
00028
00029 CContextMenu::CContextMenu()
00030 {
00031   ATLTRACE(_T("CContextMenu::CContextMenu()\n"));
00032 }
00033
00034 CContextMenu::~CContextMenu()
00035 {
00036   ATLTRACE(_T("CContextMenu::~CContextMenu()\n"));
00037 }
00038
00039
00040 ////////////////////////////////////////////////////////////
00041 // IShellExtInit methods
00042 STDMETHODIMP
00043 CContextMenu::Initialize(LPCITEMIDLIST pIDFolder,
00044                            LPDATAOBJECT pDataObj,
00045                            HKEY hKeyID )
00046 {
00047
00048   ATLTRACE(_T("CContextMenu::Initialize.\n"));
00049
00050   if (pDataObj == NULL)
00051   {
00052     return E_INVALIDARG; // no point in going on
00053   }
00054
00055   //
00056   // Store a pointer to the data object
00057   //
00058   m_spDataObj = pDataObj;
00059
00060   return NOERROR;
00061 }
00062
00063
00064
00065
00066 BOOL _InsertMenuHelper(
00067     HMENU hMenu,          // handle to menu
00068     UINT uPosition,       // menu item that new menu item precedes
00069     UINT uFlags,          // menu item flags
00070     UINT_PTR uIDNewItem,  // menu item identifier or handle to drop-down
00071                           // menu or submenu
00072     LPCTSTR lpNewItem,    // menu item content
00073     UINT* pnCurrentCount
00074     )
00075 {
00076   if (::InsertMenu(hMenu, uPosition, uFlags, uIDNewItem, lpNewItem))
00077   {
00078     (*pnCurrentCount)++;
00079     return TRUE;
00080   }
00081   return FALSE;
00082 }
00083
00084
00085
00086 ///////////////////////////////////////////////////////////
00087 // IContextMenu methods
00088 STDMETHODIMP
00089 CContextMenu::QueryContextMenu(HMENU hMenu,
00090                                  UINT indexMenu,
00091                                  UINT idCmdFirst,
00092                                  UINT idCmdLast,
00093                                  UINT uFlags )
00094
00095 {
00096
00097   TCHAR szBuffer[MAX_PATH];
00098   UINT nMenuItemsAdded = 0;
00099
00100   ATLTRACE(_T("CContextMenu::QueryContextMenu.\n"));
00101
00102
00103   // add them items to your menu, inserting them at indexMenu + the offset for your
00104   // item.  idCmdFirst / idCmdList is the range you should use, they should
00105   // not exceed this range.  On exit return the number of items and IDs you claimed,
00106
00107     if ( !LoadString(_Module.GetModuleInstance(), IDS_SCP_MENU,
00108                      szBuffer, ARRAYLEN(szBuffer)) )
00109     {
00110       ATLTRACE(_T("Failed to load resource for menu item.\n"));
00111     }
00112     _InsertMenuHelper(hMenu,
00113              indexMenu,
00114              MF_BYPOSITION|MF_STRING,
00115              idCmdFirst,
00116              szBuffer, &nMenuItemsAdded);
00117
00118   return nMenuItemsAdded;
00119 }
00120
00121
00122 STDMETHODIMP
00123 CContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
00124 {
00125   HRESULT hr = S_OK;
00126   ATLTRACE (_T("CDSContextMenu::InvokeCommand\n"));
00127   ATLTRACE (_T("\tlpcmi->lpVerb is %d.\n"), lpcmi->lpVerb);
00128
00129   switch ((INT_PTR)(lpcmi->lpVerb))
00130   {
00131   case 0:
00132     ShowClipformatInfo();
00133     break;
00134   }
00135   return hr;
00136 }
00137
00138 STDMETHODIMP
00139 CContextMenu::GetCommandString(UINT_PTR idCmd,
00140                                    UINT uFlags,
00141                                    UINT FAR* reserved,
00142                                    LPSTR pszName,
00143                                    UINT ccMax)
00144
00145 {
00146   HRESULT hr = S_OK;
00147   TCHAR szBuffer[MAX_PATH];
00148
00149
00150   ATLTRACE (_T("CContextMenu::GetCommandString\n"));
00151   ATLTRACE (_T("\tidCmd is %d.\n"), idCmd);
00152   if (uFlags != GCS_HELPTEXT)
00153   {
00154     ATLTRACE (_T("CDSContextMenu::GetCommand String- flags don't request helptext. flags: %lx\n"),
00155            uFlags);
00156     return hr;
00157   }
00158
00159   switch ((idCmd))
00160   {
00161   case 0:
00162     if ( !LoadString(_Module.GetModuleInstance(), IDS_SCP_MENU,
00163                      szBuffer, ARRAYLEN(szBuffer)) )
00164     break;
00165   }
00166
00167
00168   wcscpy ((LPWSTR)pszName, (LPWSTR)(LPCWSTR)szBuffer);
00169   return hr;
00170 }
00171
00172
00173 void CContextMenu::ShowClipformatInfo()
00174 {
00175   CSCPCMenuDialog dlg(m_spDataObj);
00176   dlg.DoModal();
00177 }
00178
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/addvfiledlg.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

addvfiledlg.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  AddVFileDlg.cpp:  Implementation of the CAddVFileDlg class.
00015 //
00016
00017
00018
00019 #include "AddVFileDlg.h"
00020 #include "Globals.h"
00021 #include "Resource.h"        // Control IDs
00022 #include "BaseNode.h"        // NODE_PROPERTIES struct
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //  Construction-Destruction
00026
00027 //---------------------------------------------------------------------------
00028 //
00029 CAddVFileDlg::CAddVFileDlg( ULONG nTemplate, HWND pParentWnd )
00030              : CBaseDialog( nTemplate )
00031 {
00032   _ASSERT( NULL != pParentWnd );
00033   m_hParentWnd = pParentWnd;
00034
00035 }
00036
00037 CAddVFileDlg::~CAddVFileDlg()
00038 {
00039 }
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 //  Message handlers
00043
00044
00045 //---------------------------------------------------------------------------
00046 LRESULT CAddVFileDlg::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
00047 {
00048   LRESULT lResult = 0;
00049
00050   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00051   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00052   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_LOCKED_ATTR   );
00053   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00054   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00055
00056   lResult = SendMessage( hArchiveCtrl,  BM_SETCHECK, BST_UNCHECKED, 0 );
00057   lResult = SendMessage( hHiddenCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00058   lResult = SendMessage( hLockedCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00059   lResult = SendMessage( hReadOnlyCtrl, BM_SETCHECK, BST_UNCHECKED, 0 );
00060
00061   lResult = SetWindowText( hDevNameCtrl, _T("") );
00062   SetFocus( hDevNameCtrl );
00063
00064   return 0;
00065 }
00066
00067 //---------------------------------------------------------------------------
00068 LRESULT CAddVFileDlg::OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam )
00069 {
00070   LRESULT          lResult = 0;
00071   NODE_PROPERTIES  NodeProps;
00072
00073   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00074
00075   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00076   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00077   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_LOCKED_ATTR   );
00078   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00079   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00080
00081   if( BST_CHECKED == SendMessage( hArchiveCtrl, BM_GETCHECK, 0, 0 ) )
00082     NodeProps.dwAttributes |= ATTRIBUTE_DATA_ARCHIVE;
00083
00084   if( BST_CHECKED == SendMessage( hHiddenCtrl, BM_GETCHECK, 0, 0 ) )
00085     NodeProps.dwAttributes |= ATTRIBUTE_DATA_HIDDEN;
00086
00087   if( BST_CHECKED == SendMessage( hLockedCtrl, BM_GETCHECK, 0, 0 ) )
00088     NodeProps.dwAttributes |= ATTRIBUTE_DATA_LOCKED;
00089
00090   if( BST_CHECKED == SendMessage( hReadOnlyCtrl, BM_GETCHECK, 0, 0 ) )
00091     NodeProps.dwAttributes |= ATTRIBUTE_DATA_READONLY;
00092
00093   // Convert to wide characters here for all platforms.  This is the node name
00094   TCHAR szBuff[ MAX_NAME_LEN ] = {0};
00095   GetWindowText( hDevNameCtrl, szBuff, MAX_NAME_LEN );
00096   CopyT2W( NodeProps.szNodeName, szBuff, MAX_NAME_LEN);
00097   // Probably a good idea to check for NULL name strings here
00098
00099   // This message passes the user supplied info to the Static Node
00100   SendMessage( m_hParentWnd, WM_ADD_VIRTUALFILE, (WPARAM)&NodeProps, 0 );
00101
00102   // Now tell the static node we are deleting ourselves so the
00103   // context menu option can be enabled
00104   SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00105
00106   // Call the base class to shut down the dialog
00107   CBaseDialog::OnOK( hDlg, wParam, lParam );
00108   return 0;
00109 }
00110
00111 /////////////////////////////////////////////////////////////////////////////
00112 //  Virtual function implementations
00113
00114 //---------------------------------------------------------------------------
00115 BOOL CAddVFileDlg::ProcessMessage
00116 (
00117   HWND     hDlg,           //[in] Handle to dialog box
00118   UINT     uMsg,           //[in] Message
00119   WPARAM   wParam,         //[in] First message parameter
00120   LPARAM   lParam          //[in] Second message parameter
00121 )
00122 {
00123   LRESULT lResult = 0;
00124
00125   switch( uMsg )
00126   {
00127     case WM_INITDIALOG:
00128       lResult = OnInitDialog( hDlg, wParam, lParam );
00129       break;
00130
00131     case WM_DESTROY:
00132       lResult = OnDestroy( hDlg, wParam, lParam );
00133       break;
00134
00135     case WM_NCDESTROY:
00136       lResult = OnNcDestroy( hDlg, wParam, lParam );
00137       break;
00138
00139     case WM_CLOSE:
00140       // Not overriding WM_CLOSE and IDCANCEL so we must send
00141       // WM_DEVICENODE_CLOSED before calling the base class or else
00142       // the context menu will stay grayed
00143       SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00144       lResult = OnClose( hDlg, wParam, lParam );
00145
00146     case WM_COMMAND:
00147       switch( wParam )
00148       {
00149         case IDOK:
00150           lResult = OnOK( hDlg, wParam, lParam );
00151           break;
00152
00153         case IDCANCEL:
00154           SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00155           lResult = OnCancel( hDlg, wParam, lParam );
00156           break;
00157
00158         default:
00159           break;
00160       }
00161     default:
00162       break;
00163   }
00164   return (BOOL)lResult;
00165 }
00166
00167
00168
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/basedialog.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

basedialog.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  BaseDialog.cpp: implementation of the CBaseDialog class.
00014 //
00015
00016 #include "BaseDialog.h"
00017 #include "Globals.h"
00018
00019
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 // Construction/Destruction
00023
00024 //---------------------------------------------------------------------------
00025 CBaseDialog::CBaseDialog( ULONG nTemplate )
00026 {
00027   _ASSERT( NULL != nTemplate );
00028
00029   m_nTemplate = nTemplate;
00030   m_hWnd      = NULL;          // Handle returned by CreateDialogParam
00031   m_DlgProc   = DlgProc;       // Point to default dialog proc
00032   m_dwFlags   = 0;
00033 }
00034
00035 //---------------------------------------------------------------------------
00036 CBaseDialog::~CBaseDialog()
00037 {
00038 }
00039
00040 //---------------------------------------------------------------------------
00041 //  Use CreateDialogParam rather than CreateDialog so that we can later
00042 //  retrieve the 'this' pointer which we will need to point back to the
00043 //  particular instance of this class.
00044 //
00045 HWND CBaseDialog::Create
00046 (
00047   HINSTANCE  hInstance,      //[in] Global instance handle
00048   HWND       hWndParent,     //[in] Handle to parent window
00049   DWORD      dwFlags         //[in] Create flags - not used
00050 )
00051 {
00052   _ASSERT( NULL != hInstance );
00053
00054   m_dwFlags = dwFlags;
00055   m_hWnd = CreateDialogParam( hInstance,
00056                               MAKEINTRESOURCE(m_nTemplate),
00057                               hWndParent,
00058                               m_DlgProc,
00059                               (LPARAM)this
00060                             );
00061
00062   BOOL bReturn = ShowWindow( m_hWnd, SW_SHOW );  // Should return 0
00063
00064   return m_hWnd;
00065 }
00066
00067
00068 /////////////////////////////////////////////////////////////////////////////
00069 //  Message Handlers
00070
00071 //---------------------------------------------------------------------------
00072 LRESULT CBaseDialog::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
00073 {
00074   return 1;
00075 }
00076
00077 //---------------------------------------------------------------------------
00078 //  This is the first message sent by the DetroyWindow() function.
00079 //  It is sent after the window is removed from the screen, but it should
00080 //  be assumed that any child windows still exist.
00081 //
00082 LRESULT CBaseDialog::OnDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam )
00083 {
00084   return 1;
00085 }
00086
00087 //---------------------------------------------------------------------------
00088 //  This is sent after WM_DESTROY, and informs the app that the non-client
00089 //  area is being destroyed.  This is where allocated resources should be
00090 //  cleaned up.
00091 //
00092 LRESULT CBaseDialog::OnNcDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam )
00093 {
00094   m_hWnd = NULL;             // Since this is a modeless-only dialog
00095   delete this;               // class we delete ourselves here
00096
00097   return 1;
00098 }
00099
00100 //---------------------------------------------------------------------------
00101 LRESULT CBaseDialog::OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam )
00102 {
00103   return DestroyWindow( m_hWnd);
00104 }
00105
00106 //---------------------------------------------------------------------------
00107 LRESULT CBaseDialog::OnCancel( HWND hDlg, WPARAM wParam, LPARAM lParam )
00108 {
00109   return DestroyWindow( m_hWnd);
00110 }
00111
00112 //---------------------------------------------------------------------------
00113 LRESULT CBaseDialog::OnClose( HWND hDlg, WPARAM wParam, LPARAM lParam )
00114 {
00115   return DestroyWindow( m_hWnd);
00116 }
00117
00118
00119 /////////////////////////////////////////////////////////////////////////////
00120 //  Dialog Procedures
00121
00122 //---------------------------------------------------------------------------
00123 //  Since this is a static function we can't use a 'this' pointer or call
00124 //  the base class directly.  There may be multiple base classes using
00125 //  this method.  We get around this by storing the 'this' pointer in the
00126 //  lParam of CreateDialogParam.  When we get WM_INITDIALOG we get this
00127 //  pointer back in the lParam.  Now we can use SetWindowLongPtr to store
00128 //  it, and later retireve it with GetWindowLongPtr.  Once we have a
00129 //  valid 'this' pointer we can cast it back to the base class and then
00130 //  call the base class's ProcessMessage function.
00131 //
00132 BOOL CALLBACK CBaseDialog::DlgProc
00133 (
00134   HWND     hDlg,           //[in] Handle to dialog box
00135   UINT     uMsg,           //[in] Message
00136   WPARAM   wParam,         //[in] First message parameter
00137   LPARAM   lParam          //[in] Second message parameter
00138 )
00139 {
00140   BOOL bReturn = FALSE;
00141   if( WM_INITDIALOG == uMsg )
00142   {
00143     SetWindowLongPtr(hDlg, GWL_USERDATA, lParam);
00144   }
00145
00146   CBaseDialog* pThis = reinterpret_cast<CBaseDialog*>(GetWindowLongPtr(hDlg, GWL_USERDATA));
00147   if( NULL != pThis )
00148   {
00149     bReturn = pThis->ProcessMessage( hDlg, uMsg, wParam, lParam );
00150   }
00151
00152   return bReturn;
00153 }
00154
00155 //---------------------------------------------------------------------------
00156 //  This is the instance specific method used to process messages.  The
00157 //  DialogProc delegates this responsibiliy to each instance of the class.
00158 //  This is a pure virtual function.  The code below is provided to cut
00159 //  and paste into the derived class's implementation.
00160 /*
00161 BOOL CBaseDialog::ProcessMessage
00162 (
00163   HWND     hDlg,           //[in] Handle to dialog box
00164   UINT     uMsg,           //[in] Message
00165   WPARAM   wParam,         //[in] First message parameter
00166   LPARAM   lParam          //[in] Second message parameter
00167 )
00168 {
00169   LRESULT lResult = 0;
00170   switch( uMsg )
00171   {
00172     case WM_INITDIALOG:
00173       lResult = OnInitDialog( hDlg, wParam, lParam );
00174       break;
00175
00176     case WM_DESTROY:
00177       lResult = OnDestroy( hDlg, wParam, lParam );
00178       break;
00179
00180     case WM_NCDESTROY:
00181       lResult = OnNcDestroy( hDlg, wParam, lParam );
00182       break;
00183
00184     case WM_CLOSE:
00185       lResult = OnClose( hDlg, wParam, lParam );
00186
00187     case WM_COMMAND:
00188       switch( wParam )
00189       {
00190         case IDOK:
00191           lResult = OnOK( hDlg, wParam, lParam );
00192           break;
00193
00194         case IDCANCEL:
00195           lResult = OnCancel( hDlg, wParam, lParam );
00196           break;
00197
00198         default:
00199           break;
00200       }
00201     default:
00202       break;
00203   }
00204   return (BOOL)lResult;
00205 }
00206 */
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Pipes/Pipeproc.c Source File

  • NetDS
  • RPC
  • Pipes

Pipeproc.c

Go to the documentation of this file.
00001 /*************************************************************************
00002                     Copyright Microsoft Corp. 1992 - 2000
00003                         Remote Machine pipe sample
00004
00005   FILE      :   pipeproc.c
00006
00007   PURPOSE   : Remote procedures used in the RPC distributed application
00008                 pipe sample
00009
00010   COMMENTS  :   This file is linked together with the server side of the
00011                 application.
00012
00013 *************************************************************************/
00014 #include "pipe.h"       // Generated by the MIDL compiler
00015 #include "common.h"     // Common definitions is locataed in  this file
00016
00017 #define MAX_BUFFER_SIZE 1000       // Buffer used on the server side
00018
00019
00020 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00021 /* Procedure    :   void ScrambleFile(unsigned long, CHAR_PIPE_TYPE *)  */
00022 /* Desc.        :   This procedure receives a file from the client, and */
00023 /*                  then "encodes" the file by adding 1 to every        */
00024 /*                  character, and then sends the file back to the      */
00025 /*                  client. The file is sent back and forth using pipes */
00026 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00027 void ScrambleFile(unsigned long nAction, CHAR_PIPE_TYPE *in_out_pipe)
00028 {
00029     FILE    *fpTemp;                    // Pointer to the temporary file
00030     _TUCHAR pcBuffer[MAX_BUFFER_SIZE];  // Buffer to store the elements in
00031
00032     unsigned long
00033         nActualTransferCount,   // Actual number of elements received
00034         nIdx,                   // Counter in loop
00035         nElementsToSend;        // Number of elements to send to the client
00036     BOOL bDone = FALSE;         // Inidicates when the pipe is done
00037
00038
00039     // Open up a file to temporary store the pulled data in
00040     fpTemp = _tfopen(TEXT("tempfile.oak"), TEXT("w+"));
00041
00042     _tprintf(TEXT("Retrieving data from the client...\n"));
00043     // First process the entire pull. Input pipes must be transmitted first
00044     while(FALSE == bDone)
00045     {
00046         in_out_pipe->pull(      // Grab a chunck of data from the client
00047             in_out_pipe->state, // Pointer to the state
00048             pcBuffer,           // Buffer to put data in
00049             MAX_BUFFER_SIZE,    // Max number of elements to receive
00050             &nActualTransferCount); // Actual number of elements received
00051
00052         // A data transfer count of 0 means the end of the pipe
00053         if(nActualTransferCount == 0)
00054         {
00055             bDone = TRUE;
00056         }
00057         else        // Save the data to an intermediate file
00058         {
00059             fwrite(pcBuffer, sizeof(_TUCHAR), nActualTransferCount, fpTemp);
00060         }
00061     }
00062
00063     // Reset the flag
00064     bDone = FALSE;
00065
00066     // Reset the filehandle to point at start of file
00067     fseek(fpTemp, 0, SEEK_SET);
00068
00069     _tprintf(TEXT("Sending the data back to the client...\n"));
00070     // Now we can send the data back
00071     while(FALSE == bDone)
00072     {
00073         // Read a number of bytes from the file, into the buffer
00074         nElementsToSend = (ULONG) fread(pcBuffer,
00075                                   sizeof(_TUCHAR),
00076                                   MAX_BUFFER_SIZE,
00077                                   fpTemp);
00078
00079         // If no more elements to send, we are done. Must send 0 to the
00080         // client to notify that the pipe is empty
00081         if(nElementsToSend == 0)
00082         {
00083             bDone = TRUE;
00084         }
00085
00086         // According to the action, scramble or descramble the data
00087         for (nIdx = 0; nIdx < nElementsToSend; nIdx++)
00088         {
00089             if(nAction == SCRAMBLE)
00090             {
00091                 pcBuffer[nIdx]++;
00092             }
00093             else
00094             {
00095                 pcBuffer[nIdx]--;
00096             }
00097         }
00098
00099         // Send the buffer to the client
00100         in_out_pipe->push(      // Send a chunck of data to the client
00101             in_out_pipe->state, // Pointer to the state
00102             pcBuffer,             // Date to send is in this buffer
00103             nElementsToSend);  // The number of elements to send
00104     } // End while (!done)
00105
00106     // Close the file
00107     fclose(fpTemp);
00108 }
00109
00110
00111
00112 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00113 /* Procedure    :   void ShutDown(void);                                */
00114 /* Desc.        :   This procedure send a message to the server that it */
00115 /*                  can stop listening for remote procedure calls       */
00116 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00117 void ShutDown(void)
00118 {
00119     RPC_STATUS nStatus;
00120
00121     // Tell the server to stop listening for remote procedure calls
00122     _tprintf(TEXT("Shutting down the server\n"));
00123     nStatus = RpcMgmtStopServerListening(NULL);
00124     EXIT_IF_FAIL(nStatus, "RpcMgmtStopServerListening");
00125 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/PoolTest.Idl Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest

PoolTest.Idl

Go to the documentation of this file.
00001 // PoolTest.idl : IDL source for PoolTest.dll
00002 //
00003
00004 library DummyLib
00005 {
00006
00007 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Print.h Source File

  • WinUI
  • CommDlg
  • CDTest

Print.h

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 void DoPrintDialog(HWND) ;
00007
00008 INT_PTR APIENTRY PrintProc(HWND, UINT, WPARAM, LPARAM) ;
00009 INT_PTR APIENTRY DevnamesProc(HWND, UINT, WPARAM, LPARAM) ;
00010 INT_PTR APIENTRY DevmodeProc(HWND, UINT, WPARAM, LPARAM) ;
00011
00012
00013
00014 #define ID_STRUCTSIZEP              119
00015 #define ID_HWNDOWNERP               120
00016 #define ID_HDCP                     123
00017 #define ID_FLAGSP                   124
00018 #define ID_FROMPAGEP                125
00019 #define ID_TOPAGEP                  126
00020 #define ID_MINPAGEP                 127
00021 #define ID_MAXPAGEP                 128
00022 #define ID_COPIESP                  129
00023 #define ID_HINSTANCEP               130
00024 #define ID_CUSTDATAP                131
00025 #define ID_LPPRINTTEMPP             133
00026 #define ID_LPSETUPTEMPP             134
00027 #define ID_HPRINTTEMPP              135
00028 #define ID_HSETUPTEMPP              136
00029 #define ID_SZDEVMODEP               606
00030 #define ID_SZDEVNAMESP              607
00031 #define ID_ADD1                     610
00032 #define ID_CLEAR1                   611
00033 #define ID_ADD2                     612
00034 #define ID_CLEAR2P                  613
00035 #define ID_ADD1P                    614
00036 #define ID_CLEAR1P                  615
00037 #define ID_ADD2P                    616
00038 #define ID_HDEVMODEP                608
00039 #define ID_HDEVNAMESP               609
00040 #define ID_ERRORP                   621
00041 #define ID_RETURNP                  622
00042 #define ID_EDITDEVMODE              617
00043 #define ID_EDITDEVNAMES             618
00044 #define ID_PRINTHOOKP               132
00045 #define ID_SETUPHOOKP               624
00046
00047
00048 #define ID_PRINTDIALOG              605
00049 #define ID_RESETPRINT               625
00050 #define ID_NULLSTRUCTP              626
00051 #define ID_PRESETUPP                627
00052 #define ID_PREPRINTP                628
00053 #define ID_MULTITHREADPRINT         629
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagMETA16HEADER Member List

This is the complete list of members for tagMETA16HEADER, including all inherited members.
mtHeaderSize | tagMETA16HEADER
mtMaxRecord | tagMETA16HEADER
mtNoObjects | tagMETA16HEADER
mtNoParameters | tagMETA16HEADER
mtSize | tagMETA16HEADER
mtType | tagMETA16HEADER
mtVersion | tagMETA16HEADER
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/list.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

list.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 2000 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module LIST.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _LIST_H_
00012 #define _LIST_H_
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // Includes
00016 //
00017 /////////////////////////////////////////////////////////////////////////////
00018 #include <limits.h>        ///ULONG_MAX
00019
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 // Defines
00023 //
00024 /////////////////////////////////////////////////////////////////////////////
00025 typedef void*    POSITION;
00026
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CNode
00030 //
00031 /////////////////////////////////////////////////////////////////////////////
00032 template <class TYPE> class CNode
00033 {
00034 public:
00035     // constructors
00036     CNode(CNode* pPrevNode, CNode* pNextNode);
00037     virtual ~CNode();
00038
00039     // members
00040     TYPE     m_data;        // element data
00041     CNode*   m_pNext;        // next CNode
00042     CNode*   m_pPrev;        // prev CNode
00043 };
00044
00045
00046 /////////////////////////////////////////////////////////////////////////////
00047 // CNode::CNode
00048 //
00049 /////////////////////////////////////////////////////////////////////////////
00050 template <class TYPE> CNode<TYPE>::CNode(CNode* pPrevNode, CNode* pNextNode)
00051 {
00052     //Constructor
00053     m_pPrev = pPrevNode;
00054     m_pNext = pNextNode;
00055
00056     //NOTE:  The constructor doesn't have an element passed in for
00057     //data.  This is so we don't have a copy of the parameter and then
00058     //need to copy it for assignment...
00059 }
00060
00061 /////////////////////////////////////////////////////////////////////////////
00062 // CNode::~CNode
00063 //
00064 /////////////////////////////////////////////////////////////////////////////
00065 template <class TYPE> CNode<TYPE>::~CNode()
00066 {
00067     //Destructor
00068     m_pPrev = NULL;
00069     m_pNext = NULL;
00070 }
00071
00072
00073
00074 /////////////////////////////////////////////////////////////////////////////
00075 // CList
00076 //
00077 /////////////////////////////////////////////////////////////////////////////
00078 template <class TYPE, class ARG_TYPE> class CList
00079 {
00080 public:
00081
00082     //constructors
00083     CList();
00084     virtual ~CList();
00085
00086     //members
00087 private:
00088     //data
00089     CNode<TYPE>*        m_pNodeHead;                    // Head of CList
00090     CNode<TYPE>*        m_pNodeTail;                    // Tail of CList
00091
00092     ULONG                m_ulElements;                    // Elements in the list
00093
00094 public:
00095     //list modifying operations
00096     virtual POSITION    AddHead(ARG_TYPE element);        // Add to Head
00097     virtual POSITION    AddTail(ARG_TYPE element);        // Add to Tail
00098
00099     virtual POSITION    InsertBefore(POSITION position, ARG_TYPE element);    // Add before position
00100     virtual POSITION    InsertAfter(POSITION position, ARG_TYPE element);    // Add after position
00101
00102     virtual TYPE        RemoveHead();                    // Remove from Head
00103     virtual TYPE        RemoveTail();                    // Remove from Tail
00104     virtual TYPE        RemoveAt(POSITION position);    // RemoveAt position
00105             void        RemoveAll();                    // Remove all elements
00106
00107     //Peek methods
00108     inline    POSITION    GetHeadPosition()    const        {    return m_pNodeHead; }
00109     inline    POSITION    GetTailPosition()    const        {    return m_pNodeTail; }
00110
00111     inline    TYPE        GetHead()    const                {     ASSERT(m_pNodeHead);    return m_pNodeHead->m_data;        }
00112     inline    TYPE&        GetHead()                        {     ASSERT(m_pNodeHead);    return m_pNodeHead->m_data;        }
00113     inline    TYPE        GetTail()    const                {     ASSERT(m_pNodeTail);    return m_pNodeTail->m_data;        }
00114     inline    TYPE&        GetTail()                        {     ASSERT(m_pNodeTail);    return m_pNodeTail->m_data;        }
00115
00116     virtual TYPE        GetNext(POSITION& position)    const;    // Next element
00117     virtual TYPE&        GetNext(POSITION& position);        // Next element
00118     virtual TYPE        GetPrev(POSITION& position)    const;    // Prev element
00119     virtual TYPE&        GetPrev(POSITION& position);        // Prev element
00120
00121     //Data methods
00122     virtual TYPE        GetAt(POSITION position) const;                //Get element value
00123     virtual TYPE&        GetAt(POSITION position);                    //Get element value
00124     virtual void        SetAt(POSITION position, ARG_TYPE element);    //Set element value
00125
00126     //Array-like methods
00127     virtual POSITION    FindIndex(ULONG iIndex) const;        //Index element
00128     virtual POSITION    Find(ARG_TYPE element, POSITION startAfter = NULL) const;
00129
00130     //informational methods
00131     inline BOOL            IsEmpty()    const        {    return m_ulElements==0; }
00132     inline ULONG        GetCount()    const        {    return m_ulElements;    }
00133 };
00134
00135
00136 /////////////////////////////////////////////////////////////////////////////
00137 // CList::CList
00138 //
00139 /////////////////////////////////////////////////////////////////////////////
00140 template <class TYPE, class ARG_TYPE> CList<TYPE, ARG_TYPE>::CList()
00141 {
00142     //constructor
00143     m_pNodeHead        = NULL;
00144     m_pNodeTail        = NULL;
00145     m_ulElements    = 0;
00146 }
00147
00148 /////////////////////////////////////////////////////////////////////////////
00149 // CList::~CList
00150 //
00151 /////////////////////////////////////////////////////////////////////////////
00152 template <class TYPE, class ARG_TYPE> CList<TYPE, ARG_TYPE>::~CList()
00153 {
00154     //Remove all elements
00155     RemoveAll();
00156 }
00157
00158
00159 /////////////////////////////////////////////////////////////////////////////
00160 // CList::AddHead
00161 //
00162 /////////////////////////////////////////////////////////////////////////////
00163 template <class TYPE, class ARG_TYPE> POSITION CList<TYPE, ARG_TYPE>::AddHead(ARG_TYPE element)
00164 {
00165     //Add to the Head of the CList, (stack)
00166     CNode<TYPE>* pNewNode = new CNode<TYPE>(NULL, m_pNodeHead);
00167     if(pNewNode)
00168     {
00169         pNewNode->m_data = element;
00170
00171         //If there was a list hook the head->prev to the new head
00172         if(m_pNodeHead)
00173             m_pNodeHead->m_pPrev = pNewNode;
00174         else
00175             m_pNodeTail = pNewNode;
00176
00177         m_pNodeHead = pNewNode;
00178         m_ulElements++;
00179     }
00180     return pNewNode;
00181 }
00182
00183
00184 /////////////////////////////////////////////////////////////////////////////
00185 // CList::AddTail
00186 //
00187 /////////////////////////////////////////////////////////////////////////////
00188 template <class TYPE, class ARG_TYPE> POSITION CList<TYPE, ARG_TYPE>::AddTail(ARG_TYPE element)
00189 {
00190     //Add to the m_pNodeTail of the CList
00191     CNode<TYPE>* pNewNode = new CNode<TYPE>(m_pNodeTail, NULL);
00192     if(pNewNode)
00193     {
00194         pNewNode->m_data = element;
00195
00196         if(m_pNodeTail != NULL)
00197             m_pNodeTail->m_pNext = pNewNode;
00198         else
00199             m_pNodeHead = pNewNode;
00200
00201         m_pNodeTail = pNewNode;
00202         m_ulElements++;
00203     }
00204     return pNewNode;
00205 }
00206
00207
00208
00209 /////////////////////////////////////////////////////////////////////////////
00210 // CList::GetNext
00211 //
00212 /////////////////////////////////////////////////////////////////////////////
00213 template <class TYPE, class ARG_TYPE> TYPE CList<TYPE, ARG_TYPE>::GetNext(POSITION& position) const
00214 {
00215     ASSERT(position);
00216
00217     //Set position to the next element
00218     CNode<TYPE>* pNode = (CNode<TYPE>*)position;
00219     position = pNode->m_pNext;
00220
00221     //return the current element
00222     return pNode->m_data;
00223 }
00224
00225
00226 /////////////////////////////////////////////////////////////////////////////
00227 // CList::GetNext
00228 //
00229 /////////////////////////////////////////////////////////////////////////////
00230 template <class TYPE, class ARG_TYPE> TYPE& CList<TYPE, ARG_TYPE>::GetNext(POSITION& position)
00231 {
00232     ASSERT(position);
00233
00234     //Set position to the next element
00235     CNode<TYPE>* pNode = (CNode<TYPE>*)position;
00236     position = pNode->m_pNext;
00237
00238     //return the current element
00239     return pNode->m_data;
00240 }
00241
00242
00243 /////////////////////////////////////////////////////////////////////////////
00244 // CList::GetPrev
00245 //
00246 /////////////////////////////////////////////////////////////////////////////
00247 template <class TYPE, class ARG_TYPE> TYPE CList<TYPE, ARG_TYPE>::GetPrev(POSITION& position) const
00248 {
00249     ASSERT(position);
00250
00251     //Set position to the next element
00252     CNode<TYPE>* pNode = (CNode<TYPE>*)position;
00253     position = pNode->m_pPrev;
00254
00255     //return the current element
00256     return pNode->m_data;
00257 }
00258
00259
00260 /////////////////////////////////////////////////////////////////////////////
00261 // CList::GetPrev
00262 //
00263 /////////////////////////////////////////////////////////////////////////////
00264 template <class TYPE, class ARG_TYPE> TYPE& CList<TYPE, ARG_TYPE>::GetPrev(POSITION& position)
00265 {
00266     ASSERT(position);
00267
00268     //Set position to the next element
00269     CNode<TYPE>* pNode = (CNode<TYPE>*)position;
00270     position = pNode->m_pPrev;
00271
00272     //return the current element
00273     return pNode->m_data;
00274 }
00275
00276
00277 /////////////////////////////////////////////////////////////////////////////
00278 // CList::GetAt
00279 //
00280 /////////////////////////////////////////////////////////////////////////////
00281 template <class TYPE, class ARG_TYPE> TYPE CList<TYPE, ARG_TYPE>::GetAt(POSITION position) const
00282 {
00283     ASSERT(position);
00284     CNode<TYPE>* pNode = (CNode<TYPE>*)position;
00285     return pNode->m_data;
00286 }
00287
00288 /////////////////////////////////////////////////////////////////////////////
00289 // CList::GetAt
00290 //
00291 /////////////////////////////////////////////////////////////////////////////
00292 template <class TYPE, class ARG_TYPE> TYPE& CList<TYPE, ARG_TYPE>::GetAt(POSITION position)
00293 {
00294     ASSERT(position);
00295     CNode<TYPE>* pNode = (CNode<TYPE>*)position;
00296     return pNode->m_data;
00297 }
00298
00299 /////////////////////////////////////////////////////////////////////////////
00300 // CList::SetAt
00301 //
00302 /////////////////////////////////////////////////////////////////////////////
00303 template <class TYPE, class ARG_TYPE> void CList<TYPE, ARG_TYPE>::SetAt(POSITION position, ARG_TYPE element)
00304 {
00305     ASSERT(position);
00306
00307     //Save the old data
00308     CNode<TYPE>* pNode = (CNode<TYPE>*)position;
00309
00310     //Store new data
00311     pNode->m_data = element;
00312 }
00313
00314
00315 /////////////////////////////////////////////////////////////////////////////
00316 // CList::RemoveHead
00317 //
00318 /////////////////////////////////////////////////////////////////////////////
00319 template <class TYPE, class ARG_TYPE> TYPE CList<TYPE, ARG_TYPE>::RemoveHead()
00320 {
00321     //Remove and return from the Head of the List
00322     ASSERT(m_pNodeHead);
00323
00324     CNode<TYPE>* pOldHead = m_pNodeHead;    // pointer to the Removed node
00325     TYPE element = GetHead();                //make a copy, before deleteing
00326
00327     m_pNodeHead = pOldHead->m_pNext;    // reroute Head to exclude the first element
00328     if(m_pNodeHead)
00329     {
00330         ASSERT(m_pNodeTail);
00331         m_pNodeHead->m_pPrev = NULL;
00332     }
00333     else
00334     {
00335         m_pNodeTail = NULL;
00336     }
00337
00338     m_ulElements--;
00339     delete pOldHead;                        // delete head
00340     return element;
00341 }
00342
00343
00344 /////////////////////////////////////////////////////////////////////////////
00345 // CList::RemoveTail
00346 //
00347 /////////////////////////////////////////////////////////////////////////////
00348 template <class TYPE, class ARG_TYPE> TYPE CList<TYPE, ARG_TYPE>::RemoveTail()
00349 {
00350     //Remove and return from the m_pNodeTail of the CList
00351     ASSERT(m_pNodeTail);
00352
00353     CNode<TYPE>* pOldTail = m_pNodeTail;
00354     TYPE element = GetTail();  //make a copy before deleteing
00355
00356     m_pNodeTail = pOldTail->m_pPrev;
00357     if(m_pNodeTail)
00358     {
00359         ASSERT(m_pNodeHead);
00360         m_pNodeTail->m_pNext = NULL;
00361     }
00362     else
00363     {
00364         m_pNodeHead = NULL;
00365     }
00366
00367     m_ulElements--;
00368     delete pOldTail;
00369     return element;
00370 }
00371
00372
00373 /////////////////////////////////////////////////////////////////////////////
00374 // CList::RemoveAt
00375 //
00376 /////////////////////////////////////////////////////////////////////////////
00377 template <class TYPE, class ARG_TYPE> TYPE CList<TYPE, ARG_TYPE>::RemoveAt(POSITION position)
00378 {
00379     //Remove CList[position]
00380     ASSERT(position);
00381     CNode<TYPE>* pOldNode = (CNode<TYPE>*)position;
00382     TYPE element = GetAt(position);  //make a copy before deleteing
00383
00384     // If removing the head
00385     if(pOldNode == m_pNodeHead)
00386     {
00387         m_pNodeHead = pOldNode->m_pNext;
00388     }
00389     else
00390     {
00391         pOldNode->m_pPrev->m_pNext = pOldNode->m_pNext;
00392     }
00393
00394     if (pOldNode == m_pNodeTail)
00395     {
00396         m_pNodeTail = pOldNode->m_pPrev;
00397     }
00398     else
00399     {
00400         pOldNode->m_pNext->m_pPrev = pOldNode->m_pPrev;
00401     }
00402
00403     m_ulElements--;
00404     delete pOldNode;
00405     return element;
00406 }
00407
00408 /////////////////////////////////////////////////////////////////////////////
00409 // CList::RemoveAll
00410 //
00411 /////////////////////////////////////////////////////////////////////////////
00412 template <class TYPE, class ARG_TYPE> void CList<TYPE, ARG_TYPE>::RemoveAll()
00413 {
00414     // Remove all items from the CList
00415     CNode<TYPE>* pNode = m_pNodeHead;
00416     while(pNode)
00417     {
00418         CNode<TYPE>* pTemp = pNode;
00419         pNode = pNode->m_pNext;
00420         delete pTemp;
00421     }
00422
00423     m_pNodeHead   = NULL;
00424     m_pNodeTail   = NULL;
00425     m_ulElements    = 0;
00426 }
00427
00428
00429 /////////////////////////////////////////////////////////////////////////////
00430 // CList::InsertBefore
00431 //
00432 /////////////////////////////////////////////////////////////////////////////
00433 template <class TYPE, class ARG_TYPE> POSITION CList<TYPE, ARG_TYPE>::InsertBefore(POSITION position, ARG_TYPE element)
00434 {
00435     //insert before the position
00436     if(position == m_pNodeHead)    // Add before Head
00437       return AddHead(element);
00438
00439     CNode<TYPE>* pOldNode = (CNode<TYPE>*)position;
00440
00441     //otherwise a little more difficult
00442     CNode<TYPE>* pNewNode = new CNode<TYPE>(pOldNode->m_pPrev, pOldNode);
00443     if(pNewNode)
00444     {
00445         pNewNode->m_data = element;
00446
00447         //Hook up before after nodes to it
00448         if(pOldNode->m_pPrev)
00449         {
00450             pOldNode->m_pPrev->m_pNext = pNewNode;
00451         }
00452         else
00453         {
00454             m_pNodeHead = pNewNode;
00455         }
00456
00457         m_ulElements++;
00458     }
00459     return pNewNode;
00460 }
00461
00462
00463
00464 /////////////////////////////////////////////////////////////////////////////
00465 // CList::InsertAfter
00466 //
00467 /////////////////////////////////////////////////////////////////////////////
00468 template <class TYPE, class ARG_TYPE> POSITION CList<TYPE, ARG_TYPE>::InsertAfter(POSITION position, ARG_TYPE element)
00469 {
00470     //insert after the position
00471     if(position == m_pNodeTail)     // Add after the m_pNodeTail
00472       return AddTail(element);
00473
00474     CNode<TYPE>* pOldNode = (CNode<TYPE>*)position;
00475
00476     //other wise a little more difficult
00477     CNode<TYPE>* pNewNode = new CNode<TYPE>(pOldNode, pOldNode->m_pNext);
00478     if(pNewNode)
00479     {
00480         pNewNode->m_data = element;
00481
00482         //Hook up before after nodes to it
00483         if(pOldNode->m_pNext)
00484         {
00485             pOldNode->m_pNext->m_pPrev = pNewNode;
00486         }
00487         else
00488         {
00489             m_pNodeTail = pNewNode;
00490         }
00491
00492         m_ulElements++;
00493     }
00494     return pNewNode;
00495 }
00496
00497
00498 /////////////////////////////////////////////////////////////////////////////
00499 // CList::FindIndex
00500 //
00501 /////////////////////////////////////////////////////////////////////////////
00502 template <class TYPE, class ARG_TYPE> POSITION CList<TYPE, ARG_TYPE>::FindIndex(ULONG iIndex) const
00503 {
00504     ASSERT(iIndex>=0 && iIndex<m_ulElements);
00505
00506     CNode<TYPE>* pNode = m_pNodeHead;
00507
00508     //Find the specified index
00509     while(iIndex--)
00510         pNode = pNode->m_pNext;
00511
00512     return (POSITION)pNode;
00513 }
00514
00515
00516 /////////////////////////////////////////////////////////////////////////////
00517 // CList::Find
00518 //
00519 /////////////////////////////////////////////////////////////////////////////
00520 template <class TYPE, class ARG_TYPE> POSITION CList<TYPE, ARG_TYPE>::Find(ARG_TYPE element, POSITION pPosAfter) const
00521 {
00522     CNode<TYPE>* pNode = m_pNodeHead;
00523     if(pPosAfter)
00524         pNode = ((CNode<TYPE>*)pPosAfter)->m_pNext;
00525
00526     //return pointer to found element
00527     for(CNode<TYPE>* p = pNode; p != NULL; p = p->m_pNext)
00528       if(p->m_data == element)
00529         return p;   // return position to found CNode
00530
00531     return NULL;  // return NULL if not found
00532 }
00533
00534
00535
00536 /////////////////////////////////////////////////////////////////////////////
00537 // CAssoc
00538 //
00539 /////////////////////////////////////////////////////////////////////////////
00540 template <class KEY, class VALUE> class CAssoc
00541 {
00542 public:
00543     // constructors
00544     CAssoc();
00545     virtual ~CAssoc();
00546
00547     // members
00548     KEY          m_key;        // key
00549     VALUE     m_value;      // element data
00550 };
00551
00552
00553 /////////////////////////////////////////////////////////////////////////////
00554 // CAssoc::CAssoc
00555 //
00556 /////////////////////////////////////////////////////////////////////////////
00557 template <class KEY, class VALUE> CAssoc<KEY, VALUE>::CAssoc()
00558 {
00559     //Constructor
00560 //    m_key        = key;
00561 //    m_value        = value;      // element data
00562
00563     //NOTE:  The constructor doesn't have an element passed in for
00564     //data.  This is so we don't have a copy of the parameter and then
00565     //need to copy it for assignment...
00566 }
00567
00568 /////////////////////////////////////////////////////////////////////////////
00569 // CAssoc::~CAssoc
00570 //
00571 /////////////////////////////////////////////////////////////////////////////
00572 template <class KEY, class VALUE> CAssoc<KEY, VALUE>::~CAssoc()
00573 {
00574 }
00575
00576
00577 /////////////////////////////////////////////////////////////////////////////
00578 // CMap
00579 //
00580 /////////////////////////////////////////////////////////////////////////////
00581 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00582 class CMap
00583 {
00584 public:
00585     // Construction
00586     CMap();
00587     virtual ~CMap();
00588
00589     // number of elements
00590     int GetCount();
00591     BOOL IsEmpty();
00592
00593     // Lookup
00594     BOOL Lookup(ARG_KEY key, VALUE& rValue);
00595
00596     // add a new (key, value) pair
00597     BOOL SetAt(ARG_KEY key, ARG_VALUE newValue);
00598
00599     // removing existing (key, ?) pair
00600     BOOL RemoveKey(ARG_KEY key);
00601     void RemoveAll();
00602
00603     // iterating all (key, value) pairs
00604     POSITION GetStartPosition();
00605     void GetNextAssoc(POSITION& rNextPosition, KEY& rKey, VALUE& rValue);
00606
00607 // Implementation
00608 protected:
00609     POSITION            GetPosition(ARG_KEY key);
00610     CAssoc<KEY, VALUE>*    AssocFromPos(POSITION);
00611
00612     CList<CAssoc<KEY, VALUE>*, CAssoc<KEY, VALUE>*>  m_listValues;
00613 };
00614
00615
00616 /////////////////////////////////////////////////////////////////////////////
00617 // CMap
00618 //
00619 /////////////////////////////////////////////////////////////////////////////
00620 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00621 CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::CMap()
00622 {
00623 }
00624
00625 /////////////////////////////////////////////////////////////////////////////
00626 // ~CMap
00627 //
00628 /////////////////////////////////////////////////////////////////////////////
00629 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00630 CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::~CMap()
00631 {
00632     m_listValues.RemoveAll();
00633 }
00634
00635
00636 /////////////////////////////////////////////////////////////////////////////
00637 // CMap::GetPosition
00638 //
00639 /////////////////////////////////////////////////////////////////////////////
00640 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00641 POSITION CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetPosition(ARG_KEY key)
00642 {
00643     //Find this "key" in the list...
00644     //NOTE:  This is an extremly slow process for a CMap class.
00645     //This is a linear search to just make the code simple and quick,
00646     //This really should be a hashtable lookup
00647     POSITION pos = m_listValues.GetHeadPosition();
00648     while(pos)
00649     {
00650         if(AssocFromPos(pos)->m_key == key)
00651             return pos;
00652         m_listValues.GetNext(pos);
00653     }
00654
00655     return NULL;
00656 }
00657
00658 /////////////////////////////////////////////////////////////////////////////
00659 // CMap::AssocFromPos
00660 //
00661 /////////////////////////////////////////////////////////////////////////////
00662 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00663 CAssoc<KEY, VALUE>* CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::AssocFromPos(POSITION pos)
00664 {
00665     if(!pos)
00666         return NULL;
00667
00668     CNode<CAssoc<KEY, VALUE>*>* pNode = (CNode<CAssoc<KEY, VALUE>*>*)pos;
00669     return pNode->m_data;
00670 }
00671
00672 /////////////////////////////////////////////////////////////////////////////
00673 // CMap::GetStartPosition
00674 //
00675 /////////////////////////////////////////////////////////////////////////////
00676 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00677 POSITION CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetStartPosition()
00678 {
00679     return m_listValues.GetHeadPosition();
00680 }
00681
00682 /////////////////////////////////////////////////////////////////////////////
00683 // CMap::GetCount
00684 //
00685 /////////////////////////////////////////////////////////////////////////////
00686 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00687 int CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetCount()
00688 {
00689     return m_listValues.GetCount();
00690 }
00691
00692 /////////////////////////////////////////////////////////////////////////////
00693 // CMap::IsEmpty
00694 //
00695 /////////////////////////////////////////////////////////////////////////////
00696 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00697 BOOL CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::IsEmpty()
00698 {
00699     return m_listValues.IsEmpty();
00700 }
00701
00702 /////////////////////////////////////////////////////////////////////////////
00703 // CMap::Lookup
00704 //
00705 /////////////////////////////////////////////////////////////////////////////
00706 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00707 BOOL CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::Lookup(ARG_KEY key, VALUE& rValue)
00708 {
00709     POSITION pos = GetPosition(key);
00710     if(!pos)
00711         return FALSE;
00712
00713     rValue = AssocFromPos(pos)->m_value;
00714     return TRUE;
00715 }
00716
00717 /////////////////////////////////////////////////////////////////////////////
00718 // CMap::RemoveAll
00719 //
00720 /////////////////////////////////////////////////////////////////////////////
00721 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00722 void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::RemoveAll()
00723 {
00724     m_listValues.RemoveAll();
00725 }
00726
00727
00728 /////////////////////////////////////////////////////////////////////////////
00729 // CMap::RemoveKey
00730 //
00731 /////////////////////////////////////////////////////////////////////////////
00732 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00733 BOOL CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::RemoveKey(ARG_KEY key)
00734 // remove key - return TRUE if removed
00735 {
00736     //Find the key in the List...
00737     POSITION pos = GetPosition(key);
00738     if(pos == NULL)
00739         return FALSE;
00740
00741     //Remove this Node...
00742     m_listValues.RemoveAt(pos);
00743     return TRUE;
00744 }
00745
00746
00747 /////////////////////////////////////////////////////////////////////////////
00748 // CMap::SetAt
00749 //
00750 /////////////////////////////////////////////////////////////////////////////
00751 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00752 BOOL CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::SetAt(ARG_KEY key, ARG_VALUE value)
00753 {
00754     //Try to find this key...
00755     POSITION pos = GetPosition(key);
00756     if(pos)
00757     {
00758         //Found already, just change the value...
00759         AssocFromPos(pos)->m_value = value;
00760     }
00761     else
00762     {
00763         //Not found, just need to add to the list...
00764         CAssoc<KEY, VALUE>* pCAssoc = new CAssoc<KEY, VALUE>;
00765         if(!pCAssoc)
00766             return FALSE;
00767
00768         pCAssoc->m_key = key;
00769         pCAssoc->m_value = value;
00770
00771         //Add it to the list...
00772         m_listValues.AddTail(pCAssoc);
00773     }
00774
00775     return TRUE;
00776 }
00777
00778 /////////////////////////////////////////////////////////////////////////////
00779 // CMap::GetNextAssoc
00780 //
00781 /////////////////////////////////////////////////////////////////////////////
00782 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
00783 void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetNextAssoc(POSITION& rNextPosition,
00784     KEY& rKey, VALUE& rValue)
00785 {
00786     if(rNextPosition)
00787     {
00788         CAssoc<KEY, VALUE>* pCAssoc = AssocFromPos(rNextPosition);
00789         rKey = pCAssoc->m_key;
00790         rValue = pCAssoc->m_value;
00791
00792         //Update the position to the next item, for iteration...
00793         m_listValues.GetNext(rNextPosition);
00794     }
00795 }
00796
00797
00798
00799 /////////////////////////////////////////////////////////////////////////////
00800 // CVector
00801 //
00802 /////////////////////////////////////////////////////////////////////////////
00803 template <class TYPE, class IDX = ULONG> class CVector
00804 {
00805 public:
00806
00807     //constructors
00808     CVector(IDX ulLowerBound = 0, IDX ulGrowSize = 10);
00809     virtual ~CVector();
00810
00811     //array modifying operations
00812     virtual TYPE*        AddElement(TYPE element);
00813     virtual void        RemoveAll();
00814
00815     //insertion deletion routines
00816     virtual TYPE*        InsertAt(IDX iIndex, TYPE element);    // Insert element at index
00817     virtual void        RemoveAt(IDX iIndex);                    // Remove element at index
00818
00819     //Attaching
00820     virtual void        Attach(CVector& rVector);
00821     virtual void        Attach(IDX cElements, TYPE* rgElements);
00822     virtual void        Detach(IDX* pcElements, TYPE** prgElements);
00823
00824     //Array-like methods
00825     virtual TYPE&        GetElement(IDX iIndex);
00826     virtual TYPE&        operator[](IDX iIndex)            {    return GetElement(iIndex);    }
00827
00828     //informational methods
00829     virtual    const IDX    GetCount()                        {    return m_cElements;            }
00830     virtual    const TYPE*    GetElements() const             {    return m_rgElements;        }
00831
00832 protected:
00833     //data
00834     IDX                    m_ulMaxSize;                            // MAX sizeof array
00835     IDX                    m_ulGrowSize;                            // Size to Grow for each allocation
00836     IDX                    m_ulLowerBound;                            // LowerBound of array
00837     IDX                    m_cElements;                            // Number of elements
00838     TYPE*                m_rgElements;                            // Array of elements
00839 };
00840
00841
00842 /////////////////////////////////////////////////////////////////////////////
00843 // CVector::CVector
00844 //
00845 /////////////////////////////////////////////////////////////////////////////
00846 template <class TYPE, class IDX> CVector<TYPE, IDX>::CVector(IDX ulLowerBound, IDX ulGrowSize)
00847 {
00848     //construct the array
00849     m_ulLowerBound = ulLowerBound;
00850     m_ulMaxSize = 0;
00851     m_ulGrowSize = ulGrowSize;
00852
00853     m_cElements = 0;
00854     m_rgElements = NULL;
00855 }
00856
00857
00858 /////////////////////////////////////////////////////////////////////////////
00859 // CVector::~CVector
00860 //
00861 /////////////////////////////////////////////////////////////////////////////
00862 template <class TYPE, class IDX> CVector<TYPE, IDX>::~CVector()
00863 {
00864     //Delete the Array
00865     CoTaskMemFree(m_rgElements);
00866     m_rgElements    = NULL;
00867     m_cElements        = 0;
00868 }
00869
00870
00871 ///////////////////////////////////////////////////////////////
00872 // TPropSets::Attach
00873 //
00874 ///////////////////////////////////////////////////////////////
00875 template <class TYPE, class IDX> void CVector<TYPE, IDX>::Attach(CVector& rVector)
00876 {
00877     //Detach from passed in object
00878     IDX cElements = 0;
00879     TYPE* rgElements = NULL;
00880     rVector.Detach(&cElements, &rgElements);
00881
00882     //Now Attch them to our object
00883     Attach(cElements, rgElements);
00884 }
00885
00886
00887 ///////////////////////////////////////////////////////////////
00888 // CVector::Attach
00889 //
00890 ///////////////////////////////////////////////////////////////
00891 template <class TYPE, class IDX> void CVector<TYPE, IDX>::Attach(IDX cElements, TYPE* rgElements)
00892 {
00893     RemoveAll();
00894     CoTaskMemFree(m_rgElements);
00895
00896     m_ulMaxSize        = cElements;
00897     m_cElements        = cElements;
00898     m_rgElements    = rgElements;
00899 }
00900
00901
00902 ///////////////////////////////////////////////////////////////
00903 // CVector::Detach
00904 //
00905 ///////////////////////////////////////////////////////////////
00906 template <class TYPE, class IDX> void CVector<TYPE, IDX>::Detach(IDX* pcElements, TYPE** prgElements)
00907 {
00908     ASSERT(pcElements);
00909     ASSERT(prgElements);
00910
00911     //Give our elements to the user...
00912     *pcElements = m_cElements;
00913     *prgElements = m_rgElements;
00914
00915     //We are done with them (consumer owns them...)
00916     m_ulMaxSize    = 0;
00917     m_cElements = 0;
00918     m_rgElements = NULL;
00919 }
00920
00921
00922 /////////////////////////////////////////////////////////////////////////////
00923 // CVector::RemoveAll
00924 //
00925 /////////////////////////////////////////////////////////////////////////////
00926 template <class TYPE, class IDX> void CVector<TYPE, IDX>::RemoveAll()
00927 {
00928     //NOTE: We don't actually free the array, for optmizations.
00929     //We just reset the count of elements, and m_ulMaxSize records the amount of
00930     //memory that can be reused without needing reallocations...
00931     m_cElements = 0;
00932 }
00933
00934
00935 /////////////////////////////////////////////////////////////////////////////
00936 // CVector::RemoveAt
00937 //
00938 /////////////////////////////////////////////////////////////////////////////
00939 template <class TYPE, class IDX> void CVector<TYPE, IDX>::RemoveAt(IDX iIndex)
00940 {
00941     //Remove CVector[position]
00942     iIndex -= m_ulLowerBound;
00943     ASSERT(iIndex < m_cElements);
00944
00945     //May Need to shift the entire array after this element up
00946     //If it is not the last row in the vector
00947     if(iIndex < m_cElements)
00948         memmove(m_rgElements + iIndex, m_rgElements + iIndex + 1, (m_cElements-iIndex) * sizeof(TYPE));
00949
00950     m_cElements--;
00951 }
00952
00953
00954
00955 /////////////////////////////////////////////////////////////////////////////
00956 // CVector::AddElement
00957 //
00958 /////////////////////////////////////////////////////////////////////////////
00959 template <class TYPE, class IDX> TYPE* CVector<TYPE, IDX>::AddElement(TYPE element)
00960 {
00961     //Add an element to the end of the list
00962
00963     //Just delegate out to our InsertAt method, since we may need
00964     //to enlarge the buffer size...
00965     return InsertAt(m_cElements + m_ulLowerBound, element);
00966 }
00967
00968 /////////////////////////////////////////////////////////////////////////////
00969 // CVector::InsertAt
00970 //
00971 /////////////////////////////////////////////////////////////////////////////
00972 template <class TYPE, class IDX> TYPE* CVector<TYPE, IDX>::InsertAt(IDX iIndex, TYPE element)
00973 {
00974     iIndex -= m_ulLowerBound;
00975     ASSERT(iIndex <= m_cElements); //Could be adding at end
00976
00977     //May need to alloc more room (if needed)
00978     if(m_cElements == m_ulMaxSize)
00979     {
00980         m_ulMaxSize += 1 + m_ulGrowSize;
00981         m_rgElements = (TYPE*)CoTaskMemRealloc(m_rgElements, m_ulMaxSize * sizeof(TYPE));
00982
00983         //Check Allocation
00984         if(!m_rgElements)
00985             return NULL;
00986     }
00987
00988     //At this point we need an array...
00989     ASSERT(m_rgElements);
00990
00991     //May Need to shift the entire array after this element down
00992     //If not inserting at the end of the list
00993     if(iIndex < m_cElements)
00994         memmove(&m_rgElements[iIndex+1], &m_rgElements[iIndex], (m_cElements-iIndex) * sizeof(TYPE));
00995
00996     //Set new value
00997     m_rgElements[iIndex] = element;
00998     m_cElements++;
00999     return &m_rgElements[iIndex];
01000 }
01001
01002
01003
01004 /////////////////////////////////////////////////////////////////////////////
01005 // CVector::GetElements
01006 //
01007 /////////////////////////////////////////////////////////////////////////////
01008 template <class TYPE, class IDX> TYPE& CVector<TYPE, IDX>::GetElement(IDX iIndex)
01009 {
01010     iIndex -= m_ulLowerBound;
01011
01012     ASSERT(m_rgElements && iIndex < m_cElements);
01013     return m_rgElements[iIndex];
01014 }
01015
01016
01017
01018 /////////////////////////////////////////////////////////////////////////////
01019 // CVectorEx
01020 //
01021 // NOTE: This Vector class requires the operator== to be defined for the type
01022 /////////////////////////////////////////////////////////////////////////////
01023 template <class TYPE, class IDX = ULONG> class CVectorEx : public CVector<TYPE, IDX>
01024 {
01025 public:
01026
01027     //constructors
01028     CVectorEx(IDX ulLowerBound = 0, IDX ulGrowSize = 10);
01029     virtual ~CVectorEx();
01030
01031     //Helpers - require the operator== to be defined
01032     virtual void        RemoveElement(TYPE element);
01033     virtual IDX            FindElement(TYPE element);                // Find index of element
01034
01035 protected:
01036     //data
01037 };
01038
01039
01040 /////////////////////////////////////////////////////////////////////////////
01041 // CVectorEx::CVectorEx
01042 //
01043 /////////////////////////////////////////////////////////////////////////////
01044 template <class TYPE, class IDX> CVectorEx<TYPE, IDX>::CVectorEx(IDX ulLowerBound, IDX ulGrowSize)
01045     : CVector<TYPE, IDX>(ulLowerBound, ulGrowSize)
01046 {
01047 }
01048
01049
01050 /////////////////////////////////////////////////////////////////////////////
01051 // CVectorEx::~CVectorEx
01052 //
01053 /////////////////////////////////////////////////////////////////////////////
01054 template <class TYPE, class IDX> CVectorEx<TYPE, IDX>::~CVectorEx()
01055 {
01056 }
01057
01058 /////////////////////////////////////////////////////////////////////////////
01059 // CVectorEx::RemoveElement
01060 //
01061 /////////////////////////////////////////////////////////////////////////////
01062 template <class TYPE, class IDX> void CVectorEx<TYPE, IDX>::RemoveElement(TYPE element)
01063 {
01064     //Try to find the index of the element
01065     IDX iIndex = FindElement(element);
01066
01067     //Deletgate to our RemoveAt method
01068     RemoveAt(iIndex);
01069 }
01070
01071 /////////////////////////////////////////////////////////////////////////////
01072 // CVectorEx::FindElement
01073 //
01074 /////////////////////////////////////////////////////////////////////////////
01075 template <class TYPE, class IDX> IDX CVectorEx<TYPE, IDX>::FindElement(TYPE element)
01076 {
01077     //return pointer to found element
01078     for(IDX i=0; i<m_cElements; i++)
01079       if(m_rgElements[i] == element)
01080         return i + m_ulLowerBound;   // return position to found element
01081
01082     return ULONG_MAX;
01083 }
01084
01085
01086
01087 #endif //_LIST_H_
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/vcAcct/CAccount.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • vcAcct

CAccount.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc19.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\mssdk\samples\com\Services\Transaction\SampleBank\vcacct\release\vcacct.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package vcacct;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 /** @com.class(classid=04CF0B76-1989-11D0-B917-0080C7394688,DynamicCasts)
00019     @com.interface(iid=04CF0B72-1989-11D0-B917-0080C7394688, thread=AUTO, type=DUAL) */
00020 public class CAccount implements IUnknown,com.ms.com.NoAutoScripting,vcacct.IAccount
00021 {
00022   /** @com.method(vtoffset=4, dispid=1610743808, type=METHOD, name="Post", addFlagsVtable=4)
00023       @com.parameters([in,type=I4] lAccount, [in,type=I4] lAmount, [type=STRING] return) */
00024   public native String Post(int lAccount, int lAmount);
00025
00026
00027   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x4cf0b72, (short)0x1989, (short)0x11d0, (byte)0xb9, (byte)0x17, (byte)0x0, (byte)0x80, (byte)0xc7, (byte)0x39, (byte)0x46, (byte)0x88);
00028
00029   public static final com.ms.com._Guid clsid = new com.ms.com._Guid((int)0x4cf0b76, (short)0x1989, (short)0x11d0, (byte)0xb9, (byte)0x17, (byte)0x0, (byte)0x80, (byte)0xc7, (byte)0x39, (byte)0x46, (byte)0x88);
00030 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/msdfmap.idl Source File

  • Dataaccess
  • rds
  • handler
  • vc

msdfmap.idl

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File:        msdfmap.idl
00004 //
00005 // Copyright:   Copyright (c) 1991-1999 Microsoft Corporation
00006 //
00007 // Contents:    IDL source for msdfmap.dll
00008 //
00009 // Comments:    This file will be processed by the MIDL tool to
00010 //              produce the type library (msdfmap.tlb) and marshalling code.
00011 //
00012 //-----------------------------------------------------------------------------
00013
00014 import "oaidl.idl";
00015 import "ocidl.idl";
00016
00017
00018 [
00019   // MSDFMAP_VC type library
00020   uuid(9D3B7E04-5BAF-11d1-922A-00C04FBBBFB3),
00021   version(1.0),
00022   helpstring("msdfmap 1.0 Type Library")
00023 ]
00024 library MSDFMAPLib
00025 {
00026   importlib("stdole32.tlb");
00027 #ifdef WIN32
00028   importlib("stdole2.tlb");
00029 #else
00030   importlib("stdole.tlb");
00031 #endif
00032   importlib("msdfhdl.tlb");
00033
00034
00035   [
00036     // MSDFMAP_VC.Handler
00037     uuid(9D3B7E05-5BAF-11d1-922A-00C04FBBBFB3),
00038     helpstring("Handler Class")
00039   ]
00040   coclass Handler
00041   {
00042     [default] interface IDataFactoryHandler;
00043   };
00044 };
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IPC/NamePipe/Console/NmPipe.c Source File

  • WinBase
  • IPC
  • NamePipe
  • Console

NmPipe.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014 \******************************************************************************/
00015
00016 #include <windows.h>
00017 #include <stdio.h>
00018 #include <sddl.h>
00019 #include <stdlib.h>
00020 #include <process.h>
00021
00022 /* Error checking macro. If bSuccess == TRUE, print error info */
00023 #define PERR(bSuccess, szApi) {if (!(bSuccess)) printf("%s: Error %d from %s \
00024     on line %d\n", __FILE__, GetLastError(), szApi, __LINE__);}
00025
00026 #define DEFNAME "\\\\.\\pipe\\nmpipe" /* Default pipe name */
00027 /* Define OVERLAPPED_IO to TRUE to use Overlapped IO. Otherwise define as
00028    FALSE */
00029 //#define OVERLAPPED_IO TRUE
00030 #define OVERLAPPED_IO FALSE
00031
00032 /* structure to pass into the writer thread */
00033 typedef struct
00034 {
00035    HANDLE hPipe;     /* pipe write handle */
00036    char *szData;     /* data to repeatedly write */
00037    int iDataSize;    /* size of buffer pointed to by szData */
00038 } WRITER_PARAMS;
00039
00040
00041 // CreateMyDACL
00042 // Creates a security descriptor containing the
00043 // desired DACL. This function uses SDDL to make Deny and Allow ACEs.
00044 //
00045 // Parameter:
00046 //     SECURITY_ATTRIBUTES * pSA
00047 // Address to a SECURITY_ATTRIBUTES structure. It is the caller's
00048 // responsibility to properly initialize the structure, and to free
00049 // the structure's lpSecurityDescriptor member when done (by calling
00050 // the LocalFree function).
00051 //
00052 // Return value:
00053 //    FALSE if the address to the structure is NULL.
00054 //    Otherwise, this function returns the value from the
00055 //    ConvertStringSecurityDescriptorToSecurityDescriptor function.
00056 BOOL CreateMyDACL(SECURITY_ATTRIBUTES * pSA)
00057 {
00058     // Define the SDDL for the DACL. This example sets
00059     // the following access:
00060     //     Built-in guests are denied all access.
00061     //     Anonymous Logon is denied all access.
00062     //     Authenticated Users are allowed read/write/execute access.
00063     //     Administrators are allowed full control.
00064     // Modify these values as needed to generate the proper
00065     // DACL for your application.
00066     TCHAR * szSD = "D:"                   // Discretionary ACL
00067                    "(D;OICI;GA;;;BG)"     // Deny access to Built-in Guests
00068                    "(D;OICI;GA;;;AN)"     // Deny access to Anonymous Logon
00069                    "(A;OICI;GRGWGX;;;AU)" // Allow read/write/execute to Authenticated Users
00070                    "(A;OICI;GA;;;BA)";    // Allow full control to Administrators
00071
00072     if (NULL == pSA)
00073         return FALSE;
00074
00075     return ConvertStringSecurityDescriptorToSecurityDescriptor(
00076                                                               szSD,
00077                                                               SDDL_REVISION_1,
00078                                                               &(pSA->lpSecurityDescriptor),
00079                                                               NULL);
00080 }
00081
00082 /*
00083  ** BOOL pipeCheck(HANDLE h)
00084  *
00085  *  PARAMETERS: HANDLE hPipe: pipe handle to close if an error condition exists
00086  *
00087  *  DESCRIPTION: if GetLastError() returns a common error generated by a
00088  *               broken pipe, close the pipe handle. Call this right after a
00089  *               pipe operation.
00090  *
00091  *  RETURNS: FALSE if the pipe is broken, TRUE if not.
00092  *
00093  */
00094 BOOL pipeCheck(HANDLE hPipe)
00095 {
00096    DWORD dwLastError = GetLastError();
00097
00098    if (dwLastError == ERROR_BROKEN_PIPE || dwLastError == ERROR_NO_DATA)
00099    {
00100       puts("\n* pipe broken, closing...");
00101       CloseHandle(hPipe);
00102       return (FALSE);
00103    }
00104    if (dwLastError == ERROR_INVALID_HANDLE) /* is handle already closed? */
00105       return (FALSE);
00106    return (TRUE);
00107 } /* pipeCheck() */
00108
00109 /*
00110  ** void reader(HANDLE hPipe)
00111  *
00112  *  PARAMETERS: HANDLE hPipe: pipe handle to read from
00113  *
00114  *  DESCRIPTION: read from the handle and dump data to the console.
00115  *
00116  *  RETURNS: none
00117  *
00118  */
00119 void reader(HANDLE hPipe)
00120 {
00121    char buf[64];
00122    DWORD dwRead;
00123    BOOL bSuccess;
00124    OVERLAPPED ol;
00125
00126    if (OVERLAPPED_IO) /* if overlapped, prepare OVERLAPPED structure */
00127    {
00128       memset(&ol, 0, sizeof(ol));
00129       ol.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
00130       PERR(ol.hEvent, "CreateEvent");
00131    }
00132    while (1)
00133    {
00134       bSuccess = ReadFile(hPipe, buf, sizeof(buf), &dwRead,
00135                           OVERLAPPED_IO ? &ol : NULL);
00136       if (!bSuccess && GetLastError() == ERROR_IO_PENDING)
00137          bSuccess = GetOverlappedResult(hPipe, &ol, &dwRead, TRUE);
00138       /* If ReadFile or GetOverlappedResult fails, check pipe. If pipe is
00139          broken, fall out of loop */
00140       if (!bSuccess && !pipeCheck(hPipe))
00141          break;
00142       /* else check for any other kinds of errors that may have occurred */
00143       PERR(bSuccess, "ReadFile");
00144       printf("%.*s", dwRead, buf); /* print only number of chars read */
00145    } /* while */
00146    CloseHandle(ol.hEvent);
00147    _endthread();
00148 } /* reader() */
00149
00150 /*
00151  ** void writer(WRITER_PARAMS *writer_params)
00152  *
00153  *  PARAMETERS: WRITER_PARAMS *writer_params: misc info needed for writing to
00154  *              the pipe
00155  *
00156  *  DESCRIPTION: write data from WRITER_PARAMS to the pipe
00157  *
00158  *  RETURNS: none
00159  *
00160  */
00161 void writer(WRITER_PARAMS *writer_params)
00162 {
00163    DWORD dwWritten;
00164    BOOL bSuccess;
00165    OVERLAPPED ol;
00166
00167    if (OVERLAPPED_IO)
00168    {
00169       memset(&ol, 0, sizeof(ol));
00170       ol.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
00171       PERR(ol.hEvent, "CreateEvent");
00172    }
00173    while (1)
00174    {
00175       bSuccess = WriteFile(writer_params->hPipe, writer_params->szData,
00176                            writer_params->iDataSize, &dwWritten, OVERLAPPED_IO ? &ol : NULL);
00177       if (!bSuccess && GetLastError() == ERROR_IO_PENDING)
00178          bSuccess = GetOverlappedResult(writer_params->hPipe, &ol, &dwWritten,
00179                                         TRUE);
00180       /* If ReadFile or GetOverlappedResult fails, check pipe. If pipe is
00181          broken, fall out of loop */
00182       if (!bSuccess && !pipeCheck(writer_params->hPipe))
00183          break;
00184       /* else check for any other kinds of errors that may have occurred */
00185       PERR(bSuccess, "WriteFile");
00186    } /* while */
00187    free(writer_params);
00188    CloseHandle(ol.hEvent);
00189    _endthread();
00190 } /* writer() */
00191
00192 /*
00193  ** main()
00194  *
00195  *  DESCRIPTION: Connect pipe instances to clients. Start a reader thread for
00196  *               each client. If OVERLAPPED_IO is defined, also start a
00197  *               writer thread for full duplex pipe I/O testing. If this is
00198  *               a client, connect to the server pipe and start a writer
00199  *               thread. If OVERLAPPED_IO, also start a reader thread.
00200  *
00201  */
00202
00203 void main(int argc, char *argv[])
00204 {
00205    HANDLE hPipe;
00206    BOOL bSuccess;
00207    BOOL bNotConnected;
00208    char *szPname;
00209    WRITER_PARAMS *writer_params;
00210    DWORD dwClients;
00211    SECURITY_ATTRIBUTES saPipe;
00212    OVERLAPPED ol;
00213    DWORD dwRead;
00214
00215    if (argc < 3)
00216    {
00217       puts("nmpipe [/s|/c] <string> <pipename>");
00218       puts("'/s' to start as server, '/c' to start as client");
00219       puts("<string>: string to write to the pipe");
00220       puts("<pipename>: full UNC name of pipe (optional)");
00221       puts("example: nmpipe /s \"hello from server \" \\\\.\\pipe\\pipetst");
00222       return;
00223    }
00224    szPname = (argc > 3) ? argv[3] : DEFNAME;
00225    if (tolower(argv[1][1]) == 's')
00226    {
00227       if (OVERLAPPED_IO)
00228       {
00229          memset(&ol, 0, sizeof(ol));
00230          ol.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
00231          PERR(ol.hEvent, "CreateEvent");
00232       }
00233       SetConsoleTitle("SERVER: nmpipe sample");
00234
00235       saPipe.nLength = sizeof(saPipe);
00236       saPipe.bInheritHandle = TRUE;
00237
00238       if(!CreateMyDACL(&saPipe) )
00239       {
00240           // DACL creation FAILED!!
00241           return;
00242       }
00243
00244       while (1)
00245       {
00246          /* Create a named pipe: duplex, type byte, readmode byte, unlimited
00247             instances, default timeout of 60s */
00248          hPipe = CreateNamedPipe(szPname, PIPE_ACCESS_DUPLEX |
00249                                  (OVERLAPPED_IO ? FILE_FLAG_OVERLAPPED : 0), PIPE_TYPE_BYTE |
00250                                  PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 0, 0,
00251                                  60000, &saPipe);
00252          PERR(hPipe != INVALID_HANDLE_VALUE, "CreateNamedPipe");
00253          puts("\n* pipe created, waiting for connection...");
00254          bSuccess = ConnectNamedPipe(hPipe, OVERLAPPED_IO ? &ol : NULL);
00255          if (!bSuccess && GetLastError() == ERROR_IO_PENDING)
00256             bSuccess = GetOverlappedResult(hPipe, &ol, &dwRead, TRUE);
00257          /* check return from either ConnectNamedPipe or GetOverlappedResult.
00258             If a client managed to connect between the CreateNamedPipe and
00259             ConnectNamedPipe calls, ERROR_PIPE_CONNECTED will result */
00260          if (!bSuccess && GetLastError() != ERROR_PIPE_CONNECTED)
00261          {
00262             /* something went wrong, report error, close instance and try again */
00263             PERR(bSuccess, "ConnectNamedPipe");
00264             CloseHandle(hPipe);
00265             continue;
00266          }
00267          /* find out how many pipe instances there currently are */
00268          bSuccess = GetNamedPipeHandleState(hPipe, NULL, &dwClients, NULL, NULL,
00269                                             NULL, 0);
00270          PERR(bSuccess, "GetNamedPipeHandleState");
00271          printf("\n* %d clients connected", dwClients);
00272          _beginthread(reader, 0, hPipe);
00273          writer_params = (WRITER_PARAMS *)malloc(sizeof(WRITER_PARAMS));
00274          if (NULL == writer_params)
00275          {
00276              // Malloc failed
00277              return;
00278          }
00279          writer_params->hPipe = hPipe;
00280          writer_params->szData = argv[2];
00281          writer_params->iDataSize = (int)strlen(argv[2]);
00282          /* WARNING! reading and writing at the same time to a non-overlapped
00283             pipe is a no-no! If not overlapped, server only reads and client
00284             only writes */
00285          if (OVERLAPPED_IO)
00286             _beginthread(writer, 0, writer_params);
00287       } /* while */
00288       CloseHandle(ol.hEvent);
00289       CloseHandle(hPipe);
00290     free(saPipe.lpSecurityDescriptor);
00291    }
00292    else /* no '/s', assume it's a client */
00293    {
00294       char szTemp[64];
00295
00296       sprintf(szTemp, "Client %s", argv[2]);
00297       SetConsoleTitle(szTemp);
00298       bNotConnected = TRUE;
00299       while (bNotConnected)
00300       {
00301          /* attempt to connect to pipe instance */
00302          hPipe = CreateFile(szPname, GENERIC_READ | GENERIC_WRITE, 0, NULL,
00303                             OPEN_EXISTING, OVERLAPPED_IO ? FILE_FLAG_OVERLAPPED : 0, NULL);
00304          if (GetLastError() == ERROR_PIPE_BUSY)
00305          {
00306             puts("Pipe busy, waiting for a pipe instance...");
00307             bSuccess = WaitNamedPipe(szPname, NMPWAIT_USE_DEFAULT_WAIT);
00308             PERR(bSuccess, "WaitNamedPipe");
00309          }
00310          else
00311          {
00312             PERR(hPipe != INVALID_HANDLE_VALUE, "CreateFile");
00313             bNotConnected = (hPipe == INVALID_HANDLE_VALUE);
00314          }
00315       } /* while */
00316       puts("Connected to pipe...");
00317       if (OVERLAPPED_IO) /* if overlapped, start reader thread */
00318          _beginthread(reader, 0, hPipe);
00319       writer_params = malloc(sizeof(WRITER_PARAMS));
00320       writer_params->hPipe = hPipe;
00321       writer_params->szData = argv[2];
00322       writer_params->iDataSize = (int)strlen(argv[2]);
00323       writer(writer_params);
00324
00325    } /* else */
00326
00327    CloseHandle(hPipe);
00328    if (OVERLAPPED_IO) CloseHandle(ol.hEvent);
00329    return;
00330 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CConstraintDlg Member List

This is the complete list of members for CConstraintDlg, including all inherited members.
CConstraintDlg(CMainWindow *pCMainWindow) | CConstraintDlg |
CDialogLite(UINT uIDD=0) | CDialogLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateDlg(HWND hWndParent) | CDialogLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CRowsetViewerDlg(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CRowsetViewerDlg |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [static]
DoModal(HWND hWndParent) | CDialogLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
EndDialog(int nResult) | CDialogLite | [virtual]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetOptions() | CRowsetViewerDlg | [virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CDialogLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_comboConstraintType | CConstraintDlg |
m_comboDeleteRule | CConstraintDlg |
m_comboMatchType | CConstraintDlg |
m_comboUpdateRule | CConstraintDlg |
m_editBaseTableName | CConstraintDlg |
m_editColumnName | CConstraintDlg |
m_editConstraintName | CConstraintDlg |
m_editConstraintText | CConstraintDlg |
m_editFKColumnName | CConstraintDlg |
m_editReferencedTableName | CConstraintDlg |
m_fModal | CDialogLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_listColumnList | CConstraintDlg |
m_listDeferrability | CConstraintDlg |
m_listFKColumnList | CConstraintDlg |
m_nID | CWndLite |
m_pCMainWindow | CRowsetViewerDlg |
m_pCMDIChild | CRowsetViewerDlg |
m_pConsDesc | CConstraintDlg |
m_ppwszTableName | CConstraintDlg |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_uIDD | CDialogLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CDialogLite | [virtual]
OnCancel() | CDialogLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CConstraintDlg | [virtual]
CDialogLite::OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitDialog() | CConstraintDlg | [virtual]
CDialogLite::OnInitDialog() | CDialogLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnOK() | CConstraintDlg | [virtual]
CDialogLite::OnOK() | CDialogLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetConstraint(HWND hWndParent, DBCONSTRAINTDESC *pConsDesc) | CConstraintDlg | [inline]
SetConstraintAndTable(HWND hWndParent, DBCONSTRAINTDESC *pConsDesc, WCHAR **ppwszTableName) | CConstraintDlg |
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CConstraintDlg() | CConstraintDlg | [virtual]
~CDialogLite() | CDialogLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:55:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vj/mydatasource.java Source File

  • Dataaccess
  • osp
  • vj

mydatasource.java

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample OLEDB Simple Provider
00003 // (C) Copyright 1991-1999 Microsoft Corporation.  All Rights Reserved.
00004 //
00005 // module MyDataSource.java | msDataSourceObject implementation
00006 //
00007 //
00008
00009
00010 ////////////////////////////////////////////////////////
00011 // Imports
00012 //
00013 ////////////////////////////////////////////////////////
00014 import java.util.*;
00015 import com.ms.com.*;
00016 import com.ms.osp.*;
00017
00018
00019 ////////////////////////////////////////////////////////
00020 // MyDataSource
00021 //
00022 ////////////////////////////////////////////////////////
00023 /**
00024  * @com.register ( clsid=81C75D38-790A-11D2-8A61-0060088F441E, typelib=81C75D37-790A-11D2-8A61-0060088F441E )
00025  */
00026 class MyDataSource implements DataSource
00027 {
00028   // data
00029   String    m_sDataMember;  // Simple provider sample file name
00030   Vector    m_vListeners; // List of DataSourceListeners
00031   MyOSPObject m_rOSPObject; // Reference to the Simple Provider object
00032
00033   //constructors
00034   public MyDataSource()
00035   {
00036     // Reference a new simple provider object:
00037     m_sDataMember = new String("Unitialized Sample");
00038     m_vListeners = new Vector();
00039     m_rOSPObject = new MyOSPObject();
00040   }
00041
00042   /////////////////////////////////////////////////////////////////////////
00043   // DataSourceObject methods
00044   //
00045   /////////////////////////////////////////////////////////////////////////
00046
00047   public IUnknown getDataMember(String sDataMember, _Guid riid) throws ComException
00048   {
00049     if (sDataMember == null)
00050       throw new ComFailException();
00051
00052     // The DataMember string contains the file name.  Use it to prompt the
00053     // OSPObject to load its data.  Return the OSP Object:
00054     m_sDataMember = new String(sDataMember);
00055     m_rOSPObject.setFile(sDataMember);
00056     m_rOSPObject.loadData();
00057     return m_rOSPObject;
00058   }
00059
00060   public String getDataMemberName(int lIndex)
00061   {
00062     if (lIndex != 0)
00063       throw new ComFailException();
00064     return new String(m_sDataMember);
00065   }
00066
00067   public int getDataMemberCount()
00068   {
00069     // This sample DataSource has only one data member:
00070     return 1;
00071   }
00072
00073   public void addDataSourceListener(DataSourceListener rDataSourceListener) throws ComException
00074   {
00075     if (rDataSourceListener == null)
00076       throw new ComFailException();
00077
00078     // Add the listener:
00079     m_vListeners.addElement(rDataSourceListener);
00080   }
00081
00082   public void removeDataSourceListener(DataSourceListener rDataSourceListener) throws ComException
00083   {
00084     if (rDataSourceListener == null)
00085       throw new ComFailException();
00086
00087     // Find the Listener in the list and remove it:
00088     m_vListeners.removeElement(rDataSourceListener);
00089   }
00090
00091   public static void main(String args[])
00092   {
00093     // Test code:
00094     MyDataSource dso = new MyDataSource();
00095     MyOSPObject osp = (MyOSPObject)dso.getDataMember("C:\\Customer.txt", OLEDBSimpleProvider.iid);
00096     System.out.println("Data Member = " + dso.getDataMemberName(0) + ".");
00097     int cRows = osp.getRowCount();
00098     int cColumns = osp.getColumnCount();
00099     System.out.println("Row count = " + cRows + ".");
00100     System.out.println("Column count = " + cColumns + ".");
00101   }
00102 };
00103
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/land.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

land.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Land.h"
00021
00022 const GUID CLandBasedVehicle::thisGuid = { 0x2974380e, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CLandBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/About.Cpp Source File

  • Web
  • MSAgent
  • c
  • Cap

About.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 - 2000 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 #include "stdafx.h"
00045 #include "About.h"
00046 #include "resource.h"
00047 #include <malloc.h>
00048
00049
00050 AboutDlg::AboutDlg() {
00051
00052   m_hIcon = NULL;
00053 }
00054
00055
00056 AboutDlg::~AboutDlg() {
00057
00058 }
00059
00060
00061 void AboutDlg::DoModal(HWND hWndParent, short sAgentVersionMajor, short sAgentVersionMinor) {
00062
00063   HWND hWndFocus;
00064
00065   m_sAgentMajor = sAgentVersionMajor;
00066   m_sAgentMinor = sAgentVersionMinor;
00067
00068   hWndFocus = GetFocus();
00069
00070   DialogBoxParam(GetModuleHandle(NULL),
00071            MAKEINTRESOURCE(IDD_ABOUT),
00072            hWndParent,
00073            (DLGPROC)DlgProc,
00074            (long)this);
00075
00076   if (hWndFocus)
00077     SetFocus(hWndFocus);
00078 }
00079
00080
00081 BOOL AboutDlg::OnInitDialog() {
00082
00083   _TCHAR  szExe[_MAX_PATH];
00084   _TCHAR  szVersion[256];
00085   DWORD dwVersionSize;
00086   DWORD dwTemp;
00087   void   *pData;
00088   void   *pVerInfo;
00089   UINT  uVerInfoSize;
00090
00091   // Load the application icon
00092
00093   m_hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_APP));
00094
00095   GetWindowRect(GetDlgItem(m_hWnd, IDC_ICONPOS), &m_rcIcon);
00096   ScreenToClient(m_hWnd, (POINT *)&m_rcIcon);
00097
00098   GetModuleFileName(NULL, szExe, _MAX_PATH);
00099
00100   dwVersionSize = GetFileVersionInfoSize(szExe, &dwTemp);
00101
00102   // There better be version data
00103
00104   _ASSERT(dwVersionSize != 0);
00105
00106   __try {
00107     pData = _alloca(dwVersionSize);
00108   }
00109   __except(EXCEPTION_EXECUTE_HANDLER) {
00110     pData = NULL;
00111   }
00112
00113   if (pData) {
00114
00115     GetFileVersionInfo(szExe, 0, dwVersionSize, pData);
00116
00117     if (VerQueryValue(pData, _T("\\"), &pVerInfo, &uVerInfoSize)) {
00118       wsprintf(szVersion,
00119            _T("%d.%.2d.%d.%d"),
00120            HIWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionMS),
00121            LOWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionMS),
00122            HIWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionLS),
00123            LOWORD(((VS_FIXEDFILEINFO *)pVerInfo)->dwFileVersionLS));
00124       SetDlgItemText(m_hWnd, IDC_VERSION, szVersion);
00125     }
00126   }
00127
00128   // Microsoft Agent Version
00129
00130   wsprintf(szVersion, _T("%d.%.2d"), m_sAgentMajor, m_sAgentMinor);
00131   SetDlgItemText(m_hWnd, IDC_AGENTVERSION, szVersion);
00132
00133   return TRUE;
00134 }
00135
00136
00137 BOOL CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
00138
00139   AboutDlg *pDlg;
00140
00141   pDlg = (AboutDlg *)GetWindowLong(hWnd, GWLP_USERDATA);
00142
00143   switch (uMsg) {
00144     case WM_INITDIALOG:
00145       pDlg = (AboutDlg *)lParam;
00146       SetWindowLong(hWnd, GWLP_USERDATA, (long)pDlg);
00147       pDlg->m_hWnd = hWnd;
00148       return pDlg->OnInitDialog();
00149
00150
00151     case WM_COMMAND:
00152       if ((wParam == IDCANCEL) || (wParam == IDOK)) {
00153         EndDialog(hWnd, wParam);
00154         return TRUE;
00155       }
00156       break;
00157
00158
00159     case WM_SYSCOMMAND:
00160       if ((wParam & 0xFFF0) == SC_CLOSE) {
00161         EndDialog(hWnd, IDOK);
00162         return TRUE;
00163       }
00164       break;
00165
00166
00167     case WM_PAINT:
00168       PAINTSTRUCT ps;
00169       HBRUSH hbr;
00170
00171       BeginPaint(hWnd, &ps);
00172
00173       hbr = CreateSolidBrush(GetSysColor(COLOR_3DFACE));
00174
00175       DrawIconEx(ps.hdc,
00176              pDlg->m_rcIcon.left,
00177              pDlg->m_rcIcon.top,
00178              pDlg->m_hIcon,
00179              GetSystemMetrics(SM_CXICON),
00180              GetSystemMetrics(SM_CYICON),
00181              0,
00182              hbr,
00183              DI_NORMAL);
00184
00185       DeleteObject(hbr);
00186
00187       EndPaint(hWnd, &ps);
00188       break;
00189   }
00190
00191   return FALSE;
00192 }
00193
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SocketMonitor Member List

This is the complete list of members for SocketMonitor, including all inherited members.
__WSAFDIsSet(SOCKET s, FD_SET FAR *set, APIHook< int > &hook) | DTHandler | [protected, virtual]
accept(SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
bind(SOCKET s, const struct sockaddr FAR *name, int namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
closesocket(SOCKET s, APIHook< int > &hook) | DTHandler | [protected, virtual]
connect(SOCKET s, const struct sockaddr FAR *name, int namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
dispatch(int notificationCode, void *returnCode, char *LibraryName, bool preAPI, va_list vl) | DTHandler |
gethostbyaddr(const char FAR *addr, int len, int type, APIHook< HOSTENT > &hook) | DTHandler | [protected, virtual]
gethostbyname(const char FAR *name, APIHook< HOSTENT > &hook) | DTHandler | [protected, virtual]
gethostname(char FAR *name, int namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
getpeername(SOCKET s, struct sockaddr FAR *name, int FAR *namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
getprotobyname(const char FAR *name, APIHook< PROTOENT > &hook) | DTHandler | [protected, virtual]
getprotobynumber(int number, APIHook< PROTOENT > &hook) | DTHandler | [protected, virtual]
getservbyname(const char FAR *name, const char FAR *proto, APIHook< SERVENT > &hook) | DTHandler | [protected, virtual]
getservbyport(int port, const char FAR *proto, APIHook< SERVENT > &hook) | DTHandler | [protected, virtual]
getsockname(SOCKET s, struct sockaddr FAR *name, int FAR *namelen, APIHook< int > &hook) | DTHandler | [protected, virtual]
getsockopt(SOCKET s, int level, int optname, char FAR *optval, int FAR *optlen, APIHook< int > &hook) | DTHandler | [protected, virtual]
htonl(unsigned long hostlong, APIHook< unsigned long > &hook) | DTHandler | [protected, virtual]
htons(unsigned short hostshort, APIHook< unsigned short > &hook) | DTHandler | [protected, virtual]
inet_addr(const char FAR *cp, APIHook< unsigned long > &hook) | DTHandler | [protected, virtual]
inet_ntoa(struct in_addr in, APIHook< char FAR * > &hook) | DTHandler | [protected, virtual]
ioctlsocket(SOCKET s, long cmd, unsigned long FAR *argp, APIHook< int > &hook) | DTHandler | [protected, virtual]
listen(SOCKET s, int backlog, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPAddressToString(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPWSTR lpszAddressString, LPDWORD lpdwAddressStringLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPGetAddressByName(LPWSTR lpszServiceInstanceName, LPGUID lpServiceClassId, DWORD dwNameSpace, LPDWORD lpdwBufferLength, LPWSAQUERYSETW lpqsResults, DWORD dwResolution, LPWSTR lpszAliasBuffer, LPDWORD lpdwAliasBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPGetServiceClassInfo(IN LPGUID lpProviderId, IN OUT LPDWORD lpdwBufSize, IN OUT LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPGetServiceClassNameByClassId(LPGUID lpServiceClassId, LPWSTR lpszServiceClassName, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPInstallServiceClass(LPGUID lpProviderId, LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPLookupServiceBegin(LPGUID lpProviderId, LPWSAQUERYSETW lpqsRestrictions, LPWSASERVICECLASSINFOW lpServiceClassInfo, DWORD dwControlFlags, LPHANDLE lphLookup, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPLookupServiceEnd(HANDLE hLookup, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPLookupServiceNext(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSET lpqsResults, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPRemoveServiceClass(IN LPGUID lpProviderId, IN LPGUID lpServiceClassId, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPSetService(LPGUID lpProviderId, LPWSASERVICECLASSINFOW lpServiceClassInfo, LPWSAQUERYSETW lpqsRegInfo, WSAESETSERVICEOP essOperation, DWORD dwControlFlags, APIHook< int > &hook) | DTHandler | [protected, virtual]
NSPStringToAddress(LPWSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
ntohl(unsigned long netlong, APIHook< unsigned long > &hook) | DTHandler | [protected, virtual]
ntohs(unsigned short netshort, APIHook< unsigned short > &hook) | DTHandler | [protected, virtual]
recv(SOCKET s, char FAR *buf, int len, int flags, APIHook< int > &hook) | SocketMonitor | [protected, virtual]
recvfrom(SOCKET s, char FAR *buf, int len, int flags, struct sockaddr FAR *from, int FAR *fromlen, APIHook< int > &hook) | DTHandler | [protected, virtual]
select(int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, const struct timeval FAR *timeout, APIHook< int > &hook) | DTHandler | [protected, virtual]
send(SOCKET s, const char FAR *buf, int len, int flags, APIHook< int > &hook) | SocketMonitor | [protected, virtual]
sendto(SOCKET s, const char FAR *buf, int len, int flags, const struct sockaddr FAR *to, int tolen, APIHook< int > &hook) | DTHandler | [protected, virtual]
setsockopt(SOCKET s, int level, int optname, const char FAR *optval, int optlen, APIHook< int > &hook) | DTHandler | [protected, virtual]
shutdown(SOCKET s, int how, APIHook< int > &hook) | DTHandler | [protected, virtual]
socket(int af, int type, int protocol, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WPUCloseEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WPUCloseSocketHandle(SOCKET s, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUCreateEvent(LPINT lpErrno, APIHook< WSAEVENT > &hook) | DTHandler | [protected, virtual]
WPUCreateSocketHandle(DWORD dwCatalogEntryId, DWORD dwContext, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WPUFDIsSet(SOCKET s, FD_SET FAR *set, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUGetProviderPath(LPGUID lpProviderId, LPWSTR lpszProviderDllPath, LPINT lpProviderDllPathLen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUModifyIFSHandle(DWORD dwCatalogEntryId, SOCKET ProposedHandle, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WPUPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WPUQueryBlockingCallback(DWORD dwCatalogEntryId, LPBLOCKINGCALLBACK FAR *lplpfnCallback, LPDWORD lpdwContext, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUQuerySocketHandleContext(SOCKET s, LPDWORD lpContext, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUQueueApc(LPWSATHREADID lpThreadId, LPWSAUSERAPC lpfnUserApc, DWORD dwContext, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WPUResetEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WPUSetEvent(WSAEVENT hEvent, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WSAAccept(SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen, LPCONDITIONPROC lpfnCondition, unsigned long dwCallbackData, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSAAddressToStringA(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOA lpProtocolInfo, OUT LPTSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAAddressToStringW(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPTSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetHostByAddr(HWND hWnd, unsigned int wMsg, const char FAR *addr, int len, int type, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetHostByName(HWND hWnd, unsigned int wMsg, const char FAR *name, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetProtoByName(HWND hWnd, unsigned int wMsg, const char FAR *name, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetProtoByNumber(HWND hWnd, unsigned int wMsg, int number, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetServByName(HWND hWnd, unsigned int wMsg, const char FAR *name, const char FAR *proto, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncGetServByPort(HWND hWnd, unsigned int wMsg, int port, const char FAR *proto, char FAR *buf, int buflen, APIHook< HANDLE > &hook) | DTHandler | [protected, virtual]
WSAAsyncSelect(SOCKET s, HWND hWnd, unsigned int wMsg, long lEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACancelAsyncRequest(HANDLE hAsyncTaskHandle, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACancelBlockingCall(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACleanup(APIHook< int > &hook) | SocketMonitor | [protected, virtual]
WSACloseEvent(WSAEVENT hEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAConnect(SOCKET s, const struct sockaddr FAR *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSACreateEvent(APIHook< WSAEVENT > &hook) | DTHandler | [protected, virtual]
WSADuplicateSocketA(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOA lpProtocolInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSADuplicateSocketW(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOW lpProtocolInfo, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEnumNameSpaceProvidersA(IN OUT LPDWORD lpdwBufferLength, OUT LPWSANAMESPACE_INFOA lpnspBuffer, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAEnumNameSpaceProvidersW(IN OUT LPDWORD lpdwBufferLength, OUT LPWSANAMESPACE_INFOW lpnspBuffer, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEnumProtocolsA(LPINT lpiProtocols, LPWSAPROTOCOL_INFOA lpProtocolBuffer, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEnumProtocolsW(LPINT lpiProtocols, LPWSAPROTOCOL_INFOW lpProtocolBuffer, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetLastError(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetOverlappedResult(SOCKET s, LPWSAOVERLAPPED lpOverlapped, LPDWORD lpcbTransfer, BOOL fWait, unsigned long *lpdwFlags, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetQOSByName(SOCKET s, LPWSABUF lpQOSName, LPQOS lpQOS, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassInfoA(LPGUID lpProviderId, LPGUID lpServiceClassId, LPDWORD lpdwBufferLength, LPWSASERVICECLASSINFOA lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassInfoW(LPGUID lpProviderId, LPGUID lpServiceClassId, LPDWORD lpdwBufferLength, LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassNameByClassIdA(LPGUID lpServiceClassId, LPSTR lpszServiceClassName, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAGetServiceClassNameByClassIdW(LPGUID lpServiceClassId, LPWSTR lpszServiceClassName, LPDWORD lpdwBufferLength, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAHtonl(SOCKET s, unsigned long hostlong, unsigned long FAR *lpnetlong, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAHtons(SOCKET s, unsigned short hostshort, unsigned short FAR *lpnetshort, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAInstallServiceClassA(LPWSASERVICECLASSINFOA lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAInstallServiceClassW(LPWSASERVICECLASSINFOW lpServiceClassInfo, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAIsBlocking(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAJoinLeaf(SOCKET s, const struct sockaddr *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, DWORD dwFlags, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSALookupServiceBeginA(LPWSAQUERYSETA lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceBeginW(LPWSAQUERYSETW lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceEnd(HANDLE hLookup, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceNextA(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETA lpqsResults, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSALookupServiceNextW(HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETW lpqsResults, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSANtohl(SOCKET s, unsigned long netlong, unsigned long *lphostlong, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSANtohs(SOCKET s, unsigned short netshort, unsigned short *lphostshort, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARecvDisconnect(SOCKET s, LPWSABUF lpInboundDisconnectData, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARecvFrom(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, struct sockaddr *lpFrom, LPINT lpFromlen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSARemoveServiceClass(LPGUID lpServiceClassId, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAResetEvent(WSAEVENT hEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASend(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASendDisconnect(SOCKET s, LPWSABUF lpOutboundDisconnectData, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASendTo(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, const struct sockaddr *lpTo, int iTolen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASetBlockingHook(FARPROC lpBlockFunc, APIHook< FARPROC > &hook) | DTHandler | [protected, virtual]
WSASetEvent(WSAEVENT hEvent, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSASetLastError(int iError, APIHook< void > &hook) | DTHandler | [protected, virtual]
WSASetServiceA(LPWSAQUERYSETA lpqsRegInfo, WSAESETSERVICEOP essOperation, DWORD dwControlFlags, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSASetServiceW(LPWSAQUERYSETW lpqsRegInfo, WSAESETSERVICEOP essOperation, DWORD dwControlFlags, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSASocketA(int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocolInfo, GROUP g, DWORD dwFlags, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSASocketW(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData, APIHook< int > &hook) | SocketMonitor | [protected, virtual]
WSAStringToAddressA(LPTSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOA lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAStringToAddressW(LPTSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, APIHook< INT > &hook) | DTHandler | [protected, virtual]
WSAUnhookBlockingHook(APIHook< int > &hook) | DTHandler | [protected, virtual]
WSAWaitForMultipleEvents(DWORD cEvents, const WSAEVENT FAR *lphEvents, BOOL fWaitAll, DWORD dwTimeout, BOOL fAlertable, APIHook< DWORD > &hook) | DTHandler | [protected, virtual]
WSCDeinstallProvider(LPGUID lpProviderId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCEnableNSProvider(LPGUID lpProviderId, BOOL fEnable, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCEnumProtocols(LPINT lpiProtocols, LPWSAPROTOCOL_INFOW lpProtocolBuffer, LPDWORD lpdwBufferLength, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCGetProviderPath(LPGUID lpProviderId, LPWSTR lpszProviderDllPath, LPINT lpProviderDllPathLen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCInstallNameSpace(LPWSTR lpszIdentifier, LPWSTR lpszPathName, DWORD dwNameSpace, DWORD dwVersion, LPGUID lpProviderId, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCInstallProvider(const LPGUID lpProviderId, const LPWSTR lpszProviderDllPath, const LPWSAPROTOCOL_INFOW lpProtocolInfoList, DWORD dwNumberOfEntries, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSCUnInstallNameSpace(LPGUID lpProviderId, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPAccept(SOCKET s, struct sockaddr FAR *addr, LPINT addrlen, LPCONDITIONPROC lpfnCondition, DWORD dwCallbackData, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSPAddressToString(LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPWSTR lpszAddressString, LPDWORD lpdwAddressStringLength, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPAsyncSelect(SOCKET s, HWND hWnd, unsigned int wMsg, long lEvent, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPBind(SOCKET s, const struct sockaddr FAR *name, int namelen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPCancelBlockingCall(LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPCleanup(LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPCloseSocket(SOCKET s, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPConnect(SOCKET s, const struct sockaddr FAR *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPDuplicateSocket(SOCKET s, DWORD dwProcessId, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPGetOverlappedResult(SOCKET s, LPWSAOVERLAPPED lpOverlapped, LPDWORD lpcbTransfer, BOOL fWait, LPDWORD lpdwFlags, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WSPGetPeerName(SOCKET s, struct sockaddr FAR *name, LPINT namelen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPGetQOSByName(SOCKET s, LPWSABUF lpQOSName, LPQOS lpQOS, LPINT lpErrno, APIHook< BOOL > &hook) | DTHandler | [protected, virtual]
WSPGetSockName(SOCKET s, struct sockaddr FAR *name, LPINT namelen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPGetSockOpt(SOCKET s, int level, int optname, char FAR *optval, LPINT optlen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPJoinLeaf(SOCKET s, const struct sockaddr FAR *name, int namelen, LPWSABUF lpCallerData, LPWSABUF lpCalleeData, LPQOS lpSQOS, LPQOS lpGQOS, DWORD dwFlags, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSPListen(SOCKET s, int backlog, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPRecv(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPRecvDisconnect(SOCKET s, LPWSABUF lpInboundDisconnectData, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPRecvFrom(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, struct sockaddr FAR *lpFrom, LPINT lpFromlen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSelect(int nfds, fd_set FAR *readfds, fd_set FAR *writefds, fd_set FAR *exceptfds, const struct timeval FAR *timeout, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSend(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSendDisconnect(SOCKET s, LPWSABUF lpOutboundDisconnectData, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSendTo(SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesSent, DWORD dwFlags, const struct sockaddr FAR *lpTo, int iTolen, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, LPWSATHREADID lpThreadId, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSetSockOpt(SOCKET s, int level, int optname, const char FAR *optval, int optlen, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPShutdown(SOCKET s, int how, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPSocket(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags, LPINT lpErrno, APIHook< SOCKET > &hook) | DTHandler | [protected, virtual]
WSPStartup(WORD wVersionRequested, LPWSPDATA lpWSPData, LPWSAPROTOCOL_INFOW lpProtocolInfo, WSPUPCALLTABLE UpcallTable, LPWSPPROC_TABLE lpProcTable, APIHook< int > &hook) | DTHandler | [protected, virtual]
WSPStringToAddress(LPWSTR AddressString, INT AddressFamily, LPWSAPROTOCOL_INFOW lpProtocolInfo, LPSOCKADDR lpAddress, LPINT lpAddressLength, LPINT lpErrno, APIHook< int > &hook) | DTHandler | [protected, virtual]
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/Dibutil.c Source File

  • Multimedia
  • Gdi
  • WinCap32

Dibutil.c

Go to the documentation of this file.
00001 //**********************************************************************
00002 //
00003 //  dibutil.c
00004 //
00005 //  Source file for Device-Independent Bitmap (DIB) API.  Provides
00006 //  the following functions:
00007 //
00008 //  CreateDIB()         - Creates new DIB
00009 //  FindDIBBits()       - Sets pointer to the DIB bits
00010 //  DIBWidth()          - Gets the width of the DIB
00011 //  DIBHeight()         - Gets the height of the DIB
00012 //  PaletteSize()       - Calculates the buffer size required by a palette
00013 //  DIBNumColors()      - Calculates number of colors in the DIB's color table
00014 //  CreateDIBPalette()  - Creates a palette from a DIB
00015 //  DIBToBitmap()       - Creates a bitmap from a DIB
00016 //  BitmapToDIB()       - Creates a DIB from a bitmap
00017 //  PalEntriesOnDevice()- Gets the number of palette entries of a device
00018 //  GetSystemPalette()  - Returns a handle to the current system palette
00019 //  AllocRoomForDIB()   - Allocates memory for a DIB
00020 //  ChangeDIBFormat()   - Changes a DIB's BPP and/or compression format
00021 //  ChangeBitmapFormat()- Changes a bitmap to a DIB with specified BPP and
00022 //                        compression format
00023 //
00024 // Written by Microsoft Product Support Services, Developer Support.
00025 // Copyright 1991 - 2000 Microsoft Corporation. All rights reserved.
00026 //**********************************************************************
00027
00028 #define     STRICT      // enable strict type checking
00029
00030 #include <windows.h>
00031 #include <assert.h>
00032 #include "dibapi.h"
00033 #include "dibutil.h"
00034 #include <stdio.h>
00035
00036
00037 /*************************************************************************
00038  *
00039  * CreateDIB()
00040  *
00041  * Parameters:
00042  *
00043  * DWORD dwWidth    - Width for new bitmap, in pixels
00044  * DWORD dwHeight   - Height for new bitmap
00045  * WORD  wBitCount  - Bit Count for new DIB (1, 4, 8, or 24)
00046  *
00047  * Return Value:
00048  *
00049  * HDIB             - Handle to new DIB
00050  *
00051  * Description:
00052  *
00053  * This function allocates memory for and initializes a new DIB by
00054  * filling in the BITMAPINFOHEADER, allocating memory for the color
00055  * table, and allocating memory for the bitmap bits.  As with all
00056  * HDIBs, the header, colortable and bits are all in one contiguous
00057  * memory block.  This function is similar to the CreateBitmap()
00058  * Windows API.
00059  *
00060  * The colortable and bitmap bits are left uninitialized (zeroed) in the
00061  * returned HDIB.
00062  *
00063  *
00064  ************************************************************************/
00065
00066 HDIB CreateDIB(DWORD dwWidth, DWORD dwHeight, WORD wBitCount)
00067 {
00068     BITMAPINFOHEADER    bi;             // bitmap header
00069     LPBITMAPINFOHEADER  lpbi;           // pointer to BITMAPINFOHEADER
00070     DWORD               dwLen;          // size of memory block
00071     HDIB                hDIB;
00072     DWORD               dwBytesPerLine; // Number of bytes per scanline
00073
00074
00075     // Make sure bits per pixel is valid
00076
00077     if (wBitCount <= 1)
00078         wBitCount = 1;
00079     else if (wBitCount <= 4)
00080         wBitCount = 4;
00081     else if (wBitCount <= 8)
00082         wBitCount = 8;
00083     else if (wBitCount <= 24)
00084         wBitCount = 24;
00085   else if (wBitCount <= 32)
00086     wBitCount = 32;
00087     else
00088         wBitCount = 4;  // set default value to 4 if parameter is bogus
00089
00090     // initialize BITMAPINFOHEADER
00091
00092     bi.biSize = sizeof(BITMAPINFOHEADER);
00093     bi.biWidth = dwWidth;         // fill in width from parameter
00094     bi.biHeight = dwHeight;       // fill in height from parameter
00095     bi.biPlanes = 1;              // must be 1
00096     bi.biBitCount = wBitCount;    // from parameter
00097     bi.biCompression = BI_RGB;
00098     bi.biSizeImage = 0;           // 0's here mean "default"
00099     bi.biXPelsPerMeter = 0;
00100     bi.biYPelsPerMeter = 0;
00101     bi.biClrUsed = 0;
00102     bi.biClrImportant = 0;
00103
00104     // calculate size of memory block required to store the DIB.  This
00105     // block should be big enough to hold the BITMAPINFOHEADER, the color
00106     // table, and the bits
00107
00108     dwBytesPerLine = WIDTHBYTES(wBitCount * dwWidth);
00109     dwLen = bi.biSize + PaletteSize((LPSTR)&bi) + (dwBytesPerLine * dwHeight);
00110
00111     // alloc memory block to store our bitmap
00112
00113     hDIB = GlobalAlloc(GHND, dwLen);
00114
00115     // major bummer if we couldn't get memory block
00116
00117     if (!hDIB)
00118         return NULL;
00119
00120     // lock memory and get pointer to it
00121
00122     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00123
00124     // use our bitmap info structure to fill in first part of
00125     // our DIB with the BITMAPINFOHEADER
00126
00127     *lpbi = bi;
00128
00129     // Since we don't know what the colortable and bits should contain,
00130     // just leave these blank.  Unlock the DIB and return the HDIB.
00131
00132     GlobalUnlock(hDIB);
00133
00134     //return handle to the DIB
00135
00136     return hDIB;
00137 }
00138
00139
00140 /*************************************************************************
00141  *
00142  * FindDIBBits()
00143  *
00144  * Parameter:
00145  *
00146  * LPSTR lpDIB      - pointer to packed-DIB memory block
00147  *
00148  * Return Value:
00149  *
00150  * LPSTR            - pointer to the DIB bits
00151  *
00152  * Description:
00153  *
00154  * This function calculates the address of the DIB's bits and returns a
00155  * pointer to the DIB bits.
00156  *
00157  ************************************************************************/
00158
00159 LPSTR FindDIBBits(LPSTR lpDIB)
00160 {
00161   return (lpDIB != NULL ? (lpDIB + *(LPDWORD)lpDIB + PaletteSize(lpDIB)) :  NULL );
00162 }
00163
00164
00165 /*************************************************************************
00166  *
00167  * DIBWidth()
00168  *
00169  * Parameter:
00170  *
00171  * LPSTR lpDIB      - pointer to packed-DIB memory block
00172  *
00173  * Return Value:
00174  *
00175  * DWORD            - width of the DIB
00176  *
00177  * Description:
00178  *
00179  * This function gets the width of the DIB from the BITMAPINFOHEADER
00180  * width field if it is a Windows 3.0-style DIB or from the BITMAPCOREHEADER
00181  * width field if it is an OS/2-style DIB.
00182  *
00183  ************************************************************************/
00184
00185
00186 DWORD DIBWidth(LPSTR lpDIB)
00187 {
00188     LPBITMAPINFOHEADER   lpbmi;  // pointer to a Win 3.0-style DIB
00189     LPBITMAPCOREHEADER   lpbmc;  // pointer to an OS/2-style DIB
00190
00191   if (!lpDIB)
00192     return 0;
00193
00194     // point to the header (whether Win 3.0 and OS/2)
00195
00196     lpbmi = (LPBITMAPINFOHEADER)lpDIB;
00197     lpbmc = (LPBITMAPCOREHEADER)lpDIB;
00198
00199     // return the DIB width if it is a Win 3.0 DIB
00200
00201     if (lpbmi->biSize == sizeof(BITMAPINFOHEADER))
00202         return lpbmi->biWidth;
00203     else  // it is an OS/2 DIB, so return its width
00204         return (DWORD)lpbmc->bcWidth;
00205 }
00206
00207
00208 /*************************************************************************
00209  *
00210  * DIBHeight()
00211  *
00212  * Parameter:
00213  *
00214  * LPSTR lpDIB      - pointer to packed-DIB memory block
00215  *
00216  * Return Value:
00217  *
00218  * DWORD            - height of the DIB
00219  *
00220  * Description:
00221  *
00222  * This function gets the height of the DIB from the BITMAPINFOHEADER
00223  * height field if it is a Windows 3.0-style DIB or from the BITMAPCOREHEADER
00224  * height field if it is an OS/2-style DIB.
00225  *
00226  ************************************************************************/
00227
00228 DWORD DIBHeight(LPSTR lpDIB)
00229 {
00230    LPBITMAPINFOHEADER   lpbmi;  // pointer to a Win 3.0-style DIB
00231    LPBITMAPCOREHEADER   lpbmc;  // pointer to an OS/2-style DIB
00232
00233    if (!lpDIB)
00234      return 0;
00235
00236    // point to the header (whether OS/2 or Win 3.0
00237
00238    lpbmi = (LPBITMAPINFOHEADER)lpDIB;
00239    lpbmc = (LPBITMAPCOREHEADER)lpDIB;
00240
00241     // return the DIB height if it is a Win 3.0 DIB
00242     if (lpbmi->biSize == sizeof(BITMAPINFOHEADER))
00243         return lpbmi->biHeight;
00244     else  // it is an OS/2 DIB, so return its height
00245         return (DWORD)lpbmc->bcHeight;
00246 }
00247
00248
00249 /*************************************************************************
00250  *
00251  * PaletteSize()
00252  *
00253  * Parameter:
00254  *
00255  * LPSTR lpDIB      - pointer to packed-DIB memory block
00256  *
00257  * Return Value:
00258  *
00259  * WORD             - size of the color palette of the DIB
00260  *
00261  * Description:
00262  *
00263  * This function gets the size required to store the DIB's palette by
00264  * multiplying the number of colors by the size of an RGBQUAD (for a
00265  * Windows 3.0-style DIB) or by the size of an RGBTRIPLE (for an OS/2-
00266  * style DIB).
00267  *
00268  ************************************************************************/
00269
00270 WORD PaletteSize(LPSTR lpDIB)
00271 {
00272   if (!lpDIB)
00273     return (WORD) 0;
00274
00275     // calculate the size required by the palette
00276     if (IS_WIN30_DIB (lpDIB))
00277         return (DIBNumColors(lpDIB) * sizeof(RGBQUAD));
00278     else
00279         return (DIBNumColors(lpDIB) * sizeof(RGBTRIPLE));
00280 }
00281
00282
00283 /*************************************************************************
00284  *
00285  * DIBNumColors()
00286  *
00287  * Parameter:
00288  *
00289  * LPSTR lpDIB      - pointer to packed-DIB memory block
00290  *
00291  * Return Value:
00292  *
00293  * WORD             - number of colors in the color table
00294  *
00295  * Description:
00296  *
00297  * This function calculates the number of colors in the DIB's color table
00298  * by finding the bits per pixel for the DIB (whether Win3.0 or OS/2-style
00299  * DIB). If bits per pixel is 1: colors=2, if 4: colors=16, if 8: colors=256,
00300  * if 24, no colors in color table.
00301  *
00302  ************************************************************************/
00303
00304 WORD DIBNumColors(LPSTR lpDIB)
00305 {
00306     WORD wBitCount;  // DIB bit count
00307
00308   if (!lpDIB)
00309     return (WORD) 0;
00310
00311     // If this is a Windows-style DIB, the number of colors in the
00312     // color table can be less than the number of bits per pixel
00313     // allows for (i.e. lpbi->biClrUsed can be set to some value).
00314     // If this is the case, return the appropriate value.
00315
00316
00317     if (IS_WIN30_DIB(lpDIB))
00318     {
00319         DWORD dwClrUsed;
00320
00321         dwClrUsed = ((LPBITMAPINFOHEADER)lpDIB)->biClrUsed;
00322         if (dwClrUsed)
00323
00324         return (WORD)dwClrUsed;
00325     }
00326
00327     // Calculate the number of colors in the color table based on
00328     // the number of bits per pixel for the DIB.
00329
00330     if (IS_WIN30_DIB(lpDIB))
00331         wBitCount = ((LPBITMAPINFOHEADER)lpDIB)->biBitCount;
00332     else
00333         wBitCount = ((LPBITMAPCOREHEADER)lpDIB)->bcBitCount;
00334
00335     // return number of colors based on bits per pixel
00336
00337     switch (wBitCount)
00338     {
00339         case 1:
00340             return 2;
00341
00342         case 4:
00343             return 16;
00344
00345         case 8:
00346             return 256;
00347
00348         default:
00349             return 0;
00350     }
00351 }
00352
00353
00354 /*************************************************************************
00355  *
00356  * CreateDIBPalette()
00357  *
00358  * Parameter:
00359  *
00360  * HDIB hDIB        - specifies the DIB
00361  *
00362  * Return Value:
00363  *
00364  * HPALETTE         - specifies the palette
00365  *
00366  * Description:
00367  *
00368  * This function creates a palette from a DIB by allocating memory for the
00369  * logical palette, reading and storing the colors from the DIB's color table
00370  * into the logical palette, creating a palette from this logical palette,
00371  * and then returning the palette's handle. This allows the DIB to be
00372  * displayed using the best possible colors (important for DIBs with 256 or
00373  * more colors).
00374  *
00375  ************************************************************************/
00376
00377 HPALETTE CreateDIBPalette(HDIB hDIB)
00378 {
00379     LPLOGPALETTE        lpPal;          // pointer to a logical palette
00380     HANDLE              hLogPal;        // handle to a logical palette
00381     HPALETTE            hPal = NULL;    // handle to a palette
00382     int                 i, wNumColors;  // loop index, number of colors in color table
00383     LPSTR               lpbi;           // pointer to packed-DIB
00384     LPBITMAPINFO        lpbmi;          // pointer to BITMAPINFO structure (Win3.0)
00385     LPBITMAPCOREINFO    lpbmc;          // pointer to BITMAPCOREINFO structure (OS/2)
00386     BOOL                bWinStyleDIB;   // Win3.0 DIB?
00387
00388     // if handle to DIB is invalid, return NULL
00389
00390     if (!hDIB)
00391         return NULL;
00392
00393     // lock DIB memory block and get a pointer to it
00394
00395     lpbi = GlobalLock(hDIB);
00396
00397     // get pointer to BITMAPINFO (Win 3.0)
00398
00399     lpbmi = (LPBITMAPINFO)lpbi;
00400
00401     // get pointer to BITMAPCOREINFO (OS/2 1.x)
00402
00403     lpbmc = (LPBITMAPCOREINFO)lpbi;
00404
00405     // get the number of colors in the DIB
00406
00407     wNumColors = DIBNumColors(lpbi);
00408
00409     // is this a Win 3.0 DIB?
00410
00411     bWinStyleDIB = IS_WIN30_DIB(lpbi);
00412     if (wNumColors)
00413     {
00414         // allocate memory block for logical palette
00415
00416         hLogPal = GlobalAlloc(GHND, sizeof(LOGPALETTE) +
00417                 sizeof(PALETTEENTRY) * wNumColors);
00418
00419         // if not enough memory, clean up and return NULL
00420
00421         if (!hLogPal)
00422         {
00423             GlobalUnlock(hDIB);
00424             return NULL;
00425         }
00426
00427         // lock memory block and get pointer to it
00428
00429         lpPal = (LPLOGPALETTE)GlobalLock(hLogPal);
00430
00431         // set version and number of palette entries
00432
00433         lpPal->palVersion = PALVERSION;
00434         lpPal->palNumEntries = (WORD) wNumColors;
00435
00436         // store RGB triples (if Win 3.0 DIB) or RGB quads (if OS/2 DIB)
00437         // into palette
00438
00439         for (i = 0; i < wNumColors; i++)
00440         {
00441             if (bWinStyleDIB)
00442             {
00443                 lpPal->palPalEntry[i].peRed = lpbmi->bmiColors[i].rgbRed;
00444                 lpPal->palPalEntry[i].peGreen = lpbmi->bmiColors[i].rgbGreen;
00445                 lpPal->palPalEntry[i].peBlue = lpbmi->bmiColors[i].rgbBlue;
00446                 lpPal->palPalEntry[i].peFlags = 0;
00447             }
00448             else
00449             {
00450                 lpPal->palPalEntry[i].peRed = lpbmc->bmciColors[i].rgbtRed;
00451                 lpPal->palPalEntry[i].peGreen = lpbmc->bmciColors[i].rgbtGreen;
00452                 lpPal->palPalEntry[i].peBlue = lpbmc->bmciColors[i].rgbtBlue;
00453                 lpPal->palPalEntry[i].peFlags = 0;
00454             }
00455         }
00456
00457         // create the palette and get handle to it
00458
00459         hPal = CreatePalette(lpPal);
00460
00461         // if error getting handle to palette, clean up and return NULL
00462
00463         if (!hPal)
00464         {
00465             GlobalUnlock(hLogPal);
00466             GlobalFree(hLogPal);
00467             return NULL;
00468         }
00469     }
00470
00471     // clean up
00472
00473     GlobalUnlock(hLogPal);
00474     GlobalFree(hLogPal);
00475     GlobalUnlock(hDIB);
00476
00477     // return handle to DIB's palette
00478     return hPal;
00479 }
00480
00481
00482 /*************************************************************************
00483  *
00484  * DIBToBitmap()
00485  *
00486  * Parameters:
00487  *
00488  * HDIB hDIB        - specifies the DIB to convert
00489  *
00490  * HPALETTE hPal    - specifies the palette to use with the bitmap
00491  *
00492  * Return Value:
00493  *
00494  * HBITMAP          - identifies the device-dependent bitmap
00495  *
00496  * Description:
00497  *
00498  * This function creates a bitmap from a DIB using the specified palette.
00499  * If no palette is specified, default is used.
00500  *
00501  * NOTE:
00502  *
00503  * The bitmap returned from this funciton is always a bitmap compatible
00504  * with the screen (e.g. same bits/pixel and color planes) rather than
00505  * a bitmap with the same attributes as the DIB.  This behavior is by
00506  * design, and occurs because this function calls CreateDIBitmap to
00507  * do its work, and CreateDIBitmap always creates a bitmap compatible
00508  * with the hDC parameter passed in (because it in turn calls
00509  * CreateCompatibleBitmap).
00510  *
00511  * So for instance, if your DIB is a monochrome DIB and you call this
00512  * function, you will not get back a monochrome HBITMAP -- you will
00513  * get an HBITMAP compatible with the screen DC, but with only 2
00514  * colors used in the bitmap.
00515  *
00516  * If your application requires a monochrome HBITMAP returned for a
00517  * monochrome DIB, use the function SetDIBits().
00518  *
00519  * Also, the DIBpassed in to the function is not destroyed on exit. This
00520  * must be done later, once it is no longer needed.
00521  *
00522  ************************************************************************/
00523
00524 HBITMAP DIBToBitmap(HDIB hDIB, HPALETTE hPal)
00525 {
00526     LPSTR       lpDIBHdr, lpDIBBits;  // pointer to DIB header, pointer to DIB bits
00527     HBITMAP     hBitmap;            // handle to device-dependent bitmap
00528     HDC         hDC;                    // handle to DC
00529     HPALETTE    hOldPal = NULL;    // handle to a palette
00530
00531     // if invalid handle, return NULL
00532
00533     if (!hDIB)
00534         return NULL;
00535
00536     // lock memory block and get a pointer to it
00537
00538     lpDIBHdr = GlobalLock(hDIB);
00539
00540     // get a pointer to the DIB bits
00541
00542     lpDIBBits = FindDIBBits(lpDIBHdr);
00543
00544   if (!lpDIBBits)
00545   {
00546      GlobalUnlock(hDIB);
00547         return NULL;
00548     }
00549
00550     // get a DC
00551
00552     hDC = GetDC(NULL);
00553     if (!hDC)
00554     {
00555         // clean up and return NULL
00556
00557         GlobalUnlock(hDIB);
00558         return NULL;
00559     }
00560
00561     // select and realize palette
00562
00563     if (hPal)
00564         hOldPal = SelectPalette(hDC, hPal, FALSE);
00565
00566     RealizePalette(hDC);
00567
00568     // create bitmap from DIB info. and bits
00569     hBitmap = CreateDIBitmap(hDC, (LPBITMAPINFOHEADER)lpDIBHdr, CBM_INIT,
00570             lpDIBBits, (LPBITMAPINFO)lpDIBHdr, DIB_RGB_COLORS);
00571
00572     // restore previous palette
00573     if (hOldPal)
00574         SelectPalette(hDC, hOldPal, FALSE);
00575
00576     // clean up
00577     ReleaseDC(NULL, hDC);
00578     GlobalUnlock(hDIB);
00579
00580     // return handle to the bitmap
00581     return hBitmap;
00582 }
00583
00584
00585 /*************************************************************************
00586  *
00587  * BitmapToDIB()
00588  *
00589  * Parameters:
00590  *
00591  * HBITMAP hBitmap  - specifies the bitmap to convert
00592  *
00593  * HPALETTE hPal    - specifies the palette to use with the bitmap
00594  *
00595  * Return Value:
00596  *
00597  * HDIB             - identifies the device-dependent bitmap
00598  *
00599  * Description:
00600  *
00601  * This function creates a DIB from a bitmap using the specified palette.
00602  *
00603  ************************************************************************/
00604
00605 HDIB BitmapToDIB(HBITMAP hBitmap, HPALETTE hPal)
00606 {
00607     BITMAP              bm;         // bitmap structure
00608     BITMAPINFOHEADER    bi;         // bitmap header
00609     LPBITMAPINFOHEADER  lpbi;       // pointer to BITMAPINFOHEADER
00610     DWORD               dwLen;      // size of memory block
00611     HANDLE              hDIB, h;    // handle to DIB, temp handle
00612     HDC                 hDC;        // handle to DC
00613     WORD                biBits;     // bits per pixel
00614
00615     // check if bitmap handle is valid
00616
00617     if (!hBitmap)
00618         return NULL;
00619
00620     // fill in BITMAP structure, return NULL if it didn't work
00621
00622     if (!GetObject(hBitmap, sizeof(bm), (LPSTR)&bm))
00623         return NULL;
00624
00625     // if no palette is specified, use default palette
00626
00627     if (hPal == NULL)
00628         hPal = GetStockObject(DEFAULT_PALETTE);
00629
00630     // calculate bits per pixel
00631
00632     biBits = bm.bmPlanes * bm.bmBitsPixel;
00633
00634     // make sure bits per pixel is valid
00635
00636     if (biBits <= 1)
00637         biBits = 1;
00638     else if (biBits <= 4)
00639         biBits = 4;
00640     else if (biBits <= 8)
00641         biBits = 8;
00642     else // if greater than 8-bit, force to 24-bit
00643         biBits = 24;
00644
00645     // initialize BITMAPINFOHEADER
00646
00647     bi.biSize = sizeof(BITMAPINFOHEADER);
00648     bi.biWidth = bm.bmWidth;
00649     bi.biHeight = bm.bmHeight;
00650     bi.biPlanes = 1;
00651     bi.biBitCount = biBits;
00652     bi.biCompression = BI_RGB;
00653     bi.biSizeImage = 0;
00654     bi.biXPelsPerMeter = 0;
00655     bi.biYPelsPerMeter = 0;
00656     bi.biClrUsed = 0;
00657     bi.biClrImportant = 0;
00658
00659     // calculate size of memory block required to store BITMAPINFO
00660
00661     dwLen = bi.biSize + PaletteSize((LPSTR)&bi);
00662
00663     // get a DC
00664
00665     hDC = GetDC(NULL);
00666
00667     // select and realize our palette
00668
00669     hPal = SelectPalette(hDC, hPal, FALSE);
00670     RealizePalette(hDC);
00671
00672     // alloc memory block to store our bitmap
00673
00674     hDIB = GlobalAlloc(GHND, dwLen);
00675
00676     // if we couldn't get memory block
00677
00678     if (!hDIB)
00679     {
00680       // clean up and return NULL
00681
00682       SelectPalette(hDC, hPal, TRUE);
00683       RealizePalette(hDC);
00684       ReleaseDC(NULL, hDC);
00685       return NULL;
00686     }
00687
00688     // lock memory and get pointer to it
00689
00690     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00691
00692     /// use our bitmap info. to fill BITMAPINFOHEADER
00693
00694     *lpbi = bi;
00695
00696     // call GetDIBits with a NULL lpBits param, so it will calculate the
00697     // biSizeImage field for us
00698
00699     GetDIBits(hDC, hBitmap, 0, (UINT)bi.biHeight, NULL, (LPBITMAPINFO)lpbi,
00700         DIB_RGB_COLORS);
00701
00702     // get the info. returned by GetDIBits and unlock memory block
00703
00704     bi = *lpbi;
00705     GlobalUnlock(hDIB);
00706
00707     // if the driver did not fill in the biSizeImage field, make one up
00708     if (bi.biSizeImage == 0)
00709         bi.biSizeImage = WIDTHBYTES((DWORD)bm.bmWidth * biBits) * bm.bmHeight;
00710
00711     // realloc the buffer big enough to hold all the bits
00712
00713     dwLen = bi.biSize + PaletteSize((LPSTR)&bi) + bi.biSizeImage;
00714
00715     if (h = GlobalReAlloc(hDIB, dwLen, 0))
00716         hDIB = h;
00717     else
00718     {
00719         // clean up and return NULL
00720
00721         GlobalFree(hDIB);
00722         hDIB = NULL;
00723         SelectPalette(hDC, hPal, TRUE);
00724         RealizePalette(hDC);
00725         ReleaseDC(NULL, hDC);
00726         return NULL;
00727     }
00728
00729     // lock memory block and get pointer to it */
00730
00731     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00732
00733     // call GetDIBits with a NON-NULL lpBits param, and actualy get the
00734     // bits this time
00735
00736     if (GetDIBits(hDC, hBitmap, 0, (UINT)bi.biHeight, (LPSTR)lpbi +
00737             (WORD)lpbi->biSize + PaletteSize((LPSTR)lpbi), (LPBITMAPINFO)lpbi,
00738             DIB_RGB_COLORS) == 0)
00739     {
00740         // clean up and return NULL
00741
00742         GlobalUnlock(hDIB);
00743         hDIB = NULL;
00744         SelectPalette(hDC, hPal, TRUE);
00745         RealizePalette(hDC);
00746         ReleaseDC(NULL, hDC);
00747         return NULL;
00748     }
00749
00750     bi = *lpbi;
00751
00752     // clean up
00753     GlobalUnlock(hDIB);
00754     SelectPalette(hDC, hPal, TRUE);
00755     RealizePalette(hDC);
00756     ReleaseDC(NULL, hDC);
00757
00758     // return handle to the DIB
00759     return hDIB;
00760 }
00761
00762
00763 /*************************************************************************
00764  *
00765  * PalEntriesOnDevice()
00766  *
00767  * Parameter:
00768  *
00769  * HDC hDC          - device context
00770  *
00771  * Return Value:
00772  *
00773  * int              - number of palette entries on device
00774  *
00775  * Description:
00776  *
00777  * This function gets the number of palette entries on the specified device
00778  *
00779  ************************************************************************/
00780
00781 int PalEntriesOnDevice(HDC hDC)
00782 {
00783     int nColors;  // number of colors
00784
00785     // Find out the number of colors on this device.
00786
00787     nColors = (1 << (GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES)));
00788
00789     assert(nColors);
00790     return nColors;
00791 }
00792
00793
00794 /*************************************************************************
00795  *
00796  * GetSystemPalette()
00797  *
00798  * Parameters:
00799  *
00800  * None
00801  *
00802  * Return Value:
00803  *
00804  * HPALETTE         - handle to a copy of the current system palette
00805  *
00806  * Description:
00807  *
00808  * This function returns a handle to a palette which represents the system
00809  * palette.  The system RGB values are copied into our logical palette using
00810  * the GetSystemPaletteEntries function.
00811  *
00812  ************************************************************************/
00813
00814 HPALETTE GetSystemPalette(void)
00815 {
00816     HDC hDC;                // handle to a DC
00817     static HPALETTE hPal = NULL;   // handle to a palette
00818     HANDLE hLogPal;         // handle to a logical palette
00819     LPLOGPALETTE lpLogPal;  // pointer to a logical palette
00820     int nColors;            // number of colors
00821
00822     // Find out how many palette entries we want.
00823
00824     hDC = GetDC(NULL);
00825
00826     if (!hDC)
00827         return NULL;
00828
00829     nColors = PalEntriesOnDevice(hDC);   // Number of palette entries
00830
00831     // Allocate room for the palette and lock it.
00832
00833     hLogPal = GlobalAlloc(GHND, sizeof(LOGPALETTE) + nColors *
00834             sizeof(PALETTEENTRY));
00835
00836     // if we didn't get a logical palette, return NULL
00837
00838     if (!hLogPal)
00839         return NULL;
00840
00841     // get a pointer to the logical palette
00842
00843     lpLogPal = (LPLOGPALETTE)GlobalLock(hLogPal);
00844
00845     // set some important fields
00846
00847     lpLogPal->palVersion = PALVERSION;
00848     lpLogPal->palNumEntries = (WORD) nColors;
00849
00850     // Copy the current system palette into our logical palette
00851
00852     GetSystemPaletteEntries(hDC, 0, nColors,
00853             (LPPALETTEENTRY)(lpLogPal->palPalEntry));
00854
00855     // Go ahead and create the palette.  Once it's created,
00856     // we no longer need the LOGPALETTE, so free it.
00857
00858     hPal = CreatePalette(lpLogPal);
00859
00860     // clean up
00861
00862     GlobalUnlock(hLogPal);
00863     GlobalFree(hLogPal);
00864     ReleaseDC(NULL, hDC);
00865
00866     return hPal;
00867 }
00868
00869
00870 /*************************************************************************
00871  *
00872  * AllocRoomForDIB()
00873  *
00874  * Parameters:
00875  *
00876  * BITMAPINFOHEADER - bitmap info header stucture
00877  *
00878  * HBITMAP          - handle to the bitmap
00879  *
00880  * Return Value:
00881  *
00882  * HDIB             - handle to memory block
00883  *
00884  * Description:
00885  *
00886  *  This routine takes a BITMAPINOHEADER, and returns a handle to global
00887  *  memory which can contain a DIB with that header.  It also initializes
00888  *  the header portion of the global memory.  GetDIBits() is used to determine
00889  *  the amount of room for the DIB's bits.  The total amount of memory
00890  *  needed = sizeof(BITMAPINFOHEADER) + size of color table + size of bits.
00891  *
00892  ************************************************************************/
00893
00894 HANDLE AllocRoomForDIB(BITMAPINFOHEADER bi, HBITMAP hBitmap)
00895 {
00896     DWORD               dwLen;
00897     HANDLE              hDIB;
00898     HDC                 hDC;
00899     LPBITMAPINFOHEADER  lpbi;
00900     HANDLE              hTemp;
00901
00902     // Figure out the size needed to hold the BITMAPINFO structure
00903     // (which includes the BITMAPINFOHEADER and the color table).
00904
00905     dwLen = bi.biSize + PaletteSize((LPSTR) &bi);
00906     hDIB  = GlobalAlloc(GHND,dwLen);
00907
00908     // Check that DIB handle is valid
00909
00910     if (!hDIB)
00911         return NULL;
00912
00913     // Set up the BITMAPINFOHEADER in the newly allocated global memory,
00914     // then call GetDIBits() with lpBits = NULL to have it fill in the
00915     // biSizeImage field for us.
00916
00917     lpbi  = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
00918     *lpbi = bi;
00919
00920     hDC   = GetDC(NULL);
00921
00922     GetDIBits(hDC, hBitmap, 0, (UINT) bi.biHeight, NULL, (LPBITMAPINFO)lpbi,
00923             DIB_RGB_COLORS);
00924     ReleaseDC(NULL, hDC);
00925
00926     // If the driver did not fill in the biSizeImage field,
00927     // fill it in -- NOTE: this is a bug in the driver!
00928
00929     if (lpbi->biSizeImage == 0)
00930         lpbi->biSizeImage = WIDTHBYTES((DWORD)lpbi->biWidth *
00931                 lpbi->biBitCount) * lpbi->biHeight;
00932
00933     // Get the size of the memory block we need
00934
00935     dwLen = lpbi->biSize + PaletteSize((LPSTR) &bi) + lpbi->biSizeImage;
00936
00937     // Unlock the memory block
00938
00939     GlobalUnlock(hDIB);
00940
00941     // ReAlloc the buffer big enough to hold all the bits
00942
00943     if (hTemp = GlobalReAlloc(hDIB,dwLen,0))
00944         return hTemp;
00945     else
00946     {
00947         // Else free memory block and return failure
00948
00949         GlobalFree(hDIB);
00950         return NULL;
00951     }
00952 }
00953
00954
00955 /*************************************************************************
00956  *
00957  * ChangeDIBFormat()
00958  *
00959  * Parameter:
00960  *
00961  * HDIB             - handle to packed-DIB in memory
00962  *
00963  * WORD             - desired bits per pixel
00964  *
00965  * DWORD            - desired compression format
00966  *
00967  * Return Value:
00968  *
00969  * HDIB             - handle to the new DIB if successful, else NULL
00970  *
00971  * Description:
00972  *
00973  * This function will convert the bits per pixel and/or the compression
00974  * format of the specified DIB. Note: If the conversion was unsuccessful,
00975  * we return NULL. The original DIB is left alone. Don't use code like the
00976  * following:
00977  *
00978  *    hMyDIB = ChangeDIBFormat(hMyDIB, 8, BI_RLE4);
00979  *
00980  * The conversion will fail, but hMyDIB will now be NULL and the original
00981  * DIB will now hang around in memory. We could have returned the old
00982  * DIB, but we wanted to allow the programmer to check whether this
00983  * conversion succeeded or failed.
00984  *
00985  ************************************************************************/
00986
00987 HDIB ChangeDIBFormat(HDIB hDIB, WORD wBitCount, DWORD dwCompression)
00988 {
00989     HDC                hDC;             // Handle to DC
00990     HBITMAP            hBitmap;         // Handle to bitmap
00991     BITMAP             Bitmap;          // BITMAP data structure
00992     BITMAPINFOHEADER   bi;              // Bitmap info header
00993     LPBITMAPINFOHEADER lpbi;            // Pointer to bitmap info
00994     HDIB               hNewDIB = NULL;  // Handle to new DIB
00995     HPALETTE           hPal, hOldPal;   // Handle to palette, prev pal
00996     WORD               DIBBPP, NewBPP;  // DIB bits per pixel, new bpp
00997     DWORD              DIBComp, NewComp;// DIB compression, new compression
00998
00999     // Check for a valid DIB handle
01000
01001     if (!hDIB)
01002         return NULL;
01003
01004     // Get the old DIB's bits per pixel and compression format
01005
01006     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDIB);
01007     DIBBPP = ((LPBITMAPINFOHEADER)lpbi)->biBitCount;
01008     DIBComp = ((LPBITMAPINFOHEADER)lpbi)->biCompression;
01009     GlobalUnlock(hDIB);
01010
01011     // Validate wBitCount and dwCompression
01012     // They must match correctly (i.e., BI_RLE4 and 4 BPP or
01013     // BI_RLE8 and 8BPP, etc.) or we return failure
01014     if (wBitCount == 0)
01015     {
01016         NewBPP = DIBBPP;
01017         if ((dwCompression == BI_RLE4 && NewBPP == 4) ||
01018                 (dwCompression == BI_RLE8 && NewBPP == 8) ||
01019                 (dwCompression == BI_RGB))
01020             NewComp = dwCompression;
01021         else
01022             return NULL;
01023     }
01024     else if (wBitCount == 1 && dwCompression == BI_RGB)
01025     {
01026         NewBPP = wBitCount;
01027         NewComp = BI_RGB;
01028     }
01029     else if (wBitCount == 4)
01030     {
01031         NewBPP = wBitCount;
01032         if (dwCompression == BI_RGB || dwCompression == BI_RLE4)
01033             NewComp = dwCompression;
01034         else
01035             return NULL;
01036     }
01037     else if (wBitCount == 8)
01038     {
01039         NewBPP = wBitCount;
01040         if (dwCompression == BI_RGB || dwCompression == BI_RLE8)
01041             NewComp = dwCompression;
01042         else
01043             return NULL;
01044     }
01045     else if (wBitCount == 24 && dwCompression == BI_RGB)
01046     {
01047         NewBPP = wBitCount;
01048         NewComp = BI_RGB;
01049     }
01050     else
01051         return NULL;
01052
01053     // Save the old DIB's palette
01054
01055     hPal = CreateDIBPalette(hDIB);
01056     if (!hPal)
01057         return NULL;
01058
01059     // Convert old DIB to a bitmap
01060
01061     hBitmap = DIBToBitmap(hDIB, hPal);
01062     if (!hBitmap)
01063     {
01064         DeleteObject(hPal);
01065         return NULL;
01066     }
01067
01068     // Get info about the bitmap
01069     GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&Bitmap);
01070
01071     // Fill in the BITMAPINFOHEADER appropriately
01072
01073     bi.biSize               = sizeof(BITMAPINFOHEADER);
01074     bi.biWidth              = Bitmap.bmWidth;
01075     bi.biHeight             = Bitmap.bmHeight;
01076     bi.biPlanes             = 1;
01077     bi.biBitCount           = NewBPP;
01078     bi.biCompression        = NewComp;
01079     bi.biSizeImage          = 0;
01080     bi.biXPelsPerMeter      = 0;
01081     bi.biYPelsPerMeter      = 0;
01082     bi.biClrUsed            = 0;
01083     bi.biClrImportant       = 0;
01084
01085     // Go allocate room for the new DIB
01086
01087     hNewDIB = AllocRoomForDIB(bi, hBitmap);
01088     if (!hNewDIB)
01089         return NULL;
01090
01091     // Get a pointer to the new DIB
01092
01093     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hNewDIB);
01094
01095     // Get a DC and select/realize our palette in it
01096
01097     hDC  = GetDC(NULL);
01098     hOldPal = SelectPalette(hDC, hPal, FALSE);
01099     RealizePalette(hDC);
01100
01101     // Call GetDIBits and get the new DIB bits
01102
01103     if (!GetDIBits(hDC, hBitmap, 0, (UINT) lpbi->biHeight,
01104             (LPSTR)lpbi + (WORD)lpbi->biSize + PaletteSize((LPSTR)lpbi),
01105             (LPBITMAPINFO)lpbi, DIB_RGB_COLORS))
01106     {
01107         GlobalUnlock(hNewDIB);
01108         GlobalFree(hNewDIB);
01109         hNewDIB = NULL;
01110     }
01111
01112     // Clean up and return
01113
01114     SelectPalette(hDC, hOldPal, TRUE);
01115     RealizePalette(hDC);
01116     ReleaseDC(NULL, hDC);
01117
01118     // Unlock the new DIB's memory block
01119     if (hNewDIB)
01120         GlobalUnlock(hNewDIB);
01121
01122     DeleteObject(hBitmap);
01123     DeleteObject(hPal);
01124
01125     return hNewDIB;
01126 }
01127
01128
01129 /*************************************************************************
01130  *
01131  * ChangeBitmapFormat()
01132  *
01133  * Parameter:
01134  *
01135  * HBITMAP          - handle to a bitmap
01136  *
01137  * WORD             - desired bits per pixel
01138  *
01139  * DWORD            - desired compression format
01140  *
01141  * HPALETTE         - handle to palette
01142  *
01143  * Return Value:
01144  *
01145  * HDIB             - handle to the new DIB if successful, else NULL
01146  *
01147  * Description:
01148  *
01149  * This function will convert a bitmap to the specified bits per pixel
01150  * and compression format. The bitmap and it's palette will remain
01151  * after calling this function.
01152  *
01153  ************************************************************************/
01154
01155 HDIB ChangeBitmapFormat(HBITMAP hBitmap, WORD wBitCount, DWORD dwCompression,
01156         HPALETTE hPal)
01157 {
01158     HDC                hDC;          // Screen DC
01159     HDIB               hNewDIB=NULL; // Handle to new DIB
01160     BITMAP             Bitmap;       // BITMAP data structure
01161     BITMAPINFOHEADER   bi;           // Bitmap info. header
01162     LPBITMAPINFOHEADER lpbi;         // Pointer to bitmap header
01163     HPALETTE           hOldPal=NULL; // Handle to palette
01164     WORD               NewBPP;       // New bits per pixel
01165     DWORD              NewComp;      // New compression format
01166
01167     // Check for a valid bitmap handle
01168
01169     if (!hBitmap)
01170         return NULL;
01171
01172     // Validate wBitCount and dwCompression
01173     // They must match correctly (i.e., BI_RLE4 and 4 BPP or
01174     // BI_RLE8 and 8BPP, etc.) or we return failure
01175
01176     if (wBitCount == 0)
01177     {
01178         NewComp = dwCompression;
01179         if (NewComp == BI_RLE4)
01180             NewBPP = 4;
01181         else if (NewComp == BI_RLE8)
01182             NewBPP = 8;
01183         else // Not enough info */
01184             return NULL;
01185     }
01186     else if (wBitCount == 1 && dwCompression == BI_RGB)
01187     {
01188         NewBPP = wBitCount;
01189         NewComp = BI_RGB;
01190     }
01191     else if (wBitCount == 4)
01192     {
01193         NewBPP = wBitCount;
01194         if (dwCompression == BI_RGB || dwCompression == BI_RLE4)
01195             NewComp = dwCompression;
01196         else
01197             return NULL;
01198     }
01199     else if (wBitCount == 8)
01200     {
01201         NewBPP = wBitCount;
01202         if (dwCompression == BI_RGB || dwCompression == BI_RLE8)
01203             NewComp = dwCompression;
01204         else
01205             return NULL;
01206     }
01207     else if (wBitCount == 24 && dwCompression == BI_RGB)
01208     {
01209         NewBPP = wBitCount;
01210         NewComp = BI_RGB;
01211     }
01212     else
01213         return NULL;
01214
01215     // Get info about the bitmap
01216
01217     GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&Bitmap);
01218
01219     // Fill in the BITMAPINFOHEADER appropriately
01220
01221     bi.biSize               = sizeof(BITMAPINFOHEADER);
01222     bi.biWidth              = Bitmap.bmWidth;
01223     bi.biHeight             = Bitmap.bmHeight;
01224     bi.biPlanes             = 1;
01225     bi.biBitCount           = NewBPP;
01226     bi.biCompression        = NewComp;
01227     bi.biSizeImage          = 0;
01228     bi.biXPelsPerMeter      = 0;
01229     bi.biYPelsPerMeter      = 0;
01230     bi.biClrUsed            = 0;
01231     bi.biClrImportant       = 0;
01232
01233     // Go allocate room for the new DIB
01234
01235     hNewDIB = AllocRoomForDIB(bi, hBitmap);
01236     if (!hNewDIB)
01237         return NULL;
01238
01239     // Get a pointer to the new DIB
01240
01241     lpbi = (LPBITMAPINFOHEADER)GlobalLock(hNewDIB);
01242
01243     hDC = GetDC(NULL);
01244
01245     // If we have a palette, select/realize it
01246
01247     if (hPal)
01248     {
01249         hOldPal = SelectPalette(hDC, hPal, FALSE);
01250         RealizePalette(hDC);
01251     }
01252
01253     // Call GetDIBits and get the new DIB bits
01254
01255     if (!GetDIBits(hDC, hBitmap, 0, (UINT) lpbi->biHeight, (LPSTR)lpbi +
01256             (WORD)lpbi->biSize + PaletteSize((LPSTR)lpbi), (LPBITMAPINFO)lpbi,
01257             DIB_RGB_COLORS))
01258     {
01259         GlobalUnlock(hNewDIB);
01260         GlobalFree(hNewDIB);
01261         hNewDIB = NULL;
01262     }
01263
01264     // Clean up and return
01265
01266     if (hOldPal)
01267     {
01268         SelectPalette(hDC, hOldPal, TRUE);
01269         RealizePalette(hDC);
01270         ReleaseDC(NULL, hDC);
01271     }
01272
01273     // Unlock the new DIB's memory block
01274
01275     if (hNewDIB)
01276         GlobalUnlock(hNewDIB);
01277
01278     return hNewDIB;
01279 }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmMonitor/DllDatax.c Source File

  • Com
  • Services
  • Crm
  • CrmMonitor

DllDatax.c

Go to the documentation of this file.
00001 // wrapper for dlldata.c
00002
00003 #ifdef _MERGE_PROXYSTUB // merge proxy stub DLL
00004
00005 #define REGISTER_PROXY_DLL //DllRegisterServer, etc.
00006
00007 #if !defined(_WIN32_WINNT)
00008 #define _WIN32_WINNT 0x0500
00009 #endif // !defined(_WIN32_WINNT)
00010 #define USE_STUBLESS_PROXY  //defined only with MIDL switch /Oicf
00011
00012 #pragma comment(lib, "rpcndr.lib")
00013 #pragma comment(lib, "rpcns4.lib")
00014 #pragma comment(lib, "rpcrt4.lib")
00015
00016 #define DllMain       PrxDllMain
00017 #define DllRegisterServer PrxDllRegisterServer
00018 #define DllUnregisterServer PrxDllUnregisterServer
00019 #define DllGetClassObject   PrxDllGetClassObject
00020 #define DllCanUnloadNow     PrxDllCanUnloadNow
00021
00022 #include "dlldata.c"
00023 #include "CrmMonComp_p.c"
00024
00025 #ifdef _NOPROXY //no midl generated dlldata.c
00026
00027 #define STRICT 1
00028 #include <ole2.h>
00029
00030 BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00031 {return TRUE;}
00032
00033 STDAPI PrxDllCanUnloadNow(void){return S_OK;}
00034
00035 STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00036 {return CLASS_E_CLASSNOTAVAILABLE;}
00037
00038 STDAPI PrxDllRegisterServer(void){return S_OK;}
00039
00040 STDAPI PrxDllUnregisterServer(void){return S_OK;}
00041
00042 #endif //!PROXY_DELEGATION
00043
00044 #endif //_MERGE_PROXYSTUB
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CUtil Member List

This is the complete list of members for CUtil, including all inherited members.
CUtil() | CUtil |
GetConn() | CUtil | [inline]
GetIniString(CHAR *section, CHAR *key) | CUtil | [private]
GetSql() | CUtil | [inline]
GetUsername() | CUtil | [inline]
HasReadAccess() | CUtil | [inline]
HasWriteAccess() | CUtil | [inline]
m_bstrConn | CUtil | [private]
m_bstrDatasource | CUtil | [private]
m_bstrIniFile | CUtil | [private]
m_bstrSectionConn | CUtil | [private]
m_bstrSectionName | CUtil | [private]
m_bstrSectionUserlist | CUtil | [private]
m_bstrSql | CUtil | [private]
m_bstrSqlSection | CUtil | [private]
m_cLastIniString | CUtil | [private]
m_lAccess | CUtil | [private]
m_pszLastIniString | CUtil | [private]
m_pszUsername | CUtil | [private]
ParseConn(WCHAR *conn) | CUtil | [private]
RaiseError(HRESULT hr) | CUtil |
SetConn(BSTR conn) | CUtil |
SetIniFile(BSTR args) | CUtil |
SetSection(void) | CUtil | [private]
SetSql(BSTR str) | CUtil |
SubstituteParameters(CUtilString &RetVal, CHAR *str, WCHAR *params) | CUtil | [private]
~CUtil() | CUtil |
Generated on Wed Nov 13 2024 16:57:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: UDDI/wsdldiscovery/AssemblyInfo.cs Source File

  • UDDI
  • wsdldiscovery

AssemblyInfo.cs

Go to the documentation of this file.
00001 /*=====================================================================
00002   This file is part of the Microsoft UDDI SDK Code Samples.
00003
00004   Copyright (C) Microsoft Corporation.  All rights reserved.
00005
00006 This source code is intended only as a supplement to Microsoft
00007 Development Tools and/or on-line documentation.  See these other
00008 materials for detailed information regarding Microsoft code samples.
00009
00010 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00011 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00012 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00013 PARTICULAR PURPOSE.
00014 =====================================================================*/
00015
00016 using System.Reflection;
00017 using System.Runtime.CompilerServices;
00018
00019 //
00020 // General Information about an assembly is controlled through the following
00021 // set of attributes. Change these attribute values to modify the information
00022 // associated with an assembly.
00023 //
00024 [assembly: AssemblyTitle("")]
00025 [assembly: AssemblyDescription("")]
00026 [assembly: AssemblyConfiguration("")]
00027 [assembly: AssemblyCompany("")]
00028 [assembly: AssemblyProduct("")]
00029 [assembly: AssemblyCopyright("")]
00030 [assembly: AssemblyTrademark("")]
00031 [assembly: AssemblyCulture("")]
00032
00033 //
00034 // Version information for an assembly consists of the following four values:
00035 //
00036 //      Major Version
00037 //      Minor Version
00038 //      Build Number
00039 //      Revision
00040 //
00041 // You can specify all the values or you can default the Revision and Build Numbers
00042 // by using the '*' as shown below:
00043
00044 [assembly: AssemblyVersion("1.0.*")]
00045
00046 //
00047 // In order to sign your assembly you must specify a key to use. Refer to the
00048 // Microsoft .NET Framework documentation for more information on assembly signing.
00049 //
00050 // Use the attributes below to control which key is used for signing.
00051 //
00052 // Notes:
00053 //   (*) If no key is specified, the assembly is not signed.
00054 //   (*) KeyName refers to a key that has been installed in the Crypto Service
00055 //       Provider (CSP) on your machine. KeyFile refers to a file which contains
00056 //       a key.
00057 //   (*) If the KeyFile and the KeyName values are both specified, the
00058 //       following processing occurs:
00059 //       (1) If the KeyName can be found in the CSP, that key is used.
00060 //       (2) If the KeyName does not exist and the KeyFile does exist, the key
00061 //           in the KeyFile is installed into the CSP and used.
00062 //   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
00063 //       When specifying the KeyFile, the location of the KeyFile should be
00064 //       relative to the project output directory which is
00065 //       %Project Directory%\obj<configuration>. For example, if your KeyFile is
00066 //       located in the project directory, you would specify the AssemblyKeyFile
00067 //       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
00068 //   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
00069 //       documentation for more information on this.
00070 //
00071 [assembly: AssemblyDelaySign(false)]
00072 [assembly: AssemblyKeyFile("")]
00073 [assembly: AssemblyKeyName("")]
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPrintAux Member List

This is the complete list of members for CPrintAux, including all inherited members.
_bUserAbort | CPrintAux | [private]
_hDlgPrint | CPrintAux | [private]
AbortProc(HDC hdcPrn, short nCode) | CPrintAux | [friend]
CPrintRequest class | CPrintAux | [friend]
PrintDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | CPrintAux | [friend]
Generated on Wed Nov 13 2024 16:57:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/registry.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091         _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124         _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,         // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154         MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/odbc/quiktest/dllstub.c Source File

  • Dataaccess
  • odbc
  • quiktest

dllstub.c

Go to the documentation of this file.
00001 //*------------------------------------------------------------------------
00002 //| File:     DLLSTUB.C
00003 //|
00004 //| Purpose:    This is a generic module which contains the entry points
00005 //|           required to compile a DLL.
00006 //*------------------------------------------------------------------------
00007 #include <windows.h>
00008 #include "autotest.h"
00009
00010 HINSTANCE   hLoadedInst;
00011
00012
00013
00014 //-------------------------------------------------------------------------
00015 //  For WIN32 programs, there is only one entry point which takes care of
00016 //    everything.  For 16 bit apps, however, there are two entry points,
00017 //    LibMain which is called upon initialization, and WEP which is the
00018 //    windows exit procedure.
00019 //-------------------------------------------------------------------------
00020
00021
00022 #ifdef WIN32
00023 #include <winnt.h>
00024
00025 int EXTFUN TstLibMain(HANDLE hInst, DWORD fdwReason, LPVOID lpReserved)
00026 {
00027   BOOL WINAPI _CRT_INIT(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved);
00028
00029   switch(fdwReason) {
00030     case DLL_PROCESS_ATTACH:
00031     case DLL_THREAD_ATTACH:
00032       hLoadedInst = hInst;
00033       if(!hLoadedInst || !(_CRT_INIT(hInst, fdwReason, lpReserved)))
00034         return FALSE;
00035       break;
00036
00037     case DLL_PROCESS_DETACH:
00038     case DLL_THREAD_DETACH:
00039       if(!(_CRT_INIT(hInst, fdwReason, lpReserved)))
00040         return FALSE;
00041       break;
00042     }
00043
00044   return TRUE;
00045 }
00046
00047 #else
00048
00049
00050 //*---------------------------------------------------------------------------------
00051 //| LibMain:
00052 //| This entry point will simply take care of our data segment.
00053 //| Parms:
00054 //| in      hInst           Current hInstance (data segment)
00055 //| in      wDataSeg
00056 //| in      cbHeapSize
00057 //| in      szCmdLine       Command line arguments
00058 //| Returns:
00059 //| TRUE if successful, FALSE on a failure
00060 //*---------------------------------------------------------------------------------
00061 int EXTFUN LibMain(HINSTANCE hInst, WORD wDataSeg, WORD cbHeapSize, LPSTR szCmdLine)
00062 {
00063   if(cbHeapSize != 0)
00064     UnlockData(0);
00065
00066   hLoadedInst = hInst;
00067
00068   return TRUE;
00069 }
00070
00071
00072
00073 //*---------------------------------------------------------------------------------
00074 //| WEP:
00075 //| This is the windows exit procedure.  We will be passed a flag which
00076 //|   tells us if we are being unloaded by a normal Unload call or if
00077 //|   the system is shutting down.
00078 //| Parms:
00079 //| int   fParm           What type of unload?
00080 //| Returns:
00081 //| TRUE always
00082 //*---------------------------------------------------------------------------------
00083 int EXTFUN WEP(int fParm)
00084 {
00085   switch (fParm) {
00086     case WEP_SYSTEM_EXIT:
00087     case WEP_FREE_DLL:
00088     default:
00089       return TRUE;
00090   }
00091 }
00092
00093
00094
00095 #endif
00096
Generated on Wed Nov 13 2024 16:52:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/sampletest.h Source File

  • NetDS
  • RRas
  • ip

sampletest.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\sampletest.h
00008
00009 Abstract:
00010
00011     The file contains declarations for the test program
00012
00013 --*/
00014
00015 #ifndef _SAMPLETEST_H_
00016 #define _SAMPLETEST_H_
00017
00018 #include <windows.h>
00019
00020 #include "ipsample.h"
00021
00022 #endif // _SAMPLETEST_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_FILETIME Member List

This is the complete list of members for _FILETIME, including all inherited members.
dwHighDateTime | _FILETIME
dwLowDateTime | _FILETIME
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagUser Member List

This is the complete list of members for tagUser, including all inherited members.
fLocal | tagUser
fMcu | tagUser
fTop | tagUser
iItem | tagUser
m_pChannelAs | tagUser
m_pChannelAudio | tagUser
m_pChannelData | tagUser
m_pChannelFt | tagUser
pMember | tagUser
pszAddr | tagUser
pszName | tagUser
uchCaps | tagUser
uId | tagUser
uType | tagUser
uVersion | tagUser
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/DCO_DimmerService/DimmerDeviceDCO.cpp Source File

  • NetDS
  • upnp
  • DCO_DimmerService

DimmerDeviceDCO.cpp

Go to the documentation of this file.
00001 //
00002 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 // PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00008 //
00009 //
00010 // DimmerDeviceDCO.cpp : Implementation code for Dimmer Device
00011
00012 #include <atlbase.h>
00013 #include "resource.h"
00014 #include "DeviceDll.h"
00015 #include <atlcom.h>
00016 #include <upnphost.h>
00017 #include <initguid.h>
00018 #include "dimmerdevice.h"
00019 #include "dimmerdevice_i.c"
00020 #include "DimmerService.h"
00021 #include "DimmerDeviceDCO.h"
00022
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //  UPNPDimmerDevice : Implementation
00026 ////////////////////////////////////////////////////////////////////////////
00027 UPNPDimmerDevice:: UPNPDimmerDevice()
00028 {
00029    // initialise variables
00030    INT i,j;
00031
00032    // initialise the table mapping the template UDN's to the UDN's used by the device host.
00033    // there is only one entry in this table since the device has only a RootDevice and no
00034    // embedded devices
00035    UDNmapping[0][0] = SysAllocString(L"uuid:RootDevice");
00036    UDNmapping[0][1] = NULL;
00037
00038
00039    // initialise the table mapping between the devices and the services ID's of the services it hosts
00040    // i.e. Row 0 contains services IDs for the RootDevice and Row1 for embedded device 1 if present etc.
00041    // The sample device just has a Rootdevice and no embedded devices
00042    serviceIDDeviceMap[0][0] = SysAllocString( L"urn:microsoft-com:serviceId:DimmerService1.0" );
00043
00044    // array pDisPtrs holds the IDispatch Interface pointers for the services supported by the device
00045    for (i = 0; i < NUM_TEMPLATE_UDNS_IN_DESCDOC; i++)
00046    {
00047       for (j = 0; j < MAX_NOSERVICE_PER_DEVICE; j++)
00048       {
00049          pDisPtrs[i][j] = NULL;
00050       }
00051    }
00052 }
00053
00054
00055
00056 UPNPDimmerDevice::~ UPNPDimmerDevice()
00057 {
00058    INT i,j;
00059    for (i = 0; i < NUM_TEMPLATE_UDNS_IN_DESCDOC; i++)
00060    {
00061       for (j = 0; j < MAX_NOSERVICE_PER_DEVICE; j++)
00062       {
00063          if (pDisPtrs[i][j] != NULL)
00064          {
00065             pDisPtrs[i][j]->Release();
00066             pDisPtrs[i][j]=NULL;
00067          }
00068       }
00069    }
00070
00071    //free the strings allocated for the table mapping the template UDN to real UDN
00072    SysFreeString(UDNmapping[0][0]);
00073
00074    //free the strings allocated for the table mapping devices to Service ID's
00075    SysFreeString(serviceIDDeviceMap[0][0]);
00076
00077 }
00078
00079
00080
00081 STDMETHODIMP  UPNPDimmerDevice::Initialize(BSTR bstrXMLDesc,BSTR deviceID,BSTR bstrInitString)
00082 {
00083    //We create an instance of our service and store it for future use
00084    HRESULT hr = S_OK;
00085    HANDLE fHandle = NULL;
00086    DWORD numBytesWritten = 0;
00087    IUPnPRegistrar *pReg = NULL;
00088    CHAR *pDescDoc = NULL;
00089    INT i;
00090
00091    OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Entering Initialize\n"));
00092    CComObject<UPNPDimmerService> *pUPNPDimmerService;
00093
00094    //if the description doc passed to the Initialize function is NULL return an error
00095    if (bstrXMLDesc == NULL)
00096    {
00097       OutputDebugString(TEXT("UPNPDimmerDeviceDCO: bstrXMLDesc is null\n"));
00098       return E_FAIL;
00099    }
00100
00101
00102    // Now create Service Objects for the services hosted by the device and store
00103    // it in the pDispPtrs table. We get the Service Object IDispatch pointer for
00104    // the RootDevice's dimming service and store it in Location 0,0
00105    pUPNPDimmerService = NULL;
00106    OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Creating the service object\n"));
00107    hr = CComObject<UPNPDimmerService>::CreateInstance(&pUPNPDimmerService);
00108
00109    if (FAILED(hr))
00110    {
00111       OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Cannot create the service object\n"));
00112       return E_FAIL;
00113    }
00114
00115    // if we could not create the service object for the Dimmer Service return an Error
00116    if (pUPNPDimmerService==NULL)
00117    {
00118       OutputDebugString(TEXT("UPNPDimmerDeviceDCO: The service object is null\n"));
00119       return E_FAIL;
00120    }
00121
00122    // Now get the pointer to the IDispatch interface using the QueryInterface function
00123
00124    OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Querying the IDispatch for the service object\n"));
00125    hr = pUPNPDimmerService->QueryInterface(IID_IDispatch,(LPVOID *) &pDisPtrs[0][0]);
00126
00127    if (FAILED(hr))
00128    {
00129       OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Can't get IDispatch interface from the service object\n"));
00130       pUPNPDimmerService->Release();
00131       return hr;
00132    }
00133
00134
00135    // Now create a table mapping the template UDN's to the actual published UDN's we
00136    // use BSTR's since the function GetUniqueDeviceName() takes in BSTR's as parameters
00137    OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Creating the registrar object\n"));
00138    hr = CoCreateInstance(
00139       CLSID_UPnPRegistrar,
00140       NULL,
00141       CLSCTX_SERVER,
00142       IID_IUPnPRegistrar,
00143       (LPVOID *) &pReg
00144       );
00145
00146    if (FAILED(hr))
00147    {
00148       OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Can't create the registrar object\n"));
00149       pUPNPDimmerService->Release();
00150       return hr;
00151    }
00152
00153    for (i = 0; i < NUM_TEMPLATE_UDNS_IN_DESCDOC; i++)
00154    {
00155       hr = pReg->GetUniqueDeviceName(deviceID, UDNmapping[i][0], &UDNmapping[i][1]);
00156       if (FAILED(hr))
00157       {
00158          pReg->Release();
00159          pUPNPDimmerService->Release();
00160          OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Can't get the unique device names\n"));
00161          return hr;
00162       }
00163    }
00164
00165    pReg->Release();
00166    OutputDebugString(TEXT("UPNPDimmerDeviceDCO: Exiting the Initialize\n"));
00167    return hr;
00168
00169 }
00170
00171 STDMETHODIMP  UPNPDimmerDevice::GetServiceObject(BSTR bstrUDN,BSTR bstrServiceId,IDispatch **ppdispService)
00172 {
00173    // Look at the Service for which the pointer is asked and return it in the IDispatch pointer
00174    INT i;
00175    INT foundDevice = -1;
00176    INT foundService = -1;
00177
00178    for (i = 0; i < NUM_TEMPLATE_UDNS_IN_DESCDOC; i++)
00179    {
00180       if (_tcscmp(bstrUDN,UDNmapping[i][1]) == 0)
00181       {
00182          foundDevice = i;
00183       }
00184    }
00185
00186    if (foundDevice == -1)
00187    {
00188       return E_FAIL;
00189    }
00190
00191    // else find the service in this particular device
00192    for (i = 0; i < MAX_NOSERVICE_PER_DEVICE; i++)
00193    {
00194       if (_tcscmp(serviceIDDeviceMap[foundDevice][i],bstrServiceId)==0)
00195       {
00196          foundService=i;
00197       }
00198    }
00199
00200    if (foundService==-1)
00201    {
00202       return E_FAIL;
00203    }
00204
00205    if (pDisPtrs[foundDevice][foundService] == NULL)
00206    {
00207       return E_FAIL;
00208    }
00209
00210    pDisPtrs[foundDevice][foundService]->AddRef();
00211    *ppdispService = pDisPtrs[foundDevice][foundService];
00212    return S_OK;
00213 }
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Range/cache.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Range

cache.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include <windows.h>
00018 #include <wininet.h>
00019 #include "range.h"
00020
00021 //==============================================================================
00022 BOOL QueryHeaders
00023 (
00024      HANDLE                hRequest,
00025      PHTTP_REQUESTCB_PARAM pCBParam,
00026      SYSTEMTIME*           pstLastModified
00027 )
00028 {
00029     DWORD cbBuf;
00030     BOOL fRet;
00031
00032     pCBParam->CallbackType     = REQUESTCB_STARTED;
00033     pCBParam->fdwRequestFlags  = HTTP_REQUEST_FROM_CACHE;
00034
00035     // Get if the server supports ranges from the response headers.
00036     static char szBytes[] ="bytes";
00037     char szBuf[sizeof(szBytes)];
00038     cbBuf = sizeof(szBytes);
00039     fRet = HttpQueryInfo
00040         (hRequest, HTTP_QUERY_ACCEPT_RANGES, szBuf, &cbBuf, 0);
00041     if (fRet && !lstrcmpi (szBuf, szBytes))
00042         pCBParam->fdwRequestFlags |= HTTP_REQUEST_ACCEPT_RANGES;
00043
00044     // Get the response code.
00045     cbBuf = sizeof(pCBParam->dwResponseCode);
00046     fRet = HttpQueryInfo
00047     (
00048         hRequest,
00049         HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_STATUS_CODE,
00050         &pCBParam->dwResponseCode,
00051         &cbBuf,
00052         NULL
00053     );
00054     if (!fRet)
00055        pCBParam->dwResponseCode = 0;
00056
00057     // Get the last modified time from the response headers.
00058     cbBuf = sizeof(*pstLastModified);
00059     fRet = HttpQueryInfo
00060     (
00061         hRequest,
00062         HTTP_QUERY_FLAG_SYSTEMTIME | HTTP_QUERY_LAST_MODIFIED,
00063         pstLastModified,
00064         &cbBuf,
00065         NULL
00066     );
00067     pCBParam->pstLastModified = fRet? pstLastModified : NULL;
00068
00069     // Get the content length from the cache file size.
00070     pCBParam->dwContentLength =
00071         InternetSetFilePointer (hRequest, NULL, 0, FILE_END, 0);
00072
00073     return TRUE;
00074 }
00075
00076 //==============================================================================
00077 BOOL HttpReadFromCache (PHTTP_REQUEST_PARAM pParam)
00078 {
00079     // Locals that must be initialized before goto done.
00080     BOOL fSuccess = FALSE;
00081     HANDLE hInternet = NULL;
00082     HANDLE hConnect  = NULL;
00083     HANDLE hRequest  = NULL;
00084     PVOID pRead = NULL;
00085     HRESULT hrRequest = S_OK;
00086
00087     // Initialize wininet
00088     hInternet = InternetOpen
00089         ("RR", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_OFFLINE);
00090     if (!hInternet)
00091         goto done;
00092     hRequest = InternetOpenUrl
00093         (hInternet, pParam->pszUrl, NULL, 0, INTERNET_FLAG_OFFLINE, 0);
00094     if (!hRequest)
00095         goto done;
00096
00097     // Initialize callback parameters.
00098     HTTP_REQUESTCB_PARAM CBParam;
00099     CBParam.cbStruct         = sizeof(CBParam);
00100     CBParam.dwRequestCtx     = pParam->dwRequestCtx;
00101
00102     // Allocate read buffer
00103     DWORD cbRead;
00104     cbRead = 4096;
00105     pRead  = LocalAlloc (LMEM_FIXED, cbRead);
00106     if (!pRead)
00107     {
00108         SetLastError (ERROR_NOT_ENOUGH_MEMORY);
00109         goto done;
00110     }
00111
00112     SYSTEMTIME st;
00113     if (!QueryHeaders (hRequest, &CBParam, &st))
00114         goto done;
00115
00116     fSuccess = TRUE;
00117
00118     // Notify the client that request is started.
00119     if (!(*pParam->pfnRequestCB) (&CBParam))
00120         goto notify;
00121
00122     // Set up ranges to read.
00123     HTTP_REQUEST_RANGE EntireRange;
00124     PHTTP_REQUEST_RANGE pRanges;
00125     DWORD cRanges;
00126
00127     if (pParam->cRanges)
00128     {
00129         pRanges = pParam->pRanges;
00130         cRanges = pParam->cRanges;
00131     }
00132     else
00133     {
00134         EntireRange.dwOffset = 0;
00135         EntireRange.dwSize = CBParam.dwContentLength;
00136         pRanges = &EntireRange;
00137         cRanges = 1;
00138     }
00139
00140     // Loop over the ranges, reading into the buffer.
00141     CBParam.CallbackType = REQUESTCB_DATA;
00142     CBParam.lpDataBuffer = pRead;
00143
00144     while (cRanges--)
00145     {
00146         CBParam.dwDataOffset = pRanges->dwOffset;
00147         DWORD cbRange        = pRanges->dwSize;
00148         if (!cbRange)
00149             cbRange = InternetSetFilePointer (hRequest, 0, NULL, FILE_END, 0)
00150               - pRanges->dwOffset;
00151
00152         while (cbRange) // Loop until we have all the data for the range.
00153         {
00154             InternetSetFilePointer
00155                 (hRequest, CBParam.dwDataOffset, NULL, FILE_BEGIN, 0);
00156
00157             if (!InternetReadFile
00158                 (hRequest, pRead, min(cbRead, cbRange), &CBParam.cbDataLength))
00159             {
00160                 hrRequest = E_FAIL;
00161                 goto notify;
00162             }
00163
00164             // Check for EOF
00165             if (!CBParam.cbDataLength)
00166                 break;
00167
00168             // Call the client with data.
00169             if (!(*pParam->pfnRequestCB) (&CBParam))
00170                 goto notify;
00171
00172             CBParam.dwDataOffset += CBParam.cbDataLength;
00173             cbRange              -= CBParam.cbDataLength;
00174         }
00175
00176         // Advance to next range.
00177         pRanges++;
00178
00179     } // end while (cRanges--)
00180
00181 notify:
00182
00183     // Notify the client we are done.
00184     CBParam.CallbackType = REQUESTCB_DONE;
00185     CBParam.hrRequest = hrRequest;
00186     (*pParam->pfnRequestCB) (&CBParam);
00187
00188 done:
00189     if (pRead)
00190         LocalFree ((HLOCAL) pRead);
00191     if (hRequest)
00192         InternetCloseHandle (hRequest);
00193     if (hConnect)
00194         InternetCloseHandle (hConnect);
00195     if (hInternet)
00196         InternetCloseHandle (hInternet);
00197     return fSuccess;
00198 }
00199
00200 //==============================================================================
00201 BOOL HttpReadRequest (PHTTP_REQUEST_PARAM pParam)
00202 {
00203     if (pParam->cbStruct != sizeof(HTTP_REQUEST_PARAM))
00204     {
00205         SetLastError (ERROR_INVALID_PARAMETER);
00206         return FALSE;
00207     }
00208
00209     if (HttpReadFromCache (pParam))
00210         return TRUE;
00211     return HttpReadFromServer (pParam);
00212 }
00213
00214
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/fax/PrintSdi/NewDocDlg.h Source File

  • NetDS
  • fax
  • PrintSdi

NewDocDlg.h

Go to the documentation of this file.
00001 #if !defined(AFX_NEWDOCDLG_H__55689553_8B6C_11D1_B7AE_000000000000__INCLUDED_)
00002 #define AFX_NEWDOCDLG_H__55689553_8B6C_11D1_B7AE_000000000000__INCLUDED_
00003
00004 #if _MSC_VER >= 1000
00005 #pragma once
00006 #endif // _MSC_VER >= 1000
00007 // NewDocDlg.h : header file
00008 //
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // NewDocDlg dialog
00012
00013 class NewDocDlg : public CDialog
00014 {
00015 // Construction
00016 public:
00017   NewDocDlg(CWnd* pParent = NULL);   // standard constructor
00018
00019 // Dialog Data
00020   //{{AFX_DATA(NewDocDlg)
00021   enum { IDD = IDD_NEWDIALOG };
00022   CString m_szText;
00023   int   m_polytype;
00024   //}}AFX_DATA
00025
00026
00027 // Overrides
00028   // ClassWizard generated virtual function overrides
00029   //{{AFX_VIRTUAL(NewDocDlg)
00030   protected:
00031   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00032   //}}AFX_VIRTUAL
00033
00034 // Implementation
00035 protected:
00036
00037   // Generated message map functions
00038   //{{AFX_MSG(NewDocDlg)
00039     // NOTE: the ClassWizard will add member functions here
00040   //}}AFX_MSG
00041   DECLARE_MESSAGE_MAP()
00042 };
00043
00044 //{{AFX_INSERT_LOCATION}}
00045 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00046
00047 #endif // !defined(AFX_NEWDOCDLG_H__55689553_8B6C_11D1_B7AE_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RealTimeStylusPlugins::PacketFilterPlugin Member List

This is the complete list of members for RealTimeStylusPlugins::PacketFilterPlugin, including all inherited members.
CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
DataInterest | RealTimeStylusPlugins::PacketFilterPlugin |
Error(RealTimeStylus sender, ErrorData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
InAirPackets(RealTimeStylus sender, InAirPacketsData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
ModifyPacketData(StylusDataBase data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline, private]
PacketFilterPlugin(Rectangle r) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
Packets(RealTimeStylus sender, PacketsData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
RealTimeStylusDisabled(RealTimeStylus sender, RealTimeStylusDisabledData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
RealTimeStylusEnabled(RealTimeStylus sender, RealTimeStylusEnabledData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
rectangle | RealTimeStylusPlugins::PacketFilterPlugin | [private]
StylusButtonDown(RealTimeStylus sender, StylusButtonDownData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
StylusButtonUp(RealTimeStylus sender, StylusButtonUpData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
StylusDown(RealTimeStylus sender, StylusDownData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
StylusInRange(RealTimeStylus sender, StylusInRangeData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
StylusOutOfRange(RealTimeStylus sender, StylusOutOfRangeData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
StylusUp(RealTimeStylus sender, StylusUpData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
SystemGesture(RealTimeStylus sender, SystemGestureData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
TabletAdded(RealTimeStylus sender, TabletAddedData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
TabletRemoved(RealTimeStylus sender, TabletRemovedData data) | RealTimeStylusPlugins::PacketFilterPlugin | [inline]
Generated on Wed Nov 13 2024 16:58:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/SimpDnd.h Source File

  • Com
  • Fundamentals
  • SimpDnd

SimpDnd.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: simpdnd.h
00003 //
00004 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00005 //**********************************************************************
00006 #define IDM_ABOUT 100
00007 #define IDM_INSERT  101
00008 #define IDM_VERB0 1000
00009
00010 int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow);
00011 BOOL InitApplication(HANDLE hInstance);
00012 BOOL InitInstance(HANDLE hInstance, int nCmdShow);
00013 //@@WTK WIN32, UNICODE
00014 //long FAR PASCAL _export MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00015 long FAR PASCAL EXPORT MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00016 //@@WTK WIN32, UNICODE
00017 //long FAR PASCAL _export DocWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00018 long FAR PASCAL EXPORT DocWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00019 //@@WTK WIN32, UNICODE
00020 //BOOL FAR PASCAL _export About(HWND hDlg, unsigned message, WORD wParam, LONG lParam);
00021 BOOL FAR PASCAL EXPORT About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/addvfiledlg.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

addvfiledlg.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  AddVFileDlg.cpp:  Implementation of the CAddVFileDlg class.
00015 //
00016
00017
00018
00019 #include "AddVFileDlg.h"
00020 #include "Globals.h"
00021 #include "Resource.h"        // Control IDs
00022 #include "BaseNode.h"        // NODE_PROPERTIES struct
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //  Construction-Destruction
00026
00027 //---------------------------------------------------------------------------
00028 //
00029 CAddVFileDlg::CAddVFileDlg( ULONG nTemplate, HWND pParentWnd )
00030              : CBaseDialog( nTemplate )
00031 {
00032   _ASSERT( NULL != pParentWnd );
00033   m_hParentWnd = pParentWnd;
00034
00035 }
00036
00037 CAddVFileDlg::~CAddVFileDlg()
00038 {
00039 }
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 //  Message handlers
00043
00044
00045 //---------------------------------------------------------------------------
00046 LRESULT CAddVFileDlg::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
00047 {
00048   LRESULT lResult = 0;
00049
00050   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00051   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00052   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_LOCKED_ATTR   );
00053   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00054   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00055
00056   lResult = SendMessage( hArchiveCtrl,  BM_SETCHECK, BST_UNCHECKED, 0 );
00057   lResult = SendMessage( hHiddenCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00058   lResult = SendMessage( hLockedCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00059   lResult = SendMessage( hReadOnlyCtrl, BM_SETCHECK, BST_UNCHECKED, 0 );
00060
00061   lResult = SetWindowText( hDevNameCtrl, _T("") );
00062   SetFocus( hDevNameCtrl );
00063
00064   return 0;
00065 }
00066
00067 //---------------------------------------------------------------------------
00068 LRESULT CAddVFileDlg::OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam )
00069 {
00070   LRESULT          lResult = 0;
00071   NODE_PROPERTIES  NodeProps;
00072
00073   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00074
00075   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00076   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00077   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_LOCKED_ATTR   );
00078   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00079   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00080
00081   if( BST_CHECKED == SendMessage( hArchiveCtrl, BM_GETCHECK, 0, 0 ) )
00082     NodeProps.dwAttributes |= ATTRIBUTE_DATA_ARCHIVE;
00083
00084   if( BST_CHECKED == SendMessage( hHiddenCtrl, BM_GETCHECK, 0, 0 ) )
00085     NodeProps.dwAttributes |= ATTRIBUTE_DATA_HIDDEN;
00086
00087   if( BST_CHECKED == SendMessage( hLockedCtrl, BM_GETCHECK, 0, 0 ) )
00088     NodeProps.dwAttributes |= ATTRIBUTE_DATA_LOCKED;
00089
00090   if( BST_CHECKED == SendMessage( hReadOnlyCtrl, BM_GETCHECK, 0, 0 ) )
00091     NodeProps.dwAttributes |= ATTRIBUTE_DATA_READONLY;
00092
00093
00094   // Convert to wide characters here for all platforms.  This is the node name
00095   TCHAR szBuff[ MAX_NAME_LEN ] = {0};
00096   GetWindowText( hDevNameCtrl, szBuff, MAX_NAME_LEN );
00097   CopyT2W( NodeProps.szNodeName, szBuff, MAX_NAME_LEN);
00098   // Probably a good idea to check for NULL name strings here
00099
00100   // This message passes the user supplied info to the Static Node
00101   SendMessage( m_hParentWnd, WM_ADD_VIRTUALFILE, (WPARAM)&NodeProps, 0 );
00102
00103   // Now tell the static node we are deleting ourselves so the
00104   // context menu option can be enabled
00105   SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00106
00107   // Call the base class to shut down the dialog
00108   CBaseDialog::OnOK( hDlg, wParam, lParam );
00109   return 0;
00110 }
00111
00112 /////////////////////////////////////////////////////////////////////////////
00113 //  Virtual function implementations
00114
00115 //---------------------------------------------------------------------------
00116 BOOL CAddVFileDlg::ProcessMessage
00117 (
00118   HWND     hDlg,           //[in] Handle to dialog box
00119   UINT     uMsg,           //[in] Message
00120   WPARAM   wParam,         //[in] First message parameter
00121   LPARAM   lParam          //[in] Second message parameter
00122 )
00123 {
00124   LRESULT lResult = 0;
00125
00126   switch( uMsg )
00127   {
00128     case WM_INITDIALOG:
00129       lResult = OnInitDialog( hDlg, wParam, lParam );
00130       break;
00131
00132     case WM_DESTROY:
00133       lResult = OnDestroy( hDlg, wParam, lParam );
00134       break;
00135
00136     case WM_NCDESTROY:
00137       lResult = OnNcDestroy( hDlg, wParam, lParam );
00138       break;
00139
00140     case WM_CLOSE:
00141       // Not overriding WM_CLOSE and IDCANCEL so we must send
00142       // WM_DEVICENODE_CLOSED before calling the base class or else
00143       // the context menu will stay grayed
00144       SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00145       lResult = OnClose( hDlg, wParam, lParam );
00146       break;
00147
00148     case WM_COMMAND:
00149       switch( wParam )
00150       {
00151         case IDOK:
00152           lResult = OnOK( hDlg, wParam, lParam );
00153           break;
00154
00155         case IDCANCEL:
00156           SendMessage( m_hParentWnd, WM_VIRTUALFILE_CLOSED, 0, 0 );
00157           lResult = OnCancel( hDlg, wParam, lParam );
00158           break;
00159
00160         default:
00161           break;
00162       }
00163     default:
00164       break;
00165   }
00166   return (BOOL)lResult;
00167 }
00168
00169
00170
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/state.h Source File

  • Begin
  • sdkdiff

state.h

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010 #ifndef __STATE_H__
00011 #define __STATE_H__
00012
00013 /*
00014  * sdkdiff - windows file and directory comparisons
00015  *
00016  * state.h
00017  *
00018  * definition of the results of comparisons for files and for lines
00019  * within files.
00020  *
00021  * These need to be globally declared so that the UI code in sdkdiff.cpp can
00022  * map states to the colour scheme (to correctly highlight changed lines).
00023  *
00024  * They apply to files (compitem_getstate() ) and to sections in the
00025  * composite list (section_getstate). All lines within a section have the
00026  * same state. The UI code will use the view_getstate() function to find the
00027  * state for a given line on the screen.
00028  *
00029  */
00030
00031 /* applies to both lines or files: they are the same */
00032 #define STATE_SAME    1
00033
00034 /* applies to files.  Same size, date, time */
00035 #define STATE_COMPARABLE  2
00036
00037 /* applies to files.  Different, but only in blanks
00038  * This state only turns up after the file has been expanded.
00039  */
00040 #define STATE_SIMILAR   3
00041
00042 /* applies only to files */
00043
00044 /* - files differ (and can be expanded) */
00045 #define STATE_DIFFER    4
00046
00047 /* they are only in the left or right tree */
00048 #define STATE_FILELEFTONLY  5
00049 #define STATE_FILERIGHTONLY 6
00050
00051
00052 /* applies to lines only */
00053
00054 /* the line only exists in one of the lists */
00055 #define STATE_LEFTONLY    7 /* line only in left file */
00056 #define STATE_RIGHTONLY   8 /* line only in right file */
00057
00058
00059 /* the line is the same in both files, but in
00060  * different places (thus the line will appear twice in the composite list,
00061  * once with each of these two states
00062  */
00063 #define STATE_MOVEDLEFT   9 /* this is the left file version */
00064 #define STATE_MOVEDRIGHT  10  /* this is the right file version*/
00065
00066
00067 #define STATE_SIMILARLEFT 11      /* this is the left file zebra version */
00068 #define STATE_SIMILARRIGHT      12  /* this is the right file zebra version*/
00069
00070 /* In processing the sections to build the composite list, we need to
00071  * track which sections have been processed.  After this the left and
00072  * right lists of sections are of no further interest
00073  */
00074 #define STATE_MARKED    99
00075
00076 #endif
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAsyncXXX< T, ISyncFace, IAsyncFace > Member List

This is the complete list of members for CAsyncXXX< T, ISyncFace, IAsyncFace >, including all inherited members.
ActiveComponents() | CUnknown | [inline, protected, static]
AutoQI(DWORD dwCreateOpts) | CUnknown | [inline, virtual]
AutoRelease() | CUnknown | [inline, virtual]
CAsyncXXX() | CAsyncXXX< T, ISyncFace, IAsyncFace > | [inline, private]
CAsyncXXX(LPUNKNOWN lpUnk, REFIID iid) | CAsyncXXX< T, ISyncFace, IAsyncFace > | [private]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
Create(LPUNKNOWN lpUnkCtrl, REFIID riid1, REFIID riid2, T *pT, ISyncFace *lpSyncface) | CAsyncXXX< T, ISyncFace, IAsyncFace > | [static]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CUnknown(IUnknown *pUnknownOuter, LPCSTR className="CUnknown") | CUnknown | [protected]
CUnknown(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CUnknown | [inline]
DisplayObject() | CBase | [virtual]
FinalRelease() | CAsyncXXX< T, ISyncFace, IAsyncFace > | [virtual]
FinishQI(IUnknown *pI, REFIID iid, void **ppv) | CUnknown | [protected]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CUnknown | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CUnknown | [inline, virtual]
GetISync() | CAsyncXXX< T, ISyncFace, IAsyncFace > | [inline]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CUnknown | [inline, virtual]
GetObjectMenu() | CUnknown | [inline, virtual]
GetObjectName() | CUnknown | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetOuterUnknown() const | CUnknown | [inline]
GetParent(SOURCE eSource) | CBase | [virtual]
IAsyncFace class | CAsyncXXX< T, ISyncFace, IAsyncFace > | [friend]
Init(const CFactoryData *pData) | CAsyncXXX< T, ISyncFace, IAsyncFace > | [private, virtual]
Init(T *pT, ISyncFace *lpSyncface) | CAsyncXXX< T, ISyncFace, IAsyncFace > | [private, virtual]
CUnknown::Init() | CUnknown | [inline, protected, virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_iid | CAsyncXXX< T, ISyncFace, IAsyncFace > | [private]
m_lpObj | CAsyncXXX< T, ISyncFace, IAsyncFace > | [private]
m_lpSyncface | CAsyncXXX< T, ISyncFace, IAsyncFace > | [private]
m_lpUnkSync | CAsyncXXX< T, ISyncFace, IAsyncFace > | [private]
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
NondelegatingAddRef() | CUnknown | [protected, virtual]
NondelegatingQueryInterface(const IID &iid, void **ppv) | CAsyncXXX< T, ISyncFace, IAsyncFace > | [virtual]
NondelegatingRelease() | CUnknown | [protected, virtual]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
Quit() | CUnknown | [protected, virtual]
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
Reset() | CAsyncXXX< T, ISyncFace, IAsyncFace > |
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
Signal() | CAsyncXXX< T, ISyncFace, IAsyncFace > |
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
Wait(ULONG dwFlags, ULONG dwMilliseconds) | CAsyncXXX< T, ISyncFace, IAsyncFace > |
~CAsyncXXX() | CAsyncXXX< T, ISyncFace, IAsyncFace > | [virtual]
~CBase() | CBase | [virtual]
~CUnknown() | CUnknown | [protected, virtual]
~CUnknown() | CUnknown | [inline, virtual]
Generated on Wed Nov 13 2024 16:55:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SmartCard/SmartCardAPI/SCQuery/SCCommon.Cpp Source File

  • Security
  • SmartCard
  • SmartCardAPI
  • SCQuery

SCCommon.Cpp

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Module:      SCCommon.cpp
00010
00011  Abstract:    Common routines for used by Smart Card enbled application.
00012
00013  Environment: Win32 console, C++ w/SEH
00014
00015 ------------------------------------------------------------------------------*/
00016
00017 ///////////////
00018 //
00019 // INCLUDE
00020 //
00021
00022 #include <tchar.h>
00023 #include <assert.h>
00024 #include <windows.h>
00025 #include <winscard.h>
00026
00027 #include "sccommon.h"
00028
00029
00030 ///////////////
00031 //
00032 // Internal Functions
00033 //
00034
00035 static LONG scSelectFile (IN SCARDHANDLE hCard,
00036                           IN DWORD dwClassCode,
00037                           IN LPBYTE lpbFileName,
00038                           OUT LPDWORD lpdwExtraBytes);
00039
00040
00041 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00042
00043  Function : SCMalloc
00044
00045  Synopsis : Allocate a block of memory and initialize to all 0s.
00046
00047  Parameter: - IN DWORD dwSize
00048
00049               Size of memory to allocate in bytes.
00050
00051  Return   : Pointer to allocated memory block or NULL. Memory allocated must be
00052             freed with SCFree().
00053
00054 ------------------------------------------------------------------------------*/
00055
00056 LPVOID SCMalloc (IN DWORD dwSize)
00057 {
00058     return(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize));
00059 }
00060
00061
00062 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00063
00064  Function : SCFree
00065
00066  Synopsis : Free a block of memory previously allocated by SCMalloc().
00067
00068  Parameter: - IN LPVOID lpMemory
00069
00070               Pointer to memory block to be freed.
00071
00072  Return   : SCARD_S_SUCCESS or error code
00073
00074 -----------------------------------------------------------------------------*/
00075
00076 LONG SCFree (IN LPVOID lpMemory)
00077 {
00078     LONG lResult;
00079
00080     //
00081     // Parameters sanity check.
00082     //
00083     assert(lpMemory != NULL);
00084
00085     if (HeapFree(GetProcessHeap(), 0, lpMemory))
00086     {
00087         lResult = SCARD_S_SUCCESS;
00088     }
00089     else
00090     {
00091         lResult = GetLastError();
00092     }
00093
00094     return lResult;
00095 }
00096
00097
00098 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00099
00100  Function : SCListReaders
00101
00102  Synopsis : Return a list of registered Smart Card readers associated with the
00103             specified reader groups.
00104
00105  Parameter: - IN SCARDCONTEXT hContext
00106
00107               Resource manager context returned by SCardEstablishContext(), or
00108               NULL if the query is not directed towards a specific context.
00109
00110             - IN LPCTSTR lpmszReaderGroups
00111
00112               Pointer to multi-string reader group names, or NULL to list all
00113               readers known to the system.
00114
00115             - OUT LPTSTR * lplpmszReaderNames
00116
00117               Receives a pointer to a block of memory containing list of
00118               registered reader names. This block of memory must be freed
00119               with scFree().
00120
00121  Return   : SCARD_S_SUCCESS or error code
00122
00123 ------------------------------------------------------------------------------*/
00124
00125 LONG SCListReaders (IN SCARDCONTEXT hContext,
00126                     IN LPCTSTR lpmszReaderGroups,
00127                     OUT LPTSTR * lplpmszReaderNames)
00128 {
00129     LONG  lResult;
00130     DWORD dwReaders;
00131
00132     //
00133     // Parameters sanity check.
00134     //
00135     assert(lplpmszReaderNames != NULL);
00136
00137     //
00138     // Initialize returned info.
00139     //
00140     * lplpmszReaderNames = NULL;
00141
00142     //
00143     // First find the required buffer length.
00144     //
00145     lResult = SCardListReaders(hContext,
00146                                lpmszReaderGroups,
00147                                NULL,         // NULL to indicate we want to
00148                                &dwReaders);  // know the length of the buffer
00149     if (lResult != SCARD_S_SUCCESS)
00150     {
00151         return lResult;
00152     }
00153
00154     //
00155     // Allocate memory.
00156     //
00157     LPTSTR lpmszReaderNames = (LPTSTR) SCMalloc(dwReaders * sizeof(_TCHAR));
00158
00159     if (lpmszReaderNames == NULL)
00160     {
00161         return ERROR_OUTOFMEMORY;
00162     }
00163
00164     //
00165     // Now actually get the list of reader names.
00166     //
00167     lResult = SCardListReaders(hContext,
00168                                lpmszReaderGroups,
00169                                lpmszReaderNames,
00170                                &dwReaders);
00171     if (lResult == SCARD_S_SUCCESS)
00172     {
00173         //
00174         // Successful, so return pointer to reader names.
00175         //
00176         *lplpmszReaderNames = lpmszReaderNames;
00177     }
00178     else
00179     {
00180         //
00181         // Error occurred, so free memory.
00182         //
00183         SCFree((LPVOID) lpmszReaderNames);
00184     }
00185
00186     return lResult;
00187 }
00188
00189
00190 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00191
00192  Function : SCListCards
00193
00194  Synopsis : Return a list of registered Smart Cards associated with the
00195             specified ATR string.
00196
00197  Parameter: - IN SCARDCONTEXT hContext
00198
00199               Resource manager context returned by SCardEstablishContext(), or
00200               NULL if the query is not directed towards a specific context.
00201
00202             - IN LPCBYTE lpszATR
00203
00204               ATR string of the card to list, or NULL to return all cards known
00205               to the system.
00206
00207             - OUT LPTSTR * lplpmszCardNames
00208
00209               Receives a pointer to a block of memory containing list of
00210               registered card names. This block of memory must be freed
00211               with scFree().
00212
00213  Return   : SCARD_S_SUCCESS or error code
00214
00215 ------------------------------------------------------------------------------*/
00216
00217 LONG SCListCards (IN SCARDCONTEXT hContext,
00218                   IN LPCBYTE lpszATR,
00219                   OUT LPTSTR * lplpmszCardNames)
00220 {
00221     LONG  lResult;
00222     DWORD dwCards;
00223
00224     //
00225     // Parameters sanity check.
00226     //
00227     assert(lplpmszCardNames != NULL);
00228
00229     //
00230     // Initialize returned info.
00231     //
00232     * lplpmszCardNames = NULL;
00233
00234     //
00235     // First find the required buffer length.
00236     //
00237     lResult = SCardListCards(hContext,
00238                              lpszATR,
00239                              NULL,
00240                              0,
00241                              NULL,       // NULL to indicate we want to
00242                              &dwCards);  // know the length of the buffer
00243     if (lResult != SCARD_S_SUCCESS)
00244     {
00245         return lResult;
00246     }
00247
00248     //
00249     // Allocate memory.
00250     //
00251     LPTSTR lpmszCardNames = (LPTSTR) SCMalloc(dwCards * sizeof(_TCHAR));
00252
00253     if (lpmszCardNames == NULL)
00254     {
00255         return ERROR_OUTOFMEMORY;
00256     }
00257
00258     //
00259     // Now actually get the list of card names.
00260     //
00261     lResult = SCardListCards(hContext,
00262                              lpszATR,
00263                              NULL,
00264                              0,
00265                              lpmszCardNames,
00266                              &dwCards);
00267     if (lResult == SCARD_S_SUCCESS)
00268     {
00269         //
00270         // Successful, so return pointer to card names.
00271         //
00272         *lplpmszCardNames = lpmszCardNames;
00273     }
00274     else
00275     {
00276         //
00277         // Error occurred, so free memory.
00278         //
00279         SCFree((LPVOID) lpmszCardNames);
00280     }
00281
00282     return lResult;
00283 }
00284
00285
00286 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00287
00288  Function : SCListGroups
00289
00290  Synopsis : Return a list of registered reader groups.
00291
00292  Parameter: - IN SCARDCONTEXT hContext
00293
00294               Resource manager context returned by SCardEstablishContext(), or
00295               NULL if the query is not directed towards a specific context.
00296
00297             - OUT LPTSTR * lplpmszGroupNames
00298
00299               Receives a pointer to a block of memory containing list of
00300               registered reader group names. This block of memory must be freed
00301               with scFree().
00302
00303  Return   : SCARD_S_SUCCESS or error code
00304
00305 ------------------------------------------------------------------------------*/
00306
00307 LONG SCListGroups (IN SCARDCONTEXT hContext,
00308                    OUT LPTSTR * lplpmszGroupNames)
00309 {
00310     LONG  lResult;
00311     DWORD dwGroups;
00312
00313     //
00314     // Parameters sanity check.
00315     //
00316     assert(lplpmszGroupNames != NULL);
00317
00318     //
00319     // Initialize returned info.
00320     //
00321     * lplpmszGroupNames = NULL;
00322
00323     //
00324     // First find the required buffer length.
00325     //
00326     lResult = SCardListReaderGroups(hContext,
00327                                     NULL,        // NULL to indicate we want to
00328                                     &dwGroups);  // know the length of the buffer
00329     if (lResult != SCARD_S_SUCCESS)
00330     {
00331         return lResult;
00332     }
00333
00334     //
00335     // Allocate memory.
00336     //
00337     LPTSTR lpmszGroupNames = (LPTSTR) SCMalloc(dwGroups * sizeof(_TCHAR));
00338
00339     if (lpmszGroupNames == NULL)
00340     {
00341         return ERROR_OUTOFMEMORY;
00342     }
00343
00344     //
00345     // Now actually get the list of group names.
00346     //
00347     lResult = SCardListReaderGroups(hContext,
00348                                     lpmszGroupNames,
00349                                     &dwGroups);
00350     if (lResult == SCARD_S_SUCCESS)
00351     {
00352         //
00353         // Successful, so return pointer to group names.
00354         //
00355         *lplpmszGroupNames = lpmszGroupNames;
00356     }
00357     else
00358     {
00359         //
00360         // Error occurred, so free memory.
00361         //
00362         SCFree((LPVOID) lpmszGroupNames);
00363     }
00364
00365     return lResult;
00366 }
00367
00368
00369 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00370
00371  Function : SCGetAttrib
00372
00373  Synopsis : Get the current reader attributes for the given card handle. It does
00374             not affect the state of the reader, driver, or card.
00375
00376
00377  Parameter: - IN SCARDHANDLE hCard
00378
00379               Card handle returned by SCardConnect()
00380
00381             - IN DWORD dwAttrId
00382
00383               Identifier for the attribute to get
00384
00385             - OUT LPBYTE * lplpbAttr
00386
00387               Receives a pointer to a block of memory containing the requested
00388               attribute.  This block of memory must be freed with SCFree().
00389
00390  Return   : SCARD_S_SUCCESS or error code
00391
00392 ------------------------------------------------------------------------------*/
00393
00394 LONG SCGetAttrib (IN SCARDHANDLE hCard,
00395                   IN DWORD dwAttrId,
00396                   OUT LPBYTE * lplpbAttr)
00397 {
00398     LONG  lResult;
00399     DWORD dwAttrLen;
00400
00401     //
00402     // Parameters sanity check.
00403     //
00404     assert(lplpbAttr != NULL);
00405
00406     //
00407     // Initialize returned info.
00408     //
00409     * lplpbAttr = NULL;
00410
00411     //
00412     // First find the required buffer length.
00413     //
00414
00415     lResult = SCardGetAttrib(hCard,
00416                              dwAttrId,
00417                              NULL,         // NULL to indicate we want to
00418                              &dwAttrLen);  // know the length of the buffer
00419     if (lResult != SCARD_S_SUCCESS)
00420     {
00421         return lResult;
00422     }
00423
00424     //
00425     // Allocate memory.
00426     //
00427     LPBYTE lpbAttr = (LPBYTE) SCMalloc(dwAttrLen);
00428
00429     if (lpbAttr == NULL)
00430     {
00431         return ERROR_OUTOFMEMORY;
00432     }
00433
00434     //
00435     // Now actually get the attribute.
00436     //
00437     lResult = SCardGetAttrib(hCard,
00438                              dwAttrId,
00439                              lpbAttr,
00440                              &dwAttrLen);
00441     if (lResult == SCARD_S_SUCCESS)
00442     {
00443         //
00444         // Successful, so return pointer to attribute.
00445         //
00446         *lplpbAttr = lpbAttr;
00447     }
00448     else
00449     {
00450         //
00451         // Error occurred, so free memory.
00452         //
00453         SCFree((LPVOID) lpbAttr);
00454     }
00455
00456     return lResult;
00457 }
00458
00459 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00460
00461  Function : SCGetResponse
00462
00463  Synopsis : Get the response data from the card.
00464
00465  Parameter: - IN SCARDHANDLE hCard
00466
00467               Card handle returned by SCardConnect()
00468
00469             - IN DWORD dwLength
00470
00471               Length of response data to retrieve in bytes
00472
00473             - OUT LPBYTE * lplpbResponse
00474
00475               Receives a pointer to a block of memory containing the requested
00476               response data from the card. This block of memory must be freed
00477               with SCFree().
00478
00479  Return   : SCARD_S_SUCCESS or error code
00480
00481 ------------------------------------------------------------------------------*/
00482
00483 LONG SCGetResponse (IN SCARDHANDLE hCard,
00484                     IN DWORD dwLength,
00485                     OUT LPBYTE * lplpbResponse)
00486 {
00487     LONG lResult;
00488
00489     //
00490     // Parameters sanity check.
00491     //
00492     assert(lplpbResponse != NULL);
00493
00494     //
00495     // APDU response data length cannot be larger than 256
00496     //
00497     if (dwLength > 256)
00498     {
00499         return SCARD_E_INVALID_PARAMETER;
00500     }
00501
00502     //
00503     // Initialize returned info.
00504     //
00505     *lplpbResponse = NULL;
00506
00507     //
00508     // Allocate memory.
00509     //
00510     LPBYTE lpbResponse = (LPBYTE) SCMalloc(dwLength + 2);
00511
00512     if (lpbResponse == NULL)
00513     {
00514         return ERROR_OUTOFMEMORY;
00515     }
00516
00517     //
00518     // Construct the Get Response APDU.
00519     // Note that when dwLength is casted to BYTE, 256 would be converted to 0,
00520     // which will be the correct value to indicate 256 bytes.
00521     //
00522     DWORD dwStatusLen = dwLength + 2;
00523     BYTE apdu[5] = {0xc0, 0xc0, 0x00, 0x00, (BYTE) dwLength};
00524
00525     //
00526     // Send APDU to card.
00527     //
00528     lResult = SCardTransmit(hCard,
00529                             SCARD_PCI_T0,
00530                             apdu,
00531                             sizeof(apdu),
00532                             NULL,
00533                             lpbResponse,
00534                             &dwStatusLen);
00535     if (lResult == SCARD_S_SUCCESS)
00536     {
00537         //
00538         // Did we get all the data?
00539         //
00540         if (dwStatusLen == dwLength + 2)
00541         {
00542             //
00543             // Is the data good?
00544             //
00545             if (lpbResponse[dwLength] == 0x90 && lpbResponse[dwLength + 1] == 0x00)
00546             {
00547                 //
00548                 // Successful, so return pointer to response data.
00549                 //
00550                 *lplpbResponse = (LPBYTE) lpbResponse;
00551             }
00552             else
00553             {
00554                 //
00555                 // Error occurred, so free memory
00556                 //
00557                 SCFree(lpbResponse);
00558
00559                 //
00560                 // and return SW1 and SW2 as return code
00561                 //
00562                 lResult = MAKELONG(MAKEWORD(lpbResponse[dwLength + 1],
00563                                             lpbResponse[dwLength]), 0x000);
00564             }
00565         }
00566         else
00567         {
00568             //
00569             // Error occurred, so free memory
00570             //
00571             SCFree(lpbResponse);
00572
00573             //
00574             // and return SW1 and SW2 as return code
00575             //
00576             lResult = MAKELONG(MAKEWORD(lpbResponse[1], lpbResponse[0]), 0x000);
00577         }
00578     }
00579     else
00580     {
00581         //
00582         // Error occurred, so free memory before returning.
00583         //
00584         SCFree(lpbResponse);
00585     }
00586
00587     return lResult;
00588 }
00589
00590
00591 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00592
00593  Function : SCSelectFile
00594
00595  Synopsis : Select a file on the Smart Card.
00596
00597  Parameter: - IN SCARDHANDLE hCard
00598
00599               Card handle returned by SCardConnect()
00600
00601             - IN LPBYTE lpbFileName
00602
00603               Pointer to 2-byte filename to select on the card
00604
00605             - OUT LPDWORD lpdwExtraBytes
00606
00607               Pointer to a DWORD to receive number of extra bytes available from
00608               the card as a consequent of this operation.
00609
00610  Return   : SCARD_S_SUCCESS or error code
00611
00612  Remarks  : Value for APDU Class byte when used for Select File command varies
00613             among different cards. Some cards expect it to be 0xC0, while others
00614             insist on 0x00. To properly handle this inconsistency, we will try
00615             both 0xC0 and 0x00, if necessary.
00616
00617 ------------------------------------------------------------------------------*/
00618
00619 LONG SCSelectFile (IN SCARDHANDLE hCard,
00620                    IN LPBYTE lpbFileName,
00621                    OUT LPDWORD lpdwExtraBytes)
00622 {
00623     LONG lResult;
00624
00625     //
00626     // Parameters sanity check.
00627     //
00628     assert(lpbFileName != NULL);
00629     assert(lpdwExtraBytes != NULL);
00630
00631     //
00632     // Start with 0xC0.
00633     //
00634     lResult = scSelectFile(hCard, 0xC0, lpbFileName, lpdwExtraBytes);
00635     if (lResult == 0x6e00)
00636     {
00637         //
00638         // Try 0x00.
00639         //
00640         lResult = scSelectFile(hCard, 0x00, lpbFileName, lpdwExtraBytes);
00641     }
00642
00643     return lResult;
00644 }
00645
00646
00647 /*++++++++++++++++++++++++++++++++++++++
00648
00649  Function : scSelectFile
00650
00651  Synopsis : Internal. Select a file on the Smart Card.
00652
00653  Parameter: - IN SCARDHANDLE hCard
00654
00655               Card handle returned by SCardConnect()
00656
00657             - IN DWORD dwClassCode
00658
00659               Must be 0xC0 or 0x00
00660
00661             - IN LPBYTE lpbFileName
00662
00663               Pointer to 2-byte filename to select on the card
00664
00665             - OUT LPDWORD lpdwExtraBytes
00666
00667               Pointer to a DWORD to receive number of extra bytes available from
00668               the card as a consequent of this operation.
00669
00670  Return   : SCARD_S_SUCCESS or error code
00671
00672 ----------------------------------------*/
00673
00674 static LONG scSelectFile (IN SCARDHANDLE hCard,
00675                           IN DWORD dwClassCode,
00676                           IN LPBYTE lpbFileName,
00677                           OUT LPDWORD lpdwExtraBytes)
00678 {
00679     LONG lResult;
00680
00681     //
00682     // Initialize returned info.
00683     //
00684     *lpdwExtraBytes = 0;
00685
00686     //
00687     // Construct the Select File APDU
00688     //
00689     BYTE  status[2];
00690     DWORD dwStatusLength = sizeof(status);
00691     BYTE apdu[7] = {(BYTE) dwClassCode, 0xa4, 0x00, 0x00, 0x02,
00692         *lpbFileName, *(lpbFileName + 1)};
00693
00694     //
00695     // Send APDU to card
00696     //
00697     lResult = SCardTransmit(hCard,
00698                             SCARD_PCI_T0,
00699                             apdu,
00700                             sizeof(apdu),
00701                             NULL,
00702                             status,
00703                             &dwStatusLength);
00704
00705     //
00706     // Sanity check
00707     //
00708     assert(dwStatusLength == sizeof(status));
00709
00710     //
00711     // If API successful but card operation failed, then
00712     // return SW1 and SW2 as error code
00713     //
00714     if (lResult == SCARD_S_SUCCESS)
00715     {
00716         if (!(status[0] == 0x90 && status[1] == 0x00))
00717         {
00718             if (status[0] == 0x61)
00719             {
00720                 //
00721                 // Successful, but there might be extra data from the card
00722                 //
00723                 *lpdwExtraBytes = (DWORD) status[1];
00724             }
00725             else
00726             {
00727                 //
00728                 // Card error, so return SW1 and SW2 as error
00729                 //
00730                 lResult = MAKELONG(MAKEWORD(status[1], status[0]), 0x0000);
00731             }
00732         }
00733     }
00734
00735     return lResult;
00736 }
00737
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/AdvClient/stdafx.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • AdvClient

stdafx.cpp

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 // stdafx.cpp : source file that includes just the standard includes
00003 //  AdvClientle.pch will be the pre-compiled header
00004 //  stdafx.obj will contain the pre-compiled type information
00005
00006 #include "stdafx.h"
00007
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Metafile/MfEdit/MfEdit.h Source File

  • Multimedia
  • Gdi
  • Metafile
  • MfEdit

MfEdit.h

Go to the documentation of this file.
00001 /******************************Module*Header*******************************\
00002 * Module Name: mfedit.h
00003 *
00004 * Header file for mfedit
00005 *
00006 * Copyright 1996 - 2000 Microsoft Corporation
00007 *
00008 * Contains all the definitions, global variables, structures, etc
00009 *
00010 * Dependencies:
00011 *
00012 \**************************************************************************/
00013 #define LIGHTGRAY               RGB(192, 192, 192)
00014 #define DARKGRAY                RGB(128, 128, 128)
00015 #define MAX_POINTS              256
00016 #define MAX_POINTS_MF           3
00017 #define MAX_POINTS_BMP          3
00018 #define MAX_FRAME               800
00019 #define MAX_FILE                800
00020 #define MAX_ERR_STRING          128
00021 #define MAX_ARRAYSIZE           256
00022
00023 //
00024 // String ID's
00025 //
00026 #define IDS_INITAPPFAIL   16
00027 #define IDS_LOADACCFAIL   17
00028 #define IDS_MFDEMOCL    18
00029 #define IDS_NOMFFORCPY    19
00030 #define IDS_CNVEMFTO3X    20
00031 #define IDS_GETWMFBTSFAIL 21
00032 #define IDS_MALLOCFAIL    22
00033 #define IDS_GETWMFBTSFAIL2  23
00034 #define IDS_MALLOCFAIL2   24
00035 #define IDS_CPY3XMFTOCLP  25
00036 #define IDS_GETWMFBTSFAIL2X 26
00037 #define IDS_CNVFAIL   27
00038 #define IDS_CPYEMFTOCLP   28
00039 #define IDS_PST3XMF   29
00040 #define IDS_NOINFO3XMFX   30
00041
00042 #define IDS_SAVEMF    32
00043 #define IDS_FILEOPNFAIL   33
00044 #define IDS_MAPFCREFAIL   34
00045 #define IDS_MAPVWMAPFOFAIL  35
00046 #define IDS_GET3XFRMCLPFAIL 36
00047 #define IDS_PSTEMF    37
00048 #define IDS_GETEMFFROMCLPFAIL 38
00049 #define IDS_ERROR   39
00050 #define IDS_NOMFLDFORHTST 40
00051 #define IDS_DLGABOUTCREFAIL 41
00052
00053 #define IDS_LDMSKBM   43
00054 #define IDS_LDBM    44
00055 #define IDS_SVDRAWSFASBM  45
00056 #define IDS_LDMF    46
00057 #define IDS_MUSTESCHTSTMD 47
00058 #define IDS_REC     48
00059 #define IDS_CREMFDCFAIL   49
00060 #define IDS_ADDCMNTFAIL   50
00061
00062 #define IDS_STOP    55
00063 #define IDS_FMT_PLAYMF    56
00064 #define IDS_CREPALFAIL    57
00065
00066 #define IDS_NOMFFORPLAY   61
00067 #define IDS_ALDUSMF   62
00068 #define IDS_DRAWSFCLR   63
00069 #define IDS_PEN     64
00070 #define IDS_TXT     65
00071 #define IDS_RECT    66
00072 #define IDS_FILLRECT    67
00073 #define IDS_ELLIPSE   68
00074 #define IDS_FILLELLIPSE   69
00075 #define IDS_LN      70
00076 #define IDS_MSTLBCLKFORBZ 71
00077 #define IDS_MUST3CLKFORBM 72
00078 #define IDS_MUST3CLKFORXMF  73
00079 #define IDS_NOMFFORPRT    74
00080
00081 #define IDS_CREPRTTHRDFAIL  76
00082 #define IDS_CREPNTFAIL    77
00083 #define IDS_CREPBYTEFAIL  78
00084 #define IDS_NOBMFOREMBED  79
00085 #define IDS_NOMFFOREMBED  80
00086 #define IDS_FT_DIB    81
00087 #define IDS_FM_DIB    82
00088 #define IDS_FT_RLE    83
00089 #define IDS_FM_RLE    84
00090 #define IDS_FT_EPS    85
00091 #define IDS_FM_EPS    86
00092 #define IDS_FT_EMF    87
00093 #define IDS_FM_EMF    88
00094 #define IDS_FT_WMF    89
00095 #define IDS_FM_WMF    90
00096
00097 #define IDS_SAVEMFAS    92
00098 #define IDS_LDMFMTFILEFAIL  93
00099 #define IDS_CREMAPFILEFAIL  94
00100 #define IDS_MAPVWOFMAPFOFAIL  95
00101 #define IDS_NOTDIBBMFILE  96
00102 #define IDS_GETMFBTSXFAIL 97
00103 #define IDS_GETMFBTSXFAIL2  98
00104 #define IDS_LDMSK   99
00105 #define IDS_MALLOCFAILNOHIT 100
00106
00107 #define IDS_NULLRGNHTSTFAIL 102
00108 #define IDS_EMF     103
00109 #define IDS_NOHIT   104
00110 #define IDS_NOMFTOPRT   105
00111 #define IDS_ESCPRT    106
00112 #define IDS_CREPRTDCFAIL  107
00113 #define IDS_PRT     108
00114
00115 #define IDS_PRTTHRDDONE   111
00116 #define IDS_ALLOCPALFAIL  112
00117
00118 #define IDS_HFTONEPALNULL 114
00119 #define IDS_PALNULL   115
00120 #define IDS_MUSTMSKMCHROMEBM  116
00121 #define IDS_NOPALENTRYFORCPY  117
00122 #define IDS_CPYPALFAIL    118
00123
00124 #define IDS_NULLPTR   121
00125 #define IDS_NOTADOBE    122
00126 #define IDS_SKPTOEOL    123
00127 #define IDS_MUSTNOTEOF    124
00128 #define IDS_GETBNDLFTFAIL 125
00129 #define IDS_GETBNDTOPFAIL 126
00130 #define IDS_GETBNDRGTFAIL 127
00131 #define IDS_GETBNDBOTFAIL 128
00132 #define IDS_SETADVGRPHMDFAIL  129
00133
00134 #define IDS_FMT_HIT   131
00135 #define IDS_FMT_NOHTST    132
00136 #define IDS_FMT_PLAYEMFFAIL 133
00137 #define IDS_FMT_FILEOPNFAIL 134
00138 #define IDS_FMT_CREMAPFILEFAIL  135
00139 #define IDS_FMT_MAPVWMAPFOFAIL  136
00140 #define IDS_FMT_SETWMFBTSFAIL 137
00141 #define IDS_FMT_SETWMFBTSXFAIL  138
00142 #define IDS_FMT_PLAYMFFAIL  139
00143 #define IDS_FMT_GETMFFAIL 140
00144
00145 //
00146 // Menu ID's
00147 //
00148 #define MM_LOAD                 7001
00149 #define MM_RECORD               7002
00150 #define MM_PRINT                7003
00151 #define MM_PAGESETUP            7004
00152 #define MM_PRINTSETUP           7005
00153 #define MM_ABOUT                7006
00154 #define MM_CUT                  7007
00155 #define MM_COPY                 7008
00156 #define MM_PASTE                7009
00157 #define MM_DEL                  7010
00158 #define MM_LOAD_BMP             7011
00159 #define MM_SAVE_BMP             7012
00160 #define MM_LOAD_MASKBMP         7013
00161 #define MM_REMOVE               7014
00162 #define MM_INSERT               7015
00163 #define MM_HITTEST              7016
00164 #define MM_REPEAT               7017
00165 #define MM_INCREASE             7018
00166 #define MM_NORMAL               7019
00167 #define MM_DECREASE             7020
00168 #define MM_PEN                  7021
00169 #define MM_BRUSH                7022
00170 #define MM_FONT                 7023
00171 #define MM_LEABOUT              7024
00172 #define MM_FIT2WND              7025
00173 #define MM_IMPORT_3X            7026
00174 #define MM_EXPORT_3X            7027
00175 #define MM_TTOUTLN_STROKEFILL   7028
00176 #define MM_TTOUTLN_POLYDRAW     7029
00177 #define MM_C_WND_MF             7030
00178 #define MM_C_BEGIN_GP           7031
00179 #define MM_C_END_GP             7032
00180 #define MM_C_MLTFMTS            7033
00181
00182 #define SIZEOFCAPTIONTEXT 20
00183
00184 #define ACCEL_ID                100
00185 #define APP_ICON                 100
00186
00187 //
00188 // Control Panel ID's
00189 //
00190 #define OD_BTN_CNT              5
00191 #define DID_CTRLPANEL           100
00192 #define DID_ZERO                1000
00193 #define DID_ONE                 1001
00194 #define DID_TWO                 1002
00195 #define DID_THREE               1003
00196 #define DID_FOUR                1004
00197 #define DID_FIVE                1005
00198 #define DID_SIX                 1006
00199 #define DID_SEVEN               1007
00200 #define DID_EIGHT               1008
00201 #define DID_NINE                1009
00202 #define DID_TEN_PLUS            1010
00203 #define ID_OD_BTN_BASE          1011
00204 #define DID_OPEN                1011
00205 #define DID_RECORD              1012
00206 #define DID_STOP                1013
00207 #define DID_PLAY                1014
00208 #define DID_FF                  1015
00209 #define DID_CLEAR               1016
00210 #define DID_COUNTER             1017
00211 #define DID_TMP                 1018
00212
00213 //
00214 // Control Panel's Owner draw bitmaps
00215 //
00216 #define BMID_BASED              1011
00217 #define BMID_OPEND              1011
00218 #define BMID_RECORDD            1012
00219 #define BMID_STOPD              1013
00220 #define BMID_PLAYD              1014
00221 #define BMID_FFD                1015
00222 #define BMID_BASEU              2011
00223 #define BMID_OPENU              2011
00224 #define BMID_RECORDU            2012
00225 #define BMID_STOPU              2013
00226 #define BMID_PLAYU              2014
00227 #define BMID_FFU                2015
00228
00229 //
00230 // Tools ID's
00231 //
00232 #define OD_TOOL_CNT             10
00233 #define ID_OD_TOOL_BASE         3001
00234 #define DID_PEN                 3001
00235 #define DID_TEXT                3002
00236 #define DID_RECT                3003
00237 #define DID_FILLRECT            3004
00238 #define DID_ELLIPSE             3005
00239 #define DID_FILLELLIPSE         3006
00240 #define DID_LINE                3007
00241 #define DID_BEZIER              3008
00242 #define DID_BMPOBJ              3009
00243 #define DID_METAF               3010
00244
00245 //
00246 // Tools Owner Draw bitmaps
00247 //
00248 #define BMID_TOOLBASED          3001
00249 #define BMID_PEND               3001
00250 #define BMID_TEXTD              3002
00251 #define BMID_RECTD              3003
00252 #define BMID_FILLRECTD          3004
00253 #define BMID_ELLIPSED           3005
00254 #define BMID_FILLELLIPSED       3006
00255 #define BMID_LINED              3007
00256 #define BMID_BEZIERD            3008
00257 #define BMID_BMPOBJD            3009
00258 #define BMID_METAFD             3010
00259 #define BMID_TOOLBASEU          4001
00260 #define BMID_PENU               4001
00261 #define BMID_TEXTU              4002
00262 #define BMID_RECTU              4003
00263 #define BMID_FILLRECTU          4004
00264 #define BMID_ELLIPSEU           4005
00265 #define BMID_FILLELLIPSEU       4006
00266 #define BMID_LINEU              4007
00267 #define BMID_BEZIERU            4008
00268 #define BMID_BMPOBJU            4009
00269 #define BMID_METAFU             4010
00270
00271 //
00272 // some handy macros
00273 //
00274 #define GET_WM_CTLCOLOR_HDC(wp, lp, msg)        (HDC)(wp)
00275 #define GET_WM_CTLCOLOR_HWND(wp, lp, msg)       (HWND)(lp)
00276 #define GET_WM_CTLCOLOR_TYPE(wp, lp, msg)       (WORD)(msg - WM_CTLCOLORMSGBOX)
00277
00278 #define META32_SIGNATURE        0x464D4520      // ' EMF'
00279 #define ALDUS_ID    0x9AC6CDD7
00280
00281 #define CARET_HEIGHT    16
00282
00283 typedef struct
00284   {
00285   DWORD   key;
00286   WORD          hmf;
00287   SMALL_RECT    bbox;
00288   WORD    inch;
00289   DWORD   reserved;
00290   WORD    checksum;
00291   } APMFILEHEADER;
00292 typedef APMFILEHEADER * PAPMFILEHEADER;
00293 #define APMSIZE 22
00294
00295
00296 #ifndef RC_INVOKED
00297 #pragma pack(2)
00298 typedef struct tagMETA16HEADER
00299 {
00300     WORD  mtType;
00301     WORD  mtHeaderSize;
00302     WORD  mtVersion;
00303     DWORD mtSize;
00304     WORD  mtNoObjects;
00305     DWORD mtMaxRecord;
00306     WORD  mtNoParameters;
00307 } META16HEADER, LPMETA16HEADER;
00308 #pragma pack()
00309
00310 #endif // RC_INVOKED
00311
00312
00313 typedef struct _playinfo {
00314     int iRecord;
00315     BOOL bPlayContinuous;
00316 } PLAYINFO;
00317
00318 typedef struct _metalookup {
00319     LPSTR   szGDIName;
00320     int     iMRNumber;
00321 } METALOOKUP;
00322
00323 typedef struct _htdata {
00324     POINT   point;
00325     int     iRecord;
00326 } HTDATA;
00327
00328 METALOOKUP rgMetaName[] =
00329 {
00330    { "                           ", 0                              },
00331    { "HEADER                     ", EMR_HEADER                     },
00332    { "POLYBEZIER                 ", EMR_POLYBEZIER                 },
00333    { "POLYGON                    ", EMR_POLYGON                    },
00334    { "POLYLINE                   ", EMR_POLYLINE                   },
00335    { "POLYBEZIERTO               ", EMR_POLYBEZIERTO               },
00336    { "POLYLINETO                 ", EMR_POLYLINETO                 },
00337    { "POLYPOLYLINE               ", EMR_POLYPOLYLINE               },
00338    { "POLYPOLYGON                ", EMR_POLYPOLYGON                },
00339    { "SETWINDOWEXTEX             ", EMR_SETWINDOWEXTEX             },
00340    { "SETWINDOWORGEX             ", EMR_SETWINDOWORGEX             },
00341    { "SETVIEWPORTEXTEX           ", EMR_SETVIEWPORTEXTEX           },
00342    { "SETVIEWPORTORGEX           ", EMR_SETVIEWPORTORGEX           },
00343    { "SETBRUSHORGEX              ", EMR_SETBRUSHORGEX              },
00344    { "EOF                        ", EMR_EOF                        },
00345    { "SETPIXELV                  ", EMR_SETPIXELV                  },
00346    { "SETMAPPERFLAGS             ", EMR_SETMAPPERFLAGS             },
00347    { "SETMAPMODE                 ", EMR_SETMAPMODE                 },
00348    { "SETBKMODE                  ", EMR_SETBKMODE                  },
00349    { "SETPOLYFILLMODE            ", EMR_SETPOLYFILLMODE            },
00350    { "SETROP2                    ", EMR_SETROP2                    },
00351    { "SETSTRETCHBLTMODE          ", EMR_SETSTRETCHBLTMODE          },
00352    { "SETTEXTALIGN               ", EMR_SETTEXTALIGN               },
00353    { "SETCOLORADJUSTMENT         ", EMR_SETCOLORADJUSTMENT         },
00354    { "SETTEXTCOLOR               ", EMR_SETTEXTCOLOR               },
00355    { "SETBKCOLOR                 ", EMR_SETBKCOLOR                 },
00356    { "OFFSETCLIPRGN              ", EMR_OFFSETCLIPRGN              },
00357    { "MOVETOEX                   ", EMR_MOVETOEX                   },
00358    { "SETMETARGN                 ", EMR_SETMETARGN                 },
00359    { "EXCLUDECLIPRECT            ", EMR_EXCLUDECLIPRECT            },
00360    { "INTERSECTCLIPRECT          ", EMR_INTERSECTCLIPRECT          },
00361    { "SCALEVIEWPORTEXTEX         ", EMR_SCALEVIEWPORTEXTEX         },
00362    { "SCALEWINDOWEXTEX           ", EMR_SCALEWINDOWEXTEX           },
00363    { "SAVEDC                     ", EMR_SAVEDC                     },
00364    { "RESTOREDC                  ", EMR_RESTOREDC                  },
00365    { "SETWORLDTRANSFORM          ", EMR_SETWORLDTRANSFORM          },
00366    { "MODIFYWORLDTRANSFORM       ", EMR_MODIFYWORLDTRANSFORM       },
00367    { "SELECTOBJECT               ", EMR_SELECTOBJECT               },
00368    { "CREATEPEN                  ", EMR_CREATEPEN                  },
00369    { "CREATEBRUSHINDIRECT        ", EMR_CREATEBRUSHINDIRECT        },
00370    { "DELETEOBJECT               ", EMR_DELETEOBJECT               },
00371    { "ANGLEARC                   ", EMR_ANGLEARC                   },
00372    { "ELLIPSE                    ", EMR_ELLIPSE                    },
00373    { "RECTANGLE                  ", EMR_RECTANGLE                  },
00374    { "ROUNDRECT                  ", EMR_ROUNDRECT                  },
00375    { "ARC                        ", EMR_ARC                        },
00376    { "CHORD                      ", EMR_CHORD                      },
00377    { "PIE                        ", EMR_PIE                        },
00378    { "SELECTPALETTE              ", EMR_SELECTPALETTE              },
00379    { "CREATEPALETTE              ", EMR_CREATEPALETTE              },
00380    { "SETPALETTEENTRIES          ", EMR_SETPALETTEENTRIES          },
00381    { "RESIZEPALETTE              ", EMR_RESIZEPALETTE              },
00382    { "REALIZEPALETTE             ", EMR_REALIZEPALETTE             },
00383    { "EXTFLOODFILL               ", EMR_EXTFLOODFILL               },
00384    { "LINETO                     ", EMR_LINETO                     },
00385    { "ARCTO                      ", EMR_ARCTO                      },
00386    { "POLYDRAW                   ", EMR_POLYDRAW                   },
00387    { "SETARCDIRECTION            ", EMR_SETARCDIRECTION            },
00388    { "SETMITERLIMIT              ", EMR_SETMITERLIMIT              },
00389    { "BEGINPATH                  ", EMR_BEGINPATH                  },
00390    { "ENDPATH                    ", EMR_ENDPATH                    },
00391    { "CLOSEFIGURE                ", EMR_CLOSEFIGURE                },
00392    { "FILLPATH                   ", EMR_FILLPATH                   },
00393    { "STROKEANDFILLPATH          ", EMR_STROKEANDFILLPATH          },
00394    { "STROKEPATH                 ", EMR_STROKEPATH                 },
00395    { "FLATTENPATH                ", EMR_FLATTENPATH                },
00396    { "WIDENPATH                  ", EMR_WIDENPATH                  },
00397    { "SELECTCLIPPATH             ", EMR_SELECTCLIPPATH             },
00398    { "ABORTPATH                  ", EMR_ABORTPATH                  },
00399    { "UNKNOWN                    ", 69                             },
00400    { "GDICOMMENT                 ", EMR_GDICOMMENT                 },
00401    { "FILLRGN                    ", EMR_FILLRGN                    },
00402    { "FRAMERGN                   ", EMR_FRAMERGN                   },
00403    { "INVERTRGN                  ", EMR_INVERTRGN                  },
00404    { "PAINTRGN                   ", EMR_PAINTRGN                   },
00405    { "EXTSELECTCLIPRGN           ", EMR_EXTSELECTCLIPRGN           },
00406    { "BITBLT                     ", EMR_BITBLT                     },
00407    { "STRETCHBLT                 ", EMR_STRETCHBLT                 },
00408    { "MASKBLT                    ", EMR_MASKBLT                    },
00409    { "PLGBLT                     ", EMR_PLGBLT                     },
00410    { "SETDIBITSTODEVICE          ", EMR_SETDIBITSTODEVICE          },
00411    { "STRETCHDIBITS              ", EMR_STRETCHDIBITS              },
00412    { "EXTCREATEFONTINDIRECTW     ", EMR_EXTCREATEFONTINDIRECTW     },
00413    { "EXTTEXTOUTA                ", EMR_EXTTEXTOUTA                },
00414    { "EXTTEXTOUTW                ", EMR_EXTTEXTOUTW                },
00415    { "POLYBEZIER16               ", EMR_POLYBEZIER16               },
00416    { "POLYGON16                  ", EMR_POLYGON16                  },
00417    { "POLYLINE16                 ", EMR_POLYLINE16                 },
00418    { "POLYBEZIERTO16             ", EMR_POLYBEZIERTO16             },
00419    { "POLYLINETO16               ", EMR_POLYLINETO16               },
00420    { "POLYPOLYLINE16             ", EMR_POLYPOLYLINE16             },
00421    { "POLYPOLYGON16              ", EMR_POLYPOLYGON16              },
00422    { "POLYDRAW16                 ", EMR_POLYDRAW16                 },
00423    { "CREATEMONOBRUSH            ", EMR_CREATEMONOBRUSH            },
00424    { "CREATEDIBPATTERNBRUSHPT    ", EMR_CREATEDIBPATTERNBRUSHPT    },
00425    { "EXTCREATEPEN               ", EMR_EXTCREATEPEN               },
00426    { "POLYTEXTOUTA               ", EMR_POLYTEXTOUTA               },
00427    { "POLYTEXTOUTW               ", EMR_POLYTEXTOUTW               },
00428    { "SETICMMODE                 ", EMR_SETICMMODE                 },
00429    { "CREATECOLORSPACE           ", EMR_CREATECOLORSPACE           },
00430    { "SETCOLORSPACE              ", EMR_SETCOLORSPACE              },
00431    { "DELETECOLORSPACE           ", EMR_DELETECOLORSPACE           },
00432 #ifdef OPENGL_EMF
00433    { "GLSRECORD                  ", EMR_GLSRECORD                  },
00434    { "GLSBOUNDEDRECORD           ", EMR_GLSBOUNDEDRECORD           },
00435    { "PIXELFORMAT                ", EMR_PIXELFORMAT                },
00436 #endif
00437 };
00438
00439 typedef struct _PRTDATA {
00440     BOOL            bFit2Wnd;
00441     HENHMETAFILE    hMetaf;
00442 } PRTDATA, *PPRTDATA;
00443
00444 PROC    gpfnGetEnhMetaFilePixelFormat = (PROC)NULL;
00445
00446 HANDLE  ghModule;
00447 HWND    ghwndMain   = NULL;
00448 HWND    ghwndClient = NULL;
00449 HWND    ghwndDrawSurf = NULL;
00450 HWND    ghwndCtrlPanel = NULL;
00451 HWND    ghwndTools = NULL;
00452 HWND    ghTextWnd = NULL;
00453 HPALETTE ghPal = NULL;
00454 HPALETTE ghHT = NULL;
00455
00456 LONG    glcyStatus;
00457 BOOL    gbRecording = FALSE;
00458 BOOL    gbHitTest = FALSE;
00459
00460 #if 0   // STRICT doesn't like this
00461 HWND    grHwndCtrlBtn[OD_BTN_CNT];
00462 HWND    grHwndToolBtn[OD_TOOL_CNT];
00463 #endif
00464 PVOID   grHwndCtrlBtn[OD_BTN_CNT];
00465 PVOID   grHwndToolBtn[OD_TOOL_CNT];
00466
00467 DWORD_PTR   gdwCurCtrl = DID_STOP;
00468 DWORD_PTR   gdwCurTool = DID_PEN;
00469
00470 HFONT    ghCurFont = (HFONT)NULL;
00471 LOGFONT  glf;
00472 COLORREF gCrText=0;                         // Black
00473
00474 HMENU   hMenu,      hMenuWindow;
00475 HMENU   hChildMenu, hChildMenuWindow;
00476 HDC     ghDCMem;
00477 HDC     ghDCMetaf = (HDC) NULL;
00478 HENHMETAFILE ghMetaf = NULL;
00479 HMETAFILE ghmf=NULL;
00480
00481 HBITMAP ghBmp = NULL, ghBmpMask = NULL;
00482
00483 #if 0   // STRICT doesn't like this
00484 HBITMAP ghBmpDn[OD_BTN_CNT], ghBmpUp[OD_BTN_CNT];
00485 HBITMAP ghToolBmpDn[OD_TOOL_CNT], ghToolBmpUp[OD_TOOL_CNT];
00486 #endif
00487 PVOID   ghBmpDn[OD_BTN_CNT], ghBmpUp[OD_BTN_CNT];
00488 PVOID   ghToolBmpDn[OD_TOOL_CNT], ghToolBmpUp[OD_TOOL_CNT];
00489
00490 HBRUSH  ghbrRed;
00491 HBRUSH  ghbrCur = (HBRUSH)NULL;
00492 HPEN    ghpnCur = (HPEN)NULL;
00493 HBRUSH  ghbrAppBkgd;
00494 HPEN    ghpnWide;
00495
00496 HWND    ghwndNext = NULL;
00497 BOOL    gbFit2Wnd = TRUE;
00498 BOOL    gbImport3X = FALSE;
00499 BOOL    gbExport3X = FALSE;
00500 BOOL    gbSFOutln = FALSE;
00501 BOOL    gbPDOutln = FALSE;
00502 BOOL    gbTT = FALSE;
00503 BOOL    gb3D = FALSE;
00504 BOOL    gbRCSet = FALSE;
00505 BOOL    gbDebug = FALSE;
00506 BOOL    gbUseMfPFD = TRUE;
00507 BOOL    gbDB = FALSE;
00508
00509 BOOL    gbUseDIB = FALSE;
00510
00511 typedef struct _FileInfo{
00512     HANDLE      hFile;
00513     HANDLE      hMapFile;
00514     LPVOID      lpvMapView;
00515 } FILEINFO, *PFILEINFO;
00516
00517 typedef struct _DIBDATA{
00518     ULONG           ulFiles;
00519     ULONG           ulFrames;
00520     FILEINFO        rgFileInfo[MAX_FILE];
00521     PBYTE           rgpjFrame[MAX_FRAME];
00522     PBITMAPINFO     rgpbmi[MAX_FILE];
00523     BOOL            rgbCoreHdr[MAX_FILE];
00524 } DIBDATA, *PDIBDATA;
00525
00526 DIBDATA gDib;
00527
00528 typedef struct tagCMTMLTFMT {
00529     DWORD       ident;
00530     DWORD       iComment;
00531     RECTL       rclOutput;
00532     DWORD       nFormats;
00533     EMRFORMAT   aemrformat[1];
00534 } CMTMLTFMT;
00535
00536 #define GDICOMMENT_IDENTIFIER   0x43494447
00537 #define GDICOMMENT_MULTIFORMATS 0x40000004
00538
00539 #define BLACK               PALETTERGB(0,0,0)
00540 #define WHITE               PALETTERGB(255,255,255)
00541 #define NUM_STATIC_COLORS   (COLOR_BTNHIGHLIGHT - COLOR_SCROLLBAR + 1)
00542
00543 // Maximum color distance with 8-bit components
00544 #define MAX_COL_DIST (3*256*256L)
00545
00546 // Number of static colors
00547 #define STATIC_COLORS 20
00548
00549 // Flags used when matching colors
00550 #define EXACT_MATCH 1
00551 #define COLOR_USED 1
00552 #define GAMMA_CORRECTION 14
00553
00554 // TRUE if app wants to take over palette
00555 static BOOL gbUseStaticColors = FALSE;
00556
00557 // TRUE if static system color settings have been replaced with B&W settings.
00558 static BOOL gbSystemColorsInUse = FALSE;
00559
00560 // TRUE if static colors have been saved
00561 static BOOL gbStaticSaved = FALSE;
00562
00563 // saved system static colors
00564 static COLORREF gacrSave[NUM_STATIC_COLORS];
00565
00566 // new B&W system static colors
00567 static COLORREF gacrBlackAndWhite[NUM_STATIC_COLORS] = {
00568     WHITE,  // COLOR_SCROLLBAR
00569     BLACK,  // COLOR_BACKGROUND
00570     BLACK,  // COLOR_ACTIVECAPTION
00571     WHITE,  // COLOR_INACTIVECAPTION
00572     WHITE,  // COLOR_MENU
00573     WHITE,  // COLOR_WINDOW
00574     BLACK,  // COLOR_WINDOWFRAME
00575     BLACK,  // COLOR_MENUTEXT
00576     BLACK,  // COLOR_WINDOWTEXT
00577     WHITE,  // COLOR_CAPTIONTEXT
00578     WHITE,  // COLOR_ACTIVEBORDER
00579     WHITE,  // COLOR_INACTIVEBORDER
00580     WHITE,  // COLOR_APPWORKSPACE
00581     BLACK,  // COLOR_HIGHLIGHT
00582     WHITE,  // COLOR_HIGHLIGHTTEXT
00583     WHITE,  // COLOR_BTNFACE
00584     BLACK,  // COLOR_BTNSHADOW
00585     BLACK,  // COLOR_GRAYTEXT
00586     BLACK,  // COLOR_BTNTEXT
00587     BLACK,  // COLOR_INACTIVECAPTIONTEXT
00588     BLACK   // COLOR_BTNHIGHLIGHT
00589     };
00590 static INT gaiStaticIndex[NUM_STATIC_COLORS] = {
00591     COLOR_SCROLLBAR          ,
00592     COLOR_BACKGROUND         ,
00593     COLOR_ACTIVECAPTION      ,
00594     COLOR_INACTIVECAPTION    ,
00595     COLOR_MENU               ,
00596     COLOR_WINDOW             ,
00597     COLOR_WINDOWFRAME        ,
00598     COLOR_MENUTEXT           ,
00599     COLOR_WINDOWTEXT         ,
00600     COLOR_CAPTIONTEXT        ,
00601     COLOR_ACTIVEBORDER       ,
00602     COLOR_INACTIVEBORDER     ,
00603     COLOR_APPWORKSPACE       ,
00604     COLOR_HIGHLIGHT          ,
00605     COLOR_HIGHLIGHTTEXT      ,
00606     COLOR_BTNFACE            ,
00607     COLOR_BTNSHADOW          ,
00608     COLOR_GRAYTEXT           ,
00609     COLOR_BTNTEXT            ,
00610     COLOR_INACTIVECAPTIONTEXT,
00611     COLOR_BTNHIGHLIGHT
00612     };
00613
00614 static VOID SaveStaticEntries(HDC);
00615 static VOID UseStaticEntries(HDC);
00616
00617 //
00618 // Forward declarations.
00619 //
00620 BOOL InitializeApp   (void);
00621 LONG_PTR APIENTRY MainWndProc     (HWND, UINT, WPARAM, LPARAM);
00622 LONG_PTR APIENTRY DrawSurfWndProc (HWND, UINT, WPARAM, LPARAM);
00623 BOOL CALLBACK About           (HWND, UINT, WPARAM, LPARAM);
00624 LONG_PTR APIENTRY TextWndProc     (HWND, UINT, WPARAM, LPARAM);
00625 LONG_PTR APIENTRY CtrlPanelDlgProc(HWND, UINT, WPARAM, LPARAM);
00626 BOOL bDrawStuff      (HDC, INT, INT, INT, INT, BOOL, BOOL, BOOL, LPSTR);
00627 HENHMETAFILE hemfLoadMetafile(HWND);
00628 HDC  hDCRecordMetafileAs(HWND, LPSTR);
00629 BOOL APIENTRY bPlayRecord(HDC, LPHANDLETABLE, LPENHMETARECORD, UINT, LPVOID);
00630 BOOL APIENTRY bDoHitTest(HDC, LPHANDLETABLE, LPENHMETARECORD, UINT, LPVOID);
00631 BOOL bHitTest(HDC, INT, INT);
00632 HBITMAP hBmpLoadBitmapFile(HDC, PSTR);
00633 BOOL bGetBMP(HWND, BOOL);
00634 BOOL bChooseNewFont(HWND, PLOGFONT, COLORREF * );
00635 BOOL bChooseNewColor(HWND, LPDWORD);
00636 BOOL bPrintMf(PPRTDATA);
00637 HBRUSH hBrCreateBrush(HDC, DWORD);
00638 BOOL bSelectDIBPal(HDC, LPBITMAPINFO, BOOL);
00639 BOOL bFreeDibFile(PDIBDATA);
00640 BOOL bPlgBlt(HDC, LPPOINT);
00641 HPALETTE CopyPalette(HPALETTE hPalSrc);
00642 int CALLBACK iTT(LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM);
00643 CMTMLTFMT *pLoadMltFmtFile(VOID);
00644 HLOCAL Free(CMTMLTFMT *pMfmt);
00645 BOOL bGetEPSBounds(LPVOID, RECTL *);
00646 BOOL bIsAdobe(char *szStr);
00647 BOOL bIsEPS(char *szStr);
00648 BOOL bIsBndBox(char *szStr);
00649 BOOL bIsEOF(char *szStr);
00650 //BOOL bGetWord(LPVOID, char *, char **);
00651 //BOOL bGoNextLine(LPVOID, char **);
00652 BOOL bGetWord(LPVOID, char *, int*);
00653 BOOL bGoNextLine(LPVOID, int*);
00654 BOOL bSetAdvancedGraphics(HDC hdc);
00655
00656 //extern unsigned char __stdcall ComponentFromIndex(INT, INT, INT);
00657 //extern int aiDefaultOverride[20];
00658 //extern PALETTEENTRY apeDefaultPalEntry[20];
00659
00660
00661 BOOL bCleanUpRC(VOID);
00662 BOOL bSetupRC(HDC hDC, PIXELFORMATDESCRIPTOR *ppfdIn);
00663
00664 //
00665 // function prototype for looking up string resources
00666 //
00667
00668 LPTSTR GetStringRes (int);
00669 LPTSTR GetStringRes2 (int);
00670 LPTSTR BuildFilterStrs(int);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/FileRepAsyncPipe/Service.h Source File

  • NetDS
  • RPC
  • FileRep
  • FileRepAsyncPipe

Service.h

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: Service.h
00008
00009     PURPOSE: Provides file replication service function declarations.
00010
00011     FUNCTIONS:
00012
00013     COMMENTS: These funtions may be used by the main service routines
00014         as well as by the client and server file replication RPC routines.
00015
00016 */
00017 #pragma once
00018
00019 #include "Resources.h"
00020
00021 // Name of the executable
00022 #define APPNAME TEXT("FileRepService")
00023
00024 // Internal name of the service
00025 #define SERVICENAME TEXT("FileRepService")
00026
00027 // Displayed name of the service
00028 #define SERVICEDISPLAYNAME TEXT("File Replication Service")
00029
00030 // List of service dependencies
00031 #define DEPENDENCIES TEXT("RPCSS\0\0")
00032
00033 #ifdef PROF
00034 #include "Prof.h"
00035 #endif
00036
00037 // The maximum number of concurrent requests that can be handled
00038 // by the server system service for each of the priority groups.
00039 extern const UINT ServerReqBounds[];
00040
00041 // The maximum number of requests that can be placed to the client
00042 // system service from each user group.
00043 extern const UINT ClientReqBounds[];
00044
00045 // The maximum number of concurrent requests that a client system
00046 // service will handle.
00047 extern const UINT ClientActiveReqBounds[];
00048
00049 // The maximum number of concurrent requests that a server system
00050 // service will handle.
00051 extern const UINT ServerActiveReqBounds[];
00052
00053 // The number of priority groups.
00054 extern const UINT NumPriGroups;
00055
00056 extern Counter *pClientReqCounters[];
00057 extern Counter *pClientActiveReqCounters[];
00058
00059 extern Counter *pServerReqCounters[];
00060 extern Counter *pServerActiveReqCounters[];
00061
00062 // Keeps queued requests.
00063 extern Queue *ClientReqQueues[];
00064 extern Queue *ServerReqQueues[];
00065
00066 #ifdef DEBUG1
00067 // Keeps requests that are being handled.
00068 // Used to detect leaked requests.
00069 extern Queue *ClientActiveReqQueue;
00070 extern Queue *ServerActiveReqQueue;
00071 #endif
00072
00073 // Conteins the number of requests that are being
00074 // handled for each user.
00075 extern Queue *ClientActiveReqHashCounters[];
00076 extern Queue *ServerActiveReqHashCounters[];
00077
00078 // The maximum number of requests for a single
00079 // user that can be handled simultaneously.
00080 extern const UINT MaxUserReqs;
00081
00082 // The priority of regular users.
00083 // A separate queue is maintained for
00084 // scheduling each user's requests.
00085 extern const UINT RegUsersPri;
00086
00087 extern BOOL bServerListening;
00088
00089 // status handle of the service
00090 extern SERVICE_STATUS_HANDLE sshStatusHandle;
00091
00092 // current status of the service
00093 extern SERVICE_STATUS ssStatus;
00094
00095 extern BOOL bNoFileIO;
00096
00097 extern PSID pSystemSID;
00098 extern PSID pAdminSID;
00099 extern PSID pAnonSID;
00100
00101 /*
00102     Prototypes for shared service functions.
00103     See function definitions in Service.cpp for help.
00104 */
00105
00106 PSID GetUserSID();
00107
00108 PTOKEN_GROUPS GetUserGroups();
00109
00110 BOOL IsGroupMember(PSID pSID, PTOKEN_GROUPS pGroupInfo);
00111
00112 VOID CreateWellKnownSids(VOID);
00113
00114 VOID DeleteWellKnownSids(VOID);
00115
00116 UINT GetCurrentUserPriority(VOID);
00117
00118 BOOL ReportStatusToSCMgr(SERVICE_STATUS_HANDLE *sshStatusHandle,
00119                          SERVICE_STATUS *ssStatus,
00120                          DWORD dwCurrentState,
00121                          DWORD dwWin32ExitCode,
00122                          DWORD dwWaitHint);
00123
00124 VOID AddToMessageLog(LPTSTR lpszMsg);
00125
00126 VOID AddToMessageLogProcFailure(LPTSTR ProcName, DWORD ErrCode);
00127
00128 VOID AddToMessageLogProcFailureEEInfo(LPTSTR ProcName, DWORD ErrCode);
00129
00130 VOID AddRpcEEInfo(DWORD Status, LPTSTR Msg);
00131
00132 VOID AddRpcEEInfoAndRaiseException(DWORD Status, LPTSTR Msg);
00133
00134 // RPC heap size bounds.
00135 #define RPC_HEAP_SIZE_INIT (1024*1024)
00136 #define RPC_HEAP_SIZE_MAX (128*1024*1024)
00137
00138 // Heap for use by midl_user_allocate and midl_user_free.
00139 extern HANDLE RpcHeap;
00140
00141 VOID * AutoHeapAlloc(size_t dwBytes);
00142
00143 VOID AutoHeapFree(VOID * lpMem);
00144
00145 BOOL StartFileRepServer (VOID);
00146 VOID ServerStop (VOID);
00147
00148 // end Service.h
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/CPartitionInfo.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

CPartitionInfo.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      CPartitionInfo.h
00005 //
00006 //  Description:
00007 //      This file contains the declaration of the CPartitionInfo
00008 //      class.
00009 //
00010 //      The class CPartitionInfo represents a disk partition.
00011 //      It implements the IClusCfgPartitionInfo interface.
00012 //
00013 //  Implementation Files:
00014 //      CPartitionInfo.cpp
00015 //
00016 //////////////////////////////////////////////////////////////////////////////
00017
00018 #pragma once
00019
00020
00021 //////////////////////////////////////////////////////////////////////////////
00022 // Include Files
00023 //////////////////////////////////////////////////////////////////////////////
00024
00025 #include "stdafx.h"
00026 #include "CMgdClusCfgInit.h"
00027
00028
00029 //////////////////////////////////////////////////////////////////////////////
00030 // Constant Declarations
00031 //////////////////////////////////////////////////////////////////////////////
00032
00033
00034 //////////////////////////////////////////////////////////////////////////////
00035 //++
00036 //
00037 //  class CPartitionInfo
00038 //
00039 //  Description:
00040 //      The class CPartitionInfo represents a disk partition.
00041 //
00042 //  Interfaces:
00043 //      IClusCfgPartitionInfo
00044 //      IWMIService
00045 //      IWMIObject
00046 //      IPartitionProperties
00047 //      IClusCfgInitialize
00048 //--
00049 //////////////////////////////////////////////////////////////////////////////
00050 class CPartitionInfo
00051     : public IClusCfgPartitionInfo
00052     , public IWMIServices
00053     , public IWMIObject
00054     , public IPartitionProperties
00055     , public CMgdClusCfgInit
00056     , public CComCoClass< CPartitionInfo, &CLSID_CPartitionInfo >
00057 {
00058 public:
00059
00060 BEGIN_COM_MAP( CPartitionInfo )
00061     COM_INTERFACE_ENTRY( IClusCfgPartitionInfo )
00062     COM_INTERFACE_ENTRY( IWMIServices )
00063     COM_INTERFACE_ENTRY( IWMIObject )
00064     COM_INTERFACE_ENTRY( IClusCfgInitialize )
00065     COM_INTERFACE_ENTRY( IPartitionProperties )
00066 END_COM_MAP();
00067
00068 DECLARE_NOT_AGGREGATABLE( CPartitionInfo )
00069
00070 #pragma warning( push, 3 )
00071 #pragma warning( disable : 4995 ) // warning C4995: '<x>': name was marked as #pragma deprecated
00072 DECLARE_REGISTRY_RESOURCEID( IDR_CPartitionInfo )
00073 #pragma warning( pop )
00074
00075 private:
00076
00077     //
00078     // Private member functions and data
00079     //
00080
00081     LONG                m_cRef;
00082     LCID                m_lcid;
00083     IWbemServices *     m_pIWbemServices;
00084     BSTR                m_bstrName;
00085     BSTR                m_bstrUID;
00086     BSTR                m_bstrDescription;
00087     IUnknown *          ((*m_prgLogicalDisks)[]);
00088     ULONG               m_idxNextLogicalDisk;
00089     ULONG               m_ulPartitionSize;
00090     BSTR                m_bstrDiskDeviceID;
00091
00092     //
00093     //  Private copy constructor to prevent copying of this COM object.
00094     //
00095
00096     CPartitionInfo( const CPartitionInfo & nodeSrc );
00097
00098     //
00099     //  Private assignment operator to prevent copying of this COM object.
00100     //
00101
00102     const CPartitionInfo & operator = ( const CPartitionInfo & nodeSrc );
00103
00104     HRESULT HrAddLogicalDiskToArray( IWbemClassObject * pDiskIn );
00105     HRESULT HrGetLogicalDisks( IWbemClassObject * pPartitionIn );
00106     HRESULT HrLogLogicalDiskInfo( IWbemClassObject * pLogicalDiskIn, BSTR bstrDeviceIDIn );
00107
00108 public:
00109
00110     //
00111     //  Public constructor & destructor.
00112     //
00113
00114     CPartitionInfo( void );
00115     virtual ~CPartitionInfo( void );
00116
00117     //
00118     // IWMIServices Interface
00119     //
00120
00121     STDMETHOD( SetWbemServices )( IWbemServices * pIWbemServicesIn );
00122
00123     //
00124     // IWMIObject Interfaces
00125     //
00126
00127     STDMETHOD( SetWbemObject )( IWbemClassObject * pPartitionIn, BOOL * pfRetainObjectOut );
00128
00129     //
00130     // IClusCfgManagedResourceInfo Interface
00131     //
00132
00133     STDMETHOD( GetUID )( BSTR * pbstrUIDOut );
00134     STDMETHOD( GetName )( BSTR * pbstrNameOut );
00135     STDMETHOD( SetName )( LPCWSTR bstrNameIn );
00136     STDMETHOD( GetDescription )( BSTR * pbstrDescriptionOut );
00137     STDMETHOD( SetDescription )( LPCWSTR bstrDescriptionIn );
00138     STDMETHOD( GetDriveLetterMappings )( SDriveLetterMapping * pdlmDriveLetterUsageOut );
00139     STDMETHOD( SetDriveLetterMappings )( SDriveLetterMapping dlmDriveLetterMappingIn );
00140     STDMETHOD( GetSize )( ULONG * pcMegaBytes );
00141
00142     //
00143     // IPartitionProperties Interface
00144     //
00145
00146     STDMETHOD( HrIsThisLogicalDisk )( WCHAR cLogicalDisk );
00147     STDMETHOD( HrIsNTFS )( void );
00148     STDMETHOD( HrGetFriendlyName )( BSTR * pbstrNameOut );
00149     STDMETHOD( HrSetDeviceID )( BSTR bstrDeviceIDIn );
00150
00151 }; //*** class CPartitionInfo
00152
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DropTgt.h Source File

  • WinUI
  • Shell
  • DragImg

DropTgt.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DropTgt.h
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include <windows.h>
00023 #include <ole2.h>
00024 #include <shlobj.h>
00025
00026 /**************************************************************************
00027    class definitions
00028 **************************************************************************/
00029
00030 class CDropTarget : public IDropTarget
00031 {
00032 private:
00033    ULONG m_cRefCount;
00034    BOOL m_fAcceptFmt;
00035    IDropTargetHelper *m_pDropTargetHelper;
00036
00037    //Utility function to read type of drag from key state
00038    BOOL QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect);
00039    void DisplayFileNames(HWND, HGLOBAL);
00040
00041 public:
00042    CDropTarget(void);
00043    ~CDropTarget(void);
00044
00045    // IUnknown methods
00046    STDMETHOD(QueryInterface)(REFIID, LPVOID*);
00047    STDMETHOD_(ULONG, AddRef)(void);
00048    STDMETHOD_(ULONG, Release)(void);
00049
00050    // IDropTarget methods
00051    STDMETHOD(DragEnter)(LPDATAOBJECT, DWORD, POINTL, LPDWORD);
00052    STDMETHOD(DragOver)(DWORD, POINTL, LPDWORD);
00053    STDMETHOD(DragLeave)(void);
00054    STDMETHOD(Drop)(LPDATAOBJECT, DWORD, POINTL, LPDWORD);
00055 };
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextSamplePropPage/ContextSamplePropPage.idl Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification
  • ContextSamplePropPage

ContextSamplePropPage.idl

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows Media Technologies
00004 //  Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 //  File:       ContextSamplePropPage.idl
00007 //
00008 //  Contents:
00009 //
00010 //--------------------------------------------------------------------------
00011 // This file will be processed by the MIDL tool to
00012 // produce the type library (ContextSamplePropPage.tlb) and marshalling code.
00013
00014 cpp_quote("//+-------------------------------------------------------------------------")
00015 cpp_quote("//")
00016 cpp_quote("//  Microsoft Windows Media Technologies")
00017 cpp_quote("//  Copyright (C) Microsoft Corporation. All rights reserved.")
00018 cpp_quote("//")
00019 cpp_quote("//  Automatically generated by Midl from ContextSamplePropPage.idl")
00020 cpp_quote("//")
00021 cpp_quote("//  DO NOT EDIT THIS FILE.")
00022 cpp_quote("//")
00023 cpp_quote("//--------------------------------------------------------------------------")
00024
00025
00026 import "oaidl.idl";
00027 import "ocidl.idl";
00028
00029 // {2B8E10C3-4DFE-4e4f-9BCC-2F01F611244B}
00030 //cpp_quote( "EXTERN_GUID( LIBID_CONTEXTSAMPLEPROPPAGELib, 0x2b8e10c3, 0x4dfe, 0x4e4f, 0x9b, 0xcc, 0x2f, 0x1, 0xf6, 0x11, 0x24, 0x4b);" )
00031 // {2B8E10C4-4DFE-4e4f-9BCC-2F01F611244B}
00032 //cpp_quote( "EXTERN_GUID( CLSID_ContextSamplePropPage, 0x2b8e10c4, 0x4dfe, 0x4e4f, 0x9b, 0xcc, 0x2f, 0x1, 0xf6, 0x11, 0x24, 0x4b);" )
00033
00034
00035 [
00036   uuid(2B8E10C3-4DFE-4e4f-9BCC-2F01F611244B),
00037   version(9.0),
00038   helpstring("ContextSamplePropPage 9.0 Type Library")
00039 ]
00040 library CONTEXTSAMPLEPROPPAGELib
00041 {
00042   importlib("stdole32.tlb");
00043   importlib("stdole2.tlb");
00044
00045
00046   [
00047     uuid(2B8E10C4-4DFE-4e4f-9BCC-2F01F611244B),
00048     helpstring("ContextSamplePropPage Class")
00049   ]
00050   coclass ContextSamplePropPage
00051   {
00052     interface IUnknown;
00053   };
00054 };
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/gcallusers/vc/gcallusers.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • gcallusers
  • vc

gcallusers.cpp

Go to the documentation of this file.
00001 // gcallusers.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include <wchar.h>
00005 #include <activeds.h>
00006
00007 HRESULT FindAllUsersInGC();
00008
00009 int main(int argc, char* argv[])
00010 {
00011 //Initialize COM
00012 CoInitialize(NULL);
00013
00014 HRESULT hr = S_OK;
00015 wprintf(L"This program finds all users in the forest\nby searching the global catalog.\n");
00016 wprintf(L"------------------------------\n");
00017
00018 hr = FindAllUsersInGC();
00019 if (FAILED(hr))
00020   wprintf(L"Search for all users failed with hr: %d\n", hr);
00021 // Uninitialize COM
00022 CoUninitialize();
00023 return 0;
00024 }
00025
00026 HRESULT FindAllUsersInGC()
00027 {
00028     HRESULT hr = E_FAIL;
00029     HRESULT hrGC = S_OK;
00030
00031   VARIANT var;
00032   ULONG lFetch;
00033
00034     // Interface Pointers
00035     IDirectorySearch *pGCSearch = NULL;
00036   IADsContainer *pContainer = NULL;
00037     IUnknown *pUnk = NULL;
00038   IEnumVARIANT *pEnum = NULL;
00039     IDispatch *pDisp = NULL;
00040     IADs *pADs = NULL;
00041
00042   //Bind to Global Catalog
00043     hr = ADsOpenObject(L"GC:",  //NT 4.0, Win9.x client must include the servername, e.g GC://myServer
00044          NULL,
00045          NULL,
00046          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00047          IID_IADsContainer,
00048          (void**)&pContainer);
00049
00050   if (SUCCEEDED(hr))
00051   {
00052        hr = pContainer->get__NewEnum( &pUnk );
00053        if (SUCCEEDED(hr))
00054      {
00055       hr = pUnk->QueryInterface( IID_IEnumVARIANT, (void**) &pEnum );
00056       if (SUCCEEDED(hr))
00057       {
00058       // Now Enumerate--there should be only one item.
00059       hr = pEnum->Next( 1, &var, &lFetch );
00060       if (SUCCEEDED(hr))
00061       {
00062         while( hr == S_OK )
00063         {
00064           if ( lFetch == 1 )
00065           {
00066             pDisp = V_DISPATCH(&var);
00067             hr = pDisp->QueryInterface( IID_IDirectorySearch, (void**)&pGCSearch);
00068             hrGC = hr;
00069           }
00070           VariantClear(&var);
00071           hr = pEnum->Next( 1, &var, &lFetch );
00072         };
00073       }
00074       }
00075         if (pEnum)
00076           pEnum->Release();
00077      }
00078        if (pUnk)
00079        pUnk->Release();
00080   }
00081   if (pContainer)
00082     pContainer->Release();
00083
00084
00085   if (FAILED(hrGC))
00086   {
00087     if (pGCSearch)
00088       pGCSearch->Release();
00089     return hrGC;
00090   }
00091
00092   //Create search filter
00093   LPOLESTR pszSearchFilter = L"(&(objectCategory=person)(objectClass=user))";
00094     //Search entire subtree from root.
00095   ADS_SEARCHPREF_INFO SearchPrefs;
00096   SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00097   SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
00098   SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
00099     DWORD dwNumPrefs = 1;
00100
00101   // COL for iterations
00102     ADS_SEARCH_COLUMN col;
00103
00104     // Handle used for searching
00105     ADS_SEARCH_HANDLE hSearch;
00106
00107   // Set the search preference
00108     hr = pGCSearch->SetSearchPreference( &SearchPrefs, dwNumPrefs);
00109     if (FAILED(hr))
00110         return hr;
00111   // Set attributes to return
00112   CONST DWORD dwAttrNameSize = 2;
00113     LPOLESTR pszAttribute[dwAttrNameSize] = {L"cn",L"distinguishedName"};
00114
00115     // Execute the search
00116     hr = pGCSearch->ExecuteSearch(pszSearchFilter,
00117                               pszAttribute,
00118                   dwAttrNameSize,
00119                   &hSearch
00120                   );
00121   if ( SUCCEEDED(hr) )
00122   {
00123
00124     // Call IDirectorySearch::GetNextRow() to retrieve the next row
00125     //of data
00126         while( pGCSearch->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
00127     {
00128
00129             // loop through the array of passed column names,
00130             // print the data for each column
00131             for (DWORD x = 0; x < dwAttrNameSize; x++)
00132             {
00133
00134           // Get the data for this column
00135                 hr = pGCSearch->GetColumn( hSearch, pszAttribute[x], &col );
00136
00137           if ( SUCCEEDED(hr) )
00138           {
00139             // Print the data for the column and free the column
00140           // Note the attributes we asked for are type CaseIgnoreString.
00141                     wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString);
00142             pGCSearch->FreeColumn( &col );
00143           }
00144           else
00145             wprintf(L"<%s property is not a string>",pszAttribute[x]);
00146             }
00147         wprintf(L"------------------------------\n");
00148     }
00149
00150     // Close the search handle to clean up
00151         pGCSearch->CloseSearchHandle(hSearch);
00152   }
00153   if (pGCSearch)
00154     pGCSearch->Release();
00155     return hr;
00156 }
00157
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/inc/rcusync.h Source File

  • NetDS
  • RRas
  • rqs
  • inc

rcusync.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RcuSync.h
00004 //
00005 //      Synopsis:   Sychronization objects.
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011
00012 #pragma once
00013
00014 #ifndef __RcuSync_h
00015 #define __RcuSync_h
00016
00017 #ifdef __cplusplus
00018
00019 class RcuSecurityDescriptor;  // TODO: Remove this when it is designed/implemented
00020
00021 //+----------------------------------------------------------------------------
00022 //
00023 // Synopsis: Critical section object
00024 //
00025 //-----------------------------------------------------------------------------
00026 class RcuCritSec
00027 {
00028 public:
00029     RcuCritSec();
00030     ~RcuCritSec();
00031
00032     HRESULT
00033     Initialize();
00034
00035     HRESULT
00036     Enter();
00037
00038     VOID
00039     Leave();
00040
00041 private:
00042     CRITICAL_SECTION m_CritSec;
00043     BOOL m_fInitialized;
00044 };
00045
00046 //+----------------------------------------------------------------------------
00047 //
00048 // Synopsis: Event object
00049 //
00050 //-----------------------------------------------------------------------------
00051 enum RcuEventState
00052 {
00053     SIGNALED,
00054     NONSIGNALED
00055 };
00056
00057 class RcuEvent
00058 {
00059 public:
00060     RcuEvent();
00061     ~RcuEvent();
00062
00063     HRESULT
00064     Initialize(
00065         IN RcuEventState esInitialState,
00066         IN BOOL fManualReset,
00067         IN BOOL fInherit = FALSE,
00068         IN RcuSecurityDescriptor* pSD = NULL);
00069
00070     HANDLE
00071     GetHandle() const
00072     {
00073         return m_hEvent;
00074     }
00075
00076     HRESULT
00077     SetState(
00078         IN RcuEventState esState)
00079     {
00080         return (SIGNALED == esState) ? Set() : Reset();
00081     }
00082
00083     HRESULT
00084     Set();
00085
00086     HRESULT
00087     Reset();
00088
00089     HRESULT
00090     Pulse();
00091
00092 private:
00093     HANDLE m_hEvent;
00094 };
00095
00096 //+----------------------------------------------------------------------------
00097 //
00098 // Synopsis: Multiple-reader-single-writer lock
00099 //
00100 //-----------------------------------------------------------------------------
00101
00102 enum RcuRwLockRole
00103 {
00104     READER,
00105     WRITER
00106 };
00107
00108 class RcuRwLock
00109 {
00110 public:
00111     RcuRwLock();
00112     ~RcuRwLock();
00113
00114     HRESULT
00115     Initialize();
00116
00117     HRESULT
00118     Lock(
00119         IN RcuRwLockRole Role);
00120
00121     HRESULT
00122     Unlock(
00123         IN RcuRwLockRole Role);
00124
00125 private:
00126     RcuCritSec* m_pcsLock;
00127     RcuEvent* m_peNoReaders;
00128     LONG m_lCounter;
00129 };
00130
00131
00132
00133
00134 #endif
00135 #endif
00136
00137
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Inc/CARGUIDS.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • Inc

CARGUIDS.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CARGUIDS.H
00003
00004   Summary:   This is the common include file for the Car-related COM
00005              Interfaces and COM Objects. GUIDs are defined for the
00006              Interfaces and CLSIDs are defined for the COM objects made
00007              using those interfaces.
00008
00009              This file is global to all the Tutorial Code Samples (kept
00010              in the ..\INC directory).  It is a good practice to
00011              factor out Interface and GUID specifications to reduce the
00012              possibility of GUID or interface conflicts.
00013
00014   Classes:   .
00015
00016   Functions: .
00017
00018   Origin:    10-7-95: atrent - Factored out of COMOBJ and DLLSERVE.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 #if !defined(CARGUIDS_H)
00036 #define CARGUIDS_H
00037
00038 #if !defined(RC_INCLUDE)
00039
00040 /*---------------------------------------------------------------------------
00041   Here are the IIDs for the interfaces of the Car-related
00042   COM components in the DLLSERVE, DLLCLIEN, and later code samples.
00043 ---------------------------------------------------------------------------*/
00044 DEFINE_GUID(IID_ICar,
00045   0x0002da00, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00046
00047 DEFINE_GUID(IID_IUtility,
00048   0x0002da01, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00049
00050 DEFINE_GUID(IID_ICruise,
00051   0x0002da02, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00052
00053 DEFINE_GUID(IID_ISample,
00054   0x0002da03, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00055
00056
00057 /*---------------------------------------------------------------------------
00058   Here are the CLSIDs for the Class Factories of the Car-related
00059   COM components in the DLLSERVE and DLLCLIEN code samples.
00060 ---------------------------------------------------------------------------*/
00061 DEFINE_GUID(CLSID_DllCar,
00062   0x0002da04, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00063
00064 DEFINE_GUID(CLSID_DllUtilityCar,
00065   0x0002da05, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00066
00067 DEFINE_GUID(CLSID_DllCruiseCar,
00068   0x0002da06, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00069
00070 DEFINE_GUID(CLSID_DllCarSample,
00071   0x0002da07, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00072
00073
00074 /*---------------------------------------------------------------------------
00075   Here are the CLSIDs for the Class Factories of the Car-related
00076   COM components in the LICSERVE and LICCLIEN code samples.
00077 ---------------------------------------------------------------------------*/
00078 DEFINE_GUID(CLSID_LicCruiseCar,
00079   0x0002da08, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00080
00081 DEFINE_GUID(CLSID_LicCarSample,
00082   0x0002da09, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00083
00084
00085 /*---------------------------------------------------------------------------
00086   Here are the CLSIDs for the Class Factories of the Car-related
00087   COM components in the LOCSERVE and LOCCLIEN code samples.
00088 ---------------------------------------------------------------------------*/
00089 DEFINE_GUID(CLSID_LocCar,
00090   0x0002da0a, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00091
00092 DEFINE_GUID(CLSID_LocUtilityCar,
00093   0x0002da0b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00094
00095 DEFINE_GUID(CLSID_LocCruiseCar,
00096   0x0002da0c, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00097
00098
00099 /*---------------------------------------------------------------------------
00100   Here are the CLSIDs for the Class Factories of the Car-related
00101   COM components in the APTSERVE and APTCLIEN code samples.
00102 ---------------------------------------------------------------------------*/
00103 DEFINE_GUID(CLSID_AptCar,
00104   0x0002da0d, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00105
00106 DEFINE_GUID(CLSID_AptUtilityCar,
00107   0x0002da0e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00108
00109 DEFINE_GUID(CLSID_AptCruiseCar,
00110   0x0002da0f, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
00111
00112
00113 #endif // RC_INCLUDE
00114
00115 #endif // CARGUIDS_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/Util.Cpp Source File

  • Web
  • NetMeeting
  • NMFT

Util.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMFT.EXE
00003 //  File:       UTIL.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 static TCHAR _szFilter[] = TEXT("All Files\0*.*\0Text Files (*.txt)\0*.TXT\0");
00019 static TCHAR _szPickMsg[] = TEXT("Select a file to send");
00020
00021
00022 //****************************************************************************
00023 //
00024 // BOOL FGetFileName(LPTSTR szFileName)
00025 //
00026 //****************************************************************************
00027
00028 BOOL FGetFileName(LPTSTR szFileName)
00029 {
00030   OPENFILENAME ofn;
00031
00032   if  (NULL == szFileName)
00033     return FALSE;
00034
00035   szFileName[0] = 0;
00036
00037   ZeroMemory(&ofn, sizeof(OPENFILENAME));
00038
00039   ofn.lStructSize   = sizeof(OPENFILENAME);
00040   ofn.hwndOwner     = ghwndMain;
00041   ofn.hInstance     = (HINSTANCE) ghInst;
00042   ofn.lpstrFilter   = _szFilter;
00043   ofn.nFilterIndex  = 1L;
00044   ofn.lpstrFile     = szFileName;
00045   ofn.nMaxFile      = MAX_PATH; // really max characters for szFileName
00046   ofn.lpstrTitle    = _szPickMsg;
00047   ofn.lpstrInitialDir = NULL;
00048   ofn.Flags = OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER;
00049
00050   return GetOpenFileName(&ofn);
00051 }
00052
00053
00054 //****************************************************************************
00055 //
00056 // BOOL FFileExists(LPCTSTR szFile)
00057 //
00058 //****************************************************************************
00059
00060 BOOL FFileExists(LPCTSTR szFile)
00061 {
00062   HANDLE hFile  = 0;
00063
00064   if ((NULL == szFile) || (_T('\0') == *szFile))
00065     return FALSE;
00066
00067   UINT uErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
00068   hFile = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
00069     NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
00070   SetErrorMode(uErrorMode); // Restore error mode
00071
00072   if (hFile == INVALID_HANDLE_VALUE)
00073     return FALSE;
00074
00075   CloseHandle(hFile);
00076   return TRUE;
00077 }
00078
00079
00080 //****************************************************************************
00081 //
00082 // LPVOID LpvAlloc(int cb)
00083 //
00084 // Return a pointer to an allocated array of bytes
00085 //
00086 //****************************************************************************
00087
00088 LPVOID LpvAlloc(int cb)
00089 {
00090   return LocalAlloc(LMEM_FIXED, cb);
00091 }
00092
00093
00094 //****************************************************************************
00095 //
00096 // LPTSTR PszAlloc(int cch)
00097 //
00098 //****************************************************************************
00099
00100 LPTSTR PszAlloc(int cch)
00101 {
00102   return (LPTSTR) LocalAlloc(LMEM_FIXED, sizeof(TCHAR) * (cch+1));
00103 }
00104
00105
00106 //****************************************************************************
00107 //
00108 // VOID FreePlpv(LPVOID plpv)
00109 //
00110 // Free the data pointed to by plpv and set *plpv to NULL
00111 //
00112 //****************************************************************************
00113
00114 VOID FreePlpv(LPVOID plpv)
00115 {
00116   if ((plpv == NULL) || (*(VOID FAR * FAR *)plpv == NULL)) {
00117     return;
00118   }
00119
00120   LocalFree(*(VOID FAR * FAR *)plpv);
00121   *(VOID FAR * FAR *)plpv = NULL;
00122 }
00123
00124
00125 //****************************************************************************
00126 //
00127 // LPCTSTR StrChr(LPCTSTR pcsz, TCHAR ch)
00128 //
00129 //****************************************************************************
00130
00131 LPCTSTR StrChr(LPCTSTR pcsz, TCHAR ch)
00132 {
00133     LPCTSTR pcszFound = NULL;
00134
00135     if (pcsz)
00136     {
00137         while (*pcsz)
00138         {
00139             if (*pcsz == ch)
00140             {
00141                 pcszFound = pcsz;
00142                 break;
00143             }
00144
00145             pcsz = CharNext(pcsz);
00146         }
00147     }
00148
00149     return pcszFound;
00150 }
00151
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBankDlg Member List

This is the complete list of members for CBankDlg, including all inherited members.
CBankDlg() | CBankDlg |
ConsumeAllMessages() | CBankDlg | [private]
DoWork(CThreadData *pData, int nTestType) | CBankDlg | [private]
GetThreadData(THREADDATA *pTd) | CBankDlg |
IDD enum value | CBankDlg |
LoadAll() | CBankDlg |
m_cd | CBankDlg | [private]
m_hCreateThread | CBankDlg | [private]
m_hFile | CBankDlg | [private]
m_hMenu | CBankDlg | [private]
m_list | CBankDlg | [private]
m_nMaxRowLength | CBankDlg | [private]
m_nMsgs | CBankDlg | [private]
m_nSuiteIndex | CBankDlg | [private]
m_nTotalTests | CBankDlg | [private]
m_pCurrentThreadData | CBankDlg | [private]
OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnAssertOnErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CBankDlg |
OnCopy(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnCopyAll(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnCopyErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnCreateRows(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnCreateTables(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CBankDlg |
OnGo(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CBankDlg |
OnInitMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CBankDlg |
OnKillThreads(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnRandom(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnRetryOnErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnRunSuite(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnSelectAccount(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnSelectChattyDisplay(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnSelectCoInit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnSelectCreatePerIteration(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnSelectLanguage(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnSelectMoveMoney(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnShowError(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CBankDlg |
OnShowResults(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CBankDlg |
OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CBankDlg |
OnStop(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnStopOnODBCErrors(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnViewNext(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
OnViewPrev(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CBankDlg |
SaveAll() | CBankDlg |
SetDescription(THREADDATA *pData) | CBankDlg | [private]
SetThreadData(THREADDATA *pTd) | CBankDlg |
UpdateStatus(CThreadData *pData, int nCurItem) | CBankDlg | [private]
~CBankDlg() | CBankDlg |
Generated on Wed Nov 13 2024 16:55:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/CRUCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

CRUCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CRUCAR.H
00003
00004   Summary:   Include file for the aggregatable COCruiseCar COM object class.
00005
00006              CRUCAR showcases the construction of the COCruiseCar COM
00007              object class with the IUnknown, ICar, and ICruise interfaces.
00008              This is done through Aggregation reuse of a COCar COM
00009              object (specifically providing its ICar interface features).
00010
00011              This multiple interface COM Object Class is achieved via
00012              the technique of nested classes: the implementation of the
00013              ICar and ICruise interfaces are nested inside of the
00014              COCruiseCar COM object class.
00015
00016              For a comprehensive tutorial code tour of this module's
00017              contents and offerings see the tutorial DLLSERVE.HTM file.
00018              For more specific technical details on the internal workings
00019              see the comments dispersed throughout the module's source code.
00020
00021   Classes:   COCruiseCar.
00022
00023   Functions: .
00024
00025   Origin:    9-11-95: atrent - Editor-inheritance from CRUCAR.H in
00026                the COMOBJ Tutorial Code Sample.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 #if !defined(CRUCAR_H)
00044 #define CRUCAR_H
00045
00046 #ifdef __cplusplus
00047
00048 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00049   ObjectClass: COCruiseCar
00050
00051   Summary:     COM Object Class for COCruiseCar COM Objects.  COM objects
00052                of this class augment COCar COM objects (which offer ICar
00053                interface features of Shift, Clutch, Speed, and Steer) with
00054                ICruise interface features (Engage and Adjust).  This
00055                COCruiseCar COM object class is constructed by aggregation
00056                reuse of the COCar COM object class.  The mulitple
00057                interfaces on this COM object class are constructed via
00058                the nested interface classes technique.
00059
00060   Interfaces:  IUnknown
00061                  Standard interface providing COM object features.
00062                ICar
00063                  Basic Car operation features.
00064                ICruise
00065                  Cruise control features.
00066
00067   Aggregation: Yes, COCruiseCar COM objects are aggregatable by passing
00068                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00069 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00070 class COCruiseCar : public IUnknown
00071 {
00072   public:
00073     // Main Object Constructor & Destructor.
00074     COCruiseCar(IUnknown* pUnkOuter, CServer* pServer);
00075     ~COCruiseCar(void);
00076
00077     // A general method for initializing a newly created COCruiseCar.
00078     HRESULT Init(void);
00079
00080     // IUnknown methods. Main object, non-delegating.
00081     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00082     STDMETHODIMP_(ULONG) AddRef(void);
00083     STDMETHODIMP_(ULONG) Release(void);
00084
00085   private:
00086     // We declare nested class interface implementations here.
00087
00088     // We implement the ICruise interface (ofcourse) in this COCruiseCar
00089     // COM object class.  This is the interface that we are using as an
00090     // augmentation to the existing COCar COM object class.
00091     class CImpICruise : public ICruise
00092     {
00093       public:
00094         // Interface Implementation Constructor & Destructor.
00095         CImpICruise(COCruiseCar* pBackObj, IUnknown* pUnkOuter);
00096         ~CImpICruise(void);
00097
00098         // IUnknown methods.
00099         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00100         STDMETHODIMP_(ULONG) AddRef(void);
00101         STDMETHODIMP_(ULONG) Release(void);
00102
00103         // ICruise methods.
00104         STDMETHODIMP Engage(BOOL bOnOff);
00105         STDMETHODIMP Adjust(BOOL bUpDown);
00106
00107       private:
00108         // Data private to this interface implementation of ICruise.
00109         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00110         COCruiseCar*  m_pBackObj;    // Parent Object back pointer.
00111         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00112     };
00113
00114     // Make the otherwise private and nested ICar interface implementation
00115     // a friend to COM object instantiations of this selfsame COCruiseCar
00116     // COM object class.
00117     friend CImpICruise;
00118
00119     // Private data of COCruiseCar COM objects.
00120
00121     // Nested ICruise implementation instantiation.  This ICruise interface
00122     // is implemented inside this COCruiseCar object as a native interface.
00123     CImpICruise     m_ImpICruise;
00124
00125     // Main Object reference count.
00126     ULONG           m_cRefs;
00127
00128     // Outer unknown (aggregation & delegation). Used when this COCruiseCar
00129     // object is being aggregated.  Otherwise it is used for delegation
00130     // if this object is reused via containment.
00131     IUnknown*       m_pUnkOuter;
00132
00133     // We need to save the IUnknown interface pointer on the COCar
00134     // object that we aggregate.  We use this when we need to delegate
00135     // IUnknown calls to this aggregated inner object.
00136     IUnknown*       m_pUnkCar;
00137
00138     // Pointer to this component server's control object.
00139     CServer*        m_pServer;
00140 };
00141
00142 typedef COCruiseCar* PCOCruiseCar;
00143
00144 #endif // __cplusplus
00145
00146
00147 #endif // CRUCAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/BasicRecognition/resource.h Source File

  • TabletPC
  • BasicRecognition

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by BasicRecognition.rc
00004 //
00005 #define IDR_MENU                        101
00006 #define IDR_ICON                        102
00007 #define IDI_ICON                        103
00008 #define ID_RECOGNIZE                    40001
00009 #define ID_CLEAR                        40002
00010
00011 // Next default values for new objects
00012 //
00013 #ifdef APSTUDIO_INVOKED
00014 #ifndef APSTUDIO_READONLY_SYMBOLS
00015 #define _APS_NEXT_RESOURCE_VALUE        104
00016 #define _APS_NEXT_COMMAND_VALUE         40003
00017 #define _APS_NEXT_CONTROL_VALUE         1000
00018 #define _APS_NEXT_SYMED_VALUE           101
00019 #endif
00020 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/tracemacro.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

tracemacro.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "TraceMacro.h"
00017 #include <StdIo.h>             // Needed for sprintf on Win98
00018
00019
00020 //---------------------------------------------------------------------------
00021 //  Function implementations
00022 //
00023
00024 //---------------------------------------------------------------------------
00025 //  Provides trace output for HRESULTs in hex.
00026 //
00027 VOID Trace_HR
00028 (
00029   LPCTSTR pszClass,        //[in] Class name for message
00030   LPCTSTR pszFunction,     //[in] Function name for message
00031   HRESULT hr               //[in] HRESULT to display as a value
00032 )
00033 {
00034 #ifdef _DEBUG
00035
00036   TCHAR  szBuffer[512];
00037   TCHAR  szFormat[] = _T("%s::%s-> Returned 0x%X\n");
00038   INT    nChars     = 0;
00039
00040   nChars = _stprintf( szBuffer, szFormat, pszClass, pszFunction, hr );
00041   _ASSERTE( nChars < sizeof(szBuffer) );
00042
00043   OutputDebugString( szBuffer );
00044
00045 #endif
00046 } //end Trace_HR()
00047
00048
00049 //---------------------------------------------------------------------------
00050 //  Provides trace output for user defined numeric values in the form:
00051 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00052 //
00053 VOID Trace_Value
00054 (
00055   LPCTSTR pszClass,        //[in] Class name for message
00056   LPCTSTR pszFunction,     //[in] Function name for message
00057   LPCTSTR pszValueName,    //[in] Value name for message
00058   LONG    nValue           //[in] Numeric value for message
00059 )
00060 {
00061 #ifdef _DEBUG
00062
00063   TCHAR  szBuffer[512];
00064   TCHAR  szFormat[] = _T("%s::%s-> %s = %u\n");
00065   INT    nChars     = 0;
00066
00067   nChars = _stprintf( szBuffer,
00068                       szFormat,
00069                       pszClass,
00070                       pszFunction,
00071                       pszValueName,
00072                       nValue
00073                     );
00074   _ASSERTE( nChars < sizeof(szBuffer) );
00075
00076   OutputDebugString( szBuffer );
00077
00078 #endif
00079 } //end Trace_Value()
00080
00081 //---------------------------------------------------------------------------
00082 //  Provides trace output for user defined numeric values in the form:
00083 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00084 //
00085 VOID Trace_Pointer
00086 (
00087   LPCTSTR pszClass,        //[in] Class name for message
00088   LPCTSTR pszFunction,     //[in] Function name for message
00089   LPCTSTR pszObject,       //[in] Action which was taken
00090   ULONG   ulValue          //[in] Numeric value for message
00091 )
00092 {
00093 #ifdef _DEBUG
00094
00095   TCHAR  szBuffer[512];
00096   TCHAR  szFormat[] = _T("%s::%s-> %s = 0x%X\n");
00097   INT    nChars     = 0;
00098
00099   nChars = _stprintf( szBuffer,
00100                       szFormat,
00101                       pszClass,
00102                       pszFunction,
00103                       pszObject,
00104                       ulValue
00105                     );
00106   _ASSERTE( nChars < sizeof(szBuffer) );
00107
00108   OutputDebugString( szBuffer );
00109
00110 #endif
00111 } //end Trace_Pointer()
00112
00113
00114 //---------------------------------------------------------------------------
00115 //  Provides trace output which shows the class name, function name, and
00116 //  a string which maps to an MMC notification.
00117 //
00118 VOID Trace_Event
00119 (
00120   LPCTSTR pszClass,        //[in] Class name for message
00121   LPCTSTR pszFunction,     //[in] Event name for message
00122   LONG    nEvent           //[in] Event code to map to string
00123 )
00124 {
00125 #ifdef _DEBUG
00126
00127   TCHAR  szEventStr[64];
00128   TCHAR  szBuffer[512];
00129   TCHAR  szFormat[] = _T("%s::%s-> Event = %s\n");
00130   INT    nChars     = 0;
00131
00132   MapEvent( nEvent, szEventStr );
00133
00134   nChars = _stprintf( szBuffer,
00135                       szFormat,
00136                       pszClass,
00137                       pszFunction,
00138                       szEventStr
00139                     );
00140   _ASSERTE( nChars < sizeof(szBuffer) );
00141
00142   OutputDebugString( szBuffer );
00143
00144 #endif
00145 } //end Trace_Event()
00146
00147 //---------------------------------------------------------------------------
00148 //  Provides trace output which shows the class name and function name
00149 //
00150 VOID Trace_Start
00151 (
00152   LPCTSTR pszClass,        //[in] Class name for message
00153   LPCTSTR pszFunction      //[in] Event name for message
00154 )
00155 {
00156 #ifdef _DEBUG
00157
00158   TCHAR  szBuffer[512];
00159   TCHAR  szFormat[] = _T("%s::%s-> Started \n");
00160   INT    nChars     = 0;
00161
00162   nChars = _stprintf( szBuffer,
00163                       szFormat,
00164                       pszClass,
00165                       pszFunction
00166                     );
00167   _ASSERTE( nChars < sizeof(szBuffer) );
00168
00169   OutputDebugString( szBuffer );
00170
00171 #endif
00172 } //end Trace_Start()
00173
00174
00175
00176 //---------------------------------------------------------------------------
00177 // Provides human readable output for notifications
00178 //
00179 VOID MapEvent( LONG Event, LPTSTR szEventStr )
00180 {
00181 #ifdef _DEBUG
00182
00183   switch( Event )
00184   {
00185     case MMCN_ACTIVATE:
00186       _tcscpy( szEventStr, _T("MMCN_ACTIVATE          ") );
00187       break;
00188
00189     case MMCN_ADD_IMAGES:
00190       _tcscpy( szEventStr, _T("MMCN_ADD_IMAGES        ") );
00191       break;
00192
00193     case MMCN_BTN_CLICK:
00194       _tcscpy( szEventStr, _T("MMCN_BTN_CLICK         ") );
00195       break;
00196
00197     case MMCN_CLICK:
00198       _tcscpy( szEventStr, _T("MMCN_CLICK             ") );
00199       break;
00200
00201     case MMCN_COLUMN_CLICK:
00202       _tcscpy( szEventStr, _T("MMCN_COLUMN_CLICK       ") );
00203       break;
00204
00205     case MMCN_CONTEXTMENU:
00206       _tcscpy( szEventStr, _T("MMCN_CONTEXTMENU        ") );
00207       break;
00208
00209     case MMCN_CUTORMOVE:
00210       _tcscpy( szEventStr, _T("MMCN_CUTORMOVE          ") );
00211       break;
00212
00213     case MMCN_DBLCLICK:
00214       _tcscpy( szEventStr, _T("MMCN_DBLCLICK           ") );
00215       break;
00216
00217     case MMCN_DELETE:
00218       _tcscpy( szEventStr, _T("MMCN_DELETE             ") );
00219       break;
00220
00221     case MMCN_DESELECT_ALL:
00222       _tcscpy( szEventStr, _T("MMCN_DESELECT_ALL       ") );
00223       break;
00224
00225     case MMCN_EXPAND:
00226       _tcscpy( szEventStr, _T("MMCN_EXPAND             ") );
00227       break;
00228
00229     case MMCN_HELP:
00230       _tcscpy( szEventStr, _T("MMCN_HELP               ") );
00231       break;
00232
00233     case MMCN_MENU_BTNCLICK:
00234       _tcscpy( szEventStr, _T("MMCN_MENU_BTNCLICK      ") );
00235       break;
00236
00237     case MMCN_MINIMIZED:
00238       _tcscpy( szEventStr, _T("MMCN_MINIMIZED          ") );
00239       break;
00240
00241     case MMCN_PASTE:
00242       _tcscpy( szEventStr, _T("MMCN_PASTE              ") );
00243       break;
00244
00245     case MMCN_PROPERTY_CHANGE:
00246       _tcscpy( szEventStr, _T("MMCN_PROPERTY_CHANGE    ") );
00247       break;
00248
00249     case MMCN_QUERY_PASTE:
00250       _tcscpy( szEventStr, _T("MMCN_QUERY_PASTE        ") );
00251       break;
00252
00253     case MMCN_REFRESH:
00254       _tcscpy( szEventStr, _T("MMCN_REFRESH            ") );
00255       break;
00256
00257     case MMCN_REMOVE_CHILDREN:
00258       _tcscpy( szEventStr, _T("MMCN_REMOVE_CHILDREN    ") );
00259       break;
00260
00261     case MMCN_RENAME:
00262       _tcscpy( szEventStr, _T("MMCN_RENAME             ") );
00263       break;
00264
00265     case MMCN_SELECT:
00266       _tcscpy( szEventStr, _T("MMCN_SELECT             ") );
00267       break;
00268
00269     case MMCN_SHOW:
00270       _tcscpy( szEventStr, _T("MMCN_SHOW               ") );
00271       break;
00272
00273     case MMCN_VIEW_CHANGE:
00274       _tcscpy( szEventStr, _T("MMCN_VIEW_CHANGE        ") );
00275       break;
00276
00277     case MMCN_SNAPINHELP:
00278       _tcscpy( szEventStr, _T("MMCN_SNAPINHELP         ") );
00279       break;
00280
00281     case MMCN_CONTEXTHELP:
00282       _tcscpy( szEventStr, _T("MMCN_CONTEXTHELP        ") );
00283       break;
00284
00285     case MMCN_INITOCX:
00286       _tcscpy( szEventStr, _T("MMCN_INITOCX            ") );
00287       break;
00288
00289     // MMC Version 1.1 notifications
00290     case MMCN_FILTER_CHANGE:
00291       _tcscpy( szEventStr, _T("MMCN_FILTER_CHANGE      ") );
00292       break;
00293
00294     case MMCN_FILTERBTN_CLICK:
00295       _tcscpy( szEventStr, _T("MMCN_FILTERBTN_CLICK    ") );
00296       break;
00297
00298     case MMCN_RESTORE_VIEW:
00299       _tcscpy( szEventStr, _T("MMCN_RESTORE_VIEW       ") );
00300       break;
00301
00302     case MMCN_PRINT:
00303       _tcscpy( szEventStr, _T("MMCN_PRINT              ") );
00304       break;
00305
00306     case MMCN_PRELOAD:
00307       _tcscpy( szEventStr, _T("MMCN_PRELOAD            ") );
00308       break;
00309
00310     case MMCN_LISTPAD:
00311       _tcscpy( szEventStr, _T("MMCN_LISTPAD            ") );
00312       break;
00313
00314     case MMCN_EXPANDSYNC:
00315       _tcscpy( szEventStr, _T("MMCN_EXPANDSYNC         ") );
00316       break;
00317
00318     // MMC Version 1.2 notifications
00319     case MMCN_COLUMNS_CHANGED:
00320       _tcscpy( szEventStr, _T("MMCN_COLUMNS_CHANGED    ") );
00321       break;
00322
00323     default:
00324       _stprintf( szEventStr, _T("0x%X"), Event );
00325       break;
00326   }
00327
00328 #endif
00329 } //end MapEvent()
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SAMPLE_HELPER_DATA_ Member List

This is the complete list of members for _SAMPLE_HELPER_DATA_, including all inherited members.
bEnabled | _SAMPLE_HELPER_DATA_
GatewayUserData | _SAMPLE_HELPER_DATA_
InterfaceID | _SAMPLE_HELPER_DATA_
Potential | _SAMPLE_HELPER_DATA_
SprocketCount | _SAMPLE_HELPER_DATA_
Supermetric | _SAMPLE_HELPER_DATA_
WidgetCount | _SAMPLE_HELPER_DATA_
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLBSub Member List

This is the complete list of members for CLBSub, including all inherited members.
CLBSub(CComSpy *pSpy) | CLBSub | [inline]
CLBSub() | CLBSub | [inline]
CSysLCESub() | CSysLCESub | [inline]
EngineDefined(BSTR bstrPropName, VARIANT *varPropValue, BSTR bstrClsidEng) | CLBSub | [inline]
GetEventClass(LPGUID guid) | CLBSub | [inline, virtual]
GetEventType(EventEnum *e) | CLBSub | [inline, virtual]
GetInterface(IID *iid) | CLBSub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
TargetDown(BSTR bstrServerName, BSTR bstrClsidEng) | CLBSub | [inline]
TargetUp(BSTR bstrServerName, BSTR bstrClsidEng) | CLBSub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/Upload/resource.h Source File

  • Web
  • bits
  • Upload

resource.h

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //
00006 //  BITS Upload sample
00007 //  ==================
00008 //
00009 //  Module name:
00010 //  resource.h
00011 //
00012 //  Purpose:
00013 //  Defines resource IDs for the UI elements.
00014 //
00015 //----------------------------------------------------------------------------
00016
00017
00018 #define IDR_UPLOADSAMPLE                101
00019 #define IDD_UPLOADSAMPLECLIENTDIALOG    102
00020 #define IDC_SAMPLETEXT                  201
00021 #define IDC_VIRTUALDIR                  203
00022 #define IDC_UPLOADREPLY_CHECKBOX        204
00023 #define IDC_JOBSTATUS                   207
00024 #define IDC_RADIO1                      208
00025 #define IDC_RADIO2                      209
00026 #define IDC_COMBO1                      210
00027
00028 // Next default values for new objects
00029 //
00030 #ifdef APSTUDIO_INVOKED
00031 #ifndef APSTUDIO_READONLY_SYMBOLS
00032 #define _APS_NEXT_RESOURCE_VALUE        201
00033 #define _APS_NEXT_COMMAND_VALUE         32768
00034 #define _APS_NEXT_CONTROL_VALUE         211
00035 #define _APS_NEXT_SYMED_VALUE           103
00036 #endif
00037 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/CAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

CAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CAR.H
00003
00004   Summary:   Include file for the aggregatable COCar COM object class.
00005
00006              COCar offers a main IUnknown interface and the ICar
00007              interface (Car-related features).  This multiple interface
00008              COM Object Class is achieved via the technique of nested
00009              classes.  The implementation of the ICar interface is
00010              nested inside of the COCar Class.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial LOCSERVE.HTM file.
00014              For more specific technical details on the internal workings
00015              see the comments dispersed throughout the module's source
00016              code.
00017
00018   Classes:   COCar.
00019
00020   Functions:
00021
00022   Origin:    11-14-95: atrent - Editor-inheritance from CAR.H in
00023                the DLLSERVE Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 #if !defined(CAR_H)
00041 #define CAR_H
00042
00043 #ifdef __cplusplus
00044
00045 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00046   ObjectClass: COCar
00047
00048   Summary:     COM object class for COCar COM objects.  COM objects of
00049                this class offer ICar interface features (Shift, Clutch,
00050                Speed, and Steer).  The mulitple interfaces on this COM
00051                object are constructed via the nested interface classes
00052                technique.
00053
00054   Interfaces:  IUnknown
00055                  Standard interface providing COM object features.
00056                ICar
00057                  Basic Car operation features.
00058
00059   Aggregation: Yes, COCar COM Objects are aggregatable by passing
00060                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00061 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00062 class COCar : public IUnknown
00063 {
00064   public:
00065     // Main Object Constructor & Destructor.
00066     COCar(IUnknown* pUnkOuter, CServer* pServer);
00067     ~COCar(void);
00068
00069     // IUnknown methods. Main object, non-delegating.
00070     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00071     STDMETHODIMP_(ULONG) AddRef(void);
00072     STDMETHODIMP_(ULONG) Release(void);
00073
00074   private:
00075     // We declare nested class interface implementations here.
00076
00077     class CImpICar : public ICar
00078     {
00079       public:
00080         // Interface Implementation Constructor & Destructor.
00081         CImpICar(COCar* pBackObj, IUnknown* pUnkOuter);
00082         ~CImpICar(void);
00083
00084         // IUnknown methods.
00085         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00086         STDMETHODIMP_(ULONG) AddRef(void);
00087         STDMETHODIMP_(ULONG) Release(void);
00088
00089         // ICar methods.
00090         STDMETHODIMP Shift(short nGear);
00091         STDMETHODIMP Clutch(short nEngaged);
00092         STDMETHODIMP Speed(short nMph);
00093         STDMETHODIMP Steer(short nAngle);
00094
00095       private:
00096         // Data private to this COCar interface implementation of ICar.
00097         ULONG        m_cRefI;        // Interface Ref Count (for debugging).
00098         COCar*       m_pBackObj;     // Parent Object back pointer.
00099         IUnknown*    m_pUnkOuter;    // Outer unknown for Delegation.
00100     };
00101
00102     // Make the otherwise private and nested ICar interface implementation
00103     // a friend to COM object instantiations of this selfsame COCar
00104     // COM object class.
00105     friend CImpICar;
00106
00107     // Private data of COCar COM objects.
00108
00109     // Nested ICar implementation instantiation.  This ICar interface
00110     // is instantiated inside this COCar object as a native interface.
00111     CImpICar         m_ImpICar;
00112
00113     // Main Object reference count.
00114     ULONG            m_cRefs;
00115
00116     // Outer unknown (aggregation & delegation).
00117     IUnknown*        m_pUnkOuter;
00118
00119     // Pointer to this component server's control object.
00120     CServer*         m_pServer;
00121 };
00122
00123 typedef COCar* PCOCar;
00124
00125 #endif // __cplusplus
00126
00127
00128 #endif // CAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_SEC_CONTEXT Member List

This is the complete list of members for _SEC_CONTEXT, including all inherited members.
ContextFlags | _SEC_CONTEXT
ContextId | _SEC_CONTEXT
CredentialId | _SEC_CONTEXT
FirstAccept enum value | _SEC_CONTEXT
FirstInit enum value | _SEC_CONTEXT
Idle enum value | _SEC_CONTEXT
Next | _SEC_CONTEXT
Nonce | _SEC_CONTEXT
SecondAccept enum value | _SEC_CONTEXT
SecondInit enum value | _SEC_CONTEXT
State | _SEC_CONTEXT
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Font.h Source File

  • WinUI
  • CommDlg
  • CDTest

Font.h

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 void DoFontDialog(HWND) ;
00007 INT_PTR APIENTRY FontProc(HWND, UINT, WPARAM, LPARAM) ;
00008
00009
00010 #define ID_FONTDIALOG               607
00011 #define WM_CF_LF                    (WM_USER+2)
00012
00013 #define ID_STRUCTSIZEF              116
00014 #define ID_HWNDOWNERF               117
00015 #define ID_HDCF                     118
00016 #define ID_LOGFONTF                 119
00017 #define ID_POINTSIZEF               120
00018 #define ID_FLAGSF                   121
00019 #define ID_RGBCOLORSF               122
00020 #define ID_CUSTDATAF                123
00021 #define ID_HOOKF                    124
00022 #define ID_TEMPLATEF                125
00023 #define ID_HINSTANCEF               126
00024 #define ID_STYLEF                   127
00025 #define ID_FONTTYPEF                128
00026 #define ID_SIZEMINF                 129
00027 #define ID_SIZEMAXF                 130
00028 #define ID_ERRORF                   135
00029 #define ID_RETURNF                  136
00030 #define ID_HDCSCREEN                137
00031 #define ID_HDCPRINTER               138
00032 #define ID_HDCNULL                  131
00033 #define ID_EDITLOGFONT              132
00034 #define ID_RESETFONT                139
00035 #define ID_HDCINVALID               609
00036 #define ID_NULLSTRUCTFONT           608
00037 #define ID_PRELOADEDFONT            610
00038 #define ID_FONTLIST                 611
00039 #define F_ANSIONLY                  614
00040 #define F_TTONLY                    615
00041 #define F_SCREENFONTS               616
00042 #define F_PRINTERFONTS              617
00043 #define F_FIXEDPITCHONLY            618
00044 #define F_NOOEMFONTS                619
00045 #define F_NOSIMULATIONS             620
00046 #define F_NOVECTORFONTS             621
00047 #define F_SCALABLEONLY              622
00048 #define F_WYSIWYG                   623
00049 #define ID_MULTITHREADFONT          624
00050 #define ID_SEND_WM_CF_LF_MSG        625
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/Fakemenu/fakemenu.c Source File

  • WinUI
  • Shell
  • Fakemenu

fakemenu.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  *  FakeMenu.c
00004  *
00005  *  Copyright (c) 1997 Microsoft Corporation.  All rights reserved.
00006  *
00007  *       This source code is only intended as a supplement to
00008  *       Microsoft Development Tools, q.v. for detailed
00009  *       information regarding the Microsoft samples programs.
00010  *
00011  *  Abstract:
00012  *
00013  *      Sample program to demonstrate how a program can display a
00014  *      popup window which does not deactivate its parent.  This
00015  *      can be used for things like a magnifying glass window or
00016  *      a pseudo-menu.
00017  *
00018  *****************************************************************************/
00019
00020 #include "FakeMenu.h"
00021 #define COMPILE_MULTIMON_STUBS
00022 #include <multimon.h>
00023
00024 /*****************************************************************************
00025  *
00026  *      Overview
00027  *
00028  *      Normally, pop-up windows receive activation, resulting in the
00029  *      owner window being de-activated.  To prevent the owner from
00030  *      being de-activated, the pop-up window should not receive
00031  *      activation.
00032  *
00033  *      Since the pop-up window is not active, input messages are not
00034  *      delivered to the pop-up.  Instead, the input messages must be
00035  *      explicitly inspected by the message loop.
00036  *
00037  *      Our sample program illustrates how you can create a pop-up
00038  *      window that contains a selection of colors.
00039  *
00040  *      Right-click in the window to change its background color
00041  *      via the fake menu popup.  Observe
00042  *
00043  *      -   The caption of the main application window remains
00044  *          highlighted even though the fake-menu is "active".
00045  *
00046  *      -   The current fake-menu item highlight follows the mouse.
00047  *
00048  *      -   The keyboard arrows can be used to move the highlight,
00049  *          ESC cancels the fake-menu, Enter accepts the fake-menu.
00050  *
00051  *      -   The fake-menu appears on the correct monitor (for
00052  *          multiple-monitor systems).
00053  *
00054  *****************************************************************************/
00055
00056 HINSTANCE   g_hinst;                /* My hinstance */
00057 HBRUSH      g_hbrColor;             /* The selected color */
00058
00059 /*****************************************************************************
00060  *
00061  *      This is the array of predefined colors we put into the color
00062  *      picker.
00063  *
00064  *****************************************************************************/
00065
00066 #define CCLRPREDEF  16              /* 16 predefined colors */
00067
00068 const COLORREF c_rgclrPredef[CCLRPREDEF] = {
00069     RGB(0x00, 0x00, 0x00),          /* 0 = black    */
00070     RGB(0x80, 0x00, 0x00),          /* 1 = maroon   */
00071     RGB(0x00, 0x80, 0x00),          /* 2 = green    */
00072     RGB(0x80, 0x80, 0x00),          /* 3 = olive    */
00073     RGB(0x00, 0x00, 0x80),          /* 4 = navy     */
00074     RGB(0x80, 0x00, 0x80),          /* 5 = purple   */
00075     RGB(0x00, 0x80, 0x80),          /* 6 = teal     */
00076     RGB(0x80, 0x80, 0x80),          /* 7 = gray     */
00077     RGB(0xC0, 0xC0, 0xC0),          /* 8 = silver   */
00078     RGB(0xFF, 0x00, 0x00),          /* 9 = red      */
00079     RGB(0x00, 0xFF, 0x00),          /* A = lime     */
00080     RGB(0xFF, 0xFF, 0x00),          /* B = yelow    */
00081     RGB(0x00, 0x00, 0xFF),          /* C = blue     */
00082     RGB(0xFF, 0x00, 0xFF),          /* D = fuchsia  */
00083     RGB(0x00, 0xFF, 0xFF),          /* E = cyan     */
00084     RGB(0xFF, 0xFF, 0xFF),          /* F = white    */
00085 };
00086
00087 /*****************************************************************************
00088  *
00089  *  COLORPICKSTATE
00090  *
00091  *      Structure that records the state of a color-picker pop-up.
00092  *
00093  *      A pointer to this state information is kept in the GWLP_USERDATA
00094  *      window long.
00095  *
00096  *      The iSel field is the index of the selected color, or the
00097  *      special value -1 to mean that no item is highlighted.
00098  *
00099  *****************************************************************************/
00100
00101 typedef struct COLORPICKSTATE {
00102
00103     BOOL fDone;             /* Set when we should get out */
00104     int iSel;               /* Which color is selected? */
00105     int iResult;            /* Which color should be returned? */
00106     HWND hwndOwner;         /* Our owner window */
00107
00108 } COLORPICKSTATE, *PCOLORPICKSTATE;
00109
00110 #define CYCOLOR         16      /* Height of a single color pick */
00111 #define CXFAKEMENU      100     /* Width of our fake menu */
00112
00113 /*****************************************************************************
00114  *
00115  *  ColorPick_GetColorRect
00116  *
00117  *      Returns the rectangle that encloses the specified color.
00118  *
00119  *****************************************************************************/
00120
00121 void
00122 ColorPick_GetColorRect(LPRECT prc, int iColor)
00123 {
00124     /*
00125      *  Build the "menu" item rect.
00126      */
00127     prc->left = 0;
00128     prc->right = CXFAKEMENU;
00129     prc->top = iColor * CYCOLOR;
00130     prc->bottom = prc->top + CYCOLOR;
00131
00132 }
00133
00134 /*****************************************************************************
00135  *
00136  *  ColorPick_OnCreate
00137  *
00138  *      Stash away our state.
00139  *
00140  *****************************************************************************/
00141
00142 LRESULT
00143 ColorPick_OnCreate(HWND hwnd, LPCREATESTRUCT pcs)
00144 {
00145     SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)(pcs->lpCreateParams));
00146
00147     return 0;
00148 }
00149
00150 /*****************************************************************************
00151  *
00152  *  ColorPick_OnPaint
00153  *
00154  *      Draw the color bars, and put a border around the selected
00155  *      color.
00156  *
00157  *****************************************************************************/
00158
00159 void
00160 ColorPick_OnPaint(PCOLORPICKSTATE pcps, HWND hwnd)
00161 {
00162     PAINTSTRUCT ps;
00163     HDC hdc;
00164
00165     hdc = BeginPaint(hwnd, &ps);
00166     if (hdc) {
00167         RECT rcClient;
00168         int iColor;
00169
00170         GetClientRect(hwnd, &rcClient);
00171
00172         /*
00173          *  For each of our predefined colors, draw it in a little
00174          *  rectangular region, leaving some border so the user can
00175          *  see if the item is highlighted or not.
00176          */
00177         for (iColor = 0; iColor < CCLRPREDEF; iColor++) {
00178             RECT rc;
00179             HBRUSH hbr;
00180
00181             /*
00182              *  Build the "menu" item rect.
00183              */
00184             ColorPick_GetColorRect(&rc, iColor);
00185
00186             /*
00187              *  If the item is highlighted, then draw a highlighted
00188              *  background.
00189              */
00190             if (iColor == pcps->iSel) {
00191                 FillRect(hdc, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
00192             }
00193
00194             /*
00195              *  Now shrink the rectangle by an edge and fill the
00196              *  rest with the color of the item itself.
00197              */
00198             InflateRect(&rc, -GetSystemMetrics(SM_CXEDGE),
00199                              -GetSystemMetrics(SM_CYEDGE));
00200
00201             hbr = CreateSolidBrush(c_rgclrPredef[iColor]);
00202             FillRect(hdc, &rc, hbr);
00203             DeleteObject(hbr);
00204         }
00205
00206         EndPaint(hwnd, &ps);
00207     }
00208 }
00209
00210 /*****************************************************************************
00211  *
00212  *  ColorPick_ChangeSel
00213  *
00214  *      Change the selection to the specified item.
00215  *
00216  *****************************************************************************/
00217
00218 void
00219 ColorPick_ChangeSel(PCOLORPICKSTATE pcps, HWND hwnd, int iSel)
00220 {
00221     /*
00222      *  If the selection changed, then
00223      *  repaint the items that need repainting.
00224      */
00225     if (pcps->iSel != iSel) {
00226         RECT rc;
00227
00228         if (pcps->iSel >= 0) {
00229             ColorPick_GetColorRect(&rc, pcps->iSel);
00230             InvalidateRect(hwnd, &rc, TRUE);
00231         }
00232
00233         pcps->iSel = iSel;
00234         if (pcps->iSel >= 0) {
00235             ColorPick_GetColorRect(&rc, pcps->iSel);
00236             InvalidateRect(hwnd, &rc, TRUE);
00237         }
00238
00239     }
00240 }
00241
00242 /*****************************************************************************
00243  *
00244  *  ColorPick_OnMouseMove
00245  *
00246  *      Track the mouse to see if it is over any of our colors.
00247  *
00248  *****************************************************************************/
00249
00250 void
00251 ColorPick_OnMouseMove(PCOLORPICKSTATE pcps, HWND hwnd, int x, int y)
00252 {
00253     int iSel;
00254
00255     if (x >= 0 && x < CXFAKEMENU &&
00256         y >= 0 && y < CCLRPREDEF * CYCOLOR) {
00257         iSel = y / CYCOLOR;
00258     } else {
00259         iSel = -1;
00260     }
00261
00262     ColorPick_ChangeSel(pcps, hwnd, iSel);
00263
00264 }
00265
00266 /*****************************************************************************
00267  *
00268  *  ColorPick_OnLButtonUp
00269  *
00270  *      When the button comes up, we are done.
00271  *
00272  *****************************************************************************/
00273
00274 void
00275 ColorPick_OnLButtonUp(PCOLORPICKSTATE pcps, HWND hwnd, int x, int y)
00276 {
00277     /*
00278      *  First track to the final location, in case the user
00279      *  moves the mouse REALLY FAST and immediately lets go.
00280      */
00281     ColorPick_OnMouseMove(pcps, hwnd, x, y);
00282
00283     /*
00284      *  Set the result to the current selection.
00285      */
00286     pcps->iResult = pcps->iSel;
00287
00288     /*
00289      *  And tell the message loop that we're done.
00290      */
00291     pcps->fDone = TRUE;
00292 }
00293
00294 /*****************************************************************************
00295  *
00296  *  ColorPick_OnKeyDown
00297  *
00298  *      If the ESC key is pressed, then abandon the fake menu.
00299  *
00300  *      If the Enter key is pressed, then accept the current selection.
00301  *
00302  *      If an arrow key is pressed, the move the selection.
00303  *
00304  *****************************************************************************/
00305
00306 void
00307 ColorPick_OnKeyDown(PCOLORPICKSTATE pcps, HWND hwnd, WPARAM vk)
00308 {
00309     switch (vk) {
00310
00311     case VK_ESCAPE:
00312         pcps->fDone = TRUE;         /* Abandoned */
00313         break;
00314
00315     case VK_RETURN:
00316         pcps->iResult = pcps->iSel; /* Accept current selection */
00317         pcps->fDone = TRUE;
00318         break;
00319
00320     case VK_UP:
00321         if (pcps->iSel > 0) {
00322             ColorPick_ChangeSel(pcps, hwnd, pcps->iSel - 1);
00323         } else {
00324             ColorPick_ChangeSel(pcps, hwnd, CCLRPREDEF - 1);
00325         }
00326         break;
00327
00328     case VK_DOWN:
00329         if (pcps->iSel + 1 < CCLRPREDEF) {
00330             ColorPick_ChangeSel(pcps, hwnd, pcps->iSel + 1);
00331         } else {
00332             ColorPick_ChangeSel(pcps, hwnd, 0);
00333         }
00334         break;
00335
00336
00337     }
00338 }
00339
00340 /*****************************************************************************
00341  *
00342  *  ColorPick_WndProc
00343  *
00344  *      Window procedure for the color picker popup.
00345  *
00346  *****************************************************************************/
00347
00348 LRESULT CALLBACK
00349 ColorPick_WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
00350 {
00351     PCOLORPICKSTATE pcps = (PCOLORPICKSTATE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
00352
00353     switch (uiMsg) {
00354
00355     case WM_CREATE:
00356         return ColorPick_OnCreate(hwnd, (LPCREATESTRUCT)lParam);
00357
00358     case WM_MOUSEMOVE:
00359         ColorPick_OnMouseMove(pcps, hwnd, (short)LOWORD(lParam),
00360                                           (short)HIWORD(lParam));
00361         break;
00362
00363     case WM_LBUTTONUP:
00364         ColorPick_OnLButtonUp(pcps, hwnd, (short)LOWORD(lParam),
00365                                           (short)HIWORD(lParam));
00366         break;
00367
00368     case WM_SYSKEYDOWN:
00369     case WM_KEYDOWN:
00370         ColorPick_OnKeyDown(pcps, hwnd, wParam);
00371         break;
00372
00373     /*
00374      *  Do not activate when somebody clicks on me.
00375      */
00376     case WM_MOUSEACTIVATE:
00377         return MA_NOACTIVATE;
00378
00379     case WM_PAINT:
00380         ColorPick_OnPaint(pcps, hwnd);
00381         return 0;
00382
00383     }
00384
00385     return DefWindowProc(hwnd, uiMsg, wParam, lParam);
00386 }
00387
00388 /*****************************************************************************
00389  *
00390  *  ColorPick_ChooseLocation
00391  *
00392  *      Find a place to put the window so it won't go off the screen
00393  *      or straddle two monitors.
00394  *
00395  *      x, y = location of mouse click (preferred upper-left corner)
00396  *      cx, cy = size of window being created
00397  *
00398  *      We use the same logic that real menus use.
00399  *
00400  *      -   If (x, y) is too high or too far left, then slide onto screen.
00401  *      -   Use (x, y) if all fits on the monitor.
00402  *      -   If too low, then slide up.
00403  *      -   If too far right, then flip left.
00404  *
00405  *****************************************************************************/
00406
00407 void
00408 ColorPick_ChooseLocation(HWND hwnd, int x, int y, int cx, int cy, LPPOINT ppt)
00409 {
00410     HMONITOR hmon;
00411     MONITORINFO minf;
00412
00413     /*
00414      *  First get the dimensions of the monitor that contains (x, y).
00415      */
00416     ppt->x = x;
00417     ppt->y = y;
00418
00419     hmon = MonitorFromPoint(*ppt, MONITOR_DEFAULTTONULL);
00420
00421     /*
00422      *  If (x, y) is not on any monitor, then use the monitor that
00423      *  the owner window is on.
00424      */
00425     if (hmon == NULL) {
00426         hmon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
00427     }
00428
00429     minf.cbSize = sizeof(minf);
00430     GetMonitorInfo(hmon, &minf);
00431
00432     /*
00433      *  Now slide things around until they fit.
00434      */
00435
00436     /*
00437      *  If too high, then slide down.
00438      */
00439     if (ppt->y < minf.rcMonitor.top) {
00440         ppt->y = minf.rcMonitor.top;
00441     }
00442
00443     /*
00444      *  If too far left, then slide right.
00445      */
00446     if (ppt->x < minf.rcMonitor.left) {
00447         ppt->x = minf.rcMonitor.left;
00448     }
00449
00450     /*
00451      *  If too low, then slide up.
00452      */
00453     if (ppt->y > minf.rcMonitor.bottom - cy) {
00454         ppt->y = minf.rcMonitor.bottom - cy;
00455     }
00456
00457     /*
00458      *  If too far right, then flip left.
00459      */
00460     if (ppt->x > minf.rcMonitor.right - cx) {
00461         ppt->x = ppt->x - cx;
00462     }
00463 }
00464
00465 /*****************************************************************************
00466  *
00467  *  ColorPick_Popup
00468  *
00469  *      Display a fake menu to allow the user to select the color.
00470  *
00471  *      Return the color index the user selected, or -1 if no color
00472  *      was selected.
00473  *
00474  *****************************************************************************/
00475
00476 int
00477 ColorPick_Popup(HWND hwndOwner, int x, int y)
00478 {
00479     COLORPICKSTATE cps;
00480     HWND hwndPopup, hwndActive;
00481     RECT rc;
00482     DWORD dwStyle, dwExStyle;
00483     MSG msg;
00484     POINT pt;
00485     int cx, cy;
00486
00487     /*
00488      *  Early check:  We must be on same thread as the owner
00489      *  so we can see its mouse and keyboard messages when we
00490      *  set capture to it.
00491      */
00492     if (GetCurrentThreadId() != GetWindowThreadProcessId(hwndOwner, NULL)) {
00493         /*
00494          *  Error: Menu must be on same thread as parent window.
00495          */
00496         return -1;
00497     }
00498
00499     cps.fDone = FALSE;          /* Not done yet */
00500     cps.iSel = -1;              /* No initial selection */
00501     cps.iResult = -1;           /* No result */
00502     cps.hwndOwner = hwndOwner;  /* Owner window */
00503
00504     /*
00505      *  The style and extended style we want to use.
00506      */
00507
00508     dwStyle = WS_POPUP | WS_BORDER;
00509     dwExStyle = WS_EX_TOOLWINDOW |      /* So it doesn't show up in taskbar */
00510                 WS_EX_DLGMODALFRAME |   /* Get the edges right */
00511                 WS_EX_WINDOWEDGE |
00512                 WS_EX_TOPMOST;          /* So it isn't obscured */
00513
00514     /*
00515      *  We want a client area of size (CXFAKEMENU, CCLRPREDEF * CYCOLOR),
00516      *  so use AdjustWindowRectEx to figure out what window rect will
00517      *  give us a client rect of that size.
00518      */
00519     rc.left = 0;
00520     rc.top = 0;
00521     rc.right = CXFAKEMENU;
00522     rc.bottom = CCLRPREDEF * CYCOLOR;
00523     AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);
00524
00525     /*
00526      *  Now find a proper home for the window that won't go off
00527      *  the screen or straddle two monitors.
00528      */
00529     cx = rc.right - rc.left;
00530     cy = rc.bottom - rc.top;
00531     ColorPick_ChooseLocation(hwndOwner, x, y, cx, cy, &pt);
00532
00533     hwndPopup = CreateWindowEx(
00534         dwExStyle,                      /* Extended style */
00535         "ColorPick",                    /* Class Name */
00536         "",                             /* Title */
00537         dwStyle,                        /* Style */
00538         pt.x, pt.y,                     /* Position */
00539         cx, cy,                         /* Size */
00540         hwndOwner,                      /* Parent */
00541         NULL,                           /* No menu */
00542         g_hinst,                        /* Instance */
00543         &cps);                          /* Starting parameters */
00544
00545     /*
00546      *  Show the window but don't activate it!
00547      */
00548     ShowWindow(hwndPopup, SW_SHOWNOACTIVATE);
00549
00550     /*
00551      *  We want to receive all mouse messages, but since
00552      *  only the active window can capture the mouse,
00553      *  we have to set the capture to our owner window,
00554      *  and then steal the mouse messages out from under him.
00555      */
00556     SetCapture(hwndOwner);
00557
00558     /*
00559      *  Go into a message loop that filters all the messages
00560      *  it receives and routes the interesting ones to the
00561      *  color picker window.
00562      */
00563     while (GetMessage(&msg, NULL, 0, 0)) {
00564
00565         /*
00566          *  Something may have happened that caused us to stop.
00567          *  If so, then stop.
00568          */
00569         if (cps.fDone) break;
00570
00571         /*
00572          *  If our owner stopped being the active window
00573          *  (e.g., the user Alt+Tab'd to another window
00574          *  in the meantime), then stop.
00575          */
00576         hwndActive = GetActiveWindow();
00577         if (hwndActive != hwndOwner &&
00578             !IsChild(hwndActive, hwndOwner)) break;
00579         if (GetCapture() != hwndOwner) break;
00580
00581         /*
00582          *  At this point, we get to snoop at all input messages
00583          *  before they get dispatched.  This allows us to
00584          *  route all input to our popup window even if really
00585          *  belongs to somebody else.
00586          *
00587          *  All mouse messages are remunged and directed at our
00588          *  popup menu.  If the mouse message arrives as client
00589          *  coordinates, then we have to convert it from the
00590          *  client coordinates of the original target to the
00591          *  client coordinates of the new target.
00592          */
00593
00594         switch (msg.message) {
00595
00596         /*
00597          *  These mouse messages arrive in client coordinates,
00598          *  so in addition to stealing the message, we also
00599          *  need to convert the coordinates.
00600          */
00601         case WM_MOUSEMOVE:
00602         case WM_LBUTTONDOWN:
00603         case WM_LBUTTONUP:
00604         case WM_LBUTTONDBLCLK:
00605         case WM_RBUTTONDOWN:
00606         case WM_RBUTTONUP:
00607         case WM_RBUTTONDBLCLK:
00608         case WM_MBUTTONDOWN:
00609         case WM_MBUTTONUP:
00610         case WM_MBUTTONDBLCLK:
00611             pt.x = (short)LOWORD(msg.lParam);
00612             pt.y = (short)HIWORD(msg.lParam);
00613             MapWindowPoints(msg.hwnd, hwndPopup, &pt, 1);
00614             msg.lParam = MAKELPARAM(pt.x, pt.y);
00615             msg.hwnd = hwndPopup;
00616             break;
00617
00618         /*
00619          *  These mouse messages arrive in screen coordinates,
00620          *  so we just need to steal the message.
00621          */
00622         case WM_NCMOUSEMOVE:
00623         case WM_NCLBUTTONDOWN:
00624         case WM_NCLBUTTONUP:
00625         case WM_NCLBUTTONDBLCLK:
00626         case WM_NCRBUTTONDOWN:
00627         case WM_NCRBUTTONUP:
00628         case WM_NCRBUTTONDBLCLK:
00629         case WM_NCMBUTTONDOWN:
00630         case WM_NCMBUTTONUP:
00631         case WM_NCMBUTTONDBLCLK:
00632             msg.hwnd = hwndPopup;
00633             break;
00634
00635         /*
00636          *  Steal all keyboard messages, too.
00637          */
00638         case WM_KEYDOWN:
00639         case WM_KEYUP:
00640         case WM_CHAR:
00641         case WM_DEADCHAR:
00642         case WM_SYSKEYDOWN:
00643         case WM_SYSKEYUP:
00644         case WM_SYSCHAR:
00645         case WM_SYSDEADCHAR:
00646             msg.hwnd = hwndPopup;
00647             break;
00648
00649         }
00650
00651         TranslateMessage(&msg);
00652         DispatchMessage(&msg);
00653
00654         /*
00655          *  Something may have happened that caused us to stop.
00656          *  If so, then stop.
00657          */
00658         if (cps.fDone) break;
00659
00660         /*
00661          *  If our owner stopped being the active window
00662          *  (e.g., the user Alt+Tab'd to another window
00663          *  in the meantime), then stop.
00664          */
00665         hwndActive = GetActiveWindow();
00666         if (hwndActive != hwndOwner &&
00667             !IsChild(hwndActive, hwndOwner)) break;
00668         if (GetCapture() != hwndOwner) break;
00669
00670     }
00671
00672     /*
00673      *  Clean up the capture we created.
00674      */
00675     ReleaseCapture();
00676
00677     DestroyWindow(hwndPopup);
00678
00679     /*
00680      *  If we got a WM_QUIT message, then re-post it so the caller's
00681      *  message loop will see it.
00682      */
00683     if (msg.message == WM_QUIT) {
00684         PostQuitMessage((int)msg.wParam);
00685     }
00686
00687     return cps.iResult;
00688 }
00689
00690 /*****************************************************************************
00691  *
00692  *  FakeMenuDemo_OnEraseBkgnd
00693  *
00694  *      Erase the background in the selected color.
00695  *
00696  *****************************************************************************/
00697
00698 void
00699 FakeMenuDemo_OnEraseBkgnd(HWND hwnd, HDC hdc)
00700 {
00701     RECT rc;
00702
00703     GetClientRect(hwnd, &rc);
00704     FillRect(hdc, &rc, g_hbrColor);
00705 }
00706
00707 /*****************************************************************************
00708  *
00709  *  FakeMenuDemo_OnContextMenu
00710  *
00711  *      Display the color-picker pseudo-menu so the user can change
00712  *      the color.
00713  *
00714  *****************************************************************************/
00715
00716 void
00717 FakeMenuDemo_OnContextMenu(HWND hwnd, int x, int y)
00718 {
00719     int iColor;
00720
00721     /*
00722      *  If the coordinates are (-1, -1), then the user typed Shift+F10,
00723      *  so we should pretend the user clicked at client (0, 0).
00724      */
00725     if (x == -1 && y == -1) {
00726         POINT pt;
00727         pt.x = 0;
00728         pt.y = 0;
00729         ClientToScreen(hwnd, &pt);
00730         x = pt.x;
00731         y = pt.y;
00732     }
00733
00734     iColor = ColorPick_Popup(hwnd, x, y);
00735
00736     /*
00737      *  If the user picked a color, then change to that color.
00738      */
00739     if (iColor >= 0) {
00740         DeleteObject(g_hbrColor);
00741         g_hbrColor = CreateSolidBrush(c_rgclrPredef[iColor]);
00742         InvalidateRect(hwnd, NULL, TRUE);
00743     }
00744 }
00745
00746 /*****************************************************************************
00747  *
00748  *  FakeMenuDemo_WndProc
00749  *
00750  *      Window procedure for the fake menu demo.
00751  *
00752  *****************************************************************************/
00753
00754 LRESULT CALLBACK
00755 FakeMenuDemo_WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
00756 {
00757     switch (uiMsg) {
00758
00759     case WM_ERASEBKGND:
00760         FakeMenuDemo_OnEraseBkgnd(hwnd, (HDC)wParam);
00761         return TRUE;
00762
00763     case WM_CONTEXTMENU:
00764         FakeMenuDemo_OnContextMenu(hwnd, (short)LOWORD(lParam),
00765                                          (short)HIWORD(lParam));
00766         return 0;
00767
00768     case WM_DESTROY:
00769         PostQuitMessage(0);
00770         break;
00771     }
00772
00773     return DefWindowProc(hwnd, uiMsg, wParam, lParam);
00774 }
00775
00776 /*****************************************************************************
00777  *
00778  *  InitClasses
00779  *
00780  *      Register our window classes.
00781  *
00782  *      "FakeMenuDemo" is the class for the main window.
00783  *
00784  *      "ColorPick" is the class for our color-picker pseudo-menu.
00785  *
00786  *****************************************************************************/
00787
00788 void
00789 InitClasses(void)
00790 {
00791     WNDCLASS wc;
00792
00793     wc.style = 0;
00794     wc.lpfnWndProc = ColorPick_WndProc;
00795     wc.cbClsExtra = 0;
00796     wc.cbWndExtra = 0;
00797     wc.hInstance = g_hinst;
00798     wc.hIcon = NULL;
00799     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00800     wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
00801     wc.lpszMenuName = NULL;
00802     wc.lpszClassName = "ColorPick";
00803
00804     RegisterClass(&wc);
00805
00806     wc.style = 0;
00807     wc.lpfnWndProc = FakeMenuDemo_WndProc;
00808     wc.cbClsExtra = 0;
00809     wc.cbWndExtra = 0;
00810     wc.hInstance = g_hinst;
00811     wc.hIcon = NULL;
00812     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00813     wc.hbrBackground = NULL;            /* Background color is dynamic */
00814     wc.lpszMenuName = NULL;
00815     wc.lpszClassName = "FakeMenuDemo";
00816
00817     RegisterClass(&wc);
00818
00819 }
00820
00821 /*****************************************************************************
00822  *
00823  *  WinMain
00824  *
00825  *      Program entry point.
00826  *
00827  *      Demonstrate pseudo-menus.
00828  *
00829  *****************************************************************************/
00830
00831 int WINAPI
00832 WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
00833 {
00834     MSG msg;
00835     HWND hwnd;
00836
00837     g_hinst = hinst;
00838
00839     InitClasses();
00840
00841     /*
00842      *  Start out white.
00843      */
00844     g_hbrColor = CreateSolidBrush(RGB(0xFF, 0xFF, 0xFF));
00845
00846     hwnd = CreateWindow(
00847         "FakeMenuDemo",                 /* Class Name */
00848         "Fake Menu Demo - Right-click in window to change color", /* Title */
00849         WS_OVERLAPPEDWINDOW,            /* Style */
00850         CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
00851         CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
00852         NULL,                           /* Parent */
00853         NULL,                           /* No menu */
00854         hinst,                          /* Instance */
00855         0);                             /* No special parameters */
00856
00857     ShowWindow(hwnd, nCmdShow);
00858
00859     while (GetMessage(&msg, NULL, 0, 0)) {
00860         TranslateMessage(&msg);
00861         DispatchMessage(&msg);
00862     }
00863
00864     return 0;
00865 }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/resource.h Source File

  • SysMgmt
  • MMC
  • Taskpads

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDS_NAME                        3
00008 #define IDS_SNAPINNAME                  6
00009 #define IDS_ABOUTNAME                   9
00010 #define IDI_ICON1                       108
00011 #define IDB_SMOPEN                      111
00012 #define IDB_SMBMP                       112
00013 #define IDB_LGBMP                       113
00014 #define IDB_BITMAP1                     114
00015 #define IDR_SMICONS                     120
00016 #define IDR_LGICONS                     121
00017 #define IDB_ROCKET                      40004
00018 #define IDB_CAR                         40005
00019 #define IDB_PLANE                       40006
00020 #define IDB_BIKE                        40007
00021 #define IDB_ROCKET2                     40008
00022 #define IDB_CAR2                        40009
00023 #define IDB_PLANE2                      40010
00024 #define IDB_BIKE2                       40011
00025 #define IDB_CLOSED2                     40012
00026 #define IDB_OPEN2                       40013
00027 #define IDB_CLOSED                      40014
00028 #define IDB_OPEN                        40015
00029
00030 // Next default values for new objects
00031 //
00032 #ifdef APSTUDIO_INVOKED
00033 #ifndef APSTUDIO_READONLY_SYMBOLS
00034 #define _APS_NEXT_RESOURCE_VALUE        116
00035 #define _APS_NEXT_COMMAND_VALUE         40016
00036 #define _APS_NEXT_CONTROL_VALUE         1000
00037 #define _APS_NEXT_SYMED_VALUE           101
00038 #endif
00039 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/about.Cpp Source File

  • SysMgmt
  • MMC
  • Ppgeext

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163         MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164         *lpDest = wszStr;
00165
00166
00167     return S_OK;
00168 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/SMF.h Source File

  • Multimedia
  • Audio
  • MidiPlyr

SMF.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 * SMF.H
00013 *
00014 * Public include file for Standard MIDI File access routines.
00015 *
00016 *****************************************************************************/
00017
00018 #ifndef _SMF_
00019 #define _SMF_
00020
00021 #include "global.h"
00022
00023 typedef DWORD SMFRESULT;
00024 typedef DWORD TICKS;
00025 typedef TICKS FAR *PTICKS;
00026 typedef BYTE HUGE *HPBYTE;
00027
00028 #define MAX_TICKS           ((TICKS)0xFFFFFFFFL)
00029
00030 #define SMF_SUCCESS         (0L)
00031 #define SMF_INVALID_FILE    (1L)
00032 #define SMF_NO_MEMORY       (2L)
00033 #define SMF_OPEN_FAILED     (3L)
00034 #define SMF_INVALID_TRACK   (4L)
00035 #define SMF_META_PENDING    (5L)
00036 #define SMF_ALREADY_OPEN    (6L)
00037 #define SMF_END_OF_TRACK    (7L)
00038 #define SMF_NO_META         (8L)
00039 #define SMF_INVALID_PARM    (9L)
00040 #define SMF_INVALID_BUFFER  (10L)
00041 #define SMF_END_OF_FILE     (11L)
00042 #define SMF_REACHED_TKMAX   (12L)
00043
00044 DECLARE_HANDLE(HSMF);
00045
00046 typedef struct tag_smfopenstruct
00047 {
00048     LPSTR               pstrName;
00049     DWORD               dwTimeDivision;
00050     HSMF                hSmf;
00051 }   SMFOPENFILESTRUCT,
00052     FAR *PSMFOPENFILESTRUCT;
00053
00054 extern SMFRESULT FNLOCAL smfOpenFile(
00055     PSMFOPENFILESTRUCT  psofs);
00056
00057 extern SMFRESULT FNLOCAL smfCloseFile(
00058     HSMF                hsmf);
00059
00060 typedef struct tag_smffileinfo
00061 {
00062     DWORD               dwTracks;
00063     DWORD               dwFormat;
00064     DWORD               dwTimeDivision;
00065     TICKS               tkLength;
00066 }   SMFFILEINFO,
00067     FAR *PSMFFILEINFO;
00068
00069 extern SMFRESULT FNLOCAL smfGetFileInfo(
00070     HSMF                hsmf,
00071     PSMFFILEINFO        psfi);
00072
00073 extern DWORD FNLOCAL smfTicksToMillisecs(
00074     HSMF                hsmf,
00075     TICKS               tkOffset);
00076
00077 extern DWORD FNLOCAL smfMillisecsToTicks(
00078     HSMF                hsmf,
00079     DWORD               msOffset);
00080
00081 extern SMFRESULT FNLOCAL smfReadEvents(
00082     HSMF                hsmf,
00083     LPMIDIHDR           lpmh,
00084     TICKS               tkMax);
00085
00086 extern SMFRESULT FNLOCAL smfSeek(
00087     HSMF                hsmf,
00088     TICKS               tkPosition,
00089     LPMIDIHDR           lpmh);
00090
00091 extern DWORD FNLOCAL smfGetStateMaxSize(
00092     void);
00093
00094 /* Buffer described by LPMIDIHDR is in polymsg format, except that it
00095 ** can contain meta-events (which will be ignored during playback by
00096 ** the current system). This means we can use the pack functions, etc.
00097 */
00098 #define PMSG_META       ((BYTE)0xC0)
00099
00100 #endif
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProxyPlugin Member List

This is the complete list of members for CProxyPlugin, including all inherited members.
AddCacheItem(BSTR bstrOriginUrl, BSTR bstrPrestuffUrl, long lExpiration, long lBandwidth, long lRemoteEventFlags, IWMSCacheProxyCallback *pCallback, VARIANT varContext) | CProxyPlugin | [inline]
CProxyPlugin() | CProxyPlugin |
CreateCacheItemCollection(IWMSCacheItemCollection **ppCacheItemCollection) | CProxyPlugin | [inline]
DisablePlugin() | CProxyPlugin |
EnablePlugin(long *pdwFlags, long *pdwHeartbeatPeriod) | CProxyPlugin |
FindCacheItem(BSTR pszOriginUrl, IWMSCacheItemDescriptor **ppCacheItemDescriptor) | CProxyPlugin | [inline]
GetCustomAdminInterface(IDispatch **ppValue) | CProxyPlugin |
InitializePlugin(IWMSContext *pServerContext, IWMSNamedValues *pNamedValues, IWMSClassObject *pClassFactory) | CProxyPlugin |
m_pICacheProxyServer | CProxyPlugin | [private]
OnCacheClientClose(HRESULT resultHr, IWMSContext *pUserContext, IWMSContext *pPresentationContext) | CProxyPlugin |
OnCancelDownloadContent(long lHr, VARIANT varContext) | CProxyPlugin | [inline]
OnCompareContentInformation(long lHr, WMS_CACHE_VERSION_COMPARE_RESPONSE CompareResponse, IWMSContext *pNewContentInfo, VARIANT varContext) | CProxyPlugin | [inline]
OnDownloadContentFinished(long lHr, SAFEARRAY *psaArchiveContexts, VARIANT varContext) | CProxyPlugin | [inline]
OnDownloadContentProgress(long lHr, WMS_RECORD_PROGRESS_OPCODE opCode, IWMSContext *pArchiveContext, VARIANT varContext) | CProxyPlugin | [inline]
OnGetContentInformation(long lHr, IWMSContext *pContentInfo, VARIANT varContext) | CProxyPlugin |
OnHeartbeat() | CProxyPlugin |
ParseUrl(BSTR bstrUrl, BSTR *pbstrProtocol, BSTR *pbstrHost, BSTR *pbstrPath, WORD *pwPort) | CProxyPlugin | [private]
QueryCache(BSTR bstrOriginUrl, IWMSContext *pUserContext, IWMSCommandContext *pCommandContext, IWMSContext *pPresentationContext, long QueryType, IWMSCacheProxyCallback *pCallback, VARIANT varContext) | CProxyPlugin |
QueryCacheMissPolicy(BSTR bstrOriginUrl, IWMSContext *pUserContext, IWMSCommandContext *pCommandContext, IWMSContext *pPresentationContext, IUnknown *pCachePluginContext, long QueryType, IWMSCacheProxyCallback *pCallback, VARIANT varContext) | CProxyPlugin |
QuerySpaceForCacheItem(long lContentSizeLow, long lContentSizeHigh, VARIANT_BOOL *pvarfSpaceAvail) | CProxyPlugin | [inline]
RemoveAllCacheItems(IWMSCacheProxyCallback *pCallback, VARIANT varContext) | CProxyPlugin | [inline]
RemoveCacheItem(BSTR bstrOriginUrl, IWMSCacheProxyCallback *pCallback, VARIANT varContext) | CProxyPlugin | [inline]
ShutdownPlugin() | CProxyPlugin |
~CProxyPlugin() | CProxyPlugin | [virtual]
Generated on Wed Nov 13 2024 16:57:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/Dog/iDog.Idl Source File

  • Com
  • Fundamentals
  • CustomSurrogate
  • Dog

iDog.Idl

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 // IID_IDog
00019 [
00020   object,
00021   uuid(F40B88C1-D534-11d1-9D01-0060081982D5),
00022   helpstring("Dog Interface"),
00023   pointer_default(unique)
00024 ]
00025 interface IDog : IUnknown
00026 {
00027   import "unknwn.idl";
00028
00029     HRESULT Bark();
00030     HRESULT Scratch();
00031 }
00032
00033 // LIBID_Dog
00034 [
00035   uuid(F40B88C3-D534-11d1-9D01-0060081982D5),
00036   helpstring("Dog Object InProc 1.0 Type Library"),
00037   lcid(0x0409),
00038   version(1.0)
00039 ]
00040 library DogObjectLib
00041 {
00042     importlib("stdole32.tlb");
00043     importlib("stdole2.tlb");
00044
00045   interface IDog;
00046
00047     // CLSID_Dog
00048     [
00049      uuid(F40B88C2-D534-11d1-9D01-0060081982D5),
00050        helpstring("Dog Class")
00051     ]
00052     coclass DogClass
00053     {
00054         [default] interface IDog;
00055     }
00056 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/BrowserHost.h Source File

  • Web
  • Browser
  • EditGlyphs

BrowserHost.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // BrowserHost.h : Declaration of the CBrowserHost
00006
00007 #ifndef __BROWSERHOST_H_
00008 #define __BROWSERHOST_H_
00009
00010 #include "resource.h"    // main symbols
00011 #include <commctrl.h>
00012 #include <atlwin.h>
00013 #include <exdisp.h>
00014 #include <mshtml.h>
00015 //#include <mshtmhst.h>
00016 //#include <mshtmdid.h>
00017 //#include <mshtmcid.h>
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CBrowserHost
00021 class ATL_NO_VTABLE CBrowserHost :
00022   public CComObjectRootEx<CComSingleThreadModel>,
00023   public CComCoClass<CBrowserHost, &CLSID_BrowserHost>,
00024   public IDispatchImpl<IBrowserHost, &IID_IBrowserHost, &LIBID_EDGLYPHSLib>,
00025   public CWindowImpl<CBrowserHost>,
00026   public IOleClientSite,
00027   public IOleInPlaceSite
00028 {
00029 public:
00030   CBrowserHost();
00031
00032 DECLARE_REGISTRY_RESOURCEID(IDR_BROWSERHOST)
00033
00034 DECLARE_PROTECT_FINAL_CONSTRUCT()
00035
00036 BEGIN_COM_MAP(CBrowserHost)
00037   COM_INTERFACE_ENTRY(IBrowserHost)
00038   COM_INTERFACE_ENTRY(IDispatch)
00039   COM_INTERFACE_ENTRY(IOleClientSite)
00040   COM_INTERFACE_ENTRY(IOleWindow)
00041   COM_INTERFACE_ENTRY(IOleInPlaceSite)
00042   COM_INTERFACE_ENTRY2(DWebBrowserEvents2, IDispatch)
00043 END_COM_MAP()
00044
00045 BEGIN_MSG_MAP(CAtlBrCon)
00046   MESSAGE_HANDLER(WM_CREATE,    OnCreate)
00047   MESSAGE_HANDLER(WM_NCDESTROY, OnNCDestroy)
00048   MESSAGE_HANDLER(WM_SIZE,      OnSize)
00049   MESSAGE_HANDLER(WM_KEYDOWN,   OnKeydown)
00050
00051   // Button Commands
00052   COMMAND_ID_HANDLER(ID_BUTTON1, OnButton1)
00053   COMMAND_ID_HANDLER(ID_BUTTON2, OnButton2)
00054   COMMAND_ID_HANDLER(ID_BUTTON3, OnButton3)
00055
00056   ALT_MSG_MAP(1) // For subclassed window - m_wndUrlCombo
00057 END_MSG_MAP()
00058
00059 // IBrowserHost
00060 public:
00061   STDMETHOD(GetHwnd)(long* phwnd);
00062   STDMETHOD(Run)();
00063
00064 protected:
00065   BOOL  m_bEnableCtxMenus;
00066   DWORD m_dwDLControl;
00067   DWORD m_dwCookie;
00068   DWORD m_dwDocHostUIFlags;
00069   DWORD m_dwDocHostUIDblClk;
00070   BOOL  m_bInPlaceActive;
00071   BOOL  m_bAtlBrowserHelp;
00072   BOOL  m_bButton2Down;
00073   BOOL  m_bButton3Down;
00074   CContainedWindow m_wndUrlCombo;
00075   CWindow m_wndStatusBar;
00076   CWindow m_wndToolBar;
00077
00078
00079   CComQIPtr<IWebBrowser2, &IID_IWebBrowser2> m_spWebBrowser;
00080   CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> m_spDoc;
00081   CComQIPtr<IOleInPlaceObject, &IID_IOleInPlaceObject> m_spInPlaceObject;
00082   CComQIPtr<IOleCommandTarget, &IID_IOleCommandTarget> m_spOleCmdTarg;
00083
00084   LRESULT OnCreate(UINT, WPARAM, LPARAM, BOOL&);
00085   LRESULT OnSize(UINT, WPARAM, LPARAM, BOOL&);
00086   LRESULT OnNCDestroy(UINT, WPARAM, LPARAM, BOOL&);
00087   LRESULT OnKeydown(UINT, WPARAM wParam, LPARAM lParam, BOOL&);
00088
00089   LRESULT OnButton1(WORD, WORD, HWND, BOOL&);
00090   LRESULT OnButton2(WORD, WORD, HWND, BOOL&);
00091   LRESULT OnButton3(WORD, WORD, HWND, BOOL&);
00092
00093   STDMETHOD(Stop)();
00094
00095 private:
00096   void CreateToolbar();
00097 public:
00098
00099 // IDispatch Methods
00100 private:
00101   STDMETHOD(Invoke)(DISPID dispidMember,
00102             REFIID riid,
00103             LCID lcid,
00104             WORD wFlags,
00105             DISPPARAMS* pdispparams,
00106             VARIANT * pvarResult,
00107             EXCEPINFO* pexcepinfo,
00108             UINT* puArgErr);
00109
00110 // IOleWindow
00111 private:
00112   STDMETHOD(GetWindow)(HWND *phwnd)
00113   {
00114      *phwnd = m_hWnd;
00115     return S_OK;
00116   }
00117
00118    STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) {return E_NOTIMPL;}
00119
00120 // IOleInPlaceSite
00121 private:
00122   STDMETHOD(CanInPlaceActivate)() {return S_OK;}
00123
00124   STDMETHOD(OnInPlaceActivate)()
00125   {
00126       m_bInPlaceActive = TRUE;
00127       return S_OK;
00128   }
00129
00130   STDMETHOD(GetWindowContext)(IOleInPlaceFrame** ppFrame,
00131                 IOleInPlaceUIWindow** ppDoc,
00132                 LPRECT lprcPosRect,
00133                 LPRECT lprcClipRect,
00134                 LPOLEINPLACEFRAMEINFO lpFrameInfo)
00135   {
00136     GetClientRect(lprcPosRect);
00137     GetClientRect(lprcClipRect);
00138     return S_OK;
00139   }
00140
00141   STDMETHOD(OnInPlaceDeactivate)()
00142   {
00143     m_bInPlaceActive = FALSE;
00144     return S_OK;
00145   }
00146
00147   STDMETHOD(OnUIActivate)() {return E_NOTIMPL;}
00148   STDMETHOD(Scroll)(SIZE scrollExtant) {return E_NOTIMPL;}
00149   STDMETHOD(OnUIDeactivate)(BOOL fUndoable) {return E_NOTIMPL;}
00150   STDMETHOD(DiscardUndoState)() {return E_NOTIMPL;}
00151   STDMETHOD(DeactivateAndUndo)( void) {return E_NOTIMPL;}
00152   STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect) {return E_NOTIMPL;}
00153
00154 // IOleClientSite Methods
00155 private:
00156   STDMETHOD(SaveObject)(void) {return E_NOTIMPL;}
00157   STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) {return E_NOTIMPL;}
00158   STDMETHOD(GetContainer)(IOleContainer **ppContainer) {return E_NOTIMPL;}
00159   STDMETHOD(ShowObject)(void) {return E_NOTIMPL;}
00160   STDMETHOD(OnShowWindow)(BOOL fShow) {return E_NOTIMPL;}
00161   STDMETHOD(RequestNewObjectLayout)(void) {return E_NOTIMPL;}
00162 };
00163
00164 #endif //__BROWSERHOST_H_
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/ctransaction.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

ctransaction.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CTRANSACTION.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CTRANSACTION_H_
00012 #define _CTRANSACTION_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019
00020
00021
00022 /////////////////////////////////////////////////////////////////
00023 // CTransaction class
00024 //
00025 /////////////////////////////////////////////////////////////////
00026 class CTransaction : public CContainerBase
00027 {
00028 public:
00029   //Constructors
00030   CTransaction(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00031   virtual ~CTransaction();
00032
00033   //IUnknown Helpers
00034   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00035   virtual HRESULT     AutoRelease();
00036   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00037
00038   //Pure Virtual
00039   virtual WCHAR*      GetObjectName()     { return L"Transaction";    }
00040   virtual UINT      GetObjectMenu()     { return IDM_TRANSACTIONMENU; }
00041   virtual LONG      GetObjectImage()    { return IMAGE_FORM;      }
00042   virtual REFIID      GetDefaultInterface() { return IID_ITransaction;    }
00043
00044   //Methods
00045
00046   //Helpers
00047
00048   //OLE DB Interfaces
00049   //[MANDATORY]
00050   ITransaction*         m_pITransaction;        //Transaction interface
00051
00052   //[OPTIONAL]
00053
00054   //Extra Interfaces
00055   DWORD             m_dwCookieTransNotify;
00056 };
00057
00058
00059
00060 /////////////////////////////////////////////////////////////////
00061 // CTransactionOptions class
00062 //
00063 /////////////////////////////////////////////////////////////////
00064 class CTransactionOptions : public CBase
00065 {
00066 public:
00067   //Constructors
00068   CTransactionOptions(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00069   virtual ~CTransactionOptions();
00070
00071   //IUnknown Helpers
00072   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00073   virtual HRESULT     AutoRelease();
00074   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00075
00076   //Pure Virtual
00077   virtual WCHAR*      GetObjectName()     { return L"TransactionOptions";     }
00078   virtual UINT      GetObjectMenu()     { return IDM_TRANSACTIONOPTIONSMENU;  }
00079   virtual LONG      GetObjectImage()    { return IMAGE_FORM;          }
00080   virtual REFIID      GetDefaultInterface() { return IID_ITransactionOptions;   }
00081
00082   //Methods
00083
00084   //Helpers
00085
00086   //OLE DB Interfaces
00087   //[MANDATORY]
00088   ITransactionOptions*      m_pITransactionOptions;     //TransactionOptions interface
00089
00090   //[OPTIONAL]
00091 };
00092
00093
00094 #endif  //_CTRANSACTION_H_
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PersistedConfigurationDataSet Member List

This is the complete list of members for PersistedConfigurationDataSet, including all inherited members.
Items PersistedConfigurationDataSet
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAddDeviceDlg Member List

This is the complete list of members for CAddDeviceDlg, including all inherited members.
CAddDeviceDlg(ULONG nTemplate, HWND hParentWnd) | CAddDeviceDlg |
CAddDeviceDlg(ULONG nTemplate, HWND hParentWnd) | CAddDeviceDlg |
CAddDeviceDlg(ULONG nTemplate, HWND hParentWnd) | CAddDeviceDlg |
CAddDeviceDlg(ULONG nTemplate, HWND hParentWnd) | CAddDeviceDlg |
CAddDeviceDlg(ULONG nTemplate, HWND hParentWnd) | CAddDeviceDlg |
CAddDeviceDlg(ULONG nTemplate, HWND hParentWnd) | CAddDeviceDlg |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
CBaseDialog(ULONG nTemplate=0) | CBaseDialog |
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
Create(HINSTANCE hInstance, HWND hWndParent, DWORD dwFlags=0) | CBaseDialog | [virtual]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, static]
m_hParentWnd | CAddDeviceDlg | [private]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam) | CBaseDialog | [protected, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [private, virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [virtual]
ProcessMessage(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAddDeviceDlg | [virtual]
~CAddDeviceDlg() | CAddDeviceDlg |
~CAddDeviceDlg() | CAddDeviceDlg |
~CAddDeviceDlg() | CAddDeviceDlg |
~CAddDeviceDlg() | CAddDeviceDlg |
~CAddDeviceDlg() | CAddDeviceDlg |
~CAddDeviceDlg() | CAddDeviceDlg |
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
~CBaseDialog() | CBaseDialog | [virtual]
Generated on Wed Nov 13 2024 16:55:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCOrder/QCOrder.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCOrder

QCOrder.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      QCOrder.cpp
00003   Summary:   Implementation of DLL exports
00004   Classes:   None
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #include "resource.h"
00024 #include "initguid.h"
00025 #include <adoid.h>    // ADO
00026 #include "../QCShip/QCShip.h"
00027 #include "../QCShip/QCShip_i.c"
00028 #include "QCOrder.h"
00029 #include "QCOrder_i.c"
00030 #include "Order.h"
00031
00032 CComModule _Module;
00033
00034 BEGIN_OBJECT_MAP(ObjectMap)
00035   OBJECT_ENTRY(CLSID_Order, COrder)
00036 END_OBJECT_MAP()
00037
00038 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00039   Function: DllMain
00040   Summary:  Main QCOrder DLL entry point
00041   Args:     HINSTANCE hInstance   An instance identifier
00042       DWORD dwReason      Reason DLL loaded
00043       LPVOID                  Reserved
00044   Returns:  BOOL - always TRUE
00045 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00046
00047 extern "C"
00048 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00049 {
00050   if (dwReason == DLL_PROCESS_ATTACH)
00051   {
00052     _Module.Init(ObjectMap, hInstance);
00053     DisableThreadLibraryCalls(hInstance);
00054   }
00055   else if (dwReason == DLL_PROCESS_DETACH)
00056     _Module.Term();
00057   return TRUE;    // ok
00058 }
00059
00060 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00061   Function: DllCanUnloadNow
00062   Summary:  Is this DLL in use or can it be unloaded
00063   Args:     None
00064   Returns:  S_OK    Can be unloaded
00065             S_FALSE Still in use
00066 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00067
00068 STDAPI DllCanUnloadNow(void)
00069 {
00070   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00071 }
00072
00073 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00074   Function: DllGetClassObject
00075   Summary:  Returns a class factory to create an object of the requested type
00076   Args:     REFCLSID rclsid     Class ID
00077             REFIID riid         Interface ID
00078             LPVOID *ppv         Returned class factory
00079   Returns:  Status from GetClassObject
00080 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00081
00082 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00083 {
00084   return _Module.GetClassObject(rclsid, riid, ppv);
00085 }
00086
00087 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00088   Function: DllRegisterServer
00089   Summary:  Adds entries to the system registry
00090   Args:     None
00091   Returns:  Status from RegisterServer
00092 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00093
00094 STDAPI DllRegisterServer(void)
00095 {
00096   // registers object, typelib and all interfaces in typelib
00097   return _Module.RegisterServer(TRUE);
00098 }
00099
00100 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00101   Function: DllUnregisterServer
00102   Summary:  Removes entries from the system registry
00103   Args:     None
00104   Returns:  Status from UnregisterServer
00105 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00106
00107 STDAPI DllUnregisterServer(void)
00108 {
00109   _Module.UnregisterServer();
00110   return S_OK;
00111 }
00112
00113
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/plugxprt.h Source File

  • Web
  • NetMeeting
  • PlugTransport

plugxprt.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     PLUGTRANSPORT.EXE
00003 //  File:       PLUGXPRT.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016
00017 #ifndef _PLUG_XPRT_H_
00018 #define _PLUG_XPRT_H_
00019
00020 #define CONNIDMAXLENGTH   64
00021
00022 class CPluggableTransport
00023 {
00024 private:
00025  IPluggableTransport *m_pIPlugTrans;
00026  BOOL m_bInConnection;
00027  HANDLE m_hEvtRead;
00028  HANDLE m_hEvtWrite;
00029  HANDLE m_hEvtClose;
00030  char m_szConnID[CONNIDMAXLENGTH];
00031
00032 public:
00033  CX224 *m_pX224;
00034  CPSTN *m_pPSTN;
00035
00036  CPluggableTransport(void);
00037  ~CPluggableTransport(void);
00038  HRESULT Initialize(INmManager *pINmManager);
00039  HRESULT Uninitialize();
00040  BOOL InConnection();
00041  HRESULT CreateConnection();  // for X224
00042  HRESULT CreateConnection(LPTSTR pszComPort);  // for PSTN
00043  HRESULT AcceptConnection(HWND hWnd);  // for X224
00044  HRESULT AcceptConnection(LPTSTR pszComPort);  // for PSTN
00045  HRESULT CloseConnection(PLUGXPRT_FRAMING eFraming);  // for both
00046  HRESULT EnableWinsock();
00047  HRESULT DisableWinsock();
00048  LPSTR GetConnectionID();
00049  HANDLE GetReadEventHandle();
00050  HANDLE GetWriteEventHandle();
00051  HANDLE GetCloseEventHandle();
00052 };
00053
00054 #endif // _PLUG_XPRT_H_
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GBGETINT Member List

This is the complete list of members for GBGETINT, including all inherited members.
fSigned | GBGETINT
fSuccess | GBGETINT
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MQPers/Rcv/StdAfx.h Source File

  • NetDS
  • MessageQueuing
  • MQPers
  • Rcv

StdAfx.h

Go to the documentation of this file.
00001 #include <windows.h>
00002 #include <tchar.h>
00003 #include <comdef.h>
00004 #include <objbase.h>
00005 #include <stdio.h>
00006 #include <iostream.h>
00007 #include "../GraphObj/GraphObj_i.c" // For IID_IPoint and IID_ILine
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • Toolbar

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021 #include "Comp.h"
00022 #include "CompData.h"
00023
00024 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00025
00026 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00027 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00028
00029 //==============================================================
00030 //
00031 // CDelegationBase implementation
00032 //
00033 //
00034 CDelegationBase::CDelegationBase()
00035 : bExpanded(FALSE)
00036 {
00037     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00038         LoadBitmaps();
00039 }
00040
00041 CDelegationBase::~CDelegationBase()
00042 {
00043 }
00044
00045 // CDelegationBase::AddImages sets up the collection of images to be displayed
00046 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00047 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00048 {
00049     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00050         (long *)m_pBMapLg, // pointer to a handle
00051         0, // index of the first image in the strip
00052         RGB(0, 128, 128)  // color of the icon mask
00053         );
00054 }
00055
00056 HRESULT CDelegationBase::OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile)
00057 {
00058     WCHAR topicName[MAX_PATH];
00059
00060     wcscpy(topicName, helpFile);
00061
00062     // we should read this from a resource file
00063     wcscat(topicName, L"::/default.htm");
00064
00065     LPOLESTR pszTopic = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(topicName) + 1) * sizeof(WCHAR)));
00066
00067     wcscpy(pszTopic, topicName);
00068
00069     return m_ipDisplayHelp->ShowTopic(pszTopic);
00070 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMScBuf.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

MMScBuf.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       mmscbuf.cxx
00006 //
00007 //  Contents:   Memory Mapped Stream buffer for consecutive buffer mapping
00008 //
00009 //  Classes:    CMmStreamConsecBuf
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include "mmscbuf.hxx"
00017
00018 //+-------------------------------------------------------------------------
00019 //
00020 //  Member:     CMmStreamConsecBuf::CMmStreamConsecBuf, public
00021 //
00022 //  Synopsis:   Constructor
00023 //
00024 //--------------------------------------------------------------------------
00025
00026 CMmStreamConsecBuf::CMmStreamConsecBuf()
00027 : _pMmStream(0)
00028 {
00029     LARGE_INTEGER liOffset = { 0, 0 };
00030     _liOffset = liOffset;
00031 }
00032
00033 //+-------------------------------------------------------------------------
00034 //
00035 //  Member:     CMmStreamConsecBuf::Map, public
00036 //
00037 //  Synopsis:   Map next consecutive part of file
00038 //
00039 //  Arguments:  [cb] -- size of the mapped area
00040 //
00041 //--------------------------------------------------------------------------
00042
00043 void CMmStreamConsecBuf::Map( ULONG cb )
00044 {
00045     Win4Assert( 0 != _pMmStream );
00046
00047     if ( Get() != 0 )
00048         _pMmStream->Unmap( *this );
00049
00050     LARGE_INTEGER liNewOffset;
00051     LARGE_INTEGER liStreamSize={_pMmStream->SizeLow(), _pMmStream->SizeHigh()};
00052
00053      liNewOffset.QuadPart = cb + _liOffset.QuadPart;
00054
00055     if ( liNewOffset.QuadPart > liStreamSize.QuadPart )
00056     {
00057         cb = (ULONG)(liStreamSize.QuadPart - _liOffset.QuadPart);
00058         liNewOffset = liStreamSize;
00059     }
00060
00061     _pMmStream->Map( *this,
00062                      cb,
00063                      _liOffset.LowPart,
00064                      _liOffset.HighPart );
00065
00066     _liOffset = liNewOffset;
00067 }
00068
00069 //+-------------------------------------------------------------------------
00070 //
00071 //  Member:     CMmStreamConsecBuf::Init, public
00072 //
00073 //  Synopsis:   Initizializes CMmStreamConsecBuf
00074 //
00075 //  Arguments:  [pMmStream] -- pointer to the CMmStream from which to fill
00076 //                             the buffer
00077 //
00078 //--------------------------------------------------------------------------
00079
00080 void CMmStreamConsecBuf::Init( PMmStream * pMmStream )
00081 {
00082     _pMmStream = pMmStream;
00083     LARGE_INTEGER liOffset = { 0, 0 };
00084     _liOffset = liOffset;
00085 }
00086
00087 //+-------------------------------------------------------------------------
00088 //
00089 //  Member:     CMmStreamConsecBuf::Rewind, public
00090 //
00091 //  Synopsis:   Rewind file to beginning.
00092 //
00093 //--------------------------------------------------------------------------
00094
00095 void CMmStreamConsecBuf::Rewind()
00096 {
00097
00098     Win4Assert( 0 != _pMmStream );
00099
00100     if ( Get() != 0 )
00101         _pMmStream->Unmap( *this );
00102
00103     _liOffset.LowPart = 0;
00104     _liOffset.HighPart = 0;
00105 }
00106
00107 //+-------------------------------------------------------------------------
00108 //
00109 //  Member:     CMmStreamConsecBuf::Eof, public
00110 //
00111 //  Synopsis:   Returns whether end of file has been hit
00112 //
00113 //  Returns:    FALSE if there is still more file to be mapped.  TRUE
00114 //              otherwise.
00115 //
00116 //--------------------------------------------------------------------------
00117
00118 BOOL CMmStreamConsecBuf::Eof()
00119 {
00120     Win4Assert( 0 != _pMmStream );
00121     return( ( (ULONG) _liOffset.HighPart == _pMmStream->SizeHigh() ) &&
00122             ( _liOffset.LowPart == _pMmStream->SizeLow() ) );
00123 }
00124
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/StdAfx.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #pragma once
00007
00008 #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
00009
00010 #ifndef _UNICODE
00011 #define _UNICODE            // Microsoft Windows NT Cluster Administrator
00012                             //   Extension DLLs need to be Unicode
00013                             //   applications.
00014 #endif
00015
00016 // Choose which threading model you want by commenting or uncommenting
00017 // the proper constant definition.  If you want multi-threading
00018 // (i.e. "both"), comment both definitions out.  Also change the
00019 // THREADFLAGS_xxx set in the DECLARE_REGISTRY macro invokation in ExtObj.h
00020 //#define _ATL_SINGLE_THREADED
00021 #define _ATL_APARTMENT_THREADED
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // Macros
00025 /////////////////////////////////////////////////////////////////////////////
00026
00027 #if(_WIN32_WINNT <= 0x0500)
00028 #define RTL_NUMBER_OF(A) (sizeof(A)/sizeof((A)[0]))
00029 #endif /* _WIN32_WINNT <= 0x0500 */
00030
00031 /////////////////////////////////////////////////////////////////////////////
00032 // Include Files
00033 /////////////////////////////////////////////////////////////////////////////
00034
00035 //
00036 // Project-wide pragmas
00037 //
00038 #pragma warning( disable : 4127 )   // conditional expression is constant (for BEGIN_COM_MAP & ASSERT)
00039 #pragma warning( disable : 4505 )   // <x>: unreferenced local function has been removed
00040 #pragma warning( disable : 4511 )   // <x>: copy constructor could not be generated
00041 #pragma warning( disable : 4512 )   // <x>: assignment operator could not be generated
00042 #pragma warning( disable : 4514 )   // <x>: unreferenced inline function has been removed
00043 #pragma warning( disable : 4710 )   // function '<x>' not inlined
00044
00045 //////////////////////////////////////////////////////////////////////////////
00046 // External Include Files
00047 //////////////////////////////////////////////////////////////////////////////
00048
00049 #pragma warning( push, 3 )
00050 #pragma warning( disable : 4601 )   // #pragma push_macro : 'new' is not currently defined as a macro
00051
00052 #include <afxwin.h>         // MFC core and standard components
00053 #include <afxext.h>         // MFC extensions
00054 #include <afxdisp.h>
00055 #include <afxtempl.h>
00056 #ifndef _AFX_NO_AFXCMN_SUPPORT
00057 #include <afxcmn.h>         // MFC support for Windows 95 Common Controls
00058 #endif // _AFX_NO_AFXCMN_SUPPORT
00059
00060 // Need to include this for WM_COMMANDHELP.  Unfortunately, both afxpriv.h and
00061 // atlconv.h define some of the same macros.  Since we are using ATL, we'll use
00062 // the ATL versions.
00063 #include <afxpriv.h>
00064
00065 #include <atlbase.h>
00066
00067 //You may derive a class from CComModule and use it if you want to override
00068 //something, but do not change the name of _Module
00069 extern CComModule _Module;
00070
00071 #include <atlcom.h>
00072
00073 #include <clusapi.h>
00074 #include <resapi.h>
00075
00076 #define STRSAFE_LIB
00077 #include <strsafe.h>
00078
00079 #include "proplist.h"
00080
00081 #pragma warning( pop )
00082
00083 /////////////////////////////////////////////////////////////////////////////
00084 // Common Types
00085 /////////////////////////////////////////////////////////////////////////////
00086
00087 typedef UINT    IDS;
00088 typedef UINT    IDD;
00089
00090 /////////////////////////////////////////////////////////////////////////////
00091 // Globals
00092 /////////////////////////////////////////////////////////////////////////////
00093
00094 extern const WCHAR g_wszResourceTypeNames[];
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/FreClien/GUIBALL.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • FreClien

GUIBALL.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GUIBALL.CPP
00003
00004   Summary:   Implementation file for the CGuiBall C++ class. A GuiBall is
00005              a C++ object that uses three independent worker threads to
00006              display a moving and bouncing ball in the client area of a
00007              designated window.  It is anchored to the Windows GUI
00008              (Graphical User Interface) environment. This GuiBall object
00009              continuously paints a ball image based on data it obtains
00010              from a virtual ball object. This virtual ball object is
00011              instantiated as a COM object (a COBall) in a separate
00012              thread-safe In-process server.
00013
00014              GuiBall launches three threads which all continuously and
00015              asynchronously command the ball to move. GuiBall itself
00016              provides methods to initialize the GuiBall, paint the ball
00017              image, and restart the motion. The cool thing about this
00018              arrangement between client and server is that the ball
00019              changes color as it moves. The ball color indicates the
00020              thread that last moved the ball. This gives a visual
00021              impact to multi-threading.
00022
00023              For a comprehensive tutorial code tour of GUIBALL's contents
00024              and offerings see the tutorial FRECLIEN.HTM file. For more
00025              specific technical details on the internal workings see the
00026              comments dispersed throughout the GUIBALL source code.
00027
00028   Classes:   CThreadInitData, CGuiBall
00029
00030   Origin:    4-5-96: atrent - Created for COM Tutorial Code Samples.
00031              Also benefits from the GDIDEMO sample in the Win32 samples of
00032              the Win32 SDK.
00033
00034 ----------------------------------------------------------------------------
00035   This file is part of the Microsoft COM Tutorial Code Samples.
00036
00037   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00038
00039   This source code is intended only as a supplement to Microsoft
00040   Development Tools and/or on-line documentation.  See these other
00041   materials for detailed information regarding Microsoft code samples.
00042
00043   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00044   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00045   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00046   PARTICULAR PURPOSE.
00047 ==========================================================================+*/
00048
00049 /*--------------------------------------------------------------------------
00050   We include WINDOWS.H for all Win32 applications.
00051   We include OLE2.H because we will be calling the COM/OLE Libraries.
00052   We include APPUTIL.H because we will be building this application using
00053     the convenient Virtual Window and Dialog classes and other
00054     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00055   We include IBALL.H and BALLGUID.H for the common Ball-related Interface
00056     class, GUID, and CLSID specifications.
00057   We include GUIBALL.H because it has the C++ class used for GUI display
00058     of the moving ball.
00059 ---------------------------------------------------------------------------*/
00060 #include <windows.h>
00061 #include <ole2.h>
00062 #include <apputil.h>
00063 #include <iball.h>
00064 #include <ballguid.h>
00065 #include "guiball.h"
00066 #include "freclien.h"
00067
00068
00069 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00070   Method:   CGuiBall::CGuiBall
00071
00072   Summary:  Constructor.
00073
00074   Args:     void
00075
00076   Modifies: ...
00077
00078   Returns:  void
00079 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00080 CGuiBall::CGuiBall(void)
00081 {
00082   m_hWnd    = 0;
00083   m_pIBall  = NULL;
00084   m_crColor = RGB(0,0,0);
00085   m_dwBallThread1 = 0;
00086   m_dwBallThread2 = 0;
00087   m_dwBallThread3 = 0;
00088   m_hBallThreads[0] = 0;
00089   m_hBallThreads[1] = 0;
00090   m_hBallThreads[2] = 0;
00091 }
00092
00093
00094 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00095   Method:   CGuiBall::~CGuiBall
00096
00097   Summary:  Destructor.
00098
00099   Args:     void
00100
00101   Modifies: ...
00102
00103   Returns:  void
00104 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00105 CGuiBall::~CGuiBall(void)
00106 {
00107   BOOL bOk = TRUE;
00108
00109   if (m_pIBall)
00110   {
00111     // Kill the client's app timer for its repaints.
00112     KillTimer(m_hWnd, 1);
00113
00114     // Call down to the server's COBall and tell it to shutdown.
00115     m_pIBall->Move(FALSE);
00116
00117     // Wait for the threads to terminate before closing their thread handles.
00118     WaitForMultipleObjects(3, m_hBallThreads, TRUE, INFINITE);
00119     for (size_t i = 0; i<3; i++)
00120       CloseHandle(m_hBallThreads[i]);
00121
00122     // Release for each of the thread copies handed out.
00123     m_pIBall->Release();
00124     m_pIBall->Release();
00125     m_pIBall->Release();
00126     // Do final Release for the main copy held in CGuiBall.
00127     RELEASE_INTERFACE(m_pIBall);
00128   }
00129 }
00130
00131
00132 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00133   Function: BallThreadProc
00134
00135   Summary:  The common thread procedure for all Ball-moving free threads.
00136
00137   Args:     LPARAM lparam
00138               Standard Window Proc parameter.
00139
00140   Modifies: .
00141
00142   Returns:  DWORD
00143               Thread procedure return (usually msg.wParam).
00144 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00145 DWORD WINAPI BallThreadProc(
00146                LPARAM lparam)
00147 {
00148   CThreadInitData* pInitData = (CThreadInitData*) lparam;
00149   DWORD nEndCount = 0;
00150   HRESULT hr;
00151   BOOL bAlive;
00152
00153   // Initialize COM for use by this thread. Tell COM this new thread
00154   // is another free-threaded thread in the multi-threaded apartment.
00155   hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00156   bAlive = SUCCEEDED(hr);
00157
00158   if (bAlive)
00159   {
00160     // Continuously move the ball while it is still alive.
00161     while (bAlive)
00162     {
00163       // Use system timer to slow down the ball motion to the range
00164       // of the humanly perceptible.
00165       if (GetTickCount() > nEndCount)
00166       {
00167         // After the delay, call from this thread thru IBall interface
00168         // to move the ball that lives in the single COBall COM object.
00169         // Set bAlive flag FALSE if the COBall can no longer move.
00170         hr = pInitData->m_pIBall->Move(TRUE);
00171         bAlive = (NOERROR == hr);
00172
00173         // Set new timer end count.
00174         nEndCount = GetTickCount() + pInitData->m_nDelay;
00175       }
00176     }
00177
00178     // UnInitialize COM for use by this thread.
00179     CoUninitialize();
00180   }
00181
00182   return 0;
00183 }
00184
00185
00186 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00187   Method:   CGuiBall::Init
00188
00189   Summary:  Get everything related to CGuiBall started. Make any
00190             subordinate objects, like COBall, and get it started. Starts
00191             the worker move-threads that breathe life into the COBall COM
00192             object.
00193
00194   Args:     HWND hWnd
00195               Handle of the main window. Part of what makes CGuiBall
00196               a GUI kind of thing.
00197
00198   Modifies: ...
00199
00200   Returns:  BOOL
00201               TRUE for success; FALSE for fail.
00202 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00203 BOOL CGuiBall::Init(
00204        HWND hWnd)
00205 {
00206   BOOL bOk = FALSE;
00207   HRESULT hr;
00208
00209   if (hWnd)
00210   {
00211     m_hWnd = hWnd;
00212
00213     // Call COM service to create the single COBall instance.
00214     // We are not aggregating it so we ask for its IBall interface
00215     // directly.
00216     hr = CoCreateInstance(
00217            CLSID_DllBall,
00218            NULL,
00219            CLSCTX_INPROC_SERVER,
00220            IID_IBall,
00221            (PPVOID)&m_pIBall);
00222     if (SUCCEEDED(hr))
00223     {
00224       // Now start up 3 client BallThreads that will all try to move the
00225       // Ball concurrently. They will bring independent asynchronous life
00226       // to the ball. The separate main process thread displays the ball.
00227       // These threads (including the main display thread) will all
00228       // comprise the multi-threaded apartment of the main process.
00229
00230       // Create Structures for thread initialization.
00231       m_BallThreadData1.m_hWnd = hWnd;
00232       m_BallThreadData1.m_nDelay = BALL_MOVE_DELAY;
00233       m_BallThreadData1.m_pIBall = m_pIBall;
00234       m_BallThreadData2.m_hWnd = hWnd;
00235       m_BallThreadData2.m_nDelay = BALL_MOVE_DELAY;
00236       m_BallThreadData2.m_pIBall = m_pIBall;
00237       m_BallThreadData3.m_hWnd = hWnd;
00238       m_BallThreadData3.m_nDelay = BALL_MOVE_DELAY;
00239       m_BallThreadData3.m_pIBall = m_pIBall;
00240
00241       // Create the ball-moving thread #1.
00242       m_hBallThreads[0] = CreateThread(
00243                             0,
00244                             0,
00245                             (LPTHREAD_START_ROUTINE) BallThreadProc,
00246                             (LPVOID) &m_BallThreadData1,
00247                             0,
00248                             &m_dwBallThread1);
00249
00250       bOk = (NULL != m_hBallThreads[0]);
00251       if (bOk)
00252       {
00253         // AddRef for the copy handed out to free-thread1.
00254         m_pIBall->AddRef();
00255
00256         // Create the Ball Moving Thread #2.
00257         m_hBallThreads[1] = CreateThread(
00258                               0,
00259                               0,
00260                               (LPTHREAD_START_ROUTINE) BallThreadProc,
00261                               (LPVOID) &m_BallThreadData2,
00262                               0,
00263                               &m_dwBallThread2);
00264
00265         bOk = (NULL != m_hBallThreads[1]);
00266         if (bOk)
00267         {
00268           // AddRef for the copy handed out to free-thread2.
00269           m_pIBall->AddRef();
00270
00271           // Create the Ball Moving Thread #3.
00272           m_hBallThreads[2] = CreateThread(
00273                                 0,
00274                                 0,
00275                                 (LPTHREAD_START_ROUTINE) BallThreadProc,
00276                                 (LPVOID) &m_BallThreadData3,
00277                                 0,
00278                                 &m_dwBallThread3);
00279
00280           bOk = (NULL != m_hBallThreads[2]);
00281           if (bOk)
00282           {
00283             // AddRef for the copy handed out to free-thread3.
00284             m_pIBall->AddRef();
00285           }
00286         }
00287       }
00288     }
00289     else
00290       HrMsg(hWnd, TEXT(NOCOMOBJ_ERROR_STR), hr);
00291
00292     if (!bOk)
00293     {
00294       hr = GetLastError();
00295       if (FAILED(hr))
00296         HrMsg(hWnd, TEXT(NOTHREAD_ERROR_STR), hr);
00297     }
00298   }
00299
00300   if (bOk)
00301   {
00302     // Set up the client process to periodically paint the ball
00303     // thru WM_TIMER messages to the main Window proc.
00304     SetTimer(hWnd, 1, BALL_PAINT_DELAY, NULL);
00305   }
00306
00307   return (bOk);
00308 }
00309
00310
00311 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00312   Method:   CGuiBall::PaintBall
00313
00314   Summary:  Tell CGuiBall to paint one image of the GuiBall.
00315
00316   Args:     void
00317
00318   Modifies: ...
00319
00320   Returns:  void
00321 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00322 void CGuiBall::PaintBall(void)
00323 {
00324   HDC       hDC;
00325   HBRUSH    hBrush;
00326   POINT     Org, Ext;
00327   HRGN      hNew;
00328
00329   if (m_pIBall)
00330   {
00331     // Ask the COBall for its current ball (location, region, and color).
00332     m_pIBall->GetBall(&Org, &Ext, &m_crColor);
00333
00334     // Create the new ball image/region.
00335     hNew = CreateEllipticRgn(Org.x, Org.y, Ext.x, Ext.y);
00336
00337     if(hDC = GetDC(m_hWnd))
00338     {
00339       // Make a paint brush, dip it in pixel paint, and paint the
00340       // ball image.
00341       hBrush = CreateSolidBrush(m_crColor);
00342       FillRgn(hDC, hNew, hBrush);
00343       DeleteObject(hBrush);
00344       ReleaseDC(m_hWnd, hDC);
00345     }
00346
00347     // Delete the region object.
00348     DeleteObject(hNew);
00349   }
00350
00351   return;
00352 }
00353
00354
00355 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00356   Method:   CGuiBall::Restart
00357
00358   Summary:  Restart the display process. Places ball in start position
00359             in a clean window.
00360
00361   Args:     void.
00362
00363   Modifies: ...
00364
00365   Returns:  void.
00366 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00367 void CGuiBall::Restart(void)
00368 {
00369   RECT  WinRect;
00370   HDC   hDC = GetDC(m_hWnd);
00371
00372   if(hDC && m_pIBall)
00373   {
00374     GetClientRect(m_hWnd, &WinRect);
00375     FillRect(hDC, &WinRect, GETCLASSBRUSH(m_hWnd));
00376
00377     // Tell the COBall to reset itself.
00378     m_pIBall->Reset(&WinRect, 0);
00379
00380     // Call our own CGuiBall method to paint an initial image of the ball.
00381     PaintBall();
00382
00383     // Release the Device Context.
00384     ReleaseDC(m_hWnd, hDC);
00385   }
00386
00387   return;
00388 }
00389
00390
00391 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00392   Method:   CGuiBall::PaintWin
00393
00394   Summary:  Clears window background and paints the GuiBall at its
00395             current location.
00396
00397   Args:     void
00398
00399   Modifies: ...
00400
00401   Returns:  void
00402 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00403 void CGuiBall::PaintWin(void)
00404 {
00405   HDC         hDC;
00406   PAINTSTRUCT ps;
00407   RECT        WinRect;
00408
00409   if(hDC = BeginPaint(m_hWnd, &ps))
00410     EndPaint(m_hWnd, &ps);
00411
00412   if(hDC = GetDC(m_hWnd))
00413   {
00414     // Get our window's client area rectangle.
00415     GetClientRect(m_hWnd, &WinRect);
00416     // Fill that rectangle with pixels of white paint.
00417     FillRect(hDC, &WinRect, GETCLASSBRUSH(m_hWnd));
00418
00419     // Paint a current  image of the ball wherever it is.
00420     PaintBall();
00421
00422     ReleaseDC(m_hWnd, hDC);
00423   }
00424
00425   return;
00426 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/HiPerfClient/RefClint.h Source File

  • SysMgmt
  • WMI
  • VC
  • HiPerfClient

RefClint.h

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 ///////////////////////////////////////////////////////////////////
00003 //
00004 //  RefClint.h : Refresher client header file
00005 //
00006 //  Created by a-dcrews and sanjes
00007 //
00008 ///////////////////////////////////////////////////////////////////
00009
00010 #ifndef _REFCLINT_H_
00011
00012 #define _REFCLINT_H_
00013
00014 #include <wbemcli.h>
00015
00016 ///////////////////////////////////////////////////////////////////
00017 //
00018 //  Globals and constants
00019 //
00020 ///////////////////////////////////////////////////////////////////
00021
00022 const WCHAR cwcsObjectPath[]  = L"Win32_BasicHiPerf"; // The name of the sample object
00023 const long  clNumInstances    = 5;      // The number of Win32_BasicHiPerf instances
00024 const DWORD cdwNumReps    = 100;      // The number of sample refreshes
00025
00026 ///////////////////////////////////////////////////////////////////
00027 //
00028 //  CRefresherMember
00029 //
00030 //  This class facilitates the management of objects or enumerators
00031 //  that have been added to the refresher and the unique ID assigned
00032 //  to them.
00033 //
00034 ///////////////////////////////////////////////////////////////////
00035
00036 template<class T>
00037 class CRefresherMember
00038 {
00039   T*    m_pMember;
00040   long  m_lID;
00041
00042 public:
00043   CRefresherMember() : m_pMember( NULL ), m_lID( 0 ) {}
00044   virtual ~CRefresherMember() { if ( NULL != m_pMember) m_pMember->Release(); }
00045
00046   void Set(T* pMember, long lID);
00047   void Reset();
00048
00049   T* GetMember();
00050   long GetID(){ return m_lID; }
00051 };
00052
00053 template <class T> inline void CRefresherMember<T>::Set(T* pMember, long lID)
00054 {
00055   if ( NULL != pMember )
00056     pMember->AddRef();
00057   if ( NULL != m_pMember)
00058     m_pMember->Release();
00059   m_pMember = pMember;
00060   m_lID = lID;
00061 }
00062
00063 template <class T> inline void CRefresherMember<T>::Reset()
00064 {
00065   if (NULL != m_pMember)
00066     m_pMember->Release();
00067
00068   m_pMember = NULL;
00069   m_lID = 0;
00070 }
00071
00072 template <class T> inline T* CRefresherMember<T>::GetMember()
00073 {
00074   if ( NULL != m_pMember )
00075     m_pMember->AddRef();
00076
00077   return m_pMember;
00078 }
00079
00080
00081 ///////////////////////////////////////////////////////////////////
00082 //
00083 //  CRefClient
00084 //
00085 //  This class encapsulates the basic functionality of a WMI client
00086 //  using the high performance refresher interface.
00087 //
00088 ///////////////////////////////////////////////////////////////////
00089
00090 class CRefClient
00091 {
00092   IWbemServices*        m_pNameSpace;   // A pointer to the namespace
00093   IWbemRefresher*       m_pRefresher;   // A pointer to the refresher
00094   IWbemConfigureRefresher*    m_pConfig;    // A pointer to the refresher's manager
00095
00096   CRefresherMember<IWbemHiPerfEnum> m_Enum;     // The enumerator added to the refresher
00097   CRefresherMember<IWbemObjectAccess> m_Instances[clNumInstances];  // The instances added to the refreshrer
00098
00099 protected:
00100   HRESULT SetHandles();
00101 public:
00102   CRefClient();
00103   virtual ~CRefClient();
00104   HRESULT Initialize(IWbemServices* pNameSpace);
00105   HRESULT AddObjects();
00106   HRESULT RemoveObjects();
00107   HRESULT ShowObjectData();
00108
00109   HRESULT AddEnum();
00110   HRESULT RemoveEnum();
00111   HRESULT ShowEnumeratorData();
00112
00113   HRESULT Refresh();
00114 };
00115
00116 #endif  //_REFCLINT_H_
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/basesnap.h Source File

  • SysMgmt
  • MMC
  • Menubtn

basesnap.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018 #ifndef _BASESNAP_H_
00019 #define _BASESNAP_H_
00020
00021 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj);
00022 STDAPI DllCanUnloadNow(void);
00023
00024 ULONG g_uObjects = 0;
00025 ULONG g_uSrvLock = 0;
00026
00027 class CClassFactory : public IClassFactory
00028 {
00029 private:
00030     ULONG m_cref;
00031
00032 public:
00033     enum FACTORY_TYPE {COMPONENT = 0, ABOUT = 1};
00034
00035     CClassFactory(FACTORY_TYPE factoryType);
00036     ~CClassFactory();
00037
00038     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00039     STDMETHODIMP_(ULONG) AddRef();
00040     STDMETHODIMP_(ULONG) Release();
00041
00042     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID *);
00043     STDMETHODIMP LockServer(BOOL);
00044
00045 private:
00046     FACTORY_TYPE m_factoryType;
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/LSP/sockinfo.cpp Source File

  • NetDS
  • WinSock
  • LSP

sockinfo.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1999  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: provider.cpp
00009 //
00010 // Description:
00011 //
00012 //    This sample illustrates how to develop a layered service provider that is
00013 //    capable of counting all bytes transmitted through a TCP/IP socket.
00014 //
00015 //    This file contains support functions that are common to the lsp and
00016 //    the instlsp sample for enumerating the Winsock catalog of service
00017 //    providers.
00018 //
00019
00020 #include "provider.h"
00021
00022 //
00023 // External variable definitions
00024 //
00025 extern CRITICAL_SECTION gCriticalSection;
00026 extern INT              gLayerCount;
00027 extern PROVIDER        *gBaseInfo;
00028 extern HANDLE           hLspHeap;
00029 extern HANDLE           gAddContextEvent;
00030
00031 static char Msg[512];
00032
00033 //
00034 // Function: FindAndLockSocketContext
00035 //
00036 // Description:
00037 //    This routine grabs the LSP critical seciton to lookup the socket context
00038 //    and increase its ref count. Any operation on the socket context holds
00039 //    the critical section so that it cannot be freed while its state changes.
00040 //
00041 SOCK_INFO *FindAndLockSocketContext(SOCKET s, int *lpErrno)
00042 {
00043     SOCK_INFO *SocketContext=NULL;
00044     int        ret;
00045
00046     EnterCriticalSection(&gCriticalSection);
00047
00048     ret = MainUpCallTable.lpWPUQuerySocketHandleContext(
00049             s,
00050             (PDWORD_PTR) &SocketContext,
00051             lpErrno
00052             );
00053     if (ret == SOCKET_ERROR)
00054     {
00055         dbgprint("FindAndLockSocketContext: WPUQuerySocketHandleContext failed: %d", *lpErrno);
00056     }
00057     else
00058     {
00059         InterlockedIncrement(&SocketContext->RefCount);
00060     }
00061     LeaveCriticalSection(&gCriticalSection);
00062
00063     return SocketContext;
00064 }
00065
00066 //
00067 // Function: UnlockSocketContext
00068 //
00069 // Description:
00070 //    This routine holds the LSP critical section and decrements the ref count
00071 //    by one. It also checks if the socket has been closed while holding the
00072 //    ref count. This can happen if two threads are accessing a socket simultaneously
00073 //    and one calls closesocket. We don't want to remove the context from under
00074 //    the second thread so it is marked as closing instead.
00075 //
00076 void UnlockSocketContext(SOCK_INFO *context, int *lpErrno)
00077 {
00078     LONG    newval;
00079
00080     EnterCriticalSection(&gCriticalSection);
00081
00082     // Decrement the ref count and see if someone closed this socket (from another thread)
00083     newval = InterlockedDecrement(&context->RefCount);
00084     if ((newval == 0) && (context->dwOutstandingAsync == 0) && (context->bClosing))
00085     {
00086         // Socket has been closed so close the handle and free associated resources
00087         if (MainUpCallTable.lpWPUCloseSocketHandle(context->LayeredSocket, lpErrno) == SOCKET_ERROR)
00088         {
00089             dbgprint("UnlockSocketContext: WPUCloseSocketHandle() failed: %d", *lpErrno);
00090         }
00091
00092         context->LayeredSocket = INVALID_SOCKET;
00093
00094         RemoveSocketInfo(context->Provider, context);
00095
00096         #ifdef DEBUG
00097         dbgprint("Closing socket %d Bytes Sent [%lu] Bytes Recv [%lu]",
00098                 context->LayeredSocket, context->BytesSent, context->BytesRecv);
00099         #endif
00100
00101         ReleaseSocketLock(context);
00102
00103         #ifdef DEBUG
00104         dbgprint("Freeing a SOCK_INFO (SocketContext) structure");
00105         #endif
00106
00107         FreeSockInfo(context);
00108         context = NULL;
00109     }
00110
00111     LeaveCriticalSection(&gCriticalSection);
00112 }
00113
00114 //
00115 // Function: AcquireSocketLock
00116 //
00117 // Description:
00118 //    This routine acquires the critical section which is a member of the
00119 //    socket's context structure. This is held when modifying the socket
00120 //    context outside of looking up the context (which is performed by
00121 //    FindAndLockSocketContext).
00122 //
00123 void AcquireSocketLock(SOCK_INFO *SockInfo)
00124 {
00125     EnterCriticalSection(&SockInfo->SockCritSec);
00126 }
00127
00128 //
00129 // Function: ReleaseSocketLock
00130 //
00131 // Description:
00132 //    This routine releases the socket context critical section.
00133 //
00134 void ReleaseSocketLock(SOCK_INFO *SockInfo)
00135 {
00136     LeaveCriticalSection(&SockInfo->SockCritSec);
00137 }
00138
00139 //
00140 // Function: CreateSockInfo
00141 //
00142 // Description:
00143 //    Allocates a new socket info context structure and initializes the fields
00144 //    except for the LayeredSocket field. The context must be allocated first,
00145 //    then the layered socket is created (with the SOCK_INFO structure as the
00146 //    context information), and then the LayeredSocket field is set. If
00147 //    the Inherit context is provided, information is copied to the new socket
00148 //    context structure (such as with WSPAccept). If the Insert flag is TRUE
00149 //    then the context is automatically inserted into the list of sockets
00150 //    for the given provider. If not then the caller must insert the context
00151 //    (WSPAccept does this to ensure all fields of the context are valid
00152 //    including LayeredSocket before insertion so that the async thread
00153 //    handler will work properly).
00154 //
00155 SOCK_INFO *CreateSockInfo(PROVIDER *Provider, SOCKET ProviderSocket, SOCK_INFO *Inherit, BOOL Insert)
00156 {
00157     SOCK_INFO   *NewInfo=NULL;
00158
00159     NewInfo = (SOCK_INFO *)HeapAlloc(hLspHeap,
00160                                      HEAP_ZERO_MEMORY,
00161                                      sizeof(SOCK_INFO));
00162     if (NewInfo == NULL)
00163     {
00164         dbgprint("HeapAlloc() failed: %d", GetLastError());
00165         return NULL;
00166     }
00167     NewInfo->ProviderSocket     = ProviderSocket;
00168     NewInfo->bClosing           = FALSE;
00169     NewInfo->dwOutstandingAsync = 0;
00170     NewInfo->BytesRecv          = 0;
00171     NewInfo->BytesSent          = 0;
00172     NewInfo->Provider           = Provider;
00173     NewInfo->hWnd               = (Inherit ? Inherit->hWnd : 0);
00174     NewInfo->uMsg               = (Inherit ? Inherit->uMsg : 0);
00175
00176     InitializeCriticalSection(&NewInfo->SockCritSec);
00177
00178     if (Insert == TRUE)
00179     {
00180         InsertSocketInfo(Provider, NewInfo);
00181     }
00182
00183     return NewInfo;
00184 }
00185
00186 //
00187 // Function: FreeSockInfo
00188 //
00189 // Description:
00190 //    This routine frees the socket context structure.
00191 //
00192 void FreeSockInfo(SOCK_INFO *info)
00193 {
00194     DeleteCriticalSection(&info->SockCritSec);
00195     HeapFree(hLspHeap, 0, info);
00196
00197     return;
00198 }
00199
00200 //
00201 // Function: InsertSocketInfo
00202 //
00203 // Description:
00204 //    We keep track of all the sockets created for a particulare provider.
00205 //    This routine inserts a newly created socket (and its SOCK_INFO) into
00206 //    the list.
00207 //
00208 void InsertSocketInfo(PROVIDER *provider, SOCK_INFO *sock)
00209 {
00210     if (!provider || !sock)
00211     {
00212         dbgprint("InsertSocketInfo: PROVIDER or SOCK_INFO == NULL!");
00213         return;
00214     }
00215
00216     EnterCriticalSection(&provider->ProviderCritSec);
00217
00218     sock->next = sock->prev = NULL;
00219
00220     sock->next = provider->SocketList;
00221     if (provider->SocketList)
00222     {
00223         provider->SocketList->prev = sock;
00224     }
00225     provider->SocketList = sock;
00226
00227     LeaveCriticalSection(&provider->ProviderCritSec);
00228
00229     SetEvent(gAddContextEvent);
00230 }
00231
00232 //
00233 // Function: RemoveSocketInfo
00234 //
00235 // Description:
00236 //    This function removes a given SOCK_INFO structure from the referenced
00237 //    provider. It doesn't free the structure, it just removes it from the
00238 //    list.
00239 //
00240 void RemoveSocketInfo(PROVIDER *provider, SOCK_INFO *si)
00241 {
00242     EnterCriticalSection(&provider->ProviderCritSec);
00243     if (si->prev == NULL)
00244     {
00245         provider->SocketList = si->next;
00246         if (provider->SocketList)
00247             provider->SocketList->prev = NULL;
00248     }
00249     else
00250     {
00251         si->prev->next = si->next;
00252         if (si->next)
00253             si->next->prev = si->prev;
00254     }
00255
00256     LeaveCriticalSection(&provider->ProviderCritSec);
00257 }
00258
00259 //
00260 // Function: CloseAndFreeSocketInfo
00261 //
00262 // Description:
00263 //    Closes all sockets belonging to the specified provider and frees
00264 //    the context information. If the lower provider socket is still
00265 //    valid, set an abortive linger, and close the socket.
00266 //
00267 void CloseAndFreeSocketInfo(PROVIDER *provider)
00268 {
00269     SOCK_INFO    *si=NULL,
00270                  *siprev=NULL;
00271     struct linger linger;
00272     int           Error, ret;
00273
00274     linger.l_onoff = 1;
00275     linger.l_linger = 0;
00276
00277     // Walk the list of sockets
00278     si = provider->SocketList;
00279     while (si)
00280     {
00281         // Set the abortive linger
00282         ret = provider->NextProcTable.lpWSPSetSockOpt(
00283             si->ProviderSocket,
00284             SOL_SOCKET,
00285             SO_LINGER,
00286             (char *)&linger,
00287             sizeof(linger),
00288             &Error);
00289         if (ret != SOCKET_ERROR)
00290         {
00291             // Close the lower provider socket
00292             ret = provider->NextProcTable.lpWSPCloseSocket(
00293                 si->ProviderSocket,
00294                 &Error);
00295             if (ret == SOCKET_ERROR)
00296             {
00297                 dbgprint("WSPCloseSocket() on handle %d failed: %d", si->ProviderSocket, Error);
00298             }
00299             #ifdef DEBUG
00300             else
00301             {
00302                 dbgprint("Successfully closed socket %d", si->ProviderSocket);
00303             }
00304             #endif
00305         }
00306         #ifdef DEBUG
00307         else
00308         {
00309             dbgprint("WSPSetSockOpt(SO_LINGER) failed: %d", Error);
00310         }
00311         #endif
00312
00313         // Close the layered handle
00314         MainUpCallTable.lpWPUCloseSocketHandle(
00315             si->LayeredSocket,
00316             &Error);
00317
00318         siprev = si;
00319         si = si->next;
00320
00321         // Free the context structure
00322         FreeSockInfo(siprev);
00323     }
00324     return;
00325 }
00326
00327 //
00328 // Function: GetCallerSocket
00329 //
00330 // Description:
00331 //    This function returns the SOCK_INFO structure for the given
00332 //    provider socket. If provider is NULL then we'll search all
00333 //    providers for the socket info. This routine is only used
00334 //    in handling asynchronous window messages (WSAAsyncSelect)
00335 //    since the window handler receives only the provider's socket
00336 //    and we need to find the associated context structure.
00337 //
00338 SOCK_INFO *GetCallerSocket(PROVIDER *provider, SOCKET ProviderSock)
00339 {
00340     SOCK_INFO *si;
00341
00342     EnterCriticalSection(&gCriticalSection);
00343
00344     if (provider)
00345     {
00346         // If we know the provider just search its list of sockets
00347         si = provider->SocketList;
00348         while(si)
00349         {
00350             if (si->ProviderSocket == ProviderSock)
00351             {
00352                 LeaveCriticalSection(&gCriticalSection);
00353                 return si;
00354             }
00355             si = si->next;
00356         }
00357     }
00358     else
00359     {
00360         // Don't know the provider so we must search all of them
00361         for(INT i=0; i < gLayerCount ;i++)
00362         {
00363             si = gBaseInfo[i].SocketList;
00364             while (si)
00365             {
00366                 if (si->ProviderSocket == ProviderSock)
00367                 {
00368                     LeaveCriticalSection(&gCriticalSection);
00369                     return si;
00370                 }
00371                 si = si->next;
00372             }
00373         }
00374     }
00375
00376     LeaveCriticalSection(&gCriticalSection);
00377     return NULL;
00378 }
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::ADORecordConstruction Member List

This is the complete list of members for msado15::ADORecordConstruction, including all inherited members.
getRow() | msado15::ADORecordConstruction |
iid | msado15::ADORecordConstruction | [static]
setParentRow(IUnknown _jcomparam_0) | msado15::ADORecordConstruction |
setRow(IUnknown ppRow) | msado15::ADORecordConstruction |
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCOrder/Order.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCOrder

Order.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      Order.cpp
00003   Summary:   Implementation of COrder class
00004   Classes:   Implemented: COrder
00005        Used: ADO  CLSID_ADOConnection
00006        Used: COM+ ObjectContext
00007   Methods:   put_CustomerId
00008        put_OrderId
00009        LineItem
00010        ProcessOrder
00011   Origin:    Implementation of case study in Queued Components specification
00012 ----------------------------------------------------------------------------
00013   Copyright 1992 - 2000 Microsoft Corporation, All rights reserved.
00014
00015     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00016     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00017     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018     PARTICULAR PURPOSE
00019 ==========================================================================+*/
00020
00021 #include "stdafx.h"
00022 #include "..\DataSourceNames.h" // ADO Data Source Names, userid, password
00023 #include <adoid.h>    // ADO OLEDBSDK
00024 #include <adoint.h>   // ADO OLEDBSDK
00025 #include "QCOrder.h"
00026 #include "Order.h"
00027 #include "..\QCOrder\processFlags.h"
00028 #include "..\QCShip2\QCShip2.h"
00029
00030 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00031   Method:   COrder::put_CustomerId
00032   Summary:  property put for CustomerId property
00033   Args:     long lCustomerId      A customer identifier
00034   Modifies: class member variable m_lCustomerId
00035   Returns:  HRESULT - Always returns S_OK
00036 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00037
00038 STDMETHODIMP COrder::put_CustomerId(long lCustomerId)
00039 {
00040   m_lCustomerId = lCustomerId;
00041   return S_OK;
00042 }
00043
00044 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00045   Method:   COrder::put_OrderId
00046   Summary:  property put for OrderId property
00047   Args:     long lOrderId     An order identifier
00048   Modifies: class member variable m_lOrderId
00049   Returns:  HRESULT - Always returns S_OK
00050 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00051
00052 STDMETHODIMP COrder::put_OrderId(long lOrderId)
00053 {
00054   m_lOrderId = lOrderId;
00055   return S_OK;
00056 }
00057
00058 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00059   Method:   COrder::LineItem
00060   Summary:  Adds a single item to an order
00061   Args:     long lItemId      An item identifier (e.g. stock number)
00062       long lQuantity      Quantity of the item ordered
00063   Modifies: class members m_veclItemId and m_veclQuantity
00064   Returns:  HRESULT - Always returns S_OK
00065 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00066
00067 STDMETHODIMP COrder::LineItem(long lItemId, long lQuantity)
00068 {
00069   m_veclItemId.push_back(lItemId);
00070   m_veclQuantity.push_back(lQuantity);
00071   return S_OK;
00072 }
00073
00074 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00075   Method:   COrder::Process
00076   Summary:  Adds order to Order Entry table.
00077       Sends order to shipping department.
00078   Args:     long  lFlags - option flags - see constants in IDL file
00079   Modifies: Rows in order entry database (DSN = QCSampOrder)
00080       Issues COM+ SetComplete or SetAbort depending on request success
00081   Returns:  HRESULT - returns failure from embedded function requests or S_OK
00082 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00083
00084 STDMETHODIMP COrder::Process(long lFlags)
00085 {
00086   HRESULT hr = S_OK;
00087
00088   _RPT1(_CRT_WARN, "QCSamp2 %d Order\n", m_lOrderId);
00089
00090   if (lFlags & processFlagWriteDB) hr = WriteOrderDB();
00091
00092   if (SUCCEEDED(hr)) hr = InvokeShip(lFlags);
00093
00094   // Invoke SetComplete or SetAbort depending on our success
00095
00096   // We may be able to replace this with an "autodone" attribute
00097
00098   CComPtr<IObjectContext> pIObjectContext;
00099
00100   if (SUCCEEDED(CoGetObjectContext(IID_IObjectContext, (void**)&pIObjectContext)))
00101   {
00102     if (SUCCEEDED(hr))  pIObjectContext->SetComplete();
00103     else        pIObjectContext->SetAbort();
00104   }
00105
00106   return hr;
00107 }
00108
00109 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00110   THIS IS A PRIVATE MEMBER FUNCTION
00111
00112   Method:   COrder::InvokeShip
00113   Summary:  Creates a Ship object to send to the shipping department
00114   Args:     long  lFlags - option flags
00115   Modifies: None
00116   Returns:  HRESULT from the underlying requests
00117 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00118
00119 HRESULT COrder::InvokeShip(long lFlags)
00120 {
00121   LPWSTR pwszDisplayName;
00122
00123   if (lFlags & processFlagQueuedComponents)
00124     pwszDisplayName = L"queue:/new:QCShip2.Ship2";
00125   else
00126     pwszDisplayName = L"new:QCShip2.Ship2";
00127
00128   CComPtr<IUnknown> punkShip2;
00129
00130   HRESULT hr = CoGetObject(pwszDisplayName, 0, IID_IUnknown, (void **) &punkShip2);
00131   if (SUCCEEDED(hr))
00132   {
00133     if (lFlags & processFlagLateBound)
00134       hr = InvokeShipIDispatch(punkShip2, lFlags);
00135     else
00136       hr = InvokeShipVtable(punkShip2, lFlags);
00137   }
00138   return hr;
00139 }
00140
00141 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00142   THIS IS A PRIVATE MEMBER FUNCTION
00143
00144   Method:   COrder::InvokeShipIDispatch
00145   Summary:  Creates a Ship2 object to send to the shipping department
00146   Args:     IUnknown *  punkShip2 - IUnknown * to Shipping object
00147       long    lFlags  - flag longword with option bits
00148   Modifies: None
00149   Returns:  HRESULT from the underlying requests
00150 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00151
00152 HRESULT COrder::InvokeShipIDispatch(IUnknown * punkShip2, long lFlags)
00153 {
00154   HRESULT hr = S_OK;
00155   LPWSTR pwszDisplayName;
00156   CComQIPtr<IDispatch, &IID_IDispatch> pIDispatch(punkShip2);
00157   CComPtr<IUnknown> punkNotify;
00158
00159   if (!pIDispatch) hr = E_NOINTERFACE;
00160
00161   // Set CustomerId property
00162
00163   if (SUCCEEDED(hr))
00164   {
00165     const int nNames = 1;   // number of names
00166
00167     OLECHAR * rgszNames[nNames] = { OLESTR("CustomerId") };
00168     DISPID    dispId[nNames];
00169
00170     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00171                     LOCALE_SYSTEM_DEFAULT, dispId);
00172     if (SUCCEEDED(hr))
00173     {
00174       CComVariant varData(m_lCustomerId);
00175       DISPID    dispidPut = DISPID_PROPERTYPUT;
00176       DISPPARAMS  dispparams = {&varData, &dispidPut, 1, 1};
00177
00178       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00179                   DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
00180     }
00181   }
00182
00183   // Set OrderId property
00184
00185   if (SUCCEEDED(hr))
00186   {
00187     const int nNames = 1;
00188
00189     OLECHAR * rgszNames[nNames] = { OLESTR("OrderId") };
00190     DISPID    dispId[nNames];
00191
00192     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00193                     LOCALE_SYSTEM_DEFAULT, dispId);
00194     if (SUCCEEDED(hr))
00195     {
00196       CComVariant varData(m_lOrderId);
00197       DISPID    dispidPut = DISPID_PROPERTYPUT;
00198       DISPPARAMS  dispparams = {&varData, &dispidPut, 1, 1};
00199
00200       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00201                   DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
00202     }
00203   }
00204
00205   // Call LineItem method once for each line item
00206
00207   if (SUCCEEDED(hr))
00208   {
00209     const int nNames = 3;     // number of names to look up
00210
00211     OLECHAR * rgszNames[nNames] = { OLESTR("LineItem"),   // method name
00212                       OLESTR("lItemId"),    // parm name
00213                       OLESTR("lQuantity") };  // parm name
00214     DISPID    dispId[nNames];
00215
00216     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00217                     LOCALE_SYSTEM_DEFAULT, dispId);
00218
00219     for (int ix = 0; ix < m_veclItemId.size() && SUCCEEDED(hr); ix++)
00220     {
00221       const int nArgs = nNames - 1;   // number of arguments
00222
00223       CComVariant varData[nArgs];     // number of arguments
00224       varData[0] = m_veclItemId[ix];
00225       varData[1] = m_veclQuantity[ix];
00226
00227       DISPPARAMS dispparams = {varData, &dispId[1], nArgs, nArgs};
00228
00229       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00230                   DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
00231     }
00232   }
00233
00234   // Create Notify callback object
00235   if (SUCCEEDED(hr))
00236   {
00237     if (lFlags & processFlagQueuedComponents)
00238       pwszDisplayName = L"queue:/new:QCNotify.Notify";
00239     else
00240       pwszDisplayName = L"new:QCNotify.Notify";
00241
00242     hr = CoGetObject(pwszDisplayName, NULL, IID_IUnknown, (void**)&punkNotify);
00243   }
00244
00245
00246   // Call Process method
00247
00248   if (SUCCEEDED(hr))
00249   {
00250     const int nNames = 3;     // number of names to look up
00251
00252     OLECHAR * rgszNames[nNames] = { OLESTR("Process"),    // method name
00253                       OLESTR("lFlags"),   // parm name
00254                       OLESTR("punkNotify")};  // parm name
00255     DISPID    dispId[nNames];
00256
00257     hr = pIDispatch->GetIDsOfNames( IID_NULL, rgszNames, nNames,
00258                     LOCALE_SYSTEM_DEFAULT, dispId);
00259     if (SUCCEEDED(hr))
00260     {
00261       const int nArgs = nNames - 1; // number of arguments
00262
00263 /*
00264       VARIANTARG varData[nArgs];    // just the parameters
00265       varData[0].vt = VT_I4; varData[0].lVal = lFlags;
00266       varData[1].vt = VT_UNKNOWN; (varData[1].punkVal = punkNotify)->AddRef();
00267       DISPPARAMS  dispparams = {varData, &dispId[1], nArgs, nArgs};
00268 */
00269
00270       VARIANTARG varData[nArgs];    // just the parameters
00271       varData[1].vt = VT_I4; varData[1].lVal = lFlags;
00272       varData[0].vt = VT_UNKNOWN; (varData[0].punkVal = punkNotify)->AddRef();
00273       DISPPARAMS  dispparams = {varData, 0, nArgs, 0};
00274
00275       UINT foo;
00276       hr = pIDispatch->Invoke(dispId[0], IID_NULL, LOCALE_USER_DEFAULT,
00277                   DISPATCH_METHOD, &dispparams, NULL, NULL, &foo);
00278
00279       VariantClear(&varData[0]);
00280       VariantClear(&varData[1]);
00281     }
00282   }
00283   return hr;
00284 }
00285
00286 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00287   THIS IS A PRIVATE MEMBER FUNCTION
00288
00289   Method:   COrder::InvokeShipVtable
00290   Summary:  Creates a Ship2 object to send to the shipping department
00291   Args:     IUnknown *  punkShip2 - IUnknown * to Shipping object
00292       long    lFlags  - flag longword with option bits
00293   Modifies: None
00294   Returns:  HRESULT from the underlying requests
00295 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00296
00297 HRESULT COrder::InvokeShipVtable(IUnknown * punkShip2, long lFlags)
00298 {
00299   HRESULT hr = S_OK;
00300   LPWSTR pwszDisplayName;
00301   CComQIPtr<IShip2, &IID_IShip2> pShip2(punkShip2);
00302   CComPtr<IUnknown> punkNotify;
00303
00304   if (!pShip2) hr = E_NOINTERFACE;
00305
00306   if (SUCCEEDED(hr)) hr = pShip2->put_CustomerId(m_lCustomerId);
00307
00308   if (SUCCEEDED(hr)) hr = pShip2->put_OrderId(m_lOrderId);
00309
00310   for (int ix = 0; ix < m_veclItemId.size() && SUCCEEDED(hr); ix++)
00311   {
00312     hr = pShip2->LineItem(m_veclItemId[ix], m_veclQuantity[ix]);
00313   }
00314
00315   if (SUCCEEDED(hr))
00316   {
00317     if (lFlags & processFlagQueuedComponents)
00318       pwszDisplayName = L"queue:/new:QCNotify.Notify";
00319     else
00320       pwszDisplayName = L"new:QCNotify.Notify";
00321
00322     hr = CoGetObject(pwszDisplayName, NULL, IID_IUnknown, (void**)&punkNotify);
00323   }
00324
00325   if (SUCCEEDED(hr)) hr = pShip2->Process(lFlags, punkNotify);
00326
00327   return hr;
00328 }
00329
00330 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00331   THIS IS A PRIVATE MEMBER FUNCTION
00332
00333   Method:   COrder::WriteOrderDB
00334   Summary:  Writes the order into the Order Entry table.
00335   Args:     None
00336   Modifies: Order Entry table
00337   Returns:  HRESULT from the underlying requests.
00338 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00339
00340 HRESULT COrder::WriteOrderDB()
00341 {
00342   CComPtr<ADOConnection> pADOConnection;
00343
00344   HRESULT hr = CoCreateInstance(  CLSID_CADOConnection, NULL, CLSCTX_INPROC_SERVER,
00345                   IID_IADOConnection, (void **) &pADOConnection);
00346   if (SUCCEEDED(hr))
00347   {
00348     // Connect to the database.  name constants are in DataSourceNames.h
00349
00350     hr = pADOConnection->Open(  _bstr_t(pszOrderDSN), _bstr_t(pszUserId),
00351                   _bstr_t(pszPassword), adOpenUnspecified);
00352
00353     // Write one row per line item
00354     for (int ix = 0; ix < m_veclItemId.size() && SUCCEEDED(hr); ix++)
00355     {
00356       TCHAR szSQLStmt[512];
00357
00358       LPCTSTR const pszPrototypeInsertStmt =
00359           _T("insert into QCSampleOrder ")
00360           _T("  (order_id, cust_id, line_no, item_id, quantity) ")
00361           _T("  values(%ld, %ld, %ld, %ld, %ld)");
00362
00363       wsprintf( szSQLStmt,
00364             pszPrototypeInsertStmt,
00365             m_lOrderId,
00366             m_lCustomerId,
00367             ix,
00368             m_veclItemId[ix],
00369             m_veclQuantity[ix]);
00370
00371       hr = pADOConnection->Execute(_bstr_t(szSQLStmt), NULL, adCmdText, NULL);
00372       // hr tested in for loop
00373     }
00374   }
00375   return hr;
00376 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/bitarray.h Source File

  • Dataaccess
  • oledb
  • sampprov

bitarray.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module BITARRAY.H | Class Definitions for Bitarray Class
00008 //
00009 //
00010 #ifndef _BITARRAY_H_
00011 #define _BITARRAY_H_
00012
00013 // Forward Declaration
00014 class FAR CBitArray;
00015 typedef CBitArray FAR *LPBITARRAY;
00016
00017
00018 //--------------------------------------------------------------------
00019 // @class Allocates and manages a bit array through various methods
00020 // defined in the class
00021 //
00022 // @hungarian bits or pbits
00023 //
00024 class FAR CBitArray
00025 {
00026   private:          //@access private
00027     //@cmember Count of Slots
00028     ULONG   m_cslotCurrent;
00029     //@cmember Maximum number of pages
00030     ULONG   m_cPageMax;
00031     //@cmember Current number of pages
00032     ULONG   m_cPageCurrent;
00033     //@cmember Number of bytes per page
00034     ULONG   m_cbPage;
00035     //@cmember Mask buffer
00036     BYTE    m_rgbBitMask[8];
00037     //@cmember Bit Array
00038     BYTE    *m_rgbBit;
00039
00040
00041   public:           //@access public
00042     //@cmember Class constructor
00043     CBitArray( void );
00044     //@cmember Class destructor
00045     ~CBitArray( void );
00046     //@cmember Initialization method
00047     STDMETHODIMP FInit(ULONG cslotMax, ULONG cbPage);
00048     //@cmember Set a range of slots
00049     STDMETHODIMP SetSlots(ULONG islotFirst, ULONG islotLast);
00050     //@cmember Reset a range of slots
00051     STDMETHODIMP ResetSlots(ULONG islotFirst, ULONG islotLast);
00052     //@cmember Check if any bits are set
00053     STDMETHODIMP ArrayEmpty(void);
00054     //@cmember Check the status of a particular bit
00055     STDMETHODIMP IsSlotSet(ULONG islot);
00056     //@cmember Find the first set bit in a range of bits
00057     STDMETHODIMP FindSet(ULONG islotStart, ULONG islotLimit, ULONG* pislot);
00058
00059 };
00060
00061 #endif
00062
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/staticnode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

staticnode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CStaticNode class.
00014 //
00015
00016 #include "StaticNode.h"
00017 #include "DeviceNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "AddDeviceDlg.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CStaticNode")
00026
00027
00028 // Initialize our static GUID just once.  We use the GUID for
00029 // CComponentData because this node handles events for the
00030 // Snap-in's namespace
00031 GUID CStaticNode::thisGUID = CLSID_CComponentData;
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Construction/Destruction
00036
00037 CStaticNode::CStaticNode()
00038 {
00039   m_SDI.mask        = DEFAULT_SDI_MASK;
00040   m_SDI.displayname = MMC_CALLBACK;
00041   m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00042   m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00043   m_SDI.cChildren   = 1;              // Determines if the '+' is displayed
00044   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00045
00046   m_hStaticNode     = NULL;
00047   m_pCompData       = NULL;
00048   m_hAddDeviceDlg   = NULL;
00049 }
00050
00051
00052 CStaticNode::~CStaticNode()
00053 {
00054 }
00055
00056 //---------------------------------------------------------------------------
00057 //  This node has no parent node so pNodeProps->pParentObject is ignored.
00058 //
00059 HRESULT CStaticNode::Initialize( NODE_PROPERTIES* pNodeProps )
00060 {
00061   _ASSERT( NULL != pNodeProps );
00062   HRESULT hResult = S_FALSE;
00063
00064   SIZE_T   nLen  = wcslen( pNodeProps->szNodeName ) + 1;
00065   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00066   wcscpy( pszTmp, pNodeProps->szNodeName );
00067   if( NULL != m_pwszNodeName )
00068     CoTaskMemFree( m_pwszNodeName );
00069
00070   m_pwszNodeName = pszTmp;
00071   m_pCompData = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00072
00073   hResult = RefreshNodeList();         // Initialize scope nodes
00074
00075   // We create a hidden window to allow us to communicate with modeless
00076   // dialogs and other things which run in a seperate thread.
00077
00078   WNDCLASS wc;
00079   ZeroMemory (&wc, sizeof(WNDCLASS));
00080   wc.cbWndExtra    = sizeof(this);
00081   wc.lpfnWndProc   = StaticNodeWndProc;
00082   wc.hInstance     = g_hInst;
00083   wc.lpszClassName = _T("StaticNodeMessageWindow");
00084
00085   RegisterClass( &wc );
00086   m_hMessageWnd = CreateWindow( _T("StaticNodeMessageWindow"), NULL,
00087                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00088
00089   if( NULL == m_hMessageWnd )
00090     hResult = S_FALSE;
00091
00092   return hResult;
00093 }
00094
00095
00096 //---------------------------------------------------------------------------
00097 //  This is our hidden window which is just used for handling messages.  We
00098 //  go to all this trouble so that we don't ever pass interface pointers or
00099 //  other objects across threads.
00100 //
00101 LRESULT CALLBACK CStaticNode::StaticNodeWndProc
00102 (
00103   HWND   hWnd,     //[in] Handle to window
00104   UINT   uMsg,     //[in] Message identifier
00105   WPARAM wParam,   //[in] First message parameter
00106   LPARAM lParam    //[in] Second message parameter
00107 )
00108 {
00109   switch( uMsg )
00110   {
00111     // Since we registered the WndClass in Initialize, our WndProc will be
00112     // called with WM_CREATE right away.  Store our 'hWnd' pointer in the
00113     // CREATESTRUCT so we can retreive it later to get back to the specific
00114     // instance of CComponentData
00115     //
00116     case WM_CREATE:
00117     {
00118       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00119       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00120       break;
00121     }
00122
00123     // This is our custom message which could have been sent from a worker
00124     // thread, or in this case a modeless dialog.  We retrieve our 'this'
00125     // pointer from the WndClass and cast it to a CComponentData pointer.
00126     // WPARAM is cast to a NODE_PROPERTIES struct which can be used to
00127     // call AddDeviceNode()
00128     //
00129     case WM_ADD_DEVICENODE:
00130     {
00131       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00132       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00133       pThisNode->AddDeviceNode( pProps );
00134       break;
00135     }
00136
00137     // This message is sent by the AddDeviceDlg to let us know it's
00138     // being terminated.  Set our member handle to NULL so the item
00139     // will be show on the context menu
00140     //
00141     case WM_DEVICENODE_CLOSED:
00142     {
00143       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00144       pThisNode->m_hAddDeviceDlg = NULL;
00145     }
00146     default:
00147       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00148   }
00149   return 0;
00150 }
00151
00152
00153 /////////////////////////////////////////////////////////////////////////////
00154 // Implementation of virtual methods
00155
00156
00157 //---------------------------------------------------------------------------
00158 //  The minimum implementation of this method is to return the
00159 //  Persistable View Description string.  This string must be allocated
00160 //  with CoTaskMemAlloc.  The console will free the string.
00161 //
00162 HRESULT CStaticNode::GetResultViewType2
00163 (
00164   MMC_COOKIE             nCookie,  //[in] Identifier of object
00165   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00166 )
00167 {
00168   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+1 );
00169   if( NULL == pszDescStr )
00170     return E_OUTOFMEMORY;
00171
00172   wcscpy( pszDescStr, L"DefaultListView" );
00173   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00174
00175   return S_OK;
00176 }
00177
00178 //---------------------------------------------------------------------------
00179 HRESULT CStaticNode::GetDisplayInfo
00180 (
00181   SCOPEDATAITEM* pSDI        //[in,out] Points to SCOPEDATAITEM
00182 )
00183 {
00184   _ASSERT( NULL != pSDI );
00185   pSDI->displayname = m_pwszNodeName;
00186
00187   return S_OK;
00188 }
00189
00190 //---------------------------------------------------------------------------
00191 HRESULT CStaticNode::GetDisplayInfo
00192 (
00193   RESULTDATAITEM* pRDI
00194 )
00195 {
00196   // This method will not get called since the static node is never
00197   // displayed in the result pane
00198   return S_FALSE;
00199 }
00200
00201 /////////////////////////////////////////////////////////////////////////////
00202 // Implementation of notification handlers
00203
00204 //---------------------------------------------------------------------------
00205 HRESULT CStaticNode::OnShow
00206 (
00207   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00208   LPARAM        nArg,          //[in] TRUE if node was selcted
00209   LPARAM        nParam,        //[in] HSCOPEITEM of selected/deselected item
00210   LONG_PTR      pComponent     //[in] Points to calling IComponent
00211 )
00212 {
00213   HRESULT  hResult = S_FALSE;
00214
00215   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00216
00217   LPHEADERCTRL2  ipHeaderCtrl2 = NULL;
00218   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL2, (LONG_PTR*)&ipHeaderCtrl2 );
00219   if( S_OK != hResult )
00220    return hResult;
00221
00222   LPRESULTDATA  ipResultData = NULL;
00223   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00224   if( S_OK != hResult )
00225    return hResult;
00226
00227   if( TRUE == nArg )  // Selecting a scope node
00228   {
00229     do
00230     {
00231       hResult = ipHeaderCtrl2->InsertColumn( 0, L"Device Name", 0, 150 );
00232       BREAK_ON_ERROR( hResult );
00233
00234       hResult = ipHeaderCtrl2->InsertColumn( 1, L"Status", 0, 150 );
00235       BREAK_ON_ERROR( hResult );
00236
00237       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00238       BREAK_ON_ERROR( hResult );
00239
00240     }while(0);
00241   }
00242   else // not handling deselect notifications
00243   {
00244   }
00245
00246   TRACE_HRESULT(_T("OnShow"), hResult );
00247   return hResult;
00248 }
00249
00250
00251 //---------------------------------------------------------------------------
00252 HRESULT CStaticNode::OnSelect
00253 (
00254   LPDATAOBJECT   ipDataObject,   //[in] Points to the selected data object
00255   LPARAM         nArg,           //[in] Status of selected item
00256   LPARAM         nParam,         //[in] Not used
00257   LONG_PTR       pComponent      //[in] Pointer to parent CComponent
00258 )
00259 {
00260   BOOL    fScopePane = LOWORD(nArg);
00261   BOOL    fSelected  = HIWORD(nArg);
00262   HRESULT hResult    = S_FALSE;
00263
00264   if( NULL == ipDataObject )           // Can get this when closing the SnapIn
00265     return hResult;
00266
00267   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00268   LPCONSOLEVERB  ipConsoleVerb = NULL;
00269   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00270   if( S_OK != hResult )
00271     return hResult;
00272
00273   if( TRUE == fScopePane && TRUE == fSelected )
00274   {
00275     // This is where we will set verbs in later versions
00276   }
00277
00278   TRACE_HRESULT(_T("OnSelect"), hResult );
00279   return hResult;
00280
00281 }
00282
00283 //---------------------------------------------------------------------------
00284 HRESULT CStaticNode::OnExpand
00285 (
00286   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00287   LPARAM         nArg,         //[in] TRUE if node was selcted
00288   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00289   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00290 )
00291 {
00292   HRESULT hResult = S_FALSE;
00293
00294   if( NULL == m_hStaticNode )          // Cache the root node handle
00295     m_hStaticNode = (HSCOPEITEM)nParam;
00296
00297   if( NULL == m_pCompData )
00298     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00299
00300   // Request an IConsoleNameSpace2 pointer from CComponentData
00301   // The static node is a unique case since it's parent is also IComponentData
00302   //
00303   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00304   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00305   if( S_OK != hResult )
00306     return hResult;
00307
00308   hResult = DeleteScopeItems( ipCNS2 );
00309   hResult = InsertScopeItems( ipCNS2 );
00310
00311   return hResult;
00312 }
00313
00314
00315 //---------------------------------------------------------------------------
00316 HRESULT CStaticNode::OnRemoveChildren
00317 (
00318   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00319   LPARAM         nArg,         //[in] TRUE if node was selcted
00320   LPARAM         nParam,       //[in] HSCOPEITEM of selected/deselected item
00321   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00322 )
00323 {
00324   HRESULT hResult = S_FALSE;
00325
00326   if( NULL == m_pCompData )
00327     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00328
00329   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00330   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00331   if( S_OK != hResult )
00332     return hResult;
00333
00334   hResult = DeleteScopeItems( ipCNS2 );
00335
00336   POSITION   Pos   = m_NodeList.GetHeadPosition();
00337   LPBASENODE pNode = NULL;
00338   while( Pos )                         // Delete everything...
00339   {
00340     pNode = m_NodeList.GetNext( Pos );
00341     pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00342     delete pNode;
00343   }
00344
00345   m_NodeList.RemoveAll();              // Cleanup the list
00346
00347   TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00348   return hResult;
00349 }
00350
00351
00352 /////////////////////////////////////////////////////////////////////////////
00353 // Private helper methods
00354
00355
00356 //---------------------------------------------------------------------------
00357 //  Initializes the node list.
00358 //
00359 HRESULT CStaticNode::RefreshNodeList()
00360 {
00361   NODE_PROPERTIES NodeProps;
00362   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00363   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00364   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00365
00366   WCHAR  szNames[2][32];
00367   wcscpy( szNames[0], L"RamDisk 0" );
00368   wcscpy( szNames[1], L"Archive 0" );
00369
00370   RemoveNodes();                       // Clean the node list
00371
00372   CDeviceNode* pNode = NULL;
00373   for( DWORD i = 0; i < 2; i++ )
00374   {
00375     wcscpy( NodeProps.szNodeName, szNames[i] );
00376     pNode = new CDeviceNode;
00377     pNode->Initialize( &NodeProps );
00378     m_NodeList.AddTail( pNode );
00379
00380     // Kind of a hack, make the second device a backup device
00381     NodeProps.dwAttributes |= ATTRIBUTE_BACKUP_DEVICE;
00382   }
00383
00384   return S_OK;
00385 }
00386
00387
00388 //---------------------------------------------------------------------------
00389 //  For these first level nodes the parent is always the static or root
00390 //  node.
00391 //
00392 HRESULT CStaticNode::InsertScopeItems
00393 (
00394   LPCONSOLENAMESPACE2 ipCNS2   //[in] Needed to insert items
00395 )
00396 {
00397   _ASSERT( NULL != ipCNS2 );
00398   _ASSERT( NULL != m_hStaticNode );
00399
00400   HRESULT      hResult = S_FALSE;
00401   POSITION     Pos     = m_NodeList.GetHeadPosition();
00402   CDeviceNode* pNode   = NULL;
00403
00404   while( Pos )
00405   {
00406     pNode   = m_NodeList.GetNext( Pos );
00407     pNode->m_SDI.relativeID = m_hStaticNode;
00408     hResult = ipCNS2->InsertItem( &pNode->m_SDI );
00409   }
00410
00411   return hResult;
00412 }
00413
00414
00415 //---------------------------------------------------------------------------
00416 //  Delete the HSCOPEITEMS only, we leave the list of nodes untouched
00417 //
00418 HRESULT CStaticNode::DeleteScopeItems
00419 (
00420   LPCONSOLENAMESPACE2 ipCNS2   //[in] Needed to delete items
00421 )
00422 {
00423   _ASSERT( NULL != ipCNS2 );
00424
00425   POSITION    Pos     = m_NodeList.GetHeadPosition();
00426   HSCOPEITEM  hItem   = NULL;
00427   LPBASENODE  pNode   = NULL;
00428   HRESULT     hResult = S_FALSE;
00429
00430   while( Pos )                         // Delete everything...
00431   {
00432     pNode = m_NodeList.GetNext( Pos );
00433     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00434     if( 0 != hItem )
00435       hResult = ipCNS2->DeleteItem( hItem, TRUE );
00436   }
00437
00438   return hResult;
00439
00440 }
00441
00442 //---------------------------------------------------------------------------
00443 //  We do this instead of just calling RemoveAll() because our list contains
00444 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00445 //  the derived class object.
00446 //
00447 VOID CStaticNode::RemoveNodes()
00448 {
00449   LPBASENODE pNode = NULL;
00450   POSITION   Pos   = m_NodeList.GetHeadPosition();
00451   while( Pos )
00452   {
00453     pNode = m_NodeList.GetNext( Pos );
00454     delete pNode;
00455   }
00456   m_NodeList.RemoveAll();              // Clean the list
00457 }
00458
00459 //---------------------------------------------------------------------------
00460 HRESULT CStaticNode::AddDeviceNode
00461 (
00462   NODE_PROPERTIES*    pProps   //[in] Properties for the new node
00463 )
00464 {
00465   _ASSERT( NULL != pProps );
00466
00467   CDeviceNode* pNode   = NULL;
00468   HRESULT      hResult = S_FALSE;
00469
00470   pProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00471   pProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00472
00473   pNode = new CDeviceNode;         // Create and initialize the new
00474   pNode->Initialize( pProps );     // node, then add to our linked
00475   m_NodeList.AddTail( pNode );     // list, then insert the node
00476
00477   pNode->m_SDI.relativeID = m_hStaticNode;
00478
00479   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00480   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00481   if( S_OK != hResult )
00482     return hResult;
00483
00484   hResult = ipCNS2->InsertItem( &pNode->m_SDI );
00485
00486   return hResult;
00487 }
00488
00489 //---------------------------------------------------------------------------
00490 //  Get the selected node and call it's ToggleStatus method
00491 //
00492 VOID CStaticNode::ToggleStatus
00493 (
00494   LPDATAOBJECT ipDataObject    //[in] Points to selected node
00495 )
00496 {
00497   CDeviceNode* pNode = (CDeviceNode*)ExtractBaseNodePtr( ipDataObject );
00498   if( NULL != pNode )
00499     pNode->ToggleStatus();
00500
00501 }
00502
00503
00504 /////////////////////////////////////////////////////////////////////////////
00505 //  Support for Context Menus
00506
00507 //---------------------------------------------------------------------------
00508 //  NOTE:  Don't AddRef ipCallback.  Check docs.
00509 //
00510 HRESULT CStaticNode::AddMenuItems
00511 (
00512   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00513   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00514 )
00515 {
00516   _ASSERT( NULL != ipCallback );
00517   HRESULT hResult = S_FALSE;
00518
00519   static CONTEXTMENUITEM ctxMenu;
00520     ctxMenu.lCommandID        = IDM_NEW_DEVICE;
00521     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00522     ctxMenu.fSpecialFlags     = 0;
00523     ctxMenu.strName           = L"New Device...";
00524     ctxMenu.strStatusBarText  = L"Add a new device";
00525
00526
00527   if( NULL == m_hAddDeviceDlg )    // If the AddDevice dialog is running
00528     ctxMenu.fFlags = 0;            // gray the menu selection
00529   else
00530     ctxMenu.fFlags = MF_GRAYED;
00531
00532
00533   // Add the 'New Device' option to the New menu if allowed...
00534   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00535   {
00536     hResult = ipCallback->AddItem( &ctxMenu );
00537   }
00538
00539   return hResult;
00540 }
00541
00542
00543 //---------------------------------------------------------------------------
00544 HRESULT CStaticNode::Command
00545 (
00546   long lCommandID          //[in] Indentifier for menu ID
00547 )
00548 {
00549   HRESULT hResult = S_OK;
00550
00551   switch( lCommandID )
00552   {
00553     case IDM_NEW_DEVICE:
00554     {
00555       CAddDeviceDlg* pDlg = new CAddDeviceDlg( IDD_ADDDEVICE_DLG, m_hMessageWnd );
00556       m_hAddDeviceDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00557       break;
00558     }
00559     default:
00560     {
00561       hResult = S_FALSE;
00562       break;
00563     }
00564   }
00565   return hResult;
00566 }
00567
00568
00569
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/AppUtilDlg.Cpp Source File

  • Com
  • Administration
  • Explore.VC

AppUtilDlg.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019 #include "stdafx.h"
00020 #include "VCExplore.h"
00021 #include "AppUtilDlg.h"
00022
00023
00024 #ifdef _DEBUG
00025 #define new DEBUG_NEW
00026 #undef THIS_FILE
00027 static char THIS_FILE[] = __FILE__;
00028 #endif
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 // CAppUtilDlg dialog
00032
00033
00034 CAppUtilDlg::CAppUtilDlg(CWnd* pParent /*=NULL*/)
00035   : CDialog(CAppUtilDlg::IDD, pParent)
00036 {
00037   //{{AFX_DATA_INIT(CAppUtilDlg)
00038     // NOTE: the ClassWizard will add member initialization here
00039   //}}AFX_DATA_INIT
00040
00041   // Initialize the members
00042   m_pCatalog = NULL;
00043   m_nUtilityType = UTILITY_TYPE_UNDEFINED;
00044 }
00045
00046
00047 void CAppUtilDlg::DoDataExchange(CDataExchange* pDX)
00048 {
00049   CDialog::DoDataExchange(pDX);
00050   //{{AFX_DATA_MAP(CAppUtilDlg)
00051   DDX_Control(pDX, IDC_EDIT_APPLICATION_ID_VALUE, m_edtApp);
00052   //}}AFX_DATA_MAP
00053 }
00054
00055
00056 BEGIN_MESSAGE_MAP(CAppUtilDlg, CDialog)
00057   //{{AFX_MSG_MAP(CAppUtilDlg)
00058   ON_WM_CLOSE()
00059   ON_BN_CLICKED(IDC_BUTTON_APPLICATON_ID_SEARCH, OnAppSearch)
00060   //}}AFX_MSG_MAP
00061 END_MESSAGE_MAP()
00062
00063 /////////////////////////////////////////////////////////////////////////////
00064 // CAppUtilDlg message handlers
00065
00066 void CAppUtilDlg::set_Catalog(ICOMAdminCatalog *pCatalog)
00067 {
00068   // Only can have one Catalog object reference... release all prior references before assignment
00069   ReleaseCatalog();
00070
00071   m_pCatalog = pCatalog;
00072 }
00073
00074 void CAppUtilDlg::OnClose()
00075 {
00076   // Release the reference to the Catalog object if needed
00077   ReleaseCatalog();
00078
00079   CDialog::OnClose();
00080 }
00081
00082 void CAppUtilDlg::set_UtilityType(int UtilityType)
00083 {
00084   // Continue only for valid requests
00085   if ((UtilityType == UTILITY_TYPE_START_APP) || (UtilityType == UTILITY_TYPE_STOP_APP))
00086     m_nUtilityType = UtilityType;
00087 }
00088
00089 BOOL CAppUtilDlg::OnInitDialog()
00090 {
00091   CDialog::OnInitDialog();
00092
00093   // Set the dialogs caption and load the appropriate icon resource
00094   switch (m_nUtilityType)
00095   {
00096     case UTILITY_TYPE_START_APP:
00097       SetWindowText("Start Application");
00098       m_hIcon = AfxGetApp()->LoadIcon(IDI_START);
00099       break;
00100     case UTILITY_TYPE_STOP_APP:
00101       SetWindowText("Stop Application");
00102       m_hIcon = AfxGetApp()->LoadIcon(IDI_STOP);
00103       break;
00104   }
00105
00106   // Set the dialog's icon resource
00107   SetIcon(m_hIcon, true);   // 32x32 icon
00108   SetIcon(m_hIcon, false);  // 16x16 icon
00109
00110   return TRUE;  // return TRUE unless you set the focus to a control
00111                 // EXCEPTION: OCX Property Pages should return FALSE
00112 }
00113
00114 void CAppUtilDlg::ReleaseCatalog()
00115 {
00116   // Release the reference to the Catalog object if needed
00117   if (NULL != m_pCatalog)
00118     m_pCatalog->Release();
00119 }
00120
00121 void CAppUtilDlg::OnOK()
00122 {
00123   // Continue only if we have a valid Catalog pointer
00124   if (NULL != m_pCatalog)
00125   {
00126     HRESULT hr = 0;
00127
00128     // Retrieve the text from the edit control
00129     int nTextLength = m_edtApp.GetWindowTextLength() + 1;
00130     char* pBuf = new char[nTextLength];
00131     m_edtApp.GetWindowText(pBuf, nTextLength);
00132     _bstr_t bstrApp = pBuf;
00133     delete [] pBuf;
00134
00135     // Execute specified action
00136     switch (m_nUtilityType)
00137     {
00138     case UTILITY_TYPE_START_APP:
00139       hr = m_pCatalog->StartApplication(bstrApp);
00140       break;
00141     case UTILITY_TYPE_STOP_APP:
00142       hr = m_pCatalog->ShutdownApplication(bstrApp);
00143       break;
00144     default:
00145       MessageBox("Invalid utility type specified.\n\nNo processing will be performed.\n\nPress OK to continue.",
00146             "Error",
00147             (MB_OK | MB_ICONERROR));
00148       break;
00149     }
00150
00151     // Validate success/fail of the method call
00152     if FAILED(hr)
00153       MessageBox("Failed to perform the requested action.\n\nPress OK to continue.",
00154             "Error",
00155             (MB_OK | MB_ICONERROR));
00156   }
00157   else
00158     MessageBox("Invalid Catalog reference.\n\nNo processing will be performed.\n\nPress OK to continue.",
00159           "Error",
00160           (MB_OK | MB_ICONERROR));
00161
00162   // Release the Catalog reference
00163   ReleaseCatalog();
00164
00165   CDialog::OnOK();
00166 }
00167
00168 void CAppUtilDlg::OnAppSearch()
00169 {
00170   OPENFILENAME ofn;
00171   char pFilePath[256];
00172   char pFileTitle[256];
00173
00174   // Setup of OPENFILENAME structure
00175   ofn.lStructSize = sizeof(OPENFILENAME);
00176     ofn.hwndOwner = m_hWnd;
00177     ofn.hInstance = NULL;
00178     ofn.lpstrFilter = "All Files (*.*)\0*.*\0\0";
00179     ofn.lpstrCustomFilter = (LPSTR) NULL;
00180     ofn.nMaxCustFilter = 0;
00181     ofn.nFilterIndex = 1;
00182     pFilePath[0] = '\0';
00183     ofn.lpstrFile = pFilePath;
00184     ofn.nMaxFile = sizeof(pFilePath);
00185     ofn.lpstrFileTitle = pFileTitle;
00186     ofn.nMaxFileTitle = sizeof(pFileTitle);
00187     ofn.lpstrInitialDir = NULL;
00188   if (UTILITY_TYPE_START_APP == m_nUtilityType)
00189     ofn.lpstrTitle = "Select Application to start";
00190   else
00191     ofn.lpstrTitle = "Select Application to stop";
00192     ofn.Flags = (OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST);
00193     ofn.lpstrDefExt = "DLL";
00194     ofn.nFileOffset = 0;
00195     ofn.nFileExtension = 0;
00196     ofn.lCustData = 0;
00197
00198   // Invoke the file open common dialog
00199   GetOpenFileName(&ofn);
00200
00201   // Update the value in the control
00202   m_edtApp.SetWindowText(ofn.lpstrFile);
00203 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/ip/sampletest.cxx Source File

  • NetDS
  • RRas
  • ip

sampletest.cxx

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sample\sampletest.cxx
00008
00009 Abstract:
00010
00011     The file contains code for the test program
00012
00013 --*/
00014
00015 #include "sampletest.h"
00016
00017 int _cdecl
00018 main()
00019 {
00020     TestProtocol();
00021
00022     return 0;
00023 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/registry.Cpp Source File

  • SysMgmt
  • MMC
  • Nameext

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "Extend.h"
00026 #include "globals.h"
00027
00028 // list all of the nodes that we extend
00029 EXTENDER_NODE _NodeExtensions[] = {
00030     {NameSpaceExtension,
00031     {0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } },
00032   {0x64026453, 0x6a22, 0x11d3, {0x91, 0x54, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9} },
00033     _T("Namespace Extension to the Sky-based Vehicle node")},
00034
00035     {DummyExtension,
00036     NULL,
00037     NULL,
00038     NULL}
00039 };
00040
00041
00042 ////////////////////////////////////////////////////////
00043 //
00044 // Internal helper functions prototypes
00045 //
00046
00047 // Set the given key and its value.
00048 BOOL setKeyAndValue(const _TCHAR* pszPath,
00049                     const _TCHAR* szSubkey,
00050                     const _TCHAR* szValue) ;
00051
00052 // Set the given key and its value in the MMC Snapin location
00053 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00054                           const _TCHAR* szSubkey,
00055                           const _TCHAR* szName,
00056                           const _TCHAR* szValue);
00057
00058 // Set the given valuename under the key to value
00059 BOOL setValue(const _TCHAR* szKey,
00060               const _TCHAR* szValueName,
00061               const _TCHAR* szValue);
00062
00063 // Delete szKeyChild and all of its descendents.
00064 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00065
00066 ////////////////////////////////////////////////////////
00067 //
00068 // Constants
00069 //
00070
00071 // Size of a CLSID as a string
00072 //const int CLSID_STRING_SIZE = 39 ;
00073
00074 /////////////////////////////////////////////////////////
00075 //
00076 // Public function implementation
00077 //
00078
00079 //
00080 // Register the component in the registry.
00081 //
00082 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00083                        const CLSID& clsid,         // Class ID
00084                        const _TCHAR* szFriendlyName)       //   IDs
00085 {
00086     // Get server location.
00087     _TCHAR szModule[512] ;
00088     DWORD dwResult =
00089         ::GetModuleFileName(hModule,
00090         szModule,
00091         sizeof(szModule)/sizeof(_TCHAR)) ;
00092
00093     assert(dwResult != 0) ;
00094
00095     // Get CLSID
00096     LPOLESTR wszCLSID = NULL ;
00097     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00098
00099     assert(SUCCEEDED(hr)) ;
00100
00101   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00102
00103     // Build the key CLSID\\{...}
00104     _TCHAR szKey[64] ;
00105     _tcscpy(szKey, _T("CLSID\\")) ;
00106   _tcscat(szKey, pszCLSID) ;
00107
00108     // Add the CLSID to the registry.
00109     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00110
00111     // Add the server filename subkey under the CLSID key.
00112     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00113
00114     // set the threading model
00115     _tcscat(szKey, _T("\\InprocServer32"));
00116     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00117
00118     // Free memory.
00119     CoTaskMemFree(wszCLSID) ;
00120
00121     return S_OK ;
00122 }
00123
00124 //
00125 // Remove the component from the registry.
00126 //
00127 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00128 {
00129     // Get CLSID
00130     LPOLESTR wszCLSID = NULL ;
00131     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00132
00133
00134     // Build the key CLSID\\{...}
00135     _TCHAR szKey[64] ;
00136     _tcscpy(szKey, _T("CLSID\\")) ;
00137
00138   MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00139   _tcscat(szKey, pszT) ;
00140
00141     // Delete the CLSID Key - CLSID\{...}
00142     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00143     assert((lResult == ERROR_SUCCESS) ||
00144          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00145
00146     // Free memory.
00147     CoTaskMemFree(wszCLSID) ;
00148
00149     return S_OK ;
00150 }
00151
00152 //
00153 // Register the snap-in in the registry.
00154 //
00155
00156 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00157                        const _TCHAR* szNameString,   // NameString
00158                        const CLSID& clsidAbout,   // Class Id for About Class
00159                        const BOOL fSupportExtensions)
00160 {
00161     // Get CLSID
00162     LPOLESTR wszCLSID = NULL ;
00163     LPOLESTR wszAboutCLSID = NULL;
00164     LPOLESTR wszExtendCLSID = NULL;
00165     LPOLESTR wszNodeCLSID = NULL;
00166     EXTENDER_NODE *pNodeExtension;
00167     _TCHAR szKeyBuf[1024] ;
00168     HKEY hKey;
00169
00170
00171     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00172
00173     if (IID_NULL != clsidAbout)
00174         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00175
00176   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00177   MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00178
00179
00180     // Add the CLSID to the registry.
00181     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00182     if (IID_NULL != clsidAbout)
00183         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00184
00185     if (fSupportExtensions) {
00186         // Build the key NodeType
00187         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00188
00189         _TCHAR szKey[64] ;
00190         _tcscpy(szKey, pszCLSID) ;
00191         _tcscat(szKey, _T("\\NodeTypes")) ;
00192         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00193     }
00194
00195     // register each of the node extensions
00196     for (pNodeExtension = &(_NodeExtensions[0]);*pNodeExtension->szDescription;pNodeExtension++)
00197     {
00198         hr = StringFromCLSID(pNodeExtension->guidNode, &wszExtendCLSID);
00199         MAKE_TSTRPTR_FROMWIDE(pszExtendCLSID, wszExtendCLSID);
00200         _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes\\"));
00201         _tcscat(szKeyBuf, pszExtendCLSID);
00202
00203         switch (pNodeExtension->eType) {
00204         case NameSpaceExtension:
00205             _tcscat(szKeyBuf, _T("\\Extensions\\NameSpace"));
00206             break;
00207         default:
00208             break;
00209         }
00210
00211         // Create and open key and subkey.
00212         long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00213             szKeyBuf,
00214             0, NULL, REG_OPTION_NON_VOLATILE,
00215             KEY_ALL_ACCESS, NULL,
00216             &hKey, NULL) ;
00217
00218         if (lResult != ERROR_SUCCESS)
00219         {
00220             return FALSE ;
00221         }
00222
00223         hr = StringFromCLSID(pNodeExtension->guidExtension, &wszNodeCLSID);
00224         assert(SUCCEEDED(hr));
00225
00226         MAKE_TSTRPTR_FROMWIDE(pszNodeCLSID, wszNodeCLSID);
00227         // Set the Value.
00228         if (pNodeExtension->szDescription != NULL)
00229         {
00230             RegSetValueEx(hKey, pszNodeCLSID, 0, REG_SZ,
00231                 (BYTE *)pNodeExtension->szDescription,
00232                 (_tcslen(pNodeExtension->szDescription)+1)*sizeof(_TCHAR)) ;
00233         }
00234
00235         RegCloseKey(hKey) ;
00236
00237         CoTaskMemFree(wszExtendCLSID);
00238         CoTaskMemFree(wszNodeCLSID);
00239     }
00240
00241
00242     // Free memory.
00243     CoTaskMemFree(wszCLSID) ;
00244     if (IID_NULL != clsidAbout)
00245         CoTaskMemFree(wszAboutCLSID);
00246
00247     return S_OK ;
00248 }
00249
00250 //
00251 // Unregister the snap-in in the registry.
00252 //
00253 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00254 {
00255     _TCHAR szKeyBuf[1024];
00256     LPOLESTR wszCLSID = NULL;
00257
00258     // Get CLSID
00259     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00260   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00261
00262     // Load the buffer with the Snap-In Location
00263     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00264
00265     // Copy keyname into buffer.
00266     _tcscat(szKeyBuf, _T("\\"));
00267     _tcscat(szKeyBuf, pszCLSID);
00268
00269     // Delete the CLSID Key - CLSID\{...}
00270     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00271     assert((lResult == ERROR_SUCCESS) ||
00272          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00273
00274     // free the memory
00275     CoTaskMemFree(wszCLSID);
00276
00277     return S_OK;
00278 }
00279
00280 //
00281 // Delete a key and all of its descendents.
00282 //
00283 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00284                         const _TCHAR* lpszKeyChild)  // Key to delete
00285 {
00286     // Open the child.
00287     HKEY hKeyChild ;
00288     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00289         KEY_ALL_ACCESS, &hKeyChild) ;
00290     if (lRes != ERROR_SUCCESS)
00291     {
00292         return lRes ;
00293     }
00294
00295     // Enumerate all of the decendents of this child.
00296     FILETIME time ;
00297     _TCHAR szBuffer[256] ;
00298     DWORD dwSize = 256 ;
00299     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00300         NULL, NULL, &time) == S_OK)
00301     {
00302         // Delete the decendents of this child.
00303         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00304         if (lRes != ERROR_SUCCESS)
00305         {
00306             // Cleanup before exiting.
00307             RegCloseKey(hKeyChild) ;
00308             return lRes;
00309         }
00310         dwSize = 256 ;
00311     }
00312
00313     // Close the child.
00314     RegCloseKey(hKeyChild) ;
00315
00316     // Delete this child.
00317     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00318 }
00319
00320 //
00321 // Create a key and set its value.
00322 //   - This helper function was borrowed and modifed from
00323 //     Kraig Brockschmidt's book Inside OLE.
00324 //
00325 BOOL setKeyAndValue(const _TCHAR* szKey,
00326                     const _TCHAR* szSubkey,
00327                     const _TCHAR* szValue)
00328 {
00329     HKEY hKey;
00330     _TCHAR szKeyBuf[1024] ;
00331
00332     // Copy keyname into buffer.
00333     _tcscpy(szKeyBuf, szKey) ;
00334
00335     // Add subkey name to buffer.
00336     if (szSubkey != NULL)
00337     {
00338         _tcscat(szKeyBuf, _T("\\")) ;
00339         _tcscat(szKeyBuf, szSubkey ) ;
00340     }
00341
00342     // Create and open key and subkey.
00343     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00344         szKeyBuf,
00345         0, NULL, REG_OPTION_NON_VOLATILE,
00346         KEY_ALL_ACCESS, NULL,
00347         &hKey, NULL) ;
00348     if (lResult != ERROR_SUCCESS)
00349     {
00350         return FALSE ;
00351     }
00352
00353     // Set the Value.
00354     if (szValue != NULL)
00355     {
00356         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00357             (BYTE *)szValue,
00358             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00359     }
00360
00361     RegCloseKey(hKey) ;
00362     return TRUE ;
00363 }
00364
00365 //
00366 // Open a key value and set it
00367 //
00368 BOOL setValue(const _TCHAR* szKey,
00369               const _TCHAR* szValueName,
00370               const _TCHAR* szValue)
00371 {
00372     HKEY hKey;
00373     _TCHAR szKeyBuf[1024] ;
00374
00375     // Copy keyname into buffer.
00376     _tcscpy(szKeyBuf, szKey) ;
00377
00378     // Create and open key and subkey.
00379     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00380         szKeyBuf,
00381         0, NULL, REG_OPTION_NON_VOLATILE,
00382         KEY_ALL_ACCESS, NULL,
00383         &hKey, NULL) ;
00384     if (lResult != ERROR_SUCCESS)
00385     {
00386         return FALSE ;
00387     }
00388
00389     // Set the Value.
00390     if (szValue != NULL)
00391     {
00392         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00393             (BYTE *)szValue,
00394             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00395     }
00396
00397     RegCloseKey(hKey) ;
00398     return TRUE ;
00399 }
00400
00401 //
00402 // Create a key and set its value.
00403 //   - This helper function was borrowed and modifed from
00404 //     Kraig Brockschmidt's book Inside OLE.
00405 //
00406 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00407                           const _TCHAR* szSubkey,
00408                           const _TCHAR* szName,
00409                           const _TCHAR* szValue)
00410 {
00411     HKEY hKey;
00412     _TCHAR szKeyBuf[1024] ;
00413
00414     // Load the buffer with the Snap-In Location
00415     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00416
00417     // Copy keyname into buffer.
00418     _tcscat(szKeyBuf, _T("\\")) ;
00419     _tcscat(szKeyBuf, szKey) ;
00420
00421     // Add subkey name to buffer.
00422     if (szSubkey != NULL)
00423     {
00424         _tcscat(szKeyBuf, _T("\\")) ;
00425         _tcscat(szKeyBuf, szSubkey ) ;
00426     }
00427
00428     // Create and open key and subkey.
00429     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00430         szKeyBuf,
00431         0, NULL, REG_OPTION_NON_VOLATILE,
00432         KEY_ALL_ACCESS, NULL,
00433         &hKey, NULL) ;
00434     if (lResult != ERROR_SUCCESS)
00435     {
00436         return FALSE ;
00437     }
00438
00439     // Set the Value.
00440     if (szValue != NULL)
00441     {
00442         RegSetValueEx(hKey, szName, 0, REG_SZ,
00443             (BYTE *)szValue,
00444             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00445     }
00446
00447     RegCloseKey(hKey) ;
00448     return TRUE ;
00449 }
00450
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CUpdateReceipt Member List

This is the complete list of members for CUpdateReceipt, including all inherited members.
Activate() | CUpdateReceipt |
Construct(IDispatch *pUnk) | CUpdateReceipt |
CUpdateReceipt() | CUpdateReceipt | [inline]
CUpdateReceipt() | CUpdateReceipt | [inline]
Enlist() | CUpdateReceipt | [private]
FinalRelease() | CUpdateReceipt |
InterfaceSupportsErrorInfo(REFIID riid) | CUpdateReceipt |
InterfaceSupportsErrorInfo(REFIID riid) | CUpdateReceipt |
m_bConstructed | CUpdateReceipt | [private]
m_bObjectPooled | CUpdateReceipt | [private]
m_bShouldEnlist | CUpdateReceipt | [private]
m_hdbc | CUpdateReceipt | [private]
m_henv | CUpdateReceipt | [private]
m_hstmt | CUpdateReceipt | [private]
m_sDSN | CUpdateReceipt | [private]
m_txuow | CUpdateReceipt | [private]
STDMETHODIMP_(BOOL) CanBePooled() | CUpdateReceipt | [inline]
STDMETHODIMP_(void) Deactivate() | CUpdateReceipt | [inline]
Update(OUT long *plReceiptNo) | CUpdateReceipt |
Update(OUT long *plReceiptNo) | CUpdateReceipt |
Generated on Wed Nov 13 2024 16:57:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/clUtil.h Source File

  • Web
  • NetMeeting
  • NMShare

clUtil.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       CLUTIL.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 // Utility Classes
00017
00018 #ifndef _CL_UTIL_H_
00019 #define _CL_UTIL_H_
00020
00021
00022 //****************************************************************************
00023 //
00024 // CLASS RefCount
00025 //
00026 //****************************************************************************
00027
00028 class RefCount
00029 {
00030 private:
00031    LONG m_cRef;
00032
00033 public:
00034    RefCount();
00035    // Virtual destructor defers to destructor of derived class.
00036    virtual ~RefCount();
00037
00038    // IUnknown methods
00039
00040    ULONG STDMETHODCALLTYPE AddRef(void);
00041    ULONG STDMETHODCALLTYPE Release(void);
00042 };
00043
00044
00045
00046 //****************************************************************************
00047 //
00048 // CLASS CNotify
00049 //
00050 // Notification sink
00051 //
00052 //****************************************************************************
00053
00054 class CNotify
00055 {
00056 private:
00057     DWORD  m_dwCookie;
00058   IUnknown * m_pUnk;
00059     IConnectionPoint           * m_pcnp;
00060     IConnectionPointContainer  * m_pcnpcnt;
00061 public:
00062     CNotify(void);
00063     ~CNotify();
00064
00065     HRESULT Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN);
00066     HRESULT Disconnect(void);
00067
00068     IUnknown * GetPunk() {return m_pUnk;}
00069 };
00070
00071
00072 //****************************************************************************
00073 //
00074 // CLASS COBLIST
00075 //
00076 //****************************************************************************
00077
00078 #define POSITION COBNODE*
00079
00080 struct COBNODE
00081 {
00082   POSITION  pNext;
00083   void*   pItem;
00084 };
00085
00086 class COBLIST
00087 {
00088 protected:
00089   POSITION m_pHead;
00090   POSITION m_pTail;
00091   int      m_cItem;
00092     virtual BOOL Compare(void* pItemToCompare, void* pComparator)
00093                        { return(pItemToCompare == pComparator); }
00094 public:
00095   COBLIST() : m_pHead(NULL), m_pTail(NULL), m_cItem(0) { }
00096     virtual         ~COBLIST();
00097
00098   virtual void *  RemoveAt(POSITION rPos);
00099     void            EmptyList();
00100   POSITION      AddTail(void* pItem);
00101   void *        GetNext(POSITION& rPos);
00102     void *          SafeGetFromPosition(POSITION rPos);
00103     POSITION        GetPosition(void* pItem);
00104     POSITION        Lookup(void* pComparator);
00105   POSITION      GetHeadPosition()  { return (m_pHead); }
00106   POSITION      GetTailPosition()  { return (m_pTail); }
00107   BOOL        IsEmpty()          { return (!m_pHead); }
00108   int             GetItemCount()     { return (m_cItem); }
00109 #ifdef DEBUG
00110   void *        GetHead();
00111   void *        GetTail();
00112   void *        RemoveHead();
00113   void *          RemoveTail();
00114   void *        GetFromPosition(POSITION rPos);
00115 #else
00116   void *        GetHead()          { return GetFromPosition(GetHeadPosition());}
00117   void *          GetTail()          { return m_pTail->pItem;}
00118   void *        RemoveHead()       { return RemoveAt(m_pHead); }
00119   void *          RemoveTail()       { return RemoveAt(m_pTail); }
00120   void *        GetFromPosition(POSITION rPos){return(rPos->pItem);}
00121 #endif
00122 };
00123
00124 //****************************************************************************
00125 //
00126 // Utility Functions
00127 //
00128 //****************************************************************************
00129
00130 POSITION AddNode(PVOID pv, COBLIST ** ppList);
00131 PVOID RemoveNode(POSITION * pPos, COBLIST *pList);
00132
00133
00134 //****************************************************************************
00135 //
00136 // CLASS BSTRING
00137 //
00138 //****************************************************************************
00139
00140 class BSTRING
00141 {
00142 private:
00143   BSTR   m_bstr;
00144
00145 public:
00146   // Constructors
00147   BSTRING() {m_bstr = NULL;}
00148
00149   inline BSTRING(LPCWSTR lpcwString);
00150
00151 #if !defined(UNICODE)
00152   // We don't support construction from an ANSI string in the Unicode build.
00153   BSTRING(LPCSTR lpcString);
00154 #endif // !defined(UNICODE)
00155
00156   // Destructor
00157   inline ~BSTRING();
00158
00159   // Cast to BSTR
00160   operator BSTR() {return m_bstr;}
00161   inline LPBSTR GetLPBSTR(void);
00162 };
00163
00164
00165 BSTRING::BSTRING(LPCWSTR lpcwString)
00166 {
00167   if (NULL != lpcwString)
00168   {
00169     m_bstr = SysAllocString(lpcwString);
00170     ASSERT(NULL != m_bstr);
00171   }
00172   else
00173   {
00174     m_bstr = NULL;
00175   }
00176 }
00177
00178 BSTRING::~BSTRING()
00179 {
00180   if (NULL != m_bstr)
00181   {
00182     SysFreeString(m_bstr);
00183   }
00184 }
00185
00186 inline LPBSTR BSTRING::GetLPBSTR(void)
00187 {
00188   ASSERT(NULL == m_bstr);
00189
00190   return &m_bstr;
00191 }
00192
00193
00194 //****************************************************************************
00195 //
00196 // CLASS BTSTR
00197 //
00198 //****************************************************************************
00199
00200 class BTSTR
00201 {
00202 private:
00203   LPTSTR m_psz;
00204
00205 public:
00206   BTSTR(BSTR bstr);
00207   ~BTSTR();
00208
00209   // Cast to BSTR
00210   operator LPTSTR() {return (NULL == m_psz) ? TEXT("<null>") : m_psz;}
00211 };
00212
00213 LPTSTR PszFromBstr(BSTR bst);
00214
00215
00216 #endif  // _CL_UTIL_H_
00217
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/BPSamp/Main.c Source File

  • WinBase
  • Debug
  • BPSamp

Main.c

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004    TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE
00006
00007    Copyright (C) 1999 - 2000. Microsoft Corporation. All rights reserved.
00008
00009    main.c
00010
00011      Contains the main routine of this program including the control-C
00012      handler and the main debug event loop.
00013
00014 ----------------------------------------------------------------------------*/
00015 #include <windows.h>
00016 #include <stdio.h>
00017 #include "bpsamp.h"
00018
00019 HANDLE g_hProcDebuggee;
00020
00021 /*----------------------------------------------------------------------------
00022    main(argc, argv)
00023
00024   Main only expects a name of an EXE to debug.
00025
00026   The main routine starts the process as a debuggee by the given EXE name.
00027   It then continues to execute in a loop waiting for debug events delivered
00028   by the OS.
00029 ----------------------------------------------------------------------------*/
00030
00031 void main(int argc, char **argv)
00032 {
00033    BOOL fExit = FALSE;
00034    STARTUPINFO si;
00035    PROCESS_INFORMATION pi;
00036    LPSTR lpszCmdLine = NULL;
00037    DEBUG_EVENT de;
00038    DWORD dwContinue = 0;
00039    OSVERSIONINFO osvi;
00040
00041
00042    if (argc < 2)
00043    {
00044       printf("please pass name of exe to debug\n");
00045       return;
00046
00047    }
00048
00049    lpszCmdLine = argv[1];
00050
00051    osvi.dwOSVersionInfoSize = sizeof(osvi);
00052    GetVersionEx(&osvi);
00053    if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT)
00054    {
00055       printf("This sample is only supported on Windows NT\n");
00056       return;
00057    }
00058
00059    // register a control C handler to get user commands
00060    if (!SetConsoleCtrlHandler(control_C_handler, TRUE))
00061    {
00062       printf("FATAL! SetConsoleCtrlHandler failed: %d\n", GetLastError());
00063       return;
00064    }
00065
00066
00067    memset(&si, 0, sizeof(STARTUPINFO));
00068    si.cb = sizeof(STARTUPINFO);
00069    if (!CreateProcess(NULL, lpszCmdLine, NULL, NULL, 1,
00070         NORMAL_PRIORITY_CLASS | DEBUG_PROCESS, NULL, NULL, &si, &pi))
00071    {
00072       printf("CreateProcess(%s) failed: %d.\n", lpszCmdLine, GetLastError() );
00073       return;
00074    }
00075
00076    display_help();
00077
00078
00079    g_hProcDebuggee = pi.hProcess;
00080
00081
00082    while(!fExit && WaitForDebugEvent(&de, INFINITE))
00083    {
00084
00085       dump_debug_event_info(&de);
00086
00087       dwContinue = DBG_CONTINUE;
00088       switch(de.dwDebugEventCode)
00089       {
00090          case EXCEPTION_DEBUG_EVENT:
00091
00092          switch (de.u.Exception.ExceptionRecord.ExceptionCode)
00093          {
00094             case EXCEPTION_BREAKPOINT:
00095
00096                display_thread_registers(de.dwThreadId);
00097
00098                // if Eip is at the g_dwCodeAddress for
00099                // the code breakpoint, indicate the the
00100                // rest of the debugger we are at a code
00101                // breakpoint.
00102
00103                if (de.u.Exception.ExceptionRecord.ExceptionAddress ==
00104                      (LPVOID)g_dwCodeAddress)
00105                {
00106                   printf("code breakpoint hit!\n");
00107                   g_fAtCodeBreakpoint = TRUE;
00108                   g_dwCurrentThreadID = de.dwThreadId;
00109                }
00110                else
00111                {
00112                   g_fAtCodeBreakpoint = FALSE;
00113                }
00114
00115                fExit = do_debug_command();
00116
00117                dwContinue = DBG_CONTINUE;
00118
00119             break;
00120
00121             case EXCEPTION_SINGLE_STEP:
00122
00123                display_thread_registers(de.dwThreadId);
00124
00125                fExit = do_debug_command();
00126                dwContinue = DBG_CONTINUE;
00127
00128             break;
00129
00130             case DBG_CONTROL_C:
00131             case DBG_CONTROL_BREAK:
00132
00133
00134                fExit = do_debug_command();
00135                dwContinue = DBG_CONTINUE;
00136
00137             break;
00138
00139
00140             default:
00141                dwContinue = DBG_EXCEPTION_NOT_HANDLED;
00142             break;
00143          }
00144
00145          break;
00146
00147          case CREATE_THREAD_DEBUG_EVENT:
00148             add_thread(de.dwThreadId, de.u.CreateThread.hThread);
00149          break;
00150
00151          case CREATE_PROCESS_DEBUG_EVENT:
00152             add_thread(de.dwThreadId, de.u.CreateProcessInfo.hThread);
00153          break;
00154
00155          case EXIT_THREAD_DEBUG_EVENT:
00156             remove_thread(de.dwThreadId);
00157          break;
00158
00159          case EXIT_PROCESS_DEBUG_EVENT:
00160                fExit = TRUE;
00161          break;
00162
00163          case LOAD_DLL_DEBUG_EVENT:
00164          break;
00165
00166          case UNLOAD_DLL_DEBUG_EVENT:
00167          break;
00168
00169          case OUTPUT_DEBUG_STRING_EVENT:
00170          break;
00171
00172          case RIP_EVENT:
00173          break;
00174          default:
00175          break;
00176       }
00177
00178
00179       ContinueDebugEvent(de.dwProcessId, de.dwThreadId, dwContinue);
00180
00181    }  // while(!fExit && WaitForDebugEvent(&de, INFINITE))
00182
00183
00184 }
00185
00186
00187 /*----------------------------------------------------------------------------
00188    control_C_handler(dwCtrlType)
00189
00190   dwCtrlType tells the type of event that activated this handler routine.
00191
00192   TRUE if handled.
00193   FALSE if not handled.
00194
00195   This particular Control C handler will create a remote thread in the
00196   debuggee processes.  While it is not necessary to have a stopped process
00197   to set code breakpoints (using embedded int 3 opcode) it is necessary
00198   for data access breakpoints.   This allows the debugger to stop the
00199   debuggee so that the user can type in a debugging command (ie set a
00200   breakpoint).
00201 ----------------------------------------------------------------------------*/
00202
00203 BOOL WINAPI control_C_handler(DWORD dwCtrlType)
00204 {
00205    DWORD dwThreadID = 0;
00206    HANDLE hThread;
00207
00208
00209    if ((CTRL_C_EVENT == dwCtrlType) || (CTRL_BREAK_EVENT == dwCtrlType))
00210    {
00211       // don't start new debug command threads if one already started
00212       if (g_fInDbgCmd)
00213          return TRUE;
00214       // to start the command prompt create a thread and
00215       // return
00216
00217       g_fInDbgCmd = TRUE;  // keeps from calling CreateRemoteThread
00218                          // multiple times when debugger command thread
00219                          // is active
00220       hThread = CreateRemoteThread(g_hProcDebuggee, NULL, 0,
00221          (LPTHREAD_START_ROUTINE)DebugBreak, NULL, 0, &dwThreadID);
00222       if (hThread == NULL)
00223       {
00224          printf("ERROR: CreateRemoteThread failed: %d\n", GetLastError());
00225          g_fInDbgCmd = FALSE;
00226       }
00227       else
00228       {
00229          CloseHandle(hThread);
00230       }
00231
00232
00233       return TRUE;
00234    }
00235
00236    return FALSE;
00237 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/basesnap.Cpp Source File

  • SysMgmt
  • MMC
  • Simple

basesnap.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <initguid.h>
00021 #include "guids.h"
00022 #include "basesnap.h"
00023 #include "Comp.h"
00024 #include "CompData.h"
00025 #include "Registry.h"
00026
00027 // our globals
00028 HINSTANCE g_hinst;
00029
00030 BOOL WINAPI DllMain(HINSTANCE hinstDLL,
00031                     DWORD fdwReason,
00032                     void* lpvReserved)
00033 {
00034
00035     if (fdwReason == DLL_PROCESS_ATTACH) {
00036         g_hinst = hinstDLL;
00037     }
00038
00039     return TRUE;
00040 }
00041
00042
00043 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj)
00044 {
00045     if (rclsid != CLSID_CComponentData)
00046         return CLASS_E_CLASSNOTAVAILABLE;
00047
00048     if (!ppvObj)
00049         return E_FAIL;
00050
00051     *ppvObj = NULL;
00052
00053     // We can only hand out IUnknown and IClassFactory pointers.  Fail
00054     // if they ask for anything else.
00055     if (!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00056         return E_NOINTERFACE;
00057
00058     CClassFactory *pFactory = new CClassFactory();
00059     if (NULL == pFactory)
00060         return E_OUTOFMEMORY;
00061
00062     HRESULT hr = pFactory->QueryInterface(riid, ppvObj);
00063
00064     return hr;
00065 }
00066
00067 STDAPI DllCanUnloadNow(void)
00068 {
00069     if (g_uObjects == 0 && g_uSrvLock == 0)
00070         return S_OK;
00071     else
00072         return S_FALSE;
00073 }
00074
00075 CClassFactory::CClassFactory()
00076 : m_cref(0)
00077 {
00078     OBJECT_CREATED
00079 }
00080
00081 CClassFactory::~CClassFactory()
00082 {
00083     OBJECT_DESTROYED
00084 }
00085
00086 STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv)
00087 {
00088     if (!ppv)
00089         return E_FAIL;
00090
00091     *ppv = NULL;
00092
00093     if (IsEqualIID(riid, IID_IUnknown))
00094         *ppv = static_cast<IClassFactory *>(this);
00095     else
00096         if (IsEqualIID(riid, IID_IClassFactory))
00097             *ppv = static_cast<IClassFactory *>(this);
00098
00099         if (*ppv)
00100         {
00101             reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00102             return S_OK;
00103         }
00104
00105         return E_NOINTERFACE;
00106 }
00107
00108 STDMETHODIMP_(ULONG) CClassFactory::AddRef()
00109 {
00110     return InterlockedIncrement((LONG *)&m_cref);
00111 }
00112
00113 STDMETHODIMP_(ULONG) CClassFactory::Release()
00114 {
00115     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00116     {
00117         delete this;
00118         return 0;
00119     }
00120     return m_cref;
00121 }
00122
00123 STDMETHODIMP CClassFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj)
00124 {
00125     HRESULT  hr;
00126     void* pObj;
00127
00128     if (!ppvObj)
00129         return E_FAIL;
00130
00131     *ppvObj = NULL;
00132
00133     // Our object does does not support aggregation, so we need to
00134     // fail if they ask us to do aggregation.
00135     if (pUnkOuter)
00136         return CLASS_E_NOAGGREGATION;
00137
00138     pObj = new CComponentData();
00139
00140     if (!pObj)
00141         return E_OUTOFMEMORY;
00142
00143     // QueryInterface will do the AddRef() for us, so we do not
00144     // do it in this function
00145     hr = ((LPUNKNOWN)pObj)->QueryInterface(riid, ppvObj);
00146
00147     if (FAILED(hr))
00148         delete pObj;
00149
00150     return hr;
00151 }
00152
00153 STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
00154 {
00155     if (fLock)
00156         InterlockedIncrement((LONG *)&g_uSrvLock);
00157     else
00158         InterlockedDecrement((LONG *)&g_uSrvLock);
00159
00160     return S_OK;
00161 }
00162
00163 //////////////////////////////////////////////////////////
00164 //
00165 // Exported functions
00166 //
00167
00168
00169 //
00170 // Server registration
00171 //
00172 STDAPI DllRegisterServer()
00173 {
00174     _TCHAR szName[256];
00175     _TCHAR szSnapInName[256];
00176
00177     LoadString(g_hinst, IDS_NAME, szName, (sizeof szName)/(sizeof szName[0]));
00178     LoadString(g_hinst, IDS_SNAPINNAME, szSnapInName, (sizeof szSnapInName)/(sizeof szSnapInName[0]));
00179
00180     if (RegisterServer(g_hinst,
00181         CLSID_CComponentData,
00182         szName) == S_OK)
00183         return RegisterSnapin(CLSID_CComponentData, szSnapInName, IID_NULL, FALSE);
00184     else
00185         return E_FAIL;
00186 }
00187
00188
00189 STDAPI DllUnregisterServer()
00190 {
00191     if (UnregisterServer(CLSID_CComponentData) == S_OK)
00192         return UnregisterSnapin(CLSID_CComponentData);
00193     else
00194         return E_FAIL;
00195 }
00196
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EdAnnotator/AnnotatorProject/Annotator.cpp Source File

  • Web
  • Browser
  • EdAnnotator
  • AnnotatorProject

Annotator.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Annotator.cpp : Implementation of CAnnotator
00006
00007 #include "stdafx.h"
00008 #include "EDAnnotator.h"
00009 #include "Annotator.h"
00010 #include "docobj.h"
00011 #include "mshtmcid.h"
00012 #include "mshtmhst.h"
00013 #include "mshtmdid.h"
00014
00015 /////////////////////////////////////////////////////////////////////////////
00016 // CAnnotator
00017
00018 // IHTMLEditDesigner
00019 STDMETHODIMP
00020 CAnnotator::PostEditorEventNotify(DISPID inEvtDispId, IHTMLEventObj *pIEventObj)
00021 {
00022     return S_FALSE;
00023 }
00024
00025 STDMETHODIMP
00026 CAnnotator::PostHandleEvent(DISPID inEvtDispId, IHTMLEventObj *pIEventObj)
00027 {
00028
00029     return S_FALSE;
00030 }
00031
00032 STDMETHODIMP
00033 CAnnotator::PreHandleEvent(DISPID inEvtDispId, IHTMLEventObj *pIEventObj)
00034 {
00035     USES_CONVERSION;
00036
00037     CComQIPtr<IHTMLElement> spSrcElem;
00038     CComQIPtr<IHTMLElement3> spSrcElem3;
00039     VARIANT_BOOL bIsEditable;
00040
00041     pIEventObj->get_srcElement(&spSrcElem);
00042     spSrcElem->QueryInterface(IID_IHTMLElement3, (void**)&spSrcElem3);
00043     spSrcElem3->get_isContentEditable(&bIsEditable);
00044
00045     // Reject all events that aren't in content-editable areas
00046     if (bIsEditable == VARIANT_FALSE) return S_FALSE;
00047
00048     CComQIPtr<IOleCommandTarget> spCmdTarg;
00049     CComBSTR bstrSrcTagName;
00050     CComVariant var;
00051     LPSTR szName;
00052     BOOL bAreObjectsEqual = FALSE;
00053
00054     m_spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCmdTarg);
00055
00056     spSrcElem->get_tagName(&bstrSrcTagName);
00057     szName = OLE2A(bstrSrcTagName);
00058
00059     switch (inEvtDispId)
00060     {
00061     case DISPID_HTMLELEMENTEVENTS2_ONMOUSEOVER:
00062
00063         if (!strcmp(szName, "!") || !strcmp(szName, "COMMENT"))
00064         {
00065             // Set cursor over comment to arrow
00066             var = TRUE;
00067             spCmdTarg->Exec(&CGID_MSHTML, IDM_OVERRIDE_CURSOR, OLECMDEXECOPT_DODEFAULT, &var, NULL);
00068             HCURSOR arrow = LoadCursor(NULL,IDC_ARROW);
00069             m_hOldCursor = SetCursor(arrow);
00070         }
00071         break;
00072
00073     case DISPID_HTMLELEMENTEVENTS2_ONMOUSEOUT:
00074
00075         if (!strcmp(szName, "!") || !strcmp(szName, "COMMENT"))
00076         {
00077             // Set cursor over comment back to auto
00078             var = FALSE;
00079             SetCursor(m_hOldCursor);
00080             spCmdTarg->Exec(&CGID_MSHTML, IDM_OVERRIDE_CURSOR, OLECMDEXECOPT_DODEFAULT, &var, NULL);
00081         }
00082         break;
00083
00084     case DISPID_HTMLELEMENTEVENTS2_ONMOUSEUP:
00085
00086         // Check if current src element is the same as any saved src element
00087         // which would be the comment that is currently being edited
00088         // If it is, we want to close the comment edit box without opening a new one.
00089         if (m_spSrcElem)
00090             bAreObjectsEqual = spSrcElem.IsEqualObject(m_spSrcElem);
00091
00092         // If there is an open comment edit box already and the mouse release
00093         // didn't occur in the edit box, close the comment edit box
00094         if (m_spCommentEditBox &&
00095             !spSrcElem.IsEqualObject(m_spCommentEditBox))
00096                 CloseCommentEditBox();
00097
00098         // If there isn't an open comment edit box already, and
00099         // if the click was not on a glyph to close the comment edit box, and
00100         // if the click occurred on a comment element,
00101         // then open a comment edit box
00102         if (!m_spCommentEditBox &&
00103             !bAreObjectsEqual &&
00104             (!(strcmp(szName, "!")) || !(strcmp(szName, "COMMENT"))))
00105                 OpenCommentEditBox(spSrcElem);
00106
00107         break;
00108     }
00109
00110     return S_FALSE;
00111 }
00112
00113 STDMETHODIMP
00114 CAnnotator::TranslateAccelerator(DISPID inEvtDispId, IHTMLEventObj *pIEventObj)
00115 {
00116     return S_FALSE;
00117 }
00118
00119 // IAnnotator
00120 STDMETHODIMP CAnnotator::AttachAnnotator(IHTMLDocument2* pDoc)
00121 {
00122     CComPtr<IServiceProvider> spSP;
00123     CComPtr<IHTMLEditServices> spES;
00124
00125     m_spDoc = pDoc; // IUnknown::AddRef is automatically called
00126                     // on smart pointer m_spDoc
00127
00128     m_spDoc->QueryInterface(IID_IServiceProvider, (void**)&spSP);
00129
00130     spSP->QueryService(SID_SHTMLEditServices,
00131                        IID_IHTMLEditServices,
00132                        (void**)&spES);
00133
00134     this->QueryInterface(IID_IHTMLEditDesigner, (void**)&m_spDesigner);
00135
00136     spES->AddDesigner(m_spDesigner);
00137
00138     return S_OK;
00139 }
00140
00141 STDMETHODIMP CAnnotator::DetachAnnotator()
00142 {
00143     CComPtr<IServiceProvider> spSP;
00144     CComPtr<IHTMLEditServices> spES;
00145
00146     m_spDoc->QueryInterface(IID_IServiceProvider, (void**)&spSP);
00147
00148     spSP->QueryService(SID_SHTMLEditServices,
00149                        IID_IHTMLEditServices,
00150                        (void**)&spES);
00151
00152     spES->RemoveDesigner(m_spDesigner);
00153
00154     m_spDesigner = (IHTMLEditDesigner*)NULL; // Assignment of NULL causes automatic
00155                                              // call toIUnknown::Release on the
00156                                              // m_spDesigner smart pointer.
00157     return S_OK;
00158 }
00159
00160 STDMETHODIMP CAnnotator::ShowCommentGlyphs(BOOL bShow)
00161 {
00162     CComVariant vGlyphTableEntry;
00163     CComPtr<IOleCommandTarget> pCmdTarg;
00164
00165     m_spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&pCmdTarg);
00166
00167     if (bShow)
00168     {
00169         //Load Glyph Table Entry into VARIANT
00170         vGlyphTableEntry =
00171             "%%comment^^%%res://EDannotator.dll/comment.gif^^%%0^^%%3^^%%3^^%%4^^%%20^^%%15^^%%20^^%%15^^**";
00172
00173         // Exec IDM_ADDTOGLYPHTABLE
00174         pCmdTarg->Exec(&CGID_MSHTML,
00175                        IDM_ADDTOGLYPHTABLE,
00176                        OLECMDEXECOPT_DODEFAULT,
00177                        &vGlyphTableEntry,
00178                        NULL);
00179     }
00180     else
00181         pCmdTarg->Exec(&CGID_MSHTML,
00182                        IDM_EMPTYGLYPHTABLE,
00183                        OLECMDEXECOPT_DODEFAULT,
00184                        NULL,
00185                        NULL);
00186
00187     return S_OK;
00188 }
00189
00190 STDMETHODIMP
00191 CAnnotator::AddComment()
00192 {
00193     CComPtr<IDisplayServices> spDS;
00194     CComPtr<IHTMLCaret> spCaret;
00195     CComPtr<IDisplayPointer> spDP;
00196     CComPtr<IHTMLElement> spNewComment;
00197     CComPtr<IHTMLElement> spFElem;
00198   CComPtr<IHTMLElement3> spFElem3;
00199     CComPtr<IHTMLWindow2> spWin;
00200     CComPtr<IMarkupServices> spMS;
00201     CComPtr<IMarkupPointer> spMP;
00202   VARIANT_BOOL bIsEditable;
00203
00204     // Retrieve interface for insertion point,
00205     // place display pointer at its location, and retrieve the
00206   // flow element containing the display pointer
00207     m_spDoc->QueryInterface(IID_IDisplayServices, (void**)&spDS);
00208     spDS->CreateDisplayPointer(&spDP);
00209     spDS->GetCaret(&spCaret);
00210     spCaret->MoveDisplayPointerToCaret(spDP);
00211     spDP->GetFlowElement(&spFElem);
00212
00213   // Check if display pointer is in content-editable area
00214   spFElem->QueryInterface(IID_IHTMLElement3, (void**)&spFElem3);
00215   spFElem3->get_isContentEditable(&bIsEditable);
00216   if (bIsEditable != VARIANT_TRUE) return S_OK;
00217
00218     // Check to see if comment is open;
00219     if (m_spCommentEditBox)
00220     {
00221         // If so, check to see if caret is in comment edit box
00222
00223         if (spFElem.IsEqualObject(m_spCommentEditBox))
00224         {
00225             // If so, alert that comment can't be added to comment and return
00226             m_spDoc->get_parentWindow(&spWin);
00227             spWin->alert(L"Cannot add comment to comment.");
00228             return S_OK;
00229         }
00230         else
00231             CloseCommentEditBox();
00232     }
00233
00234     // Add the new comment and open the comment edit box for it
00235     m_spDoc->QueryInterface(IID_IMarkupServices, (void**)&spMS);
00236
00237     spMS->CreateElement(TAGID_COMMENT,
00238                         NULL,
00239                         &spNewComment);
00240
00241     spMS->CreateMarkupPointer(&spMP);
00242     spDP->PositionMarkupPointer(spMP);
00243
00244     spMS->InsertElement(spNewComment, spMP, NULL);
00245     OpenCommentEditBox(spNewComment);
00246
00247     return S_OK;
00248 }
00249
00250 //Helper methods
00251 STDMETHODIMP
00252 CAnnotator::OpenCommentEditBox(IHTMLElement* pSrcElem)
00253 {
00254     USES_CONVERSION;
00255
00256     CComPtr<IHTMLElement> spBody;
00257     CComPtr<IHTMLElement2> spBody2;
00258     CComPtr<IHTMLElement2> spSrcElem2;
00259     CComPtr<IHTMLElement2> spCommentEditBox2;
00260     CComPtr<IHTMLElement3> spCommentEditBox3;
00261     CComPtr<IHTMLStyle> spStyle;
00262     CComPtr<IHTMLStyle2> spStyle2;
00263     CComBSTR bstrOuterHTML;
00264     CComBSTR spanString;
00265     CComBSTR tagName;
00266     CComVariant vBoxLeft, vBoxTop, vBoxWidth, vBoxHeight, vBoxBGColor;
00267     LPTSTR szName;
00268
00269     // Retrieve entire comment and tag name
00270     m_spSrcElem = pSrcElem;
00271     m_spSrcElem->get_outerHTML(&bstrOuterHTML);
00272     m_spSrcElem->get_tagName(&tagName);
00273     szName = OLE2T(tagName);
00274
00275     // Extract text from comment depending on comment style
00276     LONG lCommentLength = bstrOuterHTML.Length();
00277
00278     if (!_tcscmp(szName, _T("!")))
00279     {
00280         for (int i = 4; i < lCommentLength - 3; i++)
00281         {
00282             LPTSTR onechar = (LPTSTR)&bstrOuterHTML.m_str[i];
00283             spanString.Append(onechar);
00284         }
00285     }
00286
00287     if (!_tcscmp(szName, _T("COMMENT")))
00288     {
00289         int endbracket = 8;
00290         LPTSTR onechar = (LPTSTR)&bstrOuterHTML.m_str[endbracket];
00291
00292         while (_tcscmp(onechar, _T(">")))
00293             onechar = (LPTSTR)&bstrOuterHTML.m_str[++endbracket];
00294
00295         for (int i = ++endbracket; i < lCommentLength - 10; i++)
00296         {
00297             LPTSTR onechar = (LPTSTR)&bstrOuterHTML.m_str[i];
00298             spanString.Append(onechar);
00299         }
00300     }
00301
00302     // Disable resizing handles on while in comment edit mode
00303     CComPtr<IOleCommandTarget> spCmdTarg;
00304     m_spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCmdTarg);
00305     spCmdTarg->Exec(&CGID_MSHTML, IDM_DISABLE_EDITFOCUS_UI, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
00306
00307     // Create the temporary comment edit box
00308     m_spDoc->createElement(L"span", &m_spCommentEditBox);
00309     m_spCommentEditBox->put_innerHTML(spanString);
00310
00311     // insertAdjacentElement must be called after put_innerHTML
00312     // or the undo command can erase the comment box's contents
00313     // insertAdjacentElement protects put_innerHTML from
00314     // inclusion in undo stack
00315     m_spDoc->get_body(&spBody);
00316     spBody->QueryInterface(IID_IHTMLElement2, (void**)&spBody2);
00317     spBody2->insertAdjacentElement(L"beforeEnd", m_spCommentEditBox, NULL);
00318
00319     CComPtr<IMarkupServices> spMUS;
00320     CComPtr<IMarkupPointer> spMUP;
00321     CComPtr<IDisplayServices> spDS;
00322     CComPtr<IDisplayPointer> spDP;
00323     CComPtr<ILineInfo> spLineInfo;
00324     POINT ptDPLocation;
00325
00326     // Query for IMarkupServices and
00327     // IDisplayServices interfaces
00328     m_spDoc->QueryInterface(IID_IMarkupServices, (void**)&spMUS);
00329     m_spDoc->QueryInterface(IID_IDisplayServices, (void**)&spDS);
00330
00331     // Create markup pointer and move to end of source element
00332     spMUS->CreateMarkupPointer(&spMUP);
00333     spMUP->MoveAdjacentToElement(m_spSrcElem, ELEM_ADJ_AfterEnd);
00334
00335     // Create display pointer and place at markup pointer
00336     spDS->CreateDisplayPointer(&spDP);
00337     spDP->MoveToMarkupPointer(spMUP, NULL);
00338
00339     // Get ILineInfo interface from which to
00340     // retrieve display pointer location
00341     spDP->GetLineInfo(&spLineInfo);
00342
00343     // Get display pointer location and
00344     // tranfrom to global coordinate system
00345     spLineInfo->get_x(&(ptDPLocation.x));
00346     spLineInfo->get_baseLine(&(ptDPLocation.y));
00347
00348     spDS->TransformPoint(&ptDPLocation,
00349                          COORD_SYSTEM_CONTENT,
00350                          COORD_SYSTEM_GLOBAL,
00351                          m_spSrcElem);
00352
00353     // Transfer position, size and color for box to
00354     // VARIANT structures
00355     vBoxLeft = ptDPLocation.x;
00356     vBoxTop = ptDPLocation.y;
00357     vBoxWidth = 225;
00358     vBoxHeight = 150;
00359     vBoxBGColor = "#ff6666";
00360
00361     // Set positioning and styles for comment edit box
00362     m_spCommentEditBox->get_style(&spStyle);
00363     spStyle->QueryInterface(IID_IHTMLStyle2, (void**)&spStyle2);
00364     spStyle2->put_position(L"absolute");
00365     spStyle->put_top(vBoxTop);
00366     spStyle->put_left(vBoxLeft);
00367     spStyle->put_width(vBoxWidth);
00368     spStyle->put_height(vBoxHeight);
00369     spStyle->put_backgroundColor(vBoxBGColor);
00370     spStyle->put_padding(L"5");
00371     spStyle->put_border(L"thin solid #666666");
00372
00373     // Make Comment Edit Box contentEditable
00374     m_spCommentEditBox->QueryInterface(IID_IHTMLElement3, (void**)&spCommentEditBox3);
00375     spCommentEditBox3->put_contentEditable(L"true");
00376
00377     // Place insertion point in box
00378     m_spCommentEditBox->QueryInterface(IID_IHTMLElement2, (void**)&spCommentEditBox2);
00379     spCommentEditBox2->focus();
00380
00381     return S_OK;
00382 }
00383
00384 STDMETHODIMP
00385 CAnnotator::CloseCommentEditBox()
00386 {
00387     USES_CONVERSION;
00388
00389     CComBSTR tagName;
00390     CComBSTR commentString;
00391     CComPtr<IHTMLWindow2> spWin;
00392     CComPtr<IHTMLElement> spBodyElem;
00393     CComPtr<IHTMLElement> spParElem;
00394     CComPtr<IHTMLDOMNode> spParElemNode;
00395     CComPtr<IHTMLDOMNode> spTempCommentBoxNode;
00396     CComPtr<IMarkupServices> spMUServ;
00397     CComPtr<IMarkupPointer> spMPSrcBeg;
00398     CComPtr<IMarkupPointer> spMPSrcEnd;
00399     CComPtr<IHTMLCommentElement> spCommentElement;
00400     CComPtr<IOleCommandTarget> spCmdTarg;
00401
00402     m_spSrcElem->get_tagName(&tagName);
00403     LPSTR szName = OLE2A(tagName);
00404
00405     // Format new comment from comment edit box inner text
00406     // Note: two different styles of comment
00407     if (!strcmp(szName, "!"))
00408         commentString = "<!--";
00409
00410     CComBSTR spanString;
00411     m_spCommentEditBox->get_innerText(&spanString);
00412     commentString.AppendBSTR(spanString);
00413
00414     if (!strcmp(szName, "!"))
00415         commentString.Append(_T("-->"));
00416
00417     // Place new text in original comment
00418     m_spSrcElem->QueryInterface(IID_IHTMLCommentElement, (void**)&spCommentElement);
00419     spCommentElement->put_text(commentString);
00420
00421     // Remove comment edit box
00422     m_spCommentEditBox->get_parentElement(&spParElem);
00423
00424     m_spCommentEditBox->QueryInterface(IID_IHTMLDOMNode,
00425                                        (void**)&spTempCommentBoxNode);
00426
00427     spParElem->QueryInterface(IID_IHTMLDOMNode,
00428                               (void**)&spParElemNode);
00429
00430     spParElemNode->removeChild(spTempCommentBoxNode, NULL);
00431
00432     // Release interface pointers; assignment of NULL causes automatic
00433     // call to IUnknown::Release on CComPtr smart pointers
00434     m_spCommentEditBox = (IHTMLElement*)NULL;
00435     m_spSrcElem = (IHTMLElement*)NULL;
00436
00437     // Reactivate resizing handles when leaving comment edit mode
00438     m_spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCmdTarg);
00439     spCmdTarg->Exec(&CGID_MSHTML, IDM_DISABLE_EDITFOCUS_UI, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
00440
00441     return S_OK;
00442 }
00443
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIRowsetIdentity Member List

This is the complete list of members for CImpIRowsetIdentity, including all inherited members.
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CRowset, CImpIRowsetIdentity) | CImpIRowsetIdentity
IsSameRow(HROW hThisRow, HROW hThatRow) | CImpIRowsetIdentity
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_UNITSTABLE Member List

This is the complete list of members for _UNITSTABLE, including all inherited members.
enumPeriod | _UNITSTABLE
pwszString | _UNITSTABLE
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_VOLUME_GET_GPT_ATTRIBUTES_INFORMATION Member List

This is the complete list of members for _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION, including all inherited members.
GptAttributes _VOLUME_GET_GPT_ATTRIBUTES_INFORMATION
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/common/rumem.cpp Source File

  • NetDS
  • RRas
  • rqs
  • common

rumem.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RuMem.cpp
00004 //
00005 //      Synopsis:   Memory allocation api's
00006 //
00007 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00008 //
00009 //+--------------------------------------------------------------------------
00010
00011 #include "RuMem.h"
00012
00013 // Generic Memory Free function
00014 //
00015 BOOL
00016 RuFree(
00017     IN PVOID pvMem       // The pointer to the memory block to free
00018     )
00019 {
00020     BOOL fSuccess = FALSE;
00021
00022     do
00023     {
00024         if ( NULL == pvMem )
00025         {
00026             fSuccess = FALSE;
00027             break;
00028         }
00029
00030         HANDLE hHeap = GetProcessHeap();
00031
00032         fSuccess = HeapFree(hHeap,
00033                             0,
00034                             pvMem);
00035     }
00036     while(FALSE);
00037
00038     return fSuccess;
00039 }
00040
00041 // Generic memroy allocation function. If succeded, returns the allocated memory pointer, if
00042 // failed, returns NULL pointer
00043 //
00044 PVOID
00045 RuAlloc(
00046     IN DWORD dwSize,    // how many bytes of memory to allocate
00047     IN BOOL fZero       // If the allocated memory should be Initialized to 0
00048     )
00049 {
00050     PVOID  pvMem = NULL;
00051
00052     HANDLE hHeap = GetProcessHeap();
00053
00054
00055     if ( NULL == hHeap )
00056     {
00057         return NULL;
00058     }
00059
00060     pvMem = HeapAlloc( hHeap,
00061                        fZero ? HEAP_ZERO_MEMORY: 0,
00062                        dwSize);
00063     return pvMem;
00064 }
00065
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/guids.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

guids.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      Guids.h
00005 //
00006 //  Description:
00007 //      File for definition of CLSIDs, GUIDs, and logging GUIDs.
00008 //
00009 //////////////////////////////////////////////////////////////////////////////
00010
00011 #pragma once
00012
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 // Include Files
00016 //////////////////////////////////////////////////////////////////////////////
00017
00018 #pragma warning( push )
00019 #include <initguid.h>
00020 #pragma warning( pop )
00021
00022 //////////////////////////////////////////////////////////////////////////////
00023 //
00024 // Reporting GUIDs
00025 //
00026 //////////////////////////////////////////////////////////////////////////////
00027
00028 ////////////////////////////////////////////////////////////////////////
00029 // CMgdClusCfgInit
00030 ////////////////////////////////////////////////////////////////////////
00031
00032 // {E9FBB913-DE7B-4d7d-B367-06E7EEC8019E}
00033 DEFINE_GUID( TASKID_Minor_StorageResourceInitialize,
00034 0xe9fbb913, 0xde7b, 0x4d7d, 0xb3, 0x67, 0x6, 0xe7, 0xee, 0xc8, 0x1, 0x9e);
00035
00036
00037 ////////////////////////////////////////////////////////////////////////
00038 // CStorageResource
00039 ////////////////////////////////////////////////////////////////////////
00040
00041 // {A52B9965-6BF8-4216-8FC9-04E715180DD5}
00042 DEFINE_GUID( TASKID_Minor_GetDriveLetterMappings_StorageResource,
00043 0xa52b9965, 0x6bf8, 0x4216, 0x8f, 0xc9, 0x4, 0xe7, 0x15, 0x18, 0xd, 0xd5);
00044
00045 // {FA2988E6-51FC-47ce-861E-CE7A6E9ED6AF}
00046 DEFINE_GUID( TASKID_Minor_GetName_Pointer,
00047 0xfa2988e6, 0x51fc, 0x47ce, 0x86, 0x1e, 0xce, 0x7a, 0x6e, 0x9e, 0xd6, 0xaf);
00048
00049 // {2C130DBC-CDD3-4e24-A428-E284B64D4101}
00050 DEFINE_GUID( TASKID_Minor_GetName_Memory,
00051 0x2c130dbc, 0xcdd3, 0x4e24, 0xa4, 0x28, 0xe2, 0x84, 0xb6, 0x4d, 0x41, 0x1);
00052
00053 // {E2986823-149E-40a8-8606-B8EDF1D07868}
00054 DEFINE_GUID( TASKID_Minor_SetName_StorageResource,
00055 0xe2986823, 0x149e, 0x40a8, 0x86, 0x6, 0xb8, 0xed, 0xf1, 0xd0, 0x78, 0x68);
00056
00057 // {47BE7AA7-A677-42f5-84C8-8E519179FE75}
00058 DEFINE_GUID( TASKID_Minor_StorageResource_GetUID_Pointer,
00059 0x47be7aa7, 0xa677, 0x42f5, 0x84, 0xc8, 0x8e, 0x51, 0x91, 0x79, 0xfe, 0x75);
00060
00061 // {A61D60C2-ABB4-4296-A42A-68860E97D2DD}
00062 DEFINE_GUID( TASKID_Minor_StorageResource_GetUID_Memory,
00063 0xa61d60c2, 0xabb4, 0x4296, 0xa4, 0x2a, 0x68, 0x86, 0xe, 0x97, 0xd2, 0xdd);
00064
00065 // {5771FF41-4B86-44a3-976E-00640B52AAEE}
00066 DEFINE_GUID( TASKID_Minor_StorageResource_PreCreate,
00067 0x5771ff41, 0x4b86, 0x44a3, 0x97, 0x6e, 0x0, 0x64, 0xb, 0x52, 0xaa, 0xee);
00068
00069 // {01D87B8E-0C74-4871-A4A3-6E573FCA5251}
00070 DEFINE_GUID( TASKID_Minor_StorageResource_Create,
00071 0x1d87b8e, 0xc74, 0x4871, 0xa4, 0xa3, 0x6e, 0x57, 0x3f, 0xca, 0x52, 0x51);
00072
00073 // {64D8F134-0767-4639-9A53-0388CE671405}
00074 DEFINE_GUID( TASKID_Minor_SetWbemServices_StorageResource,
00075 0x64d8f134, 0x767, 0x4639, 0x9a, 0x53, 0x3, 0x88, 0xce, 0x67, 0x14, 0x5);
00076
00077 // {626153A8-004D-49aa-AB43-DB2FF5A33A68}
00078 DEFINE_GUID( TASKID_Minor_StorageResource_Signature,
00079 0x626153a8, 0x4d, 0x49aa, 0xab, 0x43, 0xdb, 0x2f, 0xf5, 0xa3, 0x3a, 0x68);
00080
00081 // {6B10761B-5ECA-4ce7-8E9D-7FA8A078B0D4}
00082 DEFINE_GUID( TASKID_Minor_SetWbemObject_StorageResource,
00083 0x6b10761b, 0x5eca, 0x4ce7, 0x8e, 0x9d, 0x7f, 0xa8, 0xa0, 0x78, 0xb0, 0xd4);
00084
00085 // {9C22A873-9152-4b13-9160-CCB9C9279039}
00086 DEFINE_GUID( TASKID_Minor_Next_StorageResource,
00087 0x9c22a873, 0x9152, 0x4b13, 0x91, 0x60, 0xcc, 0xb9, 0xc9, 0x27, 0x90, 0x39);
00088
00089 // {FE52B921-C04B-47aa-8CC6-E320AF91D4BF}
00090 DEFINE_GUID( TASKID_Minor_StorageResource_No_Partitions,
00091 0xfe52b921, 0xc04b, 0x47aa, 0x8c, 0xc6, 0xe3, 0x20, 0xaf, 0x91, 0xd4, 0xbf);
00092
00093 // {E78EDBB5-5804-462e-870E-599BF898454C}
00094 DEFINE_GUID( TASKID_Minor_Clone_StorageResource,
00095 0xe78edbb5, 0x5804, 0x462e, 0x87, 0xe, 0x59, 0x9b, 0xf8, 0x98, 0x45, 0x4c);
00096
00097 // {255D2FC8-CF19-44f5-A515-7505C1F44A0A}
00098 DEFINE_GUID( TASKID_Minor_HrGetSCSIBus,
00099 0x255d2fc8, 0xcf19, 0x44f5, 0xa5, 0x15, 0x75, 0x5, 0xc1, 0xf4, 0x4a, 0xa);
00100
00101 // {8979ADBE-6211-4e70-8503-5B279487123F}
00102 DEFINE_GUID( TASKID_Minor_HrGetSCSIPort,
00103 0x8979adbe, 0x6211, 0x4e70, 0x85, 0x3, 0x5b, 0x27, 0x94, 0x87, 0x12, 0x3f);
00104
00105 // {800ADB0B-7F9D-465b-B57B-F3AF46D67EC2}
00106 DEFINE_GUID( TASKID_Minor_HrGetDeviceID_Pointer,
00107 0x800adb0b, 0x7f9d, 0x465b, 0xb5, 0x7b, 0xf3, 0xaf, 0x46, 0xd6, 0x7e, 0xc2);
00108
00109 // {401B7B17-D44D-4d45-A1A9-C7DD49FBEDA3}
00110 DEFINE_GUID( TASKID_Minor_HrGetDeviceID_Memory,
00111 0x401b7b17, 0xd44d, 0x4d45, 0xa1, 0xa9, 0xc7, 0xdd, 0x49, 0xfb, 0xed, 0xa3);
00112
00113 // {8B37A3E0-E23C-405e-A289-E89F9F5E8193}
00114 DEFINE_GUID( TASKID_Minor_HrGetSignature_Pointer,
00115 0x8b37a3e0, 0xe23c, 0x405e, 0xa2, 0x89, 0xe8, 0x9f, 0x9f, 0x5e, 0x81, 0x93);
00116
00117 // {E0A688F7-E589-4910-852E-7A3BD14A3A14}
00118 DEFINE_GUID( TASKID_Minor_HrSetFriendlyName_StorageResource,
00119 0xe0a688f7, 0xe589, 0x4910, 0x85, 0x2e, 0x7a, 0x3b, 0xd1, 0x4a, 0x3a, 0x14);
00120
00121 // {025AF944-540E-4b60-AC29-0B4145873719}
00122 DEFINE_GUID( TASKID_Minor_HrGetPartitionInfo,
00123 0x25af944, 0x540e, 0x4b60, 0xac, 0x29, 0xb, 0x41, 0x45, 0x87, 0x37, 0x19);
00124
00125 // {A63FEBA9-B876-458c-9D46-73E29E7DFD43}
00126 DEFINE_GUID( TASKID_Minor_WMI_DiskDrivePartitions_Qry_Failed,
00127 0xa63feba9, 0xb876, 0x458c, 0x9d, 0x46, 0x73, 0xe2, 0x9e, 0x7d, 0xfd, 0x43);
00128
00129 // {2865E3CF-251D-49d1-BD02-4A187BFE6B87}
00130 DEFINE_GUID( TASKID_Minor_WQL_Partition_Qry_Next_Failed,
00131 0x2865e3cf, 0x251d, 0x49d1, 0xbd, 0x2, 0x4a, 0x18, 0x7b, 0xfe, 0x6b, 0x87);
00132
00133 // {D099E738-2D66-4295-9C13-8E310C78BFB2}
00134 DEFINE_GUID( TASKID_Minor_HrAddPartitionToArray,
00135 0xd099e738, 0x2d66, 0x4295, 0x9c, 0x13, 0x8e, 0x31, 0xc, 0x78, 0xbf, 0xb2);
00136
00137 // {7F305E21-D0BF-4821-AB7E-25881FC5DB2E}
00138 DEFINE_GUID( TASKID_Minor_HrCreateFriendlyName_VOID,
00139 0x7f305e21, 0xd0bf, 0x4821, 0xab, 0x7e, 0x25, 0x88, 0x1f, 0xc5, 0xdb, 0x2e);
00140
00141 // {E8CB2D98-4634-442b-BEA5-C9FCAC08634A}
00142 DEFINE_GUID( TASKID_Minor_HrCreateFriendlyName_BSTR,
00143 0xe8cb2d98, 0x4634, 0x442b, 0xbe, 0xa5, 0xc9, 0xfc, 0xac, 0x8, 0x63, 0x4a);
00144
00145
00146 ////////////////////////////////////////////////////////////////////////
00147 // CEnumStorageResource
00148 ////////////////////////////////////////////////////////////////////////
00149
00150 // {A07CEAC4-8C45-4938-B70F-F75CDAC71E18}
00151 DEFINE_GUID( TASKID_Minor_InitWbem_Enum_StorageResource,
00152 0xa07ceac4, 0x8c45, 0x4938, 0xb7, 0xf, 0xf7, 0x5c, 0xda, 0xc7, 0x1e, 0x18);
00153
00154 // {5D9625A4-9DE4-4872-9523-264E0D830A0F}
00155 DEFINE_GUID( TASKID_Minor_SetWbemServices_Enum_StorageResource,
00156 0x5d9625a4, 0x9de4, 0x4872, 0x95, 0x23, 0x26, 0x4e, 0xd, 0x83, 0xa, 0xf);
00157
00158 // {C08A253C-A491-4a57-B50B-1AD2A349DA57}
00159 DEFINE_GUID( TASKID_Minor_Boot_Partition_Not_NTFS,
00160 0xc08a253c, 0xa491, 0x4a57, 0xb5, 0xb, 0x1a, 0xd2, 0xa3, 0x49, 0xda, 0x57);
00161
00162 // {AC376681-2A03-4219-930B-5BCBF48784F3}
00163 DEFINE_GUID( TASKID_Minor_Next_Enum_StorageResource,
00164 0xac376681, 0x2a03, 0x4219, 0x93, 0xb, 0x5b, 0xcb, 0xf4, 0x87, 0x84, 0xf3);
00165
00166 // {75DE3C02-09DF-4bb2-99BD-830F122EDB87}
00167 DEFINE_GUID( TASKID_Minor_Clone_Enum_StorageResource,
00168 0x75de3c02, 0x9df, 0x4bb2, 0x99, 0xbd, 0x83, 0xf, 0x12, 0x2e, 0xdb, 0x87);
00169
00170 // {C08826D6-D99B-46d1-A5E4-996B8AAA336D}
00171 DEFINE_GUID( TASKID_Minor_Pruning_Boot_Disk_Bus,
00172 0xc08826d6, 0xd99b, 0x46d1, 0xa5, 0xe4, 0x99, 0x6b, 0x8a, 0xaa, 0x33, 0x6d);
00173
00174 // {3C02DAA7-4C68-4a68-AE56-454F26D6B8C6}
00175 DEFINE_GUID( TASKID_Minor_Pruning_System_Disk_Bus,
00176 0x3c02daa7, 0x4c68, 0x4a68, 0xae, 0x56, 0x45, 0x4f, 0x26, 0xd6, 0xb8, 0xc6);
00177
00178 // {3E18B282-DDD5-4eff-8ACE-BE2948372E51}
00179 DEFINE_GUID( TASKID_Minor_HrAddObjectToArray,
00180 0x3e18b282, 0xddd5, 0x4eff, 0x8a, 0xce, 0xbe, 0x29, 0x48, 0x37, 0x2e, 0x51);
00181
00182 // {46597D45-38D8-4134-9B34-97DDC094A875}
00183 DEFINE_GUID( TASKID_Minor_HrIsLogicalDiskNTFS_InvalidArg,
00184 0x46597d45, 0x38d8, 0x4134, 0x9b, 0x34, 0x97, 0xdd, 0xc0, 0x94, 0xa8, 0x75);
00185
00186 // {CD5CBE2E-9A98-4eac-BDC3-20195C217AD3}
00187 DEFINE_GUID( TASKID_Minor_HrIsLogicalDiskNTFS,
00188 0xcd5cbe2e, 0x9a98, 0x4eac, 0xbd, 0xc3, 0x20, 0x19, 0x5c, 0x21, 0x7a, 0xd3);
00189
00190 // {AFCFF8C7-F83C-482e-BBEF-60FDCD4CC41A}
00191 DEFINE_GUID( TASKID_Minor_WMI_Get_LogicalDisk_Failed,
00192 0xafcff8c7, 0xf83c, 0x482e, 0xbb, 0xef, 0x60, 0xfd, 0xcd, 0x4c, 0xc4, 0x1a);
00193
00194 // {B8F5736B-2046-4762-8122-C737ED92BF28}
00195 DEFINE_GUID( TASKID_Minor_Non_SCSI_Disks,
00196 0xb8f5736b, 0x2046, 0x4762, 0x81, 0x22, 0xc7, 0x37, 0xed, 0x92, 0xbf, 0x28);
00197
00198 // {95D0BDFA-0579-4b40-8DDB-4F9BCA9D7205}
00199 DEFINE_GUID( TASKID_Minor_Pruning_PageFile_Disk_Bus,
00200 0x95d0bdfa, 0x579, 0x4b40, 0x8d, 0xdb, 0x4f, 0x9b, 0xca, 0x9d, 0x72, 0x5);
00201
00202 // {32135624-E54D-46c2-A7EE-704DE416FBE3}
00203 DEFINE_GUID( TASKID_Minor_Pruning_CrashDump_Disk_Bus,
00204 0x32135624, 0xe54d, 0x46c2, 0xa7, 0xee, 0x70, 0x4d, 0xe4, 0x16, 0xfb, 0xe3);
00205
00206 // {94FEA8D6-A61D-43aa-9CD9-E22C1532F7A1}
00207 DEFINE_GUID( TASKID_Minor_StorageResource_Cluster_Capable,
00208 0x94fea8d6, 0xa61d, 0x43aa, 0x9c, 0xd9, 0xe2, 0x2c, 0x15, 0x32, 0xf7, 0xa1);
00209
00210 // {25205B87-3ABE-4527-B9B2-C4D30E46D250}
00211 DEFINE_GUID( TASKID_Minor_HrGetDisks,
00212 0x25205b87, 0x3abe, 0x4527, 0xb9, 0xb2, 0xc4, 0xd3, 0xe, 0x46, 0xd2, 0x50);
00213
00214 // {CDE9F8FC-5C95-4e9a-B73A-19807DA9F5A5}
00215 DEFINE_GUID( TASKID_Minor_WQL_Disk_Qry_Next_Failed,
00216 0xcde9f8fc, 0x5c95, 0x4e9a, 0xb7, 0x3a, 0x19, 0x80, 0x7d, 0xa9, 0xf5, 0xa5);
00217
00218
00219 ////////////////////////////////////////////////////////////////////////
00220 // CStorageResType
00221 ////////////////////////////////////////////////////////////////////////
00222
00223 // {EE6AB597-5992-4a86-A785-C143C768DFB7}
00224 DEFINE_GUID( TASKID_Minor_StorageResourceType_CommitChanges,
00225 0xee6ab597, 0x5992, 0x4a86, 0xa7, 0x85, 0xc1, 0x43, 0xc7, 0x68, 0xdf, 0xb7);
00226
00227
00228 ////////////////////////////////////////////////////////////////////////
00229 // CPartitionInfo
00230 ////////////////////////////////////////////////////////////////////////
00231
00232 // {65A8703B-D91A-4edc-861D-1BF37A3A0F84}
00233 DEFINE_GUID( TASKID_Minor_SetWbemServices_Partition,
00234 0x65a8703b, 0xd91a, 0x4edc, 0x86, 0x1d, 0x1b, 0xf3, 0x7a, 0x3a, 0xf, 0x84);
00235
00236 // {3704F82D-1B0E-4b2f-BD33-86E44AC9A59B}
00237 DEFINE_GUID( TASKID_Minor_PartitionInfo_GetUID_Pointer,
00238 0x3704f82d, 0x1b0e, 0x4b2f, 0xbd, 0x33, 0x86, 0xe4, 0x4a, 0xc9, 0xa5, 0x9b);
00239
00240 // {5872713B-70E1-4155-8974-209697627AC6}
00241 DEFINE_GUID( TASKID_Minor_PartitionInfo_GetUID_Memory,
00242 0x5872713b, 0x70e1, 0x4155, 0x89, 0x74, 0x20, 0x96, 0x97, 0x62, 0x7a, 0xc6);
00243
00244 // {31729C01-AAC2-4baa-86F4-F6DCDDCB700B}
00245 DEFINE_GUID( TASKID_Minor_PartitionInfo_GetName_Pointer,
00246 0x31729c01, 0xaac2, 0x4baa, 0x86, 0xf4, 0xf6, 0xdc, 0xdd, 0xcb, 0x70, 0xb);
00247
00248 // {EBF09D63-05D2-4019-9B8A-4EB064AF01F1}
00249 DEFINE_GUID( TASKID_Minor_PartitionInfo_GetDescription_Pointer,
00250 0xebf09d63, 0x5d2, 0x4019, 0x9b, 0x8a, 0x4e, 0xb0, 0x64, 0xaf, 0x1, 0xf1);
00251
00252 // {6CA61237-00C4-4e5b-90A0-68E26315D1FC}
00253 DEFINE_GUID( TASKID_Minor_PartitionInfo_GetDescription_Memory,
00254 0x6ca61237, 0xc4, 0x4e5b, 0x90, 0xa0, 0x68, 0xe2, 0x63, 0x15, 0xd1, 0xfc);
00255
00256 // {927ECC61-E8B3-4919-88B7-2E89874784AB}
00257 DEFINE_GUID( TASKID_Minor_GetDriveLetterMappings_Partition,
00258 0x927ecc61, 0xe8b3, 0x4919, 0x88, 0xb7, 0x2e, 0x89, 0x87, 0x47, 0x84, 0xab);
00259
00260 // {8AF69452-886B-45ee-B4FD-D2FA7F47F4C4}
00261 DEFINE_GUID( TASKID_Minor_GetSize,
00262 0x8af69452, 0x886b, 0x45ee, 0xb4, 0xfd, 0xd2, 0xfa, 0x7f, 0x47, 0xf4, 0xc4);
00263
00264 // {CF4008B3-E902-4a54-80DD-2695557F4FCC}
00265 DEFINE_GUID( TASKID_Minor_SetWbemObject_Partition,
00266 0xcf4008b3, 0xe902, 0x4a54, 0x80, 0xdd, 0x26, 0x95, 0x55, 0x7f, 0x4f, 0xcc);
00267
00268 // {6EA41D85-B149-406c-93C5-59718C3EFE3C}
00269 DEFINE_GUID( TASKID_Minor_Disk_No_File_System,
00270 0x6ea41d85, 0xb149, 0x406c, 0x93, 0xc5, 0x59, 0x71, 0x8c, 0x3e, 0xfe, 0x3c);
00271
00272 // {F0493CC2-90BE-4199-9847-E71BED990B63}
00273 DEFINE_GUID( TASKID_Minor_Disk_Not_NTFS,
00274 0xf0493cc2, 0x90be, 0x4199, 0x98, 0x47, 0xe7, 0x1b, 0xed, 0x99, 0xb, 0x63);
00275
00276 // {721099AF-7CC8-4f87-A213-487297F7194F}
00277 DEFINE_GUID( TASKID_Minor_GetFriendlyName,
00278 0x721099af, 0x7cc8, 0x4f87, 0xa2, 0x13, 0x48, 0x72, 0x97, 0xf7, 0x19, 0x4f);
00279
00280 // {BD4BE998-6400-46a2-A1D8-0BB5FC17DD42}
00281 DEFINE_GUID( TASKID_Minor_HrGetFriendlyName,
00282 0xbd4be998, 0x6400, 0x46a2, 0xa1, 0xd8, 0xb, 0xb5, 0xfc, 0x17, 0xdd, 0x42);
00283
00284 // {721099AF-7CC8-4f87-A213-487297F7194F}
00285 DEFINE_GUID( TASKID_Minor_HrAddLogicalDiskToArray,
00286 0x721099af, 0x7cc8, 0x4f87, 0xa2, 0x13, 0x48, 0x72, 0x97, 0xf7, 0x19, 0x4f);
00287
00288 // {3787CC20-5822-4e23-B4B2-8712EA4823D6}
00289 DEFINE_GUID( TASKID_Minor_HrGetLogicalDisks,
00290 0x3787cc20, 0x5822, 0x4e23, 0xb4, 0xb2, 0x87, 0x12, 0xea, 0x48, 0x23, 0xd6);
00291
00292 // {B2211A28-6F50-4532-B16F-09FA7EB55472}
00293 DEFINE_GUID( TASKID_Minor_WMI_Logical_Disks_Qry_Failed,
00294 0xb2211a28, 0x6f50, 0x4532, 0xb1, 0x6f, 0x9, 0xfa, 0x7e, 0xb5, 0x54, 0x72);
00295
00296 // {67215FFB-C63D-4fee-B2D4-EA23E9F84C7E}
00297 DEFINE_GUID( TASKID_Minor_HrGetLogicalDisks_Next,
00298 0x67215ffb, 0xc63d, 0x4fee, 0xb2, 0xd4, 0xea, 0x23, 0xe9, 0xf8, 0x4c, 0x7e);
00299
00300
00301 //////////////////////////////////////////////////////////////////////////////
00302 //
00303 // Registration GUIDs
00304 //
00305 //////////////////////////////////////////////////////////////////////////////
00306
00307 //
00308 // The Resource Type's GUID
00309 //
00310 // TODO: Regenerate the GUID below using guidgen.exe so that the RESTYPE guid is
00311 //       truly unique.
00312 //
00313 //
00314 // {215929D2-0007-4d94-92A8-C058C2045900}
00315 DEFINE_GUID( RESTYPE_StorageResource,
00316 0x215929d2, 0x7, 0x4d94, 0x92, 0xa8, 0xc0, 0x58, 0xc2, 0x4, 0x59, 0x0);
00317
00318 //
00319 // This is the Cluster Administrator Extension dll CLSID to register for the type.
00320 //
00321 // TODO: Replace this CLSID with the one in the resource type's extension dll,
00322 //       which can be found in ExtObjID.h.
00323 //
00324 // {67BBCE98-BEE6-47cf-8C21-EC09E4B942A5}
00325 //DEFINE_GUID( CLSID_CoStorageResourceDllEx,
00326 //0x67bbce98, 0xbee6, 0x47cf, 0x8c, 0x21, 0xec, 0x9, 0xe4, 0xb9, 0x42, 0xa5);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/DropTgt.Cpp Source File

  • WinUI
  • Shell
  • DragImg

DropTgt.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          DropTgt.cpp
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "DropTgt.h"
00023
00024 /**************************************************************************
00025    global variables and definitions
00026 **************************************************************************/
00027
00028 extern HWND g_hwndMain;
00029
00030 /**************************************************************************
00031
00032    CDropTarget::CDropTarget()
00033
00034 **************************************************************************/
00035
00036 CDropTarget::CDropTarget(void)
00037 {
00038 m_cRefCount = 1;
00039 m_fAcceptFmt = FALSE;
00040 m_pDropTargetHelper = NULL;
00041
00042 CoCreateInstance( CLSID_DragDropHelper,
00043                   NULL,
00044                   CLSCTX_INPROC_SERVER,
00045                   IID_IDropTargetHelper,
00046                   (LPVOID*)&m_pDropTargetHelper);
00047 }
00048
00049 /**************************************************************************
00050
00051    CDropTarget::~CDropTarget()
00052
00053 **************************************************************************/
00054
00055 CDropTarget::~CDropTarget(void)
00056 {
00057 if(m_pDropTargetHelper)
00058    {
00059    m_pDropTargetHelper->Release();
00060    m_pDropTargetHelper = NULL;
00061    }
00062 }
00063
00064 ///////////////////////////////////////////////////////////////////////////
00065 //
00066 // IUnknown Implementation
00067 //
00068
00069 /**************************************************************************
00070
00071    CDropTarget::QueryInterface()
00072
00073 **************************************************************************/
00074
00075 STDMETHODIMP CDropTarget::QueryInterface(REFIID riid, LPVOID *ppvOut)
00076 {
00077 *ppvOut = NULL;
00078
00079 //IUnknown
00080 if(IsEqualIID(riid, IID_IUnknown))
00081    {
00082    *ppvOut = this;
00083    }
00084
00085 //IDropTarget
00086 else if(IsEqualIID(riid, IID_IDropTarget))
00087    {
00088    *ppvOut = (IDropTarget*)this;
00089    }
00090
00091 if(*ppvOut)
00092    {
00093    (*(LPUNKNOWN*)ppvOut)->AddRef();
00094    return S_OK;
00095    }
00096
00097 return E_NOINTERFACE;
00098 }
00099
00100 /**************************************************************************
00101
00102    CDropTarget::AddRef()
00103
00104 **************************************************************************/
00105
00106 STDMETHODIMP_(ULONG) CDropTarget::AddRef(void)
00107 {
00108 return ++m_cRefCount;
00109 }
00110
00111 /**************************************************************************
00112
00113    CDropTarget::Release()
00114
00115 **************************************************************************/
00116
00117 STDMETHODIMP_(ULONG) CDropTarget::Release(void)
00118 {
00119 if(--m_cRefCount == 0)
00120    {
00121    delete this;
00122    return 0;
00123    }
00124
00125 return m_cRefCount;
00126 }
00127
00128 ///////////////////////////////////////////////////////////////////////////
00129 //
00130 // IDropTarget Implementation
00131 //
00132
00133 /**************************************************************************
00134
00135    CDropTarget::DragEnter()
00136
00137 **************************************************************************/
00138
00139 STDMETHODIMP CDropTarget::DragEnter(   LPDATAOBJECT pDataObj,
00140                                        DWORD grfKeyState,
00141                                        POINTL pt,
00142                                        LPDWORD pdwEffect)
00143 {
00144 if(m_pDropTargetHelper)
00145    m_pDropTargetHelper->DragEnter(g_hwndMain, pDataObj, (LPPOINT)&pt, *pdwEffect);
00146
00147 FORMATETC fe;
00148
00149 fe.cfFormat = CF_HDROP;
00150 fe.ptd      = NULL;
00151 fe.dwAspect = DVASPECT_CONTENT;
00152 fe.lindex   = -1;
00153 fe.tymed    = TYMED_HGLOBAL;
00154
00155 // Does the drag source provide the clipboard format we are looking for?
00156 m_fAcceptFmt = (S_OK == pDataObj->QueryGetData(&fe)) ? TRUE : FALSE;
00157
00158 QueryDrop(grfKeyState, pdwEffect);
00159
00160 return S_OK;
00161 }
00162
00163 /**************************************************************************
00164
00165    CDropTarget::DragOver()
00166
00167 **************************************************************************/
00168
00169 STDMETHODIMP CDropTarget::DragOver( DWORD grfKeyState,
00170                                     POINTL pt,
00171                                     LPDWORD pdwEffect)
00172 {
00173 if(m_pDropTargetHelper)
00174    m_pDropTargetHelper->DragOver((LPPOINT)&pt, *pdwEffect);
00175
00176 QueryDrop(grfKeyState, pdwEffect);
00177
00178 return S_OK;
00179 }
00180
00181 /**************************************************************************
00182
00183    CDropTarget::DragLeave()
00184
00185 **************************************************************************/
00186
00187 STDMETHODIMP CDropTarget::DragLeave()
00188 {
00189 if(m_pDropTargetHelper)
00190    m_pDropTargetHelper->DragLeave();
00191
00192 m_fAcceptFmt = FALSE;
00193 return S_OK;
00194 }
00195
00196 /**************************************************************************
00197
00198    CDropTarget::Drop()
00199
00200 **************************************************************************/
00201
00202 STDMETHODIMP CDropTarget::Drop(  LPDATAOBJECT pDataObj,
00203                                  DWORD grfKeyState,
00204                                  POINTL pt,
00205                                  LPDWORD pdwEffect)
00206 {
00207 if(m_pDropTargetHelper)
00208    m_pDropTargetHelper->Drop(pDataObj, (LPPOINT)&pt, *pdwEffect);
00209
00210 FORMATETC   fe;
00211 STGMEDIUM   sm;
00212 HRESULT     hr = E_FAIL;
00213
00214 if(QueryDrop(grfKeyState, pdwEffect))
00215    {
00216    fe.cfFormat = CF_HDROP;
00217    fe.ptd = NULL;
00218    fe.dwAspect = DVASPECT_CONTENT;
00219    fe.lindex = -1;
00220    fe.tymed = TYMED_HGLOBAL;
00221
00222    // User has dropped on us. Get the data from drag source
00223    hr = pDataObj->GetData(&fe, &sm);
00224    if(SUCCEEDED(hr))
00225       {
00226       // Display the data and release it.
00227       DisplayFileNames(g_hwndMain, sm.hGlobal);
00228
00229       ReleaseStgMedium(&sm);
00230       }
00231    }
00232
00233 *pdwEffect = DROPEFFECT_NONE;
00234
00235 return hr;
00236 }
00237
00238 /* OleStdGetDropEffect
00239 ** -------------------
00240 **
00241 ** Convert a keyboard state into a DROPEFFECT.
00242 **
00243 ** returns the DROPEFFECT value derived from the key state.
00244 **    the following is the standard interpretation:
00245 **          no modifier -- Default Drop     (0 is returned)
00246 **          CTRL        -- DROPEFFECT_COPY
00247 **          SHIFT       -- DROPEFFECT_MOVE
00248 **          CTRL-SHIFT  -- DROPEFFECT_LINK
00249 **
00250 **    Default Drop: this depends on the type of the target application.
00251 **    this is re-interpretable by each target application. a typical
00252 **    interpretation is if the drag is local to the same document
00253 **    (which is source of the drag) then a MOVE operation is
00254 **    performed. if the drag is not local, then a COPY operation is
00255 **    performed.
00256 */
00257 #define OleStdGetDropEffect(grfKeyState)    \
00258     ( (grfKeyState & MK_CONTROL) ?          \
00259         ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY ) :  \
00260         ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_MOVE : 0 ) )
00261
00262 /**************************************************************************
00263
00264    CDropTarget::QueryDrop()
00265
00266 **************************************************************************/
00267
00268 BOOL CDropTarget::QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect)
00269 {
00270 DWORD dwOKEffects = *pdwEffect;
00271
00272 if(!m_fAcceptFmt)
00273    {
00274    *pdwEffect = DROPEFFECT_NONE;
00275    return FALSE;
00276    }
00277
00278 *pdwEffect = OleStdGetDropEffect(grfKeyState);
00279 if(*pdwEffect == 0)
00280    {
00281    // No modifier keys used by user while dragging.
00282    if (DROPEFFECT_COPY & dwOKEffects)
00283       *pdwEffect = DROPEFFECT_COPY;
00284    else if (DROPEFFECT_MOVE & dwOKEffects)
00285       *pdwEffect = DROPEFFECT_MOVE;
00286    else if (DROPEFFECT_LINK & dwOKEffects)
00287       *pdwEffect = DROPEFFECT_LINK;
00288    else
00289       {
00290       *pdwEffect = DROPEFFECT_NONE;
00291       }
00292    }
00293 else
00294    {
00295    // Check if the drag source application allows the drop effect desired by user.
00296    // The drag source specifies this in DoDragDrop
00297    if(!(*pdwEffect & dwOKEffects))
00298       *pdwEffect = DROPEFFECT_NONE;
00299
00300    // We don't accept links
00301    if(*pdwEffect == DROPEFFECT_LINK)
00302       *pdwEffect = DROPEFFECT_NONE;
00303    }
00304
00305 return (DROPEFFECT_NONE == *pdwEffect) ? FALSE : TRUE;
00306 }
00307
00308 /**************************************************************************
00309
00310    CDropTarget::DisplayFileNames()
00311
00312 **************************************************************************/
00313
00314 void CDropTarget::DisplayFileNames(HWND hwndOwner, HGLOBAL hgFiles)
00315 {
00316 UINT     i,
00317          nFiles;
00318 LPTSTR   pszFiles;
00319 UINT     cchSize;
00320
00321 nFiles = DragQueryFile((HDROP)hgFiles, 0xFFFFFFFF, NULL, 0);
00322
00323 // MAX_PATH + 1 for the "\n" at the end of each path, and another 1 for the null terminator
00324 cchSize = nFiles * (MAX_PATH + 1) + 1;
00325 pszFiles = new TCHAR[cchSize];
00326
00327 if(pszFiles)
00328    {
00329    LPTSTR   pszTemp;
00330
00331    for(i = 0, pszTemp = pszFiles; i < nFiles; i++, pszTemp += lstrlen(pszTemp))
00332       {
00333       DragQueryFile((HDROP)hgFiles, i, pszTemp, MAX_PATH);
00334       lstrcat(pszTemp, TEXT("\n")); // we have room for this \n at the end of each path
00335       }
00336
00337    SetForegroundWindow(hwndOwner);
00338
00339    MessageBox(hwndOwner, pszFiles, TEXT("Files Dropped"), MB_OK | MB_ICONINFORMATION);
00340
00341    delete [] pszFiles;
00342    }
00343 }
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_AcceptContext Member List

This is the complete list of members for _AcceptContext, including all inherited members.
addressFamily | _AcceptContext
hAcceptWindow | _AcceptContext
pSockList | _AcceptContext
szInterface | _AcceptContext
szPort | _AcceptContext
typeOfAccept | _AcceptContext
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/DataObj.h Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

DataObj.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          DataObj.h
00021
00022   Description:   CDataObject and CEnumForamtEtc definitions.
00023
00024 **************************************************************************/
00025
00026 #ifndef DATAOBJECT_H
00027 #define DATAOBJECT_H
00028
00029 /**************************************************************************
00030 #include statements
00031 **************************************************************************/
00032
00033 #include "DOServer.h"
00034
00035 #define CF_EMBEDSOURCE      TEXT("Embed Source")
00036
00037 /**************************************************************************
00038
00039   CDataObject class defintion
00040
00041 **************************************************************************/
00042
00043 class COleDocument;
00044
00045 class CDataObject : public IDataObject
00046 {
00047 private:
00048   COleDocument         *m_pOleDoc;
00049   LPDATAADVISEHOLDER   m_pDataAdviseHolder;
00050   UINT                 m_cfEmbedSource;
00051
00052 public:
00053   CDataObject::CDataObject(COleDocument*);
00054   CDataObject::~CDataObject(void);
00055
00056   //IUnknown methods
00057   STDMETHODIMP QueryInterface(REFIID, LPVOID*);
00058   STDMETHODIMP_(ULONG) AddRef();
00059   STDMETHODIMP_(ULONG) Release();
00060
00061   //IDataObject methods
00062   STDMETHODIMP DAdvise(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD);
00063   STDMETHODIMP DUnadvise(DWORD);
00064   STDMETHODIMP EnumDAdvise(LPENUMSTATDATA*);
00065   STDMETHODIMP EnumFormatEtc(DWORD, LPENUMFORMATETC*);
00066   STDMETHODIMP GetCanonicalFormatEtc(LPFORMATETC, LPFORMATETC);
00067   STDMETHODIMP GetData(LPFORMATETC, LPSTGMEDIUM);
00068   STDMETHODIMP GetDataHere(LPFORMATETC, LPSTGMEDIUM);
00069   STDMETHODIMP QueryGetData(LPFORMATETC);
00070   STDMETHODIMP SetData(LPFORMATETC, LPSTGMEDIUM, BOOL);
00071
00072 };
00073
00074 /**************************************************************************
00075
00076   CEnumFormatEtc class defintion
00077
00078 **************************************************************************/
00079
00080 class CEnumFormatEtc : public IEnumFORMATETC
00081 {
00082 private:
00083   ULONG       m_ObjRefCount; // Object reference count
00084   ULONG     m_iCur;        // Current element
00085     UINT      m_cfEmbedSource;
00086
00087 public:
00088   CEnumFormatEtc(void);
00089   ~CEnumFormatEtc(void);
00090
00091   // IUnknown members that delegate to m_pUnkOuter
00092   STDMETHODIMP         QueryInterface(REFIID, LPVOID*);
00093   STDMETHODIMP_(ULONG) AddRef(void);
00094   STDMETHODIMP_(ULONG) Release(void);
00095
00096   // IEnumFORMATETC members
00097   STDMETHODIMP Next(ULONG, LPFORMATETC, ULONG*);
00098   STDMETHODIMP Skip(ULONG);
00099   STDMETHODIMP Reset(void);
00100   STDMETHODIMP Clone(LPENUMFORMATETC*);
00101 };
00102
00103 #endif   //DATAOBJECT_H
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/FileView/FileView.h Source File

  • WinUI
  • Shell
  • FileView

FileView.h

Go to the documentation of this file.
00001 //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1994 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  PROGRAM: FILEVIEW.H
00009 //
00010 //  PURPOSE:   File Viewer Component Object to work with Windows 95 Explorer.
00011 //    Definitions, classes, and prototypes for a FileViewer DLL.
00012 //    Necessary modifications marked with MODIFY
00013 //
00014 //  PLATFORMS:  Windows 95
00015 //
00016 //  SPECIAL INSTRUCTIONS: N/A
00017 //
00018 #ifndef _FILEVIEW_H_
00019 #define _FILEVIEW_H_
00020
00021
00022 //Prevent windows.h from pulling in OLE 1
00023 #define INC_OLE2
00024
00025 #include <windows.h>
00026 #include <stdlib.h>
00027 #include <ole2.h>
00028 #include <commdlg.h>
00029 #include <shlobj.h>
00030
00031
00032 #include "dbgout.h"
00033 #include "cstrtabl.h"
00034 #include "cstathlp.h"
00035
00036 //Types needed for other include files.
00037 #ifndef PPVOID
00038 typedef LPVOID * PPVOID;
00039 #endif
00040
00041
00042 /*
00043  * Type and function for an object-destroyed callback.  An
00044  * Object will call ObjectDestoyed in FILEVIEW.CPP when it
00045  * deletes itself.  That way the server code, independent
00046  * of the object, can implement DllCanUnloadNow properly.
00047  */
00048 typedef void (WINAPI *PFNDESTROYED)(void);
00049 void WINAPI ObjectDestroyed(void);
00050
00051
00052 //MODIFY:  Other viewer-specific headers
00053 #include "fvtext.h"     //FileViewer specifics
00054 #include "resource.h"   //Resource definitions
00055
00056
00057
00058 //FILEVIEW.CPP
00059 HRESULT PASCAL DllGetClassObject(REFCLSID, REFIID, PPVOID);
00060 STDAPI         DllCanUnloadNow(void);
00061
00062 //A class factory that creates CFileViewer objects
00063 class CFVClassFactory : public IClassFactory
00064     {
00065     protected:
00066         ULONG           m_cRef;
00067
00068     public:
00069         CFVClassFactory(void);
00070         ~CFVClassFactory(void);
00071
00072         //IUnknown members
00073         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00074         STDMETHODIMP_(ULONG) AddRef(void);
00075         STDMETHODIMP_(ULONG) Release(void);
00076
00077         //IClassFactory members
00078         STDMETHODIMP         CreateInstance(LPUNKNOWN, REFIID, PPVOID);
00079         STDMETHODIMP         LockServer(BOOL);
00080     };
00081
00082 typedef CFVClassFactory *PCFVClassFactory;
00083
00084 #endif //_FILEVIEW_H_
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/Stack.h Source File

  • NetDS
  • WinSock
  • Dt_Dll

Stack.h

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c) 1995 Intel Corp
00004
00005   File Name:
00006
00007     stack.h
00008
00009   Abstract:
00010
00011     Implements stack structure.
00012
00013 --*/
00014
00015 #ifndef _STACKH_
00016 #define _STACKH_
00017
00018 #include "nowarn.h"  /* turn off benign warnings */
00019 #ifndef _WINSOCKAPI_
00020 #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
00021 #endif
00022 #include <windows.h>
00023 #include "nowarn.h"  /* some warnings may have been turned back on */
00024 #include "nideque.h"
00025
00026 // Name:     Stack_c
00027 // Purpose:  A general purpose stack.
00028 // Context:  Can be used anywhere.
00029 template<class T> class Stack_c : private NIDeque_c<T> {
00030
00031     public:
00032                 Stack_c() : NIDeque_c<T>() {}
00033               ~Stack_c()       {}
00034         inline BOOL Push(T Data) {return NIDeque_c<T>::InsertIntoFront(Data);}
00035         inline BOOL Pop(T &Data) {return
00036                                   NIDeque_c<T>::RemoveFromFront(Data);}
00037       inline BOOL IsEmpty()    {return NIDeque_c<T>::IsEmpty();}
00038 };
00039
00040 #endif
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Ping/resolve.cpp Source File

  • NetDS
  • WinSock
  • Ping

resolve.cpp

Go to the documentation of this file.
00001 // From Network Programming for Microsoft Windows, Second Edition by
00002 // Anthony Jones and James Ohlund.
00003 // Copyright 2002.   Reproduced by permission of Microsoft Press.
00004 // All rights reserved.
00005 //
00006 //
00007 // Common routines for resolving addresses and hostnames
00008 //
00009 // Files:
00010 //      resolve.cpp     - Common routines
00011 //      resolve.h       - Header file for common routines
00012 //
00013 // Description:
00014 //      This file contains common name resolution and name printing
00015 //      routines and is used by many of the samples on this CD.
00016 //
00017 // Compile:
00018 //      See ping.cpp
00019 //
00020 // Usage:
00021 //      See ping.cpp
00022 //
00023 #include <winsock2.h>
00024 #include <ws2tcpip.h>
00025 #include <strsafe.h>
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028
00029 #include "resolve.h"
00030
00031 //
00032 // Function: PrintAddress
00033 //
00034 // Description:
00035 //    This routine takes a SOCKADDR structure and its length and prints
00036 //    converts it to a string representation. This string is printed
00037 //    to the console via stdout.
00038 //
00039 int PrintAddress(SOCKADDR *sa, int salen)
00040 {
00041     char    host[NI_MAXHOST],
00042             serv[NI_MAXSERV];
00043     int     hostlen = NI_MAXHOST,
00044             servlen = NI_MAXSERV,
00045             rc;
00046
00047     rc = getnameinfo(
00048             sa,
00049             salen,
00050             host,
00051             hostlen,
00052             serv,
00053             servlen,
00054             NI_NUMERICHOST | NI_NUMERICSERV
00055             );
00056     if (rc != 0)
00057     {
00058         fprintf(stderr, "%s: getnameinfo failed: %d\n", __FILE__, rc);
00059         return rc;
00060     }
00061
00062     // If the port is zero then don't print it
00063     if (strcmp(serv, "0") != 0)
00064     {
00065         if (sa->sa_family == AF_INET)
00066             printf("[%s]:%s", host, serv);
00067         else
00068             printf("%s:%s", host, serv);
00069     }
00070     else
00071         printf("%s", host);
00072
00073     return NO_ERROR;
00074 }
00075
00076 //
00077 // Function: FormatAddress
00078 //
00079 // Description:
00080 //    This is similar to the PrintAddress function except that instead of
00081 //    printing the string address to the console, it is formatted into
00082 //    the supplied string buffer.
00083 //
00084 int FormatAddress(SOCKADDR *sa, int salen, char *addrbuf, int addrbuflen)
00085 {
00086     char    host[NI_MAXHOST],
00087             serv[NI_MAXSERV];
00088     int     hostlen = NI_MAXHOST,
00089             servlen = NI_MAXSERV,
00090             rc;
00091     HRESULT hRet;
00092
00093     rc = getnameinfo(
00094             sa,
00095             salen,
00096             host,
00097             hostlen,
00098             serv,
00099             servlen,
00100             NI_NUMERICHOST | NI_NUMERICSERV
00101             );
00102     if (rc != 0)
00103     {
00104         fprintf(stderr, "%s: getnameinfo failed: %d\n", __FILE__, rc);
00105         return rc;
00106     }
00107
00108     if ( (strlen(host) + strlen(serv) + 1) > (unsigned)addrbuflen)
00109         return WSAEFAULT;
00110
00111     addrbuf[0] = '\0';
00112
00113     if (sa->sa_family == AF_INET)
00114     {
00115         if(FAILED(hRet = StringCchPrintf(addrbuf, addrbuflen, "%s:%s", host, serv)))
00116         {
00117             fprintf(stderr,"%s StringCchPrintf failed: 0x%x\n",__FILE__,hRet);
00118             return (int)hRet;
00119         }
00120     }
00121     else if (sa->sa_family == AF_INET6)
00122     {
00123         if(FAILED(hRet = StringCchPrintf(addrbuf, addrbuflen, "[%s]:%s", host, serv)))
00124         {
00125             fprintf(stderr,"%s StringCchPrintf failed: 0x%x\n",__FILE__,hRet);
00126             return (int)hRet;
00127         }
00128     }
00129
00130
00131
00132     return NO_ERROR;
00133 }
00134
00135 //
00136 // Function: ResolveAddress
00137 //
00138 // Description:
00139 //    This routine resolves the specified address and returns a list of addrinfo
00140 //    structure containing SOCKADDR structures representing the resolved addresses.
00141 //    Note that if 'addr' is non-NULL, then getaddrinfo will resolve it whether
00142 //    it is a string listeral address or a hostname.
00143 //
00144 struct addrinfo *ResolveAddress(char *addr, char *port, int af, int type, int proto)
00145 {
00146     struct addrinfo hints,
00147     *res = NULL;
00148     int             rc;
00149
00150     memset(&hints, 0, sizeof(hints));
00151     hints.ai_flags  = ((addr) ? 0 : AI_PASSIVE);
00152     hints.ai_family = af;
00153     hints.ai_socktype = type;
00154     hints.ai_protocol = proto;
00155
00156     rc = getaddrinfo(
00157             addr,
00158             port,
00159            &hints,
00160            &res
00161             );
00162     if (rc != 0)
00163     {
00164         fprintf(stderr, "Invalid address %s, getaddrinfo failed: %d\n", addr, rc);
00165         return NULL;
00166     }
00167     return res;
00168 }
00169
00170 //
00171 // Function: ReverseLookup
00172 //
00173 // Description:
00174 //    This routine takes a SOCKADDR and does a reverse lookup for the name
00175 //    corresponding to that address.
00176 //
00177 int ReverseLookup(SOCKADDR *sa, int salen, char *buf, int buflen)
00178 {
00179     char    host[NI_MAXHOST];
00180     int     hostlen=NI_MAXHOST,
00181             rc;
00182     HRESULT hRet;
00183
00184     rc = getnameinfo(
00185             sa,
00186             salen,
00187             host,
00188             hostlen,
00189             NULL,
00190             0,
00191             0
00192             );
00193     if (rc != 0)
00194     {
00195         fprintf(stderr, "getnameinfo failed: %d\n", rc);
00196         return rc;
00197     }
00198
00199     buf[0] = '\0';
00200     if(FAILED(hRet = StringCchCopy(buf, buflen, host)))
00201     {
00202         fprintf(stderr,"StringCchCopy failed: 0x%x\n",hRet);
00203         return (int)hRet;
00204     }
00205
00206     return NO_ERROR;
00207 }
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Microsoft::Samples::Ink::Cs::InkZoom::InkZoom Member List

This is the complete list of members for Microsoft::Samples::Ink::Cs::InkZoom::InkZoom, including all inherited members.
blackPen | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
components | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
Dispose(bool disposing) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, protected]
hScrollBar | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
hScrollBar_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
hScrollBar_ValueChanged(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
InitializeComponent() | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
InkSpaceHeight | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
InkSpaceWidth | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
InkZoom() | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline]
InkZoom_Load(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
InkZoom_Resize(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
lblZoom | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
Main() | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private, static]
MediumInkWidth | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miActionSeparator | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miClear | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miClear_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
miExit | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miExit_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
miFile | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miInk | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miInk_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
miMain | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miModeSepararator | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miOther | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miScalePenWidth | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miScalePenWidth_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
miZoomToRect | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
miZoomToRect_Click(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
myInkCollector | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
pnlDrawingArea | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
pnlDrawingArea_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
pnlDrawingArea_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
pnlDrawingArea_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
pnlZoom | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
SmallChangeSize | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
UpdateScrollBars() | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
UpdateZoomAndScroll() | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
vScrollBar | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
vScrollBar_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
vScrollBar_ValueChanged(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
xZoomUpDown_ValueChanged(object sender, System.EventArgs e) | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline, private]
zoomFactor | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
zoomRectangle | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
zoomToolBar | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
ZoomToRectangle() | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [inline]
zoomUpDown | Microsoft::Samples::Ink::Cs::InkZoom::InkZoom | [private]
Generated on Wed Nov 13 2024 16:58:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/getschemainfo/vc/getschemainfo.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • getschemainfo
  • vc

getschemainfo.cpp

Go to the documentation of this file.
00001 // attributes.cpp : Defines the entry point for the console application.
00002 //
00003 #include <objbase.h>
00004 #include <wchar.h>
00005 #include <activeds.h>
00006 //Make sure you define UNICODE
00007 //Need to define version 5 for Windows 2000
00008 #define _WIN32_WINNT 0x0500
00009
00010 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy=-1);
00011
00012 ///////////////////////////////////////////////////////////
00013 // PLEASE READ: You must run on Windows 2000 machine to run this sample
00014 ////////////////////////////////////////////////////////////
00015 #include <sddl.h>
00016
00017 HRESULT FindAttributesOrClasses(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00018      LPOLESTR szFilter, //Filter for finding specific attributes.
00019                             //NULL returns all attributeSchema objects.
00020          LPOLESTR *pszPropertiesToReturn, //Properties to return for attributeSchema objects found
00021                               //NULL returns all set properties.
00022      BOOL bIsAttributeQuery, //TRUE queries for attributes;FALSE for classes
00023      BOOL bIsVerbose //TRUE means all properties for the found objects are displayed.
00024                      //FALSE means only the ldapDisplayName with cn in parentheses:
00025              //example: l (Locality-Name)
00026               );
00027
00028
00029
00030
00031 void wmain( int argc, wchar_t *argv[ ])
00032 {
00033
00034 //Handle the command line arguments
00035 int maxAlloc=MAX_PATH*2;
00036 LPOLESTR pszBuffer = new OLECHAR[maxAlloc];
00037 wcscpy(pszBuffer, L"");
00038
00039 BOOL bIsAttributeQuery = TRUE;
00040 BOOL bReturnVerbose = FALSE;
00041 LPOLESTR szType = L"attribute";
00042 if (1==argc||(_wcsicmp(argv[1],L"/?") == 0))
00043 {
00044   wprintf(L"This program queries the schema for the specified classes or attributes.\n");
00045   wprintf(L"Syntax: getschemainfo [/C|/A][/V][querystring]\n");
00046   wprintf(L"where /C specifies to query for classes.\n");
00047   wprintf(L"      /A specifies to query for attributes.\n");
00048   wprintf(L"      /V specifies that all properties for the found classes or attributes should be returned.\n");
00049   wprintf(L"      querystring is the query criteria in ldap query format.\n");
00050   wprintf(L"Defaults: If neither /A or /C is specified, the query is against both.\n");
00051   wprintf(L"          If no /V is specified, the query returns only the ldapDisplayName and cn of the items found.\n");
00052   wprintf(L"          If no querystring is specified, the query returns all classes and/or attributes.\n");
00053   wprintf(L"Example: getschemainfo /A (IsSingleValued=TRUE)\n");
00054   wprintf(L"Returns all single-valued attributes in the schema.\n");
00055   wprintf(L"Common querystrings:\n");
00056   wprintf(L"For attributes:\n");
00057   wprintf(L"(cn=Street-Address) to find the attribute with CN of Street-Address.\n");
00058   wprintf(L"(ldapdisplayname=street) to find the attribute with ldapdisplayname of street.\n");
00059   wprintf(L"(IsSingleValued=TRUE) for single-valued attributes.\n");
00060   wprintf(L"(IsSingleValued=FALSE) for mulit-valued attributes.\n");
00061   wprintf(L"(systemFlags:1.2.840.113556.1.4.804:=00000001) for non-replicated attributes\n");
00062   wprintf(L"(systemFlags:1.2.840.113556.1.4.804:=00000004) for constructed attributes\n");
00063   wprintf(L"(searchFlags=1) for indexed attributes.\n");
00064   wprintf(L"(isMemberOfPartialAttributeSet=TRUE) for attributes included in the global catalog\n");
00065   return;
00066 }
00067 for (int i = 1;i<argc;i++)
00068 {
00069   if (_wcsicmp(argv[i],L"/C") == 0)
00070   {
00071     bIsAttributeQuery = FALSE;
00072     szType = L"class";
00073   }
00074   else if (_wcsicmp(argv[i],L"/A") == 0)
00075   {
00076     bIsAttributeQuery = TRUE;
00077     szType = L"attribute";
00078   }
00079   else if (_wcsicmp(argv[i],L"/V") == 0)
00080   {
00081     bReturnVerbose = TRUE;
00082   }
00083   else
00084   {
00085     if ( IS_BUFFER_ENOUGH(maxAlloc,pszBuffer, argv[i]) > 0 )
00086     {
00087        wcscpy(pszBuffer,argv[i]);
00088     }
00089     else
00090     {
00091
00092       wprintf(L"The argument is too large ");
00093       return;
00094     }
00095
00096   }
00097 }
00098 if (_wcsicmp(pszBuffer,L"") == 0)
00099   wprintf(L"\nFinding all %sSchema objects in the schema...\n\n",szType);
00100 else
00101   wprintf(L"\nFinding %sSchema objects based on query: %s...\n\n",szType, pszBuffer);
00102
00103 //Intialize COM
00104 CoInitialize(NULL);
00105 HRESULT hr = S_OK;
00106 //Get rootDSE and the domain container's DN.
00107 IADs *pObject = NULL;
00108 IDirectorySearch *pSchemaNC = NULL;
00109 LPOLESTR szPath = new OLECHAR[MAX_PATH];
00110 VARIANT var;
00111 hr = ADsOpenObject(L"LDAP://rootDSE",
00112          NULL,
00113          NULL,
00114          ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00115          IID_IADs,
00116          (void**)&pObject);
00117 if (FAILED(hr))
00118 {
00119    wprintf(L"Could not execute query. Could not bind to LDAP://rootDSE.\n");
00120    if (pObject)
00121      pObject->Release();
00122    return;
00123 }
00124 if (SUCCEEDED(hr))
00125 {
00126   hr = pObject->Get(L"schemaNamingContext",&var);
00127   if (SUCCEEDED(hr))
00128   {
00129         wcscpy(szPath,L"LDAP://");
00130
00131     if ( IS_BUFFER_ENOUGH(MAX_PATH,szPath, var.bstrVal, SysStringLen(var.bstrVal)) > 0 )
00132     {
00133             wcscat(szPath,var.bstrVal);
00134     }
00135     else
00136     {
00137       wprintf(L"The Schema's DN is too larget");
00138       pObject->Release();
00139       return;
00140     }
00141
00142         hr = ADsOpenObject(szPath,
00143              NULL,
00144              NULL,
00145              ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00146              IID_IDirectorySearch,
00147              (void**)&pSchemaNC);
00148
00149     if (SUCCEEDED(hr))
00150     {
00151       hr = FindAttributesOrClasses(pSchemaNC, //IDirectorySearch pointer to schema naming context.
00152            pszBuffer,
00153            NULL,
00154            bIsAttributeQuery,
00155            bReturnVerbose
00156          );
00157       if (SUCCEEDED(hr))
00158       {
00159         if (S_FALSE==hr)
00160            wprintf(L"No %sSchema object could be found based on the query: %s\n",szType,pszBuffer);
00161       }
00162       else if (0x8007203e==hr)
00163         wprintf(L"Could not execute query. An invalid filter was specified.\n");
00164       else
00165         wprintf(L"Query failed to run. HRESULT: %x\n",hr);
00166     }
00167     else
00168     {
00169        wprintf(L"Could not execute query. Could not bind to the schema container.\n");
00170     }
00171     if (pSchemaNC)
00172        pSchemaNC->Release();
00173   }
00174     VariantClear(&var);
00175 }
00176 if (pObject)
00177     pObject->Release();
00178
00179
00180
00181
00182
00183 // Uninitialize COM
00184 CoUninitialize();
00185 return;
00186 }
00187
00188
00189
00190
00191
00192 HRESULT FindAttributesOrClasses(IDirectorySearch *pSchemaNC, //IDirectorySearch pointer to schema naming context.
00193      LPOLESTR szFilter, //Filter for finding specific attributes.
00194                             //NULL returns all attributeSchema objects.
00195          LPOLESTR *pszPropertiesToReturn, //Properties to return for attributeSchema objects found
00196                               //NULL returns all set properties unless bIsVerbose is FALSE.
00197      BOOL bIsAttributeQuery, //TRUE queries for attributes;FALSE for classes
00198      BOOL bIsVerbose //TRUE means all properties for the found objects are displayed.
00199                      //FALSE means only the ldapDisplayName with cn in parentheses:
00200              //example: l (Locality-Name)
00201               )
00202 {
00203   if (!pSchemaNC)
00204     return E_POINTER;
00205     //Create search filter
00206   int allocFilter = MAX_PATH*2;
00207   LPOLESTR pszSearchFilter = new OLECHAR[allocFilter];
00208   LPOLESTR szCategory = NULL;
00209   if (bIsAttributeQuery)
00210     szCategory = L"attributeSchema";
00211   else
00212     szCategory = L"classSchema";
00213
00214
00215   wcscpy(pszSearchFilter, L"(&(objectCategory=attributeSchema)%s)");
00216   BOOL bBufferOK=false;
00217   // Check for buffer overrun...
00218   if (szFilter)
00219   {
00220     if ( IS_BUFFER_ENOUGH(allocFilter,pszSearchFilter, szCategory) > 0 )
00221     {
00222          wsprintf(pszSearchFilter, L"(&(objectCategory=%s)%s)",szCategory,szFilter);
00223        bBufferOK=true;
00224     }
00225   }
00226   else
00227   {
00228     if ( IS_BUFFER_ENOUGH(allocFilter,pszSearchFilter, szCategory) > 0 )
00229     {
00230          wsprintf(pszSearchFilter, L"(objectCategory=%s)",szCategory);
00231        bBufferOK=true;
00232     }
00233   }
00234
00235
00236   if( !bBufferOK)
00237   {
00238       wprintf(L"Filter is too large - aborting");
00239       return E_FAIL;
00240   }
00241
00242     //Attributes are one-level deep in the Schema container so only need to search one level.
00243   ADS_SEARCHPREF_INFO SearchPrefs;
00244   SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
00245   SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
00246   SearchPrefs.vValue.Integer = ADS_SCOPE_ONELEVEL;
00247     DWORD dwNumPrefs = 1;
00248
00249   // COL for iterations
00250   LPOLESTR pszColumn = NULL;
00251   ADS_SEARCH_COLUMN col;
00252     HRESULT hr;
00253
00254     // Interface Pointers
00255     IADs    *pObj = NULL;
00256     IADs  * pIADs = NULL;
00257
00258     // Handle used for searching
00259     ADS_SEARCH_HANDLE hSearch = NULL;
00260
00261   // Set the search preference
00262     hr = pSchemaNC->SetSearchPreference( &SearchPrefs, dwNumPrefs);
00263     if (FAILED(hr))
00264         return hr;
00265
00266   LPOLESTR pszBool = NULL;
00267   DWORD dwBool;
00268   PSID pObjectSID = NULL;
00269   LPOLESTR szSID = NULL;
00270   LPOLESTR szDSGUID = new WCHAR [39];
00271   LPGUID pObjectGUID = NULL;
00272   FILETIME filetime;
00273   SYSTEMTIME systemtime;
00274   DATE date;
00275   VARIANT varDate;
00276   LARGE_INTEGER liValue;
00277   LPOLESTR *pszPropertyList = NULL;
00278   LPOLESTR pszNonVerboseList[] = {L"lDAPDisplayName",L"cn"};
00279
00280   LPOLESTR szCNValue = new OLECHAR[MAX_PATH];
00281   LPOLESTR szLDAPDispleyNameValue = new OLECHAR[MAX_PATH];
00282
00283   int iCount = 0;
00284   DWORD x = 0L;
00285
00286
00287
00288   if (!bIsVerbose)
00289   {
00290      //Return non-verbose list properties only
00291          hr = pSchemaNC->ExecuteSearch(pszSearchFilter,
00292                               pszNonVerboseList,
00293                   sizeof(pszNonVerboseList)/sizeof(LPOLESTR),
00294                   &hSearch
00295                   );
00296   }
00297   else
00298   {
00299     if (!pszPropertiesToReturn)
00300     {
00301       //Return all properties.
00302       hr = pSchemaNC->ExecuteSearch(pszSearchFilter,
00303                               NULL,
00304                   0L,
00305                   &hSearch
00306                   );
00307     }
00308     else
00309     {
00310       //specified subset.
00311         pszPropertyList = pszPropertiesToReturn;
00312        //Return specified properties
00313        hr = pSchemaNC->ExecuteSearch(pszSearchFilter,
00314                               pszPropertyList,
00315                   sizeof(pszPropertyList)/sizeof(LPOLESTR),
00316                   &hSearch
00317                   );
00318     }
00319   }
00320   if ( SUCCEEDED(hr) )
00321   {
00322     // Call IDirectorySearch::GetNextRow() to retrieve the next row
00323     //of data
00324     hr = pSchemaNC->GetFirstRow( hSearch);
00325     if (SUCCEEDED(hr))
00326     {
00327         while( hr != S_ADS_NOMORE_ROWS )
00328     {
00329       //Keep track of count.
00330       iCount++;
00331       if (bIsVerbose)
00332         wprintf(L"----------------------------------\n");
00333             // loop through the array of passed column names,
00334             // print the data for each column
00335
00336       while( pSchemaNC->GetNextColumnName( hSearch, &pszColumn ) != S_ADS_NOMORE_COLUMNS )
00337             {
00338                 hr = pSchemaNC->GetColumn( hSearch, pszColumn, &col );
00339           if ( SUCCEEDED(hr) )
00340           {
00341                 // Print the data for the column and free the column
00342           if(bIsVerbose)
00343           {
00344               // Get the data for this column
00345             wprintf(L"%s\n",col.pszAttrName);
00346           switch (col.dwADsType)
00347           {
00348             case ADSTYPE_DN_STRING:
00349                           for (x = 0; x< col.dwNumValues; x++)
00350               {
00351                 wprintf(L"  %s\r\n",col.pADsValues[x].DNString);
00352               }
00353               break;
00354             case ADSTYPE_CASE_EXACT_STRING:
00355             case ADSTYPE_CASE_IGNORE_STRING:
00356             case ADSTYPE_PRINTABLE_STRING:
00357             case ADSTYPE_NUMERIC_STRING:
00358             case ADSTYPE_TYPEDNAME:
00359             case ADSTYPE_FAXNUMBER:
00360             case ADSTYPE_PATH:
00361             case ADSTYPE_OBJECT_CLASS:
00362               for (x = 0; x< col.dwNumValues; x++)
00363               {
00364                 wprintf(L"  %s\r\n",col.pADsValues[x].CaseIgnoreString);
00365               }
00366               break;
00367             case ADSTYPE_BOOLEAN:
00368               for (x = 0; x< col.dwNumValues; x++)
00369               {
00370                 dwBool = col.pADsValues[x].Boolean;
00371                 pszBool = dwBool ? L"TRUE" : L"FALSE";
00372                 wprintf(L"  %s\r\n",pszBool);
00373               }
00374               break;
00375             case ADSTYPE_INTEGER:
00376                 for (x = 0; x< col.dwNumValues; x++)
00377               {
00378                 wprintf(L"  %d\r\n",col.pADsValues[x].Integer);
00379               }
00380               break;
00381             case ADSTYPE_OCTET_STRING:
00382                 if ( _wcsicmp(col.pszAttrName,L"objectSID") == 0 )
00383               {
00384                   for (x = 0; x< col.dwNumValues; x++)
00385                 {
00386                   pObjectSID = (PSID)(col.pADsValues[x].OctetString.lpValue);
00387                   //Convert SID to string.
00388                   ConvertSidToStringSid(pObjectSID, &szSID);
00389                   wprintf(L"  %s\r\n",szSID);
00390                   LocalFree(szSID);
00391                 }
00392               }
00393                 else if ( (_wcsicmp(col.pszAttrName,L"objectGUID") == 0)
00394                 || (_wcsicmp(col.pszAttrName,L"schemaIDGUID") == 0)
00395                 || (_wcsicmp(col.pszAttrName,L"attributeSecurityGUID") == 0) )
00396               {
00397                   for (x = 0; x< col.dwNumValues; x++)
00398                 {
00399                 //Cast to LPGUID
00400                 pObjectGUID = (LPGUID)(col.pADsValues[x].OctetString.lpValue);
00401                 //Convert GUID to string.
00402 								::StringFromGUID2(*pObjectGUID, szDSGUID, 39);
00403                 //Print the GUID
00404                 wprintf(L"  %s\r\n",szDSGUID);
00405                 }
00406               }
00407                 else if ( _wcsicmp(col.pszAttrName,L"oMObjectClass") == 0 )
00408               {
00409                 //TODO:
00410                 wprintf(L"  TODO:No conversion for this.");
00411               }
00412               else
00413                 wprintf(L"  Value of type Octet String. No Conversion.");
00414                 break;
00415             case ADSTYPE_UTC_TIME:
00416               for (x = 0; x< col.dwNumValues; x++)
00417               {
00418               systemtime = col.pADsValues[x].UTCTime;
00419               if (SystemTimeToVariantTime(&systemtime,
00420                             &date) != 0)
00421               {
00422                 //Pack in variant.vt
00423                 varDate.vt = VT_DATE;
00424                 varDate.date = date;
00425                 VariantChangeType(&varDate,&varDate,VARIANT_NOVALUEPROP,VT_BSTR);
00426                   wprintf(L"  %s\r\n",varDate.bstrVal);
00427                 VariantClear(&varDate);
00428               }
00429               else
00430                 wprintf(L"  Could not convert UTC-Time.\n");
00431               }
00432               break;
00433             case ADSTYPE_LARGE_INTEGER:
00434               for (x = 0; x< col.dwNumValues; x++)
00435               {
00436                 liValue = col.pADsValues[x].LargeInteger;
00437               filetime.dwLowDateTime = liValue.LowPart;
00438               filetime.dwHighDateTime = liValue.HighPart;
00439               if((filetime.dwHighDateTime==0) && (filetime.dwLowDateTime==0))
00440               {
00441                 wprintf(L"  No value set.\n");
00442               }
00443               else
00444               {
00445                 //Check for properties of type LargeInteger that represent time
00446                 //if TRUE, then convert to variant time.
00447                 if ((0==wcscmp(L"accountExpires", col.pszAttrName))|
00448                   (0==wcscmp(L"badPasswordTime", col.pszAttrName))||
00449                   (0==wcscmp(L"lastLogon", col.pszAttrName))||
00450                   (0==wcscmp(L"lastLogoff", col.pszAttrName))||
00451                   (0==wcscmp(L"lockoutTime", col.pszAttrName))||
00452                   (0==wcscmp(L"pwdLastSet", col.pszAttrName))
00453                    )
00454                 {
00455                   //Handle special case for Never Expires where low part is -1
00456                   if (filetime.dwLowDateTime==-1)
00457                   {
00458                     wprintf(L"  Never Expires.\n");
00459                   }
00460                   else
00461                   {
00462                     if (FileTimeToLocalFileTime(&filetime, &filetime) != 0)
00463                     {
00464                       if (FileTimeToSystemTime(&filetime,
00465                                  &systemtime) != 0)
00466                       {
00467                         if (SystemTimeToVariantTime(&systemtime,
00468                                       &date) != 0)
00469                         {
00470                           //Pack in variant.vt
00471                           varDate.vt = VT_DATE;
00472                           varDate.date = date;
00473                           VariantChangeType(&varDate,&varDate,VARIANT_NOVALUEPROP,VT_BSTR);
00474                           wprintf(L"  %s\r\n",varDate.bstrVal);
00475                           VariantClear(&varDate);
00476                         }
00477                         else
00478                         {
00479                           wprintf(L"  FileTimeToVariantTime failed\n");
00480                         }
00481                       }
00482                       else
00483                       {
00484                         wprintf(L"  FileTimeToSystemTime failed\n");
00485                       }
00486
00487                     }
00488                     else
00489                     {
00490                       wprintf(L"  FileTimeToLocalFileTime failed\n");
00491                     }
00492                   }
00493                 }
00494                 else
00495                 {
00496                   //Print the LargeInteger.
00497                   wprintf(L"  high: %d low: %d\r\n",filetime.dwHighDateTime, filetime.dwLowDateTime);
00498                 }
00499               }
00500               }
00501               break;
00502             case ADSTYPE_NT_SECURITY_DESCRIPTOR:
00503               for (x = 0; x< col.dwNumValues; x++)
00504               {
00505                 wprintf(L"  Security descriptor.\n");
00506               }
00507               break;
00508             default:
00509                   wprintf(L"Unknown type %d.\n",col.dwADsType);
00510           }
00511           }
00512             else
00513           {
00514           //Verbose handles only the two single-valued attributes: cn and ldapdisplayname
00515           //so this is a special case.
00516           if (0==wcscmp(L"cn", pszColumn))
00517           {
00518             wcscpy(szCNValue,col.pADsValues->CaseIgnoreString);
00519           }
00520           if (0==wcscmp(L"lDAPDisplayName", pszColumn))
00521           {
00522             wcscpy(szLDAPDispleyNameValue,col.pADsValues->CaseIgnoreString);
00523           }
00524           }
00525             pSchemaNC->FreeColumn( &col );
00526           }
00527         FreeADsMem( pszColumn );
00528             }
00529        if (!bIsVerbose)
00530          wprintf(L"%s (%s)\n",szLDAPDispleyNameValue,szCNValue);
00531        //Get the next row
00532        hr = pSchemaNC->GetNextRow( hSearch);
00533     }
00534
00535     }
00536     // Close the search handle to clean up
00537       pSchemaNC->CloseSearchHandle(hSearch);
00538   }
00539   if (SUCCEEDED(hr) && 0==iCount)
00540     hr = S_FALSE;
00541
00542     return hr;
00543 }
00544
00545
00546
00547
00548 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy)
00549
00550 {
00551
00552          if (toCopy == -1)
00553
00554           {
00555                toCopy = wcslen(pszSource);
00556           }
00557
00558       return maxAlloc - (wcslen(pszTarget) + toCopy + 1);
00559 }
00560
00561
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/IMSConf2.Idl Source File

  • Web
  • NetMeeting
  • NMChat

IMSConf2.Idl

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       imsconf2.idl
00004 //
00005 //
00006 //  Copyright (c) Microsoft Corporation 1995-2002
00007 //
00008 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00009 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00010 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00011 // PARTICULAR PURPOSE.
00012 //****************************************************************************
00013
00014 #include <imsconf2.idl>
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CToolBarLite Member List

This is the complete list of members for CToolBarLite, including all inherited members.
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, UINT nID, UINT nBitmapID, UINT cButtons, TBBUTTON *rgButtons, DWORD dwStyle=WS_CHILD|WS_VISIBLE|TBSTYLE_TOOLTIPS) | CToolBarLite | [virtual]
CWndLite::Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CToolBarLite() | CToolBarLite |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
EnableButton(UINT nID, bool fEnable) | CToolBarLite | [inline, virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CToolBarLite() | CToolBarLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/asserts.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

asserts.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module ASSERTS.CPP | Simple Assertion Routines
00008 //
00009 //
00010 #include "headers.h"
00011 #include <time.h>
00012 #include "asserts.h"
00013
00014 //////////////////////////////////////////////////////////////////
00015 // LRESULT wSendMessage
00016 //
00017 //////////////////////////////////////////////////////////////////
00018 LRESULT wSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, WCHAR* pwszBuffer)
00019 {
00020   CHAR szBuffer[MAX_QUERY_LEN];
00021   szBuffer[0] = EOL;
00022
00023   if(pwszBuffer && Msg != WM_GETTEXT && Msg != CB_GETLBTEXT)
00024   {
00025     //Convert to ANSI before sending, since we don't know if this was a GET/SET message
00026     ConvertToMBCS(pwszBuffer, szBuffer, MAX_QUERY_LEN);
00027   }
00028
00029
00030   //Send the message with an ANSI Buffer
00031   LRESULT lResult = SendMessageA(hWnd, Msg, (WPARAM)wParam, (LPARAM)szBuffer);
00032
00033   if(pwszBuffer && Msg == WM_GETTEXT || Msg == CB_GETLBTEXT)
00034   {
00035     //Now convert the result into the users WCHAR buffer
00036     // 64 bit TODO
00037     ConvertToWCHAR(szBuffer, pwszBuffer, (ULONG)(Msg == WM_GETTEXT ? wParam : MAX_QUERY_LEN));
00038   }
00039   return lResult;
00040 }
00041
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 // HRESULT ConvertToMBCS
00045 //
00046 /////////////////////////////////////////////////////////////////////////////
00047 HRESULT ConvertToMBCS(WCHAR* pwsz, CHAR* psz, ULONG cStrLen)
00048 {
00049   ASSERT(psz);
00050
00051   //No-op
00052   if(pwsz==NULL)
00053   {
00054     psz[0] = EOL;
00055     return S_FALSE;
00056   }
00057
00058   //Convert the string to MBCS
00059   //NOTE:  WideCharToMultiByte returns 0 if truncation occurs!  So when iResult = 0
00060   //you can be assured the amount copied is the maximum length of the buffer...
00061   INT iResult = WideCharToMultiByte(CP_OEMCP, 0, pwsz, -1, psz, cStrLen, NULL, NULL);
00062   return iResult ? S_OK : E_FAIL;
00063 }
00064
00065 /////////////////////////////////////////////////////////////////////////////
00066 // HRESULT ConvertToWCHAR
00067 //
00068 /////////////////////////////////////////////////////////////////////////////
00069 HRESULT ConvertToWCHAR(CHAR* psz, WCHAR* pwsz, ULONG cStrLen)
00070 {
00071   ASSERT(pwsz);
00072
00073   //No-op
00074   if(psz==NULL)
00075   {
00076     pwsz[0] = wEOL;
00077     return S_FALSE;
00078   }
00079
00080   //Convert the string to MBCS
00081   //NOTE:  MultiByteToWideChar returns 0 if truncation occurs!  So when iResult = 0
00082   //you can be assured the amount copied is the maximum length of the buffer...
00083   INT iResult = MultiByteToWideChar(CP_OEMCP, 0, psz, -1, pwsz, cStrLen);
00084   return iResult ? S_OK : E_FAIL;
00085 }
00086
00087
00088
00089 /////////////////////////////////////////////////////////////////////////////
00090 // HRESULT FreeProperties
00091 //
00092 /////////////////////////////////////////////////////////////////////////////
00093 HRESULT FreeProperties(ULONG* pcProperties, DBPROP** prgProperties)
00094 {
00095   ASSERT(pcProperties);
00096   ASSERT(prgProperties);
00097   HRESULT hr = S_OK;
00098
00099   //no-op case
00100   if(*pcProperties==0 || *prgProperties==NULL)
00101     return S_OK;
00102
00103   //Free the inner variants first
00104   for(ULONG i=0; i<*pcProperties; i++)
00105   {
00106     //if DBPROPSTATUS_NOTSUPPORTED then vValue is undefined
00107     if((*prgProperties)[i].dwStatus != DBPROPSTATUS_NOTSUPPORTED)
00108       TESTC(hr = VariantClear(&((*prgProperties)[i].vValue)));
00109   }
00110
00111 CLEANUP:
00112   //Now NULL the set
00113   *pcProperties = 0;
00114   SAFE_FREE(*prgProperties);
00115   return hr;
00116 }
00117
00118 /////////////////////////////////////////////////////////////////////////////
00119 // HRESULT FreeProperties
00120 //
00121 /////////////////////////////////////////////////////////////////////////////
00122 HRESULT FreeProperties(ULONG* pcPropSets, DBPROPSET** prgPropSets)
00123 {
00124   ASSERT(pcPropSets);
00125   ASSERT(prgPropSets);
00126   HRESULT hr = S_OK;
00127
00128   //Loop over all the property sets
00129   for(ULONG i=0; i<*pcPropSets; i++)
00130     FreeProperties(&((*prgPropSets)[i].cProperties), &((*prgPropSets)[i].rgProperties));
00131
00132   //Now NULL the outer set
00133   *pcPropSets = 0;
00134   SAFE_FREE(*prgPropSets);
00135   return hr;
00136 }
00137
00138
00139
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MciPlay/MciPlay.c Source File

  • Multimedia
  • Audio
  • MciPlay

MciPlay.c

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------*\
00002  *
00003  *  MCIPLAY:
00004  *
00005  *    Sample app showing the use of MCIWnd
00006  *
00007  *    MCIPLAY is a MDI aplication that demonstates the following:
00008  *
00009  *      - Using the MCIWnd window class to play MCI files.
00010  *
00011  *----------------------------------------------------------------------------*/
00012 /**************************************************************************
00013  *
00014  *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015  *  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00017  *  PURPOSE.
00018  *
00019  *  Copyright 1992 - 2000 Microsoft Corporation.  All Rights Reserved.
00020  *
00021  **************************************************************************/
00022
00023 #define  STRICT
00024 #define  INC_OLE2
00025 #include <windows.h>
00026 #include <windowsx.h>
00027 #include <commdlg.h>
00028 #include <vfw.h>
00029
00030 #include "mciplay.h"
00031
00032 #define BUFSIZE 260
00033 #define MCIPLAY_APP_CLASS "MCIPlay_App"
00034 #define MCIPLAY_DOC_CLASS MCIWND_WINDOW_CLASS
00035
00036 //---------------------------------------------------------------------------
00037
00038 #define ISCHECKED(hwnd,id) (BOOL)(GetMenuState(GetMenu(hwnd), id, 0) & MF_CHECKED)
00039
00040 /*-------------------------------------------------------------------------*\
00041 |                                                                          |
00042 |   g l o b a l   v a r i a b l e s                                        |
00043 |                                                                          |
00044 \*------------------------------------------------------------------------*/
00045
00046     HINSTANCE ghInstApp;        /* Instance handle */
00047     HACCEL ghAccelApp;
00048     HWND ghwndApp;          /* Handle to parent window */
00049     HWND ghwndMdi;          /* Handle to MCI client window */
00050     char gszBuffer[BUFSIZE];
00051
00052 /*----------------------------------------------------------------------------*\
00053 \*----------------------------------------------------------------------------*/
00054
00055 LRESULT CALLBACK AppWndProc(HWND, UINT, WPARAM, LPARAM);
00056 BOOL    CALLBACK AppAbout(HWND, UINT, WPARAM, LPARAM);
00057
00058 static BOOL AppInit(HINSTANCE, HINSTANCE, LPSTR, int);
00059 static HWND mdiCreateDoc(LPSTR, LPSTR, LPARAM);
00060 static HWND mdiCreateClient(HWND, HMENU);
00061 static LRESULT mdiSendMessage(HWND, HWND, UINT, WPARAM, LPARAM);
00062 static BOOL FormatFilterString(UINT, LPSTR);
00063 static void MCI_OnCommand(HWND, int, HWND, UINT);
00064 static void mdiFilterSendMessage(HWND, UINT, WPARAM, LPARAM);
00065 static void MCI_OnInitMenuPopup(HWND, HMENU, int, BOOL);
00066 static void MCI_OnSize(HWND, UINT, int, int);
00067
00068 /*----------------------------------------------------------------------------*\
00069 |   AppAbout( hDlg, msg, wParam, lParam )                                      |
00070 |                                                                              |
00071 |   Description:                                                               |
00072 |       This function handles messages belonging to the "About" dialog box.    |
00073 |       The only message that it looks for is WM_COMMAND, indicating the use   |
00074 |       has pressed the "OK" button.  When this happens, it takes down         |
00075 |       the dialog box.                                                        |
00076 |                                                                              |
00077 |   Arguments:                                                                 |
00078 |       hDlg            window handle of about dialog window                   |
00079 |       msg             message number                                         |
00080 |       wParam          message-dependent                                      |
00081 |       lParam          message-dependent                                      |
00082 |                                                                              |
00083 |   Returns:                                                                   |
00084 |       TRUE if message has been processed, else FALSE                         |
00085 |                                                                              |
00086 \*----------------------------------------------------------------------------*/
00087 BOOL CALLBACK AppAbout(
00088 HWND hwnd,
00089 UINT msg,
00090 WPARAM wParam,
00091 LPARAM lParam)
00092 {
00093     switch (msg) {
00094         case WM_COMMAND:
00095         EndDialog(hwnd,TRUE);
00096         return TRUE;
00097     }
00098     return FALSE;
00099 }
00100
00101 /*----------------------------------------------------------------------------*\
00102 |   AppInit ( hInstance, hPrevInstance )                                       |
00103 |                                                                              |
00104 |   Description:                                                               |
00105 |       This is called when the application is first loaded into               |
00106 |       memory.  It performs all initialization that doesn't need to be done   |
00107 |       once per instance.                                                     |
00108 |                                                                              |
00109 |   Arguments:                                                                 |
00110 |   hPrevInstance   instance handle of previous instance                       |
00111 |       hInstance       instance handle of current instance                    |
00112 |                                                                              |
00113 |   Returns:                                                                   |
00114 |       TRUE if successful, FALSE if not                                       |
00115 |                                                                              |
00116 \*----------------------------------------------------------------------------*/
00117 static BOOL AppInit(
00118 HINSTANCE hInst,
00119 HINSTANCE hPrev,
00120 LPSTR szCmd,
00121 int sw)
00122 {
00123     WNDCLASS cls;
00124     WORD wVer;
00125     char szAppName[BUFSIZE];
00126
00127     /* Save instance handle for DialogBox */
00128     ghInstApp = hInst;
00129
00130     LoadString( ghInstApp, IDS_APPNAME, szAppName, BUFSIZE );
00131
00132     /* first let's make sure we are running on 1.1 */
00133     wVer = HIWORD(VideoForWindowsVersion());
00134     if (wVer < 0x010a){
00135         char szTitle[BUFSIZE];
00136         /* oops, we are too old, blow out of here */
00137         LoadString( ghInstApp, IDS_APPERR, szTitle, BUFSIZE );
00138         LoadString( ghInstApp, IDS_VFWTOOOLD, gszBuffer, BUFSIZE );
00139         MessageBeep(MB_ICONHAND);
00140         MessageBox(NULL, gszBuffer, szTitle, MB_OK|MB_ICONSTOP);
00141         return FALSE;
00142     }
00143
00144     ghAccelApp = LoadAccelerators(ghInstApp, "AppAccel");
00145
00146     if (!hPrev) {
00147         cls.hCursor        = LoadCursor(NULL,IDC_ARROW);
00148         cls.hIcon          = LoadIcon(hInst,"AppIcon");
00149         cls.lpszMenuName   = "AppMenu";
00150         cls.lpszClassName  = MCIPLAY_APP_CLASS;
00151         cls.hbrBackground  = (HBRUSH)(COLOR_APPWORKSPACE+1);
00152         cls.hInstance      = hInst;
00153         cls.style          = 0;
00154         cls.lpfnWndProc    = (WNDPROC)AppWndProc;
00155         cls.cbClsExtra     = 0;
00156         cls.cbWndExtra     = 0;
00157
00158         if (!RegisterClass(&cls))
00159             return FALSE;
00160     }
00161
00162     // !!! Not using MCIWndCreate, so we must init ourselves
00163     if (!MCIWndRegisterClass())
00164         return FALSE;
00165
00166     ghwndApp = CreateWindow(
00167         MCIPLAY_APP_CLASS,
00168         szAppName,
00169         WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
00170         CW_USEDEFAULT,
00171         0,
00172         CW_USEDEFAULT,
00173         0,
00174         (HWND)NULL,   /* no parent */
00175         (HMENU)NULL,      /* use class menu */
00176         (HANDLE)hInst,     /* handle to window instance */
00177         (LPSTR)NULL);     /* no params to pass on */
00178
00179     /* Make window visible according to the way the app is activated */
00180     ShowWindow(ghwndApp,sw);
00181
00182     return TRUE;
00183 }
00184
00185 /*----------------------------------------------------------------------------*\
00186 |   WinMain( hInstance, hPrevInstance, lpszCmdLine, cmdShow )                  |
00187 |                                                                              |
00188 |   Description:                                                               |
00189 |       The main procedure for the App.  After initializing, it just goes      |
00190 |       into a message-processing loop until it gets a WM_QUIT message         |
00191 |       (meaning the app was closed).                                          |
00192 |                                                                              |
00193 |   Arguments:                                                                 |
00194 |       hInstance       instance handle of this instance of the app            |
00195 |       hPrevInstance   instance handle of previous instance, NULL if first    |
00196 |       lpszCmdLine     ->null-terminated command line                         |
00197 |       cmdShow         specifies how the window is initially displayed        |
00198 |                                                                              |
00199 |   Returns:                                                                   |
00200 |       The exit code as specified in the WM_QUIT message.                     |
00201 |                                                                              |
00202 \*----------------------------------------------------------------------------*/
00203 int PASCAL WinMain(
00204 HINSTANCE hInstance,
00205 HINSTANCE hPrevInstance,
00206 LPSTR szCmdLine,
00207 int sw)
00208 {
00209     MSG msg;
00210
00211     if (!AppInit(hInstance,hPrevInstance,szCmdLine,sw))
00212         return FALSE;
00213
00214     //Polling messages from event queue
00215     for (;;) {
00216         if (PeekMessage(&msg, NULL, 0, 0,PM_REMOVE)) {
00217             if (msg.message == WM_QUIT)
00218                 break;
00219
00220             if (ghAccelApp && ghwndApp && TranslateAccelerator(ghwndApp, ghAccelApp, &msg))
00221                 continue;
00222
00223             if(!TranslateMDISysAccel(ghwndMdi, &msg)) {
00224                 TranslateMessage(&msg);
00225                 DispatchMessage(&msg);
00226             }
00227         } else {
00228             // idle time here, DONT BE A PIG!
00229             WaitMessage();
00230         }
00231     }
00232     return msg.wParam;
00233 }
00234
00235 /*----------------------------------------------------------------------------*\
00236 \*----------------------------------------------------------------------------*/
00237
00238 static HWND mdiCreateDoc(
00239 LPSTR szClass,
00240 LPSTR szTitle,
00241 LPARAM l)
00242 {
00243     MDICREATESTRUCT mdics;
00244
00245     mdics.szClass   = szClass;
00246     mdics.szTitle   = szTitle;
00247     mdics.hOwner    = ghInstApp;
00248     mdics.x         = CW_USEDEFAULT;
00249     mdics.y         = 0;
00250     mdics.cx        = CW_USEDEFAULT;
00251     mdics.cy        = 0;
00252     mdics.style     = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | MCIWNDF_SHOWALL;
00253     mdics.lParam    = l;
00254
00255     return FORWARD_WM_MDICREATE(ghwndMdi, (LPMDICREATESTRUCT)&mdics, SendMessage);
00256 }
00257
00258 /*----------------------------------------------------------------------------*\
00259 |   mdiCreateClient()                                                          |
00260 |                                                                              |
00261 |   Description:                                                               |
00262 |                                                                              |
00263 |   Arguments:                                                                 |
00264 |                                                                              |
00265 |   Returns:                                                                   |
00266 |   HWND if successful, NULL otherwise                                         |
00267 |                                                                              |
00268 \*----------------------------------------------------------------------------*/
00269 static HWND mdiCreateClient(
00270 HWND hwndP,
00271 HMENU hmenuWindow)
00272 {
00273     CLIENTCREATESTRUCT ccs;
00274
00275     ccs.hWindowMenu = hmenuWindow;
00276     ccs.idFirstChild = 100;
00277
00278     return CreateWindow(
00279             "MDICLIENT",
00280             NULL,
00281             WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
00282             0,
00283             0,
00284             0,
00285             0,
00286             hwndP,
00287             0,
00288             ghInstApp,
00289             (LPVOID)&ccs);
00290 }
00291
00292 /*----------------------------------------------------------------------------*\
00293 \*----------------------------------------------------------------------------*/
00294
00295 static LRESULT mdiSendMessage(
00296 HWND hwndMdi,
00297 HWND hwnd,
00298 UINT msg,
00299 WPARAM wParam,
00300 LPARAM lParam)
00301 {
00302   LRESULT lresult =  E_FAIL;
00303   if (hwnd == (HWND)-1) {
00304     for (hwnd = GetWindow(hwndMdi, GW_CHILD); hwnd;
00305    hwnd = GetWindow(hwnd, GW_HWNDNEXT))
00306       SendMessage(hwnd, msg, wParam, lParam);
00307     lresult = 0L;
00308   } else {
00309     if (hwnd == NULL)
00310       hwnd = FORWARD_WM_MDIGETACTIVE(hwndMdi, SendMessage);
00311     if (hwnd)
00312       lresult = SendMessage(hwnd, msg, wParam, lParam);
00313   }
00314   return lresult;
00315 }
00316
00317 //----------------------------------------------------------------------------
00318 // MCI_OnCommand - Handles WM_COMMAND
00319 //----------------------------------------------------------------------------
00320 static void MCI_OnCommand(
00321 HWND hwnd,
00322 int id,
00323 HWND hwndCtl,
00324 UINT codeNotify)
00325 {
00326     HWND hwndNew;
00327     HWND hwndMovie = FORWARD_WM_MDIGETACTIVE(ghwndMdi, SendMessage);
00328
00329     switch(id) {
00330         case MENU_ABOUT:
00331             DialogBox(ghInstApp,MAKEINTRESOURCE(ABOUTBOX),hwnd,AppAbout);
00332             break;
00333
00334         case MENU_EXIT:
00335             PostMessage(hwnd,WM_CLOSE,0,0L);
00336             break;
00337
00338         case MENU_CLOSE:
00339             PostMessage(hwndMovie, WM_CLOSE, 0, 0L);
00340             break;
00341
00342         case MENU_NEW:
00343             LoadString( ghInstApp, IDS_UNTITLLED, gszBuffer, BUFSIZE );
00344             if (hwndNew = mdiCreateDoc(MCIPLAY_DOC_CLASS, gszBuffer, 0))
00345                 SetFocus(hwndNew);
00346             break;
00347
00348         case MENU_OPEN:
00349         {
00350             OPENFILENAME ofn;
00351             char szFileName[BUFSIZE];
00352             char szFilter[BUFSIZE];
00353
00354             FormatFilterString( IDS_FILTERSTRING, szFilter );
00355
00356             /* prompt user for file to open */
00357             ofn.lStructSize = sizeof(OPENFILENAME);
00358             ofn.hwndOwner = hwnd;
00359             ofn.hInstance = NULL;
00360             ofn.lpstrFilter = szFilter;
00361             ofn.lpstrCustomFilter = NULL;
00362             ofn.nMaxCustFilter = 0;
00363             ofn.nFilterIndex = 0;
00364             *szFileName = '\0';
00365             ofn.lpstrFile = szFileName;
00366             ofn.nMaxFile = BUFSIZE;
00367             ofn.lpstrFileTitle = NULL;
00368             ofn.nMaxFileTitle = 0;
00369             ofn.lpstrInitialDir = NULL;
00370             ofn.lpstrTitle = "Open";
00371             ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
00372             ofn.nFileOffset = 0;
00373             ofn.nFileExtension = 0;
00374             ofn.lpstrDefExt = NULL;
00375             ofn.lCustData = 0;
00376             ofn.lpfnHook = NULL;
00377             ofn.lpTemplateName = NULL;
00378
00379             if (GetOpenFileName(&ofn))
00380                 if (hwndNew = mdiCreateDoc(MCIPLAY_DOC_CLASS, 0, (LPARAM)(LPSTR)szFileName))
00381                     SetFocus(hwndNew);
00382         }
00383         break;
00384
00385         case WM_MDITILE:
00386         case WM_MDICASCADE:
00387         case WM_MDIICONARRANGE:
00388             SendMessage(ghwndMdi, id, 0, 0);
00389             break;
00390
00391         /* Movie Menu */
00392         case IDM_PLAY:
00393             MCIWndPlay(hwndMovie);
00394             break;
00395
00396         case IDM_RPLAY:
00397             MCIWndPlayReverse(hwndMovie);
00398             break;
00399
00400         case IDM_STOP:
00401             MCIWndStop(hwndMovie);
00402             break;
00403
00404         case IDM_HOME:
00405             MCIWndHome(hwndMovie);
00406             break;
00407
00408         case IDM_END:
00409             MCIWndEnd(hwndMovie);
00410             break;
00411
00412         case IDM_STEP:
00413             MCIWndStep(hwndMovie, 1);
00414             break;
00415
00416         case IDM_RSTEP:
00417             MCIWndStep(hwndMovie, -1);
00418             break;
00419
00420         /* Styles POPUP */
00421
00422         case IDM_SAutosizeWindow:
00423             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOAUTOSIZEWINDOW,
00424                 ISCHECKED(hwnd,id) ? MCIWNDF_NOAUTOSIZEWINDOW : 0);
00425             break;
00426
00427         case IDM_SAutosizeMovie:
00428             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOAUTOSIZEMOVIE,
00429                 ISCHECKED(hwnd,id) ? MCIWNDF_NOAUTOSIZEMOVIE : 0);
00430             break;
00431
00432         case IDM_SPlaybar:
00433             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOPLAYBAR,
00434                 ISCHECKED(hwnd,id) ? MCIWNDF_NOPLAYBAR : 0);
00435             break;
00436
00437         case IDM_SRecord:
00438             MCIWndChangeStyles(hwndMovie, MCIWNDF_RECORD,
00439                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_RECORD);
00440             break;
00441
00442         case IDM_SMenu:
00443             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOMENU,
00444                 ISCHECKED(hwnd,id) ? MCIWNDF_NOMENU : 0);
00445             break;
00446
00447         case IDM_SErrorDlg:
00448             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOERRORDLG,
00449                 ISCHECKED(hwnd,id) ? MCIWNDF_NOERRORDLG : 0);
00450             break;
00451
00452         case IDM_SShowName:
00453             MCIWndChangeStyles(hwndMovie, MCIWNDF_SHOWNAME,
00454                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_SHOWNAME);
00455             break;
00456
00457         case IDM_SShowMode:
00458             MCIWndChangeStyles(hwndMovie, MCIWNDF_SHOWMODE,
00459                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_SHOWMODE);
00460             break;
00461
00462         case IDM_SShowPos:
00463             MCIWndChangeStyles(hwndMovie, MCIWNDF_SHOWPOS,
00464                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_SHOWPOS);
00465             break;
00466
00467         case IDM_SNotifyMedia:
00468             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOTIFYMEDIA,
00469                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_NOTIFYMEDIA);
00470             break;
00471
00472         case IDM_SNotifyMode:
00473             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOTIFYMODE,
00474                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_NOTIFYMODE);
00475             break;
00476
00477         case IDM_SNotifyPos:
00478             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOTIFYPOS,
00479                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_NOTIFYPOS);
00480             break;
00481
00482         case IDM_SNotifySize:
00483             MCIWndChangeStyles(hwndMovie, MCIWNDF_NOTIFYSIZE,
00484                 ISCHECKED(hwnd,id) ? 0 : MCIWNDF_NOTIFYSIZE);
00485             break;
00486
00487         default:
00488             FORWARD_WM_COMMAND(NULL, id, hwndCtl, codeNotify, mdiFilterSendMessage);
00489             break;
00490     }
00491     return;
00492 }
00493
00494 /*----------------------------------------------------------------------------*/
00495 static void mdiFilterSendMessage(
00496 HWND    hwnd,
00497 UINT    msg,
00498 WPARAM  wParam,
00499 LPARAM  lParam)
00500 {
00501     mdiSendMessage(ghwndMdi, hwnd, msg, wParam, lParam);
00502 }
00503
00504 //----------------------------------------------------------------------------
00505 // MCI_OnInitMenuPopup - Handles WM_INITMENUPOPUP
00506 //----------------------------------------------------------------------------
00507 static void MCI_OnInitMenuPopup(
00508 HWND hwnd,
00509 HMENU hMenu,
00510 int item,
00511 BOOL fSystemMenu)
00512 {
00513     HMENU hStylesMenu = GetSubMenu(GetSubMenu(GetMenu(hwnd), 1), 10);
00514     HMENU hFileMenu = GetSubMenu(GetMenu(hwnd), 0);
00515     HMENU hMovieMenu = GetSubMenu(GetMenu(hwnd), 1);
00516     HMENU hWindowMenu = GetSubMenu(GetMenu(hwnd), 2);
00517     HWND  hwndMovie = FORWARD_WM_MDIGETACTIVE(ghwndMdi, SendMessage);
00518     UINT f;
00519
00520     // be sure this isn't the system menu
00521     if (fSystemMenu)
00522         return;
00523
00524     //
00525     // Check the styles properly when styles is chosen
00526     // !!! Make sure position constants don't change!
00527     // Dont forget that some of these styles use multiple bits
00528     // in wStyles - therefore check carefully.
00529     if ((hMenu == hStylesMenu) && hwndMovie) {
00530
00531         UINT  wStyles = MCIWndGetStyles(hwndMovie);
00532
00533         CheckMenuItem(hStylesMenu, IDM_SAutosizeWindow,
00534             ((wStyles & MCIWNDF_NOAUTOSIZEWINDOW) == MCIWNDF_NOAUTOSIZEWINDOW) ? MF_UNCHECKED : MF_CHECKED);
00535         CheckMenuItem(hStylesMenu, IDM_SAutosizeMovie,
00536             ((wStyles & MCIWNDF_NOAUTOSIZEMOVIE) == MCIWNDF_NOAUTOSIZEMOVIE) ? MF_UNCHECKED : MF_CHECKED);
00537         CheckMenuItem(hStylesMenu, IDM_SPlaybar,
00538             ((wStyles & MCIWNDF_NOPLAYBAR) == MCIWNDF_NOPLAYBAR) ? MF_UNCHECKED : MF_CHECKED);
00539         CheckMenuItem(hStylesMenu, IDM_SRecord,
00540             ((wStyles & MCIWNDF_RECORD) == MCIWNDF_RECORD) ? MF_CHECKED :MF_UNCHECKED);
00541         CheckMenuItem(hStylesMenu, IDM_SMenu,
00542             ((wStyles & MCIWNDF_NOMENU) == MCIWNDF_NOMENU) ? MF_UNCHECKED :MF_CHECKED);
00543         CheckMenuItem(hStylesMenu, IDM_SErrorDlg,
00544             ((wStyles & MCIWNDF_NOERRORDLG) == MCIWNDF_NOERRORDLG) ? MF_UNCHECKED :MF_CHECKED);
00545         CheckMenuItem(hStylesMenu, IDM_SShowName,
00546             ((wStyles & MCIWNDF_SHOWNAME) == MCIWNDF_SHOWNAME) ? MF_CHECKED :MF_UNCHECKED);
00547         CheckMenuItem(hStylesMenu, IDM_SShowMode,
00548             ((wStyles & MCIWNDF_SHOWMODE) == MCIWNDF_SHOWMODE) ? MF_CHECKED :MF_UNCHECKED);
00549         CheckMenuItem(hStylesMenu, IDM_SShowPos,
00550             ((wStyles & MCIWNDF_SHOWPOS) == MCIWNDF_SHOWPOS) ? MF_CHECKED :MF_UNCHECKED);
00551         CheckMenuItem(hStylesMenu, IDM_SNotifyMedia,
00552             ((wStyles & MCIWNDF_NOTIFYMEDIA) == MCIWNDF_NOTIFYMEDIA) ? MF_CHECKED :MF_UNCHECKED);
00553         CheckMenuItem(hStylesMenu, IDM_SNotifyMode,
00554             ((wStyles & MCIWNDF_NOTIFYMODE) == MCIWNDF_NOTIFYMODE) ? MF_CHECKED :MF_UNCHECKED);
00555         CheckMenuItem(hStylesMenu, IDM_SNotifyPos,
00556             ((wStyles & MCIWNDF_NOTIFYPOS) == MCIWNDF_NOTIFYPOS) ? MF_CHECKED :MF_UNCHECKED);
00557         CheckMenuItem(hStylesMenu, IDM_SNotifySize,
00558             ((wStyles & MCIWNDF_NOTIFYSIZE) == MCIWNDF_NOTIFYSIZE) ? MF_CHECKED :MF_UNCHECKED);
00559     }
00560
00561     //
00562     // Enable/Disable the stuff under the MOVIE popup
00563     // !!! Make sure position constants don't change!
00564     //
00565     else if (hMenu == hMovieMenu) {
00566
00567         EnableMenuItem( hMenu, 10,
00568                         MF_BYPOSITION | (hwndMovie ? MF_ENABLED : MF_GRAYED) );
00569
00570         if ( !hwndMovie
00571            || MCIWndGetMode(hwndMovie, NULL, 0) == MCI_MODE_NOT_READY) {
00572
00573             EnableMenuItem( hFileMenu, MENU_CLOSE,
00574                             hwndMovie ? MF_ENABLED : MF_GRAYED );
00575
00576             EnableMenuItem(hMenu, IDM_STOP, MF_GRAYED);
00577             EnableMenuItem(hMenu, IDM_PLAY, MF_GRAYED);
00578             EnableMenuItem(hMenu, IDM_RPLAY, MF_GRAYED);
00579             EnableMenuItem(hMenu, IDM_HOME, MF_GRAYED);
00580             EnableMenuItem(hMenu, IDM_END, MF_GRAYED);
00581             EnableMenuItem(hMenu, IDM_STEP, MF_GRAYED);
00582             EnableMenuItem(hMenu, IDM_RSTEP, MF_GRAYED);
00583
00584         } else {
00585
00586             EnableMenuItem(hFileMenu, MENU_CLOSE, MF_ENABLED);
00587             f = MCIWndGetMode(hwndMovie, NULL, 0) != MCI_MODE_STOP;
00588             EnableMenuItem(hMenu, IDM_PLAY, !f ? MF_ENABLED : MF_GRAYED);
00589             EnableMenuItem(hMenu, IDM_RPLAY, !f ? MF_ENABLED : MF_GRAYED);
00590             EnableMenuItem(hMenu, IDM_STOP, f ? MF_ENABLED : MF_GRAYED);
00591             EnableMenuItem(hMenu, IDM_HOME, MF_ENABLED);
00592             EnableMenuItem(hMenu, IDM_END,  MF_ENABLED);
00593             EnableMenuItem(hMenu, IDM_STEP, MF_ENABLED);
00594             EnableMenuItem(hMenu, IDM_RSTEP,MF_ENABLED);
00595         }
00596     }
00597
00598     //
00599     // Enable/Disable the stuff under the WINDOW menu
00600     // !!! Make sure position constants don't change!
00601     //
00602     else if (hMenu == hWindowMenu) {
00603
00604             EnableMenuItem(hMenu, 0,
00605                         MF_BYPOSITION | (hwndMovie ? MF_ENABLED : MF_GRAYED));
00606             EnableMenuItem(hMenu, 1,
00607                         MF_BYPOSITION | (hwndMovie ? MF_ENABLED : MF_GRAYED));
00608             EnableMenuItem(hMenu, 2,
00609                         MF_BYPOSITION | (hwndMovie ? MF_ENABLED : MF_GRAYED));
00610     }
00611
00612     //
00613     // Enable/Disable the stuff under the FILE menu
00614     //
00615     else if (hMenu == hFileMenu) {
00616
00617         EnableMenuItem( hFileMenu, MENU_CLOSE,
00618                         hwndMovie ? MF_ENABLED : MF_GRAYED);
00619     }
00620
00621     FORWARD_WM_INITMENUPOPUP(NULL, hMenu, item,
00622                              fSystemMenu, mdiFilterSendMessage);
00623     return;
00624 }
00625
00626 //----------------------------------------------------------------------------
00627 // MCI_OnSize - Handles WM_SIZE
00628 //----------------------------------------------------------------------------
00629 static void MCI_OnSize(
00630 HWND hwnd,
00631 UINT state,
00632 int cx,
00633 int cy)
00634 {
00635     MoveWindow(ghwndMdi,0,0,cx,cy,TRUE);
00636     return;
00637 }
00638
00639 /*----------------------------------------------------------------------------*\
00640 |   AppWndProc( hwnd, msg, wParam, lParam )                                    |
00641 |                                                                              |
00642 |   Description:                                                               |
00643 |       The window proc for the app's main (tiled) window.  This processes all |
00644 |       of the parent window's messages.                                       |
00645 |                                                                              |
00646 |   Arguments:                                                                 |
00647 |       hwnd            window handle for the parent window                    |
00648 |       msg             message number                                         |
00649 |       wParam          message-dependent                                      |
00650 |       lParam          message-dependent                                      |
00651 |                                                                              |
00652 |   Returns:                                                                   |
00653 |       0 if processed, nonzero if ignored                                     |
00654 |                                                                              |
00655 \*----------------------------------------------------------------------------*/
00656 LRESULT CALLBACK AppWndProc(
00657 HWND hwnd,
00658 UINT msg,
00659 WPARAM wParam,
00660 LPARAM lParam)
00661 {
00662
00663     switch (msg) {
00664        case WM_CREATE:
00665         ghwndMdi = mdiCreateClient(hwnd, GetSubMenu(GetMenu(hwnd), GetMenuItemCount(GetMenu(hwnd))-1));
00666         break;
00667
00668         case WM_COMMAND:
00669             HANDLE_WM_COMMAND(hwnd, wParam, lParam, MCI_OnCommand);
00670             break;
00671
00672     case WM_PALETTECHANGED:
00673         mdiSendMessage(ghwndMdi, (HWND)-1, msg, wParam, lParam);
00674         break;
00675
00676     case WM_QUERYNEWPALETTE:
00677         return mdiSendMessage(ghwndMdi, NULL, msg, wParam, lParam);
00678             break;
00679
00680         case WM_INITMENUPOPUP:
00681         HANDLE_WM_INITMENUPOPUP(hwnd, wParam, lParam, MCI_OnInitMenuPopup);
00682         break;
00683
00684     case WM_SIZE:
00685         HANDLE_WM_SIZE(hwnd, wParam, lParam, MCI_OnSize);
00686         break;
00687
00688     case WM_DESTROY:
00689         PostQuitMessage(0);
00690         return (0);
00691     }
00692     return DefFrameProc(hwnd,ghwndMdi,msg,wParam,lParam);
00693 }
00694
00695 /*--------------------------------------------------------------+
00696 | FormatFilterString                                            |
00697 |                                                               |
00698 +--------------------------------------------------------------*/
00699 static BOOL FormatFilterString(
00700 UINT uID,
00701 LPSTR lpszString )
00702 {
00703     int nLength, nCtr = 0;
00704     char chWildCard;
00705
00706     *lpszString = 0;
00707
00708     nLength = LoadString( ghInstApp, uID, lpszString, BUFSIZE );
00709
00710     chWildCard = lpszString[nLength-1];
00711
00712     while( lpszString[nCtr] ) {
00713         if( lpszString[nCtr] == chWildCard )
00714             lpszString[nCtr] = 0;
00715         nCtr++;
00716     }
00717
00718     return TRUE;
00719 }
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/staticnode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

staticnode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CStaticNode class.  This is the Snap-in's
00014 //                top level node
00015 //
00016
00017
00018 #ifndef _CLASS_CSTATICNODE_
00019 #define _CLASS_CSTATICNODE_
00020
00021 #include "Globals.h"
00022 #include "BaseNode.h"          // For NODE_PROPERTIES
00023 #include "LListImpl.h"
00024
00025 class CDeviceNode;             // References
00026 class CComponentData;
00027
00028
00029 //---------------------------------------------------------------------------
00030 class CStaticNode : public CBaseNode
00031 {
00032   public:
00033     CStaticNode();
00034     virtual ~CStaticNode();
00035
00036     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00037
00038
00039   // Virtual methods
00040   public:
00041     ULONG   GetNodeType() { return NODETYPE_STATIC; }
00042     GUID&   GetNodeGUID() { return thisGUID; }
00043
00044     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00045     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00046     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00047
00048   ///////////////////////////////////////////////////////////////////////////
00049   // Notification handlers
00050   public:
00051     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00052     HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent );
00053     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00054     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData );
00055
00056   /////////////////////////////////////////////////////////////////////////
00057   //  Context Menu methods
00058   //
00059   public:
00060     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00061     HRESULT Command( long lCommandID );
00062
00063   ///////////////////////////////////////////////////////////////////////////
00064   // Private helpers
00065   private:
00066     HRESULT  DeleteScopeItems( LPCONSOLENAMESPACE2 ipCNS2 );
00067     HRESULT  InsertScopeItems( LPCONSOLENAMESPACE2 ipCNS2 );
00068     HRESULT  RefreshNodeList();
00069     VOID     RemoveNodes();
00070
00071   ///////////////////////////////////////////////////////////////////////////
00072   // Public helpers
00073   public:
00074     HRESULT  AddDeviceNode( NODE_PROPERTIES* pProperties );
00075     VOID     ToggleStatus( LPDATAOBJECT ipDataObject );
00076     HWND     GetMessageWnd() { return m_hMessageWnd; }
00077
00078     static LRESULT CALLBACK StaticNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00079
00080   private:
00081     static GUID      thisGUID;
00082     HSCOPEITEM       m_hStaticNode;
00083     CComponentData*  m_pCompData;
00084     HWND             m_hMessageWnd;        // Our message handler
00085
00086     CLListImpl<CDeviceNode*,CDeviceNode*>  m_NodeList;
00087
00088   public:
00089     HWND             m_hAddDeviceDlg;      // Instance of AddDeviceDlg
00090
00091 };
00092
00093 #endif //_CLASS_CSTATICNODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::XactAttributeEnum Member List

This is the complete list of members for msado15::XactAttributeEnum, including all inherited members.
adXactAbortRetaining | msado15::XactAttributeEnum | [static]
adXactAsyncPhaseOne | msado15::XactAttributeEnum | [static]
adXactCommitRetaining | msado15::XactAttributeEnum | [static]
adXactSyncPhaseOne | msado15::XactAttributeEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • CMenu

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 #include "Space.h"
00023 #include "Sky.h"
00024 #include "People.h"
00025 #include "Land.h"
00026
00027 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00028
00029
00030 //==============================================================
00031 //
00032 // CStaticNode implementation
00033 //
00034 //
00035 CStaticNode::CStaticNode()
00036 {
00037     children[0] = new CPeoplePoweredVehicle;
00038     children[1] = new CLandBasedVehicle;
00039     children[2] = new CSkyBasedVehicle;
00040     children[3] = new CSpaceVehicle;
00041 }
00042
00043 CStaticNode::~CStaticNode()
00044 {
00045     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00046         if (children[n]) {
00047             delete children[n];
00048         }
00049 }
00050
00051 HRESULT CStaticNode::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00052 {
00053     SCOPEDATAITEM sdi;
00054
00055     if (!bExpanded) {
00056         // create the child nodes, then expand them
00057         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00058             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00059             sdi.mask = SDI_STR       |   // Displayname is valid
00060                 SDI_PARAM     |   // lParam is valid
00061                 SDI_IMAGE     |   // nImage is valid
00062                 SDI_OPENIMAGE |   // nOpenImage is valid
00063                 SDI_PARENT    |
00064                 SDI_CHILDREN;
00065
00066             sdi.relativeID  = (HSCOPEITEM)parent;
00067             sdi.nImage      = children[n]->GetBitmapIndex();
00068             sdi.nOpenImage  = INDEX_OPENFOLDER;
00069             sdi.displayname = MMC_CALLBACK;
00070             sdi.lParam      = (LPARAM)children[n];       // The cookie
00071             sdi.cChildren   = (n == 0); // only the first child has children
00072
00073             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00074
00075             _ASSERT( SUCCEEDED(hr) );
00076         }
00077
00078         bExpanded = TRUE;
00079     }
00080
00081     return S_OK;
00082 }
00083
00084 HRESULT CStaticNode::OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile)
00085 {
00086     WCHAR topicName[MAX_PATH];
00087
00088     wcscpy(topicName, helpFile);
00089
00090     // we should read this from a resource file
00091     wcscat(topicName, L"::/default.htm");
00092
00093     LPOLESTR pszTopic = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(topicName) + 1) * sizeof(WCHAR)));
00094
00095     wcscpy(pszTopic, topicName);
00096
00097     return m_ipDisplayHelp->ShowTopic(pszTopic);
00098
00099 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/statnode.h Source File

  • SysMgmt
  • MMC
  • Openserv

statnode.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SNAPINBASE_H
00021 #define _SNAPINBASE_H
00022
00023 #include "DeleBase.h"
00024
00025 class CStaticNode : public CDelegationBase {
00026 public:
00027     CStaticNode();
00028
00029     virtual ~CStaticNode();
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) {
00032         static _TCHAR szDisplayName[256] = {0};
00033         LoadString(g_hinst, IDS_SNAPINNAME, szDisplayName, (sizeof szDisplayName)/(sizeof szDisplayName[0]));
00034
00035         if (*snapInData.m_host != 0) {
00036             _tcscat(szDisplayName, _T(" ("));
00037             _tcscat(szDisplayName, snapInData.m_host);
00038             _tcscat(szDisplayName, _T(")"));
00039         }
00040
00041         return szDisplayName;
00042     }
00043     virtual const GUID & getNodeType() { return thisGuid; }
00044     virtual const int GetBitmapIndex() { return INDEX_NONE; }
00045
00046 public:
00047     // virtual functions go here (for MMCN_*)
00048     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
00049
00050     virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle);
00051     virtual HRESULT HasPropertySheets();
00052     virtual HRESULT GetWatermarks(HBITMAP *lphWatermark,
00053         HBITMAP *lphHeader,
00054         HPALETTE *lphPalette,
00055         BOOL *bStretch);
00056 private:
00057     enum { NUMBER_OF_CHILDREN = 4 };
00058     CDelegationBase *children[NUMBER_OF_CHILDREN];
00059
00060     // {2974380C-4C4B-11d2-89D8-000021473128}
00061     static const GUID thisGuid;
00062
00063     struct privateData {
00064         _TCHAR m_host[MAX_PATH];
00065         BOOL m_fIsRadioLocalMachine;
00066         BOOL m_fAllowOverrideMachineNameOut;
00067         bool m_isDirty;
00068
00069         privateData() : m_isDirty(false) {
00070             ZeroMemory(m_host, sizeof(m_host));
00071             m_fIsRadioLocalMachine = TRUE;
00072             m_fAllowOverrideMachineNameOut = FALSE;
00073         }
00074     } snapInData;
00075
00076     static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
00077
00078     public:
00079         LONG getDataSize() { return sizeof(privateData); }
00080         void *getData() { return &snapInData; }
00081         bool isDirty() { return snapInData.m_isDirty; }
00082         void clearDirty() { snapInData.m_isDirty = false; };
00083
00084         _TCHAR *getHost() { return *snapInData.m_host == 0 ? NULL : snapInData.m_host; }
00085 };
00086
00087
00088
00089 #endif // _SNAPINBASE_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIDBInitialize Member List

This is the complete list of members for CImpIDBInitialize, including all inherited members.
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIDBInitialize) | CImpIDBInitialize
Initialize(void) | CImpIDBInitialize
Uninitialize(void) | CImpIDBInitialize
Generated on Wed Nov 13 2024 16:56:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Ras/RasEnumEntries/c/RasEnumentries.c Source File

  • NetDS
  • Ras
  • RasEnumEntries
  • c

RasEnumentries.c

Go to the documentation of this file.
00001 //
00002 //       This is a part of the Microsoft Source Code Samples.
00003 //       Copyright 1993 - 2002 Microsoft Corporation.
00004 //       All rights reserved.
00005 //       This source code is only intended as a supplement to
00006 //       Microsoft Development Tools and/or WinHelp documentation.
00007 //       See these sources for detailed information regarding the
00008 //       Microsoft samples programs.
00009 //
00010
00011 //
00012 //    RasEnumEntries.c
00013 //
00014 //    Usage:
00015 //    RasEnumEntry
00016 //
00017 //    RAS API's used:
00018 //      RasEnumEntries
00019 //
00020 //
00021 #ifndef _WIN32_WINNT
00022 #define _WIN32_WINNT 0x500
00023 #endif
00024
00025 #include <windows.h>
00026 #include <stdio.h>
00027 #include <ras.h>
00028 #include <raserror.h>
00029 #include <tchar.h>
00030
00031 // Macro for counting maximum characters that will fit into a buffer
00032 #define CELEMS(x) ((sizeof(x))/(sizeof(x[0])))
00033
00034 int main(void)
00035 {
00036   LPRASENTRYNAME lpRasEntryName = NULL;
00037   LPRASENTRYNAME lpTempRasEntryName = NULL;
00038   DWORD cb = sizeof(RASENTRYNAME);
00039   DWORD cEntries = 0;
00040   int nRet = 0;
00041   DWORD i = 0;
00042     BOOL fSuccess = FALSE;
00043     TCHAR           szTempBuf[256] = {0};
00044
00045   lpRasEntryName = (LPRASENTRYNAME)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
00046   if (NULL == lpRasEntryName)
00047   {
00048     printf("HeapAlloc failed.\n");
00049     return ERROR_OUTOFMEMORY;
00050   }
00051
00052   lpRasEntryName->dwSize = sizeof(RASENTRYNAME);
00053
00054   // Getting the size required for the RASENTRYNAME buffer
00055
00056   nRet = RasEnumEntries(NULL, NULL, lpRasEntryName, &cb, &cEntries);
00057
00058   switch (nRet)
00059   {
00060   case ERROR_BUFFER_TOO_SMALL:
00061     if (HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasEntryName))
00062         {
00063
00064             lpRasEntryName = (LPRASENTRYNAME)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
00065           if (NULL == lpRasEntryName)
00066         {
00067           printf("HeapAlloc failed.\n");
00068                 return ERROR_OUTOFMEMORY;
00069         }
00070
00071         lpRasEntryName->dwSize = sizeof(RASENTRYNAME);
00072
00073         // Calling RasEnumEntries to enumerate the phonebook entries for a default phonebook
00074         nRet = RasEnumEntries(NULL, NULL, lpRasEntryName, &cb, &cEntries);
00075         if (ERROR_SUCCESS != nRet)
00076         {
00077           printf("RasEnumEntries failed: Error %d\n", nRet);
00078           goto done;
00079         }
00080         else
00081         {
00082                 fSuccess = TRUE;
00083         }
00084         }
00085         else
00086         {
00087       printf("HeapFree failed.\n");
00088             return GetLastError();
00089         }
00090
00091     break;
00092
00093   case ERROR_SUCCESS:
00094     fSuccess = TRUE;
00095     break;
00096
00097   default:
00098     printf("RasEnumEntries failed: Error = %d\n", nRet);
00099     goto done;
00100   }
00101
00102
00103     if (fSuccess)
00104     {
00105     printf("Phone book entries in the default phonebook:\n\n");
00106     lpTempRasEntryName = lpRasEntryName;
00107     for (i = 0; i < cEntries; i++)
00108     {
00109             ZeroMemory((LPVOID)szTempBuf, sizeof(szTempBuf));
00110             _snprintf(szTempBuf, CELEMS(szTempBuf) - 1, "%s\n",lpTempRasEntryName->szEntryName);
00111       printf(szTempBuf);
00112       lpTempRasEntryName++;
00113     }
00114     }
00115
00116 done:
00117     HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasEntryName);
00118
00119     return nRet;
00120 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/MainDlg.h Source File

  • Web
  • MSAgent
  • c
  • Cap

MainDlg.h

Go to the documentation of this file.
00001 #ifndef _MainDlg_h_
00002 #define _MainDlg_h_
00003
00004
00005 class AgentNotifySink;
00006
00007
00008 // Main Dialog class
00009
00010 class MainDlg {
00011 public:
00012   MainDlg();
00013
00014     HRESULT Init();
00015   void  LoadCharacter(LPCTSTR pszFilename);
00016
00017
00018 public:
00019   HWND  m_hWnd;
00020   HACCEL  m_hAccel;
00021
00022
00023 private:
00024   void  OnActivateApp(BOOL bActive);
00025   BOOL  OnCommand(WPARAM wParam, LPARAM lParam);
00026   void  OnDestroy();
00027   void  OnButtonClick(UINT uID);
00028   void  OnDropFiles(HDROP hDrop);
00029   void  OnRecentFile(UINT uFile);
00030   BOOL  OnInitDialog();
00031   BOOL  OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL bSysMenu);
00032   BOOL  OnSysCommand(WPARAM wParam);
00033
00034
00035 private:
00036   void  UpdateRecentFiles(LPCTSTR pszFilename);
00037   void  MakeEllipsisPath(LPCTSTR pszPath, LPTSTR pszEllipsisPath, UINT cchMaxEllipsisPath);
00038   void  OnSpeak();
00039   void  OnCharacterMove(long x, long y);
00040   void  OnCharacterRightClick(long x, long y);
00041   void  OnCharacterCommand(long lID);
00042   void  OnPropertyChange();
00043
00044
00045 private:
00046   BOOL  m_bHasMRUSeparator;
00047   BOOL  m_bAddedCommands;
00048
00049
00050 private:
00051   WNDPROC m_wpListBox;
00052   WNDPROC m_wpSpeakText;
00053   WNDPROC m_wpMoveX;
00054   WNDPROC m_wpMoveY;
00055
00056
00057 private:
00058   IAgentEx      *m_pAgent;
00059   IAgentCharacterEx *m_pCharacter;
00060   IAgentBalloonEx   *m_pBalloon;
00061   AgentNotifySink   *m_pSink;
00062   long         m_lCharacterID;
00063   long         m_lSinkID;
00064   long         m_lCmdPropertiesID;
00065
00066
00067 private:
00068   friend class AgentNotifySink;
00069   friend  LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00070   friend  LRESULT CALLBACK ListBoxWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00071   friend  LRESULT CALLBACK SpeakTextWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00072   friend  LRESULT CALLBACK MoveXWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00073   friend  LRESULT CALLBACK MoveYWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00074 };
00075
00076
00077 #endif
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagLINEINFO Member List

This is the complete list of members for tagLINEINFO, including all inherited members.
dwAPIVersion | tagLINEINFO
dwPermanentLineID | tagLINEINFO
fVoiceLine | tagLINEINFO
hLine | tagLINEINFO
nAddr | tagLINEINFO
szLineName | tagLINEINFO
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCIncoming/StdAfx.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCIncoming

StdAfx.h

Go to the documentation of this file.
00001 /******************************************************>
00002  * Copyright (c) 2001 Microsoft Corporation.
00003  * All rights reserved.
00004  *
00005  *
00006  * @Abstract: Stdafx.h
00007  * ---------- [ PCH Header Definition File]
00008  *
00009  *
00010  *
00011  ******************************************************/
00012
00013
00014 #if !defined(AFX_STDAFX_H__DE9AFDFA_F750_4A20_B6CA_410D4C1C2666__INCLUDED_)
00015 #define AFX_STDAFX_H__DE9AFDFA_F750_4A20_B6CA_410D4C1C2666__INCLUDED_
00016
00017 #if _MSC_VER > 1000
00018 #pragma once
00019 #endif // _MSC_VER > 1000
00020
00021 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00022
00023 #include <afxwin.h>         // MFC core and standard components
00024 #include <afxext.h>         // MFC extensions
00025 #include <afxdisp.h>        // MFC Automation classes
00026 #include <afxdtctl.h>   // MFC support for Internet Explorer 4 Common Controls
00027 #ifndef _AFX_NO_AFXCMN_SUPPORT
00028 #include <afxcmn.h>     // MFC support for Windows Common Controls
00029 #endif // _AFX_NO_AFXCMN_SUPPORT
00030
00031
00032
00033 #include "process.h"
00034 #include "rtccore.h"
00035 #include "rtcerr.h"
00036
00037
00038 #include <windows.h>
00039
00040 #include <atlbase.h>
00041 #include "objbase.h"
00042 #include <tchar.h>
00043 #include "ocidl.h"
00044 #include "process.h"
00045 #include "crtdbg.h"
00046
00047
00048
00049
00050 #endif // !defined(AFX_STDAFX_H__DE9AFDFA_F750_4A20_B6CA_410D4C1C2666__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConClien/GUIBALL.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • ConClien

GUIBALL.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GUIBALL.CPP
00003
00004   Summary:   Implementation file for the CGuiBall C++ class. A GuiBall is
00005              a C++ object that displays a moving and bouncing ball in the
00006              client area of a designated window.  It is anchored to the
00007              Windows GUI (Graphical User Interface) environment. This
00008              GuiBall object continuously paints a ball image based on data
00009              it obtains from a virtual ball object. This virtual ball
00010              object is instantiated as a COM object (a COBall) in a
00011              separate thread-safe In-process server, CONSERVE.
00012
00013              GuiBall relies on the system timer to send periodic WM_TIMER
00014              messages to a window procedure designated in the
00015              CGuiBall::Init call. When these messages are received, the
00016              window procedure calls the CGuiBall::PaintBall method which
00017              both moves and displays the ball image.
00018
00019              For a comprehensive tutorial code tour of GUIBALL's contents
00020              and offerings see the tutorial CONCLIEN.HTM file. For more
00021              specific technical details on the internal workings see the
00022              comments dispersed throughout the GUIBALL source code.
00023
00024   Classes:   CGuiBall.
00025
00026   Origin:    5-30-96: atrent - Editor inheritance from GUIBALL.CPP in the
00027              FRECLIEN source.
00028
00029 ----------------------------------------------------------------------------
00030   This file is part of the Microsoft COM Tutorial Code Samples.
00031
00032   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00033
00034   This source code is intended only as a supplement to Microsoft
00035   Development Tools and/or on-line documentation.  See these other
00036   materials for detailed information regarding Microsoft code samples.
00037
00038   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00039   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00040   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00041   PARTICULAR PURPOSE.
00042 ==========================================================================+*/
00043
00044 /*--------------------------------------------------------------------------
00045   We include WINDOWS.H for all Win32 applications.
00046   We include OLE2.H because we will be calling the COM/OLE libraries.
00047   We include OLECTL.H because it has definitions for connectable objects.
00048   We include APPUTIL.H because we will be building this application using
00049     the convenient Virtual Window and Dialog classes and other
00050     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00051   We include IBALL.H and BALLGUID.H for the common Ball-related Interface
00052     class, GUID, and CLSID specifications.
00053   We include GUIBALL.H because it has the C++ class used for GUI display
00054     of the moving ball.
00055   We include CONCLIEN.H because it has class and resource definitions
00056     specific to this CONCLIEN application.
00057 ---------------------------------------------------------------------------*/
00058 #include <windows.h>
00059 #include <ole2.h>
00060 #include <olectl.h>
00061 #include <apputil.h>
00062 #include <iball.h>
00063 #include <ballguid.h>
00064 #include "guiball.h"
00065 #include "sink.h"
00066 #include "conclien.h"
00067
00068
00069 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00070   Method:   CGuiBall::CGuiBall
00071
00072   Summary:  Constructor.
00073
00074   Args:     void
00075
00076   Modifies: ...
00077
00078   Returns:  void
00079 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00080 CGuiBall::CGuiBall(void)
00081 {
00082   m_hWnd       = 0;
00083   m_pIBall     = NULL;
00084   m_crColor    = RGB(0,0,0);
00085   m_OldPos.x   = 0;
00086   m_OldPos.y   = 0;
00087   m_OldExt.x   = 0;
00088   m_OldExt.y   = 0;
00089   m_pCOBallSink = NULL;
00090   m_dwBallSink = 0;
00091   m_dwBounceSndDur = BOUNCE_SOUND_DURATION;
00092   m_dwBounceBotFreq = BOUNCE_BOTTOM_FREQUENCY;
00093   m_dwBounceSideFreq = BOUNCE_SIDE_FREQUENCY;
00094   m_dwBounceTopFreq = BOUNCE_TOP_FREQUENCY;
00095 }
00096
00097
00098 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00099   Method:   CGuiBall::~CGuiBall
00100
00101   Summary:  Destructor.
00102
00103   Args:     void
00104
00105   Modifies: ...
00106
00107   Returns:  void
00108 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00109 CGuiBall::~CGuiBall(void)
00110 {
00111   BOOL bOk = TRUE;
00112
00113   // Kill the client's app timer that drives repaints. Stops the WM_TIMER
00114   // messages to the display window.
00115   KillTimer(m_hWnd, 1);
00116
00117   if (m_pIBall)
00118   {
00119     // Call down to the server's COBall and tell it about the shutdown.
00120     // This sets COBall's m_bAlive to FALSE, neutralizes all
00121     // subsequent Move calls, and thus prevents any more NotifySinks calls
00122     // from within the Move method.
00123     m_pIBall->Move(FALSE);
00124
00125     // Disconnect all Sinks--currently only one: BallSink. This officially
00126     // stops all BallSink notifications.
00127     DisconnectBallSink();
00128
00129     // Release the reference to the BallSink object.
00130     RELEASE_INTERFACE(m_pCOBallSink);
00131
00132     // Release the main interface pointer copy held in CGuiBall.
00133     RELEASE_INTERFACE(m_pIBall);
00134   }
00135 }
00136
00137
00138 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00139   Method:   CGuiBall::Init
00140
00141   Summary:  Get everything related to CGuiBall started. Make any
00142             subordinate objects, like COBall, and get it started. Starts
00143             the system timer that keeps the virtual ball moving with GUI
00144             painted images.
00145
00146   Args:     HWND hWnd
00147               Handle of the display window. Part of what makes CGuiBall
00148               a GUI kind of thing.
00149
00150   Modifies: ...
00151
00152   Returns:  BOOL
00153               TRUE for success; FALSE for fail.
00154 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00155 BOOL CGuiBall::Init(
00156        HWND hWnd)
00157 {
00158   BOOL bOk = FALSE;
00159   HRESULT hr;
00160   COBallSink* pCob = NULL;
00161
00162   if (hWnd)
00163   {
00164     m_hWnd = hWnd;
00165
00166     // Call COM service to create a COBall instance. We are not
00167     // aggregating it so we ask for its IBall interface directly.
00168     hr = CoCreateInstance(
00169            CLSID_DllSndBall,
00170            NULL,
00171            CLSCTX_INPROC_SERVER,
00172            IID_IBall,
00173            (PPVOID)&m_pIBall);
00174     if (SUCCEEDED(hr))
00175     {
00176       // Create the COBallSink Sink object to receive COBall events.
00177       pCob = new COBallSink(NULL, this);
00178       if (NULL != pCob)
00179       {
00180         // Save a pointer to the COBall IUnknown interface. AddRef
00181         // because of this saved copy.
00182         m_pCOBallSink = pCob;
00183         m_pCOBallSink->AddRef();
00184       }
00185       else
00186         hr = E_OUTOFMEMORY;
00187
00188       if (SUCCEEDED(hr))
00189       {
00190         // Set up the client process to periodically move & paint the ball
00191         // thru WM_TIMER messages to the specified hWnd's Window proc.
00192         SetTimer(hWnd, 1, BALL_PAINT_DELAY, NULL);
00193         bOk = TRUE;
00194       }
00195     }
00196   }
00197
00198   return (bOk);
00199 }
00200
00201
00202 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00203   Method:   CGuiBall::PaintBall
00204
00205   Summary:  Tell CGuiBall to move one increment and paint one image of the
00206             GuiBall.
00207
00208   Args:     void
00209
00210   Modifies: ...
00211
00212   Returns:  void
00213 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00214 void CGuiBall::PaintBall(void)
00215 {
00216   HDC       hDC;
00217   HBRUSH    hBrush;
00218   POINT     Org, Ext;
00219   HRGN      hTmp, hOld, hNew;
00220
00221   if (m_pIBall)
00222   {
00223     // Move the ball before painting it. By placing this Move call here
00224     // we link moving with painting in synchronized lock step.
00225     m_pIBall->Move(TRUE);
00226
00227     // Ask the COBall for its current ball (location, region, and color).
00228     m_pIBall->GetBall(&Org, &Ext, &m_crColor);
00229
00230     // Create the old ball image/region.
00231     hOld = CreateEllipticRgn(m_OldPos.x, m_OldPos.y, m_OldExt.x, m_OldExt.y);
00232
00233     // Create the new ball image/region.
00234     hNew = CreateEllipticRgn(Org.x, Org.y, Ext.x, Ext.y);
00235
00236     // Remember the new Pos and Ext as the next old set of Pos and Ext.
00237     m_OldPos.x = Org.x;
00238     m_OldPos.y = Org.y;
00239     m_OldExt.x = Ext.x;
00240     m_OldExt.y = Ext.y;
00241
00242     if(hDC = GetDC(m_hWnd))
00243     {
00244       // Erase old ball image.
00245       hTmp = CreateRectRgn(1, 1, 2, 2);
00246       if (NULL != hOld)
00247       CombineRgn(hTmp, hOld, hNew, RGN_DIFF);
00248       FillRgn(hDC, hTmp, GETCLASSBRUSH(m_hWnd));
00249
00250       // Make a paint brush, dip it in pixel paint, and paint the
00251       // new Ball image. Destroy brush after use.
00252       hBrush = CreateSolidBrush(m_crColor);
00253       FillRgn(hDC, hNew, hBrush);
00254       DeleteObject(hBrush);
00255       ReleaseDC(m_hWnd, hDC);
00256       DeleteObject(hTmp);
00257     }
00258
00259     // Delete the region objects.
00260     if (NULL != hOld)
00261       DeleteObject(hOld);
00262   if (NULL != hNew)
00263       DeleteObject(hNew);
00264   }
00265
00266   return;
00267 }
00268
00269
00270 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00271   Method:   CGuiBall::Restart
00272
00273   Summary:  Restart the display process. Places Ball in start position
00274             in a clean window.
00275
00276   Args:     void.
00277
00278   Modifies: ...
00279
00280   Returns:  void.
00281 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00282 void CGuiBall::Restart(void)
00283 {
00284   RECT  WinRect;
00285   HDC   hDC = GetDC(m_hWnd);
00286
00287   if(hDC && m_pIBall)
00288   {
00289     // Clear the window.
00290     // Get our window's client area rectangle.
00291     GetClientRect(m_hWnd, &WinRect);
00292     // Fill that rectangle with pixels of white paint.
00293     FillRect(hDC, &WinRect, GETCLASSBRUSH(m_hWnd));
00294
00295     // Tell the COBall to reset itself.
00296     m_pIBall->Reset(&WinRect, 0);
00297
00298     // Call our own CGuiBall method to paint an initial image of the ball.
00299     PaintBall();
00300
00301     // Release the Device Context.
00302     ReleaseDC(m_hWnd, hDC);
00303   }
00304
00305   return;
00306 }
00307
00308
00309 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00310   Method:   CGuiBall::PaintWin
00311
00312   Summary:  Clears window background and paints the GuiBall at its
00313             current location.
00314
00315   Args:     void
00316
00317   Modifies: ...
00318
00319   Returns:  void
00320 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00321 void CGuiBall::PaintWin(void)
00322 {
00323   HDC         hDC;
00324   PAINTSTRUCT ps;
00325   RECT        WinRect;
00326
00327   if(hDC = BeginPaint(m_hWnd, &ps))
00328     EndPaint(m_hWnd, &ps);
00329
00330   if(hDC = GetDC(m_hWnd))
00331   {
00332     // Get our window's client area rectangle.
00333     GetClientRect(m_hWnd, &WinRect);
00334     // Fill that rectangle with pixels of white paint.
00335     FillRect(hDC, &WinRect, GETCLASSBRUSH(m_hWnd));
00336
00337     // Paint a current image of the ball wherever it is.
00338     PaintBall();
00339
00340     ReleaseDC(m_hWnd, hDC);
00341   }
00342
00343   return;
00344 }
00345
00346
00347 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00348   Method:   CGuiBall::BounceBottom
00349
00350   Summary:  Produce a sound for the ball bounce against the Bottom
00351             boundary.
00352
00353   Args:     void
00354
00355   Modifies: ...
00356
00357   Returns:  void
00358 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00359 void CGuiBall::BounceBottom(void)
00360 {
00361   // Use the Win32 Beep call.
00362   Beep(m_dwBounceBotFreq, m_dwBounceSndDur);
00363
00364   return;
00365 }
00366
00367
00368 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00369   Method:   CGuiBall::BounceSide
00370
00371   Summary:  Produce a sound for the ball bounce against a Side boundary.
00372
00373   Args:     void
00374
00375   Modifies: ...
00376
00377   Returns:  void
00378 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00379 void CGuiBall::BounceSide(void)
00380 {
00381   // Use the Win32 Beep call.
00382   Beep(m_dwBounceSideFreq, m_dwBounceSndDur);
00383
00384   return;
00385 }
00386
00387
00388 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00389   Method:   CGuiBall::BounceTop
00390
00391   Summary:  Produce a sound for the ball bounce against the Top boundary.
00392
00393   Args:     void
00394
00395   Modifies: ...
00396
00397   Returns:  void
00398 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00399 void CGuiBall::BounceTop(void)
00400 {
00401   // Use the Win32 Beep call.
00402   Beep(m_dwBounceTopFreq, m_dwBounceSndDur);
00403
00404   return;
00405 }
00406
00407
00408 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00409   Method:   CGuiBall::GetConnectionPoint
00410
00411   Summary:  Internal private method to obtain a connection point interface.
00412
00413   Args:     REFIID riid
00414               IID of the requested connection point Interface.
00415
00416   Modifies: ...
00417
00418   Returns:  IConnectionPoint*
00419               Requested IConnectionPoint interface pointer. NULL if none.
00420 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00421 IConnectionPoint* CGuiBall::GetConnectionPoint(
00422                     REFIID riid)
00423 {
00424   IConnectionPointContainer* pConnPointContainer = NULL;
00425   IConnectionPoint* pConnPoint = NULL;
00426   IConnectionPoint* pConnPt = NULL;
00427   HRESULT hr;
00428
00429   // First query the object for its Connection Point Container. This
00430   // essentially asks the object in the server if it is connectable.
00431   hr = m_pIBall->QueryInterface(
00432          IID_IConnectionPointContainer,
00433          (PPVOID)&pConnPointContainer);
00434   if SUCCEEDED(hr)
00435   {
00436     // Find the requested Connection Point. This AddRef's the
00437     // returned pointer.
00438     hr = pConnPointContainer->FindConnectionPoint(riid, &pConnPt);
00439     if (SUCCEEDED(hr))
00440       pConnPoint = pConnPt;
00441
00442     // Release the connection point container. We're done with it.
00443     RELEASE_INTERFACE(pConnPointContainer);
00444   }
00445
00446   return pConnPoint;
00447 }
00448
00449
00450 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00451   Method:   CGuiBall::ConnectBallSink
00452
00453   Summary:  Connect the BallSink to the server COBall source.
00454
00455   Args:     void
00456
00457   Modifies: ...
00458
00459   Returns:  HRESULT
00460               Standard result code. NOERROR for success.
00461 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00462 HRESULT CGuiBall::ConnectBallSink(void)
00463 {
00464   HRESULT hr = E_FAIL;
00465   DWORD dwKey;
00466   IConnectionPoint* pConnPoint = NULL;
00467
00468   if (!m_dwBallSink)
00469   {
00470     // Get the Ball Sink connection point.
00471     pConnPoint = GetConnectionPoint(IID_IBallSink);
00472     if (NULL != pConnPoint)
00473     {
00474       // Connect the object in the server to the Ball Sink in this client.
00475       hr = pConnPoint->Advise(m_pCOBallSink, &dwKey);
00476       if (SUCCEEDED(hr))
00477         m_dwBallSink = dwKey;
00478
00479       // Release the connection point. We're done with it.
00480       RELEASE_INTERFACE(pConnPoint);
00481     }
00482   }
00483
00484   return hr;
00485 }
00486
00487
00488 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00489   Method:   CGuiBall::DisconnectBallSink
00490
00491   Summary:  Disconnect the BallSink from the server COBall source.
00492
00493   Args:     void.
00494
00495   Modifies: ...
00496
00497   Returns:  HRESULT
00498               Standard result code. NOERROR for success.
00499 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00500 HRESULT CGuiBall::DisconnectBallSink(void)
00501 {
00502   HRESULT hr = E_FAIL;
00503   IConnectionPoint* pConnPoint;
00504
00505   if (m_dwBallSink)
00506   {
00507     // Get the Ball Sink connection point.
00508     pConnPoint = GetConnectionPoint(IID_IBallSink);
00509     if (NULL != pConnPoint)
00510     {
00511       // Disconnect the object in the server from the Ball Sink in
00512       // this client.
00513       hr = pConnPoint->Unadvise(m_dwBallSink);
00514       if (SUCCEEDED(hr))
00515         m_dwBallSink = 0;
00516
00517       // Release the connection point. We're done with it.
00518       RELEASE_INTERFACE(pConnPoint);
00519     }
00520   }
00521
00522   return hr;
00523 }
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Server/BYOTTxEnlister/TxEnlister.Idl Source File

  • Com
  • Services
  • BYOT
  • Server
  • BYOTTxEnlister

TxEnlister.Idl

Go to the documentation of this file.
00001 // TxEnlister.idl : IDL source for TxEnlister.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (TxEnlister.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009
00010 [
00011   uuid(353C2600-C852-11D2-848F-0080C7A03FC6),
00012   version(1.0),
00013   helpstring("BYOTSample TxEnlister 1.0 Type Library")
00014 ]
00015 library TXENLISTERLib
00016 {
00017   importlib("stdole32.tlb");
00018   importlib("stdole2.tlb");
00019
00020   [
00021     object,
00022     uuid(5F6FA5A0-C852-11D2-848F-0080C7A03FC6),
00023     dual,
00024     helpstring("IEnlistTransaction Interface"),
00025     pointer_default(unique)
00026   ]
00027   interface IEnlistTransaction : IDispatch
00028   {
00029     [id(1), helpstring("Enlists in a TIP Transaction")] HRESULT EnlistTransaction([in] BSTR bstrTipUrl);
00030     [id(2), helpstring("Creates an instance of the requested object under the protection of the associated TIP Transaction")] HRESULT CreateInstance([in] BSTR bstrProgId, [out, retval] IDispatch** ppDispatch);
00031   };
00032
00033   [
00034     uuid(7058AFD0-C852-11D2-848F-0080C7A03FC6),
00035     helpstring("EnlistTransaction Class")
00036   ]
00037   coclass EnlistTransaction
00038   {
00039     [default] interface IEnlistTransaction;
00040   };
00041 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/UtilLib/WbemSec.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • UtilLib

WbemSec.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  WBEMSEC.CPP
00006
00007 //
00008
00009 //  Purpose: Provides some security helper functions.
00010
00011 //
00012
00013 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00014 //
00015 //***************************************************************************
00016
00017 //#undef _WIN32_WINNT
00018 //#define _WIN32_WINNT 0x0400
00019 #include "precomp.h"
00020 #include <wbemidl.h>
00021 #include "wbemsec.h"
00022
00023 //***************************************************************************
00024 //
00025 //  InitializeSecurity(DWORD dwAuthLevel, DWORD dwImpLevel)
00026 //
00027 //  DESCRIPTION:
00028 //
00029 //  Initialize DCOM security.  The authentication level is typically
00030 //  RPC_C_AUTHN_LEVEL_PKT_PRIVACY,  and the impersonation level is typically
00031 //  RPC_C_IMP_LEVEL_IMPERSONATE.
00032 //  When using asynchronous WMI callbacks remotely in an environment where the "Local System" account
00033 //  has no network identity (such as non-Kerberos domains), the authentication level of
00034 //  RPC_C_AUTHN_LEVEL_NONE is needed. However, lowering the authentication level to
00035 //  RPC_C_AUTHN_LEVEL_NONE makes your application less secure. It is wise to
00036 //  use semi-synchronous API's for accessing WMI data and events instead of the asynchronous ones.
00037 //
00038 //  RETURN VALUE:
00039 //
00040 //  see description.
00041 //
00042 //***************************************************************************
00043
00044 HRESULT InitializeSecurity(DWORD dwAuthLevel, DWORD dwImpLevel)
00045 {
00046     // Initialize security
00047     // ===================
00048
00049   DWORD dwCapabilities;
00050
00051   if (dwAuthLevel == RPC_C_AUTHN_LEVEL_NONE)
00052         dwCapabilities = EOAC_NONE;
00053   else
00054         dwCapabilities = EOAC_SECURE_REFS;
00055
00056
00057     return CoInitializeSecurity
00058     (NULL, -1, NULL, NULL,
00059         dwAuthLevel, dwImpLevel,
00060         NULL,
00061     dwCapabilities,
00062     0);
00063 }
00064
00065 //***************************************************************************
00066 //
00067 //  bool bIsNT
00068 //
00069 //  DESCRIPTION:
00070 //
00071 //  Returns true if running windows NT.
00072 //
00073 //  RETURN VALUE:
00074 //
00075 //  see description.
00076 //
00077 //***************************************************************************
00078
00079 bool bIsNT(void)
00080 {
00081     OSVERSIONINFO os;
00082     os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
00083     if(!GetVersionEx(&os))
00084         return FALSE;           // should never happen
00085     return os.dwPlatformId == VER_PLATFORM_WIN32_NT;
00086 }
00087
00088
00089 //***************************************************************************
00090 //
00091 //  SCODE ParseAuthorityUserArgs
00092 //
00093 //  DESCRIPTION:
00094 //
00095 //  NOTE: For Windows XP or later, consider calling CredUIParseUserName() instead of this method.
00096 //
00097 //  Examines the Authority and User argument and determines the authentication
00098 //  type and possibly extracts the domain name from the user arugment in the
00099 //  NTLM case.  For NTLM, the domain can be at the end of the authentication
00100 //  string, or in the front of the user name, ex:  "TestDomain\JoeUser"
00101 //
00102 //  PARAMETERS:
00103 //
00104 //  ConnType            Returned with the connection type, ie wbem, ntlm
00105 //  AuthArg             Output, contains the domain name
00106 //  UserArg             Output, user name
00107 //  Authority           Input
00108 //  User                Input
00109 //
00110 //  RETURN VALUE:
00111 //
00112 //  S_OK                all is well
00113 //  else error listed in WBEMSVC.H
00114 //
00115 //***************************************************************************
00116
00117
00118 SCODE ParseAuthorityUserArgs(BSTR & AuthArg, BSTR & UserArg,BSTR & Authority,BSTR & User)
00119 {
00120
00121     // Determine the connection type by examining the Authority string
00122
00123     if(!(Authority == NULL || wcslen(Authority) == 0 || !_wcsnicmp(Authority, L"NTLMDOMAIN:",11)))
00124         return E_INVALIDARG;
00125
00126     // The ntlm case is more complex.  There are four cases
00127     // 1)  Authority = NTLMDOMAIN:name" and User = "User"
00128     // 2)  Authority = NULL and User = "User"
00129     // 3)  Authority = "NTLMDOMAIN:" User = "domain\user"
00130     // 4)  Authority = NULL and User = "domain\user"
00131
00132     // first step is to determine if there is a backslash in the user name somewhere between the
00133     // second and second to last character
00134
00135     WCHAR * pSlashInUser = NULL;
00136     if(User)
00137     {
00138         WCHAR * pEnd = User + wcslen(User) - 1;
00139         for(pSlashInUser = User; pSlashInUser <= pEnd; pSlashInUser++)
00140             if(*pSlashInUser == L'\\')      // dont think forward slash is allowed!
00141                 break;
00142         if(pSlashInUser > pEnd)
00143             pSlashInUser = NULL;
00144     }
00145
00146     if(Authority && wcslen(Authority) > 11)
00147     {
00148         if(pSlashInUser)
00149             return E_INVALIDARG;
00150
00151         AuthArg = SysAllocString(Authority + 11);
00152     if (!AuthArg)
00153       return E_OUTOFMEMORY;
00154         if(User)
00155     {
00156       UserArg = SysAllocString(User);
00157       if (!UserArg)
00158         return E_OUTOFMEMORY;
00159     }
00160
00161         return S_OK;
00162     }
00163     else if(pSlashInUser)
00164     {
00165         INT_PTR iDomLen = min(MAX_PATH-1, pSlashInUser-User);
00166         WCHAR cTemp[MAX_PATH];
00167         wcsncpy(cTemp, User, iDomLen);
00168         cTemp[iDomLen] = 0;
00169         AuthArg = SysAllocString(cTemp);
00170     if (!AuthArg)
00171       return E_OUTOFMEMORY;
00172         if(wcslen(pSlashInUser+1))
00173     {
00174             UserArg = SysAllocString(pSlashInUser+1);
00175       if (!UserArg)
00176         return E_OUTOFMEMORY;
00177     }
00178
00179     }
00180     else
00181         if(User)
00182     {
00183       UserArg = SysAllocString(User);
00184       if (!UserArg)
00185         return E_OUTOFMEMORY;
00186     }
00187
00188     return S_OK;
00189 }
00190
00191
00192 //***************************************************************************
00193 //
00194 //  SCODE GetAuthImp
00195 //
00196 //  DESCRIPTION:
00197 //
00198 //  Gets the authentication and impersonation levels for a current interface.
00199 //
00200 //  PARAMETERS:
00201 //
00202 //  pFrom               the interface to be tested.
00203 //  pdwAuthLevel    Set to the authentication level
00204 //  pdwImpLevel    Set to the impersonation level
00205 //  RETURN VALUE:
00206 //
00207 //  S_OK                all is well
00208 //  else error listed in WBEMSVC.H
00209 //
00210 //***************************************************************************
00211
00212 SCODE GetAuthImp(IUnknown * pFrom, DWORD * pdwAuthLevel, DWORD * pdwImpLevel)
00213 {
00214
00215     if(pFrom == NULL || pdwAuthLevel == NULL || pdwImpLevel == NULL)
00216         return WBEM_E_INVALID_PARAMETER;
00217
00218     IClientSecurity * pFromSec = NULL;
00219     SCODE sc = pFrom->QueryInterface(IID_IClientSecurity, (void **) &pFromSec);
00220     if(sc == S_OK)
00221     {
00222         DWORD dwAuthnSvc, dwAuthzSvc, dwCapabilities;
00223         sc = pFromSec->QueryBlanket(pFrom, &dwAuthnSvc, &dwAuthzSvc,
00224                                             NULL,
00225                                             pdwAuthLevel, pdwImpLevel,
00226                                             NULL, &dwCapabilities);
00227
00228         // Special case of going to a win9x share level box
00229
00230         if (sc == 0x800706d2)
00231         {
00232             *pdwAuthLevel = RPC_C_AUTHN_LEVEL_NONE;
00233             *pdwImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
00234             sc = S_OK;
00235         }
00236         pFromSec->Release();
00237     }
00238     return sc;
00239 }
00240 //***************************************************************************
00241 //
00242 //  SCODE SetInterfaceSecurity
00243 //
00244 //  DESCRIPTION:
00245 //
00246 //  This routine is used by clients in order to set the security settings of a particular
00247 //  interface proxy. NOTE that setting the security blanket on the interface is not always needed:
00248 //  simple client applications that execute in their own process can typically just call
00249 //  CoInitializeSecurity( NULL, -1, NULL, NULL,
00250 //            RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
00251 //            RPC_C_IMP_LEVEL_IMPERSONATE,
00252 //            NULL,
00253 //            EOAC_NONE,
00254 //            NULL );
00255 //  before calling out to WMI.
00256 //  However, for clients that reside in DLLs and do not control
00257 //  the hosting process' COM security setting (MMC snap-ins, Visual Studio extensions and such),
00258 //  it is necessary to set security on WMI interface proxies by calling
00259 //  CoSetProxyBlanket() directly or through this helper.
00260 //
00261 //  Another case where setting proxy security for WMI connection is needed is when
00262 //  credentials different from the client process user context must be specified.
00263 //
00264 //
00265 //  PARAMETERS:
00266 //
00267 //  pInterface       Interface to be set
00268 //  pDomain          Input, domain
00269 //  pUser            Input, user name
00270 //  pPassword        Input, password.
00271 //  pFrom            Input, if not NULL, then the authentication level of this interface
00272 //                      is used
00273 //  bAuthArg          If pFrom is NULL, then this is the authentication level
00274 //  RETURN VALUE:
00275 //
00276 //  S_OK                all is well
00277 //  else error listed in WBEMSVC.H
00278 //
00279 //***************************************************************************
00280
00281 HRESULT SetInterfaceSecurity(IUnknown * pInterface, LPWSTR pAuthority, LPWSTR pUser,
00282                              LPWSTR pPassword, DWORD dwAuthLevel, DWORD dwImpLevel)
00283 {
00284
00285     SCODE sc;
00286     if(pInterface == NULL)
00287         return E_INVALIDARG;
00288
00289     // If we are lowering the security, no need to deal with the identification info
00290
00291     if(dwAuthLevel == RPC_C_AUTHN_LEVEL_NONE)
00292         return CoSetProxyBlanket(pInterface, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL,
00293                        RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
00294
00295     // If we are doing trivial case, just pass in a null authentication structure which is used
00296     // if the current logged in user's credentials are OK.
00297
00298     if((pAuthority == NULL || wcslen(pAuthority) < 1) &&
00299         (pUser == NULL || wcslen(pUser) < 1) &&
00300         (pPassword == NULL || wcslen(pPassword) < 1))
00301             return CoSetProxyBlanket(pInterface, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL,
00302                        dwAuthLevel, dwImpLevel, NULL, EOAC_NONE);
00303
00304     // If user, or Authority was passed in, the we need to create an authority argument for the login
00305
00306     COAUTHIDENTITY  authident;
00307     BSTR AuthArg = NULL, UserArg = NULL;
00308     sc = ParseAuthorityUserArgs(AuthArg, UserArg, pAuthority, pUser);
00309     if(sc != S_OK)
00310         return sc;
00311
00312     memset((void *)&authident,0,sizeof(COAUTHIDENTITY));
00313     if(bIsNT())
00314     {
00315         if(UserArg)
00316         {
00317             authident.UserLength = (ULONG)wcslen(UserArg);
00318             authident.User = (LPWSTR)UserArg;
00319         }
00320         if(AuthArg)
00321         {
00322             authident.DomainLength = (ULONG)wcslen(AuthArg);
00323             authident.Domain = (LPWSTR)AuthArg;
00324         }
00325         if(pPassword)
00326         {
00327             authident.PasswordLength = (ULONG)wcslen(pPassword);
00328             authident.Password = (LPWSTR)pPassword;
00329         }
00330         authident.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
00331     }
00332     else
00333     {
00334         char szUser[MAX_PATH], szAuthority[MAX_PATH], szPassword[MAX_PATH];
00335     ZeroMemory(szUser, sizeof(szUser));
00336     ZeroMemory(szAuthority, sizeof(szAuthority));
00337     ZeroMemory(szPassword, sizeof(szPassword));
00338
00339     size_t written = 0;
00340
00341         // Fill in the indentity structure
00342
00343         if(UserArg)
00344         {
00345             written = wcstombs(szUser, UserArg, sizeof(szUser));
00346       if (written < sizeof(szUser) - 1)
00347       {
00348         //we could retry by calling wcstombs to find out required buffer size, but this is a simple sample
00349         sc = E_INVALIDARG;
00350         goto cleanup;
00351       }
00352
00353             authident.UserLength = (ULONG)strlen(szUser);
00354             authident.User = (LPWSTR)szUser;
00355         }
00356         if(AuthArg)
00357         {
00358             written = wcstombs(szAuthority, AuthArg, sizeof(szAuthority));
00359       if (written < sizeof(szAuthority) - 1)
00360       {
00361         //we could retry by calling wcstombs to find out required buffer size, but this is a simple sample
00362         sc = E_INVALIDARG;
00363         goto cleanup;
00364       }
00365             authident.DomainLength = (ULONG)strlen(szAuthority);
00366             authident.Domain = (LPWSTR)szAuthority;
00367         }
00368         if(pPassword)
00369         {
00370             written = wcstombs(szPassword, pPassword, sizeof(szPassword));
00371       if (written < sizeof(szPassword) - 1)
00372       {
00373         //we could retry by calling wcstombs to find out required buffer size, but this is a simple sample
00374         sc = E_INVALIDARG;
00375         goto cleanup;
00376       }
00377             authident.PasswordLength = (ULONG)strlen(szPassword);
00378             authident.Password = (LPWSTR)szPassword;
00379         }
00380         authident.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
00381     }
00382     sc = CoSetProxyBlanket(pInterface, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL,
00383                        dwAuthLevel, dwImpLevel, &authident, EOAC_NONE);
00384
00385 cleanup:
00386     if(UserArg)
00387         SysFreeString(UserArg);
00388     if(AuthArg)
00389         SysFreeString(AuthArg);
00390     return sc;
00391 }
00392
00393 /******************************************************************************
00394  *
00395  *  Name: CheckAccess
00396  *
00397  *  Description:  Allow provider to evaluate permissions against a security descriptor
00398  *
00399  *  This method should be called by WMI providers in scenarios where
00400  *      they cannot or should not impersonate the client. This happens in two scenarios:
00401  *      a) when the providers access resources that are not protected by ACL's
00402  *      b) when the client connects at the impersonation level of RPC_C_IMP_LEVEL_IDENTIFY
00403  *
00404  *****************************************************************************/
00405
00406 HRESULT CheckAccess (SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
00407           DWORD a_Access ,
00408           GENERIC_MAPPING *a_Mapping)
00409 {
00410   HRESULT t_Result = S_OK ;
00411
00412   HANDLE t_Token = NULL ;
00413
00414   BOOL t_Status = OpenThreadToken (
00415
00416     GetCurrentThread () ,
00417     TOKEN_QUERY ,
00418     TRUE ,
00419     & t_Token
00420   ) ;
00421
00422   DWORD t_LastError = GetLastError () ;
00423   if ( ! t_Status)
00424   {
00425     //the thread token should always be available
00426
00427     switch ( t_LastError )
00428     {
00429       case E_ACCESSDENIED:
00430       {
00431         return  WBEM_E_ACCESS_DENIED ;
00432       }
00433       break ;
00434
00435       default:
00436       {
00437         return WBEM_E_FAILED ;
00438       }
00439       break ;
00440     }
00441   }
00442
00443
00444   DWORD t_Access = 0 ;
00445   BOOL t_AccessStatus = FALSE ;
00446   PRIVILEGE_SET *t_PrivilegeSet = NULL ;
00447   DWORD t_PrivilegeSetSize = 0 ;
00448
00449   MapGenericMask (
00450
00451     & a_Access ,
00452     a_Mapping
00453   ) ;
00454
00455   t_Status = AccessCheck (
00456
00457     a_SecurityDescriptor ,
00458     t_Token,
00459     a_Access ,
00460     a_Mapping ,
00461     NULL ,
00462     & t_PrivilegeSetSize ,
00463     & t_Access ,
00464     & t_AccessStatus
00465   ) ;
00466
00467   if (!t_Status || !t_AccessStatus )
00468   {
00469     DWORD t_LastError = GetLastError () ;
00470     if ( t_LastError == ERROR_INSUFFICIENT_BUFFER )
00471     {
00472       t_PrivilegeSet = ( PRIVILEGE_SET * ) new BYTE [ t_PrivilegeSetSize ] ;
00473       if ( t_PrivilegeSet )
00474       {
00475         t_Status = AccessCheck (
00476           a_SecurityDescriptor ,
00477           t_Token,
00478           a_Access ,
00479           a_Mapping ,
00480           t_PrivilegeSet ,
00481           & t_PrivilegeSetSize ,
00482           & t_Access ,
00483           & t_AccessStatus
00484         ) ;
00485
00486         if ( !t_Status || !t_AccessStatus )
00487         {
00488           t_Result = WBEM_E_ACCESS_DENIED ;
00489         }
00490
00491         delete [] ( BYTE * ) t_PrivilegeSet ;
00492       }
00493       else
00494       {
00495         t_Result = WBEM_E_OUT_OF_MEMORY ;
00496       }
00497     }
00498     else
00499     {
00500       t_Result = WBEM_E_ACCESS_DENIED;
00501     }
00502
00503   }
00504
00505   CloseHandle ( t_Token ) ;
00506
00507
00508   return t_Result ;
00509 }
00510
00511
00512
00513 /******************************************************************************
00514  *
00515  *  Name: GetCurrentImpersonationLevel
00516  *
00517  *
00518  *  Description:
00519  *
00520  *      Get COM impersonation level of caller.
00521  *
00522  *****************************************************************************/
00523
00524 DWORD GetCurrentImpersonationLevel ()
00525 {
00526   DWORD t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00527
00528     HANDLE t_ThreadToken = NULL ;
00529
00530     BOOL t_Status = OpenThreadToken (
00531
00532     GetCurrentThread() ,
00533     TOKEN_QUERY,
00534     TRUE,
00535     &t_ThreadToken
00536   ) ;
00537
00538     if ( t_Status )
00539     {
00540     SECURITY_IMPERSONATION_LEVEL t_Level = SecurityAnonymous ;
00541     DWORD t_Returned = 0 ;
00542
00543     t_Status = GetTokenInformation (
00544
00545       t_ThreadToken ,
00546       TokenImpersonationLevel ,
00547       & t_Level ,
00548       sizeof ( SECURITY_IMPERSONATION_LEVEL ) ,
00549       & t_Returned
00550     ) ;
00551
00552     CloseHandle ( t_ThreadToken ) ;
00553
00554     if ( t_Status == FALSE )
00555     {
00556       t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00557     }
00558     else
00559     {
00560       switch ( t_Level )
00561       {
00562         case SecurityAnonymous:
00563         {
00564           t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00565         }
00566         break ;
00567
00568         case SecurityIdentification:
00569         {
00570           t_ImpersonationLevel = RPC_C_IMP_LEVEL_IDENTIFY ;
00571         }
00572         break ;
00573
00574         case SecurityImpersonation:
00575         {
00576           t_ImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE ;
00577         }
00578         break ;
00579
00580         case SecurityDelegation:
00581         {
00582           t_ImpersonationLevel = RPC_C_IMP_LEVEL_DELEGATE ;
00583         }
00584         break ;
00585
00586         default:
00587         {
00588           t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00589         }
00590         break ;
00591       }
00592     }
00593   }
00594   else
00595   {
00596         ULONG t_LastError = GetLastError () ;
00597
00598         if ( t_LastError == ERROR_NO_IMPERSONATION_TOKEN || t_LastError == ERROR_NO_TOKEN )
00599         {
00600             t_ImpersonationLevel = RPC_C_IMP_LEVEL_DELEGATE ;
00601         }
00602         else
00603     {
00604       if ( t_LastError == ERROR_CANT_OPEN_ANONYMOUS )
00605       {
00606         t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00607       }
00608       else
00609       {
00610         t_ImpersonationLevel = RPC_C_IMP_LEVEL_ANONYMOUS ;
00611       }
00612     }
00613     }
00614
00615   return t_ImpersonationLevel ;
00616 }
00617
00618
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/extpageuser.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

extpageuser.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       ExtPageUser.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #ifndef _EXTPAGEUSER_H
00012 #define _EXTPAGEUSER_H
00013
00014 #include "resource.h"
00015 #include "util.h"
00016
00017 class CWizExtUser;
00018
00019 class CExtPageUser : public CPropertyPage
00020 {
00021 public:
00022   CExtPageUser(CWizExtUser* pWizExt)
00023     : CPropertyPage(IDD_USER_PAGE_EXT)
00024   {
00025     m_pWizExt = pWizExt;
00026   }
00027
00028   virtual ~CExtPageUser()
00029   {
00030   }
00031
00032   enum { IDD = IDD_USER_PAGE_EXT};
00033
00034   afx_msg void OnChangePicture();
00035   afx_msg void OnClearPicture();
00036
00037
00038   virtual BOOL OnInitDialog();
00039   virtual BOOL OnKillActive();
00040   virtual BOOL OnSetActive();
00041
00042 private:
00043   CButton* GetChangePictureButton() { return (CButton*)GetDlgItem(IDC_BUTTON_CHANGE_PICTURE); }
00044   CButton* GetClearPictureButton() { return (CButton*)GetDlgItem(IDC_BUTTON_CLEAR_PICTURE); }
00045   CEdit*   GetPathEdit() { return (CEdit*)GetDlgItem(IDC_EDIT_PICTURE_PATH); }
00046   CEdit*   GetIDEdit() { return (CEdit*)GetDlgItem(IDC_EDIT_EMPLOYEE_ID); }
00047   CStatic* GetPicture() { return (CStatic*)GetDlgItem(IDC_PICTURE_DISPLAY); }
00048
00049   void SetWizardButtons();
00050
00051   HRESULT WriteDataHelper();
00052   void GetSummaryInfo(BSTR* pBstrText);
00053
00054 private:
00055
00056   CThumbNailPhotoHolder     m_thumbNailPhotoHolder;
00057
00058
00059   CWizExtUser* m_pWizExt;
00060   friend class CWizExtUser;
00061
00062   DECLARE_MESSAGE_MAP()
00063 };
00064
00065 #endif //_EXTPAGEUSER_H
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropertyEditSession Member List

This is the complete list of members for CPropertyEditSession, including all inherited members.
_pContext | CEditSessionBase | [protected]
_pMark | CPropertyEditSession | [private]
_ulCallback | CPropertyEditSession | [private]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CEditSessionBase(ITfContext *pContext) | CEditSessionBase | [inline]
CPropertyEditSession(CMarkTextService *pMark, ITfContext *pContext, ULONG ulCallback) | CPropertyEditSession | [inline]
DoEditSession(TfEditCookie ec) | CPropertyEditSession | [inline, virtual]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
QueryInterface(REFIID riid, void **ppvObj) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) AddRef(void) | CEditSessionBase | [inline]
STDMETHODIMP_(ULONG) Release(void) | CEditSessionBase | [inline]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
~CEditSessionBase() | CEditSessionBase | [inline, virtual]
~CPropertyEditSession() | CPropertyEditSession | [inline]
Generated on Wed Nov 13 2024 16:57:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/Dibutil.h Source File

  • Multimedia
  • Gdi
  • WinCap32

Dibutil.h

Go to the documentation of this file.
00001 /*    PortTool v2.2     dibutil.h          */
00002
00003 /*
00004  *  dibutil.h
00005  *
00006  *  Copyright 1991 - 2000 Microsoft Corporation. All rights reserved.
00007  *
00008  *  Header file for Device-Independent Bitmap (DIB) API.  Provides
00009  *  function prototypes and constants for the following functions:
00010  *
00011  *  AllocRoomForDIB()   - Allocates memory for a DIB
00012  *
00013  */
00014
00015
00016 /* DIB constants */
00017 #define PALVERSION   0x300
00018
00019 /* DIB macros */
00020 #define IS_WIN30_DIB(lpbi)  ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
00021 #define RECTWIDTH(lpRect)     ((lpRect)->right - (lpRect)->left)
00022 #define RECTHEIGHT(lpRect)    ((lpRect)->bottom - (lpRect)->top)
00023
00024 /* function prototypes */
00025 HANDLE          AllocRoomForDIB(BITMAPINFOHEADER bi, HBITMAP hBitmap);
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Register/register.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • Register

register.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      REGISTER.CPP
00003
00004   Summary:   Implementation file for the REGISTER.EXE code sample
00005              application.  REGISTER is a simple Win32 application that can
00006              load a COM component server (either EXE or DLL) and command
00007              it to register or unregister its components in the system
00008              Registry.
00009
00010              For a comprehensive tutorial code tour of REGISTER's contents
00011              and offerings see the tutorial REGISTER.HTM file. For
00012              more specific technical details on the internal workings see
00013              the comments dispersed throughout the REGISTER source code.
00014
00015   Classes:   CMainWindow.
00016
00017   Functions: WinMain.
00018
00019   Origin:    12-28-96: atrent - Based on SELFREG by Kraig Brockschmidt.
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is only intended as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 /*---------------------------------------------------------------------------
00037   We include WINDOWS.H for all Win32 applications.
00038   We include OLE2.H because we will be calling the COM/OLE Libraries.
00039   We include INITGUID.H only once (here) in the entire app because we
00040     will be using GUIDs and want them as constants in the data segment.
00041   We include APPUTIL.H because we will be building this application using
00042     the utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00043   We include REGISTER.H because it has resource definitions
00044     specific to this REGISTER application.
00045 ---------------------------------------------------------------------------*/
00046 #include <windows.h>
00047 #include <ole2.h>
00048 #include <initguid.h>
00049 #include <apputil.h>
00050 #include "register.h"
00051
00052
00053 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00054   Function: ErrorBoxID
00055
00056   Summary:  Utility function to show an error message box dialog.
00057             Parent window is desktop.
00058
00059   Args;     HINSTANCE hInst,
00060               Handle to app instance.
00061             UINT uStrID
00062               Resource ID of the error string to display.
00063
00064   Returns:  int
00065               TRUE if success; FALSE if not.
00066               Result of the MessageBox call.
00067 ------------------------------------------------------------------------F-F*/
00068 int ErrorBoxID(
00069       HINSTANCE hInst,
00070       UINT uStrID)
00071 {
00072   int iResult = FALSE;
00073   CHAR szTitle[MAX_STRING];
00074   CHAR szError[MAX_STRING];
00075
00076   if (LoadStringA(hInst, IDS_ERROR_TITLE, szTitle, MAX_STRING))
00077     if (LoadStringA(hInst, uStrID, szError, MAX_STRING))
00078       iResult = MessageBoxA(
00079                   NULL,
00080                   szError,
00081                   szTitle,
00082                   MB_OK | MB_ICONEXCLAMATION);
00083
00084   return (iResult);
00085 }
00086
00087
00088 /*F+F++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00089   Function: SkipAnsiString
00090
00091   Summary:  Utility function to scan an input ANSI string and either skip
00092             white characters or skip non-white characters.
00093
00094   Args;     LPSTR psz,
00095               Input ANSI string to be scanned.
00096             BOOL bSkip)
00097               Input boolean determining whether to skip white space
00098               or not.  TRUE means skip white space; FALSE means skip
00099               non-white chars.
00100
00101   Returns:  LPSTR
00102               String pointer after the skip.
00103 ------------------------------------------------------------------------F-F*/
00104 LPSTR SkipAnsiString(
00105          LPSTR psz,
00106          BOOL bSkipWhite)
00107 {
00108   char ch;
00109   BOOL bWhite;
00110
00111   while (ch = *psz)
00112   {
00113     bWhite = ('\n'==ch || '\r'==ch || '\t'==ch || ' '==ch);
00114
00115     if ((bSkipWhite && !bWhite) || (!bSkipWhite && bWhite))
00116       break;
00117
00118     psz++;
00119   }
00120
00121   return psz;
00122 }
00123
00124
00125 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00126   Function: WinMain
00127
00128   Summary:  The Windows main entry point function for this application.
00129             Initializes the application, the COM Libraries, and starts
00130             the main application message loop.
00131
00132   Args:     HINSTANCE hInstance,
00133               Instance handle; a new one for each invocation of this app.
00134             HINSTANCE hPrevInstance,
00135               Instance handle of the previous instance. NULL in Win32.
00136             LPSTR lpCmdLine,
00137               Windows passes a pointer to the application's
00138               invocation command line.
00139             int nCmdShow)
00140               Bits telling the show state of the application.
00141
00142   Returns:  int
00143               msg.wParam (upon exit of message loop).
00144               FALSE if this instance couldn't initialize and run.
00145 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00146 extern "C" int PASCAL WinMain(
00147                         HINSTANCE hInstance,
00148                         HINSTANCE hPrevInstance,
00149                         LPSTR pszCmdLine,
00150                         int nCmdShow)
00151 {
00152   int   iFail = FALSE;
00153   BOOL  bEXE = FALSE;
00154   BOOL  bUnreg = FALSE;
00155   LPSTR psz;
00156   char  ch;
00157
00158   /*--------------------------------------------------------------------
00159     Walk down the command line looking for /u and /e in any order.
00160     The first non-whitespace character after whitespace that is not
00161     a "/" is assumed to be the beginning of the server filename.
00162     This is all done in ANSI because pszCmdLine is in ANSI.
00163   --------------------------------------------------------------------*/
00164   psz = pszCmdLine;
00165
00166   while (ch = *psz)
00167   {
00168     BOOL    bStop = FALSE;
00169
00170     switch (ch)
00171     {
00172       case '\t':
00173       case '\n':
00174       case '\r':
00175       case ' ':
00176         // Skip any white space.
00177         psz = SkipAnsiString(psz, TRUE);
00178         continue;
00179
00180       case '/':
00181       case '-':
00182         // Check what option this is, then skip to next whitespace.
00183         ch = *(++psz);
00184         if ('u' == ch)
00185           bUnreg = TRUE;
00186         if ('e' == ch)
00187           bEXE = TRUE;
00188         psz = SkipAnsiString(psz, FALSE);
00189         continue;
00190
00191       default:
00192         bStop = TRUE;
00193         break;
00194     }
00195
00196     if (bStop)
00197       break;
00198
00199     psz++;
00200   }
00201
00202   if (0 != ch)
00203   {
00204     // If the command line was not null, launch the specified EXE or
00205     // load the specified DLL and tell either to do their registration
00206     // or unregistartion.
00207     if (bEXE)
00208     {
00209       // Verify the length of the input string to make sure we don't overrun
00210       // our buffer.
00211       if (lstrlenA(psz) < (MAX_PATH - 1 - lstrlenA("/UNREGSERVER"))) {
00212         UINT uError;
00213         CHAR szEXE[MAX_PATH];
00214
00215         wsprintfA(
00216           szEXE,
00217           "%s %s",
00218           psz,
00219           bUnreg ? "/UNREGSERVER" : "/REGSERVER");
00220
00221         // We WinExec the .EXE server passing /unregserver or /regserver.
00222         uError = WinExec(szEXE, SW_HIDE);
00223         if (uError < 32)
00224         {
00225           ErrorBoxID(hInstance, IDS_EXERUN_FAIL);
00226           iFail = TRUE;
00227         }
00228         else
00229         {
00230           // Show a timed message box indicating registration success.
00231           DelayBox(hInstance, MAKEINTRESOURCE(IDD_SUCCESS_MSG), NULL);
00232         }
00233       }
00234       else
00235       {
00236         ErrorBoxID(hInstance, IDS_EXERUN_FAIL);
00237         iFail = TRUE;
00238       }
00239     }
00240     else
00241     {
00242       // Because we load the DLL server into our own (ie, REGISTER.EXE)
00243       // process space, call to initialize the COM Library.  Use the
00244       // SUCCEEDED macro to detect success.  If fail then exit app
00245       // with error message.
00246       if (SUCCEEDED(CoInitialize(NULL)))
00247       {
00248         HINSTANCE hMod;
00249
00250         // Load the Server DLL into our process space.
00251         hMod = LoadLibraryA(psz);
00252
00253         if (NULL != hMod)
00254         {
00255           HRESULT (STDAPICALLTYPE *pfn)(void);
00256
00257           if (bUnreg)
00258           {
00259             (FARPROC&)pfn = GetProcAddress(hMod, "DllUnregisterServer");
00260
00261             if (NULL != pfn)
00262               iFail = FAILED((*pfn)());
00263
00264             if (iFail)
00265               ErrorBoxID(hInstance, IDS_DLLUNREG_FAIL);
00266             else
00267             {
00268               // Show a timed message box indicating registration success.
00269               DelayBox(hInstance, MAKEINTRESOURCE(IDD_SUCCESS_MSG), NULL);
00270             }
00271           }
00272           else
00273           {
00274             (FARPROC&)pfn = GetProcAddress(hMod, "DllRegisterServer");
00275
00276             if (NULL != pfn)
00277               iFail = FAILED((*pfn)());
00278             if (iFail)
00279               ErrorBoxID(hInstance, IDS_DLLREG_FAIL);
00280             else
00281             {
00282               // Show a timed message box indicating registration success.
00283               DelayBox(hInstance, MAKEINTRESOURCE(IDD_SUCCESS_MSG), NULL);
00284             }
00285           }
00286           CoFreeLibrary(hMod);
00287         }
00288         else
00289           ErrorBoxID(hInstance, IDS_LOADLIB_FAIL);
00290
00291         // We're exiting this app so shut down the COM Library.
00292         CoUninitialize();
00293       }
00294       else
00295         ErrorBoxID(hInstance, IDS_COMINITFAILED);
00296     }
00297   }
00298
00299   return iFail;
00300 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CWndLite Member List

This is the complete list of members for CWndLite, including all inherited members.
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_nID | CWndLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/dragdrop/globals.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • dragdrop

globals.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _MMC_GLOBALS_H
00015 #define _MMC_GLOBALS_H
00016
00017 #include <TChar.h>
00018 #include <Mmc.h>
00019 #include <CrtDbg.h>
00020 #include "Guids.h"
00021
00022
00023 class CBaseNode;                       // References
00024 class CDataObject;
00025
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // Global types
00029
00030
00031 typedef struct _tag_MMC_VERSION_INFO
00032 {
00033   long   nMajor;
00034   long   nMinor;
00035
00036 }CONSOLE_VERSION;
00037
00038 extern CONSOLE_VERSION g_CV;           // Global version struct
00039
00040 //---------------------------------------------------------------------------
00041 extern HINSTANCE g_hInst;              // Global instance handle
00042 extern ULONG     g_uObjectCount;       // Instance count for this object
00043 extern ULONG     g_uServerLocks;       // Server lock count for this object
00044
00045 //---------------------------------------------------------------------------
00046 // Clipformats requiered by MMC
00047
00048 extern UINT g_cfDisplayName;      // DisplayName for our SnapIn node
00049 extern UINT g_cfNodeType;         // GUID of the selected node
00050 extern UINT g_cfSnapinClsid;      // Class ID of this SnapIn
00051 extern UINT g_cfszNodeType;       // String version of namespace GUID
00052
00053 extern UINT g_cfBaseNodePtr;      // Retrieves BaseNode pointer
00054 extern UINT g_cfDataObjPtr;       // Retrieves pointer to CDataObject
00055
00056 // DRAGDROP: New clipformats
00057 extern UINT g_cfNodePropPtr;      // Retrieves NODE_PROPERTIES pointer
00058 extern UINT g_cfNodeTypeFlg;      // Retrieves a flag indicating node type
00059
00060 //---------------------------------------------------------------------------
00061 //  Global function prototypes
00062
00063 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide );
00064 void _fastcall CopyT2W( LPWSTR strDest, LPCTSTR strSource, size_t count);
00065
00066 void InitClipboardFormats();
00067
00068 HRESULT ExtractFromDataObject( LPDATAOBJECT ipDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal );
00069
00070 CBaseNode*   ExtractBaseNodePtr( LPDATAOBJECT ipDataObject );
00071 CDataObject* ExtractDataObjPtr(  LPDATAOBJECT ipDataObject );
00072 ULONG        ExtractNodeTypeFlg( LPDATAOBJECT ipDataObject );
00073
00074 HRESULT GetConsoleVersion( CONSOLE_VERSION* pVersion );
00075
00076 //---------------------------------------------------------------------------
00077 //  Global Strings
00078
00079
00080 static TCHAR*  gtszSNAPIN_NAME       = _T("Sample J (MMC 2.0) - Drag-Drop");
00081 static TCHAR*  gtszABOUT_NAME        = _T("Sample J (MMC 2.0) - ISnapinAbout");
00082
00083
00084 static WCHAR*  gwszROOT_NODE_NAME    = L"Drag-Drop Sample";
00085 static WCHAR*  gwszFOLDER_NODE_NAME  = L"Root Folder";
00086 static WCHAR*  gwszVFILE_NODE_NAME   = L"Virtual File";
00087 static WCHAR*  gwszABOUT_DESCRIPTION = L"MMC SDK Drag-Drop Sample";
00088 static WCHAR*  gwszABOUT_PROVIDER    = L"Copyright © 1999 - 2001 Microsoft Corporation";
00089 static WCHAR*  gwszABOUT_VERSION     = L"2.0";
00090
00091 // We need to do this to get around MMC.IDL - it explicitly defines
00092 // the clipboard formats as WCHAR types...
00093 #define T_CCF_DISPLAY_NAME    _T("CCF_DISPLAY_NAME")
00094 #define T_CCF_NODETYPE        _T("CCF_NODETYPE")
00095 #define T_CCF_SZNODETYPE      _T("CCF_SZNODETYPE")
00096 #define T_CCF_SNAPIN_CLASSID  _T("CCF_SNAPIN_CLASSID")
00097
00098 #define T_CCF_BASENODE_PTR    _T("CCF_BASENODE_PTR")
00099 #define T_CCF_DATAOBJ_PTR     _T("CCF_DATAOBJ_PTR")
00100 #define T_CCF_NODEPROP_PTR    _T("CCF_NODEPROP_PTR")   //DRAGDROP: New clipformat
00101 #define T_CCF_NODETYPE_FLG    _T("CCF_NODETYPE_FLG")   //DRAGDROP: New clipformat
00102
00103 //---------------------------------------------------------------------------
00104 // Constants
00105
00106 #define INIT_DEFAULT_NODE              -1
00107
00108 #define NODETYPE_STATIC                100   // Node Types
00109 #define NODETYPE_DEVICE                200
00110 #define NODETYPE_FOLDER                300
00111 #define NODETYPE_VFILE                 400
00112
00113
00114 #define ATTRIBUTE_DATA_ARCHIVE         2     // Node Attributes
00115 #define ATTRIBUTE_DATA_HIDDEN          4
00116 #define ATTRIBUTE_DATA_LOCKED          8
00117 #define ATTRIBUTE_DATA_READONLY        16
00118 #define ATTRIBUTE_BACKUP_DEVICE        2048  //0xFFFF
00119
00120
00121 #define IMG_DEVICE_DEFAULT             0     // Image Indexes
00122 #define IMG_DEVICE_OFFLINE             1
00123 #define IMG_DATA_FILE                  2
00124 #define IMG_DRIVE_DEFAULT              3
00125 #define IMG_DRIVE_OFFLINE              4
00126 #define IMG_FOLDER_DEFAULT             5
00127 #define IMG_CDROM_DEFAULT              6
00128 #define IMG_REMOVABLE_MEDIA            7
00129
00130 #define IDM_NEW_DEVICE                 100
00131 #define IDM_NEW_FOLDER                 200
00132 #define IDM_TOGGLE_STATUS              300
00133 #define IDM_NEW_VIRTFILE               400   // RESULTITEM:  New menu
00134
00135 #define STATUS_ONLINE                  1
00136 #define STATUS_OFFLINE                 0
00137
00138 // Define some custom window messages so that objects running in
00139 // different threads can send us commands.
00140 //
00141 #define WM_DEL_DEVICENODES             (WM_USER + 100)
00142 #define WM_ADD_DEVICENODE              (WM_USER + 101)
00143 #define WM_DEVICENODE_CLOSED           (WM_USER + 102)
00144 #define WM_ADD_VIRTUALFILE             (WM_USER + 103)
00145 #define WM_VIRTUALFILE_CLOSED          (WM_USER + 104)
00146
00147
00148 // Defines interfaces which can be requested from IComponentData
00149 // or IComponet's ::GetInterface method
00150 //
00151 #define REQUEST_ICONSOLENAMESPACE      1000
00152 #define REQUEST_ICONSOLE               1001
00153 #define REQUEST_ICONSOLEVERB           1002
00154 #define REQUEST_IRESULTDATA            1003
00155 #define REQUEST_IHEADERCTRL            1004
00156
00157
00158 // DRAGDROP: FormatEtc struct used for Node Properties
00159 #define NP_FORMATETC {g_cfNodePropPtr, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}
00160
00161
00162
00163 /////////////////////////////////////////////////////////////////////////////
00164 // Helper classes and macros
00165
00166 #define BYTE_SIZE(string)          ((_tcslen(string)+1) * sizeof(TCHAR))
00167
00168 #define BREAK_ON_ERROR( hResult )  if( S_OK != hResult ) continue
00169
00170 // Useful only for debugging.  Never use modal dialogs in release builds!!
00171 #define MsgBox(wszMsg, wszTitle) ::MessageBox(NULL, wszMsg, wszTitle, MB_OK)
00172
00173
00174 //---------------------------------------------------------------------------
00175 template<class TYPE>
00176 inline void SAFE_RELEASE( TYPE*& pObj )
00177 {
00178   if( NULL != pObj )
00179   {
00180     pObj->Release();
00181     pObj = NULL;
00182   }
00183   else
00184   {
00185     OutputDebugString(_T("Attempted to release NULL Com pointer.\n"));
00186   }
00187 }
00188
00189 //---------------------------------------------------------------------------
00190 template<class TYPE>
00191 inline void SAFE_FREE_BITMAP( TYPE*& pObj )
00192 {
00193   if( NULL != pObj )
00194   {
00195     BOOL bStatus = DeleteObject( pObj );
00196     pObj = NULL;
00197   }
00198   else
00199   {
00200     OutputDebugString(_T("Attempted to delete NULL Bitmap handle.\n"));
00201   }
00202 }
00203
00204 //---------------------------------------------------------------------------
00205 template<class TYPE>
00206 inline void SAFE_FREE_ICON( TYPE*& pObj )
00207 {
00208   if( NULL != pObj )
00209   {
00210     BOOL bStatus = DestroyIcon( pObj );
00211     pObj = NULL;
00212   }
00213   else
00214   {
00215     OutputDebugString(_T("Attempted to delete NULL Icon handle.\n"));
00216   }
00217 }
00218
00219
00220
00221 //---------------------------------------------------------------------------
00222 //  W2T converts a wide character string to unicode if _UNICODE is not
00223 //  defined.  If it is defined then the sting is copied to another buffer.
00224 //
00225 #ifndef _UNICODE
00226 #define W2T( szAnsiPtr, szWide )   Unicode2Ansi( szAnsiPtr, szWide )
00227 #else
00228 #define W2T( szAnsiPtr, szWide )                                 \
00229         *szAnsiPtr = (WCHAR*)CoTaskMemAlloc(BYTE_SIZE(szWide) ); \
00230         CopyMemory( *szAnsiPtr, szWide, BYTE_SIZE(szWide) )
00231
00232 #endif //_UNICODE
00233
00234
00235 #endif //_MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapisend/avifilereader.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapisend

avifilereader.h

Go to the documentation of this file.
00001 /*
00002
00003 Copyright (c) 1999 - 2000  Microsoft Corporation
00004
00005
00006 Module Name:
00007
00008     AVIFileReader.h
00009
00010
00011 Abstract:
00012
00013     Declaration for the AVIFileReader class.
00014
00015 */
00016
00017 #if !defined(AFX_AVIFILEREADER_H__6AC8BC7B_287D_452A_98BF_1C2B69277AB3__INCLUDED_)
00018 #define AFX_AVIFILEREADER_H__6AC8BC7B_287D_452A_98BF_1C2B69277AB3__INCLUDED_
00019
00020
00021 //
00022 // an abstraction for a media file open for reading
00023 //
00024
00025 class CAVIFileReader
00026 {
00027
00028 public:
00029
00030
00031     //
00032     // open stream
00033     //
00034
00035     HRESULT Initialize(char *pszFileName);
00036
00037
00038     //
00039     // constructor
00040     //
00041
00042     CAVIFileReader();
00043
00044
00045     //
00046     // close stream
00047     //
00048
00049   virtual ~CAVIFileReader();
00050
00051
00052     //
00053     // read stream data into buffer
00054     //
00055
00056     HRESULT Read(BYTE *pBuffer, LONG nBufferSize, LONG *pBytesWritten);
00057
00058
00059     //
00060     // returns waveformat for the open file. the caller must free
00061     // returned memory
00062     //
00063
00064     HRESULT GetFormat(WAVEFORMATEX **ppWaveFormat);
00065
00066
00067     //
00068     // return TRUE if the file was opened and is a valid wave file containing
00069     // an audio stream
00070     //
00071
00072     BOOL IsValidAudioFile()
00073     {
00074
00075         //
00076         // if we know stream's format, chances are this is a valid audio file
00077         //
00078
00079         if (NULL == m_pWaveFormat)
00080         {
00081             return FALSE;
00082         }
00083         else
00084         {
00085             return TRUE;
00086         }
00087     }
00088
00089
00090 private:
00091
00092
00093     //
00094     // audio stream
00095     //
00096
00097     PAVISTREAM  m_pAudioStream;
00098
00099
00100     //
00101     // format of the audio stream
00102     //
00103
00104     WAVEFORMATEX *m_pWaveFormat;
00105
00106
00107     //
00108     // number of samples read so far. we use it to determine the current
00109     // position in the stream
00110     //
00111
00112     LONG m_nSamplesReadSoFar;
00113
00114 };
00115
00116
00117 #endif // !defined(AFX_AVIFILEREADER_H__6AC8BC7B_287D_452A_98BF_1C2B69277AB3__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Audit/Audit.c Source File

  • Security
  • Authorization
  • Audit

Audit.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     audit.c
00012
00013 Abstract:
00014
00015     This module illustrates how to use the Windows NT LSA security API
00016     to manage the audit status on the local machine or a remote machine.
00017
00018     Querying the current audit status is illustrated, in addition to
00019     changing the audit state of an audit event type.  Enabling and
00020     disabling all auditing is also illustrated.
00021
00022     When targetting a domain controller for an audit update operation,
00023     be sure to target the primary domain controller for the domain.
00024     The audit settings are replicated by the primary domain controller
00025     to each backup domain controller as appropriate.  The NetGetDCName()
00026     Lan Manager API call can be used to get the primary domain controller
00027     computer name from a domain name.
00028
00029     This sample will target the local machine if no command line argument is
00030     specified, or the machine specified on argv[1], eg. audit.exe \\winbase
00031
00032     The sample relies on the ntsecapi.h header file found in the Win32SDK
00033     \mstools\security directory.
00034
00035 --*/
00036
00037 #include <windows.h>
00038 #include <stdio.h>
00039
00040 #include "ntsecapi.h" // \mstools\samples\win32\winnt\security\include\ntsecapi.h
00041
00042 #define RTN_OK 0
00043 #define RTN_USAGE 1
00044 #define RTN_ERROR 13
00045
00046 //
00047 // if you have the ddk, include ntstatus.h
00048 //
00049 #ifndef STATUS_SUCCESS
00050 #define STATUS_SUCCESS              ((NTSTATUS)0x00000000L)
00051 #define STATUS_INVALID_PARAMETER    ((NTSTATUS)0xC000000DL)
00052 #endif
00053
00054
00055 NTSTATUS
00056 DisplayAudit(
00057     LSA_HANDLE PolicyHandle
00058     );
00059
00060 void
00061 DisplayAuditEventOption(
00062     DWORD EventTypeIndex,
00063     POLICY_AUDIT_EVENT_OPTIONS EventOption
00064     );
00065
00066 NTSTATUS
00067 SetAuditEvent(
00068     LSA_HANDLE PolicyHandle,
00069     POLICY_AUDIT_EVENT_TYPE EventType,
00070     POLICY_AUDIT_EVENT_OPTIONS EventOption
00071     );
00072
00073 NTSTATUS
00074 SetAuditMode(
00075     LSA_HANDLE PolicyHandle,
00076     BOOL bEnable
00077     );
00078
00079 //
00080 // helper functions
00081 //
00082
00083 NTSTATUS
00084 OpenPolicy(
00085     LPWSTR ServerName,
00086     DWORD DesiredAccess,
00087     PLSA_HANDLE PolicyHandle
00088     );
00089
00090 void
00091 InitLsaString(
00092     PLSA_UNICODE_STRING LsaString,
00093     LPWSTR String
00094     );
00095
00096 void
00097 DisplayNtStatus(
00098     LPSTR szAPI,        // pointer to Ansi function name
00099     NTSTATUS Status     // NTSTATUS error value
00100     );
00101
00102 void
00103 DisplayWinError(
00104     LPSTR szAPI,    // pointer to Ansi function name
00105     DWORD dwError   // DWORD WinError
00106     );
00107
00108 //
00109 // unicode entry point and argv
00110 //
00111 int
00112 __cdecl
00113 wmain(
00114     int argc,
00115     wchar_t *argv[]
00116     )
00117 {
00118     LPWSTR wComputerName;
00119     LSA_HANDLE PolicyHandle;
00120     NTSTATUS Status;
00121
00122     //
00123     // pickup machine name if appropriate
00124     //
00125     if(argc == 2)
00126         wComputerName = argv[1];
00127     else
00128         wComputerName = NULL; // local machine
00129
00130     //
00131     // display current audit state
00132     //
00133
00134     Status = OpenPolicy(
00135                 wComputerName,
00136                 POLICY_VIEW_AUDIT_INFORMATION,
00137                 &PolicyHandle
00138                 );
00139
00140     if(Status == STATUS_SUCCESS) {
00141         //
00142         // display current auditing status
00143         //
00144         Status = DisplayAudit(PolicyHandle);
00145
00146         LsaClose(PolicyHandle);
00147
00148         if(Status != STATUS_SUCCESS) {
00149             DisplayNtStatus("DisplayAudit", Status);
00150             return RTN_ERROR;
00151         }
00152     } else {
00153         DisplayNtStatus("OpenPolicy", Status);
00154         return RTN_ERROR;
00155     }
00156
00157     //
00158     // enable success and failure audits of logon/logoff events
00159     //
00160
00161     Status = OpenPolicy(
00162                 wComputerName,
00163                 POLICY_VIEW_AUDIT_INFORMATION |
00164                 POLICY_SET_AUDIT_REQUIREMENTS,
00165                 &PolicyHandle
00166                 );
00167
00168     if(Status == STATUS_SUCCESS) {
00169
00170         //
00171         // enable success and failure auditing of logon/logoff
00172         //
00173         Status = SetAuditEvent(
00174             PolicyHandle,
00175             AuditCategoryLogon,
00176             POLICY_AUDIT_EVENT_SUCCESS | POLICY_AUDIT_EVENT_FAILURE
00177             );
00178
00179         //
00180         // enable audits
00181         //
00182         if( Status == STATUS_SUCCESS )
00183             Status = SetAuditMode(PolicyHandle, TRUE);
00184
00185         LsaClose(PolicyHandle);
00186
00187         if(Status != STATUS_SUCCESS) {
00188             DisplayNtStatus("SetAuditMode", Status);
00189             return RTN_ERROR;
00190         }
00191     } else {
00192         DisplayNtStatus("OpenPolicy", Status);
00193         return RTN_ERROR;
00194     }
00195
00196     return RTN_OK;
00197 }
00198
00199
00200 NTSTATUS
00201 DisplayAudit(
00202     LSA_HANDLE PolicyHandle
00203     )
00204 {
00205     PPOLICY_AUDIT_EVENTS_INFO AuditEvents;
00206     NTSTATUS Status;
00207     DWORD i; // index into EventAuditingOptions
00208
00209     //
00210     // obtain AuditEvents
00211     //
00212     Status = LsaQueryInformationPolicy(
00213                 PolicyHandle,
00214                 PolicyAuditEventsInformation,
00215                 &AuditEvents
00216                 );
00217
00218     if(Status != STATUS_SUCCESS) return Status;
00219
00220     //
00221     // successfully obtained AuditEventsInformation.  Now display.
00222     //
00223     if(AuditEvents->AuditingMode) {
00224         printf("Auditing Enabled\n");
00225     } else {
00226         printf("Auditing Disabled\n");
00227     }
00228
00229     for(i = 0 ; i < AuditEvents->MaximumAuditEventCount ; i++) {
00230         DisplayAuditEventOption(i, AuditEvents->EventAuditingOptions[i]);
00231     }
00232
00233     //
00234     // free allocated memory
00235     //
00236     LsaFreeMemory(AuditEvents);
00237
00238     return Status;
00239 }
00240
00241 void
00242 DisplayAuditEventOption(
00243     DWORD EventTypeIndex,
00244     POLICY_AUDIT_EVENT_OPTIONS EventOption
00245     )
00246 {
00247     printf("AuditCategory");
00248
00249     switch (EventTypeIndex) {
00250         case AuditCategorySystem:
00251         printf("System");
00252         break;
00253
00254         case AuditCategoryLogon:
00255         printf("Logon");
00256         break;
00257
00258         case AuditCategoryObjectAccess:
00259         printf("ObjectAccess");
00260         break;
00261
00262         case AuditCategoryPrivilegeUse:
00263         printf("PrivilegeUse");
00264         break;
00265
00266         case AuditCategoryDetailedTracking:
00267         printf("DetailedTracking");
00268         break;
00269
00270         case AuditCategoryPolicyChange:
00271         printf("PolicyChange");
00272         break;
00273
00274         case AuditCategoryAccountManagement:
00275         printf("AccountManagement");
00276         break;
00277
00278         default:
00279         printf("Unknown");
00280     }
00281
00282     if(EventOption & POLICY_AUDIT_EVENT_SUCCESS)
00283         printf(" AUDIT_EVENT_SUCCESS");
00284
00285     if(EventOption & POLICY_AUDIT_EVENT_FAILURE)
00286         printf(" AUDIT_EVENT_FAILURE");
00287
00288     printf("\n");
00289 }
00290
00291 NTSTATUS
00292 SetAuditEvent(
00293     LSA_HANDLE PolicyHandle,
00294     POLICY_AUDIT_EVENT_TYPE EventType,
00295     POLICY_AUDIT_EVENT_OPTIONS EventOption
00296     )
00297 {
00298     PPOLICY_AUDIT_EVENTS_INFO pae;
00299     NTSTATUS Status;
00300     DWORD i; // index into EventAuditingOptions
00301
00302     //
00303     // obtain AuditEvents
00304     //
00305     Status = LsaQueryInformationPolicy(
00306                 PolicyHandle,
00307                 PolicyAuditEventsInformation,
00308                 &pae
00309                 );
00310
00311     if(Status != STATUS_SUCCESS) return Status;
00312
00313     //
00314     // insure we were passed a valid EventType and EventOption
00315     //
00316     if((ULONG)EventType > pae->MaximumAuditEventCount ||
00317       (!EventOption & POLICY_AUDIT_EVENT_MASK) ) {
00318         LsaFreeMemory(pae);
00319         return STATUS_INVALID_PARAMETER;
00320     }
00321
00322     //
00323     // set all auditevents to the unchanged status...
00324     //
00325     for(i = 0 ; i < pae->MaximumAuditEventCount ; i++) {
00326         pae->EventAuditingOptions[i] = POLICY_AUDIT_EVENT_UNCHANGED;
00327     }
00328
00329     //
00330     // ...and update only the specified EventType
00331     //
00332     pae->EventAuditingOptions[EventType] = EventOption;
00333
00334     //
00335     // set the new AuditEvents
00336     //
00337     Status = LsaSetInformationPolicy(
00338                 PolicyHandle,
00339                 PolicyAuditEventsInformation,
00340                 pae
00341                 );
00342
00343     //
00344     // free allocated memory
00345     //
00346     LsaFreeMemory(pae);
00347
00348     return Status;
00349 }
00350
00351 NTSTATUS
00352 SetAuditMode(
00353     LSA_HANDLE PolicyHandle,
00354     BOOL bEnable
00355     )
00356 {
00357     PPOLICY_AUDIT_EVENTS_INFO AuditEvents;
00358     NTSTATUS Status;
00359     DWORD i;
00360
00361     //
00362     // obtain current AuditEvents
00363     //
00364     Status = LsaQueryInformationPolicy(
00365                 PolicyHandle,
00366                 PolicyAuditEventsInformation,
00367                 &AuditEvents
00368                 );
00369
00370     if(Status != STATUS_SUCCESS) return Status;
00371
00372     //
00373     // update the relevant member
00374     //
00375     AuditEvents->AuditingMode = bEnable;
00376
00377     //
00378     // set all auditevents to the unchanged status...
00379     //
00380     for(i = 0 ; i < AuditEvents->MaximumAuditEventCount ; i++) {
00381         AuditEvents->EventAuditingOptions[i] = POLICY_AUDIT_EVENT_UNCHANGED;
00382     }
00383
00384     //
00385     // set the new auditing mode (enabled or disabled)
00386     //
00387     Status = LsaSetInformationPolicy(
00388                 PolicyHandle,
00389                 PolicyAuditEventsInformation,
00390                 AuditEvents
00391                 );
00392
00393     LsaFreeMemory(AuditEvents);
00394
00395     return Status;
00396 }
00397
00398 void
00399 InitLsaString(
00400     PLSA_UNICODE_STRING LsaString,
00401     LPWSTR String
00402     )
00403 {
00404     DWORD StringLength;
00405
00406     if(String == NULL) {
00407         LsaString->Buffer = NULL;
00408         LsaString->Length = 0;
00409         LsaString->MaximumLength = 0;
00410
00411         return;
00412     }
00413
00414     StringLength = lstrlenW(String);
00415     LsaString->Buffer = String;
00416     LsaString->Length = (USHORT) StringLength * sizeof(WCHAR);
00417     LsaString->MaximumLength = (USHORT) (StringLength + 1) *
00418         sizeof(WCHAR);
00419 }
00420
00421 NTSTATUS
00422 OpenPolicy(
00423     LPWSTR ServerName,
00424     DWORD DesiredAccess,
00425     PLSA_HANDLE PolicyHandle
00426     )
00427 {
00428     PLSA_UNICODE_STRING Server;
00429     LSA_OBJECT_ATTRIBUTES ObjectAttributes;
00430     LSA_UNICODE_STRING ServerString;
00431
00432     //
00433     // Always initialize the object attributes to all zeroes
00434     //
00435     ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
00436
00437     if(ServerName != NULL) {
00438         //
00439         // Make a LSA_UNICODE_STRING out of the LPWSTR passed in
00440         //
00441         InitLsaString(&ServerString, ServerName);
00442         Server = &ServerString;
00443     } else {
00444         Server = NULL; // default to local machine
00445     }
00446
00447     //
00448     // Attempt to open the policy and return NTSTATUS
00449     //
00450     return LsaOpenPolicy(
00451                 Server,
00452                 &ObjectAttributes,
00453                 DesiredAccess,
00454                 PolicyHandle
00455                 );
00456 }
00457
00458 void
00459 DisplayNtStatus(
00460     LPSTR szAPI,
00461     NTSTATUS Status
00462     )
00463 {
00464     //
00465     // convert the NTSTATUS to Winerror and DisplayWinError()
00466     //
00467     DisplayWinError(szAPI, LsaNtStatusToWinError(Status) );
00468 }
00469
00470 void
00471 DisplayWinError(
00472     LPSTR szAPI,    // pointer to Ansi function name
00473     DWORD dwError   // DWORD WinError
00474     )
00475 {
00476     LPSTR MessageBuffer;
00477     DWORD dwBufferLength;
00478
00479     //
00480     // TODO get this fprintf out of here!
00481     //
00482     fprintf(stderr,"%s error!\n", szAPI);
00483
00484     if(dwBufferLength=FormatMessageA(
00485             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00486             FORMAT_MESSAGE_FROM_SYSTEM,
00487             NULL,
00488             dwError,
00489             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00490             (LPSTR) &MessageBuffer,
00491             0,
00492             NULL
00493             ))
00494     {
00495         DWORD dwBytesWritten; // unused
00496
00497         //
00498         // Output message string on stderr
00499         //
00500         WriteFile(
00501                 GetStdHandle(STD_ERROR_HANDLE),
00502                 MessageBuffer,
00503                 dwBufferLength,
00504                 &dwBytesWritten,
00505                 NULL
00506                 );
00507
00508         //
00509         // free the buffer allocated by the system
00510         //
00511         LocalFree(MessageBuffer);
00512     }
00513 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/SaveOptionsEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

SaveOptionsEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: SaveOptionsEnum
00019
00020 public class SaveOptionsEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adSaveCreateNotExist = 1;
00023   public static final short adSaveCreateOverWrite = 2;
00024 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Extens/delebase.h Source File

  • SysMgmt
  • MMC
  • Extens

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CDelegationBase {
00030 public:
00031     CDelegationBase();
00032     virtual ~CDelegationBase();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00035     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00036
00037     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00038     virtual const int GetBitmapIndex() = 0;
00039
00040     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00041
00042 public:
00043     // virtual functions go here (for MMCN_*)
00044     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
00045     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
00046     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00047     virtual HRESULT OnRename(LPOLESTR pszNewName) { return S_FALSE; }
00048     virtual HRESULT OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect) { return S_FALSE; }
00049
00050 public:
00051     static HBITMAP m_pBMapSm;
00052     static HBITMAP m_pBMapLg;
00053
00054 protected:
00055     static void LoadBitmaps() {
00056         m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
00057         m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
00058     }
00059
00060     BOOL bExpanded;
00061
00062 private:
00063     // {2974380B-4C4B-11d2-89D8-000021473128}
00064     static const GUID thisGuid;
00065 };
00066
00067 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/devicenode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

devicenode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Defines the CDeviceNode class.  This node is a child of
00014 //                CStaticNode.  It represents a Virtual Storage device
00015 //
00016 //
00017
00018
00019 #ifndef _CLASS_CDEVICENODE_
00020 #define _CLASS_CDEVICENODE_
00021
00022 #include "Globals.h"
00023 #include "FolderNode.h"      // Folders are children of this node
00024 #include "LListImpl.h"
00025
00026
00027 class CComponentData;        // References
00028
00029 //---------------------------------------------------------------------------
00030 class CDeviceNode : public CBaseNode
00031 {
00032   public:
00033     CDeviceNode();
00034     virtual ~CDeviceNode();
00035
00036     HRESULT Initialize( NODE_PROPERTIES* pNodeProps );
00037     VOID    ToggleStatus();
00038
00039   // Virtual methods
00040   public:
00041     ULONG   GetNodeType() { return NODETYPE_DEVICE; }
00042     GUID&   GetNodeGUID() { return m_thisGUID; }
00043
00044     HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo );
00045     HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI );
00046     HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI );
00047
00048   ///////////////////////////////////////////////////////////////////////////
00049   // Notification handlers
00050   //
00051   public:
00052     HRESULT OnSelect( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00053     HRESULT OnShow( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00054     HRESULT OnExpand( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00055     HRESULT OnRemoveChildren( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData );
00056     HRESULT OnRename( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent );
00057
00058     HRESULT OnViewChange( LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent )
00059             { return E_NOTIMPL; }
00060
00061   ///////////////////////////////////////////////////////////////////////////
00062   //  Context Menu methods
00063   //
00064   public:
00065     HRESULT AddMenuItems( LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR* pInsertionAllowed );
00066     HRESULT Command( long lCommandID );
00067
00068   /////////////////////////////////////////////////////////////////////////
00069   //  IExtendControlbar
00070   //
00071   public:
00072     HRESULT ControlbarNotify( LPARAM nArg, LPARAM lParam, LONG_PTR pComp );
00073
00074   ///////////////////////////////////////////////////////////////////////////
00075   // Private helpers
00076   //
00077   private:
00078     HRESULT  DeleteChildItems( LPCONSOLENAMESPACE2 ipCNS );
00079     HRESULT  InsertChildItems( LPCONSOLENAMESPACE2 ipCNS );
00080     HRESULT  RefreshNodeList();
00081     VOID     RemoveNodes();
00082
00083   private:
00084     static GUID  m_thisGUID;
00085     DWORD        m_dwAttributes;
00086     HSCOPEITEM   m_hParentNode;
00087     LPWSTR       m_wzStatus;
00088     BOOL         m_bOnlineStatus;
00089     HWND         m_hMessageWnd;        // Our message handler
00090
00091
00092     CLListImpl<CBaseNode*,CBaseNode*>  m_NodeList;
00093     CComponentData*                    m_pCompData;
00094
00095   public:
00096     HWND         m_hAddFolderDlg;      // Instance of AddDeviceDlg
00097
00098
00099     HRESULT  AddFolderNode( NODE_PROPERTIES* pProperties );
00100
00101     static LRESULT CALLBACK DeviceNodeWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
00102
00103 };
00104
00105 #endif //_CLASS_CDEVICENODE_
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CacheProxySamplePlugin::ContentInfo Member List

This is the complete list of members for CacheProxySamplePlugin::ContentInfo, including all inherited members.
CacheFlags | CacheProxySamplePlugin::ContentInfo |
CacheProxyCallback | CacheProxySamplePlugin::ContentInfo |
CacheUrl | CacheProxySamplePlugin::ContentInfo |
CDL | CacheProxySamplePlugin::ContentInfo |
CDLData | CacheProxySamplePlugin::ContentInfo |
ContentInfo(string o, string c) | CacheProxySamplePlugin::ContentInfo | [inline]
ContentSize | CacheProxySamplePlugin::ContentInfo |
ContentType | CacheProxySamplePlugin::ContentInfo |
EntityTags | CacheProxySamplePlugin::ContentInfo |
ExpirationTime | CacheProxySamplePlugin::ContentInfo |
LastModified | CacheProxySamplePlugin::ContentInfo |
lExpiration | CacheProxySamplePlugin::ContentInfo |
OriginUrl | CacheProxySamplePlugin::ContentInfo |
SubscriptionFlag | CacheProxySamplePlugin::ContentInfo |
varContext | CacheProxySamplePlugin::ContentInfo |
Generated on Wed Nov 13 2024 16:58:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyEvictListener/StdAfx.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyEvictListener

StdAfx.cpp

Go to the documentation of this file.
00001 //
00002 // stdafx.cpp : source file that includes just the standard includes
00003 //  stdafx.pch will be the pre-compiled header
00004 //  stdafx.obj will contain the pre-compiled type information
00005 //
00006
00007 #include "stdafx.h"
00008
00009 #ifdef _ATL_STATIC_REGISTRY
00010 #include <statreg.h>
00011 #endif
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/dballoc.h Source File

  • Com
  • Fundamentals
  • OleStd

dballoc.h

Go to the documentation of this file.
00001 /***
00002 *dballoc.h
00003 *
00004 *  Copyright (C) 1992-2000, Microsoft Corporation.  All Rights Reserved.
00005 *
00006 *Purpose:
00007 *  This file contains the definition of CDbAlloc - A debug implementation
00008 *  of the IMalloc interface.
00009 *
00010 *Implementation Notes:
00011 *
00012 *****************************************************************************/
00013
00014 #ifndef DBALLOC_H_INCLUDED /* { */
00015 #define DBALLOC_H_INCLUDED
00016
00017
00018 interface IDbOutput : public IUnknown
00019 {
00020    STDMETHOD(QueryInterface)(THIS_ REFIID riid, void FAR* FAR* ppv) PURE;
00021    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
00022    STDMETHOD_(ULONG, Release)(THIS) PURE;
00023
00024    virtual void _cdecl Printf (THIS_
00025      char FAR* szFmt, ...) PURE;
00026
00027    STDMETHOD_(void, Assertion)(THIS_
00028      BOOL cond,
00029      char FAR* szExpr,
00030      char FAR* szFile,
00031      UINT uLine,
00032      char FAR* szMsg) PURE;
00033 };
00034
00035
00036 #endif /* } DBALLOC_H_INCLUDED */
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/Notify.Cpp Source File

  • Web
  • MSAgent
  • c
  • Cap

Notify.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 - 2000 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 #include "stdafx.h"
00045 #include "Notify.h"
00046 #include "MainDlg.h"
00047
00048
00049 // IUnknown methods
00050
00051 STDMETHODIMP AgentNotifySink::QueryInterface (REFIID riid, LPVOID *ppv) {
00052
00053     *ppv = NULL;
00054
00055     if ((riid == IID_IUnknown) || (riid == IID_IAgentNotifySink) ||
00056     (riid == IID_IAgentNotifySinkEx))
00057         *ppv = this;
00058
00059     if (*ppv == NULL)
00060         return E_NOINTERFACE;
00061
00062     ((LPUNKNOWN)*ppv)->AddRef();
00063
00064     return NOERROR;
00065 }
00066
00067
00068 STDMETHODIMP_ (ULONG) AgentNotifySink::AddRef() {
00069
00070   return ++m_cRefs;
00071 }
00072
00073
00074 STDMETHODIMP_(ULONG) AgentNotifySink::Release() {
00075
00076   if (--m_cRefs != 0)
00077     return m_cRefs;
00078
00079   delete this;
00080   return 0;
00081 }
00082
00083
00084 // IDispatch methods (Boilerplate implementation)
00085
00086 STDMETHODIMP AgentNotifySink::GetTypeInfoCount(UINT *pctInfo) {
00087
00088     *pctInfo = 1;
00089     return NOERROR;
00090 }
00091
00092
00093 STDMETHODIMP AgentNotifySink::GetTypeInfo(UINT itInfo, LCID lcid, ITypeInfo **ppTypeInfo) {
00094
00095     HRESULT hRes;
00096     ITypeLib *pLib;
00097
00098     *ppTypeInfo = NULL;
00099
00100   if (itInfo != 0)
00101         return TYPE_E_ELEMENTNOTFOUND;
00102
00103     if (ppTypeInfo == NULL)
00104         return E_POINTER;
00105
00106   if ((PRIMARYLANGID(lcid) != LANG_NEUTRAL) &&
00107     (PRIMARYLANGID(lcid) != LANG_ENGLISH))
00108     return DISP_E_UNKNOWNLCID;
00109
00110     hRes = LoadRegTypeLib(LIBID_AgentServerObjects,
00111               1,
00112               0,
00113               PRIMARYLANGID(lcid),
00114               &pLib);
00115     if (FAILED(hRes))
00116         return hRes;
00117
00118   hRes = pLib->GetTypeInfoOfGuid(IID_IAgentNotifySinkEx, ppTypeInfo);
00119
00120   pLib->Release();
00121
00122     if (FAILED(hRes))
00123         return hRes;
00124
00125     (*ppTypeInfo)->AddRef();
00126
00127     return NOERROR;
00128 }
00129
00130
00131 STDMETHODIMP AgentNotifySink::GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgDispID) {
00132
00133     HRESULT hRes;
00134     ITypeInfo *pInfo;
00135
00136   // REFIID must be NULL
00137
00138   if (riid != IID_NULL)
00139         return ResultFromScode(DISP_E_UNKNOWNINTERFACE);
00140
00141   // Get the TypeInfo for the specified lcid
00142
00143     hRes = GetTypeInfo(0, lcid, &pInfo);
00144
00145   if (FAILED(hRes))
00146     return hRes;
00147
00148   // Use the TypeInfo to get the DISPIDs of the specified names.
00149   // That's the whole point here.  Let TypeInfo do the work so
00150   // we don't have to.
00151
00152   hRes = pInfo->GetIDsOfNames(rgszNames, cNames, rgDispID);
00153
00154   pInfo->Release();
00155
00156     return hRes;
00157 }
00158
00159
00160 STDMETHODIMP AgentNotifySink::Invoke(DISPID dispID, REFIID riid, LCID lcid,
00161                    unsigned short wFlags, DISPPARAMS *pDispParams,
00162                    VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
00163                    UINT *puArgErr) {
00164
00165   HRESULT hRes;
00166   ITypeInfo *pInfo;
00167
00168     // The riid parameter is always supposed to be IID_NULL
00169
00170   if (riid != IID_NULL)
00171         return DISP_E_UNKNOWNINTERFACE;
00172
00173   // Get the type info for the specified lcid
00174
00175     hRes = GetTypeInfo(0, lcid, &pInfo);
00176
00177     if (FAILED(hRes))
00178         return hRes;
00179
00180     // Clear exceptions
00181
00182     SetErrorInfo(0L, NULL);
00183
00184   hRes = pInfo->Invoke(this,
00185              dispID,
00186              wFlags,
00187              pDispParams,
00188              pVarResult,
00189              pExcepInfo,
00190              puArgErr);
00191
00192
00193     pInfo->Release();
00194
00195     return hRes;
00196 }
00197
00198
00199 // IAgentNotifySinkEx methods
00200
00201 STDMETHODIMP AgentNotifySink::Command(long dwCommandID, IUnknown * punkUserInput) {
00202
00203   _ASSERT(m_pMainDlg);
00204
00205   m_pMainDlg->OnCharacterCommand(dwCommandID);
00206
00207   return NOERROR;
00208 }
00209
00210
00211 STDMETHODIMP AgentNotifySink::ActivateInputState(long dwCharID, long bActivated) {
00212
00213   return NOERROR;
00214 }
00215
00216
00217 STDMETHODIMP AgentNotifySink::Restart() {
00218
00219   return NOERROR;
00220 }
00221
00222
00223 STDMETHODIMP AgentNotifySink::Shutdown() {
00224
00225   return NOERROR;
00226 }
00227
00228
00229 STDMETHODIMP AgentNotifySink::VisibleState(long dwCharID, long bVisible, long lCause) {
00230
00231   return NOERROR;
00232 }
00233
00234
00235 STDMETHODIMP AgentNotifySink::Click(long dwCharID, short fwKeys, long x, long y) {
00236
00237   _ASSERT(m_pMainDlg);
00238
00239   if (fwKeys & MK_RBUTTON)
00240     m_pMainDlg->OnCharacterRightClick(x, y);
00241
00242   return NOERROR;
00243 }
00244
00245
00246 STDMETHODIMP AgentNotifySink::DblClick(long dwCharID, short fwKeys, long x, long y) {
00247
00248   return NOERROR;
00249 }
00250
00251
00252 STDMETHODIMP AgentNotifySink::DragStart(long dwCharID, short fwKeys, long x, long y) {
00253
00254   return NOERROR;
00255 }
00256
00257
00258 STDMETHODIMP AgentNotifySink::DragComplete(long dwCharID, short fwKeys, long x, long y) {
00259
00260   return NOERROR;
00261 }
00262
00263
00264 STDMETHODIMP AgentNotifySink::RequestStart(long dwRequestID) {
00265
00266   return NOERROR;
00267 }
00268
00269
00270 STDMETHODIMP AgentNotifySink::RequestComplete(long dwRequestID, long hrStatus) {
00271
00272   return NOERROR;
00273 }
00274
00275
00276 STDMETHODIMP AgentNotifySink::BookMark(long dwBookMarkID) {
00277
00278   return NOERROR;
00279 }
00280
00281
00282 STDMETHODIMP AgentNotifySink::Idle(long dwCharID, long bStart) {
00283
00284   return NOERROR;
00285 }
00286
00287
00288 STDMETHODIMP AgentNotifySink::Move(long dwCharID, long x, long y, long lCause) {
00289
00290   _ASSERT(m_pMainDlg);
00291
00292   m_pMainDlg->OnCharacterMove(x, y);
00293
00294   return NOERROR;
00295 }
00296
00297
00298 STDMETHODIMP AgentNotifySink::Size(long dwCharID, long lWidth, long lHeight) {
00299
00300   return NOERROR;
00301 }
00302
00303
00304 STDMETHODIMP AgentNotifySink::BalloonVisibleState(long dwCharID, long bVisible) {
00305
00306   return NOERROR;
00307 }
00308
00309
00310 STDMETHODIMP AgentNotifySink::HelpComplete(long dwCharID, long dwCommandID, long dwCause) {
00311
00312   return NOERROR;
00313 }
00314
00315
00316 STDMETHODIMP AgentNotifySink::ListeningState(long dwCharID, long bListening, long dwCause) {
00317
00318   return NOERROR;
00319 }
00320
00321
00322 STDMETHODIMP AgentNotifySink::DefaultCharacterChange(BSTR bszGUID) {
00323
00324   return NOERROR;
00325 }
00326
00327
00328 STDMETHODIMP AgentNotifySink::AgentPropertyChange() {
00329
00330   _ASSERT(m_pMainDlg);
00331
00332   m_pMainDlg->OnPropertyChange();
00333
00334   return NOERROR;
00335 }
00336
00337
00338 STDMETHODIMP AgentNotifySink::ActiveClientChange(long dwCharID, long bActive) {
00339
00340   return NOERROR;
00341 }
00342
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/CMgdClusCfgInit.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

CMgdClusCfgInit.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      CMgdClusCfgInit.cpp
00007 //
00008 //  Description:
00009 //      Implementation of the CMgdClusCfgInit class.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020 //////////////////////////////////////////////////////////////////////////////
00021 // Include Files
00022 //////////////////////////////////////////////////////////////////////////////
00023
00024 #include "clres.h"
00025 #include "CMgdClusCfgInit.h"
00026
00027
00028 //////////////////////////////////////////////////////////////////////////////
00029 // CMgdClusCfgInit class
00030 //////////////////////////////////////////////////////////////////////////////
00031
00032
00033 //////////////////////////////////////////////////////////////////////////////
00034 //++
00035 //
00036 //  CMgdClusCfgInit::CMgdClusCfgInit
00037 //
00038 //  Description:
00039 //      Constructor. Sets all member variables to default values.
00040 //
00041 //  Arguments:
00042 //      None.
00043 //
00044 //  Return Value:
00045 //      None.
00046 //
00047 //--
00048 //////////////////////////////////////////////////////////////////////////////
00049 CMgdClusCfgInit::CMgdClusCfgInit( void )
00050 {
00051     m_picccCallback = NULL;
00052     m_lcid = GetUserDefaultLCID();
00053
00054     m_bstrNodeName = NULL;
00055     m_bstrDllName = NULL;
00056     m_bstrResTypeName = NULL;
00057     m_bstrDisplayName = NULL;
00058
00059 } //*** CMgdClusCfgInit::CMgdClusCfgInit
00060
00061
00062 //////////////////////////////////////////////////////////////////////////////
00063 //++
00064 //
00065 //  CMgdClusCfgInit::~CMgdClusCfgInit
00066 //
00067 //  Description:
00068 //      Destructor. Frees all previously allocated memory and releases all
00069 //      interface pointers.
00070 //
00071 //  Arguments:
00072 //      None.
00073 //
00074 //  Return Value:
00075 //      None.
00076 //
00077 //--
00078 //////////////////////////////////////////////////////////////////////////////
00079 CMgdClusCfgInit::~CMgdClusCfgInit( void )
00080 {
00081     if ( m_picccCallback != NULL )
00082     {
00083         m_picccCallback->Release();
00084         m_picccCallback = NULL;
00085     } // if: m_picccCallback was used
00086
00087     SysFreeString( m_bstrNodeName );
00088     SysFreeString( m_bstrDllName );
00089     SysFreeString( m_bstrResTypeName );
00090     SysFreeString( m_bstrDisplayName );
00091
00092 } //*** CMgdClusCfgInit::~CMgdClusCfgInit
00093
00094
00095 //////////////////////////////////////////////////////////////////////////////
00096 //++
00097 //
00098 //  CMgdClusCfgInit::Initialize
00099 //
00100 //  Description:
00101 //      Initialize this component.
00102 //
00103 //  Arguments:
00104 //      punkCallbackIn
00105 //          Interface on which to query for the IClusCfgCallback interface.
00106 //
00107 //      lcidIn
00108 //          Locale ID.
00109 //
00110 //  Return Value:
00111 //      S_OK
00112 //          Success.
00113 //
00114 //      E_POINTER
00115 //          Expected pointer argument specified as NULL.
00116 //
00117 //      E_OUTOFMEMORY
00118 //          Out of memory.
00119 //
00120 //      Other HRESULTs
00121 //          Failure.
00122 //
00123 //--
00124 //////////////////////////////////////////////////////////////////////////////
00125 STDMETHODIMP
00126 CMgdClusCfgInit::Initialize(
00127       IUnknown *    punkCallbackIn
00128     , LCID          lcidIn
00129     )
00130 {
00131     HRESULT hr = S_OK;
00132     WCHAR   szComputerName[ MAX_PATH ];
00133     DWORD   cchComputerName = MAX_PATH;
00134     DWORD   dwError = ERROR_SUCCESS;
00135
00136     m_lcid = lcidIn;
00137
00138     if ( punkCallbackIn == NULL )
00139     {
00140         hr = E_POINTER;
00141         goto Cleanup;
00142     } // if: Callback pointer is invalid (NULL)
00143
00144     //
00145     // Save the callback interface pointer.
00146     //
00147
00148     hr = punkCallbackIn->TypeSafeQI( IClusCfgCallback, &m_picccCallback );
00149     if ( FAILED( hr ) )
00150     {
00151         goto Cleanup;
00152     } // if: TypeSafeQI failed
00153
00154     //
00155     // Save the computer name for use by SendStatusReport.
00156     //
00157
00158     if ( GetComputerNameEx( ComputerNamePhysicalDnsHostname, szComputerName, &cchComputerName ) == 0 )
00159     {
00160         dwError = GetLastError();
00161         hr = HRESULT_FROM_WIN32( dwError );
00162
00163         HrSendStatusReport(
00164               TASKID_Major_Find_Devices
00165             , TASKID_Minor_ClipBookServer_Initialize
00166             , 1
00167             , 1
00168             , 1
00169             , hr
00170             , IDS_CLUSCFG_ERROR_GETCOMPUTERNAME_FAILED
00171             , 0
00172             );
00173         goto Cleanup;
00174     } // if: GetComputerName failed
00175
00176     m_bstrNodeName = SysAllocString( szComputerName );
00177     if ( m_bstrNodeName == NULL )
00178     {
00179         hr = E_OUTOFMEMORY;
00180         goto Cleanup;
00181     } // if:
00182
00183     //
00184     // Get the dll name.
00185     //
00186
00187     m_bstrDllName = SysAllocString( RESTYPE_DLL_NAME );
00188     if ( m_bstrDllName == NULL )
00189     {
00190         hr = E_OUTOFMEMORY;
00191         goto Cleanup;
00192     } // if:
00193
00194     //
00195     // Get the resource type name.
00196     //
00197
00198     m_bstrResTypeName = SysAllocString( RESTYPE_NAME );
00199     if ( m_bstrResTypeName == NULL )
00200     {
00201         hr = E_OUTOFMEMORY;
00202         goto Cleanup;
00203     } // if:
00204
00205     //
00206     // Load the resource type display name.
00207     //
00208
00209     //
00210     // NOTE:    The resource type display name should be localized, but the resource type
00211     //          name should always remain the same.
00212     //
00213
00214     hr = HrLoadStringIntoBSTR( _Module.m_hInstResource, IDS_RESTYPE_DISPLAYNAME, &m_bstrDisplayName );
00215     if ( FAILED( hr ) )
00216     {
00217         goto Cleanup;
00218     } // if:
00219
00220 Cleanup:
00221
00222     return hr;
00223
00224 } //*** CMgdClusCfgInit::Initialize
00225
00226
00227 //////////////////////////////////////////////////////////////////////////////
00228 //++
00229 //
00230 //  CMgdClusCfgInit::HrSendStatusReport
00231 //
00232 //  Description:
00233 //      Wraps IClusCfgCallback::SendStatusReport.
00234 //
00235 //  Arguments:
00236 //       clsidTaskMajorIn
00237 //       clsidTaskMinorIn
00238 //       ulMinIn
00239 //       ulMaxIn
00240 //       ulCurrentIn
00241 //       hrStatusIn
00242 //       idsDescriptionIn
00243 //       idsReferenceIn
00244 //
00245 //  Return Value:
00246 //      S_OK
00247 //          Success.
00248 //
00249 //      Other HRESULTs
00250 //          Failure.
00251 //
00252 //--
00253 //////////////////////////////////////////////////////////////////////////////
00254 STDMETHODIMP
00255 CMgdClusCfgInit::HrSendStatusReport(
00256       CLSID     clsidTaskMajorIn
00257     , CLSID     clsidTaskMinorIn
00258     , ULONG     ulMinIn
00259     , ULONG     ulMaxIn
00260     , ULONG     ulCurrentIn
00261     , HRESULT   hrStatusIn
00262     , UINT      idsDescriptionIn
00263     , UINT      idsReferenceIn
00264     ...
00265     )
00266 {
00267     HRESULT     hr = S_OK;
00268     BSTR        bstrDescription = NULL;
00269     BSTR        bstrReference = NULL;
00270     va_list     valist = NULL;
00271
00272     va_start( valist, idsReferenceIn );
00273     hr = HrFormatStringWithVAListIntoBSTR( _Module.m_hInstResource, idsDescriptionIn, &bstrDescription, valist );
00274     va_end( valist );
00275     if ( FAILED( hr ) )
00276     {
00277         goto Cleanup;
00278     } // if:
00279
00280     if ( idsReferenceIn != 0 )
00281     {
00282         hr = HrLoadStringIntoBSTR( _Module.m_hInstResource, idsReferenceIn, &bstrReference );
00283         if ( FAILED( hr ) )
00284         {
00285             goto Cleanup;
00286         } // if:
00287     } // if: valid reference string
00288
00289     hr = SendStatusReport(
00290               clsidTaskMajorIn
00291             , clsidTaskMinorIn
00292             , ulMinIn
00293             , ulMaxIn
00294             , ulCurrentIn
00295             , hrStatusIn
00296             , bstrDescription
00297             , bstrReference
00298             );
00299     if ( FAILED( hr ) )
00300     {
00301         goto Cleanup;
00302     } // if:
00303
00304 Cleanup:
00305
00306     SysFreeString( bstrDescription );
00307     SysFreeString( bstrReference );
00308
00309     return hr;
00310
00311 } //*** CMgdClusCfgInit::HrSendStatusReport
00312
00313
00314 //////////////////////////////////////////////////////////////////////////////
00315 //++
00316 //
00317 //  CMgdClusCfgInit::HrSendStatusReport
00318 //
00319 //  Description:
00320 //      Wraps IClusCfgCallback::SendStatusReport.
00321 //
00322 //  Arguments:
00323 //       clsidTaskMajorIn
00324 //       clsidTaskMinorIn
00325 //       ulMinIn
00326 //       ulMaxIn
00327 //       ulCurrentIn
00328 //       hrStatusIn
00329 //       pcszDescriptionIn
00330 //       idsReferenceIn
00331 //       ...        optional parameters for pcszDescriptionIn
00332 //
00333 //  Return Value:
00334 //      S_OK
00335 //          Success.
00336 //
00337 //      Other HRESULTs
00338 //          Failure.
00339 //
00340 //--
00341 //////////////////////////////////////////////////////////////////////////////
00342 STDMETHODIMP
00343 CMgdClusCfgInit::HrSendStatusReport(
00344       CLSID     clsidTaskMajorIn
00345     , CLSID     clsidTaskMinorIn
00346     , ULONG     ulMinIn
00347     , ULONG     ulMaxIn
00348     , ULONG     ulCurrentIn
00349     , HRESULT   hrStatusIn
00350     , LPCWSTR   pcszDescriptionIn
00351     , UINT      idsReferenceIn
00352     ...
00353     )
00354 {
00355     HRESULT     hr = S_OK;
00356     BSTR        bstrDescription = NULL;
00357     BSTR        bstrReference = NULL;
00358     va_list     valist = NULL;
00359
00360     va_start( valist, idsReferenceIn );
00361     hr = HrFormatStringWithVAListIntoBSTR( pcszDescriptionIn, &bstrDescription, valist );
00362     va_end( valist );
00363     if ( FAILED( hr ) )
00364     {
00365         goto Cleanup;
00366     } // if:
00367
00368     if ( idsReferenceIn != 0 )
00369     {
00370         hr = HrLoadStringIntoBSTR( _Module.m_hInstResource, idsReferenceIn, &bstrReference );
00371         if ( FAILED( hr ) )
00372         {
00373             goto Cleanup;
00374         } // if:
00375     } // if: valid reference string
00376
00377     hr = SendStatusReport(
00378               clsidTaskMajorIn
00379             , clsidTaskMinorIn
00380             , ulMinIn
00381             , ulMaxIn
00382             , ulCurrentIn
00383             , hrStatusIn
00384             , bstrDescription
00385             , bstrReference
00386             );
00387     if ( FAILED( hr ) )
00388     {
00389         goto Cleanup;
00390     } // if:
00391
00392 Cleanup:
00393
00394     SysFreeString( bstrDescription );
00395     SysFreeString( bstrReference );
00396
00397     return hr;
00398
00399 } //*** CMgdClusCfgInit::HrSendStatusReport
00400
00401
00402 //////////////////////////////////////////////////////////////////////////////
00403 //++
00404 //
00405 //  CMgdClusCfgInit::HrSendStatusReport
00406 //
00407 //  Description:
00408 //      Wraps IClusCfgCallback::SendStatusReport.
00409 //
00410 //  Arguments:
00411 //       clsidTaskMajorIn
00412 //       clsidTaskMinorIn
00413 //       ulMinIn
00414 //       ulMaxIn
00415 //       ulCurrentIn
00416 //       hrStatusIn
00417 //       pcszDescriptionIn
00418 //       pcszReferenceIn
00419 //
00420 //  Return Value:
00421 //      S_OK
00422 //          Success.
00423 //
00424 //      Other HRESULTs
00425 //          Failure.
00426 //
00427 //--
00428 //////////////////////////////////////////////////////////////////////////////
00429 STDMETHODIMP
00430 CMgdClusCfgInit::HrSendStatusReport(
00431       CLSID      clsidTaskMajorIn
00432     , CLSID      clsidTaskMinorIn
00433     , ULONG      ulMinIn
00434     , ULONG      ulMaxIn
00435     , ULONG      ulCurrentIn
00436     , HRESULT    hrStatusIn
00437     , LPCWSTR    pcszDescriptionIn
00438     , LPCWSTR    pcszReferenceIn
00439     ...
00440     )
00441 {
00442     HRESULT     hr = S_OK;
00443     BSTR        bstrDescription = NULL;
00444     va_list     valist = NULL;
00445
00446     va_start( valist, pcszReferenceIn );
00447     hr = HrFormatStringWithVAListIntoBSTR( pcszDescriptionIn, &bstrDescription, valist );
00448     va_end( valist );
00449     if ( FAILED( hr ) )
00450     {
00451         goto Cleanup;
00452     } // if:
00453
00454     hr = SendStatusReport(
00455               clsidTaskMajorIn
00456             , clsidTaskMinorIn
00457             , ulMinIn
00458             , ulMaxIn
00459             , ulCurrentIn
00460             , hrStatusIn
00461             , bstrDescription
00462             , pcszReferenceIn
00463             );
00464     if ( FAILED( hr ) )
00465     {
00466         goto Cleanup;
00467     } // if:
00468
00469 Cleanup:
00470
00471     SysFreeString( bstrDescription );
00472
00473     return hr;
00474
00475 } //*** CMgdClusCfgInit::HrSendStatusReport
00476
00477
00478 //////////////////////////////////////////////////////////////////////////////
00479 //++
00480 //
00481 //  CMgdClusCfgInit::SendStatusReport
00482 //
00483 //  Description:
00484 //      Wraps IClusCfgCallback::SendStatusReport.
00485 //
00486 //  Arguments:
00487 //       clsidTaskMajorIn
00488 //       clsidTaskMinorIn
00489 //       ulMinIn
00490 //       ulMaxIn
00491 //       ulCurrentIn
00492 //       hrStatusIn
00493 //       pcszDescriptionIn
00494 //       pcszReferenceIn
00495 //
00496 //  Return Value:
00497 //      S_OK
00498 //          Success.
00499 //
00500 //      Other HRESULTs
00501 //          Failure.
00502 //
00503 //--
00504 //////////////////////////////////////////////////////////////////////////////
00505 STDMETHODIMP
00506 CMgdClusCfgInit::SendStatusReport(
00507       CLSID     clsidTaskMajorIn
00508     , CLSID     clsidTaskMinorIn
00509     , ULONG     ulMinIn
00510     , ULONG     ulMaxIn
00511     , ULONG     ulCurrentIn
00512     , HRESULT   hrStatusIn
00513     , LPCWSTR   pcszDescriptionIn
00514     , LPCWSTR   pcszReferenceIn
00515     )
00516 {
00517     HRESULT     hr = S_OK;
00518     FILETIME    ftTime;
00519
00520     assert( m_picccCallback != NULL );
00521     assert( m_bstrNodeName != NULL );
00522
00523     GetSystemTimeAsFileTime( &ftTime );
00524
00525     if ( m_picccCallback != NULL )
00526     {
00527         hr = m_picccCallback->SendStatusReport(
00528                   m_bstrNodeName
00529                 , clsidTaskMajorIn
00530                 , clsidTaskMinorIn
00531                 , ulMinIn
00532                 , ulMaxIn
00533                 , ulCurrentIn
00534                 , hrStatusIn
00535                 , pcszDescriptionIn
00536                 , &ftTime
00537                 , pcszReferenceIn
00538                 );
00539         if ( FAILED( hr ) )
00540         {
00541             goto Cleanup;
00542         } // if:
00543     } // if: m_picccCallback != NULL
00544
00545 Cleanup:
00546
00547     return hr;
00548
00549 } //*** CMgdClusCfgInit::SendStatusReport
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/GINA/GinaHook/GinaHook.h Source File

  • Security
  • GINA
  • GinaHook

GinaHook.h

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006
00007  Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  Module:   Ginahook.h
00010
00011  Abstract: See ReadMe.txt for more detail information about this sample.
00012
00013  Revision: August 6, 1999.
00014
00015 ------------------------------------------------------------------------------*/
00016
00017 //
00018 // Function prototypes for the GINA interface.
00019 //
00020
00021 typedef BOOL (WINAPI * PFWLXNEGOTIATE)  (DWORD, DWORD *);
00022 typedef BOOL (WINAPI * PFWLXINITIALIZE) (LPWSTR, HANDLE, PVOID, PVOID, PVOID *);
00023 typedef VOID (WINAPI * PFWLXDISPLAYSASNOTICE) (PVOID);
00024 typedef int  (WINAPI * PFWLXLOGGEDOUTSAS) (PVOID, DWORD, PLUID, PSID, PDWORD,
00025                                            PHANDLE, PWLX_MPR_NOTIFY_INFO,
00026                                            PVOID *);
00027 typedef BOOL (WINAPI * PFWLXACTIVATEUSERSHELL) (PVOID, PWSTR, PWSTR, PVOID);
00028 typedef int  (WINAPI * PFWLXLOGGEDONSAS) (PVOID, DWORD, PVOID);
00029 typedef VOID (WINAPI * PFWLXDISPLAYLOCKEDNOTICE) (PVOID);
00030 typedef int  (WINAPI * PFWLXWKSTALOCKEDSAS) (PVOID, DWORD);
00031 typedef BOOL (WINAPI * PFWLXISLOCKOK) (PVOID);
00032 typedef BOOL (WINAPI * PFWLXISLOGOFFOK) (PVOID);
00033 typedef VOID (WINAPI * PFWLXLOGOFF) (PVOID);
00034 typedef VOID (WINAPI * PFWLXSHUTDOWN) (PVOID, DWORD);
00035
00036 //
00037 // New for version 1.1
00038 //
00039
00040 typedef BOOL (WINAPI * PFWLXSCREENSAVERNOTIFY) (PVOID, BOOL *);
00041 typedef BOOL (WINAPI * PFWLXSTARTAPPLICATION) (PVOID, PWSTR, PVOID, PWSTR);
00042
00043 //
00044 // New for version 1.3
00045 //
00046
00047 typedef BOOL (WINAPI * PFWLXNETWORKPROVIDERLOAD) (PVOID, PWLX_MPR_NOTIFY_INFO);
00048 typedef BOOL (WINAPI * PFWLXDISPLAYSTATUSMESSAGE) (PVOID, HDESK, DWORD, PWSTR, PWSTR);
00049 typedef BOOL (WINAPI * PFWLXGETSTATUSMESSAGE) (PVOID, DWORD *, PWSTR, DWORD);
00050 typedef BOOL (WINAPI * PFWLXREMOVESTATUSMESSAGE) (PVOID);
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/about.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

about.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "About.h"
00020 #include "resource.h"
00021 #include "globals.h"
00022 #include <crtdbg.h>
00023
00024 CSnapinAbout::CSnapinAbout()
00025 : m_cref(0)
00026 {
00027     OBJECT_CREATED
00028
00029         m_hSmallImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMBMP), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00030     m_hLargeImage = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_LGBMP), IMAGE_BITMAP, 32, 32, LR_LOADTRANSPARENT);
00031
00032     m_hSmallImageOpen = (HBITMAP)LoadImage(g_hinst, MAKEINTRESOURCE(IDB_SMOPEN), IMAGE_BITMAP, 16, 16, LR_LOADTRANSPARENT);
00033
00034     m_hAppIcon = LoadIcon(g_hinst, MAKEINTRESOURCE(IDI_ICON1));
00035 }
00036
00037 CSnapinAbout::~CSnapinAbout()
00038 {
00039     if (m_hSmallImage != NULL)
00040         FreeResource(m_hSmallImage);
00041
00042     if (m_hLargeImage != NULL)
00043         FreeResource(m_hLargeImage);
00044
00045     if (m_hSmallImageOpen != NULL)
00046         FreeResource(m_hSmallImageOpen);
00047
00048     if (m_hAppIcon != NULL)
00049         FreeResource(m_hAppIcon);
00050
00051     m_hSmallImage = NULL;
00052     m_hLargeImage = NULL;
00053     m_hSmallImageOpen = NULL;
00054     m_hAppIcon = NULL;
00055
00056     OBJECT_DESTROYED
00057 }
00058
00059 ///////////////////////
00060 // IUnknown implementation
00061 ///////////////////////
00062
00063 STDMETHODIMP CSnapinAbout::QueryInterface(REFIID riid, LPVOID *ppv)
00064 {
00065     if (!ppv)
00066         return E_FAIL;
00067
00068     *ppv = NULL;
00069
00070     if (IsEqualIID(riid, IID_IUnknown))
00071         *ppv = static_cast<ISnapinAbout *>(this);
00072     else if (IsEqualIID(riid, IID_ISnapinAbout))
00073         *ppv = static_cast<ISnapinAbout *>(this);
00074
00075     if (*ppv)
00076     {
00077         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00078         return S_OK;
00079     }
00080
00081     return E_NOINTERFACE;
00082 }
00083
00084 STDMETHODIMP_(ULONG) CSnapinAbout::AddRef()
00085 {
00086     return InterlockedIncrement((LONG *)&m_cref);
00087 }
00088
00089 STDMETHODIMP_(ULONG) CSnapinAbout::Release()
00090 {
00091     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00092     {
00093         // we need to decrement our object count in the DLL
00094         delete this;
00095         return 0;
00096     }
00097     return m_cref;
00098
00099 }
00100
00101 ///////////////////////////////
00102 // Interface ISnapinAbout
00103 ///////////////////////////////
00104 STDMETHODIMP CSnapinAbout::GetSnapinDescription(
00105                                                 /* [out] */ LPOLESTR *lpDescription)
00106 {
00107     _TCHAR szDesc[MAX_PATH];
00108
00109     LoadString(g_hinst, IDS_SNAPINDESC, szDesc, (sizeof szDesc)/(sizeof szDesc[0]));
00110
00111     return AllocOleStr(lpDescription, szDesc);
00112 }
00113
00114
00115 STDMETHODIMP CSnapinAbout::GetProvider(
00116                                        /* [out] */ LPOLESTR *lpName)
00117 {
00118     return AllocOleStr(lpName, _T("Copyright © 1999 - 2001 Microsoft Corporation"));;
00119 }
00120
00121
00122 STDMETHODIMP CSnapinAbout::GetSnapinVersion(
00123                                             /* [out] */ LPOLESTR *lpVersion)
00124 {
00125     return AllocOleStr(lpVersion, _T("1.0"));;
00126 }
00127
00128
00129 STDMETHODIMP CSnapinAbout::GetSnapinImage(
00130                                           /* [out] */ HICON *hAppIcon)
00131 {
00132     *hAppIcon = m_hAppIcon;
00133
00134     if (*hAppIcon == NULL)
00135         return E_FAIL;
00136     else
00137         return S_OK;
00138 }
00139
00140
00141 STDMETHODIMP CSnapinAbout::GetStaticFolderImage(
00142                                                 /* [out] */ HBITMAP *hSmallImage,
00143                                                 /* [out] */ HBITMAP *hSmallImageOpen,
00144                                                 /* [out] */ HBITMAP *hLargeImage,
00145                                                 /* [out] */ COLORREF *cMask)
00146 {
00147     *hSmallImage = m_hSmallImage;
00148     *hLargeImage = m_hLargeImage;
00149
00150     *hSmallImageOpen = m_hSmallImageOpen;
00151
00152     *cMask = RGB(0, 128, 128);
00153
00154     if (*hSmallImage == NULL || *hLargeImage == NULL || *hSmallImageOpen == NULL)
00155         return E_FAIL;
00156     else
00157         return S_OK;
00158 }
00159
00160 // this allocates a chunk of memory using CoTaskMemAlloc and copies our chars into it
00161 HRESULT CSnapinAbout::AllocOleStr(LPOLESTR *lpDest, _TCHAR *szBuffer)
00162 {
00163         MAKE_WIDEPTR_FROMTSTR_ALLOC(wszStr, szBuffer);
00164         *lpDest = wszStr;
00165
00166
00167     return S_OK;
00168 }
Generated on Wed Nov 13 2024 16:52:30 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/MainDlg.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

MainDlg.h

Go to the documentation of this file.
00001 // CapMFCDlg.h : header file
00002 //
00003 //{{AFX_INCLUDES()
00004 #include "acex.h"
00005 //}}AFX_INCLUDES
00006
00007 #if !defined(AFX_CAPMFCDLG_H__AB8FEB9A_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00008 #define AFX_CAPMFCDLG_H__AB8FEB9A_3841_11D2_8512_00C04FA34A14__INCLUDED_
00009
00010 #if _MSC_VER > 1000
00011 #pragma once
00012 #endif // _MSC_VER > 1000
00013
00014 /////////////////////////////////////////////////////////////////////////////
00015 // CCapMFCDlg dialog
00016
00017 class CCapMFCDlg : public CDialog
00018 {
00019 // Construction
00020 public:
00021   CCapMFCDlg(CWnd* pParent = NULL); // standard constructor
00022
00023 // Dialog Data
00024   //{{AFX_DATA(CCapMFCDlg)
00025   enum { IDD = IDD_CAPMFC_DIALOG };
00026   CStatic m_YLabel;
00027   CStatic m_XLabel;
00028   CButton m_PositionLabel;
00029   CEdit m_MoveY;
00030   CEdit m_MoveX;
00031   CButton m_Move;
00032   CButton m_BalloonEnabled;
00033   CButton m_BalloonSizeToText;
00034   CButton m_BalloonAutoPace;
00035   CButton m_BalloonAutoHide;
00036   CButton m_Speak;
00037   CButton m_SpeechOutputLabel;
00038   CEdit m_SpeakText;
00039   CButton m_Sfx;
00040   CButton m_Stop;
00041   CButton m_StopBeforePlay;
00042   CButton m_Play;
00043   CButton m_AnimationsLabel;
00044   CListBox  m_Animations;
00045   CAgentCtlEx m_Agent;
00046   //}}AFX_DATA
00047
00048   // ClassWizard generated virtual function overrides
00049   //{{AFX_VIRTUAL(CCapMFCDlg)
00050   public:
00051   virtual void OnFinalRelease();
00052   protected:
00053   virtual void DoDataExchange(CDataExchange* pDX);  // DDX/DDV support
00054   virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
00055   //}}AFX_VIRTUAL
00056
00057 // Implementation
00058 protected:
00059   HICON m_hIcon;
00060
00061   // Generated message map functions
00062   //{{AFX_MSG(CCapMFCDlg)
00063   virtual BOOL OnInitDialog();
00064   afx_msg void OnInitMenuPopup(CMenu *pPopupMenu, UINT uIndex, BOOL bSysMenu);
00065   afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
00066   afx_msg void OnDropFiles(HDROP hDropInfo);
00067   afx_msg void OnActivateApp(BOOL bActive, DWORD hTask);
00068   afx_msg void OnPaint();
00069   afx_msg HCURSOR OnQueryDragIcon();
00070   afx_msg void OnFileExit();
00071   afx_msg void OnFileOpen();
00072   afx_msg void OnPlay();
00073   afx_msg void OnDblclkAnimations();
00074   afx_msg void OnStop();
00075   afx_msg void OnSfx();
00076   afx_msg void OnSpeak();
00077   afx_msg void OnChangeSpeakText();
00078   afx_msg void OnSetFocusSpeakText();
00079   afx_msg void OnBalloonUse();
00080   afx_msg void OnMove();
00081   afx_msg void OnSetFocusMoveX();
00082   afx_msg void OnSetFocusMoveY();
00083   afx_msg void OnMoveAgent(LPCTSTR CharacterID, short x, short y, short Cause);
00084   afx_msg void OnSetFocusAnimations();
00085   afx_msg void OnCommandAgent(LPDISPATCH UserInput);
00086   afx_msg void OnAgentPropertyChange();
00087   afx_msg void OnHelpAbout();
00088   DECLARE_EVENTSINK_MAP()
00089   //}}AFX_MSG
00090   DECLARE_MESSAGE_MAP()
00091
00092 private:
00093   void  LoadCharacter(CString pszFilename);
00094   void  OnRecentFile(UINT uFile);
00095   void  UpdateRecentFiles(LPCTSTR pszFilename);
00096   void  MakeEllipsisPath(LPCTSTR pszPath, LPTSTR pszEllipsisPath, UINT cchMaxEllipsisPath);
00097
00098 private:
00099   LPCTSTR m_pszCurCharID;
00100   BOOL  m_bHasMRUSeparator;
00101 };
00102
00103 //{{AFX_INSERT_LOCATION}}
00104 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00105
00106 #endif // !defined(AFX_CAPMFCDLG_H__AB8FEB9A_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcProp.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcProp.h

Go to the documentation of this file.
00001 #if !defined(AFX_AGENTCTLPROPERTYSHEET_H__AB8FEBA8_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00002 #define AFX_AGENTCTLPROPERTYSHEET_H__AB8FEBA8_3841_11D2_8512_00C04FA34A14__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00008
00009 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00010 //  Microsoft Visual C++, your modifications will be overwritten.
00011
00012 /////////////////////////////////////////////////////////////////////////////
00013 // CAgentCtlPropertySheet wrapper class
00014
00015 class CAgentCtlPropertySheet : public COleDispatchDriver
00016 {
00017 public:
00018   CAgentCtlPropertySheet() {}   // Calls COleDispatchDriver default constructor
00019   CAgentCtlPropertySheet(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
00020   CAgentCtlPropertySheet(const CAgentCtlPropertySheet& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
00021
00022 // Attributes
00023 public:
00024
00025 // Operations
00026 public:
00027   short GetLeft();
00028   short GetTop();
00029   short GetHeight();
00030   short GetWidth();
00031   void SetVisible(BOOL bNewValue);
00032   BOOL GetVisible();
00033   void SetPage(LPCTSTR lpszNewValue);
00034   CString GetPage();
00035 };
00036
00037 //{{AFX_INSERT_LOCATION}}
00038 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00039
00040 #endif // !defined(AFX_AGENTCTLPROPERTYSHEET_H__AB8FEBA8_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DComDraw/SINK.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DComDraw

SINK.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SINK.H
00003
00004   Summary:   Include file for the COPaperSink COM object class.
00005
00006              COPaperSink offers a main IUnknown interface and the custom
00007              IPaperSink interface (outgoing connection events from COPaper
00008              drawing paper objects). This multiple interface COM Object
00009              Class is achieved via the technique of nested classes.  The
00010              implementation of the IPaperSink interface is nested inside
00011              of the COPaperSink Class.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial SSOCLIEN.HTM
00015              file. For more specific technical details on the internal
00016              workings see the comments dispersed throughout the module's
00017              source code.
00018
00019   Functions: .
00020
00021   Classes:   COPaperSink.
00022
00023   Origin:    8-23-97: atrent - Editor-inheritance from BALL.H in the
00024              CONSERVE Tutorial Code Sample. [Revised]
00025
00026 ----------------------------------------------------------------------------
00027   This file is part of the Microsoft COM Tutorial Code Samples.
00028
00029   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00030
00031   This source code is intended only as a supplement to Microsoft
00032   Development Tools and/or on-line documentation.  See these other
00033   materials for detailed information regarding Microsoft code samples.
00034
00035   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00036   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00037   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00038   PARTICULAR PURPOSE.
00039 ==========================================================================+*/
00040
00041 #if !defined(SINK_H)
00042 #define SINK_H
00043
00044 #ifdef __cplusplus
00045
00046
00047 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00048   ObjectClass: COPaperSink
00049
00050   Summary:     The main Sink COM object class for COPaperSink COM objects.
00051                COM objects of this class offer the IPaperSink sink
00052                interface supporting various drawing paper events. The
00053                mulitple interfaces on this COM object are constructed via
00054                the nested interface classes technique.
00055
00056   Interfaces:  IUnknown
00057                  Standard interface providing COM object features.
00058                IPaperSink
00059                  Sink interface for Paper events.
00060
00061   Aggregation: Yes, COPaperSink COM Objects are aggregatable by passing
00062                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00063 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00064 class COPaperSink : public IUnknown
00065 {
00066   public:
00067     // Main Object Constructor & Destructor.
00068     COPaperSink(IUnknown* pUnkOuter, CGuiPaper* pGuiPaper);
00069     ~COPaperSink(void);
00070
00071     // IUnknown methods. Main object, non-delegating.
00072     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00073     STDMETHODIMP_(ULONG) AddRef(void);
00074     STDMETHODIMP_(ULONG) Release(void);
00075
00076   private:
00077     // We declare nested class interface implementations here.
00078
00079     class CImpIPaperSink : public IPaperSink
00080     {
00081       public:
00082         // Interface Implementation Constructor & Destructor.
00083         CImpIPaperSink(COPaperSink* pCO, IUnknown* pUnkOuter);
00084         ~CImpIPaperSink(void);
00085
00086         // IUnknown methods.
00087         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00088         STDMETHODIMP_(ULONG) AddRef(void);
00089         STDMETHODIMP_(ULONG) Release(void);
00090
00091         // IPaperSink methods.
00092         STDMETHODIMP         Locked(void);
00093         STDMETHODIMP         Unlocked(void);
00094         STDMETHODIMP         Loaded(void);
00095         STDMETHODIMP         Saved(void);
00096         STDMETHODIMP         InkStart(
00097                                SHORT nX,
00098                                SHORT nY,
00099                                SHORT nWidth,
00100                                COLORREF crInkColor);
00101         STDMETHODIMP         InkDraw(
00102                                SHORT nX,
00103                                SHORT nY);
00104         STDMETHODIMP         InkStop(
00105                                SHORT nX,
00106                                SHORT nY);
00107         STDMETHODIMP         Erased(void);
00108         STDMETHODIMP         Resized(LONG lWidth, LONG lHeight);
00109
00110       private:
00111         // Data private to this interface implementation of IPaper.
00112         COPaperSink* m_pCO;          // Parent Object back pointer.
00113         IUnknown*    m_pUnkOuter;    // Outer unknown for Delegation.
00114     };
00115
00116     // Make the otherwise private and nested IPaperSink interface
00117     // implementation a friend to COM object instantiations of this
00118     // COPaperSink COM object class.
00119     friend CImpIPaperSink;
00120
00121     // Private data of COPaperSink COM objects.
00122
00123     // Nested IPaperSink implementation instantiation.  This IPaperSink
00124     // interface is instantiated inside this COPaperSink object as a
00125     // native interface.
00126     CImpIPaperSink   m_ImpIPaperSink;
00127
00128     // Main Object reference count.
00129     ULONG            m_cRefs;
00130
00131     // Outer unknown (aggregation delegation). Used when this COM object
00132     // is being aggregated.
00133     IUnknown*        m_pUnkOuter;
00134
00135     // Pointer to the main object that can service the Sink events.
00136     CGuiPaper*       m_pGuiPaper;
00137 };
00138
00139 typedef COPaperSink* PCOPaperSink;
00140
00141 #endif // __cplusplus
00142
00143
00144 #endif // SINK_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAVIFileReader Member List

This is the complete list of members for CAVIFileReader, including all inherited members.
CAVIFileReader() | CAVIFileReader |
GetFormat(WAVEFORMATEX **ppWaveFormat) | CAVIFileReader |
Initialize(char *pszFileName) | CAVIFileReader |
IsValidAudioFile() | CAVIFileReader | [inline]
m_nSamplesReadSoFar | CAVIFileReader | [private]
m_pAudioStream | CAVIFileReader | [private]
m_pWaveFormat | CAVIFileReader | [private]
Read(BYTE *pBuffer, LONG nBufferSize, LONG *pBytesWritten) | CAVIFileReader |
~CAVIFileReader() | CAVIFileReader | [virtual]
Generated on Wed Nov 13 2024 16:55:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDeviceNode Member List

This is the complete list of members for CDeviceNode, including all inherited members.
AddFolderNode(NODE_PROPERTIES *pProperties) | CDeviceNode |
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CDeviceNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CDeviceNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CDeviceNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CDeviceNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CDeviceNode | [virtual]
AddMenuItems(LPCONTEXTMENUCALLBACK ipCallback, long __RPC_FAR *pInsertionAllowed) | CDeviceNode | [virtual]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CBaseNode() | CBaseNode | [inline]
CDeviceNode() | CDeviceNode |
CDeviceNode() | CDeviceNode |
CDeviceNode() | CDeviceNode |
CDeviceNode() | CDeviceNode |
CDeviceNode() | CDeviceNode |
CDeviceNode() | CDeviceNode |
Command(long lCommandID) | CDeviceNode | [virtual]
Command(long lCommandID) | CDeviceNode | [virtual]
Command(long lCommandID) | CDeviceNode | [virtual]
Command(long lCommandID) | CDeviceNode | [virtual]
Command(long lCommandID) | CDeviceNode | [virtual]
Command(long lCommandID) | CDeviceNode | [virtual]
ControlbarNotify(LPARAM nArg, LPARAM lParam, LONG_PTR pComp) | CDeviceNode | [virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle) | CDeviceNode | [inline, virtual]
CreatePropertyPages(LPPROPERTYSHEETCALLBACK lpCallback, LONG_PTR Handle) | CDeviceNode | [inline, virtual]
DeleteChildItems(LPCONSOLENAMESPACE2 ipCNS2) | CDeviceNode | [private]
DeleteChildItems(LPCONSOLENAMESPACE2 ipCNS) | CDeviceNode | [private]
DeleteChildItems(LPCONSOLENAMESPACE2 ipCNS2) | CDeviceNode | [private]
DeleteChildItems(LPCONSOLENAMESPACE2 ipCNS) | CDeviceNode | [private]
DeleteChildItems(LPCONSOLENAMESPACE2 ipCNS2) | CDeviceNode | [private]
DeleteChildItems(LPCONSOLENAMESPACE2 ipCNS) | CDeviceNode | [private]
DeviceNodeWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CDeviceNode | [static]
GetAttributes() | CDeviceNode | [inline, virtual]
GetAttributeString() | CDeviceNode | [inline, virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CDeviceNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CDeviceNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CDeviceNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CDeviceNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CDeviceNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CDeviceNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CDeviceNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CDeviceNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CDeviceNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CDeviceNode | [virtual]
GetDisplayInfo(SCOPEDATAITEM *pSDI) | CDeviceNode | [virtual]
GetDisplayInfo(RESULTDATAITEM *pRDI) | CDeviceNode | [virtual]
GetNodeGUID() | CDeviceNode | [inline, virtual]
GetNodeGUID() | CDeviceNode | [inline, virtual]
GetNodeGUID() | CDeviceNode | [inline, virtual]
GetNodeGUID() | CDeviceNode | [inline, virtual]
GetNodeGUID() | CDeviceNode | [inline, virtual]
GetNodeGUID() | CDeviceNode | [inline, virtual]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeName() | CBaseNode | [inline]
GetNodeType() | CDeviceNode | [inline, virtual]
GetNodeType() | CDeviceNode | [inline, virtual]
GetNodeType() | CDeviceNode | [inline, virtual]
GetNodeType() | CDeviceNode | [inline, virtual]
GetNodeType() | CDeviceNode | [inline, virtual]
GetNodeType() | CDeviceNode | [inline, virtual]
GetObjectPath() | CDeviceNode | [inline, virtual]
GetProperties(LPNODEPROPS *ppNodeProps) | CDeviceNode | [virtual]
GetProperty(BSTR bstrPropertyName, PBSTR pbstrProperty) | CDeviceNode | [inline, virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CDeviceNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CDeviceNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CDeviceNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CDeviceNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CDeviceNode | [virtual]
GetResultViewType2(MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo) | CDeviceNode | [virtual]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CDeviceNode | [inline, virtual]
GetWatermarks(HBITMAP __RPC_FAR *lphWatermark, HBITMAP __RPC_FAR *lphHeader, HPALETTE __RPC_FAR *lphPalette, BOOL __RPC_FAR *bStretch) | CDeviceNode | [inline, virtual]
InitDefaultFolder() | CDeviceNode | [private]
Initialize(NODE_PROPERTIES *pNodeProps) | CDeviceNode | [virtual]
Initialize(LPNODEPROPS pNodeProps) | CDeviceNode | [virtual]
Initialize(NODE_PROPERTIES *pNodeProps) | CDeviceNode | [virtual]
Initialize(NODE_PROPERTIES *pNodeProps) | CDeviceNode | [virtual]
Initialize(NODE_PROPERTIES *pNodeProps) | CDeviceNode | [virtual]
Initialize(NODE_PROPERTIES *pNodeProps) | CDeviceNode | [virtual]
InsertChildItems(LPCONSOLENAMESPACE2 ipCNS2) | CDeviceNode | [private]
InsertChildItems(LPCONSOLENAMESPACE2 ipCNS) | CDeviceNode | [private]
InsertChildItems(LPCONSOLENAMESPACE2 ipCNS2) | CDeviceNode | [private]
InsertChildItems(LPCONSOLENAMESPACE2 ipCNS) | CDeviceNode | [private]
InsertChildItems(LPCONSOLENAMESPACE2 ipCNS2) | CDeviceNode | [private]
InsertChildItems(LPCONSOLENAMESPACE2 ipCNS) | CDeviceNode | [private]
IsAttributeSet(DWORD dwAttribute) | CDeviceNode | [inline, virtual]
m_bOnlineStatus | CDeviceNode | [private]
m_dwAttributes | CDeviceNode | [private]
m_hAddFolderDlg | CDeviceNode |
m_hMessageWnd | CDeviceNode | [private]
m_hParentNode | CDeviceNode | [private]
m_NodeList | CDeviceNode | [private]
m_nPropPageCount | CBaseNode | [protected]
m_pAttributeStr | CBaseNode |
m_pCompData | CDeviceNode | [private]
m_pParentNode | CDeviceNode | [private]
m_pwszNodeName | CBaseNode | [protected]
m_RDI | CBaseNode |
m_SDI | CBaseNode |
m_thisGUID | CDeviceNode | [private, static]
m_wzStatus | CDeviceNode | [private]
OnContextHelp(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnCutOrMove(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [inline, virtual]
OnDelete(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CDeviceNode | [inline, virtual]
OnDelete(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [inline, virtual]
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnExpand(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnQueryPaste(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnRemoveChildren(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pCompData) | CDeviceNode | [virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnRename(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [inline, virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnSelect(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnShow(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [inline, virtual]
OnViewChange(LPDATAOBJECT ipDataObject, LPARAM nArg, LPARAM nParam, LONG_PTR pComponent) | CDeviceNode | [inline, virtual]
CBaseNode::OnViewChange(LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent) | CBaseNode | [inline, virtual]
QueryForPropertyPage() | CDeviceNode | [inline, virtual]
QueryForPropertyPage() | CDeviceNode | [inline, virtual]
RefreshNodeList() | CDeviceNode | [private]
RefreshNodeList() | CDeviceNode | [private]
RefreshNodeList() | CDeviceNode | [private]
RefreshNodeList() | CDeviceNode | [private]
RefreshNodeList() | CDeviceNode | [private]
RemoveAttribute(DWORD dwAttribute) | CDeviceNode | [inline, virtual]
RemoveChildNode(LONG_PTR pChildNode) | CDeviceNode |
RemoveChildNodes() | CDeviceNode | [private]
RemoveNodes() | CDeviceNode | [private]
RemoveNodes() | CDeviceNode | [private]
RemoveNodes() | CDeviceNode | [private]
RemoveNodes() | CDeviceNode | [private]
RemoveNodes() | CDeviceNode | [private]
SetAttribute(DWORD dwAttribute) | CDeviceNode | [inline, virtual]
thisGUID | CDeviceNode | [private, static]
ToggleStatus() | CDeviceNode |
ToggleStatus() | CDeviceNode |
ToggleStatus() | CDeviceNode |
ToggleStatus() | CDeviceNode |
ToggleStatus() | CDeviceNode |
ToggleStatus() | CDeviceNode |
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CBaseNode() | CBaseNode | [inline, virtual]
~CDeviceNode() | CDeviceNode | [virtual]
~CDeviceNode() | CDeviceNode | [virtual]
~CDeviceNode() | CDeviceNode | [virtual]
~CDeviceNode() | CDeviceNode | [virtual]
~CDeviceNode() | CDeviceNode | [virtual]
~CDeviceNode() | CDeviceNode | [virtual]
Generated on Wed Nov 13 2024 16:56:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/Formdump/keys.h Source File

  • Web
  • iis
  • extensions
  • Formdump

keys.h

Go to the documentation of this file.
00001 //  Copyright (c) 1997-2002 Microsoft Corporation
00002 //
00003 //  Module Name:
00004 //
00005 //    keys.h
00006 //
00007 //  Abstract:
00008 //
00009 //    header file for reusable interface
00010
00011 // Abstracted pointer
00012
00013 typedef void *HKEYLIST;
00014
00015 // Retrieves and decodes inbound form data.  Builds list of keys, and
00016 // pointers to data within a content file.  Returns handle to first
00017 // element in the list.
00018
00019 HKEYLIST GetKeyList(IN EXTENSION_CONTROL_BLOCK *pECB);
00020
00021 // GetKeyInfo extracts the key name and content values from the
00022 // supplied key, and returns a handle to the next key in the list.
00023 //
00024 // The length is the exact length of the inbound data, but a NULL
00025 // is appended to the data.  For example, a text string of five
00026 // characters has a *pdwLength=5, but GetKeyBuffer returns at
00027 // least a 6 byte buffer--the five characters and a NULL.
00028
00029 HKEYLIST GetKeyInfo(IN HKEYLIST hKey, OUT LPCSTR *plpszKeyName,
00030                     OUT LPDWORD pdwLength, OUT BOOL *pbHasCtrlChars,
00031                     OUT LPINT pnInstance);
00032
00033 // GetKeyBuffer returns a pointer to the buffer holding data.
00034 // Depending on the implementation in keys.cpp, this may or may not
00035 // be a buffer the exact size of the data (it may be bigger).
00036 //
00037 // The data is zero-terminated.
00038
00039 LPBYTE GetKeyBuffer(IN HKEYLIST hKey);
00040
00041 // FindKey sequentially searches the linked list for a specific key.
00042 // The return handle can be used with GetKeyInfo to get more details.
00043 // FindKey returns the very first occurance of a duplicate key.
00044 // Also, it searches from the given key which need not be the head
00045 // key.
00046
00047 HKEYLIST FindKey(IN HKEYLIST hKeyList, IN LPCSTR lpszSearchName);
00048
00049 // FreeKeyList releases all of the memory associated with a key list.
00050 // Also, content resources are deleted.
00051
00052 void FreeKeyList(IN HKEYLIST hKeyList);
00053
00054 // GetKeyOffset returns the offset within the internal buffer or
00055 // the content file.  Under normal circumstances, use GetKeyInfo
00056 // and GetKeyBuffer instead of directly accessing the buffer.
00057
00058 DWORD GetKeyOffset(IN HKEYLIST hKey);
00059
00060 #ifdef USE_TEMPORARY_FILES
00061
00062   // GetContentFile returns the name of the temporary file used
00063   // to save the content.  The temporary file may be open.
00064
00065   LPCTSTR GetContentFile(IN HKEYLIST hKeyList);
00066
00067   // CloseContentFile forces the content file to be closed.  This
00068   // allows you to pass the file to something else that may open
00069   // it.  Call OpenContentFile before calling any other key
00070   // function.
00071
00072   void CloseContentFile(IN HKEYLIST hKeyList);
00073
00074   // OpenContentFile forces the content file to be reopened.
00075   // GetKeyBuffer will fail if the content file was closed by
00076   // CloseContentFile, but not reopened.
00077
00078   void OpenContentFile(IN HKEYLIST hKeyList);
00079
00080 #else
00081
00082   // GetDataBuffer returns a pointer to the start of the data
00083   // buffer which holds all content.  This function is not
00084   // particularly useful -- use GetKeyBuffer to get a pointer
00085   // to the buffer for a specific key.
00086
00087   LPBYTE GetDataBuffer(IN HKEYLIST hKey);
00088
00089 #endif
00090
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ICONDIR Member List

This is the complete list of members for ICONDIR, including all inherited members.
idCount | ICONDIR
idEntries | ICONDIR
idReserved | ICONDIR
idType | ICONDIR
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProxyIRowsetNotify< T > Member List

This is the complete list of members for CProxyIRowsetNotify< T >, including all inherited members.
Fire_OnFieldChange(IRowset *pRowset, HROW hRow, ULONG cColumns, ULONG *rgColumns, ULONG eReason, ULONG ePhase, LONG fCantDeny) | CProxyIRowsetNotify< T > | [inline]
Fire_OnRowChange(IRowset *pRowset, ULONG cRows, const HROW *rghRows, ULONG eReason, ULONG ePhase, LONG fCantDeny) | CProxyIRowsetNotify< T > | [inline]
Fire_OnRowsetChange(IRowset *pRowset, ULONG eReason, ULONG ePhase, LONG fCantDeny) | CProxyIRowsetNotify< T > | [inline]
Fire_RemoteOnFieldChange(IRowset *pRowset, HROW hRow, ULONG cColumns, ULONG *rgColumns, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo **ppErrorInfoRem) | CProxyIRowsetNotify< T > | [inline]
Fire_RemoteOnRowChange(IRowset *pRowset, ULONG cRows, const HROW *rghRows, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo **ppErrorInfoRem) | CProxyIRowsetNotify< T > | [inline]
Fire_RemoteOnRowsetChange(IRowset *pRowset, ULONG eReason, ULONG ePhase, LONG fCantDeny, IErrorInfo **ppErrorInfoRem) | CProxyIRowsetNotify< T > | [inline]
Generated on Wed Nov 13 2024 16:57:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Sample::UI::AboutBox Member List

This is the complete list of members for Sample::UI::AboutBox, including all inherited members.
AboutBox() | Sample::UI::AboutBox | [inline]
components | Sample::UI::AboutBox | [private]
CopyrightLabel | Sample::UI::AboutBox | [private]
Dispose(bool disposing) | Sample::UI::AboutBox | [inline, protected]
IconBox | Sample::UI::AboutBox | [private]
InitializeComponent() | Sample::UI::AboutBox | [inline, private]
OkButton | Sample::UI::AboutBox | [private]
OkButton_Click(object sender, System.EventArgs e) | Sample::UI::AboutBox | [inline, private]
TitleLabel | Sample::UI::AboutBox | [private]
Generated on Wed Nov 13 2024 16:58:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/resource.h Source File

  • SysMgmt
  • MMC
  • Proppage

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resources.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDI_PSI_LANDBASED               2
00008 #define IDS_NAME                        3
00009 #define IDS_SNAPINNAME                  6
00010 #define IDS_ABOUTNAME                   9
00011 #define IDS_PST_ROCKET                  10
00012 #define IDS_PST_LANDBASED               11
00013 #define IDD_PROPPAGE_LARGE              107
00014 #define IDI_ICON1                       108
00015 #define IDB_SMOPEN                      111
00016 #define IDB_SMBMP                       112
00017 #define IDB_LGBMP                       113
00018 #define IDI_PSI_ROCKET                  114
00019 #define IDR_SMICONS                     120
00020 #define IDR_LGICONS                     121
00021 #define IDC_ROCKET_NAME                 1000
00022 #define IDC_ROCKET_HEIGHT               1001
00023 #define IDC_ROCKET_WEIGHT               1002
00024 #define IDC_ROCKET_PAYLOAD              1003
00025 #define IDC_ROCKET_STATUS               1005
00026 #define IDB_ROCKET                      40004
00027 #define IDB_CAR                         40005
00028 #define IDB_PLANE                       40006
00029 #define IDB_BIKE                        40007
00030 #define IDB_ROCKET2                     40008
00031 #define IDB_CAR2                        40009
00032 #define IDB_PLANE2                      40010
00033 #define IDB_BIKE2                       40011
00034 #define IDB_CLOSED2                     40012
00035 #define IDB_OPEN2                       40013
00036 #define IDB_CLOSED                      40014
00037 #define IDB_OPEN                        40015
00038
00039 // Next default values for new objects
00040 //
00041 #ifdef APSTUDIO_INVOKED
00042 #ifndef APSTUDIO_READONLY_SYMBOLS
00043 #define _APS_NEXT_RESOURCE_VALUE        116
00044 #define _APS_NEXT_COMMAND_VALUE         40016
00045 #define _APS_NEXT_CONTROL_VALUE         1008
00046 #define _APS_NEXT_SYMED_VALUE           101
00047 #endif
00048 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/FullSvr/fullserv.h Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • FullSvr

fullserv.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: FullServ.h
00004
00005 Summary:  Declaration of CFullServ and CAsyncFullServ
00006
00007 ----------------------------------------------------------------------------
00008
00009 This file is part of the Microsoft COM+ Samples.
00010
00011 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00012
00013 This source code is intended only as a supplement to Microsoft
00014 Development Tools and/or on-line documentation. See these other
00015 materials for detailed information regarding Microsoft code samples.
00016
00017 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00018 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00019 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00020 PARTICULAR PURPOSE.
00021
00022 ==========================================================================+*/
00023
00024 #ifndef __FULLSERV_H_
00025 #define __FULLSERV_H_
00026
00027 #include "resource.h"       // main symbols
00028
00029 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00030   Class:       CFullServ
00031   Summary:     Provides a synchronous implementation of ISample, and handles
00032          calls to IFullServ asynchronously by creating call objects for
00033          AsyncIFullServ
00034   Interfaces:  IFullServ
00035          ISample
00036          ICallFactory
00037   Aggregation: Supported
00038 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00039 class ATL_NO_VTABLE CFullServ :
00040   public CComObjectRootEx<CComMultiThreadModel>,
00041   public CComCoClass<CFullServ, &CLSID_FullServ>,
00042   public IFullServ,
00043   public ISample,
00044   public ICallFactory
00045 {
00046 public:
00047   CFullServ()
00048   {
00049   }
00050
00051 DECLARE_REGISTRY_RESOURCEID(IDR_FULLSERV)
00052 DECLARE_AGGREGATABLE(CFullServ)
00053
00054 DECLARE_PROTECT_FINAL_CONSTRUCT()
00055
00056 BEGIN_COM_MAP(CFullServ)
00057   COM_INTERFACE_ENTRY(IFullServ)
00058   COM_INTERFACE_ENTRY(ISample)
00059   COM_INTERFACE_ENTRY(ICallFactory)
00060 END_COM_MAP()
00061
00062 // IFullServ
00063 public:
00064   //IFullServ
00065   STDMETHOD(Sum)(/*[in]*/ int i, /*[in]*/ int j, /*[out,retval]*/int * sum);
00066   //ICallFactory
00067   STDMETHOD(CreateCall)(REFIID riid1,IUnknown *pUnk,
00068               REFIID riid2,IUnknown **ppObj);
00069   //ISample
00070   STDMETHOD(Work)(/*[in]*/ int i, /*[in]*/ int j, /*[out,retval]*/int * sum);
00071
00072 };
00073
00074 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00075   Class:       CONotify
00076   Summary:     This class is the call object created by CFullServ::CreateCall
00077   Interfaces:  AsyncIFullServ - the asynchronous version of IFullServ
00078          ISynchronize - A call object must implement ISynchronize. In
00079          this case the call object auto aggregates CLSID_ManualResetEvent
00080   Aggregation: Supported
00081 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00082 class CAsyncFullServ : public CComObjectRootEx<CComMultiThreadModel>,
00083              public CComCoClass<CAsyncFullServ,&CLSID_AsyncFullServ>,
00084              public AsyncIFullServ
00085 {
00086 public:
00087   CAsyncFullServ(){
00088     m_callInProgress = FALSE;
00089   }
00090
00091   void Init(IFullServ * pIFullServ){
00092     m_pIFullServ = pIFullServ;//calls addref
00093   }
00094
00095 private:
00096   CComPtr<IFullServ> m_pIFullServ;//Pointer to sync interface
00097   BOOL m_callInProgress;
00098   int m_i,m_j,m_sum; // member vars used for Sum
00099   HRESULT m_hr; //used to store the HRESULT of Begin
00100
00101 public:
00102 DECLARE_GET_CONTROLLING_UNKNOWN()
00103 DECLARE_PROTECT_FINAL_CONSTRUCT()
00104 DECLARE_POLY_AGGREGATABLE(CAsyncFullServ)
00105 BEGIN_COM_MAP(CAsyncFullServ)
00106   COM_INTERFACE_ENTRY(AsyncIFullServ)
00107   COM_INTERFACE_ENTRY_AUTOAGGREGATE(IID_ISynchronize,m_pAggISync.p,CLSID_ManualResetEvent)
00108 END_COM_MAP()
00109
00110
00111   CComPtr<IUnknown> m_pAggISync;
00112
00113   //AsyncIFullServ
00114   STDMETHOD(Begin_Sum)(int i, int j);
00115   STDMETHOD(Finish_Sum)(int* sum);
00116
00117   //Called by worker thread
00118   STDMETHOD(doSum)();
00119
00120
00121 };
00122
00123 #endif //__FULLSERV_H_
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/Dog/Dog.Cpp Source File

  • Com
  • Fundamentals
  • CustomSurrogate
  • Dog

Dog.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include "idog_i.c"
00020 #include "dogcf.h"
00021
00022 LONG g_cLocks;
00023 LONG g_cObjects;
00024 HINSTANCE g_hInst;
00025
00026 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID pvReserved)
00027 {
00028     switch (dwReason)
00029   {
00030       case DLL_PROCESS_ATTACH:
00031       {
00032         g_hInst = hInstance;
00033         g_cObjects = 0;
00034         g_cLocks = 0;
00035       }
00036       break;
00037       case DLL_THREAD_ATTACH:
00038       break;
00039       case DLL_THREAD_DETACH:
00040       break;
00041       case DLL_PROCESS_DETACH:
00042       break;
00043     }
00044
00045     return TRUE;
00046 }
00047
00048 STDAPI DllRegisterServer()
00049 {
00050     return S_OK;
00051 }
00052
00053 STDAPI DllUnregisterServer()
00054 {
00055     return S_OK;
00056 }
00057
00058 STDAPI DllCanUnloadNow()
00059 {
00060     return (g_cLocks | g_cObjects) ? S_FALSE : S_OK;
00061 }
00062
00063 STDAPI  DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID FAR* ppv)
00064 {
00065     HRESULT hr;
00066     CClassFactory* pv;
00067
00068     if (!ppv)
00069         return E_INVALIDARG;
00070
00071     if (!IsEqualCLSID(rclsid, CLSID_DogClass))
00072         return CLASS_E_CLASSNOTAVAILABLE;
00073
00074     pv = new CClassFactory();
00075     if (!pv)
00076         return E_OUTOFMEMORY;
00077
00078     hr = ((IUnknown *)pv)->QueryInterface(riid, ppv);
00079
00080     return hr;
00081 }
00082
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/User/vc/iasuser.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • User
  • vc

iasuser.cpp

Go to the documentation of this file.
00001 // userprop.cpp : Defines the entry point for the console application.
00002 //
00003
00004 //For the pow function to calculate powers of 2
00005 #include <math.h>
00006 #include <wchar.h>
00007 #include <objbase.h>
00008 #include <activeds.h>
00009
00010 //Make sure you define UNICODE
00011 //Need to define version 5 for Windows 2000
00012 #define _WIN32_WINNT 0x0500
00013 #include <sddl.h>
00014
00015
00016
00017 //Function to use the get_* methods of IADsUser.
00018 HRESULT GetUserPropertyMethods(IADsUser *pUser);
00019
00020 HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
00021                        LPWSTR szFindUser, //Name of user to find.
00022                        IADs **ppUser); //Return a pointer to the user
00023
00024
00025 void wmain( int argc, wchar_t *argv[ ])
00026 {
00027
00028 //Handle the command line arguments.
00029
00030     wchar_t pszBuffer[MAX_PATH*2] ;
00031     if ( argc != 2 )
00032     {
00033         wprintf( L"This program finds a user in the current domain\n" ) ;
00034         wprintf( L"(Windows 2000 or higher), and displays all the IADsUser\n" ) ;
00035         wprintf( L"properties.\n\n" ) ;
00036         wprintf(L"useage:  iadsuser <username>\n");
00037         wprintf( L"where <username> is the DN of the user.\n" ) ;
00038         wprintf( L"Enclose in quotes as necessary.\n" ) ;
00039         return ;
00040     }
00041     wcsncpy( pszBuffer, argv[1], MAX_PATH * 2 ) ;
00042     pszBuffer[(MAX_PATH*2)-1] = 0 ;
00043     //if empty string, exit.
00044     if ( 0==wcscmp(L"", pszBuffer) )
00045         return ;
00046
00047     wprintf(L"\nFinding user: %ws...\n",pszBuffer);
00048
00049 //Intialize COM
00050     CoInitialize(NULL);
00051     HRESULT hr = S_OK;
00052 //Get rootDSE and the domain container's DN.
00053     IADs *pObject = NULL;
00054     IDirectorySearch *pDS = NULL;
00055     wchar_t szPath[MAX_PATH] ;
00056     VARIANT var;
00057     hr = ADsOpenObject(L"LDAP://rootDSE",
00058                        NULL,
00059                        NULL,
00060                        ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00061                        IID_IADs,
00062                        (void**)&pObject);
00063     if ( FAILED(hr) )
00064     {
00065         wprintf(L"Not Found. Could not bind to the domain.\n");
00066         if ( pObject )
00067             pObject->Release();
00068         return;
00069     }
00070
00071     VariantInit( &var ) ;
00072     hr = pObject->Get(L"defaultNamingContext",&var);
00073     if ( SUCCEEDED(hr) )
00074     {
00075         _snwprintf( szPath, MAX_PATH, L"LDAP://%ws", var.bstrVal ) ;
00076         szPath[MAX_PATH-1] = 0 ;
00077         VariantClear(&var);
00078         if ( pObject )
00079         {
00080             pObject->Release();
00081             pObject = NULL;
00082         }
00083         //Bind to the root of the current domain.
00084         hr = ADsOpenObject(szPath,
00085                            NULL,
00086                            NULL,
00087                            ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
00088                            IID_IDirectorySearch,
00089                            (void**)&pDS);
00090         if ( SUCCEEDED(hr) )
00091         {
00092             hr =  FindUserByName(pDS, //Container to search
00093                                  pszBuffer, //Name of user to find.
00094                                  &pObject); //Return a pointer to the user
00095             if ( SUCCEEDED(hr) )
00096             {
00097                 IADsUser *pUser = NULL;
00098                 hr = pObject->QueryInterface( IID_IADsUser, (void**) &pUser );
00099                 if ( SUCCEEDED(hr) )
00100                 {
00101                     wprintf (L"----------------------------------------------\n");
00102                     wprintf (L"--------Call GetUserPropertyMethods-----------\n");
00103                     hr = GetUserPropertyMethods(pUser);
00104                     wprintf (L"GetUserPropertyMethods HR: %x\n", hr);
00105                 }
00106                 if ( pUser )
00107                     pUser->Release();
00108             }
00109             else
00110             {
00111                 wprintf(L"User \"%ws\" not Found.\n",pszBuffer);
00112                 wprintf (L"FindUserByName failed with the following HR: %x\n", hr);
00113             }
00114             if ( pObject )
00115                 pObject->Release();
00116         }
00117
00118         if ( pDS )
00119             pDS->Release();
00120     }
00121
00122 //Uninitalize COM
00123     CoUninitialize();
00124
00125     return;
00126 }
00127
00128 HRESULT GetUserPropertyMethods( IADsUser *pUser )
00129 {
00130     VARIANT_BOOL bBool ;
00131     DATE date ;
00132     BSTR bstr ;
00133     LONG lProp ;
00134     VARIANT var ;
00135     HRESULT hr ;
00136     long lBound, uBound ;
00137
00138     if ( NULL == pUser ) {
00139         return( HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER ) ) ;
00140     }
00141     VariantInit( &var ) ;
00142
00143     hr = pUser->get_AccountDisabled( &bBool ) ;
00144     if ( SUCCEEDED( hr ) ) {
00145         wprintf( L"AccountDisabled: %ws\n", ( bBool ? L"TRUE" : L"FALSE" ) ) ;
00146     }
00147     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00148         wprintf( L"AccountDisabled property not found.\n" ) ;
00149     }
00150     else {
00151         wprintf( L"AccountDisabled failed with hr: 0x%08x\n", hr ) ;
00152     }
00153
00154     hr = pUser->get_AccountExpirationDate( &date ) ;
00155     if ( SUCCEEDED( hr ) ) {
00156         var.vt = VT_DATE ;
00157         var.date = date ;
00158         hr = VariantChangeType( &var, &var, VARIANT_NOVALUEPROP, VT_BSTR ) ;
00159         if ( SUCCEEDED( hr ) ) {
00160             wprintf( L"AccountExpirationDate: %ws\n", var.bstrVal ) ;
00161         }
00162         else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00163             wprintf( L"AccountExpirationDate property not found.\n" ) ;
00164         }
00165         else {
00166             wprintf( L"AccountExpirationDate failed with hr: 0x%08x\n", hr ) ;
00167         }
00168         VariantClear( &var ) ;
00169     }
00170
00171     hr = pUser->get_BadLoginAddress( &bstr ) ;
00172     if ( SUCCEEDED( hr ) ) {
00173         wprintf( L"BadLoginAddress: %ws\n", bstr ) ;
00174         SysFreeString( bstr ) ;
00175     }
00176     else {
00177         if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00178             wprintf( L"BadLoginAddress property not found.\n" ) ;
00179         }
00180         else if ( E_ADS_PROPERTY_NOT_SUPPORTED == hr ) {
00181             // Property not supported on all platforms, check documentation.
00182             wprintf( L"BadLoginAddress property is not supported on this platform.\n" ) ;
00183         }
00184         else {
00185             wprintf( L"BadLoginAddress failed with hr: 0x%08x\n", hr ) ;
00186         }
00187     }
00188
00189     hr = pUser->get_BadLoginCount( &lProp ) ;
00190     if ( SUCCEEDED( hr ) ) {
00191         wprintf( L"BadLoginCount: %d\n", lProp ) ;
00192     }
00193     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00194         wprintf( L"BadLoginCount property not found.\n" ) ;
00195     }
00196     else {
00197         wprintf( L"BadLoginCount failed with hr: 0x%08x\n", hr ) ;
00198     }
00199
00200     hr = pUser->get_Department( &bstr ) ;
00201     if ( SUCCEEDED( hr ) ) {
00202         wprintf( L"Department: %ws\n", bstr ) ;
00203         SysFreeString( bstr ) ;
00204     }
00205     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00206         wprintf( L"Department property not found.\n" ) ;
00207     }
00208     else {
00209         wprintf( L"Department failed with hr: 0x%08x\n", hr ) ;
00210     }
00211
00212     hr = pUser->get_Description( &bstr ) ;
00213     if ( SUCCEEDED( hr ) ) {
00214         wprintf( L"Description: %ws\n", bstr ) ;
00215         SysFreeString( bstr ) ;
00216     }
00217     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00218         wprintf( L"Description property not found.\n" ) ;
00219     }
00220     else {
00221         wprintf( L"Description failed with hr: 0x%08x\n", hr ) ;
00222     }
00223
00224     hr = pUser->get_Division( &bstr ) ;
00225     if ( SUCCEEDED( hr ) ) {
00226         wprintf( L"Division: %ws\n", bstr ) ;
00227         SysFreeString( bstr ) ;
00228     }
00229     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00230         wprintf( L"Division property not found.\n" ) ;
00231     }
00232     else {
00233         wprintf( L"Division failed with hr: 0x%08x\n", hr ) ;
00234     }
00235
00236     hr = pUser->get_EmailAddress( &bstr ) ;
00237     if ( SUCCEEDED( hr ) ) {
00238         wprintf( L"EmailAddress: %ws\n", bstr ) ;
00239         SysFreeString( bstr ) ;
00240     }
00241     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00242         wprintf( L"EmailAddress property not found.\n" ) ;
00243     }
00244     else {
00245         wprintf( L"EmailAddress failed with hr: 0x%08x\n", hr ) ;
00246     }
00247
00248     hr = pUser->get_EmployeeID( &bstr ) ;
00249     if ( SUCCEEDED( hr ) ) {
00250         wprintf( L"EmployeeID: %ws\n", bstr ) ;
00251         SysFreeString( bstr ) ;
00252     }
00253     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00254         wprintf( L"EmployeeID property not found.\n" ) ;
00255     }
00256     else {
00257         wprintf( L"EmployeeID failed with hr: 0x%08x\n", hr ) ;
00258     }
00259
00260     hr = pUser->get_FaxNumber( &var ) ;
00261     if ( SUCCEEDED( hr ) ) {
00262         // Note:  This property method can return either a VARIANT with
00263         // type VT_BSTR and a single string, or a VARIANT with type
00264         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
00265         // the target directory's property is single- or multi-valued.
00266         // Generic code should probably handle both cases.
00267         if ( VT_BSTR == var.vt ) {
00268             wprintf( L"FaxNumber: %ws\n", var.bstrVal ) ;
00269         }
00270         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
00271             VARIANT elem ;
00272             VariantInit( &elem ) ;
00273             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
00274                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
00275                 while ( lBound <= uBound ) {
00276                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
00277                         wprintf( L"FaxNumber: %ws\n", elem.bstrVal ) ;
00278                         VariantClear( &elem ) ;
00279                     }
00280                     ++lBound ;
00281                 }
00282             }
00283         }
00284         VariantClear( &var ) ;
00285     }
00286     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00287         wprintf( L"FaxNumber property not found.\n" ) ;
00288     }
00289     else {
00290         wprintf( L"FaxNumber failed with hr: 0x%08x\n", hr ) ;
00291     }
00292
00293     hr = pUser->get_FirstName( &bstr ) ;
00294     if ( SUCCEEDED( hr ) ) {
00295         wprintf( L"FirstName: %ws\n", bstr ) ;
00296         SysFreeString( bstr ) ;
00297     }
00298     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00299         wprintf( L"FirstName property not found.\n" ) ;
00300     }
00301     else {
00302         wprintf( L"FirstName failed with hr: 0x%08x\n", hr ) ;
00303     }
00304
00305     hr = pUser->get_FullName( &bstr ) ;
00306     if ( SUCCEEDED( hr ) ) {
00307         wprintf( L"FullName: %ws\n", bstr ) ;
00308         SysFreeString( bstr ) ;
00309     }
00310     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00311         wprintf( L"FullName property not found.\n" ) ;
00312     }
00313     else {
00314         wprintf( L"FullName failed with hr: 0x%08x\n", hr ) ;
00315     }
00316
00317     hr = pUser->get_GraceLoginsAllowed( &lProp ) ;
00318     if ( SUCCEEDED( hr ) ) {
00319         wprintf( L"GraceLoginsAllowed: %d\n", lProp ) ;
00320     }
00321     else if ( E_ADS_PROPERTY_NOT_SUPPORTED == hr ) {
00322         // Property not supported on all platforms, check documentation.
00323         wprintf( L"GraceLoginsAllowed property is not supported on this platform.\n" ) ;
00324     }
00325     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00326         wprintf( L"GraceLoginsAllowed property not found.\n" ) ;
00327     }
00328     else {
00329         wprintf( L"GraceLoginsAllowed failed with hr: 0x%08x\n", hr ) ;
00330     }
00331
00332     hr = pUser->get_GraceLoginsRemaining( &lProp ) ;
00333     if ( SUCCEEDED( hr ) ) {
00334         wprintf( L"GraceLoginsRemaining: %d\n", lProp ) ;
00335     }
00336     else if ( E_ADS_PROPERTY_NOT_SUPPORTED == hr ) {
00337         // Property not supported on all platforms, check documentation.
00338         wprintf( L"GraceLoginsRemaining property is not supported on this platform.\n" ) ;
00339     }
00340     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00341         wprintf( L"GraceLoginsRemaining property not found.\n" ) ;
00342     }
00343     else {
00344         wprintf( L"GraceLoginsRemaining failed with hr: 0x%08x\n", hr ) ;
00345     }
00346
00347     hr = pUser->get_HomeDirectory( &bstr ) ;
00348     if ( SUCCEEDED( hr ) ) {
00349         wprintf( L"HomeDirectory: %ws\n", bstr ) ;
00350         SysFreeString( bstr ) ;
00351     }
00352     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00353         wprintf( L"HomeDirectory property not found.\n" ) ;
00354     }
00355     else {
00356         wprintf( L"HomeDirectory failed with hr: 0x%08x\n", hr ) ;
00357     }
00358
00359     hr = pUser->get_HomePage( &bstr ) ;
00360     if ( SUCCEEDED( hr ) ) {
00361         wprintf( L"HomePage: %ws\n", bstr ) ;
00362         SysFreeString( bstr ) ;
00363     }
00364     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00365         wprintf( L"HomePage property not found.\n" ) ;
00366     }
00367     else {
00368         wprintf( L"HomePage failed with hr: 0x%08x\n", hr ) ;
00369     }
00370
00371     hr = pUser->get_IsAccountLocked( &bBool ) ;
00372     if ( SUCCEEDED( hr ) ) {
00373         wprintf( L"IsAccountLocked: %ws\n", ( bBool ? L"TRUE" : L"FALSE" ) ) ;
00374     }
00375     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00376         wprintf( L"IsAccountLocked property not found.\n" ) ;
00377     }
00378     else {
00379         wprintf( L"IsAccountLocked failed with hr: 0x%08x\n", hr ) ;
00380     }
00381
00382     hr = pUser->get_Languages( &var ) ;
00383     if ( SUCCEEDED( hr ) ) {
00384         // Note:  This property method can return either a VARIANT with
00385         // type VT_BSTR and a single string, or a VARIANT with type
00386         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
00387         // the target directory's property is single- or multi-valued.
00388         // Generic code should probably handle both cases.
00389         if ( VT_BSTR == var.vt ) {
00390             wprintf( L"Languages: %ws\n", var.bstrVal ) ;
00391         }
00392         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
00393             VARIANT elem ;
00394             VariantInit( &elem ) ;
00395             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
00396                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
00397                 while ( lBound <= uBound ) {
00398                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
00399                         wprintf( L"Languages: %ws\n", elem.bstrVal ) ;
00400                         VariantClear( &elem ) ;
00401                     }
00402                     ++lBound ;
00403                 }
00404             }
00405         }
00406         VariantClear( &var ) ;
00407     }
00408     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00409         wprintf( L"Languages property not found.\n" ) ;
00410     }
00411     else if ( E_ADS_PROPERTY_NOT_SUPPORTED == hr ) {
00412         // Property not supported on all platforms, check documentation.
00413         wprintf( L"Languages property is not supported on this platform.\n" ) ;
00414     }
00415     else {
00416         wprintf( L"Languages failed with hr: 0x%08x\n", hr ) ;
00417     }
00418
00419     hr = pUser->get_LastFailedLogin( &date ) ;
00420     if ( SUCCEEDED( hr ) ) {
00421         var.vt = VT_DATE ;
00422         var.date = date ;
00423         hr = VariantChangeType( &var, &var, VARIANT_NOVALUEPROP, VT_BSTR ) ;
00424         if ( SUCCEEDED( hr ) ) {
00425             wprintf( L"LastFailedLogin: %ws\n", var.bstrVal ) ;
00426         }
00427         else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00428             wprintf( L"LastFailedLogin property not found.\n" ) ;
00429         }
00430         else {
00431             wprintf( L"LastFailedLogin failed with hr: 0x%08x\n", hr ) ;
00432         }
00433         VariantClear( &var ) ;
00434     }
00435
00436     hr = pUser->get_LastLogin( &date ) ;
00437     if ( SUCCEEDED( hr ) ) {
00438         var.vt = VT_DATE ;
00439         var.date = date ;
00440         hr = VariantChangeType( &var, &var, VARIANT_NOVALUEPROP, VT_BSTR ) ;
00441         if ( SUCCEEDED( hr ) ) {
00442             wprintf( L"LastLogin: %ws\n", var.bstrVal ) ;
00443         }
00444         else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00445             wprintf( L"LastLogin property not found.\n" ) ;
00446         }
00447         else {
00448             wprintf( L"LastLogin failed with hr: 0x%08x\n", hr ) ;
00449         }
00450         VariantClear( &var ) ;
00451     }
00452
00453     hr = pUser->get_LastLogoff( &date ) ;
00454     if ( SUCCEEDED( hr ) ) {
00455         var.vt = VT_DATE ;
00456         var.date = date ;
00457         hr = VariantChangeType( &var, &var, VARIANT_NOVALUEPROP, VT_BSTR ) ;
00458         if ( SUCCEEDED( hr ) ) {
00459             wprintf( L"LastLogoff: %ws\n", var.bstrVal ) ;
00460         }
00461         else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00462             wprintf( L"LastLogoff property not found.\n" ) ;
00463         }
00464         else {
00465             wprintf( L"LastLogoff failed with hr: 0x%08x\n", hr ) ;
00466         }
00467         VariantClear( &var ) ;
00468     }
00469
00470     hr = pUser->get_LastName( &bstr ) ;
00471     if ( SUCCEEDED( hr ) ) {
00472         wprintf( L"LastName: %ws\n", bstr ) ;
00473         SysFreeString( bstr ) ;
00474     }
00475     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00476         wprintf( L"LastName property not found.\n" ) ;
00477     }
00478     else {
00479         wprintf( L"LastName failed with hr: 0x%08x\n", hr ) ;
00480     }
00481
00482     hr = pUser->get_LoginHours( &var ) ;
00483     if ( SUCCEEDED( hr ) ) {
00484         wprintf(L"LoginHours:\n");
00485         //For Octet String
00486         void HUGEP *pArray;
00487         ULONG dwSLBound;
00488         ULONG dwSUBound;
00489         if ( var.vt==(VT_UI1|VT_ARRAY) )
00490         {
00491             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var),
00492                                                 1,
00493                                                 (long FAR *) &dwSLBound ) ) &&
00494                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var),
00495                                                 1,
00496                                                 (long FAR *) &dwSUBound ) ) ) {
00497                 hr = SafeArrayAccessData( V_ARRAY(&var),
00498                                           &pArray );
00499
00500                 //21 byte array representing 8 hour blocks for each day.
00501                 //First byte is 16:00-23:59 on saturday.
00502                 //Second byte is 0:00-07:59 on sunday,
00503                 //Third byte is 8:00-15:59 on sunday,
00504                 //and so on up to 8:00-15:59 on saturday.
00505                 PBYTE pLogonHours = (PBYTE)pArray;
00506                 wchar_t szDay[12] ;
00507                 wchar_t szTime[12] ;
00508                 int base = 2;
00509                 //8 bits in a byte.
00510                 DWORD iBitMax = 8;
00511                 DWORD dVal, j;
00512                 int iTotalBytes = 21;
00513                 int iOffset;
00514                 for ( int k = 1; k <= iTotalBytes; k++ )
00515                 {
00516                     if ( k!=iTotalBytes )
00517                         iOffset = k;
00518                     else
00519                         iOffset = 0;
00520                     //Get the block of time during the day.
00521                     switch ( k-1 )
00522                     {
00523                     case 0:
00524                     case 1:
00525                     case 2:
00526                         wcscpy(szDay, L"Sunday" ) ;
00527                         break;
00528                     case 3:
00529                     case 4:
00530                     case 5:
00531                         wcscpy(szDay, L"Monday" ) ;
00532                         break;
00533                     case 6:
00534                     case 7:
00535                     case 8:
00536                         wcscpy(szDay, L"Tuesday" );
00537                         break;
00538                     case 9:
00539                     case 10:
00540                     case 11:
00541                         wcscpy(szDay, L"Wednesday" );
00542                         break;
00543                     case 12:
00544                     case 13:
00545                     case 14:
00546                         wcscpy(szDay, L"Thursday" );
00547                         break;
00548                     case 15:
00549                     case 16:
00550                     case 17:
00551                         wcscpy(szDay, L"Friday" );
00552                         break;
00553                     case 18:
00554                     case 19:
00555                     case 20:
00556                         wcscpy(szDay, L"Saturday");
00557                         break;
00558                     }
00559
00560                     switch ( k-1 )
00561                     {
00562                     case 0:
00563                     case 3:
00564                     case 6:
00565                     case 9:
00566                     case 12:
00567                     case 15:
00568                     case 18:
00569                         for ( j = 0; j < iBitMax; j++ )
00570                         {
00571                             dVal = (DWORD)pow(base, j);
00572                             if ( (pLogonHours[iOffset] & dVal)==dVal )
00573                             {
00574                                 switch ( j )
00575                                 {
00576                                 case 0:
00577                                     wcscpy(szTime, L"00:00-59");
00578                                     break;
00579                                 case 1:
00580                                     wcscpy(szTime, L"01:00-59");
00581                                     break;
00582                                 case 2:
00583                                     wcscpy(szTime, L"02:00-59");
00584                                     break;
00585                                 case 3:
00586                                     wcscpy(szTime, L"03:00-59");
00587                                     break;
00588                                 case 4:
00589                                     wcscpy(szTime, L"04:00-59");
00590                                     break;
00591                                 case 5:
00592                                     wcscpy(szTime, L"05:00-59");
00593                                     break;
00594                                 case 6:
00595                                     wcscpy(szTime, L"06:00-59");
00596                                     break;
00597                                 case 7:
00598                                     wcscpy(szTime, L"07:00-59");
00599                                     break;
00600                                 }
00601                                 wprintf(L"   %ws %ws\n",szDay,szTime);
00602                             }
00603                         }
00604                         break;
00605                     case 1:
00606                     case 4:
00607                     case 7:
00608                     case 10:
00609                     case 13:
00610                     case 16:
00611                     case 19:
00612                         for ( j = 0; j < iBitMax; j++ )
00613                         {
00614                             dVal = (DWORD)pow(base, j);
00615                             if ( (pLogonHours[iOffset] & dVal)==dVal )
00616                             {
00617                                 switch ( j )
00618                                 {
00619                                 case 0:
00620                                     wcscpy(szTime, L"08:00-59");
00621                                     break;
00622                                 case 1:
00623                                     wcscpy(szTime, L"09:00-59");
00624                                     break;
00625                                 case 2:
00626                                     wcscpy(szTime, L"10:00-59");
00627                                     break;
00628                                 case 3:
00629                                     wcscpy(szTime, L"11:00-59");
00630                                     break;
00631                                 case 4:
00632                                     wcscpy(szTime, L"12:00-59");
00633                                     break;
00634                                 case 5:
00635                                     wcscpy(szTime, L"13:00-59");
00636                                     break;
00637                                 case 6:
00638                                     wcscpy(szTime, L"14:00-59");
00639                                     break;
00640                                 case 7:
00641                                     wcscpy(szTime, L"15:00-59");
00642                                     break;
00643                                 }
00644                                 wprintf(L"   %ws %ws\n",szDay,szTime);
00645                             }
00646                         }
00647                         break;
00648                     case 2:
00649                     case 5:
00650                     case 8:
00651                     case 11:
00652                     case 14:
00653                     case 17:
00654                     case 20:
00655                         for ( j = 0; j < iBitMax; j++ )
00656                         {
00657                             dVal = (DWORD)pow(base, j);
00658                             if ( (pLogonHours[iOffset] & dVal)==dVal )
00659                             {
00660                                 switch ( j )
00661                                 {
00662                                 case 0:
00663                                     wcscpy(szTime, L"16:00-59");
00664                                     break;
00665                                 case 1:
00666                                     wcscpy(szTime, L"17:00-59");
00667                                     break;
00668                                 case 2:
00669                                     wcscpy(szTime, L"18:00-59");
00670                                     break;
00671                                 case 3:
00672                                     wcscpy(szTime, L"19:00-59");
00673                                     break;
00674                                 case 4:
00675                                     wcscpy(szTime, L"20:00-59");
00676                                     break;
00677                                 case 5:
00678                                     wcscpy(szTime, L"21:00-59");
00679                                     break;
00680                                 case 6:
00681                                     wcscpy(szTime, L"22:00-59");
00682                                     break;
00683                                 case 7:
00684                                     wcscpy(szTime, L"23:00-59");
00685                                     break;
00686                                 }
00687                                 wprintf(L"   %ws %ws\n",szDay,szTime);
00688                             }
00689                         }
00690                         break;
00691                     }
00692                 }
00693
00694                 //Decrement the access count for the array.
00695                 SafeArrayUnaccessData( V_ARRAY(&var) );
00696             }
00697         }
00698         VariantClear(&var ) ;
00699     }
00700     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00701         wprintf( L"LoginHours property not found.\n" ) ;
00702     }
00703     else {
00704         wprintf( L"LoginHours failed with hr: 0x%08x\n", hr ) ;
00705     }
00706
00707     hr = pUser->get_LoginScript( &bstr ) ;
00708     if ( SUCCEEDED( hr ) ) {
00709         wprintf( L"LoginScript: %ws\n", bstr ) ;
00710         SysFreeString( bstr ) ;
00711     }
00712     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00713         wprintf( L"LoginScript property not found.\n" ) ;
00714     }
00715     else {
00716         wprintf( L"LoginScript failed with hr: 0x%08x\n", hr ) ;
00717     }
00718
00719     hr = pUser->get_LoginWorkstations( &var ) ;
00720     if ( SUCCEEDED( hr ) ) {
00721         if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
00722              SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
00723             VARIANT elem ;
00724             while ( lBound <= uBound ) {
00725                 hr = SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ;
00726                 if ( SUCCEEDED( hr ) ) {
00727                     wprintf( L"LoginWorkstations: %ws\n", elem.bstrVal ) ;
00728                     VariantClear( &elem ) ;
00729                 }
00730                 ++lBound ;
00731             }
00732         }
00733         VariantClear( &var ) ;
00734     }
00735     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00736         wprintf( L"LoginWorkstations property not found.\n" ) ;
00737     }
00738     else {
00739         wprintf( L"LoginWorkstations failed with hr: 0x%08x\n", hr ) ;
00740     }
00741
00742     hr = pUser->get_Manager( &bstr ) ;
00743     if ( SUCCEEDED( hr ) ) {
00744         wprintf( L"Manager: %ws\n", bstr ) ;
00745         SysFreeString( bstr ) ;
00746     }
00747     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00748         wprintf( L"Manager property not found.\n" ) ;
00749     }
00750     else {
00751         wprintf( L"Manager failed with hr: 0x%08x\n", hr ) ;
00752     }
00753
00754     hr = pUser->get_MaxLogins( &lProp ) ;
00755     if ( SUCCEEDED( hr ) ) {
00756         wprintf( L"MaxLogins: %d\n", lProp ) ;
00757     }
00758     else if ( E_ADS_PROPERTY_NOT_SUPPORTED == hr ) {
00759         // Property not supported on all platforms, check documentation.
00760         wprintf( L"MaxLogins property is not supported on this platform.\n" ) ;
00761     }
00762     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00763         wprintf( L"MaxLogins property not found.\n" ) ;
00764     }
00765     else {
00766         wprintf( L"MaxLogins failed with hr: 0x%08x\n", hr ) ;
00767     }
00768
00769     hr = pUser->get_MaxStorage( &lProp ) ;
00770     if ( SUCCEEDED( hr ) ) {
00771         wprintf( L"MaxStorage: %d\n", lProp ) ;
00772     }
00773     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00774         wprintf( L"MaxStorage property not found.\n" ) ;
00775     }
00776     else {
00777         wprintf( L"MaxStorage failed with hr: 0x%08x\n", hr ) ;
00778     }
00779
00780     hr = pUser->get_NamePrefix( &bstr ) ;
00781     if ( SUCCEEDED( hr ) ) {
00782         wprintf( L"NamePrefix: %ws\n", bstr ) ;
00783         SysFreeString( bstr ) ;
00784     }
00785     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00786         wprintf( L"NamePrefix property not found.\n" ) ;
00787     }
00788     else {
00789         wprintf( L"NamePrefix failed with hr: 0x%08x\n", hr ) ;
00790     }
00791
00792     hr = pUser->get_NameSuffix( &bstr ) ;
00793     if ( SUCCEEDED( hr ) ) {
00794         wprintf( L"NameSuffix: %ws\n", bstr ) ;
00795         SysFreeString( bstr ) ;
00796     }
00797     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00798         wprintf( L"NameSuffix property not found.\n" ) ;
00799     }
00800     else {
00801         wprintf( L"NameSuffix failed with hr: 0x%08x\n", hr ) ;
00802     }
00803
00804     hr = pUser->get_OfficeLocations( &var ) ;
00805     if ( SUCCEEDED( hr ) ) {
00806         // Note:  This property method can return either a VARIANT with
00807         // type VT_BSTR and a single string, or a VARIANT with type
00808         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
00809         // the target directory's property is single- or multi-valued.
00810         // Generic code should probably handle both cases.
00811         if ( VT_BSTR == var.vt ) {
00812             wprintf( L"OfficeLocations: %ws\n", var.bstrVal ) ;
00813         }
00814         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
00815             VARIANT elem ;
00816             VariantInit( &elem ) ;
00817             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
00818                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
00819                 while ( lBound <= uBound ) {
00820                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
00821                         wprintf( L"OfficeLocations: %ws\n", elem.bstrVal ) ;
00822                         VariantClear( &elem ) ;
00823                     }
00824                     ++lBound ;
00825                 }
00826             }
00827         }
00828         VariantClear( &var ) ;
00829     }
00830     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00831         wprintf( L"OfficeLocations property not found.\n" ) ;
00832     }
00833     else {
00834         wprintf( L"OfficeLocations failed with hr: 0x%08x\n", hr ) ;
00835     }
00836
00837     hr = pUser->get_OtherName( &bstr ) ;
00838     if ( SUCCEEDED( hr ) ) {
00839         wprintf( L"OtherName: %ws\n", bstr ) ;
00840         SysFreeString( bstr ) ;
00841     }
00842     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00843         wprintf( L"OtherName property not found.\n" ) ;
00844     }
00845     else {
00846         wprintf( L"OtherName failed with hr: 0x%08x\n", hr ) ;
00847     }
00848
00849     hr = pUser->get_PasswordExpirationDate( &date ) ;
00850     if ( SUCCEEDED( hr ) ) {
00851         var.vt = VT_DATE ;
00852         var.date = date ;
00853         hr = VariantChangeType( &var, &var, VARIANT_NOVALUEPROP, VT_BSTR ) ;
00854         if ( SUCCEEDED( hr ) ) {
00855             wprintf( L"PasswordExpirationDate: %ws\n", var.bstrVal ) ;
00856         }
00857         else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00858             wprintf( L"PasswordExpirationDate property not found.\n" ) ;
00859         }
00860         else {
00861             wprintf( L"PasswordExpirationDate failed with hr: 0x%08x\n", hr ) ;
00862         }
00863         VariantClear( &var ) ;
00864     }
00865
00866     hr = pUser->get_PasswordLastChanged( &date ) ;
00867     if ( SUCCEEDED( hr ) ) {
00868         var.vt = VT_DATE ;
00869         var.date = date ;
00870         hr = VariantChangeType( &var, &var, VARIANT_NOVALUEPROP, VT_BSTR ) ;
00871         if ( SUCCEEDED( hr ) ) {
00872             wprintf( L"PasswordLastChanged: %ws\n", var.bstrVal ) ;
00873         }
00874         else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00875             wprintf( L"PasswordLastChanged property not found.\n" ) ;
00876         }
00877         else {
00878             wprintf( L"PasswordLastChanged failed with hr: 0x%08x\n", hr ) ;
00879         }
00880         VariantClear( &var ) ;
00881     }
00882
00883     hr = pUser->get_PasswordMinimumLength( &lProp ) ;
00884     if ( SUCCEEDED( hr ) ) {
00885         wprintf( L"PasswordMinimumLength: %d\n", lProp ) ;
00886     }
00887     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00888         wprintf( L"PasswordMinimumLength property not found.\n" ) ;
00889     }
00890     else {
00891         wprintf( L"PasswordMinimumLength failed with hr: 0x%08x\n", hr ) ;
00892     }
00893
00894     hr = pUser->get_PasswordRequired( &bBool ) ;
00895     if ( SUCCEEDED( hr ) ) {
00896         wprintf( L"PasswordRequired: %ws\n", ( bBool ? L"TRUE" : L"FALSE" ) ) ;
00897     }
00898     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00899         wprintf( L"PasswordRequired property not found.\n" ) ;
00900     }
00901     else {
00902         wprintf( L"PasswordRequired failed with hr: 0x%08x\n", hr ) ;
00903     }
00904
00905     hr = pUser->get_Picture( &var ) ;
00906     if ( SUCCEEDED( hr ) ) {
00907         wprintf( L"Picture is set (not displayed)\n" ) ;
00908         VariantClear( &var ) ;
00909     }
00910     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00911         wprintf( L"Picture property not found.\n" ) ;
00912     }
00913     else {
00914         wprintf( L"Picture failed with hr: 0x%08x\n", hr ) ;
00915     }
00916
00917     hr = pUser->get_PostalAddresses( &var ) ;
00918     if ( SUCCEEDED( hr ) ) {
00919         if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
00920              SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
00921             VARIANT elem ;
00922             while ( lBound <= uBound ) {
00923                 hr = SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ;
00924                 if ( SUCCEEDED( hr ) ) {
00925                     wprintf( L"PostalAddresses: %ws\n", elem.bstrVal ) ;
00926                     VariantClear( &elem ) ;
00927                 }
00928                 ++lBound ;
00929             }
00930         }
00931         VariantClear( &var ) ;
00932     }
00933     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00934         wprintf( L"PostalAddresses property not found.\n" ) ;
00935     }
00936     else {
00937         wprintf( L"PostalAddresses failed with hr: 0x%08x\n", hr ) ;
00938     }
00939
00940     hr = pUser->get_PostalCodes( &var ) ;
00941     if ( SUCCEEDED( hr ) ) {
00942         // Note:  This property method can return either a VARIANT with
00943         // type VT_BSTR and a single string, or a VARIANT with type
00944         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
00945         // the target directory's property is single- or multi-valued.
00946         // Generic code should probably handle both cases.
00947         if ( VT_BSTR == var.vt ) {
00948             wprintf( L"PostalCodes: %ws\n", var.bstrVal ) ;
00949         }
00950         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
00951             VARIANT elem ;
00952             VariantInit( &elem ) ;
00953             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
00954                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
00955                 while ( lBound <= uBound ) {
00956                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
00957                         wprintf( L"PostalCodes: %ws\n", elem.bstrVal ) ;
00958                         VariantClear( &elem ) ;
00959                     }
00960                     ++lBound ;
00961                 }
00962             }
00963         }
00964         VariantClear( &var ) ;
00965     }
00966     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00967         wprintf( L"PostalCodes property not found.\n" ) ;
00968     }
00969     else {
00970         wprintf( L"PostalCodes failed with hr: 0x%08x\n", hr ) ;
00971     }
00972
00973     hr = pUser->get_Profile( &bstr ) ;
00974     if ( SUCCEEDED( hr ) ) {
00975         wprintf( L"Profile: %ws\n", bstr ) ;
00976         SysFreeString( bstr ) ;
00977     }
00978     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00979         wprintf( L"Profile property not found.\n" ) ;
00980     }
00981     else {
00982         wprintf( L"Profile failed with hr: 0x%08x\n", hr ) ;
00983     }
00984
00985     hr = pUser->get_RequireUniquePassword( &bBool ) ;
00986     if ( SUCCEEDED( hr ) ) {
00987         wprintf( L"RequireUniquePassword: %ws\n", ( bBool ? L"TRUE" : L"FALSE" ) ) ;
00988     }
00989     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
00990         wprintf( L"RequireUniquePassword property not found.\n" ) ;
00991     }
00992     else {
00993         wprintf( L"RequireUniquePassword failed with hr: 0x%08x\n", hr ) ;
00994     }
00995
00996     hr = pUser->get_SeeAlso( &var ) ;
00997     if ( SUCCEEDED( hr ) ) {
00998         if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
00999              SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
01000             VARIANT elem ;
01001             while ( lBound <= uBound ) {
01002                 hr = SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ;
01003                 if ( SUCCEEDED( hr ) ) {
01004                     wprintf( L"SeeAlso: %ws\n", elem.bstrVal ) ;
01005                     VariantClear( &elem ) ;
01006                 }
01007                 ++lBound ;
01008             }
01009         }
01010         VariantClear( &var ) ;
01011     }
01012     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
01013         wprintf( L"SeeAlso property not found.\n" ) ;
01014     }
01015     else {
01016         wprintf( L"SeeAlso failed with hr: 0x%08x\n", hr ) ;
01017     }
01018
01019     hr = pUser->get_TelephoneHome( &var ) ;
01020     if ( SUCCEEDED( hr ) ) {
01021         // Note:  This property method can return either a VARIANT with
01022         // type VT_BSTR and a single string, or a VARIANT with type
01023         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
01024         // the target directory's property is single- or multi-valued.
01025         // Generic code should probably handle both cases.
01026         if ( VT_BSTR == var.vt ) {
01027             wprintf( L"TelephoneHome: %ws\n", var.bstrVal ) ;
01028         }
01029         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
01030             VARIANT elem ;
01031             VariantInit( &elem ) ;
01032             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
01033                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
01034                 while ( lBound <= uBound ) {
01035                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
01036                         wprintf( L"TelephoneHome: %ws\n", elem.bstrVal ) ;
01037                         VariantClear( &elem ) ;
01038                     }
01039                     ++lBound ;
01040                 }
01041             }
01042         }
01043         VariantClear( &var ) ;
01044     }
01045     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
01046         wprintf( L"TelephoneHome property not found.\n" ) ;
01047     }
01048     else {
01049         wprintf( L"TelephoneHome failed with hr: 0x%08x\n", hr ) ;
01050     }
01051
01052     hr = pUser->get_TelephoneMobile( &var ) ;
01053     if ( SUCCEEDED( hr ) ) {
01054         // Note:  This property method can return either a VARIANT with
01055         // type VT_BSTR and a single string, or a VARIANT with type
01056         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
01057         // the target directory's property is single- or multi-valued.
01058         // Generic code should probably handle both cases.
01059         if ( VT_BSTR == var.vt ) {
01060             wprintf( L"TelephoneMobile: %ws\n", var.bstrVal ) ;
01061         }
01062         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
01063             VARIANT elem ;
01064             VariantInit( &elem ) ;
01065             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
01066                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
01067                 while ( lBound <= uBound ) {
01068                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
01069                         wprintf( L"TelephoneMobile: %ws\n", elem.bstrVal ) ;
01070                         VariantClear( &elem ) ;
01071                     }
01072                     ++lBound ;
01073                 }
01074             }
01075         }
01076         VariantClear( &var ) ;
01077     }
01078     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
01079         wprintf( L"TelephoneMobile property not found.\n" ) ;
01080     }
01081     else {
01082         wprintf( L"TelephoneMobile failed with hr: 0x%08x\n", hr ) ;
01083     }
01084
01085     hr = pUser->get_TelephoneNumber( &var ) ;
01086     if ( SUCCEEDED( hr ) ) {
01087         // Note:  This property method can return either a VARIANT with
01088         // type VT_BSTR and a single string, or a VARIANT with type
01089         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
01090         // the target directory's property is single- or multi-valued.
01091         // Generic code should probably handle both cases.
01092         if ( VT_BSTR == var.vt ) {
01093             wprintf( L"TelephoneNumber: %ws\n", var.bstrVal ) ;
01094         }
01095         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
01096             VARIANT elem ;
01097             VariantInit( &elem ) ;
01098             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
01099                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
01100                 while ( lBound <= uBound ) {
01101                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
01102                         wprintf( L"TelephoneNumber: %ws\n", elem.bstrVal ) ;
01103                         VariantClear( &elem ) ;
01104                     }
01105                     ++lBound ;
01106                 }
01107             }
01108         }
01109         VariantClear( &var ) ;
01110     }
01111     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
01112         wprintf( L"TelephoneNumber property not found.\n" ) ;
01113     }
01114     else {
01115         wprintf( L"TelephoneNumber failed with hr: 0x%08x\n", hr ) ;
01116     }
01117
01118     hr = pUser->get_TelephonePager( &var ) ;
01119     if ( SUCCEEDED( hr ) ) {
01120         // Note:  This property method can return either a VARIANT with
01121         // type VT_BSTR and a single string, or a VARIANT with type
01122         // VT_ARRAY | VT_BSTR and multiple strings, depending on whether
01123         // the target directory's property is single- or multi-valued.
01124         // Generic code should probably handle both cases.
01125         if ( VT_BSTR == var.vt ) {
01126             wprintf( L"TelephonePager: %ws\n", var.bstrVal ) ;
01127         }
01128         else if ( ( VT_ARRAY | VT_BSTR ) == var.vt ) {
01129             VARIANT elem ;
01130             VariantInit( &elem ) ;
01131             if ( SUCCEEDED( SafeArrayGetLBound( V_ARRAY(&var), 1, &lBound ) ) &&
01132                  SUCCEEDED( SafeArrayGetUBound( V_ARRAY(&var), 1, &uBound ) ) ) {
01133                 while ( lBound <= uBound ) {
01134                     if ( SUCCEEDED( SafeArrayGetElement( V_ARRAY(&var), &lBound, &elem ) ) ) {
01135                         wprintf( L"TelephonePager: %ws\n", elem.bstrVal ) ;
01136                         VariantClear( &elem ) ;
01137                     }
01138                     ++lBound ;
01139                 }
01140             }
01141         }
01142         VariantClear( &var ) ;
01143     }
01144     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
01145         wprintf( L"TelephonePager property not found.\n" ) ;
01146     }
01147     else {
01148         wprintf( L"TelephonePager failed with hr: 0x%08x\n", hr ) ;
01149     }
01150
01151     hr = pUser->get_Title( &bstr ) ;
01152     if ( SUCCEEDED( hr ) ) {
01153         wprintf( L"Title: %ws\n", bstr ) ;
01154         SysFreeString( bstr ) ;
01155     }
01156     else if ( E_ADS_PROPERTY_NOT_FOUND == hr ) {
01157         wprintf( L"Title property not found.\n" ) ;
01158     }
01159     else {
01160         wprintf( L"Title failed with hr: 0x%08x\n", hr ) ;
01161     }
01162
01163     return( S_OK ) ;
01164 }
01165
01166 HRESULT FindUserByName( IDirectorySearch *pSearchBase,
01167                         LPWSTR szFindUser,
01168                         IADs **ppUser )
01169 {
01170     HRESULT hr ;
01171     wchar_t pszSearchFilter[MAX_PATH] ;
01172     wchar_t pszADsPath[MAX_PATH] ;
01173     ADS_SEARCHPREF_INFO searchPrefs ;
01174     ADS_SEARCH_COLUMN col ;
01175     ADS_SEARCH_HANDLE hSearch ;
01176     LPWSTR pszAttribute[1] = { L"ADsPath"} ;
01177
01178     if ( NULL == pSearchBase || NULL == szFindUser || NULL == ppUser ) {
01179         return( E_INVALIDARG ) ;
01180     }
01181
01182     // build our search filter.
01183     if ( 0 > _snwprintf( pszSearchFilter, MAX_PATH, L"(&(objectCategory=person)(objectClass=user)(cn=%ws))", szFindUser ) ) {
01184         // uh oh, username is too long.  just abort.
01185         return( E_INVALIDARG ) ;
01186     }
01187     ZeroMemory(&searchPrefs, sizeof( searchPrefs ) ) ;
01188     searchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE ;
01189     searchPrefs.vValue.dwType = ADSTYPE_INTEGER ;
01190     searchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE ;
01191     hr = pSearchBase->SetSearchPreference( &searchPrefs, 1 ) ;
01192     if ( FAILED( hr ) ) {
01193         return( hr ) ;
01194     }
01195     hr = pSearchBase->ExecuteSearch( pszSearchFilter, pszAttribute, 1, &hSearch ) ;
01196     if ( SUCCEEDED( hr ) ) {
01197         if ( S_ADS_NOMORE_ROWS != pSearchBase->GetNextRow( hSearch ) ) {
01198             hr = pSearchBase->GetColumn( hSearch, pszAttribute[0], &col ) ;
01199             if ( SUCCEEDED( hr ) ) {
01200                 wcsncpy( pszADsPath, col.pADsValues->CaseIgnoreString, MAX_PATH ) ;
01201                 pszADsPath[MAX_PATH-1] = 0 ;
01202                 hr = ADsOpenObject( pszADsPath, NULL, NULL, ADS_SECURE_AUTHENTICATION, IID_IADs, (void**)ppUser ) ;
01203                 if ( SUCCEEDED( hr ) ) {
01204                     wprintf( L"Found User.\n" ) ;
01205                     wprintf( L"%ws: %ws\n", pszAttribute[0], pszADsPath ) ;
01206                 }
01207                 pSearchBase->FreeColumn( &col ) ;
01208             }
01209         }
01210         pSearchBase->CloseSearchHandle( hSearch ) ;
01211     }
01212     return( hr ) ;
01213
01214 }
01215
01216
01217
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/MyDevice.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

MyDevice.h

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Fri Apr 12 22:33:43 2002
00006  */
00007 /* Compiler settings for C:\UPnPSample\SDKDimmer\DimmerDevice\StepByStep\Step3\MyDevice.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013
00014 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00015 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00016 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00017 #endif
00018
00019 #include "rpc.h"
00020 #include "rpcndr.h"
00021
00022 #ifndef __MyDevice_h__
00023 #define __MyDevice_h__
00024
00025 #ifdef __cplusplus
00026 extern "C"{
00027 #endif
00028
00029 /* Forward Declarations */
00030
00031 #ifndef __IUPnPService_DimmingService_SCPD_FWD_DEFINED__
00032 #define __IUPnPService_DimmingService_SCPD_FWD_DEFINED__
00033 typedef interface IUPnPService_DimmingService_SCPD IUPnPService_DimmingService_SCPD;
00034 #endif  /* __IUPnPService_DimmingService_SCPD_FWD_DEFINED__ */
00035
00036
00037 #ifndef __Dimmer_FWD_DEFINED__
00038 #define __Dimmer_FWD_DEFINED__
00039
00040 #ifdef __cplusplus
00041 typedef class Dimmer Dimmer;
00042 #else
00043 typedef struct Dimmer Dimmer;
00044 #endif /* __cplusplus */
00045
00046 #endif  /* __Dimmer_FWD_DEFINED__ */
00047
00048
00049 /* header files for imported files */
00050 #include "oaidl.h"
00051 #include "ocidl.h"
00052
00053 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00054 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00055
00056
00057 #ifndef __MYDEVICELib_LIBRARY_DEFINED__
00058 #define __MYDEVICELib_LIBRARY_DEFINED__
00059
00060 /* library MYDEVICELib */
00061 /* [helpstring][version][uuid] */
00062
00063 typedef /* [v1_enum] */
00064 enum DIMMINGSERVICE_SCPD_DISPIDS
00065     { DISPID_POWER  = 1,
00066   DISPID_DIMLEVEL = DISPID_POWER + 1,
00067   DISPID_POWERON  = DISPID_DIMLEVEL + 1,
00068   DISPID_POWEROFF = DISPID_POWERON + 1,
00069   DISPID_GETPOWERVALUE  = DISPID_POWEROFF + 1,
00070   DISPID_SETDIMLEVEL  = DISPID_GETPOWERVALUE + 1,
00071   DISPID_GETDIMLEVEL  = DISPID_SETDIMLEVEL + 1,
00072   DISPID_GETCONFIGDETAILS = DISPID_GETDIMLEVEL + 1
00073     } DIMMINGSERVICE_SCPD_DISPIDS;
00074
00075
00076 EXTERN_C const IID LIBID_MYDEVICELib;
00077
00078 #ifndef __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__
00079 #define __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__
00080
00081 /* interface IUPnPService_DimmingService_SCPD */
00082 /* [object][unique][oleautomation][uuid] */
00083
00084
00085 EXTERN_C const IID IID_IUPnPService_DimmingService_SCPD;
00086
00087 #if defined(__cplusplus) && !defined(CINTERFACE)
00088
00089     MIDL_INTERFACE("a315fcbd-7f4b-4081-a172-2f534c438957")
00090     IUPnPService_DimmingService_SCPD : public IDispatch
00091     {
00092     public:
00093         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Power(
00094             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pPower) = 0;
00095
00096         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_dimLevel(
00097             /* [retval][out] */ long __RPC_FAR *pdimLevel) = 0;
00098
00099         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PowerOn( void) = 0;
00100
00101         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PowerOff( void) = 0;
00102
00103         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetPowerValue(
00104             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVall) = 0;
00105
00106         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetDimLevel(
00107             /* [in] */ long dLevel) = 0;
00108
00109         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetDimLevel(
00110             /* [out][in] */ long __RPC_FAR *pdLevel) = 0;
00111
00112         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetConfigDetails(
00113             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVal,
00114             /* [out][in] */ long __RPC_FAR *pdLevel) = 0;
00115
00116     };
00117
00118 #else   /* C style interface */
00119
00120     typedef struct IUPnPService_DimmingService_SCPDVtbl
00121     {
00122         BEGIN_INTERFACE
00123
00124         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00125             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00126             /* [in] */ REFIID riid,
00127             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00128
00129         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00130             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00131
00132         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00133             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00134
00135         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
00136             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00137             /* [out] */ UINT __RPC_FAR *pctinfo);
00138
00139         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
00140             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00141             /* [in] */ UINT iTInfo,
00142             /* [in] */ LCID lcid,
00143             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
00144
00145         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
00146             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00147             /* [in] */ REFIID riid,
00148             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
00149             /* [in] */ UINT cNames,
00150             /* [in] */ LCID lcid,
00151             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
00152
00153         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
00154             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00155             /* [in] */ DISPID dispIdMember,
00156             /* [in] */ REFIID riid,
00157             /* [in] */ LCID lcid,
00158             /* [in] */ WORD wFlags,
00159             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
00160             /* [out] */ VARIANT __RPC_FAR *pVarResult,
00161             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
00162             /* [out] */ UINT __RPC_FAR *puArgErr);
00163
00164         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Power )(
00165             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00166             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pPower);
00167
00168         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_dimLevel )(
00169             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00170             /* [retval][out] */ long __RPC_FAR *pdimLevel);
00171
00172         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PowerOn )(
00173             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00174
00175         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PowerOff )(
00176             IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00177
00178         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetPowerValue )(
00179             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00180             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVall);
00181
00182         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetDimLevel )(
00183             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00184             /* [in] */ long dLevel);
00185
00186         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetDimLevel )(
00187             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00188             /* [out][in] */ long __RPC_FAR *pdLevel);
00189
00190         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetConfigDetails )(
00191             IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00192             /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVal,
00193             /* [out][in] */ long __RPC_FAR *pdLevel);
00194
00195         END_INTERFACE
00196     } IUPnPService_DimmingService_SCPDVtbl;
00197
00198     interface IUPnPService_DimmingService_SCPD
00199     {
00200         CONST_VTBL struct IUPnPService_DimmingService_SCPDVtbl __RPC_FAR *lpVtbl;
00201     };
00202
00203
00204
00205 #ifdef COBJMACROS
00206
00207
00208 #define IUPnPService_DimmingService_SCPD_QueryInterface(This,riid,ppvObject)  \
00209     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00210
00211 #define IUPnPService_DimmingService_SCPD_AddRef(This) \
00212     (This)->lpVtbl -> AddRef(This)
00213
00214 #define IUPnPService_DimmingService_SCPD_Release(This)  \
00215     (This)->lpVtbl -> Release(This)
00216
00217
00218 #define IUPnPService_DimmingService_SCPD_GetTypeInfoCount(This,pctinfo) \
00219     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
00220
00221 #define IUPnPService_DimmingService_SCPD_GetTypeInfo(This,iTInfo,lcid,ppTInfo)  \
00222     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
00223
00224 #define IUPnPService_DimmingService_SCPD_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)  \
00225     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
00226
00227 #define IUPnPService_DimmingService_SCPD_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)  \
00228     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
00229
00230
00231 #define IUPnPService_DimmingService_SCPD_get_Power(This,pPower) \
00232     (This)->lpVtbl -> get_Power(This,pPower)
00233
00234 #define IUPnPService_DimmingService_SCPD_get_dimLevel(This,pdimLevel) \
00235     (This)->lpVtbl -> get_dimLevel(This,pdimLevel)
00236
00237 #define IUPnPService_DimmingService_SCPD_PowerOn(This)  \
00238     (This)->lpVtbl -> PowerOn(This)
00239
00240 #define IUPnPService_DimmingService_SCPD_PowerOff(This) \
00241     (This)->lpVtbl -> PowerOff(This)
00242
00243 #define IUPnPService_DimmingService_SCPD_GetPowerValue(This,ppowerVall) \
00244     (This)->lpVtbl -> GetPowerValue(This,ppowerVall)
00245
00246 #define IUPnPService_DimmingService_SCPD_SetDimLevel(This,dLevel) \
00247     (This)->lpVtbl -> SetDimLevel(This,dLevel)
00248
00249 #define IUPnPService_DimmingService_SCPD_GetDimLevel(This,pdLevel)  \
00250     (This)->lpVtbl -> GetDimLevel(This,pdLevel)
00251
00252 #define IUPnPService_DimmingService_SCPD_GetConfigDetails(This,ppowerVal,pdLevel) \
00253     (This)->lpVtbl -> GetConfigDetails(This,ppowerVal,pdLevel)
00254
00255 #endif /* COBJMACROS */
00256
00257
00258 #endif  /* C style interface */
00259
00260
00261
00262 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_get_Power_Proxy(
00263     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00264     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pPower);
00265
00266
00267 void __RPC_STUB IUPnPService_DimmingService_SCPD_get_Power_Stub(
00268     IRpcStubBuffer *This,
00269     IRpcChannelBuffer *_pRpcChannelBuffer,
00270     PRPC_MESSAGE _pRpcMessage,
00271     DWORD *_pdwStubPhase);
00272
00273
00274 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_get_dimLevel_Proxy(
00275     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00276     /* [retval][out] */ long __RPC_FAR *pdimLevel);
00277
00278
00279 void __RPC_STUB IUPnPService_DimmingService_SCPD_get_dimLevel_Stub(
00280     IRpcStubBuffer *This,
00281     IRpcChannelBuffer *_pRpcChannelBuffer,
00282     PRPC_MESSAGE _pRpcMessage,
00283     DWORD *_pdwStubPhase);
00284
00285
00286 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_PowerOn_Proxy(
00287     IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00288
00289
00290 void __RPC_STUB IUPnPService_DimmingService_SCPD_PowerOn_Stub(
00291     IRpcStubBuffer *This,
00292     IRpcChannelBuffer *_pRpcChannelBuffer,
00293     PRPC_MESSAGE _pRpcMessage,
00294     DWORD *_pdwStubPhase);
00295
00296
00297 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_PowerOff_Proxy(
00298     IUPnPService_DimmingService_SCPD __RPC_FAR * This);
00299
00300
00301 void __RPC_STUB IUPnPService_DimmingService_SCPD_PowerOff_Stub(
00302     IRpcStubBuffer *This,
00303     IRpcChannelBuffer *_pRpcChannelBuffer,
00304     PRPC_MESSAGE _pRpcMessage,
00305     DWORD *_pdwStubPhase);
00306
00307
00308 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_GetPowerValue_Proxy(
00309     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00310     /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVall);
00311
00312
00313 void __RPC_STUB IUPnPService_DimmingService_SCPD_GetPowerValue_Stub(
00314     IRpcStubBuffer *This,
00315     IRpcChannelBuffer *_pRpcChannelBuffer,
00316     PRPC_MESSAGE _pRpcMessage,
00317     DWORD *_pdwStubPhase);
00318
00319
00320 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_SetDimLevel_Proxy(
00321     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00322     /* [in] */ long dLevel);
00323
00324
00325 void __RPC_STUB IUPnPService_DimmingService_SCPD_SetDimLevel_Stub(
00326     IRpcStubBuffer *This,
00327     IRpcChannelBuffer *_pRpcChannelBuffer,
00328     PRPC_MESSAGE _pRpcMessage,
00329     DWORD *_pdwStubPhase);
00330
00331
00332 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_GetDimLevel_Proxy(
00333     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00334     /* [out][in] */ long __RPC_FAR *pdLevel);
00335
00336
00337 void __RPC_STUB IUPnPService_DimmingService_SCPD_GetDimLevel_Stub(
00338     IRpcStubBuffer *This,
00339     IRpcChannelBuffer *_pRpcChannelBuffer,
00340     PRPC_MESSAGE _pRpcMessage,
00341     DWORD *_pdwStubPhase);
00342
00343
00344 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IUPnPService_DimmingService_SCPD_GetConfigDetails_Proxy(
00345     IUPnPService_DimmingService_SCPD __RPC_FAR * This,
00346     /* [out][in] */ VARIANT_BOOL __RPC_FAR *ppowerVal,
00347     /* [out][in] */ long __RPC_FAR *pdLevel);
00348
00349
00350 void __RPC_STUB IUPnPService_DimmingService_SCPD_GetConfigDetails_Stub(
00351     IRpcStubBuffer *This,
00352     IRpcChannelBuffer *_pRpcChannelBuffer,
00353     PRPC_MESSAGE _pRpcMessage,
00354     DWORD *_pdwStubPhase);
00355
00356
00357
00358 #endif  /* __IUPnPService_DimmingService_SCPD_INTERFACE_DEFINED__ */
00359
00360
00361 EXTERN_C const CLSID CLSID_Dimmer;
00362
00363 #ifdef __cplusplus
00364
00365 class DECLSPEC_UUID("d31b8f49-367e-41b7-8fc4-50e23d36625d")
00366 Dimmer;
00367 #endif
00368 #endif /* __MYDEVICELib_LIBRARY_DEFINED__ */
00369
00370 /* Additional Prototypes for ALL interfaces */
00371
00372 /* end of Additional Prototypes */
00373
00374 #ifdef __cplusplus
00375 }
00376 #endif
00377
00378 #endif
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/tracedp/TraceDp.c Source File

  • WinBase
  • EventTrace
  • tracedp

TraceDp.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 Module Name:
00006
00007     tracedp.c
00008
00009 Abstract:
00010
00011     Sample trace provider program.
00012
00013 --*/
00014
00015 #include <stdio.h>
00016 #include <stdlib.h>
00017
00018 #include <windows.h>
00019 #include <shellapi.h>
00020 #include <tchar.h>
00021 #include <wmistr.h>
00022
00023 #include <guiddef.h>
00024 #include <evntrace.h>
00025
00026 #define DEFAULT_EVENTS                  5000
00027 #define MAXSTR                          1024
00028
00029 TRACEHANDLE LoggerHandle;
00030
00031 // Control GUID for this provider.
00032 GUID   ControlGuid  =
00033     {0xd58c126f, 0xb309, 0x11d1, 0x96, 0x9e, 0x00, 0x00, 0xf8, 0x75, 0xa5, 0xbc};
00034
00035
00036 // Only one transaction GUID will be registered for this provider.
00037 GUID TransactionGuid =
00038     {0xce5b1020, 0x8ea9, 0x11d0, 0xa4, 0xec, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10};
00039 // Array for transaction GUID registration.
00040 TRACE_GUID_REGISTRATION TraceGuidReg[] =
00041 {
00042     { (LPGUID)&TransactionGuid,
00043       NULL
00044     }
00045 };
00046
00047 // User event layout: one ULONG.
00048 typedef struct _USER_EVENT {
00049     EVENT_TRACE_HEADER    Header;
00050     ULONG                 EventInfo;
00051 } USER_EVENT, *PUSER_EVENT;
00052
00053 // Registration handle.
00054 TRACEHANDLE RegistrationHandle;
00055 // Trace on/off switch, level, and flag.
00056 BOOLEAN TraceOnFlag;
00057 ULONG EnableLevel = 0;
00058 ULONG EnableFlags = 0;
00059
00060 // Number of events to be logged. The actual number can be less if disabled early.
00061 ULONG MaxEvents = DEFAULT_EVENTS;
00062 // To keep track of events logged.
00063 ULONG EventCount = 0;
00064
00065 // ControlCallback function for enable/disable.
00066 ULONG
00067 ControlCallback(
00068     IN WMIDPREQUESTCODE RequestCode,
00069     IN PVOID Context,
00070     IN OUT ULONG *InOutBufferSize,
00071     IN OUT PVOID Buffer
00072     );
00073
00074 // Main work to be traced is done here.
00075 void
00076 DoWork();
00077
00078 __cdecl main(argc, argv)
00079     int argc;
00080     char **argv;
00081 /*++
00082
00083 Routine Description:
00084
00085     main() routine.
00086
00087 Arguments:
00088
00089     Usage: TraceDp [number of events]
00090                 [number of events] default is 5000
00091
00092 Return Value:
00093
00094         Error Code defined in winerror.h : If the function succeeds,
00095                 it returns ERROR_SUCCESS (== 0).
00096
00097 --*/
00098 {
00099     ULONG Status, i;
00100     LPTSTR *targv, *utargv = NULL;
00101
00102     TraceOnFlag = FALSE;
00103
00104 #ifdef UNICODE
00105     if ((targv = CommandLineToArgvW(
00106                       GetCommandLineW(),    // pointer to a command-line string
00107                       &argc                 // receives the argument count
00108                       )) == NULL)
00109     {
00110         return (GetLastError());
00111     };
00112     utargv = targv;
00113 #else
00114     targv = argv;
00115 #endif
00116
00117     // process command line arguments to override defaults
00118     if (argc == 2) {
00119         targv ++;
00120         if (**targv >= _T('0') && **targv <= _T('9')) {
00121             MaxEvents = _ttoi(targv[0]);
00122         }
00123         else if (!_tcsicmp(targv[0], _T("/?")) || !_tcsicmp(targv[0], _T("-?"))) {
00124             printf("Usage: TraceDp [number of events]\n");
00125             printf("\t[number of events]        default is 5000\n");
00126
00127             return ERROR_SUCCESS;
00128         }
00129     }
00130
00131     // Free temporary argument buffer.
00132     if (utargv != NULL) {
00133         GlobalFree(utargv);
00134     }
00135
00136     // Event provider registration.
00137     Status = RegisterTraceGuids(
00138                 (WMIDPREQUEST)ControlCallback,   // callback function
00139                 0,
00140                 &ControlGuid,
00141                 1,
00142                 TraceGuidReg,
00143                 NULL,
00144                 NULL,
00145                 &RegistrationHandle
00146              );
00147
00148     if (Status != ERROR_SUCCESS) {
00149         _tprintf(_T("Trace registration failed. Status=%d\n"), Status);
00150         return(Status);
00151     }
00152     else {
00153         _tprintf(_T("Trace registered successfully\n"));
00154     }
00155
00156     _tprintf(_T("Testing Logger with %d events\n"),
00157             MaxEvents);
00158
00159     // Sleep until enabled by a trace controller. In this sample, we wait to be
00160     // enabled for tracing. However, normal applications should continue and log
00161     // events when enabled later on.
00162     while (!TraceOnFlag) {
00163         _sleep(1000);
00164     }
00165
00166     // Do the work while logging events. We trace two events (START and END) for
00167     // each call to DoWork.
00168     for (i = 0; i < MaxEvents / 2; i++) {
00169         DoWork();
00170     }
00171
00172     // Unregister.
00173     UnregisterTraceGuids(RegistrationHandle);
00174
00175     return ERROR_SUCCESS;
00176 }
00177
00178 ULONG
00179 ControlCallback(
00180     IN WMIDPREQUESTCODE RequestCode,
00181     IN PVOID Context,
00182     IN OUT ULONG *InOutBufferSize,
00183     IN OUT PVOID Buffer
00184 )
00185 /*++
00186
00187 Routine Description:
00188
00189     Callback function when enabled.
00190
00191 Arguments:
00192
00193     RequestCode - Flag for either enable or disable.
00194     Context - User-defined context.
00195     InOutBufferSize - not used.
00196     Buffer - WNODE_HEADER for the logger session.
00197
00198 Return Value:
00199
00200     Error Status. ERROR_SUCCESS if successful.
00201
00202 --*/
00203 {
00204     ULONG Status;
00205     ULONG RetSize;
00206
00207     Status = ERROR_SUCCESS;
00208
00209     switch (RequestCode)
00210     {
00211         case WMI_ENABLE_EVENTS:
00212         {
00213             RetSize = 0;
00214             LoggerHandle = GetTraceLoggerHandle( Buffer );
00215             EnableLevel = GetTraceEnableLevel(LoggerHandle);
00216             EnableFlags = GetTraceEnableFlags(LoggerHandle);
00217             _tprintf(_T("Logging enabled to 0x%016I64x(%d,%d,%d)\n"),
00218                     LoggerHandle, RequestCode, EnableLevel, EnableFlags);
00219             TraceOnFlag = TRUE;
00220             break;
00221         }
00222         case WMI_DISABLE_EVENTS:
00223         {
00224             TraceOnFlag = FALSE;
00225             RetSize = 0;
00226             LoggerHandle = 0;
00227             _tprintf(_T("\nLogging Disabled\n"));
00228             break;
00229         }
00230         default:
00231         {
00232             RetSize = 0;
00233             Status = ERROR_INVALID_PARAMETER;
00234             break;
00235         }
00236
00237     }
00238
00239     *InOutBufferSize = RetSize;
00240     return(Status);
00241 }
00242
00243 void
00244 DoWork()
00245 /*++
00246
00247 Routine Description:
00248
00249     Logs events.
00250
00251 Arguments:
00252
00253 Return Value:
00254
00255     None.
00256
00257 --*/
00258 {
00259     USER_EVENT UserEvent;
00260     ULONG Status;
00261
00262     RtlZeroMemory(&UserEvent, sizeof(UserEvent));
00263     UserEvent.Header.Size  = sizeof(USER_EVENT);
00264     UserEvent.Header.Flags = WNODE_FLAG_TRACED_GUID;
00265     UserEvent.Header.Guid  = TransactionGuid;
00266
00267     // Log START event to indicate a start of a routine or activity.
00268     // We log EventCount as data.
00269     if (TraceOnFlag) {
00270         UserEvent.Header.Class.Type         = EVENT_TRACE_TYPE_START;
00271         UserEvent.EventInfo = ++EventCount;
00272         Status = TraceEvent(
00273                         LoggerHandle,
00274                         (PEVENT_TRACE_HEADER) & UserEvent);
00275         if (Status != ERROR_SUCCESS) {
00276             // TraceEvent() failed. This could happen when the logger
00277             // cannot keep up with too many events logged rapidly.
00278             // In such cases, the return valid is
00279             // ERROR_NOT_ENOUGH_MEMORY.
00280             _tprintf(_T("TraceEvent failed. Status=%d\n"), Status);
00281         }
00282     }
00283
00284     //
00285     // Main body of the work in this routine comes here.
00286     //
00287     _sleep(1);
00288
00289     // Log END event to indicate an end of a routine or activity.
00290     // We log EventCount as data.
00291     if (TraceOnFlag) {
00292         UserEvent.Header.Class.Type         = EVENT_TRACE_TYPE_END;
00293         UserEvent.EventInfo = ++EventCount;
00294         Status = TraceEvent(
00295                         LoggerHandle,
00296                         (PEVENT_TRACE_HEADER) & UserEvent);
00297         if (Status != ERROR_SUCCESS) {
00298             // TraceEvent() failed. This could happen when the logger
00299             // cannot keep up with too many events logged rapidly.
00300             // In such cases, the return valid is
00301             // ERROR_NOT_ENOUGH_MEMORY.
00302             _tprintf(_T("TraceEvent failed. Status=%d\n"), Status);
00303         }
00304     }
00305 }
00306
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/BYOTSampleWeb/_ScriptLibrary/rsProxy.java Source File

  • Com
  • Services
  • BYOT
  • BYOTSampleWeb
  • _ScriptLibrary

rsProxy.java

Go to the documentation of this file.
00001 // ************************************************************************
00002 // Microsoft Script Library
00003 // Visual InterDev 6.0 Remote Scripting proxy
00004 // Copyright 1998 Microsoft Corporation. All Rights Reserved.
00005 // ************************************************************************
00006 import java.applet.*;
00007 import java.awt.*;
00008
00009 import java.net.URL;
00010 import java.io.InputStream;
00011 import java.io.IOException;
00012
00013
00014
00015 //==============================================================================
00016 // Main Class for applet RSProxy
00017 //
00018 //==============================================================================
00019 public class RSProxy extends Applet implements Runnable
00020 {
00021
00022   // APPLET INFO SUPPORT:
00023   // The getAppletInfo() method returns a string describing the applet's
00024   // author, copyright date, or miscellaneous information.
00025     //--------------------------------------------------------------------------
00026     public String getAppletInfo()
00027     {
00028     return  "Name: RSProxy\r\n" +
00029         "Author: Microsoft\r\n" +
00030         "Copyright (c) 1998 Microsoft Corp.";
00031     }
00032
00033     public void init()        { resize(0,0); }
00034     public void destroy()     {}
00035     public void paint(Graphics g) {}
00036     public void start()       {}
00037     public void stop()        {}
00038
00039
00040   // Event Status Codes
00041   //--------------------------------------------------------------------------
00042   static final int E_FAIL = -1;
00043     static final int S_COMPLETED = 0;
00044     static final int S_PENDING = 1;
00045     static final int S_PARTIAL = 2;
00046
00047
00048     // Request Object Definition
00049   //--------------------------------------------------------------------------
00050     static final int REQUEST_NEXT = 0;
00051     static final int REQUEST_PREV = 1;
00052     static final int REQUEST_ID = 2;
00053     static final int REQUEST_URL = 3;
00054     static final int REQUEST_URLCONTEXT = 4;
00055   static final int REQUEST_MODE = 5;
00056   static final int REQUEST_THREAD = 6;
00057     static final int C_REQUEST = 7;
00058
00059     // Request Object Modes
00060   //--------------------------------------------------------------------------
00061     static final int REQUEST_MODE_COMPLETE = 0;
00062     static final int REQUEST_MODE_PARTIAL = 1;
00063
00064     // Response Object Definition
00065   //--------------------------------------------------------------------------
00066     static final int RESPONSE_NEXT = 0;
00067     static final int RESPONSE_REQUESTID = 1;
00068     static final int RESPONSE_STATUS = 2;
00069     static final int RESPONSE_MESSAGE = 3;
00070     static final int RESPONSE_DATA = 4;
00071     static final int C_RESPONSE = 5;
00072
00073     // Other Constants
00074   //--------------------------------------------------------------------------
00075     static final int BUFFER_SIZE = 512;
00076     static final int EXPECTED_MAX_CONCURRENT_CALLS = 5;
00077
00078
00079
00080     // Private Members
00081   //--------------------------------------------------------------------------
00082   // Request list. Requests are inserted at head and removed when completed.
00083     private Object m_requestLock;
00084     private Object[] m_requestHead;
00085     // Response queue.
00086     private Object m_responseLock;
00087     private Object[] m_responseHead;
00088     private Object[] m_responseTail;
00089
00090
00091     // Public Methods
00092   //--------------------------------------------------------------------------
00093
00094   // RSProxy class constructor
00095   public RSProxy()
00096     {
00097         m_requestLock = new Object();
00098         m_responseLock = new Object();
00099     }
00100
00101   // initiates a request given an id and url
00102     public void startRequest(String requestID,String url_context,String url,int mode)
00103     {
00104         Object[] request = newRequest(requestID,url_context,url,mode);
00105         insertRequest(request);
00106         Thread thread = new Thread(this,requestID);
00107     request[REQUEST_THREAD] = thread;
00108         thread.start();
00109     }
00110
00111   // used to poll applet for response
00112     public synchronized boolean waitForResponse()
00113     {
00114         // a response is already queued up
00115         if (null != m_responseHead)
00116             return true;
00117
00118         // a response cannot be generated without a request
00119         if (null == m_requestHead)
00120             return false;
00121
00122         try
00123         { // try waiting for a response
00124             while (null == m_responseHead)
00125                 wait();
00126             return true;
00127         }
00128         catch (InterruptedException ie)
00129         {
00130             return false;
00131         }
00132     }
00133
00134   public synchronized void cancelRequest(String requestId)
00135   {
00136     Object [] request = findRequest(requestId);
00137
00138     if (request == null)
00139       return;
00140     if (request[REQUEST_THREAD] != null)
00141       ((Thread)request[REQUEST_THREAD]).stop();
00142   }
00143   // The following methods get the response information
00144   // Only the UI thread should call these methods.
00145     public boolean hasResponse()
00146     { return null != m_responseHead;    }
00147
00148     public void endResponse()
00149     { removeResponse();           }
00150
00151     public String getRequestID()
00152     {
00153         if (null == m_responseHead)
00154       return "";
00155         return (String)m_responseHead[RESPONSE_REQUESTID];
00156     }
00157
00158     public int getStatus()
00159     {
00160         if (null == m_responseHead)
00161             return 0;
00162         return getInteger(m_responseHead[RESPONSE_STATUS]);
00163     }
00164
00165     public String getMessage()
00166     {
00167         if (null == m_responseHead)
00168             return "";
00169         return (String)m_responseHead[RESPONSE_MESSAGE];
00170     }
00171
00172     public String getData()
00173     {
00174         if (null == m_responseHead)
00175             return "";
00176         return (String)m_responseHead[RESPONSE_DATA];
00177     }
00178
00179
00180     // Runnable Protocol
00181   //--------------------------------------------------------------------------
00182     public void run()
00183     {
00184         String requestID = Thread.currentThread().getName();
00185         runUrlDownloadThread(requestID);
00186     }
00187
00188     // Protected Methods
00189   //--------------------------------------------------------------------------
00190
00191   // spawns worker thread to asynchronously retrieve data for given request
00192     protected void runUrlDownloadThread(String requestID)
00193     {
00194         Object[] request = findRequest(requestID);
00195         Object[] response;
00196
00197         if (null == request)
00198             response = newErrorResponse(requestID,"Unknown request id.");
00199         else
00200         {
00201             try
00202             {
00203                 int bytesRead;
00204                 byte[] buffer = new byte[BUFFER_SIZE];
00205         URL contextURL = new URL((String)request[REQUEST_URLCONTEXT]);
00206                 InputStream stream = new URL(contextURL,(String)request[REQUEST_URL]).openStream();
00207         StringBuffer responseBuffer = new StringBuffer();
00208
00209                 while (-1 != (bytesRead = stream.read(buffer)))
00210                 {
00211           if (request[REQUEST_MODE] == getObject(REQUEST_MODE_PARTIAL))
00212           { // generate response as partial data buffers are received
00213             response = newDataResponse(requestID,new String(buffer,0,0,bytesRead),false);
00214             handleResponse(request,response);
00215           }
00216           else //if (request[REQUEST_MODE] == getObject(REQUEST_MODE_COMPLETE))
00217           { // generate a single response when request is complete
00218             responseBuffer.append(new String(buffer,0,0,bytesRead));
00219           }
00220                 }
00221         stream.close();
00222
00223         if (request[REQUEST_MODE] == getObject(REQUEST_MODE_PARTIAL))
00224           response = newDataResponse(requestID, "", true);
00225         else //if (request[REQUEST_MODE] == getObject(REQUEST_MODE_COMPLETE))
00226           response = newDataResponse(requestID,responseBuffer.toString(),true);
00227             }
00228             catch (Exception e)
00229             {
00230                 response = newErrorResponse(requestID,e.getMessage());
00231             }
00232     }
00233
00234     handleResponse(request,response);
00235     }
00236
00237   // handle response, inserts response into queue, removes request when complete
00238     protected synchronized void handleResponse(Object[] request,Object[] response)
00239     {
00240         insertResponse(response);
00241     int status = getInteger(response[RESPONSE_STATUS]);
00242         if (S_COMPLETED == status || E_FAIL == status)
00243             removeRequest(request);
00244         notifyAll();
00245     }
00246
00247     // Object constructors
00248   //--------------------------------------------------------------------------
00249
00250     // constructor for new Request object
00251     protected Object[] newRequest(String requestID,String url_context,String url,int mode)
00252     {
00253         Object[] request = new Object[C_REQUEST];
00254         request[REQUEST_ID] = requestID;
00255         request[REQUEST_URL] = url;
00256         request[REQUEST_URLCONTEXT] = url_context;
00257         request[REQUEST_MODE] = getObject(mode);
00258         return request;
00259     }
00260
00261     // constructor for new Response object
00262     protected Object[] newDataResponse(String requestID,String data,boolean finished)
00263     {
00264         Object[] response = new Object[C_RESPONSE];
00265         response[RESPONSE_REQUESTID] = requestID;
00266         response[RESPONSE_STATUS] = new Integer(finished ? S_COMPLETED : S_PARTIAL);
00267         response[RESPONSE_MESSAGE] = "Completed";
00268         response[RESPONSE_DATA] = data;
00269         return response;
00270     }
00271
00272   // constructor for new ErrorResponse object
00273     protected Object[] newErrorResponse(String requestID,String message)
00274     {
00275         Object[] response = new Object[C_RESPONSE];
00276         response[RESPONSE_REQUESTID] = requestID;
00277         response[RESPONSE_STATUS] = new Integer(E_FAIL);
00278         response[RESPONSE_MESSAGE] = message;
00279         response[RESPONSE_DATA] = "";
00280     return response;
00281     }
00282
00283     // list management routines
00284   //--------------------------------------------------------------------------
00285
00286   // find a given request object in the request list
00287     protected Object[] findRequest(String requestID)
00288     {
00289         synchronized (m_requestLock)
00290     {
00291             Object[] i;
00292             for (i = m_requestHead; null != i; i = (Object[])i[REQUEST_NEXT])
00293       {
00294                 if (0 == requestID.compareTo((String)i[REQUEST_ID]))
00295                     return i;
00296       }
00297     }
00298         return null;
00299     }
00300
00301   // insert a request object at the head of the request list
00302     protected void insertRequest(Object[] request)
00303     {
00304         synchronized (m_requestLock)
00305     {
00306             request[REQUEST_PREV] = null;
00307             request[REQUEST_NEXT] = m_requestHead;
00308             if (null != m_requestHead)
00309                 m_requestHead[REQUEST_PREV] = request;
00310             m_requestHead = request;
00311     }
00312   }
00313
00314   // remove a request object from the request list
00315     protected void removeRequest(Object[] request)
00316     {
00317         synchronized (m_requestLock)
00318     {
00319             if (null == request[REQUEST_PREV])
00320                 m_requestHead = (Object[])request[REQUEST_NEXT];
00321             else
00322                 ((Object[])request[REQUEST_PREV])[REQUEST_NEXT] = request[REQUEST_NEXT];
00323
00324             if (null != request[REQUEST_NEXT])
00325                 ((Object[])request[REQUEST_NEXT])[REQUEST_PREV] = request[REQUEST_PREV];
00326     }
00327     }
00328
00329   // insert a response object onto the tail of the queue
00330     protected void insertResponse(Object[] response)
00331     {
00332         synchronized (m_responseLock)
00333     {
00334             if (null == m_responseHead)
00335       {
00336                 m_responseHead = response;
00337                 m_responseTail = response;
00338       }
00339             else
00340       {
00341                 m_responseTail[RESPONSE_NEXT] = response;
00342                 m_responseTail = response;
00343       }
00344     }
00345     }
00346
00347     // remove response at the head of the queue
00348     protected void removeResponse()
00349     {
00350         synchronized (m_responseLock)
00351     {
00352             if (null != m_responseHead)
00353       {
00354                 m_responseHead = (Object[])m_responseHead[RESPONSE_NEXT];
00355                 if (null == m_responseHead)
00356                     m_responseTail = null;
00357       }
00358     }
00359     }
00360
00361     // private helper functions
00362   //--------------------------------------------------------------------------
00363
00364   // casts int as Object
00365   private Object getObject(int integer)
00366   { return new Integer(integer);  }
00367
00368   // casts Object as int
00369   private int getInteger(Object obj)
00370   {
00371     if (null == obj)
00372       return 0;
00373     return ((Integer)obj).intValue();
00374   }
00375
00376 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagINTERFACEIMPL Member List

This is the complete list of members for tagINTERFACEIMPL, including all inherited members.
cRef | tagINTERFACEIMPL
lpBack | tagINTERFACEIMPL
lpVtbl | tagINTERFACEIMPL
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/registry.h Source File

  • SysMgmt
  • MMC
  • Complete

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout);    // Class Id for About Class
00040
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/basenode.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

basenode.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014
00015
00016 #ifndef _CLASS_BASENODE_
00017 #define _CLASS_BASENODE_
00018
00019 #include "Globals.h"
00020 #include "Resource.h"
00021
00022
00023 #define DEFAULT_SDI_MASK  (SDI_STR | SDI_PARAM | SDI_IMAGE | SDI_OPENIMAGE | SDI_PARENT | SDI_CHILDREN)
00024 #define DEFAULT_RDI_MASK  (RDI_STR | RDI_PARAM | RDI_IMAGE)
00025
00026 #define MAX_NAME_LEN     64
00027
00028
00029 //---------------------------------------------------------------------------
00030 //  Data types specific to this object
00031 //
00032 typedef struct tag_BASENODE_PROPERTIES
00033 {
00034   WCHAR      szNodeName[MAX_NAME_LEN];
00035   LONG_PTR   pComponentData;
00036
00037 }NODE_PROPERTIES;
00038
00039 typedef NODE_PROPERTIES*  LPNODE_PROPERTIES;
00040
00041
00042 //---------------------------------------------------------------------------
00043 class CBaseNode
00044 {
00045   public:
00046     CBaseNode()
00047     {
00048       m_pwszNodeName      = NULL;
00049
00050       ZeroMemory( &m_SDI, sizeof(SCOPEDATAITEM) );
00051       ZeroMemory( &m_RDI, sizeof(RESULTDATAITEM) );
00052     };
00053
00054     virtual ~CBaseNode()
00055     {
00056       if( NULL != m_pwszNodeName )
00057         CoTaskMemFree( m_pwszNodeName );
00058     };
00059
00060   public:
00061     LPWSTR   GetNodeName()     { return m_pwszNodeName;  }
00062
00063     virtual  HRESULT Initialize( NODE_PROPERTIES* pProperties ) = 0;
00064     virtual  ULONG   GetNodeType() = 0;
00065     virtual  GUID*   GetNodeGUID() = 0;
00066
00067   /////////////////////////////////////////////////////////////////////////
00068   // These virtual methods handle calls from the console
00069   //
00070   public:
00071     virtual  HRESULT GetDisplayInfo( SCOPEDATAITEM* pSDI ) = 0;
00072     virtual  HRESULT GetDisplayInfo( RESULTDATAITEM* pRDI ) = 0;
00073     virtual  HRESULT GetResultViewType2( MMC_COOKIE nCookie, PRESULT_VIEW_TYPE_INFO pRVTinfo ) = 0;
00074
00075   ///////////////////////////////////////////////////////////////////////////
00076   // These virtual methods handle notifications
00077   //
00078   public:
00079     virtual  HRESULT OnSelect( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent ) = 0;
00080     virtual  HRESULT OnShow( LPDATAOBJECT ipDataObject, LONG nArg, LONG nParam, LONG_PTR pComponent ) = 0;
00081
00082   public:
00083     SCOPEDATAITEM    m_SDI;
00084     RESULTDATAITEM   m_RDI;
00085
00086   protected:
00087     LPWSTR     m_pwszNodeName;
00088
00089 }; //end class CBaseNode
00090
00091 #endif //_CLASS_BASENODE_
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/WtsApi/APIView.h Source File

  • WinBase
  • WtsApi
  • WtsApi

APIView.h

Go to the documentation of this file.
00001 // APIView.h : interface of the CAPIView class
00002 //
00003 //  Copyright 1995-1999, Citrix Systems Inc.
00004 //  Copyright (c) 1997 - 2000  Microsoft Corporation
00005
00006 /////////////////////////////////////////////////////////////////////////////
00007
00008 #if !defined(AFX_APIVIEW_H__C090CEF2_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
00009 #define AFX_APIVIEW_H__C090CEF2_303B_11D1_8310_00C04FBEFCDA__INCLUDED_
00010
00011 #if _MSC_VER >= 1000
00012 #pragma once
00013 #endif // _MSC_VER >= 1000
00014
00015 class CAPIView : public CView
00016 {
00017 protected: // create from serialization only
00018   CAPIView();
00019   DECLARE_DYNCREATE(CAPIView)
00020
00021 // Attributes
00022 public:
00023   CAPIDoc* GetDocument();
00024
00025 // Operations
00026 public:
00027
00028 // Overrides
00029   // ClassWizard generated virtual function overrides
00030   //{{AFX_VIRTUAL(CAPIView)
00031   public:
00032   virtual void OnDraw(CDC* pDC);  // overridden to draw this view
00033   virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00034   //}}AFX_VIRTUAL
00035
00036 // Implementation
00037 public:
00038   virtual ~CAPIView();
00039 #ifdef _DEBUG
00040   virtual void AssertValid() const;
00041   virtual void Dump(CDumpContext& dc) const;
00042 #endif
00043
00044 protected:
00045
00046 // Generated message map functions
00047 protected:
00048   //{{AFX_MSG(CAPIView)
00049   afx_msg void OnSetFocus(CWnd* pOldWnd);
00050   afx_msg void OnPaint();
00051   //}}AFX_MSG
00052   DECLARE_MESSAGE_MAP()
00053 private:
00054 };
00055
00056 #ifndef _DEBUG  // debug version in APIView.cpp
00057 inline CAPIDoc* CAPIView::GetDocument()
00058    { return (CAPIDoc*)m_pDocument; }
00059 #endif
00060
00061 /////////////////////////////////////////////////////////////////////////////
00062
00063 //{{AFX_INSERT_LOCATION}}
00064 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00065
00066 #endif // !defined(AFX_APIVIEW_H__C090CEF2_303B_11D1_8310_00C04FBEFCDA__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpcmenu/SCPCMenu.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpcmenu

SCPCMenu.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       SCPCMenu.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //dsshexten.h
00012
00013 extern const CLSID CLSID_SCPContextMenu;
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/compdata.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

compdata.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #ifndef _CLASS_CCOMPONENTDATA_
00016 #define _CLASS_CCOMPONENTDATA_
00017
00018
00019 #include "Globals.h"
00020 #include "BaseNode.h"
00021
00022 class  CStaticNode;           // References
00023
00024 //---------------------------------------------------------------------------
00025 class CComponentData : public IComponentData2,
00026                               IExtendContextMenu
00027 {
00028   private:
00029     ULONG                m_cRef;
00030     LPCONSOLE3           m_ipConsole;
00031     LPCONSOLENAMESPACE2  m_ipConsoleNameSpace;
00032     CStaticNode*         m_pStaticNode;
00033     HSCOPEITEM           m_hStaticNode;
00034
00035   public:
00036     CComponentData();
00037     ~CComponentData();
00038
00039     /////////////////////////////////////////////////////////////////////////
00040     // Interface IUnknown
00041     //
00042     STDMETHODIMP QueryInterface( REFIID riid, LPVOID *ppv );
00043     STDMETHODIMP_(ULONG) AddRef();
00044     STDMETHODIMP_(ULONG) Release();
00045
00046     /////////////////////////////////////////////////////////////////////////
00047     // Interface IComponentData
00048     //
00049     HRESULT STDMETHODCALLTYPE Initialize
00050             ( /*[in]*/ LPUNKNOWN pUnknown );
00051
00052     HRESULT STDMETHODCALLTYPE CreateComponent
00053             ( /*[out]*/ LPCOMPONENT __RPC_FAR* ppComponent);
00054
00055     HRESULT STDMETHODCALLTYPE Notify
00056             ( /*[in]*/ LPDATAOBJECT ipDataObject,
00057               /*[in]*/ MMC_NOTIFY_TYPE MmcEvent,
00058               /*[in]*/ LONG nArg,
00059               /*[in]*/ LONG nParam
00060             );
00061
00062     HRESULT STDMETHODCALLTYPE Destroy( void);
00063
00064     HRESULT STDMETHODCALLTYPE QueryDataObject
00065             ( /*[in]*/  MMC_COOKIE uCookie,
00066               /*[in]*/  DATA_OBJECT_TYPES nEnumType,
00067               /*[out]*/ LPDATAOBJECT __RPC_FAR* ppDataObject
00068             );
00069
00070     HRESULT STDMETHODCALLTYPE GetDisplayInfo
00071             ( /*[out][in]*/ SCOPEDATAITEM __RPC_FAR* pScopeDataItem );
00072
00073     HRESULT STDMETHODCALLTYPE CompareObjects
00074             ( /*[in]*/ LPDATAOBJECT ipDataObjectA,
00075               /*[in]*/ LPDATAOBJECT ipDataObjectB
00076             );
00077
00078     HRESULT STDMETHODCALLTYPE QueryDispatch
00079             ( /*[in] */  MMC_COOKIE  nCookie,
00080               /*[in] */  DATA_OBJECT_TYPES eType,
00081               /*[out]*/  LPDISPATCH* pipDispatch
00082             );
00083
00084
00085     /////////////////////////////////////////////////////////////////////////
00086     // Interface IExtendContextMenu
00087     //
00088     HRESULT STDMETHODCALLTYPE AddMenuItems
00089             ( /*[in] */ LPDATAOBJECT ipDataObject,
00090               /*[in] */ LPCONTEXTMENUCALLBACK ipCallback,
00091               /*[out,in]*/ long __RPC_FAR* pInsertionAllowed
00092             );
00093
00094     HRESULT STDMETHODCALLTYPE Command
00095             ( /*[in]*/ long lCommandID,
00096               /*[in]*/ LPDATAOBJECT piDataObject
00097             );
00098
00099   // Pulic helper methods
00100   public:
00101     CStaticNode* GetStaticNode() { return m_pStaticNode; }
00102     HRESULT      GetInterface( DWORD dwRequestedInterface,  LONG_PTR* ppInterface );
00103
00104 };
00105
00106 #endif //_CLASS_CCOMPONENTDATA_
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CFileShareSampleParamsPage Member List

This is the complete list of members for CFileShareSampleParamsPage, including all inherited members.
Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal) | CPropertyPage |
Apply() | CPropertyPage |
BAllRequiredFieldsPresent(void) const | CFileShareSampleParamsPage | [protected]
BApplyChanges(void) | CBasePropertyPage | [protected, virtual]
BApplyChanges(void) | CBasePropertyPage | [protected, virtual]
BBackPressed(void) const | CBasePropertyPage | [inline, protected]
BBackPressed(void) const | CBasePropertyPage | [inline, protected]
BBuildPropList(CClusPropList &rcplInout, BOOL fNoNewPropsIn=FALSE) | CBasePropertyPage | [protected, virtual]
BBuildPropList(CClusPropList &rcplInout, BOOL fNoNewPropsIn=FALSE) | CBasePropertyPage | [protected, virtual]
BSaved(void) const | CBasePropertyPage | [inline, protected]
BSaved(void) const | CBasePropertyPage | [inline, protected]
BSetPrivateProps(BOOL fValidateOnlyIn=FALSE, BOOL fNoNewPropsIn=FALSE) | CBasePropertyPage | [protected]
BSetPrivateProps(BOOL fValidateOnlyIn=FALSE, BOOL fNoNewPropsIn=FALSE) | CBasePropertyPage | [protected]
BWizard(void) const | CBasePropertyPage | [inline, protected]
BWizard(void) const | CBasePropertyPage | [inline, protected]
CBasePropertyPage(void) | CBasePropertyPage |
CBasePropertyPage(UINT nIDTemplateIn, UINT nIDCaptionIn=0) | CBasePropertyPage |
CBasePropertyPage(void) | CBasePropertyPage |
CBasePropertyPage(UINT nIDTemplateIn, UINT nIDCaptionIn=0) | CBasePropertyPage |
CFileShareSampleParamsPage(void) | CFileShareSampleParamsPage |
CommonConstruct(void) | CBasePropertyPage | [protected]
CommonConstruct(void) | CBasePropertyPage | [protected]
Cot(void) const | CBasePropertyPage | [inline]
Cot(void) const | CBasePropertyPage | [inline]
CPropertyPage(REFCLSID clsid, INT iDialogID) | CPropertyPage |
Cprops(void) const | CFileShareSampleParamsPage | [inline, protected, virtual]
Deactivate() | CPropertyPage |
DEFINE_ADDREF_RELEASE | CPropertyPage |
DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [static]
DisplaySetPropsError(DWORD scIn, UINT idsOperIn) const | CBasePropertyPage | [protected, virtual]
DisplaySetPropsError(DWORD scIn, UINT idsOperIn) const | CBasePropertyPage | [protected, virtual]
DoDataExchange(CDataExchange *pDX) | CFileShareSampleParamsPage | [protected, virtual]
EnableNext(BOOL fEnableIn=TRUE) | CBasePropertyPage | [protected]
EnableNext(BOOL fEnableIn=TRUE) | CBasePropertyPage | [protected]
epropMAX enum value | CFileShareSampleParamsPage | [protected]
epropMaxUsers enum value | CFileShareSampleParamsPage | [protected]
epropPath enum value | CFileShareSampleParamsPage | [protected]
epropRemark enum value | CFileShareSampleParamsPage | [protected]
epropShareName enum value | CFileShareSampleParamsPage | [protected]
GetClassID(CLSID __RPC_FAR *pClassID) | CPropertyPage | [inline]
GetPageInfo(PROPPAGEINFO __RPC_FAR *pPageInfo) | CPropertyPage | [inline, virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [virtual]
Hcluster(void) const | CBasePropertyPage | [inline, protected]
Hcluster(void) const | CBasePropertyPage | [inline, protected]
Help(LPCOLESTR pszHelpDir) | CPropertyPage | [inline]
Hpage(void) const | CBasePropertyPage | [inline]
Hpage(void) const | CBasePropertyPage | [inline]
HrCreatePage(void) | CBasePropertyPage |
HrCreatePage(void) | CBasePropertyPage |
HrInit(CExtObject *peoInout) | CBasePropertyPage | [virtual]
HrInit(CExtObject *peoInout) | CBasePropertyPage | [virtual]
IDD enum value | CFileShareSampleParamsPage |
IddPropertyPage(void) const | CBasePropertyPage | [inline, protected]
IddPropertyPage(void) const | CBasePropertyPage | [inline, protected]
IddWizardPage(void) const | CBasePropertyPage | [inline, protected]
IddWizardPage(void) const | CBasePropertyPage | [inline, protected]
IdsCaption(void) const | CBasePropertyPage | [inline, protected]
IdsCaption(void) const | CBasePropertyPage | [inline, protected]
InitNew(void) | CPropertyPage | [inline]
IsPageDirty() | CPropertyPage |
Load(IPropertyBag __RPC_FAR *pPropBag, IErrorLog __RPC_FAR *pErrorLog) | CPropertyPage | [inline]
m_bBackPressed | CBasePropertyPage | [protected]
m_bDoDetach | CBasePropertyPage | [protected]
m_bSaved | CBasePropertyPage | [protected]
m_clsid | CPropertyPage | [protected]
m_cRef | CPropertyPage | [protected]
m_editPath | CFileShareSampleParamsPage |
m_editShareName | CFileShareSampleParamsPage |
m_hpage | CBasePropertyPage | [protected]
m_hWnd | CPropertyPage | [protected]
m_iddPropertyPage | CBasePropertyPage | [protected]
m_iddWizardPage | CBasePropertyPage | [protected]
m_iDialogID | CPropertyPage | [protected]
m_idsCaption | CBasePropertyPage | [protected]
m_nMaxUsers | CFileShareSampleParamsPage |
m_nPrevMaxUsers | CFileShareSampleParamsPage |
m_peo | CBasePropertyPage | [protected]
m_pIPropertyPageSite | CPropertyPage | [protected]
m_rgProps | CFileShareSampleParamsPage | [protected]
m_staticIcon | CBasePropertyPage |
m_staticTitle | CBasePropertyPage |
m_strPath | CFileShareSampleParamsPage |
m_strPrevPath | CFileShareSampleParamsPage |
m_strPrevRemark | CFileShareSampleParamsPage |
m_strPrevShareName | CFileShareSampleParamsPage |
m_strRemark | CFileShareSampleParamsPage |
m_strShareName | CFileShareSampleParamsPage |
m_strTitle | CBasePropertyPage |
Move(LPCRECT pRect) | CPropertyPage |
OnApply() | CBasePropertyPage | [virtual]
OnApply() | CBasePropertyPage | [virtual]
OnChangeCtrl() | CBasePropertyPage | [protected]
OnChangeCtrl() | CBasePropertyPage | [protected]
OnChangeRequiredField() | CFileShareSampleParamsPage | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CBasePropertyPage | [protected]
OnCreate(LPCREATESTRUCT lpCreateStruct) | CBasePropertyPage | [protected]
OnDestroy() | CBasePropertyPage | [protected]
OnDestroy() | CBasePropertyPage | [protected]
OnInitDialog() | CFileShareSampleParamsPage | [protected, virtual]
OnSetActive() | CFileShareSampleParamsPage | [virtual]
OnWizardBack() | CBasePropertyPage | [virtual]
OnWizardBack() | CBasePropertyPage | [virtual]
OnWizardFinish() | CBasePropertyPage | [virtual]
OnWizardFinish() | CBasePropertyPage | [virtual]
OnWizardNext() | CBasePropertyPage | [virtual]
OnWizardNext() | CBasePropertyPage | [virtual]
Peo(void) const | CBasePropertyPage | [inline, protected]
Peo(void) const | CBasePropertyPage | [inline, protected]
PiWizardCallback(void) const | CBasePropertyPage | [inline, protected]
PiWizardCallback(void) const | CBasePropertyPage | [inline, protected]
Pprops(void) const | CFileShareSampleParamsPage | [inline, protected, virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | CPropertyPage |
Save(IPropertyBag __RPC_FAR *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) | CPropertyPage | [inline]
ScParseProperties(CClusPropList &rcplIn) | CBasePropertyPage | [protected]
ScParseProperties(CClusPropList &rcplIn) | CBasePropertyPage | [protected]
ScParseUnknownProperty(LPCWSTR pwszNameIn, const CLUSPROP_BUFFER_HELPER &rvalueIn, DWORD cbBufIn) | CBasePropertyPage | [inline, protected, virtual]
ScParseUnknownProperty(LPCWSTR pwszNameIn, const CLUSPROP_BUFFER_HELPER &rvalueIn, DWORD cbBufIn) | CBasePropertyPage | [inline, protected, virtual]
SetObjects(ULONG cObjects, IUnknown __RPC_FAR *__RPC_FAR *ppUnk) | CPropertyPage | [inline]
SetPageSite(IPropertyPageSite *pPageSite) | CPropertyPage |
Show(UINT nCmdShow) | CPropertyPage |
TranslateAccelerator(MSG *pMsg) | CPropertyPage |
~CBasePropertyPage(void) | CBasePropertyPage | [inline, virtual]
~CBasePropertyPage(void) | CBasePropertyPage | [inline, virtual]
~CPropertyPage() | CPropertyPage | [virtual]
Generated on Wed Nov 13 2024 16:56:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/Resource.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Visual C++ generated include file.
00003 // Used by TapiComm.RC
00004 //
00005 #define IDC_COUNTRYCODE                 1000
00006 #define IDC_TAPILINE                    1001
00007 #define IDC_CONFIGURELINE               1002
00008 #define IDC_DIALINGPROPERTIES           1003
00009 #define IDC_PHONENUMBER                 1004
00010 #define IDC_DIAL                        1005
00011 #define IDC_AREACODE                    1006
00012 #define IDC_CALLINGCARD                 1007
00013 #define IDC_USEDIALINGRULES             1008
00014 #define IDC_LOCATION                    1009
00015 #define IDC_CANONICALNUMBER             1010
00016 #define IDC_DISPLAYABLENUMBER           1011
00017 #define IDC_DIALABLENUMBER              1012
00018 #define IDC_STATICCOUNTRYCODE           1013
00019 #define IDC_STATICAREACODE              1014
00020 #define IDC_STATICPHONENUMBER           1015
00021 #define IDC_STATICLOCATION              1016
00022 #define IDC_STATICCALLINGCARD           1017
00023 #define IDC_STATICTAPILINE              1018
00024 #define IDC_STATICCANONICAL             1019
00025 #define IDC_STATICDIALABLE              1020
00026 #define IDC_STATICDISPLAYABLE           1021
00027 #define IDC_LINEICON                    1022
00028
00029 #define IDC_NOHELPCONTROLS              1101
00030 #define IDC_STATICWHERETODIAL           1102
00031 #define IDC_STATICHOWTODIAL             1103
00032 #define IDC_STATICCONNECTUSING          1104
00033 #define IDC_STATICPHONENUMBERS          1105
00034
00035 #define IDC_CONFIGURATIONCHANGED        1201
00036 #define IDC_LINECREATE                  1202
00037
00038 #define IDC_STATIC                      -1
00039
00040 // Next default values for new objects
00041 //
00042 #ifdef APSTUDIO_INVOKED
00043 #ifndef APSTUDIO_READONLY_SYMBOLS
00044 #define _APS_NO_MFC                     1
00045 #define _APS_NEXT_RESOURCE_VALUE        101
00046 #define _APS_NEXT_COMMAND_VALUE         40001
00047 #define _APS_NEXT_CONTROL_VALUE         1301
00048 #define _APS_NEXT_SYMED_VALUE           101
00049 #endif
00050 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/resource.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ViewEx.rc
00004 //
00005 #define IDB_APPIMG_32                   101
00006 #define IDB_APPIMG_16                   104
00007 #define IDI_APP_ICON                    105
00008 #define IDB_NODEIMAGES_16               106
00009 #define IDB_NODEIMAGES_32               107
00010 #define IDD_BASE_DIALOG                 108
00011 #define IDD_ADDDEVICE_DLG               109
00012 #define IDD_ADDVFILE_DLG                110
00013 #define IDC_ARCHIVE_ATTR                1000
00014 #define IDC_HIDDEN_ATTR                 1001
00015 #define IDC_LOCKED_ATTR                 1002
00016 #define IDC_READONLY_ATTR               1003
00017 #define IDC_DEVNAME_EDIT                1004
00018 #define IDC_BACKUP_FLAG                 1005
00019
00020 // Next default values for new objects
00021 //
00022 #ifdef APSTUDIO_INVOKED
00023 #ifndef APSTUDIO_READONLY_SYMBOLS
00024 #define _APS_NEXT_RESOURCE_VALUE        110
00025 #define _APS_NEXT_COMMAND_VALUE         40001
00026 #define _APS_NEXT_CONTROL_VALUE         1006
00027 #define _APS_NEXT_SYMED_VALUE           101
00028 #endif
00029 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/SSPI/SockAuth/Security.h Source File

  • Security
  • SSPI
  • SockAuth

Security.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 Module Name:
00006
00007     security.h
00008
00009 Abstract:
00010
00011     Functions to handle communication with the security package
00012
00013 Revision History:
00014
00015 --*/
00016
00017 BOOL InitPackage (
00018   TCHAR *lpPackageName,
00019   BOOL fVerbose
00020   );
00021
00022 BOOL TermPackage ();
00023
00024 BOOL InitSession (DWORD dwKey);
00025
00026 BOOL TermSession (DWORD dwKey);
00027
00028 BOOL GenClientContext (
00029   DWORD dwKey,
00030   BYTE *pIn,
00031   DWORD cbIn,
00032   BYTE **pOut,
00033   DWORD *pcbOut,
00034   BOOL *pfDone,
00035         ULONG *pAttribs,
00036         CHAR *pszTarget
00037   );
00038
00039 BOOL GenServerContext (
00040   DWORD dwKey,
00041   BYTE *pIn,
00042   DWORD cbIn,
00043   BYTE **pOut,
00044   DWORD *pcbOut,
00045   BOOL *pfDone,
00046   ULONG *pAttribs
00047   );
00048
00049 BOOL ImpersonateContext (DWORD dwKey);
00050
00051 BOOL RevertContext (DWORD dwKey);
00052
00053 BOOL EncryptThis (
00054          DWORD dwKey,
00055          PBYTE pMessage,
00056          ULONG cbMessage,
00057          BYTE ** ppOutput,
00058          LPDWORD pcbOutput
00059   );
00060
00061 PBYTE DecryptThis(
00062          DWORD dwKey,
00063          PBYTE achData,
00064          LPDWORD pcbMessage
00065   );
00066
00067 BOOL
00068 SignThis (
00069          DWORD dwKey,
00070          PBYTE pMessage,
00071          ULONG cbMessage,
00072          BYTE ** ppOutput,
00073          LPDWORD pcbOutput
00074   );
00075
00076 PBYTE VerifyThis(
00077           DWORD dwKey,
00078           PBYTE pBuffer,
00079           LPDWORD pcbMessage
00080   );
00081
00082 void PrintHexDump(DWORD length, PBYTE buffer);
00083
00084
00085
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagSYNCHRONIZECOMPLETEDMSG Member List

This is the complete list of members for _tagSYNCHRONIZECOMPLETEDMSG, including all inherited members.
hr _tagSYNCHRONIZECOMPLETEDMSG
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/staticnode.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

staticnode.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Abstract:     Implementation of the CStaticNode class.
00014 //
00015
00016 #include "StaticNode.h"
00017 #include "DeviceNode.h"
00018 #include "CompData.h"
00019 #include "Comp.h"
00020 #include "AddDeviceDlg.h"
00021
00022                              // Tracing stuff
00023 #include "TraceMacro.h"
00024 #undef  MODULESTRING
00025 #define MODULESTRING  _T("CStaticNode")
00026
00027
00028 // Initialize our static GUID just once.  We use the GUID for
00029 // CComponentData because this node handles events for the
00030 // Snap-in's namespace
00031 GUID CStaticNode::thisGUID = CLSID_CComponentData;
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Construction/Destruction
00036
00037 CStaticNode::CStaticNode()
00038 {
00039   m_SDI.mask        = DEFAULT_SDI_MASK;
00040   m_SDI.displayname = MMC_CALLBACK;
00041   m_SDI.nImage      = IMG_DEVICE_DEFAULT;
00042   m_SDI.nOpenImage  = IMG_DEVICE_DEFAULT;
00043   m_SDI.cChildren   = 1;              // Determines if the '+' is displayed
00044   m_SDI.lParam      = reinterpret_cast<LPARAM>(this);
00045
00046   m_hStaticNode     = NULL;
00047   m_pCompData       = NULL;
00048   m_hAddDeviceDlg   = NULL;
00049 }
00050
00051
00052 CStaticNode::~CStaticNode()
00053 {
00054 }
00055
00056 //---------------------------------------------------------------------------
00057 HRESULT CStaticNode::Initialize( NODE_PROPERTIES* pNodeProps )
00058 {
00059   _ASSERT( NULL != pNodeProps );
00060   HRESULT hResult = S_FALSE;
00061
00062   UINT   nLen   = wcslen( pNodeProps->szNodeName ) + 1;
00063   LPWSTR pszTmp = (LPWSTR)CoTaskMemAlloc(nLen * sizeof(WCHAR));
00064   wcscpy( pszTmp, pNodeProps->szNodeName );
00065   if( NULL != m_pwszNodeName )
00066     CoTaskMemFree( m_pwszNodeName );
00067
00068   m_pwszNodeName = pszTmp;
00069   m_pCompData = reinterpret_cast<CComponentData*>(pNodeProps->pComponentData);
00070
00071   //  The static node is the top level node so pNodeProps->pParentObject is
00072   //  not used.
00073
00074   hResult = RefreshNodeList();         // Initialize scope nodes
00075
00076   // We create a hidden window to allow us to communicate with modeless
00077   // dialogs and other things which run in a seperate thread.
00078
00079   WNDCLASS wc;
00080   ZeroMemory (&wc, sizeof(WNDCLASS));
00081   wc.cbWndExtra    = sizeof(this);
00082   wc.lpfnWndProc   = StaticNodeWndProc;
00083   wc.hInstance     = g_hInst;
00084   wc.lpszClassName = _T("StaticNodeMessageWindow");
00085
00086   RegisterClass( &wc );
00087   m_hMessageWnd = CreateWindow( _T("StaticNodeMessageWindow"), NULL,
00088                                 0, 0, 0, 0, 0, NULL, 0, g_hInst, this);
00089
00090   if( NULL == m_hMessageWnd )
00091     hResult = S_FALSE;
00092
00093   return hResult;
00094 }
00095
00096
00097 //---------------------------------------------------------------------------
00098 //  This is our hidden window which is just used for handling messages.  We
00099 //  go to all this trouble so that we don't ever pass interface pointers or
00100 //  other objects across threads.
00101 //
00102 LRESULT CALLBACK CStaticNode::StaticNodeWndProc
00103 (
00104   HWND   hWnd,     //[in] Handle to window
00105   UINT   uMsg,     //[in] Message identifier
00106   WPARAM wParam,   //[in] First message parameter
00107   LPARAM lParam    //[in] Second message parameter
00108 )
00109 {
00110   switch( uMsg )
00111   {
00112     // Since we registered the WndClass in Initialize, our WndProc will be
00113     // called with WM_CREATE right away.  Store our 'hWnd' pointer in the
00114     // CREATESTRUCT so we can retreive it later to get back to the specific
00115     // instance of CComponentData
00116     //
00117     case WM_CREATE:
00118     {
00119       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00120       SetWindowLongPtr( hWnd, 0, (LONG_PTR)lpcs->lpCreateParams );
00121       break;
00122     }
00123
00124     // This is our custom message which could have been sent from a worker
00125     // thread, or in this case a modeless dialog.  We retrieve our 'this'
00126     // pointer from the WndClass and cast it to a CComponentData pointer.
00127     // WPARAM is cast to a NODE_PROPERTIES struct which can be used to
00128     // call AddDeviceNode()
00129     //
00130     case WM_ADD_DEVICENODE:
00131     {
00132       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00133       NODE_PROPERTIES* pProps = (NODE_PROPERTIES*)wParam;
00134       pThisNode->AddDeviceNode( pProps );
00135       break;
00136     }
00137
00138     // This message is sent by the AddDeviceDlg to let us know it's
00139     // being terminated.  Set our member handle to NULL so the item
00140     // will be show on the context menu
00141     //
00142     case WM_DEVICENODE_CLOSED:
00143     {
00144       CStaticNode* pThisNode = (CStaticNode*)GetWindowLongPtr( hWnd, 0 );
00145       pThisNode->m_hAddDeviceDlg = NULL;
00146     }
00147     default:
00148       return DefWindowProc( hWnd, uMsg, wParam, lParam );
00149   }
00150   return 0;
00151 }
00152
00153
00154 /////////////////////////////////////////////////////////////////////////////
00155 // Implementation of virtual methods
00156
00157
00158 //---------------------------------------------------------------------------
00159 //  The minimum implementation of this method is to return the
00160 //  Persistable View Description string.  This string must be allocated
00161 //  with CoTaskMemAlloc.  The console will free the string.
00162 //
00163 HRESULT CStaticNode::GetResultViewType2
00164 (
00165   MMC_COOKIE             nCookie,  //[in] Identifier of object
00166   PRESULT_VIEW_TYPE_INFO pRVTinfo  //[in,out] ViewTypeInfo struct
00167 )
00168 {
00169   LPOLESTR pszDescStr = (LPOLESTR)CoTaskMemAlloc( sizeof(L"DefaultListView")+1 );
00170   if( NULL == pszDescStr )
00171     return E_OUTOFMEMORY;
00172
00173   wcscpy( pszDescStr, L"DefaultListView" );
00174   pRVTinfo->pstrPersistableViewDescription = pszDescStr;
00175
00176   return S_OK;
00177 }
00178
00179 //---------------------------------------------------------------------------
00180 HRESULT CStaticNode::GetDisplayInfo
00181 (
00182   SCOPEDATAITEM* pSDI        //[in][out] Points to SCOPEDATAITEM
00183 )
00184 {
00185   _ASSERT( NULL != pSDI );
00186   pSDI->displayname = m_pwszNodeName;
00187
00188   return S_OK;
00189 }
00190
00191 //---------------------------------------------------------------------------
00192 HRESULT CStaticNode::GetDisplayInfo
00193 (
00194   RESULTDATAITEM* pRDI
00195 )
00196 {
00197   // This method will not get called since the static node is never
00198   // displayed in the result pane
00199   return S_FALSE;
00200 }
00201
00202 /////////////////////////////////////////////////////////////////////////////
00203 // Implementation of notification handlers
00204
00205 //---------------------------------------------------------------------------
00206 HRESULT CStaticNode::OnShow
00207 (
00208   LPDATAOBJECT  ipDataObject,  //[in] Points to selected node
00209   LONG          nArg,          //[in] TRUE if node was selcted
00210   LONG          nParam,        //[in] HSCOPEITEM of selected/deselected item
00211   LONG_PTR      pComponent     //[in] Points to calling IComponent
00212 )
00213 {
00214   HRESULT  hResult = S_FALSE;
00215
00216   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00217
00218   LPHEADERCTRL2  ipHeaderCtrl = NULL;
00219   hResult = pComp->GetInterface( REQUEST_IHEADERCTRL, (LONG_PTR*)&ipHeaderCtrl );
00220   if( S_OK != hResult )
00221    return hResult;
00222
00223   LPRESULTDATA  ipResultData = NULL;
00224   hResult = pComp->GetInterface( REQUEST_IRESULTDATA, (LONG_PTR*)&ipResultData );
00225   if( S_OK != hResult )
00226    return hResult;
00227
00228   if( TRUE == nArg )  // Selecting a scope node
00229   {
00230     do
00231     {
00232       hResult = ipHeaderCtrl->InsertColumn( 0, L"Device Name", 0, 150 );
00233       BREAK_ON_ERROR( hResult );
00234
00235       hResult = ipHeaderCtrl->InsertColumn( 1, L"Status", 0, 150 );
00236       BREAK_ON_ERROR( hResult );
00237
00238       hResult = ipResultData->ModifyViewStyle( MMC_NOSORTHEADER, (MMC_RESULT_VIEW_STYLE)NULL );
00239       BREAK_ON_ERROR( hResult );
00240
00241     }while(0);
00242   }
00243   else // not handling deselect notifications
00244   {
00245   }
00246
00247   TRACE_HRESULT(_T("OnShow"), hResult );
00248   return hResult;
00249 }
00250
00251
00252 //---------------------------------------------------------------------------
00253 HRESULT CStaticNode::OnSelect
00254 (
00255   LPDATAOBJECT   ipDataObject,   //[in] Points to the selected data object
00256   LONG           nArg,           //[in] Status of selected item
00257   LONG           nParam,         //[in] Not used
00258   LONG_PTR       pComponent      //[in] Pointer to parent CComponent
00259 )
00260 {
00261   BOOL    fScopePane = LOWORD(nArg);
00262   BOOL    fSelected  = HIWORD(nArg);
00263   HRESULT hResult    = S_FALSE;
00264
00265   if( NULL == ipDataObject )           // Can get this when closing the SnapIn
00266     return hResult;
00267
00268   CComponent* pComp = reinterpret_cast<CComponent*>(pComponent);
00269   LPCONSOLEVERB  ipConsoleVerb = NULL;
00270   hResult = pComp->GetInterface( REQUEST_ICONSOLEVERB, (LONG_PTR*)&ipConsoleVerb );
00271   if( S_OK != hResult )
00272     return hResult;
00273
00274   if( TRUE == fScopePane && TRUE == fSelected )
00275   {
00276     // This is where we will set verbs in later versions
00277   }
00278
00279   TRACE_HRESULT(_T("OnSelect"), hResult );
00280   return hResult;
00281
00282 }
00283
00284 //---------------------------------------------------------------------------
00285 //  The static node is a special case.  The CComponentData pointer is also
00286 //  our parent so we don't need to use the pCompData parameter
00287 //
00288 HRESULT CStaticNode::OnExpand
00289 (
00290   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00291   LONG           nArg,         //[in] TRUE if node was selcted
00292   LONG           nParam,       //[in] HSCOPEITEM of selected/deselected item
00293   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00294 )
00295 {
00296   HRESULT hResult = S_FALSE;
00297
00298   if( NULL == m_hStaticNode )          // Cache the root node handle
00299     m_hStaticNode = static_cast<HSCOPEITEM>(nParam);
00300
00301   if( NULL == m_pCompData )
00302     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00303
00304
00305   // Request an IConsoleNameSpace2 pointer from CComponentData
00306   // The static node is a unique case since it's parent is also IComponentData
00307   //
00308   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00309   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00310   if( S_OK != hResult )
00311     return hResult;
00312
00313   hResult = DeleteScopeItems( ipCNS2 );
00314   hResult = InsertScopeItems( ipCNS2 );
00315
00316   return hResult;
00317 }
00318
00319
00320 //---------------------------------------------------------------------------
00321 HRESULT CStaticNode::OnRemoveChildren
00322 (
00323   LPDATAOBJECT   ipDataObject, //[in] Points to selected data object
00324   LONG           nArg,         //[in] TRUE if node was selcted
00325   LONG           nParam,       //[in] HSCOPEITEM of selected/deselected item
00326   LONG_PTR       pCompData     //[in] Points to calling CComponentData
00327 )
00328 {
00329   HRESULT hResult = S_FALSE;
00330
00331   if( NULL == m_pCompData )
00332     m_pCompData = reinterpret_cast<CComponentData*>(pCompData);
00333
00334   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00335   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00336   if( S_OK != hResult )
00337     return hResult;
00338
00339   hResult = DeleteScopeItems( ipCNS2 );
00340
00341   POSITION   Pos   = m_NodeList.GetHeadPosition();
00342   LPBASENODE pNode = NULL;
00343   while( Pos )                         // Delete everything...
00344   {
00345     pNode = m_NodeList.GetNext( Pos );
00346     pNode->OnRemoveChildren( ipDataObject, nArg, nParam, pCompData );
00347     delete pNode;
00348   }
00349
00350   m_NodeList.RemoveAll();              // Cleanup the list
00351
00352   TRACE_HRESULT( _T("OnRemoveChildren"), hResult );
00353   return hResult;
00354 }
00355
00356
00357 /////////////////////////////////////////////////////////////////////////////
00358 // Private helper methods
00359
00360
00361 //---------------------------------------------------------------------------
00362 //  Initializes the node list.
00363 //
00364 HRESULT CStaticNode::RefreshNodeList()
00365 {
00366   NODE_PROPERTIES NodeProps;
00367   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00368   NodeProps.pParentObject  = reinterpret_cast<LONG_PTR>(this);
00369   NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00370
00371   WCHAR  szNames[2][32];
00372   wcscpy( szNames[0], L"RamDisk 0" );
00373   wcscpy( szNames[1], L"Archive 0" );
00374
00375   RemoveNodes();                       // Clean the node list
00376
00377   CDeviceNode* pNode = NULL;
00378   for( DWORD i = 0; i < 2; i++ )
00379   {
00380     wcscpy( NodeProps.szNodeName, szNames[i] );
00381     pNode = new CDeviceNode;
00382     pNode->Initialize( &NodeProps );
00383     m_NodeList.AddTail( pNode );
00384
00385     // Kind of a hack, make the second device a backup device
00386     NodeProps.dwAttributes |= ATTRIBUTE_BACKUP_DEVICE;
00387   }
00388
00389   return S_OK;
00390 }
00391
00392
00393 //---------------------------------------------------------------------------
00394 //  For these first level nodes the parent is always the static or root
00395 //  node.
00396 //
00397 HRESULT CStaticNode::InsertScopeItems
00398 (
00399   LPCONSOLENAMESPACE2 ipCNS2   //[in] Needed to insert items
00400 )
00401 {
00402   _ASSERT( NULL != ipCNS2 );
00403   _ASSERT( NULL != m_hStaticNode );
00404
00405   HRESULT      hResult = S_FALSE;
00406   POSITION     Pos     = m_NodeList.GetHeadPosition();
00407   CDeviceNode* pNode   = NULL;
00408
00409   while( Pos )
00410   {
00411     pNode   = m_NodeList.GetNext( Pos );
00412     pNode->m_SDI.relativeID = m_hStaticNode;
00413     hResult = ipCNS2->InsertItem( &pNode->m_SDI );
00414   }
00415
00416   return hResult;
00417 }
00418
00419
00420 //---------------------------------------------------------------------------
00421 //  Delete the HSCOPEITEMS only, we leave the list of nodes untouched
00422 //
00423 HRESULT CStaticNode::DeleteScopeItems
00424 (
00425   LPCONSOLENAMESPACE2 ipCNS2   //[in] Needed to delete items
00426 )
00427 {
00428   _ASSERT( NULL != ipCNS2 );
00429
00430   POSITION    Pos     = m_NodeList.GetHeadPosition();
00431   HSCOPEITEM  hItem   = NULL;
00432   LPBASENODE  pNode   = NULL;
00433   HRESULT     hResult = S_FALSE;
00434
00435   while( Pos )                         // Delete everything...
00436   {
00437     pNode = m_NodeList.GetNext( Pos );
00438     hItem = (HSCOPEITEM)pNode->m_SDI.ID;
00439     if( 0 != hItem )
00440       hResult = ipCNS2->DeleteItem( hItem, TRUE );
00441   }
00442
00443   return hResult;
00444
00445 }
00446
00447 //---------------------------------------------------------------------------
00448 //  We do this instead of just calling RemoveAll() because our list contains
00449 //  CBaseNode pointers and so RemoveAll() does not call the destructor for
00450 //  the derived class object.
00451 //
00452 VOID CStaticNode::RemoveNodes()
00453 {
00454   LPBASENODE pNode = NULL;
00455   POSITION   Pos   = m_NodeList.GetHeadPosition();
00456   while( Pos )
00457   {
00458     pNode = m_NodeList.GetNext( Pos );
00459     delete pNode;
00460   }
00461   m_NodeList.RemoveAll();              // Clean the list
00462 }
00463
00464 //---------------------------------------------------------------------------
00465 HRESULT CStaticNode::AddDeviceNode
00466 (
00467   NODE_PROPERTIES*    pProps   //[in] Properties for the new node
00468 )
00469 {
00470   _ASSERT( NULL != pProps );
00471
00472   CDeviceNode* pNode   = NULL;
00473   HRESULT      hResult = S_FALSE;
00474
00475   pProps->pParentObject  = reinterpret_cast<LONG_PTR>(this);
00476   pProps->pComponentData = reinterpret_cast<LONG_PTR>(m_pCompData);
00477
00478   pNode = new CDeviceNode;         // Create and initialize the new
00479   pNode->Initialize( pProps );     // node, then add to our linked
00480   m_NodeList.AddTail( pNode );     // list, then insert the node
00481
00482   pNode->m_SDI.relativeID = m_hStaticNode;
00483
00484   LPCONSOLENAMESPACE2 ipCNS2 = NULL;
00485   hResult = m_pCompData->GetInterface( REQUEST_ICONSOLENAMESPACE2, (LONG_PTR*)&ipCNS2 );
00486   if( S_OK != hResult )
00487     return hResult;
00488
00489   hResult = ipCNS2->InsertItem( &pNode->m_SDI );
00490   // TRACE_HRESULT( _T("AddDeviceNode"), hResult );
00491   return hResult;
00492 }
00493
00494 //---------------------------------------------------------------------------
00495 //  Get the selected node and call it's ToggleStatus method
00496 //
00497 VOID CStaticNode::ToggleStatus
00498 (
00499   LPDATAOBJECT ipDataObject
00500 )
00501 {
00502   CDeviceNode* pNode = (CDeviceNode*)ExtractBaseNodePtr( ipDataObject );
00503   if( NULL != pNode )
00504     pNode->ToggleStatus();
00505
00506 }
00507
00508
00509 /////////////////////////////////////////////////////////////////////////////
00510 //  Support for Context Menus
00511
00512 //---------------------------------------------------------------------------
00513 //  NOTE:  Don't AddRef ipCallback.  Check docs.
00514 //
00515 HRESULT CStaticNode::AddMenuItems
00516 (
00517   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00518   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00519 )
00520 {
00521   _ASSERT( NULL != ipCallback );
00522   HRESULT hResult = S_FALSE;
00523
00524   static CONTEXTMENUITEM ctxMenu;
00525     ctxMenu.lCommandID        = IDM_NEW_DEVICE;
00526     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_PRIMARY_NEW;
00527     ctxMenu.fSpecialFlags     = 0;
00528     ctxMenu.strName           = L"New Device...";
00529     ctxMenu.strStatusBarText  = L"Add a new device";
00530
00531
00532   if( NULL == m_hAddDeviceDlg )    // If the AddDevice dialog is running
00533     ctxMenu.fFlags = 0;            // gray the menu selection
00534   else
00535     ctxMenu.fFlags = MF_GRAYED;
00536
00537
00538   // Add the 'New Device' option to the New menu if allowed...
00539   if( CCM_INSERTIONALLOWED_NEW & *pInsertionAllowed )
00540   {
00541     hResult = ipCallback->AddItem( &ctxMenu );
00542   }
00543
00544   return hResult;
00545 }
00546
00547
00548 //---------------------------------------------------------------------------
00549 HRESULT CStaticNode::Command
00550 (
00551   long lCommandID          //[in] Indentifier for menu ID
00552 )
00553 {
00554   HRESULT hResult = S_OK;
00555
00556   switch( lCommandID )
00557   {
00558     case IDM_NEW_DEVICE:
00559     {
00560       CAddDeviceDlg* pDlg = new CAddDeviceDlg( IDD_ADDDEVICE_DLG, m_hMessageWnd );
00561       m_hAddDeviceDlg = pDlg->Create( g_hInst, GetDesktopWindow(), 0 );
00562       break;
00563     }
00564     default:
00565     {
00566       hResult = S_FALSE;
00567       break;
00568     }
00569   }
00570   return hResult;
00571 }
00572
00573
00574
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/filerepservice.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

filerepservice.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server System Service
00006
00007     FILE: FileRepService.c
00008
00009     PURPOSE: Provides file replication services.
00010
00011     FUNCTIONS:
00012         main() - calls the StartServiceCtrlDispatcher function to
00013             connect to the SCM and start the control dispatcher thread.
00014         ServiceMain() - the entry point for the service.
00015         ServiceCtrl() - this function is called by the dispatcher thread.
00016             It handles the control code passed to it.
00017         ServiceStart() - performs actual initialization and starts the service.
00018             Makes the RPC server listen for calls.
00019         ServiceStop() - stops listening for RPCs.
00020
00021     COMMENTS:
00022
00023 */
00024
00025 #include <windows.h>
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <process.h>
00029 #include <tchar.h>
00030 #include <rpc.h>
00031
00032 // Generated by the MIDL compiler
00033 #include "FileRepServer.h"
00034 #include "FileRepClient.h"
00035
00036 // Contains declarations for system service functions.
00037 #include "Service.h"
00038
00039 // Common definitions
00040 #include "common.h"
00041
00042 /*
00043     Internal funtion declarations.
00044     See definitions for more info.
00045 */
00046
00047 VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv);
00048
00049 VOID WINAPI ServiceCtrl(DWORD Opcode);
00050
00051 VOID ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
00052
00053 VOID ServiceStop();
00054
00055 /*
00056     Internal variables
00057 */
00058
00059 // status handle of the service
00060 SERVICE_STATUS_HANDLE sshStatusHandle;
00061
00062 // current status of the service
00063 SERVICE_STATUS ssStatus;
00064
00065 /*
00066     FUNCTION: main()
00067
00068     PURPOSE: main() calls StartServiceCtrlDispatcher to register the
00069         main service thread.    When this call returns,
00070         the service has stopped.
00071
00072     PARAMETERS:
00073         dwArgc - number of command line arguments
00074         lpszArgv - array of command line arguments
00075
00076     RETURN VALUE:
00077         none
00078
00079     COMMENTS:
00080 */
00081 VOID _cdecl main(int argc, char **argv){
00082
00083     // Since we provide a single service there is only
00084     // one entry in the service dispatch table
00085     SERVICE_TABLE_ENTRY DispatchTable[] = {
00086         { TEXT(SERVICENAME), (LPSERVICE_MAIN_FUNCTION)ServiceMain },
00087         { NULL, NULL }
00088     };
00089
00090     // The service control manager may be starting the service with
00091     // this call, so we must call StartServiceCtrlDispatcher.
00092     if (!StartServiceCtrlDispatcher(DispatchTable)) {
00093         AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed"));
00094     }
00095 }
00096
00097 /*
00098     FUNCTION: ServiceMain
00099
00100     PURPOSE: To perform actual initialization of the client service.    It
00101         is the entry point into the service.
00102
00103     PARAMETERS:
00104         dwArgc - number of command line arguments
00105         lpszArgv - array of command line arguments
00106
00107     RETURN VALUE:
00108         none
00109
00110     COMMENTS:
00111         This routine performs the service initialization and then calls
00112         the user defined ServiceStart() routine to perform majority
00113         of the work.
00114 */
00115 VOID WINAPI ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) {
00116
00117     // Initial service configuration
00118     ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
00119     ssStatus.dwCurrentState = SERVICE_START_PENDING;
00120     ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
00121     ssStatus.dwWin32ExitCode = 0;
00122     ssStatus.dwServiceSpecificExitCode = 0;
00123     ssStatus.dwCheckPoint = 0;
00124     ssStatus.dwWaitHint = 0;
00125
00126     sshStatusHandle = RegisterServiceCtrlHandler(TEXT(SERVICENAME), ServiceCtrl);
00127
00128     // Tell the SCM that the service is starting up.
00129     if (!SetServiceStatus(sshStatusHandle, &ssStatus)) {
00130         AddToMessageLog(TEXT("ServiceMain: SetServiceStatus failed\n"));
00131         return;
00132     }
00133
00134     // Initialize the service and start it.
00135     ServiceStart(dwArgc, lpszArgv);
00136
00137     return;
00138 }
00139
00140 /*
00141     FUNCTION: ServiceCtrl
00142
00143     PURPOSE: This function is called by the SCM whenever
00144         ControlService() is called on this service.
00145
00146     PARAMETERS:
00147         dwCtrlCode - type of control requested
00148
00149     RETURN VALUE:
00150         none
00151
00152     COMMENTS:
00153 */
00154
00155 VOID WINAPI ServiceCtrl(DWORD Opcode) {
00156
00157     // We only handle the STOP control requsts.
00158     switch(Opcode) {
00159
00160         case SERVICE_CONTROL_STOP:
00161             // Stop the service.
00162             ServiceStop();
00163       break;
00164
00165         default:
00166       AddToMessageLog(TEXT("ServiceCtrl: unrecognized or unimplemented opcode\n"));
00167     }
00168
00169     return;
00170 }
00171
00172
00173 /*
00174     RPC configuration.
00175 */
00176
00177 // The service listens to all the protseqs listed in this array.
00178 // It listens for replication utilities on local RPC and for
00179 // remote requests on TCP/IP
00180 LPTSTR ServerProtocolArray[] = { TEXT("ncacn_ip_tcp"),
00181          TEXT("ncalrpc") };
00182
00183 // Used in RpcServerUseProtseq.
00184 // Specifies the maximum number of concurrent remote
00185 // procedure call requests the server wants to handle.
00186 ULONG cMaxCallsListen = RPC_C_PROTSEQ_MAX_REQS_DEFAULT;
00187
00188 // Similarly, but for RpcServerListen.
00189 ULONG cMaxCallsExecute = RPC_C_LISTEN_MAX_CALLS_DEFAULT;
00190
00191 // Used in RpcServerListen().  The minnimum number of threads listening.
00192 ULONG cMinimumThreads = 2;
00193
00194 RPC_BINDING_VECTOR * pBindingVector = NULL;
00195
00196 // Status variable for the RPC calls.
00197 RPC_STATUS status;
00198
00199 /*
00200     FUNCTION: ServiceStart
00201
00202     PURPOSE: Actual code of the service
00203              that does the work.
00204
00205     PARAMETERS:
00206         dwArgc - number of command line arguments
00207         lpszArgv - array of command line arguments
00208
00209     RETURN VALUE:
00210         none
00211
00212     COMMENTS:
00213         Starts the service listening for RPC requests.
00214 */
00215 VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv){
00216
00217     unsigned int i;
00218
00219     // Report the status to the service control manager.
00220     if (!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_START_PENDING, NO_ERROR, 1000)) {
00221         AddToMessageLog(TEXT("ReportStatusToSCMgr failed\n"));
00222   ServiceStop();
00223         return;
00224     }
00225
00226     // Service initialization
00227
00228     // Register the service interfaces.
00229     status = RpcServerRegisterIf(s_FileRepServer_v1_0_s_ifspec, NULL, NULL);
00230     if (status != RPC_S_OK){
00231         AddToMessageLog(TEXT("ServiceStart: RpcServerRegisterIf(s_FileRepServer_v1_0_s_ifspec, ...) failed\n"));
00232   ServiceStop();
00233         return;
00234     }
00235     status = RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, NULL, NULL);
00236     if (status != RPC_S_OK){
00237         AddToMessageLog(TEXT("ServiceStart: RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, ...) failed\n"));
00238   ServiceStop();
00239         return;
00240     }
00241
00242     for (i = 0; i < sizeof(ServerProtocolArray)/sizeof(unsigned char *); i++) {
00243
00244         // Use the protocol sequences specified in ProtocolArray
00245         // for receiving RPCs.
00246         status = RpcServerUseProtseq((_TUCHAR *)ServerProtocolArray[i], cMaxCallsListen, NULL);
00247
00248         if (status != RPC_S_OK){
00249             AddToMessageLog(TEXT("ServiceStart: RpcServerUseProtseq failed\n"));
00250       ServiceStop();
00251             return;
00252         }
00253     }
00254
00255     // Obtain a binding vector for the server.
00256     status = RpcServerInqBindings(&pBindingVector);
00257     if (status != RPC_S_OK) {
00258         AddToMessageLog(TEXT("ServiceStart: RpcServerInqBindings failed\n"));
00259   ServiceStop();
00260         return;
00261     }
00262
00263     // Register the client and the server services in the endpoint map
00264     // of the host computer.
00265     status = RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00266     if (status != RPC_S_OK){
00267         AddToMessageLog(TEXT("ServiceStart: RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, ...) failed\n"));
00268   ServiceStop();
00269         return;
00270     }
00271     status = RpcEpRegister(FileRepClient_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00272     if (status != RPC_S_OK){
00273         AddToMessageLog(TEXT("ServiceStart: RpcEpRegister(FileRepClient_v1_0_s_ifspec, ...) failed\n"));
00274   ServiceStop();
00275         return;
00276     }
00277
00278     // Create the heap to be used by midl_user_allocate and midl_user_free
00279     RpcHeap = HeapCreate(0, RPC_HEAP_SIZE_INIT, RPC_HEAP_SIZE_MAX);
00280
00281 #ifdef PROF
00282     ProfOpenLog(TEXT("FileRepService.prof"));
00283 #endif
00284
00285     // Start accepting client calls.
00286     // The last argument's being 1 indicates that RpcServerListen
00287     // should return immediately after completing function processing.
00288     status = RpcServerListen(cMinimumThreads, cMaxCallsExecute, 1);
00289     if (status != RPC_S_OK){
00290         AddToMessageLog(TEXT("ServiceStart: RpcServerListen failed\n"));
00291   ServiceStop();
00292         return;
00293     }
00294
00295     // Tell The SCM that the service is running.
00296     if (!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_RUNNING, NO_ERROR, 0)){
00297         AddToMessageLog(TEXT("ServiceStart: ReportStatusToSCMgr failed"));
00298   ServiceStop();
00299         return;
00300     }
00301
00302     // End of initialization
00303
00304     // RpcMgmtWaitServerListen() will block until the server has
00305     // stopped listening.
00306     status = RpcMgmtWaitServerListen();
00307     if (status != RPC_S_OK){
00308         AddToMessageLog(TEXT("ServiceStart: RpcMgmtWaitServerListen failed"));
00309   ServiceStop();
00310         return;
00311     }
00312
00313     // Cleanup
00314
00315     // Delete the binding vector.
00316     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
00317     if(status != RPC_S_OK){
00318         AddToMessageLog(TEXT("ServiceStart: RpcServerUnregisterIf failed"));
00319         return;
00320     }
00321
00322     return;
00323 }
00324
00325
00326 /*
00327     FUNCTION: ServiceStop
00328
00329     PURPOSE: Stops a service
00330
00331     PARAMETERS:
00332         none
00333
00334     RETURN VALUE:
00335         none
00336
00337     COMMENTS:
00338
00339 */
00340 VOID ServiceStop() {
00341     RPC_STATUS status;
00342
00343     // Stops the server, wakes up the main thread.
00344     status = RpcMgmtStopServerListening(NULL);
00345     if(status != RPC_S_OK) {
00346         AddToMessageLog(TEXT("ServiceStop: RpcMgmtStopServerListening failed."));
00347         return;
00348     }
00349
00350     // Tell The SCM that the service is stopped.
00351     if(!ReportStatusToSCMgr(&sshStatusHandle, &ssStatus, SERVICE_STOPPED, NO_ERROR, 0)) {
00352         AddToMessageLog(TEXT("ServiceStop: ReportStatusToSCMgr failed"));
00353         return;
00354     }
00355
00356 #ifdef PROF
00357     ProfCloseLog();
00358 #endif
00359
00360 }
00361
00362 // end FileRepService.c
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/sky.h Source File

  • SysMgmt
  • MMC
  • CutCopy

sky.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _SKY_H
00021 #define _SKY_H
00022
00023 #include "DeleBase.h"
00024
00025 class CSkyBasedVehicle : public CDelegationBase {
00026 public:
00027     CSkyBasedVehicle() { }
00028
00029     virtual ~CSkyBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Sky-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_SKYICON; }
00034
00035 public:
00036     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem);
00037     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions);
00038
00039 private:
00040     enum { IDM_NEW_SKY = 3 };
00041
00042     // {2974380F-4C4B-11d2-89D8-000021473128}
00043     static const GUID thisGuid;
00044 };
00045
00046
00047 #endif // _SKY_H
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WtsApi/TSSysInf/Inc/SysInfo.h Source File

  • WinBase
  • WtsApi
  • TSSysInf
  • Inc

SysInfo.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright 1998 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     tssysinfo.h
00008
00009 Abstract:
00010
00011     This module contains the declarations for the functions used in the check_sd
00012     sample.  The declarations are grouped based on the modules they are located in.
00013
00014 Author:
00015
00016     Frank Kim (franki)    18-Mar-99
00017
00018 --*/
00019
00020 #ifndef _TSSYSINFO_
00021 #define _TSSYSINFO_
00022
00023 #define STRICT
00024 #define _
00025
00026 //
00027 // undefine this if you want to build for UNICODE
00028 //
00029 //#define UNICODE
00030 //#define _UNICODE
00031
00032 #include <windows.h>
00033 #include <stdio.h>
00034 #include <wtsapi32.h>
00035 #include <tchar.h>
00036 #include <lmcons.h>
00037
00038 #ifdef TSDLL
00039
00040 #include <pchannel.h>
00041 #include <cchannel.h>
00042
00043 #endif
00044
00045 //
00046 // definitions
00047 //
00048 #define CHANNELNAME "sysinfo"
00049 #define TSVERSIONINFO 0
00050 #define TSMEMORYINFO  1
00051 #define QUERY_INTERVAL 2000  // milliseconds
00052
00053 //
00054 // definitions
00055 //
00056 typedef struct{
00057     char          szClientName[MAX_COMPUTERNAME_LENGTH+1];
00058     TCHAR         szComputerName[MAX_COMPUTERNAME_LENGTH+1];
00059     TCHAR         szUserName[UNLEN+1];
00060     OSVERSIONINFO osvi;
00061     SYSTEM_INFO   si;
00062 } TS_VERSION_INFO;
00063
00064 //
00065 // GLOBAL variables
00066 //
00067 #ifdef TSDLL
00068
00069 HANDLE                ghThread;
00070 HANDLE                ghWriteEvent;
00071 HANDLE                ghAlertThread;
00072 HANDLE                ghStopThread;
00073 HANDLE                ghSynchCodeEvent;
00074 LPHANDLE              gphChannel;
00075 DWORD                 gdwOpenChannel;
00076 PCHANNEL_ENTRY_POINTS gpEntryPoints;
00077 DWORD                 gdwControlCode;
00078 char                  gszClientName[MAX_COMPUTERNAME_LENGTH+1];
00079
00080 #else
00081
00082 HANDLE                ghEventEnd;
00083
00084 #endif
00085
00086 //
00087 // declarations
00088 //
00089 void DisplayError(LPTSTR pszAPI);
00090
00091 #ifdef TSDLL
00092 void WaitForTheWrite(HANDLE hEvent);
00093 void GetMemoryInfo(void);
00094 void GetVersionInfo(void);
00095 void WINAPI WorkerThread(void);
00096 void WINAPI VirtualChannelOpenEvent(DWORD openHandle, UINT event, LPVOID pdata, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags);
00097 VOID VCAPITYPE VirtualChannelInitEventProc(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength);
00098 BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints);
00099 #else
00100 BOOL WINAPI HandlerRoutine(DWORD dwCtrlType);
00101 #endif
00102
00103 #endif // _TSSYSINFO_
00104
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/Server.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

Server.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SERVER.H
00003
00004   Summary:   Internal include file for the DLLSERVE.DLL server code
00005              sample.  Contains class declarations, Resource IDs and
00006              string macros for internal use in constructing this DLL
00007              as a COM component server.  Declares the CServer server
00008              control object class.
00009
00010              For a comprehensive tutorial code tour of this module's
00011              contents and offerings see the tutorial DLLSERVE.HTM file.
00012              For more specific technical details on the internal workings
00013              see the comments dispersed throughout the module's source code.
00014
00015   Classes:   CServer.
00016
00017   Functions: none
00018
00019   Origin:    9-11-95: atrent - Editor-inheritance from CAR.H in
00020                the COMOBJ Tutorial Code Sample.
00021
00022 ----------------------------------------------------------------------------
00023   This file is part of the Microsoft COM Tutorial Code Samples.
00024
00025   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00026
00027   This source code is intended only as a supplement to Microsoft
00028   Development Tools and/or on-line documentation.  See these other
00029   materials for detailed information regarding Microsoft code samples.
00030
00031   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00032   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00033   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00034   PARTICULAR PURPOSE.
00035 ==========================================================================+*/
00036
00037
00038 #if !defined(SERVER_H)
00039 #define SERVER_H
00040
00041 // String Macros.
00042 #define ABOUT_TITLE_STR "DLLSERVE: Tutorial Code Sample"
00043
00044 // Dialog IDs.
00045 #define IDD_ABOUTBOX                1000
00046
00047 // Error-related String Identifiers.
00048 #define IDS_ASSERT_FAIL             2200
00049
00050
00051 #ifdef __cplusplus
00052
00053 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00054   Class:    CServer
00055
00056   Summary:  Class to encapsulate control of this COM server (eg, handle
00057             Lock and Object counting, encapsulate otherwise global data).
00058
00059   Methods:  none
00060 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00061 class CServer
00062 {
00063   public:
00064     CServer(void);
00065     ~CServer(void);
00066
00067     void Lock(void);
00068     void Unlock(void);
00069     void ObjectsUp(void);
00070     void ObjectsDown(void);
00071
00072     // A place to store the handle to loaded instance of this DLL module.
00073     HINSTANCE m_hDllInst;
00074
00075     // A place to store a client's parent window.
00076     HWND m_hWndParent;
00077
00078     // A Pointer to a Message Box object.
00079     CMsgBox* m_pMsgBox;
00080
00081     // Global DLL Server living Object count.
00082     LONG m_cObjects;
00083
00084     // Global DLL Server Client Lock count.
00085     LONG m_cLocks;
00086 };
00087
00088 #endif // __cplusplus
00089
00090 // Allow other internal DLLSERVE modules to get at the globals.
00091 extern CServer* g_pServer;
00092 extern CMsgLog* g_pMsgLog;
00093
00094
00095 #endif // SERVER_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/filerepclient.idl Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

filerepclient.idl

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005
00006     FILE: FileRepClient.idl
00007
00008     PURPOSE:  Defines the interface for the client system service.
00009
00010 */
00011
00012 [
00013     uuid(fe7f2eda-5da1-4041-928c-d2534d3fa129),
00014     pointer_default(ref),
00015     version(1.0)
00016 ]
00017
00018 interface FileRepClient {
00019
00020 // Declare the string data type. This should work for UNICODE.
00021 #ifdef _UNICODE
00022     typedef wchar_t * STR;
00023 #else
00024     typedef unsigned char * STR;
00025 #endif
00026
00027     /*
00028         A replication request is made by making this RPC.  With ServerName
00029   specifying the source machine for replication, RemoteFileName
00030   specifying the source file for replication, and LocalFileName
00031   the name for the file on the local machine.  A thread is forked
00032   to handle the actual file replication and an error encountered by
00033   the thread will not produce the error return status.
00034     */
00035     void RequestFile([in] handle_t hFileRepClient,
00036          [in, ref, string] STR ServerName,
00037          [in, ref, string] STR RemoteFileName,
00038          [in, ref, string] STR LocalFileName);
00039 }
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_CLIPBOOKSERVER_RESOURCE Member List

This is the complete list of members for _CLIPBOOKSERVER_RESOURCE, including all inherited members.
cwWorkerThread | _CLIPBOOKSERVER_RESOURCE
dwProcessId | _CLIPBOOKSERVER_RESOURCE
hCluster | _CLIPBOOKSERVER_RESOURCE
hkeyParameters | _CLIPBOOKSERVER_RESOURCE
hResource | _CLIPBOOKSERVER_RESOURCE
hResourceHandle | _CLIPBOOKSERVER_RESOURCE
hService | _CLIPBOOKSERVER_RESOURCE
pwszResourceName | _CLIPBOOKSERVER_RESOURCE
resid | _CLIPBOOKSERVER_RESOURCE
state | _CLIPBOOKSERVER_RESOURCE
Generated on Wed Nov 13 2024 16:55:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_WORK_THREAD_DATA Member List

This is the complete list of members for _WORK_THREAD_DATA, including all inherited members.
hPort | _WORK_THREAD_DATA
pRecvBuf | _WORK_THREAD_DATA
pSendBuf | _WORK_THREAD_DATA
RecvBufSize | _WORK_THREAD_DATA
SendBufSize | _WORK_THREAD_DATA
VOID(WINAPI *pfnSecurityDialogEnd)(SECURITY_MESSAGE *) | _WORK_THREAD_DATA
Generated on Wed Nov 13 2024 16:55:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/createuser/vc/main.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • createuser
  • vc

main.cpp

Go to the documentation of this file.
00001
00002 #define INC_OLE2
00003 #define UNICODE 1
00004 #define _WIN32_DCOM
00005
00006 #include <windows.h>
00007 #include <winuser.h>
00008
00009 #include <stdio.h>
00010 #include <stdlib.h>
00011 #include <string.h>
00012 #include <malloc.h>
00013 #include <winldap.h>
00014
00015 #include <activeds.h>
00016 #include <assert.h>
00017
00018 #include "CreateUserHelpers.h"
00019 #include "UserProps.h"
00020
00021
00022 //#include "AttributesList.h"
00023 #define MAX_ATTRIBS 4096
00024
00025 ////////////////////////////////////////////////////////////////////////////////////////////////////
00026 // String for usage information
00027 WCHAR * pwszUsage = L"Creates new User under the passed container.\n"
00028                     L"Usage:\n"
00029                     L"CreateUser\n"
00030                     L"        <*> Simple New User Information <*>\n"
00031                     L"            /LDAP <Path of container>\n"
00032                     L"              ADsPath of the container for placing the new group\n"
00033                     L"           /UNAME <NT 5 User Name> \n"
00034                     L"              This is the name for the new group\n"
00035                     L"           /SAMNAME <Downlevel NT 4 Sam Account name>\n"
00036                     L"              Cannot exceed 20 characters and must be globally unique\n"
00037                     L"\n"
00038                     L"        <*> Detailed New User information <*>\n"
00039                     L"            /FILE < Info File >\n"
00040                     L"              Filename for file to contain new user information\n"
00041                     L"\n"
00042                     L"        <*> OPTIONAL Binding Information <*>\n"
00043                     L"           /USER <User name used for binding to the DC>\n"
00044                     L"           /PASS <Password used for binding to the DC>\n"
00045                     L"           (If these are passed, binding is done with ADsOpenObject())\n"
00046                     L"\n"
00047                     L"\n";
00048
00049
00050 // Sample command line:
00051
00052 //    /LDAP "LDAP://nttest.microsoft.com/CN=UGExercise Sample Container,dc=nttest,dc=microsoft,dc=com" /UNAME BOB /SAMNAME BOB /USER Administrator /PASS ""
00053
00054 ////////////////////////////////////////////////////////////////////////////////////////////////////
00055 // Module level global variables
00056
00057 BSTR bsLDAP     = NULL; // <Path of container> ADsPath of the container for placing the new group
00058
00059 BSTR bsUNAME    = NULL; // <NT 5 User Name> This is the name for the new group
00060
00061 BSTR bsSAMNAME  = NULL; // <Downlevel NT 4 Sam Account name> Cannot exceed 20 characters and must be globally unique
00062
00063 BSTR bsFILE     = NULL; // < Info File > Filename for file to contain new user information
00064
00065 BSTR bsUSER     = NULL; // <User name used for binding to the DC>
00066
00067 BSTR bsPASS     = NULL; // <Password used for binding to the DC>
00068
00069 ////////////////////////////////////////////////////////////////////////////////////////////////////
00070 // Forward Declarations
00071 BOOL    ParseCommandLine( int argc, wchar_t *argv[ ]);
00072 HRESULT CreateUser(IDirectoryObject *pDirObject, LPWSTR pwCommonName,LPWSTR pwSamAcctName,IDirectoryObject ** ppDirObjRet);
00073 void    Trim(LPWSTR pwszData);
00074 HRESULT CreateUserFromFile(IDirectoryObject *pDirObject, LPWSTR pwCommonName,LPWSTR pwSamAcctName,IDirectoryObject ** ppDirObjRet,LPWSTR pwszFileName);
00075 BOOL    GetNextLine(FILE* fp,LPWSTR pwszDest,int iSize);
00076 void    RemoveSpecialChars(LPWSTR pwszLine);
00077
00078 ////////////////////////////////////////////////////////////////////////////////////////////////////
00079 // main()
00080
00081 /* Note: Using the UNICODE version of main().
00082    this removes the need for the sample to include
00083    UNICODE-ANSI conversion routines
00084 */
00085 void wmain( int argc, wchar_t *argv[ ])
00086 {
00087     WCHAR pwszTemp[4096];
00088
00089     // We have now scanned PAST whitespace- so copy the string:
00090     wcscpy(pwszTemp,L" A String");
00091
00092     Trim(pwszTemp);
00093
00094     HRESULT hr;
00095     IDirectoryObject * pDirObjectContainer = NULL;
00096     IDirectoryObject * pDirObjRet = NULL;
00097
00098     // Initialize COM
00099     CoInitialize(0);
00100
00101     if (!ParseCommandLine(argc,argv))
00102         return;
00103
00104     // Bind to the container passed
00105     // If USER and PASS passed in, use ADsOpenObject()
00106     if (bsUSER)
00107         hr = ADsOpenObject(bsLDAP, bsUSER, bsPASS,
00108                                    ADS_SECURE_AUTHENTICATION,IID_IDirectoryObject, (void**) &pDirObjectContainer);
00109     else
00110         hr = ADsGetObject(  bsLDAP, IID_IDirectoryObject,(void **)&pDirObjectContainer);
00111
00112     if (SUCCEEDED(hr))
00113     {
00114         // if a file is NOT passed in- Do the simple version
00115         if (!bsFILE)
00116         {
00117             // Call the helper funtion to create the User
00118             hr = CreateUser(pDirObjectContainer, bsUNAME,bsSAMNAME,
00119                              &pDirObjRet);
00120         }
00121         else // file was passed in
00122         {
00123             // Call the helper funtion to create the User
00124             hr = CreateUserFromFile(pDirObjectContainer, bsUNAME,bsSAMNAME,
00125                                     &pDirObjRet,bsFILE);
00126         }
00127         if (SUCCEEDED(hr))
00128         {
00129             _putws(L"\n\n New User created with the following properties:\n");
00130
00131             IADs * pIADsNewGoup = NULL;
00132
00133             // User succeeded- now get an IADs interface to it
00134             // and print some properties
00135             hr = pDirObjRet->QueryInterface(IID_IADs,(void**)&pIADsNewGoup);
00136
00137             if (SUCCEEDED(hr))
00138             {
00139                 PrintIADSObject(pIADsNewGoup);
00140
00141                 pIADsNewGoup->Release();
00142                 pIADsNewGoup = NULL;
00143             }
00144             else
00145                 CheckADHRESULT(hr,L"QueryInterface() - New User for IADs");
00146             pDirObjRet->Release();
00147             pDirObjRet = NULL;
00148         }
00149         else
00150             CheckADHRESULT(hr,L"CreateUser()");
00151
00152         pDirObjectContainer->Release();
00153         pDirObjectContainer = NULL;
00154     }
00155     else
00156         if (bsUSER)
00157             CheckADHRESULT(hr,L"ADsOpenObject()");
00158         else
00159             CheckADHRESULT(hr,L"ADsGetObject()");
00160
00161     CoUninitialize();
00162  }
00163
00164
00165 ////////////////////////////////////////////////////////////////////////////////////////////////////
00166 /*
00167     ParseCommandLine()- Parses command line and sets module level globals
00168
00169     Parameters:
00170
00171         int argc            - Number of Arguments
00172         wchar_t *argv[ ]    - Array of arguments
00173
00174     Returns:
00175         TRUE if Command line was successfully parsed
00176
00177     Affectets global variables:
00178
00179         BSTR bsLDAP
00180         BSTR bsUNAME
00181         BSTR bsSAMNAME
00182         BSTR bsFILE
00183         BSTR bsUSER
00184         BSTR bsPASS
00185 */
00186
00187 BOOL ParseCommandLine( int argc, wchar_t *argv[ ])
00188 {
00189 /*
00190      ** PARSE the FOLLOWING ARGUMENTS:
00191     /LDAP <Path of container>
00192         ADsPath of the container for placing the new group
00193
00194     /UNAME <NT 5 User Name>
00195         This is the name for the new group
00196
00197     /SAMNAME <Downlevel NT 4 Sam Account name>
00198         Cannot exceed 20 characters and must be globally unique
00199
00200     <*> Detailed New User information <*>
00201     /FILE < Info File >
00202
00203         Filename for file to contain new user information
00204
00205     <*> OPTIONAL Binding Information <*>
00206     /USER <User name used for binding to the DC>
00207
00208     /PASS <Password used for binding to the DC>
00209     (If these are passed, binding is done with ADsOpenObject())
00210 */
00211   if (argc == 1)
00212   {
00213         _putws(pwszUsage);
00214         return FALSE;
00215     }
00216     for (int x= 1; x < argc; x++)
00217     {
00218         if (_wcsicmp(argv[x],L"/LDAP")==0)
00219         {
00220             if (argc == x) // Make sure the parameter was passed
00221             {
00222                 wprintf(L"\nERROR: %s Missing parameter!!!!\n\n",argv[x]);
00223                 _putws(pwszUsage);
00224                 return FALSE;
00225             }
00226             // Go to the next argument and save it in module level variable
00227             x++;
00228             bsLDAP = SysAllocString(argv[x]);
00229         }
00230         else if (_wcsicmp(argv[x],L"/UNAME")==0)
00231         {
00232             if (argc == x) // Make sure the parameter was passed
00233             {
00234                 wprintf(L"\nERROR: %s Missing parameter!!!!\n\n",argv[x]);
00235                 _putws(pwszUsage);
00236                 return FALSE;
00237             }
00238             // Go to the next argument and save it in module level variable
00239             x++;
00240             bsUNAME = SysAllocString(argv[x]);
00241         }
00242         else if (_wcsicmp(argv[x],L"/SAMNAME")==0)
00243         {
00244             if (argc == x) // Make sure the parameter was passed
00245             {
00246                 wprintf(L"\nERROR: %s Missing parameter!!!!\n\n",argv[x]);
00247                 _putws(pwszUsage);
00248                 return FALSE;
00249             }
00250             // Go to the next argument and save it in module level variable
00251             x++;
00252             bsSAMNAME = SysAllocString(argv[x]);
00253         }
00254         else if (_wcsicmp(argv[x],L"/FILE")==0)
00255         {
00256             if (argc == x) // Make sure the parameter was passed
00257             {
00258                 wprintf(L"\nERROR: %s Missing parameter!!!!\n\n",argv[x]);
00259                 _putws(pwszUsage);
00260                 return FALSE;
00261             }
00262             // Go to the next argument and save it in module level variable
00263             x++;
00264             bsFILE = SysAllocString(argv[x]);
00265         }
00266         else if (_wcsicmp(argv[x],L"/USER")==0)
00267         {
00268             if (argc == x) // Make sure the parameter was passed
00269             {
00270                 wprintf(L"\nERROR: %s Missing parameter!!!!\n\n",argv[x]);
00271                 _putws(pwszUsage);
00272                 return FALSE;
00273             }
00274             // Go to the next argument and save it in module level variable
00275             x++;
00276             bsUSER = SysAllocString(argv[x]);
00277         }
00278         else if (_wcsicmp(argv[x],L"/PASS")==0)
00279         {
00280             if (argc == x) // Make sure the parameter was passed
00281             {
00282                 wprintf(L"\nERROR: %s Missing parameter!!!!\n\n",argv[x]);
00283                 _putws(pwszUsage);
00284                 return FALSE;
00285             }
00286             // Go to the next argument and save it in module level variable
00287             x++;
00288             bsPASS = SysAllocString(argv[x]);
00289         }
00290         else
00291         {
00292                 wprintf(L"\nERROR: %s UNknown Argument\n\n",argv[x]);
00293                 _putws(pwszUsage);
00294                 return FALSE;
00295         }
00296     }
00297     // Check if User is poassed, then password is required:
00298     if (bsUSER || bsPASS)
00299         if (!bsUSER || !bsPASS) // if either one is missing complain
00300         {
00301             _putws(L"\nERROR: If /USER is specified /PASS is required!");
00302             return FALSE;
00303         }
00304
00305     return TRUE;
00306 }
00307
00308
00309 HRESULT ConvertUTCFromStringToUTCTime( LPWSTR pwszTime, SYSTEMTIME *pst)
00310 {
00311     FILETIME ft;
00312     TCHAR sz[3];
00313     LPWSTR pszSrc = pwszTime;
00314     SYSTEMTIME st;
00315
00316     // Year
00317     sz[0] = pszSrc[0];
00318     sz[1] = pszSrc[1];
00319     sz[2] = TEXT('\0');
00320     st.wYear = (WORD)_wtoi(sz);
00321     if (st.wYear < 50)
00322     {
00323         st.wYear += 2000;
00324     }
00325     else
00326     {
00327         st.wYear += 1900;
00328     }
00329     // Month
00330     sz[0] = pszSrc[2];
00331     sz[1] = pszSrc[3];
00332     st.wMonth = (WORD)_wtoi(sz);
00333
00334     // Day
00335     sz[0] = pszSrc[4];
00336     sz[1] = pszSrc[5];
00337     st.wDay = (WORD)_wtoi(sz);
00338
00339     // Hour
00340     sz[0] = pszSrc[6];
00341     sz[1] = pszSrc[7];
00342     st.wHour = (WORD)_wtoi(sz);
00343
00344     // Minute
00345     sz[0] = pszSrc[8];
00346     sz[1] = pszSrc[9];
00347     st.wMinute = (WORD)_wtoi(sz);
00348
00349     // Second
00350     sz[0] = pszSrc[10];
00351     sz[1] = pszSrc[11];
00352     st.wSecond = (WORD)_wtoi(sz);
00353     st.wMilliseconds = 0;
00354
00355     // This gets us the day of week
00356     SystemTimeToFileTime(&st, &ft);
00357     FileTimeToSystemTime(&ft, &st);
00358     *pst = st;
00359     return S_OK;
00360 }
00361
00362
00363 ////////////////////////////////////////////////////////////////////////////////////////////////////
00364 /*  GetNextLine()   - Retrives a line from the passed file pointer
00365
00366     Parameters
00367
00368         FILE* fp        - File Pointer
00369         LPWSTR pwszDest - Destination Buffer
00370         int iSize       - Size of Destination Buffer
00371 */
00372
00373 BOOL GetNextLine(FILE* fp,LPWSTR pwszDest,int iSize)
00374 {
00375   //BOOL bRet;
00376   WCHAR c =0 ;
00377   int x = 0;
00378   do
00379   {
00380     if (x < iSize )
00381         {
00382             // Get a character
00383             c = getwc(fp);
00384         // Handle the end
00385             if (x ==0 && ((char)c) == EOF )
00386           return FALSE;
00387
00388         // If it is NOT a carriage return - save the character
00389             // (note the cast to (char): as EOF is a char -1.
00390             // with a WIDE character this becomes 65535)
00391             // so we cast DOWN the char to test for the potential -1
00392             if (c!= '\r' && ((char)c) != EOF && c != '\n')
00393           pwszDest[x++] = c;
00394           else
00395                 break;
00396         }
00397   } while (c != '\r' && c != EOF && c != '\n' && c !=65535);
00398
00399   pwszDest[x] = NULL;
00400   return TRUE;
00401 }
00402
00403
00404 ////////////////////////////////////////////////////////////////////////////////////////////////////
00405 /*  Trim()   - VERY simple function for removing left and right whitespace from a unicode string
00406
00407     Parameters
00408
00409         LPWSTR pwszData                 -   Data passed for trimming- Function will modify
00410 */
00411 void Trim(LPWSTR pwszData)
00412 {
00413     int iscan=0;
00414     int iput=0;
00415
00416     int iLenData = wcslen(pwszData);
00417     LPWSTR pwszTemp = new WCHAR[iLenData+1];
00418     int iLenTemp;
00419
00420     // Trim left:
00421     while (pwszData[iscan] != NULL && (pwszData[iscan] == ' ' || pwszData[iscan] == '\t' ))
00422         iscan++;
00423
00424     // We have now scanned PAST whitespace- so copy the string:
00425     wcscpy(pwszTemp,&pwszData[iscan]);
00426
00427     // Now we need to do the TrimRight
00428     iLenTemp = wcslen(pwszTemp);
00429
00430     for (iscan = iLenTemp-1; iscan; iscan--)
00431     {
00432         if (!(pwszTemp[iscan] == ' ' || pwszTemp[iscan] == '\t' ) )
00433             break;
00434     }
00435     pwszTemp[iscan+1] =NULL;
00436     wcscpy(pwszData,pwszTemp);
00437 }
00438
00439 ////////////////////////////////////////////////////////////////////////////////////////////////////
00440 /*  RemoveSpecialChars()   - Removes Tabs from passed string
00441
00442     Parameters
00443
00444     LPWSTR pwszLine         - Target String
00445 */
00446 void RemoveSpecialChars(LPWSTR pwszLine)
00447 {
00448     int iLen = wcslen(pwszLine);
00449     for (int x = 0; x < iLen; x++)
00450     {
00451         switch (pwszLine[x])
00452         {
00453             case '\t':
00454                 pwszLine[x] = ' '; // convert tabs to spaces..
00455         }
00456     }
00457 }
00458
00459 ////////////////////////////////////////////////////////////////////////////////////////////////////
00460 /*  ReadDataFromLine()   - Reads the Attribute and the Value from a passed line of text
00461
00462     Parameters
00463
00464         LPWSTR pwszLine         - Line to read
00465         BSTR * pbsAttrib        - Attribute NAME to return
00466         BSTR * pbsValue         - Value of the attribute
00467 */
00468 HRESULT ReadDataFromLine(LPWSTR pwszLine,BSTR * pbsAttrib, BSTR * pbsValue)
00469 {
00470     int x;
00471     int iLen = wcslen(pwszLine);
00472
00473     *pbsAttrib = NULL;
00474     *pbsValue  = NULL;
00475
00476     // Remove any tabs still in the line:
00477     RemoveSpecialChars(pwszLine);
00478
00479     // If this line is a comment or blank, bail..
00480     if (pwszLine[0] == L'/' || iLen == 0)
00481         return S_FALSE;
00482
00483     // Make a temp string to save our string
00484     LPWSTR pwszTempAttrib = new WCHAR [iLen +1];
00485     pwszTempAttrib[0]= NULL;
00486
00487     for (x = 0; x< iLen; x++)
00488         switch(pwszLine[x])
00489         {
00490              case L' ':
00491              case L'\t':
00492              {
00493                 // NULL terminate the copy we are building
00494                 pwszTempAttrib[x] = L'\0';
00495                 x++;
00496                 goto DoneReadDataFromLine;
00497                 break;
00498              }
00499              case NULL:    // if we hit the end of the string- there is NOT a value there
00500              {
00501                 wprintf(L"\n!!!Attribute missing value [%s]\n",pwszLine);
00502                 return E_FAIL;
00503              }
00504              default:
00505              {
00506                 pwszTempAttrib[x] = pwszLine[x];
00507              }
00508         }
00509
00510 DoneReadDataFromLine:
00511     // Trim off any preceding spaces..
00512     Trim((LPWSTR)pwszLine +x);
00513
00514     // Grab the END of the passed line, and put it in the
00515     // Value BSTR
00516     *pbsValue = SysAllocString((LPWSTR)pwszLine +x);
00517
00518     // Alloc a new BSTR to return for this attribute
00519     *pbsAttrib= SysAllocString(pwszTempAttrib);
00520
00521     if (iLen)
00522         delete [] pwszTempAttrib ;
00523     return S_OK;
00524 }
00525
00526 ////////////////////////////////////////////////////////////////////////////////////////////////////
00527 /*  MakeOctetADSVALUE()   - Reads the passed octet string into the passed ADSVALUE,
00528                             Sample String:
00529                                     x00 x00 x00 x00 xe0 xff x03 xe0 xff x03 xe0 xff x03 xe0 xff x03 xe0 xff x03 x00 x00
00530                             The "x"'s are required and the values must be in HEX format
00531
00532     Parameters
00533
00534     ADSVALUE *  pAdsValue    - Returned ADSVALUE of Type OctetString
00535     LPWSTR      pwszOctet    - String representing OCTET
00536
00537 */
00538 HRESULT MakeOctetADSVALUE(ADSVALUE * pAdsValue,LPWSTR pwszOctet)
00539 {
00540     int iNumBytes = 0;
00541     int iStrLen = wcslen(pwszOctet);
00542
00543     // Count the number of BYTES in the String
00544     for (int x =0;x <iStrLen;x++)
00545         if (pwszOctet[x] == L'x' || pwszOctet[x] == L'X')
00546             iNumBytes ++;
00547
00548     if (iNumBytes)
00549     {
00550         int iCurrByte =0;
00551
00552         // Allocate the bytes
00553         pAdsValue->OctetString.lpValue = new BYTE [iNumBytes+1];
00554         pAdsValue->OctetString.dwLength = iNumBytes;
00555
00556         for (int x =0;x <iStrLen;x++)
00557             if (pwszOctet[x] == L'x' || pwszOctet[x] == L'X')
00558             {
00559                 x++;
00560                 int iVal;
00561                 // found an x so grab the data
00562                 swscanf(  &pwszOctet[x], L"%x",&iVal);
00563                 pAdsValue->OctetString.lpValue[iCurrByte++]= iVal;
00564
00565                 // scan past the rest of the string
00566                 for (x =x;x<iStrLen && pwszOctet[x] != (WCHAR)' ' ;x++)
00567                     ;
00568             }
00569     }
00570     else
00571         return E_FAIL;
00572
00573     return S_OK;
00574 }
00575
00576 ////////////////////////////////////////////////////////////////////////////////////////////////////
00577 /*  PopulateADSAttrInfo()   - Populates the passed ADS_ATTR_INFO from the passed attribute and Value
00578
00579     Parameters
00580
00581     ADS_ATTR_INFO * pattrInfo   - Pointer to Element to be added
00582     LPWSTR pwszAttrib           - Name of the Attribute
00583     LPWSTR pwszValue            - Value of the Attribute
00584
00585 */
00586 BOOL PopulateADSAttrInfo(ADS_ATTR_INFO * pattrInfo,LPWSTR pwszAttrib,LPWSTR pwszValue)
00587 {
00588     // Look up the attribute name and get the TYPE string for this attribute
00589     LPWSTR pwszType;
00590     LPWSTR  pwszSingleMulti;
00591     BOOL bAttribIsSingle = TRUE;
00592
00593     BOOL bret;
00594
00595     bret = MapUserAttribToType(pwszAttrib,&pwszType,&pwszSingleMulti);
00596     if (!bret)
00597     {
00598         wprintf(L"\n!!!Error: unable to map %s\n",pwszAttrib);
00599         return FALSE;
00600     }
00601
00602     if (_wcsicmp(pwszSingleMulti,L"MV")==0)
00603         bAttribIsSingle = FALSE;
00604     else
00605         bAttribIsSingle = TRUE;
00606
00607     // Look up the string and get the corrosponding ADSVALUE...
00608     ADSTYPE adType = MapTypeToADSTYPE(pwszType);
00609
00610     if (adType == ADSTYPE_UNKNOWN)
00611     {
00612         wprintf(L"\n!!!Error: unable to map %s ADS_TYPE unknown\n",pwszAttrib);
00613         return FALSE;
00614     }
00615     // FIll in the Attribute Name
00616     pattrInfo->pszAttrName = new WCHAR [wcslen(pwszAttrib)+1];
00617     wcscpy(pattrInfo->pszAttrName,pwszAttrib);
00618     pattrInfo->dwControlCode  = ADS_ATTR_UPDATE;
00619     pattrInfo->dwADsType = ADSTYPE_CASE_IGNORE_STRING;
00620
00621     pattrInfo->pADsValues = new ADSVALUE;
00622     pattrInfo->pADsValues->dwType = adType;
00623     pattrInfo->dwNumValues = 1;
00624
00625     // Fill in the VALUE:
00626     switch (adType )
00627     {
00628
00629         case ADSTYPE_DN_STRING:
00630         case ADSTYPE_CASE_EXACT_STRING:
00631         case ADSTYPE_CASE_IGNORE_STRING:
00632         case ADSTYPE_PRINTABLE_STRING:
00633         case ADSTYPE_NUMERIC_STRING:
00634         case ADSTYPE_TYPEDNAME:
00635         case ADSTYPE_FAXNUMBER:
00636         case ADSTYPE_PATH:
00637         case ADSTYPE_OBJECT_CLASS:
00638         {
00639             pattrInfo->pADsValues->CaseIgnoreString = new WCHAR [wcslen(pwszValue)+1];
00640             wcscpy(pattrInfo->pADsValues->CaseIgnoreString,pwszValue);
00641
00642             break;
00643         }
00644         case ADSTYPE_BOOLEAN:
00645             if (_wcsicmp(pwszValue,L"TRUE")==0)
00646                 pattrInfo->pADsValues->Boolean = 1;
00647             else if (_wcsicmp(pwszValue,L"FALSE")==0)
00648                 pattrInfo->pADsValues->Boolean = 0;
00649             else if (_wtoi(pwszValue)>0)
00650                 pattrInfo->pADsValues->Boolean = 1;
00651             else
00652                 pattrInfo->pADsValues->Boolean = 0;
00653             break;
00654         case ADSTYPE_INTEGER:
00655         {
00656             pattrInfo->pADsValues->Integer = _wtoi(pwszValue);
00657             break;
00658         }
00659         case ADSTYPE_OCTET_STRING:
00660         {
00661             // Read the string into an actualy binary blob
00662             HRESULT hr = MakeOctetADSVALUE(pattrInfo->pADsValues ,pwszValue);
00663             if (FAILED(hr))
00664                 return FALSE;
00665             break;
00666         }
00667         case ADSTYPE_UTC_TIME:
00668         {
00669             SYSTEMTIME pst;
00670
00671             HRESULT hr = ConvertUTCFromStringToUTCTime( pwszValue,&pst );
00672
00673             if (FAILED(hr))
00674                 return FALSE;
00675
00676             pattrInfo->pADsValues->UTCTime = pst;
00677
00678             break;
00679         }
00680         case ADSTYPE_LARGE_INTEGER:
00681         {
00682             pattrInfo->pADsValues->dwType = ADSTYPE_LARGE_INTEGER;
00683             swscanf (pwszValue, L"%I64d", &pattrInfo->pADsValues->LargeInteger);
00684             break;
00685         }
00686
00687         default:
00688         {
00689             wprintf(L"\n\n!!!ERROR Unrecognized Type for atrib: %s",pwszAttrib);
00690             return FALSE;
00691         }
00692     }
00693     return TRUE;
00694 }
00695
00696
00697 ////////////////////////////////////////////////////////////////////////////////////////////////////
00698 /*  PopulateAttrInfoFromFile()   - Populates the passed ADS_ATTR_INFO from the passed filename
00699
00700     Parameters
00701
00702     LPWSTR pwszFileName         - file from which info is read
00703     ADS_ATTR_INFO * pattrInfo   - Pointer to Elements to be added
00704     DWORD &rdwNumPopulated      - Returned number populated
00705 */
00706
00707 BOOL PopulateAttrInfoFromFile(LPWSTR pwszFileName,ADS_ATTR_INFO * pattrInfo,DWORD &rdwNumPopulated )
00708 {
00709     HRESULT hr = S_OK;
00710     BOOL    bRet = FALSE;
00711   FILE * fpInput = NULL;
00712     WCHAR  pwszLine[4096];
00713     rdwNumPopulated = 0;
00714
00715   if( (fpInput = _wfopen( pwszFileName, L"r" )) == NULL )
00716   {
00717     wprintf(L"\nError Opening Input File:%s",pwszFileName);
00718     return FALSE;
00719   }
00720
00721     while (GetNextLine(fpInput,pwszLine,4096) && SUCCEEDED(hr))
00722     {
00723         Trim(pwszLine);
00724
00725         BSTR bsAttrib;
00726         BSTR bsValue;
00727
00728         // Read the line into our BSTRS
00729         // if S_FALSE is returned, then we do not have a line
00730         // if E_FAIL is returned, then we have an error condition
00731         hr = ReadDataFromLine(pwszLine,&bsAttrib,&bsValue);
00732
00733         if (hr == S_OK)
00734         {
00735             wprintf(L" attrib:%s value:%s\n",bsAttrib,bsValue);
00736
00737             // Take the attribute and value and add them to the Array
00738             if (!PopulateADSAttrInfo(&pattrInfo[rdwNumPopulated],bsAttrib,bsValue))
00739             {
00740                 hr = E_FAIL;
00741                 break;
00742             }
00743
00744             SysFreeString(bsAttrib);
00745             SysFreeString(bsValue);
00746
00747             rdwNumPopulated++;
00748         }
00749     }
00750   fclose(fpInput);
00751   return (SUCCEEDED(hr));
00752 }
00753
00754
00755
00756
00757 ////////////////////////////////////////////////////////////////////////////////////////////////////
00758 /*  CreateUserFromFile()   - Function for creating a basic User
00759
00760     Parameters
00761
00762         IDirectoryObject *pDirObject    -   Parent Directory Object for the new User
00763         LPWSTR pwCommonName             -   Common Name for the new User
00764         IDirectoryObject ** ppDirObjRet -   Pointer to the Pointer which will receive the new User
00765         int iUserType                  -   Bitflags for new User:
00766                                                                     ADS_User_TYPE_GLOBAL_User,
00767                                                                     ADS_User_TYPE_DOMAIN_LOCAL_User,
00768                                                                     ADS_User_TYPE_UNIVERSAL_User,
00769                                                                     ADS_User_TYPE_SECURITY_ENABLED
00770 */
00771 HRESULT CreateUserFromFile(IDirectoryObject *pDirObject, LPWSTR pwCommonName,LPWSTR pwSamAcctName,IDirectoryObject ** ppDirObjRet,LPWSTR pwszFileName)
00772 {
00773     // To simply things, allocate a fixed array:
00774     ADS_ATTR_INFO   attrInfo [MAX_ATTRIBS+1];
00775
00776     HRESULT         hr = S_OK;
00777     DWORD           dwNumPopulated;
00778     LPDISPATCH      pDisp;
00779     *ppDirObjRet     = NULL;
00780     WCHAR           pwCommonNameFull[MAX_PATH*2];
00781     BOOL    bRet = FALSE;
00782     FILE * fpInput = NULL;
00783     WCHAR  pwszLine[4096];
00784     dwNumPopulated = 0;
00785
00786   if( (fpInput = _wfopen( pwszFileName, L"r" )) == NULL )
00787   {
00788     wprintf(L"\nError Opening Input File:%s",pwszFileName);
00789     return FALSE;
00790   }
00791
00792     while (GetNextLine(fpInput,pwszLine,4096) && SUCCEEDED(hr))
00793     {
00794         Trim(pwszLine);
00795
00796         BSTR bsAttrib;
00797         BSTR bsValue;
00798
00799         // Read the line into our BSTRS
00800         // if S_FALSE is returned, then we do not have a line
00801         // if E_FAIL is returned, then we have an error condition
00802         hr = ReadDataFromLine(pwszLine,&bsAttrib,&bsValue);
00803
00804         if (hr == S_OK)
00805         {
00806             wprintf(L" attrib:%s value:%s\n",bsAttrib,bsValue);
00807
00808             // Take the attribute and value and add them to the Array
00809             if (!PopulateADSAttrInfo(&attrInfo[dwNumPopulated],bsAttrib,bsValue))
00810             {
00811                 hr = E_FAIL;
00812                 break;
00813             }
00814
00815             SysFreeString(bsAttrib);
00816             SysFreeString(bsValue);
00817             dwNumPopulated++;
00818         }
00819     }
00820   fclose(fpInput);
00821
00822     wsprintfW(pwCommonNameFull,L"CN=%s",pwCommonName);
00823
00824     hr = pDirObject->CreateDSObject( pwCommonNameFull,  attrInfo,
00825     dwNumPopulated, &pDisp );
00826
00827     if (SUCCEEDED(hr))
00828     {
00829         hr = pDisp->QueryInterface(IID_IDirectoryObject,(void**) ppDirObjRet);
00830
00831         pDisp->Release();
00832         pDisp = NULL;
00833     }
00834
00835     //FreeAttrInfo(attrInfo);
00836
00837   return hr;
00838 }
00839
00840 ////////////////////////////////////////////////////////////////////////////////////////////////////
00841 /*  CreateUser()   - Function for creating a basic User
00842
00843     Parameters
00844
00845         IDirectoryObject *pDirObject    -   Parent Directory Object for the new User
00846         LPWSTR pwCommonName             -   Common Name for the new User
00847         IDirectoryObject ** ppDirObjRet -   Pointer to the Pointer which will receive the new User
00848         int iUserType                  -   Bitflags for new User:
00849                                                                     ADS_User_TYPE_GLOBAL_User,
00850                                                                     ADS_User_TYPE_DOMAIN_LOCAL_User,
00851                                                                     ADS_User_TYPE_UNIVERSAL_User,
00852                                                                     ADS_User_TYPE_SECURITY_ENABLED
00853 */
00854 HRESULT CreateUser(IDirectoryObject *pDirObject, LPWSTR pwCommonName,LPWSTR pwSamAcctName,IDirectoryObject ** ppDirObjRet)
00855 {
00856     assert(pDirObject);
00857     if (wcslen(pwSamAcctName) >20)
00858     {
00859         MessageBox(NULL,L"SamAccountName CANNOT be bigger than 20 characters",L"Error: CreateSimpleUser()",MB_ICONSTOP);
00860         assert(0);
00861         return E_FAIL;
00862     }
00863
00864   HRESULT    hr;
00865     ADSVALUE   sAMValue;
00866     ADSVALUE   classValue;
00867     LPDISPATCH pDisp;
00868     WCHAR       pwCommonNameFull[1024];
00869
00870     ADS_ATTR_INFO  attrInfo[] =
00871     {
00872        { L"objectClass", ADS_ATTR_UPDATE,
00873                            ADSTYPE_CASE_IGNORE_STRING, &classValue, 1 },
00874        {L"sAMAccountName", ADS_ATTR_UPDATE,
00875                            ADSTYPE_CASE_IGNORE_STRING, &sAMValue, 1},
00876     };
00877
00878     DWORD dwAttrs = sizeof(attrInfo)/sizeof(ADS_ATTR_INFO);
00879     classValue.dwType = ADSTYPE_CASE_IGNORE_STRING;
00880     classValue.CaseIgnoreString = L"User";
00881
00882     sAMValue.dwType=ADSTYPE_CASE_IGNORE_STRING;
00883     sAMValue.CaseIgnoreString = pwSamAcctName;
00884
00885     wsprintfW(pwCommonNameFull,L"CN=%s",pwCommonName);
00886
00887     hr = pDirObject->CreateDSObject( pwCommonNameFull,  attrInfo,
00888                                 dwAttrs, &pDisp );
00889     if (SUCCEEDED(hr))
00890     {
00891         hr = pDisp->QueryInterface(IID_IDirectoryObject,(void**) ppDirObjRet);
00892
00893         pDisp->Release();
00894         pDisp = NULL;
00895     }
00896     return hr;
00897 }
00898
00899
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/GridFont/Grid.Cxx Source File

  • Multimedia
  • Gdi
  • Fonts
  • GridFont

Grid.Cxx

Go to the documentation of this file.
00001 #include <windows.h>
00002 #include <windowsx.h>
00003 #include <string.h>
00004 #include <tchar.h>
00005 #include <stdio.h>
00006 #include "app.h"
00007
00008 #include "grid.hxx"
00009
00010 // These are global variables set by CFontRange::SetFontRange()
00011 // and used by CTextGrid::SetCharTable(). This is safe as only
00012 // one font is selected at a given time by the program.
00013
00014 int             vSegCount;
00015 USHORT *        vStartCount;
00016 USHORT *        vEndCount;
00017
00018 CSet   *    vpCSet;
00019
00020 //+--------------------------------------------------------
00021 // Class:       CFontSelect
00022 //
00023 // Purpose:     Select/Deselect a font
00024 //
00025 // History:     22-Jan-1993     asmusf  created
00026 //----------------------------------------------------------
00027
00028 // pure inline
00029
00030 //+--------------------------------------------------------
00031 // Class:       CGridIt
00032 //
00033 // Purpose:     Iterate over a grid
00034 //
00035 // History:     22-Jan-1993     asmusf  created
00036 //----------------------------------------------------------
00037
00038 // pure inline
00039
00040 //+--------------------------------------------------------
00041 // Class:       CLineGrid
00042 //
00043 // Purpose:     Create an n x m Grid of lines
00044 //
00045 // History:     22-Jan-1993     asmusf  created
00046 //----------------------------------------------------------
00047
00048 CLineGrid::CLineGrid(UINT cCol, UINT cRow, SIZE size )
00049 {
00050     _size = size;
00051     _cCol = cCol;
00052     _cRow = cRow;
00053     SetStyle();
00054     SetWeight();
00055 }
00056
00057 void CLineGrid::SetStyle(int iStyle)
00058 {
00059     _iStyle = iStyle;
00060 }
00061
00062 void CLineGrid::SetWeight(int nWeight)
00063 {
00064     _nWeight = nWeight*20;  // internal twips, API is points
00065 }
00066
00067 void CLineGrid::Paint(CCanvas& canvas, RECT rc, POINT pt)
00068 {
00069     int cx, cy;
00070     UINT i;
00071
00072     // set up pen
00073     CBlackPen pen(canvas, _iStyle, _nWeight);
00074
00075     // Draw the grid
00076     for(cx = pt.x, i=0; i<=_cCol; i++, cx+=_size.cx )
00077     {
00078         if( cx >= rc.left && cx <= rc.right )
00079         {
00080             canvas.Line(cx, pt.y,
00081                         cx, pt.y+_cRow*_size.cy);
00082         }
00083     }
00084     for(cy = pt.y, i=0; i<=_cRow; i++, cy+=_size.cy )
00085     {
00086         if( cy >= rc.top && cy <= rc.bottom )
00087         {
00088             canvas.Line(pt.x,                cy,
00089                         pt.x+_cCol*_size.cx, cy);
00090         }
00091     }
00092 }
00093
00094 //+--------------------------------------------------------
00095 // Class:       CTextGrid
00096 //
00097 // Purpose:     Create an n x m grid of textual elements
00098 //
00099 // History:     22-Jan-1993     asmusf  created
00100 //----------------------------------------------------------
00101
00102 void CTextGrid::SetFont(HFONT hfont)
00103 {
00104     _font = hfont;
00105 }
00106
00107 void CTextGrid :: Paint(CCanvas& canvas, RECT rc, POINT pt)
00108 {
00109     // Choose text alignment
00110     SetTextAlign(HDC(canvas), TA_BASELINE|TA_CENTER);
00111
00112     CFontSelect fs(canvas, _font);
00113
00114     for( CGridIt It( _cCol, _cRow, _size, pt ); !It.Done(); ++It)
00115     {
00116         if( It.Cx()+_size.cx > rc.left && It.Cx() < rc.right &&
00117                 It.Cy()+_size.cy > rc.top && It.Cy() < rc.bottom )
00118         {
00119             DrawElement(canvas, It.Cx()+_ptOrg.x, It.Cy()+_ptOrg.y,
00120                                 It.Col(), It.Row());
00121         }
00122     }
00123 }
00124
00125 UINT CTextGrid::Hittest(POINT pt, POINT ptTest)
00126 {
00127     for( CGridIt It( _cCol, _cRow, _size, pt ); !It.Done(); ++It)
00128     {
00129         if( It.Cx() <= ptTest.x && It.Cy() <= ptTest.y  &&
00130             It.Cx()+_size.cx > ptTest.x && It.Cy() +_size.cy > ptTest.y)
00131             {
00132                 return   _cRow* It.Col()+ It.Row() + _iEltOffset;
00133             }
00134     }
00135     return 0xFFFF;
00136 }
00137
00138 void CTextGrid::SetCharTable()
00139 {
00140      USHORT i;
00141    UINT imin = _iEltOffset;
00142    UINT imax = imin + _cCol*_cRow - 1;
00143
00144    // Make sure the block is used by the font
00145    if (_pCharUsed != NULL)
00146        LocalFree (LocalHandle(_pCharUsed));
00147    // Allocate buffer and make it not used (LPTR put zero in memory)
00148    if ((_pCharUsed = (USHORT *)LocalAlloc(LPTR, _cCol*_cRow*sizeof(USHORT))) == NULL)
00149        return;
00150    if (imin > vEndCount[vSegCount-1] || imax < vStartCount[0])
00151        return;
00152    for (i = 0; i < vSegCount; i++)
00153        {
00154        if (imax < vStartCount[i])  // no more useful cmap ranges
00155            break;
00156        if (imin <= vEndCount[i] && imax >= vStartCount[i]) // check for include
00157          {
00158            UINT icur = imin;
00159            while (icur++ < vStartCount[i]);  // scan until reaching vStartCount
00160        icur--;
00161        while (icur <= imax && icur <= vEndCount[i])
00162          _pCharUsed[icur++ - imin] = TRUE;
00163        }
00164       }
00165 }
00166
00167 //+--------------------------------------------------------
00168 // Class:       CCharGrid
00169 //
00170 // Purpose:     Create an n x m Grid of single characters
00171 //
00172 // History:     22-Jan-1993     asmusf  created
00173 //----------------------------------------------------------
00174
00175 CCharGrid :: CCharGrid(UINT cCol, UINT cRow, SIZE size, UINT iEltOffset)
00176 {
00177     _size  = size;
00178     _cCol  = cCol;
00179     _cRow  = cRow;
00180     _iEltOffset = iEltOffset;
00181     SetTextOrg();
00182 }
00183
00184 #define NBSP 0x00A0 // no break space
00185
00186 void CCharGrid::DrawElement(CCanvas& canvas, COORD x, COORD y, UINT i, UINT j)
00187 {
00188   WORD iChar = _cRow*i+j+_iEltOffset;
00189 #ifdef UNICODE
00190   static CCTypeSet Combining(0,0,C3_NONSPACING || C3_DIACRITIC || C3_VOWELMARK);
00191   static CCTypeSet Alpha(C1_ALPHA, 0, 0);
00192 #endif
00193
00194   if ( vpCSet && vpCSet->In(iChar) )
00195   {
00196       SetTextColor(canvas, RGB(128,0,128));
00197   }
00198     if (_pCharUsed == NULL || _pCharUsed[_cRow*i+j]) // if char exists draw it
00199   {
00200 #ifdef UNICODE
00201     if( Combining.In(iChar) && !Alpha.In(iChar) )
00202     {
00203       TCHAR pch[2] = { iChar,0 };
00204       CFontSelect fs(canvas, _font);
00205       //SIZE size;
00206         //GetTextExtentPoint(canvas, pch, 2, &size);
00207       //canvas.Text(x, y, pch, 2 );
00208       canvas.Char(x+_size.cx/4/*+size.cx/2*/,y, iChar);
00209
00210         // set up pen
00211         CBlackPen pen(canvas, PS_DOT, 0);
00212       CBrush brush(canvas);
00213
00214       // draw dotted circle
00215       int r = 7*_size.cx/16;
00216       canvas.Circle(x, y-r/2, r);
00217     }
00218     else
00219     {
00220           canvas.Char(x, y, iChar);
00221     }
00222 #else
00223     canvas.Char(x, y, (TCHAR)iChar);
00224 #endif
00225   }
00226     SetTextColor(canvas, RGB(0,0,0));
00227 }
00228
00229 //+--------------------------------------------------------
00230 // Class:       CCodeGrid
00231 //
00232 // Purpose:     Create an n x m Grid, numbered in sequence
00233 //
00234 // History:     22-Jan-1993     asmusf  created
00235 //----------------------------------------------------------
00236 CCodeGrid :: CCodeGrid(UINT cCol, UINT cRow, SIZE size, UINT iEltOffset)
00237 {
00238     _size  = size;
00239     _cCol  = cCol;
00240     _cRow  = cRow;
00241     _iEltOffset = iEltOffset;
00242     SetTextOrg();
00243     SetFormat();
00244 }
00245
00246 void CCodeGrid :: SetFormat(UINT fuFormat, UINT cDigits)
00247 {
00248     _cDigits = cDigits;
00249
00250     _szFormat[0]='%';
00251     if( fuFormat == DECIMAL )
00252     {
00253         _cDigits = 4;       // Constraint:
00254                             // This format for Decimal
00255         _szFormat[1]='3';   // really only works with _cDigits == 4
00256         _szFormat[2]='d';   //
00257         _szFormat[3]=' ';   // (blank padding for better positioning)
00258     }
00259     else //
00260     {
00261         _szFormat[1]='0';
00262         _szFormat[2]=_cDigits%10+'0';
00263         _szFormat[3]='X';
00264     }
00265     _szFormat[4]='\0';
00266 }
00267
00268 void CCodeGrid::DrawElement(CCanvas &canvas, COORD x, COORD y, UINT i, UINT j)
00269 {
00270      TCHAR sz[32];
00271    if (_pCharUsed == NULL || _pCharUsed[_cRow*i+j]) // if char exists draw it
00272          {
00273              _sntprintf( sz, sizeof(sz)/sizeof(TCHAR), _szFormat, (_cRow*i+j+_iEltOffset));
00274              sz[sizeof(sz)/sizeof(TCHAR) - 1] = TEXT('\0');
00275              canvas.Text(x, y, sz, _cDigits);
00276          }
00277 }
00278
00279
00280 //+--------------------------------------------------------
00281 // Class:       CCharBlock
00282 //
00283 // Purpose:     Create an n x m lined block of characters and codes
00284 //
00285 // History:     22-Jan-1993     asmusf  created
00286 //----------------------------------------------------------
00287
00288 CCharBlock::CCharBlock(UINT cCol, UINT cRow, UINT iBlockOffset, const CBlockFormat &bf) :
00289      _Line(cCol, cRow, bf._size),
00290      _Char(cCol, cRow, bf._size, iBlockOffset),
00291      _Code(cCol, cRow, bf._size, iBlockOffset)
00292 {
00293      // LINE GRID
00294      _Line.SetStyle(PS_SOLID);
00295
00296      // LARGE CHARACTER each cell
00297      _Char.SetFont(bf._fontChar);
00298
00299      // CODE POINT label each cell
00300      _Code.SetTextOrg(bf._size.cx/2, 9*bf._size.cy/10);
00301      _Code.SetFont(bf._fontCode);
00302      _Code.SetFormat(HEXADECIMAL,4);
00303 }
00304
00305 void CCharBlock::Paint(CCanvas& canvas, RECT rc, POINT pt)
00306 {
00307     _Line.Paint(canvas, rc, pt);
00308 #ifdef UNICODE
00309     _Char.SetCharTable();
00310     _Code.SetCharTable();
00311 #endif
00312     _Char.Paint(canvas, rc, pt);
00313     _Code.Paint(canvas, rc, pt);
00314 }
00315
00316 UINT CCharBlock::Hittest(POINT pt, POINT ptTest)
00317 {
00318     return _Code.Hittest(pt, ptTest);
00319 }
00320
00321 void CCharBlock :: SetFormat(UINT fuFormat)
00322 {
00323     _Code.SetFormat(fuFormat&DECIMAL,4);
00324 }
00325
00326 void CCharBlock::SetFont(HFONT font)
00327 {
00328     _Char.SetFont(font);
00329 }
00330
00331 //+--------------------------------------------------------
00332 // Class:       CBlockFrame
00333 //
00334 // Purpose:     Create an n x m frame around a block of characters
00335 //
00336 // History:     22-Jan-1993     asmusf  created
00337 //----------------------------------------------------------
00338
00339 CBlockFrame::CBlockFrame(UINT cCol, UINT cRow, POINT pt, UINT iBlockOffset,
00340                                 TCHAR * szHeader, const CFrameFormat &ff):
00341      CCharBlock(cCol, cRow, iBlockOffset, ff ),
00342      _size(ff._size),
00343      _Cols(cCol,    1, ff._size, iBlockOffset/16),
00344      _cRow(cRow),
00345      _cCol(cCol)
00346 {
00347
00348      // COLUMN label above first row
00349      _Cols.SetFormat(HEXADECIMAL,3);
00350      _Cols.SetFont(ff._fontLabel);
00351
00352
00353      // if not first block on page, suppress row labels
00354      if( iBlockOffset % 0x100 )
00355      {
00356         _pRows = NULL;
00357      }
00358      else
00359      {
00360         // ROW label to left of first column
00361         _pRows = new CCodeGrid(1, cRow,  ff._size);
00362         _pRows->SetFont(ff._fontLabel);
00363      }
00364
00365      // BLOCK HEADER
00366      _szHeader = new TCHAR[lstrlen(szHeader)+sizeof(TCHAR)];
00367      lstrcpyn(_szHeader, szHeader, sizeof(_szHeader)/sizeof(TCHAR));
00368      _fontHeader = ff._fontHeader;
00369
00370 }
00371
00372 CBlockFrame::~CBlockFrame()
00373 {
00374     delete _pRows;
00375     delete _szHeader;
00376 }
00377
00378
00379 void CBlockFrame::Paint(CCanvas& canvas, RECT rc, POINT pt)
00380 {
00381     Draw(canvas, pt);
00382     {
00383         POINT ptCols = {pt.x, pt.y-_size.cy};
00384         _Cols.Paint(canvas, rc, ptCols);
00385     }
00386     CCharBlock::Paint(canvas, rc, pt);
00387
00388     // these two are optional. Test first, then draw
00389     if(_pRows )
00390     {
00391         POINT ptRows = {pt.x-_size.cx, pt.y};
00392         _pRows->Paint(canvas, rc, ptRows);
00393     }
00394 }
00395
00396 void CBlockFrame::Draw(CCanvas& canvas, POINT pt)
00397 {
00398     UINT dy = 3*_size.cy/2;     // height of short uprights
00399     UINT cx = _cCol*_size.cx;
00400     UINT cy = _cRow*_size.cy;
00401   RECT rc;
00402
00403     // set up pen
00404     CBlackPen pen(canvas, PS_SOLID, 40);    // Solid Black 40/20 points
00405
00406     //Draw block divider lines
00407
00408     canvas.Line(pt.x,    pt.y-dy, pt.x,    pt.y+cy);  // left edge
00409     canvas.Line(pt.x+cx, pt.y-dy, pt.x+cx, pt.y+cy);  // right edge
00410     canvas.Line(pt.x,    pt.y,    pt.x+cx, pt.y);     // top edge
00411     canvas.Line(pt.x,    pt.y+cy, pt.x+cx, pt.y+cy);  // bottom
00412
00413     CFontSelect fs(canvas, _fontHeader);
00414
00415     SetTextAlign(canvas, TA_BASELINE|TA_LEFT);
00416     rc.left = pt.x + _size.cx/12;
00417     rc.top = pt.y - 6*_size.cy/5;
00418     rc.right = pt.x + cx - _size.cx/12;
00419     rc.bottom = pt.y;
00420     canvas.RCText(&rc,
00421                 _szHeader,
00422                 lstrlen(_szHeader));
00423 }
00424
00425 // The following Array contains the widhts of the Unicode blocks in
00426 // columns. Each Block has a corresponding entry in the stringtable
00427 // giving its block header. "Unassigned" blocks can span page boun-
00428 // daries.
00429
00430 static UINT aBlockWidth[]=
00431 {
00432     2,6,2,6,   // 0000
00433     8,8,       // 0100
00434     5,6,5,     // 0200
00435     7,6,3,     // 0300
00436     16,        // 0400
00437     3,6,7,     // 0500
00438     16,        // 0600
00439     32,        // 0700 - 08FF
00440     8,8,       // 0900
00441     8,8,       // 0A00
00442     8,8,       // 0B00
00443     8,8,       // 0C00
00444     8,8,       // 0D00
00445     8,8,       // 0E00
00446     16,        // 0F00
00447     10,6,      // 1000
00448   16,      // 1100
00449     192,       // 1200 - 1DFF
00450   16,      // 1E00
00451   16,      // 1F00
00452     7,3,3,3,   // 2000
00453     5,4,7,     // 2100
00454     16,        // 2200
00455     16,        // 2300
00456     4,2,10,    // 2400
00457     8,2,6,     // 2500
00458     16,        // 2600
00459     12,4,      // 2700
00460     128,       // 2800 - 2FFF
00461     4,6,6,     // 3000
00462     3,6,1,6,   // 3100
00463     16,        // 3200
00464     16,        // 3300
00465     144,       // 3400 - 3CFF
00466     3,13,      // 3D00
00467     96,        // 3E00 - 43FF
00468   16,      // 4400
00469   144,     // 4500 - 4DFF
00470     82*16,     // 4E00 - 9FFF
00471     64*16,     // A000 - DFFF
00472     25*16,     // E000 - F8FF
00473     32,        // F900 - FAFF
00474   5,11,    // FB00
00475     32,        // FC00 - FDFF
00476     2,5,9,     // FE00
00477     15,1,      // FF00
00478     200        // Sentinel
00479 };
00480
00481 //+--------------------------------------------------------
00482 // Class:       CBlockFormat
00483 //
00484 // Purpose:     Block formatting
00485 //
00486 // History:     22-Jan-1993     asmusf  created
00487 //----------------------------------------------------------
00488
00489 CBlockFormat::CBlockFormat() :
00490     _fontCode    (TEXT("Arial Narrow"), -6),
00491 #ifdef UNICODE
00492     _fontChar    (TEXT("Lucida Sans Unicode"), -16, TRUE)
00493 #else
00494     _fontChar    (TEXT("Lucida Sans"), -16, TRUE)
00495 #endif
00496 {
00497 };
00498
00499 //+--------------------------------------------------------
00500 // Class:       CFrameFormat
00501 //
00502 // Purpose:     Frame formatting
00503 //
00504 // History:     22-Jan-1993     asmusf  created
00505 //----------------------------------------------------------
00506
00507 CFrameFormat::CFrameFormat() :
00508     _fontHeader  (TEXT("Arial"), -12, TRUE),
00509     _fontLabel   (TEXT("Arial"), -10, TRUE)
00510 {
00511 }
00512
00513 //+--------------------------------------------------------
00514 // Class:       CPageFormat
00515 //
00516 // Purpose:     Page formatting
00517 //
00518 // History:     22-Jan-1993     asmusf  created
00519 //----------------------------------------------------------
00520 CPageFormat::CPageFormat(UINT fuFormat) :
00521     _fontPageNum (TEXT("Times New Roman"), -10, FALSE)
00522 {
00523     _size.cx =  4*INCH2/5;
00524     _size.cy =  INCH2;
00525
00526     SetFormat(fuFormat);
00527 }
00528
00529 void CPageFormat::SetFormat(UINT fuFormat)
00530 {
00531     _fuFormat = fuFormat;
00532
00533     if( fuFormat & PAGEPRINT )
00534     {
00535         _pt.x=     INCH2+(INCH2*7)/10;
00536         _pt.y=     INCH1+(INCH1*7)/10;
00537     }
00538     else
00539     {
00540         _pt.x=     INCH2;
00541         _pt.y=     INCH1;
00542     }
00543
00544     // locations of headers / footers
00545     _ptPE[0].x = _pt.x-_size.cx;
00546     _ptPE[0].y = _size.cy/2;
00547     _ptPE[1].x = _pt.x+_size.cx*16;
00548     _ptPE[1].y = _size.cy/2;
00549     _ptPE[2].x = _pt.x+(_size.cx*15)/2;
00550     _ptPE[2].y = _pt.y+(_size.cy*33)/2;
00551 }
00552
00553 //+--------------------------------------------------------
00554 // Class:       CPage
00555 //
00556 // Purpose:     One or more blocks
00557 //
00558 // History:     22-Jan-1993     asmusf  created
00559 //----------------------------------------------------------
00560 CPage::CPage(HINSTANCE hInst, CPageFormat &pf, UINT nPage) :
00561     _cBlock(0),
00562     _pf(pf),
00563     _hInst(hInst),
00564     _PageHeadL (1, 1, pf._size,nPage*256      ),
00565     _PageHeadR (1, 1, pf._size,(nPage+1)*256-1),
00566     _PageNums  (1, 1, pf._size,nPage+1        )
00567                                 // page numbers are 1 based on output
00568 {
00569     // Set up page elementss
00570
00571     _PageHeadL.SetFont(pf._fontLabel);
00572     _PageHeadR.SetFont(pf._fontLabel);
00573     _PageNums.SetFont(pf._fontPageNum);
00574
00575     InitPage( nPage);
00576     SetFormat(_pf._fuFormat);
00577 }
00578
00579 CPage::~CPage()
00580 {
00581     while( _cBlock )
00582     {
00583         delete _apBlock[--_cBlock];
00584     }
00585 }
00586
00587
00588
00589 void CPage::SetFormat(UINT fuFormat)
00590 {
00591     // set it
00592     _pf.SetFormat(fuFormat);
00593
00594     // apply it
00595     for( UINT i = 0; i < _cBlock ; ++i )
00596     {
00597         _apBlock[i]->SetFormat(fuFormat&MASKROOT);
00598     }
00599
00600     _PageHeadL.SetFormat(HEXADECIMAL, 4);
00601     _PageHeadR.SetFormat(HEXADECIMAL, 4);
00602     _PageNums.SetFormat(DECIMAL);
00603 }
00604
00605
00606 void CPage::Paint(CCanvas& canvas, RECT rc)
00607 {
00608     for( UINT i = 0; i < _cBlock; ++i )
00609     {
00610         _apBlock[i]->Paint(canvas, rc, _aptBlock[i]);
00611     }
00612
00613     if( _pf._fuFormat & PAGEELEMS )
00614     {
00615         _PageHeadL.Paint(canvas, rc, _pf._ptPE[0]);
00616         _PageHeadR.Paint(canvas, rc, _pf._ptPE[1]);
00617         _PageNums.Paint (canvas, rc, _pf._ptPE[2]);
00618     }
00619 }
00620
00621 UINT CPage::Hittest(POINT ptTest)
00622 {
00623     UINT uHit = 0xFFFF;
00624
00625     for( UINT i = 0; i < _cBlock && uHit ==0xFFFF ; ++i )
00626     {
00627         uHit = _apBlock[i]->Hittest(_aptBlock[i], ptTest);
00628     }
00629     return uHit;
00630 }
00631
00632 //-- protected member functions...
00633
00634 UINT CPage::InitPage(UINT nPage)
00635 {
00636     UINT iEnd = 0;
00637     TCHAR szBlockHeader[40];
00638     UINT i;
00639     POINT ptBlock=_pf._pt;
00640
00641     // Set up blocks
00642
00643     for( i=0; i < sizeof(aBlockWidth)/sizeof(UINT); i++ )
00644     {
00645         if( nPage*16 < (iEnd+=aBlockWidth[i]) )
00646         {
00647             break;
00648         }
00649     }
00650     UINT iStart = max(nPage*16, iEnd-aBlockWidth[i]);
00651
00652     do
00653     {
00654         LoadString(_hInst, i, szBlockHeader, 40);
00655         _apBlock[_cBlock]= new CBlockFrame(
00656                   min( aBlockWidth[i],      // grid width in columns
00657                        (nPage+1)*16-iStart),// (but at most to end of page)
00658                   16,                       // cRow always 16
00659                   ptBlock,                  // grid origin
00660                   iStart*16,                // first char offset
00661                   szBlockHeader,            // header string
00662                   _pf);                     // common formatting
00663
00664         _aptBlock[_cBlock] = ptBlock;
00665         _cBlock++;
00666
00667         ptBlock.x+=_pf._size.cx*aBlockWidth[i];
00668         iStart=iEnd;
00669     }
00670     while(
00671             (i++ < sizeof(aBlockWidth)/sizeof(UINT))
00672                 &&
00673             ((nPage+1)*16 >= (iEnd+=aBlockWidth[i]))
00674                 &&
00675             (_cBlock < 4)
00676          );
00677
00678
00679     return _cBlock;
00680 }
00681
00682
00683 void CPage::SetFont(HFONT hfont)
00684 {
00685     for( UINT i = 0; i < _cBlock ; ++i )
00686     {
00687         _apBlock[i]->SetFont(hfont);
00688     }
00689 }
00690
00691 //+--------------------------------------------------------
00692 // Class:       CModel
00693 //
00694 // Purpose:     Iterator over pages
00695 //
00696 // History:     22-Jan-1993     asmusf  created
00697 //----------------------------------------------------------
00698 CModel::CModel(HINSTANCE hInst, HWND hwnd, UINT fuFormat, UINT fPageMode) :
00699     _iPage(0),
00700 #ifdef UNICODE
00701     _macPage(0x100),
00702 #else
00703     _macPage(1),
00704 #endif
00705     _pf(fuFormat),
00706     _hInst(hInst),
00707     _fPageMode(fPageMode)
00708 {
00709     _pPage = new CPage(hInst, _pf, _iPage);
00710     _fr.SetFontRange(hwnd, _pf._fontChar);
00711 }
00712
00713 CModel::~CModel()
00714 {
00715     delete _pPage;
00716 }
00717
00718 void CModel::NextPage()
00719 {
00720
00721     if (_fPageMode == ALLPAGES)
00722         SetPage(_iPage+=(_iPage+1<_macPage? 1 : 0));
00723   else
00724       {
00725       int iNewPage = _iPage;
00726         while (!_fr.IsPageUsed(++iNewPage) && iNewPage < (int)_macPage);// scan until first found
00727     if (iNewPage < (int)_macPage)                // change only if under boundary
00728         SetPage(_iPage = (UINT)iNewPage);
00729     }
00730 }
00731
00732 void CModel::PrevPage()
00733 {
00734     if (_fPageMode == ALLPAGES)
00735         SetPage(_iPage-=(_iPage? 1 : 0));
00736   else
00737       {
00738       int iNewPage = _iPage;
00739         while (!_fr.IsPageUsed(--iNewPage) && iNewPage >= 0); // scan until first found
00740     if (iNewPage >= 0)                                // change only if above boundary
00741         SetPage(_iPage = (UINT)iNewPage);
00742     }
00743 }
00744
00745 void CModel::NextSection()
00746 {
00747   _iPage+=(_iPage+16<_macPage? 16 : 0);      // increment by 16 pages
00748     if (_fPageMode == ALLPAGES || _fr.IsPageUsed(_iPage)) // if in USEDONLY mode and
00749         SetPage(_iPage);               // the page is not used
00750   else
00751     NextPage();
00752 }                          // we skip to the next
00753
00754 void CModel::PrevSection()
00755 {
00756     _iPage-=(_iPage >= 16 ? 16 : 0);
00757     if (_fPageMode == ALLPAGES || _fr.IsPageUsed(_iPage)) // if in USEDONLY mode and
00758         SetPage(_iPage);               // the page is not used
00759   else
00760     PrevPage();                  // we skip to the previous
00761 }
00762
00763 void CModel::SetPage(UINT nPage)
00764 {
00765     delete _pPage;
00766     _pPage = new CPage(_hInst, _pf, nPage);
00767 }
00768
00769 void CModel::GetFormat(UINT &fuFormat)
00770 {
00771     fuFormat=_pf._fuFormat;
00772 }
00773
00774 void CModel::SetFormat(UINT fuFormat)
00775 {
00776     _pPage->SetFormat(fuFormat);
00777 }
00778
00779 HFONT CModel::GetFont()
00780 {
00781     return _pf._fontChar;
00782 }
00783
00784 BOOL CModel::CreateFont(LOGFONT &lf)
00785 {
00786     if(_pf._fontChar.Create(lf))
00787     {
00788          _pPage->SetFont(_pf._fontChar);
00789          return TRUE;
00790     }
00791     return FALSE;
00792 }
00793
00794 BOOL CModel::ChooseFont(HWND hwnd)
00795 {
00796     if(_pf._fontChar.Choose(hwnd))
00797     {
00798      _fr.SetFontRange(hwnd, _pf._fontChar);
00799          _pPage->SetFont(_pf._fontChar);
00800          return TRUE;
00801     }
00802     return FALSE;
00803 }
00804
00805 UINT CModel::Hittest( POINT pt)
00806 {
00807     return _pPage->Hittest( pt);
00808 }
00809
00810 void CModel::GetPageMode(UINT &fPageMode)
00811 {
00812     fPageMode = _fPageMode;
00813 }
00814
00815 void CModel::SetPageMode(UINT fPageMode)
00816 {
00817     _fPageMode = fPageMode;
00818   if (fPageMode == USEDONLY && !_fr.IsPageUsed(_iPage))//if the current page is empty
00819       {
00820     UINT iCurrentPage = _iPage;
00821     NextPage();                 //we skip to next
00822     if (iCurrentPage == _iPage)         //if there is no next page
00823         PrevPage();               //we go to prev (has to be one)
00824     }
00825 }
00826
00827 void CModel :: SetCSet(CSet * pCSet)
00828 {
00829   vpCSet = pCSet;
00830 }
00831
00832 //+----------------------------------------------------------------------
00833 // Class  CFontRange
00834 //
00835 // Purpose: Set character coverage of the target font
00836 //
00837 // History: 6-Dec-1993  michelsu created
00838 //-----------------------------------------------------------------------
00839 void CFontRange::SetFontRange(HWND hwnd, HFONT hfont)
00840 {
00841     CScreenCanvas scanvas(hwnd);     // provide the DC
00842     CFontSelect fs(scanvas, hfont);
00843
00844     USHORT   i;
00845
00846     for (i=0;i<256;i++)
00847         _fPageUsed[i]=FALSE;         // assume no page used
00848 #ifdef UNICODE
00849     if (CountUCSegments(scanvas))    // set page used flag for relevant pages
00850         for (i=0;i<vSegCount;i++) _fPageUsed[(vStartCount[i] & 0xFF00) >> 8] = TRUE;
00851     else                             // if the font is not TrueType, set only the 1st page
00852         _fPageUsed[0] =TRUE;
00853 #else
00854     _fPageUsed[0] =TRUE;
00855 #endif
00856 }
00857
00858 CFontRange::~CFontRange()
00859 {
00860     if (vStartCount != NULL)
00861         LocalFree (LocalHandle (vStartCount));
00862     if (vEndCount != NULL)
00863         LocalFree (LocalHandle (vEndCount));
00864 }
00865 //+----------------------------------------------------------------------
00866 // Class  CFontRange
00867 //
00868 // Purpose: Get character coverage of the target font (_pf._fontChar)
00869 //
00870 // History: 6-Dec-1993  michelsu created (borrowed in large from TTFONTS)
00871 //-----------------------------------------------------------------------
00872 BOOL CFontRange::CountUCSegments(HDC hdc)
00873 {
00874 #define CMAPHEX 0x70616d63 // = "cmap" (reversed)
00875 #define NBYTES   256
00876 #define OFFSETERROR 0
00877 #define MBERROR TEXT("Application Error.")
00878 #define MBERRORFLAGS MB_OK | MB_ICONHAND
00879
00880 typedef struct tagTABLE{
00881     USHORT platformID;
00882     USHORT encodingID;
00883     ULONG  offset;
00884 } TABLE, *PTABLE;
00885
00886 typedef struct tagSUBTABLE{
00887     USHORT format;
00888     USHORT length;
00889     USHORT version;
00890     USHORT segCountX2;
00891     USHORT searchRange;
00892     USHORT entrySelector;
00893     USHORT rangeShift;
00894 } SUBTABLE, *PSUBTABLE;
00895
00896     DWORD       cbData;
00897     USHORT      aShort[2];
00898     DWORD       nBytes;
00899     USHORT      i, nTables;
00900     PTABLE      pTable;
00901     PSUBTABLE   pSubTable;
00902     ULONG       offset,offsetFormat4;
00903     BYTE        buffer[NBYTES];
00904
00905     // find number of encoding tables, second long in cmap
00906     nBytes = GetFontData(hdc, CMAPHEX, 0, aShort, 4);
00907     if (nBytes == GDI_ERROR || nBytes == 0) //GDI error or no cmap table
00908         return FALSE;
00909     nTables = aShort[1];
00910     SwapShort (&nTables);
00911
00912     // limit ourself to 32 encoding tables (largely enough)
00913     cbData = nTables * sizeof(TABLE);
00914     if (cbData >NBYTES)
00915       {
00916       MessageBox (NULL, TEXT("cbData >NBYTES"),MBERROR , MBERRORFLAGS);
00917       return FALSE;
00918       }
00919
00920     // get array of encoding tables.
00921     // Check each one for PlatformId = 3, Encoding ID = 1.
00922     nBytes=GetFontData (hdc, CMAPHEX, 4, buffer, cbData);
00923     pTable = (PTABLE)buffer;
00924     offsetFormat4 = OFFSETERROR;
00925     for (i = 0; i< nTables; i++)
00926       {
00927         SwapShort (&(pTable->encodingID));
00928         SwapShort (&(pTable->platformID));
00929         if ((pTable->platformID == 3)&&(pTable->encodingID == 1))
00930             {
00931             offsetFormat4 = pTable->offset;
00932             SwapULong (&offsetFormat4);
00933             break;
00934             }
00935         pTable++;
00936         }
00937     if (offsetFormat4 == OFFSETERROR) //Can not find 3,1 subtable
00938         return FALSE;
00939
00940     /* Get the beginning of the subtable, especially the segment count */
00941     nBytes=GetFontData (hdc, CMAPHEX, offsetFormat4, buffer, sizeof(SUBTABLE));
00942     pSubTable = (PSUBTABLE) buffer;
00943     SwapShort (&(pSubTable->format));
00944     SwapShort (&(pSubTable->segCountX2));
00945     if (pSubTable->format != 4)
00946         {
00947         MessageBox (NULL, TEXT("format !=4"), MBERROR, MBERRORFLAGS);
00948         return FALSE;
00949         }
00950     vSegCount = pSubTable->segCountX2 / 2;
00951
00952     /* Now that we know how many segments that the font contains,
00953      *  free up the old memory, and realloc. the two global arrays.
00954      */
00955     if (vStartCount != NULL)
00956         LocalFree (LocalHandle (vStartCount));
00957     if (vEndCount != NULL)
00958         LocalFree (LocalHandle (vEndCount));
00959     vStartCount = (USHORT *)LocalAlloc (LPTR, vSegCount * sizeof(USHORT));
00960     vEndCount = (USHORT *)LocalAlloc (LPTR, vSegCount * sizeof(USHORT));
00961     if ((vStartCount == NULL) || (vEndCount == NULL))
00962         {
00963         MessageBox (NULL, TEXT("LocalAlloc failed"), MBERROR, MBERRORFLAGS);
00964         return FALSE;
00965         }
00966
00967     /* read in the array of endCount values */
00968     offset = offsetFormat4
00969            + (7 * sizeof (USHORT));  /* skip constant # bytes in subtable */
00970     cbData = vSegCount * sizeof (USHORT);
00971     nBytes=GetFontData (hdc, CMAPHEX, offset, vEndCount, cbData );
00972     for (i = 0; i<vSegCount; i++)
00973         SwapShort (& (vEndCount[i]));
00974
00975     /* read in the array of startCount values */
00976     offset = offsetFormat4
00977            + (7 * sizeof (USHORT))   /* skip constant # bytes in subtable */
00978            + (vSegCount * sizeof (USHORT)) /* skip endCount array */
00979            + sizeof (USHORT);             /* skip reservedPad */
00980     cbData = vSegCount * sizeof (USHORT);
00981     nBytes=GetFontData (hdc, CMAPHEX, offset, vStartCount, cbData );
00982     for (i = 0; i<vSegCount; i++)
00983         SwapShort (& (vStartCount[i]));
00984
00985     return TRUE;
00986 }
00987
00988
00989 void CFontRange::SwapShort (PUSHORT p)
00990 {
00991 SHORT temp;
00992
00993     temp =(SHORT)( HIBYTE (*p) + (LOBYTE(*p) << 8));
00994     *p = temp;
00995 }
00996
00997
00998
00999 void CFontRange::SwapULong (PULONG p)
01000 {
01001 ULONG temp;
01002
01003     temp = (LONG) ((BYTE) *p);
01004     temp <<= 8;
01005     *p >>=8;
01006
01007     temp += (LONG) ((BYTE) *p);
01008     temp <<= 8;
01009     *p >>=8;
01010
01011     temp += (LONG) ((BYTE) *p);
01012     temp <<= 8;
01013     *p >>=8;
01014
01015     temp += (LONG) ((BYTE) *p);
01016     *p = temp;
01017 }
01018
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/EventNotification/ContextSamplePropPage/ContextSamplePropPageImpl.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • EventNotification
  • ContextSamplePropPage

ContextSamplePropPageImpl.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName: ContextSamplePropPageImpl.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #include "stdafx.h"
00013 #include "ContextSamplePropPageImpl.h"
00014 #include "ContextSamplePropPage.h"
00015 #include <atlbase.h>
00016
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CContextSamplePropPage
00020
00021 CContextSamplePropPage::CContextSamplePropPage( void )
00022 {
00023     m_dwTitleID = IDS_TITLEContextSamplePropPage;
00024     m_dwHelpFileID = IDS_HELPFILEContextSamplePropPage;
00025     m_dwDocStringID = IDS_DOCSTRINGContextSamplePropPage;
00026
00027     m_wmsOrigContextTypes = WMS_CONTEXT_PLUGIN_NO_CONTEXT;
00028     m_wmsContextTypes = WMS_CONTEXT_PLUGIN_NO_CONTEXT;
00029     m_fInitializing = TRUE;
00030 }
00031
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 STDMETHODIMP
00035 CContextSamplePropPage::Apply( void )
00036 {
00037     HRESULT hr = S_OK;
00038     long lMaxSize = 0;
00039
00040     if ( ! m_bDirty )
00041     {
00042         return( S_OK );
00043     }
00044
00045     hr = RetrieveDialogInformation();
00046
00047     if( SUCCEEDED( hr ) )
00048     {
00049         //
00050         // Set all the properties that have changed.
00051         //
00052         if( !m_pPluginAdmin )
00053         {
00054             MessageBox( IDS_SERVER_CONNECT_ERROR );
00055             return( E_FAIL );
00056         }
00057         else
00058         {
00059             // Check the old values and only set if they have changed
00060             if( ( NULL != m_bstrOrigOutputPath.m_str )
00061                 && ( NULL != m_bstrOutputPath.m_str )
00062                 && _wcsicmp( m_bstrOrigOutputPath, m_bstrOutputPath ) )
00063             {
00064                 m_pPluginAdmin->put_OutputPath( m_bstrOutputPath );
00065             }
00066
00067             if( m_wmsOrigContextTypes != m_wmsContextTypes )
00068             {
00069                 m_pPluginAdmin->put_ContextTypes( m_wmsContextTypes );
00070             }
00071         }
00072     }
00073
00074     if( SUCCEEDED( hr ) )
00075     {
00076         SetDirty( FALSE );
00077     }
00078
00079     return( hr );
00080 } //end of Apply.
00081
00082
00083 /////////////////////////////////////////////////////////////////////////////
00084 void
00085 CContextSamplePropPage::MessageBox( UINT id )
00086 {
00087     CComBSTR bstrMessage;
00088     CComBSTR bstrTitle( "Windows Media Services" );
00089
00090     if( bstrMessage.LoadString( id ) )
00091     {
00092         ::MessageBox( m_hWnd, bstrMessage, bstrTitle, MB_OK );
00093     }
00094 }
00095
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 HRESULT
00099 CContextSamplePropPage::Connect()
00100 {
00101     // Interface pointers are given in the following order:
00102     // m_ppUnk[0] = Plugin Admin Interface
00103     // m_ppUnk[1] = Server Interface (IWMSServer)
00104     // m_ppUnk[2] = Pubpoint Interface (IWMSPublishingPoint)
00105
00106     // IF m_nObjects == 3 then m_pUnk[2] will have the pubpoint interface
00107
00108     if( 0 == m_nObjects )
00109     {
00110         return( E_UNEXPECTED );
00111     }
00112
00113     m_pPluginAdmin = m_ppUnk[0];
00114
00115     if( ! m_pPluginAdmin )
00116     {
00117         return( E_FAIL );
00118     }
00119
00120     return( S_OK );
00121 }
00122
00123
00124 /////////////////////////////////////////////////////////////////////////////
00125 LRESULT
00126 CContextSamplePropPage::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
00127 {
00128     ATLTRACE( "== CContextSamplePropPage::OnInitDialog\n" );
00129
00130     EnableThemeDialogTexture( m_hWnd, ETDT_ENABLETAB );
00131
00132     HRESULT hr = S_OK;
00133     m_fInitializing = TRUE;
00134
00135     hr = Connect();
00136     if ( FAILED( hr ) )
00137     {
00138         MessageBox( IDS_SERVER_CONNECT_ERROR );
00139         Deactivate();
00140         return( m_fInitializing = FALSE );
00141     }
00142
00143     hr = GetPluginSetting();
00144     if( SUCCEEDED( hr ) )
00145     {
00146         hr = PopulateControls();
00147     }
00148
00149     return( m_fInitializing = FALSE );
00150 } //end of OnInitDialog.
00151
00152
00153 /////////////////////////////////////////////////////////////////////////////
00154 HRESULT CContextSamplePropPage::RetrieveDialogInformation()
00155 {
00156     WCHAR wstrOutputPath[MAX_PATH];
00157     HRESULT hr = S_OK;
00158
00159     //
00160     // Grab the new information for the Output Path property.
00161     //
00162     if( GetDlgItemText( IDC_EDIT_OUTPUT_PATH, wstrOutputPath, MAX_PATH) )
00163     {
00164         m_bstrOutputPath = wstrOutputPath;
00165         if( NULL == m_bstrOutputPath.m_str )
00166         {
00167             hr = E_FAIL;
00168         }
00169     }
00170     else
00171     {
00172         // Failed to get text from control
00173         hr = E_FAIL;
00174     }
00175
00176     // reset to zero and then set bits accordingly
00177     m_wmsContextTypes = WMS_CONTEXT_PLUGIN_NO_CONTEXT;
00178
00179     if( BST_CHECKED == ::SendMessage( GetDlgItem( IDC_CHECK_USER_CONTEXT ), BM_GETCHECK, 0, 0 ) )
00180     {
00181         m_wmsContextTypes = (WMS_CONTEXT_PLUGIN_CONTEXT_TYPE) ( m_wmsContextTypes | WMS_CONTEXT_PLUGIN_USER_CONTEXT );
00182     }
00183     if( BST_CHECKED == ::SendMessage( GetDlgItem( IDC_CHECK_PRESENTATION_CONTEXT ), BM_GETCHECK, 0, 0 ) )
00184     {
00185         m_wmsContextTypes = (WMS_CONTEXT_PLUGIN_CONTEXT_TYPE) ( m_wmsContextTypes | WMS_CONTEXT_PLUGIN_PRESENTATION_CONTEXT );
00186     }
00187     if( BST_CHECKED == ::SendMessage( GetDlgItem( IDC_CHECK_COMMAND_REQUEST_CONTEXT ), BM_GETCHECK, 0, 0 ) )
00188     {
00189         m_wmsContextTypes = (WMS_CONTEXT_PLUGIN_CONTEXT_TYPE) ( m_wmsContextTypes | WMS_CONTEXT_PLUGIN_COMMAND_REQUEST_CONTEXT );
00190     }
00191     if( BST_CHECKED == ::SendMessage( GetDlgItem( IDC_CHECK_COMMAND_RESPONSE_CONTEXT ), BM_GETCHECK, 0, 0 ) )
00192     {
00193         m_wmsContextTypes = (WMS_CONTEXT_PLUGIN_CONTEXT_TYPE) ( m_wmsContextTypes | WMS_CONTEXT_PLUGIN_COMMAND_RESPONSE_CONTEXT );
00194     }
00195
00196     return( hr );
00197 }
00198
00199
00200 /////////////////////////////////////////////////////////////////////////////
00201 HRESULT
00202 CContextSamplePropPage::GetPluginSetting()
00203 {
00204     HRESULT hr = S_OK;
00205
00206     ATLTRACE( "CContextSamplePropPage::GetPluginSetting\n" );
00207
00208     //
00209     // Get plugin's properties.
00210     //
00211     if( !m_pPluginAdmin )
00212     {
00213         MessageBox( IDS_PLUGIN_PROPS_ERROR );
00214         m_fInitializing = FALSE;
00215         return( E_FAIL );
00216     }
00217     hr = m_pPluginAdmin->get_OutputPath( &m_bstrOrigOutputPath );
00218     if( FAILED( hr ) )
00219     {
00220         MessageBox( IDS_PLUGIN_PROPS_ERROR );
00221         Deactivate();
00222         m_fInitializing = FALSE;
00223         return( hr );
00224     }
00225     m_bstrOutputPath = m_bstrOrigOutputPath;
00226
00227     hr = m_pPluginAdmin->get_ContextTypes( &m_wmsOrigContextTypes );
00228     if( FAILED( hr ) )
00229     {
00230         MessageBox( IDS_PLUGIN_PROPS_ERROR );
00231         Deactivate();
00232         m_fInitializing = FALSE;
00233         return( hr );
00234     }
00235     m_wmsContextTypes = m_wmsOrigContextTypes;
00236
00237     return( hr );
00238 } //end of GetPluginSetting.
00239
00240
00241 /////////////////////////////////////////////////////////////////////////////
00242 HRESULT
00243 CContextSamplePropPage::PopulateControls()
00244 {
00245     HRESULT hr = S_OK;
00246     bool fEnableMaxSize = false;
00247
00248     ATLTRACE( "CContextSamplePropPage::PopulateControls\n" );
00249
00250     //
00251     // Display the plugin's properties.
00252     //
00253     ::EnableWindow( GetDlgItem( IDC_EDIT_OUTPUT_PATH ), TRUE );
00254     SetDlgItemText( IDC_EDIT_OUTPUT_PATH, ( wchar_t * ) m_bstrOutputPath );
00255     ::SendMessage( GetDlgItem( IDC_EDIT_OUTPUT_PATH ), EM_SETLIMITTEXT, MAX_PATH - 1, 0 );
00256
00257     if( WMS_CONTEXT_PLUGIN_USER_CONTEXT & m_wmsContextTypes )
00258     {
00259         ::SendMessage( GetDlgItem( IDC_CHECK_USER_CONTEXT ), BM_SETCHECK, BST_CHECKED, 0 );
00260     }
00261     else
00262     {
00263         ::SendMessage( GetDlgItem( IDC_CHECK_USER_CONTEXT ), BM_SETCHECK, BST_UNCHECKED, 0 );
00264     }
00265
00266     if( WMS_CONTEXT_PLUGIN_PRESENTATION_CONTEXT & m_wmsContextTypes )
00267     {
00268         ::SendMessage( GetDlgItem( IDC_CHECK_PRESENTATION_CONTEXT ), BM_SETCHECK, BST_CHECKED, 0 );
00269     }
00270     else
00271     {
00272         ::SendMessage( GetDlgItem( IDC_CHECK_PRESENTATION_CONTEXT ), BM_SETCHECK, BST_UNCHECKED, 0 );
00273     }
00274
00275     if( WMS_CONTEXT_PLUGIN_COMMAND_REQUEST_CONTEXT & m_wmsContextTypes )
00276     {
00277         ::SendMessage( GetDlgItem( IDC_CHECK_COMMAND_REQUEST_CONTEXT ), BM_SETCHECK, BST_CHECKED, 0 );
00278     }
00279     else
00280     {
00281         ::SendMessage( GetDlgItem( IDC_CHECK_COMMAND_REQUEST_CONTEXT ), BM_SETCHECK, BST_UNCHECKED, 0 );
00282     }
00283
00284     if( WMS_CONTEXT_PLUGIN_COMMAND_RESPONSE_CONTEXT & m_wmsContextTypes )
00285     {
00286         ::SendMessage( GetDlgItem( IDC_CHECK_COMMAND_RESPONSE_CONTEXT ), BM_SETCHECK, BST_CHECKED, 0 );
00287     }
00288     else
00289     {
00290         ::SendMessage( GetDlgItem( IDC_CHECK_COMMAND_RESPONSE_CONTEXT ), BM_SETCHECK, BST_UNCHECKED, 0 );
00291     }
00292
00293     return( hr );
00294 } //end of PopulateControls.
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userwizard/userwizard.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userwizard

userwizard.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       userwizard.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // dscreate.cpp : Implementation of DLL Exports.
00012
00013 #include "stdafx.h"
00014
00015 // initguid.h requires this.
00016 //
00017 #include <objbase.h>
00018
00019 // this redefines the DEFINE_GUID() macro to do allocation.
00020 //
00021 #include <initguid.h>
00022
00023 //#include <dsshell.h>
00024
00025 #include <dsadmin.h>
00026
00027 #include "resource.h"
00028 #include "userwizard.h"
00029 #include "WizExt.h"
00030
00031 // {C03793D3-A7C8-11d1-B940-00A0C9A06D2D}
00032 static const GUID CLSID_WizExtUser =
00033 { 0xc03793d3, 0xa7c8, 0x11d1, { 0xb9, 0x40, 0x0, 0xa0, 0xc9, 0xa0, 0x6d, 0x2d } };
00034
00035 CMyWizExtModule _Module;
00036
00037 BEGIN_OBJECT_MAP(ObjectMap)
00038   OBJECT_ENTRY(CLSID_WizExtUser,      CWizExtUser)
00039 END_OBJECT_MAP()
00040
00041 class CMyWizExtApp : public CWinApp
00042 {
00043 public:
00044   virtual BOOL InitInstance();
00045   virtual int ExitInstance();
00046 };
00047
00048 CMyWizExtApp theApp;
00049
00050 BOOL CMyWizExtApp::InitInstance()
00051 {
00052   _Module.Init(ObjectMap, m_hInstance);
00053   return CWinApp::InitInstance();
00054 }
00055
00056 int CMyWizExtApp::ExitInstance()
00057 {
00058   _Module.Term();
00059   return CWinApp::ExitInstance();
00060 }
00061
00062 /////////////////////////////////////////////////////////////////////////////
00063 // Used to determine whether the DLL can be unloaded by OLE
00064
00065 STDAPI DllCanUnloadNow(void)
00066 {
00067   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00068   return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
00069 }
00070
00071 /////////////////////////////////////////////////////////////////////////////
00072 // Returns a class factory to create an object of the requested type
00073
00074 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00075 {
00076   return _Module.GetClassObject(rclsid, riid, ppv);
00077 }
00078
00079 /////////////////////////////////////////////////////////////////////////////
00080 // DllRegisterServer - Adds entries to the system registry
00081
00082 BOOL x = TRUE;
00083 STDAPI DllRegisterServer(void)
00084 {
00085     return _Module.RegisterServer(FALSE);
00086 }
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // DllUnregisterServer - Removes entries from the system registry
00090
00091 STDAPI DllUnregisterServer(void)
00092 {
00093   _Module.UnregisterServer();
00094   return S_OK;
00095 }
00096
00097
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RecvBuf Member List

This is the complete list of members for RecvBuf, including all inherited members.
BufAlloc(DWORD dwSize) | RecvBuf |
BufBeg(void) | RecvBuf | [inline]
BufReset(void) | RecvBuf | [inline]
BufScanInt(DWORD *pdwRet, BYTE cDelimit) | RecvBuf |
BufScanStr(PSTR pszSearch, DWORD cbSearch) | RecvBuf |
BufShift(void) | RecvBuf | [inline]
BufSize(void) | RecvBuf | [inline]
BufSpace(void) | RecvBuf | [inline]
m_cbBufSize | RecvBuf | [private]
m_pbBufBeg | RecvBuf | [private]
m_pbBufEnd | RecvBuf | [private]
m_pbDataBeg | RecvBuf |
m_pbDataEnd | RecvBuf |
RecvBuf() | RecvBuf | [inline]
~RecvBuf() | RecvBuf | [inline]
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Connection15 Member List

This is the complete list of members for msado15::Connection15, including all inherited members.
BeginTrans() | msado15::Connection15 |
Close() | msado15::Connection15 |
CommitTrans() | msado15::Connection15 |
Execute(String CommandText, Variant RecordsAffected, int Options) | msado15::Connection15 |
getAttributes() | msado15::Connection15 |
getCommandTimeout() | msado15::Connection15 |
getConnectionString() | msado15::Connection15 |
getConnectionTimeout() | msado15::Connection15 |
getCursorLocation() | msado15::Connection15 |
getDefaultDatabase() | msado15::Connection15 |
getErrors() | msado15::Connection15 |
getIsolationLevel() | msado15::Connection15 |
getMode() | msado15::Connection15 |
getProperties() | msado15::Connection15 |
getProvider() | msado15::Connection15 |
getState() | msado15::Connection15 |
getVersion() | msado15::Connection15 |
iid | msado15::Connection15 | [static]
Open(String ConnectionString, String UserID, String Password, int Options) | msado15::Connection15 |
OpenSchema(int Schema, Variant Restrictions, Variant SchemaID) | msado15::Connection15 |
RollbackTrans() | msado15::Connection15 |
setAttributes(int plAttr) | msado15::Connection15 |
setCommandTimeout(int plTimeout) | msado15::Connection15 |
setConnectionString(String pbstr) | msado15::Connection15 |
setConnectionTimeout(int plTimeout) | msado15::Connection15 |
setCursorLocation(int plCursorLoc) | msado15::Connection15 |
setDefaultDatabase(String pbstr) | msado15::Connection15 |
setIsolationLevel(int Level) | msado15::Connection15 |
setMode(int plMode) | msado15::Connection15 |
setProvider(String pbstr) | msado15::Connection15 |
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/Provider.h Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

Provider.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  Provider.h
00006 //
00007 // Description:
00008 //      Definition of command-line event consumer provider class
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include <wbemcli.h>
00015 #include <wbemprov.h>
00016
00017 class CProvider : public IWbemEventConsumerProvider
00018 {
00019 public:
00020   CProvider(CListBox  *pOutputList);
00021   ~CProvider();
00022
00023     // IUnknown members
00024     STDMETHODIMP         QueryInterface(REFIID, LPVOID *);
00025     STDMETHODIMP_(ULONG) AddRef(void);
00026     STDMETHODIMP_(ULONG) Release(void);
00027
00028   // This routine allows you to map the 1 physical consumer
00029   // to potentially multiple logical consumers.
00030     STDMETHOD(FindConsumer)(
00031         IWbemClassObject* pLogicalConsumer,
00032         IWbemUnboundObjectSink** ppConsumer);
00033
00034 private:
00035
00036   DWORD m_cRef;
00037   CListBox  *m_pOutputList;
00038 };
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows.Net/resource.h Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows.Net

resource.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1997 - 1999
00006 //
00007 //  File:       resource.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 //{{NO_DEPENDENCIES}}
00012 // Microsoft Developer Studio generated include file.
00013 // Used by certexit.rc
00014 //
00015 #define IDS_CERTEXIT_DESC 1
00016 #define IDS_CERTMANAGEEXITMODULE_DESC 2
00017
00018
00019 // Next default values for new objects
00020 //
00021 #ifdef APSTUDIO_INVOKED
00022 #ifndef APSTUDIO_READONLY_SYMBOLS
00023 #define _APS_NEXT_RESOURCE_VALUE        201
00024 #define _APS_NEXT_COMMAND_VALUE         32768
00025 #define _APS_NEXT_CONTROL_VALUE         201
00026 #define _APS_NEXT_SYMED_VALUE           101
00027 #endif
00028 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/resource.h Source File

  • SysMgmt
  • MMC
  • WMI

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Resource.rc
00004 //
00005 #define IDS_HELPFILE                    1
00006 #define IDS_SNAPINDESC                  2
00007 #define IDI_PSI_LANDBASED               2
00008 #define IDS_NAME                        3
00009 #define IDS_SNAPINNAME                  6
00010 #define IDS_ABOUTNAME                   9
00011 #define IDS_PST_ROCKET                  10
00012 #define IDS_PST_LANDBASED               11
00013 #define IDS_BIKE_TITLE                  12
00014 #define IDD_PROPPAGE_LARGE              107
00015 #define IDI_ICON1                       108
00016 #define IDD_PROPPAGE_PEOPLE             108
00017 #define IDB_SMOPEN                      111
00018 #define IDB_SMBMP                       112
00019 #define IDB_LGBMP                       113
00020 #define IDI_PSI_ROCKET                  114
00021 #define IDR_SMICONS                     120
00022 #define IDR_LGICONS                     121
00023 #define IDC_ROCKET_NAME                 1000
00024 #define IDC_ROCKET_HEIGHT               1001
00025 #define IDC_ROCKET_WEIGHT               1002
00026 #define IDC_ROCKET_PAYLOAD              1003
00027 #define IDC_ROCKET_STATUS               1005
00028 #define IDC_PEOPLE_NAME                 1008
00029 #define IDC_PEOPLE_COLOR                1009
00030 #define IDC_PEOPLE_MATERIAL             1010
00031 #define IDC_PEOPLE_OWNER                1011
00032 #define IDC_PEOPLE_SURFACE              1012
00033 #define IDC_GIRLS                       1013
00034 #define IDC_PEOPLE_GIRLS                1013
00035 #define IDB_ROCKET                      40004
00036 #define IDB_CAR                         40005
00037 #define IDB_PLANE                       40006
00038 #define IDB_BIKE                        40007
00039 #define IDB_ROCKET2                     40008
00040 #define IDB_CAR2                        40009
00041 #define IDB_PLANE2                      40010
00042 #define IDB_BIKE2                       40011
00043 #define IDB_CLOSED2                     40012
00044 #define IDB_OPEN2                       40013
00045 #define IDB_CLOSED                      40014
00046 #define IDB_OPEN                        40015
00047
00048 // Next default values for new objects
00049 //
00050 #ifdef APSTUDIO_INVOKED
00051 #ifndef APSTUDIO_READONLY_SYMBOLS
00052 #define _APS_NEXT_RESOURCE_VALUE        116
00053 #define _APS_NEXT_COMMAND_VALUE         40016
00054 #define _APS_NEXT_CONTROL_VALUE         1014
00055 #define _APS_NEXT_SYMED_VALUE           101
00056 #endif
00057 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/AString.Cpp Source File

  • Security
  • CertServices
  • Encode

AString.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        astring.cpp
00007 //
00008 // Contents:    Cert Server Extension Encoding/Decoding implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013
00014 #pragma hdrstop
00015
00016 #include <assert.h>
00017 #include "resource.h"
00018 #include "astring.h"
00019 #include "celib.h"
00020
00021
00022 //+--------------------------------------------------------------------------
00023 // CCertEncodeStringArray::~CCertEncodeStringArray -- destructor
00024 //
00025 // free memory associated with this instance
00026 //+--------------------------------------------------------------------------
00027
00028 CCertEncodeStringArray::~CCertEncodeStringArray()
00029 {
00030     _Cleanup();
00031 }
00032
00033
00034 //+--------------------------------------------------------------------------
00035 // CCertEncodeStringArray::_Cleanup -- release all resources
00036 //
00037 // free memory associated with this instance
00038 //+--------------------------------------------------------------------------
00039
00040 VOID
00041 CCertEncodeStringArray::_Cleanup()
00042 {
00043     LONG i;
00044
00045     if (NULL != m_aValue)
00046     {
00047   for (i = 0; i < m_cValue; i++)
00048   {
00049       CERT_NAME_VALUE *pNameValue;
00050
00051       pNameValue = m_aValue[i];
00052       assert(NULL != pNameValue);
00053       if (m_fConstructing)
00054       {
00055     if (NULL != pNameValue->Value.pbData)
00056     {
00057         LocalFree(pNameValue->Value.pbData);
00058     }
00059       }
00060       else
00061       {
00062     LocalFree(pNameValue);
00063       }
00064   }
00065   if (m_fConstructing && NULL != m_aValue[0])
00066   {
00067       LocalFree(m_aValue[0]);
00068   }
00069   LocalFree(m_aValue);
00070   m_aValue = NULL;
00071     }
00072     m_cValue = 0;
00073     m_cValuesSet = 0;
00074     m_fConstructing = FALSE;
00075     m_StringType = CERT_RDN_IA5_STRING;
00076 }
00077
00078
00079 //+--------------------------------------------------------------------------
00080 // CCertEncodeStringArray::Decode -- Decode StringArray
00081 //
00082 // Returns S_OK on success.
00083 //+--------------------------------------------------------------------------
00084
00085 STDMETHODIMP
00086 CCertEncodeStringArray::Decode(
00087     /* [in] */ BSTR const strBinary)
00088 {
00089     HRESULT hr = S_OK;
00090     CRYPT_SEQUENCE_OF_ANY *pSequence = NULL;
00091     DWORD cbSequence;
00092     LONG i;
00093
00094     _Cleanup();
00095
00096     if (NULL == strBinary)
00097     {
00098   hr = E_POINTER;
00099   ceERRORPRINTLINE("NULL parm", hr);
00100   goto error;
00101     }
00102
00103     // Decode to an array of ASN blobs:
00104
00105     if (!ceDecodeObject(
00106         X509_ASN_ENCODING,
00107         X509_SEQUENCE_OF_ANY,
00108         (BYTE *) strBinary,
00109         SysStringByteLen(strBinary),
00110         FALSE,
00111         (VOID **) &pSequence,
00112         &cbSequence))
00113     {
00114   hr = ceHLastError();
00115   ceERRORPRINTLINE("ceDecodeObject", hr);
00116   goto error;
00117     }
00118
00119     m_aValue = (CERT_NAME_VALUE **) LocalAlloc(
00120         LMEM_FIXED,
00121         pSequence->cValue * sizeof(m_aValue[0]));
00122     if (NULL == m_aValue)
00123     {
00124   hr = E_OUTOFMEMORY;
00125   ceERRORPRINTLINE("LocalAlloc", hr);
00126   goto error;
00127     }
00128     for (i = 0; i < (LONG) pSequence->cValue; i++)
00129     {
00130   DWORD cb;
00131
00132   // Decode each ASN blob to a name value (string blob + encoding type):
00133
00134   if (!ceDecodeObject(
00135       X509_ASN_ENCODING,
00136       X509_UNICODE_ANY_STRING,
00137       pSequence->rgValue[i].pbData,
00138       pSequence->rgValue[i].cbData,
00139       FALSE,
00140       (VOID **) &m_aValue[i],
00141       &cb))
00142   {
00143       hr = ceHLastError();
00144       ceERRORPRINTLINE("ceDecodeObject", hr);
00145       goto error;
00146   }
00147   if (0 == i)
00148   {
00149       m_StringType = m_aValue[i]->dwValueType;
00150   }
00151   else
00152   {
00153       if (m_StringType != (LONG) m_aValue[i]->dwValueType)
00154       {
00155     ceERRORPRINTLINE("dwValueType mismatch", hr);
00156       }
00157   }
00158   m_cValue++;
00159     }
00160     assert((LONG) pSequence->cValue == m_cValue);
00161
00162 error:
00163     if (NULL != pSequence)
00164     {
00165   LocalFree(pSequence);
00166     }
00167     if (S_OK != hr)
00168     {
00169   _Cleanup();
00170     }
00171     return(_SetErrorInfo(hr, L"CCertEncodeStringArray::Decode"));
00172 }
00173
00174
00175 //+--------------------------------------------------------------------------
00176 // CCertEncodeStringArray::GetStringType -- Get string type
00177 //
00178 // Returns S_OK on success.
00179 //+--------------------------------------------------------------------------
00180
00181 STDMETHODIMP
00182 CCertEncodeStringArray::GetStringType(
00183     /* [out, retval] */ LONG __RPC_FAR *pStringType)
00184 {
00185     HRESULT hr = S_OK;
00186
00187     if (NULL == pStringType)
00188     {
00189   hr = E_POINTER;
00190   ceERRORPRINTLINE("NULL parm", hr);
00191   goto error;
00192     }
00193     if (NULL == m_aValue)
00194     {
00195   hr = E_INVALIDARG;
00196   ceERRORPRINTLINE("bad parameter", hr);
00197   goto error;
00198     }
00199     *pStringType = m_StringType;
00200 error:
00201     return(_SetErrorInfo(hr, L"CCertEncodeStringArray::GetStringType"));
00202 }
00203
00204
00205 //+--------------------------------------------------------------------------
00206 // CCertEncodeStringArray::GetCount -- Get Array count
00207 //
00208 // Returns S_OK on success.
00209 //+--------------------------------------------------------------------------
00210
00211 STDMETHODIMP
00212 CCertEncodeStringArray::GetCount(
00213     /* [out, retval] */ LONG __RPC_FAR *pCount)
00214 {
00215     HRESULT hr = S_OK;
00216
00217     if (NULL == pCount)
00218     {
00219   hr = E_POINTER;
00220   ceERRORPRINTLINE("NULL parm", hr);
00221   goto error;
00222     }
00223     if (NULL == m_aValue)
00224     {
00225   hr = E_INVALIDARG;
00226   ceERRORPRINTLINE("bad parameter", hr);
00227   goto error;
00228     }
00229     *pCount = m_cValue;
00230 error:
00231     return(_SetErrorInfo(hr, L"CCertEncodeStringArray::GetCount"));
00232 }
00233
00234
00235 //+--------------------------------------------------------------------------
00236 // CCertEncodeStringArray::GetValue -- Fetch the indexed string
00237 //
00238 // Returns S_OK on success.
00239 //+--------------------------------------------------------------------------
00240
00241 STDMETHODIMP
00242 CCertEncodeStringArray::GetValue(
00243     /* [in] */ LONG Index,
00244     /* [out, retval] */ BSTR __RPC_FAR *pstr)
00245 {
00246     HRESULT hr = S_OK;
00247
00248     if (NULL == pstr)
00249     {
00250   hr = E_POINTER;
00251   ceERRORPRINTLINE("NULL parm", hr);
00252   goto error;
00253     }
00254     ceFreeBstr(pstr);
00255     if (NULL == m_aValue || Index >= m_cValue)
00256     {
00257   hr = E_INVALIDARG;
00258   ceERRORPRINTLINE("bad parameter", hr);
00259   goto error;
00260     }
00261     if (NULL == m_aValue[Index]->Value.pbData)
00262     {
00263   hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
00264   ceERRORPRINTLINE("uninitialized", hr);
00265   goto error;
00266     }
00267     if (!ceConvertWszToBstr(
00268       pstr,
00269       (WCHAR const *) m_aValue[Index]->Value.pbData,
00270       -1))
00271     {
00272   hr = E_OUTOFMEMORY;
00273   ceERRORPRINTLINE("ceConvertWszToBstr", hr);
00274   goto error;
00275     }
00276 error:
00277     return(_SetErrorInfo(hr, L"CCertEncodeStringArray::GetValue"));
00278 }
00279
00280
00281 //+--------------------------------------------------------------------------
00282 // CCertEncodeStringArray::Reset -- clear out data
00283 //
00284 // Returns S_OK on success.
00285 //+--------------------------------------------------------------------------
00286
00287 STDMETHODIMP
00288 CCertEncodeStringArray::Reset(
00289     /* [in] */ LONG Count,
00290     /* [in] */ LONG StringType)
00291 {
00292     HRESULT hr = S_OK;
00293     CERT_NAME_VALUE *aNameValue = NULL;
00294     LONG i;
00295
00296     _Cleanup();
00297     m_fConstructing = TRUE;
00298     if (CENCODEMAX < Count || 0 > Count)
00299     {
00300   hr = E_INVALIDARG;
00301   ceERRORPRINTLINE("bad count parameter", hr);
00302   goto error;
00303     }
00304
00305     switch (StringType)
00306     {
00307   case CERT_RDN_ANY_TYPE:
00308   //case CERT_RDN_ENCODED_BLOB:
00309   //case CERT_RDN_OCTET_STRING:
00310   case CERT_RDN_NUMERIC_STRING:
00311   case CERT_RDN_PRINTABLE_STRING:
00312   //case CERT_RDN_TELETEX_STRING: same as CERT_RDN_T61_STRING:
00313   case CERT_RDN_T61_STRING:
00314   case CERT_RDN_VIDEOTEX_STRING:
00315   case CERT_RDN_IA5_STRING:
00316   case CERT_RDN_GRAPHIC_STRING:
00317   //case CERT_RDN_VISIBLE_STRING: same as CERT_RDN_ISO646_STRING:
00318   case CERT_RDN_ISO646_STRING:
00319   case CERT_RDN_GENERAL_STRING:
00320   //case CERT_RDN_UNIVERSAL_STRING: same as CERT_RDN_INT4_STRING:
00321   case CERT_RDN_INT4_STRING:
00322   //case CERT_RDN_BMP_STRING: same as case CERT_RDN_UNICODE_STRING:
00323   case CERT_RDN_UNICODE_STRING:
00324       break;
00325
00326   default:
00327       hr = E_INVALIDARG;
00328       ceERRORPRINTLINE("bad parameter", hr);
00329       goto error;
00330     }
00331     m_StringType = StringType;
00332
00333     aNameValue = (CERT_NAME_VALUE *) LocalAlloc(
00334         LMEM_FIXED | LMEM_ZEROINIT,
00335         Count * sizeof(*m_aValue[0]));
00336     if (NULL == aNameValue)
00337     {
00338   hr = E_OUTOFMEMORY;
00339   ceERRORPRINTLINE("LocalAlloc", hr);
00340   goto error;
00341     }
00342
00343     m_aValue = (CERT_NAME_VALUE **) LocalAlloc(
00344         LMEM_FIXED,
00345         Count * sizeof(m_aValue[0]));
00346     if (NULL == m_aValue)
00347     {
00348   hr = E_OUTOFMEMORY;
00349   ceERRORPRINTLINE("LocalAlloc", hr);
00350   goto error;
00351     }
00352
00353     m_cValue = Count;
00354     for (i = 0; i < Count; i++)
00355     {
00356   m_aValue[i] = &aNameValue[i];
00357     }
00358     aNameValue = NULL;
00359
00360 error:
00361     if (NULL != aNameValue)
00362     {
00363   LocalFree(aNameValue);
00364     }
00365     if (S_OK != hr)
00366     {
00367   _Cleanup();
00368     }
00369     return(_SetErrorInfo(hr, L"CCertEncodeStringArray::Reset"));
00370 }
00371
00372
00373 //+--------------------------------------------------------------------------
00374 // CCertEncodeStringArray::SetValue -- Set an array string
00375 //
00376 // Returns S_OK on success.
00377 //+--------------------------------------------------------------------------
00378
00379 STDMETHODIMP
00380 CCertEncodeStringArray::SetValue(
00381     /* [in] */ LONG Index,
00382     /* [in] */ BSTR const str)
00383 {
00384     HRESULT hr = S_OK;
00385     WCHAR *pwsz;
00386
00387     if (NULL == str)
00388     {
00389   hr = E_POINTER;
00390   ceERRORPRINTLINE("NULL parm", hr);
00391   goto error;
00392     }
00393     if (!m_fConstructing ||
00394   NULL == m_aValue ||
00395   Index >= m_cValue ||
00396   m_cValuesSet >= m_cValue ||
00397   NULL != m_aValue[Index]->Value.pbData)
00398     {
00399   hr = E_INVALIDARG;
00400   ceERRORPRINTLINE("bad parameter", hr);
00401   goto error;
00402     }
00403     pwsz = ceDuplicateString(str);
00404     if (NULL == pwsz)
00405     {
00406   hr = E_OUTOFMEMORY;
00407   ceERRORPRINTLINE("ceDuplicateString", hr);
00408   goto error;
00409     }
00410     m_aValue[Index]->dwValueType = m_StringType;
00411     m_aValue[Index]->Value.pbData = (BYTE *) pwsz;
00412     m_aValue[Index]->Value.cbData = 0;
00413     m_cValuesSet++;
00414
00415 error:
00416     return(_SetErrorInfo(hr, L"CCertEncodeStringArray::SetValue"));
00417 }
00418
00419
00420 //+--------------------------------------------------------------------------
00421 // CCertEncodeStringArray::Encode -- Encode StringArray
00422 //
00423 // Returns S_OK on success.
00424 //+--------------------------------------------------------------------------
00425
00426 STDMETHODIMP
00427 CCertEncodeStringArray::Encode(
00428     /* [out, retval] */ BSTR __RPC_FAR *pstrBinary)
00429 {
00430     HRESULT hr = S_OK;
00431     LONG i;
00432     CRYPT_SEQUENCE_OF_ANY Sequence;
00433     BYTE *pbEncoded = NULL;
00434     DWORD cbEncoded;
00435
00436     Sequence.cValue = 0;
00437     Sequence.rgValue = NULL;
00438
00439     if (NULL == pstrBinary)
00440     {
00441   hr = E_POINTER;
00442   ceERRORPRINTLINE("NULL parm", hr);
00443   goto error;
00444     }
00445     ceFreeBstr(pstrBinary);
00446     if (!m_fConstructing || NULL == m_aValue)
00447     {
00448   hr = E_INVALIDARG;
00449   ceERRORPRINTLINE("bad parameter", hr);
00450   goto error;
00451     }
00452     if (m_cValuesSet != m_cValue)
00453     {
00454   hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00455   ceERRORPRINTLINE("uninitialized values", hr);
00456   goto error;
00457     }
00458
00459     Sequence.rgValue = (CRYPT_DER_BLOB *) LocalAlloc(
00460             LMEM_FIXED,
00461             m_cValue * sizeof(Sequence.rgValue[0]));
00462     if (NULL == Sequence.rgValue)
00463     {
00464   hr = E_OUTOFMEMORY;
00465   ceERRORPRINTLINE("LocalAlloc", hr);
00466   goto error;
00467     }
00468
00469     for (i = 0; i < m_cValue; i++)
00470     {
00471   // Encode each name blob into an ASN blob:
00472
00473   if (!ceEncodeObject(
00474       X509_ASN_ENCODING,
00475       X509_UNICODE_ANY_STRING,
00476       m_aValue[i],
00477       0,
00478       FALSE,
00479       &Sequence.rgValue[i].pbData,
00480       &Sequence.rgValue[i].cbData))
00481   {
00482       hr = ceHLastError();
00483       ceERRORPRINTLINE("ceEncodeObject", hr);
00484       goto error;
00485   }
00486   Sequence.cValue++;
00487     }
00488     assert((LONG) Sequence.cValue == m_cValue);
00489
00490     // Encode the array of ASN blob:
00491
00492     if (!ceEncodeObject(
00493         X509_ASN_ENCODING,
00494         X509_SEQUENCE_OF_ANY,
00495         &Sequence,
00496         0,
00497         FALSE,
00498         &pbEncoded,
00499         &cbEncoded))
00500     {
00501   hr = ceHLastError();
00502   ceERRORPRINTLINE("ceEncodeObject", hr);
00503   goto error;
00504     }
00505     if (!ceConvertWszToBstr(
00506       pstrBinary,
00507       (WCHAR const *) pbEncoded,
00508       cbEncoded))
00509     {
00510   hr = E_OUTOFMEMORY;
00511   ceERRORPRINTLINE("ceConvertWszToBstr", hr);
00512   goto error;
00513     }
00514
00515 error:
00516     if (NULL != pbEncoded)
00517     {
00518   LocalFree(pbEncoded);
00519     }
00520     if (NULL != Sequence.rgValue)
00521     {
00522   assert((LONG) Sequence.cValue <= m_cValue);
00523   for (i = 0; i < (LONG) Sequence.cValue; i++)
00524   {
00525       assert(NULL != Sequence.rgValue[i].pbData);
00526       LocalFree(Sequence.rgValue[i].pbData);
00527   }
00528   LocalFree(Sequence.rgValue);
00529     }
00530     return(_SetErrorInfo(hr, L"CCertEncodeStringArray::Encode"));
00531 }
00532
00533
00534 //+--------------------------------------------------------------------------
00535 // CCertEncodeStringArray::_SetErrorInfo -- set error object information
00536 //
00537 // Returns passed HRESULT
00538 //+--------------------------------------------------------------------------
00539
00540 HRESULT
00541 CCertEncodeStringArray::_SetErrorInfo(
00542     IN HRESULT hrError,
00543     IN WCHAR const *pwszDescription)
00544 {
00545     assert(FAILED(hrError) || S_OK == hrError || S_FALSE == hrError);
00546     if (FAILED(hrError))
00547     {
00548   HRESULT hr;
00549
00550   hr = ceDispatchSetErrorInfo(
00551           hrError,
00552           pwszDescription,
00553           wszCLASS_CERTENCODESTRINGARRAY,
00554           &IID_ICertEncodeStringArray);
00555   assert(hr == hrError);
00556     }
00557     return(hrError);
00558 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/Framer/IAdvSink.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • Framer

IAdvSink.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /*
00019  * IADVSINK.CPP
00020  * IAdviseSink for Document Objects CSite class
00021  *
00022  */
00023
00024
00025 #include "framer.h"
00026
00027
00028 /*
00029  * CImpIAdviseSink::CImpIAdviseSink
00030  * CImpIAdviseSink::~CImpIAdviseSink
00031  *
00032  * Parameters (Constructor):
00033  *  pSite           PCSite of the site we're in.
00034  *  pUnkOuter       LPUNKNOWN to which we delegate.
00035  */
00036
00037 CImpIAdviseSink::CImpIAdviseSink(PCSite pSite
00038     , LPUNKNOWN pUnkOuter)
00039     {
00040     m_cRef=0;
00041     m_pSite=pSite;
00042     m_pUnkOuter=pUnkOuter;
00043     return;
00044     }
00045
00046 CImpIAdviseSink::~CImpIAdviseSink(void)
00047     {
00048     return;
00049     }
00050
00051
00052
00053
00054 /*
00055  * CImpIAdviseSink::QueryInterface
00056  * CImpIAdviseSink::AddRef
00057  * CImpIAdviseSink::Release
00058  *
00059  * Purpose:
00060  *  IUnknown members for CImpIAdviseSink object.
00061  */
00062
00063 STDMETHODIMP CImpIAdviseSink::QueryInterface(REFIID riid, void **ppv)
00064     {
00065     return m_pUnkOuter->QueryInterface(riid, ppv);
00066     }
00067
00068
00069 STDMETHODIMP_(ULONG) CImpIAdviseSink::AddRef(void)
00070     {
00071     ++m_cRef;
00072     return m_pUnkOuter->AddRef();
00073     }
00074
00075 STDMETHODIMP_(ULONG) CImpIAdviseSink::Release(void)
00076     {
00077     --m_cRef;
00078     return m_pUnkOuter->Release();
00079     }
00080
00081
00082
00083 /*
00084  * Unused members in CImpIAdviseSink
00085  *  OnDataChange
00086  *  OnViewChange
00087  *  OnRename
00088  *  OnSave
00089  */
00090
00091 STDMETHODIMP_(void) CImpIAdviseSink::OnDataChange(LPFORMATETC pFEIn
00092     , LPSTGMEDIUM pSTM)
00093     {
00094     return;
00095     }
00096
00097 STDMETHODIMP_(void) CImpIAdviseSink::OnViewChange(DWORD dwAspect
00098     , LONG lindex)
00099     {
00100     return;
00101     }
00102
00103 STDMETHODIMP_(void) CImpIAdviseSink::OnRename(LPMONIKER pmk)
00104     {
00105     return;
00106     }
00107
00108 STDMETHODIMP_(void) CImpIAdviseSink::OnSave(void)
00109     {
00110     return;
00111     }
00112
00113
00114
00115
00116 /*
00117  * CImpIAdviseSink::OnClose
00118  *
00119  * Purpose:
00120  *  Informs the advise sink that the OLE object has closed and is
00121  *  no longer bound in any way.  We use this to do a File/Close
00122  *  to delete the object since we don't hold onto any.
00123  *
00124  * Parameters:
00125  *  None
00126  *
00127  * Return Value:
00128  *  None
00129  */
00130
00131 STDMETHODIMP_(void) CImpIAdviseSink::OnClose(void)
00132     {
00133   //This does the same as File/Close
00134   //Not quite because CFrame::Close requires some synchronous
00135   //calls that will fail if done here, so just post a message to
00136   //do this
00137     //m_pSite->m_pFR->Close();
00138
00139   HWND    hwnd;
00140   m_pSite->m_pFR->GetWindow(&hwnd);
00141   PostMessage(
00142     hwnd,
00143     WM_COMMAND,
00144     MAKELONG(IDM_FILECLOSE, 0),
00145     0);
00146     return;
00147     }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/guids.h Source File

  • SysMgmt
  • MMC
  • ActiveX

guids.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 // {FA7306A6-8B0D-11d2-8A0B-000021473128}
00020 DEFINE_GUID(CLSID_CComponentData,
00021             0xfa7306a6, 0x8b0d, 0x11d2, 0x8a, 0xb, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28);
00022
00023 // {FA7306A8-8B0D-11d2-8A0B-000021473128}
00024 DEFINE_GUID(CLSID_CSnapinAbout,
00025             0xfa7306a8, 0x8b0d, 0x11d2, 0x8a, 0xb, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28);
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/RPCsvc/Server.c Source File

  • NetDS
  • RPC
  • RPCsvc

Server.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE:   server.c
00009 //
00010 //  PURPOSE:  Implements the body of the RPC service sample.
00011 //
00012 //  FUNCTIONS:
00013 //            Called by service.c:
00014 //            ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
00015 //            ServiceStop( );
00016 //
00017 //            Called by RPC:
00018 //            error_status_t Ping(handle_t)
00019 //
00020 //  COMMENTS: The ServerStart and ServerStop functions implemented here are
00021 //            prototyped in service.h.  The other functions are RPC manager
00022 //            functions prototypes in rpcsvc.h.
00023 //
00024 //
00025 //  AUTHOR: Craig Link - Microsoft Developer Support
00026 //          Mario Goertzel - RPC Development
00027 //
00028
00029
00030 #include <windows.h>
00031 #include <stdio.h>
00032 #include <stdlib.h>
00033 #include <process.h>
00034 #include <tchar.h>
00035 #include <rpc.h>
00036 #include "service.h"
00037 #include "rpcsvc.h"
00038
00039 //
00040 // RPC configuration.
00041 //
00042
00043 // This service listens to all the protseqs listed in this array.
00044 // This should be read from the service's configuration in the
00045 // registery.
00046
00047 TCHAR *ProtocolArray[] = { TEXT("ncalrpc"),
00048                            TEXT("ncacn_ip_tcp"),
00049                            TEXT("ncacn_np"),
00050                            TEXT("ncadg_ip_udp")
00051                          };
00052
00053 // Used in RpcServerUseProtseq, for some protseqs
00054 // this is used as a hint for buffer size.
00055 ULONG ProtocolBuffer = 3;
00056
00057 // Use in RpcServerListen().  More threads will increase performance,
00058 // but use more memory.
00059 ULONG MinimumThreads = 3;
00060
00061 //
00062 //  FUNCTION: ServiceStart
00063 //
00064 //  PURPOSE: Actual code of the service
00065 //           that does the work.
00066 //
00067 //  PARAMETERS:
00068 //    dwArgc   - number of command line arguments
00069 //    lpszArgv - array of command line arguments
00070 //
00071 //  RETURN VALUE:
00072 //    none
00073 //
00074 //  COMMENTS:
00075 //    Starts the service listening for RPC requests.
00076 //
00077 VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
00078 {
00079     UINT i;
00080     RPC_BINDING_VECTOR *pbindingVector = 0;
00081     RPC_STATUS status;
00082     BOOL fListening = FALSE;
00083
00084     ///////////////////////////////////////////////////
00085     //
00086     // Service initialization
00087     //
00088
00089     //
00090     // Use protocol sequences (protseqs) specified in ProtocolArray.
00091     //
00092
00093     for(i = 0; i < sizeof(ProtocolArray)/sizeof(TCHAR *); i++)
00094         {
00095
00096         // Report the status to the service control manager.
00097         if (!ReportStatusToSCMgr(
00098             SERVICE_START_PENDING, // service state
00099             NO_ERROR,              // exit code
00100             3000))                 // wait hint
00101             return;
00102
00103
00104         status = RpcServerUseProtseq(ProtocolArray[i],
00105                                      ProtocolBuffer,
00106                                      0);
00107
00108         if (status == RPC_S_OK)
00109             {
00110             fListening = TRUE;
00111             }
00112         }
00113
00114     if (!fListening)
00115         {
00116         // Unable to listen to any protocol!
00117         //
00118         AddToMessageLog(TEXT("RpcServerUseProtseq() failed\n"));
00119         return;
00120         }
00121
00122     // Report the status to the service control manager.
00123     //
00124     if (!ReportStatusToSCMgr(
00125         SERVICE_START_PENDING, // service state
00126         NO_ERROR,              // exit code
00127         3000))                 // wait hint
00128         return;
00129
00130     // Register the services interface(s).
00131     //
00132
00133     status = RpcServerRegisterIf(RpcServiceSample_v1_0_s_ifspec,   // from rpcsvc.h
00134                                  0,
00135                                  0);
00136
00137
00138     if (status != RPC_S_OK)
00139         return;
00140
00141     // Report the status to the service control manager.
00142     //
00143     if (!ReportStatusToSCMgr(
00144         SERVICE_START_PENDING, // service state
00145         NO_ERROR,              // exit code
00146         3000))                 // wait hint
00147         return;
00148
00149
00150     // Register interface(s) and binding(s) (endpoints) with
00151     // the endpoint mapper.
00152     //
00153
00154     status = RpcServerInqBindings(&pbindingVector);
00155
00156     if (status != RPC_S_OK)
00157         {
00158         return;
00159         }
00160
00161     status = RpcEpRegister(RpcServiceSample_v1_0_s_ifspec,   // from rpcsvc.h
00162                            pbindingVector,
00163                            0,
00164                            0);
00165
00166     if (status != RPC_S_OK)
00167         {
00168         return;
00169         }
00170
00171     // Report the status to the service control manager.
00172     //
00173     if (!ReportStatusToSCMgr(
00174         SERVICE_START_PENDING, // service state
00175         NO_ERROR,              // exit code
00176         3000))                 // wait hint
00177         return;
00178
00179     // Enable NT LM Security Support Provider (NtLmSsp service)
00180     //
00181     status = RpcServerRegisterAuthInfo(0,
00182                                        RPC_C_AUTHN_WINNT,
00183                                        0,
00184                                        0
00185                                        );
00186     if (status != RPC_S_OK)
00187         {
00188         return;
00189         }
00190
00191     // Report the status to the service control manager.
00192     //
00193     if (!ReportStatusToSCMgr(
00194         SERVICE_START_PENDING, // service state
00195         NO_ERROR,              // exit code
00196         3000))                 // wait hint
00197         return;
00198
00199
00200     // Start accepting client calls.
00201     //
00202     status = RpcServerListen(MinimumThreads,
00203                              RPC_C_LISTEN_MAX_CALLS_DEFAULT,  // rpcdce.h
00204                              TRUE);                           // don't block.
00205
00206     if (status != RPC_S_OK)
00207         {
00208         return;
00209         }
00210
00211     // Report the status to the service control manager.
00212     //
00213     if (!ReportStatusToSCMgr(
00214         SERVICE_RUNNING,       // service state
00215         NO_ERROR,              // exit code
00216         0))                    // wait hint
00217         return;
00218
00219     //
00220     // End of initialization
00221     //
00222     ////////////////////////////////////////////////////////////
00223
00224     ////////////////////////////////////////////////////////////
00225     //
00226     // Cleanup
00227     //
00228
00229     // RpcMgmtWaitServerListen() will block until the server has
00230     // stopped listening.  If this service had something better to
00231     // do with this thread, it would delay this call until
00232     // ServiceStop() had been called. (Set an event in ServiceStop()).
00233     //
00234     status = RpcMgmtWaitServerListen();
00235
00236     // ASSERT(status == RPC_S_OK)
00237
00238     // Remove entries from the endpoint mapper database.
00239     //
00240     RpcEpUnregister(RpcServiceSample_v1_0_s_ifspec,   // from rpcsvc.h
00241                     pbindingVector,
00242                     0);
00243
00244     // Delete the binding vector
00245     //
00246     RpcBindingVectorFree(&pbindingVector);
00247
00248     //
00249     ////////////////////////////////////////////////////////////
00250     return;
00251 }
00252
00253
00254 //
00255 //  FUNCTION: ServiceStop
00256 //
00257 //  PURPOSE: Stops the service
00258 //
00259 //  PARAMETERS:
00260 //    none
00261 //
00262 //  RETURN VALUE:
00263 //    none
00264 //
00265 //  COMMENTS:
00266 //    If a ServiceStop procedure is going to
00267 //    take longer than 3 seconds to execute,
00268 //    it should spawn a thread to execute the
00269 //    stop code, and return.  Otherwise, the
00270 //    ServiceControlManager will believe that
00271 //    the service has stopped responding.
00272 //
00273 VOID ServiceStop()
00274 {
00275     // Stop's the server, wakes the main thread.
00276
00277     RpcMgmtStopServerListening(0);
00278 }
00279
00280
00281 //
00282 //  FUNCTION: Ping
00283 //
00284 //  PURPOSE: Implements the Ping() operation.
00285 //
00286 //  PARAMETERS:
00287 //    none
00288 //
00289 //  RETURN VALUE:
00290 //    none
00291 //
00292 //  COMMENTS:
00293 //    Ping() operation defined in rpcsvc.idl.
00294 //    Used by clients to test the connection.
00295 //
00296
00297 error_status_t
00298 Ping(
00299     handle_t h
00300     )
00301 {
00302     return(0);
00303 }
00304
00305 //
00306 //  FUNCTIONS: BufferIn1, BufferIn2, BufferIn3
00307 //
00308 //  PURPOSE: Implements three different methods
00309 //           for sending data to the server.
00310 //
00311 //  PARAMETERS:
00312 //    see rpcsvc.idl
00313 //
00314 //  RETURN VALUE:
00315 //    error_status_t - 0;
00316 //
00317
00318 error_status_t
00319 BufferIn1(
00320          handle_t h,
00321          byte Buffer[],
00322          unsigned long Length,
00323          unsigned long Size
00324          )
00325 {
00326     return(0);
00327 }
00328
00329 error_status_t
00330 BufferIn2(
00331          handle_t h,
00332          byte Buffer[],
00333          unsigned long Length
00334          )
00335 {
00336     return(0);
00337 }
00338
00339 error_status_t
00340 BufferIn3(
00341          handle_t h,
00342          byte Buffer[],
00343          unsigned long Length
00344          )
00345 {
00346     return(0);
00347 }
00348
00349 //
00350 //  FUNCTIONS: BufferOut1, BufferOut2, BufferOut3, BufferOut4
00351 //
00352 //  PURPOSE: Implements four different methods
00353 //           for reading data from the server.
00354 //
00355 //  PARAMETERS:
00356 //    see rpcsvc.idl
00357 //
00358 //  RETURN VALUE:
00359 //    error_status_t - 0;
00360 //
00361
00362 error_status_t
00363 BufferOut1(
00364          handle_t h,
00365          byte Buffer[],
00366          unsigned long *pLength
00367          )
00368 {
00369     *pLength = BUFFER_SIZE;
00370     return(0);
00371 }
00372
00373 error_status_t
00374 BufferOut2(
00375           handle_t h,
00376           byte Buffer[],
00377           unsigned long Size,
00378           unsigned long *pLength
00379           )
00380 {
00381     *pLength = BUFFER_SIZE;
00382     return(0);
00383 }
00384
00385 error_status_t
00386 BufferOut3(
00387           handle_t h,
00388           BUFFER *pBuffer
00389           )
00390 {
00391     pBuffer->BufferLength = BUFFER_SIZE;
00392     pBuffer->Buffer = MIDL_user_allocate(BUFFER_SIZE);
00393
00394     if (pBuffer->Buffer == 0)
00395         {
00396         return(RPC_S_OUT_OF_MEMORY);
00397         }
00398     return(0);
00399 }
00400
00401 error_status_t
00402 BufferOut4(
00403           handle_t h,
00404           byte Buffer[],
00405           unsigned long *pLength
00406           )
00407 {
00408     *pLength = BUFFER_SIZE;
00409     return(0);
00410 }
00411
00412 //
00413 //  FUNCTIONS: StructsIn1, StructsIn2, StructsIn3
00414 //
00415 //  PURPOSE: Implements server side of the struct/enum operations.
00416 //
00417 //  PARAMETERS:
00418 //    see rpcsvc.idl
00419 //
00420 //  RETURN VALUE:
00421 //    error_status_t - 0;
00422 //
00423 //
00424 error_status_t
00425 StructsIn1(
00426           handle_t h,
00427           struct BAD1 array[50]
00428           )
00429 {
00430     return(0);
00431 }
00432
00433 error_status_t
00434 StructsIn2(
00435           handle_t h,
00436           struct BAD2 array[50]
00437           )
00438 {
00439     return(0);
00440 }
00441
00442 error_status_t
00443 StructsIn3(
00444           handle_t h,
00445           struct GOOD array[50]
00446           )
00447 {
00448     return(0);
00449 }
00450
00451 //
00452 //  FUNCTIONS: ListIn, ListOut1, ListOut2
00453 //
00454 //  PURPOSE: Implements server side of linked list functions.
00455 //
00456 //
00457 //  PARAMETERS:
00458 //    see rpcsvc.idl
00459 //
00460 //  RETURN VALUE:
00461 //    error_status_t - 0;
00462 //
00463 //  NOTES:
00464 //    Since ListOut2 uses [enable_allocate] it
00465 //    must allocate all memory for parameters
00466 //    with RpcSsAllocate().
00467 //
00468
00469 error_status_t
00470 ListIn(
00471       handle_t h,
00472       PLIST pList
00473       )
00474 {
00475     return(0);
00476 }
00477
00478 error_status_t
00479 ListOut1(
00480         handle_t h,
00481         LIST *pList
00482         )
00483 {
00484     int i;
00485     for(i = 0; i < LIST_SIZE; i++)
00486         {
00487         pList->data = i;
00488         pList->pNext = MIDL_user_allocate(sizeof(LIST));
00489         if (pList->pNext == 0)
00490             {
00491             return(RPC_S_OUT_OF_MEMORY);
00492             }
00493         pList = pList->pNext;
00494         }
00495
00496     pList->data = i;
00497     pList->pNext = 0;
00498
00499     return(0);
00500 }
00501
00502 error_status_t
00503 ListOut2(
00504         handle_t h,
00505         LIST *pList
00506         )
00507 {
00508     int i;
00509     for(i = 0; i < LIST_SIZE; i++)
00510         {
00511         pList->data = i;
00512         pList->pNext = RpcSsAllocate(sizeof(LIST));
00513         // RpcSsAllocate raises an exception when it
00514         // fails.  Use RpcSmAllocate is this is
00515         // undesirable.
00516         pList = pList->pNext;
00517         }
00518
00519     pList->data = i;
00520     pList->pNext = 0;
00521
00522     return(0);
00523 }
00524
00525 //
00526 //  FUNCTIONS: UnionCall1, UnionCall2
00527 //
00528 //  PURPOSE: Implements server side of the Union functions.
00529 //
00530 //  PARAMETERS:
00531 //    see rpcsvc.idl
00532 //
00533 //  RETURN VALUE:
00534 //    error_status_t - 0;
00535 //
00536 //
00537 error_status_t
00538 UnionCall1(
00539           handle_t h,
00540           unsigned long Length,
00541           BAD_UNION aUnion[]
00542           )
00543 {
00544     return(0);
00545 }
00546
00547 error_status_t
00548 UnionCall2(
00549           handle_t h,
00550           GOOD_UNION *pUnion
00551           )
00552 {
00553     return(0);
00554 }
00555
00556 //
00557 //  FUNCTION: CheckSecurity
00558 //
00559 //  PURPOSE: Demonstrates the RPC security APIs.
00560 //
00561 //  PARAMETERS:
00562 //    h - binding to client which made the call.
00563 //
00564 //  RETURN VALUE:
00565 //    0 - no error
00566 //
00567 error_status_t
00568 CheckSecurity(
00569              handle_t h
00570              )
00571 {
00572     RPC_STATUS status;
00573
00574     // At this point the thread is running in the server
00575     // security context.  There is guarantee that the client
00576     // even used a secure connection.
00577
00578     status = RpcImpersonateClient(h);
00579
00580     if (status != RPC_S_OK)
00581         {
00582         return(RPC_S_ACCESS_DENIED);
00583         }
00584
00585     // This thread is now running in the clients security context.
00586
00587     //
00588     // The server should now open a file, mutex, event or its own data
00589     // structure which has an ACL associated with it to check that the
00590     // client has the right to access the server's protected data.
00591     //
00592
00593     status = RpcRevertToSelf();
00594
00595     // ASSERT(status == RPC_S_OK);
00596
00597     // This thread is now running in the server's security context.
00598
00599     return(0);
00600 }
00601
00602
00603 //
00604 //  FUNCTIONS: MIDL_user_allocate and MIDL_user_free
00605 //
00606 //  PURPOSE: Used by stubs to allocate and free memory
00607 //           in standard RPC calls. Not used when
00608 //           [enable_allocate] is specified in the .acf.
00609 //
00610 //
00611 //  PARAMETERS:
00612 //    See documentations.
00613 //
00614 //  RETURN VALUE:
00615 //    Exceptions on error.  This is not required,
00616 //    you can use -error allocation on the midl.exe
00617 //    command line instead.
00618 //
00619 //
00620 void * __RPC_USER MIDL_user_allocate(size_t size)
00621 {
00622     return(HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, size));
00623 }
00624
00625 void __RPC_USER MIDL_user_free( void *pointer)
00626 {
00627     HeapFree(GetProcessHeap(), 0, pointer);
00628 }
00629
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPContextMenuModule Member List

This is the complete list of members for CSCPContextMenuModule, including all inherited members.
UpdateRegistryCLSID(const CLSID &clsid, BOOL bRegister) CSCPContextMenuModule
Generated on Wed Nov 13 2024 16:57:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/cplusplus/StdAfx.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • cplusplus

StdAfx.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            StdAfx.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012
00013 #include "stdafx.h"
00014
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/JavaClient/FullSvr/ISynchronize.java Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • JavaClient
  • FullSvr

ISynchronize.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc958.tmp" /nologo /d "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\JavaClient" "D:\mssdk\Samples\COM\Fundamentals\AsyncCalls\FullSvr\Debug\FullSvr.exe")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package fullsvr;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // VTable-only interface ISynchronize
00019 /** @com.interface(iid=00000030-0000-0000-C000-000000000046, thread=AUTO) */
00020 public interface ISynchronize extends IUnknown
00021 {
00022   /** @com.method(vtoffset=0, addFlagsVtable=4)
00023       @com.parameters([in,type=U4] dwFlags, [in,type=U4] dwMilliseconds) */
00024   public void Wait(int dwFlags, int dwMilliseconds);
00025
00026   /** @com.method(vtoffset=1, addFlagsVtable=4)
00027       @com.parameters() */
00028   public void Signal();
00029
00030   /** @com.method(vtoffset=2, addFlagsVtable=4)
00031       @com.parameters() */
00032   public void Reset();
00033
00034
00035   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x30, (short)0x0, (short)0x0, (byte)0xc0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x0, (byte)0x46);
00036 }
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Factory.cpp Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Factory.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Factory.cpp : Implementation of CFactory
00006 #include "stdafx.h"
00007 #include "Render.h"
00008 #include "Factory.h"
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CFactory
00012 STDMETHODIMP
00013 CFactory::FindBehavior(BSTR bstrBehavior,
00014                        BSTR bstrBehaviorUrl,
00015                        IElementBehaviorSite* pSite,
00016                        IElementBehavior** ppBehavior)
00017 {
00018    HRESULT hr;
00019    CComObject<CBehavior>* pBehavior;
00020
00021    // Create a Behavior object.
00022    hr = CComObject<CBehavior>::CreateInstance(&pBehavior);
00023
00024    if (SUCCEEDED(hr))
00025    {
00026     hr = pBehavior->QueryInterface(IID_IElementBehavior, (void**)ppBehavior );
00027    }
00028
00029    return hr;
00030 }
00031
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/vcAcct/IGetReceipt.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • vcAcct

IGetReceipt.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc19.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\mssdk\samples\com\Services\Transaction\SampleBank\vcacct\release\vcacct.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package vcacct;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface IGetReceipt
00019 /** @com.interface(iid=A81260B1-DDC8-11D0-B5A0-00C04FB957D8, thread=AUTO, type=DUAL) */
00020 public interface IGetReceipt extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1610743808, type=METHOD, name="GetNextReceipt", addFlagsVtable=4)
00023       @com.parameters([type=I4] return) */
00024   public int GetNextReceipt();
00025
00026
00027   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xa81260b1, (short)0xddc8, (short)0x11d0, (byte)0xb5, (byte)0xa0, (byte)0x0, (byte)0xc0, (byte)0x4f, (byte)0xb9, (byte)0x57, (byte)0xd8);
00028 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/sky.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

sky.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "Sky.h"
00021
00022 const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 //==============================================================
00025 //
00026 // CSkyBasedVehicle implementation
00027 //
00028 //
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/Font.c Source File

  • WinUI
  • CommDlg
  • CDTest

Font.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 /************************************************************************
00007
00008   File: font.c
00009
00010   Purpose:
00011
00012     Contains all functions pertinent to CDTEST's Font dialog.
00013
00014   Functions:
00015
00016      DoFontDlg()          -- Creates CDTEST's font dialog.
00017
00018      FontProc()           -- Callback for CDTEST's font dialog.
00019
00020      InitFontStruct()     -- Fills a CHOOSEFONT structure with some defaults.
00021
00022      FillFontDlg()        -- Fills CDTEST's font dialog with the contents
00023                              of a CHOOSEFONT structure.
00024
00025      GetFontDlg()         -- Retrieves the contents of CDTEST's font dialog
00026                              and fills a CHOOSEFONT structure with them.
00027
00028      GetHdc()             -- Creates and returns an HDC
00029
00030      LogFontProc()        -- Callback function for the logfont dlg.
00031
00032      InitLogFontStruct()  -- Fills a LOGFONT structure with some defaults.
00033
00034      FillLogFontDlg()     -- Fills the LOGFONT dlg with the values in
00035                              a LOGFONT structure.
00036
00037      GetLogFontDlg()      -- Retrieves the user's edits in the LogFont dlg
00038                              and puts them in a LOGFONT structure.
00039
00040      FontHookProc()       -- Callback function for CHOOSEFONT->lpfnHook
00041
00042      GetFontDlgHandle()   -- Creates a handle to the custom template and
00043                              returns a handle to it.
00044
00045      EnumFontsProc()      -- Callback function for EnumFontFamilies()
00046
00047      FillFontsBox()       -- Fills CDTEST's font list box with requested fonts
00048
00049      ResetCheckBoxes()    -- handles the font choices check box manipulations
00050
00051      HandleFontCheckBox() -- Handles the WM_COMMAND messages from the font
00052                              choices check boxes.
00053
00054      DoChooseFontStuff()  -- Calls the ChooseFont() function.
00055
00056      FontThreadProc1()    -- Starting address for the first thread.
00057
00058      FontThreadProc2()    -- Starting address for the second thread.
00059
00060      MultiThreadFontDlg() -- Creates two threads which each create a
00061                              ChooseFont() dialog.
00062
00063      FontEnableButtons()  -- Enables or disables CDTEST's font dialog buttons.
00064                              Necessary for multithreading part of this app.
00065
00066 ************************************************************************/
00067
00068
00069 #include <windows.h>
00070 #include <commdlg.h>
00071 #include <stdlib.h>
00072 #include <winnls.h>
00073 #include "cdtest.h"
00074 #include "font.h"
00075 #include "logfont.h"
00076
00077
00078
00079 /* some definitions that will help us tell the difference between
00080    screen and printer fonts */
00081
00082 #define FONT_TYPE_WYSIWYG 1
00083 BOOL bScreen ;
00084
00085
00086
00087 /* function prototypes and general variables */
00088
00089 void InitFontStruct(HWND, LPCHOOSEFONT) ;
00090 void FillFontDlg(HWND, LPCHOOSEFONT) ;
00091 void GetFontDlg(HWND, LPCHOOSEFONT) ;
00092 HDC  GetHdc(HWND, int) ;
00093 void InitLogFontStruct(HWND, LPLOGFONT) ;
00094 void FillLogFontDlg(HWND, LPLOGFONT) ;
00095 void GetLogFontDlg(HWND, LPLOGFONT) ;
00096 INT_PTR APIENTRY LogFontProc(HWND, UINT, WPARAM, LPARAM) ;
00097 UINT_PTR CALLBACK FontHookProc(HWND, UINT, WPARAM, LPARAM) ;
00098 int  CALLBACK EnumFontsProc(LPLOGFONT, LPTEXTMETRIC, DWORD, LPARAM) ;
00099 void FillFontsBox(HWND, DWORD) ;
00100 void ResetCheckBoxes(HWND) ;
00101 void HandleFontCheckBox(HWND, int) ;
00102 void DoChooseFontStuff(HWND, LPCHOOSEFONT) ;
00103
00104
00105
00106 /* Global variables and some external variables and functions */
00107
00108 DWORD dwFontFlag ;
00109 PRINTDLG pfd ;
00110 BOOL bLogFontParam ;
00111 LOGFONT lfWM_CF_LF ;                 //for the WM_CHOOSEFONT_GETLOGFONT message
00112 extern UINT_PTR uMode ;
00113 extern LONG_PTR MyAtol(LPTSTR, BOOL, LPBOOL) ;
00114 HRSRC hResFont;
00115 HGLOBAL hDialogFont ;
00116 HANDLE GetFontDlgHandle(void) ;
00117 CHOOSEFONT cf ;
00118 LOGFONT lf ;
00119 HDC hdc ;
00120 TCHAR szFaceName[50] ;
00121 TCHAR szFontTemplate[50] ;
00122 TCHAR szFontStyle[50] ;
00123 #define HDCSCREEN 1
00124 #define HDCPRINTER 2
00125 #define HDCNULL 3
00126 #define HDCINVALID 4
00127 INT nHdcType ;
00128
00129
00130
00131 /* Multithreading stuff */
00132
00133 HANDLE hFontThread1 ;
00134 HANDLE hFontThread2 ;
00135 DWORD  dwFontThreadID1 ;
00136 DWORD  dwFontThreadID2 ;
00137 DWORD  dwFontThreadParm1 ;
00138 DWORD  dwFontThreadParm2 ;
00139 DWORD  FontThreadProc1(LPDWORD) ;
00140 DWORD  FontThreadProc2(LPDWORD) ;
00141 HWND hwndMainFont ;
00142 int    nOpenFontDialogCount ;
00143 CHOOSEFONT cfThread1 ;
00144 CHOOSEFONT cfThread2 ;
00145 void MultiThreadFontDlg(void) ;
00146 void EnableFontButtons(HWND, BOOL) ;
00147
00148
00149
00150
00151 /************************************************************************
00152
00153   Function: DoFontDlg(HWND)
00154
00155   Purpose:
00156
00157     To create the CDTEST's font dialog
00158
00159   Returns: Nothing.
00160
00161   Comments:
00162
00163
00164 ************************************************************************/
00165
00166 void DoFontDialog(HWND hwnd)
00167 {
00168
00169
00170   DialogBox(hInst, MAKEINTRESOURCE(ID_FONTDIALOG),
00171             hwnd, FontProc) ;
00172
00173 }
00174
00175
00176
00177
00178
00179
00180
00181 /************************************************************************
00182
00183   Function: FontProc(HWND, UINT, WPARAM, LPARAM)
00184
00185   Purpose:
00186
00187     Callback function for CDTEST's font dialog.
00188
00189   Returns: TRUE or FALSE depending on the situation.
00190
00191   Comments:
00192
00193
00194 ************************************************************************/
00195
00196
00197 INT_PTR APIENTRY FontProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00198 {
00199   BOOL b ;
00200   TCHAR szNum[30] ;
00201
00202   switch (msg)
00203   {
00204     case WM_INITDIALOG:
00205
00206         InitLogFontStruct(hwnd, &lf) ;   //fill (struct lf) so the choosefont
00207         InitFontStruct(hwnd, &cf) ;      //struct can use it
00208         FillFontDlg(hwnd, &cf) ;
00209
00210         CheckRadioButton(hwnd, ID_HDCSCREEN, ID_HDCPRINTER, ID_HDCSCREEN) ;
00211         nHdcType = HDCSCREEN ;
00212
00213         dwFontFlag = cf.Flags ;
00214
00215         FillFontsBox(hwnd, dwFontFlag) ;
00216
00217         ResetCheckBoxes(hwnd) ;
00218
00219         *(&cfThread1) = *(&cfThread2) = *(&cf) ;
00220
00221         hwndMainFont = hwnd ;
00222         nOpenFontDialogCount = 0 ;
00223
00224         SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEF)) ;
00225
00226         break ;
00227
00228
00229     case UMSG_DECREMENTDLGCOUNT:  // user defined message.  This is send by
00230                                   // the functions that are executing when
00231                                   // a new thread is created.  When these
00232                                   // Thread functions end, they should send
00233                                   // this message.
00234
00235       nOpenFontDialogCount-- ;
00236
00237       if (nOpenFontDialogCount == 0)
00238         EnableFontButtons(hwnd, TRUE) ;
00239
00240       break ;
00241
00242
00243     case WM_CF_LF:
00244
00245        /* If this message comes in, we know that the user clicked the
00246           button that tells the ChooseFont() dialog to tell the parent
00247           to send the WM_CHOOSEFONT_GETLOGFONT message.  So what we will
00248           do is send the message and then show the user what was in the
00249           logfont by calling creating the Logfont dialog box */
00250
00251
00252        SendMessage((HWND) lParam, WM_CHOOSEFONT_GETLOGFONT,
00253                    0, (LPARAM) &lfWM_CF_LF) ;
00254
00255        bLogFontParam = TRUE ; //tells us if we are doing normal logfont
00256                               //processing or answering the WM_CF_LF message.
00257
00258        DialogBoxParam(hInst, MAKEINTRESOURCE(ID_LOGFONTDIALOG),
00259                       (HWND) lParam, LogFontProc, (LPARAM) &lf) ;
00260
00261        bLogFontParam = FALSE ;
00262
00263        break ;
00264
00265
00266     case WM_COMMAND:
00267     {
00268         switch (LOWORD(wParam))
00269         {
00270           case IDOK:
00271             DoChooseFontStuff(hwnd, &cf) ;  //create the dialog.
00272             break ;
00273
00274           case IDCANCEL:
00275             EndDialog(hwnd, FALSE) ;
00276             break ;
00277
00278           case ID_RESETFONT:
00279
00280             InitLogFontStruct(hwnd, &lf) ;  //reset all the structures.
00281             InitFontStruct(hwnd, &cf) ;
00282             FillFontDlg(hwnd, &cf) ;        //refill the dialog.
00283
00284             CheckRadioButton(hwnd, ID_HDCSCREEN, ID_HDCPRINTER, ID_HDCSCREEN) ;
00285             nHdcType = HDCSCREEN ;
00286
00287             SendDlgItemMessage(hwnd, ID_NULLSTRUCTFONT, BM_SETCHECK, (WPARAM) 0, (LPARAM)0) ;
00288             SendDlgItemMessage(hwnd, ID_PRELOADEDFONT,  BM_SETCHECK, (WPARAM) 0, (LPARAM)0) ;
00289
00290             dwFontFlag = cf.Flags ;
00291             FillFontsBox(hwnd, dwFontFlag) ;
00292             ResetCheckBoxes(hwnd) ;
00293
00294             SetFocus(GetDlgItem(hwnd, ID_STRUCTSIZEF)) ;
00295
00296             break ;
00297
00298
00299           case ID_HDCSCREEN:
00300             nHdcType = HDCSCREEN ;
00301             break ;
00302
00303           case ID_HDCPRINTER:
00304             nHdcType = HDCPRINTER ;
00305             break ;
00306
00307           case ID_HDCNULL:
00308             nHdcType = HDCNULL ;
00309             break ;
00310
00311           case ID_HDCINVALID:
00312             nHdcType = HDCINVALID ;
00313             break ;
00314
00315           case ID_EDITLOGFONT:
00316
00317             /* Get the address of the logfont and then show the user what
00318                is in it with the Logfont dialog box */
00319
00320             GetDlgItemText(hwnd, ID_LOGFONTF, szNum, 30) ;
00321             cf.lpLogFont = (LPLOGFONT) MyAtol(szNum, uMode==IDM_HEXMODE, &b) ;
00322
00323             DialogBox(hInst, MAKEINTRESOURCE(ID_LOGFONTDIALOG),
00324                       hwnd, LogFontProc) ;
00325             break ;
00326
00327
00328           case F_TTONLY:
00329           case F_ANSIONLY:
00330           case F_PRINTERFONTS:
00331           case F_SCREENFONTS:
00332           case F_FIXEDPITCHONLY:
00333           case F_NOOEMFONTS:
00334           case F_NOVECTORFONTS:
00335           case F_SCALABLEONLY:
00336           case F_WYSIWYG:
00337             HandleFontCheckBox(hwnd, LOWORD(wParam)) ;
00338             break ;
00339
00340
00341           case ID_MULTITHREADFONT:
00342
00343             /* Set the dialog count to 2, disable the buttons in CDTEST's font
00344                dialog so the user can't do anything until last dialog has
00345                been terminated */
00346
00347             nOpenFontDialogCount = 2 ;
00348
00349             EnableFontButtons(hwndMainFont, FALSE) ;
00350
00351             /* And then do the multithreading */
00352
00353             MultiThreadFontDlg() ;
00354
00355             break ;
00356
00357
00358           default: break ;
00359         }
00360     }
00361
00362     default:
00363
00364       /*
00365          If the help button is pressed in the ChooseFont()
00366          dialog, it will send a message Registered with RegisterWindowMessage()
00367          to the parent window.  The message nHelpMessage was registered
00368          at application startup
00369
00370          It must be detected with an IF statement because the value
00371          returned by RegisterWindowMessage() is not a constant
00372       */
00373
00374       if (msg == nHelpMessage)
00375         MessageBox(GetForegroundWindow(), TEXT("Hello from the help button"),
00376                    TEXT("Font Help Button"), MB_OK | MB_APPLMODAL) ;
00377       break ;
00378   }
00379
00380   return FALSE ;
00381 }
00382
00383
00384
00385
00386
00387
00388
00389
00390 /************************************************************************
00391
00392   Function: InitFontStruct(HWND, LPCHOOSEFONT)
00393
00394   Purpose:
00395
00396     Fill the CHOOSEFONT structure passed as the second parameter with
00397     some default values.
00398
00399   Returns: Nothing.
00400
00401   Comments:
00402
00403
00404 ************************************************************************/
00405
00406 void InitFontStruct(HWND hwnd, LPCHOOSEFONT pcf)
00407 {
00408   pcf->lStructSize = sizeof(CHOOSEFONT) ;
00409   pcf->hwndOwner = hwnd ;
00410   pcf->hDC = (HDC) 0 ;
00411   pcf->lpLogFont = &lf ;
00412   pcf->iPointSize = 24 ;
00413   pcf->Flags = CF_EFFECTS | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT | CF_SHOWHELP | CF_APPLY ;
00414   pcf->rgbColors = RGB(0, 255, 0) ;
00415   pcf->lCustData = 0L ;
00416   pcf->lpfnHook = FontHookProc ;
00417
00418   lstrcpyn(szFontTemplate, TEXT("fonttemp"), ARRAYSIZE(szFontTemplate)) ;
00419   pcf->lpTemplateName = szFontTemplate ;
00420
00421   pcf->hInstance = (HANDLE) hInst ;
00422
00423   lstrcpyn(szFontStyle, TEXT("Bold"), ARRAYSIZE(szFontStyle)) ;
00424   pcf->lpszStyle = szFontStyle ;
00425
00426   pcf->nFontType = SCREEN_FONTTYPE ;
00427
00428   pcf->nSizeMin = 8 ;
00429   pcf->nSizeMax = 50 ;
00430 }
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441 /************************************************************************
00442
00443   Function: FillFontDlg(HWND, LPCHOOSEFONT)
00444
00445   Purpose:
00446
00447     Fill CDTEST's font dialog with the values in the CHOOSEFONT structure
00448     passed via the second parameter.
00449
00450   Returns: Nothing.
00451
00452   Comments:
00453
00454
00455 ************************************************************************/
00456
00457 void FillFontDlg(HWND hwnd, LPCHOOSEFONT pcf)
00458 {
00459   wsprintf(szTemp, szLongFilter, pcf->lStructSize) ;
00460   SetDlgItemText(hwnd, ID_STRUCTSIZEF, szTemp) ;
00461
00462   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hwndOwner) ;
00463   SetDlgItemText(hwnd, ID_HWNDOWNERF, szTemp) ;
00464
00465   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hDC) ;
00466   SetDlgItemText(hwnd, ID_HDCF, szTemp) ;
00467
00468   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hDC) ;
00469   SetDlgItemText(hwnd, ID_HDCF, szTemp) ;
00470
00471   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->lpLogFont) ;
00472   SetDlgItemText(hwnd, ID_LOGFONTF, szTemp) ;
00473
00474   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->iPointSize) ;
00475   SetDlgItemText(hwnd, ID_POINTSIZEF, szTemp) ;
00476
00477   wsprintf(szTemp, szLongFilter, pcf->Flags) ;
00478   SetDlgItemText(hwnd, ID_FLAGSF, szTemp) ;
00479
00480   wsprintf(szTemp, szLongFilter, pcf->rgbColors) ;
00481   SetDlgItemText(hwnd, ID_RGBCOLORSF, szTemp) ;
00482
00483   wsprintf(szTemp, szLongFilter, pcf->lCustData) ;
00484   SetDlgItemText(hwnd, ID_CUSTDATAF, szTemp) ;
00485
00486   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->lpfnHook) ;
00487   SetDlgItemText(hwnd, ID_HOOKF, szTemp) ;
00488
00489   SetDlgItemText(hwnd, ID_TEMPLATEF, pcf->lpTemplateName) ;
00490
00491   wsprintf(szTemp, szPointerFilter, (DWORD_PTR) pcf->hInstance) ;
00492   SetDlgItemText(hwnd, ID_HINSTANCEF, szTemp) ;
00493
00494   SetDlgItemText(hwnd, ID_STYLEF, pcf->lpszStyle) ;
00495
00496   wsprintf(szTemp, szLongFilter, (int) pcf->nFontType) ;
00497   SetDlgItemText(hwnd, ID_FONTTYPEF, szTemp) ;
00498
00499   wsprintf(szTemp, szLongFilter, (int) pcf->nSizeMin) ;
00500   SetDlgItemText(hwnd, ID_SIZEMINF, szTemp) ;
00501
00502   wsprintf(szTemp, szLongFilter, (int) pcf->nSizeMax) ;
00503   SetDlgItemText(hwnd, ID_SIZEMAXF, szTemp) ;
00504
00505 }
00506
00507
00508
00509
00510
00511
00512
00513 /************************************************************************
00514
00515   Function: GetFontDlg(HWND, LPCHOOSEFONT)
00516
00517   Purpose:
00518
00519     Retrieve the users edits from CDTEST's font dialog and put them
00520     in the CHOOSEFONT structure passed in as the second parameter
00521
00522   Returns: Nothing.
00523
00524   Comments:
00525
00526
00527 ************************************************************************/
00528
00529 void GetFontDlg(HWND hwnd, LPCHOOSEFONT pcf)
00530 {
00531   BOOL b ;
00532   TCHAR szNum[30] ;
00533
00534 #define WSIZEFO 30
00535
00536   GetDlgItemText(hwnd, ID_STRUCTSIZEF, szNum, WSIZEFO) ;
00537   pcf->lStructSize = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00538
00539   GetDlgItemText(hwnd, ID_HWNDOWNERF, szNum, WSIZEFO) ;
00540   pcf->hwndOwner = (HWND) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00541
00542   GetDlgItemText(hwnd, ID_LOGFONTF, szNum, WSIZEFO) ;
00543   pcf->lpLogFont = (LPLOGFONT) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00544
00545   GetDlgItemText(hwnd, ID_POINTSIZEF, szNum, WSIZEFO) ;
00546   pcf->iPointSize = (int) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00547
00548   GetDlgItemText(hwnd, ID_FLAGSF, szNum, WSIZEFO) ;
00549   pcf->Flags = (DWORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00550
00551   GetDlgItemText(hwnd, ID_RGBCOLORSF, szNum, WSIZEFO) ;
00552   pcf->rgbColors = (COLORREF) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00553
00554   GetDlgItemText(hwnd, ID_CUSTDATAF, szNum, WSIZEFO) ;
00555   pcf->lCustData = MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00556
00557   GetDlgItemText(hwnd, ID_HOOKF, szNum, WSIZEFO) ;
00558   pcf->lpfnHook = (LPCFHOOKPROC) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00559
00560   GetDlgItemText(hwnd, ID_TEMPLATEF, szFontTemplate, 50) ;
00561
00562   GetDlgItemText(hwnd, ID_HINSTANCEF, szNum, WSIZEFO) ;
00563   pcf->hInstance = (HANDLE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00564
00565   GetDlgItemText(hwnd, ID_STYLEF, szFontStyle, 50) ;
00566
00567   GetDlgItemText(hwnd, ID_FONTTYPEF, szNum, WSIZEFO) ;
00568   pcf->nFontType = (WORD) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00569
00570   GetDlgItemText(hwnd, ID_SIZEMINF, szNum, WSIZEFO) ;
00571   pcf->nSizeMin = (int) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00572
00573   GetDlgItemText(hwnd, ID_SIZEMAXF, szNum, WSIZEFO) ;
00574   pcf->nSizeMax = (int) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00575 }
00576
00577
00578
00579
00580
00581
00582
00583 /************************************************************************
00584
00585   Function: GetHdc(HWND, int)
00586
00587   Purpose:
00588
00589     Creates and returns an HDC of the type specified.
00590
00591
00592   Returns: The HDC that it creates.
00593
00594
00595   Comments:
00596
00597     The NULL and INVALID HDCs are only useful to test if the common dialogs
00598     handle an HDC that is not useful, but this function is also necessary
00599     in that the HDC must be a printer HDC if ChooseFont() is called
00600     with the CF_PRINTERFONTS flag bit set.
00601
00602     To tell ChooseFont() to list only printer fonts:
00603
00604     1.  Set the HDC in CDTEST's font dialog to "Printer"
00605
00606     2.  Set the "Flags" edit box CF_PRINTERFONTS
00607
00608
00609 ************************************************************************/
00610
00611
00612
00613 HDC GetHdc(HWND hwnd, int nType)
00614 {
00615   switch (nType)
00616   {
00617     case HDCSCREEN:
00618         return GetDC(hwnd) ;
00619         break ;
00620
00621     case HDCNULL:
00622         return (HDC) 0 ;
00623         break ;
00624
00625     case HDCINVALID:
00626         return (HDC) 999 ;
00627         break ;
00628
00629     case HDCPRINTER:
00630
00631         /* To get the HDC of the current printer, fill out a PRINTDLG
00632            structure, and set it's flags to (PD_RETURNDC | PD_RETURNDEFAULT).
00633            This will tell PrintDlg() to create you an HDC but not show
00634            the Print dialog box. */
00635
00636         pfd.lStructSize = sizeof(PRINTDLG) ;
00637         pfd.hwndOwner = hwnd ;
00638         pfd.hDevMode = (HANDLE) 0 ;
00639         pfd.hDevNames = (HANDLE) 0 ;
00640         pfd.Flags = PD_RETURNDC | PD_RETURNDEFAULT ;   //just get default printer
00641         pfd.nFromPage = 0 ;
00642         pfd.nToPage = 0 ;
00643         pfd.nMinPage = 0 ;
00644         pfd.nMaxPage = 0 ;
00645         pfd.nCopies = 0 ;
00646         pfd.hInstance = (HANDLE) hInst ;
00647
00648         if (PrintDlg(&pfd) == 0)
00649             MessageBox(hwnd, TEXT("Error: Could not create a printer DC!"),
00650                        (LPTSTR) NULL, MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;
00651         else
00652            return pfd.hDC ;
00653
00654         break ;
00655
00656     default:
00657         break ;
00658   }
00659   return (HDC) 0 ;
00660 }
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670 /************************************************************************
00671
00672   Function: LogFontProc(HWND, int, WPARAM, LPARAM)
00673
00674   Purpose:
00675
00676     The callback proc for the LogFont dialog box
00677
00678
00679   Returns: BOOL -- depending on the situation.
00680
00681
00682   Comments:
00683
00684 ************************************************************************/
00685
00686
00687 INT_PTR APIENTRY LogFontProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00688 {
00689   switch (msg)
00690   {
00691     case WM_INITDIALOG:
00692         FillLogFontDlg(hwnd, cf.lpLogFont) ;  //start off with the one that
00693                                               //is returned from ChooseFont()
00694         break ;
00695
00696     case WM_COMMAND:
00697         switch(LOWORD(wParam))
00698         {
00699           case IDOK:
00700
00701             GetLogFontDlg(hwnd, &lf) ;
00702
00703             cf.lpLogFont = &lf ;
00704
00705             EndDialog(hwnd, TRUE) ;
00706
00707             break ;
00708
00709
00710
00711           case ID_RESETLF:
00712
00713             SetFocus(GetDlgItem(hwnd, ID_LFHEIGHT)) ;
00714
00715             InitLogFontStruct(hwnd, &lf) ;
00716
00717             FillLogFontDlg(hwnd, &lf) ;
00718
00719             break ;
00720
00721
00722           case IDCANCEL:
00723
00724             EndDialog(hwnd, FALSE) ;
00725
00726             break ;
00727
00728
00729           default:
00730             break ;
00731         }
00732
00733     default: break ;
00734   }
00735
00736
00737   return FALSE ;
00738 }
00739
00740
00741
00742
00743
00744
00745
00746 /************************************************************************
00747
00748   Function: InitLogFontStruct(HWND, LPLOGFONT)
00749
00750   Purpose:
00751
00752     Fills the LOGFONT structure passed in as the second parameter with
00753     some default values.
00754
00755   Returns: Nothing.
00756
00757   Comments:
00758
00759 ************************************************************************/
00760
00761 void InitLogFontStruct(HWND hwnd, LPLOGFONT plf)
00762 {
00763   plf->lfHeight = 24 ;
00764   plf->lfWidth  = 20 ;
00765   plf->lfEscapement = 0 ;
00766   plf->lfOrientation = 10 ;
00767   plf->lfWeight = 400 ;
00768   plf->lfItalic = FALSE ;
00769   plf->lfUnderline = FALSE ;
00770   plf->lfStrikeOut = FALSE ;
00771   plf->lfCharSet = ANSI_CHARSET ;
00772   plf->lfOutPrecision = OUT_DEFAULT_PRECIS ;
00773   plf->lfClipPrecision = CLIP_DEFAULT_PRECIS ;
00774   plf->lfQuality = DEFAULT_QUALITY ;
00775   plf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE ;
00776
00777   szFaceName[0] = (TCHAR) 0 ;
00778   lstrcpyn(plf->lfFaceName, szFaceName, ARRAYSIZE(plf->lfFaceName)) ;
00779 }
00780
00781
00782
00783
00784
00785
00786 /************************************************************************
00787
00788   Function: FillLogFontDlg(HWND, LPLOGFONT)
00789
00790   Purpose:
00791
00792     Fills CDTEST's logfont dialog with the values in the logfont that
00793     is passed in as the second parameter.
00794
00795   Returns: Nothing.
00796
00797   Comments:
00798
00799 ************************************************************************/
00800
00801 void FillLogFontDlg(HWND hwnd, LPLOGFONT plf)
00802 {
00803   TCHAR szTemp[50] ;
00804
00805   LPLOGFONT pl = plf ;
00806
00807   if (bLogFontParam)    //Are creating this dialog in response to the
00808     pl = &lfWM_CF_LF ;  //WM_CHOOSEFONT_GETLOGFONT message ?
00809
00810   if (!pl)              //Avert a ghastly exception error
00811     return ;
00812
00813   wsprintf(szTemp, szLongFilter, pl->lfHeight) ;
00814   SetDlgItemText(hwnd, ID_LFHEIGHT, szTemp) ;
00815
00816   wsprintf(szTemp, szLongFilter, pl->lfWidth) ;
00817   SetDlgItemText(hwnd, ID_LFWIDTH, szTemp) ;
00818
00819   wsprintf(szTemp, szLongFilter, pl->lfEscapement) ;
00820   SetDlgItemText(hwnd, ID_LFESCAPEMENT, szTemp) ;
00821
00822   wsprintf(szTemp, szLongFilter, pl->lfOrientation) ;
00823   SetDlgItemText(hwnd, ID_LFORIENTATION, szTemp) ;
00824
00825   wsprintf(szTemp, szLongFilter, pl->lfWeight) ;
00826   SetDlgItemText(hwnd, ID_LFWEIGHT, szTemp) ;
00827
00828   wsprintf(szTemp, szShortFilter, pl->lfItalic) ;
00829   SetDlgItemText(hwnd, ID_LFITALIC, szTemp) ;
00830
00831   wsprintf(szTemp, szShortFilter, pl->lfUnderline) ;
00832   SetDlgItemText(hwnd, ID_LFUNDERLINE, szTemp) ;
00833
00834   wsprintf(szTemp, szShortFilter, pl->lfStrikeOut) ;
00835   SetDlgItemText(hwnd, ID_LFSTRIKEOUT, szTemp) ;
00836
00837   wsprintf(szTemp, szShortFilter, pl->lfCharSet) ;
00838   SetDlgItemText(hwnd, ID_LFCHARSET, szTemp) ;
00839
00840   wsprintf(szTemp, szShortFilter, pl->lfOutPrecision) ;
00841   SetDlgItemText(hwnd, ID_LFOUTP, szTemp) ;
00842
00843   wsprintf(szTemp, szShortFilter, pl->lfClipPrecision) ;
00844   SetDlgItemText(hwnd, ID_LFCLIPP, szTemp) ;
00845
00846   wsprintf(szTemp, szShortFilter, pl->lfQuality) ;
00847   SetDlgItemText(hwnd, ID_LFQUALITY, szTemp) ;
00848
00849   wsprintf(szTemp, szShortFilter, pl->lfPitchAndFamily) ;
00850   SetDlgItemText(hwnd, ID_LFPITCHANDFAM, szTemp) ;
00851
00852   SetDlgItemText(hwnd, ID_LFFACENAME, (LPTSTR) pl->lfFaceName) ;
00853 }
00854
00855
00856
00857
00858
00859
00860 /************************************************************************
00861
00862   Function: GetLogFontDlg(HWND, LPLOGFONT)
00863
00864   Purpose:
00865
00866     Retrieves the users edits in CDTEST's Logfont dialog and puts them
00867     into the LOGFONT struct that is passed as the second parameter.
00868
00869   Returns: Nothing.
00870
00871   Comments:
00872
00873 ************************************************************************/
00874
00875 void GetLogFontDlg(HWND hwnd, LPLOGFONT plf)
00876 {
00877   BOOL b ;
00878   TCHAR szNum[30] ;
00879
00880   if (bLogFontParam)  //if we are just viewing the logfont because we sent a
00881     return ;          //WM_CHOOSEFONT_GETLOGFONT message, don't change the Logfont Struct
00882                       //that ChooseFont() gives us...
00883
00884   #define LFSIZE 30
00885
00886   GetDlgItemText(hwnd, ID_LFHEIGHT, szNum, LFSIZE) ;
00887   plf->lfHeight = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00888
00889   GetDlgItemText(hwnd, ID_LFWIDTH, szNum, LFSIZE) ;
00890   plf->lfWidth = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00891
00892   GetDlgItemText(hwnd, ID_LFESCAPEMENT, szNum, LFSIZE) ;
00893   plf->lfEscapement = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00894
00895   GetDlgItemText(hwnd, ID_LFORIENTATION, szNum, LFSIZE) ;
00896   plf->lfOrientation = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00897
00898   GetDlgItemText(hwnd, ID_LFWEIGHT, szNum, LFSIZE) ;
00899   plf->lfWeight = (LONG) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00900
00901   GetDlgItemText(hwnd, ID_LFITALIC, szNum, LFSIZE) ;
00902   plf->lfItalic = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00903
00904   GetDlgItemText(hwnd, ID_LFUNDERLINE, szNum, LFSIZE) ;
00905   plf->lfUnderline = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00906
00907   GetDlgItemText(hwnd, ID_LFSTRIKEOUT, szNum, LFSIZE) ;
00908   plf->lfStrikeOut = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00909
00910   GetDlgItemText(hwnd, ID_LFCHARSET, szNum, LFSIZE) ;
00911   plf->lfCharSet = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00912
00913   GetDlgItemText(hwnd, ID_LFOUTP, szNum, LFSIZE) ;
00914   plf->lfOutPrecision = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00915
00916   GetDlgItemText(hwnd, ID_LFCLIPP, szNum, LFSIZE) ;
00917   plf->lfClipPrecision = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00918
00919   GetDlgItemText(hwnd, ID_LFQUALITY, szNum, LFSIZE) ;
00920   plf->lfQuality = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00921
00922   GetDlgItemText(hwnd, ID_LFPITCHANDFAM, szNum, LFSIZE) ;
00923   plf->lfPitchAndFamily = (BYTE) MyAtol(szNum, uMode == IDM_HEXMODE, &b) ;
00924
00925   GetDlgItemText(hwnd, ID_LFFACENAME, (LPTSTR) plf->lfFaceName, 32) ;
00926 }
00927
00928
00929
00930
00931
00932
00933
00934
00935 /************************************************************************
00936
00937   Function: FontHookProc(HWND, UINT, WPARAM, LPARAM)
00938
00939   Purpose: The callback function that acts as the hook proc for
00940            the ChooseFont() dialog.
00941
00942
00943   Returns: TRUE to discard the message.  FALSE to send the message on
00944            to the normal dialog processing done by the ChooseFont()
00945            function.
00946
00947   Comments:
00948
00949 ************************************************************************/
00950
00951 UINT_PTR CALLBACK FontHookProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00952 {
00953   LPCHOOSEFONT pCf ;
00954   TCHAR szMsg[50] ;
00955
00956   switch(msg)
00957   {
00958     case WM_INITDIALOG:
00959
00960       pCf = (LPCHOOSEFONT) lParam ;
00961
00962       if (pCf->lCustData != 0L)
00963       {
00964         wsprintf(szMsg, TEXT("CHOOSEFONT->lCustData is: %ld"), pCf->lCustData) ;
00965         MessageBox(hwnd, szMsg, TEXT("lCustData Sent!"), MB_OK) ;
00966       }
00967
00968       SetWindowText(hwnd, TEXT("Font Hook Proc Dialog")) ;
00969
00970       break ;
00971
00972     case WM_COMMAND:
00973
00974         /* NOTE: This button will only be available if the user creates the
00975            ChooseFont() dialog with the CF_ENABLETEMPLATE or CF_ENABLETEMPLATEHANDLE
00976            flag.
00977
00978            This button will only work if the ChooseFont() dialog is created
00979            with the CF_ENABLEHOOK flag.  So, to get full functionality from
00980            this button:
00981
00982            1.  Enter (CF_ENABLEHOOK | CF_ENABLETEMPLATE | CF_SCREENFONTS)
00983                in the "Flags" edit box of CDTEST'S Font dialog.
00984
00985            2.  Click OK
00986         */
00987
00988
00989
00990         /* The parent will send the WM_CHOOSEFONT_GETLOGFONT message and
00991            display it's findings in a LogFont dialog if it gets this message */
00992
00993         if (LOWORD(wParam) == ID_SEND_WM_CF_LF_MSG)
00994           SendMessage(GetParent(hwnd), WM_CF_LF, 0, (LPARAM) hwnd) ;
00995
00996         break ;
00997
00998
00999     default:
01000       break ;
01001   }
01002
01003   return 0 ;   //send msg to the common dialog code
01004 }
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014 /************************************************************************
01015
01016   Function: GetFontDlgHandle(void)
01017
01018   Purpose:  Finds and loads the custom template resource and returns a
01019             handle to it.
01020
01021
01022   Returns: A handle to the custom template resource.
01023
01024   Comments:
01025
01026 ************************************************************************/
01027
01028 HANDLE GetFontDlgHandle(void)
01029 {
01030
01031   hResFont = FindResource(hInst, TEXT("fonttemp"), RT_DIALOG) ;
01032
01033   hDialogFont = LoadResource(hInst, hResFont) ;
01034
01035
01036   return hDialogFont ;
01037 }
01038
01039
01040
01041
01042
01043
01044
01045
01046 /************************************************************************
01047
01048   Function: EnumFontsProc(LPLOGFONT, LPTEXTMETRIC, DWORD, LONG)
01049
01050   Purpose: Acts as a callback function for the EnumFontFamilies()
01051            function.
01052
01053   Returns: 0 if the font enumeration should stop.  1 to ask for the
01054            next font.
01055
01056   Comments:
01057
01058     EnumFontFamilies will find the fonts on the system and call this
01059     function each time it finds a font.  Pointers to the LOGFONT and
01060     TEXTMETRIC structures the describe the font are passed as the first
01061     and second arguments, so we can determine if the fonts we get
01062     meet the specs we want.  If they do, we can add them to the font
01063     list box in CDTEST's Font dialog.
01064
01065     NOTE:
01066
01067     None of this affects the performance of ChooseFont().  This serves
01068     only to illustrate how ChooseFont() finds the fonts you request based
01069     on the flags you pass to the ChooseFont() function.
01070
01071     The fonts found with this function should be the same as the ones
01072     found by ChooseFont() for any flag combination.
01073
01074
01075 ************************************************************************/
01076
01077
01078 int CALLBACK EnumFontsProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
01079                            DWORD dwStyle, LPARAM lParam)
01080 {
01081   LRESULT i ;
01082
01083   /* check to see if the font is already there right off the bat
01084      and just continue the enumeration if it is...        */
01085
01086
01087   i = SendDlgItemMessage((HWND) lParam, ID_FONTLIST, LB_FINDSTRINGEXACT, (WPARAM) 0,
01088                          (LPARAM) (LPTSTR) lplf->lfFaceName) ;
01089
01090   if (i != LB_ERR)
01091   {
01092     if (bScreen)     //if we are adding it for the first time
01093       return 1 ;
01094
01095     //else, we are adding printer fonts, so if we find one that is already there
01096     //it must be available for both the printer and the screen...
01097
01098     else
01099     {
01100       SendDlgItemMessage((HWND) lParam, ID_FONTLIST, LB_SETITEMDATA, i,
01101                           FONT_TYPE_WYSIWYG) ;
01102       return 1 ;
01103     }
01104   }
01105
01106
01107   //Get rid of any fonts that we don't want...
01108
01109   if ((dwFontFlag & CF_TTONLY) && (!(dwStyle & TRUETYPE_FONTTYPE)))
01110     return 1 ;
01111
01112   if ((dwFontFlag & CF_SCALABLEONLY) && (dwStyle & RASTER_FONTTYPE))
01113     return 1 ;
01114
01115   if ((dwFontFlag & CF_ANSIONLY) && (lplf->lfCharSet != ANSI_CHARSET))
01116     return 1 ;
01117
01118   if ((dwFontFlag & CF_FIXEDPITCHONLY) && (lplf->lfPitchAndFamily & VARIABLE_PITCH))
01119     return 1 ;
01120
01121   if ((dwFontFlag & CF_NOVECTORFONTS) && (lplf->lfCharSet == OEM_CHARSET))
01122     return 1 ;
01123
01124
01125   //if there is a font to be added, add it.
01126
01127   if (*(lplf->lfFaceName))
01128     SendDlgItemMessage((HWND) lParam, ID_FONTLIST, LB_ADDSTRING,
01129                      (WPARAM) 0, (LPARAM) (LPTSTR) lplf->lfFaceName) ;
01130
01131   return 1 ;
01132 }
01133
01134
01135
01136
01137
01138
01139
01140
01141 /************************************************************************
01142
01143   Function: FillFontsBox(HWND, DWORD)
01144
01145   Purpose: Enumerates all fonts on the system and sends the ones that
01146            meet the criteria of the dwFlags parameter (CF_SCREENFONTS,
01147            CF_SCALABLEONLY, etc).
01148
01149   Returns: Nothing.
01150
01151   Comments:
01152
01153
01154 ************************************************************************/
01155
01156 void FillFontsBox(HWND hwnd, DWORD dwFlags)
01157 {
01158   HDC hdc ;
01159   HWND hwndControl ;
01160   LRESULT dwData ;
01161   LRESULT nItemCount ;
01162
01163
01164   /* Empty the list box, and turn of the redraw because we may need
01165      to remove some fonts after they are added if the user calls this
01166      function with the CF_WYSIWYG flag bit set. */
01167
01168   SendDlgItemMessage(hwnd, ID_FONTLIST, LB_RESETCONTENT, (WPARAM)0, (LPARAM) 0) ;
01169
01170   hwndControl = GetDlgItem(hwnd, ID_FONTLIST) ;
01171
01172   SendMessage(hwndControl, WM_SETREDRAW, FALSE, 0L) ;
01173
01174
01175   /* Now call EnumFontFamilies() for each type of HDC requested */
01176
01177   if (dwFlags & CF_SCREENFONTS)
01178   {
01179     bScreen = TRUE ;
01180     hdc = GetHdc(hwnd, HDCSCREEN) ;
01181     EnumFontFamilies(hdc, (LPTSTR) NULL, (FONTENUMPROC) EnumFontsProc, (LONG_PTR) hwnd) ;
01182     ReleaseDC(hwnd, hdc) ;
01183   }
01184
01185   if (dwFlags & CF_PRINTERFONTS)
01186   {
01187     bScreen = FALSE ;
01188     hdc = GetHdc(hwnd, HDCPRINTER) ;
01189     EnumFontFamilies(hdc, (LPTSTR) NULL, (FONTENUMPROC) EnumFontsProc, (LONG_PTR) hwnd) ;
01190     ReleaseDC(hwnd, hdc) ;
01191   }
01192
01193
01194   /* Special case:  If the CF_WYSIWYG flag is used, we have to enumerate
01195      the fonts in both HDCs and then remove all the ones that are not
01196      both printer fonts and screen fonts. */
01197
01198   if (dwFontFlag & CF_WYSIWYG)
01199   {
01200     nItemCount = SendDlgItemMessage(hwnd, ID_FONTLIST, LB_GETCOUNT, 0, 0L) ;
01201
01202     nItemCount-- ;   //the list is zero based
01203
01204     while (nItemCount >= 0)
01205     {
01206       dwData = SendDlgItemMessage(hwnd, ID_FONTLIST, LB_GETITEMDATA, nItemCount, 0L) ;
01207
01208       if (dwData != FONT_TYPE_WYSIWYG)
01209       {
01210         SendDlgItemMessage(hwnd, ID_FONTLIST, LB_DELETESTRING, nItemCount, 0L) ;
01211       }
01212
01213       nItemCount-- ;
01214     }
01215   }
01216
01217
01218   /* Now redraw the font list */
01219
01220   SendMessage(hwndControl, WM_SETREDRAW, TRUE, 0L) ;
01221   InvalidateRect(hwndControl, NULL, FALSE) ;
01222
01223   return ;
01224 }
01225
01226
01227
01228
01229
01230
01231 /************************************************************************
01232
01233   Function: ResetCheckBoxes(HWND)
01234
01235   Purpose: Checks the checkboxes that control what fonts are listed in
01236            CDTEST's font list box.
01237
01238   Returns: Nothing.
01239
01240   Comments:
01241
01242
01243 ************************************************************************/
01244
01245 void ResetCheckBoxes(HWND hwnd)
01246 {
01247
01248   SendDlgItemMessage(hwnd, F_TTONLY,          BM_SETCHECK, dwFontFlag & CF_TTONLY         ? 1 : 0, (LPARAM)0) ;
01249   SendDlgItemMessage(hwnd, F_ANSIONLY,        BM_SETCHECK, dwFontFlag & CF_ANSIONLY       ? 1 : 0, (LPARAM)0) ;
01250   SendDlgItemMessage(hwnd, F_SCREENFONTS,     BM_SETCHECK, dwFontFlag & CF_SCREENFONTS    ? 1 : 0, (LPARAM)0) ;
01251   SendDlgItemMessage(hwnd, F_PRINTERFONTS,    BM_SETCHECK, dwFontFlag & CF_PRINTERFONTS   ? 1 : 0, (LPARAM)0) ;
01252   SendDlgItemMessage(hwnd, F_NOOEMFONTS,      BM_SETCHECK, dwFontFlag & CF_NOOEMFONTS     ? 1 : 0, (LPARAM)0) ;
01253   SendDlgItemMessage(hwnd, F_NOVECTORFONTS,   BM_SETCHECK, dwFontFlag & CF_NOVECTORFONTS  ? 1 : 0, (LPARAM)0) ;
01254   SendDlgItemMessage(hwnd, F_SCALABLEONLY,    BM_SETCHECK, dwFontFlag & CF_SCALABLEONLY   ? 1 : 0, (LPARAM)0) ;
01255   SendDlgItemMessage(hwnd, F_WYSIWYG,         BM_SETCHECK, dwFontFlag & CF_WYSIWYG        ? 1 : 0, (LPARAM)0) ;
01256   SendDlgItemMessage(hwnd, F_FIXEDPITCHONLY,  BM_SETCHECK, dwFontFlag & CF_FIXEDPITCHONLY ? 1 : 0, (LPARAM)0) ;
01257
01258 }
01259
01260
01261
01262
01263
01264
01265 /************************************************************************
01266
01267   Function: HandleFontCheckBox(HWND)
01268
01269   Purpose: If the user clicks one of the fonts in the CDTEST's list of
01270            valid font types, this function will check the correct boxes
01271            and set the correct values in the flag which keeps track of
01272            which fonts are to be enumerated and added to CDTEST's font
01273            list box.
01274
01275
01276   Returns: Nothing.
01277
01278   Comments:
01279
01280     CF_NOOEMFONTS and CF_NOVECTORFONTS are identical.
01281
01282
01283 ************************************************************************/
01284
01285 void HandleFontCheckBox(HWND hwnd, int nID)
01286 {
01287   DWORD dwTemp ;
01288
01289   dwTemp = dwFontFlag ;
01290
01291   switch (nID)
01292   {
01293     case F_TTONLY:
01294
01295       /* TTONLY is a special case.  If we only want Truetype fonts,
01296          turn off irrelevant flags */
01297
01298       if (!(dwFontFlag & CF_TTONLY)) //if we're turning this flag on...
01299       {
01300         dwFontFlag = 0L ;  //turn everyone off but the following:
01301
01302         dwFontFlag |= CF_TTONLY ;
01303
01304         if (dwTemp & CF_ANSIONLY)
01305           dwFontFlag |= CF_ANSIONLY ;
01306
01307         if (dwTemp & CF_FIXEDPITCHONLY)
01308           dwFontFlag |= CF_FIXEDPITCHONLY ;
01309
01310         if (dwTemp & CF_SCREENFONTS)
01311           dwFontFlag |= CF_SCREENFONTS ;
01312
01313         if (dwTemp & CF_PRINTERFONTS)
01314           dwFontFlag |= CF_PRINTERFONTS ;
01315       }
01316       else
01317       {
01318         dwFontFlag ^= CF_TTONLY ;
01319       }
01320
01321
01322       break ;
01323
01324     case F_ANSIONLY:
01325       dwFontFlag ^= CF_ANSIONLY ;        //otherwise toggle the bit.
01326       dwFontFlag &= ~CF_WYSIWYG ;
01327
01328       break ;
01329
01330     case F_PRINTERFONTS:
01331       dwFontFlag ^= CF_PRINTERFONTS ;
01332
01333       break ;
01334
01335     case F_SCREENFONTS:
01336       dwFontFlag ^= CF_SCREENFONTS ;
01337
01338       break ;
01339
01340     case F_FIXEDPITCHONLY:
01341       dwFontFlag ^= CF_FIXEDPITCHONLY ;
01342
01343       break ;
01344
01345     case F_NOOEMFONTS:
01346       dwFontFlag ^= CF_NOOEMFONTS ;
01347
01348       break ;
01349
01350     case F_NOVECTORFONTS:
01351       dwFontFlag ^= CF_NOVECTORFONTS ;
01352
01353       break ;
01354
01355     case F_SCALABLEONLY:
01356       dwFontFlag ^= CF_SCALABLEONLY ;
01357
01358       break ;
01359
01360     case F_WYSIWYG:                        //We want fonts for both the
01361                                            //screen and the printer...
01362       dwFontFlag ^= CF_WYSIWYG ;
01363
01364       if (dwFontFlag & CF_WYSIWYG)
01365         dwFontFlag |= (CF_SCREENFONTS | CF_PRINTERFONTS | CF_SCALABLEONLY) ;
01366
01367       break ;
01368
01369     default: break ;
01370   }
01371
01372   ResetCheckBoxes(hwnd) ;
01373   FillFontsBox(hwnd, dwFontFlag) ;
01374 }
01375
01376
01377
01378
01379
01380
01381
01382 /************************************************************************
01383
01384   Function: DoChooseFontStuff(HWND, LPCHOOSEFONT)
01385
01386   Purpose:
01387
01388     Calls the ChooseFont() function.
01389
01390   Returns: Nothing.
01391
01392   Comments:
01393
01394
01395 ************************************************************************/
01396
01397
01398 void DoChooseFontStuff(HWND hwnd, LPCHOOSEFONT pcf)
01399 {
01400   BOOL bRet = FALSE ;
01401
01402   if (IsDlgButtonChecked(hwnd, ID_PRELOADEDFONT) == 1)
01403   {
01404     pcf->hInstance = GetFontDlgHandle() ;
01405     wsprintf(szTemp, szLongFilter, pcf->hInstance) ;
01406     SetDlgItemText(hwnd, ID_HINSTANCEF, szTemp) ;
01407   }
01408
01409   pcf->hDC = GetHdc(hwnd, nHdcType) ;
01410
01411   wsprintf(szTemp, szLongFilter, pcf->hDC) ;
01412   SetDlgItemText(hwnd, ID_HDCF, szTemp) ;
01413
01414
01415   GetFontDlg(hwnd, pcf) ;
01416
01417
01418   if (IsDlgButtonChecked(hwnd, ID_NULLSTRUCTFONT) == 1)
01419     bRet = ChooseFont((LPCHOOSEFONT)NULL) ;
01420   else
01421     bRet = ChooseFont(pcf) ;
01422
01423   wsprintf(szTemp, szLongFilter, CommDlgExtendedError()) ;
01424   SetDlgItemText(hwnd, ID_ERRORF, szTemp) ;
01425
01426   if (pcf->hDC)
01427   {
01428     ReleaseDC(hwnd, pcf->hDC) ;   //free the HDC that we used if we called
01429     pcf->hDC = (HDC) 0 ;          //the function with a valid HDC.
01430   }
01431
01432   if (hDialogFont)
01433   {
01434     FreeResource(hDialogFont) ;
01435     hDialogFont = (HANDLE) 0 ;
01436     hResFont = (HANDLE) 0 ;
01437   }
01438
01439   wsprintf(szTemp, szShortFilter, bRet) ;     //fill results into the Font dlg
01440   SetDlgItemText(hwnd, ID_RETURNF, szTemp) ;
01441
01442   FillFontDlg(hwnd, pcf) ;
01443 }
01444
01445
01446
01447
01448
01449
01450 /************************************************************************
01451
01452   Function: FontThreadProc1(LPDWORD)
01453
01454   Purpose:
01455
01456     Acts as the starting address for thread 1
01457
01458   Returns: Any DWORD value.
01459
01460   Comments:
01461
01462
01463 ************************************************************************/
01464
01465 DWORD FontThreadProc1(LPDWORD pdw)
01466 {
01467   DoChooseFontStuff(hwndMainFont, &cfThread1) ;
01468
01469   PostMessage(hwndMainFont, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;
01470
01471   return 0L ;
01472 }
01473
01474
01475
01476
01477
01478
01479
01480 /************************************************************************
01481
01482   Function: FontThreadProc2(LPDWORD)
01483
01484   Purpose:
01485
01486     Acts as the starting address for thread 2
01487
01488   Returns: Any DWORD value.
01489
01490   Comments:
01491
01492
01493 ************************************************************************/
01494
01495
01496 DWORD FontThreadProc2(LPDWORD pdw)
01497 {
01498   DoChooseFontStuff(hwndMainFont, &cfThread2) ;
01499
01500   PostMessage(hwndMainFont, UMSG_DECREMENTDLGCOUNT, 0, 0L ) ;
01501
01502   return 0L ;
01503 }
01504
01505
01506
01507
01508
01509
01510
01511 /************************************************************************
01512
01513   Function: MultiThreadFontDlg(void)
01514
01515   Purpose:
01516
01517     Create the two threads that will in turn create two ChooseFont()
01518     dialogs.
01519
01520   Returns: Nothing.
01521
01522   Comments:
01523
01524     Multithreading note:
01525
01526     This function will return before the common dialog functions return.
01527     Therefore, do not pass any parameters to this function that will be
01528     referenced by the common dialogs because as soon as this function
01529     ends those parameters will be gone.
01530
01531 ************************************************************************/
01532
01533 void MultiThreadFontDlg(void)
01534 {
01535
01536   dwFontThreadParm1 = dwFontThreadParm2 = 0L ;
01537
01538   if (!(hFontThread1 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
01539                                      (LPTHREAD_START_ROUTINE) FontThreadProc1,
01540                                      &dwFontThreadParm1, CREATE_SUSPENDED, &dwFontThreadID1)))
01541
01542   {
01543     MessageBox(GetForegroundWindow(), TEXT("Error creating thread 1"), NULL,
01544                MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;
01545
01546     nOpenFontDialogCount = 0 ;
01547
01548     EnableFontButtons(hwndMainFont, TRUE) ;
01549
01550     return ;
01551   }
01552
01553
01554   if (!(hFontThread2 = CreateThread((LPSECURITY_ATTRIBUTES) NULL, 0,
01555                                      (LPTHREAD_START_ROUTINE) FontThreadProc2,
01556                                      &dwFontThreadParm2, CREATE_SUSPENDED, &dwFontThreadID2)))
01557   {
01558     MessageBox(GetForegroundWindow(), TEXT("Error creating thread 2"), NULL,
01559                MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL) ;
01560
01561     nOpenFontDialogCount = 0 ;
01562
01563     EnableFontButtons(hwndMainFont, TRUE) ;
01564
01565     return ;
01566   }
01567
01568   ResumeThread(hFontThread1) ;
01569   ResumeThread(hFontThread2) ;
01570
01571   return ;
01572 }
01573
01574
01575
01576
01577
01578
01579 /************************************************************************
01580
01581   Function: EnableFontButtons(HWND, BOOL)
01582
01583   Purpose:
01584
01585     Enables or disables CDTEST's font dialogs buttons based on the
01586     status of the second parameter.
01587
01588
01589   Returns: Nothing.
01590
01591   Comments:
01592
01593     This is necessary when multithreading in the case of this application.
01594
01595 ************************************************************************/
01596
01597 void EnableFontButtons(HWND hwnd, BOOL bEnable)
01598 {
01599   EnableWindow(GetDlgItem(hwnd, IDOK), bEnable) ;
01600   EnableWindow(GetDlgItem(hwnd, IDCANCEL), bEnable) ;
01601   EnableWindow(GetDlgItem(hwnd, ID_RESETFONT), bEnable) ;
01602   EnableWindow(GetDlgItem(hwnd, ID_MULTITHREADFONT), bEnable) ;
01603   EnableWindow(GetDlgItem(hwnd, ID_EDITLOGFONT), bEnable) ;
01604 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagCONSOLEDATA Member List

This is the complete list of members for tagCONSOLEDATA, including all inherited members.
x | tagCONSOLEDATA
y | tagCONSOLEDATA
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/OleStd/stdpal.c Source File

  • Com
  • Fundamentals
  • OleStd

stdpal.c

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------
00002 |   stdpal.c
00003 |
00004 |   Standard App Palette useful for OLE applications.
00005 |   Use OleStdCreateStandardPalette API to create the palette.
00006 |
00007 |   Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00008 |
00009 -----------------------------------------------------------------------*/
00010
00011 #ifndef PC_RESERVED
00012 #include <windows.h>
00013 #endif
00014
00015 #include <olestd.h>
00016
00017 #include "stdpal.h"
00018
00019 #define cpeAppPal 256  // number of colors in our apps palette
00020 typedef struct
00021    {
00022    WORD wVersion;
00023    WORD cpe;
00024    PALETTEENTRY rgpe[cpeAppPal];
00025    } LOGPAL;
00026
00027
00028 /*-----------------------------------------------------------------------
00029 |   OleStdCreateStandardPalette
00030 |
00031 |       Creates the standard Apps palette.  Create one of these for your
00032 |   app, and select/realize it into each DC.
00033 |
00034 |   Arguments:
00035 |       void:
00036 |
00037 |   Returns:
00038 |
00039 |   Keywords:
00040 -----------------------------------------------------------------------*/
00041 STDAPI_(HPALETTE) OleStdCreateStandardPalette(void)
00042    {
00043    HDC hdc;
00044    HPALETTE hpal;
00045
00046    hpal = (HPALETTE) NULL;
00047    hdc = GetDC(NULL);
00048    if (hdc != NULL && GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE)
00049       {
00050       int cpeSysPal;
00051       int cpeReserved;
00052
00053       cpeSysPal = GetDeviceCaps(hdc, SIZEPALETTE);
00054       cpeReserved = GetDeviceCaps(hdc, NUMRESERVED);
00055       if (cpeSysPal > cpeReserved)
00056          {
00057          int cpeReserved2;
00058          unsigned char FAR* lpb;
00059          PALETTEENTRY FAR* ppe;
00060          PALETTEENTRY FAR* ppeMac;
00061          LOGPAL logpal;
00062
00063          cpeReserved2 = cpeReserved/2;
00064
00065          // Get the system palette entries at the beginning and end.
00066          GetSystemPaletteEntries(hdc, 0, cpeReserved2, logpal.rgpe);
00067          GetSystemPaletteEntries(hdc, cpeSysPal - cpeReserved2, cpeReserved2,
00068             &logpal.rgpe[cpeAppPal-cpeReserved2]);
00069
00070          logpal.cpe = cpeAppPal;
00071          logpal.wVersion = 0x300;
00072
00073          lpb = (BYTE FAR *) &palSVGA[10];
00074          ppe = (PALETTEENTRY FAR*)&logpal.rgpe[cpeReserved2];
00075          ppeMac = (PALETTEENTRY FAR*)&logpal.rgpe[cpeAppPal-cpeReserved2];
00076          while (ppe < ppeMac)
00077             {
00078             ppe->peFlags = PC_NOCOLLAPSE;
00079             ppe->peRed   = *lpb++;
00080             ppe->peGreen = *lpb++;
00081             ppe->peBlue  = *lpb++;
00082             ppe++;
00083             }
00084          hpal = CreatePalette((LOGPALETTE FAR *)&logpal);
00085          }
00086       }
00087    ReleaseDC(NULL, hdc);
00088    return hpal;
00089    }
Generated on Wed Nov 13 2024 16:51:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/TextElem.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

TextElem.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright 1992 - 1998 Microsoft Corporation
00004 //
00005 //  File:       textelem.hxx
00006 //
00007 //  Contents:   Html Text Element class
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __TEXTELEM_HXX__ )
00012 #define __TEXTELEM_HXX__
00013
00014 #include <htmlelem.hxx>
00015
00016
00017 //+-------------------------------------------------------------------------
00018 //
00019 //  Class:      CTextElement
00020 //
00021 //  Purpose:    Parsing element for text
00022 //
00023 //--------------------------------------------------------------------------
00024
00025 class CTextElement : public CHtmlElement
00026 {
00027
00028 public:
00029     CTextElement( CHtmlIFilter& htmlIFilter, CSerialStream& serialStream );
00030
00031     virtual SCODE   GetChunk( STAT_CHUNK *pStat );
00032     virtual SCODE   GetText( ULONG *pcwcBuffer, WCHAR *awcBuffer );
00033
00034     virtual void    InitStatChunk( STAT_CHUNK *pStat );
00035     virtual void    InitFilterRegion( ULONG& idChunkSource,
00036                                       ULONG& cwcStartSource,
00037                                       ULONG& cwcLenSource );
00038
00039 private:
00040     BOOL             _fNoMoreText;     // No more text in current chunk
00041     HtmlTokenType    _eTokTypeNext;    // Token type of the following chunk
00042     ULONG            _idChunk;         // Id of text chunk
00043     ULONG            _cTextChars;      // # chars in text chunk
00044 };
00045
00046
00047 #endif // __TEXTELEM_HXX__
00048
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/PerfDll/DataMem.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • PerfDll

DataMem.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1995 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 Module Name:
00010
00011     datamem.c
00012
00013 Abstract:
00014
00015     a file containing the constant data structures used by the Performance
00016     Monitor data for the application heap performance counter object
00017
00018     This file contains a set of constant data structures which are
00019     currently defined for the application heap Objects.
00020
00021 --*/
00022 //
00023 //  Include Files
00024 //
00025
00026 #include <windows.h>
00027 #include <winperf.h>
00028 #include "..\pub\memctrnm.h"    // offset definitions
00029 #include "datamem.h"            // data structure definitions
00030
00031 // dummy local variable
00032 static    APPMEM_COUNTERS     ac;
00033
00034 //
00035 //  Constant structure initializations
00036 //      defined in datamem.h
00037 //
00038
00039 APPMEM_DATA_DEFINITION AppMemDataDefinition = {
00040    {sizeof(APPMEM_DATA_DEFINITION) + sizeof(APPMEM_COUNTERS),
00041       sizeof(APPMEM_DATA_DEFINITION),
00042       sizeof(PERF_OBJECT_TYPE),
00043       APPMEMOBJ,
00044       0,
00045       APPMEMOBJ,
00046       0,
00047       PERF_DETAIL_NOVICE,
00048       (sizeof(APPMEM_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
00049       sizeof(PERF_COUNTER_DEFINITION),
00050       0,  // application memory bytes is the default counter
00051       0,  // 0 instances to start with
00052       0,  // unicode instance names
00053       {0,0},
00054       {0,0}
00055    },
00056    {sizeof(PERF_COUNTER_DEFINITION),
00057       APPMEMALLOC,
00058       0,
00059       APPMEMALLOC,
00060       0,
00061       -5,
00062       PERF_DETAIL_NOVICE,
00063       PERF_COUNTER_RAWCOUNT,
00064       sizeof(ac.dwAppMemBytesAllocated),
00065       0,
00066    },
00067    {sizeof(PERF_COUNTER_DEFINITION),
00068       APPALLOCS,
00069       0,
00070       APPALLOCS,
00071       0,
00072       -1,
00073       PERF_DETAIL_NOVICE,
00074       PERF_COUNTER_RAWCOUNT,
00075       sizeof(ac.dwAppMemAllocs),
00076       0
00077    },
00078    {sizeof(PERF_COUNTER_DEFINITION),
00079       APPALLOCSSEC,
00080       0,
00081       APPALLOCSSEC,
00082       0,
00083       0,
00084       PERF_DETAIL_NOVICE,
00085       PERF_COUNTER_COUNTER,
00086       sizeof(ac.dwAppMemAllocsSec),
00087       0
00088    },
00089    {sizeof(PERF_COUNTER_DEFINITION),
00090       APPREALLOCS,
00091       0,
00092       APPREALLOCS,
00093       0,
00094       -1,
00095       PERF_DETAIL_NOVICE,
00096       PERF_COUNTER_RAWCOUNT,
00097       sizeof(ac.dwAppMemReAllocs),
00098       0
00099    },
00100    {sizeof(PERF_COUNTER_DEFINITION),
00101       APPREALLOCSSEC,
00102       0,
00103       APPREALLOCSSEC,
00104       0,
00105       0,
00106       PERF_DETAIL_NOVICE,
00107       PERF_COUNTER_COUNTER,
00108       sizeof(ac.dwAppMemReAllocsSec),
00109       0
00110    },
00111    {sizeof(PERF_COUNTER_DEFINITION),
00112       APPFREES,
00113       0,
00114       APPFREES,
00115       0,
00116       -1,
00117       PERF_DETAIL_NOVICE,
00118       PERF_COUNTER_RAWCOUNT,
00119       sizeof(ac.dwAppMemFrees),
00120       0
00121    },
00122    {sizeof(PERF_COUNTER_DEFINITION),
00123       APPFREESSEC,
00124       0,
00125       APPFREESSEC,
00126       0,
00127       0,
00128       PERF_DETAIL_NOVICE,
00129       PERF_COUNTER_COUNTER,
00130       sizeof(ac.dwAppMemFreesSec),
00131       0
00132    }
00133 };
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

InkCollection::InkCollection Member List

This is the complete list of members for InkCollection::InkCollection, including all inherited members.
components | InkCollection::InkCollection | [private]
CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data) | InkCollection::InkCollection | [inline]
DataInterest | InkCollection::InkCollection |
Dispose(bool disposing) | InkCollection::InkCollection | [inline, protected]
Dispose(bool disposing) | InkCollection::InkCollection | [inline, protected]
Error(RealTimeStylus sender, ErrorData data) | InkCollection::InkCollection | [inline]
InAirPackets(RealTimeStylus sender, InAirPacketsData data) | InkCollection::InkCollection | [inline]
InitializeComponent() | InkCollection::InkCollection | [inline, private]
InitializeComponent() | InkCollection::InkCollection | [inline, private]
InkCollection() | InkCollection::InkCollection | [inline]
InkCollection() | InkCollection::InkCollection | [inline]
InkCollection_Load(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
InkCollection_Load(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
InkCollection_Paint(object sender, System.Windows.Forms.PaintEventArgs e) | InkCollection::InkCollection | [inline, private]
Main() | InkCollection::InkCollection | [inline, private, static]
Main() | InkCollection::InkCollection | [inline, private, static]
MediumInkWidth | InkCollection::InkCollection | [private]
miBlack | InkCollection::InkCollection | [private]
miBlack_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miBlack_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miBlue | InkCollection::InkCollection | [private]
miBlue_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miBlue_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miColor | InkCollection::InkCollection | [private]
miEnabled | InkCollection::InkCollection | [private]
miEnabled_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miEnabled_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miExit | InkCollection::InkCollection | [private]
miExit_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miExit_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miGreen | InkCollection::InkCollection | [private]
miGreen_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miGreen_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miMain | InkCollection::InkCollection | [private]
miMainFile | InkCollection::InkCollection | [private]
miMainInk | InkCollection::InkCollection | [private]
miMedium | InkCollection::InkCollection | [private]
miMedium_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miMedium_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miRed | InkCollection::InkCollection | [private]
miRed_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miRed_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miThick | InkCollection::InkCollection | [private]
miThick_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miThick_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miThin | InkCollection::InkCollection | [private]
miThin_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miThin_Click(object sender, System.EventArgs e) | InkCollection::InkCollection | [inline, private]
miWidth | InkCollection::InkCollection | [private]
myDynamicRenderer | InkCollection::InkCollection | [private]
myInk | InkCollection::InkCollection | [private]
myInkCollector | InkCollection::InkCollection | [private]
myPackets | InkCollection::InkCollection | [private]
myRealTimeStylus | InkCollection::InkCollection | [private]
myRenderer | InkCollection::InkCollection | [private]
Packets(RealTimeStylus sender, PacketsData data) | InkCollection::InkCollection | [inline]
RealTimeStylusDisabled(RealTimeStylus sender, RealTimeStylusDisabledData data) | InkCollection::InkCollection | [inline]
RealTimeStylusEnabled(RealTimeStylus sender, RealTimeStylusEnabledData data) | InkCollection::InkCollection | [inline]
StylusButtonDown(RealTimeStylus sender, StylusButtonDownData data) | InkCollection::InkCollection | [inline]
StylusButtonUp(RealTimeStylus sender, StylusButtonUpData data) | InkCollection::InkCollection | [inline]
StylusDown(RealTimeStylus sender, StylusDownData data) | InkCollection::InkCollection | [inline]
StylusInRange(RealTimeStylus sender, StylusInRangeData data) | InkCollection::InkCollection | [inline]
StylusOutOfRange(RealTimeStylus sender, StylusOutOfRangeData data) | InkCollection::InkCollection | [inline]
StylusUp(RealTimeStylus sender, StylusUpData data) | InkCollection::InkCollection | [inline]
SystemGesture(RealTimeStylus sender, SystemGestureData data) | InkCollection::InkCollection | [inline]
TabletAdded(RealTimeStylus sender, TabletAddedData data) | InkCollection::InkCollection | [inline]
TabletRemoved(RealTimeStylus sender, TabletRemovedData data) | InkCollection::InkCollection | [inline]
ThickInkWidth | InkCollection::InkCollection | [private]
ThinInkWidth | InkCollection::InkCollection | [private]
Generated on Wed Nov 13 2024 16:58:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/StdAfx.Cpp Source File

  • Web
  • MSAgent
  • c
  • Cap

StdAfx.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 - 2000 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 #include "stdafx.h"
00045
00046 #include <objbase.h>
00047 #include <initguid.h>
00048 #include "AgtSvr_i.c"
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcim.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcim.cpp

Go to the documentation of this file.
00001 // rtcim.cpp
00002 //
00003
00004 #include "stdafx.h"
00005
00006 // Font definition
00007 static CHARFORMAT cfDefault =
00008 {
00009   sizeof(CHARFORMAT),
00010   CFM_EFFECTS | CFM_PROTECTED | CFM_SIZE | CFM_OFFSET | CFM_COLOR | CFM_CHARSET | CFM_FACE,
00011   CFE_AUTOCOLOR,    // effects
00012   200,        // height, 200 twips == 10 points
00013   0,          // offset
00014   0,          // color (not used since CFE_AUTOCOLOR is specified)
00015   DEFAULT_CHARSET,
00016   FF_SWISS,     // pitch and family
00017   _T("Microsoft Sans Serif") // face name
00018 };
00019
00020 /////////////////////////////////////////////
00021 //
00022 // CRTCIMSession::CRTCIMSession
00023 //
00024
00025 CRTCIMSession::CRTCIMSession() : CRTCSession()
00026 {
00027     m_hDisplay = NULL;
00028     m_hEdit = NULL;
00029     m_hSend = NULL;
00030     m_fTyping = FALSE;
00031     m_wpOrigEditProc = NULL;
00032 }
00033
00034 /////////////////////////////////////////////
00035 //
00036 // CRTCIMSession::~CRTCIMSession
00037 //
00038
00039 CRTCIMSession::~CRTCIMSession()
00040 {
00041 }
00042
00043 /////////////////////////////////////////////
00044 //
00045 // CRTCIMSession::RegisterClass
00046 //
00047
00048 HRESULT CRTCIMSession::RegisterClass()
00049 {
00050     // Register the window class
00051     WNDCLASS wc;
00052     ATOM atom;
00053
00054     ZeroMemory(&wc, sizeof(WNDCLASS));
00055
00056     wc.style         = CS_HREDRAW | CS_VREDRAW;
00057     wc.lpfnWndProc   = (WNDPROC)CRTCIMSession::WindowProc;
00058     wc.hInstance     = GetModuleHandle(NULL);
00059     wc.hIcon         = NULL;
00060     wc.hCursor       =
00061         LoadCursor(NULL, IDC_ARROW);
00062     wc.hbrBackground =
00063         GetSysColorBrush(COLOR_3DFACE);
00064     wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU_IM);
00065     wc.lpszClassName = IM_CLASS;
00066
00067     atom = ::RegisterClass( &wc );
00068
00069     if ( !atom )
00070     {
00071         // RegisterClass failed
00072         return E_FAIL;
00073     }
00074
00075     return S_OK;
00076 }
00077
00078 /////////////////////////////////////////////
00079 //
00080 // CRTCIMSession::WindowProc
00081 //
00082
00083 LRESULT CALLBACK CRTCIMSession::WindowProc(
00084   HWND hWnd,      // handle to window
00085   UINT uMsg,      // message identifier
00086   WPARAM wParam,  // first message parameter
00087   LPARAM lParam   // second message parameter
00088 )
00089 {
00090     CRTCIMSession * me = NULL;
00091     LRESULT  lr = 0;
00092
00093     if ( uMsg == WM_CREATE )
00094     {
00095         // Create an instance of the class
00096         me = new CRTCIMSession;
00097         me->m_hWnd = hWnd;
00098
00099         // Store the class instance pointer in the
00100         // window's user data for later retrieval
00101         SetWindowLong(hWnd, GWL_USERDATA, (LONG)me);
00102
00103         lr = me->OnCreate(uMsg, wParam, lParam);
00104     }
00105     else
00106     {
00107         // Retrieve the class instance pointer from the
00108         // window's user data
00109         me = (CRTCIMSession *)GetWindowLong(hWnd, GWL_USERDATA);
00110
00111         switch( uMsg )
00112         {
00113         case WM_DESTROY:
00114             lr = me->OnDestroy(uMsg, wParam, lParam);
00115
00116             // Delete the object instance
00117             delete me;
00118
00119             break;
00120
00121         case WM_CLOSE:
00122             lr = me->OnClose(uMsg, wParam, lParam);
00123             break;
00124
00125         case WM_SIZE:
00126             lr = me->OnSize(uMsg, wParam, lParam);
00127             break;
00128
00129         case WM_COMMAND:
00130             lr = me->OnCommand(uMsg, wParam, lParam);
00131             break;
00132
00133         default:
00134             lr = DefWindowProc( hWnd, uMsg, wParam, lParam );
00135         }
00136     }
00137
00138     return lr;
00139 }
00140
00141 /////////////////////////////////////////////
00142 //
00143 // CRTCIMSession::EditSubclassProc
00144 //
00145
00146 LRESULT CALLBACK CRTCIMSession::EditSubclassProc(
00147   HWND hWnd,      // handle to window
00148   UINT uMsg,      // message identifier
00149   WPARAM wParam,  // first message parameter
00150   LPARAM lParam   // second message parameter
00151 )
00152 {
00153     CRTCIMSession * me = NULL;
00154     me = (CRTCIMSession *)GetWindowLong(hWnd, GWL_USERDATA);
00155
00156     if ( uMsg == WM_KEYDOWN )
00157     {
00158         // Intercept the return key from the edit box
00159         // and press the send button
00160         if ( (wParam == VK_RETURN) &&
00161              !(GetKeyState(VK_CONTROL) & 0x8000))
00162         {
00163             SendMessage(me->m_hWnd, WM_COMMAND,
00164                 MAKEWPARAM(IDC_IM_SEND, BN_CLICKED),
00165                 (LPARAM)me->m_hSend);
00166
00167             return 0;
00168         }
00169     }
00170
00171     // Call the original edit window procedure
00172     return CallWindowProc(
00173         me->m_wpOrigEditProc,
00174         hWnd, uMsg, wParam, lParam);
00175 }
00176
00177 /////////////////////////////////////////////
00178 //
00179 // CRTCIMSession::DoSendMessage
00180 //
00181
00182 HRESULT CRTCIMSession::DoSendMessage()
00183 {
00184     LONG cch;
00185     BSTR bstrMessage = NULL;
00186     HRESULT hr;
00187
00188     // Determine the length of the outgoing message
00189     // in the edit box
00190     cch = SendMessageW(m_hEdit, WM_GETTEXTLENGTH, 0, 0);
00191
00192     if (cch > 0)
00193     {
00194         // Allocate a buffer for the outgoing message
00195         bstrMessage = SysAllocStringLen(NULL, cch);
00196
00197         if (bstrMessage == NULL)
00198         {
00199             // SysAllocStringLen failed
00200             return E_OUTOFMEMORY;
00201         }
00202
00203         // Get the outgoing message from the edit box
00204         if (cch != SendMessageW(m_hEdit, WM_GETTEXT, cch+1, (LPARAM)bstrMessage))
00205         {
00206             // SendMessageW failed
00207             SAFE_FREE_STRING(bstrMessage);
00208             return E_FAIL;
00209         }
00210
00211         // Get the local user URI
00212         BSTR bstrURI = NULL;
00213
00214         hr = m_pWin->GetUserURI(&bstrURI);
00215
00216         if (FAILED(hr))
00217         {
00218             // GetUserURI failed
00219             SAFE_FREE_STRING(bstrMessage);
00220             return hr;
00221         }
00222
00223         // Display the outgoing message
00224         DoDisplayMessage(bstrURI, bstrMessage);
00225
00226         SAFE_FREE_STRING(bstrURI);
00227
00228         // Clear the edit box
00229         SetWindowText(m_hEdit, L"");
00230
00231         // Send the outgoing message
00232         hr = m_pSession->SendMessage(NULL, bstrMessage, 0);
00233
00234         SAFE_FREE_STRING(bstrMessage);
00235
00236         if (FAILED(hr))
00237         {
00238             // SendMessage failed
00239             return hr;
00240         }
00241     }
00242
00243     return S_OK;
00244 }
00245
00246 /////////////////////////////////////////////
00247 //
00248 // CRTCIMSession::DoDisplayMessage
00249 //
00250
00251 HRESULT CRTCIMSession::DoDisplayMessage(PWSTR szUser, PWSTR szMessage)
00252 {
00253     // Select the end of the text in the edit control
00254     SendMessage(m_hDisplay, EM_SETSEL, -1, -1);
00255
00256     // Set format for the user text
00257     CHARFORMAT cf;
00258     PARAFORMAT pf;
00259
00260     cf.cbSize = sizeof(CHARFORMAT);
00261     cf.dwMask = CFM_COLOR;
00262     cf.dwEffects = 0;
00263     cf.crTextColor = RGB(0,128,128);
00264
00265     SendMessage(m_hDisplay, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
00266
00267     pf.cbSize = sizeof(PARAFORMAT);
00268     pf.dwMask = PFM_STARTINDENT;
00269     pf.dxStartIndent = 50;
00270
00271     SendMessage(m_hDisplay, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
00272
00273     // Paste the user text in the edit control
00274     SendMessageW(m_hDisplay, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)szUser);
00275     SendMessageW(m_hDisplay, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L" says:\n");
00276
00277     // Set format for the message text
00278     cf.cbSize = sizeof(CHARFORMAT);
00279     cf.dwMask = CFM_COLOR;
00280     cf.dwEffects = CFE_AUTOCOLOR;
00281     cf.crTextColor = 0;
00282
00283     SendMessage(m_hDisplay, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
00284
00285     pf.cbSize = sizeof(PARAFORMAT);
00286     pf.dwMask = PFM_STARTINDENT;
00287     pf.dxStartIndent = 200;
00288
00289     SendMessage(m_hDisplay, EM_SETPARAFORMAT, 0, (LPARAM)&pf);
00290
00291     // Paste the message text in the edit control
00292     SendMessageW(m_hDisplay, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)szMessage);
00293
00294     // Paste a new line in the edit control
00295     SendMessageW(m_hDisplay, EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)L"\n");
00296
00297     // Scroll to the bottom of the edit control
00298     SendMessage(m_hDisplay, WM_VSCROLL, SB_BOTTOM, 0);
00299
00300     return S_OK;
00301 }
00302
00303 /////////////////////////////////////////////
00304 //
00305 // CRTCIMSession::DoSendTyping
00306 //
00307
00308 HRESULT CRTCIMSession::DoSendTyping()
00309 {
00310     BOOL fTyping;
00311     HRESULT hr;
00312
00313     // Is the edit box empty?
00314     fTyping = (SendMessage(m_hEdit, WM_GETTEXTLENGTH, 0, 0) > 0);
00315
00316     if (m_fTyping != fTyping)
00317     {
00318         // Typing status has changed
00319         m_fTyping = fTyping;
00320
00321         hr = m_pSession->SendMessageStatus(
00322             m_fTyping ? RTCMUS_TYPING : RTCMUS_IDLE,
00323             0);
00324
00325         if (FAILED(hr))
00326         {
00327             // SendMessageStatus failed
00328             return hr;
00329         }
00330     }
00331
00332     return S_OK;
00333 }
00334
00335 /////////////////////////////////////////////
00336 //
00337 // CRTCIMSession::DoDisplayTyping
00338 //
00339
00340 HRESULT CRTCIMSession::DoDisplayTyping(PWSTR szUser, BOOL fTyping)
00341 {
00342     if (fTyping)
00343     {
00344         // Display typing status in the status bar.
00345         WCHAR szTyping[MAX_STRING];
00346         _snwprintf(szTyping, MAX_STRING, L"%s is typing.", szUser);
00347         szTyping[MAX_STRING-1] = L'\0';
00348
00349         SetStatusText(szTyping);
00350     }
00351     else
00352     {
00353         // User is not longer typing. Display the session
00354         // state in the status bar.
00355         DeliverSessionState(m_enState);
00356     }
00357
00358     return S_OK;
00359 }
00360
00361 /////////////////////////////////////////////
00362 //
00363 // CRTCIMSession::OnCreate
00364 //
00365
00366 LRESULT CRTCIMSession::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam)
00367 {
00368     // Call the base class
00369     CRTCSession::OnCreate(uMsg, wParam, lParam);
00370
00371     // Create the display control
00372     m_hDisplay = CreateWindowEx(
00373         WS_EX_CLIENTEDGE,
00374         RICHEDIT_CLASS,
00375         NULL,
00376         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_VSCROLL |
00377         ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY,
00378         0, 0,
00379         0, 0,
00380         m_hWnd,
00381         (HMENU)IDC_IM_DISPLAY,
00382         GetModuleHandle(NULL),
00383         NULL);
00384
00385     if ( !m_hDisplay )
00386     {
00387         // CreateWindowEx failed
00388         return -1;
00389     }
00390
00391     SendMessage(m_hDisplay, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cfDefault);
00392
00393     // Create the edit control
00394     m_hEdit = CreateWindowEx(
00395         WS_EX_CLIENTEDGE,
00396         RICHEDIT_CLASS,
00397         NULL,
00398         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_VSCROLL |
00399         ES_MULTILINE | ES_AUTOVSCROLL,
00400         0, 0,
00401         0, 0,
00402         m_hWnd,
00403         (HMENU)IDC_IM_EDIT,
00404         GetModuleHandle(NULL),
00405         NULL);
00406
00407     if ( !m_hEdit )
00408     {
00409         // CreateWindowEx failed
00410         return -1;
00411     }
00412
00413     SendMessage(m_hEdit, EM_SETEVENTMASK, 0, ENM_CHANGE);
00414     SendMessage(m_hEdit, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cfDefault);
00415
00416     // Subclass the edit window
00417     m_wpOrigEditProc = (WNDPROC)SetWindowLong(m_hEdit,
00418         GWL_WNDPROC, (LONG)CRTCIMSession::EditSubclassProc);
00419     SetWindowLong(m_hEdit, GWL_USERDATA, (LONG)this);
00420
00421     // Create the send button
00422     m_hSend = CreateWindowExW(
00423         0,
00424         L"BUTTON",
00425         L"Send",
00426         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | BS_PUSHBUTTON,
00427         0, 0,
00428         0, 0,
00429         m_hWnd,
00430         (HMENU)IDC_IM_SEND,
00431         GetModuleHandle(NULL),
00432         NULL);
00433
00434     if ( !m_hSend )
00435     {
00436         // CreateWindowExW failed
00437         return -1;
00438     }
00439
00440     // Set focus to the edit window
00441     SetFocus(m_hEdit);
00442
00443     return 0;
00444 }
00445
00446 /////////////////////////////////////////////
00447 //
00448 // CRTCIMSession::OnDestroy
00449 //
00450
00451 LRESULT CRTCIMSession::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam)
00452 {
00453     // Call the base class
00454     CRTCSession::OnDestroy(uMsg, wParam, lParam);
00455
00456     // Unsubclass the edit window
00457     SetWindowLong(m_hEdit, GWL_WNDPROC, (LONG)m_wpOrigEditProc);
00458
00459     return 0;
00460 }
00461
00462 /////////////////////////////////////////////
00463 //
00464 // CRTCIMSession::OnSize
00465 //
00466
00467 LRESULT CRTCIMSession::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam)
00468 {
00469     // Call the base class
00470     CRTCSession::OnSize(uMsg, wParam, lParam);
00471
00472     RECT rcWnd, rcStatusBar, rcDisplay, rcEdit, rcSend;
00473     const int SIZE_EDGE = 5;
00474     const int SIZE_BUTTON = 60;
00475
00476     GetClientRect(m_hWnd, &rcWnd);
00477     GetClientRect(m_hStatusBar, &rcStatusBar);
00478
00479     // Resize the send button
00480     rcSend.bottom = rcWnd.bottom -
00481         (rcStatusBar.bottom - rcStatusBar.top) -
00482         SIZE_EDGE;
00483     rcSend.top = rcSend.bottom - SIZE_BUTTON;
00484     rcSend.right = rcWnd.right - SIZE_EDGE;
00485     rcSend.left = rcSend.right - SIZE_BUTTON;
00486
00487     MoveWindow(
00488         m_hSend,
00489         rcSend.left,
00490         rcSend.top,
00491         (rcSend.right - rcSend.left),
00492         (rcSend.bottom - rcSend.top),
00493         TRUE);
00494
00495     // Resize the edit control
00496     rcEdit.bottom = rcSend.bottom;
00497     rcEdit.top = rcSend.top;
00498     rcEdit.right = rcSend.left - SIZE_EDGE;
00499     rcEdit.left = rcWnd.left + SIZE_EDGE;
00500
00501     MoveWindow(
00502         m_hEdit,
00503         rcEdit.left,
00504         rcEdit.top,
00505         (rcEdit.right - rcEdit.left),
00506         (rcEdit.bottom - rcEdit.top),
00507         TRUE);
00508
00509     // Resize the display control
00510     rcDisplay.bottom = rcEdit.top - SIZE_EDGE;
00511     rcDisplay.top = rcWnd.top + SIZE_EDGE;
00512     rcDisplay.right = rcWnd.right - SIZE_EDGE;
00513     rcDisplay.left = rcWnd.left + SIZE_EDGE;
00514
00515     MoveWindow(
00516         m_hDisplay,
00517         rcDisplay.left,
00518         rcDisplay.top,
00519         (rcDisplay.right - rcDisplay.left),
00520         (rcDisplay.bottom - rcDisplay.top),
00521         TRUE);
00522
00523     return 0;
00524 }
00525
00526 /////////////////////////////////////////////
00527 //
00528 // CRTCIMSession::OnCommand
00529 //
00530
00531 LRESULT CRTCIMSession::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam)
00532 {
00533     if (HIWORD(wParam) == EN_CHANGE)
00534     {
00535         switch(LOWORD(wParam))
00536         {
00537         case IDC_IM_EDIT:
00538             DoSendTyping();
00539             break;
00540         }
00541     }
00542     else
00543     {
00544         switch(LOWORD(wParam))
00545         {
00546         case ID_FILE_EXIT:
00547             PostMessage(m_hWnd, WM_CLOSE, 0, 0);
00548             break;
00549
00550         case IDC_IM_SEND:
00551             DoSendMessage();
00552             break;
00553         }
00554     }
00555
00556     return 0;
00557 }
00558
00559 /////////////////////////////////////////////
00560 //
00561 // CRTCIMSession::DeliverMessage
00562 //
00563
00564 HRESULT CRTCIMSession::DeliverMessage(IRTCParticipant * pParticipant, BSTR bstrContentType, BSTR bstrMessage)
00565 {
00566     HRESULT hr;
00567     BSTR bstrURI = NULL;
00568
00569     // Get the URI of the incoming user
00570     hr = pParticipant->get_UserURI(&bstrURI);
00571
00572     if (FAILED(hr))
00573     {
00574         // get_UserURI failed
00575         return hr;
00576     }
00577
00578     // Display the incoming message
00579     hr = DoDisplayMessage(bstrURI, bstrMessage);
00580
00581     if (FAILED(hr))
00582     {
00583         // DoDisplayMessage failed
00584         return hr;
00585     }
00586
00587     // Set the incoming user's typing status to idle
00588     hr = DoDisplayTyping(bstrURI, RTCMUS_IDLE);
00589
00590     if (FAILED(hr))
00591     {
00592         // DoDisplayTyping failed
00593         return hr;
00594     }
00595
00596     return S_OK;
00597 }
00598
00599 /////////////////////////////////////////////
00600 //
00601 // CRTCIMSession::DeliverUserStatus
00602 //
00603
00604 HRESULT CRTCIMSession::DeliverUserStatus(IRTCParticipant * pParticipant, RTC_MESSAGING_USER_STATUS enStatus)
00605 {
00606     HRESULT hr;
00607     BSTR bstrURI = NULL;
00608
00609     // Get the URI of the incoming user
00610     hr = pParticipant->get_UserURI(&bstrURI);
00611
00612     if (FAILED(hr))
00613     {
00614         // get_UserURI failed
00615         return hr;
00616     }
00617
00618     // Display the typing status of the incoming user
00619     hr = DoDisplayTyping(bstrURI, (enStatus == RTCMUS_TYPING));
00620
00621     if (FAILED(hr))
00622     {
00623         // DoDisplayTyping failed
00624         return hr;
00625     }
00626
00627     return S_OK;
00628 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/localres.h Source File

  • SysMgmt
  • MMC
  • Complete

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/registry.h Source File

  • SysMgmt
  • MMC
  • Ppgeext

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout);    // Class Id for About Class
00040
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/UNK.H Source File

  • Com
  • async
  • server

UNK.H

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #define DECLARE_UNKNOWN                         \
00019   virtual HRESULT __stdcall                     \
00020     QueryInterface(REFIID iid, PVOID *ppv);             \
00021     virtual ULONG __stdcall AddRef()                  \
00022   {                                 \
00023     return InterlockedIncrement(reinterpret_cast<PLONG>(&m_cRef));  \
00024   } ;                                 \
00025   virtual ULONG __stdcall Release()                 \
00026   {                                 \
00027     _ASSERT(m_cRef > 0); /* not thread safe */            \
00028     if (InterlockedDecrement(reinterpret_cast<PLONG>(&m_cRef)) == 0)\
00029     {                               \
00030       FinalRelease();                       \
00031       delete this;                        \
00032       return 0;                         \
00033     }                               \
00034     return m_cRef;                          \
00035                                     \
00036   } ;                                 \
00037   virtual void __stdcall FinalRelease();
00038
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/land.h Source File

  • SysMgmt
  • MMC
  • CMenu

land.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _LAND_H
00021 #define _LAND_H
00022
00023 #include "DeleBase.h"
00024
00025 class CLandBasedVehicle : public CDelegationBase {
00026 public:
00027     CLandBasedVehicle() { }
00028
00029     virtual ~CLandBasedVehicle() {}
00030
00031     virtual const _TCHAR *GetDisplayName(int nCol = 0) { return _T("Land-based Vehicles"); }
00032     virtual const GUID & getNodeType() { return thisGuid; }
00033     virtual const int GetBitmapIndex() { return INDEX_LANDICON; }
00034
00035 public:
00036     // virtual functions go here (for MMCN_*)
00037     virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed);
00038     virtual HRESULT OnMenuCommand(IConsole *pConsole, long lCommandID);
00039
00040 private:
00041     enum { IDM_NEW_LAND = 2 };
00042
00043     // {2974380E-4C4B-11d2-89D8-000021473128}
00044     static const GUID thisGuid;
00045 };
00046
00047 #endif // _LAND_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/updrec.h Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

updrec.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UpdRec.h
00003   Summary:   Header for Object Pooled Update Receipt component
00004   Classes:   CUpdateReceipt
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #if !defined(AFX_UPDATERECEIPT_H__A81260B9_DDC8_11D0_B5A0_00C04FB957D8__INCLUDED_)
00023 #define AFX_UPDATERECEIPT_H__A81260B9_DDC8_11D0_B5A0_00C04FB957D8__INCLUDED_
00024
00025 #include "resource.h"       // main symbols
00026 #include "comsvcs.h"
00027
00028 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00029 Class:  CUpdateReceipt
00030 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00031
00032 class CUpdateReceipt :
00033   public CComDualImpl<IUpdateReceipt, &IID_IUpdateReceipt, &LIBID_ACCOUNT>,
00034   public ISupportErrorInfo,
00035   public CComObjectRoot,
00036   public IObjectConstruct,
00037   public IObjectControl,
00038   public CComCoClass<CUpdateReceipt,&CLSID_CUpdateReceipt>
00039 {
00040 private:
00041     CComBSTR m_sDSN;
00042     HENV m_henv;
00043     HDBC m_hdbc;
00044     HSTMT m_hstmt;
00045     BOOL m_bConstructed;
00046     GUID m_txuow;
00047     BOOL m_bShouldEnlist;
00048     BOOL m_bObjectPooled;
00049     HRESULT Enlist();
00050
00051 public:
00052   CUpdateReceipt()
00053   {
00054     m_henv = 0;
00055     m_hdbc = 0;
00056     m_hstmt= 0;
00057     m_bConstructed = FALSE;
00058     m_txuow = GUID_NULL;
00059     m_bObjectPooled = FALSE;
00060   }
00061
00062   BEGIN_COM_MAP(CUpdateReceipt)
00063   COM_INTERFACE_ENTRY(IDispatch)
00064   COM_INTERFACE_ENTRY(IObjectConstruct)
00065   COM_INTERFACE_ENTRY(IObjectControl)
00066   COM_INTERFACE_ENTRY(IUpdateReceipt)
00067   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00068 END_COM_MAP()
00069
00070 void FinalRelease();
00071
00072
00073 DECLARE_REGISTRY_RESOURCEID(IDR_UpdateReceipt)
00074
00075 // ISupportsErrorInfo
00076   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00077
00078 // IUpdateReceipt
00079
00080 public:
00081   STDMETHOD (Update) (OUT long* plReceiptNo);
00082
00083 //IObjectConstruct
00084   STDMETHODIMP Construct(IDispatch * pUnk);
00085
00086 // IObjectControl
00087
00088   STDMETHODIMP_(BOOL) CanBePooled()
00089   {
00090     return TRUE;
00091   }
00092
00093   STDMETHODIMP Activate();
00094
00095   STDMETHODIMP_(void) Deactivate()
00096   {
00097   }
00098
00099
00100 };
00101
00102 #endif // !defined(AFX_UPDATERECEIPT_H__A81260B9_DDC8_11D0_B5A0_00C04FB957D8__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDataLinks Member List

This is the complete list of members for CDataLinks, including all inherited members.
AutoQI(DWORD dwCreateOpts) | CDataLinks | [virtual]
AutoRelease() | CDataLinks | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CDataLinks(CMainWindow *pCMainWindow) | CDataLinks |
Create(CBase *pCSource, DWORD dwCSLCTX=CLSCTX_INPROC_SERVER, WCHAR *pwszRemoteServer=NULL) | CDataLinks | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CDataLinks | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CDataLinks | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CDataLinks | [inline, virtual]
GetObjectMenu() | CDataLinks | [inline, virtual]
GetObjectName() | CDataLinks | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIDBPromptInitialize | CDataLinks |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CDataLinks | [virtual]
PromptDataSource(CAggregate *pCAggregate, HWND hWndParent, DBPROMPTOPTIONS dwPromptOptions, ULONG cTypeFilters, DBSOURCETYPE *rgTypeFilters, WCHAR *pwszProvFilter, REFIID riid, IUnknown **ppDataSource) | CDataLinks | [virtual]
PromptFileName(HWND hWndParent, DBPROMPTOPTIONS dwPromptOptions, WCHAR *pwszDirectory, WCHAR *pwszFileName, WCHAR **ppwszSelectedFile) | CDataLinks | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
~CBase() | CBase | [virtual]
~CDataLinks() | CDataLinks | [virtual]
Generated on Wed Nov 13 2024 16:56:02 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

filedata Member List

This is the complete list of members for filedata, including all inherited members.
diritem | filedata
fUnicode | filedata
lines | filedata
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/SimpleClient/Resource.h Source File

  • SysMgmt
  • WMI
  • VC
  • SimpleClient

Resource.h

Go to the documentation of this file.
00001 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00002 //{{NO_DEPENDENCIES}}
00003 // Microsoft Developer Studio generated include file.
00004 // Used by WbemClient.rc
00005 //
00006 #define IDC_ENUMDISKS                   3
00007 #define IDC_MAKEOFFICE                  4
00008 #define IDC_DISKINFO                    5
00009 #define IDM_ABOUTBOX                    0x0010
00010 #define IDD_ABOUTBOX                    100
00011 #define IDS_ABOUTBOX                    101
00012 #define IDD_WBEMCLIENT_DIALOG           102
00013 #define IDR_MAINFRAME                   128
00014 #define IDC_CONNECT                     1000
00015 #define IDC_OUTPUTLIST                  1001
00016 #define IDC_NAMESPACE                   1002
00017
00018 // Next default values for new objects
00019 //
00020 #ifdef APSTUDIO_INVOKED
00021 #ifndef APSTUDIO_READONLY_SYMBOLS
00022 #define _APS_NEXT_RESOURCE_VALUE        129
00023 #define _APS_NEXT_COMMAND_VALUE         32771
00024 #define _APS_NEXT_CONTROL_VALUE         1003
00025 #define _APS_NEXT_SYMED_VALUE           101
00026 #endif
00027 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/registry.Cpp Source File

  • SysMgmt
  • MMC
  • Taskpads

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091         _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123         MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124         _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,         // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154         MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191         MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203                (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Simple/mmccrack.Cpp Source File

  • SysMgmt
  • MMC
  • Simple

mmccrack.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <mmc.h>
00020 #include <winuser.h>
00021 #include <tchar.h>
00022
00023 #include "globals.h"
00024
00025 #define STRSAFE_NO_DEPRECATE
00026 #include <strsafe.h>
00027
00028 static TCHAR *MMCN_CrackVerb(MMC_CONSOLE_VERB verb)
00029 {
00030   static TCHAR error[64];
00031
00032   switch (verb) {
00033     case MMC_VERB_NONE:
00034     return _T("NONE");
00035     case MMC_VERB_OPEN:
00036     return _T("OPEN");
00037     case MMC_VERB_COPY:
00038     return _T("COPY");
00039     case MMC_VERB_PASTE:
00040     return _T("PASTE");
00041     case MMC_VERB_DELETE:
00042     return _T("DELETE");
00043     case MMC_VERB_PROPERTIES:
00044     return _T("PROPERTIES");
00045     case MMC_VERB_RENAME:
00046     return _T("RENAME");
00047     case MMC_VERB_REFRESH:
00048     return _T("REFRESH");
00049     case MMC_VERB_PRINT:
00050     return _T("PRINT");
00051     case MMC_VERB_CUT:
00052     return _T("CUT");
00053   default:
00054     wsprintf(error, _T("Unknown verb id %d"), verb);
00055     return error;
00056   }
00057 }
00058
00059 void MMCN_Crack(BOOL bComponentData,
00060                 IDataObject *pDataObject,
00061         IComponentData *pCompData,
00062         IComponent *pComp,
00063                 MMC_NOTIFY_TYPE event,
00064         LPARAM arg,
00065         LPARAM param)
00066 {
00067 #ifdef MMC_CRACK_MESSAGES
00068         const size_t cchMessage = 256;
00069   TCHAR message[cchMessage] = {0};
00070
00071   if (bComponentData == TRUE)
00072     OutputDebugString(_T("IComponentData::Notify( "));
00073   else
00074     OutputDebugString(_T("IComponent::Notify( "));
00075
00076   wsprintf(message, _T("DataObject: %08x, CompData: %08x, Comp: %08x ) - "), pDataObject, pCompData, pComp);
00077   OutputDebugString(message);
00078
00079     switch (event)  {
00080     case MMCN_ACTIVATE:
00081       wsprintf(message, _T("MMCN_ACTIVATE\n\tActivate: %d\n"), arg);
00082       break;
00083
00084     case MMCN_ADD_IMAGES:
00085       wsprintf(message, _T("MMCN_ADD_IMAGES\n\tImage List: %08x\n\tScope Item: %08x\n"), arg, param);
00086       break;
00087
00088     case MMCN_BTN_CLICK:
00089       wsprintf(message, _T("MMCN_BTN_CLICK\n\tVerb: %ws\n"), MMCN_CrackVerb((MMC_CONSOLE_VERB)param));
00090       break;
00091
00092     case MMCN_COLUMN_CLICK:
00093       wsprintf(message, _T("MMCN_COLUMN_CLICK\n\tColumn: %d\n\tSort Option: %d\n"), arg,   param);
00094       break;
00095
00096     case MMCN_COLUMNS_CHANGED:
00097       wsprintf(message, _T("MMCN_COLUMNS_CHANGED\n"));
00098       break;
00099
00100     case MMCN_CONTEXTHELP:
00101       wsprintf(message, _T("MMCN_CONTEXTHELP\n"));
00102       break;
00103
00104     case MMCN_CONTEXTMENU:
00105       wsprintf(message, _T("MMCN_CONTEXTMENU\n"));
00106       break;
00107
00108     case MMCN_CUTORMOVE:
00109       wsprintf(message, _T("MMCN_CUTORMOVE\n"));
00110       break;
00111
00112     case MMCN_DBLCLICK:
00113       wsprintf(message, _T("MMCN_DBLCLICK\n"));
00114       break;
00115
00116     case MMCN_DELETE:
00117       wsprintf(message, _T("MMCN_DELETE\n"));
00118       break;
00119
00120     case MMCN_DESELECT_ALL:
00121       wsprintf(message, _T("MMCN_DESELECT_ALL\n"));
00122       break;
00123
00124     case MMCN_EXPAND:
00125       wsprintf(message, _T("MMCN_EXPAND\n\tExpand: %d\n\tScope Item: %08x\n"), arg, param);
00126       break;
00127
00128     case MMCN_EXPANDSYNC:
00129       wsprintf(message, _T("MMCN_EXPANDSYNC\n"));
00130       break;
00131
00132     case MMCN_FILTERBTN_CLICK:
00133       wsprintf(message, _T("MMCN_FILTERBTN_CLICK\n\tColumn: %d\n"), arg);
00134       break;
00135
00136     case MMCN_FILTER_CHANGE:
00137       wsprintf(message, _T("MMCN_FILTER_CHANGE\n\tColumn: %d\n"), param);
00138       break;
00139
00140     case MMCN_HELP:
00141       wsprintf(message, _T("MMCN_HELP\n"));
00142       break;
00143
00144     case MMCN_INITOCX:
00145       wsprintf(message, _T("MMCN_INITOCX\n\tIUnknown: %08x\n"), param);
00146       break;
00147
00148     case MMCN_LISTPAD:
00149       wsprintf(message, _T("MMCN_LISTPAD\n\tConnect: %d\n"), arg);
00150       break;
00151
00152     case MMCN_MENU_BTNCLICK:
00153       wsprintf(message, _T("MMCN_MENU_BTNCLICK\n"));
00154       break;
00155
00156     case MMCN_MINIMIZED:
00157       wsprintf(message, _T("MMCN_MINIMIZED\n\tMinimized: %d\n"), arg);
00158       break;
00159
00160     case MMCN_PASTE:
00161       wsprintf(message, _T("MMCN_PASTE\n\tCopy: %d\n"), param == NULL);
00162       break;
00163
00164     case MMCN_PRELOAD:
00165       wsprintf(message, _T("MMCN_PRELOAD\n\tScope Item: %08x\n"), arg);
00166       break;
00167
00168     case MMCN_PRINT:
00169       wsprintf(message, _T("MMCN_PRINT\n"));
00170       break;
00171
00172     case MMCN_PROPERTY_CHANGE:
00173       wsprintf(message, _T("MMCN_PROPERTY_CHANGE\n\tScope: %d\n\tArg: %08x\n"), arg, param);
00174       break;
00175
00176     case MMCN_QUERY_PASTE:
00177       wsprintf(message, _T("MMCN_QUERY_PASTE\n"));
00178       break;
00179
00180     case MMCN_REFRESH:
00181       wsprintf(message, _T("MMCN_REFRESH\n"));
00182       break;
00183
00184     case MMCN_REMOVE_CHILDREN:
00185       wsprintf(message, _T("MMCN_REMOVE_CHILDREN\n\tScope Item: %08x\n"), arg);
00186       break;
00187
00188     case MMCN_RENAME:
00189                         // Destination string may contain a truncation of the ideal result.
00190                         // (Indicated by return value other than S_OK).
00191                         // However, it will be null-terminated.
00192       StringCchPrintf(message, cchMessage, _T("MMCN_RENAME\n\tNew Name: '%ws'\n"), (LPOLESTR)param);
00193       break;
00194
00195     case MMCN_RESTORE_VIEW:
00196       wsprintf(message, _T("MMCN_RESTORE_VIEW\n"));
00197       break;
00198
00199     case MMCN_SELECT:
00200       wsprintf(message, _T("MMCN_SELECT\n\tScope: %d\n\tSelect: %08x\n"), LOWORD(arg), HIWORD(arg));
00201       break;
00202
00203     case MMCN_SHOW:
00204       wsprintf(message, _T("MMCN_SHOW\n\tShow: %d\n\tScope Item: %08x\n"), arg, param);
00205       break;
00206
00207     case MMCN_SNAPINHELP:
00208       wsprintf(message, _T("MMCN_SNAPINHELP\n"));
00209       break;
00210
00211     case MMCN_VIEW_CHANGE:
00212       wsprintf(message, _T("MMCN_VIEW_CHANGE\n\tData: %08x\n\tHint: %08x\n"), arg, param);
00213       break;
00214   }
00215
00216   if (message[0] != 0)
00217     OutputDebugString(message);
00218   else
00219     OutputDebugString(_T("unknown event\n"));
00220
00221 #endif
00222   return;
00223 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcUser.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcUser.h

Go to the documentation of this file.
00001 #ifndef _ACUser_h_
00002 #define _ACUser_h_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007
00008
00009 // Machine generated IDispatch wrapper class(es) created with ClassWizard
00010 /////////////////////////////////////////////////////////////////////////////
00011 // IAgentCtlUserInput wrapper class
00012
00013 class CAgentCtlUserInput : public COleDispatchDriver
00014 {
00015 public:
00016   CAgentCtlUserInput() {}   // Calls COleDispatchDriver default constructor
00017   CAgentCtlUserInput(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
00018   CAgentCtlUserInput(const CAgentCtlUserInput& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
00019
00020 // Attributes
00021 public:
00022
00023 // Operations
00024 public:
00025   short GetCount();
00026   CString GetName();
00027   CString GetCharacterID();
00028   long GetConfidence();
00029   CString GetVoice();
00030   CString GetAlt1Name();
00031   long GetAlt1Confidence();
00032   CString GetAlt1Voice();
00033   CString GetAlt2Name();
00034   long GetAlt2Confidence();
00035   CString GetAlt2Voice();
00036 };
00037
00038
00039 #endif
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/Object/OHello/OHello.Idl Source File

  • Com
  • Fundamentals
  • Object
  • OHello

OHello.Idl

Go to the documentation of this file.
00001 /* file: OHello.idl */
00002 [
00003   object,
00004   uuid(a46deb31-9f33-11cd-b23f-00aa00339cce)
00005 ]
00006 interface IHello : IUnknown
00007 {
00008     // pull in the definitions for all the standard interfaces
00009   import "unknwn.idl";
00010
00011
00012
00013     HRESULT HelloProc([in, string] char *pszString);
00014
00015 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptServe/CAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptServe

CAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CAR.CPP
00003
00004   Summary:   Implementation file for the COCar COM Object Class (for
00005              aggregatable Car COM Objects).
00006
00007              COCar offers a main IUnknown interface and the ICar
00008              interface (Car-related features).  This multiple interface
00009              COM Object Class is achieved via the technique of nested
00010              classes--the implementation of the ICar interface is
00011              nested inside of the COCar Class.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial APTSERVE.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the module's source code.
00017
00018   Classes:   COCar.
00019
00020   Functions: none.
00021
00022   Origin:    3-20-96: atrent - Editor-inheritance from CAR.CPP in
00023                the LOCSERVE Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040
00041 /*---------------------------------------------------------------------------
00042   We include WINDOWS.H for all Win32 applications.
00043   We include OLE2.H because we will make calls to the COM/OLE Libraries.
00044   We include APPUTIL.H because we will be building this application using
00045     the convenient Virtual Window and Dialog classes and other
00046     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00047   We include MICARS.H and CARGUIDS.H for the common car-related Interface
00048     class, GUID, and CLSID specifications.
00049   We include SERVER.H because it has internal class declarations and
00050     resource ID definitions specific for this executable.
00051   We include CAR.H because it has the class COCar declarations.
00052 ---------------------------------------------------------------------------*/
00053 #include <windows.h>
00054 #include <ole2.h>
00055 #include <apputil.h>
00056 #include <micars.h>
00057 #include <carguids.h>
00058 #include "server.h"
00059 #include "car.h"
00060
00061
00062 /*---------------------------------------------------------------------------
00063   COCar's implementation of its main COM object class including
00064   Constructor, Destructor, QueryInterface, AddRef, and Release.
00065 ---------------------------------------------------------------------------*/
00066
00067 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00068   Method:   COCar::COCar
00069
00070   Summary:  COCar Constructor. Note the member initializer:
00071             "m_ImpICar(this, pUnkOuter)" which is used to pass the 'this'
00072             and pUnkOuter pointers of this constructor function to the
00073             constructor in the instantiation of the implementation of
00074             the CImpICar interface (which is nested inside this present
00075             COCar Object Class).
00076
00077   Args:     IUnknown* pUnkOuter,
00078               Pointer to the the outer Unknown.  NULL means this COM Object
00079               is not being Aggregated.  Non NULL means it is being created
00080               on behalf of an outside COM object that is reusing it via
00081               aggregation.
00082             CServer* pServer)
00083               Pointer to the server's control object.
00084
00085   Modifies: m_cRefs, m_pUnkOuter, m_pServer.
00086
00087   Returns:  void
00088 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00089 COCar::COCar(
00090   IUnknown* pUnkOuter,
00091   CServer* pServer) :
00092   m_ImpICar(this, pUnkOuter)
00093 {
00094   // Zero the COM object's reference count.
00095   m_cRefs = 0;
00096
00097   // No AddRef necessary if non-NULL, as we're nested.
00098   m_pUnkOuter = pUnkOuter;
00099
00100   // Assign the pointer to the server control object.
00101   m_pServer = pServer;
00102
00103   LOGF2("L<%X>: COCar Constructor. m_pUnkOuter=0x%X.",TID,m_pUnkOuter);
00104
00105   return;
00106 }
00107
00108
00109 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00110   Method:   COCar::~COCar
00111
00112   Summary:  COCar Destructor.
00113
00114   Args:     void
00115
00116   Modifies: .
00117
00118   Returns:  void
00119 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00120 COCar::~COCar(void)
00121 {
00122   LOGF1("L<%X>: COCar::Destructor.",TID);
00123
00124   return;
00125 }
00126
00127
00128 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00129   Method:   COCar::QueryInterface
00130
00131   Summary:  QueryInterface of the COCar non-delegating
00132             IUnknown implementation.
00133
00134   Args:     REFIID riid,
00135               [in] GUID of the Interface being requested.
00136             PPVOID ppv)
00137               [out] Address of the caller's pointer variable that will
00138               receive the requested interface pointer.
00139
00140   Modifies: *ppv.
00141
00142   Returns:  HRESULT
00143 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00144 STDMETHODIMP COCar::QueryInterface(
00145                REFIID riid,
00146                PPVOID ppv)
00147 {
00148   HRESULT hr = E_NOINTERFACE;
00149   *ppv = NULL;
00150
00151   if (IID_IUnknown == riid)
00152   {
00153     *ppv = this;
00154     LOGF1("L<%X>: COCar::QueryInterface. 'this' pIUnknown returned.",TID);
00155   }
00156   else if (IID_ICar == riid)
00157   {
00158     *ppv = &m_ImpICar;
00159     LOGF1("L<%X>: COCar::QueryInterface. pICar returned.",TID);
00160   }
00161
00162   if (NULL != *ppv)
00163   {
00164     // We've handed out a pointer to the interface so obey the COM rules
00165     // and AddRef the reference count.
00166     ((LPUNKNOWN)*ppv)->AddRef();
00167     hr = NOERROR;
00168   }
00169
00170   return (hr);
00171 }
00172
00173
00174 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00175   Method:   COCar::AddRef
00176
00177   Summary:  AddRef of the COCar non-delegating IUnknown implementation.
00178
00179   Args:     void
00180
00181   Modifies: m_cRefs.
00182
00183   Returns:  ULONG
00184               New value of m_cRefs (COM object's reference count).
00185 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00186 STDMETHODIMP_(ULONG) COCar::AddRef(void)
00187 {
00188   m_cRefs++;
00189
00190   LOGF2("L<%X>: COCar::AddRef. New cRefs=%i.",TID,m_cRefs);
00191
00192   return m_cRefs;
00193 }
00194
00195
00196 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00197   Method:   COCar::Release
00198
00199   Summary:  Release of the COCar non-delegating IUnknown implementation.
00200
00201   Args:     void
00202
00203   Modifies: m_cRefs.
00204
00205   Returns:  ULONG
00206               New value of m_cRefs (COM object's reference count).
00207 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00208 STDMETHODIMP_(ULONG) COCar::Release(void)
00209 {
00210   ULONG cRefs;
00211   m_cRefs--;
00212   cRefs = m_cRefs;
00213
00214   LOGF2("L<%X>: COCar::Release. New cRefs=%i.",TID,m_cRefs);
00215
00216   if (0 == m_cRefs)
00217   {
00218     CServer* pServer = m_pServer;
00219     // We artificially bump the main ref count to prevent reentrancy
00220     // via the main object destructor.  Not really needed in this
00221     // COCar but a good practice because we are aggregatable and
00222     // may at some point in the future add something entertaining like
00223     // some Releases in the COCar destructor.
00224     m_cRefs++;
00225     delete this;
00226
00227     // We've reached a zero reference count for this COM object.
00228     // So we tell the server housing to decrement its global object
00229     // count so that the server will be unloaded if appropriate.
00230     if (NULL != pServer)
00231       pServer->ObjectsDown();
00232   }
00233
00234   return cRefs;
00235 }
00236
00237
00238 /*---------------------------------------------------------------------------
00239   COCar's nested implementation of the ICar interface including
00240   Constructor, Destructor, QueryInterface, AddRef, Release,
00241   Shift, Clutch, Speed, and Steer.
00242 ---------------------------------------------------------------------------*/
00243
00244 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00245   Method:   COCar::CImpICar::CImpICar
00246
00247   Summary:  Constructor for the CImpICar interface instantiation.
00248
00249   Args:     COCar* pBackObj,
00250               Back pointer to the parent outer object.
00251             IUnknown* pUnkOuter
00252               Pointer to the outer Unknown.  For delegation.
00253
00254   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00255
00256   Returns:  void
00257 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00258 COCar::CImpICar::CImpICar(
00259   COCar* pBackObj,
00260   IUnknown* pUnkOuter)
00261 {
00262   // Zero an ICar method call counter (used for tutorial purposes only).
00263   m_C = 0;
00264
00265   // Init the Interface Ref Count (used for debugging only).
00266   m_cRefI = 0;
00267
00268   // Init the Back Object Pointer to point to the parent object.
00269   m_pBackObj = pBackObj;
00270
00271   // Init the CImpICar interface's delegating Unknown pointer.  We use
00272   // the Back Object pointer for IUnknown delegation here if we are not
00273   // being aggregated.  If we are being aggregated we use the supplied
00274   // pUnkOuter for IUnknown delegation.  In either case the pointer
00275   // assignment requires no AddRef because the CImpICar lifetime is
00276   // guaranteed by the lifetime of the parent object in which
00277   // CImpICar is nested.
00278   if (NULL == pUnkOuter)
00279   {
00280     m_pUnkOuter = pBackObj;
00281     LOGF1("L<%X>: COCar::CImpICar Constructor. Non-Aggregating.",TID);
00282   }
00283   else
00284   {
00285     m_pUnkOuter = pUnkOuter;
00286     LOGF1("L<%X>: COCar::CImpICar Constructor. Aggregating.",TID);
00287   }
00288
00289   return;
00290 }
00291
00292
00293 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00294   Method:   COCar::CImpICar::~CImpICar
00295
00296   Summary:  Destructor for the CImpICar interface instantiation.
00297
00298   Args:     void
00299
00300   Modifies: .
00301
00302   Returns:  void
00303 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00304 COCar::CImpICar::~CImpICar(void)
00305 {
00306   LOGF1("L<%X>: COCar::CImpICar Destructor.",TID);
00307
00308   return;
00309 }
00310
00311
00312 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00313   Method:   COCar::CImpICar::QueryInterface
00314
00315   Summary:  The QueryInterface IUnknown member of this ICar interface
00316             implementation that delegates to m_pUnkOuter, whatever it is.
00317
00318   Args:     REFIID riid,
00319               [in] GUID of the Interface being requested.
00320             PPVOID ppv)
00321               [out] Address of the caller's pointer variable that will
00322               receive the requested interface pointer.
00323
00324   Modifies: .
00325
00326   Returns:  HRESULT
00327               Returned by the delegated outer QueryInterface call.
00328 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00329 STDMETHODIMP COCar::CImpICar::QueryInterface(
00330                REFIID riid,
00331                PPVOID ppv)
00332 {
00333   LOGF1("L<%X>: COCar::CImpICar::QueryInterface. Delegating.",TID);
00334
00335   // Delegate this call to the outer object's QueryInterface.
00336   return m_pUnkOuter->QueryInterface(riid, ppv);
00337 }
00338
00339
00340 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00341   Method:   COCar::CImpICar::AddRef
00342
00343   Summary:  The AddRef IUnknown member of this ICar interface
00344             implementation that delegates to m_pUnkOuter, whatever it is.
00345
00346   Args:     void
00347
00348   Modifies: m_cRefI.
00349
00350   Returns:  ULONG
00351               Returned by the delegated outer AddRef call.
00352 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00353 STDMETHODIMP_(ULONG) COCar::CImpICar::AddRef(void)
00354 {
00355   // Increment the Interface Reference Count.
00356   ++m_cRefI;
00357
00358   LOGF2("L<%X>: COCar::CImpICar::Addref. Delegating. New cI=%i.",TID,m_cRefI);
00359
00360   // Delegate this call to the outer object's AddRef.
00361   return m_pUnkOuter->AddRef();
00362 }
00363
00364
00365 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00366   Method:   COCar::CImpICar::Release
00367
00368   Summary:  The Release IUnknown member of this ICar interface
00369             implementation that delegates to m_pUnkOuter, whatever it is.
00370
00371   Args:     void
00372
00373   Modifies: m_cRefI.
00374
00375   Returns:  ULONG
00376               Returned by the delegated outer Release call.
00377 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00378 STDMETHODIMP_(ULONG) COCar::CImpICar::Release(void)
00379 {
00380   // Decrement the Interface Reference Count.
00381   --m_cRefI;
00382
00383   LOGF2("L<%X>: COCar::CImpICar::Release. Delegating. New cI=%i.",TID,m_cRefI);
00384
00385   // Delegate this call to the outer object's Release.
00386   return m_pUnkOuter->Release();
00387 }
00388
00389
00390 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00391   Method:   COCar::CImpICar::Shift
00392
00393   Summary:  The Shift member method of this ICar interface implementation.
00394             A simple empty method on a COCar COM object for tutorial
00395             purposes.  Presumably if this Car object were modeling
00396             a real Car then the Shift method would shift to the specified
00397             gear.
00398
00399   Args:     short nGear
00400               0 - Neutral; 1 - 5 First 5 forward gears; 6 - Reverse.
00401
00402   Modifies: m_C.
00403
00404   Returns:  HRESULT
00405               NOERROR
00406 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00407 STDMETHODIMP COCar::CImpICar::Shift(
00408                short nGear)
00409 {
00410   // Increment method call counter purely for tutorial reasons.
00411   m_C++;
00412
00413   LOGF2("L<%X>: COCar::CImpICar::Shift. Called. ICar calls=%i.",TID,m_C);
00414
00415   return NOERROR;
00416 }
00417
00418
00419 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00420   Method:   COCar::CImpICar::Clutch
00421
00422   Summary:  The Clutch member method of this ICar interface implementation.
00423             A simple empty method on a COCar COM object for tutorial
00424             purposes.  Presumably if this Car object were modeling
00425             a real Car then the Clutch method would engage the clutch the
00426             specified amount.
00427
00428   Args:     short nEngaged)
00429               Percent clutch is engaged (0 to 100%).
00430
00431   Modifies: m_C.
00432
00433   Returns:  HRESULT
00434               NOERROR
00435 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00436 STDMETHODIMP COCar::CImpICar::Clutch(
00437                short nEngaged)
00438 {
00439   // Increment method call counter purely for tutorial reasons.
00440   m_C++;
00441
00442   LOGF2("L<%X>: COCar::CImpICar::Clutch. Called. ICar calls=%i.",TID,m_C);
00443
00444   return NOERROR;
00445 }
00446
00447
00448 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00449   Method:   COCar::CImpICar::Speed
00450
00451   Summary:  The Speed member method of this ICar interface implementation.
00452             A simple empty method on a COCar COM object for tutorial
00453             purposes.  Presumably if this Car object were modeling
00454             a real Car then this method would accelerate/brake to bring
00455             the car to the specified speed.
00456
00457   Args:     short nMph
00458               New speed in miles per hour.
00459
00460   Modifies: m_C.
00461
00462   Returns:  HRESULT
00463               NOERROR
00464 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00465 STDMETHODIMP COCar::CImpICar::Speed(
00466                short nMph)
00467 {
00468   // Increment method call counter purely for tutorial reasons.
00469   m_C++;
00470
00471   LOGF2("L<%X>: COCar::CImpICar::Speed. Called. ICar calls=%i.",TID,m_C);
00472
00473   return NOERROR;
00474 }
00475
00476
00477 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00478   Method:   COCar::CImpICar::Steer
00479
00480   Summary:  The Steer member method of this ICar interface implementation.
00481             A simple empty method on a COCar COM object for tutorial
00482             purposes.  Presumably if this Car object were modeling
00483             a real Car then the Steer method would set the steering
00484             angle of the Car.
00485
00486   Args:     short nAngle)
00487               0 degrees straight ahead, -45 Full left, +45 Full right.
00488
00489   Modifies: m_C.
00490
00491   Returns:  HRESULT
00492               NOERROR
00493 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00494 STDMETHODIMP COCar::CImpICar::Steer(
00495                short nAngle)
00496 {
00497   // Increment method call counter purely for tutorial reasons.
00498   m_C++;
00499
00500   LOGF2("L<%X>: COCar::CImpICar::Steer. Called. ICar calls=%i.",TID,m_C);
00501
00502   return NOERROR;
00503 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows.Net/certpsam.cpp Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows.Net

certpsam.cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 1999
00005 //
00006 // File:        certpsam.cpp
00007 //
00008 // Contents:    Cert Server Policy Module implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013
00014 #pragma hdrstop
00015
00016 #include "celib.h"
00017 #include "policy.h"
00018 #include "module.h"
00019
00020 CComModule _Module;
00021
00022 BEGIN_OBJECT_MAP(ObjectMap)
00023     OBJECT_ENTRY(CLSID_CCertPolicySample, CCertPolicySample)
00024     OBJECT_ENTRY(CLSID_CCertManagePolicyModuleSample, CCertManagePolicyModuleSample)
00025 END_OBJECT_MAP()
00026
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // DLL Entry Point
00030
00031 extern "C"
00032 BOOL WINAPI
00033 DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00034 {
00035     switch (dwReason)
00036     {
00037   case DLL_PROCESS_ATTACH:
00038       _Module.Init(ObjectMap, hInstance);
00039       DisableThreadLibraryCalls(hInstance);
00040       break;
00041
00042         case DLL_PROCESS_DETACH:
00043       _Module.Term();
00044             break;
00045     }
00046     return(TRUE);    // ok
00047 }
00048
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // Used to determine whether the DLL can be unloaded by OLE
00052
00053 STDAPI
00054 DllCanUnloadNow(void)
00055 {
00056     return(_Module.GetLockCount() == 0? S_OK : S_FALSE);
00057 }
00058
00059
00060 /////////////////////////////////////////////////////////////////////////////
00061 // Returns a class factory to create an object of the requested type
00062
00063 STDAPI
00064 DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00065 {
00066     return(_Module.GetClassObject(rclsid, riid, ppv));
00067 }
00068
00069
00070 /////////////////////////////////////////////////////////////////////////////
00071 // DllRegisterServer - Adds entries to the system registry
00072
00073 STDAPI
00074 DllRegisterServer(void)
00075 {
00076     // registers object, typelib and all interfaces in typelib
00077     return(_Module.RegisterServer(TRUE));
00078 }
00079
00080
00081 /////////////////////////////////////////////////////////////////////////////
00082 // DllUnregisterServer - Removes entries from the system registry
00083
00084 STDAPI
00085 DllUnregisterServer(void)
00086 {
00087     _Module.UnregisterServer();
00088     return(S_OK);
00089 }
00090
00091
00092 void __RPC_FAR *__RPC_USER
00093 MIDL_user_allocate(size_t cb)
00094 {
00095     return(LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT, cb));
00096 }
00097
00098
00099 void __RPC_USER
00100 MIDL_user_free(void __RPC_FAR *pb)
00101 {
00102     LocalFree(pb);
00103 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/extensions/io/ASyncWrite/fwasync.c Source File

  • Web
  • iis
  • extensions
  • io
  • ASyncWrite

fwasync.c

Go to the documentation of this file.
00001 /* Copyright (c) 1995-2002 Microsoft Corporation
00002
00003   Module Name:
00004
00005     fwasync.c
00006
00007   Abstract:
00008
00009     This module demonstrates a simple file transfer using ISAPI application
00010     using the Async WriteClient() with callback.
00011 */
00012
00013 #include <windows.h>
00014 #include <stdio.h>
00015 #include "httpext.h"
00016 #include "openf.h"
00017
00018 LIST_ENTRY g_lWorkItems;
00019 CRITICAL_SECTION g_csWorkItems;
00020
00021 #define USE_WORK_QUEUE 0
00022 #define MAX_BUFFER_SIZE 4096
00023
00024 typedef struct _AIO_WORK_ITEM {
00025
00026     LIST_ENTRY    listEntry;
00027     EXTENSION_CONTROL_BLOCK * pecb;
00028     HANDLE        hFile;
00029     OVERLAPPED    ov;
00030     DWORD         nRead;
00031     CHAR          pchBuffer[ MAX_BUFFER_SIZE ];
00032
00033 }  AIO_WORK_ITEM, * PAWI;
00034
00035 DWORD SendHeaderToClient(IN EXTENSION_CONTROL_BLOCK *pecb, IN LPCSTR pszErrorMsg);
00036 DWORD SendFileToClient(IN EXTENSION_CONTROL_BLOCK *pecb, IN LPCSTR pszFile);
00037 DWORD SendFileOver(IN EXTENSION_CONTROL_BLOCK *pecb, IN HANDLE hFile);
00038
00039 /*
00040   Description:
00041
00042     This function DllLibMain() is the main initialization function for
00043     this DLL. It initializes local variables and prepares it to be invoked
00044     subsequently.
00045
00046   Arguments:
00047
00048     hinstDll          Instance Handle of the DLL
00049     fdwReason         Reason why NT called this DLL
00050     lpvReserved       Reserved parameter for future use.
00051
00052   Returns:
00053
00054     TRUE is successful; otherwise FALSE is returned.
00055 */
00056
00057 BOOL WINAPI DllMain(IN HINSTANCE hinstDll, IN DWORD fdwReason, IN LPVOID lpvContext OPTIONAL)
00058 {
00059   BOOL fReturn = TRUE;
00060
00061   switch (fdwReason) {
00062
00063     case DLL_PROCESS_ATTACH :
00064
00065       OutputDebugString( "Initializing the global data for fwasync.dll\n");
00066
00067       /* Initialize various data and modules. */
00068
00069       InitializeCriticalSection(&g_csWorkItems);
00070
00071       InitializeListHead(&g_lWorkItems);
00072
00073       fReturn = (InitFileHandleCache() == NO_ERROR);
00074
00075       break;
00076
00077     case DLL_PROCESS_DETACH :
00078
00079       /*
00080         Only cleanup when we are called because of a FreeLibrary() *i.e., when lpvContext == NULL)
00081         If we are called because of a process termination, dont free anything. System will free resources and memory for us.
00082       */
00083
00084       CleanupFileHandleCache();
00085
00086       if (lpvContext != NULL)
00087         DeleteCriticalSection(&g_csWorkItems);
00088
00089       break;
00090
00091     default :
00092
00093       break;
00094   }
00095
00096   return fReturn;
00097 }
00098
00099 /*
00100   Description:
00101
00102     This function performs the necessary action to send response for the
00103     request received from the client. It picks up the name of a file from
00104     the pecb->lpszQueryString and sends the file using Asynchronous WriteClient
00105
00106   Arguments:
00107
00108     pecb          pointer to ECB containing parameters related to the request.
00109
00110   Returns:
00111
00112     Returns HSE_* status codes
00113 */
00114
00115 DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pecb)
00116 {
00117   DWORD hseStatus;
00118
00119   if (pecb->lpszQueryString == NULL)
00120     hseStatus = SendHeaderToClient(pecb, "File Not Found");
00121   else
00122     hseStatus = SendFileToClient(pecb, pecb->lpszQueryString);
00123
00124   return hseStatus;
00125 }
00126
00127 /*
00128   Description:
00129
00130     Sets the ISAPI extension version information.
00131
00132   Arguments:
00133
00134     Version     pointer to HSE_VERSION_INFO structure
00135
00136   Return Value:
00137
00138     TRUE
00139 */
00140
00141 BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer)
00142 {
00143   pVer->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
00144
00145   lstrcpyn((LPSTR) pVer->lpszExtensionDesc, "File Transfer using WriteClient", HSE_MAX_EXT_DLL_NAME_LEN);
00146
00147   return TRUE;
00148 }
00149
00150 /*
00151   Description:
00152
00153     This function is called when IIS decides to stop and unload the
00154     ISAPI DLL. We can do any custom cleanup for the module inside this function
00155 */
00156
00157 BOOL WINAPI TerminateExtension(DWORD dwFlags)
00158 {
00159   /* Nothing specific do here for cleanup. Cleanup is done in the dll process detach in DllLibMain() */
00160
00161   return TRUE;
00162 }
00163
00164 DWORD SendHeaderToClient(IN EXTENSION_CONTROL_BLOCK *pecb, IN LPCSTR pszErrorMsg)
00165 {
00166   HSE_SEND_HEADER_EX_INFO SendHeaderExInfo;
00167   char szStatus[] = "200 OK";
00168   char szHeader[1024];
00169
00170   /* Note the HTTP header block is terminated by a blank '\r\n' pair, followed by the document body */
00171
00172   wsprintf(szHeader, "Content-Type: text/html\r\n\r\n<head><title>Simple File Transfer (Async Write)</title></head>\n<body><h1>%s</h1>\n", pszErrorMsg);
00173
00174   /* Populate SendHeaderExInfo struct */
00175
00176   SendHeaderExInfo.pszStatus = szStatus;
00177   SendHeaderExInfo.pszHeader = szHeader;
00178   SendHeaderExInfo.cchStatus = lstrlen(szStatus);
00179   SendHeaderExInfo.cchHeader = lstrlen(szHeader);
00180   SendHeaderExInfo.fKeepConn = FALSE;
00181
00182   /* Send header - use the EX Version to send the header blob */
00183
00184   if (!pecb->ServerSupportFunction(pecb->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SendHeaderExInfo, NULL, NULL))
00185     return HSE_STATUS_ERROR;
00186
00187   return HSE_STATUS_SUCCESS;
00188 }
00189
00190 DWORD SendFileToClient(IN EXTENSION_CONTROL_BLOCK  *pecb, IN LPCSTR pszFile)
00191 {
00192   CHAR    pchBuffer[1024];
00193   HANDLE  hFile;
00194   DWORD   hseStatus = HSE_STATUS_SUCCESS;
00195
00196   hFile = FcOpenFile(pecb, pszFile);
00197
00198   if (hFile == INVALID_HANDLE_VALUE) {
00199
00200     wsprintfA(pchBuffer, "OpenFailed: Error (%d) while opening the file %s.\n", GetLastError(), pszFile);
00201
00202     hseStatus = SendHeaderToClient( pecb, pchBuffer);
00203
00204   } else {
00205
00206     wsprintfA(pchBuffer, " Transferred file contains...");
00207
00208     hseStatus = SendHeaderToClient(pecb, pchBuffer);
00209
00210     if (hseStatus == HSE_STATUS_SUCCESS) {
00211
00212       hseStatus = SendFileOver(pecb, hFile);
00213
00214       if (hseStatus != HSE_STATUS_PENDING) {
00215
00216         /* assume that the data is transmitted, and close file handle */
00217
00218         FcCloseFile(hFile);
00219
00220         if (hseStatus != HSE_STATUS_SUCCESS) {
00221
00222           /* Error in transmitting the file. Send error message. */
00223
00224           wsprintfA(pchBuffer, "Send Failed: Error (%d) for file %s.\n", GetLastError(), pszFile);
00225
00226           SendHeaderToClient(pecb, pchBuffer);
00227         }
00228       }
00229     }
00230   }
00231
00232   return (hseStatus);
00233 }
00234
00235 DWORD ReadDataForPaw(IN PAWI paw)
00236 {
00237   DWORD hseStatus = HSE_STATUS_SUCCESS;
00238
00239   /* read data from the file */
00240
00241   if (!FcReadFromFile(paw->hFile, paw->pchBuffer, MAX_BUFFER_SIZE, &paw->nRead, &paw->ov))
00242     hseStatus = HSE_STATUS_ERROR;
00243
00244   return hseStatus;
00245 }
00246
00247 DWORD SendDataForPaw(IN PAWI paw)
00248 {
00249   DWORD hseStatus = HSE_STATUS_PENDING;
00250
00251   /* write data to client */
00252
00253   if (!paw->pecb->WriteClient(paw->pecb->ConnID, paw->pchBuffer, &paw->nRead, HSE_IO_ASYNC))
00254     hseStatus = HSE_STATUS_ERROR;
00255
00256   return hseStatus;
00257 }
00258
00259 VOID CleanupAW(IN PAWI paw, IN BOOL fDoneWithSession)
00260 {
00261   DWORD err = GetLastError();
00262
00263   FcCloseFile(paw->hFile);
00264
00265   CloseHandle(paw->ov.hEvent);
00266
00267   if (fDoneWithSession)
00268       paw->pecb->ServerSupportFunction( paw->pecb->ConnID, HSE_REQ_DONE_WITH_SESSION, NULL, NULL, NULL);
00269
00270   SetLastError(err);
00271
00272   /* Remove from work items list */
00273
00274   #if USE_WORK_QUEUE
00275     EnterCriticalSection(&g_csWorkItems);
00276     RemoveEntryList(&paw->listEntry);
00277     LeaveCriticalSection(&g_csWorkItems);
00278   # endif
00279
00280   LocalFree(paw);
00281 }
00282
00283 /*
00284   Description:
00285
00286     This is the callback function for handling completions of asynchronous IO.
00287     This function performs necessary cleanup and resubmits additional IO
00288     (if required). In this case, this function is called at the end of a
00289     successful Async WriteClient(). This function attempts to read the next
00290     chunk of data and sends it to client. If there is no next chunk this
00291     function cleans up the state and informs IIS about its intention to end
00292     the request.
00293
00294   Arguments:
00295
00296     pecb          pointer to ECB containing parameters related to the request.
00297     pContext      context information supplied with the asynchronous IO call.
00298     cbIO          count of bytes of IO in the last call.
00299     dwError       Error if any, for the last IO operation.
00300
00301   Returns:
00302
00303     None.
00304 */
00305
00306 VOID WINAPI HseIoCompletion(IN EXTENSION_CONTROL_BLOCK *pECB, IN PVOID pContext, IN DWORD cbIO, IN DWORD dwError)
00307 {
00308   PAWI paw = (PAWI)pContext;
00309   EXTENSION_CONTROL_BLOCK *pecb = paw->pecb;
00310   DWORD hseStatus;
00311
00312   /*
00313     1. if no errors, do another read of the file
00314     2. send the read contents to client
00315     3. if no data present, cleanup and exit
00316   */
00317
00318   if (dwError != NO_ERROR) {
00319
00320     /* Do Cleanup */
00321
00322     CleanupAW(paw, TRUE);
00323
00324     return;
00325   }
00326
00327   /* Read next chunk of data */
00328
00329   paw->nRead = 0;
00330
00331   hseStatus = ReadDataForPaw(paw);
00332
00333   if (hseStatus == HSE_STATUS_SUCCESS && paw->nRead > 0)
00334     hseStatus = SendDataForPaw( paw);
00335
00336   if (hseStatus != HSE_STATUS_PENDING)
00337     CleanupAW( paw, TRUE);
00338 }
00339
00340 DWORD SendFileOver(IN EXTENSION_CONTROL_BLOCK *pecb, IN HANDLE hFile)
00341 {
00342   PAWI paw;
00343   DWORD hseStatus = HSE_STATUS_SUCCESS;
00344
00345   paw = (PAWI)LocalAlloc(LMEM_FIXED, sizeof(AIO_WORK_ITEM));
00346
00347   if (paw == NULL) {
00348
00349     SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00350
00351     return HSE_STATUS_ERROR;
00352   }
00353
00354   /* Fill in all the data in AIO_WORK_ITEM */
00355
00356   paw->pecb = pecb;
00357   InitializeListHead(&paw->listEntry);
00358   paw->hFile = hFile;
00359   paw->nRead = 0;
00360   memset(&paw->ov, 0, sizeof(OVERLAPPED));
00361   paw->ov.OffsetHigh = 0;
00362   paw->ov.Offset = 0;
00363   paw->ov.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
00364
00365   if (paw->ov.hEvent == NULL) {
00366
00367     LocalFree(paw);
00368
00369     return HSE_STATUS_ERROR;
00370   }
00371
00372   /* Setup the callback context for the Async IO */
00373
00374   if (!pecb->ServerSupportFunction(pecb->ConnID, HSE_REQ_IO_COMPLETION, HseIoCompletion, 0, (LPDWORD)paw)) {
00375
00376     /* Do cleanup and return error */
00377
00378     CloseHandle(paw->ov.hEvent);
00379
00380     LocalFree(paw);
00381
00382     return HSE_STATUS_ERROR;
00383   }
00384
00385   /* Add to the list */
00386
00387   #if USE_WORK_QUEUE
00388     EnterCriticalSection(&g_csWorkItems);
00389     InsertTailList(&g_lWorkItems,  &paw->listEntry);
00390     LeaveCriticalSection(&g_csWorkItems);
00391   #endif
00392
00393   hseStatus = ReadDataForPaw(paw);
00394
00395   if (hseStatus == HSE_STATUS_SUCCESS && paw->nRead > 0)
00396     hseStatus = SendDataForPaw( paw);
00397
00398   if (hseStatus != HSE_STATUS_PENDING)
00399     CleanupAW(paw, FALSE);
00400
00401   return hseStatus;
00402 }
00403
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/DsBrowse/bitmaps/afxres.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • DsBrowse
  • bitmaps

afxres.h

Go to the documentation of this file.
00001 // Microsoft Foundation Classes C++ library.
00002 // Copyright (C) 1992 - 2000 Microsoft Corporation,
00003 // All rights reserved.
00004
00005 // This source code is only intended as a supplement to the
00006 // Microsoft Foundation Classes Reference and Microsoft
00007 // QuickHelp and/or WinHelp documentation provided with the library.
00008 // See these sources for detailed information regarding the
00009 // Microsoft Foundation Classes product.
00010
00011 #ifndef __AFXRES_H__
00012 #define __AFXRES_H__
00013
00014 #define _AFXRES    1            // this is an MFC project
00015
00016 #ifdef RC_INVOKED
00017 #ifndef _INC_WINDOWS
00018 #define _INC_WINDOWS
00019 #include <winres.h>            // extract from windows header
00020 #endif
00021 #endif
00022
00023 #ifdef APSTUDIO_INVOKED
00024 #define APSTUDIO_HIDDEN_SYMBOLS
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // MFC resource types (see Technical note TN024 for implementation details)
00029
00030 #ifdef RC_INVOKED
00031 #define DLGINIT     240
00032 #else
00033 #define RT_DLGINIT  MAKEINTRESOURCE(240)
00034 #endif
00035
00036 #define WM_VBXINIT      (WM_USER+0)
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039
00040 #ifdef APSTUDIO_INVOKED
00041 #undef APSTUDIO_HIDDEN_SYMBOLS
00042 #endif
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045 // General style bits etc
00046
00047 // ControlBar styles
00048 #define CBRS_NOALIGN        0x00000000L
00049 #define CBRS_LEFT           0x00001400L     // align on left, line on right
00050 #define CBRS_TOP            0x00002800L     // align on top, line on bottom
00051 #define CBRS_RIGHT          0x00004100L     // align on right, line on left
00052 #define CBRS_BOTTOM         0x00008200L     // align on bottom, line on top
00053
00054 /////////////////////////////////////////////////////////////////////////////
00055 // Standard window components
00056
00057 // Mode indicators in status bar - these are routed like commands
00058 #define ID_INDICATOR_EXT                0xE700  // extended selection indicator
00059 #define ID_INDICATOR_CAPS               0xE701  // cap lock indicator
00060 #define ID_INDICATOR_NUM                0xE702  // num lock indicator
00061 #define ID_INDICATOR_SCRL               0xE703  // scroll lock indicator
00062 #define ID_INDICATOR_OVR                0xE704  // overtype mode indicator
00063 #define ID_INDICATOR_REC                0xE705  // record mode indicator
00064
00065 #define ID_SEPARATOR                    0   // special separator value
00066
00067
00068 #ifndef RC_INVOKED  // code only
00069 // Standard control bars (IDW = window ID)
00070 #define AFX_IDW_CONTROLBAR_FIRST 0xE800
00071 #define AFX_IDW_CONTROLBAR_LAST 0xE8FF
00072
00073 #define AFX_IDW_TOOLBAR                 0xE800  // main Toolbar for window
00074 #define AFX_IDW_STATUS_BAR              0xE801  // Status bar window
00075 #define AFX_IDW_PREVIEW_BAR             0xE802  // PrintPreview Dialog Bar
00076 #define AFX_IDW_RESIZE_BAR              0xE803  // OLE in-place resize bar
00077
00078 // Macro for mapping standard control bars to bitmask (limit of 32)
00079 #define AFX_CONTROLBAR_MASK(nIDC)   (1L << (nIDC - AFX_IDW_CONTROLBAR_FIRST))
00080
00081 // parts of Main Frame
00082 #define AFX_IDW_PANE_FIRST              0xE900  // first pane (256 max)
00083 #define AFX_IDW_PANE_LAST               0xE9ff
00084 #define AFX_IDW_HSCROLL_FIRST           0xEA00  // first Horz scrollbar (16 max)
00085 #define AFX_IDW_VSCROLL_FIRST           0xEA10  // first Vert scrollbar (16 max)
00086
00087 #define AFX_IDW_SIZE_BOX                0xEA20  // size box for splitters
00088 #define AFX_IDW_PANE_SAVE               0xEA21  // to shift AFX_IDW_PANE_FIRST
00089 #endif //!RC_INVOKED
00090
00091 #ifndef APSTUDIO_INVOKED
00092 // common style for form views
00093 #define AFX_WS_DEFAULT_VIEW             (WS_CHILD | WS_VISIBLE | WS_BORDER)
00094 #endif
00095
00096 /////////////////////////////////////////////////////////////////////////////
00097 // Standard app configurable strings
00098
00099 // for application title (defaults to EXE name or name in constructor)
00100 #define AFX_IDS_APP_TITLE               0xE000
00101 // idle message bar line
00102 #define AFX_IDS_IDLEMESSAGE             0xE001
00103 // message bar line when in shift-F1 help mode
00104 #define AFX_IDS_HELPMODEMESSAGE         0xE002
00105 // application title when OLE 2.0 object is in-place active
00106 #define AFX_IDS_APP_TITLE_INPLACE       0xE003
00107 // document title when editing OLE 2.0 embedding
00108 #define AFX_IDS_APP_TITLE_EMBEDDING     0xE004
00109
00110 /////////////////////////////////////////////////////////////////////////////
00111 // Standard Commands
00112
00113 // File commands
00114 #define ID_FILE_NEW                     0xE100
00115 #define ID_FILE_OPEN                    0xE101
00116 #define ID_FILE_CLOSE                   0xE102
00117 #define ID_FILE_SAVE                    0xE103
00118 #define ID_FILE_SAVE_AS                 0xE104
00119 #define ID_FILE_PAGE_SETUP              0xE105
00120 #define ID_FILE_PRINT_SETUP             0xE106
00121 #define ID_FILE_PRINT                   0xE107
00122 #define ID_FILE_PRINT_PREVIEW           0xE108
00123 #define ID_FILE_UPDATE                  0xE109
00124 #define ID_FILE_SAVE_COPY_AS            0xE10A
00125
00126 #define ID_FILE_MRU_FILE1               0xE110          // range - 16 max
00127 #define ID_FILE_MRU_FILE2               0xE111
00128 #define ID_FILE_MRU_FILE3               0xE112
00129 #define ID_FILE_MRU_FILE4               0xE113
00130
00131 // Edit commands
00132 #define ID_EDIT_CLEAR                   0xE120
00133 #define ID_EDIT_CLEAR_ALL               0xE121
00134 #define ID_EDIT_COPY                    0xE122
00135 #define ID_EDIT_CUT                     0xE123
00136 #define ID_EDIT_FIND                    0xE124
00137 #define ID_EDIT_PASTE                   0xE125
00138 #define ID_EDIT_PASTE_LINK              0xE126
00139 #define ID_EDIT_PASTE_SPECIAL           0xE127
00140 #define ID_EDIT_REPEAT                  0xE128
00141 #define ID_EDIT_REPLACE                 0xE129
00142 #define ID_EDIT_SELECT_ALL              0xE12A
00143 #define ID_EDIT_UNDO                    0xE12B
00144 #define ID_EDIT_REDO                    0xE12C
00145
00146 // Window commands
00147 #define ID_WINDOW_NEW                   0xE130
00148 #define ID_WINDOW_ARRANGE               0xE131
00149 #define ID_WINDOW_CASCADE               0xE132
00150 #define ID_WINDOW_TILE_HORZ             0xE133
00151 #define ID_WINDOW_TILE_VERT             0xE134
00152 #define ID_WINDOW_SPLIT                 0xE135
00153 #ifndef RC_INVOKED      // code only
00154 #define AFX_IDM_WINDOW_FIRST            0xE130
00155 #define AFX_IDM_WINDOW_LAST             0xE13F
00156 #define AFX_IDM_FIRST_MDICHILD          0xFF00  // window list starts here
00157 #endif //!RC_INVOKED
00158
00159 // Help and App commands
00160 #define ID_APP_ABOUT                    0xE140
00161 #define ID_APP_EXIT                     0xE141
00162 #define ID_HELP_INDEX                   0xE142
00163 #define ID_HELP_USING                   0xE143
00164 #define ID_CONTEXT_HELP                 0xE144      // shift-F1
00165 // special commands for processing help
00166 #define ID_HELP                         0xE145      // first attempt for F1
00167 #define ID_DEFAULT_HELP                 0xE146      // last attempt
00168
00169 // Misc
00170 #define ID_NEXT_PANE                    0xE150
00171 #define ID_PREV_PANE                    0xE151
00172
00173 // OLE commands
00174 #define ID_OLE_INSERT_NEW               0xE200
00175 #define ID_OLE_EDIT_LINKS               0xE201
00176 #define ID_OLE_EDIT_CONVERT             0xE202
00177 #define ID_OLE_EDIT_CHANGE_ICON         0xE203
00178 #define ID_OLE_VERB_FIRST               0xE210     // range - 16 max
00179 #ifndef RC_INVOKED      // code only
00180 #define ID_OLE_VERB_LAST                0xE21F
00181 #endif //!RC_INVOKED
00182
00183 // for print preview dialog bar
00184 #define AFX_ID_PREVIEW_CLOSE            0xE300
00185 #define AFX_ID_PREVIEW_NUMPAGE          0xE301      // One/Two Page button
00186 #define AFX_ID_PREVIEW_NEXT             0xE302
00187 #define AFX_ID_PREVIEW_PREV             0xE303
00188 #define AFX_ID_PREVIEW_PRINT            0xE304
00189 #define AFX_ID_PREVIEW_ZOOMIN           0xE305
00190 #define AFX_ID_PREVIEW_ZOOMOUT          0xE306
00191
00192 // View commands (same number used as IDW used for control bar)
00193 #define ID_VIEW_TOOLBAR                 0xE800
00194 #define ID_VIEW_STATUS_BAR              0xE801
00195   // -> E8FF reserved for other control bar commands
00196
00197 // RecordForm commands
00198 #define ID_RECORD_FIRST                 0xE900
00199 #define ID_RECORD_LAST                  0xE901
00200 #define ID_RECORD_NEXT                  0xE902
00201 #define ID_RECORD_PREV                  0xE903
00202
00203 /////////////////////////////////////////////////////////////////////////////
00204 // Standard control IDs
00205
00206 #define IDC_STATIC              -1      // all static controls
00207
00208 /////////////////////////////////////////////////////////////////////////////
00209 // Standard string error/warnings
00210
00211 #ifndef RC_INVOKED      // code only
00212 #define AFX_IDS_SCFIRST                 0xEF00
00213 #endif //!RC_INVOKED
00214
00215 #define AFX_IDS_SCSIZE                  0xEF00
00216 #define AFX_IDS_SCMOVE                  0xEF01
00217 #define AFX_IDS_SCMINIMIZE              0xEF02
00218 #define AFX_IDS_SCMAXIMIZE              0xEF03
00219 #define AFX_IDS_SCNEXTWINDOW            0xEF04
00220 #define AFX_IDS_SCPREVWINDOW            0xEF05
00221 #define AFX_IDS_SCCLOSE                 0xEF06
00222 #define AFX_IDS_SCRESTORE               0xEF12
00223 #define AFX_IDS_SCTASKLIST              0xEF13
00224
00225 #define AFX_IDS_MDICHILD                0xEF1F
00226
00227 #define AFX_IDS_DESKACCESSORY           0xEFDA
00228
00229 // General strings
00230 #define AFX_IDS_OPENFILE                0xF000
00231 #define AFX_IDS_SAVEFILE                0xF001
00232 #define AFX_IDS_ALLFILTER               0xF002
00233 #define AFX_IDS_UNTITLED                0xF003
00234 #define AFX_IDS_SAVEFILECOPY            0xF004
00235 #define AFX_IDS_PREVIEW_CLOSE           0xF005
00236
00237 // Printing and print preview strings
00238 #define AFX_IDS_PRINTONPORT             0xF040
00239 #define AFX_IDS_ONEPAGE                 0xF041
00240 #define AFX_IDS_TWOPAGE                 0xF042
00241 #define AFX_IDS_PRINTPAGENUM            0xF043
00242 #define AFX_IDS_PREVIEWPAGEDESC         0xF044
00243
00244 // OLE strings
00245 #define AFX_IDS_OBJECT_MENUITEM         0xF080
00246 #define AFX_IDS_EDIT_VERB               0xF081
00247 #define AFX_IDS_ACTIVATE_VERB           0xF082
00248 #define AFX_IDS_CHANGE_LINK             0xF083
00249 #define AFX_IDS_AUTO                    0xF084
00250 #define AFX_IDS_MANUAL                  0xF085
00251 #define AFX_IDS_FROZEN                  0xF086
00252 #define AFX_IDS_ALL_FILES               0xF087
00253   // dynamically changing menu items
00254 #define AFX_IDS_SAVE_MENU               0xF088
00255 #define AFX_IDS_UPDATE_MENU             0xF089
00256 #define AFX_IDS_SAVE_AS_MENU            0xF08A
00257 #define AFX_IDS_SAVE_COPY_AS_MENU       0xF08B
00258 #define AFX_IDS_EXIT_MENU               0xF08C
00259 #define AFX_IDS_UPDATING_ITEMS          0xF08D
00260   // COlePasteSpecialDialog defines
00261 #define AFX_IDS_METAFILE_FORMAT         0xF08E
00262 #define AFX_IDS_DIB_FORMAT              0xF08F
00263 #define AFX_IDS_BITMAP_FORMAT           0xF090
00264 #define AFX_IDS_LINKSOURCE_FORMAT       0xF091
00265 #define AFX_IDS_EMBED_FORMAT            0xF092
00266
00267 // General error / prompt strings
00268 #define AFX_IDP_INVALID_FILENAME        0xF100
00269 #define AFX_IDP_FAILED_TO_OPEN_DOC      0xF101
00270 #define AFX_IDP_FAILED_TO_SAVE_DOC      0xF102
00271 #define AFX_IDP_ASK_TO_SAVE             0xF103
00272 #define AFX_IDP_FAILED_TO_CREATE_DOC    0xF104
00273 #define AFX_IDP_FILE_TOO_LARGE          0xF105
00274 #define AFX_IDP_FAILED_TO_START_PRINT   0xF106
00275 #define AFX_IDP_FAILED_TO_LAUNCH_HELP   0xF107
00276 #define AFX_IDP_INTERNAL_FAILURE        0xF108      // general failure
00277 #define AFX_IDP_COMMAND_FAILURE         0xF109      // command failure
00278 #define AFX_IDP_FAILED_MEMORY_ALLOC     0xF10A
00279 #define AFX_IDP_VB2APICALLED            0xF10B
00280
00281 // DDV parse errors
00282 #define AFX_IDP_PARSE_INT               0xF110
00283 #define AFX_IDP_PARSE_REAL              0xF111
00284 #define AFX_IDP_PARSE_INT_RANGE         0xF112
00285 #define AFX_IDP_PARSE_REAL_RANGE        0xF113
00286 #define AFX_IDP_PARSE_STRING_SIZE       0xF114
00287 #define AFX_IDP_PARSE_RADIO_BUTTON      0xF115
00288
00289 // CFile/CArchive error strings for user failure
00290 #define AFX_IDP_FAILED_INVALID_FORMAT   0xF120
00291 #define AFX_IDP_FAILED_INVALID_PATH     0xF121
00292 #define AFX_IDP_FAILED_DISK_FULL        0xF122
00293 #define AFX_IDP_FAILED_ACCESS_READ      0xF123
00294 #define AFX_IDP_FAILED_ACCESS_WRITE     0xF124
00295 #define AFX_IDP_FAILED_IO_ERROR_READ    0xF125
00296 #define AFX_IDP_FAILED_IO_ERROR_WRITE   0xF126
00297
00298 // OLE errors / prompt strings
00299 #define AFX_IDP_STATIC_OBJECT           0xF180
00300 #define AFX_IDP_FAILED_TO_CONNECT       0xF181
00301 #define AFX_IDP_SERVER_BUSY             0xF182
00302 #define AFX_IDP_BAD_VERB                0xF183
00303 #define AFX_IDP_FAILED_TO_NOTIFY        0xF185
00304 #define AFX_IDP_FAILED_TO_LAUNCH        0xF186
00305 #define AFX_IDP_ASK_TO_UPDATE           0xF187
00306 #define AFX_IDP_FAILED_TO_UPDATE        0xF188
00307 #define AFX_IDP_FAILED_TO_REGISTER      0xF189
00308 #define AFX_IDP_FAILED_TO_AUTO_REGISTER 0xF18A
00309 #define AFX_IDP_FAILED_TO_CONVERT       0xF18B
00310 #define AFX_IDP_GET_NOT_SUPPORTED       0xF18C
00311 #define AFX_IDP_SET_NOT_SUPPORTED       0xF18D
00312 #define AFX_IDP_ASK_TO_DISCARD          0xF18E
00313
00314 // 0xf200-0xf20f reserved for use by VBX library code
00315
00316 // Database errors / prompt strings
00317 #ifndef RC_INVOKED      // code only
00318 #define AFX_IDP_SQL_FIRST               0xF280
00319 #endif //!RC_INVOKED
00320 #define AFX_IDP_SQL_CONNECT_FAIL              0xF281
00321 #define AFX_IDP_SQL_RECORDSET_FORWARD_ONLY    0xF282
00322 #define AFX_IDP_SQL_EMPTY_COLUMN_LIST         0xF283
00323 #define AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH     0xF284
00324 #define AFX_IDP_SQL_ILLEGAL_MODE              0xF285
00325 #define AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED    0xF286
00326 #define AFX_IDP_SQL_NO_CURRENT_RECORD         0xF287
00327 #define AFX_IDP_SQL_NO_ROWS_AFFECTED          0xF288
00328 #define AFX_IDP_SQL_RECORDSET_READONLY        0xF289
00329 #define AFX_IDP_SQL_SQL_NO_TOTAL              0xF28A
00330 #define AFX_IDP_SQL_ODBC_LOAD_FAILED          0xF28B
00331 #define AFX_IDP_SQL_DYNASET_NOT_SUPPORTED     0xF28C
00332 #define AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED    0xF28D
00333 #define AFX_IDP_SQL_API_CONFORMANCE           0xF28E
00334 #define AFX_IDP_SQL_SQL_CONFORMANCE           0xF28F
00335 #define AFX_IDP_SQL_NO_DATA_FOUND             0xF290
00336 #define AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED  0xF291
00337 #define AFX_IDP_SQL_ODBC_V2_REQUIRED          0xF292
00338 #define AFX_IDP_SQL_NO_POSITIONED_UPDATES     0xF293
00339 #define AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED   0xF294
00340 #define AFX_IDP_SQL_DATA_TRUNCATED            0xF295
00341
00342 /////////////////////////////////////////////////////////////////////////////
00343 // AFX implementation - control IDs (AFX_IDC)
00344
00345 // Parts of dialogs
00346 #define AFX_IDC_LISTBOX                 100
00347 #define AFX_IDC_CHANGE                  101
00348
00349 // for print dialog
00350 #define AFX_IDC_PRINT_DOCNAME           201
00351 #define AFX_IDC_PRINT_PRINTERNAME       202
00352 #define AFX_IDC_PRINT_PORTNAME          203
00353 #define AFX_IDC_PRINT_PAGENUM           204
00354
00355 /////////////////////////////////////////////////////////////////////////////
00356 // IDRs for standard components
00357
00358 // AFX standard ICON IDs (for MFC V1 apps)
00359 #define AFX_IDI_STD_MDIFRAME            1
00360 #define AFX_IDI_STD_FRAME               2
00361
00362 #ifndef RC_INVOKED  // code only
00363 // These are really COMMDLG dialogs, so there usually isn't a resource
00364 // for them, but these IDs are used as help IDs.
00365 #define AFX_IDD_FILEOPEN                28676
00366 #define AFX_IDD_FILESAVE                28677
00367 #define AFX_IDD_FONT                    28678
00368 #define AFX_IDD_COLOR                   28679
00369 #define AFX_IDD_PRINT                   28680
00370 #define AFX_IDD_PRINTSETUP              28681
00371 #define AFX_IDD_FIND                    28682
00372 #define AFX_IDD_REPLACE                 28683
00373 #endif //!RC_INVOKED
00374
00375 // Standard dialogs app should leave alone (0x7801->)
00376 #define AFX_IDD_NEWTYPEDLG              30721
00377 #define AFX_IDD_PRINTDLG                30722
00378 #define AFX_IDD_PREVIEW_TOOLBAR         30723
00379
00380 // Dialogs defined for OLE2UI library
00381 #define AFX_IDD_INSERTOBJECT            30724
00382 #define AFX_IDD_CHANGEICON              30725
00383 #define AFX_IDD_CONVERT                 30726
00384 #define AFX_IDD_PASTESPECIAL            30727
00385 #define AFX_IDD_EDITLINKS               30728
00386 #define AFX_IDD_FILEBROWSE              30729
00387 #define AFX_IDD_BUSY                    30730
00388
00389 // Standard cursors (0x7901->)
00390   // AFX_IDC = Cursor resources
00391 #define AFX_IDC_CONTEXTHELP             30977       // context sensitive help
00392 #define AFX_IDC_MAGNIFY                 30978       // print preview zoom
00393 #define AFX_IDC_SMALLARROWS             30979       // splitter
00394 #define AFX_IDC_HSPLITBAR               30980       // splitter
00395 #define AFX_IDC_VSPLITBAR               30981       // splitter
00396 #define AFX_IDC_NODROPCRSR              30982       // No Drop Cursor
00397 #define AFX_IDC_TRACKNWSE               30983       // tracker
00398 #define AFX_IDC_TRACKNESW               30984       // tracker
00399 #define AFX_IDC_TRACKNS                 30985       // tracker
00400 #define AFX_IDC_TRACKWE                 30986       // tracker
00401 #define AFX_IDC_TRACK4WAY               30987       // tracker
00402 #define AFX_IDC_MOVE4WAY                30988       // resize bar (server only)
00403
00404 #ifdef _AFXCTL
00405 /////////////////////////////////////////////////////////////////////////////
00406 // AFX OLE control implementation - control IDs (AFX_IDC)
00407
00408 // Font property page
00409 #define AFX_IDC_FONTPROP                1000
00410 #define AFX_IDC_FONTNAMES               1001
00411 #define AFX_IDC_FONTSTYLES              1002
00412 #define AFX_IDC_FONTSIZES               1003
00413 #define AFX_IDC_STRIKEOUT               1004
00414 #define AFX_IDC_UNDERLINE               1005
00415 #define AFX_IDC_SAMPLEBOX               1006
00416
00417 // Color property page
00418 #define AFX_IDC_COLOR_BLACK             1100
00419 #define AFX_IDC_COLOR_WHITE             1101
00420 #define AFX_IDC_COLOR_RED               1102
00421 #define AFX_IDC_COLOR_GREEN             1103
00422 #define AFX_IDC_COLOR_BLUE              1104
00423 #define AFX_IDC_COLOR_YELLOW            1105
00424 #define AFX_IDC_COLOR_MAGENTA           1106
00425 #define AFX_IDC_COLOR_CYAN              1107
00426 #define AFX_IDC_COLOR_GRAY              1108
00427 #define AFX_IDC_COLOR_LIGHTGRAY         1109
00428 #define AFX_IDC_COLOR_DARKRED           1110
00429 #define AFX_IDC_COLOR_DARKGREEN         1111
00430 #define AFX_IDC_COLOR_DARKBLUE          1112
00431 #define AFX_IDC_COLOR_LIGHTBROWN        1113
00432 #define AFX_IDC_COLOR_DARKMAGENTA       1114
00433 #define AFX_IDC_COLOR_DARKCYAN          1115
00434 #define AFX_IDC_COLORPROP               1116
00435 #define AFX_IDC_SYSTEMCOLORS            1117
00436
00437 // Picture porperty page
00438 #define AFX_IDC_PROPNAME                1201
00439 #define AFX_IDC_PICTURE                 1202
00440 #define AFX_IDC_BROWSE                  1203
00441
00442 // Property Sheet control id's
00443 #define ID_APPLY_NOW                    0xEA00
00444
00445 /////////////////////////////////////////////////////////////////////////////
00446 // IDRs for OLE control standard components
00447
00448 // Standard propery page dialogs app should leave alone (0x7E01->)
00449 #define AFX_IDD_PROPPAGE_COLOR         32257
00450 #define AFX_IDD_PROPPAGE_FONT          32258
00451 #define AFX_IDD_PROPPAGE_PICTURE       32259
00452
00453 #define AFX_IDB_TRUETYPE               32384
00454
00455 // Tab Control bitmap IDs
00456 #define AFX_IDB_SCROLL                  30989
00457 #define AFX_IDB_SCROLL_LEFT             30990
00458 #define AFX_IDB_SCROLL_RIGHT            30991
00459 #define AFX_IDB_SCROLL_LEFT_DIS         30992
00460 #define AFX_IDB_SCROLL_RIGHT_DIS        30993
00461
00462 /////////////////////////////////////////////////////////////////////////////
00463 // Standard OLE control string error/warnings
00464
00465 // Property Sheet button strings
00466 #define AFX_IDS_PS_OK                   0xF220
00467 #define AFX_IDS_PS_CANCEL               0xF221
00468 #define AFX_IDS_PS_APPLY_NOW            0xF222
00469 #define AFX_IDS_PS_HELP                 0xF223
00470 #define AFX_IDS_PS_CLOSE                0xF224
00471
00472 #define AFX_IDS_DEFAULT_PAGE_TITLE      0xFE00
00473 #define AFX_IDS_PROPPAGE_UNKNOWN        0xFE01
00474 #define AFX_IDS_FRAMECAPTIONFORMAT      0xFE02
00475 #define AFX_IDS_PROPERTIES              0xFE03
00476 #define AFX_IDS_COLOR_DESKTOP           0xFE04
00477 #define AFX_IDS_COLOR_APPWORKSPACE      0xFE05
00478 #define AFX_IDS_COLOR_WNDBACKGND        0xFE06
00479 #define AFX_IDS_COLOR_WNDTEXT           0xFE07
00480 #define AFX_IDS_COLOR_MENUBAR           0xFE08
00481 #define AFX_IDS_COLOR_MENUTEXT          0xFE09
00482 #define AFX_IDS_COLOR_ACTIVEBAR         0xFE0A
00483 #define AFX_IDS_COLOR_INACTIVEBAR       0xFE0B
00484 #define AFX_IDS_COLOR_ACTIVETEXT        0xFE0C
00485 #define AFX_IDS_COLOR_INACTIVETEXT      0xFE0D
00486 #define AFX_IDS_COLOR_ACTIVEBORDER      0xFE0E
00487 #define AFX_IDS_COLOR_INACTIVEBORDER    0xFE0F
00488 #define AFX_IDS_COLOR_WNDFRAME          0xFE10
00489 #define AFX_IDS_COLOR_SCROLLBARS        0xFE11
00490 #define AFX_IDS_COLOR_BTNFACE           0xFE12
00491 #define AFX_IDS_COLOR_BTNSHADOW         0xFE13
00492 #define AFX_IDS_COLOR_BTNTEXT           0xFE14
00493 #define AFX_IDS_COLOR_BTNHIGHLIGHT      0xFE15
00494 #define AFX_IDS_COLOR_DISABLEDTEXT      0xFE16
00495 #define AFX_IDS_COLOR_HIGHLIGHT         0xFE17
00496 #define AFX_IDS_COLOR_HIGHLIGHTTEXT     0xFE18
00497 #define AFX_IDS_REGULAR                 0xFE19
00498 #define AFX_IDS_BOLD                    0xFE1A
00499 #define AFX_IDS_ITALIC                  0xFE1B
00500 #define AFX_IDS_BOLDITALIC              0xFE1C
00501 #define AFX_IDS_SAMPLETEXT              0xFE1D
00502 #define AFX_IDS_DISPLAYSTRING_FONT      0xFE1E
00503 #define AFX_IDS_DISPLAYSTRING_COLOR     0xFE1F
00504 #define AFX_IDS_DISPLAYSTRING_PICTURE   0xFE20
00505 #define AFX_IDS_PICTUREFILTER           0xFE21
00506 #define AFX_IDS_PICTYPE_UNKNOWN         0xFE22
00507 #define AFX_IDS_PICTYPE_NONE            0xFE23
00508 #define AFX_IDS_PICTYPE_BITMAP          0xFE24
00509 #define AFX_IDS_PICTYPE_METAFILE        0xFE25
00510 #define AFX_IDS_PICTYPE_ICON            0xFE26
00511 #define AFX_IDS_PROPFRAME               0xFE27
00512 #define AFX_IDS_COLOR_PPG               0xFE28
00513 #define AFX_IDS_COLOR_PPG_CAPTION       0xFE29
00514 #define AFX_IDS_FONT_PPG                0xFE2A
00515 #define AFX_IDS_FONT_PPG_CAPTION        0xFE2B
00516 #define AFX_IDS_PICTURE_PPG             0xFE2C
00517 #define AFX_IDS_PICTURE_PPG_CAPTION     0xFE2D
00518 #define AFX_IDS_STANDARD_FONT           0xFE2E
00519 #define AFX_IDS_STANDARD_PICTURE        0xFE2F
00520 #define AFX_IDS_PICTUREBROWSETITLE      0xFE30
00521
00522 // OLE Control verb names
00523 #define AFX_IDS_VERB_EDIT               0xFE40
00524 #define AFX_IDS_VERB_PROPERTIES         0xFE41
00525
00526 // OLE Control internal error messages
00527 #define AFX_IDP_PROPFRAME_OOM           0xFE80
00528 #define AFX_IDP_PROPFRAME_OOR           0xFE81
00529 #define AFX_IDP_PROPFRAME_NOPAGES       0xFE82
00530 #define AFX_IDP_PICTURECANTOPEN         0xFE83
00531 #define AFX_IDP_PICTURECANTLOAD         0xFE84
00532 #define AFX_IDP_PICTURETOOLARGE         0xFE85
00533 #define AFX_IDP_PICTUREREADFAILED       0xFE86
00534
00535 // Standard OLE Control error strings
00536 #define AFX_IDP_E_ILLEGALFUNCTIONCALL       0xFEA0
00537 #define AFX_IDP_E_OVERFLOW                  0xFEA1
00538 #define AFX_IDP_E_OUTOFMEMORY               0xFEA2
00539 #define AFX_IDP_E_DIVISIONBYZERO            0xFEA3
00540 #define AFX_IDP_E_OUTOFSTRINGSPACE          0xFEA4
00541 #define AFX_IDP_E_OUTOFSTACKSPACE           0xFEA5
00542 #define AFX_IDP_E_BADFILENAMEORNUMBER       0xFEA6
00543 #define AFX_IDP_E_FILENOTFOUND              0xFEA7
00544 #define AFX_IDP_E_BADFILEMODE               0xFEA8
00545 #define AFX_IDP_E_FILEALREADYOPEN           0xFEA9
00546 #define AFX_IDP_E_DEVICEIOERROR             0xFEAA
00547 #define AFX_IDP_E_FILEALREADYEXISTS         0xFEAB
00548 #define AFX_IDP_E_BADRECORDLENGTH           0xFEAC
00549 #define AFX_IDP_E_DISKFULL                  0xFEAD
00550 #define AFX_IDP_E_BADRECORDNUMBER           0xFEAE
00551 #define AFX_IDP_E_BADFILENAME               0xFEAF
00552 #define AFX_IDP_E_TOOMANYFILES              0xFEB0
00553 #define AFX_IDP_E_DEVICEUNAVAILABLE         0xFEB1
00554 #define AFX_IDP_E_PERMISSIONDENIED          0xFEB2
00555 #define AFX_IDP_E_DISKNOTREADY              0xFEB3
00556 #define AFX_IDP_E_PATHFILEACCESSERROR       0xFEB4
00557 #define AFX_IDP_E_PATHNOTFOUND              0xFEB5
00558 #define AFX_IDP_E_INVALIDPATTERNSTRING      0xFEB6
00559 #define AFX_IDP_E_INVALIDUSEOFNULL          0xFEB7
00560 #define AFX_IDP_E_INVALIDFILEFORMAT         0xFEB8
00561 #define AFX_IDP_E_INVALIDPROPERTYVALUE      0xFEB9
00562 #define AFX_IDP_E_INVALIDPROPERTYARRAYINDEX 0xFEBA
00563 #define AFX_IDP_E_SETNOTSUPPORTEDATRUNTIME  0xFEBB
00564 #define AFX_IDP_E_SETNOTSUPPORTED           0xFEBC
00565 #define AFX_IDP_E_NEEDPROPERTYARRAYINDEX    0xFEBD
00566 #define AFX_IDP_E_SETNOTPERMITTED           0xFEBE
00567 #define AFX_IDP_E_GETNOTSUPPORTEDATRUNTIME  0xFEBF
00568 #define AFX_IDP_E_GETNOTSUPPORTED           0xFEC0
00569 #define AFX_IDP_E_PROPERTYNOTFOUND          0xFEC1
00570 #define AFX_IDP_E_INVALIDCLIPBOARDFORMAT    0xFEC2
00571 #define AFX_IDP_E_INVALIDPICTURE            0xFEC3
00572 #define AFX_IDP_E_PRINTERERROR              0xFEC4
00573 #define AFX_IDP_E_CANTSAVEFILETOTEMP        0xFEC5
00574 #define AFX_IDP_E_SEARCHTEXTNOTFOUND        0xFEC6
00575 #define AFX_IDP_E_REPLACEMENTSTOOLONG       0xFEC7
00576
00577 #endif //_AFXCTL
00578
00579 /////////////////////////////////////////////////////////////////////////////
00580 #endif //__AFXRES_H__
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcim.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcim.h

Go to the documentation of this file.
00001 // rtcimsession.h
00002 //
00003
00004 #ifndef _RTCIMSESSION_H_
00005 #define _RTCIMSESSION_H_
00006
00007 // Class for instant messaging session windows
00008 class CRTCIMSession : public CRTCSession
00009 {
00010 public:
00011     CRTCIMSession();
00012     ~CRTCIMSession();
00013
00014     // Registers the window class
00015     static HRESULT RegisterClass();
00016
00017     // Window procedure
00018     static LRESULT CALLBACK WindowProc(
00019         HWND hWnd,      // handle to window
00020         UINT uMsg,      // message identifier
00021         WPARAM wParam,  // first message parameter
00022         LPARAM lParam   // second message parameter
00023         );
00024
00025     // Subclass procedure for the edit control
00026     static LRESULT CALLBACK EditSubclassProc(
00027         HWND hWnd,      // handle to window
00028         UINT uMsg,      // message identifier
00029         WPARAM wParam,  // first message parameter
00030         LPARAM lParam   // second message parameter
00031         );
00032
00033 protected:
00034
00035     HWND m_hDisplay;
00036     HWND m_hEdit;
00037     HWND m_hSend;
00038     BOOL m_fTyping;
00039     WNDPROC m_wpOrigEditProc;
00040
00041     // Send an instant message
00042     HRESULT DoSendMessage();
00043
00044     // Display an instant message
00045     HRESULT DoDisplayMessage(PWSTR szUser, PWSTR szMessage);
00046
00047     // Send typing status
00048     HRESULT DoSendTyping();
00049
00050     // Display typing status
00051     HRESULT DoDisplayTyping(PWSTR szUser, BOOL fTyping);
00052
00053     // Window message handlers
00054     virtual LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam);
00055     virtual LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam);
00056     virtual LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam);
00057     LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam);
00058
00059     // Event handlers
00060     virtual HRESULT DeliverMessage(IRTCParticipant * pParticipant, BSTR bstrContentType, BSTR bstrMessage);
00061     virtual HRESULT DeliverUserStatus(IRTCParticipant * pParticipant, RTC_MESSAGING_USER_STATUS enStatus);
00062 };
00063
00064 #endif //_RTCIMSESSION_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IAppletSessionNotifyVtbl Member List

This is the complete list of members for IAppletSessionNotifyVtbl, including all inherited members.
aDynamicChannels | IAppletSessionNotifyVtbl
apAppRosters | IAppletSessionNotifyVtbl
apAppRosters | IAppletSessionNotifyVtbl
cDynamicChannels | IAppletSessionNotifyVtbl
cHandles | IAppletSessionNotifyVtbl
cRosters | IAppletSessionNotifyVtbl
cRosters | IAppletSessionNotifyVtbl
Data | IAppletSessionNotifyVtbl
eCommand | IAppletSessionNotifyVtbl
eCommand | IAppletSessionNotifyVtbl
eCommand | IAppletSessionNotifyVtbl
eDataPriority | IAppletSessionNotifyVtbl
eidMyself | IAppletSessionNotifyVtbl
eReason | IAppletSessionNotifyVtbl
eReason | IAppletSessionNotifyVtbl
eReason | IAppletSessionNotifyVtbl
eRights | IAppletSessionNotifyVtbl
eStatus | IAppletSessionNotifyVtbl
fUniformSend | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *JoinSessionConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *LeaveSessionIndication)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *SendDataIndication)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *RosterReportIndication)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *InquireRosterConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *InvokeAppletConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *RegistryConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *AllocateHandleConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *ChannelConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *ChannelIndication)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *TokenConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *TestTokenConfirm)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *TokenIndication)(IAppletSessionNotify __RPC_FAR *This | IAppletSessionNotifyVtbl
hrResult | IAppletSessionNotifyVtbl
hrResult | IAppletSessionNotifyVtbl
hrResult | IAppletSessionNotifyVtbl
hrResult | IAppletSessionNotifyVtbl
hrResult | IAppletSessionNotifyVtbl
nChannelID | IAppletSessionNotifyVtbl
nChannelID | IAppletSessionNotifyVtbl
nChannelID | IAppletSessionNotifyVtbl
nFirstHandle | IAppletSessionNotifyVtbl
nidMyself | IAppletSessionNotifyVtbl
nReqTag | IAppletSessionNotifyVtbl
nTokenID | IAppletSessionNotifyVtbl
nTokenID | IAppletSessionNotifyVtbl
nTokenID | IAppletSessionNotifyVtbl
pEntryOwner | IAppletSessionNotifyVtbl
ppvObject | IAppletSessionNotifyVtbl
pRegistryItem | IAppletSessionNotifyVtbl
pRegistryKey | IAppletSessionNotifyVtbl
riid | IAppletSessionNotifyVtbl
sidMyself | IAppletSessionNotifyVtbl
uidInitiator | IAppletSessionNotifyVtbl
uidInitiator | IAppletSessionNotifyVtbl
uidLeave | IAppletSessionNotifyVtbl
uidManager | IAppletSessionNotifyVtbl
uidMyself | IAppletSessionNotifyVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(IAppletSessionNotify __RPC_FAR *This) | IAppletSessionNotifyVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(IAppletSessionNotify __RPC_FAR *This) | IAppletSessionNotifyVtbl
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/SyncMgr/SyncDir/DllMain.h Source File

  • NetDS
  • SyncMgr
  • SyncDir

DllMain.h

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------
00011
00012 #ifndef _DLLMAIN_
00013 #define _DLLMAIN_
00014
00015 STDAPI DllRegisterServer(void);
00016 STDAPI DllUnregisterServer(void);
00017 STDAPI DllCanUnloadNow(void);
00018 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvOut);
00019
00020 #endif // _DLLMAIN_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Data.c Source File

  • WinUI
  • Input
  • Ime
  • IMEApps

Data.c

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      DATA.C                                                        */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation                */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <imm.h>
00011 #include "wapi.h"
00012
00013 HANDLE hInst      = NULL;
00014 HWND hWndMain     = NULL;
00015 HWND hWndCompStr  = NULL;
00016 HWND hWndToolBar  = NULL;
00017 HWND hWndStatus   = NULL;
00018 HWND hWndCandList = NULL;
00019
00020 LOGFONT lf = {0};
00021 HFONT hFont = NULL;
00022
00023 int nStatusHeight = 0;
00024 int nToolBarHeight = 0;
00025 BOOL fShowCand = FALSE;
00026 DWORD fdwProperty = 0;
00027
00028 DWORD  dwCompStrLen      = 0;
00029 DWORD  dwCompAttrLen     = 0;
00030 DWORD  dwCompClsLen      = 0;
00031 DWORD  dwCompReadStrLen  = 0;
00032 DWORD  dwCompReadAttrLen = 0;
00033 DWORD  dwCompReadClsLen  = 0;
00034 DWORD  dwResultStrLen      = 0;
00035 DWORD  dwResultClsLen      = 0;
00036 DWORD  dwResultReadStrLen  = 0;
00037 DWORD  dwResultReadClsLen  = 0;
00038
00039 MYCHAR szCompStr[512]         = {0};
00040 BYTE   bCompAttr[512]         = {0};
00041 DWORD  dwCompCls[128]         = {0};
00042 MYCHAR szCompReadStr[512]     = {0};
00043 BYTE   bCompReadAttr[512]     = {0};
00044 DWORD  dwCompReadCls[128]     = {0};
00045 MYCHAR szResultStr[512]       = {0};
00046 DWORD  dwResultCls[128]       = {0};
00047 MYCHAR szResultReadStr[512]   = {0};
00048 DWORD  dwResultReadCls[128]   = {0};
00049 MYCHAR szPaintResult[512]     = {0};
00050 MYCHAR szPaintResultRead[512] = {0};
00051
00052 LPCANDIDATELIST lpCandList = NULL;
00053
00054 POINT ptImeUIPos = {0};
00055
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CList< TYPE, ARG_TYPE > Member List

This is the complete list of members for CList< TYPE, ARG_TYPE >, including all inherited members.
AddHead(ARG_TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
AddHead(TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
AddTail(ARG_TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
AddTail(TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
CList() | CList< TYPE, ARG_TYPE > |
CList() | CList< TYPE, ARG_TYPE > |
Find(ARG_TYPE element, POSITION startAfter=NULL) const | CList< TYPE, ARG_TYPE > | [virtual]
Find(TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
FindIndex(ULONG iIndex) const | CList< TYPE, ARG_TYPE > | [virtual]
FindIndex(ULONG iIndex) | CList< TYPE, ARG_TYPE > | [virtual]
GetAt(POSITION position) const | CList< TYPE, ARG_TYPE > | [virtual]
GetAt(POSITION position) | CList< TYPE, ARG_TYPE > | [virtual]
GetAt(LISTPOS position) const | CList< TYPE, ARG_TYPE > | [inline, virtual]
GetCount() const | CList< TYPE, ARG_TYPE > | [inline]
GetCount() | CList< TYPE, ARG_TYPE > | [inline, virtual]
GetHead() const | CList< TYPE, ARG_TYPE > | [inline]
GetHead() | CList< TYPE, ARG_TYPE > | [inline]
GetHead() | CList< TYPE, ARG_TYPE > | [virtual]
GetHeadPosition() const | CList< TYPE, ARG_TYPE > | [inline]
GetHeadPosition() | CList< TYPE, ARG_TYPE > | [inline, virtual]
GetNext(POSITION &position) const | CList< TYPE, ARG_TYPE > | [virtual]
GetNext(POSITION &position) | CList< TYPE, ARG_TYPE > | [virtual]
GetNext(LISTPOS &position) | CList< TYPE, ARG_TYPE > | [inline, virtual]
GetPrev(POSITION &position) const | CList< TYPE, ARG_TYPE > | [virtual]
GetPrev(POSITION &position) | CList< TYPE, ARG_TYPE > | [virtual]
GetPrev(LISTPOS &position) | CList< TYPE, ARG_TYPE > | [inline, virtual]
GetTail() const | CList< TYPE, ARG_TYPE > | [inline]
GetTail() | CList< TYPE, ARG_TYPE > | [inline]
GetTail() | CList< TYPE, ARG_TYPE > | [virtual]
GetTailPosition() const | CList< TYPE, ARG_TYPE > | [inline]
GetTailPosition() | CList< TYPE, ARG_TYPE > | [inline, virtual]
InsertAfter(POSITION position, ARG_TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
InsertAfter(LISTPOS position, TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
InsertBefore(POSITION position, ARG_TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
InsertBefore(LISTPOS position, TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
IsEmpty() const | CList< TYPE, ARG_TYPE > | [inline]
IsEmpty() | CList< TYPE, ARG_TYPE > | [inline, virtual]
m_pHeadNode | CList< TYPE, ARG_TYPE > | [private]
m_pNodeHead | CList< TYPE, ARG_TYPE > | [private]
m_pNodeTail | CList< TYPE, ARG_TYPE > | [private]
m_pTailNode | CList< TYPE, ARG_TYPE > | [private]
m_ulElements | CList< TYPE, ARG_TYPE > | [private]
RemoveAll() | CList< TYPE, ARG_TYPE > |
RemoveAll() | CList< TYPE, ARG_TYPE > | [virtual]
RemoveAt(POSITION position) | CList< TYPE, ARG_TYPE > | [virtual]
RemoveAt(LISTPOS position) | CList< TYPE, ARG_TYPE > | [virtual]
RemoveHead() | CList< TYPE, ARG_TYPE > | [virtual]
RemoveHead() | CList< TYPE, ARG_TYPE > | [virtual]
RemoveTail() | CList< TYPE, ARG_TYPE > | [virtual]
RemoveTail() | CList< TYPE, ARG_TYPE > | [virtual]
SetAt(POSITION position, ARG_TYPE element) | CList< TYPE, ARG_TYPE > | [virtual]
SetAt(LISTPOS position, TYPE element) | CList< TYPE, ARG_TYPE > | [inline, virtual]
~CList() | CList< TYPE, ARG_TYPE > | [virtual]
~CList() | CList< TYPE, ARG_TYPE > | [virtual]
Generated on Wed Nov 13 2024 16:56:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/odbcdata.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

odbcdata.Cpp

Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "Data.h"
00003 #include "Entity.h"
00004 #include "Dynamic.h"
00005 #include "Resultset.h"
00006 #include "odbcdata.h"
00007 #include "Proxy.h"
00008
00009 HRESULT CODBCData::BindResultMetaData(FieldMetaData **ppMetaData, short *pCount)
00010 {
00011   short nCol;
00012   HRESULT hr = S_OK;
00013   RETCODE rc = 0;
00014   short nsChars = 0;
00015   WCHAR wszFieldName[FIELDNAME_MAXSIZE];
00016
00017   rc = SQLNumResultCols(m_hstmt, pCount);
00018
00019   PROCESS_SQL_ERROR(rc);
00020
00021   if (*ppMetaData == NULL)
00022   {
00023     *ppMetaData = new FieldMetaData[(*pCount) + 1];
00024   }
00025
00026   for (nCol = 1; nCol <= *pCount; nCol++)
00027   {
00028     short nIndex = nCol-1;
00029
00030     FieldMetaData *pMeta = &(*ppMetaData)[nIndex];
00031
00032     rc = SQLDescribeColW(m_hstmt, (short)nCol, wszFieldName, (short)FIELDNAME_MAXSIZE - 1, &nsChars, (short*)&pMeta->sqldatatype, &pMeta->nDataLen, &pMeta->nScale, &pMeta->nNullable);
00033     PROCESS_SQL_ERROR(rc);
00034
00035     pMeta->wszName.AssignCopy(nsChars, wszFieldName);
00036
00037     pMeta->vt = VT_EMPTY;
00038     pMeta->bNull = false;
00039
00040     switch(pMeta->sqldatatype)
00041     {
00042     case SQL_TINYINT:
00043       pMeta->nDataLen = sizeof(long);
00044       pMeta->vt = VT_UI1;
00045       pMeta->sqltype = SQL_C_SLONG;
00046       break;
00047     case SQL_SMALLINT:
00048       pMeta->nDataLen = sizeof(long);
00049       pMeta->vt = VT_I2;
00050       pMeta->sqltype = SQL_C_SLONG;
00051       break;
00052     case SQL_NUMERIC:
00053     case SQL_INTEGER:
00054       pMeta->nDataLen = sizeof(long);
00055       pMeta->vt = VT_I4;
00056       pMeta->sqltype = SQL_C_SLONG;
00057       break;
00058     case SQL_TYPE_DATE:
00059     case SQL_TYPE_TIME:
00060     case SQL_TYPE_TIMESTAMP:
00061     case 11: // datetime?
00062       pMeta->nDataLen = MAX_FIELD_DATA_SIZE - 1;
00063       pMeta->vt = VT_DATE;
00064       pMeta->sqltype = SQL_C_WCHAR;
00065       break;
00066     case SQL_BIT:
00067       pMeta->nDataLen = sizeof(bool);
00068       pMeta->vt = VT_BOOL;
00069       pMeta->sqltype = SQL_C_SLONG;
00070       break;
00071     case SQL_DECIMAL:
00072       pMeta->nDataLen = MAX_FIELD_DATA_SIZE - 1;
00073       if (pMeta->nScale == 4)
00074         pMeta->vt = VT_CY;
00075       else
00076         pMeta->vt = VT_DECIMAL;
00077       pMeta->sqltype = SQL_C_WCHAR;
00078       break;
00079     case SQL_VARCHAR:
00080     case SQL_CHAR:
00081     case SQL_LONGVARCHAR:
00082     case SQL_WCHAR:
00083     case SQL_WVARCHAR:
00084     case SQL_WLONGVARCHAR:
00085     default:
00086       pMeta->nDataLen = MAX_FIELD_DATA_SIZE - 1;
00087       pMeta->vt = VT_BSTR;
00088       pMeta->sqltype = SQL_C_WCHAR;
00089       break;
00090     }
00091
00092     rc = SQLBindCol(m_hstmt, (short)nCol, pMeta->sqltype, (void*)pMeta->pData, MAX_FIELD_DATA_SIZE - 1, &pMeta->nDataBindLen);
00093     PROCESS_SQL_ERROR(rc);
00094   }
00095   return hr;
00096 }
00097
00098 HRESULT CODBCData::GetConnection(BSTR sDsn, BOOL bUseObjectPool)
00099 {
00100   RETCODE rc;
00101   HRESULT hr= S_OK;
00102
00103   // We're object pooling, so we don't need connection pooling
00104   if (bUseObjectPool)
00105   {
00106     rc = SQLSetEnvAttr(NULL, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_OFF, SQL_IS_INTEGER);
00107     ASSERT_SQL_SUCCESS(rc);
00108   }
00109   else
00110   {
00111     rc = SQLSetEnvAttr(SQL_NULL_HENV, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_DRIVER, SQL_IS_INTEGER);
00112     ASSERT_SQL_SUCCESS(rc);
00113   }
00114
00115   rc = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HENV, &m_henv);
00116   ASSERT_SQL_SUCCESS(rc);
00117
00118   rc = SQLSetEnvAttr(m_henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER);
00119   ASSERT_SQL_SUCCESS(rc);
00120
00121   rc = SQLSetEnvAttr(m_henv, SQL_ATTR_CP_MATCH, (SQLPOINTER) SQL_CP_RELAXED_MATCH, SQL_IS_INTEGER);
00122   ASSERT_SQL_SUCCESS(rc);
00123
00124   rc = SQLAllocHandle(SQL_HANDLE_DBC, m_henv, &m_hdbc);
00125
00126   if (SQL_FAILED(rc))
00127     return E_FAIL;
00128
00129   rc = SQLSetConnectAttr(m_hdbc, SQL_ATTR_ODBC_CURSORS, NULL, SQL_CUR_USE_ODBC);
00130
00131   if (SQL_FAILED(rc))
00132     return E_FAIL;
00133   WCHAR szConn[1024];
00134   WORD nSize = 1023;
00135   m_wszConnection.AssignCopy(SysStringLen(sDsn), sDsn);
00136
00137   rc = SQLDriverConnectW(m_hdbc, NULL, (SQLWCHAR*)(LPCWSTR)m_wszConnection, SQL_NTS, (SQLWCHAR *)szConn, 1023, (short *)&nSize, (UWORD)SQL_DRIVER_NOPROMPT);
00138   if (SQL_FAILED(rc))
00139   {
00140     SQLFreeEnv(m_henv);
00141     return E_FAIL;
00142   }
00143   rc = SQLAllocStmt(m_hdbc, &m_hstmt); // generic stmt
00144   if (SQL_FAILED(rc))
00145   {
00146     SQLFreeConnect(m_hdbc);
00147     SQLFreeEnv(m_henv);
00148
00149     return E_FAIL;
00150   }
00151   return S_OK;
00152 }
00153
00154 HRESULT CODBCData::Enlist(IObjectContext * pObjectContext, const CLSID &clsid, const IID &iid)
00155 {
00156   HRESULT hr = E_FAIL;
00157   _ASSERTE(pObjectContext);
00158
00159   IObjectContextInfo  * pObjTx = NULL;
00160   hr = pObjectContext->QueryInterface(IID_IObjectContextInfo, (void **)&pObjTx);
00161   if (pObjTx)
00162   {
00163     ITransaction * pTx = NULL;
00164     hr = pObjTx->GetTransaction ((IUnknown **)&pTx);
00165     RETCODE rc;
00166     if (pTx)
00167     {
00168       rc = SQLSetConnectAttr(m_hdbc,SQL_ATTR_ENLIST_IN_DTC, pTx, 0);
00169       if (SQL_FAILED(rc))
00170       {
00171         char szError[1024];
00172
00173         ATLTRACE ("Enlist failed: %#x\n", rc);
00174
00175         GetODBCError(szError);
00176         hr = AtlReportError(clsid, szError, iid, E_FAIL);
00177       }
00178       else
00179       {
00180         hr = S_OK;
00181       }
00182       pTx->Release();
00183     }
00184     pObjTx->Release();
00185   }
00186   return hr;
00187 }
00188
00189 void CODBCData::GetODBCError(char *szError)
00190 {
00191   char szSqlState[64];
00192   SDWORD NativeError;
00193   SWORD cbErrorMsg;
00194   SQLError(m_henv, m_hdbc, m_hstmt, (SQLCHAR*)szSqlState, &NativeError, (SQLCHAR*)szError, 1023, &cbErrorMsg);
00195 }
00196
00197 HRESULT CODBCData::ExecuteSQL(LPCWSTR wszSQL, long *pResult)
00198 {
00199   RETCODE rc = 0;
00200   HRESULT hr = S_OK;
00201   long nResult = -1;
00202   long nData = -1;
00203   long nDataLen = sizeof(long);
00204   long nDataBindLen = sizeof(long);
00205   SQLSMALLINT sqltype = SQL_C_SLONG;
00206
00207   SETCOMPLETE;
00208
00209   rc = SQLExecDirectW(m_hstmt, (LPWSTR)wszSQL, SQL_NTS);
00210
00211   PROCESS_SQL_ERROR(rc);
00212
00213   // Only ask for results if we have been asked for results.
00214   if (pResult != NULL)
00215   {
00216     rc = SQLRowCount(m_hstmt, &nResult);
00217
00218     PROCESS_SQL_ERROR(rc);
00219
00220   // This may fail (so don't check return value) if there is no data to return
00221     rc = SQLFetch(m_hstmt);
00222
00223   //  PROCESS_SQL_ERROR(rc);
00224
00225     if (!SQL_FAILED(rc))
00226     {
00227       rc = SQLGetData(m_hstmt, (SQLUSMALLINT)1, sqltype, (void*)&nData, nDataLen, &nDataBindLen);
00228     //  PROCESS_SQL_ERROR(rc);
00229     }
00230
00231     if (nData != -1)
00232     {
00233       nResult = nData;
00234     }
00235
00236     *pResult = nResult;
00237   }
00238
00239   return hr;
00240 }
00241
00242 void CODBCData::CloseCurrentStatement()
00243 {
00244   SQLCloseCursor(m_hstmt);
00245   SQLFreeStmt(m_hstmt, SQL_UNBIND);
00246   SQLFreeStmt(m_hstmt, SQL_CLOSE);
00247 }
00248
00249 HRESULT CODBCData::NextResultsetData(long *pResult)
00250 {
00251   RETCODE rc = 0;
00252   HRESULT hr = S_OK;
00253
00254   rc = SQLMoreResults(m_hstmt);
00255
00256   if (pResult != NULL)
00257   {
00258     rc = SQLRowCount(m_hstmt, pResult);
00259
00260     PROCESS_SQL_ERROR(rc);
00261   }
00262   return hr;
00263 }
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/GlobalDev/globaldev/nlsapi.c Source File

  • WinUI
  • GlobalDev
  • globaldev

nlsapi.c

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////////////////////
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright 2001 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 // Purpose:
00011 //    This application demonstrates the different aspects of software globalization:
00012 //
00013 //        - A single executable with world-wide functionality (fully Unicode enabled
00014 //        for Windows 2000 and Windows XP).
00015 //
00016 //        - Locale independency by using Windows NLS APIs to display data (dates,
00017 //        numbers, time, etc.) within a user's desired format.
00018 //
00019 //        - Multilingual editing using standard edit controls.
00020 //
00021 //        - Multilingual input locales within edit control fields.
00022 //
00023 //        - Font selection and their affect on displayed data.
00024 //
00025 //        - Multilingual user interface and satellite DLLs.
00026 //
00027 // Written by Houman Pournasseh
00028 //
00029 ///////////////////////////////////////////////////////////////////////////////////////////
00030
00031 ///////////////////////////////////////////////////////////////////////////////////////////
00032 //
00033 //   Module:        NLSAPI.C
00034 //
00035 //   Description:    Handles the window proc for the "NLS API" tab of the property sheet.
00036 //
00037 //   Functions:
00038 //        NLSDlgProc()          - Window procedure message handler.
00039 //        LcidDlgProc()         - Window procedure message handler.
00040 //        iConvertStrToInt()    - Converts a hex value saved as string to int.
00041 //        InitNLSFields()       - Initialize NLS formatting fields for a given LCID.
00042 //        EnumLocalesProc()     - Callback function for locale enumeration.
00043 //        EnumTimeFormatsProc() - Callback function for time format enumeration.
00044 //        EnumSDateFormatsProc()- Callback function for short date format enumeration.
00045 //        EnumLDateFormatsProc()- Callback function for long date format enumeration.
00046 //        EnumCalendarInfoProc()- Callback function for calendar information enumeration.
00047 //        CompareFunc()         - A private compare function for list-view sorting.
00048 //
00049 ///////////////////////////////////////////////////////////////////////////////////////////
00050 #include "global.h"
00051
00052 // internal function declaration
00053 int     iConvertStrToInt(LPTSTR);
00054 void    InitNLSFields(HWND, LCID);
00055 BOOL    CALLBACK EnumLocalesProc(LPTSTR);
00056 BOOL    CALLBACK EnumTimeFormatsProc(LPTSTR);
00057 BOOL    CALLBACK EnumSDateFormatsProc(LPTSTR);
00058 BOOL    CALLBACK EnumCalendarInfoProc(LPTSTR);
00059 BOOL    CALLBACK EnumLDateFormatsProc(LPTSTR);
00060 INT_PTR CALLBACK LcidDlgProc(HWND, UINT, WPARAM, LPARAM);
00061 int     CALLBACK CompareFunc(LPARAM, LPARAM, LPARAM);
00062
00063 // general variable declaration
00064 HWND    g_hwndList;
00065 HWND    g_hDlg;
00066 int     g_iCurLocale;
00067 int     g_iCounter = 0;
00068
00069
00070 ///////////////////////////////////////////////////////////////////////////////////////////
00071 //    Function:        NLSDlgProc
00072 //
00073 //    Description:    Message-processing function for text tab
00074 //
00075 //    Comments:
00076 //
00077 ///////////////////////////////////////////////////////////////////////////////////////////
00078 INT_PTR CALLBACK NLSDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00079 {
00080     BOOL bProcessedMsg = TRUE;
00081
00082     switch(uMsg)
00083     {
00084         case WM_INITDIALOG:
00085         {
00086             LVCOLUMN    lvcCol = {0};
00087             UINT        lcid = 0;
00088             LVFINDINFO  lvInfo = {0};
00089             int         iItem = 0;
00090
00091             // load our own icon
00092             SendMessage(GetParent(hDlg), WM_SETICON, ICON_BIG, (LPARAM) (LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON))));
00093
00094             // Create our list column  for the listview control
00095             g_hwndList = GetDlgItem(hDlg, IDC_LV_LCID);
00096             g_hDlg = hDlg;
00097
00098             lvcCol.mask = LVCF_TEXT;
00099             LoadString(g_hRes, STR_LANGID, g_tcsTemp, MAX_STR);
00100             lvcCol.pszText = g_tcsTemp;
00101             ListView_InsertColumn(g_hwndList, COLUMN_LANGID, (LV_COLUMN *)&lvcCol);
00102
00103             LoadString(g_hRes, STR_LANG, g_tcsTemp, MAX_STR);
00104             lvcCol.pszText = g_tcsTemp;
00105             ListView_InsertColumn(g_hwndList, COLUMN_LANGUAGE, (LV_COLUMN *)&lvcCol);
00106
00107             LoadString(g_hRes, STR_NLANG, g_tcsTemp, MAX_STR);
00108             lvcCol.pszText = g_tcsTemp;
00109             ListView_InsertColumn(g_hwndList, COLUMN_NATIVELANG, (LV_COLUMN *)&lvcCol);
00110
00111             LoadString(g_hRes, STR_NCOUNTRY, g_tcsTemp, MAX_STR);
00112             lvcCol.pszText = g_tcsTemp;
00113             ListView_InsertColumn(g_hwndList, COLUMN_NATIVECOUNTRY, (LV_COLUMN *)&lvcCol);
00114
00115             LoadString(g_hRes, STR_ACP, g_tcsTemp, MAX_STR);
00116             lvcCol.pszText = g_tcsTemp;
00117             ListView_InsertColumn(g_hwndList, COLUMN_ACP, (LV_COLUMN *)&lvcCol);
00118
00119             LoadString(g_hRes, STR_OEMCP, g_tcsTemp, MAX_STR);
00120             lvcCol.pszText = g_tcsTemp;
00121             ListView_InsertColumn(g_hwndList, COLUMN_OEMCP, (LV_COLUMN *)&lvcCol);
00122
00123             // fill out our listview control with available locales (supported ones).
00124             EnumSystemLocales(EnumLocalesProc, LCID_SUPPORTED);
00125
00126             // Initialize formatting fields related to the selected locale in the listview
00127             InitNLSFields(hDlg, LOCALE_USER_DEFAULT);
00128
00129             // Set the column width of the listview control.
00130             ListView_SetColumnWidth(g_hwndList, COLUMN_LANGID, LVSCW_AUTOSIZE_USEHEADER);
00131             ListView_SetColumnWidth(g_hwndList, COLUMN_LANGUAGE, LVSCW_AUTOSIZE_USEHEADER);
00132             ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVELANG, LVSCW_AUTOSIZE_USEHEADER);
00133             ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVECOUNTRY, LVSCW_AUTOSIZE_USEHEADER);
00134             ListView_SetColumnWidth(g_hwndList, COLUMN_ACP, LVSCW_AUTOSIZE_USEHEADER);
00135             ListView_SetColumnWidth(g_hwndList, COLUMN_OEMCP, LVSCW_AUTOSIZE_USEHEADER);
00136
00137             // Find user's current locale and select that item in the listview control.
00138             lcid = GetUserDefaultLCID();
00139
00140             // Our list has all the LCIDs in 4 digits (0409) whereas GetUserDefaultLCID returs (409).
00141             if (lcid < 0x1000)
00142             {
00143                 _sntprintf(g_tcsTemp,MAX_STR,TEXT("0%x"), lcid);
00144             }
00145             else
00146             {
00147                 _sntprintf(g_tcsTemp,MAX_STR,TEXT("%x"), lcid);
00148             }
00149
00150             lvInfo.flags = LVFI_STRING;
00151             lvInfo.psz = g_tcsTemp;
00152
00153             iItem = ListView_FindItem(g_hwndList, 0, &lvInfo);
00154             ListView_SetItemState (g_hwndList, iItem, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
00155             ListView_EnsureVisible(g_hwndList, iItem, FALSE);
00156
00157             // Set some of the extended styles of our list view (cool reports ;-)
00158             ListView_SetExtendedListViewStyle(g_hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_GRIDLINES | LVS_EX_TWOCLICKACTIVATE);
00159         }
00160         break;
00161
00162         case WM_NOTIFY:
00163             switch (((NMHDR *)lParam)->code)
00164             {
00165                 case LVN_COLUMNCLICK:
00166                     {
00167                         NM_LISTVIEW nmv;
00168                         static int iLastSort = COLUMN_LANGID;
00169                         LPARAM lSortParam = -1;
00170                         LVFINDINFO lvInfo;
00171                         int         iItem;
00172
00173                         // When a column is clicked we need to redo our sorting of preview table.
00174
00175                         nmv = *(const NM_LISTVIEW *) lParam;
00176
00177                         // We don't sort for native language and native country name (avoid confusion).
00178                         if ((nmv.iSubItem == COLUMN_NATIVELANG) || (nmv.iSubItem == COLUMN_NATIVECOUNTRY))
00179                         {
00180                             break;
00181                         }
00182
00183                         // If our last sorting was on a different column, we need to do more
00184                         // than simply reverting our sorting.
00185                         // Because of listview sorting limitations, we need to redo our list...
00186                         if (iLastSort != nmv.iSubItem)
00187                         {
00188                             // The list view sorting is based on a q-sort, we need to redo our list!
00189                             ListView_DeleteAllItems(g_hwndList);
00190                             g_iCounter  = 0;
00191                             EnumSystemLocales(EnumLocalesProc, LCID_SUPPORTED);
00192
00193                             // Make sure the last selection remains active after sorting...
00194                             if (g_iCurLocale < 0x1000)
00195                             {
00196                                 _sntprintf(g_tcsTemp,MAX_STR,TEXT("0%x"), g_iCurLocale);
00197                             }
00198                             else
00199                             {
00200                                 _sntprintf(g_tcsTemp,MAX_STR,TEXT("%x"), g_iCurLocale);
00201                             }
00202
00203                             lvInfo.flags = LVFI_STRING;
00204                             lvInfo.psz = g_tcsTemp;
00205                             iItem = ListView_FindItem(g_hwndList, 0, &lvInfo);
00206                             ListView_SetItemState (g_hwndList, iItem, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
00207
00208                             // Update our flag for the last column sorted and set the sorting flag
00209                             iLastSort = nmv.iSubItem;
00210                             lSortParam = iLastSort;
00211                         }
00212
00213                         // Do the actual sorting...
00214                         ListView_SortItems(g_hwndList, (PFNLVCOMPARE)CompareFunc, lSortParam);
00215
00216                         // Make sure our selection is visible after the sorting!
00217                         ListView_EnsureVisible(g_hwndList, ListView_GetSelectionMark(g_hwndList), FALSE);
00218                     }
00219                     break;
00220
00221                 case LVN_ITEMCHANGED:   /* fall-through */
00222                 case LVN_ITEMACTIVATE:
00223                     {
00224                         LPNM_LISTVIEW lpnmlv = (LPNM_LISTVIEW)lParam;
00225                         static    int iItem;
00226                         LVITEM    lvItem = {0};
00227
00228                         // Item selection has been changed.
00229                         // Find the new langId and update our formatting fields...
00230                         if (iItem != lpnmlv->iItem)
00231                         {
00232                             iItem = lpnmlv->iItem;
00233
00234                             lvItem.mask = LVIF_TEXT;
00235                             lvItem.iItem = iItem;
00236                             lvItem.pszText = g_tcsTemp;
00237                             lvItem.cchTextMax  = STR_LEN;
00238                             ListView_GetItem(g_hwndList, &lvItem);
00239                             g_iCurLocale = iConvertStrToInt(lvItem.pszText);
00240                             InitNLSFields(hDlg, g_iCurLocale);
00241                         }
00242
00243                         // Show advanced data on the selected locale...
00244                         if (((NMHDR *)lParam)->code == LVN_ITEMACTIVATE)
00245                         {
00246                            bProcessedMsg = (DialogBox(g_hRes, MAKEINTRESOURCE(DLG_LCID), hDlg, LcidDlgProc) != -1);
00247                         }
00248                     }
00249                     break;
00250                 }
00251                 break;
00252
00253                 case WM_COMMAND:
00254                     switch(LOWORD(wParam))
00255                     {
00256                         case IDCANCEL: /* fall-through*/
00257                         case IDOK:
00258                             break;
00259
00260                         case IDC_TIMEFORMAT:
00261                             {
00262                                 if(HIWORD(wParam) == CBN_SELCHANGE)
00263                                 {
00264                                     // Time formating selection has been changed.
00265                                     // Re-edit time
00266                                     HWND    hList = NULL;
00267                                     LRESULT index = 0;
00268                                     TCHAR    tcTemp[MAX_STR];
00269
00270                                     hList = GetDlgItem(hDlg, IDC_TIMEFORMAT);
00271
00272                                     if(NULL == hList)
00273                                     {
00274                                         bProcessedMsg = FALSE;
00275                                         break;
00276                                     }
00277
00278                                     index = SendMessage(hList, CB_GETCURSEL, 0, 0);
00279                                     SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
00280                                     GetTimeFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
00281                                     SetWindowText(GetDlgItem(hDlg, IDC_TIMESAMPLE), tcTemp);
00282                                 }
00283                             }
00284                             break;
00285
00286                         case IDC_SDATEFORMAT:
00287                             {
00288                                 if(HIWORD(wParam) == CBN_SELCHANGE)
00289                                 {
00290                                     // short date formating selection has been changed.
00291                                     // Re-edit short date
00292                                     HWND    hList = NULL;
00293                                     LRESULT index = 0;
00294                                     TCHAR    tcTemp[MAX_STR];
00295
00296                                     hList = GetDlgItem(hDlg, IDC_SDATEFORMAT);
00297
00298                                     if(NULL == hList)
00299                                     {
00300                                         bProcessedMsg = FALSE;
00301                                         break;
00302                                     }
00303                                     index = SendMessage(hList, CB_GETCURSEL, 0, 0);
00304                                     SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
00305                                     GetDateFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
00306                                     SetWindowText(GetDlgItem(hDlg, IDC_SDATESAMPLE), tcTemp);
00307                                 }
00308                             }
00309                             break;
00310
00311                         case IDC_LDATEFORMAT:
00312                             {
00313                                 if(HIWORD(wParam) == CBN_SELCHANGE)
00314                                 {
00315                                     // long date formating selection has been changed.
00316                                     // Re-edit long date
00317                                     HWND    hList = NULL;
00318                                     LRESULT index = 0;
00319                                     TCHAR    tcTemp[MAX_STR];
00320
00321                                     hList = GetDlgItem(hDlg, IDC_LDATEFORMAT);
00322
00323                                     if(NULL == hList)
00324                                     {
00325                                         bProcessedMsg = FALSE;
00326                                         break;
00327                                     }
00328
00329                                     index = SendMessage(hList, CB_GETCURSEL, 0, 0);
00330                                     SendMessage(hList, CB_GETLBTEXT, index, (LPARAM) g_tcsTemp);
00331                                     GetDateFormat(g_iCurLocale, 0, NULL, g_tcsTemp, tcTemp, MAX_STR);
00332                                     SetWindowText(GetDlgItem(hDlg, IDC_LDATESAMPLE), tcTemp);
00333                                 }
00334                             }
00335                             break;
00336                     }
00337                     break;
00338
00339         default:
00340             bProcessedMsg = FALSE;
00341     }
00342
00343     return bProcessedMsg;
00344 }
00345
00346
00347 ///////////////////////////////////////////////////////////////////////////////////////////
00348 //  Function:       EnumLocalesProc
00349 //
00350 //  Description:    Call back function for supported locale enumeration.
00351 //                  In this callback function we retrieve different information
00352 //                  related to the enumerated locale and append that info to our listview
00353 //                  control.
00354 //
00355 //  Comments:
00356 //
00357 ///////////////////////////////////////////////////////////////////////////////////////////
00358 BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
00359 {
00360     int     iCurLocale = 0;
00361     TCHAR   szCurName[STR_LEN];
00362     LVITEM  lviItem = {0};
00363     int     iNewItem  = 0;
00364     BOOL    bProcessed = TRUE;
00365
00366     if (!lpLocaleString)
00367     {
00368         bProcessed = FALSE;
00369     }
00370     else
00371     {
00372         iCurLocale = iConvertStrToInt(lpLocaleString);
00373
00374         // initialize out LV item
00375         lviItem.mask = LVIF_TEXT | LVIF_PARAM;
00376         lviItem.cchTextMax  = STR_LEN;
00377         lviItem.lParam = g_iCounter ;
00378
00379         // Get LangID and add it in LV
00380         GetLocaleInfo(iCurLocale, LOCALE_ILANGUAGE , szCurName, STR_LEN);
00381         lviItem.pszText = szCurName;
00382         iNewItem = ListView_InsertItem(g_hwndList, &lviItem);
00383
00384         // Get and write localize language name
00385         GetLocaleInfo(iCurLocale, LOCALE_SLANGUAGE , szCurName, STR_LEN);
00386         ListView_SetItemText(g_hwndList, iNewItem, 1, szCurName);
00387
00388         // Get and write Native Language Name...
00389         GetLocaleInfo(iCurLocale, LOCALE_SNATIVELANGNAME , szCurName, STR_LEN);
00390         ListView_SetItemText(g_hwndList, iNewItem, 2, szCurName);
00391
00392         // Get and write Native Country Name...
00393         GetLocaleInfo(iCurLocale, LOCALE_SNATIVECTRYNAME , szCurName, STR_LEN);
00394         ListView_SetItemText(g_hwndList, iNewItem, 3, szCurName);
00395
00396         // Get and write ANSI CP.
00397         GetLocaleInfo(iCurLocale, LOCALE_IDEFAULTANSICODEPAGE , szCurName, STR_LEN);
00398         ListView_SetItemText(g_hwndList, iNewItem, 4, szCurName);
00399
00400         // Get and write OEM CP.
00401         GetLocaleInfo(iCurLocale, LOCALE_IDEFAULTCODEPAGE , szCurName, STR_LEN);
00402         ListView_SetItemText(g_hwndList, iNewItem, 5, szCurName);
00403
00404         g_iCounter ++;
00405     }
00406
00407     return bProcessed;
00408 }
00409
00410 ///////////////////////////////////////////////////////////////////////////////////////////
00411 //  Function:       iConvertStrToInt
00412 //
00413 //  Description:    Converts a hex value saved as a string (coming from EnumSystemLocale)
00414 //                  to an integer.
00415 //
00416 //  Comments:
00417 //
00418 ///////////////////////////////////////////////////////////////////////////////////////////
00419 int iConvertStrToInt(LPTSTR strString)
00420 {
00421 int   i, iNum;
00422 int   iValue = 0;
00423 int   iboundry;
00424
00425   // convert the string to upper case first.
00426   _tcsupr(strString);
00427
00428   // we look into 4 LSB only since:
00429   // LCID (DWORD) = Sort-Key (HI-WORD) + Lang ID (LOW-WORD)
00430     __try
00431     {
00432         // If strString is not null terminated , this call can cause access violation.
00433         iboundry = _tcslen(strString) - 1;
00434     }
00435
00436     __except(EXCEPTION_EXECUTE_HANDLER)
00437     {
00438         iboundry = 0;
00439     }
00440
00441
00442   for (i = iboundry; i > iboundry - 4; i--)
00443   {
00444     iNum = strString[i] - 48; // 48 being the ASCII number for 0
00445     if (iNum > 10)        // if it's over digit range
00446       iNum -= 7;
00447     iValue += iNum * (int)(pow(16, iboundry-i));
00448   }
00449   return iValue;
00450 }
00451
00452 ///////////////////////////////////////////////////////////////////////////////////////////
00453 //  Function:       InitNLSFields
00454 //
00455 //  Description:    Initialize NLS formatting fields for a given LCID
00456 //
00457 //  Comments:
00458 //
00459 ///////////////////////////////////////////////////////////////////////////////////////////
00460 void InitNLSFields(HWND hDlg, LCID lcid)
00461 {
00462     TCHAR   tcsTemp[MAX_STR];
00463     HWND    hList = NULL;
00464
00465     // Init larg number fields...
00466     LoadString(g_hInst, STR_LARGEPOSNUMBER, g_tcsTemp, MAX_STR);
00467     GetNumberFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
00468     SetWindowText(GetDlgItem(hDlg, IDC_POS_NUMBER), tcsTemp);
00469
00470     LoadString(g_hInst, STR_LARGENEGNUMBER, g_tcsTemp, MAX_STR);
00471     GetNumberFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
00472     SetWindowText(GetDlgItem(hDlg, IDC_NEG_NUMBER), tcsTemp);
00473
00474     // Init the currency field format...
00475     LoadString(g_hInst, STR_LARGEPOSNUMBER, g_tcsTemp, MAX_STR);
00476     GetCurrencyFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
00477     SetWindowText(GetDlgItem(hDlg, IDC_POS_CURRENCY), tcsTemp);
00478
00479     LoadString(g_hInst, STR_LARGENEGNUMBER, g_tcsTemp, MAX_STR);
00480     GetCurrencyFormat(lcid, 0, g_tcsTemp, NULL, tcsTemp, MAX_STR);
00481     SetWindowText(GetDlgItem(hDlg, IDC_NEG_CURRENCY), tcsTemp);
00482
00483     // Init time field format...
00484     // Delete our previous list of items...
00485     hList = GetDlgItem(g_hDlg, IDC_TIMEFORMAT);
00486     if(NULL != hList)
00487     {
00488         SendMessage(hList, CB_RESETCONTENT , 0, 0);
00489
00490         // Enumerates the time formats that are available for a specified locale.
00491         EnumTimeFormats(EnumTimeFormatsProc, lcid, 0);
00492         SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
00493         SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
00494         GetTimeFormat(lcid, 0, NULL, g_tcsTemp, tcsTemp, MAX_STR);
00495         SetWindowText(GetDlgItem(hDlg, IDC_TIMESAMPLE), tcsTemp);
00496     }
00497
00498     // Init calendar field format...
00499     // Delete our previous list of items...
00500     hList = GetDlgItem(g_hDlg, IDC_CALFORMAT);
00501     if(NULL != hList)
00502     {
00503         SendMessage(hList, CB_RESETCONTENT , 0, 0);
00504
00505         // Enumerates the short date formats that are available for a specified locale.
00506         EnumCalendarInfo(EnumCalendarInfoProc, lcid, ENUM_ALL_CALENDARS, CAL_SCALNAME);
00507         SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
00508         SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
00509     }
00510
00511     // Init short date field format...
00512     // Delete our previous list of items...
00513     hList = GetDlgItem(g_hDlg, IDC_SDATEFORMAT);
00514     if(NULL != hList)
00515     {
00516         SendMessage(hList, CB_RESETCONTENT , 0, 0);
00517
00518         // Enumerates the short date formats that are available for a specified locale.
00519         EnumDateFormats(EnumSDateFormatsProc, lcid, DATE_SHORTDATE);
00520         SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
00521         SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
00522         GetDateFormat(lcid, 0, NULL, g_tcsTemp, tcsTemp, MAX_STR);
00523         SetWindowText(GetDlgItem(hDlg, IDC_SDATESAMPLE), tcsTemp);
00524     }
00525
00526     // Init long date field format...
00527     // Delete our previous list of items...
00528     hList = GetDlgItem(g_hDlg, IDC_LDATEFORMAT);
00529     if(NULL != hList)
00530     {
00531         SendMessage(hList, CB_RESETCONTENT , 0, 0);
00532
00533         // Enumerates the long date formats that are available for a specified locale
00534         EnumDateFormats(EnumLDateFormatsProc, lcid, DATE_LONGDATE);
00535         SendMessage(hList, CB_SETCURSEL, 0, 0);          // item index
00536         SendMessage(hList, CB_GETLBTEXT, 0, (LPARAM) g_tcsTemp);
00537         GetDateFormat(lcid, 0, NULL, g_tcsTemp, tcsTemp, MAX_STR);
00538         SetWindowText(GetDlgItem(hDlg, IDC_LDATESAMPLE), tcsTemp);
00539     }
00540 }
00541
00542 ///////////////////////////////////////////////////////////////////////////////////////////
00543 //  Function:       EnumTimeFormatsProc
00544 //
00545 //  Description:    Callback function for time format enumeration.
00546 //
00547 //  Comments:
00548 //
00549 ///////////////////////////////////////////////////////////////////////////////////////////
00550 BOOL CALLBACK EnumTimeFormatsProc(LPTSTR lpTimeFormatString)
00551 {
00552     BOOL bProcessed = TRUE;
00553
00554     if (!lpTimeFormatString)
00555     {
00556         bProcessed = FALSE;
00557     }
00558     else
00559     {
00560         // Fill into the combo box the list of supported time formats...
00561         SendMessage(GetDlgItem(g_hDlg, IDC_TIMEFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpTimeFormatString);
00562     }
00563
00564     return bProcessed;
00565 }
00566
00567
00568 ///////////////////////////////////////////////////////////////////////////////////////////
00569 //  Function:   EnumSDateFormatsProc
00570 //
00571 //  Description:    Callback function for short date format enumeration.
00572 //
00573 //  Comments:
00574 //
00575 ///////////////////////////////////////////////////////////////////////////////////////////
00576 BOOL CALLBACK EnumSDateFormatsProc(LPTSTR lpDateFormatString)
00577 {
00578     BOOL bProcessed = TRUE;
00579     if (!lpDateFormatString)
00580     {
00581         return FALSE;
00582     }
00583     else
00584     {
00585         // Fill into the combo box the list of supported short date formats...
00586         SendMessage(GetDlgItem(g_hDlg, IDC_SDATEFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpDateFormatString);
00587     }
00588
00589     return bProcessed;
00590 }
00591
00592 ///////////////////////////////////////////////////////////////////////////////////////////
00593 //  Function:       EnumLDateFormatsProc
00594 //
00595 //  Description:    Callback function for long date format enumeration.
00596 //
00597 //  Comments:
00598 //
00599 ///////////////////////////////////////////////////////////////////////////////////////////
00600 BOOL CALLBACK EnumLDateFormatsProc(LPTSTR lpDateFormatString)
00601 {
00602     BOOL bProcessed = TRUE;
00603
00604     if (!lpDateFormatString)
00605     {
00606         return FALSE;
00607     }
00608     else
00609     {
00610         // Fill into the combo box the list of supported long date formats...
00611         SendMessage(GetDlgItem(g_hDlg, IDC_LDATEFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpDateFormatString);
00612     }
00613
00614     return bProcessed;
00615 }
00616
00617 ///////////////////////////////////////////////////////////////////////////////////////////
00618 //  Function:       EnumCalendarInfoProc
00619 //
00620 //  Description:    Callback function for calendar name enumeration.
00621 //
00622 //  Comments:
00623 //
00624 ///////////////////////////////////////////////////////////////////////////////////////////
00625 BOOL CALLBACK EnumCalendarInfoProc(LPTSTR lpCalendarInfoString)
00626 {
00627     BOOL bProcessed = TRUE;
00628
00629     if (!lpCalendarInfoString)
00630     {
00631         return FALSE;
00632     }
00633     else
00634     {
00635         // Fill into the combo box the list of supported calendars...
00636         SendMessage(GetDlgItem(g_hDlg, IDC_CALFORMAT), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lpCalendarInfoString);
00637     }
00638
00639     return bProcessed;
00640 }
00641
00642
00643 ///////////////////////////////////////////////////////////////////////////////////////////
00644 //  Function:       LcidDlgProc
00645 //
00646 //  Description:    Message-processing function for lcid windows.
00647 //
00648 //  Comments:
00649 //
00650 ///////////////////////////////////////////////////////////////////////////////////////////
00651 INT_PTR CALLBACK LcidDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00652 {
00653     BOOL bProcessedMsg = TRUE;
00654
00655     switch(uMsg)
00656     {
00657     case WM_INITDIALOG:
00658         {
00659             TCHAR   szCurName[STR_LEN];
00660
00661             // Get and write Localized Name...
00662             GetLocaleInfo(g_iCurLocale, LOCALE_SLANGUAGE , szCurName, STR_LEN);
00663             SetWindowText(GetDlgItem(hDlg, IDC_LANGNAME), szCurName);
00664
00665             // Get and write Native Language Name...
00666             GetLocaleInfo(g_iCurLocale, LOCALE_SNATIVELANGNAME , szCurName, STR_LEN);
00667             SetWindowText(GetDlgItem(hDlg, IDC_NLANGNAME), szCurName);
00668
00669             // Get and write Native Country Name...
00670             GetLocaleInfo(g_iCurLocale, LOCALE_SNATIVECTRYNAME , szCurName, STR_LEN);
00671             SetWindowText(GetDlgItem(hDlg, IDC_NCOUNTRYNAME), szCurName);
00672
00673             // Get and write ANSI CP
00674             GetLocaleInfo(g_iCurLocale, LOCALE_IDEFAULTANSICODEPAGE , szCurName, STR_LEN);
00675             SetWindowText(GetDlgItem(hDlg, IDC_ACP), szCurName);
00676
00677             // Get and write OEM CP
00678             GetLocaleInfo(g_iCurLocale, LOCALE_IDEFAULTCODEPAGE , szCurName, STR_LEN);
00679             SetWindowText(GetDlgItem(hDlg, IDC_OEM), szCurName);
00680         }
00681         break;
00682
00683     case WM_COMMAND:
00684         switch(LOWORD(wParam))
00685         {
00686             case IDOK:      /* fall-through */
00687             case IDCANCEL:
00688                 bProcessedMsg = EndDialog(hDlg, TRUE);
00689                 break;
00690         }
00691      break;
00692
00693     default:
00694         bProcessedMsg = FALSE;
00695         break;
00696     }
00697
00698     return bProcessedMsg;
00699 }
00700
00701 ///////////////////////////////////////////////////////////////////////////////////////////
00702 //  Function:       CompareFunc
00703 //
00704 //  Description:    An enumeration function for our list view control
00705 //                  lParam1: the lparam parameter of the first item to be compared
00706 //                  lParam2: the lparam of the second item we are comparing against
00707 //                  lParamSort: the column to which the items  to be compared belongs to
00708 //
00709 //  Comments:
00710 //
00711 ///////////////////////////////////////////////////////////////////////////////////////////
00712 int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
00713 {
00714 int     iRet = 0;
00715 TCHAR   csItem1[STR_LEN], csItem2[STR_LEN];
00716
00717     // We are just reversing the order, just leave now.
00718     if (lParamSort == -1)
00719     {
00720         iRet = 1;
00721     }
00722     else
00723     {
00724         // find the text of the subitem that we want to sort...
00725         ListView_GetItemText(g_hwndList, (int)lParam1, (int)lParamSort, csItem1, STR_LEN);
00726         ListView_GetItemText(g_hwndList, (int)lParam2, (int)lParamSort, csItem2, STR_LEN);
00727
00728         switch (lParamSort)
00729         {
00730             case COLUMN_LANGID:
00731                 iRet = lstrcmp(csItem1, csItem2);
00732                 break;
00733
00734             case COLUMN_LANGUAGE:
00735                 iRet = lstrcmp(csItem1, csItem2);
00736                 break;
00737
00738             case COLUMN_ACP:
00739                 iRet = _ttoi(csItem1) - _ttoi (csItem2);
00740                 break;
00741
00742         case COLUMN_OEMCP:
00743                 iRet = _ttoi(csItem1) - _ttoi (csItem2);
00744                 break;
00745
00746             // Don't do anything. We should not get here.
00747             default:
00748                 iRet = -1;
00749         }
00750     }
00751
00752     return iRet;
00753 }
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRTCOutgoingDlg Member List

This is the complete list of members for CRTCOutgoingDlg, including all inherited members.
AddRef(void) | CRTCOutgoingDlg | [protected]
AddToMediaCapabilities(LONG lMedia, VARIANT_BOOL fPersist) | CRTCOutgoingDlg | [protected]
AddToParticipantList(BSTR bstrParty) | CRTCOutgoingDlg | [protected]
CRTCOutgoingDlg(CWnd *pParent=NULL) | CRTCOutgoingDlg |
DoDataExchange(CDataExchange *pDX) | CRTCOutgoingDlg | [protected, virtual]
Event(RTC_EVENT RTCEvent, IDispatch *pEvent) | CRTCOutgoingDlg | [protected]
IDD enum value | CRTCOutgoingDlg |
InitialControlsState() | CRTCOutgoingDlg | [protected]
InitializeRTCApp() | CRTCOutgoingDlg | [protected]
m_btnAddParty | CRTCOutgoingDlg |
m_btnAppSharing | CRTCOutgoingDlg |
m_btnConnect | CRTCOutgoingDlg |
m_btnDisconnect | CRTCOutgoingDlg |
m_btnPcPc | CRTCOutgoingDlg |
m_btnPcPh | CRTCOutgoingDlg |
m_btnPhPh | CRTCOutgoingDlg |
m_btnRemoveParty | CRTCOutgoingDlg |
m_btnTune | CRTCOutgoingDlg |
m_ctrlEditStatus | CRTCOutgoingDlg |
m_dwEventCookie | CRTCOutgoingDlg | [protected]
m_dwRefCount | CRTCOutgoingDlg | [protected]
m_editDURI | CRTCOutgoingDlg |
m_editLURI | CRTCOutgoingDlg |
m_hIcon | CRTCOutgoingDlg | [protected]
m_lbParties | CRTCOutgoingDlg |
m_pIPrevVideo | CRTCOutgoingDlg | [protected]
m_pIRecvVideo | CRTCOutgoingDlg | [protected]
m_pIRTCClient | CRTCOutgoingDlg | [protected]
m_pIRTCParty | CRTCOutgoingDlg | [protected]
m_pIRTCSession | CRTCOutgoingDlg | [protected]
m_SessionType | CRTCOutgoingDlg | [protected]
OnAddparty() | CRTCOutgoingDlg | [protected]
OnAppsharing() | CRTCOutgoingDlg | [protected]
OnClose() | CRTCOutgoingDlg | [protected]
OnConnect() | CRTCOutgoingDlg | [protected]
OnDblclkPartylist() | CRTCOutgoingDlg | [protected]
OnDisconnect() | CRTCOutgoingDlg | [protected]
OnInitDialog() | CRTCOutgoingDlg | [protected, virtual]
OnPaint() | CRTCOutgoingDlg | [protected]
OnPcpcradio() | CRTCOutgoingDlg | [protected]
OnPcphradio() | CRTCOutgoingDlg | [protected]
OnPhphradio() | CRTCOutgoingDlg | [protected]
OnQueryDragIcon() | CRTCOutgoingDlg | [protected]
OnRemoveparty() | CRTCOutgoingDlg | [protected]
OnSelchangePartylist() | CRTCOutgoingDlg | [protected]
OnSysCommand(UINT nID, LPARAM lParam) | CRTCOutgoingDlg | [protected]
OnTune() | CRTCOutgoingDlg | [protected]
QueryInterface(REFIID iid, void **ppvObject) | CRTCOutgoingDlg | [protected]
Release(void) | CRTCOutgoingDlg | [protected]
ReleaseStateMachine() | CRTCOutgoingDlg | [protected]
RemoveFromMediaCapabilities(LONG lMedia, VARIANT_BOOL fPersist) | CRTCOutgoingDlg | [protected]
RTCClientEvent(IDispatch *pIDispatch) | CRTCOutgoingDlg | [protected]
RTCMediaEvent(IDispatch *pIDispatch) | CRTCOutgoingDlg | [protected]
RTCSessionStateEvent(IDispatch *pIDispatch) | CRTCOutgoingDlg | [protected]
SESSION_OPERATION typedef | CRTCOutgoingDlg | [protected]
ShutdownRTCApp() | CRTCOutgoingDlg | [protected]
StateAddPartyIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateAddPartyIDCVisible(VARIANT_BOOL fVisible) | CRTCOutgoingDlg | [protected]
StateAppSharingIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateCoCreateClient() | CRTCOutgoingDlg | [protected]
StateConnectIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateConnectIDCVisible(VARIANT_BOOL fVisible) | CRTCOutgoingDlg | [protected]
StateDisconnectIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateDUriIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateInitClient() | CRTCOutgoingDlg | [protected]
StateListenMode(RTC_LISTEN_MODE lMode) | CRTCOutgoingDlg | [protected]
StateLUriIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StatePartyListIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateQueryActiveMedia(LONG *plActiveMedia) | CRTCOutgoingDlg | [protected]
StateRemovePartyIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateSessionControl(SESSION_OPERATION soType) | CRTCOutgoingDlg | [protected]
StateSinkEvent(LONG lEventMask) | CRTCOutgoingDlg | [protected]
StateStartT120(RTC_T120_APPLET tType) | CRTCOutgoingDlg | [protected]
StateStartTunning() | CRTCOutgoingDlg | [protected]
StateTuneIDC(VARIANT_BOOL fEnable) | CRTCOutgoingDlg | [protected]
StateUnSinkEvent() | CRTCOutgoingDlg | [protected]
STO_ADDPARTY enum value | CRTCOutgoingDlg | [protected]
STO_CREATE enum value | CRTCOutgoingDlg | [protected]
STO_REMOVEPARTY enum value | CRTCOutgoingDlg | [protected]
STO_TERMINATE enum value | CRTCOutgoingDlg | [protected]
tagSESSION_OPERATION enum name | CRTCOutgoingDlg | [protected]
WindowProc(UINT message, WPARAM wParam, LPARAM lParam) | CRTCOutgoingDlg | [protected, virtual]
Generated on Wed Nov 13 2024 16:57:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/DCO_DimmerService/DeviceDll.h Source File

  • NetDS
  • upnp
  • DCO_DimmerService

DeviceDll.h

Go to the documentation of this file.
00001
00002 #ifndef __SD_SAMPLEDIMMER_H_
00003 #define __SD_SAMPLEDIMMER_H_
00004
00005 /* Used to create a COM Server Object to host the IUPnPDeviceControl  object for the dimmer device*/
00006 EXTERN_C CComModule _Module;
00007
00008 #endif
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMShare/Cmd.Cpp Source File

  • Web
  • NetMeeting
  • NMShare

Cmd.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMSHARE.EXE
00003 //  File:       CMD.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017
00018 VOID CmdOptions(void)
00019 {
00020 }
00021
00022 //****************************************************************************
00023 //
00024 // VOID CmdClear(void)
00025 //
00026 // Clear the message window
00027 //
00028 //****************************************************************************
00029
00030 VOID CmdClear(void)
00031 {
00032   ClearText();
00033 }
00034
00035
00036 //****************************************************************************
00037 //
00038 // VOID CmdExit(void)
00039 //
00040 // Shutdown the application.
00041 //
00042 //****************************************************************************
00043
00044 VOID CmdExit(void)
00045 {
00046   DestroyWindow(ghwndMain);
00047 }
00048
00049
00050 //****************************************************************************
00051 //
00052 // VOID CmdHelp(void)
00053 //
00054 // Bring up help for the application
00055 //
00056 //****************************************************************************
00057
00058 VOID CmdHelp(void)
00059 {
00060 }
00061
00062
00063 //****************************************************************************
00064 //
00065 // VOID CmdFont(void)
00066 //
00067 // Change the font for the message window
00068 //
00069 //****************************************************************************
00070
00071 VOID CmdFont(void)
00072 {
00073 #ifdef NOTUSED
00074   CHOOSEFONT cf;
00075   LOGFONT    lf;
00076   HFONT      hfont;
00077
00078   lf = gPref.lf;
00079
00080   ClearStruct(&cf);
00081   cf.lStructSize = sizeof(CHOOSEFONT);
00082   cf.hwndOwner = ghwndMain;
00083   cf.lpLogFont = &lf;
00084   cf.iPointSize = 10;
00085   cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_INITTOLOGFONTSTRUCT;
00086
00087   if (ChooseFont(&cf) != TRUE)
00088     return;
00089
00090   hfont= CreateFontIndirect(cf.lpLogFont);
00091   if (hfont == hfontNil)
00092     return;
00093
00094   MaybeDeleteObject((HGDIOBJ *) &ghfontEntry);
00095   ghfontEntry = hfont;
00096   SendMessage(ghwndMsg, WM_SETFONT,
00097     (WPARAM) ghfontEntry, MAKELPARAM(TRUE, 0));
00098
00099   gPref.lf = lf;
00100 #endif
00101 }
00102
00103
00104 //****************************************************************************
00105 //
00106 // VOID CmdAbout(void)
00107 //
00108 // Display the about box
00109 //
00110 //****************************************************************************
00111
00112 VOID CmdAbout(void)
00113 {
00114   TCHAR szVersion[MAX_PATH];
00115
00116   LoadString(ghInst, IDS_VERSION, szVersion, CCHMAX(szVersion));
00117
00118   ShellAbout(ghwndMain, szVersion, NULL, LoadIcon(ghInst, MAKEINTRESOURCE(ICO_MAIN)));
00119 }
00120
00121
00122
00123 //****************************************************************************
00124 //
00125 // VOID CmdViewSbar(void)
00126 //
00127 // Show/Hide the status bar
00128 //
00129 //****************************************************************************
00130
00131 VOID CmdViewSbar(void)
00132 {
00133   gPref.fSbar = !gPref.fSbar;
00134   ShowHwnd(ghwndSbar, gPref.fSbar, IDM_VIEW_SBAR);
00135 }
00136
00137
00138 VOID CmdViewMsg(void)
00139 {
00140   gPref.fMsgWindow = !gPref.fMsgWindow;
00141   ShowHwnd(ghwndMsg, gPref.fMsgWindow, IDM_VIEW_MSG);
00142 }
00143
00144
00145 VOID CmdViewUsers(void)
00146 {
00147   gPref.fUserList = !gPref.fUserList;
00148   ShowHwnd(ghwndUser, gPref.fUserList, IDM_VIEW_USERLIST);
00149 }
00150
00151 VOID CmdRefresh(void)
00152 {
00153   DoEnumApps();
00154 }
00155
00156 VOID CmdWorkAlone(void)
00157 {
00158   DoWorkAlone();
00159 }
00160
00161 VOID CmdCollaborate(void)
00162 {
00163   DoCollaborate();
00164 }
00165
00166 VOID CmdInControl(void)
00167 {
00168   DoTakeControl();
00169 }
00170
00171
00172 //****************************************************************************
00173 //
00174 // Main window command table definition.
00175 //
00176 //****************************************************************************
00177
00178 static CMD _rgcmdMain[] =
00179 {
00180   {IDM_EXIT,                CmdExit},
00181
00182   {IDM_WORK_ALONE,          CmdWorkAlone},
00183   {IDM_COLLABORATE,         CmdCollaborate},
00184   {IDM_IN_CONTROL,          CmdInControl},
00185
00186   {IDM_VIEW_CLEAR,          CmdClear},
00187
00188   {IDM_VIEW_SBAR,           CmdViewSbar},
00189   {IDM_VIEW_MSG,            CmdViewMsg},
00190   {IDM_VIEW_USERLIST,       CmdViewUsers},
00191   {IDM_REFRESH,             CmdRefresh},
00192
00193   {IDM_HELP,                CmdHelp},
00194   {IDM_ABOUT,               CmdAbout},
00195
00196   {0, NULL}  // MUST be last entry in the table
00197 };
00198
00199
00200 //****************************************************************************
00201 //
00202 // LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
00203 //
00204 // Handle a WM_COMMAND message
00205 //
00206 //****************************************************************************
00207
00208 LRESULT MsgCmdMain(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam)
00209 {
00210   UINT wCmd = (UINT) GET_WM_COMMAND_ID(wparam, lparam);
00211
00212   for (LPCMD lpcmd = _rgcmdMain; 0 != lpcmd->wCmd; lpcmd++)
00213   {
00214     if (wCmd == lpcmd->wCmd)
00215     {
00216       lpcmd->pfncmd();
00217       break;
00218     }
00219   }
00220
00221   return 0L;
00222 }
00223
00224
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpy/SpyCon.h Source File

  • Com
  • Administration
  • Spy
  • ComSpy

SpyCon.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __SPYCON_H_
00018 #define __SPYCON_H_
00019
00020 #include "resource.h"       // main symbols
00021
00022 /////////////////////////////////////////////////////////////////////////////
00023 // CSpyCon
00024 class ATL_NO_VTABLE CSpyCon :
00025   public CComObjectRoot,
00026   public CComCoClass<CSpyCon, &CLSID_SpyCon>,
00027   public ISpyCon,
00028   public CWindowImpl<CSpyCon>,
00029   public IOleClientSite,
00030   public IOleInPlaceSite
00031
00032 {
00033 private:
00034     IOleObject * m_pOleObject;
00035     BOOL m_bInPlaceActive;
00036     IComSpy * m_pSpy;
00037 public:
00038
00039   BOOL m_bTopmost;
00040   WINDOWPLACEMENT m_wp;
00041   BOOL m_bSaveOnExit;
00042
00043   ~CSpyCon()
00044   {
00045     SafeRelease(m_pSpy);
00046     SafeRelease(m_pOleObject);
00047   }
00048   CSpyCon()
00049   {
00050     memset(&m_wp, NULL, sizeof(m_wp));
00051     m_wp.length = sizeof(m_wp);
00052     m_bTopmost = FALSE;
00053     m_bInPlaceActive = FALSE;
00054     m_bSaveOnExit = TRUE;
00055     m_pSpy = NULL;
00056     m_pOleObject = NULL;
00057   }
00058
00059   void FinalRelease()
00060   {
00061     SafeRelease(m_pSpy);
00062     SafeRelease(m_pOleObject);
00063   }
00064 DECLARE_REGISTRY_RESOURCEID(IDR_SPYCON)
00065 DECLARE_NOT_AGGREGATABLE(CSpyCon)
00066
00067 BEGIN_COM_MAP(CSpyCon)
00068   COM_INTERFACE_ENTRY(ISpyCon)
00069   COM_INTERFACE_ENTRY(IOleClientSite)
00070   COM_INTERFACE_ENTRY(IOleWindow)
00071   COM_INTERFACE_ENTRY(IOleInPlaceSite)
00072 END_COM_MAP()
00073
00074 BEGIN_MSG_MAP(CSpyCon)
00075   MESSAGE_HANDLER(WM_NCDESTROY, OnNCDestroy)
00076   MESSAGE_HANDLER(WM_SIZE, OnSize)
00077   MESSAGE_HANDLER(WM_ERASEBKGND, OnErase)
00078   MESSAGE_HANDLER(WM_INITMENU, OnInitMenu)
00079   COMMAND_ID_HANDLER(IDM_EXIT, OnExit)
00080   COMMAND_ID_HANDLER(WM_CLOSE, OnExit)
00081   COMMAND_ID_HANDLER(IDM_SELECT_APPLICATIONS, OnSelectFilter)
00082   MESSAGE_HANDLER(WM_SYSCOMMAND, OnSysCommand)
00083   COMMAND_ID_HANDLER(ID_LOG, OnLogToFile)
00084   COMMAND_ID_HANDLER(ID_CHOOSE_LOG_FILE_NAME, OnChooseLogFile)
00085   COMMAND_ID_HANDLER(ID_SAVE, OnSave)
00086   COMMAND_ID_HANDLER(ID_CLEAR, OnClear)
00087   COMMAND_ID_HANDLER(ID_OPTIONS_GRID_LINES, OnToggleGridLines)
00088   COMMAND_ID_HANDLER(IDM_ON_TOP, OnAlwaysOnTop)
00089   COMMAND_ID_HANDLER(IDM_ABOUT, OnAbout)
00090   COMMAND_ID_HANDLER(ID_CHOOSEFONT, OnChooseFont)
00091   COMMAND_ID_HANDLER(ID_SHOW_ON_SCREEN, OnToggleShowOnScreen)
00092   COMMAND_ID_HANDLER(ID_SAVE_ON_EXIT, OnToggleSaveOnExit)
00093   COMMAND_ID_HANDLER(ID_SAVE_NOW, OnSaveNow)
00094
00095 END_MSG_MAP()
00096
00097   LRESULT OnSaveNow(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00098   LRESULT OnToggleSaveOnExit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00099   LRESULT OnToggleShowOnScreen(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00100   LRESULT OnSelectFilter(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00101   LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00102   LRESULT OnLogToFile(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00103   LRESULT OnChooseLogFile(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00104   LRESULT OnInitMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00105   LRESULT OnSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00106   LRESULT OnClear(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00107   LRESULT OnToggleGridLines(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00108   LRESULT OnAlwaysOnTop(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00109   LRESULT OnAbout(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00110   LRESULT OnChooseFont(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00111   LRESULT OnClose(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00112   LRESULT OnExit(WORD /*wNotifyCode*/, WORD /* wID */, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00113
00114   LRESULT OnNCDestroy(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& /* lResult */)
00115   {
00116     PostQuitMessage(0);
00117     return 0;
00118   }
00119
00120   LRESULT OnErase(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& bHandled)
00121   {
00122     if (m_bInPlaceActive)
00123       return 0;
00124     bHandled = FALSE;
00125     return 1;
00126   }
00127
00128   LRESULT OnSize(UINT /* uMsg */, WPARAM /* wParam */, LPARAM /* lParam */, BOOL& /* lResult */)
00129   {
00130     if (m_pOleObject && m_bInPlaceActive)
00131     {
00132       CComQIPtr<IOleInPlaceObject, &IID_IOleInPlaceObject> pInPlaceObject(m_pOleObject);
00133       RECT rcClient;
00134       GetClientRect(&rcClient);
00135       pInPlaceObject->SetObjectRects(&rcClient, &rcClient);
00136       GetWindowPlacement(&m_wp); // for storing in the registry
00137     }
00138     return 0;
00139   }
00140 // ISpyCon
00141 public:
00142   STDMETHOD(Run)();
00143
00144 // IOleClientSite
00145 public:
00146     STDMETHOD(SaveObject)(void)
00147   {
00148     ATLTRACENOTIMPL(_T("IOleClientSite::SaveObject"));
00149   }
00150     STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
00151   {
00152     ATLTRACENOTIMPL(_T("IOleClientSite::GetMoniker"));
00153   }
00154     STDMETHOD(GetContainer)(IOleContainer **ppContainer)
00155   {
00156     ATLTRACENOTIMPL(_T("IOleClientSite::GetContainer"));
00157   }
00158     STDMETHOD(ShowObject)(void)
00159   {
00160     ATLTRACENOTIMPL(_T("IOleClientSite::ShowObject"));
00161   }
00162     STDMETHOD(OnShowWindow)(BOOL fShow)
00163   {
00164     ATLTRACENOTIMPL(_T("IOleClientSite::OnShowWindow"));
00165   }
00166     STDMETHOD(RequestNewObjectLayout)(void)
00167   {
00168     ATLTRACENOTIMPL(_T("IOleClientSite::RequestNewObjectLayout"));
00169   }
00170
00171
00172 // IOleWindow
00173 public:
00174     STDMETHOD(GetWindow)(HWND *phwnd)
00175   {
00176     *phwnd = m_hWnd;
00177     return S_OK;
00178   }
00179     STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode)
00180   {
00181     ATLTRACENOTIMPL(_T("IOleWindow::CanInPlaceActivate"));
00182   }
00183
00184 // IOleInPlaceSite
00185 public:
00186   HRESULT SaveSettings();
00187     STDMETHOD(CanInPlaceActivate)(void)
00188   {
00189     return S_OK;
00190   }
00191     STDMETHOD(OnInPlaceActivate)(void)
00192   {
00193     m_bInPlaceActive = TRUE;
00194     return S_OK;
00195   }
00196     STDMETHOD(OnUIActivate)(void)
00197   {
00198     ATLTRACENOTIMPL(_T("IOleInPlaceSite::OnUIActivate"));
00199   }
00200     STDMETHOD(GetWindowContext)(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc,
00201     LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
00202   {
00203     GetClientRect(lprcPosRect);
00204     GetClientRect(lprcClipRect);
00205     return S_OK;
00206   }
00207     STDMETHOD(Scroll)(SIZE scrollExtant)
00208   {
00209     ATLTRACENOTIMPL(_T("IOleInPlaceSite::Scroll"));
00210   }
00211     STDMETHOD(OnUIDeactivate)(BOOL fUndoable)
00212   {
00213     ATLTRACENOTIMPL(_T("IOleInPlaceSite::OnUIDeactivate"));
00214   }
00215     STDMETHOD(OnInPlaceDeactivate)( void)
00216   {
00217     m_bInPlaceActive = FALSE;
00218     return S_OK;
00219   }
00220     STDMETHOD(DiscardUndoState)( void)
00221   {
00222     ATLTRACENOTIMPL(_T("IOleInPlaceSite::DiscardUndoState"));
00223   }
00224     STDMETHOD(DeactivateAndUndo)( void)
00225   {
00226     ATLTRACENOTIMPL(_T("IOleInPlaceSite::DeactivateAndUndo"));
00227   }
00228     STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect)
00229   {
00230     ATLTRACENOTIMPL(_T("IOleInPlaceSite::OnPosRectChange"));
00231   }
00232
00233
00234
00235 };
00236
00237 #endif //__SPYCON_H_
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nameext/nameext.Cpp Source File

  • SysMgmt
  • MMC
  • Nameext

nameext.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "sky.h"
00021 #include "nameext.h"
00022 #include "DataObj.h"
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include <crtdbg.h>
00026
00027
00028 // we need to do this to get around MMC.IDL - it explicitly defines
00029 // the clipboard formats as WCHAR types...
00030 #define _T_CCF_DISPLAY_NAME _T("CCF_DISPLAY_NAME")
00031 #define _T_CCF_NODETYPE _T("CCF_NODETYPE")
00032 #define _T_CCF_SNAPIN_CLASSID _T("CCF_SNAPIN_CLASSID")
00033
00034 // These are the clipboard formats that we must supply at a minimum.
00035 // mmc.h actually defined these. We can make up our own to use for
00036 // other reasons. We don't need any others at this time.
00037 UINT CComponentData::s_cfDisplayName = RegisterClipboardFormat(_T_CCF_DISPLAY_NAME);
00038 UINT CComponentData::s_cfNodeType    = RegisterClipboardFormat(_T_CCF_NODETYPE);
00039 UINT CComponentData::s_cfSnapInCLSID = RegisterClipboardFormat(_T_CCF_SNAPIN_CLASSID);
00040
00041
00042 const GUID CComponentData::skybasedvehicleGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00043
00044 HBITMAP CComponentData::m_pBMapSm = NULL;
00045 HBITMAP CComponentData::m_pBMapLg = NULL;
00046
00047 CComponentData::CComponentData()
00048 : m_cref(0), bExpanded(FALSE), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00049 {
00050     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00051         LoadBitmaps();
00052
00053   OBJECT_CREATED
00054 }
00055
00056 CComponentData::~CComponentData()
00057 {
00058
00059     OBJECT_DESTROYED
00060 }
00061
00062 ///////////////////////
00063 // IUnknown implementation
00064 ///////////////////////
00065
00066 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00067 {
00068     if (!ppv)
00069         return E_FAIL;
00070
00071     *ppv = NULL;
00072
00073     if (IsEqualIID(riid, IID_IUnknown))
00074         *ppv = static_cast<IComponentData *>(this);
00075     else if (IsEqualIID(riid, IID_IComponentData))
00076         *ppv = static_cast<IComponentData *>(this);
00077     else if (IsEqualIID(riid, IID_IExtendContextMenu))
00078         *ppv = static_cast<IExtendContextMenu *>(this);
00079
00080     if (*ppv)
00081     {
00082         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00083         return S_OK;
00084     }
00085
00086     return E_NOINTERFACE;
00087 }
00088
00089 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00090 {
00091     return InterlockedIncrement((LONG *)&m_cref);
00092 }
00093
00094 STDMETHODIMP_(ULONG) CComponentData::Release()
00095 {
00096     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00097     {
00098         // we need to decrement our object count in the DLL
00099         delete this;
00100         return 0;
00101     }
00102
00103     return m_cref;
00104 }
00105
00106 ///////////////////////////////
00107 // Interface IComponentData
00108 ///////////////////////////////
00109 HRESULT CComponentData::Initialize(
00110                                    /* [in] */ LPUNKNOWN pUnknown)
00111 {
00112     HRESULT      hr;
00113
00114     //
00115     // Get pointer to name space interface
00116     //
00117     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00118     _ASSERT( S_OK == hr );
00119
00120     //
00121     // Get pointer to console interface
00122     //
00123     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00124     _ASSERT( S_OK == hr );
00125
00126     IImageList *pImageList;
00127     m_ipConsole->QueryScopeImageList(&pImageList);
00128     _ASSERT( S_OK == hr );
00129
00130     hr = pImageList->ImageListSetStrip( (long *)m_pBMapSm, // pointer to a handle
00131         (long *)m_pBMapLg, // pointer to a handle
00132         0, // index of the first image in the strip
00133         RGB(0, 128, 128)  // color of the icon mask
00134         );
00135
00136     pImageList->Release();
00137
00138     return S_OK;
00139 }
00140
00141 HRESULT CComponentData::CreateComponent(
00142                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00143 {
00144     *ppComponent = NULL;
00145
00146     CComponent *pComponent = new CComponent(this);
00147
00148     if (NULL == pComponent)
00149         return E_OUTOFMEMORY;
00150
00151     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00152 }
00153
00154 HRESULT CComponentData::Notify(
00155                                /* [in] */ LPDATAOBJECT lpDataObject,
00156                                /* [in] */ MMC_NOTIFY_TYPE event,
00157                                /* [in] */ LPARAM arg,
00158                                /* [in] */ LPARAM param)
00159 {
00160     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00161
00162   HRESULT hr = S_FALSE;
00163
00164   if (NULL == lpDataObject)
00165         return hr;
00166
00167   switch (event)
00168   {
00169     case MMCN_EXPAND:
00170
00171       GUID myGuid;
00172       GUID* pGUID= &myGuid;
00173       // extract GUID of the the currently selected node type from the data object
00174       hr = ExtractObjectTypeGUID(lpDataObject, pGUID);
00175       _ASSERT( S_OK == hr );
00176
00177
00178       // compare node type GUIDs of currently selected node and the node type
00179       // we want to extend. If they are are equal, currently selected node
00180       // is the type we want to extend, so we add our items underneath it
00181       if (IsEqualGUID(*pGUID, getPrimaryNodeType()))
00182         OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00183
00184       else
00185       // currently selected node is one of ours instead
00186       {
00187         CDelegationBase *base = GetOurDataObject(lpDataObject)->GetBaseNodeObject();
00188         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00189       }
00190
00191       break;
00192   }
00193
00194     return hr;
00195 }
00196
00197 HRESULT CComponentData::Destroy( void)
00198 {
00199     // Free interfaces
00200     if (m_ipConsoleNameSpace) {
00201         m_ipConsoleNameSpace->Release();
00202         m_ipConsoleNameSpace = NULL;
00203     }
00204
00205     if (m_ipConsole) {
00206         m_ipConsole->Release();
00207         m_ipConsole = NULL;
00208     }
00209
00210     return S_OK;
00211 }
00212
00213 HRESULT CComponentData::QueryDataObject(
00214                                         /* [in] */ MMC_COOKIE cookie,
00215                                         /* [in] */ DATA_OBJECT_TYPES type,
00216                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00217 {
00218     CDataObject *pObj = NULL;
00219
00220   //cookie == 0 not possible in a namespace extension
00221 //    if (cookie == 0)
00222 //        pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00223 //    else
00224       pObj = new CDataObject(cookie, type);
00225
00226     if (!pObj)
00227         return E_OUTOFMEMORY;
00228
00229     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00230
00231     return S_OK;
00232 }
00233
00234 HRESULT CComponentData::GetDisplayInfo(
00235                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00236 {
00237     HRESULT hr = S_FALSE;
00238
00239     // if they are asking for the SDI_STR we have one of those to give
00240     if (pScopeDataItem->lParam) {
00241         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00242         if (pScopeDataItem->mask & SDI_STR) {
00243             LPCTSTR pszT = base->GetDisplayName();
00244             MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00245             pScopeDataItem->displayname = pszW;
00246         }
00247
00248         if (pScopeDataItem->mask & SDI_IMAGE) {
00249             pScopeDataItem->nImage = base->GetBitmapIndex();
00250         }
00251     }
00252
00253     return hr;
00254 }
00255
00256 HRESULT CComponentData::CompareObjects(
00257                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00258                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00259 {
00260     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00261     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00262
00263     // compare the object pointers
00264     if (baseA->GetCookie() == baseB->GetCookie())
00265         return S_OK;
00266
00267     return S_FALSE;
00268 }
00269
00270
00271 ///////////////////////////////
00272 // Interface IExtendContextMenu
00273 ///////////////////////////////
00274 HRESULT CComponentData::AddMenuItems(
00275                                      /* [in] */ LPDATAOBJECT piDataObject,
00276                                      /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
00277                                      /* [out][in] */ long __RPC_FAR *pInsertionAllowed)
00278 {
00279     CDelegationBase *base = GetOurDataObject(piDataObject)->GetBaseNodeObject();
00280
00281     return base->OnAddMenuItems(piCallback, pInsertionAllowed);
00282 }
00283
00284 HRESULT CComponentData::Command(
00285                                 /* [in] */ long lCommandID,
00286                                 /* [in] */ LPDATAOBJECT piDataObject)
00287 {
00288     CDelegationBase *base = GetOurDataObject(piDataObject)->GetBaseNodeObject();
00289
00290     return base->OnMenuCommand(m_ipConsole, lCommandID);
00291 }
00292
00293
00294 ///////////////////////////////
00295 // CComponentData::OnExpand
00296 ///////////////////////////////
00297
00298 HRESULT CComponentData::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00299 {
00300   //first create the CSkyVehicle objects, one for each inserted item
00301     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00302         children[n] = new CSkyVehicle(n + 1);
00303     }
00304
00305   //now fill an SCOPEDATAITEM for each item and then insert it
00306   SCOPEDATAITEM sdi;
00307
00308     if (!bExpanded) {
00309         // create the child nodes, then expand them
00310         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00311             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00312             sdi.mask = SDI_STR       |   // Displayname is valid
00313                 SDI_PARAM     |   // lParam is valid
00314                 SDI_IMAGE     |   // nImage is valid
00315                 SDI_OPENIMAGE |   // nOpenImage is valid
00316                 SDI_PARENT    |   // relativeID is valid
00317                 SDI_CHILDREN;     // cChildren is valid
00318
00319             sdi.relativeID  = (HSCOPEITEM)parent;
00320             sdi.nImage      = children[n]->GetBitmapIndex();
00321             sdi.nOpenImage  = INDEX_OPENFOLDER;
00322             sdi.displayname = MMC_CALLBACK;
00323             sdi.lParam      = (LPARAM)children[n];       // The cookie
00324             sdi.cChildren   = 0;
00325
00326             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00327
00328             _ASSERT( SUCCEEDED(hr) );
00329         }
00330     }
00331
00332     return S_OK;
00333 }
00334
00335
00336
00337 ///////////////////////////////
00338 // Member functions for extracting
00339 // information from a primary's
00340 // data object
00341 ///////////////////////////////
00342
00343 HRESULT CComponentData::ExtractData( IDataObject* piDataObject,
00344                                            CLIPFORMAT   cfClipFormat,
00345                                            BYTE*        pbData,
00346                                            DWORD        cbData )
00347 {
00348     HRESULT hr = S_OK;
00349
00350     FORMATETC formatetc = {cfClipFormat, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00351     STGMEDIUM stgmedium = {TYMED_HGLOBAL, NULL};
00352
00353     stgmedium.hGlobal = ::GlobalAlloc(GPTR, cbData);
00354     do // false loop
00355     {
00356         if (NULL == stgmedium.hGlobal)
00357         {
00358             hr = E_OUTOFMEMORY;
00359             break;
00360         }
00361         hr = piDataObject->GetDataHere( &formatetc, &stgmedium );
00362         if ( FAILED(hr) )
00363         {
00364             break;
00365         }
00366
00367         BYTE* pbNewData = reinterpret_cast<BYTE*>(stgmedium.hGlobal);
00368         if (NULL == pbNewData)
00369         {
00370             hr = E_UNEXPECTED;
00371             break;
00372         }
00373         ::memcpy( pbData, pbNewData, cbData );
00374     } while (FALSE); // false loop
00375
00376     if (NULL != stgmedium.hGlobal)
00377     {
00378         ::GlobalFree(stgmedium.hGlobal);
00379     }
00380     return hr;
00381 } // ExtractData()
00382
00383 HRESULT CComponentData::ExtractString( IDataObject *piDataObject,
00384                                              CLIPFORMAT   cfClipFormat,
00385                                              _TCHAR       *pstr,
00386                                              DWORD        cchMaxLength)
00387 {
00388     return ExtractData( piDataObject, cfClipFormat, (PBYTE)pstr, cchMaxLength );
00389 }
00390
00391 HRESULT CComponentData::ExtractSnapInCLSID( IDataObject* piDataObject, CLSID* pclsidSnapin )
00392 {
00393     return ExtractData( piDataObject, s_cfSnapInCLSID, (PBYTE)pclsidSnapin, sizeof(CLSID) );
00394 }
00395
00396 HRESULT CComponentData::ExtractObjectTypeGUID( IDataObject* piDataObject, GUID* pguidObjectType )
00397 {
00398     return ExtractData( piDataObject, s_cfNodeType, (PBYTE)pguidObjectType, sizeof(GUID) );
00399 }
00400
00401
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/StdAfx.h Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__1A34A4C5_1C2D_11D1_98C4_00C04FC2C8D5__INCLUDED_)
00006 #define AFX_STDAFX_H__1A34A4C5_1C2D_11D1_98C4_00C04FC2C8D5__INCLUDED_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012 #define STRICT
00013
00014
00015 #if !defined(_WIN32_WINNT)
00016 #define _WIN32_WINNT 0x0500
00017 #endif // !defined(_WIN32_WINNT)
00018
00019 #define _ATL_APARTMENT_THREADED
00020
00021
00022 #include <atlbase.h>
00023 //You may derive a class from CComModule and use it if you want to override
00024 //something, but do not change the name of _Module
00025 extern CComModule _Module;
00026 #include <atlcom.h>
00027
00028 //{{AFX_INSERT_LOCATION}}
00029 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00030
00031 #endif // !defined(AFX_STDAFX_H__1A34A4C5_1C2D_11D1_98C4_00C04FC2C8D5__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProviderFactory Member List

This is the complete list of members for CProviderFactory, including all inherited members.
CProviderFactory(CListBox *pOutputList) | CProviderFactory |
CProviderFactory(CListBox *pOutputList) | CProviderFactory |
m_cRef | CProviderFactory | [private]
m_pOutputList | CProviderFactory | [private]
ppvObject | CProviderFactory |
QueryInterface(REFIID, LPVOID *) | CProviderFactory |
QueryInterface(REFIID, LPVOID *) | CProviderFactory |
riid | CProviderFactory |
STDMETHOD_(SCODE, CreateInstance)(IUnknown *pUnkOuter | CProviderFactory |
STDMETHOD_(SCODE, LockServer)(BOOL fLock) | CProviderFactory |
STDMETHOD_(SCODE, CreateInstance)(IUnknown *pUnkOuter | CProviderFactory |
STDMETHOD_(SCODE, LockServer)(BOOL fLock) | CProviderFactory |
STDMETHODIMP_(ULONG) AddRef(void) | CProviderFactory |
STDMETHODIMP_(ULONG) Release(void) | CProviderFactory |
STDMETHODIMP_(ULONG) AddRef(void) | CProviderFactory |
STDMETHODIMP_(ULONG) Release(void) | CProviderFactory |
~CProviderFactory() | CProviderFactory | [virtual]
~CProviderFactory() | CProviderFactory | [virtual]
Generated on Wed Nov 13 2024 16:57:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEventSink Member List

This is the complete list of members for CEventSink, including all inherited members.
CEventSink(HWND hwnd) | CEventSink | [inline]
CEventSink() | CEventSink | [inline]
Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams, VARIANT *pvarResult, EXCEPINFO *pexcepinfo, UINT *puArgErr) | CEventSink |
m_hwnd | CEventSink |
m_pBehavior | CEventSink |
mouseDown | CEventSink |
OnClick() | CEventSink |
OnMouseOut() | CEventSink |
OnMouseOver() | CEventSink |
STDMETHOD_(SCODE, Indicate)(long lObjectCount | CEventSink |
~CEventSink() | CEventSink | [inline]
Generated on Wed Nov 13 2024 16:56:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSCPWiz Member List

This is the complete list of members for CSCPWiz, including all inherited members.
AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) | CSCPWiz |
CSCPWiz() | CSCPWiz | [inline]
DECLARE_REGISTRY_CLSID() | CSCPWiz |
GetClassIcon() | CSCPWiz | [inline]
GetClassName() | CSCPWiz | [inline]
GetContainer() | CSCPWiz | [inline]
GetContainerCanonicalName() | CSCPWiz | [inline]
GetCopySourceObj() | CSCPWiz | [inline]
GetDefaultSummary(CString &s) | CSCPWiz |
GetIDsAdminNewObj() | CSCPWiz | [inline]
GetIDsAdminNewObjPrimarySite() | CSCPWiz | [inline]
GetObj() | CSCPWiz | [inline]
GetSummaryInfo(BSTR *pBstrText) | CSCPWiz |
GetTitle() | CSCPWiz | [inline]
Initialize(IADsContainer *pADsContainerObj, IADs *pADsCopySource, LPCWSTR lpszClassName, IDsAdminNewObj *pDsAdminNewObj, LPDSA_NEWOBJ_DISPINFO pDispInfo) | CSCPWiz |
m_hObjClassIcon | CSCPWiz | [protected]
m_pWizPage1 | CSCPWiz | [protected]
m_pWizPage2 | CSCPWiz | [protected]
m_pWizPage3 | CSCPWiz | [protected]
m_spADsContainerObj | CSCPWiz | [private]
m_spADsCopySourceObj | CSCPWiz | [private]
m_spADsObj | CSCPWiz | [private]
m_spDsAdminNewObj | CSCPWiz | [private]
m_spDsAdminNewObjPrimarySite | CSCPWiz | [private]
m_szClassName | CSCPWiz | [protected]
m_szContCanonicalName | CSCPWiz | [protected]
m_szTitle | CSCPWiz | [protected]
OnError(HWND hWnd, HRESULT hr, ULONG uContext) | CSCPWiz |
SetObj(IADs *pADsObj) | CSCPWiz | [inline]
SetObject(IADs *pADsObj) | CSCPWiz |
WriteData(HWND hWnd, ULONG uContext) | CSCPWiz |
WriteDataHelper() | CSCPWiz |
~CSCPWiz() | CSCPWiz | [inline]
Generated on Wed Nov 13 2024 16:57:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/PositionEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

PositionEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: PositionEnum
00019
00020 public class PositionEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adPosUnknown = -1;
00023   public static final short adPosBOF = -2;
00024   public static final short adPosEOF = -3;
00025 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tag_preroll Member List

This is the complete list of members for tag_preroll, including all inherited members.
tkBase | tag_preroll
tkEnd | tag_preroll
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/UserEvents/VCAcct/StdAfx.h Source File

  • Com
  • Services
  • Events
  • UserEvents
  • VCAcct

StdAfx.h

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: stdafx.h
00003 //
00004 // Description: include file for standard system include files,
00005 //        or project specific include files that are used frequently,
00006 //        but are changed infrequently
00007 //
00008 // This file is part of the Microsoft COM+ Samples
00009 //
00010 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00011 //
00012 // This source code is intended only as a supplement to Microsoft
00013 // Development Tools and/or on-line documentation.  See these other
00014 // materials for detailed information reagrding Microsoft code samples.
00015 //
00016 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 // PARTICULAR PURPOSE.
00020 //
00021 //==============================================================================
00022
00023
00024 #define _ATL_STATIC_REGISTRY
00025
00026 #include <atlbase.h>
00027 //You may derive a class from CComModule and use it if you want to override
00028 //something, but do not change the name of _Module
00029 extern CComModule _Module;
00030 #include <atlcom.h>
00031
00032 #define THROW_ERR(exp,str) {if (FAILED (hr = (exp))) {lErrFlag = 0; pErrMsg = _T(str); throw hr;}}
00033 #define THROW_STR(str) { hr = APP_ERROR; lErrFlag = 1; pErrMsg = str; throw hr;}
00034 #define RETHROW_ERR(exp) { if (FAILED(hr = (exp))) {lErrFlag = 2; throw hr;}}
00035
00036 #define APP_ERROR 0x80004100
00037
00038
00039 inline BSTR TCHAR2BSTR (TCHAR* szBuf) {
00040
00041   WCHAR* wszBuf;
00042
00043 #ifndef UNICODE
00044   wszBuf = new WCHAR [512];
00045   MultiByteToWideChar( CP_ACP, 0, szBuf, -1, wszBuf, 512 );
00046 #else
00047   wszBuf = szBuf;
00048 #endif
00049
00050   BSTR bstrNew = ::SysAllocString (wszBuf);
00051
00052 #ifndef UNICODE
00053   delete [] wszBuf;
00054 #endif
00055
00056   return bstrNew;
00057 }
00058
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminComponentFlags.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminComponentFlags.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminComponentFlags
00019
00020 public interface COMAdminComponentFlags
00021 {
00022   public static final int COMAdminCompFlagTypeInfoFound = 1;
00023   public static final int COMAdminCompFlagCOMPlusPropertiesFound = 2;
00024   public static final int COMAdminCompFlagProxyFound = 4;
00025   public static final int COMAdminCompFlagInterfacesFound = 8;
00026   public static final int COMAdminCompFlagAlreadyInstalled = 16;
00027   public static final int COMAdminCompFlagNotInApplication = 32;
00028 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/EventStatusEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

EventStatusEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: EventStatusEnum
00019
00020 public class EventStatusEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adStatusOK = 1;
00023   public static final short adStatusErrorsOccurred = 2;
00024   public static final short adStatusCantDeny = 3;
00025   public static final short adStatusCancel = 4;
00026   public static final short adStatusUnwantedEvent = 5;
00027 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/ToolBar.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

ToolBar.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE: toolbar.c
00009 //
00010 //  PURPOSE: Handles general routines for the Toolbar control
00011 //
00012 //  FUNCTIONS:
00013 //    CreateTBar    - Creates the Toolbar control for the sample.
00014 //    MsgNotify     - Handles the WM_NOTIFY message that gets sent to
00015 //                    the parent window to get ToolTip Text.
00016 //  COMMENTS:
00017 //
00018
00019 #include <windows.h>            // required for all Windows applications
00020 #include <windowsx.h>
00021 #include <commctrl.h>           // prototypes and defs for common controls
00022 #include "globals.h"            // prototypes specific to this application
00023 #include "toolbar.h"            // prototypes and #defines for toolbar.c
00024
00025 // Global Variable for the toolbar control.
00026
00027 HWND    hWndToolbar;
00028
00029 //  **TODO**  Change the following values to match your toolbar bitmap
00030 //
00031 // NUMIMAGES    = Number of images in toolbar.bmp.  Note that this is not
00032 //                the same as the number of elements on the toolbar.
00033 // IMAGEWIDTH   = Width of a single button image in toolbar.bmp
00034 // IMAGEHEIGHT  = Height of a single button image in toolbar.bmp
00035 // BUTTONWIDTH  = Width of a button on the toolbar (zero = default)
00036 // BUTTONHEIGHT = Height of a button on the toolbar (zero = default)
00037
00038 #define NUMIMAGES       9
00039 #define IMAGEWIDTH      18
00040 #define IMAGEHEIGHT     17
00041 #define BUTTONWIDTH     0
00042 #define BUTTONHEIGHT    0
00043
00044 //  **TODO**  Add/remove entries in the following array to define the
00045 //            toolbar buttons (see documentation for TBBUTTON).
00046
00047 TBBUTTON tbButton[] =
00048 {
00049     {1, IDM_MAKECALL,   TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00050     {2, IDM_HANGUPCALL, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00051     {0, 0,              TBSTATE_ENABLED, TBSTYLE_SEP,    0, 0},
00052     {7, IDM_ABOUT,      TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0},
00053 };
00054
00055
00056 //
00057 //  FUNCTION: CreateTBar(HWND)
00058 //
00059 //  PURPOSE:  Calls CreateToolBarEx()
00060 //
00061 //
00062 //  PARAMETERS:
00063 //
00064 //  hwnd - Window handle : Used for the hWndParent parameter of the control.
00065 //
00066 //  RETURN VALUE:
00067 //
00068 //  If toolbar control was created successfully Return TRUE,
00069 //  else returns FALSE.
00070 //
00071 //  COMMENTS:
00072 //
00073 //
00074
00075 BOOL CreateTBar(HWND hwnd)
00076 {
00077     hWndToolbar = CreateToolbarEx(hwnd,
00078                                   WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS,
00079                                   IDM_TOOLBAR,
00080                                   NUMIMAGES,
00081                                   hInst,
00082                                   IDB_BMP,
00083                                   tbButton,
00084                                   sizeof(tbButton)/sizeof(TBBUTTON),
00085                                   BUTTONWIDTH,
00086                                   BUTTONHEIGHT,
00087                                   IMAGEWIDTH,
00088                                   IMAGEHEIGHT,
00089                                   sizeof(TBBUTTON));
00090
00091     return (hWndToolbar != NULL);
00092 }
00093
00094 //
00095 //  FUNCTION: MsgNotify(HWND, UINT, WPARAM, LPARAM)
00096 //
00097 //  PURPOSE:  WM_NOTIFY is sent to the parent window to get the
00098 //            tooltip text assoc'd with that toolbar button.
00099 //
00100 //  PARAMETERS:
00101 //
00102 //    hwnd      - Window handle  (Unused)
00103 //    uMessage  - Message number (Unused)
00104 //    wparam    - Extra data     (Unused)
00105 //    lparam    - TOOLTIPTEXT FAR*
00106 //
00107 //  RETURN VALUE:
00108 //    Always returns 0 - Message handled
00109 //
00110 //
00111 //  COMMENTS:
00112 //    This message fills in the lpszText field of the TOOLTIPTEXT
00113 //    structure if code == TTN_NEEDTEXT
00114 //
00115
00116 LRESULT MsgNotify(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00117 {
00118     LPTOOLTIPTEXT lpToolTipText;
00119     static char   szBuffer[64];
00120
00121     lpToolTipText = (LPTOOLTIPTEXT)lparam;
00122     if (lpToolTipText->hdr.code == TTN_NEEDTEXT)
00123     {
00124         LoadString(hInst,
00125                    (UINT)(lpToolTipText->hdr.idFrom),   // string ID == command ID
00126                    szBuffer,
00127                    sizeof(szBuffer));
00128
00129         lpToolTipText->lpszText = szBuffer;
00130     }
00131     return 0;
00132 }
00133
00134 void EnableMakeCall(HWND hWnd, BOOL bEnable)
00135 {
00136     EnableMenuItem(GetMenu(hWnd), IDM_MAKECALL, MF_BYCOMMAND |
00137         (bEnable ? MF_ENABLED : MF_GRAYED));
00138     SendMessage(hWndToolbar, TB_ENABLEBUTTON, (WPARAM) IDM_MAKECALL,
00139         (LPARAM) MAKELONG(bEnable, 0));
00140
00141 }
00142
00143 void EnableHangupCall(HWND hWnd, BOOL bEnable)
00144 {
00145     EnableMenuItem(GetMenu(hWnd), IDM_HANGUPCALL, MF_BYCOMMAND |
00146         (bEnable ? MF_ENABLED : MF_GRAYED));
00147     SendMessage(hWndToolbar, TB_ENABLEBUTTON, (WPARAM) IDM_HANGUPCALL,
00148         (LPARAM) MAKELONG(bEnable, 0));
00149 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::RecordStatusEnum Member List

This is the complete list of members for msado15::RecordStatusEnum, including all inherited members.
adRecCanceled | msado15::RecordStatusEnum | [static]
adRecCantRelease | msado15::RecordStatusEnum | [static]
adRecConcurrencyViolation | msado15::RecordStatusEnum | [static]
adRecDBDeleted | msado15::RecordStatusEnum | [static]
adRecDeleted | msado15::RecordStatusEnum | [static]
adRecIntegrityViolation | msado15::RecordStatusEnum | [static]
adRecInvalid | msado15::RecordStatusEnum | [static]
adRecMaxChangesExceeded | msado15::RecordStatusEnum | [static]
adRecModified | msado15::RecordStatusEnum | [static]
adRecMultipleChanges | msado15::RecordStatusEnum | [static]
adRecNew | msado15::RecordStatusEnum | [static]
adRecObjectOpen | msado15::RecordStatusEnum | [static]
adRecOK | msado15::RecordStatusEnum | [static]
adRecOutOfMemory | msado15::RecordStatusEnum | [static]
adRecPendingChanges | msado15::RecordStatusEnum | [static]
adRecPermissionDenied | msado15::RecordStatusEnum | [static]
adRecSchemaViolation | msado15::RecordStatusEnum | [static]
adRecUnmodified | msado15::RecordStatusEnum | [static]
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ShellExt/Resource.h Source File

  • WinUI
  • Shell
  • ShellExt

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Visual C++ generated include file.
00003 // Used by shellext.rc
00004 // Copyright 1993 - 2000 Microsoft Corporation.  All Rights Reserved.
00005 //
00006 #define IDI_ICON1                       129
00007 #define IDI_ICON2                       130
00008 #define IDI_ICON3                       131
00009 #define IDD_GAKPAGE                     132
00010 #define IDI_ICON4                       133
00011 #define IDI_ICON5                       134
00012 #define IDI_ICON6                       135
00013 #define IDC_RED                         1000
00014 #define IDC_GREEN                       1001
00015 #define IDC_BLUE                        1002
00016
00017 // Next default values for new objects
00018 //
00019 #ifdef APSTUDIO_INVOKED
00020 #ifndef APSTUDIO_READONLY_SYMBOLS
00021 #define _APS_NEXT_RESOURCE_VALUE        136
00022 #define _APS_NEXT_COMMAND_VALUE         32771
00023 #define _APS_NEXT_CONTROL_VALUE         1000
00024 #define _APS_NEXT_SYMED_VALUE           101
00025 #endif
00026 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADsError/ADsError.h Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADsError

ADsError.h

Go to the documentation of this file.
00001 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00002
00003
00004 /* File created by MIDL compiler version 5.01.0164 */
00005 /* at Tue Apr 13 15:05:07 1999
00006  */
00007 /* Compiler settings for C:\projects\RTK\ADsError\ADsError.idl:
00008     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00009     error checks: allocation ref bounds_check enum stub_data
00010 */
00011 //@@MIDL_FILE_HEADING(  )
00012
00013
00014 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00015 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00016 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00017 #endif
00018
00019 #include "rpc.h"
00020 #include "rpcndr.h"
00021
00022 #ifndef __RPCNDR_H_VERSION__
00023 #error this stub requires an updated version of <rpcndr.h>
00024 #endif // __RPCNDR_H_VERSION__
00025
00026 #ifndef COM_NO_WINDOWS_H
00027 #include "windows.h"
00028 #include "ole2.h"
00029 #endif /*COM_NO_WINDOWS_H*/
00030
00031 #ifndef __ADsError_h__
00032 #define __ADsError_h__
00033
00034 #ifdef __cplusplus
00035 extern "C"{
00036 #endif
00037
00038 /* Forward Declarations */
00039
00040 #ifndef __IADsError_FWD_DEFINED__
00041 #define __IADsError_FWD_DEFINED__
00042 typedef interface IADsError IADsError;
00043 #endif  /* __IADsError_FWD_DEFINED__ */
00044
00045
00046 #ifndef __ADsError_FWD_DEFINED__
00047 #define __ADsError_FWD_DEFINED__
00048
00049 #ifdef __cplusplus
00050 typedef class ADsError ADsError;
00051 #else
00052 typedef struct ADsError ADsError;
00053 #endif /* __cplusplus */
00054
00055 #endif  /* __ADsError_FWD_DEFINED__ */
00056
00057
00058 /* header files for imported files */
00059 #include "oaidl.h"
00060 #include "ocidl.h"
00061
00062 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00063 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00064
00065 #ifndef __IADsError_INTERFACE_DEFINED__
00066 #define __IADsError_INTERFACE_DEFINED__
00067
00068 /* interface IADsError */
00069 /* [unique][helpstring][dual][uuid][object] */
00070
00071
00072 EXTERN_C const IID IID_IADsError;
00073
00074 #if defined(__cplusplus) && !defined(CINTERFACE)
00075
00076     MIDL_INTERFACE("417D01DF-F1C6-11D2-BC88-00C04FD430AF")
00077     IADsError : public IDispatch
00078     {
00079     public:
00080         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetErrorMessage(
00081             /* [in] */ long hResult,
00082             /* [retval][out] */ BSTR __RPC_FAR *pbMsg) = 0;
00083
00084     };
00085
00086 #else   /* C style interface */
00087
00088     typedef struct IADsErrorVtbl
00089     {
00090         BEGIN_INTERFACE
00091
00092         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00093             IADsError __RPC_FAR * This,
00094             /* [in] */ REFIID riid,
00095             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00096
00097         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00098             IADsError __RPC_FAR * This);
00099
00100         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00101             IADsError __RPC_FAR * This);
00102
00103         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
00104             IADsError __RPC_FAR * This,
00105             /* [out] */ UINT __RPC_FAR *pctinfo);
00106
00107         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
00108             IADsError __RPC_FAR * This,
00109             /* [in] */ UINT iTInfo,
00110             /* [in] */ LCID lcid,
00111             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
00112
00113         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
00114             IADsError __RPC_FAR * This,
00115             /* [in] */ REFIID riid,
00116             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
00117             /* [in] */ UINT cNames,
00118             /* [in] */ LCID lcid,
00119             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
00120
00121         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
00122             IADsError __RPC_FAR * This,
00123             /* [in] */ DISPID dispIdMember,
00124             /* [in] */ REFIID riid,
00125             /* [in] */ LCID lcid,
00126             /* [in] */ WORD wFlags,
00127             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
00128             /* [out] */ VARIANT __RPC_FAR *pVarResult,
00129             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
00130             /* [out] */ UINT __RPC_FAR *puArgErr);
00131
00132         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetErrorMessage )(
00133             IADsError __RPC_FAR * This,
00134             /* [in] */ long hResult,
00135             /* [retval][out] */ BSTR __RPC_FAR *pbMsg);
00136
00137         END_INTERFACE
00138     } IADsErrorVtbl;
00139
00140     interface IADsError
00141     {
00142         CONST_VTBL struct IADsErrorVtbl __RPC_FAR *lpVtbl;
00143     };
00144
00145
00146
00147 #ifdef COBJMACROS
00148
00149
00150 #define IADsError_QueryInterface(This,riid,ppvObject) \
00151     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00152
00153 #define IADsError_AddRef(This)  \
00154     (This)->lpVtbl -> AddRef(This)
00155
00156 #define IADsError_Release(This) \
00157     (This)->lpVtbl -> Release(This)
00158
00159
00160 #define IADsError_GetTypeInfoCount(This,pctinfo)  \
00161     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
00162
00163 #define IADsError_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
00164     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
00165
00166 #define IADsError_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
00167     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
00168
00169 #define IADsError_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
00170     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
00171
00172
00173 #define IADsError_GetErrorMessage(This,hResult,pbMsg) \
00174     (This)->lpVtbl -> GetErrorMessage(This,hResult,pbMsg)
00175
00176 #endif /* COBJMACROS */
00177
00178
00179 #endif  /* C style interface */
00180
00181
00182
00183 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IADsError_GetErrorMessage_Proxy(
00184     IADsError __RPC_FAR * This,
00185     /* [in] */ long hResult,
00186     /* [retval][out] */ BSTR __RPC_FAR *pbMsg);
00187
00188
00189 void __RPC_STUB IADsError_GetErrorMessage_Stub(
00190     IRpcStubBuffer *This,
00191     IRpcChannelBuffer *_pRpcChannelBuffer,
00192     PRPC_MESSAGE _pRpcMessage,
00193     DWORD *_pdwStubPhase);
00194
00195
00196
00197 #endif  /* __IADsError_INTERFACE_DEFINED__ */
00198
00199
00200
00201 #ifndef __ADSERRORLib_LIBRARY_DEFINED__
00202 #define __ADSERRORLib_LIBRARY_DEFINED__
00203
00204 /* library ADSERRORLib */
00205 /* [helpstring][version][uuid] */
00206
00207
00208 EXTERN_C const IID LIBID_ADSERRORLib;
00209
00210 EXTERN_C const CLSID CLSID_ADsError;
00211
00212 #ifdef __cplusplus
00213
00214 class DECLSPEC_UUID("417D01E0-F1C6-11D2-BC88-00C04FD430AF")
00215 ADsError;
00216 #endif
00217 #endif /* __ADSERRORLib_LIBRARY_DEFINED__ */
00218
00219 /* Additional Prototypes for ALL interfaces */
00220
00221 unsigned long             __RPC_USER  BSTR_UserSize(     unsigned long __RPC_FAR *, unsigned long            , BSTR __RPC_FAR * );
00222 unsigned char __RPC_FAR * __RPC_USER  BSTR_UserMarshal(  unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
00223 unsigned char __RPC_FAR * __RPC_USER  BSTR_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
00224 void                      __RPC_USER  BSTR_UserFree(     unsigned long __RPC_FAR *, BSTR __RPC_FAR * );
00225
00226 /* end of Additional Prototypes */
00227
00228 #ifdef __cplusplus
00229 }
00230 #endif
00231
00232 #endif
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHtmlElement Member List

This is the complete list of members for CHtmlElement, including all inherited members.
_aTempBuffer | CHtmlElement | [protected]
_htmlIFilter | CHtmlElement | [protected]
_scanner | CHtmlElement | [protected]
_serialStream | CHtmlElement | [protected]
CHtmlElement(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CHtmlElement |
GetChunk(STAT_CHUNK *pStat)=0 | CHtmlElement | [pure virtual]
GetText(ULONG *pcwcOutput, WCHAR *awcBuffer)=0 | CHtmlElement | [pure virtual]
GetValue(PROPVARIANT **ppPropValue) | CHtmlElement | [virtual]
InitFilterRegion(ULONG &idChunkSource, ULONG &cwcStartSource, ULONG &cwcLenSource) | CHtmlElement | [virtual]
InitStatChunk(STAT_CHUNK *pStat)=0 | CHtmlElement | [pure virtual]
SkipRemainingTextAndGotoNextChunk(STAT_CHUNK *pStat) | CHtmlElement | [protected]
SwitchToNextHtmlElement(STAT_CHUNK *pStat) | CHtmlElement | [protected]
~CHtmlElement() | CHtmlElement | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/llistimpl.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

llistimpl.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //  This is a part of the MMC SDK.
00003 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the MMC SDK
00007 //  Reference and related electronic documentation provided with the
00008 //  library.  See these sources for detailed information regarding the
00009 //  MMC Library product.
00010 //
00011 //  LListImple.cpp: implementation of CLListImpl helper functions
00012 //
00013
00014
00015 #include "LListImpl.h"
00016
00017
00018 //---------------------------------------------------------------------------
00019 CPlex* PASCAL CPlex::Create(CPlex*& pHead, UINT nMax, UINT cbElement)
00020 {
00021   _ASSERT( nMax > 0 && cbElement > 0 );
00022   CPlex* p = (CPlex*) new BYTE[sizeof(CPlex) + nMax * cbElement];
00023       // may throw exception
00024   p->pNext = pHead;
00025   pHead = p;  // change head (adds in reverse order for simplicity)
00026   return p;
00027
00028 } //end Create()
00029
00030 //---------------------------------------------------------------------------
00031 // Free this one and links
00032 //
00033 void CPlex::FreeDataChain()
00034 {
00035   CPlex* p = this;
00036   while (p != NULL)
00037   {
00038     BYTE* bytes = (BYTE*) p;
00039     CPlex* pNext = p->pNext;
00040     delete[] bytes;
00041     p = pNext;
00042   }
00043 } //end FreeDataChain()
00044
00045 //---------------------------------------------------------------------------
00046 // IsValidAddress() returns TRUE if the passed parameter points
00047 // to at least nBytes of accessible memory. If bReadWrite is TRUE,
00048 // the memory must be writeable; if bReadWrite is FALSE, the memory
00049 // may be const.
00050 //
00051 BOOL IsValidAddress
00052 (
00053   const void*  lp,
00054   UINT         nBytes,
00055   BOOL         bReadWrite /* TRUE */
00056 )
00057 {
00058   // Simple version using Win-32 APIs for pointer validation.
00059   return (lp != NULL && !IsBadReadPtr(lp, nBytes) &&
00060          (!bReadWrite || !IsBadWritePtr((LPVOID)lp, nBytes)));
00061
00062 } //end IsValidAddress()
00063
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/ExtObj.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

ExtObj.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ExtObj.h
00007 //
00008 //  Implementation File:
00009 //      ExtObj.cpp
00010 //
00011 //  Description:
00012 //      Definition of the CExtObject class, which implements the
00013 //      extension interfaces required by a Microsoft Windows NT Cluster
00014 //      Administrator Extension DLL.
00015 //
00016 //  Author:
00017 //      <name> (<e-mail name>) Mmmm DD, 2003
00018 //
00019 //  Revision History:
00020 //
00021 //  Notes:
00022 //
00023 /////////////////////////////////////////////////////////////////////////////
00024
00025 #pragma once
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // Include Files
00029 /////////////////////////////////////////////////////////////////////////////
00030
00031 #pragma warning( push )
00032 #include <CluAdmEx.h>   // for CLUADMEX_OBJECT_TYPE and interfaces
00033 #pragma warning( pop )
00034
00035 #include "ExtObjID.h"   // for CLSID_CoClipBookServerEx
00036 #include "ExtObjData.h"
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // External Class Declarations
00040 /////////////////////////////////////////////////////////////////////////////
00041
00042 class CBasePropertyPage;
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045 // CPageList
00046 /////////////////////////////////////////////////////////////////////////////
00047
00048 typedef CList< CBasePropertyPage *, CBasePropertyPage * > CPageList;
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // class CExtObject
00052 /////////////////////////////////////////////////////////////////////////////
00053
00054 class CExtObject
00055     : public IWEExtendPropertySheet
00056     , public IWEExtendWizard
00057     , public ISupportErrorInfo
00058     , public CComObjectRoot
00059     , public CComCoClass< CExtObject, &CLSID_CoClipBookServerEx >
00060 {
00061 public:
00062     CExtObject( void );
00063 BEGIN_COM_MAP( CExtObject )
00064     COM_INTERFACE_ENTRY( IWEExtendPropertySheet )
00065     COM_INTERFACE_ENTRY( IWEExtendWizard )
00066     COM_INTERFACE_ENTRY( ISupportErrorInfo )
00067 END_COM_MAP()
00068
00069 //DECLARE_NOT_AGGREGATABLE( CExtObject )
00070
00071 //
00072 // Uncomment the line above if you don't want your object to support aggregation.
00073 // The default is to support it.
00074 //
00075
00076 #pragma warning( push, 3 )
00077 #pragma warning( disable : 4996 ) // warning C4996: 'ATL::CComModule::UpdateRegistryClass' was declared deprecated
00078 DECLARE_REGISTRY(
00079           CExtObject
00080         , _T("CLUADMEX.ClipBookServerEx")
00081         , _T("CLUADMEX.ClipBookServerEx")
00082         , IDS_CLUADMEX_COMOBJ_DESC
00083         , THREADFLAGS_APARTMENT
00084         );
00085 #pragma warning( pop )
00086
00087     //
00088     // ISupportsErrorInfo
00089     //
00090
00091     STDMETHOD( InterfaceSupportsErrorInfo )( REFIID riid );
00092
00093     //
00094     // IWEExtendPropertySheet
00095     //
00096
00097 public:
00098     STDMETHOD( CreatePropertySheetPages )(
00099                       IUnknown *                 piDataIn
00100                     , IWCPropertySheetCallback * piCallbackIn
00101                     );
00102
00103     //
00104     // IWEExtendWizard
00105     //
00106
00107 public:
00108     STDMETHOD( CreateWizardPages )(
00109                       IUnknown *            piDataIn
00110                     , IWCWizardCallback *   piCallbackIn
00111                     );
00112
00113     CLUADMEX_OBJECT_TYPE Cot() { return (m_podObjData != NULL) ? m_podObjData->Cot() : CLUADMEX_OT_NONE; }
00114
00115     //
00116     // IGetClusterUIInfo data
00117     //
00118
00119     LCID                        Lcid( void ) const                  { return m_lcid; }
00120     HFONT                       Hfont( void ) const                 { return m_hfont; }
00121     HICON                       Hicon( void ) const                 { return m_hicon; }
00122     IWCWizardCallback *         PiWizardCallback( void ) const      { return m_piWizardCallback; }
00123     BOOL                        BWizard( void ) const               { return m_bWizard; }
00124
00125     //
00126     // IGetClusterDataInfo data
00127     //
00128
00129     HCLUSTER                    Hcluster( void ) const              { return m_hCluster; }
00130     LONG                        Cobj( void ) const                  { return m_cobj; }
00131     CObjData *                  PodObjData( void )                  { return m_podObjData; }
00132     HRESULT                     HrGetObjectInfo( void );
00133
00134 //
00135 // Attributes
00136 //
00137
00138 protected:
00139
00140     IUnknown *                  m_piData;
00141     IWCWizardCallback *         m_piWizardCallback;
00142     BOOL                        m_bWizard;
00143
00144     //
00145     // IGetClusterUIInfo data
00146     //
00147
00148     LCID                        m_lcid;
00149     HFONT                       m_hfont;
00150     HICON                       m_hicon;
00151
00152     //
00153     // IGetClusterDataInfo data
00154     //
00155
00156     HCLUSTER                    m_hCluster;
00157     LONG                        m_cobj;
00158
00159     CObjData *                  m_podObjData;
00160
00161 //
00162 // Implementation
00163 //
00164
00165     virtual ~CExtObject(void);
00166
00167     HRESULT                     HrGetUIInfo( IUnknown * piDataIn );
00168     HRESULT                     HrSaveData( IUnknown * piDataIn );
00169
00170     CPageList                   m_lpg;
00171
00172 }; //*** class CExtObject
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagAppletTokenRequest Member List

This is the complete list of members for tagAppletTokenRequest, including all inherited members.
eCommand | tagAppletTokenRequest
hrGiveResponse | tagAppletTokenRequest
nTokenID | tagAppletTokenRequest
uidGiveTo | tagAppletTokenRequest
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/filters/AuthFilt/db.c Source File

  • Web
  • iis
  • filters
  • AuthFilt

db.c

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 1996-2002  Microsoft Corporation
00003
00004 Module Name:
00005
00006     db.c
00007
00008 Abstract:
00009
00010     This module implements the database routines for the authentication filter.
00011 */
00012
00013 #include <windows.h>
00014 #include <httpfilt.h>
00015 #include "authfilt.h"
00016
00017 /*
00018   This is the name of the file that contains the username/password pairs and
00019   the appropriate NT account the username/password should be mapped to.
00020
00021   The format of the file is:
00022
00023   User1:Password1, NTUser1:NTPassword1
00024   User2:Password2, NTUser2:NTPassword2
00025   User3:Password3, NTUser1:NTPassword1
00026 */
00027
00028 #define USER_LIST_FILE "c:\\inetsrv\\userdb.txt"
00029
00030 /* Globals */
00031
00032 CHAR *pszUserFile = NULL;
00033
00034 /*
00035   Description:
00036
00037     Looks up the username and confirms the user is allowed access to the server
00038
00039   Arguments:
00040
00041     pszUserName - The username to validate, will contain the mapped username on return.  Must be at least SF_MAX_USERNAME
00042     pszPassword - The password for this user.  Will contain the mapped password on return.  Must be at least SF_MAX_PASSWORD
00043     pfValid     - Set to TRUE if the user should be logged on.
00044
00045   Return Value:
00046
00047     TRUE on success, FALSE on failure
00048 */
00049
00050 BOOL ValidateUser(IN OUT CHAR *pszUserName, IN OUT CHAR *pszPassword, OUT BOOL *pfValid)
00051 {
00052   BOOL fFound;
00053   CHAR achPassword[SF_MAX_PASSWORD];
00054   CHAR achNTUser[SF_MAX_USERNAME];
00055   CHAR achNTUserPassword[SF_MAX_PASSWORD];
00056
00057   /*  Assume we're going to fail validation */
00058
00059   *pfValid = FALSE;
00060
00061   /*  Lookup the user in the cache, if that fails, get the user from the */
00062   /*  database and add the retrieved user to the cache */
00063
00064   if (!LookupUserInCache(pszUserName, &fFound, achPassword, achNTUser, achNTUserPassword))
00065     return FALSE;
00066
00067   if (!fFound)
00068   {
00069     if (!LookupUserInDb(pszUserName, &fFound, achPassword, achNTUser, achNTUserPassword))
00070       return FALSE;
00071
00072     if (fFound)
00073       AddUserToCache(pszUserName, achPassword, achNTUser, achNTUserPassword);
00074   }
00075
00076   if (!fFound)
00077   {
00078     DbgWrite((DEST, "[ValidateUser] Failed to find user %s\n", pszUserName));
00079
00080     return TRUE;
00081   }
00082
00083   /* Do the passwords match? */
00084
00085   if (!strcmp(pszPassword, achPassword))
00086   {
00087     /* We have a match, map to the NT user and password */
00088
00089     strcpy(pszUserName, achNTUser);
00090     strcpy(pszPassword, achNTUserPassword);
00091
00092     *pfValid = TRUE;
00093   }
00094
00095   return TRUE;
00096 }
00097
00098 /*
00099   Description:
00100
00101     Retrieves the userlist from the file.  If the users were coming from a
00102     database, this routine would connect to the database.
00103
00104   Return Value:
00105
00106     TRUE on success, FALSE on failure
00107 */
00108
00109 BOOL InitializeUserDatabase(VOID)
00110 {
00111   HANDLE hFile;
00112   DWORD  cbFile;
00113   DWORD  cbRead;
00114
00115   /* Open and read the file.  The System account must have access to the file. */
00116
00117   hFile = CreateFile(USER_LIST_FILE, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
00118
00119   if (hFile == INVALID_HANDLE_VALUE)
00120   {
00121     DbgWrite((DEST, "[InitializeUserDatabase] Error %d openning %s\n", GetLastError(), USER_LIST_FILE));
00122
00123     return FALSE;
00124   }
00125
00126   cbFile = GetFileSize(hFile, NULL);
00127
00128   if (cbFile == (DWORD) -1)
00129   {
00130     CloseHandle(hFile);
00131
00132     return FALSE;
00133   }
00134
00135   pszUserFile = LocalAlloc(LPTR, cbFile + 1);
00136
00137   if (!pszUserFile)
00138   {
00139     SetLastError(ERROR_NOT_ENOUGH_MEMORY);
00140
00141     CloseHandle(hFile);
00142
00143     return FALSE;
00144   }
00145
00146   if (!ReadFile(hFile, pszUserFile, cbFile, &cbRead, NULL))
00147   {
00148     CloseHandle(hFile);
00149     LocalFree(pszUserFile);
00150
00151     return FALSE;
00152   }
00153
00154   CloseHandle( hFile );
00155
00156   /* Null terminate the file data */
00157
00158   pszUserFile[cbRead] = '\0';
00159
00160   return TRUE;
00161 }
00162
00163 /*
00164   Description:
00165
00166     Looks up the username in the database and returns the other attributes
00167     associated with this user
00168
00169     The file data is not sorted to simulate the cost of an external database
00170     lookup.
00171
00172   Arguments:
00173
00174     pszUserName       - The username to find in the database (case insensitive)
00175     pfFound           - Set to TRUE if the specified user name was found in the database
00176     pszPassword       - The external password for the found user.  Buffer must be at least SF_MAX_PASSWORD bytes.
00177     pszNTUser         - The NT username associated with this user, Buffer must be at least SF_MAX_USERNAME bytes
00178     pszNTUserPassword - The password for NTUser. Buffer must be at least SF_MAX_PASSWORD
00179
00180   Return Value:
00181
00182     TRUE on success, FALSE on failure
00183 */
00184
00185 BOOL LookupUserInDb(IN CHAR *pszUser, OUT BOOL *pfFound, OUT CHAR *pszPassword, OUT CHAR *pszNTUser, OUT CHAR *pszNTUserPassword)
00186 {
00187   CHAR *pch = pszUserFile;
00188   CHAR *pchEnd;
00189   DWORD cchUser = strlen(pszUser);
00190   DWORD cch;
00191
00192   *pfFound = FALSE;
00193
00194   /*
00195     Find the external username.  We're expecting one user per line in
00196     the form:
00197
00198         username:password, NTUser:NTUserPassword
00199   */
00200
00201   while (pch && *pch)
00202   {
00203     while (ISWHITE(*pch))
00204       pch++;
00205
00206     if (toupper(*pch) == toupper(*pszUser) && !strnicmp(pszUser, pch, cchUser) && pch[cchUser] == ':')
00207     {
00208       pch += cchUser + 1;
00209       goto Found;
00210     }
00211
00212     pch = strchr(pch + 1, '\n');
00213   }
00214
00215   /* Not found */
00216
00217   return TRUE;
00218
00219 Found:
00220
00221   /* Break out the external username */
00222
00223   if (!(pchEnd = strchr(pch, ',')))
00224   {
00225     SetLastError(ERROR_INVALID_PASSWORDNAME);
00226     return FALSE;
00227   }
00228
00229   cch = pchEnd - pch;
00230
00231   if (cch + 1 > SF_MAX_PASSWORD)
00232   {
00233     SetLastError(ERROR_INVALID_PASSWORDNAME);
00234     return FALSE;
00235   }
00236
00237   memcpy(pszPassword, pch, cch);
00238   pszPassword[cch] = '\0';
00239
00240   pch = pchEnd + 1;
00241
00242   /* Get the NT username from the file */
00243
00244   while (ISWHITE(*pch))
00245       pch++;
00246
00247   if (!(pchEnd = strchr(pch, ':')))
00248   {
00249     SetLastError(ERROR_BAD_USERNAME);
00250     return FALSE;
00251   }
00252
00253   cch = pchEnd - pch;
00254
00255   if (cch + 1 > SF_MAX_USERNAME)
00256   {
00257     SetLastError(ERROR_BAD_USERNAME);
00258     return FALSE;
00259   }
00260
00261   memcpy(pszNTUser, pch, cch);
00262   pszNTUser[cch] = '\0';
00263
00264   pch = pchEnd + 1;
00265
00266   /* Get the NT password from the file, look for a '\r' or '\n' */
00267
00268   pchEnd = pch;
00269
00270   while (*pchEnd && *pchEnd != '\r' && *pchEnd != '\n')
00271     pchEnd++;
00272
00273   cch = pchEnd - pch;
00274
00275   if (cch + 1 > SF_MAX_PASSWORD)
00276   {
00277     SetLastError(ERROR_INVALID_PASSWORDNAME);
00278     return FALSE;
00279   }
00280
00281   memcpy(pszNTUserPassword, pch, cch);
00282   pszNTUserPassword[cch] = '\0';
00283
00284   *pfFound = TRUE;
00285
00286   return TRUE;
00287 }
00288
00289 /*
00290   Description:
00291
00292     Shutsdown the user database.
00293 */
00294
00295 VOID TerminateUserDatabase(VOID)
00296 {
00297   if (pszUserFile)
00298     LocalFree(pszUserFile);
00299 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/cData.h Source File

  • Web
  • NetMeeting
  • NMChat

cData.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       CDATA.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 //****************************************************************************
00017 //
00018 // CLASS CDataNotify
00019 //
00020 //****************************************************************************
00021
00022 class CDataNotify : public RefCount, public CNotify, public INmChannelDataNotify
00023 {
00024 public:
00025   CDataNotify();
00026   ~CDataNotify();
00027
00028   // INmChannelDataNotify
00029   HRESULT STDMETHODCALLTYPE NmUI(CONFN uNotify);
00030   HRESULT STDMETHODCALLTYPE MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember * pMember);
00031   HRESULT STDMETHODCALLTYPE DataSent(INmMember *pMember, ULONG uSize, LPBYTE pb);
00032   HRESULT STDMETHODCALLTYPE DataReceived(INmMember *pMember, ULONG uSize, LPBYTE pb, ULONG dwFlags);
00033
00034   // ICNotify methods
00035   HRESULT STDMETHODCALLTYPE Connect (IUnknown *pUnk);
00036   HRESULT STDMETHODCALLTYPE Disconnect(void);
00037
00038   // IUnknown methods
00039   ULONG STDMETHODCALLTYPE AddRef(void);
00040   ULONG STDMETHODCALLTYPE Release(void);
00041   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
00042 };
00043
00044
00045 // Global Variables
00046 extern INmChannelData * g_pChannelData;
00047 extern CDataNotify    * g_pNotifyData;
00048
00049 // Global Routines
00050 HRESULT HookData(INmChannelData * pChannel);
00051 VOID DoCreateDataChannel(INmConference *pConference);
00052 VOID FreeDataChannel(void);
00053 VOID CheckDataChannel(void);
00054
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/sdkdiff/tpaint.cpp Source File

  • Begin
  • sdkdiff

tpaint.cpp

Go to the documentation of this file.
00001 /*
00002  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003  * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005  * PARTICULAR PURPOSE.
00006  *
00007  * Copyright (c) Microsoft Corporation.  All Rights Reserved.
00008  */
00009
00010
00011 /*
00012  * standard table class.
00013  *
00014  * paint functions.
00015  *
00016  * see table.h for interface description
00017  */
00018
00019 #include "precomp.h"
00020
00021 #include "table.h"
00022 #include "tpriv.h"
00023
00024 #ifdef WIN32
00025
00026 int
00027 GetTextExtent(HDC hdc, LPSTR text, INT len)
00028 {
00029     SIZE sz;
00030
00031     GetTextExtentPoint(hdc, text, len, &sz);
00032     return(sz.cx);
00033 }
00034 #endif
00035
00036 void gtab_updatecontig(HWND hwnd, lpTable ptab, int line, int cell1, int count);
00037
00038 /* change all cr/lf chars in input text to nul chars */
00039 void gtab_delcr(LPSTR ptext)
00040 {
00041   LPSTR chp;
00042
00043   if (ptext == NULL) {
00044     return;
00045   }
00046   for(chp = ptext; (chp = My_mbschr(chp, '\r')) != NULL; ) {
00047     *chp = '\0';
00048   }
00049   for(chp = ptext; (chp = My_mbschr(chp, '\n')) != NULL; ) {
00050     *chp = '\0';
00051   }
00052 }
00053 void gtab_delcrW(LPWSTR pwzText)
00054 {
00055   LPWSTR pwch;
00056
00057   if (pwzText)
00058     for(pwch = pwzText; *pwch; pwch++)
00059       if (*pwch == '\r' || *pwch == '\n')
00060         *pwch = 0;
00061 }
00062
00063 /* ensure that all visible cells in the given line have valid
00064  * text and property contents. loop through the cells, picking out
00065  * contiguous blocks of visible, invalid cells and call
00066  * gtab_updatecontig to update these from the owner window.
00067  */
00068 void
00069 gtab_updateline(HWND hwnd, lpTable ptab, int line)
00070 {
00071   lpCellPos ppos;
00072   int cell1, cellcount;
00073   lpLineData pline;
00074   lpCellData cd;
00075   int i;
00076
00077   if (line < 0 || line >= ptab->nlines)
00078     return;
00079
00080   pline = &ptab->pdata[line];
00081   cell1 = 0;
00082   cellcount = 0;
00083   for (i = 0; i < ptab->hdr.ncols; i++) {
00084     ppos = &ptab->pcellpos[i];
00085     cd = &pline->pdata[i];
00086     if (ppos->clipstart < ppos->clipend) {
00087       if ((cd->flags & CELL_VALID) == 0) {
00088         /* add a cell to the list to be updated*/
00089         if (cellcount++ == 0) {
00090           cell1 = i;
00091         }
00092       } else {
00093         /* this cell already valid - so end of
00094          * a contig block. if the contig
00095          * block just ended contained cells to update,
00096          * do it now
00097          */
00098         if (cellcount > 0) {
00099           gtab_updatecontig(hwnd, ptab,
00100             line, cell1, cellcount);
00101         }
00102         cellcount = 0;
00103       }
00104     }
00105     /* cell not visible - end of a contig block. If it was a
00106      * non-empty contig block, then update it now.
00107      */
00108     if (cellcount > 0)  {
00109       gtab_updatecontig(hwnd, ptab, line, cell1, cellcount);
00110       cellcount = 0;
00111     }
00112   }
00113   if (cellcount > 0) {
00114     gtab_updatecontig(hwnd, ptab, line, cell1, cellcount);
00115     cellcount = 0;
00116   }
00117 }
00118
00119 /*
00120  * update a contiguous block of invalid cells by calling the owner window
00121  */
00122 void
00123 gtab_updatecontig(HWND hwnd, lpTable ptab, int line, int cell1, int count)
00124 {
00125   lpLineData pline;
00126   lpCellData cd;
00127   CellDataList list;
00128   lpProps colprops;
00129   int i;
00130   COLORREF rgb;
00131
00132   pline = &ptab->pdata[line];
00133   cd = &pline->pdata[cell1];
00134
00135   list.id = ptab->hdr.id;
00136   list.row = gtab_linetorow(hwnd, ptab, line);
00137   list.startcell = cell1;
00138   list.ncells = count;
00139   list.plist = cd;
00140
00141   /* clear out prop flags */
00142   rgb = GetSysColor(COLOR_WINDOW);
00143   for (i = 0; i < count; i++) {
00144     cd[i].props.valid = P_BCOLOUR;
00145     cd[i].props.backcolour = rgb;
00146     if (cd[i].nchars > 0) {
00147       cd[i].ptext[0] = '\0';
00148       if (cd[i].pwzText) {
00149         cd[i].pwzText[0] = '\0';
00150       }
00151     }
00152   }
00153
00154   if (list.row < ptab->hdr.nrows) {
00155     gtab_sendtq(hwnd, TQ_GETDATA, (LPARAM) &list);
00156   }
00157
00158   /* for each cell, mark valid and set properties */
00159   for (i = 0; i < count; i++) {
00160     cd[i].flags |= CELL_VALID;
00161     gtab_delcr(cd[i].ptext);
00162     gtab_delcrW(cd[i].pwzText);
00163     /* fetch properties from hdr and colhdr */
00164     colprops = &ptab->pcolhdr[i + cell1].props;
00165     if (!(cd[i].props.valid & P_FCOLOUR)) {
00166       if (colprops->valid & P_FCOLOUR) {
00167         cd[i].props.valid |= P_FCOLOUR;
00168         cd[i].props.forecolour = colprops->forecolour;
00169       } else if (ptab->hdr.props.valid & P_FCOLOUR) {
00170         cd[i].props.valid |= P_FCOLOUR;
00171         cd[i].props.forecolour =
00172           ptab->hdr.props.forecolour;
00173       }
00174     }
00175
00176     if (!(cd[i].props.valid & P_FCOLOURWS)) {
00177       if (colprops->valid & P_FCOLOURWS) {
00178         cd[i].props.valid |= P_FCOLOURWS;
00179         cd[i].props.forecolourws = colprops->forecolourws;
00180       } else if (ptab->hdr.props.valid & P_FCOLOURWS) {
00181         cd[i].props.valid |= P_FCOLOURWS;
00182         cd[i].props.forecolourws =
00183           ptab->hdr.props.forecolourws;
00184       }
00185     }
00186
00187     if (!(cd[i].props.valid & P_BCOLOUR)) {
00188       if (colprops->valid & P_BCOLOUR) {
00189         cd[i].props.valid |= P_BCOLOUR;
00190         cd[i].props.backcolour = colprops->backcolour;
00191       } else if (ptab->hdr.props.valid & P_BCOLOUR) {
00192         cd[i].props.valid |= P_BCOLOUR;
00193         cd[i].props.backcolour =
00194           ptab->hdr.props.backcolour;
00195       }
00196     }
00197
00198     if (!(cd[i].props.valid & P_FONT)) {
00199       if (colprops->valid & P_FONT) {
00200         cd[i].props.valid |= P_FONT;
00201         cd[i].props.hFont = colprops->hFont;
00202       } else if (ptab->hdr.props.valid & P_FONT) {
00203         cd[i].props.valid |= P_FONT;
00204         cd[i].props.hFont = ptab->hdr.props.hFont;
00205       }
00206     }
00207
00208     if (!(cd[i].props.valid & P_ALIGN)) {
00209       if (colprops->valid & P_ALIGN) {
00210         cd[i].props.valid |= P_ALIGN;
00211         cd[i].props.alignment = colprops->alignment;
00212       } else if (ptab->hdr.props.valid & P_ALIGN) {
00213         cd[i].props.valid |= P_ALIGN;
00214         cd[i].props.alignment =
00215           ptab->hdr.props.alignment;
00216       }
00217     }
00218
00219     if (!(cd[i].props.valid & P_BOX)) {
00220       if (colprops->valid & P_BOX) {
00221         cd[i].props.valid |= P_BOX;
00222         cd[i].props.box = colprops->box;
00223       } else if (ptab->hdr.props.valid & P_BOX) {
00224         cd[i].props.valid |= P_BOX;
00225         cd[i].props.box = ptab->hdr.props.box;
00226       }
00227     }
00228     /* you can't set width/height per cell - this
00229      * is ignored at cell level.
00230      */
00231   }
00232
00233 }
00234
00235 void
00236 gtab_boxcell(HWND hwnd, HDC hdc, LPRECT rcp, LPRECT pclip, UINT boxmode)
00237 {
00238   if (boxmode & P_BOXTOP) {
00239     MoveToEx(hdc, max(rcp->left, pclip->left),
00240       max(rcp->top, pclip->top), NULL);
00241     LineTo(hdc, min(rcp->right, pclip->right),
00242       max(rcp->top, pclip->top));
00243   }
00244   if (boxmode & P_BOXBOTTOM) {
00245     MoveToEx(hdc, max(rcp->left, pclip->left),
00246       min(rcp->bottom, pclip->bottom), NULL);
00247     LineTo(hdc, min(rcp->right, pclip->right),
00248       min(rcp->bottom, pclip->bottom));
00249   }
00250   if (boxmode & P_BOXLEFT) {
00251     MoveToEx(hdc, max(rcp->left, pclip->left),
00252       max(rcp->top, pclip->top), NULL);
00253     MoveToEx(hdc, max(rcp->left, pclip->left),
00254       min(rcp->bottom, pclip->bottom), NULL);
00255   }
00256   if (boxmode & P_BOXRIGHT) {
00257     MoveToEx(hdc, min(rcp->right, pclip->right),
00258       max(rcp->top, pclip->top), NULL);
00259     LineTo(hdc, min(rcp->right, pclip->right),
00260       min(rcp->bottom, pclip->bottom));
00261   }
00262 }
00263
00264 void
00265 gtab_paintcell(HWND hwnd, HDC hdc, lpTable ptab, int line, int cell, BOOL show_whitespace, BOOL fPrinting)
00266 {
00267   lpLineData pline;
00268   lpCellData cd;
00269   lpCellPos ppos;
00270   RECT rc, rcbox;
00271   int cx, x, y;
00272   UINT align;
00273   LPSTR chp, tabp=NULL;
00274   LPWSTR pwch, pwchBreak=NULL;
00275   DWORD fcol, fcolOld=0, fcolws=0;
00276   DWORD bkcol, bkcolOld=0;
00277   HFONT hfont, hfontOld=NULL;
00278   HBRUSH hbr;
00279   char szCharSet[] = "\t ";
00280   WCHAR wzCharSet[] = L"\t ";
00281   char szSpaceReplace[] = { (unsigned char)183,(unsigned char) 0 };
00282   char szTabReplace[] = { (unsigned char)187, (unsigned char) 0 };
00283   int cxSpaceReplace;
00284   int cxTabReplace;
00285   SIZE size ={0,0};
00286   TEXTMETRIC tm;
00287   int yOfs;
00288   DWORD etoFlags = ETO_CLIPPED;
00289
00290         fcol = 0; bkcol = 0;
00291         hfont = 0;
00292   /* init pointers to cell text and properties */
00293   pline = &ptab->pdata[line];
00294   cd = &pline->pdata[cell];
00295   ppos = &ptab->pcellpos[cell];
00296
00297   /* draw gutter */
00298   rc.top = pline->linepos.clipstart;
00299   rc.bottom = pline->linepos.clipend;
00300   rc.left = (cell > 0) ? ptab->pcellpos[cell - 1].clipend : 0;
00301   rc.right = ppos->clipstart;
00302   if (cell > ptab->hdr.fixedcols && ptab->hdr.fixedcols < ptab->hdr.ncols) {
00303     rc.left = max(rc.left, ptab->pcellpos[ptab->hdr.fixedcols].clipstart);
00304   }
00305   if (ptab->hdr.fixedcols > 0 && cell == ptab->hdr.fixedcols) {
00306     rc.right--;
00307   }
00308   if (!fPrinting && rc.right > rc.left) {
00309     FillRect(hdc, &rc, (HBRUSH)(COLOR_WINDOW + 1));
00310   }
00311
00312   /* clip all output to this rectangle */
00313   rc.top = pline->linepos.clipstart;
00314   rc.bottom = pline->linepos.clipend;
00315   rc.left = ppos->clipstart;
00316   rc.right = ppos->clipend;
00317
00318   /* check cell properties and colours */
00319   if (cd->props.valid & P_ALIGN) {
00320     align = cd->props.alignment;
00321   } else {
00322     align = P_LEFT;
00323   }
00324
00325   if (!fPrinting && cd->props.valid & P_FONT) {
00326     hfontOld = (HFONT)SelectObject(hdc, cd->props.hFont);
00327   }
00328
00329   // get y offset to center text vertically within cell
00330   GetTextMetrics(hdc, &tm);
00331   yOfs = (rc.bottom - rc.top - tm.tmHeight) / 2;
00332
00333   /* set replacement chars and char widths */
00334   cxSpaceReplace = GetTextExtent(hdc, szSpaceReplace, 1);
00335   cxTabReplace = cxSpaceReplace * ptab->tabchars;
00336
00337   /* set colours if not default */
00338   if (!fPrinting) {
00339     if (cd->props.valid & P_FCOLOUR) {
00340       fcol = cd->props.forecolour;
00341       fcolOld = SetTextColor(hdc, fcol);
00342     }
00343     if (cd->props.valid & P_FCOLOURWS) {
00344       fcolws = cd->props.forecolourws;
00345     }
00346     else {
00347       fcolws = fcol;
00348     }
00349     if (cd->props.valid & P_BCOLOUR) {
00350       /* there is a non-default background colour.
00351       * create a brush and fill the entire cell with it
00352        */
00353       hbr = CreateSolidBrush(cd->props.backcolour);
00354       if (hbr)
00355       {
00356         FillRect(hdc, &rc, hbr);
00357         DeleteObject(hbr);
00358       }
00359
00360       /* also set colour as background colour for the text */
00361       bkcolOld = SetBkColor(hdc, cd->props.backcolour);
00362     }
00363   }
00364
00365   /* calc offset of text within cell for right-align or centering */
00366   if (align == P_LEFT) {
00367     cx = ptab->avewidth/2;
00368   } else {
00369     cx = 0;
00370
00371     if (cd->pwzText) {
00372       GetTextExtentPoint32W(hdc, cd->pwzText, (int)wcslen(cd->pwzText), &size);
00373     } else if (cd->ptext) {
00374       GetTextExtentPoint32A(hdc, cd->ptext, (int)lstrlen(cd->ptext), &size);
00375     }
00376     cx = size.cx;
00377
00378     if (align == P_CENTRE) {
00379       cx = (ppos->size - cx) / 2;
00380     } else {
00381       cx = ppos->size - cx - (ptab->avewidth/2);
00382     }
00383   }
00384   cx += ppos->start;
00385
00386   /* expand tabs on output and show whitespace on output */
00387   x = 0;
00388   y = pline->linepos.start + yOfs;
00389
00390   /* set search string for strpbrk fn;
00391      don't search for space chars unless we're showing whitespace */
00392   if (!show_whitespace)
00393   {
00394     szCharSet[1] = '\0';
00395     wzCharSet[1] = '\0';
00396   }
00397
00398   // determine the string to display (ansi/unicode).  if we have a string
00399   // and it's not empty, then loop and display it.
00400   chp = cd->ptext;
00401   pwch = cd->pwzText;
00402   if (pwch ? *pwch : (chp && *chp))
00403   {
00404     while (TRUE)
00405     {
00406       if (pwch)
00407       {
00408         pwchBreak = wcspbrk(pwch, wzCharSet);
00409         if (!pwchBreak)
00410           pwchBreak = pwch + wcslen(pwch);
00411       }
00412       else
00413       {
00414         tabp = (LPSTR)My_mbspbrk((PUCHAR)chp, (PUCHAR)szCharSet);
00415         if (!tabp)
00416           tabp = chp + lstrlen(chp);
00417       }
00418
00419       /* perform output up to tab/space char */
00420       if (pwch)
00421         ExtTextOutW(hdc, x+cx, y, etoFlags, &rc, pwch, (UINT)(pwchBreak-pwch), NULL);
00422       else
00423         ExtTextOutA(hdc, x+cx, y, etoFlags, &rc, chp, (UINT)(tabp-chp), NULL);
00424
00425       /* advance past the tab */
00426       if (pwch)
00427       {
00428         GetTextExtentPoint32W(hdc, pwch, (UINT)(pwchBreak - pwch), &size);
00429         pwch = pwchBreak;
00430       }
00431       else
00432       {
00433         GetTextExtentPoint32A(hdc, chp, (UINT)(tabp - chp), &size);
00434         chp = tabp;
00435       }
00436       x += size.cx;
00437
00438       // bail if we hit null terminator
00439       if (pwch ? !*pwch : !*chp)
00440         break;
00441
00442       /* handle tab chars */
00443       while (pwch ? (*pwch == '\t') : (*chp == '\t'))
00444       {
00445         /* print replacement char */
00446         if (show_whitespace)
00447         {
00448           if (!fPrinting)
00449             SetTextColor(hdc, fcolws);
00450
00451           ExtTextOut(hdc, x + cx, y, etoFlags, &rc, szTabReplace, 1, NULL);
00452
00453           if (!fPrinting)
00454             SetTextColor(hdc, fcol);
00455         }
00456
00457         /* advance past the tab */
00458         if (cxTabReplace > 0)
00459           x += cxTabReplace - (x % cxTabReplace);
00460         if (pwch)
00461           pwch = ++pwchBreak;
00462         else
00463           chp = ++tabp;
00464       }
00465
00466       /* handle space chars */
00467       if (show_whitespace)
00468       {
00469         while (pwch ? (*pwch == ' ') : (*chp == ' '))
00470         {
00471           /* replace space char with visible char */
00472           if (!fPrinting)
00473             SetTextColor(hdc, fcolws);
00474
00475           ExtTextOut(hdc, x + cx, y, etoFlags, &rc, szSpaceReplace, 1, NULL);
00476
00477           if (!fPrinting)
00478             SetTextColor(hdc, fcol);
00479
00480           x += cxSpaceReplace;
00481           if (pwch)
00482             pwch = ++pwchBreak;
00483           else
00484             chp = ++tabp;
00485         }
00486       }
00487     }
00488   }
00489
00490   /* reset colours to original if not default */
00491   if (!fPrinting) {
00492     if (cd->props.valid & P_FCOLOUR) {
00493       SetTextColor(hdc, fcolOld);
00494     }
00495     if (cd->props.valid & P_BCOLOUR) {
00496       SetBkColor(hdc, bkcolOld);
00497     }
00498     if (cd->props.valid & P_FONT) {
00499       SelectObject(hdc, hfontOld);
00500     }
00501   }
00502
00503   /* now box cell if marked */
00504   if (!fPrinting) {
00505     if ((cd->props.valid & P_BOX)) {
00506       if (cd->props.box != 0) {
00507         rcbox.top = y;
00508         rcbox.bottom = rcbox.top + pline->linepos.size;
00509         rcbox.left = ppos->start;
00510         rcbox.right = ppos->start + ppos->size;
00511         gtab_boxcell(hwnd, hdc, &rcbox, &rc, cd->props.box);
00512       }
00513     }
00514   }
00515 }
00516
00517 /* fetch and paint the specified line */
00518 void
00519 gtab_paintline(HWND hwnd, HDC hdc, lpTable ptab, int line, BOOL show_whitespace, BOOL fPrinting)
00520 {
00521   lpCellPos ppos = NULL;
00522   int i;
00523   RECT rc;
00524
00525   if (line < 0 || line >= ptab->nlines)
00526     return;
00527
00528   if (!fPrinting)
00529     GetClientRect(hwnd, &rc);
00530
00531   gtab_updateline(hwnd, ptab, line);
00532
00533   for (i = 0; i < ptab->hdr.ncols; i++) {
00534     ppos = &ptab->pcellpos[i];
00535     /* show whitespace iff the flag is set
00536        and we're painting the main text column */
00537     if (ppos->clipstart < ppos->clipend) {
00538       gtab_paintcell(hwnd, hdc, ptab, line, i,
00539                (show_whitespace && (i == 2)), fPrinting);
00540     }
00541   }
00542
00543   if (!fPrinting && ppos) {
00544     rc.top = ptab->pdata[line].linepos.clipstart;
00545     rc.bottom = ptab->pdata[line].linepos.clipend;
00546     rc.left = ppos->clipend;
00547     FillRect(hdc, &rc, (HBRUSH)(COLOR_WINDOW + 1));
00548   }
00549 }
00550
00551 void
00552 gtab_paint(HWND hwnd)
00553 {
00554     PAINTSTRUCT ps;
00555     int y, y2, i;
00556     HDC hDC = BeginPaint(hwnd, &ps);
00557     lpTable ptab = (lpTable) GetWindowLongPtr(hwnd, WL_TABLE);
00558
00559     if (!ptab) {
00560         FillRect(hDC, &ps.rcPaint, (HBRUSH)(COLOR_WINDOW + 1));
00561     } else {
00562         /* separator lines between fixed rows/columns
00563          * (ie headers) and the rest - if enabled
00564          */
00565         /* paint here first for good impression,
00566          * and again after to clean up!!
00567          */
00568         if (ptab->hdr.vseparator) {
00569             gtab_vsep(hwnd, ptab, hDC);
00570         }
00571         if (ptab->hdr.hseparator) {
00572             gtab_hsep(hwnd, ptab, hDC);
00573         }
00574
00575         /* paint only the rows that need painting */
00576         for (i = 0; i < ptab->nlines; i++) {
00577             y = ptab->pdata[i].linepos.start;
00578             y2 = y + ptab->pdata[i].linepos.size;
00579             if ( (y <= ps.rcPaint.bottom) &&
00580                  (y2 >= ps.rcPaint.top)) {
00581                 gtab_paintline(hwnd, hDC, ptab, i, ptab->show_whitespace, FALSE);
00582             }
00583         }
00584         if (ptab->hdr.vseparator) {
00585             gtab_vsep(hwnd, ptab, hDC);
00586         }
00587         if (ptab->hdr.hseparator) {
00588             gtab_hsep(hwnd, ptab, hDC);
00589         }
00590         if (ptab->selvisible) {
00591             gtab_invertsel(hwnd, ptab, hDC);
00592         }
00593     }
00594
00595     EndPaint(hwnd, &ps);
00596 }
00597
00598
00599 void
00600 gtab_vsep(HWND hwnd, lpTable ptab, HDC hdc)
00601 {
00602   int x;
00603   RECT rc;
00604
00605   if (ptab->hdr.fixedcols < 1) {
00606     return;
00607   }
00608   x = ptab->pcellpos[ptab->hdr.fixedcols - 1].clipend+1;
00609   GetClientRect(hwnd, &rc);
00610   MoveToEx(hdc, x, rc.top, NULL);
00611   LineTo(hdc, x, rc.bottom);
00612 }
00613
00614 void
00615 gtab_hsep(HWND hwnd, lpTable ptab, HDC hdc)
00616 {
00617   int y;
00618   RECT rc;
00619
00620   if (ptab->hdr.fixedrows < 1) {
00621     return;
00622   }
00623   y = ptab->rowheight * ptab->hdr.fixedrows;
00624   GetClientRect(hwnd, &rc);
00625   MoveToEx(hdc, rc.left, y-1, NULL);
00626   LineTo(hdc, rc.right, y-1);
00627 }
00628
00629 /* draw in (inverting) the dotted selection lines for tracking a col width
00630  */
00631 void
00632 gtab_drawvertline(HWND hwnd, lpTable ptab)
00633 {
00634   RECT rc;
00635   HDC hdc;
00636   HPEN hpen;
00637
00638   hdc = GetDC(hwnd);
00639   if (hdc)
00640   {
00641     SetROP2(hdc, R2_XORPEN);
00642     hpen = (HPEN)SelectObject(hdc, hpenDotted);
00643     GetClientRect(hwnd, &rc);
00644
00645     MoveToEx(hdc, ptab->trackline1, rc.top, NULL);
00646     LineTo(hdc, ptab->trackline1, rc.bottom);
00647     if (ptab->trackline2 != -1) {
00648       MoveToEx(hdc, ptab->trackline2, rc.top, NULL);
00649       LineTo(hdc, ptab->trackline2, rc.bottom);
00650     }
00651
00652     SelectObject(hdc, hpen);
00653     ReleaseDC(hwnd, hdc);
00654   }
00655 }
00656
00657
00658 /*
00659  * mark the selected line, if visible, in the style chosen by the
00660  * client app. This can be TM_SOLID, meaning an inversion of
00661  * the whole selected area or TM_FOCUS, meaning, inversion of the first
00662  * cell, and then a dotted focus rectangle for the rest.
00663  *
00664  * this function inverts either style, and so will turn the selection
00665  * both on and off.
00666  */
00667 void
00668 gtab_invertsel(HWND hwnd, lpTable ptab, HDC hdc_in)
00669 {
00670   HDC hdc;
00671   int firstline, lastline;
00672   long startrow, lastrow, toprow, bottomrow;
00673   RECT rc;
00674   int lastcell;
00675
00676
00677
00678   /* get the selection start and end rows ordered vertically */
00679   if (ptab->select.nrows == 0) {
00680       return;
00681   } else if (ptab->select.nrows < 0) {
00682       startrow = ptab->select.startrow + ptab->select.nrows + 1;
00683       lastrow = ptab->select.startrow;
00684   } else {
00685       startrow = ptab->select.startrow;
00686       lastrow = ptab->select.startrow + ptab->select.nrows -1;
00687   }
00688
00689   /* is selected area (or part of it) visible on screen ?  */
00690   firstline = gtab_rowtoline(hwnd, ptab, startrow);
00691   lastline = gtab_rowtoline(hwnd, ptab, lastrow);
00692
00693
00694   if (firstline < 0) {
00695       toprow = gtab_linetorow(hwnd, ptab,
00696           ptab->hdr.fixedselectable ? 0: ptab->hdr.fixedrows);
00697       if ((toprow >= startrow)  &&
00698     (toprow <= lastrow)) {
00699         firstline = gtab_rowtoline(hwnd, ptab, toprow);
00700       } else {
00701     return;
00702       }
00703   } else {
00704       toprow = 0;
00705   }
00706
00707
00708   if (lastline < 0) {
00709       bottomrow = gtab_linetorow(hwnd, ptab, ptab->nlines-1);
00710       if ((bottomrow <= lastrow) &&
00711     (bottomrow >=startrow)) {
00712         lastline = gtab_rowtoline(hwnd, ptab, bottomrow);
00713       } else {
00714     return;
00715       }
00716   }
00717
00718
00719   rc.top = ptab->pdata[firstline].linepos.clipstart;
00720   rc.bottom = ptab->pdata[lastline].linepos.clipend;
00721
00722
00723
00724   /* selection mode includes a flag TM_FOCUS indicating we should
00725    * use a focus rect instead of the traditional inversion for
00726    * selections in this table. This interferes with multiple backgrnd
00727    * colours less.  However we still do inversion for fixedcols.
00728    */
00729
00730   lastcell = (int)(ptab->select.startcell + ptab->select.ncells - 1);
00731
00732
00733   /*
00734    * invert the whole area for TM_SOLID or just the first
00735    * cell for TM_FOCUS
00736    */
00737   rc.left = ptab->pcellpos[ptab->select.startcell].clipstart;
00738   if (ptab->hdr.selectmode & TM_FOCUS) {
00739     rc.right = ptab->pcellpos[ptab->select.startcell].clipend;
00740   }else {
00741     rc.right = ptab->pcellpos[lastcell].clipend;
00742   }
00743
00744   if (hdc_in == NULL) {
00745     hdc = GetDC(hwnd);
00746     if (!hdc)
00747       return;
00748   } else {
00749     hdc = hdc_in;
00750   }
00751
00752   InvertRect(hdc, &rc);
00753
00754   /*
00755    * draw focus rectangle around remaining cells on this line, if there
00756    * are any
00757    */
00758   if (ptab->hdr.selectmode & TM_FOCUS) {
00759     if (toprow > startrow) {
00760         rc.top--;
00761     }
00762     if (ptab->select.ncells > 1) {
00763       rc.left = ptab->pcellpos[ptab->select.startcell+1].clipstart;
00764       rc.right = ptab->pcellpos[lastcell].clipend;
00765       DrawFocusRect(hdc, &rc);
00766     }
00767   }
00768
00769   if (hdc_in == NULL) {
00770     ReleaseDC(hwnd, hdc);
00771   }
00772 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/serviceconfig/makefile.inc Source File

  • NetDS
  • http
  • serviceconfig

makefile.inc

Go to the documentation of this file.
00001 $(O)\nlstxt.mc: localmsg.mc
00002     copy localmsg.mc $@
00003     $(MC) -v -h $(O) -r $(O) $@
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/Factory.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

Factory.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.H
00003
00004   Summary:   Include file for the class factory COM objects: CFCar,
00005              CFUtilityCar, and CFCruiseCar. These constitute the LOCSERVE
00006              server's Class Factories for those COM components.
00007
00008              The multiple interface COM Object Classes are achieved via
00009              the technique of nested classes: the implementation of the
00010              IClassFactory interfaces are nested inside of the class
00011              factory COM object classes.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial LOCSERVE.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the module's source code.
00017
00018   Classes:   CFCar, CFUtilityCar, CFCruiseCar.
00019
00020   Functions: .
00021
00022   Origin:    11-14-95: atrent - Editor-inheritance from FACTORY.H in
00023                the DLLSERVE Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 #if !defined(FACTORY_H)
00041 #define FACTORY_H
00042
00043 #ifdef __cplusplus
00044
00045 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00046   ObjectClass: CFCar
00047
00048   Summary:     Class Factory COM Object Class for Car COM components.
00049                Used to manufacture COCar COM objects.  The mulitple
00050                interfaces on this COM object class are constructed via
00051                the nested interface classes technique.
00052
00053   Interfaces:  IUnknown
00054                  Standard interface providing COM object features.
00055                IClassFactory
00056                  Standard interface providing COM Class Factory features.
00057
00058   Aggregation: Yes, CFCar COM objects are aggregatable by
00059                passing a non-NULL pUnkOuter IUnknown pointer into the
00060                constructor.
00061 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00062 class CFCar : public IUnknown
00063 {
00064   public:
00065     // Main Object Constructor & Destructor.
00066     CFCar(IUnknown* pUnkOuter, CServer* pServer);
00067     ~CFCar(void);
00068
00069     // IUnknown methods. Main object, non-delegating.
00070     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00071     STDMETHODIMP_(ULONG) AddRef(void);
00072     STDMETHODIMP_(ULONG) Release(void);
00073
00074   private:
00075     // We declare nested class interface implementations here.
00076
00077     // We implement the IClassFactory interface (of-course) in this class
00078     // factory COM object class.
00079     class CImpIClassFactory : public IClassFactory
00080     {
00081       public:
00082         // Interface Implementation Constructor & Destructor.
00083         CImpIClassFactory(
00084           CFCar* pBackObj,
00085           IUnknown* pUnkOuter,
00086           CServer* pServer);
00087         ~CImpIClassFactory(void);
00088
00089         // IUnknown methods.
00090         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00091         STDMETHODIMP_(ULONG) AddRef(void);
00092         STDMETHODIMP_(ULONG) Release(void);
00093
00094         // IClassFactory methods.
00095         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00096         STDMETHODIMP         LockServer(BOOL);
00097
00098       private:
00099         // Data private to this interface implementation of IClassFactory.
00100         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00101         CFCar*        m_pBackObj;    // Parent Object back pointer.
00102         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00103         CServer*      m_pServer;     // Server's control object.
00104     };
00105
00106     // Make the otherwise private and nested IClassFactory interface
00107     // implementation a friend to COM object instantiations of this
00108     // selfsame CFCar COM object class.
00109     friend CImpIClassFactory;
00110
00111     // Private data of CFCar COM objects.
00112
00113     // Nested IClassFactory implementation instantiation.
00114     CImpIClassFactory m_ImpIClassFactory;
00115
00116     // Main Object reference count.
00117     ULONG             m_cRefs;
00118
00119     // Outer unknown (aggregation & delegation). Used when this
00120     // CFCar object is being aggregated.  Otherwise it is used
00121     // for delegation if this object is reused via containment.
00122     IUnknown*         m_pUnkOuter;
00123
00124     // Pointer to this component server's control object.
00125     CServer*          m_pServer;
00126 };
00127
00128 typedef CFCar* PCFCar;
00129
00130
00131 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00132   ObjectClass: CFUtilityCar
00133
00134   Summary:     Class Factory COM Object Class for UtilityCar COM
00135                components.  Used to manufacture COUtilityCar COM
00136                objects.  The mulitple interfaces on this COM object
00137                class are constructed via the nested interface
00138                classes technique.
00139
00140   Interfaces:  IUnknown
00141                  Standard interface providing COM object features.
00142                IClassFactory
00143                  Standard interface providing COM Class Factory features.
00144
00145   Aggregation: Yes, CFUtilityCar COM objects are aggregatable by
00146                passing a non-NULL pUnkOuter IUnknown pointer into the
00147                constructor.
00148 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00149 class CFUtilityCar : public IUnknown
00150 {
00151   public:
00152     // Main Object Constructor & Destructor.
00153     CFUtilityCar(IUnknown* pUnkOuter, CServer* pServer);
00154     ~CFUtilityCar(void);
00155
00156     // A general method for initializing a newly created CFUtilityCar.
00157     HRESULT Init(void);
00158
00159     // IUnknown methods. Main object, non-delegating.
00160     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00161     STDMETHODIMP_(ULONG) AddRef(void);
00162     STDMETHODIMP_(ULONG) Release(void);
00163
00164   private:
00165     // We declare nested class interface implementations here.
00166
00167     // We implement the IClassFactory interface (ofcourse) in this class
00168     // factory COM object class.
00169     class CImpIClassFactory : public IClassFactory
00170     {
00171       public:
00172         // Interface Implementation Constructor & Destructor.
00173         CImpIClassFactory(
00174           CFUtilityCar* pBackObj,
00175           IUnknown* pUnkOuter,
00176           CServer* pServer);
00177         ~CImpIClassFactory(void);
00178
00179         // IUnknown methods.
00180         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00181         STDMETHODIMP_(ULONG) AddRef(void);
00182         STDMETHODIMP_(ULONG) Release(void);
00183
00184         // IClassFactory methods.
00185         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00186         STDMETHODIMP         LockServer(BOOL);
00187
00188       private:
00189         // Data private to this interface implementation of IClassFactory.
00190         ULONG            m_cRefI;       // Interface Ref Count (debugging).
00191         CFUtilityCar*    m_pBackObj;    // Parent Object back pointer.
00192         IUnknown*        m_pUnkOuter;   // Outer unknown for Delegation.
00193         CServer*         m_pServer;     // Server Control Object.
00194     };
00195
00196     // Make the otherwise private and nested IClassFactory interface
00197     // implementation a friend to COM object instantiations of this
00198     // selfsame CFUtilityCar COM object class.
00199     friend CImpIClassFactory;
00200
00201     // Private data of CFUtilityCar COM objects.
00202
00203     // Nested IClassFactory implementation instantiation.
00204     CImpIClassFactory m_ImpIClassFactory;
00205
00206     // Main Object reference count.
00207     ULONG             m_cRefs;
00208
00209     // Outer unknown (aggregation & delegation). Used when this
00210     // CFUtilityCar object is being aggregated.  Otherwise it is used
00211     // for delegation if this object is reused via containment.
00212     IUnknown*         m_pUnkOuter;
00213
00214     // Pointer to this component server's control object.
00215     CServer*          m_pServer;
00216 };
00217
00218 typedef CFUtilityCar* PCFUtilityCar;
00219
00220
00221 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00222   ObjectClass: CFCruiseCar
00223
00224   Summary:     Class Factory COM Object Class for CruiseCar COM
00225                components.  Used to manufacture COCruiseCar COM objects.
00226                The mulitple interfaces on this COM object class are
00227                constructed via the nested interface classes technique.
00228
00229   Interfaces:  IUnknown
00230                  Standard interface providing COM object features.
00231                IClassFactory
00232                  Standard interface providing COM Class Factory features.
00233
00234   Aggregation: Yes, CFCruiseCar COM objects are aggregatable by
00235                passing a non-NULL pUnkOuter IUnknown pointer into the
00236                constructor.
00237 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00238 class CFCruiseCar : public IUnknown
00239 {
00240   public:
00241     // Main Object Constructor & Destructor.
00242     CFCruiseCar(IUnknown* pUnkOuter, CServer* pServer);
00243     ~CFCruiseCar(void);
00244
00245     // A general method for initializing a newly created CFCruiseCar.
00246     HRESULT Init(void);
00247
00248     // IUnknown methods. Main object, non-delegating.
00249     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00250     STDMETHODIMP_(ULONG) AddRef(void);
00251     STDMETHODIMP_(ULONG) Release(void);
00252
00253   private:
00254     // We declare nested class interface implementations here.
00255
00256     // We implement the IClassFactory interface (ofcourse) in this class
00257     // factory COM object class.
00258     class CImpIClassFactory : public IClassFactory
00259     {
00260       public:
00261         // Interface Implementation Constructor & Destructor.
00262         CImpIClassFactory(
00263           CFCruiseCar* pBackObj,
00264           IUnknown* pUnkOuter,
00265           CServer* pServer);
00266         ~CImpIClassFactory(void);
00267
00268         // IUnknown methods.
00269         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00270         STDMETHODIMP_(ULONG) AddRef(void);
00271         STDMETHODIMP_(ULONG) Release(void);
00272
00273         // IClassFactory methods.
00274         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00275         STDMETHODIMP         LockServer(BOOL);
00276
00277       private:
00278         // Data private to this interface implementation of IClassFactory.
00279         ULONG            m_cRefI;       // Interface Ref Count (debugging).
00280         CFCruiseCar*     m_pBackObj;    // Parent Object back pointer.
00281         IUnknown*        m_pUnkOuter;   // Outer unknown for Delegation.
00282         CServer*         m_pServer;     // Server Control Object.
00283     };
00284
00285     // Make the otherwise private and nested IClassFactory interface
00286     // implementation a friend to COM object instantiations of this
00287     // selfsame CFCruiseCar COM object class.
00288     friend CImpIClassFactory;
00289
00290     // Private data of CFCruiseCar COM objects.
00291
00292     // Nested IClassFactory implementation instantiation.
00293     CImpIClassFactory m_ImpIClassFactory;
00294
00295     // Main Object reference count.
00296     ULONG             m_cRefs;
00297
00298     // Outer unknown (aggregation & delegation). Used when this
00299     // CFCruiseCar object is being aggregated.  Otherwise it is used
00300     // for delegation if this object is reused via containment.
00301     IUnknown*         m_pUnkOuter;
00302
00303     // Pointer to this component server's control object.
00304     CServer*          m_pServer;
00305 };
00306
00307 typedef CFCruiseCar* PCFCruiseCar;
00308
00309 #endif // __cplusplus
00310
00311
00312 #endif // FACTORY_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/ConnectionEvents.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

ConnectionEvents.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dispatch-only interface ConnectionEvents
00019 /** @com.interface(iid=00000400-0000-0010-8000-00AA006D2EA4, thread=AUTO, type=DISPATCH) */
00020 public interface ConnectionEvents extends IUnknown
00021 {
00022   /** @com.method(dispid=0, type=METHOD, name="InfoMessage")
00023       @com.parameters([in,type=DISPATCH] pError, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pConnection) */
00024   public void InfoMessage(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00025
00026   /** @com.method(dispid=1, type=METHOD, name="BeginTransComplete")
00027       @com.parameters([in,type=I4] TransactionLevel, [in,type=DISPATCH] pError, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pConnection) */
00028   public void BeginTransComplete(int TransactionLevel, msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00029
00030   /** @com.method(dispid=3, type=METHOD, name="CommitTransComplete")
00031       @com.parameters([in,type=DISPATCH] pError, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pConnection) */
00032   public void CommitTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00033
00034   /** @com.method(dispid=2, type=METHOD, name="RollbackTransComplete")
00035       @com.parameters([in,type=DISPATCH] pError, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pConnection) */
00036   public void RollbackTransComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00037
00038   /** @com.method(dispid=4, type=METHOD, name="WillExecute")
00039       @com.parameters([in,out,elementType=STRING,type=ARRAY] Source, [in,out,elementType=I4,type=PTR] CursorType, [in,out,elementType=I4,type=PTR] LockType, [in,out,elementType=I4,type=ARRAY] Options, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pCommand, [in,type=DISPATCH] pRecordset, [in,type=DISPATCH] pConnection) */
00040   public void WillExecute(String[] Source, int[] CursorType, int[] LockType, int[] Options, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection);
00041
00042   /** @com.method(dispid=5, type=METHOD, name="ExecuteComplete")
00043       @com.parameters([in,type=I4] RecordsAffected, [in,type=DISPATCH] pError, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pCommand, [in,type=DISPATCH] pRecordset, [in,type=DISPATCH] pConnection) */
00044   public void ExecuteComplete(int RecordsAffected, msado15.Error pError, int[] adStatus, msado15._Command pCommand, msado15._Recordset pRecordset, msado15._Connection pConnection);
00045
00046   /** @com.method(dispid=6, type=METHOD, name="WillConnect")
00047       @com.parameters([in,out,elementType=STRING,type=ARRAY] ConnectionString, [in,out,elementType=STRING,type=ARRAY] UserID, [in,out,elementType=STRING,type=ARRAY] Password, [in,out,elementType=I4,type=ARRAY] Options, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pConnection) */
00048   public void WillConnect(String[] ConnectionString, String[] UserID, String[] Password, int[] Options, int[] adStatus, msado15._Connection pConnection);
00049
00050   /** @com.method(dispid=7, type=METHOD, name="ConnectComplete")
00051       @com.parameters([in,type=DISPATCH] pError, [in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pConnection) */
00052   public void ConnectComplete(msado15.Error pError, int[] adStatus, msado15._Connection pConnection);
00053
00054   /** @com.method(dispid=8, type=METHOD, name="Disconnect")
00055       @com.parameters([in,out,elementType=I4,type=PTR] adStatus, [in,type=DISPATCH] pConnection) */
00056   public void Disconnect(int[] adStatus, msado15._Connection pConnection);
00057
00058
00059   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0x400, (short)0x0, (short)0x10, (byte)0x80, (byte)0x0, (byte)0x0, (byte)0xaa, (byte)0x0, (byte)0x6d, (byte)0x2e, (byte)0xa4);
00060 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/EnumStreams/FindStream.c Source File

  • WinBase
  • IO
  • EnumStreams

FindStream.c

Go to the documentation of this file.
00001 /*----------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1999 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009 findstream.c
00010
00011 This file contains the FindFirstStream, FindNextStream,
00012 FindCloseStream functions used to enumerate streams in files.
00013 ----------------------------------------------------------------*/
00014
00015 #include <windows.h>
00016 #include <tchar.h>
00017
00018 #ifndef UNICODE
00019    #include <stdio.h>
00020 #endif
00021
00022 #include "findstream.h"
00023
00024 // FFSTREAMMAGIC is a magic number used to identify a block of memory as FFSTREAM type
00025 #define FFSTREAMMAGIC 0x54534646
00026
00027 // FFSTREAM is used to track where we are in the process of enumerating streams.
00028 typedef struct _FFSTREAM
00029 {
00030    DWORD   dwFFStreamMagic;
00031    HANDLE  hFile;
00032    LPVOID  lpContext;
00033 } FFSTREAM, *LPFFSTREAM;
00034
00035 #define lenof(x)  ((sizeof(x) / sizeof(TCHAR)) - 1)
00036
00037 // DATASTUFFIX is a suffix at the end of stream names returned from BackupRead
00038 #define DATASUFFIX  _T(":$DATA")
00039
00040 /*----------------------------------------------------------------
00041 ffproc(LPFFSTREAM lpFFStream, LPSTREAM_FIND_DATA lpFindStreamData)
00042
00043 This function is the core function used by FindFirstStream and FindNextStream.
00044 Its purpose is to use BackupRead to read the stream header and get the stream
00045 name.  It will then skip the data portion of the backup stream using BackupSeek.
00046 It returns once it finds a backup stream of type ID BACKUP_DATA or
00047 BACKUP_ALTERNATE_DATA or when there is no more data to read.
00048
00049 lpFFStream
00050     Buffer used internally by FindxxxStream to keep track of
00051     context.
00052 lpFindStreamData
00053     Buffer passed thru FindxxxStream used to return stream
00054     information to the caller
00055
00056 Returns TRUE if successful, FALSE if not.
00057
00058 On failure GetLastError can return:
00059
00060 ERROR_NO_MORE_FILES
00061     There are no more stream in the file
00062 ERROR_READ_FAULT
00063     BackupRead returned an error
00064 ERROR_OUTOFMEMROY
00065    Could not allocate memory to hold internal status information
00066
00067 ----------------------------------------------------------------*/
00068
00069 static BOOL ffproc(LPFFSTREAM lpFFStream, LPSTREAM_FIND_DATA lpFindStreamData)
00070 {
00071    WIN32_STREAM_ID BackupStreamHeader;
00072    LPWSTR lpStreamName;
00073    DWORD dwLoToSeek, dwHiToSeek;
00074    DWORD dwLoSeek, dwHiSeek;
00075    DWORD dwToRead, dwRead;
00076    BOOL bFoundDataStream;
00077
00078    // Enumerate the streams now
00079    // we loop here until we get a stream with ID BACKUP_DATA or
00080    // BACKUP_ALTERNATE_DATA
00081    bFoundDataStream = FALSE;
00082    while (!bFoundDataStream)
00083    {
00084       // Read the backup stream header
00085       // We read up to the stream name
00086       dwToRead = (DWORD)((LPBYTE)&(BackupStreamHeader.cStreamName[0]) -
00087                  (LPBYTE)&BackupStreamHeader.dwStreamId);
00088
00089       if (!BackupRead(lpFFStream->hFile, (BYTE *)&BackupStreamHeader, dwToRead,
00090                       &dwRead, FALSE, TRUE, &(lpFFStream->lpContext)))
00091       {
00092          SetLastError(ERROR_READ_FAULT);
00093          return FALSE;
00094       }
00095
00096       if (dwRead == 0)
00097       {
00098          SetLastError(ERROR_NO_MORE_FILES);
00099          return FALSE;
00100       }
00101
00102       // if there is a stream name (length > 0), then process it
00103       if (BackupStreamHeader.dwStreamNameSize > 0)
00104       {
00105          // the stream name is a Unicode string.  BackupRead returns the
00106          // stream name length in bytes.
00107
00108          // allocate enough memory to hold the stream name (including the
00109          // terminating null)
00110          if ((lpStreamName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
00111                                                BackupStreamHeader.dwStreamNameSize +
00112                                                sizeof(WCHAR))) == NULL)
00113          {
00114             SetLastError(ERROR_OUTOFMEMORY);
00115             return FALSE;
00116          }
00117
00118
00119          if (!BackupRead(lpFFStream->hFile, (LPBYTE)lpStreamName,
00120                          BackupStreamHeader.dwStreamNameSize, &dwRead, FALSE, TRUE,
00121                          &(lpFFStream->lpContext)))
00122          {
00123             SetLastError(ERROR_READ_FAULT);
00124             return FALSE;
00125          }
00126
00127          // Fill in the terminating nul for the string
00128          lpStreamName[BackupStreamHeader.dwStreamNameSize / sizeof(WCHAR)] =
00129          _T('\0');
00130       }
00131       else
00132          lpStreamName = L"";
00133
00134
00135       if (BackupStreamHeader.dwStreamId == BACKUP_DATA ||
00136           BackupStreamHeader.dwStreamId == BACKUP_ALTERNATE_DATA)
00137       {
00138          bFoundDataStream = TRUE;
00139
00140          // Record the size of the stream in structure passed by caller
00141          lpFindStreamData->Size.QuadPart = BackupStreamHeader.Size.QuadPart;
00142
00143 #ifdef UNICODE
00144          // if Unicode, then copy the name to the structure passed by caller
00145          lstrcpy(lpFindStreamData->cStreamName, lpStreamName);
00146 #else
00147          // if ANSI then convert the name into the structure passed by caller.
00148          // Because the source string is NULL terminated, we can pass -1
00149          // as the string length and rely on the conversion function to
00150          // calculate the string length, including the NULL terminator.
00151          WideCharToMultiByte(CP_ACP, 0, lpStreamName, -1,
00152                              lpFindStreamData->cStreamName,
00153                              sizeof(lpFindStreamData->cStreamName), NULL, NULL);
00154 #endif
00155
00156          // remove :$DATA at end...
00157          if (lstrcmp(lpFindStreamData->cStreamName +
00158                      lstrlen(lpFindStreamData->cStreamName) -
00159                      lenof(DATASUFFIX),
00160                      DATASUFFIX) == 0)
00161          {
00162             lpFindStreamData->cStreamName[
00163                                          lstrlen(lpFindStreamData->cStreamName) -
00164                                          lenof(DATASUFFIX)] = _T('\0');
00165          }
00166
00167          // remove : at beginning.
00168          // Use MoveMemory here because the source and destination overlap.
00169          if (*lpFindStreamData->cStreamName == _T(':'))
00170             MoveMemory(lpFindStreamData->cStreamName,
00171                        lpFindStreamData->cStreamName + 1,
00172                        sizeof(lpFindStreamData->cStreamName) - 1);
00173       }
00174
00175       // if the stream had a name, then free the memory used to hold it
00176       if (BackupStreamHeader.dwStreamNameSize > 0)
00177          HeapFree(GetProcessHeap(), 0, lpStreamName);
00178
00179       // Skip the stream data
00180       dwLoToSeek = BackupStreamHeader.Size.LowPart;
00181       dwHiToSeek = BackupStreamHeader.Size.HighPart;
00182       if (!BackupSeek(lpFFStream->hFile, dwLoToSeek, dwHiToSeek, &dwLoSeek,
00183                       &dwHiSeek, &(lpFFStream->lpContext)))
00184       {
00185          SetLastError(ERROR_READ_FAULT);
00186          return FALSE;
00187       }
00188    }
00189
00190    return TRUE;
00191 }
00192
00193 /*----------------------------------------------------------------
00194 FindFirstStream(LPCTSTR lpFileName,
00195                 LPSTREAM_FIND_DATA lpFindStreamData)
00196
00197 The FindFirstStream function enumerates the streams contained in the
00198 file specified by lpFileName.  Use FindNextStream to continue
00199 enumerating streams.  Use FindCloseStream when done.
00200
00201 lpFileName
00202     Null terminated string contains the name of file to enumerate
00203     streams
00204 lpFindStreamData
00205     Buffer used to return stream information to the caller
00206
00207 Returns INVALID_HANDLE_VALUE if it fails, a HANDLE otherwise
00208
00209 On failure GetLastError can return:
00210
00211 ERROR_FILE_NOT_FOUND
00212    The file does not exist or it does not contain any streams.
00213    Note that empty files do not contain any streams.
00214 ERROR_READ_FAULT
00215    Could not read the names of the streams
00216 ERROR_OUTOFMEMROY
00217    Could not allocate memory to hold internal status information
00218
00219 Other error codes could be passed from lower level APIs
00220 ----------------------------------------------------------------*/
00221
00222 HANDLE FindFirstStream(LPCTSTR lpFileName, LPSTREAM_FIND_DATA lpFindStreamData)
00223 {
00224    LPFFSTREAM lpFFStream;
00225
00226    if ((lpFFStream = HeapAlloc(GetProcessHeap(), 0, sizeof(FFSTREAM))) == NULL)
00227    {
00228       SetLastError(ERROR_OUTOFMEMORY);
00229       return INVALID_HANDLE_VALUE;
00230    }
00231
00232    // set the magic number which mark the handle as valid...
00233    lpFFStream->dwFFStreamMagic = FFSTREAMMAGIC;
00234    lpFFStream->lpContext = NULL;
00235
00236    if ((lpFFStream->hFile = CreateFile(lpFileName, GENERIC_READ,
00237                                        FILE_SHARE_READ | FILE_SHARE_WRITE,
00238                                        NULL, OPEN_EXISTING,
00239                                        FILE_FLAG_BACKUP_SEMANTICS, NULL)) ==
00240        INVALID_HANDLE_VALUE)
00241    {
00242       HeapFree(GetProcessHeap(), 0, lpFFStream);
00243       // pass on error from CreateFile...
00244       return INVALID_HANDLE_VALUE;
00245    }
00246
00247    if (!ffproc(lpFFStream, lpFindStreamData))
00248    {
00249       // free resource on failure...
00250       CloseHandle(lpFFStream->hFile);
00251
00252       HeapFree(GetProcessHeap(), 0, lpFFStream);
00253
00254       // pass on error...
00255       if (GetLastError() == ERROR_NO_MORE_FILES)
00256          SetLastError(ERROR_FILE_NOT_FOUND);
00257       return INVALID_HANDLE_VALUE;
00258    }
00259
00260    return (HANDLE)lpFFStream;
00261 }
00262
00263 /*----------------------------------------------------------------
00264 FindNextStream(HANDLE hFindStream,
00265                 LPSTREAM_FIND_DATA lpFindStreamData)
00266
00267 The FindNextStream function continues enumerating the streams
00268 specified by hFindStream.  Use FindFirstStream to start the
00269 enumeration.  Use FindCloseStream when done.
00270
00271 hFindStream
00272     Handle returned from FindFirstStream
00273 lpFindStreamData
00274     Buffer used to return stream information to the caller
00275
00276 Returns TRUE if it succeeds, FALSE otherwise.
00277
00278 On failure GetLastError can return:
00279
00280 ERROR_INVALID_HANDLE
00281     The passed handle was not created using FindFirstStream or
00282     was closed already.
00283 ERROR_NO_MORE_FILES
00284     There are no more stream in the file
00285 ERROR_READ_FAULT
00286     There was a problem reading stream names using the Backup
00287     APIs.
00288 ERROR_OUTOFMEMROY
00289     Could not allocate memory to hold internal status information
00290
00291 ----------------------------------------------------------------*/
00292
00293 BOOL FindNextStream(HANDLE hFindStream, LPSTREAM_FIND_DATA lpFindStreamData)
00294 {
00295    LPFFSTREAM lpFFStream = (LPFFSTREAM)hFindStream;
00296
00297    // verify that the passed structure is a FFSTREAM structure...
00298    if (lpFFStream->dwFFStreamMagic != FFSTREAMMAGIC)
00299    {
00300       SetLastError(ERROR_INVALID_HANDLE);
00301       return FALSE;
00302    }
00303
00304    if (!ffproc(lpFFStream, lpFindStreamData))
00305    {
00306       // pass on error...
00307       return FALSE;
00308    }
00309
00310    return TRUE;
00311 }
00312
00313 /*----------------------------------------------------------------
00314 FindCloseStream(HANDLE hFindStream)
00315
00316 The FindCloseStream function releases the resources used to
00317 enumerate the streams specified by hFindStream.  Use FindFirstStream
00318 to start the enumeration.
00319
00320 hFindStream
00321     Handle returned from FindFirstStream
00322
00323 Returns TRUE if it succeeds, FALSE otherwise.
00324
00325 On failure GetLastError can return:
00326
00327 ERROR_INVALID_HANDLE
00328     The passed handle was not created using FindFirstStream or
00329     was closed already.
00330
00331 ----------------------------------------------------------------*/
00332 BOOL FindCloseStream(HANDLE hFindStream)
00333 {
00334    LPFFSTREAM lpFFStream = (LPFFSTREAM)hFindStream;
00335
00336    // verify that the passed structure is a FFSTREAM structure...
00337    if (lpFFStream->dwFFStreamMagic != FFSTREAMMAGIC)
00338    {
00339       SetLastError(ERROR_INVALID_HANDLE);
00340       return FALSE;
00341    }
00342
00343    // Release the context memory
00344    BackupRead(0, NULL, 0, NULL, TRUE, FALSE, &(lpFFStream->lpContext));
00345
00346    // Close the file handle
00347    CloseHandle(lpFFStream->hFile);
00348
00349    // obliterate the magic number of handle making it invalid...
00350    lpFFStream->dwFFStreamMagic = 0;
00351
00352    // Free the handle...
00353    HeapFree(GetProcessHeap(), 0, lpFFStream);
00354
00355    return TRUE;
00356 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminThreadingModels.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminThreadingModels.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminThreadingModels
00019
00020 public interface COMAdminThreadingModels
00021 {
00022   public static final int COMAdminThreadingModelApartment = 0;
00023   public static final int COMAdminThreadingModelFree = 1;
00024   public static final int COMAdminThreadingModelMain = 2;
00025   public static final int COMAdminThreadingModelBoth = 3;
00026   public static final int COMAdminThreadingModelNeutral = 4;
00027   public static final int COMAdminThreadingModelNotSpecified = 5;
00028 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAPIView Member List

This is the complete list of members for CAPIView, including all inherited members.
_iScale | CView | [protected]
_ptClient | CView | [protected]
_ptOrg | CView | [protected]
_ptScroll | CView | [protected]
_size | CView | [protected]
CAPIView() | CAPIView | [protected]
CView(int cx, int cy) | CView |
GetDocument() | CAPIView | [inline]
Hittest(CCanvas &canvas, POINT pt, CModel *_pModel) | CView |
Invalidate(HWND hwnd, LPRECT lpRect=NULL) | CView |
OnDraw(CDC *pDC) | CAPIView | [virtual]
OnPaint() | CAPIView | [protected]
OnSetFocus(CWnd *pOldWnd) | CAPIView | [protected]
Paint(CCanvas &canvas, CModel *_pModel, RECT rc) | CView |
PreCreateWindow(CREATESTRUCT &cs) | CAPIView | [virtual]
Scroll(CCanvas &canvas) | CView | [protected]
SetSize(int cx, int cy) | CView |
~CAPIView() | CAPIView | [virtual]
Generated on Wed Nov 13 2024 16:55:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpwizard/StdAfx.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpwizard

StdAfx.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       StdAfx.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // stdafx.cpp : source file that includes just the standard includes
00012 //  stdafx.pch will be the pre-compiled header
00013 //  stdafx.obj will contain the pre-compiled type information
00014
00015 #include "stdafx.h"
00016
00017 #include <atlimpl.cpp>
00018
00019 HRESULT WINAPI CSCPWizModule::UpdateRegistryCLSID(const CLSID& clsid, BOOL bRegister)
00020 {
00021   static const WCHAR szIPS32[] = _T("InprocServer32");
00022   static const WCHAR szCLSID[] = _T("CLSID");
00023
00024   HRESULT hRes = S_OK;
00025
00026   LPOLESTR lpOleStrCLSIDValue;
00027   ::StringFromCLSID(clsid, &lpOleStrCLSIDValue);
00028
00029   CRegKey key;
00030   if (bRegister)
00031   {
00032     LONG lRes = key.Open(HKEY_CLASSES_ROOT, szCLSID);
00033     if (lRes == ERROR_SUCCESS)
00034     {
00035       lRes = key.Create(key, lpOleStrCLSIDValue);
00036       if (lRes == ERROR_SUCCESS)
00037       {
00038         WCHAR szModule[_MAX_PATH];
00039         ::GetModuleFileName(m_hInst, szModule, _MAX_PATH);
00040         key.SetKeyValue(szIPS32, szModule);
00041       }
00042     }
00043     if (lRes != ERROR_SUCCESS)
00044       hRes = HRESULT_FROM_WIN32(lRes);
00045   }
00046   else
00047   {
00048     key.Attach(HKEY_CLASSES_ROOT);
00049     if (key.Open(key, szCLSID) == ERROR_SUCCESS)
00050       key.RecurseDeleteKey(lpOleStrCLSIDValue);
00051   }
00052   ::CoTaskMemFree(lpOleStrCLSIDValue);
00053   return hRes;
00054 }
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/quelist.c Source File

  • Multimedia
  • Gdi
  • PrintJob

quelist.c

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 * PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   QueList.C
00010 *
00011 *   PURPOSE:    Implements an abstraction around a ListView common control
00012 *      used to display the contents of a printer queue.
00013 *
00014 *   FUNCTIONS:
00015         CreateQueList()   - Creates the child window control
00016         ResizeQueList()   - Forces the control to the size Parents Client Area.
00017         InitQueList()     - Initializes the control and sets the column
00018                             Headings.
00019         SetQueListContents()  - Does a minimal update of the ListViews
00020                                 contents.
00021         ResizeWindowToControlWidth()  - Adjusts the Application Window so
00022                                         the client area is the controls
00023                                         desired size.
00024 *
00025 ******************************************************************************/
00026
00027
00028 #define STRICT
00029 #include <windows.h>   // required for all Windows applications
00030 #include "resource.h"  // Windows resource IDs
00031 #include "Queue.h"     // Data Structure for Queue data
00032 #include "QueList.h"   // Declarations for these exported functions
00033
00034
00035 extern HINSTANCE    g_hInst;        // Instance of the application
00036 static unsigned short *g_pnColumns; // # of columns pulled from resources
00037
00038 /**********************************************************
00039  * Module private declarations
00040  **********************************************************/
00041
00042 static void ResizeWindowToControlWidth (HWND hWnd, HWND hWndControl);
00043 static BOOL InitQueList (HWND hwndListView);
00044
00045
00046 /**********************************************************
00047  * Publicly Exported declarations
00048  *********************************************************/
00049
00050
00051 /****************************************************************************
00052
00053     FUNCTION:   CreateQueList(HWND hwndParent)
00054
00055
00056     PURPOSE:   Used to initially, periodically, or upon user request,
00057                completely fill in the data for the printer queue.
00058
00059     COMMENTS:
00060
00061             If Printer Change Notifications are not used this function is
00062             called by the polling thread each time it wakes up to refresh the
00063             data for the Printer Queue.
00064
00065 ****************************************************************************/
00066
00067 HWND CreateQueList(HWND hwndParent)
00068 {
00069     DWORD       dwStyle;
00070     HWND        hwndListView;
00071
00072     /*
00073      * List View Styles for this control
00074      */
00075     dwStyle =   WS_TABSTOP |
00076                 WS_CHILD |
00077                 WS_BORDER |
00078                 LVS_REPORT |
00079                 WS_VISIBLE;
00080
00081     hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,          // ex style
00082                                      WC_LISTVIEW,               // class name - defined in commctrl.h
00083                                      "",                        // dummy text
00084                                      dwStyle,                   // style
00085                                      0,                         // x position
00086                                      0,                         // y position
00087                                      0,                         // width
00088                                      0,                         // height
00089                                      hwndParent,                // parent
00090                                      (HMENU)IDC_LISTVIEW,       // ID
00091                                      g_hInst,                   // instance
00092                                      NULL);                     // no extra data
00093
00094     /* Very bad, Bail */
00095     if(!hwndListView)
00096        return NULL;
00097
00098     /* Setup the control via resources */
00099     InitQueList(hwndListView);
00100
00101     /* make the parent wide enough for the child window */
00102     ResizeWindowToControlWidth(hwndParent, hwndListView);
00103
00104     return hwndListView;
00105
00106 } /* end of function CreateQueList */
00107
00108 /****************************************************************************
00109
00110     FUNCTION:   ResizeQueList(HWND hwndListView, HWND hwndParent)
00111
00112
00113     PURPOSE:   Changes the Window's dimensions and location to fit
00114                perfectly withing the parent's client area.
00115
00116     COMMENTS:
00117
00118             Trivial.
00119
00120 ****************************************************************************/
00121
00122 void ResizeQueList(HWND hwndListView, HWND hwndParent)
00123 {
00124     RECT  rc;
00125
00126     GetClientRect(hwndParent, &rc);
00127
00128     MoveWindow( hwndListView,
00129                 rc.left,
00130                 rc.top,
00131                 rc.right - rc.left,
00132                 rc.bottom - rc.top,
00133                 TRUE);
00134 } /* end of function ResizeQueList */
00135
00136 /****************************************************************************
00137
00138     FUNCTION:   InitQueList( HWND )
00139
00140
00141     PURPOSE:   InitQueList sets up an existing ListView Common Control to
00142                contain specific columns as defined by resources in the
00143                application.
00144
00145     COMMENTS:
00146
00147             The # of columns for the control is defined by IDR_COLUMNCOUNT in
00148             the applications resources. The strings for the column headings
00149             are stored IDS_COLUMN1 + n resource strings. The default widths of
00150             the columns are stored in an array of shorts located at IDR_COLUMNWIDTHS.
00151
00152 ****************************************************************************/
00153
00154 BOOL InitQueList(HWND hwndListView)
00155 {
00156     LV_COLUMN       lvColumn;
00157     int             i,
00158                     nColumns,
00159                     nListWidth;
00160     unsigned short  *pnColumnWidths;
00161     HRSRC           hColumnWidthsRsrc;
00162     HGLOBAL         hColumnWidths;
00163     HRSRC           hColumnCountRsrc;
00164     HGLOBAL         hColumnCount;
00165     char            szheading[ColumnHeadingSize+1];
00166     RECT            rcWindow;
00167
00168     // empty the list just to make sure.
00169     ListView_DeleteAllItems(hwndListView);
00170     while ( ListView_DeleteColumn (hwndListView, 0) );
00171
00172     /* pull out the # of columns from the resource */
00173     hColumnCountRsrc = FindResource(g_hInst, MAKEINTRESOURCE(IDR_COLUMNCOUNT), RT_RCDATA);
00174     hColumnCount = LoadResource(g_hInst, hColumnCountRsrc);
00175     g_pnColumns = (unsigned short *)LockResource(hColumnCount);
00176     nColumns = *g_pnColumns;        // promote to an int
00177
00178     /* grab a pointer to an array of widths */
00179     hColumnWidthsRsrc = FindResource(g_hInst, MAKEINTRESOURCE(IDR_COLUMNWIDTHS), RT_RCDATA);
00180     hColumnWidths = LoadResource(g_hInst, hColumnWidthsRsrc);
00181     pnColumnWidths = (unsigned short *)LockResource(hColumnWidths);
00182
00183     //initialize the columns
00184     nListWidth = 0;
00185     lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
00186     lvColumn.fmt = LVCFMT_LEFT;
00187     for(i = 0; i < nColumns; i++)
00188     {
00189         /* adjust the size of each column */
00190         lvColumn.cx = pnColumnWidths[i];
00191
00192         /* accumulate width of columns and their seperations */
00193         nListWidth += pnColumnWidths[i] +1;
00194
00195         LoadString(g_hInst, IDS_COLUMN1+i, szheading, ColumnHeadingSize+1);
00196         lvColumn.pszText = szheading;
00197         ListView_InsertColumn(hwndListView, i, &lvColumn);
00198     }
00199
00200     /* Resize the window */
00201     GetWindowRect(hwndListView, &rcWindow);
00202     MoveWindow(hwndListView,
00203                rcWindow.left,
00204                rcWindow.top,
00205                nListWidth,
00206                (rcWindow.bottom-rcWindow.top),
00207                FALSE);
00208
00209
00210     return TRUE;
00211
00212 } /* end of function InitQueList */
00213
00214
00215 /****************************************************************************
00216
00217     FUNCTION:   SetQueListContents( HWND, QUEUEDATA * )
00218
00219
00220     PURPOSE:   SetQueListContents does a minimal update of cells of the
00221                ListView common control.
00222
00223     COMMENTS:
00224
00225             The QUEUEDATA data structure contains information indicating what
00226             parts of the data it contains has changed. This information is used
00227             to make sure that we change only those ListView items that need to
00228             be updated.
00229
00230 ****************************************************************************/
00231
00232 void SetQueListContents(HWND hwndListView, QUEUEDATA *pQueue)
00233 {
00234     LV_ITEM         lvItem;
00235     unsigned int    i,          // Rows
00236                     j,          // Columns
00237                     nItems;     // Initial # of lines in the list view
00238
00239     SendMessage(hwndListView, WM_SETREDRAW, FALSE, 0);
00240
00241     /*
00242      * find out how many items already in the list view
00243      * that we can reuse.
00244      */
00245     nItems = ListView_GetItemCount(hwndListView);
00246
00247     for(i = 0; i < pQueue->nJobs; i++)
00248     {
00249         /* refresh listbox contents */
00250
00251         /* setup for the Row */
00252         lvItem.mask = LVIF_TEXT;
00253         lvItem.iImage = 0;
00254         lvItem.iItem = i;
00255
00256         for (j=0; j< *g_pnColumns; j++)
00257         {
00258             if (IsChanged(&pQueue->pJobs[i], (WORD)j))
00259             {
00260                 /* fill in the LV_ITEM structure for the item */
00261                 lvItem.pszText = GetColumnData(&pQueue->pJobs[i], (unsigned short)j);
00262                 lvItem.iSubItem = j;
00263
00264                 /* while we can reuse items, use SetItem for subitems */
00265                 if (!j && i >= nItems)
00266                     ListView_InsertItem(hwndListView, &lvItem);
00267                 else
00268                     ListView_SetItem(hwndListView, &lvItem);
00269
00270                 // we own the string passed back from GetColumnData
00271                 free (lvItem.pszText);
00272             }
00273
00274         }
00275
00276         // Mark everything as current
00277         ClearChanges(&pQueue->pJobs[i]);
00278
00279     }
00280
00281     /* If the list shrunk, delete any remaining items. */
00282     for (; i < nItems; i++)
00283     {
00284         ListView_DeleteItem(hwndListView, i);
00285     }
00286
00287     /* Update the window */
00288     SendMessage(hwndListView, WM_SETREDRAW, TRUE, 0);
00289     InvalidateRect(hwndListView, NULL, FALSE);
00290
00291 } /* end of function SetQueListContents */
00292
00293
00294 /****************************************************************************
00295
00296     FUNCTION:   ResizeWindowToControlWidth( HWND hWnd, HWND hWndControl )
00297
00298
00299     PURPOSE:   Resizes the parent Window so that the client area is the right
00300                size to contain the ListView common control as configured.
00301
00302     COMMENTS:
00303
00304
00305 ****************************************************************************/
00306
00307 void ResizeWindowToControlWidth(HWND hWnd, HWND hWndControl)
00308 {
00309     RECT    rcWindow, rcClient;
00310
00311     /* Set required client area to accomodate our columns */
00312     GetClientRect(hWnd, &rcClient);
00313     GetWindowRect(hWndControl, &rcWindow);
00314     rcClient.right = rcClient.left + (rcWindow.right - rcWindow.left);
00315
00316     /* Calculate the window size to accomodate the Client size */
00317     AdjustWindowRect(&rcClient, WS_OVERLAPPEDWINDOW, TRUE);
00318     GetWindowRect(hWnd, &rcWindow);
00319
00320     /* New Width and old Height */
00321     rcWindow.bottom = (rcClient.bottom-rcClient.top);
00322     rcWindow.right = (rcClient.right-rcClient.left);
00323
00324     /* Adjust the window size */
00325     MoveWindow(hWnd,
00326                rcWindow.left,
00327                rcWindow.top,
00328                rcWindow.right,
00329                rcWindow.bottom,
00330                FALSE);
00331
00332 } /* end of function ResizeWindowToControlWidth */
00333
00334 /* end of source file QueList.C */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/CeError.Cpp Source File

  • Security
  • CertServices
  • Encode

CeError.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2002
00005 //
00006 // File:        ceerror.cpp
00007 //
00008 // Contents:    Cert Server error wrapper routines
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include <pch.cpp>
00013
00014 #pragma hdrstop
00015
00016 #include "celib.h"
00017 #include <assert.h>
00018 #include <ntdsbmsg.h>
00019 #include <delayimp.h>
00020 #include <wininet.h>
00021
00022 #define CERTLIB_12BITERRORMASK  0x00000fff
00023 #define CERTLIB_WIN32ERRORMASK  0x0000ffff
00024
00025
00026 //+--------------------------------------------------------------------------
00027 // Jet errors:
00028
00029 #define HRESULT_FROM_JETWARNING(jerr) \
00030         (ERROR_SEVERITY_WARNING | (FACILITY_NTDSB << 16) | jerr)
00031
00032 #define HRESULT_FROM_JETERROR(jerr) \
00033         (ERROR_SEVERITY_ERROR | (FACILITY_NTDSB << 16) | -jerr)
00034
00035 #define JETERROR_FROM_HRESULT(hr) \
00036         (-(LONG) (CERTLIB_WIN32ERRORMASK & (hr)))
00037
00038 #define ISJETERROR(hr) \
00039         ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) ~CERTLIB_WIN32ERRORMASK)
00040
00041 #define ISJETHRESULT(hr) \
00042     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_ERROR | \
00043                 (FACILITY_NTDSB << 16)))
00044
00045 #define wszJETERRORPREFIX       L"ESE"
00046
00047
00048 //+--------------------------------------------------------------------------
00049 // Setup API errors:
00050
00051 #define ISSETUPHRESULT(hr) \
00052     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_ERROR | \
00053                                               APPLICATION_ERROR_MASK | \
00054                                               (FACILITY_NULL << 16)))
00055
00056 #define wszSETUPERRORPREFIX       L"INF"
00057
00058
00059 //+--------------------------------------------------------------------------
00060 // Win32 errors:
00061
00062 #define ISWIN32ERROR(hr) \
00063         ((~CERTLIB_WIN32ERRORMASK & (hr)) == 0)
00064
00065 #define ISWIN32HRESULT(hr) \
00066     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_WARNING | \
00067                 (FACILITY_WIN32 << 16)))
00068
00069 #define WIN32ERROR_FROM_HRESULT(hr) \
00070         (CERTLIB_WIN32ERRORMASK & (hr))
00071
00072 #define wszWIN32ERRORPREFIX     L"WIN32"
00073
00074
00075 //+--------------------------------------------------------------------------
00076 // Http errors:
00077
00078 #define ISHTTPERROR(hr) \
00079     ((HRESULT) HTTP_STATUS_FIRST <= (hr) && (HRESULT) HTTP_STATUS_LAST >= (hr))
00080
00081 #define ISHTTPHRESULT(hr) \
00082     (ISWIN32HRESULT(hr) && ISHTTPERROR(WIN32ERROR_FROM_HRESULT(hr)))
00083
00084 #define wszHTTPERRORPREFIX     L"HTTP"
00085
00086
00087 //+--------------------------------------------------------------------------
00088 // Delayload errors:
00089
00090 #define DELAYLOAD_FROM_WIN32(hr)  VcppException(ERROR_SEVERITY_ERROR, (hr))
00091
00092 #define WIN32ERROR_FROM_DELAYLOAD(hr)  (CERTLIB_WIN32ERRORMASK & (hr))
00093
00094 #define ISDELAYLOADHRESULTFACILITY(hr) \
00095     ((~CERTLIB_WIN32ERRORMASK & (hr)) == (HRESULT) (ERROR_SEVERITY_ERROR | \
00096                                               (FACILITY_VISUALCPP << 16)))
00097
00098 // E_DELAYLOAD_MOD_NOT_FOUND    0xc06d007e
00099 #define E_DELAYLOAD_MOD_NOT_FOUND   DELAYLOAD_FROM_WIN32(ERROR_MOD_NOT_FOUND)
00100
00101 // E_DELAYLOAD_PROC_NOT_FOUND   0xc06d007f
00102 #define E_DELAYLOAD_PROC_NOT_FOUND  DELAYLOAD_FROM_WIN32(ERROR_PROC_NOT_FOUND)
00103
00104 #define ISDELAYLOADHRESULT(hr) \
00105         ((HRESULT) E_DELAYLOAD_MOD_NOT_FOUND == (hr) || \
00106          (HRESULT) E_DELAYLOAD_PROC_NOT_FOUND == (hr) || \
00107          HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND) == (hr) || \
00108          HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND) == (hr))
00109
00110
00111 //+--------------------------------------------------------------------------
00112 // ASN encoding errors:
00113
00114 #define ISOSSERROR(hr) \
00115         ((~CERTLIB_12BITERRORMASK & (hr)) == CRYPT_E_OSS_ERROR)
00116
00117 #define OSSERROR_FROM_HRESULT(hr) \
00118         (CERTLIB_12BITERRORMASK & (hr))
00119
00120 #define wszOSSERRORPREFIX       L"ASN"
00121
00122
00123 HRESULT
00124 ceJetHResult(
00125     IN HRESULT hr)
00126 {
00127     if (S_OK != hr)
00128     {
00129         if (SUCCEEDED(hr))
00130         {
00131 #if 0
00132             hr = HRESULT_FROM_JETWARNING(hr);
00133 #else
00134             if (S_FALSE != hr)
00135             {
00136                 _PrintError(hr, "JetHResult: mapping to S_FALSE");
00137             }
00138             assert(S_FALSE == hr);
00139             hr = S_FALSE;
00140 #endif
00141         }
00142         else if (ISJETERROR(hr))
00143         {
00144             hr = HRESULT_FROM_JETERROR(hr);
00145         }
00146     }
00147     assert(S_OK == hr || S_FALSE == hr || FAILED(hr));
00148     return(hr);
00149 }
00150
00151
00152 HRESULT
00153 ceHExceptionCode(
00154     IN EXCEPTION_POINTERS const *pep)
00155 {
00156     HRESULT hr = pep->ExceptionRecord->ExceptionCode;
00157
00158 #if (0 == i386)
00159     if ((HRESULT) STATUS_DATATYPE_MISALIGNMENT == hr)
00160     {
00161   hr = CERTSRV_E_ALIGNMENT_FAULT;
00162     }
00163 #endif
00164     return(ceHError(hr));
00165 }
00166
00167
00168 BOOL
00169 ceIsDelayLoadHResult(
00170     IN HRESULT hr)
00171 {
00172     return(ISDELAYLOADHRESULT(hr));
00173 }
00174
00175
00176 #define wszCOLONSPACE   L": "
00177
00178 WCHAR const *
00179 ceHResultToStringEx(
00180     IN OUT WCHAR *awchr,
00181     IN HRESULT hr,
00182     IN BOOL fRaw)
00183 {
00184     HRESULT hrd;
00185     WCHAR const *pwszType;
00186
00187     hrd = hr;
00188     pwszType = L"";
00189     if (ISJETERROR(hr))
00190     {
00191         pwszType = wszJETERRORPREFIX wszCOLONSPACE;
00192     }
00193     else if (ISJETHRESULT(hr))
00194     {
00195         hrd = JETERROR_FROM_HRESULT(hr);
00196         pwszType = wszJETERRORPREFIX wszCOLONSPACE;
00197     }
00198     else if (ISOSSERROR(hr))
00199     {
00200         hrd = OSSERROR_FROM_HRESULT(hr);
00201         pwszType = wszOSSERRORPREFIX wszCOLONSPACE;
00202     }
00203     else if (ISHTTPHRESULT(hr) || ISHTTPERROR(hr))
00204     {
00205         hrd = WIN32ERROR_FROM_HRESULT(hr);
00206         pwszType = wszWIN32ERRORPREFIX L"/" wszHTTPERRORPREFIX wszCOLONSPACE;
00207     }
00208     else if (ISWIN32HRESULT(hr) || ISWIN32ERROR(hr))
00209     {
00210         hrd = WIN32ERROR_FROM_HRESULT(hr);
00211         pwszType = wszWIN32ERRORPREFIX wszCOLONSPACE;
00212     }
00213     else if (ISDELAYLOADHRESULTFACILITY(hr))
00214     {
00215         hrd = WIN32ERROR_FROM_DELAYLOAD(hr);
00216         pwszType = wszWIN32ERRORPREFIX wszCOLONSPACE;
00217     }
00218     else if (ISSETUPHRESULT(hr))
00219     {
00220         pwszType = wszSETUPERRORPREFIX wszCOLONSPACE;
00221     }
00222     if (fRaw)
00223     {
00224         pwszType = L"";
00225     }
00226
00227     _snwprintf(
00228         awchr,
00229         cwcHRESULTSTRING,
00230         L"0x%x (%ws%d)",
00231         hr,
00232         pwszType,
00233         hrd);
00234     return(awchr);
00235 }
00236
00237
00238 WCHAR const *
00239 ceHResultToString(
00240     IN OUT WCHAR *awchr,
00241     IN HRESULT hr)
00242 {
00243     return(ceHResultToStringEx(awchr, hr, FALSE));
00244 }
00245
00246
00247 WCHAR const *
00248 ceHResultToStringRaw(
00249     IN OUT WCHAR *awchr,
00250     IN HRESULT hr)
00251 {
00252     return(ceHResultToStringEx(awchr, hr, TRUE));
00253 }
00254
00255
00256 static HMODULE s_hMod = NULL;
00257 static DWORD s_idsUnexpected = 0;
00258 static DWORD s_idsUnknownErrorCode = 0; // L"Error %ws %ws"
00259
00260 VOID
00261 ceInitErrorMessageText(
00262     IN HMODULE hMod,
00263     IN DWORD idsUnexpected,
00264     IN DWORD idsUnknownErrorCode) // L"Error %ws %ws"
00265 {
00266     s_hMod = hMod;
00267     s_idsUnexpected = idsUnexpected;
00268     s_idsUnknownErrorCode = idsUnknownErrorCode;
00269 }
00270
00271
00272 DWORD
00273 errFormatMessage(
00274     IN HMODULE hMod,
00275     IN HRESULT hr,
00276     OUT WCHAR const **ppwszOut,
00277     OPTIONAL IN WCHAR const * const *ppwszArgs)
00278 {
00279     DWORD dwFlags;
00280
00281     dwFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER;
00282     if (NULL == hMod)
00283     {
00284   dwFlags |= FORMAT_MESSAGE_FROM_SYSTEM;
00285     }
00286     else
00287     {
00288   dwFlags |= FORMAT_MESSAGE_FROM_HMODULE;
00289     }
00290     if (NULL == ppwszArgs || NULL == ppwszArgs[0])
00291     {
00292   dwFlags |= FORMAT_MESSAGE_IGNORE_INSERTS;
00293     }
00294     else
00295     {
00296   dwFlags |= FORMAT_MESSAGE_ARGUMENT_ARRAY;
00297     }
00298     return(FormatMessage(
00299     dwFlags,
00300                 hMod,
00301                 hr,
00302                 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
00303                 (WCHAR *) ppwszOut,
00304                 1,
00305     (va_list *) ppwszArgs));
00306 }
00307
00308
00309 // Alloc and return error message string
00310
00311 WCHAR const *
00312 ceGetErrorMessageText(
00313     IN HRESULT hr,
00314     IN BOOL fHResultString)
00315 {
00316     return(ceGetErrorMessageTextEx(hr, fHResultString, NULL));
00317 }
00318
00319
00320 WCHAR const *
00321 ceGetErrorMessageText1(
00322     IN HRESULT hr,
00323     IN BOOL fHResultString,
00324     IN OPTIONAL WCHAR const *pwszInsertionText)
00325 {
00326     WCHAR const *apwszInsertionText[2];
00327     WCHAR const * const *papwsz = NULL;
00328
00329     if (NULL != pwszInsertionText)
00330     {
00331   apwszInsertionText[0] = pwszInsertionText;
00332   apwszInsertionText[1] = NULL;
00333   papwsz = apwszInsertionText;
00334     }
00335     return(ceGetErrorMessageTextEx(hr, fHResultString, papwsz));
00336 }
00337
00338
00339 WCHAR const *
00340 ceGetErrorMessageTextEx(
00341     IN HRESULT hr,
00342     IN BOOL fHResultString,
00343     IN OPTIONAL WCHAR const * const *papwszInsertionText)
00344 {
00345     WCHAR const *pwszRet = NULL;
00346     WCHAR const *pwszRetStatic = NULL;
00347     WCHAR *pwszMsgT;
00348     WCHAR awchr[cwcHRESULTSTRING];
00349     DWORD cwc;
00350     DWORD cwcCopy;
00351     DWORD cwcUnexpected;
00352     WCHAR const *pwszUnexpected = NULL;
00353     WCHAR wszEmpty[] = L"";
00354     HMODULE hMod1 = NULL;
00355     HMODULE hMod2 = NULL;
00356
00357     if (E_UNEXPECTED == hr)
00358     {
00359   pwszUnexpected = L"Unexpected method call sequence.";
00360     }
00361 #if (0 == i386)
00362     else if (STATUS_DATATYPE_MISALIGNMENT == hr)
00363     {
00364   pwszUnexpected = L"Possible data alignment fault.";
00365     }
00366 #endif
00367     if (NULL == pwszUnexpected)
00368     {
00369   pwszUnexpected = wszEmpty;
00370     }
00371     cwcUnexpected = wcslen(pwszUnexpected);
00372
00373     cwc = errFormatMessage(NULL, hr, &pwszRet, papwszInsertionText);
00374     if (0 == cwc && ISDELAYLOADHRESULTFACILITY(hr))
00375     {
00376   cwc = errFormatMessage(
00377       NULL,
00378       WIN32ERROR_FROM_DELAYLOAD(hr),
00379       &pwszRet,
00380       papwszInsertionText);
00381     }
00382     if (0 == cwc)
00383     {
00384         hMod1 = LoadLibrary(L"ntdsbmsg.dll");
00385         if (NULL != hMod1)
00386         {
00387             HRESULT hrEDB = hr;
00388             HRESULT hrFormat;
00389             BOOL fFirst = TRUE;
00390
00391             while (TRUE)
00392             {
00393                 cwc = errFormatMessage(hMod1, hrEDB, &pwszRet, papwszInsertionText);
00394                 if (0 == cwc && FAILED(hrEDB) && fFirst)
00395                 {
00396                     hrFormat = ceHLastError();
00397                     if (HRESULT_FROM_WIN32(ERROR_MR_MID_NOT_FOUND) == hrFormat)
00398                     {
00399                         hrEDB = ceJetHResult(hrEDB);
00400                         if (hrEDB != hr)
00401                         {
00402                             fFirst = FALSE;
00403                             continue;
00404                         }
00405                     }
00406                 }
00407                 break;
00408             }
00409         }
00410     }
00411     if (0 == cwc)
00412     {
00413   HMODULE hModT = GetModuleHandle(L"wininet.dll");
00414         if (NULL != hModT)
00415         {
00416             HRESULT hrHttp = hr;
00417             HRESULT hrFormat;
00418             BOOL fFirst = TRUE;
00419
00420             while (TRUE)
00421             {
00422     cwc = errFormatMessage(hModT, hrHttp, &pwszRet, papwszInsertionText);
00423                 if (0 == cwc && ISWIN32HRESULT(hrHttp) && fFirst)
00424                 {
00425                     hrFormat = ceHLastError();
00426                     if (HRESULT_FROM_WIN32(ERROR_MR_MID_NOT_FOUND) == hrFormat)
00427                     {
00428       hrHttp = WIN32ERROR_FROM_HRESULT(hrHttp);
00429                         if (hrHttp != hr)
00430                         {
00431                             fFirst = FALSE;
00432                             continue;
00433                         }
00434                     }
00435                 }
00436                 break;
00437             }
00438         }
00439     }
00440     if (0 == cwc)
00441     {
00442         hMod2 = LoadLibrary(L"cdosys.dll");
00443         if (NULL != hMod2)
00444         {
00445       cwc = errFormatMessage(hMod2, hr, &pwszRet, papwszInsertionText);
00446         }
00447     }
00448
00449     if (0 == cwc) // couldn't find error, use default & error code
00450     {
00451   fHResultString = TRUE;
00452     }
00453     awchr[0] = L'\0';
00454     if (fHResultString)
00455     {
00456   ceHResultToString(awchr, hr);
00457     }
00458
00459     if (0 == cwc)
00460     {
00461   pwszRetStatic = L"Error";
00462   pwszRet = pwszRetStatic;
00463     }
00464
00465     // strip trailing \r\n
00466
00467     cwcCopy = wcslen(pwszRet);
00468     if (2 <= cwcCopy &&
00469   L'\r' == pwszRet[cwcCopy - 2] &&
00470   L'\n' == pwszRet[cwcCopy - 1])
00471     {
00472   cwcCopy -= 2;
00473     }
00474     cwc = cwcCopy + 1 + cwcUnexpected + 1 + wcslen(awchr) + 1;
00475     pwszMsgT = (WCHAR *) LocalAlloc(LMEM_FIXED, cwc * sizeof(WCHAR));
00476     if (NULL == pwszMsgT)
00477     {
00478   _JumpError(E_OUTOFMEMORY, error, "LocalAlloc");
00479     }
00480     CopyMemory(pwszMsgT, pwszRet, cwcCopy * sizeof(WCHAR));
00481     pwszMsgT[cwcCopy] = L'\0';
00482
00483     if (0 != cwcUnexpected)
00484     {
00485   wcscat(pwszMsgT, L" ");
00486   wcscat(pwszMsgT, pwszUnexpected);
00487     }
00488     if (fHResultString)
00489     {
00490   wcscat(pwszMsgT, L" ");
00491   wcscat(pwszMsgT, awchr);
00492     }
00493     assert(wcslen(pwszMsgT) < cwc);
00494     if (NULL != pwszRet && pwszRetStatic != pwszRet)
00495     {
00496   LocalFree(const_cast<WCHAR *>(pwszRet));
00497     }
00498     pwszRet = pwszMsgT;
00499
00500 error:
00501     if (NULL != hMod1)
00502     {
00503         FreeLibrary(hMod1);
00504     }
00505     if (NULL != hMod2)
00506     {
00507         FreeLibrary(hMod2);
00508     }
00509     return(pwszRet);
00510 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/CapJ/about.java Source File

  • Web
  • MSAgent
  • Java
  • CapJ

about.java

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright (C) 1997-1998 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //==========================================================================
00011
00012 import com.ms.wfc.app.*;
00013 import com.ms.wfc.core.*;
00014 import com.ms.wfc.ui.*;
00015
00016 public class About extends Form
00017 {
00018   private void okButton_click(Object sender, Event e)
00019   {
00020     this.setDialogResult(DialogResult.OK);
00021   }
00022
00023   public About()
00024   {
00025     super();
00026
00027     initForm();
00028   }
00029
00030   public void dispose()
00031   {
00032     super.dispose();
00033     components.dispose();
00034   }
00035
00036   Container components = new Container();
00037   Button okButton = new Button();
00038   Label titleLabel = new Label();
00039   Label versionLabel = new Label();
00040   Label nameLabel = new Label();
00041
00042   private void initForm()
00043   {
00044     okButton.setLocation(new Point(224, 16));
00045     okButton.setSize(new Point(84, 23));
00046     okButton.setTabIndex(0);
00047     okButton.setText("OK");
00048     okButton.addOnClick(new EventHandler(this.okButton_click));
00049
00050     this.setText("About Microsoft Character Animation Previewer");
00051     this.setAcceptButton(okButton);
00052     this.setAutoScaleBaseSize(new Point(5, 13));
00053     this.setBorderStyle(FormBorderStyle.FIXED_TOOLWINDOW);
00054     this.setCancelButton(okButton);
00055     this.setClientSize(new Point(324, 85));
00056     this.setMaximizeBox(false);
00057     this.setMinimizeBox(false);
00058     this.setStartPosition(FormStartPosition.CENTER_SCREEN);
00059
00060     titleLabel.setLocation(new Point(10, 10));
00061     titleLabel.setSize(new Point(192, 16));
00062     titleLabel.setTabIndex(1);
00063     titleLabel.setTabStop(false);
00064     titleLabel.setText("Microsoft Character Animation Previewer");
00065
00066     versionLabel.setLocation(new Point(8, 56));
00067     versionLabel.setSize(new Point(64, 16));
00068     versionLabel.setTabIndex(2);
00069     versionLabel.setTabStop(false);
00070     versionLabel.setText("Version 1.00");
00071
00072     nameLabel.setLocation(new Point(8, 32));
00073     nameLabel.setSize(new Point(192, 16));
00074     nameLabel.setTabIndex(3);
00075     nameLabel.setTabStop(false);
00076     nameLabel.setText("Copyright (C) 1998 Microsoft Corporation");
00077
00078     this.setNewControls(new Control[] {
00079               nameLabel,
00080               versionLabel,
00081               titleLabel,
00082               okButton});
00083   }
00084
00085   public static void main(String args[])
00086   {
00087     Application.run(new About());
00088   }
00089 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceDmp/tracedmp.cpp Source File

  • WinBase
  • EventTrace
  • TraceDmp

tracedmp.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 Module Name:
00006
00007     tracedmp.cpp
00008
00009 Abstract:
00010
00011     Sample trace consumer program. Converts binary Event Trace Log (ETL) to CSV format.
00012
00013     Aside from various printing routines for dumping event data and writing summary,
00014     three functions need mentioning. main() parses command line and calls OpenTrace(),
00015     ProcessTrace(), and CloseTrace(). BufferCallback() is for BufferCallback and
00016     simply counts the number of buffers processed. Finally, DumpEvent() is the
00017     EventCallback function in this sample that writes event data into a dumpfile.
00018
00019     Important Notes:
00020
00021     Event Tracing API for trace consumption (OpenTrace, ProcessTrace, CloseTrace,...)
00022     are straightforward and easy to use. Hence, getting an event back is simple.
00023     However, another important aspect of trace consumption is event decoding, which
00024     requires event layout information. This information may be known in advance and
00025     hard coded in an event consumer, but we rely on WMI name space for storing event
00026     layout information. This requires extensive WMI interface just to get the layout.
00027
00028     We placed all the routines needed for getting layout information in a separate
00029     file (tracewmi.cpp). The only two functions exported from this file are
00030     GetMofInfoHead() and RemoveMofInfo(). GetMofInfoHead() is the one that returns
00031     MOF_INFO with the proper layout information. RemoveMofInfo() is used only for
00032     cleaning up cached event list.
00033
00034     We hope this helps readers understand two separate issues in this samples:
00035     event tracing APIs and WMI interface.
00036
00037 --*/
00038 #include "tracedmp.h"
00039
00040 extern
00041 PMOF_INFO
00042 GetMofInfoHead(
00043     GUID Guid,
00044     SHORT  nType,
00045     SHORT nVersion,
00046     CHAR  nLevel
00047 );
00048
00049 extern
00050 void
00051 RemoveMofInfo(
00052     PLIST_ENTRY pMofInfo
00053 );
00054
00055 // Simple check on a trace file.
00056 ULONG
00057 CheckFile(
00058     LPTSTR fileName
00059 );
00060
00061 // BufferCallback function.
00062 ULONG
00063 WINAPI
00064 BufferCallback(
00065     PEVENT_TRACE_LOGFILE pLog
00066 );
00067
00068 // EventCallback function in this sample.
00069 void
00070 WINAPI
00071 DumpEvent(
00072     PEVENT_TRACE pEvent
00073 );
00074
00075 // Print functions
00076 void
00077 PrintSummary();
00078
00079 void
00080 PrintDumpHeader();
00081
00082 void
00083 PrintEvent(
00084     PEVENT_TRACE pEvent,
00085     PMOF_INFO pMofInfo
00086     );
00087
00088 // Other helper functions.
00089 void
00090 GuidToString(
00091     PTCHAR s,
00092     LPGUID piid
00093 );
00094
00095 void
00096 PrintHelpMessage();
00097
00098 void
00099 CleanupEventList(
00100     VOID
00101 );
00102
00103 // output files
00104 FILE* DumpFile = NULL;
00105 FILE* SummaryFile = NULL;
00106
00107 static ULONG TotalBuffersRead = 0;
00108 static ULONG TotalEventsLost = 0;
00109 static ULONG TotalEventCount = 0;
00110 static ULONG TimerResolution = 10;
00111
00112 static ULONGLONG StartTime   = 0;
00113 static ULONGLONG EndTime     = 0;
00114 static BOOL   fNoEndTime  = FALSE;
00115 static __int64 ElapseTime;
00116
00117 // Option flags.
00118 BOOLEAN fSummaryOnly  = FALSE;
00119
00120 // Sizeof of a pointer in a file may be different.
00121 ULONG PointerSize = sizeof(PVOID) * 8;
00122
00123 // log files
00124 PEVENT_TRACE_LOGFILE EvmFile[MAXLOGFILES];
00125 ULONG LogFileCount = 0;
00126
00127 // IF the events are from a private logger, we need to make some adjustment.
00128 BOOL bUserMode = FALSE;
00129
00130 // Global head for event layout linked list
00131 PLIST_ENTRY EventListHead = NULL;
00132
00133 int __cdecl main (int argc, LPTSTR* argv)
00134 /*++
00135
00136 Routine Description:
00137
00138     It is the main function.
00139
00140 Arguments:
00141 Usage: tracedmp [options]  <EtlFile1 EtlFile2 ...>| [-h | -? | -help]
00142         -o <file>          Output CSV file
00143         -rt [LoggerName]   Realtime tracedmp from the logger [LoggerName]
00144         -summary           Summary.txt only
00145         -h
00146         -help
00147         -?                 Display usage information
00148
00149 Return Value:
00150
00151     Error Code defined in winerror.h : If the function succeeds,
00152                 it returns ERROR_SUCCESS (== 0).
00153
00154 --*/
00155 {
00156     TCHAR DumpFileName[MAXSTR];
00157     TCHAR SummaryFileName[MAXSTR];
00158
00159     LPTSTR *targv;
00160
00161 #ifdef UNICODE
00162     LPTSTR *cmdargv;
00163 #endif
00164
00165     PEVENT_TRACE_LOGFILE pLogFile;
00166     ULONG Status = ERROR_SUCCESS;
00167     ULONG i, j;
00168     TRACEHANDLE HandleArray[MAXLOGFILES];
00169
00170 #ifdef UNICODE
00171     if ((cmdargv = CommandLineToArgvW(
00172                         GetCommandLineW(),  // pointer to a command-line string
00173                         &argc               // receives the argument count
00174                         )) == NULL)
00175     {
00176         return(GetLastError());
00177     };
00178     targv = cmdargv ;
00179 #else
00180     targv = argv;
00181 #endif
00182
00183     _tcscpy(DumpFileName, DUMP_FILE_NAME);
00184     _tcscpy(SummaryFileName, SUMMARY_FILE_NAME);
00185
00186     while (--argc > 0) {
00187         ++targv;
00188         if (**targv == '-' || **targv == '/') {  // argument found
00189             if( **targv == '/' ){
00190                 **targv = '-';
00191             }
00192
00193             if ( !_tcsicmp(targv[0], _T("-summary")) ) {
00194                 fSummaryOnly = TRUE;
00195             }
00196             else if (targv[0][1] == 'h' || targv[0][1] == 'H'
00197                                        || targv[0][1] == '?')
00198             {
00199                 PrintHelpMessage();
00200                 return ERROR_SUCCESS;
00201             }
00202             else if ( !_tcsicmp(targv[0], _T("-rt")) ) {
00203                 TCHAR LoggerName[MAXSTR];
00204                 _tcscpy(LoggerName, KERNEL_LOGGER_NAME);
00205                 if (argc > 1) {
00206                    if (targv[1][0] != '-' && targv[1][0] != '/') {
00207                        ++targv; --argc;
00208                        _tcscpy(LoggerName, targv[0]);
00209                    }
00210                 }
00211
00212                 pLogFile = (PEVENT_TRACE_LOGFILE) malloc(sizeof(EVENT_TRACE_LOGFILE));
00213                 if (pLogFile == NULL){
00214                     _tprintf(_T("Allocation Failure\n"));
00215                     Status = ERROR_OUTOFMEMORY;
00216                     goto cleanup;
00217                 }
00218                 RtlZeroMemory(pLogFile, sizeof(EVENT_TRACE_LOGFILE));
00219                 EvmFile[LogFileCount] = pLogFile;
00220
00221                 EvmFile[LogFileCount]->LogFileName = NULL;
00222                 EvmFile[LogFileCount]->LoggerName =
00223                     (LPTSTR) malloc(MAXSTR * sizeof(TCHAR));
00224
00225                 if (EvmFile[LogFileCount]->LoggerName == NULL) {
00226                     _tprintf(_T("Allocation Failure\n"));
00227                     Status = ERROR_OUTOFMEMORY;
00228                     goto cleanup;
00229                 }
00230                 _tcscpy(EvmFile[LogFileCount]->LoggerName, LoggerName);
00231
00232                 _tprintf(_T("Setting RealTime mode for  %s\n"),
00233                         EvmFile[LogFileCount]->LoggerName);
00234
00235                 EvmFile[LogFileCount]->Context = NULL;
00236                 EvmFile[LogFileCount]->BufferCallback = BufferCallback;
00237                 EvmFile[LogFileCount]->BuffersRead = 0;
00238                 EvmFile[LogFileCount]->CurrentTime = 0;
00239                 EvmFile[LogFileCount]->EventCallback = &DumpEvent;
00240                 EvmFile[LogFileCount]->LogFileMode = EVENT_TRACE_REAL_TIME_MODE;
00241                 LogFileCount++;
00242             }
00243             else if ( !_tcsicmp(targv[0], _T("-o")) ) {
00244                 if (argc > 1) {
00245                     if (targv[1][0] != '-' && targv[1][0] != '/') {
00246                         TCHAR drive[10];
00247                         TCHAR path[MAXSTR];
00248                         TCHAR file[MAXSTR];
00249                         TCHAR ext[MAXSTR];
00250                         ++targv; --argc;
00251
00252                         _tfullpath(DumpFileName, targv[0], MAXSTR);
00253                         _tsplitpath( DumpFileName, drive, path, file, ext );
00254                         _tcscpy(ext,_T("csv"));
00255                         _tmakepath( DumpFileName, drive, path, file, ext );
00256                         _tcscpy(ext,_T("txt"));
00257                         _tmakepath( SummaryFileName, drive, path, file, ext );
00258                     }
00259                 }
00260             }
00261         }
00262         else {
00263             pLogFile = (PEVENT_TRACE_LOGFILE) malloc(sizeof(EVENT_TRACE_LOGFILE));
00264             if (pLogFile == NULL){
00265                 _tprintf(_T("Allocation Failure\n"));
00266                 Status = ERROR_OUTOFMEMORY;
00267                 goto cleanup;
00268             }
00269             RtlZeroMemory(pLogFile, sizeof(EVENT_TRACE_LOGFILE));
00270             EvmFile[LogFileCount] = pLogFile;
00271
00272             EvmFile[LogFileCount]->LoggerName = NULL;
00273             EvmFile[LogFileCount]->LogFileName =
00274                 (LPTSTR) malloc(MAXSTR*sizeof(TCHAR));
00275             if (EvmFile[LogFileCount]->LogFileName == NULL) {
00276                 _tprintf(_T("Allocation Failure\n"));
00277                 Status = ERROR_OUTOFMEMORY;
00278                 goto cleanup;
00279             }
00280
00281             _tfullpath(EvmFile[LogFileCount]->LogFileName, targv[0], MAXSTR);
00282             _tprintf(_T("Setting log file to: %s\n"),
00283                      EvmFile[LogFileCount]->LogFileName);
00284             // If one of the log files is not readable, exit.
00285             if (!CheckFile(EvmFile[LogFileCount]->LogFileName)) {
00286                 _tprintf(_T("Cannot open logfile for reading\n"));
00287                 Status = ERROR_INVALID_PARAMETER;
00288                 goto cleanup;
00289             }
00290             EvmFile[LogFileCount]->Context = NULL;
00291             EvmFile[LogFileCount]->BufferCallback = BufferCallback;
00292             EvmFile[LogFileCount]->BuffersRead = 0;
00293             EvmFile[LogFileCount]->CurrentTime = 0;
00294             EvmFile[LogFileCount]->EventCallback = &DumpEvent;
00295             LogFileCount++;
00296         }
00297     }
00298
00299     if (LogFileCount <= 0) {
00300         PrintHelpMessage();
00301         return Status;
00302     }
00303
00304     // OpenTrace calls
00305     for (i = 0; i < LogFileCount; i++) {
00306         TRACEHANDLE x;
00307
00308         x = OpenTrace(EvmFile[i]);
00309         HandleArray[i] = x;
00310         if (HandleArray[i] == 0) {
00311             Status = GetLastError();
00312             _tprintf(_T("Error Opening Trace %d with status=%d\n"),
00313                                                            i, Status);
00314
00315             for (j = 0; j < i; j++)
00316                 CloseTrace(HandleArray[j]);
00317             goto cleanup;
00318         }
00319     }
00320
00321     // Open files.
00322     if (!fSummaryOnly)
00323     {
00324         DumpFile = _tfopen(DumpFileName, _T("w"));
00325         if (DumpFile == NULL) {
00326             Status = ERROR_INVALID_PARAMETER;
00327             _tprintf(_T("DumpFile is NULL\n"));
00328             goto cleanup;
00329         }
00330     }
00331     SummaryFile = _tfopen(SummaryFileName, _T("w"));
00332     if (SummaryFile == NULL) {
00333         Status = ERROR_INVALID_PARAMETER;
00334         _tprintf(_T("SummaryFile is NULL\n"));
00335         goto cleanup;
00336     }
00337
00338     if (!fSummaryOnly)
00339     {
00340         PrintDumpHeader();
00341     }
00342
00343     // At this point, users can set a different trace callback function for
00344     // a specific GUID using SetTraceCallback(). Also RemoveTraceCallback() allows
00345     // users to remove a callback function for a specific GUID. In this way, users
00346     // can customize callbacks based on GUIDs.
00347
00348     // Actual processing takes place here. EventCallback function will be invoked
00349     // for each event.
00350     // We do not use start and end time parameters in this sample.
00351     Status = ProcessTrace(
00352             HandleArray,
00353             LogFileCount,
00354             NULL,
00355             NULL
00356             );
00357
00358     if (Status != ERROR_SUCCESS) {
00359         _tprintf(_T("Error processing with status=%dL (GetLastError=0x%x)\n"),
00360                 Status, GetLastError());
00361     }
00362
00363     for (j = 0; j < LogFileCount; j++){
00364         Status = CloseTrace(HandleArray[j]);
00365         if (Status != ERROR_SUCCESS) {
00366             _tprintf(_T("Error Closing Trace %d with status=%d\n"), j, Status);
00367         }
00368     }
00369
00370     // Write summary.
00371     PrintSummary();
00372
00373 cleanup:
00374     if (!fSummaryOnly && DumpFile != NULL)  {
00375         _tprintf(_T("Event traces dumped to %s\n"), DumpFileName);
00376         fclose(DumpFile);
00377     }
00378
00379     if(SummaryFile != NULL){
00380         _tprintf(_T("Event Summary dumped to %s\n"), SummaryFileName);
00381         fclose(SummaryFile);
00382     }
00383
00384     for (i = 0; i < LogFileCount; i ++)
00385     {
00386         if (EvmFile[i]->LoggerName != NULL)
00387         {
00388             free(EvmFile[i]->LoggerName);
00389             EvmFile[i]->LoggerName = NULL;
00390         }
00391         if (EvmFile[i]->LogFileName != NULL)
00392         {
00393             free(EvmFile[i]->LogFileName);
00394             EvmFile[i]->LogFileName = NULL;
00395         }
00396         free(EvmFile[i]);
00397     }
00398 #ifdef UNICODE
00399     GlobalFree(cmdargv);
00400 #endif
00401
00402     SetLastError(Status);
00403     if(Status != ERROR_SUCCESS ){
00404         _tprintf(_T("Exit Status: %d\n"), Status);
00405     }
00406
00407     return Status;
00408 }
00409
00410 ULONG
00411 WINAPI
00412 BufferCallback(
00413     PEVENT_TRACE_LOGFILE pLog
00414     )
00415 /*++
00416
00417 Routine Description:
00418
00419     Callback method for processing a buffer. Does not do anything but
00420     updating global counters.
00421
00422 Arguments:
00423
00424     pLog - Pointer to a log file.
00425
00426 Return Value:
00427
00428     Always TRUE.
00429
00430 --*/
00431 {
00432     TotalBuffersRead++;
00433     return (TRUE);
00434 }
00435
00436 void
00437 WINAPI
00438 DumpEvent(
00439     PEVENT_TRACE pEvent
00440 )
00441 /*++
00442
00443 Routine Description:
00444
00445     Callback method for processing an event. It obtains the layout
00446     information by calling GetMofInfoHead(), which returns the pointer
00447     to the PMOF_INFO corresponding to the event type. Then it writes
00448     to the output file.
00449
00450     NOTE: Only character arrays are supported in this program.
00451
00452 Arguments:
00453
00454     pEvent - Pointer to an event.
00455
00456 Return Value:
00457
00458     None.
00459
00460 --*/
00461 {
00462     PEVENT_TRACE_HEADER pHeader;
00463     PMOF_INFO pMofInfo;
00464
00465     TotalEventCount++;
00466
00467     if (pEvent == NULL) {
00468         _tprintf(_T("Warning: Null Event\n"));
00469         return;
00470     }
00471
00472     pHeader = (PEVENT_TRACE_HEADER) &pEvent->Header;
00473
00474     // Extrace log file information if the event is a log file header.
00475     if( IsEqualGUID(&(pEvent->Header.Guid), &EventTraceGuid) &&
00476         pEvent->Header.Class.Type == EVENT_TRACE_TYPE_INFO ) {
00477
00478         PTRACE_LOGFILE_HEADER head = (PTRACE_LOGFILE_HEADER)pEvent->MofData;
00479         if( NULL != head ){
00480             if(head->TimerResolution > 0){
00481                 TimerResolution = head->TimerResolution / 10000;
00482             }
00483
00484             StartTime  = head->StartTime.QuadPart;
00485             EndTime    = head->EndTime.QuadPart;
00486             // If ProcessTrace() call was made on areal time logger or an trace file being
00487             // logged, EndTime amy be 0.
00488             fNoEndTime = (EndTime == 0);
00489
00490             TotalEventsLost += head->EventsLost;
00491
00492             // We use global flags for private logger and pointer size.
00493             // This may cause an error when trace files are from different environments.
00494             bUserMode = (head->LogFileMode & EVENT_TRACE_PRIVATE_LOGGER_MODE);
00495
00496             // Set pointer size
00497             PointerSize =  head->PointerSize * 8;
00498             if (PointerSize != 64){
00499                 PointerSize = 32;
00500             }
00501         }
00502     }
00503
00504     // if EndTime is missing from one of the files, keep updating to get the largest value.
00505     if (fNoEndTime && EndTime < (ULONGLONG) pHeader->TimeStamp.QuadPart) {
00506         EndTime = pHeader->TimeStamp.QuadPart;
00507     }
00508
00509     // Find the MOF information for this event. This will retrieve the layout
00510     // information from WMI fi we don't already have it in our list.
00511     pMofInfo = GetMofInfoHead (
00512             pEvent->Header.Guid,
00513             pEvent->Header.Class.Type,
00514             pEvent->Header.Class.Version,
00515             pEvent->Header.Class.Level
00516         );
00517
00518     if( NULL == pMofInfo ){
00519         // Could not locate event layout information.
00520         return;
00521     }
00522
00523     pMofInfo->EventCount++;
00524
00525     if( fSummaryOnly == TRUE ){
00526         return;
00527     }
00528     // At this point, pEvent and pMofInfo are not NULL. No need to check in PrintEvent().
00529     PrintEvent(pEvent, pMofInfo);
00530
00531 }
00532
00533 /***************************************************************************************
00534     Various printing and helper function after this point.
00535 ***************************************************************************************/
00536
00537 void PrintDumpHeader()
00538 /*++
00539
00540 Routine Description:
00541
00542     Prints out column headers to a dump file.
00543
00544 Arguments:
00545
00546     None
00547
00548 Return Value:
00549
00550     None
00551
00552 --*/
00553 {
00554     _ftprintf(DumpFile,
00555         _T("%12s, %10s,%7s,%21s,%11s,%11s, User Data\n"),
00556         _T("Event Name"), _T("Type"), _T("TID"), _T("Clock-Time"),
00557         _T("Kernel(ms)"), _T("User(ms)")
00558         );
00559 }
00560
00561 void PrintSummary()
00562 /*++
00563
00564 Routine Description:
00565
00566     Prints out a event summary into a dump file while cleaning the event list.
00567
00568 Arguments:
00569
00570     None
00571
00572 Return Value:
00573
00574     None
00575
00576 --*/
00577 {
00578     ULONG i;
00579
00580     _ftprintf(SummaryFile,_T("Files Processed:\n"));
00581     for (i = 0; i < LogFileCount; i++) {
00582         _ftprintf(SummaryFile, _T("\t%s\n"),EvmFile[i]->LogFileName);
00583     }
00584
00585     ElapseTime = EndTime - StartTime;
00586     _ftprintf(SummaryFile,
00587               _T("Total Buffers Processed %d\n")
00588               _T("Total Events  Processed %d\n")
00589               _T("Total Events  Lost      %d\n")
00590               _T("Start Time              0x%016I64X\n")
00591               _T("End Time                0x%016I64X\n")
00592               _T("Elapsed Time            %I64d sec\n"),
00593               TotalBuffersRead,
00594               TotalEventCount,
00595               TotalEventsLost,
00596               StartTime,
00597               EndTime,
00598               (ElapseTime / 10000000) );
00599
00600     _ftprintf(SummaryFile,
00601        _T("+-------------------------------------------------------------------------------------+\n")
00602        _T("|%10s    %-20s %-10s  %-36s  |\n")
00603        _T("+-------------------------------------------------------------------------------------+\n"),
00604        _T("EventCount"),
00605        _T("EventName"),
00606        _T("EventType"),
00607        _T("Guid")
00608         );
00609
00610     // Print event GUIDs while cleaning up.
00611     CleanupEventList();
00612
00613     _ftprintf(SummaryFile,
00614         _T("+-------------------------------------------------------------------------------------+\n")
00615          );
00616 }
00617
00618 void
00619 PrintEvent(
00620     PEVENT_TRACE pEvent,
00621     PMOF_INFO pMofInfo
00622     )
00623 /*++
00624
00625 Routine Description:
00626
00627     Dumps event data into a dump file.
00628
00629 Arguments:
00630
00631     None
00632
00633 Return Value:
00634
00635     None
00636
00637 --*/
00638 {
00639     PEVENT_TRACE_HEADER pHeader = (PEVENT_TRACE_HEADER) &pEvent->Header;
00640     ULONG   i;
00641     PITEM_DESC pItem;
00642     CHAR str[MOFSTR];
00643     WCHAR wstr[MOFWSTR];
00644     PCHAR ptr;
00645     ULONG ulongword;
00646     LONG  longword;
00647     USHORT ushortword;
00648     SHORT  shortword;
00649     CHAR iChar;
00650     WCHAR iwChar;
00651     ULONG MofDataUsed;
00652     PLIST_ENTRY Head, Next;
00653
00654     // Print a general information on the event.
00655     if ( pMofInfo->strDescription != NULL ){
00656         _ftprintf( DumpFile, _T("%12s, "), pMofInfo->strDescription );
00657     }
00658     else {
00659         TCHAR strGuid[MAXSTR];
00660         GuidToString( strGuid, &pMofInfo->Guid );
00661         _ftprintf( DumpFile, _T("%12s, "), strGuid );
00662     }
00663
00664     if (pMofInfo->strType != NULL && _tcslen(pMofInfo->strType) ){
00665         _ftprintf( DumpFile, _T("%10s, "), pMofInfo->strType );
00666     }
00667     else {
00668         _ftprintf( DumpFile, _T("%10d, "), pEvent->Header.Class.Type );
00669     }
00670
00671     // Thread ID
00672     _ftprintf( DumpFile, _T("0x%04X, "), pHeader->ThreadId );
00673
00674     // System Time
00675     _ftprintf( DumpFile, _T("%20I64u, "), pHeader->TimeStamp.QuadPart);
00676
00677     if ( bUserMode == FALSE ){
00678         // Kernel Time
00679         _ftprintf(DumpFile, _T("%10lu, "), pHeader->KernelTime * TimerResolution);
00680
00681         // User Time
00682         _ftprintf(DumpFile, _T("%10lu, "), pHeader->UserTime * TimerResolution);
00683     }
00684     else {
00685         // processor Time
00686         _ftprintf(DumpFile, _T("%I64u, "), pHeader->ProcessorTime);
00687     }
00688
00689     if (NULL == pEvent->MofData && pEvent->MofLength != 0) {
00690         _tprintf(_T("Incorrect MOF size\n"));
00691         return;
00692     }
00693
00694     Head = pMofInfo->ItemHeader;
00695     Next = Head->Flink;
00696     ptr = (PCHAR)(pEvent->MofData);
00697
00698     // If we cannot locate layout information, just print the size.
00699     if ((Head == Next) && (pEvent->MofLength > 0)) {
00700          _ftprintf(DumpFile, _T("DataSize=%d, "), pEvent->MofLength);
00701     }
00702
00703     // Print event-specific data.
00704     while (Head != Next) {
00705         pItem = CONTAINING_RECORD(Next, ITEM_DESC, Entry);
00706         Next = Next->Flink;
00707
00708         MofDataUsed = (ULONG) (ptr - (PCHAR)(pEvent->MofData));
00709
00710         if (MofDataUsed >= pEvent->MofLength){
00711             break;
00712         }
00713
00714         switch (pItem->ItemType)
00715         {
00716         case ItemChar:      // char
00717         case ItemUChar:     // unsigned char
00718             for( i = 0; i < pItem->ArraySize; i++){
00719                 iChar = *((PCHAR) ptr);
00720                 _ftprintf(DumpFile,   _T("%c"), iChar);
00721                 ptr += sizeof(CHAR);
00722             }
00723             _ftprintf(DumpFile, _T(", "));
00724             break;
00725
00726         case ItemWChar:     // wide char
00727             for(i = 0;i < pItem->ArraySize; i++){
00728                 iwChar = *((PWCHAR) ptr);
00729                 _ftprintf(DumpFile, _T(",%wc"), iwChar);
00730                 ptr += sizeof(WCHAR);
00731             }
00732             _ftprintf(DumpFile, _T(", "));
00733             break;
00734
00735         case ItemCharShort: // char as a number
00736             iChar = *((PCHAR) ptr);
00737             _ftprintf(DumpFile, _T("%d, "), iChar);
00738             ptr += sizeof(CHAR);
00739             break;
00740
00741         case ItemShort:     // short
00742             shortword = * ((PSHORT) ptr);
00743             _ftprintf(DumpFile, _T("%6d, "), shortword);
00744             ptr += sizeof (SHORT);
00745             break;
00746
00747         case ItemUShort:    // unsigned short
00748             ushortword = *((PUSHORT) ptr);
00749             _ftprintf(DumpFile, _T("%6u, "), ushortword);
00750             ptr += sizeof (USHORT);
00751             break;
00752
00753         case ItemLong:      // long
00754             longword = *((PLONG) ptr);
00755             _ftprintf(DumpFile, _T("%8d, "), longword);
00756             ptr += sizeof (LONG);
00757             break;
00758
00759         case ItemULong:     // unsigned long
00760             ulongword = *((PULONG) ptr);
00761             _ftprintf(DumpFile, _T("%8lu, "), ulongword);
00762             ptr += sizeof (ULONG);
00763             break;
00764
00765         case ItemULongX:    // unsinged long as hex
00766             ulongword = *((PULONG) ptr);
00767             _ftprintf(DumpFile, _T("0x%08X, "), ulongword);
00768             ptr += sizeof (ULONG);
00769             break;
00770
00771         case ItemLongLong:
00772         {
00773             LONGLONG n64;   // longlong
00774             n64 = *((LONGLONG*) ptr);
00775             ptr += sizeof(LONGLONG);
00776             _ftprintf(DumpFile, _T("%16I64d, "), n64);
00777             break;
00778         }
00779
00780         case ItemULongLong: // unsigned longlong
00781         {
00782             ULONGLONG n64;
00783             n64 = *((ULONGLONG*) ptr);
00784             ptr += sizeof(ULONGLONG);
00785             _ftprintf(DumpFile, _T("%16I64u, "), n64);
00786             break;
00787         }
00788
00789         case ItemFloat:     // float
00790         {
00791             float f32;
00792             f32 = *((float*) ptr);
00793             ptr += sizeof(float);
00794             _ftprintf(DumpFile, _T("%f, "), f32);
00795             break;
00796         }
00797
00798         case ItemDouble:    // double
00799         {
00800             double f64;
00801             f64 = *((double*) ptr);
00802             ptr += sizeof(double);
00803             _ftprintf(DumpFile, _T("%f, "), f64);
00804             break;
00805         }
00806
00807         case ItemPtr :      // pointer
00808         {
00809             unsigned __int64 pointer;
00810             if (PointerSize == 64) {
00811                 pointer = *((unsigned __int64 *) ptr);
00812                 _ftprintf(DumpFile, _T("0x%X, "), pointer);
00813                 ptr += 8;
00814             }
00815             else {      // assumes 32 bit otherwise
00816                 ulongword = *((PULONG) ptr);
00817                 _ftprintf(DumpFile, _T("0x%08X, "), ulongword);
00818                 ptr += 4;
00819             }
00820             break;
00821         }
00822
00823         case ItemIPAddr:    // IP address
00824         {
00825             ulongword = *((PULONG) ptr);
00826
00827             // Convert it to readable form
00828             _ftprintf(DumpFile, _T("%03d.%03d.%03d.%03d, "),
00829                     (ulongword >>  0) & 0xff,
00830                     (ulongword >>  8) & 0xff,
00831                     (ulongword >> 16) & 0xff,
00832                     (ulongword >> 24) & 0xff);
00833             ptr += sizeof (ULONG);
00834             break;
00835         }
00836
00837         case ItemPort:      // Port
00838         {
00839             _ftprintf(DumpFile, _T("%u, "), NTOHS(*((PUSHORT)ptr)));
00840             ptr += sizeof (USHORT);
00841             break;
00842         }
00843
00844         case ItemString:    // NULL-terminated char string
00845         {
00846             USHORT pLen = (USHORT)strlen((CHAR*) ptr);
00847
00848             if (pLen > 0)
00849             {
00850                 strcpy(str, ptr);
00851                 for (i = pLen-1; i > 0; i--) {
00852                     if (str[i] == 0xFF)
00853                         str[i] = 0;
00854                     else break;
00855                 }
00856 #ifdef UNICODE
00857                 MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
00858                 _ftprintf(DumpFile, _T("\"%ws\","), wstr);
00859 #else
00860                 _ftprintf(DumpFile, _T("\"%s\","), str);
00861 #endif
00862             }
00863             ptr += (pLen + 1);
00864             break;
00865         }
00866
00867         case ItemWString:   // NULL-terminated wide char string
00868         {
00869             size_t  pLen = 0;
00870             size_t     i;
00871
00872             if (*(PWCHAR)ptr)
00873             {
00874                 pLen = ((wcslen((PWCHAR)ptr) + 1) * sizeof(WCHAR));
00875                 RtlCopyMemory(wstr, ptr, pLen);
00876                 // Unused space in a buffer is filled with 0xFFFF.
00877                 // Replace them with 0, just in case.
00878                 for (i = (pLen / 2) - 1; i > 0; i--)
00879                 {
00880                     if (((USHORT) wstr[i] == (USHORT) 0xFFFF))
00881                     {
00882                         wstr[i] = (USHORT) 0;
00883                     }
00884                     else break;
00885                 }
00886
00887                 wstr[pLen / 2] = wstr[(pLen / 2) + 1]= '\0';
00888                 _ftprintf(DumpFile, _T("\"%ws\","), wstr);
00889             }
00890             ptr += pLen;
00891
00892             break;
00893         }
00894
00895         case ItemDSString:   // Counted String
00896         {
00897             USHORT pLen = (USHORT)(256 * ((USHORT) * ptr) + ((USHORT) * (ptr + 1)));
00898             ptr += sizeof(USHORT);
00899             if (pLen > (pEvent->MofLength - MofDataUsed - 1)) {
00900                 pLen = (USHORT) (pEvent->MofLength - MofDataUsed - 1);
00901             }
00902             if (pLen > 0)
00903             {
00904                 strncpy(str, ptr, pLen);
00905                 str[pLen] = '\0';
00906 #ifdef UNICODE
00907                 MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
00908                 fwprintf(DumpFile, _T("\"%ws\","), wstr);
00909 #else
00910                 fprintf(DumpFile, _T("\"%s\","), str);
00911 #endif
00912             }
00913             ptr += (pLen + 1);
00914             break;
00915         }
00916
00917         case ItemPString:   // Counted String
00918         {
00919             USHORT pLen = * ((USHORT *) ptr);
00920             ptr += sizeof(USHORT);
00921
00922             if (pLen > (pEvent->MofLength - MofDataUsed)) {
00923                 pLen = (USHORT) (pEvent->MofLength - MofDataUsed);
00924             }
00925
00926             if (pLen > MOFSTR * sizeof(CHAR)) {
00927                 pLen = MOFSTR * sizeof(CHAR);
00928             }
00929             if (pLen > 0) {
00930                 RtlCopyMemory(str, ptr, pLen);
00931                 str[pLen] = '\0';
00932 #ifdef UNICODE
00933                 MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
00934                 _ftprintf(DumpFile, _T("\"%ws\","), wstr);
00935 #else
00936                 _ftprintf(DumpFile, _T("\"%s\","), str);
00937 #endif
00938             }
00939             ptr += pLen;
00940             break;
00941         }
00942
00943         case ItemDSWString:  // DS Counted Wide Strings
00944         case ItemPWString:   // Counted Wide Strings
00945         {
00946             USHORT pLen = (USHORT)(( pItem->ItemType == ItemDSWString)
00947                         ? (256 * ((USHORT) * ptr) + ((USHORT) * (ptr + 1)))
00948                         : (* ((USHORT *) ptr)));
00949
00950             ptr += sizeof(USHORT);
00951             if (pLen > (pEvent->MofLength - MofDataUsed)) {
00952                 pLen = (USHORT) (pEvent->MofLength - MofDataUsed);
00953             }
00954
00955             if (pLen > MOFWSTR * sizeof(WCHAR)) {
00956                 pLen = MOFWSTR * sizeof(WCHAR);
00957             }
00958             if (pLen > 0) {
00959                 RtlCopyMemory(wstr, ptr, pLen);
00960                 wstr[pLen / sizeof(WCHAR)] = L'\0';
00961                 _ftprintf(DumpFile, _T("\"%ws\","), wstr);
00962             }
00963             ptr += pLen;
00964             break;
00965         }
00966
00967         case ItemNWString:   // Non Null Terminated String
00968         {
00969            USHORT Size;
00970
00971            Size = (USHORT)(pEvent->MofLength - (ULONG)(ptr - (PCHAR)(pEvent->MofData)));
00972            if( Size > MOFSTR )
00973            {
00974                Size = MOFSTR;
00975            }
00976            if (Size > 0)
00977            {
00978                RtlCopyMemory(wstr, ptr, Size);
00979                wstr[Size / 2] = '\0';
00980                _ftprintf(DumpFile, _T("\"%ws\","), wstr);
00981            }
00982            ptr += Size;
00983            break;
00984         }
00985
00986         case ItemMLString:  // Multi Line String
00987         {
00988             USHORT   pLen;
00989             char   * src, * dest;
00990             BOOL     inQ       = FALSE;
00991             BOOL     skip      = FALSE;
00992             UINT     lineCount = 0;
00993
00994             ptr += sizeof(UCHAR) * 2;
00995             pLen = (USHORT)strlen(ptr);
00996             if (pLen > 0)
00997             {
00998                 src = ptr;
00999                 dest = str;
01000                 while (* src != '\0'){
01001                     if (* src == '\n'){
01002                         if (!lineCount){
01003                             * dest++ = ' ';
01004                         }
01005                         lineCount++;
01006                     }else if (* src == '\"'){
01007                         if (inQ){
01008                             char   strCount[32];
01009                             char * cpy;
01010
01011                             sprintf(strCount, "{%dx}", lineCount);
01012                             cpy = & strCount[0];
01013                             while (* cpy != '\0'){
01014                                 * dest ++ = * cpy ++;
01015                             }
01016                         }
01017                         inQ = !inQ;
01018                     }else if (!skip){
01019                         *dest++ = *src;
01020                     }
01021                     skip = (lineCount > 1 && inQ);
01022                     src++;
01023                 }
01024                 *dest = '\0';
01025 #ifdef UNICODE
01026                 MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, MOFWSTR);
01027                 _ftprintf(DumpFile, _T("\"%ws\","), wstr);
01028 #else
01029                 _ftprintf(DumpFile, _T("\"%s\","), str);
01030 #endif
01031             }
01032             ptr += (pLen);
01033             break;
01034         }
01035
01036         case ItemSid:       // SID
01037         {
01038             WCHAR        UserName[64];
01039             WCHAR        Domain[64];
01040             WCHAR        FullName[256];
01041             ULONG        asize = 0;
01042             ULONG        bsize = 0;
01043             ULONG        SidMarker;
01044             SID_NAME_USE Se;
01045             ULONG        nSidLength;
01046
01047             RtlCopyMemory(&SidMarker, ptr, sizeof(ULONG));
01048             if (SidMarker == 0){
01049                 ptr += 4;
01050                 fwprintf(DumpFile,   L"0, ");
01051             }
01052             else
01053             {
01054                 if (PointerSize == 64) {
01055                     ptr += 16;           // skip the TOKEN_USER structure
01056                 }
01057                 else {
01058                     ptr += 8;            // skip the TOKEN_USER structure
01059                 }
01060                 nSidLength = 8 + (4*ptr[1]);
01061
01062                 asize = 64;
01063                 bsize = 64;
01064                 if (LookupAccountSidW(
01065                                 NULL,
01066                                (PSID) ptr,
01067                                (LPWSTR) & UserName[0],
01068                                & asize,
01069                                (LPWSTR) & Domain[0],
01070                                & bsize,
01071                                & Se))
01072                 {
01073                     LPWSTR pFullName = &FullName[0];
01074                     swprintf(pFullName, L"\\\\%s\\%s", Domain, UserName);
01075                     asize = (ULONG)  lstrlenW(pFullName);
01076                     if (asize > 0){
01077                          fwprintf(DumpFile,   L"\"%s\", ", pFullName);
01078                     }
01079                 }
01080                 else
01081                 {
01082                      fwprintf(DumpFile,   L"\"System\", " );
01083                 }
01084                 SetLastError( ERROR_SUCCESS );
01085                 ptr += nSidLength;
01086             }
01087             break;
01088         }
01089
01090         case ItemGuid:      // GUID
01091         {
01092             TCHAR s[64];
01093             GuidToString(s, (LPGUID)ptr);
01094             _ftprintf(DumpFile,   _T("%s, "), s);
01095             ptr += sizeof(GUID);
01096             break;
01097         }
01098         case ItemBool:      // boolean
01099         {
01100             BOOL Flag = (BOOL)*ptr;
01101             _ftprintf(DumpFile, _T("%5s, "), (Flag) ? _T("TRUE") : _T("FALSE"));
01102             ptr += sizeof(BOOL);
01103             break;
01104         }
01105
01106         default:
01107             ptr += sizeof (int);
01108         }
01109     }
01110
01111     //Instance ID
01112     _ftprintf(DumpFile, _T("%d,"), pEvent->InstanceId);
01113
01114     //Parent Instance ID
01115     _ftprintf(DumpFile, _T("%d\n"), pEvent->ParentInstanceId);
01116
01117 }
01118
01119 ULONG
01120 CheckFile(
01121     LPTSTR fileName
01122 )
01123 /*++
01124
01125 Routine Description:
01126
01127     Checks whether a file exists and is readable.
01128
01129 Arguments:
01130
01131     fileName - File name.
01132
01133 Return Value:
01134
01135     Non-zero if the file exists and is readable. Zero otherwise.
01136
01137 --*/
01138 {
01139     HANDLE hFile;
01140     ULONG Status;
01141
01142     hFile = CreateFile(
01143                 fileName,
01144                 GENERIC_READ,
01145                 FILE_SHARE_READ | FILE_SHARE_WRITE,
01146                 NULL,
01147                 OPEN_EXISTING,
01148                 FILE_ATTRIBUTE_NORMAL,
01149                 NULL
01150                 );
01151     Status = (hFile != INVALID_HANDLE_VALUE);
01152     CloseHandle(hFile);
01153     return Status;
01154 }
01155
01156 void
01157 GuidToString(
01158     PTCHAR s,
01159     LPGUID piid
01160 )
01161 /*++
01162
01163 Routine Description:
01164
01165     Converts a GUID into a string.
01166
01167 Arguments:
01168
01169     s - String that will have the converted GUID.
01170     piid - GUID
01171
01172 Return Value:
01173
01174     None.
01175
01176 --*/
01177 {
01178     _stprintf(s, _T("{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"),
01179                piid->Data1, piid->Data2,
01180                piid->Data3,
01181                piid->Data4[0], piid->Data4[1],
01182                piid->Data4[2], piid->Data4[3],
01183                piid->Data4[4], piid->Data4[5],
01184                piid->Data4[6], piid->Data4[7]);
01185     return;
01186 }
01187
01188 void
01189 PrintHelpMessage()
01190 /*++
01191
01192 Routine Description:
01193
01194     Prints out help messages.
01195
01196 Arguments:
01197
01198     None
01199
01200 Return Value:
01201
01202     None
01203
01204 --*/
01205 {
01206     _tprintf(
01207         _T("Usage: tracedmp [options]  <EtlFile1 EtlFile2 ...>| [-h | -? | -help]\n")
01208         _T("\t-o <file>          Output CSV file\n")
01209         _T("\t-rt [LoggerName]   Realtime tracedmp from the logger [LoggerName]\n")
01210         _T("\t-summary           Summary.txt only\n")
01211         _T("\t-h\n")
01212         _T("\t-help\n")
01213         _T("\t-?                 Display usage information\n")
01214         _T("\n")
01215         _T("\tDefault output file is dumpfile.csv\n")
01216     );
01217 }
01218
01219 void
01220 CleanupEventList(
01221     VOID
01222 )
01223 /*++
01224
01225 Routine Description:
01226
01227     Cleans up a global event list.
01228
01229 Arguments:
01230
01231 Return Value:
01232
01233     None.
01234
01235 --*/
01236 {
01237     PLIST_ENTRY Head, Next;
01238     PMOF_INFO pMofInfo;
01239     TCHAR s[256];
01240     TCHAR wstr[256];
01241     PTCHAR str;
01242
01243     if (EventListHead == NULL) {
01244         return;
01245     }
01246
01247     Head = EventListHead;
01248     Next = Head->Flink;
01249     while (Head != Next) {
01250         RtlZeroMemory(&wstr, 256);
01251
01252         pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
01253
01254         if (pMofInfo->EventCount > 0) {
01255             GuidToString(&s[0], &pMofInfo->Guid);
01256             str = s;
01257             if( pMofInfo->strDescription != NULL ){
01258                 _tcscpy( wstr, pMofInfo->strDescription );
01259             }
01260
01261             _ftprintf(SummaryFile,_T("|%10d    %-20s %-10s  %36s|\n"),
01262                       pMofInfo->EventCount,
01263                       wstr,
01264                       pMofInfo->strType ? pMofInfo->strType : GUID_TYPE_DEFAULT,
01265                       str);
01266         }
01267
01268         RemoveEntryList(&pMofInfo->Entry);
01269         RemoveMofInfo(pMofInfo->ItemHeader);
01270         free(pMofInfo->ItemHeader);
01271
01272         if (pMofInfo->strDescription != NULL)
01273             free(pMofInfo->strDescription);
01274         if (pMofInfo->strType != NULL)
01275             free(pMofInfo->strType);
01276
01277         Next = Next->Flink;
01278         free(pMofInfo);
01279     }
01280
01281     free(EventListHead);
01282 }
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CInputTag Member List

This is the complete list of members for CInputTag, including all inherited members.
_aTempBuffer | CHtmlElement | [protected]
_cValueChars | CInputTag | [private]
_cValueCharsFiltered | CInputTag | [private]
_htmlIFilter | CHtmlElement | [protected]
_pwcValueBuf | CInputTag | [private]
_scanner | CHtmlElement | [protected]
_serialStream | CHtmlElement | [protected]
CHtmlElement(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CHtmlElement |
CInputTag(CHtmlIFilter &htmlIFilter, CSerialStream &serialStream) | CInputTag |
GetChunk(STAT_CHUNK *pStat) | CInputTag | [virtual]
GetText(ULONG *pcwcOutput, WCHAR *awcBuffer) | CInputTag | [virtual]
GetValue(PROPVARIANT **ppPropValue) | CHtmlElement | [virtual]
InitFilterRegion(ULONG &idChunkSource, ULONG &cwcStartSource, ULONG &cwcLenSource) | CHtmlElement | [virtual]
InitStatChunk(STAT_CHUNK *pStat) | CInputTag | [virtual]
SkipRemainingTextAndGotoNextChunk(STAT_CHUNK *pStat) | CHtmlElement | [protected]
SwitchToNextHtmlElement(STAT_CHUNK *pStat) | CHtmlElement | [protected]
~CHtmlElement() | CHtmlElement | [inline, virtual]
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/About/delebase.h Source File

  • SysMgmt
  • MMC
  • About

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CDelegationBase {
00030 public:
00031     CDelegationBase();
00032     virtual ~CDelegationBase();
00033
00034     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00035     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00036
00037     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00038     virtual const int GetBitmapIndex() = 0;
00039
00040     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00041
00042 public:
00043     // virtual functions go here (for MMCN_*)
00044
00045 private:
00046     // {2974380B-4C4B-11d2-89D8-000021473128}
00047     static const GUID thisGuid;
00048 };
00049
00050 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/ExtObjData.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

ExtObjData.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      ExtObjData.h
00007 //
00008 //  Implementation File:
00009 //      ExtObjData.cpp
00010 //
00011 //  Description:
00012 //      Definition of the context menu, property sheet, and wizard funcitons.
00013 //
00014 //  Author:
00015 //      <name> (<e-mail name>) Mmmm DD, 2003
00016 //
00017 //  Revision History:
00018 //
00019 //  Notes:
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #pragma once
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Include Files
00027 /////////////////////////////////////////////////////////////////////////////
00028
00029 #pragma warning( push )
00030 #include <CluAdmEx.h>   // for IWCContextMenuCallback
00031 #pragma warning( pop )
00032
00033 /////////////////////////////////////////////////////////////////////////////
00034 // Forward Class Declarations
00035 /////////////////////////////////////////////////////////////////////////////
00036
00037 //class CObjData;
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // Global Function Declarations
00041 /////////////////////////////////////////////////////////////////////////////
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 // class CObjData
00045 /////////////////////////////////////////////////////////////////////////////
00046
00047 class CObjData
00048 {
00049 protected:
00050     CLUADMEX_OBJECT_TYPE    m_cot;
00051     CString                 m_strName;
00052     CRuntimeClass **        m_rgprtcPSPages;    // Property Sheet pages
00053     CRuntimeClass **        m_rgprtcWizPages;   // Wizard pages
00054
00055     virtual HRESULT
00056     AddContextMenuItem(
00057                   IWCContextMenuCallback * piCallbackIn
00058                 , UINT    nMenuItem
00059                 , UINT    nMenuItemDesc
00060                 , UINT    nBaseID
00061                 , ULONG   uFlags
00062                 );
00063
00064     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00065
00066 public:
00067
00068     CObjData( void )
00069     {
00070         m_cot = CLUADMEX_OT_NONE;
00071         m_rgprtcPSPages = NULL;
00072         m_rgprtcWizPages = NULL;
00073     } // *** CObjData
00074
00075     virtual ~CObjData( void ) {}
00076
00077     static HRESULT
00078     S_HrCreateObject(
00079           IUnknown *    piDataIn
00080         , CObjData **   ppodOut
00081         );
00082
00083     virtual HRESULT
00084     AddContextMenuItems(
00085         IWCContextMenuCallback * piCallbackIn
00086         )
00087     {
00088         UNREFERENCED_PARAMETER( piCallbackIn );
00089         return E_NOTIMPL;
00090     } // *** AddContextMenuItems
00091
00092     virtual HRESULT
00093     InvokeCommand(
00094         ULONG nCommandIDIn
00095         )
00096     {
00097         UNREFERENCED_PARAMETER( nCommandIDIn);
00098         return E_NOTIMPL;
00099     } // *** InvokeCommand
00100
00101     virtual HRESULT
00102     GetPropertySheetPages(
00103         CRuntimeClass *** ppaPropSheetsOut
00104         )
00105     {
00106         UNREFERENCED_PARAMETER( ppaPropSheetsOut );
00107         return E_NOTIMPL;
00108     } // *** GetPropertySheetPages
00109
00110     virtual HRESULT
00111     GetWizardPages(
00112         CRuntimeClass *** ppaWizardPagesOut
00113         )
00114     {
00115         UNREFERENCED_PARAMETER( ppaWizardPagesOut );
00116         return E_NOTIMPL;
00117     } // *** GetWizardPages
00118
00119     virtual CString
00120     StrName( void )
00121     {
00122         return m_strName;
00123     } // *** StrName
00124
00125     CLUADMEX_OBJECT_TYPE
00126     Cot( void )
00127     {
00128         return m_cot;
00129     } // *** Cot
00130
00131 };  //*** class CObjData
00132
00133 /////////////////////////////////////////////////////////////////////////////
00134 // class CClusterData
00135 /////////////////////////////////////////////////////////////////////////////
00136
00137 class CClusterData
00138     : public CObjData
00139 {
00140 private:
00141     HCLUSTER    m_hCluster;         // This is a copy, don't free it.
00142     CString     m_strClusterName;
00143
00144 protected:
00145     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00146
00147 public:
00148     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00149     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00150
00151     HCLUSTER GetHCluster( void ) { return m_hCluster; };
00152
00153 };  //*** class CClusterData
00154
00155 /////////////////////////////////////////////////////////////////////////////
00156 // class CNodeData
00157 /////////////////////////////////////////////////////////////////////////////
00158
00159 class CNodeData
00160     : public CObjData
00161 {
00162 private:
00163     HNODE   m_hNode;    // This is a copy, don't free it.
00164
00165 protected:
00166     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00167
00168 public:
00169
00170     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00171     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00172
00173     HNODE GetHNode( void ) { return m_hNode; };
00174
00175 };  //*** class CNodeData
00176
00177 /////////////////////////////////////////////////////////////////////////////
00178 // class CGroupData
00179 /////////////////////////////////////////////////////////////////////////////
00180
00181 class CGroupData
00182     : public CObjData
00183 {
00184 private:
00185     HGROUP  m_hGroup;   // This is a copy, don't free it.
00186
00187 protected:
00188     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00189
00190 public:
00191
00192     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00193     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00194
00195     HGROUP GetHGroup( void ) { return m_hGroup; };
00196
00197 };  //*** class CGroupData
00198
00199 /////////////////////////////////////////////////////////////////////////////
00200 // class CResData
00201 /////////////////////////////////////////////////////////////////////////////
00202
00203 class CResData
00204     : public CObjData
00205 {
00206 private:
00207     HRESOURCE   m_hResource;        // This is a copy, don't free it.
00208     CString     m_strResTypeName;
00209     BOOL        m_fSupportedType;   // Is this resource a type that we explicitly extend?
00210
00211 protected:
00212     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00213
00214 public:
00215     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00216     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00217     virtual HRESULT GetPropertySheetPages( CRuntimeClass *** ppaPropSheetsOut );
00218     virtual HRESULT GetWizardPages( CRuntimeClass *** ppaWizardPagesOut );
00219
00220     HRESOURCE GetHResource( void ) { return m_hResource; };
00221
00222 }; //*** class CResData
00223
00224 /////////////////////////////////////////////////////////////////////////////
00225 // class CResTypeData
00226 /////////////////////////////////////////////////////////////////////////////
00227
00228 class CResTypeData
00229     : public CObjData
00230 {
00231 private:
00232     BOOL        m_fSupportedType;   // Is this restype one that we explicitly extend?
00233
00234 protected:
00235     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00236
00237 public:
00238     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00239     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00240
00241 };  //*** class CResData
00242
00243 /////////////////////////////////////////////////////////////////////////////
00244 // class CNetworkData
00245 /////////////////////////////////////////////////////////////////////////////
00246
00247 class CNetworkData
00248     : public CObjData
00249 {
00250 private:
00251     HNETWORK    m_hNetwork;     // This is a copy, don't free it.
00252
00253 protected:
00254     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00255
00256 public:
00257
00258     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00259     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00260
00261     HNETWORK GetHNetwork( void ) { return m_hNetwork; };
00262
00263 };  //*** class CNetworkData
00264
00265 /////////////////////////////////////////////////////////////////////////////
00266 // class CNetInterfaceData
00267 /////////////////////////////////////////////////////////////////////////////
00268
00269 class CNetInterfaceData
00270     : public CObjData
00271 {
00272 private:
00273     HNETINTERFACE   m_hNetInterface;    // This is a copy, don't free it.
00274
00275 protected:
00276     virtual HRESULT HrInitialize( IUnknown * piDataIn );
00277
00278 public:
00279
00280     virtual HRESULT AddContextMenuItems( IWCContextMenuCallback * piCallbackIn );
00281     virtual HRESULT InvokeCommand( ULONG nCommandIDIn );
00282
00283     HNETINTERFACE GetHNetInterface( void ) { return m_hNetInterface; };
00284
00285 };  //*** class CNetInterfaceData
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/AppMem/pub/AppMem.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • AppMem
  • pub

AppMem.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright 1995 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     appmem.h
00008
00009 Abstract:
00010
00011     function prototypes and definitions for applications using the
00012     application memory performance counters
00013
00014 Revision History
00015
00016     30 Aug 1995     Bob Watson (a-robw)     Created
00017
00018 --*/
00019 #ifndef _APPMEM_H_
00020 #define _APPMEM_H_
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026 HGLOBAL
00027 GlobalAllocP (
00028     UINT    fuFlags,
00029     DWORD   cbBytes
00030 );
00031
00032 HGLOBAL
00033 GlobalFreeP (
00034     HGLOBAL hglbMem
00035 );
00036
00037 HGLOBAL
00038 GlobalReAllocP (
00039     HGLOBAL hglbMem,
00040     DWORD   cbBytes,
00041     UINT    fuFlags
00042 );
00043
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047
00048 #endif // _APPMEM_H_
00049
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDropSource Member List

This is the complete list of members for CDropSource, including all inherited members.
CDropSource() | CDropSource |
CDropSource() | CDropSource |
GiveFeedback(DWORD dwEffect) | CDropSource |
GiveFeedback(DWORD) | CDropSource |
m_cRef | CDropSource | [private]
m_ObjRefCount | CDropSource | [private]
QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) | CDropSource |
QueryContinueDrag(BOOL, DWORD) | CDropSource |
QueryInterface(REFIID riid, void **ppvObject) | CDropSource |
QueryInterface(REFIID, LPVOID *) | CDropSource |
STDMETHODIMP_(ULONG) AddRef() | CDropSource |
STDMETHODIMP_(ULONG) Release() | CDropSource |
STDMETHODIMP_(ULONG) AddRef(void) | CDropSource |
STDMETHODIMP_(ULONG) Release(void) | CDropSource |
~CDropSource() | CDropSource | [virtual]
~CDropSource() | CDropSource |
Generated on Wed Nov 13 2024 16:56:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIBindResource Member List

This is the complete list of members for CImpIBindResource, including all inherited members.
Bind(IUnknown *pUnkOuter, LPCOLESTR pwszURL, DWORD dwBindFlags, REFGUID rguid, REFIID riid, IAuthenticate *pAuthenticate, DBIMPLICITSESSION *pImplSession, DWORD *pdwBindStatus, IUnknown **ppUnk) | CImpIBindResource
BindDSO(IUnknown *pUnkOuter, REFIID riid, BOOL fWaitForInit, WCHAR *pwszDataSource, IUnknown **ppUnk) | CImpIBindResource
BindRow(IUnknown *pUnkOuter, REFIID riid, DBIMPLICITSESSION *pImplSession, WCHAR *pwszDataSource, WCHAR *pwszFile, ULONG ulRowNum, IUnknown **ppUnk) | CImpIBindResource
BindRowset(IUnknown *pUnkOuter, REFIID riid, DBIMPLICITSESSION *pImplSession, WCHAR *pwszDataSource, WCHAR *pwszFile, IUnknown **ppUnk) | CImpIBindResource
BindSession(IUnknown *pUnkOuter, REFIID riid, WCHAR *pwszDataSource, IUnknown **ppUnk) | CImpIBindResource
BindSession(DBIMPLICITSESSION *pImplSession, WCHAR *pwszDataSource) | CImpIBindResource
BindStream(IUnknown *pUnkOuter, REFIID riid, DBIMPLICITSESSION *pImplSession, WCHAR *pwszDataSource, WCHAR *pwszFile, ULONG ulRowNum, IUnknown **ppUnk) | CImpIBindResource
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CBaseObj, CImpIBindResource) | CImpIBindResource
FindKeyword(LPCOLESTR pwszURL, LPCOLESTR pwszKeyword, WCHAR **ppwszToken) | CImpIBindResource
ParseURL(LPCOLESTR pwszURL, WCHAR **ppwszDataSource, WCHAR **ppwszTableName, ULONG *pulRowNum) | CImpIBindResource
ValidateBindArgs(IUnknown *pUnkOuter, LPCOLESTR pwszURL, DBBINDURLFLAG dwBindFlags, REFGUID rguid, REFIID riid, DBIMPLICITSESSION *pImplSession, IAuthenticate *pAuthenticate, DWORD *pdwBindStatus, IUnknown **ppUnk) | CImpIBindResource
Generated on Wed Nov 13 2024 16:56:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Help/CompData.Cpp Source File

  • SysMgmt
  • MMC
  • Help

CompData.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030     m_pStaticNode = new CStaticNode;
00031
00032     TCHAR tmpHelpFile[MAX_PATH];
00033
00034     GetWindowsDirectory(tmpHelpFile, (sizeof tmpHelpFile)/(sizeof tmpHelpFile[0]));
00035     _tcscat(tmpHelpFile, _T("\\HELP\\"));
00036     LoadString(g_hinst, IDS_HELPFILE, &tmpHelpFile[_tcslen(tmpHelpFile)], MAX_PATH - _tcslen(tmpHelpFile));
00037
00038   MAKE_WIDEPTR_FROMTSTR(wszHelpFile, tmpHelpFile);
00039   wcscpy(m_HelpFile, wszHelpFile);
00040 }
00041
00042 CComponentData::~CComponentData()
00043 {
00044     if (m_pStaticNode) {
00045         delete m_pStaticNode;
00046     }
00047
00048     OBJECT_DESTROYED
00049 }
00050
00051 ///////////////////////
00052 // IUnknown implementation
00053 ///////////////////////
00054
00055 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00056 {
00057     if (!ppv)
00058         return E_FAIL;
00059
00060     *ppv = NULL;
00061
00062     if (IsEqualIID(riid, IID_IUnknown))
00063         *ppv = static_cast<IComponentData *>(this);
00064     else if (IsEqualIID(riid, IID_IComponentData))
00065         *ppv = static_cast<IComponentData *>(this);
00066     else if (IsEqualIID(riid, IID_ISnapinHelp2))
00067         *ppv = static_cast<ISnapinHelp2*>(this);
00068
00069     if (*ppv)
00070     {
00071         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00072         return S_OK;
00073     }
00074
00075     return E_NOINTERFACE;
00076 }
00077
00078 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00079 {
00080     return InterlockedIncrement((LONG *)&m_cref);
00081 }
00082
00083 STDMETHODIMP_(ULONG) CComponentData::Release()
00084 {
00085     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00086     {
00087         // we need to decrement our object count in the DLL
00088         delete this;
00089         return 0;
00090     }
00091
00092     return m_cref;
00093 }
00094
00095 ///////////////////////////////
00096 // Interface IComponentData
00097 ///////////////////////////////
00098 HRESULT CComponentData::Initialize(
00099                                    /* [in] */ LPUNKNOWN pUnknown)
00100 {
00101     HRESULT      hr;
00102
00103     //
00104     // Get pointer to name space interface
00105     //
00106     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00107     _ASSERT( S_OK == hr );
00108
00109     //
00110     // Get pointer to console interface
00111     //
00112     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00113     _ASSERT( S_OK == hr );
00114
00115     return S_OK;
00116 }
00117
00118 HRESULT CComponentData::CreateComponent(
00119                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00120 {
00121     *ppComponent = NULL;
00122
00123     CComponent *pComponent = new CComponent(this);
00124
00125     if (NULL == pComponent)
00126         return E_OUTOFMEMORY;
00127
00128     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00129 }
00130
00131 HRESULT CComponentData::Notify(
00132                                /* [in] */ LPDATAOBJECT lpDataObject,
00133                                /* [in] */ MMC_NOTIFY_TYPE event,
00134                                /* [in] */ LPARAM arg,
00135                                /* [in] */ LPARAM param)
00136 {
00137   MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00138
00139     return S_FALSE;
00140 }
00141
00142 HRESULT CComponentData::Destroy( void)
00143 {
00144     // Free interfaces
00145     if (m_ipConsoleNameSpace) {
00146         m_ipConsoleNameSpace->Release();
00147         m_ipConsoleNameSpace = NULL;
00148     }
00149
00150     if (m_ipConsole) {
00151         m_ipConsole->Release();
00152         m_ipConsole = NULL;
00153     }
00154
00155     return S_OK;
00156 }
00157
00158 HRESULT CComponentData::QueryDataObject(
00159                                         /* [in] */ MMC_COOKIE cookie,
00160                                         /* [in] */ DATA_OBJECT_TYPES type,
00161                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00162 {
00163     CDataObject *pObj = NULL;
00164
00165     if (cookie == 0)
00166         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00167     else
00168         pObj = new CDataObject(cookie, type);
00169
00170     if (!pObj)
00171         return E_OUTOFMEMORY;
00172
00173     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00174
00175     return S_OK;
00176 }
00177
00178 HRESULT CComponentData::GetDisplayInfo(
00179                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00180 {
00181     HRESULT hr = S_FALSE;
00182
00183     // if they are asking for the SDI_STR we have one of those to give
00184     if (pScopeDataItem->lParam) {
00185         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00186         if (pScopeDataItem->mask & SDI_STR) {
00187       LPCTSTR pszT = base->GetDisplayName();
00188       MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00189             pScopeDataItem->displayname = pszW;
00190         }
00191
00192         if (pScopeDataItem->mask & SDI_IMAGE) {
00193             pScopeDataItem->nImage = base->GetBitmapIndex();
00194         }
00195     }
00196
00197     return hr;
00198 }
00199
00200 HRESULT CComponentData::CompareObjects(
00201                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00202                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00203 {
00204     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00205     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00206
00207     // compare the object pointers
00208     if (baseA->GetCookie() == baseB->GetCookie())
00209         return S_OK;
00210
00211     return S_FALSE;
00212 }
00213
00214 ///////////////////////////////
00215 // Interface ISnapinHelp
00216 ///////////////////////////////
00217 HRESULT CComponentData::GetHelpTopic(
00218                                      /* [out] */ LPOLESTR *lpCompiledHelpFile)
00219 {
00220     *lpCompiledHelpFile = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(m_HelpFile) + 1) * sizeof(WCHAR)));
00221
00222     wcscpy(*lpCompiledHelpFile, m_HelpFile);
00223
00224     return S_OK;
00225 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook Server/StringUtils.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook Server

StringUtils.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      StringUtils.cpp
00007 //
00008 //  Description:
00009 //      Implementation of string manipulation routines.
00010 //
00011 //  Author:
00012 //      <name> (<e-mail name>) Mmmm DD, 2003
00013 //
00014 //  Revision History:
00015 //
00016 //  Notes:
00017 //
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020 //////////////////////////////////////////////////////////////////////////////
00021 // Include Files
00022 //////////////////////////////////////////////////////////////////////////////
00023
00024 #include "StringUtils.h"
00025
00026
00027 //////////////////////////////////////////////////////////////////////////////
00028 // String comparison routines
00029 //////////////////////////////////////////////////////////////////////////////
00030
00031
00032 /////////////////////////////////////////////////////////////////////////////
00033 //++
00034 //
00035 //  WrapCompareString
00036 //
00037 //  Description:
00038 //      Wraps the call to CompareString
00039 //
00040 //  Arguments:
00041 //      fCaseSensitive      TRUE for a case sensitive compare
00042 //                          FALSE for a case insensitive compare
00043 //      pcwszString1In      The first string.
00044 //      cch1In              The count of characters in the first string.
00045 //                          If -1 then it's assumed to be null-terminated.
00046 //      pcwszString2In      The second string.
00047 //      cchIn               The count of characters in the second string.
00048 //                          If -1 then it's assumed to be null-terminated.
00049 //  Return Value:
00050 //       0  Strings are equal.
00051 //     > 0  String1 greater than String2.
00052 //     < 0  String1 less than String2.
00053 //
00054 //--
00055 /////////////////////////////////////////////////////////////////////////////
00056 int
00057 WrapCompareString(
00058       BOOL      fCaseSensitive
00059     , LPCWSTR   pcwszString1In
00060     , size_t    cch1In
00061     , LPCWSTR   pcwszString2In
00062     , size_t    cch2In
00063     )
00064 {
00065     int nRet;
00066
00067     nRet = CompareStringW(
00068               LOCALE_SYSTEM_DEFAULT
00069             , fCaseSensitive ? 0 : NORM_IGNORECASE
00070             , pcwszString1In
00071             , static_cast< DWORD >( cch1In )
00072             , pcwszString2In
00073             , static_cast< DWORD >( cch2In )
00074             );
00075
00076     return nRet - CSTR_EQUAL; // CSTR_LT < CSTR_EQUAL < CSTR_GT
00077
00078 } // *** WrapCompareString
00079
00080 //
00081 // Full string compares.
00082 //
00083
00084 int
00085 IBSTRCompareW(
00086       BSTR  bstrString1In
00087     , BSTR  bstrString2In
00088     )
00089 {
00090     return WrapCompareString(
00091                   FALSE
00092                 , static_cast< LPCWSTR >( bstrString1In )
00093                 , SysStringLen( bstrString1In )
00094                 , static_cast< LPCWSTR >( bstrString2In )
00095                 , SysStringLen( bstrString2In )
00096                 );
00097 } //*** IBSTRCompareW
00098
00099 int
00100 BSTRCompareW(
00101       BSTR  bstrString1In
00102     , BSTR  bstrString2In
00103     )
00104 {
00105     return WrapCompareString(
00106                   TRUE
00107                 , static_cast< LPCWSTR >( bstrString1In )
00108                 , SysStringLen( bstrString1In )
00109                 , static_cast< LPCWSTR >( bstrString2In )
00110                 , SysStringLen( bstrString2In )
00111                 );
00112 } //*** BSTRCompareW
00113
00114 int
00115 IStringCompareW(
00116       LPCWSTR pcwszString1In
00117     , LPCWSTR pcwszString2In
00118     )
00119 {
00120     return WrapCompareString(
00121                   FALSE
00122                 , pcwszString1In
00123                 , static_cast< size_t >( -1 )
00124                 , pcwszString2In
00125                 , static_cast< size_t >( -1 )
00126             );
00127 } //*** IStringCompareW
00128
00129 int
00130 StringCompareW(
00131       LPCWSTR pcwszString1In
00132     , LPCWSTR pcwszString2In
00133     )
00134 {
00135     return WrapCompareString(
00136                   TRUE
00137                 , pcwszString1In
00138                 , static_cast< size_t >( -1 )
00139                 , pcwszString2In
00140                 , static_cast< size_t >( -1 )
00141                 );
00142 } //*** StringCompareW
00143
00144 int
00145 IStringCompareW(
00146       LPCWSTR   pcwszString1In
00147     , size_t    cch1In
00148     , LPCWSTR   pcwszString2In
00149     , size_t    cch2In
00150     )
00151 {
00152     return WrapCompareString(
00153                   FALSE
00154                 , pcwszString1In
00155                 , cch1In
00156                 , pcwszString2In
00157                 , cch2In
00158                 );
00159 } //*** IStringCompareW
00160
00161 int
00162 StringCompareW(
00163       LPCWSTR   pcwszString1In
00164     , size_t    cch1In
00165     , LPCWSTR   pcwszString2In
00166     , size_t    cch2In
00167     )
00168 {
00169     return WrapCompareString(
00170                   TRUE
00171                 , pcwszString1In
00172                 , cch1In
00173                 , pcwszString2In
00174                 , cch2In
00175                 );
00176 } //*** StringCompareW
00177
00178 //
00179 // Partial string compares.  They use whichever one's length is shortest
00180 // if both are specified or the NBSTR routines are used.
00181 //
00182
00183 int
00184 NIBSTRCompareW(
00185       BSTR  bstrString1In
00186     , BSTR  bstrString2In
00187     )
00188 {
00189     size_t cchMin;
00190
00191     cchMin = min( SysStringLen( bstrString1In ), SysStringLen( bstrString2In ) );
00192
00193     return WrapCompareString(
00194                   FALSE
00195                 , static_cast< LPCWSTR >( bstrString1In )
00196                 , cchMin
00197                 , static_cast< LPCWSTR >( bstrString2In )
00198                 , cchMin
00199                 );
00200 } //*** NIBSTRCompareW
00201
00202 int
00203 NBSTRCompareW(
00204       BSTR  bstrString1In
00205     , BSTR  bstrString2In
00206     )
00207 {
00208     size_t cchMin;
00209
00210     cchMin = min( SysStringLen( bstrString1In ), SysStringLen( bstrString2In ) );
00211
00212     return WrapCompareString(
00213                   TRUE
00214                 , static_cast< LPCWSTR >( bstrString1In )
00215                 , cchMin
00216                 , static_cast< LPCWSTR >( bstrString2In )
00217                 , cchMin
00218                 );
00219 } //*** NBSTRCompareW
00220
00221 int
00222 NIStringCompareW(
00223       LPCWSTR   pcwszString1In
00224     , LPCWSTR   pcwszString2In
00225     , size_t    cchIn
00226     )
00227 {
00228     return WrapCompareString(
00229                   FALSE
00230                 , pcwszString1In
00231                 , cchIn
00232                 , pcwszString2In
00233                 , cchIn
00234                 );
00235 } //*** NIStringCompareW
00236
00237 int
00238 NStringCompareW(
00239       LPCWSTR   pcwszString1In
00240     , LPCWSTR   pcwszString2In
00241     , size_t    cchIn
00242     )
00243 {
00244     return WrapCompareString(
00245                   TRUE
00246                 , pcwszString1In
00247                 , cchIn
00248                 , pcwszString2In
00249                 , cchIn
00250                 );
00251 } //*** NIStringCompareW
00252
00253 int
00254 NIStringCompareW(
00255       LPCWSTR   pcwszString1In
00256     , size_t    cch1In
00257     , LPCWSTR   pcwszString2In
00258     , size_t    cch2In
00259     )
00260 {
00261     return WrapCompareString(
00262                   FALSE
00263                 , pcwszString1In
00264                 , min( cch1In, cch2In )
00265                 , pcwszString2In
00266                 , min( cch1In, cch2In )
00267                 );
00268 } //*** NIStringCompareW
00269
00270 int
00271 NStringCompareW(
00272       LPCWSTR   pcwszString1In
00273     , size_t    cch1In
00274     , LPCWSTR   pcwszString2In
00275     , size_t    cch2In
00276     )
00277 {
00278     return WrapCompareString(
00279                   TRUE
00280                 , pcwszString1In
00281                 , min( cch1In, cch2In )
00282                 , pcwszString2In
00283                 , min( cch1In, cch2In )
00284                 );
00285 } //*** NStringCompareW
00286
00287
00288
00289 //////////////////////////////////////////////////////////////////////////////
00290 // Load string routines
00291 //////////////////////////////////////////////////////////////////////////////
00292
00293
00294 //////////////////////////////////////////////////////////////////////////////
00295 //++
00296 //
00297 //  HrLoadStringIntoBSTR
00298 //
00299 //  Description:
00300 //      Retrieves the string resource idsIn from the string table and makes it
00301 //      into a BSTR. If the BSTR is not NULL coming it, it will assume that
00302 //      you are trying reuse an existing BSTR.
00303 //
00304 //  Arguments:
00305 //      hInstanceIn
00306 //          Handle to an instance of the module whose executable file
00307 //          contains the string resource.  If not specified, defaults to
00308 //          _Module_mhInstResource.
00309 //
00310 //      langidIn
00311 //          Language ID of string table resource.
00312 //
00313 //      idsIn
00314 //          Specifies the integer identifier of the string to be loaded.
00315 //
00316 //      pbstrInout
00317 //          Pointer to the BSTR to receive the string. On a failure, the BSTR
00318 //          may be the same or NULL.
00319 //
00320 //  Return Values:
00321 //      S_OK
00322 //          The call succeeded.
00323 //
00324 //      E_OUTOFMEMORY
00325 //          Out of memory.
00326 //
00327 //      E_POINTER
00328 //          pbstrInout is NULL.
00329 //
00330 //      Other HRESULTs
00331 //          The call failed.
00332 //
00333 //  Remarks:
00334 //      This routine uses LoadResource so that it can get the actual length
00335 //      of the string resource.  If we didn't do this, we would need to call
00336 //      LoadString and allocate memory in a loop.  Very inefficient!
00337 //
00338 //--
00339 //////////////////////////////////////////////////////////////////////////////
00340 HRESULT
00341 HrLoadStringIntoBSTR(
00342       HINSTANCE hInstanceIn
00343     , LANGID    langidIn
00344     , UINT      idsIn
00345     , BSTR *    pbstrInout
00346     )
00347
00348 {
00349     HRESULT hr              = S_OK;
00350     HRSRC   hrsrc           = NULL;
00351     HGLOBAL hgbl            = NULL;
00352     int     cch             = 0;
00353     PBYTE   pbStringData;
00354     PBYTE   pbStringDataMax;
00355     PBYTE   pbStringTable;
00356     int     cbStringTable;
00357     int     nTable;
00358     int     nOffset;
00359     int     idxString;
00360
00361     assert( idsIn != 0 );
00362     assert( pbstrInout != NULL );
00363
00364     if ( pbstrInout == NULL )
00365     {
00366         hr = E_POINTER;
00367         goto Cleanup;
00368     } // if:
00369
00370     if ( hInstanceIn == NULL )
00371     {
00372         hInstanceIn = _Module.m_hInstResource;
00373     } // if:
00374
00375     //
00376     //  The resource Id specified must be converted to an index into
00377     //  a Windows StringTable.
00378     //
00379
00380     nTable = idsIn / 16;
00381     nOffset = idsIn - (nTable * 16);
00382
00383     //
00384     //  Internal Table Id's start at 1 not 0.
00385     //
00386
00387     nTable++;
00388
00389     //
00390     // Find the part of the string table where the string resides.
00391     //
00392
00393     //
00394     //  Find the table containing the string.
00395     // First try to load the language specified.  If we can't find it we
00396     // try the "neutral" language.
00397     //
00398
00399     hrsrc = FindResourceEx( hInstanceIn, RT_STRING, MAKEINTRESOURCE( nTable ), langidIn );
00400     if ( ( hrsrc == NULL ) && ( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND ) )
00401     {
00402         hrsrc = FindResourceEx(
00403                       hInstanceIn
00404                     , RT_STRING
00405                     , MAKEINTRESOURCE( nTable )
00406                     , MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )
00407                     );
00408     } // if: FindResourceEx failed
00409
00410     if ( hrsrc == NULL )
00411     {
00412         hr = HRESULT_FROM_WIN32( GetLastError() );
00413         goto Cleanup;
00414     } // if:
00415
00416     //
00417     //  Load the table.
00418     //
00419
00420     hgbl = LoadResource( hInstanceIn, hrsrc );
00421     if ( hgbl == NULL )
00422     {
00423         hr = HRESULT_FROM_WIN32( GetLastError() );
00424         goto Cleanup;
00425     } // if:
00426
00427     //
00428     //  Lock the table so we access its data.
00429     //
00430
00431     pbStringTable = reinterpret_cast< PBYTE >( LockResource( hgbl ) );
00432     if ( pbStringTable == NULL )
00433     {
00434         hr = HRESULT_FROM_WIN32( GetLastError() );
00435         goto Cleanup;
00436     } // if:
00437
00438     cbStringTable = SizeofResource( hInstanceIn, hrsrc );
00439     assert( cbStringTable != 0 );
00440
00441     //
00442     //  Set the data pointer to the beginning of the table.
00443     //
00444
00445     pbStringData = pbStringTable;
00446     pbStringDataMax = pbStringTable + cbStringTable;
00447
00448     //
00449     // Skip strings in the block of 16 which are before the desired string.
00450     //
00451
00452     for ( idxString = 0 ; idxString <= nOffset ; idxString++ )
00453     {
00454         assert( pbStringData != NULL );
00455         assert( pbStringData < pbStringDataMax );
00456
00457         //
00458         //  Get the number of characters excluding the '\0'.
00459         //
00460
00461         cch = * ( (USHORT *) pbStringData );
00462
00463         //
00464         //  Found the string.
00465         //
00466
00467         if ( idxString == nOffset )
00468         {
00469             if ( cch == 0 )
00470             {
00471                 hr = HRESULT_FROM_WIN32( ERROR_RESOURCE_NAME_NOT_FOUND );
00472                 goto Cleanup;
00473             } // if:
00474
00475             //
00476             //  Skip over the string length to get the string.
00477             //
00478
00479             pbStringData += sizeof( WCHAR );
00480
00481             break;
00482         } // if: found the string
00483
00484         //
00485         //  Add one to account for the string length.
00486         //  A string length of 0 still takes 1 WCHAR for the length portion.
00487         //
00488
00489         cch++;
00490
00491         //
00492         //  Skip over this string to get to the next string.
00493         //
00494
00495         pbStringData += ( cch * sizeof( WCHAR ) );
00496
00497     } // for: each string in the block of 16 strings in the table
00498
00499     //
00500     //  Note: nStringLen is the number of characters in the string not including the '\0'.
00501     //
00502
00503     //
00504     // If previously allocated free it before re-allocating it.
00505     //
00506
00507     if ( *pbstrInout != NULL )
00508     {
00509         SysFreeString( *pbstrInout );
00510         *pbstrInout = NULL;
00511     } // if: string was allocated previously
00512
00513     //
00514     // Allocate a BSTR for the string.
00515     //
00516
00517     *pbstrInout = SysAllocStringLen( (OLECHAR *) pbStringData, cch );
00518     if ( *pbstrInout == NULL )
00519     {
00520         hr = E_OUTOFMEMORY;
00521         goto Cleanup;
00522     } // if:
00523
00524 Cleanup:
00525
00526     return hr;
00527
00528 } //*** HrLoadStringIntoBSTR
00529
00530
00531 //////////////////////////////////////////////////////////////////////////////
00532 // Format string ID routines
00533 //////////////////////////////////////////////////////////////////////////////
00534
00535
00536 //////////////////////////////////////////////////////////////////////////////
00537 //++
00538 //
00539 //  HrFormatStringIntoBSTR
00540 //
00541 //  Description:
00542 //      Format a string (specified by idsIn, a string resource ID) and
00543 //      variable arguments into a BSTR using the FormatMessage() Win32 API.
00544 //      If the BSTR is not NULL on entry, the BSTR will be reused.
00545 //
00546 //      Calls HrFormatStringWithVAListIntoBSTR to perform the actual work.
00547 //
00548 //  Arguments:
00549 //      hInstanceIn
00550 //          Handle to an instance of the module whose executable file
00551 //          contains the string resource.
00552 //
00553 //      langidIn
00554 //          Language ID of string table resource.
00555 //
00556 //      idsIn
00557 //          Specifies the integer identifier of the string to be loaded.
00558 //
00559 //      pbstrInout
00560 //          Pointer to the BSTR to receive the string. On a failure, the BSTR
00561 //          may be the same or NULL.
00562 //
00563 //      ...
00564 //          Arguments for substitution points in the status text message.
00565 //          The FormatMessage() API is used for formatting the string, so
00566 //          substitution points must of the form %1!ws! and not %ws.
00567 //
00568 //  Return Values:
00569 //      S_OK
00570 //          The call succeeded.
00571 //
00572 //      Other HRESULTs
00573 //          The call failed.
00574 //
00575 //--
00576 //////////////////////////////////////////////////////////////////////////////
00577 HRESULT
00578 HrFormatStringIntoBSTR(
00579       HINSTANCE hInstanceIn
00580     , LANGID    langidIn
00581     , UINT      idsIn
00582     , BSTR *    pbstrInout
00583     , ...
00584     )
00585 {
00586     HRESULT hr;
00587     va_list valist;
00588
00589     va_start( valist, pbstrInout );
00590
00591     hr = HrFormatStringWithVAListIntoBSTR(
00592                           hInstanceIn
00593                         , langidIn
00594                         , idsIn
00595                         , pbstrInout
00596                         , valist
00597                         );
00598
00599     va_end( valist );
00600
00601     return hr;
00602
00603 } //*** HrFormatStringIntoBSTR
00604
00605 //////////////////////////////////////////////////////////////////////////////
00606 //++
00607 //
00608 //  HrFormatStringWithVAListIntoBSTR
00609 //
00610 //  Description:
00611 //      Format a string (specified by idsIn, a string resource ID) and
00612 //      variable arguments into a BSTR using the FormatMessage() Win32 API.
00613 //      If the BSTR is not NULL on entry, the BSTR will be reused.
00614 //
00615 //  Arguments:
00616 //      hInstanceIn
00617 //          Handle to an instance of the module whose executable file
00618 //          contains the string resource.
00619 //
00620 //      langidIn
00621 //          Language ID of string table resource.
00622 //
00623 //      idsIn
00624 //          Specifies the integer identifier of the string to be loaded.
00625 //
00626 //      pbstrInout
00627 //          Pointer to the BSTR to receive the string. On a failure, the BSTR
00628 //          may be the same or NULL.
00629 //
00630 //      valistIn
00631 //          Arguments for substitution points in the status text message.
00632 //          The FormatMessage() API is used for formatting the string, so
00633 //          substitution points must of the form %1!ws! and not %ws.
00634 //
00635 //  Return Values:
00636 //      S_OK
00637 //          The call succeeded.
00638 //
00639 //      E_OUTOFMEMORY
00640 //          Out of memory.
00641 //
00642 //      E_POINTER
00643 //          pbstrInout is NULL.
00644 //
00645 //      Other HRESULTs
00646 //          The call failed.
00647 //
00648 //--
00649 //////////////////////////////////////////////////////////////////////////////
00650 HRESULT
00651 HrFormatStringWithVAListIntoBSTR(
00652       HINSTANCE hInstanceIn
00653     , LANGID    langidIn
00654     , UINT      idsIn
00655     , BSTR *    pbstrInout
00656     , va_list   valistIn
00657     )
00658 {
00659     HRESULT hr = S_OK;
00660     BSTR    bstrStringResource = NULL;
00661     DWORD   cch;
00662     LPWSTR  pwsz = NULL;
00663
00664     assert( pbstrInout != NULL );
00665
00666     if ( pbstrInout == NULL )
00667     {
00668         hr = E_POINTER;
00669         goto Cleanup;
00670     } // if:
00671
00672     //
00673     // Load the string resource.
00674     //
00675
00676     hr = HrLoadStringIntoBSTR( hInstanceIn, langidIn, idsIn, &bstrStringResource );
00677     if ( FAILED( hr ) )
00678     {
00679         goto Cleanup;
00680     } // if:
00681
00682     //
00683     // Format the message with the arguments.
00684     //
00685
00686     cch = FormatMessage(
00687                       ( FORMAT_MESSAGE_ALLOCATE_BUFFER
00688                       | FORMAT_MESSAGE_FROM_STRING )
00689                     , bstrStringResource
00690                     , 0
00691                     , 0
00692                     , (LPWSTR) &pwsz
00693                     , 0
00694                     , &valistIn
00695                     );
00696     if ( cch == 0 )
00697     {
00698         hr = HRESULT_FROM_WIN32( GetLastError() );
00699         goto Cleanup;
00700     } // if:
00701
00702     //
00703     // If previously allocated free it before re-allocating it.
00704     //
00705
00706     if ( *pbstrInout != NULL )
00707     {
00708         SysFreeString( *pbstrInout );
00709         *pbstrInout = NULL;
00710     } // if:
00711
00712     //
00713     // Allocate a BSTR for the string.
00714     //
00715
00716     *pbstrInout = SysAllocStringLen( pwsz, cch );
00717     if ( *pbstrInout == NULL )
00718     {
00719         hr = E_OUTOFMEMORY;
00720         goto Cleanup;
00721     } // if:
00722
00723 Cleanup:
00724
00725     SysFreeString( bstrStringResource );
00726     LocalFree( pwsz );
00727
00728     return hr;
00729
00730 } //*** HrFormatStringWithVAListIntoBSTR
00731
00732
00733 //////////////////////////////////////////////////////////////////////////////
00734 // Format string routines
00735 //////////////////////////////////////////////////////////////////////////////
00736
00737
00738 //////////////////////////////////////////////////////////////////////////////
00739 //++
00740 //
00741 //  HrFormatStringIntoBSTR
00742 //
00743 //  Description:
00744 //      Format a string (specified by pcwszFmtIn) and variable arguments into
00745 //      a BSTR using the FormatMessage() Win32 API.  If the BSTR is not NULL
00746 //      on entry, the BSTR will be reused.
00747 //
00748 //      Calls HrFormatStringWithVAListIntoBSTR to perform the actual work.
00749 //
00750 //  Arguments:
00751 //      pcwszFmtIn
00752 //          Specifies the format string.
00753 //
00754 //      pbstrInout
00755 //          Pointer to the BSTR to receive the string. On a failure, the BSTR
00756 //          may be the same or NULL.
00757 //
00758 //      ...
00759 //          Arguments for substitution points in the status text message.
00760 //          The FormatMessage() API is used for formatting the string, so
00761 //          substitution points must of the form %1!ws! and not %ws.
00762 //
00763 //  Return Values:
00764 //      S_OK
00765 //          The call succeeded.
00766 //
00767 //      Other HRESULTs
00768 //          The call failed.
00769 //
00770 //--
00771 //////////////////////////////////////////////////////////////////////////////
00772 HRESULT
00773 HrFormatStringIntoBSTR(
00774       LPCWSTR   pcwszFmtIn
00775     , BSTR *    pbstrInout
00776     , ...
00777     )
00778 {
00779     HRESULT hr = S_OK;
00780     va_list valist;
00781
00782     va_start( valist, pbstrInout );
00783
00784     hr = HrFormatStringWithVAListIntoBSTR( pcwszFmtIn, pbstrInout, valist );
00785
00786     va_end( valist );
00787
00788     return hr;
00789
00790 } //*** HrFormatStringIntoBSTR
00791
00792 //////////////////////////////////////////////////////////////////////////////
00793 //++
00794 //
00795 //  HrFormatStringWithVAListIntoBSTR
00796 //
00797 //  Description:
00798 //      Format a string (specified by pcwszFmtIn) and variable arguments into
00799 //      a BSTR using the FormatMessage() Win32 API.  If the BSTR is not NULL
00800 //      on entry, the BSTR will be reused.
00801 //
00802 //  Arguments:
00803 //      pcwszFmtIn
00804 //          Specifies the format string.
00805 //
00806 //      pbstrInout
00807 //          Pointer to the BSTR to receive the string. On a failure, the BSTR
00808 //          may be the same or NULL.
00809 //
00810 //      valistIn
00811 //          Arguments for substitution points in the status text message.
00812 //          The FormatMessage() API is used for formatting the string, so
00813 //          substitution points must of the form %1!ws! and not %ws.
00814 //
00815 //  Return Values:
00816 //      S_OK
00817 //          The call succeeded.
00818 //
00819 //      E_OUTOFMEMORY
00820 //          Out of memory.
00821 //
00822 //      E_POINTER
00823 //          pcwszFmtIn or pbstrInout is NULL.
00824 //
00825 //      Other HRESULTs
00826 //          The call failed.
00827 //
00828 //--
00829 //////////////////////////////////////////////////////////////////////////////
00830 HRESULT
00831 HrFormatStringWithVAListIntoBSTR(
00832       LPCWSTR   pcwszFmtIn
00833     , BSTR *    pbstrInout
00834     , va_list   valistIn
00835     )
00836 {
00837     HRESULT hr = S_OK;
00838     DWORD   cch;
00839     LPWSTR  pwsz = NULL;
00840
00841     if (    ( pbstrInout == NULL )
00842         ||  ( pcwszFmtIn == NULL )
00843        )
00844     {
00845         hr = E_POINTER;
00846         goto Cleanup;
00847     } // if:
00848
00849     //
00850     // Format the message with the arguments.
00851     //
00852
00853     cch = FormatMessage(
00854                       ( FORMAT_MESSAGE_ALLOCATE_BUFFER
00855                       | FORMAT_MESSAGE_FROM_STRING )
00856                     , pcwszFmtIn
00857                     , 0
00858                     , 0
00859                     , (LPWSTR) &pwsz
00860                     , 0
00861                     , &valistIn
00862                     );
00863     if ( cch == 0 )
00864     {
00865         hr = HRESULT_FROM_WIN32( GetLastError() );
00866         goto Cleanup;
00867     } // if:
00868
00869     //
00870     // If previously allocated free it before re-allocating it.
00871     //
00872
00873     if ( *pbstrInout != NULL )
00874     {
00875         SysFreeString( *pbstrInout );
00876         *pbstrInout = NULL;
00877     } // if:
00878
00879     //
00880     // Allocate a BSTR for the string.
00881     //
00882
00883     *pbstrInout = SysAllocStringLen( pwsz, cch );
00884     if ( *pbstrInout == NULL )
00885     {
00886         hr = E_OUTOFMEMORY;
00887         goto Cleanup;
00888     } // if:
00889
00890 Cleanup:
00891
00892     LocalFree( pwsz );
00893
00894     return hr;
00895
00896 } //*** HrFormatStringWithVAListIntoBSTR
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/MidiPlyr/SEQUENCE.c Source File

  • Multimedia
  • Audio
  • MidiPlyr

SEQUENCE.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002 *
00003 *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 *  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
00006 *  A PARTICULAR PURPOSE.
00007 *
00008 *  Copyright 1993 - 2000 Microsoft Corporation. All Rights Reserved.
00009 *
00010 ******************************************************************************
00011 *
00012 * Sequence.C
00013 *
00014 * Sequencer engine for MIDI player app
00015 *
00016 *****************************************************************************/
00017
00018 #include <windows.h>
00019 #include <windowsx.h>
00020 #include <mmsystem.h>
00021 #include <limits.h>
00022
00023 #include "debug.h"
00024 #include "seq.h"
00025
00026 PRIVATE void FAR PASCAL seqMIDICallback(HMIDISTRM hms, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
00027 PRIVATE MMRESULT FNLOCAL XlatSMFErr(SMFRESULT smfrc);
00028
00029 /***************************************************************************
00030 *
00031 * seqAllocBuffers
00032 *
00033 * Allocate buffers for this instance.
00034 *
00035 * pSeq                      - The sequencer instance to allocate buffers for.
00036 *
00037 * Returns
00038 *   MMSYSERR_NOERROR If the operation was successful.
00039 *
00040 *   MCIERR_OUT_OF_MEMORY  If there is insufficient memory for
00041 *     the requested number and size of buffers.
00042 *
00043 * seqAllocBuffers allocates playback buffers based on the
00044 * cbBuffer and cBuffer fields of pSeq. cbBuffer specifies the
00045 * number of bytes in each buffer, and cBuffer specifies the
00046 * number of buffers to allocate.
00047 *
00048 * seqAllocBuffers must be called before any other sequencer call
00049 * on a newly allocted SEQUENCE structure. It must be paired with
00050 * a call to seqFreeBuffers, which should be the last call made
00051 * before the SEQUENCE structure is discarded.
00052 *
00053 ***************************************************************************/
00054 MMRESULT FNLOCAL seqAllocBuffers(
00055     PSEQ                    pSeq)
00056 {
00057     DWORD                   dwEachBufferSize;
00058     DWORD                   dwAlloc;
00059     UINT                    i;
00060     LPBYTE                  lpbWork;
00061
00062     assert(pSeq != NULL);
00063
00064     pSeq->uState    = SEQ_S_NOFILE;
00065     pSeq->lpmhFree  = NULL;
00066     pSeq->lpbAlloc  = NULL;
00067     pSeq->hSmf      = (HSMF)NULL;
00068
00069     /* First make sure we can allocate the buffers they asked for
00070     */
00071     dwEachBufferSize = sizeof(MIDIHDR) + (DWORD)(pSeq->cbBuffer);
00072     dwAlloc          = dwEachBufferSize * (DWORD)(pSeq->cBuffer);
00073
00074     pSeq->lpbAlloc = GlobalAllocPtr(GMEM_MOVEABLE|GMEM_SHARE, dwAlloc);
00075     if (NULL == pSeq->lpbAlloc)
00076         return MCIERR_OUT_OF_MEMORY;
00077
00078     /* Initialize all MIDIHDR's and throw them into a free list
00079     */
00080     pSeq->lpmhFree = NULL;
00081
00082     lpbWork = pSeq->lpbAlloc;
00083     for (i=0; i < pSeq->cBuffer; i++)
00084     {
00085         ((LPMIDIHDR)lpbWork)->lpNext            = pSeq->lpmhFree;
00086
00087         ((LPMIDIHDR)lpbWork)->lpData            = lpbWork + sizeof(MIDIHDR);
00088         ((LPMIDIHDR)lpbWork)->dwBufferLength    = pSeq->cbBuffer;
00089         ((LPMIDIHDR)lpbWork)->dwBytesRecorded   = 0;
00090         ((LPMIDIHDR)lpbWork)->dwUser            = (DWORD)(UINT)pSeq;
00091         ((LPMIDIHDR)lpbWork)->dwFlags           = 0;
00092
00093         pSeq->lpmhFree = (LPMIDIHDR)lpbWork;
00094
00095         lpbWork += dwEachBufferSize;
00096     }
00097
00098     return MMSYSERR_NOERROR;
00099 }
00100
00101 /***************************************************************************
00102 *
00103 * seqFreeBuffers
00104 *
00105 * Free buffers for this instance.
00106 *
00107 * pSeq                      - The sequencer instance to free buffers for.
00108 *
00109 * seqFreeBuffers frees all allocated memory belonging to the
00110 * given sequencer instance pSeq. It must be the last call
00111 * performed on the instance before it is destroyed.
00112 *
00113 ****************************************************************************/
00114 VOID FNLOCAL seqFreeBuffers(
00115     PSEQ                    pSeq)
00116 {
00117     LPMIDIHDR               lpmh;
00118
00119     assert(pSeq != NULL);
00120
00121     if (NULL != pSeq->lpbAlloc)
00122     {
00123         lpmh = (LPMIDIHDR)pSeq->lpbAlloc;
00124         assert(!(lpmh->dwFlags & MHDR_PREPARED));
00125
00126         GlobalFreePtr(pSeq->lpbAlloc);
00127     }
00128 }
00129
00130 /***************************************************************************
00131 *
00132 * seqOpenFile
00133 *
00134 * Associates a MIDI file with the given sequencer instance.
00135 *
00136 * pSeq                      - The sequencer instance.
00137 *
00138 * Returns
00139 *   MMSYSERR_NOERROR If the operation is successful.
00140 *
00141 *   MCIERR_UNSUPPORTED_FUNCTION If there is already a file open
00142 *     on this instance.
00143 *
00144 *   MCIERR_OUT_OF_MEMORY If there was insufficient memory to
00145 *     allocate internal buffers on the file.
00146 *
00147 *   MCIERR_INVALID_FILE If initial attempts to parse the file
00148 *     failed (such as the file is not a MIDI or RMI file).
00149 *
00150 * seqOpenFile may only be called if there is no currently open file
00151 * on the instance. It must be paired with a call to seqCloseFile
00152 * when operations on this file are complete.
00153 *
00154 * The pstrFile field of pSeq contains the name of the file
00155 * to open. This name will be passed directly to mmioOpen; it may
00156 * contain a specifcation for a custom MMIO file handler. The task
00157 * context used for all I/O will be the task which calls seqOpenFile.
00158 *
00159 ***************************************************************************/
00160 MMRESULT FNLOCAL seqOpenFile(
00161     PSEQ                    pSeq)
00162 {
00163     MMRESULT                rc      = MMSYSERR_NOERROR;
00164     SMFOPENFILESTRUCT       sofs;
00165     SMFFILEINFO             sfi;
00166     SMFRESULT               smfrc;
00167     DWORD                   cbBuffer;
00168
00169     assert(pSeq != NULL);
00170
00171     if (pSeq->uState != SEQ_S_NOFILE)
00172     {
00173         return MCIERR_UNSUPPORTED_FUNCTION;
00174     }
00175
00176     assert(pSeq->pstrFile != NULL);
00177
00178     sofs.pstrName     = pSeq->pstrFile;
00179
00180     smfrc = smfOpenFile(&sofs);
00181     if (SMF_SUCCESS != smfrc)
00182     {
00183         rc = XlatSMFErr(smfrc);
00184         goto Seq_Open_File_Cleanup;
00185     }
00186
00187     pSeq->hSmf = sofs.hSmf;
00188     smfGetFileInfo(pSeq->hSmf, &sfi);
00189
00190     pSeq->dwTimeDivision = sfi.dwTimeDivision;
00191     pSeq->tkLength       = sfi.tkLength;
00192     pSeq->cTrk           = sfi.dwTracks;
00193
00194     /* Track buffers must be big enough to hold the state data returned
00195     ** by smfSeek()
00196     */
00197     cbBuffer = min(pSeq->cbBuffer, smfGetStateMaxSize());
00198
00199 Seq_Open_File_Cleanup:
00200     if (MMSYSERR_NOERROR != rc)
00201         seqCloseFile(pSeq);
00202     else
00203         pSeq->uState = SEQ_S_OPENED;
00204
00205     return rc;
00206 }
00207
00208 /***************************************************************************
00209 *
00210 * seqCloseFile
00211 *
00212 * Deassociates a MIDI file with the given sequencer instance.
00213 *
00214 * pSeq                      -  The sequencer instance.
00215 *
00216 * Returns
00217 *   MMSYSERR_NOERROR If the operation is successful.
00218 *
00219 *   MCIERR_UNSUPPORTED_FUNCTION If the sequencer instance is not
00220 *     stopped.
00221 *
00222 * A call to seqCloseFile must be paired with a prior call to
00223 * seqOpenFile. All buffers associated with the file will be
00224 * freed and the file will be closed. The sequencer must be
00225 * stopped before this call will be accepted.
00226 *
00227 ***************************************************************************/
00228 MMRESULT FNLOCAL seqCloseFile(
00229     PSEQ                    pSeq)
00230 {
00231     LPMIDIHDR               lpmh;
00232
00233     assert(pSeq != NULL);
00234
00235     if (SEQ_S_OPENED != pSeq->uState)
00236         return MCIERR_UNSUPPORTED_FUNCTION;
00237
00238     if ((HSMF)NULL != pSeq->hSmf)
00239     {
00240         smfCloseFile(pSeq->hSmf);
00241         pSeq->hSmf = (HSMF)NULL;
00242     }
00243
00244     /* If we were prerolled, need to clean up -- have an open MIDI handle
00245     ** and buffers in the ready queue
00246     */
00247
00248     for (lpmh = pSeq->lpmhFree; lpmh; lpmh = lpmh->lpNext)
00249         midiOutUnprepareHeader(pSeq->hmidi, lpmh, sizeof(*lpmh));
00250
00251     if (pSeq->lpmhPreroll)
00252         midiOutUnprepareHeader(pSeq->hmidi, pSeq->lpmhPreroll, sizeof(*pSeq->lpmhPreroll));
00253
00254     if (pSeq->hmidi != NULL)
00255     {
00256         midiStreamClose((HMIDISTRM)(pSeq->hmidi));
00257         pSeq->hmidi = NULL;
00258     }
00259
00260     pSeq->uState = SEQ_S_NOFILE;
00261
00262     return MMSYSERR_NOERROR;
00263 }
00264
00265 /***************************************************************************
00266 *
00267 * seqPreroll
00268 *
00269 * Prepares the file for playback at the given position.
00270 *
00271 * pSeq                      - The sequencer instance.
00272 *
00273 * lpPreroll                 - Specifies the starting and ending tick
00274 *                             positions to play between.
00275 *
00276 * Returns
00277 *   MMSYSERR_NOERROR If the operation is successful.
00278 *
00279 *   MCIERR_UNSUPPORTED_FUNCTION If the sequencer instance is not
00280 *     opened or prerolled.
00281 *
00282 * Open the device so we can initialize channels.
00283 *
00284 * Loop through the tracks. For each track, seek to the given position and
00285 * send the init data SMF gives us to the handle.
00286 *
00287 * Wait for all init buffers to finish.
00288 *
00289 * Unprepare the buffers (they're only ever sent here; the sequencer
00290 * engine merges them into a single stream during normal playback) and
00291 * refill them with the first chunk of data from the track.
00292 *
00293 *
00294 ****************************************************************************/
00295 MMRESULT FNLOCAL seqPreroll(
00296     PSEQ                    pSeq,
00297     LPPREROLL               lpPreroll)
00298 {
00299     SMFRESULT           smfrc;
00300     MMRESULT            mmrc        = MMSYSERR_NOERROR;
00301     MIDIPROPTIMEDIV     mptd;
00302     LPMIDIHDR           lpmh = NULL;
00303     LPMIDIHDR           lpmhPreroll = NULL;
00304     DWORD               cbPrerollBuffer;
00305     UINT                uDeviceID;
00306
00307     assert(pSeq != NULL);
00308
00309     pSeq->mmrcLastErr = MMSYSERR_NOERROR;
00310
00311     if (pSeq->uState != SEQ_S_OPENED &&
00312         pSeq->uState != SEQ_S_PREROLLED)
00313         return MCIERR_UNSUPPORTED_FUNCTION;
00314
00315   pSeq->tkBase = lpPreroll->tkBase;
00316   pSeq->tkEnd = lpPreroll->tkEnd;
00317
00318     if (pSeq->hmidi)
00319     {
00320         // Recollect buffers from MMSYSTEM back into free queue
00321         //
00322         pSeq->uState = SEQ_S_RESET;
00323         midiOutReset(pSeq->hmidi);
00324
00325     while (pSeq->uBuffersInMMSYSTEM)
00326       Sleep(0);
00327     }
00328
00329     pSeq->uBuffersInMMSYSTEM = 0;
00330     pSeq->uState = SEQ_S_PREROLLING;
00331
00332     //
00333     // We've successfully opened the file and all of the tracks; now
00334     // open the MIDI device and set the time division.
00335     //
00336     // NOTE: seqPreroll is equivalent to seek; device might already be open
00337     //
00338     if (NULL == pSeq->hmidi)
00339     {
00340         uDeviceID = pSeq->uDeviceID;
00341         if ((mmrc = midiStreamOpen(&(HMIDISTRM)pSeq->hmidi,
00342                                    &uDeviceID,
00343                                    1,
00344                                    (DWORD)seqMIDICallback,
00345                                    0,
00346                                    CALLBACK_FUNCTION)) != MMSYSERR_NOERROR)
00347         {
00348             pSeq->hmidi = NULL;
00349             goto seq_Preroll_Cleanup;
00350         }
00351
00352         mptd.cbStruct  = sizeof(mptd);
00353         mptd.dwTimeDiv = pSeq->dwTimeDivision;
00354         if ((mmrc = midiStreamProperty(
00355                                        (HMIDISTRM)pSeq->hmidi,
00356                                        (LPBYTE)&mptd,
00357                                        MIDIPROP_SET|MIDIPROP_TIMEDIV)) != MMSYSERR_NOERROR)
00358         {
00359             DPF(1, "midiStreamProperty() -> %04X", (WORD)mmrc);
00360             midiStreamClose((HMIDISTRM)pSeq->hmidi);
00361             pSeq->hmidi = NULL;
00362             mmrc = MCIERR_DEVICE_NOT_READY;
00363             goto seq_Preroll_Cleanup;
00364         }
00365     }
00366
00367     mmrc = MMSYSERR_NOERROR;
00368
00369     //
00370     //  Allocate a preroll buffer.  Then if we don't have enough room for
00371     //  all the preroll info, we make the buffer larger.
00372     //
00373     if (!pSeq->lpmhPreroll)
00374     {
00375         cbPrerollBuffer = 4096;
00376         lpmhPreroll = (LPMIDIHDR)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_SHARE,
00377                                                             cbPrerollBuffer);
00378     }
00379     else
00380     {
00381         cbPrerollBuffer = pSeq->cbPreroll;
00382         lpmhPreroll = pSeq->lpmhPreroll;
00383     }
00384
00385     lpmhPreroll->lpNext            = pSeq->lpmhFree;
00386     lpmhPreroll->lpData            = (LPBYTE)lpmhPreroll + sizeof(MIDIHDR);
00387     lpmhPreroll->dwBufferLength    = cbPrerollBuffer - sizeof(MIDIHDR);
00388     lpmhPreroll->dwBytesRecorded   = 0;
00389     lpmhPreroll->dwUser            = (DWORD)(UINT)pSeq;
00390     lpmhPreroll->dwFlags           = 0;
00391
00392     do
00393     {
00394         smfrc = smfSeek(pSeq->hSmf, pSeq->tkBase, lpmhPreroll);
00395         if( SMF_SUCCESS != smfrc )
00396         {
00397             if( ( SMF_NO_MEMORY != smfrc )  ||
00398                 ( cbPrerollBuffer >= 32768L ) )
00399             {
00400                 DPF(1, "smfSeek() returned %lu", (DWORD)smfrc);
00401
00402                 GlobalFreePtr(lpmhPreroll);
00403                 pSeq->lpmhPreroll = NULL;
00404
00405                 mmrc = XlatSMFErr(smfrc);
00406                 goto seq_Preroll_Cleanup;
00407             }
00408             else   //  Try to grow buffer.
00409             {
00410                 cbPrerollBuffer *= 2;
00411                 lpmh = (LPMIDIHDR)GlobalReAllocPtr( lpmhPreroll, cbPrerollBuffer, 0 );
00412                 if( NULL == lpmh )
00413                 {
00414                     DPF(2,"seqPreroll - realloc failed, aborting preroll.");
00415                     mmrc = MCIERR_OUT_OF_MEMORY;
00416                     goto seq_Preroll_Cleanup;
00417                 }
00418
00419                 lpmhPreroll = lpmh;
00420                 lpmhPreroll->lpData = (LPBYTE)lpmhPreroll + sizeof(MIDIHDR);
00421                 lpmhPreroll->dwBufferLength = cbPrerollBuffer - sizeof(MIDIHDR);
00422
00423                 pSeq->lpmhPreroll = lpmhPreroll;
00424                 pSeq->cbPreroll = cbPrerollBuffer;
00425             }
00426         }
00427     } while( SMF_SUCCESS != smfrc );
00428
00429     if (MMSYSERR_NOERROR != (mmrc = midiOutPrepareHeader(pSeq->hmidi, lpmhPreroll, sizeof(MIDIHDR))))
00430     {
00431         DPF(1, "midiOutPrepare(preroll) -> %lu!", (DWORD)mmrc);
00432
00433         mmrc = MCIERR_DEVICE_NOT_READY;
00434         goto seq_Preroll_Cleanup;
00435     }
00436
00437     ++pSeq->uBuffersInMMSYSTEM;
00438
00439     if (MMSYSERR_NOERROR != (mmrc = midiStreamOut((HMIDISTRM)pSeq->hmidi, lpmhPreroll, sizeof(MIDIHDR))))
00440     {
00441         DPF(1, "midiStreamOut(preroll) -> %lu!", (DWORD)mmrc);
00442
00443         mmrc = MCIERR_DEVICE_NOT_READY;
00444         --pSeq->uBuffersInMMSYSTEM;
00445         goto seq_Preroll_Cleanup;
00446     }
00447     DPF(3,"seqPreroll: midiStreamOut(0x%x,0x%lx,%u) returned %u.",pSeq->hmidi,lpmhPreroll,sizeof(MIDIHDR),mmrc);
00448
00449     pSeq->fdwSeq &= ~SEQ_F_EOF;
00450     while (pSeq->lpmhFree)
00451     {
00452         lpmh = pSeq->lpmhFree;
00453         pSeq->lpmhFree = lpmh->lpNext;
00454
00455         smfrc = smfReadEvents(pSeq->hSmf, lpmh, pSeq->tkEnd);
00456         if (SMF_SUCCESS != smfrc && SMF_END_OF_FILE != smfrc)
00457         {
00458             DPF(1, "SFP: smfReadEvents() -> %u", (UINT)smfrc);
00459             mmrc = XlatSMFErr(smfrc);
00460             goto seq_Preroll_Cleanup;
00461         }
00462
00463         if (MMSYSERR_NOERROR != (mmrc = midiOutPrepareHeader(pSeq->hmidi, lpmh, sizeof(*lpmh))))
00464         {
00465             DPF(1, "SFP: midiOutPrepareHeader failed");
00466             goto seq_Preroll_Cleanup;
00467         }
00468
00469         if (MMSYSERR_NOERROR != (mmrc = midiStreamOut((HMIDISTRM)pSeq->hmidi, lpmh, sizeof(*lpmh))))
00470         {
00471             DPF(1, "SFP: midiStreamOut failed");
00472             goto seq_Preroll_Cleanup;
00473         }
00474
00475         ++pSeq->uBuffersInMMSYSTEM;
00476
00477         if (SMF_END_OF_FILE == smfrc)
00478         {
00479             pSeq->fdwSeq |= SEQ_F_EOF;
00480             break;
00481         }
00482     }
00483
00484 seq_Preroll_Cleanup:
00485     if (MMSYSERR_NOERROR != mmrc)
00486     {
00487         pSeq->uState = SEQ_S_OPENED;
00488         pSeq->fdwSeq &= ~SEQ_F_WAITING;
00489     }
00490     else
00491     {
00492         pSeq->uState = SEQ_S_PREROLLED;
00493     }
00494
00495     return mmrc;
00496 }
00497
00498 /***************************************************************************
00499 *
00500 * seqStart
00501 *
00502 * Starts playback at the current position.
00503 *
00504 * pSeq                      - The sequencer instance.
00505 *
00506 * Returns
00507 *   MMSYSERR_NOERROR If the operation is successful.
00508 *
00509 *   MCIERR_UNSUPPORTED_FUNCTION If the sequencer instance is not
00510 *     stopped.
00511 *
00512 *   MCIERR_DEVICE_NOT_READY If the underlying MIDI device could
00513 *     not be opened or fails any call.
00514 *
00515 * The sequencer must be prerolled before seqStart may be called.
00516 *
00517 * Just feed everything in the ready queue to the device.
00518 *
00519 ***************************************************************************/
00520 MMRESULT FNLOCAL seqStart(
00521     PSEQ                    pSeq)
00522 {
00523     assert(NULL != pSeq);
00524
00525     if (SEQ_S_PREROLLED != pSeq->uState)
00526     {
00527         DPF(1, "seqStart(): State is wrong! [%u]", pSeq->uState);
00528         return MCIERR_UNSUPPORTED_FUNCTION;
00529     }
00530
00531     pSeq->uState = SEQ_S_PLAYING;
00532
00533     return midiStreamRestart((HMIDISTRM)pSeq->hmidi);
00534 }
00535
00536 /***************************************************************************
00537 *
00538 * seqPause
00539 *
00540 * Pauses playback of the instance.
00541 *
00542 * pSeq                      - The sequencer instance.
00543 *
00544 * Returns
00545 *   MMSYSERR_NOERROR If the operation is successful.
00546 *
00547 *   MCIERR_UNSUPPORTED_FUNCTION If the sequencer instance is not
00548 *     playing.
00549 *
00550 * The sequencer must be playing before seqPause may be called.
00551 * Pausing the sequencer will cause all currently on notes to be turned
00552 * off. This may cause playback to be slightly inaccurate on restart
00553 * due to missing notes.
00554 *
00555 ***************************************************************************/
00556 MMRESULT FNLOCAL seqPause(
00557     PSEQ                    pSeq)
00558 {
00559     assert(NULL != pSeq);
00560
00561     if (SEQ_S_PLAYING != pSeq->uState)
00562         return MCIERR_UNSUPPORTED_FUNCTION;
00563
00564     pSeq->uState = SEQ_S_PAUSED;
00565     midiStreamPause((HMIDISTRM)pSeq->hmidi);
00566
00567     return MMSYSERR_NOERROR;
00568 }
00569
00570 /***************************************************************************
00571 *
00572 * seqRestart
00573 *
00574 * Restarts playback of an instance after a pause.
00575 *
00576 * pSeq                      - The sequencer instance.
00577 *
00578 * Returns
00579 *    MMSYSERR_NOERROR If the operation is successful.
00580 *
00581 *    MCIERR_UNSUPPORTED_FUNCTION If the sequencer instance is not
00582 *     paused.
00583 *
00584 * The sequencer must be paused before seqRestart may be called.
00585 *
00586 ***************************************************************************/
00587 MMRESULT FNLOCAL seqRestart(
00588     PSEQ                    pSeq)
00589 {
00590     assert(NULL != pSeq);
00591
00592     if (SEQ_S_PAUSED != pSeq->uState)
00593         return MCIERR_UNSUPPORTED_FUNCTION;
00594
00595     pSeq->uState = SEQ_S_PLAYING;
00596     midiStreamRestart((HMIDISTRM)pSeq->hmidi);
00597
00598     return MMSYSERR_NOERROR;
00599 }
00600
00601 /***************************************************************************
00602 *
00603 * seqStop
00604 *
00605 * Totally stops playback of an instance.
00606 *
00607 * pSeq                      - The sequencer instance.
00608 *
00609 * Returns
00610 *   MMSYSERR_NOERROR If the operation is successful.
00611 *
00612 *   MCIERR_UNSUPPORTED_FUNCTION If the sequencer instance is not
00613 *     paused or playing.
00614 *
00615 * The sequencer must be paused or playing before seqStop may be called.
00616 *
00617 ***************************************************************************/
00618 MMRESULT FNLOCAL seqStop(
00619     PSEQ                    pSeq)
00620 {
00621     assert(NULL != pSeq);
00622
00623     /* Automatic success if we're already stopped
00624     */
00625     if (SEQ_S_PLAYING != pSeq->uState &&
00626         SEQ_S_PAUSED != pSeq->uState)
00627     {
00628         pSeq->fdwSeq &= ~SEQ_F_WAITING;
00629         return MMSYSERR_NOERROR;
00630     }
00631
00632     pSeq->uState = SEQ_S_STOPPING;
00633     pSeq->fdwSeq |= SEQ_F_WAITING;
00634
00635     if (MMSYSERR_NOERROR != (pSeq->mmrcLastErr = midiStreamStop((HMIDISTRM)pSeq->hmidi)))
00636     {
00637         DPF(1, "midiOutStop() returned %lu in seqStop()!", (DWORD)pSeq->mmrcLastErr);
00638
00639         pSeq->fdwSeq &= ~SEQ_F_WAITING;
00640         return MCIERR_DEVICE_NOT_READY;
00641     }
00642
00643   while (pSeq->uBuffersInMMSYSTEM)
00644     Sleep(0);
00645
00646     return MMSYSERR_NOERROR;
00647 }
00648
00649 /***************************************************************************
00650 *
00651 * seqTime
00652 *
00653 * Determine the current position in playback of an instance.
00654 *
00655 * pSeq                      - The sequencer instance.
00656 *
00657 * pTicks                    - A pointer to a DWORD where the current position
00658 *                             in ticks will be returned.
00659 *
00660 * Returns
00661 *   MMSYSERR_NOERROR If the operation is successful.
00662 *
00663 *   MCIERR_DEVICE_NOT_READY If the underlying device fails to report
00664 *     the position.
00665 *
00666 *   MCIERR_UNSUPPORTED_FUNCTION If the sequencer instance is not
00667 *     paused or playing.
00668 *
00669 * The sequencer must be paused, playing or prerolled before seqTime
00670 * may be called.
00671 *
00672 ***************************************************************************/
00673 MMRESULT FNLOCAL seqTime(
00674     PSEQ                    pSeq,
00675     PTICKS                  pTicks)
00676 {
00677     MMRESULT                mmr;
00678     MMTIME                  mmt;
00679
00680     assert(pSeq != NULL);
00681
00682     if (SEQ_S_PLAYING != pSeq->uState &&
00683         SEQ_S_PAUSED != pSeq->uState &&
00684         SEQ_S_PREROLLING != pSeq->uState &&
00685         SEQ_S_PREROLLED != pSeq->uState &&
00686         SEQ_S_OPENED != pSeq->uState)
00687     {
00688         DPF(1, "seqTime(): State wrong! [is %u]", pSeq->uState);
00689         return MCIERR_UNSUPPORTED_FUNCTION;
00690     }
00691
00692     *pTicks = 0;
00693     if (SEQ_S_OPENED != pSeq->uState)
00694     {
00695         *pTicks = pSeq->tkBase;
00696         if (SEQ_S_PREROLLED != pSeq->uState)
00697         {
00698             mmt.wType = TIME_TICKS;
00699             mmr = midiStreamPosition((HMIDISTRM)pSeq->hmidi, &mmt, sizeof(mmt));
00700             if (MMSYSERR_NOERROR != mmr)
00701             {
00702                 DPF(1, "midiStreamPosition() returned %lu", (DWORD)mmr);
00703                 return MCIERR_DEVICE_NOT_READY;
00704             }
00705
00706             *pTicks += mmt.u.ticks;
00707         }
00708     }
00709
00710     return MMSYSERR_NOERROR;
00711 }
00712
00713 /***************************************************************************
00714 *
00715 * seqMillisecsToTicks
00716 *
00717 * Given a millisecond offset in the output stream, returns the associated
00718 * tick position.
00719 *
00720 * pSeq                      - The sequencer instance.
00721 *
00722 * msOffset                  - The millisecond offset into the stream.
00723 *
00724 * Returns the number of ticks into the stream.
00725 *
00726 ***************************************************************************/
00727 TICKS FNLOCAL seqMillisecsToTicks(
00728     PSEQ                    pSeq,
00729     DWORD                   msOffset)
00730 {
00731     return smfMillisecsToTicks(pSeq->hSmf, msOffset);
00732 }
00733
00734 /***************************************************************************
00735 *
00736 * seqTicksToMillisecs
00737 *
00738 * Given a tick offset in the output stream, returns the associated
00739 * millisecond position.
00740 *
00741 * pSeq                      - The sequencer instance.
00742 *
00743 * tkOffset                  - The tick offset into the stream.
00744 *
00745 * Returns the number of milliseconds into the stream.
00746 *
00747 ***************************************************************************/
00748 DWORD FNLOCAL seqTicksToMillisecs(
00749     PSEQ                    pSeq,
00750     TICKS                   tkOffset)
00751 {
00752     return smfTicksToMillisecs(pSeq->hSmf, tkOffset);
00753 }
00754
00755 /***************************************************************************
00756 *
00757 * seqMIDICallback
00758 *
00759 * Called by the system when a buffer is done
00760 *
00761 * dw1                       - The buffer that has completed playback.
00762 *
00763 ***************************************************************************/
00764 PRIVATE void FAR PASCAL seqMIDICallback(HMIDISTRM hms, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
00765 {
00766   LPMIDIHDR         lpmh    = (LPMIDIHDR)dw1;
00767     PSEQ                    pSeq;
00768     MMRESULT                mmrc;
00769     SMFRESULT               smfrc;
00770
00771   if (uMsg != MOM_DONE)
00772     return;
00773
00774   assert(NULL != lpmh);
00775
00776     pSeq = (PSEQ)(lpmh->dwUser);
00777
00778     assert(pSeq != NULL);
00779
00780     --pSeq->uBuffersInMMSYSTEM;
00781
00782     if (SEQ_S_RESET == pSeq->uState)
00783     {
00784         // We're recollecting buffers from MMSYSTEM
00785         //
00786     if (lpmh != pSeq->lpmhPreroll)
00787     {
00788           lpmh->lpNext   = pSeq->lpmhFree;
00789           pSeq->lpmhFree = lpmh;
00790     }
00791
00792         return;
00793     }
00794
00795
00796     if ((SEQ_S_STOPPING == pSeq->uState) || (pSeq->fdwSeq & SEQ_F_EOF))
00797     {
00798         /*
00799         ** Reached EOF, just put the buffer back on the free
00800         ** list
00801         */
00802     if (lpmh != pSeq->lpmhPreroll)
00803     {
00804           lpmh->lpNext   = pSeq->lpmhFree;
00805           pSeq->lpmhFree = lpmh;
00806     }
00807
00808         if (MMSYSERR_NOERROR != (mmrc = midiOutUnprepareHeader(pSeq->hmidi, lpmh, sizeof(*lpmh))))
00809         {
00810             DPF(1, "midiOutUnprepareHeader failed in seqBufferDone! (%lu)", (DWORD)mmrc);
00811         }
00812
00813         if (0 == pSeq->uBuffersInMMSYSTEM)
00814         {
00815             DPF(1, "seqBufferDone: normal sequencer shutdown.");
00816
00817             /* Totally done! Free device and notify.
00818             */
00819             midiStreamClose((HMIDISTRM)pSeq->hmidi);
00820
00821             pSeq->hmidi = NULL;
00822             pSeq->uState = SEQ_S_OPENED;
00823             pSeq->mmrcLastErr = MMSYSERR_NOERROR;
00824             pSeq->fdwSeq &= ~SEQ_F_WAITING;
00825
00826           // lParam indicates whether or not to preroll again. Don't if we were explicitly
00827           // stopped.
00828           //
00829             PostMessage(pSeq->hWnd, MMSG_DONE, (WPARAM)pSeq, (LPARAM)(SEQ_S_STOPPING != pSeq->uState));
00830         }
00831     }
00832     else
00833     {
00834         /*
00835         ** Not EOF yet; attempt to fill another buffer
00836         */
00837         smfrc = smfReadEvents(pSeq->hSmf, lpmh, pSeq->tkEnd);
00838
00839         switch(smfrc)
00840         {
00841             case SMF_SUCCESS:
00842                 break;
00843
00844             case SMF_END_OF_FILE:
00845                 pSeq->fdwSeq |= SEQ_F_EOF;
00846                 smfrc = SMF_SUCCESS;
00847                 break;
00848
00849             default:
00850                 DPF(1, "smfReadEvents returned %lu in callback!", (DWORD)smfrc);
00851                 pSeq->uState = SEQ_S_STOPPING;
00852                 break;
00853         }
00854
00855         if (SMF_SUCCESS == smfrc)
00856         {
00857             ++pSeq->uBuffersInMMSYSTEM;
00858             mmrc = midiStreamOut((HMIDISTRM)pSeq->hmidi, lpmh, sizeof(*lpmh));
00859             if (MMSYSERR_NOERROR != mmrc)
00860             {
00861                 DPF(1, "seqBufferDone(): midiStreamOut() returned %lu!", (DWORD)mmrc);
00862
00863                 --pSeq->uBuffersInMMSYSTEM;
00864                 pSeq->uState = SEQ_S_STOPPING;
00865             }
00866         }
00867     }
00868 }
00869
00870 /***************************************************************************
00871 *
00872 * XlatSMFErr
00873 *
00874 * Translates an error from the SMF layer into an appropriate MCI error.
00875 *
00876 * smfrc                     - The return code from any SMF function.
00877 *
00878 * Returns
00879 *   A parallel error from the MCI error codes.
00880 *
00881 ***************************************************************************/
00882 PRIVATE MMRESULT FNLOCAL XlatSMFErr(
00883     SMFRESULT               smfrc)
00884 {
00885     switch(smfrc)
00886     {
00887         case SMF_SUCCESS:
00888             return MMSYSERR_NOERROR;
00889
00890         case SMF_NO_MEMORY:
00891             return MCIERR_OUT_OF_MEMORY;
00892
00893         case SMF_INVALID_FILE:
00894         case SMF_OPEN_FAILED:
00895         case SMF_INVALID_TRACK:
00896             return MCIERR_INVALID_FILE;
00897
00898         default:
00899             return MCIERR_UNSUPPORTED_FUNCTION;
00900     }
00901 }
00902
00903
00904
00905
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagICONEXTRACT Member List

This is the complete list of members for tagICONEXTRACT, including all inherited members.
fAND | tagICONEXTRACT
hIcon | tagICONEXTRACT
hMemAND | tagICONEXTRACT
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/queryparser/QueryParser.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • queryparser

QueryParser.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002 //
00003 // Copyright (c) Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  QueryParser.cpp
00006 //
00007 // Description:
00008 //      WMI Query Parser Sample.
00009 //      This sample shows how to use the Query Parser.  It takes a query as a command
00010 //      line argument and passes it off to the parser to be parsed and then uses various
00011 //      functions to get pieces of the path. the sample has been designed to handle only simple
00012
00013 //    select queries.
00014 //
00015 // **************************************************************************
00016
00017
00018 #define _WIN32_WINNT    0x0400
00019
00020 #include <windows.h>
00021 #include <stdio.h>
00022 #include <wmiutils.h>
00023 #include <strsafe.h>
00024
00025 LPWSTR g_pQuery = 0;
00026
00027 //***************************************************************************
00028 //
00029 // DumpFeatureMasks
00030 //
00031 // Purpose: Outputs the mask in readable format
00032 //
00033 //***************************************************************************
00034
00035 void DumpFeatureMasks(unsigned __int64 mask)
00036 {
00037     printf("Query Features:\n");
00038
00039     if (mask & WMIQ_RPNF_WHERE_CLAUSE_PRESENT)
00040         printf("WMIQ_RPNF_WHERE_CLAUSE_PRESENT\n");
00041
00042     if (mask & WMIQ_RPNF_QUERY_IS_CONJUNCTIVE)
00043         printf("WMIQ_RPNF_QUERY_IS_CONJUNCTIVE\n");
00044
00045     if (mask & WMIQ_RPNF_QUERY_IS_DISJUNCTIVE)
00046         printf("WMIQ_RPNF_QUERY_IS_DISJUNCTIVE\n");
00047
00048     if (mask & WMIQ_RPNF_PROJECTION)
00049         printf("WMIQ_RPNF_PROJECTION\n");
00050
00051     if (mask & WMIQ_RPNF_FEATURE_SELECT_STAR)
00052         printf("WMIQ_RPNF_FEATURE_SELECT_STAR\n");
00053
00054     if (mask & WMIQ_RPNF_EQUALITY_TESTS_ONLY)
00055         printf("WMIQ_RPNF_EQUALITY_TESTS_ONLY\n");
00056
00057     if (mask & WMIQ_RPNF_COUNT_STAR)
00058         printf("WMIQ_RPNF_COUNT_STAR\n");
00059
00060     if (mask & WMIQ_RPNF_PROP_TO_PROP_TESTS)
00061         printf("WMIQ_RPNF_PROP_TO_PROP_TESTS\n");
00062
00063     if (mask & WMIQ_RPNF_ORDER_BY)
00064         printf("WMIQ_RPNF_ORDER_BY\n");
00065
00066     if (mask & WMIQ_RPNF_ISA_USED)
00067         printf("WMIQ_RPNF_ISA_USED\n");
00068
00069     if (mask & WMIQ_RPNF_GROUP_BY_HAVING)
00070         printf("WMIQ_RPNF_GROUP_BY_HAVING\n");
00071
00072 }
00073
00074 //***************************************************************************
00075 //
00076 // DumpSelectList
00077 //
00078 // Purpose: Lists the selected columns
00079 //
00080 //***************************************************************************
00081
00082 void DumpSelectList(ULONG uCount, SWbemQueryQualifiedName **pNames)
00083 {
00084     unsigned u;
00085
00086     printf("----BEGIN SELECT CLAUSE---\n");
00087     printf("Selected target columns/props = ");
00088
00089     for (u = 0; u < uCount; u++)
00090     {
00091         SWbemQueryQualifiedName *p = pNames[u];
00092
00093         // Print out current name.
00094         // Note that we support qualified names,
00095         // like p1.a,  p2.b, etc.
00096         // For simple cases, the m_uNameListSize is 1.
00097         // ===========================================
00098
00099         for (unsigned u2 = 0; u2 < p->m_uNameListSize; u2++)
00100         {
00101             if (u2 > 0)
00102                 printf(".");
00103             printf("%S", p->m_ppszNameList[u2]);
00104         }
00105
00106         printf(", ");
00107     }
00108
00109     printf("\n");
00110     printf("---END SELECT CLAUSE-----\n");
00111 }
00112
00113 //***************************************************************************
00114 //
00115 // DumpSubexpression
00116 //
00117 // Purpose: dumps out one of the subexpressions that make up the where clause
00118 //
00119 //***************************************************************************
00120
00121 void DumpSubexpression(SWbemRpnQueryToken *pTemp)
00122 {
00123     printf("---SUBEXPRESSION TOKEN---\n");
00124
00125     if (pTemp->m_uSubexpressionShape & WMIQ_RPN_LEFT_PROPERTY_NAME)
00126     {
00127         printf("    WMIQ_RPN_LEFT_PROPERTY_NAME\n");
00128     }
00129     if (pTemp->m_uSubexpressionShape & WMIQ_RPN_RIGHT_PROPERTY_NAME)
00130     {
00131         printf("    WMIQ_RPN_RIGHT_PROPERTY_NAME\n");
00132     }
00133     if (pTemp->m_uSubexpressionShape & WMIQ_RPN_CONST2)
00134     {
00135         printf("    WMIQ_RPN_CONST2\n");
00136     }
00137     if (pTemp->m_uSubexpressionShape & WMIQ_RPN_CONST)
00138     {
00139         printf("    WMIQ_RPN_CONST\n");
00140     }
00141     if (pTemp->m_uSubexpressionShape & WMIQ_RPN_RELOP)
00142     {
00143         printf("    WMIQ_RPN_RELOP\n");
00144     }
00145     if (pTemp->m_uSubexpressionShape & WMIQ_RPN_LEFT_FUNCTION)
00146     {
00147         printf("    WMIQ_RPN_LEFT_FUNCTION\n");
00148     }
00149     if (pTemp->m_uSubexpressionShape & WMIQ_RPN_RIGHT_FUNCTION)
00150     {
00151         printf("    WMIQ_RPN_RIGHT_FUNCTION\n");
00152     }
00153
00154     switch (pTemp->m_uOperator)
00155     {
00156         case WMIQ_RPN_OP_UNDEFINED: printf("  Operator (Invalid) WMIQ_RPN_OP_UNDEFINED\n"); break;
00157         case WMIQ_RPN_OP_EQ : printf("  Operator =  (WMIQ_RPN_OP_EQ)\n"); break;
00158         case WMIQ_RPN_OP_NE : printf("  Operator != (WMIQ_RPN_OP_NE)\n"); break;
00159         case WMIQ_RPN_OP_GE : printf("  Operator >= (WMIQ_RPN_OP_GE)\n"); break;
00160         case WMIQ_RPN_OP_LE : printf("  Operator <= (WMIQ_RPN_OP_LE)\n"); break;
00161         case WMIQ_RPN_OP_LT : printf("  Operator <  (WMIQ_RPN_OP_LT)\n"); break;
00162         case WMIQ_RPN_OP_GT : printf("  Operator >  (WMIQ_RPN_OP_GT)\n"); break;
00163         case WMIQ_RPN_OP_LIKE : printf("  Operator LIKE (WMIQ_RPN_OP_LIKE)\n"); break;
00164         case WMIQ_RPN_OP_ISA  : printf("  Operator ISA  (WMIQ_RPN_OP_ISA)\n"); break;
00165         case WMIQ_RPN_OP_ISNOTA  : printf("  Operator ISNOTA (WMIQ_RPN_OP_ISNOTA)\n"); break;
00166
00167         default:
00168             printf("  Operator <INVALID -- Internal Error>\n");
00169             break;
00170     }
00171
00172     // Dump identifiers (propety names)
00173
00174
00175     if (pTemp->m_pRightIdent)
00176     {
00177         printf("  Right side identifier = ");
00178         SWbemQueryQualifiedName *p = pTemp->m_pRightIdent;
00179         for (unsigned u = 0; u < p->m_uNameListSize; u++)
00180         {
00181             if (u > 0)
00182                 printf(".");
00183             printf("%S", p->m_ppszNameList[u]);
00184         }
00185         printf("\n");
00186     }
00187
00188     if (pTemp->m_pLeftIdent)
00189     {
00190         printf("  Left side identifier = ");
00191         SWbemQueryQualifiedName *p = pTemp->m_pLeftIdent;
00192         for (unsigned u = 0; u < p->m_uNameListSize; u++)
00193         {
00194             if (u > 0)
00195                 printf(".");
00196             printf("%S", p->m_ppszNameList[u]);
00197         }
00198         printf("\n");
00199     }
00200
00201     printf("  Apparent Type of Query Constant is ");
00202
00203     switch(pTemp->m_uConstApparentType)
00204     {
00205         case VT_NULL:
00206             printf("VT_NULL");
00207             break;
00208         case VT_I4:
00209             printf("VT_I4,  Value = %d\n", pTemp->m_Const.m_lLongVal);
00210             break;
00211         case VT_UI4:
00212             printf("VT_UI4, Value = %u\n", pTemp->m_Const.m_uLongVal);
00213             break;
00214         case VT_BOOL:
00215             printf("VT_BOOL, Value = %d\n", pTemp->m_Const.m_bBoolVal);
00216             break;
00217         case VT_R8:
00218             printf("VT_R8, Value = %f\n", pTemp->m_Const.m_dblVal);
00219             break;
00220         case VT_LPWSTR:
00221             printf("VT_LPWSTR, Value = %S\n", pTemp->m_Const.m_pszStrVal);
00222             break;
00223     }
00224
00225     printf("  Function name applied to Left Side = %S\n", pTemp->m_pszLeftFunc);
00226     printf("  Function name applied to Right Side = %S\n", pTemp->m_pszRightFunc);
00227
00228     printf("----END SUBEXPRESSION TOKEN---\n");
00229 }
00230
00231 //***************************************************************************
00232 //
00233 // DumpWhereClause
00234 //
00235 // Purpose: Dumps out the where clause
00236 //
00237 //***************************************************************************
00238
00239 void DumpWhereClause(ULONG uCount, SWbemRpnQueryToken **pWhere)
00240 {
00241     printf("---BEGIN WHERE CLAUSE---\n");
00242
00243     unsigned u;
00244
00245     for (u = 0; u < uCount; u++)
00246     {
00247         SWbemRpnQueryToken *pTemp = pWhere[u];
00248
00249         switch(pTemp->m_uTokenType)
00250         {
00251             case WMIQ_RPN_TOKEN_EXPRESSION:
00252                 DumpSubexpression(pTemp);
00253                 break;
00254
00255             case WMIQ_RPN_TOKEN_AND:
00256                 printf(" Operator: AND\n");
00257                 break;
00258
00259             case WMIQ_RPN_TOKEN_OR:
00260                 printf(" Operator: OR\n");
00261                 break;
00262
00263             case WMIQ_RPN_TOKEN_NOT:
00264                 printf(" Operator: NOT\n");
00265
00266             default:
00267                 printf(" Operator: INVALID\n");
00268         }
00269     }
00270
00271     printf("---END WHERE CLAUSE---\n");
00272 }
00273
00274 //***************************************************************************
00275 //
00276 // DumpFromClause
00277 //
00278 // Purpose: Dumps out the from clause
00279 //
00280 //***************************************************************************
00281
00282 void DumpFromClause(SWbemRpnEncodedQuery *pQuery)
00283 {
00284     printf("---FROM clause---\n");
00285
00286     if (pQuery->m_uFromTargetType & WMIQ_RPN_FROM_PATH)
00287     {
00288         printf("  Selected from container/scope [%S]\n", pQuery->m_pszOptionalFromPath);
00289     }
00290
00291     if (pQuery->m_uFromTargetType & WMIQ_RPN_FROM_UNARY)
00292     {
00293         printf("  Single class select = %S\n", pQuery->m_ppszFromList[0]);
00294     }
00295     else if (pQuery->m_uFromTargetType & WMIQ_RPN_FROM_CLASS_LIST)
00296     {
00297         for (unsigned u = 0; u < pQuery->m_uFromListSize; u++)
00298         {
00299             printf("  Selected class = %S\n", pQuery->m_ppszFromList[u]);
00300         }
00301     }
00302     else
00303     {
00304         printf("  No target classes selected; select ALL\n");
00305     }
00306
00307     printf("---END FROM clause\n");
00308 }
00309
00310 //***************************************************************************
00311 //
00312 // DumpRpn
00313 //
00314 // Purpose: Mainly calls the other routines which dump out the specific parts
00315 //
00316 //***************************************************************************
00317
00318 void DumpRpn(SWbemRpnEncodedQuery *pRpn)
00319 {
00320     printf("------------RPN Encoded Query-----------------\n");
00321     printf("RPN Version = %d\n", pRpn->m_uVersion);
00322     printf("RPN Token Type = %d\n", pRpn->m_uTokenType);
00323
00324     printf("Total detected features = %d  Feature Set = { ", pRpn->m_uDetectedArraySize);
00325     for (unsigned i = 0; i < pRpn->m_uDetectedArraySize; i++)
00326         printf("%d ", pRpn->m_puDetectedFeatures[i]);
00327     printf("}\n\n");
00328
00329     DumpFeatureMasks(pRpn->m_uParsedFeatureMask);
00330     DumpSelectList(pRpn->m_uSelectListSize, pRpn->m_ppSelectList);
00331     DumpFromClause(pRpn);
00332     DumpWhereClause(pRpn->m_uWhereClauseSize, pRpn->m_ppRpnWhereClause);
00333 }
00334
00335 //***************************************************************************
00336 //
00337 // TestQuery
00338 //
00339 // Purpose: Calls the parser to parse the query, and if all is well, calls
00340 // the other routines to dump out the results.
00341 //
00342 //***************************************************************************
00343
00344 void TestQuery(IWbemQuery *pQuery)
00345 {
00346     HRESULT hRes;
00347     ULONG uFeatures[] =
00348     {
00349         WMIQ_LF1_BASIC_SELECT,
00350         WMIQ_LF2_CLASS_NAME_IN_QUERY
00351     };
00352
00353     hRes = pQuery->SetLanguageFeatures(0, sizeof(uFeatures)/sizeof(ULONG), uFeatures);
00354
00355     hRes = pQuery->Parse(L"SQL", g_pQuery, 0);
00356
00357     if (FAILED(hRes))
00358     {
00359         printf("Parse failed with error 0x%X\n", hRes);
00360         return;
00361     }
00362
00363
00364     SWbemRpnEncodedQuery *pRpn = 0;
00365     hRes = pQuery->GetAnalysis(
00366         WMIQ_ANALYSIS_RPN_SEQUENCE,
00367         0,
00368         (LPVOID *) &pRpn
00369         );
00370
00371     if (SUCCEEDED(hRes))
00372     {
00373         printf("\n\nGot RPN Output\n");
00374         DumpRpn(pRpn);
00375         pQuery->FreeMemory(pRpn);
00376     }
00377 }
00378
00379 //***************************************************************************
00380 //
00381 // main
00382 //
00383 // Purpose: Entry point for the application.
00384 //
00385 //***************************************************************************
00386
00387 void main(int argc, char *argv[])
00388 {
00389     if (argc < 2)
00390     {
00391         printf("\nusage:  QueryParser \"simple select query\"");
00392     printf("\nexample;  c:>QueryParser \"select RowA, RowB from tableName where propz=3\"");
00393         return;
00394     }
00395
00396     wchar_t buf[8192];
00397   HRESULT hr = StringCbPrintfW(buf, sizeof(buf), L"%S", argv[1]);
00398   if (FAILED(hr))
00399   {
00400     printf("Query string cannot exceed %d characters.\n", sizeof(buf)/sizeof(wchar_t) - 1);
00401     printf("StringCbPrintfW failed with error code: 0x%X.\n", hr);
00402     return;
00403   }
00404
00405     g_pQuery = buf;
00406
00407   wprintf(L"Query = %s\n", g_pQuery);
00408
00409
00410     // Standard COM initialization stuff.
00411     // ===================================
00412
00413     CoInitializeEx(0, COINIT_MULTITHREADED);
00414
00415     // Get the QueryParser object call the test code
00416     // =============================================
00417
00418     IWbemQuery *pQuery = 0;
00419
00420     hr = CoCreateInstance(CLSID_WbemQuery, 0, CLSCTX_INPROC_SERVER,
00421             IID_IWbemQuery, (LPVOID *) &pQuery);
00422
00423     if (hr != S_OK)
00424         printf("Failed to create Query object.\n");
00425     else
00426     {
00427         printf("Got a query parser object\n");
00428         TestQuery(pQuery);
00429         pQuery->Release();
00430     }
00431
00432     CoUninitialize();
00433 }
00434
00435
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSampleMSP Member List

This is the complete list of members for CSampleMSP, including all inherited members.
CreateMSPCall(IN MSP_HANDLE htCall, IN DWORD dwReserved, IN DWORD dwMediaType, IN IUnknown *pOuterUnknown, OUT IUnknown **ppMSPCall) | CSampleMSP |
CSampleMSP() | CSampleMSP |
GetCallMediaTypes(void) | CSampleMSP | [protected]
MSPAddressAddRef(void) | CSampleMSP | [virtual]
MSPAddressRelease(void) | CSampleMSP | [virtual]
ShutdownMSPCall(IN IUnknown *pMSPCall) | CSampleMSP |
~CSampleMSP() | CSampleMSP | [virtual]
Generated on Wed Nov 13 2024 16:57:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/MSPBase/msptrmar.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • MSPBase

msptrmar.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1998-1999 Microsoft Corporation
00004
00005 Module Name:
00006
00007     msptrmar.cpp
00008
00009 Abstract:
00010
00011     MSP base classes: implementation of audio render terminal.
00012
00013 --*/
00014
00015 #include "precomp.h"
00016 #pragma hdrstop
00017
00018 #include <mmsystem.h>
00019
00020 // Filter volume level ranges
00021 const long AX_MIN_VOLUME = -9640; // -10000;
00022 const long AX_MAX_VOLUME = 0;
00023
00024 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00025 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00026
00027 CAudioRenderTerminal::CAudioRenderTerminal()
00028 {
00029     m_TerminalDirection = TD_RENDER;
00030     m_TerminalType = TT_STATIC;
00031
00032     m_szName[0] = L'\0'; // real name is copied in on creation
00033
00034     m_bResourceReserved = false;
00035
00036     LOG((MSP_TRACE, "CAudioRenderTerminal::CAudioRenderTerminal() finished"));
00037 }
00038
00039 CAudioRenderTerminal::~CAudioRenderTerminal()
00040 {
00041     LOG((MSP_TRACE, "CAudioRenderTerminal::~CAudioRenderTerminal() finished"));
00042 }
00043
00044 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00045 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00046
00047 // This function determines if the terminal associated with a given
00048 // moniker is "good". A good terminal returns S_OK; a bad terminal returns an
00049 // error.
00050 //
00051 // A good terminal has the following properties:
00052 //      * has a friendly name
00053 //      * is not a WAVE_MAPPER terminal
00054 //      * is not a DirectSound terminal (unless USE_DIRECT_SOUND is pound-defined)
00055 //
00056
00057 static inline HRESULT TerminalAllowed(IMoniker * pMoniker)
00058 {
00059     HRESULT hr;
00060     CComPtr<IPropertyBag> pBag;
00061     hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pBag);
00062     if (FAILED(hr))
00063     {
00064         LOG((MSP_ERROR, "audio render TerminalAllowed (IMoniker::BindToStorage) "
00065                             "- returning  %8x", hr));
00066         return hr;
00067     }
00068
00069     VARIANT var;
00070
00071     // we make sure creation is not going to fail on
00072     // account of a nonexistent friendly name
00073     VariantInit(&var);
00074     var.vt = VT_BSTR;
00075     hr = pBag->Read(L"FriendlyName", &var, 0);
00076     if (FAILED(hr))
00077     {
00078         LOG((MSP_ERROR, "audio render TerminalAllowed "
00079             "(IPropertyBag::Read on FriendlyName) - got  %8x; skipping terminal", hr));
00080         return hr;
00081     }
00082
00083     // Fix for memory leak!
00084     SysFreeString(var.bstrVal);
00085
00086      // NOTE: Magic code selects only wave devices
00087     VariantInit(&var);
00088     var.vt = VT_I4;
00089     hr = pBag->Read(L"WaveOutId", &var, 0);
00090
00091     if (hr != S_OK)
00092     {
00093         #ifndef USE_DIRECT_SOUND
00094
00095             // This is most likely a DirectSound terminal
00096             LOG((MSP_WARN, "audio render TerminalAllowed - "
00097                 "this is a DirectSound terminal "
00098                 "so we are skipping it - note that this is a routine "
00099                 "occurance - returning  %8x", hr));
00100
00101         #else  // we do use DirectSound
00102             return S_OK;
00103         #endif
00104     }
00105     else if (var.lVal == WAVE_MAPPER)
00106     {
00107         // hack: if the value is equal to WAVE_MAPPER then don't use it....
00108         hr = E_FAIL; // random failure code :)
00109
00110         LOG((MSP_WARN, "audio render TerminalAllowed - "
00111             "this is a WAVE_MAPPER terminal "
00112             "so we are skipping it - note that this is a routine "
00113             "occurance - returning  %8x", hr));
00114     }
00115
00116     return hr;
00117 }
00118
00119 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00120 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00121
00122 HRESULT CAudioRenderTerminal::CreateTerminal(
00123     IN  CComPtr<IMoniker>   pMoniker,
00124     IN  MSP_HANDLE          htAddress,
00125     OUT ITTerminal        **ppTerm
00126     )
00127 {
00128     // Enable ATL string conversion macros.
00129     USES_CONVERSION;
00130
00131     LOG((MSP_TRACE, "CAudioRenderTerminal::CreateTerminal - enter"));
00132
00133     //
00134     // Validate the parameters
00135     //
00136
00137     if ( MSPB_IsBadWritePtr(ppTerm, sizeof(ITTerminal *) ) )
00138     {
00139         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateTerminal : "
00140             "bad terminal pointer; returning E_POINTER"));
00141         return E_POINTER;
00142     }
00143
00144     if ( IsBadReadPtr(pMoniker, sizeof(IMoniker) ) )
00145     {
00146         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateTerminal : "
00147             "bad moniker pointer; returning E_POINTER"));
00148         return E_POINTER;
00149     }
00150
00151     //
00152     // We return a NULL terminal if we fail.
00153     //
00154
00155     *ppTerm = NULL;
00156     HRESULT hr;
00157
00158     // Refuse to work with DirectSound or WAVE_MAPPER terminals.
00159     // or if we can't read the friendlyName...
00160     if (FAILED(hr = TerminalAllowed(pMoniker))) return hr;
00161
00162     //
00163     // Get the name for this filter out of the property bag.
00164     //
00165
00166     CComPtr<IPropertyBag> pBag;
00167     hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pBag);
00168     if (FAILED(hr))
00169     {
00170         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateTerminal (IMoniker::BindToStorage) - returning  %8x", hr));
00171         return hr;
00172     }
00173
00174     VARIANT var;
00175     VariantInit(&var);
00176
00177     var.vt = VT_BSTR;
00178     hr = pBag->Read(L"FriendlyName", &var, 0);
00179     if (FAILED(hr))
00180     {
00181         LOG((MSP_WARN, "CAudioRenderTerminal::CreateTerminal "
00182             "(IPropertyBag::Read) - got  %8x - we are therefore skipping "
00183             "this terminal; note that this is fairly routine", hr));
00184
00185         return hr;
00186     }
00187
00188     //
00189     // Create the terminal.
00190     //
00191
00192     CMSPComObject<CAudioRenderTerminal> *pLclTerm = new CMSPComObject<CAudioRenderTerminal>;
00193     if (pLclTerm == NULL)
00194     {
00195         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateTerminal - returning E_OUTOFMEMORY"));
00196         return E_OUTOFMEMORY;
00197     }
00198
00199     //
00200     // Save some stuff in the terminal.
00201     //
00202
00203     pLclTerm->m_pMoniker = pMoniker;
00204
00205     lstrcpyn(pLclTerm->m_szName, OLE2T(var.bstrVal), MAX_PATH);
00206
00207     SysFreeString(var.bstrVal);
00208
00209     //
00210     // Get the ITTerminal interface that we were asked for.
00211     //
00212
00213     hr = pLclTerm->_InternalQueryInterface(IID_ITTerminal, (void**)ppTerm);
00214
00215     if ( FAILED(hr) )
00216     {
00217         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateTerminal - "
00218             "Internal QI failed; returning 0x%08x", hr));
00219
00220         delete pLclTerm;
00221         *ppTerm = NULL; // just in case
00222
00223         return hr;
00224     }
00225
00226     //
00227     // Finish initializing the terminal.
00228     //
00229
00230     hr = pLclTerm->Initialize(CLSID_SpeakersTerminal,
00231                               TAPIMEDIATYPE_AUDIO,
00232                               TD_RENDER,
00233                               htAddress
00234                              );
00235     if ( FAILED(hr) )
00236     {
00237         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateTerminal - "
00238             "Initialize failed; returning 0x%08x", hr));
00239
00240         (*ppTerm)->Release();
00241         *ppTerm = NULL; // just in case
00242
00243         return hr;
00244     }
00245
00246     LOG((MSP_TRACE, "CAudioRenderTerminal::CreateTerminal - exit S_OK"));
00247     return S_OK;
00248 }
00249
00250 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00251 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00252
00253 // Create the filters used by this terminal
00254
00255 HRESULT CAudioRenderTerminal::CreateFilters()
00256 {
00257     LOG((MSP_TRACE, "CAudioRenderTerminal::CreateFilters - enter"));
00258
00259     HRESULT hr;
00260
00261     //
00262     // We used to recreate the audio render filter every time, but we don't
00263     // have any real reason for doing so. Just return S_OK if the filter
00264     // has already been created.
00265     //
00266
00267     if ( m_pIFilter != NULL )
00268     {
00269         _ASSERTE( m_pIPin != NULL );
00270
00271         LOG((MSP_TRACE, "CAudioRenderTerminal::CreateFilters - "
00272             "filter already created - exit S_OK"));
00273
00274         return S_OK;
00275     }
00276
00277     _ASSERTE ( m_pIBasicAudio == NULL );
00278     _ASSERTE ( m_pIPin == NULL );
00279
00280     //
00281     // Sanity checks.
00282     //
00283     if ( m_pMoniker == NULL )
00284     {
00285         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateFilters - "
00286             "no moniker present - returning E_UNEXPECTED"));
00287
00288         return E_UNEXPECTED;
00289     }
00290
00291     //
00292     // Create a new instance of the filter.
00293     //
00294     hr = m_pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&m_pIFilter);
00295
00296     if ( FAILED(hr) )
00297     {
00298         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateFilters - "
00299             "BindToObject failed; returning  %8x", hr));
00300         return hr;
00301     }
00302
00303     //
00304     // Get the basic audio interface for the filter. If it doesn't exist, we
00305     // can live with that, but all our IBasicAudio methods will fail.
00306     //
00307
00308     hr = m_pIFilter->QueryInterface(IID_IBasicAudio,
00309                                        (void **) &m_pIBasicAudio);
00310     if ( FAILED(hr) )
00311     {
00312         LOG((MSP_WARN, "CAudioRenderTerminal::CreateFilters - "
00313             "QI for IBasicAudio failed: %8x", hr));
00314     }
00315
00316     hr = FindTerminalPin();
00317
00318     if ( FAILED(hr) )
00319     {
00320         LOG((MSP_ERROR, "CAudioRenderTerminal::CreateFilters - "
00321             "FindTerminalPin failed; returning  0x%08x", hr));
00322
00323         m_pIFilter = NULL; // does an implicit release
00324
00325         if ( m_pIBasicAudio )
00326         {
00327             m_pIBasicAudio = NULL; // does an implicit release
00328         }
00329
00330         return hr;
00331     }
00332
00333     LOG((MSP_TRACE, "CAudioRenderTerminal::CreateFilters - exit S_OK"));
00334
00335     return S_OK;
00336 }
00337
00338 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00339 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00340
00341 HRESULT
00342 CAudioRenderTerminal::FindTerminalPin(
00343     )
00344 {
00345     LOG((MSP_TRACE, "CAudioRenderTerminal::FindTerminalPin - enter"));
00346
00347     //
00348     // Sanity checks so we don't AV.
00349     //
00350
00351     if (m_pIPin != NULL)
00352     {
00353         LOG((MSP_TRACE, "CAudioRenderTerminal::FindTerminalPin - "
00354             "we've already got a pin; exit E_UNEXPECTED"));
00355         return E_UNEXPECTED;
00356     }
00357
00358     if (m_pIFilter == NULL)
00359     {
00360         LOG((MSP_TRACE, "CAudioRenderTerminal::FindTerminalPin - "
00361             "we don't have a filter; exit E_UNEXPECTED"));
00362         return E_UNEXPECTED;
00363     }
00364
00365     HRESULT hr;
00366     CComPtr<IEnumPins> pIEnumPins;
00367     ULONG cFetched;
00368
00369     //
00370     // Find the render pin for the filter.
00371     //
00372
00373     hr = m_pIFilter->EnumPins(&pIEnumPins);
00374
00375     if (FAILED(hr))
00376     {
00377         LOG((MSP_ERROR,
00378             "CAudioRenderTerminal::FindTerminalPin - can't enum pins 0x%08x",
00379             hr));
00380         return hr;
00381     }
00382
00383     IPin * pIPin;
00384
00385     // Enumerate all the pins and break on the
00386     // first pin that meets requirement.
00387     for (;;)
00388     {
00389         if (pIEnumPins->Next(1, &pIPin, &cFetched) != S_OK)
00390         {
00391             LOG((MSP_ERROR,
00392                 "CAudioRenderTerminal::FindTerminalPin - can't get a pin %8x",
00393                 hr));
00394             return (hr == S_FALSE) ? E_FAIL : hr;
00395         }
00396
00397         if (0 == cFetched)
00398         {
00399             LOG((MSP_ERROR, "CAudioRenderTerminal::FindTerminalPin - got zero pins"));
00400             return E_FAIL;
00401         }
00402
00403         PIN_DIRECTION dir;
00404
00405         if (FAILED(hr = pIPin->QueryDirection(&dir)))
00406         {
00407             LOG((MSP_ERROR,
00408                 "CAudioRenderTerminal::FindTerminalPin - can't query pin direction %8x",
00409                 hr));
00410             pIPin->Release();
00411             return hr;
00412         }
00413
00414         if (PINDIR_INPUT == dir)
00415         {
00416             break;
00417         }
00418
00419         pIPin->Release();
00420     }
00421
00422     m_pIPin = pIPin;
00423
00424     LOG((MSP_TRACE, "CAudioRenderTerminal::FindTerminalPin - exit S_OK"));
00425
00426     return S_OK;
00427 }
00428
00429
00430 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00431 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00432
00433 HRESULT CAudioRenderTerminal::AddFiltersToGraph(
00434     )
00435 {
00436     LOG((MSP_TRACE, "CAudioRenderTerminal::AddFiltersToGraph - enter"));
00437
00438     if (m_pGraph == NULL)
00439     {
00440         LOG((MSP_ERROR, "CAudioRenderTerminal::AddFiltersToGraph - "
00441             "haven't got a filter graph; return E_UNEXPECTED"));
00442         return E_UNEXPECTED;
00443     }
00444
00445     //
00446     // Create the filters if this is the first connection with this terminal.
00447     //
00448
00449     HRESULT hr = CreateFilters();
00450
00451     if ( FAILED(hr) )
00452     {
00453         LOG((MSP_ERROR, "CAudioRenderTerminal::AddFiltersToGraph - "
00454             "CreateFilters failed; returning  0x%08x", hr));
00455         return hr;
00456     }
00457
00458     //
00459     // Add the filter to the graph.
00460     //
00461     // A word about names:
00462     // If a filter has already been added with the same name (which will
00463     // happen if we have more than one audio render terminal in the same
00464     // graph) then that will return VFW_S_DUPLICATE_NAME, which is not
00465     // a failure.
00466     //
00467
00468     hr = m_pGraph->AddFilter(m_pIFilter, WAVEOUT_NAME);
00469
00470     if ( FAILED(hr) )
00471     {
00472         LOG((MSP_ERROR, "CAudioRenderTerminal::AddFiltersToGraph - "
00473             "returning  0x%08x", hr));
00474         return hr;
00475     }
00476
00477     LOG((MSP_TRACE, "CAudioRenderTerminal::AddFiltersToGraph - exit S_OK"));
00478     return S_OK;
00479 }
00480
00481
00482 //////////////////////////////////////////////////////////////////////////////
00483 // we override this here so we can do some stuff
00484 // right after the filter gets connected
00485
00486 STDMETHODIMP CAudioRenderTerminal::CompleteConnectTerminal(void)
00487 {
00488     LOG((MSP_TRACE, "CAudioRenderTerminal::CompleteConnectTerminal - enter"));
00489
00490     // By default, we need not unreserve later.
00491     m_bResourceReserved = false;
00492
00493     // Don't clobber the base class' machinations (currently nothing...)
00494     HRESULT hr = CSingleFilterTerminal::CompleteConnectTerminal();
00495
00496     if (FAILED(hr))
00497     {
00498         LOG((MSP_TRACE, "CAudioRenderTerminal::CompleteConnectTerminal: "
00499                 "CSingleFilterTerminal method failed"));
00500         return hr;
00501     }
00502
00503     // So here we are, after our filter has been added to the filter graph and connected up.
00504     // We need to use the filter's
00505     // IAMResourceControl::Reserve method to make sure the filter opens the waveOut device
00506     // now (and keeps it open).
00507
00508     //////////////////////////////////////////////////////////////////////////
00509     // we must inform the filter that we want it to grab the wave device.
00510     // We do this after connecting because the filter needs to negotiate the
00511     // media type before it can open a wave device.
00512
00513     CComPtr <IAMResourceControl> pIResource;
00514
00515     hr = m_pIFilter->QueryInterface(IID_IAMResourceControl, (void **) &pIResource);
00516     if (FAILED(hr))
00517     {
00518         LOG((MSP_ERROR, "CAudioRenderTerminal::CompleteConnectTerminal - QI failed: %8x", hr));
00519
00520         // This is a nonesential operation so we do not fail.
00521         return S_OK;
00522     }
00523
00524     // The QueryInterface didn't fail...
00525
00526     hr = pIResource->Reserve(AMRESCTL_RESERVEFLAGS_RESERVE, NULL);
00527
00528     if (FAILED(hr))
00529     {
00530         LOG((MSP_ERROR, "CAudioRenderTerminal::CompleteConnectTerminal - "
00531                             "device reservation failed: %8x", hr));
00532         return hr;
00533     }
00534     else if (hr == S_FALSE)
00535     {
00536         // Well, in this case either another application is already using the wave out device,
00537         // or we are running half-duplex and we've got both wavein and waveout terminals
00538         // selected.
00539
00540         LOG((MSP_ERROR, "CAudioRenderTerminal::CompleteConnectTerminal - "
00541                 "device already in use: %8x", hr));
00542         return hr;
00543
00544     } // {if the driver is half-duplex}
00545
00546     // We have succeeded in reserving, so we will want to unreserve later.
00547     m_bResourceReserved = true;
00548
00549     LOG((MSP_TRACE, "CAudioRenderTerminal::CompleteConnectTerminal - exit S_OK"));
00550     return S_OK;
00551 }
00552
00553 //////////////////////////////////////////////////////////////////////////////////
00554 // We override this here so we can unreserve the resource when we are done.
00555 // removes filters from the filter graph and resets member variables
00556 // Disconnect may be called anytime after Connect succeeds (it need not be called
00557 // if CompleteConnect fails)
00558
00559 STDMETHODIMP CAudioRenderTerminal::DisconnectTerminal(
00560             IN      IGraphBuilder  * pGraph,
00561             IN      DWORD            dwReserved
00562             )
00563 {
00564     LOG((MSP_TRACE, "CAudioRenderTerminal::DisconnectTerminal - enter"));
00565
00566     HRESULT hr;
00567
00568     //
00569     // First call the base class method, to make sure we validate everything
00570     // and don't mess with our resource reservation unless this is a valid
00571     // disconnection (e.g., the filter graph pointersmatch).
00572     //
00573
00574     hr = CSingleFilterTerminal::DisconnectTerminal(pGraph, dwReserved);
00575
00576     if (FAILED(hr))
00577     {
00578         LOG((MSP_TRACE, "CAudioRenderTerminal::DisconnectTerminal : "
00579                 "CSingleFilterTerminal method failed; hr = %d", hr));
00580         return hr;
00581     }
00582
00583     // if we need to release the resource
00584     if (m_bResourceReserved)
00585     {
00586         CComPtr <IAMResourceControl> pIResource;
00587
00588         hr = m_pIFilter->QueryInterface(IID_IAMResourceControl, (void **) &pIResource);
00589         if (FAILED(hr))
00590         {
00591             LOG((MSP_ERROR, "CAudioRenderTerminal::DisconnectTerminal - QI failed: %8x", hr));
00592
00593             // This is a nonesential operation so we do not "return hr;" here.
00594         }
00595         else
00596         {
00597             // QueryInterface didn't fail, and we have reserved WaveOut, so we must
00598             // unreserve now.
00599
00600             hr = pIResource->Reserve(AMRESCTL_RESERVEFLAGS_UNRESERVE, NULL);
00601             if (FAILED(hr))
00602             {
00603                 LOG((MSP_ERROR, "CAudioRenderTerminal::DisconnectTerminal - "
00604                                     "device unreservation failed: %8x", hr));
00605                 // no reason to completely die at this point, so we just continue
00606             }
00607
00608             // if other things fail we may be called again, but we should not try
00609             // to unreserve again.
00610             m_bResourceReserved = false;
00611
00612         } // {if QI succeeded}
00613     } // {if need to release resource}
00614
00615     LOG((MSP_TRACE, "CAudioRenderTerminal::DisconnectTerminal - exit S_OK"));
00616
00617     return S_OK;
00618 }
00619
00620 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00621 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00622
00623 // private helper method:
00624
00625 static HRESULT RangeConvert(long   lInput,
00626                             long   lInputMin,
00627                             long   lInputMax,
00628                             long * plOutput,
00629                             long   lOutputMin,
00630                             long   lOutputMax)
00631 {
00632     _ASSERTE( lInputMin  < lInputMax );
00633     _ASSERTE( lOutputMin < lOutputMax );
00634     _ASSERTE( ! MSPB_IsBadWritePtr(plOutput, sizeof(long)) );
00635
00636     if (lInput < lInputMin)
00637     {
00638         LOG((MSP_ERROR, "RangeConvert - value out of range - "
00639             "%d < %d; returning E_INVALIDARG",
00640             lInput, lInputMin));
00641
00642         return E_INVALIDARG;
00643     }
00644
00645     if (lInput > lInputMax)
00646     {
00647         LOG((MSP_ERROR, "RangeConvert - value out of range - "
00648             "%d > %d; returning E_INVALIDARG",
00649             lInput, lInputMax));
00650
00651         return E_INVALIDARG;
00652     }
00653
00654     // This is how much we are going to expand the range of the input.
00655     double dRangeWidthRatio = (double) (lOutputMax - lOutputMin) /
00656                               (double) (lInputMax  - lInputMin);
00657
00658     *plOutput = (long) ((lInput - lInputMin) * dRangeWidthRatio) + lOutputMin;
00659
00660     return S_OK;
00661 }
00662
00663 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00664 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00665
00666 STDMETHODIMP CAudioRenderTerminal::get_Volume(long * plVolume)
00667 {
00668     CLock lock(m_CritSec);
00669
00670     LOG((MSP_TRACE, "CAudioRenderTerminal::get_Volume - enter"));
00671
00672     //
00673     // Parameter checks.
00674     //
00675
00676     if ( MSPB_IsBadWritePtr(plVolume, sizeof(long)) )
00677     {
00678         LOG((MSP_ERROR, "CAudioRenderTerminal::get_Volume - "
00679             "bad pointer argument"));
00680         return E_POINTER;
00681     }
00682
00683     if (m_pIBasicAudio == NULL)
00684     {
00685         LOG((MSP_ERROR, "CAudioRenderTerminal::get_Volume - "
00686             "don't have necessary interface - exit E_FAIL"));
00687         return E_FAIL;
00688     }
00689
00690     //
00691     // Let the filter do the work.
00692     //
00693
00694     HRESULT hr = m_pIBasicAudio->get_Volume(plVolume);
00695
00696     if (FAILED(hr))
00697     {
00698         LOG((MSP_ERROR, "CAudioRenderTerminal::get_Volume - "
00699             "filter call failed: %08x", hr));
00700         return hr;
00701     }
00702
00703     //
00704     // Asjust the range of the value returned to match the range specified
00705     // by the TAPI APIs.
00706     //
00707
00708     hr = RangeConvert(*plVolume, AX_MIN_VOLUME, AX_MAX_VOLUME,
00709                       plVolume,  0,             0xFFFF);
00710
00711     if (FAILED(hr))
00712     {
00713         LOG((MSP_ERROR, "CAudioRenderTerminal::get_Volume - "
00714             "RangeConvert call failed: %08x", hr));
00715         return hr;
00716     }
00717
00718     LOG((MSP_TRACE, "CAudioRenderTerminal::get_Volume - exit S_OK"));
00719     return S_OK;
00720 }
00721
00722 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00723 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00724
00725 STDMETHODIMP CAudioRenderTerminal::put_Volume(long lVolume)
00726 {
00727     CLock lock(m_CritSec);
00728
00729     LOG((MSP_TRACE, "CAudioRenderTerminal::put_Volume - enter"));
00730
00731     if (m_pIBasicAudio == NULL)
00732     {
00733         LOG((MSP_ERROR, "CAudioRenderTerminal::put_Volume - "
00734             "don't have necessary interface - exit E_FAIL"));
00735         return E_FAIL;
00736     }
00737
00738     //
00739     // Asjust the range of the value returned to match the range needed
00740     // by the WaveOut filter.
00741     //
00742
00743     HRESULT hr = RangeConvert(lVolume,  0,             0xFFFF,
00744                               &lVolume, AX_MIN_VOLUME, AX_MAX_VOLUME);
00745
00746     if (FAILED(hr))
00747     {
00748         LOG((MSP_ERROR, "CAudioRenderTerminal::put_Volume - "
00749             "RangeConvert call failed: %08x", hr));
00750         return hr;
00751     }
00752
00753     //
00754     // Let the filter do the work.
00755     //
00756
00757     hr = m_pIBasicAudio->put_Volume(lVolume);
00758
00759     if (FAILED(hr))
00760     {
00761         LOG((MSP_ERROR, "CAudioRenderTerminal::put_Volume - "
00762             "filter call failed: %08x", hr));
00763         return hr;
00764     }
00765
00766     LOG((MSP_TRACE, "CAudioRenderTerminal::put_Volume - exit S_OK"));
00767     return S_OK;
00768 }
00769
00770 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00771 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00772
00773 STDMETHODIMP CAudioRenderTerminal::get_Balance(long * plBalance)
00774 {
00775     HRESULT hr = E_NOTIMPL;
00776
00777     LOG((MSP_TRACE, "CAudioRenderTerminal::get_Balance - enter"));
00778     LOG((MSP_TRACE, "CAudioRenderTerminal::get_Balance - exit 0x%08x", hr));
00779
00780     return hr;
00781 }
00782
00783 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00784 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00785
00786 STDMETHODIMP CAudioRenderTerminal::put_Balance(long lBalance)
00787 {
00788     HRESULT hr = E_NOTIMPL;
00789
00790     LOG((MSP_TRACE, "CAudioRenderTerminal::put_Balance - enter"));
00791     LOG((MSP_TRACE, "CAudioRenderTerminal::put_Balance - exit 0x%08x", hr));
00792
00793     return hr;
00794 }
00795
00796 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00797 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00798
00799 STDMETHODIMP
00800 CAudioRenderTerminal::get_WaveId(
00801     OUT long * plWaveId
00802     )
00803 {
00804     LOG((MSP_TRACE, "CAudioRenderTerminal::get_WaveId - enter"));
00805
00806     CLock lock(m_CritSec);
00807
00808     //
00809     // Parameter checks.
00810     //
00811
00812     if ( MSPB_IsBadWritePtr(plWaveId, sizeof(long)) )
00813     {
00814         LOG((MSP_ERROR, "CAudioRenderTerminal::get_WaveId - "
00815             "bad pointer argument"));
00816
00817         return E_POINTER;
00818     }
00819
00820     //
00821     // Check the moniker pointer.
00822     //
00823
00824     if ( IsBadReadPtr( m_pMoniker, sizeof(IMoniker) ) )
00825     {
00826         LOG((MSP_ERROR, "CAudioRenderTerminal::get_WaveId - "
00827             "bad moniker pointer - exit E_UNEXPECTED"));
00828
00829         return E_UNEXPECTED;
00830     }
00831
00832     //
00833     // Get a property bag from the moniker.
00834     //
00835
00836     IPropertyBag * pBag;
00837
00838     HRESULT hr = m_pMoniker->BindToStorage(0,
00839                                            0,
00840                                            IID_IPropertyBag,
00841                                            (void **) &pBag);
00842
00843     if ( FAILED(hr) )
00844     {
00845         LOG((MSP_ERROR, "CAudioRenderTerminal::get_WaveId - "
00846             "can't get property bag - exit 0x%08x", hr));
00847
00848         return hr;
00849     }
00850
00851     //
00852     // Get the ID from the property bag.
00853     //
00854
00855     VARIANT var;
00856
00857     var.vt = VT_I4;
00858
00859     hr = pBag->Read(
00860         L"WaveOutId",
00861         &var,
00862         0);
00863
00864     pBag->Release();
00865
00866     if ( FAILED(hr) )
00867     {
00868         LOG((MSP_ERROR, "CAudioRenderTerminal::get_WaveId - "
00869             "can't read wave ID - exit 0x%08x", hr));
00870
00871         return hr;
00872     }
00873
00874     *plWaveId = (long) var.lVal;
00875
00876     LOG((MSP_TRACE, "CAudioRenderTerminal::get_WaveId - exit S_OK"));
00877
00878     return S_OK;
00879 }
00880
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/DataAccess/DataAcOleDB/oledbcomponent.Cpp Source File

  • Com
  • Services
  • Transaction
  • DataAccess
  • DataAcOleDB

oledbcomponent.Cpp

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: OLEDBComponent.cpp
00003 //
00004 // Description: Implementation of COLEDBComponent
00005 //
00006 // This file is part of the Microsoft COM+ Samples
00007 //
00008 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00009 //
00010 // This source code is intended only as a supplement to Microsoft
00011 // Development Tools and/or on-line documentation.  See these other
00012 // materials for detailed information reagrding Microsoft code samples.
00013 //
00014 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 // PARTICULAR PURPOSE.
00018 //
00019 //==============================================================================
00020
00021
00022 //#define DBINITCONSTANTS // Initialize OLE constants...
00023
00024
00025 #include "stdafx.h"
00026 #include "Oledbkb.h"
00027 #include "OLEDBComponent.h"
00028
00029 //TODO: You will have to adjust the following #include statements
00030 //to have correct paths to your oledb header files.
00031 #include "oledb.h"
00032 #include "oledberr.h"
00033 #include "msdaguid.h"
00034 #include "msdasql.h"
00035 //END TODO
00036
00037
00038 #include <windows.h>
00039 #include <stdio.h>
00040
00041
00042 HRESULT SetInitProps(IDBInitialize *);
00043
00044 /////////////////////////////////////////////////////////////////////////////
00045 // COLEDBComponent
00046
00047 HRESULT COLEDBComponent::Activate()
00048 {
00049   HRESULT hr = CoGetObjectContext(IID_IObjectContext, (void**)&m_spObjectContext);
00050   if (SUCCEEDED(hr))
00051     return S_OK;
00052   return hr;
00053 }
00054
00055 BOOL COLEDBComponent::CanBePooled()
00056 {
00057   return TRUE;
00058 }
00059
00060 void COLEDBComponent::Deactivate()
00061 {
00062   m_spObjectContext.Release();
00063 }
00064
00065
00066 STDMETHODIMP COLEDBComponent::SimpleQuery(BSTR * returnval)
00067 {
00068
00069   IDBInitialize*    pIDBInitialize    = NULL;
00070    IMultipleResults*  pIMultipleResults = NULL;
00071    IDBCreateSession* pIDBCreateSession  = NULL;
00072    IDBCreateCommand* pIDBCreateCommand  = NULL;
00073    ICommandText*     pICommandText    = NULL;
00074    ICommand*         pICommand      = NULL;
00075    IAccessor*     pIAccessor      = NULL;
00076    IRowset*       pIRowset      = NULL;
00077
00078   LPCOLESTR         wSQLString
00079     = OLESTR("select au_fname from authors where au_lname = 'White'");
00080    LONG              cRowsAffected;
00081    HRESULT           retcode;
00082    ULONG          cRowsObtained;
00083    HROW         hRow;
00084    HROW*          pRows = &hRow;
00085    HACCESSOR      hAccessor;
00086    DBBINDSTATUS   DBBindStatus;
00087    DBBINDING      DBBindings =
00088       {1, 0, 0, 0, NULL, NULL, NULL, DBPART_VALUE,
00089       DBMEMOWNER_CLIENTOWNED, DBPARAMIO_NOTPARAM, 20,
00090       0, 129, 255, 255};
00091   char          RowValue[20];
00092
00093 //  Helper        myHelper;
00094
00095   CoInitialize(NULL);
00096
00097   if(FAILED(CoCreateInstance(CLSID_MSDASQL, NULL, CLSCTX_INPROC_SERVER,
00098         IID_IDBInitialize, (void**)&pIDBInitialize)))
00099         goto error;
00100
00101    if(FAILED(SetInitProps(pIDBInitialize)))
00102         goto error;
00103
00104   if(FAILED(pIDBInitialize->Initialize()))
00105     goto error;
00106
00107   if(FAILED(pIDBInitialize->QueryInterface(IID_IDBCreateSession, (void**) &pIDBCreateSession)))
00108       goto error;
00109
00110    if(FAILED(pIDBCreateSession->CreateSession(NULL, IID_IDBCreateCommand,
00111        (IUnknown**) &pIDBCreateCommand)))
00112     goto error;
00113
00114    if(FAILED(pIDBCreateCommand->CreateCommand(NULL, IID_ICommand,
00115        (IUnknown**) &pICommand)))
00116     goto error;
00117
00118    if(FAILED(retcode=pICommand->QueryInterface(IID_ICommandText,
00119     (void**) &pICommandText)))
00120     goto error;
00121
00122    //if(FAILED(pICommandText->SetCommandText(DBGUID_DBSQL, wSQLString))))
00123    if(FAILED(pICommandText->SetCommandText(DBGUID_DEFAULT, OLESTR("select au_fname from authors where au_lname = 'White'"))))
00124     goto error;
00125
00126   if(FAILED(pICommand->Execute(NULL, IID_IMultipleResults, NULL,
00127     &cRowsAffected,(IUnknown**) &pIMultipleResults)))
00128     goto error;
00129
00130   if(FAILED(pIMultipleResults->GetResult(NULL, 0, IID_IRowset,
00131     &cRowsAffected,(IUnknown**) &pIRowset)))
00132     goto error;
00133
00134    if(FAILED(pIRowset->QueryInterface(IID_IAccessor,
00135     (void**) &pIAccessor)))
00136     goto error;
00137
00138    if(FAILED(pIAccessor->CreateAccessor(DBACCESSOR_ROWDATA, 1,
00139     &DBBindings,0,&hAccessor,&DBBindStatus)))
00140     goto error;
00141
00142   if(DBBINDSTATUS_OK != DBBindStatus)
00143     goto error;
00144
00145    if(FAILED(pIRowset->GetNextRows(0,0,1,&cRowsObtained,&pRows )))
00146     goto error;
00147
00148   if(cRowsObtained == 0)
00149         goto error;
00150
00151    if(FAILED(pIRowset->GetData(hRow, hAccessor, RowValue)))
00152     goto error;
00153
00154   OLECHAR svalue[20];
00155    if(0 == MultiByteToWideChar(CP_ACP, 0, (const char *)RowValue,
00156     20, svalue, 20))
00157     goto error;
00158   *returnval = SysAllocString(svalue);
00159
00160   if (m_spObjectContext)
00161     m_spObjectContext->SetComplete();
00162
00163   retcode = S_OK;
00164
00165   goto cleanup;
00166
00167
00168 error:
00169   if (m_spObjectContext)
00170     m_spObjectContext->SetAbort();
00171   retcode = E_FAIL;
00172   goto cleanup;
00173
00174 cleanup:
00175   if(pIDBCreateSession)
00176       pIDBCreateSession->Release();
00177
00178    if(pIDBCreateCommand)
00179     pIDBCreateCommand->Release();
00180
00181   if(pICommand)
00182       pICommand->Release();
00183
00184    if(pICommandText)
00185     pICommandText->Release();
00186
00187   if(pIRowset)
00188   {
00189     pIRowset->ReleaseRows(cRowsObtained, &hRow, NULL, NULL, NULL);
00190     pIRowset->Release();
00191   }
00192
00193   if(pIAccessor)
00194   {
00195     pIAccessor->ReleaseAccessor(hAccessor, NULL);
00196     pIAccessor->Release();
00197   }
00198
00199   if(pIMultipleResults)
00200     pIMultipleResults->Release();
00201
00202   if(pIDBInitialize)
00203   {
00204     pIDBInitialize->Uninitialize();
00205     pIDBInitialize->Release();
00206   }
00207
00208     CoUninitialize();
00209
00210     return retcode;
00211 }
00212
00213 HRESULT SetInitProps(IDBInitialize * pIDBInitialize)
00214 {
00215   IDBProperties* pIDBProperties;
00216    DBPROP         InitProperties[4];
00217    DBPROPSET      rgInitPropSet;
00218   HRESULT     retcode;
00219
00220    for (ULONG i = 0; i < 4; i++ )
00221   {
00222     VariantInit(&InitProperties[i].vValue);
00223       InitProperties[i].dwOptions = DBPROPOPTIONS_REQUIRED;
00224       InitProperties[i].colid = DB_NULLID;
00225    }
00226
00227    InitProperties[0].dwPropertyID = DBPROP_INIT_PROMPT;
00228    InitProperties[0].vValue.vt = VT_I2;
00229    InitProperties[0].vValue.iVal = DBPROMPT_NOPROMPT;
00230
00231    InitProperties[1].dwPropertyID = DBPROP_INIT_DATASOURCE;
00232    InitProperties[1].vValue.vt = VT_BSTR;
00233    InitProperties[1].vValue.bstrVal = SysAllocString(OLESTR("pubs"));
00234
00235    InitProperties[2].dwPropertyID = DBPROP_AUTH_USERID;
00236    InitProperties[2].vValue.vt = VT_BSTR;
00237    InitProperties[2].vValue.bstrVal = SysAllocString(OLESTR("sa"));
00238
00239    InitProperties[3].dwPropertyID = DBPROP_AUTH_PASSWORD;
00240    InitProperties[3].vValue.vt = VT_BSTR;
00241    InitProperties[3].vValue.bstrVal = SysAllocString(OLESTR(""));
00242
00243    rgInitPropSet.guidPropertySet = DBPROPSET_DBINIT;
00244    rgInitPropSet.cProperties = 4;
00245    rgInitPropSet.rgProperties = InitProperties;
00246
00247    if(FAILED(pIDBInitialize->QueryInterface(IID_IDBProperties, (void**) &pIDBProperties)))
00248     goto error;
00249    if(FAILED(pIDBProperties->SetProperties(1, &rgInitPropSet)))
00250     goto error;
00251
00252   retcode = S_OK;
00253   goto cleanup;
00254
00255 error:
00256   retcode = E_FAIL;
00257   goto cleanup;
00258
00259 cleanup:
00260   if(pIDBProperties)
00261     pIDBProperties->Release();
00262
00263   SysFreeString(InitProperties[1].vValue.bstrVal);
00264    SysFreeString(InitProperties[2].vValue.bstrVal);
00265    SysFreeString(InitProperties[3].vValue.bstrVal);
00266
00267   return retcode;
00268 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/HuError.h Source File

  • NetDS
  • WinSock
  • Dt_Dll

HuError.h

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c) 1995 Intel Corp
00004
00005   File Name:
00006
00007     huerror.cpp
00008
00009   Abstract:
00010
00011     Header file for error functions.
00012
00013 --*/
00014
00015 #ifndef _ERRORH_
00016 #define _ERRORH_
00017
00018 #include <stdarg.h>
00019
00020 const int ERRORSTART = 0x100;
00021
00022 typedef enum {  ENONE     = ERRORSTART,
00023                 OTHERERROR,
00024                 ALLOCERROR,
00025                 INVALIDARG,
00026                 OBJNOTINIT,
00027     OBJEFFERROR,  // Object effeciency error.
00028     ALREADYCONN,
00029     ALREADYLIST
00030              } ErrorCode_e;
00031
00032 void        HUSetLastError(ErrorCode_e ErrorCode);
00033 ErrorCode_e HUGetLastError();
00034 void        HUPrintError(char *func,ErrorCode_e ErrorCode = ENONE);
00035
00036 #endif
00037 
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/LogWriter/LogFile.h Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest
  • LogWriter

LogFile.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: LogFile.h
00004
00005 Summary: Declaration of CLogFile
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 #ifndef __LOGFILE_H_
00023 #define __LOGFILE_H_
00024
00025 #include "resource.h"       // main symbols
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CLogFile
00029 class ATL_NO_VTABLE CLogFile :
00030   public CComObjectRootEx<CComSingleThreadModel>,
00031   public CComCoClass<CLogFile, &CLSID_LogFile>,
00032   public IDispatchImpl<ILogFile, &IID_ILogFile, &LIBID_LOGWRITERLib>,
00033   public IObjectControl,
00034   public IObjectConstruct
00035 {
00036 public:
00037   CLogFile()
00038   {
00039   }
00040
00041   ~CLogFile();
00042
00043 DECLARE_REGISTRY_RESOURCEID(IDR_LOGFILE)
00044
00045 DECLARE_PROTECT_FINAL_CONSTRUCT()
00046
00047 BEGIN_COM_MAP(CLogFile)
00048   COM_INTERFACE_ENTRY(ILogFile)
00049   COM_INTERFACE_ENTRY(IDispatch)
00050   COM_INTERFACE_ENTRY(IObjectControl)
00051   COM_INTERFACE_ENTRY(IObjectConstruct)
00052 END_COM_MAP()
00053
00054 private:
00055 // ILogFile
00056   STDMETHOD(Write)(/*[in]*/ BSTR buf, /*[in]*/ DWORD dwID);
00057
00058 // IObjectControl
00059   STDMETHOD(Activate)();
00060   STDMETHOD_(VOID, Deactivate)();
00061   STDMETHOD_(BOOL, CanBePooled)();
00062
00063 // IObjectConstruct
00064   STDMETHOD(Construct)(IDispatch * pCtorObj);
00065
00066 // private vars
00067   HANDLE  m_hFile;
00068   IContextState* m_pContextState;
00069
00070 };
00071
00072 #endif //__LOGFILE_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/omniprov/source/msomniprovrs.cpp Source File

  • Dataaccess
  • oledb
  • omniprov
  • source

msomniprovrs.cpp

Go to the documentation of this file.
00001 // Start of file MSOmniProvRS.cpp
00002 // File: MSOmniProvRS.cpp
00003 //
00004 //  This file contains the implementation for the CMSOmniProvRowset and CMSOmniProvCommand
00005 //
00006 //  The following functions have been customized or added for the provider to function:
00007 //
00008 //    CMSOmniProvCommand :: Execute -  Executes the command...
00009 //    CMSOmniProvCommand :: GetColumnsInfo - Returns the column metadata requested by the consumer...
00010 //    CMSOmniProvRowset :: Execute - Parses the SQL query, executes it and builds the initial rowset...
00011 //    CMSOmniProvRowset :: GetColumnInfo - Returns the column metadata requested by the consumer builds reading the schema '.sxt' file...
00012 //    CMSOmniProvRowset :: CreateColInfo - Creates all of the column information and stores it in the rowset...
00013 //    CMSOmniProvRowset :: AllocateProxyBuffers - Causes the proxy buffers to be allocated for each of the CRow objects...
00014 //    CMSOmniProvRowset :: GetSchemaInfo - Returns the column metadata about the rowset...
00015 //    CMSOmniProvRowset :: CheckTable - Finds if the table in the Query exists or not...
00016 //    CMSOmniProvRowset :: GetDataSource - Retrieves the file name including the path to the schema '.sxt' file...
00017 //
00018
00019 #include "stdafx.h"
00020 #include "TheProvider.h"  // Contains the definitions for the interfaces
00021 #include "MSOmniProvRS.h"  // Command and rowset header file
00022 #include <comdef.h> // For _bstr_t
00023
00024 // CMSOmniProvCommand
00025
00026 // CMSOmniProvCommand :: Execute
00027 // Executes the command...
00028 HRESULT CMSOmniProvCommand::Execute(IUnknown * pUnkOuter, REFIID riid, DBPARAMS * pParams,
00029                  LONG * pcRowsAffected, IUnknown ** ppRowset)
00030 {
00031   CMSOmniProvRowset* pRowset;
00032   return CreateRowset(pUnkOuter, riid, pParams, pcRowsAffected, ppRowset, pRowset);
00033 }
00034
00035 // CMSOmniProvCommand :: GetColumnsInfo
00036 // Returns the column metadata requested by the consumer...
00037 ATLCOLUMNINFO* CMSOmniProvCommand::GetColumnInfo(CMSOmniProvCommand* pv, ULONG* pcInfo)
00038 {
00039   return NULL;
00040 }
00041
00042
00043 // CMSOmniProvRowset
00044
00045 // CMSOmniProvRowset::Execute
00046 // 1. Parse the SQL query,
00047 // 2. Execute the query, and
00048 // 3. Build the initial rowset
00049 HRESULT CMSOmniProvRowset::Execute(DBPARAMS * pParams, LONG* pcRowsAffected)
00050 {
00051   USES_CONVERSION;
00052   CMSOmniProvRowset* pT = (CMSOmniProvRowset*) this;
00053   CMSOmniProvRowset::ObjectLock cab((CMSOmniProvRowset*) this);
00054   HRESULT hr;
00055
00056   _bstr_t m_bstrFileName;
00057   if ( FAILED(hr=pT->GetDataSource(m_bstrFileName)) )
00058     return hr;
00059
00060   // Check the property value whether read/ updatabiliy property is set or not...
00061   _variant_t varUpd;
00062   GetPropValue(&DBPROPSET_ROWSET,DBPROP_UPDATABILITY, &varUpd);
00063   if ( 0 != varUpd.iVal )
00064   {
00065     // 1. a) Build the file's Schema m_prgColInfo from the '.sxt' file,
00066     //     b) Open the file '.txt', and
00067     //     c) Fill the m_DBFile.m_Rows structure
00068     // Open in exclusive mode
00069     if (!m_DBFile.Open((LPCTSTR) m_bstrFileName,true))
00070       return DB_E_NOTABLE;
00071     if (!m_DBFile.FillRowArray())
00072         return E_FAIL;
00073   }
00074   else // Open in non-exclusive mode
00075   {
00076     if (!m_DBFile.Open((LPCTSTR) m_bstrFileName,false))
00077       return DB_E_NOTABLE;
00078     if (!m_DBFile.FillRowArray())
00079         return E_FAIL;
00080   }
00081
00082   // Validate Command
00083     // 2. PARSE the SQL Query here  (Only SELECT * FROM <Table_Name> is supported)
00084   TCHAR sep[] = " ";
00085   _bstr_t bstrSQL(pT->m_strCommandText);
00086   TCHAR * token = _tcstok((TCHAR*) bstrSQL, (TCHAR*) sep);
00087
00088   if (!CheckTable((TCHAR*) token))
00089   {
00090     // The Rowset was created using the ICommand::Execute( )...
00091     // Only "SELECT * FROM Table_Name"  Queries are supported
00092     if(_tcscmp(_tcsupr(token),"SELECT") != 0)
00093     {
00094       ATLTRACE2(atlTraceDBProvider,0,(const TCHAR*) (_bstr_t("Query: '")+ bstrSQL + _bstr_t("' is not a valid Query\n")));
00095       return DB_E_ERRORSINCOMMAND;
00096     }
00097     ATLTRACE2(atlTraceDBProvider,0,(const TCHAR*) (_bstr_t("\tIt is a valid '")+_bstr_t(token) + _bstr_t("' Query\n")));
00098
00099     TCHAR szTblNm[MAX_TABLE_NAME_SIZE];
00100     while (token != NULL)
00101     {
00102       _tcscpy(szTblNm,token);
00103       token= _tcstok(NULL,(TCHAR*) sep);
00104     }
00105     if (!CheckTable((TCHAR*) szTblNm))
00106       return DB_E_NOTABLE;
00107   }
00108
00109   // Allocate proxy buffers based on the schema information
00110   // Each CRow contains proxy buffer that the data is trasnferred to in the native
00111   // format.  This information then needs to be copied out to the file in character format
00112   // on SetData() calls.
00113
00114   CreateColInfo();
00115
00116   AllocateProxyBuffers();
00117
00118   if (pcRowsAffected != NULL)
00119     *pcRowsAffected = m_DBFile.m_Rows.GetSize();
00120
00121   return S_OK;
00122 }
00123
00124 // CMSOmniProvRowset :: GetColumnInfo
00125 // Overriding GetColumnInfo as we will be deriving the column information
00126 // from the schema '.sxt' file
00127 ATLCOLUMNINFO* CMSOmniProvRowset::GetColumnInfo(CMSOmniProvRowset* pv, ULONG* pNumCols)
00128 {
00129   ATLASSERT(pv!=NULL);
00130   ATLASSERT(pNumCols!=NULL);
00131
00132   return pv->GetSchemaInfo(pNumCols);
00133 }
00134
00135 // CMSOmniProvRowset :: CreateColInfo
00136 // This function creates all of the column information and stores it in the rowset.
00137 // It currently uses all of the columns of the table
00138 void CMSOmniProvRowset::CreateColInfo()
00139 {
00140   // check if bookmarks are set
00141   bool bUseBookmarks = false;
00142   CComVariant varBookmarks;
00143   HRESULT hrLocal = GetPropValue(&DBPROPSET_ROWSET, DBPROP_BOOKMARKS, &varBookmarks);
00144   bUseBookmarks = (hrLocal == S_OK &&  varBookmarks.boolVal == VARIANT_TRUE);
00145
00146   // get column info from the .INI file
00147   ULONG ulNumCols;
00148   ATLCOLUMNINFO * prgColInfo = m_DBFile.GetSchemaInfo(&ulNumCols);
00149
00150   // Need to add bookmark column info?
00151   if (bUseBookmarks)
00152   {
00153     // create new set of column information which includes bookmarks
00154     ATLCOLUMNINFO * prgColInfoNew;
00155     prgColInfoNew = new ATLCOLUMNINFO[ulNumCols+1];
00156
00157     // set bindings for the bookmark
00158     memset(&prgColInfoNew[0], 0, sizeof(ATLCOLUMNINFO));
00159     prgColInfoNew[0].cbOffset = 0;
00160     prgColInfoNew[0].iOrdinal = 0;
00161     prgColInfoNew[0].columnid.eKind = DBKIND_NAME;
00162     prgColInfoNew[0].columnid.uGuid.guid = GUID_NULL;
00163     prgColInfoNew[0].columnid.uName.pwszName = OLESTR("Bookmark");
00164     prgColInfoNew[0].pwszName = OLESTR("Bookmark");
00165     prgColInfoNew[0].wType = DBTYPE_I4;
00166     prgColInfoNew[0].ulColumnSize = 4;
00167     prgColInfoNew[0].dwFlags = DBCOLUMNFLAGS_ISBOOKMARK;
00168
00169     // copy the old information into the new
00170     for (unsigned int i = 1; i <= ulNumCols; i++)
00171     {
00172       prgColInfoNew[i] = prgColInfo[i-1];
00173       prgColInfoNew[i].cbOffset +=4;  //adjust space for bookmark
00174     }
00175
00176     ulNumCols++;
00177     prgColInfo = prgColInfoNew;
00178   }
00179
00180   // store column info in the rowset object
00181   SetSchemaInfo(prgColInfo, ulNumCols);
00182   // 2.0
00183   // Release the temporary prgColInfo
00184   delete prgColInfo;
00185 }
00186
00187 // CMSOmniProvRowset :: AllocateProxyBuffers
00188 // Causes the proxy buffers to be allocated for each of the CRow objects
00189 // which represents one row of the file.
00190 void CMSOmniProvRowset::AllocateProxyBuffers()
00191 {
00192   CSimpleArray<CRow *> * pRows = &m_DBFile.m_Rows;
00193   int nSize = pRows->GetSize();
00194   for (int i = 0; i < nSize; i++)
00195   {
00196     (*pRows)[i]->AllocProxyBuffer(m_prgColInfo, m_cCols);
00197   }
00198 }
00199
00200 // CMSOmniProvRowset :: GetSchemaInfo
00201 // Returns the column metadata about the rowset...
00202 ATLCOLUMNINFO * CMSOmniProvRowset::GetSchemaInfo(ULONG * pNumCols)
00203 {
00204   // Allocate the column information only once  as the functions we are returning the
00205   // data from don't free.
00206   *pNumCols = m_cCols;
00207
00208   return m_prgColInfo;
00209 }
00210
00211
00212 // CMSOmniProvRowset :: CheckTable
00213 // Finds if the table in the Query exists or not...
00214 // 2.0
00215 // Code to recognize table name enclosed in [ ]...
00216 BOOL CMSOmniProvRowset::CheckTable(TCHAR* szTblNm)
00217 {
00218   CMSOmniProvRowset* pT = (CMSOmniProvRowset*) this;
00219   if(szTblNm[0] == '[')
00220   {
00221     int iLenBuff = 0;
00222     iLenBuff = _tcslen(szTblNm);
00223     TCHAR *szTmpBuff= (TCHAR *) malloc(sizeof(TCHAR) *iLenBuff );
00224      _tcsncpy(szTmpBuff, szTblNm + 1,iLenBuff -2);
00225     szTmpBuff[sizeof(TCHAR) *(iLenBuff - 2)] = '\0';
00226     if (!_tcscmp(pT->m_DBFile.m_szTblNm, szTmpBuff))
00227     {
00228         free(szTmpBuff);
00229       return true;
00230     }
00231     else
00232         free(szTmpBuff);
00233   }
00234   if (!_tcscmp(pT->m_DBFile.m_szTblNm, szTblNm))
00235     return true;
00236   else
00237     return false;
00238 }
00239
00240 //CMSOmniProvRowset :: GetDataSource
00241 // Retrieves the file name including the path to the schema '.sxt' file...
00242 HRESULT CMSOmniProvRowset::GetDataSource(_bstr_t &m_bstrLoc)
00243 {
00244   CMSOmniProvRowset* pT = (CMSOmniProvRowset*) this;
00245   CMSOmniProvRowset::ObjectLock cab((CMSOmniProvRowset*) this);
00246   CComPtr<IDBCreateCommand> spSession = NULL;
00247   CComPtr<IRowset> spRowset = NULL;
00248
00249   HRESULT hr = pT->GetSite(IID_IDBCreateCommand, (void**) &spSession);
00250   if (SUCCEEDED(hr))  // The Rowset was created from an IOpenRowset::OpenRowset( )...
00251   {
00252       // Get to DBPROP_INIT_DATASOURCE property
00253       CComPtr<IDBCreateSession> spInit;
00254       CComPtr<IObjectWithSite> spCreator2 = NULL;
00255
00256       if (FAILED(hr = spSession->QueryInterface(IID_IObjectWithSite,(void**) &spCreator2)))
00257       {
00258           ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IObjectWithSite from ICommand...\n");
00259           return E_FAIL;
00260       }
00261
00262       if (FAILED(hr = spCreator2->GetSite(IID_IDBCreateSession,(void**) &spInit)))
00263       {
00264           ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IDBCreateSession from ICommand...\n");
00265           return E_FAIL;
00266       }
00267       // Initialize the property variables
00268       ULONG               cPropertyIDSets =1;
00269       DBPROPIDSET   rgPropertyIDSets[1];
00270       ULONG              cPropertySets;
00271       DBPROPSET *        prgPropertySets;
00272       DBPROPID  rgPropId[1];
00273
00274       rgPropId[0] = DBPROP_INIT_DATASOURCE;
00275       rgPropertyIDSets[0].rgPropertyIDs = rgPropId;
00276       rgPropertyIDSets[0].cPropertyIDs = 1;
00277       rgPropertyIDSets[0].guidPropertySet = DBPROPSET_DBINIT;
00278       CComPtr<IDBProperties> spProperties = NULL;
00279
00280       hr = spInit->QueryInterface(IID_IDBProperties,(void**) &spProperties);
00281       if(FAILED(hr))
00282       {
00283         ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IDBCreateSession'ss IDBProperties...\n");
00284         return hr;
00285       }
00286
00287       spProperties->GetProperties(cPropertyIDSets, rgPropertyIDSets,&cPropertySets, &prgPropertySets) ;
00288       m_bstrLoc = _bstr_t(prgPropertySets->rgProperties[0].vValue);
00289   }
00290   else // The Rowset was created from ICommand::Execute( )
00291   {
00292     CComPtr<ICommand> spCommand=NULL;
00293     hr = pT->GetSite(IID_ICommand,(void**) &spCommand);
00294     if(FAILED(hr))
00295     {
00296       ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the ICommand of the Rowset...\n");
00297       return E_FAIL;
00298     }
00299
00300     CComPtr<IObjectWithSite> spCreator = NULL;
00301     if (FAILED(hr = spCommand->QueryInterface(IID_IObjectWithSite,(void**) &spCreator)))
00302     {
00303         ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IObjectWithSite from ICommand...\n");
00304         return E_FAIL;
00305     }
00306
00307     if (FAILED(hr = spCreator->GetSite(IID_IDBCreateCommand,(void**) &spSession)))
00308     {
00309         ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IDBCreateSession from ICommand...\n");
00310         return E_FAIL;
00311     }
00312
00313     CComPtr<IDBCreateSession> spInit;
00314     CComPtr<IObjectWithSite> spCreator2 = NULL;
00315     if (FAILED(hr = spSession->QueryInterface(IID_IObjectWithSite,(void**) &spCreator2)))
00316     {
00317         ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IObjectWithSite from ICommand...\n");
00318         return E_FAIL;
00319     }
00320     if (FAILED(hr = spCreator2->GetSite(IID_IDBCreateSession,(void**) &spInit)))
00321     {
00322         ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IDBCreateSession from ICommand...\n");
00323         return E_FAIL;
00324     }
00325
00326     // Get to DBPROP_INIT_DATASOURCE
00327     ULONG               cPropertyIDSets =1;
00328     DBPROPIDSET   rgPropertyIDSets[1];
00329     ULONG              cPropertySets;
00330     DBPROPSET *        prgPropertySets;
00331     DBPROPID  rgPropId[1];
00332
00333     rgPropId[0] = DBPROP_INIT_DATASOURCE;
00334     rgPropertyIDSets[0].rgPropertyIDs = rgPropId;
00335     rgPropertyIDSets[0].cPropertyIDs = 1;
00336     rgPropertyIDSets[0].guidPropertySet = DBPROPSET_DBINIT;
00337
00338     CComPtr<IDBProperties> spProperties = NULL;
00339     hr = spInit->QueryInterface(IID_IDBProperties,(void**) &spProperties);
00340     if(FAILED(hr))
00341     {
00342       ATLTRACE2(atlTraceDBProvider,0,"FATAL ERROR: Cannot get to the IDBCreateSession'ss IDBProperties...\n");
00343       return hr;
00344     }
00345
00346     spProperties->GetProperties(cPropertyIDSets, rgPropertyIDSets,&cPropertySets, &prgPropertySets) ;
00347     m_bstrLoc = _bstr_t(prgPropertySets->rgProperties[0].vValue);
00348   }
00349   return hr;
00350 }
00351
00352 // End of file MSOmniProvRS.cpp
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CryptoApi/InitUser/InitUser.c Source File

  • Security
  • CryptoApi
  • InitUser

InitUser.c

Go to the documentation of this file.
00001 /******************************************************************************\
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1996 - 2000.  Microsoft Corporation.  All rights reserved.
00008 \******************************************************************************/
00009
00010 #include <windows.h>
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 #include <wincrypt.h>
00014
00015 /*****************************************************************************/
00016 void _cdecl main(void)
00017 {
00018     INT iReturn = 0;
00019     HCRYPTPROV hProv = 0;
00020     LPSTR pszContainerName = NULL;
00021     DWORD cbContainerName = 0;
00022     HCRYPTKEY hKey;
00023
00024     // Attempt to acquire a handle to the default key container.
00025     if(!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0)) {
00026
00027         if(GetLastError() != NTE_BAD_KEYSET) {
00028             // Some sort of error occured.
00029             printf("Error opening default key container!\n");
00030             goto Error;
00031         }
00032
00033         // Create default key container.
00034         if(!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET)) {
00035
00036             printf("Error creating default key container!\n");
00037             goto Error;
00038         }
00039
00040         // Get size of the name of the default key container name.
00041         if(CryptGetProvParam(hProv, PP_CONTAINER, NULL, &cbContainerName, 0)) {
00042
00043             // Allocate buffer to receive default key container name.
00044             pszContainerName = malloc(cbContainerName);
00045
00046             if(pszContainerName) {
00047                 // Get name of default key container name.
00048                 if(!CryptGetProvParam(hProv, PP_CONTAINER, pszContainerName, &cbContainerName, 0)) {
00049                     // Error getting default key container name.
00050                     pszContainerName[0] = 0;
00051                 }
00052             }
00053         }
00054
00055         printf("Create key container '%s'\n", pszContainerName ? pszContainerName : "");
00056
00057         // Free container name buffer (if created)
00058         if(pszContainerName) {
00059             free(pszContainerName);
00060         }
00061     }
00062
00063     // Attempt to get handle to signature key.
00064     if(!CryptGetUserKey(hProv, AT_SIGNATURE, &hKey)) {
00065
00066         if(GetLastError() != NTE_NO_KEY) {
00067             printf("Error %x during CryptGetUserKey!\n", GetLastError());
00068             goto Error;
00069         }
00070
00071         // Create signature key pair.
00072         printf("Create signature key pair\n");
00073
00074         if(!CryptGenKey(hProv, AT_SIGNATURE, 0, &hKey)) {
00075             printf("Error %x during CryptGenKey!\n", GetLastError());
00076             goto Error;
00077         }
00078     }
00079
00080     // Close key handle
00081     CryptDestroyKey(hKey);
00082
00083     // Attempt to get handle to exchange key.
00084     if(!CryptGetUserKey(hProv, AT_KEYEXCHANGE, &hKey)) {
00085
00086         if(GetLastError() != NTE_NO_KEY) {
00087             printf("Error %x during CryptGetUserKey!\n", GetLastError());
00088             goto Error;
00089         }
00090
00091         // Create key exchange key pair.
00092         printf("Create key exchange key pair\n");
00093
00094         if(!CryptGenKey(hProv, AT_KEYEXCHANGE, 0, &hKey)) {
00095             printf("Error %x during CryptGenKey!\n", GetLastError());
00096             goto Error;
00097         }
00098     }
00099
00100     // Close key handle
00101     CryptDestroyKey(hKey);
00102
00103     printf("OK\n");
00104
00105 Exit:
00106
00107     // Close the context (if open)
00108     if(hProv) {
00109         CryptReleaseContext(hProv, 0);
00110     }
00111
00112     exit(iReturn);
00113
00114 Error:
00115
00116     iReturn = 1;
00117     goto Exit;
00118 }
Generated on Wed Nov 13 2024 16:52:29 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/comp.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 CComponent::CComponent(CComponentData *parent)
00029 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL)
00030 {
00031     OBJECT_CREATED
00032
00033         m_ipDisplayHelp = NULL;
00034     m_ipControlBar  = NULL;
00035     m_ipMenuButton  = NULL;
00036 }
00037
00038 CComponent::~CComponent()
00039 {
00040     OBJECT_DESTROYED
00041 }
00042
00043 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00044 {
00045     if (!ppv)
00046         return E_FAIL;
00047
00048     *ppv = NULL;
00049
00050     if (IsEqualIID(riid, IID_IUnknown))
00051         *ppv = static_cast<IComponent *>(this);
00052     else if (IsEqualIID(riid, IID_IComponent))
00053         *ppv = static_cast<IComponent *>(this);
00054     else if (IsEqualIID(riid, IID_IExtendControlbar))
00055         *ppv = static_cast<IExtendControlbar *>(this);
00056
00057     if (*ppv)
00058     {
00059         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00060         return S_OK;
00061     }
00062
00063     return E_NOINTERFACE;
00064 }
00065
00066 STDMETHODIMP_(ULONG) CComponent::AddRef()
00067 {
00068     return InterlockedIncrement((LONG *)&m_cref);
00069 }
00070
00071 STDMETHODIMP_(ULONG) CComponent::Release()
00072 {
00073     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00074     {
00075         delete this;
00076         return 0;
00077     }
00078     return m_cref;
00079
00080 }
00081
00082 ///////////////////////////////
00083 // Interface IComponent
00084 ///////////////////////////////
00085 STDMETHODIMP CComponent::Initialize(
00086                                     /* [in] */ LPCONSOLE lpConsole)
00087 {
00088     HRESULT hr = S_OK;
00089
00090     // Save away all the interfaces we'll need.
00091     // Fail if we can't QI the required interfaces.
00092
00093     m_ipConsole = lpConsole;
00094     m_ipConsole->AddRef();
00095
00096     hr = m_ipConsole->QueryInterface(IID_IDisplayHelp, (void **)&m_ipDisplayHelp);
00097
00098     return hr;
00099 }
00100
00101 STDMETHODIMP CComponent::Notify(
00102                                 /* [in] */ LPDATAOBJECT lpDataObject,
00103                                 /* [in] */ MMC_NOTIFY_TYPE event,
00104                                 /* [in] */ LPARAM arg,
00105                                 /* [in] */ LPARAM param)
00106 {
00107     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00108
00109     HRESULT hr = S_FALSE;
00110
00111   //Get our data object. If it is NULL, we return with S_FALSE.
00112   //See implementation of GetOurDataObject() to see how to
00113   //handle special data objects.
00114   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00115   if (NULL == pDataObject)
00116     return S_FALSE;
00117
00118   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00119
00120     switch (event)      {
00121     case MMCN_ADD_IMAGES:
00122         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00123         break;
00124
00125     case MMCN_SELECT:
00126         hr = base->OnSelect(m_ipConsole, (BOOL) LOWORD(arg), (BOOL) HIWORD(arg));
00127         break;
00128
00129     case MMCN_SHOW:
00130         hr = base->OnShow(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00131         break;
00132
00133     case MMCN_CONTEXTHELP:
00134         hr = base->OnShowContextHelp(m_ipDisplayHelp, m_pComponentData->m_HelpFile);
00135         break;
00136     }
00137
00138     return hr;
00139 }
00140
00141 STDMETHODIMP CComponent::Destroy(
00142                                  /* [in] */ MMC_COOKIE cookie)
00143 {
00144     if (m_ipConsole) {
00145         m_ipConsole->Release();
00146         m_ipConsole = NULL;
00147     }
00148
00149     if (m_ipDisplayHelp) {
00150         m_ipDisplayHelp->Release();
00151         m_ipDisplayHelp = NULL;
00152     }
00153
00154     if (m_ipControlBar) {
00155         m_ipControlBar->Release();
00156         m_ipControlBar = NULL;
00157     }
00158
00159     if (m_ipMenuButton) {
00160         m_ipMenuButton->Release();
00161         m_ipMenuButton = NULL;
00162     }
00163
00164     return S_OK;
00165 }
00166
00167
00168 STDMETHODIMP CComponent::QueryDataObject(
00169                                          /* [in] */ MMC_COOKIE cookie,
00170                                          /* [in] */ DATA_OBJECT_TYPES type,
00171                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00172 {
00173     CDataObject *pObj = NULL;
00174
00175     if (cookie == 0)
00176         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00177     else
00178         pObj = new CDataObject(cookie, type);
00179
00180     if (!pObj)
00181         return E_OUTOFMEMORY;
00182
00183     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00184
00185     return S_OK;
00186 }
00187
00188 STDMETHODIMP CComponent::GetResultViewType(
00189                                            /* [in] */ MMC_COOKIE cookie,
00190                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00191                                            /* [out] */ long __RPC_FAR *pViewOptions)
00192 {
00193     CDelegationBase *base = (CDelegationBase *)cookie;
00194
00195     //
00196     // Ask for default listview.
00197     //
00198     if (base == NULL)
00199     {
00200         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00201         *ppViewType = NULL;
00202     }
00203     else
00204         return base->GetResultViewType(ppViewType, pViewOptions);
00205
00206     return S_OK;
00207 }
00208
00209 STDMETHODIMP CComponent::GetDisplayInfo(
00210                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00211 {
00212     HRESULT hr = S_OK;
00213     CDelegationBase *base = NULL;
00214
00215     // if they are asking for the RDI_STR we have one of those to give
00216
00217     if (pResultDataItem->lParam) {
00218         base = (CDelegationBase *)pResultDataItem->lParam;
00219         if (pResultDataItem->mask & RDI_STR) {
00220                         LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00221                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00222             pResultDataItem->str = pszW;
00223         }
00224
00225         if (pResultDataItem->mask & RDI_IMAGE) {
00226             pResultDataItem->nImage = base->GetBitmapIndex();
00227         }
00228     }
00229
00230     return hr;
00231 }
00232
00233
00234 STDMETHODIMP CComponent::CompareObjects(
00235                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00236                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00237 {
00238     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00239     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00240
00241     // compare the object pointers
00242     if (baseA->GetCookie() == baseB->GetCookie())
00243         return S_OK;
00244
00245     return S_FALSE;
00246 }
00247
00248 ///////////////////////////////
00249 // Interface IExtendControlBar
00250 ///////////////////////////////
00251 HRESULT CComponent::SetControlbar(
00252                                   /* [in] */ LPCONTROLBAR pControlbar)
00253 {
00254     HRESULT hr = S_OK;
00255
00256     //
00257     //  Clean up
00258     //
00259
00260     // if we've got a cached control bar, release it
00261     if (m_ipControlBar) {
00262         m_ipControlBar->Release();
00263         m_ipControlBar = NULL;
00264     }
00265
00266     // if we've got a cached menubutton, release it
00267     if (m_ipMenuButton) {
00268         m_ipMenuButton->Release();
00269         m_ipMenuButton = NULL;
00270     }
00271
00272     //
00273     // Install new pieces if necessary
00274     //
00275
00276     // if a new one came in, cache and AddRef
00277     if (pControlbar) {
00278         m_ipControlBar = pControlbar;
00279         m_ipControlBar->AddRef();
00280
00281         // add our menu button
00282         hr = m_ipControlBar->Create(MENUBUTTON,  // type of control to be created
00283             dynamic_cast<IExtendControlbar *>(this),
00284             reinterpret_cast<IUnknown **>(&m_ipMenuButton));
00285         _ASSERT(SUCCEEDED(hr));
00286
00287         m_ipMenuButton->AddRef();
00288
00289         hr = m_ipMenuButton->AddButton(IDR_STATE_MENU, L"Vehicle &Status", L"Change vehicle state");
00290         _ASSERT(SUCCEEDED(hr));
00291     }
00292
00293     return hr;
00294 }
00295
00296 HRESULT CComponent::ControlbarNotify(
00297                                      /* [in] */ MMC_NOTIFY_TYPE event,
00298                                      /* [in] */ LPARAM arg,
00299                                      /* [in] */ LPARAM param)
00300 {
00301     HRESULT hr = S_OK;
00302
00303     if (event == MMCN_SELECT) {
00304         CDelegationBase *base = GetOurDataObject(reinterpret_cast<IDataObject *>(param))->GetBaseNodeObject();
00305         hr = base->SetMenuState(m_ipControlBar, m_ipMenuButton, (BOOL) LOWORD(arg), (BOOL) HIWORD(arg));
00306     } else if (event == MMCN_MENU_BTNCLICK) {
00307         CDelegationBase *base = GetOurDataObject(reinterpret_cast<IDataObject *>(arg))->GetBaseNodeObject();
00308         hr = base->OnSetMenuButton(m_ipConsole, (MENUBUTTONDATA *)param);
00309     }
00310
00311     return hr;
00312 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRenameDlg Member List

This is the complete list of members for CRenameDlg, including all inherited members.
CRenameDlg(CString sOldName, CWnd *pParent=NULL) | CRenameDlg |
DoDataExchange(CDataExchange *pDX) | CRenameDlg | [protected, virtual]
GetName() | CRenameDlg | [inline]
IDD enum value | CRenameDlg |
m_sName | CRenameDlg |
m_sNewName | CRenameDlg | [protected]
m_sOldName | CRenameDlg | [protected]
OnInitDialog() | CRenameDlg | [protected, virtual]
OnOK() | CRenameDlg | [protected, virtual]
Generated on Wed Nov 13 2024 16:57:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Begin/Generic/Generic.H Source File

  • Begin
  • Generic

Generic.H

Go to the documentation of this file.
00001 #define IDM_NEW            100
00002 #define IDM_OPEN           101
00003 #define IDM_SAVE           102
00004 #define IDM_SAVEAS         103
00005 #define IDM_PRINT          104
00006 #define IDM_PRINTSETUP     105
00007 #define IDM_EXIT           106
00008 #define IDM_UNDO           200
00009 #define IDM_CUT            201
00010 #define IDM_COPY           202
00011 //---------------------------------------------------------------------------
00012 //  GENERIC.H
00013 //---------------------------------------------------------------------------
00014
00015 #define IDM_PASTE          203
00016 #define IDM_LINK           204
00017 #define IDM_LINKS          205
00018 #define IDM_HELPCONTENTS   300
00019 #define IDM_HELPSEARCH     301
00020 #define IDM_HELPHELP       302
00021 #define IDM_ABOUT          303
00022 #define IDM_HELPTOPICS     304
00023
00024 #define IDC_STATIC -1
00025
00026 #define DLG_VERFIRST        400
00027 #define IDC_COMPANY        DLG_VERFIRST
00028 #define IDC_FILEDESC          DLG_VERFIRST+1
00029 #define IDC_PRODVER         DLG_VERFIRST+2
00030 #define IDC_COPYRIGHT       DLG_VERFIRST+3
00031 #define IDC_OSVERSION       DLG_VERFIRST+4
00032 #define IDC_TRADEMARK       DLG_VERFIRST+5
00033 #define DLG_VERLAST         DLG_VERFIRST+5
00034
00035 #define IDC_LABEL           DLG_VERLAST+1
00036
00037
00038 #define IDS_APP_TITLE       500
00039 #define IDS_DISPLAYCHANGED  501
00040 #define IDS_VER_INFO_LANG   502
00041 #define IDS_VERSION_ERROR   503
00042 #define IDS_NO_HELP         504
00043 
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/c_draw/DrawDlg.h Source File

  • NetDS
  • MessageQueuing
  • c_draw

DrawDlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // drawdlg.h : header file
00013 //
00014 //
00015
00016 #include "drawarea.h"
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // CDisdrawDlg dialog
00020
00021 class CDisdrawDlg : public CDialog
00022 {
00023 // Construction
00024 public:
00025
00026
00027   CDisdrawDlg(CWnd* pParent = NULL);  // standard constructor
00028
00029   void SendMouseMovement(LINE lineNew);
00030   void SendKeystroke(UINT uChar);
00031
00032 // Data
00033   CString m_strLogin;
00034   HANDLE m_hqIncoming;
00035   HANDLE m_hqOutgoing;
00036
00037 // Dialog Data
00038   //{{AFX_DATA(CDisdrawDlg)
00039   enum { IDD = IDD_DISDRAW_DIALOG };
00040   CStatic m_cComputerLabel;
00041   CButton m_CancelButton;
00042   CStatic m_cQueueLabel;
00043   CButton m_cMessageFrame;
00044   CButton m_cDsFrame;
00045   CButton m_cRadioExpress;
00046   CButton m_cRadioDS;
00047   CEdit m_cComputerInput;
00048   CEdit m_cQueueInput;
00049   CButton m_cContinueButton;
00050   CDrawArea m_drawScribble;
00051   CButton m_btnAttach;
00052   CString m_strFriend;
00053   int   m_iDelivery;
00054   int   m_iRadioDS;
00055   CString m_strRemoteComputerName;
00056     CButton m_cRadioWorkgroup;
00057     CButton m_cRadioRecoverable;
00058   //}}AFX_DATA
00059
00060
00061
00062   // ClassWizard generated virtual function overrides
00063   //{{AFX_VIRTUAL(CDisdrawDlg)
00064   protected:
00065   virtual void DoDataExchange(CDataExchange* pDX);  // DDX/DDV support
00066   //}}AFX_VIRTUAL
00067
00068 // Implementation
00069 protected:
00070   void startReceiveUpdateThread();
00071   BOOL OpenPrivateReceiveQueue();
00072   void initializeUi(BOOL fConnectedToDS);
00073   HICON m_hIcon;
00074
00075   BOOL OpenReceiveQueue();
00076     BOOL IsDsEnabledLocaly();
00077
00078
00079   // Generated message map functions
00080   //{{AFX_MSG(CDisdrawDlg)
00081   virtual BOOL OnInitDialog();
00082   afx_msg void OnPaint();
00083   afx_msg HCURSOR OnQueryDragIcon();
00084   afx_msg void OnButtonAttach();
00085   afx_msg void OnChangeEditFriend();
00086   afx_msg void OnClose();
00087   afx_msg void OnConnect();
00088   afx_msg void OnChangeEditFriendComputer();
00089   //}}AFX_MSG
00090   DECLARE_MESSAGE_MAP()
00091 private:
00092   BOOL m_fDsEnabledLocaly;
00093 };
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/c_sharp/xmldsig/xmldsig.cs Source File

  • Security
  • capicom
  • c_sharp
  • xmldsig

xmldsig.cs

Go to the documentation of this file.
00001 //******************************************************************************
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00004 // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00005 // WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00006 //
00007 // Copyright (C) 1999- 2002.  Microsoft Corporation.  All rights reserved.
00008 //
00009 //******************************************************************************
00010 //
00011 // xmldsig.cs
00012 //
00013 // This is a C# sample that illustrates how to use features introduced in
00014 // CAPICOM's bridging support to interop between CAPI and System.Security.xml.
00015 //
00016 // Note: for simplicity, this code does not handle exceptions.
00017 //
00018 //******************************************************************************
00019
00020 using System;
00021 using System.Windows.Forms;
00022 using Sample.UI;
00023
00024 namespace Sample {
00025     public class Sample {
00026       public static void Main() {
00027         Application.Run(new MainWindow());
00028       }
00029     }
00030 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Proppage/space.Cpp Source File

  • SysMgmt
  • MMC
  • Proppage

space.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include <windows.h>
00021 #include "Space.h"
00022 #include "Comp.h"
00023 #include "resource.h"
00024 #define STRSAFE_NO_DEPRECATE
00025 #include <strsafe.h>
00026
00027 const GUID CSpaceVehicle::thisGuid = { 0x29743810, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00028 const GUID CRocket::thisGuid = { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00029
00030 //==============================================================
00031 //
00032 // CSpaceVehicle implementation
00033 //
00034 //
00035 CSpaceVehicle::CSpaceVehicle()
00036 {
00037     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00038         children[n] = new CRocket(_T("Rocket"), n+1, 500000, 265, 75000);
00039     }
00040 }
00041
00042 CSpaceVehicle::~CSpaceVehicle()
00043 {
00044     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00045         if (children[n]) {
00046             delete children[n];
00047         }
00048 }
00049
00050 HRESULT CSpaceVehicle::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00051 {
00052     HRESULT      hr = S_OK;
00053
00054     IHeaderCtrl *pHeaderCtrl = NULL;
00055     IResultData *pResultData = NULL;
00056
00057     if (bShow) {
00058         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00059         _ASSERT( SUCCEEDED(hr) );
00060
00061         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00062         _ASSERT( SUCCEEDED(hr) );
00063
00064         // Set the column headers in the results pane
00065         hr = pHeaderCtrl->InsertColumn( 0, L"Rocket Class", 0, MMCLV_AUTO );
00066         _ASSERT( S_OK == hr );
00067         hr = pHeaderCtrl->InsertColumn( 1, L"Rocket Weight", 0, MMCLV_AUTO );
00068         _ASSERT( S_OK == hr );
00069         hr = pHeaderCtrl->InsertColumn( 2, L"Rocket Height", 0, MMCLV_AUTO );
00070         _ASSERT( S_OK == hr );
00071         hr = pHeaderCtrl->InsertColumn( 3, L"Rocket Payload", 0, MMCLV_AUTO );
00072         _ASSERT( S_OK == hr );
00073         hr = pHeaderCtrl->InsertColumn( 4, L"Status", 0, MMCLV_AUTO );
00074         _ASSERT( S_OK == hr );
00075
00076         // insert items here
00077         RESULTDATAITEM rdi;
00078
00079         hr = pResultData->DeleteAllRsltItems();
00080         _ASSERT( SUCCEEDED(hr) );
00081
00082         if (!bExpanded) {
00083             // create the child nodes, then expand them
00084             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00085                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00086                 rdi.mask       = RDI_STR       |   // Displayname is valid
00087                     RDI_IMAGE     |
00088                     RDI_PARAM;        // nImage is valid
00089
00090                 rdi.nImage      = children[n]->GetBitmapIndex();
00091                 rdi.str         = MMC_CALLBACK;
00092                 rdi.nCol        = 0;
00093                 rdi.lParam      = (LPARAM)children[n];
00094
00095                 hr = pResultData->InsertItem( &rdi );
00096
00097                 _ASSERT( SUCCEEDED(hr) );
00098             }
00099         }
00100
00101         pHeaderCtrl->Release();
00102         pResultData->Release();
00103     }
00104
00105     return hr;
00106 }
00107
00108 //==============================================================
00109 //
00110 // CRocket implementation
00111 //
00112 //
00113 CRocket::CRocket(_TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload)
00114 : szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED)
00115 {
00116     if (szName) {
00117         this->szName = new _TCHAR[(_tcslen(szName) + 1) * sizeof(_TCHAR)];
00118         _tcscpy(this->szName, szName);
00119     }
00120
00121     this->nId = id;
00122     this->lWeight = lWeight;
00123     this->lHeight = lHeight;
00124     this->lPayload = lPayload;
00125
00126     m_ppHandle = 0;
00127 }
00128
00129 CRocket::~CRocket()
00130 {
00131     if (szName)
00132         delete [] szName;
00133 }
00134
00135 const _TCHAR *CRocket::GetDisplayName(int nCol)
00136 {
00137     const size_t cchBuffer = 128;
00138     static _TCHAR buf[cchBuffer];
00139
00140     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00141     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00142
00143     switch (nCol) {
00144     case 0:
00145         StringCchPrintf(buf, cchBuffer, _T("%s (#%d)"), szName ? szName : _T(""), nId);
00146         break;
00147
00148     case 1:
00149         StringCchPrintf(buf, cchBuffer, _T("%ld metric tons"), lWeight);
00150         break;
00151
00152     case 2:
00153         StringCchPrintf(buf, cchBuffer, _T("%ld meters"), lHeight);
00154         break;
00155
00156     case 3:
00157         StringCchPrintf(buf, cchBuffer, _T("%ld kilos"), lPayload);
00158         break;
00159
00160     case 4:
00161         StringCchPrintf(buf, cchBuffer, _T("%s"),
00162             iStatus == RUNNING ? _T("running") :
00163         iStatus == PAUSED ? _T("paused") :
00164         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00165         break;
00166
00167     }
00168
00169     return buf;
00170 }
00171
00172 HRESULT CRocket::OnRename(LPOLESTR pszNewName)
00173 {
00174     if (szName) {
00175         delete [] szName;
00176         szName = NULL;
00177     }
00178
00179     MAKE_TSTRPTR_FROMWIDE(ptrname, pszNewName);
00180     szName = new _TCHAR[(_tcslen(ptrname) + 1) * sizeof(_TCHAR)];
00181     _tcscpy(szName, ptrname);
00182
00183     return S_OK;
00184 }
00185
00186 // handle anything special when the user clicks Apply or Ok
00187 // on the property sheet.  This sample directly accesses the
00188 // operated-on object, so there's nothing special to do when the user presses Ok.
00189 // when the user presses Apply, we update the currently selected result item
00190 HRESULT CRocket::OnPropertyChange(IConsole *pConsole)
00191 {
00192
00193     //redraw the item
00194     IResultData *pResultData = NULL;
00195
00196   HRESULT hr;
00197
00198   hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00199   _ASSERT( SUCCEEDED(hr) );
00200
00201   HRESULTITEM myhresultitem;
00202
00203   //lparam == this. See CSpaceVehicle::OnShow
00204   hr = pResultData->FindItemByLParam( (LPARAM)this, &myhresultitem );
00205   _ASSERT( SUCCEEDED(hr) );
00206
00207   hr = pResultData->UpdateItem( myhresultitem );
00208   _ASSERT( SUCCEEDED(hr) );
00209
00210     pResultData->Release();
00211
00212
00213   return S_OK;
00214 }
00215
00216 HRESULT CRocket::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00217 {
00218     IConsoleVerb *pConsoleVerb;
00219
00220     HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00221     _ASSERT(SUCCEEDED(hr));
00222
00223     hr = pConsoleVerb->SetVerbState(MMC_VERB_RENAME, ENABLED, TRUE);
00224
00225     // can't get to properties (via the standard methods) unless
00226     // we tell MMC to display the Properties menu item and
00227     // toolbar button, this wil give the user a visual cue that
00228     // there's "something" to do
00229     hr = pConsoleVerb->SetVerbState(MMC_VERB_PROPERTIES, ENABLED, TRUE);
00230
00231     pConsoleVerb->Release();
00232
00233     return S_OK;
00234 }
00235
00236 // Implement the dialog proc
00237 BOOL CALLBACK CRocket::DialogProc(
00238                                   HWND hwndDlg,  // handle to dialog box
00239                                   UINT uMsg,     // message
00240                                   WPARAM wParam, // first message parameter
00241                                   LPARAM lParam  // second message parameter
00242                                   )
00243 {
00244     static CRocket *pRocket = NULL;
00245
00246     switch (uMsg) {
00247     case WM_INITDIALOG:
00248         // catch the "this" pointer so we can actually operate on the object
00249         pRocket = reinterpret_cast<CRocket *>(reinterpret_cast<PROPSHEETPAGE *>(lParam)->lParam);
00250
00251         SetDlgItemText(hwndDlg, IDC_ROCKET_NAME, pRocket->szName);
00252         SetDlgItemInt(hwndDlg, IDC_ROCKET_HEIGHT, pRocket->lHeight, FALSE);
00253         SetDlgItemInt(hwndDlg, IDC_ROCKET_WEIGHT, pRocket->lWeight, FALSE);
00254         SetDlgItemInt(hwndDlg, IDC_ROCKET_PAYLOAD, pRocket->lPayload, FALSE);
00255
00256         _ASSERT( CB_ERR != SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_INSERTSTRING, 0, (LPARAM)_T("Running")) );
00257         _ASSERT( CB_ERR != SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_INSERTSTRING, 1, (LPARAM)_T("Paused")) );
00258         _ASSERT( CB_ERR != SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_INSERTSTRING, 2, (LPARAM)_T("Stopped")) );
00259
00260         SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_SETCURSEL, (WPARAM)pRocket->iStatus, 0);
00261
00262         break;
00263
00264     case WM_COMMAND:
00265         // turn the Apply button on
00266         if (HIWORD(wParam) == EN_CHANGE ||
00267             HIWORD(wParam) == CBN_SELCHANGE)
00268             SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00269         break;
00270
00271     case WM_DESTROY:
00272         // tell MMC that we're done with the property sheet (we got this
00273         // handle in CreatePropertyPages
00274         MMCFreeNotifyHandle(pRocket->m_ppHandle);
00275         break;
00276
00277     case WM_NOTIFY:
00278         switch (((NMHDR *) lParam)->code) {
00279         case PSN_APPLY:
00280             // update the information
00281             if (pRocket->szName) {
00282                 delete [] pRocket->szName;
00283                 pRocket->szName = NULL;
00284             }
00285
00286             {
00287                 int n = SendDlgItemMessage(hwndDlg, IDC_ROCKET_NAME, WM_GETTEXTLENGTH, 0, 0);
00288                 if (n != 0) {
00289                     pRocket->szName = new _TCHAR[n + 1];
00290                     GetDlgItemText(hwndDlg, IDC_ROCKET_NAME, pRocket->szName, n + 1);
00291                 }
00292             }
00293             pRocket->lHeight = GetDlgItemInt(hwndDlg, IDC_ROCKET_HEIGHT, NULL, FALSE);
00294             pRocket->lWeight = GetDlgItemInt(hwndDlg, IDC_ROCKET_WEIGHT, NULL, FALSE);
00295             pRocket->lPayload = GetDlgItemInt(hwndDlg, IDC_ROCKET_PAYLOAD, NULL, FALSE);
00296
00297             pRocket->iStatus = (ROCKET_STATUS)SendDlgItemMessage(hwndDlg, IDC_ROCKET_STATUS, CB_GETCURSEL, 0, 0);
00298
00299             // ask MMC to send us a message (on the main thread) so
00300             // we know the Apply button was clicked.
00301             HRESULT hr = MMCPropertyChangeNotify(pRocket->m_ppHandle, (long)pRocket);
00302
00303             _ASSERT(SUCCEEDED(hr));
00304
00305             return PSNRET_NOERROR;
00306         }
00307         break;
00308     }
00309
00310     return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
00311 }
00312
00313
00314 HRESULT CRocket::HasPropertySheets()
00315 {
00316     // say "yes" when MMC asks if we have pages
00317     return S_OK;
00318 }
00319
00320 HRESULT CRocket::CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle)
00321 {
00322     PROPSHEETPAGE psp;
00323     HPROPSHEETPAGE hPage = NULL;
00324
00325     // cache this handle so we can call MMCPropertyChangeNotify
00326     m_ppHandle = handle;
00327
00328     // create the property page for this node.
00329     // NOTE: if your node has multiple pages, put the following
00330     // in a loop and create multiple pages calling
00331     // lpProvider->AddPage() for each page.
00332     psp.dwSize = sizeof(PROPSHEETPAGE);
00333     psp.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USEICONID;
00334     psp.hInstance = g_hinst;
00335     psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_LARGE);
00336     psp.pfnDlgProc = DialogProc;
00337     psp.lParam = reinterpret_cast<LPARAM>(this);
00338     psp.pszTitle = MAKEINTRESOURCE(IDS_PST_ROCKET);
00339     psp.pszIcon = MAKEINTRESOURCE(IDI_PSI_ROCKET);
00340
00341
00342     hPage = CreatePropertySheetPage(&psp);
00343     _ASSERT(hPage);
00344
00345     return lpProvider->AddPage(hPage);
00346 }
00347
00348 HRESULT CRocket::GetWatermarks(HBITMAP *lphWatermark,
00349                                HBITMAP *lphHeader,
00350                                HPALETTE *lphPalette,
00351                                BOOL *bStretch)
00352 {
00353     return S_FALSE;
00354 }
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/Java/Hello2/notify.java Source File

  • Web
  • MSAgent
  • Java
  • Hello2

notify.java

Go to the documentation of this file.
00001 //==========================================================================
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright (C) 1997-1998 Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //==========================================================================
00011
00012 // Standard java imports
00013
00014 import java.applet.*;
00015 import java.awt.*;
00016
00017 // COM and Microsoft Agent imports
00018
00019 import com.ms.com.Variant;
00020 import agentsvr.IAgentEx;
00021 import agentsvr.IAgentNotifySinkEx;
00022 import agentsvr.IAgentCharacterEx;
00023
00024 // This class is an implementation of an IAgentNotifySinkEx.
00025 // All methods are stubs except Click.
00026
00027 public class Notify implements IAgentNotifySinkEx
00028 {
00029   IAgentEx      m_AgentEx = null;
00030   IAgentCharacterEx m_Character = null;
00031   int         m_RequestID[] = {-1};
00032   int         m_CommandID = -1;
00033
00034   private final int TRUE = 1;
00035   private final int MK_LBUTTON = 0x0001;
00036
00037   public Notify()
00038   {
00039     // Constructor left intentionally blank
00040   }
00041
00042   public void Initialize(IAgentEx agent,
00043                IAgentCharacterEx character,
00044                int commandID)
00045   {
00046     m_AgentEx = agent;
00047     m_Character = character;
00048     m_CommandID = commandID;
00049   }
00050
00051   public void Click(int characterID, short keys, int x, int y)
00052   {
00053     if ((m_Character != null) && ((keys & MK_LBUTTON) == MK_LBUTTON))
00054     {
00055       m_Character.Speak("You clicked on me with the left mouse button.", "", m_RequestID);
00056     }
00057   }
00058
00059   public void DblClick(int characterID, short keys, int x, int y)
00060   {
00061   }
00062
00063   public void Restart()
00064   {
00065   }
00066
00067   public void BookMark(int bookmarkID)
00068   {
00069   }
00070
00071   public void Shutdown()
00072   {
00073   }
00074
00075   public void DragStart(int characterID, short keys, int x, int y)
00076   {
00077   }
00078
00079   public void DragComplete(int characterID, short keys, int x, int y)
00080   {
00081   }
00082
00083   public void ActivateInputState(int characterID, int activated)
00084   {
00085   }
00086
00087   public void Command(int commandID, com.ms.com.IUnknown userInput)
00088   {
00089     if (commandID == m_CommandID)
00090     {
00091       m_AgentEx.ShowDefaultCharacterProperties((short)-1, (short)-1, TRUE);
00092     }
00093   }
00094
00095   public void RequestStart(int requestID)
00096   {
00097   }
00098
00099   public void RequestComplete(int requestID, int status)
00100   {
00101   }
00102
00103   public void VisibleState(int characterID, int visible, int cause)
00104   {
00105   }
00106
00107   public void Idle(int characterID, int start)
00108   {
00109   }
00110
00111   public void Move(int characterID, int x, int y, int cause)
00112   {
00113   }
00114
00115   public void Size(int characterID, int width, int height)
00116   {
00117   }
00118
00119   public void BalloonVisibleState(int characterID, int visible)
00120   {
00121   }
00122
00123   public void HelpComplete(int characterID, int commandID, int cause)
00124   {
00125   }
00126
00127   public void ListeningState(int characterID, int state, int cause)
00128   {
00129   }
00130
00131   public void DefaultCharacterChange(String guid)
00132   {
00133     if (m_Character != null)
00134     {
00135       m_Character.Speak("The character changed.", "", m_RequestID);
00136     }
00137   }
00138
00139   public void AgentPropertyChange()
00140   {
00141   }
00142
00143   public void ActiveClientChange(int characterID, int status)
00144   {
00145   }
00146 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRegAccess Member List

This is the complete list of members for CRegAccess, including all inherited members.
_hKey | CRegAccess | [private]
_wcsPath | CRegAccess | [private]
_wcsPathBuf | CRegAccess | [private]
CRegAccess(HKEY keyRelative, WCHAR const *pwcsRegPath) | CRegAccess |
Get(WCHAR const *pwcsValue, WCHAR *wcsVal, unsigned cc) | CRegAccess |
~CRegAccess() | CRegAccess |
Generated on Wed Nov 13 2024 16:57:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/Bag.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

Bag.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       bag.cxx
00006 //
00007 //  Contents:   Bag for Html parsing elements
00008 //
00009 //  Classes:    CHtmlElementBag
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <bag.hxx>
00017 #include <htmlelem.hxx>
00018
00019 //+-------------------------------------------------------------------------
00020 //
00021 //  Class:      CHtmlElemBagEntry::CHtmlElemBagEntry
00022 //
00023 //  Purpose:    Constructor
00024 //
00025 //--------------------------------------------------------------------------
00026
00027 CHtmlElemBagEntry::CHtmlElemBagEntry()
00028     : _pHtmlElement(0),
00029       _eTokType(GenericToken)
00030 {
00031 }
00032
00033
00034
00035 //+-------------------------------------------------------------------------
00036 //
00037 //  Class:      CHtmlElemBagEntry::~CHtmlElemBagEntry
00038 //
00039 //  Purpose:    Destructor
00040 //
00041 //--------------------------------------------------------------------------
00042
00043 CHtmlElemBagEntry::~CHtmlElemBagEntry()
00044 {
00045     delete _pHtmlElement;
00046 }
00047
00048
00049 //+-------------------------------------------------------------------------
00050 //
00051 //  Method:     CHtmlElementBag::CHtmlElementBag
00052 //
00053 //  Synopsis:   Constructor
00054 //
00055 //  Arguments:  [cElems]  -- Count of Html elements in bag
00056 //
00057 //--------------------------------------------------------------------------
00058
00059 CHtmlElementBag::CHtmlElementBag( unsigned cElems )
00060     : _uMaxSize(cElems),
00061       _uCurSize(0)
00062 {
00063     _aBagEntry = newk(mtNewX, NULL) CHtmlElemBagEntry[cElems];
00064 }
00065
00066
00067
00068 //+-------------------------------------------------------------------------
00069 //
00070 //  Method:     CHtmlElementBag::~CHtmlElementBag
00071 //
00072 //  Synopsis:   Destructor
00073 //
00074 //--------------------------------------------------------------------------
00075
00076 CHtmlElementBag::~CHtmlElementBag()
00077 {
00078     delete[] _aBagEntry;
00079 }
00080
00081
00082
00083 //+-------------------------------------------------------------------------
00084 //
00085 //  Method:     CHtmlElementBag::AddElement
00086 //
00087 //  Synopsis:   Add a new mapping the bag
00088 //
00089 //  Arguments:  [eHtmlToken]  -- token type
00090 //              [pHtmlElem] -- Html element corresponding to eHtmlToken
00091 //
00092 //--------------------------------------------------------------------------
00093
00094 void CHtmlElementBag::AddElement( HtmlTokenType eTokType,
00095                                   CHtmlElement *pHtmlElement )
00096 {
00097     Win4Assert( _uCurSize < _uMaxSize );
00098
00099     _aBagEntry[_uCurSize].SetTokenType( eTokType );
00100     _aBagEntry[_uCurSize].SetHtmlElement( pHtmlElement );
00101     _uCurSize++;
00102 }
00103
00104
00105
00106 //+-------------------------------------------------------------------------
00107 //
00108 //  Method:     CHtmlElementBag::QueryElement
00109 //
00110 //  Synopsis:   Retrieve the Html element corresponding to given token type
00111 //
00112 //  Arguments:  [eHtmlToken]  -- token type
00113 //
00114 //--------------------------------------------------------------------------
00115
00116 CHtmlElement *CHtmlElementBag::QueryElement( HtmlTokenType eTokType )
00117 {
00118     for (unsigned i=0; i<_uCurSize; i++)
00119     {
00120         if ( _aBagEntry[i].GetTokenType() == eTokType )
00121             return _aBagEntry[i].GetHtmlElement();
00122     }
00123
00124     htmlDebugOut(( DEB_ERROR,
00125                  "Unknown Html token type 0x%x in CHtmlElementBag::QueryElement\n",
00126                  eTokType ));
00127     Win4Assert( !"Cannot map Html token type" );
00128     return 0;
00129 }
00130
00131
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/DataGen.c Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen

DataGen.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1995 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     datagen.c
00008
00009 Abstract:
00010
00011     a file containing the constant data structures used by the Performance
00012     Monitor data for the Signal Generator Perf DLL
00013
00014     This file contains a set of constant data structures which are
00015     currently defined for the Signal Generator Perf DLL.
00016
00017 Created:
00018
00019     Bob Watson  28-Jul-1995
00020
00021 Revision History:
00022
00023     None.
00024
00025 --*/
00026 //
00027 //  Include Files
00028 //
00029
00030 #include <windows.h>
00031 #include <winperf.h>
00032 #include "genctrnm.h"
00033 #include "datagen.h"
00034
00035 // dummy variable for field sizing.
00036 static SIGGEN_COUNTER   sc;
00037
00038 //
00039 //  Constant structure initializations
00040 //      defined in datagen.h
00041 //
00042
00043 SIGGEN_DATA_DEFINITION SigGenDataDefinition = {
00044
00045     {sizeof(SIGGEN_DATA_DEFINITION) + sizeof(SIGGEN_COUNTER),
00046     sizeof(SIGGEN_DATA_DEFINITION),
00047     sizeof(PERF_OBJECT_TYPE),
00048     SIGGEN_OBJ,
00049     0,
00050     SIGGEN_OBJ,
00051     0,
00052     PERF_DETAIL_NOVICE,
00053     (sizeof(SIGGEN_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
00054         sizeof(PERF_COUNTER_DEFINITION),
00055     0   // assigned in Open Procedure
00056     PERF_NO_INSTANCES,
00057     0
00058     },
00059     {   sizeof(PERF_COUNTER_DEFINITION),
00060     SINE_WAVE,
00061     0,
00062     SINE_WAVE,
00063     0,
00064     0,
00065     PERF_DETAIL_NOVICE,
00066     PERF_COUNTER_RAWCOUNT,
00067     sizeof(sc.dwSineWaveValue),
00068     (DWORD_PTR)&(((PSIGGEN_COUNTER)0)->dwSineWaveValue)
00069     },
00070     {   sizeof(PERF_COUNTER_DEFINITION),
00071     TRIANGLE_WAVE,
00072     0,
00073     TRIANGLE_WAVE,
00074     0,
00075     0,
00076     PERF_DETAIL_NOVICE,
00077     PERF_COUNTER_RAWCOUNT,
00078     sizeof(sc.dwTriangleWaveValue),
00079     (DWORD_PTR)&(((PSIGGEN_COUNTER)0)->dwTriangleWaveValue)
00080     },
00081     {   sizeof(PERF_COUNTER_DEFINITION),
00082     SQUARE_WAVE,
00083     0,
00084     SQUARE_WAVE,
00085     0,
00086     0,
00087     PERF_DETAIL_NOVICE,
00088     PERF_COUNTER_RAWCOUNT,
00089     sizeof(sc.dwSquareWaveValue),
00090     (DWORD_PTR)&(((PSIGGEN_COUNTER)0)->dwSquareWaveValue)
00091     },
00092     {   sizeof(PERF_COUNTER_DEFINITION),
00093     CONSTANT_VALUE,
00094     0,
00095     CONSTANT_VALUE,
00096     0,
00097     0,
00098     PERF_DETAIL_NOVICE,
00099     PERF_COUNTER_RAWCOUNT,
00100     sizeof(sc.dwConstantValue),
00101     (DWORD_PTR)&(((PSIGGEN_COUNTER)0)->dwConstantValue)
00102     }
00103 };
00104 
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_MAZEDATA Member List

This is the complete list of members for _MAZEDATA, including all inherited members.
nMaze _MAZEDATA
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProvider Member List

This is the complete list of members for CProvider, including all inherited members.
CProvider(CListBox *pOutputList) | CProvider |
CProvider(CListBox *pOutputList) | CProvider |
FindConsumer(IWbemClassObject *pLogicalConsumer, IWbemUnboundObjectSink **ppConsumer) | CProvider |
FindConsumer(IWbemClassObject *pLogicalConsumer, IWbemUnboundObjectSink **ppConsumer) | CProvider |
Initialize(LPWSTR pszUser, LONG lFlags, LPWSTR pszNamespace, LPWSTR pszLocale, IWbemServices __RPC_FAR *pNamespace, IWbemContext __RPC_FAR *pCtx, IWbemProviderInitSink __RPC_FAR *pInitSink) | CProvider |
m_cRef | CProvider | [private]
m_pOutputList | CProvider | [private]
QueryInterface(REFIID, LPVOID *) | CProvider |
QueryInterface(REFIID, LPVOID *) | CProvider |
STDMETHODIMP_(ULONG) AddRef(void) | CProvider |
STDMETHODIMP_(ULONG) Release(void) | CProvider |
STDMETHODIMP_(ULONG) AddRef(void) | CProvider |
STDMETHODIMP_(ULONG) Release(void) | CProvider |
~CProvider() | CProvider |
~CProvider() | CProvider |
Generated on Wed Nov 13 2024 16:57:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/stdafx.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

stdafx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__B7418AD1_EBDA_4D87_A361_0CB1506C47A0__INCLUDED_)
00006 #define AFX_STDAFX_H__B7418AD1_EBDA_4D87_A361_0CB1506C47A0__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #define STRICT
00013 #ifndef _WIN32_WINNT
00014 #define _WIN32_WINNT 0x0400
00015 #endif
00016 #define _ATL_APARTMENT_THREADED
00017
00018 #include <atlbase.h>
00019 //You may derive a class from CComModule and use it if you want to override
00020 //something, but do not change the name of _Module
00021 extern CComModule _Module;
00022 #include <atlcom.h>
00023 #include <mtx.h>
00024 #define THROW_ERR(exp,str) {if (FAILED (hr = (exp))) {lErrFlag = 0; pErrMsg = _T(str); throw hr;}}
00025 #define THROW_STR(str) { hr = APP_ERROR; lErrFlag = 1; pErrMsg = str; throw hr;}
00026 #define RETHROW_ERR(exp) { if (FAILED(hr = (exp))) {lErrFlag = 2; throw hr;}}
00027 #define APP_ERROR 0x80004100
00028 #define SafeRelease(x) { if (x){x->Release();x=NULL;}}
00029
00030 #pragma warning( disable : 4146 )
00031 #pragma warning( disable : 4192 )
00032 #import "c:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "adoEOF")
00033 #pragma warning( default : 4192 )
00034 #pragma warning( default : 4146 )
00035
00036 #include <atlcom.h>
00037 #include <vector>
00038 #include <map>
00039
00040 #define ARRAY_VERSION 4     // version of the array (used for packet checking)
00041 #define COLLECTION_VERSION 4  // version of the collection (used for packet checking)
00042
00043 #include "limits.h"
00044 #include "string_fast.h"
00045
00046 #define WCSCPY wcscpy_fast
00047 //#define WCSCPY wcscpy
00048 #define WCSNCPY wcsncpy_fast
00049 //#define WCSNCMP wcsncmp
00050 #define WCSNCMP wcsncmp_fast
00051
00052 #define WCSCMP wcscmp_fast
00053
00054 #define SETCOMPLETE if (m_spObjectContext.p != NULL) m_spObjectContext->SetComplete();
00055 #define SETABORT if (m_spObjectContext.p != NULL) m_spObjectContext->SetAbort();
00056
00057 #include "heap.h"
00058 #include "string.h"
00059 #include "utils.h"
00060
00061 #include "MarshalHelpers.h"
00062 #include "StaticMap.h"
00063
00064 //{{AFX_INSERT_LOCATION}}
00065 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00066
00067 #endif // !defined(AFX_STDAFX_H__B7418AD1_EBDA_4D87_A361_0CB1506C47A0__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProvider_IWbemEventConsumerProvider Member List

This is the complete list of members for CProvider_IWbemEventConsumerProvider, including all inherited members.
CProvider_IWbemEventConsumerProvider() | CProvider_IWbemEventConsumerProvider |
FindConsumer(IWbemClassObject *a_LogicalConsumer, IWbemUnboundObjectSink **a_Consumer) | CProvider_IWbemEventConsumerProvider |
Initialize(LPWSTR a_User, LONG a_Flags, LPWSTR a_Namespace, LPWSTR a_Locale, IWbemServices *a_Core, IWbemContext *a_Context, IWbemProviderInitSink *a_Sink) | CProvider_IWbemEventConsumerProvider |
m_CoreService | CProvider_IWbemEventConsumerProvider | [private]
m_Locale | CProvider_IWbemEventConsumerProvider | [private]
m_Namespace | CProvider_IWbemEventConsumerProvider | [private]
m_ReferenceCount | CProvider_IWbemEventConsumerProvider | [private]
m_User | CProvider_IWbemEventConsumerProvider | [private]
QueryInterface(REFIID, LPVOID FAR *) | CProvider_IWbemEventConsumerProvider |
Shutdown(LONG a_Flags, ULONG a_MaxMilliSeconds, IWbemContext *a_Context) | CProvider_IWbemEventConsumerProvider |
STDMETHODIMP_(ULONG) AddRef() | CProvider_IWbemEventConsumerProvider |
STDMETHODIMP_(ULONG) Release() | CProvider_IWbemEventConsumerProvider |
~CProvider_IWbemEventConsumerProvider() | CProvider_IWbemEventConsumerProvider |
Generated on Wed Nov 13 2024 16:57:07 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/dynamic.h Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

dynamic.h

Go to the documentation of this file.
00001
00002 // Dynamic.h : Declaration of the CDynamic
00003
00004 #ifndef __DYNAMIC_H_
00005 #define __DYNAMIC_H_
00006
00007 #include "resource.h"       // main symbols
00008
00009 bool operator<(const CFastVariant l, const CFastVariant r);
00010 bool operator==(const CFastVariant l, const CFastVariant r);
00011
00012 //static CFastVariant vtMissing(VT_ERROR);
00013 typedef std::vector<CFastVariant, std::allocator<CFastVariant> > varvect;
00014
00015 typedef std::map<_bstr_t, long> bstr2long;
00016 typedef std::map<long, _bstr_t> long2bstr;
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CDynamic
00019 class ATL_NO_VTABLE CDynamic :
00020   public CComObjectRootEx<CComMultiThreadModel>,
00021   public CComCoClass<CDynamic, &CLSID_Dynamic>,
00022   public ISupportErrorInfo,
00023   public IMarshal,
00024   public IPersistStream,
00025   public IPersistStreamInit,
00026   public IDispatchImpl<IDynamic, &IID_IDynamic, &LIBID_DataServices>
00027 {
00028 public:
00029   CDynamic()
00030   {
00031     Clear();
00032   }
00033
00034   ~CDynamic()
00035   {
00036   }
00037
00038 DECLARE_REGISTRY_RESOURCEID(IDR_DYNAMIC)
00039 DECLARE_GET_CONTROLLING_UNKNOWN()
00040
00041 BEGIN_COM_MAP(CDynamic)
00042   COM_INTERFACE_ENTRY(IDynamic)
00043   COM_INTERFACE_ENTRY2(IDispatch, IDynamic)
00044   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00045   COM_INTERFACE_ENTRY(IMarshal)
00046   COM_INTERFACE_ENTRY(IPersistStreamInit)
00047   COM_INTERFACE_ENTRY2(IPersist, IPersistStream)
00048   COM_INTERFACE_ENTRY(IPersistStream)
00049 END_COM_MAP()
00050
00051 // ISupportsErrorInfo
00052   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00053
00054 // IDynamic
00055 public:
00056   STDMETHOD(_NewEnum)(/*[out, retval]*/ IUnknown** ppunk);
00057   STDMETHOD(Item)(VARIANT *pIndex, /*[out, retval]*/ VARIANT *pVal);
00058   STDMETHOD(Count)(/*[out, retval]*/ long *pVal);
00059   STDMETHOD(Add)(VARIANT *pItem, VARIANT *pKey = &vtMissing, VARIANT *pBefore = &vtMissing, VARIANT *pAfter = &vtMissing);
00060   STDMETHOD(Remove)(VARIANT *pIndex);
00061 // IMarshal (Actually we delegate to IPersistStream's implementation here)
00062   STDMETHOD(GetUnmarshalClass) (REFIID riid, void * pv, DWORD dwDestContext, void * pvDestContext, DWORD mshlFlags, CLSID* pCid )
00063   {
00064     *pCid = GetObjectCLSID();
00065     return S_OK;
00066   }
00067
00068   STDMETHOD(GetMarshalSizeMax) (REFIID riid, void * pv, DWORD dwDestContext, void * pvDestContext, DWORD mshlFlags, ULONG* pSize )
00069   {
00070     _ULARGE_INTEGER ul;
00071     HRESULT hr;
00072
00073     ul.LowPart = 0;
00074     ul.HighPart = 0;
00075     hr = GetSizeMax(&ul);
00076
00077     if (SUCCEEDED(hr))
00078       *pSize = ul.LowPart;
00079
00080     return hr;
00081   }
00082
00083   STDMETHOD(MarshalInterface)  (IStream* pStm, REFIID riid, void *pv, DWORD dwDestContext, void * pvDestContext, DWORD mshlFlags)
00084   {
00085     return Save(pStm, FALSE);
00086   }
00087
00088   STDMETHOD(UnmarshalInterface)(IStream* pStm, REFIID riid, void ** ppv )
00089   {
00090     HRESULT hr = Load(pStm);
00091
00092     if (SUCCEEDED(hr))
00093     {
00094       hr = QueryInterface(riid, ppv);
00095     }
00096     return hr;
00097   }
00098
00099   STDMETHOD (ReleaseMarshalData)(IStream *pStm)
00100   {
00101     // Nothing to do
00102     return E_NOTIMPL;
00103   }
00104
00105     STDMETHOD (DisconnectObject)( DWORD dwReserved)
00106   {
00107     // Proxy and Object are not connected -- nothing to do
00108     return E_NOTIMPL;
00109   }
00110
00111 // IPersistStreamInit
00112 // IPersistStream
00113 // IPersist
00114   STDMETHOD(GetClassID)(GUID * pClassID)
00115   {
00116     if (pClassID == NULL)
00117       return E_POINTER;
00118
00119     *pClassID = GetObjectCLSID();
00120
00121     return S_OK;
00122   }
00123
00124   STDMETHOD(IsDirty)()
00125   {
00126     HRESULT hr = S_FALSE;
00127
00128     if (m_bRequiresSave)
00129     {
00130       hr = S_OK;
00131     }
00132     return hr;
00133   }
00134
00135   STDMETHOD(Load)(IStream * pStm)
00136   {
00137     long nSize = 0, colCount = 0, n = 0, nVer = 0;
00138     HRESULT hr = S_OK;
00139
00140     hr = Count(&colCount);
00141
00142     *pStm >> (long)nVer; // version
00143
00144     if (nVer < COLLECTION_VERSION)
00145       return STG_E_OLDFORMAT;
00146
00147     *pStm >> colCount; // count
00148     *pStm >> m_bRequiresSave; // count
00149
00150     for (n = 1; (n <= colCount && SUCCEEDED(hr)); n++)
00151     {
00152       CFastVariant v;
00153       CFastVariant vKey;
00154
00155       *pStm >> vKey;
00156
00157       hr = v.ReadFromStream(pStm);
00158       if (SUCCEEDED(hr))
00159         hr = Add(&v, &vKey);
00160     }
00161
00162     return hr;
00163   }
00164
00165   STDMETHOD(Save)(IStream * pStm, int fClearDirty)
00166   {
00167     long nSize = 0, colCount = 0, n = 0;
00168     HRESULT hr = S_OK;
00169
00170     hr = Count(&colCount);
00171
00172     *pStm << (long)COLLECTION_VERSION; // version
00173     *pStm << colCount; // count
00174     *pStm << m_bRequiresSave; // save
00175
00176     for (n = 1; (n <= colCount && SUCCEEDED(hr)); n++)
00177     {
00178       CFastVariant v;
00179       CFastVariant item(n);
00180       CFastVariant vKey;
00181
00182       hr = Item(&item, &v);
00183       vKey = (LPCWSTR)m_MapIndex[n];
00184       *pStm << vKey;
00185
00186       hr = v.WriteToStream(pStm);
00187     }
00188
00189     if (fClearDirty)
00190       m_bRequiresSave = false;
00191
00192     return hr;
00193   }
00194
00195   STDMETHOD(GetSizeMax)(_ULARGE_INTEGER * pCbSize)
00196   {
00197     if (pCbSize == NULL)
00198       return E_POINTER;
00199
00200     long nSize = 0, colCount = 0, n = 0;
00201     HRESULT hr = S_OK;
00202     VARIANT vItem;
00203
00204     hr = Count(&colCount);
00205
00206     nSize += sizeof((long)COLLECTION_VERSION); // version
00207     nSize += sizeof(colCount); // count
00208     nSize += sizeof(m_bRequiresSave); // save
00209
00210     for (n = 1; n <= colCount; n++)
00211     {
00212       CFastVariant item(n);
00213       CFastVariant vKey((BSTR)m_MapIndex[n]);
00214
00215       nSize += GetVariantSize(vKey);
00216
00217       hr = Item(&item, &vItem);
00218       nSize += GetVariantSize(vItem);
00219       VariantClear(&vItem);
00220     }
00221     pCbSize->LowPart = nSize;
00222     return hr;
00223   }
00224
00225   STDMETHOD(InitNew)()
00226   {
00227     long n;
00228     long count;
00229     HRESULT hr = S_OK;
00230
00231     hr = Count(&count);
00232     if (SUCCEEDED(hr))
00233     {
00234       for (n=0;(n < count && SUCCEEDED(hr)); n++)
00235       {
00236         _variant_t vIndex(n);
00237         hr = Remove(&vIndex);
00238       }
00239       m_bRequiresSave = false;
00240     }
00241     return hr;
00242   }
00243
00244 private:
00245 // Data:
00246   varvect m_VarVect;
00247   bstr2long m_IndexMap;
00248   long2bstr m_MapIndex;
00249   bool m_bRequiresSave;
00250   int m_nGrow;
00251   int m_nReserve;
00252
00253 // Methods:
00254   void Clear();
00255 };
00256
00257 #endif //__DYNAMIC_H_
Generated on Wed Nov 13 2024 16:52:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/XForm.h Source File

  • Multimedia
  • Gdi
  • GdiDemo

XForm.h

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012
00013 #ifdef WIN16
00014 #define APIENTRY FAR PASCAL
00015 typedef WORD WPARAM;
00016 //#else
00017 //typedef DWORD WPARAM;
00018 #endif
00019
00020
00021 #define XFORMCLASS "XFORMDEMO"
00022
00023 typedef struct _XFORMDATA
00024 {
00025 #ifndef NOT_IMPLEMENTED
00026     XFORM xForm;
00027 #endif
00028     POINT pObject[4];
00029     int   nObject;
00030 } XFORMDATA;
00031 typedef XFORMDATA      *PXFORMDATA;
00032 typedef XFORMDATA NEAR *NPXFORMDATA;
00033 typedef XFORMDATA FAR  *LPXFORMDATA;
00034
00035
00036 /*
00037 ** XFORM WINDOW ROUTINES (xform.c)
00038 */
00039 HWND  FAR      CreateXFormWindow(HWND,int);
00040 LRESULT  CALLBACK XFormProc(HWND,UINT,WPARAM,LPARAM);
00041 BOOL           XFormCreateProc(HWND);
00042 VOID           XFormDestroyProc(HWND);
00043 BOOL           XFormCommandProc(HWND,WPARAM,LPARAM);
00044 VOID           XFormPaintProc(HWND);
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/SimpleClient/WbemClientDlg.h Source File

  • SysMgmt
  • WMI
  • VC
  • SimpleClient

WbemClientDlg.h

Go to the documentation of this file.
00001 // WbemClientDlg.h : header file
00002
00003
00004
00005 //
00006
00007
00008
00009 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00010
00011
00012
00013 #if !defined(AFX_WBEMCLIENTDLG_H__4C1DEDF9_F003_11D1_BDD8_00C04F8F8B8D__INCLUDED_)
00014
00015 #define AFX_WBEMCLIENTDLG_H__4C1DEDF9_F003_11D1_BDD8_00C04F8F8B8D__INCLUDED_
00016
00017
00018
00019 #if _MSC_VER >= 1000
00020
00021 #pragma once
00022
00023 #endif // _MSC_VER >= 1000
00024
00025
00026
00027 #include "wbemcli.h"     // WMI interface declarations
00028
00029
00030
00031 class CWbemClientDlgAutoProxy;
00032
00033
00034
00035 /////////////////////////////////////////////////////////////////////////////
00036
00037 // CWbemClientDlg dialog
00038
00039
00040
00041 class CWbemClientDlg : public CDialog
00042
00043 {
00044
00045 // Construction
00046
00047 public:
00048
00049   CWbemClientDlg(CWnd* pParent = NULL); // standard constructor
00050   ~CWbemClientDlg();
00051
00052
00053
00054 // Dialog Data
00055
00056   //{{AFX_DATA(CWbemClientDlg)
00057
00058   enum { IDD = IDD_WBEMCLIENT_DIALOG };
00059
00060   CButton m_diskInfo;
00061
00062   CButton m_enumDisks;
00063
00064   CListBox  m_outputList;
00065
00066   CString m_namespace;
00067
00068   //}}AFX_DATA
00069
00070
00071
00072   // ClassWizard generated virtual function overrides
00073
00074   //{{AFX_VIRTUAL(CWbemClientDlg)
00075
00076   protected:
00077
00078   virtual void DoDataExchange(CDataExchange* pDX);  // DDX/DDV support
00079
00080   //}}AFX_VIRTUAL
00081
00082
00083
00084 private:
00085
00086   IWbemServices *m_pIWbemServices;
00087
00088   IWbemServices *m_pOfficeService;
00089
00090
00091
00092 // Implementation
00093
00094 protected:
00095
00096   HICON m_hIcon;
00097
00098
00099
00100   // Generated message map functions
00101
00102   //{{AFX_MSG(CWbemClientDlg)
00103
00104   virtual BOOL OnInitDialog();
00105
00106   afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
00107
00108   afx_msg void OnPaint();
00109
00110   afx_msg HCURSOR OnQueryDragIcon();
00111
00112   afx_msg void OnConnect();
00113
00114   afx_msg void OnEnumdisks();
00115
00116   afx_msg void OnMakeoffice();
00117
00118   afx_msg void OnDiskinfo();
00119
00120   //}}AFX_MSG
00121
00122   DECLARE_MESSAGE_MAP()
00123
00124 };
00125
00126
00127
00128 //{{AFX_INSERT_LOCATION}}
00129
00130 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00131
00132
00133
00134 #endif // !defined(AFX_WBEMCLIENTDLG_H__4C1DEDF9_F003_11D1_BDD8_00C04F8F8B8D__INCLUDED_)
00135
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/CClusterUtils.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

CClusterUtils.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      CClusterUtils.cpp
00005 //
00006 //  Description:
00007 //      This file contains the implementation of the CClusterUtils class.
00008 //
00009 //  Header File:
00010 //      CClusterUtils.h
00011 //
00012 //////////////////////////////////////////////////////////////////////////////
00013
00014 //////////////////////////////////////////////////////////////////////////////
00015 // Include Files
00016 //////////////////////////////////////////////////////////////////////////////
00017
00018 #include "stdafx.h"
00019 #include "CClusterUtils.h"
00020
00021
00022 //////////////////////////////////////////////////////////////////////////////
00023 // CClusterUtils class
00024 //////////////////////////////////////////////////////////////////////////////
00025
00026
00027 //////////////////////////////////////////////////////////////////////////////
00028 //++
00029 //
00030 //  CClusterUtils::HrIsGroupOwnedByThisNode
00031 //
00032 //  Description:
00033 //      Is the cluster group hGroupIn owned by node bstrNodeNameIn?
00034 //
00035 //  Arguments:
00036 //      hGroupIn
00037 //          A handle to a cluster group.
00038 //
00039 //      bstrNodeNameIn
00040 //          Node name to compare against the group's owning node name.
00041 //
00042 //  Return Value:
00043 //      S_OK
00044 //          The group is owned by the node.
00045 //
00046 //      S_FALSE
00047 //          The group is not owned by the node.
00048 //
00049 //      Other
00050 //          An error occurred.
00051 //
00052 //  Remarks:
00053 //      None.
00054 //
00055 //--
00056 //////////////////////////////////////////////////////////////////////////////
00057 HRESULT
00058 CClusterUtils::HrIsGroupOwnedByThisNode(
00059       HGROUP  hGroupIn
00060     , BSTR    bstrNodeNameIn
00061     )
00062 {
00063     assert( hGroupIn != NULL );
00064     assert( bstrNodeNameIn != NULL );
00065
00066     HRESULT             hr = S_OK;
00067     DWORD               sc = ERROR_SUCCESS;
00068     WCHAR *             pwszNodeName = NULL;
00069     DWORD               cchNodeName = 33;
00070     CLUSTER_GROUP_STATE cgs;
00071
00072     pwszNodeName = new WCHAR[ cchNodeName ];
00073     if ( pwszNodeName == NULL )
00074     {
00075         hr = E_OUTOFMEMORY;
00076         goto Cleanup;
00077     } // if:
00078
00079     cgs = GetClusterGroupState( hGroupIn, pwszNodeName, &cchNodeName );
00080     sc = GetLastError();
00081     if ( sc == ERROR_MORE_DATA )
00082     {
00083         delete [] pwszNodeName;
00084         pwszNodeName = NULL;
00085         cchNodeName++;
00086
00087         pwszNodeName = new WCHAR[ cchNodeName ];
00088         if ( pwszNodeName == NULL )
00089         {
00090             hr = E_OUTOFMEMORY;
00091             goto Cleanup;
00092         } // if:
00093
00094         cgs = GetClusterGroupState( hGroupIn, pwszNodeName, &cchNodeName );
00095     } // if: the pwszNodeName buffer wasn't big enough
00096
00097     if ( cgs == ClusterGroupStateUnknown )
00098     {
00099         sc = GetLastError();
00100         hr = HRESULT_FROM_WIN32( sc );
00101         goto Cleanup;
00102     } // if: GetClusterGroupState failed
00103
00104     if ( NIStringCompareW(
00105                   bstrNodeNameIn
00106                 , SysStringLen( bstrNodeNameIn )
00107                 , pwszNodeName
00108                 , cchNodeName
00109                 )
00110          == 0
00111        )
00112     {
00113         hr = S_OK;
00114     } // if: Node names match so this group is owned by that node.
00115     else
00116     {
00117         hr = S_FALSE;
00118     } // else: Node names do not match and the group is owned by another node.
00119
00120 Cleanup:
00121
00122     delete [] pwszNodeName;
00123
00124     return hr;
00125
00126 } //*** CClusterUtils::HrIsGroupOwnedByThisNode
00127
00128
00129 //////////////////////////////////////////////////////////////////////////////
00130 //++
00131 //
00132 //  CClusterUtils:HrIsNodeClustered
00133 //
00134 //  Description:
00135 //      Is this node a member of a cluster?
00136 //
00137 //  Arguments:
00138 //      None.
00139 //
00140 //  Return Value:
00141 //      S_OK
00142 //          The node is clustered.
00143 //
00144 //      S_FALSE
00145 //          The node is NOT clustered.
00146 //
00147 //      Other
00148 //          An error occurred.
00149 //
00150 //--
00151 //////////////////////////////////////////////////////////////////////////////
00152 HRESULT
00153 CClusterUtils::HrIsNodeClustered( void )
00154 {
00155     HRESULT hr = S_FALSE;
00156     DWORD   sc = ERROR_SUCCESS;
00157     DWORD   dwClusterState;
00158
00159     //
00160     // Get the cluster state of the local node.
00161     // Ignore the case where the service does not exist so that
00162     // EvictCleanup can do its job.
00163     //
00164
00165     sc = GetNodeClusterState( NULL, &dwClusterState );
00166     if ( ( sc != ERROR_SUCCESS ) && ( sc != ERROR_SERVICE_DOES_NOT_EXIST ) )
00167     {
00168         hr = HRESULT_FROM_WIN32( sc );
00169         goto Cleanup;
00170     } // if : GetNodeClusterState failed
00171
00172     if ( ( dwClusterState == ClusterStateRunning ) || ( dwClusterState == ClusterStateNotRunning ) )
00173     {
00174         hr = S_OK;
00175     } // if:
00176
00177 Cleanup:
00178
00179     return hr;
00180
00181 } //*** CClusterUtils::HrIsNodeClustered
00182
00183
00184 //////////////////////////////////////////////////////////////////////////////
00185 //++
00186 //
00187 //  CClusterUtils:HrEnumNodeResources
00188 //
00189 //  Description:
00190 //      Enumerate the resources owned by this node.
00191 //
00192 //  Arguments:
00193 //      bstrNodeNameIn
00194 //          aa
00195 //
00196 //  Return Value:
00197 //      S_OK
00198 //          Success.
00199 //
00200 //      Other
00201 //          An error occurred.
00202 //
00203 //  Remarks:
00204 //      None.
00205 //
00206 //--
00207 //////////////////////////////////////////////////////////////////////////////
00208 HRESULT
00209 CClusterUtils::HrEnumNodeResources(
00210     BSTR bstrNodeNameIn
00211     )
00212 {
00213     assert( bstrNodeNameIn != NULL );
00214
00215     HRESULT     hr = S_FALSE;
00216     DWORD       sc = ERROR_SUCCESS;
00217     DWORD       idx = 0;
00218     HCLUSTER    hCluster = NULL;
00219     HCLUSENUM   hEnum = NULL;
00220     DWORD       dwType;
00221     WCHAR *     pwszGroupName = NULL;
00222     DWORD       cchGroupName = 33;
00223     HGROUP      hGroup = NULL;
00224
00225     hCluster = OpenCluster( NULL );
00226     if ( hCluster == NULL )
00227     {
00228         sc = GetLastError();
00229         hr = HRESULT_FROM_WIN32( sc );
00230         goto Cleanup;
00231     } // if:
00232
00233     hEnum = ClusterOpenEnum( hCluster, CLUSTER_ENUM_GROUP );
00234     if ( hEnum == NULL )
00235     {
00236         sc = GetLastError();
00237         hr = HRESULT_FROM_WIN32( sc );
00238         goto Cleanup;
00239     } // if:
00240
00241     pwszGroupName = new WCHAR[ cchGroupName ];
00242     if ( pwszGroupName == NULL )
00243     {
00244         hr = E_OUTOFMEMORY;
00245         goto Cleanup;
00246     } // if:
00247
00248     for ( idx = 0; ; )
00249     {
00250         sc = ClusterEnum( hEnum, idx, &dwType, pwszGroupName, &cchGroupName );
00251         if ( sc == ERROR_SUCCESS )
00252         {
00253             //
00254             // Process the current group.  See if it is owned by this
00255             // node and if so load its resources.
00256             //
00257             hGroup = OpenClusterGroup( hCluster, pwszGroupName );
00258             if ( hGroup == NULL )
00259             {
00260                 sc = GetLastError();
00261                 hr = HRESULT_FROM_WIN32( sc );
00262                 goto Cleanup;
00263             } // if:
00264
00265             hr = HrIsGroupOwnedByThisNode( hGroup, bstrNodeNameIn );
00266             if ( FAILED( hr ) )
00267             {
00268                 goto Cleanup;
00269             } // if:
00270
00271             if ( hr == S_OK )
00272             {
00273                 hr = HrLoadGroupResources( hCluster, hGroup );
00274                 if ( FAILED( hr ) )
00275                 {
00276                     goto Cleanup;
00277                 } // if:
00278             } // if:
00279
00280             CloseClusterGroup( hGroup );
00281             hGroup = NULL;
00282
00283             idx++;
00284             continue;
00285         } // if: ClusterEnum succeeded
00286
00287         if ( sc == ERROR_MORE_DATA )
00288         {
00289             //
00290             // Allocate a bigger buffer and try again.
00291             //
00292             delete [] pwszGroupName;
00293             pwszGroupName = NULL;
00294             cchGroupName++;
00295
00296             pwszGroupName = new WCHAR[ cchGroupName ];
00297             if ( pwszGroupName == NULL )
00298             {
00299                 hr = E_OUTOFMEMORY;
00300                 goto Cleanup;
00301             } // if:
00302
00303             continue;
00304         } // if: pwszGroupName wasn't big enough
00305
00306         if ( sc == ERROR_NO_MORE_ITEMS )
00307         {
00308             //
00309             // Enum is complete.
00310             //
00311             hr = S_OK;
00312             break;
00313         } // if:
00314
00315         hr = HRESULT_FROM_WIN32( sc );
00316         break;
00317     } // for: each group in the enum
00318
00319 Cleanup:
00320
00321     if ( hGroup != NULL )
00322     {
00323         CloseClusterGroup( hGroup );
00324     } // if:
00325
00326     if ( hEnum != NULL )
00327     {
00328         ClusterCloseEnum( hEnum );
00329     } // if:
00330
00331     if ( hCluster != NULL )
00332     {
00333         CloseCluster( hCluster );
00334     } // if:
00335
00336     delete [] pwszGroupName;
00337
00338     return hr;
00339
00340 } //*** CClusterUtils::HrEnumNodeResources
00341
00342
00343 //////////////////////////////////////////////////////////////////////////////
00344 //++
00345 //
00346 //  CClusterUtils::HrLoadGroupResources
00347 //
00348 //  Description:
00349 //      For each resource in the group pass its handle to HrNodeResourceCallback.
00350 //
00351 //  Arguments:
00352 //      hClusterIn
00353 //          Handle to the cluster.
00354 //
00355 //      hGroupIn
00356 //          Handle to the group whose resources we're enumerating.
00357 //
00358 //  Return Value:
00359 //      S_OK
00360 //          Success.
00361 //
00362 //      Other
00363 //          An error occurred.
00364 //
00365 //  Remarks:
00366 //      None.
00367 //
00368 //--
00369 //////////////////////////////////////////////////////////////////////////////
00370 HRESULT
00371 CClusterUtils::HrLoadGroupResources(
00372       HCLUSTER    hClusterIn
00373     , HGROUP      hGroupIn
00374     )
00375 {
00376     assert( hClusterIn != NULL );
00377     assert( hGroupIn != NULL );
00378
00379     HRESULT     hr = S_OK;
00380     DWORD       sc = ERROR_SUCCESS;
00381     HGROUPENUM  hEnum = NULL;
00382     WCHAR *     pwszResourceName = NULL;
00383     DWORD       cchResourceName = 33;
00384     DWORD       dwType;
00385     DWORD       idx = 0;
00386     HRESOURCE   hResource = NULL;
00387
00388     hEnum = ClusterGroupOpenEnum( hGroupIn, CLUSTER_GROUP_ENUM_CONTAINS );
00389     if ( hEnum == NULL )
00390     {
00391         sc = GetLastError();
00392         hr = HRESULT_FROM_WIN32( sc );
00393         goto Cleanup;
00394     } // if:
00395
00396     pwszResourceName = new WCHAR[ cchResourceName ];
00397     if ( pwszResourceName == NULL )
00398     {
00399         hr = E_OUTOFMEMORY;
00400         goto Cleanup;
00401     } // if:
00402
00403     for ( idx = 0; ; )
00404     {
00405         sc = ClusterGroupEnum( hEnum, idx, &dwType, pwszResourceName, &cchResourceName );
00406         if ( sc == ERROR_SUCCESS )
00407         {
00408             //
00409             // Process the current resource.  Open it and pass a handle
00410             // to HrNodeResourceCallback for further processing.
00411             //
00412             hResource = OpenClusterResource( hClusterIn, pwszResourceName );
00413             if ( hResource == NULL )
00414             {
00415                 sc = GetLastError();
00416                 hr = HRESULT_FROM_WIN32( sc );
00417                 goto Cleanup;
00418             } // if:
00419
00420             hr = HrNodeResourceCallback( hResource );
00421             if ( FAILED( hr ) )
00422             {
00423                 goto Cleanup;
00424             } // if:
00425
00426             CloseClusterResource( hResource );
00427             hResource = NULL;
00428
00429             idx++;
00430             continue;
00431         } // if:
00432
00433         if ( sc == ERROR_MORE_DATA )
00434         {
00435             //
00436             // Allocate a bigger buffer and try again.
00437             //
00438             delete [] pwszResourceName;
00439             pwszResourceName = NULL;
00440             cchResourceName++;
00441
00442             pwszResourceName = new WCHAR[ cchResourceName ];
00443             if ( pwszResourceName == NULL )
00444             {
00445                 hr = E_OUTOFMEMORY;
00446                 goto Cleanup;
00447             } // if:
00448
00449             continue;
00450         } // if:
00451
00452         if ( sc == ERROR_NO_MORE_ITEMS )
00453         {
00454             //
00455             // Enum is complete.
00456             //
00457             hr = S_OK;
00458             break;
00459         } // if:
00460
00461         hr = HRESULT_FROM_WIN32( sc );
00462         break;
00463     } // for:
00464
00465 Cleanup:
00466
00467     if ( hResource != NULL )
00468     {
00469         CloseClusterResource( hResource );
00470     } // if:
00471
00472     if ( hEnum != NULL )
00473     {
00474         ClusterGroupCloseEnum( hEnum );
00475     } // if:
00476
00477     delete [] pwszResourceName;
00478
00479     return hr;
00480
00481 } //*** CClusterUtils::HrLoadGroupResources
00482
00483
00484 //////////////////////////////////////////////////////////////////////////////
00485 //++
00486 //
00487 //  CClusterUtils:HrGetQuorumResourceName
00488 //
00489 //  Description:
00490 //      Retrieve the quorum resource's name.
00491 //
00492 //  Arguments:
00493 //      pbstrQuorumResourceNameOut
00494 //          Pointer to receive the allocated BSTR containing the quorum resource name.
00495 //
00496 //  Return Value:
00497 //      S_OK
00498 //          Success.
00499 //
00500 //      Other
00501 //          An error occurred.
00502 //
00503 //  Remarks:
00504 //      None.
00505 //
00506 //--
00507 //////////////////////////////////////////////////////////////////////////////
00508 HRESULT
00509 CClusterUtils::HrGetQuorumResourceName(
00510     BSTR * pbstrQuorumResourceNameOut
00511     )
00512 {
00513     assert( pbstrQuorumResourceNameOut != NULL );
00514
00515     HRESULT     hr = S_OK;
00516     HCLUSTER    hCluster = NULL;
00517     DWORD       sc = ERROR_SUCCESS;
00518     WCHAR *     pwszResourceName = NULL;
00519     DWORD       cchResourceName = 33;
00520     WCHAR *     pwszDeviceName = NULL;
00521     DWORD       cchDeviceName = 33;
00522     DWORD       cbQuorumLog;
00523
00524     hCluster = OpenCluster( NULL );
00525     if ( hCluster == NULL )
00526     {
00527         sc = GetLastError();
00528         hr = HRESULT_FROM_WIN32( sc );
00529         goto Cleanup;
00530     } // if:
00531
00532     pwszResourceName = new WCHAR[ cchResourceName ];
00533     if ( pwszResourceName == NULL )
00534     {
00535         hr = E_OUTOFMEMORY;
00536         goto Cleanup;
00537     } // if:
00538
00539     pwszDeviceName = new WCHAR[ cchDeviceName ];
00540     if ( pwszDeviceName == NULL )
00541     {
00542         hr = E_OUTOFMEMORY;
00543         goto Cleanup;
00544     } // if:
00545
00546     //
00547     // Try to get the quorum resource name.  We need to pass in the device name
00548     // buffer as well or the call will fail.
00549     //
00550     sc = GetClusterQuorumResource(
00551               hCluster
00552             , pwszResourceName
00553             , &cchResourceName
00554             , pwszDeviceName
00555             , &cchDeviceName
00556             , &cbQuorumLog
00557             );
00558     if ( sc == ERROR_MORE_DATA )
00559     {
00560         //
00561         //  At least one of the buffers wasn't big enough.  Reallocate and try again.
00562         //
00563         delete [] pwszResourceName;
00564         pwszResourceName = NULL;
00565         cchResourceName++;
00566
00567         delete [] pwszDeviceName;
00568         pwszDeviceName = NULL;
00569         cchDeviceName++;
00570
00571         pwszResourceName = new WCHAR[ cchResourceName ];
00572         if ( pwszResourceName == NULL )
00573         {
00574             hr = E_OUTOFMEMORY;
00575             goto Cleanup;
00576         } // if:
00577
00578         pwszDeviceName = new WCHAR[ cchDeviceName ];
00579         if ( pwszDeviceName == NULL )
00580         {
00581             hr = E_OUTOFMEMORY;
00582             goto Cleanup;
00583         } // if:
00584
00585         sc = GetClusterQuorumResource(
00586                   hCluster
00587                 , pwszResourceName
00588                 , &cchResourceName
00589                 , pwszDeviceName
00590                 , &cchDeviceName
00591                 , &cbQuorumLog
00592                 );
00593     } // if:
00594
00595     if ( sc == ERROR_SUCCESS )
00596     {
00597         //
00598         // Allocate a BSTR and copy the WCHAR string into it.
00599         //
00600         *pbstrQuorumResourceNameOut = SysAllocString( pwszResourceName );
00601         if ( *pbstrQuorumResourceNameOut == NULL )
00602         {
00603             hr = E_OUTOFMEMORY;
00604             goto Cleanup;
00605         } // if:
00606     } // if: GetClusterQuorumResource succeeded.
00607     else
00608     {
00609         hr = HRESULT_FROM_WIN32( sc );
00610         goto Cleanup;
00611     } // else: GetClusterQuorumResource failed.
00612
00613     hr = S_OK;
00614
00615 Cleanup:
00616
00617     if ( hCluster != NULL )
00618     {
00619         CloseCluster( hCluster );
00620     } // if:
00621
00622     delete [] pwszResourceName;
00623     delete [] pwszDeviceName;
00624
00625     return hr;
00626
00627 } //*** CClusterUtils::HrGetQuorumResourceName
00628
00629
00630 //////////////////////////////////////////////////////////////////////////////
00631 //++
00632 //
00633 //  CClusterUtils::HrIsClusterServiceRunning
00634 //
00635 //  Description:
00636 //      Is this node a member of a cluster and is the serice running?
00637 //
00638 //  Arguments:
00639 //      None.
00640 //
00641 //  Return Value:
00642 //      S_OK
00643 //          The node is clustered and the serivce is running.
00644 //
00645 //      S_FALSE
00646 //          The node is not clustered, or the serivce is not running.
00647 //
00648 //      Other
00649 //          An error occurred.
00650 //
00651 //  Remarks:
00652 //      None.
00653 //
00654 //--
00655 //////////////////////////////////////////////////////////////////////////////
00656 HRESULT
00657 CClusterUtils::HrIsClusterServiceRunning( void )
00658 {
00659     HRESULT hr = S_FALSE;
00660     DWORD   sc = ERROR_SUCCESS;
00661     DWORD   dwClusterState;
00662
00663     //
00664     // Get the cluster state of the node.
00665     // Ignore the case where the service does not exist so that
00666     // EvictCleanup can do its job.
00667     //
00668
00669     sc = GetNodeClusterState( NULL, &dwClusterState );
00670     if ( ( sc != ERROR_SUCCESS ) && ( sc != ERROR_SERVICE_DOES_NOT_EXIST ) )
00671     {
00672         hr = HRESULT_FROM_WIN32( sc );
00673         goto Cleanup;
00674     } // if : GetClusterState() failed
00675
00676     if ( dwClusterState == ClusterStateRunning )
00677     {
00678         hr = S_OK;
00679     } // if:
00680
00681 Cleanup:
00682
00683     return hr;
00684
00685 } //*** CClusterUtils::HrIsClusterServiceRunning
00686
00687
00688 //////////////////////////////////////////////////////////////////////////////
00689 //++
00690 //
00691 //  CClusterUtils::HrIsCoreResource
00692 //
00693 //  Description:
00694 //      Determines whether the resource is a core resource.
00695 //
00696 //  Arguments:
00697 //      hResourceIn
00698 //          Handle of the resource to test.
00699 //
00700 //  Return Value:
00701 //      S_OK
00702 //          Resource is a core resource.
00703 //
00704 //      S_FALSE
00705 //          Resource is not a core resource.
00706 //
00707 //      Other
00708 //          An error occurred.
00709 //
00710 //--
00711 //////////////////////////////////////////////////////////////////////////////
00712 HRESULT
00713 CClusterUtils::HrIsCoreResource(
00714     HRESOURCE hResourceIn
00715     )
00716 {
00717     assert( hResourceIn != NULL );
00718
00719     HRESULT hr = S_FALSE;
00720     DWORD   sc = ERROR_SUCCESS;
00721     DWORD   dwFlags = 0;
00722     DWORD   cb = 0;
00723
00724     //
00725     // If the resource has the CLUS_FLAG_CORE flag set then it is a core resource.
00726     //
00727     sc = ClusterResourceControl(
00728               hResourceIn
00729             , NULL
00730             , CLUSCTL_RESOURCE_GET_FLAGS
00731             , NULL
00732             , 0
00733             , &dwFlags
00734             , sizeof( dwFlags )
00735             , &cb
00736             );
00737     if ( sc != ERROR_SUCCESS )
00738     {
00739         hr = HRESULT_FROM_WIN32( sc );
00740         goto Cleanup;
00741     } // if:
00742
00743     if ( dwFlags & CLUS_FLAG_CORE )
00744     {
00745         hr = S_OK;
00746     } // if:
00747
00748 Cleanup:
00749
00750     return hr;
00751
00752 } //*** CClusterUtils::HrIsCoreResource
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinCap32/WinCap.c Source File

  • Multimedia
  • Gdi
  • WinCap32

WinCap.c

Go to the documentation of this file.
00001 //***********************************************************************
00002 //
00003 // Wincap.c
00004 //
00005 // Windows Screen Capture Utility
00006 // Version 3.20
00007 //
00008 // Description:
00009 // ------------
00010 //
00011 // Captures portions of the screen, specific windows, or the entire screen
00012 // and saves it to a file or prints it.  Uses DIBAPI functions to do most
00013 // of the capture/printing/saving work.  See the file DIBAPI.TXT for a
00014 // description of the DIB api functions.
00015 //
00016 // Changes from first version:
00017 //
00018 // - Updated to use 3.1 Common Dialogs and 3.1 hook functions
00019 // - New user interface displays window which was captured in client
00020 //      area of Wincap, complete with scroll bars
00021 // - Hot new hotkeys allow more versatile capturing of windows (e.g. you
00022 //      can now capture windows with menu items pulled down)
00023 // - New APIs to draw bitmaps and DIBs on the screen
00024 // - Nifty startup bitmap
00025 // - All DIB API functions are now in a DLL, which can be used
00026 //      by any application
00027 //
00028 // Changes from version 3.1 to 3.2:
00029 // - Window selection changed due to how SetCapture works under Win32
00030 // - The window to be selected for capture is highlighted as the cursor is moved
00031 // - Option to copy DIB, DDB, and Palette to the clipboard
00032 //
00033 // Written by Microsoft Product Support Services, Developer Support.
00034 // Copyright 1991 - 2000 Microsoft Corporation. All rights reserved.
00035 //***********************************************************************
00036
00037 #define STRICT
00038 #include <windows.h>
00039 #include <stdio.h>
00040 #include <string.h>
00041 #include "commdlg.h"
00042 #include "wincap.h"
00043 #include "resource.h"
00044 #include "dialogs.h"
00045 #include "dibapi.h"
00046
00047 char szAppName[20];     // Name of application - used in dialog boxes
00048
00049 // Global variables
00050
00051 HINSTANCE   ghInst;             // Handle to instance
00052 HWND        ghWndMain;          // Handle to main window
00053
00054 HOOKPROC    lpfnKeyHook;        // Used in keyboard hook
00055 HOOKPROC    lpfnOldHook;        // Used for keyboard hook
00056 HWND        hModelessDlg;       // Handle to modeless "Saving to file..."
00057                                 // dialog box
00058
00059 BOOL        bStartup=TRUE;      // Startup flag for WM_PAINT/logo
00060 BOOL        bViewFull=FALSE;    // Full view flag
00061 HBITMAP     ghbmLogo;           // Handle to logo bitmap
00062 HBITMAP     ghBitmap=NULL;      // Handle to captured bitmap
00063 HPALETTE    ghPal=NULL;         // Handle to our bitmap's palette
00064 char        gszWindowText[100]; // Text which tells what we captured
00065
00066 BOOL        gbLButtonDown=FALSE;
00067 BOOL        gbSave = FALSE;
00068 HWND        ghWndCapture=NULL;
00069 BOOL        gbNowCapturing = FALSE;
00070 BOOL        gbCaptRect = FALSE;
00071 HWND        hSelectDlg;         // help dialog for window selection
00072 HWND        hRectangleDlg;      // help dialog for rectangle selection
00073 UINT        guiFileOKMsg;       // for common dialog FILEOKSTRING
00074
00075 #define WM_DOCAPTURE WM_USER+101 // Used for screen capture messages
00076
00077 // Macro to swap two values
00078
00079 #define SWAP(x,y)   ((x)^=(y)^=(x)^=(y))
00080 #define SCROLL_RATIO    4
00081
00082 BOOL CenterWindow (HWND hwndChild, HWND hwndParent);
00083
00084 //************************************************************************
00085 //
00086 // WinMain()
00087 //
00088 // Entry point of the Application.
00089 //
00090 //************************************************************************
00091
00092 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine,
00093         int nCmdShow)
00094 {
00095     MSG msg;
00096     WNDCLASS wndclass;
00097     HWND hWnd;
00098   CHAR lpBuffer[256];
00099
00100     strncpy(szAppName, "WinCap", 7);     // Name of our App
00101   szAppName[6] = '\0';
00102
00103     hModelessDlg = NULL;             // Set handle to modeless dialog to NULL
00104                                      // because we haven't created it yet
00105
00106     hSelectDlg = hRectangleDlg = NULL;
00107
00108   LoadString(ghInst, IDS_MAINWINDOWTITLE, lpBuffer, sizeof(lpBuffer));
00109     if (!FindWindow(szAppName, lpBuffer))
00110     {
00111         wndclass.style = 0;
00112         wndclass.lpfnWndProc = (WNDPROC)WndProc;
00113         wndclass.cbClsExtra = 0;
00114         wndclass.cbWndExtra = 0;
00115         wndclass.hInstance = hInstance;
00116         wndclass.hIcon = LoadIcon(hInstance, "WINCAP");
00117         wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
00118
00119         // Use black for background for better contrast
00120
00121         wndclass.hbrBackground = GetStockObject(GRAY_BRUSH);
00122
00123         wndclass.lpszMenuName = (LPSTR)"MAINMENU";
00124         wndclass.lpszClassName = (LPSTR)szAppName;
00125
00126         if (!RegisterClass(&wndclass))
00127             return FALSE;
00128
00129         ghInst = hInstance;  // Set Global variable
00130
00131         // Create a main window for this application instance.
00132
00133         hWnd = CreateWindow(szAppName, lpBuffer, WS_OVERLAPPEDWINDOW,
00134                 CW_USEDEFAULT, CW_USEDEFAULT, 450, 345, NULL, NULL, hInstance,            // This instance owns this window
00135                 NULL);
00136
00137         ghWndMain = hWnd;      // Set global variable
00138
00139         ShowWindow(hWnd, nCmdShow);
00140         UpdateWindow(hWnd);
00141
00142         // Set up the Keyboard hook for our hotkeys
00143
00144         InstallHook(hWnd, TRUE);  // Function resides in DIBAPI32.DLL
00145
00146         // Create our full-screen view class
00147
00148         wndclass.style = 0;
00149         wndclass.lpfnWndProc = (WNDPROC)FullViewWndProc;
00150         wndclass.cbClsExtra = 0;
00151         wndclass.cbWndExtra = 0;
00152         wndclass.hInstance = hInstance;
00153         wndclass.hIcon = NULL;
00154         wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
00155         wndclass.hbrBackground = GetStockObject(GRAY_BRUSH);
00156         wndclass.lpszMenuName = (LPSTR)NULL;
00157         wndclass.lpszClassName = (LPSTR)"ViewClass";
00158
00159         if (!RegisterClass(&wndclass))
00160             return FALSE;
00161
00162     }
00163
00164     // Let's make this a single-instance app -- we can get into hotkey
00165     // conflicts (e.g. windows won't know which instance of WINCAP to
00166     // send the message to).
00167
00168     else
00169     {
00170         LoadString(ghInst, IDS_WINCAPRUNNING, lpBuffer, sizeof(lpBuffer));
00171     MessageBeep(0);
00172         MessageBox(NULL, lpBuffer, szAppName, MB_OK | MB_ICONHAND);
00173         return FALSE;
00174     }
00175
00176     // Polling messages from event queue -- we have a modeless dialog
00177     // box, so we have to take care of the messages here also
00178
00179     while (GetMessage(&msg, NULL, 0, 0))
00180     {
00181         if (hModelessDlg == NULL || !IsDialogMessage(hModelessDlg, &msg) ||
00182                 hSelectDlg || !IsDialogMessage(hSelectDlg, &msg) ||
00183                 hRectangleDlg || !IsDialogMessage(hRectangleDlg, &msg))
00184         {
00185             TranslateMessage(&msg);
00186             DispatchMessage(&msg);
00187         }
00188     }
00189     return (int)msg.wParam;
00190 }
00191
00192
00193
00194 //**********************************************************************
00195 //
00196 // WndProc()
00197 //
00198 // This is our main window procedure.  It receives all the messages destined
00199 // for our application's main window.
00200 //
00201 // When we capture a window, we capture it into a Device-Dependent bitmap,
00202 // and at the same time, we get a copy of the current system palette.  This
00203 // makes displaying the bitmap on the screen very fast.  And when we want
00204 // to print or save the captured window, we need to use this palette to
00205 // convert the DDB to a DIB.
00206 //
00207 //*********************************************************************
00208
00209 long WINAPI WndProc(HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam)
00210 {
00211
00212     // The gbNowCapturing variable is set to TRUE if we are in the middle of
00213     // printing.  This takes care of the case when the user presses the hotkey
00214     // during capturing
00215
00216     static BOOL     bCapturedYet = FALSE;  // TRUE if window contains captured screen
00217     HWND            hViewWnd;              // Handle to our view window
00218     static WORD     wCaptureCommand;
00219     static HCURSOR  hOldCursor;
00220     static HWND     hBrowseWnd;
00221     CHAR            lpBuffer[128];
00222     CHAR            lpBuffer2[128];
00223
00224
00225     switch (wMessage)
00226     {
00227
00228         case WM_CREATE:
00229             if (!hSelectDlg)
00230                 hSelectDlg = CreateDialog(ghInst, "Select", hWnd,
00231                         SelectDlgProc);
00232
00233             if (!hRectangleDlg)
00234                 hRectangleDlg = CreateDialog(ghInst, "Rectangle", hWnd,
00235                         RectangleDlgProc);
00236
00237
00238             ghbmLogo = LoadBitmap(ghInst, "STARTBMP");
00239             guiFileOKMsg = RegisterWindowMessage( (LPCSTR)FILEOKSTRING );
00240             break;
00241
00242         // Gray out menu items if we haven't captured anything yet.
00243
00244         case WM_INITMENU:
00245             EnableMenuItem(GetMenu(hWnd), IDM_SAVE, MF_BYCOMMAND |
00246                     (bCapturedYet ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
00247             EnableMenuItem(GetMenu(hWnd), IDM_PRINT, MF_BYCOMMAND |
00248                     (bCapturedYet ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
00249             EnableMenuItem(GetMenu(hWnd), IDM_EDITCOPY, MF_BYCOMMAND |
00250                     (bCapturedYet ? MF_ENABLED : MF_DISABLED | MF_GRAYED));
00251             return 0;
00252
00253
00254         // The WM_PALETTECHANGED message informs all windows that the window
00255         // with input focus has realized its logical palette, thereby changing
00256         // the system palette. This message allows a window without input focus
00257         // that uses a color palette to realize its logical palettes and update
00258         // its client area.
00259         //
00260         // This message is sent to all windows, including the one that changed
00261         // the system palette and caused this message to be sent. The wParam of
00262         // this message contains the handle of the window that caused the system
00263         // palette to change. To avoid an infinite loop, care must be taken to
00264         // check that the wParam of this message does not match the window's
00265         // handle.
00266
00267         case WM_PALETTECHANGED:
00268         {
00269             HDC         hDC;      // Handle to device context
00270             HPALETTE    hOldPal;  // Handle to previous logical palette
00271
00272             // Before processing this message, make sure we
00273             // are indeed using a palette
00274
00275             if (ghPal)
00276             {
00277                 // If this application did not change the palette, select
00278                 // and realize this application's palette
00279
00280                 if (wParam != (WPARAM)hWnd)
00281                 {
00282                     // Need the window's DC for SelectPalette/RealizePalette
00283
00284                     hDC = GetDC(hWnd);
00285
00286                     // Select and realize our palette
00287
00288                     hOldPal = SelectPalette(hDC, ghPal, FALSE);
00289                     RealizePalette(hDC);
00290
00291                     // WHen updating the colors for an inactive window,
00292                     // UpdateColors can be called because it is faster than
00293                     // redrawing the client area (even though the results are
00294                     // not as good)
00295
00296                     UpdateColors(hDC);
00297
00298                     // Clean up
00299
00300                     if (hOldPal)
00301                        SelectPalette(hDC, hOldPal, FALSE);
00302
00303                     ReleaseDC(hWnd, hDC);
00304                 }
00305             }
00306             break;
00307         }
00308
00309
00310         // The WM_QUERYNEWPALETTE message informs a window that it is about to
00311         // receive input focus. In response, the window receiving focus should
00312         // realize its palette as a foreground palette and update its client
00313         // area. If the window realizes its palette, it should return TRUE;
00314         // otherwise, it should return FALSE.
00315
00316         case WM_QUERYNEWPALETTE:
00317         {
00318             HDC         hDC;      // Handle to device context
00319             HPALETTE    hOldPal;  // Handle to previous logical palette
00320
00321             // Before processing this message, make sure we
00322             // are indeed using a palette
00323
00324             if (ghPal)
00325             {
00326                  // Need the window's DC for SelectPalette/RealizePalette
00327
00328                  hDC = GetDC(hWnd);
00329
00330                  // Select and realize our palette
00331
00332                  hOldPal = SelectPalette(hDC, ghPal, FALSE);
00333                  RealizePalette(hDC);
00334
00335                  // Redraw the entire client area
00336
00337                  InvalidateRect(hWnd, NULL, TRUE);
00338                  UpdateWindow(hWnd);
00339
00340                  // Clean up
00341
00342                  if (hOldPal)
00343                     SelectPalette(hDC, hOldPal, FALSE);
00344
00345                  ReleaseDC(hWnd, hDC);
00346
00347                  // Message processed, return TRUE
00348
00349                  return TRUE;
00350              }
00351
00352             // Message not processed, return FALSE
00353
00354             return FALSE;
00355         }
00356
00357
00358
00359         case WM_MOVE:
00360         {
00361             if (gbNowCapturing)
00362             {
00363                 if (gbCaptRect)
00364                     CenterWindow(hRectangleDlg, hWnd);
00365                 else
00366                     CenterWindow(hSelectDlg, hWnd);
00367             }
00368
00369             return 0;
00370         }
00371
00372         case WM_SIZE:
00373         {
00374             static BOOL     bSizing=FALSE;
00375
00376             if (gbNowCapturing)
00377             {
00378                 if (gbCaptRect)
00379                     CenterWindow(hRectangleDlg, hWnd);
00380                 else
00381                     CenterWindow(hSelectDlg, hWnd);
00382             }
00383
00384             // Check if we are already sizing
00385
00386             if (bSizing)
00387                 return 0l;
00388
00389             bSizing = TRUE;
00390             DoSize(hWnd);
00391             bSizing = FALSE;
00392             break;
00393         }
00394
00395         case WM_HSCROLL:
00396         case WM_VSCROLL:
00397             DoScroll(hWnd, wMessage, (int)HIWORD(wParam), (int)LOWORD(wParam));
00398             break;
00399
00400         case WM_PAINT:
00401             DoPaint(hWnd);
00402             break;
00403
00404         case WM_COMMAND:
00405             switch (LOWORD(wParam))
00406             {
00407                 case IDM_ABOUT:
00408                     DialogBox(ghInst, (LPSTR)"About", hWnd, AboutDlgProc);
00409                     break;
00410
00411                 case IDM_SAVE:
00412                     SaveMe();
00413                     break;
00414
00415                 case IDM_PRINT:
00416                     PrintMe();
00417                     break;
00418
00419                 case IDM_VIEWFULL:
00420                     if (!bViewFull && (ghBitmap || bStartup))
00421                     {
00422                         HDC     hDC;
00423                         int ScreenX, ScreenY;
00424
00425                         hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
00426
00427                         ScreenX = GetDeviceCaps(hDC, HORZRES);
00428
00429                         ScreenY = GetDeviceCaps(hDC, VERTRES);
00430                         DeleteDC(hDC);
00431
00432                         hViewWnd = CreateWindow((LPSTR)"ViewClass", (LPSTR)NULL,
00433                                 WS_POPUP | WS_VISIBLE, 0, 0, ScreenX, ScreenY,
00434                                 hWnd, NULL, ghInst, NULL);
00435
00436                         ShowWindow(hViewWnd, SW_SHOW);
00437                         UpdateWindow(hViewWnd);
00438                     }
00439                     else {
00440                         LoadString(ghInst, IDS_NOIMAGE, lpBuffer, sizeof(lpBuffer));
00441                         LoadString(ghInst, IDS_VWFULLSCRN, lpBuffer2, sizeof(lpBuffer2));
00442                         MessageBox(hWnd, lpBuffer, lpBuffer2, MB_OK);
00443                     }
00444                     break;
00445
00446                 case IDM_EDITCOPY: // Copy DIB, bitmap, & palette to clipboard
00447                     if (OpenClipboard(hWnd))
00448                     {
00449                         HDIB        hDib;
00450                         HBITMAP     hBitmap;
00451                         HPALETTE    hPal;
00452
00453                         EmptyClipboard();
00454
00455                         if (ghBitmap)
00456                         {
00457                             // Once these are added to the clipboard, the
00458                             // clipboard owns the data.
00459
00460                             if (hDib = BitmapToDIB(ghBitmap, ghPal))
00461                                 SetClipboardData(CF_DIB, hDib);
00462
00463                             // Make a copy of the bitmap so the clipboard can
00464                             // own it.
00465
00466                             if (hBitmap = DIBToBitmap(hDib, ghPal))
00467                                 SetClipboardData(CF_BITMAP, hBitmap);
00468
00469                             // Make a copy of the palette so the clipboard can
00470                             // own it.
00471
00472                             if (hPal = GetStockObject(DEFAULT_PALETTE))
00473                                 SetClipboardData(CF_PALETTE, hPal);
00474                         }
00475
00476                         CloseClipboard();
00477                     }
00478                     break;
00479
00480                 case IDM_VIEWCLEAR:
00481                 {
00482                     WORD        wRet;
00483
00484                     if (gbSave)
00485                     {
00486                         LoadString(ghInst, IDS_SAVEBMP, lpBuffer, sizeof(lpBuffer));
00487                         wRet =(WORD) MessageBox(hWnd, lpBuffer,
00488                                 szAppName, MB_ICONEXCLAMATION | MB_YESNOCANCEL);
00489
00490                         if (wRet == IDYES)
00491                             SaveMe();
00492                         else if( wRet == IDCANCEL)
00493                             break;
00494                     }
00495
00496
00497                     gbSave = FALSE;
00498
00499                     // If we are just displaying logo, don't
00500                     // display it anymore
00501
00502                     if (bStartup)
00503                         bStartup = FALSE;
00504
00505                     // Delete captured bitmap if we have one
00506
00507                     if (ghBitmap)
00508                     {
00509                         DeleteObject(ghBitmap);
00510                         ghBitmap = NULL;
00511                     }
00512
00513                     // Delete our captured bitmap's palette if we have one
00514
00515                     if (ghPal)
00516                     {
00517                         DeleteObject(ghPal);
00518                         ghPal = NULL;
00519                     }
00520
00521                     // Now update display to reflect fact that we
00522                     // nuked the captured bitmap or don't want to
00523                     // look at the cool logo
00524
00525                     InvalidateRect(hWnd, NULL, TRUE);
00526                     UpdateWindow(hWnd);
00527
00528                     bCapturedYet = FALSE;  // Gray out "File.Save" menu item
00529                     break;
00530                 }
00531
00532
00533                 case IDM_CAPTRECT:
00534                     gbCaptRect = TRUE;
00535
00536                 case IDM_CAPTWINDOW:  // make sure lParam == IDM_CURSORSELECT
00537                 case IDM_CAPTCLIENT:  // make sure lParam == IDM_CURSORSELECT
00538                     lParam = IDM_CURSORSELECT;
00539
00540                 case IDM_ACTIVEWINDOW:
00541                 case IDM_DESKTOP:
00542
00543
00544                 // User selected one of the window capture items
00545
00546                 // Check to see that we aren't already in the middle of
00547                 // capturing.  This could happen if the user presses our hotkey
00548                 // in the middle of one of our dialog boxes.
00549
00550                 if (gbNowCapturing)
00551                 {
00552                     LoadString(ghInst, IDS_CAPTEDALREADY, lpBuffer, sizeof(lpBuffer));
00553                     MessageBox(NULL, lpBuffer,
00554                             szAppName, MB_OK | MB_ICONEXCLAMATION);
00555                 }
00556                 else
00557                 {
00558                     // User wants to capture screen.  One problem we may
00559                     // run into here is that we might have a popup menu pulled
00560                     // down in our own application when we get to this point
00561                     // (because of the hotkey feature of this app).
00562                     //
00563                     // Normally, we'd just enter a message loop after calling
00564                     // ShowWindow(SW_HIDE) to take care of any menu messages
00565                     // which may have been posted as we hide our application's
00566                     // window, and *then* call our screen capture routine.
00567                     // But unfortunately, we can't do that here and be 100% safe.
00568                     //
00569                     // If we *have* been sent here on a hotkey, and a menu of
00570                     // our own app is currently down, then we are currently running
00571                     // inside of a PeekMessage() loop in the Windows Menu
00572                     // manager. We should *not* enter another PeekMessage loop,
00573                     // but should return from this message case right away.
00574                     // The Windows Menu manager code relies on checking messages
00575                     // in it's queue via it's own PeekMessage loop, and if we
00576                     // entered one, it would confuse the menu manager.
00577                     //
00578                     // So what we do instead is just post ourselves a private
00579                     // message, and when we get this message (see below), then
00580                     // do the screen capture.
00581                     //
00582
00583                     // Commence screen capture!
00584
00585                     gbNowCapturing = TRUE;
00586
00587                     if (wParam == IDM_DESKTOP)
00588                         ShowWindow(hWnd, SW_HIDE);
00589
00590                     // Allow this message case to return right away.  We'll
00591                     // capture screen down below.
00592
00593                     if (lParam != IDM_CURSORSELECT)
00594                         PostMessage(hWnd, WM_DOCAPTURE, wParam, 0L);
00595                     else if (gbCaptRect)
00596                     {
00597                         CenterWindow(hRectangleDlg, hWnd);
00598                         ShowWindow(hRectangleDlg, SW_SHOW);
00599                     }
00600                     else
00601                     {
00602                         CenterWindow(hSelectDlg, hWnd);
00603                         ShowWindow(hSelectDlg, SW_SHOW);
00604                     }
00605
00606                     wCaptureCommand = (WORD)wParam;
00607                 }
00608                 break;
00609
00610                 case IDM_EXIT:
00611                     PostMessage(hWnd, WM_CLOSE, 0, 0L);
00612                     break;
00613
00614                 default:
00615                     return (int)DefWindowProc(hWnd, wMessage, wParam, lParam);
00616                     break;
00617             } //switch (LOWORD(wParam))
00618
00619             break; // case WM_COMMAND:
00620
00621
00622         // Message case for doing screen capture.  This message is posted
00623         // to us from the IDM_CAPT* code above.  wParam should be equal to
00624         // the ID of the message which we got sent here for (it is used in
00625         // the call to DoCapture()).
00626
00627         case WM_DOCAPTURE:
00628         {
00629             // We're going to capture a new screen, get rid of
00630             // previous captured image
00631
00632             if (ghBitmap)
00633             {
00634                 DeleteObject(ghBitmap);
00635                 ghBitmap = NULL;
00636             }
00637
00638             if (ghPal)
00639             {
00640                 DeleteObject(ghPal);
00641                 ghPal = NULL;
00642             }
00643
00644             SetForegroundWindow(ghWndCapture);
00645
00646             // Save captured screen as bitmap
00647
00648             DoCapture(hWnd, (WORD)wParam);
00649
00650             SetForegroundWindow(hWnd);
00651
00652             // Un-hide Window
00653
00654             ShowWindow(hWnd, SW_SHOW);
00655
00656             if (IsIconic(hWnd))
00657                 PostMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE,  0L);
00658
00659             if (!gbCaptRect)
00660                 gbNowCapturing = FALSE;
00661
00662             bCapturedYet = TRUE; // Enable "File.Save" menu item
00663             gbSave = TRUE;
00664             break;
00665         }
00666
00667         case WM_LBUTTONDOWN:
00668         {
00669
00670             if (!gbNowCapturing)
00671                 break;
00672
00673             ShowWindow(hWnd, SW_HIDE);  // Hide main app's window
00674             if (gbCaptRect)
00675                 ShowWindow(hRectangleDlg, SW_HIDE);
00676             else
00677                 ShowWindow(hSelectDlg, SW_HIDE);
00678             if (gbCaptRect)
00679             {
00680                 hOldCursor = SetCursor(LoadCursor(NULL, IDC_CROSS));
00681                 PostMessage(hWnd, WM_DOCAPTURE, wCaptureCommand, 0L);
00682             }
00683             else
00684                 hOldCursor = SetCursor(LoadCursor(ghInst, "SELECT"));
00685             gbLButtonDown = TRUE;
00686             SetCapture(ghWndMain);
00687             break;
00688         }
00689
00690
00691         case WM_LBUTTONUP:
00692         {
00693             POINTS      pts;
00694             POINT       pt;
00695
00696             if (!(gbNowCapturing && gbLButtonDown))
00697                 break;
00698
00699             ReleaseCapture();
00700             gbLButtonDown = FALSE;
00701             SetCursor(hOldCursor);
00702
00703             if (gbCaptRect)
00704             {
00705                 gbCaptRect = FALSE;
00706                 gbNowCapturing = FALSE;
00707                 break;
00708             }
00709
00710             FrameWindow(hBrowseWnd);
00711             hBrowseWnd = NULL;
00712
00713             pts = MAKEPOINTS(lParam);
00714             pt.x = pts.x;
00715             pt.y = pts.y;
00716
00717             // Convert to screen coordinates
00718
00719             ClientToScreen(ghWndMain, &pt);
00720
00721             // Get Window that we clicked on
00722
00723             ghWndCapture = WindowFromPoint(pt);
00724
00725             // If it's not a valid window, just return NULL
00726
00727             if (!ghWndCapture)
00728             {
00729                SetCursor(hOldCursor);
00730                gbLButtonDown = gbNowCapturing = FALSE;
00731                break;
00732             }
00733
00734             PostMessage(hWnd, WM_DOCAPTURE, wCaptureCommand, 0L);
00735             break;
00736
00737         }
00738
00739         case WM_MOUSEMOVE:
00740         {
00741             POINT       pt;
00742             HWND        hWndCurrent;
00743
00744             if (!(gbNowCapturing && gbLButtonDown))
00745                 break;
00746
00747             if (gbCaptRect)
00748                 break;
00749
00750             // get the current mouse position
00751
00752             GetCursorPos(&pt);
00753
00754             // Get Window that we clicked on
00755
00756             hWndCurrent = WindowFromPoint(pt);
00757
00758             // if the cursor is still moving in the current window, no need
00759             // to highlight it again
00760
00761             if (hWndCurrent != hBrowseWnd)
00762             {
00763                 FrameWindow(hBrowseWnd);
00764                 FrameWindow(hWndCurrent);
00765                 hBrowseWnd = hWndCurrent;
00766                 if (hWndCurrent)
00767                     UpdateWindow(hWndCurrent);
00768             }
00769
00770             break;
00771         }
00772
00773         case WM_CLOSE:
00774         {
00775             WORD        wRet;
00776
00777             if (gbSave)
00778             {
00779                 LoadString(ghInst, IDS_SAVEBMP, lpBuffer, sizeof(lpBuffer));
00780                 wRet = (WORD) MessageBox(hWnd, lpBuffer,
00781                         szAppName, MB_ICONEXCLAMATION | MB_YESNOCANCEL);
00782
00783                 if (wRet == IDYES)
00784                     SaveMe();
00785                 else if( wRet == IDCANCEL)
00786                     break;
00787             }
00788
00789             if (IsWindow(hSelectDlg))
00790                 DestroyWindow(hSelectDlg);
00791             if (IsWindow(hRectangleDlg))
00792                 DestroyWindow(hRectangleDlg);
00793
00794             return (int)DefWindowProc(hWnd, wMessage, wParam, lParam);
00795         }
00796
00797         case WM_DESTROY:  // Clean up
00798             InstallHook(hWnd, FALSE);  // Remove keyboard hook
00799             DeleteObject(ghbmLogo);
00800
00801             if (ghBitmap)
00802                 DeleteObject(ghBitmap);
00803             if (ghPal)
00804                 DeleteObject(ghPal);
00805
00806
00807             PostQuitMessage(0);
00808             break;
00809
00810         default:
00811             return (int)DefWindowProc(hWnd, wMessage, wParam, lParam);
00812     }
00813     return 0L;
00814 }
00815
00816
00817 //**********************************************************************
00818 //
00819 // FullViewWndProc()
00820 //
00821 // This is our full-screen popup window procedure. It is used to display an
00822 // image using the entire screen. Clicking the left mouse button restores
00823 // to the main app window.
00824 //
00825 //
00826 //*********************************************************************
00827
00828
00829 long APIENTRY FullViewWndProc(HWND hWnd, UINT wMessage, WPARAM wParam,
00830         LPARAM  lParam)
00831 {
00832     switch (wMessage)
00833     {
00834         case WM_PAINT:
00835         {
00836             PAINTSTRUCT     ps;
00837             HDC             hMemDC;
00838             BITMAP          bm;
00839             HBITMAP         hOldBm;
00840             RECT            rect, rectClient;
00841             int             x, y;
00842
00843             BeginPaint(hWnd, &ps);
00844
00845             // Check to see if we are displaying a bitmap
00846
00847             if (!ghBitmap)
00848             {
00849
00850                 // No bitmap yet, are we in start mode?
00851
00852                 if (bStartup)
00853                 {
00854                     GetClientRect(hWnd, &rectClient);
00855
00856                     hMemDC = CreateCompatibleDC(ps.hdc);
00857
00858                     // Select our logo bitmap
00859
00860                     hOldBm = SelectObject(hMemDC, ghbmLogo);
00861                     GetObject(ghbmLogo, sizeof(BITMAP), (VOID *)&bm);
00862
00863                     x = (rectClient.right - bm.bmWidth) / 2;
00864                     y = (rectClient.bottom - bm.bmHeight) / 2;
00865
00866                     // Now bitblt our logo to client area
00867                     BitBlt(ps.hdc, x, y, bm.bmWidth, bm.bmHeight,
00868                           hMemDC, 0, 0, SRCCOPY);
00869
00870                     // Clean up
00871                     SelectObject(hMemDC,hOldBm);
00872                     DeleteDC(hMemDC);
00873                 }
00874             }
00875             else
00876             {
00877                 // Get info for captured bitmap
00878
00879                 GetObject(ghBitmap, sizeof(BITMAP), (LPSTR)&bm);
00880
00881                 // Fill in src/dest rectangle with width and height
00882                 // of captured bitmap
00883
00884                 rect.left = 0;
00885                 rect.top = 0;
00886                 rect.right = bm.bmWidth;
00887                 rect.bottom = bm.bmHeight;
00888
00889                 // Paint the captured bitmap in the client area
00890
00891                 PaintBitmap(ps.hdc, &rect, ghBitmap, &rect, ghPal);
00892             }
00893
00894             EndPaint(hWnd, &ps);
00895             break;
00896          }
00897
00898         case WM_KEYDOWN:
00899         case WM_LBUTTONDOWN:
00900             DestroyWindow(hWnd);
00901             break;
00902
00903         default:
00904             return (int)DefWindowProc(hWnd, wMessage, wParam, lParam);
00905     }
00906
00907   return 0;
00908 }
00909
00910
00911 //**********************************************************************
00912 //
00913 // SaveMe()
00914 //
00915 // This procedure calls up the common dialog "File.Save" box, then
00916 // saves the current hBitmap as a DIB in the specified file, in the
00917 // file format specified by the user in the dialog.
00918 //
00919 //*********************************************************************
00920
00921 void SaveMe()
00922 {
00923     char    szFileBuf[255];     // Buffer to hold returned file name
00924     DWORD_PTR dwFlags;            // used to pass in / get out file type
00925     HDC     hDC;                // HDC for getting info
00926     int     iBits;              // Bits per pixel of the display adapter
00927     DWORD   dCompression;       // Compression that the user specifies
00928     WORD    wBitCount;          // Bits per pixel that the user specifies
00929     WORD    wCompression;       // Compression
00930     HDIB    hDIB;               // A handle to our dib
00931     BOOL    bResult;            // Result of dialog box - TRUE if OK was pressed
00932     CHAR    lpBuffer[128];      // Buffer to hold string message retrieved from resources
00933     CHAR    lpBuffer2[128];     // Buffer to hold string message retrieved from resources
00934
00935     // Set up default compression to display in dialog box
00936
00937     wCompression = IDD_RGB;
00938
00939     // Depending on bits/pixel type for current display,
00940     // set the appropriate bit in the fFileOptions flag
00941     //
00942     // NOTE that we don't just assign wBitCount to iBits.  The reason
00943     // for this is some displays aren't 1,4,8 or 24 bits.  Some are
00944     // 15 bits, which isn't valid for a DIB, so in this case, we would
00945     // set the bits to 24.
00946
00947     hDC = CreateDC("DISPLAY",NULL,NULL,NULL);
00948     iBits = GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES);
00949     DeleteDC(hDC);
00950
00951     if (iBits <= 1)
00952         wBitCount = 1;
00953
00954     else if (iBits <= 4)
00955         wBitCount = 4;
00956
00957     else if (iBits <= 8)
00958         wBitCount = 8;
00959
00960     else if (iBits <= 24)
00961         wBitCount = 24;
00962
00963   else if (iBits <= 32)
00964     wBitCount = 32;
00965
00966     // Our dwFlags parameter to GetFileName is made up of the
00967     // bits per pixel in the HIWORD (1, 2, 4, or 24), and the compression
00968     // type in the LOWORD (IDD_RGB, IDD_RLE4, or IDD_RLE8).
00969
00970     dwFlags = MAKELONG(wCompression, wBitCount);
00971
00972
00973     // Bring up File/Save... dialog and get info. about filename,
00974     // compression, and bits/pix. of DIB to be written.
00975
00976     bResult = GetFileName(ghWndMain, (LPSTR)szFileBuf, &dwFlags);  // Function will accept up to 255 characters.
00977
00978     // Extract DIB specs and save to file (if the user did not
00979     // press cancel)
00980
00981     if (bResult)
00982     {
00983         switch(LOWORD(dwFlags))
00984         {
00985             case IDD_RLE4:
00986                 dCompression = BI_RLE4;
00987                 break;
00988
00989             case IDD_RLE8:
00990                 dCompression = BI_RLE8;
00991                 break;
00992
00993             case IDD_RGB:
00994             default:
00995                 dCompression = BI_RGB;
00996                 break;
00997         }
00998
00999         // First, call up a modeless dialog box which tells that we are
01000         // saving this to a file...
01001
01002         if (!hModelessDlg)
01003         {
01004             hModelessDlg = CreateDialogParam(ghInst, (LPSTR)"Saving",
01005                     ghWndMain,SavingDlgProc,(LPARAM)szFileBuf);
01006         }
01007
01008         // Now, write out the DIB in the proper format.  The following
01009         // API ChangeBitmapFormat() will convert the specified bitmap
01010         // to a DIB with the specified Bit Count, Compression and
01011         // Palette.  Remember that the HIWORD of dwFlags specifies the
01012         // bits per pixel.
01013
01014         hDIB = ChangeBitmapFormat(ghBitmap, HIWORD(dwFlags),
01015                 dCompression, ghPal);
01016
01017         if (hDIB)
01018         {
01019             if (SaveDIB(hDIB, szFileBuf))
01020             {
01021                 LoadString(ghInst, IDS_CANTSAVE, lpBuffer, sizeof(lpBuffer));
01022                 LoadString(ghInst, IDS_SAVEERROR, lpBuffer2, sizeof(lpBuffer2));
01023                 MessageBox(NULL, lpBuffer, lpBuffer2, MB_ICONEXCLAMATION);
01024                 gbSave = TRUE;
01025             }
01026             else
01027                 gbSave = FALSE;
01028
01029             DestroyDIB(hDIB);
01030         }
01031
01032         DestroyWindow(hModelessDlg);
01033         hModelessDlg = NULL;
01034     }
01035
01036 }
01037
01038 //*********************************************************************
01039 //
01040 // PrintMe()
01041 //
01042 // This procedure calls up the "File.Print" dialog, then prints the
01043 // current hBitmap as a DIB on the default printer.
01044 //
01045 //*********************************************************************
01046
01047 void PrintMe()
01048 {
01049     static OPTIONSTRUCT opts;
01050     DWORD_PTR           iReturn;
01051     HDIB                hDIB;
01052     WORD                wReturn;
01053
01054
01055     // Display "Print Options" Box
01056
01057
01058     iReturn = DialogBoxParam(ghInst, (LPSTR)"Print", ghWndMain, PrintDlgProc,
01059             (LPARAM) &opts);
01060
01061     if (iReturn)
01062     {
01063         // User pressed "OK" -- do the printing
01064
01065         hDIB = BitmapToDIB(ghBitmap, ghPal);
01066
01067         if (hDIB)
01068         {
01069
01070             // Print the dib using PrintDIB() API
01071
01072             if (opts.iOption == IDC_STRETCHTOPAGE)
01073                 wReturn = PrintDIB(hDIB, PW_STRETCHTOPAGE, 0, 0,
01074                         (LPSTR)gszWindowText);
01075
01076             else if (opts.iOption == IDC_SCALE)
01077                 wReturn = PrintDIB(hDIB, (WORD)PW_SCALE, (WORD)opts.iXScale,
01078                         (WORD)opts.iYScale, (LPSTR)gszWindowText);
01079             else
01080                 wReturn = PrintDIB(hDIB, PW_BESTFIT, 0, 0,
01081                         (LPSTR)gszWindowText);
01082
01083             if (wReturn)
01084                 DIBError(wReturn);
01085
01086             DestroyDIB(hDIB);
01087         }
01088     }
01089 }
01090
01091
01092
01093 //*********************************************************************
01094 //
01095 // DoCapture()
01096 //
01097 // This procedure gets called when the user wants to capture the
01098 // screen.  The wCommand parameter tells us which capture operation
01099 // we want to perform.
01100 //
01101 //*********************************************************************
01102
01103
01104 void DoCapture(HWND hWnd, WORD wCommand)
01105 {
01106     HBITMAP     hBitmap;        // Handle to our temporary bitmap
01107     HPALETTE    hPal;           // Handle to our palette
01108     CHAR        lpBuffer[128];  // Buffer for string retrieved from resources
01109
01110
01111     switch (wCommand)
01112     {
01113         // Copy Entire screen to DIB
01114
01115         case IDM_DESKTOP:
01116         {
01117             RECT rScreen;       // Rect containing entire screen coordinates
01118             HDC hDC;            // DC to screen
01119             MSG msg;            // Message for the PeekMessage()
01120
01121             hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
01122             rScreen.left = rScreen.top = 0;
01123             rScreen.right = GetDeviceCaps(hDC, HORZRES);
01124             rScreen.bottom = GetDeviceCaps(hDC, VERTRES);
01125
01126             // Delete our DC
01127
01128             DeleteDC(hDC);
01129
01130             LoadString(ghInst, IDS_ENTIRESCRN, lpBuffer, sizeof(lpBuffer));
01131             strncpy(gszWindowText, lpBuffer, sizeof(gszWindowText) - 1);
01132       gszWindowText[sizeof(gszWindowText) - 1] = '\0';
01133
01134             // Wait until everybody repaints themselves
01135
01136             while (PeekMessage(&msg,NULL,0,0,PM_REMOVE) != 0)
01137             {
01138                 TranslateMessage(&msg);
01139                 DispatchMessage(&msg);
01140             }
01141
01142
01143             hBitmap = CopyScreenToBitmap(&rScreen);
01144
01145             if (hBitmap)
01146                 hPal = GetSystemPalette();
01147             else
01148                 hPal = NULL;
01149         }
01150         break;
01151
01152
01153         // copy user-selected portion of screen to DIB
01154
01155         case IDM_CAPTRECT:
01156         {
01157             RECT rRubberBand;       // Region to capture (screen coordinates)
01158
01159             // Allow user to "rubberband" a section of the screen for
01160             // us to capture
01161
01162             RubberBandScreen(&rRubberBand);
01163             LoadString(ghInst, IDS_USERSELECT, lpBuffer, sizeof(lpBuffer));
01164             strncpy(gszWindowText, lpBuffer, sizeof(gszWindowText) - 1);
01165       gszWindowText[sizeof(gszWindowText) - 1] = '\0';
01166
01167             hBitmap = CopyScreenToBitmap(&rRubberBand);
01168
01169             if (hBitmap)
01170                 hPal = GetSystemPalette();
01171             else
01172                 hPal = NULL;
01173         }
01174         break;
01175
01176
01177
01178         case IDM_CAPTWINDOW:
01179         case IDM_CAPTCLIENT:
01180         case IDM_ACTIVEWINDOW:
01181         {
01182             HWND    hWndSelect;       // The current active window
01183             HWND    hWndDesktop;      // Window to desktop
01184             MSG     msg;              // For our peekmessage loop
01185
01186             // Just capture the current active window, whatever it is
01187
01188             if (wCommand == IDM_ACTIVEWINDOW)
01189                 hWndSelect = GetForegroundWindow();
01190
01191             // Allow the user to click on a single window to capture
01192
01193             else
01194                 hWndSelect = ghWndCapture;
01195
01196             // If they try to capture the desktop window, then just
01197             // capture the entire screen.
01198
01199             hWndDesktop = GetDesktopWindow();
01200
01201             if (hWndSelect == hWndDesktop)
01202             {
01203                 RECT    rScreen;    // contains entire screen coordinates
01204                 HDC     hDC;        // DC to screen
01205                 MSG     msg1;       // Message for the PeekMessage()
01206
01207                 hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
01208                 rScreen.left = rScreen.top = 0;
01209                 rScreen.right = GetDeviceCaps(hDC, HORZRES);
01210                 rScreen.bottom = GetDeviceCaps(hDC, VERTRES);
01211
01212                 /* Delete our DC */
01213                 DeleteDC(hDC);
01214
01215                 LoadString(ghInst, IDS_ENTIRESCRN, lpBuffer, sizeof(lpBuffer));
01216                 strncpy(gszWindowText, lpBuffer, sizeof(gszWindowText) -1);
01217
01218
01219                 // Wait until everybody repaints themselves
01220
01221                 while (PeekMessage(&msg1,NULL,0,0,PM_REMOVE) != 0)
01222                 {
01223                     TranslateMessage(&msg1);
01224                     DispatchMessage(&msg1);
01225                 }
01226
01227                 ghBitmap = CopyScreenToBitmap(&rScreen);
01228
01229                 if (ghBitmap)
01230                     ghPal = GetSystemPalette();
01231                 else
01232                     ghPal = NULL;
01233
01234                 ghWndCapture = NULL;
01235                 return;
01236             }
01237
01238             // Check to see that the hWnd is not NULL
01239
01240             if (!hWndSelect)
01241             {
01242                 LoadString(ghInst, IDS_CANTCAPWNDW, lpBuffer, sizeof(lpBuffer));
01243                 MessageBox(NULL, lpBuffer, szAppName,
01244                         MB_ICONEXCLAMATION | MB_OK);
01245
01246                 hBitmap = NULL;
01247                 hPal = NULL;
01248                 break;
01249             }
01250
01251             // Make sure it's not a hidden window.  Hmm, capturing a hidden
01252             // window would certainly be a cool trick, wouldn't it?
01253
01254             if (!IsWindowVisible(hWndSelect))
01255             {
01256                 LoadString(ghInst, IDS_WNDWNOTVIS, lpBuffer, sizeof(lpBuffer));
01257                 MessageBox(NULL, lpBuffer,
01258                         szAppName, MB_ICONEXCLAMATION | MB_OK);
01259
01260                 ghWndCapture = NULL;
01261                 hBitmap = NULL;
01262                 hPal = NULL;
01263                 break;
01264             }
01265
01266             // Move window which was selected to top of Z-order for
01267             // the capture, and make it redraw itself
01268
01269             SetWindowPos(hWndSelect, NULL, 0, 0, 0, 0,
01270                     SWP_DRAWFRAME | SWP_NOSIZE | SWP_NOMOVE);
01271
01272             UpdateWindow(hWndSelect);
01273
01274             // Wait until everybody repaints themselves
01275
01276             while (PeekMessage(&msg,NULL,0,0,PM_REMOVE) != 0)
01277             {
01278                 TranslateMessage(&msg);
01279                 DispatchMessage(&msg);
01280             }
01281
01282             // Get the caption
01283
01284             GetWindowText(hWndSelect, gszWindowText, 100);
01285
01286             // Capture the screen -- if we selected CLIENT only capture, then
01287             // select that open when calling our API.  Otherwise, get the
01288             // entire window.
01289
01290             hBitmap = CopyWindowToBitmap(hWndSelect,
01291                     (WORD)((wCommand == IDM_CAPTCLIENT) ? (PW_CLIENT) :
01292                     (PW_WINDOW)));
01293
01294             if (hBitmap)
01295                 hPal = GetSystemPalette();
01296             else
01297                 hPal = NULL;
01298
01299             break;
01300         }
01301
01302         //Oops, something went wrong
01303
01304         default:
01305             LoadString(ghInst, IDS_INTERROR, lpBuffer, sizeof(lpBuffer));
01306             MessageBox(NULL, lpBuffer, szAppName,
01307                     MB_ICONHAND | MB_OK);
01308             break;
01309     }
01310
01311     if (hBitmap)
01312     {
01313         ghBitmap = hBitmap;
01314         hBitmap = NULL;
01315     }
01316     if (hPal)
01317     {
01318         ghPal = hPal;
01319         hPal = NULL;
01320     }
01321
01322     // Now, paint our bitmap in the client area
01323
01324     if (bStartup)
01325         bStartup = FALSE;
01326
01327     InvalidateRect(hWnd, NULL, FALSE);
01328     UpdateWindow(hWnd);
01329     ghWndCapture = NULL;
01330 }
01331
01332
01333
01334 //**********************************************************************
01335 //
01336 // RubberBandScreen()
01337 //
01338 // This function allows the user to rubber-band a portion of the screen.
01339 // When the left button is released, the rect that the user selected
01340 // (in screen coordinates) is returned in lpRect.
01341 //
01342 //*********************************************************************
01343
01344 void RubberBandScreen(LPRECT lpRect)
01345 {
01346     POINT   pt;                 // Temporary POINT
01347     MSG     msg;                // Used in our PeekMessage() loop
01348     POINT   ptOrigin;           // Point where the user pressed left mouse button down
01349     RECT    rcClip;             // Current selection
01350     HDC     hScreenDC;          // DC to the screen (so we can draw on it)
01351     BOOL    bCapturing = FALSE; // TRUE if we are rubber-banding
01352     POINTS  pts;
01353     BOOL    bLButtonUp = FALSE;
01354
01355     hScreenDC = CreateDC("DISPLAY", NULL, NULL, NULL);
01356
01357     // Eat mouse messages until a WM_LBUTTONUP is encountered. Meanwhile
01358     // continue to draw a rubberbanding rectangle and display it's dimensions
01359
01360     for (;;)
01361     {
01362         WaitMessage();
01363         if (PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
01364         {
01365             // If the message is a WM_LBUTTONDOWN, begin drawing the
01366             // rubber-band box.
01367
01368             if (msg.message == WM_RBUTTONDOWN)
01369             {
01370                 // User pressed left button, initialize selection
01371                 // Set origin to current mouse position (in window coords)
01372
01373                 pts = MAKEPOINTS(msg.lParam);
01374
01375                 ptOrigin.x = pts.x;
01376                 ptOrigin.y = pts.y;
01377
01378                 // Convert to screen coordinates
01379
01380                 ClientToScreen(ghWndMain, &ptOrigin);
01381
01382
01383                 // rcClip is the current rectangle that the user
01384                 // has selected.  Since user just pressed left button down,
01385                 // initialize this rect very small
01386
01387                 rcClip.left = rcClip.right = ptOrigin.x;
01388                 rcClip.top = rcClip.bottom = ptOrigin.y;
01389                 NormalizeRect(&rcClip);     // Make sure it is a normal rect
01390                 DrawSelect(hScreenDC, TRUE, &rcClip); // Draw the rubber-band box
01391                 bCapturing = TRUE;
01392             }
01393
01394             else if (msg.message == WM_LBUTTONUP)
01395             {
01396                 if (!bCapturing)
01397                     break;
01398                 else
01399                 {
01400                     bLButtonUp = TRUE;
01401                     PostMessage(ghWndMain, WM_RBUTTONUP, msg.wParam, msg.lParam);
01402                 }
01403             }
01404
01405             // Any messages that make it into the next statement are mouse
01406             // messages, and we are capturing, so let's update the rubber-band
01407             // box
01408
01409             if (bCapturing)
01410             {
01411                 DrawSelect(hScreenDC, FALSE, &rcClip);  // erase old rubber-band
01412                 rcClip.left = ptOrigin.x;   // Update rect with new mouse info
01413                 rcClip.top = ptOrigin.y;
01414
01415                 pts = MAKEPOINTS(msg.lParam);
01416
01417                 pt.x = pts.x;
01418                 pt.y = pts.y;
01419
01420                 // Convert to screen coordinates
01421
01422                 ClientToScreen(ghWndMain, &pt);
01423                 rcClip.right = pt.x;
01424                 rcClip.bottom = pt.y;
01425                 NormalizeRect(&rcClip);
01426                 DrawSelect(hScreenDC, TRUE, &rcClip); // new rubber-band
01427             }
01428
01429             // If the message is WM_LBUTTONUP, then we stop the selection
01430             // process.
01431
01432             if (msg.message == WM_RBUTTONUP)
01433             {
01434                 DrawSelect(hScreenDC, FALSE, &rcClip);    // erase rubber-band
01435                 if (bLButtonUp)
01436                     PostMessage(ghWndMain, WM_LBUTTONUP, msg.wParam, msg.lParam);
01437                 break;
01438             }
01439         }
01440         else
01441             continue;
01442     }
01443     DeleteDC(hScreenDC);
01444
01445     // Assign rect user selected to lpRect parameter
01446
01447     if (!IsRectEmpty(&rcClip))
01448         CopyRect(lpRect, &rcClip);
01449
01450     PostMessage(ghWndMain, WM_LBUTTONUP, msg.wParam, msg.lParam);
01451 }
01452
01453
01454 //***************************************************************************
01455 //
01456 // DrawSelect
01457 //
01458 // Draws the selected clip rectangle with its dimensions on the DC
01459 //
01460 //***************************************************************************
01461
01462
01463 void DrawSelect(HDC hdc, BOOL fDraw, LPRECT lprClip)
01464 {
01465     char sz[80];
01466     DWORD dw;
01467     int x, y, len, dx, dy;
01468     HDC hdcBits;
01469     HBITMAP hbm;
01470     RECT rcClip;
01471     SIZE sExtent;
01472
01473     rcClip = *lprClip;
01474     if (!IsRectEmpty(&rcClip))
01475     {
01476
01477         // If a rectangular clip region has been selected, draw it
01478
01479         PatBlt(hdc, rcClip.left, rcClip.top, rcClip.right - rcClip.left, 1,
01480                 DSTINVERT);
01481         PatBlt(hdc, rcClip.left, rcClip.bottom, 1, -(rcClip.bottom-rcClip.top),
01482                 DSTINVERT);
01483         PatBlt(hdc, rcClip.right - 1, rcClip.top, 1, rcClip.bottom - rcClip.top,
01484                 DSTINVERT);
01485         PatBlt(hdc, rcClip.right, rcClip.bottom - 1, -(rcClip.right -
01486                 rcClip.left), 1, DSTINVERT);
01487
01488         // Format the dimensions string ...
01489
01490         _snprintf(sz, sizeof(sz) - 1, "%dx%d", rcClip.right - rcClip.left, rcClip.bottom -
01491                rcClip.top);
01492     sz[sizeof(sz) - 1] = '\0';
01493
01494         len = lstrlen(sz);
01495
01496         // ... and center it in the rectangle
01497
01498         dw = GetTextExtentPoint(hdc, sz, len, &sExtent);
01499         dx = sExtent.cx;
01500         dy = sExtent.cy;
01501         x = (rcClip.right + rcClip.left - dx) / 2;
01502         y = (rcClip.bottom + rcClip.top - dy) / 2;
01503         hdcBits = CreateCompatibleDC(hdc);
01504         SetTextColor(hdcBits, 0xFFFFFFL);
01505         SetBkColor(hdcBits, 0x000000L);
01506
01507         // Output the text to the DC
01508
01509         if (hbm = CreateBitmap(dx, dy, 1, 1, NULL))
01510         {
01511             hbm = SelectObject(hdcBits, hbm);
01512             ExtTextOut(hdcBits, 0, 0, 0, NULL, sz, len, NULL);
01513             BitBlt(hdc, x, y, dx, dy, hdcBits, 0, 0, SRCINVERT);
01514             hbm = SelectObject(hdcBits, hbm);
01515             DeleteObject(hbm);
01516         }
01517         DeleteDC(hdcBits);
01518     }
01519 }
01520
01521
01522 //*************************************************************************
01523 //
01524 //  FUNCTION   : NormalizeRect(RECT *prc)
01525 //
01526 //  PURPOSE    : If the rectangle coordinates are reversed, swaps them.
01527 //               This is used to make sure that the first coordinate of
01528 //               our rect is the upper left, and the second is lower right.
01529 //
01530 //*************************************************************************
01531
01532 void WINAPI NormalizeRect(LPRECT prc)
01533 {
01534     if (prc->right  < prc->left) SWAP(prc->right,  prc->left);
01535     if (prc->bottom < prc->top)  SWAP(prc->bottom, prc->top);
01536 }
01537
01538
01539 //***************************************************************************
01540 //
01541 // Function: DoSize
01542 //
01543 // Purpose:  Called by WndProc() on WM_SIZE
01544 //
01545 //           When the window is sized -- set up the scroll bars.
01546 //
01547 //           The window will be repainted if the new size, combined
01548 //           with the current scroll bar positions would create blank
01549 //           space at the left or bottom of the window.
01550 //
01551 //***************************************************************************
01552
01553 void DoSize(HWND hWnd)
01554 {
01555     BITMAP      bm;                     // Bitmap info structure
01556     int         cxBitmap=0, cyBitmap=0; // Bitmap width and height
01557     int         cxScroll, cyScroll;     // Scroll positions
01558     RECT        rect;                   // Client rectangle
01559
01560     // repaint if displaying bitmap
01561
01562     if (ghBitmap)
01563     {
01564         // Get info about bitmap
01565
01566         GetObject(ghBitmap, sizeof(BITMAP), (LPSTR)&bm);
01567
01568         // Get the width and height of the bitmap
01569
01570         cxBitmap = bm.bmWidth;
01571         cyBitmap = bm.bmHeight;
01572
01573         // Find out the dimensions of the window, and the current thumb
01574         // positions
01575
01576         GetClientRect(hWnd, &rect);
01577
01578         cxScroll = GetScrollPos (hWnd, SB_HORZ);
01579         cyScroll = GetScrollPos (hWnd, SB_VERT);
01580
01581         // If current thumb positions would cause blank space
01582         // at right or bottom of client area, repaint
01583
01584         if (cxScroll + rect.right > cxBitmap ||
01585                 cyScroll + rect.bottom > cyBitmap)
01586             InvalidateRect(hWnd, NULL, FALSE);
01587
01588         // Make sure scroll bars are updated
01589
01590         SetupScrollBars(hWnd, (WORD)cxBitmap, (WORD)cyBitmap);
01591     }
01592     else if (bStartup)
01593         InvalidateRect(hWnd, NULL, TRUE);
01594 }
01595
01596
01597 //***************************************************************************
01598 //
01599 // Function: ReallyGetClientRect
01600 //
01601 // Purpose:  Gets the rectangular area of the client rect including
01602 //           the area underneath visible scroll bars.  Stolen from
01603 //           ShowDIB.
01604 //
01605 //***************************************************************************
01606
01607 void ReallyGetClientRect(HWND hWnd, LPRECT lpRect)
01608 {
01609     DWORD   dwWinStyle;
01610
01611     dwWinStyle = GetWindowLong (hWnd, GWL_STYLE);
01612
01613     GetClientRect (hWnd, lpRect);
01614
01615     if (dwWinStyle & WS_HSCROLL)
01616         lpRect->bottom += (GetSystemMetrics (SM_CYHSCROLL) - 1);
01617
01618     if (dwWinStyle & WS_VSCROLL)
01619         lpRect->right  += (GetSystemMetrics (SM_CXVSCROLL) - 1);
01620 }
01621
01622
01623 //***************************************************************************
01624 //
01625 // Function: SetupScrollBars
01626 //
01627 // Purpose:  Sets up scroll bars.
01628 //
01629 //***************************************************************************
01630
01631 void SetupScrollBars(HWND hWnd, WORD cxBitmap, WORD cyBitmap)
01632 {
01633     RECT        rect;                       // Client Rectangle
01634     BOOL        bNeedScrollBars=FALSE;      // Need Scroll bars?
01635     unsigned    cxWindow, cyWindow;         // Width and height of client area
01636     int         cxRange=0, cyRange=0;       // Range needed for horz and vert
01637
01638     // Do some initialization
01639
01640     ReallyGetClientRect(hWnd, &rect);
01641
01642     cxWindow = rect.right - rect.left;
01643     cyWindow = rect.bottom - rect.top;
01644
01645     // Now determine if we need the scroll bars
01646
01647     if ((cxWindow < (unsigned)cxBitmap) || (cyWindow < (unsigned)cyBitmap))
01648         bNeedScrollBars = TRUE;
01649
01650
01651     // Setup the scroll bar ranges.  We want to be able to
01652     // scroll the window so that all the bitmap can appear
01653     // within the client area.  Take into account that
01654     // if the opposite scroll bar is activated, it eats
01655     // up some client area.
01656
01657     if (bNeedScrollBars)
01658     {
01659         cyRange = (unsigned)cyBitmap - cyWindow - 1 +
01660                 GetSystemMetrics (SM_CYHSCROLL);
01661         cxRange = (unsigned)cxBitmap - cxWindow - 1 +
01662                 GetSystemMetrics (SM_CXVSCROLL);
01663     }
01664
01665     // Set the ranges we've calculated (0 to 0 means invisible scrollbar)
01666
01667     SetScrollRange(hWnd, SB_VERT, 0, cyRange, TRUE);
01668     SetScrollRange(hWnd, SB_HORZ, 0, cxRange, TRUE);
01669 }
01670
01671
01672 //**********************************************************************
01673 //
01674 // Function:   DoScroll()
01675 //
01676 // Purpose:    Called by ChildWndProc() on WM_HSCROLL and WM_VSCROLL.
01677 //             Window needs to be scrolled (user has clicked on one
01678 //             of the scroll bars.
01679 //
01680 //             Does scrolling in both horiziontal and vertical directions.
01681 //             Note that the variables are all named as if we were
01682 //             doing a horizontal scroll.  However, if we're doing a
01683 //             vertical scroll, they are initialized to the appropriate
01684 //             values for a vertical scroll.
01685 //
01686 //             If we scroll by one (i.e. user clicks on one of the
01687 //             scrolling arrows), we scroll the window by 1/SCROLL_RATIO
01688 //             of the client area.  In other words, if SCROLL_RATION==4,
01689 //             then we move the client area over a 1/4 of the width/height
01690 //             of the screen.
01691 //
01692 //             If the user is paging up/down we move a full client area's
01693 //             worth.
01694 //
01695 //             If the user moves the thumb to an absolute position, we
01696 //             just move there.
01697 //
01698 //             ScrollWindow/re-painting do the actual work of scrolling.
01699 //
01700 //**********************************************************************
01701
01702 void DoScroll(HWND hWnd, int message, int wPos, int wScrollType)
01703 {
01704     int  xBar;          // Where scrollbar is now.
01705     int  nMin;          // Minumum scroll bar value.
01706     int  nMax;          // Maximum scroll bar value.
01707     int  dx;            // How much to move.
01708     int  nOneUnit;      // # of pixels for LINEUP/LINEDOWN
01709     int  cxClient;      // Width of client area.
01710     int  nHorzOrVert;   // Doing the horizontal or vertical?
01711     RECT rect;          // Client area.
01712
01713     GetClientRect (hWnd, &rect);
01714
01715     if (message == WM_HSCROLL)
01716     {
01717         nHorzOrVert = SB_HORZ;
01718         cxClient    = rect.right - rect.left;
01719     }
01720     else
01721     {
01722         nHorzOrVert = SB_VERT;
01723         cxClient    = rect.bottom - rect.top;
01724     }
01725
01726     // On a SB_LINEUP/SB_LINEDOWN we will move the DIB by
01727     //  1/SCROLL_RATIO of the client area (i.e. if SCROLL_RATIO
01728     //  is 4, it will scroll the DIB a quarter of the client
01729     //  area's height or width.
01730
01731     nOneUnit = cxClient / SCROLL_RATIO;
01732     if (!nOneUnit)
01733         nOneUnit = 1;
01734
01735     xBar = GetScrollPos (hWnd, nHorzOrVert);
01736     GetScrollRange (hWnd, nHorzOrVert, &nMin, &nMax);
01737
01738     switch (wScrollType)
01739     {
01740         case SB_LINEDOWN:             // One line right.
01741             dx = nOneUnit;
01742             break;
01743
01744         case SB_LINEUP:               // One line left.
01745             dx = -nOneUnit;
01746             break;
01747
01748         case SB_PAGEDOWN:             // One page right.
01749             dx = cxClient;
01750             break;
01751
01752         case SB_PAGEUP:               // One page left.
01753             dx = -cxClient;
01754             break;
01755
01756         case SB_THUMBPOSITION:        // Absolute position.
01757             dx = wPos - xBar;
01758             break;
01759
01760         default:                      // No change.
01761             dx = 0;
01762             break;
01763     }
01764
01765     if (dx)
01766     {
01767         xBar += dx;
01768
01769         if (xBar < nMin)
01770         {
01771             dx  -= xBar - nMin;
01772             xBar = nMin;
01773         }
01774
01775         if (xBar > nMax)
01776         {
01777             dx  -= xBar - nMax;
01778             xBar = nMax;
01779         }
01780
01781         if (dx)
01782         {
01783             SetScrollPos (hWnd, nHorzOrVert, xBar, TRUE);
01784
01785             if (nHorzOrVert == SB_HORZ)
01786                 ScrollWindow (hWnd, -dx, 0, NULL, NULL);
01787             else
01788                 ScrollWindow (hWnd, 0, -dx, NULL, NULL);
01789
01790             UpdateWindow (hWnd);
01791         }
01792     }
01793 }
01794
01795 //****************************************************************************
01796 //
01797 // Function: DoPaint()
01798 //
01799 // Purpose:  Called by WndProc. Does painting for client area.
01800 //
01801 //
01802 //***************************************************************************
01803
01804 void DoPaint(HWND hWnd)
01805 {
01806     HDC             hDC, hMemDC;         // Handle to DC, memory DC
01807     PAINTSTRUCT     ps;                  // Painting structure
01808     BITMAP          bm;                  // BITMAP structure
01809     HBITMAP         hOldBm;              // Handle to previous bitmap
01810     RECT            rectClient, rectDDB; // Client and bitmap rectangles
01811     int             xScroll, yScroll;    // Scroll positions
01812     int             x, y;                // Logo origin
01813
01814
01815     // Begin painting
01816
01817     hDC = BeginPaint(hWnd, &ps);
01818
01819     // Check to see if we are displaying a bitmap
01820
01821     if (!ghBitmap)
01822     {
01823         // No bitmap yet, are we in start mode?
01824
01825         if (bStartup)
01826         {
01827             GetClientRect(hWnd, &rectClient);
01828
01829             hMemDC = CreateCompatibleDC(ps.hdc);
01830
01831             // Select our logo bitmap
01832
01833             hOldBm = SelectObject(hMemDC, ghbmLogo);
01834
01835             GetObject(ghbmLogo, sizeof(BITMAP), (VOID *)&bm);
01836
01837             x = (rectClient.right - bm.bmWidth) / 2;
01838             y = (rectClient.bottom - bm.bmHeight) / 2;
01839
01840             // Now bitblt our logo to client area
01841
01842             BitBlt(ps.hdc, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
01843                     SRCCOPY);
01844
01845             // Clean up
01846             SelectObject(hMemDC,hOldBm);
01847             DeleteDC(hMemDC);
01848         }
01849         else
01850         {
01851             // Turn off scroll bars in case they were on
01852
01853                 SetScrollRange (hWnd, SB_VERT, 0, 0, TRUE);
01854             SetScrollRange (hWnd, SB_HORZ, 0, 0, TRUE);
01855         }
01856     }
01857     else // We are displaying a bitmap
01858     {
01859         // Get bitmap info
01860
01861         GetObject(ghBitmap, sizeof(BITMAP), (LPSTR)&bm);
01862
01863         // Get scroll bar positions
01864
01865         xScroll  = GetScrollPos  (hWnd, SB_HORZ);
01866         yScroll  = GetScrollPos  (hWnd, SB_VERT);
01867
01868         // Set up the scroll bars appropriately.
01869
01870         SetupScrollBars(hWnd, (WORD)bm.bmWidth, (WORD)bm.bmHeight);
01871
01872         // Set up the necessary rectangles -- i.e. the rectangle
01873         //  we're rendering into, and the rectangle in the bitmap
01874
01875         GetClientRect (hWnd, &rectClient);
01876
01877         rectDDB.left   = xScroll;
01878         rectDDB.top    = yScroll;
01879         rectDDB.right  = xScroll + rectClient.right - rectClient.left;
01880         rectDDB.bottom = yScroll + rectClient.bottom - rectClient.top;
01881
01882         if (rectDDB.right > bm.bmWidth)
01883         {
01884             int dx;
01885
01886             dx = bm.bmWidth - rectDDB.right;
01887
01888             rectDDB.right     += dx;
01889             rectClient.right  += dx;
01890         }
01891
01892         if (rectDDB.bottom > bm.bmHeight)
01893         {
01894             int dy;
01895
01896             dy = bm.bmHeight - rectDDB.bottom;
01897
01898             rectDDB.bottom    += dy;
01899             rectClient.bottom += dy;
01900         }
01901
01902         // Go do the actual painting.
01903
01904         PaintBitmap(hDC, &rectClient, ghBitmap, &rectDDB, ghPal);
01905     }
01906
01907     EndPaint(hWnd, &ps);
01908 }
01909
01910
01911 //****************************************************************************
01912 //
01913 // Function: FrameWindow()
01914 //
01915 // Purpose:  Highlight the window frame
01916 //
01917 //
01918 //***************************************************************************
01919
01920 void FrameWindow(HWND hWnd)
01921 {
01922     HDC     hdc;
01923     RECT    rc;
01924
01925 #define DINV    3
01926
01927     if (!IsWindow(hWnd))
01928         return;
01929
01930     hdc = GetWindowDC(hWnd);
01931     GetWindowRect(hWnd, &rc);
01932     OffsetRect(&rc, -rc.left, -rc.top);
01933
01934     if (!IsRectEmpty(&rc))
01935     {
01936         PatBlt(hdc, rc.left, rc.top, rc.right-rc.left, DINV, DSTINVERT);
01937         PatBlt(hdc, rc.left, rc.bottom-DINV, DINV, -(rc.bottom-rc.top-2*DINV),
01938                 DSTINVERT);
01939         PatBlt(hdc, rc.right-DINV, rc.top+DINV, DINV, rc.bottom-rc.top-2*DINV,
01940                 DSTINVERT);
01941         PatBlt(hdc, rc.right, rc.bottom-DINV, -(rc.right-rc.left), DINV,
01942                 DSTINVERT);
01943     }
01944
01945     ReleaseDC(hWnd, hdc);
01946 }
01947
01948 //****************************************************************************
01949 //
01950 // FUNCTION: CenterWindow (HWND, HWND)
01951 //
01952 // PURPOSE:  Center one window over another
01953 //
01954 // COMMENTS:
01955 //
01956 //      Dialog boxes take on the screen position that they were designed at,
01957 //      which is not always appropriate. Centering the dialog over a particular
01958 //      window usually results in a better position.
01959 //
01960 //***************************************************************************
01961
01962 BOOL CenterWindow (HWND hwndChild, HWND hwndParent)
01963 {
01964     RECT    rChild, rParent;
01965     int     wChild, hChild, wParent, hParent;
01966     int     wScreen, hScreen, xNew, yNew;
01967     HDC     hdc;
01968
01969     // Get the Height and Width of the child window
01970     GetWindowRect (hwndChild, &rChild);
01971     wChild = rChild.right - rChild.left;
01972     hChild = rChild.bottom - rChild.top;
01973
01974     // Get the Height and Width of the parent window
01975     GetWindowRect (hwndParent, &rParent);
01976     wParent = rParent.right - rParent.left;
01977     hParent = rParent.bottom - rParent.top;
01978
01979     // Get the display limits
01980     hdc = GetDC (hwndChild);
01981     wScreen = GetDeviceCaps (hdc, HORZRES);
01982     hScreen = GetDeviceCaps (hdc, VERTRES);
01983     ReleaseDC (hwndChild, hdc);
01984
01985     // Calculate new X position, then adjust for screen
01986     xNew = rParent.left + ((wParent - wChild) /2);
01987     if (xNew < 0)
01988         xNew = 0;
01989     else if ((xNew+wChild) > wScreen)
01990         xNew = wScreen - wChild;
01991
01992     // Calculate new Y position, then adjust for screen
01993     yNew = rParent.top  + ((hParent - hChild) /2);
01994     if (yNew < 0)
01995         yNew = 0;
01996     else if ((yNew+hChild) > hScreen)
01997         yNew = hScreen - hChild;
01998
01999     // Set it, and return
02000     return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0,
02001             SWP_NOSIZE | SWP_NOZORDER);
02002 }
02003
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CProperties Member List

This is the complete list of members for CProperties, including all inherited members.
AddElement(DBPROPelement) | CVector< DBPROP > | [virtual]
AddProperty(DBPROPID dwPropertyID, const DBID &colid) | TPropBase< DBPROP > | [virtual]
Attach(DBPROPSET *pPropSet) | CProperties | [virtual]
TPropBase< DBPROP >::Attach(CVector &rVector) | CVector< DBPROP > | [virtual]
TPropBase< DBPROP >::Attach(ULONGcElements, DBPROP *rgElements) | CVector< DBPROP > | [virtual]
CProperties(DBPROPSET *pPropSet=NULL) | CProperties |
CVector(ULONGulLowerBound=0, ULONGulGrowSize=10) | CVector< DBPROP > |
Detach(DBPROPSET *pPropSet) | CProperties | [virtual]
TPropBase< DBPROP >::Detach(ULONG *pcElements, DBPROP **prgElements) | CVector< DBPROP > | [virtual]
FindProperty(DBPROPID dwPropertyID, const DBID &colid) | CProperties | [virtual]
GetCount() | CVector< DBPROP > | [inline, virtual]
GetElement(ULONGiIndex) | CVector< DBPROP > | [virtual]
GetElements() const | CVector< DBPROP > | [inline, virtual]
GetProperties() | TPropBase< DBPROP > | [inline, virtual]
InsertAt(ULONGiIndex, DBPROPelement) | CVector< DBPROP > | [virtual]
m_cElements | CVector< DBPROP > | [protected]
m_rgElements | CVector< DBPROP > | [protected]
m_ulGrowSize | CVector< DBPROP > | [protected]
m_ulLowerBound | CVector< DBPROP > | [protected]
m_ulMaxSize | CVector< DBPROP > | [protected]
operator[](ULONGiIndex) | CVector< DBPROP > | [inline, virtual]
RemoveAll() | CProperties | [virtual]
RemoveAt(ULONGiIndex) | CVector< DBPROP > | [virtual]
SetProperty(DBPROPID dwPropertyID, DBTYPE wType, void *pv, DBPROPOPTIONS dwOptions=DBPROPOPTIONS_REQUIRED, const DBID &colid=DB_NULLID) | CProperties | [virtual]
TPropBase(ULONG cElements=0, DBPROP *rgElements=NULL) | TPropBase< DBPROP > |
~CProperties() | CProperties | [virtual]
~CVector() | CVector< DBPROP > | [virtual]
~TPropBase() | TPropBase< DBPROP > | [virtual]
Generated on Wed Nov 13 2024 16:57:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTransactionOptions Member List

This is the complete list of members for CTransactionOptions, including all inherited members.
AutoQI(DWORD dwCreateOpts) | CTransactionOptions | [virtual]
AutoRelease() | CTransactionOptions | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
CTransactionOptions(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CTransactionOptions |
DisplayObject() | CBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CTransactionOptions | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CTransactionOptions | [virtual]
GetObjectDesc() | CBase | [inline, virtual]
GetObjectImage() | CTransactionOptions | [inline, virtual]
GetObjectMenu() | CTransactionOptions | [inline, virtual]
GetObjectName() | CTransactionOptions | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pITransactionOptions | CTransactionOptions |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
~CBase() | CBase | [virtual]
~CTransactionOptions() | CTransactionOptions | [virtual]
Generated on Wed Nov 13 2024 16:57:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIStream Member List

This is the complete list of members for CImpIStream, including all inherited members.
Clone(IStream **ppstm) | CImpIStream
Commit(DWORD grfCommitFlags) | CImpIStream
CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) | CImpIStream
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CStream, CImpIStream) | CImpIStream
LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) | CImpIStream
Read(void *pv, ULONG cb, ULONG *pcbRead) | CImpIStream
Revert() | CImpIStream
Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) | CImpIStream
SetSize(ULARGE_INTEGER libNewSize) | CImpIStream
Stat(STATSTG *pstatstg, DWORD grfStatFlag) | CImpIStream
UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) | CImpIStream
Write(const void *pv, ULONG cb, ULONG *pcbWritten) | CImpIStream
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/CAsyncXXX.h Source File

  • Com
  • async
  • server

CAsyncXXX.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 #if !defined(__CAsyncXXX__)
00019 #define __CAsyncXXX__
00020
00021 #include "CUnknown.h"
00022
00023
00024 typedef ISynchronize *LPSYNCHRONIZE;
00025 typedef ICallFactory *LPCALLFACTORY;
00026
00027
00028
00029 /*
00030  *  This is a general purpose helper class for Asynchronous interfaces. This class encapsulates all of
00031  *  the boiler plate code such as ICallFactory::CreateCall(), ISynchronize.
00032  *
00033  *  What you need to provide is the implemenation of the Asynchronous interface.
00034  *
00035  *  The following is an explaination of the template parameters.
00036  *
00037  *  1) The class which encapsulates the call object:    class T
00038  *  2) The class which supports the synchronous interface:  class ISyncFace
00039  *  3) The class which supports the asynchronous interface  class IAsyncFace
00040  *
00041  */
00042 template<class T, class ISyncFace, class IAsyncFace>
00043 class CAsyncXXX : public CUnknown,
00044           public IAsyncFace,
00045           public ISynchronize
00046 {
00047   friend class IAsyncFace;
00048 private:
00049   ISyncFace*    m_lpSyncface; // Back pointer to asychronous interface
00050   T*        m_lpObj;    // Back pointer to class
00051   REFIID      m_iid;      // IID of asynchronous interface
00052   LPUNKNOWN     m_lpUnkSync;  // IUnknown of the corresponding synchronous interface
00053
00054   CAsyncXXX() :CUnknown(NULL,"CAsyncXXX"), m_iid(CLSID_NULL) {};
00055
00056   CAsyncXXX(LPUNKNOWN lpUnk, REFIID iid);
00057
00058   virtual HRESULT __stdcall Init(const CFactoryData *pData);
00059   virtual HRESULT __stdcall Init(T *pT, ISyncFace *lpSyncface);
00060
00061 public:
00062
00063   /*  This class can only be instanciated by way of the below Create() method. The reason for this is there are
00064    *  are a number of items that need to be wired up in order for this to be initialized correctly. By restricting
00065    *  the instanciation to a static method call I can insure this to always be setup correctly.
00066    *
00067    *  Within the call to ICallFactory::CreateCall(REFIID riid1, LPUNKNOWN pUnkCtrl, REFIID riid2, LPUNKNOWN *ppv)
00068    *  you need to supply the following
00069    *
00070    *  1) Controlling IUnknown; COM _always_ aggreates the call object if the object and container are not within the
00071    *  same apartment. The caller still is free to pass it's own controlling unknown if it wish special handling such
00072    *  as using it's own implemenation of ISynchronize
00073    *
00074    *  2) IID of the Asynchronous interface
00075    *
00076    *  3) IID to return interface to return
00077    *
00078    *  4) Pointer to the instance of T. Currently this is not used however the intention is that some call objects may
00079    *  need to use some of the functionality of the class which has encapsulated it
00080    *
00081    *  5) Pointer to the synchronize interface. The reason for this is that some methods may be able to finish quickly.
00082    *  In this case you would want to handle the call synchronously; delegating to the synchronise interface allows you
00083    *  to do so easily.
00084    *
00085    *  Below is an example of how to instanciate a call object.
00086    *
00087    *
00088    *  *ppv = CAsyncXXX<CServer, ITest, CAsyncTest>::Create(pUnkCtrl, riid1, riid2, this, this);
00089    *
00090    *
00091    */
00092   static LPUNKNOWN __stdcall Create(LPUNKNOWN lpUnkCtrl,    // Controlling Unknown
00093                   REFIID riid1,       // IID of the asynchronous interface
00094                   REFIID riid2,       // IID of the requested interface
00095                   T *pT,            // Instance pointer of the containing class
00096                   ISyncFace *lpSyncface);   // Instance pointer of the synchronous interface
00097
00098   virtual ~CAsyncXXX();
00099
00100   // Declare the delegating IUnknown.
00101   #pragma warning(disable : 4355)
00102   DECLARE_IUNKNOWN
00103
00104   // IUnknown
00105   HRESULT __stdcall
00106     NondelegatingQueryInterface(const IID& iid, void** ppv);
00107
00108   // Notification to derived classes that we are releasing
00109   void __stdcall FinalRelease();
00110
00111   // Helper functions that IAsyncFace will use to talk to ISynchronize. These methods encapsulate the common
00112   // scenario where one QI's the call object for ISynchronize, calls one of it's methods and releases the interface
00113   HRESULT __stdcall Reset();
00114   HRESULT __stdcall Signal();
00115   HRESULT __stdcall Wait(ULONG dwFlags, ULONG dwMilliseconds);
00116
00117   __inline ISyncFace* GetISync() {return m_lpSyncface;}
00118
00119
00120 };
00121
00122
00123 #include "CAsyncXXX.cpp"
00124 #endif //__CAsyncXXX__
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/CompareEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

CompareEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: CompareEnum
00019
00020 public class CompareEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adCompareLessThan = 0;
00023   public static final short adCompareEqual = 1;
00024   public static final short adCompareGreaterThan = 2;
00025   public static final short adCompareNotEqual = 3;
00026   public static final short adCompareNotComparable = 4;
00027 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RECEIVE_CONTEXT Member List

This is the complete list of members for RECEIVE_CONTEXT, including all inherited members.
hQueue | RECEIVE_CONTEXT
ov | RECEIVE_CONTEXT
pmsgprops | RECEIVE_CONTEXT
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/SampView/ShlFldr.Cpp Source File

  • WinUI
  • Shell
  • SampView

ShlFldr.Cpp

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1998 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          ShlFldr.cpp
00013
00014    Description:   Implements CShellFolder.
00015
00016 **************************************************************************/
00017
00018 /**************************************************************************
00019    #include statements
00020 **************************************************************************/
00021
00022 #include "ShlFldr.h"
00023 #include "ShlView.h"
00024 #include "ExtrIcon.h"
00025 #include "ContMenu.h"
00026 #include "DataObj.h"
00027 #include "DropTgt.h"
00028 #include "ViewList.h"
00029 #include "Guid.h"
00030 #include "resource.h"
00031 #include <ShellApi.h>
00032 #include <shlwapi.h>
00033
00034 /**************************************************************************
00035    global variables
00036 **************************************************************************/
00037
00038 #define DEFAULT_DATA TEXT("Data")
00039
00040 extern CViewList  *g_pViewList;
00041
00042 /**************************************************************************
00043
00044    CShellFolder::CShellFolder()
00045
00046 **************************************************************************/
00047
00048 CShellFolder::CShellFolder(CShellFolder *pParent, LPCITEMIDLIST pidl)
00049 {
00050 g_DllRefCount++;
00051
00052 m_psfParent = pParent;
00053 if(m_psfParent)
00054    m_psfParent->AddRef();
00055
00056 m_pPidlMgr = new CPidlMgr();
00057 if(!m_pPidlMgr)
00058    {
00059    delete this;
00060    return;
00061    }
00062
00063 //get the shell's IMalloc pointer
00064 //we'll keep this until we get destroyed
00065 if(FAILED(SHGetMalloc(&m_pMalloc)))
00066    {
00067    delete this;
00068    return;
00069    }
00070
00071 m_pidlFQ = NULL;
00072 m_pidlRel = NULL;
00073 if(pidl)
00074    {
00075    m_pidlRel = m_pPidlMgr->Copy(pidl);
00076    }
00077
00078
00079 m_ObjRefCount = 1;
00080 }
00081
00082 /**************************************************************************
00083
00084    CShellFolder::~CShellFolder()
00085
00086 **************************************************************************/
00087
00088 CShellFolder::~CShellFolder()
00089 {
00090 if(m_pidlRel)
00091    {
00092    m_pPidlMgr->Delete(m_pidlRel);
00093    m_pidlRel = NULL;
00094    }
00095
00096 if(m_pidlFQ)
00097    {
00098    m_pPidlMgr->Delete(m_pidlFQ);
00099    m_pidlFQ = NULL;
00100    }
00101
00102 if(m_psfParent)
00103    m_psfParent->Release();
00104
00105 if(m_pMalloc)
00106    {
00107    m_pMalloc->Release();
00108    }
00109
00110 if(m_pPidlMgr)
00111    {
00112    delete m_pPidlMgr;
00113    }
00114
00115 g_DllRefCount--;
00116 }
00117
00118 ///////////////////////////////////////////////////////////////////////////
00119 //
00120 // IUnknown Implementation
00121 //
00122
00123 /**************************************************************************
00124
00125    CShellFolder::QueryInterface
00126
00127 **************************************************************************/
00128
00129 STDMETHODIMP CShellFolder::QueryInterface(REFIID riid, LPVOID *ppReturn)
00130 {
00131 *ppReturn = NULL;
00132
00133 //IUnknown
00134 if(IsEqualIID(riid, IID_IUnknown))
00135    {
00136    *ppReturn = this;
00137    }
00138
00139 //IShellFolder
00140 else if(IsEqualIID(riid, IID_IShellFolder))
00141    {
00142    *ppReturn = (IShellFolder*)this;
00143    }
00144
00145 //IPersist
00146 else if(IsEqualIID(riid, IID_IPersist))
00147    {
00148    *ppReturn = (IPersist*)this;
00149    }
00150
00151 //IPersistFolder
00152 else if(IsEqualIID(riid, IID_IPersistFolder))
00153    {
00154    *ppReturn = (IPersistFolder*)this;
00155    }
00156
00157 if(*ppReturn)
00158    {
00159    (*(LPUNKNOWN*)ppReturn)->AddRef();
00160    return S_OK;
00161    }
00162
00163 return E_NOINTERFACE;
00164 }
00165
00166 #define DC_NAME   TEXT("David Campbell")
00167 #define DC_DATA   TEXT("Really Loves Cheese")
00168
00169 /**************************************************************************
00170
00171    CShellFolder::AddRef
00172
00173 **************************************************************************/
00174
00175 STDMETHODIMP_(DWORD) CShellFolder::AddRef(VOID)
00176 {
00177 return ++m_ObjRefCount;
00178 }
00179
00180 /**************************************************************************
00181
00182    CShellFolder::Release
00183
00184 **************************************************************************/
00185
00186 STDMETHODIMP_(DWORD) CShellFolder::Release(VOID)
00187 {
00188 if(--m_ObjRefCount == 0)
00189    {
00190    delete this;
00191    return 0;
00192    }
00193
00194 return m_ObjRefCount;
00195 }
00196
00197 ///////////////////////////////////////////////////////////////////////////
00198 //
00199 // IPersist Implementation
00200 //
00201
00202 /**************************************************************************
00203
00204    CShellView::GetClassID()
00205
00206 **************************************************************************/
00207
00208 STDMETHODIMP CShellFolder::GetClassID(LPCLSID lpClassID)
00209 {
00210 *lpClassID = CLSID_SampleNameSpace;
00211
00212 return S_OK;
00213 }
00214
00215 ///////////////////////////////////////////////////////////////////////////
00216 //
00217 // IPersistFolder Implementation
00218 //
00219
00220 /**************************************************************************
00221
00222    CShellView::Initialize()
00223
00224 **************************************************************************/
00225
00226 STDMETHODIMP CShellFolder::Initialize(LPCITEMIDLIST pidlFQ)
00227 {
00228 if(m_pidlFQ)
00229    {
00230    m_pPidlMgr->Delete(m_pidlFQ);
00231    m_pidlFQ = NULL;
00232    }
00233
00234 m_pidlFQ = m_pPidlMgr->Copy(pidlFQ);
00235
00236 return S_OK;
00237 }
00238
00239 ///////////////////////////////////////////////////////////////////////////
00240 //
00241 // IShellFolder Implementation
00242 //
00243
00244 /**************************************************************************
00245
00246    CShellFolder::BindToObject()
00247
00248 **************************************************************************/
00249
00250 STDMETHODIMP CShellFolder::BindToObject(  LPCITEMIDLIST pidl,
00251                                           LPBC pbcReserved,
00252                                           REFIID riid,
00253                                           LPVOID *ppvOut)
00254 {
00255 *ppvOut = NULL;
00256
00257 //Make sure the item is a folder.
00258 ULONG ulAttribs = SFGAO_FOLDER;
00259 this->GetAttributesOf(1, &pidl, &ulAttribs);
00260 if(!(ulAttribs & SFGAO_FOLDER))
00261    return E_INVALIDARG;
00262
00263 CShellFolder   *pShellFolder = new CShellFolder(this, pidl);
00264 if(!pShellFolder)
00265    return E_OUTOFMEMORY;
00266
00267 LPITEMIDLIST   pidlTemp = m_pPidlMgr->Concatenate(m_pidlFQ, pidl);
00268 pShellFolder->Initialize(pidlTemp);
00269 m_pPidlMgr->Delete(pidlTemp);
00270
00271 HRESULT  hr = pShellFolder->QueryInterface(riid, ppvOut);
00272
00273 pShellFolder->Release();
00274
00275 return hr;
00276 }
00277
00278 /**************************************************************************
00279
00280    CShellFolder::BindToStorage()
00281
00282 **************************************************************************/
00283
00284 STDMETHODIMP CShellFolder::BindToStorage( LPCITEMIDLIST pidl,
00285                                           LPBC pbcReserved,
00286                                           REFIID riid,
00287                                           LPVOID *ppvOut)
00288 {
00289 *ppvOut = NULL;
00290
00291 return E_NOTIMPL;
00292 }
00293
00294 /**************************************************************************
00295
00296    CShellFolder::CompareIDs()
00297
00298 **************************************************************************/
00299
00300 STDMETHODIMP CShellFolder::CompareIDs( LPARAM lParam,
00301                                        LPCITEMIDLIST pidl1,
00302                                        LPCITEMIDLIST pidl2)
00303 {
00304 HRESULT        hr = E_FAIL;
00305 LPITEMIDLIST   pidlTemp1;
00306 LPITEMIDLIST   pidlTemp2;
00307
00308 //walk down the lists, comparing each individual item
00309
00310 pidlTemp1 = (LPITEMIDLIST)pidl1;
00311 pidlTemp2 = (LPITEMIDLIST)pidl2;
00312
00313 while(pidlTemp1 && pidlTemp2)
00314    {
00315    hr = CompareItems(pidlTemp1, pidlTemp2);
00316    if(HRESULT_CODE(hr))
00317       {
00318       //the items are different
00319       break;
00320       }
00321
00322    pidlTemp1 = m_pPidlMgr->GetNextItem(pidlTemp1);
00323    pidlTemp2 = m_pPidlMgr->GetNextItem(pidlTemp2);
00324
00325    if(pidlTemp1 && !pidlTemp1->mkid.cb)
00326       {
00327       pidlTemp1 = NULL;
00328       }
00329
00330    if(pidlTemp2 && !pidlTemp2->mkid.cb)
00331       {
00332       pidlTemp2 = NULL;
00333       }
00334
00335    hr = E_FAIL;
00336    }
00337
00338 if(!pidlTemp1 && pidlTemp2)
00339    {
00340    //pidl1 is at a higher level than pidl2
00341    return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(-1));
00342    }
00343 else if(pidlTemp1 && !pidlTemp2)
00344    {
00345    //pidl2 is at a higher level than pidl1
00346    return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(1));
00347    }
00348 else if(SUCCEEDED(hr))
00349    {
00350    //the items are at the same level but are different
00351    return hr;
00352    }
00353
00354 //the items are the same
00355 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
00356 }
00357
00358 /**************************************************************************
00359
00360    CShellFolder::CreateViewObject()
00361
00362 **************************************************************************/
00363
00364 STDMETHODIMP CShellFolder::CreateViewObject( HWND hwndOwner,
00365                                              REFIID riid,
00366                                              LPVOID *ppvOut)
00367 {
00368 HRESULT  hr = E_NOINTERFACE;
00369
00370 if(IsEqualIID(riid, IID_IShellView))
00371    {
00372    CShellView  *pShellView;
00373
00374    *ppvOut = NULL;
00375
00376    pShellView = new CShellView(this, m_pidlRel);
00377    if(!pShellView)
00378       return E_OUTOFMEMORY;
00379
00380    hr = pShellView->QueryInterface(riid, ppvOut);
00381
00382    pShellView->Release();
00383    }
00384 else if(IsEqualIID(riid, IID_IDropTarget))
00385    {
00386    CDropTarget *pdt = new CDropTarget(this);
00387
00388    if(pdt)
00389       {
00390       *ppvOut = pdt;
00391       return S_OK;
00392       }
00393    }
00394 else if(IsEqualIID(riid, IID_IContextMenu))
00395    {
00396    /*
00397    Create a context menu object for this folder. This can be used for the
00398    background of a view.
00399    */
00400    CContextMenu   *pcm = new CContextMenu(this);
00401
00402    if(pcm)
00403       {
00404       *ppvOut = pcm;
00405       return S_OK;
00406       }
00407    }
00408
00409
00410 return hr;
00411 }
00412
00413 /**************************************************************************
00414
00415    CShellFolder::EnumObjects()
00416
00417 **************************************************************************/
00418
00419 STDMETHODIMP CShellFolder::EnumObjects(   HWND hwndOwner,
00420                                           DWORD dwFlags,
00421                                           LPENUMIDLIST *ppEnumIDList)
00422 {
00423 *ppEnumIDList = NULL;
00424
00425 TCHAR szPath[MAX_PATH];
00426 GetPath(NULL, szPath, MAX_PATH);
00427 *ppEnumIDList = new CEnumIDList(szPath, dwFlags);
00428 if(!*ppEnumIDList)
00429    return E_OUTOFMEMORY;
00430
00431 return S_OK;
00432 }
00433
00434 /**************************************************************************
00435
00436    CShellFolder::GetAttributesOf()
00437
00438 **************************************************************************/
00439
00440 STDMETHODIMP CShellFolder::GetAttributesOf(  UINT uCount,
00441                                              LPCITEMIDLIST aPidls[],
00442                                              LPDWORD pdwAttribs)
00443 {
00444 UINT  i;
00445
00446 if(IsBadWritePtr(pdwAttribs, sizeof(DWORD)))
00447    {
00448    return E_INVALIDARG;
00449    }
00450
00451 if(0 == uCount)
00452    {
00453    /*
00454    This can happen in the Win95 shell when the view is run in rooted mode.
00455    When this occurs, return the attributes for a plain old folder.
00456    */
00457    *pdwAttribs = SFGAO_FOLDER |
00458                   SFGAO_HASSUBFOLDER |
00459                   SFGAO_BROWSABLE |
00460                   SFGAO_DROPTARGET;
00461    }
00462
00463 for(i = 0; i < uCount; i++)
00464    {
00465    DWORD dwAttribs = 0;
00466
00467    //Add the flags common to all items, if applicable.
00468    dwAttribs |= SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_CANCOPY | SFGAO_CANMOVE;
00469
00470    //is this item a folder?
00471    if(m_pPidlMgr->IsFolder(m_pPidlMgr->GetLastItem(aPidls[i])))
00472       {
00473       dwAttribs |= SFGAO_FOLDER | SFGAO_BROWSABLE | SFGAO_DROPTARGET | SFGAO_CANLINK;
00474
00475       //does this folder item have any sub folders?
00476       if(HasSubFolder(aPidls[i]))
00477          dwAttribs |= SFGAO_HASSUBFOLDER;
00478       }
00479
00480    *pdwAttribs &= dwAttribs;
00481    }
00482
00483 return S_OK;
00484 }
00485
00486 /**************************************************************************
00487
00488    CShellFolder::GetUIObjectOf()
00489
00490 **************************************************************************/
00491
00492 STDMETHODIMP CShellFolder::GetUIObjectOf( HWND hwndOwner,
00493                                           UINT uCount,
00494                                           LPCITEMIDLIST *pPidls,
00495                                           REFIID riid,
00496                                           LPUINT puReserved,
00497                                           LPVOID *ppvOut)
00498 {
00499 *ppvOut = NULL;
00500
00501 if(IsEqualIID(riid, IID_IContextMenu))
00502    {
00503    CContextMenu   *pcm = new CContextMenu(this, pPidls, uCount);
00504
00505    if(pcm)
00506       {
00507       *ppvOut = pcm;
00508       return S_OK;
00509       }
00510    }
00511
00512 else if(IsEqualIID(riid, IID_IDataObject))
00513    {
00514    CDataObject *pdo = new CDataObject(this, pPidls, uCount);
00515
00516    if(pdo)
00517       {
00518       *ppvOut = pdo;
00519       return S_OK;
00520       }
00521    }
00522
00523 if(uCount != 1)
00524    return E_INVALIDARG;
00525
00526 if(IsEqualIID(riid, IID_IExtractIcon))
00527    {
00528    CExtractIcon   *pei;
00529    LPITEMIDLIST   pidl;
00530
00531    pidl = m_pPidlMgr->Concatenate(m_pidlRel, pPidls[0]);
00532
00533    pei = new CExtractIcon(pidl);
00534
00535    /*
00536    The temp PIDL can be deleted because the new CExtractIcon either failed or
00537    made its own copy of it.
00538    */
00539    m_pPidlMgr->Delete(pidl);
00540
00541    if(pei)
00542       {
00543       *ppvOut = pei;
00544       return S_OK;
00545       }
00546
00547    return E_OUTOFMEMORY;
00548    }
00549 else if(IsEqualIID(riid, IID_IDropTarget))
00550    {
00551    CShellFolder   *psfTemp = NULL;
00552
00553    BindToObject(pPidls[0], NULL, IID_IShellFolder, (LPVOID*)&psfTemp);
00554
00555    if(psfTemp)
00556       {
00557       CDropTarget *pdt = new CDropTarget(psfTemp);
00558
00559       psfTemp->Release();
00560
00561       if(pdt)
00562          {
00563          *ppvOut = pdt;
00564          return S_OK;
00565          }
00566       }
00567    }
00568
00569 return E_NOINTERFACE;
00570 }
00571
00572 /**************************************************************************
00573
00574    CShellFolder::GetDisplayNameOf()
00575
00576 **************************************************************************/
00577
00578 STDMETHODIMP CShellFolder::GetDisplayNameOf( LPCITEMIDLIST pidl,
00579                                              DWORD dwFlags,
00580                                              LPSTRRET lpName)
00581 {
00582 TCHAR szText[MAX_PATH] = TEXT("");
00583 int   cchOleStr;
00584
00585 if(dwFlags & SHGDN_FORPARSING)
00586    {
00587    //a "path" is being requested - is it full or relative?
00588    if(dwFlags & SHGDN_INFOLDER)
00589       {
00590       //the relative path is being requested
00591       m_pPidlMgr->GetRelativeName(pidl, szText, ARRAYSIZE(szText));
00592       }
00593    else
00594       {
00595       GetFullName(pidl, szText, ARRAYSIZE(szText), dwFlags);
00596       }
00597    }
00598 else
00599    {
00600    //only the text of the last item is being requested
00601    LPITEMIDLIST   pidlLast = m_pPidlMgr->GetLastItem(pidl);
00602    m_pPidlMgr->GetRelativeName(pidlLast, szText, ARRAYSIZE(szText));
00603    }
00604
00605 //get the number of characters required
00606 cchOleStr = lstrlen(szText) + 1;
00607
00608 //allocate the wide character string
00609 lpName->pOleStr = (LPWSTR)m_pMalloc->Alloc(cchOleStr * sizeof(WCHAR));
00610 if(!lpName->pOleStr)
00611    return E_OUTOFMEMORY;
00612
00613 lpName->uType = STRRET_WSTR;
00614
00615 LocalToWideChar(lpName->pOleStr, szText, cchOleStr);
00616
00617 return S_OK;
00618 }
00619
00620 /**************************************************************************
00621
00622    CShellFolder::ParseDisplayName()
00623
00624 **************************************************************************/
00625
00626 STDMETHODIMP CShellFolder::ParseDisplayName( HWND hwndOwner,
00627                                              LPBC pbcReserved,
00628                                              LPOLESTR lpDisplayName,
00629                                              LPDWORD pdwEaten,
00630                                              LPITEMIDLIST *pPidlNew,
00631                                              LPDWORD pdwAttributes)
00632 {
00633 return E_NOTIMPL;
00634 }
00635
00636 /**************************************************************************
00637
00638    CShellFolder::SetNameOf()
00639
00640 **************************************************************************/
00641
00642 STDMETHODIMP CShellFolder::SetNameOf(  HWND hwndOwner,
00643                                        LPCITEMIDLIST pidl,
00644                                        LPCOLESTR lpName,
00645                                        DWORD dwFlags,
00646                                        LPITEMIDLIST *ppidlOut)
00647 {
00648 if(!pidl)
00649    return E_INVALIDARG;
00650
00651 if(m_pPidlMgr->IsFolder(pidl))
00652    {
00653    TCHAR          szOld[MAX_PATH];
00654    TCHAR          szNew[MAX_PATH];
00655    LPTSTR         pszTemp;
00656    LPITEMIDLIST   pidlNew;
00657    LPITEMIDLIST   pidlFQOld;
00658    LPITEMIDLIST   pidlFQNew;
00659
00660    //get the old name
00661    GetPath(pidl, szOld, MAX_PATH);
00662
00663    //build the new name
00664    GetPath(pidl, szNew, MAX_PATH);
00665    for(pszTemp = szNew + lstrlen(szNew) - 1; pszTemp > szNew; pszTemp--)
00666       {
00667       if('\\' == *pszTemp)
00668          {
00669          *(pszTemp + 1) = 0;
00670          break;
00671          }
00672       }
00673
00674    pszTemp = szNew + lstrlen(szNew);
00675    WideCharToLocal(pszTemp, (LPWSTR)lpName, MAX_PATH);
00676
00677    if(!MoveFile(szOld, szNew))
00678       {
00679       MessageBeep(MB_ICONERROR);
00680       return E_FAIL;
00681       }
00682
00683    //create a PIDL for the renamed folder using the relative name
00684    WideCharToLocal(szNew, (LPWSTR)lpName, MAX_PATH);
00685    pidlNew = m_pPidlMgr->CreateFolderPidl(szNew);
00686
00687    pidlFQOld = CreateFQPidl(pidl);
00688    pidlFQNew = CreateFQPidl(pidlNew);
00689
00690    SHChangeNotify(SHCNE_RENAMEFOLDER, SHCNF_IDLIST, pidlFQOld, pidlFQNew);
00691
00692    NotifyViews(SHCNE_RENAMEFOLDER, pidl, pidlNew);
00693
00694    if(ppidlOut)
00695       {
00696       *ppidlOut = pidlNew;
00697       }
00698    else
00699       {
00700       m_pPidlMgr->Delete(pidlNew);
00701       }
00702
00703    m_pPidlMgr->Delete(pidlFQOld);
00704    m_pPidlMgr->Delete(pidlFQNew);
00705    }
00706 else
00707    {
00708    TCHAR          szOld[MAX_PATH];
00709    TCHAR          szNew[MAX_PATH];
00710    TCHAR          szData[MAX_DATA];
00711    TCHAR          szFile[MAX_PATH];
00712    LPITEMIDLIST   pidlNew;
00713    LPITEMIDLIST   pidlFQOld;
00714    LPITEMIDLIST   pidlFQNew;
00715
00716    //get the new name
00717    WideCharToLocal(szNew, (LPWSTR)lpName, MAX_PATH);
00718
00719    //get the file name
00720    GetPath(pidl, szFile, MAX_PATH);
00721
00722    //get the old item name
00723    m_pPidlMgr->GetName(pidl, szOld, MAX_PATH);
00724
00725    //get the old item's data
00726    m_pPidlMgr->GetData(pidl, szData, MAX_PATH);
00727
00728    //remove the old entry from the INI file
00729    WritePrivateProfileString( c_szSection,
00730                               szOld,
00731                               NULL,
00732                               szFile);
00733
00734    //add the new entry into the INI file
00735    WritePrivateProfileString( c_szSection,
00736                               szNew,
00737                               szData,
00738                               szFile);
00739
00740    m_pPidlMgr->GetData(pidl, szData, MAX_DATA);
00741    pidlNew = m_pPidlMgr->CreateItemPidl(szNew, szData);
00742
00743    pidlFQOld = CreateFQPidl(pidl);
00744    pidlFQNew = CreateFQPidl(pidlNew);
00745
00746    SHChangeNotify(SHCNE_RENAMEITEM, SHCNF_IDLIST, pidlFQOld, pidlFQNew);
00747
00748    NotifyViews(SHCNE_RENAMEITEM, pidl, pidlNew);
00749
00750    if(0 == lstrcmpi(szNew, DC_NAME))
00751       {
00752       SetItemData((LPCITEMIDLIST)pidlNew, DC_DATA);
00753       }
00754
00755    if(ppidlOut)
00756       {
00757       *ppidlOut = pidlNew;
00758       m_pPidlMgr->Delete((LPITEMIDLIST)pidl);
00759       }
00760    else
00761       {
00762       m_pPidlMgr->Delete(pidlNew);
00763       }
00764
00765    m_pPidlMgr->Delete(pidlFQOld);
00766    m_pPidlMgr->Delete(pidlFQNew);
00767    }
00768
00769 return S_OK;
00770 }
00771
00772 /**************************************************************************
00773
00774    CShellFolder::AddFolder()
00775
00776 **************************************************************************/
00777
00778 STDMETHODIMP CShellFolder::AddFolder(LPCTSTR pszName, LPITEMIDLIST *ppidlOut)
00779 {
00780 HRESULT  hr = E_FAIL;
00781
00782 //create a folder
00783 TCHAR szFolder[MAX_PATH] = TEXT("");
00784
00785 if(m_pidlRel)
00786    {
00787    GetPath(NULL, szFolder, MAX_PATH);
00788    }
00789 else
00790    {
00791    lstrcpyn(szFolder, g_szStoragePath, ARRAYSIZE(szFolder));
00792    }
00793
00794 SmartAppendBackslash(szFolder, ARRAYSIZE(szFolder));
00795 StrCatBuff(szFolder, pszName, ARRAYSIZE(szFolder));
00796
00797 if(ppidlOut)
00798    *ppidlOut = NULL;
00799
00800 if(CreateDirectory(szFolder, NULL))
00801    {
00802    LPITEMIDLIST   pidl;
00803
00804    //set the attributes that define one of our folders
00805    DWORD dwAttr = GetFileAttributes(szFolder);
00806    SetFileAttributes(szFolder, dwAttr | FILTER_ATTRIBUTES);
00807
00808    //add an empty items.ini file because this also defines one of our folders
00809    TCHAR szFile[MAX_PATH];
00810    lstrcpyn(szFile, szFolder, ARRAYSIZE(szFile));
00811    SmartAppendBackslash(szFile, ARRAYSIZE(szFile));
00812    StrCatBuff(szFile, c_szDataFile, ARRAYSIZE(szFile));
00813    HANDLE   hFile;
00814    hFile = CreateFile(  szFile,
00815                         GENERIC_WRITE,
00816                         0,
00817                         NULL,
00818                         CREATE_ALWAYS,
00819                         FILE_ATTRIBUTE_NORMAL,
00820                         NULL);
00821    CloseHandle(hFile);
00822
00823    pidl = m_pPidlMgr->CreateFolderPidl(pszName);
00824    if(pidl)
00825       {
00826       LPITEMIDLIST   pidlFQ;
00827
00828       hr = S_OK;
00829
00830       pidlFQ = CreateFQPidl(pidl);
00831
00832       SHChangeNotify(SHCNE_MKDIR, SHCNF_IDLIST, pidlFQ, NULL);
00833
00834       NotifyViews(SHCNE_MKDIR, pidl, NULL);
00835
00836       m_pPidlMgr->Delete(pidlFQ);
00837
00838       if(ppidlOut)
00839          *ppidlOut = pidl;
00840       else
00841          m_pPidlMgr->Delete(pidl);
00842       }
00843    }
00844
00845 return hr;
00846 }
00847
00848 /**************************************************************************
00849
00850    CShellFolder::AddItem()
00851
00852 **************************************************************************/
00853
00854 STDMETHODIMP CShellFolder::AddItem( LPCTSTR pszName,
00855                                     LPCTSTR pszData,
00856                                     LPITEMIDLIST *ppidlOut)
00857 {
00858 if(ppidlOut)
00859    *ppidlOut = NULL;
00860
00861 //create an item
00862 HRESULT  hr = E_FAIL;
00863 TCHAR    szFile[MAX_PATH];
00864 LPCTSTR  psz = DEFAULT_DATA;
00865
00866 if(pszData && *pszData)
00867    psz = pszData;
00868
00869 //get the file name
00870 if(m_pidlRel)
00871    {
00872    GetPath(NULL, szFile, MAX_PATH);
00873    }
00874 else
00875    {
00876    lstrcpyn(szFile, g_szStoragePath, ARRAYSIZE(szFile));
00877    }
00878
00879 SmartAppendBackslash(szFile, ARRAYSIZE(szFile));
00880 StrCatBuff(szFile, c_szDataFile, ARRAYSIZE(szFile));
00881
00882 //add the new entry into the INI file
00883 if(WritePrivateProfileString( c_szSection,
00884                               pszName,
00885                               DEFAULT_DATA,
00886                               szFile))
00887    {
00888    LPITEMIDLIST   pidl;
00889
00890    pidl = m_pPidlMgr->CreateItemPidl(pszName, psz);
00891    if(pidl)
00892       {
00893       LPITEMIDLIST   pidlFQ;
00894
00895       hr = S_OK;
00896
00897       pidlFQ = CreateFQPidl(pidl);
00898
00899       SHChangeNotify(SHCNE_CREATE, SHCNF_IDLIST, pidlFQ, NULL);
00900
00901       NotifyViews(SHCNE_CREATE, pidl, NULL);
00902
00903       m_pPidlMgr->Delete(pidlFQ);
00904
00905       if(ppidlOut)
00906          *ppidlOut = pidl;
00907       else
00908          m_pPidlMgr->Delete(pidl);
00909       }
00910    }
00911
00912 return hr;
00913 }
00914
00915 /**************************************************************************
00916
00917    CShellFolder::SetItemData()
00918
00919 **************************************************************************/
00920
00921 STDMETHODIMP CShellFolder::SetItemData(LPCITEMIDLIST pidl, LPCTSTR pszData)
00922 {
00923 BOOL  fResult;
00924
00925 if(m_pPidlMgr->IsFolder(pidl))
00926    {
00927    return E_INVALIDARG;
00928    }
00929
00930 if(!pszData)
00931    fResult = m_pPidlMgr->SetData(pidl, TEXT(""));
00932 else
00933    fResult = m_pPidlMgr->SetData(pidl, pszData);
00934
00935 TCHAR szName[MAX_PATH];
00936 TCHAR szFile[MAX_PATH];
00937
00938 //get the file name
00939 GetPath(pidl, szFile, MAX_PATH);
00940
00941 //get the old item name
00942 m_pPidlMgr->GetName(pidl, szName, MAX_PATH);
00943
00944 //change/add the name in the INI file
00945 WritePrivateProfileString( c_szSection,
00946                            szName,
00947                            pszData,
00948                            szFile);
00949
00950 NotifyViews(SHCNE_UPDATEITEM, pidl, NULL);
00951
00952 return fResult ? S_OK : E_FAIL;
00953 }
00954
00955 /**************************************************************************
00956
00957    CShellFolder::GetFullName()
00958
00959 **************************************************************************/
00960
00961 VOID CShellFolder::GetFullName(  LPCITEMIDLIST pidl,
00962                                  LPTSTR pszText,
00963                                  DWORD dwSize,
00964                                  DWORD dwFlags)
00965 {
00966 *pszText = 0;
00967
00968 //Get the name of our fully-qualified PIDL from the desktop folder.
00969 IShellFolder   *psfDesktop = NULL;
00970 SHGetDesktopFolder(&psfDesktop);
00971 if(psfDesktop)
00972    {
00973    STRRET   str;
00974    if(SUCCEEDED(psfDesktop->GetDisplayNameOf(   m_pidlFQ,
00975                                                 dwFlags,
00976                                                 &str)))
00977       {
00978       GetTextFromSTRRET(m_pMalloc, &str, m_pidlFQ, pszText, dwSize);
00979       if(*pszText)
00980          {
00981          SmartAppendBackslash(pszText, dwSize);
00982          }
00983       }
00984
00985    psfDesktop->Release();
00986    }
00987
00988 //add the current item's text
00989 m_pPidlMgr->GetRelativeName(  pidl,
00990                               pszText + lstrlen(pszText),
00991                               dwSize - lstrlen(pszText));
00992 }
00993
00994 /**************************************************************************
00995
00996    CShellFolder::GetUniqueName()
00997
00998 **************************************************************************/
00999
01000 #define NEW_FOLDER_NAME TEXT("New Folder")
01001 #define NEW_ITEM_NAME TEXT("New Item")
01002
01003 STDMETHODIMP CShellFolder::GetUniqueName(BOOL fFolder, LPTSTR pszName, DWORD dwSize)
01004 {
01005 HRESULT  hr;
01006 IEnumIDList *pEnum = NULL;
01007 LPTSTR pszTemp;
01008
01009 if(fFolder)
01010    {
01011    pszTemp = NEW_FOLDER_NAME;
01012    }
01013 else
01014    {
01015    pszTemp = NEW_ITEM_NAME;
01016    }
01017
01018 hr = EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &pEnum);
01019
01020 if(pEnum)
01021    {
01022    BOOL  fUnique = FALSE;
01023
01024    lstrcpyn(pszName, pszTemp, dwSize);
01025
01026    while(!fUnique)
01027       {
01028       //see if this name already exists in this folder
01029       LPITEMIDLIST   pidl;
01030       DWORD          dwFetched;
01031       int            i = 1;
01032 next:
01033       pEnum->Reset();
01034
01035       while((S_OK == pEnum->Next(1, &pidl, &dwFetched)) && dwFetched)
01036          {
01037          STRRET   str;
01038          TCHAR    szText[MAX_PATH];
01039
01040          GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str);
01041
01042          GetTextFromSTRRET(m_pMalloc, &str, pidl, szText, MAX_PATH);
01043
01044          if(0 == lstrcmpi(szText, pszName))
01045             {
01046             wsprintf(pszName, TEXT("%s %d"), pszTemp, i++);
01047             goto next;
01048             }
01049          }
01050       fUnique = TRUE;
01051       }
01052
01053    pEnum->Release();
01054    }
01055
01056 return hr;
01057 }
01058
01059 /**************************************************************************
01060
01061    CShellFolder::CreateFQPidl()
01062
01063 **************************************************************************/
01064
01065 LPITEMIDLIST CShellFolder::CreateFQPidl(LPCITEMIDLIST pidl)
01066 {
01067 return m_pPidlMgr->Concatenate(m_pidlFQ, pidl);
01068 }
01069
01070 /**************************************************************************
01071
01072    CShellFolder::GetPath()
01073
01074 **************************************************************************/
01075
01076 VOID CShellFolder::GetPath(LPCITEMIDLIST pidl, LPTSTR pszPath, DWORD dwSize)
01077 {
01078 CShellFolder   **ppsf;
01079 CShellFolder   *psfCurrent;
01080 int            nCount;
01081
01082 *pszPath = 0;
01083
01084 //we need the number of parent items in the chain
01085 for(nCount = 0, psfCurrent = this; psfCurrent; nCount++)
01086    {
01087    psfCurrent = psfCurrent->m_psfParent;
01088    }
01089
01090 ppsf = (CShellFolder**)m_pMalloc->Alloc(nCount * sizeof(CShellFolder*));
01091 if(ppsf)
01092    {
01093    int   i;
01094
01095    //fill in the interface pointer array
01096    for(i = 0, psfCurrent = this; i < nCount; i++)
01097       {
01098       *(ppsf + i) = psfCurrent;
01099       psfCurrent = psfCurrent->m_psfParent;
01100       }
01101
01102    //Get the name of the root of our storage.
01103    lstrcpyn(pszPath, g_szStoragePath, dwSize);
01104    SmartAppendBackslash(pszPath, dwSize);
01105
01106    /*
01107    Starting at the top of the parent chain, walk down, getting the text for
01108    each folder's PIDL.
01109    */
01110    for(i = nCount - 1; i >= 0; i--)
01111       {
01112       psfCurrent = *(ppsf + i);
01113       if(psfCurrent)
01114          {
01115          LPTSTR   pszCurrent = pszPath + lstrlen(pszPath);
01116          DWORD    dwCurrentSize = dwSize - lstrlen(pszPath);
01117
01118          m_pPidlMgr->GetRelativeName(  psfCurrent->m_pidlRel,
01119                                        pszCurrent,
01120                                        dwCurrentSize);
01121          SmartAppendBackslash(pszPath, dwSize);
01122          }
01123       }
01124
01125    //add the item's path
01126    if(pidl)
01127       {
01128       if(m_pPidlMgr->IsFolder(pidl))
01129          {
01130          m_pPidlMgr->GetRelativeName(pidl, pszPath + lstrlen(pszPath),
01131             dwSize - lstrlen(pszPath));
01132          }
01133       else
01134          {
01135          lstrcpyn(   pszPath + lstrlen(pszPath),
01136                      c_szDataFile,
01137                      dwSize - lstrlen(pszPath));
01138          }
01139       }
01140
01141    m_pMalloc->Free(ppsf);
01142    }
01143 }
01144
01145 /**************************************************************************
01146
01147    CShellFolder::HasSubFolder()
01148
01149 **************************************************************************/
01150
01151 BOOL CShellFolder::HasSubFolder(LPCITEMIDLIST pidl)
01152 {
01153 TCHAR             szPath[MAX_PATH];
01154 TCHAR             szTemp[MAX_PATH];
01155 HANDLE            hFind;
01156 WIN32_FIND_DATA   wfd;
01157 BOOL              fReturn = FALSE;
01158
01159 if(!m_pPidlMgr->IsFolder(pidl))
01160    return FALSE;
01161
01162 GetPath(pidl, szPath, MAX_PATH);
01163 lstrcpyn(szTemp, szPath, ARRAYSIZE(szTemp));
01164 SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
01165 StrCatBuff(szTemp, TEXT("*.*"), ARRAYSIZE(szTemp));
01166
01167 hFind = FindFirstFile(szTemp, &wfd);
01168
01169 if(INVALID_HANDLE_VALUE != hFind)
01170    {
01171    do
01172       {
01173       if((FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes) &&
01174          ((wfd.dwFileAttributes & FILTER_ATTRIBUTES) == FILTER_ATTRIBUTES) &&
01175          lstrcmpi(wfd.cFileName, TEXT(".")) &&
01176          lstrcmpi(wfd.cFileName, TEXT("..")))
01177          {
01178          //We found one of our directories. Make sure it contains a data file.
01179
01180          //build the path of the directory or file found
01181          lstrcpyn(szTemp, szPath, ARRAYSIZE(szTemp));
01182          SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
01183          StrCatBuff(szTemp, wfd.cFileName, ARRAYSIZE(szTemp));
01184          SmartAppendBackslash(szTemp, ARRAYSIZE(szTemp));
01185          StrCatBuff(szTemp, c_szDataFile, ARRAYSIZE(szTemp));
01186          HANDLE   hDataFile = FindFirstFile(szTemp, &wfd);
01187          if(INVALID_HANDLE_VALUE != hDataFile)
01188             {
01189             fReturn = TRUE;
01190             FindClose(hDataFile);
01191             break;
01192             }
01193          }
01194       }
01195    while(FindNextFile(hFind, &wfd));
01196
01197    FindClose(hFind);
01198    }
01199
01200 return fReturn;
01201 }
01202
01203 /**************************************************************************
01204
01205    CShellFolder::DeleteItems()
01206
01207 **************************************************************************/
01208
01209 STDMETHODIMP CShellFolder::DeleteItems(LPITEMIDLIST *aPidls, UINT uCount)
01210 {
01211 HRESULT  hr = E_FAIL;
01212 UINT     i;
01213
01214 for(i = 0; i < uCount; i++)
01215    {
01216    if(m_pPidlMgr->IsFolder(aPidls[i]))
01217       {
01218       TCHAR szPath[MAX_PATH];
01219
01220       GetPath(aPidls[i], szPath, MAX_PATH);
01221
01222       DeleteDirectory(szPath);
01223
01224       LPITEMIDLIST   pidlFQ = CreateFQPidl(aPidls[i]);
01225
01226       SHChangeNotify(SHCNE_RMDIR, SHCNF_IDLIST, pidlFQ, NULL);
01227
01228       NotifyViews(SHCNE_RMDIR, aPidls[i], NULL);
01229
01230       m_pPidlMgr->Delete(pidlFQ);
01231
01232       hr = S_OK;
01233       }
01234    else
01235       {
01236       TCHAR szFile[MAX_PATH];
01237       TCHAR szName[MAX_NAME];
01238
01239       //get the file name
01240       GetPath(aPidls[i], szFile, MAX_PATH);
01241
01242       //get the item name
01243       m_pPidlMgr->GetName(aPidls[i], szName, MAX_NAME);
01244
01245       //remove the entry from the INI file
01246       WritePrivateProfileString( c_szSection,
01247                                  szName,
01248                                  NULL,
01249                                  szFile);
01250
01251       LPITEMIDLIST   pidlFQ = CreateFQPidl(aPidls[i]);
01252
01253       SHChangeNotify(SHCNE_DELETE, SHCNF_IDLIST, pidlFQ, NULL);
01254
01255       NotifyViews(SHCNE_DELETE, aPidls[i], NULL);
01256
01257       m_pPidlMgr->Delete(pidlFQ);
01258
01259       hr = S_OK;
01260       }
01261    }
01262
01263 return hr;
01264 }
01265
01266 /**************************************************************************
01267
01268    CShellFolder::CopyItems()
01269
01270 **************************************************************************/
01271
01272 STDMETHODIMP CShellFolder::CopyItems(  CShellFolder *psfSource,
01273                                        LPITEMIDLIST *aPidls,
01274                                        UINT uCount)
01275 {
01276 HRESULT  hr = E_FAIL;
01277 TCHAR    szFromFolder[MAX_PATH];
01278 TCHAR    szToFolder[MAX_PATH];
01279 UINT     i;
01280
01281 //get the storage path of the folder being copied from
01282 psfSource->GetPath(NULL, szFromFolder, MAX_PATH);
01283 SmartAppendBackslash(szFromFolder, ARRAYSIZE(szFromFolder));
01284
01285 //get the storage path of the folder being copied to
01286 this->GetPath(NULL, szToFolder, MAX_PATH);
01287 SmartAppendBackslash(szToFolder, ARRAYSIZE(szToFolder));
01288
01289 for(i = 0; i < uCount; i++)
01290    {
01291    TCHAR    szFrom[MAX_PATH];
01292    TCHAR    szTo[MAX_PATH];
01293
01294    lstrcpyn(szFrom, szFromFolder, ARRAYSIZE(szFrom));
01295
01296    lstrcpyn(szTo, szToFolder, ARRAYSIZE(szTo));
01297
01298    if(m_pPidlMgr->IsFolder(aPidls[i]))
01299       {
01300       LPTSTR   pszTemp;
01301       pszTemp = szFrom + lstrlen(szFrom);
01302       m_pPidlMgr->GetRelativeName(aPidls[i], pszTemp, MAX_PATH - lstrlen(szFrom));
01303
01304       SmartAppendBackslash(szTo, ARRAYSIZE(szTo));
01305
01306       //need to double NULL terminate the names
01307       *(szFrom + lstrlen(szFrom) + 1) = 0;
01308       *(szTo + lstrlen(szTo) + 1) = 0;
01309
01310       SHFILEOPSTRUCT sfi;
01311       sfi.hwnd = NULL;
01312       sfi.wFunc = FO_COPY;
01313       sfi.pFrom = szFrom;
01314       sfi.pTo = szTo;
01315       sfi.fFlags = FOF_NOCONFIRMMKDIR | FOF_SILENT;
01316
01317       if(0 == SHFileOperation(&sfi))
01318          {
01319          LPITEMIDLIST   pidlFQ;
01320
01321          pidlFQ = CreateFQPidl(aPidls[i]);
01322
01323          SHChangeNotify(SHCNE_MKDIR, SHCNF_IDLIST, pidlFQ, NULL);
01324
01325          NotifyViews(SHCNE_MKDIR, aPidls[i], NULL);
01326
01327          m_pPidlMgr->Delete(pidlFQ);
01328
01329          hr = S_OK;
01330          }
01331       }
01332    else
01333       {
01334       TCHAR szName[MAX_NAME];
01335       TCHAR szData[MAX_DATA];
01336
01337       StrCatBuff(szFrom, c_szDataFile, ARRAYSIZE(szFrom));
01338       StrCatBuff(szTo, c_szDataFile, ARRAYSIZE(szTo));
01339
01340       m_pPidlMgr->GetRelativeName(aPidls[i], szName, MAX_NAME);
01341
01342       if(GetPrivateProfileString(c_szSection, szName, TEXT(""), szData, MAX_DATA, szFrom))
01343          {
01344          //add the entry to the destination
01345          if(WritePrivateProfileString(c_szSection, szName, szData, szTo))
01346             {
01347             LPITEMIDLIST   pidlFQ;
01348
01349             //remove the entry from the source
01350             WritePrivateProfileString(c_szSection, szName, NULL, szFrom);
01351
01352             pidlFQ = CreateFQPidl(aPidls[i]);
01353
01354             SHChangeNotify(SHCNE_CREATE, SHCNF_IDLIST, pidlFQ, NULL);
01355
01356             NotifyViews(SHCNE_CREATE, aPidls[i], NULL);
01357
01358             m_pPidlMgr->Delete(pidlFQ);
01359
01360             hr = S_OK;
01361             }
01362          }
01363       }
01364    }
01365
01366 return hr;
01367 }
01368
01369 /**************************************************************************
01370
01371    CShellFolder::NotifyViews()
01372
01373    This function is used to notify any existing views that something has
01374    changed. This is necessary because there is no public way to register for
01375    change notifications that get generated in response to SHChangeNotify.
01376    Each CShellView adds itself to g_pViewList when it gets created and
01377    removes itself from g_pViewList when it is destroyed.
01378
01379 **************************************************************************/
01380
01381 VOID CShellFolder::NotifyViews(  DWORD dwType,
01382                                  LPCITEMIDLIST pidlOld,
01383                                  LPCITEMIDLIST pidlNew)
01384 {
01385 IShellFolder   *psfDesktop;
01386
01387 SHGetDesktopFolder(&psfDesktop);
01388
01389 if(psfDesktop)
01390    {
01391    if(g_pViewList)
01392       {
01393       CShellView  *pView;
01394
01395       pView = g_pViewList->GetNextView(NULL);
01396       while(pView)
01397          {
01398          LPITEMIDLIST   pidlView = pView->GetFQPidl();
01399
01400          //is this view a view of this folder?
01401          HRESULT  hr;
01402          hr = psfDesktop->CompareIDs(0, m_pidlFQ, pidlView);
01403          if(SUCCEEDED(hr) && 0 == HRESULT_CODE(hr))
01404             {
01405             switch(dwType)
01406                {
01407                case SHCNE_MKDIR:
01408                case SHCNE_CREATE:
01409                   pView->AddItem(pidlOld);
01410                   break;
01411
01412                case SHCNE_RMDIR:
01413                case SHCNE_DELETE:
01414                   pView->DeleteItem(pidlOld);
01415                   break;
01416
01417                case SHCNE_RENAMEFOLDER:
01418                case SHCNE_RENAMEITEM:
01419                   pView->RenameItem(pidlOld, pidlNew);
01420                   break;
01421
01422                case SHCNE_UPDATEITEM:
01423                   pView->UpdateData(pidlOld);
01424                   break;
01425                }
01426             }
01427          pView = g_pViewList->GetNextView(pView);
01428          }
01429       }
01430    psfDesktop->Release();
01431    }
01432 }
01433
01434 /**************************************************************************
01435
01436    CShellFolder::CompareItems()
01437
01438 **************************************************************************/
01439
01440 STDMETHODIMP CShellFolder::CompareItems(  LPCITEMIDLIST pidl1,
01441                                           LPCITEMIDLIST pidl2)
01442 {
01443 TCHAR szString1[MAX_PATH] = TEXT("");
01444 TCHAR szString2[MAX_PATH] = TEXT("");
01445
01446 /*
01447 Special case - If one of the items is a folder and the other is an item, always
01448 make the folder come before the item.
01449 */
01450 if(m_pPidlMgr->IsFolder(pidl1) != m_pPidlMgr->IsFolder(pidl2))
01451    {
01452    return MAKE_HRESULT( SEVERITY_SUCCESS,
01453                         0,
01454                         USHORT(m_pPidlMgr->IsFolder(pidl1) ? -1 : 1));
01455    }
01456
01457 m_pPidlMgr->GetRelativeName(pidl1, szString1, ARRAYSIZE(szString1));
01458 m_pPidlMgr->GetRelativeName(pidl2, szString2, ARRAYSIZE(szString2));
01459
01460 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(lstrcmpi(szString1, szString2)));
01461 }
01462
Generated on Wed Nov 13 2024 16:52:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_CUSTOM_ENTRY_DATA_SAMPLE_ Member List

This is the complete list of members for _CUSTOM_ENTRY_DATA_SAMPLE_, including all inherited members.
ptEntry | _CUSTOM_ENTRY_DATA_SAMPLE_
szEntryName | _CUSTOM_ENTRY_DATA_SAMPLE_
szPhoneBookPath | _CUSTOM_ENTRY_DATA_SAMPLE_
tEntryDlg | _CUSTOM_ENTRY_DATA_SAMPLE_
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/server/cfactory.cpp Source File

  • Com
  • async
  • server

cfactory.cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #include <objbase.h>
00018
00019 #include "Registry.h"
00020 #include "CFactory.h"
00021 #include "Debug.h"
00022
00023
00024 ///////////////////////////////////////////////////////////
00025 //
00026 // Static variables
00027 //
00028 long CFactory::s_cServerLocks = 0;    // Count of locks
00029
00030 #if 1 // defined(_DLL_SERVER_)
00031 extern DWORD g_dwTLS;
00032 // extern HMODULE g_hModule;
00033 #endif
00034
00035 extern CFactoryData g_FactoryDataArray[];
00036 extern int g_cFactoryDataEntries;
00037 extern CLSID g_clsid;
00038 extern LPOLESTR g_progID;
00039 extern HANDLE g_CloseEvent;
00040 extern HMODULE g_hModule;
00041
00042
00043 //
00044 // Forward defines
00045 //
00046
00047 ///////////////////////////////////////////////////////////
00048 //
00049 // CFactory implementation
00050 //
00051 CFactory::CFactory(const CFactoryData* pFactoryData)
00052 : m_cRef(0), m_pFactoryData(pFactoryData)
00053 {
00054   DEBUGTRACE(_T("In CFactory ctor"));
00055   _ASSERT(m_pFactoryData);
00056   g_clsid = *m_pFactoryData->m_pCLSID;
00057   g_progID = m_pFactoryData->m_szProgID;
00058 }
00059
00060
00061 CFactory::~CFactory()
00062 {
00063   DEBUGTRACE(_T("In CFactory dtor"));
00064 }
00065
00066 //
00067 // IUnknown implementation
00068 //
00069 HRESULT __stdcall CFactory::QueryInterface(REFIID iid, void** ppv)
00070 {
00071 #if defined(_DEBUG)
00072   LPWSTR lpstrIID;
00073   StringFromIID(iid, &lpstrIID);
00074   DEBUGTRACE(_TEXT("IClassFactory::QueryInterface has been asked for %S"), lpstrIID);
00075   CoTaskMemFree(lpstrIID);
00076 #endif
00077   CHECKPOINTER(ppv);
00078
00079   if ((iid == IID_IUnknown) || (iid == IID_IClassFactory))
00080   {
00081     *ppv = this;
00082   }
00083   else
00084   {
00085     *ppv = NULL;
00086     return E_NOINTERFACE;
00087   }
00088   static_cast<LPUNKNOWN>(*ppv)->AddRef();
00089   return S_OK;
00090 }
00091
00092 ULONG __stdcall CFactory::AddRef()
00093 {
00094   return InterlockedIncrement(&m_cRef);
00095 }
00096
00097 ULONG __stdcall CFactory::Release()
00098 {
00099   if (InterlockedDecrement(&m_cRef) == 0)
00100   {
00101     delete this;
00102     return 0;
00103   }
00104   return m_cRef;
00105 }
00106
00107 //
00108 // IClassFactory implementation
00109 //
00110 HRESULT __stdcall CFactory::CreateInstance(IUnknown* pUnknownOuter,
00111                                            const IID& iid,
00112                                            void** ppv)
00113 {
00114   DEBUGTRACE(_T("In IClassFactory::CreateInstance"));
00115   HRESULT hr;
00116   CHECKPOINTER(ppv);
00117
00118   // Aggregate only if the requested IID is IID_IUnknown.
00119   if ((pUnknownOuter != NULL) && (iid != IID_IUnknown))
00120   {
00121     hr = CLASS_E_NOAGGREGATION;
00122     goto END;
00123   }
00124
00125   _ASSERT(m_pFactoryData->version == MAKEVERSION(1, 0));
00126
00127   // Create the component.
00128   CUnknown* pNewComponent;
00129   hr = m_pFactoryData->CreateInstance(pUnknownOuter, &pNewComponent);
00130
00131   if (FAILED(hr))
00132   {
00133     goto END;
00134   }
00135
00136   // Initialize the component.
00137   pNewComponent->NondelegatingAddRef();
00138   hr = pNewComponent->Init(m_pFactoryData);
00139   if (SUCCEEDED(hr))
00140   {
00141     // Get the requested interface.
00142     hr = pNewComponent->NondelegatingQueryInterface(iid, ppv);
00143   }
00144   pNewComponent->NondelegatingRelease();
00145 END:
00146   DEBUGTRACE(_T("IClassFactory::CreateInstance returning [%X]"), hr);
00147   return hr ;
00148 }
00149
00150
00151 // LockServer
00152 HRESULT __stdcall CFactory::LockServer(BOOL bLock)
00153 {
00154   DEBUGTRACE(_T("IClassFactory::LockServer called with bLock = [%s]"), bLock ? "TRUE" : "FALSE");
00155   if (bLock)
00156   {
00157     InterlockedIncrement(&s_cServerLocks);
00158 #if !defined(_DLL_SERVER_)
00159     CoAddRefServerProcess();
00160 #endif // _DLL_SERVER_
00161   }
00162   else
00163   {
00164     InterlockedDecrement(&s_cServerLocks);
00165 #if !defined(_DLL_SERVER_)
00166     if (CoReleaseServerProcess() == 0) // Last reference to server time to cleanup and exit
00167 #if defined(_APARTMENT_)
00168       PostQuitMessage(0);
00169 #else // Free Threaded
00170       SetEvent(g_CloseEvent);
00171 #endif // _APARTMENT_
00172 #endif // _DLL_SERVER_
00173   }
00174   return S_OK;
00175 }
00176
00177 //
00178 // Register all components.
00179 //
00180 HRESULT CFactory::RegisterAll()
00181 {
00182   HRESULT hr;
00183   for(int i = 0 ; i < g_cFactoryDataEntries ; i++)
00184     if (FAILED(hr = RegisterServer(g_hModule, g_FactoryDataArray[i])))
00185       break;
00186   return hr;
00187 }
00188
00189 HRESULT CFactory::UnregisterAll()
00190 {
00191   HRESULT hr;
00192   for(int i = 0 ; i < g_cFactoryDataEntries ; i++)
00193     if (FAILED(hr = UnregisterServer(g_hModule, g_FactoryDataArray[i])))
00194       break;
00195   return hr;
00196 }
00197
00198 #if defined(_DLL_SERVER_)
00199 #error("_DLL_SERVER_ defined")
00200 ///////////////////////////////////////////////////////////
00201 //
00202 // GetClassObject
00203 //   - Create a class factory based on a CLSID.
00204 //
00205 HRESULT CFactory::GetClassObject(const CLSID& clsid,
00206                                  const IID& iid,
00207                                  void** ppv)
00208 {
00209   DEBUGTRACE(_T("In CFactory::GetClassObject"));
00210   HRESULT hr;
00211   CHECKPOINTER(ppv);
00212
00213   if ((iid != IID_IUnknown) && (iid != IID_IClassFactory))
00214   {
00215     hr = E_NOINTERFACE ;
00216     goto END;
00217   }
00218
00219   // Traverse the array of data looking for this class ID.
00220   int i;
00221   for (i = 0; i < g_cFactoryDataEntries; i++)
00222   {
00223     const CFactoryData* pData = &g_FactoryDataArray[i] ;
00224     if (pData->IsClassID(clsid))
00225     {
00226       // Found the ClassID in the array of components we can
00227       // create.  So create a class factory for this component.
00228       // Pass the CFactoryData structure to the class factory
00229       // so that it knows what kind of components to create.
00230       *ppv = (IUnknown*) new CFactory(pData) ;
00231       if (*ppv == NULL)
00232       {
00233         hr = E_OUTOFMEMORY ;
00234         goto END;
00235       }
00236       return NOERROR ;
00237     }
00238   }
00239   hr = CLASS_E_CLASSNOTAVAILABLE ;
00240 END:
00241   DEBUGTRACE(_T("CFactory::GetClassObject returning [%X]"), hr);
00242   return hr;
00243 }
00244
00245
00246 //
00247 // Determine if the component can be unloaded.
00248 //
00249 HRESULT CFactory::CanUnloadNow()
00250 {
00251   if (CUnknown::ActiveComponents() || IsLocked())
00252   {
00253     DEBUGTRACE(_T("CFactory::CanUnloadNow returning S_FALSE"));
00254     return S_FALSE ;
00255   }
00256   else
00257   {
00258     DEBUGTRACE(_T("CFactory::CanUnloadNow returning S_OK"));
00259     return S_OK ;
00260   }
00261 }
00262
00263 //////////////////////////////////////////////////////////
00264 //
00265 // Exported functions
00266 //
00267
00268 STDAPI DllCanUnloadNow()
00269 {
00270   return CFactory::CanUnloadNow() ;
00271 }
00272
00273 //
00274 // Get class factory
00275 //
00276 STDAPI DllGetClassObject(const CLSID& clsid,
00277                          const IID& iid,
00278                          void** ppv)
00279 {
00280   return CFactory::GetClassObject(clsid, iid, ppv) ;
00281 }
00282
00283 //
00284 // Server registration
00285 //
00286 STDAPI DllRegisterServer()
00287 {
00288
00289   return CFactory::RegisterAll() ;
00290 }
00291
00292
00293 STDAPI DllUnregisterServer()
00294 {
00295   return CFactory::UnregisterAll() ;
00296 }
00297
00298 ///////////////////////////////////////////////////////////
00299 //
00300 // DLL module information
00301 //
00302 BOOL APIENTRY DllMain(HANDLE hModule,
00303                       DWORD dwReason,
00304                       void* lpReserved)
00305 {
00306   if (dwReason == DLL_PROCESS_ATTACH)
00307   {
00308     g_dwTLS = TlsAlloc();
00309     g_hModule = hModule ;
00310   }
00311   else if (dwReason == DLL_PROCESS_DETACH)
00312     TlsFree(g_dwTLS);
00313   return TRUE ;
00314 }
00315 #endif // _DLL_SERVER_
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Crm/CrmFilesTest/CrmFilesTest.Cpp Source File

  • Com
  • Services
  • Crm
  • CrmFilesTest

CrmFilesTest.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: CrmFilesTest.cpp
00004
00005 ----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009
00010
00011 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00012
00013
00014
00015 This source code is intended only as a supplement to Microsoft
00016
00017 Development Tools and/or on-line documentation. See these other
00018
00019 materials for detailed information regarding Microsoft code samples.
00020
00021
00022
00023 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00024
00025 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00026
00027 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00028
00029 PARTICULAR PURPOSE.
00030
00031 ==========================================================================+*/
00032 // CrmFilesTest.cpp : Implementation of DLL Exports.
00033
00034
00035 // Note: Proxy/Stub Information
00036 //    To merge the proxy/stub code into the object DLL, add the file
00037 //    dlldatax.c to the project.  Make sure precompiled headers
00038 //    are turned off for this file, and add _MERGE_PROXYSTUB to the
00039 //    defines for the project.
00040 //
00041 //    If you are not running WinNT4.0 or Win95 with DCOM, then you
00042 //    need to remove the following define from dlldatax.c
00043 //    #define _WIN32_WINNT 0x0500
00044 //
00045 //    Further, if you are running MIDL without /Oicf switch, you also
00046 //    need to remove the following define from dlldatax.c.
00047 //    #define USE_STUBLESS_PROXY
00048 //
00049 //    Modify the custom build rule for CrmFilesTest.idl by adding the following
00050 //    files to the Outputs.
00051 //      CrmFilesTest_p.c
00052 //      dlldata.c
00053 //    To build a separate proxy/stub DLL,
00054 //    run nmake -f CrmFilesTestps.mk in the project directory.
00055
00056 #include "stdafx.h"
00057 #include "resource.h"
00058 #include "initguid.h"
00059 #include "CrmFilesTest.h"
00060 #include "dlldatax.h"
00061
00062 #include "CrmFilesTest_i.c"
00063 #include <initguid.h>
00064 #include "CrmFilesTestObj.h"
00065
00066 #ifdef _MERGE_PROXYSTUB
00067 extern "C" HINSTANCE hProxyDll;
00068 #endif
00069
00070 CComModule _Module;
00071
00072 BEGIN_OBJECT_MAP(ObjectMap)
00073   OBJECT_ENTRY(CLSID_CrmFilesTest, CCrmFilesTest)
00074 END_OBJECT_MAP()
00075
00076 /////////////////////////////////////////////////////////////////////////////
00077 // DLL Entry Point
00078
00079 extern "C"
00080 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00081 {
00082   lpReserved;
00083 #ifdef _MERGE_PROXYSTUB
00084   if (!PrxDllMain(hInstance, dwReason, lpReserved))
00085     return FALSE;
00086 #endif
00087   if (dwReason == DLL_PROCESS_ATTACH)
00088   {
00089     _Module.Init(ObjectMap, hInstance);
00090     DisableThreadLibraryCalls(hInstance);
00091   }
00092   else if (dwReason == DLL_PROCESS_DETACH)
00093     _Module.Term();
00094   return TRUE;    // ok
00095 }
00096
00097 /////////////////////////////////////////////////////////////////////////////
00098 // Used to determine whether the DLL can be unloaded by OLE
00099
00100 STDAPI DllCanUnloadNow(void)
00101 {
00102 #ifdef _MERGE_PROXYSTUB
00103   if (PrxDllCanUnloadNow() != S_OK)
00104     return S_FALSE;
00105 #endif
00106   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00107 }
00108
00109 /////////////////////////////////////////////////////////////////////////////
00110 // Returns a class factory to create an object of the requested type
00111
00112 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00113 {
00114 #ifdef _MERGE_PROXYSTUB
00115   if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
00116     return S_OK;
00117 #endif
00118   return _Module.GetClassObject(rclsid, riid, ppv);
00119 }
00120
00121 /////////////////////////////////////////////////////////////////////////////
00122 // DllRegisterServer - Adds entries to the system registry
00123
00124 STDAPI DllRegisterServer(void)
00125 {
00126 #ifdef _MERGE_PROXYSTUB
00127   HRESULT hRes = PrxDllRegisterServer();
00128   if (FAILED(hRes))
00129     return hRes;
00130 #endif
00131   // registers object, typelib and all interfaces in typelib
00132   return _Module.RegisterServer(TRUE);
00133 }
00134
00135 /////////////////////////////////////////////////////////////////////////////
00136 // DllUnregisterServer - Removes entries from the system registry
00137
00138 STDAPI DllUnregisterServer(void)
00139 {
00140 #ifdef _MERGE_PROXYSTUB
00141   PrxDllUnregisterServer();
00142 #endif
00143   _Module.UnregisterServer();
00144   return S_OK;
00145 }
00146
00147
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/Check_SD/Helper.c Source File

  • Security
  • Authorization
  • Check_SD

Helper.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1997 - 2000.  Microsoft Corporation.  All rights reserved
00008
00009 Module Name:
00010
00011     helper.c
00012
00013 Abstract:
00014
00015     This module contains helper functions used by check_sd.
00016
00017     ConvertSid()            - converts a binary SID to textual form.
00018     DisplayError()          - displays error code and message for an
00019                               API failure
00020     Privilege()             - enables or disables a privilege.  the
00021                               function will first check to see if the
00022                               thread is impersonating, if it is the
00023                               privilege is enabled in the impersonation
00024                               token if not, the privilege is enabled in
00025                               the process token
00026     LookupAccountOtherSid() - there are certain builtin accounts on Windows NT
00027                               which do not have a mapped account name.
00028                               LookupAccountSid will return the error
00029                               ERROR_NONE_MAPPED.  This function generates SIDs
00030                               for the following accounts that are not mapped:
00031                               * ACCOUNT OPERATORS
00032                               * SYSTEM OPERATORS
00033                               * PRINTER OPERATORS
00034                               * BACKUP OPERATORS
00035
00036                               the other SID it creates is a LOGON SID, it has
00037                               a prefix of S-1-5-5.  a LOGON SID is a unique
00038                               identifier for a user's logon session.
00039
00040 Changes:
00041
00042     Change System to Server Operators in LookupAccountOtherSid 16-Aug-98
00043
00044 --*/
00045
00046 #include "check_sd.h"
00047 #include <tchar.h>
00048 #include <stdio.h>
00049
00050 BOOL ConvertSid(PSID pSid, LPTSTR pszSidText, LPDWORD dwBufferLen)
00051 {
00052      DWORD                     dwSubAuthorities;
00053      DWORD                     dwSidRev = SID_REVISION;
00054      DWORD                     dwCounter;
00055      DWORD                     dwSidSize;
00056      PSID_IDENTIFIER_AUTHORITY psia;
00057
00058      //
00059      // test if Sid passed in is valid
00060      //
00061      if(!IsValidSid(pSid))
00062           return FALSE;
00063
00064      //
00065      // obtain SidIdentifierAuthority
00066      //
00067      psia = GetSidIdentifierAuthority(pSid);
00068
00069      //
00070      // obtain sidsubauthority count
00071      //
00072      dwSubAuthorities =* GetSidSubAuthorityCount(pSid);
00073
00074      //
00075      // compute buffer length
00076      // S-SID_REVISION- + identifierauthority- + subauthorities- + NULL
00077      //
00078      dwSidSize = (15 + 12 + (12 * dwSubAuthorities) + 1) * sizeof(TCHAR);
00079
00080      //
00081      // check provided buffer length.
00082      // If not large enough, indicate proper size and setlasterror
00083      //
00084      if (*dwBufferLen < dwSidSize){
00085           *dwBufferLen = dwSidSize;
00086           SetLastError(ERROR_INSUFFICIENT_BUFFER);
00087           return FALSE;
00088          }
00089
00090      //
00091      // prepare S-SID_REVISION-
00092      //
00093      dwSidSize=wsprintf(pszSidText, TEXT("S-%lu-"), dwSidRev );
00094
00095      //
00096      // prepare SidIdentifierAuthority
00097      //
00098      if ( (psia->Value[0] != 0) || (psia->Value[1] != 0) ){
00099           dwSidSize += wsprintf(pszSidText + lstrlen(pszSidText),
00100           TEXT("0x%02hx%02hx%02hx%02hx%02hx%02hx"),
00101           (USHORT)psia->Value[0],
00102           (USHORT)psia->Value[1],
00103           (USHORT)psia->Value[2],
00104           (USHORT)psia->Value[3],
00105           (USHORT)psia->Value[4],
00106           (USHORT)psia->Value[5]);
00107          }
00108      else{
00109           dwSidSize += wsprintf(pszSidText + lstrlen(pszSidText),
00110                                TEXT("%lu"),
00111                                (ULONG)(psia->Value[5]      )   +
00112                                (ULONG)(psia->Value[4] <<  8)   +
00113                                (ULONG)(psia->Value[3] << 16)   +
00114                                (ULONG)(psia->Value[2] << 24)   );
00115          }
00116
00117      //
00118      // loop through SidSubAuthorities
00119      //
00120      for (dwCounter=0 ; dwCounter < dwSubAuthorities ; dwCounter++){
00121           dwSidSize+=wsprintf(pszSidText + dwSidSize, TEXT("-%lu"),
00122                *GetSidSubAuthority(pSid, dwCounter));
00123          }
00124
00125      return TRUE;
00126 }
00127
00128 void DisplayError(DWORD dwError, LPTSTR pszAPI)
00129 {
00130      LPVOID lpvMessageBuffer;
00131
00132      if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
00133                    NULL, dwError,
00134                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //The user default language
00135                    (LPTSTR)&lpvMessageBuffer, 0, NULL))
00136    {
00137         printf ("FormatMessage failed: 0x%x\n", GetLastError());
00138       return;
00139    }
00140
00141      //
00142      //... now display this string
00143      //
00144      _tprintf(TEXT("ERROR: API        = %s.\n"), pszAPI);
00145      _tprintf(TEXT("       error code = %d.\n"), dwError);
00146      _tprintf(TEXT("       message    = %s\n"), (LPTSTR)lpvMessageBuffer);
00147
00148      //
00149      // Free the buffer allocated by the system
00150      //
00151      if (LocalFree(lpvMessageBuffer))
00152      printf ("LocalFree failed: 0x%x\n", GetLastError());
00153
00154      ExitProcess(0);
00155 }
00156
00157 BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
00158 {
00159      HANDLE           hToken;
00160      TOKEN_PRIVILEGES tp;
00161
00162      //
00163      // obtain the token, first check the thread and then the process
00164      //
00165      if (!OpenThreadToken(GetCurrentThread(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, TRUE, &hToken)){
00166           if (GetLastError() == ERROR_NO_TOKEN){
00167                if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
00168                     return FALSE;
00169           }
00170           else
00171                return FALSE;
00172    }
00173
00174      //
00175      // get the luid for the privilege
00176      //
00177      if (!LookupPrivilegeValue(NULL, pszPrivilege, &tp.Privileges[0].Luid))
00178           return FALSE;
00179
00180      tp.PrivilegeCount = 1;
00181
00182      if (bEnable)
00183           tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
00184      else
00185           tp.Privileges[0].Attributes = 0;
00186
00187      //
00188      // enable or disable the privilege
00189      //
00190      if (!AdjustTokenPrivileges(hToken, FALSE, &tp, 0, (PTOKEN_PRIVILEGES)NULL, 0))
00191           return FALSE;
00192
00193      if (!CloseHandle(hToken))
00194           return FALSE;
00195
00196      return TRUE;
00197 }
00198
00199 void LookupAccountOtherSid(PSID psidCheck, LPTSTR pszName, LPDWORD pcbName, LPTSTR pszDomain, LPDWORD pcbDomain, PSID_NAME_USE psnu)
00200 {
00201      int                      i;
00202      PSID                     psid[UNKNOWNSIDS];
00203      PSID                     psidLogonSid;
00204      SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY;
00205      TCHAR                    szName[UNKNOWNSIDS][18] = {TEXT("ACCOUNT OPERATORS"), TEXT("SERVER OPERATORS"), TEXT("PRINTER OPERATORS"), TEXT("BACKUP OPERATORS")};
00206
00207      //
00208      // name should be bigger than 18, builtin should be greater than 8
00209      //
00210
00211      //
00212      // create account operators
00213      //
00214      if (!AllocateAndInitializeSid(&sia, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ACCOUNT_OPS, 0, 0, 0, 0, 0, 0, &psid[0]))
00215           DisplayError(GetLastError(), TEXT("AllocateAndInitializeSid"));
00216
00217      //
00218      // create system operators
00219      //
00220      if (!AllocateAndInitializeSid(&sia, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_SYSTEM_OPS, 0, 0, 0, 0, 0, 0, &psid[1]))
00221           DisplayError(GetLastError(), TEXT("AllocateAndInitializeSid"));
00222
00223      //
00224      // create printer operators
00225      //
00226      if (!AllocateAndInitializeSid(&sia, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_PRINT_OPS, 0, 0, 0, 0, 0, 0, &psid[2]))
00227           DisplayError(GetLastError(), TEXT("AllocateAndInitializeSid"));
00228
00229      //
00230      // create backup operators
00231      //
00232      if (!AllocateAndInitializeSid(&sia, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_BACKUP_OPS, 0, 0, 0, 0, 0, 0, &psid[3]))
00233           DisplayError(GetLastError(), TEXT("AllocateAndInitializeSid"));
00234
00235      //
00236      // create a logon SID
00237      //
00238      if (!AllocateAndInitializeSid(&sia, 2, 0x00000005, 0, 0, 0, 0, 0, 0, 0, &psidLogonSid))
00239           DisplayError(GetLastError(), TEXT("AllocateAndInitializeSid"));
00240
00241      *psnu =  SidTypeAlias;
00242
00243      for (i = 0; i < 4; i++){
00244           if (EqualSid(psidCheck, psid[i])){
00245          if (!lstrcpy(pszName, szName[i]))
00246               DisplayError(GetLastError(), TEXT("lstrcpy"));
00247
00248                if (!lstrcpy(pszDomain, TEXT("BUILTIN")))
00249               DisplayError(GetLastError(), TEXT("lstrcpy"));
00250                break;
00251           }
00252      }
00253
00254      if (EqualPrefixSid(psidCheck, psidLogonSid)){
00255      if (!lstrcpy(pszName, TEXT("LOGON SID")))
00256             DisplayError(GetLastError(), TEXT("_tcsncpy"));
00257      }
00258
00259      //
00260      // free the sids
00261      //
00262      for (i=0;i<4;i++){
00263           FreeSid(psid[i]);
00264      }
00265
00266      FreeSid(psidLogonSid);
00267 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditHost/Snap.cpp Source File

  • Web
  • Browser
  • EditHost

Snap.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // Snap.cpp : Implementation of CSnap
00006 #include "stdafx.h"
00007 #include "EdHost.h"
00008 #include "Snap.h"
00009
00010 /////////////////////////////////////////////////////////////////////////////
00011 // CSnap
00012
00013 // IHTMLEditHost
00014 STDMETHODIMP
00015 CSnap::SnapRect(IHTMLElement *pIElement,
00016         RECT *prcNew,
00017         ELEMENT_CORNER eHandle)
00018 {
00019   if (!m_bSnapOn) return S_OK; // Disables snap to grid when m_bSnapOn is FALSE
00020
00021   LONG lWidth = prcNew->right - prcNew->left;
00022   LONG lHeight = prcNew->bottom - prcNew->top;
00023
00024   switch (eHandle)
00025   {
00026   case ELEMENT_CORNER_NONE:
00027     prcNew->top = ((prcNew->top + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00028     prcNew->left = ((prcNew->left + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00029     prcNew->bottom = prcNew->top + lHeight;
00030     prcNew->right = prcNew->left + lWidth;
00031     break;
00032
00033   case ELEMENT_CORNER_TOP:
00034     prcNew->top = ((prcNew->top + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00035     break;
00036
00037   case ELEMENT_CORNER_LEFT:
00038     prcNew->left = ((prcNew->left + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00039     break;
00040
00041   case ELEMENT_CORNER_BOTTOM:
00042     prcNew->bottom = ((prcNew->bottom + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement + 1;
00043     break;
00044
00045   case ELEMENT_CORNER_RIGHT:
00046     prcNew->right = ((prcNew->right + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement + 1;
00047     break;
00048
00049   case ELEMENT_CORNER_TOPLEFT:
00050     prcNew->top = ((prcNew->top + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00051     prcNew->left = ((prcNew->left + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00052     break;
00053
00054   case ELEMENT_CORNER_TOPRIGHT:
00055     prcNew->top = ((prcNew->top + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00056     prcNew->right = ((prcNew->right + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement + 1;
00057     break;
00058
00059   case ELEMENT_CORNER_BOTTOMLEFT:
00060     prcNew->bottom = ((prcNew->bottom + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement + 1;
00061     prcNew->left = ((prcNew->left + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement - 2;
00062     break;
00063
00064   case ELEMENT_CORNER_BOTTOMRIGHT:
00065     prcNew->bottom = ((prcNew->bottom + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement + 1;
00066     prcNew->right = ((prcNew->right + (m_lSnapIncrement/2))/m_lSnapIncrement) * m_lSnapIncrement + 1;
00067     break;
00068   }
00069
00070   return S_OK;
00071
00072 }
00073
00074 // ISnap
00075 STDMETHODIMP CSnap::get_SnapIncrement(long *pVal)
00076 {
00077   pVal = &m_lSnapIncrement;
00078
00079   return S_OK;
00080 }
00081
00082 STDMETHODIMP CSnap::put_SnapIncrement(long newVal)
00083 {
00084   m_lSnapIncrement = newVal;
00085
00086   return S_OK;
00087 }
00088
00089 STDMETHODIMP CSnap::get_SnapOn(BOOL *pVal)
00090 {
00091   pVal = &m_bSnapOn;
00092
00093   return S_OK;
00094 }
00095
00096 STDMETHODIMP CSnap::put_SnapOn(BOOL newVal)
00097 {
00098   m_bSnapOn = newVal;
00099
00100   return S_OK;
00101 }
00102
00103
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/CMgdClusCfgInit.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

CMgdClusCfgInit.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      CMgdClusCfgInit.h
00005 //
00006 //  Description:
00007 //      Header file for the CMgdClusCfgInit class
00008 //
00009 //  Implementation Files:
00010 //      CMgdClusCfgInit.cpp
00011 //
00012 //  Description:
00013 //      Header file for the CMgdClusCfgInit class
00014 //
00015 //////////////////////////////////////////////////////////////////////////////
00016
00017 #pragma once
00018
00019
00020 //////////////////////////////////////////////////////////////////////////////
00021 // Include Files
00022 //////////////////////////////////////////////////////////////////////////////
00023
00024 #include "stdafx.h"
00025
00026
00027 //////////////////////////////////////////////////////////////////////////////
00028 //++
00029 //
00030 //  class CMgdClusCfgInit
00031 //
00032 //  Description:
00033 //      The CMgdClusCfgInit class is a base class implementation of the
00034 //      IClusCfgInitialize interface.
00035 //
00036 //--
00037 //////////////////////////////////////////////////////////////////////////////
00038 class CMgdClusCfgInit
00039     : public IClusCfgInitialize
00040     , public CComObjectRoot
00041 {
00042 public:
00043
00044     CMgdClusCfgInit( void );
00045     virtual ~CMgdClusCfgInit( void );
00046
00047     //
00048     // IClusCfgInitialize interface
00049     //
00050
00051     STDMETHOD( Initialize )( IUnknown * punkCallbackIn, LCID lcidIn );
00052
00053     //
00054     // Public member functions.
00055     //
00056
00057     IClusCfgCallback *  GetCallback( void )     { return m_picccCallback; }
00058     LCID                GetLCID( void )         { return m_lcid; }
00059     BSTR                GetNodeName( void )     { return m_bstrNodeName; }
00060     BSTR                GetDllName( void )      { return m_bstrDllName; }
00061     BSTR                GetResTypeName( void )  { return m_bstrResTypeName; }
00062     BSTR                GetDisplayName( void )  { return m_bstrDisplayName; }
00063
00064     STDMETHOD( HrSendStatusReport )(
00065           CLSID      clsidTaskMajorIn
00066         , CLSID      clsidTaskMinorIn
00067         , ULONG      ulMinIn
00068         , ULONG      ulMaxIn
00069         , ULONG      ulCurrentIn
00070         , HRESULT    hrStatusIn
00071         , LPCWSTR    pcszDescriptionIn
00072         , LPCWSTR    pcszReferenceIn
00073         ...
00074         );
00075
00076     STDMETHOD( HrSendStatusReport )(
00077           CLSID      clsidTaskMajorIn
00078         , CLSID      clsidTaskMinorIn
00079         , ULONG      ulMinIn
00080         , ULONG      ulMaxIn
00081         , ULONG      ulCurrentIn
00082         , HRESULT    hrStatusIn
00083         , LPCWSTR    pcszDescriptionIn
00084         , UINT       idsReferenceIn
00085         ...
00086         );
00087
00088     STDMETHOD( HrSendStatusReport )(
00089           CLSID     clsidTaskMajorIn
00090         , CLSID     clsidTaskMinorIn
00091         , ULONG     ulMinIn
00092         , ULONG     ulMaxIn
00093         , ULONG     ulCurrentIn
00094         , HRESULT   hrStatusIn
00095         , UINT      idsDescriptionIn
00096         , UINT      idsReferenceIn
00097         ...
00098         );
00099
00100 private:
00101
00102     //
00103     // Private member functions.
00104     //
00105
00106     STDMETHOD( SendStatusReport )(
00107           CLSID     clsidTaskMajorIn
00108         , CLSID     clsidTaskMinorIn
00109         , ULONG     ulMinIn
00110         , ULONG     ulMaxIn
00111         , ULONG     ulCurrentIn
00112         , HRESULT   hrStatusIn
00113         , LPCWSTR   pcszDescriptionIn
00114         , LPCWSTR   pcszReferenceIn
00115         );
00116
00117     //
00118     // Private copy constructor to avoid copying.
00119     //
00120
00121     CMgdClusCfgInit( const CMgdClusCfgInit & rSrcIn );
00122
00123     //
00124     // Private assignment operator to avoid copying.
00125     //
00126
00127     const CMgdClusCfgInit & operator = ( const CMgdClusCfgInit & rSrcIn );
00128
00129     //
00130     // IClusCfgCallback info.
00131     //
00132
00133     LCID                m_lcid;
00134     IClusCfgCallback *  m_picccCallback;
00135     BSTR                m_bstrNodeName;
00136
00137     //
00138     // Resource dll, resource type, and resource type display names.
00139     //
00140
00141     BSTR    m_bstrDllName;
00142     BSTR    m_bstrResTypeName;
00143     BSTR    m_bstrDisplayName;
00144
00145 }; //*** class CMgdClusCfgInit
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDbAlloc Member List

This is the complete list of members for CDbAlloc, including all inherited members.
AddInst(void FAR *pv, ULONG nAlloc, ULONG cb) | CDbAlloc | [private]
Assertion(BOOL cond, char FAR *szExpr, char FAR *szFile, UINT uLine, char FAR *szMsg) | CDbAlloc | [inline, private]
cb | CDbAlloc |
CDbAlloc() | CDbAlloc | [inline]
Create(ULONG options, IDbOutput FAR *pdbout, IMalloc FAR *FAR *ppmalloc) | CDbAlloc | [static]
DelInst(void FAR *pv) | CDbAlloc | [private]
DumpInst(CAddrNode FAR *pn) | CDbAlloc | [private]
DumpInstTable(void) | CDbAlloc | [private]
GetInst(void FAR *pv) | CDbAlloc | [private]
HashInst(void FAR *pv) const | CDbAlloc | [inline, private]
IsEmpty(void) | CDbAlloc | [private]
m_cAllocCalls | CDbAlloc | [private]
m_nBreakAtAllocSize | CDbAlloc | [private]
m_nBreakAtNthAlloc | CDbAlloc | [private]
m_pdbout | CDbAlloc | [private]
m_refs | CDbAlloc | [private]
m_rganode | CDbAlloc | [private]
m_rgchSig | CDbAlloc | [private, static]
operator delete(void FAR *pv) | CDbAlloc | [inline]
operator new(size_t cb) | CDbAlloc | [inline]
QueryInterface(REFIID riid, void FAR *FAR *ppv) | CDbAlloc |
STDMETHOD_(ULONG, AddRef)(void) | CDbAlloc |
STDMETHOD_(ULONG, Release)(void) | CDbAlloc |
STDMETHOD_(void FAR *, Alloc)(ULONG cb) | CDbAlloc |
STDMETHOD_(void FAR *, Realloc)(void FAR *pv | CDbAlloc |
STDMETHOD_(void, Free)(void FAR *pv) | CDbAlloc |
STDMETHOD_(ULONG, GetSize)(void FAR *pv) | CDbAlloc |
STDMETHOD_(int, DidAlloc)(void FAR *pv) | CDbAlloc |
STDMETHOD_(void, HeapMinimize)(void) | CDbAlloc |
~CDbAlloc() | CDbAlloc | [inline]
Generated on Wed Nov 13 2024 16:56:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditGlyphs/EdGlyphs_p.c Source File

  • Web
  • Browser
  • EditGlyphs

EdGlyphs_p.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /* this ALWAYS GENERATED file contains the proxy stub code */
00006
00007
00008 /* File created by MIDL compiler version 5.01.0164 */
00009 /* at Fri Feb 25 18:53:48 2000
00010  */
00011 /* Compiler settings for C:\workshop\samples\browser\EditGlyphs\EdGlyphs.idl:
00012     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00013     error checks: allocation ref bounds_check enum stub_data
00014 */
00015 //@@MIDL_FILE_HEADING(  )
00016
00017 #define USE_STUBLESS_PROXY
00018
00019
00020 /* verify that the <rpcproxy.h> version is high enough to compile this file*/
00021 #ifndef __REDQ_RPCPROXY_H_VERSION__
00022 #define __REQUIRED_RPCPROXY_H_VERSION__ 440
00023 #endif
00024
00025
00026 #include "rpcproxy.h"
00027 #ifndef __RPCPROXY_H_VERSION__
00028 #error this stub requires an updated version of <rpcproxy.h>
00029 #endif // __RPCPROXY_H_VERSION__
00030
00031
00032 #include "EdGlyphs.h"
00033
00034 #define TYPE_FORMAT_STRING_SIZE   7
00035 #define PROC_FORMAT_STRING_SIZE   129
00036
00037 typedef struct _MIDL_TYPE_FORMAT_STRING
00038     {
00039     short          Pad;
00040     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
00041     } MIDL_TYPE_FORMAT_STRING;
00042
00043 typedef struct _MIDL_PROC_FORMAT_STRING
00044     {
00045     short          Pad;
00046     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
00047     } MIDL_PROC_FORMAT_STRING;
00048
00049
00050 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
00051 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
00052
00053
00054 /* Object interface: IUnknown, ver. 0.0,
00055    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00056
00057
00058 /* Object interface: IDispatch, ver. 0.0,
00059    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
00060
00061
00062 /* Object interface: IBrowserHost, ver. 0.0,
00063    GUID={0x5FD6158A,0x71F6,0x4F20,{0xB8,0xA9,0x6E,0xAF,0x5D,0x03,0x2D,0x15}} */
00064
00065
00066 extern const MIDL_STUB_DESC Object_StubDesc;
00067
00068
00069 extern const MIDL_SERVER_INFO IBrowserHost_ServerInfo;
00070
00071 #pragma code_seg(".orpc")
00072 static const unsigned short IBrowserHost_FormatStringOffsetTable[] =
00073     {
00074     (unsigned short) -1,
00075     (unsigned short) -1,
00076     (unsigned short) -1,
00077     (unsigned short) -1,
00078     0,
00079     22,
00080     44
00081     };
00082
00083 static const MIDL_SERVER_INFO IBrowserHost_ServerInfo =
00084     {
00085     &Object_StubDesc,
00086     0,
00087     __MIDL_ProcFormatString.Format,
00088     &IBrowserHost_FormatStringOffsetTable[-3],
00089     0,
00090     0,
00091     0,
00092     0
00093     };
00094
00095 static const MIDL_STUBLESS_PROXY_INFO IBrowserHost_ProxyInfo =
00096     {
00097     &Object_StubDesc,
00098     __MIDL_ProcFormatString.Format,
00099     &IBrowserHost_FormatStringOffsetTable[-3],
00100     0,
00101     0,
00102     0
00103     };
00104
00105 CINTERFACE_PROXY_VTABLE(10) _IBrowserHostProxyVtbl =
00106 {
00107     &IBrowserHost_ProxyInfo,
00108     &IID_IBrowserHost,
00109     IUnknown_QueryInterface_Proxy,
00110     IUnknown_AddRef_Proxy,
00111     IUnknown_Release_Proxy ,
00112     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00113     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00114     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00115     0 /* IDispatch_Invoke_Proxy */ ,
00116     (void *)-1 /* IBrowserHost::Run */ ,
00117     (void *)-1 /* IBrowserHost::Stop */ ,
00118     (void *)-1 /* IBrowserHost::GetHwnd */
00119 };
00120
00121
00122 static const PRPC_STUB_FUNCTION IBrowserHost_table[] =
00123 {
00124     STUB_FORWARDING_FUNCTION,
00125     STUB_FORWARDING_FUNCTION,
00126     STUB_FORWARDING_FUNCTION,
00127     STUB_FORWARDING_FUNCTION,
00128     NdrStubCall2,
00129     NdrStubCall2,
00130     NdrStubCall2
00131 };
00132
00133 CInterfaceStubVtbl _IBrowserHostStubVtbl =
00134 {
00135     &IID_IBrowserHost,
00136     &IBrowserHost_ServerInfo,
00137     10,
00138     &IBrowserHost_table[-3],
00139     CStdStubBuffer_DELEGATING_METHODS
00140 };
00141
00142
00143 /* Object interface: ISnap, ver. 0.0,
00144    GUID={0xCCBFDE40,0xFE5D,0x4A3C,{0x88,0x0B,0x47,0x83,0x97,0x15,0xE3,0xAC}} */
00145
00146
00147 extern const MIDL_STUB_DESC Object_StubDesc;
00148
00149
00150 extern const MIDL_SERVER_INFO ISnap_ServerInfo;
00151
00152 #pragma code_seg(".orpc")
00153
00154 static const MIDL_STUB_DESC Object_StubDesc =
00155     {
00156     0,
00157     NdrOleAllocate,
00158     NdrOleFree,
00159     0,
00160     0,
00161     0,
00162     0,
00163     0,
00164     __MIDL_TypeFormatString.Format,
00165     1, /* -error bounds_check flag */
00166     0x20000, /* Ndr library version */
00167     0,
00168     0x50100a4, /* MIDL Version 5.1.164 */
00169     0,
00170     0,
00171     0,  /* notify & notify_flag routine table */
00172     1,  /* Flags */
00173     0,  /* Reserved3 */
00174     0,  /* Reserved4 */
00175     0   /* Reserved5 */
00176     };
00177
00178 static const unsigned short ISnap_FormatStringOffsetTable[] =
00179     {
00180     (unsigned short) -1,
00181     (unsigned short) -1,
00182     (unsigned short) -1,
00183     (unsigned short) -1,
00184     72,
00185     100
00186     };
00187
00188 static const MIDL_SERVER_INFO ISnap_ServerInfo =
00189     {
00190     &Object_StubDesc,
00191     0,
00192     __MIDL_ProcFormatString.Format,
00193     &ISnap_FormatStringOffsetTable[-3],
00194     0,
00195     0,
00196     0,
00197     0
00198     };
00199
00200 static const MIDL_STUBLESS_PROXY_INFO ISnap_ProxyInfo =
00201     {
00202     &Object_StubDesc,
00203     __MIDL_ProcFormatString.Format,
00204     &ISnap_FormatStringOffsetTable[-3],
00205     0,
00206     0,
00207     0
00208     };
00209
00210 CINTERFACE_PROXY_VTABLE(9) _ISnapProxyVtbl =
00211 {
00212     &ISnap_ProxyInfo,
00213     &IID_ISnap,
00214     IUnknown_QueryInterface_Proxy,
00215     IUnknown_AddRef_Proxy,
00216     IUnknown_Release_Proxy ,
00217     0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ ,
00218     0 /* (void *)-1 /* IDispatch::GetTypeInfo */ ,
00219     0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ ,
00220     0 /* IDispatch_Invoke_Proxy */ ,
00221     (void *)-1 /* ISnap::GetSnapOn */ ,
00222     (void *)-1 /* ISnap::SetSnapOn */
00223 };
00224
00225
00226 static const PRPC_STUB_FUNCTION ISnap_table[] =
00227 {
00228     STUB_FORWARDING_FUNCTION,
00229     STUB_FORWARDING_FUNCTION,
00230     STUB_FORWARDING_FUNCTION,
00231     STUB_FORWARDING_FUNCTION,
00232     NdrStubCall2,
00233     NdrStubCall2
00234 };
00235
00236 CInterfaceStubVtbl _ISnapStubVtbl =
00237 {
00238     &IID_ISnap,
00239     &ISnap_ServerInfo,
00240     9,
00241     &ISnap_table[-3],
00242     CStdStubBuffer_DELEGATING_METHODS
00243 };
00244
00245 #pragma data_seg(".rdata")
00246
00247 #if !defined(__RPC_WIN32__)
00248 #error  Invalid build platform for this stub.
00249 #endif
00250
00251 #if !(TARGET_IS_NT40_OR_LATER)
00252 #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
00253 #error   -Oif or -Oicf, more than 32 methods in the interface.
00254 #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
00255 #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
00256 #endif
00257
00258
00259 static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
00260     {
00261         0,
00262         {
00263
00264   /* Procedure Run */
00265
00266       0x33,   /* FC_AUTO_HANDLE */
00267       0x6c,   /* Old Flags:  object, Oi2 */
00268 /*  2 */  NdrFcLong( 0x0 ), /* 0 */
00269 /*  6 */  NdrFcShort( 0x7 ),  /* 7 */
00270 #ifndef _ALPHA_
00271 /*  8 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00272 #else
00273       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00274 #endif
00275 /* 10 */  NdrFcShort( 0x0 ),  /* 0 */
00276 /* 12 */  NdrFcShort( 0x8 ),  /* 8 */
00277 /* 14 */  0x4,    /* Oi2 Flags:  has return, */
00278       0x1,    /* 1 */
00279
00280   /* Return value */
00281
00282 /* 16 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00283 #ifndef _ALPHA_
00284 /* 18 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00285 #else
00286       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00287 #endif
00288 /* 20 */  0x8,    /* FC_LONG */
00289       0x0,    /* 0 */
00290
00291   /* Procedure Stop */
00292
00293 /* 22 */  0x33,   /* FC_AUTO_HANDLE */
00294       0x6c,   /* Old Flags:  object, Oi2 */
00295 /* 24 */  NdrFcLong( 0x0 ), /* 0 */
00296 /* 28 */  NdrFcShort( 0x8 ),  /* 8 */
00297 #ifndef _ALPHA_
00298 /* 30 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00299 #else
00300       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00301 #endif
00302 /* 32 */  NdrFcShort( 0x0 ),  /* 0 */
00303 /* 34 */  NdrFcShort( 0x8 ),  /* 8 */
00304 /* 36 */  0x4,    /* Oi2 Flags:  has return, */
00305       0x1,    /* 1 */
00306
00307   /* Return value */
00308
00309 /* 38 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00310 #ifndef _ALPHA_
00311 /* 40 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00312 #else
00313       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00314 #endif
00315 /* 42 */  0x8,    /* FC_LONG */
00316       0x0,    /* 0 */
00317
00318   /* Procedure GetHwnd */
00319
00320 /* 44 */  0x33,   /* FC_AUTO_HANDLE */
00321       0x6c,   /* Old Flags:  object, Oi2 */
00322 /* 46 */  NdrFcLong( 0x0 ), /* 0 */
00323 /* 50 */  NdrFcShort( 0x9 ),  /* 9 */
00324 #ifndef _ALPHA_
00325 /* 52 */  NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00326 #else
00327       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00328 #endif
00329 /* 54 */  NdrFcShort( 0x8 ),  /* 8 */
00330 /* 56 */  NdrFcShort( 0x8 ),  /* 8 */
00331 /* 58 */  0x4,    /* Oi2 Flags:  has return, */
00332       0x2,    /* 2 */
00333
00334   /* Parameter phwnd */
00335
00336 /* 60 */  NdrFcShort( 0x148 ),  /* Flags:  in, base type, simple ref, */
00337 #ifndef _ALPHA_
00338 /* 62 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00339 #else
00340       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00341 #endif
00342 /* 64 */  0x8,    /* FC_LONG */
00343       0x0,    /* 0 */
00344
00345   /* Return value */
00346
00347 /* 66 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00348 #ifndef _ALPHA_
00349 /* 68 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00350 #else
00351       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00352 #endif
00353 /* 70 */  0x8,    /* FC_LONG */
00354       0x0,    /* 0 */
00355
00356   /* Procedure GetSnapOn */
00357
00358 /* 72 */  0x33,   /* FC_AUTO_HANDLE */
00359       0x6c,   /* Old Flags:  object, Oi2 */
00360 /* 74 */  NdrFcLong( 0x0 ), /* 0 */
00361 /* 78 */  NdrFcShort( 0x7 ),  /* 7 */
00362 #ifndef _ALPHA_
00363 /* 80 */  NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00364 #else
00365       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00366 #endif
00367 /* 82 */  NdrFcShort( 0x8 ),  /* 8 */
00368 /* 84 */  NdrFcShort( 0x8 ),  /* 8 */
00369 /* 86 */  0x4,    /* Oi2 Flags:  has return, */
00370       0x2,    /* 2 */
00371
00372   /* Parameter lIsOn */
00373
00374 /* 88 */  NdrFcShort( 0x148 ),  /* Flags:  in, base type, simple ref, */
00375 #ifndef _ALPHA_
00376 /* 90 */  NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00377 #else
00378       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00379 #endif
00380 /* 92 */  0x8,    /* FC_LONG */
00381       0x0,    /* 0 */
00382
00383   /* Return value */
00384
00385 /* 94 */  NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00386 #ifndef _ALPHA_
00387 /* 96 */  NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00388 #else
00389       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00390 #endif
00391 /* 98 */  0x8,    /* FC_LONG */
00392       0x0,    /* 0 */
00393
00394   /* Procedure SetSnapOn */
00395
00396 /* 100 */ 0x33,   /* FC_AUTO_HANDLE */
00397       0x6c,   /* Old Flags:  object, Oi2 */
00398 /* 102 */ NdrFcLong( 0x0 ), /* 0 */
00399 /* 106 */ NdrFcShort( 0x8 ),  /* 8 */
00400 #ifndef _ALPHA_
00401 /* 108 */ NdrFcShort( 0xc ),  /* x86, MIPS, PPC Stack size/offset = 12 */
00402 #else
00403       NdrFcShort( 0x18 ), /* Alpha Stack size/offset = 24 */
00404 #endif
00405 /* 110 */ NdrFcShort( 0x8 ),  /* 8 */
00406 /* 112 */ NdrFcShort( 0x8 ),  /* 8 */
00407 /* 114 */ 0x4,    /* Oi2 Flags:  has return, */
00408       0x2,    /* 2 */
00409
00410   /* Parameter lIsOn */
00411
00412 /* 116 */ NdrFcShort( 0x48 ), /* Flags:  in, base type, */
00413 #ifndef _ALPHA_
00414 /* 118 */ NdrFcShort( 0x4 ),  /* x86, MIPS, PPC Stack size/offset = 4 */
00415 #else
00416       NdrFcShort( 0x8 ),  /* Alpha Stack size/offset = 8 */
00417 #endif
00418 /* 120 */ 0x8,    /* FC_LONG */
00419       0x0,    /* 0 */
00420
00421   /* Return value */
00422
00423 /* 122 */ NdrFcShort( 0x70 ), /* Flags:  out, return, base type, */
00424 #ifndef _ALPHA_
00425 /* 124 */ NdrFcShort( 0x8 ),  /* x86, MIPS, PPC Stack size/offset = 8 */
00426 #else
00427       NdrFcShort( 0x10 ), /* Alpha Stack size/offset = 16 */
00428 #endif
00429 /* 126 */ 0x8,    /* FC_LONG */
00430       0x0,    /* 0 */
00431
00432       0x0
00433         }
00434     };
00435
00436 static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
00437     {
00438         0,
00439         {
00440       NdrFcShort( 0x0 ),  /* 0 */
00441 /*  2 */
00442       0x11, 0x8,  /* FC_RP [simple_pointer] */
00443 /*  4 */  0x8,    /* FC_LONG */
00444       0x5c,   /* FC_PAD */
00445
00446       0x0
00447         }
00448     };
00449
00450 const CInterfaceProxyVtbl * _EdGlyphs_ProxyVtblList[] =
00451 {
00452     ( CInterfaceProxyVtbl *) &_ISnapProxyVtbl,
00453     ( CInterfaceProxyVtbl *) &_IBrowserHostProxyVtbl,
00454     0
00455 };
00456
00457 const CInterfaceStubVtbl * _EdGlyphs_StubVtblList[] =
00458 {
00459     ( CInterfaceStubVtbl *) &_ISnapStubVtbl,
00460     ( CInterfaceStubVtbl *) &_IBrowserHostStubVtbl,
00461     0
00462 };
00463
00464 PCInterfaceName const _EdGlyphs_InterfaceNamesList[] =
00465 {
00466     "ISnap",
00467     "IBrowserHost",
00468     0
00469 };
00470
00471 const IID *  _EdGlyphs_BaseIIDList[] =
00472 {
00473     &IID_IDispatch,
00474     &IID_IDispatch,
00475     0
00476 };
00477
00478
00479 #define _EdGlyphs_CHECK_IID(n)  IID_GENERIC_CHECK_IID( _EdGlyphs, pIID, n)
00480
00481 int __stdcall _EdGlyphs_IID_Lookup( const IID * pIID, int * pIndex )
00482 {
00483     IID_BS_LOOKUP_SETUP
00484
00485     IID_BS_LOOKUP_INITIAL_TEST( _EdGlyphs, 2, 1 )
00486     IID_BS_LOOKUP_RETURN_RESULT( _EdGlyphs, 2, *pIndex )
00487
00488 }
00489
00490 const ExtendedProxyFileInfo EdGlyphs_ProxyFileInfo =
00491 {
00492     (PCInterfaceProxyVtblList *) & _EdGlyphs_ProxyVtblList,
00493     (PCInterfaceStubVtblList *) & _EdGlyphs_StubVtblList,
00494     (const PCInterfaceName * ) & _EdGlyphs_InterfaceNamesList,
00495     (const IID ** ) & _EdGlyphs_BaseIIDList,
00496     & _EdGlyphs_IID_Lookup,
00497     2,
00498     2,
00499     0, /* table of [async_uuid] interfaces */
00500     0, /* Filler1 */
00501     0, /* Filler2 */
00502     0  /* Filler3 */
00503 };
Generated on Wed Nov 13 2024 16:52:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/IO/DiskQuota/ProcessMenu.Cpp Source File

  • WinBase
  • IO
  • DiskQuota

ProcessMenu.Cpp

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1999 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009
00010 ProcessMenu.cpp
00011
00012 Description:
00013 Implements the functions used to process the user's selection for the
00014 various menus.
00015 ----------------------------------------------------------------------------*/
00016
00017 #define WIN32_LEAN_AND_MEAN
00018
00019 #include <windows.h>
00020 #include <stdio.h>
00021 #include <dskquota.h>
00022 #include "ProcessMenu.h"
00023 #include "PrintMenu.h"
00024 #include "Commands.h"
00025
00026 /*-----------------------------------------------------------------------------
00027 ProcessMainMenu(WCHAR wcMenuChoice, IDiskQuotaControl* lpDiskQuotaControl)
00028     Prints out the main menu choices
00029
00030 Parameters
00031     wcMenuChoice - UNICODE menu choice
00032
00033     lpDiskQuotaControl - Pointer to an object that implements the
00034         IDiskQuotaControl interface.
00035
00036 Return Value
00037     TRUE - User's selection was processed successfully
00038     FALSE - User chose to exit
00039 -----------------------------------------------------------------------------*/
00040 BOOL ProcessMainMenu(WCHAR wcMenuChoice, IDiskQuotaControl* lpDiskQuotaControl)
00041 {
00042     switch (wcMenuChoice)
00043     {
00044     case L'A':
00045     case L'a':
00046         // Print main menu stuff
00047         while (ProcessDefaultQuotaMenu(PrintDefaultQuotaMenu(),
00048                                        lpDiskQuotaControl));
00049         break;
00050     case L'B':
00051     case L'b':
00052         while (ProcessQuotaLogFlagMenu(PrintQuotaLogFlagMenu(),
00053                                        lpDiskQuotaControl));
00054         break;
00055     case L'C':
00056     case L'c':
00057         while (ProcessDefaultLimitsMenu(PrintDefaultLimitsMenu(),
00058                                         lpDiskQuotaControl));
00059         break;
00060     case L'D':
00061     case L'd':
00062         while (ProcessQuotaManagerMenu(PrintQuotaManagerMenu(),
00063                                        lpDiskQuotaControl));
00064         break;
00065     case L'E':
00066     case L'e':
00067         while (ProcessUserManagerMenu(PrintUserManagerMenu(),
00068                                       lpDiskQuotaControl));
00069         break;
00070     case L'X':
00071     case L'x':
00072         return FALSE;
00073         break;
00074     default:
00075         wprintf(L"\n\nInvalid selection.\n");
00076         break;
00077     }
00078
00079     return TRUE;
00080 }
00081
00082 /*-----------------------------------------------------------------------------
00083 ProcessDefaultQuotaMenu(WCHAR wcMenuChoice,
00084                         IDiskQuotaControl* lpDiskQuotaControl)
00085     Processes the user's selection for getting and setting the default quota
00086     settings
00087
00088 Parameters
00089     wcMenuChoice - UNICODE menu choice
00090
00091     lpDiskQuotaControl - Pointer to an object that implements the
00092         IDiskQuotaControl interface.
00093
00094 Return Value
00095     TRUE - User's selection was processed successfully
00096     FALSE - User chose to exit
00097 -----------------------------------------------------------------------------*/
00098 BOOL ProcessDefaultQuotaMenu(WCHAR wcMenuChoice,
00099                              IDiskQuotaControl* lpDiskQuotaControl)
00100 {
00101     DWORD dwState = 0;
00102
00103     switch(wcMenuChoice)
00104     {
00105     case L'A':
00106     case L'a':
00107         GetDefaultQuota(lpDiskQuotaControl);
00108         break;
00109     case L'B':
00110     case L'b':
00111         lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_DISABLED(dwState));
00112         break;
00113     case L'C':
00114     case L'c':
00115         lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_TRACKED(dwState));
00116         break;
00117     case L'D':
00118     case L'd':
00119         lpDiskQuotaControl->SetQuotaState(DISKQUOTA_SET_ENFORCED(dwState));
00120         break;
00121     case L'X':
00122     case L'x':
00123         return FALSE;
00124         break;
00125     default:
00126         wprintf(L"\n\nInvalid selection.\n");
00127         break;
00128     }
00129
00130     return TRUE;
00131 }
00132
00133 /*-----------------------------------------------------------------------------
00134 ProcessQuotaLogFlagMenu(WCHAR wcMenuChoice,
00135                         IDiskQuotaControl* lpDiskQuotaControl)
00136     Processes the user's selection for getting and setting the quota log flags
00137
00138 Parameters
00139     wcMenuChoice - UNICODE menu choice
00140
00141     lpDiskQuotaControl - Pointer to an object that implements the
00142         IDiskQuotaControl interface.
00143
00144 Return Value
00145     TRUE - User's selection was processed successfully
00146     FALSE - User chose to exit
00147 -----------------------------------------------------------------------------*/
00148 BOOL ProcessQuotaLogFlagMenu(WCHAR wcMenuChoice,
00149                              IDiskQuotaControl* lpDiskQuotaControl)
00150 {
00151     DWORD dwQuotaLogFlags = 0;
00152     lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);
00153
00154     switch(wcMenuChoice)
00155     {
00156     case L'A':
00157     case L'a':
00158         GetQuotaLogFlags(lpDiskQuotaControl);
00159         break;
00160     case L'B':
00161     case L'b':
00162         lpDiskQuotaControl->
00163             SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_THRESHOLD(dwQuotaLogFlags,
00164                                                               TRUE));
00165         break;
00166     case L'C':
00167     case L'c':
00168         lpDiskQuotaControl->
00169             SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_LIMIT(dwQuotaLogFlags,
00170                                                           TRUE));
00171         break;
00172     case L'D':
00173     case L'd':
00174         lpDiskQuotaControl->
00175             SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_THRESHOLD(dwQuotaLogFlags,
00176                                                               FALSE));
00177         break;
00178     case L'E':
00179     case L'e':
00180         lpDiskQuotaControl->
00181             SetQuotaLogFlags(DISKQUOTA_SET_LOG_USER_LIMIT(dwQuotaLogFlags,
00182                                                           FALSE));
00183         break;
00184     case L'X':
00185     case L'x':
00186         return FALSE;
00187         break;
00188     default:
00189         wprintf(L"\n\nInvalid selection.\n");
00190         break;
00191     }
00192
00193     return TRUE;
00194 }
00195
00196 /*-----------------------------------------------------------------------------
00197 ProcessDefaultLimitsMenu(WCHAR wcMenuChoice,
00198                          IDiskQuotaControl* lpDiskQuotaControl)
00199     Processes the user's selection for getting and setting the default quota
00200     limit
00201
00202 Parameters
00203     wcMenuChoice - UNICODE menu choice
00204
00205     lpDiskQuotaControl - Pointer to an object that implements the
00206         IDiskQuotaControl interface.
00207
00208 Return Value
00209     TRUE - User's selection was processed successfully
00210     FALSE - User chose to exit
00211 -----------------------------------------------------------------------------*/
00212 BOOL ProcessDefaultLimitsMenu(WCHAR wcMenuChoice,
00213                               IDiskQuotaControl* lpDiskQuotaControl)
00214 {
00215     DWORD dwQuotaLogFlags = 0;
00216     lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);
00217
00218     switch(wcMenuChoice)
00219     {
00220     case L'A':
00221     case L'a':
00222         GetDefaultHardLimit(lpDiskQuotaControl);
00223         break;
00224     case L'B':
00225     case L'b':
00226         GetDefaultThreshold(lpDiskQuotaControl);
00227         break;
00228     case L'C':
00229     case L'c':
00230         SetDefaultHardLimit(lpDiskQuotaControl);
00231         break;
00232     case L'D':
00233     case L'd':
00234         SetDefaultThreshold(lpDiskQuotaControl);
00235         break;
00236     case L'X':
00237     case L'x':
00238         return FALSE;
00239         break;
00240     default:
00241         wprintf(L"\n\nInvalid selection.\n");
00242         break;
00243     }
00244
00245     return TRUE;
00246 }
00247
00248 /*-----------------------------------------------------------------------------
00249 ProcessUserManagerMenu(WCHAR wcMenuChoice,
00250                        IDiskQuotaControl* lpDiskQuotaControl)
00251     Processes the user's selection for adding and deleting users for which to
00252     track disk quotas
00253
00254 Parameters
00255     wcMenuChoice - UNICODE menu choice
00256
00257     lpDiskQuotaControl - Pointer to an object that implements the
00258         IDiskQuotaControl interface.
00259
00260 Return Value
00261     TRUE - User's selection was processed successfully
00262     FALSE - User chose to exit
00263 -----------------------------------------------------------------------------*/
00264 BOOL ProcessUserManagerMenu(WCHAR wcMenuChoice,
00265                             IDiskQuotaControl* lpDiskQuotaControl)
00266 {
00267     DWORD dwQuotaLogFlags = 0;
00268     lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);
00269
00270     switch(wcMenuChoice)
00271     {
00272     case L'A':
00273     case L'a':
00274         AddUser(lpDiskQuotaControl);
00275         break;
00276     case L'B':
00277     case L'b':
00278         DeleteUser(lpDiskQuotaControl);
00279         break;
00280     case L'C':
00281     case L'c':
00282         EnumerateUsers(lpDiskQuotaControl);
00283         break;
00284     case L'X':
00285     case L'x':
00286         return FALSE;
00287         break;
00288     default:
00289         wprintf(L"\n\nInvalid selection.\n");
00290         break;
00291     }
00292
00293     return TRUE;
00294 }
00295
00296 /*-----------------------------------------------------------------------------
00297 ProcessUserManagerMenu(WCHAR wcMenuChoice,
00298                        IDiskQuotaControl* lpDiskQuotaControl)
00299     Processes the user's selection for adding and deleting users for which to
00300     track disk quotas
00301
00302 Parameters
00303     wcMenuChoice - UNICODE menu choice
00304
00305     lpDiskQuotaControl - Pointer to an object that implements the
00306         IDiskQuotaControl interface.
00307
00308 Return Value
00309     TRUE - User's selection was processed successfully
00310     FALSE - User chose to exit
00311 -----------------------------------------------------------------------------*/
00312 BOOL ProcessQuotaManagerMenu(WCHAR wcMenuChoice,
00313                              IDiskQuotaControl* lpDiskQuotaControl)
00314 {
00315     DWORD dwQuotaLogFlags = 0;
00316     lpDiskQuotaControl->GetQuotaLogFlags(&dwQuotaLogFlags);
00317
00318     switch(wcMenuChoice)
00319     {
00320     case L'A':
00321     case L'a':
00322         EnumerateUserQuotas(lpDiskQuotaControl);
00323         break;
00324     case L'B':
00325     case L'b':
00326         SetUserHardLimit(lpDiskQuotaControl);
00327         break;
00328     case L'C':
00329     case L'c':
00330         SetUserThreshold(lpDiskQuotaControl);
00331         break;
00332     case L'X':
00333     case L'x':
00334         return FALSE;
00335         break;
00336     default:
00337         wprintf(L"\n\nInvalid selection.\n");
00338         break;
00339     }
00340
00341     return TRUE;
00342 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ContextNameHint Member List

This is the complete list of members for ContextNameHint, including all inherited members.
lContextHint | ContextNameHint
wstrContextName | ContextNameHint
Generated on Wed Nov 13 2024 16:57:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 #include "Space.h"
00023 #include "Sky.h"
00024 #include "People.h"
00025 #include "Land.h"
00026 #include "Backgrnd.h"
00027
00028 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00029
00030 //==============================================================
00031 //
00032 // CStaticNode implementation
00033 //
00034 //
00035 CStaticNode::CStaticNode()
00036 {
00037     children[0] = new CPeoplePoweredVehicle;
00038     children[1] = new CLandBasedVehicle;
00039     children[2] = new CSkyBasedVehicle;
00040     children[3] = new CSpaceFolder;
00041     children[4] = new CBackgroundFolder;
00042 }
00043
00044 CStaticNode::~CStaticNode()
00045 {
00046     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00047         if (children[n]) {
00048             delete children[n];
00049         }
00050
00051   if (m_pBMapSm != NULL)
00052     DeleteObject(m_pBMapSm);
00053
00054   if (m_pBMapLg != NULL)
00055     DeleteObject(m_pBMapLg);
00056 }
00057
00058 HRESULT CStaticNode::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00059 {
00060     SCOPEDATAITEM sdi;
00061
00062     if (!bExpanded) {
00063         // create the child nodes, then expand them
00064         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00065             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00066             sdi.mask = SDI_STR       |   // Displayname is valid
00067                 SDI_PARAM     |   // lParam is valid
00068                 SDI_IMAGE     |   // nImage is valid
00069                 SDI_OPENIMAGE |   // nOpenImage is valid
00070                 SDI_PARENT    |
00071                 SDI_CHILDREN;
00072
00073             sdi.relativeID  = (HSCOPEITEM)parent;
00074             sdi.nImage      = children[n]->GetBitmapIndex();
00075             sdi.nOpenImage  = INDEX_OPENFOLDER;
00076             sdi.displayname = MMC_CALLBACK;
00077             sdi.lParam      = (LPARAM)children[n];   // The cookie
00078             sdi.cChildren   = (n == 0 || n == 3);    // Only first and fourth
00079                            // children have child nodes
00080
00081             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00082
00083             _ASSERT( SUCCEEDED(hr) );
00084
00085         children[n]->SetHandle((HANDLE)sdi.ID);
00086         }
00087     }
00088
00089     return S_OK;
00090 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/ioipao.h Source File

  • Com
  • Fundamentals
  • SimpSvr

ioipao.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: IOIPAO.H
00003 //
00004 //      Definition of COleInPlaceActiveObject
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _IOIPAO_H_)
00010 #define _IOIPAO_H_
00011
00012
00013 #include <ole2.h>
00014 #include "obj.h"
00015
00016 class CSimpSvrObj;
00017
00018 interface COleInPlaceActiveObject : public IOleInPlaceActiveObject
00019 {
00020 private:
00021   CSimpSvrObj FAR * m_lpObj;
00022   int m_nCount;
00023
00024 public:
00025   COleInPlaceActiveObject::COleInPlaceActiveObject(CSimpSvrObj FAR * lpSimpSvrObj)
00026     {
00027     m_lpObj = lpSimpSvrObj;     // set up the back ptr
00028     m_nCount = 0;            // clear the ref count.
00029     };
00030   COleInPlaceActiveObject::~COleInPlaceActiveObject() {};   // destructor
00031
00032 // IUnknown Methods
00033
00034   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppvObj);
00035   STDMETHODIMP_(ULONG) AddRef ();
00036   STDMETHODIMP_(ULONG) Release ();
00037
00038   STDMETHODIMP OnDocWindowActivate  ( BOOL fActivate) ;
00039   STDMETHODIMP OnFrameWindowActivate  ( BOOL fActivate) ;
00040   STDMETHODIMP GetWindow  ( HWND FAR* lphwnd);
00041   STDMETHODIMP ContextSensitiveHelp  ( BOOL fEnterMode);
00042   STDMETHODIMP TranslateAccelerator  ( LPMSG lpmsg);
00043   STDMETHODIMP ResizeBorder  ( LPCRECT lprectBorder,
00044                  LPOLEINPLACEUIWINDOW lpUIWindow,
00045                  BOOL fFrameWindow);
00046   STDMETHODIMP EnableModeless  ( BOOL fEnable);
00047
00048 };
00049
00050 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/FreeObject/FreeTest.h Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • FreeObject

FreeTest.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: FreeTest.h
00004
00005 Summary: Declaration of the CFreeTest
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 #ifndef __FREETEST_H_
00023 #define __FREETEST_H_
00024
00025 #include "resource.h"       // main symbols
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CFreeTest
00029 class ATL_NO_VTABLE CFreeTest :
00030   public CComObjectRootEx<CComSingleThreadModel>,
00031   public CComCoClass<CFreeTest, &CLSID_FreeTest>,
00032   public IDispatchImpl<ISyncTest, &IID_ISyncTest, &LIBID_FREEOBJECTLib>
00033 {
00034 public:
00035   CFreeTest()
00036   {
00037   }
00038
00039 DECLARE_REGISTRY_RESOURCEID(IDR_FREETEST)
00040
00041 DECLARE_PROTECT_FINAL_CONSTRUCT()
00042
00043 BEGIN_COM_MAP(CFreeTest)
00044   COM_INTERFACE_ENTRY(ISyncTest)
00045   COM_INTERFACE_ENTRY(IDispatch)
00046 END_COM_MAP()
00047
00048 // ISyncTest
00049 public:
00050   STDMETHOD(Exercise)(void);
00051 };
00052
00053 #endif //__FREETEST_H_
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Enum/vc/Enum.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Enum
  • vc

Enum.cpp

Go to the documentation of this file.
00001 // Enum.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "stdio.h"
00006 #include "activeds.h"
00007
00008
00009
00010
00011 int main(int argc, char* argv[])
00012 {
00013   HRESULT hr;
00014   IADsContainer *pCont;
00015   CoInitialize(NULL);
00016
00017
00018   ////////////////////////////////
00019   // Bind to a domain object
00020   //////////////////////////////////
00021   hr = ADsGetObject(L"WinNT://INDEPENDENCE", IID_IADsContainer, (void**) &pCont );
00022   if ( !SUCCEEDED(hr) )
00023   {
00024     return 0;
00025   }
00026
00027   /////////////////////////////////
00028   // Enumerate
00029   /////////////////////////////////
00030   IEnumVARIANT *pEnum = NULL;
00031   hr = ADsBuildEnumerator( pCont, &pEnum );
00032   if ( SUCCEEDED(hr) )
00033   {
00034     VARIANT var;
00035     ULONG   lFetch;
00036     IADs   *pChild=NULL;
00037     VariantInit(&var);
00038
00039     while( SUCCEEDED(ADsEnumerateNext( pEnum, 1, &var, &lFetch )) && lFetch == 1 )
00040     {
00041       hr = V_DISPATCH(&var)->QueryInterface( IID_IADs, (void**) &pChild );
00042       if ( SUCCEEDED(hr) )
00043       {
00044         BSTR bstrName;
00045         BSTR bstrClass;
00046         // Get more information on the child classes
00047         pChild->get_Name(&bstrName);
00048         pChild->get_Class(&bstrClass);
00049
00050         printf("%S\t(%S)\n", bstrName, bstrClass );
00051
00052         // Clean-up
00053         SysFreeString(bstrName);
00054         SysFreeString(bstrClass);
00055
00056         pChild->Release();
00057
00058       }
00059       VariantClear(&var);
00060     }
00061
00062   }
00063
00064   if ( pEnum )
00065   {
00066     ADsFreeEnumerator( pEnum );
00067   }
00068
00069   pCont->Release();
00070
00071   CoUninitialize();
00072   return 0;
00073 }
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step1/ADsFirstExt_i.c Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step1

ADsFirstExt_i.c

Go to the documentation of this file.
00001 /* this file contains the actual definitions of */
00002 /* the IIDs and CLSIDs */
00003
00004 /* link this file in with the server and any clients */
00005
00006
00007 /* File created by MIDL compiler version 5.01.0164 */
00008 /* at Mon Apr 29 12:44:14 2002
00009  */
00010 /* Compiler settings for C:\sdk\sdkpublic\samples\netds\adsi\samples\Extension\tutorial\Step1\ADsFirstExt.idl:
00011     Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
00012     error checks: allocation ref bounds_check enum stub_data
00013 */
00014 //@@MIDL_FILE_HEADING(  )
00015 #ifdef __cplusplus
00016 extern "C"{
00017 #endif
00018
00019
00020 #ifndef __IID_DEFINED__
00021 #define __IID_DEFINED__
00022
00023 typedef struct _IID
00024 {
00025     unsigned long x;
00026     unsigned short s1;
00027     unsigned short s2;
00028     unsigned char  c[8];
00029 } IID;
00030
00031 #endif // __IID_DEFINED__
00032
00033 #ifndef CLSID_DEFINED
00034 #define CLSID_DEFINED
00035 typedef IID CLSID;
00036 #endif // CLSID_DEFINED
00037
00038 const IID IID_IHelloWorld = {0xE1E3EDF7,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}};
00039
00040
00041 const IID LIBID_ADSFIRSTEXTLib = {0xE1E3EDEA,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}};
00042
00043
00044 const CLSID CLSID_HelloWorld = {0xE1E3EDF8,0x48D1,0x11D2,{0xB2,0x2B,0x00,0x00,0xF8,0x7A,0x6B,0x50}};
00045
00046
00047 #ifdef __cplusplus
00048 }
00049 #endif
00050
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/EnumDesk/resource.h Source File

  • WinUI
  • Shell
  • EnumDesk

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by EnumDesk.rc
00004 //
00005 #define IDM_MAIN_MENU                   100
00006 #define IDC_SPLIT_CURSOR                101
00007 #define IDR_ACCELS                      102
00008 #define IDM_LARGE_ICONS                 200
00009 #define IDM_SMALL_ICONS                 201
00010 #define IDM_LIST                        202
00011 #define IDM_REFRESH                     203
00012 #define IDM_EXIT                        1000
00013
00014 // Next default values for new objects
00015 //
00016 #ifdef APSTUDIO_INVOKED
00017 #ifndef APSTUDIO_READONLY_SYMBOLS
00018 #define _APS_NEXT_RESOURCE_VALUE        103
00019 #define _APS_NEXT_COMMAND_VALUE         301
00020 #define _APS_NEXT_CONTROL_VALUE         1014
00021 #define _APS_NEXT_SYMED_VALUE           102
00022 #endif
00023 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/CLOSQDlg.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

CLOSQDlg.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // ClosQDlg.cpp : implementation file
00013 //
00014
00015
00016
00017
00018 #include "stdafx.h"
00019 #include "MQApitst.h"
00020 #include "ClosQDlg.h"
00021
00022 #ifdef _DEBUG
00023 #define new DEBUG_NEW
00024 #undef THIS_FILE
00025 static char THIS_FILE[] = __FILE__;
00026 #endif
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CCloseQueueDialog dialog
00030
00031
00032 CCloseQueueDialog::CCloseQueueDialog(CArray <ARRAYQ*, ARRAYQ*>*  pStrArray, CWnd* pParent /*=NULL*/)
00033   : CDialog(CCloseQueueDialog::IDD, pParent)
00034 {
00035   m_pStrArray = pStrArray;
00036
00037   //{{AFX_DATA_INIT(CCloseQueueDialog)
00038   m_szPathName = _T("");
00039   //}}AFX_DATA_INIT
00040 }
00041
00042
00043 void CCloseQueueDialog::DoDataExchange(CDataExchange* pDX)
00044 {
00045   CDialog::DoDataExchange(pDX);
00046   //{{AFX_DATA_MAP(CCloseQueueDialog)
00047   DDX_Control(pDX, IDC_COMBO, m_PathNameCB);
00048   DDX_CBString(pDX, IDC_COMBO, m_szPathName);
00049   DDV_MaxChars(pDX, m_szPathName, 4000);
00050   //}}AFX_DATA_MAP
00051 }
00052
00053
00054 BEGIN_MESSAGE_MAP(CCloseQueueDialog, CDialog)
00055   //{{AFX_MSG_MAP(CCloseQueueDialog)
00056   //}}AFX_MSG_MAP
00057 END_MESSAGE_MAP()
00058
00059 /////////////////////////////////////////////////////////////////////////////
00060 // CCloseQueueDialog message handlers
00061
00062 BOOL CCloseQueueDialog::OnInitDialog()
00063 {
00064   CDialog::OnInitDialog();
00065
00066   int i;
00067
00068   // TODO: Add extra initialization here
00069   for  (i=0 ; i<m_pStrArray->GetSize() ; i++)
00070   {
00071     if ((*m_pStrArray)[i]->bFormatNameOnly)
00072     {
00073       VERIFY (m_PathNameCB.AddString((*m_pStrArray)[i]->szFormatName) != CB_ERR);
00074     }
00075     else
00076     {
00077       VERIFY (m_PathNameCB.AddString((*m_pStrArray)[i]->szPathName) != CB_ERR);
00078     }
00079   }
00080
00081     if (m_PathNameCB.GetCount() > 0) m_PathNameCB.SetCurSel(0);
00082
00083     return TRUE;  // return TRUE unless you set the focus to a control
00084                 // EXCEPTION: OCX Property Pages should return FALSE
00085 }
00086
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ThreadArgs Member List

This is the complete list of members for ThreadArgs, including all inherited members.
bImpersonating | ThreadArgs
hFileRepServer | ThreadArgs
hLocalFile | ThreadArgs
pbBuf | ThreadArgs
phContext | ThreadArgs
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/basesnap.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

basesnap.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  Abstract: This module provides the basic COM and DLL methods to create
00015 //            and load the Snap-in.  IClassFactory::CreateInstance creates
00016 //            an instance of a class whose type is passed in the constructor
00017 //
00018
00019
00020 #ifndef _BASESNAP_H_
00021 #define _BASESNAP_H_
00022
00023 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj);
00024 STDAPI DllCanUnloadNow(void);
00025
00026 //---------------------------------------------------------------------------
00027 class CClassFactory : public IClassFactory
00028 {
00029   public:
00030     enum FACTORY_TYPE {COMPONENTDATA = 0, ABOUT = 1};
00031
00032   public:
00033     CClassFactory(FACTORY_TYPE eFactoryType);
00034     ~CClassFactory();
00035
00036     STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv);
00037     STDMETHODIMP_(ULONG) AddRef();
00038     STDMETHODIMP_(ULONG) Release();
00039
00040     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID*);
00041     STDMETHODIMP LockServer(BOOL);
00042
00043   private:
00044     ULONG         m_cRef;
00045     FACTORY_TYPE  m_FactoryType;
00046
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/resource.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by PropPage.rc
00004 //
00005 #define IDB_APPIMG_32                   101
00006 #define IDB_APPIMG_16                   104
00007 #define IDI_APP_ICON                    105
00008 #define IDB_NODEIMAGES_16               106
00009 #define IDB_NODEIMAGES_32               107
00010 #define IDD_BASE_DIALOG                 108
00011 #define IDD_ADDDEVICE_DLG               109
00012 #define IDD_ADDVFILE_DLG                110
00013 #define IDD_VFILE_PPAGE0                111
00014 #define IDC_ARCHIVE_ATTR                1000
00015 #define IDC_HIDDEN_ATTR                 1001
00016 #define IDC_LOCKED_ATTR                 1002
00017 #define IDC_READONLY_ATTR               1003
00018 #define IDC_DEVNAME_EDIT                1004
00019 #define IDC_BACKUP_FLAG                 1005
00020
00021 // Next default values for new objects
00022 //
00023 #ifdef APSTUDIO_INVOKED
00024 #ifndef APSTUDIO_READONLY_SYMBOLS
00025 #define _APS_NEXT_RESOURCE_VALUE        113
00026 #define _APS_NEXT_COMMAND_VALUE         40001
00027 #define _APS_NEXT_CONTROL_VALUE         1010
00028 #define _APS_NEXT_SYMED_VALUE           101
00029 #endif
00030 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/rtcsample/rtcdialogs.h Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • rtcsample

rtcdialogs.h

Go to the documentation of this file.
00001 // rtcdialogs.h
00002 //
00003
00004 #ifndef _RTCDIALOGS_H_
00005 #define _RTCDIALOGS_H_
00006
00007 // Show the logon dialog
00008 HRESULT ShowLogonDialog(HWND hWndParent,
00009                         BSTR *pbstrURI, BSTR *pbstrServer, BSTR *pbstrTransport);
00010
00011 // Show the authentication dialog
00012 HRESULT ShowAuthDialog(HWND hWndParent, BSTR bstrOldURI,
00013                        BSTR *pbstrURI, BSTR *pbstrAccount, BSTR *pbstrPassword);
00014
00015 // Show the incoming watcher dialog
00016 HRESULT ShowWatcherDialog(HWND hWndParent,
00017                           BSTR bstrName, BSTR bstrURI,
00018                           BOOL *pfAllow, BOOL *pfAddBuddy);
00019
00020 // Show the address dialog (outgoing session/buddy)
00021 HRESULT ShowAddressDialog(HWND hWndParent,
00022                           PWSTR szTitle, BOOL fGetName,
00023                           BSTR *pbstrURI, BSTR *pbstrName);
00024
00025 // Show the incoming session dialog
00026 HRESULT ShowSessionDialog(HWND hwndParent,
00027                           BSTR bstrName, BSTR bstrURI,
00028                           BOOL *pfAccept);
00029
00030 #endif //_RTCDIALOGS_H_
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_RECVARGS Member List

This is the complete list of members for _RECVARGS, including all inherited members.
dwBufferCount | _RECVARGS
dwFlags | _RECVARGS
dwNumberOfBytesRecvd | _RECVARGS
lpBuffers | _RECVARGS
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CStringTable Member List

This is the complete list of members for CStringTable, including all inherited members.
CStringTable(HINSTANCE) | CStringTable |
FInit(UINT, UINT, UINT) | CStringTable |
m_cStrings | CStringTable | [protected]
m_hInst | CStringTable | [protected]
m_idsMax | CStringTable | [protected]
m_idsMin | CStringTable | [protected]
m_ppszTable | CStringTable | [protected]
m_pszStrings | CStringTable | [protected]
operator[](const UINT) const | CStringTable |
~CStringTable(void) | CStringTable |
Generated on Wed Nov 13 2024 16:57:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Multisel/space.Cpp Source File

  • SysMgmt
  • MMC
  • Multisel

space.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "DataObj.h"
00021 #include "Space.h"
00022 #include "Comp.h"
00023 #define STRSAFE_NO_DEPRECATE
00024 #include <strsafe.h>
00025
00026 const GUID CSpaceFolder::thisGuid = { 0x29743810, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00027 const GUID CSpaceStation::thisGuid = { 0x62273a12, 0x1914, 0x11d3, { 0x9a, 0x38, 0x0, 0x80, 0xc7, 0x25, 0x80, 0x72 } };
00028 const GUID CRocket::thisGuid = { 0x29743811, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00029
00030 //==============================================================
00031 //
00032 // CSpaceFolder implementation
00033 //
00034 //
00035 CSpaceFolder::CSpaceFolder()
00036 {
00037     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00038         children[n] = new CSpaceStation();
00039     }
00040 }
00041
00042 CSpaceFolder::~CSpaceFolder()
00043 {
00044     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00045         if (children[n]) {
00046             delete children[n];
00047         }
00048 }
00049
00050 HRESULT CSpaceFolder::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00051 {
00052     SCOPEDATAITEM sdi;
00053
00054     if (!bExpanded) {
00055         // create the child nodes, then expand them
00056         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00057             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00058             sdi.mask = SDI_STR       |   // Displayname is valid
00059                 SDI_PARAM     |   // lParam is valid
00060                 SDI_IMAGE     |   // nImage is valid
00061                 SDI_OPENIMAGE |   // nOpenImage is valid
00062                 SDI_PARENT    |
00063                 SDI_CHILDREN;
00064
00065             sdi.relativeID  = (HSCOPEITEM)parent;
00066             sdi.nImage      = children[n]->GetBitmapIndex();
00067             sdi.nOpenImage  = INDEX_OPENFOLDER;
00068             sdi.displayname = MMC_CALLBACK;
00069             sdi.lParam      = (LPARAM)children[n];       // The cookie
00070             sdi.cChildren   = 0;
00071
00072             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00073
00074             _ASSERT( SUCCEEDED(hr) );
00075
00076                     children[n]->SetHandle((HANDLE)sdi.ID);
00077         }
00078     }
00079
00080     return S_OK;
00081 }
00082
00083 //==============================================================
00084 //
00085 // CSpaceStation implementation
00086 //
00087 //
00088 CSpaceStation::CSpaceStation()
00089 {
00090     for (int n = 0; n < MAX_CHILDREN; n++) {
00091         children[n] = NULL;
00092     }
00093
00094     for (n = 0; n < NUMBER_OF_CHILDREN; n++) {
00095         children[n] = new CRocket(this, _T("Rocket"), n, 350115, 320, 52300);
00096     }
00097 }
00098
00099 CSpaceStation::~CSpaceStation()
00100 {
00101     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00102         if (children[n]) {
00103             delete children[n];
00104         }
00105 }
00106
00107
00108 HRESULT CSpaceStation::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
00109 {
00110     *pViewOptions = MMC_VIEW_OPTIONS_MULTISELECT;
00111   return S_FALSE;
00112 }
00113
00114 HRESULT CSpaceStation::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00115 {
00116     HRESULT      hr = S_OK;
00117
00118     IHeaderCtrl *pHeaderCtrl = NULL;
00119     IResultData *pResultData = NULL;
00120
00121     if (bShow) {
00122         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00123         _ASSERT( SUCCEEDED(hr) );
00124
00125         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00126         _ASSERT( SUCCEEDED(hr) );
00127
00128         // Set the column headers in the results pane
00129         hr = pHeaderCtrl->InsertColumn( 0, L"Rocket Class", 0, MMCLV_AUTO );
00130         _ASSERT( S_OK == hr );
00131         hr = pHeaderCtrl->InsertColumn( 1, L"Rocket Weight", 0, MMCLV_AUTO );
00132         _ASSERT( S_OK == hr );
00133         hr = pHeaderCtrl->InsertColumn( 2, L"Rocket Height", 0, MMCLV_AUTO );
00134         _ASSERT( S_OK == hr );
00135         hr = pHeaderCtrl->InsertColumn( 3, L"Rocket Payload", 0, MMCLV_AUTO );
00136         _ASSERT( S_OK == hr );
00137         hr = pHeaderCtrl->InsertColumn( 4, L"Status", 0, MMCLV_AUTO );
00138         _ASSERT( S_OK == hr );
00139
00140         // insert items here
00141         RESULTDATAITEM rdi;
00142
00143         hr = pResultData->DeleteAllRsltItems();
00144         _ASSERT( SUCCEEDED(hr) );
00145
00146         if (!bExpanded) {
00147             // create the child nodes, then expand them
00148             for (int n = 0; NULL != children[n]; n++) {
00149         BOOL childDeleteStatus = children[n]->getDeletedStatus();
00150         if ( !childDeleteStatus) {
00151             ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00152             rdi.mask       = RDI_STR       |   // Displayname is valid
00153                              RDI_IMAGE     |
00154                              RDI_PARAM;        // nImage is valid
00155
00156             rdi.nImage      = children[n]->GetBitmapIndex();
00157             rdi.str         = MMC_CALLBACK;
00158             rdi.nCol        = 0;
00159             rdi.lParam      = (LPARAM)children[n];
00160
00161             hr = pResultData->InsertItem( &rdi );
00162
00163             _ASSERT( SUCCEEDED(hr) );
00164
00165             children[n]->SetHandle((HANDLE)rdi.itemID);
00166                  }
00167             }
00168         }
00169
00170         pHeaderCtrl->Release();
00171         pResultData->Release();
00172     }
00173
00174     return hr;
00175 }
00176
00177 HRESULT CSpaceStation::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00178 {
00179     IConsoleVerb *pConsoleVerb;
00180
00181     HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00182     _ASSERT(SUCCEEDED(hr));
00183
00184     hr = pConsoleVerb->SetVerbState(MMC_VERB_PASTE, ENABLED, TRUE);
00185
00186     pConsoleVerb->Release();
00187
00188     return S_OK;
00189 }
00190
00191 HRESULT CSpaceStation::OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype)
00192
00193 {
00194   HRESULT hr = S_OK;
00195
00196   _ASSERT(item);
00197   _ASSERT(SCOPE == itemtype);
00198
00199   //refresh all result pane views
00200   hr = pConsole->SelectScopeItem( (HSCOPEITEM)item );
00201   _ASSERT( S_OK == hr);
00202
00203   return hr;
00204 }
00205
00206
00207 //==============================================================
00208 //
00209 // CRocket implementation
00210 //
00211 //
00212 CRocket::CRocket(CSpaceStation *pSpaceStation, _TCHAR *szName, int id, LONG lWeight, LONG lHeight, LONG lPayload)
00213 : m_pSpaceStation(pSpaceStation), szName(NULL), lWeight(0), lHeight(0), lPayload(0), iStatus(STOPPED)
00214 {
00215     if (szName) {
00216         this->szName = new _TCHAR[(_tcslen(szName) + 1) * sizeof(_TCHAR)];
00217         _tcscpy(this->szName, szName);
00218     }
00219
00220     this->nId = id;
00221     this->lWeight = lWeight;
00222     this->lHeight = lHeight;
00223     this->lPayload = lPayload;
00224
00225   isDeleted = FALSE;
00226 }
00227
00228 CRocket::~CRocket()
00229 {
00230     if (szName)
00231         delete [] szName;
00232 }
00233
00234 const _TCHAR *CRocket::GetDisplayName(int nCol)
00235 {
00236     const size_t cchBuffer = 128;
00237     static _TCHAR buf[cchBuffer];
00238
00239     // StringCchPrintf and StringCchCopy always null-terminate the destination string.
00240     // However the string may be a truncation of the ideal result (indicated by  return value other than S_OK).
00241
00242     switch (nCol) {
00243     case 0:
00244         StringCchPrintf(buf, cchBuffer, _T("%s (#%d)"), szName ? szName : _T(""), nId);
00245         break;
00246
00247     case 1:
00248         StringCchPrintf(buf, cchBuffer, _T("%ld metric tons"), lWeight);
00249         break;
00250
00251     case 2:
00252         StringCchPrintf(buf, cchBuffer, _T("%ld meters"), lHeight);
00253         break;
00254
00255     case 3:
00256         StringCchPrintf(buf, cchBuffer, _T("%ld kilos"), lPayload);
00257         break;
00258
00259     case 4:
00260         StringCchPrintf(buf, cchBuffer, _T("%s"),
00261             iStatus == RUNNING ? _T("running") :
00262         iStatus == PAUSED ? _T("paused") :
00263         iStatus == STOPPED ? _T("stopped") : _T("unknown"));
00264         break;
00265
00266     }
00267
00268     return buf;
00269 }
00270
00271
00272 HRESULT CRocket::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect)
00273 {
00274     IConsoleVerb *pConsoleVerb;
00275
00276     HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb);
00277     _ASSERT(SUCCEEDED(hr));
00278
00279   //MMC automatically disables rename verb during a multiselection
00280     hr = pConsoleVerb->SetVerbState(MMC_VERB_RENAME, ENABLED, TRUE);
00281     hr = pConsoleVerb->SetVerbState(MMC_VERB_DELETE, ENABLED, TRUE);
00282
00283     pConsoleVerb->Release();
00284
00285     return S_OK;
00286 }
00287
00288 HRESULT CRocket::OnRefresh(IConsole *pConsole)
00289
00290 {
00291   //Call IConsole::UpdateAllViews to redraw all views
00292   //owned by the parent scope item
00293
00294   IDataObject *pDummy = NULL;
00295   HANDLE handle  = m_pSpaceStation->GetHandle();
00296
00297   HRESULT hr;
00298
00299   hr = pConsole->UpdateAllViews(pDummy, (long)handle, UPDATE_SCOPEITEM);
00300   _ASSERT( S_OK == hr);
00301
00302   return hr;
00303 }
00304
00305 HRESULT CRocket::OnDelete(IConsole *pConsole)
00306 {
00307
00308   _ASSERT( NULL != this );
00309
00310   HRESULT hr = S_OK;
00311
00312   //Delete the item. The IConsole that is passed into DeleteChild
00313   //is from the child result item, so we can use it to QI for IResultData
00314   IResultData *pResultData = NULL;
00315
00316   hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00317   _ASSERT( SUCCEEDED(hr) );
00318
00319   HRESULTITEM childresultitem;
00320
00321   _ASSERT( NULL != &childresultitem );
00322
00323     //lparam == this. See CSpaceVehicle::OnShow
00324     hr = pResultData->FindItemByLParam( (LPARAM)this, &childresultitem );
00325     if ( FAILED(hr) )
00326     {
00327         // Failed : Reason may be that current view does not have this item.
00328         // So exit gracefully.
00329         hr = S_FALSE;
00330     } else
00331
00332     {
00333         hr = pResultData->DeleteItem( childresultitem, 0 );
00334         _ASSERT( SUCCEEDED(hr) );
00335     }
00336
00337     pResultData->Release();
00338
00339
00340   //Now set child's isDeleted member to true so that the parent doesn't try to
00341   //to insert it again in CSpaceVehicle::OnShow. Admittedly, a hack...
00342   isDeleted = TRUE;
00343
00344   return hr;
00345 }
00346
00347 HRESULT CRocket::OnRename(LPOLESTR pszNewName)
00348 {
00349
00350   HRESULT hr = S_FALSE;
00351
00352   if (szName) {
00353         delete [] szName;
00354         szName = NULL;
00355     }
00356
00357     MAKE_TSTRPTR_FROMWIDE(ptrname, pszNewName);
00358     szName = new _TCHAR[(_tcslen(ptrname) + 1) * sizeof(_TCHAR)];
00359     _tcscpy(szName, ptrname);
00360
00361     return hr;
00362 }
00363
00364
00365 HRESULT CRocket::OnUpdateItem(IConsole *pConsole, long item, ITEM_TYPE itemtype)
00366
00367 {
00368   HRESULT hr = S_FALSE;
00369
00370   _ASSERT(NULL != this || isDeleted || RESULT == itemtype);
00371
00372   //redraw the item
00373   IResultData *pResultData = NULL;
00374
00375   hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00376   _ASSERT( SUCCEEDED(hr) );
00377
00378   HRESULTITEM myhresultitem;
00379   _ASSERT(NULL != &myhresultitem);
00380
00381   //lparam == this. See CSpaceStation::OnShow
00382   hr = pResultData->FindItemByLParam( (LPARAM)this, &myhresultitem );
00383
00384   if ( FAILED(hr) ) {
00385     //there is no HRESULTITEM for the item, because
00386     //the item is not inserted in the current view. Exit gracefully
00387     hr = S_FALSE;
00388   } else
00389
00390   {
00391     hr = pResultData->UpdateItem( myhresultitem );
00392     _ASSERT( SUCCEEDED(hr) );
00393   }
00394
00395   pResultData->Release();
00396
00397   return hr;
00398 }
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/Factory.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

Factory.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      FACTORY.H
00003
00004   Summary:   Include file for the class factory COM object: CFPaper. This
00005              constitutes the DCDSERVE server's class factory for the
00006              SharePaper COM component.
00007
00008              The multiple interface COM Object Class is achieved via the
00009              technique of nested classes: the implementation of the
00010              standard IClassFactory interface is nested inside of the
00011              class factory COM object class. APPUTIL's CThreaded OwnThis
00012              mechanism is used to ensure mutually exclusive access to the
00013              class factory by contending multiple threads.
00014
00015              For a comprehensive tutorial code tour of this module's
00016              contents and offerings see the tutorial DCDSERVE.HTM
00017              file. For more specific technical details on the internal
00018              workings see the comments dispersed throughout the module's
00019              source code.
00020
00021   Classes:   CFPaper.
00022
00023   Functions: .
00024
00025   Origin:    8-23-97: atrent - Editor-inheritance from FACTORY.H in
00026                the CONSERVE Tutorial Code Sample. [Revised]
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 #if !defined(FACTORY_H)
00044 #define FACTORY_H
00045
00046 #ifdef __cplusplus
00047
00048 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00049   ObjectClass: CFPaper
00050
00051   Summary:     Class Factory COM Object Class for SharePaper COM
00052                components. Used to manufacture COPaper COM objects.  The
00053                mulitple interfaces on this COM object class are
00054                constructed via the nested interface classes technique.
00055
00056   Interfaces:  IUnknown
00057                  Standard interface providing COM object features.
00058                IClassFactory
00059                  Standard interface providing COM Class Factory features.
00060
00061   Aggregation: Yes, CFPaper COM objects are aggregatable by
00062                passing a non-NULL pUnkOuter IUnknown pointer into the
00063                constructor.
00064 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00065 class CFPaper : public IUnknown, public CThreaded
00066 {
00067   public:
00068     // Main Object Constructor & Destructor.
00069     CFPaper(IUnknown* pUnkOuter, CServer* pServer);
00070     ~CFPaper(void);
00071
00072     // IUnknown methods. Main object, non-delegating.
00073     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00074     STDMETHODIMP_(ULONG) AddRef(void);
00075     STDMETHODIMP_(ULONG) Release(void);
00076
00077     // We declare nested class interface implementations here.
00078
00079     // We implement the IClassFactory interface in this class
00080     // factory COM object class. Derive also from abstract CThreaded
00081     // to provide the OwnThis/UnownThis thread-safety mechanism.
00082     class CImpIClassFactory : public IClassFactory, public CThreaded
00083     {
00084       public:
00085         // Interface Implementation Constructor & Destructor.
00086         CImpIClassFactory(
00087           CFPaper* pCO,
00088           IUnknown* pUnkOuter,
00089           CServer* pServer);
00090         ~CImpIClassFactory(void);
00091
00092         // IUnknown methods.
00093         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00094         STDMETHODIMP_(ULONG) AddRef(void);
00095         STDMETHODIMP_(ULONG) Release(void);
00096
00097         // IClassFactory methods.
00098         STDMETHODIMP         CreateInstance(IUnknown*, REFIID, PPVOID);
00099         STDMETHODIMP         LockServer(BOOL);
00100
00101       private:
00102         // Data private to this interface implementation of IClassFactory.
00103         CFPaper*      m_pCO;         // Parent Object back pointer.
00104         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00105         CServer*      m_pServer;     // Server's control object.
00106     };
00107
00108     // Make the otherwise private and nested IClassFactory interface
00109     // implementation a friend to COM object instantiations of this
00110     // CFPaper COM object class.
00111     friend CImpIClassFactory;
00112
00113   private:
00114     // Private data of CFPaper COM objects.
00115
00116     // Nested IClassFactory implementation instantiation.
00117     CImpIClassFactory m_ImpIClassFactory;
00118
00119     // Main Object reference count.
00120     ULONG             m_cRefs;
00121
00122     // Outer unknown (aggregation & delegation). Used when this
00123     // CFPaper object is being aggregated.  Otherwise it is used
00124     // for delegation if this object is reused via containment.
00125     IUnknown*         m_pUnkOuter;
00126
00127     // Pointer to this component server's control object.
00128     CServer*          m_pServer;
00129 };
00130
00131
00132 #endif // __cplusplus
00133
00134
00135 #endif // FACTORY_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/property.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

property.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module PROPERTY.H
00008 //
00009 //-----------------------------------------------------------------------------
00010 #ifndef _PROPERTY_H_
00011 #define _PROPERTY_H_
00012
00013
00014 ///////////////////////////////////////////////////////////////
00015 // Includes
00016 //
00017 ///////////////////////////////////////////////////////////////
00018
00019
00020 ///////////////////////////////////////////////////////////////
00021 // TPropBase
00022 //
00023 ///////////////////////////////////////////////////////////////
00024 template <class TYPE> class TPropBase : public CVector<TYPE>
00025 {
00026 public:
00027   //constructors
00028   TPropBase(ULONG cElements = 0, TYPE* rgElements = NULL);
00029   virtual ~TPropBase();
00030
00031   //Interface
00032   virtual TYPE*     GetProperties()   { return (TYPE*)GetElements(); }
00033
00034   //Interating
00035   virtual TYPE*     AddProperty(DBPROPID dwPropertyID, const DBID& colid);
00036
00037   //Pure Virtual
00038   //NOTE: The base class can't implement this for two reasons.  First is that
00039   //the structures are not the same, ie: they all don't have a dwPropertyID member
00040   //(DBPROPID is just a DWORD array).  Second is that some require comparing colid's as well...
00041   virtual TYPE*     FindProperty(DBPROPID dwPropertyID, const DBID& colid) = 0;
00042
00043 protected:
00044   //data
00045 };
00046
00047
00048 ///////////////////////////////////////////////////////////////
00049 // CProperties
00050 //
00051 ///////////////////////////////////////////////////////////////
00052 class CProperties : public TPropBase<DBPROP>
00053 {
00054 public:
00055   //constructors
00056   CProperties(DBPROPSET* pPropSet = NULL);
00057   virtual ~CProperties();
00058
00059   //Interface
00060   virtual void      Attach(DBPROPSET* pPropSet);
00061   virtual void      Detach(DBPROPSET* pPropSet);
00062
00063   //Overloads
00064   virtual void      RemoveAll();
00065   virtual DBPROP*     FindProperty(DBPROPID dwPropertyID, const DBID& colid);
00066
00067   //Helpers
00068   virtual HRESULT     SetProperty(DBPROPID dwPropertyID, DBTYPE wType, void* pv, DBPROPOPTIONS dwOptions = DBPROPOPTIONS_REQUIRED, const DBID& colid = DB_NULLID);
00069
00070
00071 protected:
00072   //data
00073 };
00074
00075
00076 ///////////////////////////////////////////////////////////////
00077 // CPropertyInfos
00078 //
00079 ///////////////////////////////////////////////////////////////
00080 class CPropertyInfos  : public TPropBase<DBPROPINFO>
00081 {
00082 public:
00083   //constructors
00084   CPropertyInfos(DBPROPINFOSET* pPropInfoSet = NULL);
00085   virtual ~CPropertyInfos();
00086
00087   //Interface
00088   virtual void      Attach(DBPROPINFOSET* pPropSet);
00089   virtual void      Detach(DBPROPINFOSET* pPropSet);
00090
00091   //Overloads
00092   virtual void      RemoveAll();
00093   virtual DBPROPINFO*   FindProperty(DBPROPID dwPropertyID, const DBID& colid);
00094
00095   //Helpers
00096 //  virtual HRESULT     SetProperty(DBPROPID dwPropertyID);
00097
00098 protected:
00099   //data
00100 };
00101
00102
00103 ///////////////////////////////////////////////////////////////
00104 // CPropertyIDs
00105 //
00106 ///////////////////////////////////////////////////////////////
00107 class CPropertyIDs  : public TPropBase<DBPROPID>
00108 {
00109 public:
00110   //constructors
00111   CPropertyIDs(DBPROPIDSET* pPropSet = NULL);
00112   virtual ~CPropertyIDs();
00113
00114   //Interface
00115   virtual void      Attach(DBPROPIDSET* pPropSet);
00116   virtual void      Detach(DBPROPIDSET* pPropSet);
00117
00118   //Overloads
00119   virtual DBPROPID*   FindProperty(DBPROPID dwPropertyID, const DBID& colid);
00120
00121   //Helpers
00122   virtual HRESULT     SetProperty(DBPROPID dwPropertyID);
00123
00124 protected:
00125   //data
00126 };
00127
00128
00129 ///////////////////////////////////////////////////////////////
00130 // TPropSetBase
00131 //
00132 ///////////////////////////////////////////////////////////////
00133 template <class TYPE, class OBJTYPE> class TPropSetBase : public CVector<TYPE>
00134 {
00135 public:
00136   //constructors
00137   TPropSetBase(ULONG cElements = 0, TYPE* rgElements = NULL);
00138   virtual ~TPropSetBase();
00139
00140   //Overloads
00141   virtual void      RemoveAll();
00142
00143   //Interface
00144   virtual TYPE*     GetPropSets() { return (TYPE*)GetElements(); }
00145
00146   //Interating
00147   virtual TYPE*     AddPropSet(REFGUID guidPropertySet);
00148   virtual TYPE*     FindPropSet(REFGUID guidPropertySet);
00149
00150 protected:
00151   //data
00152
00153 private:
00154 };
00155
00156
00157
00158 ///////////////////////////////////////////////////////////////
00159 // CPropSets
00160 //
00161 ///////////////////////////////////////////////////////////////
00162 class CPropSets : public TPropSetBase<DBPROPSET, CProperties>
00163 {
00164 public:
00165   //constructors
00166   CPropSets(ULONG cPropSets = 0, DBPROPSET* rgPropSets = NULL);
00167   virtual ~CPropSets();
00168
00169   //Helpers
00170   virtual HRESULT     SetProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet, DBTYPE wType, void* pv, DBPROPOPTIONS dwOptions = DBPROPOPTIONS_REQUIRED, const DBID& colid = DB_NULLID);
00171   virtual DBPROP*     FindProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet, const DBID& colid);
00172
00173 protected:
00174   //data
00175 };
00176
00177
00178
00179 ///////////////////////////////////////////////////////////////
00180 // CPropInfoSets
00181 //
00182 ///////////////////////////////////////////////////////////////
00183 class CPropInfoSets : public TPropSetBase<DBPROPINFOSET, CPropertyInfos>
00184 {
00185 public:
00186   //constructors
00187   CPropInfoSets(ULONG cPropInfoSets = 0, DBPROPINFOSET* rgPropInfoSets = NULL);
00188   virtual ~CPropInfoSets();
00189
00190   //Helpers
00191 //  virtual HRESULT     SetProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet, DBTYPE wType, void* pv, DBPROPOPTIONS dwOptions = DBPROPOPTIONS_REQUIRED, const DBID& colid = DB_NULLID);
00192   virtual DBPROPINFO*   FindProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet);
00193
00194 protected:
00195   //data
00196 };
00197
00198
00199 ///////////////////////////////////////////////////////////////
00200 // CPropIDSets
00201 //
00202 ///////////////////////////////////////////////////////////////
00203 class CPropIDSets : public TPropSetBase<DBPROPIDSET, CPropertyIDs>
00204 {
00205 public:
00206   //constructors
00207   CPropIDSets(ULONG cPropIDSets = 0, DBPROPIDSET* rgPropIDSets = NULL);
00208   virtual ~CPropIDSets();
00209
00210   //Helpers
00211   virtual HRESULT     SetProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet);
00212   virtual DBPROPID*   FindProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet);
00213
00214 protected:
00215   //data
00216 };
00217
00218
00219
00220 ////////////////////////////////////////////////////////////////////////////
00221 // Properties
00222 //
00223 ////////////////////////////////////////////////////////////////////////////
00224
00225 //Find Property
00226 DBPROPINFOSET*  FindPropSet(REFGUID guidPropertySet, ULONG cPropInfoSets, DBPROPINFOSET* rgPropInfoSets);
00227 DBPROPINFO*   FindProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet, ULONG cPropInfoSets, DBPROPINFOSET* rgPropInfoSets);
00228
00229 //Combine Proeprties
00230 HRESULT     CombineProperties(ULONG* pcPropInfoSets, DBPROPINFOSET** prgPropInfoSets, ULONG cPropInfoSets2, DBPROPINFOSET* rgPropInfoSets2, BOOL bFreeAddedPropSet = TRUE);
00231 HRESULT     CombineProperties(ULONG* pcPropInfoSets, DBPROPINFOSET** prgPropInfoSets, ULONG cPropSets2, DBPROPSET* rgPropSets2, BOOL bFreeAddedPropSet = TRUE);
00232
00233 //Property Info
00234 HRESULT     GetPropInfo(IDBProperties* pIDBProperties, DBPROPID dwPropertyID, REFGUID guidPropertySet, DBPROPINFO** ppPropInfo);
00235 DBPROPFLAGS   GetPropInfoFlags(IDBProperties* pIDBProperties, DBPROPID dwPropertyID, REFGUID guidPropertySet);
00236
00237 //Property Flags
00238 BOOL      IsSupportedProperty(IDBProperties* pIDBProperties, DBPROPID dwPropertyID, REFGUID guidPropertySet);
00239 BOOL      IsSettableProperty(IDBProperties* pIDBProperties, DBPROPID dwPropertyID, REFGUID guidPropertySet);
00240
00241 //Get Property
00242 HRESULT     GetProperty(REFIID riid, IUnknown* pIUnknown, DBPROPID dwPropertyID, REFGUID guidPropertySet, DBPROP** ppProperty);
00243 HRESULT     GetProperty(REFIID riid, IUnknown* pIUnknown, DBPROPID dwPropertyID, REFGUID guidPropertySet, DBTYPE wType, void* pv);
00244
00245 //Set Property
00246 HRESULT     SetProperty(DBPROPID dwPropertyID, REFGUID guidPropertySet, ULONG* pcPropSets, DBPROPSET** prgPropSets, DBTYPE wType, void* pv, DBPROPOPTIONS dwOptions = DBPROPOPTIONS_REQUIRED, const DBID& colid = DB_NULLID);
00247
00248 //Free Property
00249 HRESULT     FreeProperties(ULONG* pcPropSets, DBPROPSET** prgPropSets);
00250 HRESULT     FreeProperties(ULONG* pcPropIDSets, DBPROPIDSET** prgPropIDSets);
00251 HRESULT     FreeProperties(ULONG* pcPropInfoSets, DBPROPINFOSET** prgPropInfoSets);
00252 HRESULT     FreeProperties(ULONG* pcProperties, DBPROP** prgProperties);
00253
00254
00255 #endif  //_PROPERTY_H_
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CTSFEditWnd Member List

This is the complete list of members for CTSFEditWnd, including all inherited members.
_CanPlaybackSelection(void) | CTSFEditWnd | [private]
_CanReconvertSelection(void) | CTSFEditWnd | [private]
_ClearAdviseSink(PADVISE_SINK pAdviseSink) | CTSFEditWnd | [private]
_ClearRequestedAttributes(void) | CTSFEditWnd | [private]
_ClearText(void) | CTSFEditWnd | [private]
_GetComposing(void) | CTSFEditWnd |
_GetCurrentSelection(void) | CTSFEditWnd | [private]
_GetDisplayAttributes(void) | CTSFEditWnd |
_GetReadingText(void) | CTSFEditWnd |
_GetText(LPWSTR *ppwsz, LPLONG pcch=NULL) | CTSFEditWnd | [private]
_GetTextOwner(void) | CTSFEditWnd |
_GetWindow() | CTSFEditWnd |
_InitFunctionProvider() | CTSFEditWnd | [private]
_Initialize(ITfThreadMgr *pThreadMgr, TfClientId tfcId) | CTSFEditWnd |
_InternalLockDocument(DWORD dwLockFlags) | CTSFEditWnd | [private]
_InternalUnlockDocument() | CTSFEditWnd | [private]
_IsLocked(DWORD dwLockType) | CTSFEditWnd | [private]
_Load(IStream *pStream) | CTSFEditWnd | [private]
_LoadFromFile(LPTSTR pszFile) | CTSFEditWnd |
_LockDocument(DWORD dwLockFlags) | CTSFEditWnd | [private]
_OnCommand(WORD, WORD, HWND) | CTSFEditWnd | [private]
_OnCreate(VOID) | CTSFEditWnd | [private]
_OnDestroy(VOID) | CTSFEditWnd | [private]
_OnEditChange(void) | CTSFEditWnd | [private]
_OnEditKillFocus(VOID) | CTSFEditWnd | [private]
_OnEditSetFocus(VOID) | CTSFEditWnd | [private]
_OnGetPreservedKey() | CTSFEditWnd |
_OnInitMenuPopup(WPARAM, LPARAM) | CTSFEditWnd |
_OnKillFocus(VOID) | CTSFEditWnd | [private]
_OnNotify(UINT, LPNMHDR) | CTSFEditWnd | [private]
_OnSetFocus(VOID) | CTSFEditWnd | [private]
_OnSize(WPARAM, LPARAM) | CTSFEditWnd | [private]
_OnTest(void) | CTSFEditWnd |
_OnUpdate(void) | CTSFEditWnd |
_Playback(void) | CTSFEditWnd |
_Reconvert(void) | CTSFEditWnd |
_Save(IStream *pStream) | CTSFEditWnd | [private]
_SaveToFile(LPTSTR pszFile) | CTSFEditWnd |
_TerminateAllCompositions(void) | CTSFEditWnd |
_TestInsert(LONG acpTestStart, LONG acpTestEnd, ULONG cch, LONG *pacpResultStart, LONG *pacpResultEnd) | CTSFEditWnd | [private]
_UninitFunctionProvider() | CTSFEditWnd | [private]
_Uninitialize() | CTSFEditWnd |
_UnlockDocument() | CTSFEditWnd | [private]
_UpdateStatusBar(void) | CTSFEditWnd | [private]
_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam) | CTSFEditWnd | [private, static]
AdviseSink(REFIID riid, IUnknown *punk, DWORD dwMask) | CTSFEditWnd |
CTSFEditWnd(HINSTANCE hInstance, HWND hwndParent) | CTSFEditWnd |
FindNextAttrTransition(LONG acpStart, LONG acpHalt, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags, LONG *pacpNext, BOOL *pfFound, LONG *plFoundOffset) | CTSFEditWnd |
GetACPFromPoint(TsViewCookie vcView, const POINT *pt, DWORD dwFlags, LONG *pacp) | CTSFEditWnd |
GetActiveView(TsViewCookie *pvcView) | CTSFEditWnd |
GetDescription(BSTR *pbstrDesc) | CTSFEditWnd |
GetEmbedded(LONG acpPos, REFGUID rguidService, REFIID riid, IUnknown **ppunk) | CTSFEditWnd |
GetEndACP(LONG *pacp) | CTSFEditWnd |
GetFormattedText(LONG acpStart, LONG acpEnd, IDataObject **ppDataObject) | CTSFEditWnd |
GetFunction(REFGUID rguid, REFIID riid, IUnknown **ppunk) | CTSFEditWnd |
GetScreenExt(TsViewCookie vcView, RECT *prc) | CTSFEditWnd |
GetSelection(ULONG ulIndex, ULONG ulCount, TS_SELECTION_ACP *pSelection, ULONG *pcFetched) | CTSFEditWnd |
GetStatus(TS_STATUS *pdcs) | CTSFEditWnd |
GetText(LONG acpStart, LONG acpEnd, WCHAR *pchPlain, ULONG cchPlainReq, ULONG *pcchPlainOut, TS_RUNINFO *prgRunInfo, ULONG ulRunInfoReq, ULONG *pulRunInfoOut, LONG *pacpNext) | CTSFEditWnd |
GetTextExt(TsViewCookie vcView, LONG acpStart, LONG acpEnd, RECT *prc, BOOL *pfClipped) | CTSFEditWnd |
GetType(GUID *pguid) | CTSFEditWnd |
GetWnd(TsViewCookie vcView, HWND *phwnd) | CTSFEditWnd |
InsertEmbedded(DWORD dwFlags, LONG acpStart, LONG acpEnd, IDataObject *pDataObject, TS_TEXTCHANGE *pChange) | CTSFEditWnd |
InsertEmbeddedAtSelection(DWORD dwFlags, IDataObject *pDataObject, LONG *pacpStart, LONG *pacpEnd, TS_TEXTCHANGE *pChange) | CTSFEditWnd |
InsertTextAtSelection(DWORD dwFlags, const WCHAR *pchText, ULONG cch, LONG *pacpStart, LONG *pacpEnd, TS_TEXTCHANGE *pChange) | CTSFEditWnd |
m_acpEnd | CTSFEditWnd | [private]
m_acpStart | CTSFEditWnd | [private]
m_ActiveSelEnd | CTSFEditWnd | [private]
m_AdviseSink | CTSFEditWnd | [private]
m_cchOldLength | CTSFEditWnd | [private]
m_cCompositions | CTSFEditWnd | [private]
m_dwInternalLockType | CTSFEditWnd | [private]
m_dwLockType | CTSFEditWnd | [private]
m_EditCookie | CTSFEditWnd | [private]
m_fInterimChar | CTSFEditWnd | [private]
m_fLayoutChanged | CTSFEditWnd | [private]
m_fLocked | CTSFEditWnd | [private]
m_fNotify | CTSFEditWnd | [private]
m_fPendingLockUpgrade | CTSFEditWnd | [private]
m_hInst | CTSFEditWnd | [private]
m_hWnd | CTSFEditWnd | [private]
m_hwndEdit | CTSFEditWnd | [private]
m_hwndParent | CTSFEditWnd | [private]
m_hwndStatus | CTSFEditWnd | [private]
m_ObjRefCount | CTSFEditWnd | [private]
m_pCategoryMgr | CTSFEditWnd | [private]
m_pContext | CTSFEditWnd | [private]
m_pDisplayAttrMgr | CTSFEditWnd | [private]
m_pDocMgr | CTSFEditWnd | [private]
m_pPrevDocMgr | CTSFEditWnd | [private]
m_pServices | CTSFEditWnd | [private]
m_pThreadMgr | CTSFEditWnd | [private]
m_rgAttributes | CTSFEditWnd | [private]
m_rgCompositions | CTSFEditWnd | [private]
m_tfClientID | CTSFEditWnd | [private]
OnEndComposition(ITfCompositionView *pComposition) | CTSFEditWnd |
OnStartComposition(ITfCompositionView *pComposition, BOOL *pfOk) | CTSFEditWnd |
OnUpdateComposition(ITfCompositionView *pComposition, ITfRange *pRangeNew) | CTSFEditWnd |
QueryInsert(LONG acpTestStart, LONG acpTestEnd, ULONG cch, LONG *pacpResultStart, LONG *pacpResultEnd) | CTSFEditWnd |
QueryInsertEmbedded(const GUID *pguidService, const FORMATETC *pFormatEtc, BOOL *pfInsertable) | CTSFEditWnd |
QueryInterface(REFIID, LPVOID *) | CTSFEditWnd |
RequestAttrsAtPosition(LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags) | CTSFEditWnd |
RequestAttrsTransitioningAtPosition(LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags) | CTSFEditWnd |
RequestLock(DWORD dwLockFlags, HRESULT *phrSession) | CTSFEditWnd |
RequestSupportedAttrs(DWORD dwFlags, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs) | CTSFEditWnd |
RetrieveRequestedAttrs(ULONG ulCount, TS_ATTRVAL *paAttrVals, ULONG *pcFetched) | CTSFEditWnd |
SetSelection(ULONG ulCount, const TS_SELECTION_ACP *pSelection) | CTSFEditWnd |
SetText(DWORD dwFlags, LONG acpStart, LONG acpEnd, const WCHAR *pchText, ULONG cch, TS_TEXTCHANGE *pChange) | CTSFEditWnd |
STDMETHOD_(DWORD, AddRef)() | CTSFEditWnd |
STDMETHOD_(DWORD, Release)() | CTSFEditWnd |
UnadviseSink(IUnknown *punk) | CTSFEditWnd |
~CTSFEditWnd() | CTSFEditWnd |
Generated on Wed Nov 13 2024 16:57:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/site.h Source File

  • Com
  • Fundamentals
  • SimpDnd

site.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: SITE.H
00003 //
00004 //      Definition of CSimpleSite
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008 #if !defined( _SITE_H_ )
00009 #define _SITE_H_
00010
00011 #include <ole2.h>
00012 #include "ias.h"
00013 #include "iocs.h"
00014
00015 class CSimpleDoc;
00016
00017 class CSimpleSite : public IUnknown
00018 {
00019 public:
00020   int m_nCount;
00021   LPOLEOBJECT m_lpOleObject;
00022   DWORD m_dwDrawAspect;
00023   SIZEL m_sizel;
00024   BOOL m_fObjectOpen;
00025   LPSTORAGE m_lpObjStorage;
00026
00027   CAdviseSink m_AdviseSink;
00028   COleClientSite m_OleClientSite;
00029
00030   CSimpleDoc FAR * m_lpDoc;
00031
00032   // IUnknown Interfaces
00033   STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
00034   STDMETHODIMP_(ULONG) AddRef();
00035   STDMETHODIMP_(ULONG) Release();
00036
00037   void InitObject(BOOL fCreateNew);
00038   static CSimpleSite FAR * Create(CSimpleDoc FAR *lpDoc);
00039   CSimpleSite(CSimpleDoc FAR *lpDoc);
00040   ~CSimpleSite();
00041   void PaintObj(HDC hDC);
00042   void GetObjRect(LPRECT lpRect);
00043   void CloseOleObject(void);
00044   void UnloadOleObject(void);
00045 };
00046
00047 #endif  // _SITE_H_
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNewsJAVA/ComAdmin/COMAdminSynchronizationOptions.java Source File

  • Com
  • Services
  • Events
  • EventNewsJAVA
  • ComAdmin

COMAdminSynchronizationOptions.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.3167.1
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe"   /w /xi /X:rkc /l "D:\DOCUME~1\a-joest\LOCALS~1\Temp\jvc6EA.tmp" /nologo /d "D:\Documents and Settings\a-joest\Desktop\Sunil" "A:\comadmin.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package comadmin;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: COMAdminSynchronizationOptions
00019
00020 public interface COMAdminSynchronizationOptions
00021 {
00022   public static final int COMAdminSynchronizationIgnored = 0;
00023   public static final int COMAdminSynchronizationNone = 1;
00024   public static final int COMAdminSynchronizationSupported = 2;
00025   public static final int COMAdminSynchronizationRequired = 3;
00026   public static final int COMAdminSynchronizationRequiresNew = 4;
00027 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/dxtrans/dxsurf3/dxsurf3.cpp Source File

  • Web
  • dxtrans
  • dxsurf3

dxsurf3.cpp

Go to the documentation of this file.
00001 ///////////////////////////////////////////////////////////////////////////////
00002 // DXSurf3.cpp
00003 //
00004 // This sample shows a fractal being rendered translucently over a parrot.
00005 //
00006 // This sample demonstrates
00007 // - using a DXSurface in fullscreen and windowed mode
00008 // - loading an image onto a DXSurface
00009 // - directly manipulating the Alpha, Red, Green, and Blue components of pixels
00010 // - using GDI operations on DXSurfaces
00011 // - using a DXTransform to scale a DXSurface to fit the window
00012 //   (Use this instead of StretchBlt() to preserve alpha quality.)
00013 //
00014 // USAGE:
00015 //      c:> dxsurf3.exe [-width xxx -height yyy -bpp zzz -windowed]
00016 //               xxx specifies the width in pixels of the window, e.g. 1024
00017 //               yyy specifies the height in pixels of the window, e.g. 768
00018 //               zzz specifies the bits-per-pixel of the window, e.g. 16
00019 //               -windowed indicates whether to run in a window or fullscreen
00020 //
00021 // NOTE:
00022 // The PTSTR type and the TEXT() macro deal with ANSI / Multibyte Character
00023 // compatibility.  For further information see the Unicode topic in the
00024 // Developer Studio documentation or in MSDN.
00025 //
00026 // Copyright (c) 2001 Microsoft Corporation.  All rights reserved.
00027 ///////////////////////////////////////////////////////////////////////////////
00028
00029 #define STRICT
00030 #include <atlbase.h>
00031 #include <windows.h>
00032 #include <DXTrans.h>
00033 #include <DXTGuid.c>
00034 #include <DXBounds.h>
00035 #include <DXHelper.h>
00036 #include <DXTError.h>
00037 #include <stdlib.h>
00038 #include <time.h>
00039 #include <assert.h>
00040 #include <string.h>
00041 #include <mmsystem.h>
00042 #include <stdio.h>
00043 #include "resource.h"
00044
00045 #define SAFE_RELEASE(ptr) if(ptr) { ptr->Release(); ptr = NULL; }
00046 #define NUMPIXELSTODRAW 100 // Draw this many pixels per rendering iteration.
00047
00048 typedef struct
00049 {
00050     int         nWidth;
00051     int         nHeight;
00052     int         nBPP;
00053     BOOL        bWindowed;
00054     HINSTANCE   hInstance;
00055 } WININFO;
00056
00057 BOOL ParseCommandLine(WININFO*, PTSTR);
00058 BOOL InitInstance(WININFO*, PTSTR);
00059 int FindNumWithParameter(PTSTR);
00060 int FindParameter(PTSTR);
00061 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00062 void GetImageDirectoryAndFileName(PWSTR, PCWSTR);
00063
00064 static WCHAR g_wstrImagePathAndFile[_MAX_PATH + _MAX_FNAME + _MAX_EXT];
00065
00066 ///////////////////////////////////////////////////////////////////////////////
00067 int WINAPI WinMain(HINSTANCE    hInstance,
00068                    HINSTANCE /* hPrevInstance */,
00069                    PTSTR        pszCmdLine,
00070                    int       /* nCmdShow */)
00071 ///////////////////////////////////////////////////////////////////////////////
00072 {
00073     static  WININFO wi;
00074             PTSTR   pstrClassName = TEXT("DXSurface Sample 3");
00075             HWND    hWnd;
00076             DWORD   dwStyle, dwExStyle;
00077             int     nX, nY;
00078             MSG     msg;
00079             int     nEdgeX, nEdgeY, nTopY;
00080             DWORD   dwPresentTime, dwLastTime;
00081             HMENU   hMenu;
00082
00083     CoInitialize(NULL);
00084
00085     wi.hInstance = hInstance;
00086     if(!ParseCommandLine(&wi, pszCmdLine))
00087         goto CLEANUP_AND_EXIT;
00088
00089     // Register the window class and change the display settings if necessary.
00090     if(!InitInstance(&wi, pstrClassName))
00091         goto CLEANUP_AND_EXIT;
00092
00093     if(wi.bWindowed)
00094     {
00095         dwExStyle = 0;
00096         dwStyle = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
00097         nX = nY = CW_USEDEFAULT;
00098         nEdgeX = GetSystemMetrics(SM_CXEDGE);
00099         nEdgeY = GetSystemMetrics(SM_CYEDGE);
00100         nTopY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU);
00101         hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_DXSURFMENU));
00102     }
00103     else
00104     {
00105         dwExStyle = WS_EX_TOPMOST;
00106         dwStyle = WS_POPUP | WS_VISIBLE;
00107         nX = nY = 0;
00108         nEdgeX = nEdgeY = nTopY = 0;
00109         hMenu = NULL;
00110     }
00111
00112     hWnd = CreateWindowEx(
00113                     dwExStyle,                  // extended window style
00114                     pstrClassName,              // pointer to registered class name
00115                     pstrClassName,              // pointer to window name
00116                     dwStyle,                    // window style
00117                     nX,                         // horizontal position of window
00118                     nY,                         // vertical position of window
00119                     wi.nWidth + (2*nEdgeX),     // window width
00120                     wi.nHeight + (2*nEdgeY) + nTopY, // window height
00121                     NULL,                       // handle to parent or owner window
00122                     hMenu,                      // handle to menu or child-window identifier
00123                     hInstance,                  // handle to application instance
00124                     (LPVOID)&wi);               // pointer to window-creation data
00125     if(!hWnd)
00126         goto CLEANUP_AND_EXIT;
00127
00128     // Store the WININFO structure so that other functions can get to it.
00129     SetWindowLong(hWnd, GWL_USERDATA, (LONG)&wi);
00130
00131     // Showtime!
00132     ShowWindow(hWnd, SW_SHOW);
00133     UpdateWindow(hWnd);
00134
00135     // Initialize time variables used to maintain a steady framerate.
00136     dwPresentTime = timeGetTime();
00137     dwLastTime    = dwPresentTime;
00138
00139     while(1)
00140     {
00141         while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
00142         {
00143             if(msg.message == WM_QUIT)
00144                 goto CLEANUP_AND_EXIT;
00145
00146             TranslateMessage(&msg);
00147             DispatchMessage(&msg);
00148         }
00149
00150         // Check if it's time to render.
00151         if(dwPresentTime - dwLastTime >= 35)
00152         {
00153             InvalidateRect(hWnd, NULL, TRUE);
00154             UpdateWindow(hWnd);
00155             dwLastTime = timeGetTime();
00156         }
00157         dwPresentTime = timeGetTime();
00158     }
00159
00160 CLEANUP_AND_EXIT:
00161     if(!wi.bWindowed)
00162         ChangeDisplaySettings(0, 0);
00163
00164     CoUninitialize();
00165     return 0;
00166 }
00167
00168
00169 ///////////////////////////////////////////////////////////////////////////////
00170 LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00171 ///////////////////////////////////////////////////////////////////////////////
00172 {
00173     static IDXSurface*         pSurfImage       = NULL;
00174     static IDXSurface*         pSurfSierpinski  = NULL;
00175     static IDXSurface*         pSurfOut         = NULL;
00176     static IDXSurfaceFactory*  pSurfFact        = NULL;
00177     static POINT               ptSierpinskiVertices[3];
00178            WININFO*            pwi;
00179
00180     pwi = (WININFO*)GetWindowLong(hWnd, GWL_USERDATA);
00181
00182     switch(uMsg)
00183     {
00184         case WM_CREATE:
00185         {
00186             LPCREATESTRUCT          lpcs        = (LPCREATESTRUCT)lParam;
00187             IDXSurface*             pSurfTemp   = NULL;
00188             IDXTransformFactory*    pTransFact  = NULL;
00189             IDXTransform*           pScaleTransform = NULL;
00190             SIZE                    size;
00191             HRESULT                 hRes;
00192             IDXTScale*              pScale      = NULL;
00193             CDXDBnds                bounds;
00194             DXPMSAMPLE              sample;
00195             LRESULT                 lRet = -1;
00196
00197             // Get the structure that describes the physical window.
00198             pwi = (WININFO*)lpcs->lpCreateParams;
00199             bounds.SetXYSize(pwi->nWidth, pwi->nHeight);
00200             size.cx = pwi->nWidth; size.cy = pwi->nHeight;
00201
00202             // Create a transform factory through which we'll get
00203             // our surface factory.  Using the surface factory
00204             // we can create and manipulate DXSurfaces.
00205             hRes = CoCreateInstance(CLSID_DXTransformFactory, NULL,
00206                             CLSCTX_INPROC, IID_IDXTransformFactory, (void**)&pTransFact);
00207             if(FAILED(hRes))
00208             {
00209                 MessageBox(NULL, TEXT("Failed to CoCreate the Transform Factory!\n"
00210                     "Please register dxtrans.dll."), TEXT("DXSurface Sample 3"), MB_OK);
00211                 goto FAILED;
00212             }
00213
00214             // Get the surface factory from the transform factory.
00215             pTransFact->QueryInterface(IID_IDXSurfaceFactory, (void**)&pSurfFact);
00216
00217             // Create a surface from an image file.
00218             // NOTE: The first parameter is a wide character string.  If your path
00219             // is in ANSI, use mbstowcs() or MultiByteToWideChar().
00220             hRes = pSurfFact->LoadImage(
00221                                     L"parrot.png",
00222                                     NULL,
00223                                     NULL,
00224                                     NULL,
00225                                     IID_IDXSurface,
00226                                     (void**)&pSurfTemp);
00227             if(FAILED(hRes))
00228             {
00229                 if(hRes == DXTERR_REQ_IE_DLLNOTFOUND) // Need IE4.0 or greater.
00230                 {
00231                     MessageBox(NULL, TEXT("Failed to load the image!\n"
00232                         "IE4.0 or greater is required for DXTransforms.\n"
00233                         "Press enter to exit."),
00234                         TEXT("DXSurface Sample 3"), MB_OK);
00235                 }
00236                 else // Assume we couldn't find dxmedia image directory.
00237                 {
00238                     MessageBox(NULL, TEXT("The image file Parrot.png must be\n"
00239                         "in the current directory.\n"
00240                         "Press enter to exit."),
00241                         TEXT("DXSurface Sample 3"), MB_OK);
00242                 }
00243
00244                 goto FAILED;
00245             }
00246
00247             // Create a second, empty surface, using the size of the window
00248             // for the bounds.  This surface will hold the resized version of
00249             // the image we loaded.
00250             hRes = pSurfFact->CreateSurface(
00251                                     NULL,               // ddraw surface
00252                                     NULL,               // ddsurfacedesc
00253                                     &DDPF_PMARGB32,     // format id
00254                                     &bounds,
00255                                     0,
00256                                     NULL,
00257                                     IID_IDXSurface,
00258                                     (void**)&pSurfImage);
00259             if(FAILED(hRes))
00260             {
00261                 MessageBox(NULL, TEXT("Failed to load image!\n"
00262                     "Please provide a valid image file."), TEXT("DXSurface Sample 3"), MB_OK);
00263                 goto FAILED;
00264             }
00265
00266             // Create and set-up the scale transform which will resize our image to fit
00267             // the entire window.  Use this instead of StretchBlt() to preserve
00268             // image quality as alpha is ignored with StretchBlt().
00269             hRes = pTransFact->CreateTransform(NULL, 0, NULL, 0, NULL, NULL, CLSID_DXTScale,
00270                                 IID_IDXTransform, (void**)&pScaleTransform);
00271             if(FAILED(hRes))
00272             {
00273                 MessageBox(NULL, TEXT("Failed to create the Scale transform!\n"
00274                     "Please register dxtrans.dll."), TEXT("DXSurface Sample 3"), MB_OK);
00275                 goto FAILED;
00276             }
00277
00278             pScaleTransform->Setup(
00279                                 (IUnknown**)&pSurfTemp,     // Source (from LoadImage)
00280                                 1,
00281                                 (IUnknown**)&pSurfImage,    // Dest (from CreateSurface)
00282                                 1,
00283                                 0);
00284
00285             // Get the IDXTScale interface because IDXTScale::ScaleFitToSize()
00286             // is what we need to call.
00287             pScaleTransform->QueryInterface(IID_IDXTScale, (void**)&pScale);
00288             pScale->ScaleFitToSize(NULL, size, FALSE);
00289
00290             // Scale the output surface to the window size.
00291             pScaleTransform->Execute(NULL, NULL, NULL);
00292
00293             // Create a surface the same size as the output surface
00294             // for fractal plotting.
00295             pSurfFact->CreateSurface(
00296                         NULL,               // ddraw surface
00297                         NULL,               // ddsurfacedesc
00298                         &DDPF_PMARGB32,     // format id
00299                         &bounds,
00300                         0,
00301                         NULL,
00302                         IID_IDXSurface,
00303                         (void**)&pSurfSierpinski);
00304
00305             // Create the output surface which will hold the final result of our
00306             // composition of the image and the fractal.
00307             pSurfFact->CreateSurface(
00308                         NULL,               // ddraw surface
00309                         NULL,               // ddsurfacedesc
00310                         &DDPF_PMARGB32,     // format id
00311                         &bounds,
00312                         0,
00313                         NULL,
00314                         IID_IDXSurface,
00315                         (void**)&pSurfOut);
00316
00317             // Set up the sierpinski vertices.
00318             ptSierpinskiVertices[0].x = bounds.Width() / 2;
00319             ptSierpinskiVertices[0].y = 0;
00320             ptSierpinskiVertices[1].x = 0;
00321             ptSierpinskiVertices[1].y = bounds.Height() - 1;
00322             ptSierpinskiVertices[2].x = bounds.Width() - 1;
00323             ptSierpinskiVertices[2].y = bounds.Height() - 1;
00324
00325             // Initialize the sierpinski surface to full on red but zero alpha,
00326             // i.e. a transparent red surface.
00327             sample.Alpha = sample.Green = sample.Blue = 0x00;
00328             sample.Red = 0x40;
00329             DXFillSurface(
00330                 pSurfSierpinski,
00331                 sample,
00332                 FALSE,  // Don't do a blend, just do a straight copy.
00333                 10000); // Wait this many milliseconds.
00334
00335             srand((unsigned)time(NULL));
00336
00337             lRet = 0;
00338             goto OK;
00339
00340
00341 // If we failed, we clean up all COM interfaces that we created.
00342 // If we're successful, only clean up the temporary interfaces.
00343 FAILED:
00344             SAFE_RELEASE(pSurfOut);
00345             SAFE_RELEASE(pSurfImage);
00346             SAFE_RELEASE(pSurfSierpinski);
00347             SAFE_RELEASE(pSurfFact);
00348 OK:
00349             SAFE_RELEASE(pScaleTransform);
00350             SAFE_RELEASE(pScale);
00351             SAFE_RELEASE(pSurfTemp);
00352             SAFE_RELEASE(pTransFact);
00353             return lRet;
00354         } // WM_CREATE
00355
00356         case WM_CLOSE:
00357             SAFE_RELEASE(pSurfImage);
00358             SAFE_RELEASE(pSurfOut);
00359             SAFE_RELEASE(pSurfSierpinski);
00360             SAFE_RELEASE(pSurfFact);
00361             PostQuitMessage(0);
00362             return 0;
00363
00364         case WM_PAINT:
00365         {
00366             HDC         hDC;
00367             PAINTSTRUCT ps;
00368             IDXDCLock*  pIDCLock = NULL;
00369             CDXDBnds    bounds;
00370             static POINT ptCurrent = { -1, -1 };
00371
00372             hDC = BeginPaint(hWnd, &ps);
00373
00374             if(ptCurrent.x == -1)
00375                 ptCurrent = ptSierpinskiVertices[rand() % 3];
00376
00377             pSurfImage->GetBounds(&bounds);
00378
00379             // Use IDXSurfaceFactory::BitBlt() to blt the image to the output
00380             // surface.
00381             pSurfFact->BitBlt(
00382                             pSurfOut,
00383                             NULL,
00384                             pSurfImage,
00385                             NULL,
00386                             0);
00387
00388             IDXARGBReadWritePtr* pRWPtr = NULL;
00389
00390             // Lock the DXSurface, and get an interface that allows
00391             // us to access the pixels.
00392             pSurfSierpinski->LockSurface(
00393                                     NULL,
00394                                     INFINITE,
00395                                     DXLOCKF_READWRITE,
00396                                     IID_IDXARGBReadWritePtr,
00397                                     (void**)&pRWPtr,
00398                                     NULL);
00399
00400             // We use GetNativeType to give us a pointer to the first pixel,
00401             // and the number of pixels per row.
00402             DXNATIVETYPEINFO info;
00403             pRWPtr->GetNativeType(&info);
00404             DXSAMPLE* pSample = (DXSAMPLE*)info.pFirstByte;
00405             ULONG ulRowSampWidth = info.lPitch / sizeof(DXSAMPLE);
00406
00407             // Calculate pixels to turn on.
00408             for(int i=0; i<NUMPIXELSTODRAW; i++)
00409             {
00410                 POINT ptTemp = ptSierpinskiVertices[rand() % 3];
00411                 ptCurrent.x = abs((ptTemp.x - ptCurrent.x) / 2) + min(ptTemp.x, ptCurrent.x);
00412                 ptCurrent.y = abs((ptTemp.y - ptCurrent.y) / 2) + min(ptTemp.y, ptCurrent.y);
00413
00414                 assert(ptCurrent.x >= 0);
00415                 assert(ptCurrent.x < pwi->nWidth);
00416                 assert(ptCurrent.y >= 0);
00417                 assert(ptCurrent.y < pwi->nHeight);
00418
00419                 // Calculate the index to the pixel.
00420                 // Turn on the alpha channel to 1/4 intensity.
00421                 UINT uIndex =  ulRowSampWidth * ptCurrent.y + ptCurrent.x;
00422                 pSample[uIndex].Alpha = 0x40;
00423             }
00424
00425             // Releasing this unlocks the Sierpinski dxsurface locked above.
00426             SAFE_RELEASE(pRWPtr);
00427
00428             // Blend the fractal surface onto the output surface.
00429             pSurfFact->BitBlt(
00430                             pSurfOut,
00431                             NULL,
00432                             pSurfSierpinski,
00433                             NULL,
00434                             DXBOF_DO_OVER); // Do an alpha blend.
00435
00436             // Lock the output surface and draw it to the DC, using GDI's BitBlt.
00437             pSurfOut->LockSurfaceDC(NULL, INFINITE, DXLOCKF_READ, &pIDCLock);
00438
00439             PTSTR pstrMessage = TEXT("Red pixels alpha-blended over an image");
00440             SetBkMode(pIDCLock->GetDC(), TRANSPARENT);
00441             SetTextColor(pIDCLock->GetDC(), RGB(0xFF, 0x00, 0x00));
00442             TextOut(pIDCLock->GetDC(), 0, 0, pstrMessage, 38);
00443
00444             BitBlt(
00445                 hDC,                // handle to destination device context
00446                 0,                  // x-coordinate of upper-left corner of dest. rect.
00447                 0,                  // y-coordinate of upper-left corner of dest. rect.
00448                 pwi->nWidth,        // width of destination rectangle
00449                 pwi->nHeight,       // height of destination rectangle
00450                 pIDCLock->GetDC(),  // handle to source device context
00451                 0,                  // x-coordinate of upper-left corner of source rectangle
00452                 0,                  // y-coordinate of upper-left corner of source rectangle
00453                 SRCCOPY);           // raster operation code
00454
00455             SAFE_RELEASE(pIDCLock);
00456             EndPaint(hWnd, &ps);
00457             return 0;
00458         }
00459
00460         case WM_CHAR:
00461             if(wParam == VK_ESCAPE)
00462                 PostMessage(hWnd, WM_CLOSE, 0, 0);
00463             return 0;
00464
00465         case WM_COMMAND:
00466             switch(LOWORD(wParam))
00467             {
00468                 case ID_FILE_EXIT:
00469                     PostMessage(hWnd, WM_CLOSE, 0, 0);
00470                     break;
00471
00472                 case ID_FILE_ABOUT:
00473                     MessageBox(hWnd, TEXT("DXSurface Sample 3 Version 1.0\n"
00474                                           "Copyright (c) 1998-2001 Microsoft Corporation.\n"
00475                                           "All rights reserved."),
00476                                           TEXT("DXSurface Sample 3"),
00477                                           MB_ICONINFORMATION | MB_OK);
00478                     break;
00479             }
00480             return 0;
00481     }
00482
00483     return DefWindowProc(hWnd, uMsg, wParam, lParam);
00484 }
00485
00486 ///////////////////////////////////////////////////////////////////////////////
00487 BOOL ParseCommandLine(WININFO* pwi, PTSTR pszCmdLine)
00488 ///////////////////////////////////////////////////////////////////////////////
00489 // Go through the command line, setting pertinent info in WININFO structure.
00490 {
00491     pwi->nWidth = FindNumWithParameter(TEXT("-width"));
00492     pwi->nHeight = FindNumWithParameter(TEXT("-height"));
00493     pwi->nBPP   = FindNumWithParameter(TEXT("-bpp"));
00494     pwi->bWindowed = FindParameter(TEXT("-windowed"));
00495
00496     if(pwi->nWidth < 0  ||  pwi->nHeight < 0  ||  pwi->nBPP < 0)
00497     {
00498         // Get the current display settings.
00499         HDC hDC = GetDC(NULL);
00500         int nCurrentBPP = GetDeviceCaps(hDC, BITSPIXEL);
00501         ReleaseDC(NULL, hDC);
00502
00503         // Set to a default resolution of 640x480 windowed.
00504         pwi->nWidth = 640;
00505         pwi->nHeight = 480;
00506         pwi->nBPP = nCurrentBPP;
00507         pwi->bWindowed = TRUE;
00508     }
00509     else if(pwi->bWindowed == -1)
00510         pwi->bWindowed = FALSE;
00511
00512     return TRUE;
00513 }
00514
00515 ///////////////////////////////////////////////////////////////////////////////
00516 BOOL InitInstance(WININFO* pwi, PTSTR strClassName)
00517 ///////////////////////////////////////////////////////////////////////////////
00518 // Register the window class and possibly change the video mode,
00519 // taking into acount WININFO.
00520 {
00521     BOOL        bRet = FALSE;
00522     DEVMODE     devmode;
00523     WNDCLASSEX  wcex = { sizeof(WNDCLASSEX), CS_HREDRAW | CS_VREDRAW, WndProc,
00524                             0, 0, pwi->hInstance,
00525                             LoadIcon(pwi->hInstance, MAKEINTRESOURCE(IDI_DXS3)),
00526                             LoadCursor(NULL, IDC_ARROW),
00527                             NULL, NULL, strClassName, 0 };
00528
00529     if(!RegisterClassEx(&wcex))
00530         goto EXIT_FAIL;
00531
00532     if(!pwi->bWindowed)
00533     {
00534         ZeroMemory(&devmode, sizeof(devmode));
00535         devmode.dmSize          = sizeof(DEVMODE);
00536         devmode.dmBitsPerPel    = pwi->nBPP;
00537         devmode.dmPelsWidth     = pwi->nWidth;
00538         devmode.dmPelsHeight    = pwi->nHeight;
00539         devmode.dmFields        = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
00540         if(ChangeDisplaySettings(&devmode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
00541         {
00542             MessageBox(NULL, TEXT("Failed to set the display mode!\n"
00543                        "See dxsurf3.txt for how to choose another."),
00544                        TEXT("DXSurface Sample 3"), MB_OK);
00545             goto EXIT_FAIL;
00546         }
00547         ShowCursor(FALSE);
00548     }
00549
00550     bRet = TRUE;
00551 EXIT_FAIL:
00552     return bRet;
00553 }
00554
00555 ///////////////////////////////////////////////////////////////////////////////
00556 int FindNumWithParameter(PTSTR strParam)
00557 ///////////////////////////////////////////////////////////////////////////////
00558 // Returns the number associated with a command-line parameter, e.g.
00559 // returns the number 640 when passed a string "-width 640".
00560 // If the string is not found, -1 is returned.
00561 {
00562     // TODO: Check that argv[i+1] is not past end of string AND that it
00563     // is a positive string of numbers.
00564     for(int i=0; i<__argc; i++)
00565     {
00566         if(lstrcmpi(strParam, __argv[i]) == 0)
00567             if(i+1 < __argc)
00568                 return atoi(__argv[i+1]);
00569             else // We're at the end of the command line string.
00570                 break;
00571     }
00572
00573     return -1;
00574 }
00575
00576 ///////////////////////////////////////////////////////////////////////////////
00577 int FindParameter(PTSTR strParam)
00578 ///////////////////////////////////////////////////////////////////////////////
00579 // Returns -1 if parameter not found, else 1.
00580 {
00581     for(int i=0; i<__argc; i++)
00582     {
00583         if(lstrcmpi(strParam, __argv[i]) == 0)
00584             return 1;
00585     }
00586
00587     return -1;
00588 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCacheMapEl Member List

This is the complete list of members for CCacheMapEl, including all inherited members.
CCacheMapEl(long lIndex) | CCacheMapEl | [inline]
GetUID() | CCacheMapEl | [inline]
m_lGenID | CCacheMapEl | [private, static]
m_lIndex | CCacheMapEl | [private]
m_lUID | CCacheMapEl | [private]
Generated on Wed Nov 13 2024 16:55:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/client/CEvent.h Source File

  • Com
  • async
  • client

CEvent.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #if !defined(__CEVENT__)
00018 #define __CEVENT__
00019
00020 #include <objidl.h>
00021 #include "..\Server\unk.h"
00022 #include "..\Server\debug.h"
00023 #include "proxy.h"
00024
00025 class CEvent : public AppEvents
00026 {
00027 public:
00028
00029   DWORD m_cRef;
00030
00031   CEvent() : m_cRef(0)
00032   {
00033     DEBUGTRACE(_T("In CEvent ctor"));
00034   }
00035
00036
00037   ~CEvent()
00038   {
00039     DEBUGTRACE(_T("In CEvent dtor"));
00040   }
00041
00042   DECLARE_UNKNOWN
00043
00044   HRESULT __stdcall Beep(short alert)
00045   {
00046     Sleep(1500);
00047     MessageBeep(alert);
00048     MessageBox(NULL, "Beep!", "DCOM Test Client", MB_OK);
00049     return S_OK;
00050   }
00051 };
00052
00053 HRESULT __stdcall CEvent::QueryInterface(REFIID iid, PVOID *ppObj)
00054   {
00055 #if defined(_DEBUG)
00056     LPWSTR lpstrIID;
00057     StringFromIID(iid, &lpstrIID);
00058     DEBUGTRACE(_TEXT("CEvent::QueryInterface has been asked for %S"), lpstrIID);
00059     CoTaskMemFree(lpstrIID);
00060 #endif
00061
00062     if (iid == IID_IUnknown || iid == IID_AppEvents)
00063       *ppObj = (AppEvents*)this;
00064     else
00065     {
00066       *ppObj = NULL;
00067       return E_NOINTERFACE;
00068     }
00069
00070     if (*ppObj)
00071       reinterpret_cast<LPUNKNOWN>(*ppObj)->AddRef();
00072
00073     return S_OK;
00074   }
00075
00076 void __stdcall CEvent::FinalRelease()
00077   {
00078     DEBUGTRACE(_T("CEvent::FinalRelease called"));
00079     return;
00080   }
00081
00082 #endif // __CEVENT__
00083
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SecurObj/Main.Cpp Source File

  • Security
  • Authorization
  • SecurObj

Main.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1997 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010    Module Name:
00011
00012        main.cpp
00013
00014    Description:
00015
00016        This module contains the code for processing the dialog box interface,
00017        including the private object tree view.
00018
00019        TODO: Select an access level request before doing AccessCheck
00020
00021 --*/
00022
00023 #define UNICODE
00024 #define _UNICODE
00025
00026 #include "resource.h"
00027 #include "aclui.h"
00028 #include "Main.h"
00029
00030 // GLOBALS
00031 char        szAppName[] = "Object Security Sample";   // The name of this application
00032 HINSTANCE   g_hInstance;
00033
00034 BOOL InitInstance(
00035         HINSTANCE          hInstance,
00036         int                nCmdShow);
00037
00038 //////////////////////////////////////////////////////////////////
00039 // You gotta have a WinMain
00040 //
00041 //////////////////////////////////////////////////////////////////
00042 int CALLBACK WinMain( HINSTANCE hInstance,
00043                       HINSTANCE hPrevInstance,
00044                       LPSTR lpCmdLine,
00045                       int nCmdShow)
00046 {
00047
00048    MSG      msg;
00049    HACCEL   hAccelTable;
00050
00051    // Perform initializations that apply to a specific instance
00052
00053    if( !InitInstance(hInstance, nCmdShow))
00054       return(FALSE);
00055
00056    hAccelTable = LoadAccelerators (hInstance, MAKEINTRESOURCE(IDR_PRIVOBJ_ACC));
00057
00058    // Acquire and dispatch messages until a WM_QUIT message is received.
00059
00060    while( GetMessage( &msg, // message structure
00061                       NULL,   // handle of window receiving the message
00062                       0,      // lowest message to examine
00063                       0 ))     // highest message to examine
00064    {
00065       if( !TranslateAccelerator( msg.hwnd, hAccelTable, &msg ) )
00066       {
00067             TranslateMessage(&msg);// Translates virtual key codes
00068             DispatchMessage(&msg); // Dispatches message to window
00069       }
00070    }
00071
00072
00073    return (int)(msg.wParam); // Returns the value from PostQuitMessage
00074
00075    lpCmdLine; // This will prevent 'unused formal parameter' warnings
00076 }
00077
00078 //////////////////////////////////////////////////////////////////
00079 // Good old InitInstance
00080 //
00081 //////////////////////////////////////////////////////////////////
00082 BOOL InitInstance(
00083         HINSTANCE          hInstance,
00084         int                nCmdShow)
00085 {
00086         HWND            hWnd; // Main window handle.
00087
00088         // Save the instance handle in static variable, which will be used in
00089         // many subsequence calls from this application to Windows.
00090
00091         g_hInstance = hInstance; // Store instance handle in our global variable
00092
00093         InitCommonControls();
00094
00095         // Create a main window for this application instance.
00096
00097         hWnd = CreateDialog( hInstance,
00098                              MAKEINTRESOURCE(IDD_DIALOG_MAIN),
00099                              NULL,
00100                              (DLGPROC)DlgProc );
00101
00102         // If window could not be created, return "failure"
00103         if (!hWnd) {
00104                 return (FALSE);
00105         }
00106
00107         // Make the window visible; update its client area; and return "success"
00108         ShowWindow(hWnd, nCmdShow); // Show the window
00109         UpdateWindow(hWnd);         // Sends WM_PAINT message
00110
00111         return (TRUE);              // We succeeded...
00112
00113 }
00114
00115 //////////////////////////////////////////////////////////////////
00116 //
00117 // AddItemToTree - adds items to a tree-view control.
00118 //
00119 // Returns: the handle of the newly added item.
00120 //
00121 // Parameters:
00122 //    hwndTV - handle of the tree-view control
00123 //    lpszItem - text of the item to add
00124 //    hParent - the parent object
00125 //    pObject - allows us to reference object through the tree view item
00126 //
00127 //////////////////////////////////////////////////////////////////
00128 HTREEITEM AddItemToTree(
00129             HWND hwndTV,
00130             LPTSTR lpszItem,
00131             HTREEITEM hParent,
00132             POBJECT pObject
00133             )
00134 {
00135    TV_INSERTSTRUCT IStruct;
00136    HTREEITEM hTreeItem;
00137
00138    IStruct.item.mask = TVIF_TEXT | TVIF_PARAM;
00139
00140    // Set the text of the item.
00141    IStruct.item.pszText = lpszItem;
00142    IStruct.item.cchTextMax = lstrlen(lpszItem);
00143
00144    // use the item's data area to store pointer to object
00145    IStruct.item.lParam = (LPARAM) pObject;
00146
00147    if( pObject->fContainer )
00148       IStruct.hInsertAfter = TVI_FIRST;
00149    else
00150       IStruct.hInsertAfter = TVI_LAST;
00151
00152    IStruct.hParent = hParent;
00153
00154    hTreeItem = TreeView_InsertItem( hwndTV, &IStruct );
00155
00156    pObject->hTreeItem = hTreeItem;
00157
00158    return hTreeItem;
00159 }
00160
00161
00162 //////////////////////////////////////////////////////////////////
00163 // BOOL CenterDialog
00164 //
00165 //////////////////////////////////////////////////////////////////
00166 BOOL CenterDialog(HWND hdlg)
00167 {
00168     RECT  rcParent;                         // Parent window client rect
00169     RECT  rcDlg;                            // Dialog window rect
00170     int   nLeft, nTop;                      // Top-left coordinates
00171     int   cWidth, cHeight;                  // Width and height
00172     HWND  hwnd;
00173
00174     // Get frame window client rect in screen coordinates
00175     hwnd = GetParent(hdlg);
00176     if(hwnd == NULL || hwnd == GetDesktopWindow())
00177     {
00178         rcParent.top = rcParent.left = 0;
00179         rcParent.right = GetSystemMetrics(SM_CXFULLSCREEN);
00180         rcParent.bottom = GetSystemMetrics(SM_CYFULLSCREEN);
00181     }
00182     else
00183     GetWindowRect(hwnd, &rcParent);
00184
00185     // Determine the top-left point for the dialog to be centered
00186     GetWindowRect(hdlg, &rcDlg);
00187     cWidth  = rcDlg.right  - rcDlg.left;
00188     cHeight = rcDlg.bottom - rcDlg.top;
00189     nLeft   = rcParent.left +
00190                 (((rcParent.right  - rcParent.left) - cWidth ) / 2);
00191     nTop    = rcParent.top  +
00192                 (((rcParent.bottom - rcParent.top ) - cHeight) / 2);
00193     if (nLeft < 0) nLeft = 0;
00194     if (nTop  < 0) nTop  = 0;
00195
00196     // Place the dialog
00197     return MoveWindow(hdlg, nLeft, nTop, cWidth, cHeight, TRUE);
00198 }
00199
00200 //////////////////////////////////////////////////////////////////
00201 // This is the main dialog box that presents the tree view
00202 // presentation of our private objects and the buttons that
00203 // allow you to do other things.
00204 //
00205 //////////////////////////////////////////////////////////////////
00206 BOOL CALLBACK DlgProc (HWND hwnd, UINT msg,
00207                      WPARAM wParam,  LPARAM lParam)
00208 {
00209
00210    LRESULT  lCount;
00211    HANDLE   hToken;
00212    POBJECT  pObject=NULL,pNewObject=NULL;
00213    WORD     wClient;
00214    DWORD    dwResult;
00215    HTREEITEM hTreeItem;
00216    HTREEITEM hNewTreeItem=NULL;
00217    TV_ITEM   tvItem;
00218    WCHAR     szUser[256];
00219    DWORD     dwSIFlags=SI_EDIT_ALL | SI_ADVANCED | SI_NO_ACL_PROTECT; // Used by security editor
00220    HWND      hControlWnd;
00221
00222    switch (msg)
00223    {
00224
00225       case WM_CLOSE:
00226          DestroyWindow(hwnd);
00227          PostQuitMessage(1);
00228          return TRUE;
00229
00230
00231       case WM_INITDIALOG:
00232
00233           CenterDialog(hwnd);
00234          //
00235          // Initialize the user list
00236          //
00237          DefaultUser();
00238
00239
00240          GetLogonName(0,szUser);
00241          SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00242                       CB_ADDSTRING, 0, (LPARAM)szUser);
00243
00244          SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00245             CB_SETCURSEL, 0, 0L );
00246
00247           return TRUE ;
00248
00249
00250       case WM_COMMAND:
00251             switch (LOWORD(wParam))
00252             {
00253                case IDOK:
00254                   DestroyWindow(hwnd);
00255                   PostQuitMessage(1);
00256                   return TRUE;
00257
00258                case IDC_IMPERSONATE:
00259                   lCount = SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00260                                         CB_GETCOUNT, 0, 0 );
00261                   if( NewLogon( g_hInstance, (WORD)lCount ) )
00262                   {
00263                      GetLogonName((WORD)lCount,szUser);
00264                      SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00265                                   CB_ADDSTRING, 0, (LPARAM)szUser);
00266                   }
00267                   else
00268                      MessageBox(NULL, L"New Logon failed!", L"Logon Error", MB_OK);
00269                   return TRUE;
00270
00271                case IDC_ACCESSCHECK:
00272
00273                   hControlWnd = GetDlgItem(hwnd, IDC_OBJECT_TREE);
00274
00275                   hTreeItem = TreeView_GetSelection(hControlWnd);
00276
00277                   if( hTreeItem == NULL )
00278                   {
00279                      MessageBox( NULL, L"Select Container or Object first", L"Error", MB_OK );
00280                      break;
00281                   }
00282
00283                   tvItem.mask = TVIF_PARAM;
00284                   tvItem.hItem = hTreeItem;
00285
00286                   // get the tree view item
00287                   TreeView_GetItem(hControlWnd,&tvItem);
00288
00289                   // get the object pointer from the tree view item
00290                   pObject = (POBJECT)tvItem.lParam;
00291
00292                   wClient = (WORD)SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00293                                                CB_GETCURSEL, 0, 0 );
00294
00295                   hToken = GetClientImpToken( wClient );
00296                   dwResult = CheckAccess( pObject, hToken );
00297
00298                   SetFocus(hControlWnd);
00299
00300                   return TRUE;
00301
00302                case IDC_NEW_TREE:
00303
00304                   hControlWnd = GetDlgItem( hwnd, IDC_OBJECT_TREE );
00305
00306                   pObject = NULL;
00307
00308                   wClient = (WORD)SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00309                                                CB_GETCURSEL, 0, 0 );
00310
00311                   pNewObject = NewObject( pObject, TRUE, wClient );
00312
00313                   pNewObject->fContainer = TRUE;
00314
00315                   AddItemToTree( hControlWnd,
00316                                  L"Root",
00317                                  NULL,
00318                                  pNewObject );
00319
00320                   SetFocus( hControlWnd );
00321
00322                   return TRUE;
00323
00324                case IDC_NEW_CONTAINER:
00325
00326                   hControlWnd = GetDlgItem( hwnd, IDC_OBJECT_TREE );
00327
00328                    hTreeItem = TreeView_GetSelection( hControlWnd );
00329
00330                   if( hTreeItem == NULL )
00331                   {
00332                      MessageBox( NULL, L"Select Container first", L"Error", MB_OK );
00333                      break;
00334                   }
00335                   tvItem.mask = TVIF_PARAM;
00336                   tvItem.hItem = hTreeItem;
00337
00338                   // Make sure it is a container object
00339                   TreeView_GetItem( hControlWnd, &tvItem );
00340
00341                   // get the object pointer from the tree view item
00342                   pObject = (POBJECT)tvItem.lParam;
00343
00344                   if( !pObject->fContainer )
00345                   {
00346                      MessageBox( NULL, L"Object not a container", L"Error", MB_OK );
00347                      break;
00348                   }
00349
00350                   // If this were a actual secure application, I would want to
00351                   // make sure that the current client has the proper access
00352                   // right on this container to create a new container.
00353                   // ACCESS_CREATE_OBJECT?
00354
00355                   wClient = (WORD)SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00356                                                CB_GETCURSEL, 0, 0 );
00357
00358                   pNewObject = NewObject( pObject, TRUE, wClient );
00359
00360                   pNewObject->fContainer = TRUE;
00361
00362                   hNewTreeItem = AddItemToTree(
00363                                      hControlWnd,
00364                                      L"Container",
00365                                      hTreeItem,
00366                                      pNewObject );
00367
00368                   SetFocus( hControlWnd );
00369
00370                   TreeView_SelectItem(
00371                       hControlWnd,
00372                       hNewTreeItem);
00373
00374                   return TRUE;
00375
00376                case IDC_NEW_OBJECT:
00377
00378                   hControlWnd = GetDlgItem( hwnd, IDC_OBJECT_TREE );
00379
00380                   hTreeItem = TreeView_GetSelection(
00381                      GetDlgItem( hwnd, IDC_OBJECT_TREE ) );
00382
00383                   if( hTreeItem == NULL )
00384                   {
00385                      MessageBox( NULL, L"Select Container first", L"Error", MB_OK );
00386                      break;
00387                   }
00388
00389                   tvItem.mask = TVIF_PARAM;
00390                   tvItem.hItem = hTreeItem;
00391
00392                   // Make sure it is a container object
00393                   TreeView_GetItem( hControlWnd, &tvItem );
00394
00395                   pObject = (POBJECT)tvItem.lParam;
00396
00397                   if( !pObject->fContainer )
00398                   {
00399                      MessageBox( NULL, L"Object not a container", L"Error", MB_OK );
00400                      break;
00401                   }
00402
00403                   // If this were a actual secure application, I would want to
00404                   // make sure that the current client has the proper access
00405                   // right on this container to create a new object.
00406                   // ACCESS_CREATE_OBJECT?
00407
00408                   wClient = (WORD)SendMessage( GetDlgItem( hwnd,IDC_USERLIST ),
00409                                                CB_GETCURSEL, 0, 0 );
00410
00411                   pNewObject = NewObject( pObject, FALSE, wClient );
00412                   pNewObject->fContainer = FALSE;
00413
00414                   hNewTreeItem = AddItemToTree(
00415                                      hControlWnd,
00416                                      L"Object",
00417                                      hTreeItem,
00418                                      pNewObject );
00419
00420                   SetFocus( hControlWnd );
00421
00422                   TreeView_Select(
00423                       hControlWnd,
00424                       hNewTreeItem,
00425                       TVGN_FIRSTVISIBLE);
00426
00427                   return TRUE;
00428
00429                case IDC_SECURITY:
00430
00431                   hControlWnd = GetDlgItem( hwnd, IDC_OBJECT_TREE );
00432
00433                   hTreeItem = TreeView_GetSelection( hControlWnd );
00434
00435                   if( hTreeItem == NULL )
00436                   {
00437                      MessageBox( NULL, L"Select Container or Object first", L"Error", MB_OK );
00438                      break;
00439                   }
00440
00441                   tvItem.mask = TVIF_PARAM;
00442                   tvItem.hItem = hTreeItem;
00443
00444                   // get the tree view item
00445                   TreeView_GetItem( hControlWnd, &tvItem );
00446
00447                   // get the object pointer from the tree view item
00448                   pObject = (POBJECT)tvItem.lParam;
00449
00450                   wClient = (WORD)SendMessage(GetDlgItem( hwnd,IDC_USERLIST ),
00451                                               CB_GETCURSEL, 0, 0);
00452
00453                   LPSECURITYINFO psi;
00454
00455                   if(SUCCEEDED(CreateObjSecurityInfo( dwSIFlags,
00456                                           &(pObject->pSD), &psi, wClient,
00457                                           L"", pObject->fContainer)))
00458                   {
00459                      EditSecurity(NULL,psi);
00460                      psi->Release();
00461                      tvItem.lParam = (LPARAM)pObject;
00462                      TreeView_SetItem(hControlWnd, &tvItem );
00463                   }
00464                   else
00465                      MessageBox(NULL, L"CreateObjSecurityInfo Failed", L"Error", MB_OK);
00466
00467                   SetFocus(hControlWnd);
00468
00469                   return TRUE;
00470
00471
00472             }
00473         default:
00474            break;
00475
00476    }
00477
00478    return FALSE;
00479
00480 }
00481
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/TSFcase/globals.h Source File

  • WinUI
  • TSFcase

globals.h

Go to the documentation of this file.
00001 //
00002 // globals.h
00003 //
00004 // Global variable declarations.
00005 //
00006
00007 #ifndef GLOBALS_H
00008 #define GLOBALS_H
00009
00010 #include <windows.h>
00011 #include <ole2.h>
00012 #include <olectl.h>
00013 #include <assert.h>
00014 #include "msctf.h"
00015
00016 void DllAddRef();
00017 void DllRelease();
00018
00019 void ToggleCase(TfEditCookie ec, ITfRange *range, BOOL fIgnoreRangeEnd);
00020 void InsertTextAtSelection(TfEditCookie ec, ITfContext *pContext, const WCHAR *pchText, ULONG cchText);
00021
00022 #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
00023
00024 #define CASE_LANGID    MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
00025
00026 #define CASE_DESC    L"Case Text Service"
00027 #define CASE_DESC_A   "Case Text Service"
00028 #define CASE_MODEL   TEXT("Apartment")
00029
00030 #define LANGBAR_ITEM_DESC L"Case Menu" // max 32 chars!
00031
00032 #define CASE_ICON_INDEX  0
00033
00034 #define SafeRelease(punk)       \
00035 {                               \
00036     if ((punk) != NULL)         \
00037     {                           \
00038         (punk)->Release();      \
00039     }                           \
00040 }
00041
00042 #define SafeReleaseClear(punk)  \
00043 {                               \
00044     if ((punk) != NULL)         \
00045     {                           \
00046         (punk)->Release();      \
00047         (punk) = NULL;          \
00048     }                           \
00049 }
00050
00051 //+---------------------------------------------------------------------------
00052 //
00053 // SafeStringCopy
00054 //
00055 // Copies a string from one buffer to another.  wcsncpy does not always
00056 // null-terminate the destination buffer; this function does.
00057 //----------------------------------------------------------------------------
00058
00059 inline void SafeStringCopy(WCHAR *pchDst, ULONG cchMax, const WCHAR *pchSrc)
00060 {
00061     if (cchMax > 0)
00062     {
00063         wcsncpy(pchDst, pchSrc, cchMax);
00064         pchDst[cchMax-1] = '\0';
00065     }
00066 }
00067
00068 extern HINSTANCE g_hInst;
00069
00070 extern LONG g_cRefDll;
00071
00072 extern CRITICAL_SECTION g_cs;
00073
00074 extern const CLSID c_clsidCaseTextService;
00075
00076 extern const GUID c_guidCaseProfile;
00077
00078 extern const GUID c_guidLangBarItemButton;
00079
00080 #endif // GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/Factory.h Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

Factory.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  factory.h
00006 //
00007 // Description:
00008 //      Definition for command-line event consumer provider class factory
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #include <wbemcli.h>
00015
00016 class CProviderFactory : public IClassFactory
00017 {
00018 public:
00019
00020   CProviderFactory(CListBox *pOutputList);
00021   virtual ~CProviderFactory();
00022
00023     // IUnknown members
00024     STDMETHODIMP         QueryInterface(REFIID, LPVOID *);
00025     STDMETHODIMP_(ULONG) AddRef(void);
00026     STDMETHODIMP_(ULONG) Release(void);
00027
00028     STDMETHOD_(SCODE, CreateInstance)(IUnknown * pUnkOuter,
00029                   REFIID riid,
00030                   void ** ppvObject);
00031
00032     STDMETHOD_(SCODE, LockServer)(BOOL fLock);
00033
00034 private:
00035   LONG m_cRef;
00036   CListBox  *m_pOutputList;
00037
00038 };
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/WinNT/PlgBlt/Track.c Source File

  • Multimedia
  • Gdi
  • WinNT
  • PlgBlt

Track.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1992 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /**************************************************************************\
00013 *  track.c -- support for direct manipulation of parallelogram object.
00014 \**************************************************************************/
00015
00016 #include <windows.h>
00017 #include <math.h>
00018 #include "track.h"
00019
00020 #define EPSILON  (float) 0.0001
00021 #define RECTSIZE  60
00022
00023
00024
00025 /**************************************************************************\
00026 *
00027 *  function:  doTrackObject()
00028 *
00029 *  input parameters:
00030 *   pto -  pointer to a track object.
00031 *   msg -  message selecting what action to take.  Values may include WM_*'s
00032 *           (see case statements below for more information.)
00033 *   hwnd - Window handle for the window the track object exists within.
00034 *   lParam - Usually fourth param to window proc. varies based on msg.
00035 *
00036 *  global variables:  none.
00037 *
00038 *  coordinate spaces:  There are three coordinate spaces of interest here,
00039 *   and this routine is frequently switching between them...
00040 *
00041 *           WORLD                   DEVICE                  SCREEN
00042 *
00043 *      object coordinates       input mouse pos       used w/ SetCursorPos()
00044 *         (pto->rect)          (lParam for WM_*)
00045 *
00046 *             ----->  LPtoDP() ---->    ----> ClientToScreen() -->
00047 *             <-----  DPtoLP() <----    <---- ScreenToClient() <--
00048 *
00049 *   in addition, the HDC has an offset origin.  Device coordinates for the
00050 *   mouse (lParam) never take this into account, but it is necessary to
00051 *   translate them in order to get direct manipulation right.
00052 *
00053 \**************************************************************************/
00054 PTrackObject doTrackObject(PTrackObject pto, int msg, HWND hwnd, LONG_PTR lParam)
00055 {
00056   if ((pto == NULL) && (msg != TROB_NEW))  return NULL;
00057
00058   switch (msg) {
00059
00060
00061     /**********************************************************************\
00062     *  TROB_NEW
00063     *
00064     * Allocate new PTrackObject structure.  Fill in default values
00065     *  for the fields of the structure.  Set up the HDC correctly.
00066     * return - pointer to the new object.
00067     \**********************************************************************/
00068     case  TROB_NEW: {
00069         PTrackObject  pto;
00070
00071         /* with LPTR returned value is a pointer. */
00072         pto = (PTrackObject) LocalAlloc (LPTR, sizeof (TrackObject));
00073     if (!pto) return NULL;    /* failed to create track object*/
00074
00075         /* initialize the HDC and other fields. */
00076         pto->hdc = GetDC (hwnd);
00077         SetGraphicsMode (pto->hdc, GM_ADVANCED);
00078         SetROP2(pto->hdc, R2_NOT);
00079         SelectObject (pto->hdc, GetStockObject (NULL_BRUSH));
00080         pto->Mode = TMNONE;
00081         pto->allowedModes = TMMOVE | TMSIZEXY;
00082
00083         GetWorldTransform (pto->hdc, &(pto->xfmChange));
00084
00085         /* initialize the size. */
00086         pto->rect.top = pto->rect.left = 0;
00087         pto->rect.bottom = pto->rect.right = RECTSIZE;
00088
00089         return (pto);
00090     }
00091
00092
00093
00094     /**********************************************************************\
00095     *  TROB_DELETE
00096     *
00097     * Complement of TROB_NEW.  Free up the memory allocated for the object.
00098     \**********************************************************************/
00099     case  TROB_DELETE:
00100         doTrackObject (pto, TROB_PAINT, hwnd, lParam);
00101         ReleaseDC (hwnd, pto->hdc);
00102         LocalFree (LocalHandle ((LPSTR)pto));
00103     return NULL;
00104
00105
00106
00107     /**********************************************************************\
00108     *  TROB_PAINT
00109     *
00110     * Paint the object into its hdc.  Called half the time to erase
00111     *  the object, and half the time to redraw it.
00112     \**********************************************************************/
00113     case TROB_PAINT: {
00114         MoveToEx (pto->hdc, pto->rect.right, pto->rect.top, NULL);
00115         LineTo (pto->hdc,  pto->rect.left, pto->rect.top);
00116         LineTo (pto->hdc,  pto->rect.left, pto->rect.bottom);
00117
00118         if (pto->allowedModes & TMSIZEXY) {
00119           LineTo (pto->hdc,  pto->rect.right, pto->rect.bottom);
00120           LineTo (pto->hdc,  pto->rect.right, pto->rect.top);
00121         }
00122
00123         if (pto->allowedModes & TMROTATE) {
00124           MoveToEx (pto->hdc, pto->rect.left, pto->rect.bottom/ 4, NULL);
00125           AngleArc (pto->hdc, pto->rect.left, pto->rect.top,
00126                  (DWORD) pto->rect.bottom/ 4, (float) 270.0, (float) 90.0);
00127         }
00128
00129     } return NULL;
00130
00131
00132
00133     /**********************************************************************\
00134     *  TROB_HITTEST
00135     *
00136     * Check the point sent in in the lParam to see if it lays within
00137     *  the bounds of the objects defining rectangle.
00138     * return - pointer to the object iff the point is in rectangle,
00139     *  otherwise return NULL.
00140     \**********************************************************************/
00141     case TROB_HITTEST:{
00142         POINT  mouWorld;
00143         mouWorld.x = LOWORD(lParam);
00144         mouWorld.y = HIWORD(lParam);
00145
00146         DPtoLP (pto->hdc, &mouWorld, 1);
00147
00148         if (PtInRect (&pto->rect, mouWorld))  return pto;
00149         else  return NULL;
00150     }
00151
00152
00153
00154     /**********************************************************************\
00155     *  WM_LBUTTONDOWN &  WM_RBUTTONDOWN
00156     *
00157     * Capture the mouse, set the tracking mode depending on the mouse
00158     *  location in world coordinates, reset the mouse position.
00159     *
00160     \**********************************************************************/
00161     case WM_LBUTTONDOWN:
00162     case WM_RBUTTONDOWN: {
00163       POINT  newmouScreen;
00164       POINT  mouWorld;
00165
00166       mouWorld.x = LOWORD(lParam);
00167       mouWorld.y = HIWORD(lParam);
00168       DPtoLP (pto->hdc, &mouWorld, 1);
00169
00170       /* upper left hand corner. right button is no-op. */
00171       if ((mouWorld.x <= (pto->rect.right  / 2)) &&
00172           (mouWorld.y <= (pto->rect.bottom / 2))) {
00173           if (msg == WM_RBUTTONDOWN) return NULL;
00174           pto->Mode = TMMOVE;
00175           newmouScreen.x = pto->rect.left;
00176           newmouScreen.y = pto->rect.top;
00177
00178       /* lower left hand corner */
00179       } else if ((mouWorld.x <= (pto->rect.right  / 2)) &&
00180           (mouWorld.y > (pto->rect.bottom / 2))) {
00181
00182           pto->Mode = (msg == WM_RBUTTONDOWN) ? TMSHEARY : TMSIZEY;
00183           newmouScreen.x = pto->rect.left;
00184           newmouScreen.y = pto->rect.bottom;
00185
00186       /* upper right hand corner */
00187       } else if ((mouWorld.x > (pto->rect.right  / 2)) &&
00188           (mouWorld.y <= (pto->rect.bottom / 2))) {
00189
00190           pto->Mode = (msg == WM_RBUTTONDOWN) ? TMSHEARX : TMSIZEX;
00191           newmouScreen.x = pto->rect.right;
00192           newmouScreen.y = pto->rect.top;
00193
00194       /* lower right hand corner */
00195       } else if ((mouWorld.x > (pto->rect.right  / 2)) &&
00196           (mouWorld.y > (pto->rect.bottom / 2))) {
00197
00198           pto->Mode = (msg == WM_RBUTTONDOWN) ? TMROTATE : TMSIZEXY;
00199           newmouScreen.x = pto->rect.right;
00200           newmouScreen.y = pto->rect.bottom;
00201       }
00202
00203       if (! (pto->Mode & pto->allowedModes)) {
00204         pto->Mode = TMNONE;
00205         return NULL;
00206       }
00207
00208       SetCapture(hwnd);
00209       LPtoDP (pto->hdc, &newmouScreen, 1);
00210       ClientToScreen (hwnd, &newmouScreen);
00211       SetCursorPos (newmouScreen.x,newmouScreen.y);
00212
00213       GetWorldTransform (pto->hdc, &pto->xfmDown);
00214     } return NULL;
00215
00216
00217
00218     /**********************************************************************\
00219     *  WM_MOUSEMOVE
00220     *
00221     * this is where almost all of the interesting calculation is done.
00222     *  First clip the mouse location to be in rectClip, then
00223     *  call MouseMove() to handle the different tracking modes.
00224     \**********************************************************************/
00225     case WM_MOUSEMOVE: {
00226       if ((short) LOWORD(lParam) < (short)pto->rectClip.left)
00227         lParam = MAKELONG ((WORD)pto->rectClip.left, HIWORD(lParam));
00228
00229       if (LOWORD(lParam) > (WORD)pto->rectClip.right)
00230         lParam = MAKELONG ((WORD)pto->rectClip.right, HIWORD(lParam));
00231
00232       if ((short) HIWORD(lParam) < (short)pto->rectClip.top)
00233         lParam = MAKELONG (LOWORD(lParam), (WORD)pto->rectClip.top);
00234
00235       if (HIWORD(lParam) > (WORD)pto->rectClip.bottom)
00236         lParam = MAKELONG (LOWORD(lParam),(WORD)pto->rectClip.bottom);
00237
00238       MouseMove (pto, msg, hwnd, lParam);
00239
00240     } return NULL;
00241
00242
00243
00244     /**********************************************************************\
00245     *  WM_RBUTTONUP & WM_LBUTTONUP
00246     *
00247     * simply release the mouse capture, and set the mode to TMNONE.
00248     \**********************************************************************/
00249     case WM_RBUTTONUP:
00250     case WM_LBUTTONUP: {
00251       if (pto->Mode) {
00252          ReleaseCapture();
00253          pto->Mode = TMNONE;
00254       }
00255     } return NULL;
00256
00257   }  /* end switch(msg) */
00258
00259   return NULL;  /* exercise all possible paths */
00260 }
00261
00262
00263
00264
00265
00266
00267 /**************************************************************************\
00268 *  function:  MouseMove()
00269 *
00270 *  input parameters:
00271 *   pto -  pointer to a track object.
00272 *   msg -  not used.
00273 *   hwnd - Window handle for the window the track object exists within.
00274 *   lParam - Usually fourth param to window proc. varies based on msg.
00275 *
00276 *  The tracking behavior which the user observers when moving the mouse
00277 *   is based on the current tracking mode of the object.  This is usually
00278 *   determined on the mouse down event (c.f. TM*).  First erase the old
00279 *   object, then figure out the change to the transform matrix, finally
00280 *   change the world transform matrix and redraw the object.
00281 *
00282 *  Tranform:
00283 *    (    eM11        eM12        0   )
00284 *    (    eM21        eM22        0   )
00285 *    (    eDx         eDy         1   )
00286 *
00287 *   xDevice = (xWorld * eM11) + (yWorld * eM21) + eDx
00288 *   yDevice = (xWorld * eM12) + (yWorld * eM22) + eDy
00289 *
00290 *   In this routine the Device (mouse location) and World (rectangle corner)
00291 *   points are known.  Therefore, the two equations above are solved for
00292 *   the desired matrix entry value (e.g. eM11, 1M12, ... eDy).  The tracking
00293 *   mode determines which one of these entries may be changed.  E.g. scaling
00294 *   in X modifies eM11 while shearing in X modifies eM12.  So rather than
00295 *   using the world transform to map from world to device points, we are
00296 *   back-computing the proper contents of the world transform.
00297 *
00298 \**************************************************************************/
00299 VOID MouseMove(PTrackObject pto, int msg, HWND hwnd, LONG_PTR lParam)
00300 {
00301 POINT  mouWorld, mouDevice, orgDevice;
00302
00303     UNREFERENCED_PARAMETER(msg);
00304
00305     doTrackObject(pto, TROB_PAINT, hwnd, lParam);
00306     mouDevice.x = mouWorld.x = LOWORD(lParam);
00307     mouDevice.y = mouWorld.y = HIWORD(lParam);
00308
00309     SetWorldTransform(pto->hdc, &pto->xfmDown);
00310     DPtoLP (pto->hdc, &mouWorld, 1);
00311
00312     /* offset the mouse device point for the viewport's origin. */
00313     GetViewportOrgEx (pto->hdc, &orgDevice);
00314     mouDevice.x -= orgDevice.x;
00315     mouDevice.y -= orgDevice.y;
00316
00317     GetWorldTransform(pto->hdc, &pto->xfmChange);
00318
00319     switch (pto->Mode) {
00320       /*******************************************************\
00321       *    (     1         xShear       0   )
00322       *    (     0           1          0   )
00323       *    (     0           0          1   )
00324       *
00325       * xWorld = rect.left == 0;
00326       \*******************************************************/
00327       case TMSHEARX: {
00328         pto->xfmChange.eM12 = (float) mouDevice.y;
00329         pto->xfmChange.eM12 -=pto->xfmChange.eDy;
00330         pto->xfmChange.eM12 /=(float) pto->rect.right ;
00331         SetWorldTransform (pto->hdc, &pto->xfmChange);
00332       } break;
00333
00334
00335       /*******************************************************\
00336       *    (     1           0          0   )
00337       *    (   yShear        1          0   )
00338       *    (     0           0          1   )
00339       *
00340       * yWorld = rect.top == 0;
00341       \*******************************************************/
00342       case TMSHEARY: {
00343         pto->xfmChange.eM21 = (float) mouDevice.x;
00344         pto->xfmChange.eM21 -=pto->xfmChange.eDx;
00345         pto->xfmChange.eM21 /=(float) pto->rect.bottom ;
00346         SetWorldTransform (pto->hdc, &pto->xfmChange);
00347
00348       } break;
00349
00350
00351       /*******************************************************\
00352       *    (   cos(a)      -sin(a)      0   )
00353       *    (   sin(a)       cos(a)      0   )
00354       *    (     0           0          1   )
00355       *
00356       * a == rotation angle.  Since mouse in in lower right,
00357       *  we need to shift this back 45 degrees (assuming that
00358       *  straight down is 0 degrees).  Thus we actually compute
00359       *  cos(a) = cos(b - 45) = cos(b)sin(45) + cos(45)sin(45)
00360       *  where b is angle from the origin to the mouse (x,y)
00361       *  cos(45) = sin(45) ~= 0.707107
00362       *  cos(b) = y/r    sin(b) = x/r
00363       *
00364       \*******************************************************/
00365       case TMROTATE: {
00366         float r;
00367
00368         /* translate back to the origin. */
00369         pto->xfmChange.eDx = pto->xfmChange.eDy = (float)0.0;
00370         SetWorldTransform (pto->hdc, &pto->xfmChange);
00371
00372         /* rotate about the origin. */
00373         r = (float) sqrt( (double)(mouWorld.x * mouWorld.x) +
00374                           (double)(mouWorld.y * mouWorld.y));
00375
00376         pto->xfmChange.eM11 = (float) mouWorld.y / r;
00377         pto->xfmChange.eM11 += (float) mouWorld.x / r;
00378         pto->xfmChange.eM11 *= (float) 0.707107;
00379         pto->xfmChange.eM22 = pto->xfmChange.eM11;
00380
00381         pto->xfmChange.eM12 = (float) mouWorld.y / r;
00382         pto->xfmChange.eM12 -= (float) mouWorld.x / r;
00383         pto->xfmChange.eM12 *= (float) 0.707107;
00384         pto->xfmChange.eM21 = -pto->xfmChange.eM12;
00385
00386         pto->xfmChange.eDx = pto->xfmChange.eDy = (float)0.0;
00387
00388         ModifyWorldTransform (pto->hdc, &pto->xfmChange, MWT_RIGHTMULTIPLY);
00389
00390         /* translate back to the original offset. */
00391         pto->xfmChange.eM11 =
00392         pto->xfmChange.eM22 = (float) 1.0;
00393         pto->xfmChange.eM12 =
00394         pto->xfmChange.eM21 = (float) 0.0;
00395
00396         pto->xfmChange.eDx = pto->xfmDown.eDx;
00397         pto->xfmChange.eDy = pto->xfmDown.eDy;
00398         ModifyWorldTransform (pto->hdc, &pto->xfmChange, MWT_RIGHTMULTIPLY);
00399         GetWorldTransform (pto->hdc, &pto->xfmChange);
00400       } break;
00401
00402
00403       /*******************************************************\
00404       *    (  Size X         0          0   )
00405       *    (     0        Size Y        0   )
00406       *    (     0           0          1   )
00407       *
00408       \*******************************************************/
00409       case TMSIZEXY: {
00410         pto->xfmChange.eM11 = (float) mouDevice.x;
00411         pto->xfmChange.eM11 -=pto->xfmChange.eDx;
00412         pto->xfmChange.eM11 -=((float) pto->rect.bottom*pto->xfmChange.eM21);
00413         pto->xfmChange.eM11 /=(float) pto->rect.right ;
00414         if (fabs(pto->xfmChange.eM11) < EPSILON)  // HACK.  system bug ?
00415            pto->xfmChange.eM11 = EPSILON;
00416
00417         pto->xfmChange.eM22 = (float) mouDevice.y;
00418         pto->xfmChange.eM22 -=pto->xfmChange.eDy;
00419         pto->xfmChange.eM22 -=((float) pto->rect.right*pto->xfmChange.eM12);
00420         pto->xfmChange.eM22 /=(float) pto->rect.bottom ;
00421         if (fabs(pto->xfmChange.eM22) < EPSILON)  // HACK.  system bug ?
00422            pto->xfmChange.eM22 = EPSILON;
00423         SetWorldTransform (pto->hdc, &pto->xfmChange);
00424       } break;
00425
00426
00427       /*******************************************************\
00428       *    (  Size X         0          0   )
00429       *    (     0           1          0   )
00430       *    (     0           0          1   )
00431       *
00432       * yWorld = rect.top == 0;
00433       \*******************************************************/
00434       case TMSIZEX: {
00435         pto->xfmChange.eM11 = (float) mouDevice.x;
00436         pto->xfmChange.eM11 -=pto->xfmChange.eDx;
00437         pto->xfmChange.eM11 /=(float) pto->rect.right ;
00438         if (fabs(pto->xfmChange.eM11) < EPSILON)  // HACK.  system bug ?
00439            pto->xfmChange.eM11 = EPSILON;
00440
00441         SetWorldTransform (pto->hdc, &pto->xfmChange);
00442       } break;
00443
00444
00445       /*******************************************************\
00446       *    (     1           0          0   )
00447       *    (     0        Size Y        0   )
00448       *    (     0           0          1   )
00449       *
00450       * xWorld = rect.left == 0;
00451       \*******************************************************/
00452       case TMSIZEY: {
00453         pto->xfmChange.eM22 = (float) mouDevice.y;
00454         pto->xfmChange.eM22 -=pto->xfmChange.eDy;
00455         pto->xfmChange.eM22 /=(float) pto->rect.bottom ;
00456         if (fabs(pto->xfmChange.eM22) < EPSILON)  // HACK.  system bug ?
00457            pto->xfmChange.eM22 = EPSILON;
00458         SetWorldTransform (pto->hdc, &pto->xfmChange);
00459       } break;
00460
00461
00462       /*******************************************************\
00463       *    (     1           0          0   )
00464       *    (     0           1          0   )
00465       *    (   Move x      Move y       1   )
00466       *
00467       * xWorld = rect.left == 0;
00468       * yWorld = rect.top == 0;
00469       \*******************************************************/
00470       case TMMOVE: {
00471         pto->xfmChange.eDx = (float) mouDevice.x ;
00472         pto->xfmChange.eDy = (float) mouDevice.y ;
00473         SetWorldTransform (pto->hdc, &pto->xfmChange);
00474       } break;
00475     } /* end switch */
00476
00477     doTrackObject(pto, TROB_PAINT, hwnd, lParam);
00478
00479     return;
00480  }
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/Simple/DispTree.Cxx Source File

  • WinBase
  • Indexing
  • Simple

DispTree.Cxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // FILE:     disptree.cxx
00011 //
00012 // PURPOSE:  Displays a command tree, for debugging.
00013 //
00014 // PLATFORM: Windows 2000
00015 //
00016 //--------------------------------------------------------------------------
00017
00018 #define UNICODE
00019
00020 #include <stdio.h>
00021 #include <windows.h>
00022
00023 #include <oledberr.h>
00024 #include <oledb.h>
00025 #include <cmdtree.h>
00026
00027 //+-------------------------------------------------------------------------
00028 //
00029 //  Function:   PrintVectorItems
00030 //
00031 //  Synopsis:   Prints items in a PROPVARIANT vector
00032 //
00033 //  Arguments:  [pVal]  - The array of values
00034 //              [cVals] - The count of values
00035 //              [pcFmt] - The format string
00036 //
00037 //--------------------------------------------------------------------------
00038
00039 template<class T> void PrintVectorItems(
00040     T *     pVal,
00041     ULONG   cVals,
00042     char *  pcFmt )
00043 {
00044     printf( "{ " );
00045
00046     for( ULONG iVal = 0; iVal < cVals; iVal++ )
00047     {
00048         if ( 0 != iVal )
00049             printf( "," );
00050         printf( pcFmt, *pVal++ );
00051     }
00052
00053     printf( " }" );
00054 } //PrintVectorItems
00055
00056 //+-------------------------------------------------------------------------
00057 //
00058 //  Function:   DisplayVariant
00059 //
00060 //  Synopsis:   Displays a PROPVARIANT.  This is not a complete
00061 //              implementation; many VT_ types are not complete.
00062 //
00063 //  Arguments:  [pNode]  - The command tree node
00064 //              [iLevel] - The 0-based level in the tree
00065 //
00066 //--------------------------------------------------------------------------
00067
00068 void DisplayVariant( PROPVARIANT * pVar )
00069 {
00070     if ( 0 == pVar )
00071     {
00072         printf( "NULL" );
00073         return;
00074     }
00075
00076     PROPVARIANT & v = *pVar;
00077
00078     switch ( v.vt )
00079     {
00080         case VT_I4 : printf( "VT_I4 %d", v.lVal ); break;
00081         case VT_UI1 : printf( "VT_UI1 %d", v.bVal ); break;
00082         case VT_I2 : printf( "VT_I2 %d", v.iVal ); break;
00083         case VT_R4 : printf( "VT_R4 %f", v.fltVal ); break;
00084         case VT_R8 : printf( "VT_R8 %lf", v.dblVal ); break;
00085         case VT_BOOL : printf( "VT_BOOL %d", v.boolVal ); break;
00086         case VT_ERROR : printf( "VT_ERROR %#x", v.scode ); break;
00087         case VT_CY :
00088         {
00089             double dbl;
00090             HRESULT hr = VarR8FromCy( pVar->cyVal, &dbl );
00091
00092             if ( SUCCEEDED( hr ) )
00093                 printf( "VT_CY %lf", dbl );
00094             break;
00095         }
00096         case VT_DATE : printf( "VT_DATE " ); break;
00097         case VT_FILETIME : printf( "VT_FILETIME %#I64x ", v.filetime ); break;
00098         case VT_BSTR : printf( "VT_BSTR '%ws'", v.bstrVal ); break;
00099         case VT_UNKNOWN : printf( "VT_UNKNOWN " ); break;
00100         case VT_DISPATCH : printf( "VT_DISPATCH " ); break;
00101         case VT_BYREF|VT_UI1 : printf( "VT_BYREF|VT_UI1 " ); break;
00102         case VT_BYREF|VT_I2 : printf( "VT_BYREF|VT_I2 " ); break;
00103         case VT_BYREF|VT_I4 : printf( "VT_BYREF|VT_I4 " ); break;
00104         case VT_BYREF|VT_R4 : printf( "VT_BYREF|VT_R4 " ); break;
00105         case VT_BYREF|VT_R8 : printf( "VT_BYREF|VT_R8 " ); break;
00106         case VT_BYREF|VT_BOOL : printf( "VT_BYREF|VT_BOOL " ); break;
00107         case VT_BYREF|VT_ERROR : printf( "VT_BYREF|VT_ERROR " ); break;
00108         case VT_BYREF|VT_CY : printf( "VT_BYREF|VT_CY " ); break;
00109         case VT_BYREF|VT_DATE : printf( "VT_BYREF|VT_DATE " ); break;
00110         case VT_BYREF|VT_BSTR : printf( "VT_BYREF|VT_BSTR " ); break;
00111         case VT_BYREF|VT_UNKNOWN : printf( "VT_BYREF|VT_UNKNOWN " ); break;
00112         case VT_BYREF|VT_DISPATCH : printf( "VT_BYREF|VT_DISPATCH " ); break;
00113         case VT_BYREF|VT_ARRAY : printf( "VT_BYREF|VT_ARRAY " ); break;
00114         case VT_BYREF|VT_VARIANT : printf( "VT_BYREF|VT_VARIANT " ); break;
00115         case VT_I1 : printf( "VT_I1 %d", v.bVal ); break;
00116         case VT_UI2 : printf( "VT_UI2 %u", v.uiVal ); break;
00117         case VT_UI4 : printf( "VT_UI4 %u", v.ulVal ); break;
00118         case VT_INT : printf( "VT_INT %d", v.lVal ); break;
00119         case VT_UINT : printf( "VT_UINT %u", v.ulVal ); break;
00120         case VT_BYREF|VT_DECIMAL : printf( "VT_BYREF|VT_DECIMAL " ); break;
00121         case VT_BYREF|VT_I1 : printf( "VT_BYREF|VT_I1 " ); break;
00122         case VT_BYREF|VT_UI2 : printf( "VT_BYREF|VT_UI2 " ); break;
00123         case VT_BYREF|VT_UI4 : printf( "VT_BYREF|VT_UI4 " ); break;
00124         case VT_BYREF|VT_INT : printf( "VT_BYREF|VT_INT " ); break;
00125         case VT_BYREF|VT_UINT : printf( "VT_BYREF|VT_UINT " ); break;
00126         case VT_LPSTR : printf( "VT_LPSTR '%s'", v.pszVal ); break;
00127         case VT_LPWSTR : printf( "VT_LPWSTR '%ws'", v.pwszVal ); break;
00128         case VT_I8 : printf( "VT_I8 %I64d", v.hVal ); break;
00129         case VT_UI8 : printf( "VT_I8 %I64u", v.hVal ); break;
00130         case VT_VECTOR | VT_I1:
00131             printf( "VT_VECTOR | VT_I1 " );
00132             PrintVectorItems( v.caub.pElems, v.caub.cElems, "%d" );
00133             break;
00134         case VT_VECTOR | VT_I2:
00135             printf( "VT_VECTOR | VT_I2 " );
00136             PrintVectorItems( v.cai.pElems, v.cai.cElems, "%d" );
00137             break;
00138         case VT_VECTOR | VT_I4:
00139             printf( "VT_VECTOR | VT_I4 " );
00140             PrintVectorItems( v.cal.pElems, v.cal.cElems, "%d" );
00141             break;
00142         case VT_VECTOR | VT_I8:
00143             printf( "VT_VECTOR | VT_I8 " );
00144             PrintVectorItems( v.cah.pElems, v.cah.cElems, "%I64d" );
00145             break;
00146         case VT_VECTOR | VT_UI1:
00147             printf( "VT_VECTOR | VT_UI1 " );
00148             PrintVectorItems( v.caub.pElems, v.caub.cElems, "%u" );
00149             break;
00150         case VT_VECTOR | VT_UI2:
00151             printf( "VT_VECTOR | VT_UI2 " );
00152             PrintVectorItems( v.caui.pElems, v.caui.cElems, "%u" );
00153             break;
00154         case VT_VECTOR | VT_UI4:
00155             printf( "VT_VECTOR | VT_UI4 " );
00156             PrintVectorItems( v.caul.pElems, v.caul.cElems, "%u" );
00157             break;
00158         case VT_VECTOR | VT_UI8:
00159             printf( "VT_VECTOR | VT_UI8 " );
00160             PrintVectorItems( v.cauh.pElems, v.cauh.cElems, "%I64u" );
00161             break;
00162         case VT_VECTOR | VT_BSTR:
00163             printf( "VT_VECTOR | VT_BSTR " );
00164             PrintVectorItems( v.cabstr.pElems, v.cabstr.cElems, "%ws" );
00165             break;
00166         case VT_VECTOR | VT_LPSTR:
00167             printf( "VT_VECTOR | VT_LPSTR " );
00168             PrintVectorItems( v.calpstr.pElems, v.calpstr.cElems, "%s" );
00169             break;
00170         case VT_VECTOR | VT_LPWSTR:
00171             printf( "VT_VECTOR | VT_LPWSTR " );
00172             PrintVectorItems( v.calpwstr.pElems, v.calpwstr.cElems, "%ws" );
00173             break;
00174         case VT_VECTOR | VT_R4:
00175             printf( "VT_VECTOR | VT_R4 " );
00176             PrintVectorItems( v.caflt.pElems, v.caflt.cElems, "%f" );
00177             break;
00178         case VT_VECTOR | VT_R8:
00179             printf( "VT_VECTOR | VT_R8 " );
00180             PrintVectorItems( v.cadbl.pElems, v.cadbl.cElems, "%lf" );
00181             break;
00182         default : printf( "unknown vt %#x", v.vt );
00183     }
00184 } //DisplayVariant
00185
00186 //+-------------------------------------------------------------------------
00187 //
00188 //  Function:   PrintSpace
00189 //
00190 //  Synopsis:   Prints white space.
00191 //
00192 //  Arguments:  [cPlaces] - Number of levels to print
00193 //
00194 //--------------------------------------------------------------------------
00195
00196 void PrintSpace( ULONG cPlaces )
00197 {
00198     for( ULONG iPlace = 0; iPlace < cPlaces; iPlace++ )
00199         printf( "  " );
00200 } //PrintSpace
00201
00202 //+-------------------------------------------------------------------------
00203 //
00204 //  Function:   DisplayCommandTree
00205 //
00206 //  Synopsis:   Displays the command tree, useful for debugging.  This is
00207 //              not a complete implementation; many DBVALUEKINDs are not
00208 //              complete.
00209 //
00210 //  Arguments:  [pNode]  - The command tree node
00211 //              [iLevel] - The 0-based level in the tree
00212 //
00213 //--------------------------------------------------------------------------
00214
00215 void DisplayCommandTree(
00216     DBCOMMANDTREE * pNode,
00217     ULONG           iLevel )
00218 {
00219     PrintSpace( iLevel );
00220     printf( "op: (%d) ", pNode->op );
00221     switch ( pNode->op )
00222     {
00223         case DBOP_scalar_constant : printf( "DBOP_scalar_constant" ); break;
00224         case DBOP_DEFAULT : printf( "DBOP_DEFAULT" ); break;
00225         case DBOP_NULL : printf( "DBOP_NULL" ); break;
00226         case DBOP_bookmark_name : printf( "DBOP_bookmark_name" ); break;
00227         case DBOP_catalog_name : printf( "DBOP_catalog_name" ); break;
00228         case DBOP_column_name : printf( "DBOP_column_name" ); break;
00229         case DBOP_schema_name : printf( "DBOP_schema_name" ); break;
00230         case DBOP_outall_name : printf( "DBOP_outall_name" ); break;
00231         case DBOP_qualifier_name : printf( "DBOP_qualifier_name" ); break;
00232         case DBOP_qualified_column_name : printf( "DBOP_qualified_column_name" ); break;
00233         case DBOP_table_name : printf( "DBOP_table_name" ); break;
00234         case DBOP_nested_table_name : printf( "DBOP_nested_table_name" ); break;
00235         case DBOP_nested_column_name : printf( "DBOP_nested_column_name" ); break;
00236         case DBOP_row : printf( "DBOP_row" ); break;
00237         case DBOP_table : printf( "DBOP_table" ); break;
00238         case DBOP_sort : printf( "DBOP_sort" ); break;
00239         case DBOP_distinct : printf( "DBOP_distinct" ); break;
00240         case DBOP_distinct_order_preserving : printf( "DBOP_distinct_order_preserving" ); break;
00241         case DBOP_alias : printf( "DBOP_alias" ); break;
00242         case DBOP_cross_join : printf( "DBOP_cross_join" ); break;
00243         case DBOP_union_join : printf( "DBOP_union_join" ); break;
00244         case DBOP_inner_join : printf( "DBOP_inner_join" ); break;
00245         case DBOP_left_semi_join : printf( "DBOP_left_semi_join" ); break;
00246         case DBOP_right_semi_join : printf( "DBOP_right_semi_join" ); break;
00247         case DBOP_left_anti_semi_join : printf( "DBOP_left_anti_semi_join" ); break;
00248         case DBOP_right_anti_semi_join : printf( "DBOP_right_anti_semi_join" ); break;
00249         case DBOP_left_outer_join : printf( "DBOP_left_outer_join" ); break;
00250         case DBOP_right_outer_join : printf( "DBOP_right_outer_join" ); break;
00251         case DBOP_full_outer_join : printf( "DBOP_full_outer_join" ); break;
00252         case DBOP_natural_join : printf( "DBOP_natural_join" ); break;
00253         case DBOP_natural_left_outer_join : printf( "DBOP_natural_left_outer_join" ); break;
00254         case DBOP_natural_right_outer_join : printf( "DBOP_natural_right_outer_join" ); break;
00255         case DBOP_natural_full_outer_join : printf( "DBOP_natural_full_outer_join" ); break;
00256         case DBOP_set_intersection : printf( "DBOP_set_intersection" ); break;
00257         case DBOP_set_union : printf( "DBOP_set_union" ); break;
00258         case DBOP_set_left_difference : printf( "DBOP_set_left_difference" ); break;
00259         case DBOP_set_right_difference : printf( "DBOP_set_right_difference" ); break;
00260         case DBOP_set_anti_difference : printf( "DBOP_set_anti_difference" ); break;
00261         case DBOP_bag_intersection : printf( "DBOP_bag_intersection" ); break;
00262         case DBOP_bag_union : printf( "DBOP_bag_union" ); break;
00263         case DBOP_bag_left_difference : printf( "DBOP_bag_left_difference" ); break;
00264         case DBOP_bag_right_difference : printf( "DBOP_bag_right_difference" ); break;
00265         case DBOP_bag_anti_difference : printf( "DBOP_bag_anti_difference" ); break;
00266         case DBOP_division : printf( "DBOP_division" ); break;
00267         case DBOP_relative_sampling : printf( "DBOP_relative_sampling" ); break;
00268         case DBOP_absolute_sampling : printf( "DBOP_absolute_sampling" ); break;
00269         case DBOP_transitive_closure : printf( "DBOP_transitive_closure" ); break;
00270         case DBOP_recursive_union : printf( "DBOP_recursive_union" ); break;
00271         case DBOP_aggregate : printf( "DBOP_aggregate" ); break;
00272         case DBOP_remote_table : printf( "DBOP_remote_table" ); break;
00273         case DBOP_select : printf( "DBOP_select" ); break;
00274         case DBOP_order_preserving_select : printf( "DBOP_order_preserving_select" ); break;
00275         case DBOP_project : printf( "DBOP_project" ); break;
00276         case DBOP_project_order_preserving : printf( "DBOP_project_order_preserving" ); break;
00277         case DBOP_top : printf( "DBOP_top" ); break;
00278         case DBOP_top_percent : printf( "DBOP_top_percent" ); break;
00279         case DBOP_top_plus_ties : printf( "DBOP_top_plus_ties" ); break;
00280         case DBOP_top_percent_plus_ties : printf( "DBOP_top_percent_plus_ties" ); break;
00281         case DBOP_rank : printf( "DBOP_rank" ); break;
00282         case DBOP_rank_ties_equally : printf( "DBOP_rank_ties_equally" ); break;
00283         case DBOP_rank_ties_equally_and_skip : printf( "DBOP_rank_ties_equally_and_skip" ); break;
00284         case DBOP_navigate : printf( "DBOP_navigate" ); break;
00285         case DBOP_nesting : printf( "DBOP_nesting" ); break;
00286         case DBOP_unnesting : printf( "DBOP_unnesting" ); break;
00287         case DBOP_nested_apply : printf( "DBOP_nested_apply" ); break;
00288         case DBOP_cross_tab : printf( "DBOP_cross_tab" ); break;
00289         case DBOP_is_NULL : printf( "DBOP_is_NULL" ); break;
00290         case DBOP_is_NOT_NULL : printf( "DBOP_is_NOT_NULL" ); break;
00291         case DBOP_equal : printf( "DBOP_equal" ); break;
00292         case DBOP_not_equal : printf( "DBOP_not_equal" ); break;
00293         case DBOP_less : printf( "DBOP_less" ); break;
00294         case DBOP_less_equal : printf( "DBOP_less_equal" ); break;
00295         case DBOP_greater : printf( "DBOP_greater" ); break;
00296         case DBOP_greater_equal : printf( "DBOP_greater_equal" ); break;
00297         case DBOP_equal_all : printf( "DBOP_equal_all" ); break;
00298         case DBOP_not_equal_all : printf( "DBOP_not_equal_all" ); break;
00299         case DBOP_less_all : printf( "DBOP_less_all" ); break;
00300         case DBOP_less_equal_all : printf( "DBOP_less_equal_all" ); break;
00301         case DBOP_greater_all : printf( "DBOP_greater_all" ); break;
00302         case DBOP_greater_equal_all : printf( "DBOP_greater_equal_all" ); break;
00303         case DBOP_equal_any : printf( "DBOP_equal_any" ); break;
00304         case DBOP_not_equal_any : printf( "DBOP_not_equal_any" ); break;
00305         case DBOP_less_any : printf( "DBOP_less_any" ); break;
00306         case DBOP_less_equal_any : printf( "DBOP_less_equal_any" ); break;
00307         case DBOP_greater_any : printf( "DBOP_greater_any" ); break;
00308         case DBOP_greater_equal_any : printf( "DBOP_greater_equal_any" ); break;
00309         case DBOP_anybits : printf( "DBOP_anybits" ); break;
00310         case DBOP_allbits : printf( "DBOP_allbits" ); break;
00311         case DBOP_anybits_any : printf( "DBOP_anybits_any" ); break;
00312         case DBOP_allbits_any : printf( "DBOP_allbits_any" ); break;
00313         case DBOP_anybits_all : printf( "DBOP_anybits_all" ); break;
00314         case DBOP_allbits_all : printf( "DBOP_allbits_all" ); break;
00315         case DBOP_between : printf( "DBOP_between" ); break;
00316         case DBOP_between_unordered : printf( "DBOP_between_unordered" ); break;
00317         case DBOP_match : printf( "DBOP_match" ); break;
00318         case DBOP_match_unique : printf( "DBOP_match_unique" ); break;
00319         case DBOP_match_partial : printf( "DBOP_match_partial" ); break;
00320         case DBOP_match_partial_unique : printf( "DBOP_match_partial_unique" ); break;
00321         case DBOP_match_full : printf( "DBOP_match_full" ); break;
00322         case DBOP_match_full_unique : printf( "DBOP_match_full_unique" ); break;
00323         case DBOP_scalar_parameter : printf( "DBOP_scalar_parameter" ); break;
00324         case DBOP_scalar_function : printf( "DBOP_scalar_function" ); break;
00325         case DBOP_plus : printf( "DBOP_plus" ); break;
00326         case DBOP_minus : printf( "DBOP_minus" ); break;
00327         case DBOP_times : printf( "DBOP_times" ); break;
00328         case DBOP_over : printf( "DBOP_over" ); break;
00329         case DBOP_div : printf( "DBOP_div" ); break;
00330         case DBOP_modulo : printf( "DBOP_modulo" ); break;
00331         case DBOP_power : printf( "DBOP_power" ); break;
00332         case DBOP_like : printf( "DBOP_like" ); break;
00333         case DBOP_sounds_like : printf( "DBOP_sounds_like" ); break;
00334         case DBOP_like_any : printf( "DBOP_like_any" ); break;
00335         case DBOP_like_all : printf( "DBOP_like_all" ); break;
00336         case DBOP_is_INVALID : printf( "DBOP_is_INVALID" ); break;
00337         case DBOP_is_TRUE : printf( "DBOP_is_TRUE" ); break;
00338         case DBOP_is_FALSE : printf( "DBOP_is_FALSE" ); break;
00339         case DBOP_and : printf( "DBOP_and" ); break;
00340         case DBOP_or : printf( "DBOP_or" ); break;
00341         case DBOP_xor : printf( "DBOP_xor" ); break;
00342         case DBOP_equivalent : printf( "DBOP_equivalent" ); break;
00343         case DBOP_not : printf( "DBOP_not" ); break;
00344         case DBOP_implies : printf( "DBOP_implies" ); break;
00345         case DBOP_overlaps : printf( "DBOP_overlaps" ); break;
00346         case DBOP_case_condition : printf( "DBOP_case_condition" ); break;
00347         case DBOP_case_value : printf( "DBOP_case_value" ); break;
00348         case DBOP_nullif : printf( "DBOP_nullif" ); break;
00349         case DBOP_cast : printf( "DBOP_cast" ); break;
00350         case DBOP_coalesce : printf( "DBOP_coalesce" ); break;
00351         case DBOP_position : printf( "DBOP_position" ); break;
00352         case DBOP_extract : printf( "DBOP_extract" ); break;
00353         case DBOP_char_length : printf( "DBOP_char_length" ); break;
00354         case DBOP_octet_length : printf( "DBOP_octet_length" ); break;
00355         case DBOP_bit_length : printf( "DBOP_bit_length" ); break;
00356         case DBOP_substring : printf( "DBOP_substring" ); break;
00357         case DBOP_upper : printf( "DBOP_upper" ); break;
00358         case DBOP_lower : printf( "DBOP_lower" ); break;
00359         case DBOP_trim : printf( "DBOP_trim" ); break;
00360         case DBOP_translate : printf( "DBOP_translate" ); break;
00361         case DBOP_convert : printf( "DBOP_convert" ); break;
00362         case DBOP_string_concat : printf( "DBOP_string_concat" ); break;
00363         case DBOP_current_date : printf( "DBOP_current_date" ); break;
00364         case DBOP_current_time : printf( "DBOP_current_time" ); break;
00365         case DBOP_current_timestamp : printf( "DBOP_current_timestamp" ); break;
00366         case DBOP_content_select : printf( "DBOP_content_select" ); break;
00367         case DBOP_content : printf( "DBOP_content" ); break;
00368         case DBOP_content_freetext : printf( "DBOP_content_freetext" ); break;
00369         case DBOP_content_proximity : printf( "DBOP_content_proximity" ); break;
00370         case DBOP_content_vector_or : printf( "DBOP_content_vector_or" ); break;
00371         case DBOP_delete : printf( "DBOP_delete" ); break;
00372         case DBOP_update : printf( "DBOP_update" ); break;
00373         case DBOP_insert : printf( "DBOP_insert" ); break;
00374         case DBOP_min : printf( "DBOP_min" ); break;
00375         case DBOP_max : printf( "DBOP_max" ); break;
00376         case DBOP_count : printf( "DBOP_count" ); break;
00377         case DBOP_sum : printf( "DBOP_sum" ); break;
00378         case DBOP_avg : printf( "DBOP_avg" ); break;
00379         case DBOP_any_sample : printf( "DBOP_any_sample" ); break;
00380         case DBOP_stddev : printf( "DBOP_stddev" ); break;
00381         case DBOP_stddev_pop : printf( "DBOP_stddev_pop" ); break;
00382         case DBOP_var : printf( "DBOP_var" ); break;
00383         case DBOP_var_pop : printf( "DBOP_var_pop" ); break;
00384         case DBOP_first : printf( "DBOP_first" ); break;
00385         case DBOP_last : printf( "DBOP_last" ); break;
00386         case DBOP_in : printf( "DBOP_in" ); break;
00387         case DBOP_exists : printf( "DBOP_exists" ); break;
00388         case DBOP_unique : printf( "DBOP_unique" ); break;
00389         case DBOP_subset : printf( "DBOP_subset" ); break;
00390         case DBOP_proper_subset : printf( "DBOP_proper_subset" ); break;
00391         case DBOP_superset : printf( "DBOP_superset" ); break;
00392         case DBOP_proper_superset : printf( "DBOP_proper_superset" ); break;
00393         case DBOP_disjoint : printf( "DBOP_disjoint" ); break;
00394         case DBOP_pass_through : printf( "DBOP_pass_through" ); break;
00395         case DBOP_defined_by_GUID : printf( "DBOP_defined_by_GUID" ); break;
00396         case DBOP_text_command : printf( "DBOP_text_command" ); break;
00397         case DBOP_SQL_select : printf( "DBOP_SQL_select" ); break;
00398         case DBOP_prior_command_tree : printf( "DBOP_prior_command_tree" ); break;
00399         case DBOP_add_columns : printf( "DBOP_add_columns" ); break;
00400         case DBOP_column_list_anchor : printf( "DBOP_column_list_anchor" ); break;
00401         case DBOP_column_list_element : printf( "DBOP_column_list_element" ); break;
00402         case DBOP_command_list_anchor : printf( "DBOP_command_list_anchor" ); break;
00403         case DBOP_command_list_element : printf( "DBOP_command_list_element" ); break;
00404         case DBOP_from_list_anchor : printf( "DBOP_from_list_anchor" ); break;
00405         case DBOP_from_list_element : printf( "DBOP_from_list_element" ); break;
00406         case DBOP_project_list_anchor : printf( "DBOP_project_list_anchor" ); break;
00407         case DBOP_project_list_element : printf( "DBOP_project_list_element" ); break;
00408         case DBOP_row_list_anchor : printf( "DBOP_row_list_anchor" ); break;
00409         case DBOP_row_list_element : printf( "DBOP_row_list_element" ); break;
00410         case DBOP_scalar_list_anchor : printf( "DBOP_scalar_list_anchor" ); break;
00411         case DBOP_scalar_list_element : printf( "DBOP_scalar_list_element" ); break;
00412         case DBOP_set_list_anchor : printf( "DBOP_set_list_anchor" ); break;
00413         case DBOP_set_list_element : printf( "DBOP_set_list_element" ); break;
00414         case DBOP_sort_list_anchor : printf( "DBOP_sort_list_anchor" ); break;
00415         case DBOP_sort_list_element : printf( "DBOP_sort_list_element" ); break;
00416         case DBOP_alter_character_set : printf( "DBOP_alter_character_set" ); break;
00417         case DBOP_alter_collation : printf( "DBOP_alter_collation" ); break;
00418         case DBOP_alter_domain : printf( "DBOP_alter_domain" ); break;
00419         case DBOP_alter_index : printf( "DBOP_alter_index" ); break;
00420         case DBOP_alter_procedure : printf( "DBOP_alter_procedure" ); break;
00421         case DBOP_alter_schema : printf( "DBOP_alter_schema" ); break;
00422         case DBOP_alter_table : printf( "DBOP_alter_table" ); break;
00423         case DBOP_alter_trigger : printf( "DBOP_alter_trigger" ); break;
00424         case DBOP_alter_view : printf( "DBOP_alter_view" ); break;
00425         case DBOP_coldef_list_anchor : printf( "DBOP_coldef_list_anchor" ); break;
00426         case DBOP_coldef_list_element : printf( "DBOP_coldef_list_element" ); break;
00427         case DBOP_create_assertion : printf( "DBOP_create_assertion" ); break;
00428         case DBOP_create_character_set : printf( "DBOP_create_character_set" ); break;
00429         case DBOP_create_collation : printf( "DBOP_create_collation" ); break;
00430         case DBOP_create_domain : printf( "DBOP_create_domain" ); break;
00431         case DBOP_create_index : printf( "DBOP_create_index" ); break;
00432         case DBOP_create_procedure : printf( "DBOP_create_procedure" ); break;
00433         case DBOP_create_schema : printf( "DBOP_create_schema" ); break;
00434         case DBOP_create_synonym : printf( "DBOP_create_synonym" ); break;
00435         case DBOP_create_table : printf( "DBOP_create_table" ); break;
00436         case DBOP_create_temporary_table : printf( "DBOP_create_temporary_table" ); break;
00437         case DBOP_create_translation : printf( "DBOP_create_translation" ); break;
00438         case DBOP_create_trigger : printf( "DBOP_create_trigger" ); break;
00439         case DBOP_create_view : printf( "DBOP_create_view" ); break;
00440         case DBOP_drop_assertion : printf( "DBOP_drop_assertion" ); break;
00441         case DBOP_drop_character_set : printf( "DBOP_drop_character_set" ); break;
00442         case DBOP_drop_collation : printf( "DBOP_drop_collation" ); break;
00443         case DBOP_drop_domain : printf( "DBOP_drop_domain" ); break;
00444         case DBOP_drop_index : printf( "DBOP_drop_index" ); break;
00445         case DBOP_drop_procedure : printf( "DBOP_drop_procedure" ); break;
00446         case DBOP_drop_schema : printf( "DBOP_drop_schema" ); break;
00447         case DBOP_drop_synonym : printf( "DBOP_drop_synonym" ); break;
00448         case DBOP_drop_table : printf( "DBOP_drop_table" ); break;
00449         case DBOP_drop_translation : printf( "DBOP_drop_translation" ); break;
00450         case DBOP_drop_trigger : printf( "DBOP_drop_trigger" ); break;
00451         case DBOP_drop_view : printf( "DBOP_drop_view" ); break;
00452         case DBOP_foreign_key : printf( "DBOP_foreign_key" ); break;
00453         case DBOP_grant_privileges : printf( "DBOP_grant_privileges" ); break;
00454         case DBOP_index_list_anchor : printf( "DBOP_index_list_anchor" ); break;
00455         case DBOP_index_list_element : printf( "DBOP_index_list_element" ); break;
00456         case DBOP_primary_key : printf( "DBOP_primary_key" ); break;
00457         case DBOP_property_list_anchor : printf( "DBOP_property_list_anchor" ); break;
00458         case DBOP_property_list_element : printf( "DBOP_property_list_element" ); break;
00459         case DBOP_referenced_table : printf( "DBOP_referenced_table" ); break;
00460         case DBOP_rename_object : printf( "DBOP_rename_object" ); break;
00461         case DBOP_revoke_privileges : printf( "DBOP_revoke_privileges" ); break;
00462         case DBOP_schema_authorization : printf( "DBOP_schema_authorization" ); break;
00463         case DBOP_unique_key : printf( "DBOP_unique_key" ); break;
00464         case DBOP_scope_list_anchor : printf( "DBOP_scope_list_anchor" ); break;
00465         case DBOP_scope_list_element : printf( "DBOP_scope_list_element" ); break;
00466         case DBOP_content_table : printf( "DBOP_content_table" ); break;
00467
00468         default : printf( "unknown DBOP" ); break;
00469     }
00470
00471     printf( "\n" );
00472
00473     PrintSpace( iLevel );
00474     printf( "wKind: (%d) ", pNode->wKind );
00475     switch( pNode->wKind )
00476     {
00477         case DBVALUEKIND_BYGUID :
00478         {
00479             printf( "DBVALUEKIND_BYGUID " );
00480             break;
00481         }
00482         case DBVALUEKIND_COLDESC :
00483         {
00484             printf( "DBVALUEKIND_COLDESC " );
00485             break;
00486         }
00487         case DBVALUEKIND_ID :
00488         {
00489             printf( "DBVALUEKIND_ID: " );
00490             if ( 0 == pNode->value.pdbidValue )
00491                 printf( "NULL" );
00492             else
00493             {
00494                 DBKIND kind = pNode->value.pdbidValue->eKind;
00495
00496                 if ( DBKIND_GUID        == kind ||
00497                      DBKIND_GUID_NAME   == kind ||
00498                      DBKIND_GUID_PROPID == kind )
00499                 {
00500                     GUID &g = pNode->value.pdbidValue->uGuid.guid;
00501                     printf( "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-"
00502                             "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
00503                             g.Data1,g.Data2,g.Data3,g.Data4[0],
00504                             g.Data4[1],g.Data4[2],g.Data4[3],g.Data4[4],
00505                             g.Data4[5],g.Data4[6],g.Data4[7] );
00506                 }
00507                 if ( DBKIND_GUID_PROPID == kind ||
00508                      DBKIND_PROPID      == kind )
00509                     printf( " %d", pNode->value.pdbidValue->uName.ulPropid );
00510                 if ( DBKIND_GUID_NAME == kind ||
00511                      DBKIND_NAME      == kind )
00512                     printf( " '%ws'", pNode->value.pdbidValue->uName.pwszName );
00513             }
00514             break;
00515         }
00516         case DBVALUEKIND_CONTENT :
00517         {
00518             printf( "DBVALUEKIND_CONTENT: " );
00519             if ( 0 == pNode->value.pdbcntntValue )
00520                 printf( "NULL" );
00521             else
00522                 printf( "'%ws', method %d, weight %d, lcid %#x",
00523                         pNode->value.pdbcntntValue->pwszPhrase,
00524                         pNode->value.pdbcntntValue->dwGenerateMethod,
00525                         pNode->value.pdbcntntValue->lWeight,
00526                         pNode->value.pdbcntntValue->lcid );
00527             break;
00528         }
00529         case DBVALUEKIND_CONTENTVECTOR :
00530         {
00531             printf( "DBVALUEKIND_CONTENTVECTOR: " );
00532             DBCONTENTVECTOR *p = pNode->value.pdbcntntvcValue;
00533             if ( 0 == p )
00534                 printf( "NULL" );
00535             else
00536             {
00537                 printf( "method %d, weight %d ",
00538                          p->dwRankingMethod,
00539                          p->lWeight );
00540             }
00541             break;
00542         }
00543         case DBVALUEKIND_GROUPINFO :
00544         {
00545             printf( "DBVALUEKIND_GROUPINFO " );
00546             break;
00547         }
00548         case DBVALUEKIND_PARAMETER :
00549         {
00550             printf( "DBVALUEKIND_PARAMETER " );
00551             break;
00552         }
00553         case DBVALUEKIND_PROPERTY :
00554         {
00555             printf( "DBVALUEKIND_PROPERTY " );
00556             break;
00557         }
00558         case DBVALUEKIND_SETFUNC :
00559         {
00560             printf( "DBVALUEKIND_SETFUNC " );
00561             break;
00562         }
00563         case DBVALUEKIND_SORTINFO :
00564         {
00565             printf( "DBVALUEKIND_SORTINFO: " );
00566             if ( 0 == pNode->value.pdbsrtinfValue )
00567                 printf( "NULL" );
00568             else
00569                 printf( "fDesc %d, lcid %#x",
00570                         pNode->value.pdbsrtinfValue->fDesc,
00571                         pNode->value.pdbsrtinfValue->lcid );
00572             break;
00573         }
00574         case DBVALUEKIND_TEXT :
00575         {
00576             printf( "DBVALUEKIND_TEXT " );
00577             break;
00578         }
00579         case DBVALUEKIND_COMMAND :
00580         {
00581             printf( "DBVALUEKIND_COMMAND " );
00582             break;
00583         }
00584         case DBVALUEKIND_MONIKER :
00585         {
00586             printf( "DBVALUEKIND_MONIKER " );
00587             break;
00588         }
00589         case DBVALUEKIND_ROWSET :
00590         {
00591             printf( "DBVALUEKIND_ROWSET " );
00592             break;
00593         }
00594         case DBVALUEKIND_LIKE :
00595         {
00596             printf( "DBVALUEKIND_LIKE " );
00597             break;
00598         }
00599         case DBVALUEKIND_CONTENTPROXIMITY :
00600         {
00601             printf( "DBVALUEKIND_CONTENTPROXIMITY " );
00602             break;
00603         }
00604         case DBVALUEKIND_CONTENTSCOPE :
00605         {
00606             printf( "DBVALUEKIND_CONTENTSCOPE " );
00607             if ( 0 == pNode->value.pdbcntntscpValue )
00608                 printf( "NULL" );
00609             else
00610                 printf( "dwFlags %#x, pwszElementValue %ws",
00611                         pNode->value.pdbcntntscpValue->dwFlags,
00612                         pNode->value.pdbcntntscpValue->pwszElementValue );
00613             break;
00614         }
00615         case DBVALUEKIND_CONTENTTABLE :
00616         {
00617             printf( "DBVALUEKIND_CONTENTTABLE " );
00618             if ( 0 == pNode->value.pdbcntnttblValue )
00619                 printf( "NULL" );
00620             else
00621                 printf( "machine %ws, catalog %ws",
00622                         pNode->value.pdbcntnttblValue->pwszMachine,
00623                         pNode->value.pdbcntnttblValue->pwszCatalog );
00624             break;
00625         }
00626         case DBVALUEKIND_IDISPATCH :
00627         {
00628             printf( "DBVALUEKIND_IDISPATCH " );
00629             break;
00630         }
00631         case DBVALUEKIND_IUNKNOWN :
00632         {
00633             printf( "DBVALUEKIND_IUNKNOWN " );
00634             break;
00635         }
00636         case DBVALUEKIND_EMPTY :
00637         {
00638             printf( "DBVALUEKIND_EMPTY " );
00639             break;
00640         }
00641         case DBVALUEKIND_NULL :
00642         {
00643             printf( "DBVALUEKIND_NULL " );
00644             break;
00645         }
00646         case DBVALUEKIND_I2 :
00647         {
00648             printf( "DBVALUEKIND_I2: %d", pNode->value.sValue );
00649             break;
00650         }
00651         case DBVALUEKIND_I4 :
00652         {
00653             printf( "DBVALUEKIND_I4: %d", pNode->value.lValue );
00654             break;
00655         }
00656         case DBVALUEKIND_R4 :
00657         {
00658             printf( "DBVALUEKIND_R4: %f", pNode->value.flValue );
00659             break;
00660         }
00661         case DBVALUEKIND_R8 :
00662         {
00663             printf( "DBVALUEKIND_R8: %lf", pNode->value.dblValue );
00664             break;
00665         }
00666         case DBVALUEKIND_CY :
00667         {
00668             printf( "DBVALUEKIND_CY " );
00669             break;
00670         }
00671         case DBVALUEKIND_DATE :
00672         {
00673             printf( "DBVALUEKIND_DATE " );
00674             break;
00675         }
00676         case DBVALUEKIND_BSTR :
00677         {
00678             printf( "DBVALUEKIND_BSTR: '%ws'", pNode->value.pbstrValue );
00679             break;
00680         }
00681         case DBVALUEKIND_ERROR :
00682         {
00683             printf( "DBVALUEKIND_ERROR: %d", pNode->value.scodeValue );
00684             break;
00685         }
00686         case DBVALUEKIND_BOOL :
00687         {
00688             printf( "DBVALUEKIND_BOOL: %d", pNode->value.fValue );
00689             break;
00690         }
00691         case DBVALUEKIND_VARIANT :
00692         {
00693             printf( "DBVALUEKIND_VARIANT " );
00694
00695             // Indexing Service uses PROPVARIANTs (extended VARIANTs)
00696
00697             DisplayVariant( (PROPVARIANT *) pNode->value.pvarValue );
00698             break;
00699         }
00700         case DBVALUEKIND_I1 :
00701         {
00702             printf( "DBVALUEKIND_I1: %d", pNode->value.schValue );
00703             break;
00704         }
00705         case DBVALUEKIND_UI1 :
00706         {
00707             printf( "DBVALUEKIND_UI1: %u", pNode->value.uchValue );
00708             break;
00709         }
00710         case DBVALUEKIND_UI2 :
00711         {
00712             printf( "DBVALUEKIND_UI2: %u", pNode->value.usValue );
00713             break;
00714         }
00715         case DBVALUEKIND_UI4 :
00716         {
00717             printf( "DBVALUEKIND_UI4: %u", pNode->value.ulValue );
00718             break;
00719         }
00720         case DBVALUEKIND_I8 :
00721         {
00722             printf( "DBVALUEKIND_I8: %I64d", pNode->value.llValue );
00723             break;
00724         }
00725         case DBVALUEKIND_UI8 :
00726         {
00727             printf( "DBVALUEKIND_UI8: %I64u", pNode->value.llValue );
00728             break;
00729         }
00730         case DBVALUEKIND_GUID :
00731         {
00732             printf( "DBVALUEKIND_GUID " );
00733             break;
00734         }
00735         case DBVALUEKIND_BYTES :
00736         {
00737             printf( "DBVALUEKIND_BYTES " );
00738             break;
00739         }
00740         case DBVALUEKIND_STR :
00741         {
00742             printf( "DBVALUEKIND_STR: '%s'", pNode->value.pzValue );
00743             break;
00744         }
00745         case DBVALUEKIND_WSTR :
00746         {
00747             printf( "DBVALUEKIND_WSTR: '%ws'", pNode->value.pwszValue );
00748             break;
00749         }
00750         case DBVALUEKIND_NUMERIC :
00751         {
00752             printf( "DBVALUEKIND_NUMERIC " );
00753             break;
00754         }
00755         case DBVALUEKIND_DBDATE :
00756         {
00757             printf( "DBVALUEKIND_DBDATE " );
00758             break;
00759         }
00760         case DBVALUEKIND_DBTIME :
00761         {
00762             printf( "DBVALUEKIND_DBTIME " );
00763             break;
00764         }
00765         case DBVALUEKIND_DBTIMESTAMP :
00766         {
00767             printf( "DBVALUEKIND_DBTIMESTAMP " );
00768             break;
00769         }
00770         default :
00771         {
00772             printf( "unknown DBVALUEKIND " );
00773             break;
00774         }
00775     }
00776
00777     printf( "\n" );
00778
00779     if ( pNode->pctFirstChild )
00780     {
00781         PrintSpace( iLevel );
00782         printf( "first child:\n" );
00783         DisplayCommandTree( pNode->pctFirstChild, iLevel + 1 );
00784     }
00785
00786     if ( pNode->pctNextSibling )
00787     {
00788         PrintSpace( iLevel );
00789         printf( "next sibling:\n" );
00790         DisplayCommandTree( pNode->pctNextSibling, iLevel + 1 );
00791     }
00792
00793     if ( 0 == iLevel )
00794         printf( "\n" );
00795 } //DisplayCommandTree
00796
00797
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

HTTP_REQUESTCB_PARAM Member List

This is the complete list of members for HTTP_REQUESTCB_PARAM, including all inherited members.
CallbackType | HTTP_REQUESTCB_PARAM
cbDataLength | HTTP_REQUESTCB_PARAM
cbStruct | HTTP_REQUESTCB_PARAM
dwContentLength | HTTP_REQUESTCB_PARAM
dwDataOffset | HTTP_REQUESTCB_PARAM
dwRequestCtx | HTTP_REQUESTCB_PARAM
dwResponseCode | HTTP_REQUESTCB_PARAM
fdwRequestFlags | HTTP_REQUESTCB_PARAM
hrRequest | HTTP_REQUESTCB_PARAM
lpDataBuffer | HTTP_REQUESTCB_PARAM
pstLastModified | HTTP_REQUESTCB_PARAM
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpCntr/iocs.Cpp Source File

  • Com
  • Fundamentals
  • SimpCntr

iocs.Cpp

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: IOCS.CPP
00003 //
00004 //      Implementation file for COleClientSite
00005 //
00006 // Functions:
00007 //
00008 //      See IOCS.H for class definition
00009 //
00010 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00011 //**********************************************************************
00012
00013 #include "pre.h"
00014 #include "iocs.h"
00015 #include "ias.h"
00016 #include "ioipf.h"
00017 #include "ioips.h"
00018 #include "app.h"
00019 #include "site.h"
00020 #include "doc.h"
00021
00022
00023 //**********************************************************************
00024 //
00025 // COleClientSite::QueryInterface
00026 //
00027 // Purpose:
00028 //
00029 //      Used for interface negotiation at this interface
00030 //
00031 // Parameters:
00032 //
00033 //      REFIID riid         -   A reference to the interface that is
00034 //                              being queried.
00035 //
00036 //      LPVOID FAR* ppvObj  -   An out parameter to return a pointer to
00037 //                              the interface.
00038 //
00039 // Return Value:
00040 //
00041 //      S_OK                -   The interface is supported.
00042 //      E_NOINTERFACE       -   The interface is not supported
00043 //
00044 // Function Calls:
00045 //      Function                    Location
00046 //
00047 //      OutputDebugString           Windows API
00048 //      CSimpleSite::QueryInterface SITE.CPP
00049 //
00050 // Comments:
00051 //
00052 //********************************************************************
00053
00054 STDMETHODIMP COleClientSite::QueryInterface(REFIID riid, LPVOID FAR* ppvObj)
00055 {
00056         OutputDebugString("In IOCS::QueryInterface\r\n");
00057
00058         // delegate to the container Site
00059         return m_pSite->QueryInterface(riid, ppvObj);
00060 }
00061
00062 //**********************************************************************
00063 //
00064 // CSimpleApp::AddRef
00065 //
00066 // Purpose:
00067 //
00068 //      Adds to the reference count at the interface level.
00069 //
00070 // Parameters:
00071 //
00072 //      None
00073 //
00074 // Return Value:
00075 //
00076 //      ULONG   -   The new reference count of the interface
00077 //
00078 // Function Calls:
00079 //      Function                    Location
00080 //
00081 //      OutputDebugString           Windows API
00082 //
00083 // Comments:
00084 //
00085 //********************************************************************
00086
00087 STDMETHODIMP_(ULONG) COleClientSite::AddRef()
00088 {
00089         OutputDebugString("In IOCS::AddRef\r\n");
00090
00091         // increment the interface reference count (for debugging only)
00092         ++m_nCount;
00093
00094         // delegate to the container Site
00095         return m_pSite->AddRef();
00096 }
00097
00098
00099 //**********************************************************************
00100 //
00101 // CSimpleApp::Release
00102 //
00103 // Purpose:
00104 //
00105 //      Decrements the reference count at this level
00106 //
00107 // Parameters:
00108 //
00109 //      None
00110 //
00111 // Return Value:
00112 //
00113 //      ULONG   -   The new reference count of the interface.
00114 //
00115 // Function Calls:
00116 //      Function                    Location
00117 //
00118 //      OutputDebugString           Windows API
00119 //
00120 // Comments:
00121 //
00122 //********************************************************************
00123
00124 STDMETHODIMP_(ULONG) COleClientSite::Release()
00125 {
00126         OutputDebugString("In IOCS::Release\r\n");
00127
00128         // decrement the interface reference count (for debugging only)
00129         --m_nCount;
00130
00131         // delegate to the container Site
00132         return m_pSite->Release();
00133 }
00134
00135 //**********************************************************************
00136 //
00137 // COleClientSite::SaveObject
00138 //
00139 // Purpose:
00140 //
00141 //      Called by the object when it wants to be saved to persistant
00142 //      storage
00143 //
00144 // Parameters:
00145 //
00146 //      None
00147 //
00148 // Return Value:
00149 //
00150 //      S_OK
00151 //
00152 // Function Calls:
00153 //      Function                            Location
00154 //
00155 //      OutputDebugString                   Windows API
00156 //      IOleObject::QueryInterface          Object
00157 //      IPersistStorage::SaveCompleted      Object
00158 //      IPersistStorage::Release            Object
00159 //      OleSave                             OLE API
00160 //                           OLE API
00161 //
00162 // Comments:
00163 //
00164 //********************************************************************
00165
00166 STDMETHODIMP COleClientSite::SaveObject()
00167 {
00168         CStabilize stabilize(m_pSite);
00169         LPPERSISTSTORAGE lpPS;
00170         SCODE sc = E_FAIL;
00171
00172         OutputDebugString("In IOCS::SaveObject\r\n");
00173
00174         // get a pointer to IPersistStorage
00175         HRESULT hErr = m_pSite->m_lpOleObject->QueryInterface(IID_IPersistStorage, (LPVOID FAR *)&lpPS);
00176
00177         // save the object
00178         if (hErr == NOERROR)
00179                 {
00180                 sc =  OleSave(lpPS, m_pSite->m_lpObjStorage, TRUE) ;
00181                 lpPS->SaveCompleted(NULL);
00182                 lpPS->Release();
00183                 }
00184
00185         return sc;
00186 }
00187
00188 //**********************************************************************
00189 //
00190 // COleClientSite::GetMoniker
00191 //
00192 // Purpose:
00193 //
00194 //      Not Implemented
00195 //
00196 // Parameters:
00197 //
00198 //      Not Implemented
00199 //
00200 // Return Value:
00201 //
00202 // Function Calls:
00203 //      Function                    Location
00204 //
00205 //      OutputDebugString           Windows API
00206 //
00207 // Comments:
00208 //
00209 //      This function is not implemented because we don't support
00210 //      linking.
00211 //
00212 //********************************************************************
00213
00214 STDMETHODIMP COleClientSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER FAR* ppmk)
00215 {
00216         OutputDebugString("In IOCS::GetMoniker\r\n");
00217
00218         // need to null the out pointer
00219         *ppmk = NULL;
00220
00221         return E_NOTIMPL;
00222 }
00223
00224 //**********************************************************************
00225 //
00226 // COleClientSite::GetContainer
00227 //
00228 // Purpose:
00229 //
00230 //      Not Implemented
00231 //
00232 // Parameters:
00233 //
00234 //      Not Implemented
00235 //
00236 // Return Value:
00237 //
00238 //      Not Implemented
00239 //
00240 // Function Calls:
00241 //      Function                    Location
00242 //
00243 //      OutputDebugString           Windows API
00244 //
00245 // Comments:
00246 //
00247 //      Not Implemented
00248 //
00249 //********************************************************************
00250
00251 STDMETHODIMP COleClientSite::GetContainer(LPOLECONTAINER FAR* ppContainer)
00252 {
00253         OutputDebugString("In IOCS::GetContainer\r\n");
00254
00255         // NULL the out pointer
00256         *ppContainer = NULL;
00257
00258         return E_NOTIMPL;
00259 }
00260
00261 //**********************************************************************
00262 //
00263 // COleClientSite::ShowObject
00264 //
00265 // Purpose:
00266 //
00267 //      Not Implemented
00268 //
00269 // Parameters:
00270 //
00271 //      Not Implemented
00272 //
00273 // Return Value:
00274 //
00275 //      Not Implemented
00276 //
00277 // Function Calls:
00278 //      Function                    Location
00279 //
00280 //      OutputDebugString           Windows API
00281 //
00282 // Comments:
00283 //
00284 //      This function is not implemented because we don't support
00285 //      linking.
00286 //
00287 //********************************************************************
00288
00289 STDMETHODIMP COleClientSite::ShowObject()
00290 {
00291         OutputDebugString("In IOCS::ShowObject\r\n");
00292         return NOERROR;
00293 }
00294
00295 //**********************************************************************
00296 //
00297 // COleClientSite::OnShowWindow
00298 //
00299 // Purpose:
00300 //
00301 //      Object calls this method when it is opening/closing non-InPlace
00302 //      Window
00303 //
00304 // Parameters:
00305 //
00306 //      BOOL fShow  - TRUE if Window is opening, FALSE if closing
00307 //
00308 // Return Value:
00309 //
00310 //      S_OK
00311 //
00312 // Function Calls:
00313 //      Function                    Location
00314 //
00315 //      OutputDebugString           Windows API
00316 //      InvalidateRect              Windows API
00317 //                   OLE API
00318 //
00319 // Comments:
00320 //
00321 //********************************************************************
00322
00323 STDMETHODIMP COleClientSite::OnShowWindow(BOOL fShow)
00324 {
00325         CStabilize stabilize(m_pSite);
00326         OutputDebugString("In IOCS::OnShowWindow\r\n");
00327         m_pSite->m_fObjectOpen = fShow;
00328         InvalidateRect(m_pSite->m_lpDoc->m_hDocWnd, NULL, TRUE);
00329
00330         // if object window is closing, then bring container window to top
00331         if (! fShow) {
00332                 BringWindowToTop(m_pSite->m_lpDoc->m_hDocWnd);
00333                 SetFocus(m_pSite->m_lpDoc->m_hDocWnd);
00334         }
00335         return S_OK;
00336 }
00337
00338 //**********************************************************************
00339 //
00340 // COleClientSite::RequestNewObjectLayout
00341 //
00342 // Purpose:
00343 //
00344 //      Not Implemented
00345 //
00346 // Parameters:
00347 //
00348 //      Not Implemented
00349 //
00350 // Return Value:
00351 //
00352 //      Not Implemented
00353 //
00354 // Function Calls:
00355 //      Function                    Location
00356 //
00357 //      OutputDebugString           Windows API
00358 //
00359 // Comments:
00360 //
00361 //      Not Implemented
00362 //
00363 //********************************************************************
00364
00365 STDMETHODIMP COleClientSite::RequestNewObjectLayout()
00366 {
00367         OutputDebugString("In IOCS::RequestNewObjectLayout\r\n");
00368         return E_NOTIMPL;
00369 }
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/CharHash.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

CharHash.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       charhash.hxx
00006 //
00007 //  Contents:   Hash table that maps special characters to Unicode
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __CHARHASH_HXX__ )
00012 #define __CHARHASH_HXX__
00013
00014 const MAX_TAG_LENGTH = 50;                  // Max length of any Html tag
00015
00016 const SPECIAL_CHAR_HASH_TABLE_SIZE = 97;    // Size of hash table
00017
00018 const PRIVATE_USE_MAPPING_FOR_LT = 0xe800;  // Unicode chars from private use area
00019 const PRIVATE_USE_MAPPING_FOR_GT = 0xe801;
00020
00021
00022 //+-------------------------------------------------------------------------
00023 //
00024 //  Class:      CSpecialCharHashTable
00025 //
00026 //  Purpose:    Hash table for special characters such as &agrave;
00027 //
00028 //--------------------------------------------------------------------------
00029
00030 class CSpecialCharHashEntry
00031 {
00032
00033 public:
00034     CSpecialCharHashEntry( WCHAR *pwszName, WCHAR wch );
00035
00036     WCHAR *                    GetName()                   { return _wszName; }
00037     WCHAR                      GetWideChar()               { return _wch; }
00038
00039     CSpecialCharHashEntry *    GetNextHashEntry()          { return _pHashEntryNext; }
00040     void SetNextHashEntry(CSpecialCharHashEntry *pEntry)   { _pHashEntryNext = pEntry; }
00041
00042 private:
00043     WCHAR                       _wszName[MAX_TAG_LENGTH];   // Special char name
00044     WCHAR                       _wch;                       // Unicode mapping
00045     CSpecialCharHashEntry *     _pHashEntryNext;            // Link to next entry
00046 };
00047
00048
00049 //+-------------------------------------------------------------------------
00050 //
00051 //  Class:      CSpecialCharHashTable
00052 //
00053 //  Purpose:    Hash table for special characters such as &nbsp;
00054 //
00055 //  Note:       As these are static hence global objects, don't make them
00056 //              unwindable.
00057 //
00058 //--------------------------------------------------------------------------
00059
00060 class CSpecialCharHashTable
00061 {
00062
00063 public:
00064     CSpecialCharHashTable();
00065     ~CSpecialCharHashTable();
00066
00067     void        Add( WCHAR *pwszName, WCHAR wch );
00068     BOOL        Lookup( WCHAR *pwcInputBuf,
00069                         unsigned uLen,
00070                         WCHAR& wch );
00071
00072 private:
00073     unsigned    Hash( WCHAR *pwszName, unsigned cLen );
00074
00075     CSpecialCharHashEntry *   _aHashTable[SPECIAL_CHAR_HASH_TABLE_SIZE];     // Actual hash table
00076 };
00077
00078
00079 #endif // __CHARHASH_HXX__
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DcdServe/DcdServe.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DcdServe

DcdServe.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      DCDSERVE.H
00003
00004   Summary:   Main include file for the DCDSERVE.EXE sample application.
00005              In addition to class definitions, this DCDSERVE.H file
00006              contains definitions of the application's menu, string,
00007              and other resource IDs.
00008
00009              For a comprehensive tutorial code tour of DCDSERVE's contents
00010              and offerings see the tutorial DCDSERVE.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the DCDSERVE source code.
00013
00014   Classes:   CMainWindow.
00015
00016   Functions: WinMain.
00017
00018   Origin:    8-23-97: atrent - Editor-inheritance from LOCSERVE.H in
00019                the LOCSERVE Tutorial Code Sample. [Revised]
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(DCDSERVE_H)
00037 #define DCDSERVE_H
00038
00039 #ifdef __cplusplus
00040
00041 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00042   Class:    CMainWindow
00043
00044   Summary:  Class to encapsulate the application's main window, menu, and
00045             message dispatching behavior.
00046
00047   Methods:  CMainWindow
00048               Constructor.
00049             InitInstance
00050               Creates a new instance of the main window.
00051 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00052 class CMainWindow: public CVirWindow
00053 {
00054   public:
00055     CMainWindow();
00056     ~CMainWindow();
00057     BOOL InitInstance(HINSTANCE, int);
00058
00059     // Methods for registering and unregistering this server.
00060     BOOL RegisterServer(void);
00061     BOOL UnregisterServer(void);
00062
00063     TCHAR m_szFileName[MAX_PATH];
00064
00065   protected:
00066     LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00067
00068   private:
00069     LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00070 };
00071
00072 #endif // __cplusplus
00073
00074 // Window Class String Macros.
00075 #define MAIN_WINDOW_TITLE_STR       "DCDSERVE: Tutorial Code Sample"
00076 #define MAIN_WINDOW_CLASS_NAME_STR  "DCDSERVEWindow"
00077 #define MAIN_WINDOW_CLASS_MENU_STR  "DCDSERVEMenu"
00078
00079 // File Menu Command Identifiers.
00080 #define IDM_FILE_EXIT               1000
00081
00082 // Help Menu Command Identifiers.
00083 #define IDM_HELP_ABOUT              1905
00084
00085 // Error-related String Identifiers.
00086 #define IDS_COMINITFAILED           2000
00087 #define IDS_APPINITFAILED           2001
00088 #define IDS_OUTOFMEMORY             2002
00089 #define IDS_NOHELPFILE              2003
00090 #define IDS_NOUNICODE               2004
00091 #define IDS_NODCOM                  2005
00092 #define IDS_NOSERVER                2006
00093
00094 #define IDS_ASSERT_FAIL             2200
00095
00096 // Notice-related String Identifiers.
00097 #define IDS_NOTIMPLEMENTED          2301
00098
00099 #endif // DCDSERVE_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/Atsp32/Resource.h Source File

  • NetDS
  • Tapi
  • Tapi2
  • Atsp32

Resource.h

Go to the documentation of this file.
00001 #define IDD_DIALOG1     101
00002 #define IDC_DEVICES     1001
00003 #define IDC_NAME        1002
00004 #define IDC_PORT        1003
00005 #define IDC_COMMANDS    1004
00006 #define IDC_ADD         1005
00007 #define IDC_REMOVE      1006
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/appletalk/PrSamp.h Source File

  • NetDS
  • WinSock
  • appletalk

PrSamp.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright 1994 - 2000 Microsoft Corporation
00004
00005 Module Name: prperf.c
00006
00007
00008 Abstract: This Sample Windows Socket Application demonstrates use of
00009           the AppleTalk PAP Protocol. Both a server and a client
00010           application are included in this source file. The client
00011           app reads a file and sends the contents to the server. The
00012           server writes out the received bytes to another file.
00013
00014
00015 --*/
00016
00017 BOOL
00018 DoServer();
00019
00020 BOOL
00021 DoClient();
00022
00023 BOOL
00024 OpenSocketRegisterAndListen();
00025
00026 unsigned long
00027 PerfThread(LPVOID lpvTest);
00028
00029 BOOL
00030 CheckForRecv(SOCKET s);
00031
00032 BOOL
00033 CheckForSend(SOCKET s);
00034
00035 void
00036 usage();
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CClientApp Member List

This is the complete list of members for CClientApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CClientApp() | CClientApp |
CWinApp() | CWinApp |
DoAPing(IPingResponder *pResp, DWORD dwTimeout) | CClientApp |
ExitInstance() | CWinApp | [virtual]
InitInstance() | CClientApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
nFail | CClientApp |
OnIdle(LONG lCount) | CClientApp | [virtual]
pDlg | CClientApp |
pMonitor | CClientApp |
pMonitorCallFactory | CClientApp |
pMonitorResponder | CClientApp |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CClientApp() | CClientApp |
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:55:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/appsub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

appsub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __APP_H__
00018 #define __APP_H__
00019
00020 #include "stdafx.h"
00021 #include "resource.h"       // main symbols
00022
00023 CComBSTR GuidToBstr(REFGUID guid);
00024
00025 class CComSpy;
00026
00027 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00028 Class:   CAppSub
00029 Summary: Application Event Subscriber
00030 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00031 class ATL_NO_VTABLE CAppSub :
00032   public CSysLCESub,
00033   public IComAppEvents
00034 {
00035 public:
00036   CAppSub()
00037   {
00038     m_pSpy = NULL;
00039   }
00040   CAppSub(CComSpy * pSpy)
00041   {
00042     m_pSpy = pSpy;
00043   }
00044   DECLARE_NOT_AGGREGATABLE(CAppSub)
00045   DECLARE_GET_CONTROLLING_UNKNOWN()
00046
00047   BEGIN_COM_MAP(CAppSub)
00048     COM_INTERFACE_ENTRY(IComAppEvents)
00049     COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00050   END_COM_MAP()
00051
00052
00053   STDMETHODIMP GetEventType(EventEnum * e){*e = Application;return S_OK;}
00054   STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00055   STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComAppEvents;return S_OK;}
00056
00057
00058   STDMETHODIMP OnAppActivation(COMSVCSEVENTINFO * pInfo, GUID guidApp)
00059   {
00060     if (m_pSpy)
00061     {
00062       CComBSTR sGuidApp = GuidToBstr(guidApp);
00063       m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnAppActivation"), sGuidApp);
00064       m_pSpy -> AddParamValueToList(L"guidApp", sGuidApp);
00065
00066       IF_AUDIT_DO(OnAppActivation)(pInfo->perfCount, sGuidApp);
00067     }
00068     return S_OK;
00069   }
00070
00071   STDMETHODIMP OnAppShutdown(COMSVCSEVENTINFO * pInfo, GUID guidApp)
00072   {
00073     if (m_pSpy)
00074     {
00075       CComBSTR sGuidApp = GuidToBstr(guidApp);
00076       m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnAppShutdown"), sGuidApp);
00077       m_pSpy -> AddParamValueToList(L"guidApp", sGuidApp);
00078       IF_AUDIT_DO(OnAppShutdown)(pInfo->perfCount, sGuidApp);
00079     }
00080
00081     return S_OK;
00082   }
00083
00084   STDMETHODIMP OnAppForceShutdown(COMSVCSEVENTINFO * pInfo, GUID guidApp)
00085   {
00086     if (m_pSpy)
00087     {
00088       CComBSTR sGuidApp = GuidToBstr(guidApp);
00089       m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnAppForceShutdown"), sGuidApp);
00090       m_pSpy -> AddParamValueToList(L"guidApp", sGuidApp);
00091 //      IF_AUDIT_DO(OnAppShutdown)(pInfo->perfCount, sGuidApp);
00092     }
00093
00094   return S_OK;
00095   }
00096 };
00097
00098 #endif //__APP_H__
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/hashtbl.h Source File

  • Dataaccess
  • oledb
  • sampprov

hashtbl.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @module hashtbl.h | Class Definitions for CHashTbl Class and
00006 // miscellaneous bookmark functions
00007 //
00008 //
00009 #ifndef _HASHTBL_H_
00010 #define _HASHTBL_H_
00011 #include "bitarray.h"
00012
00013 #define SIZE_64K         65535      // Actually 64*1024-1
00014
00015
00016 // This defines the data as stored within the row buffer.
00017 // Each row has columns laid out sequentially.
00018 // Use 'offsetof' when doing pointer addition.
00019 // Note that it is important to align these.
00020 // Suggest ensuring quadword alignment for double and __int64.
00021
00022 typedef struct _COLUMNDATA {
00023   SDWORD    dwLength; // length of data (not space allocated)
00024   DWORD   dwStatus; // status of column
00025   BYTE    bData[1]; // data here and beyond
00026 } COLUMNDATA, *PCOLUMNDATA;
00027
00028 // This is the layout of a row.
00029 // Note the unique arrangement of the hash chain pointers
00030 // inside the row itself.
00031 // Note also that the structure for columns is defined, and
00032 // each row contains an array of columns.
00033 // Bookmarks are named separately from ColumnData, for clarity
00034 // of usage.  The layout directly matches COLUMNDATA, however.
00035 // There are asserts which enforce this.
00036 typedef struct tagRowBuff
00037 {
00038   DBREFCOUNT  ulRefCount;   // reference count of outstanding handles
00039   ULONG       irowbuffNext; // next row in bookmark hash chain
00040   USHORT      wBmkHash;   // hash value (redundant)
00041   VOID       *pbBmk;      // ptr  to bookmark
00042   DBBKMARK    cbBmk;      // (dwLength) bookmark size, in bytes
00043   ULONG       dwBmkStatus;  // (dwStatus) bookmark status
00044   DBBKMARK    dwBmk;      // (bData)    bookmark value, , maybe row count
00045   COLUMNDATA  cdData[1];    // Column data here and beyond (Bookmark should be here)
00046 } ROWBUFF, *PROWBUFF;
00047
00048 typedef struct tagSLOT
00049 {
00050   ULONG islotNext;
00051   ULONG islotPrev;
00052   ULONG cslot;
00053 } SLOT, *PSLOT;
00054
00055 typedef struct tagLSTSLOT
00056 {
00057   ULONG       islotFirst;
00058   ULONG       islotRov;
00059   ULONG       islotMin;
00060   ULONG       islotMax;
00061   BYTE        *rgslot;
00062   LPBITARRAY  pbitsSlot;  // bit array to mark active rows
00063   ULONG       cbExtra;
00064   ULONG       cbslotLeftOver;
00065   ULONG       cbSlot;
00066   ULONG       cbPage;
00067   ULONG       cbCommitCurrent;
00068   ULONG       cbCommitMax;
00069 } LSTSLOT, *PLSTSLOT;
00070
00071
00072 HRESULT GetNextSlots(PLSTSLOT plstslot, ULONG cslot, ULONG* pislot);
00073 VOID DecoupleSlot(PLSTSLOT plstslot, ULONG islot, PSLOT pslot);
00074 VOID AddSlotToList(PLSTSLOT plstslot, ULONG islot, PSLOT pslot);
00075 HRESULT ReleaseSlots(PLSTSLOT plstslot, ULONG islot, ULONG cslot);
00076 HRESULT InitializeSlotList(ULONG cslotMax, ULONG cbSlot, ULONG cbPage, LPBITARRAY pbits, PLSTSLOT* pplstslot, BYTE** prgslot);
00077 HRESULT ResetSlotList(PLSTSLOT plstslot);
00078 HRESULT ReleaseSlotList(PLSTSLOT plstslot);
00079
00080
00081 #endif
00082
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/BPSamp/BPSamp.h Source File

  • WinBase
  • Debug
  • BPSamp

BPSamp.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004    TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE
00006
00007    Copyright (C) 1999 - 2000. Microsoft Corporation. All rights reserved.
00008
00009    bpsamp.h
00010
00011      Contains declarations for functions and globals that are used
00012      across all C files in this project.
00013
00014 ----------------------------------------------------------------------------*/
00015 void dump_debug_event_info(DEBUG_EVENT *de);
00016 void display_help(void);
00017
00018
00019 BOOL add_thread(DWORD dwThreadID, HANDLE hThread);
00020 BOOL remove_thread(DWORD dwThreadID);
00021 BOOL display_thread_registers(DWORD dwID);
00022
00023 void set_thread_eip_back(DWORD dwThreadID);
00024
00025
00026
00027 BOOL WINAPI control_C_handler(DWORD dwCtrlType);
00028 BOOL do_debug_command(void);
00029 BOOL set_databreakpoint(DWORD dwAddress);
00030 BOOL clear_databreakpoint(void);
00031
00032 BOOL set_codebreakpoint(DWORD dwAddress);
00033 BOOL clear_codebreakpoint(void);
00034
00035 extern BOOL g_fInDbgCmd;
00036
00037 extern BOOL g_fAtCodeBreakpoint;
00038 extern DWORD g_dwCodeAddress;
00039 extern DWORD g_dwCurrentThreadID;
00040
00041 extern HANDLE g_hProcDebuggee;
00042
00043
00044
Generated on Wed Nov 13 2024 16:52:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/TitleTag.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

TitleTag.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright 1992 - 2000 Microsoft Corporation.
00004 //
00005 //  File:       titletag.cxx
00006 //
00007 //  Contents:   Parsing algorithm for title tag in Html
00008 //
00009 //  Classes:    CTitleTag
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <titletag.hxx>
00017 #include <htmlguid.hxx>
00018
00019 //+-------------------------------------------------------------------------
00020 //
00021 //  Method:     CTitleTag::CTitleTag
00022 //
00023 //  Synopsis:   Constructor
00024 //
00025 //  Arguments:  [htmlIFilter]  -- Reference to Html filter
00026 //              [serialStream] -- Reference to input stream
00027 //              [propSpec]     -- Property spec
00028 //              [eTokType]     -- Token corresponding to this property
00029 //
00030 //--------------------------------------------------------------------------
00031
00032 CTitleTag::CTitleTag( CHtmlIFilter& htmlIFilter,
00033                       CSerialStream& serialStream,
00034                       CFullPropSpec& propSpec,
00035                       HtmlTokenType eTokType )
00036     : CPropertyTag(htmlIFilter, serialStream, propSpec, eTokType)
00037 {
00038 }
00039
00040
00041
00042 //+-------------------------------------------------------------------------
00043 //
00044 //  Method:     CTitleTag::GetChunk
00045 //
00046 //  Synopsis:   Gets the next chunk and returns chunk information in pStat
00047 //
00048 //  Arguments:  [pStat] -- chunk information returned here
00049 //
00050 //--------------------------------------------------------------------------
00051
00052 SCODE CTitleTag::GetChunk( STAT_CHUNK * pStat )
00053 {
00054     switch ( _eState )
00055     {
00056     case NoMoreProperty:
00057         _eState = FilteringValueProperty;
00058
00059         pStat->idChunk = _htmlIFilter.GetNextChunkId();
00060         pStat->breakType = CHUNK_EOS;
00061         pStat->flags = CHUNK_VALUE;
00062         pStat->locale = _htmlIFilter.GetLocale();
00063         pStat->attribute.guidPropSet = _propSpec.GetPropSet();
00064
00065         Win4Assert( _propSpec.IsPropertyPropid() );
00066
00067         pStat->attribute.psProperty.ulKind = PRSPEC_PROPID;
00068         pStat->attribute.psProperty.propid = _propSpec.GetPropertyPropid();
00069         pStat->idChunkSource = _ulIdContentChunk;
00070         pStat->cwcStartSource = 0;
00071         pStat->cwcLenSource = 0;
00072
00073         return S_OK;
00074
00075     case FilteringValueProperty:
00076     case NoMoreValueProperty:
00077         //
00078         // Skip over the end property tag
00079         //
00080         _scanner.EatTag();
00081
00082         return SwitchToNextHtmlElement( pStat );
00083
00084     default:
00085         return CPropertyTag::GetChunk( pStat );
00086     }
00087 }
00088
00089
00090
00091 //+-------------------------------------------------------------------------
00092 //
00093 //  Method:     CTitleTag::GetText
00094 //
00095 //  Synopsis:   Retrieves text from current chunk
00096 //
00097 //  Arguments:  [pcwcBuffer] -- count of UniCode characters in buffer
00098 //              [awcBuffer]  -- buffer for text
00099 //
00100 //--------------------------------------------------------------------------
00101
00102 SCODE CTitleTag::GetText( ULONG *pcwcOutput, WCHAR *awcBuffer )
00103 {
00104     switch ( _eState )
00105     {
00106     case FilteringValueProperty:
00107     case NoMoreValueProperty:
00108         return FILTER_E_NO_TEXT;
00109
00110     default:
00111         return CPropertyTag::GetText( pcwcOutput, awcBuffer );
00112     }
00113 }
00114
00115
00116
00117 //+-------------------------------------------------------------------------
00118 //
00119 //  Method:     CTitleTag::GetValue
00120 //
00121 //  Synopsis:   Retrieves value from current chunk
00122 //
00123 //  Arguments:  [ppPropValue] -- Value returned here
00124 //
00125 //--------------------------------------------------------------------------
00126
00127 SCODE CTitleTag::GetValue( PROPVARIANT **ppPropValue )
00128 {
00129     switch (_eState)
00130     {
00131     case FilteringContent:
00132     case NoMoreContent:
00133     case FilteringProperty:
00134     case FilteringPropertyButContentNotFiltered:
00135     case NoMoreProperty:
00136         return FILTER_E_NO_VALUES;
00137
00138     case FilteringValueProperty:
00139     {
00140         ConcatenateProperty( L"\0", 1 );     // Null terminate for SetLPWSTR
00141
00142         PROPVARIANT *pPropVar = (PROPVARIANT *) CoTaskMemAlloc( sizeof PROPVARIANT );
00143         if ( pPropVar == 0 )
00144             return E_OUTOFMEMORY;
00145
00146         pPropVar->vt = VT_LPWSTR;
00147         int cb = (int) ( ( wcslen(_pwcPropBuf) + 1 ) * sizeof( WCHAR ) );
00148         pPropVar->pwszVal = (WCHAR *) CoTaskMemAlloc( cb );
00149
00150         if ( pPropVar->pwszVal == 0 )
00151         {
00152             CoTaskMemFree( (void *) pPropVar );
00153             return E_OUTOFMEMORY;
00154         }
00155
00156         RtlCopyMemory( pPropVar->pwszVal, _pwcPropBuf, cb );
00157
00158         *ppPropValue = pPropVar;
00159
00160         _eState = NoMoreValueProperty;
00161         return S_OK;
00162     }
00163
00164     case NoMoreValueProperty:
00165         return FILTER_E_NO_MORE_VALUES;
00166
00167     default:
00168         Win4Assert( !"Unknown value of _eState" );
00169         htmlDebugOut(( DEB_ERROR,
00170                        "CTitleTag::GetValue, unknown value of _eState: %d\n",
00171                        _eState ));
00172         return E_FAIL;
00173     }
00174 }
00175
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Explore.VC/UtilitiesDlg.h Source File

  • Com
  • Administration
  • Explore.VC

UtilitiesDlg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018
00019
00020 #if !defined(AFX_UTILITIESDLG_H__0B7BB73C_B53B_11D2_86A8_000000000000__INCLUDED_)
00021 #define AFX_UTILITIESDLG_H__0B7BB73C_B53B_11D2_86A8_000000000000__INCLUDED_
00022
00023 #if _MSC_VER > 1000
00024 #pragma once
00025 #endif // _MSC_VER > 1000
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CUtilitiesDlg dialog
00029
00030 class CUtilitiesDlg : public CDialog
00031 {
00032 // Construction
00033 public:
00034   void set_Catalog(ICOMAdminCatalog* pCatalog);
00035   CUtilitiesDlg(CWnd* pParent = NULL);   // standard constructor
00036
00037 // Dialog Data
00038   //{{AFX_DATA(CUtilitiesDlg)
00039   enum { IDD = IDD_UTILITIES };
00040     // NOTE: the ClassWizard will add data members here
00041   //}}AFX_DATA
00042
00043
00044 // Overrides
00045   // ClassWizard generated virtual function overrides
00046   //{{AFX_VIRTUAL(CUtilitiesDlg)
00047   protected:
00048   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00049   //}}AFX_VIRTUAL
00050
00051 // Implementation
00052 protected:
00053   HICON m_hIcon;
00054
00055   // Generated message map functions
00056   //{{AFX_MSG(CUtilitiesDlg)
00057   afx_msg void OnClose();
00058   virtual BOOL OnInitDialog();
00059   afx_msg void OnJNEC();
00060   afx_msg void OnRefresh();
00061   afx_msg void OnRouter();
00062   afx_msg void OnStart();
00063   afx_msg void OnStop();
00064   virtual void OnOK();
00065   //}}AFX_MSG
00066   DECLARE_MESSAGE_MAP()
00067 private:
00068   void ReleaseCatalog();
00069   int m_nUtilityOption;
00070   int m_nUtilityType;
00071   ICOMAdminCatalog* m_pCatalog;
00072 };
00073
00074 //{{AFX_INSERT_LOCATION}}
00075 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00076
00077 #endif // !defined(AFX_UTILITIESDLG_H__0B7BB73C_B53B_11D2_86A8_000000000000__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/csession.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

csession.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CSESSION.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 /////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 /////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016
00017
00018 /////////////////////////////////////////////////////////////////
00019 // CSession::CSession
00020 //
00021 /////////////////////////////////////////////////////////////////
00022 CSession::CSession(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild)
00023   : CAsynchBase(eCSession, pCMainWindow, pCMDIChild)
00024 {
00025   //OLE DB Interfaces
00026   m_pIGetDataSource   = NULL;   //Session interface
00027   m_pIOpenRowset      = NULL;   //Session interface
00028   m_pISessionProperties = NULL;   //Session interface
00029   m_pIDBCreateCommand   = NULL;   //Session interface
00030   m_pIDBSchemaRowset    = NULL;   //Session interface
00031   m_pIIndexDefinition   = NULL;   //Session interface
00032   m_pIAlterIndex      = NULL;   //Session interface
00033   m_pIAlterTable      = NULL;   //Session interface
00034   m_pITableDefinition   = NULL;   //Session interface
00035   m_pITableDefinitionWithConstraints  = NULL;   //Session interface
00036
00037   m_pITransaction     = NULL;   //Session interface
00038   m_pITransactionLocal  = NULL;   //Session interface
00039   m_pITransactionJoin   = NULL;   //Session interface
00040   m_pITransactionObject = NULL;   //Session interface
00041
00042   m_pIBindResource    = NULL;   //Session interface
00043   m_pICreateRow     = NULL;   //Session interface
00044
00045   m_cProvTypes      = 0;  // for native type names
00046   m_rgProvTypes     = NULL;
00047 }
00048
00049
00050 /////////////////////////////////////////////////////////////////
00051 // CSession::~CSession
00052 //
00053 /////////////////////////////////////////////////////////////////
00054 CSession::~CSession()
00055 {
00056   ReleaseObject(0);
00057
00058   //Objects
00059   m_listCPropSets.RemoveAll();
00060 }
00061
00062
00063 /////////////////////////////////////////////////////////////////
00064 // IUnknown** CSession::GetInterfaceAddress
00065 //
00066 /////////////////////////////////////////////////////////////////
00067 IUnknown** CSession::GetInterfaceAddress(REFIID riid)
00068 {
00069   HANDLE_GETINTERFACE(IGetDataSource);
00070   HANDLE_GETINTERFACE(IOpenRowset);
00071   HANDLE_GETINTERFACE(ISessionProperties);
00072   HANDLE_GETINTERFACE(IDBCreateCommand);
00073   HANDLE_GETINTERFACE(IDBSchemaRowset);
00074   HANDLE_GETINTERFACE(IIndexDefinition);
00075   HANDLE_GETINTERFACE(IAlterIndex);
00076   HANDLE_GETINTERFACE(IAlterTable);
00077   HANDLE_GETINTERFACE(ITableDefinition);
00078   HANDLE_GETINTERFACE(ITableDefinitionWithConstraints);
00079   HANDLE_GETINTERFACE(ITransaction);
00080   HANDLE_GETINTERFACE(ITransactionLocal);
00081   HANDLE_GETINTERFACE(ITransactionJoin);
00082   HANDLE_GETINTERFACE(ITransactionObject);
00083   HANDLE_GETINTERFACE(IBindResource);
00084   HANDLE_GETINTERFACE(ICreateRow);
00085
00086   //Otherwise delegate
00087   return CAsynchBase::GetInterfaceAddress(riid);
00088 }
00089
00090
00091 /////////////////////////////////////////////////////////////////
00092 // HRESULT CSession::AutoRelease
00093 //
00094 /////////////////////////////////////////////////////////////////
00095 HRESULT CSession::AutoRelease()
00096 {
00097   //Session
00098   RELEASE_INTERFACE(IGetDataSource);
00099   RELEASE_INTERFACE(IOpenRowset);
00100   RELEASE_INTERFACE(ISessionProperties);
00101   RELEASE_INTERFACE(IDBCreateCommand);
00102   RELEASE_INTERFACE(IDBSchemaRowset);
00103   RELEASE_INTERFACE(IIndexDefinition);
00104   RELEASE_INTERFACE(IAlterIndex);
00105   RELEASE_INTERFACE(IAlterTable);
00106   RELEASE_INTERFACE(ITableDefinition);
00107   RELEASE_INTERFACE(ITableDefinitionWithConstraints);
00108   RELEASE_INTERFACE(ITransaction);
00109   RELEASE_INTERFACE(ITransactionLocal);
00110   RELEASE_INTERFACE(ITransactionObject);
00111   RELEASE_INTERFACE(ITransactionJoin);
00112
00113   RELEASE_INTERFACE(IBindResource);
00114   RELEASE_INTERFACE(ICreateRow);
00115
00116   //Delegate
00117   return CAsynchBase::AutoRelease();
00118 }
00119
00120
00121 /////////////////////////////////////////////////////////////////
00122 // HRESULT CSession::AutoQI
00123 //
00124 /////////////////////////////////////////////////////////////////
00125 HRESULT CSession::AutoQI(DWORD dwCreateOpts)
00126 {
00127   //Delegate First so we have base interfaces
00128   CAsynchBase::AutoQI(dwCreateOpts);
00129
00130   //[MANDATORY]
00131   if(dwCreateOpts & CREATE_QI_MANDATORY)
00132   {
00133     OBTAIN_INTERFACE(IOpenRowset);
00134     OBTAIN_INTERFACE(IGetDataSource);
00135     OBTAIN_INTERFACE(ISessionProperties);
00136   }
00137
00138   //AutoQI
00139   if(dwCreateOpts & CREATE_QI_OPTIONAL)
00140   {
00141     //[OPTIONAL]
00142     OBTAIN_INTERFACE(IDBCreateCommand);
00143     OBTAIN_INTERFACE(IDBSchemaRowset);
00144     OBTAIN_INTERFACE(IIndexDefinition);
00145     OBTAIN_INTERFACE(IAlterIndex);
00146     OBTAIN_INTERFACE(IAlterTable);
00147     OBTAIN_INTERFACE(ITableDefinition);
00148     OBTAIN_INTERFACE(ITableDefinitionWithConstraints);
00149     OBTAIN_INTERFACE(ITransaction);
00150     OBTAIN_INTERFACE(ITransactionLocal);
00151     OBTAIN_INTERFACE(ITransactionObject);
00152     OBTAIN_INTERFACE(ITransactionJoin);
00153
00154     OBTAIN_INTERFACE(IBindResource);
00155     OBTAIN_INTERFACE(ICreateRow);
00156   }
00157
00158   return S_OK;
00159 }
00160
00161
00162 /////////////////////////////////////////////////////////////////
00163 // HRESULT CSession::CreateCommand
00164 //
00165 /////////////////////////////////////////////////////////////////
00166 HRESULT CSession::CreateCommand(CAggregate* pCAggregate, REFIID riid, IUnknown** ppIUnknown)
00167 {
00168   HRESULT       hr = S_OK;
00169
00170   //Obtain the IDBCreateCommand Interface
00171   IDBCreateCommand* pIDBCreateCommand = SOURCE_GETINTERFACE(this, IDBCreateCommand);
00172   if(pIDBCreateCommand)
00173   {
00174     //CreateCommand
00175     XTEST(hr = pIDBCreateCommand->CreateCommand(pCAggregate, riid, ppIUnknown));
00176     TESTC(TRACE_METHOD(hr, L"IDBCreateCommand::CreateCommand(0x%p, %s, &0x%p)", pCAggregate, GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL));
00177
00178     //Handle Aggregation
00179     if(pCAggregate)
00180       TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00181   }
00182
00183 CLEANUP:
00184   return hr;
00185 }
00186
00187
00188 /////////////////////////////////////////////////////////////////
00189 // HRESULT CSession::GetDataSource
00190 //
00191 /////////////////////////////////////////////////////////////////
00192 HRESULT CSession::GetDataSource(REFIID riid, IUnknown** ppIUnknown)
00193 {
00194   HRESULT   hr = S_OK;
00195
00196   //This interface is required to continue...
00197   if(m_pIGetDataSource)
00198   {
00199     //IGetDataSource::GetDataSource
00200     XTEST(hr = m_pIGetDataSource->GetDataSource(riid, ppIUnknown));
00201     TESTC(TRACE_METHOD(hr, L"IGetDataSource::GetDataSource(%s, &0x%p)", GetInterfaceName(riid), ppIUnknown ? *ppIUnknown : NULL));
00202   }
00203
00204 CLEANUP:
00205   return hr;
00206 }
00207
00208
00209
00210 /////////////////////////////////////////////////////////////////
00211 // HRESULT CSession::OpenRowset
00212 //
00213 /////////////////////////////////////////////////////////////////
00214 HRESULT CSession::OpenRowset(CAggregate* pCAggregate, DBID* pTableID, DBID* pIndexID, REFIID riid, ULONG cPropSets, DBPROPSET* rgPropSets, IUnknown** ppIUnknown)
00215 {
00216   HRESULT       hr = E_FAIL;      // HRESULT
00217
00218   if(!m_pIOpenRowset)
00219     return E_FAIL;
00220
00221   WCHAR wszTableName[MAX_QUERY_LEN+1];
00222   WCHAR wszIndexName[MAX_QUERY_LEN+1];
00223
00224   // From IOpenRowset, get a rowset object
00225   DBIDToString(pTableID, wszTableName, MAX_QUERY_LEN);
00226   DBIDToString(pIndexID, wszIndexName, MAX_QUERY_LEN);
00227
00228   XTEST_(hr = m_pIOpenRowset->OpenRowset(
00229               pCAggregate,    // pUnkOuter
00230               pTableID,     // pTableID
00231               pIndexID,     // pIndexID
00232               riid,       // refiid
00233               cPropSets,      // cProperties
00234               rgPropSets,     // rgProperties
00235               ppIUnknown),S_OK);  // IRowset pointer
00236   TRACE_METHOD(hr, L"IOpenRowset::OpenRowset(0x%p, %s, %s, %s, %d, 0x%p, &0x%p)", pCAggregate, wszTableName, wszIndexName, GetInterfaceName(riid), cPropSets, rgPropSets, ppIUnknown ? *ppIUnknown : NULL);
00237
00238   //Display Errors (if occurred)
00239   TESTC(hr = DisplayPropErrors(hr, cPropSets, rgPropSets));
00240
00241   //Handle Aggregation
00242   if(pCAggregate)
00243     TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00244
00245 CLEANUP:
00246   return hr;
00247 }
00248
00249
00250 /////////////////////////////////////////////////////////////////
00251 // HRESULT CSession::GetSchemaRowset
00252 //
00253 /////////////////////////////////////////////////////////////////
00254 HRESULT CSession::GetSchemaRowset(CAggregate* pCAggregate, REFGUID guidSchema, ULONG cRestrictions, VARIANT* rgRestrictions, REFIID riid, ULONG cPropSets, DBPROPSET* rgPropSets, IUnknown** ppIUnknown)
00255 {
00256   HRESULT hr = S_OK;
00257   if(!m_pIDBSchemaRowset)
00258     return E_FAIL;
00259
00260   //Schema Rowset
00261   WCHAR wszBuffer[MAX_NAME_LEN+1];
00262   WCHAR* pwszSchemaName = GetSchemaName(guidSchema);
00263
00264   //Try to find the String Resprentation of the guidSchema
00265   if(pwszSchemaName == NULL)
00266   {
00267     StringFromGUID2(guidSchema, wszBuffer, MAX_NAME_LEN);
00268     pwszSchemaName = wszBuffer;
00269   }
00270
00271   //GetSchema Rowset
00272   XTEST_(hr = m_pIDBSchemaRowset->GetRowset(
00273           pCAggregate,    // punkOuter
00274           guidSchema,     // schema IID
00275           cRestrictions,    // # of restrictions
00276           rgRestrictions,   // array of restrictions
00277           riid,       // rowset interface
00278           cPropSets,      // # of properties
00279           rgPropSets,     // properties
00280           ppIUnknown),S_OK);  // rowset pointer
00281
00282   TRACE_METHOD(hr, L"IDBSchemaRowset::GetRowset(0x%p, %s, %d, 0x%p, %s, %d, 0x%p, &0x%p)", pCAggregate, pwszSchemaName, cRestrictions, rgRestrictions, GetInterfaceName(riid), cPropSets, rgPropSets, ppIUnknown ? *ppIUnknown : NULL);
00283
00284   //Display Errors (if occurred)
00285   TESTC(hr = DisplayPropErrors(hr, cPropSets, rgPropSets));
00286
00287   //Handle Aggregation
00288   if(pCAggregate)
00289     TESTC(hr = pCAggregate->HandleAggregation(riid, ppIUnknown));
00290
00291 CLEANUP:
00292   return hr;
00293 }
00294
00295
00296 ////////////////////////////////////////////////////////////////
00297 // HRESULT CSession::GetProviderTypes
00298 //
00299 ////////////////////////////////////////////////////////////////
00300 HRESULT CSession::GetProviderTypes()
00301 {
00302   HRESULT     hr  = S_OK;
00303
00304   HROW rghRows[MAX_BLOCK_SIZE];
00305   HROW* phRows = rghRows;
00306   DBCOUNTITEM cRowsObtained = 0;
00307   CComPtr<IUnknown> spUnknown;
00308   CRowset cRowset(m_pCMainWindow);
00309   HACCESSOR hAccessor = DB_NULL_HACCESSOR;
00310
00311   //Setup the Bindings
00312   const static DBCOUNTITEM cBindings = 4;
00313   const static DBBINDING rgBindings[cBindings] =
00314     {
00315       1,
00316       offsetof(PROVTYPEINFO, wszTypeName),
00317       0,
00318       0,
00319       NULL,
00320       NULL,
00321       NULL,
00322       DBPART_VALUE,
00323       DBMEMOWNER_CLIENTOWNED,
00324       DBPARAMIO_NOTPARAM,
00325       MAX_NAME_LEN,
00326       0,
00327       DBTYPE_WSTR,
00328       0,
00329       0,
00330
00331       2,
00332       offsetof(PROVTYPEINFO, wType),
00333       0,
00334       0,
00335       NULL,
00336       NULL,
00337       NULL,
00338       DBPART_VALUE,
00339       DBMEMOWNER_CLIENTOWNED,
00340       DBPARAMIO_NOTPARAM,
00341       sizeof(DBTYPE),
00342       0,
00343       DBTYPE_UI2,
00344       0,
00345       0,
00346
00347       3,
00348       offsetof(PROVTYPEINFO, ulColumnSize),
00349       0,
00350       0,
00351       NULL,
00352       NULL,
00353       NULL,
00354       DBPART_VALUE,
00355       DBMEMOWNER_CLIENTOWNED,
00356       DBPARAMIO_NOTPARAM,
00357       sizeof(DBLENGTH), //TODO64: So is this schema going to be updated to allow for more than 4gig size?
00358       0,
00359       DBTYPE_UI4,     //TODO64: Sure would be nice to have defined type that toggels for the OS?
00360       0,
00361       0,
00362
00363       15,
00364       offsetof(PROVTYPEINFO, iMaxScale),
00365       0,
00366       0,
00367       NULL,
00368       NULL,
00369       NULL,
00370       DBPART_VALUE,
00371       DBMEMOWNER_CLIENTOWNED,
00372       DBPARAMIO_NOTPARAM,
00373       sizeof(SHORT),
00374       0,
00375       DBTYPE_I2,
00376       0,
00377       0,
00378     };
00379
00380   //IDBSchemaRowset is optional
00381   //Only need to obtain this info once, so if already done, just exit
00382   if(m_pIDBSchemaRowset == NULL || m_cProvTypes != 0)
00383     goto CLEANUP;
00384
00385   //PROVIDER_TYPES Rowset (is required if Schemas are supported)
00386   TESTC(hr = GetSchemaRowset(NULL, DBSCHEMA_PROVIDER_TYPES, 0, NULL, IID_IUnknown, 0, NULL, &spUnknown));
00387   TESTC(hr = cRowset.CreateObject(this, IID_IUnknown, spUnknown));
00388
00389   //IAccessor::CreateAccessor
00390   TESTC(hr = cRowset.CreateAccessor(DBACCESSOR_ROWDATA, cBindings, (DBBINDING*)rgBindings, 0, &hAccessor));
00391
00392   //Loop through the entire returned rowset
00393   while(TRUE)
00394   {
00395     TESTC(hr = cRowset.GetNextRows(0, MAX_BLOCK_SIZE, &cRowsObtained, &phRows));
00396
00397     //ENDOFROWSET
00398     if(cRowsObtained==0)
00399       break;
00400
00401     //Alloc room for ProviderInfo (in chunks)
00402     SAFE_REALLOC(m_rgProvTypes, PROVTYPEINFO, m_cProvTypes + cRowsObtained);
00403     memset(&m_rgProvTypes[m_cProvTypes], 0, sizeof(PROVTYPEINFO) * (size_t)cRowsObtained);
00404
00405     //Loop over rows obtained and get ProviderInfo
00406     for(ULONG i=0; i<cRowsObtained; i++)
00407     {
00408       //Get the Data
00409       TESTC(hr = cRowset.GetData(rghRows[i], hAccessor, (void*)&m_rgProvTypes[m_cProvTypes]));
00410       m_cProvTypes++;
00411     }
00412
00413     //Release all the rows
00414     TESTC(hr = cRowset.ReleaseRows(cRowsObtained, rghRows));
00415   }
00416
00417 CLEANUP:
00418   cRowset.ReleaseAccessor(&hAccessor);
00419   return hr;
00420 }
00421
00422
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat2/session.h Source File

  • Web
  • NetMeeting
  • NMChat2

session.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       SESSION.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1999-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef _SESSION_H_
00016 #define _SESSION_H_
00017
00018
00019 //****************************************************************************
00020 //
00021 // CLASS CAppletSession
00022 //
00023 //****************************************************************************
00024
00025 class CAppletSession : public CRefCount, public IAppletSessionNotify
00026 {
00027 public:
00028
00029   CAppletSession(CApplet *pApplet, IAppletSession *pISession);
00030   ~CAppletSession(void);
00031
00032   // IUnknown methods
00033   ULONG STDMETHODCALLTYPE AddRef(void);
00034   ULONG STDMETHODCALLTYPE Release(void);
00035   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void * *ppvObj);
00036
00037   // IAppletSessionNotify
00038     HRESULT STDMETHODCALLTYPE JoinSessionConfirm(
00039                     HRESULT            hrResult,
00040                     AppletUserID       uidMyself,
00041                     AppletNodeID       nidMyself,
00042                     AppletSessionID    sidMyself,
00043                     AppletEntityID     eidMyself,
00044                     ULONG              cDynamicChannels,
00045                     AppletChannelID aDynamicChannels[]);
00046
00047     HRESULT STDMETHODCALLTYPE LeaveSessionIndication(
00048                     AppletReason   eReason,
00049                     AppletUserID   uidLeave);
00050
00051     HRESULT STDMETHODCALLTYPE SendDataIndication(
00052                     BOOL               fUniformSend,
00053                     AppletUserID       uidInitiator,
00054                     AppletChannelID    nChannelID,
00055                     AppletPriority     eDataPriority,
00056                     AppletOctetString  Data);
00057
00058     HRESULT STDMETHODCALLTYPE RosterReportIndication(
00059                     ULONG              cRosters,
00060                     AppletRoster **apAppRosters);
00061
00062     HRESULT STDMETHODCALLTYPE InquireRosterConfirm(
00063                     HRESULT            hrResult,
00064                     ULONG              cRosters,
00065                     AppletRoster **apAppRosters);
00066
00067     HRESULT STDMETHODCALLTYPE InvokeAppletConfirm(
00068                     AppletRequestTag   nReqTag,
00069                     HRESULT            hrResult);
00070
00071     HRESULT STDMETHODCALLTYPE RegistryConfirm(
00072                     AppletRegistryCommand      eCommand,
00073                     HRESULT                    hrResult,
00074                     AppletRegistryKey         *pRegistryKey,
00075                     AppletRegistryItem        *pRegistryItem,
00076                     AppletRegistryEntryOwner  *pEntryOwner,
00077                     AppletModificationRights   eRights);
00078
00079     HRESULT STDMETHODCALLTYPE AllocateHandleConfirm(
00080                     HRESULT                hrResult,
00081                     ULONG                  nFirstHandle,
00082                     ULONG                  cHandles);
00083
00084     HRESULT STDMETHODCALLTYPE ChannelConfirm(
00085                     AppletChannelCommand   eCommand,
00086                     HRESULT                hrResult,
00087                     AppletChannelID        nChannelID);
00088
00089     HRESULT STDMETHODCALLTYPE ChannelIndication(
00090                     AppletChannelCommand   eCommand,
00091                     AppletChannelID        nChannelID,
00092                     AppletReason           eReason,
00093                     AppletUserID           uidManager);
00094
00095     HRESULT STDMETHODCALLTYPE TokenConfirm(
00096                     AppletTokenCommand     eCommand,
00097                     HRESULT                hrResult,
00098                     AppletTokenID          nTokenID);
00099
00100     HRESULT STDMETHODCALLTYPE TestTokenConfirm(
00101                     AppletTokenID          nTokenID,
00102                     AppletTokenStatus      eStatus);
00103
00104     HRESULT STDMETHODCALLTYPE TokenIndication(
00105                     AppletTokenCommand     eCommand,
00106                     AppletReason           eReason,
00107                     AppletTokenID          nTokenID,
00108                     AppletUserID           uidInitiator);
00109
00110     AppletConfID    GetConfID(void) { return m_nConfID; }
00111     HRESULT         Join(void) { return m_pISession->Join(&m_JoinSessionReq); }
00112     HRESULT         Leave(void) { ::UiRemoveMember(NULL); return m_pISession->Leave(); }
00113     HRESULT         Advise(void) { return m_pISession->Advise((IAppletSessionNotify *) this, &m_dwCookie); }
00114     HRESULT         UnAdvise(void) { return m_pISession->UnAdvise(m_dwCookie); }
00115     HRESULT         SendData(AppletChannelID, ULONG cbBufSize, BYTE *pBuffer);
00116
00117     void SetMember(INmMember *pIMember);
00118     void RemoveMember(INmMember *);
00119
00120     HRESULT InvokeApplet(void);
00121
00122 private:
00123
00124     void BuildJoinSessionStructure(void);
00125     void SetMember(AppletRecord *);
00126     LPTSTR GetMemberName(AppletUserID uid);
00127
00128 private:
00129
00130     CApplet                *m_pApplet;
00131     IAppletSession         *m_pISession;
00132     DWORD                   m_dwCookie;
00133     AppletConfID            m_nConfID;
00134     AppletUserID            m_uidMyself;
00135     AppletNodeID            m_nidMyself;
00136     AppletSessionID         m_sidMyself;
00137     AppletEntityID          m_eidMyself;
00138     LPSTR                   m_pszMyName;
00139     AppletChannelID         m_nDynamicMulticastChannel;
00140     BOOL                    m_fTopProvider;
00141
00142     ULONG                   m_cMembers;
00143     CMember                *m_apMembers[MAX_MEMBERS];
00144
00145     // space to hold the join session request
00146     AppletSessionRequest    m_JoinSessionReq;
00147     AppletRegistryKey       m_DynChnlRegKey;
00148 };
00149
00150
00151 class CMember
00152 {
00153 public:
00154
00155     CMember(INmMember *);
00156     CMember(AppletRecord *);
00157     ~CMember(void);
00158
00159     void SetMember(INmMember *, BOOL fFirstTime = FALSE);
00160     void SetMember(AppletRecord *, BOOL fFirstTime = FALSE);
00161
00162     BOOL IsSameUID(AppletUserID uid) { return (uid == m_uidMember); }
00163     BOOL IsEmptyUID(void) { return (0 == m_uidMember); }
00164
00165     BOOL IsSameMemberID(AppletNodeID nid) { return (nid == m_nidMember); }
00166     BOOL IsEmptyMember(void) { return (NULL == m_pszMemberName); }
00167
00168     LPTSTR GetName(void) { return m_pszMemberName; }
00169
00170     AppletUserID GetUID(void) { return m_uidMember; }
00171
00172     BOOL IsInRoster(void) { return m_fInRoster; }
00173     void SetInRosterFlag(void) { m_fInRoster = TRUE; }
00174     void ClearInRosterFlag(void) { m_fInRoster = FALSE; }
00175
00176 private:
00177
00178     void Initialize(void);
00179
00180 private:
00181
00182     BOOL            m_fInRoster;
00183     LPTSTR          m_pszMemberName;
00184     AppletNodeID    m_nidMember;
00185     AppletUserID    m_uidMember;
00186     AppletEntityID  m_eidMember;
00187 };
00188
00189
00190
00191 extern CAppletSession *g_pSession;
00192
00193 HRESULT RegisterStandardAppletInvokeInfo(AppletLongString *pKey);
00194 HRESULT RegisterNonStandardAppletInvokeInfo(void);
00195
00196
00197 typedef struct
00198 {
00199     BOOL                fValid;
00200     AppletConfID        nConfID;
00201     AppletNodeID        nidInitiator;
00202 }
00203     INVOKE_INFO;
00204
00205 BOOL GetInvokeInfo(INVOKE_INFO *);
00206
00207 extern INVOKE_INFO g_InvokeInfo;
00208
00209 #endif // _SESSION_H_
00210
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/CommDlg/CDTest/DevNames.h Source File

  • WinUI
  • CommDlg
  • CDTest

DevNames.h

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1993 - 2000 Microsoft Corp.
00004 *       All rights not expressly granted in the SDK license are reserved.
00005 \******************************************************************************/
00006 #define ID_WDRIVEROFF               105
00007 #define ID_WDEVICEOFF               106
00008 #define ID_WOUTPUTOFF               107
00009 #define ID_WDEFAULT                 108
00010 #define ID_DEVNAMESDIALOG           700
00011 #define ID_RESETDEVNAMES            109
Generated on Wed Nov 13 2024 16:52:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TYPEINFO Member List

This is the complete list of members for TYPEINFO, including all inherited members.
fIsAutoInc | TYPEINFO
fIsNullable | TYPEINFO
ulColumnSize | TYPEINFO
wszCreateParams | TYPEINFO
wszTypeName | TYPEINFO
wType | TYPEINFO
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Server/MonitorServer.h Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Server

MonitorServer.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: MonitorServer.h
00004
00005 Summary:  Definition of CMonitorServer Class. Generated by VS6 ATL Wizard.
00006
00007 ----------------------------------------------------------------------------
00008
00009 This file is part of the Microsoft COM+ Samples.
00010
00011 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00012
00013 This source code is intended only as a supplement to Microsoft
00014 Development Tools and/or on-line documentation. See these other
00015 materials for detailed information regarding Microsoft code samples.
00016
00017 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00018 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00019 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00020 PARTICULAR PURPOSE.
00021
00022 ==========================================================================+*/
00023 // MonitorServer.h: Definition of the CMonitorServerClass class
00024 //
00025 //////////////////////////////////////////////////////////////////////
00026
00027 #if !defined(AFX_MONITORSERVER_H__F159BD5F_4DA8_11D2_9672_00AA00B913AC__INCLUDED_)
00028 #define AFX_MONITORSERVER_H__F159BD5F_4DA8_11D2_9672_00AA00B913AC__INCLUDED_
00029
00030 #if _MSC_VER >= 1000
00031 #pragma once
00032 #endif // _MSC_VER >= 1000
00033
00034 #include <stdlib.h>
00035 #include <time.h>
00036 #include "resource.h"       // main symbols
00037
00038 /////////////////////////////////////////////////////////////////////////////
00039 // CMonitorServerClass
00040
00041 class CMonitorServer :
00042   public IMonitorServer,
00043   public CComObjectRoot,
00044   public CComCoClass<CMonitorServer,&CLSID_MonitorServer>
00045 {
00046 public:
00047   CMonitorServer() { srand( (unsigned)time(NULL) );}
00048 BEGIN_COM_MAP(CMonitorServer)
00049   COM_INTERFACE_ENTRY(IMonitorServer)
00050 END_COM_MAP()
00051 DECLARE_NOT_AGGREGATABLE(CMonitorServer)
00052
00053 DECLARE_REGISTRY_RESOURCEID(IDR_MonitorServer)
00054
00055 // IMonitorServer
00056     HRESULT STDMETHODCALLTYPE GetData(
00057       /* [out] */ LONG __RPC_FAR *pData );
00058
00059     HRESULT STDMETHODCALLTYPE GetPingResponder(
00060             /* [out] */ IPingResponder __RPC_FAR *__RPC_FAR *ppPing);
00061
00062 public:
00063 };
00064
00065 #endif // !defined(AFX_MONITORSERVER_H__F159BD5F_4DA8_11D2_9672_00AA00B913AC__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/BPSamp/Utils.c Source File

  • WinBase
  • Debug
  • BPSamp

Utils.c

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------
00002    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004    TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE
00006
00007    Copyright (C) 1999 - 2000. Microsoft Corporation. All rights reserved.
00008
00009    utils.c
00010
00011      Contains utility functions that support management of thread
00012      information for multiple threads of the debuggee, adding and
00013      remove the breakpoints, and displaying the event information.
00014
00015 ----------------------------------------------------------------------------*/
00016 #include <windows.h>
00017 #include <stdio.h>
00018 #include "bpsamp.h"
00019
00020 /*---------------------------------------------------------------------------
00021     code to manage lists of debuggee threads
00022
00023     In order for data watchpoints to work, the CPU context of all
00024     threads in the debuggee process must be set.  Otherwise the debugger
00025     will catch the data writer of only one thread (the one in which
00026     the debug registers of its CPU context was set).  We need to manage
00027     a list of threads as they come and go.
00028
00029     This list management is simplified in an array of up to 100 threads.
00030     For an indeterminate number of threads implement a link list.
00031 ----------------------------------------------------------------------------*/
00032
00033 typedef struct {
00034    DWORD dwThreadID;
00035    HANDLE hThread;
00036 } DBG_THREAD_INFO, *PDBG_THREAD_INFO;
00037
00038 #define MAX_THREADS 100
00039 static DBG_THREAD_INFO dti[MAX_THREADS];
00040
00041 /*---------------------------------------------------------------------------
00042    add_thread(dwThreadID, hHandle)
00043
00044   dwThreadID -- thread ID passed to the debugger of a thread created
00045                 in the debuggee
00046   hHandle --    handle of thread this routine duplicates
00047
00048   TRUE  if the function succeeds
00049   FALSE if number of threads added exceeds max.
00050
00051 ---------------------------------------------------------------------------*/
00052 BOOL add_thread(DWORD dwThreadID, HANDLE hThread)
00053 {
00054    DWORD i;
00055
00056    // find first empty slot
00057    for (i = 0; i<MAX_THREADS; i++)
00058    {
00059       if (dti[i].dwThreadID == 0)
00060       {
00061          dti[i].dwThreadID = dwThreadID;
00062
00063          if (!DuplicateHandle(GetCurrentProcess(),
00064                   hThread,
00065                   GetCurrentProcess(),
00066                   &(dti[i].hThread),
00067                   THREAD_GET_CONTEXT | THREAD_SET_CONTEXT,
00068                   FALSE,
00069                   0))
00070          {
00071             printf("add_thread: DuplicateHandle failed: %d\n",
00072             GetLastError());
00073          }
00074
00075          return TRUE;
00076       }
00077
00078    }
00079
00080    // assume no slot left
00081    printf("WARNING! tried to add more threads than %d thread in list\n",
00082    MAX_THREADS);
00083    return FALSE;
00084 }
00085
00086
00087 /*---------------------------------------------------------------------------
00088    remove_thread
00089
00090   dwThreadID  ID of thread in the list to remove
00091
00092   returns TRUE if successfully removes thread from list
00093   returns FALSE if dwThreadID is not found in list.
00094
00095 ---------------------------------------------------------------------------*/
00096 BOOL remove_thread(DWORD dwThreadID)
00097 {
00098    DWORD i;
00099
00100    // find request thread id
00101    for (i = 0; i<MAX_THREADS; i++)
00102    {
00103       if (dti[i].dwThreadID == dwThreadID)
00104       {
00105          dti[i].dwThreadID = 0;
00106          CloseHandle(dti[i].hThread);
00107          dti[i].hThread = NULL;
00108          return TRUE;
00109       }
00110
00111    }
00112
00113    // assume thread ID not found here
00114    printf("WARNING: request to remove thread %d not found in thread list\n",
00115    dwThreadID);
00116    return FALSE;
00117
00118 }
00119
00120
00121 /*---------------------------------------------------------------------------
00122    display_thread_registers
00123
00124   dwID  ID of thread for which it's CPU context is displayed
00125
00126   returns TRUE if ID found and context is displayed
00127   returns FALSE if ID not found in list or context is not displayed
00128
00129   Displays registers for a given thread ID.
00130 ---------------------------------------------------------------------------*/
00131 BOOL display_thread_registers(DWORD dwID)
00132 {
00133    DWORD i;
00134    CONTEXT context;
00135
00136    // find request thread id
00137    for (i = 0; i<MAX_THREADS; i++)
00138    {
00139       if (dti[i].dwThreadID == dwID)
00140       {
00141          context.ContextFlags = CONTEXT_FULL;
00142          if (!GetThreadContext(dti[i].hThread, &context))
00143          {
00144             printf("GetThreadContext failed: %d\n", GetLastError());
00145             return FALSE;
00146          }
00147
00148
00149          printf("eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\n"
00150                 "eip=%08x esp=%08x ebp=%08x\n",
00151                 context.Eax,
00152                 context.Ebx,
00153                 context.Ecx,
00154                 context.Edx,
00155                 context.Esi,
00156                 context.Edi,
00157                 context.Eip,
00158                 context.Esp,
00159                 context.Ebp);
00160
00161          return TRUE;
00162       }
00163
00164    }
00165
00166    // assume thread ID not found here
00167    printf("WARNING: request to thread registers for %d not found"
00168           "in thread list\n", dwID);
00169    return FALSE;
00170
00171
00172 }
00173
00174 /*---------------------------------------------------------------------------
00175     code to manipulate EIP
00176
00177   This function is required because after hitting a code breakpoint,
00178   in order to continue the EIP must be set back one after restoring
00179   the original opcode.  Otherwise we continue to execute from the middle
00180   of an opcode.
00181 ---------------------------------------------------------------------------*/
00182
00183 void set_thread_eip_back(DWORD dwThreadID)
00184 {
00185    HANDLE hThread = NULL;
00186    int i;
00187    CONTEXT context;
00188
00189    for (i=0; i<MAX_THREADS; i++)
00190    {
00191       if (dti[i].dwThreadID == dwThreadID)
00192       {
00193          hThread = dti[i].hThread;
00194          break;
00195       }
00196    }
00197
00198    if (hThread == NULL)
00199    {
00200       printf("FATAL: cannot find thread %d in thread list to set EIP back\n", dwThreadID);
00201    }
00202
00203    context.ContextFlags = CONTEXT_CONTROL;
00204
00205    GetThreadContext(hThread, &context);
00206    context.Eip--;
00207    SetThreadContext(hThread, &context);
00208
00209
00210 }
00211
00212
00213
00214 /*---------------------------------------------------------------------------
00215     code to set and remove watch point (break on data change)
00216 ----------------------------------------------------------------------------*/
00217
00218
00219 // address of the byte that was replaced with
00220 // an int 3 instruction
00221 DWORD g_dwCodeAddress;
00222 BYTE  bOpCode;            // original opcode in debuggee
00223 const BYTE X86INT3 = 0xcc;
00224
00225
00226 /// this example is hardcoded to set a debug register to watch
00227 /// when memory changes at a certain address
00228 #define DR7SET   0x000d0101   // exact, local, w, 4 bytes
00229 #define DR7CLEAR 0x00000000
00230
00231 /*---------------------------------------------------------------------------
00232    setthread_databreakpoint(hThread, dwAddress)
00233
00234   hThread -- handle of thread for which the debug registers are set
00235   dwAddress -- address of data to watch
00236
00237   This sets the CPU context for the given hThread.  The address specifies
00238   memory in the debuggee process to watch.  The DR7 register is set so
00239   that if any of the 4 bytes at that address is written to, an exception
00240   is sent to this debugger.  For more information about the flags in
00241   the DR7 register please refer to Intel documentation on programming
00242   the CPU.
00243 ---------------------------------------------------------------------------*/
00244 void setthread_databreakpoint(HANDLE hThread, DWORD dwAddress)
00245 {
00246    CONTEXT context;
00247
00248
00249    context.ContextFlags = CONTEXT_DEBUG_REGISTERS;
00250
00251    if (!GetThreadContext(hThread, &context))
00252    {
00253       printf("GetThreadContext failed: %d\n", GetLastError());
00254       return;
00255    }
00256
00257
00258
00259    context.Dr0 = dwAddress;
00260    context.Dr7 = DR7SET;
00261    context.Dr6 = 0;
00262
00263    if (!SetThreadContext(hThread, &context))
00264    {
00265       printf("SetThreadContext failed: %d\n", GetLastError());
00266       return;
00267    }
00268
00269
00270    if (!GetThreadContext(hThread, &context))
00271    {
00272       printf("GetThreadContext failed: %d\n", GetLastError());
00273       return;
00274    }
00275
00276
00277    printf("setthread_databreakpoint set Dr0 = %08X, Dr7 = %08X\n",
00278    context.Dr0, context.Dr7);
00279
00280 }
00281
00282
00283 /*---------------------------------------------------------------------------
00284    clearthread_databreakpoint(hThread)
00285
00286   hThread   handle to thread for which the CPU context is set
00287
00288   This routine clear the DR7 register for the CPU context of the given
00289   thread.
00290 ---------------------------------------------------------------------------*/
00291 void clearthread_databreakpoint(HANDLE hThread)
00292 {
00293    CONTEXT context;
00294
00295
00296    context.ContextFlags = CONTEXT_DEBUG_REGISTERS;
00297
00298    if (!GetThreadContext(hThread, &context))
00299    {
00300       printf("GetThreadContext failed: %d\n", GetLastError());
00301       return;
00302    }
00303
00304
00305
00306    context.Dr0 = 0;
00307    context.Dr7 = DR7CLEAR;
00308
00309    if (!SetThreadContext(hThread, &context))
00310    {
00311       printf("SetThreadContext failed: %d\n", GetLastError());
00312       return;
00313    }
00314
00315
00316    if (!GetThreadContext(hThread, &context))
00317    {
00318       printf("GetThreadContext failed: %d\n", GetLastError());
00319       return;
00320    }
00321
00322
00323    printf("clearthread_databreakpoint -- Dr0 = %08X, Dr7 = %08X\n",
00324    context.Dr0, context.Dr7);
00325
00326 }
00327
00328
00329
00330
00331 /*---------------------------------------------------------------------------
00332    set_databreakpoint(dwAddress)
00333
00334   dwAddress  Address of data to watch
00335
00336   return TRUE
00337
00338   This routine will call the supporting routine to set the CPU context for
00339   all threads in the debuggee process. In this case for setting the DR0 and
00340   DR7 registers to watch for data writing from any thread.
00341 ---------------------------------------------------------------------------*/
00342 BOOL set_databreakpoint(DWORD dwAddress)
00343 {
00344    DWORD i;
00345
00346    // need to iterate through each thread ID
00347    // and set the thread context to set the debug
00348    // threads
00349    for (i=0; i<MAX_THREADS; i++)
00350    {
00351       if (dti[i].dwThreadID)
00352       {
00353          setthread_databreakpoint(dti[i].hThread, dwAddress);
00354       }
00355
00356    }
00357
00358    return TRUE;
00359 }
00360
00361
00362 /*---------------------------------------------------------------------------
00363    clear_databreakpoint
00364
00365   returns TRUE
00366
00367   This routine will call the supporting routine to set the CPU context for
00368   all threads in the debuggee process.  In this case for clearing the DR0
00369   and DR7 debug registers.
00370 ---------------------------------------------------------------------------*/
00371 BOOL clear_databreakpoint(void)
00372 {
00373    DWORD i;
00374
00375    // need to iterate through each thread ID
00376    // and set the thread context to set the debug
00377    // threads
00378    for (i=0; i<MAX_THREADS; i++)
00379    {
00380       if (dti[i].dwThreadID)
00381       {
00382          clearthread_databreakpoint(dti[i].hThread);
00383       }
00384
00385    }
00386
00387
00388    return TRUE;
00389 }
00390
00391
00392 /*---------------------------------------------------------------------------
00393     code to set and remove code breakpoints
00394 ----------------------------------------------------------------------------*/
00395
00396
00397
00398 /*---------------------------------------------------------------------------
00399    set_codebreakpoint
00400
00401   dwAddress   address in debuggee process of where to write int 3 opcode
00402
00403   returns TRUE if opcode written to address
00404   returns FALSE if opcode failed to be written to address
00405
00406   This reads the debuggee process memory to get the original opcode to
00407   restore it when clearing the breakpoint.  Also, in a "real debugger" you
00408   would restore the opcode or use the opcode when disassembly.  The
00409   disassembler should not show int 3 where the bp is at.
00410
00411   To put the breakpoint in the code this routine writes 0xCC (opcode for
00412   int 3 instruction).
00413 ---------------------------------------------------------------------------*/
00414 BOOL set_codebreakpoint(DWORD dwAddress)
00415 {
00416    DWORD cbBytes;
00417
00418    // read the original opcode of where we want to set an int 3 instruction
00419    if (!ReadProcessMemory(g_hProcDebuggee,
00420                          (LPCVOID)dwAddress,
00421                          (LPVOID)&bOpCode, 1, &cbBytes))
00422    {
00423       printf("ReadProcessMemory failed: %d\n", GetLastError());
00424       return FALSE;
00425    }
00426
00427    if (!WriteProcessMemory(g_hProcDebuggee,
00428                           (LPVOID)dwAddress,
00429                           (LPVOID)&X86INT3, 1, &cbBytes))
00430    {
00431       printf("ReadProcessMemory failed: %d\n", GetLastError());
00432       return FALSE;
00433    }
00434
00435    g_dwCodeAddress = dwAddress;
00436    printf("Breakpoint set at %08X\n", g_dwCodeAddress);
00437    return TRUE;
00438 }
00439
00440
00441 /*--------------------------------------------------------------------------
00442    clear_codebreakpoint
00443
00444
00445   returns TRUE  if function succees
00446   returns FALSE if failure to write to the process memory
00447                 if a code breakpoint was not previously set
00448
00449   This function restores the original opcode to the debuggee process.
00450 ---------------------------------------------------------------------------*/
00451 BOOL clear_codebreakpoint(void)
00452 {
00453    DWORD cbBytes;
00454
00455    if (g_dwCodeAddress == 0)
00456    {
00457       printf("no code breakpoint to clear\n");
00458       return FALSE;
00459    }
00460
00461    if (!WriteProcessMemory(g_hProcDebuggee,
00462                           (LPVOID)g_dwCodeAddress,
00463                           (LPVOID)&bOpCode, 1, &cbBytes))
00464    {
00465       printf("ReadProcessMemory failed: %d\n", GetLastError());
00466       return FALSE;
00467    }
00468
00469    g_dwCodeAddress = 0;
00470
00471    return TRUE;
00472
00473 }
00474
00475
00476
00477 /*---------------------------------------------------------------------------
00478     code that dumps debug events to stdout
00479 ----------------------------------------------------------------------------*/
00480
00481 /*---------------------------------------------------------------------------
00482    dump_debug_event_info(de)
00483
00484   de   pointer to DEBUG_EVENT structure
00485
00486   This function displays what debug event the debugger receives.
00487 ---------------------------------------------------------------------------*/
00488 void dump_debug_event_info(DEBUG_EVENT *de)
00489 {
00490
00491    switch(de->dwDebugEventCode)
00492    {
00493       case EXCEPTION_DEBUG_EVENT:
00494          printf("%d: EXCEPTION_DEBUG_EVENT\n", de->dwThreadId);
00495
00496          switch (de->u.Exception.ExceptionRecord.ExceptionCode)
00497          {
00498             case EXCEPTION_ACCESS_VIOLATION:
00499                printf("\tEXCEPTION_ACCESS_VIOLATION\n");
00500             break;
00501
00502             case EXCEPTION_DATATYPE_MISALIGNMENT:
00503                printf("\tEXCEPTION_DATATYPE_MISALIGNMENT\n");
00504             break;
00505
00506             case EXCEPTION_BREAKPOINT:
00507                printf("\tEXCEPTION_BREAKPOINT\n");
00508             break;
00509
00510             case EXCEPTION_SINGLE_STEP:
00511                printf("\tEXCEPTION_SINGLE_STEP\n");
00512             break;
00513
00514             case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
00515                printf("\tEXCEPTION_ARRAY_BOUNDS_EXCEEDED\n");
00516             break;
00517
00518             case EXCEPTION_FLT_DENORMAL_OPERAND:
00519                printf("\tEXCEPTION_FLT_DENORMAL_OPERAND\n");
00520             break;
00521
00522             case EXCEPTION_FLT_DIVIDE_BY_ZERO:
00523                printf("\tEXCEPTION_FLT_DIVIDE_BY_ZERO\n");
00524             break;
00525
00526             case EXCEPTION_FLT_INEXACT_RESULT:
00527                printf("\tEXCEPTION_FLT_INEXACT_RESULT\n");
00528             break;
00529
00530             case EXCEPTION_FLT_INVALID_OPERATION:
00531                printf("\tEXCEPTION_FLT_INVALID_OPERATION\n");
00532             break;
00533
00534             case EXCEPTION_FLT_OVERFLOW:
00535                printf("\tEXCEPTION_FLT_OVERFLOW\n");
00536             break;
00537
00538             case EXCEPTION_FLT_STACK_CHECK:
00539                printf("\tEXCEPTION_FLT_STACK_CHECK\n");
00540             break;
00541
00542             case EXCEPTION_FLT_UNDERFLOW:
00543                printf("\tEXCEPTION_FLT_UNDERFLOW\n");
00544             break;
00545
00546             case EXCEPTION_INT_DIVIDE_BY_ZERO:
00547                printf("\tEXCEPTION_INT_DIVIDE_BY_ZERO\n");
00548             break;
00549
00550             case EXCEPTION_INT_OVERFLOW:
00551                printf("\tEXCEPTION_INT_OVERFLOW\n");
00552             break;
00553
00554             case EXCEPTION_PRIV_INSTRUCTION:
00555                printf("\tEXCEPTION_PRIV_INSTRUCTION\n");
00556             break;
00557
00558             case EXCEPTION_IN_PAGE_ERROR:
00559                printf("\tEXCEPTION_IN_PAGE_ERROR\n");
00560             break;
00561
00562             case EXCEPTION_ILLEGAL_INSTRUCTION:
00563                printf("\tEXCEPTION_ILLEGAL_INSTRUCTION\n");
00564             break;
00565
00566             case EXCEPTION_NONCONTINUABLE_EXCEPTION:
00567                printf("\tEXCEPTION_NONCONTINUABLE_EXCEPTION\n");
00568             break;
00569
00570             case EXCEPTION_STACK_OVERFLOW:
00571                printf("\tEXCEPTION_STACK_OVERFLOW\n");
00572             break;
00573
00574             case EXCEPTION_INVALID_DISPOSITION:
00575                printf("\tEXCEPTION_INVALID_DISPOSITION\n");
00576             break;
00577
00578             case EXCEPTION_GUARD_PAGE:
00579                printf("\tEXCEPTION_GUARD_PAGE\n");
00580             break;
00581
00582             case EXCEPTION_INVALID_HANDLE:
00583                printf("\tEXCEPTION_INVALID_HANDLE\n");
00584             break;
00585
00586             case CONTROL_C_EXIT:
00587                printf("\tCONTROL_C_EXIT\n");
00588             break;
00589
00590             case DBG_CONTROL_C:
00591                printf("\tDBG_CONTROL_C\n");
00592             break;
00593
00594             case DBG_CONTROL_BREAK:
00595                printf("\tDBG_CONTROL_BREAK\n");
00596             break;
00597
00598             default:
00599                printf("\tUnknown exception raised: %08X\n",
00600                de->u.Exception.ExceptionRecord.ExceptionCode);
00601             break;
00602          }
00603
00604       break;
00605
00606       case CREATE_THREAD_DEBUG_EVENT:
00607          printf("%d: CREATE_THREAD_DEBUG_EVENT.\n", de->dwThreadId);
00608       break;
00609
00610       case CREATE_PROCESS_DEBUG_EVENT:
00611          printf("%d: CREATE_PROCESS_DEBUG_EVENT\n", de->dwThreadId);
00612       break;
00613
00614       case EXIT_THREAD_DEBUG_EVENT:
00615          printf("%d: EXIT_THREAD_DEBUG_EVENT\n", de->dwThreadId);
00616       break;
00617
00618       case EXIT_PROCESS_DEBUG_EVENT:
00619          printf("%d: EXIT_PROCESS_DEBUG_EVENT\n", de->dwThreadId);
00620       break;
00621
00622       case LOAD_DLL_DEBUG_EVENT:
00623          printf("%d: LOAD_DLL_DEBUG_EVENT\n", de->dwThreadId);
00624       break;
00625
00626       case UNLOAD_DLL_DEBUG_EVENT:
00627          printf("%d: UNLOAD_DLL_DEBUG_EVENT\n", de->dwThreadId);
00628       break;
00629
00630       case OUTPUT_DEBUG_STRING_EVENT:
00631          printf("%d: OUTPUT_DEBUG_STRING_EVENT\n", de->dwThreadId);
00632       break;
00633
00634       case RIP_EVENT:
00635          printf("%d: RIP_EVENT\n", de->dwThreadId);
00636       break;
00637
00638       default:  // we should never get here
00639          printf("%d: de.dwDebugEventCode default case %08X\n",
00640          de->dwThreadId, de->dwDebugEventCode);
00641       break;
00642    }
00643
00644 }
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpSvr/icf.h Source File

  • Com
  • Fundamentals
  • SimpSvr

icf.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: icf.h
00003 //
00004 //      Definition of CClassFactory
00005 //
00006 // Copyright 1993 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008
00009 #if !defined( _ICF_H_)
00010 #define _ICF_H_
00011
00012 class CSimpSvrApp;
00013
00014 interface CClassFactory :  IClassFactory
00015 {
00016 private:
00017   int m_nCount;               // reference count
00018   CSimpSvrApp FAR * m_lpApp;
00019
00020 public:
00021   CClassFactory::CClassFactory(CSimpSvrApp FAR * lpApp)
00022     {
00023     OutputDebugString("In CClassFactory's Constructor\r\n");
00024     m_lpApp = lpApp;
00025     m_nCount = 0;
00026     };
00027   CClassFactory::~CClassFactory()
00028      {
00029      OutputDebugString("In CClassFactory's Destructor\r\n");
00030      };
00031
00032   // IUnknown Methods
00033
00034   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppvObj);
00035   STDMETHODIMP_(ULONG) AddRef ();
00036   STDMETHODIMP_(ULONG) Release ();
00037
00038   STDMETHODIMP CreateInstance (LPUNKNOWN pUnkOuter,
00039                 REFIID riid,
00040                 LPVOID FAR* ppvObject);
00041   STDMETHODIMP LockServer ( BOOL fLock);
00042
00043 };
00044
00045 #endif
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/prsample/session.cpp Source File

  • Dataaccess
  • oledb
  • prsample

session.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 // Microsoft OLE DB Programmer's Reference Sample
00003 // Copyright (C) 1998 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module SESSION.CPP
00008 //
00009 //---------------------------------------------------------------------------
00010
00011
00012 /////////////////////////////////////////////////////////////////
00013 // Includes
00014 //
00015 /////////////////////////////////////////////////////////////////
00016 #include "prsample.h"   // Programmer's Reference Sample includes
00017
00018
00019
00020 /////////////////////////////////////////////////////////////////
00021 // myCreateSession
00022 //
00023 //  Create an OLE DB Session object from the given DataSource
00024 //  object. The IDBCreateSession interface is mandatory, so this
00025 //  is a simple operation.
00026 //
00027 /////////////////////////////////////////////////////////////////
00028 HRESULT myCreateSession
00029   (
00030   IUnknown *        pUnkDataSource,
00031   IUnknown **       ppUnkSession
00032   )
00033 {
00034   HRESULT         hr;
00035   IDBCreateSession *    pIDBCreateSession   = NULL;
00036
00037   //Create a Session Object from a Data Source Object
00038   XCHECK_HR(hr = pUnkDataSource->QueryInterface(
00039         IID_IDBCreateSession, (void**)&pIDBCreateSession));
00040   XCHECK_HR(hr = pIDBCreateSession->CreateSession(
00041         NULL,       //pUnkOuter
00042         IID_IOpenRowset,  //riid
00043         ppUnkSession    //ppSession
00044         ));
00045
00046 CLEANUP:
00047   if( pIDBCreateSession )
00048     pIDBCreateSession->Release();
00049   return hr;
00050 }
00051
00052
00053 /////////////////////////////////////////////////////////////////
00054 // myCreateSchemaRowset
00055 //
00056 //  If the provider supports IDBSchemaRowset, this function will
00057 //  obtain the tables schema rowset, will display this rowset to
00058 //  the user, and will allow the user to select a row in the
00059 //  rowset containing the name of a table of interest.
00060 //
00061 /////////////////////////////////////////////////////////////////
00062 HRESULT myCreateSchemaRowset
00063   (
00064   GUID          guidSchema,
00065   IUnknown *        pUnkSession,
00066   ULONG         cchBuffer,
00067   LPWSTR          pwszBuffer
00068   )
00069 {
00070   HRESULT         hr              = S_OK;
00071   IDBSchemaRowset *   pIDBSchemaRowset      = NULL;
00072   IUnknown *        pUnkRowset          = NULL;
00073
00074   const ULONG       cProperties         = 2;
00075   DBPROP          rgProperties[cProperties];
00076   DBPROPSET       rgPropSets[1];
00077
00078   // Attempt to obtain the IDBSchemaRowset interface on the Session object.
00079   // This is not a mandatory interface; if it is not supported, we are done
00080   CHECK_HR(pUnkSession->QueryInterface(
00081           IID_IDBSchemaRowset, (void**)&pIDBSchemaRowset));
00082
00083   // Set properties on the rowset, to request additional functionality
00084   myAddRowsetProperties(rgPropSets, cProperties, rgProperties);
00085
00086   // Get the requested schema rowset; if IDBSchemaRowset is supported,
00087   // the following schema rowsets are required to be supported:
00088   //  DBSCHEMA_TABLES, DBSCHEMA_COLUMNS, and DBSCHEMA_PROVIDERTYPES
00089   // We know that we will be asking for one of these, so it is not
00090   // necessary to call IDBSchemaRowset::GetSchemas in this case
00091   XCHECK_HR(hr = pIDBSchemaRowset->GetRowset(
00092         NULL,     //pUnkOuter
00093         guidSchema,   //guidSchema
00094         0,        //cRestrictions
00095         NULL,     //rgRestrictions
00096         IID_IRowset,  //riid
00097         1,        //cPropSets
00098         rgPropSets,   //rgPropSets
00099         &pUnkRowset   //ppRowset
00100         ));
00101
00102   // Display the rowset to the user; this will allow the user to
00103   // perform basic navigation of the rowset and will allow the user
00104   // to select a row containing a desired table name (taken from the
00105   // TABLE_NAME column)
00106   CHECK_HR(hr = myDisplayRowset(pUnkRowset,
00107     L"TABLE_NAME", cchBuffer, pwszBuffer));
00108
00109 CLEANUP:
00110   if( pIDBSchemaRowset )
00111     pIDBSchemaRowset->Release();
00112   if( pUnkRowset )
00113     pUnkRowset->Release();
00114   return hr;
00115 }
00116
00117
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::AffectEnum Member List

This is the complete list of members for msado15::AffectEnum, including all inherited members.
adAffectAll | msado15::AffectEnum | [static]
adAffectAllChapters | msado15::AffectEnum | [static]
adAffectCurrent | msado15::AffectEnum | [static]
adAffectGroup | msado15::AffectEnum | [static]
Generated on Wed Nov 13 2024 16:58:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/simple/globals.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • simple

globals.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _MMC_GLOBALS_H
00015 #define _MMC_GLOBALS_H
00016
00017 #include <Tchar.h>
00018 #include <Mmc.h>
00019 #include <CrtDbg.h>
00020
00021
00022 #pragma warning(4:4267)   // convertion from size_t to smaller type
00023 #pragma warning(4:4244)   // sizeof returns to INT
00024
00025 extern HINSTANCE g_hInst;              // Global instance handle
00026 extern ULONG     g_uObjectCount;       // Instance count for this object
00027 extern ULONG     g_uServerLocks;       // Server lock count for this object
00028
00029 //---------------------------------------------------------------------------
00030 // Clipformats requiered by MMC
00031
00032 extern UINT g_cfDisplayName;      // DisplayName for our SnapIn node
00033 extern UINT g_cfNodeType;         // GUID of the selected node
00034 extern UINT g_cfSnapinClsid;      // Class ID of this SnapIn
00035 extern UINT g_cfszNodeType;       // String version of namespace GUID
00036
00037
00038 //---------------------------------------------------------------------------
00039 //
00040 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide );
00041
00042 void InitClipboardFormats();
00043
00044 //---------------------------------------------------------------------------
00045 //  Global Strings
00046
00047 // These strings are Unicode or Ansi depending on the target platform
00048 //
00049 static TCHAR*  gtszSNAPIN_NAME       = _T("Sample A (MMC 2.0) - Simple");
00050
00051
00052 // These strings are used by the console, so they're Unicode on all platforms
00053 //
00054 static WCHAR*  gwszROOT_NODE_NAME    = L"Simple Root Node";
00055
00056
00057 // We need to do this to get around MMC.IDL - it explicitly defines
00058 // the clipboard formats as WCHAR types...
00059 #define T_CCF_DISPLAY_NAME    _T("CCF_DISPLAY_NAME")
00060 #define T_CCF_NODETYPE        _T("CCF_NODETYPE")
00061 #define T_CCF_SZNODETYPE      _T("CCF_SZNODETYPE")
00062 #define T_CCF_SNAPIN_CLASSID  _T("CCF_SNAPIN_CLASSID")
00063
00064
00065
00066
00067 //---------------------------------------------------------------------------
00068 // Constants
00069
00070 #define NODETYPE_STATIC      100;
00071
00072
00073 /////////////////////////////////////////////////////////////////////////////
00074 // Helper classes and macros
00075
00076 #define BYTE_SIZE(string)          ((_tcslen(string)+1) * sizeof(TCHAR))
00077
00078 #define BREAK_ON_ERROR( hResult )  if( S_OK != hResult ) continue
00079
00080
00081 //---------------------------------------------------------------------------
00082 template<class TYPE>
00083 inline void SAFE_RELEASE( TYPE*& pObj )
00084 {
00085   if( NULL != pObj )
00086   {
00087     pObj->Release();
00088     pObj = NULL;
00089   }
00090   else
00091   {
00092     OutputDebugString(_T("Attempted to release NULL Com pointer.\n"));
00093   }
00094 } // end SAFE_RELEASE()
00095
00096
00097
00098 //---------------------------------------------------------------------------
00099 //  W2T converts a wide character string to unicode if _UNICODE is not
00100 //  defined.  If it is defined then the sting is copied to another buffer.
00101 //
00102 #ifndef _UNICODE
00103 #define W2T( pszAnsi, szWide )   Unicode2Ansi( pszAnsi, szWide )
00104 #else
00105 #define W2T( szAnsiPtr, szWide )                                              \
00106         *szAnsiPtr = (WCHAR*)CoTaskMemAlloc(BYTE_SIZE(szWide)+sizeof(TCHAR)); \
00107         CopyMemory( *szAnsiPtr, szWide, BYTE_SIZE(szWide)+sizeof(TCHAR) )
00108 #endif
00109
00110
00111 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/sendto/sendto.c Source File

  • WinUI
  • sendto

sendto.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  *  SendTo.c
00004  *
00005  *  Copyright (c) 1997 Microsoft Corporation.  All rights reserved.
00006  *
00007  *       This source code is only intended as a supplement to
00008  *       Microsoft Development Tools, q.v. for detailed
00009  *       information regarding the Microsoft samples programs.
00010  *
00011  *  Abstract:
00012  *
00013  *      Sample program to demonstrate how a program can display a
00014  *      "Send To" menu and send documents to items thereon.
00015  *
00016  *****************************************************************************/
00017
00018 #include "SendTo.h"
00019
00020 /*****************************************************************************
00021  *
00022  *      Overview
00023  *
00024  *      This sample program illustrates the following points:
00025  *
00026  *      -   Enumerating the contents of the "Send To" folder.
00027  *
00028  *      -   Obtaining the IDataObject interface for a file.
00029  *
00030  *      -   Obtaining the IDropTarget for a shell extension.
00031  *
00032  *      -   Dropping a file onto an item thus enumerated.
00033  *
00034  *****************************************************************************/
00035
00036 /*****************************************************************************
00037  *
00038  *      Notes
00039  *
00040  *      Since this program is written in C, invoking OLE methods is
00041  *      done via
00042  *
00043  *          p->lpVtbl->MethodName(p, arg, arg)
00044  *
00045  *      To convert this program to C++, the code that invokes OLE
00046  *      methods should be changed to
00047  *
00048  *          p->MethodName(arg, arg)
00049  *
00050  *      just like any other C++ method.
00051  *
00052  *      For example,
00053  *
00054  *         g_pMalloc->lpVtbl->Free(g_pMalloc, pv);
00055  *
00056  *      becomes
00057  *
00058  *          g_pMalloc->Free(pv);
00059  *
00060  *      and
00061  *
00062  *          peidl->lpVtbl->Release(peidl);
00063  *
00064  *      becomes
00065  *
00066  *          peidl->Release();
00067  *
00068  *      Also, REFIID parameters in C are passed as
00069  *
00070  *          &IID_IName
00071  *
00072  *      but they are passed in C++ as
00073  *
00074  *          IID_IName
00075  *
00076  *      Therefore,
00077  *
00078  *          hres = g_psfDesktop->lpVtbl->BindToObject(g_psfDesktop,
00079  *                      pidl, NULL, &IID_IShellFolder, (LPVOID *)&psf);
00080  *
00081  *      becomes
00082  *
00083  *          hres = g_psfDesktop->BindToObject(
00084  *                      pidl, NULL, IID_IShellFolder, (LPVOID *)&psf);
00085  *
00086  *****************************************************************************/
00087
00088 HINSTANCE   g_hinst;                /* My hinstance */
00089 LPMALLOC    g_pMalloc;              /* The OLE task allocator */
00090 LPSHELLFOLDER g_psfDesktop;         /* The desktop folder */
00091 HMENU       g_hmenuSendTo;          /* Our SendTo popup */
00092 char        g_szFileName[MAX_PATH]; /* The name of the "open" file */
00093
00094 /*****************************************************************************
00095  *
00096  *  Our SendTo menu occupies the IDs IDM_SENDTOFIRST through IDM_SENDTOLAST.
00097  *  The text of the menu item is the name of the target, and the reference
00098  *  data points to the corresponding PIDL relative to the SENDTO folder.
00099  *
00100  *****************************************************************************/
00101
00102 /*****************************************************************************
00103  *
00104  *  ShellFree
00105  *
00106  *      Free some memory via the shell task allocator.
00107  *
00108  *****************************************************************************/
00109
00110 void
00111 ShellFree(LPVOID pv)
00112 {
00113     g_pMalloc->lpVtbl->Free(g_pMalloc, pv);
00114 }
00115
00116 /*****************************************************************************
00117  *
00118  *  StrRetToStr
00119  *
00120  *      Take a STRRET structure and put the result into the cStr field.
00121  *
00122  *****************************************************************************/
00123
00124 void
00125 StrRetToStr(LPSTRRET pstr, LPITEMIDLIST pidl)
00126 {
00127     LPWSTR pOleStr;
00128
00129     switch (pstr->uType) {
00130
00131     case STRRET_WSTR:
00132         /*
00133          *      The pOleStr points to a WCHAR string that we convert
00134          *      to ANSI.  We need to stash pstr->pOleStr into a safe
00135          *      place, because pstr->cStr lives in the same place.
00136          */
00137         pOleStr = pstr->pOleStr;
00138         WideCharToMultiByte(CP_ACP, 0, pOleStr, -1,
00139                             pstr->cStr, MAX_PATH, NULL, NULL);
00140         ShellFree(pOleStr);
00141         break;
00142
00143     case STRRET_OFFSET:
00144         /*
00145          *      The string lives inside the pidl, so copy it out.
00146          */
00147         lstrcpyn(pstr->cStr, (LPSTR)((LPBYTE)pidl + pstr->uOffset), MAX_PATH);
00148         break;
00149
00150     case STRRET_CSTR:
00151         /*
00152          *      The string already is in the right place.
00153          */
00154         break;
00155     }
00156 }
00157
00158 /*****************************************************************************
00159  *
00160  *  GetSpecialFolder
00161  *
00162  *      Create an LPSHELLFOLDER for the specified special folder.
00163  *
00164  *      It is the responsibility of the caller to Release() the
00165  *      IShellFolder that is returned.
00166  *
00167  *****************************************************************************/
00168
00169 LPSHELLFOLDER
00170 GetSpecialFolder(HWND hwnd, int idFolder)
00171 {
00172     HRESULT hres;
00173     LPSHELLFOLDER psf;
00174     LPITEMIDLIST pidl;
00175
00176     hres = SHGetSpecialFolderLocation(hwnd, CSIDL_SENDTO, &pidl);
00177     if (SUCCEEDED(hres)) {
00178         hres = g_psfDesktop->lpVtbl->BindToObject(g_psfDesktop,
00179                     pidl, NULL, &IID_IShellFolder, (LPVOID *)&psf);
00180         if (SUCCEEDED(hres)) {
00181             /* Woo-hoo, we're done */
00182         } else {
00183             psf = NULL;
00184         }
00185         ShellFree(pidl);
00186     } else {
00187         psf = NULL;
00188     }
00189     return psf;
00190 }
00191
00192 /*****************************************************************************
00193  *
00194  *  PidlFromPath
00195  *
00196  *      Convert a path to an LPITEMIDLIST.
00197  *
00198  *****************************************************************************/
00199
00200 LPITEMIDLIST
00201 PidlFromPath(HWND hwnd, LPCSTR pszPath)
00202 {
00203     LPITEMIDLIST pidl;
00204     ULONG ulEaten;
00205     DWORD dwAttributes;
00206     HRESULT hres;
00207     WCHAR wszName[MAX_PATH];
00208
00209     if (!MultiByteToWideChar(CP_ACP, 0, pszPath, -1, wszName, MAX_PATH)) {
00210         return NULL;
00211     }
00212
00213     hres = g_psfDesktop->lpVtbl->ParseDisplayName(g_psfDesktop, hwnd,
00214                          NULL, wszName, &ulEaten, &pidl, &dwAttributes);
00215     if (FAILED(hres)) {
00216         return NULL;
00217     }
00218
00219     return pidl;
00220 }
00221
00222 /*****************************************************************************
00223  *
00224  *  StepOverPidl
00225  *
00226  *      Given a pidl, step over the current item, returning the next item.
00227  *
00228  *****************************************************************************/
00229
00230 LPITEMIDLIST
00231 StepOverPidl(LPITEMIDLIST pidl)
00232 {
00233     return (LPITEMIDLIST)((BYTE*)pidl + pidl->mkid.cb);
00234 }
00235
00236 /*****************************************************************************
00237  *
00238  *  GetUIObjectOfAbsPidl
00239  *
00240  *      Given an absolute (desktop-relative) LPITEMIDLIST, get the
00241  *      specified UI object.
00242  *
00243  *****************************************************************************/
00244
00245 HRESULT
00246 GetUIObjectOfAbsPidl(HWND hwnd, LPITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
00247 {
00248     /*
00249      *  To get the UI object of an absolute pidl, we must first bind
00250      *  to its parent, and then call GetUIObjectOf on the last part.
00251      */
00252
00253     LPITEMIDLIST pidlLast, pidlNext;
00254     USHORT cb;
00255     LPSHELLFOLDER psf;
00256     HRESULT hres;
00257
00258     /*
00259      *  Just for safety's sake.
00260      */
00261     *ppvOut = NULL;
00262
00263     /*
00264      *  Walk the incoming pidl to split it into the parent part
00265      *  and the last part.  (This is the Shell Namespace version
00266      *  of walking a path to split it into a directory part and
00267      *  a filename part.)
00268      */
00269
00270     for (pidlLast = pidl; pidlNext = StepOverPidl(pidlLast),
00271                           pidlNext->mkid.cb; pidlLast = pidlNext) {
00272         /* Keep walking */
00273     }
00274
00275     /*
00276      *  Now temporarily split the pidl at the point we found.
00277      *  Save the value we smash so we can restore it.
00278      */
00279     cb = pidlLast->mkid.cb;
00280     pidlLast->mkid.cb = 0;
00281
00282     /*
00283      *  Bind to the folder part.  Note that if pidlLast == pidl, then
00284      *  this means that there is no folder part; the item is a direct
00285      *  child of the desktop.  (Note that we need to AddRef to balance
00286      *  the Release we do afterwards.)
00287      */
00288     if (pidl == pidlLast) {
00289         psf = g_psfDesktop;
00290         g_psfDesktop->lpVtbl->AddRef(g_psfDesktop);
00291         hres = S_OK;
00292     } else {
00293         hres = g_psfDesktop->lpVtbl->BindToObject(g_psfDesktop, pidl,
00294                         NULL, &IID_IShellFolder, (LPVOID *)&psf);
00295     }
00296
00297     /*
00298      *  Before we forget, restore the pidl we temporarily edited.
00299      */
00300     pidlLast->mkid.cb = cb;
00301
00302     if (FAILED(hres)) {
00303         /*
00304          *  Couldn't even get to the parent; we have no chance of
00305          *  getting to the item itself.
00306          */
00307         return hres;
00308     }
00309
00310     /*
00311      *  Now ask the parent for the the UI object of the child.
00312      */
00313     hres = psf->lpVtbl->GetUIObjectOf(psf, hwnd, 1, &pidlLast,
00314                                 riid, NULL, ppvOut);
00315
00316     /*
00317      *  Regardless of whether or not the GetUIObjectOf succeeded,
00318      *  we have no further use for the parent folder.
00319      */
00320     psf->lpVtbl->Release(psf);
00321
00322     return hres;
00323 }
00324
00325 /*****************************************************************************
00326  *
00327  *  GetUIObjectOfPath
00328  *
00329  *      Given an absolute path, get its specified UI object.
00330  *
00331  *****************************************************************************/
00332
00333 HRESULT
00334 GetUIObjectOfPath(HWND hwnd, LPCSTR pszPath, REFIID riid, LPVOID *ppvOut)
00335 {
00336     LPITEMIDLIST pidl;
00337     HRESULT hres;
00338
00339     /*
00340      *  Just for safety's sake.
00341      */
00342     *ppvOut = NULL;
00343
00344     pidl = PidlFromPath(hwnd, pszPath);
00345     if (!pidl) {
00346         return E_FAIL;
00347     }
00348
00349     hres = GetUIObjectOfAbsPidl(hwnd, pidl, riid, ppvOut);
00350
00351     ShellFree(pidl);
00352
00353     return hres;
00354 }
00355
00356 /*****************************************************************************
00357  *
00358  *  DoDrop
00359  *
00360  *      Drop a data object on a drop target.
00361  *
00362  *****************************************************************************/
00363
00364 void
00365 DoDrop(LPDATAOBJECT pdto, LPDROPTARGET pdt)
00366 {
00367     POINTL pt = { 0, 0 };
00368     DWORD dwEffect;
00369     HRESULT hres;
00370
00371     /*
00372      *  The data object enters the drop target via the left button
00373      *  with all drop effects permitted.
00374      */
00375     dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE | DROPEFFECT_LINK;
00376     hres = pdt->lpVtbl->DragEnter(pdt, pdto, MK_LBUTTON, pt, &dwEffect);
00377     if (SUCCEEDED(hres) && dwEffect) {
00378         /*
00379          *  The drop target likes the data object and the effect.
00380          *  Go drop it.
00381          */
00382         hres = pdt->lpVtbl->Drop(pdt, pdto, MK_LBUTTON, pt, &dwEffect);
00383
00384     } else {
00385         /*
00386          *  The drop target didn't like us.  Tell it we're leaving,
00387          *  sorry to bother you.
00388          */
00389         hres = pdt->lpVtbl->DragLeave(pdt);
00390     }
00391 }
00392
00393 /*****************************************************************************
00394  *
00395  *  SendTo_OnCreate
00396  *
00397  *      When we are created, remember the handle of our SendTo menu
00398  *      so we can recognize it later.
00399  *
00400  *****************************************************************************/
00401
00402 BOOL
00403 SendTo_OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
00404 {
00405     MENUITEMINFO mii;
00406     HMENU hmenu;
00407     mii.cbSize = sizeof(mii);
00408     mii.fMask = MIIM_SUBMENU;
00409
00410     hmenu = GetMenu(hwnd);
00411     if (GetMenuItemInfo(hmenu, IDM_SENDTOPOPUP, FALSE, &mii)) {
00412         g_hmenuSendTo = mii.hSubMenu;
00413     }
00414
00415     return TRUE;
00416 }
00417
00418 /*****************************************************************************
00419  *
00420  *  SendTo_ResetSendToMenu
00421  *
00422  *      Wipe out all the items in the menu, freeing the associated memory.
00423  *
00424  *****************************************************************************/
00425
00426 void
00427 SendTo_ResetSendToMenu(HMENU hmenu)
00428 {
00429     MENUITEMINFO mii;
00430
00431     mii.cbSize = sizeof(mii);
00432     mii.fMask = MIIM_DATA;
00433
00434     while (GetMenuItemInfo(hmenu, 0, TRUE, &mii)) {
00435         if (mii.dwItemData) {
00436             ShellFree((LPVOID)mii.dwItemData);
00437         }
00438         DeleteMenu(hmenu, 0, MF_BYPOSITION);
00439     }
00440
00441 }
00442
00443 /*****************************************************************************
00444  *
00445  *  SendTo_FillSendToMenu
00446  *
00447  *      Enumerate the contents of the SendTo folder and fill the
00448  *      menu with the items therein.
00449  *
00450  *****************************************************************************/
00451
00452 void
00453 SendTo_FillSendToMenu(HWND hwnd, HMENU hmenu)
00454 {
00455     MENUITEMINFO mii;
00456     LPSHELLFOLDER psf;
00457     LPITEMIDLIST pidl;
00458     LPENUMIDLIST peidl;
00459     HRESULT hres;
00460     STRRET str;
00461     UINT idm = IDM_SENDTOFIRST;
00462
00463     psf = GetSpecialFolder(hwnd, CSIDL_SENDTO);
00464     if (psf) {
00465         hres = psf->lpVtbl->EnumObjects(psf, hwnd,
00466                     SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
00467                     &peidl);
00468         if (SUCCEEDED(hres)) {
00469             while (peidl->lpVtbl->Next(peidl, 1, &pidl, NULL) == S_OK &&
00470                    idm < IDM_SENDTOLAST) {
00471                 hres = psf->lpVtbl->GetDisplayNameOf(psf, pidl,
00472                                     SHGDN_NORMAL, &str);
00473                 if (SUCCEEDED(hres)) {
00474
00475                     StrRetToStr(&str, pidl);
00476
00477                     if (AppendMenu(hmenu, MF_ENABLED | MF_STRING,
00478                                    idm, str.cStr)) {
00479                         mii.cbSize = sizeof(mii);
00480                         mii.fMask = MIIM_DATA;
00481                         mii.dwItemData = (ULONG_PTR)pidl;
00482                         SetMenuItemInfo(hmenu, idm, FALSE, &mii);
00483                         idm++;
00484
00485                     }
00486                 }
00487             }
00488             peidl->lpVtbl->Release(peidl);
00489         }
00490         psf->lpVtbl->Release(psf);
00491
00492     }
00493
00494     /*
00495      *  If the menu is still empty (the user has an empty SendTo folder),
00496      *  then add a disabled "None" item so we have at least something
00497      *  to display.
00498      */
00499     if (idm == IDM_SENDTOFIRST) {
00500         AppendMenu(hmenu, MF_GRAYED | MF_DISABLED | MF_STRING,
00501                    idm, "(none)");
00502     }
00503 }
00504
00505 /*****************************************************************************
00506  *
00507  *  SendTo_OnInitMenuPopup
00508  *
00509  *      When the SendTo menu pops up, enumerate the contents of the
00510  *      SendTo folder and populate the menu.
00511  *
00512  *****************************************************************************/
00513
00514 void
00515 SendTo_OnInitMenuPopup(HWND hwnd, HMENU hmenu, UINT item, BOOL fSystemMenu)
00516 {
00517
00518     /*
00519      *  If it's the SendTo menu, then rebuild it.
00520      */
00521     if (hmenu == g_hmenuSendTo) {
00522         SendTo_ResetSendToMenu(hmenu);
00523         SendTo_FillSendToMenu(hwnd, hmenu);
00524     }
00525 }
00526
00527 /*****************************************************************************
00528  *
00529  *  SendTo_OnOpen
00530  *
00531  *      "Open" a file.  Just get its name and save it in our global
00532  *      g_szFileName variable.  (And update the title too, just to
00533  *      look pretty.)
00534  *
00535  *****************************************************************************/
00536
00537 void
00538 SendTo_OnOpen(HWND hwnd)
00539 {
00540     OPENFILENAME ofn;
00541     char szFileName[MAX_PATH];
00542     char szTitle[64];
00543
00544     ZeroMemory(&ofn, sizeof(ofn));
00545     ofn.lStructSize = sizeof(ofn);
00546     ofn.hwndOwner = hwnd;
00547     lstrcpy(szFileName, g_szFileName);
00548     ofn.lpstrFile = szFileName;
00549     ofn.nMaxFile = MAX_PATH;
00550     ofn.lpstrFileTitle = szTitle;
00551     ofn.nMaxFileTitle = 64;
00552     ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
00553     if (GetOpenFileName(&ofn)) {
00554         lstrcpy(g_szFileName, szFileName);
00555         wsprintf(szFileName, "%s - SendTo Demo", szTitle);
00556         SetWindowText(hwnd, szFileName);
00557     }
00558 }
00559
00560 /*****************************************************************************
00561  *
00562  *  SendTo_SendToItem
00563  *
00564  *      The user selected an item from our SendTo menu.
00565  *
00566  *      hwnd - window
00567  *      idm - menu item id
00568  *
00569  *****************************************************************************/
00570
00571 void
00572 SendTo_SendToItem(HWND hwnd, int idm)
00573 {
00574     MENUITEMINFO mii;
00575     LPSHELLFOLDER psf;
00576     LPITEMIDLIST pidl;
00577     LPDATAOBJECT pdto;
00578     LPDROPTARGET pdt;
00579     HRESULT hres;
00580
00581     /*
00582      *  First convert our filename to a data object.
00583      */
00584     hres = GetUIObjectOfPath(hwnd, g_szFileName, &IID_IDataObject,
00585                                     (LPVOID *)&pdto);
00586
00587     if (SUCCEEDED(hres)) {
00588
00589         /*
00590          *  Now go find the item we should send to.
00591          */
00592         mii.cbSize = sizeof(mii);
00593         mii.fMask = MIIM_DATA;
00594         if (GetMenuItemInfo(g_hmenuSendTo, idm, FALSE, &mii) &&
00595             mii.dwItemData) {
00596             pidl = (LPITEMIDLIST)mii.dwItemData;
00597
00598             /*
00599              *  Now convert the send to pidl to a drop target.
00600              */
00601             psf = GetSpecialFolder(hwnd, CSIDL_SENDTO);
00602             if (psf) {
00603                 hres = psf->lpVtbl->GetUIObjectOf(psf, hwnd, 1, &pidl,
00604                                     &IID_IDropTarget, NULL, (LPVOID *)&pdt);
00605                 if (SUCCEEDED(hres)) {
00606
00607                     /*
00608                      *  Now drop the file on the drop target.
00609                      */
00610
00611                     DoDrop(pdto, pdt);
00612                     pdt->lpVtbl->Release(pdt);
00613                 }
00614
00615                 psf->lpVtbl->Release(psf);
00616             }
00617         }
00618         pdto->lpVtbl->Release(pdto);
00619     }
00620
00621 }
00622
00623 /*****************************************************************************
00624  *
00625  *  SendTo_OnCommand
00626  *
00627  *      Handle our menu messages.
00628  *
00629  *      Our "Send To" commands live in the range
00630  *      IDM_SENDTOFIRST through IDM_SENDTOLAST.
00631  *
00632  *****************************************************************************/
00633
00634 void
00635 SendTo_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
00636 {
00637     if (id >= IDM_SENDTOFIRST && id <= IDM_SENDTOLAST) {
00638         SendTo_SendToItem(hwnd, id);
00639     } else if (id == IDM_OPEN) {
00640         SendTo_OnOpen(hwnd);
00641     }
00642 }
00643
00644 /*****************************************************************************
00645  *
00646  *  SendTo_OnDestroy
00647  *
00648  *      When our window is destroyed, clean up the memory associated
00649  *      with the SendTo submenu.
00650  *
00651  *      Also post a quit message because our application is over.
00652  *
00653  *****************************************************************************/
00654
00655 void
00656 SendTo_OnDestroy(HWND hwnd)
00657 {
00658     if (g_hmenuSendTo) {
00659         SendTo_ResetSendToMenu(g_hmenuSendTo);
00660     }
00661
00662     PostQuitMessage(0);
00663 }
00664
00665 /*****************************************************************************
00666  *
00667  *  SendTo_WndProc
00668  *
00669  *      Window procedure for the Send To demo.
00670  *
00671  *****************************************************************************/
00672
00673 LRESULT CALLBACK
00674 SendTo_WndProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
00675 {
00676     switch (uiMsg) {
00677
00678     HANDLE_MSG(hwnd, WM_CREATE, SendTo_OnCreate);
00679
00680     HANDLE_MSG(hwnd, WM_COMMAND, SendTo_OnCommand);
00681
00682     HANDLE_MSG(hwnd, WM_INITMENUPOPUP, SendTo_OnInitMenuPopup);
00683
00684     HANDLE_MSG(hwnd, WM_DESTROY, SendTo_OnDestroy);
00685
00686     }
00687
00688     return DefWindowProc(hwnd, uiMsg, wParam, lParam);
00689 }
00690
00691 /*****************************************************************************
00692  *
00693  *  InitApp
00694  *
00695  *      Register our window classes and otherwise prepare for action.
00696  *
00697  *****************************************************************************/
00698
00699 BOOL
00700 InitApp(void)
00701 {
00702     WNDCLASS wc;
00703     HRESULT hr;
00704
00705     wc.style = 0;
00706     wc.lpfnWndProc = SendTo_WndProc;
00707     wc.cbClsExtra = 0;
00708     wc.cbWndExtra = 0;
00709     wc.hInstance = g_hinst;
00710     wc.hIcon = NULL;
00711     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
00712     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
00713     wc.lpszMenuName = "SendToMenu";
00714     wc.lpszClassName = "SendTo";
00715
00716     RegisterClass(&wc);
00717
00718     hr = SHGetMalloc(&g_pMalloc);
00719     if (FAILED(hr)) {
00720         return FALSE;
00721     }
00722
00723     hr = SHGetDesktopFolder(&g_psfDesktop);
00724     if (FAILED(hr)) {
00725         return FALSE;
00726     }
00727
00728     return TRUE;
00729 }
00730
00731 /*****************************************************************************
00732  *
00733  *  TermApp
00734  *
00735  *      Clean up.
00736  *
00737  *****************************************************************************/
00738
00739 void
00740 TermApp(void)
00741 {
00742     if (g_pMalloc) {
00743         g_pMalloc->lpVtbl->Release(g_pMalloc);
00744         g_pMalloc = NULL;
00745     }
00746
00747     if (g_psfDesktop) {
00748         g_psfDesktop->lpVtbl->Release(g_psfDesktop);
00749         g_psfDesktop = NULL;
00750     }
00751
00752 }
00753
00754 /*****************************************************************************
00755  *
00756  *  WinMain
00757  *
00758  *      Program entry point.
00759  *
00760  *      Demonstrate Send To menu.
00761  *
00762  *****************************************************************************/
00763
00764 int WINAPI
00765 WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR pszCmdLine, int nCmdShow)
00766 {
00767     MSG msg;
00768     HWND hwnd;
00769     HRESULT hrInit;
00770
00771     g_hinst = hinst;
00772
00773     if (!InitApp()) return 0;
00774
00775     hrInit = CoInitialize(NULL);
00776
00777     hwnd = CreateWindow(
00778         "SendTo",                       /* Class Name */
00779         "SendTo Demo",                  /* Title */
00780         WS_OVERLAPPEDWINDOW,            /* Style */
00781         CW_USEDEFAULT, CW_USEDEFAULT,   /* Position */
00782         CW_USEDEFAULT, CW_USEDEFAULT,   /* Size */
00783         NULL,                           /* Parent */
00784         NULL,                           /* No menu */
00785         hinst,                          /* Instance */
00786         0);                             /* No special parameters */
00787
00788     ShowWindow(hwnd, nCmdShow);
00789
00790     while (GetMessage(&msg, NULL, 0, 0)) {
00791         TranslateMessage(&msg);
00792         DispatchMessage(&msg);
00793     }
00794
00795     TermApp();
00796
00797     if (SUCCEEDED(hrInit))
00798         CoUninitialize();
00799
00800     return 0;
00801 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ECB_QUEUE_ENTRY Member List

This is the complete list of members for ECB_QUEUE_ENTRY, including all inherited members.
dwNextEntry | ECB_QUEUE_ENTRY
pECB | ECB_QUEUE_ENTRY
Generated on Wed Nov 13 2024 16:57:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/guids.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

guids.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #ifndef _CONTEXTMENUX_PROJECT_GUIDS_
00016 #define _CONTEXTMENUX_PROJECT_GUIDS_
00017
00018 // {6568A231-D647-4E60-BB38-B8B3878B9DDF}
00019 DEFINE_GUID( CLSID_CExtendContextMenuEx,
00020              0x6568a231, 0xd647, 0x4e60, 0xbb, 0x38, 0xb8, 0xb3, 0x87, 0x8b, 0x9d, 0xdf);
00021
00022
00023
00024 #endif //_CONTEXTMENUX_PROJECT_GUIDS_
00025
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CHILDWINDOWDATA Member List

This is the complete list of members for CHILDWINDOWDATA, including all inherited members.
ANDRect | CHILDWINDOWDATA
ANDTextRect | CHILDWINDOWDATA
BlackRect | CHILDWINDOWDATA
BlackTextRect | CHILDWINDOWDATA
BoxRect | CHILDWINDOWDATA
DrawingRect | CHILDWINDOWDATA
hWndFormatListBox | CHILDWINDOWDATA
pIR | CHILDWINDOWDATA
WhiteRect | CHILDWINDOWDATA
WhiteTextRect | CHILDWINDOWDATA
XORImageRect | CHILDWINDOWDATA
XORRect | CHILDWINDOWDATA
XORTextRect | CHILDWINDOWDATA
Generated on Wed Nov 13 2024 16:56:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IInkRecognitionEventsImpl< T > Member List

This is the complete list of members for IInkRecognitionEventsImpl< T >, including all inherited members.
mc_AtlFuncInfo | IInkRecognitionEventsImpl< T > | [static]
OnRecognitionWithAlternates(pIInkRecoResult, vCustomParam, RecognitionStatus) | IInkRecognitionEventsImpl< T > |
pT | IInkRecognitionEventsImpl< T > |
SINK_ENTRY_INFO(SINK_ID, DIID__IInkRecognitionEvents, DISPID_RERecognitionWithAlternates, RecognitionWithAlternates, const_cast< _ATL_FUNC_INFO * >(&mc_AtlFuncInfo)) HRESULT __stdcall RecognitionWithAlternates(IInkRecognitionResult *pIInkRecoResult | IInkRecognitionEventsImpl< T > |
SINK_ENTRY_INFO(SINK_ID, DIID__IInkRecognitionEvents, DISPID_RERecognition, Recognition, const_cast< _ATL_FUNC_INFO * >(&mc_AtlFuncInfo)) HRESULT __stdcall Recognition(BSTR bstrRecognizedString | IInkRecognitionEventsImpl< T > |
vCustomParam | IInkRecognitionEventsImpl< T > |
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/dataobj.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

dataobj.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _CLASS_CDATAOBJECT_
00015 #define _CLASS_CDATAOBJECT_
00016
00017 #include "Globals.h"
00018 #include "StaticNode.h"
00019
00020 //---------------------------------------------------------------------------
00021 class CDataObject : public IDataObject
00022 {
00023   private:
00024     ULONG     m_cRef;
00025     ULONG     m_uCookie;
00026     ULONG     m_uContext;
00027
00028   public:
00029     CDataObject();
00030     ~CDataObject();
00031
00032   public:  // Interface IUnknown
00033     STDMETHODIMP QueryInterface( REFIID riid, LPVOID* ppv );
00034     STDMETHODIMP_(ULONG) AddRef();
00035     STDMETHODIMP_(ULONG) Release();
00036
00037   public:  // IDataObject methods
00038     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00039
00040     // The rest are not implemented
00041     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00042     { return E_NOTIMPL; };
00043
00044     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00045     { return E_NOTIMPL; };
00046
00047     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00048     { return E_NOTIMPL; };
00049
00050     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00051     { return E_NOTIMPL; };
00052
00053     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00054     { return E_NOTIMPL; };
00055
00056     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00057     { return E_NOTIMPL; };
00058
00059     STDMETHODIMP DUnadvise (DWORD dwConnection)
00060     { return E_NOTIMPL; };
00061
00062     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00063     { return E_NOTIMPL; };
00064
00065   ///////////////////////////////////////////////////////////////////////////
00066   // Custom Methods
00067   public:
00068     VOID   SetPrivateData( ULONG uCookie, ULONG uContext );
00069
00070     // For future use, not used in this sample
00071     ULONG  GetContext() { return m_uContext; }
00072     ULONG  GetCookie()  { return m_uCookie;  }
00073
00074   ///////////////////////////////////////////////////////////////////////////
00075   // Handlers for required clipboard formats
00076   private:
00077     HRESULT  RetrieveDisplayString( IStream* ipStream );
00078     HRESULT  RetrieveSnapInClassID( IStream* ipStream );
00079     HRESULT  RetrieveNodeTypeGuid( IStream* ipStream );
00080     HRESULT  RetrieveGuidString( IStream* ipStream );
00081
00082 };
00083
00084 #endif //_CLASS_CDATAOBJECT_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/Init.c Source File

  • Multimedia
  • Gdi
  • GdiDemo

Init.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /*---------------------------------------------------------------------------*\
00013 | INITIALIZATION MODULE
00014 |   This module contains startup-routines for the creation of windows for this
00015 |   application.
00016 |
00017 |   RegisterAppClass
00018 |   UnregisterAppClass
00019 |   CreateAppWindow
00020 |   CreateMDIClientWindow
00021 |
00022 \*---------------------------------------------------------------------------*/
00023
00024 #include <windows.h>
00025 #include "gdidemo.h"
00026 #include "poly.h"
00027 #include "xform.h"
00028 #include "maze.h"
00029 #include "draw.h"
00030 #include "bounce.h"
00031
00032 /*---------------------------------------------------------------------------*\
00033 | REGISTER APPLICATION CLASS
00034 |   This routine registers all classes necessary for the application.
00035 \*---------------------------------------------------------------------------*/
00036 BOOL FAR RegisterAppClass(HANDLE hInstance)
00037 {
00038     WNDCLASS wndClass;
00039
00040
00041     /*
00042     ** Set the common wndClass information.  This is common to all windows
00043     ** of this application.
00044     */
00045     wndClass.style         = CS_HREDRAW | CS_VREDRAW;
00046     wndClass.cbClsExtra    = 0;
00047     wndClass.cbWndExtra    = sizeof(LONG_PTR);
00048     wndClass.hCursor       = LoadCursor(NULL,IDC_ARROW);
00049     wndClass.hInstance     = hInstance;
00050
00051
00052     /*
00053     ** Register the main top-level window (frame).
00054     */
00055     wndClass.lpfnWndProc   = WndProc;
00056     wndClass.hIcon         = LoadIcon(hInstance,MAKEINTRESOURCE(APPICON));
00057     wndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
00058     wndClass.lpszMenuName  = MAKEINTRESOURCE(APPMENU);
00059     wndClass.lpszClassName = APPCLASS;
00060
00061     if(!RegisterClass(&wndClass))
00062         return(FALSE);
00063
00064
00065     /*
00066     ** Register the polybezier demo window.
00067     */
00068     wndClass.lpfnWndProc   = PolyProc;
00069     wndClass.hIcon         = LoadIcon(NULL,IDI_APPLICATION);
00070     wndClass.hbrBackground = GetStockObject(BLACK_BRUSH);
00071     wndClass.lpszMenuName  = NULL;
00072     wndClass.lpszClassName = POLYCLASS;
00073
00074     if(!RegisterClass(&wndClass))
00075     {
00076         UnregisterClass(APPCLASS,hInstance);
00077         return(FALSE);
00078     }
00079
00080
00081     /*
00082     ** Register the xform demo window.
00083     */
00084     wndClass.lpfnWndProc   = XFormProc;
00085     wndClass.hIcon         = LoadIcon(NULL,IDI_APPLICATION);
00086     wndClass.hbrBackground = GetStockObject(BLACK_BRUSH);
00087     wndClass.lpszMenuName  = NULL;
00088     wndClass.lpszClassName = XFORMCLASS;
00089
00090     if(!RegisterClass(&wndClass))
00091     {
00092         UnregisterClass(APPCLASS ,hInstance);
00093         UnregisterClass(POLYCLASS,hInstance);
00094         return(FALSE);
00095     }
00096
00097
00098     /*
00099     ** Register the maze demo window.
00100     */
00101     wndClass.lpfnWndProc   = MazeProc;
00102     wndClass.hIcon         = LoadIcon(NULL,IDI_APPLICATION);
00103     wndClass.hbrBackground = GetStockObject(BLACK_BRUSH);
00104     wndClass.lpszMenuName  = NULL;
00105     wndClass.lpszClassName = MAZECLASS;
00106
00107     if(!RegisterClass(&wndClass))
00108     {
00109         UnregisterClass(APPCLASS  ,hInstance);
00110         UnregisterClass(POLYCLASS ,hInstance);
00111         UnregisterClass(XFORMCLASS,hInstance);
00112         return(FALSE);
00113     }
00114
00115
00116     /*
00117     ** Register the random draw demo window.
00118     */
00119     wndClass.lpfnWndProc   = DrawProc;
00120     wndClass.hIcon         = LoadIcon(NULL,IDI_APPLICATION);
00121     wndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
00122     wndClass.lpszMenuName  = NULL;
00123     wndClass.lpszClassName = DRAWCLASS;
00124
00125     if(!RegisterClass(&wndClass))
00126     {
00127         UnregisterClass(APPCLASS  ,hInstance);
00128         UnregisterClass(POLYCLASS ,hInstance);
00129         UnregisterClass(XFORMCLASS,hInstance);
00130         UnregisterClass(MAZECLASS ,hInstance);
00131         return(FALSE);
00132     }
00133
00134
00135     /*
00136     ** Register the bouncing ball demo window.
00137     */
00138     wndClass.lpfnWndProc   = BounceProc;
00139     wndClass.hIcon         = LoadIcon(NULL,IDI_APPLICATION);
00140     wndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
00141     wndClass.lpszMenuName  = NULL;
00142     wndClass.lpszClassName = BOUNCECLASS;
00143
00144     if(!RegisterClass(&wndClass))
00145     {
00146         UnregisterClass(APPCLASS  ,hInstance);
00147         UnregisterClass(POLYCLASS ,hInstance);
00148         UnregisterClass(XFORMCLASS,hInstance);
00149         UnregisterClass(MAZECLASS ,hInstance);
00150         UnregisterClass(DRAWCLASS ,hInstance);
00151         return(FALSE);
00152     }
00153
00154     return(TRUE);
00155 }
00156
00157
00158 /*---------------------------------------------------------------------------*\
00159 | UNREGISTER APPLICATION CLASS
00160 |   This routine unregisters all classes registered for the application.
00161 |   It is typically called upon termination of the application.
00162 \*---------------------------------------------------------------------------*/
00163 VOID FAR UnregisterAppClass(HANDLE hInstance)
00164 {
00165     UnregisterClass(APPCLASS   ,hInstance);
00166     UnregisterClass(POLYCLASS  ,hInstance);
00167     UnregisterClass(XFORMCLASS ,hInstance);
00168     UnregisterClass(MAZECLASS  ,hInstance);
00169     UnregisterClass(DRAWCLASS  ,hInstance);
00170     UnregisterClass(BOUNCECLASS,hInstance);
00171
00172     return;
00173 }
00174
00175
00176 /*---------------------------------------------------------------------------*\
00177 | CREATE APPLICATION WINDOW
00178 |   This routine creates the main top-level window.
00179 \*---------------------------------------------------------------------------*/
00180 HWND FAR CreateAppWindow(HANDLE hInstance)
00181 {
00182     /*
00183     ** Upon creation of the window, initialize the extra object information.
00184     */
00185     return(CreateWindow(APPCLASS,APPTITLE,WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
00186             CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
00187             NULL,NULL,hInstance,NULL));
00188 }
00189
00190
00191 /*---------------------------------------------------------------------------*\
00192 | CREATE MDI CLIENT WINDOW
00193 |   This routine creates the client window which handles the MDI windows.
00194 |   The window will eventually be size to fit into the frame-window's client
00195 |   area.
00196 \*---------------------------------------------------------------------------*/
00197 HWND FAR CreateMDIClientWindow(HWND hWndFrame)
00198 {
00199     HWND               hWndClient;
00200     HANDLE             hInstance;
00201     CLIENTCREATESTRUCT ccs;
00202
00203
00204     /*
00205     ** Initialize the client struct to point to define the menu and child
00206     ** identifiers.  The menu item specifies the parent menu in which the
00207     ** the list of MDI childs will be appended to this menu.
00208     */
00209     ccs.hWindowMenu  = NULL;
00210     ccs.idFirstChild = 0;
00211
00212
00213     hInstance = GETINSTANCE(hWndFrame);
00214
00215     hWndClient = CreateWindow("MDICLIENT",NULL,WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
00216             0,0,1,1,hWndFrame,NULL,hInstance,(LPVOID)&ccs);
00217
00218     return(hWndClient);
00219 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/queue.c Source File

  • Multimedia
  • Gdi
  • PrintJob

queue.c

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 * PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   Queue.c
00010 *
00011 *   PURPOSE:    Data structure implementation.
00012 *
00013
00014     FUNCTIONS:
00015
00016     ReplaceString() - Utility function that reallocates string space and copies
00017                       the string to a target string pointer.
00018
00019     FreeJob() - Frees and Initializes a JOBDATA structure.
00020
00021     NewJob() - Creates a new JOBDATA structure given data from the spooler.
00022
00023     FindJob() - Finds a job in the queue.
00024
00025     AddChange() - Marks a part of a job's data as having changed.
00026
00027     ClearChanges() - Clears all marked changes in a job's data.
00028
00029     IsChanged() - Tests some part of a job's data for having changed.
00030
00031     GetColumnData() - Returns a formatted string representing some part of
00032                       a job's data based upon presentation column.
00033
00034     AllocQueueData() - Allocates or Reallocates a QUEUEDATA data structure.
00035
00036     FreeQueueData() - Frees a QUEUEDATA data structure.
00037
00038     FreeJobs() - Frees all of the jobs from a queue.
00039
00040     SetPrinterQueueData() - Sets the printer information for a queue.
00041
00042     AddJobData() - Adds a new job to the queue.
00043
00044     SetJobData() - Finds or Adds a job and sets its data.
00045
00046     UpdateJobData() - Processes a printer notification and updates an job that
00047                       is in the queue.
00048
00049     UpdatePrinterData() - Processes a printer notification and updates the
00050                           printer data.
00051
00052     COMMENTS:
00053
00054             This module uses C Runtime memory allocation routines to allocate and
00055             or reallocate memory.
00056
00057             This module simply implements a custom data structure for tracking
00058             printer queue information.
00059
00060 ******************************************************************************/
00061
00062 #define STRICT
00063 #include <Windows.h>
00064 #include "Queue.h"
00065 #include "QueCore.h"
00066 #include "QueList.H"
00067
00068
00069 /****************************************************************************
00070 *                           Module private functions.
00071 ****************************************************************************/
00072
00073
00074 /****************************************************************************
00075
00076     FUNCTION:   ReplaceString( char **, char * )
00077
00078
00079     PURPOSE:   Copies the char * into the char * pointed to by the char **.
00080
00081     COMMENTS:
00082
00083             *(char **) is freed and then allocated as appropriate to hold
00084             char *. NULL is valid for *(char **) and simply causes an
00085             allocation.
00086
00087 ****************************************************************************/
00088
00089 static BOOL ReplaceString(char **ppStr, char *pSrcStr)
00090 {
00091     char *pNewStr;
00092
00093     /*
00094      * OK, why not, propagate the NULL value.
00095      */
00096     if (pSrcStr == NULL)
00097     {
00098         free (*ppStr);
00099         *ppStr = NULL;
00100         return TRUE;
00101     }
00102
00103     /* Make a copy of the source */
00104     pNewStr = (char *)malloc(lstrlen(pSrcStr)+1);
00105     /* bad thing happened, bail */
00106     if (pNewStr == NULL)
00107         return FALSE;
00108     lstrcpyn(pNewStr, pSrcStr, lstrlen(pSrcStr)+1);
00109
00110     /* cleanup previous String */
00111     free (*ppStr);
00112
00113     /* send it back to caller */
00114     *ppStr = pNewStr;
00115
00116     return TRUE;
00117
00118 } /* end of function ReplaceString */
00119
00120
00121 /****************************************************************************
00122
00123     FUNCTION:   FreeJob( JOBDATA * )
00124
00125
00126     PURPOSE:   Frees up the contents of JOBDATA * and initializes the
00127                structure.
00128
00129     COMMENTS:
00130
00131             The resulting structure is clean (i.e. it is initialized to NULL.
00132
00133 ****************************************************************************/
00134
00135 static void FreeJob(JOBDATA *pJob)
00136 {
00137     free (pJob->pszDocument);
00138     free (pJob->pszOwner);
00139     free (pJob->pszStatus);
00140     ZeroMemory(pJob, sizeof(JOBDATA));
00141
00142 } /* end of function FreeJob */
00143
00144
00145 /****************************************************************************
00146
00147     FUNCTION:   NewJob( JOBDATA *, JOB_INFO_2 * )
00148
00149
00150     PURPOSE:   Given job data from the spooler it copies data into the JOBDATA
00151                structure.
00152
00153     COMMENTS:
00154
00155             This function allocates memory and attaches it to JOBDATA.
00156
00157 ****************************************************************************/
00158
00159 static BOOL NewJob(JOBDATA *pJob, JOB_INFO_2 *pJI)
00160 {
00161     /* pJob assumed uninitilazed */
00162     ZeroMemory(pJob, sizeof(JOBDATA));
00163
00164
00165     /* Copy the data we want */
00166     pJob->JobId = pJI->JobId;
00167
00168     if (!ReplaceString(&pJob->pszDocument, pJI->pDocument))
00169         goto Fail;
00170     if (!ReplaceString(&pJob->pszOwner, pJI->pUserName))
00171         goto Fail;
00172     if (!ReplaceString(&pJob->pszStatus, pJI->pStatus))
00173         goto Fail;
00174
00175     pJob->dwStatus = pJI->Status;
00176     pJob->PagesPrinted = pJI->PagesPrinted;
00177     pJob->TotalPages = pJI->TotalPages;
00178     pJob->Size = pJI->Size;
00179     pJob->Submitted = pJI->Submitted;
00180     pJob->BytesPrinted = 0;
00181
00182     /* Initialize the changed data to now chagnes */
00183     memset(&pJob->Changed, (char)TRUE, sizeof(pJob->Changed));
00184
00185     return TRUE;
00186
00187 /* Bail when failure occurs */
00188 Fail:
00189     FreeJob(pJob);
00190
00191     return FALSE;
00192
00193 } /* end of function NewJob */
00194
00195
00196 /****************************************************************************
00197 *                           Module public functions.
00198 ****************************************************************************/
00199
00200
00201 /****************************************************************************
00202
00203     FUNCTION:   FindJob( QUEUEDATA *, DWORD, DWORD )
00204
00205
00206     PURPOSE:   Finds a job in the QUEUEDATA by job id.
00207
00208     COMMENTS:
00209
00210         Returns the position of the job in the queue in pAt.
00211
00212 ****************************************************************************/
00213
00214 static BOOL FindJob(QUEUEDATA *pQueueData, DWORD JobId, DWORD *pAt)
00215 {
00216     DWORD i;
00217
00218     /* find the job in the queue */
00219     for (i=0; i < pQueueData->nJobs; i++)
00220     {
00221         if (pQueueData->pJobs[i].JobId == JobId)
00222             break;
00223     }
00224
00225     if (i >= pQueueData->nJobs)
00226         return FALSE;       /* Not found in our queue data */
00227
00228     *pAt = i;
00229     return TRUE;
00230
00231 } /* end of function FindJob */
00232
00233 /****************************************************************************
00234
00235     FUNCTION:   AddChange( JOBDATA *, WORD )
00236
00237
00238     PURPOSE:   Marks the data in the JOBDATA that has changed.
00239
00240     COMMENTS:
00241
00242 ****************************************************************************/
00243
00244 void AddChange(JOBDATA *pJob, WORD Change)
00245 {
00246     pJob->Changed[Change] = TRUE;
00247
00248 } /* end of function AddChange */
00249
00250
00251 /****************************************************************************
00252
00253     FUNCTION:   ClearChanges( JOBDATA * )
00254
00255
00256     PURPOSE:   Clears all of the changes marked in the JOBDATA.
00257
00258     COMMENTS:
00259
00260 ****************************************************************************/
00261
00262 void ClearChanges(JOBDATA *pJob)
00263 {
00264     ZeroMemory(pJob->Changed, sizeof(pJob->Changed));
00265
00266 } /* end of function ClearChanges */
00267
00268
00269 /****************************************************************************
00270
00271     FUNCTION:   IsChanged( JOBDATA *, WORD Change )
00272
00273
00274     PURPOSE:   Tests to see if a part of the JOB has been changed.
00275
00276     COMMENTS:
00277
00278 ****************************************************************************/
00279
00280 BOOL IsChanged(JOBDATA *pJob, WORD Change)
00281 {
00282     return pJob->Changed[Change];
00283
00284 } /* end of function IsChanged */
00285
00286
00287 /****************************************************************************
00288
00289     FUNCTION:   GetColumnData( JOBDATA *, unsigned short iCol )
00290
00291
00292     PURPOSE:   Returns a string representation of a part of the job which is
00293                to appear in a coloumn of the display.
00294
00295     COMMENTS:
00296
00297         iCol is the column index corresponding ot the columns created in the
00298         ListView control.
00299
00300         The function allocates a string buffer and returns it to the caller.
00301         The caller is responsible for deleting the memory returned to it.
00302
00303 ****************************************************************************/
00304
00305 char *GetColumnData(JOBDATA *pJob, unsigned short iCol)
00306 {
00307     char *pStr = NULL;
00308     char Buffer[100];
00309
00310     switch (iCol)
00311     {
00312         case DOCUMENTNAME:
00313         {
00314             ReplaceString(&pStr, pJob->pszDocument);
00315             break;
00316         }
00317         case OWNERNAME:
00318         {
00319             ReplaceString(&pStr, pJob->pszOwner);
00320             break;
00321         }
00322         case STATUS:
00323         {
00324             if (pJob->pszStatus != NULL && lstrlen(pJob->pszStatus))
00325             {
00326                 ReplaceString(&pStr, pJob->pszStatus);
00327             }
00328             else
00329             {
00330                 MakeJobStatusStr(Buffer, sizeof(Buffer), pJob->dwStatus);
00331                 ReplaceString(&pStr, Buffer);
00332             }
00333             break;
00334         }
00335         case SUBMITTED:
00336         {
00337             wsprintf(Buffer,
00338                     "%02u/%02u/%u - %02u:%02u",
00339                     pJob->Submitted.wMonth,
00340                     pJob->Submitted.wDay,
00341                     (pJob->Submitted.wYear-((pJob->Submitted.wYear/100)*100)),
00342                     pJob->Submitted.wHour,
00343                     pJob->Submitted.wMinute);
00344             ReplaceString(&pStr, Buffer);
00345             break;
00346         }
00347         case PROGRESS:
00348         {
00349             if (pJob->PagesPrinted == 1)
00350                 wsprintf(Buffer, "%u page of %u Pages, %u bytes of %u Total Bytes", pJob->PagesPrinted, pJob->TotalPages, pJob->BytesPrinted, pJob->Size);
00351             else
00352                 wsprintf(Buffer, "%u pages of %u Pages, %u bytes of %u Total Bytes", pJob->PagesPrinted, pJob->TotalPages, pJob->BytesPrinted, pJob->Size);
00353             ReplaceString(&pStr, Buffer);
00354             break;
00355         }
00356         default:
00357         {
00358             ReplaceString(&pStr, "");
00359             break;
00360         }
00361     }
00362
00363     return pStr;
00364
00365 } /* end of function GetColumnData */
00366
00367
00368 /****************************************************************************
00369
00370     FUNCTION:   AllocQueueData( QUEUEDATA *, DWORD nJobs )
00371
00372
00373     PURPOSE:   Allocates or Reallocates a QUEUEDATA data structure to hold
00374                 Print QUEUE information.
00375
00376     COMMENTS:
00377
00378         AllocQueueData initializes the additional data space to all zeroes.
00379
00380 ****************************************************************************/
00381
00382 BOOL AllocQueueData(QUEUEDATA *pQueueData, DWORD nJobs)
00383 {
00384     QUEUEDATA   NewData;
00385
00386     /* if we are to realloc, it should be expansion */
00387     if (nJobs < pQueueData->nAllocated)
00388         return FALSE;
00389
00390     /* short cut the trivial */
00391     if (nJobs == pQueueData->nAllocated)
00392         return TRUE;
00393
00394     /* Allocate a new Queue */
00395     ZeroMemory(&NewData, sizeof(NewData));
00396     NewData.pJobs = (JOBDATA *)realloc(pQueueData->pJobs, sizeof(JOBDATA) * nJobs);
00397     if (NewData.pJobs == NULL && nJobs)
00398     {
00399         return FALSE;
00400     }
00401     NewData.nJobs = pQueueData->nJobs;
00402     NewData.nAllocated = nJobs;
00403     NewData.Printer = pQueueData->Printer;
00404
00405     /* Initialize the new allocated data space */
00406     ZeroMemory(&NewData.pJobs[NewData.nJobs], sizeof(JOBDATA)*(NewData.nAllocated-NewData.nJobs));
00407
00408     *pQueueData = NewData;
00409
00410     return TRUE;
00411
00412 } /* end of function AllocQueueData */
00413
00414
00415 /****************************************************************************
00416
00417     FUNCTION:   FreeQueueData( QUEUEDATA * )
00418
00419
00420     PURPOSE:   Deallocates a QUEUEDATA data structure.
00421
00422     COMMENTS:
00423
00424 ****************************************************************************/
00425
00426 void FreeQueueData(QUEUEDATA *pQueueData)
00427 {
00428     FreeJobs(pQueueData);
00429     free (pQueueData->Printer.pszPrinterName);
00430     free (pQueueData->Printer.pszServerName);
00431     free (pQueueData->Printer.pszShareName);
00432     free (pQueueData->pJobs);
00433     ZeroMemory(pQueueData, sizeof(QUEUEDATA));
00434 } /* end of function FreeQueueData */
00435
00436
00437 /****************************************************************************
00438
00439     FUNCTION:   FreeJobs( QUEUEDATA * )
00440
00441
00442     PURPOSE:   Deallocates the jobs contained in a QUEUEDATA data structure.
00443
00444     COMMENTS:
00445
00446 ****************************************************************************/
00447
00448 void FreeJobs(QUEUEDATA *pQueueData)
00449 {
00450     DWORD   i;
00451
00452     for (i=0; i < pQueueData->nJobs; i++)
00453     {
00454         FreeJob(&pQueueData->pJobs[i]);
00455     }
00456     free (pQueueData->pJobs);
00457     pQueueData->pJobs = NULL;
00458     pQueueData->nJobs = pQueueData->nAllocated = 0;
00459 } /* end of function FreeJobs */
00460
00461
00462 /****************************************************************************
00463
00464     FUNCTION:   SetPrinterQueueData( QUEUEDATA *, PRINTER_INFO_2 * )
00465
00466
00467     PURPOSE:   Sets the printer data that is kept by the QUEUEDATA data
00468                 structure.
00469
00470     COMMENTS:
00471
00472 ****************************************************************************/
00473
00474 BOOL SetPrinterQueueData(QUEUEDATA *pQueueData, PRINTER_INFO_2 *pPI)
00475 {
00476     PRINTERDATA pd;
00477
00478     if (pPI == NULL)
00479         return FALSE;
00480
00481     /* Initialize and copy pertinent data */
00482     ZeroMemory(&pd, sizeof(pd));
00483
00484     ReplaceString(&pd.pszPrinterName, pPI->pPrinterName);
00485     ReplaceString(&pd.pszServerName, pPI->pServerName);
00486     ReplaceString(&pd.pszShareName, pPI->pShareName);
00487
00488     pd.dwStatus = pPI->Status;
00489     pd.cJobs = pPI->cJobs;
00490     pd.hPrinter = pQueueData->Printer.hPrinter;
00491
00492     /* Cleanup previous printer data */
00493     free (pQueueData->Printer.pszPrinterName);
00494     free (pQueueData->Printer.pszServerName);
00495     free (pQueueData->Printer.pszShareName);
00496
00497     /* copy it */
00498     pQueueData->Printer = pd;
00499     return TRUE;
00500
00501 } /* end of function SetPritnerQueueData */
00502
00503
00504 /****************************************************************************
00505
00506     FUNCTION:   AddJobData( QUEUEDATA *, JOB_INFO_2 * )
00507
00508
00509     PURPOSE:   Appends the job to the queue data structure.
00510
00511     COMMENTS:
00512
00513 ****************************************************************************/
00514
00515 BOOL AddJobData(QUEUEDATA *pQueueData, JOB_INFO_2 *pJI)
00516 {
00517
00518     /* allocated more space if necessary */
00519     if (pQueueData->nJobs == pQueueData->nAllocated)
00520         if (!AllocQueueData(pQueueData, pQueueData->nAllocated+1))
00521             return FALSE;
00522
00523     /* Add the Job at the end */
00524     if (!NewJob(&pQueueData->pJobs[pQueueData->nJobs], pJI))
00525         return FALSE;
00526
00527     pQueueData->nJobs++;
00528
00529     return TRUE;
00530
00531 } /* end of function AddJobData */
00532
00533
00534 /****************************************************************************
00535
00536     FUNCTION:   SetJobData( QUEUEDATA *, JOB_INFO_2 * )
00537
00538
00539     PURPOSE:   Locates the job in the queue and updates its data.
00540
00541     COMMENTS:
00542                 If the job is not located in the queue the function returns
00543                 FALSE;
00544
00545 ****************************************************************************/
00546
00547 BOOL SetJobData(QUEUEDATA *pQueueData, JOB_INFO_2 *pJI)
00548 {
00549     DWORD i;
00550     JOBDATA jd;
00551
00552     if (!FindJob(pQueueData, pJI->JobId, &i))
00553         return FALSE;
00554
00555     /* make a new one */
00556     if (!NewJob(&jd, pJI))
00557         return FALSE;
00558
00559     /* cleanup previous version */
00560     FreeJob(&pQueueData->pJobs[i]);
00561
00562     /* copy new data */
00563     pQueueData->pJobs[i] = jd;
00564
00565     return TRUE;
00566
00567 } /* end of function SetJobData */
00568
00569
00570 /****************************************************************************
00571
00572     FUNCTION:   UpdateJobData( QUEUEDATA *, PRINTER_NOTIFY_INFO_DATA * )
00573
00574
00575     PURPOSE:   Updates the job data identified by the notify information.
00576
00577     COMMENTS:
00578                 This function checks for the right notification data and
00579                 returns FALSE if it is not correct.
00580
00581                 If the job in the notification information is not found,
00582                 a new one is created in the queue.
00583
00584                 As each piece of a Job's data is updates it is marked in
00585                 the data structure as having been changed.
00586
00587 ****************************************************************************/
00588
00589 BOOL UpdateJobData(QUEUEDATA *pQueueData, PRINTER_NOTIFY_INFO_DATA *pPNID)
00590 {
00591     DWORD       i;
00592     BOOL        fSuccess = FALSE;
00593     JOB_INFO_2  ji;
00594
00595     /* check for the right notification type */
00596     if (pPNID->Type != JOB_NOTIFY_TYPE)
00597         return FALSE;
00598
00599     if (!FindJob(pQueueData, pPNID->Id, &i))
00600     {
00601         /* didn't find job so possibly a new one */
00602         /* add an entry that can be updated now and later */
00603         ZeroMemory(&ji, sizeof(ji));
00604         ji.JobId = pPNID->Id;
00605         if (!AddJobData(pQueueData, &ji))
00606             return FALSE;
00607         if (!FindJob(pQueueData, pPNID->Id, &i))
00608             return FALSE;
00609     }
00610
00611     /* Update members based on the advertised change */
00612     switch (pPNID->Field)
00613     {
00614         case JOB_NOTIFY_FIELD_STATUS:
00615         {
00616             pQueueData->pJobs[i].dwStatus = pPNID->NotifyData.adwData[0];
00617             fSuccess = TRUE;
00618             AddChange(&pQueueData->pJobs[i], STATUS);
00619             break;
00620         }
00621         case JOB_NOTIFY_FIELD_STATUS_STRING:
00622         {
00623             fSuccess = ReplaceString(&pQueueData->pJobs[i].pszStatus, pPNID->NotifyData.Data.pBuf);
00624             AddChange(&pQueueData->pJobs[i], STATUS);
00625             break;
00626         }
00627         case JOB_NOTIFY_FIELD_USER_NAME:
00628         {
00629             fSuccess = ReplaceString(&pQueueData->pJobs[i].pszOwner, pPNID->NotifyData.Data.pBuf);
00630             AddChange(&pQueueData->pJobs[i], OWNERNAME);
00631             break;
00632         }
00633         case JOB_NOTIFY_FIELD_DOCUMENT:
00634         {
00635             fSuccess = ReplaceString(&pQueueData->pJobs[i].pszDocument, pPNID->NotifyData.Data.pBuf);
00636             AddChange(&pQueueData->pJobs[i], DOCUMENTNAME);
00637             break;
00638         }
00639         case JOB_NOTIFY_FIELD_PAGES_PRINTED:
00640         {
00641             pQueueData->pJobs[i].PagesPrinted = pPNID->NotifyData.adwData[0];
00642             AddChange(&pQueueData->pJobs[i], PROGRESS);
00643             break;
00644         }
00645         case JOB_NOTIFY_FIELD_TOTAL_PAGES:
00646         {
00647             pQueueData->pJobs[i].TotalPages = pPNID->NotifyData.adwData[0];
00648             AddChange(&pQueueData->pJobs[i], PROGRESS);
00649             break;
00650         }
00651         case JOB_NOTIFY_FIELD_TOTAL_BYTES:
00652         {
00653             pQueueData->pJobs[i].Size = pPNID->NotifyData.adwData[0];
00654             AddChange(&pQueueData->pJobs[i], PROGRESS);
00655             break;
00656         }
00657         case JOB_NOTIFY_FIELD_BYTES_PRINTED:
00658         {
00659             pQueueData->pJobs[i].BytesPrinted = pPNID->NotifyData.adwData[0];
00660             AddChange(&pQueueData->pJobs[i], PROGRESS);
00661             break;
00662         }
00663         case JOB_NOTIFY_FIELD_SUBMITTED:
00664         {
00665             pQueueData->pJobs[i].Submitted = *(SYSTEMTIME*) pPNID->NotifyData.Data.pBuf;
00666             AddChange(&pQueueData->pJobs[i], SUBMITTED);
00667             break;
00668         }
00669     }
00670
00671     return fSuccess;
00672
00673 } /* end of function UpdateJobData */
00674
00675
00676 /****************************************************************************
00677
00678     FUNCTION:   UpdatePrinterData( QUEUEDATA *, PRINTER_NOTIFY_INFO_DATA * )
00679
00680
00681     PURPOSE:   Updates the printer data identified by the notify information.
00682
00683     COMMENTS:
00684                 This function checks for the right notification data and
00685                 returns FALSE if it is not correct.
00686
00687 ****************************************************************************/
00688
00689 BOOL UpdatePrinterData(QUEUEDATA *pQueueData, PRINTER_NOTIFY_INFO_DATA *pPNID)
00690 {
00691     BOOL    fSuccess = FALSE;
00692
00693     /* make sure we are processing printer data */
00694     if (pPNID->Type != PRINTER_NOTIFY_TYPE)
00695         return FALSE;
00696
00697     /* update the change as advertised */
00698     switch (pPNID->Field)
00699     {
00700         case PRINTER_NOTIFY_FIELD_PRINTER_NAME:
00701         {
00702             fSuccess = ReplaceString(&pQueueData->Printer.pszPrinterName, pPNID->NotifyData.Data.pBuf);
00703             break;
00704         }
00705         case PRINTER_NOTIFY_FIELD_SHARE_NAME:
00706         {
00707             fSuccess = ReplaceString(&pQueueData->Printer.pszShareName, pPNID->NotifyData.Data.pBuf);
00708             break;
00709         }
00710         case PRINTER_NOTIFY_FIELD_SERVER_NAME:
00711         {
00712             fSuccess = ReplaceString(&pQueueData->Printer.pszServerName, pPNID->NotifyData.Data.pBuf);
00713             break;
00714         }
00715         case PRINTER_NOTIFY_FIELD_STATUS:
00716         {
00717             pQueueData->Printer.dwStatus = pPNID->NotifyData.adwData[0];
00718             fSuccess = TRUE;
00719             break;
00720         }
00721         case PRINTER_NOTIFY_FIELD_CJOBS:
00722         {
00723             pQueueData->Printer.cJobs = pPNID->NotifyData.adwData[0];
00724             fSuccess = TRUE;
00725             break;
00726         }
00727     }
00728
00729     return fSuccess;
00730
00731 } /* end of function UpdatePrinterData */
00732
00733 /* end of source file Queue.C */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDynamicResultset Member List

This is the complete list of members for CDynamicResultset, including all inherited members.
STDMETHOD_(ULONG, Release)() CDynamicResultset [inline]
Generated on Wed Nov 13 2024 16:56:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSpecialCharHashEntry Member List

This is the complete list of members for CSpecialCharHashEntry, including all inherited members.
_pHashEntryNext | CSpecialCharHashEntry | [private]
_wch | CSpecialCharHashEntry | [private]
_wszName | CSpecialCharHashEntry | [private]
CSpecialCharHashEntry(WCHAR *pwszName, WCHAR wch) | CSpecialCharHashEntry |
GetName() | CSpecialCharHashEntry | [inline]
GetNextHashEntry() | CSpecialCharHashEntry | [inline]
GetWideChar() | CSpecialCharHashEntry | [inline]
SetNextHashEntry(CSpecialCharHashEntry *pEntry) | CSpecialCharHashEntry | [inline]
Generated on Wed Nov 13 2024 16:57:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cwinapp.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cwinapp.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module MAIN.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 //////////////////////////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 //////////////////////////////////////////////////////////////////////////////
00015 #include "Headers.h"
00016 #include "CWinApp.h"
00017
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CWinApp
00021 //
00022 /////////////////////////////////////////////////////////////////////////////
00023 CWinApp::CWinApp()
00024   : CAppLite(IDR_ROWSETVIEWER)
00025 {
00026   //Windows
00027   m_pCMainWindow    = NULL;
00028
00029   //Data
00030   m_pCMallocSpy   = NULL;
00031 }
00032
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // CWinApp
00036 //
00037 /////////////////////////////////////////////////////////////////////////////
00038 CWinApp::~CWinApp()
00039 {
00040 }
00041
00042
00043 /////////////////////////////////////////////////////////////////////////////
00044 // CWinApp
00045 //
00046 /////////////////////////////////////////////////////////////////////////////
00047 CWinApp theApp;
00048
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // CWinApp::InitInstance
00052 //
00053 /////////////////////////////////////////////////////////////////////////////
00054 BOOL CWinApp::InitInstance()
00055 {
00056   //CoInitialize before we do anything...
00057   //NOTE: We have to use OleInitialize for Drag-n-Drop.  RegisterDragDrop fails
00058   //with E_OUTOFMEMORY if just CoInitialize is done...
00059   OleInitialize(NULL);
00060
00061   // Ensure that common control DLL is loaded
00062   INITCOMMONCONTROLSEX iccex;
00063   iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00064   iccex.dwICC = ICC_USEREX_CLASSES | ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES | ICC_TAB_CLASSES | ICC_BAR_CLASSES;
00065   InitCommonControlsEx(&iccex);
00066
00067   //Set the Locale for all C runtime functions...
00068   setlocale(LC_ALL, ".ACP");
00069
00070 /*
00071   // Load all saved user options
00072   LoadUserOptions();
00073
00074   //C-runtime hooks
00075   EnableCRTReportHook();
00076   EnableCRTAllocHook();
00077 */
00078   //Create the Main Window and Child Windows...
00079   m_pCMainWindow = new CMainWindow;
00080   if(!m_pCMainWindow->Create(NULL, L"RowsetViewer", L"Microsoft OLE DB RowsetViewer", IDR_ROWSETVIEWER, LoadIcon(GetAppLite()->m_hInstance, MAKEINTRESOURCE(IDR_ROWSETVIEWER))))
00081     return FALSE;
00082
00083   //Register IMallocSpy (if requested)
00084   if(GetErrorPosting(EP_IMALLOC_SPY))
00085   {
00086     m_pCMallocSpy = new CMallocSpy;
00087     if(m_pCMallocSpy)
00088       m_pCMallocSpy->Register();
00089   }
00090
00091   //Restore the window positions and state
00092   if(m_pCMainWindow->m_wndPlacement.length)
00093   {
00094     //This already does a ShowWindow/UpdateWindow
00095     m_pCMainWindow->SetWindowPlacement();
00096   }
00097   else
00098   {
00099     //Show the window...
00100     m_pCMainWindow->ShowWindow(GetAppLite()->m_nCmdShow);
00101     m_pCMainWindow->UpdateWindow();
00102   }
00103
00104   return TRUE;
00105 }
00106
00107
00108 /////////////////////////////////////////////////////////////////////////////
00109 // CWinApp::ExitInstance
00110 //
00111 /////////////////////////////////////////////////////////////////////////////
00112 int CWinApp::ExitInstance()
00113 {
00114   //Since we use the CRT hooks, it will be called on delete.
00115   //So we need to first NULL the global pointer, then delete the actual object...
00116   CFrameWndLite* pCMainWindow = m_pCMainWindow;
00117   m_pCMainWindow = NULL;
00118   SAFE_DELETE(pCMainWindow);
00119
00120   //Globals
00121   g_spDataConvert.Release();
00122
00123   //Unitialize COM
00124   SetErrorInfo(0, NULL);
00125   OleUninitialize();
00126
00127   //Display any Leaks
00128   if(m_pCMallocSpy)
00129   {
00130     if(GetErrorPosting(EP_IMALLOC_SPY))
00131       m_pCMallocSpy->DumpLeaks();
00132     m_pCMallocSpy->Unregister();
00133     SAFE_RELEASE(m_pCMallocSpy);
00134   }
00135
00136   return CAppLite::ExitInstance();
00137 }
00138
00139
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MMStrm.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

MMStrm.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       mmstrm.cxx
00006 //
00007 //  Contents:   Memory Mapped Stream using win32 API
00008 //
00009 //  Classes:    CMmStream, CMmStreamBuf
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <mmstrm.hxx>
00017 #include <osv.hxx>
00018
00019 //+-------------------------------------------------------------------------
00020 //
00021 //  Member:     CMmStream::CMmStream
00022 //
00023 //  Synopsis:   constructor
00024 //
00025 //  Arguments:  [wcsPath] - file path
00026 //
00027 //--------------------------------------------------------------------------
00028
00029 CMmStream::CMmStream ( WCHAR* wcsPath )
00030     : _hMap(0),
00031       _sizeLow( 0 ),
00032       _sizeHigh( 0 )
00033 {
00034     OpenRorW ( wcsPath );
00035 }
00036
00037 //+-------------------------------------------------------------------------
00038 //
00039 //  Member:     CMmStream::CMmStream
00040 //
00041 //  Synopsis:   constructor
00042 //
00043 //--------------------------------------------------------------------------
00044 CMmStream::CMmStream()
00045         : _hFile(INVALID_HANDLE_VALUE),
00046           _hMap(0),
00047           _fWrite(FALSE),
00048           _sizeLow( 0 ),
00049           _sizeHigh( 0 )
00050 {
00051 }
00052
00053
00054 //+-------------------------------------------------------------------------
00055 //
00056 //  Member:     CMmStream::~CMmStream
00057 //
00058 //  Synopsis:   destructor
00059 //
00060 //
00061 //--------------------------------------------------------------------------
00062 CMmStream::~CMmStream()
00063 {
00064     if (Ok())
00065     {
00066         if(_hMap )
00067         {
00068             CloseHandle(_hMap);
00069             _hMap = 0;
00070         }
00071
00072         CloseHandle ( _hFile );
00073         _hFile = INVALID_HANDLE_VALUE;
00074     }
00075 }
00076
00077
00078
00079 //+-------------------------------------------------------------------------
00080 //
00081 //  Member:     CMmStream::OpenRorW, public
00082 //
00083 //  Synopsis:   Open stream
00084 //
00085 //  Arguments:  [path] - file path
00086 //
00087 //  Notes:      Tries to open read/write, create if necessary.
00088 //              If it fails, try opening read only. If read/write,
00089 //              regions are mapped in COMMON_PAGE_SIZE increments.
00090 //
00091 //--------------------------------------------------------------------------
00092
00093 void CMmStream::OpenRorW ( WCHAR* wcsPath )
00094 {
00095     // Try read write access (create if possible)
00096
00097     if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00098     {
00099         _hFile = CreateFile( wcsPath,
00100                              GENERIC_READ | GENERIC_WRITE,
00101                              FILE_SHARE_READ,
00102                              0, // security
00103                              OPEN_ALWAYS,
00104                              FILE_ATTRIBUTE_NORMAL,
00105                              0 ); // template
00106     }
00107     else // win95
00108     {
00109         // Worst case - size of multibyte == size of Unicode
00110         int nLen = (int) ( wcslen( wcsPath ) * 2 );
00111         char *pszPath = new char[nLen];
00112
00113         if ( pszPath == NULL )
00114         {
00115             _hFile = INVALID_HANDLE_VALUE;
00116         }
00117         else
00118         {
00119             if ( wcstombs( pszPath, wcsPath, nLen ) == -1 )
00120             {
00121                 _hFile = INVALID_HANDLE_VALUE;
00122             }
00123             else
00124             {
00125                 _hFile = CreateFileA( pszPath,
00126                                       GENERIC_READ | GENERIC_WRITE,
00127                                       FILE_SHARE_READ,
00128                                       0, // security
00129                                       OPEN_ALWAYS,
00130                                       FILE_ATTRIBUTE_NORMAL,
00131                                       0 ); // template
00132             }
00133             delete [] pszPath;
00134             pszPath = NULL;
00135         }
00136     }
00137
00138     if ( Ok() )
00139     {
00140         _fWrite = TRUE;
00141     }
00142     else
00143     {
00144         _fWrite = FALSE;
00145         // Try read only access
00146
00147         if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00148         {
00149             _hFile = CreateFile( wcsPath,
00150                                  GENERIC_READ,
00151                                  FILE_SHARE_READ | FILE_SHARE_WRITE,
00152                                  0, // security
00153                                  OPEN_EXISTING,
00154                                  FILE_ATTRIBUTE_NORMAL,
00155                                  0 ); // template
00156         }
00157         else // win95
00158         {
00159             // Worst case - size of multibyte == size of Unicode
00160             int nLen = (int) ( wcslen( wcsPath ) * 2 );
00161             char *pszPath = new char[nLen];
00162
00163             if ( pszPath == NULL )
00164             {
00165                 _hFile = INVALID_HANDLE_VALUE;
00166             }
00167             else
00168             {
00169                 if ( wcstombs( pszPath, wcsPath, nLen ) == -1 )
00170                 {
00171                     _hFile = INVALID_HANDLE_VALUE;
00172                 }
00173                 else
00174                 {
00175                     _hFile = CreateFileA( pszPath,
00176                                           GENERIC_READ,
00177                                           FILE_SHARE_READ | FILE_SHARE_WRITE,
00178                                           0, // security
00179                                           OPEN_EXISTING,
00180                                           FILE_ATTRIBUTE_NORMAL,
00181                                           0 ); // template
00182                 }
00183                 delete [] pszPath;
00184                 pszPath = NULL;
00185             }
00186         }
00187     }
00188
00189     if (Ok())
00190     {
00191         _sizeLow = GetFileSize ( _hFile, &_sizeHigh );
00192
00193         if (_sizeLow == 0xffffffff && GetLastError() != NO_ERROR)
00194         {
00195             Close();
00196             throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00197         }
00198
00199
00200         if (_fWrite )
00201         {
00202             CommonPageRound(_sizeLow, _sizeHigh);
00203         }
00204
00205         if ( _sizeLow != 0 || _sizeHigh != 0 )
00206         {
00207             if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00208             {
00209                 _hMap = CreateFileMapping( _hFile,
00210                                            0, // security
00211                                            _fWrite ? PAGE_READWRITE : PAGE_READONLY,
00212                                            _sizeHigh,
00213                                            _sizeLow,
00214                                            0 ); // name
00215             }
00216             else // windows 95
00217             {
00218                 _hMap = CreateFileMappingA( _hFile,
00219                                             0, // security
00220                                             _fWrite ? PAGE_READWRITE : PAGE_READONLY,
00221                                             _sizeHigh,
00222                                             _sizeLow,
00223                                             0 ); // name
00224             }
00225
00226             if (_hMap == NULL)
00227             {
00228                 Close();
00229                 throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00230             }
00231         }
00232     }
00233 }
00234
00235
00236 //+---------------------------------------------------------------------------
00237 //
00238 //  Function:   IsCreateExisting
00239 //
00240 //  Synopsis:   Tests if the error was a result of trying to create a
00241 //              file that already exists.
00242 //
00243 //  Arguments:  [Error]      --  Error returned by the system.
00244 //              [modeAccess] --  access mode specified to CreateFile.
00245 //              [modeCreate] --  create mode specified to CreateFile.
00246 //
00247 //  Returns:    TRUE if the failure is because of trying to create a "New"
00248 //              file with the same name as the one already existing.
00249 //              FALSE otherwise.
00250 //
00251 //----------------------------------------------------------------------------
00252
00253 BOOL IsCreateExisting( ULONG Error, ULONG modeAccess, ULONG modeCreate )
00254 {
00255     if ( (Error == ERROR_ALREADY_EXISTS || Error == ERROR_FILE_EXISTS) &&
00256          (modeAccess & GENERIC_WRITE) &&
00257          (modeCreate & CREATE_NEW) )
00258     {
00259        return TRUE;
00260     }
00261     else
00262     {
00263         return FALSE;
00264     }
00265 }
00266
00267
00268 //+-------------------------------------------------------------------------
00269 //
00270 //  Member:     CMmStream::Open, public
00271 //
00272 //  Synopsis:   Open stream
00273 //
00274 //  Arguments:  [path] - file path
00275 //              [modeAccess] -- access mode
00276 //              [modeShare] -- sharing mode
00277 //              [modeCreate] -- create mode
00278 //
00279 //--------------------------------------------------------------------------
00280
00281 void CMmStream::Open(
00282     const WCHAR* wcsPath,
00283     ULONG modeAccess,
00284     ULONG modeShare,
00285     ULONG modeCreate,
00286     ULONG modeAttribute)
00287 {
00288     _fWrite = FALSE;
00289
00290     if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00291     {
00292         _hFile = CreateFile( wcsPath,
00293                              modeAccess,
00294                              modeShare,
00295                              0, // security
00296                              modeCreate,
00297                              modeAttribute,
00298                              0 ); // template
00299     }
00300     else // win95
00301     {
00302         // Worst case - size of multibyte == size of Unicode
00303         int nLen = (int) ( wcslen( wcsPath ) * 2 );
00304         char *pszPath = new char[nLen];
00305
00306         if ( pszPath == NULL )
00307         {
00308             _hFile = INVALID_HANDLE_VALUE;
00309         }
00310         else
00311         {
00312             if ( wcstombs( pszPath, wcsPath, nLen ) == -1 )
00313             {
00314                 _hFile = INVALID_HANDLE_VALUE;
00315             }
00316             else
00317             {
00318                 _hFile = CreateFileA( pszPath,
00319                                       modeAccess,
00320                                       modeShare,
00321                                       0, // security
00322                                       modeCreate,
00323                                       modeAttribute,
00324                                       0 ); // template
00325             }
00326
00327             delete [] pszPath;
00328             pszPath = NULL;
00329         }
00330     }
00331
00332     if ( !Ok() )
00333     {
00334         //
00335         // If applicable, delete a zomby and re-create it.
00336         //
00337         if ( IsCreateExisting( GetLastError(), modeAccess, modeCreate ) )
00338         {
00339             htmlDebugOut(( DEB_ERROR, "CreateNew on %ws - already exists\n",
00340                          wcsPath ));
00341             modeCreate &= ~CREATE_NEW;   // Turn off the Create new flag
00342             modeCreate |= CREATE_ALWAYS; // Enable the CREATE_ALWAYS flag.
00343
00344             if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00345             {
00346                 _hFile = CreateFile( wcsPath,
00347                                      modeAccess,
00348                                      modeShare,
00349                                      0,          // security
00350                                      modeCreate,
00351                                      FILE_ATTRIBUTE_NORMAL,
00352                                      0 );        // template
00353             }
00354             else // win95
00355             {
00356                 // Worst case - size of multibyte == size of Unicode
00357                 int nLen = (int) wcslen( wcsPath );
00358                 char *pszPath = new char[nLen];
00359
00360                 if ( pszPath == NULL )
00361                 {
00362                     _hFile = INVALID_HANDLE_VALUE;
00363                 }
00364                 else
00365                 {
00366                     if ( wcstombs( pszPath, wcsPath, nLen ) == -1 )
00367                     {
00368                         _hFile = INVALID_HANDLE_VALUE;
00369                     }
00370                     else
00371                     {
00372                         _hFile = CreateFileA( pszPath,
00373                                               modeAccess,
00374                                               modeShare,
00375                                               0,          // security
00376                                               modeCreate,
00377                                               FILE_ATTRIBUTE_NORMAL,
00378                                               0 );        // template
00379                     }
00380                     delete [] pszPath;
00381                     pszPath = NULL;
00382                 }
00383             }
00384         }
00385     }
00386
00387     if ( Ok() )
00388     {
00389         _sizeLow = GetFileSize ( _hFile, &_sizeHigh );
00390
00391         if (_sizeLow == 0xffffffff && GetLastError() != NO_ERROR)
00392         {
00393             Close();
00394             htmlDebugOut (( DEB_ERROR, "Open stream %ws failed\n", wcsPath ));
00395             throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00396         }
00397
00398         if ( modeAccess & GENERIC_WRITE )
00399         {
00400             _fWrite = TRUE;
00401             CommonPageRound(_sizeLow, _sizeHigh);
00402             // Handle the case of OFS zero size files
00403             if (_sizeLow == 0 && _sizeHigh == 0)
00404             {
00405                 if ( SetFilePointer ( _hFile,
00406                                       COMMON_PAGE_SIZE,
00407                                       0,
00408                                       FILE_BEGIN ) == INVALID_SET_FILE_POINTER &&
00409                      GetLastError() != NO_ERROR )
00410                 {
00411                     Close();
00412                     htmlDebugOut(( DEB_ERROR,
00413                                  "CMmStream::Open -- SetFilePointer returned %d\n",
00414                                  GetLastError() ));
00415                     throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00416                 }
00417
00418                 if ( !SetEndOfFile( _hFile ) )
00419                 {
00420                     Close();
00421                     htmlDebugOut(( DEB_ERROR,
00422                                  "CMmStream::Open -- SetEndOfFile returned %d\n",
00423                                  GetLastError() ));
00424                     throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00425                 }
00426                 _sizeLow = COMMON_PAGE_SIZE;
00427             }
00428         }
00429
00430         if ( _sizeLow != 0 || _sizeHigh != 0 )
00431         {
00432             if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00433             {
00434                 _hMap = CreateFileMapping( _hFile,
00435                                            0, // security
00436                                            _fWrite ? PAGE_READWRITE : PAGE_READONLY,
00437                                            _sizeHigh,
00438                                            _sizeLow,
00439                                            0 ); // name
00440             }
00441             else // win95
00442             {
00443                 _hMap = CreateFileMappingA( _hFile,
00444                                             0, // security
00445                                             _fWrite ? PAGE_READWRITE : PAGE_READONLY,
00446                                             _sizeHigh,
00447                                             _sizeLow,
00448                                             0 ); // name
00449             }
00450
00451             if (_hMap == NULL)
00452             {
00453                 Close();
00454                 htmlDebugOut (( DEB_ERROR, "File mapping failed\n" ));
00455                 throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00456             }
00457         }
00458     }
00459     else
00460     {
00461         htmlDebugOut (( DEB_ITRACE, "Open failed on MM Stream; GetLastError()=0x%x\n",
00462                       GetLastError() ));
00463     }
00464 }
00465
00466 //+-------------------------------------------------------------------------
00467 //
00468 //  Member:     CMmStream::Close, public
00469 //
00470 //  Synopsis:   Create all handles
00471 //
00472 //--------------------------------------------------------------------------
00473
00474 void CMmStream::Close()
00475 {
00476     if (Ok())
00477     {
00478         if(_hMap )
00479         {
00480             if ( !CloseHandle(_hMap))
00481             {
00482                 htmlDebugOut (( DEB_ERROR, "Closing file mapping failed\n" ));
00483                 throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00484             }
00485             _hMap = 0;
00486         }
00487         if ( !CloseHandle ( _hFile ))
00488         {
00489
00490             htmlDebugOut (( DEB_ERROR, "Closing file handle failed\n" ));
00491             throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00492         }
00493         _hFile = INVALID_HANDLE_VALUE;
00494     }
00495 }
00496
00497 //+-------------------------------------------------------------------------
00498 //
00499 //  Member:     CMmStream::SetSize, public
00500 //
00501 //  Synopsis:   Increase the size of the (writable) file
00502 //
00503 //  Arguments:  [storage] -- storage (not used)
00504 //              [newSizeLow]  -- Low 32 bits of filesize
00505 //              [newSizeHigh] -- High 32 bits of filesize
00506 //
00507 //--------------------------------------------------------------------------
00508
00509 void CMmStream::SetSize ( PStorage& storage,
00510     ULONG newSizeLow, ULONG newSizeHigh )
00511 {
00512     if (_hMap != 0)
00513         CloseHandle(_hMap);
00514
00515     LARGE_INTEGER sizeOld = { _sizeLow, _sizeHigh };
00516     LARGE_INTEGER sizeNew = { newSizeLow, newSizeHigh };
00517
00518     if (sizeNew.QuadPart < sizeOld.QuadPart)
00519     {
00520         if ( SetFilePointer ( _hFile,
00521                               newSizeLow,
00522                               (long *)&newSizeHigh,
00523                               FILE_BEGIN ) == INVALID_SET_FILE_POINTER  &&
00524              GetLastError() != NO_ERROR )
00525         {
00526             htmlDebugOut(( DEB_ERROR,
00527                          "CMmStream::Close -- SetFilePointer returned %d\n",
00528                          GetLastError() ));
00529             throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00530         }
00531
00532         if ( !SetEndOfFile( _hFile ) )
00533         {
00534             htmlDebugOut(( DEB_ERROR,
00535                          "CMmStream::Close -- SetEndOfFile returned %d\n",
00536                          GetLastError() ));
00537             throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00538         }
00539
00540     }
00541
00542     if ( GetOSVersion() == VER_PLATFORM_WIN32_NT )
00543     {
00544         _hMap = CreateFileMapping( _hFile,
00545                                    0, // security
00546                                    PAGE_READWRITE,
00547                                    newSizeHigh,
00548                                    newSizeLow,
00549                                    0 ); // name
00550     }
00551     else // win95
00552     {
00553         _hMap = CreateFileMappingA( _hFile,
00554                                     0, // security
00555                                     PAGE_READWRITE,
00556                                     newSizeHigh,
00557                                     newSizeLow,
00558                                     0 ); // name
00559     }
00560
00561     if (_hMap == 0)
00562         throw ( CException(HRESULT_FROM_WIN32(GetLastError())));
00563
00564     _sizeLow = newSizeLow;
00565     _sizeHigh = newSizeHigh;
00566 }
00567
00568
00569 //+-------------------------------------------------------------------------
00570 //
00571 //  Member:     CMmStream::MapAll, public
00572 //
00573 //  Synopsis:   Create file mapping
00574 //
00575 //--------------------------------------------------------------------------
00576 void CMmStream::MapAll ( CMmStreamBuf& sbuf )
00577 {
00578     Win4Assert ( SizeHigh() == 0 );
00579     Map ( sbuf, SizeLow(), 0, 0 );
00580 }
00581
00582 //+-------------------------------------------------------------------------
00583 //
00584 //  Member:     CMmStream::Map, private
00585 //
00586 //  Synopsis:   Create file mapping
00587 //
00588 //  Arguments:  [cb] -- size of the mapped area
00589 //              [offLow] -- low part of file offset
00590 //              [offHigh] -- high part of file offset
00591 //
00592 //--------------------------------------------------------------------------
00593
00594 void CMmStream::Map ( CMmStreamBuf& sbuf,
00595                       ULONG cb, ULONG offLow, ULONG offHigh,
00596                       BOOL
00597                     )
00598 {
00599     Win4Assert ( _hMap != 0 );
00600
00601     if ( !_fWrite )
00602     {
00603         //
00604         // Adjust size to be min( cb, sizeoffile - off )
00605         //
00606
00607         LARGE_INTEGER size = { _sizeLow, _sizeHigh };
00608         LARGE_INTEGER off  = { offLow, offHigh };
00609         LARGE_INTEGER licb = { cb, 0 };
00610         LARGE_INTEGER diff;
00611
00612         diff.QuadPart = size.QuadPart - off.QuadPart;
00613
00614         if ( diff.QuadPart < licb.QuadPart )
00615         {
00616             cb = diff.LowPart;
00617             htmlDebugOut(( DEB_ITRACE,
00618                          "CMmStream::Map -- reducing map to 0x%x bytes\n",
00619                          cb ));
00620         }
00621     }
00622
00623     void* buf = MapViewOfFile (
00624             _hMap,
00625             _fWrite? FILE_MAP_WRITE: FILE_MAP_READ,
00626             offHigh,
00627             offLow,
00628             cb );
00629
00630     if ( 0 == buf )
00631     {
00632         htmlDebugOut(( DEB_ERROR,
00633                      "CMmStream::Map -- MapViewOfFile returned %d\n",
00634                      GetLastError() ));
00635         throw( CException( HRESULT_FROM_WIN32( GetLastError() ) ) );
00636     }
00637
00638     sbuf.SetBuf( buf );
00639     sbuf.SetSize ( cb );
00640     sbuf.SetStream ( this );
00641 }
00642
00643 //+-------------------------------------------------------------------------
00644 //
00645 //  Member:     CMmStream::Unmap, public
00646 //
00647 //  Synopsis:   Unmap the view of file
00648 //
00649 //--------------------------------------------------------------------------
00650
00651 void CMmStream::Unmap( CMmStreamBuf& sbuf )
00652 {
00653      if ( !UnmapViewOfFile(sbuf.Get()) )
00654      {
00655          htmlDebugOut(( DEB_ERROR, "UnmapViewOfFile returned %d\n",
00656                       GetLastError() ));
00657          throw( CException( HRESULT_FROM_WIN32( GetLastError() ) ) );
00658      }
00659
00660      sbuf.SetBuf ( 0 );
00661 }
00662
00663 //+-------------------------------------------------------------------------
00664 //
00665 //  Member:     CMmStream::Flush, public
00666 //
00667 //  Synopsis:   Flush the view back to disk
00668 //
00669 //--------------------------------------------------------------------------
00670
00671 void CMmStream::Flush( CMmStreamBuf& sbuf, ULONG cb )
00672 {
00673     FlushViewOfFile ( sbuf.Get(), cb );
00674 }
00675
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/Paint.c Source File

  • WinUI
  • Input
  • Ime
  • IMEApps

Paint.c

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      PAINT.C                                                       */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation                */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <imm.h>
00011 #include "resource.h"
00012 #include "imeapps.h"
00013
00014 #define DEBUG 1
00015
00016
00017
00018 void SetAttrColor(HDC hDC, BYTE bAttr)
00019 {
00020     switch (bAttr)
00021     {
00022         case ATTR_INPUT:
00023             SetTextColor(hDC,RGB(0,0,0));
00024             SetBkMode(hDC,TRANSPARENT);
00025             break;
00026
00027         case ATTR_TARGET_CONVERTED:
00028             SetTextColor(hDC,RGB(255,255,255));
00029             SetBkMode(hDC,OPAQUE);
00030             SetBkColor(hDC,RGB(0,0,255));
00031             break;
00032
00033         case ATTR_CONVERTED:
00034             SetTextColor(hDC,RGB(0,0,255));
00035             SetBkMode(hDC,TRANSPARENT);
00036             break;
00037
00038         case ATTR_TARGET_NOTCONVERTED:
00039             SetTextColor(hDC,RGB(255,255,255));
00040             SetBkMode(hDC,OPAQUE);
00041             SetBkColor(hDC,RGB(0,255,0));
00042             break;
00043
00044         case ATTR_INPUT_ERROR:
00045             SetTextColor(hDC,RGB(255,255,0));
00046             SetBkMode(hDC,TRANSPARENT);
00047             break;
00048
00049         case ATTR_FIXEDCONVERTED:
00050             SetTextColor(hDC,RGB(255,0,0));
00051             SetBkMode(hDC,TRANSPARENT);
00052             break;
00053
00054         default:
00055             SetTextColor(hDC,RGB(0,0,0));
00056             SetBkMode(hDC,TRANSPARENT);
00057             break;
00058     }
00059 }
00060
00061 LRESULT HandlePaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
00062 {
00063     HDC hDC = NULL;
00064     PAINTSTRUCT ps = {0};
00065     UINT i;
00066     int x = ORG_X;
00067     int y = ORG_Y;
00068     SIZE sz;
00069     HFONT hOldFont = NULL;
00070     HFONT hDefFont = GetStockObject(DEFAULT_GUI_FONT);
00071     int height,defheight;
00072     const char  szResult[] = "Result String";
00073     const char  szComp[] = "Composition String";
00074     RECT rc = {0};
00075
00076     GetClientRect(hWnd,&rc);
00077
00078     hDC = BeginPaint(hWnd, &ps);
00079
00080     if (hFont)
00081     {
00082         hOldFont = SelectObject(hDC,hDefFont);
00083     }
00084
00085
00086     // Get the height of the default gui font.
00087     GetTextExtentPoint(hDC,"A",1,&sz);
00088     defheight = sz.cy + 1;
00089
00090     // Get the height of the font.
00091     SelectObject(hDC,hFont);
00092     GetTextExtentPoint(hDC,"A",1,&sz);
00093     height = sz.cy + 1;
00094
00095     SelectObject(hDC,hDefFont);
00096     SetTextColor(hDC,RGB(0,0,0));
00097     SetBkMode(hDC,TRANSPARENT);
00098     TextOut(hDC,ORG_X,y,szResult,lstrlen(szResult));
00099     y += defheight;
00100
00101     if (Mylstrlen(szPaintResult))
00102     {
00103         x = ORG_X;
00104         SelectObject(hDC,hFont);
00105         SetTextColor(hDC,RGB(255,0,0));
00106         SetBkMode(hDC,TRANSPARENT);
00107 #ifdef USEWAPI
00108         TextOutW(hDC,x,y,szPaintResult,Mylstrlen(szPaintResult));
00109 #else
00110         TextOut(hDC,x,y,szPaintResult,Mylstrlen(szPaintResult));
00111 #endif
00112     }
00113
00114     y += height;
00115
00116     if (Mylstrlen(szPaintResultRead))
00117     {
00118         x = ORG_X;
00119         SelectObject(hDC,hFont);
00120         SetTextColor(hDC,RGB(255,0,0));
00121         SetBkMode(hDC,TRANSPARENT);
00122 #ifdef USEWAPI
00123         TextOutW(hDC,x,y,szPaintResultRead,Mylstrlen(szPaintResultRead));
00124 #else
00125         TextOut(hDC,x,y,szPaintResultRead,Mylstrlen(szPaintResultRead));
00126 #endif
00127     }
00128 #if 0
00129     if (dwResultReadStrLen)
00130     {
00131         x = ORG_X;
00132         SelectObject(hDC,hFont);
00133         SetTextColor(hDC,RGB(0,0,0));
00134         SetBkMode(hDC,TRANSPARENT);
00135
00136         if (dwResultReadClsLen)
00137         {
00138             dwResultReadCls[127] = 0;
00139             i = 1;
00140
00141             SetTextColor(hDC,RGB(255,0,0));
00142             while (dwResultReadCls[i] && dwResultReadCls[i-1] < dwResultReadStrLen)
00143             {
00144                 DWORD dwTextLen = dwResultReadCls[i] - dwResultReadCls[i-1];
00145                 LPSTR lpStart = szResultReadStr + dwResultReadCls[i-1];
00146
00147                 TextOut(hDC,x,y,lpStart,dwTextLen);
00148                 GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
00149                 x += sz.cx;
00150
00151                 TextOut(hDC,x,y,",",1);
00152                 GetTextExtentPoint(hDC,",",1,&sz);
00153                 x += (sz.cx + 2);
00154
00155                 i++;
00156             }
00157         }
00158         else
00159         {
00160             SetTextColor(hDC,RGB(255,0,0));
00161             SetBkMode(hDC,TRANSPARENT);
00162             TextOut(hDC,x,y,szResultReadStr,dwResultReadStrLen);
00163         }
00164
00165
00166     }
00167 #endif
00168
00169     y += height;
00170
00171     SelectObject(hDC,hDefFont);
00172     SetTextColor(hDC,RGB(0,0,0));
00173     SetBkMode(hDC,TRANSPARENT);
00174     TextOut(hDC,ORG_X,y,szComp,lstrlen(szComp));
00175     y += defheight;
00176
00177     if (dwCompStrLen)
00178     {
00179         x = ORG_X;
00180         SelectObject(hDC,hFont);
00181         SetTextColor(hDC,RGB(0,0,0));
00182
00183         if (dwCompClsLen && dwCompAttrLen)
00184         {
00185             dwCompCls[127] = 0;
00186             i = 1;
00187
00188             while (dwCompCls[i] && dwCompCls[i-1] < dwCompStrLen)
00189             {
00190                 DWORD dwTextLen = dwCompCls[i] - dwCompCls[i-1];
00191                 LPMYSTR lpStart = szCompStr + dwCompCls[i-1];
00192
00193                 SetAttrColor(hDC, bCompAttr[dwCompCls[i-1]]);
00194 #ifdef USEWAPI
00195                 TextOutW(hDC,x,y,lpStart,dwTextLen);
00196                 GetTextExtentPointW(hDC,lpStart,dwTextLen,&sz);
00197 #else
00198                 TextOut(hDC,x,y,lpStart,dwTextLen);
00199                 GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
00200 #endif
00201                 x += sz.cx;
00202
00203                 SetTextColor(hDC,RGB(0,0,0));
00204                 SetBkMode(hDC,TRANSPARENT);
00205 #ifdef USEWAPI
00206                 TextOutW(hDC,x,y,MYTEXT(","),1);
00207                 GetTextExtentPointW(hDC,MYTEXT(","),1,&sz);
00208 #else
00209                 TextOut(hDC,x,y,",",1);
00210                 GetTextExtentPoint(hDC,",",1,&sz);
00211 #endif
00212                 x += (sz.cx + 2);
00213
00214                 i++;
00215             }
00216         }
00217         else
00218         {
00219             SetBkMode(hDC,TRANSPARENT);
00220 #ifdef USEWAPI
00221             TextOutW(hDC,x,y,szCompStr,dwCompStrLen);
00222 #else
00223             TextOut(hDC,x,y,szCompStr,dwCompStrLen);
00224 #endif
00225         }
00226
00227     }
00228
00229     y += height;
00230
00231     if (dwCompReadStrLen)
00232     {
00233         x = ORG_X;
00234         SelectObject(hDC,hFont);
00235         SetTextColor(hDC,RGB(0,0,0));
00236         SetBkMode(hDC,TRANSPARENT);
00237
00238         if (dwCompReadClsLen && dwCompReadAttrLen)
00239         {
00240             dwCompReadCls[127] = 0;
00241             i = 1;
00242
00243             while (dwCompReadCls[i] && dwCompReadCls[i-1] < dwCompReadStrLen)
00244             {
00245                 DWORD dwTextLen = dwCompReadCls[i] - dwCompReadCls[i-1];
00246                 LPMYSTR lpStart = szCompReadStr + dwCompReadCls[i-1];
00247
00248                 SetAttrColor(hDC, bCompReadAttr[dwCompReadCls[i-1]]);
00249 #ifdef USEWAPI
00250                 TextOutW(hDC,x,y,lpStart,dwTextLen);
00251                 GetTextExtentPointW(hDC,lpStart,dwTextLen,&sz);
00252 #else
00253                 TextOut(hDC,x,y,lpStart,dwTextLen);
00254                 GetTextExtentPoint(hDC,lpStart,dwTextLen,&sz);
00255 #endif
00256                 x += sz.cx;
00257
00258                 SetTextColor(hDC,RGB(0,0,0));
00259                 SetBkMode(hDC,TRANSPARENT);
00260 #ifdef USEWAPI
00261                 TextOutW(hDC,x,y,MYTEXT(","),1);
00262                 GetTextExtentPointW(hDC,MYTEXT(","),1,&sz);
00263 #else
00264                 TextOut(hDC,x,y,",",1);
00265                 GetTextExtentPoint(hDC,",",1,&sz);
00266 #endif
00267                 x += (sz.cx + 2);
00268
00269                 i++;
00270             }
00271         }
00272         else
00273         {
00274             SetBkMode(hDC,TRANSPARENT);
00275 #ifdef USEWAPI
00276             TextOutW(hDC,x,y,szCompReadStr,dwCompReadStrLen);
00277 #else
00278             TextOut(hDC,x,y,szCompReadStr,dwCompReadStrLen);
00279 #endif
00280         }
00281
00282     }
00283
00284     y += height;
00285
00286     ptImeUIPos.y = y;
00287
00288     SelectObject(hDC,hOldFont);
00289     EndPaint(hWnd,&ps);
00290     return 1;
00291 }
00292
00293 LRESULT HandleCandPaint(HWND hWnd,WPARAM wParam, LPARAM lParam)
00294 {
00295     HDC hDC = NULL;
00296     PAINTSTRUCT ps = {0};
00297     UINT i;
00298     int x = ORG_X;
00299     int y = ORG_Y;
00300     SIZE sz;
00301     HFONT hOldFont = NULL;
00302     HFONT hDefFont = GetStockObject(DEFAULT_GUI_FONT);
00303     int height,defheight;
00304     LPDWORD lpdwOffset = NULL;
00305     RECT rect = {0};
00306     const char  szCand[] = "Candidate List";
00307     const char  szCandNull[] = "";
00308     const char  szCandRead[] = "Reading";
00309     const char  szCandCode[] = "Code";
00310     const char  szCandMean[] = "Meaning";
00311     const char  szCandRadi[] = "Radical";
00312     const char  szCandStrk[] = "Stroke";
00313
00314
00315     GetClientRect(hWnd,&rect);
00316
00317     hDC = BeginPaint(hWnd, &ps);
00318
00319     if (!lpCandList)
00320     {
00321         goto pt_cand_10;
00322     }
00323
00324     if (hFont)
00325     {
00326         hOldFont = SelectObject(hDC,hDefFont);
00327     }
00328
00329
00330     // Get the height of the default gui font.
00331     GetTextExtentPoint(hDC,"A",1,&sz);
00332     defheight = sz.cy + 1;
00333
00334     // Get the height of the font.
00335     SelectObject(hDC,hFont);
00336     GetTextExtentPoint(hDC,"A",1,&sz);
00337     height = sz.cy + 1;
00338
00339     SelectObject(hDC,hDefFont);
00340     SetTextColor(hDC,RGB(0,0,0));
00341     SetBkMode(hDC,TRANSPARENT);
00342     TextOut(hDC,ORG_X,y,szCand,lstrlen(szCand));
00343     y += defheight;
00344
00345     switch (lpCandList->dwStyle)
00346     {
00347         case IME_CAND_READ:
00348             TextOut(hDC,ORG_X,y,szCandRead,lstrlen(szCandRead));
00349             break;
00350
00351         case IME_CAND_CODE:
00352             TextOut(hDC,ORG_X,y,szCandCode,lstrlen(szCandCode));
00353             break;
00354
00355         case IME_CAND_MEANING:
00356             TextOut(hDC,ORG_X,y,szCandMean,lstrlen(szCandMean));
00357             break;
00358
00359         case IME_CAND_RADICAL:
00360             TextOut(hDC,ORG_X,y,szCandRadi,lstrlen(szCandRadi));
00361             break;
00362
00363         case IME_CAND_STROKE:
00364             TextOut(hDC,ORG_X,y,szCandStrk,lstrlen(szCandStrk));
00365             break;
00366
00367         default:
00368             break;
00369
00370     }
00371     y += defheight;
00372
00373     if (!lpCandList->dwCount)
00374     {
00375         goto pt_cand_10;
00376     }
00377
00378     lpdwOffset = &lpCandList->dwOffset[0];
00379
00380     lpdwOffset += lpCandList->dwPageStart;
00381
00382     for (i = lpCandList->dwPageStart;
00383          (i < lpCandList->dwCount) &&
00384          (i < lpCandList->dwPageStart + lpCandList->dwPageSize) &&
00385          (y <= rect.bottom + height); i++)
00386     {
00387         LPSTR lpstr = (LPSTR)lpCandList + *lpdwOffset++;
00388
00389         x = ORG_X;
00390
00391         SelectObject(hDC,hFont);
00392         if (i != lpCandList->dwSelection)
00393         {
00394             SetTextColor(hDC,RGB(0,0,0));
00395             SetBkMode(hDC,TRANSPARENT);
00396         }
00397         else
00398         {
00399             SetTextColor(hDC,RGB(255,255,255));
00400             SetBkColor(hDC,RGB(0,0,255));
00401             SetBkMode(hDC,OPAQUE);
00402         }
00403
00404         TextOut(hDC,x,y,lpstr,lstrlen(lpstr));
00405         y += height;
00406     }
00407
00408     SelectObject(hDC,hOldFont);
00409
00410 pt_cand_10:
00411     EndPaint(hWnd,&ps);
00412     return 1;
00413 }
00414
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/PrintJob/quecore.h Source File

  • Multimedia
  • Gdi
  • PrintJob

quecore.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 * PARTICULAR PURPOSE.
00006 *
00007 *  Copyright (C) 1999 - 2000  Microsoft Corporation.  All Rights Reserved.
00008 *
00009 *   FILE:   QueCore.H
00010 *
00011 *   PURPOSE:    Declares the core set of printer queue manipulation routines.
00012 *
00013 *   COMMENTS:   These functions are located in PrintJob.C
00014 *
00015 *   FUNCTIONS:
00016 *       MakeJobStatusStr () - Converts status bits in dwStatus into a string.
00017 *       Refresh() - Updates data structures and App window for the pQueue.
00018 *       RefreshFromNotification() - Updates the data and App Window given the
00019 *               pNotification.
00020 *       UpdateWindowTitle() - Sets the Window title appropriately from the pPd.
00021 *
00022 ******************************************************************************/
00023
00024 /* helper funcitons */
00025
00026 void    MakeJobStatusStr(char *szBuffer, short cchChars, DWORD dwStatus);
00027
00028 /* operations on printer queue data */
00029
00030 void    Refresh(HWND hWnd, QUEUEDATA *pQueue);
00031 BOOL    RefreshFromNotification(HWND hWnd, QUEUEDATA *pQueue, PRINTER_NOTIFY_INFO *pNotification);
00032 void    UpdateWindowTitle(HWND hWnd, QUEUEDATA *pPd);
00033
00034 /* end of header file QueCore.h */
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEditBoxLite Member List

This is the complete list of members for CEditBoxLite, including all inherited members.
CanPaste() | CEditBoxLite | [inline]
CEditBoxLite(HWND hWndParent=NULL, UINT nID=0) | CEditBoxLite |
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Copy() | CEditBoxLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CSplitterLite(HWND hWndParent=NULL, UINT nID=0) | CSplitterLite |
Cut() | CEditBoxLite | [inline]
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient) | CSplitterLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetLine(INDEX iLine, CHAR *pszBuffer, ULONG ulMaxSize) | CEditBoxLite |
GetLineCount() | CEditBoxLite | [inline]
GetSel(INDEX *piMin, INDEX *piMax) | CEditBoxLite | [inline, virtual]
GetSel(CHARRANGE *pcr) | CEditBoxLite | [inline, virtual]
GetTextRange(CHARRANGE &cr, WCHAR *pwszBuffer) | CEditBoxLite |
GetTextRange(CHARRANGE &cr, CHAR *pszBuffer) | CEditBoxLite |
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
LineIndex(INDEX nLine) | CEditBoxLite | [inline]
LineLength(INDEX nStartChar) | CEditBoxLite | [inline]
LineScroll(INDEX nLines, INDEX nChars=0) | CEditBoxLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hCursorOld | CSplitterLite |
m_hCursorRight | CSplitterLite |
m_hCursorTop | CSplitterLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iBorderCX | CSplitterLite |
m_iBorderCY | CSplitterLite |
m_nID | CWndLite |
m_pCWndBottom | CSplitterLite |
m_pCWndLeft | CSplitterLite |
m_pCWndRight | CSplitterLite |
m_pCWndTop | CSplitterLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnBorder(REFPOINTS pts, INT iBorder) | CSplitterLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CEditBoxLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
Paste() | CEditBoxLite | [inline]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
ReplaceAll(LPCWSTR pwszString, bool bReplaceAll=FALSE, bool fHighlight=FALSE) | CEditBoxLite | [virtual]
ReplaceSel(LPCWSTR pwszString, bool bCanUndo) | CEditBoxLite | [inline, virtual]
Save(LPCWSTR pwszFileName) | CEditBoxLite |
ScrollCaret() | CEditBoxLite | [inline]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetOptions(UINT dwOptions, UINT fOperation=ECOOP_OR) | CEditBoxLite | [inline]
SetReadOnly(bool bReadOnly) | CEditBoxLite | [inline]
SetSel(INDEX iMin, INDEX iMax) | CEditBoxLite | [inline, virtual]
SetSplitter(CSplitterLite *pCWndTop, CSplitterLite *pCWndBottom=NULL, CSplitterLite *pCWndLeft=NULL, CSplitterLite *pCWndRight=NULL) | CSplitterLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT *pPoint) | CSplitterLite | [virtual]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CEditBoxLite() | CEditBoxLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:56:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LicClien/UTCRUCAR.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • LicClien

UTCRUCAR.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTCRUCAR.CPP
00003
00004   Summary:   Implementation file for the aggregatable COUtilityCruiseCar
00005              COM object class.
00006
00007              UTCRUCAR showcases the construction of the COUtilityCruiseCar
00008              COM object class with the IUnknown, ICar, ICruise, and
00009              IUtility interfaces.  This is done through Aggregation reuse
00010              of COLicCruiseCar's ICar and ICruise interface features.
00011
00012              For a comprehensive tutorial code tour of this module's
00013              contents and offerings see the tutorial DLLCLIEN.HTM
00014              file.  For more specific technical details on the internal
00015              workings see the comments dispersed throughout the
00016              module's source code.
00017
00018   Classes:   COUtilityCruiseCar
00019
00020   Functions: CreateUtilityCruiseCar.
00021
00022   Origin:    10-5-95: atrent - Editor inheritance from DLLCLIEN source.
00023
00024 ----------------------------------------------------------------------------
00025   This file is part of the Microsoft COM Tutorial Code Samples.
00026
00027   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00028
00029   This source code is intended only as a supplement to Microsoft
00030   Development Tools and/or on-line documentation.  See these other
00031   materials for detailed information regarding Microsoft code samples.
00032
00033   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00034   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00035   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00036   PARTICULAR PURPOSE.
00037 ==========================================================================+*/
00038
00039 /*---------------------------------------------------------------------------
00040   We include WINDOWS.H for all Win32 applications.
00041   We include OLE2.H because we will be calling the COM/OLE Libraries.
00042   We include OLECTL.H because we will using IClassFactory2.
00043   We include APPUTIL.H because we will be building this application using
00044     the convenient Virtual Window and Dialog classes and other
00045     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00046   We include ICARS.H and CARGUIDS.H for the common car-related Interface
00047     class, GUID, and CLSID specifications.
00048   We include LICCLIEN.H to support this module's use of trace logging.
00049   We include UTCRUCAR.H because it has the COUtilityCruiseCar declarations.
00050 ---------------------------------------------------------------------------*/
00051 #include <windows.h>
00052 #include <ole2.h>
00053 #include <olectl.h>
00054 #include <apputil.h>
00055 #include <icars.h>
00056 #include <carguids.h>
00057 #include "licclien.h"
00058 #include "utcrucar.h"
00059
00060
00061 /*---------------------------------------------------------------------------
00062   COUtilityCruiseCar's implementation of its main COM object class including
00063   Constructor, Destructor, QueryInterface, AddRef, and Release.
00064 ---------------------------------------------------------------------------*/
00065
00066 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00067   Method:   COUtilityCruiseCar::COUtilityCruiseCar
00068
00069   Summary:  COUtilityCruiseCar Constructor. Note the member initializer:
00070             "m_ImpIUtility(this, pUnkOuter)" which is used to pass the 'this'
00071             and pUnkOuter pointers of this constructor function to the
00072             constructor in the instantiation of the implementation of
00073             the CImpIUtility interface (which is nested inside this present
00074             COUtilityCruiseCar Object Class).
00075
00076   Args:     IUnknown* pUnkOuter)
00077               Pointer to the the outer Unknown.  NULL means this COM Object
00078               is not being Aggregated.  Non NULL means it is being created
00079               on behalf of an outside COM object that is reusing it via
00080               aggregation.
00081
00082   Modifies: m_cRefs, m_pUnkOuter, m_pUnkCruiseCar.
00083
00084   Returns:  void
00085 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00086 COUtilityCruiseCar::COUtilityCruiseCar(
00087   IUnknown* pUnkOuter) :
00088   m_ImpIUtility(this, pUnkOuter)
00089 {
00090   // Zero the COM object's reference count.
00091   m_cRefs = 0;
00092
00093   // No AddRef necessary if non-NULL, as this COM object's lifetime
00094   // is totally coupled with the controlling Outer object's lifetime.
00095   m_pUnkOuter = pUnkOuter;
00096
00097   // Zero the pointer to the aggregated COLicCruiseCar object's IUnknown
00098   // interface (for delegation of IUnknown calls to it).
00099   m_pUnkCruiseCar = NULL;
00100
00101   LOGF1("C: COUtilityCruiseCar Constructor. m_pUnkOuter=0x%X.", m_pUnkOuter);
00102
00103   return;
00104 }
00105
00106
00107 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00108   Method:   COUtilityCruiseCar::~COUtilityCruiseCar
00109
00110   Summary:  COUtilityCruiseCar Destructor.
00111
00112   Args:     void
00113
00114   Modifies: .
00115
00116   Returns:  void
00117 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00118 COUtilityCruiseCar::~COUtilityCruiseCar(void)
00119 {
00120   LOG("C: COUtilityCruiseCar::Destructor.");
00121
00122   RELEASE_INTERFACE(m_pUnkCruiseCar);
00123
00124   return;
00125 }
00126
00127
00128 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00129   Method:   COUtilityCruiseCar::Init
00130
00131   Summary:  COUtilityCruiseCar Initialization method.
00132
00133   Args:     BSTR bstrLicKey
00134               Runtime license key string.
00135
00136   Modifies: m_pUnkCruiseCar, m_pICar, m_pICruise, m_cRefs.
00137
00138   Returns:  HRESULT
00139               Standard result code. NOERROR for success.
00140 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00141 HRESULT COUtilityCruiseCar::Init(
00142           BSTR bstrLicKey)
00143 {
00144   HRESULT hr;
00145   IClassFactory2* pICF2LicCruiseCar;
00146
00147   // Set up the right pIUnknown for delegation.  If we are being
00148   // aggregated then we pass the pUnkOuter in turn to any COM objects
00149   // that we are aggregating.  m_pUnkOuter was set in the Constructor.
00150   IUnknown* pUnkOuter = (NULL == m_pUnkOuter) ? this : m_pUnkOuter;
00151
00152   LOG("C: COUtilityCruiseCar::Init.");
00153
00154   // Get a class factory for LicCruiseCar and issue IClassFactory's
00155   // CreateInstance method to manufacture a COLicCruiseCar COM object.
00156   hr = CoGetClassObject(
00157          CLSID_LicCruiseCar,
00158          CLSCTX_INPROC_SERVER,
00159          NULL,
00160          IID_IClassFactory2,
00161          (PPVOID)&pICF2LicCruiseCar);
00162   if (SUCCEEDED(hr))
00163   {
00164     LOG("C: COUtilityCruiseCar::Init IClassFactory2 obtained.");
00165     hr = pICF2LicCruiseCar->CreateInstanceLic(
00166                               pUnkOuter,
00167                               NULL,
00168                               IID_IUnknown,
00169                               bstrLicKey,
00170                               (PPVOID)&m_pUnkCruiseCar);
00171     pICF2LicCruiseCar->Release();
00172     if (SUCCEEDED(hr))
00173     {
00174       LOG("C: COUtilityCruiseCar::Init Created LicCruiseCar using License Key.");
00175     }
00176     else
00177     {
00178       LOG("C: COUtilityCruiseCar::Init Unable to Create LicCruiseCar.");
00179     }
00180   }
00181
00182   if (SUCCEEDED(hr))
00183   {
00184     LOG("C: COUtilityCruiseCar::Init Succeeded.");
00185   }
00186   else
00187   {
00188     LOG("C: COUtilityCruiseCar::Init Failed.");
00189   }
00190
00191   return (hr);
00192 }
00193
00194
00195 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00196   Method:   COUtilityCruiseCar::QueryInterface
00197
00198   Summary:  QueryInterface of the COUtilityCruiseCar non-delegating
00199             IUnknown implementation.
00200
00201   Args:     REFIID riid,
00202               [in] GUID of the Interface being requested.
00203             PPVOID ppv)
00204               [out] Address of the caller's pointer variable that will
00205               receive the requested interface pointer.
00206
00207   Modifies: .
00208
00209   Returns:  HRESULT
00210 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00211 STDMETHODIMP COUtilityCruiseCar::QueryInterface(
00212                REFIID riid,
00213                PPVOID ppv)
00214 {
00215   HRESULT hr = E_NOINTERFACE;
00216   *ppv = NULL;
00217
00218   if (IID_IUnknown == riid)
00219   {
00220     *ppv = this;
00221     LOG("C: COUtilityCruiseCar::QueryInterface. 'this' pIUnknown returned.");
00222   }
00223   else if (IID_IUtility == riid)
00224   {
00225     // This IUtility interface is implemented in this COUtilityCruiseCar
00226     // object as a native interface of COUtilityCruiseCar.
00227     *ppv = &m_ImpIUtility;
00228     LOG("C: COUtilityCruiseCar::QueryInterface. pIUtility returned.");
00229   }
00230
00231   if (NULL != *ppv)
00232   {
00233     // We've handed out a pointer to an interface so obey the COM rules
00234     //   and AddRef its reference count.
00235     ((LPUNKNOWN)*ppv)->AddRef();
00236     hr = NOERROR;
00237   }
00238   else if (IID_ICar == riid)
00239   {
00240     LOG("C: COUtilityCruiseCar::QueryInterface. ICar delegating.");
00241     // We didn't implement the ICar interface in this COUtilityCruiseCar
00242     // object.  The aggregated inner object (LicCruiseCar) is contributing
00243     // the ICar interface to this present composite or aggregating
00244     // UtilityCruiseCar object.  So, to satisfy a QI request for the ICar
00245     // interface, we delegate the QueryInterface to the inner
00246     // object's IUnknown.
00247     hr = m_pUnkCruiseCar->QueryInterface(riid, ppv);
00248   }
00249   else if (IID_ICruise == riid)
00250   {
00251     LOG("C: COUtilityCruiseCar::QueryInterface. ICruise delegating.");
00252     // We didn't implement the ICruise interface in this COUtilityCruiseCar
00253     // object.  The aggregated inner object (LicCruiseCar) is contributing
00254     // the ICruise interface to this present composite or aggregating
00255     // UtilityCruiseCar object.  As above we delegate this QI to the
00256     // aggregated object's IUnknown.
00257     hr = m_pUnkCruiseCar->QueryInterface(riid, ppv);
00258   }
00259
00260   return (hr);
00261 }
00262
00263
00264 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00265   Method:   COUtilityCruiseCar::AddRef
00266
00267   Summary:  AddRef of the COUtilityCruiseCar non-delegating
00268             IUnknown implementation.
00269
00270   Args:     void
00271
00272   Modifies: m_cRefs.
00273
00274   Returns:  ULONG
00275               New value of m_cRefs (COM object's reference count).
00276 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00277 STDMETHODIMP_(ULONG) COUtilityCruiseCar::AddRef(void)
00278 {
00279   m_cRefs++;
00280
00281   LOGF1("C: COUtilityCruiseCar::AddRef. New cRefs=%i.", m_cRefs);
00282
00283   return m_cRefs;
00284 }
00285
00286
00287 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00288   Method:   COUtilityCruiseCar::Release
00289
00290   Summary:  Release of the COUtilityCruiseCar non-delegating IUnknown
00291             implementation.
00292
00293   Args:     void
00294
00295   Modifies: m_cRefs.
00296
00297   Returns:  ULONG
00298               New value of m_cRefs (COM object's reference count).
00299 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00300 STDMETHODIMP_(ULONG) COUtilityCruiseCar::Release(void)
00301 {
00302   ULONG ulCount = --m_cRefs;
00303
00304   LOGF1("C: COUtilityCruiseCar::Release. New cRefs=%i.", m_cRefs);
00305
00306   if (0 == m_cRefs)
00307   {
00308     // We artificially bump the main ref count.  Thie fulfills one of
00309     // the rules of aggregated objects and ensures that an indirect
00310     // recursive call to this release won't occur because of other
00311     // delegating releases that might happen in our own destructor.
00312     m_cRefs++;
00313     delete this;
00314   }
00315
00316   return ulCount;
00317 }
00318
00319
00320 /*---------------------------------------------------------------------------
00321   COUtilityCruiseCar's nested implementation of the IUtility interface
00322   including methods: Constructor, Destructor, QueryInterface, AddRef,
00323   Release, Offroad, and Winch.
00324 ---------------------------------------------------------------------------*/
00325
00326 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00327   Method:   COUtilityCruiseCar::CImpIUtility::CImpIUtility
00328
00329   Summary:  Constructor for the CImpIUtility interface instantiation.
00330
00331   Args:     COUtilityCruiseCar* pBackObj,
00332               Back pointer to the parent outer object.
00333             IUnknown* pUnkOuter)
00334               Pointer to the outer Unknown.  For delegation.
00335
00336   Modifies: m_cRefI, m_pBackObj, m_pUnkOuter.
00337
00338   Returns:  void
00339 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00340 COUtilityCruiseCar::CImpIUtility::CImpIUtility(
00341   COUtilityCruiseCar* pBackObj,
00342   IUnknown* pUnkOuter)
00343 {
00344   // Init the Interface Ref Count (used for debugging only).
00345   m_cRefI = 0;
00346
00347   // Init the Back Object Pointer to point to the outer object.
00348   m_pBackObj = pBackObj;
00349
00350   // Init the CImpIUtility interface's delegating IUnknown pointer.  We use
00351   // the Back Object pointer for IUnknown delegation here if we are not
00352   // being aggregated.  If we are being aggregated we use the supplied
00353   // pUnkOuter for IUnknown delegation.  In either case the pointer
00354   // assignment requires no AddRef because the CImpIUtility lifetime is
00355   // quaranteed by the lifetime of the parent object in which
00356   // CImpIUtility is nested.
00357   if (NULL == pUnkOuter)
00358   {
00359     m_pUnkOuter = pBackObj;
00360     LOG("C: COUtilityCruiseCar::CImpIUtility Constructor. Non-Aggregating.");
00361   }
00362   else
00363   {
00364     m_pUnkOuter = pUnkOuter;
00365     LOG("C: COUtilityCruiseCar::CImpIUtility Constructor. Aggregating.");
00366   }
00367
00368   return;
00369 }
00370
00371
00372 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00373   Method:   COUtilityCruiseCar::CImpIUtility::~CImpIUtility
00374
00375   Summary:  Destructor for the CImpIUtility interface instantiation.
00376
00377   Args:     void
00378
00379   Modifies: .
00380
00381   Returns:  void
00382 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00383 COUtilityCruiseCar::CImpIUtility::~CImpIUtility(void)
00384 {
00385   LOG("C: COUtilityCruiseCar::CImpIUtility Destructor.");
00386
00387   return;
00388 }
00389
00390
00391 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00392   Method:   COUtilityCruiseCar::CImpIUtility::QueryInterface
00393
00394   Summary:  The QueryInterface IUnknown member of this IUtility interface
00395             implementation that delegates to m_pUnkOuter, whatever it is.
00396
00397   Args:     REFIID riid,
00398               [in] GUID of the Interface being requested.
00399             PPVOID ppv)
00400               [out] Address of the caller's pointer variable that will
00401               receive the requested interface pointer.
00402
00403   Modifies: .
00404
00405   Returns:  HRESULT
00406               Returned by the delegated outer QueryInterface call.
00407 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00408 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::QueryInterface(
00409                REFIID riid,
00410                PPVOID ppv)
00411 {
00412   LOG("C: COUtilityCruiseCar::CImpIUtility::QueryInterface. Delegating.");
00413
00414   // Delegate this call to the outer object's QueryInterface.
00415   return m_pUnkOuter->QueryInterface(riid, ppv);
00416 }
00417
00418
00419 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00420   Method:   COUtilityCruiseCar::CImpIUtility::AddRef
00421
00422   Summary:  The AddRef IUnknown member of this IUtility interface
00423             implementation that delegates to m_pUnkOuter, whatever it is.
00424
00425   Args:     void
00426
00427   Modifies: m_cRefI.
00428
00429   Returns:  ULONG
00430               Returned by the delegated outer AddRef call.
00431 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00432 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::AddRef(void)
00433 {
00434   // Increment the Interface Reference Count.
00435   ++m_cRefI;
00436
00437   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Addref. Delegating. New cI=%i.", m_cRefI);
00438
00439   // Delegate this call to the outer object's AddRef.
00440   return m_pUnkOuter->AddRef();
00441 }
00442
00443
00444 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00445   Method:   COUtilityCruiseCar::CImpIUtility::Release
00446
00447   Summary:  The Release IUnknown member of this IUtility interface
00448             implementation that delegates to m_pUnkOuter, whatever it is.
00449
00450   Args:     void
00451
00452   Modifies: .
00453
00454   Returns:  ULONG
00455               Returned by the delegated outer Release call.
00456 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00457 STDMETHODIMP_(ULONG) COUtilityCruiseCar::CImpIUtility::Release(void)
00458 {
00459   // Decrement the Interface Reference Count.
00460   --m_cRefI;
00461
00462   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Release. Delegating. New cI=%i.", m_cRefI);
00463
00464   // Delegate this call to the outer object's Release.
00465   return m_pUnkOuter->Release();
00466 }
00467
00468
00469 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00470   Method:   COUtilityCruiseCar::CImpIUtility::Offroad
00471
00472   Summary:  The Offroad member method of this IUtility interface
00473             implementation.  A simple empty method on a COUtilityCruiseCar
00474             COM object for tutorial purposes.  Presumably if this
00475             UtilityCruise Car object were modeling a real Car then the
00476             Offroad method would function the 4-wheel drive transfer case
00477             and shift it to the specified 4-wheel drive mode.
00478
00479   Args:     short nGear
00480               0 = 2H or regular 2-wheel drive;
00481               1 = 4H or 4-wheel drive high speed;
00482               2 = neutral; and
00483               3 = 4L or 4-wheel drive low speed).
00484
00485   Modifies: .
00486
00487   Returns:  HRESULT
00488               NOERROR
00489 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00490 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Offroad(
00491                short nGear)
00492 {
00493   HRESULT hr;
00494   ICar* pICar = NULL;
00495
00496   // In our fantasy Sport-Utility Car world we may need to stop the car
00497   // before switching to 4-Wheel drive low (nGear == 3 for 4L). Let's
00498   // assume so because it's a convenient excuse to show this aggregating
00499   // COUtilityCruiseCar outer object using one of the interfaces (ICar)
00500   // of its aggregated COLicCruiseCar inner object.  LICCLIEN gracefully
00501   // cooperates in this by invoking this Offroad method from the
00502   // UtilityCruiseCar menu with nGear == 3.
00503   if (3 == nGear)
00504   {
00505     hr = m_pBackObj->m_pUnkCruiseCar->QueryInterface(
00506                                         IID_ICar,
00507                                         (PPVOID)&pICar);
00508     if (SUCCEEDED(hr))
00509     {
00510       m_pUnkOuter->Release();
00511       pICar->Speed(0);
00512       m_pUnkOuter->AddRef();
00513       pICar->Release();
00514     }
00515   }
00516
00517   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Offroad. Called. nGear=%i.",nGear);
00518
00519   return NOERROR;
00520 }
00521
00522
00523 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00524   Method:   COUtilityCruiseCar::CImpIUtility::Winch
00525
00526   Summary:  The Adjust member method of this IUtility interface
00527             implementation.  A simple empty method on a COUtilityCruiseCar
00528             COM object for tutorial purposes.  Presumably if this
00529             UtilityCruiseCar object were modeling a real Car then the
00530             Winch method would turn on/off the front-mounted Winch to the
00531             specified RPMs.
00532
00533   Args:     short nRpm
00534               0 = off; 1 - 50 RPM.
00535
00536   Modifies: .
00537
00538   Returns:  HRESULT
00539               NOERROR
00540 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00541 STDMETHODIMP COUtilityCruiseCar::CImpIUtility::Winch(
00542                short nRpm)
00543 {
00544   LOGF1("C: COUtilityCruiseCar::CImpIUtility::Winch. Called. nRpm=%i.",nRpm);
00545
00546   return NOERROR;
00547 }
00548
00549
00550 /*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F
00551   Function: CreateUtilityCruiseCar
00552
00553   Summary:  Creates an instance of the COUtilityCruiseCar COM object class
00554             returning a requested interface pointer. COUtilityCruiseCar
00555             uses the Aggregation reuse technique to incorporate
00556             COLicCruiseCar features (ie, ICar and ICruise implementations)
00557             into its Interface offerings (ie, IUnknown, and IUtility).
00558             With this aggregation, the ICar and ICruise interfaces are not
00559             implemented in COUtilityCruiseCar.  They are instead solely
00560             implemented in a COLicCruiseCar object that
00561             CreateUtilityCruiseCar instantiates.  That COLicCruiseCar's ICar
00562             and ICruise implementations are used directly in this
00563             aggregation.  COLicCruiseCar is provided as a licensed component
00564             by the outside LICSERVE.DLL server.
00565
00566   Args:     IUnknown* pUnkOuter,
00567               Pointer the outer Unknown interface.  Non NULL implies
00568               that the new COM object is being created via an
00569               aggregation with an Outer object.  NULL implies that the
00570               object is not being created via aggregation.
00571             REFIID riid,
00572               The GUID of the interface requested on the new COM Object.
00573             PPVOID ppv)
00574               Address of the caller's pointer variable that will
00575               receive the requested interface pointer.
00576
00577   Returns:  HRESULT
00578               NOERROR if successful, CLASS_E_NOAGREGATION if IUnknown is
00579               not requested with non-NULL pUnkOuter, or other errors as
00580               appropriate.
00581 F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/
00582 HRESULT CreateUtilityCruiseCar(
00583           IUnknown* pUnkOuter,
00584           REFIID riid,
00585           BSTR bstrLicKey,
00586           PPVOID ppv)
00587 {
00588   HRESULT hr;
00589   COUtilityCruiseCar* pCob;
00590
00591   LOGF1("C: CreateUtilityCruiseCar. pUnkOuter=0x%X.",pUnkOuter);
00592
00593   // If the creation call is requesting aggregation (pUnkOuter != NULL),
00594   // the COM rules state the IUnknown interface MUST also be concomitantly
00595   // requested.  If it is not so requested ( riid != IID_IUnknown) then
00596   // an error must be returned indicating that no aggregate creation of
00597   // the COUtilityCruiseCar COM Object can be performed using anything
00598   // other than a controlling IUnknown interface.
00599   if (NULL != pUnkOuter && riid != IID_IUnknown)
00600     hr = CLASS_E_NOAGGREGATION;
00601   else
00602   {
00603     // Instantiate a COUtilityCruiseCar COM Object.
00604     pCob = new COUtilityCruiseCar(pUnkOuter);
00605     if (NULL != pCob)
00606     {
00607       // If we have succeeded in instantiating the COUtilityCruiseCar object
00608       // we initialize it to offer it's interfaces.
00609       hr = pCob->Init(bstrLicKey);
00610       if (SUCCEEDED(hr))
00611       {
00612         // We QueryInterface this new COM Object not only to deposit the
00613         // main interface pointer to the caller's pointer variable, but to
00614         // also automatically bump the Reference Count on the new COM
00615         // Object after handing out this *ppv reference to it.
00616         hr = pCob->QueryInterface(riid, (PPVOID)ppv);
00617       }
00618     }
00619     else
00620       hr = E_OUTOFMEMORY;
00621   }
00622
00623   if (SUCCEEDED(hr))
00624   {
00625     LOGF1("C: CreateUtilityCruiseCar Succeeded. *ppv=0x%X.",*ppv);
00626   }
00627   else
00628   {
00629     LOG("C: CreateUtilityCruiseCar Failed.");
00630   }
00631
00632   return hr;
00633 }
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/delebase.h Source File

  • SysMgmt
  • MMC
  • ActiveX

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CComponent;
00030 class CComponentData;
00031
00032 class CDelegationBase {
00033 public:
00034     CDelegationBase();
00035     virtual ~CDelegationBase();
00036
00037     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00038     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00039
00040     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00041     virtual const int GetBitmapIndex() = 0;
00042
00043     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00044
00045 public:
00046     virtual HRESULT AddImages(IImageList *pImageList, HSCOPEITEM hsi);
00047     virtual HRESULT Expand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
00048     virtual HRESULT Select(IConsole *pConsole, BOOL bScope, BOOL bSelect) { return S_FALSE; }
00049     virtual HRESULT Show(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
00050     virtual HRESULT ShowContextHelp(IConsole *pConsole, IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile) { return S_FALSE; }
00051
00052     virtual HRESULT InitOCX(IUnknown *pUnknown) { return S_FALSE; }
00053
00054 public:
00055     void SetComponentData(CComponentData *pComponentData) { m_pComponentData = pComponentData; }
00056
00057     HBITMAP m_pBMapSm;
00058     HBITMAP m_pBMapLg;
00059
00060 protected:
00061     void LoadBitmaps() {
00062         m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
00063         m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
00064     }
00065
00066     BOOL bExpanded;
00067
00068 private:
00069     // {2974380B-4C4B-11d2-89D8-000021473128}
00070     static const GUID thisGuid;
00071
00072 public:
00073     CComponentData *m_pComponentData;
00074 };
00075
00076 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/DimmerService.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

DimmerService.h

Go to the documentation of this file.
00001 // DimmerService.h : Declaration of the CDimmerService
00002
00003 #ifndef __DIMMERSERVICE_H_
00004 #define __DIMMERSERVICE_H_
00005
00006 #include "resource.h"       // main symbols
00007 #import "C:\UPnPSample\SDKDimmer\DimmerDevice\StepByStep\Step2\Debug\upnphost.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
00008
00009 /////////////////////////////////////////////////////////////////////////////
00010 // CDimmerService
00011 class ATL_NO_VTABLE CDimmerService :
00012   public CComObjectRootEx<CComMultiThreadModel>,
00013   //public CComCoClass<CDimmerService, &CLSID_DimmerService>,
00014   //public IDispatchImpl<IDimmerService, &IID_IDimmerService, &LIBID_MYDEVICELib>,
00015   public IUPnPEventSource,
00016     public IDispatchImpl<IUPnPService_DimmingService_SCPD, &IID_IUPnPService_DimmingService_SCPD, &LIBID_MYDEVICELib>
00017   //public IUPnPService_DimmingService_SCPD
00018 {
00019 public:
00020   CDimmerService();
00021   ~CDimmerService();
00022    // IUPnPService_DimmingService_SCPD methods (i.e. Dimming Service Methods)
00023     STDMETHOD (get_Power) (VARIANT_BOOL *pval);
00024   STDMETHOD (get_dimLevel) (LONG *dLevel);
00025
00026     STDMETHOD (PowerOn) ();
00027     STDMETHOD (PowerOff) ();
00028
00029     STDMETHOD (GetPowerValue) (VARIANT_BOOL *powerVal);
00030
00031   STDMETHOD (SetDimLevel) (LONG dLevel);
00032   STDMETHOD (GetDimLevel) (LONG *dLevel);
00033   STDMETHOD (GetConfigDetails) (VARIANT_BOOL *powerVal,LONG *dLevel);
00034
00035    // IUPnPEventSource methods
00036     STDMETHOD (Advise) (IUPnPEventSink *punkSubscriber);
00037     STDMETHOD (Unadvise) (IUPnPEventSink *punkSubscriber);
00038
00039 private:
00040     VARIANT_BOOL power;
00041   LONG dimnessLevel;
00042     IUPnPEventSink *esEventingManager;
00043
00044   //to synchronise between multiple requests for the same action
00045     CRITICAL_SECTION csSync;
00046 //DECLARE_REGISTRY_RESOURCEID(IDR_DIMMERSERVICE)
00047
00048 //DECLARE_PROTECT_FINAL_CONSTRUCT()
00049
00050 BEGIN_COM_MAP(CDimmerService)
00051   //COM_INTERFACE_ENTRY(IDimmerService)
00052   COM_INTERFACE_ENTRY(IDispatch)
00053   COM_INTERFACE_ENTRY(IUPnPEventSource)
00054   COM_INTERFACE_ENTRY(IUPnPService_DimmingService_SCPD)
00055 END_COM_MAP()
00056
00057
00058 };
00059
00060 #endif //__DIMMERSERVICE_H_
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/WinHlprs/cwindow.Cxx Source File

  • Com
  • Fundamentals
  • WinHlprs

cwindow.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright Microsoft Corporation.
00005 //
00006 //  File:       cwindow.cxx
00007 //
00008 //  Contents:   implementation for a window class
00009 //
00010 //  Classes:    CHlprWindow
00011 //
00012 //  Functions:  WindowProc
00013 //
00014 //  History:    4-12-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #include "cwindow.h"
00019
00020 //+---------------------------------------------------------------------------
00021 //
00022 //  Member:     CHlprWindow::Create
00023 //
00024 //  Synopsis:   Special version of CreateWindow.
00025 //
00026 //  Arguments:  [lpszClassName]  - address of registered class name
00027 //              [lpszWindowName] - address of window name
00028 //              [dwStyle]        - window style
00029 //              [x]              - horizontal position of window
00030 //              [y]              - vertical position of window
00031 //              [nWidth]         - window width
00032 //              [nHeight]        - window height
00033 //              [hwndParent]     - handle of parent or owner window
00034 //              [hmenu]          - handle of menu, or child window identifier
00035 //              [hinst]          - handle of application instance
00036 //
00037 //  Returns:    HWND of the created window
00038 //
00039 //  Modifies:   _hwnd, _hInstance
00040 //
00041 //  History:    4-12-94   stevebl   Created
00042 //
00043 //  Notes:      The window class must have been previously registered (as
00044 //              is normal Windows procedure) and the callback function
00045 //              must have been registered as ::WindowProc.  ::WindowProc will
00046 //              then forward all messages on to the CHlprWindow::WindowProc
00047 //              method, allowing the window to directly access class members
00048 //              (i.e. giving the WindowProc access to the "this" pointer).
00049 //
00050 //----------------------------------------------------------------------------
00051
00052 HWND CHlprWindow::Create(
00053     LPCTSTR lpszClassName,
00054     LPCTSTR lpszWindowName,
00055     DWORD dwStyle,
00056     int x,
00057     int y,
00058     int nWidth,
00059     int nHeight,
00060     HWND hwndParent,
00061     HMENU hmenu,
00062     HINSTANCE hinst)
00063 {
00064     _hInstance = hinst;
00065     return(_hwnd =
00066         CreateWindow(
00067             lpszClassName,
00068             lpszWindowName,
00069             dwStyle,
00070             x,
00071             y,
00072             nWidth,
00073             nHeight,
00074             hwndParent,
00075             hmenu,
00076             hinst,
00077             this));
00078 }
00079
00080 //+---------------------------------------------------------------------------
00081 //
00082 //  Function:   WindowProc
00083 //
00084 //  Synopsis:   Standard WindowProc that forwards Windows messages on to the
00085 //              CHlprWindow::WindowProc method.
00086 //
00087 //  Arguments:  [hwnd]   - window handle
00088 //              [uMsg]   - message
00089 //              [wParam] - first message parameter
00090 //              [lParam] - second message parameter
00091 //
00092 //  History:    4-12-94   stevebl   Created
00093 //
00094 //  Notes:      This Window procedure expects that it will receive a "this"
00095 //              pointer as the lpCreateParams member passed as part of the
00096 //              WM_CREATE message.  It saves the "this" pointer in the
00097 //              GWL_USERDATA field of the window structure.
00098 //
00099 //----------------------------------------------------------------------------
00100
00101 LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00102 {
00103     CHlprWindow * pw;
00104     switch (uMsg)
00105     {
00106     case WM_CREATE:
00107         // Since this is the first time that we can get ahold of
00108         // a pointer to the window class object, all messages that might
00109         // have been sent before this are never seen by the Windows object
00110         // and only get passed on to te DefWindowProc
00111
00112         // get a pointer to the window class object
00113         pw = (CHlprWindow *) ((CREATESTRUCT *)lParam)->lpCreateParams;
00114         // set its USERDATA DWORD to point to the class object
00115         SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) pw);
00116         // Set it's protected _hwnd member variable to ensure that
00117         // member functions have access to the correct window handle.
00118         pw->_hwnd = hwnd;
00119         break;
00120     case WM_DESTROY:
00121         // This is our signal to destroy the window class object.
00122
00123         pw = (CHlprWindow *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
00124         SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
00125         delete pw;
00126         pw = (CHlprWindow *) 0;
00127         break;
00128     default:
00129         // get a pointer to the window class object
00130         pw = (CHlprWindow *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
00131         break;
00132     }
00133     // and call its message proc method
00134     if (pw != (CHlprWindow *) 0)
00135     {
00136         return(pw->WindowProc(uMsg, wParam, lParam));
00137     }
00138     else
00139     {
00140         return(DefWindowProc(hwnd, uMsg, wParam, lParam));
00141     }
00142 }
00143
00144
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/dataobj.h Source File

  • SysMgmt
  • MMC
  • CutCopy

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097 BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
00098
00099 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

RSProxy Member List

This is the complete list of members for RSProxy, including all inherited members.
BUFFER_SIZE | RSProxy | [package, static]
C_REQUEST | RSProxy | [package, static]
C_RESPONSE | RSProxy | [package, static]
cancelRequest(String requestId) | RSProxy | [inline]
destroy() | RSProxy | [inline]
E_FAIL | RSProxy | [package, static]
endResponse() | RSProxy | [inline]
EXPECTED_MAX_CONCURRENT_CALLS | RSProxy | [package, static]
findRequest(String requestID) | RSProxy | [inline, protected]
getAppletInfo() | RSProxy | [inline]
getData() | RSProxy | [inline]
getInteger(Object obj) | RSProxy | [inline, private]
getMessage() | RSProxy | [inline]
getObject(int integer) | RSProxy | [inline, private]
getRequestID() | RSProxy | [inline]
getStatus() | RSProxy | [inline]
handleResponse(Object[] request, Object[] response) | RSProxy | [inline, protected]
hasResponse() | RSProxy | [inline]
init() | RSProxy | [inline]
insertRequest(Object[] request) | RSProxy | [inline, protected]
insertResponse(Object[] response) | RSProxy | [inline, protected]
m_requestHead | RSProxy | [private]
m_requestLock | RSProxy | [private]
m_responseHead | RSProxy | [private]
m_responseLock | RSProxy | [private]
m_responseTail | RSProxy | [private]
newDataResponse(String requestID, String data, boolean finished) | RSProxy | [inline, protected]
newErrorResponse(String requestID, String message) | RSProxy | [inline, protected]
newRequest(String requestID, String url_context, String url, int mode) | RSProxy | [inline, protected]
paint(Graphics g) | RSProxy | [inline]
removeRequest(Object[] request) | RSProxy | [inline, protected]
removeResponse() | RSProxy | [inline, protected]
REQUEST_ID | RSProxy | [package, static]
REQUEST_MODE | RSProxy | [package, static]
REQUEST_MODE_COMPLETE | RSProxy | [package, static]
REQUEST_MODE_PARTIAL | RSProxy | [package, static]
REQUEST_NEXT | RSProxy | [package, static]
REQUEST_PREV | RSProxy | [package, static]
REQUEST_THREAD | RSProxy | [package, static]
REQUEST_URL | RSProxy | [package, static]
REQUEST_URLCONTEXT | RSProxy | [package, static]
RESPONSE_DATA | RSProxy | [package, static]
RESPONSE_MESSAGE | RSProxy | [package, static]
RESPONSE_NEXT | RSProxy | [package, static]
RESPONSE_REQUESTID | RSProxy | [package, static]
RESPONSE_STATUS | RSProxy | [package, static]
RSProxy() | RSProxy | [inline]
run() | RSProxy | [inline]
runUrlDownloadThread(String requestID) | RSProxy | [inline, protected]
S_COMPLETED | RSProxy | [package, static]
S_PARTIAL | RSProxy | [package, static]
S_PENDING | RSProxy | [package, static]
start() | RSProxy | [inline]
startRequest(String requestID, String url_context, String url, int mode) | RSProxy | [inline]
stop() | RSProxy | [inline]
waitForResponse() | RSProxy | [inline]
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CutCopy/registry.h Source File

  • SysMgmt
  • MMC
  • CutCopy

registry.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __Registry_H__
00020 #define __Registry_H__
00021
00022 #include <tchar.h>
00023
00024 // This function will register a component in the Registry.
00025 // The component calls this function from its DllRegisterServer function.
00026 HRESULT RegisterServer(HMODULE hModule,
00027                        const CLSID& clsid,
00028                        const _TCHAR* szFriendlyName) ;
00029
00030 // This function will unregister a component.  Components
00031 // call this function from their DllUnregisterServer function.
00032 HRESULT UnregisterServer(const CLSID& clsid) ;
00033
00034
00035 // This function will register a Snap-In component.  Components
00036 // call this function from their DllRegisterServer function.
00037 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00038                        const _TCHAR* szNameString,   // NameString
00039                        const CLSID& clsidAbout,   // Class Id for About Class
00040                        const BOOL fSupportExtensions = FALSE);
00041
00042 HRESULT UnregisterSnapin(const CLSID& clsid);         // Class ID
00043
00044 #endif
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/LogWriter/LogWriter.Idl Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest
  • LogWriter

LogWriter.Idl

Go to the documentation of this file.
00001 // LogWriter.idl : IDL source for LogWriter.dll
00002 //
00003
00004 // This file will be processed by the MIDL tool to
00005 // produce the type library (LogWriter.tlb) and marshalling code.
00006
00007 import "oaidl.idl";
00008 import "ocidl.idl";
00009   [
00010     object,
00011     uuid(702886C0-088C-11D3-A115-0080C71F306F),
00012     dual,
00013     helpstring("ILogFile Interface"),
00014     pointer_default(unique)
00015   ]
00016   interface ILogFile : IDispatch
00017   {
00018     HRESULT Write([in] BSTR buf, [in] DWORD dwID);
00019   };
00020
00021 [
00022   uuid(450CC2A0-088C-11D3-A115-0080C71F306F),
00023   version(1.0),
00024   helpstring("LogWriter 1.0 Type Library")
00025 ]
00026 library LOGWRITERLib
00027 {
00028   importlib("stdole32.tlb");
00029   importlib("stdole2.tlb");
00030
00031   [
00032     uuid(702886C1-088C-11D3-A115-0080C71F306F),
00033     helpstring("LogFile Class")
00034   ]
00035   coclass LogFile
00036   {
00037     [default] interface ILogFile;
00038   };
00039 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/Inc/IBALL.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • Inc

IBALL.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      IBALL.H
00003
00004   Summary:   This is the common include file for the Ball-related COM
00005              Interfaces.  The Interface abstract base classes are
00006              declared.
00007
00008              This file is global to all the Tutorial Code Samples (kept in
00009              the ..\INC directory).  It is a good practice to factor out
00010              Interface and GUID specifications to reduce the possibility
00011              of GUID or interface conflicts.
00012
00013   Classes:   IBall, IBallSink.
00014
00015   Functions: none
00016
00017   Origin:    5-30-96: atrent - Revised for the COM Tutorial Samples.
00018
00019 ----------------------------------------------------------------------------
00020   This file is part of the Microsoft COM Tutorial Code Samples.
00021
00022   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00023
00024   This source code is intended only as a supplement to Microsoft
00025   Development Tools and/or on-line documentation.  See these other
00026   materials for detailed information regarding Microsoft code samples.
00027
00028   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00029   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00030   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00031   PARTICULAR PURPOSE.
00032 ==========================================================================+*/
00033
00034 #if !defined(IBALL_H)
00035 #define IBALL_H
00036
00037 #if !defined(RC_INCLUDE)
00038
00039
00040 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00041   Interface: IBall
00042
00043   Summary:   Interface for moving Ball-like COM Objects.
00044
00045   Methods:   Reset
00046                Init and reset the ball.
00047              Move
00048                Move the ball.
00049              GetBall
00050                Obtain the ball's current position, extent, and color.
00051 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00052 DECLARE_INTERFACE_(IBall, IUnknown)
00053 {
00054   // IUnknown methods.
00055   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
00056   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
00057   STDMETHOD_(ULONG,Release) (THIS) PURE;
00058
00059   // IBall methods.
00060   STDMETHOD(Reset)      (THIS_ RECT*, SHORT) PURE;
00061   STDMETHOD(Move)       (THIS_ BOOL) PURE;
00062   STDMETHOD(GetBall)    (THIS_ POINT*, POINT*, COLORREF*) PURE;
00063 };
00064
00065
00066 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00067   Interface: IBallSink
00068
00069   Summary:   Sink Connection Interface for Ball-like COM Objects that
00070              communicate events back to the client.
00071
00072   Methods:   BounceBottom
00073                The virtual ball hit the bottom edge of its bounding
00074                rectangle and bounced.
00075              BounceLeft
00076                The virtual ball hit the left edge of its bounding
00077                rectangle and bounced.
00078              BounceRight
00079                The virtual ball hit the right edge of its bounding
00080                rectangle and bounced.
00081              BounceTop
00082                The virtual ball hit the top edge of its bounding
00083                rectangle and bounced.
00084 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00085 DECLARE_INTERFACE_(IBallSink, IUnknown)
00086 {
00087   // IUnknown methods.
00088   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
00089   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
00090   STDMETHOD_(ULONG,Release) (THIS) PURE;
00091
00092   // IBallSink methods.
00093   STDMETHOD(BounceBottom)   (THIS) PURE;
00094   STDMETHOD(BounceLeft)     (THIS) PURE;
00095   STDMETHOD(BounceRight)    (THIS) PURE;
00096   STDMETHOD(BounceTop)      (THIS) PURE;
00097 };
00098
00099
00100 #endif // RC_INCLUDE
00101
00102 #endif // IBALL_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Playlist/dlldatax.h Source File

  • Multimedia
  • WindowsMediaServices9
  • Playlist

dlldatax.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            dlldatax.h
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #if !defined(AFX_DLLDATAX_H__62AB32B9_6F62_495D_885F_F293714921A9__INCLUDED_)
00013 #define AFX_DLLDATAX_H__62AB32B9_6F62_495D_885F_F293714921A9__INCLUDED_
00014
00015 #if _MSC_VER > 1000
00016 #pragma once
00017 #endif // _MSC_VER > 1000
00018
00019 #ifdef _MERGE_PROXYSTUB
00020
00021 extern "C"
00022 {
00023 BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason,
00024   LPVOID lpReserved);
00025 STDAPI PrxDllCanUnloadNow(void);
00026 STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv);
00027 STDAPI PrxDllRegisterServer(void);
00028 STDAPI PrxDllUnregisterServer(void);
00029 }
00030
00031 #endif
00032
00033 //{{AFX_INSERT_LOCATION}}
00034 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00035
00036 #endif // !defined(AFX_DLLDATAX_H__62AB32B9_6F62_495D_885F_F293714921A9__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SecPrint/SecPrint.c Source File

  • Security
  • Authorization
  • SecPrint

SecPrint.c

Go to the documentation of this file.
00001 /*++
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1997 - 2002 Microsoft Corporation.  All Rights Reserved.
00008
00009 SecPrint.C
00010
00011 This sample illustrates how to use the low-level access control APIs to
00012 add permissions to a printer.
00013
00014 Note that the specific combination of parameters shown below are not the only
00015 possible combination to set on a printer object. The combination below is the
00016 only combination, however, that will be recognized by the printer control panel
00017 as security privileges that correspond to "print access", "manage documents",
00018 "manage printer", and "full control" (and "no access" on NT4 or earlier.)
00019
00020 Command line arguments: <printer name> <user name> <p|md|mp|f> [d]
00021
00022         where P  = Print access
00023               MD = Manage documents
00024               MP = Manage printers
00025               F  = Full control <P + MD + MP>
00026
00027 Use <D> to deny specified access to the specified
00028 group or user (otherwise specified access is granted.)
00029
00030 Note: On NT4 or earlier denied 'Full Control' is displayed
00031 as 'No Access' by the Explorer Printer Permissions dialog.
00032 Denying P, MD, or MP on NT4 or earlier will not be viewable
00033 using this dialog eventhough the DACL is valid.
00034
00035 David Mowers (davemo)   1-Jun-98
00036 David McPherson (davemm)   11-Jun-99 (Fixup, Demo Open/Get/SetPrinter, SEH)
00037
00038 --*/
00039 #define UNICODE
00040 #define _UNICODE
00041 #include <windows.h>
00042 #include <stdio.h>
00043 #include <tchar.h>
00044
00045 #define ACCESS_DENY 1
00046 #define ACCESS_ALLOW 2
00047
00048 //
00049 //  FUNCTION: GetPrinterDACL
00050 //
00051 //  PURPOSE: Obtains DACL from specified printer
00052 //
00053 //  RETURN VALUE:
00054 //       TRUE or FALSE
00055 //
00056 //  COMMENTS:
00057 //
00058 BOOL GetPrinterDACL(LPTSTR szPrinterName, PACL *ppACL)
00059 {
00060    HANDLE            hPrinter = NULL;
00061    PPRINTER_INFO_3   pPrnInfo3 = NULL;
00062    PRINTER_DEFAULTS  PrnDefs;
00063    DWORD             cbNeeded = 0;
00064    DWORD             cbBuf = 0;
00065    BOOL              bDaclPres;
00066    BOOL              bDef;
00067    BOOL              bRes = FALSE;
00068    ACL_SIZE_INFORMATION AclInfo;
00069    PACL              pACL = NULL;
00070
00071    PrnDefs.DesiredAccess = READ_CONTROL;
00072    PrnDefs.pDatatype = NULL;
00073    PrnDefs.pDevMode = NULL;
00074
00075    __try
00076    {
00077       if (!OpenPrinter(szPrinterName, &hPrinter, &PrnDefs))
00078          __leave;
00079
00080       // Call GetPrinter twice to get size of printer info structure.
00081
00082       while (!GetPrinter(hPrinter, 3, (LPBYTE)pPrnInfo3, cbBuf, &cbNeeded))
00083       {
00084          if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
00085          {
00086             cbBuf = cbNeeded;
00087             pPrnInfo3 = LocalAlloc(LPTR, cbNeeded);
00088             if (pPrnInfo3 == NULL)
00089                     __leave;
00090          }
00091          else
00092             __leave;
00093       }
00094
00095       if (!GetPrinter(hPrinter, 3, (LPBYTE)pPrnInfo3, cbBuf, &cbNeeded))
00096          __leave;
00097
00098       if (!GetSecurityDescriptorDacl(pPrnInfo3->pSecurityDescriptor,
00099                                        &bDaclPres, &pACL, &bDef))
00100          __leave;
00101
00102       if (!GetAclInformation(pACL, &AclInfo,
00103                             sizeof(ACL_SIZE_INFORMATION), AclSizeInformation))
00104          __leave;
00105
00106
00107           // The caller just needs the DACL. So, make a copy of the DACL for the
00108           // caller and free the printer info structure. The caller must free
00109           // the allocated memory for this DACL copy.
00110
00111       *ppACL = LocalAlloc(LPTR, AclInfo.AclBytesInUse);
00112       if (*ppACL == NULL)
00113          __leave;
00114
00115       memcpy(*ppACL, pACL, AclInfo.AclBytesInUse);
00116
00117       bRes = TRUE;
00118    }
00119
00120    __finally
00121    {
00122       if (pPrnInfo3 != NULL) LocalFree((HLOCAL)pPrnInfo3);
00123       if (hPrinter != NULL) ClosePrinter(hPrinter);
00124    }
00125
00126    return bRes;
00127 }
00128
00129 //
00130 //  FUNCTION: SetPrinterDACL
00131 //
00132 //  PURPOSE: Applies DACL to specified printer
00133 //
00134 //  RETURN VALUE:
00135 //       TRUE or FALSE
00136 //
00137 //  COMMENTS:
00138 //
00139 BOOL SetPrinterDACL(LPTSTR szPrinterName, PACL pDacl)
00140 {
00141    HANDLE               hPrinter = NULL;
00142    PRINTER_INFO_3       pi3;
00143    PRINTER_DEFAULTS     PrnDefs;
00144    SECURITY_DESCRIPTOR  NewSD;
00145    BOOL                 bRes = FALSE;
00146
00147    PrnDefs.DesiredAccess = READ_CONTROL|WRITE_DAC;
00148    PrnDefs.pDatatype = NULL;
00149    PrnDefs.pDevMode = NULL;
00150    pi3.pSecurityDescriptor = &NewSD;
00151
00152
00153    __try
00154    {
00155       if (!OpenPrinter(szPrinterName, &hPrinter, &PrnDefs))
00156          __leave;
00157
00158       if (!InitializeSecurityDescriptor(&NewSD, SECURITY_DESCRIPTOR_REVISION))
00159          __leave;
00160
00161       if (!SetSecurityDescriptorDacl(&NewSD, TRUE, pDacl, FALSE))
00162          __leave;
00163
00164       if (!SetPrinter(hPrinter, 3, (LPBYTE)&pi3, 0))
00165          __leave;
00166
00167       bRes = TRUE;
00168    }
00169
00170    __finally
00171    {
00172       if (hPrinter != NULL) ClosePrinter(hPrinter);
00173    }
00174
00175    return bRes;
00176 }
00177
00178 //
00179 //  FUNCTION: AddAccessRights
00180 //
00181 //  PURPOSE: Applies ACE for access to specified object DACL
00182 //
00183 //  RETURN VALUE:
00184 //       TRUE or FALSE
00185 //
00186 //  COMMENTS:
00187 //
00188 BOOL AddAccessRights(LPTSTR szPrinterName,
00189                       DWORD dwAccessMask,
00190                       BYTE bAceFlags,
00191                       LPTSTR szUserName,
00192                       BYTE bType)
00193 {
00194    // User Name and Sid variables
00195    PSID           pSid = NULL;
00196    DWORD          cbSid = 0;
00197    LPTSTR         szDomainName = NULL;
00198    DWORD          cbDomainName = 0;
00199    SID_NAME_USE   SidType;
00200
00201    // ACL variables
00202    PACL                 pACL = NULL;
00203    ACL_SIZE_INFORMATION AclInfo;
00204    DWORD                dwNewAceCount = 0;
00205
00206    // New ACL variables
00207    PACL  pNewACL = NULL;
00208    DWORD dwNewACLSize;
00209
00210    // Temporary ACE
00211    PACCESS_ALLOWED_ACE  pTempAce; // structure is same for access denied ace
00212    UINT                 CurrentAceIndex;
00213
00214    __try
00215    {
00216       // Call LookupAccountName twice, once to just get buffer sizes
00217
00218       while (!LookupAccountName(NULL, szUserName, pSid, &cbSid,
00219                                  szDomainName, &cbDomainName, &SidType))
00220       {
00221          if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
00222          {
00223             pSid = LocalAlloc(LPTR, cbSid);
00224             szDomainName = LocalAlloc(LPTR, (cbDomainName * sizeof(TCHAR)));
00225             if (pSid == NULL || szDomainName == NULL)
00226             {
00227                _tprintf(TEXT("LocalAlloc failed\n"));
00228                __leave;
00229             }
00230          }
00231          else
00232          {
00233             _tprintf(TEXT("Error %d - LookupAccountName\n"), GetLastError());
00234             __leave;
00235          }
00236       }
00237
00238       _tprintf(TEXT("Adding ACE for %s\n"), szUserName);
00239
00240       // Get security DACL for printer
00241
00242       if (!GetPrinterDACL(szPrinterName, &pACL))
00243       {
00244          _tprintf(TEXT("Error %d getting printer DACL\n"), GetLastError());
00245          __leave;
00246       }
00247
00248       // Compute size needed for the new ACL
00249
00250       if (pACL)  // Get size of old ACL
00251       {
00252          if (!GetAclInformation(pACL, &AclInfo, sizeof(ACL_SIZE_INFORMATION),
00253             AclSizeInformation))
00254          {
00255             _tprintf(TEXT("Error %d: GetAclInformation\n"), GetLastError());
00256             __leave;
00257          }
00258       }
00259
00260       if (pACL)  // Add room for new ACEs
00261       {
00262          dwNewACLSize = AclInfo.AclBytesInUse +
00263                         sizeof(ACCESS_ALLOWED_ACE) +
00264                         GetLengthSid(pSid) - sizeof(DWORD);
00265       }
00266       else
00267       {
00268          dwNewACLSize = sizeof(ACCESS_ALLOWED_ACE) +
00269                         sizeof(ACL) +
00270                         GetLengthSid(pSid) - sizeof(DWORD);
00271       }
00272
00273       // Allocate and setup ACL.
00274
00275       pNewACL = (PACL)LocalAlloc(LPTR, dwNewACLSize);
00276       if (pNewACL == NULL)
00277       {
00278          _tprintf(TEXT("LocalAlloc failed.\n"));
00279          __leave;
00280       }
00281
00282       if (!InitializeAcl(pNewACL, dwNewACLSize, ACL_REVISION2))
00283       {
00284          _tprintf(TEXT("Error %d: InitializeAcl\n"),GetLastError());
00285          __leave;
00286       }
00287
00288       // If new ACE is Access Denied ACE add it to front of new ACL
00289
00290       if (bType == ACCESS_DENY)
00291       {
00292          // Add the access-denied ACE to the new DACL
00293          if (!AddAccessDeniedAce(pNewACL, ACL_REVISION2, dwAccessMask, pSid))
00294          {
00295             _tprintf(TEXT("Error %d: AddAccessDeniedAce\n"), GetLastError());
00296             __leave;
00297          }
00298
00299          dwNewAceCount++;
00300
00301          // get pointer to ace we just added, so we can change the AceFlags
00302
00303          if (!GetAce(pNewACL,
00304                      0, // we know it is the first ace in the Acl
00305                      &pTempAce))
00306          {
00307             _tprintf(TEXT("Error %d: GetAce\n"), GetLastError());
00308             __leave;
00309          }
00310
00311          pTempAce->Header.AceFlags = bAceFlags;
00312       }
00313
00314       // If a DACL was present, copy the resident ACEs to the new DACL
00315
00316       if (pACL)
00317       {
00318          // Copy the file's old ACEs to our new ACL
00319
00320          if (AclInfo.AceCount)
00321          {
00322             for (CurrentAceIndex = 0; CurrentAceIndex < AclInfo.AceCount;
00323                                                          CurrentAceIndex++)
00324             {
00325                // Get an ACE
00326
00327                if (!GetAce(pACL, CurrentAceIndex, &pTempAce))
00328                {
00329                   _tprintf(TEXT("Error %d: GetAce\n"), GetLastError());
00330                   __leave;
00331                }
00332
00333                // Check to see if this ACE is identical to one were adding.
00334                // If it is identical don't copy it over.
00335                if (!EqualSid((PSID)&(pTempAce->SidStart),pSid) ||
00336                    (pTempAce->Mask != dwAccessMask)            ||
00337                    (pTempAce->Header.AceFlags != bAceFlags))
00338                {
00339                   // ACE is distinct, add it to the new ACL
00340
00341                   if (!AddAce(pNewACL, ACL_REVISION, MAXDWORD, pTempAce,
00342                      ((PACE_HEADER)pTempAce)->AceSize))
00343                   {
00344                      _tprintf(TEXT("Error %d: AddAce\n"), GetLastError());
00345                      __leave;
00346                   }
00347
00348                   dwNewAceCount++;
00349                }
00350             }
00351          }
00352       }
00353
00354       // If the new ACE is an Access allowed ACE add it at the end.
00355
00356       if (bType == ACCESS_ALLOW)
00357       {
00358          // Add the access-allowed ACE to the new DACL
00359
00360          if (!AddAccessAllowedAce(pNewACL, ACL_REVISION2, dwAccessMask, pSid))
00361          {
00362             _tprintf(TEXT("Error %d: AddAccessAllowedAce\n"), GetLastError());
00363             __leave;
00364          }
00365
00366          // Get pointer to ACE we just added, so we can change the AceFlags
00367
00368          if (!GetAce(pNewACL,
00369                      dwNewAceCount, // Zero based position of the last ace
00370                      &pTempAce))
00371          {
00372             _tprintf(TEXT("Error %d: GetAce\n"), GetLastError());
00373             __leave;
00374          }
00375
00376          pTempAce->Header.AceFlags = bAceFlags;
00377       }
00378
00379       // Set the DACL to the object
00380
00381       if (!SetPrinterDACL(szPrinterName, pNewACL))
00382       {
00383          _tprintf(TEXT("Error %d setting printer DACL\n"), GetLastError());
00384          __leave;
00385       }
00386    }
00387
00388    __finally
00389    {
00390       // Free the memory allocated for the old and new ACL and user info
00391       if (pACL != NULL) LocalFree((HLOCAL)pACL);
00392       if (pNewACL != NULL) LocalFree((HLOCAL)pNewACL);
00393       if (pSid != NULL) LocalFree(pSid);
00394       if (szDomainName != NULL) LocalFree(szDomainName);
00395    }
00396
00397    return(TRUE);
00398 }
00399
00400 void _tmain(INT argc, TCHAR *argv[])
00401 {
00402    BOOL bDeny = FALSE;
00403
00404    if (argc < 4)
00405    {
00406       _tprintf(TEXT("USAGE: %s <printer name> <user name> <P|MD|MP|F> [D]\n"), argv[0]);
00407       _tprintf(TEXT(" Where P  = Print access\n"));
00408       _tprintf(TEXT("       MD = Manage documents\n"));
00409       _tprintf(TEXT("       MP = Manage printers\n"));
00410       _tprintf(TEXT("       F  = Full control <P + MD + MP>\n"));
00411       _tprintf(TEXT("\nUse <D> to deny specified access to the specified\n"));
00412       _tprintf(TEXT("group or user (otherwise specified access is granted.)\n"));
00413       _tprintf(TEXT("\nNote: On NT4 or earlier denied 'Full Control' is displayed\n"));
00414       _tprintf(TEXT("as 'No Access' by the Explorer Printer Permissions dialog.\n"));
00415       _tprintf(TEXT("Denying P, MD, or MP on NT4 or earlier will not be viewable\n"));
00416       _tprintf(TEXT("using this dialog eventhough the DACL is valid.\n"));
00417
00418       exit(0);
00419    }
00420
00421    if (argc >= 5 && (lstrcmpi(argv[4], TEXT("d")) == 0))
00422       bDeny = TRUE;
00423
00424    if (!lstrcmpi(argv[3], TEXT("p")))
00425    {
00426       // Add an ACL for "Print" access
00427
00428       if (!AddAccessRights(argv[1],
00429                            PRINTER_EXECUTE,
00430                            CONTAINER_INHERIT_ACE,
00431                            argv[2],
00432                            (BYTE)(bDeny ? ACCESS_DENY : ACCESS_ALLOW)))
00433
00434          _tprintf(TEXT("Error Adding Access Rights\n"));
00435    }
00436
00437    else if (!lstrcmpi(argv[3], TEXT("f")))
00438    {
00439       // Add ACLs for "Full Control" access
00440
00441       if (!AddAccessRights(argv[1],
00442                            GENERIC_ALL,
00443                            OBJECT_INHERIT_ACE | INHERIT_ONLY_ACE,
00444                            argv[2],
00445                            (BYTE)(bDeny ? ACCESS_DENY : ACCESS_ALLOW)))
00446
00447          _tprintf(TEXT("Error Adding Access Rights\n"));
00448
00449       if (!AddAccessRights(argv[1],
00450                            PRINTER_ALL_ACCESS,
00451                            CONTAINER_INHERIT_ACE,
00452                            argv[2],
00453                            (BYTE)(bDeny ? ACCESS_DENY : ACCESS_ALLOW)))
00454
00455          _tprintf(TEXT("Error Adding Access Rights\n"));
00456    }
00457
00458    else if (!lstrcmpi(argv[3], TEXT("md")))
00459    {
00460       // Add ACLs for "Manage Documents" access
00461
00462       if (!AddAccessRights(argv[1],
00463                            GENERIC_ALL,
00464                            OBJECT_INHERIT_ACE | INHERIT_ONLY_ACE,
00465                            argv[2],
00466                            (BYTE)(bDeny ? ACCESS_DENY : ACCESS_ALLOW)))
00467
00468          _tprintf(TEXT("Error Adding Access Rights\n"));
00469
00470       if (!AddAccessRights(argv[1],
00471                            READ_CONTROL,
00472                            CONTAINER_INHERIT_ACE,
00473                            argv[2],
00474                            (BYTE)(bDeny ? ACCESS_DENY : ACCESS_ALLOW)))
00475
00476          _tprintf(TEXT("Error Adding Access Rights\n"));
00477    }
00478    else if (!lstrcmpi(argv[3], TEXT("mp")))
00479    {
00480       // Add ACLs for "Manage Printers" access
00481
00482       if (!AddAccessRights(argv[1],
00483                            PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE,
00484                            0,
00485                            argv[2],
00486                            (BYTE)(bDeny ? ACCESS_DENY : ACCESS_ALLOW)))
00487
00488          _tprintf(TEXT("Error Adding Access Rights\n"));
00489    }
00490    else
00491       _tprintf(TEXT("Unknown Access type\n"));
00492 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/PropProv/ClassFac.Cpp Source File

  • SysMgmt
  • WMI
  • VC
  • PropProv

ClassFac.Cpp

Go to the documentation of this file.
00001 //***************************************************************************
00002
00003 //
00004
00005 //  CLASSFAC.CPP
00006
00007 //
00008
00009 //  Module: WMI Sample Property Provider
00010
00011 //
00012
00013 //  Purpose: Contains the class factory.  This creates objects when
00014
00015 //           connections are requested.
00016
00017 //
00018
00019 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00020 //
00021 //***************************************************************************
00022
00023 #include <objbase.h>
00024 #include "sample.h"
00025
00026 //***************************************************************************
00027 //
00028 // CProvFactory::CProvFactory
00029 // CProvFactory::~CProvFactory
00030 //
00031 // Constructor Parameters:
00032 //  None
00033 //***************************************************************************
00034
00035 CProvFactory::CProvFactory()
00036 {
00037     m_cRef=0L;
00038     return;
00039 }
00040
00041 CProvFactory::~CProvFactory(void)
00042 {
00043     return;
00044 }
00045
00046 //***************************************************************************
00047 //
00048 // CProvFactory::QueryInterface
00049 // CProvFactory::AddRef
00050 // CProvFactory::Release
00051 //
00052 // Purpose: Standard Ole routines needed for all interfaces
00053 //
00054 //***************************************************************************
00055
00056
00057 STDMETHODIMP CProvFactory::QueryInterface(REFIID riid
00058     , PPVOID ppv)
00059 {
00060     *ppv=NULL;
00061
00062     if (IID_IUnknown==riid || IID_IClassFactory==riid)
00063         *ppv=this;
00064
00065     if (NULL!=*ppv)
00066         {
00067         ((LPUNKNOWN)*ppv)->AddRef();
00068         return NOERROR;
00069         }
00070
00071     return E_NOINTERFACE;
00072 }
00073
00074 STDMETHODIMP_(ULONG) CProvFactory::AddRef(void)
00075 {
00076     return ++m_cRef;
00077 }
00078
00079 STDMETHODIMP_(ULONG) CProvFactory::Release(void)
00080 {
00081     ULONG nNewCount = InterlockedDecrement((long *)&m_cRef);
00082     if (0L == nNewCount)
00083         delete this;
00084
00085     return nNewCount;
00086 }
00087
00088 //***************************************************************************
00089 //
00090 // CProvFactory::CreateInstance
00091 //
00092 // Purpose: Instantiates a Locator object returning an interface pointer.
00093 //
00094 // Parameters:
00095 //  pUnkOuter       LPUNKNOWN to the controlling IUnknown if we are
00096 //                  being used in an aggregation.
00097 //  riid            REFIID identifying the interface the caller
00098 //                  desires to have for the new object.
00099 //  ppvObj          PPVOID in which to store the desired
00100 //                  interface pointer for the new object.
00101 //
00102 // Return Value:
00103 //  HRESULT         NOERROR if successful, otherwise E_NOINTERFACE
00104 //                  if we cannot support the requested interface.
00105 //***************************************************************************
00106
00107 STDMETHODIMP CProvFactory::CreateInstance(LPUNKNOWN pUnkOuter
00108     , REFIID riid, PPVOID ppvObj)
00109 {
00110     IUnknown *   pObj;
00111     HRESULT      hr;
00112
00113     *ppvObj=NULL;
00114
00115     // This object doesnt support aggregation.
00116
00117     if (NULL!=pUnkOuter)
00118         return CLASS_E_NOAGGREGATION;
00119
00120     //Create the object.
00121
00122     pObj= new CPropPro();
00123
00124     if (NULL==pObj)
00125         return E_OUTOFMEMORY;
00126
00127     hr=pObj->QueryInterface(riid, ppvObj);
00128
00129     //Kill the object if initial creation or Init failed.
00130     if (FAILED(hr))
00131         delete pObj;
00132     return hr;
00133 }
00134
00135 //***************************************************************************
00136 //
00137 // CProvFactory::LockServer
00138 //
00139 // Purpose:
00140 //  Increments or decrements the lock count of the DLL.  If the
00141 //  lock count goes to zero and there are no objects, the DLL
00142 //  is allowed to unload.  See DllCanUnloadNow.
00143 //
00144 // Parameters:
00145 //  fLock           BOOL specifying whether to increment or
00146 //                  decrement the lock count.
00147 //
00148 // Return Value:
00149 //  HRESULT         NOERROR always.
00150 //***************************************************************************
00151
00152
00153 STDMETHODIMP CProvFactory::LockServer(BOOL fLock)
00154 {
00155     if (fLock)
00156         InterlockedIncrement(&g_cLock);
00157     else
00158         InterlockedDecrement(&g_cLock);
00159     return NOERROR;
00160 }
00161
00162
00163
00164
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/Resource.h Source File

  • Web
  • NetMeeting
  • NMFT

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by res.rc
00004 //
00005 #define IDS_APP_TITLE                   1
00006 #define IDS_VERSION                     2
00007 #define ICO_MAIN                        101
00008 #define IDM_APP                         104
00009 #define ID_APPACCEL                     105
00010 #define IDD_PROGRESS                    124
00011 #define IDE_SEND                        1028
00012 #define IDE_DEST                        1029
00013 #define IDC_PROGRESS                    1030
00014
00015 // Next default values for new objects
00016 //
00017 #ifdef APSTUDIO_INVOKED
00018 #ifndef APSTUDIO_READONLY_SYMBOLS
00019 #define _APS_NEXT_RESOURCE_VALUE        125
00020 #define _APS_NEXT_COMMAND_VALUE         40145
00021 #define _APS_NEXT_CONTROL_VALUE         1031
00022 #define _APS_NEXT_SYMED_VALUE           101
00023 #endif
00024 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/RenderBehave/renderproject/Dlldata.c Source File

  • Web
  • Browser
  • RenderBehave
  • renderproject

Dlldata.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 /*********************************************************
00006    DllData file -- generated by MIDL compiler
00007
00008         DO NOT ALTER THIS FILE
00009
00010    This file is regenerated by MIDL on every IDL file compile.
00011
00012    To completely reconstruct this file, delete it and rerun MIDL
00013    on all the IDL files in this DLL, specifying this file for the
00014    /dlldata command line option
00015
00016 *********************************************************/
00017
00018 #define PROXY_DELEGATION
00019
00020 #include <rpcproxy.h>
00021
00022 #ifdef __cplusplus
00023 extern "C"   {
00024 #endif
00025
00026 EXTERN_PROXY_FILE( Render )
00027
00028
00029 PROXYFILE_LIST_START
00030 /* Start of list */
00031   REFERENCE_PROXY_FILE( Render ),
00032 /* End of list */
00033 PROXYFILE_LIST_END
00034
00035
00036 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00037
00038 #ifdef __cplusplus
00039 }  /*extern "C" */
00040 #endif
00041
00042 /* end of generated dlldata file */
00043 _cplusplus
00044 }  /*extern "C" */
00045 #endif
00046
00047 /* end of generated dlldata file */
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Stream Member List

This is the complete list of members for msado15::Stream, including all inherited members.
Cancel() | msado15::Stream |
Close() | msado15::Stream |
clsid | msado15::Stream | [static]
CopyTo(msado15._Stream DestStream, int CharNumber) | msado15::Stream |
Flush() | msado15::Stream |
getCharset() | msado15::Stream |
getEOS() | msado15::Stream |
getLineSeparator() | msado15::Stream |
getMode() | msado15::Stream |
getPosition() | msado15::Stream |
getSize() | msado15::Stream |
getState() | msado15::Stream |
getType() | msado15::Stream |
iid | msado15::Stream | [static]
LoadFromFile(String FileName) | msado15::Stream |
Open(Variant Source, int Mode, int Options, String UserName, String Password) | msado15::Stream |
Read(int NumBytes) | msado15::Stream |
ReadText(int NumChars) | msado15::Stream |
SaveToFile(String FileName, int Options) | msado15::Stream |
setCharset(String pbstrCharset) | msado15::Stream |
SetEOS() | msado15::Stream |
setLineSeparator(int pLS) | msado15::Stream |
setMode(int pMode) | msado15::Stream |
setPosition(int pPos) | msado15::Stream |
setType(int ptype) | msado15::Stream |
SkipLine() | msado15::Stream |
Write(Variant Buffer) | msado15::Stream |
WriteText(String Data, int Options) | msado15::Stream |
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Server/BYOTTxEnlister/StdAfx.Cpp Source File

  • Com
  • Services
  • BYOT
  • Server
  • BYOTTxEnlister

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/StoServe/StoServe.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • StoServe

StoServe.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      STOSERVE.H
00003
00004   Summary:   Main include file for the STOSERVE.DLL dynamic link library.
00005              Intended primarily for external users of this DLL who exploit
00006              it via static linkage to the DllRegisterServer and
00007              DllUnregisterServer exported service calls.
00008
00009              For a comprehensive tutorial code tour of STOSERVE's contents
00010              and offerings see the tutorial STOSERVE.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the STOSERVE source code.
00013
00014   Classes:   none.
00015
00016   Functions: DllRegisterServer, DllUnregisterServer.
00017
00018   Origin:    12-10-96: atrent - Editor-inheritance from CONSERVE.H in
00019                the CONSERVE Tutorial Code Sample. [Revised]
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(STOSERVE_H)
00037 #define STOSERVE_H
00038
00039 #if !defined(RC_INCLUDE)
00040
00041 #if !defined(_DLLEXPORT_)
00042
00043 // If _DLLEXPORT_ is NOT defined then the default is to import.
00044 #if defined(__cplusplus)
00045 #define DLLENTRY extern "C" __declspec(dllimport)
00046 #else
00047 #define DLLENTRY extern __declspec(dllimport)
00048 #endif
00049 #define STDENTRY DLLENTRY HRESULT WINAPI
00050 #define STDENTRY_(type) DLLENTRY type WINAPI
00051
00052 // Here is the list of server APIs offered by the DLL (using the
00053 // appropriate entry API declaration macros just #defined above).
00054
00055 STDENTRY DllRegisterServer(void);
00056
00057 STDENTRY DllUnregisterServer(void);
00058
00059 #else  // _DLLEXPORT_
00060
00061 // Else if _DLLEXPORT_ is indeed defined then we've been told to export.
00062 #if defined(__cplusplus)
00063 #define DLLENTRY extern "C" __declspec(dllexport)
00064 #else
00065 #define DLLENTRY __declspec(dllexport)
00066 #endif
00067 #define STDENTRY DLLENTRY HRESULT WINAPI
00068 #define STDENTRY_(type) DLLENTRY type WINAPI
00069
00070 #endif // _DLLEXPORT_
00071
00072 #endif // RC_INCLUDE
00073
00074 #endif // STOSERVE_H
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_QueueNode Member List

This is the complete list of members for _QueueNode, including all inherited members.
pData | _QueueNode
pNext | _QueueNode
Generated on Wed Nov 13 2024 16:55:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPingResponder Member List

This is the complete list of members for CPingResponder, including all inherited members.
CPingResponder() | CPingResponder | [inline]
Ping() | CPingResponder |
Generated on Wed Nov 13 2024 16:57:03 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/PropertyList/vc/ADSIhelpers.h Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • PropertyList
  • vc

ADSIhelpers.h

Go to the documentation of this file.
00001
00002
00003
00004 #ifndef ADSIHELLPERS_H
00005 #define ADSIHELLPERS_H
00006
00007 #include <activeds.h>
00008 #include <adsiid.h>
00009
00010
00011 // Function declarations
00012 void      PrintIADSObject(IADs * pIADs);
00013 void      CheckHRESULT(HRESULT hr, const char *pszCause);
00014 const char *  GetVariantStyle(VARTYPE vt);
00015 HRESULT     GetIADsPropertyValueAsBSTR(BSTR * pbsRet,IADsPropertyEntry *pAdsEntry, IADsPropertyValue * pAdsPV);
00016
00017
00018 // Macros
00019
00020 // Simple Macro to simplyfy reading a bitflag
00021 #define HAS_BIT_STYLE(val, style) \
00022 ((val & style) == style)
00023
00024
00025 #endif
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello2/Hello2.Cpp Source File

  • Web
  • MSAgent
  • c
  • Hello2

Hello2.Cpp

Go to the documentation of this file.
00001 #include "Hello2.h"
00002 #include "AgtSvr_i.c"
00003 #include "Notify.h"
00004
00005
00006 //==========================================================================
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //--------------------------------------------------------------------------
00016 //
00017 // This sample demonstrates the simplest Microsoft Agent application that
00018 // uses a notification sink.
00019 //
00020 //==========================================================================
00021
00022
00023 static const LPWSTR kpwzCharacterOld = L"\\program files\\microsoft agent\\characters\\genie.acs";
00024 static const LPTSTR kpszAppTitle = _T("Microsoft Agent Samples");
00025
00026 extern long g_lDone = 0;
00027
00028
00029 extern "C" int PASCAL WinMain(HINSTANCE hInst,
00030                 HINSTANCE hInstPrev,
00031                 LPSTR lpCmdLine,
00032                 int nCmdShow) {
00033
00034   HRESULT       hRes;
00035   _TCHAR        szError[256];
00036   VARIANT       vPath;
00037   BSTR        bszSpeak;
00038   MSG         msg;
00039   long        lCharID;
00040   long        lRequestID;
00041   long        lNotifySinkID = -1;
00042   IAgentEx       *pAgentEx;
00043   IAgentCharacterEx  *pCharacterEx = NULL;
00044   AgentNotifySink    *pSink = NULL;
00045
00046   // Initialize COM
00047
00048     if (FAILED(CoInitialize(NULL))) {
00049     MessageBox(NULL,
00050            _T("There was an error initializing COM."),
00051            kpszAppTitle,
00052            MB_OK | MB_ICONERROR);
00053         return -1;
00054   }
00055
00056   // Create an instance of the Agent 2.0 server. NOTE: by
00057   // asking for an IAgentEx interface we know we will get
00058   // at least Agent 2.0. The CLSID also changed between
00059   // 1.5 and 2.0 so we know we won't get the 1.5 server.
00060
00061   hRes = CoCreateInstance(CLSID_AgentServer,
00062               NULL,
00063               CLSCTX_SERVER,
00064               IID_IAgentEx,
00065               (LPVOID *)&pAgentEx);
00066   if (FAILED(hRes)) {
00067
00068     wsprintf(szError, _T("There was an error initializing Microsoft Agent, code = 0x%x"), hRes);
00069
00070     MessageBox(NULL,
00071            szError,
00072            kpszAppTitle,
00073            MB_OK | MB_ICONERROR);
00074
00075     CoUninitialize();
00076
00077     return -1;
00078   }
00079
00080   __try {
00081
00082     VariantInit(&vPath);
00083
00084     // Create a notify sink
00085
00086     pSink = new AgentNotifySink;
00087
00088     if (pSink == NULL) {
00089       hRes = E_OUTOFMEMORY;
00090       __leave;
00091     }
00092
00093     // AddRef it
00094
00095     pSink->AddRef();
00096
00097     // And register it with Microsoft Agent
00098
00099     hRes = pAgentEx->Register((IUnknown *)pSink, &lNotifySinkID);
00100
00101     if (FAILED(hRes))
00102       __leave;
00103
00104     // Try to load the default character
00105
00106     vPath.vt = VT_EMPTY;
00107
00108     hRes = pAgentEx->Load(vPath, &lCharID, &lRequestID);
00109
00110     if (FAILED(hRes)) {
00111
00112       // There's no default character. See if we can load the
00113       // character from the directory used in most version 1.5
00114       // applications.
00115
00116       vPath.vt = VT_BSTR;
00117       vPath.bstrVal = SysAllocString(kpwzCharacterOld);
00118
00119       if (vPath.bstrVal == NULL) {
00120         hRes = E_OUTOFMEMORY;
00121         __leave;
00122       }
00123
00124       hRes = pAgentEx->Load(vPath, &lCharID, &lRequestID);
00125
00126       // Did we successfully load a character?
00127
00128       if (FAILED(hRes))
00129         __leave;
00130     }
00131
00132     // Get the IAgentCharacterEx interface
00133
00134     hRes = pAgentEx->GetCharacterEx(lCharID, &pCharacterEx);
00135
00136     if (FAILED(hRes))
00137       __leave;
00138
00139     // Set the language of the character
00140
00141     hRes = pCharacterEx->SetLanguageID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
00142
00143     if (FAILED(hRes))
00144       __leave;
00145
00146     // Show the character.  The first parameter tells Microsoft
00147     // Agent to show the character by playing an animation.
00148
00149     hRes = pCharacterEx->Show(FALSE, &lRequestID);
00150
00151     if (FAILED(hRes))
00152       __leave;
00153
00154     // Make the character speak
00155
00156     bszSpeak = SysAllocString(L"Hello World!");
00157
00158     hRes = pCharacterEx->Speak(bszSpeak, NULL, &g_lDone);
00159
00160     SysFreeString(bszSpeak);
00161
00162     if (FAILED(hRes))
00163       __leave;
00164
00165     // Start the message loop.  A WM_QUIT message will be posted
00166     // when we get the RequestComplete notification from Microsoft Agent.
00167
00168     while (GetMessage(&msg, NULL, 0, 0) > 0)
00169       DispatchMessage(&msg);
00170
00171   }
00172   __finally {
00173
00174     if (FAILED(hRes)) {
00175
00176       wsprintf(szError, _T("An error occurred in Microsoft Agent, code = 0x%x"), hRes);
00177
00178       MessageBox(NULL,
00179              szError,
00180              kpszAppTitle,
00181              MB_OK | MB_ICONERROR | MB_TOPMOST);
00182     }
00183   }
00184
00185   // Clean up
00186
00187   if (pCharacterEx) {
00188
00189     // Release the character interface
00190
00191     pCharacterEx->Release();
00192
00193     // Unload the character.  NOTE:  releasing the character
00194     // interface does NOT make the character go away.  You must
00195     // call Unload.
00196
00197     pAgentEx->Unload(lCharID);
00198   }
00199
00200   // Release objects
00201
00202   if (pSink) {
00203
00204     if (lNotifySinkID != -1)
00205       pAgentEx->Unregister(lNotifySinkID);
00206
00207     pSink->Release();
00208   }
00209
00210   pAgentEx->Release();
00211
00212   VariantClear(&vPath);
00213
00214   CoUninitialize();
00215
00216   return 0;
00217 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/customdrawbuttondlg/Resource.h Source File

  • WinUI
  • Shell
  • customdrawbuttondlg

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Visual C++ generated include file.
00003 // Used by CustomDrawButtonDlg.rc
00004 //
00005 #define IDC_MYICON                      2
00006 #define IDOK2                           3
00007 #define IDD_CUSTOMDRAWBUTTONDLG_DIALOG  102
00008 #define IDS_APP_TITLE                   103
00009 #define IDM_ABOUT                       104
00010 #define IDM_EXIT                        105
00011 #define IDC_CUSTOMDRAWBUTTONDLG         109
00012 #define IDR_MAINFRAME                   128
00013 #define ID_CUSTOM_BUTTON                128
00014 #define IDD_DIALOG                      129
00015 #define IDC_CHECK1                      1002
00016 #define IDC_STATIC                      -1
00017
00018 // Next default values for new objects
00019 //
00020 #ifdef APSTUDIO_INVOKED
00021 #ifndef APSTUDIO_READONLY_SYMBOLS
00022 #define _APS_NO_MFC                     1
00023 #define _APS_NEXT_RESOURCE_VALUE        131
00024 #define _APS_NEXT_COMMAND_VALUE         32771
00025 #define _APS_NEXT_CONTROL_VALUE         1005
00026 #define _APS_NEXT_SYMED_VALUE           110
00027 #endif
00028 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagTOOLDISPLAYDATA Member List

This is the complete list of members for tagTOOLDISPLAYDATA, including all inherited members.
cxButton | tagTOOLDISPLAYDATA
cxImage | tagTOOLDISPLAYDATA
cyBar | tagTOOLDISPLAYDATA
cyButton | tagTOOLDISPLAYDATA
cyImage | tagTOOLDISPLAYDATA
uDPI | tagTOOLDISPLAYDATA
uIDImages | tagTOOLDISPLAYDATA
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IADsError Member List

This is the complete list of members for IADsError, including all inherited members.
GetErrorMessage([in] long hResult,[out, retval] BSTR *pbMsg) IADsError
Generated on Wed Nov 13 2024 16:57:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/caccount.h Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

caccount.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CAccount.h
00003   Summary:   Header for Object Pooled Account component
00004   Classes:   CAccount
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "resource.h"       // main symbols
00023 #include <comsvcs.h>
00024
00025 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00026 Class:  CAccount
00027 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00028
00029 interface IObjectContext;
00030
00031 class CAccount :
00032   public CComDualImpl<IAccount, &IID_IAccount, &LIBID_ACCOUNT>,
00033   public ISupportErrorInfo,
00034   public CComObjectRoot,
00035   public IObjectConstruct,
00036   public IObjectControl,
00037   public CComCoClass<CAccount,&CLSID_CAccount>
00038 {
00039 private:
00040
00041   HENV m_henv;
00042   HDBC m_hdbc;
00043   HSTMT m_hstmt;
00044   CComBSTR m_sDSN;
00045   BOOL m_bConstructed;
00046   BOOL m_bShouldEnlist;
00047   GUID m_txuow;
00048   BOOL m_bObjectPooled;
00049 public:
00050   CAccount()
00051   {
00052     m_henv = 0;
00053     m_hdbc = 0;
00054     m_hstmt= 0;
00055     m_bConstructed = FALSE;
00056     m_bShouldEnlist = FALSE;
00057     m_txuow = GUID_NULL;
00058     m_bObjectPooled = FALSE;
00059   }
00060   ~CAccount()
00061   {
00062   }
00063
00064   HRESULT Enlist();
00065
00066   void FinalRelease();
00067
00068   DECLARE_GET_CONTROLLING_UNKNOWN()
00069   DECLARE_PROTECT_FINAL_CONSTRUCT( )
00070
00071 BEGIN_COM_MAP(CAccount)
00072   COM_INTERFACE_ENTRY(IDispatch)
00073   COM_INTERFACE_ENTRY(IAccount)
00074   COM_INTERFACE_ENTRY(IObjectControl)
00075   COM_INTERFACE_ENTRY(IObjectConstruct)
00076   COM_INTERFACE_ENTRY(ISupportErrorInfo)
00077 END_COM_MAP()
00078
00079 HRESULT FinalConstruct()
00080 {
00081   return S_OK;
00082 }
00083 DECLARE_REGISTRY_RESOURCEID(IDR_Account)
00084 // ISupportsErrorInfo
00085   STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
00086
00087 // IAccount
00088 public:
00089   HRESULT DoWork(long lAccount, long lAmount, BSTR *pbstrResult);
00090   STDMETHOD(Post)(
00091     IN long lAccount,
00092     IN long lAmount,
00093     OUT BSTR* pbstrResult);
00094 //IObjectConstruct
00095   STDMETHODIMP Construct(IDispatch * pUnk);
00096
00097 // IObjectControl
00098
00099   STDMETHODIMP_(BOOL) CanBePooled()
00100   {
00101     return TRUE;
00102   }
00103
00104   STDMETHODIMP Activate();
00105
00106   STDMETHODIMP_(void) Deactivate()
00107   {
00108     // nothing to do
00109   }
00110
00111 };
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/clistener.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

clistener.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CLISTENER.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CLISTENER_H_
00012 #define _CLISTENER_H_
00013
00014
00015 //////////////////////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 //////////////////////////////////////////////////////////////////////////////
00019
00020
00021 /////////////////////////////////////////////////////////////////
00022 // CListener
00023 //
00024 /////////////////////////////////////////////////////////////////
00025 class CListener : public IRowsetNotify,   //Rowset Notifications
00026           public IDBAsynchNotify,   //Asynch Notifications
00027           public IRowPositionChange //RowPosition Notifications
00028 {
00029 public:
00030   CListener();
00031   virtual ~CListener();
00032
00033   virtual HRESULT     Advise(CContainerBase* pCCPointBase, REFIID riid, DWORD* pdwCookie);
00034   virtual HRESULT     Advise(IConnectionPoint* pIConnectionPoint, DWORD* pdwCookie);
00035
00036   virtual HRESULT     Unadvise(CContainerBase* pCCPointBase, REFIID riid, DWORD* pdwCookie);
00037   virtual HRESULT     Unadvise(IConnectionPoint* pIConnectionPoint, DWORD* pdwCookie);
00038
00039   virtual HRESULT     SetReturnValue(HRESULT hrReturn);
00040   virtual HRESULT     GetReturnValue();
00041
00042   STDMETHODIMP_(ULONG)  AddRef(void);
00043   STDMETHODIMP_(ULONG)  Release(void);
00044   STDMETHODIMP      QueryInterface(REFIID riid, LPVOID *ppv);
00045
00046   //IRowsetNotify
00047     STDMETHODIMP OnFieldChange
00048     (
00049             IRowset* pIRowset,
00050             HROW hRow,
00051             DBORDINAL cColumns,
00052             DBORDINAL rgColumns[  ],
00053             DBREASON eReason,
00054             DBEVENTPHASE ePhase,
00055             BOOL fCantDeny
00056     );
00057
00058     STDMETHODIMP OnRowChange
00059     (
00060             IRowset* pIRowset,
00061             DBCOUNTITEM cRows,
00062             const HROW rghRows[  ],
00063             DBREASON eReason,
00064             DBEVENTPHASE ePhase,
00065             BOOL fCantDeny
00066     );
00067
00068   STDMETHODIMP OnRowsetChange
00069     (
00070       IRowset* pIRowset,
00071             DBREASON eReason,
00072             DBEVENTPHASE ePhase,
00073             BOOL fCantDeny
00074     );
00075
00076
00077   //IDBAsynchNotify
00078     STDMETHODIMP OnLowResource
00079     (
00080             DB_DWRESERVE dwReserved
00081     );
00082
00083     STDMETHODIMP OnProgress
00084     (
00085             HCHAPTER    hChapter,
00086             DBASYNCHOP    eOperation,
00087             DBCOUNTITEM   ulProgress,
00088             DBCOUNTITEM   ulProgressMax,
00089             DBASYNCHPHASE eAsynchPhase,
00090             LPOLESTR pwszStatusText
00091     );
00092
00093   STDMETHODIMP OnStop
00094      (
00095             HCHAPTER    hChapter,
00096             DBASYNCHOP    eOperation,
00097             HRESULT     hrStatus,
00098             LPOLESTR    pwszStatusText
00099     );
00100
00101   //IRowPositionChange
00102   STDMETHODIMP OnRowPositionChange
00103     (
00104       DBREASON      eReason,
00105       DBEVENTPHASE    ePhase,
00106       BOOL        fCantDeny
00107     );
00108
00109
00110
00111 protected:
00112   //Data
00113   ULONG     m_cRef;     // reference count
00114   HRESULT     m_hrReturn;
00115 };
00116
00117
00118
00119 #endif //_CLISTENER_H_
Generated on Wed Nov 13 2024 16:52:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Resource/Iconpro/IconPRO.h Source File

  • WinUI
  • Resource
  • Iconpro

IconPRO.h

Go to the documentation of this file.
00001 /****************************************************************************\
00002 *
00003 *     FILE:     IconPro.H
00004 *
00005 *     PURPOSE:  IconPro Project main header file
00006 *
00007 *     COMMENTS: The child window size is determined here, based on the
00008 *               hard coded maximum sizes of icons supported. Only one
00009 *               function is exported from IconPro.C, and it is exported
00010 *               to allow MDI child windows to query for a save file name
00011 *               if they are asked to close and their data has changed.
00012 *
00013 *     Copyright 1995 - 2000 Microsoft Corp.
00014 *
00015 *
00016 * History:
00017 *                July '95 - Created
00018 *
00019 \****************************************************************************/
00020
00021
00022 /****************************************************************************/
00023 // local #defines
00024
00025 // How large of icons will we support? This is really only important
00026 // bacuase of the design of the UI. It needs to draw the entire icon
00027 // 4 times, so we limit how big one can be. The ICO spec puts no limit
00028 // on icon sizes.
00029 #define MAX_ICON_WIDTH  128              // Max width
00030 #define MIN_ICON_WIDTH  16               // Min width
00031 #define MAX_ICON_HEIGHT MAX_ICON_WIDTH   // Max height
00032 #define MIN_ICON_HEIGHT MIN_ICON_WIDTH   // Min height
00033
00034 // How big do the MDI child windows need to be to display the icon and
00035 // the listbox?
00036 #define WINDOW_WIDTH    ( ( MAX_ICON_WIDTH * 2 ) + 30 )
00037 #define WINDOW_HEIGHT   ( ( MAX_ICON_HEIGHT * 2 ) + 150 )
00038
00039 // Utility macro to calculate a rectangle's width/height
00040 #define RectWidth(r)    ((r).right - (r).left + 1)
00041 #define RectHeight(r)   ((r).bottom - (r).top + 1)
00042 /****************************************************************************/
00043
00044
00045
00046
00047 /****************************************************************************/
00048 // Exported function prototypes
00049 BOOL GetSaveIconFileName( PTSTR szFileName, UINT FilterStringID, PCTSTR szTitle );
00050 BOOL GetOpenIconFileName( PTSTR szFileName, UINT FilterStringID, PCTSTR szTitle );
00051 /****************************************************************************/
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPropertyPage Member List

This is the complete list of members for CPropertyPage, including all inherited members.
Activate(HWND hWndParent, LPCRECT pRect, BOOL bModal) | CPropertyPage |
Apply() | CPropertyPage |
CPropertyPage(REFCLSID clsid, INT iDialogID) | CPropertyPage |
Deactivate() | CPropertyPage |
DEFINE_ADDREF_RELEASE | CPropertyPage |
DialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [static]
GetClassID(CLSID __RPC_FAR *pClassID) | CPropertyPage | [inline]
GetPageInfo(PROPPAGEINFO __RPC_FAR *pPageInfo) | CPropertyPage | [inline, virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CPropertyPage | [virtual]
Help(LPCOLESTR pszHelpDir) | CPropertyPage | [inline]
InitNew(void) | CPropertyPage | [inline]
IsPageDirty() | CPropertyPage |
Load(IPropertyBag __RPC_FAR *pPropBag, IErrorLog __RPC_FAR *pErrorLog) | CPropertyPage | [inline]
m_clsid | CPropertyPage | [protected]
m_cRef | CPropertyPage | [protected]
m_hWnd | CPropertyPage | [protected]
m_iDialogID | CPropertyPage | [protected]
m_pIPropertyPageSite | CPropertyPage | [protected]
Move(LPCRECT pRect) | CPropertyPage |
QueryInterface(REFIID riid, LPVOID *ppv) | CPropertyPage |
Save(IPropertyBag __RPC_FAR *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) | CPropertyPage | [inline]
SetObjects(ULONG cObjects, IUnknown __RPC_FAR *__RPC_FAR *ppUnk) | CPropertyPage | [inline]
SetPageSite(IPropertyPageSite *pPageSite) | CPropertyPage |
Show(UINT nCmdShow) | CPropertyPage |
TranslateAccelerator(MSG *pMsg) | CPropertyPage |
~CPropertyPage() | CPropertyPage | [virtual]
Generated on Wed Nov 13 2024 16:57:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EdAnnotator/AnnotatorProject/StdAfx.h Source File

  • Web
  • Browser
  • EdAnnotator
  • AnnotatorProject

StdAfx.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 // stdafx.h : include file for standard system include files,
00006 //      or project specific include files that are used frequently,
00007 //      but are changed infrequently
00008
00009 #if !defined(AFX_STDAFX_H__2B83FBA2_0381_4F3F_8A51_1A24AFB824A7__INCLUDED_)
00010 #define AFX_STDAFX_H__2B83FBA2_0381_4F3F_8A51_1A24AFB824A7__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016 #define STRICT
00017 #ifndef _WIN32_WINNT
00018 #define _WIN32_WINNT 0x0400
00019 #endif
00020 #define _ATL_APARTMENT_THREADED
00021
00022 #include <atlbase.h>
00023 //You may derive a class from CComModule and use it if you want to override
00024 //something, but do not change the name of _Module
00025 extern CComModule _Module;
00026 #include <atlcom.h>
00027 #include <atlctl.h>
00028
00029 //{{AFX_INSERT_LOCATION}}
00030 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00031
00032 #endif // !defined(AFX_STDAFX_H__2B83FBA2_0381_4F3F_8A51_1A24AFB824A7__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyCtl/ObjPoolsub.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyCtl

ObjPoolsub.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __OBJPOOLSUB_H__
00018 #define __OBJPOOLSUB_H__
00019
00020 #include "resource.h"       // main symbols
00021
00022 CComBSTR GuidToBstr(REFGUID guid);
00023
00024 class CComSpy;
00025
00026 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00027 Class:   CObjPoolSub
00028 Summary: Object Pool Events Subscriber
00029 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00030 class ATL_NO_VTABLE CObjPoolSub :
00031   public CSysLCESub,
00032   public IComObjectPoolEvents
00033 {
00034 public:
00035   CObjPoolSub(CComSpy * pSpy)
00036   {
00037     m_pSpy = pSpy;
00038   }
00039
00040   CObjPoolSub()
00041   {
00042     m_pSpy = NULL;
00043   }
00044
00045
00046   DECLARE_NOT_AGGREGATABLE(CObjPoolSub)
00047   DECLARE_GET_CONTROLLING_UNKNOWN()
00048
00049   BEGIN_COM_MAP(CObjPoolSub)
00050     COM_INTERFACE_ENTRY(IComObjectPoolEvents)
00051     COM_INTERFACE_ENTRY_CHAIN(CSysLCESub)
00052   END_COM_MAP()
00053
00054   STDMETHODIMP GetEventType(EventEnum * e){*e = ObjectPool;return S_OK;}
00055   STDMETHODIMP GetEventClass(LPGUID guid){*guid = CLSID_ComServiceEvents;return S_OK;}
00056   STDMETHODIMP GetInterface(IID* iid){*iid = IID_IComObjectPoolEvents;return S_OK;}
00057
00058   STDMETHODIMP OnObjPoolPutObject(COMSVCSEVENTINFO * pInfo,
00059                   REFGUID guidClass,
00060                   int nReason,
00061                   DWORD dwAvailable,
00062                   ULONG64 ObjectID)
00063   {
00064     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnObjPoolPutObject"), GuidToBstr(pInfo->guidApp));
00065
00066     m_pSpy -> AddParamValueToList(L"guidClass", GuidToBstr( guidClass ));
00067
00068     WCHAR p1[16];
00069     wsprintfW(p1, L"0x%08X", nReason);
00070     m_pSpy -> AddParamValueToList(L"nReason", p1);
00071
00072     wsprintfW(p1, L"%lu", dwAvailable);
00073     m_pSpy -> AddParamValueToList(L"dwAvailable", p1);
00074
00075     WCHAR szObjectID[32];
00076     wsprintfW(szObjectID, L"0x%016X", ObjectID);
00077     m_pSpy -> AddParamValueToList(L"ObjectID", szObjectID);
00078
00079     IF_AUDIT_DO(OnObjPoolPutObject)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00080                     GuidToBstr( guidClass ),
00081                     nReason,
00082                     dwAvailable,
00083                     szObjectID);
00084     return S_OK;
00085   }
00086
00087
00088   STDMETHODIMP  OnObjPoolGetObject(COMSVCSEVENTINFO * pInfo,
00089                  REFGUID guidActivity,
00090                  REFGUID guidClass,
00091                  DWORD dwAvailable,
00092                  ULONG64 ObjectID)
00093   {
00094     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnObjPoolGetObject"), GuidToBstr(pInfo->guidApp));
00095
00096     m_pSpy -> AddParamValueToList(L"guidActivity", GuidToBstr( guidActivity ));
00097     m_pSpy -> AddParamValueToList(L"guidClass", GuidToBstr( guidClass ));
00098
00099     WCHAR p1[16];
00100     wsprintfW(p1, L"%d", dwAvailable);
00101     m_pSpy -> AddParamValueToList(L"dwAvailable", p1);
00102
00103     WCHAR szObjectID[32];
00104     wsprintfW(szObjectID, L"0x%016X", ObjectID);
00105     m_pSpy -> AddParamValueToList(L"ObjectID", szObjectID);
00106
00107     IF_AUDIT_DO(OnObjPoolGetObject)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00108                     GuidToBstr( guidActivity ),
00109                     GuidToBstr( guidClass ),
00110                     dwAvailable,
00111                     szObjectID);
00112
00113     return S_OK;
00114   }
00115
00116   STDMETHODIMP  OnObjPoolRecycleToTx(COMSVCSEVENTINFO * pInfo,
00117                      REFGUID guidActivity,
00118                      REFGUID guidClass,
00119                      REFGUID guidTx,
00120                      ULONG64 ObjectID)
00121   {
00122     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnObjPoolRecycleToTx"), GuidToBstr(pInfo->guidApp));
00123
00124     m_pSpy -> AddParamValueToList(L"guidActivity", GuidToBstr( guidActivity ));
00125     m_pSpy -> AddParamValueToList(L"guidClass", GuidToBstr( guidClass ));
00126     m_pSpy -> AddParamValueToList(L"guidTx", GuidToBstr( guidTx ));
00127
00128     WCHAR szObjectID[32];
00129     wsprintfW(szObjectID, L"0x%016X", ObjectID);
00130     m_pSpy -> AddParamValueToList(L"ObjectID", szObjectID);
00131
00132     IF_AUDIT_DO(OnObjPoolRecycleToTx)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00133                     GuidToBstr( guidActivity ),
00134                     GuidToBstr( guidClass ),
00135                     GuidToBstr( guidTx ),
00136                     szObjectID);
00137
00138     return S_OK;
00139   }
00140
00141   STDMETHODIMP  OnObjPoolGetFromTx(COMSVCSEVENTINFO * pInfo,
00142                    REFGUID guidActivity,
00143                    REFGUID guidClass,
00144                    REFGUID guidTx,
00145                    ULONG64 ObjectID)
00146   {
00147
00148     m_pSpy -> AddEventToList(pInfo->perfCount, _TEXT("OnObjPoolGetFromTx"), GuidToBstr(pInfo->guidApp));
00149     m_pSpy -> AddParamValueToList(L"guidActivity", GuidToBstr( guidActivity ));
00150     m_pSpy -> AddParamValueToList(L"guidClass", GuidToBstr( guidClass ));
00151     m_pSpy -> AddParamValueToList(L"guidTx", GuidToBstr( guidTx ));
00152
00153     WCHAR szObjectID[32];
00154     wsprintfW(szObjectID, L"0x%016X", ObjectID);
00155     m_pSpy -> AddParamValueToList(L"ObjectID", szObjectID);
00156
00157     IF_AUDIT_DO(OnObjPoolGetFromTx)(pInfo->perfCount, GuidToBstr(pInfo->guidApp),
00158                     GuidToBstr( guidActivity ),
00159                     GuidToBstr( guidClass ),
00160                     GuidToBstr( guidTx ),
00161                     szObjectID);
00162
00163
00164     return S_OK;
00165   }
00166 };
00167
00168 #endif //__OBJPOOLSUB_H__
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/FileRepAsyncPipe/FileRepClientProc.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • FileRepAsyncPipe

FileRepClientProc.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Client System Service
00006
00007     FILE: FileRepClientProc.cpp
00008
00009     PURPOSE: Remote procedures for client system service
00010
00011     FUNCTIONS:
00012         RequestFile() - receives file replication requests
00013         ThreadProcRequest() - processes file replication requests
00014     in an independent thread.
00015
00016     COMMENTS:
00017
00018 */
00019
00020 #include "common.h"
00021
00022 #include <stddef.h>
00023 #include <Ntdsapi.h>
00024 #include <time.h>
00025
00026 // header file generated by MIDL compiler
00027 #include "FileRepClient.h"
00028 #include "FileRepServer.h"
00029
00030 // Contains declarations for system service functions.
00031 #include "Service.h"
00032
00033 #ifdef DEBUG2
00034 #include "DbgMsg.h"
00035 #endif
00036
00037 #ifdef PROF
00038 #include "Prof.h"
00039 #endif
00040
00041 extern HANDLE ClientCompletionPort;
00042 extern LONG nThreadsAtClientCompletionPort;
00043
00044 // Files that are being written will be extended by this
00045 // size to allow writes to be trully asyncronous.
00046 #define FILE_SIZE_EXTENSION (1*1024*1024)
00047
00048 // Timeout for threads waiting on the client completion port
00049 #define ClientCompletionPortTimeout (20*1000)
00050
00051
00052 // The types of IO posted onto the completion port
00053 typedef enum {
00054   IoFileRep, // Posted by FileRep
00055   IoPipe, // Posted by the RPC runtime
00056   IoFile // Posted by the File IO subsystem
00057 } IoCompletionType;
00058
00059 // Action to be taken next for a given request
00060 typedef enum {
00061   Activate,
00062   Pull,
00063   Wait
00064 } ActionType;
00065
00066 // The state of the client request.
00067 typedef enum tReqState {
00068     StateArrived,
00069     StateQueued,
00070     StateActive
00071 } ReqState;
00072
00073 #ifdef DEBUG1
00074 // Used to track the number of outstanding requests
00075 unsigned nClientReqs = 0;
00076 #endif
00077
00078 //
00079 // Packages up the variables to be passed
00080 // to the processing thread.
00081 //
00082 typedef struct tReq{
00083
00084     // Binding handle to the server
00085     handle_t hFileRepServer;
00086     // Explicit binding to the client system service
00087     handle_t hFileRepClient;
00088
00089     HANDLE hTokenHandle;
00090     HANDLE hLocalFile;
00091
00092     LPTSTR ServerName;
00093     LPTSTR RemoteFileName;
00094     LPTSTR LocalFileName;
00095
00096     // Set when we are impersonating the client
00097     BOOL bImpersonating;
00098
00099     // Priority of this request
00100     UINT Pri;
00101
00102     // User SID
00103     PSID pSID;
00104
00105     // The state of the current request
00106     ReqState State;
00107
00108     // The out-pipe we use to pull data from the server.
00109     ASYNC_CHAR_PIPE_TYPE OutPipe;
00110
00111     // The async handle for the call to RemoteOpen.
00112     RPC_ASYNC_STATE Async;
00113
00114     BYTE pbBuf[PULL_BUFSIZE];
00115
00116     LONG FileWritePos;
00117     LONG CurrentExtendedSize;
00118
00119     OVERLAPPED FileOl;
00120
00121     CRITICAL_SECTION Lock;
00122
00123     LONG nWritesOutstanding;
00124     LONG nBytesOutstanding;
00125
00126     // There is an outstanding pull.
00127     BOOL bPullOutstanding;
00128
00129     // There is a buffer that has been pulled
00130     // but haven't been written to the server yet.
00131     BOOL bBuf;
00132
00133     // A receive complete notification has been received,
00134     // but no pulls have been done yet, and so the next pull
00135     // should succeed.
00136     BOOL bDataAvailable;
00137
00138     // Set when all the pulls have completed.
00139     BOOL bAllPullsDone;
00140
00141     BOOL bCallMade;
00142     BOOL bCallCancelled;
00143
00144     // Set when call complete notification has been received or
00145     // a syncronous failure has been received from the pull routine.
00146     BOOL bCallComplete;
00147
00148     // Set when we received a premature call completed notification and query
00149     // call status returned an error.
00150     BOOL bAsyncCallFailureReceived;
00151
00152     // We use this wariable to set an error code so that
00153     // ClientShutdownRequest can know whether an error has occurred.
00154     DWORD Status;
00155
00156     // Set after pull returned an error.
00157     BOOL bFailureFromPull;
00158
00159     // Set after WriteFile returned an error.
00160     BOOL bFailureFromWrite;
00161
00162 #ifdef PROF
00163     // Used to track arrival and completion times of requests.
00164     ULONG nReqId;
00165 #endif
00166
00167 } Req;
00168
00169
00170 //
00171 // Extends file associated with hFile to Size bytes.
00172 // This is necessary to allow the async writes to be "trully"
00173 // async.  Because of the inner workings of NTFS when writes extend
00174 // the size of the file they may end up being syncronous.
00175 //
00176 VOID SetFileSize (HANDLE hFile, DWORD Size) {
00177     SetFilePointer(hFile,
00178                    Size,
00179                    NULL,
00180                    FILE_BEGIN);
00181     SetEndOfFile(hFile);
00182 }
00183
00184 //
00185 // Checks request queues in the order of decreasing priority.  If a request is found and
00186 // there is space in the corresponding quota of active requests, then it is returned.
00187 //
00188 Req* FindCReq(void) {
00189
00190 #ifdef DEBUG2
00191     TCHAR Msg[MSG_SIZE];
00192 #endif
00193
00194     Req *pReq = NULL;
00195
00196     //
00197     // We will now go and check if the request or the active request sets of queues have anything that we
00198     // can service.  If they do not, then this thread can terminate.
00199     //
00200
00201     // Check if the request queues have anything on them.  If they do,
00202     // pick a request off the highest priority queue and handle it, but only if we
00203     // are not handling enough of those requests already.
00204     for (UINT pri = NumPriGroups; pri > 0; pri--) {
00205       pReq = (Req *) QueueRemove(ClientReqQueues[pri-1]);
00206       if (pReq != NULL) {
00207         break;
00208       }
00209     }
00210
00211     // We had found a request
00212     if (pReq != NULL) {
00213
00214 #ifdef DEBUG2
00215       _stprintf(Msg, TEXT("RequestFile: Took req %p off Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
00216       DbgMsgRecord(Msg);
00217 #endif
00218
00219       if (CounterIncrement(pClientActiveReqCounters[pReq->Pri])) {
00220         if (QueueHashIncrementCounter(ClientActiveReqHashCounters[pReq->Pri], pReq->pSID)) {
00221 #ifdef DEBUG2
00222           _stprintf(Msg, TEXT("Incremented ClientActiveReqCounters[%d] and ClientActiveReqHashCounters[%d]\n"), pReq->Pri, pReq->Pri);
00223           DbgMsgRecord(Msg);
00224 #endif
00225           // The request now resides on a new queue.
00226           CounterDecrement(pClientReqCounters[pReq->Pri]);
00227 #ifdef DEBUG2
00228           _stprintf(Msg, TEXT("Decremented ClientReqCounters[%d]\n"), pReq->Pri);
00229           DbgMsgRecord(Msg);
00230 #endif
00231           pReq->State = StateActive;
00232
00233 #ifdef DEBUG2
00234           _stprintf(Msg, TEXT("RequestFile: Handling active req %p\n"), pReq);
00235           DbgMsgRecord(Msg);
00236 #endif
00237
00238           return pReq;
00239
00240         }
00241         else {
00242           // There were too many requests for a given SID, place the request back
00243           // onto the queue.
00244
00245           // Don't forget to decrement the counter for the group!
00246           CounterDecrement(pClientActiveReqCounters[pReq->Pri]);
00247
00248           QueueAdd(ClientReqQueues[pReq->Pri], pReq, TRUE);
00249
00250 #ifdef DEBUG2
00251           _stprintf(Msg, TEXT("Too many active requests for a SID\n"));
00252           DbgMsgRecord(Msg);
00253           _stprintf(Msg, TEXT("RequestFile: Put req %p onto Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
00254           DbgMsgRecord(Msg);
00255 #endif
00256         }
00257       }
00258       else {
00259         // There were too many active requests for the user group, place the request back
00260         // onto the queue.
00261
00262         QueueAdd(ClientReqQueues[pReq->Pri], pReq, TRUE);
00263
00264 #ifdef DEBUG2
00265         _stprintf(Msg, TEXT("Too many active requests for priority %d\n"), pReq->Pri);
00266         DbgMsgRecord(Msg);
00267         _stprintf(Msg, TEXT("RequestFile: Put req %p onto Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
00268         DbgMsgRecord(Msg);
00269 #endif
00270       }
00271     }
00272
00273     return NULL;
00274 }
00275
00276 //
00277 // Attempts to find a queued request and post an IO completion
00278 // packet telling the worker threads to begin processing the request.
00279 //
00280 VOID FindAndActivateCReq(VOID) {
00281     DWORD status;
00282
00283     tReq *pReq = FindCReq();
00284
00285     if (pReq) {
00286
00287 #ifdef DEBUG1
00288       QueueAdd(ClientActiveReqQueue, pReq, TRUE);
00289 #endif
00290
00291       // All that is requeired to activate the request is to queue a completion
00292       // packet with Activate key and the Req as Overlapped.
00293       status = PostQueuedCompletionStatus(ClientCompletionPort,
00294                                           0,
00295                                           IoFileRep,
00296                                           (LPOVERLAPPED)pReq);
00297       ASSERT(status);
00298     }
00299 }
00300
00301 //
00302 // Closes the file handle and frees all thread data if an error occured
00303 // in one of the following functions.
00304 //
00305 // The proc may be called while holding pReq->Lock.  It will release it.
00306 //
00307 VOID ClientShutdownRequest(Req *pReq) {
00308   DWORD status;
00309   RPC_STATUS rpcstatus;
00310
00311 #ifdef DEBUG2
00312   TCHAR Msg[MSG_SIZE];
00313   DbgMsgRecord(TEXT("-> ClientShutdownRequest\n"));
00314 #endif
00315
00316   ASSERT(pReq != NULL);
00317
00318
00319   /*
00320     The failuire handling for async pipe call is as follows:
00321
00322       Pull returned failure:
00323       RPC has done all the clenaup. No need to do anything.
00324
00325       Non-RPC failure occurred:
00326       Call RpcAsyncCalncelCall
00327       Wait for call-complete notification
00328       Call RpcAsyncCompleteCall
00329
00330       Received call-complete with failure:
00331       Call RpcAsyncCompleteCall
00332
00333   */
00334
00335   // Complete or cancel the async call, depending on whether
00336   // an error has occurred and whether complete is needed.
00337   if (pReq->bCallMade && !pReq->bFailureFromPull) {
00338
00339     // If we are processing a syncronous failure and the call has not yet
00340     // been cancelled, then cancel the call and return.  We will later get a
00341     // call-complete event and will complete the call then.
00342     if (!pReq->bCallComplete && pReq->Status && !pReq->bAsyncCallFailureReceived && !pReq->bCallCancelled) {
00343
00344       RpcAsyncCancelCall(&(pReq->Async),
00345                          TRUE);
00346       // After cancelling the RPC we return and wait for a
00347       // call-complete notification.  We will continue to clean up afterwards.
00348       pReq->bCallCancelled = TRUE;
00349
00350       if (CriticalSectionOwned(&(pReq->Lock))) {
00351         LeaveCriticalSection(&(pReq->Lock));
00352       }
00353       return;
00354     }
00355
00356     // Complete a call if either an error has occurred and we already received
00357     // a completion notification, or if we had already cancelled it, or
00358     // if the request has been handled.
00359     else {
00360
00361       // If there is an outstanding pull, we should wait for it to complete.
00362       // This can only happen if WriteFile has failed.
00363       ASSERT(!pReq->bPullOutstanding || pReq->bFailureFromWrite);
00364       if (pReq->bPullOutstanding) {
00365         if (CriticalSectionOwned(&(pReq->Lock))) {
00366           LeaveCriticalSection(&pReq->Lock);
00367         }
00368         return;
00369       }
00370
00371
00372       RpcTryExcept {
00373         RpcAsyncCompleteCall(&(pReq->Async),
00374                              &status);
00375       }
00376       RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00377                     (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00378                     (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00379                     (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00380                     (RpcExceptionCode() != STATUS_BREAKPOINT) )
00381                   ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00382         ASSERT(pReq->Status != RPC_S_OK);
00383       }
00384       RpcEndExcept;
00385     }
00386   }
00387
00388
00389   // If there are outstanding writes we should wait for them to complete
00390   // before destroying the object.
00391   if (pReq->nWritesOutstanding > 0) {
00392     if (CriticalSectionOwned(&(pReq->Lock))) {
00393       LeaveCriticalSection(&pReq->Lock);
00394     }
00395     return;
00396   }
00397
00398   // If there have been no failures, then all the bytes written
00399   // should have been written and there must not be any
00400   // bytes unaccounted for.
00401   ASSERT(pReq->Status != RPC_S_OK || pReq->nBytesOutstanding == 0);
00402
00403
00404   if (CriticalSectionOwned(&(pReq->Lock))) {
00405     LeaveCriticalSection(&pReq->Lock);
00406   }
00407
00408 #ifdef DEBUG1
00409   nClientReqs--;
00410 #endif
00411
00412
00413   // We are actually going to wipe out a request after this point
00414   // and need to bring in a new one from the queue.
00415   FindAndActivateCReq();
00416
00417   // Stop impersonating if we are.
00418   // The first thing we do in handling a request is impersonating the client.
00419   if (pReq->bImpersonating) {
00420     if (RevertToSelf() == 0) {
00421       AddToMessageLogProcFailure(TEXT("ClientShutdownRequest: RevertToSelf"), GetLastError());
00422     }
00423     pReq->bImpersonating = FALSE;
00424   }
00425
00426   if(pReq->hFileRepServer != NULL) {
00427     rpcstatus = RpcBindingFree(&(pReq->hFileRepServer));
00428     ASSERT(rpcstatus == RPC_S_OK);
00429   }
00430   // Check that hLocalFile has been initialized and that initialization
00431   // was successful.
00432   if(pReq->hLocalFile != NULL && pReq->hLocalFile != INVALID_HANDLE_VALUE) {
00433
00434     // The file has been extended, truncate its size:
00435     if (pReq->FileWritePos < pReq->CurrentExtendedSize) {
00436       SetFileSize(pReq->hLocalFile, pReq->FileWritePos);
00437     }
00438
00439     status = CloseHandle(pReq->hLocalFile);
00440     ASSERT(status != 0);
00441   }
00442
00443   // Check if any of the counters need to be decremented
00444   // since we are removing the request.
00445   if (pReq->State == StateQueued) {
00446     CounterDecrement(pClientReqCounters[pReq->Pri]);
00447 #ifdef DEBUG2
00448     _stprintf(Msg, TEXT("Decremented ClientReqCounters[%d]\n"), pReq->Pri);
00449     DbgMsgRecord(Msg);
00450 #endif
00451   }
00452   if (pReq->State == StateActive) {
00453     CounterDecrement(pClientActiveReqCounters[pReq->Pri]);
00454     QueueHashDecrementCounter(ClientActiveReqHashCounters[pReq->Pri], pReq->pSID);
00455 #ifdef DEBUG2
00456     _stprintf(Msg, TEXT("Decremented ClientActiveReqCounters[%d] and ClientActiveReqHashCounters[%d]\n"), pReq->Pri, pReq->Pri);
00457     DbgMsgRecord(Msg);
00458 #endif
00459
00460 #ifdef DEBUG1
00461     QueueRemoveData(ClientActiveReqQueue, pReq);
00462 #endif
00463   }
00464
00465   if (pReq->hTokenHandle != NULL) {
00466     status = CloseHandle(pReq->hTokenHandle);
00467     ASSERT(status != NULL);
00468   }
00469
00470   if (pReq->ServerName != NULL) {
00471     AutoHeapFree(pReq->ServerName);
00472   }
00473   if (pReq->LocalFileName != NULL) {
00474     AutoHeapFree(pReq->LocalFileName);
00475   }
00476   if (pReq->RemoteFileName != NULL) {
00477     AutoHeapFree(pReq->RemoteFileName);
00478   }
00479
00480   if (pReq->pSID != NULL) {
00481     AutoHeapFree(pReq->pSID);
00482   }
00483
00484   // If the critical section has been allocated, free it.
00485   if (pReq->Lock.DebugInfo) {
00486     DeleteCriticalSection(&pReq->Lock);
00487   }
00488
00489 #ifdef PROF
00490   ProfRecordTime(pReq->nReqId, TEXT("handled"));
00491 #endif
00492
00493   AutoHeapFree(pReq);
00494
00495 #ifdef DEBUG2
00496   DbgMsgRecord(TEXT("<- ClientShutdownRequest\n"));
00497 #endif
00498 }
00499
00500 //
00501 // Handles a request taken off req queue.
00502 // Returns TRUE on sucess.
00503 //
00504 BOOL HandleReq(tReq *pReq) {
00505
00506     RPC_STATUS rpcstatus;
00507
00508     // Default connection to server system service is over TCP/IP.
00509     LPTSTR DefaultProtocolSequence = TEXT("ncacn_ip_tcp");
00510
00511     // An empty endpoint string is used, since we are going to
00512     // connect to the endpoint dynamically generated by the
00513     // RPC run-time library.  Server calls RpcServerUseProtseq to
00514     // obtain a binding hadnle and a dynamic endpoint.
00515     LPTSTR DefaultEndpoint = TEXT("");
00516
00517     LPTSTR pszUuid = NULL;
00518     LPTSTR pszOptions = NULL;
00519     LPTSTR pszStringBinding = NULL;
00520
00521     //
00522     // If a request is picked of the request queue.
00523     // Then we need to set up binding, bind to the server,
00524     // and do the initial read.
00525     //
00526
00527     // We need to impersonate the user that has issued the
00528     // remote call.
00529     // We want to impersonate as soon as possible to minimise
00530     // the amount of resources that can be consumed by an attack.
00531     if (ImpersonateLoggedOnUser(pReq->hTokenHandle) == 0) {
00532         pReq->Status = GetLastError();
00533         ClientShutdownRequest(pReq);
00534         AddToMessageLogProcFailure(TEXT("HandleReq: ImpersonateLoggedOnUser"), GetLastError());
00535         return FALSE;
00536     }
00537     pReq->bImpersonating = TRUE;
00538
00539     // Prepare the binding information.
00540     if ((rpcstatus = RpcStringBindingCompose(pszUuid,
00541                                              DefaultProtocolSequence,
00542                                              pReq->ServerName,
00543                                              DefaultEndpoint,
00544                                              pszOptions,
00545                                              &pszStringBinding)) != RPC_S_OK) {
00546         pReq->Status = rpcstatus;
00547         ClientShutdownRequest(pReq);
00548         AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: RpcStringBindingCompose"), rpcstatus);
00549         return FALSE;
00550     }
00551
00552     if ((rpcstatus = RpcBindingFromStringBinding(pszStringBinding, &(pReq->hFileRepServer))) != RPC_S_OK) {
00553         // The binding handle is invalid
00554         pReq->hFileRepServer = NULL;
00555
00556         // Deallocate the string binding.
00557         rpcstatus = RpcStringFree(&pszStringBinding);
00558         ASSERT(rpcstatus == RPC_S_OK);
00559
00560         pReq->Status = GetLastError();
00561         ClientShutdownRequest(pReq);
00562         AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: RpcBindingFromStringBinding"), rpcstatus);
00563         return FALSE;
00564     }
00565
00566     // We need to delete the string binding, since it is no longer
00567     // necessary.  All the binding information is now contained in the
00568     // binding handle.
00569     rpcstatus = RpcStringFree(&pszStringBinding);
00570     ASSERT(rpcstatus == RPC_S_OK);
00571
00572 #ifndef NO_SEC
00573     DWORD status;
00574
00575     // Quality of service structure to ensure authentication.
00576     RPC_SECURITY_QOS SecurityQOS;
00577
00578     // The length of the principal name and the principal name
00579     // for the client system service.
00580     TCHAR szSpn[MAX_PATH];
00581     ULONG ulSpn = sizeof(szSpn);
00582
00583     // Generate a principal name for the local system service.
00584     if ((status = DsMakeSpn(SERVICENAME,
00585                             pReq->ServerName,
00586                             NULL,
00587                             0,
00588                             0,
00589                             &ulSpn,
00590                             szSpn)) != ERROR_SUCCESS) {
00591         pReq->Status = GetLastError();
00592         ClientShutdownRequest(pReq);
00593         AddToMessageLogProcFailure(TEXT("HandleReq: DsMakeSpn"), GetLastError());
00594         return FALSE;
00595     }
00596
00597     // Specify quality of service parameters.
00598     SecurityQOS.Version = RPC_C_SECURITY_QOS_VERSION;
00599     SecurityQOS.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH;
00600     // Use static identity tracking since we will be issuing multiple
00601     // RPC calls from this thread with different identities: while
00602     // impersonating, and while not.  This insures that all the calls will
00603     // go to server under the identity of the user who created the binding
00604     // handle.
00605     SecurityQOS.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC;
00606     // The client system service needs to impersonate the security context
00607     // of the client utility on the remote systems where it may replicate
00608     // files from.  It will also need to obtain client's SID and hence
00609     // requires impersonation.
00610     SecurityQOS.ImpersonationType = RPC_C_IMP_LEVEL_IMPERSONATE;
00611
00612     // Set authentification and authorisation information for
00613     // the binding handle.
00614     if ((rpcstatus = RpcBindingSetAuthInfoEx(pReq->hFileRepServer, szSpn, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_GSS_KERBEROS, NULL, RPC_C_AUTHZ_NAME, &SecurityQOS)) != RPC_S_OK) {
00615
00616         pReq->Status = rpcstatus;
00617         ClientShutdownRequest(pReq);
00618         AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: RpcBindingSetAuthInfoEx"), rpcstatus);
00619         return FALSE;
00620     }
00621 #endif
00622
00623     // Initialize the async handle.
00624     RpcAsyncInitializeHandle(&(pReq->Async),
00625                              sizeof(RPC_ASYNC_STATE));
00626     pReq->Async.Flags = RPC_C_NOTIFY_ON_SEND_COMPLETE;
00627     pReq->Async.UserInfo = pReq;
00628     pReq->Async.NotificationType = RpcNotificationTypeIoc;
00629     pReq->Async.u.IOC.hIOPort = ClientCompletionPort;
00630     pReq->Async.u.IOC.dwCompletionKey = IoPipe;
00631     pReq->Async.u.IOC.lpOverlapped = (LPOVERLAPPED) pReq;
00632
00633     // Initialize the request fileds for throtteling the overlapped structure.
00634     pReq->FileOl.Offset = 0;
00635     pReq->FileOl.OffsetHigh = 0;
00636     pReq->FileOl.hEvent = NULL;
00637
00638     pReq->bPullOutstanding = FALSE;
00639     pReq->bBuf = FALSE;
00640     pReq->bDataAvailable = FALSE;
00641     pReq->bAllPullsDone = FALSE;
00642     pReq->bCallComplete = FALSE;
00643     pReq->bAsyncCallFailureReceived = FALSE;
00644     pReq->bFailureFromPull = FALSE;
00645     pReq->bFailureFromWrite = FALSE;
00646
00647     pReq->FileWritePos = 0;
00648     pReq->CurrentExtendedSize = 0;
00649
00650     // Attempt to open the local file.
00651     if ((pReq->hLocalFile = CreateFile(pReq->LocalFileName,
00652                                        GENERIC_WRITE,
00653                                        0,
00654                                        NULL,
00655                                        CREATE_ALWAYS,
00656                                        FILE_FLAG_OVERLAPPED,
00657                                        NULL)) == INVALID_HANDLE_VALUE) {
00658         pReq->Status = GetLastError();
00659         ClientShutdownRequest(pReq);
00660         AddToMessageLogProcFailure(TEXT("HandleReq: CreateFile"), GetLastError());
00661         return FALSE;
00662     }
00663
00664     SetFileSize(pReq->hLocalFile, FILE_SIZE_EXTENSION);
00665
00666     // Link this file to the client requests's IO completion port:
00667     if ((ClientCompletionPort = CreateIoCompletionPort (pReq->hLocalFile,
00668                                                         ClientCompletionPort,
00669                                                         IoFile,
00670                                                         0)) == NULL) {
00671         pReq->Status = GetLastError();
00672         ClientShutdownRequest(pReq);
00673         AddToMessageLogProcFailure(TEXT("HandleActiveReq: CreateIoCompletionPort"), GetLastError());
00674         return FALSE;
00675     }
00676
00677     // We need to enter critical section since right after the call is made
00678     // another thread can receive an asyncronous failure and clean up.
00679     EnterCriticalSection(&pReq->Lock);
00680
00681 #ifdef RETRY_EXCEPTION
00682     // When making aggressive calls to the server, this flag is
00683     // set when the call succeeded.  This makes the client service attempt
00684     // to contact the server even after an exception occured.
00685     BOOL bRetryCall = TRUE;
00686     while (bRetryCall) {
00687 #endif
00688
00689         // Attempt to open the remote file.
00690         RpcTryExcept {
00691             c_RemoteReadAsyncPipe(&(pReq->Async),
00692                                   pReq->hFileRepServer,
00693                                   pReq->RemoteFileName,
00694                                   &(pReq->OutPipe));
00695
00696 #ifdef RETRY_EXCEPTION
00697             bRetryCall = FALSE;
00698 #endif
00699         }
00700         RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00701                       (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00702                       (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00703                       (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00704                       (RpcExceptionCode() != STATUS_BREAKPOINT) )
00705                     ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00706
00707 #ifdef RETRY_EXCEPTION
00708             // This code attempts to make aggressive calls, retrying
00709             // if no endpoints are available.  It is used to put servers
00710             // under stress.
00711             if (RpcExceptionCode() != EPT_S_NOT_REGISTERED &&
00712                 RpcExceptionCode() != RPC_S_SERVER_UNAVAILABLE) {
00713 #endif
00714                 // Deallocate all the thread data before failing.
00715                 pReq->Status = RpcExceptionCode();
00716
00717                 ClientShutdownRequest(pReq);
00718                 AddToMessageLogProcFailureEEInfo(TEXT("HandleReq: c_RemoteOpen"), RpcExceptionCode());
00719
00720                 return FALSE;
00721 #ifdef RETRY_EXCEPTION
00722             }
00723 #endif
00724         }
00725         RpcEndExcept;
00726 #ifdef RETRY_EXCEPTION
00727     }
00728 #endif
00729
00730     pReq->bCallMade = true;
00731
00732     // We need to stop impersonating before putting this request back into
00733     // a queue or quitting.
00734     if (RevertToSelf() == 0) {
00735         pReq->bImpersonating = FALSE;
00736         pReq->Status = GetLastError();
00737         ClientShutdownRequest(pReq);
00738         AddToMessageLogProcFailure(TEXT("HandleReq: RevertToSelf"), GetLastError());
00739     }
00740     pReq->bImpersonating = FALSE;
00741
00742     LeaveCriticalSection(&pReq->Lock);
00743
00744     return TRUE;
00745 }
00746
00747 //
00748 // Handles a request taken off active req queue
00749 //
00750 VOID ServiceRequests(VOID) {
00751     DWORD Status;
00752
00753     // The request that we will be processing
00754     tReq *pReq;
00755
00756 #ifdef DEBUG2
00757     TCHAR Msg[MSG_SIZE];
00758 #endif
00759
00760     // Number of bytes read by a pull
00761     ULONG cbRead;
00762
00763     // Values returned after a wait on the completion port
00764     DWORD dwNumberOfBytesTransferred;
00765     DWORD dwCompletionKey;
00766     OVERLAPPED *lpOverlapped;
00767
00768     // A worker thread starts of by waiting for IO
00769     ActionType Action = Wait;
00770
00771     while(TRUE) {
00772
00773       //
00774       // Make a pull to try and receive data.
00775       //
00776       if (Action == Pull) {
00777
00778         EnterCriticalSection(&pReq->Lock);
00779
00780         // This will be set if we have processed an async failure notification.
00781         // Do not issue any more pulls and just wait for all file
00782         // IO to complete.
00783         if (pReq->bAsyncCallFailureReceived) {
00784
00785           LeaveCriticalSection(&pReq->Lock);
00786
00787           Action = Wait;
00788           continue;
00789         }
00790
00791         // This will be the case if an async write has failed and we want to
00792         // terminate the request.
00793         // Wait for all the writes to be completed.
00794         if (pReq->bFailureFromWrite == TRUE) {
00795
00796           LeaveCriticalSection(&pReq->Lock);
00797
00798           Action = Wait;
00799           continue;
00800         }
00801
00802         // We did not read anything yet.
00803         cbRead = 0;
00804
00805         RpcTryExcept {
00806
00807           WINAPI_MY_PIPE_PULL pPull = (WINAPI_MY_PIPE_PULL)pReq->OutPipe.pull;
00808
00809           pReq->bPullOutstanding = TRUE;
00810
00811
00812           Status = pPull (pReq->OutPipe.state,
00813                           (char *) pReq->pbBuf,
00814                           PULL_BUFSIZE,
00815                           &cbRead);
00816         }
00817         RpcExcept ( ( (RpcExceptionCode() != STATUS_ACCESS_VIOLATION) &&
00818                       (RpcExceptionCode() != STATUS_DATATYPE_MISALIGNMENT) &&
00819                       (RpcExceptionCode() != STATUS_PRIVILEGED_INSTRUCTION) &&
00820                       (RpcExceptionCode() != STATUS_ILLEGAL_INSTRUCTION) &&
00821                       (RpcExceptionCode() != STATUS_BREAKPOINT))
00822                     ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) {
00823
00824           Status = RpcExceptionCode();
00825           ASSERT(Status != RPC_S_OK && Status != RPC_S_ASYNC_CALL_PENDING);
00826         }
00827         RpcEndExcept;
00828
00829         // The pull has failed either through and exception or an
00830         // error return code.
00831         if (Status != RPC_S_OK && Status != RPC_S_ASYNC_CALL_PENDING) {
00832
00833           AddToMessageLogProcFailureEEInfo(TEXT("HandleActiveReq: c_RemoteRead"), Status);
00834
00835           pReq->bFailureFromPull = TRUE;
00836           pReq->bAllPullsDone = TRUE;
00837           pReq->bPullOutstanding = FALSE;
00838           pReq->bCallComplete = TRUE;
00839
00840           // Dump this request.
00841           pReq->Status = Status;
00842           ClientShutdownRequest(pReq);
00843
00844           Action = Wait;
00845         }
00846
00847         // The pull has succeeded.
00848         // We read some data.
00849         else if (Status == RPC_S_OK && cbRead > 0) {
00850
00851           pReq->FileOl.Offset = pReq->FileWritePos;
00852
00853           pReq->bDataAvailable = FALSE;
00854           pReq->bPullOutstanding = FALSE;
00855
00856           pReq->nWritesOutstanding++;
00857           pReq->nBytesOutstanding+=cbRead;
00858
00859           // Access check was done on opening when we were impersonating.
00860           // Thus we do not need to impersonate in this code.
00861           Status = WriteFile(pReq->hLocalFile, pReq->pbBuf, cbRead, NULL, &pReq->FileOl);
00862
00863           // Write has failed.
00864           if(!Status && GetLastError() != ERROR_IO_PENDING) {
00865
00866               AddToMessageLogProcFailure(TEXT("HandleActiveReq: WriteFile"), GetLastError());
00867
00868               pReq->nWritesOutstanding--;
00869
00870               pReq->nBytesOutstanding-=cbRead;
00871
00872               // If we hit a failure on write we will
00873               // stop the pulls, wait for all outstanding IO to
00874               // complete and then finish.
00875               pReq->bFailureFromWrite = TRUE;
00876
00877               // Dump this request.
00878               pReq->Status = GetLastError();
00879               ClientShutdownRequest(pReq);
00880
00881               Action = Wait;
00882           }
00883
00884           // Write has suceeded.
00885           else {
00886
00887             pReq->FileWritePos+=cbRead;
00888
00889             if (pReq->FileWritePos > pReq->CurrentExtendedSize) {
00890               pReq->CurrentExtendedSize+=FILE_SIZE_EXTENSION;
00891               SetFileSize(pReq->hLocalFile, pReq->CurrentExtendedSize);
00892             }
00893
00894             LeaveCriticalSection(&pReq->Lock);
00895
00896             Action = Pull;
00897           }
00898         }
00899
00900         // The pull has suceeded.
00901         // We did not get any data.
00902         // If the pipe is empty and pull returned 0 bytes, the transfer is complete.
00903         else if (Status == RPC_S_OK && cbRead == 0) {
00904
00905           pReq->bDataAvailable = FALSE;
00906           pReq->bPullOutstanding = FALSE;
00907
00908           pReq->bAllPullsDone = TRUE;
00909
00910           // If we have done all the pulls and received call-complete, finish.
00911           if(pReq->bAllPullsDone && pReq->bCallComplete) {
00912             ClientShutdownRequest(pReq);
00913           }
00914           // Otherwise, wait.
00915           else {
00916             LeaveCriticalSection(&pReq->Lock);
00917           }
00918
00919           // We will either complete this request ot wait for all the file
00920           // IO to complete.  In either case, the next action will be Wait.
00921           Action = Wait;
00922         }
00923
00924         // No data is present yet.  A notification will be issued later.
00925         else if (Status == RPC_S_ASYNC_CALL_PENDING && cbRead == 0) {
00926
00927           ASSERT(pReq->bDataAvailable == FALSE);
00928
00929           LeaveCriticalSection(&pReq->Lock);
00930
00931           Action = Wait;
00932         }
00933
00934         // Should not get here
00935         else {
00936
00937           LeaveCriticalSection(&pReq->Lock);
00938
00939           ASSERT(0);
00940         }
00941       }
00942
00943       //
00944       // Wait for IO completion
00945       //
00946       else if (Action == Wait) {
00947
00948         InterlockedIncrement(&nThreadsAtClientCompletionPort);
00949
00950         ASSERT(nThreadsAtClientCompletionPort >= 0);
00951
00952         Status = GetQueuedCompletionStatus(ClientCompletionPort,
00953                                            &dwNumberOfBytesTransferred,
00954                                            (PULONG_PTR)&dwCompletionKey,
00955                                            &lpOverlapped,
00956                                            ClientCompletionPortTimeout);
00957
00958         // Failure to dequeue an IO completion packet.
00959         if (!Status && lpOverlapped == NULL) {
00960
00961           ULONG nThreads = InterlockedDecrement(&nThreadsAtClientCompletionPort);
00962
00963           // Wait timed out.
00964           if (GetLastError() == WAIT_TIMEOUT) {
00965
00966
00967             // If wait timed out and there are other threads waiting on the completion port,
00968             // we can exit.
00969             if (nThreads != 0) {
00970               return;
00971             }
00972             // If there are no other threads, go back to wait for the IO.
00973             else {
00974               continue;
00975             }
00976           }
00977
00978           // Failure occurred and we were unable to dequeue an IO completion
00979           // packet.
00980           else {
00981             AddToMessageLogProcFailure(TEXT("HandleActiveReq: GetQueuedCompletionStatus"), GetLastError());
00982
00983             // Nothing we can do, just wait a little and re-try.
00984             Sleep(100);
00985             Action = Wait;
00986             continue;
00987           }
00988         }
00989
00990         // If this is the last thread to come off a completion port,
00991         // spin up an extra worker thread.  Thi ensures that there is
00992         // always a waiter on the port.
00993         if (InterlockedDecrement(&nThreadsAtClientCompletionPort) == 0) {
00994
00995           HANDLE hThread;
00996           ULONG ThreadIdentifier;
00997           DWORD status;
00998
00999           if ((hThread = CreateThread(NULL,
01000                                       0,
01001                                       (LPTHREAD_START_ROUTINE) ServiceRequests,
01002                                       NULL,
01003                                       0,
01004                                       &ThreadIdentifier)) == NULL) {
01005
01006             // If CreateThread has failed there is nothing that we can do.
01007             // Just continue...
01008             AddToMessageLogProcFailure(TEXT("ServiceRequests: CreateThread"), GetLastError());
01009           }
01010           else {
01011             // Unless we close a handle to the thread, it will remain in the
01012             // system even after its execution has terminated.
01013             status = CloseHandle(hThread);
01014             ASSERT(status != 0);
01015           }
01016         }
01017
01018         ASSERT(nThreadsAtClientCompletionPort >= 0);
01019
01020         // Dequeued an IO completion packet for a successful operation.
01021         // or for an unsucessful operation.  If Status != 0 then the
01022         // operation has suceeded.
01023
01024         // There is at most one async WriteFile outstanding,
01025         // so only one thread may be executing here for a given request.
01026         if (dwCompletionKey == IoFile) {
01027           pReq = (Req *) ((size_t)lpOverlapped - offsetof(Req, FileOl));
01028
01029 #ifdef DEBUG2
01030           _stprintf(Msg, TEXT("HandleActiveReq: received File IO for req %p\n"), pReq);
01031           DbgMsgRecord(Msg);
01032 #endif
01033
01034           EnterCriticalSection(&pReq->Lock);
01035
01036
01037           // File IO suceeded.
01038           if (Status) {
01039
01040             pReq->nWritesOutstanding--;
01041
01042             pReq->nBytesOutstanding-=dwNumberOfBytesTransferred;
01043
01044             ASSERT(pReq->nWritesOutstanding >= 0);
01045
01046             Action = Wait;
01047
01048             if(pReq->bAllPullsDone &&
01049                pReq->nWritesOutstanding <= 0 &&
01050                (pReq->bCallComplete || pReq->bAsyncCallFailureReceived || pReq->bFailureFromWrite)) {
01051
01052               ClientShutdownRequest(pReq);
01053
01054               Action = Wait;
01055             }
01056             else {
01057               LeaveCriticalSection(&pReq->Lock);
01058             }
01059           }
01060
01061           // File IO has failed.
01062           else {
01063             AddToMessageLogProcFailure(TEXT("HandleActiveReq: WriteFile"), GetLastError());
01064
01065             pReq->nWritesOutstanding--;
01066
01067             pReq->nBytesOutstanding-=dwNumberOfBytesTransferred;
01068
01069             pReq->bFailureFromWrite = TRUE;
01070
01071             // We do not want to pull any more data once file IO has failed.
01072             pReq->bAllPullsDone = TRUE;
01073
01074             ASSERT(pReq->nWritesOutstanding >= 0);
01075
01076             // If we hit a failure on write we will
01077             // wait for the async IO to complete.
01078
01079             // Dump this request.
01080             pReq->Status = GetLastError();
01081             if (pReq->Status == 0) {
01082                 pReq->Status = ERROR_OPERATION_ABORTED;
01083             }
01084
01085             ClientShutdownRequest(pReq);
01086
01087             Action = Wait;
01088           }
01089         }
01090
01091         // There is at most one async pull outstanding,
01092         // so at most one thread may be executing here for a given request.
01093         // The only possibility that we need to syncronize against is a pull and a write
01094         // completing simultaneously and racing.
01095         //
01096         // The IO completion packets posted by the RPC runtime correspond to
01097         // sucessful IO only.  Failures are reported as call-complete events.
01098         else if(dwCompletionKey == IoPipe) {
01099           pReq = (Req *) lpOverlapped;
01100
01101 #ifdef DEBUG2
01102           _stprintf(Msg, TEXT("HandleActiveReq: received Pipe IO for req %p\n"), pReq);
01103           DbgMsgRecord(Msg);
01104 #endif
01105
01106       EnterCriticalSection(&pReq->Lock);
01107
01108
01109           //
01110           // Received a call-complete notification from the RPC runtime.
01111           //
01112           if(pReq->Async.Event == RpcCallComplete) {
01113
01114             // It is possible that the server terminated the call prematurely.
01115             // If this is the case find an error.
01116             pReq->Status = RpcAsyncGetCallStatus(&pReq->Async);
01117
01118             ASSERT(pReq->bCallComplete == FALSE ||
01119                    pReq->Status == RPC_S_SERVER_UNAVAILABLE ||
01120                    pReq->Status == RPC_S_CALL_FAILED_DNE ||
01121                    pReq->Status == RPC_S_CALL_FAILED ||
01122                    pReq->Status == RPC_S_CALL_CANCELLED);
01123
01124             // The call did in fact fail.
01125             if (pReq->Status != RPC_S_OK) {
01126
01127               // If the call has failed, forget about doing
01128               // more pulls.
01129               pReq->bAllPullsDone = TRUE;
01130               pReq->bPullOutstanding = FALSE;
01131               pReq->bAsyncCallFailureReceived = TRUE;
01132
01133               // Try to dump the request.
01134               ClientShutdownRequest(pReq);
01135
01136               Action = Wait;
01137             }
01138
01139             // The call did not fail.  We received notification of it's
01140             // sucessful completion.
01141             else {
01142
01143               ASSERT(pReq->bAsyncCallFailureReceived == FALSE);
01144
01145               // Call complete should be the last notification
01146               // received.  We will note this, and wait for the file
01147               // IO to completion if necessary.
01148               pReq->bCallComplete = TRUE;
01149
01150               Action = Wait;
01151
01152               if(pReq->bAllPullsDone) {
01153                 ClientShutdownRequest(pReq);
01154               }
01155               else {
01156                 LeaveCriticalSection(&pReq->Lock);
01157               }
01158             }
01159           }
01160
01161           //
01162           // Got a receive-complete notification from the RPC runtime.
01163           //
01164           else if(pReq->Async.Event == RpcReceiveComplete){
01165
01166             Action = Pull;
01167
01168             ASSERT(pReq->bCallComplete == FALSE);
01169             ASSERT(pReq->bPullOutstanding == TRUE);
01170
01171             // If a pull has completed then there are no more
01172             // outstanding pulls.
01173             pReq->bPullOutstanding = FALSE;
01174
01175             // If an async WriteFile has failed, we would have cancelled the
01176             // call.  After getting a call-complete notification we
01177             // will clean it up.
01178             if (pReq->bCallCancelled) {
01179               Action = Wait;
01180               LeaveCriticalSection(&pReq->Lock);
01181               continue;
01182             }
01183
01184             // If the call is still a sucess, then there must be
01185             // data for us.
01186             pReq->bDataAvailable = TRUE;
01187
01188             LeaveCriticalSection(&pReq->Lock);
01189           }
01190
01191           // We should never be here.
01192           else {
01193             LeaveCriticalSection(&pReq->Lock);
01194
01195             ASSERT(0);
01196           }
01197         }
01198
01199         //
01200         // We got a FileRep internal packet to activate a new request.
01201         //
01202         else if(dwCompletionKey == IoFileRep) {
01203           pReq = (Req *) lpOverlapped;
01204
01205
01206           if(HandleReq(pReq)) {
01207             Action = Pull;
01208           }
01209           else {
01210             Action = Wait;
01211           }
01212         }
01213
01214         else { // dwCompletionKey
01215           ASSERT(0);
01216         }
01217       }
01218
01219       else { // Action
01220         ASSERT(0);
01221       }
01222     }
01223 }
01224
01225 /*
01226     FUNCTIONS: IsSecureClient
01227
01228     PURPOSE:
01229         Returns TRUE if the service is being contacted by a proper
01230       authenticated client.
01231
01232     PARAMETERS:
01233         Self-explanatory.
01234
01235     RETURN VALUE: TRUE if YES, FALSE otherwise or on error.
01236
01237 */
01238 BOOL IsSecureClient(handle_t hFileRepClient, Req *pReq) {
01239
01240 #ifndef NO_SEC
01241     RPC_AUTHZ_HANDLE hAuth;
01242     ULONG ulAuthnLevel;
01243
01244     // Get client security info.
01245     if (RpcBindingInqAuthClient(pReq->hFileRepClient,
01246                                 &hAuth,
01247                                 NULL,
01248                                 &ulAuthnLevel,
01249                                 NULL,
01250                                 NULL) != RPC_S_OK) {
01251         AddRpcEEInfo(GetLastError(), TEXT("RequestFile: RpcBindingInqAuthClient failed"));
01252         return FALSE;
01253     }
01254
01255     // Make sure the client has adequate security measures.
01256     // Since this is LRPC, we get the security level of privacy
01257     // because it is the only available security level.
01258     // We do not interoperate with old versions of FileRep
01259     // client utilities, since appropriate versions should be
01260     // available with the local system service.
01261     if (ulAuthnLevel != RPC_C_AUTHN_LEVEL_PKT_PRIVACY) {
01262         AddRpcEEInfo(RPC_S_SEC_PKG_ERROR, TEXT("RequestFile: ulAuthnLevel != RPC_C_AUTHN_LEVEL_PKT_PRIVACY"));
01263         return FALSE;
01264     }
01265 #endif
01266
01267     return TRUE;
01268 }
01269
01270 /*
01271     FUNCTIONS: RequestFile
01272
01273     PURPOSE:
01274         Called by FileRep to have the Client System
01275       Service request file replication from a Server System Service.
01276       The function processes rpc request and places it in a request
01277       queue.  It then checks the request and active request queues for
01278       requests to process, or exits.
01279
01280     PARAMETERS:
01281         Self-explanatory.
01282
01283     RETURN VALUE: none
01284
01285 */
01286 VOID RequestFile(handle_t hFileRepClient,
01287                  LPTSTR ServerName,
01288                  LPTSTR RemoteFileName,
01289                  LPTSTR LocalFileName) {
01290
01291     RPC_STATUS rpcstatus;
01292
01293     Req *pReq = NULL;
01294
01295     // The string binding that is used to make sure clients contact the
01296     // service via an LRPC call.
01297     LPTSTR StringBinding;
01298
01299     // The protocol sequence that gets extracted from the string binding.
01300     LPTSTR ProtSeq;
01301
01302     TCHAR Msg[MSG_SIZE];
01303
01304 #ifdef DEBUG2
01305     DbgMsgRecord(TEXT("-> RequestFile\n"));
01306 #endif
01307
01308     if((pReq = (Req *) AutoHeapAlloc(sizeof(Req))) == NULL) {
01309         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
01310         return;
01311     }
01312
01313     // Set pReq' fields to NULL so that we will know
01314     // in ClientShutdownRequest which ones have been initialized.
01315     pReq->hFileRepServer = NULL;
01316
01317     pReq->hFileRepClient = hFileRepClient;
01318
01319     pReq->hTokenHandle = NULL;
01320
01321     pReq->hLocalFile = NULL;
01322     pReq->bImpersonating = FALSE;
01323     pReq->Pri = 0;
01324     pReq->State = StateArrived;
01325
01326     pReq->ServerName = NULL;
01327     pReq->LocalFileName = NULL;
01328     pReq->RemoteFileName = NULL;
01329
01330     pReq->pSID = NULL;
01331
01332     pReq->Status = 0;
01333
01334     pReq->bCallMade = FALSE;
01335     pReq->bCallCancelled = FALSE;
01336
01337     pReq->Lock.DebugInfo = NULL;
01338
01339
01340     pReq->nWritesOutstanding = 0;
01341     pReq->nBytesOutstanding = 0;
01342
01343 #ifdef DEBUG1
01344     nClientReqs++;
01345
01346 #endif
01347
01348     // Copy strings out since they may need to be allocated longer then
01349     // the arguments that live on the stack.
01350     // It is conceivable that this thread will put the
01351     // request on the queue and some other thread will
01352     // handle the request after this thread has exited.
01353     if ((pReq->ServerName = (LPTSTR) AutoHeapAlloc((_tcslen(ServerName)+1) * sizeof(TCHAR))) == NULL) {
01354         pReq->Status = GetLastError();
01355         ClientShutdownRequest(pReq);
01356         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
01357         return;
01358     }
01359     CopyMemory(pReq->ServerName, ServerName, (_tcslen(ServerName)+1) * sizeof(TCHAR));
01360     if ((pReq->RemoteFileName = (LPTSTR) AutoHeapAlloc((_tcslen(RemoteFileName)+1) * sizeof(TCHAR))) == NULL) {
01361         pReq->Status = GetLastError();
01362         ClientShutdownRequest(pReq);
01363         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
01364         return;
01365     }
01366     CopyMemory(pReq->RemoteFileName, RemoteFileName, (_tcslen(RemoteFileName)+1) * sizeof(TCHAR));
01367     if ((pReq->LocalFileName = (LPTSTR) AutoHeapAlloc((_tcslen(LocalFileName)+1) * sizeof(TCHAR))) == NULL) {
01368         pReq->Status = GetLastError();
01369         ClientShutdownRequest(pReq);
01370         AddRpcEEInfoAndRaiseException(ERROR_OUTOFMEMORY, TEXT("RequestFile: AutoHeapAlloc failed"));
01371         return;
01372     }
01373     CopyMemory(pReq->LocalFileName, LocalFileName, (_tcslen(LocalFileName)+1) * sizeof(TCHAR));
01374
01375 #ifdef PROF
01376     static ULONG nTotalId;
01377
01378     EnterCriticalSection(&ProfCriticalSection);
01379
01380     // Record the number of the current request.
01381     pReq->nReqId = nTotalId;
01382     // Increment the number of the request.
01383     nTotalId++;
01384
01385     LeaveCriticalSection(&ProfCriticalSection);
01386
01387     _stprintf(Msg, TEXT("name=\"%s\" arrived"), RemoteFileName);
01388
01389     // Record the time of arrival of this request.
01390     ProfRecordTime(pReq->nReqId, Msg);
01391 #endif
01392
01393     // Make sure that the client utility is local.
01394     // Client system service only services LRPC calls.
01395     if ((rpcstatus = RpcBindingToStringBinding(pReq->hFileRepClient, &StringBinding)) != RPC_S_OK) {
01396         pReq->Status = rpcstatus;
01397         ClientShutdownRequest(pReq);
01398         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcBindingToStringBinding failed"));
01399         return;
01400     }
01401     if ((rpcstatus = RpcStringBindingParse(StringBinding, NULL, &ProtSeq, NULL, NULL, NULL)) != RPC_S_OK) {
01402         pReq->Status = rpcstatus;
01403
01404         // Free the string binding.
01405         rpcstatus = RpcStringFree(&StringBinding);
01406         ASSERT(rpcstatus == RPC_S_OK);
01407
01408         rpcstatus = pReq->Status;
01409         ClientShutdownRequest(pReq);
01410         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcStringBindingParse failed"));
01411         return;
01412     }
01413     if (_tcscmp(ProtSeq, TEXT("ncalrpc")) != 0) {
01414
01415         // Free the string binding.
01416         rpcstatus = RpcStringFree(&StringBinding);
01417         ASSERT(rpcstatus == RPC_S_OK);
01418         // And the protocol sequence
01419         rpcstatus = RpcStringFree(&ProtSeq);
01420         ASSERT(rpcstatus == RPC_S_OK);
01421
01422         pReq->Status = ERROR_ACCESS_DENIED;
01423         ClientShutdownRequest(pReq);
01424         AddRpcEEInfoAndRaiseException(RPC_S_INVALID_RPC_PROTSEQ, TEXT("RequestFile: _tcscmp(ProtSeq, TEXT(\"ncalrpc\")) != 0"));
01425         return;
01426     }
01427
01428     // Free the string binding.
01429     rpcstatus = RpcStringFree(&StringBinding);
01430     ASSERT(rpcstatus == RPC_S_OK);
01431     // And the protocol sequence.
01432     rpcstatus = RpcStringFree(&ProtSeq);
01433     ASSERT(rpcstatus == RPC_S_OK);
01434
01435 #ifndef NO_SEC
01436     if (!IsSecureClient(hFileRepClient, pReq)) {
01437         pReq->Status = ERROR_ACCESS_DENIED;
01438         ClientShutdownRequest(pReq);
01439         AddRpcEEInfoAndRaiseException(RPC_S_SEC_PKG_ERROR, TEXT("RequestFile: IsSecureClient failed"));
01440         return;
01441     }
01442 #endif
01443
01444     //
01445     // Check that we are not exceeding the bound on the number
01446     // of concurrent requests for this user's priority group.
01447     // And update the number of such requests.
01448     //
01449
01450     // Impersonate the caller so that we can get the caller's SID
01451     // Sometimes RpcImpersonateClient may fail under heavy load.
01452 #ifdef RETRY_EXCEPTION
01453     rpcstatus = RPC_S_OK;
01454     unsigned tries = 0;
01455     do {
01456       if (rpcstatus != RPC_S_OK) {
01457         tries++;
01458         Sleep(100);
01459       }
01460       rpcstatus = RpcImpersonateClient(pReq->hFileRepClient);
01461     }
01462     while (rpcstatus != RPC_S_OK && tries < 10);
01463 #else
01464     rpcstatus = RpcImpersonateClient(pReq->hFileRepClient);
01465 #endif
01466
01467     if (rpcstatus != RPC_S_OK) {
01468         pReq->Status = GetLastError();
01469         ClientShutdownRequest(pReq);
01470         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcImpersonateClient failed"));
01471         return;
01472     }
01473     pReq->bImpersonating = TRUE;
01474
01475     // We need to write down the access token for the user so that
01476     // we can use it for impersonation later when the client binding handle
01477     // gets deallocated.
01478     if (OpenThreadToken(GetCurrentThread(),
01479                         TOKEN_QUERY | TOKEN_IMPERSONATE,
01480                         TRUE,
01481                         &pReq->hTokenHandle) == 0) {
01482
01483         pReq->Status = GetLastError();
01484         ClientShutdownRequest(pReq);
01485         AddRpcEEInfoAndRaiseException(GetLastError(), TEXT("RequestFile: OpenThreadToken failed"));
01486         return;
01487     }
01488
01489     // Determine current user's priority level.  This corresponds to the
01490     // priority level of the callee, since we are impersonating.
01491     pReq->Pri = GetCurrentUserPriority();
01492
01493     // Write down the SID for the user.
01494     pReq->pSID = GetUserSID();
01495     if (pReq->pSID == NULL) {
01496         pReq->Status = RPC_S_CALL_FAILED;
01497         ClientShutdownRequest(pReq);
01498         AddRpcEEInfoAndRaiseException(RPC_S_CALL_FAILED, TEXT("RequestFile: GetUserSID failed"));
01499         return;
01500     }
01501
01502     // Stop impersonating.  We got what we wanted.
01503     if ((rpcstatus = RpcRevertToSelf()) != RPC_S_OK) {
01504         pReq->Status = GetLastError();
01505         pReq->bImpersonating = FALSE;
01506         ClientShutdownRequest(pReq);
01507         AddRpcEEInfoAndRaiseException(rpcstatus, TEXT("RequestFile: RpcRevertToSelf failed"));
01508         return;
01509     }
01510     pReq->bImpersonating = FALSE;
01511
01512     // Init the critsec.
01513     if (InitializeCriticalSectionAndSpinCount(&pReq->Lock, 10) == 0) {
01514         AddRpcEEInfoAndRaiseException(GetLastError(), TEXT("ProfOpenLog: InitializeCriticalSectionAndSpinCount"));
01515         return;
01516     }
01517
01518 #ifdef DEBUG2
01519     _stprintf(Msg, TEXT("RequestFile: Pri=%d for req %p\n"), pReq->Pri, pReq);
01520     DbgMsgRecord(Msg);
01521 #endif
01522
01523     HANDLE hThread;
01524     ULONG ThreadIdentifier;
01525     DWORD status;
01526
01527     // If the number of worker threads is lower then the maximum, create one.
01528     if (nThreadsAtClientCompletionPort < 1) {
01529
01530       // Go service some requests, remember that you are
01531       // an RPC thread.
01532       if ((hThread = CreateThread(NULL,
01533                                   0,
01534                                   (LPTHREAD_START_ROUTINE) ServiceRequests,
01535                                   NULL,
01536                                   0,
01537                                   &ThreadIdentifier)) == NULL) {
01538
01539         pReq->Status = GetLastError();
01540         ClientShutdownRequest(pReq);
01541         AddToMessageLogProcFailure(TEXT("ServiceRequests: CreateThread"), GetLastError());
01542         return;
01543       }
01544
01545       // Unless we close a handle to the thread, it will remain in the
01546       // system even after its execution has terminated.
01547       status = CloseHandle(hThread);
01548       ASSERT(status != 0);
01549     }
01550
01551     // We need to wait putting the request onto the queue untill we know that we could create
01552     // a worker thread.
01553
01554     // Increment the counter for the number of concurrent requests.
01555     if (!CounterIncrement(pClientReqCounters[pReq->Pri])) {
01556
01557         pReq->Status = RPC_S_SERVER_TOO_BUSY;
01558         ClientShutdownRequest(pReq);
01559         // We have to raise exception after deallocating the data
01560         // since there is a possibility that a client thread
01561         // will retry and will attempt to open this local file
01562         // while it's previous request is still holding a lock.
01563         // This has been actually hit on an overloaded system.
01564         AddRpcEEInfoAndRaiseException(RPC_S_SERVER_TOO_BUSY, TEXT("RequestFile: CounterIncrement failed"));
01565 #ifdef DEBUG2
01566         DbgMsgRecord(TEXT("<- RequestFile\n"));
01567 #endif
01568         return;
01569     }
01570 #ifdef DEBUG2
01571     _stprintf(Msg, TEXT("Incremented ClientReqCounters[%d]\n"), pReq->Pri);
01572     DbgMsgRecord(Msg);
01573 #endif
01574
01575     pReq->State = StateQueued;
01576
01577     // Place the request onto the queue.
01578     // The request will be picked off the queue by a worker thread from the
01579     // completion port and activate later.
01580     QueueAdd(ClientReqQueues[pReq->Pri], pReq, TRUE);
01581 #ifdef DEBUG2
01582     _stprintf(Msg, TEXT("RequestFile: Put req %p onto Req queue %p\n"), pReq, ClientReqQueues[pReq->Pri]);
01583     DbgMsgRecord(Msg);
01584 #endif
01585
01586     // Now if we can, find a queued request and activate it.
01587     FindAndActivateCReq();
01588
01589 #ifdef DEBUG2
01590     DbgMsgRecord(TEXT("<- RequestFile\n"));
01591 #endif
01592     return;
01593 }
01594
01595 // end FileRepClientProc.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_tagPROGRESSMSG Member List

This is the complete list of members for _tagPROGRESSMSG, including all inherited members.
ItemID | _tagPROGRESSMSG
lpSyncProgressItem | _tagPROGRESSMSG
Generated on Wed Nov 13 2024 16:55:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEnumConnectionPoints Member List

This is the complete list of members for CEnumConnectionPoints, including all inherited members.
AddRef() | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
CEnumConnectionPoints() | CEnumConnectionPoints | [private]
CEnumConnectionPoints(const CEnumConnectionPoints &) | CEnumConnectionPoints | [private]
CEnumConnectionPoints(LPUNKNOWN lpUnk, DWORD nCount) | CEnumConnectionPoints |
CEnumXXX(LPUNKNOWN lpUnk, REFIID iid, DWORD nCount) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [protected]
Clone(IEnumConnectionPoints **ppenum) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
Copy(LPCONNECTIONPOINT *lpCPLeft, LPCONNECTIONPOINT lpCPRight) | CEnumConnectionPoints |
Create(LPUNKNOWN lpUnk, DWORD nCount, LPCONNECTIONPOINT *elemlist) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [static]
FinalRelease() | CEnumConnectionPoints | [virtual]
Init(LPCONNECTIONPOINT *elemlist) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [protected, virtual]
m_cELT | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > |
m_cRef | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > |
m_iCur | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > |
m_iid | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > |
m_lpunk | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > |
m_prgELT | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > |
Next(ULONG celt, LPCONNECTIONPOINT *rgelt, PULONG pceltFetched) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
operator&() | CEnumConnectionPoints | [private]
operator&() const | CEnumConnectionPoints | [private]
operator=(const CEnumConnectionPoints &) | CEnumConnectionPoints | [private]
QueryInterface(REFIID iid, PVOID *ppv) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
Release() | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
Reset(void) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
Skip(ULONG celt) | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
~CEnumConnectionPoints() | CEnumConnectionPoints |
~CEnumXXX() | CEnumXXX< CEnumConnectionPoints, LPCONNECTIONPOINT, IEnumConnectionPoints > | [virtual]
Generated on Wed Nov 13 2024 16:56:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSDKSamplePlaylistParserPlugin Member List

This is the complete list of members for CSDKSamplePlaylistParserPlugin, including all inherited members.
CreatePlaylistParser(IWMSCommandContext *pCommandContext, IWMSContext *pUser, IWMSContext *pPresentation, DWORD dwFlags, IWMSClassObject *pFactory, IWMSBufferAllocator *pBufferAllocator, IWMSPlaylistParserPluginCallback *pCallback, QWORD qwContext) | CSDKSamplePlaylistParserPlugin | [virtual]
CSDKSamplePlaylistParserPlugin() | CSDKSamplePlaylistParserPlugin |
DisablePlugin() | CSDKSamplePlaylistParserPlugin |
EnablePlugin(long *pdwFlags, long *pdwHeartbeatPeriod) | CSDKSamplePlaylistParserPlugin |
GetCustomAdminInterface(IDispatch **ppValue) | CSDKSamplePlaylistParserPlugin | [virtual]
InitializePlugin(IWMSContext *pServerContext, IWMSNamedValues *pNamedValues, IWMSClassObject *pClassFactory) | CSDKSamplePlaylistParserPlugin | [virtual]
m_spClassFactory | CSDKSamplePlaylistParserPlugin | [protected]
m_spNamedValues | CSDKSamplePlaylistParserPlugin | [protected]
m_spServerContext | CSDKSamplePlaylistParserPlugin | [protected]
OnHeartbeat() | CSDKSamplePlaylistParserPlugin | [virtual]
ShutdownPlugin() | CSDKSamplePlaylistParserPlugin |
~CSDKSamplePlaylistParserPlugin() | CSDKSamplePlaylistParserPlugin |
Generated on Wed Nov 13 2024 16:57:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Audio/multichan/wave.cpp Source File

  • Multimedia
  • Audio
  • multichan

wave.cpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * wave.cpp
00003  *****************************************************************************
00004  * Copyright (c) Microsoft Corporation.
00005  */
00006
00007 #include "stdafx.h"
00008 #include "resource.h"
00009 #include "wave.h"
00010 #include <mmreg.h>
00011 #include "ChildView.h"
00012 #include <msacm.h>
00013
00014 // -----------------------------------------------------------------------------------------
00015 /*
00016  *  WaveOpenFile  : opens a wave file, validates format, extracts parameters
00017  */
00018 HANDLE
00019 WaveOpenFile
00020 (
00021     IN  LPCSTR          szFileName,
00022     OUT WAVEFORMATEX**  ppWaveFormatEx,
00023     OUT PULONG          pcbData
00024 )
00025 {
00026     HMMIO         hmmio;              // mmio style file handle
00027     MMCKINFO        mmckinfoParent;     // parent chunk info struct
00028     MMCKINFO        mmckinfoSubchunk; // sub chunk
00029     HWND            hwnd = AfxGetMainWnd()->m_hWnd;
00030
00031     HANDLE          hFile = INVALID_HANDLE_VALUE;
00032     ULONG         cbFormat = 0;
00033     LONG            lDataPos = 0;
00034
00035     // open the file
00036     if(!(hmmio = mmioOpen((LPSTR)szFileName, NULL, MMIO_READ | MMIO_ALLOCBUF)))
00037     {
00038         return FALSE;
00039     }
00040
00041     // verify that the file is of type "WAVE"
00042     mmckinfoParent.fccType = MAKEFOURCC('W', 'A', 'V', 'E');
00043     if(mmioDescend(hmmio, (LPMMCKINFO)&mmckinfoParent, NULL, MMIO_FINDRIFF))
00044     {
00045         // not a "WAVE" file!!
00046         MessageBox(hwnd, "WaveOpenFile:  Missing 'WAVE' chunk.This does not appear to be a wave file.", "MultiChan : Error opening wave file!", MB_ICONEXCLAMATION | MB_OK);
00047         goto _error_;
00048     }
00049
00050     // find the "fmt " chunk (must be a subchunk of the "WAVE" chunk)
00051     mmckinfoSubchunk.ckid = MAKEFOURCC('f', 'm', 't', ' ');
00052     if(mmioDescend(hmmio, (LPMMCKINFO)&mmckinfoSubchunk, (LPMMCKINFO)&mmckinfoParent, MMIO_FINDCHUNK))
00053     {
00054         // file has no "fmt " chunk
00055         MessageBox(hwnd, "WaveOpenFile:  Missing 'fmt ' chunk", "MultiChan : Error opening wave file!", MB_ICONEXCLAMATION | MB_OK);
00056         goto _error_;
00057     }
00058
00059     // get the size of the "fmt " chunk
00060     cbFormat = mmckinfoSubchunk.cksize;
00061
00062     // allocate waveformat.  The "max" part ensures that the cbSize member of the WAVEFORMATEX exists and = 0
00063     *ppWaveFormatEx = (LPWAVEFORMATEX)LocalAlloc(LPTR, max(cbFormat, sizeof(WAVEFORMATEX)));
00064     if(!*ppWaveFormatEx)
00065     {
00066         // failed to allocate
00067         MessageBox(hwnd, "WaveOpenFile:  Failed to allocate memory", "MultiChan : Error opening wave file!", MB_ICONEXCLAMATION | MB_OK);
00068         goto _error_;
00069     }
00070
00071     // read the "fmt " chunk
00072     if(mmioRead(hmmio, (HPSTR)*ppWaveFormatEx, cbFormat) != (LONG)cbFormat)
00073     {
00074         // failed to read the "fmt " chunk
00075         MessageBox(hwnd, "WaveOpenFile:  Error reading 'fmt ' chunk", "MultiChan : Error opening wave file!", MB_ICONEXCLAMATION | MB_OK);
00076         goto _error_;
00077     }
00078
00079     // ascend out o' the "fmt " chunk
00080     mmioAscend(hmmio, &mmckinfoSubchunk, 0);
00081
00082     // and find the data subchunk.  (current file pos should be at the beginning of the
00083     // data chunk, but when you assume...)
00084     mmckinfoSubchunk.ckid = MAKEFOURCC('d', 'a', 't', 'a');
00085     if(mmioDescend(hmmio, &mmckinfoSubchunk, &mmckinfoParent, MMIO_FINDCHUNK))
00086     {
00087         // wave file doesn't appear to have a data chunk
00088         MessageBox(hwnd, "WaveOpenFile:  Missing 'data' chunk", "MultiChan : Error opening wave file!", MB_ICONEXCLAMATION | MB_OK);
00089         goto _error_;
00090     }
00091
00092     // get the size of the "data" subchunk
00093     *pcbData = mmckinfoSubchunk.cksize;
00094     if(0L == *pcbData)
00095     {
00096         // the data chunk contains no data
00097         MessageBox(hwnd, "WaveOpenFile:  Error reading 'data' chunk", "MultiChan : Error opening wave file!", MB_ICONEXCLAMATION | MB_OK);
00098         goto _error_;
00099     }
00100
00101     // remember the data
00102     lDataPos = mmioSeek(hmmio, 0, SEEK_CUR);
00103     mmioClose(hmmio, 0);
00104
00105     //
00106     // now we are done with the mmio functions.  Reopen the file and seek to the data chunk using normal
00107     // file io routines
00108     //
00109
00110     __try
00111     {
00112         hFile =
00113             CreateFile
00114             (
00115                 szFileName,
00116                 GENERIC_READ,
00117                 FILE_SHARE_READ,
00118                 NULL,
00119                 OPEN_EXISTING,
00120                 FILE_ATTRIBUTE_NORMAL,
00121                 NULL
00122             );
00123     }
00124     __except(EXCEPTION_EXECUTE_HANDLER)
00125     {
00126         MessageBox(hwnd, "WaveOpenFile : Handling exception thrown by CreateFile!", "MultiChan : Error opening wave file!", MB_ICONEXCLAMATION | MB_OK);
00127         goto _error_;
00128     }
00129
00130     if (!IsValidHandle(hFile))
00131     {
00132         goto _error_;
00133     }
00134
00135     SetFilePointer
00136     (
00137         hFile,
00138         lDataPos,
00139         NULL,
00140         FILE_BEGIN
00141     );
00142
00143     return hFile;
00144
00145 _error_:
00146     SafeCloseHandle(hFile);
00147     if(hmmio)
00148     {
00149         mmioClose(hmmio, 0);
00150     }
00151
00152     return INVALID_HANDLE_VALUE;
00153 }
00154
00155 // -----------------------------------------------------------------------------------------
00156 /*
00157  *  WaveSaveFile  : creates and writes the mixed wave; returns success code
00158  */
00159 BOOL
00160 WaveSaveFile
00161 (
00162     IN  LPCSTR          szFileName,
00163     OUT WAVEFORMATEX*   pWaveFormatEx,
00164     IN  PVOID           pvData,
00165     IN  ULONG           cbData
00166 )
00167 {
00168     HANDLE          hFile   = INVALID_HANDLE_VALUE;
00169     ULONG           cbWritten;
00170   HRSRC           hrsrc   = (HRSRC)INVALID_HANDLE_VALUE;
00171     void*           pv      = NULL;
00172
00173     //
00174     // now we are done with the mmio functions.  Reopen the file and seek to the data chunk using normal
00175     // file io routines
00176     //
00177
00178     __try
00179     {
00180         hFile =
00181             CreateFile
00182             (
00183                 szFileName,
00184                 GENERIC_WRITE,
00185                 0,
00186                 NULL,
00187                 CREATE_ALWAYS,
00188                 FILE_ATTRIBUTE_NORMAL,
00189                 NULL
00190             );
00191     }
00192     __except(EXCEPTION_EXECUTE_HANDLER)
00193     {
00194         MessageBox(AfxGetMainWnd()->m_hWnd, "WaveSaveFile : Handling exception thrown by CreateFile!", "MultiChan : Error creating wave file", MB_ICONEXCLAMATION | MB_OK);
00195         goto _error_;
00196     }
00197
00198     if (!IsValidHandle(hFile))
00199         goto _error_;
00200
00201   //
00202   // write file header
00203   //
00204
00205     // standard wave goo
00206     struct
00207     {
00208         DWORD   fourccData;
00209         DWORD   dwDataLength;
00210     } DataHeader;
00211
00212     DataHeader.fourccData         = MAKEFOURCC('d','a','t','a');
00213     DataHeader.dwDataLength       = cbData;
00214
00215     struct
00216     {
00217         DWORD       dwRiff;
00218         DWORD       dwFileSize;
00219         DWORD       dwWave;
00220         DWORD       dwFormat;
00221         DWORD       dwFormatLength;
00222     } FileHeader;
00223
00224     FileHeader.dwRiff             = MAKEFOURCC('R','I','F','F');
00225     FileHeader.dwWave             = MAKEFOURCC('W','A','V','E');
00226     FileHeader.dwFormat           = MAKEFOURCC('f','m','t',' ');
00227     FileHeader.dwFormatLength     = sizeof(WAVEFORMATEX) + pWaveFormatEx->cbSize;
00228     FileHeader.dwFileSize         = sizeof(FileHeader) + FileHeader.dwFormatLength + sizeof(DataHeader) + cbData;
00229
00230     if(!WriteFile(hFile, &FileHeader, sizeof(FileHeader), &cbWritten, NULL))
00231         goto _error_;
00232
00233     // wave format
00234     if(!WriteFile(hFile, pWaveFormatEx, sizeof(WAVEFORMATEX) + pWaveFormatEx->cbSize, &cbWritten, NULL))
00235         goto _error_;
00236
00237     // data chuck
00238     if(!WriteFile(hFile, &DataHeader, sizeof(DataHeader), &cbWritten, NULL))
00239         goto _error_;
00240
00241     //
00242     // Write wave data
00243     //
00244     if(!WriteFile(hFile, pvData, cbData, &cbWritten, NULL))
00245         goto _error_;
00246
00247     SafeCloseHandle( hFile );
00248     return TRUE;
00249
00250 _error_:
00251     MessageBox(NULL, "WaveSaveFile : Error Writing File", "MultiChan : Error!", MB_ICONEXCLAMATION | MB_OK);
00252     SafeCloseHandle( hFile );
00253     return FALSE;
00254 }
00255
00256
00257
00258 // ===============================================================
00259 /*
00260  *   WavePlayFileCB
00261  *   callback for the waveOut functions
00262  *   notifies the originating window
00263  */
00264 void
00265 CALLBACK
00266 WavePlayFileCB
00267 (
00268     HWAVEOUT  hwo,
00269     UINT    uMsg,
00270     DWORD_PTR dwInstance,
00271     DWORD_PTR dwParam1,
00272     DWORD_PTR dwParam2
00273 )
00274 {
00275     DWORD       mmr = MMSYSERR_BASE;
00276
00277     ASSERT( ( CDialog * )dwInstance );
00278
00279     switch( uMsg )
00280     {
00281         case    WOM_OPEN:
00282             {
00283                 //
00284                 //  notify window
00285                 //
00286                 (( CDialog * )dwInstance)->PostMessage( WM_START_PLAYBACK, 0, 0 );
00287
00288                 break;
00289             }
00290         case    WOM_DONE:
00291             {
00292                 //
00293                 //  notify window
00294                 //
00295                 (( CDialog * )dwInstance)->PostMessage( WM_STOP_PLAYBACK, 0, 0 );
00296
00297                 break;
00298             }
00299
00300         case    WOM_CLOSE:
00301             {
00302
00303                 break;
00304             }
00305
00306
00307         default:
00308             ASSERT(0);
00309     }
00310     return;
00311 }
00312
00313 /*
00314  *  WaveDisablePlayback
00315  *  prevent other channels from being played at this time
00316  */
00317 void
00318 WaveTogglePlayback
00319 (
00320       CDlgSrc * pdlgSelf,
00321   const BOOL    fSwitch
00322 )
00323 {
00324   CDlgSrc * pdlgSrc = 0;
00325   //
00326   //  fSwitch toggles between disable (FALSE) and allow (TRUE)
00327   //
00328
00329   for
00330   (
00331     POSITION  position = g_listSources.GetHeadPosition();
00332     position;
00333   )
00334   {
00335     pdlgSrc = g_listSources.GetNext( position );
00336     //
00337     //  disable/enable the play button. the stop button is unaffected
00338     //
00339     pdlgSrc->m_fPlayable = fSwitch;
00340     (pdlgSrc->m_butPlay).EnableWindow( fSwitch );
00341   }
00342
00343   //
00344   //  check target
00345   //
00346   if( pdlgSelf )
00347   {
00348     //  allow stop
00349     (pdlgSelf->m_butStop).EnableWindow( !fSwitch );
00350
00351     //  destination may not be mixed already
00352     if( g_pdlgDest->m_fPlayable )
00353     {
00354       g_pdlgDest->m_fPlayable = fSwitch;
00355       (g_pdlgDest->m_butPlay).EnableWindow( fSwitch );
00356     }
00357     else
00358     {
00359       g_pdlgDest->m_fPlayable = fSwitch & (0 != g_pdlgDest->m_pbData);
00360       (g_pdlgDest->m_butPlay).EnableWindow( g_pdlgDest->m_fPlayable );
00361     }
00362   }
00363   else
00364   {
00365     g_pdlgDest->m_fPlayable = fSwitch;
00366     (g_pdlgDest->m_butPlay).EnableWindow( fSwitch );
00367     (g_pdlgDest->m_butStop).EnableWindow( !fSwitch );
00368   }
00369
00370
00371 } //  WaveTogglePlayback
00372
00373
00374 // ----------------------------------------------------------------------------------
00375 // TrapMMError
00376 // return:          FALSE if it is an error, TRUE otherwise
00377 // ----------------------------------------------------------------------------------
00378 BOOL
00379 TrapMMError
00380 (
00381     MMRESULT mmRes,
00382     LPCSTR   szAPI
00383 )
00384 {
00385   //  no error
00386     if(MMSYSERR_NOERROR == mmRes)
00387     {
00388         return( TRUE );
00389     }
00390
00391     HWND    hwndMain        = AfxGetMainWnd()->m_hWnd;
00392     char    szError[128]  = "";
00393     char    szErrMsg[128] = "";
00394
00395   //  basic mmsys error
00396   if( MMSYSERR_LASTERROR >= mmRes )
00397   {
00398     if( MMSYSERR_NOMEM == waveOutGetErrorText( mmRes, szError, 128 ) )
00399     {
00400       _snprintf( szErrMsg, 128, "Insufficient memory to complete the task.");
00401     }
00402         else
00403         {
00404         _snprintf( szErrMsg, 128, "ERROR : %s returned : %s", szAPI, szError );
00405         }
00406   }
00407     else
00408     {
00409       //  other errors
00410       switch( mmRes )
00411       {
00412         case  WAVERR_BADFORMAT  :
00413         {
00414           strcpy( szError, " : Attempt to open an unsupported waveform-audio format." );
00415           break;
00416         }
00417
00418         case  WAVERR_STILLPLAYING :
00419         {
00420           strcpy( szError, " : There is another waveform resource still playing." );
00421           break;
00422         }
00423
00424         case  WAVERR_UNPREPARED :
00425         {
00426           strcpy( szError, " : Header is not prepared." );
00427           break;
00428         }
00429
00430         case  WAVERR_SYNC     :
00431         {
00432           strcpy( szError, " : Device is synchronous." );
00433           break;
00434         }
00435
00436         case  ACMERR_NOTPOSSIBLE  :
00437         {
00438           strcpy( szError, " : The specified action is not possible in the current context." );
00439           break;
00440         }
00441
00442         case  ACMERR_BUSY :
00443         {
00444           strcpy( szError, " : The driver is currently in use and cannot be reused." );
00445           break;
00446         }
00447
00448         case  ACMERR_UNPREPARED :
00449         {
00450           strcpy( szError, " : The stream header is not currently prepared." );
00451           break;
00452         }
00453
00454         case  ACMERR_CANCELED   :
00455         {
00456           strcpy( szError, " : The action has been canceled." );
00457           break;
00458         }
00459
00460         default :
00461         {
00462           //  default
00463           _snprintf( szError, 128, "an unrecognized error code (%d).", mmRes );
00464           break;
00465         }
00466         } //  switch
00467
00468     _snprintf( szErrMsg, 128, "ERROR : %s returned %s.", szAPI, szError );
00469   }
00470
00471     // Display the string.
00472   MessageBox(hwndMain, szErrMsg, "MultiChan : Error!", MB_ICONEXCLAMATION | MB_OK);
00473
00474   return( FALSE );
00475 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/multisel/basedialog.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • multisel

basedialog.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  BaseDialog.cpp: implementation of the CBaseDialog class.
00014 //
00015
00016 #include "BaseDialog.h"
00017 #include "Globals.h"
00018
00019
00020
00021 /////////////////////////////////////////////////////////////////////////////
00022 // Construction/Destruction
00023
00024 //---------------------------------------------------------------------------
00025 CBaseDialog::CBaseDialog( ULONG nTemplate )
00026 {
00027   _ASSERT( NULL != nTemplate );
00028
00029   m_nTemplate = nTemplate;
00030   m_hWnd      = NULL;          // Handle returned by CreateDialogParam
00031   m_DlgProc   = DlgProc;       // Point to default dialog proc
00032   m_dwFlags   = 0;
00033 }
00034
00035 //---------------------------------------------------------------------------
00036 CBaseDialog::~CBaseDialog()
00037 {
00038 }
00039
00040 //---------------------------------------------------------------------------
00041 //  Use CreateDialogParam rather than CreateDialog so that we can later
00042 //  retrieve the 'this' pointer which we will need to point back to the
00043 //  particular instance of this class.
00044 //
00045 HWND CBaseDialog::Create
00046 (
00047   HINSTANCE  hInstance,      //[in] Global instance handle
00048   HWND       hWndParent,     //[in] Handle to parent window
00049   DWORD      dwFlags         //[in] Create flags - not used
00050 )
00051 {
00052   _ASSERT( NULL != hInstance );
00053
00054   m_dwFlags = dwFlags;
00055   m_hWnd = CreateDialogParam( hInstance,
00056                               MAKEINTRESOURCE(m_nTemplate),
00057                               hWndParent,
00058                               m_DlgProc,
00059                               (LPARAM)this
00060                             );
00061
00062   BOOL bReturn = ShowWindow( m_hWnd, SW_SHOW );  // Should return 0
00063
00064   return m_hWnd;
00065 }
00066
00067
00068 /////////////////////////////////////////////////////////////////////////////
00069 //  Message Handlers
00070
00071 //---------------------------------------------------------------------------
00072 LRESULT CBaseDialog::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
00073 {
00074   return 1;
00075 }
00076
00077 //---------------------------------------------------------------------------
00078 //  This is the first message sent by the DetroyWindow() function.
00079 //  It is sent after the window is removed from the screen, but it should
00080 //  be assumed that any child windows still exist.
00081 //
00082 LRESULT CBaseDialog::OnDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam )
00083 {
00084   return 1;
00085 }
00086
00087 //---------------------------------------------------------------------------
00088 //  This is sent after WM_DESTROY, and informs the app that the non-client
00089 //  area is being destroyed.  This is where allocated resources should be
00090 //  cleaned up.
00091 //
00092 LRESULT CBaseDialog::OnNcDestroy( HWND hDlg, WPARAM wParam, LPARAM lParam )
00093 {
00094   m_hWnd = NULL;             // Since this is a modeless-only dialog
00095   delete this;               // class we delete ourselves here
00096
00097   return 1;
00098 }
00099
00100 //---------------------------------------------------------------------------
00101 LRESULT CBaseDialog::OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam )
00102 {
00103   return DestroyWindow( m_hWnd);
00104 }
00105
00106 //---------------------------------------------------------------------------
00107 LRESULT CBaseDialog::OnCancel( HWND hDlg, WPARAM wParam, LPARAM lParam )
00108 {
00109   return DestroyWindow( m_hWnd);
00110 }
00111
00112 //---------------------------------------------------------------------------
00113 LRESULT CBaseDialog::OnClose( HWND hDlg, WPARAM wParam, LPARAM lParam )
00114 {
00115   return DestroyWindow( m_hWnd);
00116 }
00117
00118
00119 /////////////////////////////////////////////////////////////////////////////
00120 //  Dialog Procedures
00121
00122 //---------------------------------------------------------------------------
00123 //  Since this is a static function we can't use a 'this' pointer or call
00124 //  the base class directly.  There may be multiple base classes using
00125 //  this method.  We get around this by storing the 'this' pointer in the
00126 //  lParam of CreateDialogParam.  When we get WM_INITDIALOG we get this
00127 //  pointer back in the lParam.  Now we can use SetWindowLongPtr to store
00128 //  it, and later retireve it with GetWindowLongPtr.  Once we have a
00129 //  valid 'this' pointer we can cast it back to the base class and then
00130 //  call the base class's ProcessMessage function.
00131 //
00132 BOOL CALLBACK CBaseDialog::DlgProc
00133 (
00134   HWND     hDlg,           //[in] Handle to dialog box
00135   UINT     uMsg,           //[in] Message
00136   WPARAM   wParam,         //[in] First message parameter
00137   LPARAM   lParam          //[in] Second message parameter
00138 )
00139 {
00140   BOOL bReturn = FALSE;
00141   if( WM_INITDIALOG == uMsg )
00142   {
00143     SetWindowLongPtr(hDlg, GWL_USERDATA, lParam);
00144   }
00145
00146   CBaseDialog* pThis = reinterpret_cast<CBaseDialog*>(GetWindowLongPtr(hDlg, GWL_USERDATA));
00147   if( NULL != pThis )
00148   {
00149     bReturn = pThis->ProcessMessage( hDlg, uMsg, wParam, lParam );
00150   }
00151
00152   return bReturn;
00153 }
00154
00155 //---------------------------------------------------------------------------
00156 //  This is the instance specific method used to process messages.  The
00157 //  DialogProc delegates this responsibiliy to each instance of the class.
00158 //  This is a pure virtual function.  The code below is provided to cut
00159 //  and paste into the derived class's implementation.
00160 /*
00161 BOOL CBaseDialog::ProcessMessage
00162 (
00163   HWND     hDlg,           //[in] Handle to dialog box
00164   UINT     uMsg,           //[in] Message
00165   WPARAM   wParam,         //[in] First message parameter
00166   LPARAM   lParam          //[in] Second message parameter
00167 )
00168 {
00169   LRESULT lResult = 0;
00170   switch( uMsg )
00171   {
00172     case WM_INITDIALOG:
00173       lResult = OnInitDialog( hDlg, wParam, lParam );
00174       break;
00175
00176     case WM_DESTROY:
00177       lResult = OnDestroy( hDlg, wParam, lParam );
00178       break;
00179
00180     case WM_NCDESTROY:
00181       lResult = OnNcDestroy( hDlg, wParam, lParam );
00182       break;
00183
00184     case WM_CLOSE:
00185       lResult = OnClose( hDlg, wParam, lParam );
00186       break;
00187
00188     case WM_COMMAND:
00189       switch( wParam )
00190       {
00191         case IDOK:
00192           lResult = OnOK( hDlg, wParam, lParam );
00193           break;
00194
00195         case IDCANCEL:
00196           lResult = OnCancel( hDlg, wParam, lParam );
00197           break;
00198
00199         default:
00200           break;
00201       }
00202     default:
00203       break;
00204   }
00205   return (BOOL)lResult;
00206 }
00207 */
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpproppage/SCPProppage.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpproppage

SCPProppage.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       SCPProppage.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // SCPProppage.cpp : Implementation of DLL Exports.
00012
00013 #include "stdafx.h"
00014
00015 // initguid.h requires this.
00016 //
00017 #include <objbase.h>
00018
00019 // this redefines the DEFINE_GUID() macro to do allocation.
00020 //
00021 #include <initguid.h>
00022
00023 //#include <dsshell.h>
00024
00025 #include <dsadmin.h>
00026
00027 #include "resource.h"
00028 #include "SCPProppage.h"
00029 #include "SCP.h"
00030
00031 // {69D967C6-AB39-47b7-9F00-410185C80F89}
00032 static const GUID CLSID_ProppageSCP =
00033 { 0x69d967c6, 0xab39, 0x47b7, { 0x9f, 0x00, 0x41, 0x01, 0x85, 0xC8, 0x0F, 0x89 } };
00034
00035 CMyUIExtModule _Module;
00036
00037 BEGIN_OBJECT_MAP(ObjectMap)
00038   OBJECT_ENTRY(CLSID_ProppageSCP,    CSCP)
00039 END_OBJECT_MAP()
00040
00041 class CMyUIExtApp : public CWinApp
00042 {
00043 public:
00044   virtual BOOL InitInstance();
00045   virtual int ExitInstance();
00046 };
00047
00048 CMyUIExtApp theApp;
00049
00050 BOOL CMyUIExtApp::InitInstance()
00051 {
00052   _Module.Init(ObjectMap, m_hInstance);
00053   return CWinApp::InitInstance();
00054 }
00055
00056 int CMyUIExtApp::ExitInstance()
00057 {
00058   _Module.Term();
00059   return CWinApp::ExitInstance();
00060 }
00061
00062 /////////////////////////////////////////////////////////////////////////////
00063 // Used to determine whether the DLL can be unloaded by OLE
00064
00065 STDAPI DllCanUnloadNow(void)
00066 {
00067   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00068   return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
00069 }
00070
00071 /////////////////////////////////////////////////////////////////////////////
00072 // Returns a class factory to create an object of the requested type
00073
00074 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00075 {
00076   return _Module.GetClassObject(rclsid, riid, ppv);
00077 }
00078
00079 /////////////////////////////////////////////////////////////////////////////
00080 // DllRegisterServer - Adds entries to the system registry
00081
00082 BOOL x = TRUE;
00083 STDAPI DllRegisterServer(void)
00084 {
00085     return _Module.RegisterServer(FALSE);
00086 }
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // DllUnregisterServer - Removes entries from the system registry
00090
00091 STDAPI DllUnregisterServer(void)
00092 {
00093   _Module.UnregisterServer();
00094   return S_OK;
00095 }
00096
00097
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Notify Member List

This is the complete list of members for Notify, including all inherited members.
ActivateInputState(int characterID, int activated) | Notify | [inline]
ActivateInputState(int characterID, int activated) | Notify | [inline]
ActiveClientChange(int characterID, int status) | Notify | [inline]
ActiveClientChange(int characterID, int status) | Notify | [inline]
AgentPropertyChange() | Notify | [inline]
AgentPropertyChange() | Notify | [inline]
BalloonVisibleState(int characterID, int visible) | Notify | [inline]
BalloonVisibleState(int characterID, int visible) | Notify | [inline]
BookMark(int bookmarkID) | Notify | [inline]
BookMark(int bookmarkID) | Notify | [inline]
Click(int characterID, short keys, int x, int y) | Notify | [inline]
Click(int characterID, short keys, int x, int y) | Notify | [inline]
Command(int commandID, com.ms.com.IUnknown userInput) | Notify | [inline]
Command(int commandID, com.ms.com.IUnknown userInput) | Notify | [inline]
DblClick(int characterID, short keys, int x, int y) | Notify | [inline]
DblClick(int characterID, short keys, int x, int y) | Notify | [inline]
DefaultCharacterChange(String guid) | Notify | [inline]
DefaultCharacterChange(String guid) | Notify | [inline]
DragComplete(int characterID, short keys, int x, int y) | Notify | [inline]
DragComplete(int characterID, short keys, int x, int y) | Notify | [inline]
DragStart(int characterID, short keys, int x, int y) | Notify | [inline]
DragStart(int characterID, short keys, int x, int y) | Notify | [inline]
HelpComplete(int characterID, int commandID, int cause) | Notify | [inline]
HelpComplete(int characterID, int commandID, int cause) | Notify | [inline]
Idle(int characterID, int start) | Notify | [inline]
Idle(int characterID, int start) | Notify | [inline]
Initialize(IAgentEx agent, IAgentCharacterEx character, int commandID) | Notify | [inline]
ListeningState(int characterID, int state, int cause) | Notify | [inline]
ListeningState(int characterID, int state, int cause) | Notify | [inline]
m_AgentEx | Notify | [package]
m_Applet | Notify | [private]
m_Character | Notify | [package]
m_CommandID | Notify | [package]
m_DoneID | Notify |
m_RequestID | Notify | [package]
MK_LBUTTON | Notify | [private]
Move(int characterID, int x, int y, int cause) | Notify | [inline]
Move(int characterID, int x, int y, int cause) | Notify | [inline]
Notify() | Notify | [inline]
Notify(Hello3J applet) | Notify | [inline]
RequestComplete(int requestID, int status) | Notify | [inline]
RequestComplete(int requestID, int status) | Notify | [inline]
RequestStart(int requestID) | Notify | [inline]
RequestStart(int requestID) | Notify | [inline]
Restart() | Notify | [inline]
Restart() | Notify | [inline]
Shutdown() | Notify | [inline]
Shutdown() | Notify | [inline]
Size(int characterID, int width, int height) | Notify | [inline]
Size(int characterID, int width, int height) | Notify | [inline]
TRUE | Notify | [private]
VisibleState(int characterID, int visible, int cause) | Notify | [inline]
VisibleState(int characterID, int visible, int cause) | Notify | [inline]
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CISeqStream Member List

This is the complete list of members for CISeqStream, including all inherited members.
CISeqStream() | CISeqStream |
Clear() | CISeqStream | [virtual]
CompareData(void *pBuffer) | CISeqStream | [virtual]
Length() | CISeqStream | [inline, virtual]
m_cBufSize | CISeqStream | [private]
m_cRef | CISeqStream | [private]
m_iPos | CISeqStream | [private]
m_pBuffer | CISeqStream | [private]
operator void *const() | CISeqStream | [inline, virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | CISeqStream |
Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead) | CISeqStream |
Seek(ULONG iPos) | CISeqStream | [virtual]
STDMETHODIMP_(ULONG) AddRef(void) | CISeqStream |
STDMETHODIMP_(ULONG) Release(void) | CISeqStream |
Write(const void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbWritten) | CISeqStream |
Write(ISequentialStream *pISeqStream, ULONG *pcbWritten) | CISeqStream | [virtual]
~CISeqStream() | CISeqStream | [virtual]
Generated on Wed Nov 13 2024 16:56:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConClien/ConClien.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ConClien

ConClien.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CONCLIEN.H
00003
00004   Summary:   Include file for the CONCLIEN code sample application. In
00005              addition to class definitions, this CONCLIEN.H file contains
00006              definitions of the application's menu, string, and other
00007              resource IDs.
00008
00009              For a comprehensive tutorial code tour of CONCLIEN's contents
00010              and offerings see the tutorial CONCLIEN.HTM file. For
00011              more specific technical details on the internal workings see
00012              the comments dispersed throughout the CONCLIEN source code.
00013
00014   Classes:   CMainWindow.
00015
00016   Functions: WinMain.
00017
00018   Origin:    5-30-96: atrent - Editor-inheritance from FRECLIEN source.
00019
00020 ----------------------------------------------------------------------------
00021   This file is part of the Microsoft COM Tutorial Code Samples.
00022
00023   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00024
00025   This source code is intended only as a supplement to Microsoft
00026   Development Tools and/or on-line documentation.  See these other
00027   materials for detailed information regarding Microsoft code samples.
00028
00029   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00030   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00031   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00032   PARTICULAR PURPOSE.
00033 ==========================================================================+*/
00034
00035 #if !defined(CONCLIEN_H)
00036 #define CONCLIEN_H
00037
00038 #ifdef __cplusplus
00039
00040 extern CMsgLog* g_pMsgLog;
00041
00042 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00043   Class:    CMainWindow
00044
00045   Summary:  Class to encapsulate the application's main window, menu, and
00046             message dispatching behavior.
00047
00048   Methods:  CMainWindow
00049               Constructor.
00050             InitInstance
00051               Creates a new instance of the main window.
00052 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00053 class CMainWindow: public CVirWindow
00054 {
00055 public:
00056   CMainWindow();
00057   ~CMainWindow();
00058   BOOL InitInstance(HINSTANCE, int);
00059
00060   TCHAR m_szFileName[MAX_PATH];
00061   CMsgBox*  m_pMsgBox;
00062   CGuiBall* m_pGuiBall;
00063
00064 protected:
00065   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00066
00067 private:
00068   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00069
00070   WORD m_wWidth;
00071   WORD m_wHeight;
00072   TCHAR m_szHelpFile[MAX_PATH];
00073   TCHAR m_szFileTitle[MAX_PATH];
00074   TEXTMETRIC m_tm;
00075   OPENFILENAME m_ofnFile;
00076 };
00077
00078
00079 #endif // __cplusplus
00080
00081 // Window Class String Macros.
00082 #define MAIN_WINDOW_TITLE_STR       "CONCLIEN: Tutorial Code Sample"
00083 #define MAIN_WINDOW_CLASS_NAME_STR  "CONCLIENWindow"
00084 #define MAIN_WINDOW_CLASS_MENU_STR  "CONCLIENMenu"
00085
00086 // File Name String Macros.
00087 #define SERVER_TUTFILE_STR          "conserve.htm"
00088
00089 // OpenFile-related String Macros.
00090 #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
00091 #define OFN_DEFAULTTITLE_STR "Open File"
00092
00093 // File Menu Command Identifiers.
00094 #define IDM_FILE_EXIT               1000
00095
00096 // Connect Menu Command Identifiers.
00097 #define IDM_SOUND_BALL_ON           1100
00098 #define IDM_SOUND_BALL_OFF          1101
00099
00100 // Help Menu Command Identifiers.
00101 #define IDM_HELP_CONTENTS           1900
00102 #define IDM_HELP_TUTORIAL           1901
00103 #define IDM_HELP_TUTSERVER          1902
00104 #define IDM_HELP_READSOURCE         1904
00105 #define IDM_HELP_ABOUT              1905
00106 #define IDM_HELP_ABOUTSERVER        1906
00107
00108 // Error-related String Identifiers.
00109 #define IDS_COMINITFAILED           2000
00110 #define IDS_APPINITFAILED           2001
00111 #define IDS_OUTOFMEMORY             2002
00112 #define IDS_NOUNICODE               2003
00113 #define IDS_NOSERVER                2004
00114
00115 #define IDS_ASSERT_FAIL             2200
00116
00117 // Notice-related String Identifiers.
00118 #define IDS_NOTIMPLEMENTED          2301
00119
00120 #endif
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/GridFont/Canvas.Hxx Source File

  • Multimedia
  • Gdi
  • Fonts
  • GridFont

Canvas.Hxx

Go to the documentation of this file.
00001 #ifndef __CANVAS_HXX_
00002 #define __CANVAS_HXX_
00003
00004 //--------------------------------------------------------------------
00005 // File: Canvas.hxx
00006 //
00007 // Classes:
00008 //      CPoint - POINT with vector operations
00009 //      CCanvas - Base class for Device contexts
00010 //      CScreenCanvas - Device context for client area or display
00011 //      CPaintCanvas  - Device context for WM_PAINT message handling
00012 //
00013 // History: 22-Jan-1993 Asmusf  Created
00014 //
00015 // Copyright 1993 - 1998 Microsoft Corp. All Rights reserved
00016 //
00017 //--------------------------------------------------------------------
00018
00019 //========= CPoint ==========================================
00020
00021 class CPoint: public tagPOINT
00022 {
00023 public:
00024         CPoint()                    {x=0; y=0;  };
00025         CPoint(COORD X, COORD Y) {x = X; y = Y;     };
00026         CPoint(POINT pt)     {x = pt.x; y=pt.y; };
00027
00028         CPoint operator +(CPoint &pt){ return CPoint(x+pt.x, y+pt.y); };
00029         CPoint operator -(CPoint &pt){ return CPoint(x-pt.x, y-pt.y); };
00030         CPoint operator *(int c)           { return CPoint(x*c, y*c); };
00031         CPoint operator /(int c)           { return CPoint(x/c, y/c); };
00032 };
00033
00034 //======== CCanvas ==========================================
00035 // Base class: Any form of canvas
00036 // Inline methods only for speed.
00037
00038 class CCanvas
00039 {
00040 public:
00041     CCanvas():_hdc(0)
00042     {
00043     }
00044
00045     operator HDC() { return _hdc; }
00046
00047     void TextAlign( WORD aligntype )
00048     {
00049         SetTextAlign(_hdc, aligntype );
00050     }
00051
00052     void Line ( COORD x1, COORD y1, COORD x2, COORD y2 )
00053     {
00054         MoveToEx ( _hdc, x1, y1, NULL );
00055         LineTo   ( _hdc, x2, y2 );
00056     }
00057
00058     void Clear ( RECT& rect )
00059     {
00060         // Trick: fast erase with Extended Text Out
00061         ExtTextOut (_hdc, rect.left, rect.top, ETO_OPAQUE, &rect, TEXT(""), 0, NULL );
00062     }
00063
00064     void Text ( int x, int y, LPTSTR buf, int cBuf )
00065     {
00066         TextOut ( _hdc, x, y, buf, cBuf );
00067     }
00068
00069     void RCText ( LPRECT lprc, LPTSTR buf, int cBuf )
00070     {
00071         DrawText ( _hdc, buf, cBuf, lprc, DT_LEFT | DT_WORDBREAK | DT_NOCLIP | DT_NOPREFIX);
00072     }
00073
00074     void Char ( int x, int y, TCHAR ch )
00075     {
00076         TextOut ( _hdc, x, y,(LPTSTR) &ch, 1 );
00077     }
00078
00079
00080     void Circle (int x, int y, int r)
00081     {
00082         Ellipse (_hdc,  x-r/2, y-r/2, x+r/2, y+r/2 );
00083     }
00084
00085     void Scale(UINT iScale)
00086     {
00087         // Logical TWIPS
00088         SetMapMode (_hdc, MM_ANISOTROPIC);
00089
00090         SetWindowExtEx (_hdc, MulDiv(INCH1,iScale,100), MulDiv(INCH1,iScale,100), NULL);
00091         SetViewportExtEx (_hdc, GetDeviceCaps (_hdc, LOGPIXELSX),
00092                 GetDeviceCaps (_hdc, LOGPIXELSY), NULL);
00093     }
00094
00095     void Scroll(int dx, int dy)
00096     {
00097         SetWindowOrgEx(_hdc, dx, dy, NULL );
00098     }
00099
00100     void DPtoLP( LPPOINT lppt )
00101     {
00102         ::DPtoLP(_hdc, lppt, 1);
00103     };
00104
00105     void LPtoDP( LPPOINT lppt )
00106     {
00107         ::LPtoDP(_hdc, lppt, 1);
00108     };
00109
00110 protected:
00111     void Init ( HDC hdc )
00112     {
00113         _hdc = hdc;
00114         TextAlign(TA_CENTER | TA_BASELINE );
00115     };
00116
00117     HDC  _hdc;
00118 };
00119
00120 //======== CScreenCanvas ====================================
00121 // Device Context
00122 // Use for painting on client area other than WM_PAINT
00123
00124 class CScreenCanvas: public CCanvas
00125 {
00126 public:
00127     CScreenCanvas ( HWND hwnd ): _hwnd(hwnd)
00128     {
00129         Init (GetDC ( hwnd ));
00130     }
00131
00132     ~CScreenCanvas ()
00133     {
00134         ReleaseDC ( _hwnd, _hdc );
00135     }
00136
00137 protected:
00138
00139     HWND _hwnd;
00140 };
00141
00142 //======== CPaintCanvas =====================================
00143 // Use for painting after WM_PAINT
00144
00145 class CPaintCanvas: public CCanvas
00146 {
00147 public:
00148     CPaintCanvas ( HWND hwnd ): _hwnd(hwnd)
00149     {
00150         BeginPaint ( _hwnd, &_paint );
00151         Init ( _paint.hdc );
00152     }
00153
00154     ~CPaintCanvas ()
00155     {
00156         EndPaint(_hwnd, &_paint );
00157     }
00158
00159     RECT GetRect() { return _paint.rcPaint; };
00160 protected:
00161
00162     PAINTSTRUCT _paint;
00163     HWND        _hwnd;
00164 };
00165
00166 #endif
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Complete/dataobj.h Source File

  • SysMgmt
  • MMC
  • Complete

dataobj.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _SAMPDATAOBJECT_H_
00020 #define _SAMPDATAOBJECT_H_
00021
00022 #include <mmc.h>
00023 #include "DeleBase.h"
00024
00025 class CDataObject : public IDataObject
00026 {
00027 private:
00028     ULONG       m_cref;
00029     MMC_COOKIE      m_lCookie;
00030     DATA_OBJECT_TYPES   m_context;
00031
00032 public:
00033     CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
00034     ~CDataObject();
00035
00036     ///////////////////////////////
00037     // Interface IUnknown
00038     ///////////////////////////////
00039     STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
00040     STDMETHODIMP_(ULONG) AddRef();
00041     STDMETHODIMP_(ULONG) Release();
00042
00043     ///////////////////////////////
00044     // IDataObject methods
00045     ///////////////////////////////
00046     STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
00047
00048     // The rest are not implemented
00049     STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
00050     { return E_NOTIMPL; };
00051
00052     STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
00053     { return E_NOTIMPL; };
00054
00055     STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
00056     { return E_NOTIMPL; };
00057
00058     STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
00059     { return E_NOTIMPL; };
00060
00061     STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
00062     { return E_NOTIMPL; };
00063
00064     STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
00065     { return E_NOTIMPL; };
00066
00067     STDMETHODIMP DUnadvise (DWORD dwConnection)
00068     { return E_NOTIMPL; };
00069
00070     STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
00071     { return E_NOTIMPL; };
00072
00073     ///////////////////////////////
00074     // Custom Methods
00075     ///////////////////////////////
00076
00077     CDelegationBase *GetBaseNodeObject() {
00078         return (CDelegationBase *)m_lCookie;
00079     }
00080
00081     DATA_OBJECT_TYPES GetContext() {
00082         return m_context;
00083     }
00084
00085 public:
00086     // clipboard formats
00087     static UINT s_cfSZNodeType;
00088     static UINT s_cfDisplayName;
00089     static UINT s_cfNodeType;
00090     static UINT s_cfSnapinClsid;
00091     static UINT s_cfInternal;
00092
00093 };
00094
00095 HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
00096 CDataObject* GetOurDataObject(IDataObject *lpDataObject);
00097 BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
00098
00099 #endif _SAMPDATAOBJECT_H_
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/tapisend/tapisend.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • tapisend

tapisend.cpp

Go to the documentation of this file.
00001
00002 /*
00003
00004 Copyright (c) 1999  Microsoft Corporation
00005
00006
00007 Module Name:
00008
00009     TAPISend.cpp
00010
00011
00012 Abstract:
00013
00014     This sample illustrates use of Media Streaming Terminal for sending audio.
00015
00016     The application makes a TAPI call to the address specified in the command
00017     line and uses Media Streaming Terminal to send the media content of a wav
00018     file, also specified in the command line, to the remote machibe.
00019
00020 */
00021
00022
00023 #include "common.h"
00024 #include "avifilereader.h"
00025
00026
00027 //
00028 // global TAPI object
00029 //
00030
00031 ITTAPI *g_pTapi = NULL;
00032
00033
00034 //
00035 // a global flag, set true to request stop streaming
00036 //
00037
00038 BOOL g_bExitRequested = FALSE;
00039
00040
00041 //
00042 // possible address types strings and corresponding LINEADDRESSTYPE_ constants
00043 //
00044
00045 char *g_szAddressTypes[] =
00046             {"PHONENUMBER", "CONFERENCE", "EMAIL", "MACHINE", "IP"};
00047
00048
00049 long g_nAddressTypeConstants[] =
00050             { LINEADDRESSTYPE_PHONENUMBER,
00051               LINEADDRESSTYPE_SDP,
00052               LINEADDRESSTYPE_EMAILNAME,
00053               LINEADDRESSTYPE_DOMAINNAME,
00054               LINEADDRESSTYPE_IPADDRESS };
00055
00056 //
00057 // number of different address types
00058 //
00059
00060 const UINT g_nNumberOfAddressTypes =
00061                     sizeof(g_szAddressTypes)/sizeof(g_szAddressTypes[0]);
00062
00063
00064 ///////////////////////////////////////////////////////////////////////////////
00065 //
00066 // LogMessage
00067 //
00068 //
00069 // log a message using printf
00070 //
00071 ///////////////////////////////////////////////////////////////////////////////
00072
00073 void LogMessage(IN CHAR *pszFormat, ... )
00074 {
00075
00076     //
00077     // output buffer -- note: hardcoded limit
00078     //
00079
00080     static const BUFFER_SIZE = 1280;
00081
00082     char szBuffer[BUFFER_SIZE];
00083
00084
00085     //
00086     // get current time
00087     //
00088
00089     SYSTEMTIME SystemTime;
00090
00091     GetLocalTime(&SystemTime);
00092
00093
00094     //
00095     // format thread id and time
00096     //
00097
00098     StringCbPrintf( szBuffer, BUFFER_SIZE, "[%lx]:[%02u:%02u:%02u.%03u]::",
00099              GetCurrentThreadId(),
00100              SystemTime.wHour,
00101              SystemTime.wMinute,
00102              SystemTime.wSecond,
00103              SystemTime.wMilliseconds);
00104
00105
00106     size_t iStringLength = 0;
00107
00108     HRESULT hr = StringCbLength(szBuffer, BUFFER_SIZE, &iStringLength);
00109
00110     if (FAILED(hr))
00111     {
00112         // either this code is wrong, or someone else in the process corrupted
00113         // our memory.
00114         return;
00115     }
00116
00117
00118     //
00119     // get the actual message
00120     //
00121
00122     va_list vaArguments;
00123
00124     va_start(vaArguments, pszFormat);
00125
00126
00127     size_t iBytesLeft = BUFFER_SIZE - iStringLength;
00128
00129
00130     //
00131     // not checking the return code of this function. even if it fails, we will
00132     // have a null-terminated string that we will be able to log.
00133     //
00134
00135     StringCbVPrintf( &(szBuffer[iStringLength]), iBytesLeft, pszFormat, vaArguments);
00136
00137     va_end(vaArguments);
00138
00139
00140     //
00141     // how big is the string now, and how many bytes do we have left?
00142     //
00143
00144     hr = StringCbLength(szBuffer, BUFFER_SIZE, &iStringLength);
00145
00146     if (FAILED(hr))
00147     {
00148         // either this code is wrong, or someone else in the process corrupted
00149         // our memory.
00150         return;
00151     }
00152
00153     iBytesLeft = BUFFER_SIZE - iStringLength;
00154
00155     //
00156     // append a carriage return to the string. ignore the result code, the
00157     // result string will be null-terminated no matter what.
00158     //
00159
00160     StringCbCat(szBuffer, iBytesLeft, "\n");
00161
00162
00163     //
00164     // log the buffer
00165     //
00166
00167     printf(szBuffer);
00168 }
00169
00170
00171 #define LogError LogMessage
00172
00173
00174 ///////////////////////////////////////////////////////////////////////////////
00175 //
00176 // LogFormat
00177 //
00178 // use LogMessage to log wave format
00179 //
00180 ///////////////////////////////////////////////////////////////////////////////
00181
00182 void LogFormat(IN WAVEFORMATEX *pWaveFormat)
00183 {
00184     LogMessage("    Format: ");
00185     LogMessage("        tag: %u", pWaveFormat->wFormatTag);
00186     LogMessage("        channels: %u", pWaveFormat->nChannels);
00187     LogMessage("        samples/sec: %lu", pWaveFormat->nSamplesPerSec);
00188     LogMessage("        align: %u", pWaveFormat->nBlockAlign);
00189     LogMessage("        bits/sample: %u", pWaveFormat->wBitsPerSample);
00190
00191 }
00192
00193
00194 ///////////////////////////////////////////////////////////////////////////////
00195 //
00196 // AllocateMemory
00197 //
00198 // use win32 heap api to allocate memory on the application's heap
00199 // and zero the allocated memory
00200 //
00201 ///////////////////////////////////////////////////////////////////////////////
00202
00203 void *AllocateMemory(SIZE_T nMemorySize)
00204 {
00205
00206
00207     //
00208     // use HeapAlloc to allocate and clear memory
00209     //
00210
00211     return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nMemorySize);
00212 }
00213
00214
00215 ///////////////////////////////////////////////////////////////////////////////
00216 //
00217 // FreeMemory
00218 //
00219 // use win32 heap api to free memory previously allocated on the application's
00220 // heap
00221 //
00222 ///////////////////////////////////////////////////////////////////////////////
00223
00224 void FreeMemory(void *pMemory)
00225 {
00226
00227     //
00228     // get size of the allocated memory
00229     //
00230
00231     SIZE_T nMemorySize = HeapSize(GetProcessHeap(), 0, pMemory);
00232
00233     if (-1 == nMemorySize)
00234     {
00235         LogError("FreeMemory: failed to get size of the memory block %p",
00236                  pMemory);
00237
00238         //
00239         // don't exit -- try freeing anyway
00240         //
00241
00242     }
00243     else
00244     {
00245         //
00246         // fill memory with 0xdd's before freeing, so it is easier to debug
00247         // failures caused by using pointer to deallocated memory
00248         //
00249
00250         if (0 != pMemory)
00251         {
00252             FillMemory(pMemory, nMemorySize, 0xdd);
00253         }
00254
00255     }
00256
00257
00258     //
00259     // use HeapFree to free memory. use return code to log the result, but
00260     // do not return it to the caller
00261     //
00262
00263     BOOL bFreeSuccess = HeapFree(GetProcessHeap(), 0, pMemory);
00264
00265     if (FALSE == bFreeSuccess)
00266     {
00267         LogError("FreeMemory: HeapFree failed");
00268
00269         //
00270         // if this assertion fires, it is likely there is a problem with the
00271         // memory we are trying to deallocate. Was it allocated using heapalloc
00272         // and on the same heap? Is this a valid pointer?
00273         //
00274
00275         _ASSERTE(FALSE);
00276     }
00277
00278 }
00279
00280
00281 ///////////////////////////////////////////////////////////////////////////////
00282 //
00283 // InitializeTAPI()
00284 //
00285 // create and initialize the TAPI object
00286 //
00287 ///////////////////////////////////////////////////////////////////////////////
00288
00289 HRESULT InitializeTAPI()
00290 {
00291
00292     HRESULT hr = E_FAIL;
00293
00294     LogMessage("InitializeTAPI: started");
00295
00296
00297     //
00298     // create the TAPI object
00299     //
00300
00301     hr = CoCreateInstance(
00302                           CLSID_TAPI,
00303                           NULL,
00304                           CLSCTX_INPROC_SERVER,
00305                           IID_ITTAPI,
00306                           (LPVOID *)&g_pTapi
00307                          );
00308
00309     if (FAILED(hr))
00310     {
00311         LogError("InitializeTAPI: CoCreateInstance on TAPI failed");
00312
00313         return hr;
00314     }
00315
00316
00317     //
00318     // must initialize tapi object before using it
00319     //
00320
00321     LogMessage("InitializeTAPI: calling ITTAPI::Initialize()");
00322
00323     hr = g_pTapi->Initialize();
00324
00325     if (FAILED(hr))
00326     {
00327         LogError("InitializeTAPI: TAPI failed to initialize");
00328
00329         g_pTapi->Release();
00330         g_pTapi = NULL;
00331
00332         return hr;
00333     }
00334
00335
00336     //
00337     // setting event filtering -- this is required for synchronous
00338     // ITBasicCallControl->Connect to work
00339     //
00340
00341     LogMessage("InitializeTAPI: calling ITTAPI::put_EventFilter()");
00342
00343     hr = g_pTapi->put_EventFilter(TE_CALLSTATE);
00344
00345     if (FAILED(hr))
00346     {
00347         LogError("InitializeTAPI: TAPI failed to put event filtering");
00348
00349         g_pTapi->Shutdown();
00350
00351         g_pTapi->Release();
00352         g_pTapi = NULL;
00353
00354         return hr;
00355     }
00356
00357
00358
00359     LogMessage("InitializeTAPI: succeeded");
00360
00361     return S_OK;
00362 }
00363
00364
00365
00366 ///////////////////////////////////////////////////////////////////////////////
00367 //
00368 // ShutdownTAPI
00369 //
00370 // shutdown and release the tapi object
00371 //
00372 ///////////////////////////////////////////////////////////////////////////////
00373
00374 void ShutdownTAPI()
00375 {
00376
00377     LogMessage("ShutdownTAPI: started");
00378
00379
00380     if (NULL != g_pTapi)
00381     {
00382
00383         g_pTapi->Shutdown();
00384
00385         g_pTapi->Release();
00386         g_pTapi = NULL;
00387     }
00388
00389
00390     LogMessage("ShutdownTAPI: completed");
00391
00392 }
00393
00394
00395 ///////////////////////////////////////////////////////////////////////////////
00396 //
00397 //  IsValidAudioFile
00398 //
00399 // returns TRUE if the file specified by pszFileName
00400 // exists and is a valid audio file
00401 //
00402 ///////////////////////////////////////////////////////////////////////////////
00403
00404 BOOL IsValidAudioFile(IN char *pszFileName)
00405 {
00406
00407     //
00408     // open the file
00409     //
00410
00411     CAVIFileReader FileReader;
00412
00413     HRESULT hr = FileReader.Initialize(pszFileName);
00414
00415
00416     //
00417     // see if it is a valid audio file
00418     //
00419
00420     if ((FAILED(hr)) || !FileReader.IsValidAudioFile())
00421     {
00422         LogError("IsValidAudioFile: file [%s] does not exist or is not "
00423                  "a valid wav file", pszFileName);
00424
00425         return FALSE;
00426     }
00427     else
00428     {
00429         LogMessage("IsValidAudioFile: file [%s] is a valid audio file",
00430                     pszFileName);
00431
00432         return TRUE;
00433     }
00434
00435 }
00436
00437
00438 ///////////////////////////////////////////////////////////////////////////////
00439 //
00440 // FindAddress
00441 //
00442 // find an address of the requested type that supports audio. returns S_OK
00443 // if address found, failure otherwise
00444 //
00445 ///////////////////////////////////////////////////////////////////////////////
00446
00447 HRESULT FindAddress(IN  long nAddressType,
00448                     OUT ITAddress **ppAddress)
00449 {
00450
00451     HRESULT hr = E_FAIL;
00452
00453
00454     //
00455     // don't return garbage even if we fail
00456     //
00457
00458     *ppAddress = NULL;
00459
00460
00461     //
00462     // enumerate all available addresses
00463     //
00464
00465     IEnumAddress *pEnumAddress = NULL;
00466
00467     hr = g_pTapi->EnumerateAddresses(&pEnumAddress);
00468
00469     if (FAILED(hr))
00470     {
00471         LogError("FindAddress: Failed to enumerate addresses");
00472
00473         return hr;
00474     }
00475
00476
00477     //
00478     // walk through the enumeration of addresses and look for those which are
00479     // of requested type and supports audio
00480     //
00481
00482     while (TRUE)
00483     {
00484         //
00485         // get the next address from the enumeration
00486         //
00487
00488         ITAddress *pAddress = NULL;
00489
00490         hr = pEnumAddress->Next( 1, &pAddress, NULL );
00491
00492         if (S_OK != hr)
00493         {
00494
00495             //
00496             // no more addresses
00497             //
00498
00499             LogMessage("FindAddress: no more addresses");
00500
00501             break;
00502         }
00503
00504
00505         //
00506         // we got an address. check its capabilities
00507         //
00508
00509         ITAddressCapabilities *pAddressCaps = NULL;
00510
00511         hr = pAddress->QueryInterface( IID_ITAddressCapabilities,
00512                                        (void**)&pAddressCaps );
00513
00514         if (FAILED(hr))
00515         {
00516
00517             LogError("FindAddress: "
00518                      "Failed to QI address for address capabilities");
00519
00520             //
00521             // just continue to the next address
00522             //
00523
00524             pAddress->Release();
00525             pAddress = NULL;
00526
00527             continue;
00528         }
00529
00530
00531         //
00532         // is this the right address type?
00533         //
00534
00535         long nType = 0;
00536
00537         hr = pAddressCaps->get_AddressCapability(AC_ADDRESSTYPES, &nType);
00538
00539
00540         pAddressCaps->Release();
00541         pAddressCaps = NULL;
00542
00543
00544         if (FAILED(hr))
00545         {
00546             LogError("FindAddress: Failed to get_AddressCapability");
00547
00548             pAddress->Release();
00549             pAddress = NULL;
00550
00551             continue;
00552         }
00553
00554
00555         if (nType & nAddressType)
00556         {
00557
00558             //
00559             // this address is of the right type. does it support audio?
00560             //
00561
00562             ITMediaSupport *pMediaSupport = NULL;
00563
00564             hr = pAddress->QueryInterface(IID_ITMediaSupport,
00565                                            (void **)&pMediaSupport);
00566
00567             if (FAILED(hr))
00568             {
00569
00570                 //
00571                 // continue to the next address
00572                 //
00573
00574                 LogError("FindAddress: "
00575                          "failed to qi address for ITMediaSupport");
00576
00577                 pAddress->Release();
00578                 pAddress = NULL;
00579
00580                 continue;
00581             }
00582
00583
00584             VARIANT_BOOL bAudioSupported = VARIANT_FALSE;
00585
00586             hr = pMediaSupport->QueryMediaType(TAPIMEDIATYPE_AUDIO,
00587                                                &bAudioSupported);
00588
00589             pMediaSupport->Release();
00590             pMediaSupport = NULL;
00591
00592             if (SUCCEEDED(hr) && (VARIANT_TRUE == bAudioSupported))
00593             {
00594
00595                 LogMessage("FindAddress: address found");
00596
00597
00598                 //
00599                 // log the name of this address
00600                 //
00601
00602                 BSTR bstrAddressName = NULL;
00603
00604                 hr = pAddress->get_AddressName(&bstrAddressName);
00605
00606                 if (FAILED(hr))
00607                 {
00608                     LogError("FindAddress: failed to get address name");
00609                 }
00610                 else
00611                 {
00612                     LogMessage("   %S\n", bstrAddressName);
00613                 }
00614
00615                 SysFreeString(bstrAddressName);
00616
00617
00618                 //
00619                 // will use this address
00620                 //
00621
00622                 *ppAddress = pAddress;
00623
00624                 break;;
00625             }
00626         }
00627
00628
00629         //
00630         // can't use this address. release it
00631         //
00632
00633         pAddress->Release();
00634         pAddress = NULL;
00635
00636     }
00637
00638
00639     //
00640     // done with the enumeration. release.
00641     //
00642
00643     pEnumAddress->Release();
00644     pEnumAddress = NULL;
00645
00646
00647     //
00648     // log a message if no address was found
00649     //
00650
00651     if (NULL == *ppAddress)
00652     {
00653         LogError("FindAddress: no address found");
00654
00655         return E_FAIL;
00656
00657     }
00658
00659
00660     LogMessage("FindAddress: completed");
00661
00662     return S_OK;
00663 }
00664
00665
00666 ///////////////////////////////////////////////////////////////////////////////
00667 //
00668 // GetAddressType
00669 //
00670 // convert a address type specified by pszRequestedAddressType
00671 // to tapi LINEADDRESSTYPE_ constants (LINEADDRESSTYPE_PHONENUMBER,
00672 // LINEADDRESSTYPE_IPADDRESS, etc).
00673 //
00674 // returns E_FAIL if the string does not correspond to a valid address type
00675 //
00676 ///////////////////////////////////////////////////////////////////////////////
00677
00678 HRESULT GetAddressType(IN char *pszRequestedAddressType,
00679                        IN OUT long *pnAddressType)
00680 {
00681
00682     //
00683     // match address type specified by the user to one of the known
00684     // address types
00685     //
00686
00687     *pnAddressType = 0;
00688
00689
00690     for (int i = 0; i < g_nNumberOfAddressTypes; i++)
00691     {
00692
00693         if (0 == _stricmp(g_szAddressTypes[i], pszRequestedAddressType))
00694         {
00695
00696             //
00697             // get the address type constant corresponding to the string
00698             //
00699
00700             *pnAddressType =  g_nAddressTypeConstants[i];
00701
00702             LogMessage("GetAddressType: "
00703                        "matched address type [%s] to address type [%d]",
00704                        pszRequestedAddressType, *pnAddressType);
00705
00706             return S_OK;
00707         }
00708
00709
00710     }
00711
00712     LogError("GetAddressType: unrecognized address type [%s]",
00713               pszRequestedAddressType);
00714
00715     return E_FAIL;
00716 }
00717
00718
00719
00720 ///////////////////////////////////////////////////////////////////////////////
00721 //
00722 // CreateBSTRfromString
00723 //
00724 // create a bstr from a string supplied. the caller is responsible for
00725 // freeng the returned string by calling SysFreeString.
00726 //
00727 // returns the allocated string or NULL if failed.
00728 //
00729 ///////////////////////////////////////////////////////////////////////////////
00730
00731 BSTR CreateBSTRfromString(IN char *pszString)
00732 {
00733
00734     //
00735     // convert to wchar so we can create bstr
00736     //
00737     // allocate buffer for resulting string of wchars
00738     //
00739
00740     size_t nStringLength = strlen(pszString) + 1;
00741
00742     WCHAR *pwsString = (WCHAR *)AllocateMemory(sizeof(WCHAR) *  nStringLength);
00743
00744     if (NULL == pwsString)
00745     {
00746         LogError("CreateBSTRfromString: "
00747                  "failed to allocate memory for address string.");
00748
00749         return NULL;
00750     }
00751
00752
00753     //
00754     // convert to wchar
00755     //
00756
00757     int rc = MultiByteToWideChar(CP_ACP,
00758                                  0,
00759                                  pszString,
00760                                  -1,
00761                                  pwsString,
00762                                  (int)nStringLength);
00763
00764     if (0 == rc)
00765     {
00766         LogError("CreateBSTRfromString: Failed to convert char to wchar");
00767
00768         FreeMemory(pwsString);
00769         pwsString = NULL;
00770
00771         return NULL;
00772     }
00773
00774
00775     //
00776     // create bstr
00777     //
00778
00779     BSTR bstr = SysAllocString(pwsString);
00780
00781
00782     //
00783     // no longer needed, deallocate
00784     //
00785
00786     FreeMemory(pwsString);
00787     pwsString = NULL;
00788
00789     return bstr;
00790
00791 }
00792
00793
00794 ///////////////////////////////////////////////////////////////////////////////
00795 //
00796 // CreateAndConnectCall
00797 //
00798 // make a call using the address object specified, to the address specified
00799 //
00800 // if successful, returns S_OK and connected call, error otherwise
00801 //
00802 ///////////////////////////////////////////////////////////////////////////////
00803
00804 HRESULT CreateAndConnectCall(IN  ITAddress *pAddress,
00805                              IN  char *pszDestinationAddress,
00806                              IN  long nAddressType,
00807                              OUT ITBasicCallControl **ppCall)
00808 {
00809
00810     HRESULT hr = E_FAIL;
00811
00812
00813     //
00814     // don't return garbage
00815     //
00816
00817     *ppCall = NULL;
00818
00819
00820     //
00821     // create a call on the address
00822     //
00823
00824     BSTR bstrDestinationAddress = CreateBSTRfromString(pszDestinationAddress);
00825
00826     ITBasicCallControl *pCall = NULL;
00827
00828     hr = pAddress->CreateCall(bstrDestinationAddress,
00829                               nAddressType,
00830                               TAPIMEDIATYPE_AUDIO,
00831                               &pCall);
00832
00833     SysFreeString (bstrDestinationAddress);
00834
00835
00836     if (FAILED(hr))
00837     {
00838         LogError("CreateAndConnectCall: Failed to create a call");
00839
00840         return hr;
00841     }
00842
00843
00844     //
00845     // call created. attempt to connect synchronously
00846     //
00847
00848     LogMessage("CreateAndConnectCall: attempting a synchronous connect");
00849
00850     hr = pCall->Connect(VARIANT_TRUE);
00851
00852     if (S_OK != hr)
00853     {
00854
00855         LogError("CreateAndConnectCall: failed to connect, hr = 0x%lx", hr);
00856
00857
00858         pCall->Disconnect(DC_NORMAL);
00859
00860
00861         //
00862         // we don't need the call object if it failed to connect
00863         //
00864
00865         pCall->Release();
00866         pCall = NULL;
00867
00868         hr = E_FAIL;
00869
00870     }
00871     else
00872     {
00873         //
00874         // call is successful. return the call object
00875         //
00876
00877         LogMessage("CreateAndConnectCall: call connected successfully");
00878
00879         *ppCall = pCall;
00880     }
00881
00882
00883     return hr;
00884 }
00885
00886
00887 ///////////////////////////////////////////////////////////////////////////////
00888 //
00889 // Call
00890 //
00891 // make a call to the specified address on the first address object
00892 // of the requested type that supports audio
00893 //
00894 // if successful, returns S_OK and connected call, error otherwise
00895 //
00896 ///////////////////////////////////////////////////////////////////////////////
00897
00898 HRESULT Call(IN char *szDestinationAddress,
00899              IN char *szAddressType,
00900              OUT ITBasicCallControl **ppCall)
00901 {
00902     HRESULT hr = E_FAIL;
00903
00904
00905     //
00906     // we don't want to return garbage even if we fail
00907     //
00908
00909     *ppCall = NULL;
00910
00911
00912     //
00913     // find address type
00914     //
00915
00916     long nAddressType = 0;
00917
00918     hr = GetAddressType(szAddressType, &nAddressType);
00919
00920     if (FAILED(hr))
00921     {
00922         LogError("Call: failed to recognize address type %s", szAddressType);
00923
00924         return hr;
00925     }
00926
00927
00928     //
00929     // find an address for this address type that supports audio
00930     //
00931
00932     ITAddress *pAddress = NULL;
00933
00934     hr = FindAddress(nAddressType, &pAddress);
00935
00936     if (FAILED(hr))
00937     {
00938         LogError("Call: failed to find an address with audio for type %s",
00939                  szAddressType);
00940
00941         return hr;
00942     }
00943
00944
00945     //
00946     // have the address. create and connect call
00947     //
00948
00949     ITBasicCallControl *pCall = NULL;
00950
00951     hr = CreateAndConnectCall(pAddress,
00952                               szDestinationAddress,
00953                               nAddressType,
00954                               &pCall);
00955
00956     pAddress->Release();
00957     pAddress = NULL;
00958
00959     if (FAILED(hr))
00960     {
00961         LogError("Call: Failed to create and connect call");
00962
00963         return hr;
00964     }
00965
00966
00967     //
00968     // we have a connected call. return it.
00969     //
00970
00971     *ppCall = pCall;
00972
00973     LogMessage("Call: succeeded.");
00974
00975     return S_OK;
00976 }
00977
00978
00979 ///////////////////////////////////////////////////////////////////////////////
00980 //
00981 // FindAudioStream
00982 //
00983 // given a call, return the first outgoing audio stream.
00984 //
00985 // returns S_OK if successful, error otherwise
00986 //
00987 ///////////////////////////////////////////////////////////////////////////////
00988
00989 HRESULT FindAudioStream( IN  ITBasicCallControl *pCall,
00990                          OUT ITStream **ppStream)
00991 {
00992
00993     HRESULT hr = E_FAIL;
00994
00995     LogMessage("FindAudioStream: started");
00996
00997
00998     //
00999     // don't return garbage
01000     //
01001
01002     *ppStream = NULL;
01003
01004
01005     //
01006     // enumerate streams on the call
01007     //
01008
01009
01010
01011     //
01012     // get the ITStreamControl interface for this call
01013     //
01014
01015     ITStreamControl *pStreamControl = NULL;
01016
01017     hr = pCall->QueryInterface(IID_ITStreamControl,
01018                                 (void **) &pStreamControl);
01019
01020     if (FAILED(hr))
01021     {
01022         LogError("FindAudioStream: failed to QI call for ITStreamControl");
01023
01024         return hr;
01025     }
01026
01027
01028     //
01029     // enumerate the streams
01030     //
01031
01032     IEnumStream *pEnumStreams = NULL;
01033
01034     hr = pStreamControl->EnumerateStreams(&pEnumStreams);
01035
01036     pStreamControl->Release();
01037     pStreamControl = NULL;
01038
01039     if (FAILED(hr))
01040     {
01041         LogError("CreateAndSelectMST: failed to enumerate streams on call");
01042
01043         return hr;
01044     }
01045
01046
01047     //
01048     // walk through the streams on the call
01049     // return the first outgoing audio stream
01050     //
01051
01052     while (TRUE)
01053     {
01054         ITStream *pStream = NULL;
01055
01056         hr = pEnumStreams->Next(1, &pStream, NULL);
01057
01058         if (S_OK != hr)
01059         {
01060             //
01061             // no more streams
01062             //
01063
01064             break;
01065         }
01066
01067
01068         //
01069         // check the stream's direction
01070         //
01071
01072         TERMINAL_DIRECTION td;
01073
01074         hr = pStream->get_Direction(&td);
01075
01076         if (FAILED(hr))
01077         {
01078             LogError("CreateAndSelectMST: Failed to get stream direction");
01079
01080             pStream->Release();
01081             pStream = NULL;
01082
01083
01084             //
01085             // proceed to the next stream, if any
01086             //
01087
01088             continue;
01089         }
01090
01091
01092         //
01093         // is the stream of the right direction?
01094         //
01095
01096         if (TD_CAPTURE != td)
01097         {
01098
01099             //
01100             // incoming stream. we need outgoing.
01101             // release the stream and continue
01102             //
01103
01104             pStream->Release();
01105             pStream = NULL;
01106
01107             continue;
01108         }
01109
01110
01111         //
01112         // check the stream's media type
01113         //
01114
01115         long lMediaType = 0;
01116
01117         hr = pStream->get_MediaType(&lMediaType);
01118
01119         if (FAILED(hr))
01120         {
01121             LogError("CreateAndSelectMST: Failed to get media type");
01122
01123             pStream->Release();
01124             pStream = NULL;
01125
01126             continue;
01127         }
01128
01129         //
01130         // Does this stream have the right media type?
01131         // Streams are defined as having exactly one media type
01132         // (not a bitmask).
01133         //
01134
01135         if ( lMediaType == TAPIMEDIATYPE_AUDIO )
01136         {
01137
01138             LogMessage("FindAudioStream: stream found");
01139
01140
01141             //
01142             // this is what we need, so stop looking
01143             //
01144
01145             *ppStream = pStream;
01146
01147             break;
01148         }
01149
01150
01151         pStream->Release();
01152         pStream = NULL;
01153
01154     } // while (walking through the call's streams)
01155
01156
01157
01158     //
01159     // release stream enumeration
01160     //
01161
01162     pEnumStreams->Release();
01163     pEnumStreams = NULL;
01164
01165
01166     //
01167     // return the error code, depending on whether we found a stream or not
01168     //
01169
01170     if (NULL == *ppStream)
01171     {
01172         LogMessage("FindAudioStream: didn't find an audio stream");
01173
01174         return E_FAIL;
01175     }
01176
01177     LogMessage("FindAudioStream: succeded");
01178
01179     return S_OK;
01180
01181 }
01182
01183
01184 ///////////////////////////////////////////////////////////////////////////////
01185 //
01186 // CreateCaptureMediaStreamingTerminal
01187 //
01188 // create media streaming terminal for outgoing data
01189 //
01190 // returns the created terminal or NULL if failed
01191 //
01192 ///////////////////////////////////////////////////////////////////////////////
01193
01194 ITTerminal *CreateCaptureMediaStreamingTerminal(IN ITBasicCallControl *pCall)
01195 {
01196
01197     HRESULT hr = E_FAIL;
01198
01199
01200     //
01201     // get the call's call info so we can get the call's address
01202     //
01203
01204     ITCallInfo *pCallInfo = NULL;
01205
01206     hr = pCall->QueryInterface(IID_ITCallInfo, (void**)&pCallInfo);
01207
01208     if (FAILED(hr))
01209     {
01210         LogError("CreateCaptureMediaStreamingTerminal: "
01211                  "failed to qi call for ITCallInfo");
01212
01213         return NULL;
01214     }
01215
01216
01217     //
01218     // now we can get the address
01219     //
01220
01221     ITAddress *pAddress = NULL;
01222
01223     hr = pCallInfo->get_Address(&pAddress);
01224
01225     pCallInfo->Release();
01226     pCallInfo = NULL;
01227
01228     if (FAILED(hr))
01229     {
01230         LogError("CreateCaptureMediaStreamingTerminal: "
01231                  "failed to get call's address");
01232         return NULL;
01233     }
01234
01235
01236     //
01237     // get the terminal support interface
01238     //
01239
01240     ITTerminalSupport *pTerminalSupport = NULL;
01241
01242     hr = pAddress->QueryInterface( IID_ITTerminalSupport,
01243                                    (void **)&pTerminalSupport );
01244
01245
01246     pAddress->Release();
01247     pAddress = NULL;
01248
01249
01250     if (FAILED(hr))
01251     {
01252         LogError("CreateCaptureMediaStreamingTerminal: "
01253                  "failed to QI pAddress for ITTerminalSupport");
01254
01255         return NULL;
01256     }
01257
01258
01259     //
01260     // get string for the terminal's class id
01261     //
01262
01263     LPOLESTR psTerminalClass = NULL;
01264
01265     hr = StringFromIID(CLSID_MediaStreamTerminal, &psTerminalClass);
01266
01267     if (FAILED(hr))
01268     {
01269         LogError("CreateCaptureMediaStreamingTerminal: "
01270                  "Failed to generate string from terminal's class id");
01271
01272         pTerminalSupport->Release();
01273         pTerminalSupport = NULL;
01274
01275         return NULL;
01276     }
01277
01278
01279     //
01280     // make bstr out of the class id
01281     //
01282
01283     BSTR bstrTerminalClass = SysAllocString (psTerminalClass);
01284
01285
01286     //
01287     // free the string returned by StringFromIID
01288     //
01289
01290     CoTaskMemFree(psTerminalClass);
01291     psTerminalClass = NULL;
01292
01293
01294     if (NULL == bstrTerminalClass)
01295     {
01296
01297         LogError("CreateCaptureMediaStreamingTerminal: "
01298                  "Failed to allocate BSTR for terminal class");
01299
01300         pTerminalSupport->Release();
01301         pTerminalSupport = NULL;
01302
01303         return NULL;
01304     }
01305
01306
01307
01308     //
01309     // create media streaming terminal
01310     //
01311
01312     ITTerminal *pTerminal = NULL;
01313
01314     hr = pTerminalSupport->CreateTerminal(bstrTerminalClass,
01315                                           TAPIMEDIATYPE_AUDIO,
01316                                           TD_CAPTURE,
01317                                           &pTerminal);
01318
01319
01320     //
01321     // release resources no longer needed
01322     //
01323
01324     SysFreeString(bstrTerminalClass);
01325
01326     pTerminalSupport->Release();
01327     pTerminalSupport = NULL;
01328
01329
01330     if (FAILED(hr))
01331     {
01332         LogError("CreateCaptureMediaStreamingTerminal: "
01333                  "failed to create media streaming terminal hr = 0x%lx", hr);
01334
01335         return NULL;
01336     }
01337
01338
01339     //
01340     // successfully created media streaming terminal. return.
01341     //
01342
01343     LogMessage("CreateCaptureMediaStreamingTerminal: "
01344                "Terminal created successfully");
01345
01346     return pTerminal;
01347
01348 }
01349
01350
01351
01352 ///////////////////////////////////////////////////////////////////////////////
01353 //
01354 // SetTerminalFormat
01355 //
01356 // tell media streaming terminal the format of the data we are going to provide
01357 //
01358 ///////////////////////////////////////////////////////////////////////////////
01359
01360 HRESULT SetTerminalFormat(IN ITTerminal *pTerminal,
01361                           IN WAVEFORMATEX *pWaveFormat)
01362 {
01363
01364     HRESULT hr = E_FAIL;
01365
01366
01367     //
01368     // log format requested
01369     //
01370
01371     LogMessage("SetTerminalFormat: starting.");
01372     LogFormat(pWaveFormat);
01373
01374
01375     ITAMMediaFormat *pIMediaFormat = NULL;
01376
01377     hr = pTerminal->QueryInterface(IID_ITAMMediaFormat,
01378                                    (void **)&pIMediaFormat);
01379
01380     if (FAILED(hr))
01381     {
01382
01383         LogError("SetTerminalFormat: Failed to set terminal format");
01384
01385         return hr;
01386     }
01387
01388
01389     //
01390     // fill the media format structure
01391     //
01392
01393     AM_MEDIA_TYPE MediaType;
01394
01395     ZeroMemory(&MediaType, sizeof(AM_MEDIA_TYPE));
01396
01397     MediaType.majortype            = MEDIATYPE_Audio;
01398     MediaType.subtype              = MEDIASUBTYPE_PCM;
01399     MediaType.bFixedSizeSamples    = TRUE;
01400     MediaType.bTemporalCompression = FALSE;
01401     MediaType.lSampleSize          = pWaveFormat->nBlockAlign;
01402     MediaType.formattype           = FORMAT_WaveFormatEx;
01403     MediaType.pUnk                 = NULL;
01404
01405     MediaType.cbFormat             = sizeof(WAVEFORMATEX) +
01406                                      pWaveFormat->cbSize;
01407
01408     MediaType.pbFormat             = (BYTE*)pWaveFormat;
01409
01410
01411     //
01412     // set the requested format
01413     //
01414
01415     hr = pIMediaFormat->put_MediaFormat(&MediaType);
01416
01417     if (FAILED(hr))
01418     {
01419
01420         //
01421         // try to see what format the terminal wanted
01422         //
01423
01424         LogError("SetTerminalFormat: failed to set format");
01425
01426         AM_MEDIA_TYPE *pMediaFormat = NULL;
01427
01428         HRESULT hr2 = pIMediaFormat->get_MediaFormat(&pMediaFormat);
01429
01430
01431         if (SUCCEEDED(hr2))
01432         {
01433
01434             if (pMediaFormat->formattype == FORMAT_WaveFormatEx)
01435             {
01436
01437                 //
01438                 // log the terminal's format
01439                 //
01440
01441                 LogError("SetTerminalFormat: terminal's format is");
01442                 LogFormat((WAVEFORMATEX*) pMediaFormat->pbFormat);
01443
01444             }
01445             else
01446             {
01447
01448                 LogError("SetTerminalFormat: "
01449                          "terminal's format is not WAVEFORMATEX");
01450             }
01451
01452
01453             //
01454             // note: we are responsible for deallocating the format returned by
01455             // get_MediaFormat
01456             //
01457
01458             DeleteMediaType(pMediaFormat);
01459
01460         } //  succeeded to get terminal's format
01461         else
01462         {
01463
01464             LogError("SetTerminalFormat: failed to get terminal's format");
01465
01466         }
01467
01468     } // failed to set format
01469
01470
01471     pIMediaFormat->Release();
01472     pIMediaFormat = NULL;
01473
01474     LogMessage("SetTerminalFormat: completed");
01475
01476     return hr;
01477 }
01478
01479
01480 ///////////////////////////////////////////////////////////////////////////////
01481 //
01482 // SetAllocatorProperties
01483 //
01484 // sets allocator properties to the terminal
01485 //
01486 ///////////////////////////////////////////////////////////////////////////////
01487
01488 HRESULT SetAllocatorProperties(IN ITTerminal *pTerminal)
01489 {
01490
01491     //
01492     // different buffer sizes may produce different sound quality, depending
01493     // on the underlying transport that is being used.
01494     //
01495     // this function illustrates how an app can control the number and size of
01496     // buffers. A multiple of 30 ms (480 bytes at 16-bit 8 KHz PCM) is the most
01497     // appropriate sample size for IP (especailly G.723.1).
01498     //
01499     // However, small buffers can cause poor audio quality on some voice boards.
01500     //
01501     // If this method is not called, the allocator properties suggested by the
01502     // connecting filter will be used.
01503     //
01504     // Note: do not set allocator properties in the applications unless you are
01505     // sure that sound quality will not degrade as a result. Some MSPs can have
01506     // their own preferred allocator properties, and will not be able to
01507     // provide the best quality if the app sets its own properties, different
01508     // from what is preferred by the msp.
01509     //
01510     // Also note that ITAllocatorProperties::SetBufferSize allows the app to
01511     // specify preferred size of the buffer allocated to the application
01512     // without affecting terminal's allocator properties.
01513     //
01514
01515     LogMessage("SetAllocatorProperties: starting.");
01516
01517
01518     HRESULT hr = E_FAIL;
01519
01520
01521     //
01522     // get ITAllocator properties interface on the terminal
01523     //
01524
01525     ITAllocatorProperties *pITAllocatorProperties = NULL;
01526
01527
01528     hr = pTerminal->QueryInterface(IID_ITAllocatorProperties,
01529                                    (void **)&pITAllocatorProperties);
01530
01531
01532     if (FAILED(hr))
01533     {
01534         LogError("SetAllocatorProperties: "
01535                  "failed to QI terminal for ITAllocatorProperties");
01536
01537         return hr;
01538     }
01539
01540
01541     //
01542     // configure allocator properties
01543     //
01544
01545     ALLOCATOR_PROPERTIES AllocProps;
01546
01547     AllocProps.cbBuffer   = 4800;
01548     AllocProps.cBuffers   = 5;
01549     AllocProps.cbAlign    = 1;
01550     AllocProps.cbPrefix   = 0;
01551
01552
01553     hr = pITAllocatorProperties->SetAllocatorProperties(&AllocProps);
01554
01555     if (FAILED(hr))
01556     {
01557         LogError("SetAllocatorProperties: failed to set allocator properties. "
01558                  "hr = 0x%lx", hr);
01559
01560         pITAllocatorProperties->Release();
01561         pITAllocatorProperties = NULL;
01562
01563         return hr;
01564     }
01565
01566
01567     //
01568     // ask media streaming terminal to allocate buffers for us.
01569     // TRUE is the default, so strictly speaking, we didn't have to call
01570     // this method.
01571     //
01572
01573     hr = pITAllocatorProperties->SetAllocateBuffers(TRUE);
01574
01575
01576     pITAllocatorProperties->Release();
01577     pITAllocatorProperties = NULL;
01578
01579
01580     if (FAILED(hr))
01581     {
01582         LogError("SetAllocatorProperties: failed to SetAllocateBuffers, "
01583                  "hr = 0x%lx", hr);
01584
01585         return hr;
01586     }
01587
01588
01589     //
01590     // succeeded setting allocator properties
01591     //
01592
01593     LogMessage("SetAllocatorProperties: completed");
01594
01595     return S_OK;
01596 }
01597
01598
01599 ///////////////////////////////////////////////////////////////////////////////
01600 //
01601 // ReadFileIntoTerminal
01602 //
01603 // read data from the file and submit it to media streaming terminal
01604 //
01605 // exit when finished reading the file, user requested exit by pressing
01606 // ctrl+break, or the connection broke
01607 //
01608 // returns S_FALSE when finished streaming the file, S_OK if user requested
01609 // exit, failure otherwise
01610 //
01611 ///////////////////////////////////////////////////////////////////////////////
01612
01613 HRESULT ReadFileIntoTerminal(IN CAVIFileReader *pFileReader,
01614                              IN ITTerminal *pPlaybackTerminal)
01615 {
01616
01617     HRESULT hr = E_FAIL;
01618
01619     LogMessage("ReadFileIntoTerminal: started.");
01620
01621
01622     Sleep(20000);
01623
01624
01625     //
01626     // get terminal's IMediaStream interface
01627     //
01628
01629     IMediaStream *pTerminalMediaStream = NULL;
01630
01631     hr = pPlaybackTerminal->QueryInterface(IID_IMediaStream,
01632                                            (void**)&pTerminalMediaStream);
01633
01634     if (FAILED(hr))
01635     {
01636         LogError("ReadFileIntoTerminal: "
01637                  "failed to QI terminal for IMediaStream");
01638
01639         return hr;
01640     }
01641
01642
01643     //
01644     // create a queue (STL deque) that will hold all the samples that we ever
01645     // submitted to media streaming terminal
01646     //
01647     // we need this so when we are finished reading the file, we can go through
01648     // the list of all the samples that we have submitted and make sure mst
01649     // is finished processing them
01650     //
01651     // note that samples get reused, the same samples will be put in the queue
01652     // more than once. so the size of the queue will be proportional to the
01653     // size of the file being played. this might cause problems if
01654     // the file is big or the source of the samples is unlimited (live audio
01655     // feed). In this case, the logic can be modified to only enqueue each
01656     // sample once, by comparing against existing queue entries.
01657     //
01658
01659     std::deque<IStreamSample*> SampleQ;
01660
01661
01662     //
01663     // count the number of samples that have been submitted
01664     //
01665
01666     ULONG nSampleCount = 0;
01667
01668
01669     //
01670     // keep reading samples from file and sending them.
01671     // (until user requests exit, there is no more data, or failure)
01672     //
01673
01674     while (!g_bExitRequested)
01675     {
01676
01677         //
01678         // allocate a sample on the terminal's media stream
01679         //
01680         // Note: the call to AllocateSample() will block if we filled all the
01681         // samples with data, and there are no more samples for us to fill
01682         // (waiting for media streaming terminal to process samples we have
01683         // submitted). When MST is is done with at least one sample, the call
01684         // will return. This logic will ensure that MST always has work and is
01685         // never starved for samples.
01686         //
01687
01688         IStreamSample *pStreamSample = NULL;
01689
01690         hr = pTerminalMediaStream->AllocateSample(0, &pStreamSample);
01691
01692         if (FAILED(hr))
01693         {
01694             LogError("ReadFileIntoTerminal: "
01695                      "failed to allocate a sample on terminal's stream");
01696
01697             break;
01698         }
01699
01700
01701         //
01702         // get IMemoryData on the sample so we can get to the sample's memory
01703         // data
01704         //
01705
01706         IMemoryData *pSampleMemoryData = NULL;
01707
01708         hr = pStreamSample->QueryInterface(IID_IMemoryData,
01709                                            (void**)&pSampleMemoryData);
01710
01711         if (FAILED(hr))
01712         {
01713             LogError("ReadFileIntoTerminal: failed to qi sample for IMemoryData");
01714
01715             pStreamSample->Release();
01716             pStreamSample = NULL;
01717
01718             break;
01719
01720         }
01721
01722
01723         //
01724         // get to the sample's memory buffer
01725         //
01726
01727         DWORD nBufferSize = 0;
01728
01729         BYTE *pBuffer = NULL;
01730
01731         hr = pSampleMemoryData->GetInfo(&nBufferSize, &pBuffer, NULL);
01732
01733         if (FAILED(hr))
01734         {
01735
01736             LogError("ReadFileIntoTerminal: "
01737                      "failed to get info on sample's memory");
01738
01739             pStreamSample->Release();
01740             pStreamSample = NULL;
01741
01742             pSampleMemoryData->Release();
01743             pSampleMemoryData = NULL;
01744
01745             break;
01746
01747         }
01748
01749
01750         //
01751         // read file into memory buffer provided by the sample
01752         //
01753
01754         LONG nBytesRead = 0;
01755
01756         hr = pFileReader->Read(pBuffer, nBufferSize, &nBytesRead);
01757
01758         if (FAILED(hr))
01759         {
01760             LogError("ReadFileIntoTerminal: failed to read data from file");
01761
01762             pStreamSample->Release();
01763             pStreamSample = NULL;
01764
01765             pSampleMemoryData->Release();
01766             pSampleMemoryData = NULL;
01767
01768             break;
01769
01770         }
01771         else if (S_FALSE == hr)
01772         {
01773             //
01774             // no more data
01775             //
01776
01777             LogMessage("ReadFileIntoTerminal: finished reading file");
01778
01779             pStreamSample->Release();
01780             pStreamSample = NULL;
01781
01782             pSampleMemoryData->Release();
01783             pSampleMemoryData = NULL;
01784
01785             break;
01786         }
01787
01788
01789
01790         //
01791         // tell the sample how many useful bytes are in the sample's buffer
01792         //
01793
01794         hr = pSampleMemoryData->SetActual(nBytesRead);
01795
01796         pSampleMemoryData->Release();
01797         pSampleMemoryData = NULL;
01798
01799         if (FAILED(hr))
01800         {
01801
01802             LogError("ReadFileIntoTerminal: failed to SetActual (%ld bytes) "
01803                      "on the sample.", nBytesRead);
01804
01805             pStreamSample->Release();
01806             pStreamSample = NULL;
01807
01808             break;
01809
01810         }
01811
01812
01813         //
01814         // we are done with the sample. now let media streaming terminal
01815         // process it asynchronously. when the terminal is finished with
01816         // the sample, this sample will be returned to us from the call
01817         // to AllocateSample()
01818         //
01819
01820         hr = pStreamSample->Update(SSUPDATE_ASYNC, NULL, NULL, 0);
01821
01822
01823         //
01824         // with some MSPs, starting the stream can be done asynchronously, so
01825         // there may be a delay between the time when terminal is selected
01826         // (or call connected) and the time when the stream becomes usable.
01827         //
01828         // attempting to use the stream before the stream is active would
01829         // result in the Update() returning error VFW_E_NOT_COMMITTED.
01830         //
01831         // Usually an application would not start using the stream until
01832         // it gets media event CME_STREAM_ACTIVE. This requires the app
01833         // to register a callback interface by calling
01834         // ITTAPI::RegisterCallNotifications. Refer to documentation and other
01835         // samples for more details on how this is done.
01836         //
01837         // To keep things simple, this sample doesn't do event processing.
01838         // To deal with the problem of using the stream before it becomes
01839         // active, we retry Update() until we succeed.
01840         //
01841         // Note that there is still a danger that the stream becomes
01842         // disconnected before we process the first sample, in which case
01843         // we will be stuck in a loop, which can be exited when the user
01844         // presses ctrl+break
01845         //
01846
01847         while ( (hr == VFW_E_NOT_COMMITTED)
01848                 && (0 == nSampleCount)
01849                 && !g_bExitRequested )
01850         {
01851             LogMessage("ReadFileIntoTerminal: "
01852                        "Update returned VFW_E_NOT_COMMITTED. "
01853                        "Likely cause: stream not yet started. Retrying.");
01854
01855             Sleep( 1000 );
01856
01857             hr = pStreamSample->Update(SSUPDATE_ASYNC, NULL, NULL, 0);
01858         }
01859
01860         if (FAILED(hr))
01861         {
01862             LogError("ReadFileIntoTerminal: failed to Update the sample");
01863
01864             pStreamSample->Release();
01865             pStreamSample = NULL;
01866
01867             break;
01868
01869         }
01870
01871
01872         //
01873         // the sample was submitted successfully. update count
01874         //
01875
01876         nSampleCount++;
01877
01878         if (nSampleCount == 300)
01879         {
01880
01881             LogError("ReadFileIntoTerminal: sleeping 10 seconds");
01882
01883             Sleep(30000);
01884
01885             LogError("ReadFileIntoTerminal: woke up");
01886         }
01887
01888         //
01889         // keep the sample we have just submitted. on exit, we will wait
01890         // for it to be processed by mst
01891         //
01892
01893         SampleQ.push_back(pStreamSample);
01894
01895     } // file reading/sample-filling loop
01896
01897
01898     LogMessage("ReadFileIntoTerminal: processed %lu samples", nSampleCount);
01899
01900
01901     //
01902     // walk through the list of all the samples we have submitted and wait for
01903     // each sample to be done
01904     //
01905
01906     while (!SampleQ.empty())
01907     {
01908
01909         //
01910         // get and remove a sample from the queue
01911         //
01912
01913         IStreamSample *pStreamSample = SampleQ.front();
01914
01915         SampleQ.pop_front();
01916
01917
01918         //
01919         // wait for the Media Streaming Terminal to finish
01920         // processing the sample
01921         //
01922
01923         pStreamSample->CompletionStatus(COMPSTAT_WAIT, INFINITE);
01924
01925
01926         //
01927         // ignore the error code -- release the sample in any case
01928         //
01929
01930         pStreamSample->Release();
01931         pStreamSample = NULL;
01932
01933     }
01934
01935
01936     LogMessage("ReadFileIntoTerminal: released all submitted samples");
01937
01938
01939     //
01940     // tell media streaming terminal's stream that there is no more data
01941     //
01942
01943     pTerminalMediaStream->SendEndOfStream(0);
01944
01945
01946     //
01947     // ignore the error code
01948     //
01949
01950     pTerminalMediaStream->Release();
01951     pTerminalMediaStream = NULL;
01952
01953
01954     //
01955     // if we disconnect the call right away, the call may be dropped before
01956     // receiver gets all the samples. An application should wait for
01957     // STREAM_INACTIVE media event before disconnecting the call.
01958     //
01959     // Since, for simplicity, we are not processing events in this sample,
01960     // wait several seconds to give the receiver a little time to complete
01961     // processing.
01962     //
01963
01964     LogMessage("ReadFileIntoTerminal: Sleeping to give the receiver time "
01965                "to process everything we have sent.");
01966
01967     Sleep(7500);
01968
01969
01970     LogMessage("ReadFileIntoTerminal: completed");
01971
01972     return hr;
01973 }
01974
01975
01976 ///////////////////////////////////////////////////////////////////////////////
01977 //
01978 // CreateAndSelectTerminal
01979 //
01980 // creates a media streaming terminal for capture, sets requested format,
01981 // sets allocator properties, and selects the terminal on the call's first
01982 // outgoing audio stream.
01983 //
01984 // returns S_OK and terminal if success
01985 // error if failure
01986 //
01987 ///////////////////////////////////////////////////////////////////////////////
01988
01989 HRESULT CreateAndSelectTerminal(IN ITBasicCallControl *pCall,
01990                                 IN WAVEFORMATEX *pWaveFormat,
01991                                 OUT ITTerminal **ppTerminal)
01992 {
01993
01994     HRESULT hr = E_FAIL;
01995
01996
01997     //
01998     // don't return garbage
01999     //
02000
02001     *ppTerminal = NULL;
02002
02003
02004
02005     //
02006     // find an outgoing audio stream on the call
02007     //
02008
02009     ITStream *pStream = NULL;
02010
02011     hr = FindAudioStream(pCall, &pStream);
02012
02013     if (FAILED(hr))
02014     {
02015         LogError("CreateAndSelectTerminal: failed to find an outgoing audio stream");
02016
02017         return hr;
02018     }
02019
02020
02021     //
02022     // create media streaming terminal
02023     //
02024
02025     ITTerminal *pTerminal = NULL;
02026
02027     pTerminal = CreateCaptureMediaStreamingTerminal(pCall);
02028
02029
02030     if (NULL == pTerminal)
02031     {
02032
02033         LogError("CreateAndSelectTerminal: Failed to create media streaming terminal");
02034
02035         pStream->Release();
02036         pStream = NULL;
02037
02038         return hr;
02039
02040     }
02041
02042
02043     //
02044     // tell media streaming terminal format of the data
02045     // we are going to send. If the terminal cannot handle this format
02046     // return an error
02047     //
02048
02049     hr = SetTerminalFormat(pTerminal, pWaveFormat);
02050
02051     if (FAILED(hr))
02052     {
02053         LogMessage("CreateAndSelectTerminal: "
02054                    "terminal does not support requested format");
02055
02056         pStream->Release();
02057         pStream = NULL;
02058
02059         pTerminal->Release();
02060         pTerminal = NULL;
02061
02062         return hr;
02063     }
02064
02065
02066     //
02067     // set allocator properties.
02068     //
02069     // calling ITAllocatorProperties::SetAllocatorProperties with the
02070     // properties that are not optimal for the MSP in use can result
02071     // in loss of sound quality.
02072     //
02073     // So make sure that you only call this function if you know you
02074     // need it.
02075     //
02076     // Do not use ITAllocatorProperties::SetAllocatorProperties to set
02077     // the size of the buffer you want to get when you fill samples,
02078     // ITAllocatorProperties::SetBufferSize will accomplish that without
02079     // affecting terminal's allocator properties.
02080     //
02081
02082     // hr = SetAllocatorProperties(pTerminal);
02083
02084     if (FAILED(hr))
02085     {
02086
02087         //
02088         // not fatal -- we are still likely to successfully stream data
02089         //
02090
02091         LogMessage("CreateAndSelectTerminal: "
02092                    "failed to set allocator properties. continuing.");
02093     }
02094
02095
02096     //
02097     // select the terminal on the stream
02098     //
02099
02100     hr = pStream->SelectTerminal(pTerminal);
02101
02102
02103     //
02104     // don't need the stream anymore
02105     //
02106
02107     pStream->Release();
02108     pStream = NULL;
02109
02110
02111     if (FAILED(hr))
02112     {
02113         LogError("CreateAndSelectTerminal: Failed to select terminal on the stream");
02114
02115         pTerminal->Release();
02116         pTerminal = NULL;
02117
02118     }
02119
02120
02121     //
02122     // if everything went smoothly pTerminal has a pointer to configured
02123     // and selected terminal. otherwise pTerminal is null and all resources
02124     // have been released
02125     //
02126
02127     *ppTerminal = pTerminal;
02128
02129
02130     return hr;
02131
02132 }
02133
02134
02135 ///////////////////////////////////////////////////////////////////////////////
02136 //
02137 // StreamFile
02138 //
02139 // use TAPI to connect to the remote machine to stream file
02140 //
02141 ///////////////////////////////////////////////////////////////////////////////
02142
02143 HRESULT StreamFile(IN char *szFileName,
02144                    IN char *szAddressString,
02145                    IN char *szAddressType)
02146 {
02147
02148     HRESULT hr = E_FAIL;
02149
02150
02151     LogMessage("StreamFile: file [%s] address [%s] address type [%s]",
02152                 szFileName, szAddressString, szAddressType);
02153
02154
02155     //
02156     // check if the file is valid
02157     //
02158
02159     if (!IsValidAudioFile(szFileName))
02160     {
02161
02162         LogError("StreamFile: file not valid [%s]", szFileName);
02163
02164         return E_FAIL;
02165     }
02166
02167
02168     //
02169     // initialize COM libraries -- used by TAPI
02170     //
02171
02172     hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
02173
02174     if ( FAILED(hr))
02175     {
02176         LogError("StreamFile: Failed to CoInitialize");
02177
02178         return hr;
02179     }
02180
02181
02182     //
02183     // create and initialize TAPI
02184     //
02185
02186     hr = InitializeTAPI();
02187
02188     if (SUCCEEDED(hr))
02189     {
02190
02191         //
02192         // try to make a call
02193         //
02194
02195         ITBasicCallControl *pCall = NULL;
02196
02197         hr = Call(szAddressString, szAddressType, &pCall);
02198
02199         if (SUCCEEDED(hr))
02200         {
02201
02202             //
02203             // construct the file reader object
02204             // to be used to read file's data
02205             //
02206             // note: If you want to play more than one file in one call, reuse
02207             // the same terminal for the duration of the call. Under
02208             // Windows 2000, all data submitted via the Media Streaming Terminal
02209             // during the call must have the same format. Changing a Media
02210             // Streaming Terminal's format after it is initially configured will
02211             // always return an error code, regardless of the OS version.
02212             // Unselecting a Media Streaming Terminal and creating and selecting
02213             // a new terminal on the same stream from the same call with a
02214             // different format is not supported on Windows 2000. This may,
02215             // however, be supported on other versions of Windows. For the latest
02216             // information on which versions of Windows support this, please
02217             // refer to the latest Platform SDK documentation.
02218             //
02219
02220             CAVIFileReader FileReader;
02221
02222             hr =  FileReader.Initialize(szFileName);
02223
02224
02225             //
02226             // get the file's format. remember to deallocate when done.
02227             //
02228
02229             WAVEFORMATEX *pWaveFormat = NULL;
02230
02231             if (SUCCEEDED(hr) &&
02232                 SUCCEEDED(hr = FileReader.GetFormat(&pWaveFormat)))
02233             {
02234
02235                 //
02236                 // create and configure a media streaming terminal and select it on this call
02237                 //
02238                 //
02239
02240                 ITTerminal *pPlaybackTerminal = NULL;
02241
02242                 hr = CreateAndSelectTerminal(pCall, pWaveFormat, &pPlaybackTerminal);
02243
02244
02245                 if (SUCCEEDED(hr))
02246                 {
02247
02248                     //
02249                     // use the terminal to send the file
02250                     //
02251
02252                     hr = ReadFileIntoTerminal(&FileReader, pPlaybackTerminal);
02253
02254                     if (FAILED(hr))
02255                     {
02256                         LogError("StreamFile: failed to ReadFileIntoTerminal");
02257                     }
02258                     else
02259                     {
02260                         LogError("StreamFile: succeeded");
02261                     }
02262
02263
02264
02265                     //
02266                     // release the terminal, we no longer need it
02267                     //
02268
02269                     pPlaybackTerminal->Release();
02270                     pPlaybackTerminal = NULL;
02271
02272                 }
02273                 else
02274                 {
02275                     LogError("StreamFile: failed to create and select terminal");
02276
02277                 }
02278
02279
02280                 //
02281                 // no longer need wave format. free memory.
02282                 //
02283
02284                 FreeMemory(pWaveFormat);
02285                 pWaveFormat = NULL;
02286
02287             }  // got file format
02288             else
02289             {
02290                 LogError("StreamFile: failed to get file's format");
02291
02292             }
02293
02294
02295             //
02296             // there is not much we can do if disconnect fails,
02297             // so ignore its return code
02298             //
02299
02300             pCall->Disconnect(DC_NORMAL);
02301
02302             pCall->Release();
02303             pCall = NULL;
02304
02305         }   // call connected
02306         else
02307         {
02308
02309             LogError("StreamFile: failed to connect to %s", szAddressString);
02310
02311         }
02312
02313
02314         //
02315         // tapi has been initialized. shutdown now.
02316         //
02317
02318         ShutdownTAPI();
02319
02320     } // initialized tapi
02321     else
02322     {
02323
02324         LogError("StreamFile: Failed to initialize TAPI");
02325
02326     }
02327
02328
02329     CoUninitialize();
02330
02331     return hr;
02332 }
02333
02334
02335
02336 ///////////////////////////////////////////////////////////////////////////////
02337 //
02338 // HelpScreen
02339 //
02340 // this function displays usage information
02341 //
02342 ///////////////////////////////////////////////////////////////////////////////
02343
02344 void HelpScreen()
02345 {
02346
02347     printf("Usage:\n\n"
02348                "  TAPISend filename address addresstype\n\n"
02349                "  where addresstype is [ ");
02350
02351
02352     for (int i = 0; i < g_nNumberOfAddressTypes - 1; ++i)
02353     {
02354         printf("%s | ", g_szAddressTypes[i]);
02355     }
02356
02357     printf("%s ]\n", g_szAddressTypes[i]);
02358
02359 }
02360
02361
02362 ///////////////////////////////////////////////////////////////////////////////
02363 //
02364 // CtrlHandler
02365 //
02366 // handler for ctrl+break, close, logoff and shutdown.
02367 //
02368 // sets g_bExitRequested flag signaling shutdown. this ensures graceful exit
02369 //
02370 ///////////////////////////////////////////////////////////////////////////////
02371
02372 BOOL CtrlHandler(DWORD nEventType)
02373 {
02374
02375     //
02376     // are we in the middle of shutting down?
02377     //
02378
02379     if (TRUE == g_bExitRequested)
02380     {
02381         LogMessage("CtrlHandler: shutdown is already in progress");
02382
02383         return TRUE;
02384     }
02385
02386
02387     //
02388     // any exit event (close, ctrl+break/C, logoff, shutdown)
02389     // is a signal for the application to exit.
02390     //
02391
02392     switch (nEventType)
02393     {
02394
02395         case CTRL_C_EVENT:
02396         case CTRL_CLOSE_EVENT:
02397         case CTRL_BREAK_EVENT:
02398         case CTRL_LOGOFF_EVENT:
02399         case CTRL_SHUTDOWN_EVENT:
02400
02401             LogMessage("CtrlHandler: Initiating shutdown.");
02402
02403
02404             //
02405             // signal shutdown
02406             //
02407
02408             g_bExitRequested = TRUE;
02409
02410
02411     }
02412
02413     return TRUE;
02414 }
02415
02416
02417 ///////////////////////////////////////////////////////////////////////////////
02418 //
02419 // main
02420 //
02421 // usage: TAPISend filename address addresstype
02422 //
02423 // returns 0 if success, 1 if failure
02424 //
02425 ///////////////////////////////////////////////////////////////////////////////
02426
02427 int __cdecl main(int argc, char* argv[])
02428 {
02429
02430     LogMessage("main: started");
02431
02432
02433     //
02434     // validate arguments
02435     //
02436
02437     if (argc != 4)
02438     {
02439         HelpScreen();
02440
02441         LogMessage("main: invalid arguments, exiting.");
02442
02443         return 1;
02444     }
02445
02446
02447     //
02448     // we want to handle ctrl+c and ctrl+break events so we can cleanup on exit
02449     // proceed even in case of failure
02450     //
02451
02452     SetConsoleCtrlHandler( (PHANDLER_ROUTINE)CtrlHandler, TRUE);
02453
02454
02455     //
02456     // open the file, connect to the remote machine and stream the file over
02457     //
02458
02459     HRESULT hr = StreamFile(argv[1], argv[2], argv[3]);
02460
02461
02462     //
02463     // exiting... we no longer want to handle ctrl+c and ctrl+break
02464     //
02465
02466     SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, FALSE);
02467
02468
02469     //
02470     // was file streaming successful?
02471     //
02472
02473     if (FAILED(hr))
02474     {
02475         LogError("main: Failed to stream file");
02476
02477         return 1;
02478     }
02479
02480
02481     LogMessage("main: completed");
02482
02483     return 0;
02484
02485 }
02486
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

gss_channel_bindings_struct Member List

This is the complete list of members for gss_channel_bindings_struct, including all inherited members.
acceptor_address | gss_channel_bindings_struct
acceptor_addrtype | gss_channel_bindings_struct
application_data | gss_channel_bindings_struct
initiator_address | gss_channel_bindings_struct
initiator_addrtype | gss_channel_bindings_struct
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMChat/cMemb.Cpp Source File

  • Web
  • NetMeeting
  • NMChat

cMemb.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMCHAT.EXE
00003 //  File:       CMEMB.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #include "precomp.h"
00016
00017 COBLIST * g_pListUser = (COBLIST *) NULL;
00018
00019 INmMember * g_pMemberLocal = NULL;
00020
00021
00022 //****************************************************************************
00023 //
00024 // PUSER PUserFromINmMember(INmMember * pMember)
00025 //
00026 //****************************************************************************
00027
00028 PUSER PUserFromINmMember(INmMember * pMember)
00029 {
00030   if (NULL != g_pListUser)
00031   {
00032     POSITION pos = g_pListUser->GetHeadPosition();
00033     while (NULL != pos)
00034     {
00035       PUSER pUser = (PUSER) g_pListUser->GetNext(pos);
00036       if (pMember == pUser->pMember)
00037       {
00038         ASSERT(pMember == pUser->pMember);
00039         return pUser;
00040       }
00041     }
00042   }
00043
00044   return NULL;
00045 }
00046
00047
00048 //****************************************************************************
00049 //
00050 // int ItemFromPUser(PUSER pUser)
00051 //
00052 //****************************************************************************
00053
00054 int ItemFromPUser(PUSER pUser)
00055 {
00056   if (NULL == ghwndUser)
00057   {
00058     return -1;
00059   }
00060
00061   LV_FINDINFO findInfo;
00062   ClearStruct(&findInfo);           // Zero's memory
00063   findInfo.flags = LVFI_PARAM;
00064     findInfo.lParam = (LPARAM) pUser;
00065     return ListView_FindItem(ghwndUser, -1, &findInfo);
00066 }
00067
00068
00069 //****************************************************************************
00070 //
00071 // PUSER AllocUser(INmMember * pMember)
00072 //
00073 //****************************************************************************
00074
00075 PUSER AllocUser(INmMember * pMember)
00076 {
00077   if(NULL == pMember)
00078   {
00079     return NULL;
00080   }
00081
00082   HRESULT hr  = NO_ERROR;
00083   BSTR bstr = NULL;
00084   INmMember * pMemberTop = NULL;
00085
00086   PUSER pUser = new USER;
00087   if (NULL == pUser)
00088   {
00089     return NULL;
00090   }
00091
00092   ClearStruct(pUser);           // Zero's memory
00093
00094   pUser->pMember = pMember;
00095   pMember->AddRef();
00096
00097   hr = pMember->GetName(&bstr);
00098   if (SUCCEEDED(hr))
00099   {
00100     pUser->pszName = PszFromBstr(bstr);
00101     SysFreeString(bstr);
00102   }
00103
00104   hr = pMember->GetNmVersion(&pUser->uVersion);
00105
00106   pUser->fLocal = S_OK == pMember->IsSelf();
00107   pUser->fMcu = S_OK == pMember->IsMCU();
00108
00109   pUser->fTop = FALSE;
00110   if (SUCCEEDED(g_pConference->GetTopProvider(&pMemberTop)))
00111   {
00112     pUser->fTop = (pMember == pMemberTop);
00113     pMemberTop->Release();
00114   }
00115
00116   return pUser;
00117 }
00118
00119
00120 //****************************************************************************
00121 //
00122 // VOID FreeUser(PUSER pUser)
00123 //
00124 //****************************************************************************
00125
00126 VOID FreeUser(PUSER pUser)
00127 {
00128   ASSERT(NULL != pUser);
00129
00130   if(NULL == pUser)
00131   {
00132     return;
00133   }
00134
00135   FreePlpv(&pUser->pszName);
00136
00137   if (NULL != pUser->pMember)
00138   {
00139     pUser->pMember->Release();
00140   }
00141
00142   delete pUser;
00143 }
00144
00145
00146 //****************************************************************************
00147 //
00148 // VOID FreeAllUsers(void)
00149 //
00150 //****************************************************************************
00151
00152 VOID FreeAllUsers(void)
00153 {
00154   if (NULL == g_pListUser)
00155   {
00156     return;
00157   }
00158
00159   while (!g_pListUser->IsEmpty())
00160   {
00161     USER * pUser = (USER *) g_pListUser->RemoveHead();
00162     ASSERT(NULL != pUser);
00163     FreeUser(pUser);
00164   }
00165
00166   delete g_pListUser;
00167   g_pListUser = NULL;
00168 }
00169
00170
00171 //****************************************************************************
00172 //
00173 // VOID AddMember(INmMember * pMember)
00174 //
00175 //****************************************************************************
00176
00177 VOID AddMember(INmMember * pMember)
00178 {
00179   PUSER pUser = AllocUser(pMember);
00180   if (NULL == pUser)
00181   {
00182     return;
00183   }
00184
00185   AddNode(pUser, &g_pListUser);
00186
00187   LV_ITEM  lvItem;
00188   ClearStruct(&lvItem);           // Zero's memory
00189   lvItem.iItem = g_pListUser->GetItemCount();
00190   lvItem.mask = LVIF_PARAM | LVIF_TEXT;
00191   lvItem.pszText = (S_OK == pMember->IsSelf()) ? TEXT("everyone") : pUser->pszName;
00192   lvItem.cchTextMax = lstrlen(pUser->pszName);
00193   lvItem.lParam = (LPARAM) pUser;
00194   ListView_InsertItem(ghwndUser, &lvItem);
00195
00196   DisplaySysMsg(TEXT("<joined>"), pMember);
00197 }
00198
00199
00200 //****************************************************************************
00201 //
00202 // VOID RemoveMember(INmMember * pMember)
00203 //
00204 //****************************************************************************
00205
00206 VOID RemoveMember(INmMember * pMember)
00207 {
00208   if (NULL == g_pListUser)
00209   {
00210     return;
00211   }
00212
00213   POSITION pos = g_pListUser->GetHeadPosition();
00214   while (NULL != pos)
00215   {
00216     POSITION posSav = pos;
00217     PUSER pUser = (PUSER) g_pListUser->GetNext(pos);
00218     if (pMember == pUser->pMember)
00219     {
00220       ASSERT(pMember == pUser->pMember);
00221       DisplaySysMsg(TEXT("<left>"), pMember);
00222
00223       ListView_DeleteItem(ghwndUser, ItemFromPUser(pUser));
00224       FreeUser(pUser);
00225       g_pListUser->RemoveAt(posSav);
00226       return;
00227     }
00228   }
00229 }
00230
00231
00232 //****************************************************************************
00233 //
00234 // INmMember * GetSelectedMember(void)
00235 //
00236 //****************************************************************************
00237
00238 INmMember * GetSelectedMember(void)
00239 {
00240   int iItem = 0;
00241
00242   if (NULL == g_pListUser)
00243   {
00244     return NULL;
00245   }
00246
00247   iItem = ListView_GetNextItem(ghwndUser, -1, LVNI_ALL | LVNI_SELECTED);
00248   if (-1 == iItem)
00249   {
00250     return NULL;
00251   }
00252
00253   LV_ITEM lv;
00254   lv.mask = LVIF_PARAM;
00255   lv.iItem = iItem;
00256   ListView_GetItem(ghwndUser, &lv);
00257
00258   return ((PUSER) lv.lParam)->pMember;
00259 }
00260
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAuthenticatePlugin Member List

This is the complete list of members for CAuthenticatePlugin, including all inherited members.
CAuthenticatePlugin() | CAuthenticatePlugin |
CreateAuthenticationContext(IWMSAuthenticationContext **ppAuthenCtx) | CAuthenticatePlugin |
DisablePlugin() | CAuthenticatePlugin |
EnablePlugin(long *pdwFlags, long *pdwHeartbeatPeriod) | CAuthenticatePlugin |
GetCustomAdminInterface(IDispatch **ppValue) | CAuthenticatePlugin |
GetFlags(long *Flags) | CAuthenticatePlugin |
GetPackageName(BSTR *PackageName) | CAuthenticatePlugin |
GetProtocolName(BSTR *ProtocolName) | CAuthenticatePlugin |
InitializePlugin(IWMSContext *pServerContext, IWMSNamedValues *pNamedValues, IWMSClassObject *pClassFactory) | CAuthenticatePlugin |
m_spNamedValues | CAuthenticatePlugin | [private]
OnHeartbeat() | CAuthenticatePlugin |
ShutdownPlugin() | CAuthenticatePlugin |
~CAuthenticatePlugin() | CAuthenticatePlugin |
Generated on Wed Nov 13 2024 16:55:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RRas/rqs/server/rqsconfig.h Source File

  • NetDS
  • RRas
  • rqs
  • server

rqsconfig.h

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 //      File:       RqsConfig.h
00004 //
00005 //      Synopsis:   Class to read configuration for the server-side quarantine
00006 //                  removal utility.
00007 //
00008 //      Copyright   (c) Microsoft Corporation.  All rights reserved.
00009 //
00010 //+--------------------------------------------------------------------------
00011
00012 #pragma once
00013
00014 class RqsEngine;
00015
00016 typedef struct _RqsConfigString
00017 {
00018     CHAR* pszString;
00019     UINT uiLength;
00020 } RqsConfigString;
00021
00022 class RqsConfig
00023 {
00024 public:
00025     RqsConfig();
00026     ~RqsConfig();
00027
00028     VOID Clear();
00029
00030     HRESULT LoadTrace();
00031     HRESULT LoadConfig();
00032     HRESULT Load();
00033
00034     UINT GetPort() const;
00035     BOOL GetTraceEnabled() const;
00036     BOOL GetDebugTrace() const;
00037     CONST WCHAR* GetLibrary() const;
00038
00039     BOOL Find(IN CHAR* pszString) const;
00040
00041     static const PWSTR GetConfigPath();
00042     static const PWSTR GetTracePath();
00043
00044     VOID TraceSelf(const RqsEngine& Engine);
00045
00046 private:
00047     RqsConfigString* m_pStrings;
00048     UINT m_uiCount;
00049     UINT m_uiPort;
00050     BOOL m_fTraceEnabled;
00051     BOOL m_fDebuggerTrace;
00052     PWSTR m_pszLibrary;
00053
00054     VOID ClearStrings(IN RqsConfigString* pStrings, IN UINT uiCount);
00055
00056 };
00057
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/wia/GetImage/BitmapUtil.cpp Source File

  • Multimedia
  • wia
  • GetImage

BitmapUtil.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 --*/
00006
00007 #include "stdafx.h"
00008 #include "resource.h"
00009
00010 #include "BitmapUtil.h"
00011
00012 namespace BitmapUtil
00013 {
00014
00015 //////////////////////////////////////////////////////////////////////////
00016 //
00017 // GetBitmapHeaderSize
00018 //
00019
00020 ULONG GetBitmapHeaderSize(LPCVOID pDib)
00021 {
00022     ULONG nHeaderSize = *(PDWORD) pDib;
00023
00024     switch (nHeaderSize)
00025   {
00026     case sizeof(BITMAPCOREHEADER):
00027         case sizeof(BITMAPINFOHEADER):
00028     case sizeof(BITMAPV4HEADER):
00029     case sizeof(BITMAPV5HEADER):
00030     {
00031       return nHeaderSize;
00032     }
00033     }
00034
00035     return 0;
00036 }
00037
00038
00039 //////////////////////////////////////////////////////////////////////////
00040 //
00041 // GetBitmapLineWidthInBytes
00042 //
00043
00044 ULONG GetBitmapLineWidthInBytes(ULONG nWidthInPixels, ULONG nBitCount)
00045 {
00046     return (((nWidthInPixels * nBitCount) + 31) & ~31) >> 3;
00047 }
00048
00049
00050 //////////////////////////////////////////////////////////////////////////
00051 //
00052 // GetBitmapDimensions
00053 //
00054
00055 BOOL GetBitmapDimensions(LPCVOID pDib, UINT *pWidth, UINT *pHeight)
00056 {
00057     ULONG nHeaderSize = GetBitmapHeaderSize(pDib);
00058
00059     if (nHeaderSize == 0)
00060     {
00061         return FALSE;
00062     }
00063
00064     if (nHeaderSize == sizeof(BITMAPCOREHEADER))
00065     {
00066         PBITMAPCOREHEADER pbmch = (PBITMAPCOREHEADER) pDib;
00067
00068         if (pWidth != NULL)
00069         {
00070             *pWidth  = pbmch->bcWidth;
00071         }
00072
00073         if (pHeight != NULL)
00074         {
00075             *pHeight = pbmch->bcHeight;
00076         }
00077     }
00078     else
00079     {
00080         PBITMAPINFOHEADER pbmih = (PBITMAPINFOHEADER) pDib;
00081
00082         if (pWidth != NULL)
00083         {
00084             *pWidth  = pbmih->biWidth;
00085         }
00086
00087         if (pHeight != NULL)
00088         {
00089             *pHeight = abs(pbmih->biHeight);
00090         }
00091     }
00092
00093     return TRUE;
00094 }
00095
00096
00097 //////////////////////////////////////////////////////////////////////////
00098 //
00099 // GetBitmapSize
00100 //
00101
00102 ULONG GetBitmapSize(LPCVOID pDib)
00103 {
00104     ULONG nHeaderSize = GetBitmapHeaderSize(pDib);
00105
00106     if (nHeaderSize == 0)
00107     {
00108         return 0;
00109     }
00110
00111     // Start the calculation with the header size
00112
00113     ULONG nDibSize = nHeaderSize;
00114
00115     // is this an old style BITMAPCOREHEADER?
00116
00117     if (nHeaderSize == sizeof(BITMAPCOREHEADER))
00118     {
00119         PBITMAPCOREHEADER pbmch = (PBITMAPCOREHEADER) pDib;
00120
00121         // Add the color table size
00122
00123         if (pbmch->bcBitCount <= 8)
00124         {
00125             nDibSize += sizeof(RGBTRIPLE) * (1 << pbmch->bcBitCount);
00126         }
00127
00128         // Add the bitmap size
00129
00130         ULONG nWidth = GetBitmapLineWidthInBytes(pbmch->bcWidth, pbmch->bcBitCount);
00131
00132         nDibSize += nWidth * pbmch->bcHeight;
00133     }
00134     else
00135     {
00136         // this is at least a BITMAPINFOHEADER
00137
00138         PBITMAPINFOHEADER pbmih = (PBITMAPINFOHEADER) pDib;
00139
00140         // Add the color table size
00141
00142         if (pbmih->biClrUsed != 0)
00143         {
00144             nDibSize += sizeof(RGBQUAD) * pbmih->biClrUsed;
00145         }
00146         else if (pbmih->biBitCount <= 8)
00147         {
00148             nDibSize += sizeof(RGBQUAD) * (1 << pbmih->biBitCount);
00149         }
00150
00151         // Add the bitmap size
00152
00153         if (pbmih->biSizeImage != 0)
00154         {
00155             nDibSize += pbmih->biSizeImage;
00156         }
00157         else
00158         {
00159             // biSizeImage must be specified for compressed bitmaps
00160
00161             if (pbmih->biCompression != BI_RGB &&
00162                 pbmih->biCompression != BI_BITFIELDS)
00163             {
00164                 return 0;
00165             }
00166
00167             ULONG nWidth = GetBitmapLineWidthInBytes(pbmih->biWidth, pbmih->biBitCount);
00168
00169             nDibSize += nWidth * abs(pbmih->biHeight);
00170         }
00171
00172         // Consider special cases
00173
00174         if (nHeaderSize == sizeof(BITMAPINFOHEADER))
00175         {
00176             // If this is a 16 or 32 bit bitmap and BI_BITFIELDS is used,
00177             // bmiColors member contains three DWORD color masks.
00178             // For V4 or V5 headers, this info is included the header
00179
00180             if (pbmih->biCompression == BI_BITFIELDS)
00181             {
00182                 nDibSize += 3 * sizeof(DWORD);
00183             }
00184         }
00185         else if (nHeaderSize >= sizeof(BITMAPV5HEADER))
00186         {
00187             // If this is a V5 header and an ICM profile is specified,
00188             // we need to consider the profile data size
00189
00190             PBITMAPV5HEADER pbV5h = (PBITMAPV5HEADER) pDib;
00191
00192             // if there is some padding before the profile data, add it
00193
00194             if (pbV5h->bV5ProfileData > nDibSize)
00195             {
00196                 nDibSize = pbV5h->bV5ProfileData;
00197             }
00198
00199             // add the profile data size
00200
00201             nDibSize += pbV5h->bV5ProfileSize;
00202         }
00203     }
00204
00205     return nDibSize;
00206 }
00207
00208
00209 //////////////////////////////////////////////////////////////////////////
00210 //
00211 // GetBitmapOffsetBits
00212 //
00213
00214 ULONG GetBitmapOffsetBits(LPCVOID pDib)
00215 {
00216     ULONG nHeaderSize = GetBitmapHeaderSize(pDib);
00217
00218     if (nHeaderSize == 0)
00219     {
00220         return 0;
00221     }
00222
00223     // Start the calculation with the header size
00224
00225     ULONG nOffsetBits = nHeaderSize;
00226
00227     // is this an old style BITMAPCOREHEADER?
00228
00229     if (nHeaderSize == sizeof(BITMAPCOREHEADER))
00230     {
00231         PBITMAPCOREHEADER pbmch = (PBITMAPCOREHEADER) pDib;
00232
00233         // Add the color table size
00234
00235         if (pbmch->bcBitCount <= 8)
00236         {
00237             nOffsetBits += sizeof(RGBTRIPLE) * (1 << pbmch->bcBitCount);
00238         }
00239     }
00240     else
00241     {
00242         // this is at least a BITMAPINFOHEADER
00243
00244         PBITMAPINFOHEADER pbmih = (PBITMAPINFOHEADER) pDib;
00245
00246         // Add the color table size
00247
00248         if (pbmih->biClrUsed != 0)
00249         {
00250             nOffsetBits += sizeof(RGBQUAD) * pbmih->biClrUsed;
00251         }
00252         else if (pbmih->biBitCount <= 8)
00253         {
00254             nOffsetBits += sizeof(RGBQUAD) * (1 << pbmih->biBitCount);
00255         }
00256
00257         // Consider special cases
00258
00259         if (nHeaderSize == sizeof(BITMAPINFOHEADER))
00260         {
00261             // If this is a 16 or 32 bit bitmap and BI_BITFIELDS is used,
00262             // bmiColors member contains three DWORD color masks.
00263             // For V4 or V5 headers, this info is included in the header
00264
00265             if (pbmih->biCompression == BI_BITFIELDS)
00266             {
00267                 nOffsetBits += 3 * sizeof(DWORD);
00268             }
00269         }
00270         else if (nHeaderSize >= sizeof(BITMAPV5HEADER))
00271         {
00272             // If this is a V5 header and an ICM profile is specified,
00273             // we need to consider the profile data size
00274
00275             PBITMAPV5HEADER pbV5h = (PBITMAPV5HEADER) pDib;
00276
00277             // if the profile data comes before the pixel data, add it
00278
00279             if (pbV5h->bV5ProfileData <= nOffsetBits)
00280             {
00281                 nOffsetBits += pbV5h->bV5ProfileSize;
00282             }
00283         }
00284     }
00285
00286     return nOffsetBits;
00287 }
00288
00289
00290 //////////////////////////////////////////////////////////////////////////
00291 //
00292 // FixBitmapHeight
00293 //
00294
00295 BOOL FixBitmapHeight(PVOID pDib, ULONG nSize, BOOL bTopDown)
00296 {
00297     ULONG nHeaderSize = GetBitmapHeaderSize(pDib);
00298
00299     if (nHeaderSize == 0)
00300     {
00301         return FALSE;
00302     }
00303
00304     // is this an old style BITMAPCOREHEADER?
00305
00306     if (nHeaderSize == sizeof(BITMAPCOREHEADER))
00307     {
00308         PBITMAPCOREHEADER pbmch = (PBITMAPCOREHEADER) pDib;
00309
00310         // fix the height value if necessary
00311
00312         if (pbmch->bcHeight == 0)
00313         {
00314             // start the calculation with the header size
00315
00316             ULONG nSizeImage = nSize - nHeaderSize;
00317
00318             // subtract the color table size
00319
00320             if (pbmch->bcBitCount <= 8)
00321             {
00322                 nSizeImage -= sizeof(RGBTRIPLE) * (1 << pbmch->bcBitCount);
00323             }
00324
00325             // calculate the height
00326
00327             ULONG nWidth = GetBitmapLineWidthInBytes(pbmch->bcWidth, pbmch->bcBitCount);
00328
00329             if (nWidth == 0)
00330             {
00331                 return FALSE;
00332             }
00333
00334             LONG nHeight = nSizeImage / nWidth;
00335
00336             pbmch->bcHeight = (WORD) nHeight;
00337         }
00338     }
00339     else
00340     {
00341         // this is at least a BITMAPINFOHEADER
00342
00343         PBITMAPINFOHEADER pbmih = (PBITMAPINFOHEADER) pDib;
00344
00345         // fix the height value if necessary
00346
00347         if (pbmih->biHeight == 0)
00348         {
00349             // find the size of the image data
00350
00351             ULONG nSizeImage;
00352
00353             if (pbmih->biSizeImage != 0)
00354             {
00355                 // if the size is specified in the header, take it
00356
00357                 nSizeImage = pbmih->biSizeImage;
00358             }
00359             else
00360             {
00361                 // start the calculation with the header size
00362
00363                 nSizeImage = nSize - nHeaderSize;
00364
00365                 // subtract the color table size
00366
00367                 if (pbmih->biClrUsed != 0)
00368                 {
00369                     nSizeImage -= sizeof(RGBQUAD) * pbmih->biClrUsed;
00370                 }
00371                 else if (pbmih->biBitCount <= 8)
00372                 {
00373                     nSizeImage -= sizeof(RGBQUAD) * (1 << pbmih->biBitCount);
00374                 }
00375
00376                 // Consider special cases
00377
00378                 if (nHeaderSize == sizeof(BITMAPINFOHEADER))
00379                 {
00380                     // If this is a 16 or 32 bit bitmap and BI_BITFIELDS is used,
00381                     // bmiColors member contains three DWORD color masks.
00382                     // For V4 or V5 headers, this info is included the header
00383
00384                     if (pbmih->biCompression == BI_BITFIELDS)
00385                     {
00386                         nSizeImage -= 3 * sizeof(DWORD);
00387                     }
00388                 }
00389                 else if (nHeaderSize >= sizeof(BITMAPV5HEADER))
00390                 {
00391                     // If this is a V5 header and an ICM profile is specified,
00392                     // we need to consider the profile data size
00393
00394                     PBITMAPV5HEADER pbV5h = (PBITMAPV5HEADER) pDib;
00395
00396                     // add the profile data size
00397
00398                     nSizeImage -= pbV5h->bV5ProfileSize;
00399                 }
00400
00401                 // store the image size
00402
00403                 pbmih->biSizeImage = nSizeImage;
00404             }
00405
00406             // finally, calculate the height
00407
00408             ULONG nWidth = GetBitmapLineWidthInBytes(pbmih->biWidth, pbmih->biBitCount);
00409
00410             if (nWidth == 0)
00411             {
00412                 return FALSE;
00413             }
00414
00415       LONG nHeight = nSizeImage / nWidth;
00416
00417             pbmih->biHeight = bTopDown ? -nHeight : nHeight;
00418         }
00419     }
00420
00421   return TRUE;
00422 }
00423
00424
00425 //////////////////////////////////////////////////////////////////////////
00426 //
00427 // FillBitmapFileHeader
00428 //
00429
00430 BOOL FillBitmapFileHeader(LPCVOID pDib, PBITMAPFILEHEADER pbmfh)
00431 {
00432     ULONG nSize = GetBitmapSize(pDib);
00433
00434     if (nSize == 0)
00435     {
00436         return FALSE;
00437     }
00438
00439     ULONG nOffset = GetBitmapOffsetBits(pDib);
00440
00441     if (nOffset == 0)
00442     {
00443         return FALSE;
00444     }
00445
00446     pbmfh->bfType      = MAKEWORD('B', 'M');
00447     pbmfh->bfSize      = sizeof(BITMAPFILEHEADER) + nSize;
00448     pbmfh->bfReserved1 = 0;
00449     pbmfh->bfReserved2 = 0;
00450     pbmfh->bfOffBits   = sizeof(BITMAPFILEHEADER) + nOffset;
00451
00452     return TRUE;
00453 }
00454
00455 }; // namespace BitmapUtil
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GBSETINT Member List

This is the complete list of members for GBSETINT, including all inherited members.
fSigned | GBSETINT
uValue | GBSETINT
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenuExt/globals.h Source File

  • SysMgmt
  • MMC
  • CMenuExt

globals.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef _MMC_GLOBALS_H
00020 #define _MMC_GLOBALS_H
00021
00022 #include <tchar.h>
00023
00024 #ifndef STRINGS_ONLY
00025   #define IDM_BUTTON1    0x100
00026   #define IDM_BUTTON2    0x101
00027
00028   extern HINSTANCE g_hinst;
00029   extern ULONG g_uObjects;
00030
00031   #define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);
00032   #define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);
00033
00034 #endif
00035
00036 //=--------------------------------------------------------------------------=
00037 // allocates a temporary buffer that will disappear when it goes out of scope
00038 // NOTE: be careful of that -- make sure you use the string in the same or
00039 // nested scope in which you created this buffer. people should not use this
00040 // class directly.  use the macro(s) below.
00041 //
00042 class TempBuffer {
00043   public:
00044     TempBuffer(ULONG cBytes) {
00045         m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes);
00046         m_fHeapAlloc = (cBytes > 120);
00047     }
00048     ~TempBuffer() {
00049         if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf);
00050     }
00051     void *GetBuffer() {
00052         return m_pBuf;
00053     }
00054
00055   private:
00056     void *m_pBuf;
00057     // we'll use this temp buffer for small cases.
00058     //
00059     char  m_szTmpBuf[120];
00060     unsigned m_fHeapAlloc:1;
00061 };
00062
00063 //=--------------------------------------------------------------------------=
00064 // string helpers.
00065 //
00066 // given a _TCHAR, copy it into a wide buffer.
00067 // be careful about scoping when using this macro!
00068 //
00069 // how to use the below two macros:
00070 //
00071 //  ...
00072 //  LPTSTR pszT;
00073 //  pszT = MyGetTStringRoutine();
00074 //  MAKE_WIDEPTR_FROMSTR(pwsz, pszT);
00075 //  MyUseWideStringRoutine(pwsz);
00076 //  ...
00077 #ifdef UNICODE
00078 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00079     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00080     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00081     lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \
00082     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00083 #else // ANSI
00084 #define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \
00085     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00086     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00087     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00088     MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __cch##ptrname); \
00089     LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()
00090 #endif
00091
00092 #ifdef UNICODE
00093 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00094     long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \
00095     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00096     lstrcpyW((LPWSTR)ptrname, tstr)
00097 #else // ANSI
00098 #define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \
00099     long __cch##ptrname = (lstrlenA(tstr) + 1);\
00100     long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \
00101     LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \
00102     MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __cch##ptrname)
00103 #endif
00104
00105 //
00106 // similarily for MAKE_TSTRPTR_FROMWIDE.  note that the first param does not
00107 // have to be declared, and no clean up must be done.
00108 //
00109 // * 2 for DBCS handling in below length computation
00110 //
00111 #ifdef UNICODE
00112 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00113     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00114     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00115     lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \
00116     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00117 #else // ANSI
00118 #define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \
00119     long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \
00120     TempBuffer __TempBuffer##ptrname(__l##ptrname); \
00121     WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \
00122     LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()
00123 #endif
00124
00125 #endif // _MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/VCAcct/StdAfx.h Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • VCAcct

StdAfx.h

Go to the documentation of this file.
00001 //==============================================================================
00002 // Filename: stdafx.h
00003 //
00004 // Description: include file for standard system include files,
00005 //        or project specific include files that are used frequently,
00006 //        but are changed infrequently
00007 //
00008 // This file is part of the Microsoft COM+ Samples
00009 //
00010 // Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved
00011 //
00012 // This source code is intended only as a supplement to Microsoft
00013 // Development Tools and/or on-line documentation.  See these other
00014 // materials for detailed information reagrding Microsoft code samples.
00015 //
00016 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 // PARTICULAR PURPOSE.
00020 //
00021 //==============================================================================
00022
00023
00024 #define _ATL_STATIC_REGISTRY
00025
00026 #include <atlbase.h>
00027 //You may derive a class from CComModule and use it if you want to override
00028 //something, but do not change the name of _Module
00029 extern CComModule _Module;
00030 #include <atlcom.h>
00031
00032 #define THROW_ERR(exp,str) {if (FAILED (hr = (exp))) {lErrFlag = 0; pErrMsg = _T(str); throw hr;}}
00033 #define THROW_STR(str) { hr = APP_ERROR; lErrFlag = 1; pErrMsg = str; throw hr;}
00034 #define RETHROW_ERR(exp) { if (FAILED(hr = (exp))) {lErrFlag = 2; throw hr;}}
00035
00036 #define APP_ERROR 0x80004100
00037
00038
00039 inline BSTR TCHAR2BSTR (TCHAR* szBuf) {
00040
00041   WCHAR* wszBuf;
00042
00043 #ifndef UNICODE
00044   wszBuf = new WCHAR [512];
00045   MultiByteToWideChar( CP_ACP, 0, szBuf, -1, wszBuf, 512 );
00046 #else
00047   wszBuf = szBuf;
00048 #endif
00049
00050   BSTR bstrNew = ::SysAllocString (wszBuf);
00051
00052 #ifndef UNICODE
00053   delete [] wszBuf;
00054 #endif
00055
00056   return bstrNew;
00057 }
00058
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/PoolTest/TestDlg.Cpp Source File

  • Com
  • Services
  • Object_Pooling
  • PoolTest

TestDlg.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: TestDlg.cpp
00004
00005 Summary: Implementation of CTestDlg
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #include "TestDlg.h"
00024
00025 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00026
00027 Class: CTestDlg
00028
00029 Implementation of the ATL dialog class. We only use the OnInitDialog to set
00030 up our timer and a method for our timer message
00031 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00032 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00033
00034 Method: Constructor
00035
00036 Summary: Create an instance of the LogWriter
00037
00038 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00039 CTestDlg::CTestDlg() : m_nNumberWrites(0)
00040 {
00041   // make our object
00042   HRESULT        hr;
00043   IClassFactory *pCF;
00044
00045   hr=CoGetClassObject(CLSID_LogFile, CLSCTX_LOCAL_SERVER, NULL, IID_IClassFactory, (void **)&pCF);
00046   _ASSERTE(SUCCEEDED(hr));
00047
00048   hr=pCF->CreateInstance(NULL, IID_ILogFile, (void **) &m_pLF);
00049   _ASSERTE(SUCCEEDED(hr));
00050
00051   pCF->Release();
00052
00053   //CoCreateInstance(CLSID_LogFile, NULL, CLSCTX_INPROC_SERVER, IID_ILogFile, (void **) &m_pLF);
00054 }
00055
00056 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00057
00058 Method: Destructor
00059
00060 Summary: Release our pointer
00061
00062 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00063 CTestDlg::~CTestDlg()
00064 {
00065   m_pLF->Release();
00066 }
00067
00068 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00069
00070 Method: OnInitDialog
00071
00072 Summary: Grab our process ID and set up the timer to fire
00073
00074 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00075 LRESULT CTestDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00076 {
00077   // get our process id
00078   dwPID = GetCurrentProcessId();
00079
00080   // set our timer to do the log writes
00081   SetTimer(NULL, 1000);
00082
00083   return 1;  // Let the system set the focus
00084 }
00085
00086 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00087
00088 Method: OnTimer
00089
00090 Summary: Called when the WM_TIMER message is recieved. We only recive one so
00091      when we get it, call the write method on our LogFile object
00092
00093 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00094 LRESULT CTestDlg::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
00095 {
00096   _bstr_t msg = "Test String";
00097   WCHAR buf[50];
00098
00099   wsprintfW(buf, L"Message number %d\r\n", ++m_nNumberWrites);
00100   // move our buf into a BSTR
00101   msg = buf;
00102   m_pLF->Write(msg, dwPID);
00103   SetDlgItemInt(IDC_NUMBERWRITES, m_nNumberWrites);
00104   return 0;
00105 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/WMI/delebase.Cpp Source File

  • SysMgmt
  • MMC
  • WMI

delebase.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "DeleBase.h"
00021
00022 const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 HBITMAP CDelegationBase::m_pBMapSm = NULL;
00025 HBITMAP CDelegationBase::m_pBMapLg = NULL;
00026
00027
00028 //==============================================================
00029 //
00030 // CDelegationBase implementation
00031 //
00032 //
00033 CDelegationBase::CDelegationBase()
00034 : bExpanded(FALSE)
00035 {
00036     if (NULL == m_pBMapSm || NULL == m_pBMapLg)
00037         LoadBitmaps();
00038 }
00039
00040 CDelegationBase::~CDelegationBase()
00041 {
00042 }
00043
00044 // CDelegationBase::AddImages sets up the collection of images to be displayed
00045 // by the IComponent in the result pane as a result of its MMCN_SHOW handler
00046 HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
00047 {
00048     return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
00049         (long *)m_pBMapLg, // pointer to a handle
00050         0, // index of the first image in the strip
00051         RGB(0, 128, 128)  // color of the icon mask
00052         );
00053 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSyncMgrHandler Member List

This is the complete list of members for CSyncMgrHandler, including all inherited members.
CLockHandler() | CLockHandler |
CopyFileFullPath(TCHAR *pszFile1, TCHAR *pszFile2) | CSyncMgrHandler | [private]
CopyFiles(LPHANDLERITEM_SYNCSTATUS pHandlerItemID, LPHANDLERITEMSETTINGS pHandlerSyncItem, LPSYNCMGRSYNCHRONIZECALLBACK pCallback, DWORD *pdwCurProgValue, TCHAR *pszDir1, LPFILEOBJECTLIST pDir1, TCHAR *pszDir2) | CSyncMgrHandler | [private]
CountNumberOfFilesInList(LPFILEOBJECTLIST pfObjList, BOOL fRecursive) | CSyncMgrHandler | [private]
CreateDirFileListFromPath(TCHAR *pDirName, BOOL fRecursive) | CSyncMgrHandler | [private]
CreateWorkerThread() | CSyncMgrHandler | [private]
CSyncMgrHandler() | CSyncMgrHandler |
EnumSyncMgrItems(ISyncMgrEnumItems **ppenumOffineItems) | CSyncMgrHandler |
FindFileItemWithName(LPFILEOBJECTLIST pDir, TCHAR *pfName) | CSyncMgrHandler | [private]
GetFilesForDir(TCHAR *pDirName, BOOL fRecursive) | CSyncMgrHandler | [private]
GetHandlerInfo(LPSYNCMGRHANDLERINFO *ppSyncMgrHandlerInfo) | CSyncMgrHandler |
GetItemObject(REFSYNCMGRITEMID ItemID, REFIID riid, void **ppv) | CSyncMgrHandler |
GetLockThreadId() | CLockHandler | [inline]
GetProgressCallback() | CSyncMgrHandler | [private]
HandlerThreadWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CSyncMgrHandler | [friend]
Initialize(DWORD dwReserved, DWORD dwSyncFlags, DWORD cbCookie, const BYTE *lpCooke) | CSyncMgrHandler |
Lock(DWORD dwThreadId) | CLockHandler |
LogError(ISyncMgrSynchronizeCallback *lpCallBack, REFSYNCMGRITEMID pItemID, DWORD dwErrorLevel, TCHAR *lpErrorText, DWORD mask, DWORD dwSyncMgrErrorFlags, SYNCMGRERRORID ErrorID) | CSyncMgrHandler | [private]
LogError(ISyncMgrSynchronizeCallback *lpCallBack, REFSYNCMGRITEMID pItemID, DWORD dwErrorLevel, TCHAR *lpErrorText) | CSyncMgrHandler | [private]
LogError(ISyncMgrSynchronizeCallback *lpCallBack, DWORD dwErrorLevel, TCHAR *lpErrorText) | CSyncMgrHandler | [private]
m_cRef | CSyncMgrHandler | [private]
m_dwSyncFlags | CSyncMgrHandler | [private]
m_fPrepareForSync | CSyncMgrHandler | [private]
m_fStopped | CSyncMgrHandler | [private]
m_fSynchronizing | CSyncMgrHandler | [private]
m_hwndHandler | CSyncMgrHandler | [private]
m_hwndWorker | CSyncMgrHandler | [private]
m_phThread | CSyncMgrHandler | [private]
m_pItemsToSyncList | CSyncMgrHandler | [private]
m_pSyncMgrSynchronizeCallback | CSyncMgrHandler | [private]
PrepareForSync(ULONG cbNumItems, SYNCMGRITEMID *pItemIDs, HWND hWndParent, DWORD dwReserved) | CSyncMgrHandler |
PrepareForSyncCall(ULONG cbNumItems, SYNCMGRITEMID *pItemIDs, HWND hWndParent, DWORD dwReserved) | CSyncMgrHandler |
Progress(ISyncMgrSynchronizeCallback *lpCallBack, REFSYNCMGRITEMID pItemID, UINT mask, TCHAR *pStatusText, DWORD dwStatusType, int iProgValue, int iMaxValue) | CSyncMgrHandler | [private]
ProgressSetItemProgMaxValue(ISyncMgrSynchronizeCallback *lpCallBack, REFSYNCMGRITEMID pItemID, int iProgMaxValue) | CSyncMgrHandler | [private]
ProgressSetItemProgValue(ISyncMgrSynchronizeCallback *lpCallBack, REFSYNCMGRITEMID pItemID, int iProgValue) | CSyncMgrHandler | [private]
ProgressSetItemStatusText(ISyncMgrSynchronizeCallback *lpCallBack, REFSYNCMGRITEMID pItemID, TCHAR *pStatusText) | CSyncMgrHandler | [private]
ProgressSetItemStatusType(ISyncMgrSynchronizeCallback *lpCallBack, REFSYNCMGRITEMID pItemID, DWORD dwSyncMgrStatus) | CSyncMgrHandler | [private]
QueryInterface(REFIID, LPVOID FAR *) | CSyncMgrHandler |
ReconcileDir(HWND hWndParent, LPHANDLERITEM_SYNCSTATUS pHandlerItemID, LPHANDLERITEMSETTINGS pHandlerSyncItem, LPSYNCMGRSYNCHRONIZECALLBACK pCallback, DWORD *pdwCurProgValue, TCHAR *pszDir1, LPFILEOBJECTLIST pDir1, TCHAR *pszDir2, LPFILEOBJECTLIST pDir2) | CSyncMgrHandler | [private]
ReleaseFileObjectList(LPFILEOBJECTLIST pfObjList, BOOL fRecursive) | CSyncMgrHandler | [private]
SetItemStatus(REFSYNCMGRITEMID ItemID, DWORD dwSyncMgrStatus) | CSyncMgrHandler |
SetProgressCallback(ISyncMgrSynchronizeCallback *lpCallBack) | CSyncMgrHandler |
ShowError(HWND hWndParent, REFSYNCMGRERRORID ErrorID) | CSyncMgrHandler |
ShowErrorCall(HWND hWndParent, REFSYNCMGRERRORID ErrorID) | CSyncMgrHandler |
ShowProperties(HWND hWndParent, REFSYNCMGRITEMID ItemID) | CSyncMgrHandler |
ShowPropertiesCall(HWND hWndParent, REFSYNCMGRITEMID ItemID) | CSyncMgrHandler |
STDMETHODIMP_(ULONG) AddRef() | CSyncMgrHandler |
STDMETHODIMP_(ULONG) Release() | CSyncMgrHandler |
SyncDirs(HWND hWndParent, LPHANDLERITEM_SYNCSTATUS pHandlerItemID, LPHANDLERITEMSETTINGS pHandlerSyncItem) | CSyncMgrHandler | [private]
Synchronize(HWND hWndParent) | CSyncMgrHandler |
SynchronizeCall(HWND hWndParent) | CSyncMgrHandler |
UnLock() | CLockHandler |
~CLockHandler() | CLockHandler |
~CSyncMgrHandler() | CSyncMgrHandler |
Generated on Wed Nov 13 2024 16:57:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/bits/Upload/cdialog.cpp Source File

  • Web
  • bits
  • Upload

cdialog.cpp

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //
00006 //  BITS Upload sample
00007 //  ==================
00008 //
00009 //  Module name:
00010 //  cdialog.cpp
00011 //
00012 //  Purpose:
00013 //  This module implements the CSimpleDialog class, which is
00014 //  used in the sample to display the User Interface.
00015 //
00016 //  Note that the actual file upload is triggered by pressing "OK" on the UI.
00017 //  So looking at the implementation of the method OnOK() is a good
00018 //  starting point for tracking the sample's main code path.
00019 //
00020 //----------------------------------------------------------------------------
00021
00022
00023 #include <windows.h>
00024 #include <crtdbg.h>
00025 #include <strsafe.h>
00026 #include <wininet.h>
00027
00028 #include "resource.h"
00029 #include "main.h"
00030 #include "util.h"
00031 #include "cdialog.h"
00032 #include "cpack.h"
00033
00034
00035
00036 const WCHAR STR_VIRTUALDIR_PLAIN[]         = L"http://localhost/UploadSample";
00037 const WCHAR STR_VIRTUALDIR_NOTIFICATIONS[] = L"http://localhost/UploadSampleWithNotifications";
00038
00039 const WCHAR STR_SAMPLETEXT_DEFAULT[] = L"Enter some text here";
00040 const WCHAR STR_JOBNAME_DEFAULT[]    = L"BITS Upload Sample File";
00041
00042
00043 // ==========================================================================
00044 // Constructor/Destructor for CSimpleDialog
00045 // ==========================================================================
00046
00047 //---------------------------------------------------------------------------
00048 CSimpleDialog::CSimpleDialog(HINSTANCE hInstance, ULONG ulDialogId)
00049 {
00050     m_hInstance   = hInstance;
00051     m_ulDialogId  = ulDialogId;
00052     m_hWnd        = NULL;           // Handle returned by CreateDialogParam
00053     m_DlgProc     = DlgProc;        // Point to default dialog proc
00054 }
00055
00056 //---------------------------------------------------------------------------
00057 CSimpleDialog::~CSimpleDialog()
00058 {
00059 }
00060
00061 //----------------------------------------------------------------------------
00062 // Public methods exposed by CSimpleDialog
00063 //----------------------------------------------------------------------------
00064
00065 //---------------------------------------------------------------------------
00066 HRESULT CSimpleDialog::Show(INT iShowState)
00067 {
00068     HRESULT hr = S_OK;
00069
00070     m_hWnd = CreateDialogParam(
00071         m_hInstance,
00072         MAKEINTRESOURCE(m_ulDialogId),
00073         NULL,                           // hWndParent
00074         m_DlgProc,
00075         (LPARAM)this
00076         );
00077
00078     if (!m_hWnd)
00079     {
00080         hr = HRESULT_FROM_WIN32(GetLastError());
00081     }
00082     else
00083     {
00084         // the return just says if the window was previously visible or not
00085         BOOL bReturn = ShowWindow(m_hWnd, iShowState);
00086     }
00087
00088     return hr;
00089 }
00090
00091 //---------------------------------------------------------------------------
00092 HWND CSimpleDialog::GetHwnd()
00093 {
00094     return m_hWnd;
00095 }
00096
00097 //---------------------------------------------------------------------------
00098 HRESULT CSimpleDialog::AddStatusMessage(LPCWSTR wszFormat, ...)
00099 {
00100     HRESULT    hr                          = S_OK;
00101     HWND       hJobStatus;
00102     WCHAR      *pwszExistingText           = NULL;
00103     DWORD      cchExistingText             = 0;
00104     WCHAR      *pwszBuf                    = NULL;
00105     DWORD      cchBuf                      = 0;
00106     SYSTEMTIME Time;
00107     WCHAR      wszTimeBuf[20]              = {0};
00108     WCHAR      wszNewText[MAX_BUFFER_SIZE] = {0};
00109
00110
00111     if (!wszFormat)
00112     {
00113         return S_OK;
00114     }
00115
00116     //
00117     // Build a string with the text passed as a parameter
00118     //
00119     va_list arglist;
00120     va_start(arglist, wszFormat);
00121
00122     hr = StringCchVPrintfW(wszNewText, MAX_BUFFER_SIZE, wszFormat, arglist);
00123     if (FAILED(hr))
00124     {
00125         goto cleanup;
00126     }
00127
00128     //
00129     // Retrieve the text that is currently displayed in the Edit box
00130     //
00131
00132     hJobStatus      = GetDlgItem(m_hWnd, IDC_JOBSTATUS);
00133     cchExistingText = GetWindowTextLength(hJobStatus) + 1;
00134
00135     if (cchExistingText)
00136     {
00137         pwszExistingText = new WCHAR[cchExistingText];
00138         if (!pwszExistingText)
00139         {
00140             hr = E_OUTOFMEMORY;
00141             goto cleanup;
00142         }
00143
00144         GetWindowText(hJobStatus, pwszExistingText, cchExistingText);
00145     }
00146
00147     //
00148     // Get a string for the current time
00149     //
00150
00151     GetLocalTime(&Time);
00152     hr = StringCchPrintfW(wszTimeBuf, ARRAYSIZE(wszTimeBuf), L"[%.2u:%.2u %.2u.%.3us] ", Time.wHour, Time.wMinute, Time.wSecond, Time.wMilliseconds);
00153     if (FAILED(hr))
00154     {
00155         goto cleanup;
00156     }
00157
00158     //
00159     // Allocate a buffer for the new contents of the edit box
00160     //
00161     cchBuf  = cchExistingText + static_cast<DWORD>(wcslen(wszTimeBuf)) + static_cast<DWORD>(wcslen(wszNewText)) + 2 + 1;  // 2 for the break line
00162     pwszBuf = new WCHAR[cchBuf];
00163     if (!pwszBuf)
00164     {
00165         hr = E_OUTOFMEMORY;
00166         goto cleanup;
00167     }
00168     pwszBuf[0] = L'\0';
00169
00170     //
00171     // Build the new string
00172     //
00173     hr = StringCchPrintfW(pwszBuf, cchBuf, L"%s%s%s\r\n", (pwszExistingText? pwszExistingText : L""), wszTimeBuf, wszNewText);
00174     if (FAILED(hr))
00175     {
00176         goto cleanup;
00177     }
00178
00179     //
00180     // Update the control with the new string
00181     //
00182     if (!SetWindowText(hJobStatus, pwszBuf))
00183     {
00184         hr = HRESULT_FROM_WIN32(GetLastError());
00185         goto cleanup;
00186     }
00187
00188     //
00189     // Automatically scroll down the edit box
00190     //
00191     SendMessage(hJobStatus, EM_SETSEL, (WPARAM)0, (LPARAM)-1);
00192   SendMessage(hJobStatus, EM_SCROLLCARET, 0, 0);
00193
00194 cleanup:
00195
00196     va_end(arglist);
00197
00198     if (pwszExistingText)
00199     {
00200         delete [] pwszExistingText;
00201         pwszExistingText = NULL;
00202     }
00203
00204     if (pwszBuf)
00205     {
00206         delete [] pwszBuf;
00207         pwszBuf = NULL;
00208     }
00209
00210     return hr;
00211 }
00212
00213 // ==========================================================================
00214 // Message handlers (private)
00215 // ==========================================================================
00216
00217 //---------------------------------------------------------------------------
00218 LRESULT CSimpleDialog::OnInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam)
00219 {
00220     HWND    hVirtualDir   = NULL;
00221     HWND    hSampleText   = NULL;
00222     HWND    hUploadReply  = NULL;
00223
00224     // Set combobox contents
00225   SendDlgItemMessage(hDlg, IDC_VIRTUALDIR, CB_ADDSTRING, 0, (LPARAM)STR_VIRTUALDIR_PLAIN);
00226   SendDlgItemMessage(hDlg, IDC_VIRTUALDIR, CB_ADDSTRING, 0, (LPARAM)STR_VIRTUALDIR_NOTIFICATIONS);
00227     SendDlgItemMessage(hDlg, IDC_VIRTUALDIR, CB_LIMITTEXT, (WPARAM)(INTERNET_MAX_URL_LENGTH-1), (LPARAM)0);
00228     SendDlgItemMessage(hDlg, IDC_VIRTUALDIR, CB_SETCURSEL, (WPARAM)0, (LPARAM)0);
00229
00230     //hVirtualDir = GetDlgItem(hDlg, IDC_VIRTUALDIR);
00231     //SetWindowText(hVirtualDir, STR_VIRTUALDIR_DEFAULT);
00232
00233     hSampleText = GetDlgItem(hDlg, IDC_SAMPLETEXT);
00234     SetWindowText(hSampleText, STR_SAMPLETEXT_DEFAULT);
00235
00236     hUploadReply = GetDlgItem(hDlg, IDC_UPLOADREPLY_CHECKBOX);
00237     SendMessage(hUploadReply, BM_SETCHECK, BST_UNCHECKED, 0 );
00238
00239
00240     SetFocus(hSampleText);
00241
00242     return 1;
00243 }
00244
00245 //---------------------------------------------------------------------------
00246 LRESULT CSimpleDialog::OnOK(HWND hDlg, WPARAM wParam, LPARAM lParam)
00247 {
00248     HRESULT hr = S_OK;
00249     WCHAR   wszBuffSampleText[MAX_BUFFER_SIZE]         = {0};
00250     WCHAR   wszBuffVirtualDir[INTERNET_MAX_URL_LENGTH] = {0};
00251     BOOL    fRequireUploadReply = FALSE;
00252     LRESULT lRet = 1;
00253     CPack   XMLPack;
00254
00255     //
00256     // Grab input values from the UI
00257     //
00258     hr = CollectUserInput(
00259         wszBuffVirtualDir,
00260         ARRAYSIZE(wszBuffVirtualDir),
00261         wszBuffSampleText,
00262         ARRAYSIZE(wszBuffSampleText),
00263         &fRequireUploadReply
00264     );
00265     if (FAILED(hr))
00266     {
00267
00268         DisplayErrorMessage(L"Failed to collect input values from the UI.", hr);
00269         lRet = 0;
00270         goto done;
00271     }
00272
00273
00274     //
00275     //  Pack the text as an XML file and UPLOAD it to the server!!
00276     //
00277     AddStatusMessage(L"START OF PROCESS TO UPLOAD FILE");
00278
00279     hr = XMLPack.PackText(wszBuffSampleText);
00280     if (FAILED(hr))
00281     {
00282         lRet = 0;
00283         goto done;
00284     }
00285
00286     hr = XMLPack.Upload(STR_JOBNAME_DEFAULT, wszBuffVirtualDir, fRequireUploadReply);
00287     if (FAILED(hr))
00288     {
00289         lRet = 0;
00290         goto done;
00291     }
00292
00293 done:
00294
00295     if (!lRet)
00296     {
00297         AddStatusMessage(L"END OF UPLOAD PROCESS -- FAILED");
00298     }
00299
00300     return lRet;
00301 }
00302
00303 //---------------------------------------------------------------------------
00304 //  This is the first message sent by the DetroyWindow() function.
00305 //  It is sent after the window is removed from the screen, but it should
00306 //  be assumed that any child windows still exist.
00307 //
00308 LRESULT CSimpleDialog::OnDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam)
00309 {
00310     PostQuitMessage(0);
00311     return 1;
00312 }
00313
00314 //---------------------------------------------------------------------------
00315 //  This is sent after WM_DESTROY, and informs the app that the non-client
00316 //  area is being destroyed.  This is where allocated resources should be
00317 //  cleaned up.
00318 //
00319 LRESULT CSimpleDialog::OnNcDestroy(HWND hDlg, WPARAM wParam, LPARAM lParam)
00320 {
00321     m_hWnd = NULL;             // Since this is a modeless-only dialog
00322
00323     return 1;
00324 }
00325
00326
00327 //---------------------------------------------------------------------------
00328 LRESULT CSimpleDialog::OnCancel(HWND hDlg, WPARAM wParam, LPARAM lParam)
00329 {
00330     return DestroyWindow(m_hWnd);
00331 }
00332
00333 //---------------------------------------------------------------------------
00334 LRESULT CSimpleDialog::OnClose(HWND hDlg, WPARAM wParam, LPARAM lParam)
00335 {
00336     HRESULT hr = S_OK;
00337     CSmartComPtr<IEnumBackgroundCopyJobs> JobsEnum;
00338     CSmartComPtr<IBackgroundCopyJob>      Job;
00339     WCHAR *pwszJobName = NULL;
00340
00341     //
00342     // As we are leaving the application, cancel jobs that are still
00343     // in progress. This will only apply to Jobs submitted by this
00344     // user AND with our predefined description string
00345     //
00346     hr = g_JobManager->EnumJobs(0, JobsEnum.GrabOutPtr());
00347     if (FAILED(hr))
00348     {
00349         DisplayErrorMessage(L"Failed to create a BITS job enumerator. Error id is 0x%X.", hr);
00350         goto done;
00351     }
00352
00353     while((JobsEnum->Next(1, Job.GrabOutPtr(), NULL) == S_OK))
00354     {
00355         hr = Job->GetDisplayName(&pwszJobName);
00356         if (SUCCEEDED(hr))
00357         {
00358             if (wcscmp(pwszJobName, STR_JOBNAME_DEFAULT) == 0)
00359             {
00360                 // Found a job that was created by this app -- remove the
00361                 // notification callback and then cancel it
00362                 hr = Job->SetNotifyInterface(NULL);
00363                 if (FAILED(hr))
00364                 {
00365                     DisplayErrorMessage(L"Failed to remove the notification callback for a job while cleaning up jobs created by this application.", hr);
00366                 }
00367
00368                 hr = Job->Cancel();
00369                 if (FAILED(hr))
00370                 {
00371                     DisplayErrorMessage(L"Failed to cancel a job while cleaning up jobs created by this application.", hr);
00372                 }
00373             }
00374
00375             CoTaskMemFree(pwszJobName);
00376             pwszJobName = NULL;
00377         }
00378     }
00379
00380 done:
00381
00382     return DestroyWindow(m_hWnd);
00383 }
00384
00385
00386 // ==========================================================================
00387 // Main dialog procedure
00388 // ==========================================================================
00389
00390 //---------------------------------------------------------------------------
00391 //  Since this is a static function we can't use a 'this' pointer.
00392 //  We get around this by storing the 'this' pointer in the
00393 //  lParam of CreateDialogParam.  When we get WM_INITDIALOG we get this
00394 //  pointer back in the lParam.  Now we can use SetWindowLongPtr to store
00395 //  it, and later retireve it with GetWindowLongPtr.  Once we have a
00396 //  valid 'this' pointer we can cast it back to the base class and then
00397 //  call the base class's ProcessMessage function.
00398 //
00399
00400 INT_PTR CALLBACK CSimpleDialog::DlgProc (
00401   HWND     hDlg,           //[in] Handle to dialog box
00402   UINT     uMsg,           //[in] Message
00403   WPARAM   wParam,         //[in] First message parameter
00404   LPARAM   lParam          //[in] Second message parameter
00405   )
00406 {
00407     BOOL bReturn = FALSE;
00408     if (WM_INITDIALOG == uMsg)
00409     {
00410         SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam);
00411     }
00412
00413     CSimpleDialog* pThis = reinterpret_cast<CSimpleDialog *>(GetWindowLongPtr(hDlg, GWLP_USERDATA));
00414     if (pThis != NULL)
00415     {
00416         bReturn = pThis->ProcessMessage(hDlg, uMsg, wParam, lParam);
00417     }
00418
00419     return bReturn;
00420 }
00421
00422 //---------------------------------------------------------------------------
00423 //  This is the instance specific method used to process messages.  The
00424 //  DialogProc delegates this responsibility to each instance of the class.
00425 //
00426 BOOL CSimpleDialog::ProcessMessage (
00427   HWND     hDlg,           //[in] Handle to dialog box
00428   UINT     uMsg,           //[in] Message
00429   WPARAM   wParam,         //[in] First message parameter
00430   LPARAM   lParam          //[in] Second message parameter
00431   )
00432 {
00433     LRESULT lResult = 0;
00434     switch (uMsg)
00435     {
00436         case WM_INITDIALOG:
00437             lResult = OnInitDialog(hDlg, wParam, lParam);
00438             break;
00439
00440         case WM_DESTROY:
00441             lResult = OnDestroy(hDlg, wParam, lParam);
00442             break;
00443
00444         case WM_NCDESTROY:
00445             lResult = OnNcDestroy(hDlg, wParam, lParam);
00446             break;
00447
00448         case WM_CLOSE:
00449             lResult = OnClose(hDlg, wParam, lParam);
00450             break;
00451
00452         case WM_COMMAND:
00453             switch (wParam)
00454             {
00455                 case IDOK:
00456                     lResult = OnOK(hDlg, wParam, lParam);
00457                     break;
00458
00459                 case IDCANCEL:
00460                     lResult = OnCancel(hDlg, wParam, lParam);
00461                     break;
00462
00463                 default:
00464                     break;
00465             }
00466         default:
00467             break;
00468     }
00469
00470     return(BOOL)lResult;
00471 }
00472
00473 // ==========================================================================
00474 // Auxiliary methods (private)
00475 // ==========================================================================
00476
00477 HRESULT CSimpleDialog::CollectUserInput(
00478     IN OUT WCHAR *wszBuffVirtualDir,
00479     IN     DWORD  cchBuffVirtualDir,
00480     IN OUT WCHAR *wszBuffSampleText,
00481     IN     DWORD  cchBuffSampleText,
00482     OUT    BOOL  *fRequireUploadReply
00483 )
00484 {
00485     HRESULT hr                      = S_OK;
00486     HWND    hSampleText             = NULL;
00487     HWND    hVirtualDir             = NULL;
00488     HWND    hUploadReply            = NULL;
00489     INT     iEnd                    = 0;
00490     LRESULT idx                     = CB_ERR;
00491     LRESULT len                     = 0;
00492
00493     if (!wszBuffVirtualDir || !wszBuffSampleText || !fRequireUploadReply)
00494     {
00495         hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER);
00496         goto cleanup;
00497     }
00498
00499     *fRequireUploadReply = FALSE;
00500
00501     hVirtualDir = GetDlgItem(m_hWnd, IDC_VIRTUALDIR);
00502
00503      // get the index of the selection on the combobox
00504     idx = SendMessage(hVirtualDir, CB_GETCURSEL, (LPARAM)0, 0);
00505     if (idx == CB_ERR)
00506     {
00507         // the user probably edited something and used the combobox as an edit box
00508         len = SendMessage(hVirtualDir, WM_GETTEXTLENGTH, 0, 0);
00509
00510         if ((len == CB_ERR) || ((static_cast<DWORD>(len)+1) >= cchBuffVirtualDir))   // cchBuff includes the \0
00511         {
00512             hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00513             goto cleanup;
00514         }
00515
00516         SendMessage(
00517           hVirtualDir,                // handle to destination window
00518           WM_GETTEXT,                 // message to send
00519           (LPARAM)len,                // number of characters to copy
00520           (WPARAM)wszBuffVirtualDir   // text buffer
00521         );
00522     }
00523     else
00524     {
00525         len = SendMessage(
00526           hVirtualDir,                 // handle to destination window
00527           CB_GETLBTEXTLEN,             // message to send
00528           (WPARAM)idx,                 // item index
00529           (LPARAM)0                    // not used; must be zero
00530         );
00531
00532         if ((len == CB_ERR) || ((static_cast<DWORD>(len)+1) >= cchBuffVirtualDir)) // len + 1 includes the \0
00533         {
00534             hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00535             goto cleanup;
00536         }
00537
00538         // get the string of the current selection
00539         SendMessage(hVirtualDir, CB_GETLBTEXT, (LPARAM)idx, (WPARAM)wszBuffVirtualDir);
00540     }
00541
00542
00543     // if virtual directory doesn't end with a /, add it
00544     iEnd = static_cast<INT>(wcslen(wszBuffVirtualDir));
00545     if (iEnd > 0 && wszBuffVirtualDir[iEnd-1] != L'/')
00546     {
00547         hr = StringCchCat(wszBuffVirtualDir, cchBuffVirtualDir, L"/");
00548         if (FAILED(hr))
00549         {
00550             // we should never get here;
00551             goto cleanup;
00552         }
00553     }
00554
00555     hSampleText = GetDlgItem(m_hWnd, IDC_SAMPLETEXT);
00556     GetWindowText(hSampleText, wszBuffSampleText, cchBuffSampleText);
00557
00558     hUploadReply = GetDlgItem(m_hWnd, IDC_UPLOADREPLY_CHECKBOX);
00559     if (SendMessage(hUploadReply, BM_GETCHECK, 0, 0) == BST_CHECKED)
00560     {
00561         *fRequireUploadReply = TRUE;
00562     }
00563
00564 cleanup:
00565
00566     return hr;
00567 }
Generated on Wed Nov 13 2024 16:52:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/cdialoglite.cpp Source File

  • Dataaccess
  • oledb
  • rowsetviewer

cdialoglite.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CDIALOGLITE.CPP
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011
00012
00013 //////////////////////////////////////////////////////////////////////////
00014 // Includes
00015 //
00016 //////////////////////////////////////////////////////////////////////////
00017 #include "Headers.h"
00018
00019
00020 //////////////////////////////////////////////////////////////////////////
00021 // Globals
00022 //
00023 //////////////////////////////////////////////////////////////////////////
00024 CAppLite*   g_pCAppLite = NULL;
00025 CAppLite*   GetAppLite()          { return g_pCAppLite;   }
00026 void      SetAppLite(CAppLite* pCAppLite) { g_pCAppLite = pCAppLite;  }
00027
00028
00029
00030 //////////////////////////////////////////////////////////////////////////////
00031 // WinMain
00032 //
00033 //////////////////////////////////////////////////////////////////////////////
00034 int PASCAL WinMain(
00035   HINSTANCE hInstance,
00036   HINSTANCE hPrevInstance,
00037   LPSTR lpCmdLine,
00038   int nCmdShow
00039   )
00040 {
00041   //Should have a static CAppLite object at this point...
00042   CAppLite* pCAppLite = GetAppLite();
00043   ASSERT(pCAppLite);
00044
00045   //Create CWndApp
00046   if(!pCAppLite->AppInitialize(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
00047     return -1;
00048
00049   //Init
00050   if(!pCAppLite->InitInstance())
00051     return pCAppLite->ExitInstance();
00052
00053   //Make sure we have a CMainWindow setup at this point...
00054   if(!CAppLite::m_pCMainWindow || !CAppLite::m_pCMainWindow->m_hWnd)
00055     return pCAppLite->ExitInstance();
00056
00057   //Run
00058   if(!pCAppLite->Run())
00059     return pCAppLite->ExitInstance();
00060
00061   //Exit
00062   return pCAppLite->ExitInstance();
00063 }
00064
00065
00066
00067
00068 HWND      CAppLite::m_hWndModeless = NULL;  //Static
00069 CFrameWndLite*  CAppLite::m_pCMainWindow = NULL;  //Static
00070 /////////////////////////////////////////////////////////////////////
00071 // CAppLite::CAppLite
00072 //
00073 /////////////////////////////////////////////////////////////////////
00074 CAppLite::CAppLite(UINT nAppID)
00075 {
00076   m_nAppID = nAppID;
00077
00078   //Need to setup global CAppLite
00079   SetAppLite(this);
00080 }
00081
00082
00083 /////////////////////////////////////////////////////////////////////
00084 // CAppLite::~CAppLite
00085 //
00086 /////////////////////////////////////////////////////////////////////
00087 CAppLite::~CAppLite()
00088 {
00089   SetAppLite(NULL);
00090 }
00091
00092
00093 /////////////////////////////////////////////////////////////////////
00094 // CAppLite::AppInitialize
00095 //
00096 /////////////////////////////////////////////////////////////////////
00097 BOOL CAppLite::AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR* pszCmdLine, INT nCmdShow)
00098 {
00099   m_hInstance   = hInstance;
00100   m_hPrevInstance = hPrevInstance;
00101   m_pszCmdLine  = pszCmdLine;
00102   m_nCmdShow    = nCmdShow;
00103
00104   return TRUE;
00105 }
00106
00107
00108 /////////////////////////////////////////////////////////////////////
00109 // CAppLite::InitInstance
00110 //
00111 /////////////////////////////////////////////////////////////////////
00112 BOOL CAppLite::InitInstance()
00113 {
00114   return TRUE;
00115 }
00116
00117
00118 /////////////////////////////////////////////////////////////////////
00119 // CAppLite::Run
00120 //
00121 /////////////////////////////////////////////////////////////////////
00122 int CAppLite::Run()
00123 {
00124   MSG   msg;
00125
00126   //load accelerators
00127   HACCEL  hAccel = LoadAccelerators(m_hInstance, MAKEINTRESOURCE(m_nAppID));
00128
00129   // acquire and dispatch messages until a WM_QUIT message is received
00130   while(GetMessage(&msg, NULL, 0, 0))
00131   {
00132     //Modeless dialog boxes...
00133     if(m_hWndModeless && IsWindow(m_hWndModeless) && IsDialogMessage(m_hWndModeless, &msg))
00134       continue;
00135
00136     //Main Window Translation?
00137     if(m_pCMainWindow)
00138     {
00139       if(m_pCMainWindow->PreTranslateMessage(&msg))
00140         continue;
00141     }
00142
00143     //Check for App accelerators
00144     if(hAccel && TranslateAccelerator(m_pCMainWindow->m_hWnd, hAccel, &msg))
00145       continue;
00146
00147         // if the message does not need special processing, dispatch it
00148     TranslateMessage(&msg);
00149     DispatchMessage(&msg);
00150   }
00151
00152   return TRUE;
00153 }
00154
00155
00156 /////////////////////////////////////////////////////////////////////
00157 // CAppLite::ExitInstance
00158 //
00159 /////////////////////////////////////////////////////////////////////
00160 int CAppLite::ExitInstance()
00161 {
00162   return TRUE;
00163 }
00164
00165
00166 /////////////////////////////////////////////////////////////////////
00167 // CWndLite::CWndLite
00168 //
00169 /////////////////////////////////////////////////////////////////////
00170 CWndLite::CWndLite(HWND hWndParent, UINT nID)
00171 {
00172   m_hWnd      = NULL;
00173   m_hWndParent  = NULL;
00174   m_pwszClassName = NULL;
00175   m_nID     = 0;
00176   m_bUnicodeMsg = IsUnicodeOS();
00177
00178   if(hWndParent && nID)
00179     CreateIndirect(hWndParent, nID);
00180
00181   //SubClass
00182   m_pSubClassProc  = NULL;
00183 }
00184
00185
00186 /////////////////////////////////////////////////////////////////////
00187 // CWndLite::~CWndLite
00188 //
00189 /////////////////////////////////////////////////////////////////////
00190 CWndLite::~CWndLite()
00191 {
00192   SAFE_FREE(m_pwszClassName);
00193 }
00194
00195
00196 /////////////////////////////////////////////////////////////////////
00197 // CWndLite::PreCreateWindow
00198 //
00199 /////////////////////////////////////////////////////////////////////
00200 BOOL CWndLite::PreCreateWindow(CREATESTRUCTW& cs)
00201 {
00202   return TRUE;
00203 }
00204
00205
00206
00207 /////////////////////////////////////////////////////////////////////
00208 // CWndLite::Create
00209 //
00210 /////////////////////////////////////////////////////////////////////
00211 BOOL CWndLite::Create(HWND hWndParent, WCHAR* pwszClassName,
00212             WCHAR* pwszWindowName, UINT uID,
00213             DWORD dwStyle, DWORD dwExStyle,
00214             int x, int y, int cx, int cy)
00215 {
00216   ASSERT(IsDestroyed());
00217   m_hWndParent = hWndParent;
00218
00219   //Setup CreateStruct
00220   CREATESTRUCTW cs;
00221   cs.dwExStyle    = dwExStyle;
00222   cs.lpszClass    = pwszClassName;
00223   cs.lpszName     = pwszWindowName;
00224   cs.style      = dwStyle;
00225   cs.x        = x;
00226   cs.y        = y;
00227   cs.cx       = cx;
00228   cs.cy       = cy;
00229   cs.hwndParent   = hWndParent;
00230   cs.hMenu      = (HMENU)(ULONG_PTR)uID;
00231   cs.hInstance    = GetAppLite()->m_hInstance;
00232   cs.lpCreateParams = this;
00233
00234   //Allow Modification of CreateParams...
00235   if(!PreCreateWindow(cs))
00236     return FALSE;
00237
00238   //Convert the Params
00239   CHAR szClassName[MAX_NAME_LEN] = {0};
00240   ConvertToMBCS(pwszClassName, szClassName, MAX_NAME_LEN);
00241   CHAR szWindowName[MAX_NAME_LEN] = {0};
00242   ConvertToMBCS(pwszWindowName, szWindowName, MAX_NAME_LEN);
00243
00244   //Copy the Class Name
00245   SAFE_FREE(m_pwszClassName);
00246   m_pwszClassName = wcsDuplicate(pwszClassName);
00247
00248   //Actually CreateWindowEx
00249   m_hWnd = CreateWindowExA(cs.dwExStyle, szClassName,
00250       szWindowName, cs.style, cs.x, cs.y, cs.cx, cs.cy,
00251       cs.hwndParent, cs.hMenu, cs.hInstance, cs.lpCreateParams);
00252
00253   //Assoicate this window with this class
00254   if(m_hWnd)
00255   {
00256     SetThis(m_hWnd, this);
00257     return OnInitialUpdate();
00258   }
00259
00260   GETLASTERROR(m_hWnd)
00261   return NULL;
00262 }
00263
00264
00265 /////////////////////////////////////////////////////////////////////
00266 // CWndLite::CreateIndirect
00267 //
00268 /////////////////////////////////////////////////////////////////////
00269 BOOL CWndLite::CreateIndirect(HWND hWndParent, UINT nID)
00270 {
00271   m_nID     = nID;
00272
00273   if(nID)
00274   {
00275     //Its a control on a window
00276     m_hWnd      = ::GetDlgItem(hWndParent, m_nID);
00277     m_hWndParent  = hWndParent;
00278   }
00279   else
00280   {
00281     //Its just a window
00282     m_hWnd      = hWndParent;
00283     m_hWndParent  = GetParent(m_hWnd);
00284   }
00285
00286   //TODO:
00287   //Some messages (ie: EM_GETTEXTRANGE), since their is not a W-unicode and A-ansi version),
00288   //the message is completly based upon how you created the window.  If we created the window
00289   //incorectly, then we are limited to how the resource created it which is basically how you
00290   //compile the source.  Its also dependent upon weither you subclass the window.
00291   //(SetWindowLongPtrA or SetWindowLongW).
00292 #ifndef UNICODE
00293   m_bUnicodeMsg = FALSE;
00294 #endif
00295
00296   if(m_hWnd)
00297   {
00298     //NOTE: You only need to save the "this" pointer if your going
00299     //to subclass the window.  Otherwise two simple classes on a window control
00300     //will end up overwriting each other.  So we moved this to SubClassWindow
00301     return OnInitialUpdate();
00302   }
00303
00304   return FALSE;
00305 }
00306
00307
00308
00309 /////////////////////////////////////////////////////////////////////
00310 // CWndLite::OnInitialUpdate
00311 //
00312 /////////////////////////////////////////////////////////////////////
00313 BOOL CWndLite::OnInitialUpdate()
00314 {
00315   return TRUE;
00316 }
00317
00318
00319 /////////////////////////////////////////////////////////////////////
00320 // CWndLite::DestroyWindow
00321 //
00322 /////////////////////////////////////////////////////////////////////
00323 BOOL CWndLite::DestroyWindow()
00324 {
00325   if(m_hWnd)
00326   {
00327 		::DestroyWindow(m_hWnd);
00328     m_hWnd = NULL;
00329     return TRUE;
00330   }
00331
00332   return FALSE;
00333 }
00334
00335
00336 /////////////////////////////////////////////////////////////////////
00337 // CWndLite::SubClassWindow
00338 //
00339 /////////////////////////////////////////////////////////////////////
00340 BOOL CWndLite::SubClassWindow(WNDPROC pWndProc)
00341 {
00342   //NOTE: This method does not handle multiple levels...
00343   ASSERT(m_pSubClassProc == NULL);
00344
00345   //Save the "this" pointer (in case we haven't already, for the case where
00346   //we are subclassing a window thats already created - CreateIndirect).
00347   SetThis(m_hWnd, this);
00348
00349   m_pSubClassProc = (WNDPROC)GetWindowLongPtr(m_hWnd, GWLP_WNDPROC);
00350     SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG_PTR)pWndProc);
00351   return TRUE;
00352 }
00353
00354
00355 /////////////////////////////////////////////////////////////////////
00356 // CWndLite::OnCreate
00357 //
00358 /////////////////////////////////////////////////////////////////////
00359 BOOL CWndLite::OnCreate(CREATESTRUCT* pCREATESTRUCT)
00360 {
00361   return TRUE;
00362 }
00363
00364
00365 /////////////////////////////////////////////////////////////////////
00366 // CWndLite::OnCommandNotify
00367 //
00368 /////////////////////////////////////////////////////////////////////
00369 BOOL CWndLite::OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl)
00370 {
00371   return FALSE;
00372 }
00373
00374
00375 /////////////////////////////////////////////////////////////////////
00376 // CWndLite::OnCommand
00377 //
00378 /////////////////////////////////////////////////////////////////////
00379 BOOL CWndLite::OnCommand(UINT iID, HWND hWndCtrl)
00380 {
00381   return FALSE;
00382 }
00383
00384
00385 /////////////////////////////////////////////////////////////////////
00386 // CWndLite::OnUpdateCommand
00387 //
00388 /////////////////////////////////////////////////////////////////////
00389 BOOL CWndLite::OnUpdateCommand(HMENU hMenu, UINT nID, DWORD* pdwFlags)
00390 {
00391   return FALSE;
00392 }
00393
00394
00395 /////////////////////////////////////////////////////////////////////
00396 // CWndLite::OnNotify
00397 //
00398 /////////////////////////////////////////////////////////////////////
00399 BOOL CWndLite::OnNotify(INT idCtrl, NMHDR* pNMHDR)
00400 {
00401   return FALSE;
00402 }
00403
00404
00405 /////////////////////////////////////////////////////////////////////
00406 // CWndLite::OnActivate
00407 //
00408 /////////////////////////////////////////////////////////////////////
00409 BOOL CWndLite::OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious)
00410 {
00411   return FALSE;
00412 }
00413
00414
00415 /////////////////////////////////////////////////////////////////////
00416 // CWndLite::OnClose
00417 //
00418 /////////////////////////////////////////////////////////////////////
00419 BOOL CWndLite::OnClose()
00420 {
00421   return FALSE;
00422 }
00423
00424
00425 /////////////////////////////////////////////////////////////////////
00426 // CWndLite::OnDestroy
00427 //
00428 /////////////////////////////////////////////////////////////////////
00429 BOOL CWndLite::OnDestroy()
00430 {
00431   //Remove our Class from the hWnd lookup...
00432   SetThis(m_hWnd, NULL);
00433
00434   //Remove window items...
00435   m_hWnd      = NULL;
00436   m_hWndParent  = NULL;
00437   SAFE_FREE(m_pwszClassName);
00438   m_pSubClassProc = NULL;
00439   return TRUE;
00440 }
00441
00442
00443 /////////////////////////////////////////////////////////////////////
00444 // CWndLite::OnTimer
00445 //
00446 /////////////////////////////////////////////////////////////////////
00447 BOOL CWndLite::OnTimer(WPARAM nIDEvent)
00448 {
00449   return FALSE;
00450 }
00451
00452
00453 /////////////////////////////////////////////////////////////////////
00454 // CWndLite::OnDropFiles
00455 //
00456 /////////////////////////////////////////////////////////////////////
00457 BOOL CWndLite::OnDropFiles(HDROP hDrop)
00458 {
00459   return FALSE;
00460 }
00461
00462
00463 /////////////////////////////////////////////////////////////////////
00464 // CWndLite::OnSysCommand
00465 //
00466 /////////////////////////////////////////////////////////////////////
00467 BOOL CWndLite::OnSysCommand(WPARAM nCmdType, REFPOINTS pts)
00468 {
00469   return FALSE;
00470 }
00471
00472 /////////////////////////////////////////////////////////////////////
00473 // CWndLite::OnSize
00474 //
00475 /////////////////////////////////////////////////////////////////////
00476 BOOL CWndLite::OnSize(WPARAM nType, REFPOINTS pts)
00477 {
00478   return FALSE;
00479 }
00480
00481 /////////////////////////////////////////////////////////////////////
00482 // CWndLite::OnSizing
00483 //
00484 /////////////////////////////////////////////////////////////////////
00485 BOOL CWndLite::OnSizing(WPARAM nSize, REFPOINTS pts)
00486 {
00487   return FALSE;
00488 }
00489
00490
00491 /////////////////////////////////////////////////////////////////////
00492 // CWndLite::OnMove
00493 //
00494 /////////////////////////////////////////////////////////////////////
00495 BOOL CWndLite::OnMove(REFPOINTS pts)
00496 {
00497   return FALSE;
00498 }
00499
00500 /////////////////////////////////////////////////////////////////////
00501 // CWndLite::OnMouseMove
00502 //
00503 /////////////////////////////////////////////////////////////////////
00504 BOOL CWndLite::OnMouseMove(WPARAM nHittest, REFPOINTS pts)
00505 {
00506   return FALSE;
00507 }
00508
00509
00510 /////////////////////////////////////////////////////////////////////
00511 // CWndLite::OnDblclk
00512 //
00513 /////////////////////////////////////////////////////////////////////
00514 BOOL CWndLite::OnDblclk(WPARAM fwKeys, REFPOINTS pts)
00515 {
00516   return FALSE;
00517 }
00518
00519
00520 /////////////////////////////////////////////////////////////////////
00521 // CWndLite::OnLButtonDown
00522 //
00523 /////////////////////////////////////////////////////////////////////
00524 BOOL CWndLite::OnLButtonDown(WPARAM fwKeys, REFPOINTS pts)
00525 {
00526   return FALSE;
00527 }
00528
00529
00530 /////////////////////////////////////////////////////////////////////
00531 // CWndLite::OnLButtonUp
00532 //
00533 /////////////////////////////////////////////////////////////////////
00534 BOOL CWndLite::OnLButtonUp(WPARAM fwKeys, REFPOINTS pts)
00535 {
00536   return FALSE;
00537 }
00538
00539
00540 /////////////////////////////////////////////////////////////////////
00541 // CWndLite::OnRButtonDown
00542 //
00543 /////////////////////////////////////////////////////////////////////
00544 BOOL CWndLite::OnRButtonDown(WPARAM fwKeys, REFPOINTS pts)
00545 {
00546   //NOTE: The right mouse button doesn't automatically activate the MDI window...
00547   return FALSE;
00548 }
00549
00550
00551 /////////////////////////////////////////////////////////////////////
00552 // CWndLite::OnRButtonUp
00553 //
00554 /////////////////////////////////////////////////////////////////////
00555 BOOL CWndLite::OnRButtonUp(WPARAM fwKeys, REFPOINTS pts)
00556 {
00557   return FALSE;
00558 }
00559
00560
00561 /////////////////////////////////////////////////////////////////////
00562 // CWndLite::OnSetCursor
00563 //
00564 /////////////////////////////////////////////////////////////////////
00565 BOOL CWndLite::OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg)
00566 {
00567   return FALSE;
00568 }
00569
00570
00571 /////////////////////////////////////////////////////////////////////
00572 // CWndLite::OnContextMenu
00573 //
00574 /////////////////////////////////////////////////////////////////////
00575 BOOL CWndLite::OnContextMenu(HWND hWnd, REFPOINTS pts)
00576 {
00577   return FALSE;
00578 }
00579
00580
00581 /////////////////////////////////////////////////////////////////////
00582 // CWndLite::OnChar
00583 //
00584 /////////////////////////////////////////////////////////////////////
00585 BOOL CWndLite::OnChar(TCHAR chCharCode, LPARAM lKeyData)
00586 {
00587   return FALSE;
00588 }
00589
00590
00591 /////////////////////////////////////////////////////////////////////
00592 // CWndLite::OnKeyDown
00593 //
00594 /////////////////////////////////////////////////////////////////////
00595 BOOL CWndLite::OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData)
00596 {
00597   return FALSE;
00598 }
00599
00600 /////////////////////////////////////////////////////////////////////
00601 // CWndLite::OnSysKeyDown
00602 //
00603 /////////////////////////////////////////////////////////////////////
00604 BOOL CWndLite::OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData)
00605 {
00606   return FALSE;
00607 }
00608
00609 /////////////////////////////////////////////////////////////////////
00610 // CWndLite::OnVScroll
00611 //
00612 /////////////////////////////////////////////////////////////////////
00613 BOOL CWndLite::OnVScroll(int nScrollCode, int nPos, HWND hWnd)
00614 {
00615   return FALSE;
00616 }
00617
00618
00619 /////////////////////////////////////////////////////////////////////
00620 // CWndLite::OnHScroll
00621 //
00622 /////////////////////////////////////////////////////////////////////
00623 BOOL CWndLite::OnHScroll(int nScrollCode, int nPos, HWND hWnd)
00624 {
00625   return FALSE;
00626 }
00627
00628
00629 /////////////////////////////////////////////////////////////////////
00630 // CWndLite::OnNCMouseMove
00631 //
00632 /////////////////////////////////////////////////////////////////////
00633 BOOL CWndLite::OnNCMouseMove(WPARAM nHittest, REFPOINTS pts)
00634 {
00635   return FALSE;
00636 }
00637
00638 /////////////////////////////////////////////////////////////////////
00639 // CWndLite::OnNCButtonDown
00640 //
00641 /////////////////////////////////////////////////////////////////////
00642 BOOL CWndLite::OnNCButtonDown(WPARAM nHittest, REFPOINTS pts)
00643 {
00644   return FALSE;
00645 }
00646
00647 /////////////////////////////////////////////////////////////////////////////
00648 // CWndLite::OnSetFocus
00649 //
00650 /////////////////////////////////////////////////////////////////////////////
00651 BOOL CWndLite::OnSetFocus(HWND hWndPrevFocus)
00652 {
00653   return FALSE;
00654 }
00655
00656
00657 ////////////////////////////////////////////////////////////////
00658 // CWndLite::OnMenuSelect
00659 //
00660 /////////////////////////////////////////////////////////////////
00661 BOOL CWndLite::OnMenuSelect(UINT uID)
00662 {
00663   return FALSE;
00664 }
00665
00666
00667 ////////////////////////////////////////////////////////////////
00668 // CWndLite::OnInitMenuPopup
00669 //
00670 /////////////////////////////////////////////////////////////////
00671 BOOL CWndLite::OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu)
00672 {
00673   //Ignore the msg if it is for a system menu
00674   if(fSysMenu)
00675     return FALSE;
00676
00677   //Go through the menu items for current popup menu
00678   //and enable/disable menu item, if required
00679
00680   //Also note that HandleMenuPos is a recursive algortym.  This is for the
00681   //case where I need to detmerine if a "submenu->" is enabled or diasbled.
00682   //The only way to really tell is to know if there are any subitems that
00683   //are needed, but some of the subitems inturn may be "submenu->".
00684   //Therefore a item will be enabled if there is at least one subitem
00685   //The is wanted, and disabled if there are no subitems wanted.
00686   INT iMenuItems = GetMenuItemCount(hMenu);
00687   DWORD dwFlags = 0;
00688   for(LONG i=0; i<iMenuItems; i++)
00689   {
00690     dwFlags = 0;
00691     if(HandleMenuPos(hMenu, i, &dwFlags))
00692     {
00693       EnableMenuItem(hMenu, i, MF_BYPOSITION | dwFlags);
00694       CheckMenuItem(hMenu, i, MF_BYPOSITION | dwFlags);
00695     }
00696   }
00697
00698   return TRUE;
00699 }
00700
00701
00702 ////////////////////////////////////////////////////////////////
00703 // CWndLite::HandleMenuPos
00704 //
00705 /////////////////////////////////////////////////////////////////
00706 BOOL CWndLite::HandleMenuPos(HMENU hMenu, UINT uPos, DWORD* pdwFlags)
00707 {
00708   ASSERT(pdwFlags);
00709   *pdwFlags = 0;
00710   ULONG ulMenuID = GetMenuItemID(hMenu, uPos);
00711
00712   //SubMenu
00713   if(ulMenuID == ULONG_MAX)
00714   {
00715     BOOL bHandled = FALSE;
00716
00717     //Recursive Alogorytm
00718     HMENU hSubMenu = GetSubMenu(hMenu, uPos);
00719     INT iItems = GetMenuItemCount(hSubMenu);
00720     for(LONG i=0; i<iItems; i++)
00721     {
00722       //As soon as we find one menu item that we handle, we can return
00723       //since we now know the entire sub menu needs to be enabled for this item...
00724       if(HandleMenuPos(hSubMenu, i, pdwFlags))
00725       {
00726         bHandled = TRUE;
00727         if(*pdwFlags == MF_ENABLED)
00728           return TRUE;
00729       }
00730     }
00731
00732     return bHandled;
00733   }
00734
00735   //Otherwise we have a valid Menu ID...
00736   return OnUpdateCommand(hMenu, ulMenuID, pdwFlags);
00737 }
00738
00739
00740 /////////////////////////////////////////////////////////////////////
00741 // CWndLite::HandleMessage
00742 //
00743 /////////////////////////////////////////////////////////////////////
00744 BOOL CWndLite::HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
00745 {
00746   switch(msg)
00747   {
00748     case WM_COMMAND:
00749     {
00750       UINT wNotifyCode  = HIWORD(wParam); // notification code
00751       UINT iID      = LOWORD(wParam); // item, control, or accelerator identifier
00752       HWND hWndCtrl   = (HWND)lParam;   // handle of control
00753
00754       //Filter out any Control Notification codes
00755       //  wNotifyCode   - Specifies the notification code if the message is from a control. If the message is from an accelerator, this parameter is 1. If the message is from a menu, this parameter is 0.
00756       //  wID       - Specifies the identifier of the menu item, control, or accelerator.
00757       //  hwndCtl     - Identifies the control sending the message if the message is from a control. Otherwise, this parameter is NULL.
00758       if(hWndCtrl && wNotifyCode)
00759         return OnCommandNotify(wNotifyCode, iID, hWndCtrl);
00760
00761       return OnCommand(iID, hWndCtrl);
00762     }
00763
00764     case WM_SYSCOMMAND:
00765       return OnSysCommand(wParam, MAKEPOINTS(lParam));
00766
00767     case WM_ACTIVATE:
00768       return OnActivate(LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
00769
00770     case WM_MENUSELECT:
00771       return OnMenuSelect(LOWORD(wParam));
00772
00773     case WM_INITMENUPOPUP:
00774       return OnInitMenuPopup((HMENU)wParam, LOWORD(lParam), HIWORD(lParam));
00775
00776     case WM_NOTIFY:
00777       return OnNotify((INT)wParam, (NMHDR*)lParam);
00778
00779     case WM_CLOSE:
00780       return OnClose();
00781
00782     case WM_DESTROY:
00783       return OnDestroy();
00784
00785     case WM_TIMER:
00786       return OnTimer(wParam);
00787
00788     case WM_DROPFILES:
00789       return OnDropFiles((HDROP)wParam);
00790
00791     case WM_SIZE:
00792       return OnSize(wParam, MAKEPOINTS(lParam));
00793
00794     case WM_SIZING:
00795       return OnSizing(wParam, MAKEPOINTS(lParam));
00796
00797     case WM_MOVE:
00798       return OnMove(MAKEPOINTS(lParam));
00799
00800     case WM_MOUSEMOVE:
00801       return OnMouseMove(wParam, MAKEPOINTS(lParam));
00802
00803     case WM_LBUTTONDBLCLK:
00804       return OnDblclk(wParam, MAKEPOINTS(lParam));
00805
00806     case WM_LBUTTONDOWN:
00807       return OnLButtonDown(wParam, MAKEPOINTS(lParam));
00808
00809     case WM_LBUTTONUP:
00810       return OnLButtonUp(wParam, MAKEPOINTS(lParam));
00811
00812     case WM_RBUTTONDOWN:
00813       return OnRButtonDown(wParam, MAKEPOINTS(lParam));
00814
00815     case WM_RBUTTONUP:
00816       return OnRButtonUp(wParam, MAKEPOINTS(lParam));
00817
00818     case WM_CONTEXTMENU:
00819       return OnContextMenu((HWND)wParam, MAKEPOINTS(lParam));
00820
00821     case WM_CHAR:
00822       return OnChar((TCHAR)wParam, lParam);
00823
00824     case WM_KEYDOWN:
00825       return OnKeyDown(wParam, lParam);
00826
00827     case WM_SYSKEYDOWN:
00828       return OnSysKeyDown(wParam, lParam);
00829
00830     case WM_VSCROLL:
00831       return OnVScroll(LOWORD(wParam), HIWORD(wParam), (HWND) lParam);
00832
00833     case WM_HSCROLL:
00834       return OnHScroll(LOWORD(wParam), HIWORD(wParam), (HWND) lParam);
00835
00836     case WM_NCMOUSEMOVE:
00837       return OnNCMouseMove(wParam, MAKEPOINTS(lParam));
00838
00839     case WM_NCLBUTTONDOWN:
00840       return OnNCButtonDown(wParam, MAKEPOINTS(lParam));
00841
00842     case WM_SETFOCUS:
00843       return OnSetFocus((HWND)wParam);
00844   }
00845
00846   return FALSE;
00847 }
00848
00849
00850 /////////////////////////////////////////////////////////////////////
00851 // CWndLite::UnhandledMessage
00852 //
00853 /////////////////////////////////////////////////////////////////////
00854 LRESULT CWndLite::UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
00855 {
00856   return DefWindowProc(hWnd, msg, wParam, lParam);
00857 }
00858
00859
00860 /////////////////////////////////////////////////////////////////////
00861 // CWndLite::WndProc
00862 //
00863 /////////////////////////////////////////////////////////////////////
00864 LRESULT WINAPI CWndLite::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
00865 {
00866   CWndLite* pCWndLite = (CWndLite*)GetThis(hWnd);
00867
00868   switch(msg)
00869   {
00870     case WM_CREATE:
00871         {
00872       //Save the Window Handle
00873       CREATESTRUCT* pCS = (CREATESTRUCT*)lParam;
00874       pCWndLite = (CWndLite*)pCS->lpCreateParams;
00875       pCWndLite->m_hWnd = hWnd;
00876
00877       //Save the "this" pointer
00878       SetThis(hWnd, pCWndLite);
00879       if(pCWndLite->OnCreate(pCS))
00880         return 0;
00881       return -1;
00882     }
00883   };
00884
00885   //Otherwise just pass on message to original control
00886   if(pCWndLite)
00887   {
00888     //Pass onto our handler
00889     if(pCWndLite->HandleMessage(hWnd, msg, wParam, lParam))
00890       return 0;
00891
00892     //Pass onto SubClass'd window, if their is one...
00893     if(pCWndLite->m_pSubClassProc)
00894       return CallWindowProc(pCWndLite->m_pSubClassProc, hWnd, msg, wParam, lParam);
00895
00896     //Otherwise pass onto our default handler
00897     return pCWndLite->UnhandledMessage(hWnd, msg, wParam, lParam);
00898   }
00899
00900   return DefWindowProc(hWnd, msg, wParam, lParam);
00901 }
00902
00903
00904
00905 /////////////////////////////////////////////////////////////////////
00906 // CMDIChildLite::CMDIChildLite
00907 //
00908 /////////////////////////////////////////////////////////////////////
00909 CMDIChildLite::CMDIChildLite()
00910 {
00911 }
00912
00913
00914 /////////////////////////////////////////////////////////////////////
00915 // CMDIChildLite::~CMDIChildLite
00916 //
00917 /////////////////////////////////////////////////////////////////////
00918 CMDIChildLite::~CMDIChildLite()
00919 {
00920 }
00921
00922
00923 /////////////////////////////////////////////////////////////////////
00924 // CMDIChildLite::Create
00925 //
00926 /////////////////////////////////////////////////////////////////////
00927 BOOL CMDIChildLite::Create
00928 (
00929   HWND  hWndMDIClient,
00930   WCHAR*  pwszClassName,
00931   WCHAR*  pwszWindowName,
00932   UINT  uID,
00933   HICON hIcon,
00934   DWORD dwStyle,
00935   DWORD dwExStyle,
00936   int   x,
00937   int   y,
00938   int   cx,
00939   int   cy
00940 )
00941 {
00942   ASSERT(IsDestroyed());
00943   m_hWndParent = hWndMDIClient;
00944   WNDCLASS wc;
00945
00946   //Convert the Params
00947   CHAR szClassName[MAX_NAME_LEN] = {0};
00948   ConvertToMBCS(pwszClassName, szClassName, MAX_NAME_LEN);
00949   CHAR szWindowName[MAX_NAME_LEN] = {0};
00950   ConvertToMBCS(pwszWindowName, szWindowName, MAX_NAME_LEN);
00951
00952   // Register MDI Window classes, if we haven't done so already...
00953   if(!GetClassInfo(GetAppLite()->m_hInstance, szClassName, &wc))
00954   {
00955     wc.style      = 0;
00956     wc.lpfnWndProc    = MDIWndProc;
00957     wc.cbClsExtra   = 0;
00958     wc.cbWndExtra   = DLGWINDOWEXTRA;
00959     wc.hInstance    = GetAppLite()->m_hInstance;
00960     wc.hIcon      = hIcon;
00961     wc.hCursor      = LoadCursor(NULL, IDC_ARROW);
00962     wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
00963     wc.lpszMenuName   = MAKEINTRESOURCE(uID);
00964     wc.lpszClassName  = szClassName;
00965
00966     // register MDI Child Window Class
00967     if(!RegisterClass(&wc))
00968       return FALSE;
00969   }
00970
00971   //Setup CreateStruct
00972   CREATESTRUCTW cs;
00973   cs.dwExStyle    = dwExStyle;
00974   cs.lpszClass    = pwszClassName;
00975   cs.lpszName     = pwszWindowName;
00976   cs.style      = dwStyle;
00977   cs.x        = x;
00978   cs.y        = y;
00979   cs.cx       = cx;
00980   cs.cy       = cy;
00981   cs.hwndParent   = m_hWndParent;
00982   cs.hMenu      = (HMENU)(ULONG_PTR)uID;
00983   cs.hInstance    = GetAppLite()->m_hInstance;
00984   cs.lpCreateParams = this;
00985
00986   //Allow Modification of CreateParams...
00987   if(!PreCreateWindow(cs))
00988     return FALSE;
00989
00990   //Setup MDICREATESTRUCT for real create
00991   MDICREATESTRUCTA mcs;
00992   mcs.szClass   = szClassName;
00993   mcs.szTitle   = szWindowName;
00994   mcs.hOwner    = cs.hInstance;
00995   mcs.x     = cs.x;
00996   mcs.y     = cs.y;
00997   mcs.cx      = cs.cx;
00998   mcs.cy      = cs.cy;
00999   mcs.style   = cs.style;
01000   mcs.lParam    = (LPARAM)this;
01001
01002   //Copy the Class Name
01003   SAFE_FREE(m_pwszClassName);
01004   m_pwszClassName = wcsDuplicate(pwszClassName);
01005
01006   //Create the window through the MDICLIENT window
01007   m_hWnd = (HWND)::SendMessage(hWndMDIClient, WM_MDICREATE, 0, (LPARAM)&mcs);
01008
01009   //Assoicate this window with this class
01010   if(m_hWnd)
01011   {
01012     SetThis(m_hWnd, this);
01013     OnInitialUpdate();
01014   }
01015
01016   return m_hWnd != NULL;
01017 }
01018
01019
01020 /////////////////////////////////////////////////////////////////////
01021 // CMDIChildLite::HandleMessage
01022 //
01023 /////////////////////////////////////////////////////////////////////
01024 BOOL CMDIChildLite::HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
01025 {
01026   switch(msg)
01027   {
01028     case WM_MDIACTIVATE:
01029       return OnMDIActivate(lParam ? TRUE : FALSE, (HWND)lParam, (HWND)wParam);
01030   }
01031
01032   //Otherwise delegate
01033   return CWndLite::HandleMessage(hWnd, msg, wParam, lParam);
01034 }
01035
01036
01037 /////////////////////////////////////////////////////////////////////
01038 // CMDIChildLite::OnMDIActivate
01039 //
01040 /////////////////////////////////////////////////////////////////////
01041 BOOL CMDIChildLite::OnMDIActivate(BOOL bActivate, HWND hWndActivate, HWND hWndDeactivate)
01042 {
01043   return FALSE;
01044 }
01045
01046
01047 /////////////////////////////////////////////////////////////////////
01048 // CMDIChildLite::AutoPosition
01049 //
01050 /////////////////////////////////////////////////////////////////////
01051 BOOL CMDIChildLite::AutoPosition(BOOL fDefaultPosition)
01052 {
01053   return FALSE;
01054 }
01055
01056
01057 /////////////////////////////////////////////////////////////////////
01058 // CMDIChildLite::UnhandledMessage
01059 //
01060 /////////////////////////////////////////////////////////////////////
01061 LRESULT CMDIChildLite::UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
01062 {
01063   return DefMDIChildProc(hWnd, msg, wParam, lParam);
01064 }
01065
01066
01067 /////////////////////////////////////////////////////////////////////
01068 // CMDIChildLite::MDIWndProc
01069 //
01070 /////////////////////////////////////////////////////////////////////
01071 LRESULT WINAPI CMDIChildLite::MDIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
01072 {
01073   switch(msg)
01074   {
01075     case WM_CREATE:
01076         {
01077       //Save the Window Handle
01078       CREATESTRUCT* pCS = (CREATESTRUCT*)lParam;
01079       MDICREATESTRUCT* pMDICS = (MDICREATESTRUCT*)pCS->lpCreateParams;
01080       CMDIChildLite* pCMDIChildLite = (CMDIChildLite*)pMDICS->lParam;
01081
01082       //Save the "this" pointer
01083       SetThis(hWnd, pCMDIChildLite);
01084
01085       //NOTE:  Inside CMDIChildLite::Create it has to call SendMessage
01086       //with MDICREATE inorder to create the window.  The problem is that
01087       //the window handle is returned from the message, and user code
01088       //within OnCreate may need the window handle to setup controls...
01089       pCMDIChildLite->m_hWnd = hWnd;
01090       if(pCMDIChildLite->OnCreate(pCS))
01091         return 0;
01092       return -1;
01093     }
01094   };
01095
01096   //Otherwise just pass on message to original control
01097   return WndProc(hWnd, msg, wParam, lParam);
01098 }
01099
01100
01101
01102
01103 /////////////////////////////////////////////////////////////////////
01104 // CFrameWndLite::CFrameWndLite
01105 //
01106 /////////////////////////////////////////////////////////////////////
01107 CFrameWndLite::CFrameWndLite()
01108 {
01109 }
01110
01111
01112 /////////////////////////////////////////////////////////////////////
01113 // CFrameWndLite::~CFrameWndLite
01114 //
01115 /////////////////////////////////////////////////////////////////////
01116 CFrameWndLite::~CFrameWndLite()
01117 {
01118 }
01119
01120
01121 /////////////////////////////////////////////////////////////////////
01122 // CFrameWndLite::Create
01123 //
01124 /////////////////////////////////////////////////////////////////////
01125 BOOL CFrameWndLite::Create(HWND hWndParent, WCHAR* pwszClassName,
01126             WCHAR* pwszWindowName, UINT uID, HICON hIcon,
01127             DWORD dwStyle, DWORD dwExStyle,
01128             int x, int y, int cx, int cy)
01129 {
01130   HINSTANCE hInstance = GetAppLite()->m_hInstance;
01131   DWORD dwResult = 0;
01132 /*
01133   //TODO:
01134   //Left in for the truely UNICODE port
01135
01136    if(IsUnicodeOS() && 0)
01137   {
01138     //Setup the Structure
01139     WNDCLASSEXW wc;
01140     wc.cbSize     = sizeof(WNDCLASSEXW);
01141     wc.style      = 0;
01142     wc.lpfnWndProc    = WndProc;
01143     wc.cbClsExtra   = 0;
01144     wc.cbWndExtra   = 0;
01145     wc.hInstance    = hInstance;
01146     wc.hIcon      = hIcon;
01147     wc.hCursor      = LoadCursorW(NULL, (LPWSTR)IDC_ARROW);
01148     wc.hbrBackground  = (HBRUSH)(COLOR_APPWORKSPACE+1);
01149     wc.lpszMenuName   = MAKEINTRESOURCEW(uID);
01150     wc.lpszClassName  = pwszClassName;
01151     wc.hIconSm      = hIcon;
01152
01153     //Register the window class
01154     dwResult = RegisterClassExW(&wc);
01155   }
01156   else
01157   {
01158 */    CHAR szClassName[MAX_NAME_LEN];
01159     ConvertToMBCS(pwszClassName, szClassName, MAX_NAME_LEN);
01160
01161     //Setup the Structure
01162     WNDCLASSEXA wc;
01163     wc.cbSize     = sizeof(WNDCLASSEXA);
01164     wc.style      = 0;
01165     wc.lpfnWndProc    = WndProc;
01166     wc.cbClsExtra   = 0;
01167     wc.cbWndExtra   = 0;
01168     wc.hInstance    = hInstance;
01169     wc.hIcon      = hIcon;
01170     wc.hCursor      = LoadCursorA(NULL, (LPSTR)IDC_ARROW);
01171     wc.hbrBackground  = (HBRUSH)(COLOR_APPWORKSPACE+1);
01172     wc.lpszMenuName   = MAKEINTRESOURCEA(uID);
01173     wc.lpszClassName  = szClassName;
01174     wc.hIconSm      = hIcon;
01175
01176     //Register the window class
01177     dwResult = RegisterClassExA(&wc);
01178 /*  }
01179 */
01180   //Now actually Create the Window
01181   if(dwResult)
01182   {
01183     //Delegate
01184     CWndLite::Create(hWndParent, pwszClassName, pwszWindowName, NULL,
01185             dwStyle, dwExStyle, x, y, cx, cy);
01186   }
01187
01188   return m_hWnd != NULL;
01189 }
01190
01191
01192 /////////////////////////////////////////////////////////////////////
01193 // CFrameWndLite::PreTranslateMessage
01194 //
01195 /////////////////////////////////////////////////////////////////////
01196 BOOL  CFrameWndLite::PreTranslateMessage(MSG* pmsg)
01197 {
01198   return FALSE;
01199 }
01200
01201
01202 /////////////////////////////////////////////////////////////////////
01203 // CFrameWndLite::OnNotify
01204 //
01205 /////////////////////////////////////////////////////////////////////
01206 BOOL CFrameWndLite::OnNotify(INT idCtrl, NMHDR* pNMHDR)
01207 {
01208   //The ToolBar and Menu always send the message to the FrameWindow, and we need
01209   //to delegate the message to our the child windows...
01210   switch(pNMHDR->code)
01211   {
01212     ON_COMMAND(TTN_NEEDTEXT, OnToolTip(idCtrl, pNMHDR));
01213   };
01214
01215   //Delegate
01216   return CWndLite::OnNotify(idCtrl, pNMHDR);
01217 }
01218
01219
01220 /////////////////////////////////////////////////////////////////////
01221 // CFrameWndLite::OnToolTip
01222 //
01223 /////////////////////////////////////////////////////////////////////
01224 void CFrameWndLite::OnToolTip(INT idCtrl, NMHDR* pNMHDR)
01225 {
01226   // Display the ToolTip text.
01227   LPTOOLTIPTEXTA lpToolTipText = (LPTOOLTIPTEXTA)pNMHDR;
01228
01229   //Load the ToolTip string from the resource...
01230   static CHAR szBuffer[MAX_NAME_LEN];
01231   LoadStringA(GetAppLite()->m_hInstance, (UINT)lpToolTipText->hdr.idFrom, szBuffer, MAX_NAME_LEN);
01232   lpToolTipText->lpszText = szBuffer;
01233 }
01234
01235
01236 /////////////////////////////////////////////////////////////////////
01237 // CFrameWndLite::OnClose
01238 //
01239 /////////////////////////////////////////////////////////////////////
01240 BOOL CFrameWndLite::OnClose()
01241 {
01242   return DestroyWindow();
01243 }
01244
01245
01246 /////////////////////////////////////////////////////////////////////
01247 // CFrameWndLite::OnDestroy
01248 //
01249 /////////////////////////////////////////////////////////////////////
01250 BOOL CFrameWndLite::OnDestroy()
01251 {
01252   PostQuitMessage(0);
01253
01254   //Delegate
01255   return CWndLite::OnDestroy();
01256 }
01257
01258
01259 /////////////////////////////////////////////////////////////////////
01260 // CMDIFrameLite::CMDIFrameLite
01261 //
01262 /////////////////////////////////////////////////////////////////////
01263 CMDIFrameLite::CMDIFrameLite()
01264 {
01265   m_hWndMDIClient = NULL;
01266 }
01267
01268
01269 /////////////////////////////////////////////////////////////////////
01270 // CMDIFrameLite::~CMDIFrameLite
01271 //
01272 /////////////////////////////////////////////////////////////////////
01273 CMDIFrameLite::~CMDIFrameLite()
01274 {
01275 }
01276
01277
01278 /////////////////////////////////////////////////////////////////////
01279 // CMDIFrameLite::UnhandledMessage
01280 //
01281 /////////////////////////////////////////////////////////////////////
01282 LRESULT CMDIFrameLite::UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
01283 {
01284   //Need to pass unhandled messges to the MDI client...
01285   return DefFrameProc(hWnd, m_hWndMDIClient, msg, wParam, lParam);
01286 }
01287
01288
01289 /////////////////////////////////////////////////////////////////////
01290 // CMDIFrameLite::OnCreate
01291 //
01292 /////////////////////////////////////////////////////////////////////
01293 BOOL CMDIFrameLite::OnCreate(CREATESTRUCT* pCREATESTRUCT)
01294 {
01295   //Delegate
01296   if(CFrameWndLite::OnCreate(pCREATESTRUCT))
01297   {
01298     //Now Create the MDI Client...
01299     return OnCreateClient(pCREATESTRUCT);
01300   }
01301
01302   return FALSE;
01303 }
01304
01305
01306 /////////////////////////////////////////////////////////////////////
01307 // CMDIFrameLite::OnDestroy
01308 //
01309 /////////////////////////////////////////////////////////////////////
01310 BOOL CMDIFrameLite::OnDestroy()
01311 {
01312   //Remove window items...
01313   m_hWndMDIClient = NULL;
01314
01315   //Delegate
01316   return CFrameWndLite::OnDestroy();
01317 }
01318
01319
01320 /////////////////////////////////////////////////////////////////////
01321 // CMDIFrameLite::OnCreateClient
01322 //
01323 /////////////////////////////////////////////////////////////////////
01324 BOOL CMDIFrameLite::OnCreateClient(CREATESTRUCT* pCREATESTRUCT)
01325 {
01326   DWORD dwStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | /*WS_VSCROLL | WS_HSCROLL |*/ WS_VISIBLE | CS_DBLCLKS;
01327   DWORD dwExStyle = WS_EX_CLIENTEDGE;
01328
01329   //Now Setup MDI CreateStruct
01330   CLIENTCREATESTRUCT  ccs;
01331   ccs.hWindowMenu   = NULL;//GetSubMenu(GetMenu(m_hWnd), 9/*IDMENU_WINDOW*/);//TODO     //TODO
01332   ccs.idFirstChild  = IDC_MDICHILD;
01333
01334   //Now we need to Create the MDI Client Window...
01335   m_hWndMDIClient = CreateWindowExA(dwExStyle, "MDICLIENT", NULL, dwStyle,
01336       CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
01337       m_hWnd, (HMENU)ID_MDICLIENT, GetAppLite()->m_hInstance, (LPSTR)&ccs);
01338
01339   return m_hWndMDIClient != NULL;
01340 }
01341
01342
01343 /////////////////////////////////////////////////////////////////////
01344 // CMDIFrameLite::OnCommandNotify
01345 //
01346 /////////////////////////////////////////////////////////////////////
01347 BOOL CMDIFrameLite::OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl)
01348 {
01349   CWndLite* pCWndLite = GetActiveWindow();
01350   if(pCWndLite)
01351     if(pCWndLite->OnCommandNotify(wNotifyCode, iID, hWndCtrl))
01352       return TRUE;
01353
01354   return FALSE;
01355 }
01356
01357
01358 /////////////////////////////////////////////////////////////////////
01359 // CMDIFrameLite::OnCommand
01360 //
01361 /////////////////////////////////////////////////////////////////////
01362 BOOL CMDIFrameLite::OnCommand(UINT iID, HWND hWndCtrl)
01363 {
01364   CWndLite* pCWndLite = GetActiveWindow();
01365   if(pCWndLite)
01366     if(pCWndLite->OnCommand(iID, hWndCtrl))
01367       return TRUE;
01368
01369   return FALSE;
01370 }
01371
01372
01373 /////////////////////////////////////////////////////////////////////
01374 // CMDIFrameLite::OnUpdateCommand
01375 //
01376 /////////////////////////////////////////////////////////////////////
01377 BOOL CMDIFrameLite::OnUpdateCommand(HMENU hMenu, UINT nID, DWORD* pdwFlags)
01378 {
01379   CWndLite* pCWndLite = GetActiveWindow();
01380   if(pCWndLite)
01381     if(pCWndLite->OnUpdateCommand(hMenu, nID, pdwFlags))
01382       return TRUE;
01383
01384   return FALSE;
01385 }
01386
01387
01388 /////////////////////////////////////////////////////////////////////
01389 // CMDIFrameLite::OnNotify
01390 //
01391 /////////////////////////////////////////////////////////////////////
01392 BOOL CMDIFrameLite::OnNotify(INT idCtrl, NMHDR* pNMHDR)
01393 {
01394   CWndLite* pCWndLite = GetActiveWindow();
01395   if(pCWndLite)
01396     if(pCWndLite->OnNotify(idCtrl, pNMHDR))
01397       return TRUE;
01398
01399   //Delegate
01400   return CFrameWndLite::OnNotify(idCtrl, pNMHDR);
01401 }
01402
01403
01404 /////////////////////////////////////////////////////////////////////
01405 // CMDIFrameLite::PreTranslateMessage
01406 //
01407 /////////////////////////////////////////////////////////////////////
01408 BOOL  CMDIFrameLite::PreTranslateMessage(MSG* pmsg)
01409 {
01410   //Check for MDI accelerators
01411   return m_hWndMDIClient && TranslateMDISysAccel(m_hWndMDIClient, pmsg);
01412 }
01413
01414
01415 /////////////////////////////////////////////////////////////////////
01416 // CMDIFrameLite::GetActiveWindow
01417 //
01418 /////////////////////////////////////////////////////////////////////
01419 CMDIChildLite* CMDIFrameLite::GetActiveWindow(WCHAR* pwszClassName)
01420 {
01421   ASSERT(m_hWndMDIClient);
01422
01423   //Obtain the first Active Child Window...
01424   HWND hWndChild = GetWindow(m_hWndMDIClient, GW_CHILD);
01425   if(hWndChild)
01426   {
01427     //Return the first child of the specified type...
01428     CMDIChildLite* pCMDIChildLite = (CMDIChildLite*)GetThis(hWndChild);
01429     if(pCMDIChildLite)
01430     {
01431       if(pwszClassName)
01432       {
01433         if(StringCompare(pwszClassName, pCMDIChildLite->m_pwszClassName))
01434           return pCMDIChildLite;
01435       }
01436       else
01437       {
01438         return pCMDIChildLite;
01439       }
01440     }
01441   }
01442
01443   return NULL;
01444 }
01445
01446
01447 /////////////////////////////////////////////////////////////////////
01448 // CMDIFrameLite::FindWindow
01449 //
01450 /////////////////////////////////////////////////////////////////////
01451 CMDIChildLite* CMDIFrameLite::FindWindow(WCHAR* pwszClassName)
01452 {
01453   ASSERT(pwszClassName);
01454
01455   //Obtain the first Active Child Window...
01456   HWND hWndChild = GetWindow(m_hWndMDIClient, GW_CHILD);
01457   while(hWndChild)
01458   {
01459     CMDIChildLite* pCMDIChildLite = (CMDIChildLite*)GetThis(hWndChild);
01460     if(pCMDIChildLite)
01461     {
01462       //Return the first child of the specified type...
01463       if(StringCompare(pCMDIChildLite->m_pwszClassName, pwszClassName))
01464         return pCMDIChildLite;
01465     }
01466
01467     //Get the Next Window
01468     hWndChild = GetWindow(hWndChild, GW_HWNDNEXT);
01469   }
01470
01471   return NULL;
01472 }
01473
01474
01475 /////////////////////////////////////////////////////////////////////////////
01476 // CMDIFrameLite::OnAutoPosition
01477 //
01478 /////////////////////////////////////////////////////////////////////////////
01479 void CMDIFrameLite::OnAutoPosition()
01480 {
01481   //Auto Position all children...
01482   HWND hWndChild = GetWindow(m_hWndMDIClient, GW_CHILD);
01483   while(hWndChild)
01484   {
01485     CMDIChildLite* pCMDIChildLite = (CMDIChildLite*)GetThis(hWndChild);
01486     if(pCMDIChildLite)
01487       pCMDIChildLite->AutoPosition();
01488
01489     //Get the Next Window
01490     hWndChild = GetWindow(hWndChild, GW_HWNDNEXT);
01491   }
01492 }
01493
01494
01495
01496 /////////////////////////////////////////////////////////////////////
01497 // CDialogLite::CDialogLite
01498 //
01499 /////////////////////////////////////////////////////////////////////
01500 CDialogLite::CDialogLite(UINT uIDD)
01501 {
01502   m_uIDD    = uIDD;
01503   m_fModal  = TRUE;
01504 }
01505
01506
01507 /////////////////////////////////////////////////////////////////////
01508 // CDialogLite::~CDialogLite
01509 //
01510 /////////////////////////////////////////////////////////////////////
01511 CDialogLite::~CDialogLite()
01512 {
01513 }
01514
01515
01516 /////////////////////////////////////////////////////////////////////
01517 // CDialogLite::OnInitDialog
01518 //
01519 /////////////////////////////////////////////////////////////////////
01520 BOOL CDialogLite::OnInitDialog()
01521 {
01522   return TRUE;
01523 }
01524
01525
01526 /////////////////////////////////////////////////////////////////////
01527 // CDialogLite::OnActivate
01528 //
01529 /////////////////////////////////////////////////////////////////////
01530 BOOL CDialogLite::OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious)
01531 {
01532   if(!m_fModal)
01533     CAppLite::m_hWndModeless = fActive ? m_hWnd : NULL;
01534
01535   return FALSE;
01536 }
01537
01538
01539 /////////////////////////////////////////////////////////////////////
01540 // CDialogLite::OnOK
01541 //
01542 /////////////////////////////////////////////////////////////////////
01543 BOOL CDialogLite::OnOK()
01544 {
01545   EndDialog(IDOK);
01546   return TRUE;
01547 }
01548
01549 /////////////////////////////////////////////////////////////////////
01550 // CDialogLite::OnCancel
01551 //
01552 /////////////////////////////////////////////////////////////////////
01553 BOOL CDialogLite::OnCancel()
01554 {
01555   EndDialog(IDCANCEL);
01556   return TRUE;
01557 }
01558
01559
01560 /////////////////////////////////////////////////////////////////////
01561 // CDialogLite::DoModal
01562 //
01563 /////////////////////////////////////////////////////////////////////
01564 LRESULT CDialogLite::DoModal(HWND hWndParent)
01565 {
01566   //Modal Dialog Box
01567   m_hWndParent  = hWndParent;
01568   m_fModal    = TRUE;
01569   return DisplayDialog(m_uIDD, m_hWndParent, DlgProc, (LPARAM)this);
01570 }
01571
01572
01573 /////////////////////////////////////////////////////////////////////
01574 // CDialogLite::CreateDlg
01575 //
01576 /////////////////////////////////////////////////////////////////////
01577 HWND CDialogLite::CreateDlg(HWND hWndParent)
01578 {
01579   //Modeless (non-Modal) Dialog Box
01580   m_hWndParent  = hWndParent;
01581   m_fModal    = FALSE;
01582   return CreateDialogParam(GetAppLite()->m_hInstance, MAKEINTRESOURCE(m_uIDD), m_hWndParent, DlgProc, (LPARAM)this);
01583 }
01584
01585
01586 /////////////////////////////////////////////////////////////////////
01587 // CDialogLite::EndDialog
01588 //
01589 /////////////////////////////////////////////////////////////////////
01590 void CDialogLite::EndDialog(int nResult)
01591 {
01592 	::EndDialog(m_hWnd, nResult);
01593 }
01594
01595
01596 /////////////////////////////////////////////////////////////////////
01597 // CDialogLite::HandleMessage
01598 //
01599 /////////////////////////////////////////////////////////////////////
01600 BOOL CDialogLite::HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
01601 {
01602   switch(msg)
01603   {
01604     case WM_COMMAND:
01605     {
01606       UINT wNotifyCode  = HIWORD(wParam); // notification code
01607       UINT iID      = LOWORD(wParam); // item, control, or accelerator identifier
01608       HWND hWndCtrl   = (HWND)lParam;   // handle of control
01609
01610       //Filter out any Control Notification codes
01611       //  wNotifyCode   - Specifies the notification code if the message is from a control. If the message is from an accelerator, this parameter is 1. If the message is from a menu, this parameter is 0.
01612       //  wID       - Specifies the identifier of the menu item, control, or accelerator.
01613       //  hwndCtl     - Identifies the control sending the message if the message is from a control. Otherwise, this parameter is NULL.
01614       if(hWndCtrl && wNotifyCode)
01615         return OnCommandNotify(wNotifyCode, iID, hWndCtrl);
01616
01617       //We are only interested in the following
01618       switch(iID)
01619       {
01620         case IDOK:
01621           return OnOK();
01622
01623         case IDCANCEL:
01624           return OnCancel();
01625       };
01626       break;
01627     }
01628   };
01629
01630   //Otherwise pass onto our main window handler
01631   return CWndLite::HandleMessage(hWnd, msg, wParam, lParam);
01632 }
01633
01634
01635 /////////////////////////////////////////////////////////////////////
01636 // CDialogLite::DlgProc
01637 //
01638 /////////////////////////////////////////////////////////////////////
01639 INT_PTR WINAPI CDialogLite::DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
01640 {
01641   CDialogLite* pCDialogLite = (CDialogLite*)GetThis(hWnd);
01642
01643   switch (msg)
01644   {
01645     case WM_INITDIALOG:
01646     {
01647       //Save the Window Handle
01648       pCDialogLite = (CDialogLite*)lParam;
01649       pCDialogLite->m_hWnd = hWnd;
01650
01651       //Save the "this" pointer
01652       SetThis(hWnd, pCDialogLite);
01653       return pCDialogLite->OnInitDialog();
01654     }
01655   };
01656
01657   if(pCDialogLite)
01658     return pCDialogLite->HandleMessage(hWnd, msg, wParam, lParam);
01659
01660   return FALSE;
01661 };
01662
01663
01664
01665
01666 /////////////////////////////////////////////////////////////////////
01667 // CSplitterLite::CSplitterLite
01668 //
01669 /////////////////////////////////////////////////////////////////////
01670 CSplitterLite::CSplitterLite(HWND hWndParent, UINT nID)
01671   : CWndLite(hWndParent, nID)
01672 {
01673   m_pCWndTop    = NULL;
01674   m_pCWndBottom = NULL;
01675   m_pCWndLeft   = NULL;
01676   m_pCWndRight  = NULL;
01677
01678   m_hCursorOld  = NULL;
01679   m_hCursorTop  = NULL;
01680   m_hCursorRight  = NULL;
01681
01682   m_iBorderCX   = 0;
01683   m_iBorderCY   = 0;
01684 }
01685
01686
01687 /////////////////////////////////////////////////////////////////////
01688 // CSplitterLite::SetSplitter
01689 //
01690 /////////////////////////////////////////////////////////////////////
01691 BOOL CSplitterLite::SetSplitter(CSplitterLite* pCWndTop, CSplitterLite* pCWndBottom, CSplitterLite* pCWndLeft, CSplitterLite* pCWndRight)
01692 {
01693   m_pCWndTop    = pCWndTop;
01694   m_pCWndBottom = pCWndBottom;
01695   m_pCWndLeft   = pCWndLeft;
01696   m_pCWndRight  = pCWndRight;
01697
01698   //Load the appropiate cursor
01699   m_hCursorOld  = NULL;
01700   m_hCursorTop  = LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS));
01701   m_hCursorRight  = LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE));
01702
01703   m_iBorderCX   = GetSystemMetrics(SM_CXFIXEDFRAME);
01704   m_iBorderCY   = GetSystemMetrics(SM_CYFIXEDFRAME);
01705   return TRUE;
01706 }
01707
01708
01709 /////////////////////////////////////////////////////////////////////
01710 // CSplitterLite::OnBorder
01711 //
01712 /////////////////////////////////////////////////////////////////////
01713 BOOL CSplitterLite::OnBorder(REFPOINTS pts, INT iBorder)
01714 {
01715   RECT rect;
01716   GetWindowRect(m_hWnd, &rect);
01717
01718   switch(iBorder)
01719   {
01720     case HTLEFT:
01721       return pts.x <= (rect.left + m_iBorderCX);
01722
01723     case HTRIGHT:
01724       return pts.x >= (rect.right - m_iBorderCX);
01725
01726     case HTTOP:
01727       return pts.y <= (rect.top + m_iBorderCY);
01728
01729     case HTBOTTOM:
01730       return pts.y >= (rect.bottom - m_iBorderCY);
01731   };
01732
01733   return FALSE;
01734 }
01735
01736
01737 /////////////////////////////////////////////////////////////////////
01738 // CSplitterLite::OnNCMouseMove
01739 //
01740 /////////////////////////////////////////////////////////////////////
01741 BOOL CSplitterLite::OnNCMouseMove(WPARAM nHittest, REFPOINTS pts)
01742 {
01743   //HitTest
01744   if(nHittest == HTBORDER)
01745   {
01746     //HTBOTTOM
01747     if(m_pCWndBottom && OnBorder(pts, HTBOTTOM))
01748     {
01749        if(m_pCWndBottom->m_pCWndTop)
01750          m_hCursorOld = SetCursor(m_hCursorTop);
01751     }
01752     //HTTOP
01753     else if(m_pCWndTop && OnBorder(pts, HTTOP))
01754     {
01755        if(m_pCWndTop->m_pCWndBottom)
01756          m_hCursorOld = SetCursor(m_hCursorTop);
01757     }
01758     //HTRIGHT
01759     else if(m_pCWndRight && OnBorder(pts, HTRIGHT))
01760     {
01761       if(m_pCWndRight->m_pCWndLeft)
01762         m_hCursorOld = SetCursor(m_hCursorRight);
01763     }
01764     //HTLEFT
01765     else if(m_pCWndLeft && OnBorder(pts, HTLEFT))
01766     {
01767        if(m_pCWndLeft->m_pCWndRight)
01768          m_hCursorOld = SetCursor(m_hCursorRight);
01769     }
01770   }
01771   else
01772   {
01773     //Restore the Cursor
01774     if(m_hCursorOld)
01775     {
01776       SetCursor(m_hCursorOld);
01777       m_hCursorOld = NULL;
01778     }
01779   }
01780
01781   return TRUE;
01782 }
01783
01784
01785 /////////////////////////////////////////////////////////////////////
01786 // CSplitterLite::OnNCButtonDown
01787 //
01788 /////////////////////////////////////////////////////////////////////
01789 BOOL CSplitterLite::OnNCButtonDown(WPARAM nHittest, REFPOINTS ptsScreen)
01790 {
01791   //WM_NCLBUTTONDOWN is in Screen Coordinates, relateive to the desktop.
01792
01793   if(nHittest == HTBORDER)
01794   {
01795     POINT pt;
01796
01797     //Is the Mouse on the Bottom Border?
01798     if(m_pCWndBottom && OnBorder(ptsScreen, HTBOTTOM))
01799     {
01800       //Create the "Bounding" Rectangle...
01801       RECT rectLeft = GetClientCoords(m_hWndParent, m_hWnd);
01802       RECT rectRight  = GetClientCoords(m_hWndParent, m_pCWndBottom->m_hWnd);
01803       BOOL fVertical  = FALSE;
01804
01805       //StartTracking...
01806       if(StartTracking(ptsScreen, rectLeft, rectRight, fVertical, &pt))
01807       {
01808         //MoveWindow is in Screen Coordinates.
01809         MoveWindow(m_hWnd, rectLeft.left, rectLeft.top, rectLeft.right-rectLeft.left, pt.y-rectLeft.top, FALSE);
01810         MoveWindow(m_pCWndBottom->m_hWnd, rectRight.left, pt.y, rectRight.right-rectRight.left, rectRight.bottom - pt.y, FALSE);
01811
01812         if(m_pCWndRight && m_pCWndRight->m_pCWndBottom)
01813         {
01814           HWND hWndRight  = m_pCWndRight->m_hWnd;
01815           rectRight   = GetClientCoords(m_hWndParent, hWndRight);
01816           MoveWindow(hWndRight, rectRight.left, rectRight.top, rectRight.right-rectRight.left, pt.y - rectRight.top, FALSE);
01817         }
01818
01819         if(m_pCWndBottom->m_pCWndRight && m_pCWndBottom->m_pCWndRight->m_pCWndTop)
01820         {
01821           HWND hWndRight  = m_pCWndBottom->m_pCWndRight->m_hWnd;
01822           rectRight   = GetClientCoords(m_hWndParent, hWndRight);
01823           MoveWindow(hWndRight, rectRight.left, pt.y, rectRight.right-rectRight.left, rectRight.bottom - pt.y, FALSE);
01824         }
01825
01826         //Now invalidate all windows
01827         InvalidateRect(m_hWndParent, NULL, FALSE);
01828         return TRUE;
01829       }
01830     }
01831
01832     //Is the Mouse on the Top Border?
01833     if(m_pCWndTop && OnBorder(ptsScreen, HTTOP))
01834     {
01835       //Create the "Bounding" Rectangle...
01836       RECT rectLeft = GetClientCoords(m_hWndParent, m_pCWndTop->m_hWnd);
01837       RECT rectRight  = GetClientCoords(m_hWndParent, m_hWnd);
01838       BOOL fVertical  = FALSE;
01839
01840       //StartTracking...
01841       if(StartTracking(ptsScreen, rectLeft, rectRight, fVertical, &pt))
01842       {
01843         //MoveWindow is in Screen Coordinates.
01844         MoveWindow(m_pCWndTop->m_hWnd, rectLeft.left, rectLeft.top, rectLeft.right-rectLeft.left, pt.y-rectLeft.top, FALSE);
01845         MoveWindow(m_hWnd, rectRight.left, pt.y, rectRight.right-rectRight.left, rectRight.bottom - pt.y, FALSE);
01846
01847         if(m_pCWndRight && m_pCWndRight->m_pCWndTop)
01848         {
01849           HWND hWndRight  = m_pCWndRight->m_hWnd;
01850           rectRight   = GetClientCoords(m_hWndParent, hWndRight);
01851           MoveWindow(hWndRight, rectRight.left, pt.y, rectRight.right-rectRight.left, rectRight.bottom - pt.y, FALSE);
01852         }
01853
01854         if(m_pCWndTop->m_pCWndRight && m_pCWndTop->m_pCWndRight->m_pCWndBottom)
01855         {
01856           HWND hWndRight  = m_pCWndTop->m_pCWndRight->m_hWnd;
01857           rectRight = GetClientCoords(m_hWndParent, hWndRight);
01858           MoveWindow(hWndRight, rectRight.left, rectRight.top, rectRight.right-rectRight.left, pt.y - rectRight.top, FALSE);
01859         }
01860
01861         //Now invalidate all windows
01862         InvalidateRect(m_hWndParent, NULL, FALSE);
01863         return TRUE;
01864       }
01865     }
01866
01867     //Is the Mouse on the Left Border?
01868     if(m_pCWndLeft && OnBorder(ptsScreen, HTLEFT))
01869     {
01870       //Create the "Bounding" Rectangle...
01871       RECT rectLeft = GetClientCoords(m_hWndParent, m_pCWndLeft->m_hWnd);
01872       RECT rectRight  = GetClientCoords(m_hWndParent, m_hWnd);
01873       BOOL fVertical  = TRUE;
01874
01875       //StartTracking...
01876       if(StartTracking(ptsScreen, rectLeft, rectRight, fVertical, &pt))
01877       {
01878         //MoveWindow is in Screen Coordinates.
01879         MoveWindow(m_pCWndLeft->m_hWnd, rectLeft.left, rectLeft.top, pt.x - rectLeft.left, rectLeft.bottom - rectLeft.top, FALSE);
01880         MoveWindow(m_hWnd, pt.x, rectRight.top, rectRight.right-pt.x, rectRight.bottom - rectRight.top, FALSE);
01881
01882         if(m_pCWndLeft->m_pCWndBottom)
01883         {
01884           HWND hWndBottom = m_pCWndLeft->m_pCWndBottom->m_hWnd;
01885           RECT rectBottom = GetClientCoords(m_hWndParent, hWndBottom);
01886           MoveWindow(hWndBottom, rectBottom.left, rectBottom.top, pt.x-rectBottom.left, rectBottom.bottom-rectBottom.top, FALSE);
01887         }
01888
01889         //Now invalidate all windows
01890         InvalidateRect(m_hWndParent, NULL, FALSE);
01891         return TRUE;
01892       }
01893     }
01894
01895     //Is the Mouse on the Right Border?
01896     if(m_pCWndRight && OnBorder(ptsScreen, HTRIGHT) && m_pCWndRight->m_pCWndLeft)
01897     {
01898       //Create the "Bounding" Rectangle...
01899       RECT rectLeft = GetClientCoords(m_hWndParent, m_hWnd);
01900       RECT rectRight  = GetClientCoords(m_hWndParent, m_pCWndRight->m_hWnd);
01901       BOOL fVertical  = TRUE;
01902
01903       //StartTracking...
01904       if(StartTracking(ptsScreen, rectLeft, rectRight, fVertical, &pt))
01905       {
01906         //MoveWindow is in Screen Coordinates.
01907         MoveWindow(m_hWnd, rectLeft.left, rectLeft.top, pt.x - rectLeft.left, rectLeft.bottom - rectLeft.top, FALSE);
01908         MoveWindow(m_pCWndRight->m_hWnd, pt.x, rectRight.top, rectRight.right-pt.x, rectRight.bottom - rectRight.top, FALSE);
01909
01910         if(m_pCWndTop)
01911         {
01912           HWND hWndTop = m_pCWndTop->m_hWnd;
01913           RECT rectTop = GetClientCoords(m_hWndParent, hWndTop);
01914           MoveWindow(hWndTop, rectTop.left, rectTop.top, pt.x-rectTop.left, rectTop.bottom-rectTop.top, FALSE);
01915         }
01916
01917         if(m_pCWndBottom)
01918         {
01919           HWND hWndBottom = m_pCWndBottom->m_hWnd;
01920           RECT rectBottom = GetClientCoords(m_hWndParent, hWndBottom);
01921           MoveWindow(hWndBottom, rectBottom.left, rectBottom.top, pt.x-rectBottom.left, rectBottom.bottom-rectBottom.top, FALSE);
01922         }
01923
01924         //Now invalidate all windows
01925         InvalidateRect(m_hWndParent, NULL, FALSE);
01926         return TRUE;
01927       }
01928     }
01929   }
01930
01931   return FALSE;
01932 }
01933
01934
01935 /////////////////////////////////////////////////////////////////////
01936 // CSplitterLite::DrawSplitter
01937 //
01938 /////////////////////////////////////////////////////////////////////
01939 BOOL CSplitterLite::DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient)
01940 {
01941   if(fVertical)
01942   {
01943     //Vertical Splitter
01944     //PatBlt - in Client Coordinates
01945     DWORD dwTop   = min(rectLeft.top, rectRight.top);
01946     DWORD dwHeight  = max(rectLeft.bottom, rectRight.bottom) - dwTop;
01947     PatBlt(hDC, ptsClient.x, dwTop, m_iBorderCX, dwHeight, DSTINVERT);
01948   }
01949   else
01950   {
01951     //Horizontal Splitter
01952     //PatBlt - in Client Coordinates
01953     DWORD dwLeft  = min(rectLeft.left, rectRight.left);
01954     DWORD dwWidth = max(rectLeft.right, rectRight.right) - dwLeft;
01955     PatBlt(hDC, dwLeft, ptsClient.y, dwWidth, m_iBorderCY, DSTINVERT);
01956   }
01957   return TRUE;
01958 }
01959
01960
01961
01962 /////////////////////////////////////////////////////////////////////
01963 // CSplitterLite::StartTracking
01964 //
01965 /////////////////////////////////////////////////////////////////////
01966 BOOL CSplitterLite::StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT* pPoint)
01967 {
01968   ASSERT(pPoint);
01969   BOOL bTracking = TRUE;
01970   MSG msgModal;
01971
01972   //Capture mouse so Frame window gets mouse messages
01973   HDC hDC = GetDC(m_hWndParent);
01974   SetCapture(m_hWnd);
01975   m_hCursorOld = SetCursor(fVertical ? m_hCursorRight : m_hCursorTop);
01976   BOOL fWithinBounds = FALSE;
01977
01978   RECT rect;
01979   GetWindowRect(m_hWnd, &rect);
01980   POINT ptLocal = { rect.left, rect.top };
01981   ScreenToClient(m_hWndParent, &ptLocal);
01982
01983   //Convert Screen Coordinates to Client Coordinates...
01984   POINT ptClient = { ptsScreen.x, ptsScreen.y};
01985   ScreenToClient(m_hWndParent, &ptClient);
01986   POINTS ptsClient = { (SHORT)ptClient.x, (SHORT)ptClient.y };
01987
01988   //Draw splitter
01989   DrawSplitter(hDC, fVertical, rectLeft, rectRight, ptsClient);
01990
01991   //While the split-bar is being dragged
01992   while (bTracking)
01993   {
01994     //Get mouse message
01995     GetMessage(&msgModal, NULL, WM_MOUSEFIRST, WM_MOUSELAST);
01996     switch (msgModal.message)
01997     {
01998       case WM_MOUSEMOVE:
01999       {
02000         //WM_MOUSEMOVE is in Client Coordindates, relateive to the client window.
02001         SHORT px = LOWORD(msgModal.lParam);
02002         SHORT py = HIWORD(msgModal.lParam);
02003
02004         //Only redraw if different position than last time
02005         if((fVertical && px != ptsClient.x) ||
02006           (!fVertical && py != ptsClient.y))
02007         {
02008           //Draw splitter - erase previous
02009           DrawSplitter(hDC, fVertical, rectLeft, rectRight, ptsClient);
02010
02011           //Get new mouse positions
02012           ptsClient.x = (SHORT)ptLocal.x + px;
02013           ptsClient.y = (SHORT)ptLocal.y + py;
02014
02015           //Draw splitter - draw new
02016           DrawSplitter(hDC, fVertical, rectLeft, rectRight, ptsClient);
02017         }
02018         break;
02019       }
02020
02021       // End of split-bar drag
02022       case WM_LBUTTONUP:
02023       case WM_LBUTTONDOWN:
02024       case WM_LBUTTONDBLCLK:
02025       case WM_RBUTTONUP:
02026       case WM_RBUTTONDOWN:
02027       case WM_RBUTTONDBLCLK:
02028       {
02029         //WM_LBUTTONUP is in Client Coordindates, relateive to the client window.
02030         SHORT px = LOWORD(msgModal.lParam);
02031         SHORT py = HIWORD(msgModal.lParam);
02032
02033         //Draw splitter - erase previous
02034         DrawSplitter(hDC, fVertical, rectLeft, rectRight, ptsClient);
02035
02036         // Get new mouse positions
02037         ptsClient.x = (SHORT)ptLocal.x + px;
02038         ptsClient.y = (SHORT)ptLocal.y + py;
02039
02040         //We Now need to resize the Window
02041         //Only adjust windows if Mouse is within Max/Min Coords
02042         if(fVertical)
02043           fWithinBounds = (ptsClient.x > rectLeft.left && ptsClient.x < rectRight.right);
02044         else
02045           fWithinBounds = (ptsClient.y > rectLeft.top && ptsClient.y < rectRight.bottom);
02046
02047         bTracking = FALSE;  // Break out of tracking loop
02048         break;
02049       }
02050     }
02051   }
02052
02053   ReleaseCapture();
02054   SetCursor(m_hCursorOld);
02055   ReleaseDC(m_hWnd, hDC);
02056
02057   if(fWithinBounds)
02058   {
02059     pPoint->x = ptsClient.x;
02060     pPoint->y = ptsClient.y;
02061     return TRUE;
02062   }
02063
02064   return FALSE;
02065 }
02066
02067
02068 /////////////////////////////////////////////////////////////////////
02069 // CScrollBarLite::CScrollBarLite
02070 //
02071 /////////////////////////////////////////////////////////////////////
02072 CScrollBarLite::CScrollBarLite()
02073 {
02074 }
02075
02076
02077 /////////////////////////////////////////////////////////////////////
02078 // CScrollBarLite::~CScrollBarLite
02079 //
02080 /////////////////////////////////////////////////////////////////////
02081 CScrollBarLite::~CScrollBarLite()
02082 {
02083 }
02084
02085
02086
02087 ////////////////////////////////////////////////////////////////
02088 // CScrollBarLite::SetScroll
02089 //
02090 /////////////////////////////////////////////////////////////////
02091 INT CScrollBarLite::SetScroll(INT lPos, BOOL bRedraw)
02092 {
02093   //This function is a "superset" of the SetScrollPos, but it takes into
02094   //acount the caller may not know the boundary of the scrollbar, and adjusts...
02095
02096   //First obtain the scroll bar ranges...
02097   INT nMin, nMax;
02098   if(GetScrollRange(&nMin, &nMax))
02099   {
02100     lPos = min(lPos, nMax);
02101     lPos = max(lPos, nMin);
02102
02103     //Set the new range
02104     return SetScrollPos(lPos, bRedraw);
02105   }
02106
02107   return 0;
02108 }
02109
02110
02111 //////////////////////////////////////////////////////////////////
02112 // CScrollBarLite::SetScrollInfo
02113 //
02114 //////////////////////////////////////////////////////////////////
02115 INT CScrollBarLite::SetScrollInfo(INT iPos, INT iRangeSize, INT iPageSize, BOOL fRedraw)
02116 {
02117   SCROLLINFO ScrollInfo = { sizeof(SCROLLINFO), SIF_ALL, 0, iRangeSize, iPageSize, iPos, 0};
02118
02119   //SetScrollInfo
02120   return ::SetScrollInfo(m_hWnd, SB_CTL, &ScrollInfo, fRedraw);
02121 }
02122
02123
02124 //////////////////////////////////////////////////////////////////
02125 // CScrollBarLite::GetScrollInfo
02126 //
02127 //////////////////////////////////////////////////////////////////
02128 BOOL CScrollBarLite::GetScrollInfo(INT* piPos, INT* piRangeSize, INT* piPageSize)
02129 {
02130   INT iPos = 0;
02131   INT iRangeSize = 0;
02132   INT iPageSize = 0;
02133
02134   SCROLLINFO ScrollInfo = { sizeof(SCROLLINFO), SIF_ALL, 0, iRangeSize, iPageSize, iPos, 0};
02135
02136   //SetScrollInfo
02137   BOOL bResult = ::GetScrollInfo(m_hWnd, SB_CTL, &ScrollInfo);
02138
02139   //Fill in arguments
02140   if(piPos)
02141     *piPos = iPos;
02142   if(piRangeSize)
02143     *piRangeSize = iRangeSize;
02144   if(piPageSize)
02145     *piPageSize = iPageSize;
02146
02147   return bResult;
02148 }
02149
02150
02151
02152 /////////////////////////////////////////////////////////////////////
02153 // CEditBoxLite::CEditBoxLite
02154 //
02155 /////////////////////////////////////////////////////////////////////
02156 CEditBoxLite::CEditBoxLite(HWND hWndParent, UINT nID)
02157   : CSplitterLite(hWndParent, nID)
02158 {
02159 }
02160
02161
02162 /////////////////////////////////////////////////////////////////////
02163 // CEditBoxLite::~CEditBoxLite
02164 //
02165 /////////////////////////////////////////////////////////////////////
02166 CEditBoxLite::~CEditBoxLite()
02167 {
02168 }
02169
02170
02171 /////////////////////////////////////////////////////////////////////
02172 // CEditBoxLite::OnCreate
02173 //
02174 /////////////////////////////////////////////////////////////////////
02175 BOOL CEditBoxLite::OnCreate(CREATESTRUCT* pCREATESTRUCT)
02176 {
02177   //SubClass the window
02178   SubClassWindow(WndProc);
02179
02180   //Delegate
02181   return CSplitterLite::OnCreate(pCREATESTRUCT);
02182 }
02183
02184
02185 /////////////////////////////////////////////////////////////////////
02186 // CEditBoxLite::GetTextRange
02187 //
02188 /////////////////////////////////////////////////////////////////////
02189 INDEX CEditBoxLite::GetTextRange(CHARRANGE& cr, WCHAR* pwszBuffer)
02190 {
02191   //With EM_GETTEXTRANGE (Since their is not a W-unicode and A-ansi version), the message
02192   //is completly based upon how you created the window.  Since we currently only
02193   //call this from CreateIndirect (ANSI) we just assume this...
02194   if(m_bUnicodeMsg)
02195   {
02196     TEXTRANGEW tr;
02197     tr.chrg = cr;
02198     tr.lpstrText = pwszBuffer;
02199
02200     return (INDEX)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
02201   }
02202   else
02203   {
02204     CHAR szBuffer[MAX_QUERY_LEN] = {0};
02205
02206     TEXTRANGEA tr;
02207     tr.chrg = cr;
02208     tr.lpstrText = szBuffer;
02209
02210     INDEX lReturn = (INDEX)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
02211     ConvertToWCHAR(szBuffer, pwszBuffer, cr.cpMax - cr.cpMin);
02212     return lReturn;
02213   }
02214 }
02215
02216
02217 /////////////////////////////////////////////////////////////////////
02218 // CEditBoxLite::GetTextRange
02219 //
02220 /////////////////////////////////////////////////////////////////////
02221 INDEX CEditBoxLite::GetTextRange(CHARRANGE& cr, CHAR* pszBuffer)
02222 {
02223   //With EM_GETTEXTRANGE (Since their is not a W-unicode and A-ansi version), the message
02224   //is completly based upon how you created the window.  Since we currently only
02225   //call this from CreateIndirect (ANSI) we just assume this...
02226   if(m_bUnicodeMsg)
02227   {
02228     WCHAR wszBuffer[MAX_QUERY_LEN] = {0};
02229
02230     TEXTRANGEW tr;
02231     tr.chrg = cr;
02232     tr.lpstrText = wszBuffer;
02233
02234     INDEX lReturn = (INDEX)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
02235     ConvertToMBCS(wszBuffer, pszBuffer, cr.cpMax - cr.cpMin);
02236     return lReturn;
02237   }
02238   else
02239   {
02240     TEXTRANGEA tr;
02241     tr.chrg = cr;
02242     tr.lpstrText = pszBuffer;
02243
02244     return (INDEX)::SendMessage(m_hWnd, EM_GETTEXTRANGE, 0, (LPARAM)&tr);
02245   }
02246 }
02247
02248
02249 /////////////////////////////////////////////////////////////////////
02250 // CEditBoxLite::GetLine
02251 //
02252 /////////////////////////////////////////////////////////////////////
02253 INDEX CEditBoxLite::GetLine(INDEX iLine, CHAR* pszBuffer, ULONG ulMaxSize)
02254 {
02255   ASSERT(pszBuffer && ulMaxSize);
02256
02257   //Get the Text for this Line
02258   //EM_GETLINE assumes the first byte of the buffer
02259   //indicates the total size of the buffer
02260   ((WORD*)pszBuffer)[0] = (WORD)(ulMaxSize-1);
02261   INDEX iChars = (INDEX)SendMessage(m_hWnd, EM_GETLINE, iLine, (LPARAM)pszBuffer);
02262
02263   //Supposedly EM_GETLINE doesn't contain a NULL Terminator?!
02264   pszBuffer[min((ULONG)iChars, ulMaxSize)] = EOL;
02265   return iChars;
02266 }
02267
02268
02269 /////////////////////////////////////////////////////////////////////
02270 // CEditBoxLite::Save
02271 //
02272 /////////////////////////////////////////////////////////////////////
02273 BOOL CEditBoxLite::Save(LPCWSTR pwszFileName)
02274 {
02275   CFileLite cFile;
02276   CHAR szBuffer[MAX_QUERY_LEN];
02277
02278   //Open the file, (prompt if error)
02279   if(FAILED(cFile.Open(pwszFileName, GENERIC_WRITE, 0, CREATE_ALWAYS, TRUE)))
02280     return FALSE;
02281
02282   //Loop over all lines in the RichEdit control and write to the file...
02283   //Copy the contents of this ListBox to the destination...
02284   INDEX iCount = GetLineCount();
02285   for(INDEX i=0; i<iCount; i++)
02286   {
02287     //Get this line from the Control
02288     if(!GetLine(i, szBuffer, MAX_NAME_LEN))
02289       break;
02290
02291     //Blast it to the file...
02292     cFile.Write(szBuffer);
02293     cFile.Write(wWndEOL);
02294   }
02295
02296   return TRUE;
02297 }
02298
02299
02300 /////////////////////////////////////////////////////////////////////
02301 // CEditBoxLite::ReplaceSelAll
02302 //
02303 /////////////////////////////////////////////////////////////////////
02304 void CEditBoxLite::ReplaceAll(LPCWSTR pwszString, bool bReplaceAll, bool bHighlight)
02305 {
02306   if(pwszString)
02307   {
02308     INDEX iStartPos = 0;
02309     INDEX iStartPos2 = 0;
02310     INDEX iEndPos = 0;
02311     INDEX iEndPos2 = 0;
02312
02313     if(bReplaceAll)
02314     {
02315       //Replace the entire text?
02316       SetSel(0, -1);
02317     }
02318     else
02319     {
02320       //Obtain the Selected Text Start and End Positions
02321       GetSel(&iStartPos, &iEndPos);
02322     }
02323
02324     //Replace the Selection
02325     ReplaceSel(pwszString, TRUE/*fCanUndo*/);
02326
02327     //Make sure the replacement is visible...
02328     ScrollCaret();
02329
02330     if(bHighlight)
02331     {
02332       if(bReplaceAll)
02333       {
02334         //Highlight all the text...
02335         SetSel(0, -1);
02336       }
02337       else
02338       {
02339         //Highlight the text we used...
02340         GetSel(&iStartPos2, &iEndPos2);
02341         SetSel(iStartPos, iEndPos2);
02342       }
02343     }
02344   }
02345 }
02346
02347
02348
02349 /////////////////////////////////////////////////////////////////////
02350 // CXmlDOM::CXmlDOM
02351 //
02352 /////////////////////////////////////////////////////////////////////
02353 CXmlDOM::CXmlDOM()
02354 {
02355 }
02356
02357
02358 /////////////////////////////////////////////////////////////////////
02359 // CXmlDOM::~CXmlDOM
02360 //
02361 /////////////////////////////////////////////////////////////////////
02362 CXmlDOM::~CXmlDOM()
02363 {
02364 }
02365
02366
02367 /////////////////////////////////////////////////////////////////////
02368 // CXmlDOM::PrintNode
02369 //
02370 /////////////////////////////////////////////////////////////////////
02371 HRESULT CXmlDOM::PrintNode(IXMLDOMNode* spNode, CConsole& rConsole, ULONG ullevel)
02372 {
02373   HRESULT hr = S_OK;
02374   CComBSTR        bstrName;
02375   CComVariant       varValue;
02376
02377   CComPtr<IXMLDOMNamedNodeMap>  spAttrs;
02378   CComPtr<IXMLDOMNode>      spChild;
02379
02380   //Write out this node
02381   if(spNode)
02382   {
02383     //Output: Indentation Level
02384     for(ULONG i=0; i<ullevel; i++)
02385       rConsole << L"    ";
02386
02387     //Node Name
02388     TESTC(hr = spNode->get_nodeName(&bstrName));
02389
02390     //Node type
02391     DOMNodeType nodeType;
02392     TESTC(hr = spNode->get_nodeType(&nodeType));
02393
02394     //Node Value
02395     TESTC(hr = spNode->get_nodeValue(&varValue));
02396     varValue.ChangeType(VT_BSTR);
02397
02398     switch(nodeType)
02399     {
02400       case NODE_PROCESSING_INSTRUCTION:
02401         rConsole << RGB_BLUE << L"<?" << RGB_NONE;
02402         rConsole << RGB_BLUE  << bstrName << RGB_NONE;
02403
02404         //Output: Attributes
02405         PrintAttributes(spNode, rConsole);
02406
02407         //Output: >
02408         rConsole << RGB_BLUE << L" ?>" << RGB_NONE;
02409         rConsole.WriteLine();
02410         break;
02411
02412       case NODE_DOCUMENT_TYPE:
02413       {
02414         //<!DOCTYPE root (View Source for full doctype...)>
02415         rConsole << RGB_BLUE << L"<!DOCTYPE " << bstrName;
02416         rConsole << CA_ITALIC << L" (View Source for full doctype...)" << CA_NORMAL;
02417         rConsole.WriteLine();
02418         break;
02419       }
02420
02421       case NODE_TEXT:
02422         //This is the text of a node, not an element (ie: doesn't need tags)
02423         rConsole << CA_BOLD << V_BSTR(&varValue) << CA_NORMAL;
02424         rConsole.WriteLine();
02425         break;
02426
02427       default:
02428         ASSERT(!"Unhandled Node Type?");
02429         //FALL THROUGH TO DISPLAY UNKNOWN ELEMENT
02430
02431       case NODE_ELEMENT:
02432       case NODE_DOCUMENT:
02433         //Output: <ElementName
02434         rConsole << RGB_BLUE << L"<" << RGB_NONE;
02435         rConsole << RGB_DARK_RED  << bstrName << RGB_NONE;
02436
02437         //Output: Attributes
02438         PrintAttributes(spNode, rConsole);
02439
02440         //Output: Value
02441         rConsole << CA_BOLD << V_BSTR(&varValue) << CA_NORMAL;
02442
02443         //Output: >
02444         rConsole << RGB_BLUE << L">" << RGB_NONE;
02445         rConsole.WriteLine();
02446         break;
02447
02448     }
02449
02450     //Now recurse into any children...
02451     TESTC(hr = spNode->get_firstChild(&spChild));
02452     while(spChild)
02453     {
02454       CComPtr<IXMLDOMNode>  spNext;
02455
02456       //Recurse for all siblings...
02457       TESTC(hr = PrintNode(spChild, rConsole, ullevel+1));
02458       TESTC(hr = spChild->get_nextSibling(&spNext));
02459
02460       spChild.Attach(spNext);
02461       spNext.Detach();
02462     }
02463   }
02464
02465 CLEANUP:
02466   return hr;
02467 }
02468
02469
02470 /////////////////////////////////////////////////////////////////////
02471 // CXmlDOM::PrintAttributes
02472 //
02473 /////////////////////////////////////////////////////////////////////
02474 HRESULT CXmlDOM::PrintAttributes(IXMLDOMNode* spNode, CConsole& rConsole)
02475 {
02476   HRESULT hr = S_OK;
02477   CComBSTR        bstrName;
02478   CComVariant       varValue;
02479
02480   CComPtr<IXMLDOMNamedNodeMap>  spAttrs;
02481   CComPtr<IXMLDOMNode>      spChild;
02482
02483   //Write out the Attributes
02484   if(spNode)
02485   {
02486     //Write out all attributes
02487     TESTC(hr = spNode->get_attributes(&spAttrs));
02488     if(spAttrs)
02489     {
02490       TESTC(hr = spAttrs->nextNode(&spChild));
02491       while(spChild)
02492       {
02493         //Attribute name
02494         TESTC(hr = spChild->get_nodeName(&bstrName));
02495
02496         //Attribute Value
02497         TESTC(hr = spChild->get_nodeValue(&varValue));
02498         varValue.ChangeType(VT_BSTR);
02499
02500         //Node type
02501         DOMNodeType nodeType;
02502         TESTC(hr = spNode->get_nodeType(&nodeType));
02503
02504         switch(nodeType)
02505         {
02506           case NODE_PROCESSING_INSTRUCTION:
02507             //Output: AttributeName="
02508             rConsole << RGB_BLUE;
02509             rConsole << L" " << bstrName;
02510             rConsole << L"=\"";
02511
02512             //Output: AttributeValue
02513             rConsole << V_BSTR(&varValue);
02514
02515             //Output: "
02516             rConsole << L"\"" << RGB_NONE;
02517             break;
02518
02519
02520           default:
02521             ASSERT(!"Unhandled Node Type?");
02522             //FALL THROUGH TO DISPLAY UNKNOWN ELEMENT
02523
02524           case NODE_ELEMENT:
02525             //Output: AttributeName="
02526             rConsole << RGB_DARK_RED;
02527             rConsole << L" " << bstrName;
02528             rConsole << RGB_BLUE << L"=\"";
02529
02530             //Output: AttributeValue
02531             rConsole << RGB_NONE << CA_BOLD << V_BSTR(&varValue);
02532
02533             //Output: "
02534             rConsole << RGB_BLUE << CA_NORMAL << L"\"" << RGB_NONE;
02535             break;
02536         };
02537
02538         bstrName.Empty();
02539         varValue.Clear();
02540
02541         //Next Attribute
02542         spChild.Release();
02543         TESTC(hr = spAttrs->nextNode(&spChild));
02544       }
02545     }
02546   }
02547
02548 CLEANUP:
02549   return hr;
02550 }
02551
02552
02553 /////////////////////////////////////////////////////////////////////
02554 // CRichEditLite::CRichEditLite
02555 //
02556 /////////////////////////////////////////////////////////////////////
02557 CRichEditLite::CRichEditLite(HWND hWndParent, UINT nID)
02558   : CEditBoxLite(hWndParent, nID)
02559 {
02560 }
02561
02562
02563 /////////////////////////////////////////////////////////////////////
02564 // CRichEditLite::~CRichEditLite
02565 //
02566 /////////////////////////////////////////////////////////////////////
02567 CRichEditLite::~CRichEditLite()
02568 {
02569 }
02570
02571
02572 /////////////////////////////////////////////////////////////////////
02573 // CRichEditLite::OnCreate
02574 //
02575 /////////////////////////////////////////////////////////////////////
02576 BOOL CRichEditLite::OnCreate(CREATESTRUCT* pCREATESTRUCT)
02577 {
02578   //URL detection
02579   SendMessage(m_hWnd, EM_AUTOURLDETECT, TRUE, 0);
02580   SendMessage(m_hWnd, EM_SETEVENTMASK, 0, ENM_LINK);
02581
02582   //Delegate
02583   return CEditBoxLite::OnCreate(pCREATESTRUCT);
02584 }
02585
02586
02587 /////////////////////////////////////////////////////////////////////
02588 // CRichEditLite::SetWordWrap
02589 //
02590 /////////////////////////////////////////////////////////////////////
02591 BOOL CRichEditLite::SetWordWrap(BOOL fWordWrap)
02592 {
02593   //WordWrap
02594   // 0 - Wrap to window
02595   // 1 - Do not wrap lines
02596   return (BOOL)SendMessage(m_hWnd, EM_SETTARGETDEVICE, (WPARAM)NULL, fWordWrap ? 0 : 1);
02597 }
02598
02599
02600 /////////////////////////////////////////////////////////////////////
02601 // CRichEditLite::SetDefaultFont
02602 //
02603 /////////////////////////////////////////////////////////////////////
02604 LRESULT CRichEditLite::SetDefaultFont()
02605 {
02606   //Default Font
02607   //If you wise not to replace the font with this default, then just
02608   //set cbSize = 0 before calling ::Create.
02609   CHARFORMATW charFormat;
02610   memset(&charFormat, 0, sizeof(CHARFORMATW));
02611   charFormat.cbSize   = sizeof(CHARFORMATW);
02612   charFormat.dwMask   = CFM_SIZE | CFM_COLOR | CFM_FACE | CFM_OFFSET | CFM_CHARSET | CFM_LINK | CFM_PROTECTED | CFM_STRIKEOUT | CFM_UNDERLINE | CFM_ITALIC | CFM_BOLD;
02613   charFormat.dwEffects  = CFE_AUTOCOLOR;
02614   charFormat.yHeight    = 0x60;
02615   StringCopy(charFormat.szFaceName, L"MS Sans Serif", LF_FACESIZE);
02616
02617   //By default the font for RichEdit controls is HUGE!  By default we will replace
02618   //the font with the default for Edit Controls which is Sans-Serif size 8...
02619   if(charFormat.cbSize)
02620     return SetCharFormat(SCF_ALL, charFormat);
02621
02622   return 0;
02623 }
02624
02625
02626 /////////////////////////////////////////////////////////////////////
02627 // CRichEditLite::OnNotify
02628 //
02629 /////////////////////////////////////////////////////////////////////
02630 BOOL CRichEditLite::OnNotify(INT idCtrl, NMHDR* pNMHDR)
02631 {
02632   switch(pNMHDR->code)
02633   {
02634     ON_COMMAND(EN_LINK, OnLink(idCtrl, (ENLINK*)pNMHDR));
02635   };
02636
02637   //Delegate
02638   return CEditBoxLite::OnNotify(idCtrl, pNMHDR);
02639 }
02640
02641
02642 /////////////////////////////////////////////////////////////////////
02643 // CRichEditLite::OnLink
02644 //
02645 /////////////////////////////////////////////////////////////////////
02646 BOOL CRichEditLite::OnLink(INT idCtrl, ENLINK* pEnLink)
02647 {
02648   //Default Implementation of OnLink, of actually executing the link...
02649   if(pEnLink)
02650   {
02651     switch(pEnLink->msg)
02652     {
02653       case WM_LBUTTONDOWN:
02654       {
02655         //Obtain the link text.
02656         if(pEnLink->chrg.cpMax - pEnLink->chrg.cpMin <= MAX_QUERY_LEN)
02657         {
02658           CWaitCursor waitCursor;
02659           if(IsUnicodeOS())
02660           {
02661             WCHAR wszLink[MAX_QUERY_LEN] = {0};
02662             GetTextRange(pEnLink->chrg, wszLink);
02663
02664             //ShellExecute returns a value greater than 32 is successful (nice design!)
02665             //NOTE: ShellExecute returns a HINSTANCE, (for backard compatibility), but really this is a LONG
02666             return (LONG_PTR)ShellExecuteW(m_hWnd, L"open", wszLink, NULL, NULL, SW_SHOWNORMAL) > 32;
02667           }
02668           else
02669           {
02670             CHAR szLink[MAX_QUERY_LEN] = {0};
02671             GetTextRange(pEnLink->chrg, szLink);
02672
02673             //ShellExecute returns a value greater than 32 is successful (nice design!)
02674             //NOTE: ShellExecute returns a HINSTANCE, (for backard compatibility), but really this is a LONG
02675             return (LONG_PTR)ShellExecuteA(m_hWnd, "open", szLink, NULL, NULL, SW_SHOWNORMAL) > 32;
02676           }
02677         }
02678       }
02679     };
02680   }
02681
02682   return FALSE;
02683 }
02684
02685
02686 /////////////////////////////////////////////////////////////////////
02687 // CRichEditLite::ReplaceSel
02688 //
02689 /////////////////////////////////////////////////////////////////////
02690 void CRichEditLite::ReplaceSel(LPCWSTR pwszString, bool bCanUndo, DWORD dwMask, DWORD dwColor)
02691 {
02692   //Change to bold and/or color
02693   if(dwMask)
02694     SetEffects(dwMask, dwMask & CFM_BOLD ? CFE_BOLD : 0, dwColor);
02695
02696   //Delegate
02697   ReplaceSel(pwszString, bCanUndo);
02698
02699   //Change back
02700   if(dwMask)
02701     SetEffects(dwMask, CFE_AUTOCOLOR, 0);
02702 }
02703
02704
02705 /////////////////////////////////////////////////////////////////////
02706 // CRichEditLite::Append
02707 //
02708 /////////////////////////////////////////////////////////////////////
02709 void CRichEditLite::Append(LPCWSTR pwszString, bool bCanUndo, DWORD dwMask, DWORD dwColor)
02710 {
02711   //Move the position to the end
02712   SetSel(LONG_MAX, LONG_MAX);
02713
02714   //Delegate
02715   ReplaceSel(pwszString, bCanUndo, dwMask, dwColor);
02716 }
02717
02718
02719 /////////////////////////////////////////////////////////////////////
02720 // CRichEditLite::GetSelectedText
02721 //
02722 /////////////////////////////////////////////////////////////////////
02723 WCHAR* CRichEditLite::GetSelectedText(BOOL fEntireLine)
02724 {
02725   INDEX cpMin = 0;
02726   INDEX cpMax = 0;
02727   WCHAR* pwsz = NULL;
02728   HRESULT hr = S_OK;
02729
02730   //Obtain the EditBox text (rules below).
02731   //  1.  First try to obtain whatever text is highlighted (even multiline highlight)
02732   //  2.  Or if nothing is highlighted take the entire line of the cursor
02733
02734   //Obtain the Selected Text Start and End Positions
02735   GetSel(&cpMin, &cpMax);
02736
02737   //If there is no selected Text
02738   //Just get the entire line, as if it were highlighted...
02739   if(cpMin == cpMax)
02740   {
02741     //Obtain the first character of the selected line...
02742     INDEX iCharIndex = LineIndex(-1);
02743     INDEX iLineLength = LineLength(cpMin);
02744
02745     if(fEntireLine)
02746     {
02747       cpMin = (LONG)iCharIndex;
02748       cpMax = (LONG)(iCharIndex + iLineLength);
02749     }
02750
02751     //Obtain the current word, if nothing is selected...
02752     if(cpMin == cpMax)
02753     {
02754       //TODO
02755 /*      //Find the begining of the whole word that the cursor is over...
02756       while(cpMin > iCharIndex)
02757       {
02758         if(!iswalnum(pwsz[cpMin - iCharIndex - 1]))
02759           break;
02760         cpMin--;
02761       }
02762
02763       //Find the ending of the whole word that the cursor is over...
02764       while(cpMax < (iCharIndex + iLineLength))
02765       {
02766         if(!iswalnum(pwsz[cpMax - iCharIndex]))
02767           break;
02768         cpMax++;
02769       }
02770 */    }
02771
02772     //Highlight the text we used...
02773     SetSel(cpMin, cpMax);
02774   }
02775
02776   //Now that we have a selection...
02777   ASSERT(cpMax>=cpMin && cpMax>=0 && cpMin>=0);
02778
02779   //Simple, just obtain the selected text...
02780   INDEX iMaxChars = (cpMax-cpMin+1)+1;
02781
02782   //Allocate a buffer large enough to hold all the text...
02783   //NOTE:  We pass in the length to wSendMessage so it knows the conversion length...
02784   SAFE_ALLOC(pwsz, WCHAR, iMaxChars);
02785   wSendMessage(m_hWnd, EM_GETSELTEXT, iMaxChars, pwsz);
02786
02787 CLEANUP:
02788   return pwsz;
02789 }
02790
02791
02792
02793
02794 /////////////////////////////////////////////////////////////////////
02795 // CRichEditLite::SetEffects
02796 //
02797 /////////////////////////////////////////////////////////////////////
02798 BOOL CRichEditLite::SetEffects(DWORD dwMask, DWORD  dwEffects, COLORREF crTextColor)
02799 {
02800   CHARFORMATW charFormat;
02801   charFormat.cbSize   = sizeof(CHARFORMATW);
02802   charFormat.dwMask   = dwMask;
02803   charFormat.dwEffects  = dwEffects;
02804   charFormat.crTextColor  = crTextColor;
02805   return SetCharFormat(SCF_SELECTION, charFormat);
02806 }
02807
02808
02809 /////////////////////////////////////////////////////////////////////
02810 // CRichEditLite::SetCharFormat
02811 //
02812 /////////////////////////////////////////////////////////////////////
02813 BOOL CRichEditLite::SetCharFormat(DWORD dwMask, CHARFORMATW& charFormatW)
02814 {
02815   //Unfortunatly the RichEdit20W requires a CHARFORMATW structure (size) to be passed in
02816   //and will ignore the CHARFORMATA size, and the same is true for RichEdit20A with CHARFORMATA.
02817   //This is a unique structure in that this is not a pointer to a string szFaceName, but the
02818   //string buffer is a part of the structure, making cbSize different.  Even though we don't
02819   //have the maks indicating the face name is valid, it still does validation and will ignore
02820   //any mismatched size with the use of the control...
02821
02822   if(IsUnicodeOS())
02823   {
02824     return (BOOL)SendMessageW(m_hWnd, EM_SETCHARFORMAT, dwMask, (LPARAM)&charFormatW);
02825   }
02826   else
02827   {
02828     //Convert the CHARFORMATW to CHARFORMATA
02829     CHARFORMATA charFormatA;
02830     memcpy(&charFormatA, &charFormatW, sizeof(CHARFORMATA));
02831     charFormatA.cbSize = sizeof(CHARFORMATA);
02832
02833     //Convert the Unicode inline string to MBCS
02834     ConvertToMBCS(charFormatW.szFaceName, charFormatA.szFaceName, LF_FACESIZE);
02835     return (BOOL)SendMessageA(m_hWnd, EM_SETCHARFORMAT, dwMask, (LPARAM)&charFormatA);
02836   }
02837 }
02838
02839
02840
02841
02842 /////////////////////////////////////////////////////////////////////
02843 // CRichEditLite::FindText
02844 //
02845 /////////////////////////////////////////////////////////////////////
02846 INDEX CRichEditLite::FindText(DWORD dwFindFlags, FINDTEXTEXW* pFindTextW)
02847 {
02848   INDEX lPos = -1;
02849
02850   if(IsUnicodeOS())
02851   {
02852     //EM_FINDTEXT
02853     lPos = SendMessageW(m_hWnd, EM_FINDTEXTEXW, dwFindFlags, (LPARAM)pFindTextW);
02854   }
02855   else
02856   {
02857     CHAR szBuffer[MAX_NAME_LEN];
02858     ConvertToMBCS(pFindTextW->lpstrText, szBuffer, MAX_NAME_LEN);
02859
02860     //Input Args
02861     FINDTEXTEXA FindTextA;
02862     FindTextA.chrg      = pFindTextW->chrg;
02863     FindTextA.lpstrText   = szBuffer;
02864
02865     //EM_FINDTEXT
02866     lPos = SendMessageA(m_hWnd, EM_FINDTEXTEX, dwFindFlags, (LPARAM)&FindTextA);
02867
02868     //Output Params
02869     pFindTextW->chrgText  = FindTextA.chrgText;
02870   }
02871
02872   return lPos;
02873 }
02874
02875
02876 /////////////////////////////////////////////////////////////////////////////
02877 // CRichEditLite::FindNext
02878 //
02879 /////////////////////////////////////////////////////////////////////////////
02880 BOOL CRichEditLite::FindNext(DWORD dwFindFlags, WCHAR* pwszText)
02881 {
02882   //Obtain the Current Position of the 'caret'
02883   CHARRANGE chrg;
02884   GetSel(&chrg);
02885   BOOL fForward = (dwFindFlags & FR_DOWN);
02886
02887   //This now is the "next" or "previous" positions to search from...
02888   //NOTE: We have to use "Min" on backward searching otherwise it will continue to find
02889   //the selected word over and over...
02890   chrg.cpMin  = fForward ? chrg.cpMax : chrg.cpMin;
02891   chrg.cpMax  = fForward ? LONG_MAX : 0;
02892
02893   FINDTEXTEXW findTextEx;
02894   findTextEx.chrg     = chrg;
02895   findTextEx.lpstrText  = pwszText;
02896
02897   //First search from the point specified to the bottom (if forward)
02898   INDEX iPos = FindText(dwFindFlags, &findTextEx);
02899   if(iPos == -1)
02900   {
02901     //If not found, then switch to start from the begining (if forward) to the org starting point.
02902     findTextEx.chrg.cpMin  = fForward ? 0 : LONG_MAX;
02903     findTextEx.chrg.cpMax  = chrg.cpMax;
02904
02905     //Search
02906     iPos = FindText(dwFindFlags, &findTextEx);
02907   }
02908
02909   if(iPos != -1)
02910   {
02911     //Found a match, Select it...
02912     SetSel(findTextEx.chrgText.cpMin, findTextEx.chrgText.cpMax);
02913     return TRUE;
02914   }
02915
02916   //Otherwise, not found
02917   return FALSE;
02918 }
02919
02920
02921
02922 /////////////////////////////////////////////////////////////////////
02923 // CListBoxLite::CListBoxLite
02924 //
02925 /////////////////////////////////////////////////////////////////////
02926 CListBoxLite::CListBoxLite(HWND hWndParent, UINT nID)
02927   : CWndLite(hWndParent, nID)
02928 {
02929 }
02930
02931
02932 /////////////////////////////////////////////////////////////////////
02933 // CListBoxLite::~CListBoxLite
02934 //
02935 /////////////////////////////////////////////////////////////////////
02936 CListBoxLite::~CListBoxLite()
02937 {
02938 }
02939
02940
02941 /////////////////////////////////////////////////////////////////////
02942 // CListBoxLite::OnCommandNotify
02943 //
02944 /////////////////////////////////////////////////////////////////////
02945 BOOL CListBoxLite::OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl)
02946 {
02947   switch(wNotifyCode)
02948   {
02949     case LBN_DBLCLK:
02950     {
02951       if(OnDblClk(iID, hWndCtrl))
02952         return TRUE;
02953       break;
02954     }
02955   };
02956
02957   //Otherwise Delegate
02958   return CWndLite::OnCommandNotify(wNotifyCode, iID, hWndCtrl);
02959 }
02960
02961
02962 /////////////////////////////////////////////////////////////////////
02963 // CListBoxLite::OnDblClk
02964 //
02965 /////////////////////////////////////////////////////////////////////
02966 BOOL CListBoxLite::OnDblClk(INT iID, HWND hWndCtrl)
02967 {
02968   return FALSE;
02969 }
02970
02971
02972 /////////////////////////////////////////////////////////////////////
02973 // CListViewLite::CListViewLite
02974 //
02975 /////////////////////////////////////////////////////////////////////
02976 CListViewLite::CListViewLite(HWND hWndParent, UINT nID)
02977   : CSplitterLite(hWndParent, nID)
02978 {
02979 }
02980
02981
02982 /////////////////////////////////////////////////////////////////////
02983 // CListViewLite::~CListViewLite
02984 //
02985 /////////////////////////////////////////////////////////////////////
02986 CListViewLite::~CListViewLite()
02987 {
02988 }
02989
02990
02991 /////////////////////////////////////////////////////////////////////
02992 // CListViewLite::OnCreate
02993 //
02994 /////////////////////////////////////////////////////////////////////
02995 BOOL CListViewLite::OnCreate(CREATESTRUCT* pCREATESTRUCT)
02996 {
02997   //SubClass the window
02998   SubClassWindow(WndProc);
02999
03000   //Delegate
03001   return CSplitterLite::OnCreate(pCREATESTRUCT);
03002 }
03003
03004
03005 /////////////////////////////////////////////////////////////////////
03006 // CListViewLite::OnNotify
03007 //
03008 /////////////////////////////////////////////////////////////////////
03009 BOOL CListViewLite::OnNotify(INT idCtrl, NMHDR* pNMHDR)
03010 {
03011   switch(pNMHDR->code)
03012   {
03013     ON_COMMAND(LVN_COLUMNCLICK,   OnColumnClick(idCtrl, (NMLISTVIEW*)pNMHDR));
03014     ON_COMMAND(LVN_ITEMACTIVATE,  OnItemActivate(idCtrl, (NMLISTVIEW*)pNMHDR));
03015     ON_COMMAND(LVN_ITEMCHANGED,   OnItemChanged(idCtrl, (NMLISTVIEW*)pNMHDR));
03016   };
03017
03018   //Delegate
03019   return CSplitterLite::OnNotify(idCtrl, pNMHDR);
03020 }
03021
03022
03023 /////////////////////////////////////////////////////////////////////
03024 // CListViewLite::OnColumnClick
03025 //
03026 /////////////////////////////////////////////////////////////////////
03027 BOOL CListViewLite::OnColumnClick(INT idCtrl, NMLISTVIEW* pNMListView)
03028 {
03029   return FALSE;
03030 }
03031
03032
03033 /////////////////////////////////////////////////////////////////////
03034 // CListViewLite::OnItemActivate
03035 //
03036 /////////////////////////////////////////////////////////////////////
03037 BOOL CListViewLite::OnItemActivate(INT idCtrl, NMLISTVIEW* pNMListView)
03038 {
03039   return FALSE;
03040 }
03041
03042 /////////////////////////////////////////////////////////////////////
03043 // CListViewLite::OnItemChanged
03044 //
03045 /////////////////////////////////////////////////////////////////////
03046 BOOL CListViewLite::OnItemChanged(INT idCtrl, NMLISTVIEW* pNMListView)
03047 {
03048   return FALSE;
03049 }
03050
03051
03052 /////////////////////////////////////////////////////////////////////
03053 // CListViewLite::InsertItem
03054 //
03055 /////////////////////////////////////////////////////////////////////
03056 INDEX CListViewLite::InsertItem(INDEX iItem, INDEX iSubItem, WCHAR* wszName, LPARAM lParam, INT iImage, UINT iState, UINT iStateMask)
03057 {
03058   return LV_InsertItem(m_hWnd, iItem, iSubItem, wszName, lParam, iImage, iState, iStateMask);
03059 }
03060
03061
03062 /////////////////////////////////////////////////////////////////////
03063 // CListViewLite::SetItemText
03064 //
03065 /////////////////////////////////////////////////////////////////////
03066 BOOL CListViewLite::SetItemText(INDEX iItem, INDEX iSubItem, WCHAR* pwszName)
03067 {
03068   return LV_SetItemText(m_hWnd, iItem, iSubItem, pwszName);
03069 }
03070
03071
03072 /////////////////////////////////////////////////////////////////////
03073 // CListViewLite::SetItemState
03074 //
03075 /////////////////////////////////////////////////////////////////////
03076 BOOL CListViewLite::SetItemState(INDEX iItem, INDEX iSubItem, UINT iState, UINT iStateMask)
03077 {
03078   return LV_SetItemState(m_hWnd, iItem, iSubItem, iState, iStateMask);
03079 }
03080
03081
03082 /////////////////////////////////////////////////////////////////////
03083 // CListViewLite::GetItemImage
03084 //
03085 /////////////////////////////////////////////////////////////////////
03086 INT CListViewLite::GetItemImage(INDEX iItem, INDEX iSubItem)
03087 {
03088   return LV_GetItemImage(m_hWnd, iItem, iSubItem);
03089 }
03090
03091
03092 /////////////////////////////////////////////////////////////////////
03093 // CListViewLite::SetItemImage
03094 //
03095 /////////////////////////////////////////////////////////////////////
03096 BOOL CListViewLite::SetItemImage(INDEX iItem, INDEX iSubItem, INT iImage)
03097 {
03098   return LV_SetItemImage(m_hWnd, iItem, iSubItem, iImage);
03099 }
03100
03101
03102 /////////////////////////////////////////////////////////////////////
03103 // CListViewLite::SetItemParam
03104 //
03105 /////////////////////////////////////////////////////////////////////
03106 BOOL CListViewLite::SetItemParam(INDEX iItem, INDEX iSubItem, LPARAM lParam)
03107 {
03108   return LV_SetItemParam(m_hWnd, iItem, iSubItem, lParam);
03109 }
03110
03111
03112 /////////////////////////////////////////////////////////////////////
03113 // CListViewLite::SetColumn
03114 //
03115 /////////////////////////////////////////////////////////////////////
03116 BOOL CListViewLite::SetColumn(INDEX iColumn, WCHAR* wszName, INT iImage)
03117 {
03118   ULONG dwMask = LVCF_TEXT | LVCF_FMT | LVCF_SUBITEM;
03119   INT dwFmt = LVCFMT_LEFT;
03120   if(iImage != IMAGE_NONE)
03121   {
03122     dwMask |= LVCF_IMAGE;
03123     dwFmt |= LVCFMT_IMAGE;
03124   }
03125
03126   //LVM_SETCOLUMN
03127   if(IsUnicodeOS())
03128   {
03129     //Setup LVM_SETCOLUMN
03130     LV_COLUMNW lvColumnHeader = { dwMask, dwFmt, 0, wszName, 0, 0, iImage, 0};
03131     return (BOOL)SendMessage(m_hWnd, LVM_SETCOLUMNW, (WPARAM)iColumn, (LPARAM)&lvColumnHeader);
03132   }
03133   else
03134   {
03135     //Setup LVM_SETCOLUMN
03136     CHAR szBuffer[MAX_NAME_LEN];
03137     LV_COLUMNA lvColumnHeader = { dwMask, dwFmt, 0, szBuffer, 0, 0, iImage, 0};
03138     ConvertToMBCS(wszName, szBuffer, MAX_NAME_LEN);
03139     return (BOOL)SendMessage(m_hWnd, LVM_SETCOLUMNA, (WPARAM)iColumn, (LPARAM)&lvColumnHeader);
03140   }
03141 }
03142
03143
03144 /////////////////////////////////////////////////////////////////////
03145 // CListViewLite::InsertColumn
03146 //
03147 /////////////////////////////////////////////////////////////////////
03148 INDEX CListViewLite::InsertColumn(INDEX iColumn, WCHAR* wszName, INT iImage)
03149 {
03150   return LV_InsertColumn(m_hWnd, iColumn, wszName, iImage);
03151 }
03152
03153 /////////////////////////////////////////////////////////////////////
03154 // CListViewLite::GetItemParam
03155 //
03156 /////////////////////////////////////////////////////////////////////
03157 LPARAM CListViewLite::GetItemParam(INDEX iItem)
03158 {
03159   return LV_GetItemParam(m_hWnd, iItem, 0);
03160 }
03161
03162 /////////////////////////////////////////////////////////////////////
03163 // CListViewLite::GetItemText
03164 //
03165 /////////////////////////////////////////////////////////////////////
03166 INDEX CListViewLite::GetItemText(INDEX iItem, INDEX iSubItem, WCHAR* wszName, ULONG ulMaxChars)
03167 {
03168   return LV_GetItemText(m_hWnd, iItem, iSubItem, wszName, ulMaxChars);
03169 }
03170
03171
03172 /////////////////////////////////////////////////////////////////////
03173 // CListViewLite::HitTest
03174 //
03175 /////////////////////////////////////////////////////////////////////
03176 INDEX CListViewLite::HitTest(REFPOINTS pts, UINT* pFlags, BOOL fClientCoords)
03177 {
03178   LVHITTESTINFO lvHitInfo = {{pts.x, pts.y}, 0, 0};
03179   if(!fClientCoords)
03180     ScreenToClient(m_hWnd, &lvHitInfo.pt);
03181
03182   //LVM_HITTEST
03183   INDEX iItem = (INDEX)SendMessage(m_hWnd, LVM_HITTEST, 0, (LPARAM)&lvHitInfo);
03184   if(pFlags)
03185     *pFlags = lvHitInfo.flags;
03186
03187   return iItem;
03188 }
03189
03190
03191 /////////////////////////////////////////////////////////////////////
03192 // CTreeViewLite::CTreeViewLite
03193 //
03194 /////////////////////////////////////////////////////////////////////
03195 CTreeViewLite::CTreeViewLite(HWND hWndParent, UINT nID)
03196   : CSplitterLite(hWndParent, nID)
03197 {
03198   m_hDraggingItem = NULL;
03199 }
03200
03201
03202 /////////////////////////////////////////////////////////////////////
03203 // CTreeViewLite::~CTreeViewLite
03204 //
03205 /////////////////////////////////////////////////////////////////////
03206 CTreeViewLite::~CTreeViewLite()
03207 {
03208 }
03209
03210
03211 /////////////////////////////////////////////////////////////////////
03212 // CTreeViewLite::OnCreate
03213 //
03214 /////////////////////////////////////////////////////////////////////
03215 BOOL CTreeViewLite::OnCreate(CREATESTRUCT* pCREATESTRUCT)
03216 {
03217   //SubClass the window
03218   SubClassWindow(WndProc);
03219
03220   //Delegate
03221   return CSplitterLite::OnCreate(pCREATESTRUCT);
03222 }
03223
03224
03225 /////////////////////////////////////////////////////////////////////
03226 // CTreeViewLite::OnNotify
03227 //
03228 /////////////////////////////////////////////////////////////////////
03229 BOOL CTreeViewLite::OnNotify(INT idCtrl, NMHDR* pNMHDR)
03230 {
03231   switch(pNMHDR->code)
03232   {
03233     ON_COMMAND(TVN_SELCHANGED,    OnSelChanged(idCtrl, (NMTREEVIEW*)pNMHDR));
03234     ON_COMMAND(TVN_BEGINLABELEDIT,  OnBeginLabelEdit(idCtrl, (NMTVDISPINFO*)pNMHDR));
03235     ON_COMMAND(TVN_ENDLABELEDIT,  OnEndLabelEdit(idCtrl, (NMTVDISPINFO*)pNMHDR));
03236     ON_COMMAND(TVN_BEGINDRAG,   OnBeginDrag(idCtrl, (NMTREEVIEW*)pNMHDR));
03237   };
03238
03239   //Delegate
03240   return CSplitterLite::OnNotify(idCtrl, pNMHDR);
03241 }
03242
03243
03244 /////////////////////////////////////////////////////////////////////////////
03245 // CTreeViewLite::OnSelChanged
03246 //
03247 /////////////////////////////////////////////////////////////////////////////
03248 BOOL CTreeViewLite::OnSelChanged(INT idCtrl, NMTREEVIEW* pNMTreeView)
03249 {
03250   return FALSE;
03251 }
03252
03253
03254 /////////////////////////////////////////////////////////////////////////////
03255 // CTreeViewLite::OnBeginLabelEdit
03256 //
03257 /////////////////////////////////////////////////////////////////////////////
03258 BOOL CTreeViewLite::OnBeginLabelEdit(INT idCtrl, NMTVDISPINFO* ptvdi)
03259 {
03260   return FALSE;
03261 }
03262
03263
03264 /////////////////////////////////////////////////////////////////////////////
03265 // CTreeViewLite::OnEndLabelEdit
03266 //
03267 /////////////////////////////////////////////////////////////////////////////
03268 BOOL CTreeViewLite::OnEndLabelEdit(INT idCtrl, NMTVDISPINFO* ptvdi)
03269 {
03270   return FALSE;
03271 }
03272
03273
03274 /////////////////////////////////////////////////////////////////////////////
03275 // CTreeViewLite::OnBeginDrag
03276 //
03277 /////////////////////////////////////////////////////////////////////////////
03278 BOOL CTreeViewLite::OnBeginDrag(INT idCtrl, NMTREEVIEW* pNMTreeView)
03279 {
03280     //Tell the TreeView control to create an image to use for dragging.
03281   HTREEITEM hItem = pNMTreeView->itemNew.hItem;
03282     HIMAGELIST hImageList = TreeView_CreateDragImage(m_hWnd, hItem);
03283
03284   RECT rect;
03285   TreeView_GetItemRect(m_hWnd, pNMTreeView->itemNew.hItem, &rect, FALSE);
03286   m_hDraggingItem = hItem;
03287
03288   //Start the drag operation.
03289   ULONG level = 0;
03290
03291   do
03292   {
03293     hItem = TreeView_GetParent(m_hWnd, hItem);
03294     level++;
03295   }
03296   while(hItem);
03297
03298   LONG xIndent = TreeView_GetIndent( m_hWnd ) * level;
03299     ImageList_BeginDrag(hImageList, 0,  pNMTreeView->ptDrag.x - rect.left - xIndent,  pNMTreeView->ptDrag.y - rect.top);
03300
03301   //Hide the mouse cursor, and direct mouse input to the parent window.
03302     ShowCursor( FALSE );
03303   SetCapture(m_hWnd);
03304
03305   ImageList_DragEnter(m_hWnd, pNMTreeView->ptDrag.x - rect.left - xIndent, pNMTreeView->ptDrag.y);
03306   return TRUE;
03307 }
03308
03309
03310 /////////////////////////////////////////////////////////////////////
03311 // CTreeViewLite::OnMouseMove
03312 //
03313 /////////////////////////////////////////////////////////////////////
03314 BOOL CTreeViewLite::OnMouseMove(WPARAM nHittest, REFPOINTS pts)
03315 {
03316   if(m_hDraggingItem)
03317   {
03318     ImageList_DragMove(pts.x, pts.y);
03319
03320     //If the cursor is on an item, hilite it as the drop target
03321     HTREEITEM hItem = HitTest(pts);
03322     if(hItem)
03323     {
03324       ImageList_DragLeave( m_hWnd );
03325       TreeView_SelectDropTarget(m_hWnd, hItem);
03326       ImageList_DragEnter( m_hWnd, pts.x, pts.y);
03327     }
03328     return TRUE;
03329   }
03330
03331   return FALSE;
03332 }
03333
03334
03335 /////////////////////////////////////////////////////////////////////
03336 // CTreeViewLite::OnLButtonUp
03337 //
03338 /////////////////////////////////////////////////////////////////////
03339 BOOL CTreeViewLite::OnLButtonUp(WPARAM fwKeys, REFPOINTS pts)
03340 {
03341   if(m_hDraggingItem)
03342   {
03343     //End the Drag
03344     ImageList_EndDrag();
03345     ReleaseCapture();
03346     ShowCursor(TRUE);
03347     ImageList_DragLeave( m_hWnd );
03348     TreeView_SelectDropTarget(m_hWnd, NULL);
03349
03350     m_hDraggingItem = NULL;
03351     return TRUE;
03352   }
03353
03354   return FALSE;
03355 }
03356
03357
03358 /////////////////////////////////////////////////////////////////////
03359 // CTreeViewLite::GetItemParam
03360 //
03361 /////////////////////////////////////////////////////////////////////
03362 LPARAM CTreeViewLite::GetItemParam(HTREEITEM hTreeItem)
03363 {
03364   return TV_GetItemParam(m_hWnd, hTreeItem);
03365 }
03366
03367
03368 /////////////////////////////////////////////////////////////////////
03369 // CTreeViewLite::SetItemState
03370 //
03371 /////////////////////////////////////////////////////////////////////
03372 BOOL CTreeViewLite::SetItemState(HTREEITEM hItem, UINT iState, UINT iStateMask)
03373 {
03374   return TV_SetItemState(m_hWnd, hItem, iState, iStateMask);
03375 }
03376
03377
03378 /////////////////////////////////////////////////////////////////////
03379 // CTreeViewLite::SetItemImage
03380 //
03381 /////////////////////////////////////////////////////////////////////
03382 BOOL CTreeViewLite::SetItemImage(HTREEITEM hItem, INT iImage, INT iSelectedImage)
03383 {
03384   //TVM_SETITEM
03385   TVITEM tvItem = { TVIF_IMAGE|TVIF_SELECTEDIMAGE, hItem, 0, 0, NULL, 0, iImage, iSelectedImage, 0, 0};
03386   return (BOOL)SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)&tvItem);
03387 }
03388
03389
03390 /////////////////////////////////////////////////////////////////////
03391 // CTreeViewLite::SetItemParam
03392 //
03393 /////////////////////////////////////////////////////////////////////
03394 BOOL CTreeViewLite::SetItemParam(HTREEITEM hItem, LPARAM lParam)
03395 {
03396   //TVM_SETITEM
03397   TVITEM tvItem = { TVIF_PARAM, hItem, 0, 0, NULL, 0, 0, 0, 0, lParam};
03398   return (BOOL)SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)&tvItem);
03399 }
03400
03401
03402 /////////////////////////////////////////////////////////////////////
03403 // CTreeViewLite::SetItemText
03404 //
03405 /////////////////////////////////////////////////////////////////////
03406 BOOL CTreeViewLite::SetItemText(HTREEITEM hItem, WCHAR* pwszText)
03407 {
03408   if(IsUnicodeOS())
03409   {
03410     //TVM_SETITEM
03411     TVITEMW tvItem = { TVIF_TEXT, hItem, 0, 0, pwszText, 0, 0, 0, 0, 0};
03412     return (BOOL)SendMessageW(m_hWnd, TVM_SETITEMW, 0, (LPARAM)&tvItem);
03413   }
03414   else
03415   {
03416     CHAR szBuffer[MAX_NAME_LEN+1];
03417     ConvertToMBCS(pwszText, szBuffer, MAX_NAME_LEN);
03418
03419     //TVM_SETITEM
03420     TVITEMA tvItem = { TVIF_TEXT, hItem, 0, 0, szBuffer, 0, 0, 0, 0, 0};
03421     return (BOOL)SendMessageA(m_hWnd, TVM_SETITEMA, 0, (LPARAM)&tvItem);
03422   }
03423 }
03424
03425
03426 /////////////////////////////////////////////////////////////////////
03427 // HTREEITEM CTreeViewLite::InsertItem
03428 //
03429 /////////////////////////////////////////////////////////////////////
03430 HTREEITEM CTreeViewLite::InsertItem(HTREEITEM hParent, HTREEITEM hInsAfter, WCHAR* wszName, LPARAM lParam, INT iImage, INT iSelectedImage, UINT iState, UINT iStateMask)
03431 {
03432   return TV_InsertItem(m_hWnd, hParent, hInsAfter, wszName, lParam, iImage, iSelectedImage, iState, iStateMask);
03433 }
03434
03435
03436 /////////////////////////////////////////////////////////////////////
03437 // HTREEITEM CTreeViewLite::HitTest
03438 //
03439 /////////////////////////////////////////////////////////////////////
03440 HTREEITEM CTreeViewLite::HitTest(REFPOINTS pts, UINT* pFlags, BOOL fClientCoords)
03441 {
03442   TVHITTESTINFO tvHitInfo = {{pts.x, pts.y}, 0, NULL};
03443   if(!fClientCoords)
03444     ScreenToClient(m_hWnd, &tvHitInfo.pt);
03445
03446   //TVM_HITTEST
03447   HTREEITEM hItem = (HTREEITEM)SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)&tvHitInfo);
03448   if(pFlags)
03449     *pFlags = tvHitInfo.flags;
03450
03451   return hItem;
03452 }
03453
03454
03455
03456 /////////////////////////////////////////////////////////////////////
03457 // CComboBoxLite::CComboBoxLite
03458 //
03459 /////////////////////////////////////////////////////////////////////
03460 CComboBoxLite::CComboBoxLite(HWND hWndParent, UINT nID)
03461   : CWndLite(hWndParent, nID)
03462 {
03463   //NOTE: The "Height" of the combo indicates the "dropdown" height of the combo...
03464
03465
03466   m_iSavedSel   = CB_ERR;
03467 }
03468
03469
03470 /////////////////////////////////////////////////////////////////////
03471 // CComboBoxLite::~CComboBoxLite
03472 //
03473 /////////////////////////////////////////////////////////////////////
03474 CComboBoxLite::~CComboBoxLite()
03475 {
03476 }
03477
03478
03479 /////////////////////////////////////////////////////////////////////////////
03480 // CComboBoxLite::Populate
03481 //
03482 /////////////////////////////////////////////////////////////////////////////
03483 BOOL CComboBoxLite::Populate(ULONG cItems, const WIDENAMEMAP* rgItems)
03484 {
03485   //Remove any existing Data
03486   ResetContent();
03487
03488   //Fill in the Combo Box...
03489   for(ULONG i=0; i<cItems; i++)
03490     AddString(rgItems[i].pwszName, (LPARAM)rgItems[i].lItem);
03491
03492   //Restore the Default Selection...
03493   RestoreSelection();
03494   return TRUE;
03495 }
03496
03497
03498
03499 /////////////////////////////////////////////////////////////////////////////
03500 // CComboBoxLite::OnCommandNotify
03501 //
03502 /////////////////////////////////////////////////////////////////////////////
03503 BOOL CComboBoxLite::OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl)
03504 {
03505   switch(wNotifyCode)
03506   {
03507     case CBN_SELCHANGE:
03508     {
03509       if(OnSelChange(iID, hWndCtrl))
03510         return TRUE;
03511       break;
03512     }
03513
03514     case CBN_DROPDOWN:
03515     {
03516       if(OnDropDown(iID, hWndCtrl))
03517         return TRUE;
03518       break;
03519     }
03520   };
03521
03522   //Otherwise Delegate
03523   return CWndLite::OnCommandNotify(wNotifyCode, iID, hWndCtrl);
03524 }
03525
03526
03527 /////////////////////////////////////////////////////////////////////////////
03528 // CComboBoxLite::OnSelChange
03529 //
03530 /////////////////////////////////////////////////////////////////////////////
03531 BOOL CComboBoxLite::OnSelChange(INT iID, HWND hWndCtrl)
03532 {
03533   return FALSE;
03534 }
03535
03536
03537 /////////////////////////////////////////////////////////////////////////////
03538 // CComboBoxLite::OnDropDown
03539 //
03540 /////////////////////////////////////////////////////////////////////////////
03541 BOOL CComboBoxLite::OnDropDown(INT iID, HWND hWndCtrl)
03542 {
03543   return FALSE;
03544 }
03545
03546
03547 ////////////////////////////////////////////////////////////////
03548 // CComboBoxLite::AddString
03549 //
03550 /////////////////////////////////////////////////////////////////
03551 INDEX CComboBoxLite::AddString(WCHAR* pwszString, LPARAM lParam)
03552 {
03553   //Delegate to our other function to add just the string to the combo
03554   INDEX iItem = AddString(pwszString);
03555   if(iItem!=CB_ERR)
03556   {
03557     //Now set the item data for this item...
03558     SetItemParam(iItem, lParam);
03559   }
03560
03561   return iItem;
03562 }
03563
03564
03565 /////////////////////////////////////////////////////////////////////
03566 // CComboBoxLite::GetSelText
03567 //
03568 /////////////////////////////////////////////////////////////////////
03569 INDEX CComboBoxLite::GetSelText(WCHAR* pwszString, ULONG ulMaxSize)
03570 {
03571   ASSERT(pwszString);
03572   ASSERT(ulMaxSize);
03573
03574   //Try to obtain the Current Selection
03575   INDEX iSel = GetCurSel();
03576
03577   //This may fail, if the current selection is entered (DropDown instead of DropList)
03578   if(iSel == CB_ERR)
03579   {
03580     GetWindowText(pwszString, ulMaxSize);
03581   }
03582   else
03583   {
03584     //Should be limiting the text if this ASSERT is hit!
03585     //Length does not include the NULL Terminator
03586     LRESULT ulLength = GetTextLength(iSel);
03587     ASSERT((ULONG)ulLength < ulMaxSize);
03588
03589     //Obtain the text...
03590     if((ULONG)ulLength < ulMaxSize)
03591       GetText(iSel, pwszString);
03592   }
03593
03594   return iSel;
03595 }
03596
03597
03598 //////////////////////////////////////////////////////////////////
03599 // CComboBoxLite::SetSelText
03600 //
03601 //////////////////////////////////////////////////////////////////
03602 INDEX CComboBoxLite::SetSelText(WCHAR* pwszString, BOOL fAddItem)
03603 {
03604   ASSERT(pwszString);
03605
03606   //Try to find the Indicated Text
03607   INDEX iSel = FindStringExact(pwszString);
03608
03609   //If not found, just add it to the list (if desired)
03610   if(iSel == CB_ERR)
03611   {
03612     if(fAddItem)
03613     {
03614       iSel = AddString(pwszString, 0);
03615     }
03616     else
03617     {
03618       SetCurSel(iSel);
03619       SetWindowText(pwszString);
03620     }
03621   }
03622
03623   if(iSel != CB_ERR)
03624     iSel = SetCurSel(iSel);
03625
03626   return iSel;
03627 }
03628
03629
03630 ////////////////////////////////////////////////////////////////
03631 // CComboBoxLite::SetSelValue
03632 //
03633 /////////////////////////////////////////////////////////////////
03634 INDEX CComboBoxLite::SetSelValue(LPARAM lParam)
03635 {
03636   //Loop through all Combo Item Values and Select specified one...
03637   INDEX iCount = GetCount();
03638   for(INDEX i=0; i<iCount; i++)
03639   {
03640     if(lParam == GetItemParam(i))
03641     {
03642       SetCurSel(i);
03643       return i;
03644     }
03645   }
03646
03647   return CB_ERR;
03648 }
03649
03650
03651
03652 /////////////////////////////////////////////////////////////////////
03653 // CComboBoxLite::GetSelValue
03654 //
03655 /////////////////////////////////////////////////////////////////////
03656 LPARAM CComboBoxLite::GetSelValue()
03657 {
03658   //Obtain the Current Selection
03659   INDEX iSel    = GetCurSel();
03660   LPARAM lParam = CB_ERR;
03661
03662   //This may fail, if the current selection is entered (DropDown instead of DropList)
03663   if(iSel == CB_ERR)
03664   {
03665     WCHAR* pwszText = GetWindowText();
03666     WCHAR* pwszEnd = NULL;
03667     if(pwszText)
03668     {
03669       //Convert to LPARAM
03670       if(!ConvertToLONG(pwszText, (LONG*)&lParam))
03671         lParam = CB_ERR;
03672       SAFE_FREE(pwszText);
03673     }
03674   }
03675   else
03676   {
03677     lParam = GetItemParam(iSel);
03678   }
03679
03680   return lParam;
03681 }
03682
03683
03684 /////////////////////////////////////////////////////////////////////
03685 // CButtonLite::CButtonLite
03686 //
03687 /////////////////////////////////////////////////////////////////////
03688 CButtonLite::CButtonLite(HWND hWndParent, UINT nID)
03689   : CWndLite(hWndParent, nID)
03690 {
03691 }
03692
03693
03694 /////////////////////////////////////////////////////////////////////
03695 // CButtonLite::~CButtonLite
03696 //
03697 /////////////////////////////////////////////////////////////////////
03698 CButtonLite::~CButtonLite()
03699 {
03700 }
03701
03702
03703 /////////////////////////////////////////////////////////////////////
03704 // CComboBoxEx::CComboBoxEx
03705 //
03706 /////////////////////////////////////////////////////////////////////
03707 CComboBoxEx::CComboBoxEx(HWND hWndParent, UINT nID)
03708   : CComboBoxLite(hWndParent, nID)
03709 {
03710 }
03711
03712
03713 /////////////////////////////////////////////////////////////////////
03714 // CComboBoxEx::~CComboBoxEx
03715 //
03716 /////////////////////////////////////////////////////////////////////
03717 CComboBoxEx::~CComboBoxEx()
03718 {
03719 }
03720
03721
03722 /////////////////////////////////////////////////////////////////////
03723 // CComboBoxEx::OnInitialUpdate
03724 //
03725 /////////////////////////////////////////////////////////////////////
03726 BOOL CComboBoxEx::OnInitialUpdate()
03727 {
03728   SetUnicodeFormat(IsUnicodeOS());
03729
03730   //Delegate
03731   return CComboBoxLite::OnInitialUpdate();
03732 }
03733
03734
03735 /////////////////////////////////////////////////////////////////////
03736 // CComboBoxEx::InsertItem
03737 //
03738 /////////////////////////////////////////////////////////////////////
03739 INDEX CComboBoxEx::InsertItem(INDEX iItem, WCHAR* pwszName, LPARAM lParam, INT iIndent, INT iImage, UINT iSelectedImage)
03740 {
03741   INDEX iIndex = CB_ERR;
03742
03743   //Figure out the mask
03744   UINT   dwMask = 0;
03745   if(lParam != PARAM_NONE)
03746     dwMask |= CBEIF_LPARAM;
03747   if(pwszName )
03748     dwMask |= CBEIF_TEXT;
03749   if(iIndent != PARAM_NONE)
03750     dwMask |= CBEIF_INDENT;
03751   if(iImage != IMAGE_NONE)
03752     dwMask |= CBEIF_IMAGE;
03753   if(iSelectedImage != IMAGE_NONE)
03754     dwMask |= CBEIF_SELECTEDIMAGE;
03755
03756   //CBEM_INSERTITEM
03757   //NOTE: In the OnInitialUpdate we set the ComboBoxEx to be Unicode if on
03758   //a unicode OS and ANSI is not.  Even thought resource has ComboBoxEx (ANSI) the control
03759   //allow the user tha change the setting at runtime...
03760   if(IsUnicodeOS())
03761   {
03762     COMBOBOXEXITEMW comboItem = { dwMask, iItem, pwszName, 0/*cchTextMax*/, iImage, iSelectedImage, 0/*iOverlay*/, iIndent, lParam };
03763     iIndex = SendMessageW(m_hWnd, CBEM_INSERTITEMW, 0, (LPARAM)&comboItem);
03764   }
03765   else
03766   {
03767     CHAR szBuffer[MAX_NAME_LEN+1]={0};
03768     ConvertToMBCS(pwszName, szBuffer, MAX_NAME_LEN);
03769
03770     COMBOBOXEXITEMA comboItem = { dwMask, iItem, szBuffer, 0/*cchTextMax*/, iImage, iSelectedImage, 0/*iOverlay*/, iIndent, lParam };
03771     iIndex = SendMessageA(m_hWnd, CBEM_INSERTITEMA, 0, (LPARAM)&comboItem);
03772   }
03773
03774   return iIndex;
03775 }
03776
03777
03778 /////////////////////////////////////////////////////////////////////
03779 // CToolBarLite::CToolBarLite
03780 //
03781 /////////////////////////////////////////////////////////////////////
03782 CToolBarLite::CToolBarLite()
03783 {
03784 }
03785
03786
03787 /////////////////////////////////////////////////////////////////////
03788 // CToolBarLite::~CToolBarLite
03789 //
03790 /////////////////////////////////////////////////////////////////////
03791 CToolBarLite::~CToolBarLite()
03792 {
03793 }
03794
03795
03796 /////////////////////////////////////////////////////////////////////
03797 // CToolBarLite::Create
03798 //
03799 /////////////////////////////////////////////////////////////////////
03800 BOOL CToolBarLite::Create(HWND hWndParent, UINT nID,  UINT nBitmapID, UINT cButtons, TBBUTTON* rgButtons, DWORD dwStyle)
03801 {
03802   ASSERT(IsDestroyed());
03803   m_hWndParent = hWndParent;
03804   HINSTANCE hInstance = GetAppLite()->m_hInstance;
03805
03806   //Create ToolBar
03807   m_hWnd = CreateToolbarEx(
03808     hWndParent,       // parent
03809     dwStyle,
03810     nID,          // toolbar id
03811     3,                      // number of bitmaps
03812     hInstance,              // mod instance
03813     nBitmapID,        // resource ID for bitmap
03814     rgButtons,        // address of buttons
03815     cButtons,       // number of buttons
03816     16,16,                  // width & height of buttons
03817     16,16,                  // width & height of bitmaps
03818     sizeof(TBBUTTON));      // structure size
03819
03820     //Create ToolTips
03821     HWND hWndTT = (HWND)SendMessage(m_hWnd, TB_GETTOOLTIPS, 0, 0);
03822   if(hWndTT)
03823     {
03824       TOOLINFOA toolInfo;
03825     memset(&toolInfo, 0, sizeof(TOOLINFO));
03826         toolInfo.cbSize   = sizeof(TOOLINFO);
03827         toolInfo.uFlags   = TTF_CENTERTIP;
03828         toolInfo.hwnd   = m_hWnd;
03829         toolInfo.uId    = (UINT)ID_TOOLBAR;
03830         toolInfo.hinst    = hInstance;
03831         toolInfo.lpszText = (LPSTR)LPSTR_TEXTCALLBACKA;
03832
03833         // Set up the ToolTips
03834         SendMessage(hWndTT, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo);
03835   }
03836   return m_hWnd != NULL;
03837 }
03838
03839
03840 /////////////////////////////////////////////////////////////////////
03841 // CStatusBarLite::CStatusBarLite
03842 //
03843 /////////////////////////////////////////////////////////////////////
03844 CStatusBarLite::CStatusBarLite()
03845 {
03846 }
03847
03848
03849 /////////////////////////////////////////////////////////////////////
03850 // CStatusBarLite::~CStatusBarLite
03851 //
03852 /////////////////////////////////////////////////////////////////////
03853 CStatusBarLite::~CStatusBarLite()
03854 {
03855 }
03856
03857
03858 /////////////////////////////////////////////////////////////////////
03859 // CStatusBarLite::Create
03860 //
03861 /////////////////////////////////////////////////////////////////////
03862 BOOL CStatusBarLite::Create(HWND hWndParent, UINT nID,  WCHAR* pwszText, DWORD dwStyle)
03863 {
03864   ASSERT(IsDestroyed());
03865   m_hWndParent = hWndParent;
03866
03867   //Create StatusBar
03868   if(IsUnicodeOS())
03869   {
03870     m_hWnd = CreateStatusWindowW(dwStyle, pwszText, hWndParent, nID);
03871   }
03872   else
03873   {
03874     CHAR szBuffer[MAX_NAME_LEN];
03875     ConvertToMBCS(pwszText, szBuffer, MAX_NAME_LEN);
03876     m_hWnd = CreateStatusWindowA(dwStyle, szBuffer, hWndParent, nID);
03877   }
03878
03879   return m_hWnd != NULL;
03880
03881 }
03882
03883
03884 /////////////////////////////////////////////////////////////////////
03885 // CPropPageLite::CPropPageLite
03886 //
03887 /////////////////////////////////////////////////////////////////////
03888 CPropPageLite::CPropPageLite(UINT uIDD, TCHAR* ptszTitle)
03889   : CDialogLite(uIDD)
03890 {
03891   memset(&m_psPage, 0, sizeof(PROPSHEETPAGE));
03892
03893     //PROPSHEETPAGE
03894   m_psPage.dwSize     = sizeof(PROPSHEETPAGE);
03895     m_psPage.dwFlags    = PSP_USETITLE;
03896     m_psPage.hInstance    = GetAppLite()->m_hInstance;
03897     m_psPage.pszTemplate  = MAKEINTRESOURCE(uIDD);
03898     m_psPage.pszIcon    = NULL;
03899     m_psPage.pfnDlgProc   = PropPageProc;
03900     m_psPage.pszTitle   = ptszTitle;
03901     m_psPage.lParam     = (INT_PTR)this;
03902
03903   //Parent Property Sheet
03904   m_pCPropSheet     = NULL;
03905 }
03906
03907
03908 /////////////////////////////////////////////////////////////////////
03909 // CPropPageLite::~CPropPageLite
03910 //
03911 /////////////////////////////////////////////////////////////////////
03912 CPropPageLite::~CPropPageLite()
03913 {
03914 }
03915
03916
03917
03918 /////////////////////////////////////////////////////////////////////
03919 // CPropPageLite::CPropPageLite
03920 //
03921 /////////////////////////////////////////////////////////////////////
03922 void CPropPageLite::SetParent(CPropSheetLite* pCPropSheetLite)
03923 {
03924   ASSERT(pCPropSheetLite);
03925   m_pCPropSheet = pCPropSheetLite;
03926 }
03927
03928
03929 /////////////////////////////////////////////////////////////////////
03930 // CPropPageLite::OnApply
03931 //
03932 /////////////////////////////////////////////////////////////////////
03933 BOOL CPropPageLite::OnApply()
03934 {
03935   return TRUE;
03936 }
03937
03938
03939 /////////////////////////////////////////////////////////////////////
03940 // CPropPageLite::OnOK
03941 //
03942 /////////////////////////////////////////////////////////////////////
03943 BOOL CPropPageLite::OnOK()
03944 {
03945   return TRUE;
03946 }
03947
03948
03949 /////////////////////////////////////////////////////////////////////
03950 // CPropPageLite::OnReset
03951 //
03952 /////////////////////////////////////////////////////////////////////
03953 BOOL CPropPageLite::OnReset()
03954 {
03955   return TRUE;
03956 }
03957
03958
03959 /////////////////////////////////////////////////////////////////////
03960 // CPropPageLite::OnCancel
03961 //
03962 /////////////////////////////////////////////////////////////////////
03963 BOOL CPropPageLite::OnCancel()
03964 {
03965   return TRUE;
03966 }
03967
03968
03969
03970 /////////////////////////////////////////////////////////////////////
03971 // CPropPageLite::OnSetActive
03972 //
03973 /////////////////////////////////////////////////////////////////////
03974 BOOL CPropPageLite::OnSetActive()
03975 {
03976   return TRUE;
03977 }
03978
03979
03980 /////////////////////////////////////////////////////////////////////
03981 // CPropPageLite::OnKillActive
03982 //
03983 /////////////////////////////////////////////////////////////////////
03984 BOOL CPropPageLite::OnKillActive()
03985 {
03986   return TRUE;
03987 }
03988
03989
03990 /////////////////////////////////////////////////////////////////////
03991 // CPropPageLite::HandleMessage
03992 //
03993 /////////////////////////////////////////////////////////////////////
03994 BOOL CPropPageLite::HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
03995 {
03996   switch(msg)
03997   {
03998     case WM_NOTIFY:
03999     {
04000       switch (((NMHDR*)lParam)->code)
04001         {
04002         case PSN_SETACTIVE:
04003         {
04004           if(!OnSetActive())
04005           {
04006             SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
04007             return TRUE;
04008           }
04009
04010           return FALSE;
04011         }
04012
04013         case PSN_KILLACTIVE:
04014         {
04015           if(!OnKillActive())
04016           {
04017             SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
04018             return TRUE;
04019           }
04020
04021           return FALSE;
04022         }
04023
04024         case PSN_APPLY: //OK
04025         {
04026           if(!OnApply())
04027           {
04028             SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
04029             return TRUE;
04030           }
04031
04032           return FALSE;
04033         }
04034
04035         case PSN_RESET: //CANCEL
04036           OnReset();
04037           return FALSE;
04038       }
04039     }
04040   };
04041
04042   //Pass the message onto the Dialog
04043   return CDialogLite::HandleMessage(hWnd, msg, wParam, lParam);
04044 }
04045
04046
04047
04048
04049 /////////////////////////////////////////////////////////////////////
04050 // CPropPageLite::PropPageProc
04051 //
04052 /////////////////////////////////////////////////////////////////////
04053 INT_PTR WINAPI CPropPageLite::PropPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
04054 {
04055   CPropPageLite* pCPropPageLite = (CPropPageLite*)GetThis(hWnd);
04056
04057   switch(msg)
04058   {
04059     case WM_INITDIALOG:
04060     {
04061       //Save the Window Handle
04062       PROPSHEETPAGE*ps = (PROPSHEETPAGE*)lParam;
04063       CPropPageLite* pCPropPageLite = (CPropPageLite*)ps->lParam;
04064       pCPropPageLite->m_hWnd = hWnd;
04065
04066       //Save the "this" pointer
04067       SetThis(hWnd, pCPropPageLite);
04068       return pCPropPageLite->OnInitDialog();
04069     }
04070   };
04071
04072   if(pCPropPageLite)
04073     return pCPropPageLite->HandleMessage(hWnd, msg, wParam, lParam);
04074
04075   return FALSE;
04076 }
04077
04078
04079
04080 /////////////////////////////////////////////////////////////////////
04081 // CPropSheetLite::CPropSheetLite
04082 //
04083 /////////////////////////////////////////////////////////////////////
04084 CPropSheetLite::CPropSheetLite(TCHAR* ptszTitle, HICON hIcon)
04085 {
04086   memset(&m_psHeader, 0, sizeof(PROPSHEETPAGE));
04087
04088     //PROPSHEETHEADER
04089     m_psHeader.dwSize     = sizeof(PROPSHEETHEADER);
04090     m_psHeader.dwFlags      = PSH_USEHICON | PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW;
04091     m_psHeader.hwndParent   = NULL;
04092     m_psHeader.hInstance    = GetAppLite()->m_hInstance;
04093   m_psHeader.hIcon      = hIcon;
04094     m_psHeader.pszCaption   = ptszTitle;
04095     m_psHeader.nPages     = 0;
04096     m_psHeader.nStartPage   = 0;
04097     m_psHeader.ppsp       = NULL;
04098 }
04099
04100
04101 /////////////////////////////////////////////////////////////////////
04102 // CPropSheetLite::~CPropSheetLite
04103 //
04104 /////////////////////////////////////////////////////////////////////
04105 CPropSheetLite::~CPropSheetLite()
04106 {
04107   SAFE_FREE(m_psHeader.ppsp);
04108 }
04109
04110
04111
04112 /////////////////////////////////////////////////////////////////////
04113 // CPropSheetLite::AddPage
04114 //
04115 /////////////////////////////////////////////////////////////////////
04116 void CPropSheetLite::AddPage(CPropPageLite* pCPropPageLite)
04117 {
04118   ASSERT(pCPropPageLite);
04119   HRESULT hr = S_OK;
04120
04121   //Set the Pages parent (this sheet)
04122   pCPropPageLite->SetParent(this);
04123
04124   //Enlarge the array
04125   SAFE_REALLOC(m_psHeader.ppsp, PROPSHEETPAGE, m_psHeader.nPages+1);
04126
04127   //Copy into our array
04128   memcpy((void*)&m_psHeader.ppsp[m_psHeader.nPages], &pCPropPageLite->m_psPage, sizeof(PROPSHEETPAGE));
04129   m_psHeader.nPages++;
04130
04131 CLEANUP:
04132   ;
04133 }
04134
04135
04136 /////////////////////////////////////////////////////////////////////
04137 // CPropSheetLite::DoModal
04138 //
04139 /////////////////////////////////////////////////////////////////////
04140 LRESULT CPropSheetLite::DoModal(HWND hWndParent, INT nStartPage)
04141 {
04142   //Display the Property Sheet
04143     m_psHeader.hwndParent = hWndParent;
04144   m_psHeader.nStartPage = nStartPage;
04145     return PropertySheet(&m_psHeader);
04146 }
04147
04148
04149
04150 /////////////////////////////////////////////////////////////////////
04151 // CTabLite::CTabLite
04152 //
04153 /////////////////////////////////////////////////////////////////////
04154 CTabLite::CTabLite(HWND hWndParent, UINT nID)
04155   : CSplitterLite(hWndParent, nID)
04156 {
04157 }
04158
04159
04160 /////////////////////////////////////////////////////////////////////
04161 // CTabLite::~CTabLite
04162 //
04163 /////////////////////////////////////////////////////////////////////
04164 CTabLite::~CTabLite()
04165 {
04166 }
04167
04168
04169 /////////////////////////////////////////////////////////////////////
04170 // CTabLite::OnCreate
04171 //
04172 /////////////////////////////////////////////////////////////////////
04173 BOOL CTabLite::OnCreate(CREATESTRUCT* pCREATESTRUCT)
04174 {
04175   //SubClass the window
04176   SubClassWindow(WndProc);
04177
04178   //Delegate
04179   return CSplitterLite::OnCreate(pCREATESTRUCT);
04180 }
04181
04182
04183 /////////////////////////////////////////////////////////////////////
04184 // CTabLite::OnNotify
04185 //
04186 /////////////////////////////////////////////////////////////////////
04187 BOOL CTabLite::OnNotify(INT idCtrl, NMHDR* pNMHDR)
04188 {
04189   switch(pNMHDR->code)
04190   {
04191     ON_COMMAND(TCN_SELCHANGE,   OnSelChange((INT)pNMHDR->idFrom, pNMHDR->hwndFrom));
04192     ON_COMMAND(TCN_SELCHANGING,   OnSelChanging((INT)pNMHDR->idFrom, pNMHDR->hwndFrom));
04193 //    ON_COMMAND(TCN_GETOBJECT,   OnGetObject((NMOBJECTNOTIFY*)pNMHDR));
04194   };
04195
04196   return FALSE;
04197 }
04198
04199
04200 /////////////////////////////////////////////////////////////////////////////
04201 // CTabLite::SetCurSel
04202 //
04203 /////////////////////////////////////////////////////////////////////////////
04204 INDEX CTabLite::SetCurSel(INDEX iItem, BOOL fSendNotification)
04205 {
04206   //NOTE: We have to send this message our selves due to the following MSDN Article
04207   //"This method selects a tab in a tab control. A tab control does not send a
04208   //TCN_SELCHANGING or TCN_SELCHANGE notification message when a tab is selected using
04209   //this method. These notifications are sent, using WM_NOTIFY, when the user clicks or
04210   //uses the keyboard to change tabs."
04211   if(fSendNotification)
04212   {
04213     NMHDR nmHdr = { m_hWnd, IDP_TABS, TCN_SELCHANGING };
04214     SendMessage(m_hWnd, WM_NOTIFY, 0, (LPARAM)&nmHdr);
04215   }
04216
04217   //Send the message
04218   INDEX iSel = (INDEX)::SendMessageA(m_hWnd, TCM_SETCURSEL, iItem, 0);
04219
04220   //Post
04221   if(fSendNotification)
04222   {
04223     NMHDR nmHdr = { m_hWnd, IDP_TABS, TCN_SELCHANGE };
04224     SendMessage(m_hWnd, WM_NOTIFY, 0, (LPARAM)&nmHdr);
04225   }
04226
04227   return iSel;
04228 }
04229
04230
04231 /////////////////////////////////////////////////////////////////////////////
04232 // CTabLite::OnSelChange
04233 //
04234 /////////////////////////////////////////////////////////////////////////////
04235 BOOL CTabLite::OnSelChange(INT iID, HWND hWndCtrl)
04236 {
04237   return FALSE;
04238 }
04239
04240
04241 /////////////////////////////////////////////////////////////////////////////
04242 // CTabLite::OnSelChanging
04243 //
04244 /////////////////////////////////////////////////////////////////////////////
04245 BOOL CTabLite::OnSelChanging(INT iID, HWND hWndCtrl)
04246 {
04247   return FALSE;
04248 }
04249
04250 ////////////////////////////////////////////////////////////////
04251 // CTabLite::FindTab
04252 //
04253 /////////////////////////////////////////////////////////////////
04254 INDEX CTabLite::FindTab(LPARAM lParam)
04255 {
04256   //Try and find this suite in the list
04257   INDEX cItems = GetItemCount();
04258   for(INDEX iItem=0; iItem<cItems; iItem++)
04259   {
04260     LPARAM lCurParam = GetItemData(iItem);
04261     if(lParam == lCurParam)
04262       return iItem;
04263   }
04264
04265   return CB_ERR;
04266 }
04267
04268
04269 /////////////////////////////////////////////////////////////////////
04270 // CTabLite::GetItemData
04271 //
04272 /////////////////////////////////////////////////////////////////////
04273 LPARAM CTabLite::GetItemData(INDEX iItem)
04274 {
04275   LPARAM lParam = CB_ERR;
04276
04277   //Delegate
04278   if(GetItem(iItem, NULL, 0, &lParam))
04279     return lParam;
04280
04281   return CB_ERR;
04282 }
04283
04284
04285 /////////////////////////////////////////////////////////////////////
04286 // CTabLite::GetItem
04287 //
04288 /////////////////////////////////////////////////////////////////////
04289 BOOL CTabLite::GetItem(INDEX iItem, WCHAR* pwszText, ULONG ulMaxLength, LPARAM* plParam)
04290 {
04291   //Calculate the Mask/flags
04292   UINT dwMask = 0;
04293   if(pwszText && ulMaxLength)
04294     dwMask |= TCIF_TEXT;
04295 //  if(iImage != IMAGE_NONE)
04296 //    dwMask |= TCIF_IMAGE;
04297 //  if(dwState != STATE_NONE)
04298 //    dwMask |= TCIF_STATE;
04299   if(plParam)
04300     dwMask |= TCIF_PARAM;
04301
04302   if(IsUnicodeOS())
04303   {
04304     //TCM_GETITEMW
04305     TCITEMW tcItem = { dwMask, 0, 0, pwszText, ulMaxLength, 0, 0/*lParam*/};
04306     if(SendMessageW(m_hWnd, TCM_GETITEMW, iItem, (LPARAM)&tcItem))
04307     {
04308       if(plParam)
04309         *plParam = tcItem.lParam;
04310       return TRUE;
04311     }
04312   }
04313   else
04314   {
04315     CHAR szBuffer[MAX_NAME_LEN+1];
04316
04317     //TCM_GETITEMA
04318     TCITEMA tcItem = { dwMask, 0, 0, szBuffer, MAX_NAME_LEN, 0, 0/*lParam*/};
04319     if(SendMessageA(m_hWnd, TCM_GETITEMA, iItem, (LPARAM)&tcItem))
04320     {
04321       if(pwszText)
04322         ConvertToWCHAR(szBuffer, pwszText, ulMaxLength);
04323       if(plParam)
04324         *plParam = tcItem.lParam;
04325       return TRUE;
04326     }
04327   }
04328
04329
04330   //Otherwise
04331   return FALSE;
04332 }
04333
04334
04335 /////////////////////////////////////////////////////////////////////
04336 // CTabLite::SetItemText
04337 //
04338 /////////////////////////////////////////////////////////////////////
04339 BOOL CTabLite::SetItemText(INDEX iItem, LPCWSTR pwszText)
04340 {
04341   //Delegate
04342   return SetItem(iItem, pwszText);
04343 }
04344
04345
04346 /////////////////////////////////////////////////////////////////////
04347 // CTabLite::SetItem
04348 //
04349 /////////////////////////////////////////////////////////////////////
04350 BOOL CTabLite::SetItem(INDEX iItem, LPCWSTR pwszText, LPARAM lParam, INT iImage, DWORD dwState, DWORD dwStateMask)
04351 {
04352   //Calculate the Mask/flags
04353   UINT dwMask = 0;
04354   if(pwszText)
04355     dwMask |= TCIF_TEXT;
04356   if(iImage != IMAGE_NONE)
04357     dwMask |= TCIF_IMAGE;
04358   if(dwState != STATE_NONE)
04359     dwMask |= TCIF_STATE;
04360   if(lParam != PARAM_NONE)
04361     dwMask |= TCIF_PARAM;
04362
04363   if(IsUnicodeOS())
04364   {
04365     //TVM_SETITEM
04366     TCITEMW tcItem = { dwMask, dwState, dwStateMask, (WCHAR*)pwszText, 0/*cchTextMax*/, iImage, lParam };
04367     return (BOOL)SendMessageW(m_hWnd, TCM_SETITEMW, iItem, (LPARAM)&tcItem);
04368   }
04369   else
04370   {
04371     CHAR szBuffer[MAX_NAME_LEN+1];
04372     ConvertToMBCS(pwszText, szBuffer, MAX_NAME_LEN);
04373
04374     //TVM_SETITEM
04375     TCITEMA tcItem = { dwMask, dwState, dwStateMask, szBuffer, 0/*cchTextMax*/, iImage, lParam };
04376     return (BOOL)SendMessageA(m_hWnd, TCM_SETITEMA, iItem, (LPARAM)&tcItem);
04377   }
04378 }
04379
04380
04381 /////////////////////////////////////////////////////////////////////
04382 // CTabLite::InsertItem
04383 //
04384 /////////////////////////////////////////////////////////////////////
04385 INDEX CTabLite::InsertItem(INDEX iItem, LPCWSTR pwszText, LPARAM lParam, INT iImage, DWORD dwState, DWORD dwStateMask)
04386 {
04387   //Calculate the Mask/flags
04388   UINT dwMask = 0;
04389   if(pwszText)
04390     dwMask |= TCIF_TEXT;
04391   if(iImage != IMAGE_NONE)
04392     dwMask |= TCIF_IMAGE;
04393   if(dwState != STATE_NONE)
04394     dwMask |= TCIF_STATE;
04395   if(lParam != PARAM_NONE)
04396     dwMask |= TCIF_PARAM;
04397
04398   if(IsUnicodeOS())
04399   {
04400     //TCM_INSERTITEM
04401     TCITEMW tcItem = { dwMask, dwState, dwStateMask, (WCHAR*)pwszText, 0/*cchTextMax*/, iImage, lParam };
04402     return (INDEX)SendMessageW(m_hWnd, TCM_INSERTITEMW, iItem, (LPARAM)&tcItem);
04403   }
04404   else
04405   {
04406     CHAR szBuffer[MAX_QUERY_LEN+1] = {0};
04407     ConvertToMBCS(pwszText, szBuffer, MAX_QUERY_LEN);
04408
04409     //TCM_INSERTITEM
04410     TCITEMA tcItem = { dwMask, dwState, dwStateMask, szBuffer, 0/*cchTextMax*/, iImage, lParam };
04411     return (INDEX)SendMessageA(m_hWnd, TCM_INSERTITEMA, iItem, (LPARAM)&tcItem);
04412   }
04413
04414   return 0;
04415 }
04416
04417
04418
04419
04420
04421 /////////////////////////////////////////////////////////////////////////////
04422 // CCmdLineLite
04423 //
04424 /////////////////////////////////////////////////////////////////////////////
04425 CCmdLineLite::CCmdLineLite()
04426 {
04427   m_wszLastCmd[0] = wEOL;
04428 }
04429
04430
04431 /////////////////////////////////////////////////////////////////////////////
04432 // CCmdLineLite
04433 //
04434 /////////////////////////////////////////////////////////////////////////////
04435 CCmdLineLite::~CCmdLineLite()
04436 {
04437 }
04438
04439
04440 /////////////////////////////////////////////////////////////////////////////
04441 // CCmdLineLite::ResetParser
04442 //
04443 /////////////////////////////////////////////////////////////////////////////
04444 void CCmdLineLite::ResetParser()
04445 {
04446   m_wszLastCmd[0] = wEOL;
04447 }
04448
04449
04450 /////////////////////////////////////////////////////////////////////////////
04451 // CCmdLineLite::ParseParam
04452 //
04453 /////////////////////////////////////////////////////////////////////////////
04454 void CCmdLineLite::ParseParam( WCHAR* pwszParam, BOOL bFlag, BOOL bLast )
04455 {
04456 }
04457
04458
04459 /////////////////////////////////////////////////////////////////////////////
04460 // CCmdLineLite::ParseCommandLine
04461 //
04462 /////////////////////////////////////////////////////////////////////////////
04463 BOOL CCmdLineLite::ParseCommandLine()
04464 {
04465   //NOTE:  This is a simple command line parser which relies upon the Runtime to seperate
04466   //the arguments into argc/argv pairs.  Basically the runtime determines arguments by words
04467   //seperated soley by spaces, unless they are enclosed in double quotes.  If an argument
04468   //has spaces or needs embedded quotes, you need to close the argument in double quotes
04469   //and the embedded quotes need to be single quotes, (as single quotes are not recognized
04470   //and are ignored)
04471   WCHAR wszBuffer[MAX_QUERY_LEN];
04472
04473   for(INT i=1; i<__argc; i++)
04474   {
04475     //TODO remove conversion code for NT unicode support (GetCommandLineW)
04476     //Can always do the opposite conversion on Win95 if only GetCommandLineA is supported.
04477     WCHAR* pwszParam = wszBuffer;
04478     ConvertToWCHAR(__argv[i], pwszParam, MAX_QUERY_LEN);
04479
04480     BOOL bFlag = FALSE;
04481     BOOL bLast = ((i + 1) == __argc);
04482     if(pwszParam[0] == L'-' || pwszParam[0] == L'/')
04483     {
04484       // remove flag specifier
04485       bFlag = TRUE;
04486       pwszParam++;
04487     }
04488
04489     ParseParam(pwszParam, bFlag, bLast);
04490   }
04491
04492   //TRUE - CmdLine specified, FALSE - no command line args
04493   return __argc >1;
04494 }
04495
04496
04497 /////////////////////////////////////////////////////////////////////////////
04498 // CCmdLineLite::ParseFile
04499 //
04500 /////////////////////////////////////////////////////////////////////////////
04501 BOOL CCmdLineLite::ParseFile(WCHAR* pwszFileName)
04502 {
04503   if(!pwszFileName)
04504     return FALSE;
04505
04506   static CHAR szBuffer[MAX_QUERY_LEN+1] = {0};
04507   CHAR*  pszToken = NULL;
04508   BOOL bFlag = TRUE;
04509
04510   //Reset the Parser
04511   ResetParser();
04512
04513   //Open the file - for reading...
04514   CFileLite cFile;
04515   if(FAILED(cFile.Open(pwszFileName, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING)))
04516     return FALSE;
04517
04518   //Start reading...
04519   //NOTE:  We read the entire steam in ANSI, since this is the native format of the file.
04520   //We get major speed improvements reading all characters first, then converting to Unicode.
04521   //This method also prevens bugs with converting MBCS chars to unicode when all the characters
04522   //have not been read, since we may be converting and leading or trailing byte independent
04523   //of the context or other characters related...
04524   while(!cFile.IsEOF())
04525   {
04526     CHAR  chToken = 0;
04527     CHAR  chQuote = 0;
04528     LONG  cQuotes = 0;
04529     ULONG cChars = 0;
04530     BOOL  bLast = FALSE;
04531
04532     szBuffer[0] = EOL;
04533     pszToken = szBuffer;
04534
04535     //Obtain the string
04536     //Sure wish getLine allowed more than 1 deliminator
04537     //Since its doesn't I get 1 character at a time until either a space
04538     //or carriage return it hit...
04539     while(!cFile.IsEOF() && cChars<MAX_QUERY_LEN)
04540     {
04541       if(cFile.Read(sizeof(CHAR), &chToken)!=S_OK)
04542         break;
04543
04544       //Quote Character
04545       if(chToken == '\"' || chToken == '\'')
04546       {
04547         //First Quote - remember which quote char used
04548         if(cQuotes==0 && cChars==0)
04549           chQuote = chToken;
04550
04551         //Start or End of Quote
04552         if(chToken == chQuote)
04553           cQuotes = cQuotes ? cQuotes-1 : cQuotes+1;
04554
04555         //Don't include the first or the last quote
04556         if(cChars==0 || cQuotes==0)
04557           continue;
04558       }
04559
04560       //End of Token
04561       if(cQuotes==0)
04562       {
04563         //End of Token indicators (not inside quotes)
04564         if(chToken==' ' || chToken=='\n' || cFile.IsEOF())
04565           break;
04566
04567         //Line Feed are ignored (not inside quotes)
04568         if(chToken=='\r')
04569           continue;
04570       }
04571
04572       *pszToken = chToken;
04573       pszToken++;
04574       cChars++;
04575     }
04576
04577     //End of this token...
04578     *pszToken = EOL;
04579
04580     //Determine if this is a flag or parameter
04581     //Its only a flag if it wasn't inside a quoted option and begins with '/' or '-'
04582     if(!chQuote && (szBuffer[0] == '/' || szBuffer[0] == '-'))
04583     {
04584       bFlag = TRUE;       //This is a flag
04585       pszToken = &szBuffer[1];  //Remove the flag
04586     }
04587     else
04588     {
04589       bFlag = FALSE;
04590       pszToken = szBuffer;
04591     }
04592
04593     //Last Argument in the file...
04594     bLast = cFile.IsEOF();
04595
04596     //Parse The Command Line...
04597     //Ignore whitespace, but whitespace enclosed in quotes is counted as a param...
04598     if(pszToken[0] || chQuote)
04599     {
04600       //Now convert the Token into Unicode...
04601       static WCHAR wszBuffer[MAX_QUERY_LEN] = {0};
04602       ConvertToWCHAR(pszToken, wszBuffer, MAX_QUERY_LEN);
04603
04604       //Parse this parameter...
04605       ParseParam(wszBuffer, bFlag, bLast);
04606     }
04607   }
04608
04609   return TRUE;
04610 }
04611
04612
04613
04614 /////////////////////////////////////////////////////////////////////
04615 // CFileLite
04616 //
04617 /////////////////////////////////////////////////////////////////////
04618 CFileLite::CFileLite()
04619 {
04620   m_hFile   = NULL;
04621   m_bEOF    = FALSE;
04622
04623   m_bUnicode  = FALSE;
04624   m_cbWritten = 0;
04625   m_cbRead  = 0;
04626 }
04627
04628
04629 /////////////////////////////////////////////////////////////////////
04630 // ~CFileLite
04631 //
04632 /////////////////////////////////////////////////////////////////////
04633 CFileLite::~CFileLite()
04634 {
04635   //Cannot Call Virtual function from destructor
04636   CFileLite::Close();
04637 }
04638
04639
04640 /////////////////////////////////////////////////////////////////////
04641 // CFileLite::Open
04642 //
04643 /////////////////////////////////////////////////////////////////////
04644 HRESULT CFileLite::Open(LPCWSTR pwszFileName, DWORD dwDesiredAccess, DWORD dwShareMode, DWORD dwCreationDisposition, BOOL fDisplayDialog, HWND hWndParent)
04645 {
04646   ASSERT(m_hFile == NULL);
04647
04648   if(IsUnicodeOS())
04649   {
04650     m_hFile = CreateFileW
04651           (
04652             pwszFileName,
04653             dwDesiredAccess,          // access (read-write) mode
04654             dwShareMode,            // share mode
04655             NULL,               // pointer to security attributes
04656             dwCreationDisposition,        // how to create
04657             FILE_ATTRIBUTE_NORMAL,        // file attributes
04658             NULL                // handle to file with attributes to copy
04659           );
04660
04661     if(m_hFile==INVALID_HANDLE_VALUE)
04662     {
04663       if(fDisplayDialog)
04664       {
04665         wMessageBox(hWndParent, MB_TASKMODAL | MB_ICONERROR | MB_OK, wsz_ERROR, L"Unable to open file \"%s\", make sure File Name and Path are valid", pwszFileName);
04666         if(hWndParent)
04667           SetFocus(hWndParent);
04668       }
04669       m_hFile = NULL;
04670     }
04671   }
04672   else
04673   {
04674     static CHAR szFileName[MAX_NAME_LEN] = {0};
04675     ConvertToMBCS(pwszFileName, szFileName, MAX_NAME_LEN);
04676
04677     //Delegate
04678     return Open(szFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition,
04679             fDisplayDialog, hWndParent);
04680   }
04681
04682   return m_hFile ? S_OK : E_FAIL;
04683 }
04684
04685
04686 /////////////////////////////////////////////////////////////////////
04687 // CFileLite::Open
04688 //
04689 /////////////////////////////////////////////////////////////////////
04690 HRESULT CFileLite::Open(LPCSTR pszFileName, DWORD dwDesiredAccess, DWORD dwShareMode, DWORD dwCreationDisposition, BOOL fDisplayDialog, HWND hWndParent)
04691 {
04692   ASSERT(m_hFile == NULL);
04693
04694   m_hFile = CreateFileA
04695         (
04696           pszFileName,
04697           dwDesiredAccess,          // access (read-write) mode
04698           dwShareMode,            // share mode
04699           NULL,               // pointer to security attributes
04700           dwCreationDisposition,        // how to create
04701           FILE_ATTRIBUTE_NORMAL,        // file attributes
04702           NULL                // handle to file with attributes to copy
04703         );
04704
04705   if(m_hFile==INVALID_HANDLE_VALUE)
04706   {
04707     if(fDisplayDialog)
04708     {
04709       wMessageBox(hWndParent, MB_TASKMODAL | MB_ICONERROR | MB_OK, wsz_ERROR, L"Unable to open file \"%S\", make sure File Name and Path are valid", pszFileName);
04710       if(hWndParent)
04711         SetFocus(hWndParent);
04712     }
04713     m_hFile = NULL;
04714   }
04715
04716   return m_hFile ? S_OK : E_FAIL;
04717 }
04718
04719
04720 /////////////////////////////////////////////////////////////////////
04721 // CFileLite::Seek
04722 //
04723 /////////////////////////////////////////////////////////////////////
04724 DWORD CFileLite::Seek(LONG lDistanceToMove, DWORD dwOrigin)
04725 {
04726   if(m_hFile)
04727     return SetFilePointer(m_hFile, lDistanceToMove, NULL, dwOrigin);
04728
04729   return 0;
04730 }
04731
04732
04733 /////////////////////////////////////////////////////////////////////
04734 // CFileLite::DetermineUnicode
04735 //
04736 /////////////////////////////////////////////////////////////////////
04737 BOOL CFileLite::DetermineUnicode()
04738 {
04739   //When you open a file in Notepad, Notepad calls a Win32 function named IsTextUnicode.
04740   //This function determines whether the file uses Unicode. If the file starts with the
04741   //conventional signature for Unicode the BOM U+FEFF it knows to treat the file as Unicode.
04742   //(Notepad always adds a BOM to a Unicode file when saving it and hides it again when opening
04743   //the file.) If there is no BOM, IsTextUnicode can only guess whether the file uses Unicode
04744   //based on a number of rules (described in the Visual C++ 2 documentation of IsTextUnicode).
04745   if(!m_cbRead)
04746   {
04747     //If we have not read any characters yet, we need to read the first 2 characters
04748     //(which may contain the BOM - Byte Order Mark) to determine if unicode or MBCS format
04749     WCHAR wBOM = wEOL;
04750     if(ReadFile(m_hFile, &wBOM, sizeof(wBOM), &m_cbRead, NULL))
04751     {
04752       if(wBOM == UNICODE_BYTE_ORDER_MARK)
04753       {
04754         //Unicode file
04755         m_bUnicode = TRUE;
04756       }
04757       else
04758       {
04759         //Otherwise its not Unicode, and the bytes we just read are real
04760         //data, so "unread" them by moving the seek pointer back...
04761         Seek(-(LONG)m_cbRead, FILE_CURRENT);
04762         m_bUnicode = FALSE;
04763       }
04764     }
04765   }
04766
04767   return m_bUnicode;
04768 }
04769
04770
04771 /////////////////////////////////////////////////////////////////////
04772 // CFileLite::Read
04773 //
04774 /////////////////////////////////////////////////////////////////////
04775 HRESULT CFileLite::Read(ULONG cbBytes, WCHAR* pwszText, ULONG* pcbRead)
04776 {
04777   ULONG cbRead = 0;
04778   HRESULT hr = S_OK;
04779
04780   if(m_hFile && pwszText)
04781   {
04782     if(DetermineUnicode())
04783     {
04784       //The file is Unicode, just read directly into unicode string
04785       hr = ReadBytes(cbBytes, (BYTE*)pwszText, &cbRead);
04786     }
04787     else
04788     {
04789       static CHAR szBuffer[MAX_QUERY_LEN] = {0};
04790
04791       //The file is MBCS, conversion is required to Unicode string
04792       hr = ReadBytes(min(cbBytes/2, sizeof(szBuffer)), (BYTE*)szBuffer, &cbRead);
04793       if(SUCCEEDED(hr))
04794       {
04795         ConvertToWCHAR(szBuffer, pwszText, cbBytes);
04796         cbRead = cbRead*sizeof(WCHAR);
04797       }
04798     }
04799   }
04800
04801   if(pcbRead)
04802     *pcbRead = cbRead;
04803   return hr;
04804 }
04805
04806
04807 /////////////////////////////////////////////////////////////////////
04808 // CFileLite::Read
04809 //
04810 /////////////////////////////////////////////////////////////////////
04811 HRESULT CFileLite::Read(ULONG cbBytes, CHAR* pszText, ULONG* pcbRead)
04812 {
04813   ULONG cbRead = 0;
04814   HRESULT hr = S_OK;
04815
04816   if(m_hFile && pszText)
04817   {
04818     if(DetermineUnicode())
04819     {
04820       static WCHAR wszBuffer[MAX_QUERY_LEN] = {0};
04821
04822       //The file is Unicode, conversion is required to MBCS string
04823       hr = ReadBytes(min(cbBytes*2, sizeof(wszBuffer)), (BYTE*)wszBuffer, &cbRead);
04824       if(SUCCEEDED(hr))
04825       {
04826         ConvertToMBCS(wszBuffer, pszText, cbBytes);
04827         cbRead = cbRead/sizeof(WCHAR);
04828       }
04829     }
04830     else
04831     {
04832       //The file is MBCS, just read directly from the stream
04833       hr = ReadBytes(cbBytes, (BYTE*)pszText, &cbRead);
04834     }
04835   }
04836
04837   if(pcbRead)
04838     *pcbRead = cbRead;
04839   return hr;
04840 }
04841
04842
04843 /////////////////////////////////////////////////////////////////////
04844 // CFileLite::ReadBytes
04845 //
04846 /////////////////////////////////////////////////////////////////////
04847 HRESULT CFileLite::ReadBytes(ULONG cbBytes, BYTE* rgBytes, ULONG* pcbRead)
04848 {
04849   ULONG cbRead = 0;
04850   HRESULT hr = S_OK;
04851
04852   if(m_hFile && cbBytes)
04853   {
04854     ASSERT(rgBytes);
04855
04856     //Read from the file...
04857     if(ReadFile(m_hFile, rgBytes, cbBytes, &cbRead, NULL))
04858     {
04859       if(cbBytes == cbRead)
04860         hr = S_OK;
04861       else
04862         hr = S_FALSE;
04863     }
04864     else
04865     {
04866       hr = E_FAIL;
04867     }
04868   }
04869
04870   if(pcbRead)
04871     *pcbRead = cbRead;
04872
04873   m_bEOF = (hr != S_OK);
04874   return hr;
04875 }
04876
04877
04878 /////////////////////////////////////////////////////////////////////
04879 // CFileLite::Write
04880 //
04881 /////////////////////////////////////////////////////////////////////
04882 HRESULT CFileLite::Write(LPCWSTR pwszText, ULONG* pcbWritten)
04883 {
04884   ULONG cbWritten = 0;
04885   HRESULT hr = S_OK;
04886
04887   if(m_hFile && pwszText)
04888   {
04889     if(IsUnicode())
04890     {
04891       //The file is Unicode, just directly write out the stream of unicode bytes
04892       hr = WriteBytes(wcslen(pwszText)*sizeof(WCHAR), (BYTE*)pwszText, &cbWritten);
04893     }
04894     else
04895     {
04896       //The File is ANSI(MBCS), but the string is Unicode
04897       //Conversion required...
04898       static CHAR szBuffer[MAX_QUERY_LEN] = {0};
04899       ConvertToMBCS(pwszText, szBuffer, MAX_QUERY_LEN);
04900
04901       hr = WriteBytes(strlen(szBuffer)*sizeof(CHAR), (BYTE*)szBuffer, &cbWritten);
04902     }
04903   }
04904
04905   if(pcbWritten)
04906     *pcbWritten = cbWritten;
04907   return hr;
04908 }
04909
04910
04911 /////////////////////////////////////////////////////////////////////
04912 // CFileLite::Write
04913 //
04914 /////////////////////////////////////////////////////////////////////
04915 HRESULT CFileLite::Write(LPCSTR pszText, ULONG* pcbWritten)
04916 {
04917   ULONG cbWritten = 0;
04918   HRESULT hr = S_OK;
04919
04920   if(m_hFile && pszText)
04921   {
04922     if(IsUnicode())
04923     {
04924       //The file is Unicode, but the string is ANSI
04925       //Conversion required...
04926       static WCHAR wszBuffer[MAX_QUERY_LEN] = {0};
04927       ConvertToWCHAR(pszText, wszBuffer, MAX_QUERY_LEN);
04928
04929       hr = WriteBytes(wcslen(wszBuffer)*sizeof(WCHAR), (BYTE*)wszBuffer, &cbWritten);
04930     }
04931     else
04932     {
04933       //The File is ANSI(MBCS), just directly write out the stream of bytes
04934       //to MBCS before writting it directly to the file...
04935       hr = WriteBytes(strlen(pszText)*sizeof(CHAR), (BYTE*)pszText, &cbWritten);
04936     }
04937   }
04938
04939   if(pcbWritten)
04940     *pcbWritten = cbWritten;
04941   return hr;
04942 }
04943
04944
04945 /////////////////////////////////////////////////////////////////////
04946 // CFileLite::WriteBytes
04947 //
04948 /////////////////////////////////////////////////////////////////////
04949 HRESULT CFileLite::WriteBytes(ULONG cBytes, BYTE* rgBytes, ULONG* pcbWritten)
04950 {
04951   ULONG cbWritten = 0;
04952   HRESULT hr = S_OK;
04953
04954   if(m_hFile && cBytes)
04955   {
04956     ASSERT(rgBytes);
04957
04958     //When saving as a Unicode Text file, Notepad always writes out a byte order mark (BOM)
04959     //Unicode character U+FEFF as the first Unicode character in a file.
04960     //It uses this character (and not the file extension) to help it distinguish Unicode text
04961     //from other data.
04962     if(IsUnicode() && !m_cbWritten)
04963     {
04964       //If the file format is Unicode, and we haven't written any bytes to file
04965       //yet then write out the BOM (Byte Order Mark) to indicate unicode.
04966       WriteFile(m_hFile, &UNICODE_BYTE_ORDER_MARK, sizeof(UNICODE_BYTE_ORDER_MARK), &m_cbWritten, NULL);
04967     }
04968
04969     //Output to the file
04970     if(WriteFile(m_hFile, rgBytes, cBytes, &cbWritten, NULL))
04971       hr = S_OK;
04972     else
04973       hr = E_FAIL;
04974   }
04975
04976   if(pcbWritten)
04977     *pcbWritten = cbWritten;
04978   return hr;
04979 }
04980
04981
04982 /////////////////////////////////////////////////////////////////////
04983 // CFileLite::WriteQuoted
04984 //
04985 /////////////////////////////////////////////////////////////////////
04986 HRESULT CFileLite::WriteQuoted(LPCWSTR pwszText)
04987 {
04988   if(pwszText == NULL)
04989   {
04990     //Simple, empty string within quotes...
04991     Write(L"\"\"");
04992   }
04993   else if(wcschr(pwszText, L'\'')==NULL)
04994   {
04995     //String doesn't have embedded single quotes, so we can safely use this for outside
04996     Write(L"\'");
04997     Write(pwszText);
04998     Write(L"\'");
04999   }
05000   else if(wcschr(pwszText, L'\"')==NULL)
05001   {
05002     //String doesn't have embedded double quotes, so we can safely use this for outside
05003     Write(L"\"");
05004     Write(pwszText);
05005     Write(L"\"");
05006   }
05007   else
05008   {
05009     //String contains both single and double quotes!
05010     //We will need to double the embedded single quotes, so their is no confusion
05011     //on where the string begins or ends...
05012     Write(L"\'");
05013
05014     LPCWSTR pwszString = pwszText;
05015     WCHAR* pwszQuote = wcschr(pwszString, L'\'');
05016     while(pwszQuote && pwszString[0])
05017     {
05018       //Output upto the single quote, and output two single quotes
05019       *pwszQuote = L'\0';
05020       Write(pwszString);
05021       Write(L"\'\'");
05022       *pwszQuote = L'\'';
05023
05024       //Move to the next part of the string after what we have already output'ed
05025       pwszString = pwszQuote + 1;
05026       pwszQuote = wcschr(pwszString, L'\'');
05027     }
05028
05029     //Output the rest of the string
05030     Write(pwszString);
05031     Write(L"\'");
05032   }
05033
05034   return S_OK;
05035 }
05036
05037 /////////////////////////////////////////////////////////////////////
05038 // CFileLite::WriteFormat
05039 //
05040 /////////////////////////////////////////////////////////////////////
05041 HRESULT CFileLite::WriteFormat(LPCWSTR pwszFmt, ...)
05042 {
05043   if(!IsOpen())
05044     return S_OK;
05045
05046   va_list   marker;
05047   WCHAR   wszBuffer[MAX_QUERY_LEN];
05048
05049   // Use format and arguements as input
05050   //This version will not overwrite the stack, since it only copies
05051   //upto the max size of the array
05052   va_start(marker, pwszFmt);
05053   _vsnwprintf(wszBuffer, MAX_QUERY_LEN, pwszFmt, marker);
05054   va_end(marker);
05055
05056   //Make sure there is a NULL Terminator, vsnwprintf will not copy
05057   //the terminator if length==MAX_QUERY_LEN
05058   wszBuffer[MAX_QUERY_LEN-1] = wEOL;
05059
05060   //Delegate
05061   return Write(wszBuffer);
05062 }
05063
05064 /////////////////////////////////////////////////////////////////////
05065 // CFileLite::Flush
05066 //
05067 /////////////////////////////////////////////////////////////////////
05068 HRESULT CFileLite::Flush()
05069 {
05070   if(m_hFile)
05071   {
05072 //    return FlushFileBuffers(m_hFile) ? S_OK : E_FAIL;
05073   }
05074
05075   return S_OK;
05076 }
05077
05078 /////////////////////////////////////////////////////////////////////
05079 // CFileLite::Close
05080 //
05081 /////////////////////////////////////////////////////////////////////
05082 HRESULT CFileLite::Close()
05083 {
05084   if(m_hFile)
05085   {
05086     Flush();
05087     CloseHandle(m_hFile);
05088   }
05089
05090   m_hFile   = NULL;
05091   m_bEOF    = FALSE;
05092   m_cbWritten = 0;
05093   m_cbRead  = 0;
05094   return S_OK;
05095 }
05096
05097 //////////////////////////////////////////////////////////////////
05098 // LV_InsertColumn
05099 //
05100 //////////////////////////////////////////////////////////////////
05101 INDEX LV_InsertColumn(HWND hWnd, INDEX iColumn, WCHAR* wszName, INT iImage)
05102 {
05103   ULONG dwMask = LVCF_TEXT | LVCF_FMT | LVCF_SUBITEM;
05104   INT dwFmt = LVCFMT_LEFT;
05105   if(iImage != IMAGE_NONE)
05106   {
05107     dwMask |= LVCF_IMAGE;
05108     dwFmt |= LVCFMT_IMAGE;
05109   }
05110
05111   //LVM_INSERTCOLUMN
05112   if(IsUnicodeOS())
05113   {
05114     //Setup LV_COLUMNINFO
05115     LV_COLUMNW lvColumnHeader = { dwMask, dwFmt, 0, wszName, 0, 0, iImage, 0};
05116     return (INDEX)SendMessage(hWnd, LVM_INSERTCOLUMNW, (WPARAM)iColumn, (LPARAM)&lvColumnHeader);
05117   }
05118   else
05119   {
05120     //Setup LV_COLUMNINFO
05121     CHAR szBuffer[MAX_NAME_LEN];
05122     LV_COLUMNA lvColumnHeader = { dwMask, dwFmt, 0, szBuffer, 0, 0, iImage, 0};
05123     ConvertToMBCS(wszName, szBuffer, MAX_NAME_LEN);
05124     return (INDEX)SendMessage(hWnd, LVM_INSERTCOLUMNA, (WPARAM)iColumn, (LPARAM)&lvColumnHeader);
05125   }
05126 }
05127
05128
05129 //////////////////////////////////////////////////////////////////
05130 // LV_InsertItem
05131 //
05132 //////////////////////////////////////////////////////////////////
05133 INDEX LV_InsertItem(HWND hWnd, INDEX iItem, INDEX iSubItem, WCHAR* wszName, LPARAM lParam, INT iImage, UINT iState, UINT iStateMask)
05134 {
05135   //Calculate the Mask/flags
05136   ULONG dwMask = 0;
05137   if(wszName)
05138     dwMask |= LVIF_TEXT;
05139   if(iImage != IMAGE_NONE)
05140     dwMask |= LVIF_IMAGE;
05141   if(iState != STATE_NONE)
05142     dwMask |= LVIF_STATE;
05143   if(iSubItem == 0)
05144     dwMask |= LVIF_PARAM;
05145
05146   if(IsUnicodeOS())
05147   {
05148     //LVM_INSERTITEM
05149     if(iSubItem==0)
05150     {
05151       LV_ITEMW lvItem = { dwMask, (INT)iItem, (INT)iSubItem, iState, iStateMask, wszName, 0, iImage, lParam, 0};
05152       return (INDEX)SendMessageW(hWnd, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
05153     }
05154     //LVM_SETITEM
05155     else
05156     {
05157       LV_ITEMW lvItem = { dwMask, (INT)iItem, (INT)iSubItem, iState, iStateMask, wszName, 0, iImage, lParam, 0};
05158       return (INDEX)SendMessageW(hWnd, LVM_SETITEMW, 0, (LPARAM)&lvItem);
05159     }
05160   }
05161   else
05162   {
05163     CHAR szBuffer[MAX_QUERY_LEN+1];
05164     ConvertToMBCS(wszName, szBuffer, MAX_QUERY_LEN);
05165
05166     //LVM_INSERTITEM
05167     if(iSubItem==0)
05168     {
05169       LV_ITEMA lvItem = { dwMask, (INT)iItem, (INT)iSubItem, iState, iStateMask, szBuffer, 0, iImage, lParam, 0};
05170       return (INDEX)SendMessageA(hWnd, LVM_INSERTITEMA, 0, (LPARAM)&lvItem);
05171     }
05172     //LVM_SETITEM
05173     else
05174     {
05175       LV_ITEMA lvItem = { dwMask, (INT)iItem, (INT)iSubItem, iState, iStateMask, szBuffer, 0, iImage, lParam, 0};
05176       return (INDEX)SendMessageA(hWnd, LVM_SETITEMA, 0, (LPARAM)&lvItem);
05177     }
05178   }
05179
05180   return LVM_ERR;
05181 }
05182
05183
05184 //////////////////////////////////////////////////////////////////
05185 // LV_SetItemText
05186 //
05187 //////////////////////////////////////////////////////////////////
05188 BOOL LV_SetItemText(HWND hWnd, INDEX iItem, INDEX iSubItem, WCHAR* pwszName)
05189 {
05190   if(IsUnicodeOS())
05191   {
05192     //LVM_SETITEM
05193     LV_ITEMW lvItem = { LVIF_TEXT, (INT)iItem, (INT)iSubItem, 0, 0, pwszName, 0, 0, 0, 0};
05194     return (BOOL)SendMessage(hWnd, LVM_SETITEMTEXTW, (WPARAM)iItem, (LPARAM)&lvItem);
05195   }
05196   else
05197   {
05198     CHAR szBuffer[MAX_NAME_LEN+1];
05199     ConvertToMBCS(pwszName, szBuffer, MAX_NAME_LEN);
05200
05201     //LVM_SETITEM
05202     LV_ITEMA lvItem = { LVIF_TEXT, (INT)iItem, (INT)iSubItem, 0, 0, szBuffer, 0, 0, 0, 0};
05203     return (BOOL)SendMessageA(hWnd, LVM_SETITEMTEXTA, (WPARAM)iItem, (LPARAM)&lvItem);
05204   }
05205 }
05206
05207
05208 //////////////////////////////////////////////////////////////////
05209 // LV_SetItemState
05210 //
05211 //////////////////////////////////////////////////////////////////
05212 BOOL LV_SetItemState(HWND hWnd, INDEX iItem, INDEX iSubItem, UINT iState, UINT iStateMask)
05213 {
05214   //LVM_SETITEM
05215   LV_ITEM lvItem = { LVIF_STATE, (INT)iItem, (INT)iSubItem, iState, iStateMask, NULL, 0, 0, 0, 0};
05216   return (BOOL)SendMessage(hWnd, LVM_SETITEMSTATE, (WPARAM)iItem, (LPARAM)&lvItem);
05217 }
05218
05219 //////////////////////////////////////////////////////////////////
05220 // LV_SetItemImage
05221 //
05222 //////////////////////////////////////////////////////////////////
05223 BOOL LV_SetItemImage(HWND hWnd, INDEX iItem, INDEX iSubItem, INT iImage)
05224 {
05225   //LVM_SETITEM (With IMAGE mask)
05226   LV_ITEM lvItem = { LVIF_IMAGE, (INT)iItem, (INT)iSubItem, 0, 0, NULL, 0, iImage, 0, 0};
05227   return (BOOL)SendMessage(hWnd, LVM_SETITEM, 0, (LPARAM)&lvItem);
05228 }
05229
05230 //////////////////////////////////////////////////////////////////
05231 // LV_SetItemParam
05232 //
05233 //////////////////////////////////////////////////////////////////
05234 BOOL LV_SetItemParam(HWND hWnd, INDEX iItem, INDEX iSubItem, LPARAM lParam)
05235 {
05236   //LVM_SETITEM (With IMAGE mask)
05237   LV_ITEM lvItem = { LVIF_PARAM, (INT)iItem, (INT)iSubItem, 0, 0, NULL, 0, 0, lParam, 0};
05238   return (BOOL)SendMessage(hWnd, LVM_SETITEM, 0, (LPARAM)&lvItem);
05239 }
05240
05241
05242 //////////////////////////////////////////////////////////////////
05243 // LV_GetItemText
05244 //
05245 //////////////////////////////////////////////////////////////////
05246 INDEX LV_GetItemText(HWND hWnd, INDEX iItem, INDEX iSubItem, WCHAR* pwszName, ULONG ulMaxSize)
05247 {
05248   ASSERT(pwszName);
05249   pwszName[0] = wEOL;
05250   INDEX lReturn = 0;
05251
05252   //LVM_GETITEMTEXT
05253   if(IsUnicodeOS())
05254   {
05255     LV_ITEMW lvItem = { LVIF_TEXT, (INT)iItem, (INT)iSubItem, 0, 0, pwszName, ulMaxSize, 0, 0, 0};
05256     lReturn = (INDEX)SendMessage(hWnd, LVM_GETITEMTEXTW, (WPARAM)iItem, (LPARAM)&lvItem);
05257   }
05258   else
05259   {
05260     CHAR szBuffer[MAX_NAME_LEN] = {0};
05261
05262     LV_ITEMA lvItem = { LVIF_TEXT, (INT)iItem, (INT)iSubItem, 0, 0, szBuffer, MAX_NAME_LEN, 0, 0, 0};
05263     lReturn = (INDEX)SendMessage(hWnd, LVM_GETITEMTEXTA, (WPARAM)iItem, (LPARAM)&lvItem);
05264
05265     ConvertToWCHAR(szBuffer, pwszName, ulMaxSize);
05266   }
05267
05268   return lReturn;
05269 }
05270
05271 //////////////////////////////////////////////////////////////////
05272 // LV_GetItemState
05273 //
05274 //////////////////////////////////////////////////////////////////
05275 UINT LV_GetItemState(HWND hWnd, INDEX iItem, UINT iMask)
05276 {
05277   //LVM_GETITEMSTATE
05278   return  (UINT)SendMessage(hWnd, LVM_GETITEMSTATE, (WPARAM)iItem, (LPARAM)iMask);
05279 }
05280
05281 //////////////////////////////////////////////////////////////////
05282 // LV_GetItemImage
05283 //
05284 //////////////////////////////////////////////////////////////////
05285 INT LV_GetItemImage(HWND hWnd, INDEX iItem, INDEX iSubItem)
05286 {
05287   //LVM_GETITEM
05288   LV_ITEM lvItem = { LVIF_IMAGE, (INT)iItem, (INT)iSubItem, 0, 0, 0, 0, 0, 0, 0};
05289   SendMessage(hWnd, LVM_GETITEM, 0, (LPARAM)&lvItem);
05290   return lvItem.iImage;
05291 }
05292
05293 //////////////////////////////////////////////////////////////////
05294 // LV_GetItemParam
05295 //
05296 //////////////////////////////////////////////////////////////////
05297 LPARAM LV_GetItemParam(HWND hWnd, INDEX iItem, INDEX iSubItem)
05298 {
05299   //LVM_GETITEM
05300   LV_ITEM lvItem = { LVIF_PARAM, (INT)iItem, (INT)iSubItem, 0, 0, 0, 0, 0, 0, 0};
05301   SendMessage(hWnd, LVM_GETITEM, 0, (LPARAM)&lvItem);
05302   return lvItem.lParam;
05303 }
05304
05305
05306 //////////////////////////////////////////////////////////////////
05307 // LV_GetSelItems
05308 //
05309 //////////////////////////////////////////////////////////////////
05310 LRESULT LV_GetSelItems(HWND hWnd, INDEX* pcItems, INDEX** prgSelItems, LPARAM** prgSelParams)
05311 {
05312   //Get the total Selected Items
05313   HRESULT hr = S_OK;
05314   INDEX i,iSelItem =0;
05315   INDEX cItems = (INDEX)SendMessage(hWnd, LVM_GETSELECTEDCOUNT, 0, 0);
05316
05317   //Alloc Output Array
05318   if(prgSelItems)
05319     SAFE_ALLOC(*prgSelItems, INDEX, cItems);
05320   if(prgSelParams)
05321     SAFE_ALLOC(*prgSelParams, LPARAM, cItems);
05322
05323   //Find all params of Selected Items
05324   iSelItem = (INDEX)SendMessage(hWnd, LVM_GETNEXTITEM, (WPARAM)-1, (LPARAM)LVNI_SELECTED);
05325   for(i=0; i<cItems; i++)
05326   {
05327     if(prgSelItems)
05328       (*prgSelItems)[i] = iSelItem;
05329     if(prgSelParams)
05330       (*prgSelParams)[i] = LV_GetItemParam(hWnd, iSelItem, 0);
05331     iSelItem = (INDEX)SendMessage(hWnd, LVM_GETNEXTITEM, (WPARAM)iSelItem, (LPARAM)LVNI_SELECTED);
05332   }
05333
05334 CLEANUP:
05335   if(pcItems)
05336     *pcItems = cItems;
05337   return cItems;
05338 }
05339
05340
05341 //////////////////////////////////////////////////////////////////
05342 // LV_GetAllItems
05343 //
05344 //////////////////////////////////////////////////////////////////
05345 LRESULT LV_GetAllItems(HWND hWnd, INDEX* pcItems, INDEX** prgItems, LPARAM** prgParams)
05346 {
05347   //Get the total Items
05348   HRESULT hr = S_OK;
05349   INDEX i=0;
05350   INDEX cItems = (INDEX)SendMessage(hWnd, LVM_GETITEMCOUNT, 0, 0);
05351
05352   //Alloc Output Array
05353   if(prgItems)
05354     SAFE_ALLOC(*prgItems, INDEX, cItems);
05355   if(prgParams)
05356     SAFE_ALLOC(*prgParams, LPARAM, cItems);
05357
05358   //Find all Items
05359   for(i=0; i<cItems; i++)
05360   {
05361     if(prgItems)
05362       (*prgItems)[i] = i;
05363     if(prgParams)
05364       (*prgParams)[i] = LV_GetItemParam(hWnd, i, 0);
05365   }
05366
05367 CLEANUP:
05368   if(pcItems)
05369     *pcItems = cItems;
05370   return cItems;
05371 }
05372
05373
05374 ////////////////////////////////////////////////////////////////
05375 // LV_FindItem
05376 //
05377 /////////////////////////////////////////////////////////////////
05378 INDEX LV_FindItem(HWND hWnd, LPARAM lParam, INDEX iStart)
05379 {
05380   //LVM_FINDITEM
05381   LV_FINDINFO lvFindInfo = { LVIF_PARAM, 0, lParam, 0, 0};
05382   return (INDEX)SendMessage(hWnd, LVM_FINDITEM, (WPARAM)iStart, (LPARAM)&lvFindInfo);
05383 }
05384
05385
05386 //////////////////////////////////////////////////////////////////
05387 // TV_InsertItem
05388 //
05389 //////////////////////////////////////////////////////////////////
05390 HTREEITEM TV_InsertItem(HWND hWnd, HTREEITEM hParent, HTREEITEM hInsAfter, WCHAR* wszName, LPARAM lParam, INT iImage, INT iSelectedImage, UINT iState, UINT iStateMask)
05391 {
05392   //Calculate the Mask/flags
05393   ULONG dwMask = 0;
05394   if(wszName)
05395     dwMask |= LVIF_TEXT;
05396   if(iImage != IMAGE_NONE)
05397     dwMask |= (LVIF_IMAGE | TVIF_SELECTEDIMAGE);
05398   if(iState != STATE_NONE)
05399     dwMask |= LVIF_STATE;
05400   if(lParam != PARAM_NONE)
05401     dwMask |= LVIF_PARAM;
05402
05403   if(IsUnicodeOS())
05404   {
05405     //TVM_INSERTITEM
05406     TV_INSERTSTRUCTW tvInsertStruct = { hParent, hInsAfter, { dwMask, 0, iState, iStateMask, wszName, 0, iImage, iSelectedImage, 0, lParam} };
05407     return (HTREEITEM)SendMessageW(hWnd, TVM_INSERTITEMW, 0, (LPARAM)&tvInsertStruct);
05408   }
05409   else
05410   {
05411     CHAR szBuffer[MAX_NAME_LEN+1];
05412     ConvertToMBCS(wszName, szBuffer, MAX_NAME_LEN);
05413
05414     //TVM_INSERTITEM
05415     TV_INSERTSTRUCTA tvInsertStruct = { hParent, hInsAfter, { dwMask, 0, iState, iStateMask, szBuffer, 0, iImage, iSelectedImage, 0, lParam} };
05416     return (HTREEITEM)SendMessageA(hWnd, TVM_INSERTITEMA, 0, (LPARAM)&tvInsertStruct);
05417   }
05418 }
05419
05420
05421 //////////////////////////////////////////////////////////////////
05422 // TV_GetItemText
05423 //
05424 //////////////////////////////////////////////////////////////////
05425 BOOL TV_GetItemText(HWND hWnd, HTREEITEM hItem, WCHAR* pwszBuffer, LONG ulMaxSize)
05426 {
05427   ASSERT(pwszBuffer);
05428   BOOL bReturn = 0;
05429
05430   if(IsUnicodeOS())
05431   {
05432     TVITEMW tvItem = { TVIF_TEXT, hItem, 0, 0, pwszBuffer, ulMaxSize, 0, 0, 0, 0};
05433     bReturn = (BOOL)SendMessage(hWnd, TVM_GETITEMW, 0, (LPARAM)&tvItem);
05434   }
05435   else
05436   {
05437     CHAR szBuffer[MAX_NAME_LEN] = {0};
05438
05439     TVITEMA tvItem = { TVIF_TEXT, hItem, 0, 0, szBuffer, MAX_NAME_LEN, 0, 0, 0, 0};
05440     bReturn = (BOOL)SendMessage(hWnd, TVM_GETITEMA, 0, (LPARAM)&tvItem);
05441
05442     ConvertToWCHAR(szBuffer, pwszBuffer, ulMaxSize);
05443   }
05444
05445   return bReturn;
05446 }
05447
05448
05449 //////////////////////////////////////////////////////////////////
05450 // TV_GetItemParam
05451 //
05452 //////////////////////////////////////////////////////////////////
05453 LPARAM TV_GetItemParam(HWND hWnd, HTREEITEM hItem)
05454 {
05455   //no-op
05456   if(hItem == NULL)
05457     return NULL;
05458
05459   TVITEM tvItem = { TVIF_PARAM, hItem, 0, 0, NULL, 0, 0, 0, 0, 0};
05460
05461   //GetItem
05462   SendMessage(hWnd, TVM_GETITEM, 0, (LPARAM)&tvItem);
05463
05464   //return the lParam
05465   return tvItem.lParam;
05466 }
05467
05468
05469 //////////////////////////////////////////////////////////////////
05470 // TV_SetItemState
05471 //
05472 //////////////////////////////////////////////////////////////////
05473 BOOL TV_SetItemState(HWND hWnd, HTREEITEM hItem, UINT iState, UINT iStateMask)
05474 {
05475   //TVM_SETITEM
05476   TVITEM tvItem = { TVIF_STATE, hItem, iState, iStateMask, NULL, 0, 0, 0, 0, 0};
05477   return (BOOL)SendMessage(hWnd, TVM_SETITEM, 0, (LPARAM)&tvItem);
05478 }
05479
05480
05481 //////////////////////////////////////////////////////////////////
05482 // TV_FindItem
05483 //
05484 //////////////////////////////////////////////////////////////////
05485 HTREEITEM TV_FindItem(HWND hWnd, HTREEITEM hParent, WCHAR* wszName)
05486 {
05487   ASSERT(hWnd);
05488   ASSERT(wszName);
05489   CHAR szBuffer[MAX_NAME_LEN];
05490
05491   //Convert to MBCS
05492   CHAR szName[MAX_NAME_LEN];
05493   ConvertToMBCS(wszName, szName, MAX_NAME_LEN);
05494
05495   TVITEMA tvItemA = { TVIF_TEXT, 0, 0, 0, szBuffer, MAX_NAME_LEN, 0, 0, 0, 0};
05496   tvItemA.hItem = (HTREEITEM)SendMessage(hWnd, TVM_GETNEXTITEM, (WPARAM)TVGN_CHILD, (LPARAM)hParent);
05497   while(tvItemA.hItem)
05498   {
05499     //Try to find this string in the Tree
05500     if(SendMessage(hWnd, TVM_GETITEM, 0, (LPARAM)&tvItemA))
05501     {
05502       if(strcmp(szName, tvItemA.pszText)==0)
05503         return tvItemA.hItem;
05504     }
05505
05506     //Otherwise get the NextItem and continue...
05507     tvItemA.hItem = (HTREEITEM)SendMessage(hWnd, TVM_GETNEXTITEM, (WPARAM)TVGN_NEXT, (LPARAM)tvItemA.hItem);
05508   }
05509
05510   return NULL;
05511 }
05512
05513
05514 /////////////////////////////////////////////////////////////////////
05515 // CWaitCursor
05516 //
05517 /////////////////////////////////////////////////////////////////////
05518 CWaitCursor::CWaitCursor()
05519 {
05520   m_hPrevCursor = NULL;
05521   WaitCursor();
05522 }
05523
05524
05525 /////////////////////////////////////////////////////////////////////
05526 // ~CWaitCursor
05527 //
05528 /////////////////////////////////////////////////////////////////////
05529 CWaitCursor::~CWaitCursor()
05530 {
05531   RestoreCursor();
05532 };
05533
05534
05535 /////////////////////////////////////////////////////////////////////
05536 // CWaitCursor::WaitCursor
05537 //
05538 /////////////////////////////////////////////////////////////////////
05539 void CWaitCursor::WaitCursor()
05540 {
05541   static HCURSOR  hWaitCursor = LoadCursor(NULL, IDC_WAIT);
05542
05543   //Set the "HourGlass" wait cursor
05544   m_hPrevCursor = SetCursor(hWaitCursor);
05545 };
05546
05547
05548 /////////////////////////////////////////////////////////////////////
05549 // CWaitCursor::RestoreCursor
05550 //
05551 /////////////////////////////////////////////////////////////////////
05552 void CWaitCursor::RestoreCursor()
05553 {
05554   //Restore the previous cursor...
05555   SetCursor(m_hPrevCursor);
05556 };
05557
05558
05559
05560 ////////////////////////////////////////////////////////////////
05561 // DisplayContextMenu
05562 //
05563 /////////////////////////////////////////////////////////////////
05564 BOOL DisplayContextMenu(HWND hWnd, UINT iID, REFPOINTS rPts, HWND hWndParent, BOOL fRelCords)
05565 {
05566   //Load the SubMenu
05567   HMENU hMenu = LoadMenu(GetAppLite()->m_hInstance, MAKEINTRESOURCE(iID));
05568   HMENU hSubMenu = GetSubMenu(hMenu, 0);
05569
05570   RECT rect;
05571   GetWindowRect(hWnd, &rect);
05572   POINTS pts = rPts;  //Make a copy to modify const...
05573
05574   //Coordinates might be Screen Coordinates or Relative
05575   if(fRelCords)
05576   {
05577     rect.top  += pts.y;
05578     rect.bottom += pts.y;
05579     rect.left += pts.x;
05580     rect.right  += pts.x;
05581   }
05582
05583   //This message may have come from the keyboard
05584   //Just display at upper left corner
05585   if(pts.x < rect.left || pts.x > rect.right || pts.y < rect.top || pts.y > rect.bottom)
05586   {
05587     pts.x = (SHORT)rect.left + 5;
05588     pts.y = (SHORT)rect.top + 5;
05589   }
05590
05591   //Display SubMenu
05592   //Wants (x,y) in Screen Coordinates
05593   BOOL bResult = TrackPopupMenu(hSubMenu,
05594           TPM_LEFTALIGN | TPM_RIGHTBUTTON,
05595           pts.x,
05596           pts.y,
05597           0,
05598           hWndParent,
05599           NULL);
05600
05601   DestroyMenu(hSubMenu);
05602   DestroyMenu(hMenu);
05603   return bResult;
05604 }
05605
05606
05607 ////////////////////////////////////////////////////////////////
05608 // DisplayDialog
05609 //
05610 /////////////////////////////////////////////////////////////////
05611 LRESULT   DisplayDialog(UINT uID, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParam)
05612 {
05613   //Display DialogBoxParam and dump any errors...
05614   LRESULT lResult = DialogBoxParam(GetAppLite()->m_hInstance, MAKEINTRESOURCE(uID), hWndParent, lpDialogFunc, lParam);
05615   GETLASTERROR(lResult != -1);
05616
05617   return lResult;
05618 }
05619
05620
05621
05622 /////////////////////////////////////////////////////////////////////
05623 // CDropObject::CDropObject
05624 //
05625 /////////////////////////////////////////////////////////////////////
05626 CDropObject::CDropObject()
05627 {
05628   //IUnknown
05629   m_cRef = 0;
05630 }
05631
05632
05633 /////////////////////////////////////////////////////////////////////
05634 // CDropObject::~CDropObject
05635 //
05636 /////////////////////////////////////////////////////////////////////
05637 CDropObject::~CDropObject()
05638 {
05639 }
05640
05641
05642 /////////////////////////////////////////////////////////////////
05643 // CDropObject::AddRef
05644 //
05645 /////////////////////////////////////////////////////////////////
05646 STDMETHODIMP_(ULONG)  CDropObject::AddRef()
05647 {
05648   //AddRef
05649   return ++m_cRef;
05650 }
05651
05652
05653 /////////////////////////////////////////////////////////////////
05654 // CDropObject::Release
05655 //
05656 /////////////////////////////////////////////////////////////////
05657 STDMETHODIMP_(ULONG)  CDropObject::Release()
05658 {
05659   //Release
05660   if(--m_cRef)
05661     return m_cRef;
05662
05663   delete this;
05664   return 0;
05665 }
05666
05667 /////////////////////////////////////////////////////////////////
05668 // CDropObject::QueryInterface
05669 //
05670 /////////////////////////////////////////////////////////////////
05671 STDMETHODIMP  CDropObject::QueryInterface(REFIID riid, LPVOID *ppv)
05672 {
05673   if(!ppv)
05674     return E_INVALIDARG;
05675   *ppv = NULL;
05676
05677   //IUNKNOWN
05678   if(riid == IID_IUnknown)
05679     *ppv = this;
05680   else if(riid == IID_IDataObject)
05681     *ppv = (IDataObject*)this;
05682
05683   if(*ppv)
05684   {
05685     ((IUnknown*)(*ppv))->AddRef();
05686     return S_OK;
05687   }
05688
05689   return E_NOINTERFACE;
05690 }
05691
05692
05693 /////////////////////////////////////////////////////////////////
05694 // CDropObject::GetData
05695 //
05696 /////////////////////////////////////////////////////////////////
05697 STDMETHODIMP  CDropObject::GetData(FORMATETC* pformatetcIn, STGMEDIUM* pmedium)
05698 {
05699   return E_NOTIMPL;
05700 }
05701
05702
05703 /////////////////////////////////////////////////////////////////
05704 // CDropObject::GetDataHere
05705 //
05706 /////////////////////////////////////////////////////////////////
05707 STDMETHODIMP  CDropObject::GetDataHere(FORMATETC* pformatetc, STGMEDIUM* pmedium)
05708 {
05709   return E_NOTIMPL;
05710 }
05711
05712
05713 /////////////////////////////////////////////////////////////////
05714 // CDropObject::QueryGetData
05715 //
05716 /////////////////////////////////////////////////////////////////
05717 STDMETHODIMP  CDropObject::QueryGetData(FORMATETC* pformatetc)
05718 {
05719   return E_NOTIMPL;
05720 }
05721
05722 /////////////////////////////////////////////////////////////////
05723 // CDropObject::GetCanonicalFormatEtc
05724 //
05725 /////////////////////////////////////////////////////////////////
05726 STDMETHODIMP  CDropObject::GetCanonicalFormatEtc(FORMATETC* pformatectIn, FORMATETC* pformatetcOut)
05727 {
05728   return E_NOTIMPL;
05729 }
05730
05731 /////////////////////////////////////////////////////////////////
05732 // CDropObject::SetData
05733 //
05734 /////////////////////////////////////////////////////////////////
05735 STDMETHODIMP  CDropObject::SetData(FORMATETC* pformatetc, STGMEDIUM* pmedium, BOOL fRelease)
05736 {
05737   return E_NOTIMPL;
05738 }
05739
05740 /////////////////////////////////////////////////////////////////
05741 // CDropObject::EnumFormatEtc
05742 //
05743 /////////////////////////////////////////////////////////////////
05744 STDMETHODIMP  CDropObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc)
05745 {
05746   return E_NOTIMPL;
05747 }
05748
05749 /////////////////////////////////////////////////////////////////
05750 // CDropObject::DAdvise
05751 //
05752 /////////////////////////////////////////////////////////////////
05753 STDMETHODIMP  CDropObject::DAdvise(FORMATETC* pformatetc, DWORD advf, IAdviseSink* pAdvSink, DWORD* pdwConnection)
05754 {
05755   return E_NOTIMPL;
05756 }
05757
05758
05759 /////////////////////////////////////////////////////////////////
05760 // CDropObject::DUnadvise
05761 //
05762 /////////////////////////////////////////////////////////////////
05763 STDMETHODIMP  CDropObject::DUnadvise(DWORD dwConnection)
05764 {
05765   return E_NOTIMPL;
05766 }
05767
05768
05769 /////////////////////////////////////////////////////////////////
05770 // CDropObject::EnumDAdvise
05771 //
05772 /////////////////////////////////////////////////////////////////
05773 STDMETHODIMP  CDropObject::EnumDAdvise(IEnumSTATDATA** ppenumAdvise)
05774 {
05775   return E_NOTIMPL;
05776 }
05777
05778
05779
05780 /////////////////////////////////////////////////////////////////////
05781 // CDropSource::CDropSource
05782 //
05783 /////////////////////////////////////////////////////////////////////
05784 CDropSource::CDropSource()
05785 {
05786   //IUnknown
05787   m_cRef = 0;
05788 }
05789
05790
05791 /////////////////////////////////////////////////////////////////////
05792 // CDropSource::~CDropSource
05793 //
05794 /////////////////////////////////////////////////////////////////////
05795 CDropSource::~CDropSource()
05796 {
05797 }
05798
05799
05800 /////////////////////////////////////////////////////////////////
05801 // CDropSource::AddRef
05802 //
05803 /////////////////////////////////////////////////////////////////
05804 STDMETHODIMP_(ULONG)  CDropSource::AddRef()
05805 {
05806   //AddRef
05807   return ++m_cRef;
05808 }
05809
05810
05811 /////////////////////////////////////////////////////////////////
05812 // CDropSource::Release
05813 //
05814 /////////////////////////////////////////////////////////////////
05815 STDMETHODIMP_(ULONG)  CDropSource::Release()
05816 {
05817   //Release
05818   if(--m_cRef)
05819     return m_cRef;
05820
05821   delete this;
05822   return 0;
05823 }
05824
05825 /////////////////////////////////////////////////////////////////
05826 // CDropSource::QueryInterface
05827 //
05828 /////////////////////////////////////////////////////////////////
05829 STDMETHODIMP  CDropSource::QueryInterface(REFIID riid, LPVOID *ppv)
05830 {
05831   if(!ppv)
05832     return E_INVALIDARG;
05833   *ppv = NULL;
05834
05835   //IUNKNOWN
05836   if(riid == IID_IUnknown)
05837     *ppv = this;
05838   else if(riid == IID_IDropSource)
05839     *ppv = (IDropSource*)this;
05840
05841   if(*ppv)
05842   {
05843     ((IUnknown*)(*ppv))->AddRef();
05844     return S_OK;
05845   }
05846
05847   return E_NOINTERFACE;
05848 }
05849
05850
05851 /////////////////////////////////////////////////////////////////
05852 // CDropSource::QueryContinueDrag
05853 //
05854 /////////////////////////////////////////////////////////////////
05855 STDMETHODIMP  CDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
05856 {
05857   return E_NOTIMPL;
05858 }
05859
05860
05861 /////////////////////////////////////////////////////////////////
05862 // CDropSource::GiveFeedback
05863 //
05864 /////////////////////////////////////////////////////////////////
05865 STDMETHODIMP  CDropSource::GiveFeedback(DWORD dwEffect)
05866 {
05867   return E_NOTIMPL;
05868 }
05869
05870
05871
05872
05873 /////////////////////////////////////////////////////////////////////
05874 // CDropTarget::CDropTarget
05875 //
05876 /////////////////////////////////////////////////////////////////////
05877 CDropTarget::CDropTarget()
05878 {
05879   //IUnknown
05880   m_cRef = 0;
05881 }
05882
05883
05884 /////////////////////////////////////////////////////////////////////
05885 // CDropTarget::~CDropTarget
05886 //
05887 /////////////////////////////////////////////////////////////////////
05888 CDropTarget::~CDropTarget()
05889 {
05890 }
05891
05892
05893 /////////////////////////////////////////////////////////////////
05894 // CDropTarget::AddRef
05895 //
05896 /////////////////////////////////////////////////////////////////
05897 STDMETHODIMP_(ULONG)  CDropTarget::AddRef()
05898 {
05899   //AddRef
05900   return ++m_cRef;
05901 }
05902
05903
05904 /////////////////////////////////////////////////////////////////
05905 // CDropTarget::Release
05906 //
05907 /////////////////////////////////////////////////////////////////
05908 STDMETHODIMP_(ULONG)  CDropTarget::Release()
05909 {
05910   //Release
05911   if(--m_cRef)
05912     return m_cRef;
05913
05914   delete this;
05915   return 0;
05916 }
05917
05918 /////////////////////////////////////////////////////////////////
05919 // CDropTarget::QueryInterface
05920 //
05921 /////////////////////////////////////////////////////////////////
05922 STDMETHODIMP  CDropTarget::QueryInterface(REFIID riid, LPVOID *ppv)
05923 {
05924   if(!ppv)
05925     return E_INVALIDARG;
05926   *ppv = NULL;
05927
05928   //IUNKNOWN
05929   if(riid == IID_IUnknown)
05930     *ppv = this;
05931   else if(riid == IID_IDropTarget)
05932     *ppv = (IDropTarget*)this;
05933
05934   if(*ppv)
05935   {
05936     ((IUnknown*)(*ppv))->AddRef();
05937     return S_OK;
05938   }
05939
05940   return E_NOINTERFACE;
05941 }
05942
05943
05944 /////////////////////////////////////////////////////////////////
05945 // CDropTarget::DragEnter
05946 //
05947 /////////////////////////////////////////////////////////////////
05948 STDMETHODIMP  CDropTarget::DragEnter(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
05949 {
05950   ASSERT(pDataObj);
05951   ASSERT(pdwEffect);
05952   *pdwEffect = DROPEFFECT_COPY;
05953   return S_OK;
05954 }
05955
05956
05957 /////////////////////////////////////////////////////////////////
05958 // CDropTarget::DragOver
05959 //
05960 /////////////////////////////////////////////////////////////////
05961 STDMETHODIMP  CDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
05962 {
05963   ASSERT(pdwEffect);
05964   *pdwEffect = DROPEFFECT_COPY;
05965   return S_OK;
05966 }
05967
05968
05969 /////////////////////////////////////////////////////////////////
05970 // CDropTarget::DragLeave
05971 //
05972 /////////////////////////////////////////////////////////////////
05973 STDMETHODIMP  CDropTarget::DragLeave()
05974 {
05975   return S_OK;
05976 }
05977
05978
05979 /////////////////////////////////////////////////////////////////
05980 // CDropTarget::Drop
05981 //
05982 /////////////////////////////////////////////////////////////////
05983 STDMETHODIMP  CDropTarget::Drop(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
05984 {
05985   ASSERT(pdwEffect);
05986   ASSERT(pDataObj);
05987   *pdwEffect = DROPEFFECT_COPY;
05988   HRESULT hr = S_OK;
05989
05990   //FORMATC structure
05991   FORMATETC DataFormat =
05992     {
05993     CF_HDROP,
05994     NULL,
05995     DVASPECT_CONTENT,
05996     -1,
05997     TYMED_HGLOBAL
05998     };
05999
06000   //STGMEDIUM Structure
06001   STGMEDIUM Medium;
06002   memset(&Medium, 0, sizeof(STGMEDIUM));
06003
06004   //NOTE: If your only dealing with Dragging and Dropping Files
06005   //you can more simply just use WM_DROPFILES instead of implementing
06006   //this interface setting everything up, etc...
06007
06008   //Obtain the Data...
06009   if(SUCCEEDED(hr = pDataObj->GetData(&DataFormat, &Medium)))
06010   {
06011     HDROP hDrop = (HDROP)Medium.hGlobal;
06012
06013     //Obtain the number of files...
06014     UINT cFiles = DragQueryFile(hDrop, (UINT)-1, NULL, 0);
06015
06016     //For every file...
06017     for(ULONG iFile=0; iFile<cFiles; iFile++)
06018     {
06019       CHAR szFileName[_MAX_PATH];
06020
06021       DragQueryFile(hDrop, iFile, szFileName, NUMELE(szFileName));
06022       wMessageBox(GetFocus(), MB_TASKMODAL | MB_ICONERROR | MB_OK,
06023         wsz_INFO, L"File %d: %S", iFile+1, szFileName);
06024     }
06025   }
06026
06027 //CLEANUP:
06028   return hr;
06029 }
Generated on Wed Nov 13 2024 16:52:06 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/dlldata.c Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

dlldata.c

Go to the documentation of this file.
00001 /*********************************************************
00002    DllData file -- generated by MIDL compiler
00003
00004         DO NOT ALTER THIS FILE
00005
00006    This file is regenerated by MIDL on every IDL file compile.
00007
00008    To completely reconstruct this file, delete it and rerun MIDL
00009    on all the IDL files in this DLL, specifying this file for the
00010    /dlldata command line option
00011
00012 *********************************************************/
00013
00014
00015 #include <rpcproxy.h>
00016
00017 #ifdef __cplusplus
00018 extern "C"   {
00019 #endif
00020
00021 EXTERN_PROXY_FILE( upnphost )
00022
00023
00024 PROXYFILE_LIST_START
00025 /* Start of list */
00026   REFERENCE_PROXY_FILE( upnphost ),
00027 /* End of list */
00028 PROXYFILE_LIST_END
00029
00030
00031 DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
00032
00033 #ifdef __cplusplus
00034 }  /*extern "C" */
00035 #endif
00036
00037 /* end of generated dlldata file */
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMain Member List

This is the complete list of members for CMain, including all inherited members.
CMain() | CMain | [inline]
e_compType | CMain | [private]
eCOMPlus enum value | CMain | [private]
eFree enum value | CMain | [private]
eSTA enum value | CMain | [private]
IDD enum value | CMain |
m_bStop | CMain | [private]
m_curThreadCount | CMain | [private]
m_dwMaxTime | CMain | [private]
m_dwMinTime | CMain | [private]
m_dwTotalIters | CMain | [private]
m_dwTotalTime | CMain | [private]
m_iCookie | CMain | [private]
m_iIters | CMain | [private]
OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CMain | [inline]
OnClickedRadio_COMPlusSync(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CMain | [inline]
OnClickedRadio_Free(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CMain | [inline]
OnClickedRadio_STA(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CMain | [inline]
OnClickedStart(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled) | CMain |
OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CMain |
OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CMain | [inline]
OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) | CMain |
ThreadStart(LPVOID lp) | CMain | [static]
UpdateCounters(DWORD lDelta) | CMain |
UpdateUI(void) | CMain |
~CMain() | CMain | [inline]
Generated on Wed Nov 13 2024 16:56:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/Browser/EditCommands/resource.h Source File

  • Web
  • Browser
  • EditCommands

resource.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Microsoft Corporation.  All rights reserved.
00003  */
00004
00005 //{{NO_DEPENDENCIES}}
00006 // Microsoft Developer Studio generated include file.
00007 // Used by EdCommands.rc
00008 //
00009 #define IDS_PROJNAME                    100
00010 #define IDR_EdCommands                  100
00011 #define IDR_BROWSERHOST                 101
00012 #define ID_TOPBAND                      32782
00013 #define ID_LEFTBAND                     32784
00014 #define ID_BUTTON1                      32786
00015 #define ID_BUTTON2                      32788
00016 #define ID_BUTTON3                      32790
00017 #define ID_BUTTON4                      32792
00018 #define ID_BUTTON5                      32794
00019 #define ID_BUTTON6                      32796
00020 #define ID_BUTTON7                      32798
00021 #define ID_BOX1                         32800
00022 #define ID_BOX2                         32802
00023 #define ID_BOX3                         32804
00024 #define ID_BOX4                         32806
00025 #define ID_ADDRESSBOX                   32808
00026 #define ID_CHECKBOX                     32810
00027
00028 // Next default values for new objects
00029 //
00030 #ifdef APSTUDIO_INVOKED
00031 #ifndef APSTUDIO_READONLY_SYMBOLS
00032 #define _APS_NEXT_RESOURCE_VALUE        201
00033 #define _APS_NEXT_COMMAND_VALUE         32768
00034 #define _APS_NEXT_CONTROL_VALUE         201
00035 #define _APS_NEXT_SYMED_VALUE           104
00036 #endif
00037 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/IMEApps/IMEApps.c Source File

  • WinUI
  • Input
  • Ime
  • IMEApps

IMEApps.c

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      IMEAPPS.C                                                     */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation                */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <commdlg.h>
00011 #include <commctrl.h>
00012 #include <imm.h>
00013 #include "resource.h"
00014 #include "imeapps.h"
00015
00016
00017 /**********************************************************************/
00018 /*                                                                    */
00019 /*    WinMain(HINSTANCE, HINSTANCE, LPSTR, int)                       */
00020 /*                                                                    */
00021 /**********************************************************************/
00022 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
00023 {
00024     MSG msg = {0};
00025     BOOL bRet = FALSE;
00026     BOOL bSuccess = TRUE;
00027
00028     if (!InitApplication(hInstance))
00029     {
00030         bSuccess = FALSE;
00031         goto exit_func;
00032     }
00033
00034     if (!InitInstance(hInstance, nCmdShow))
00035     {
00036         bSuccess = FALSE;
00037         goto exit_func;
00038     }
00039
00040
00041     while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
00042     {
00043         if (bRet == -1)
00044         {
00045             bSuccess = FALSE;
00046             goto exit_func;
00047         }
00048         else
00049         {
00050             TranslateMessage(&msg);
00051             DispatchMessage(&msg);
00052         }
00053     }
00054
00055 exit_func:
00056     if (bSuccess)
00057     {
00058         return (int)(msg.wParam);
00059     }
00060     else
00061     {
00062         return 0;
00063     }
00064 }
00065
00066 /**********************************************************************/
00067 /*                                                                    */
00068 /*    InitApplication(HANDLE)                                         */
00069 /*                                                                    */
00070 /**********************************************************************/
00071 BOOL InitApplication(HANDLE hInstance)
00072 {
00073     WNDCLASS  wc = {0};
00074     BOOL bSuccess = TRUE;
00075
00076     wc.style         = CS_HREDRAW | CS_VREDRAW;
00077     wc.lpfnWndProc   = MainWndProc;
00078     wc.cbClsExtra    = 0;
00079     wc.cbWndExtra    = 0;
00080     wc.hInstance     = hInstance;
00081     wc.hIcon         = LoadIcon(hInstance,"MyIcon");
00082     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00083     wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
00084     wc.lpszMenuName  = "ImeAppsMenu";
00085     wc.lpszClassName = "ImeAppsWClass";
00086
00087     if (! RegisterClass (&wc))
00088     {
00089         bSuccess = FALSE;
00090         goto exit_func;
00091     }
00092
00093     wc.style         = CS_HREDRAW | CS_VREDRAW;
00094     wc.lpfnWndProc   = CompStrWndProc;
00095     wc.cbClsExtra    = 0;
00096     wc.cbWndExtra    = 4;
00097     wc.hInstance     = hInstance;
00098     wc.hIcon         = NULL;
00099     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00100     wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
00101     wc.lpszMenuName  = NULL;
00102     wc.lpszClassName = "CompStrWndClass";
00103
00104     if (! RegisterClass (&wc))
00105     {
00106         bSuccess = FALSE;
00107         goto exit_func;
00108     }
00109
00110     wc.style         = CS_HREDRAW | CS_VREDRAW;
00111     wc.lpfnWndProc   = CandListWndProc;
00112     wc.cbClsExtra    = 0;
00113     wc.cbWndExtra    = 0;
00114     wc.hInstance     = hInstance;
00115     wc.hIcon         = NULL;
00116     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
00117     wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
00118     wc.lpszMenuName  = NULL;
00119     wc.lpszClassName = "CandListWndClass";
00120
00121     if (! RegisterClass (&wc))
00122     {
00123         bSuccess = FALSE;
00124         goto exit_func;
00125     }
00126
00127     hFont = GetStockObject(DEFAULT_GUI_FONT);
00128
00129 exit_func:
00130     return bSuccess;
00131 }
00132
00133 /**********************************************************************/
00134 /*                                                                    */
00135 /*    InitInstance(HANDLE, int)                                       */
00136 /*                                                                    */
00137 /**********************************************************************/
00138 BOOL InitInstance(HANDLE hInstance, INT nCmdShow)
00139 {
00140 #ifdef USEWAPI
00141     char szTitle[] =  "ImeApps W API version";
00142 #else
00143     char szTitle[] =  "ImeApps";
00144 #endif
00145
00146     hInst = hInstance;
00147
00148
00149     ptImeUIPos.x = 0;
00150     ptImeUIPos.y = 0;
00151
00152     if (!(hWndMain = CreateWindowEx(0L,
00153                                     "ImeAppsWClass", (LPSTR)szTitle,
00154                                     WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
00155                                     CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
00156                                   NULL, NULL, hInstance, NULL)))
00157     {
00158       return FALSE;
00159     }
00160
00161     /* display each windows */
00162     ShowWindow (hWndMain, nCmdShow);
00163     UpdateWindow (hWndMain);
00164
00165     return TRUE;
00166 }
00167
00168 /**********************************************************************/
00169 /*                                                                    */
00170 /*    InitIMEUIPosition(HWND)                                         */
00171 /*                                                                    */
00172 /**********************************************************************/
00173 void InitIMEUIPosition(HWND hWnd)
00174 {
00175     HDC hDC = NULL;
00176     int y;
00177     SIZE sz;
00178     HFONT hOldFont = NULL;
00179     HFONT hDefFont = NULL;
00180     int height, defheight;
00181
00182     hDefFont = GetStockObject(DEFAULT_GUI_FONT);
00183
00184     hOldFont = NULL;
00185
00186     y = ORG_Y;
00187
00188     hDC = GetDC(hWnd);
00189
00190     if (hFont)
00191     {
00192         hOldFont = SelectObject(hDC,hDefFont);
00193     }
00194
00195
00196     // Get the height of the default gui font.
00197     GetTextExtentPoint(hDC,"A",1,&sz);
00198     defheight = sz.cy + 1;
00199
00200     // Get the height of the font.
00201     SelectObject(hDC,hFont);
00202     GetTextExtentPoint(hDC,"A",1,&sz);
00203     height = sz.cy + 1;
00204
00205     SelectObject(hDC,hDefFont);
00206     y += defheight;
00207
00208     y += height;
00209
00210     y += height;
00211
00212     y += defheight;
00213
00214     y += height;
00215
00216     y += height;
00217
00218     ptImeUIPos.y = y;
00219
00220     SelectObject(hDC,hOldFont);
00221     ReleaseDC(hWnd, hDC);
00222
00223     return;
00224 }
00225
00226 /**********************************************************************/
00227 /*                                                                    */
00228 /*    MainWndProc(HWND, UINT, WPARAM, LPARAM)                         */
00229 /*                                                                    */
00230 /**********************************************************************/
00231 LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00232 {
00233     FARPROC lpProc = NULL;
00234     RECT rect      = {0};
00235     HMENU hMenu    = NULL;
00236     HIMC hIMC      = NULL;
00237     BOOL fOpen     = FALSE;
00238
00239     switch (message)
00240     {
00241         case WM_CREATE:
00242
00243             // Create Status Window
00244             CreateTBar(hWnd);
00245             CreateStatus(hWnd);
00246
00247             // Create Child Window
00248             GetClientRect(hWnd, &rect);
00249             if (!(hWndCompStr = CreateWindowEx(WS_EX_CLIENTEDGE,
00250               "CompStrWndClass", NULL,
00251               WS_CHILD | WS_VISIBLE,
00252               // 0, 0, rect.right, rect.bottom - nStatusHeight,
00253               0, 0, 0, 0,
00254               hWnd, NULL, hInst, NULL)))
00255           return FALSE;
00256
00257
00258             InitIMEUIPosition(hWndCompStr);
00259
00260
00261             if (!(hWndCandList = CreateWindowEx(WS_EX_CLIENTEDGE,
00262               "CandListWndClass", NULL,
00263               WS_CHILD | WS_VISIBLE,
00264               0, 0, 0, 0,
00265               hWnd, NULL, hInst, NULL)))
00266           return FALSE;
00267
00268             ShowWindow(hWndCompStr, SW_SHOW);
00269             ShowWindow(hWndCandList, SW_SHOWNA);
00270
00271             SetStatusItems(hWnd);
00272
00273             hMenu = GetMenu(hWnd);
00274             CheckMenuItem(hMenu,IDM_SHOWCAND,
00275                                 (fShowCand ? MF_CHECKED : MF_UNCHECKED));
00276
00277             break;
00278
00279         case WM_COMMAND:
00280             switch(LOWORD(wParam))
00281             {
00282             case IDM_ABOUT:
00283                 lpProc = MakeProcInstance(AboutDlg, hInst);
00284                 DialogBox(hInst, "ABOUTBOX", hWnd, (DLGPROC)lpProc);
00285                 FreeProcInstance(lpProc);
00286                 break;
00287
00288             case IDM_FONT:
00289                 {
00290                     CHOOSEFONT cf = {0};
00291                     LOGFONT lfT = {0};
00292
00293                     /* Set all structure fields to zero. */
00294
00295                     memset(&cf, 0, sizeof(CHOOSEFONT));
00296                     memcpy(&lfT, &lf, sizeof(LOGFONT));
00297
00298                     cf.lStructSize = sizeof(CHOOSEFONT);
00299                     cf.hwndOwner = hWnd;
00300                     cf.lpLogFont = &lfT;
00301                     cf.Flags = CF_SCREENFONTS | CF_EFFECTS;
00302                     cf.nFontType = SCREEN_FONTTYPE;
00303
00304                     if (ChooseFont(&cf))
00305                     {
00306                         if (hFont)
00307                         {
00308                             DeleteObject(hFont);
00309                         }
00310
00311                         memcpy(&lf, &lfT, sizeof(LOGFONT));
00312                         hFont = CreateFontIndirect(&lf);
00313                         InvalidateRect(hWndCompStr,NULL,TRUE);
00314                         UpdateWindow(hWndCompStr);
00315                     }
00316                 }
00317                 break;
00318
00319
00320                 case IDM_SHOWCAND:
00321                     hMenu = GetMenu(hWnd);
00322                     fShowCand = !fShowCand;
00323                     CheckMenuItem(hMenu,IDM_SHOWCAND,
00324                                 (fShowCand ? MF_CHECKED : MF_UNCHECKED));
00325                     MoveCompCandWindow(hWnd);
00326                     UpdateShowCandButton();
00327                     break;
00328
00329                 case IDM_OPENSTATUS:
00330                     hIMC = ImmGetContext(hWndCompStr);
00331                     fOpen = ImmGetOpenStatus(hIMC);
00332                     ImmSetOpenStatus(hIMC,!fOpen);
00333                     UpdateShowOpenStatusButton(!fOpen);
00334                     ImmReleaseContext(hWndCompStr,hIMC);
00335
00336                     hMenu = GetMenu(hWnd);
00337                     CheckMenuItem(hMenu,IDM_OPENSTATUS,
00338                                 (fOpen ? MF_UNCHECKED : MF_CHECKED));
00339                     break;
00340
00341                 case IDM_NATIVEMODE: /* fall-through */
00342                 case IDM_FULLHALF:   /* fall-through */
00343                 case IDM_ROMAN:      /* fall-through */
00344                 case IDM_CHARCODE:   /* fall-through */
00345                 case IDM_HANJA:      /* fall-through */
00346                 case IDM_SOFTKBD:    /* fall-through */
00347                 case IDM_EUDC:       /* fall-through */
00348                 case IDM_SYMBOL:
00349                     HandleModeCommand(hWnd,wParam,lParam);
00350                     break;
00351
00352                 case IDM_CONVERT:    /* fall-through */
00353                 case IDM_CANCEL:     /* fall-through */
00354                 case IDM_REVERT:     /* fall-through */
00355                 case IDM_COMPLETE:   /* fall-through */
00356                 case IDM_OPENCAND:   /* fall-through */
00357                 case IDM_CLOSECAND:  /* fall-through */
00358                 case IDM_NEXTCAND:   /* fall-through */
00359                 case IDM_PREVCAND:
00360                     HandleConvertCommand(hWnd,wParam,lParam);
00361                     break;
00362
00363                 case IDM_NEXTCLAUSE: /* fall-through */
00364                 case IDM_PREVCLAUSE:
00365                     HandleChangeAttr(hWnd,(LOWORD(wParam) == IDM_NEXTCLAUSE));
00366                     break;
00367
00368                 default:
00369                     break;
00370             }
00371             break;
00372
00373         case WM_SETFOCUS:
00374             SetFocus(hWndCompStr);
00375             break;
00376
00377         case WM_NOTIFY:
00378             SetTooltipText(hWnd, lParam);
00379             break;
00380
00381         case WM_SIZE:
00382             SendMessage(hWndStatus,message,wParam,lParam);
00383             SendMessage(hWndToolBar,message,wParam,lParam);
00384
00385             if (wParam != SIZE_MINIMIZED)
00386             {
00387                 MoveCompCandWindow(hWnd);
00388             }
00389             break;
00390
00391         case WM_IME_NOTIFY:
00392             switch (wParam)
00393             {
00394                 case IMN_OPENSTATUSWINDOW:  /* fall-through */
00395                 case IMN_CLOSESTATUSWINDOW:
00396                     break;
00397
00398                 case IMN_SETCONVERSIONMODE:
00399                     return (DefWindowProc(hWnd, message, wParam, lParam));
00400             }
00401             break;
00402
00403
00404         case WM_DESTROY:
00405             if (hFont)
00406             {
00407                 DeleteObject(hFont);
00408             }
00409             PostQuitMessage(0);
00410             break;
00411
00412         default:
00413             return (DefWindowProc(hWnd, message, wParam, lParam));
00414     }
00415     return 0L;
00416 }
00417 /**********************************************************************/
00418 /*                                                                    */
00419 /*    CompStrWndProc(HWND, UINT, WPARAM, LPARAM)                      */
00420 /*                                                                    */
00421 /**********************************************************************/
00422 LRESULT CALLBACK CompStrWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00423 {
00424     HIMC hIMC    = NULL;
00425     HIMC hOldIMC = NULL;
00426
00427     switch (message)
00428     {
00429         case WM_CREATE:
00430             hIMC = ImmCreateContext();
00431             hOldIMC = ImmAssociateContext(hWnd,hIMC);
00432             SetWindowLongPtr(hWnd, 0, (LONG_PTR)hOldIMC);
00433             fdwProperty = ImmGetProperty(GetKeyboardLayout(0), IGP_PROPERTY);
00434             break;
00435
00436         case WM_CHAR:
00437             HandleChar(hWnd,wParam,lParam);
00438             break;
00439
00440         case WM_LBUTTONUP:  /* fall-through */
00441         case WM_RBUTTONUP:
00442             if (hIMC = ImmGetContext(hWnd))
00443             {
00444                 HMENU hMenu = NULL;
00445
00446                 InitMenuItemIDTable();
00447                 hMenu = CreateImeMenu(hWnd, hIMC, NULL,(message == WM_RBUTTONUP));
00448
00449                 if (hMenu)
00450                 {
00451                     DWORD dwItemData;
00452                     DWORD dwPos = (DWORD)GetMessagePos();
00453                     int nCmd;
00454
00455                     nCmd = TrackPopupMenuEx(hMenu,
00456                                             TPM_RETURNCMD | TPM_NONOTIFY |
00457                                             TPM_LEFTBUTTON | TPM_LEFTALIGN | TPM_TOPALIGN,
00458                                             LOWORD(dwPos), HIWORD(dwPos),
00459                                             hWnd, NULL);
00460
00461                     if (nCmd)
00462                     {
00463                         nCmd -= IDM_STARTIMEMENU;
00464                         dwItemData = FindItemData(nCmd);
00465                         ImmNotifyIME(hIMC, NI_IMEMENUSELECTED, nCmd, dwItemData);
00466                     }
00467                 }
00468                 EndMenuItemIDTable();
00469
00470                 DestroyMenu(hMenu);
00471             }
00472             break;
00473
00474         case WM_IME_SETCONTEXT:
00475             if (fShowCand)
00476             {
00477                 lParam &= ~ISC_SHOWUICANDIDATEWINDOW;
00478             }
00479
00480             if (fdwProperty & IME_PROP_SPECIAL_UI)
00481             {
00482                 // EMPTY
00483             }
00484             else if (fdwProperty & IME_PROP_AT_CARET)
00485             {
00486                 lParam &= ~ISC_SHOWUICOMPOSITIONWINDOW;
00487             }
00488             else
00489             {
00490                 // EMPTY
00491             }
00492
00493             return (DefWindowProc(hWnd, message, wParam, lParam));
00494
00495         case WM_IME_STARTCOMPOSITION:
00496             // Normally, we should not call into HandleStartComposition
00497             // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
00498             // we should pass this message to DefWindowProc directly for
00499             // this kind of IMEs
00500
00501             HandleStartComposition(hWnd,wParam,lParam);
00502
00503             // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
00504             // and not IME_PROP_AT_CARET IMEs
00505
00506             if (fdwProperty & IME_PROP_SPECIAL_UI)
00507             {
00508                 return (DefWindowProc(hWnd, message, wParam, lParam));
00509             }
00510             else if (fdwProperty & IME_PROP_AT_CARET)
00511             {
00512                 // EMPTY
00513             }
00514             else
00515             {
00516                 return (DefWindowProc(hWnd, message, wParam, lParam));
00517             }
00518
00519             break;
00520
00521         case WM_IME_ENDCOMPOSITION:
00522             // Normally, we should not call into HandleEndComposition
00523             // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
00524             // we should pass this message to DefWindowProc directly for
00525             // this kind of IMEs
00526
00527             HandleEndComposition(hWnd,wParam,lParam);
00528
00529             // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
00530             // and not IME_PROP_AT_CARET IMEs
00531
00532             if (fdwProperty & IME_PROP_SPECIAL_UI)
00533             {
00534                 return (DefWindowProc(hWnd, message, wParam, lParam));
00535             }
00536             else if (fdwProperty & IME_PROP_AT_CARET)
00537             {
00538                 // EMPTY
00539             }
00540             else
00541             {
00542                 return (DefWindowProc(hWnd, message, wParam, lParam));
00543             }
00544             break;
00545
00546         case WM_IME_COMPOSITION:
00547             // Normally, we should not call into HandleComposition
00548             // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
00549             // we should pass this message to DefWindowProc directly for
00550             // this kind of IMEs
00551
00552             HandleComposition(hWnd,wParam,lParam);
00553
00554             // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
00555             // and not IME_PROP_AT_CARET IMEs
00556
00557             if (fdwProperty & IME_PROP_SPECIAL_UI)
00558             {
00559                 return (DefWindowProc(hWnd, message, wParam, lParam));
00560             }
00561             else if (fdwProperty & IME_PROP_AT_CARET)
00562             {
00563                 // EMPTY
00564             }
00565             else
00566             {
00567                 return (DefWindowProc(hWnd, message, wParam, lParam));
00568             }
00569             break;
00570
00571         case WM_PAINT:
00572             HandlePaint(hWnd,wParam,lParam);
00573             break;
00574
00575         case WM_IME_NOTIFY:
00576             {
00577                 LRESULT lRet;
00578
00579                 // Normally, we should not call into HandleNotify
00580                 // for IME_PROP_SPECIAL_UI and not IME_PROP_AT_CARET IMEs
00581                 // we should pass this message to DefWindowProc directly for
00582                 // this kind of IMEs
00583
00584                 lRet = HandleNotify(hWnd, message, wParam, lParam);
00585
00586                 // pass this message to DefWindowProc for IME_PROP_SPECIAL_UI
00587                 // and not IME_PROP_AT_CARET IMEs
00588
00589                 if (fdwProperty & IME_PROP_SPECIAL_UI)
00590                 {
00591                     return (DefWindowProc(hWnd, message, wParam, lParam));
00592                 }
00593                 else if (fdwProperty & IME_PROP_AT_CARET)
00594                 {
00595                     // EMPTY
00596                 }
00597                 else
00598                 {
00599                     return (DefWindowProc(hWnd, message, wParam, lParam));
00600                 }
00601
00602                 return lRet;
00603             }
00604
00605         case WM_DESTROY:
00606             hOldIMC = (HIMC)GetWindowLongPtr(hWnd, 0);
00607             hIMC = ImmAssociateContext(hWnd, hOldIMC);
00608             ImmDestroyContext(hIMC);
00609             break;
00610
00611         case WM_INPUTLANGCHANGE:
00612             fdwProperty = ImmGetProperty(GetKeyboardLayout(0), IGP_PROPERTY);
00613
00614             if (hIMC = ImmGetContext(hWnd))
00615             {
00616                 CANDIDATEFORM cdf = {0};
00617
00618                 if (fdwProperty & IME_PROP_AT_CARET)
00619                 {
00620                     cdf.dwIndex = 0;
00621                     cdf.dwStyle = CFS_CANDIDATEPOS;
00622                     cdf.ptCurrentPos.x = ptImeUIPos.x;
00623                     cdf.ptCurrentPos.y = ptImeUIPos.y;
00624                     ImmSetCandidateWindow(hIMC, &cdf);
00625                 }
00626                 else
00627                 {
00628                     UINT i;
00629
00630                     // The candidate position should be decided by a near caret
00631                     // IME. There are 4 candidate form in the input context
00632
00633                     for (i = 0; i < 4; i++)
00634                     {
00635                         if (!ImmGetCandidateWindow(hIMC, i, &cdf))
00636                         {
00637                             continue;
00638                         }
00639
00640                         if (cdf.dwStyle == CFS_DEFAULT)
00641                         {
00642                             continue;
00643                         }
00644
00645                         cdf.dwStyle = CFS_DEFAULT;
00646
00647                         ImmSetCandidateWindow(hIMC, &cdf);
00648                     }
00649
00650                 }
00651
00652                 ImmReleaseContext(hWnd, hIMC);
00653             }
00654
00655             return (DefWindowProc(hWnd, message, wParam, lParam));
00656
00657         default:
00658           return (DefWindowProc(hWnd, message, wParam, lParam));
00659     }
00660     return 0L;
00661 }
00662
00663
00664 /**********************************************************************/
00665 /*                                                                    */
00666 /*    CandListWndProc(HWND, UINT, WPARAM, LPARAM)                     */
00667 /*                                                                    */
00668 /**********************************************************************/
00669 LRESULT CALLBACK CandListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
00670 {
00671     switch (message)
00672     {
00673         case WM_PAINT:
00674             HandleCandPaint(hWnd,wParam,lParam);
00675             break;
00676
00677         case WM_SETFOCUS:
00678             SetFocus(hWndCompStr);
00679             break;
00680
00681         default:
00682             return (DefWindowProc(hWnd, message, wParam, lParam));
00683     }
00684     return 0L;
00685 }
00686
00687
00688 /**********************************************************************/
00689 /*                                                                    */
00690 /*    About(HWND, UINT, WPARAM, LPARAM)                               */
00691 /*                                                                    */
00692 /**********************************************************************/
00693 LRESULT CALLBACK AboutDlg(HWND hDlg, unsigned message, WPARAM wParam, LPARAM lParam)
00694 {
00695     switch (message)
00696     {
00697         case WM_INITDIALOG:
00698             return (TRUE);
00699
00700         case WM_COMMAND:
00701             if ((wParam == IDOK) ||
00702                  (wParam == IDCANCEL))
00703             {
00704               EndDialog(hDlg, TRUE);
00705               return (TRUE);
00706             }
00707             break;
00708     }
00709     return (FALSE);
00710 }
00711
00712
00713
00714
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Tools/EntityProxy/DataServices/stdafx.Cpp Source File

  • Com
  • Tools
  • EntityProxy
  • DataServices

stdafx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/cplusplus/proxyplugin.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • cplusplus

proxyplugin.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName:            ProxyPlugin.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011
00012 #include "stdafx.h"
00013 #include "resource.h"
00014 #include <initguid.h>
00015 #include "ProxyPlugin.h"
00016
00017 #include "ProxyPluginImpl.h"
00018
00019
00020 CComModule _Module;
00021
00022 BEGIN_OBJECT_MAP(ObjectMap)
00023 OBJECT_ENTRY(CLSID_ProxyPlugin, CProxyPlugin)
00024 END_OBJECT_MAP()
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // DLL Entry Point
00028
00029 extern "C"
00030 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00031 {
00032     if (dwReason == DLL_PROCESS_ATTACH)
00033     {
00034         _Module.Init(ObjectMap, hInstance, &LIBID_PROXYPLUGINLib);
00035         DisableThreadLibraryCalls(hInstance);
00036     }
00037     else if (dwReason == DLL_PROCESS_DETACH)
00038         _Module.Term();
00039     return TRUE;    // ok
00040 }
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // Used to determine whether the DLL can be unloaded by OLE
00044
00045 STDAPI DllCanUnloadNow(void)
00046 {
00047     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00048 }
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // Returns a class factory to create an object of the requested type
00052
00053 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00054 {
00055     return _Module.GetClassObject(rclsid, riid, ppv);
00056 }
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 // DllRegisterServer - Adds entries to the system registry
00060
00061 STDAPI DllRegisterServer(void)
00062 {
00063     // registers object, typelib and all interfaces in typelib
00064     return _Module.RegisterServer(TRUE);
00065 }
00066
00067 /////////////////////////////////////////////////////////////////////////////
00068 // DllUnregisterServer - Removes entries from the system registry
00069
00070 STDAPI DllUnregisterServer(void)
00071 {
00072     return _Module.UnregisterServer(TRUE);
00073 }
00074
00075
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Extension/tutorial/step1/resource.h Source File

  • NetDS
  • ADSI
  • samples
  • Extension
  • tutorial
  • step1

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ADsFirstExt.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDS_HELLOWORLD_DESC             102
00007 #define IDR_HelloWorld                  103
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NEXT_RESOURCE_VALUE        201
00014 #define _APS_NEXT_COMMAND_VALUE         32768
00015 #define _APS_NEXT_CONTROL_VALUE         201
00016 #define _APS_NEXT_SYMED_VALUE           104
00017 #endif
00018 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/GenericUCP/CPP/stdafx.cpp Source File

  • NetDS
  • upnp
  • GenericUCP
  • CPP

stdafx.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation
00004
00005
00006 --*/
00007 // stdafx.cpp : source file that includes just the standard includes
00008 //  GenericUCP.pch will be the pre-compiled header
00009 //  stdafx.obj will contain the pre-compiled type information
00010
00011 #include "stdafx.h"
00012
00013
00014
00015
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDlgSrc Member List

This is the complete list of members for CDlgSrc, including all inherited members.
AquireData(WAVEFORMATEX *, PVOID, ULONG, UINT) | CDlgSrc |
CDlgSrc(CWnd *) | CDlgSrc |
Create(LPCSTR, SIZE, DWORD) | CDlgSrc |
DoDataExchange(CDataExchange *pDX) | CDlgSrc | [protected, virtual]
IDD enum value | CDlgSrc |
m_butClose | CDlgSrc |
m_butPlay | CDlgSrc |
m_butStop | CDlgSrc |
m_cbData | CDlgSrc |
m_cInput | CDlgSrc |
m_comboSpeaker | CDlgSrc |
m_cSamples | CDlgSrc |
m_dwChannelMask | CDlgSrc |
m_fDragging | CDlgSrc |
m_fPlayable | CDlgSrc |
m_fUse | CDlgSrc |
m_lpwhdr | CDlgSrc |
m_nChannel | CDlgSrc |
m_nSpeaker | CDlgSrc |
m_ptPosInCaption | CDlgSrc |
m_pvData | CDlgSrc |
m_pwndParent | CDlgSrc |
m_strName | CDlgSrc |
m_wfx | CDlgSrc |
OnCancel() | CDlgSrc | [inline, protected, virtual]
OnComboSpeaker() | CDlgSrc | [protected]
OnCtlColor(CDC *, CWnd *, UINT) | CDlgSrc | [protected]
OnInitDialog() | CDlgSrc | [protected, virtual]
OnLButtonDown(UINT, CPoint) | CDlgSrc | [protected]
OnLButtonUp(UINT, CPoint) | CDlgSrc | [protected]
OnMouseMove(UINT, CPoint) | CDlgSrc | [protected]
OnOK() | CDlgSrc | [inline, protected, virtual]
OnPlay() | CDlgSrc | [protected]
OnStop() | CDlgSrc | [inline, protected]
SetChannelNum(UINT) | CDlgSrc | [inline]
WindowProc(UINT, WPARAM, LPARAM) | CDlgSrc | [virtual]
~CDlgSrc(void) | CDlgSrc |
Generated on Wed Nov 13 2024 16:56:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CGdiplusInit Member List

This is the complete list of members for CGdiplusInit, including all inherited members.
CGdiplusInit(Gdiplus::DebugEventProc debugEventCallback=0, BOOL suppressBackgroundThread=FALSE, BOOL suppressExternalCodecs=FALSE) | CGdiplusInit | [inline]
StartupStatus | CGdiplusInit | [private]
Token | CGdiplusInit | [private]
~CGdiplusInit() | CGdiplusInit | [inline]
Generated on Wed Nov 13 2024 16:56:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/First/vc/StdAfx.h Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • First
  • vc

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__450794C0_AC13_11D2_9A6E_0080C7A2DC6B__INCLUDED_)
00007 #define AFX_STDAFX_H__450794C0_AC13_11D2_9A6E_0080C7A2DC6B__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif
00012
00013 // _MSC_VER > 1000
00014
00015
00016
00017 // TODO: reference additional headers your program requires here
00018
00019 //{{AFX_INSERT_LOCATION}}
00020 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00021
00022 #endif // !defined(AFX_STDAFX_H__450794C0_AC13_11D2_9A6E_0080C7A2DC6B__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/BasePage.h Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

BasePage.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      BasePage.h
00007 //
00008 //  Implementation File:
00009 //      BasePage.cpp
00010 //
00011 //  Description:
00012 //      Definition of the CBasePropertyPage class.  This class provides base
00013 //      functionality for extension DLL property pages.
00014 //
00015 //  Author:
00016 //      <name> (<e-mail name>) Mmmm DD, 2003
00017 //
00018 //  Revision History:
00019 //
00020 //  Notes:
00021 //
00022 /////////////////////////////////////////////////////////////////////////////
00023
00024 #pragma once
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // Include Files
00028 /////////////////////////////////////////////////////////////////////////////
00029
00030 #pragma warning( push )
00031 #include <CluAdmEx.h>
00032 #pragma warning( pop )
00033
00034 #include "ExtObj.h"     // for CExtObject
00035 #include "PropList.h"   // for CClusPropList, CObjectProperty
00036
00037 /////////////////////////////////////////////////////////////////////////////
00038 // CBasePropertyPage dialog
00039 /////////////////////////////////////////////////////////////////////////////
00040
00041 class CBasePropertyPage
00042     : public CPropertyPage
00043 {
00044     DECLARE_DYNCREATE( CBasePropertyPage )
00045
00046 //
00047 //  Construction
00048 //
00049
00050 public:
00051     CBasePropertyPage( void );
00052     CBasePropertyPage( UINT nIDTemplateIn, UINT nIDCaptionIn = 0 );
00053
00054     virtual ~CBasePropertyPage( void )
00055     {
00056     } //*** ~CBasePropertyPage
00057
00058     //
00059     //  Second phase construction.
00060     //
00061
00062     virtual HRESULT         HrInit( CExtObject * peoInout );
00063     HRESULT                 HrCreatePage( void );
00064
00065 protected:
00066     void                    CommonConstruct( void );
00067
00068     //
00069     //  Attributes
00070     //
00071     CExtObject *            m_peo;
00072     HPROPSHEETPAGE          m_hpage;
00073
00074     IDD                     m_iddPropertyPage;
00075     IDD                     m_iddWizardPage;
00076     IDS                     m_idsCaption;
00077
00078     CExtObject *            Peo( void ) const               { return m_peo; }
00079
00080     IDD                     IddPropertyPage( void ) const   { return m_iddPropertyPage; }
00081     IDD                     IddWizardPage( void ) const     { return m_iddWizardPage; }
00082     IDS                     IdsCaption( void ) const        { return m_idsCaption; }
00083
00084 public:
00085     HPROPSHEETPAGE          Hpage( void ) const             { return m_hpage; }
00086
00087     CLUADMEX_OBJECT_TYPE    Cot( void ) const
00088     {
00089         ASSERT( Peo() != NULL );
00090         return Peo()->Cot();
00091     }; //*** Cot
00092
00093 //
00094 //  Dialog Data
00095 //
00096
00097     //{{AFX_DATA(CBasePropertyPage)
00098     enum { IDD = 0 };
00099     //}}AFX_DATA
00100     CStatic m_staticIcon;
00101     CStatic m_staticTitle;
00102     CString m_strTitle;
00103
00104 //
00105 //  Overrides
00106 //
00107
00108     // ClassWizard generate virtual function overrides
00109     //{{AFX_VIRTUAL(CBasePropertyPage)
00110     public:
00111     virtual BOOL OnSetActive();
00112     virtual BOOL OnApply();
00113     virtual LRESULT OnWizardBack();
00114     virtual LRESULT OnWizardNext();
00115     virtual BOOL OnWizardFinish();
00116 protected:
00117     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00118     //}}AFX_VIRTUAL
00119
00120     virtual DWORD           ScParseUnknownProperty(
00121                                   LPCWSTR                           pwszNameIn
00122                                 , const CLUSPROP_BUFFER_HELPER &    rvalueIn
00123                                 , DWORD                             cbBufIn
00124                                 )
00125     {
00126         UNREFERENCED_PARAMETER( pwszNameIn );
00127         UNREFERENCED_PARAMETER( rvalueIn );
00128         UNREFERENCED_PARAMETER( cbBufIn );
00129         return ERROR_SUCCESS;
00130
00131     } //*** ScParseUnknownProperty
00132
00133     virtual BOOL            BApplyChanges( void );
00134     virtual BOOL            BBuildPropList( CClusPropList & rcplInout, BOOL fNoNewPropsIn = FALSE );
00135     virtual void            DisplaySetPropsError( DWORD scIn, UINT idsOperIn ) const;
00136
00137     virtual const CObjectProperty * Pprops( void ) const    { return NULL; }
00138     virtual DWORD                   Cprops( void ) const    { return 0; }
00139
00140 //
00141 //  Implementation
00142 //
00143
00144 protected:
00145     BOOL                    m_bBackPressed;
00146     BOOL                    m_bSaved;
00147     BOOL                    m_bDoDetach;
00148
00149     BOOL                    BBackPressed( void ) const      { return m_bBackPressed; }
00150     BOOL                    BSaved( void ) const            { return m_bSaved; }
00151     void                    EnableNext( BOOL fEnableIn = TRUE );
00152     IWCWizardCallback *     PiWizardCallback( void ) const
00153     {
00154         ASSERT( Peo() != NULL );
00155         return Peo()->PiWizardCallback();
00156     }; //*** PiWizardCallback
00157
00158     BOOL                    BWizard( void ) const
00159     {
00160         ASSERT( Peo() != NULL );
00161         return Peo()->BWizard();
00162     }; //*** BWizard
00163
00164     HCLUSTER                Hcluster( void ) const
00165     {
00166         ASSERT( Peo() != NULL );
00167         return Peo()->Hcluster();
00168     }; //*** Hcluster
00169
00170     DWORD                   ScParseProperties( CClusPropList & rcplIn );
00171     BOOL                    BSetPrivateProps(
00172                                   BOOL fValidateOnlyIn = FALSE
00173                                 , BOOL fNoNewPropsIn = FALSE
00174                                 );
00175
00176     //
00177     //  Generated message map functions
00178     //
00179
00180     //{{AFX_MSG(CBasePropertyPage)
00181     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00182     afx_msg void OnDestroy();
00183     virtual BOOL OnInitDialog();
00184     //}}AFX_MSG
00185     afx_msg void OnChangeCtrl();
00186     DECLARE_MESSAGE_MAP()
00187
00188 };  //*** class CBasePropertyPage
00189
00190 /////////////////////////////////////////////////////////////////////////////
00191 // CPageList
00192 /////////////////////////////////////////////////////////////////////////////
00193
00194 typedef CList< CBasePropertyPage *, CBasePropertyPage * > CPageList;
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DiskCleanupHandler/UnRegisterServer.Cpp Source File

  • WinUI
  • Shell
  • DiskCleanupHandler

UnRegisterServer.Cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  UnregisterServer.cpp
00011 //
00012 //      Unregisters the Disk Cleanup Handler.
00013 //
00014 //////////////////////////////////////////////////////////////////////
00015
00016 #include "Cleanup.h"
00017 #include "Resource.h"
00018
00019 extern HINSTANCE hDllInstance;
00020
00021 STDAPI DllUnregisterServer (VOID)
00022 {
00023     HRESULT     hResult     = S_OK;
00024     LRESULT     lResult     = NOERROR;
00025     HKEY        hKey        = NULL;
00026     TCHAR       szClsid[MAX_PATH] = TEXT("");
00027     TCHAR       szSubKey[MAX_PATH] = TEXT("");
00028     TCHAR       szDisplay[MAX_PATH] = TEXT("");
00029     TCHAR       szEmptyVCSubKey[MAX_PATH] = TEXT("");
00030
00031     //
00032     //  Load some necessary string values
00033     //
00034     LoadString (hDllInstance, IDS_CLSID, szClsid, MAX_PATH);
00035     LoadString (hDllInstance, IDS_DISPLAY, szDisplay, MAX_PATH);
00036     LoadString (hDllInstance, IDS_EMPTYVC_SUBKEY, szEmptyVCSubKey, MAX_PATH);
00037
00038     //
00039     //  Delete the key HKCR\CLSID\{CLSID}\InprocServer32
00040     //  Delete the key HKCR\CLSID\{CLSID}\DefaultIcon
00041     //
00042     wsprintf (szSubKey, TEXT("CLSID\\%s"), szClsid);
00043     lResult = RegOpenKeyEx (HKEY_CLASSES_ROOT, szSubKey, 0, KEY_ALL_ACCESS, &hKey);
00044     if (lResult == NOERROR)
00045     {
00046         lResult = RegDeleteKey (hKey, TEXT("InprocServer32"));
00047         if (lResult != NOERROR)
00048             hResult = SELFREG_E_CLASS;
00049
00050         lResult = RegDeleteKey (hKey, TEXT("DefaultIcon"));
00051         if (lResult != NOERROR)
00052             hResult = SELFREG_E_CLASS;
00053         RegCloseKey (hKey);
00054     }
00055     else
00056         hResult = SELFREG_E_CLASS;
00057
00058     //
00059     //  Delete the key HKCR\CLSID\{CLSID}
00060     //
00061     lResult = RegOpenKeyEx (HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_ALL_ACCESS, &hKey);
00062
00063     if (lResult == NOERROR)
00064     {
00065         lResult = RegDeleteKey (hKey, szClsid);
00066         if (lResult != NOERROR)
00067             hResult = SELFREG_E_CLASS;
00068         RegCloseKey (hKey);
00069     }
00070     else
00071         hResult = SELFREG_E_CLASS;
00072
00073     //
00074     //  Delete the key HKLM\Software\Microsoft\Windows\CurrentVersion
00075     //                   \Explorer\VolumeCaches\CleanupSample
00076     //
00077     lResult = RegOpenKeyEx (HKEY_LOCAL_MACHINE, szEmptyVCSubKey, 0, KEY_ALL_ACCESS, &hKey);
00078
00079     if (lResult == NOERROR)
00080     {
00081         lResult = RegDeleteKey (hKey, szDisplay);
00082         if (lResult != NOERROR) hResult = SELFREG_E_CLASS;
00083
00084         RegCloseKey (hKey);
00085     }
00086     else
00087         hResult = SELFREG_E_CLASS;
00088
00089     return hResult;
00090 }
00091
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/ComSyncObject/Resource.h Source File

  • Com
  • Services
  • Concurrency
  • SyncComp
  • ComSyncObject

Resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by ComSyncObject.rc
00004 //
00005 #define IDS_PROJNAME                    100
00006 #define IDR_COMSYNCTEST                 101
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        201
00013 #define _APS_NEXT_COMMAND_VALUE         32768
00014 #define _APS_NEXT_CONTROL_VALUE         201
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed Nov 13 2024 16:51:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/BYOT/Server/BYOTTxEnlister/TxEnlister.Cpp Source File

  • Com
  • Services
  • BYOT
  • Server
  • BYOTTxEnlister

TxEnlister.Cpp

Go to the documentation of this file.
00001 // TxEnlister.cpp : Implementation of DLL Exports.
00002
00003
00004 // Note: Proxy/Stub Information
00005 //      To build a separate proxy/stub DLL,
00006 //      run nmake -f TxEnlisterps.mk in the project directory.
00007
00008 #include "stdafx.h"
00009 #include "resource.h"
00010 #include <initguid.h>
00011 #include "TxEnlister.h"
00012
00013 #include "TxEnlister_i.c"
00014 #include "EnlistTransaction.h"
00015
00016
00017 CComModule _Module;
00018
00019 BEGIN_OBJECT_MAP(ObjectMap)
00020 OBJECT_ENTRY(CLSID_EnlistTransaction, CEnlistTransaction)
00021 END_OBJECT_MAP()
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // DLL Entry Point
00025
00026 extern "C"
00027 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00028 {
00029     if (dwReason == DLL_PROCESS_ATTACH)
00030     {
00031         _Module.Init(ObjectMap, hInstance, &LIBID_TXENLISTERLib);
00032         DisableThreadLibraryCalls(hInstance);
00033     }
00034     else if (dwReason == DLL_PROCESS_DETACH)
00035         _Module.Term();
00036     return TRUE;    // ok
00037 }
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // Used to determine whether the DLL can be unloaded by OLE
00041
00042 STDAPI DllCanUnloadNow(void)
00043 {
00044     return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00045 }
00046
00047 /////////////////////////////////////////////////////////////////////////////
00048 // Returns a class factory to create an object of the requested type
00049
00050 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00051 {
00052     return _Module.GetClassObject(rclsid, riid, ppv);
00053 }
00054
00055 /////////////////////////////////////////////////////////////////////////////
00056 // DllRegisterServer - Adds entries to the system registry
00057
00058 STDAPI DllRegisterServer(void)
00059 {
00060     // registers object, typelib and all interfaces in typelib
00061     return _Module.RegisterServer(TRUE);
00062 }
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065 // DllUnregisterServer - Removes entries from the system registry
00066
00067 STDAPI DllUnregisterServer(void)
00068 {
00069     return _Module.UnregisterServer(TRUE);
00070 }
00071
00072
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CCounterData Member List

This is the complete list of members for CCounterData, including all inherited members.
m_lHandle | CCounterData
m_wcsName | CCounterData
Generated on Wed Nov 13 2024 16:55:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/Dt_Dll.Cpp Source File

  • NetDS
  • WinSock
  • Dt_Dll

Dt_Dll.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c) 1995 Intel Corp
00004   Copyright (c) 1996 - 2000 Microsoft Corporation
00005
00006   File Name:
00007
00008     dt_dll.cpp
00009
00010   Abstract:
00011
00012     Contains main and supporting functions for a Debug/Trace
00013     DLL for the WinSock2 DLL.  See the design spec
00014     for more information.
00015
00016 --*/
00017
00018 //
00019 // Include Files
00020 //
00021
00022 #include "nowarn.h"  /* turn off benign warnings */
00023 #ifndef _WINSOCKAPI_
00024 #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
00025 #endif
00026 #include <windows.h>
00027 #include "nowarn.h"  /* some warnings may have been turned back on */
00028 #include <winsock2.h>
00029 #include <stdarg.h>
00030 #include <ws2spi.h>
00031 #include <commdlg.h>
00032 #include <stdio.h>
00033 #include <stdlib.h>
00034
00035 #include "dt_dll.h"
00036 #include "cstack.h"
00037 #include "dt.h"
00038 #include "handlers.h"
00039
00040 //
00041 // Forward References for Functions
00042 //
00043
00044 BOOL WINAPI
00045 DllMain(
00046     HINSTANCE DllInstHandle,
00047     DWORD     Reason,
00048     LPVOID    Reserved);
00049
00050 //
00051 // Externally Visible Global Variables
00052 //
00053
00054 HANDLE LogFileHandle=INVALID_HANDLE_VALUE;// handle to the log file
00055 ULONG  OutputStyle=NO_OUTPUT;
00056 char   Buffer[TEXT_LEN];                  // buffer for building output strings
00057 char  *szDtRegKey="System\\CurrentControlSet\\Services\\Winsock2\\Parameters\\DT_DLL_App_Data";
00058
00059 //
00060 // Static Global Variables
00061 //
00062
00063 // name for my window class
00064 static HINSTANCE        DllInstHandle;     // handle to the dll instance
00065 static DWORD            TlsIndex=0xFFFFFFFF; // tls index for this module
00066 static CRITICAL_SECTION CrSec;         // critical section for text output
00067 static HANDLE           TextOutEvent;  // set when debug window is ready
00068
00069 static char             LogFileName[MAX_PATH+1]; // name of the log file
00070 static char             ModuleFileName[MAX_PATH+1]; // name of the application
00071
00072 // function pointer tables for handler functions.
00073 static LPFNDTHANDLER  HdlFuncTable[MAX_DTCODE + 1];
00074
00075 //
00076 // Function Definitions
00077 //
00078
00079
00080 BOOL WINAPI
00081 DllMain(
00082     HINSTANCE InstanceHandle,
00083     DWORD     Reason,
00084     LPVOID    Reserved)
00085 /*++
00086
00087   DllMain()
00088
00089   Function Description:
00090
00091       Please see Windows documentation for DllEntryPoint.
00092
00093   Arguments:
00094
00095       Please see windows documentation.
00096
00097   Return Value:
00098
00099       Please see windows documentation.
00100
00101 --*/
00102 {
00103
00104     Cstack_c   *ThreadCstack;   // points to Cstack objects in tls
00105     PINITDATA   InitDataPtr;    // to pass to the window creation thread
00106     HKEY        hkeyAppData;
00107     char        szSubKeyStr[sizeof(szDtRegKey)+256],
00108                *ptr=NULL;
00109     int         ModuleLen=0;
00110
00111
00112     // OutputDebugString ("DllMain called.\n");
00113     switch(Reason) {
00114
00115         // Determine the reason for the call and act accordingly.
00116         case DLL_PROCESS_ATTACH:
00117
00118             if ((ModuleLen = GetModuleFileName (NULL, ModuleFileName, sizeof (ModuleFileName)))==0)
00119                 return FALSE;
00120
00121
00122             // Allocate a TLS index.
00123             TlsIndex = TlsAlloc();
00124             if (TlsIndex==0xFFFFFFFF)
00125                 return FALSE;
00126
00127             DllInstHandle = InstanceHandle;
00128             __try {
00129                 InitializeCriticalSection(&CrSec);
00130           }
00131             __except(EXCEPTION_EXECUTE_HANDLER) {
00132                 OutputStyle = NO_OUTPUT;
00133                 return FALSE;
00134             }
00135
00136             TextOutEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
00137             if (TextOutEvent==NULL)
00138                 return FALSE;
00139
00140             // Fill in the handler function table.
00141             DTHandlerInit(HdlFuncTable, MAX_DTCODE);
00142
00143             // Build the log file name
00144             strcpy (LogFileName, ModuleFileName);
00145             strcat (LogFileName, ".log");
00146
00147             // See if the reg key exists for this EXE
00148             ptr = &ModuleFileName[ModuleLen-1];
00149             while ( (ptr != ModuleFileName) &&  (*ptr != '\\') )
00150                 ptr--;
00151             if (*ptr == '\\')
00152                 ptr++;
00153
00154             // Build the key
00155             _snprintf(szSubKeyStr, sizeof(szDtRegKey)+255,
00156                     "%s\\%s", szDtRegKey, ptr);
00157
00158             OutputDebugString("Looking for key: ");
00159             OutputDebugString(szSubKeyStr);
00160             OutputDebugString("\r\n");
00161
00162             if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00163                         szSubKeyStr,
00164                         0,
00165                         KEY_QUERY_VALUE,
00166                         &hkeyAppData) == NO_ERROR)
00167             {
00168                 OutputDebugString("Found the registry key\r\n");
00169                 OutputStyle = FILE_ONLY;
00170
00171                 RegCloseKey(hkeyAppData);
00172             }
00173             else
00174             {
00175                 OutputStyle = NO_OUTPUT;
00176             }
00177
00178             if (OutputStyle == FILE_ONLY)
00179             {
00180                 LogFileHandle = CreateFile(LogFileName,
00181                         GENERIC_WRITE,
00182                         FILE_SHARE_READ | FILE_SHARE_WRITE,
00183                         NULL,
00184                         CREATE_ALWAYS,
00185                         FILE_ATTRIBUTE_NORMAL,
00186                         NULL);
00187                 if (LogFileHandle == INVALID_HANDLE_VALUE) {
00188                     OutputDebugString("Unable to create log file!\r\n");
00189                     OutputStyle = NO_OUTPUT;
00190                 }
00191             }
00192
00193             // Get some information for later output to the debug window
00194             // or file -- get the time, PID, and TID of the calling
00195             // process and put into a INITDATA struct.  This memory will
00196             // be freed by the thread it is passed to.
00197             InitDataPtr = (PINITDATA) LocalAlloc(0, sizeof(INITDATA));
00198             GetLocalTime(&(InitDataPtr->LocalTime));
00199             InitDataPtr->TID = GetCurrentThreadId();
00200             InitDataPtr->PID = GetCurrentProcessId();
00201
00202             // Normally the window thread does a DTTextOut of the time
00203             // and process info that we saved just above.  But in this
00204             // case,  there is no window thread so spit it out to the
00205             // file or debugger.
00206
00207             _snprintf(Buffer, TEXT_LEN-1, "Log initiated: %d-%d-%d, %d:%d:%d\r\n",
00208                     InitDataPtr->LocalTime.wMonth,
00209                     InitDataPtr->LocalTime.wDay,
00210                     InitDataPtr->LocalTime.wYear,
00211                     InitDataPtr->LocalTime.wHour,
00212                     InitDataPtr->LocalTime.wMinute,
00213                     InitDataPtr->LocalTime.wSecond);
00214             DTTextOut(LogFileHandle, Buffer, OutputStyle);
00215             _snprintf(Buffer, TEXT_LEN-1, "Process ID: 0x%X   Thread ID: 0x%X\r\n",
00216                     InitDataPtr->PID,
00217                     InitDataPtr->TID);
00218             DTTextOut(LogFileHandle, Buffer, OutputStyle);
00219
00220             // Setting this event allows {Pre|Post}ApiNotify to
00221             // proceed.  This event isn't really needed in this case
00222             // (because there is only one thread, and we know the code
00223             // above has been executed before WSAPre|PostApiNotify).
00224             SetEvent(TextOutEvent);
00225
00226             // flow through...
00227
00228         case DLL_THREAD_ATTACH:
00229
00230             // Store a pointer to a new Cstack_c in the slot for this
00231             // thread.
00232             ThreadCstack = new Cstack_c();
00233             TlsSetValue(TlsIndex, (LPVOID)ThreadCstack);
00234
00235             break;
00236
00237         case DLL_PROCESS_DETACH:
00238
00239             // Free up some resources.  This is like cleaning up your room
00240             // before the tornado strikes, but hey, it's good practice.
00241             TlsFree(TlsIndex);
00242             DeleteCriticalSection(&CrSec);
00243
00244             CloseHandle(LogFileHandle);
00245
00246             break;
00247
00248         case DLL_THREAD_DETACH:
00249
00250             // Get the pointer to this thread's Cstack, and delete the
00251             // object.
00252             ThreadCstack = (Cstack_c *)TlsGetValue(TlsIndex);
00253             delete ThreadCstack;
00254
00255             break;
00256
00257         default:
00258
00259             break;
00260     } // switch (Reason)
00261
00262     return TRUE;
00263 } // DllMain()
00264
00265
00266
00267
00268
00269 BOOL WINAPIV
00270 WSAPreApiNotify(
00271     IN  INT    NotificationCode,
00272     OUT LPVOID ReturnCode,
00273     IN  LPSTR  LibraryName,
00274     ...)
00275 /*++
00276
00277   Function Description:
00278
00279       Builds a string for output and passes it, along with information
00280       about the call, to a handler function.
00281
00282   Arguments:
00283
00284       NotificationCode -- specifies which API function called us.
00285
00286       ReturnCode -- a generic pointer to the return value of the API
00287       function.  Can be used to change the return value in the
00288       case of a short-circuit (see how the return value from
00289       PreApiNotify works for more information on short-circuiting
00290       the API function).
00291
00292       LibraryName -- a string pointing to the name of the library that
00293       called us.
00294
00295       ...    -- variable number argument list.  These are pointers
00296       to the actual parameters of the API functions.
00297
00298   Return Value:
00299
00300       Returns TRUE if we want to short-circuit the API function;
00301       in other words, returning non-zero here forces the API function
00302       to return immediately before any other actions take place.
00303
00304       Returns FALSE if we want to proceed with the API function.
00305
00306 --*/
00307 {
00308     va_list          vl;            // used for variable arg-list parsing
00309     Cstack_c         *ThreadCstack; // the Cstack_c object for this thread
00310     int              Index = 0;     // index into string we are creating
00311     BOOL             ReturnValue;   // value to return
00312     LPFNDTHANDLER    HdlFunc;       // pointer to handler function
00313     int              Counter;       // counter popped off the cstack
00314     int              OriginalError; // any pending error is saved
00315
00316     if (OutputStyle==NO_OUTPUT)
00317         return FALSE;
00318
00319     OriginalError = GetLastError();
00320
00321     EnterCriticalSection(&CrSec);
00322
00323     // Wait until the debug window is ready to receive text for output.
00324     WaitForSingleObject(TextOutEvent, INFINITE);
00325     va_start(vl, LibraryName);
00326
00327     // Get the Cstack_c object for this thread.
00328     ThreadCstack = (Cstack_c *)TlsGetValue(TlsIndex);
00329     if (!ThreadCstack){
00330         ThreadCstack = new Cstack_c();
00331         TlsSetValue(TlsIndex, (LPVOID)ThreadCstack);
00332         _snprintf(Buffer, TEXT_LEN-1, "0x%X Foriegn thread\n",
00333                  GetCurrentThreadId());
00334         DTTextOut(LogFileHandle, Buffer, OutputStyle);
00335     } //if
00336
00337     // Start building an output string with some info that's
00338     // independent of which API function called us.
00339     Index = _snprintf(Buffer, TEXT_LEN-1, "Function call: %d   ",
00340                       ThreadCstack->CGetCounter());
00341
00342     // Push the counter & increment.
00343     ThreadCstack->CPush();
00344
00345     // Reset the error to what it was when the function started.
00346     SetLastError(OriginalError);
00347
00348     // Call the appropriate handling function, output the buffer.
00349     if ((NotificationCode < MAX_DTCODE) && HdlFuncTable[NotificationCode]) {
00350         HdlFunc = HdlFuncTable[NotificationCode];
00351         ReturnValue = (*HdlFunc)(vl, ReturnCode,
00352                                  LibraryName,
00353                                  Buffer,
00354                                  Index,
00355                                  TEXT_LEN,
00356                                  TRUE);
00357
00358     } else {
00359
00360         _snprintf(Buffer + Index, TEXT_LEN - Index - 1, "Unknown function called!\r\n");
00361         DTTextOut(LogFileHandle, Buffer, OutputStyle);
00362         ReturnValue = FALSE;
00363     }
00364
00365     // If we are returning TRUE, then the API/SPI function will be
00366     // short-circuited.  We must pop the thread stack, since no
00367     // corresponding WSAPostApiNotify will be called.
00368     if (ReturnValue) {
00369         ThreadCstack->CPop(Counter);
00370     }
00371
00372     LeaveCriticalSection(&CrSec);
00373     // In case the error has changed since the handler returned, we
00374     // want to set it back.
00375     SetLastError(OriginalError);
00376     return(ReturnValue);
00377
00378 } // WSAPreApiNotify()
00379
00380
00381
00382
00383
00384
00385 BOOL WINAPIV
00386 WSAPostApiNotify(
00387     IN  INT    NotificationCode,
00388     OUT LPVOID ReturnCode,
00389     IN  LPSTR  LibraryName,
00390     ...)
00391 /*++
00392
00393   PostApiNotify()
00394
00395   Function Description:
00396
00397       Like PreApiNotify, builds a string and passes it, along with
00398       information about the call, to a handler function.
00399
00400   Arguments:
00401
00402       NotificationCode  -- specifies which API function called us.
00403
00404       ReturnCode -- a generic pointer to the return value of the API
00405       function.
00406
00407       ...    -- variable number argument list.  These are pointers
00408       to the actual parameters of the API functions.
00409
00410   Return Value:
00411
00412       Returns value is currently meaningless.
00413
00414 --*/
00415 {
00416     va_list          vl;            // used for variable arg-list parsing
00417     Cstack_c         *ThreadCstack; // the Cstack_c object for this thread
00418     int              Index = 0;     // index into string we are creating
00419     int              Counter;       // counter we pop off the cstack
00420     LPFNDTHANDLER    HdlFunc;       // pointer to handler function
00421     int              OriginalError; // any pending error is saved
00422
00423     if (OutputStyle==NO_OUTPUT)
00424         return FALSE;
00425
00426     OriginalError = GetLastError();
00427
00428     EnterCriticalSection(&CrSec);
00429
00430     // Wait until it's ok to send output.
00431     WaitForSingleObject(TextOutEvent, INFINITE);
00432
00433   va_start(vl, LibraryName);
00434
00435   // Get the cstack object from TLS, pop the Counter.
00436     ThreadCstack = (Cstack_c *) TlsGetValue(TlsIndex);
00437
00438     if (!ThreadCstack){
00439         ThreadCstack = new Cstack_c();
00440         TlsSetValue(TlsIndex, (LPVOID)ThreadCstack);
00441         _snprintf(Buffer, TEXT_LEN-1, "0x%X Foriegn thread\n",
00442                  GetCurrentThreadId());
00443         DTTextOut(LogFileHandle, Buffer, OutputStyle);
00444     } //if
00445
00446     ThreadCstack->CPop(Counter);
00447
00448     Index = _snprintf(Buffer, TEXT_LEN-1, "Function Call: %d   ", Counter);
00449
00450     // Set the error to what it originally was.
00451     SetLastError(OriginalError);
00452
00453     // Call the appropriate handling function, output the buffer.
00454     if ((NotificationCode < MAX_DTCODE) && HdlFuncTable[NotificationCode]) {
00455         HdlFunc = HdlFuncTable[NotificationCode];
00456         (*HdlFunc)(vl, ReturnCode,
00457                    LibraryName,
00458                    Buffer,
00459                    Index,
00460                    TEXT_LEN,
00461                    FALSE);
00462     } else {
00463
00464         _snprintf(Buffer + Index, TEXT_LEN - Index - 1, "Unknown function returned!\r\n");
00465         DTTextOut(LogFileHandle, Buffer, OutputStyle);
00466     }
00467
00468     LeaveCriticalSection(&CrSec);
00469     // In case the error has changed since the handler returned, we
00470     // want to set it back.
00471     SetLastError(OriginalError);
00472     return(FALSE);
00473
00474 } // WSAPostApiNotify()
00475
00476
00477 BOOL
00478 DTTextOut(
00479     IN HANDLE FileHandle,
00480     IN char   *String,
00481     DWORD     Style)
00482 /*++
00483
00484   DTTextOut()
00485
00486   Function Description:
00487
00488       This function outputs a string to a debug window and/or file.
00489
00490   Arguments:
00491
00492       FileHandle -- handle to an open file for debug output.
00493
00494       String -- the string to output.
00495
00496       Style -- specifies whether the output should go to the window,
00497       the file, or both.
00498
00499   Return Value:
00500
00501       Returns TRUE if the output succeeds, FALSE otherwise.
00502
00503 --*/
00504 {
00505 #define SCRATCH_BUFFER  (TEXT_LEN + 60)
00506
00507     DWORD NumWritten;               // WriteFile takes an address to this
00508     BOOL  Result;                   // result of WriteFile
00509     char  Output[SCRATCH_BUFFER];   // scratch buffer
00510
00511     static DWORD LineCount = 0;     // text output line number
00512     DWORD  BufIndex = 0;            // index into output string
00513
00514     if ((Style==NO_OUTPUT) || (FileHandle == INVALID_HANDLE_VALUE))
00515         return TRUE;
00516
00517     // Build a new string with the line-number and pid.tid in front.
00518     BufIndex += _snprintf(Output, SCRATCH_BUFFER-1, "(%d-%X.%X) ", LineCount++,
00519                                     GetCurrentProcessId (),
00520                                     GetCurrentThreadId ());
00521     strncat(Output, String, SCRATCH_BUFFER - BufIndex - 1);
00522
00523     Result = WriteFile(FileHandle, (LPCVOID)Output, (int) strlen(Output),
00524                        &NumWritten, NULL);
00525     if (!Result) {
00526
00527         CloseHandle(FileHandle);
00528         FileHandle = INVALID_HANDLE_VALUE;
00529         return FALSE;
00530     }
00531
00532     return TRUE;
00533
00534 } // DTTextOut()
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/MSPBase/mspterm.cpp Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • MSPBase

mspterm.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1998-1999 Microsoft Corporation
00004
00005 Module Name:
00006
00007     mspterm.cpp
00008
00009 Abstract:
00010
00011     Implementations for the CBaseTerminal, CSingleFilterTerminal, and various
00012     work item / worker thread classes.
00013
00014 --*/
00015
00016 #include "precomp.h"
00017 #pragma hdrstop
00018
00019 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00020 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00021
00022 CBaseTerminal::CBaseTerminal()
00023             : m_TerminalDirection(TD_CAPTURE)
00024             , m_TerminalType(TT_STATIC)
00025             , m_TerminalState(TS_NOTINUSE)
00026             , m_TerminalClassID(CLSID_NULL)
00027             , m_pFTM(NULL)
00028 {
00029     LOG((MSP_TRACE, "CBaseTerminal::CBaseTerminal() called"));
00030
00031     HRESULT hr = CoCreateFreeThreadedMarshaler(
00032             GetControllingUnknown(), &m_pFTM);
00033
00034     if ( FAILED(hr) )
00035     {
00036         LOG((MSP_TRACE, "CBaseTerminal::CBaseTerminal() - create ftm failed"));
00037     }
00038 }
00039
00040 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00041 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00042
00043 CBaseTerminal::~CBaseTerminal()
00044 {
00045     if (NULL != m_pFTM)
00046     {
00047          m_pFTM->Release();
00048     }
00049
00050     LOG((MSP_TRACE, "CBaseTerminal::~CBaseTerminal() finished"));
00051 }
00052
00053 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00054 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00055
00056 //
00057 // Dynamic terminals that support only one direction must override this to check
00058 // if the direction is valid (although the terminal manager is supposed to
00059 // ensure that the wrong direction is never passed). Dynamic terminal might want
00060 // to override this for other reasons too (create filters now, etc.).
00061 //
00062 // Static terminals normally just call this in their CreateTerminal().
00063 //
00064
00065 HRESULT CBaseTerminal::Initialize(
00066             IN  IID                   iidTerminalClass,
00067             IN  DWORD                 dwMediaType,
00068             IN  TERMINAL_DIRECTION    Direction,
00069             IN  MSP_HANDLE            htAddress
00070             )
00071 {
00072     CLock lock(m_CritSec);
00073
00074     LOG((MSP_TRACE, "CBaseTerminal::Initialize - enter"));
00075
00076     //
00077     // Check if the media type is supported by this terminal.
00078     //
00079
00080     if ( ! MediaTypeSupported( (long) dwMediaType) )
00081     {
00082         LOG((MSP_ERROR, "CBaseTerminal::Initialize - "
00083             "media type not supported - returning E_INVALIDARG"));
00084         return E_INVALIDARG;
00085     }
00086
00087     //
00088     // Save this configurarion.
00089     //
00090
00091     m_dwMediaType       = dwMediaType;
00092     m_TerminalDirection = Direction;
00093     m_TerminalClassID   = iidTerminalClass;
00094     m_htAddress         = htAddress;
00095
00096     LOG((MSP_TRACE, "CBaseTerminal::Initialize - exit S_OK"));
00097     return S_OK;
00098 }
00099
00100 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00101 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00102
00103 STDMETHODIMP CBaseTerminal::get_AddressHandle (
00104         OUT     MSP_HANDLE    * phtAddress
00105         )
00106 {
00107     CLock lock(m_CritSec);
00108
00109     LOG((MSP_TRACE, "CBaseTerminal::get_AddressHandle - enter"));
00110
00111     if ( MSPB_IsBadWritePtr( phtAddress, sizeof(MSP_HANDLE) ) )
00112     {
00113         LOG((MSP_ERROR, "CBaseTerminal::get_AddressHandle - returning E_POINTER"));
00114         return E_POINTER;
00115     }
00116
00117     *phtAddress = m_htAddress;
00118
00119     LOG((MSP_TRACE, "CBaseTerminal::get_AddressHandle - exit S_OK"));
00120     return S_OK;
00121 }
00122
00123 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00124 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00125
00126 STDMETHODIMP CBaseTerminal::get_Name(BSTR * pbsName)
00127 {
00128     CLock lock(m_CritSec);
00129
00130     LOG((MSP_TRACE, "CBaseTerminal::get_Name - enter"));
00131
00132     if ( MSPB_IsBadWritePtr( pbsName, sizeof(BSTR) ) )
00133     {
00134         LOG((MSP_ERROR, "CBaseTerminal::get_Name - "
00135             "bad BSTR passed in - returning E_POINTER"));
00136
00137         return E_POINTER;
00138     }
00139
00140     *pbsName = SysAllocString(m_szName);
00141
00142     if ( *pbsName == NULL )
00143     {
00144         LOG((MSP_ERROR, "CBaseTerminal::get_Name - "
00145             "can't sysallocstring - returning E_OUTOFMEMORY"));
00146
00147         return E_OUTOFMEMORY;
00148     }
00149
00150     LOG((MSP_TRACE, "CBaseTerminal::get_Name - exit S_OK"));
00151     return S_OK;
00152 }
00153
00154 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00155 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00156
00157 STDMETHODIMP CBaseTerminal::get_State(TERMINAL_STATE * pVal)
00158 {
00159     CLock lock(m_CritSec);
00160
00161     LOG((MSP_TRACE, "CBaseTerminal::get_State - enter"));
00162
00163     if ( MSPB_IsBadWritePtr( pVal, sizeof(TERMINAL_STATE) ) )
00164     {
00165         LOG((MSP_ERROR, "CBaseTerminal::get_State - returning E_POINTER"));
00166         return E_POINTER;
00167     }
00168
00169     *pVal = m_TerminalState;
00170
00171     LOG((MSP_TRACE, "CBaseTerminal::get_State - exit S_OK"));
00172     return S_OK;
00173 }
00174
00175 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00176 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00177
00178 STDMETHODIMP CBaseTerminal::get_TerminalType(TERMINAL_TYPE * pVal)
00179 {
00180     CLock lock(m_CritSec);
00181
00182     LOG((MSP_TRACE, "CBaseTerminal::get_TerminalType - enter"));
00183
00184     if ( MSPB_IsBadWritePtr( pVal, sizeof(TERMINAL_TYPE) ) )
00185     {
00186         LOG((MSP_ERROR, "CBaseTerminal::get_TerminalType - returning E_POINTER"));
00187         return E_POINTER;
00188     }
00189
00190     *pVal = m_TerminalType;
00191
00192     LOG((MSP_TRACE, "CBaseTerminal::get_TerminalType - exit S_OK"));
00193     return S_OK;
00194 }
00195
00196 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00197 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00198
00199 STDMETHODIMP CBaseTerminal::get_TerminalClass(BSTR * pbsClassID)
00200 {
00201     CLock lock(m_CritSec);
00202
00203     LOG((MSP_TRACE, "CBaseTerminal::get_TerminalClass - enter"));
00204
00205     if ( MSPB_IsBadWritePtr( pbsClassID, sizeof(BSTR) ) )
00206     {
00207         LOG((MSP_ERROR, "CBaseTerminal::get_TerminalClass - returning E_POINTER"));
00208         return E_POINTER;
00209     }
00210
00211     //
00212     // Convert the CLSID to an OLE string.
00213     //
00214
00215     LPOLESTR lposClass = NULL;
00216     HRESULT hr = StringFromCLSID(m_TerminalClassID, &lposClass);
00217     if (FAILED(hr))
00218     {
00219         LOG((MSP_ERROR, "CBaseTerminal::get_TerminalClass (StringFromCLSID) - returning  %8x", hr));
00220         return hr;
00221     }
00222
00223     //
00224     // Put the string in a BSTR.
00225     //
00226
00227     *pbsClassID = ::SysAllocString(lposClass);
00228
00229     //
00230     // Free the OLE string.
00231     //
00232
00233     ::CoTaskMemFree(lposClass);
00234
00235     if (*pbsClassID == NULL)
00236     {
00237         LOG((MSP_ERROR, "CBaseTerminal::get_TerminalClass - returning E_OUTOFMEMORY"));
00238         return E_OUTOFMEMORY;
00239     }
00240
00241     LOG((MSP_TRACE, "CBaseTerminal::get_TerminalClass - exit S_OK"));
00242     return S_OK;
00243 }
00244
00245 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00246 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00247
00248 STDMETHODIMP CBaseTerminal::get_Direction(
00249     OUT  TERMINAL_DIRECTION *pDirection
00250     )
00251 {
00252     CLock lock(m_CritSec);
00253
00254     LOG((MSP_TRACE, "CBaseTerminal::get_Direction - enter"));
00255
00256     if ( MSPB_IsBadWritePtr( pDirection, sizeof(TERMINAL_DIRECTION) ) )
00257     {
00258         LOG((MSP_ERROR, "CBaseTerminal::get_Direction - returning E_POINTER"));
00259         return E_POINTER;
00260     }
00261
00262     *pDirection = m_TerminalDirection;
00263
00264     LOG((MSP_TRACE, "CBaseTerminal::get_Direction - exit S_OK"));
00265     return S_OK;
00266 }
00267
00268 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00269 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00270
00271 // enters each of the internal filters into the filter graph
00272 // connects the internal filters together (if applicable)
00273 // and returns all the filters to be used as connection points
00274 STDMETHODIMP CBaseTerminal::ConnectTerminal(
00275         IN      IGraphBuilder  * pGraph,
00276         IN      DWORD            dwTerminalDirection,
00277         IN OUT  DWORD          * pdwNumPins,
00278         OUT     IPin          ** ppPins
00279         )
00280 {
00281     LOG((MSP_TRACE, "CBaseTerminal::ConnectTerminal - enter"));
00282
00283     //
00284     // Check parameters.
00285     //
00286
00287     if ( IsBadReadPtr(pGraph, sizeof(IGraphBuilder) ) )
00288     {
00289         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00290             "bad graph pointer; exit E_POINTER"));
00291
00292         return E_POINTER;
00293     }
00294
00295     if ( MSPB_IsBadWritePtr(pdwNumPins, sizeof(DWORD) ) )
00296     {
00297         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00298             "bad numpins pointer; exit E_POINTER"));
00299
00300         return E_POINTER;
00301     }
00302
00303     //
00304     // Find out how many pins we expose. For most terminals this is
00305     // straightforward but we pass in the graph pointer in case they
00306     // need to do something funky to figure this out.
00307     //
00308
00309     DWORD dwActualNumPins;
00310
00311     HRESULT hr;
00312
00313     hr = GetNumExposedPins(pGraph, &dwActualNumPins);
00314
00315     if ( FAILED(hr) )
00316     {
00317         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00318             "GetNumExposedPins failed - exit 0x%08x", hr));
00319
00320         return hr;
00321     }
00322
00323     //
00324     // If ppPins is NULL, just return the number of pins and don't try to
00325     // connect the terminal.
00326     //
00327
00328     if ( ppPins == NULL )
00329     {
00330         LOG((MSP_TRACE, "CBaseTerminal::ConnectTerminal - "
00331             "returned number of exposed pins - exit S_OK"));
00332
00333         *pdwNumPins = dwActualNumPins;
00334
00335         return S_OK;
00336     }
00337
00338     //
00339     // Otherwise, we have a pin return buffer. Check that the purported buffer
00340     // size is big enough and that the buffer is actually writable to the size
00341     // we need.
00342     //
00343
00344     if ( *pdwNumPins < dwActualNumPins )
00345     {
00346         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00347             "not enough space to place pins; exit TAPI_E_NOTENOUGHMEMORY"));
00348
00349         *pdwNumPins = dwActualNumPins;
00350
00351         return TAPI_E_NOTENOUGHMEMORY;
00352     }
00353
00354     if ( MSPB_IsBadWritePtr(ppPins, dwActualNumPins * sizeof(IPin *) ) )
00355     {
00356         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00357             "bad pins array pointer; exit E_POINTER"));
00358
00359         return E_POINTER;
00360     }
00361
00362     //
00363     // Check if we're already connected, and if so, change our state to
00364     // connected. Note that this makes sense for both core static terminals
00365     // and dynamic terminals. Also note that we need to protect this with
00366     // a critical section, but after this we can let go of the lock because
00367     // anyone who subsequently enters the critical section will bail at this
00368     // point.
00369     //
00370
00371     {
00372         CLock lock(m_CritSec);
00373
00374         //
00375         // check if already connected
00376         //
00377
00378         if (TS_INUSE == m_TerminalState)
00379         {
00380             LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00381                 "terminal already in use; exit TAPI_E_TERMINALINUSE"));
00382
00383             return TAPI_E_TERMINALINUSE;
00384         }
00385
00386         //
00387         // Save important state.
00388         //
00389
00390         m_pGraph        = pGraph;
00391         m_TerminalState = TS_INUSE;
00392     }
00393
00394
00395     // add filters to the filter graph
00396     hr = AddFiltersToGraph();
00397
00398     if ( FAILED(hr) )
00399     {
00400         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00401             "can't add filters to graph"));
00402         goto disconnect_terminal;
00403     }
00404
00405     // Give the terminal a chance to do any preconnection
00406     hr = ConnectFilters();
00407     if ( FAILED(hr) )
00408     {
00409         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00410             "can't do internal filter connection"));
00411         goto disconnect_terminal;
00412     }
00413
00414     //
00415     // Get the pins that this filter exposes. No need to pass in
00416     // the filter graph because we already saved the graph pointer.
00417     //
00418
00419     *pdwNumPins = dwActualNumPins;
00420     hr = GetExposedPins(ppPins);
00421
00422     if ( FAILED(hr) )
00423     {
00424         LOG((MSP_ERROR, "CBaseTerminal::ConnectTerminal - "
00425             "can't get exposed pins"));
00426         goto disconnect_terminal;
00427     }
00428
00429     LOG((MSP_TRACE, "CBaseTerminal::ConnectTerminal success"));
00430     return S_OK;
00431
00432 disconnect_terminal:
00433
00434     //
00435     // best effort attempt to disconnect - ignore error code
00436     //
00437
00438     DisconnectTerminal(pGraph, 0);
00439
00440     //
00441     // Release our reference to the graph and set ourselves to notinuse state.
00442     // DisconnectTerminal does this on success, but we need to make sure this
00443     // cleanup happens even if DisconnectTerminal failed.
00444     //
00445
00446     m_pGraph        = NULL;          // this releases the CComPtr
00447
00448     m_TerminalState = TS_NOTINUSE;
00449
00450     LOG((MSP_TRACE, "CBaseTerminal::ConnectTerminal - exit 0x%08x", hr));
00451     return hr;
00452 }
00453
00454 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00455 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00456
00457 STDMETHODIMP
00458 CBaseTerminal::CompleteConnectTerminal(void)
00459 {
00460     LOG((MSP_TRACE, "CBaseTerminal::CompleteConnectTerminal - enter"));
00461     LOG((MSP_TRACE, "CBaseTerminal::CompleteConnectTerminal - exit S_OK"));
00462     return S_OK;
00463 }
00464
00465
00466 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00467 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00468
00469 // disconnects the internal filters from each other (if applicable)
00470 // and removes them from the filter graph (thus breaking connections to
00471 // the stream).
00472 // Filter graph parameter is used for validation, to make sure the terminal
00473 // is disconnected from the same graph that it was originally connected to.
00474
00475
00476 STDMETHODIMP
00477 CBaseTerminal::DisconnectTerminal(
00478         IN      IGraphBuilder  * pGraph,
00479         IN      DWORD            dwReserved
00480         )
00481 {
00482     CLock lock(m_CritSec);
00483
00484     LOG((MSP_TRACE, "CBaseTerminal::DisconnectTerminal called"));
00485
00486     //
00487     // If not in use, then there is nothing to be done.
00488     //
00489
00490     if ( TS_INUSE != m_TerminalState )
00491     {
00492         _ASSERTE(m_pGraph == NULL);
00493
00494         LOG((MSP_TRACE, "CBaseTerminal::DisconnectTerminal success; not in use"));
00495
00496         return S_OK;
00497     }
00498
00499     //
00500     // Check that we are being disconnected from the correct graph.
00501     //
00502     if ( m_pGraph != pGraph )
00503     {
00504         LOG((MSP_TRACE, "CBaseTerminal::DisconnectTerminal - "
00505             "wrong graph; returning E_INVALIDARG"));
00506
00507         return E_INVALIDARG;
00508     }
00509
00510     //
00511     // Extra sanity check.
00512     //
00513
00514     if ( m_pGraph == NULL )
00515     {
00516         LOG((MSP_TRACE, "CBaseTerminal::DisconnectTerminal - "
00517             "no graph; returning E_UNEXPECTED"));
00518
00519         return E_UNEXPECTED;
00520     }
00521
00522     HRESULT hr;
00523
00524     //
00525     // Remove filters from the graph
00526     //
00527
00528     hr = RemoveFiltersFromGraph();
00529
00530     if ( FAILED(hr) )
00531     {
00532         LOG((MSP_ERROR, "CBaseTerminal::DisconnectTerminal - "
00533             "remove filters from graph failed; returning 0x%08x", hr));
00534
00535         return hr;
00536     }
00537
00538     //
00539     // Release our reference to the graph and set ourselves to notinuse state.
00540     //
00541
00542     m_pGraph        = NULL;          // this releases the CComPtr
00543
00544     m_TerminalState = TS_NOTINUSE;
00545
00546     LOG((MSP_TRACE, "CBaseTerminal::DisconnectTerminal success"));
00547
00548     return S_OK;
00549 }
00550
00551 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00552 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00553
00554 STDMETHODIMP CBaseTerminal::get_MediaType(long * plMediaType)
00555 {
00556     CLock lock(m_CritSec);
00557
00558     LOG((MSP_TRACE, "CBaseTerminal::get_MediaType - enter"));
00559
00560     if ( MSPB_IsBadWritePtr(plMediaType, sizeof(long) ) )
00561     {
00562         LOG((MSP_ERROR, "CBaseTerminal::get_MediaType - returning E_POINTER"));
00563         return E_POINTER;
00564     }
00565
00566     *plMediaType = (long) m_dwMediaType;
00567
00568     LOG((MSP_TRACE, "CBaseTerminal::get_MediaType - exit S_OK"));
00569     return S_OK;
00570 }
00571
00572 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00573 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00574
00575 BOOL CBaseTerminal::MediaTypeSupported(long lMediaType)
00576 {
00577     return IsValidSingleMediaType( (DWORD) lMediaType,
00578                                    GetSupportedMediaTypes() );
00579 }
00580
00581
00582
00583 /////////////////////////////////////////////////////////////////////////////
00584 /////////////////////////////////////////////////////////////////////////////
00585 //                                                                         //
00586 // CSingleFilterTerminal                                                   //
00587 //                                                                         //
00588 // This is a base class for a terminal with a single filter and pin. The   //
00589 // terminal could be any direction or media type, and it could be static   //
00590 // or dynamic.                                                             //
00591 //                                                                         //
00592 /////////////////////////////////////////////////////////////////////////////
00593 /////////////////////////////////////////////////////////////////////////////
00594
00595
00596 HRESULT CSingleFilterTerminal::GetNumExposedPins(
00597         IN   IGraphBuilder * pGraph,
00598         OUT  DWORD         * pdwNumPins)
00599 {
00600     LOG((MSP_TRACE, "CSingleFilterTerminal::GetNumExposedPins - enter"));
00601
00602     //
00603     // We ignote pGraph because we don't need to do anything special to find
00604     // out how many pins we have.
00605     //
00606
00607     *pdwNumPins = 1;
00608
00609     LOG((MSP_TRACE, "CSingleFilterTerminal::GetNumExposedPins - exit S_OK"));
00610
00611     return S_OK;
00612 }
00613
00614 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00615 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00616
00617 HRESULT CSingleFilterTerminal::GetExposedPins(
00618         OUT    IPin  ** ppPins
00619         )
00620 {
00621     LOG((MSP_TRACE, "CSingleFilterTerminal::GetExposedPins - enter"));
00622
00623     _ASSERTE( ! MSPB_IsBadWritePtr(ppPins, 1 * sizeof(IPin *) ) );
00624
00625     //
00626     // Return our single pin.
00627     //
00628
00629     *ppPins = m_pIPin;
00630     (*ppPins)->AddRef();
00631
00632     LOG((MSP_TRACE, "CSingleFilterTerminal::GetExposedPins - exit S_OK"));
00633     return S_OK;
00634 }
00635
00636 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00637 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00638
00639 // stops the rightmost render filter in the terminal
00640 // (needed for dynamic filter graphs)
00641 STDMETHODIMP CSingleFilterTerminal::RunRenderFilter(void)
00642 {
00643     // check that we're really a render filter
00644
00645     // tell our single filter to run
00646
00647     return E_NOTIMPL;
00648 }
00649
00650 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00651 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00652
00653 // stops the rightmost render filter in the terminal
00654 // (needed for dynamic filter graphs)
00655 STDMETHODIMP CSingleFilterTerminal::StopRenderFilter(void)
00656 {
00657     // check that we're really a render filter
00658
00659     // tell our single filter to stop
00660
00661     return E_NOTIMPL;
00662 }
00663
00664 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00665 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00666
00667 HRESULT
00668 CSingleFilterTerminal::RemoveFiltersFromGraph(void)
00669 {
00670     LOG((MSP_TRACE, "CSingleFilterTerminal::RemoveFiltersFromGraph - enter"));
00671
00672     if (m_pGraph == NULL)
00673     {
00674         LOG((MSP_ERROR, "CSingleFilterTerminal::RemoveFiltersFromGraph - "
00675             "no graph; returning E_UNEXPECTED"));
00676         return E_UNEXPECTED;
00677     }
00678
00679     if (m_pIFilter == NULL)
00680     {
00681         LOG((MSP_ERROR, "CSingleFilterTerminal::RemoveFiltersFromGraph - "
00682             "no filter; returning E_UNEXPECTED"));
00683         return E_UNEXPECTED;
00684     }
00685
00686     //
00687     // Remove the filter from the graph. This also disconnects any connections
00688     // the filter may have.
00689     //
00690
00691     HRESULT hr = m_pGraph->RemoveFilter(m_pIFilter);
00692
00693     LOG((MSP_TRACE, "CSingleFilterTerminal::RemoveFiltersFromGraph - exit 0x%08x", hr));
00694     return hr;
00695 }
00696
00697 HRESULT
00698 CSingleFilterStaticTerminal::CompareMoniker(
00699                                              IMoniker *pMoniker
00700                                            )
00701 {
00702     IMoniker    *pReducedMoniker;
00703     IMoniker    *pReducedNewMoniker;
00704     IBindCtx    *pbc;
00705     HRESULT     hr;
00706
00707     hr = CreateBindCtx( 0, &pbc );
00708
00709     if (FAILED(hr))
00710     {
00711         LOG((MSP_ERROR, "CSingleFilterStaticTerminal::CompareMoniker - "
00712             "unable to create bind context"));
00713         return hr;
00714     }
00715
00716     hr = m_pMoniker->Reduce(pbc ,MKRREDUCE_ALL, NULL, &pReducedMoniker);
00717
00718     if (FAILED(hr) || !pReducedMoniker)
00719     {
00720         LOG((MSP_ERROR, "CSingleFilterStaticTerminal::CompareMoniker - "
00721             "unable to reduce moniker"));
00722         pbc->Release();  // release the bind context
00723         return hr;
00724     }
00725
00726     hr = pMoniker->Reduce(pbc ,MKRREDUCE_ALL, NULL, &pReducedNewMoniker);
00727
00728     if (FAILED(hr) || !pReducedNewMoniker)
00729     {
00730         LOG((MSP_ERROR, "CSingleFilterStaticTerminal::CompareMoniker - "
00731             "unable to reduce moniker"));
00732         pbc->Release();  // release the bind context
00733         pReducedMoniker->Release();   // release the reduced moniker
00734         return hr;
00735     }
00736
00737     pbc->Release();  // release the bind context
00738
00739     if (pReducedMoniker->IsEqual(pReducedNewMoniker) == S_OK)
00740     {
00741         LOG((MSP_TRACE, "CSingleFilterStaticTerminal::CompareMoniker - "
00742             "exit - return S_OK"));
00743
00744         pReducedMoniker->Release();   // release the reduced monikers
00745         pReducedNewMoniker->Release();
00746         return S_OK;
00747     }
00748
00749     pReducedMoniker->Release();   // release the reduced monikers
00750     pReducedNewMoniker->Release();
00751
00752     LOG((MSP_TRACE, "CSingleFilterStaticTerminal::CompareMoniker - "
00753             "exit - return S_FALSE"));
00754     return S_FALSE;
00755 }
00756
00757 // eof
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/Dimmer.cpp Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

Dimmer.cpp

Go to the documentation of this file.
00001 // Dimmer.cpp : Implementation of CDimmer
00002 #include "stdafx.h"
00003 #include "MyDevice.h"
00004 #include "Dimmer.h"
00005 #include "DimmerService.h"
00006
00007 /////////////////////////////////////////////////////////////////////////////
00008 //  CDimmer : Implementation
00009 ////////////////////////////////////////////////////////////////////////////
00010  CDimmer:: CDimmer()
00011 {
00012   //initialise variables
00013   INT i,j;
00014
00015   //initialise the table mapping the template UDN's to the UDN's used by the device host.
00016   //there is only one entry in this table since the device has only a RootDevice and no embedded devices
00017   UDNmapping[0][0] = SysAllocString(L"RootDevice");
00018   UDNmapping[0][1] =NULL;
00019
00020
00021   //initialise the table mapping between the devices and the services ID's of the services it hosts
00022   //i.e. Row 0 contains services IDs for the RootDevice and Row1 for embedded device 1 if present etc.
00023   //The sample device just has a Rootdevice and no embedded devices
00024   serviceIDDeviceMap[0][0] = SysAllocString(L"upnp:id:DimmerService1.0");
00025
00026   //the array pDisPtrs holds the IDispatch Interface pointers for the services supported by the device
00027   for(i=0;i<NUM_TEMPLATE_UDNS_IN_DESCDOC;i++)
00028     for(j=0;j<MAX_NOSERVICE_PER_DEVICE;j++)
00029       pDisPtrs[i][j]=NULL;
00030
00031 }
00032
00033
00034
00035  CDimmer::~ CDimmer()
00036 {
00037   INT i,j;
00038   for(i=0;i<NUM_TEMPLATE_UDNS_IN_DESCDOC;i++)
00039     for(j=0;j<MAX_NOSERVICE_PER_DEVICE;j++)
00040       if(pDisPtrs[i][j]!=NULL)
00041       {
00042         pDisPtrs[i][j]->Release();
00043         pDisPtrs[i][j]=NULL;
00044       }
00045
00046
00047   //free the strings allocated for the table mapping the template UDN to real UDN
00048   SysFreeString(UDNmapping[0][0]);
00049
00050   //free the strings allocated for the table mapping devices to Service ID's
00051   SysFreeString(serviceIDDeviceMap[0][0]);
00052
00053 }
00054
00055
00056
00057 STDMETHODIMP  CDimmer::Initialize(BSTR bstrXMLDesc,BSTR deviceID,BSTR bstrInitString)
00058 {
00059   //We create an instance of our service and store it for future use
00060   HRESULT hr = S_OK;
00061   HANDLE fHandle=NULL;
00062   DWORD numBytesWritten=0;
00063   IUPnPRegistrar *pReg = NULL;
00064   CHAR *pDescDoc=NULL;
00065   INT i;
00066
00067   OutputDebugString(TEXT("CDimmerDCO: Entering Initialize\n"));
00068   //CComObject<UPNPDimmerService> *pUPNPDimmerService;
00069   CComObject<CDimmerService> *pUPNPDimmerService;
00070
00071   //if the description doc passed to the Initialize function is NULL return an error
00072   if(bstrXMLDesc==NULL)
00073   {
00074     OutputDebugString(TEXT("CDimmerDCO: bstrXMLDesc is null\n"));
00075     return E_FAIL;
00076   }
00077
00078
00079   //Now create Service Objects for the services hosted by the device and store it in the pDispPtrs table
00080   //We get the Service Object IDispatch pointer for the RootDevice's dimming service and store it in Location 0,0
00081   hr=S_OK;
00082   pUPNPDimmerService=NULL;
00083   OutputDebugString(TEXT("CDimmerDCO: Creating the service object\n"));
00084   //hr = CComObject<UPNPDimmerService>::CreateInstance(&pUPNPDimmerService);
00085   hr = CComObject<CDimmerService>::CreateInstance(&pUPNPDimmerService);
00086
00087   if(FAILED(hr)){
00088     OutputDebugString(TEXT("CDimmerDCO: Cannot create the service object\n"));
00089     return E_FAIL;
00090   }
00091
00092   //if we could not create the service object for the Dimmer Service return an Error
00093   if(pUPNPDimmerService==NULL) {
00094     OutputDebugString(TEXT("CDimmerDCO: The service object is null\n"));
00095     return E_FAIL;
00096   }
00097
00098   //Now get the pointer to the IDispatch interface using the QueryInterface function
00099
00100   OutputDebugString(TEXT("CDimmerDCO: Querying the IDispatch for the service object\n"));
00101   hr = pUPNPDimmerService->QueryInterface(IID_IDispatch,(LPVOID *) &pDisPtrs[0][0]);
00102   if(!SUCCEEDED(hr))
00103   {
00104     OutputDebugString(TEXT("CDimmerDCO: Can't get IDispatch interface from the service object\n"));
00105     return E_FAIL;
00106   }
00107
00108
00109   //now create a table mapping the template UDN's to the actual published UDN's we use BSTR's since
00110   //the function GetUniqueDeviceName() takes in BSTR's as parameters
00111   hr = S_OK;
00112
00113   OutputDebugString(TEXT("CDimmerDCO: Creating the registrar object\n"));
00114   hr = CoCreateInstance(    CLSID_UPnPRegistrar,
00115                 NULL,
00116                 CLSCTX_SERVER,
00117                 IID_IUPnPRegistrar,
00118                 (LPVOID *) &pReg);
00119
00120   if(!SUCCEEDED(hr))
00121   {
00122     OutputDebugString(TEXT("CDimmerDCO: Can't create the registrar object\n"));
00123     return E_FAIL;
00124   }
00125
00126   for(i=0;i<NUM_TEMPLATE_UDNS_IN_DESCDOC;i++)
00127   {
00128     hr=S_OK;
00129     hr = pReg->GetUniqueDeviceName(deviceID,UDNmapping[i][0],&UDNmapping[i][1]);
00130     if(!SUCCEEDED(hr))
00131     {
00132       pReg->Release();
00133       OutputDebugString(TEXT("CDimmerDCO: Can't get the unique device names\n"));
00134       return E_FAIL;
00135     }
00136   }
00137
00138   pReg->Release();
00139   OutputDebugString(TEXT("CDimmerDCO: Exiting the Initialize\n"));
00140   return hr;
00141
00142 }
00143
00144 STDMETHODIMP  CDimmer::GetServiceObject(BSTR bstrUDN,BSTR bstrServiceId,IDispatch **ppdispService)
00145 {
00146   // Look at the Service for which the pointer is asked and return it in the IDispatch pointer
00147   INT i;
00148   INT foundDevice=-1;
00149   INT foundService=-1;
00150
00151   for(i=0;i<NUM_TEMPLATE_UDNS_IN_DESCDOC;i++)
00152     if(_tcscmp(bstrUDN,UDNmapping[i][1])==0)
00153       foundDevice=i;
00154
00155   if(foundDevice==-1)
00156     return E_FAIL;
00157
00158   //else find the service in this particular device
00159   for(i=0;i<MAX_NOSERVICE_PER_DEVICE;i++)
00160     if(_tcscmp(serviceIDDeviceMap[foundDevice][i],bstrServiceId)==0)
00161       foundService=i;
00162
00163   if(foundService==-1)
00164     return E_FAIL;
00165
00166   if(pDisPtrs[foundDevice][foundService]==NULL) return E_FAIL;
00167
00168   pDisPtrs[foundDevice][foundService]->AddRef();
00169   *ppdispService = pDisPtrs[foundDevice][foundService];
00170   return S_OK;
00171 }
00172
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CScrollBarLite Member List

This is the complete list of members for CScrollBarLite, including all inherited members.
CheckDlgButton(INT iResourceID, UINT uCheck) | CWndLite | [inline]
Create(HWND hWndParent, WCHAR *pwszClassName, WCHAR *pwszWindowName, UINT uID, DWORD dwStyle=WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|WS_HSCROLL, DWORD dwExStyle=WS_EX_CLIENTEDGE, int x=CW_USEDEFAULT, int y=CW_USEDEFAULT, int cx=CW_USEDEFAULT, int cy=CW_USEDEFAULT) | CWndLite | [virtual]
CreateIndirect(HWND hWndParent, UINT nID=0) | CWndLite | [virtual]
CScrollBarLite() | CScrollBarLite |
CSplitterLite(HWND hWndParent=NULL, UINT nID=0) | CSplitterLite |
CWndLite(HWND hWndParent=NULL, UINT nID=0) | CWndLite |
DestroyWindow() | CWndLite | [virtual]
DrawSplitter(HDC hDC, BOOL fVertical, REFRECT rectLeft, REFRECT rectRight, REFPOINTS ptsClient) | CSplitterLite | [virtual]
EnableWindow(BOOL bEnable=TRUE) | CWndLite | [inline]
GetDlgItem(INT iResourceID) | CWndLite | [inline]
GetFont() | CWndLite | [inline]
GetScrollInfo(INT *piPos, INT *piRangeSize, INT *piPageSize) | CScrollBarLite | [virtual]
GetScrollPos() | CScrollBarLite | [inline, virtual]
GetScrollRange(int *pnMin, int *pnMax) | CScrollBarLite | [inline, virtual]
GetWindowPlacement() | CWndLite | [inline]
GetWindowText() | CWndLite | [inline]
GetWindowText(WCHAR *pwszBuffer, ULONG ulMaxSize) | CWndLite | [inline]
GetWnd() | CWndLite | [inline]
HandleMenuPos(HMENU hMenu, UINT uPos, DWORD *pdwFlags) | CWndLite | [virtual]
HandleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
IsDestroyed() | CWndLite | [inline, virtual]
IsDlgButtonChecked(INT iResourceID) | CWndLite | [inline]
IsVisible() | CWndLite | [inline]
m_bUnicodeMsg | CWndLite |
m_hCursorOld | CSplitterLite |
m_hCursorRight | CSplitterLite |
m_hCursorTop | CSplitterLite |
m_hWnd | CWndLite |
m_hWndParent | CWndLite |
m_iBorderCX | CSplitterLite |
m_iBorderCY | CSplitterLite |
m_nID | CWndLite |
m_pCWndBottom | CSplitterLite |
m_pCWndLeft | CSplitterLite |
m_pCWndRight | CSplitterLite |
m_pCWndTop | CSplitterLite |
m_pSubClassProc | CWndLite |
m_pwszClassName | CWndLite |
m_wndPlacement | CWndLite |
OnActivate(UINT fActive, UINT fMinimized, HWND hWndPrevious) | CWndLite | [virtual]
OnBorder(REFPOINTS pts, INT iBorder) | CSplitterLite | [virtual]
OnChar(TCHAR chCharCode, LPARAM lKeyData) | CWndLite | [virtual]
OnClose() | CWndLite | [virtual]
OnCommand(UINT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnCommandNotify(INT wNotifyCode, INT iID, HWND hWndCtrl) | CWndLite | [virtual]
OnContextMenu(HWND hWnd, REFPOINTS pts) | CWndLite | [virtual]
OnCreate(CREATESTRUCT *pCREATESTRUCT) | CWndLite | [virtual]
OnDblclk(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnDestroy() | CWndLite | [virtual]
OnDropFiles(HDROP hDrop) | CWndLite | [virtual]
OnHScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
OnInitialUpdate() | CWndLite | [virtual]
OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL fSysMenu) | CWndLite | [virtual]
OnKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnLButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnLButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnMenuSelect(UINT uID) | CWndLite | [virtual]
OnMouseMove(WPARAM nHittest, REFPOINTS pts) | CWndLite | [virtual]
OnMove(REFPOINTS pts) | CWndLite | [virtual]
OnNCButtonDown(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNCMouseMove(WPARAM nHittest, REFPOINTS pts) | CSplitterLite | [virtual]
OnNotify(INT idCtrl, NMHDR *pNMHDR) | CWndLite | [virtual]
OnRButtonDown(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnRButtonUp(WPARAM fwKeys, REFPOINTS pts) | CWndLite | [virtual]
OnSetCursor(HWND hWnd, INT nHittest, INT nMouseMsg) | CWndLite | [virtual]
OnSetFocus(HWND hWndPrevFocus) | CWndLite | [virtual]
OnSize(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSizing(WPARAM nType, REFPOINTS pts) | CWndLite | [virtual]
OnSysCommand(WPARAM nCmdType, REFPOINTS pts) | CWndLite | [virtual]
OnSysKeyDown(WPARAM nVirtKey, LPARAM lKeyData) | CWndLite | [virtual]
OnTimer(WPARAM nIDEvent) | CWndLite | [virtual]
OnUpdateCommand(HMENU hMenu, UINT nID, DWORD *pdwFlags) | CWndLite | [virtual]
OnVScroll(int nScrollCode, int nPos, HWND hWnd) | CWndLite | [virtual]
PreCreateWindow(CREATESTRUCTW &cs) | CWndLite | [virtual]
SetFocus() | CWndLite | [inline]
SetFont(HFONT hFont) | CWndLite | [inline]
SetScroll(int nPos, BOOL bRedraw=TRUE) | CScrollBarLite | [virtual]
SetScrollInfo(INT iPos, INT iRangeSize, INT iPageSize, BOOL fRedraw=TRUE) | CScrollBarLite | [virtual]
SetScrollPos(int nPos, BOOL bRedraw=TRUE) | CScrollBarLite | [inline, virtual]
SetScrollRange(int nMin, int nMax, BOOL bRedraw=TRUE) | CScrollBarLite | [inline, virtual]
SetSplitter(CSplitterLite *pCWndTop, CSplitterLite *pCWndBottom=NULL, CSplitterLite *pCWndLeft=NULL, CSplitterLite *pCWndRight=NULL) | CSplitterLite | [virtual]
SetWindowPlacement() | CWndLite | [inline]
SetWindowText(WCHAR *pwszString) | CWndLite | [inline]
ShowWindow(UINT nCmdShow) | CWndLite | [inline]
StartTracking(REFPOINTS ptsScreen, REFRECT rectLeft, REFRECT rectRight, BOOL fVertical, POINT *pPoint) | CSplitterLite | [virtual]
SubClassWindow(WNDPROC pWndProc) | CWndLite | [virtual]
UnhandledMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [virtual]
UpdateWindow() | CWndLite | [inline]
WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | CWndLite | [static]
~CScrollBarLite() | CScrollBarLite | [virtual]
~CWndLite() | CWndLite | [virtual]
Generated on Wed Nov 13 2024 16:57:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/Components/Cpp/MTXSample/CreateTable.cpp Source File

  • Web
  • iis
  • Components
  • Cpp
  • MTXSample

CreateTable.cpp

Go to the documentation of this file.
00001 // CreateTable.cpp : Implementation of CCreateTable
00002
00003 #include "stdafx.h"
00004 #include "BankVC.h"
00005 #include "CreateTable.h"
00006
00007 CComBSTR CONNECTION ("FILEDSN=IISSAMPLE");
00008
00009 char szSQL[] = "If not exists (Select name from sysobjects where name = 'Account' )\n" \
00010   "BEGIN \n" \
00011   "CREATE TABLE dbo.Account( \n" \
00012   "AccountNo int NOT NULL,\n"\
00013   "Balance int NULL,\n" \
00014   "CONSTRAINT PK__1_10 PRIMARY KEY CLUSTERED (AccountNo)\n)\n" \
00015   "Insert into Account Values (1, 1000) \n" \
00016   "Insert into Account Values (2, 1000) \n" \
00017   "END";
00018
00019 /////////////////////////////////////////////////////////////////////////////
00020 // CCreateTable
00021
00022 STDMETHODIMP CCreateTable::InterfaceSupportsErrorInfo(REFIID riid)
00023 {
00024   static const IID* arr[] = { &IID_ICreateTable };
00025
00026   for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
00027     if (InlineIsEqualGUID(*arr[i], riid))
00028       return S_OK;
00029
00030   return S_FALSE;
00031 }
00032
00033 STDMETHODIMP CCreateTable::CreateAccount()
00034 {
00035   TCHAR strErr[512] = "";
00036
00037   // Get the ObjectContext object
00038
00039   CComPtr<IObjectContext> pObjectContext = NULL;
00040
00041   _RecordsetPtr pRecordset = NULL;
00042   _ConnectionPtr pConnection;
00043
00044   HRESULT hr = GetObjectContext(&pObjectContext);
00045
00046   if (FAILED(hr))
00047   {
00048     wsprintf(strErr, "GetObjectContext Failed!");
00049
00050     goto ErrorHandler;
00051   }
00052
00053   // Create ADODB.Connection object and execute SQL statement to create Table
00054
00055   hr = pConnection.CreateInstance("ADODB.Connection.1");
00056
00057   if (FAILED(hr))
00058   {
00059     wsprintf(strErr, "Create ADODB.Connection object failed!");
00060
00061     goto ErrorHandler;
00062   }
00063
00064   hr = pConnection->Open(CONNECTION, NULL, NULL, NULL);
00065
00066   if (FAILED(hr))
00067   {
00068     wsprintf(strErr, "Open ODBC connection failed!");
00069
00070     goto ErrorHandler;
00071   }
00072
00073   hr = pConnection->Execute(CComBSTR(szSQL), static_cast<VARIANT *>(&vtMissing), adCmdText, &pRecordset);
00074
00075   if (FAILED(hr))
00076   {
00077     wsprintf(strErr, "Create table failed ");
00078
00079     goto ErrorHandler;
00080   }
00081
00082   pObjectContext->SetComplete();
00083
00084   return S_OK;
00085
00086 ErrorHandler:
00087
00088   Error(strErr, IID_ICreateTable);
00089
00090   if (pObjectContext)
00091     pObjectContext->SetAbort();
00092
00093   return hr;
00094 }
Generated on Wed Nov 13 2024 16:52:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_metalookup Member List

This is the complete list of members for _metalookup, including all inherited members.
iMRNumber | _metalookup
szGDIName | _metalookup
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CResString Member List

This is the complete list of members for CResString, including all inherited members.
_awc | CResString | [private]
CResString() | CResString | [inline]
CResString(UINT strIDS) | CResString | [inline]
Get() const | CResString | [inline]
Load(UINT strIDS) | CResString | [inline]
Generated on Wed Nov 13 2024 16:57:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

GLOBAL_STRUCT Member List

This is the complete list of members for GLOBAL_STRUCT, including all inherited members.
ClientSize | GLOBAL_STRUCT
dwActiveDebuggees | GLOBAL_STRUCT
fHelpUsed | GLOBAL_STRUCT
hInstance | GLOBAL_STRUCT
hWndListBox | GLOBAL_STRUCT
hWndMain | GLOBAL_STRUCT
hWndToolBar | GLOBAL_STRUCT
ListBoxSize | GLOBAL_STRUCT
MaxStrLen | GLOBAL_STRUCT
OldListBoxWndProc | GLOBAL_STRUCT
szApiFailed | GLOBAL_STRUCT
szAppName | GLOBAL_STRUCT
szShortAppName | GLOBAL_STRUCT
ToolBarHeight | GLOBAL_STRUCT
xPosOld | GLOBAL_STRUCT
yPosOld | GLOBAL_STRUCT
Generated on Wed Nov 13 2024 16:57:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA Member List

This is the complete list of members for Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA, including all inherited members.
cbSize | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
cIssuer | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
dwAcquirePrivateKeyFlags | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
dwKeySpec | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
pdwIssuerChainIndex | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
pdwIssuerElementIndex | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
pfnFindCallback | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
pszUsageIdentifier | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
pvFindArg | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
rgIssuer | Sample::Win32::CERT_CHAIN_FIND_BY_ISSUER_PARA
Generated on Wed Nov 13 2024 16:58:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/Driver/StdAfx.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • Driver

StdAfx.Cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/async/proxy/Proxy.idl Source File

  • Com
  • async
  • proxy

Proxy.idl

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 [
00019   object,
00020   uuid(FEB699CE-E786-11d1-A81E-0000F808342A),     // IID_ITest
00021   async_uuid(213839C0-D5BC-11d2-B497-00600852B4EA), // IID_AsyncITest
00022   helpstring("Asynchronous Test"),
00023   pointer_default(unique)
00024 ]
00025 interface ITest : IUnknown
00026 {
00027   import "unknwn.idl";
00028   typedef ITest* LPTEST;
00029
00030   HRESULT Test1([in,out] BSTR lpbstr);
00031   HRESULT Test2([in] BSTR bstrIn, [out] BSTR *lpbstrOut);
00032 };
00033
00034
00035 [
00036   object,
00037   uuid(083986E1-EBFB-11d1-8FB7-006097DA88F5),     // IID_AppEvents
00038     async_uuid(223839C0-D5BC-11d2-B497-00600852B4EA), // IID_AsyncAppEvents
00039   helpstring("Asynchronous Events"),
00040   pointer_default(unique)
00041 ]
00042 interface AppEvents : IUnknown
00043 {
00044   import "unknwn.idl";
00045
00046   HRESULT Beep([in] short alert);
00047 };
00048
00049
00050 // Type library description
00051 [
00052   uuid(FEB699CF-E786-11d1-A81E-0000F808342A),     // LIBID_Async_Lib
00053   version(1.0),
00054   lcid(0x409),
00055   helpstring("Async COM Test' v 1.0 typelibrary")
00056 ]
00057 library Async_Lib
00058 {
00059   importlib("stdole2.tlb");
00060
00061   [
00062     uuid(FEB699D0-E786-11d1-A81E-0000F808342A),   // CLSID_AsyncTest
00063     appobject,
00064     version(1.0),
00065     helpstring("Asynchronous COM Test Class")
00066   ]
00067   coclass AsyncTest
00068   {
00069     [default] interface ITest;
00070     [default, source] interface AppEvents;
00071   };
00072 };
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCNotify/QCNotify.Cpp Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCNotify

QCNotify.Cpp

Go to the documentation of this file.
00001 // QCNotify.cpp : Implementation of DLL Exports.
00002
00003 #include "stdafx.h"
00004 #include "resource.h"
00005 #include "initguid.h"
00006 #include <adoid.h>    // ADO
00007 #include "QCNotify.h"
00008
00009 #include "QCNotify_i.c"
00010 #include "Notify.h"
00011
00012 CComModule _Module;
00013
00014 BEGIN_OBJECT_MAP(ObjectMap)
00015   OBJECT_ENTRY(CLSID_Notify, CONotify)
00016 END_OBJECT_MAP()
00017
00018 /////////////////////////////////////////////////////////////////////////////
00019 // DLL Entry Point
00020
00021 extern "C"
00022 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
00023 {
00024   if (dwReason == DLL_PROCESS_ATTACH)
00025   {
00026     _Module.Init(ObjectMap, hInstance);
00027     DisableThreadLibraryCalls(hInstance);
00028   }
00029   else if (dwReason == DLL_PROCESS_DETACH)
00030     _Module.Term();
00031   return TRUE;    // ok
00032 }
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Used to determine whether the DLL can be unloaded by OLE
00036
00037 STDAPI DllCanUnloadNow(void)
00038 {
00039   return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
00040 }
00041
00042 /////////////////////////////////////////////////////////////////////////////
00043 // Returns a class factory to create an object of the requested type
00044
00045 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00046 {
00047   return _Module.GetClassObject(rclsid, riid, ppv);
00048 }
00049
00050 /////////////////////////////////////////////////////////////////////////////
00051 // DllRegisterServer - Adds entries to the system registry
00052
00053 STDAPI DllRegisterServer(void)
00054 {
00055   // registers object, typelib and all interfaces in typelib
00056   return _Module.RegisterServer(TRUE);
00057 }
00058
00059 /////////////////////////////////////////////////////////////////////////////
00060 // DllUnregisterServer - Removes entries from the system registry
00061
00062 STDAPI DllUnregisterServer(void)
00063 {
00064   _Module.UnregisterServer();
00065   return S_OK;
00066 }
00067
00068
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/DUnion/DUnionp.c Source File

  • NetDS
  • RPC
  • Data
  • DUnion

DUnionp.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                    Discriminated Union Example
00005
00006     FILE:       unionp.c
00007
00008     PURPOSE:    Remote procedures that are linked with the server
00009                 side of RPC distributed application
00010
00011     FUNCTIONS:  UnionParamProc()  - union, discriminant are parameters
00012                 UnionStructProc() - union, discriminant in structure
00013
00014     COMMENTS:   This distributed application illustrates distriminated
00015                 union.
00016
00017 ****************************************************************************/
00018
00019 #include <stdlib.h>
00020 #include <stdio.h>
00021 #include "dunion.h"    // header file generated by MIDL compiler
00022
00023
00024 void UnionParamProc(DISCRIM_UNION_PARAM_TYPE *up,
00025                     short                    sDiscrim)
00026 {
00027     printf("sDiscrim = %d, data = ", sDiscrim);
00028     switch(sDiscrim) {
00029     case 0:
00030         printf("short %d\n", up->sVal);
00031         break;
00032     case 1:
00033         printf("float %f\n", up->fVal);
00034         break;
00035     case 2:
00036         printf("char %c\n", up->chVal);
00037         break;
00038     default:
00039         printf("invalid\n");
00040         break;
00041     }
00042 }
00043
00044 void UnionStructProc(DISCRIM_UNION_STRUCT_TYPE *u)
00045 {
00046     printf("sDiscrim = %d, data = ", u->sDiscrim);
00047     switch(u->sDiscrim) {
00048     case 0:
00049         printf("short %d\n", u->u.sVal);
00050         break;
00051     case 1:
00052         printf("float %f\n", u->u.fVal);
00053         break;
00054     case 2:
00055         printf("char %c\n", u->u.chVal);
00056         break;
00057     default:
00058         printf("invalid\n");
00059         break;
00060     }
00061 }
00062
00063 void Shutdown(void)
00064 {
00065     RPC_STATUS status;
00066
00067     printf("Calling RpcMgmtStopServerListening\n");
00068     status = RpcMgmtStopServerListening(NULL);
00069     printf("RpcMgmtStopServerListening returned: 0x%x\n", status);
00070     if (status) {
00071         exit(status);
00072     }
00073
00074     printf("Calling RpcServerUnregisterIf\n");
00075     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
00076     printf("RpcServerUnregisterIf returned 0x%x\n", status);
00077     if (status) {
00078         exit(status);
00079     }
00080 }
00081
00082 /* end file dunionp.c */
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/DllServe/Sample.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • DllServe

Sample.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SAMPLE.H
00003
00004   Summary:   Declares a COCarSample utility COM object used to implement
00005              the server as a code sample (mainly with an Init method
00006              to enable setting up Trace logging of activity in the
00007              server to the logging facility in the Client).
00008
00009              For a comprehensive tutorial code tour of this module's
00010              contents and offerings see the tutorial DLLSERVE.HTM file.
00011              For more specific technical details on the internal workings
00012              see the comments dispersed throughout the module's source code.
00013
00014   Classes:   COCarSample.
00015
00016   Functions: none
00017
00018   Origin:    9-11-95: atrent - Editor-inheritance from CAR.H in
00019                the COMOBJ Tutorial Code Sample.
00020
00021 ----------------------------------------------------------------------------
00022   This file is part of the Microsoft COM Tutorial Code Samples.
00023
00024   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00025
00026   This source code is intended only as a supplement to Microsoft
00027   Development Tools and/or on-line documentation.  See these other
00028   materials for detailed information regarding Microsoft code samples.
00029
00030   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00031   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00032   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00033   PARTICULAR PURPOSE.
00034 ==========================================================================+*/
00035
00036 #if !defined(SAMPLE_H)
00037 #define SAMPLE_H
00038
00039 #ifdef __cplusplus
00040
00041 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00042   ObjectClass: COCarSample
00043
00044   Summary:     Utility CarSample COM Object Class for the DLLSERVE server
00045                as a code sample.
00046
00047   Interfaces:  IUnknown
00048                  Standard interface providing COM object features.
00049                ISample
00050                  Sample-specific Utility services for server as a whole.
00051
00052   Aggregation: Yes, COCarSample COM objects are aggregatable by
00053                passing a non-NULL pUnkOuter IUnknown pointer into the
00054                constructor.
00055 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00056 class COCarSample : public IUnknown
00057 {
00058   public:
00059     // Main Object Constructor & Destructor.
00060     COCarSample(IUnknown* pUnkOuter, CServer* pServer);
00061     ~COCarSample(void);
00062
00063     // IUnknown methods. Main object, non-delegating.
00064     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00065     STDMETHODIMP_(ULONG) AddRef(void);
00066     STDMETHODIMP_(ULONG) Release(void);
00067
00068   private:
00069     // We declare nested class interface implementations here.
00070
00071     // We implement the ISample interface in this COCarSample
00072     // COM object class.
00073     class CImpISample : public ISample
00074     {
00075       public:
00076         // Interface Implementation Constructor & Destructor.
00077         CImpISample(
00078           COCarSample* pBackObj,
00079           IUnknown* pUnkOuter,
00080           CServer* pServer);
00081         ~CImpISample(void);
00082
00083         // IUnknown methods.
00084         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00085         STDMETHODIMP_(ULONG) AddRef(void);
00086         STDMETHODIMP_(ULONG) Release(void);
00087
00088         // ISample methods.
00089         STDMETHODIMP         Init(HWND, PVOID);
00090         STDMETHODIMP         AboutBox(HWND);
00091
00092       private:
00093         // Data private to this interface implementation of ISample.
00094         ULONG         m_cRefI;        // Interface Ref Count (for debugging).
00095         COCarSample*  m_pBackObj;     // Parent Object back pointer.
00096         IUnknown*     m_pUnkOuter;    // Outer unknown for Delegation.
00097         CServer*      m_pServer;      // Server Control object.
00098     };
00099
00100     // Make the otherwise private and nested ISample interface
00101     // implementation a friend to COM object instantiations of this
00102     // selfsame COCarSample COM object class.
00103     friend CImpISample;
00104
00105     // Private data of COCarSample COM objects.
00106
00107     // Nested ISample implementation instantiation.
00108     CImpISample      m_ImpISample;
00109
00110     // Main Object reference count.
00111     ULONG            m_cRefs;
00112
00113     // Outer unknown (aggregation & delegation). Used when this
00114     // COCarSample object is being aggregated.  Otherwise it is used
00115     // for delegation if this object is reused via containment.
00116     IUnknown*        m_pUnkOuter;
00117
00118     // Pointer to this component server's control object.
00119     CServer*         m_pServer;
00120 };
00121
00122 typedef COCarSample* PCOCarSample;
00123
00124 #endif // __cplusplus
00125
00126
00127 #endif // SAMPLE_H
Generated on Wed Nov 13 2024 16:51:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/ADs.cpp Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

ADs.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       ADs.cpp
00008 //
00009 //  Contents:   IADs and IADsPathname usage
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #include "stdafx.h"
00015 #include "ADQI.h"
00016 #include "ADs.h"
00017 #include "ADsContainer.h"
00018
00019 #ifdef _DEBUG
00020 #undef THIS_FILE
00021 static char THIS_FILE[]=__FILE__;
00022 #define new DEBUG_NEW
00023 #endif
00024
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // CDlgIADs dialog
00028
00029 #define STRING_SEPARATOR _T("----------")
00030
00031 extern ADSIIF  adsiIfs[];
00032
00033 CDlgIADs::CDlgIADs(LPUNKNOWN pUnk, CWnd* pParent /*=NULL*/)
00034   : CDialog(CDlgIADs::IDD, pParent)
00035 {
00036   //{{AFX_DATA_INIT(CDlgIADs)
00037   m_sADsPath = _T("");
00038   m_sClass = _T("");
00039   m_sName = _T("");
00040   m_sParent = _T("");
00041   m_sSchema = _T("");
00042   m_sGUID = _T("");
00043   //}}AFX_DATA_INIT
00044
00045   ///////////////////////////////////////
00046   // Get the IADs pointer and save it
00047   /////////////////////////////////////
00048   HRESULT hr;
00049   m_pADs = NULL;
00050   hr = pUnk->QueryInterface( IID_IADs, (void **) &m_pADs );
00051   if ( !SUCCEEDED(hr) )
00052   {
00053     AfxMessageBox(_T("Fatal Error! QI for IADs failed"));
00054     return;
00055   }
00056   pUnk->Release();
00057
00058
00059 }
00060
00061
00062 CDlgIADs::~CDlgIADs()
00063 {
00064   if ( m_pADs )
00065   {
00066     m_pADs->Release();
00067   }
00068 }
00069
00070 void CDlgIADs::DoDataExchange(CDataExchange* pDX)
00071 {
00072   CDialog::DoDataExchange(pDX);
00073   //{{AFX_DATA_MAP(CDlgIADs)
00074   DDX_Control(pDX, IDC_ATTRVALUE, m_cValueList);
00075   DDX_Control(pDX, IDC_ATTRLIST, m_cAttrList);
00076   DDX_Text(pDX, IDC_ADSPATH, m_sADsPath);
00077   DDX_Text(pDX, IDC_CLASS, m_sClass);
00078   DDX_Text(pDX, IDC_NAME, m_sName);
00079   DDX_Text(pDX, IDC_PARENT, m_sParent);
00080   DDX_Text(pDX, IDC_SCHEMA, m_sSchema);
00081   DDX_Text(pDX, IDC_GUID, m_sGUID);
00082   //}}AFX_DATA_MAP
00083 }
00084
00085
00086 BEGIN_MESSAGE_MAP(CDlgIADs, CDialog)
00087   //{{AFX_MSG_MAP(CDlgIADs)
00088   ON_BN_CLICKED(IDC_GET, OnGet)
00089   ON_BN_CLICKED(IDC_GETEX, OnGetEx)
00090   ON_BN_CLICKED(IDC_GETINFO, OnGetInfo)
00091   ON_BN_CLICKED(IDC_SETINFO, OnSetInfo)
00092   ON_BN_CLICKED(IDC_GETINFOEX, OnGetInfoex)
00093   ON_BN_CLICKED(IDC_PUT, OnPut)
00094   ON_BN_CLICKED(IDC_PUTEX, OnPutEx)
00095   ON_BN_CLICKED(IDC_PARENTPATH, OnParentPath)
00096   ON_BN_CLICKED(IDC_SCHEMAPATH, OnSchemaPath)
00097   ON_BN_CLICKED(IDC_BINDGUID, OnBindGuid)
00098   ON_CBN_SELCHANGE(IDC_ATTRLIST, OnSelChangeAttrList)
00099   ON_LBN_DBLCLK(IDC_ATTRVALUE, OnDblClkAttrValue)
00100   ON_WM_HSCROLL()
00101   ON_BN_CLICKED(IDC_COPY, OnCopy)
00102   //}}AFX_MSG_MAP
00103 END_MESSAGE_MAP()
00104
00105 /////////////////////////////////////////////////////////////////////////////
00106 // CDlgIADs message handler
00107
00108
00109 BOOL CDlgIADs::OnInitDialog()
00110 {
00111   HRESULT hr;
00112   VARIANT var;
00113   BSTR    bstr;
00114   CStringList sList;
00115
00116   CDialog::OnInitDialog();
00117
00118
00119   ASSERT( m_pADs );
00120   VariantInit(&var);
00121   //////////////////////////
00122   // Get the IADs Properties
00123   /////////////////////////
00124
00125   // Path
00126   hr = m_pADs->get_ADsPath( &bstr );
00127   if ( SUCCEEDED(hr) )
00128   {
00129      m_sADsPath = bstr;
00130      SysFreeString(bstr);
00131   }
00132
00133   // Name
00134   hr = m_pADs->get_Name( &bstr );
00135   if ( SUCCEEDED(hr) )
00136   {
00137      m_sName = bstr;
00138      SysFreeString(bstr);
00139   }
00140
00141   // Parent
00142   hr = m_pADs->get_Parent( &bstr );
00143   if ( SUCCEEDED(hr) )
00144   {
00145      m_sParent = bstr;
00146      SysFreeString(bstr);
00147   }
00148
00149   // Schema
00150   hr = m_pADs->get_Schema( &bstr );
00151   if ( SUCCEEDED(hr) )
00152   {
00153      m_sSchema = bstr;
00154      SysFreeString(bstr);
00155   }
00156
00157     // Class
00158   hr = m_pADs->get_Class( &bstr );
00159   if ( SUCCEEDED(hr) )
00160   {
00161      m_sClass = bstr;
00162      SysFreeString(bstr);
00163   }
00164
00165   // GUID
00166   hr = m_pADs->get_GUID( &bstr );
00167   if ( SUCCEEDED(hr) )
00168   {
00169      m_sGUID = bstr;
00170      SysFreeString(bstr);
00171   }
00172
00173   if ( m_sGUID.GetLength() == 0 )
00174   {
00175     GetDlgItem(IDC_BINDGUID)->EnableWindow( FALSE );
00176   }
00177
00178   ///////////////////////////////////////////////////////////////
00179   //
00180   // Enumerate all attributes in this object
00181   // Steps:
00182   //  1. Get the object's schema information
00183   //  2. Bind to that schema
00184   //  3. QI for Class
00185   //  4. Enumerate the Mandatory and Optional Attributes
00186   //
00187   /////////////////////////////////////////////////////////////
00188   USES_CONVERSION;
00189   IADsClass *pClass;
00190   hr = App->ADsOpenObject(T2OLE(m_sSchema), IID_IADsClass, (void**) &pClass );
00191   if ( SUCCEEDED(hr) )
00192   {
00193       m_cAttrList.ResetContent(); // Clear the list box content.
00194
00195      // Mandatory
00196      pClass->get_MandatoryProperties( &var );
00197      VariantToStringList(  var, sList );
00198      PopulateComboBoxFromStringList( m_cAttrList, sList );
00199      VariantClear(&var);
00200
00201      //  A separator to seperate mandatory and optional attributes
00202      m_cAttrList.AddString( STRING_SEPARATOR);
00203
00204      // Optional
00205      pClass->get_OptionalProperties( &var );
00206      VariantToStringList(  var, sList );
00207      PopulateComboBoxFromStringList( m_cAttrList, sList );
00208      VariantClear(&var);
00209   }
00210
00211
00212   UpdateData(FALSE);
00213
00214   return TRUE;  // return TRUE unless you set the focus to a control
00215                 // EXCEPTION: OCX Property Pages should return FALSE
00216 }
00217
00218 void CDlgIADs::OnGet()
00219 {
00220    CString sAttr;
00221    CStringList sList;
00222    VARIANT var;
00223    HRESULT hr;
00224    m_cAttrList.GetLBText( m_cAttrList.GetCurSel(), sAttr );
00225
00226
00227
00228    if ( sAttr == STRING_SEPARATOR )
00229    {
00230      MessageBeep(0);
00231      return;
00232    }
00233
00234    m_cValueList.ResetContent();
00235
00236
00237    USES_CONVERSION;
00238    /////////////////////////////
00239    // Get the attribute
00240    ////////////////////////////////
00241    hr = m_pADs->Get( T2OLE(sAttr), &var);
00242
00243
00244    ////////////////////////////////
00245    // UI: populate the listbox
00246    ////////////////////////////////
00247    if ( SUCCEEDED(hr) )
00248    {
00249
00250     hr = VariantToStringList(  var, sList );
00251
00252     if ( SUCCEEDED(hr) )
00253     {
00254       PopulateListBoxFromStringList( m_cValueList, sList );
00255     }
00256
00257
00258     VariantClear(&var);
00259    }
00260    else
00261    {
00262      CString s;
00263      s = GetErrorMessage( hr );
00264      m_cValueList.AddString( s );
00265    }
00266
00267 }
00268
00269 ////////////////////////////////////////////////////////////////////////////////
00270 // IADs::GetEx is similar to Get. The GetEx always return an array of variant
00271 // regardless if the attribute is single or multi value.
00272 // This is useful for VB/VBS environment.
00273 ////////////////////////////////////////////////////////////////////////////////
00274 void CDlgIADs::OnGetEx()
00275 {
00276
00277    CString sAttr;
00278    CStringList sList;
00279    VARIANT var;
00280    HRESULT hr;
00281    m_cAttrList.GetLBText( m_cAttrList.GetCurSel(), sAttr );
00282    m_cValueList.ResetContent();
00283
00284    USES_CONVERSION;
00285    /////////////////////////////
00286    // GetEx the attribute
00287    ////////////////////////////////
00288    hr = m_pADs->GetEx( T2OLE(sAttr), &var);
00289
00290
00291    ////////////////////////////////
00292    // UI: populate the listbox
00293    ////////////////////////////////
00294    if ( SUCCEEDED(hr) )
00295    {
00296
00297     hr = VariantToStringList(  var, sList );
00298
00299     if ( SUCCEEDED(hr) )
00300     {
00301       PopulateListBoxFromStringList( m_cValueList, sList );
00302     }
00303
00304     VariantClear(&var);
00305    }
00306
00307
00308 }
00309
00310 //////////////////////////////////////////////////////
00311 // GetInfo is to refresh the cache
00312 // All attributes in this object will be sent
00313 // to the client and be cached again
00314 //
00315 /////////////////////////////////////////////////////////
00316 void CDlgIADs::OnGetInfo()
00317 {
00318   HRESULT hr;
00319   ASSERT(m_pADs);
00320
00321   hr = m_pADs->GetInfo();
00322   if (!SUCCEEDED(hr) )
00323   {
00324     AfxMessageBox(GetErrorMessage(hr));
00325     return;
00326   }
00327   else
00328   {
00329     AfxMessageBox(_T("Succeed"));
00330   }
00331 }
00332
00333 /////////////////////////////////////////////////////////////
00334 // SetInfo will commit any changes since the last SetInfo //
00335 //                              //
00336 //////////////////////////////////////////////////////////////
00337 void CDlgIADs::OnSetInfo()
00338 {
00339   HRESULT hr;
00340   ASSERT(m_pADs);
00341
00342   hr = m_pADs->GetInfo();
00343   if (!SUCCEEDED(hr) )
00344   {
00345     AfxMessageBox(GetErrorMessage(hr));
00346     return;
00347   }
00348   else
00349   {
00350     AfxMessageBox(_T("Succeed"));
00351   }
00352
00353
00354 }
00355
00356 //////////////////////////////////////////////////
00357 // Similar to GetInfo. Unlike GetInfo, GetInfoEx
00358 // only brings the specified attributes to the client
00359 // This is for an optimization purpose.
00360 ///////////////////////////////////////////////////
00361 void CDlgIADs::OnGetInfoex()
00362 {
00363   CGetInfoExDlg dlg;
00364   VARIANT var;
00365   HRESULT hr;
00366
00367   if ( dlg.DoModal() == IDOK )
00368   {
00369     CString s;
00370     CString sAttr;
00371     CStringList sList;
00372     int idx;
00373
00374     s = dlg.GetAttribute();
00375     //////////////////////////////////////////
00376     // Parse and put them in the string list
00377     //////////////////////////////////////////
00378     idx = s.Find(_T(","));
00379     while( idx != -1 )
00380     {
00381        sAttr = s.Mid(0, idx );
00382        sAttr.TrimLeft(); sAttr.TrimRight();
00383        sList.AddTail( sAttr );
00384        s = s.Mid( idx + 1 );
00385        idx = s.Find(_T(","));
00386     }
00387     s.TrimLeft(); s.TrimRight();
00388     sList.AddTail( s );
00389
00390     /////////////////////////////////
00391     // Convert stringlist to variant
00392     ////////////////////////////////
00393     hr = StringListToVariant( var, sList);
00394     if ( SUCCEEDED(hr) )
00395     {
00396       ///////////////////////////////
00397       // Now do the real work!!
00398       ///////////////////////////////
00399       hr = m_pADs->GetInfoEx( var, 0 );
00400       if (!SUCCEEDED(hr) )
00401       {
00402         AfxMessageBox(GetErrorMessage(hr));
00403       }
00404       VariantClear(&var);
00405     }
00406
00407
00408
00409   }
00410
00411 }
00412
00413
00414 void CDlgIADs::OnPut()
00415 {
00416   // TODO: Add your control notification handler code here
00417
00418 }
00419
00420 void CDlgIADs::OnPutEx()
00421 {
00422   // TODO: Add your control notification handler code here
00423
00424 }
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437 /////////////////////////////////////////////////////////////////////////////
00438 // CGetInfoExDlg dialog
00439
00440
00441 CGetInfoExDlg::CGetInfoExDlg(CWnd* pParent /*=NULL*/)
00442   : CDialog(CGetInfoExDlg::IDD, pParent)
00443 {
00444   //{{AFX_DATA_INIT(CGetInfoExDlg)
00445   m_sAttrText = _T("");
00446   //}}AFX_DATA_INIT
00447 }
00448
00449
00450 void CGetInfoExDlg::DoDataExchange(CDataExchange* pDX)
00451 {
00452   CDialog::DoDataExchange(pDX);
00453   //{{AFX_DATA_MAP(CGetInfoExDlg)
00454   DDX_Text(pDX, IDC_ATTR, m_sAttrText);
00455   //}}AFX_DATA_MAP
00456 }
00457
00458
00459 BEGIN_MESSAGE_MAP(CGetInfoExDlg, CDialog)
00460   //{{AFX_MSG_MAP(CGetInfoExDlg)
00461   //}}AFX_MSG_MAP
00462 END_MESSAGE_MAP()
00463
00464 /////////////////////////////////////////////////////////////////////////////
00465 // CGetInfoExDlg message handlers
00466
00467 void CGetInfoExDlg::OnOK()
00468 {
00469   UpdateData(TRUE);
00470   m_sAttr = m_sAttrText;
00471   CDialog::OnOK();
00472 }
00473
00474
00475
00476
00477 void CDlgIADs::OnParentPath()
00478 {
00479     HRESULT hr;
00480     UpdateData(TRUE); // Retrieve from UI
00481
00482
00483       USES_CONVERSION;
00484     IUnknown *pUnk;
00485     CWaitCursor wait;
00486
00487     hr = App->ADsOpenObject( T2OLE( m_sParent ), IID_IUnknown, (void**) &pUnk );
00488
00489     /////////////////////////////////////
00490     // Bring up the IADsContainer Dialog
00491     ///////////////////////////////////////
00492     if ( SUCCEEDED(hr) )
00493     {
00494       pUnk->AddRef();
00495       CDlgIADsContainer dlg( pUnk, this );
00496       dlg.DoModal();
00497
00498       pUnk->Release();
00499     }
00500     else
00501     {
00502       AfxMessageBox( GetErrorMessage(hr) );
00503     }
00504
00505
00506 }
00507
00508
00509 void CDlgIADs::OnSchemaPath()
00510 {
00511     HRESULT hr;
00512     UpdateData(TRUE); // Retrieve from UI
00513
00514
00515       USES_CONVERSION;
00516     IUnknown *pUnk;
00517     IADs     *pADs;
00518     BSTR      bstr;
00519     CWaitCursor wait;
00520
00521
00522     hr = App->ADsOpenObject( T2OLE( m_sSchema ), IID_IADs, (void**) &pADs );
00523     RETURN_ON_FAILURE(hr);
00524
00525
00526     hr = pADs->get_Parent( &bstr );
00527     pADs->Release();
00528
00529     RETURN_ON_FAILURE(hr);
00530
00531     hr = App->ADsOpenObject( bstr, IID_IUnknown, (void**) &pUnk );
00532     SysFreeString( bstr );
00533
00534     /////////////////////////////////////
00535     // Bring up the IADsContainer Dialog
00536     ///////////////////////////////////////
00537     if ( SUCCEEDED(hr) )
00538     {
00539       pUnk->AddRef();
00540       CDlgIADsContainer dlg( pUnk, this );
00541       dlg.DoModal();
00542
00543       pUnk->Release();
00544     }
00545
00546
00547
00548 }
00549
00550 //////////////////////////////////////////////////////
00551 //
00552 // GUID Binding: Only works with Active Directory
00553 //
00554 ////////////////////////////////////////////////////////
00555 void CDlgIADs::OnBindGuid()
00556 {
00557   CWaitCursor wait;
00558   CComBSTR bstrPath;
00559   IUnknown *pUnk = NULL;
00560   HRESULT hr;
00561   UpdateData(TRUE); // Retrieve from UI
00562
00563
00564
00565   CComPtr<IADsPathname> pPathname=NULL;
00566   BSTR bstr;
00567   BSTR bstrProvider;
00568   BSTR bstrServer;
00569
00570
00571   hr = CoCreateInstance( CLSID_Pathname, NULL, CLSCTX_INPROC_SERVER, IID_IADsPathname, (void**) &pPathname );
00572
00573   RETURN_ON_FAILURE(hr);
00574
00575
00576   hr = m_pADs->get_ADsPath(&bstr);
00577
00578   RETURN_ON_FAILURE(hr);
00579
00580
00581   /////////////////////////////////////////////////
00582   // Usage: PathName to find out the provider
00583   ///////////////////////////////////////////////////
00584   hr = pPathname->Set( bstr, ADS_SETTYPE_FULL );
00585   SysFreeString( bstr );
00586   RETURN_ON_FAILURE(hr);
00587
00588   hr = pPathname->Retrieve(ADS_FORMAT_PROVIDER, &bstrProvider );
00589   RETURN_ON_FAILURE(hr);
00590
00591   if ( wcscmp( bstrProvider, L"LDAP") != 0 )
00592   {
00593     AfxMessageBox(_T("Only LDAP: (Active Directory Provider) knows about <GUID=xxxx> syntax"));
00594     SysFreeString( bstrProvider );
00595     return;
00596   }
00597
00598   /////////////////////////////////////////////////
00599   // Usage: PathName to find out the server
00600   ///////////////////////////////////////////////////
00601   hr = pPathname->Retrieve(ADS_FORMAT_SERVER, &bstrServer );
00602
00603   if ( hr == E_ADS_BAD_PATHNAME ) // Serverless binding ( can work only from DS aware client )
00604   {
00605     bstrServer = SysAllocString(L"");
00606   }
00607
00608
00609
00610
00611
00612   ///////////////////////////////////////////////
00613   // Now build the LDAP://server/<GUID=xxx
00614   //////////////////////////////////////////////
00615
00616
00617   bstrPath = bstrProvider;
00618   bstrPath.Append(_T("://"));
00619   if ( wcslen( bstrServer ) ) // Server based binding ?
00620   {
00621      bstrPath.AppendBSTR( bstrServer );
00622    bstrPath.Append(_T("/"));
00623    SysFreeString( bstrServer );
00624   }
00625   bstrPath.Append(_T("<GUID="));
00626   bstrPath.Append( m_sGUID );
00627   bstrPath.Append(_T(">") );
00628
00629   // we don't need these bstrs anymore
00630   SysFreeString( bstrProvider );
00631
00632
00633
00634   // Now Bind using GUID
00635
00636   hr = App->ADsOpenObject( bstrPath, IID_IUnknown, (void**) &pUnk );
00637
00638   /////////////////////////////////////
00639   // Bring up the IADs Dialog
00640   ///////////////////////////////////////
00641   if ( SUCCEEDED(hr) )
00642   {
00643     pUnk->AddRef();
00644     CDlgIADs dlg( pUnk, this );
00645     dlg.DoModal();
00646     pUnk->Release();
00647   }
00648   else
00649   {
00650     AfxMessageBox( GetErrorMessage(hr) );
00651     return;
00652   }
00653
00654
00655 }
00656
00657 void CDlgIADs::OnSelChangeAttrList()
00658 {
00659   OnGet();
00660 }
00661
00662 void CDlgIADs::OnDblClkAttrValue()
00663 {
00664   int idx;
00665   HRESULT hr;
00666
00667   idx = m_cValueList.GetCurSel();
00668   if ( idx == LB_ERR )
00669   {
00670     return;
00671   }
00672
00673   // If someone click this it may be an interface that has the UI.
00674   // The interface value start with --> in the UI
00675   CString s;
00676   int xx;
00677   CString sArrow = ARROW_SYMBOL;
00678   m_cValueList.GetText( idx, s );
00679
00680   if ( s.Find(sArrow,0 ) == 0 )
00681   {
00682     s = s.Mid( sArrow.GetLength() );
00683
00684     // Find the appropriate dialog box
00685     xx=0;
00686     while( !IsEqualIID( *adsiIfs[xx].pIID, IID_NULL ) && s != adsiIfs[xx].szIf  )
00687     {
00688        xx++;
00689     }
00690
00691
00692       if ( adsiIfs[xx].pFn )
00693     {
00694
00695       CString sAttr;
00696       VARIANT var;
00697
00698       // We need to get the value again
00699       USES_CONVERSION;
00700       m_cAttrList.GetLBText( m_cAttrList.GetCurSel(), sAttr );
00701       hr = m_pADs->Get( T2OLE(sAttr), &var);
00702       if ( SUCCEEDED(hr) )
00703       {
00704           IUnknown *pUnk;
00705         hr = V_DISPATCH(&var)->QueryInterface( IID_IUnknown, (void**) &pUnk );
00706         if ( SUCCEEDED(hr) )
00707         {
00708               (*adsiIfs[xx].pFn)( pUnk, NULL );
00709         }
00710       }
00711     }
00712       else
00713     {
00714          AfxMessageBox(_T("No UI implemented yet"));
00715     }
00716
00717
00718
00719     return;
00720
00721   }
00722
00723
00724
00725 }
00726
00727 /////////////////////////////////
00728 // Copy to cliboard
00729 /////////////////////////////////
00730 void CDlgIADs::OnCopy()
00731 {
00732   CString s;
00733   HANDLE hMem;
00734   int idx;
00735
00736
00737   idx = m_cValueList.GetCurSel();
00738
00739   if ( idx == LB_ERR )
00740   {
00741     return;
00742   }
00743
00744   m_cValueList.GetText( idx, s );
00745
00746   if ( !OpenClipboard() )
00747   {
00748     return;
00749   }
00750   EmptyClipboard();
00751
00752
00753   hMem = GlobalAlloc( GMEM_DDESHARE, sizeof(TCHAR) * (s.GetLength() + 1) );
00754   if ( hMem )
00755   {
00756     LPTSTR pMem;
00757     pMem = (LPTSTR) GlobalLock( hMem );
00758     lstrcpyn( pMem, s, s.GetLength()+1);
00759     GlobalUnlock(hMem);
00760     SetClipboardData( CF_TEXT, hMem );
00761   }
00762
00763   CloseClipboard();
00764
00765 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/about/tracemacro.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • about

tracemacro.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "TraceMacro.h"
00017 #include <StdIo.h>             // Needed for sprintf on Win98
00018
00019 //---------------------------------------------------------------------------
00020 //  Function implementations
00021 //
00022
00023 //---------------------------------------------------------------------------
00024 //  Provides trace output for HRESULTs in hex.
00025 //
00026 VOID Trace_HR
00027 (
00028   LPCTSTR pszClass,        //[in] Class name for message
00029   LPCTSTR pszFunction,     //[in] Function name for message
00030   HRESULT hr               //[in] HRESULT to display as a value
00031 )
00032 {
00033 #ifdef _DEBUG
00034
00035   TCHAR  szBuffer[512];
00036   TCHAR  szFormat[] = _T("%s::%s-> Returned 0x%X\n");
00037   INT    nChars     = 0;
00038
00039   nChars = _stprintf( szBuffer, szFormat, pszClass, pszFunction, hr );
00040   _ASSERTE( nChars < sizeof(szBuffer) );
00041
00042   OutputDebugString( szBuffer );
00043
00044 #endif
00045 } //end Trace_HR()
00046
00047
00048 //---------------------------------------------------------------------------
00049 //  Provides trace output for user defined numeric values in the form:
00050 //    "CClassName::MyFunctionName-> UserDefinedValueString = 99"
00051 //
00052 VOID Trace_Value
00053 (
00054   LPCTSTR pszClass,        //[in] Class name for message
00055   LPCTSTR pszFunction,     //[in] Function name for message
00056   LPCTSTR pszValueName,    //[in] Value name for message
00057   LONG    nValue           //[in] Numeric value for message
00058 )
00059 {
00060 #ifdef _DEBUG
00061
00062   TCHAR  szBuffer[512];
00063   TCHAR  szFormat[] = _T("%s::%s-> %s = %u\n");
00064   INT    nChars     = 0;
00065
00066   nChars = _stprintf( szBuffer,
00067                       szFormat,
00068                       pszClass,
00069                       pszFunction,
00070                       pszValueName,
00071                       nValue
00072                     );
00073   _ASSERTE( nChars < sizeof(szBuffer) );
00074
00075   OutputDebugString( szBuffer );
00076
00077 #endif
00078 } //end Trace_Value()
00079
00080
00081 //---------------------------------------------------------------------------
00082 //  Provides trace output which shows the class name, function name, and
00083 //  a string which maps to an MMC notification.
00084 //
00085 VOID Trace_Event
00086 (
00087   LPCTSTR pszClass,        //[in] Class name for message
00088   LPCTSTR pszFunction,     //[in] Event name for message
00089   LONG    nEvent           //[in] Event code to map to string
00090 )
00091 {
00092 #ifdef _DEBUG
00093
00094   TCHAR  szEventStr[22];
00095   TCHAR  szBuffer[512];
00096   TCHAR  szFormat[] = _T("%s::%s-> Event = %s\n");
00097   INT    nChars     = 0;
00098
00099   MapEvent( nEvent, szEventStr );
00100
00101   nChars = _stprintf( szBuffer,
00102                       szFormat,
00103                       pszClass,
00104                       pszFunction,
00105                       szEventStr
00106                     );
00107   _ASSERTE( nChars < sizeof(szBuffer) );
00108
00109   OutputDebugString( szBuffer );
00110
00111 #endif
00112 } //end Trace_Event()
00113
00114 //---------------------------------------------------------------------------
00115 //  Provides trace output which shows the class name and function name
00116 //
00117 VOID Trace_Start
00118 (
00119   LPCTSTR pszClass,        //[in] Class name for message
00120   LPCTSTR pszFunction      //[in] Event name for message
00121 )
00122 {
00123 #ifdef _DEBUG
00124
00125   TCHAR  szBuffer[512];
00126   TCHAR  szFormat[] = _T("%s::%s-> Started \n");
00127   INT    nChars     = 0;
00128
00129   nChars = _stprintf( szBuffer,
00130                       szFormat,
00131                       pszClass,
00132                       pszFunction
00133                     );
00134   _ASSERTE( nChars < sizeof(szBuffer) );
00135
00136   OutputDebugString( szBuffer );
00137
00138 #endif
00139 } //end Trace_Start()
00140
00141
00142
00143 //---------------------------------------------------------------------------
00144 // Provides human readable output for notifications
00145 //
00146 VOID MapEvent( LONG Event, LPTSTR szEventStr )
00147 {
00148 #ifdef _DEBUG
00149
00150   switch( Event )
00151   {
00152     case 0x8001:
00153       _tcscpy( szEventStr, _T("MMCN_ACTIVATE       ") );
00154       break;
00155
00156     case 0x8002:
00157       _tcscpy( szEventStr, _T("MMCN_ADD_IMAGES     ") );
00158       break;
00159
00160     case 0x8003:
00161       _tcscpy( szEventStr, _T("MMCN_BTN_CLICK      ") );
00162       break;
00163
00164     case 0x8004:
00165       _tcscpy( szEventStr, _T("MMCN_CLICK          ") );
00166       break;
00167
00168     case 0x8005:
00169       _tcscpy( szEventStr, _T("MMCN_COLUMN_CLICK   ") );
00170       break;
00171
00172     case 0x8006:
00173       _tcscpy( szEventStr, _T("MMCN_CONTEXTMENU    ") );
00174       break;
00175
00176     case 0x8007:
00177       _tcscpy( szEventStr, _T("MMCN_CUTORMOVE      ") );
00178       break;
00179
00180     case 0x8008:
00181       _tcscpy( szEventStr, _T("MMCN_DBLCLICK       ") );
00182       break;
00183
00184     case 0x8009:
00185       _tcscpy( szEventStr, _T("MMCN_DELETE         ") );
00186       break;
00187
00188     case 0x800A:
00189       _tcscpy( szEventStr, _T("MMCN_DESELECT_ALL   ") );
00190       break;
00191
00192     case 0x800B:
00193       _tcscpy( szEventStr, _T("MMCN_EXPAND         ") );
00194       break;
00195
00196     case 0x800C:
00197       _tcscpy( szEventStr, _T("MMCN_HELP           ") );
00198       break;
00199
00200     case 0x800D:
00201       _tcscpy( szEventStr, _T("MMCN_MENU_BTNCLICK  ") );
00202       break;
00203
00204     case 0x800E:
00205       _tcscpy( szEventStr, _T("MMCN_MINIMIZED      ") );
00206       break;
00207
00208     case 0x800F:
00209       _tcscpy( szEventStr, _T("MMCN_PASTE          ") );
00210       break;
00211
00212     case 0x8010:
00213       _tcscpy( szEventStr, _T("MMCN_PROPERTY_CHANGE") );
00214       break;
00215
00216     case 0x8011:
00217       _tcscpy( szEventStr, _T("MMCN_QUERY_PASTE    ") );
00218       break;
00219
00220     case 0x8012:
00221       _tcscpy( szEventStr, _T("MMCN_REFRESH        ") );
00222       break;
00223
00224     case 0x8013:
00225       _tcscpy( szEventStr, _T("MMCN_REMOVE_CHILDREN") );
00226       break;
00227
00228     case 0x8014:
00229       _tcscpy( szEventStr, _T("MMCN_RENAME         ") );
00230       break;
00231
00232     case 0x8015:
00233       _tcscpy( szEventStr, _T("MMCN_SELECT         ") );
00234       break;
00235
00236     case 0x8016:
00237       _tcscpy( szEventStr, _T("MMCN_SHOW           ") );
00238       break;
00239
00240     case 0x8017:
00241       _tcscpy( szEventStr, _T("MMCN_VIEW_CHANGE    ") );
00242       break;
00243
00244     case 0x8018:
00245       _tcscpy( szEventStr, _T("MMCN_SNAPINHELP     ") );
00246       break;
00247
00248     case 0x8019:
00249       _tcscpy( szEventStr, _T("MMCN_CONTEXTHELP    ") );
00250       break;
00251
00252     case 0x801A:
00253       _tcscpy( szEventStr, _T("MMCN_INITOCX        ") );
00254       break;
00255
00256     case 0x8021:
00257       _tcscpy( szEventStr, _T("MMCN_EXPANDSYNC     ") );
00258       break;
00259
00260     default:
00261       _stprintf( szEventStr, _T("0x%X"), Event );
00262       break;
00263   }
00264
00265 #endif
00266 } //end MapEvent()
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DfV/strmvwr.Cxx Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DfV

strmvwr.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //  Copyright 1992 - 2000 Microsoft Corporation.
00005 //
00006 //  File:       stmvwr.cxx
00007 //
00008 //  Contents:   implementation for the stream viewer window class
00009 //
00010 //  Classes:    CStreamView
00011 //
00012 //  Functions:
00013 //
00014 //  History:    6-27-94   stevebl   Created
00015 //
00016 //----------------------------------------------------------------------------
00017
00018 #include <windows.h>
00019 #include <ole2.h>
00020 #include "strmvwr.h"
00021
00022 #define BYTESPERLINE 16
00023 #define DIVISIONPOINTS 8
00024
00025 //+---------------------------------------------------------------------------
00026 //
00027 //  Member:     CStreamView::CStreamView
00028 //
00029 //  Synopsis:   constructor
00030 //
00031 //  Arguments:  [hlb]    - handle to CMainWindow's listbox
00032 //              [ple]    - pointer to the LISTBOXELEMENT structure for this
00033 //                         stream
00034 //
00035 //  History:    6-27-94   stevebl   Created
00036 //
00037 //----------------------------------------------------------------------------
00038
00039 CStreamView::CStreamView(HWND hlb, LISTBOXELEMENT * ple)
00040 {
00041     _hlbParent = hlb;
00042     _ple = ple;
00043     _hfListBox = NULL;
00044 }
00045
00046 //+---------------------------------------------------------------------------
00047 //
00048 //  Member:     CStreamView::~CStreamView
00049 //
00050 //  Synopsis:   destructor
00051 //
00052 //  History:    6-27-94   stevebl   Created
00053 //
00054 //----------------------------------------------------------------------------
00055
00056 CStreamView::~CStreamView()
00057 {
00058     _ple->fOpen = FALSE;
00059     if (_hfListBox)
00060     {
00061         DeleteObject(_hfListBox);
00062     }
00063     InvalidateRect(_hlbParent, NULL, FALSE);
00064 }
00065
00066 //+---------------------------------------------------------------------------
00067 //
00068 //  Member:     CStreamView::InitInstance
00069 //
00070 //  Synopsis:   creates and shows the stream viewer window
00071 //
00072 //  Arguments:  [hInstance] - the application's instance handle
00073 //              [nCmdShow]  - command to pass to ShowWindow
00074 //
00075 //  Returns:    TRUE on success
00076 //              FALSE on failure
00077 //
00078 //  History:    6-27-94   stevebl   Created
00079 //
00080 //  Notes:      must only be called once immediately after class construction
00081 //
00082 //----------------------------------------------------------------------------
00083
00084 BOOL CStreamView::InitInstance(HINSTANCE hInstance, int nCmdShow)
00085 {
00086     IStream * pstm = (IStream * ) _ple->pInterface;
00087     STATSTG statstg;
00088     HRESULT hr = pstm->Stat(&statstg, STATFLAG_NONAME);
00089     if (FAILED(hr))
00090     {
00091         MessageBoxFromStringIdsAndArgs(
00092             _hwnd,
00093             _hInstance,
00094             IDS_STMSTATFAILED,
00095             IDS_ERROR,
00096             MB_OK | MB_ICONEXCLAMATION,
00097             hr
00098             );
00099         return(FALSE);
00100     }
00101     _cbSize = statstg.cbSize.LowPart;
00102
00103     TCHAR szStreamTitleText[MAX_STRING_LENGTH];
00104     if (!LoadString(_hInstance, IDS_STMTITLETEXT, szStreamTitleText, MAX_STRING_LENGTH))
00105     {
00106         lstrcpy(szStreamTitleText, TEXT(""));
00107     }
00108
00109     TCHAR * szTitle = new TCHAR[lstrlen(TEXT("  [0x00000000 bytes]"))
00110         + lstrlen(szStreamTitleText) + wcslen(_ple->pwcsName) + 1];
00111     if (szTitle)
00112     {
00113         wsprintf(szTitle, TEXT("%s %ws [0x%08X bytes]"), szStreamTitleText, _ple->pwcsName, _cbSize);
00114     }
00115     // Note, the Create method sets the _hwnd member for me so I don't
00116     // need to set it myself.
00117     HWND hwnd = Create(
00118         TEXT(STREAM_VIEW_CLASS_NAME),
00119         szTitle,
00120         WS_OVERLAPPED
00121             | WS_MINIMIZEBOX
00122             | WS_MAXIMIZEBOX
00123             | WS_SYSMENU
00124             | WS_THICKFRAME,
00125         CW_USEDEFAULT,
00126         CW_USEDEFAULT,
00127         CW_USEDEFAULT,
00128         CW_USEDEFAULT,
00129         NULL,
00130         NULL,
00131         hInstance);
00132     delete[] szTitle;
00133     if (!hwnd)
00134     {
00135         return(FALSE);
00136     }
00137     ShowWindow(hwnd, nCmdShow);
00138     UpdateWindow(hwnd);
00139     return(TRUE);
00140 }
00141
00142 //+---------------------------------------------------------------------------
00143 //
00144 //  Member:     CStreamView::WindowProc
00145 //
00146 //  Synopsis:   window procedure for the stream viewer window
00147 //
00148 //  Arguments:  [uMsg]   - Window's message
00149 //              [wParam] - first message parameter
00150 //              [lParam] - second message parameter
00151 //
00152 //  History:    6-27-94   stevebl   Created
00153 //
00154 //----------------------------------------------------------------------------
00155
00156 LRESULT CStreamView::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
00157 {
00158     switch (uMsg)
00159     {
00160     case WM_CREATE:
00161         {
00162             RECT rc;
00163             GetClientRect(_hwnd, &rc);
00164             // record the width before we create the list box
00165             _wWidth = (WORD) rc.right;
00166
00167             HDC hdc = GetDC(_hwnd);
00168             LOGFONT lf;
00169             memset(&lf, 0, sizeof(LOGFONT));
00170
00171             // Get an 8 point Courier font.
00172             lf.lfHeight = -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72);
00173             lstrcpy(lf.lfFaceName, TEXT("Courier"));
00174             _hfListBox = CreateFontIndirect(&lf);
00175             HFONT hfOld = (HFONT) SelectObject(hdc, _hfListBox);
00176             GetTextMetrics(hdc, &_tm);
00177             SelectObject(hdc, hfOld);
00178             ReleaseDC(_hwnd, hdc);
00179
00180             // create the child listbox
00181             _hlb = CreateWindow(
00182                 TEXT("listbox"),
00183                 TEXT(""),
00184                 LBS_OWNERDRAWFIXED |
00185                     WS_CHILD |
00186                     WS_VISIBLE |
00187                     WS_VSCROLL |
00188                     LBS_NOINTEGRALHEIGHT |
00189                     LBS_NODATA,
00190                 0,
00191                 0,
00192                 rc.right,
00193                 rc.bottom,
00194                 _hwnd,
00195                 (HMENU) IDC_LISTBOX,
00196                 _hInstance,
00197                 NULL);
00198             if (NULL == _hlb)
00199             {
00200                 // abort window creation
00201                 return(-1);
00202             }
00203             SetFocus(_hlb);
00204
00205             SendMessage(
00206                 _hlb,
00207                 LB_SETCOUNT,
00208                 (WPARAM)((_cbSize / BYTESPERLINE) + (_cbSize % BYTESPERLINE ? 1 : 0)),
00209                 0);
00210             SendMessage(_hlb, WM_SETFONT, (WPARAM) _hfListBox, 0);
00211             SendMessage(_hlb, LB_SETCURSEL, 0, 0);
00212             _crTextHigh = GetSysColor(COLOR_HIGHLIGHTTEXT);
00213             _crTextNorm = GetSysColor(COLOR_WINDOWTEXT);
00214             _crBkHigh = GetSysColor(COLOR_HIGHLIGHT);
00215             _crBkNorm = GetSysColor(COLOR_WINDOW);
00216         }
00217         break;
00218     case WM_SETFOCUS:
00219         {
00220             if (_hlb)
00221             {
00222                 SetFocus(_hlb);
00223             }
00224         break;
00225         }
00226     case WM_MEASUREITEM:
00227         {
00228             LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam;
00229             lpmis->itemHeight = _tm.tmHeight + _tm.tmExternalLeading;
00230             lpmis->itemWidth = _wWidth;
00231             return(TRUE);
00232         }
00233     case WM_DRAWITEM:
00234         {
00235             LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT) lParam;
00236             if (-1 == lpdis->itemID)
00237             {
00238                 // no items in the listbox
00239                 break;
00240             }
00241             // draw the item
00242             switch (lpdis->itemAction)
00243             {
00244             case ODA_SELECT:
00245             case ODA_DRAWENTIRE:
00246                 {
00247                     // draw the listbox item
00248                     LONG lStartByte = lpdis->itemID * BYTESPERLINE;
00249
00250                     // NOTE:  The following string is actually a bit larger
00251                     // than it has to be.  The minimum size for this string
00252                     // is acutally somewhere between 5 and 6 bytes for each
00253                     // byte (plus 12) in the stream that is to be displayed.
00254                     // Doing it this way wastes a little space but it's much
00255                     // simpler, it's faster, and it's less prone to error
00256                     // than dynamically computing it each time.
00257                     TCHAR szLine[BYTESPERLINE * 6 + 12];
00258
00259                     unsigned cch;
00260                     wsprintf(szLine, TEXT("0x%08X:"), lStartByte);
00261                     for (cch = BYTESPERLINE * 6 + 12; (unsigned) lstrlen(TEXT("0x12345678:")) < cch--; )
00262                     {
00263                         szLine[cch] = TEXT(' ');
00264                     }
00265
00266                     IStream * pstm = (IStream *) _ple->pInterface;
00267                     BYTE rgb[BYTESPERLINE];
00268                     LARGE_INTEGER dlibMove;
00269                     dlibMove.HighPart = 0;
00270                     // If we ever get a stream that's big enough to require
00271                     // that the HiPart get set, then nobody would want to
00272                     // browse that much data anyway!
00273                     dlibMove.LowPart = lStartByte;
00274
00275                     HRESULT hr = pstm->Seek(dlibMove, STREAM_SEEK_SET, NULL);
00276                     if (FAILED(hr))
00277                     {
00278                         MessageBoxFromStringIdsAndArgs(
00279                             _hwnd,
00280                             _hInstance,
00281                             IDS_STMSEEKFAILED,
00282                             IDS_ERROR,
00283                             MB_OK | MB_ICONEXCLAMATION,
00284                             hr
00285                             );
00286                         return(FALSE);
00287                     }
00288                     ULONG cbRead;
00289                     hr = pstm->Read(rgb, BYTESPERLINE, &cbRead);
00290                     if (FAILED(hr))
00291                     {
00292                         MessageBoxFromStringIdsAndArgs(
00293                             _hwnd,
00294                             _hInstance,
00295                             IDS_STMREADFAILED,
00296                             IDS_ERROR,
00297                             MB_OK | MB_ICONEXCLAMATION,
00298                             hr
00299                             );
00300                         return(FALSE);
00301                     }
00302
00303                     for (cch = 0; cch < cbRead; cch++)
00304                     {
00305                         TCHAR szTemp[3];
00306                         wsprintf(szTemp, TEXT("%02X"), rgb[cch]);
00307                         szLine[cch * 3 + cch / DIVISIONPOINTS + 12] = szTemp[0];
00308                         szLine[cch * 3 + cch / DIVISIONPOINTS + 13] = szTemp[1];
00309                         char ch = rgb[cch];
00310                         if (ch < ' ')
00311                         {
00312                             ch = '.';
00313                         }
00314                         // this is a little trick to get the character in the
00315                         // correct type of string (UNICODE or not)
00316                         wsprintf(szTemp, TEXT("%c"), ch);
00317                         szLine[cch + 13 + cch / DIVISIONPOINTS + 3 * BYTESPERLINE + BYTESPERLINE / DIVISIONPOINTS] = szTemp[0];
00318                     }
00319                     szLine[cch + 13 + cch / DIVISIONPOINTS + 3 * BYTESPERLINE + BYTESPERLINE / DIVISIONPOINTS] = 0;
00320
00321                     SIZE sizeText;
00322                     RECT rcItem = lpdis->rcItem;
00323
00324                     GetTextExtentPoint32(
00325                         lpdis->hDC,
00326                         szLine,
00327                         lstrlen(szLine),
00328                         &sizeText);
00329                     rcItem.right = rcItem.left + sizeText.cx;
00330                     COLORREF crOldText = SetTextColor(
00331                         lpdis->hDC,
00332                         (lpdis->itemState & ODS_SELECTED) ? _crTextHigh : _crTextNorm);
00333                     COLORREF crOldBack = SetBkColor(
00334                         lpdis->hDC,
00335                         (lpdis->itemState & ODS_SELECTED) ? _crBkHigh : _crBkNorm);
00336                     ExtTextOut(
00337                         lpdis->hDC,
00338                         rcItem.left,
00339                         rcItem.top,
00340                         ETO_OPAQUE | ETO_CLIPPED,
00341                         &rcItem,
00342                         szLine,
00343                         lstrlen(szLine),
00344                         NULL);
00345                     SetTextColor(lpdis->hDC, crOldText);
00346                     SetBkColor(lpdis->hDC, crOldBack);
00347                 }
00348                 break;
00349             case ODA_FOCUS:
00350                 break;
00351             }
00352             return(TRUE);
00353         }
00354     case WM_SIZE:
00355         {
00356             _wWidth = LOWORD(lParam);
00357             WORD wHeight = HIWORD(lParam);
00358             if (_hlb)
00359             {
00360                 SetWindowPos(_hlb, NULL, 0, 0, _wWidth, wHeight, SWP_NOMOVE | SWP_NOZORDER);
00361             }
00362             break;
00363         }
00364     case WM_COMMAND:
00365     case WM_QUIT:
00366     case WM_CLOSE:
00367     default:
00368         return(DefWindowProc(_hwnd, uMsg, wParam, lParam));
00369     }
00370     return(FALSE);
00371 }
00372
Generated on Wed Nov 13 2024 16:51:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/IPHelp/IPConfig/IPConfig.Cpp Source File

  • NetDS
  • IPHelp
  • IPConfig

IPConfig.Cpp

Go to the documentation of this file.
00001 /******************************************************************************\
00002 *       This is a part of the Microsoft Source Code Samples.
00003 *       Copyright 1996 - 2000 Microsoft Corporation.
00004 *       All rights reserved.
00005 *       This source code is only intended as a supplement to
00006 *       Microsoft Development Tools and/or WinHelp documentation.
00007 *       See these sources for detailed information regarding the
00008 *       Microsoft samples programs.
00009 \******************************************************************************/
00010
00011 /*
00012 Module Name:
00013
00014     Ipconfig.cpp
00015
00016 Abstract:
00017
00018     This module illustrates how to programmatically retrieve IP configuration
00019     information similar to the IPCONFIG.EXE utility.  It demonstrates how to use
00020     the IP Helper APIs GetNetworkParams() and GetAdaptersInfo().
00021
00022     To execute this application, simply build the application using the Microsoft Visual C++
00023     nmake.exe program generation utility to make an executable ipconfig.exe.  After the
00024     build is complete, simply execute the resulting ipconfig.exe program.
00025
00026
00027 Author:
00028
00029     Jim Ohlund 21-Apr-98
00030
00031 Revision History:
00032
00033 */
00034
00035
00036 #include <windows.h>
00037 #include <iphlpapi.h>
00038 #include <stdio.h>
00039 #include <time.h>
00040
00041 void main(void) {
00042
00043     DWORD Err;
00044
00045     PFIXED_INFO pFixedInfo;
00046     DWORD FixedInfoSize = 0;
00047
00048     PIP_ADAPTER_INFO pAdapterInfo, pAdapt;
00049     DWORD AdapterInfoSize;
00050     PIP_ADDR_STRING pAddrStr;
00051
00052     //
00053     // Get the main IP configuration information for this machine using a FIXED_INFO structure
00054     //
00055     if ((Err = GetNetworkParams(NULL, &FixedInfoSize)) != 0)
00056     {
00057         if (Err != ERROR_BUFFER_OVERFLOW)
00058         {
00059             printf("GetNetworkParams sizing failed with error %d\n", Err);
00060             return;
00061         }
00062     }
00063
00064     // Allocate memory from sizing information
00065     if ((pFixedInfo = (PFIXED_INFO) GlobalAlloc(GPTR, FixedInfoSize)) == NULL)
00066     {
00067         printf("Memory allocation error\n");
00068         return;
00069     }
00070
00071     if ((Err = GetNetworkParams(pFixedInfo, &FixedInfoSize)) == 0)
00072     {
00073         printf("\tHost Name . . . . . . . . . : %s\n", pFixedInfo->HostName);
00074         printf("\tDNS Servers . . . . . . . . : %s\n", pFixedInfo->DnsServerList.IpAddress.String);
00075         pAddrStr = pFixedInfo->DnsServerList.Next;
00076         while(pAddrStr)
00077         {
00078             printf("%52s\n", pAddrStr->IpAddress.String);
00079             pAddrStr = pAddrStr->Next;
00080         }
00081
00082         printf("\tNode Type . . . . . . . . . : ");
00083         switch (pFixedInfo->NodeType)
00084         {
00085             case 1:
00086                 printf("%s\n", "Broadcast");
00087                 break;
00088             case 2:
00089                 printf("%s\n", "Peer to peer");
00090                 break;
00091             case 4:
00092                 printf("%s\n", "Mixed");
00093                 break;
00094             case 8:
00095                 printf("%s\n", "Hybrid");
00096                 break;
00097             default:
00098                 printf("\n");
00099         }
00100
00101         printf("\tNetBIOS Scope ID. . . . . . : %s\n", pFixedInfo->ScopeId);
00102         printf("\tIP Routing Enabled. . . . . : %s\n", (pFixedInfo->EnableRouting ? "yes" : "no"));
00103         printf("\tWINS Proxy Enabled. . . . . : %s\n", (pFixedInfo->EnableProxy ? "yes" : "no"));
00104         printf("\tNetBIOS Resolution Uses DNS : %s\n", (pFixedInfo->EnableDns ? "yes" : "no"));
00105     } else
00106     {
00107         printf("GetNetworkParams failed with error %d\n", Err);
00108         return;
00109     }
00110
00111     //
00112     // Enumerate all of the adapter specific information using the IP_ADAPTER_INFO structure.
00113     // Note:  IP_ADAPTER_INFO contains a linked list of adapter entries.
00114     //
00115     AdapterInfoSize = 0;
00116     if ((Err = GetAdaptersInfo(NULL, &AdapterInfoSize)) != 0)
00117     {
00118         if (Err != ERROR_BUFFER_OVERFLOW)
00119         {
00120             printf("GetAdaptersInfo sizing failed with error %d\n", Err);
00121             return;
00122         }
00123     }
00124
00125     // Allocate memory from sizing information
00126     if ((pAdapterInfo = (PIP_ADAPTER_INFO) GlobalAlloc(GPTR, AdapterInfoSize)) == NULL)
00127     {
00128         printf("Memory allocation error\n");
00129         return;
00130     }
00131
00132     // Get actual adapter information
00133     if ((Err = GetAdaptersInfo(pAdapterInfo, &AdapterInfoSize)) != 0)
00134     {
00135         printf("GetAdaptersInfo failed with error %d\n", Err);
00136         return;
00137     }
00138
00139     pAdapt = pAdapterInfo;
00140
00141     while (pAdapt)
00142     {
00143         switch (pAdapt->Type)
00144         {
00145             case MIB_IF_TYPE_ETHERNET:
00146                 printf("\nEthernet adapter ");
00147                 break;
00148             case MIB_IF_TYPE_TOKENRING:
00149                 printf("\nToken Ring adapter ");
00150                 break;
00151             case MIB_IF_TYPE_FDDI:
00152                 printf("\nFDDI adapter ");
00153                 break;
00154             case MIB_IF_TYPE_PPP:
00155                 printf("\nPPP adapter ");
00156                 break;
00157             case MIB_IF_TYPE_LOOPBACK:
00158                 printf("\nLoopback adapter ");
00159                 break;
00160             case MIB_IF_TYPE_SLIP:
00161                 printf("\nSlip adapter ");
00162                 break;
00163             case MIB_IF_TYPE_OTHER:
00164             default:
00165                 printf("\nOther adapter ");
00166         }
00167         printf("%s:\n\n", pAdapt->AdapterName);
00168
00169         printf("\tDescription . . . . . . . . : %s\n", pAdapt->Description);
00170
00171         printf("\tPhysical Address. . . . . . : ");
00172         for (UINT i=0; i<pAdapt->AddressLength; i++)
00173         {
00174             if (i == (pAdapt->AddressLength - 1))
00175                 printf("%.2X\n",(int)pAdapt->Address[i]);
00176             else
00177                 printf("%.2X-",(int)pAdapt->Address[i]);
00178         }
00179
00180         printf("\tDHCP Enabled. . . . . . . . : %s\n", (pAdapt->DhcpEnabled ? "yes" : "no"));
00181
00182         pAddrStr = &(pAdapt->IpAddressList);
00183         while(pAddrStr)
00184         {
00185             printf("\tIP Address. . . . . . . . . : %s\n", pAddrStr->IpAddress.String);
00186             printf("\tSubnet Mask . . . . . . . . : %s\n", pAddrStr->IpMask.String);
00187             pAddrStr = pAddrStr->Next;
00188         }
00189
00190         printf("\tDefault Gateway . . . . . . : %s\n", pAdapt->GatewayList.IpAddress.String);
00191         pAddrStr = pAdapt->GatewayList.Next;
00192         while(pAddrStr)
00193         {
00194             printf("%52s\n", pAddrStr->IpAddress.String);
00195             pAddrStr = pAddrStr->Next;
00196         }
00197
00198         printf("\tDHCP Server . . . . . . . . : %s\n", pAdapt->DhcpServer.IpAddress.String);
00199         printf("\tPrimary WINS Server . . . . : %s\n", pAdapt->PrimaryWinsServer.IpAddress.String);
00200         printf("\tSecondary WINS Server . . . : %s\n", pAdapt->SecondaryWinsServer.IpAddress.String);
00201
00202         struct tm *newtime;
00203
00204         // Display coordinated universal time - GMT
00205         newtime = gmtime(&pAdapt->LeaseObtained);
00206         printf( "\tLease Obtained. . . . . . . : %s", asctime( newtime ) );
00207
00208         newtime = gmtime(&pAdapt->LeaseExpires);
00209         printf( "\tLease Expires . . . . . . . : %s", asctime( newtime ) );
00210
00211         pAdapt = pAdapt->Next;
00212     }
00213 }
00214
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Ping/iphdr.h Source File

  • NetDS
  • WinSock
  • Ping

iphdr.h

Go to the documentation of this file.
00001 // From Network Programming for Microsoft Windows, Second Edition by
00002 // Anthony Jones and James Ohlund.
00003 // Copyright 2002.   Reproduced by permission of Microsoft Press.
00004 // All rights reserved.
00005 //
00006 //
00007 // Sample: Protocol header definitions used by ping (raw sockets)
00008 //
00009 // Files:
00010 //      iphdr.h     - this file
00011 //
00012 // Description:
00013 //      This file contains various protocol header definitions used by
00014 //      the raw socket ping sample.
00015 //
00016 // Compile:
00017 //      See ping.cpp
00018 //
00019 // Usage:
00020 //      See ping.cpp
00021 //
00022
00023 // Align on a 1-byte boundary
00024 #include <pshpack1.h>
00025
00026 // IPv4 header
00027 typedef struct ip_hdr
00028 {
00029     unsigned char  ip_verlen;        // 4-bit IPv4 version
00030                                      // 4-bit header length (in 32-bit words)
00031     unsigned char  ip_tos;           // IP type of service
00032     unsigned short ip_totallength;   // Total length
00033     unsigned short ip_id;            // Unique identifier
00034     unsigned short ip_offset;        // Fragment offset field
00035     unsigned char  ip_ttl;           // Time to live
00036     unsigned char  ip_protocol;      // Protocol(TCP,UDP etc)
00037     unsigned short ip_checksum;      // IP checksum
00038     unsigned int   ip_srcaddr;       // Source address
00039     unsigned int   ip_destaddr;      // Source address
00040 } IPV4_HDR, *PIPV4_HDR, FAR * LPIPV4_HDR;
00041
00042 // IPv4 option header
00043 typedef struct ipv4_option_hdr
00044 {
00045     unsigned char   opt_code;           // option type
00046     unsigned char   opt_len;            // length of the option header
00047     unsigned char   opt_ptr;            // offset into options
00048     unsigned long   opt_addr[9];        // list of IPv4 addresses
00049 } IPV4_OPTION_HDR, *PIPV4_OPTION_HDR, FAR *LPIPV4_OPTION_HDR;
00050
00051 // ICMP header
00052 typedef struct icmp_hdr
00053 {
00054     unsigned char   icmp_type;
00055     unsigned char   icmp_code;
00056     unsigned short  icmp_checksum;
00057     unsigned short  icmp_id;
00058     unsigned short  icmp_sequence;
00059 } ICMP_HDR, *PICMP_HDR, FAR *LPICMP_HDR;
00060
00061 // IPv6 protocol header
00062 typedef struct ipv6_hdr
00063 {
00064     unsigned long   ipv6_vertcflow;        // 4-bit IPv6 version
00065                                            // 8-bit traffic class
00066                                            // 20-bit flow label
00067     unsigned short  ipv6_payloadlen;       // payload length
00068     unsigned char   ipv6_nexthdr;          // next header protocol value
00069     unsigned char   ipv6_hoplimit;         // TTL
00070     struct in6_addr ipv6_srcaddr;          // Source address
00071     struct in6_addr ipv6_destaddr;         // Destination address
00072 } IPV6_HDR, *PIPV6_HDR, FAR * LPIPV6_HDR;
00073
00074 // IPv6 fragment header
00075 typedef struct ipv6_fragment_hdr
00076 {
00077     unsigned char   ipv6_frag_nexthdr;
00078     unsigned char   ipv6_frag_reserved;
00079     unsigned short  ipv6_frag_offset;
00080     unsigned long   ipv6_frag_id;
00081 } IPV6_FRAGMENT_HDR, *PIPV6_FRAGMENT_HDR, FAR * LPIPV6_FRAGMENT_HDR;
00082
00083 // ICMPv6 header
00084 typedef struct icmpv6_hdr {
00085     unsigned char   icmp6_type;
00086     unsigned char   icmp6_code;
00087     unsigned short  icmp6_checksum;
00088 } ICMPV6_HDR;
00089
00090 // ICMPv6 echo request body
00091 typedef struct icmpv6_echo_request
00092 {
00093     unsigned short  icmp6_echo_id;
00094     unsigned short  icmp6_echo_sequence;
00095 } ICMPV6_ECHO_REQUEST;
00096
00097 // Define the UDP header
00098 typedef struct udp_hdr
00099 {
00100     unsigned short src_portno;       // Source port no.
00101     unsigned short dst_portno;       // Dest. port no.
00102     unsigned short udp_length;       // Udp packet length
00103     unsigned short udp_checksum;     // Udp checksum (optional)
00104 } UDP_HDR, *PUDP_HDR;
00105
00106 // IPv4 option for record route
00107 #define IP_RECORD_ROUTE     0x7
00108
00109 // ICMP6 protocol value (used in the socket call and IPv6 header)
00110 #define IPPROTO_ICMP6       58
00111
00112 // ICMP types and codes
00113 #define ICMPV4_ECHO_REQUEST_TYPE   8
00114 #define ICMPV4_ECHO_REQUEST_CODE   0
00115 #define ICMPV4_ECHO_REPLY_TYPE     0
00116 #define ICMPV4_ECHO_REPLY_CODE     0
00117 #define ICMPV4_MINIMUM_HEADER      8
00118
00119 // ICPM6 types and codes
00120 #define ICMPV6_ECHO_REQUEST_TYPE   128
00121 #define ICMPV6_ECHO_REQUEST_CODE   0
00122 #define ICMPV6_ECHO_REPLY_TYPE     129
00123 #define ICMPV6_ECHO_REPLY_CODE     0
00124
00125 // Restore byte alignment back to default
00126 #include <poppack.h>
Generated on Wed Nov 13 2024 16:52:26 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/prsample/rowset.cpp Source File

  • Dataaccess
  • oledb
  • prsample

rowset.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 // Microsoft OLE DB Programmer's Reference Sample
00003 // Copyright (C) 1998 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module ROWSET.CPP
00008 //
00009 //---------------------------------------------------------------------------
00010
00011
00012 /////////////////////////////////////////////////////////////////
00013 // Includes
00014 //
00015 /////////////////////////////////////////////////////////////////
00016 #include "prsample.h"   // Programmer's Reference Sample includes
00017
00018
00019
00020 /////////////////////////////////////////////////////////////////
00021 // myCreateRowset
00022 //
00023 //  This function creates an OLE DB Rowset object from the given
00024 //  provider's Session object. It first obtains a default table
00025 //  name from the user through the tables schema rowset, if
00026 //  supported, then creates a Rowset object by one of two methods:
00027 //
00028 //  - If the user requested that the Rowset object be created
00029 //    from a Command object, it creates a Command object, then
00030 //    obtains command text from the user, sets properties and
00031 //    the command text, and finally executes the command to
00032 //    create the Rowset object
00033 //  - Otherwise, the function obtains a table name from the user
00034 //    and calls IOpenRowset::OpenRowset to create a Rowset object
00035 //    over that table that supports the requested properties
00036 //
00037 /////////////////////////////////////////////////////////////////
00038 HRESULT myCreateRowset
00039   (
00040   IUnknown *        pUnkSession,
00041   IUnknown **       ppUnkRowset
00042   )
00043 {
00044   HRESULT         hr;
00045   IUnknown *        pUnkCommand           = NULL;
00046   IOpenRowset *     pIOpenRowset          = NULL;
00047   WCHAR         wszTableName[MAX_NAME_LEN + 1]  = {0};
00048
00049   const ULONG       cProperties           = 2;
00050   DBPROP          rgProperties[cProperties];
00051   DBPROPSET       rgPropSets[1];
00052
00053   // Obtain a default table name from the user by displaying the
00054   // tables schema rowset if schema rowsets are supported.
00055   CHECK_HR(hr = myCreateSchemaRowset(DBSCHEMA_TABLES, pUnkSession,
00056     MAX_NAME_LEN, wszTableName));
00057
00058   // Set properties on the rowset, to request additional functionality
00059   myAddRowsetProperties(rgPropSets, cProperties, rgProperties);
00060
00061   // If the user requested that the rowset be created from a
00062   // Command object, create a Command, set its properties and
00063   // text and execute it to create the Rowset object
00064   if( g_dwFlags & USE_COMMAND )
00065   {
00066     WCHAR   wszCommandText[MAX_NAME_LEN + 1];
00067
00068     // Attempt to create the Command object from the provider's
00069     // Session object. Note that Commands are not supported by
00070     // all providers, and this will fail in that case
00071     CHECK_HR(hr = myCreateCommand(pUnkSession, &pUnkCommand));
00072
00073     // Get the command text that we will execute from the user
00074     if( !myGetInputFromUser(wszCommandText, L"\nType the command "
00075       L"to execute [Enter = `select * from %s`]: ", wszTableName) )
00076     {
00077       swprintf(wszCommandText, L"select * from %s", wszTableName);
00078     }
00079
00080     // And execute the Command the user entered
00081     CHECK_HR(hr = myExecuteCommand(pUnkCommand, wszCommandText,
00082           1, rgPropSets, ppUnkRowset));
00083   }
00084   // Otherwise, the user gets the default behavior, which is to use
00085   // IOpenRowset to create the Rowset object from the Session object.
00086   // IOpenRowset is supported by all providers; it takes a TableID
00087   // and creates a rowset containing all rows in that table. It is
00088   // similar to using SQL command text of "select * from TableID"
00089   else
00090   {
00091     DBID        TableID;
00092
00093     // Create the TableID
00094     TableID.eKind     = DBKIND_NAME;
00095     TableID.uName.pwszName  = wszTableName;
00096
00097     // Obtain the table name from the user
00098     myGetInputFromUser(wszTableName, L"\nType the name of the table "
00099       L"to use [Enter = `%s`]: ", wszTableName);
00100
00101     // Get the IOpenRowset interface and create a Rowset object
00102     // over the requested table through OpenRowset
00103     XCHECK_HR(hr = pUnkSession->QueryInterface(
00104           IID_IOpenRowset, (void**)&pIOpenRowset));
00105     XCHECK_HR(hr = pIOpenRowset->OpenRowset(
00106           NULL,     //pUnkOuter
00107           &TableID,   //pTableID
00108           NULL,     //pIndexID
00109           IID_IRowset,  //riid
00110           1,        //cPropSets
00111           rgPropSets,   //rgPropSets
00112           ppUnkRowset   //ppRowset
00113           ));
00114   }
00115
00116 CLEANUP:
00117   if( pIOpenRowset )
00118     pIOpenRowset->Release();
00119   if( pUnkCommand )
00120     pUnkCommand->Release();
00121   return hr;
00122 }
00123
00124
00125 /////////////////////////////////////////////////////////////////
00126 // mySetupBindings
00127 //
00128 //  This function takes an IUnknown pointer from a Rowset object
00129 //  and creates a bindings array that describes how we want the
00130 //  data we fetch from the Rowset to be laid out in memory. It
00131 //  also calculates the total size of a row so that we can use
00132 //  this to allocate memory for the rows that we will fetch
00133 //  later.
00134 //
00135 //  For each column in the Rowset, there will be a corresponding
00136 //  element in the bindings array that describes how the
00137 //  provider should transfer the data, including length and
00138 //  status, for that column. This element also specifies the data
00139 //  type that the provider should return the column as. We will
00140 //  bind all columns as DBTYPE_WSTR, with a few exceptions
00141 //  detailed below, as providers are required to support the
00142 //  conversion of their column data to this type in the vast
00143 //  majority of cases. The exception to our binding as
00144 //  DBTYPE_WSTR is if the native column data type is
00145 //  DBTYPE_IUNKNOWN or if the user has requested that BLOB
00146 //  columns be bound as ISequentialStream objects, in which case
00147 //  we will bind those columns as ISequentialStream objects.
00148 //
00149 /////////////////////////////////////////////////////////////////
00150 HRESULT mySetupBindings
00151   (
00152   IUnknown *        pUnkRowset,
00153   ULONG *         pcBindings,
00154   DBBINDING **      prgBindings,
00155   ULONG *         pcbRowSize
00156   )
00157 {
00158   HRESULT         hr;
00159   ULONG         cColumns;
00160   DBCOLUMNINFO *      rgColumnInfo        = NULL;
00161   LPWSTR          pStringBuffer       = NULL;
00162   IColumnsInfo *      pIColumnsInfo       = NULL;
00163
00164   ULONG         iCol;
00165   ULONG         dwOffset          = 0;
00166   DBBINDING *       rgBindings          = NULL;
00167
00168   ULONG         cStorageObjs        = 0;
00169   BOOL          fMultipleObjs       = FALSE;
00170
00171   // Obtain the column information for the Rowset; from this, we can find
00172   // out the following information that we need to construct the bindings
00173   // array:
00174   //  - the number of columns
00175   //  - the ordinal of each column
00176   //  - the precision and scale of numeric columns
00177   //  - the OLE DB data type of the column
00178   XCHECK_HR(hr = pUnkRowset->QueryInterface(
00179         IID_IColumnsInfo, (void**)&pIColumnsInfo));
00180   XCHECK_HR(hr = pIColumnsInfo->GetColumnInfo(
00181         &cColumns,    //pcColumns
00182         &rgColumnInfo,  //prgColumnInfo
00183         &pStringBuffer  //ppStringBuffer
00184         ));
00185
00186   // Allocate memory for the bindings array; there is a one-to-one
00187   // mapping between the columns returned from GetColumnInfo and our
00188   // bindings
00189   rgBindings = (DBBINDING*)CoTaskMemAlloc(cColumns * sizeof(DBBINDING));
00190   CHECK_MEMORY(hr, rgBindings);
00191   memset(rgBindings, 0, cColumns * sizeof(DBBINDING));
00192
00193   // Determine if the Rowset supports multiple storage object bindings;
00194   // if it does not, we will only bind the first BLOB column or IUnknown
00195   // column as an ISequentialStream object, and will bind the rest as
00196   // DBTYPE_WSTR
00197   myGetProperty(pUnkRowset, IID_IRowset, DBPROP_MULTIPLESTORAGEOBJECTS,
00198     DBPROPSET_ROWSET, &fMultipleObjs);
00199
00200   // Construct the binding array element for each column
00201   for( iCol = 0; iCol < cColumns; iCol++ )
00202   {
00203     // This binding applies to the ordinal of this column
00204     rgBindings[iCol].iOrdinal = rgColumnInfo[iCol].iOrdinal;
00205
00206     // We are asking the provider to give us the data for this column
00207     // (DBPART_VALUE), the length of that data (DBPART_LENGTH), and
00208     // the status of the column (DBPART_STATUS)
00209     rgBindings[iCol].dwPart   = DBPART_VALUE|DBPART_LENGTH|DBPART_STATUS;
00210
00211     // The following values are the offsets to the status, length, and
00212     // data value that the provider will fill with the appropriate values
00213     // when we fetch data later. When we fetch data, we will pass a
00214     // pointer to a buffer that the provider will copy column data to,
00215     // in accordance with the binding we have provided for that column;
00216     // these are offsets into that future buffer
00217     rgBindings[iCol].obStatus = dwOffset;
00218     rgBindings[iCol].obLength = dwOffset + sizeof(DBSTATUS);
00219     rgBindings[iCol].obValue  = dwOffset + sizeof(DBSTATUS) + sizeof(ULONG);
00220
00221     // Any memory allocated for the data value will be owned by us, the
00222     // client. Note that no data will be allocated in this case, as the
00223     // DBTYPE_WSTR bindings we are using will tell the provider to simply
00224     // copy data directly into our provided buffer
00225     rgBindings[iCol].dwMemOwner = DBMEMOWNER_CLIENTOWNED;
00226
00227     // This is not a parameter binding
00228     rgBindings[iCol].eParamIO = DBPARAMIO_NOTPARAM;
00229
00230     // We want to use the precision and scale of the column
00231     rgBindings[iCol].bPrecision = rgColumnInfo[iCol].bPrecision;
00232     rgBindings[iCol].bScale   = rgColumnInfo[iCol].bScale;
00233
00234     // Bind this column as DBTYPE_WSTR, which tells the provider to
00235     // copy a Unicode string representation of the data into our buffer,
00236     // converting from the native type if necessary
00237     rgBindings[iCol].wType    = DBTYPE_WSTR;
00238
00239     // Initially, we set the length for this data in our buffer to 0;
00240     // the correct value for this will be calculated directly below
00241     rgBindings[iCol].cbMaxLen = 0;
00242
00243     // Determine the maximum number of bytes required in our buffer to
00244     // contain the Unicode string representation of the provider's native
00245     // data type, including room for the NULL-termination character
00246     switch( rgColumnInfo[iCol].wType )
00247     {
00248       case DBTYPE_NULL:
00249       case DBTYPE_EMPTY:
00250       case DBTYPE_I1:
00251       case DBTYPE_I2:
00252       case DBTYPE_I4:
00253       case DBTYPE_UI1:
00254       case DBTYPE_UI2:
00255       case DBTYPE_UI4:
00256       case DBTYPE_R4:
00257       case DBTYPE_BOOL:
00258       case DBTYPE_I8:
00259       case DBTYPE_UI8:
00260       case DBTYPE_R8:
00261       case DBTYPE_CY:
00262       case DBTYPE_ERROR:
00263         // When the above types are converted to a string, they
00264         // will all fit into 25 characters, so use that plus space
00265         // for the NULL-terminator
00266         rgBindings[iCol].cbMaxLen = (25 + 1) * sizeof(WCHAR);
00267         break;
00268
00269       case DBTYPE_DECIMAL:
00270       case DBTYPE_NUMERIC:
00271       case DBTYPE_DATE:
00272       case DBTYPE_DBDATE:
00273       case DBTYPE_DBTIMESTAMP:
00274       case DBTYPE_GUID:
00275         // Converted to a string, the above types will all fit into
00276         // 50 characters, so use that plus space for the terminator
00277         rgBindings[iCol].cbMaxLen = (50 + 1) * sizeof(WCHAR);
00278         break;
00279
00280       case DBTYPE_BYTES:
00281         // In converting DBTYPE_BYTES to a string, each byte
00282         // becomes two characters (e.g. 0xFF -> "FF"), so we
00283         // will use double the maximum size of the column plus
00284         // include space for the NULL-terminator
00285         rgBindings[iCol].cbMaxLen =
00286           (rgColumnInfo[iCol].ulColumnSize * 2 + 1) * sizeof(WCHAR);
00287         break;
00288
00289       case DBTYPE_STR:
00290       case DBTYPE_WSTR:
00291       case DBTYPE_BSTR:
00292         // Going from a string to our string representation,
00293         // we can just take the maximum size of the column,
00294         // a count of characters, and include space for the
00295         // terminator, which is not included in the column size
00296         rgBindings[iCol].cbMaxLen =
00297           (rgColumnInfo[iCol].ulColumnSize + 1) * sizeof(WCHAR);
00298         break;
00299
00300       default:
00301         // For any other type, we will simply use our maximum
00302         // column buffer size, since the display size of these
00303         // columns may be variable (e.g. DBTYPE_VARIANT) or
00304         // unknown (e.g. provider-specific types)
00305         rgBindings[iCol].cbMaxLen = MAX_COL_SIZE;
00306         break;
00307     };
00308
00309     // If the provider's native data type for this column is
00310     // DBTYPE_IUNKNOWN or this is a BLOB column and the user
00311     // has requested that we bind BLOB columns as ISequentialStream
00312     // objects, bind this column as an ISequentialStream object if
00313     // the provider supports our creating another ISequentialStream
00314     // binding
00315     if( (rgColumnInfo[iCol].wType == DBTYPE_IUNKNOWN ||
00316        ((rgColumnInfo[iCol].dwFlags & DBCOLUMNFLAGS_ISLONG) &&
00317         (g_dwFlags & USE_ISEQSTREAM))) &&
00318       (fMultipleObjs || !cStorageObjs) )
00319     {
00320       // To create an ISequentialStream object, we will
00321       // bind this column as DBTYPE_IUNKNOWN to indicate
00322       // that we are requesting this column as an object
00323       rgBindings[iCol].wType        = DBTYPE_IUNKNOWN;
00324
00325       // We want to allocate enough space in our buffer for
00326       // the ISequentialStream pointer we will obtain from
00327       // the provider
00328       rgBindings[iCol].cbMaxLen     = sizeof(ISequentialStream *);
00329
00330       // To specify the type of object that we want from the
00331       // provider, we need to create a DBOBJECT structure and
00332       // place it in our binding for this column
00333         rgBindings[iCol].pObject      =
00334                 (DBOBJECT *)CoTaskMemAlloc(sizeof(DBOBJECT));
00335       CHECK_MEMORY(hr, rgBindings[iCol].pObject);
00336
00337       // Direct the provider to create an ISequentialStream
00338       // object over the data for this column
00339       rgBindings[iCol].pObject->iid   = IID_ISequentialStream;
00340
00341       // We want read access on the ISequentialStream
00342       // object that the provider will create for us
00343       rgBindings[iCol].pObject->dwFlags = STGM_READ;
00344
00345       // Keep track of the number of storage objects (ISequentialStream
00346       // is a storage interface) that we have requested, so that we
00347       // can avoid requesting multiple storage objects from a provider
00348       // that only supports a single storage object in our bindings
00349       cStorageObjs++;
00350     }
00351
00352     // Ensure that the bound maximum length is no more than the
00353     // maximum column size in bytes that we've defined
00354     rgBindings[iCol].cbMaxLen
00355       = min(rgBindings[iCol].cbMaxLen, MAX_COL_SIZE);
00356
00357     // Update the offset past the end of this column's data, so
00358     // that the next column will begin in the correct place in
00359     // the buffer
00360     dwOffset = rgBindings[iCol].cbMaxLen + rgBindings[iCol].obValue;
00361
00362     // Ensure that the data for the next column will be correctly
00363     // aligned for all platforms, or, if we're done with columns,
00364     // that if we allocate space for multiple rows that the data
00365     // for every row is correctly aligned
00366     dwOffset = ROUNDUP(dwOffset);
00367   }
00368
00369   // Return the row size (the current dwOffset is the size of the row),
00370   // the count of bindings, and the bindings array to the caller
00371   *pcbRowSize   = dwOffset;
00372   *pcBindings   = cColumns;
00373   *prgBindings  = rgBindings;
00374
00375 CLEANUP:
00376   CoTaskMemFree(rgColumnInfo);
00377   CoTaskMemFree(pStringBuffer);
00378   if( pIColumnsInfo )
00379     pIColumnsInfo->Release();
00380   return hr;
00381 }
00382
00383
00384
00385 /////////////////////////////////////////////////////////////////
00386 // myCreateAccessor
00387 //
00388 //  This function takes an IUnknown pointer for a Rowset object
00389 //  and creates an Accessor that describes the layout of the
00390 //  buffer we will use when we fetch data. The provider will fill
00391 //  this buffer according to the description contained in the
00392 //  Accessor that we will create here.
00393 //
00394 /////////////////////////////////////////////////////////////////
00395 HRESULT myCreateAccessor
00396   (
00397   IUnknown *        pUnkRowset,
00398   HACCESSOR *       phAccessor,
00399   ULONG *         pcBindings,
00400   DBBINDING **      prgBindings,
00401   ULONG *         pcbRowSize
00402   )
00403 {
00404   HRESULT         hr;
00405   IAccessor *       pIAccessor          = NULL;
00406
00407   // An Accessor is basically a handle to a collection of bindings.
00408   // To create the Accessor, we need to first create an array of
00409   // bindings for the columns in the Rowset
00410   CHECK_HR(hr = mySetupBindings(pUnkRowset, pcBindings, prgBindings,
00411     pcbRowSize));
00412
00413   // Now that we have an array of bindings, tell the provider to
00414   // create the Accessor for those bindings. We get back a handle
00415   // to this Accessor, which we will use when fetching data
00416   XCHECK_HR(hr = pUnkRowset->QueryInterface(
00417         IID_IAccessor, (void**)&pIAccessor));
00418   XCHECK_HR(hr = pIAccessor->CreateAccessor(
00419         DBACCESSOR_ROWDATA, //dwAccessorFlags
00420         *pcBindings,    //cBindings
00421         *prgBindings,   //rgBindings
00422         0,          //cbRowSize
00423         phAccessor,     //phAccessor
00424         NULL        //rgStatus
00425         ));
00426
00427 CLEANUP:
00428   if( pIAccessor )
00429     pIAccessor->Release();
00430   return hr;
00431 }
00432
00433
00434 /////////////////////////////////////////////////////////////////
00435 // myDisplayRowset
00436 //
00437 //  This function will display data from a Rowset object and will
00438 //  allow the user to perform basic navigation of the rowset.
00439 //
00440 //  The function takes a pointer to a Rowset object's IUnknown
00441 //  and, optionally, the name of a column and a buffer that will
00442 //  receive the value of that column when the user selects a row.
00443 //
00444 /////////////////////////////////////////////////////////////////
00445 HRESULT myDisplayRowset
00446   (
00447   IUnknown *        pUnkRowset,
00448   LPCWSTR         pwszColToReturn,
00449   ULONG         cchBuffer,
00450   LPWSTR          pwszBuffer
00451   )
00452 {
00453   HRESULT         hr;
00454   IRowset *       pIRowset          = NULL;
00455   ULONG         cBindings;
00456   DBBINDING *       rgBindings          = NULL;
00457   HACCESSOR       hAccessor         = DB_NULL_HACCESSOR;
00458   ULONG         cbRowSize;
00459   void *          pData           = NULL;
00460   ULONG *         rgDispSize          = NULL;
00461   ULONG         cRowsObtained;
00462   HROW *          rghRows           = NULL;
00463   ULONG         iRow;
00464   LONG          cRows           = MAX_ROWS;
00465   LONG          iRetCol           = -1;
00466   BOOL          fCanFetchBackwards;
00467   ULONG         iIndex;
00468   void *          pCurData;
00469
00470   // Obtain the IRowset interface for use in fetching rows and data
00471   XCHECK_HR(hr = pUnkRowset->QueryInterface(
00472         IID_IRowset, (void**)&pIRowset));
00473
00474   // Determine whether this rowset supports fetching data backwards;
00475   // we use this to determine whether the rowset can support moving
00476   // to the previous set of rows, described in more detail below
00477   myGetProperty(pUnkRowset, IID_IRowset, DBPROP_CANFETCHBACKWARDS,
00478     DBPROPSET_ROWSET, &fCanFetchBackwards);
00479
00480   // If the caller wants us to return the data for a particular column
00481   // from a user-selected row, we need to turn the column name into a
00482   // column ordinal
00483   if( pwszColToReturn )
00484     CHECK_HR(hr = myFindColumn(pUnkRowset, pwszColToReturn, &iRetCol));
00485
00486   // Create an Accessor. An Accessor is basically a handle to a
00487   // collection of bindings that describes to the provider how to
00488   // copy (and convert, if necessary) column data into our buffer.
00489   // The Accessor that this creates will bind all columns as either
00490   // DBTYPE_WSTR (a Unicode string) or as an ISequentialStream object
00491   // (used for BLOB data). This will also give us the size of the
00492   // row buffer that the Accessor describes to the provider
00493   CHECK_HR(hr = myCreateAccessor(pUnkRowset, &hAccessor,
00494                     &cBindings, &rgBindings, &cbRowSize));
00495
00496   // Allocate enough memory to hold cRows rows of data; this is
00497   // where the actual row data from the provider will be placed
00498   pData = CoTaskMemAlloc(cbRowSize * MAX_ROWS);
00499   CHECK_MEMORY(hr, pData);
00500
00501   // Allocate memory for an array that we will use to calculate the
00502   // maximum display size used by each column in the current set of
00503   // rows
00504   rgDispSize = (ULONG *)CoTaskMemAlloc(cBindings * sizeof(ULONG));
00505   CHECK_MEMORY(hr, rgDispSize);
00506
00507   // In this loop, we perform the following process:
00508   //  - reset the maximum display size array
00509   //  - try to get cRows row handles from the provider
00510   //  - these handles are then used to actually get the row data from the
00511   //    provider copied into our allocated buffer
00512   //  - calculate the maximum display size for each column
00513   //  - release the row handles to the rows we obtained
00514   //  - display the column names for the rowset
00515   //  - display the row data for the rows that we fetched
00516   //  - get user input
00517   //  - free the provider-allocated row handle array
00518   //  - repeat unless the user has chosen to quit or has selected a row
00519   while( hr == S_OK )
00520   {
00521     // Clear the maximum display size array
00522     memset(rgDispSize, 0, cBindings * sizeof(ULONG));
00523
00524     // Attempt to get cRows row handles from the provider
00525     XCHECK_HR(hr = pIRowset->GetNextRows(
00526           DB_NULL_HCHAPTER, //hChapter
00527           0,          //lOffset
00528           cRows,        //cRows
00529           &cRowsObtained,   //pcRowsObtained
00530           &rghRows      //prghRows
00531           ));
00532
00533     // Loop over the row handles obtained from GetNextRows,
00534     // actually fetching the data for these rows into our buffer
00535     for( iRow = 0; iRow < cRowsObtained; iRow++ )
00536     {
00537       // Find the location in our buffer where we want to place
00538       // the data for this row. Note that if we fetched rows
00539       // backwards (cRows < 0), the row handles obtained from the
00540       // provider are reversed from the order in which we want to
00541       // actually display the data on the screen, so we will
00542       // account for this. This ensures that the resulting order
00543       // of row data in the pData buffer matches the order we
00544       // wish to use to display the data
00545       iIndex    = cRows > 0 ? iRow : cRowsObtained - iRow - 1;
00546       pCurData  = (BYTE*)pData + (cbRowSize * iIndex);
00547
00548       // Get the data for this row handle. The provider will copy
00549       // (and convert, if necessary) the data for each of the
00550       // columns that are described in our Accessor into the given
00551       // buffer (pCurData)
00552       XCHECK_HR(hr = pIRowset->GetData(
00553           rghRows[iRow],  //hRow
00554           hAccessor,    //hAccessor
00555           pCurData    //pData
00556           ));
00557
00558       // Update the maximum display size array, accounting for this row
00559       CHECK_HR(hr = myUpdateDisplaySize(cBindings, rgBindings,
00560         pCurData, rgDispSize));
00561     }
00562
00563     // If we obtained rows, release the row handles for the retrieved rows
00564     // and display the names of the rowset columns before we display the data
00565     if( cRowsObtained )
00566     {
00567       // Release the row handles that we obtained
00568       XCHECK_HR(hr = pIRowset->ReleaseRows(
00569             cRowsObtained,  //cRows
00570             rghRows,    //rghRows
00571             NULL,     //rgRowOptions
00572             NULL,     //rgRefCounts
00573             NULL      //rgRowStatus
00574             ));
00575
00576
00577       // Display the names of the rowset columns
00578       CHECK_HR(hr = myDisplayColumnNames(pIRowset, rgDispSize));
00579     }
00580
00581     // For each row that we obtained the data for, display this data
00582     for( iRow = 0; iRow < cRowsObtained; iRow++ )
00583     {
00584       // Get a pointer to the data for this row
00585       pCurData = (BYTE*)pData + (cbRowSize* iRow);
00586
00587       // And display the row data
00588       CHECK_HR(hr = myDisplayRow(iRow, cBindings, rgBindings,
00589         pCurData, rgDispSize));
00590     }
00591
00592     // Allow the user to navigate the rowset. This displays the appropriate
00593     // prompts, gets the user's input, may call IRowset::RestartPosition,
00594     // and may copy data from a selected row to the selection buffer, if so
00595     // directed. This will return S_OK if the user asked for more rows,
00596     // S_FALSE if the user selected a row, or E_FAIL if the user quits
00597     hr = myInteractWithRowset(
00598       pIRowset,         // IRowset pointer, for RestartPosition
00599       &cRows,           // updated with fetch direction value
00600       cRowsObtained,        // to indicate selection range
00601       fCanFetchBackwards,     // whether [P]revious is supported
00602       pData,            // data pointer for copying selection
00603       cbRowSize,          // size of rows for copying selection
00604       iRetCol >= 0 ?        // bindings for the selection column,
00605         &rgBindings[iRetCol] :  //  or NULL if no selection column
00606         NULL,
00607       cchBuffer,          // size of the selection buffer
00608       pwszBuffer);        // pointer to the selection buffer
00609
00610     // Since we are allowing the provider to allocate the memory for
00611     // the row handle array, we will free this memory and reset the
00612     // pointer to NULL. If this is not NULL on the next call to GetNextRows,
00613     // the provider will assume that it points to an allocated array of
00614     // the required size (which may not be the case if we obtained less
00615     // than cRows rows from this last call to GetNextRows
00616     CoTaskMemFree(rghRows);
00617     rghRows = NULL;
00618   }
00619
00620 CLEANUP:
00621   myFreeBindings(cBindings, rgBindings);
00622   CoTaskMemFree(rgDispSize);
00623   CoTaskMemFree(pData);
00624   if( pIRowset )
00625     pIRowset->Release();
00626   return hr;
00627 }
00628
00629
00630
00631 /////////////////////////////////////////////////////////////////
00632 // myInteractWithRowset
00633 //
00634 //  This function allows the user to interact with the rowset. It
00635 //  prompts the user appropriately, gets the user's input, may
00636 //  call IRowset::RestartPosition if the user requests a restart,
00637 //  and will copy data from a selected row to the selection
00638 //  buffer.
00639 //
00640 /////////////////////////////////////////////////////////////////
00641 HRESULT myInteractWithRowset
00642   (
00643   IRowset *       pIRowset,
00644   LONG *          pcRows,
00645   ULONG         cRowsObtained,
00646   BOOL          fCanFetchBackwards,
00647   void *          pData,
00648   ULONG         cbRowSize,
00649   DBBINDING *       pBinding,
00650   ULONG         cchBuffer,
00651   LPWSTR          pwszBuffer
00652   )
00653 {
00654   HRESULT         hr              = S_OK;
00655   CHAR          ch;
00656
00657   // Let the user know if no rows were fetched
00658   if( !cRowsObtained )
00659     printf("\n*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\n" \
00660          "*                                 *\n" \
00661          "* No rows obtained on this fetch! *\n" \
00662          "*                                 *\n" \
00663          "*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
00664
00665   // Print navigation options
00666   if( fCanFetchBackwards )
00667     printf("\n[P]revious; [N]ext; [R]estart; ");
00668   else
00669     printf("\n[N]ext; [R]estart; ");
00670
00671   // Print selection options
00672   if( cRowsObtained && pwszBuffer && pBinding )
00673     printf("[0]-[%d] for a row; ", cRowsObtained - 1);
00674
00675   // User can always quit the program
00676   printf("[Q]uit? ");
00677
00678   // Get the user's input
00679   while( TRUE )
00680   {
00681     // Get a character from the console
00682     ch = myGetChar();
00683
00684     // Look for one of the allowed options; if not found, go
00685     // back around and wait for another input from the user
00686
00687     // If we're looking for a row selection, allow the user to select
00688     // a row that we fetched, then copy the data from the requested
00689     // column into the selection buffer we were passed
00690     if( pwszBuffer && pBinding &&
00691       ch >= '0' && ch < (int)('0' + cRowsObtained) )
00692     {
00693       // Save the data for the selected row
00694       ULONG nSelection = ch - '0';
00695       _snwprintf(pwszBuffer, cchBuffer, L"%s",
00696           (WCHAR *)((BYTE *)pData + cbRowSize * nSelection +
00697           pBinding->obValue));
00698       pwszBuffer[cchBuffer] = L'\0';
00699       hr = S_FALSE;
00700     }
00701     // If the provider supports fetching backwards, set *pcRows
00702     // to -MAX_ROWS. When GetNextRows is called with this value,
00703     // it will fetch rows backwards from the current position
00704     // until it fetches MAX_ROWS rows or hits the end of the rowset
00705     else if( fCanFetchBackwards && ch == 'p' )
00706     {
00707       // Fetch backwards
00708       *pcRows = -MAX_ROWS;
00709     }
00710     // Set *pcRows so that the next call to GetNextRows fetches
00711     // MAX_ROWS rows forward from the current position
00712     else if( ch == 'n' )
00713     {
00714       // Fetch forward
00715       *pcRows = MAX_ROWS;
00716     }
00717     // Call IRowset::RestartPosition and fetch the first MAX_ROWS
00718     // rows of the rowset forward from there
00719     else if( ch == 'r' )
00720     {
00721       // RestartPosition
00722       *pcRows = MAX_ROWS;
00723       XCHECK_HR(hr = pIRowset->RestartPosition(DB_NULL_HCHAPTER));
00724
00725       // Restarting a command may return the DB_S_COMMANDREEXECUTED
00726       // warning. If this happens, we still want the caller to
00727       // continue to display data, so we will reset the result code
00728       // to S_OK
00729       hr = S_OK;
00730     }
00731     // Quit the program
00732     else if( ch == 'q' )
00733     {
00734       hr = E_FAIL;
00735     }
00736     // Invalid option; go back up and get another character from the user
00737     else
00738     {
00739       continue;
00740     }
00741
00742     // Echo the character and stop waiting for input
00743     printf("%c\n", ch);
00744     break;
00745   }
00746
00747 CLEANUP:
00748   return hr;
00749 }
00750
00751
00752 /////////////////////////////////////////////////////////////////
00753 // myDisplayColumnNames
00754 //
00755 //  This function takes an IUnknown pointer to a Rowset object
00756 //  and displays the names of the columns of that Rowset.
00757 //
00758 /////////////////////////////////////////////////////////////////
00759 HRESULT myDisplayColumnNames
00760   (
00761   IUnknown *        pUnkRowset,
00762   ULONG *         rgDispSize
00763   )
00764 {
00765   HRESULT         hr;
00766   IColumnsInfo *      pIColumnsInfo       = NULL;
00767   ULONG         cColumns;
00768   DBCOLUMNINFO *      rgColumnInfo        = NULL;
00769   LPOLESTR        pStringsBuffer        = NULL;
00770   WCHAR         wszColumn[MAX_DISPLAY_SIZE + 1];
00771   LPWSTR          pwszColName;
00772   ULONG         iCol;
00773   ULONG         cSpaces;
00774   ULONG         iSpace;
00775
00776   // Get the IColumnsInfo interface for the Rowset
00777   XCHECK_HR(hr = pUnkRowset->QueryInterface(
00778         IID_IColumnsInfo, (void**)&pIColumnsInfo));
00779
00780   // Get the columns information
00781   XCHECK_HR(hr = pIColumnsInfo->GetColumnInfo(
00782         &cColumns,    //pcColumns
00783         &rgColumnInfo,  //prgColumnInfo
00784         &pStringsBuffer //ppStringBuffer
00785         ));
00786
00787   // Display the title of the row index column
00788   wprintf(L" Row | ");
00789
00790   // Display all column names
00791   for( iCol = 0; iCol < cColumns; iCol++ )
00792   {
00793     pwszColName = rgColumnInfo[iCol].pwszName;
00794
00795     // If the column name is NULL, we'll use a default string
00796     if( !pwszColName )
00797     {
00798       // Is this the bookmark column?
00799       if( !rgColumnInfo[iCol].iOrdinal )
00800         pwszColName = L"Bmk";
00801       else
00802         pwszColName = L"(null)";
00803     }
00804
00805     // Ensure that the name is no longer than MAX_DISPLAY_SIZE
00806     wcsncpy(wszColumn, pwszColName, MAX_DISPLAY_SIZE);
00807     wszColumn[min(rgDispSize[iCol], MAX_DISPLAY_SIZE)] = L'\0';
00808
00809     // Figure out how many spaces we need to print after this column name
00810     cSpaces = min(rgDispSize[iCol], MAX_DISPLAY_SIZE) - wcslen(wszColumn);
00811
00812     // Print the column name
00813     wprintf(L"%s", wszColumn);
00814
00815     // Now print any spaces necessary to align this column
00816     for(iSpace = 0; iSpace < cSpaces; iSpace++ )
00817       putch(' ');
00818
00819     // Now end the column with a separator marker if necessary
00820     if( iCol < cColumns - 1 )
00821       wprintf(L" | ");
00822   }
00823
00824   // Done with the header, so print a newline
00825   wprintf(L"\n");
00826
00827 CLEANUP:
00828   CoTaskMemFree(rgColumnInfo);
00829   CoTaskMemFree(pStringsBuffer);
00830   if( pIColumnsInfo )
00831     pIColumnsInfo->Release();
00832   return hr;
00833 }
00834
00835
00836 /////////////////////////////////////////////////////////////////
00837 // myDisplayRow
00838 //
00839 //  This function displays the data for a row.
00840 //
00841 /////////////////////////////////////////////////////////////////
00842 HRESULT myDisplayRow
00843   (
00844   ULONG         iRow,
00845   ULONG         cBindings,
00846   DBBINDING *       rgBindings,
00847   void *          pData,
00848   ULONG *         rgDispSize
00849   )
00850 {
00851   HRESULT         hr              = S_OK;
00852   WCHAR         wszColumn[MAX_DISPLAY_SIZE + 1];
00853   DBSTATUS        dwStatus;
00854   ULONG         ulLength;
00855   void *          pvValue;
00856   ULONG         iCol;
00857   ULONG         cbRead;
00858   ISequentialStream *   pISeqStream         = NULL;
00859   ULONG         cSpaces;
00860   ULONG         iSpace;
00861
00862   // Display the row number
00863   wprintf(L" [%d] | ", iRow);
00864
00865   // For each column that we have bound, display the data
00866   for( iCol = 0; iCol < cBindings; iCol++ )
00867   {
00868     // We have bound status, length, and the data value for all
00869     // columns, so we know that these can all be used
00870     dwStatus  = *(DBSTATUS *)((BYTE *)pData + rgBindings[iCol].obStatus);
00871     ulLength  = *(ULONG *)((BYTE *)pData + rgBindings[iCol].obLength);
00872     pvValue   = (BYTE *)pData + rgBindings[iCol].obValue;
00873
00874     // Check the status of this column. This decides
00875     // exactly what will be displayed for the column
00876     switch( dwStatus )
00877     {
00878       // The data is NULL, so don't try to display it
00879       case DBSTATUS_S_ISNULL:
00880         wcscpy(wszColumn, L"(null)");
00881         break;
00882
00883       // The data was fetched, but may have been truncated.
00884       // Display string data for this column to the user
00885       case DBSTATUS_S_TRUNCATED:
00886       case DBSTATUS_S_OK:
00887       case DBSTATUS_S_DEFAULT:
00888       {
00889         // We have either bound the column as a Unicode string
00890         // (DBTYPE_WSTR) or as an ISequentialStream object
00891         // (DBTYPE_IUNKNOWN), and have to do different processing
00892         // for each one of these possibilities
00893         switch( rgBindings[iCol].wType )
00894         {
00895           case DBTYPE_WSTR:
00896           {
00897             // Copy the string data
00898             wcsncpy(wszColumn, (WCHAR *)pvValue, MAX_DISPLAY_SIZE);
00899             wszColumn[MAX_DISPLAY_SIZE - 1] = L'\0';
00900             break;
00901           }
00902
00903           case DBTYPE_IUNKNOWN:
00904           {
00905             // We've bound this as an ISequentialStream object,
00906             // therefore the data in our buffer is a pointer
00907             // to the object's ISequentialStream interface
00908             pISeqStream =  *(ISequentialStream**)pvValue;
00909
00910             // We call ISequentialStream::Read to read bytes from
00911             // the stream blindly into our buffer, simply as a
00912             // demonstration of ISequentialStream. To display the
00913             // data properly, the native provider type of this
00914             // column should be accounted for; it could be
00915             // DBTYPE_WSTR, in which case this works, or it could
00916             // be DBTYPE_STR or DBTYPE_BYTES, in which case this
00917             // won't display the data correctly
00918             CHECK_HR(hr = pISeqStream->Read(
00919                   wszColumn,      //pBuffer
00920                   MAX_DISPLAY_SIZE, //cBytes
00921                   &cbRead       //pcBytesRead
00922                   ));
00923
00924             // Since streams don't provide NULL-termination,
00925             // we'll NULL-terminate the resulting string ourselves
00926             wszColumn[cbRead / sizeof(WCHAR)] = L'\0';
00927
00928             // Release the stream object, now that we're done
00929             pISeqStream->Release();
00930             pISeqStream = NULL;
00931             break;
00932           }
00933         }
00934         break;
00935       }
00936
00937       // This is an error status, so don't try to display the data
00938       default:
00939         wcscpy(wszColumn, L"(error status)");
00940         break;
00941     }
00942
00943     // Determine how many spaces we need to add after displaying this
00944     // data to align it with this column in other rows
00945     cSpaces = min(rgDispSize[iCol], MAX_DISPLAY_SIZE) - wcslen(wszColumn);
00946
00947     // Print the column data
00948     wprintf(L"%s", wszColumn);
00949
00950     // Now print any spaces necessary
00951     for(iSpace = 0; iSpace < cSpaces; iSpace++ )
00952       putch(' ');
00953
00954     // Now end the column with a separator marker if necessary
00955     if( iCol < cBindings - 1 )
00956       wprintf(L" | ");
00957   }
00958
00959 CLEANUP:
00960   if( pISeqStream )
00961     pISeqStream->Release();
00962
00963   // Print the row separator
00964   wprintf(L"\n");
00965   return hr;
00966 }
00967
00968
00969
00970 /////////////////////////////////////////////////////////////////
00971 // myFreeBindings
00972 //
00973 //  This function frees a bindings array and any allocated
00974 //  structures contained in that array.
00975 //
00976 /////////////////////////////////////////////////////////////////
00977 void myFreeBindings
00978   (
00979   ULONG         cBindings,
00980   DBBINDING *       rgBindings
00981   )
00982 {
00983   ULONG         iBind;
00984
00985   // Free any memory used by DBOBJECT structures in the array
00986   for( iBind = 0; iBind < cBindings; iBind++ )
00987     CoTaskMemFree(rgBindings[iBind].pObject);
00988
00989   // Now free the bindings array itself
00990   CoTaskMemFree(rgBindings);
00991 }
00992
00993
00994 /////////////////////////////////////////////////////////////////
00995 // myAddRowsetProperties
00996 //
00997 //  This function sets up the given DBPROPSET and DBPROP
00998 //  structures, adding two optional properties that describe
00999 //  features that we would like to use on the Rowset created
01000 //  with these properties applied:
01001 //   - DBPROP_CANFETCHBACKWARDS -- the rowset should support
01002 //     fetching rows backwards from our current cursor position
01003 //   - DBPROP_IRowsetLocate     -- the rowset should support
01004 //     the IRowsetLocate interface and its semantics
01005 //
01006 /////////////////////////////////////////////////////////////////
01007 void myAddRowsetProperties(DBPROPSET* pPropSet, ULONG cProperties, DBPROP* rgProperties)
01008 {
01009   // Initialize the property set array
01010   pPropSet->rgProperties    = rgProperties;
01011   pPropSet->cProperties   = cProperties;
01012   pPropSet->guidPropertySet = DBPROPSET_ROWSET;
01013
01014   // Add the following two properties (as OPTIONAL) to the property
01015   // array contained in the property set array in order to request
01016   // that they be supported by the rowset we will create. Because
01017   // these are optional, the rowset we obtain may or may not support
01018   // this functionality. We will check for the functionality that
01019   // we need once the rowset is created and will modify our behavior
01020   // appropriately
01021   myAddProperty(&rgProperties[0], DBPROP_CANFETCHBACKWARDS);
01022   myAddProperty(&rgProperties[1], DBPROP_IRowsetLocate);
01023 }
01024
01025
01026 /////////////////////////////////////////////////////////////////
01027 // myUpdateDisplaySize
01028 //
01029 //  This function updates the rgDispSize array, keeping the
01030 //  maximum of the display size needed for the given data and
01031 //  the previous maximum size already in the array.
01032 //
01033 /////////////////////////////////////////////////////////////////
01034 HRESULT myUpdateDisplaySize
01035   (
01036   ULONG         cBindings,
01037   DBBINDING *       rgBindings,
01038   void *          pData,
01039   ULONG *         rgDispSize
01040   )
01041 {
01042   DBSTATUS        dwStatus;
01043   ULONG         cchLength;
01044   ULONG         iCol;
01045
01046   // Loop through the bindings, comparing the size of each column
01047   // against the previously found maximum size for that column
01048   for( iCol = 0; iCol < cBindings; iCol++ )
01049   {
01050     dwStatus  = *(DBSTATUS *)((BYTE *)pData + rgBindings[iCol].obStatus);
01051     cchLength = ((*(ULONG *)((BYTE *)pData + rgBindings[iCol].obLength))
01052           / sizeof(WCHAR));
01053
01054     // The length that we need to display depends on the status
01055     // of this column and generally on the data in the column
01056     switch( dwStatus )
01057     {
01058       case DBSTATUS_S_ISNULL:
01059         cchLength = 6;            // "(null)"
01060         break;
01061
01062       case DBSTATUS_S_TRUNCATED:
01063       case DBSTATUS_S_OK:
01064       case DBSTATUS_S_DEFAULT:
01065         if( rgBindings[iCol].wType == DBTYPE_IUNKNOWN )
01066           cchLength = 2 + 8;        // "0x%08lx"
01067
01068         // Ensure that the length is at least the minimum display size
01069         cchLength = max(cchLength, MIN_DISPLAY_SIZE);
01070         break;
01071
01072       default:
01073         cchLength = 14;           // "(error status)"
01074         break;
01075     }
01076
01077     if( rgDispSize[iCol] < cchLength )
01078       rgDispSize[iCol] = cchLength;
01079   }
01080
01081   return S_OK;
01082 }
01083
01084
01085 /////////////////////////////////////////////////////////////////
01086 // myFindColumn
01087 //
01088 //  Find the index of the column described in pwszName and return
01089 //  S_OK, or, if not found, S_FALSE.
01090 //
01091 /////////////////////////////////////////////////////////////////
01092 HRESULT myFindColumn
01093   (
01094   IUnknown *        pUnkRowset,
01095   LPCWSTR         pwszName,
01096   LONG *          plIndex
01097   )
01098 {
01099   HRESULT         hr;
01100   IColumnsInfo *      pIColumnsInfo       = NULL;
01101   ULONG         cColumns;
01102   DBCOLUMNINFO *      rgColumnInfo        = NULL;
01103   OLECHAR *       pStringsBuffer        = NULL;
01104   ULONG         iCol;
01105
01106   // Get the IColumnsInfo interface
01107   XCHECK_HR(hr = pUnkRowset->QueryInterface(
01108         IID_IColumnsInfo, (void**)&pIColumnsInfo));
01109
01110   // Get the columns information
01111   XCHECK_HR(hr = pIColumnsInfo->GetColumnInfo(
01112         &cColumns,    //pcColumns
01113         &rgColumnInfo,  //prgColumnInfo
01114         &pStringsBuffer //ppStringBuffer
01115         ));
01116
01117   // Assume that we'll find the column
01118   hr = S_OK;
01119
01120   // Search for the column we need
01121   for( iCol = 0; iCol < cColumns; iCol++ )
01122   {
01123     // If the column name matches we've found the column...
01124     if( rgColumnInfo[iCol].pwszName &&
01125       !wcscmp(pwszName, rgColumnInfo[iCol].pwszName) )
01126     {
01127       *plIndex = iCol;
01128       goto CLEANUP;
01129     }
01130   }
01131
01132   // If we didn't find the column, we'll return S_FALSE
01133   hr = S_FALSE;
01134
01135 CLEANUP:
01136   CoTaskMemFree(rgColumnInfo);
01137   CoTaskMemFree(pStringsBuffer);
01138   if( pIColumnsInfo )
01139     pIColumnsInfo->Release();
01140   return hr;
01141 }
01142
01143
Generated on Wed Nov 13 2024 16:52:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/DragImg/Enumfe.h Source File

  • WinUI
  • Shell
  • DragImg

Enumfe.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006
00007    Copyright 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00008 **************************************************************************/
00009
00010 /**************************************************************************
00011
00012    File:          EnumFE.h
00013
00014    Description:
00015
00016 **************************************************************************/
00017
00018 #ifndef ENUMFE_H
00019 #define ENUMFE_H
00020
00021 /**************************************************************************
00022    #include statements
00023 **************************************************************************/
00024
00025 #include <windows.h>
00026 #include <ole2.h>
00027
00028 /**************************************************************************
00029    class definitions
00030 **************************************************************************/
00031
00032 class CEnumFormatEtc : public IEnumFORMATETC
00033 {
00034 private:
00035    DWORD m_cRefCount;
00036    LPFORMATETC m_pStrFE;
00037    ULONG m_iCur;
00038    ULONG m_cItems;
00039
00040 public:
00041    CEnumFormatEtc(LPFORMATETC pFE,int numberItems);
00042    ~CEnumFormatEtc(void);
00043
00044    //BOOL FInit(HWND);
00045
00046    //IUnknown members
00047    STDMETHOD(QueryInterface)(REFIID, LPVOID*);
00048    STDMETHOD_(ULONG, AddRef)(void);
00049    STDMETHOD_(ULONG, Release)(void);
00050
00051    //IEnumFORMATETC members
00052    STDMETHOD(Next)(ULONG, LPFORMATETC, ULONG*);
00053    STDMETHOD(Skip)(ULONG);
00054    STDMETHOD(Reset)(void);
00055    STDMETHOD(Clone)(IEnumFORMATETC**);
00056 };
00057
00058 #endif   //ENUMFE_H
Generated on Wed Nov 13 2024 16:52:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDownloadUI Member List

This is the complete list of members for CDownloadUI, including all inherited members.
CDownloadUI() | CDownloadUI |
GetCurrentWindow() | CDownloadUI |
HasUserCanceled() | CDownloadUI |
IncrementProgressBar(ULONG ulProgress) | CDownloadUI |
Initialize(HINSTANCE hInst, HWND hwndParent, LPCSTR szCaption) | CDownloadUI |
InitProgressBar(ULONG ulProgressMax) | CDownloadUI |
m_fInitialized | CDownloadUI | [private]
m_fUserCancel | CDownloadUI | [private]
m_hInst | CDownloadUI | [private]
m_hwndParent | CDownloadUI | [private]
m_hwndProgress | CDownloadUI | [private]
m_szCaption | CDownloadUI | [private]
m_ulProgressMax | CDownloadUI | [private]
m_ulProgressSoFar | CDownloadUI | [private]
SetActionText(LPCSTR szAction) | CDownloadUI |
SetBannerText(LPCSTR szBanner) | CDownloadUI |
SetUserCancel() | CDownloadUI |
Terminate() | CDownloadUI |
~CDownloadUI() | CDownloadUI |
Generated on Wed Nov 13 2024 16:56:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

DEB_STARTUP_INFO_STRUCT Member List

This is the complete list of members for DEB_STARTUP_INFO_STRUCT, including all inherited members.
dwProcessId | DEB_STARTUP_INFO_STRUCT
fActive | DEB_STARTUP_INFO_STRUCT
hWndListBox | DEB_STARTUP_INFO_STRUCT
lpstrFileName | DEB_STARTUP_INFO_STRUCT
lpstrPathName | DEB_STARTUP_INFO_STRUCT
ProcessInfo | DEB_STARTUP_INFO_STRUCT
StartupInfo | DEB_STARTUP_INFO_STRUCT
Generated on Wed Nov 13 2024 16:57:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IGrid Member List

This is the complete list of members for IGrid, including all inherited members.
GridSize([out, retval] long *pVal) | IGrid
GridSize([in] long newVal) | IGrid
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLogFile Member List

This is the complete list of members for CLogFile, including all inherited members.
Activate() | CLogFile | [private]
CLogFile() | CLogFile | [inline]
Construct(IDispatch *pCtorObj) | CLogFile | [private]
m_hFile | CLogFile | [private]
m_pContextState | CLogFile | [private]
STDMETHOD_(VOID, Deactivate)() | CLogFile | [private]
STDMETHOD_(BOOL, CanBePooled)() | CLogFile | [private]
Write(BSTR buf, DWORD dwID) | CLogFile | [private]
~CLogFile() | CLogFile |
Generated on Wed Nov 13 2024 16:56:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CQCSub Member List

This is the complete list of members for CQCSub, including all inherited members.
CQCSub(CComSpy *pSpy) | CQCSub | [inline]
CQCSub() | CQCSub | [inline]
CSysLCESub() | CSysLCESub | [inline]
GetEventClass(LPGUID guid) | CQCSub | [inline, virtual]
GetEventType(EventEnum *e) | CQCSub | [inline, virtual]
GetInterface(IID *iid) | CQCSub | [inline, virtual]
Install(BSTR *PropertyName, VARIANT PropertyValue) | CSysLCESub |
m_pSpy | CSysLCESub | [protected]
m_SubscriptionGuid | CSysLCESub | [protected]
OnQCMoveToDeadQueue(COMSVCSEVENTINFO *pInfo, REFGUID guidMsgId, REFGUID guidWorkFlowId) | CQCSub | [inline]
OnQCMoveToReTryQueue(COMSVCSEVENTINFO *pInfo, REFGUID guidMsgId, REFGUID guidWorkFlowId, ULONG RetryIndex) | CQCSub | [inline]
OnQCPlayback(COMSVCSEVENTINFO *pInfo, ULONG64 objid, REFGUID guidMsgId, REFGUID guidWorkFlowId, HRESULT msmqhr) | CQCSub | [inline]
OnQCQueueOpen(COMSVCSEVENTINFO *pInfo, WCHAR szQueue[60], ULONG64 QueueID, HRESULT msmqhr) | CQCSub | [inline]
OnQCReceive(COMSVCSEVENTINFO *pInfo, ULONG64 QueueID, REFGUID guidMsgId, REFGUID guidWorkFlowId, HRESULT msmqhr) | CQCSub | [inline]
OnQCReceiveFail(COMSVCSEVENTINFO *pInfo, ULONG64 QueueID, HRESULT msmqhr) | CQCSub | [inline]
OnQCRecord(COMSVCSEVENTINFO *pInfo, ULONG64 objid, WCHAR szQueue[60], REFGUID guidMsgId, REFGUID guidWorkFlowId, HRESULT msmqhr) | CQCSub | [inline]
SetSpyObj(CComSpy *pSpy) | CSysLCESub | [inline]
Uninstall() | CSysLCESub |
Generated on Wed Nov 13 2024 16:57:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Nodes/statnode.Cpp Source File

  • SysMgmt
  • MMC
  • Nodes

statnode.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #include "StatNode.h"
00021
00022 #include "Space.h"
00023 #include "Sky.h"
00024 #include "People.h"
00025 #include "Land.h"
00026 #include "Backgrnd.h"
00027
00028 const GUID CStaticNode::thisGuid = { 0x2974380c, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00029
00030 //==============================================================
00031 //
00032 // CStaticNode implementation
00033 //
00034 //
00035 CStaticNode::CStaticNode()
00036 {
00037     children[0] = new CPeoplePoweredVehicle;
00038     children[1] = new CLandBasedVehicle;
00039     children[2] = new CSkyBasedVehicle;
00040     children[3] = new CSpaceVehicle;
00041     children[4] = new CBackgroundFolder;
00042 }
00043
00044 CStaticNode::~CStaticNode()
00045 {
00046     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00047         if (children[n]) {
00048             delete children[n];
00049         }
00050
00051   if (m_pBMapSm != NULL)
00052     DeleteObject(m_pBMapSm);
00053
00054   if (m_pBMapLg != NULL)
00055     DeleteObject(m_pBMapLg);
00056 }
00057
00058 HRESULT CStaticNode::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00059 {
00060     SCOPEDATAITEM sdi;
00061
00062     if (!bExpanded) {
00063         // create the child nodes, then expand them
00064         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00065             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00066             sdi.mask = SDI_STR       |   // Displayname is valid
00067                 SDI_PARAM     |   // lParam is valid
00068                 SDI_IMAGE     |   // nImage is valid
00069                 SDI_OPENIMAGE |   // nOpenImage is valid
00070                 SDI_PARENT    |
00071                 SDI_CHILDREN;
00072
00073             sdi.relativeID  = (HSCOPEITEM)parent;
00074             sdi.nImage      = children[n]->GetBitmapIndex();
00075             sdi.nOpenImage  = INDEX_OPENFOLDER;
00076             sdi.displayname = MMC_CALLBACK;
00077             sdi.lParam      = (LPARAM)children[n];       // The cookie
00078             sdi.cChildren   = (n == 0); // only the first child has children
00079
00080             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00081
00082             _ASSERT( SUCCEEDED(hr) );
00083         }
00084     }
00085
00086     return S_OK;
00087 }
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/adddevicedlg.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

adddevicedlg.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  AddDeviceDlg.cpp:  Implementation of the CAddDeviceDlg class.
00015 //
00016
00017
00018
00019 #include "AddDeviceDlg.h"
00020 #include "Globals.h"
00021 #include "Resource.h"        // Control IDs
00022 #include "BaseNode.h"        // NODE_PROPERTIES struct
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //  Construction-Destruction
00026
00027 //---------------------------------------------------------------------------
00028 //
00029 CAddDeviceDlg::CAddDeviceDlg( ULONG nTemplate, HWND pParentWnd )
00030              : CBaseDialog( nTemplate )
00031 {
00032   _ASSERT( NULL != pParentWnd );
00033   m_hParentWnd = pParentWnd;
00034
00035 }
00036
00037 CAddDeviceDlg::~CAddDeviceDlg()
00038 {
00039 }
00040
00041 /////////////////////////////////////////////////////////////////////////////
00042 //  Message handlers
00043
00044
00045 //---------------------------------------------------------------------------
00046 LRESULT CAddDeviceDlg::OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam )
00047 {
00048   LRESULT lResult = 0;
00049
00050   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00051   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00052   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00053   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00054   HWND hBackupCtrl   = GetDlgItem( hDlg, IDC_BACKUP_FLAG   );
00055   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00056
00057   lResult = SendMessage( hArchiveCtrl,  BM_SETCHECK, BST_UNCHECKED, 0 );
00058   lResult = SendMessage( hHiddenCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00059   lResult = SendMessage( hLockedCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00060   lResult = SendMessage( hBackupCtrl,   BM_SETCHECK, BST_UNCHECKED, 0 );
00061   lResult = SendMessage( hReadOnlyCtrl, BM_SETCHECK, BST_UNCHECKED, 0 );
00062
00063   lResult = SetWindowText( hDevNameCtrl, _T("") );
00064   SetFocus( hDevNameCtrl );
00065
00066   return 0;
00067 }
00068
00069 //---------------------------------------------------------------------------
00070 LRESULT CAddDeviceDlg::OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam )
00071 {
00072   LRESULT          lResult = 0;
00073   NODE_PROPERTIES  NodeProps;
00074
00075   ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00076
00077   HWND hArchiveCtrl  = GetDlgItem( hDlg, IDC_ARCHIVE_ATTR  );
00078   HWND hHiddenCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00079   HWND hLockedCtrl   = GetDlgItem( hDlg, IDC_HIDDEN_ATTR   );
00080   HWND hReadOnlyCtrl = GetDlgItem( hDlg, IDC_READONLY_ATTR );
00081   HWND hBackupCtrl   = GetDlgItem( hDlg, IDC_BACKUP_FLAG   );
00082   HWND hDevNameCtrl  = GetDlgItem( hDlg, IDC_DEVNAME_EDIT  );
00083
00084   if( BST_CHECKED == SendMessage( hArchiveCtrl, BM_GETCHECK, 0, 0 ) )
00085     NodeProps.dwAttributes |= ATTRIBUTE_DATA_ARCHIVE;
00086
00087   if( BST_CHECKED == SendMessage( hHiddenCtrl, BM_GETCHECK, 0, 0 ) )
00088     NodeProps.dwAttributes |= ATTRIBUTE_DATA_HIDDEN;
00089
00090   if( BST_CHECKED == SendMessage( hLockedCtrl, BM_GETCHECK, 0, 0 ) )
00091     NodeProps.dwAttributes |= ATTRIBUTE_DATA_LOCKED;
00092
00093   if( BST_CHECKED == SendMessage( hReadOnlyCtrl, BM_GETCHECK, 0, 0 ) )
00094     NodeProps.dwAttributes |= ATTRIBUTE_DATA_READONLY;
00095
00096   if( BST_CHECKED == SendMessage( hBackupCtrl, BM_GETCHECK, 0, 0 ) )
00097     NodeProps.dwAttributes |= ATTRIBUTE_BACKUP_DEVICE;
00098
00099   // Convert to wide characters here for all platforms.  This is the node name
00100   TCHAR szBuff[ MAX_NAME_LEN ] = {0};
00101   GetWindowText( hDevNameCtrl, szBuff, MAX_NAME_LEN );
00102   CopyT2W( NodeProps.szNodeName, szBuff, MAX_NAME_LEN);
00103   // Probably a good idea to check for NULL name strings here
00104
00105   // This message passes the user supplied info to the Static Node
00106   SendMessage( m_hParentWnd, WM_ADD_DEVICENODE, (WPARAM)&NodeProps, 0 );
00107
00108   // Now tell the static node we are deleting ourselves so the
00109   // context menu option can be enabled
00110   SendMessage( m_hParentWnd, WM_DEVICENODE_CLOSED, 0, 0 );
00111
00112   // Call the base class to shut down the dialog
00113   CBaseDialog::OnOK( hDlg, wParam, lParam );
00114   return 0;
00115 }
00116
00117 /////////////////////////////////////////////////////////////////////////////
00118 //  Virtual function implementations
00119
00120 //---------------------------------------------------------------------------
00121 BOOL CAddDeviceDlg::ProcessMessage
00122 (
00123   HWND     hDlg,           //[in] Handle to dialog box
00124   UINT     uMsg,           //[in] Message
00125   WPARAM   wParam,         //[in] First message parameter
00126   LPARAM   lParam          //[in] Second message parameter
00127 )
00128 {
00129   LRESULT lResult = 0;
00130
00131   switch( uMsg )
00132   {
00133     case WM_INITDIALOG:
00134       lResult = OnInitDialog( hDlg, wParam, lParam );
00135       break;
00136
00137     case WM_DESTROY:
00138       lResult = OnDestroy( hDlg, wParam, lParam );
00139       break;
00140
00141     case WM_NCDESTROY:
00142       lResult = OnNcDestroy( hDlg, wParam, lParam );
00143       break;
00144
00145     case WM_CLOSE:
00146       // Not overriding WM_CLOSE and IDCANCEL so we must send
00147       // WM_DEVICENODE_CLOSED before calling the base class or else
00148       // the context menu will stay grayed
00149       SendMessage( m_hParentWnd, WM_DEVICENODE_CLOSED, 0, 0 );
00150       lResult = OnClose( hDlg, wParam, lParam );
00151       break;
00152
00153     case WM_COMMAND:
00154       switch( wParam )
00155       {
00156         case IDOK:
00157           lResult = OnOK( hDlg, wParam, lParam );
00158           break;
00159
00160         case IDCANCEL:
00161           SendMessage( m_hParentWnd, WM_DEVICENODE_CLOSED, 0, 0 );
00162           lResult = OnCancel( hDlg, wParam, lParam );
00163           break;
00164
00165         default:
00166           break;
00167       }
00168     default:
00169       break;
00170   }
00171   return (BOOL)lResult;
00172 }
00173
00174
00175
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDownloadBindStatusCallback Member List

This is the complete list of members for CDownloadBindStatusCallback, including all inherited members.
AddRef() | CDownloadBindStatusCallback |
CDownloadBindStatusCallback(CDownloadUI *piDownloadUI) | CDownloadBindStatusCallback |
GetBindInfo(DWORD *, BINDINFO *) | CDownloadBindStatusCallback | [inline]
GetPriority(LONG *) | CDownloadBindStatusCallback | [inline]
m_iRefCnt | CDownloadBindStatusCallback | [private]
m_pDownloadUI | CDownloadBindStatusCallback | [private]
m_ulProgressSoFar | CDownloadBindStatusCallback | [private]
OnDataAvailable(DWORD, DWORD, FORMATETC *, STGMEDIUM *) | CDownloadBindStatusCallback | [inline]
OnLowResource(DWORD) | CDownloadBindStatusCallback | [inline]
OnObjectAvailable(REFIID, IUnknown *) | CDownloadBindStatusCallback | [inline]
OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) | CDownloadBindStatusCallback |
OnStartBinding(DWORD, IBinding *) | CDownloadBindStatusCallback | [inline]
OnStopBinding(HRESULT, LPCWSTR) | CDownloadBindStatusCallback | [inline]
QueryInterface(const IID &riid, void **ppvObj) | CDownloadBindStatusCallback |
Release() | CDownloadBindStatusCallback |
~CDownloadBindStatusCallback() | CDownloadBindStatusCallback |
Generated on Wed Nov 13 2024 16:56:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TempBuffer Member List

This is the complete list of members for TempBuffer, including all inherited members.
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
GetBuffer() | TempBuffer | [inline]
m_fHeapAlloc | TempBuffer | [private]
m_pBuf | TempBuffer | [private]
m_szTmpBuf | TempBuffer | [private]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
TempBuffer(ULONG cBytes) | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
~TempBuffer() | TempBuffer | [inline]
Generated on Wed Nov 13 2024 16:58:01 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyAudit/ComSpysqlAudit.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyAudit

ComSpysqlAudit.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #ifndef __COMSPYSQLAUDIT_H_
00018 #define __COMSPYSQLAUDIT_H_
00019
00020 #include "resource.h"       // main symbols
00021 #define SQL_BUF_SIZE  1024
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // CComSpySqlAudit
00025 class ATL_NO_VTABLE CComSpySqlAudit :
00026   public CComObjectRootEx<CComMultiThreadModel>,
00027   public CComCoClass<CComSpySqlAudit, &CLSID_ComSpyAudit>,
00028   public IComSpyAudit
00029 {
00030
00031 private:
00032     HENV m_henv;
00033     HDBC m_hdbc;
00034     HSTMT m_hstmt;
00035     LONGLONG m_PerformanceFrequency;
00036     WCHAR m_sSQL[SQL_BUF_SIZE];
00037
00038     long PerfCountToTickCount(LONGLONG perfCount);
00039
00040 public:
00041   CComSpySqlAudit()
00042   {
00043     m_hdbc = m_henv = m_hstmt = NULL;
00044     m_PerformanceFrequency = 0;
00045     m_pUnkMarshaler = NULL;
00046   }
00047
00048   void GetError(HENV henv, HDBC hdbc, HSTMT hstmt, BSTR *msg);
00049
00050   DECLARE_REGISTRY_RESOURCEID(IDR_COMSPYSQLAUDIT)
00051   DECLARE_NOT_AGGREGATABLE(CComSpySqlAudit)
00052   DECLARE_GET_CONTROLLING_UNKNOWN()
00053
00054   BEGIN_COM_MAP(CComSpySqlAudit)
00055     COM_INTERFACE_ENTRY(IComSpyAudit)
00056     COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
00057   END_COM_MAP()
00058
00059   HRESULT FinalConstruct()
00060   {
00061
00062     QueryPerformanceFrequency((LARGE_INTEGER *)&m_PerformanceFrequency);
00063     return CoCreateFreeThreadedMarshaler(
00064       GetControllingUnknown(), &m_pUnkMarshaler.p);
00065   }
00066
00067   void FinalRelease()
00068   {
00069     m_pUnkMarshaler.Release();
00070     RETCODE rc;
00071     if (m_hstmt)
00072     {
00073       SQLFreeStmt( m_hstmt, SQL_DROP );
00074     }
00075     if (m_hdbc)
00076     {
00077        rc = SQLDisconnect( m_hdbc);
00078        SQLFreeConnect( m_hdbc);
00079        SQLFreeEnv( m_henv );
00080     }
00081   }
00082
00083   CComPtr<IUnknown> m_pUnkMarshaler;
00084
00085 // IComSpyAudit
00086 public:
00087   STDMETHOD(Init)(LPCOLESTR sDSN, LPCOLESTR sUser, LPCOLESTR sPw);
00088
00089   /////////////////////Thread Events/////////////////////////
00090   STDMETHOD(OnThreadStart)(
00091            LONGLONG perfCount,
00092            LPCOLESTR pszGuidApp,
00093            LPCOLESTR pszThreadID,
00094            LPCOLESTR pszW2KThreadID,
00095            DWORD dwThreadCnt
00096         );
00097
00098   STDMETHOD(OnThreadTerminate)(
00099          LONGLONG perfCount,
00100          LPCOLESTR pszGuidApp,
00101          LPCOLESTR pszThreadID,
00102          LPCOLESTR pszW2KThreadID,
00103          DWORD dwThreadCnt
00104       );
00105
00106   STDMETHOD(OnThreadBindToApartment)(
00107          LONGLONG perfCount,
00108          LPCOLESTR pszGuidApp,
00109          LPCOLESTR pszThreadID,
00110          LPCOLESTR pszAptID,
00111          DWORD dwActivityCnt
00112       );
00113
00114   STDMETHOD(OnThreadUnBind)(
00115          LONGLONG perfCount,
00116          LPCOLESTR pszGuidApp,
00117          LPCOLESTR pszThreadID,
00118          LPCOLESTR pszAptID,
00119          DWORD dwActivityCnt
00120       );
00121
00122   STDMETHOD(OnThreadAssignApartment)(
00123         LONGLONG perfCount,
00124         LPCOLESTR pszGuidApp,
00125         LPCOLESTR pszGuidActivityID,
00126         LPCOLESTR pszAptID
00127       );
00128   STDMETHOD(OnThreadUnassignApartment)(
00129          LONGLONG perfCount,
00130          LPCOLESTR pszGuidApp,
00131          LPCOLESTR pszAptID
00132       );
00133
00134   STDMETHOD(OnThreadWorkEnque)(
00135          LONGLONG perfCount,
00136          LPCOLESTR pszGuidApp,
00137          LPCOLESTR pszThreadID,
00138          LPCOLESTR MsgWorkID,
00139          DWORD dwQueueLen
00140       );
00141   STDMETHOD(OnThreadWorkPrivate)(
00142          LONGLONG perfCount,
00143          LPCOLESTR pszGuidApp,
00144          LPCOLESTR pszThreadID,
00145          LPCOLESTR MsgWorkID
00146       );
00147   STDMETHOD(OnThreadWorkPublic)(
00148          LONGLONG perfCount,
00149          LPCOLESTR pszGuidApp,
00150          LPCOLESTR pszThreadID,
00151          LPCOLESTR MsgWorkID,
00152          DWORD dwQueueLen
00153       );
00154   STDMETHOD(OnThreadWorkRedirect)(
00155          LONGLONG perfCount,
00156          LPCOLESTR pszGuidApp,
00157          LPCOLESTR pszThreadID,
00158          LPCOLESTR MsgWorkID,
00159          DWORD dwQueueLen,
00160          LPCOLESTR pszThreadNum
00161       );
00162   STDMETHOD(OnThreadWorkReject)(
00163          LONGLONG perfCount,
00164          LPCOLESTR pszGuidApp,
00165          LPCOLESTR pszThreadID,
00166          LPCOLESTR MsgWorkID,
00167          DWORD dwQueueLen
00168       );
00169
00170   /////////////////////Application Events/////////////////////////
00171     STDMETHOD(OnAppActivation)(
00172                 LONGLONG perfCount,
00173                 LPCOLESTR pszGuidApp
00174             );
00175
00176     STDMETHOD(OnAppShutdown)(
00177                 LONGLONG perfCount,
00178                 LPCOLESTR pszGuidApp
00179             );
00180
00181   /////////////////////Transaction Events/////////////////////////
00182     STDMETHOD(OnTransactionStart)(
00183                 LONGLONG perfCount,
00184                 LPCOLESTR pszGuidApp,
00185                 LPCOLESTR pszGuidTxID,
00186                 LPCOLESTR pszGuidTSID,
00187         BOOL bRoot
00188             );
00189
00190     STDMETHOD(OnTransactionPrepared)(
00191                 LONGLONG perfCount,
00192                 LPCOLESTR pszGuidApp,
00193                 LPCOLESTR pszGuidTxID,
00194         BOOL bVoteYes
00195             );
00196
00197     STDMETHOD(OnTransactionAborted)(
00198                 LONGLONG perfCount,
00199                 LPCOLESTR pszGuidApp,
00200         LPCOLESTR pszGuidTxID
00201             );
00202   STDMETHOD(OnTransactionCommit)(
00203                 LONGLONG perfCount,
00204                 LPCOLESTR pszGuidApp,
00205         LPCOLESTR pszGuidTxID
00206             );
00207
00208   /////////////////////Method Events/////////////////////////
00209     STDMETHOD(OnMethodCall)(
00210                 LONGLONG perfCount,
00211         LPCOLESTR pszGuidApp,
00212                 LPCOLESTR pszObjectID,
00213                 LPCOLESTR pszGuidClassID,
00214                 LPCOLESTR pszGuidInterfaceID,
00215                 LPCOLESTR pszMethod
00216             );
00217
00218     STDMETHOD(OnMethodReturn)(
00219                 LONGLONG perfCount,
00220         LPCOLESTR pszGuidApp,
00221                 LPCOLESTR pszObjectID,
00222                 LPCOLESTR pszGuidClassID,
00223                 LPCOLESTR pszGuidInterfaceID,
00224                 LPCOLESTR pszMethod,
00225                 HRESULT hr,
00226         LPCOLESTR pszCallTime
00227             );
00228
00229     STDMETHOD(OnMethodException)(
00230                 LONGLONG perfCount,
00231         LPCOLESTR pszGuidApp,
00232                 LPCOLESTR pszObjectID,
00233                 LPCOLESTR pszGuidClassID,
00234                 LPCOLESTR pszGuidInterfaceID,
00235                 LPCOLESTR pszMethod
00236             );
00237
00238   /////////////////////ObjectConstruction Events/////////////////////////
00239   STDMETHOD(OnObjectConstruct)(
00240          LONGLONG perfCount,
00241          LPCOLESTR pszGuidApp,
00242          LPCOLESTR pszClassID,
00243          LPCOLESTR pszConstructString,
00244          LPCOLESTR pszObjectID
00245       );
00246
00247   /////////////////////Instance Events/////////////////////////
00248     STDMETHOD(OnObjectCreate)(
00249                 LONGLONG perfCount,
00250         LPCOLESTR pszGuidApp,
00251         LPCOLESTR pszGuidActivityID,
00252         LPCOLESTR pszClassID,
00253         LPCOLESTR pszTSID,
00254         LPCOLESTR pszContextID,
00255         LPCOLESTR pszObjectID
00256             );
00257
00258     STDMETHOD(OnObjectDestroy)(
00259                 LONGLONG perfCount,
00260         LPCOLESTR pszGuidApp,
00261         LPCOLESTR pszContextID
00262             );
00263
00264   /////////////////////Object Events/////////////////////////
00265     STDMETHOD(OnObjectActivate)(
00266                 LONGLONG perfCount,
00267         LPCOLESTR pszGuidApp,
00268         LPCOLESTR pszContextID,
00269         LPCOLESTR pszObjectID
00270             );
00271
00272     STDMETHOD(OnObjectDeactivate)(
00273                 LONGLONG perfCount,
00274         LPCOLESTR pszGuidApp,
00275         LPCOLESTR pszContextID,
00276         LPCOLESTR pszObjectID
00277             );
00278
00279     STDMETHOD(OnDisableCommit)(
00280                 LONGLONG perfCount,
00281         LPCOLESTR pszGuidApp,
00282         LPCOLESTR pszContextID
00283             );
00284
00285     STDMETHOD(OnEnableCommit)(
00286                 LONGLONG perfCount,
00287         LPCOLESTR pszGuidApp,
00288         LPCOLESTR pszContextID
00289             );
00290
00291     STDMETHOD(OnSetComplete)(
00292                 LONGLONG perfCount,
00293         LPCOLESTR pszGuidApp,
00294         LPCOLESTR pszContextID
00295             );
00296   STDMETHOD(OnSetAbort)(
00297                 LONGLONG perfCount,
00298         LPCOLESTR pszGuidApp,
00299         LPCOLESTR pszContextID
00300             );
00301
00302    /////////////////////Resource Events/////////////////////////
00303    STDMETHOD(OnResourceCreate)(
00304           LONGLONG perfCount,
00305           LPCOLESTR pszGuidApp,
00306           LPCOLESTR pszObjectID,
00307           LPCOLESTR pszType,
00308           LPCOLESTR pszResId,
00309           BOOL bEnlisted
00310             );
00311
00312     STDMETHOD(OnResourceAllocate)(
00313                 LONGLONG perfCount,
00314         LPCOLESTR pszGuidApp,
00315                 LPCOLESTR pszObjectID,
00316                 LPCOLESTR pszType,
00317                 LPCOLESTR pszResId,
00318         BOOL bEnlisted,
00319         LPCOLESTR pszNumRated,
00320         LPCOLESTR pszRating
00321             );
00322
00323     STDMETHOD(OnResourceRecycle)(
00324                 LONGLONG perfCount,
00325                 LPCOLESTR pszGuidApp,
00326                 LPCOLESTR pszObjectID,
00327                 LPCOLESTR pszType,
00328         LPCOLESTR pszResId
00329             );
00330
00331     STDMETHOD(OnResourceDestroy)(
00332                 LONGLONG perfCount,
00333                 LPCOLESTR pszGuidApp,
00334                 LPCOLESTR pszObjectID,
00335                 HRESULT hResult,
00336         LPCOLESTR pszType,
00337         LPCOLESTR pszResId
00338             );
00339
00340   STDMETHOD(OnResourceTrack)(
00341           LONGLONG perfCount,
00342           LPCOLESTR pszGuidApp,
00343           LPCOLESTR pszObjectID,
00344           LPCOLESTR pszType,
00345           LPCOLESTR pszResId,
00346           BOOL bEnlisted
00347             );
00348
00349   /////////////////////Security Events/////////////////////////
00350     STDMETHOD(OnAuthenticate)(
00351               LONGLONG perfCount,
00352           LPCOLESTR pszGuidApp,
00353           LPCOLESTR pszGuidActivity,
00354           LPCOLESTR pszObjectID,
00355           LPCOLESTR pszGuidIID,
00356           LPCOLESTR pszMethod,
00357           LPCOLESTR pszOriginalUser,
00358           LPCOLESTR pszDirectUser,
00359           BOOL bCurrentUserInpersonatingInProc
00360             );
00361
00362   STDMETHOD(OnAuthenticateFail)(
00363           LONGLONG perfCount,
00364           LPCOLESTR pszGuidApp,
00365           LPCOLESTR pszGuidActivity,
00366           LPCOLESTR pszObjectID,
00367           LPCOLESTR pszGuidIID,
00368           LPCOLESTR pszMethod,
00369           LPCOLESTR pszOriginalUser,
00370           LPCOLESTR pszDirectUser,
00371           BOOL bCurrentUserInpersonatingInProc
00372             );
00373
00374   /////////////////////Identity Events/////////////////////////
00375   STDMETHOD(OnIISRequestInfo)(
00376          LONGLONG perfCount,
00377          LPCOLESTR pszGuidApp,
00378          LPCOLESTR pszObjectID,
00379          LPCOLESTR pszClientIP,
00380          LPCOLESTR pszServerIP,
00381          LPCOLESTR pszURL
00382       );
00383
00384   /////////////////////ObjectPool Events/////////////////////////
00385   STDMETHOD(OnObjPoolPutObject)(
00386               LONGLONG perfCount,
00387           LPCOLESTR pszGuidApp,
00388           LPCOLESTR pszClassID,
00389           int nReason,
00390           DWORD dwAvailableObjs,
00391           LPCOLESTR pszObjectID
00392       );
00393
00394   STDMETHOD(OnObjPoolGetObject)(
00395          LONGLONG perfCount,
00396          LPCOLESTR pszGuidApp,
00397          LPCOLESTR pszGuidActivityID,
00398          LPCOLESTR pszClassID,
00399          DWORD dwAvailableObjs,
00400          LPCOLESTR pszObjectID
00401       );
00402
00403   STDMETHOD(OnObjPoolRecycleToTx)(
00404          LONGLONG perfCount,
00405          LPCOLESTR pszGuidApp,
00406          LPCOLESTR pszGuidActivityID,
00407          LPCOLESTR pszClassID,
00408          LPCOLESTR pszGuidTx,
00409          LPCOLESTR pszObjectID
00410       );
00411
00412   STDMETHOD(OnObjPoolGetFromTx)(
00413          LONGLONG perfCount,
00414          LPCOLESTR pszGuidApp,
00415          LPCOLESTR pszGuidActivityID,
00416          LPCOLESTR pszClassID,
00417          LPCOLESTR pszGuidTx,
00418          LPCOLESTR pszObjectID
00419       );
00420
00421   /////////////////////ObjectPool2 Events/////////////////////////
00422   STDMETHOD(OnObjPoolCreateObject)(
00423          LONGLONG perfCount,
00424          LPCOLESTR pszGuidApp,
00425          LPCOLESTR pszClassID,
00426          DWORD dwAvailableObjs,
00427          LPCOLESTR pszObjectID
00428       );
00429
00430   STDMETHOD(OnObjPoolDestroyObject)(
00431          LONGLONG perfCount,
00432          LPCOLESTR pszGuidApp,
00433          LPCOLESTR pszClassID,
00434          DWORD dwAvailableObjs,
00435          LPCOLESTR pszObjectID
00436       );
00437
00438   STDMETHOD(OnObjPoolCreateDecision)(
00439          LONGLONG perfCount,
00440          LPCOLESTR pszGuidApp,
00441          DWORD dwThreadsWaiting,
00442          DWORD dwAvailableObjs,
00443          DWORD dwCreatedObjs,
00444          DWORD dwMin,
00445          DWORD dwMax
00446       );
00447
00448   STDMETHOD(OnObjPoolTimeout)(
00449          LONGLONG perfCount,
00450          LPCOLESTR pszGuidApp,
00451          LPCOLESTR pszClassID,
00452          LPCOLESTR pszGuidActivityID,
00453          DWORD dwTimeout);
00454
00455   STDMETHOD(OnObjPoolCreatePool)(
00456          LONGLONG perfCount,
00457          LPCOLESTR pszGuidApp,
00458          LPCOLESTR pszClassID,
00459          DWORD dwMin,
00460          DWORD dwMax,
00461          DWORD dwTimeout
00462       );
00463
00464   /////////////////////Activity Events/////////////////////
00465   STDMETHOD(OnActivityCreate)(
00466          LONGLONG perfCount,
00467          LPCOLESTR pszGuidApp,
00468          LPCOLESTR pszGuidActivityID
00469       );
00470
00471   STDMETHOD(OnActivityDestroy)(
00472          LONGLONG perfCount,
00473          LPCOLESTR pszGuidApp,
00474          LPCOLESTR pszGuidActivityID
00475       );
00476
00477   STDMETHOD(OnActivityEnter)(
00478          LONGLONG perfCount,
00479          LPCOLESTR pszGuidApp,
00480          LPCOLESTR pszGuidCurrentApp,
00481          LPCOLESTR pszGuidEnteredApp,
00482          LPCOLESTR pszW2KThreadID
00483       );
00484
00485   STDMETHOD(OnActivityTimeout)(
00486          LONGLONG perfCount,
00487          LPCOLESTR pszGuidApp,
00488          LPCOLESTR pszGuidCurrentApp,
00489          LPCOLESTR pszGuidEnteredApp,
00490          LPCOLESTR pszW2KThreadID,
00491          DWORD dwTimeout
00492       );
00493
00494   STDMETHOD(OnActivityReenter)(
00495          LONGLONG perfCount,
00496          LPCOLESTR pszGuidApp,
00497          LPCOLESTR pszGuidCurrentApp,
00498          LPCOLESTR pszW2KThreadID,
00499          DWORD dwCallDepth
00500       );
00501
00502   STDMETHOD(OnActivityLeave)(
00503          LONGLONG perfCount,
00504          LPCOLESTR pszGuidApp,
00505          LPCOLESTR pszGuidCurrentApp,
00506          LPCOLESTR pszGuidLeftApp
00507       );
00508
00509   STDMETHOD(OnActivityLeaveSame)(
00510          LONGLONG perfCount,
00511          LPCOLESTR pszGuidApp,
00512          LPCOLESTR pszGuidCurrentApp,
00513          DWORD dwCallDepth
00514       );
00515
00516
00517
00518   /////////////////////Queued Components Events/////////////////////
00519   STDMETHOD(OnQCRecord)(
00520          LONGLONG perfCount,
00521          LPCOLESTR pszGuidApp,
00522          LPCOLESTR pszObjectID,
00523          LPCOLESTR pszQueueName,
00524          LPCOLESTR pszGuidMsgID,
00525          LPCOLESTR pszGuidWorkFlowID,
00526          HRESULT hr
00527       );
00528   STDMETHOD(OnQCQueueOpen)(
00529          LONGLONG perfCount,
00530          LPCOLESTR pszGuidApp,
00531          LPCOLESTR pszQueueName,
00532          LPCOLESTR pszQueueID,
00533          HRESULT hr
00534       );
00535   STDMETHOD(OnQCReceive)(
00536          LONGLONG perfCount,
00537          LPCOLESTR pszGuidApp,
00538          LPCOLESTR pszQueueID,
00539          LPCOLESTR pszGuidMsgID,
00540          LPCOLESTR pszGuidWorkFlowID,
00541          HRESULT hr
00542       );
00543   STDMETHOD(OnQCReceiveFail)(
00544          LONGLONG perfCount,
00545          LPCOLESTR pszGuidApp,
00546          LPCOLESTR pszQueueID,
00547          HRESULT hr
00548       );
00549   STDMETHOD(OnQCMoveToReTryQueue)(
00550          LONGLONG perfCount,
00551          LPCOLESTR pszGuidApp,
00552          LPCOLESTR pszGuidMsgID,
00553          LPCOLESTR pszGuidWorkFlowID,
00554          ULONG RetryIndex
00555       );
00556   STDMETHOD(OnQCMoveToDeadQueue)(
00557          LONGLONG perfCount,
00558          LPCOLESTR pszGuidApp,
00559          LPCOLESTR pszGuidMsgID,
00560          LPCOLESTR pszGuidWorkFlowID
00561       );
00562   STDMETHOD(OnQCPlayback)(
00563          LONGLONG perfCount,
00564          LPCOLESTR pszGuidApp,
00565          LPCOLESTR pszObjectID,
00566          LPCOLESTR pszGuidMsgID,
00567          LPCOLESTR pszGuidWorkFlowID,
00568          HRESULT hr
00569       );
00570
00571
00572   /////////////////////Exception Events/////////////////////
00573   STDMETHOD(OnExceptionUser)(
00574          LONGLONG perfCount,
00575          LPCOLESTR pszGuidApp,
00576          LPCOLESTR pszCode,
00577          LPCOLESTR pszAddress,
00578          LPCOLESTR pszStackTrace
00579       );
00580
00581
00582   /////////////////////CRM Events/////////////////////
00583   STDMETHOD(OnCRMRecoveryStart)(
00584          LONGLONG perfCount,
00585          LPCOLESTR pszGuidApp
00586       );
00587
00588   STDMETHOD(OnCRMRecoveryDone)(
00589          LONGLONG perfCount,
00590          LPCOLESTR pszGuidApp
00591       );
00592
00593   STDMETHOD(OnCRMCheckpoint)(
00594          LONGLONG perfCount,
00595          LPCOLESTR pszGuidApp
00596       );
00597
00598   STDMETHOD(OnCRMBegin)(
00599          LONGLONG perfCount,
00600          LPCOLESTR pszGuidApp,
00601          LPCOLESTR pszGuidClerkCLSID,
00602          LPCOLESTR pszGuidActivityID,
00603          LPCOLESTR pszGuidTxUOWID,
00604          LPCOLESTR pszProgIdCompensator,
00605          LPCOLESTR pszDescription
00606       );
00607
00608   STDMETHOD(OnCRMPrepare)(
00609          LONGLONG perfCount,
00610          LPCOLESTR pszGuidApp,
00611          LPCOLESTR pszGuidClerkCLSID
00612       );
00613
00614   STDMETHOD(OnCRMCommit)(
00615          LONGLONG perfCount,
00616          LPCOLESTR pszGuidApp,
00617          LPCOLESTR pszGuidClerkCLSID
00618       );
00619
00620   STDMETHOD(OnCRMAbort)(
00621          LONGLONG perfCount,
00622          LPCOLESTR pszGuidApp,
00623          LPCOLESTR pszGuidClerkCLSID
00624       );
00625
00626   STDMETHOD(OnCRMIndoubt)(
00627          LONGLONG perfCount,
00628          LPCOLESTR pszGuidApp,
00629          LPCOLESTR pszGuidClerkCLSID
00630       );
00631
00632   STDMETHOD(OnCRMDone)(
00633          LONGLONG perfCount,
00634          LPCOLESTR pszGuidApp,
00635          LPCOLESTR pszGuidClerkCLSID
00636       );
00637
00638   STDMETHOD(OnCRMRelease)(
00639          LONGLONG perfCount,
00640          LPCOLESTR pszGuidApp,
00641          LPCOLESTR pszGuidClerkCLSID
00642       );
00643
00644   STDMETHOD(OnCRMAnalyze)(
00645          LONGLONG perfCount,
00646          LPCOLESTR pszGuidApp,
00647          LPCOLESTR pszGuidClerkCLSID,
00648          LPCOLESTR pszCrmRecordType,
00649          DWORD dwRecordSize
00650       );
00651
00652   STDMETHOD(OnCRMWrite)(
00653          LONGLONG perfCount,
00654          LPCOLESTR pszGuidApp,
00655          LPCOLESTR pszGuidClerkCLSID,
00656          BOOL bVariants,
00657          DWORD dwRecordSize);
00658
00659   STDMETHOD(OnCRMForget)(
00660          LONGLONG perfCount,
00661          LPCOLESTR pszGuidApp,
00662          LPCOLESTR pszGuidClerkCLSID
00663       );
00664
00665   STDMETHOD(OnCRMForce)(
00666          LONGLONG perfCount,
00667          LPCOLESTR pszGuidApp,
00668          LPCOLESTR pszGuidClerkCLSID
00669       );
00670
00671   STDMETHOD(OnCRMDeliver)(
00672          LONGLONG perfCount,
00673          LPCOLESTR pszGuidApp,
00674          LPCOLESTR pszGuidClerkCLSID,
00675          BOOL bVariants,
00676          DWORD dwRecordSize
00677       );
00678
00679   /////////////////////Load Balancing Events/////////////////////
00680   STDMETHOD(TargetUp)(
00681        LONGLONG perfCount,
00682        LPCOLESTR pszServerName,
00683        LPCOLESTR pszClsidEng
00684     );
00685
00686   STDMETHOD(TargetDown)(
00687        LONGLONG perfCount,
00688        LPCOLESTR pszServerName,
00689        LPCOLESTR pszClsidEng
00690     );
00691
00692     STDMETHOD(EngineDefined)(
00693        LONGLONG perfCount,
00694        LPCOLESTR pszPropName,
00695        VARIANT *varPropValue,
00696        LPCOLESTR pszClsidEng
00697     );
00698 };
00699
00700 #endif //__COMSPYSQLAUDIT_H_
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCIncoming/RTCIncomingDlg.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCIncoming

RTCIncomingDlg.cpp

Go to the documentation of this file.
00001 /******************************************************>
00002  * Copyright (c) 2001 Microsoft Corporation.
00003  * All rights reserved.
00004  *
00005  * @Abstract: RTCIncomginDlg.cpp
00006  * ---------  [ Source Definition File]
00007  *
00008  *
00009  * @Description :
00010  * -------------
00011  * Class Definition file for the Main RTCIncoming Dialog Box
00012  * this Class will contain the state machine transitions
00013  * of the RTC Core Sample, answering calls, receiving events
00014  * disconnected calls, displaying video and auto answer
00015  *
00016  *
00017  ******************************************************/
00018
00019 #include "stdafx.h"
00020 #include "RTCIncoming.h"
00021 #include "RTCIncomingDlg.h"
00022 #include "Utils.h"
00023
00024 //
00025 // Should change this to link to library
00026 //
00027
00028
00029
00030 #ifdef _DEBUG
00031 #define new DEBUG_NEW
00032 #undef THIS_FILE
00033 static char THIS_FILE[] = __FILE__;
00034 #endif
00035
00036
00037 /**********************************************************
00038 //@Class CAboutDlg
00039 //
00040 //@Description
00041 //
00042 //  Class for the About Dialog Box
00043 //
00044 //
00045 //*********************************************************/
00046
00047 class CAboutDlg : public CDialog
00048 {
00049 public:
00050   CAboutDlg();
00051
00052 // Dialog Data
00053   //{{AFX_DATA(CAboutDlg)
00054   enum { IDD = IDD_ABOUTBOX };
00055   //}}AFX_DATA
00056
00057   // ClassWizard generated virtual function overrides
00058   //{{AFX_VIRTUAL(CAboutDlg)
00059   protected:
00060   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00061   //}}AFX_VIRTUAL
00062
00063 // Implementation
00064 protected:
00065   //{{AFX_MSG(CAboutDlg)
00066   //}}AFX_MSG
00067   DECLARE_MESSAGE_MAP()
00068 };
00069
00070
00071
00072 /**********************************************************
00073 //@CAboutDlg()
00074 //
00075 //@Description
00076 //
00077 //  Constructor of the CAboutDlg Class
00078 //
00079 //@Args In:     None
00080 //@Args Out:    None
00081 //
00082 //
00083 //*********************************************************/
00084 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00085 {
00086   //{{AFX_DATA_INIT(CAboutDlg)
00087   //}}AFX_DATA_INIT
00088 }
00089
00090
00091 /**********************************************************
00092 //@DoDataExchange()
00093 //
00094 //@Description
00095 //
00096 //  calles CDialog::DoDataExchange
00097 //
00098 //@Args In:     CDataExchange *
00099 //@Args Out:    Void
00100 //
00101 //
00102 //*********************************************************/
00103 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00104 {
00105   CDialog::DoDataExchange(pDX);
00106   //{{AFX_DATA_MAP(CAboutDlg)
00107   //}}AFX_DATA_MAP
00108 }
00109
00110
00111
00112 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00113   //{{AFX_MSG_MAP(CAboutDlg)
00114   //}}AFX_MSG_MAP
00115 END_MESSAGE_MAP()
00116
00117
00118
00119
00120 /**********************************************************
00121 //@CRTCIncomingDlg
00122 //
00123 //@Description
00124 //
00125 //  Constructor for CRTCIncomgDlg box initializes member
00126 //  interfaces and variables declared in class.
00127 //
00128 //@Args In:     CWnd *
00129 //@Args Out:    Void
00130 //
00131 //
00132 //*********************************************************/
00133
00134 CRTCIncomingDlg::CRTCIncomingDlg(CWnd* pParent /*=NULL*/)
00135   : CDialog(CRTCIncomingDlg::IDD, pParent)
00136 {
00137   //{{AFX_DATA_INIT(CRTCIncomingDlg)
00138
00139     m_pIRTCClient    = NULL;
00140   m_pIRTCSession   = NULL;
00141   m_dwEventCookie  = 0;
00142   m_pIRecvVideo    = NULL;
00143   m_pIPrevVideo    = NULL;
00144   m_bAutoAnswer    = VARIANT_FALSE;
00145
00146   //}}AFX_DATA_INIT
00147   // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
00148   m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
00149 }
00150
00151
00152
00153 /**********************************************************
00154 //@DoDataExchange()
00155 //
00156 //@Description
00157 //
00158 //  Calle CDialog::DoDataExchange
00159 //
00160 //@Args In:     CDataExchange *
00161 //@Args Out:    Void
00162 //
00163 //
00164 //*********************************************************/
00165
00166 void CRTCIncomingDlg::DoDataExchange(CDataExchange* pDX)
00167 {
00168   CDialog::DoDataExchange(pDX);
00169   //{{AFX_DATA_MAP(CRTCIncomingDlg)
00170   DDX_Control(pDX, IDC_CHECKAUTO, m_chkAutoAnswer);
00171   DDX_Control(pDX, IDC_STATUS, m_ctrlEditStatus);
00172   DDX_Control(pDX, IDC_DISCONNECT, m_btnDisconnect);
00173   DDX_Control(pDX, IDC_ANSWER, m_btnAnswer);
00174   //}}AFX_DATA_MAP
00175 }
00176
00177 BEGIN_MESSAGE_MAP(CRTCIncomingDlg, CDialog)
00178
00179   ////
00180   //{{AFX_MSG_MAP(CRTCIncomingDlg)
00181   ON_WM_SYSCOMMAND()
00182   ON_WM_PAINT()
00183   ON_WM_QUERYDRAGICON()
00184   ON_BN_CLICKED(IDC_ANSWER, OnAnswer)
00185   ON_BN_CLICKED(IDC_DISCONNECT, OnDisconnect)
00186   ON_BN_CLICKED(IDC_CHECKAUTO, OnCheckauto)
00187   ON_WM_CLOSE()
00188   //}}AFX_MSG_MAP
00189 END_MESSAGE_MAP()
00190
00191
00192 /**********************************************************
00193 //@OnInitDialog()
00194 //
00195 //@Description
00196 //
00197 //  Called when Dialog Box is Initialized
00198 //
00199 //@Args In:     Void
00200 //@Args Out:    BOOL
00201 //
00202 //
00203 //*********************************************************/
00204
00205 BOOL CRTCIncomingDlg::OnInitDialog()
00206 {
00207   CDialog::OnInitDialog();
00208
00209   //
00210   // Add "About..." menu item to system menu.
00211   // IDM_ABOUTBOX must be in the system command range
00212   //
00213
00214   ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
00215   ASSERT(IDM_ABOUTBOX < 0xF000);
00216
00217   CMenu* pSysMenu = GetSystemMenu(FALSE);
00218   if (pSysMenu != NULL)
00219   {
00220     CString strAboutMenu;
00221     strAboutMenu.LoadString(IDS_ABOUTBOX);
00222     if (!strAboutMenu.IsEmpty())
00223     {
00224       pSysMenu->AppendMenu(MF_SEPARATOR);
00225       pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
00226     }
00227   }
00228
00229   //
00230   // Set the icon for this dialog.  The framework does this automatically
00231   //  when the application's main window is not a dialog
00232   //
00233
00234   SetIcon(m_hIcon, TRUE);     // Set big icon
00235   SetIcon(m_hIcon, FALSE);    // Set small icon
00236
00237
00238   //
00239   // Initalize the COM Threading Model
00240   //
00241
00242
00243   ::CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
00244
00245   //
00246   // UI Disable Call Control Buttons
00247   //
00248   //
00249
00250   StateAnswerIDC(VARIANT_FALSE);
00251   StateDisconnectIDC(VARIANT_FALSE);
00252
00253
00254   //
00255   // Initialize RTC App to get ready for
00256   // Incoming Call listen mode
00257   //
00258
00259
00260   HRESULT hr = InitializeRTCApp();
00261
00262
00263   if (FAILED(hr))
00264   {
00265     LOGMSGERROR(_T("InitializeRTCApp() Failed: 0x%x"), hr);
00266     return FALSE;
00267   }
00268
00269   // return TRUE  unless you set the focus to a control
00270   return TRUE;
00271
00272 }
00273
00274
00275
00276 /**********************************************************
00277 //@OnSysCommand()
00278 //
00279 //@Description
00280 //
00281 //  Called when Dialog Box is Initialized
00282 //
00283 //@Args In:     UINT nID, LPARAM lParam
00284 //@Args Out:    VOID
00285 //
00286 //
00287 //*********************************************************/
00288
00289 void CRTCIncomingDlg::OnSysCommand(UINT nID, LPARAM lParam)
00290 {
00291   if ((nID & 0xFFF0) == IDM_ABOUTBOX)
00292   {
00293     CAboutDlg dlgAbout;
00294     dlgAbout.DoModal();
00295   }
00296   else
00297   {
00298     CDialog::OnSysCommand(nID, lParam);
00299   }
00300 }
00301
00302
00303 /**********************************************************
00304 //@OnSysCommand()
00305 //
00306 //@Description
00307 //
00308 //  If you add a minimize button to your dialog, you will need
00309 //  the code below to draw the icon.  For MFC applications using
00310 //  the document/view model, this is automatically done for you by
00311 //  the framework.
00312 //
00313 //@Args In:     Void
00314 //@Args Out:    Void
00315 //
00316 //
00317 //*********************************************************/
00318
00319 void CRTCIncomingDlg::OnPaint()
00320 {
00321   if (IsIconic())
00322   {
00323     CPaintDC dc(this); // device context for painting
00324
00325     SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00326
00327     // Center icon in client rectangle
00328     int cxIcon = GetSystemMetrics(SM_CXICON);
00329     int cyIcon = GetSystemMetrics(SM_CYICON);
00330     CRect rect;
00331     GetClientRect(&rect);
00332     int x = (rect.Width() - cxIcon + 1) / 2;
00333     int y = (rect.Height() - cyIcon + 1) / 2;
00334
00335     // Draw the icon
00336     dc.DrawIcon(x, y, m_hIcon);
00337   }
00338   else
00339   {
00340     CDialog::OnPaint();
00341   }
00342 }
00343
00344 /**********************************************************
00345 //@OnQueryDragIcon()
00346 //
00347 //@Description
00348 //
00349 //
00350 //
00351 //@Args In:     Void
00352 //@Args Out:    Void
00353 //
00354 //
00355 //*********************************************************/
00356
00357 HCURSOR CRTCIncomingDlg::OnQueryDragIcon()
00358 {
00359   return (HCURSOR) m_hIcon;
00360 }
00361
00362
00363
00364 /**********************************************************
00365 //@ Entry Point and Exit Point of the Application
00366 //*********************************************************/
00367
00368 /**********************************************************
00369 //@InitializeRTCApp()
00370 //
00371 //@Description
00372 //
00373 //  - CoCreating CLSID_RTCClient object and getting
00374 //    the IRTCClient Interface
00375 //  - Initializing the Client interface
00376 //  - Setting the Event Call Back Connection Point for
00377 //    the Source sink
00378 //  - Setting the Listen mode (opening SIP ports)
00379 //
00380 //@Args In:     Void
00381 //@Args Out:    Void
00382 //
00383 //
00384 //*********************************************************/
00385
00386 HRESULT
00387 CRTCIncomingDlg::InitializeRTCApp()
00388 {
00389
00390   HRESULT hr = S_OK;
00391
00392
00393   //
00394   // CoCreating CLSID_RTCClient object and getting
00395   // the IRTCClient Interface
00396   //
00397
00398   hr = StateCoCreateClient();
00399
00400   if (FAILED(hr))
00401   {
00402     return hr;
00403   }
00404
00405   //
00406   // Initializing the Client
00407   //
00408
00409   hr = StateInitClient();
00410
00411   if (FAILED(hr))
00412   {
00413     return hr;
00414   }
00415
00416   // Setting the Event Call Back Connection Point for
00417   // the Source sink
00418
00419   hr = StateSinkEvent(0);
00420
00421   if (FAILED(hr))
00422   {
00423     return hr;
00424   }
00425
00426   //
00427   // Setting the Listen mode to receive incoming calls
00428   // event notifications. RTCLM_BOTH flag causes the
00429   // application to open and listen on a dynamic and a
00430   // registered port 5060 for any incoming SIP messages.
00431   //
00432
00433   hr = StateListenMode( RTCLM_BOTH );
00434
00435   if (FAILED(hr))
00436   {
00437     return hr;
00438   }
00439
00440   return hr;
00441 }
00442
00443
00444 /**********************************************************
00445 //@ShutdownRTCApp
00446 //
00447 //@Description
00448 //
00449 //   DestroyWindow shutdown
00450 //
00451 //
00452 //*********************************************************/
00453 HRESULT CRTCIncomingDlg::ShutdownRTCApp()
00454 {
00455
00456   HRESULT hr  = S_OK;
00457
00458
00459     _ASSERTE(NULL != m_pIRTCClient);
00460
00461     StateUnSinkEvent();
00462
00463     hr = m_pIRTCClient->Shutdown();
00464
00465    if (FAILED(hr))
00466    {
00467       LOGMSGERROR(_T("IRTCClient::Shutdown() Failed 0x%x"), hr);
00468    }
00469
00470    ReleaseStateMachine();
00471
00472    CoUninitialize();
00473    DestroyWindow();
00474
00475   return S_OK;
00476 }
00477
00478
00479
00480 /**********************************************************
00481 //@ UI Helpers to Enable/Disable Buttons
00482 //*********************************************************/
00483 /**********************************************************
00484 //@StateAnswerIDC
00485 //
00486 //@Description
00487 //
00488 //  Changes the Style of the Answer Button from enabled/
00489 //  to disabled
00490 //
00491 //@Args In:     Void
00492 //@Args Out:    Void
00493 //
00494 //
00495 //*********************************************************/
00496 void
00497 CRTCIncomingDlg::StateAnswerIDC(VARIANT_BOOL fEnable)
00498 {
00499    if (VARIANT_TRUE == fEnable)
00500    {
00501
00502       m_btnAnswer.ModifyStyle( WS_DISABLED , 0 , 0);
00503     RedrawWindow();
00504
00505    }
00506    else
00507    {
00508       m_btnAnswer.ModifyStyle( 0 ,  WS_DISABLED, 0);
00509     RedrawWindow();
00510    }
00511 }
00512
00513 /**********************************************************
00514 //@StateDisconnectIDC
00515 //
00516 //@Description
00517 //
00518 //  Changes the Style of the Disconnect Button from enabled/
00519 //  to disabled
00520 //
00521 //@Args In:     Void
00522 //@Args Out:    Void
00523 //
00524 //
00525 //*********************************************************/
00526 void
00527 CRTCIncomingDlg::StateDisconnectIDC(VARIANT_BOOL fEnable)
00528 {
00529
00530    if (VARIANT_TRUE == fEnable)
00531    {
00532
00533       m_btnDisconnect.ModifyStyle( WS_DISABLED , 0 , 0);
00534     RedrawWindow();
00535    }
00536    else
00537    {
00538       m_btnDisconnect.ModifyStyle( 0 ,  WS_DISABLED, 0);
00539     RedrawWindow();
00540    }
00541 }
00542
00543
00544
00545 /**********************************************************
00546 //@ Dialog Box Event/Message Handlers
00547 //*********************************************************/
00548
00549 /**********************************************************
00550 //@OnAnswer
00551 //
00552 //@Description
00553 //
00554 //  Called when the Answer Button is pressed
00555 //
00556 //
00557 //@Args In:     Void
00558 //@Args Out:    Void
00559 //
00560 //
00561 //*********************************************************/
00562 void CRTCIncomingDlg::OnAnswer()
00563 {
00564
00565   HRESULT hr = S_OK;
00566
00567   hr = StateSessionControl(STO_ANSWER);
00568
00569   if (FAILED(hr))
00570   {
00571     LOGMSGERROR(_T("StateSessionControl(ANSWER): Failed 0x%x"), hr);
00572   }
00573   else
00574   {
00575     StateDisconnectIDC(VARIANT_TRUE);
00576   }
00577 }
00578
00579 /**********************************************************
00580 //@OnDisconnect
00581 //
00582 //@Description
00583 //
00584 //  Called when Disconnect button is pressed
00585 //
00586 //
00587 //@Args In:     Void
00588 //@Args Out:    Void
00589 //
00590 //
00591 //*********************************************************/
00592
00593 void CRTCIncomingDlg::OnDisconnect()
00594 {
00595
00596   HRESULT  hr   = S_OK;
00597   hr = StateSessionControl(STO_TERMINATE);
00598
00599   if (FAILED(hr))
00600   {
00601     LOGMSGERROR(_T("StateSessionControl(TERMINATE): Failed 0x%x"), hr);
00602
00603   }
00604
00605   //
00606   // Disable Disconnect Button and Enable Answer
00607   //
00608
00609   StateDisconnectIDC(VARIANT_FALSE);
00610   StateAnswerIDC(VARIANT_FALSE);
00611 }
00612
00613 /**********************************************************
00614 //@OnCheckAuto
00615 //
00616 //@Description
00617 //
00618 //   Called when AutoAnswer check box is checked/unchecked
00619 //
00620 //@Args In:     Void
00621 //@Args Out:    Void
00622 //
00623 //
00624 //*********************************************************/
00625 void CRTCIncomingDlg::OnCheckauto()
00626 {
00627   if ( 1  == m_chkAutoAnswer.GetCheck())
00628   {
00629     SetAutoAnswerMode(VARIANT_TRUE);
00630   }
00631   else
00632   {
00633     SetAutoAnswerMode(VARIANT_FALSE);
00634   }
00635 }
00636
00637 /**********************************************************
00638 //@OnClose()
00639 //
00640 //@Description
00641 //
00642 //   On Close Event Handler
00643 //
00644 //
00645 //*********************************************************/
00646 void CRTCIncomingDlg::OnClose()
00647 {
00648
00649   HRESULT   hr = S_OK;
00650
00651   _ASSERTE(NULL != m_pIRTCClient);
00652
00653   //
00654   // Need to call PrepareForShutdown Before shutdown
00655   //
00656
00657   hr = m_pIRTCClient->PrepareForShutdown();
00658   if (FAILED(hr))
00659   {
00660      LOGMSGERROR(_T("IRTCClient::PrepareForShutdown Failed 0x%x"), hr);
00661      m_pIRTCClient->Shutdown();
00662      return;
00663   }
00664
00665   ShowWindow( SW_HIDE );
00666 }
00667
00668 /**********************************************************
00669 //@WindowProc
00670 //
00671 //@Description
00672 //
00673 //  Overriding to Process the WM_RTCCOREEVENT only
00674 //  for the RTCCE_ASYNC_CLEANUP event
00675 //
00676 //
00677 //*********************************************************/
00678
00679 LRESULT CRTCIncomingDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
00680 {
00681
00682   HRESULT    hr   = S_OK;
00683
00684   switch(message)
00685   {
00686     case WM_RTCCORE_EVENT:
00687     {
00688       ShutdownRTCApp();
00689       break;
00690     }
00691   default : return CDialog::WindowProc(message, wParam, lParam);
00692
00693   }
00694
00695   return CDialog::WindowProc(message, wParam, lParam);
00696 }
00697
00698
00699 /**********************************************************
00700 //@SetAutoAnswerMode
00701 //
00702 //@Description
00703 //  Setting the Answering mode for the Application
00704 //
00705 //
00706 //@Args In:     VARIANT_BOOL (T == AutoAnswer else manual)
00707 //@Args Out:    Void
00708 //
00709 //
00710 //*********************************************************/
00711 HRESULT
00712 CRTCIncomingDlg::SetAutoAnswerMode(VARIANT_BOOL bMode)
00713 {
00714   m_bAutoAnswer = bMode;
00715   return S_OK;
00716 }
00717
00718 /**********************************************************
00719 //@ RTC State Helper Methods
00720 //*********************************************************/
00721 /**********************************************************
00722 //@StateCoCreateClient()
00723 //
00724 //@Description
00725 //
00726 //  CoCreate the RTC Client COM Object
00727 //
00728 //@Args In:     None
00729 //@Args Out:    None
00730 //
00731 //
00732 //*********************************************************/
00733 HRESULT
00734 CRTCIncomingDlg::StateCoCreateClient()
00735 {
00736
00737   HRESULT hr = S_OK;
00738
00739   _ASSERTE(NULL != this);
00740
00741   hr = CoCreateInstance(CLSID_RTCClient,
00742               NULL,
00743               CLSCTX_INPROC_SERVER,
00744               IID_IRTCClient,
00745               reinterpret_cast<void **> (&m_pIRTCClient)
00746               );
00747
00748
00749   if (FAILED(hr))
00750   {
00751     LOGMSGERROR(_T("CoCreateInstance(CLSID_RTCClient) : Failed 0x%x"), hr);
00752     return hr;
00753   }
00754
00755   return hr;
00756
00757 }
00758
00759
00760 /**********************************************************
00761 //@StateInitClient
00762 //
00763 //@Description
00764 //
00765 //  Initialize the RTCClient Interface
00766 //
00767 //@Args In:     None
00768 //@Args Out:    None
00769 //
00770 //
00771 //*********************************************************/
00772 HRESULT
00773 CRTCIncomingDlg::StateInitClient()
00774 {
00775
00776   HRESULT hr = S_OK;
00777
00778   _ASSERTE(NULL != this);
00779   _ASSERTE(NULL != m_pIRTCClient);
00780
00781   hr = m_pIRTCClient->Initialize();
00782
00783   if (FAILED(hr))
00784   {
00785
00786     LOGMSGERROR(_T("IRTCClient::Initialize : Failed 0x%x"),
00787       hr);
00788     return hr;
00789   }
00790
00791   return hr;
00792 }
00793
00794 /**********************************************************
00795 //@StateSessionControl
00796 //
00797 //@Description
00798 //
00799 //  Call Control for this App we are only concerned with
00800 //  either answering the call or disconnecting the session
00801 //
00802
00803 //@Args In:     SESSION_OPERATION = {STO_ANSWER | STO_TERMINATE}
00804 //@Args Out:    HRESULT
00805 //
00806 //*********************************************************/
00807
00808
00809 HRESULT
00810 CRTCIncomingDlg::StateSessionControl(SESSION_OPERATION soType)
00811 {
00812
00813   HRESULT hr = S_OK;
00814
00815   _ASSERTE(NULL != this);
00816   _ASSERTE(NULL != m_pIRTCSession);
00817
00818   switch(soType)
00819   {
00820
00821   case STO_ANSWER:
00822     {
00823
00824       hr = m_pIRTCSession->Answer();
00825
00826
00827       if ( FAILED(hr) )
00828       {
00829
00830         LOGMSGERROR(_T("IRTCSession::Answer() Failed 0x%x"), hr);
00831
00832         return hr;
00833       }
00834
00835       //
00836       // Enable the Disconnect Button
00837       //
00838
00839       StateDisconnectIDC(VARIANT_TRUE);
00840
00841       break;
00842     }
00843   case STO_TERMINATE:
00844     {
00845
00846       hr = m_pIRTCSession->Terminate( RTCTR_NORMAL );
00847
00848       if ( FAILED(hr) )
00849       {
00850         LOGMSGERROR(_T("IRTCSession:::Terminate() Failed 0x%x"), hr);
00851       }
00852
00853       break;
00854     }
00855   default:
00856     return E_NOTIMPL;
00857
00858   }
00859
00860   return hr;
00861 }
00862
00863 /**********************************************************
00864 //@StateListenMode
00865 //
00866 //@Description
00867 //
00868 // Call to set the List Mode on the Client to open and
00869 // list to corresponding SIP ports
00870 //
00871 //
00872 //@Args In:     RTC_LISTEN_MODE = {see RTC SDK for types}
00873 //@Args Out:    HRESULT
00874 //
00875 //*********************************************************/
00876 HRESULT
00877 CRTCIncomingDlg::StateListenMode(RTC_LISTEN_MODE lMode)
00878 {
00879
00880   HRESULT hr = S_OK;
00881
00882   _ASSERTE(NULL != this);
00883   _ASSERTE(NULL != m_pIRTCClient);
00884
00885   //
00886   // Setting the Listen mode to receive incoming calls
00887   // event notifications. Depending upon the flag the
00888   // application will open and listen on a dynamic and/or a
00889   // registered port 5060 for any incoming SIP messages.
00890   //
00891
00892   hr = m_pIRTCClient->put_ListenForIncomingSessions(lMode);
00893
00894   if (FAILED(hr))
00895   {
00896
00897     LOGMSGERROR(_T("IRTCClient::put_ListenForIncomingSessions Failed 0x%x"),
00898       hr);
00899     return hr;
00900   }
00901   else
00902   {
00903     m_ctrlEditStatus.SetWindowText(_T("Listening ..."));
00904   }
00905
00906   return hr;
00907 }
00908
00909
00910
00911 /**********************************************************
00912 //@StateQueryActiveMedia
00913 //
00914 //@Description
00915 //
00916 // Query for Active media streams on the Client
00917 //
00918 //
00919 //@Args In:     Void
00920 //@Args Out:    long active media mask
00921 //
00922 //*********************************************************/
00923
00924 HRESULT
00925 CRTCIncomingDlg::StateQueryActiveMedia(LONG *plActiveMedia)
00926 {
00927   HRESULT hr = S_OK;
00928
00929   _ASSERTE(NULL != this);
00930   _ASSERTE(NULL != m_pIRTCClient);
00931
00932
00933   LONG   lActive   = 0;
00934   BSTR   bstrMedia = NULL;
00935
00936   hr = m_pIRTCClient->get_ActiveMedia(&lActive);
00937
00938   if (FAILED(hr))
00939   {
00940     LOGMSGERROR(_T("IRTCClient::get_ActiveMedia() Failed 0x%x"), hr);
00941     return hr;
00942   }
00943
00944   *plActiveMedia = lActive;
00945
00946
00947   FREE_BSTR_IF(bstrMedia);
00948
00949   return hr;
00950 }
00951
00952
00953 /**********************************************************
00954 //@StateSinkEvent()
00955 //
00956 //@Description
00957 //
00958 //  set the Connection point source and event filter
00959 //
00960 //@Args In:     LONG Event Mask
00961 //@Args Out:    None
00962 //
00963 //
00964 //*********************************************************/
00965 HRESULT
00966 CRTCIncomingDlg::StateSinkEvent(LONG lEventMask)
00967 {
00968
00969   HRESULT                   hr          = S_OK;
00970   IUnknown                  *pUnknown   = NULL;
00971   IConnectionPointContainer *pCPC       = NULL;
00972   IConnectionPoint          *pCP        = NULL;
00973
00974   _ASSERTE(NULL != this);
00975   _ASSERTE(NULL != m_pIRTCClient);
00976
00977   //
00978   // For this Application we need to only
00979   // set the following Event Masks
00980   //
00981
00982   lEventMask = RTCEF_CLIENT                     |
00983          RTCEF_SESSION_STATE_CHANGE       |
00984          RTCEF_MEDIA;
00985
00986   //
00987   // Set the Event filter to the Client
00988   //
00989
00990   hr = m_pIRTCClient->put_EventFilter(lEventMask);
00991
00992
00993   if (FAILED(hr))
00994   {
00995
00996     LOGMSGERROR(_T("IRTCClient::put_EventFilter Failed 0x%x"),
00997       hr);
00998
00999     return hr;
01000   }
01001
01002
01003   hr = QueryInterface(IID_IUnknown,
01004                 reinterpret_cast<void**> (&pUnknown)
01005              );
01006
01007   if (FAILED(hr))
01008   {
01009     LOGMSGERROR(_T("QueryInterface(IUnknown) Failed 0x%x"), hr);
01010
01011     return hr;
01012   }
01013
01014
01015   //
01016   // Getting the ConnectionPointContainer
01017   // from IRTCEventNotification Interface
01018   //
01019
01020   hr = m_pIRTCClient->QueryInterface(IID_IConnectionPointContainer,
01021                    reinterpret_cast<void**> (&pCPC)
01022                    );
01023
01024   if (FAILED(hr))
01025   {
01026
01027     LOGMSGERROR(_T("IRTCClient::QueryInterface(IConnectionPointContainer) Failed 0x%x"),
01028       hr);
01029     return hr;
01030   }
01031
01032
01033   //
01034   // Get the Connection Point
01035   //
01036
01037   hr = pCPC->FindConnectionPoint( IID_IRTCEventNotification,
01038                   &pCP );
01039
01040
01041   if (FAILED(hr))
01042   {
01043     LOGMSGERROR(_T("IConnectionPointContainer::FindConnectionPoint() Failed 0x%x"),
01044       hr);
01045
01046     pCPC->Release();
01047     return hr;
01048   }
01049
01050   //
01051   // Advise and store cookie for UnAdvise later
01052   //
01053
01054   hr = pCP->Advise( pUnknown, &m_dwEventCookie );
01055
01056   if (FAILED(hr))
01057   {
01058
01059     LOGMSGERROR(_T("IConnectionPoint::Advise() Failed 0x%x"), hr);
01060
01061     pCPC->Release();
01062     pCP->Release();
01063     return hr;
01064   }
01065
01066
01067   pCP->Release();
01068   pCPC->Release();
01069   pUnknown->Release();
01070
01071   return hr;
01072 }
01073
01074
01075 /**********************************************************
01076 //@StateUnSinkEvent
01077 //
01078 //@Description
01079 //
01080 //  unsink event connection point
01081 //
01082 //@Args In:     None
01083 //@Args Out:    None
01084 //
01085 //
01086 //*********************************************************/
01087 HRESULT
01088 CRTCIncomingDlg::StateUnSinkEvent()
01089 {
01090
01091   HRESULT            hr       = S_OK;
01092   IUnknown                  *pUnknown   = NULL;
01093   IConnectionPointContainer *pCPC       = NULL;
01094   IConnectionPoint          *pCP        = NULL;
01095
01096
01097   //
01098   // Get IUnknown From IRTCEventNotifcation derived
01099   // implementation (this class)
01100   //
01101
01102   hr = QueryInterface(IID_IUnknown,
01103               reinterpret_cast<void**> (&pUnknown)
01104              );
01105
01106   if (FAILED(hr))
01107   {
01108     LOGMSGERROR(_T("QueryInterface(IUnknown) Failed 0x%x"), hr);
01109     return hr;
01110   }
01111
01112
01113   //
01114   // Get the Connectionpoint container
01115   //
01116
01117   hr = m_pIRTCClient->QueryInterface(IID_IConnectionPointContainer,
01118                    reinterpret_cast<void**> (&pCPC)
01119                    );
01120
01121   if (FAILED(hr))
01122   {
01123     LOGMSGERROR(_T("IRTCClient::QueryInterface(IConnectionPointContainer) Failed 0x%x"), hr);
01124
01125     return hr;
01126   }
01127
01128   //
01129   // Find the Connection Point
01130   //
01131
01132   hr = pCPC->FindConnectionPoint( IID_IRTCEventNotification,
01133                   &pCP );
01134
01135
01136   if (FAILED(hr))
01137   {
01138
01139     LOGMSGERROR(_T("IConnectionPointContainer::FindConnectionPoint Failed 0x%x"),
01140       hr);
01141
01142     pCPC->Release();
01143     return hr;
01144   }
01145
01146   //
01147   // Call Advise and save cookie for unadvise
01148   //
01149
01150   hr = pCP->Unadvise( m_dwEventCookie );
01151
01152   if (FAILED(hr))
01153   {
01154
01155     LOGMSGERROR(_T("IConnectionPoint::Unadvise() Failed 0x%x"),
01156       hr);
01157
01158     pCPC->Release();
01159     pCP->Release();
01160     return hr;
01161   }
01162
01163
01164   pCP->Release();
01165   pCPC->Release();
01166   pUnknown->Release();
01167
01168
01169   return hr;
01170 }
01171
01172
01173
01174 /**********************************************************
01175 //@ReleaseStateMachine
01176 //
01177 //@Description
01178 //
01179 //  Internal Destructor , releases all the Interfaces
01180 //
01181 //@Args In:     None
01182 //@Args Out:    None
01183 //
01184 //
01185 //*********************************************************/
01186
01187 HRESULT
01188 CRTCIncomingDlg::ReleaseStateMachine()
01189 {
01190
01191   ULONG ulRef         = 0;
01192   BOOL  fRet          = FALSE;
01193
01194   if ( NULL != m_pIRecvVideo )
01195   {
01196
01197     ulRef = m_pIRecvVideo->Release();
01198     m_pIRecvVideo = NULL;
01199
01200   }
01201
01202   if ( NULL != m_pIPrevVideo )
01203   {
01204
01205     ulRef = m_pIPrevVideo->Release();
01206     m_pIPrevVideo = NULL;
01207
01208   }
01209
01210   if ( NULL != m_pIRTCSession )
01211   {
01212
01213     ulRef = m_pIRTCSession->Release();
01214     m_pIRTCSession = NULL;
01215   }
01216
01217   return S_OK;
01218 }
01219
01220 /**********************************************************
01221 //@AddToMediaCapabilities
01222 //
01223 //@Description
01224 //
01225 //  Add Media Capability to the Client
01226 //
01227 //@Args In:     None
01228 //@Args Out:    None
01229 //
01230 //
01231 //*********************************************************/
01232
01233 HRESULT
01234 CRTCIncomingDlg::AddToMediaCapabilities(LONG lMedia, VARIANT_BOOL fPersist)
01235 {
01236
01237   HRESULT hr = S_OK;
01238   LONG    lGetMedia = 0;
01239   LONG    lSetMedia = 0;
01240
01241   _ASSERTE(NULL != m_pIRTCClient);
01242
01243   //
01244   // Get the Current Media Capabilities
01245   // and then add the media mask to the current media
01246   //
01247
01248   hr = m_pIRTCClient->get_MediaCapabilities(&lGetMedia);
01249
01250
01251   if (FAILED(hr))
01252   {
01253     LOGMSGERROR(_T("IRTCClient::get_MediaCapabilities() Failed 0x%x"), hr);
01254     return hr;
01255   }
01256   else
01257   {
01258     //
01259     // Add New Media Capability to Current Media Mask
01260     //
01261
01262     lSetMedia = lGetMedia | lMedia;
01263
01264     hr = m_pIRTCClient->SetPreferredMediaTypes(lSetMedia, fPersist);
01265
01266     if (FAILED(hr))
01267     {
01268       LOGMSGERROR(_T("IRTCClient::SetPreferredMediaTypes Failed 0x%x"), hr);
01269       return hr;
01270     }
01271
01272   }
01273
01274   return hr;
01275 }
01276
01277
01278
01279 /**********************************************************
01280 //@ RTCEventNotification Implementation
01281 //*********************************************************/
01282
01283 /**********************************************************
01284 //@QueryInterface
01285 //
01286 //@Description
01287 //
01288 //  QI for IUnknown Implementation
01289 //
01290 //@Args In:     None
01291 //@Args Out:    None
01292 //
01293 //
01294 //*********************************************************/
01295
01296 HRESULT
01297 CRTCIncomingDlg::QueryInterface(REFIID iid,
01298                    void **ppvObject)
01299 {
01300   if(iid == IID_IRTCEventNotification)
01301   {
01302
01303     *ppvObject = static_cast<IRTCEventNotification *> (this);
01304     AddRef();
01305     return S_OK;
01306   }
01307
01308
01309   if(iid == IID_IUnknown)
01310   {
01311
01312     *ppvObject = static_cast<IUnknown *> (this);
01313     AddRef();
01314     return S_OK;
01315   }
01316
01317   else
01318   {
01319      *ppvObject = NULL;
01320      return E_NOINTERFACE;
01321   }
01322
01323   return S_OK;
01324 }
01325
01326 /**********************************************************
01327 //@AddRef
01328 //
01329 //@Description
01330 //
01331 //  Ref Count
01332 //
01333 //@Args In:     None
01334 //@Args Out:    None
01335 //
01336 //
01337 //*********************************************************/
01338
01339 ULONG
01340 CRTCIncomingDlg::AddRef()
01341 {
01342
01343   ULONG ulrefCount = InterlockedIncrement(&m_dwRefCount);
01344   return ulrefCount;
01345 }
01346
01347
01348 /**********************************************************
01349 //@Release
01350 //
01351 //@Description
01352 //
01353 //  object release
01354 //
01355 //@Args In:     None
01356 //@Args Out:    None
01357 //
01358 //
01359 //*********************************************************/
01360
01361 ULONG
01362 CRTCIncomingDlg::Release()
01363 {
01364
01365   ULONG ulrefCount = InterlockedDecrement(&m_dwRefCount);
01366
01367
01368   if(0 == ulrefCount)
01369   {
01370     delete this;
01371   }
01372
01373   return ulrefCount;
01374 }
01375
01376 /**********************************************************
01377 //@Event
01378 //
01379 //@Description
01380 //  RTC CallBack for Events, the messages are
01381 //  posted to the thread message pump
01382 //
01383 //
01384 //
01385 //@Args In:     RTC_EVENT , IDispatch
01386 //@Args Out:    HRESULT
01387 //
01388 //
01389 //*********************************************************/
01390
01391 HRESULT
01392 STDMETHODCALLTYPE
01393 CRTCIncomingDlg::Event(
01394               RTC_EVENT RTCEvent,
01395             IDispatch * pEvent
01396             )
01397
01398 {
01399   HRESULT hr  = S_OK;
01400
01401   if (NULL != pEvent)
01402   {
01403     switch (RTCEvent)
01404     {
01405
01406       case RTCE_CLIENT                    :
01407       hr =  RTCClientEvent(pEvent);
01408         break;
01409       case RTCE_SESSION_STATE_CHANGE      :
01410         hr =  RTCSessionStateEvent(pEvent);
01411         break;
01412       case RTCE_MEDIA                     :
01413         hr =    RTCMediaEvent(pEvent);
01414         break;
01415         default:  break;
01416     }
01417   }
01418
01419     return hr;
01420 }
01421
01422
01423 /**********************************************************
01424 //@ RTC Event Parsers
01425 //*********************************************************/
01426
01427 /**********************************************************
01428 //@RTCClientEvent
01429 //
01430 //@Description
01431 //
01432 //  Sample is not doing any Special Processing for this Event
01433 //
01434 //@Args In:
01435 //@Args Out:
01436 //
01437 //
01438 //*********************************************************/
01439
01440 HRESULT
01441 CRTCIncomingDlg::RTCClientEvent(IDispatch *pIDispatch)
01442 {
01443   HRESULT               hr            = S_OK;
01444   IRTCClientEvent      *pIClientEvent = NULL;
01445   RTC_CLIENT_EVENT_TYPE EventType;
01446
01447   hr = pIDispatch->QueryInterface(IID_IRTCClientEvent,
01448                   reinterpret_cast<void**> (&pIClientEvent)
01449                   );
01450
01451   if (FAILED(hr))
01452   {
01453     LOGMSGERROR(_T("IDispatch::QueryInterface(IRTCClientEvent) Failed 0x%x"),
01454       hr);
01455     return hr;
01456   }
01457
01458   //
01459   // Getting the Session Interface
01460   //
01461
01462   hr = pIClientEvent->get_EventType(&EventType);
01463
01464   if (FAILED(hr))
01465   {
01466     LOGMSGERROR(_T("IRTCClientEvent::get_EventType Failed 0x%x"), hr);
01467
01468     pIClientEvent->Release();
01469     pIClientEvent = NULL;
01470     return hr;
01471   }
01472
01473   if (RTCCET_ASYNC_CLEANUP_DONE  == EventType)
01474   {
01475     //
01476     // When the WndProc gets this message we can
01477     // destroy the window
01478     //
01479
01480     DBLOGGER(_T("Final Exit ... ASYNC_CLEANUP_DONE\n"));
01481
01482     SendMessage(WM_RTCCORE_EVENT, (WPARAM) EventType, (LPARAM) NULL);
01483   }
01484
01485   if (NULL != pIClientEvent)
01486   {
01487     pIClientEvent->Release();
01488     pIClientEvent = NULL;
01489
01490   }
01491   return hr;
01492 }
01493
01494 /**********************************************************
01495 //@RTCSessionStateEvent
01496 //
01497 //@Description
01498 //
01499 //  Session State Processing
01500 //
01501 //@Args In:
01502 //@Args Out:
01503 //
01504 //
01505 //*********************************************************/
01506
01507 HRESULT
01508 CRTCIncomingDlg::RTCSessionStateEvent(IDispatch *pIDispatch)
01509 {
01510   HRESULT hr                                  = S_OK;
01511   IRTCSessionStateChangeEvent *pISessionState = NULL;
01512   RTC_SESSION_STATE SessionState;
01513
01514
01515   hr = pIDispatch->QueryInterface(IID_IRTCSessionStateChangeEvent,
01516                   reinterpret_cast<void**> (&pISessionState)
01517                   );
01518
01519   if (FAILED(hr))
01520   {
01521
01522     LOGMSGERROR(_T("IDispatch::QueryInterface(IRTCSessionStateChangeEvent) Failed 0x%x"),
01523       hr);
01524     return hr;
01525   }
01526
01527   //
01528   // Getting the Session Interface
01529   //
01530
01531   hr = pISessionState->get_State(&SessionState);
01532
01533   if (FAILED(hr))
01534   {
01535     LOGMSGERROR(_T("IRTCSessionStateChangeEvent::get_State Failed 0x%x"), hr);
01536
01537     pISessionState->Release();
01538     pISessionState = NULL;
01539     return hr;
01540   }
01541
01542
01543   //
01544   // Determine the Session State to Perform automatic
01545   // operation or set the state in the Status Edit Box
01546   // if the session pointer is not null then we currently
01547   // have a session going on.
01548   //
01549
01550   switch(SessionState)
01551   {
01552   case RTCSS_IDLE: break;
01553   case RTCSS_INCOMING:
01554   {
01555
01556     if ( m_pIRTCSession != NULL)
01557     {
01558       pISessionState->Release();
01559       pISessionState = NULL;
01560       return S_OK;
01561     }
01562
01563     m_ctrlEditStatus.SetWindowText(_T("Incoming Call..."));
01564     hr = pISessionState->get_Session(&m_pIRTCSession);
01565
01566     if (FAILED(hr))
01567     {
01568       LOGMSGERROR(_T("IRTCSessionStateChangeEvent::get_Session Failed 0x%x"), hr);
01569       pISessionState->Release();
01570       pISessionState = NULL;
01571       return hr;
01572     }
01573
01574     //
01575     // Answer Automatically if on Auto Answer mode
01576     //
01577
01578
01579     if (m_bAutoAnswer == VARIANT_TRUE)
01580     {
01581
01582       if(SUCCEEDED(hr = StateSessionControl(STO_ANSWER)))
01583       {
01584         StateDisconnectIDC(VARIANT_TRUE);
01585       }
01586     }
01587     else
01588     {
01589        StateAnswerIDC(VARIANT_TRUE);
01590     }
01591
01592     break;
01593   }
01594   case RTCSS_ANSWERING:
01595     m_ctrlEditStatus.SetWindowText(_T("Answering ..."));
01596     break;
01597   case RTCSS_INPROGRESS:
01598     m_ctrlEditStatus.SetWindowText(_T("In Progress ..."));
01599     break;
01600   case RTCSS_CONNECTED :
01601     m_ctrlEditStatus.SetWindowText(_T("Connected ..."));
01602     break;
01603   case RTCSS_DISCONNECTED:
01604     {
01605       //
01606       // Release the Session object if the Session
01607       // was terminated
01608       //
01609
01610       StateDisconnectIDC(VARIANT_FALSE);
01611       StateAnswerIDC(VARIANT_FALSE);
01612       m_ctrlEditStatus.SetWindowText(_T("Disconnected ..."));
01613       m_ctrlEditStatus.SetWindowText(_T("Listening ..."));
01614
01615
01616       m_pIRTCSession->Release();
01617       m_pIRTCSession = NULL;
01618
01619       break;
01620     }
01621   default :
01622     {
01623
01624       pISessionState->Release();
01625       pISessionState = NULL;
01626       return E_UNEXPECTED;
01627
01628     }
01629
01630   }
01631
01632
01633   if (NULL != pISessionState)
01634   {
01635     pISessionState->Release();
01636     pISessionState = NULL;
01637
01638   }
01639
01640   return hr;
01641 }
01642
01643
01644 /**********************************************************
01645 //@RTCMediaEvent
01646 //
01647 //@Description
01648 //
01649 //  Parser for Media Event
01650 //
01651 //  here we start the video window in a specific
01652 //  window location of the dialog box, we can
01653 //  only do this if the video stream has started
01654 //  if an application doesnt care about setting
01655 //  the video window coordinated you can get the
01656 //  video window and put_AutoShow(TRUE) , this will
01657 //  make the video window automatically visible when
01658 //  the stream has started.
01659 //
01660 //
01661 //@Args In:     IDispatch Event Interface
01662 //@Args Out:    HRESULT
01663 //
01664 //
01665 //*********************************************************/
01666
01667 HRESULT
01668 CRTCIncomingDlg::RTCMediaEvent(IDispatch *pIDispatch)
01669 {
01670   HRESULT hr                          = S_OK;
01671   IRTCMediaEvent        *pIMediaEvent = NULL;
01672   LONG                   lMediaType   = 0;
01673   HWND                   hwdVideoRecv , hwdVideoSend;
01674   RTC_MEDIA_EVENT_TYPE   EventType;
01675
01676   hr = pIDispatch->QueryInterface(IID_IRTCMediaEvent,
01677                   reinterpret_cast<void**> (&pIMediaEvent)
01678                   );
01679
01680   if (FAILED(hr))
01681   {
01682
01683     LOGMSGERROR(_T("IDispatch::QueryInterface(IRTCMediaEvent) Failed 0x%x"), hr);
01684     return hr;
01685   }
01686
01687   pIMediaEvent->get_MediaType(&lMediaType);
01688   pIMediaEvent->get_EventType(&EventType);
01689
01690   if ( (lMediaType == RTCMT_VIDEO_RECEIVE) && (EventType == RTCMET_STARTED) )
01691   {
01692
01693        RECT    rectPos;
01694
01695        hr = m_pIRTCClient->get_IVideoWindow(  RTCVD_RECEIVE , &m_pIRecvVideo);
01696
01697       if (SUCCEEDED(hr))
01698       {
01699         CString cstrText;
01700
01701         hr = m_pIRecvVideo->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
01702
01703         if(FAILED(hr))
01704         {
01705           LOGMSGERROR(_T("IVideoWindow::put_WindowStyle() Failed 0x%x"), hr);
01706
01707           pIMediaEvent->Release();
01708           pIMediaEvent = NULL;
01709
01710           return hr;
01711         }
01712
01713         hr = m_pIRecvVideo->put_Owner((OAHWND) m_hWnd);
01714
01715         if(FAILED(hr))
01716         {
01717
01718           LOGMSGERROR(_T("IVideoWindow::put_Owner() Failed 0x%x"), hr);
01719
01720           pIMediaEvent->Release();
01721           pIMediaEvent = NULL;
01722
01723           return hr;
01724         }
01725
01726
01727         GetDlgItem( IDC_VRECV, &hwdVideoRecv );
01728
01729         ::GetClientRect(hwdVideoRecv, &rectPos);
01730
01731             hr = m_pIRecvVideo->SetWindowPosition(
01732           rectPos.left   + RECVVID_LEFT,
01733         rectPos.top    + RECVVID_TOP,
01734         rectPos.right  - RECVVID_RIGHT,
01735         rectPos.bottom - RECVVID_BOTTOM
01736         );
01737
01738         if(FAILED(hr))
01739         {
01740           LOGMSGERROR(_T("IVideoWindow::SetWindowPosition() Failed 0x%x"), hr);
01741
01742           pIMediaEvent->Release();
01743           pIMediaEvent = NULL;
01744
01745           return hr;
01746         }
01747
01748         hr = m_pIRecvVideo->put_Visible(TRUE);
01749
01750         if (FAILED(hr))
01751         {
01752           LOGMSGERROR(_T("IVideoWindow::put_Visible Failed 0x%x"), hr);
01753
01754           pIMediaEvent->Release();
01755           pIMediaEvent = NULL;
01756
01757           return hr;
01758         }
01759
01760       }
01761
01762   }
01763
01764   else if ( ( lMediaType == RTCMT_VIDEO_RECEIVE) && (EventType == RTCMET_STOPPED))
01765   {
01766
01767     //
01768     // we must put_Visible false and set the owner
01769     // as null See DShow IVideoWindow SDK
01770     // NOTE: should not close window without releasing video
01771     // or not removing handler ownership from video window.
01772     //
01773
01774     m_pIRecvVideo->put_Visible(FALSE);
01775     m_pIRecvVideo->put_Owner(NULL);
01776
01777
01778     m_pIRecvVideo->Release();
01779     m_pIRecvVideo = NULL;
01780
01781   }
01782
01783   else if ( (lMediaType == RTCMT_VIDEO_SEND) &&  (EventType == RTCMET_STARTED))
01784   {
01785
01786        RECT    rectPos;
01787
01788        hr = m_pIRTCClient->get_IVideoWindow(  RTCVD_PREVIEW , &m_pIPrevVideo);
01789
01790       if (SUCCEEDED(hr))
01791       {
01792         CString cstrText;
01793
01794         hr = m_pIPrevVideo->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
01795
01796         if(FAILED(hr))
01797         {
01798           LOGMSGERROR(_T("IVideoWindow::put_WindowStyle() Failed 0x%x"), hr);
01799
01800           pIMediaEvent->Release();
01801           pIMediaEvent = NULL;
01802
01803           return hr;
01804         }
01805
01806         hr = m_pIPrevVideo->put_Owner((OAHWND) m_hWnd);
01807
01808         if(FAILED(hr))
01809         {
01810
01811           LOGMSGERROR(_T("IVideoWindow::put_Owner() Failed 0x%x"), hr);
01812
01813           pIMediaEvent->Release();
01814           pIMediaEvent = NULL;
01815           return hr;
01816         }
01817
01818         GetDlgItem( IDC_VSEND , &hwdVideoSend );
01819
01820         ::GetClientRect(hwdVideoSend, &rectPos);
01821
01822             hr = m_pIPrevVideo->SetWindowPosition(
01823             rectPos.left + PREVVID_LEFT,
01824         rectPos.top  + PREVVID_TOP,
01825         rectPos.right - PREVVID_RIGHT,
01826         rectPos.bottom - PREVVID_BOTTOM);
01827
01828
01829         if(FAILED(hr))
01830         {
01831           LOGMSGERROR(_T("IVideoWindow::SetWindowPosition() Failed 0x%x"), hr);
01832
01833           pIMediaEvent->Release();
01834           pIMediaEvent = NULL;
01835           return hr;
01836         }
01837
01838         hr = m_pIPrevVideo->put_Visible(TRUE);
01839
01840         if (FAILED(hr))
01841         {
01842           LOGMSGERROR(_T("IVideoWindow::put_Visible Failed 0x%x"), hr);
01843
01844           pIMediaEvent->Release();
01845           pIMediaEvent = NULL;
01846           return hr;
01847         }
01848
01849       }
01850
01851   }
01852
01853   else if ( ( lMediaType == RTCMT_VIDEO_SEND) &&
01854      (EventType == RTCMET_STOPPED))
01855   {
01856
01857     //
01858     // we must put_Visible false and set the owner
01859     // as null See DShow IVideoWindow SDK
01860     // NOTE: should not close window without releasing video
01861     // or not removing handler ownership from video window.
01862     //
01863
01864     m_pIPrevVideo->put_Visible(FALSE);
01865     m_pIPrevVideo->put_Owner(NULL);
01866
01867     m_pIPrevVideo->Release();
01868     m_pIPrevVideo = NULL;
01869
01870
01871   }
01872
01873
01874   if (NULL != pIMediaEvent)
01875   {
01876
01877     pIMediaEvent->Release();
01878     pIMediaEvent = NULL;
01879
01880   }
01881
01882   return hr;
01883
01884 }
01885
01886
Generated on Wed Nov 13 2024 16:52:21 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/Data/Xmit/Xmit.Idl Source File

  • NetDS
  • RPC
  • Data
  • Xmit

Xmit.Idl

Go to the documentation of this file.
00001 [ uuid(56BF67C0-6503-1068-BF67-00DD010FBF25),
00002   version(1.0),
00003   pointer_default(unique)
00004 ]
00005 interface xmit
00006 {
00007
00008 typedef struct _DOUBLE_LINK_LIST {
00009     short sNumber;
00010     struct _DOUBLE_LINK_LIST * pNext;
00011     struct _DOUBLE_LINK_LIST * pPrevious;
00012 } DOUBLE_LINK_LIST;
00013
00014 typedef struct _DOUBLE_XMIT_TYPE {
00015     short sSize;
00016     [size_is(sSize)] short asNumber[];
00017 } DOUBLE_XMIT_TYPE;
00018
00019 /* transmit a double-linked list as an array */
00020 typedef [transmit_as(DOUBLE_XMIT_TYPE)] DOUBLE_LINK_LIST DOUBLE_LINK_TYPE;
00021
00022
00023 void ModifyListProc([in, out] DOUBLE_LINK_TYPE *pHead);
00024
00025 void Shutdown(void);
00026
00027 }
Generated on Wed Nov 13 2024 16:52:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/compdata.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

compdata.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "Comp.h"
00016 #include "CompData.h"
00017 #include "DataObj.h"
00018 #include "Resource.h"
00019
00020                              // Tracing stuff
00021 #include "TraceMacro.h"
00022 #undef  MODULESTRING
00023 #define MODULESTRING  _T("CComponentData")
00024
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // Construction/Destruction
00028
00029
00030 //---------------------------------------------------------------------------
00031 //  This constructor is called when the Snap-in is selected from the
00032 //  Add/Remove dialog.  Build our static node and load the required
00033 //  clipformats before MMC calls us.
00034 //
00035 CComponentData::CComponentData()
00036 {
00037   // Do not assume only one instance of IComponentData implementation is created.
00038
00039
00040     m_cRef                = 0;
00041     m_ipConsoleNameSpace2 = NULL;
00042     m_ipConsole           = NULL;
00043     m_ipScopeImage        = NULL;
00044     m_hImageStrip16       = NULL;
00045     m_hImageStrip32       = NULL;
00046     m_pszwHelpPath        = NULL;
00047     m_pStaticNode         = NULL;
00048
00049     // Increment this so DllCanUnloadNow works correctly
00050     InterlockedIncrement((long*)&g_uObjectCount);
00051
00052     NODE_PROPERTIES NodeProps;
00053     ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00054     wcscpy( NodeProps.szNodeName, gwszROOT_NODE_NAME );
00055     NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(this);
00056     NodeProps.pParentObject  = NULL;
00057
00058     m_pStaticNode = new CStaticNode;
00059     m_pStaticNode->Initialize( &NodeProps );
00060
00061     InitClipboardFormats();
00062 }
00063
00064 //---------------------------------------------------------------------------
00065 CComponentData::~CComponentData()
00066 {
00067   if( NULL != m_pStaticNode )
00068   {
00069     delete m_pStaticNode;
00070     m_pStaticNode = NULL;
00071   }
00072
00073   // All done, decrement object count so the dll can be unloaded
00074   InterlockedDecrement((long*)&g_uObjectCount);
00075 }
00076
00077
00078 /////////////////////////////////////////////////////////////////////////////
00079 // IUnknown implementation
00080
00081 //---------------------------------------------------------------------------
00082 //  SNAPHELP:  Added support of ISnapinHelp2
00083 //
00084 STDMETHODIMP CComponentData::QueryInterface
00085 (
00086   REFIID   riid,       //[in] Identifier of the requested interface
00087   LPVOID   *ppv        //[out] Address of requested interface
00088 )
00089 {
00090   if( !ppv )
00091     return E_FAIL;
00092
00093   *ppv = NULL;
00094
00095   if( IsEqualIID(riid, IID_IUnknown) )
00096     *ppv = static_cast<IComponentData*>(this);
00097   else if( IsEqualIID(riid, IID_IComponentData) )
00098     *ppv = static_cast<IComponentData*>(this);
00099   else if( IsEqualIID(riid, IID_IComponentData2) )
00100     *ppv = static_cast<IComponentData2*>(this);
00101   else if( IsEqualIID(riid, IID_IExtendContextMenu) )
00102     *ppv = static_cast<IExtendContextMenu*>(this);
00103   else if( IsEqualIID(riid, IID_ISnapinHelp2) )
00104     *ppv = static_cast<ISnapinHelp2*>(this);
00105
00106
00107   if( *ppv )
00108   {
00109     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00110     return S_OK;
00111   }
00112
00113   return E_NOINTERFACE;
00114 }
00115
00116 //---------------------------------------------------------------------------
00117 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00118 {
00119   return InterlockedIncrement((LONG*)&m_cRef);
00120 }
00121
00122 //---------------------------------------------------------------------------
00123 STDMETHODIMP_(ULONG) CComponentData::Release()
00124 {
00125   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00126   {
00127     delete this;
00128     return 0;
00129   }
00130
00131   return m_cRef;
00132 }
00133
00134 /////////////////////////////////////////////////////////////////////////////
00135 // Interface IComponentData
00136
00137 //---------------------------------------------------------------------------
00138 //  Called when the user selects the Snap-in from the scope pane.
00139 //  This is where we QI and cache interfaces we will use later.  These
00140 //  interfaces are for future use since they are not used in this sample
00141 //
00142 HRESULT CComponentData::Initialize
00143 (
00144   LPUNKNOWN pUnknown         //[in] Pointer to the console's IUnknown
00145 )
00146 {
00147   HRESULT hResult = S_FALSE;
00148                              // Fail to initialize if we can't get the
00149   do                         // interfaces we need to cache
00150   {
00151     hResult = pUnknown->QueryInterface(IID_IConsoleNameSpace2, (void**)&m_ipConsoleNameSpace2);
00152     BREAK_ON_ERROR( hResult );
00153
00154     hResult = pUnknown->QueryInterface(IID_IConsole3, (void**)&m_ipConsole);
00155     BREAK_ON_ERROR( hResult );
00156
00157     // Add the images for the scope tree
00158     hResult = m_ipConsole->QueryScopeImageList(&m_ipScopeImage);
00159     BREAK_ON_ERROR( hResult );
00160
00161     // Load the bitmaps from the dll
00162     m_hImageStrip16 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_16) );
00163     if( NULL == m_hImageStrip16 )
00164     {
00165       hResult = S_FALSE;
00166       continue;
00167     }
00168
00169     m_hImageStrip32 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_32) );
00170      if( NULL == m_hImageStrip32)
00171     {
00172       hResult = S_FALSE;
00173       continue;
00174     }
00175
00176     // Set the images
00177     hResult = m_ipScopeImage->ImageListSetStrip( (LONG_PTR*)m_hImageStrip16,
00178                                                  (LONG_PTR*)m_hImageStrip32,
00179                                                  0,
00180                                                  RGB(0,255,0)
00181                                                );
00182     BREAK_ON_ERROR( hResult );
00183   }
00184   while( 0 );
00185
00186   return hResult;
00187 }
00188
00189 //---------------------------------------------------------------------------
00190 //  Called by the console every time we need to create a new result view.
00191 //  There can be several different result views. Aside from the default one
00192 //  created when the Snap-in initializes, additional ones are created by
00193 //  selecting "New window from here" in MMC's user interface.
00194 //
00195 HRESULT CComponentData::CreateComponent
00196 (
00197   LPCOMPONENT __RPC_FAR* ppComponent   //[out] Points to new IComponent class
00198 )
00199 {
00200   *ppComponent = NULL;
00201
00202   // Pass the new CComponent a pointer to it's parent
00203   CComponent* pComponent = new CComponent( this );
00204
00205   if( NULL == pComponent )
00206     return E_OUTOFMEMORY;
00207
00208   return pComponent->QueryInterface( IID_IComponent, (void**)ppComponent );
00209 }
00210
00211 //---------------------------------------------------------------------------
00212 //  Handles notification events from MMC
00213 //
00214 HRESULT CComponentData::Notify
00215 (
00216   LPDATAOBJECT     ipDataObject,   //[in] Points to the selected data object
00217   MMC_NOTIFY_TYPE  MmcEvent,       //[in] Identifies action taken by user
00218   LPARAM           nArg,           //[in] Depends on the notification type
00219   LPARAM           nParam          //[in] Depends on the notification type
00220 )
00221 {
00222   TRACE_EVENT( _T("Notify"), MmcEvent );  // Provides trace output
00223
00224   HRESULT hResult = S_FALSE;
00225   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00226   if( NULL == pNode )
00227     return hResult;
00228
00229   switch( MmcEvent )
00230   {
00231     case MMCN_EXPAND:
00232       hResult = pNode->OnExpand( ipDataObject, nArg, nParam, (LONG_PTR)this );
00233       break;
00234
00235     case MMCN_REMOVE_CHILDREN:
00236       hResult = pNode->OnRemoveChildren( ipDataObject, nArg, nParam, (LONG_PTR)this );
00237       break;
00238
00239     case MMCN_PRELOAD:                 // Function not implemented
00240     case MMCN_PROPERTY_CHANGE:         // Function not implemented
00241     case MMCN_DELETE:                  // Function not implemented
00242     case MMCN_RENAME:                  // Function not implemented
00243     default:
00244       break;
00245   }
00246
00247   return hResult;
00248 }
00249
00250 //---------------------------------------------------------------------------
00251 //  This is where we release any cached interface pointers or any
00252 //  allocated resources.
00253 //
00254 HRESULT CComponentData::Destroy( void)
00255 {
00256   SAFE_RELEASE( m_ipScopeImage        );
00257   SAFE_RELEASE( m_ipConsoleNameSpace2 );
00258   SAFE_RELEASE( m_ipConsole           );
00259
00260   SAFE_FREE_BITMAP( m_hImageStrip16 );
00261   SAFE_FREE_BITMAP( m_hImageStrip32 );
00262
00263   if( NULL != m_pszwHelpPath )
00264     CoTaskMemFree( m_pszwHelpPath );
00265
00266   return S_OK;
00267 }
00268
00269 //---------------------------------------------------------------------------
00270 //  MMC provides a NULL cookie for the static/root node.  In this sample
00271 //  we don't pass that on, instead we use the pointer to our static node
00272 //  object which handles notifications
00273 //
00274 HRESULT CComponentData::QueryDataObject
00275 (
00276   MMC_COOKIE              nCookie,     //[in]  Indentifier of the selected node
00277   DATA_OBJECT_TYPES       nEnumType,   //[in]  Context in which this object was created
00278   LPDATAOBJECT __RPC_FAR* ppDataObject //[out] Points to data object we create
00279 )
00280 {
00281   HRESULT hResult = S_FALSE;
00282   LONG_PTR   uCookie = 0;
00283
00284   CDataObject* pNewObject = new CDataObject();
00285   if( NULL == pNewObject )
00286     hResult = E_OUTOFMEMORY;
00287
00288   (0 == nCookie) ? uCookie = (LONG_PTR)m_pStaticNode : uCookie = nCookie;
00289   pNewObject->SetPrivateData( uCookie, (ULONG)nEnumType );
00290
00291   hResult = pNewObject->QueryInterface( IID_IDataObject, (void**)ppDataObject );
00292
00293   return hResult;
00294 }
00295
00296 //---------------------------------------------------------------------------
00297 //  Delegate the call to the static node object
00298 //
00299 HRESULT CComponentData::GetDisplayInfo
00300 (
00301   SCOPEDATAITEM* pScopeDataItem    //[out][in] Points to a SCOPEDATAITEM struct
00302 )
00303 {
00304   _ASSERT( NULL != pScopeDataItem );
00305   HRESULT hResult = S_OK;
00306
00307   // The console will only ask for the name string
00308   if(  pScopeDataItem->mask & SDI_STR )
00309   {
00310     CBaseNode* pNode = reinterpret_cast<CBaseNode*>(pScopeDataItem->lParam);
00311     hResult = pNode->GetDisplayInfo( pScopeDataItem );
00312   }
00313
00314   return hResult;
00315 }
00316
00317 //---------------------------------------------------------------------------
00318 HRESULT CComponentData::CompareObjects
00319 (
00320   LPDATAOBJECT ipDataObjectA,    //[in] First data object to compare
00321   LPDATAOBJECT ipDataObjectB     //[in] Second data object to compare
00322 )
00323 {
00324   return E_NOTIMPL;
00325 }
00326
00327 //---------------------------------------------------------------------------
00328 HRESULT CComponentData::QueryDispatch
00329 (
00330   MMC_COOKIE         nCookie,    //[in]  Item for which IDispatch is requested
00331   DATA_OBJECT_TYPES  eType,      //[in]  Context of item
00332   LPDISPATCH*        pipDispatch //[out] IDispatch pointer
00333 )
00334 {
00335   return E_NOTIMPL;
00336 }
00337
00338
00339 /////////////////////////////////////////////////////////////////////////////
00340 // Interface IExtendContextMenu
00341
00342 //---------------------------------------------------------------------------
00343 HRESULT CComponentData::AddMenuItems
00344 (
00345   LPDATAOBJECT ipDataObject,         //[in]
00346   LPCONTEXTMENUCALLBACK ipCallback,  //[in]
00347   long __RPC_FAR* pInsertionAllowed  //[out-in]
00348 )
00349 {
00350   _ASSERT( NULL != ipCallback );
00351   HRESULT hResult = S_FALSE;
00352
00353   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00354   if( NULL != pNode )
00355     hResult = pNode->AddMenuItems( ipCallback, pInsertionAllowed );
00356
00357   return hResult;
00358 }
00359
00360 //---------------------------------------------------------------------------
00361 //
00362 HRESULT CComponentData::Command
00363 (
00364   long         lCommandID,   //[in] Identifier of the menu item
00365   LPDATAOBJECT ipDataObject  //[in] DataObject for selected node
00366 )
00367 {
00368   HRESULT hResult = S_OK;
00369
00370   CBaseNode* pNode = ExtractBaseNodePtr( ipDataObject );
00371   if( NULL != pNode )
00372     hResult = pNode->Command( lCommandID );
00373
00374   return hResult;
00375 }
00376
00377 /////////////////////////////////////////////////////////////////////////////
00378 //  ISnapinHelp methods
00379
00380
00381 //---------------------------------------------------------------------------
00382 //  This method's sole purpose is to supply the path to the Snap-in's
00383 //  compiled help file.
00384 //  This method assumes the help file is in the same directory as the
00385 //  Snap-in.  This is the recommended location for the help file.
00386 //
00387 HRESULT CComponentData::GetHelpTopic
00388 (
00389   LPOLESTR* ppszHelpFilePath   //[out] Path to Snapin's help file
00390 )
00391 {
00392   m_pszwHelpPath  = GetHelpFilePath();
00393   SIZE_T dwPathLen = wcslen( m_pszwHelpPath );
00394
00395   // Allocate the buffer to return, and copy our cached Path to it.
00396   *ppszHelpFilePath = (LPOLESTR)CoTaskMemAlloc( (dwPathLen+1) * sizeof(WCHAR) );
00397   wcscpy( *ppszHelpFilePath, m_pszwHelpPath );
00398
00399   TRACE_HRESULT( _T("GetHelpTopic"), S_OK );
00400   return S_OK;
00401
00402 }
00403
00404 /////////////////////////////////////////////////////////////////////////////
00405 //  Helper methods
00406
00407
00408 //---------------------------------------------------------------------------
00409 LPOLESTR CComponentData::GetHelpPath()
00410 {
00411   if( NULL == m_pszwHelpPath )         // Not initialized yet...
00412   {
00413     LPOLESTR pszBogus = NULL;          // so call GetHelpTopic() to
00414     GetHelpTopic( &pszBogus );         // cache the help file path
00415   }
00416
00417   return m_pszwHelpPath;
00418 }
00419
00420
00421 //---------------------------------------------------------------------------
00422 HRESULT CComponentData::GetInterface
00423 (
00424   DWORD     dwRequestedInterface,  //[in] Request flag
00425   LONG_PTR* ppInterface            //[in-out] Interface pointer to return
00426 )
00427 {
00428   _ASSERT( NULL != ppInterface );
00429   HRESULT hResult = S_OK;
00430
00431   switch( dwRequestedInterface )
00432   {
00433     case REQUEST_ICONSOLENAMESPACE2:
00434       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsoleNameSpace2);
00435       break;
00436
00437     case REQUEST_ICONSOLE:
00438       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsole);
00439       break;
00440
00441     default:
00442       hResult = S_FALSE;
00443       *ppInterface = NULL;
00444       break;
00445   }
00446
00447   return hResult;
00448 }
00449
00450
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIServiceProvider Member List

This is the complete list of members for CImpIServiceProvider, including all inherited members.
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIServiceProvider) | CImpIServiceProvider
QueryService(REFGUID guidService, REFIID riid, void **ppvObject) | CImpIServiceProvider
Generated on Wed Nov 13 2024 16:56:42 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/Start/Parent/vc/Parent.cpp Source File

  • NetDS
  • ADSI
  • samples
  • Start
  • Parent
  • vc

Parent.cpp

Go to the documentation of this file.
00001 // Parent.cpp : Defines the entry point for the console application.
00002 //
00003
00004 #include "stdafx.h"
00005 #include "activeds.h"
00006
00007
00008 int main(int argc, char* argv[])
00009 {
00010   HRESULT hr;
00011
00012   CoInitialize(NULL);
00013
00014   /////////////////////////////////////////
00015   //Bind to an object
00016   /////////////////////////////////////////
00017   IADs *pADs = NULL;
00018   hr = ADsGetObject(L"WinNT://INDEPENDENCE/JJohnson", IID_IADs, (void**) &pADs );
00019   if (!SUCCEEDED(hr) )
00020   {
00021     return hr;
00022   }
00023
00024   BSTR bstrParent;
00025   IADs *pParent=NULL;
00026
00027   //////////////////////////////
00028   // Get the ADs Parent's Path
00029   //////////////////////////////
00030   pADs->get_Parent(&bstrParent);
00031   pADs->Release();
00032
00033   ////////////////////////////////
00034   // Bind to the Parent
00035   ////////////////////////////////
00036   hr = ADsGetObject( bstrParent, IID_IADs, (void**) &pParent );
00037   SysFreeString(bstrParent);
00038
00039
00040   if (SUCCEEDED(hr) )
00041   {
00042     // do something with pParent...
00043     pParent->Release();
00044   }
00045
00046
00047   CoUninitialize();
00048   return 0;
00049 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/ClipBookServer/ClipBook ServerEx/DDxDDv.cpp Source File

  • WinBase
  • Cluster
  • Win2003
  • ClipBookServer
  • ClipBook ServerEx

DDxDDv.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Copyright (c) 2003 <company name>
00004 //
00005 //  Module Name:
00006 //      DDxDDv.cpp
00007 //
00008 //  Description:
00009 //      Implementation of custom dialog data exchange/dialog data validation
00010 //      routines.
00011 //
00012 //  Author:
00013 //      <name> (<e-mail name>) Mmmm DD, 2003
00014 //
00015 //  Revision History:
00016 //
00017 //  Notes:
00018 //      The IDS_REQUIRED_FIELD_EMPTY string resource must be defined in
00019 //      the resource file.
00020 //
00021 /////////////////////////////////////////////////////////////////////////////
00022
00023 #include "stdafx.h"
00024 #include "DDxDDv.h"
00025
00026 #include "resource.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00034
00035 /////////////////////////////////////////////////////////////////////////////
00036 //++
00037 //
00038 //  DDX_Number
00039 //
00040 //  Description:
00041 //      Do data exchange between the dialog and the class.
00042 //
00043 //  Arguments:
00044 //      pDXIn
00045 //          Data exchange object.
00046 //
00047 //      nIDCIn
00048 //          Control ID.
00049 //
00050 //      rdwValueInout
00051 //          Value to set or get.
00052 //
00053 //      dwMinIn
00054 //          Minimum value.
00055 //
00056 //      dwMaxIn
00057 //          Maximum value.
00058 //
00059 //      fSignedIn
00060 //          TRUE = value is signed, FALSE = value is unsigned
00061 //
00062 //  Return Value:
00063 //      None.
00064 //
00065 //--
00066 /////////////////////////////////////////////////////////////////////////////
00067 void AFXAPI
00068 DDX_Number(
00069       CDataExchange *   pDXIn
00070     , int               nIDCIn
00071     , DWORD &           rdwValueInout
00072     , DWORD             dwMinIn
00073     , DWORD             dwMaxIn
00074     , BOOL              fSignedIn /* =FALSE */
00075     )
00076 {
00077     HWND    hwndCtrl = NULL;
00078     DWORD   dwValue = 0;
00079     HRESULT hr = S_OK;
00080
00081     ASSERT( pDXIn != NULL );
00082 #ifdef _DEBUG
00083     if ( fSignedIn )
00084     {
00085         ASSERT( static_cast< LONG >( dwMinIn ) < static_cast< LONG >( dwMaxIn ) );
00086     }
00087     else
00088     {
00089         ASSERT( dwMinIn < dwMaxIn );
00090     }
00091 #endif // _DEBUG
00092
00093     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00094
00095     //
00096     //  Get the control window handle.
00097     //
00098
00099     hwndCtrl = pDXIn->PrepareEditCtrl( nIDCIn );
00100
00101     if ( pDXIn->m_bSaveAndValidate )
00102     {
00103         BOOL    bTranslated;
00104
00105         //
00106         //  Get the number from the control.
00107         //
00108
00109         dwValue = GetDlgItemInt( pDXIn->m_pDlgWnd->m_hWnd, nIDCIn, &bTranslated, fSignedIn );
00110
00111         //
00112         // If the retrival failed, it is a signed number, and the minimum
00113         // value is the smallest negative value possible, check the string itself.
00114         //
00115
00116         if ( ! bTranslated && fSignedIn && (dwMinIn == 0x80000000) )
00117         {
00118             UINT    cch = 0;
00119             TCHAR   szNumber[ 20 ];
00120
00121             //
00122             //  See if it is the smallest negative number.
00123             //
00124
00125             cch = GetDlgItemText( pDXIn->m_pDlgWnd->m_hWnd, nIDCIn, szNumber, RTL_NUMBER_OF( szNumber ) );
00126             if ( (cch != 0) && (_tcsnicmp( szNumber, _T("-2147483648"), RTL_NUMBER_OF( szNumber ) ) == 0) )
00127             {
00128                 dwValue = 0x80000000;
00129                 bTranslated = TRUE;
00130             } // if:  text retrieved successfully and is highest negative number
00131         } // if:  error translating number and getting signed number
00132
00133         //
00134         // If the retrieval failed or the specified number is
00135         // out of range, display an error.
00136         //
00137
00138         if (    ! bTranslated
00139             ||  (fSignedIn
00140                 && (    (static_cast< LONG >( dwValue ) < static_cast< LONG >( dwMinIn ))
00141                     ||  (static_cast< LONG >( dwValue ) > static_cast< LONG >( dwMaxIn ))
00142                     )
00143                 )
00144             ||  (!  fSignedIn
00145                 &&  (   (dwValue < dwMinIn)
00146                     ||  (dwValue > dwMaxIn)
00147                     )
00148                 )
00149             )
00150         {
00151             TCHAR   szMin[ 32 ];
00152             TCHAR   szMax[ 32 ];
00153             CString strPrompt;
00154
00155             if ( fSignedIn )
00156             {
00157                 hr = StringCchPrintf( szMin, RTL_NUMBER_OF( szMin ), _T("%d%"), dwMinIn );
00158                 ASSERT( SUCCEEDED( hr ) );
00159                 hr = StringCchPrintf( szMax, RTL_NUMBER_OF( szMax ), _T("%d%"), dwMaxIn );
00160                 ASSERT( SUCCEEDED( hr ) );
00161             } // if:  signed number
00162             else
00163             {
00164                 hr = StringCchPrintf( szMin, RTL_NUMBER_OF( szMin ), _T("%u%"), dwMinIn );
00165                 ASSERT( SUCCEEDED( hr ) );
00166                 hr = StringCchPrintf( szMax, RTL_NUMBER_OF( szMax ), _T("%u%"), dwMaxIn );
00167                 ASSERT( SUCCEEDED( hr ) );
00168             } // else:  unsigned number
00169             AfxFormatString2( strPrompt, AFX_IDP_PARSE_INT_RANGE, szMin, szMax );
00170             AfxMessageBox( strPrompt, MB_ICONEXCLAMATION, AFX_IDP_PARSE_INT_RANGE );
00171             strPrompt.Empty(); // exception prep
00172             pDXIn->Fail();
00173         } // if:  invalid string
00174         else
00175         {
00176             rdwValueInout = dwValue;
00177         } // if:  number is in range
00178     } // if:  saving data
00179     else
00180     {
00181         CString     strMinValue;
00182         CString     strMaxValue;
00183         UINT        cchMax;
00184
00185         //
00186         //  Set the maximum number of characters that can be entered.
00187         //
00188
00189         if ( fSignedIn )
00190         {
00191             strMinValue.Format( _T("%d"), dwMinIn );
00192             strMaxValue.Format( _T("%d"), dwMaxIn );
00193         } // if:  signed value
00194         else
00195         {
00196             strMinValue.Format( _T("%u"), dwMinIn );
00197             strMaxValue.Format( _T("%u"), dwMaxIn );
00198         } // else:  unsigned value
00199         cchMax = max( strMinValue.GetLength(), strMaxValue.GetLength() );
00200         SendMessage( hwndCtrl, EM_LIMITTEXT, cchMax, 0 );
00201
00202         //
00203         //  Set the value into the control.
00204         //
00205
00206         if ( fSignedIn )
00207         {
00208             LONG lValue = static_cast< LONG >( rdwValueInout );
00209             DDX_Text( pDXIn, nIDCIn, lValue );
00210         } // if:  signed value
00211         else
00212         {
00213             DDX_Text( pDXIn, nIDCIn, rdwValueInout );
00214         } // else:
00215     } // else:  setting data onto the dialog
00216
00217 } //*** DDX_Number
00218
00219 /////////////////////////////////////////////////////////////////////////////
00220 //++
00221 //
00222 //  DDV_RequiredText
00223 //
00224 //  Description:
00225 //      Validate that the dialog string is present.
00226 //
00227 //  Arguments:
00228 //      pDXIn
00229 //          Data exchange object.
00230 //
00231 //      nIDCIn
00232 //          Control ID.
00233 //
00234 //      nIDCLabelIn
00235 //          Label control ID.
00236 //
00237 //      rstrValueIn
00238 //          Value to set or get.
00239 //
00240 //  Return Value:
00241 //      None.
00242 //
00243 //--
00244 /////////////////////////////////////////////////////////////////////////////
00245 void AFXAPI
00246 DDV_RequiredText(
00247       CDataExchange *   pDXIn
00248     , int               nIDCIn
00249     , int               nIDCLabelIn
00250     , const CString &   rstrValueIn
00251     )
00252 {
00253     ASSERT( pDXIn != NULL );
00254
00255     AFX_MANAGE_STATE( AfxGetStaticModuleState() );
00256
00257     if ( pDXIn->m_bSaveAndValidate )
00258     {
00259         if ( rstrValueIn.GetLength() == 0 )
00260         {
00261             HWND        hwndLabel;
00262             TCHAR       szLabel[ 1024 ];
00263             CString     strPrompt;
00264
00265             // Get the label window handle
00266             hwndLabel = pDXIn->PrepareEditCtrl( nIDCLabelIn );
00267
00268             // Get the text of the label.
00269             GetWindowText( hwndLabel, szLabel, RTL_NUMBER_OF( szLabel ) );
00270
00271             // Remove ampersands (&) and colons (:).
00272             CleanupLabel( szLabel );
00273
00274             // Format and display a message.
00275             strPrompt.FormatMessage( IDS_REQUIRED_FIELD_EMPTY, szLabel );
00276             AfxMessageBox( strPrompt, MB_ICONEXCLAMATION );
00277
00278             // Do this so that the control receives focus.
00279             (void) pDXIn->PrepareEditCtrl( nIDCIn );
00280
00281             // Fail the call.
00282             strPrompt.Empty();  // exception prep
00283             pDXIn->Fail();
00284         } // if:  field not specified
00285     } // if:  saving data
00286
00287 } //*** DDV_RequiredText
00288
00289 /////////////////////////////////////////////////////////////////////////////
00290 //++
00291 //
00292 //  CleanupLabel
00293 //
00294 //  Description:
00295 //      Prepare a label read from a dialog to be used as a string in a
00296 //      message by removing ampersands (&) and colons (:).
00297 //
00298 //  Arguments:
00299 //      pwszLabelIn
00300 //          Label to be cleaned up.
00301 //
00302 //  Return Value:
00303 //      None.
00304 //
00305 //--
00306 /////////////////////////////////////////////////////////////////////////////
00307 void
00308 CleanupLabel( LPTSTR pwszLabelIn )
00309 {
00310     LPTSTR  pin = NULL;
00311     LPTSTR  pout = NULL;
00312     LANGID  langid;
00313     WORD    primarylangid;
00314     BOOL    fFELanguage;
00315
00316     //
00317     //  Get the language ID.
00318     //
00319
00320     langid = GetUserDefaultLangID();
00321     primarylangid = static_cast< WORD >( PRIMARYLANGID( langid ) );
00322     fFELanguage = ((primarylangid == LANG_JAPANESE)
00323                 || (primarylangid == LANG_CHINESE)
00324                 || (primarylangid == LANG_KOREAN) );
00325
00326     //
00327     // Copy the name sans '&' and ':' chars
00328     //
00329
00330     pin = pout = pwszLabelIn;
00331     do
00332     {
00333         //
00334         // Strip FE accelerators with parentheses. e.g. "foo(&F)" -> "foo"
00335         //
00336
00337         if (    fFELanguage
00338             &&  (pin[ 0 ] == _T('('))
00339             &&  (pin[ 1 ] == _T('&'))
00340             &&  (pin[ 2 ] != _T('\0'))
00341             &&  (pin[ 3 ] == _T(')')) )
00342         {
00343             pin += 3;
00344         } // if:  Far East language with accelerator
00345         else if ( (*pin != _T('&')) && (*pin != _T(':')) )
00346         {
00347             *pout++ = *pin;
00348         } // else if:  accelerator found
00349     } while ( *pin++ != _T('\0') );
00350
00351 } //*** CleanupLabel
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CViewList Member List

This is the complete list of members for CViewList, including all inherited members.
AddToList(CShellView *) | CViewList |
CViewList() | CViewList |
DeleteList(VOID) | CViewList | [private]
GetNextView(CShellView *) | CViewList |
m_pFirst | CViewList | [private]
m_pLast | CViewList | [private]
m_pMalloc | CViewList | [private]
RemoveFromList(CShellView *) | CViewList |
~CViewList() | CViewList |
Generated on Wed Nov 13 2024 16:57:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/basesnap.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

basesnap.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //
00014 //  Abstract: This module provides the basic COM and DLL methods to create
00015 //            and load the Snap-in.  IClassFactory::CreateInstance creates
00016 //            an instance of a class whose type is passed in the constructor
00017 //
00018
00019
00020 #ifndef _BASESNAP_H_
00021 #define _BASESNAP_H_
00022
00023 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppvObj);
00024 STDAPI DllCanUnloadNow(void);
00025
00026 //---------------------------------------------------------------------------
00027 class CClassFactory : public IClassFactory
00028 {
00029   public:
00030     enum FACTORY_TYPE {CONTEXTMENUX = 0};
00031
00032   public:
00033     CClassFactory(FACTORY_TYPE eFactoryType);
00034     ~CClassFactory();
00035
00036     STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv);
00037     STDMETHODIMP_(ULONG) AddRef();
00038     STDMETHODIMP_(ULONG) Release();
00039
00040     STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID*);
00041     STDMETHODIMP LockServer(BOOL);
00042
00043   private:
00044     ULONG         m_cRef;
00045     FACTORY_TYPE  m_FactoryType;
00046
00047 };
00048
00049 #endif _BASESNAP_H_
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/CmdLineConsumer/CmdLineConsumer.h Source File

  • SysMgmt
  • WMI
  • VC
  • CmdLineConsumer

CmdLineConsumer.h

Go to the documentation of this file.
00001 // **************************************************************************
00002
00003 // Copyright (c)  Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  CmdLineConsumer.h
00006 //
00007 // Description:
00008 //      main header file for the CMDLINECONSUMER application
00009 //
00010 // History:
00011 //
00012 // **************************************************************************
00013
00014 #if !defined(AFX_CMDLINECONSUMER_H__EF85AEB7_6B6C_11D1_ADAD_00AA00B8E05A__INCLUDED_)
00015 #define AFX_CMDLINECONSUMER_H__EF85AEB7_6B6C_11D1_ADAD_00AA00B8E05A__INCLUDED_
00016
00017 #if _MSC_VER >= 1000
00018 #pragma once
00019 #endif // _MSC_VER >= 1000
00020
00021 #ifndef __AFXWIN_H__
00022   #error include 'stdafx.h' before including this file for PCH
00023 #endif
00024
00025 #include "resource.h"   // main symbols
00026 #include "factory.h"
00027
00028 /////////////////////////////////////////////////////////////////////////////
00029 // CCmdLineConsumerApp:
00030 // See CmdLineConsumer.cpp for the implementation of this class
00031 //
00032
00033 class CCmdLineConsumerApp : public CWinApp
00034 {
00035 public:
00036   CCmdLineConsumerApp();
00037
00038 // Overrides
00039   // ClassWizard generated virtual function overrides
00040   //{{AFX_VIRTUAL(CCmdLineConsumerApp)
00041   public:
00042   virtual BOOL InitInstance();
00043   //}}AFX_VIRTUAL
00044
00045 // Implementation
00046
00047   //{{AFX_MSG(CCmdLineConsumerApp)
00048     // NOTE - the ClassWizard will add and remove member functions here.
00049     //    DO NOT EDIT what you see in these blocks of generated code !
00050   //}}AFX_MSG
00051   DECLARE_MESSAGE_MAP()
00052
00053   int ExitInstance();
00054
00055 private:
00056   DWORD m_clsReg;
00057   CProviderFactory *m_factory;
00058
00059   void RegisterServer(void);
00060   void UnregisterServer(void);
00061 };
00062
00063
00064 /////////////////////////////////////////////////////////////////////////////
00065
00066 //{{AFX_INSERT_LOCATION}}
00067 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00068
00069 #endif // !defined(AFX_CMDLINECONSUMER_H__EF85AEB7_6B6C_11D1_ADAD_00AA00B8E05A__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/cpp/store/Store.cpp Source File

  • Security
  • capicom
  • cpp
  • store

Store.cpp

Go to the documentation of this file.
00001 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002
00003
00004  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00005  EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00006  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00007
00008  Copyright (C) 1999 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010  Module:      Store.cpp
00011
00012  Abstract:    Main program of CAPICOM Store sample. See ReadMe.txt for more
00013               detail information about this sample.
00014
00015  Environment: Win32 console, UNICODE ready.
00016
00017 ------------------------------------------------------------------------------*/
00018
00019 #include <tchar.h>
00020 #include <stdio.h>
00021 #include <atlbase.h>
00022 #include <windows.h>
00023
00024 #pragma warning (disable : 4192)
00025
00026 //
00027 // Import TLB from DLL
00028 //
00029 // Note: Make sure either you have the DLL in the current directory, or point
00030 //       it to the correct directory on you drive.
00031 //
00032 #import "capicom.dll"
00033
00034 //
00035 // Use CAPICOM namespace.
00036 //
00037 using namespace CAPICOM;
00038
00039 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00040
00041   Module: main()
00042
00043   Remark: Entry point of CAPICOM Store C++ sample.
00044
00045 -----------------------------------------------------------------------------*/
00046
00047 int __cdecl _tmain (int argc, _TCHAR  * argv[])
00048 {
00049     HRESULT hr = S_OK;
00050
00051     //
00052     // Initialize COM library.
00053     //
00054     CoInitialize(0);
00055
00056     try
00057     {
00058         //
00059         // Open current user My store.
00060         //
00061         _bstr_t   bstrName = _T("My");
00062         IStorePtr pIStore(__uuidof(Store));
00063
00064         if (FAILED(hr = pIStore->Open(CAPICOM_CURRENT_USER_STORE,
00065                                       bstrName,
00066                                       CAPICOM_STORE_OPEN_READ_ONLY)))
00067         {
00068             ATLTRACE(_T("Error [%#x]: pIStore->Open() failed at line %d.\n"), hr, __LINE__);
00069             throw hr;
00070         }
00071
00072         //
00073         // Display all certificate in the store.
00074         //
00075         IUnknownPtr     pIUnknown;
00076         IEnumVARIANTPtr pIEnum;
00077         _variant_t      pDisp;
00078         ULONG           ulFetched;
00079
00080         //
00081         // Get _NewEnum of Certificates collection.
00082         //
00083         if (FAILED(hr = pIStore->Certificates->get__NewEnum(&pIUnknown)))
00084         {
00085             ATLTRACE(_T("Error [%#x]: pIStore->Certificates->get__NewEnum() failed at line %d.\n"), hr, __LINE__);
00086             throw hr;
00087         }
00088
00089         //
00090         // Get IEnumVARIANT interface of _NewEnum.
00091         //
00092         if (FAILED(hr = pIUnknown->QueryInterface(IID_IEnumVARIANT, (void **) &pIEnum)))
00093         {
00094             ATLTRACE(_T("Error [%#x]: pIUnknown->QueryInterface() failed at line %d.\n"), hr, __LINE__);
00095             throw hr;
00096         }
00097
00098         //
00099         // Now loop through all items in the collection.
00100         //
00101         while (pIEnum->Next(1, &pDisp, &ulFetched) == S_OK)
00102         {
00103             //
00104             // Display the certificate.
00105             //
00106             if (FAILED(hr = ((ICertificatePtr) pDisp.pdispVal)->Display()))
00107             {
00108                 ATLTRACE(_T("Error [%#x]: ((ICertificatePtr) pDisp.pdispVal)->Display() failed at line %d.\n"), hr, __LINE__);
00109                 throw hr;
00110             }
00111
00112             pDisp.Clear();
00113         }
00114     }
00115
00116     catch (_com_error e)
00117     {
00118         hr = e.Error();
00119         ATLTRACE(_T("Error [%#x]: %s.\n"), hr, e.ErrorMessage());
00120     }
00121
00122     catch (HRESULT hr)
00123     {
00124         ATLTRACE(_T("Error [%#x]: CAPICOM error.\n"), hr);
00125     }
00126
00127     catch(...)
00128     {
00129         hr = CAPICOM_E_UNKNOWN;
00130         ATLTRACE(_T("Unknown error.\n"));
00131     }
00132
00133     CoUninitialize();
00134
00135     return (int) hr;
00136 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/idl/comspyaudit.idl Source File

  • Com
  • Administration
  • Spy
  • idl

comspyaudit.idl

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 import "oaidl.idl";
00018 import "ocidl.idl";
00019
00020   [
00021
00022     uuid(AFCF0622-1429-11D1-B1B8-00AA00BA3258),
00023
00024     helpstring("IComSpyAudit Interface"),
00025     pointer_default(unique)
00026   ]
00027   interface IComSpyAudit : IUnknown
00028   {
00029
00030     //IComThreadEvents
00031     HRESULT OnThreadStart(
00032           [in] LONGLONG perfCount,
00033           [in] LPCOLESTR pszGuidApp,
00034           [in] LPCOLESTR pszThreadID,
00035           [in] LPCOLESTR pszW2KThreadID,
00036           [in] DWORD dwThreadCnt
00037         );
00038
00039     HRESULT OnThreadTerminate(
00040           [in] LONGLONG perfCount,
00041           [in] LPCOLESTR pszGuidApp,
00042           [in] LPCOLESTR pszThreadID,
00043           [in] LPCOLESTR pszW2KThreadID,
00044           [in] DWORD dwThreadCnt
00045         );
00046
00047       HRESULT OnThreadBindToApartment(
00048           [in] LONGLONG perfCount,
00049           [in] LPCOLESTR pszGuidApp,
00050           [in] LPCOLESTR pszThreadID,
00051           [in] LPCOLESTR pszAptID,
00052           [in] DWORD dwActivityCnt
00053         );
00054
00055     HRESULT OnThreadUnBind(
00056           [in] LONGLONG perfCount,
00057           [in] LPCOLESTR pszGuidApp,
00058           [in] LPCOLESTR pszThreadID,
00059           [in] LPCOLESTR pszAptID,
00060           [in] DWORD dwActivityCnt
00061         );
00062
00063     HRESULT OnThreadAssignApartment(
00064           [in] LONGLONG perfCount,
00065           [in] LPCOLESTR pszGuidApp,
00066           [in] LPCOLESTR pszGuidActivityID,
00067           [in] LPCOLESTR pszAptID
00068         );
00069     HRESULT OnThreadUnassignApartment(
00070           [in] LONGLONG perfCount,
00071           [in] LPCOLESTR pszGuidApp,
00072           [in] LPCOLESTR pszAptID
00073         );
00074
00075     HRESULT OnThreadWorkEnque(
00076           [in] LONGLONG perfCount,
00077           [in] LPCOLESTR pszGuidApp,
00078           [in] LPCOLESTR pszThreadID,
00079           [in] LPCOLESTR MsgWorkID,
00080           [in] DWORD dwQueueLen
00081         );
00082     HRESULT OnThreadWorkPrivate(
00083           [in] LONGLONG perfCount,
00084           [in] LPCOLESTR pszGuidApp,
00085           [in] LPCOLESTR pszThreadID,
00086           [in] LPCOLESTR MsgWorkID
00087         );
00088     HRESULT OnThreadWorkPublic(
00089           [in] LONGLONG perfCount,
00090           [in] LPCOLESTR pszGuidApp,
00091           [in] LPCOLESTR pszThreadID,
00092           [in] LPCOLESTR MsgWorkID,
00093           [in] DWORD dwQueueLen
00094         );
00095     HRESULT OnThreadWorkRedirect(
00096           [in] LONGLONG perfCount,
00097           [in] LPCOLESTR pszGuidApp,
00098           [in] LPCOLESTR pszThreadID,
00099           [in] LPCOLESTR MsgWorkID,
00100           [in] DWORD dwQueueLen,
00101           [in] LPCOLESTR pszThreadNum
00102         );
00103     HRESULT OnThreadWorkReject(
00104           [in] LONGLONG perfCount,
00105           [in] LPCOLESTR pszGuidApp,
00106           [in] LPCOLESTR pszThreadID,
00107           [in] LPCOLESTR MsgWorkID,
00108           [in] DWORD dwQueueLen
00109         );
00110
00111
00112     //IComAppEvents
00113     HRESULT OnAppActivation(
00114           [in] LONGLONG perfCount,
00115           [in] LPCOLESTR pszGuidApp
00116         );
00117
00118     HRESULT OnAppShutdown(
00119           [in] LONGLONG perfCount,
00120           [in] LPCOLESTR pszGuidApp
00121         );
00122
00123     //IComInstanceEvents
00124     HRESULT OnObjectCreate(
00125           [in] LONGLONG perfCount,
00126           [in] LPCOLESTR pszGuidApp,
00127           [in] LPCOLESTR pszGuidActivityID,
00128           [in] LPCOLESTR pszClassID,
00129           [in] LPCOLESTR pszTSID,
00130           [in] LPCOLESTR pszContextID,
00131           [in] LPCOLESTR pszObjectID
00132         );
00133
00134     HRESULT OnObjectDestroy(
00135           [in] LONGLONG perfCount,
00136           [in] LPCOLESTR pszGuidApp,
00137           [in] LPCOLESTR pszContextID
00138         );
00139
00140     //IComTransactionEvents
00141     HRESULT OnTransactionStart(
00142           [in] LONGLONG perfCount,
00143           [in] LPCOLESTR pszGuidApp,
00144           [in] LPCOLESTR pszGuidTxID,
00145           [in] LPCOLESTR pszGuidTSID,
00146           [in] BOOL bRoot
00147         );
00148
00149     HRESULT OnTransactionPrepared(
00150           [in] LONGLONG perfCount,
00151           [in] LPCOLESTR pszGuidApp,
00152           [in] LPCOLESTR pszGuidTxID,
00153           [in] BOOL bVoteYes
00154         );
00155
00156     HRESULT OnTransactionAborted(
00157           [in] LONGLONG perfCount,
00158           [in] LPCOLESTR pszGuidApp,
00159           [in] LPCOLESTR pszGuidTxID
00160         );
00161
00162     HRESULT OnTransactionCommit(
00163           [in] LONGLONG perfCount,
00164           [in] LPCOLESTR pszGuidApp,
00165           [in] LPCOLESTR pszGuidTxID
00166         );
00167
00168     //IComMethodEvents
00169     HRESULT OnMethodCall(
00170           [in] LONGLONG perfCount,
00171           [in] LPCOLESTR pszGuidApp,
00172           [in] LPCOLESTR pszObjectID,
00173           [in] LPCOLESTR pszGuidClassID,
00174           [in] LPCOLESTR pszGuidInterfaceID,
00175           [in] LPCOLESTR pszMethod
00176         );
00177
00178     HRESULT OnMethodReturn(
00179           [in] LONGLONG perfCount,
00180           [in] LPCOLESTR pszGuidApp,
00181           [in] LPCOLESTR pszObjectID,
00182           [in] LPCOLESTR pszGuidClassID,
00183           [in] LPCOLESTR pszGuidInterfaceID,
00184           [in] LPCOLESTR pszMethod,
00185           [in] HRESULT hr,
00186           [in] LPCOLESTR pszCallTime
00187         );
00188
00189     HRESULT OnMethodException(
00190           [in] LONGLONG perfCount,
00191           [in] LPCOLESTR pszGuidApp,
00192           [in] LPCOLESTR pszObjectID,
00193           [in] LPCOLESTR pszGuidClassID,
00194           [in] LPCOLESTR pszGuidInterfaceID,
00195           [in] LPCOLESTR pszMethod
00196         );
00197
00198     //IComObjectEvents
00199     HRESULT OnObjectActivate(
00200           [in] LONGLONG perfCount,
00201           [in] LPCOLESTR pszGuidApp,
00202           [in] LPCOLESTR pszContextID,
00203           [in] LPCOLESTR pszObjectID
00204         );
00205
00206     HRESULT OnObjectDeactivate(
00207           [in] LONGLONG perfCount,
00208           [in] LPCOLESTR pszGuidApp,
00209           [in] LPCOLESTR pszContextID,
00210           [in] LPCOLESTR pszObjectID
00211         );
00212
00213     HRESULT OnDisableCommit(
00214           [in] LONGLONG perfCount,
00215           [in] LPCOLESTR pszGuidApp,
00216           [in] LPCOLESTR pszContextID
00217         );
00218
00219     HRESULT OnEnableCommit(
00220           [in] LONGLONG perfCount,
00221           [in] LPCOLESTR pszGuidApp,
00222           [in] LPCOLESTR pszContextID
00223         );
00224
00225     HRESULT OnSetComplete(
00226           [in] LONGLONG perfCount,
00227           [in] LPCOLESTR pszGuidApp,
00228           [in] LPCOLESTR pszContextID
00229         );
00230     HRESULT OnSetAbort(
00231           [in] LONGLONG perfCount,
00232           [in] LPCOLESTR pszGuidApp,
00233           [in] LPCOLESTR pszContextID
00234         );
00235
00236
00237       //IComResourceEvents
00238      HRESULT OnResourceCreate(
00239           [in] LONGLONG perfCount,
00240           [in] LPCOLESTR pszGuidApp,
00241           [in] LPCOLESTR pszObjectID,
00242           [in] LPCOLESTR pszType,
00243           [in] LPCOLESTR pszResId,
00244           [in] BOOL bEnlisted
00245         );
00246
00247     HRESULT OnResourceAllocate(
00248           [in] LONGLONG perfCount,
00249           [in] LPCOLESTR pszGuidApp,
00250           [in] LPCOLESTR pszObjectID,
00251           [in] LPCOLESTR pszType,
00252           [in] LPCOLESTR pszResId,
00253           [in] BOOL bEnlisted,
00254           [in] LPCOLESTR pszNumRated,
00255           [in] LPCOLESTR pszRating
00256         );
00257
00258     HRESULT OnResourceRecycle(
00259           [in] LONGLONG perfCount,
00260           [in] LPCOLESTR pszGuidApp,
00261           [in] LPCOLESTR pszObjectID,
00262           [in] LPCOLESTR pszType,
00263           [in] LPCOLESTR pszResId
00264         );
00265
00266     HRESULT OnResourceDestroy(
00267           [in] LONGLONG perfCount,
00268           [in] LPCOLESTR pszGuidApp,
00269           [in] LPCOLESTR pszObjectID,
00270           [in] HRESULT hResult,
00271           [in] LPCOLESTR pszType,
00272           [in] LPCOLESTR pszResId
00273         );
00274     HRESULT OnResourceTrack(
00275           [in] LONGLONG perfCount,
00276           [in] LPCOLESTR pszGuidApp,
00277           [in] LPCOLESTR pszObjectID,
00278           [in] LPCOLESTR pszType,
00279           [in] LPCOLESTR pszResId,
00280           [in] BOOL bEnlisted
00281         );
00282
00283
00284     //SecurityEvents
00285     HRESULT OnAuthenticate(
00286            [in] LONGLONG perfCount,
00287            [in] LPCOLESTR pszGuidApp,
00288            [in] LPCOLESTR pszGuidActivity,
00289            [in] LPCOLESTR pszObjectID,
00290            [in] LPCOLESTR pszGuidIID,
00291            [in] LPCOLESTR pszMethod,
00292            [in] LPCOLESTR pszOriginalUser,
00293            [in] LPCOLESTR pszDirectUser,
00294            [in] BOOL bCurrentUserInpersonatingInProc
00295         );
00296
00297     HRESULT OnAuthenticateFail(
00298            [in] LONGLONG perfCount,
00299            [in] LPCOLESTR pszGuidApp,
00300            [in] LPCOLESTR pszGuidActivity,
00301            [in] LPCOLESTR pszObjectID,
00302            [in] LPCOLESTR pszGuidIID,
00303            [in] LPCOLESTR pszMethod,
00304            [in] LPCOLESTR pszOriginalUser,
00305            [in] LPCOLESTR pszDirectUser,
00306            [in] BOOL bCurrentUserInpersonatingInProc
00307         );
00308
00309         //IComObjectPoolEvents
00310     HRESULT OnObjPoolPutObject(
00311                  [in] LONGLONG perfCount,
00312            [in] LPCOLESTR pszGuidApp,
00313              [in] LPCOLESTR pszClassID,
00314            [in] int nReason,
00315            [in] DWORD dwAvailableObjs,
00316            [in] LPCOLESTR pszObjectID
00317         );
00318
00319     HRESULT OnObjPoolGetObject(
00320           [in] LONGLONG perfCount,
00321           [in] LPCOLESTR pszGuidApp,
00322           [in] LPCOLESTR pszGuidActivityID,
00323           [in] LPCOLESTR pszClassID,
00324           [in] DWORD dwAvailableObjs,
00325           [in] LPCOLESTR pszObjectID
00326         );
00327
00328     HRESULT OnObjPoolRecycleToTx(
00329           [in] LONGLONG perfCount,
00330           [in] LPCOLESTR pszGuidApp,
00331           [in] LPCOLESTR pszGuidActivityID,
00332           [in] LPCOLESTR pszClassID,
00333           [in] LPCOLESTR pszGuidTx,
00334           [in] LPCOLESTR pszObjectID
00335         );
00336
00337     HRESULT OnObjPoolGetFromTx(
00338           [in] LONGLONG perfCount,
00339           [in] LPCOLESTR pszGuidApp,
00340           [in] LPCOLESTR pszGuidActivityID,
00341           [in] LPCOLESTR pszClassID,
00342           [in] LPCOLESTR pszGuidTx,
00343           [in] LPCOLESTR pszObjectID
00344         );
00345
00346     //IComObjectPoolEvents2
00347     HRESULT OnObjPoolCreateObject(
00348           [in] LONGLONG perfCount,
00349           [in] LPCOLESTR pszGuidApp,
00350           [in] LPCOLESTR pszClassID,
00351           [in] DWORD dwAvailableObjs,
00352           [in] LPCOLESTR pszObjectID
00353         );
00354
00355     HRESULT OnObjPoolDestroyObject(
00356           [in] LONGLONG perfCount,
00357           [in] LPCOLESTR pszGuidApp,
00358           [in] LPCOLESTR pszClassID,
00359           [in] DWORD dwAvailableObjs,
00360           [in] LPCOLESTR pszObjectID
00361         );
00362
00363     HRESULT OnObjPoolCreateDecision(
00364           [in] LONGLONG perfCount,
00365           [in] LPCOLESTR pszGuidApp,
00366           [in] DWORD dwThreadsWaiting,
00367           [in] DWORD dwAvailableObjs,
00368           [in] DWORD dwCreatedObjs,
00369           [in] DWORD dwMin,
00370           [in] DWORD dwMax
00371         );
00372
00373     HRESULT OnObjPoolTimeout(
00374           [in] LONGLONG perfCount,
00375           [in] LPCOLESTR pszGuidApp,
00376           [in] LPCOLESTR pszClassID,
00377           [in] LPCOLESTR pszGuidActivityID,
00378           [in] DWORD dwTimeout);
00379
00380     HRESULT OnObjPoolCreatePool(
00381           [in] LONGLONG perfCount,
00382           [in] LPCOLESTR pszGuidApp,
00383           [in] LPCOLESTR pszClassID,
00384           [in] DWORD dwMin,
00385           [in] DWORD dwMax,
00386           [in] DWORD dwTimeout
00387         );
00388
00389     //IComObjectConstructionEvents
00390     HRESULT OnObjectConstruct(
00391           [in] LONGLONG perfCount,
00392           [in] LPCOLESTR pszGuidApp,
00393           [in] LPCOLESTR pszClassID,
00394           [in] LPCOLESTR pszConstructString,
00395           [in] LPCOLESTR pszObjectID
00396         );
00397
00398
00399     //IComActivityEvents
00400     HRESULT OnActivityCreate(
00401           [in] LONGLONG perfCount,
00402           [in] LPCOLESTR pszGuidApp,
00403           [in] LPCOLESTR pszGuidActivityID
00404         );
00405
00406     HRESULT OnActivityDestroy(
00407           [in] LONGLONG perfCount,
00408           [in] LPCOLESTR pszGuidApp,
00409           [in] LPCOLESTR pszGuidActivityID
00410         );
00411
00412     HRESULT OnActivityEnter(
00413           [in] LONGLONG perfCount,
00414           [in] LPCOLESTR pszGuidApp,
00415           [in] LPCOLESTR pszGuidCurrentApp,
00416           [in] LPCOLESTR pszGuidEnteredApp,
00417           [in] LPCOLESTR pszW2KThreadID
00418         );
00419
00420     HRESULT OnActivityTimeout(
00421           [in] LONGLONG perfCount,
00422           [in] LPCOLESTR pszGuidApp,
00423           [in] LPCOLESTR pszGuidCurrentApp,
00424           [in] LPCOLESTR pszGuidEnteredApp,
00425           [in] LPCOLESTR pszW2KThreadID,
00426           [in] DWORD dwTimeout
00427         );
00428
00429     HRESULT OnActivityReenter(
00430           [in] LONGLONG perfCount,
00431           [in] LPCOLESTR pszGuidApp,
00432           [in] LPCOLESTR pszGuidCurrentApp,
00433           [in] LPCOLESTR pszW2KThreadID,
00434           [in] DWORD dwCallDepth
00435         );
00436
00437     HRESULT OnActivityLeave(
00438           [in] LONGLONG perfCount,
00439           [in] LPCOLESTR pszGuidApp,
00440           [in] LPCOLESTR pszGuidCurrentApp,
00441           [in] LPCOLESTR pszGuidLeftApp
00442         );
00443
00444     HRESULT OnActivityLeaveSame(
00445           [in] LONGLONG perfCount,
00446           [in] LPCOLESTR pszGuidApp,
00447           [in] LPCOLESTR pszGuidCurrentApp,
00448           [in] DWORD dwCallDepth
00449         );
00450
00451     //IComIdentityEvents
00452     HRESULT OnIISRequestInfo(
00453           [in] LONGLONG perfCount,
00454           [in] LPCOLESTR pszGuidApp,
00455           [in] LPCOLESTR pszObjectID,
00456           [in] LPCOLESTR pszClientIP,
00457           [in] LPCOLESTR pszServerIP,
00458           [in] LPCOLESTR pszURL
00459         );
00460
00461     //IComQCEvents
00462     HRESULT OnQCRecord(
00463           [in] LONGLONG perfCount,
00464           [in] LPCOLESTR pszGuidApp,
00465           [in] LPCOLESTR pszObjectID,
00466           [in] LPCOLESTR pszQueueName,
00467           [in] LPCOLESTR pszGuidMsgID,
00468           [in] LPCOLESTR pszGuidWorkFlowID,
00469           [in] HRESULT hr
00470         );
00471     HRESULT OnQCQueueOpen(
00472           [in] LONGLONG perfCount,
00473           [in] LPCOLESTR pszGuidApp,
00474           [in] LPCOLESTR pszQueueName,
00475           [in] LPCOLESTR pszQueueID,
00476           [in] HRESULT hr
00477         );
00478     HRESULT OnQCReceive(
00479           [in] LONGLONG perfCount,
00480           [in] LPCOLESTR pszGuidApp,
00481           [in] LPCOLESTR pszQueueID,
00482           [in] LPCOLESTR pszGuidMsgID,
00483           [in] LPCOLESTR pszGuidWorkFlowID,
00484           [in] HRESULT hr
00485         );
00486     HRESULT OnQCReceiveFail(
00487           [in] LONGLONG perfCount,
00488           [in] LPCOLESTR pszGuidApp,
00489           [in] LPCOLESTR pszQueueID,
00490           [in] HRESULT hr
00491         );
00492     HRESULT OnQCMoveToReTryQueue(
00493           [in] LONGLONG perfCount,
00494           [in] LPCOLESTR pszGuidApp,
00495           [in] LPCOLESTR pszGuidMsgID,
00496           [in] LPCOLESTR pszGuidWorkFlowID,
00497           [in] ULONG RetryIndex
00498         );
00499     HRESULT OnQCMoveToDeadQueue(
00500           [in] LONGLONG perfCount,
00501           [in] LPCOLESTR pszGuidApp,
00502           [in] LPCOLESTR pszGuidMsgID,
00503           [in] LPCOLESTR pszGuidWorkFlowID
00504         );
00505     HRESULT OnQCPlayback(
00506           [in] LONGLONG perfCount,
00507           [in] LPCOLESTR pszGuidApp,
00508           [in] LPCOLESTR pszObjectID,
00509           [in] LPCOLESTR pszGuidMsgID,
00510           [in] LPCOLESTR pszGuidWorkFlowID,
00511           [in] HRESULT hr
00512         );
00513
00514     //IComExceptionEvents
00515     HRESULT OnExceptionUser(
00516           [in] LONGLONG perfCount,
00517           [in] LPCOLESTR pszGuidApp,
00518           [in] LPCOLESTR pszCode,
00519           [in] LPCOLESTR pszAddress,
00520           [in] LPCOLESTR pszStackTrace
00521         );
00522
00523     //IComCRMEvents
00524     HRESULT OnCRMRecoveryStart(
00525           [in] LONGLONG perfCount,
00526           [in] LPCOLESTR pszGuidApp
00527         );
00528
00529     HRESULT OnCRMRecoveryDone(
00530           [in] LONGLONG perfCount,
00531           [in] LPCOLESTR pszGuidApp
00532         );
00533
00534     HRESULT OnCRMCheckpoint(
00535           [in] LONGLONG perfCount,
00536           [in] LPCOLESTR pszGuidApp
00537         );
00538
00539     HRESULT OnCRMBegin(
00540           [in] LONGLONG perfCount,
00541           [in] LPCOLESTR pszGuidApp,
00542           [in] LPCOLESTR pszGuidClerkCLSID,
00543           [in] LPCOLESTR pszGuidActivityID,
00544           [in] LPCOLESTR pszGuidTxUOWID,
00545           [in] LPCOLESTR pszProgIdCompensator,
00546           [in] LPCOLESTR pszDescription
00547         );
00548
00549     HRESULT OnCRMPrepare(
00550           [in] LONGLONG perfCount,
00551           [in] LPCOLESTR pszGuidApp,
00552           [in] LPCOLESTR pszGuidClerkCLSID
00553         );
00554
00555     HRESULT OnCRMCommit(
00556           [in] LONGLONG perfCount,
00557           [in] LPCOLESTR pszGuidApp,
00558           [in] LPCOLESTR pszGuidClerkCLSID
00559         );
00560
00561     HRESULT OnCRMAbort(
00562           [in] LONGLONG perfCount,
00563           [in] LPCOLESTR pszGuidApp,
00564           [in] LPCOLESTR pszGuidClerkCLSID
00565         );
00566
00567     HRESULT OnCRMIndoubt(
00568           [in] LONGLONG perfCount,
00569           [in] LPCOLESTR pszGuidApp,
00570           [in] LPCOLESTR pszGuidClerkCLSID
00571         );
00572
00573     HRESULT OnCRMDone(
00574           [in] LONGLONG perfCount,
00575           [in] LPCOLESTR pszGuidApp,
00576           [in] LPCOLESTR pszGuidClerkCLSID
00577         );
00578
00579     HRESULT OnCRMRelease(
00580           [in] LONGLONG perfCount,
00581           [in] LPCOLESTR pszGuidApp,
00582           [in] LPCOLESTR pszGuidClerkCLSID
00583         );
00584
00585     HRESULT OnCRMAnalyze(
00586           [in] LONGLONG perfCount,
00587           [in] LPCOLESTR pszGuidApp,
00588           [in] LPCOLESTR pszGuidClerkCLSID,
00589           [in] LPCOLESTR pszCrmRecordType,
00590           [in] DWORD dwRecordSize
00591         );
00592
00593     HRESULT OnCRMWrite(
00594           [in] LONGLONG perfCount,
00595           [in] LPCOLESTR pszGuidApp,
00596           [in] LPCOLESTR pszGuidClerkCLSID,
00597           [in] BOOL bVariants,
00598           [in] DWORD dwRecordSize);
00599
00600     HRESULT OnCRMForget(
00601           [in] LONGLONG perfCount,
00602           [in] LPCOLESTR pszGuidApp,
00603           [in] LPCOLESTR pszGuidClerkCLSID
00604         );
00605
00606     HRESULT OnCRMForce(
00607           [in] LONGLONG perfCount,
00608           [in] LPCOLESTR pszGuidApp,
00609           [in] LPCOLESTR pszGuidClerkCLSID
00610         );
00611
00612     HRESULT OnCRMDeliver(
00613           [in] LONGLONG perfCount,
00614           [in] LPCOLESTR pszGuidApp,
00615           [in] LPCOLESTR pszGuidClerkCLSID,
00616           [in] BOOL bVariants,
00617           [in] DWORD dwRecordSize
00618         );
00619
00620     //ILBEvents
00621         HRESULT TargetUp(
00622         [in] LONGLONG perfCount,
00623         [in] LPCOLESTR pszServerName,
00624         [in] LPCOLESTR pszClsidEng
00625       );
00626
00627     HRESULT TargetDown(
00628         [in] LONGLONG perfCount,
00629         [in] LPCOLESTR pszServerName,
00630         [in] LPCOLESTR pszClsidEng
00631       );
00632
00633         HRESULT  EngineDefined(
00634         [in] LONGLONG perfCount,
00635         [in] LPCOLESTR pszPropName,
00636         [in] VARIANT *varPropValue,
00637         [in] LPCOLESTR pszClsidEng
00638       );
00639
00640
00641       ////
00642     HRESULT Init(LPCOLESTR sDSN, LPCOLESTR sUser, LPCOLESTR sPw);
00643   };
00644 [
00645   uuid(AFCF0615-1429-11D1-B1B8-00AA00BA3258),
00646   version(1.0),
00647   helpstring("ComSpyAudit 1.0 Type Library")
00648 ]
00649 library COMSPYAUDITLib
00650 {
00651   importlib("stdole32.tlb");
00652   importlib("stdole2.tlb");
00653
00654   [
00655     uuid(AFCF0623-1429-11D1-B1B8-00AA00BA3258),
00656     helpstring("ComSpyAudit Class")
00657   ]
00658   coclass ComSpyAudit
00659   {
00660     [default] interface IComSpyAudit;
00661   };
00662 };
Generated on Wed Nov 13 2024 16:51:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi2/TapiComm/TapiComm.c Source File

  • NetDS
  • Tapi
  • Tapi2
  • TapiComm

TapiComm.c

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright 1995 - 2000 Microsoft Corporation.  All Rights Reserved.
00007 //
00008 //  MODULE: TapiComm.c
00009 //
00010 //  PURPOSE: Handles general routines for the TapiComm sample.
00011 //
00012 //  FUNCTIONS:
00013 //    WndProc     - Processes messages for the main window.
00014 //    MsgCommand  - Handle the WM_COMMAND messages for the main window.
00015 //    MsgCreate   - Handle the WM_CREATE messages for the main window.
00016 //    MsgSize     - Handles the WM_SIZE message by calling SendMessage() to
00017 //                  pass the WM_SIZE message onto the status bar and tool bar
00018 //                  controls.
00019 //    MsgDestroy  - Handles the WM_DESTROY message by calling
00020 //                  PostQuitMessage().
00021 //    CmdExit     - Handles the file exit command by calling destroy
00022 //                  window on the main window.
00023 //
00024 //  COMMENTS:
00025 //    Message dispatch table -
00026 //      For every message to be handled by the main window procedure
00027 //      place the message number and handler function pointer in
00028 //      rgmsd (the message dispatch table).  Place the prototype
00029 //      for the function in globals.h and the definition of the
00030 //      function in the appropriate module.
00031 //    Command dispatch table -
00032 //      For every command to be handled by the main window procedure
00033 //      place the command number and handler function pointer in
00034 //      rgcmd (the command dispatch table).  Place the prototype
00035 //      for the function in globals.h and the definition of the
00036 //      function in the appropriate module.
00037 //    Globals.h Contains the definitions of the structures and dispatch.c
00038 //      contains the functions that use these structures.
00039 //
00040
00041
00042
00043 #include <windows.h>            // required for all Windows applications
00044 #include <windowsx.h>
00045 #include <commctrl.h>           // prototypes and defs for common controls
00046 #include "globals.h"            // prototypes specific to this application
00047 #include "statbar.h"            // prototypes specific to statbar.c
00048 #include "toolbar.h"            // prototypes specific to toolbar.c
00049 #include "EditCtls.h"
00050 #include "TapiCode.h"
00051 #include "resource.h"
00052
00053 LRESULT CmdCreateFile1(HWND hWnd, WORD wCommand, WORD wNotify, HWND hwndCtrl);
00054 LRESULT CmdCreateFile2(HWND hWnd, WORD wCommand, WORD wNotify, HWND hwndCtrl);
00055
00056
00057 // Main window message table definition.
00058 MSD rgmsd[] =
00059 {
00060     {WM_COMMAND,    MsgCommand   },
00061     {WM_MENUSELECT, MsgMenuSelect},
00062     {WM_SIZE,       MsgSize      },
00063     {WM_NOTIFY,     MsgNotify    },
00064     {WM_CLOSE,      MsgClose     },
00065     {WM_CREATE,     MsgCreate    },
00066     {WM_SETFOCUS,   MsgSetFocus  },
00067     //{WM_PAINT,      MsgPaint     },
00068     {WM_DESTROY,    MsgDestroy   }
00069 };
00070
00071 MSDI msdiMain =
00072 {
00073     sizeof(rgmsd) / sizeof(MSD),
00074     rgmsd,
00075     edwpWindow
00076 };
00077
00078
00079 // Main window command table definition.
00080 CMD rgcmd[] =
00081 {
00082     {IDM_MAKECALL,    CmdMakeCall},
00083     {IDM_HANGUPCALL,  CmdHangupCall},
00084     {IDM_EXIT,        CmdExit},
00085
00086     {IDM_EDITUNDO,    CmdStub},
00087     {IDM_EDITCUT,     CmdStub},
00088     {IDM_EDITCOPY,    CmdStub},
00089     {IDM_EDITPASTE,   CmdStub},
00090     {IDM_EDITCLEAR,   CmdStub},
00091
00092     {IDM_ABOUT,       CmdAbout},
00093 };
00094
00095 CMDI cmdiMain =
00096 {
00097     sizeof(rgcmd) / sizeof(CMD),
00098     rgcmd,
00099     edwpWindow
00100 };
00101
00102
00103 //
00104 //  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
00105 //
00106 //  PURPOSE:  Processes messages for the main window.
00107 //
00108 //  PARAMETERS:
00109 //    hwnd     - window handle
00110 //    uMessage - message number
00111 //    wparam   - additional information (dependant on message number)
00112 //    lparam   - additional information (dependant on message number)
00113 //
00114 //  RETURN VALUE:
00115 //    The return value depends on the message number.  If the message
00116 //    is implemented in the message dispatch table, the return value is
00117 //    the value returned by the message handling function.  Otherwise,
00118 //    the return value is the value returned by the default window procedure.
00119 //
00120 //  COMMENTS:
00121 //    Call the DispMessage() function with the main window's message dispatch
00122 //    information (msdiMain) and the message specific information.
00123 //
00124
00125 LRESULT CALLBACK WndProc(HWND   hwnd,
00126                          UINT   uMessage,
00127                          WPARAM wparam,
00128                          LPARAM lparam)
00129 {
00130     return DispMessage(&msdiMain, hwnd, uMessage, wparam, lparam);
00131 }
00132
00133
00134 //
00135 //  FUNCTION: MsgCommand(HWND, UINT, WPARAM, LPARAM)
00136 //
00137 //  PURPOSE: Handle the WM_COMMAND messages for the main window.
00138 //
00139 //  PARAMETERS:
00140 //    hwnd     - window handle
00141 //    uMessage - WM_COMMAND (Unused)
00142 //    GET_WM_COMMAND_ID(wparam, lparam)   - Command identifier
00143 //    GET_WM_COMMAND_HWND(wparam, lparam) - Control handle
00144 //
00145 //  RETURN VALUE:
00146 //    The return value depends on the message number.  If the message
00147 //    is implemented in the message dispatch table, the return value is
00148 //    the value returned by the message handling function.  Otherwise,
00149 //    the return value is the value returned by the default window procedure.
00150 //
00151 //  COMMENTS:
00152 //    Call the DispCommand() function with the main window's command dispatch
00153 //    information (cmdiMain) and the command specific information.
00154 //
00155
00156 LRESULT MsgCommand(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00157 {
00158     return DispCommand(&cmdiMain, hwnd, wparam, lparam);
00159 }
00160
00161
00162 //
00163 //  FUNCTION: MsgCreate(HWND, UINT, WPARAM, LPARAM)
00164 //
00165 //  PURPOSE: Handle the WM_CREATE messages for the main window.
00166 //           and call InitCommonControls() API to initialize the
00167 //           common control library.
00168 //
00169 //  PARAMETERS:
00170 //    hwnd     - window handle
00171 //
00172 //  RETURN VALUE:
00173 //    Return 0 if the StatusBar and ToolBar Windows could be created
00174 //    successfully. Otherwise, returns -1 to abort the main window
00175 //    creation.
00176 //
00177 //  COMMENTS:
00178 //    Call the CreateTSBars function with the main window's window handle
00179 //    information (msdiMain).
00180 //
00181 //    Must also initialize TAPI.
00182 //
00183
00184 LRESULT MsgCreate(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00185 {
00186     InitCommonControls() ; // Initialize the common control library.
00187
00188     if (InitEditCtls(hwnd) == FALSE)
00189         return -1;
00190
00191     InitializeTAPI(hwnd);
00192
00193     if(!(CreateTBar(hwnd) && CreateSBar(hwnd)))
00194         return -1;   // Tool and status bars were not created, so return -1.
00195
00196     UpdateStatusBar("Ready to make a call.",1,0);
00197
00198     EnableMakeCall(hwnd, TRUE);
00199     EnableHangupCall(hwnd, FALSE);
00200     return 0;
00201 }
00202
00203
00204 //
00205 //  FUNCTION: MsgSize(HWND, UINT, WPARAM, LPARAM)
00206 //
00207 //  PURPOSE:  This function resizes the toolbar and statusbar controls.
00208 //
00209 //
00210 //  PARAMETERS:
00211 //
00212 //    hwnd      - Window handle  (Used)
00213 //    uMessage  - Message number (Used)
00214 //    wparam    - Extra data     (Used)
00215 //    lparam    - Extra data     (Used)
00216 //
00217 //  RETURN VALUE:
00218 //
00219 //    Always returns 0 - Message handled
00220 //
00221 //  COMMENTS:
00222 //
00223 //    When the window procdure that has the status and tool bar controls
00224 //    receive the WM_SIZE message, it has to pass the message on to these
00225 //    controls so that these controls can adjust their size accordingly.
00226 //
00227 //    It also has to resize the edit controls that are the UI for TAPI.
00228 //
00229 //
00230
00231 LRESULT MsgSize(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00232 {
00233     SendMessage(hWndStatusbar,  uMessage, wparam, lparam);
00234     SendMessage(hWndToolbar, uMessage, wparam, lparam);
00235
00236     // Re-position the panes in the status bar
00237     InitializeStatusBar(hwnd);
00238
00239     SizeEditCtls();
00240
00241     return 0 ;
00242 }
00243
00244
00245 //
00246 //  FUNCTION: MsgSetFocus(HWND, UINT, WPARAM, LPARAM)
00247 //
00248 //  PURPOSE:  This function puts the focus where is should be.
00249 //
00250 //
00251 //  PARAMETERS:
00252 //
00253 //    hwnd      - Window handle  (Used)
00254 //    uMessage  - Identifies window that lost focus (Used)
00255 //    wparam    - Extra data     (Used)
00256 //    lparam    - Extra data     (Used)
00257 //
00258 //  RETURN VALUE:
00259 //
00260 //    Always returns 0 - Message handled
00261 //
00262 //  COMMENTS:
00263 //
00264 //    Just signal the edit controls to set the focus where it belongs.
00265 //
00266 //
00267
00268 LRESULT MsgSetFocus(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00269 {
00270     SetFocusEditCtls();
00271
00272     return 0 ;
00273 }
00274
00275
00276 //
00277 //  FUNCTION: MsgDestroy(HWND, UINT, WPARAM, LPARAM)
00278 //
00279 //  PURPOSE: Calls PostQuitMessage().
00280 //
00281 //  PARAMETERS:
00282 //
00283 //    hwnd      - Window handle  (Unused)
00284 //    uMessage  - Message number (Unused)
00285 //    wparam    - Extra data     (Unused)
00286 //    lparam    - Extra data     (Unused)
00287 //
00288 //  RETURN VALUE:
00289 //
00290 //    Always returns 0 - Message handled
00291 //
00292 //  COMMENTS:
00293 //
00294 //
00295
00296 LRESULT MsgDestroy(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00297 {
00298     PostQuitMessage(0);
00299     return 0;
00300 }
00301
00302
00303 //
00304 //  FUNCTION: MsgClose(HWND, UINT, WPARAM, LPARAM)
00305 //
00306 //  PURPOSE: Exits the application.
00307 //
00308 //  PARAMETERS:
00309 //
00310 //    hwnd      - The window.
00311 //    uMessage  - Message number (Unused)
00312 //    wparam    - Extra data     (Unused)
00313 //    lparam    - Extra data     (Unused)
00314 //
00315 //  RETURN VALUE:
00316 //
00317 //    Always returns 0 - Message handled
00318 //
00319 //  COMMENTS:
00320 //
00321 //    Make sure TAPI is stopped before exiting.
00322 //
00323 //
00324
00325 LRESULT MsgClose(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00326 {
00327     ShutdownTAPI();
00328
00329     DestroyWindow(hwnd);
00330     return 0;
00331 }
00332
00333
00334 //
00335 //  FUNCTION: MsgPaint(HWND, UINT, WPARAM, LPARAM)
00336 //
00337 //  PURPOSE: Paints the client area of the window.
00338 //
00339 //  PARAMETERS:
00340 //
00341 //    hwnd      - The window.
00342 //    uMessage  - Message number (Unused)
00343 //    wparam    - Extra data     (Unused)
00344 //    lparam    - Extra data     (Unused)
00345 //
00346 //  RETURN VALUE:
00347 //
00348 //    Always returns 0 - Message handled
00349 //
00350 //  COMMENTS:
00351 //
00352 //    Not sure what needs to be painted, maybe text
00353 //    labeling the edit controls?
00354 //
00355 //
00356
00357 LRESULT MsgPaint(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
00358 {
00359     HDC hdc;
00360     PAINTSTRUCT ps;
00361
00362     hdc = BeginPaint(hwnd, &ps);
00363
00364     EndPaint(hwnd, &ps);
00365     return 0;
00366 }
00367
00368
00369 //
00370 //  FUNCTION: CmdExit(HWND, WORD, WORD, HWND)
00371 //
00372 //  PURPOSE: Exit the application.
00373 //
00374 //  PARAMETERS:
00375 //    hwnd     - The window.
00376 //    wCommand - IDM_EXIT (unused)
00377 //    wNotify  - Notification number (unused)
00378 //    hwndCtrl - NULL (unused)
00379 //
00380 //  RETURN VALUE:
00381 //    Always returns 0 - command handled.
00382 //
00383 //  COMMENTS:
00384 //
00385 //    Make sure TAPI is stopped before exiting.
00386 //
00387 //
00388
00389 LRESULT CmdExit(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00390 {
00391     char szBuffer[50];
00392     int  cbWritten = 0;
00393
00394     ShutdownTAPI();
00395
00396     cbWritten = LoadString(hInst, wCommand, szBuffer, sizeof(szBuffer));
00397     if(cbWritten == 0)
00398         strncpy(szBuffer, "Unknown Command", 49);
00399   szBuffer[49] = '\0';
00400
00401     UpdateStatusBar(szBuffer, 0, 0);
00402
00403     DestroyWindow(hwnd);
00404     return 0;
00405 }
00406
00407
00408 //
00409 //  FUNCTION: CmdHangupCall(HWND, WORD, WORD, HWND)
00410 //
00411 //  PURPOSE: Stops TAPI
00412 //
00413 //  PARAMETERS:
00414 //    hwnd     - The window.
00415 //    wCommand - IDM_HANGUPCALL (unused)
00416 //    wNotify  - Notification number (unused)
00417 //    hwndCtrl - NULL (unused)
00418 //
00419 //  RETURN VALUE:
00420 //    Always returns 0 - command handled.
00421 //
00422 //  COMMENTS:
00423 //
00424 //    Tells TAPI to close any opened lines.
00425 //
00426 //
00427
00428
00429 LRESULT CmdHangupCall(HWND hWnd, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00430 {
00431     HangupCall();
00432     return 0;
00433 }
00434
00435
00436 //
00437 //  FUNCTION: CmdMakeCall(HWND, WORD, WORD, HWND)
00438 //
00439 //  PURPOSE: Starts TAPI
00440 //
00441 //  PARAMETERS:
00442 //    hwnd     - The window.
00443 //    wCommand - IDM_MAKECALL (unused)
00444 //    wNotify  - Notification number (unused)
00445 //    hwndCtrl - NULL (unused)
00446 //
00447 //  RETURN VALUE:
00448 //    Always returns 0 - command handled.
00449 //
00450 //  COMMENTS:
00451 //
00452 //    Starts TAPI by calling the Dialing Dialog box.
00453 //    Code for this dialog is with the rest of the TAPI code.
00454 //
00455 //
00456
00457 LRESULT CmdMakeCall(HWND hWnd, WORD wCommand, WORD wNotify, HWND hwndCtrl)
00458 {
00459     DialCall();
00460     return 0;
00461 }
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Ppgeext/extend.h Source File

  • SysMgmt
  • MMC
  • Ppgeext

extend.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _EXTEND_H
00021 #define _EXTEND_H
00022
00023 struct EXTENSION_NODE
00024 {
00025     GUID  GUID;
00026     _TCHAR  szDescription[256];
00027 };
00028
00029 enum EXTENSION_TYPE
00030 {
00031     NameSpaceExtension,
00032         ContextMenuExtension,
00033         ToolBarExtension,
00034         PropertySheetExtension,
00035         TaskExtension,
00036         DynamicExtension,
00037         DummyExtension
00038 };
00039
00040 struct EXTENDER_NODE
00041 {
00042     EXTENSION_TYPE  eType;
00043     GUID      guidNode;
00044     GUID      guidExtension;
00045     _TCHAR      szDescription[256];
00046 };
00047
00048 #endif // _EXTEND_H
00049
00050
Generated on Wed Nov 13 2024 16:52:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/comp.Cpp Source File

  • SysMgmt
  • MMC
  • Toolbar

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 #define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
00029
00030 CComponent::CComponent(CComponentData *parent)
00031 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL)
00032 {
00033     OBJECT_CREATED
00034
00035         m_ipDisplayHelp = NULL;
00036     m_ipControlBar  = NULL;
00037     m_ipToolbar     = NULL;
00038 }
00039
00040 CComponent::~CComponent()
00041 {
00042     OBJECT_DESTROYED
00043 }
00044
00045 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00046 {
00047     if (!ppv)
00048         return E_FAIL;
00049
00050     *ppv = NULL;
00051
00052     if (IsEqualIID(riid, IID_IUnknown))
00053         *ppv = static_cast<IComponent *>(this);
00054     else if (IsEqualIID(riid, IID_IComponent))
00055         *ppv = static_cast<IComponent *>(this);
00056     else if (IsEqualIID(riid, IID_IExtendControlbar))
00057         *ppv = static_cast<IExtendControlbar *>(this);
00058
00059     if (*ppv)
00060     {
00061         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00062         return S_OK;
00063     }
00064
00065     return E_NOINTERFACE;
00066 }
00067
00068 STDMETHODIMP_(ULONG) CComponent::AddRef()
00069 {
00070     return InterlockedIncrement((LONG *)&m_cref);
00071 }
00072
00073 STDMETHODIMP_(ULONG) CComponent::Release()
00074 {
00075     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00076     {
00077         delete this;
00078         return 0;
00079     }
00080     return m_cref;
00081
00082 }
00083
00084 ///////////////////////////////
00085 // Interface IComponent
00086 ///////////////////////////////
00087 STDMETHODIMP CComponent::Initialize(
00088                                     /* [in] */ LPCONSOLE lpConsole)
00089 {
00090     HRESULT hr = S_OK;
00091
00092     // Save away all the interfaces we'll need.
00093     // Fail if we can't QI the required interfaces.
00094
00095     m_ipConsole = lpConsole;
00096     m_ipConsole->AddRef();
00097
00098     hr = m_ipConsole->QueryInterface(IID_IDisplayHelp, (void **)&m_ipDisplayHelp);
00099
00100     return hr;
00101 }
00102
00103 STDMETHODIMP CComponent::Notify(
00104                                 /* [in] */ LPDATAOBJECT lpDataObject,
00105                                 /* [in] */ MMC_NOTIFY_TYPE event,
00106                                 /* [in] */ LPARAM arg,
00107                                 /* [in] */ LPARAM param)
00108 {
00109     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00110
00111     HRESULT hr = S_FALSE;
00112
00113   //Get our data object. If it is NULL, we return with S_FALSE.
00114   //See implementation of GetOurDataObject() to see how to
00115   //handle special data objects.
00116   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00117   if (NULL == pDataObject)
00118     return S_FALSE;
00119
00120   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00121
00122     switch (event)      {
00123     case MMCN_ADD_IMAGES:
00124         hr = base->OnAddImages((IImageList *)arg, (HSCOPEITEM)param);
00125         break;
00126
00127     case MMCN_SELECT:
00128         // We do not set any standard verbs now.
00129         break;
00130
00131     case MMCN_SHOW:
00132         hr = base->OnShow(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00133         break;
00134
00135     case MMCN_CONTEXTHELP:
00136         hr = base->OnShowContextHelp(m_ipDisplayHelp, m_pComponentData->m_HelpFile);
00137         break;
00138     }
00139
00140     return hr;
00141 }
00142
00143 STDMETHODIMP CComponent::Destroy(
00144                                  /* [in] */ MMC_COOKIE cookie)
00145 {
00146     if (m_ipConsole) {
00147         m_ipConsole->Release();
00148         m_ipConsole = NULL;
00149     }
00150
00151     if (m_ipDisplayHelp) {
00152         m_ipDisplayHelp->Release();
00153         m_ipDisplayHelp = NULL;
00154     }
00155
00156     if (m_ipToolbar) {
00157         m_ipToolbar->Release();
00158         m_ipToolbar = NULL;
00159     }
00160
00161     if (m_ipControlBar) {
00162         m_ipControlBar->Release();
00163         m_ipControlBar = NULL;
00164     }
00165
00166     return S_OK;
00167 }
00168
00169
00170 STDMETHODIMP CComponent::QueryDataObject(
00171                                          /* [in] */ MMC_COOKIE cookie,
00172                                          /* [in] */ DATA_OBJECT_TYPES type,
00173                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00174 {
00175     CDataObject *pObj = NULL;
00176
00177     if (cookie == 0)
00178         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00179     else
00180         pObj = new CDataObject(cookie, type);
00181
00182     if (!pObj)
00183         return E_OUTOFMEMORY;
00184
00185     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00186
00187     return S_OK;
00188 }
00189
00190 STDMETHODIMP CComponent::GetResultViewType(
00191                                            /* [in] */ MMC_COOKIE cookie,
00192                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00193                                            /* [out] */ long __RPC_FAR *pViewOptions)
00194 {
00195     CDelegationBase *base = (CDelegationBase *)cookie;
00196
00197     //
00198     // Ask for default listview.
00199     //
00200     if (base == NULL)
00201     {
00202         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00203         *ppViewType = NULL;
00204     }
00205     else
00206         return base->GetResultViewType(ppViewType, pViewOptions);
00207
00208     return S_OK;
00209 }
00210
00211 STDMETHODIMP CComponent::GetDisplayInfo(
00212                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00213 {
00214     HRESULT hr = S_OK;
00215     CDelegationBase *base = NULL;
00216
00217     // if they are asking for the RDI_STR we have one of those to give
00218
00219     if (pResultDataItem->lParam) {
00220         base = (CDelegationBase *)pResultDataItem->lParam;
00221         if (pResultDataItem->mask & RDI_STR) {
00222                         LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00223                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00224             pResultDataItem->str = pszW;
00225         }
00226
00227         if (pResultDataItem->mask & RDI_IMAGE) {
00228             pResultDataItem->nImage = base->GetBitmapIndex();
00229         }
00230     }
00231
00232     return hr;
00233 }
00234
00235
00236 STDMETHODIMP CComponent::CompareObjects(
00237                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00238                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00239 {
00240     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00241     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00242
00243     // compare the object pointers
00244     if (baseA->GetCookie() == baseB->GetCookie())
00245         return S_OK;
00246
00247     return S_FALSE;
00248 }
00249
00250 ///////////////////////////////
00251 // Interface IExtendControlBar
00252 ///////////////////////////////
00253 static MMCBUTTON SnapinButtons1[] =
00254 {
00255     { 0, ID_BUTTONSTART, TBSTATE_ENABLED, TBSTYLE_GROUP, L"Start Vehicle", L"Start Vehicle" },
00256     { 1, ID_BUTTONPAUSE, TBSTATE_ENABLED, TBSTYLE_GROUP, L"Pause Vehicle", L"Pause Vehicle"},
00257     { 2, ID_BUTTONSTOP,  TBSTATE_ENABLED, TBSTYLE_GROUP, L"Stop Vehicle",  L"Stop Vehicle" },
00258 };
00259
00260 HRESULT CComponent::SetControlbar(
00261                                   /* [in] */ LPCONTROLBAR pControlbar)
00262 {
00263     HRESULT hr = S_OK;
00264
00265     //
00266     //  Clean up
00267     //
00268
00269     // if we've got a cached toolbar, release it
00270     if (m_ipToolbar) {
00271         m_ipToolbar->Release();
00272         m_ipToolbar = NULL;
00273     }
00274
00275     // if we've got a cached control bar, release it
00276     if (m_ipControlBar) {
00277         m_ipControlBar->Release();
00278         m_ipControlBar = NULL;
00279     }
00280
00281
00282     //
00283     // Install new pieces if necessary
00284     //
00285
00286     // if a new one came in, cache and AddRef
00287     if (pControlbar) {
00288         m_ipControlBar = pControlbar;
00289         m_ipControlBar->AddRef();
00290
00291         hr = m_ipControlBar->Create(TOOLBAR,  // type of control to be created
00292             dynamic_cast<IExtendControlbar *>(this),
00293             reinterpret_cast<IUnknown **>(&m_ipToolbar));
00294         _ASSERT(SUCCEEDED(hr));
00295
00296         // The IControlbar::Create AddRefs the toolbar object it created
00297         // so no need to do any addref on the interface.
00298
00299         // add the bitmap to the toolbar
00300         HBITMAP hbmp = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_TOOLBAR1));
00301         hr = m_ipToolbar->AddBitmap(3, hbmp, 16, 16, RGB(0, 128, 128)); // NOTE, hardcoded value 3
00302         _ASSERT(SUCCEEDED(hr));
00303
00304         // Add the buttons to the toolbar
00305         hr = m_ipToolbar->AddButtons(ARRAYLEN(SnapinButtons1), SnapinButtons1);
00306         _ASSERT(SUCCEEDED(hr));
00307     }
00308
00309     return hr;
00310 }
00311
00312 HRESULT CComponent::ControlbarNotify(
00313                                      /* [in] */ MMC_NOTIFY_TYPE event,
00314                                      /* [in] */ LPARAM arg,
00315                                      /* [in] */ LPARAM param)
00316 {
00317     HRESULT hr = S_OK;
00318
00319     if (event == MMCN_SELECT) {
00320         BOOL bScope = (BOOL) LOWORD(arg);
00321         BOOL bSelect = (BOOL) HIWORD(arg);
00322
00323         CDelegationBase *base = GetOurDataObject(reinterpret_cast<IDataObject *>(param))->GetBaseNodeObject();
00324         hr = base->OnSetToolbar(this, m_ipControlBar, m_ipToolbar, bScope, bSelect);
00325     } else if (event == MMCN_BTN_CLICK) {
00326         CDelegationBase *base = GetOurDataObject(reinterpret_cast<IDataObject *>(arg))->GetBaseNodeObject();
00327         hr = base->OnToolbarCommand(this, m_ipConsole, (MMC_CONSOLE_VERB)param);
00328     }
00329
00330     return hr;
00331 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/compdata.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

compdata.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #include "Globals.h"
00015 #include "Comp.h"
00016 #include "CompData.h"
00017 #include "DataObj.h"
00018 #include "Resource.h"
00019
00020                              // Tracing stuff
00021 #include "TraceMacro.h"
00022 #undef  MODULESTRING
00023 #define MODULESTRING  _T("CComponentData")
00024
00025
00026 /////////////////////////////////////////////////////////////////////////////
00027 // Construction/Destruction
00028
00029
00030 //---------------------------------------------------------------------------
00031 //  This constructor is called when the Snap-in is selected from the
00032 //  Add/Remove dialog.  Build our static node and load the required
00033 //  clipformats before MMC calls us.
00034 //
00035 CComponentData::CComponentData()
00036 {
00037   // Do not assume only one instance of IComponentData implementation is created.
00038
00039
00040     m_cRef                = 0;
00041     m_ipConsoleNameSpace2 = NULL;
00042     m_ipConsole           = NULL;
00043     m_ipScopeImage        = NULL;
00044     m_hImageStrip16       = NULL;
00045     m_hImageStrip32       = NULL;
00046
00047     // Increment this so DllCanUnloadNow works correctly
00048     InterlockedIncrement((long*)&g_uObjectCount);
00049
00050     NODE_PROPERTIES NodeProps;
00051     ZeroMemory( &NodeProps, sizeof(NODE_PROPERTIES) );
00052     wcscpy( NodeProps.szNodeName, gwszROOT_NODE_NAME );
00053
00054     NodeProps.pParentObject  = NULL;
00055     NodeProps.pComponentData = reinterpret_cast<LONG_PTR>(this);
00056
00057     m_pStaticNode = new CStaticNode;
00058     m_pStaticNode->Initialize( &NodeProps );
00059
00060     InitClipboardFormats();
00061 }
00062
00063 //---------------------------------------------------------------------------
00064 CComponentData::~CComponentData()
00065 {
00066   if( NULL != m_pStaticNode )
00067   {
00068     delete m_pStaticNode;
00069     m_pStaticNode = NULL;
00070   }
00071
00072   // All done, decrement object count so the dll can be unloaded
00073   InterlockedDecrement((long*)&g_uObjectCount);
00074 }
00075
00076
00077 /////////////////////////////////////////////////////////////////////////////
00078 // IUnknown implementation
00079
00080 //---------------------------------------------------------------------------
00081 //  CONTEXTMENU:  Must add support for IExtendContextMenu here
00082 //
00083 STDMETHODIMP CComponentData::QueryInterface
00084 (
00085   REFIID   riid,       //[in] Identifier of the requested interface
00086   LPVOID   *ppv        //[out] Address of requested interface
00087 )
00088 {
00089   if( !ppv )
00090     return E_FAIL;
00091
00092   *ppv = NULL;
00093
00094   if( IsEqualIID(riid, IID_IUnknown) )
00095     *ppv = static_cast<IComponentData*>(this);
00096   else if( IsEqualIID(riid, IID_IComponentData) )
00097     *ppv = static_cast<IComponentData*>(this);
00098   else if( IsEqualIID(riid, IID_IComponentData2) )
00099     *ppv = static_cast<IComponentData2*>(this);
00100   else if( IsEqualIID(riid, IID_IExtendContextMenu) )
00101     *ppv = static_cast<IExtendContextMenu *>(this);
00102
00103
00104   if( *ppv )
00105   {
00106     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00107     return S_OK;
00108   }
00109
00110   return E_NOINTERFACE;
00111 }
00112
00113 //---------------------------------------------------------------------------
00114 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00115 {
00116   return InterlockedIncrement((LONG*)&m_cRef);
00117 }
00118
00119 //---------------------------------------------------------------------------
00120 STDMETHODIMP_(ULONG) CComponentData::Release()
00121 {
00122   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00123   {
00124     delete this;
00125     return 0;
00126   }
00127
00128   return m_cRef;
00129 }
00130
00131 /////////////////////////////////////////////////////////////////////////////
00132 // Interface IComponentData
00133
00134 //---------------------------------------------------------------------------
00135 //  Called when the user selects the Snap-in from the scope pane.
00136 //  This is where we QI and cache interfaces we will use later.  These
00137 //  interfaces are for future use since they are not used in this sample
00138 //
00139 HRESULT CComponentData::Initialize
00140 (
00141   LPUNKNOWN pUnknown         //[in] Pointer to the console's IUnknown
00142 )
00143 {
00144   HRESULT hResult = S_FALSE;
00145                              // Fail to initialize if we can't get the
00146   do                         // interfaces we need to cache
00147   {
00148     hResult = pUnknown->QueryInterface(IID_IConsoleNameSpace2, (void**)&m_ipConsoleNameSpace2);
00149     BREAK_ON_ERROR( hResult );
00150
00151     hResult = pUnknown->QueryInterface(IID_IConsole3, (void**)&m_ipConsole);
00152     BREAK_ON_ERROR( hResult );
00153
00154     // Add the images for the scope tree
00155     hResult = m_ipConsole->QueryScopeImageList(&m_ipScopeImage);
00156     BREAK_ON_ERROR( hResult );
00157
00158     // Load the bitmaps from the dll
00159     m_hImageStrip16 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_16) );
00160     if( NULL == m_hImageStrip16 )
00161     {
00162       hResult = S_FALSE;
00163       continue;
00164     }
00165
00166     m_hImageStrip32 = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_NODEIMAGES_32) );
00167      if( NULL == m_hImageStrip32)
00168     {
00169       hResult = S_FALSE;
00170       continue;
00171     }
00172
00173     // Set the images
00174     hResult = m_ipScopeImage->ImageListSetStrip( (LONG*)m_hImageStrip16,
00175                                                  (LONG*)m_hImageStrip32,
00176                                                  0,
00177                                                  RGB(0,255,0)
00178                                                );
00179     BREAK_ON_ERROR( hResult );
00180   }
00181   while( 0 );
00182
00183   return hResult;
00184 }
00185
00186 //---------------------------------------------------------------------------
00187 //  Called by the console every time we need to create a new result view.
00188 //  There can be several different result views. Aside from the default one
00189 //  created when the Snap-in initializes, additional ones are created by
00190 //  selecting "New window from here" in MMC's user interface.
00191 //
00192 HRESULT CComponentData::CreateComponent
00193 (
00194   LPCOMPONENT __RPC_FAR* ppComponent   //[out] Points to new IComponent class
00195 )
00196 {
00197   *ppComponent = NULL;
00198
00199   // Pass the new CComponent a pointer to it's parent
00200   CComponent* pComponent = new CComponent( this );
00201
00202   if( NULL == pComponent )
00203     return E_OUTOFMEMORY;
00204
00205   return pComponent->QueryInterface( IID_IComponent, (void**)ppComponent );
00206 }
00207
00208 //---------------------------------------------------------------------------
00209 //  Handles notification events from MMC
00210 //
00211 HRESULT CComponentData::Notify
00212 (
00213   LPDATAOBJECT     ipDataObject,   //[in] Points to the selected data object
00214   MMC_NOTIFY_TYPE  MmcEvent,       //[in] Identifies action taken by user
00215   LONG             nArg,           //[in] Depends on the notification type
00216   LONG             nParam          //[in] Depends on the notification type
00217 )
00218 {
00219   TRACE_EVENT( _T("Notify"), MmcEvent );  // Provides trace output
00220
00221   HRESULT hResult = S_FALSE;
00222   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00223   if( NULL == pNode )
00224     return hResult;
00225
00226   switch( MmcEvent )
00227   {
00228     case MMCN_EXPAND:
00229       hResult = pNode->OnExpand( ipDataObject, nArg, nParam, (LONG_PTR)this );
00230       break;
00231
00232     case MMCN_REMOVE_CHILDREN:
00233       hResult = pNode->OnRemoveChildren( ipDataObject, nArg, nParam, (LONG_PTR)this );
00234       break;
00235
00236     case MMCN_PRELOAD:                 // Function not implemented
00237     case MMCN_PROPERTY_CHANGE:         // Function not implemented
00238     case MMCN_DELETE:                  // Function not implemented
00239     case MMCN_RENAME:                  // Function not implemented
00240     default:
00241       break;
00242   }
00243
00244   return hResult;
00245 }
00246
00247 //---------------------------------------------------------------------------
00248 //  This is where we release any cached interface pointers or any
00249 //  allocated resources.
00250 //
00251 HRESULT CComponentData::Destroy( void)
00252 {
00253   SAFE_RELEASE( m_ipScopeImage        );
00254   SAFE_RELEASE( m_ipConsoleNameSpace2 );
00255   SAFE_RELEASE( m_ipConsole           );
00256
00257   SAFE_FREE_BITMAP( m_hImageStrip16 );
00258   SAFE_FREE_BITMAP( m_hImageStrip32 );
00259
00260   return S_OK;
00261 }
00262
00263 //---------------------------------------------------------------------------
00264 //  MMC provides a NULL cookie for the static/root node.  In this sample
00265 //  we don't pass that on, instead we use the pointer to our static node
00266 //  object which handles notifications
00267 //
00268 HRESULT CComponentData::QueryDataObject
00269 (
00270   MMC_COOKIE              nCookie,     //[in]  Indentifier of the selected node
00271   DATA_OBJECT_TYPES       nEnumType,   //[in]  Context in which this object was created
00272   LPDATAOBJECT __RPC_FAR* ppDataObject //[out] Points to data object we create
00273 )
00274 {
00275   HRESULT hResult = S_FALSE;
00276   ULONG   uCookie = 0;
00277
00278   CDataObject* pNewObject = new CDataObject();
00279
00280   (0 == nCookie) ? uCookie = (ULONG)m_pStaticNode : uCookie = nCookie;
00281   pNewObject->SetPrivateData( uCookie, (ULONG)nEnumType );
00282
00283   if( NULL == pNewObject )
00284     hResult = E_OUTOFMEMORY;
00285   else
00286     hResult = pNewObject->QueryInterface( IID_IDataObject, (void**)ppDataObject );
00287
00288   return hResult;
00289 }
00290
00291 //---------------------------------------------------------------------------
00292 //  Delegate the call to the static node object
00293 //
00294 HRESULT CComponentData::GetDisplayInfo
00295 (
00296   SCOPEDATAITEM* pScopeDataItem    //[out][in] Points to a SCOPEDATAITEM struct
00297 )
00298 {
00299   _ASSERT( NULL != pScopeDataItem );
00300   HRESULT hResult = S_OK;
00301
00302   // The console will only ask for the name string
00303   if(  pScopeDataItem->mask & SDI_STR )
00304   {
00305     CBaseNode* pNode = reinterpret_cast<CBaseNode*>(pScopeDataItem->lParam);
00306     hResult = pNode->GetDisplayInfo( pScopeDataItem );
00307   }
00308
00309   return hResult;
00310 }
00311
00312 //---------------------------------------------------------------------------
00313 HRESULT CComponentData::CompareObjects
00314 (
00315   LPDATAOBJECT ipDataObjectA,    //[in] First data object to compare
00316   LPDATAOBJECT ipDataObjectB     //[in] Second data object to compare
00317 )
00318 {
00319   return E_NOTIMPL;
00320 }
00321
00322 //---------------------------------------------------------------------------
00323 HRESULT CComponentData::QueryDispatch
00324 (
00325   MMC_COOKIE         nCookie,    //[in]  Item for which IDispatch is requested
00326   DATA_OBJECT_TYPES  eType,      //[in]  Context of item
00327   LPDISPATCH*        pipDispatch //[out] IDispatch pointer
00328 )
00329 {
00330   return E_NOTIMPL;
00331 }
00332
00333 /////////////////////////////////////////////////////////////////////////////
00334 // Interface IExtendContextMenu
00335
00336 //---------------------------------------------------------------------------
00337 HRESULT CComponentData::AddMenuItems
00338 (
00339   LPDATAOBJECT ipDataObject,         //[in]
00340   LPCONTEXTMENUCALLBACK ipCallback,  //[in]
00341   long __RPC_FAR* pInsertionAllowed  //[out-in]
00342 )
00343 {
00344   _ASSERT( NULL != ipCallback );
00345   HRESULT hResult = S_FALSE;
00346
00347   LPBASENODE pNode = ExtractBaseNodePtr( ipDataObject );
00348   if( NULL != pNode )
00349     hResult = pNode->AddMenuItems( ipCallback, pInsertionAllowed );
00350
00351   return hResult;
00352 }
00353
00354 //---------------------------------------------------------------------------
00355 //
00356 HRESULT CComponentData::Command
00357 (
00358   long         lCommandID,   //[in] Identifier of the menu item
00359   LPDATAOBJECT ipDataObject  //[in] DataObject for selected node
00360 )
00361 {
00362   HRESULT hResult = S_OK;
00363
00364   CBaseNode* pNode = ExtractBaseNodePtr( ipDataObject );
00365   if( NULL != pNode )
00366     hResult = pNode->Command( lCommandID );
00367
00368   return hResult;
00369 }
00370
00371 /////////////////////////////////////////////////////////////////////////////
00372 //  Helper methods
00373
00374 //---------------------------------------------------------------------------
00375 HRESULT CComponentData::GetInterface
00376 (
00377   DWORD     dwRequestedInterface,  //[in] Request flag
00378   LONG_PTR* ppInterface            //[in-out] Interface pointer to return
00379 )
00380 {
00381   _ASSERT( NULL != ppInterface );
00382   HRESULT hResult = S_OK;
00383
00384   switch( dwRequestedInterface )
00385   {
00386     case REQUEST_ICONSOLENAMESPACE2:
00387       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsoleNameSpace2);
00388       break;
00389
00390     case REQUEST_ICONSOLE:
00391       *ppInterface = reinterpret_cast<LONG_PTR>(m_ipConsole);
00392       break;
00393
00394     default:
00395       hResult = S_FALSE;
00396       *ppInterface = NULL;
00397       break;
00398   }
00399
00400   return hResult;
00401 }
00402
00403
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/plgtermpriv.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

plgtermpriv.h

Go to the documentation of this file.
00001
00002 #ifndef __PLG_PRIV__
00003 #define __PLG_PRIV__
00004
00005 #include <objbase.h>
00006 #include <initguid.H>
00007
00008
00009 //{26b65f6d-f315-4162-95a0-637b21c0cb6f}
00010 DEFINE_GUID(IID_ITPlgPrivEventSink,
00011   0x26b65f6d, 0xf315, 0x4162, 0x95, 0xa0, 0x63, 0x7b, 0x21, 0xc0, 0xcb, 0x6f);
00012
00013 interface __declspec(uuid("26b65f6d-f315-4162-95a0-637b21c0cb6f")) ITPlgPrivEventSink : public IUnknown
00014 //
00015 // ITPlgPrivEventSink
00016 //
00017 //interface DECLSPEC_NOVTABLE ITPlgPrivEventSink : IUnknown
00018 //DECLARE_INTERFACE_(
00019 //    ITPlgPrivEventSink, IUnknown)
00020 {
00021     STDMETHOD (FireEvent)(long lEventCode) = 0;
00022 };
00023 #endif //__PLG_PRIV__
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAsyncQuerySink Member List

This is the complete list of members for CAsyncQuerySink, including all inherited members.
CAsyncQuerySink(CListBox *output) | CAsyncQuerySink |
GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid) | CAsyncQuerySink | [inline]
GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo) | CAsyncQuerySink | [inline]
GetTypeInfoCount(UINT *pctinfo) | CAsyncQuerySink | [inline]
hResult | CAsyncQuerySink |
Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams, VARIANT *pvarResult, EXCEPINFO *pexcepinfo, UINT *puArgErr) | CAsyncQuerySink | [inline]
m_lRef | CAsyncQuerySink | [private]
m_pOutputList | CAsyncQuerySink | [private]
m_SetStatusCalled | CAsyncQuerySink | [private]
pObjArray | CAsyncQuerySink |
pObjParam | CAsyncQuerySink |
QueryInterface(REFIID, LPVOID *) | CAsyncQuerySink |
STDMETHOD_(SCODE, Indicate)(long lObjectCount | CAsyncQuerySink |
STDMETHOD_(SCODE, SetStatus)(long lFlags | CAsyncQuerySink |
STDMETHODIMP_(ULONG) AddRef(void) | CAsyncQuerySink |
STDMETHODIMP_(ULONG) Release(void) | CAsyncQuerySink |
strParam | CAsyncQuerySink |
~CAsyncQuerySink() | CAsyncQuerySink |
Generated on Wed Nov 13 2024 16:55:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CConnectionPoint Member List

This is the complete list of members for CConnectionPoint, including all inherited members.
AddRef() | CConnectionPoint | [virtual]
Advise(LPUNKNOWN lpUnk, LPDWORD pdwCookie) | CConnectionPoint | [private, virtual]
AutoQI(DWORD dwCreateOpts) | CConnectionPoint | [virtual]
AutoRelease() | CConnectionPoint | [virtual]
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CConnectionPoint(CConnectionPointContainer *pCPC, IID iid) | CConnectionPoint |
CConnectionPoint(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CConnectionPoint |
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
EnumConnections(LPENUMCONNECTIONS *ppenum) | CConnectionPoint | [private, virtual]
FinalRelease() | CConnectionPoint | [virtual]
GetBaseType() | CBase | [inline]
GetConnectionInterface(IID *pIID) | CConnectionPoint | [private, virtual]
GetConnectionInterface(IID *pIID) | CConnectionPoint | [virtual]
GetConnectionPointContainer(LPCONNECTIONPOINTCONTAINER *ppCPC) | CConnectionPoint | [private, virtual]
GetDefaultInterface() | CConnectionPoint | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CConnectionPoint | [virtual]
GetObjectDesc() | CConnectionPoint | [virtual]
GetObjectImage() | CConnectionPoint | [inline, virtual]
GetObjectMenu() | CConnectionPoint | [inline, virtual]
GetObjectName() | CConnectionPoint | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_Adviselimit | CConnectionPoint | [private]
m_cookie | CConnectionPoint | [private]
m_cRef | CConnectionPoint | [private]
m_dwCLSCTX | CBase |
m_dwCookie | CConnectionPoint |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_guidSource | CBase |
m_hTreeItem | CBase |
m_iid | CConnectionPoint | [private]
m_lpEventSink | CConnectionPoint | [private]
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pCPC | CConnectionPoint | [private]
m_pIAggregate | CBase |
m_pIConnectionPoint | CConnectionPoint |
m_pIService | CBase |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CBase | [virtual]
QueryInterface(REFIID iid, PVOID *ppv) | CConnectionPoint | [virtual]
CBase::QueryInterface(REFIID riid, void **ppvObject) | CBase |
Release() | CConnectionPoint | [virtual]
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
SignalEvent(DISPID dispid, DISPPARAMS *params) | CConnectionPoint |
SignalEvent() | CConnectionPoint |
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
Unadvise(DWORD dwCookie) | CConnectionPoint | [private, virtual]
~CBase() | CBase | [virtual]
~CConnectionPoint() | CConnectionPoint | [virtual]
~CConnectionPoint() | CConnectionPoint | [virtual]
Generated on Wed Nov 13 2024 16:55:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDeviceFinderCallback Member List

This is the complete list of members for CDeviceFinderCallback, including all inherited members.
CDeviceFinderCallback() | CDeviceFinderCallback | [inline]
Create() | CDeviceFinderCallback | [static]
DeviceAdded(LONG lFindData, IUPnPDevice *pDevice) | CDeviceFinderCallback |
DeviceRemoved(LONG lFindData, BSTR bstrUDN) | CDeviceFinderCallback |
m_pGenericUCPDlg | CDeviceFinderCallback | [private]
SearchComplete(LONG lFindData) | CDeviceFinderCallback |
SetDialogPointer(CGenericUCPDlg *pDialog) | CDeviceFinderCallback |
~CDeviceFinderCallback() | CDeviceFinderCallback | [inline]
Generated on Wed Nov 13 2024 16:56:19 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/userext/userproppage/userproppage.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • userext
  • userproppage

userproppage.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       userproppage.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // dscreate.cpp : Implementation of DLL Exports.
00012
00013 #include "stdafx.h"
00014
00015 // initguid.h requires this.
00016 //
00017 #include <objbase.h>
00018
00019 // this redefines the DEFINE_GUID() macro to do allocation.
00020 //
00021 #include <initguid.h>
00022
00023 //#include <dsshell.h>
00024
00025 #include <dsadmin.h>
00026
00027 #include "resource.h"
00028 #include "userproppage.h"
00029 #include "ProppageUser.h"
00030
00031 // {69D967C6-AB39-47b7-8F00-410185C80F89}
00032 static const GUID CLSID_ProppageUser =
00033 { 0x69d967c6, 0xab39, 0x47b7, { 0x8f, 0x00, 0x41, 0x01, 0x85, 0xC8, 0x0F, 0x89 } };
00034
00035 CMyUIExtModule _Module;
00036
00037 BEGIN_OBJECT_MAP(ObjectMap)
00038   OBJECT_ENTRY(CLSID_ProppageUser,    CProppageUser)
00039 END_OBJECT_MAP()
00040
00041 class CMyUIExtApp : public CWinApp
00042 {
00043 public:
00044   virtual BOOL InitInstance();
00045   virtual int ExitInstance();
00046 };
00047
00048 CMyUIExtApp theApp;
00049
00050 BOOL CMyUIExtApp::InitInstance()
00051 {
00052   _Module.Init(ObjectMap, m_hInstance);
00053   return CWinApp::InitInstance();
00054 }
00055
00056 int CMyUIExtApp::ExitInstance()
00057 {
00058   _Module.Term();
00059   return CWinApp::ExitInstance();
00060 }
00061
00062 /////////////////////////////////////////////////////////////////////////////
00063 // Used to determine whether the DLL can be unloaded by OLE
00064
00065 STDAPI DllCanUnloadNow(void)
00066 {
00067   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00068   return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
00069 }
00070
00071 /////////////////////////////////////////////////////////////////////////////
00072 // Returns a class factory to create an object of the requested type
00073
00074 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00075 {
00076   return _Module.GetClassObject(rclsid, riid, ppv);
00077 }
00078
00079 /////////////////////////////////////////////////////////////////////////////
00080 // DllRegisterServer - Adds entries to the system registry
00081
00082 BOOL x = TRUE;
00083 STDAPI DllRegisterServer(void)
00084 {
00085     return _Module.RegisterServer(FALSE);
00086 }
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // DllUnregisterServer - Removes entries from the system registry
00090
00091 STDAPI DllUnregisterServer(void)
00092 {
00093   _Module.UnregisterServer();
00094   return S_OK;
00095 }
00096
00097
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Menubtn/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Menubtn

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030     m_pStaticNode = new CStaticNode;
00031
00032     TCHAR tmpHelpFile[MAX_PATH];
00033
00034     GetWindowsDirectory(tmpHelpFile, (sizeof tmpHelpFile)/(sizeof tmpHelpFile[0]));
00035     _tcscat(tmpHelpFile, _T("\\HELP\\"));
00036     LoadString(g_hinst, IDS_HELPFILE, &tmpHelpFile[_tcslen(tmpHelpFile)], MAX_PATH - _tcslen(tmpHelpFile));
00037
00038   MAKE_WIDEPTR_FROMTSTR(wszHelpFile, tmpHelpFile);
00039   wcscpy(m_HelpFile, wszHelpFile);
00040 }
00041
00042 CComponentData::~CComponentData()
00043 {
00044     if (m_pStaticNode) {
00045         delete m_pStaticNode;
00046     }
00047
00048     OBJECT_DESTROYED
00049 }
00050
00051 ///////////////////////
00052 // IUnknown implementation
00053 ///////////////////////
00054
00055 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00056 {
00057     if (!ppv)
00058         return E_FAIL;
00059
00060     *ppv = NULL;
00061
00062     if (IsEqualIID(riid, IID_IUnknown))
00063         *ppv = static_cast<IComponentData *>(this);
00064     else if (IsEqualIID(riid, IID_IComponentData))
00065         *ppv = static_cast<IComponentData *>(this);
00066     else if (IsEqualIID(riid, IID_ISnapinHelp))
00067         *ppv = static_cast<ISnapinHelp*>(this);
00068
00069     if (*ppv)
00070     {
00071         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00072         return S_OK;
00073     }
00074
00075     return E_NOINTERFACE;
00076 }
00077
00078 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00079 {
00080     return InterlockedIncrement((LONG *)&m_cref);
00081 }
00082
00083 STDMETHODIMP_(ULONG) CComponentData::Release()
00084 {
00085     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00086     {
00087         // we need to decrement our object count in the DLL
00088         delete this;
00089         return 0;
00090     }
00091
00092     return m_cref;
00093 }
00094
00095 ///////////////////////////////
00096 // Interface IComponentData
00097 ///////////////////////////////
00098 HRESULT CComponentData::Initialize(
00099                                    /* [in] */ LPUNKNOWN pUnknown)
00100 {
00101     HRESULT      hr;
00102
00103     //
00104     // Get pointer to name space interface
00105     //
00106     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00107     _ASSERT( S_OK == hr );
00108
00109     //
00110     // Get pointer to console interface
00111     //
00112     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00113     _ASSERT( S_OK == hr );
00114
00115     IImageList *pImageList;
00116     m_ipConsole->QueryScopeImageList(&pImageList);
00117     _ASSERT( S_OK == hr );
00118
00119     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00120         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00121         0, // index of the first image in the strip
00122         RGB(0, 128, 128)  // color of the icon mask
00123         );
00124
00125     pImageList->Release();
00126
00127     return S_OK;
00128 }
00129
00130 HRESULT CComponentData::CreateComponent(
00131                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00132 {
00133     *ppComponent = NULL;
00134
00135     CComponent *pComponent = new CComponent(this);
00136
00137     if (NULL == pComponent)
00138         return E_OUTOFMEMORY;
00139
00140     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00141 }
00142
00143 HRESULT CComponentData::Notify(
00144                                /* [in] */ LPDATAOBJECT lpDataObject,
00145                                /* [in] */ MMC_NOTIFY_TYPE event,
00146                                /* [in] */ LPARAM arg,
00147                                /* [in] */ LPARAM param)
00148 {
00149     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00150
00151     HRESULT hr = S_FALSE;
00152
00153   //Get our data object. If it is NULL, we return with S_FALSE.
00154   //See implementation of GetOurDataObject() to see how to
00155   //handle special data objects.
00156   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00157   if (NULL == pDataObject)
00158     return S_FALSE;
00159
00160   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00161
00162     switch (event)
00163     {
00164     case MMCN_EXPAND:
00165         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00166         break;
00167     }
00168
00169     return hr;
00170 }
00171
00172 HRESULT CComponentData::Destroy( void)
00173 {
00174     // Free interfaces
00175     if (m_ipConsoleNameSpace) {
00176         m_ipConsoleNameSpace->Release();
00177         m_ipConsoleNameSpace = NULL;
00178     }
00179
00180     if (m_ipConsole) {
00181         m_ipConsole->Release();
00182         m_ipConsole = NULL;
00183     }
00184
00185     return S_OK;
00186 }
00187
00188 HRESULT CComponentData::QueryDataObject(
00189                                         /* [in] */ MMC_COOKIE cookie,
00190                                         /* [in] */ DATA_OBJECT_TYPES type,
00191                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00192 {
00193     CDataObject *pObj = NULL;
00194
00195     if (cookie == 0)
00196         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00197     else
00198         pObj = new CDataObject(cookie, type);
00199
00200     if (!pObj)
00201         return E_OUTOFMEMORY;
00202
00203     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00204
00205     return S_OK;
00206 }
00207
00208 HRESULT CComponentData::GetDisplayInfo(
00209                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00210 {
00211     HRESULT hr = S_FALSE;
00212
00213     // if they are asking for the SDI_STR we have one of those to give
00214     if (pScopeDataItem->lParam) {
00215         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00216         if (pScopeDataItem->mask & SDI_STR) {
00217                         LPCTSTR pszT = base->GetDisplayName();
00218                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00219             pScopeDataItem->displayname = pszW;
00220         }
00221
00222         if (pScopeDataItem->mask & SDI_IMAGE) {
00223             pScopeDataItem->nImage = base->GetBitmapIndex();
00224         }
00225     }
00226
00227     return hr;
00228 }
00229
00230 HRESULT CComponentData::CompareObjects(
00231                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00232                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00233 {
00234     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00235     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00236
00237     // compare the object pointers
00238     if (baseA->GetCookie() == baseB->GetCookie())
00239         return S_OK;
00240
00241     return S_FALSE;
00242 }
00243
00244 ///////////////////////////////
00245 // Interface ISnapinHelp
00246 ///////////////////////////////
00247 HRESULT CComponentData::GetHelpTopic(
00248                                      /* [out] */ LPOLESTR *lpCompiledHelpFile)
00249 {
00250     *lpCompiledHelpFile = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(m_HelpFile) + 1) * sizeof(WCHAR)));
00251
00252     wcscpy(*lpCompiledHelpFile, m_HelpFile);
00253
00254     return S_OK;
00255 }
Generated on Wed Nov 13 2024 16:52:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/pathparser/PathParser.cpp Source File

  • SysMgmt
  • WMI
  • VC
  • pathparser

PathParser.cpp

Go to the documentation of this file.
00001 // **************************************************************************
00002 //
00003 // Copyright (c) Microsoft Corporation, All Rights Reserved
00004 //
00005 // File:  PathParser.cpp
00006 //
00007 // Description:
00008 //      WMI Path Parser Sample.
00009 //      This sample shows how to use the Path Parser.  It takes a path as a command
00010 //      line argument and passes it off to the parser to be parsed and then uses various
00011 //      functions to get pieces of the path.
00012 //
00013 // History:
00014 //
00015 // **************************************************************************
00016
00017 #include <objbase.h>
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <wbemidl.h>
00021 #include <wmiutils.h>
00022
00023 //***************************************************************************
00024 //
00025 // DumpServerName
00026 //
00027 // Purpose: Dumps the server name
00028 //
00029 //***************************************************************************
00030
00031 void DumpServerName(IWbemPath * pParser)
00032 {
00033     HRESULT hr;
00034
00035     // One could safely assume a maximum server name, but for the sake of example,
00036     // the code will call GetServer in order to determine how long of name is needed, then
00037     // do the allocation, then get the name and finally dump it.
00038
00039     DWORD dwSize = 0;
00040     hr = pParser->GetServer(&dwSize, NULL);
00041     if(FAILED(hr) || dwSize == 0)
00042         return;                                 // nothing here, just return
00043
00044     WCHAR * pServer = new WCHAR[dwSize];
00045     if(pServer)
00046     {
00047         hr = pParser->GetServer(&dwSize,  pServer);
00048         if(FAILED(hr))
00049             printf("\nUnexpected failure, hr = 0x%x", hr);
00050         else
00051             printf("\nThe server name is <%S>", pServer);
00052         delete [] pServer;
00053     }
00054 }
00055
00056 //***************************************************************************
00057 //
00058 // DumpNamespaces
00059 //
00060 // Purpose: Dumps the name spaces
00061 //
00062 //***************************************************************************
00063
00064 void DumpNamespaces(IWbemPath * pParser)
00065 {
00066     HRESULT hr;
00067
00068     // first get the number of namespaces
00069
00070     ULONG lCnt;
00071     hr  = pParser->GetNamespaceCount(&lCnt);
00072     if(FAILED(hr))
00073     {
00074         printf("\nGetNamespaceCount failed, hr = 0x%x", hr);
00075         return;
00076     }
00077
00078     for(ULONG dwCnt = 0; dwCnt < lCnt; dwCnt++)
00079     {
00080         if(dwCnt == 0)
00081             printf("\nNamespaces=");
00082         else
00083             printf(",");
00084
00085         // first determine the necessary buffer size
00086
00087         DWORD dwSize = 0;
00088         hr = pParser->GetNamespaceAt(dwCnt, &dwSize, NULL);
00089         if(FAILED(hr) || dwSize == 0)
00090         {
00091             printf("\nGetNamespaceAt failed, hr = 0x%x", hr);
00092             return;
00093         }
00094
00095         WCHAR * pNamespace = new WCHAR[dwSize];
00096         if(pNamespace)
00097         {
00098             hr = pParser->GetNamespaceAt(dwCnt, &dwSize,  pNamespace);
00099             if(FAILED(hr))
00100                 printf("\nGetNamespaceAt failed for index %d, sc = 0x%x", dwCnt, hr);
00101             else
00102                 printf("%S", pNamespace);
00103             delete [] pNamespace;
00104         }
00105     }
00106 }
00107
00108 //***************************************************************************
00109 //
00110 // DumpClassName
00111 //
00112 // Purpose: Dumps the class name
00113 //
00114 //***************************************************************************
00115
00116 void DumpClassName(IWbemPath * pParser)
00117 {
00118     HRESULT hr;
00119
00120     // One could safely assume a maximum class name, but for the sake of example,
00121     // the code will call GetClassName in order to determine how long of name is needed, then
00122     // do the allocation, then get the name and finally dump it.
00123
00124     DWORD dwSize = 0;
00125     hr = pParser->GetClassName(&dwSize, NULL);
00126     if(FAILED(hr) || dwSize == 0)
00127         return;                                 // nothing here, just return
00128
00129     WCHAR * pClassName = new WCHAR[dwSize];
00130     if(pClassName)
00131     {
00132         hr = pParser->GetClassName(&dwSize,  pClassName);
00133         if(FAILED(hr))
00134             printf("\nUnexpected failure, hr = 0x%x", hr);
00135         else
00136             printf("\nThe class name is <%S>", pClassName);
00137         delete [] pClassName;
00138     }
00139 }
00140
00141 //***************************************************************************
00142 //
00143 // DumpKeyList
00144 //
00145 // Purpose: Dumps out the keys
00146 //
00147 //***************************************************************************
00148
00149 void DumpKeyList(IWbemPath * pParser)
00150 {
00151
00152     HRESULT hr;
00153     IWbemPathKeyList * pKeyList = NULL;
00154     hr = pParser->GetKeyList(&pKeyList);
00155     if(FAILED(hr) || pKeyList == NULL)
00156     {
00157         printf("\nNULL KEY LIST *****************");
00158         return;
00159     }
00160
00161     unsigned long uNumKey;
00162     hr = pKeyList->GetCount(&uNumKey);
00163     if(FAILED(hr))
00164     {
00165         printf("\nGetCount failed, hr = 0x%x", hr);
00166         return;
00167     }
00168     printf("\nThe key count is %d", uNumKey);
00169
00170     // check for the special case of a singleton.  In this case, the path does not have a named key and the
00171     // value is "@"
00172
00173     if(uNumKey == 0)
00174     {
00175         ULONGLONG uResponse;
00176         hr = pKeyList->GetInfo(0, &uResponse);
00177         if(SUCCEEDED(hr) && (uResponse & WBEMPATH_INFO_CONTAINS_SINGLETON))
00178         {
00179             printf("\nPath is a singleton");
00180             return;
00181         }
00182     }
00183
00184     // for the sake of clarity, this example assumes a maximum name size of 256.  Normally, an application would
00185     // take one of two approaches;  First, it could just allocate a buffer the size of the text used in the SetText
00186     // call and assume that is sufficient for the largest piece.  Second, it can call GetKey2 will a NULL pointer
00187     // to the name buffer and find out how large it needs to be, as is done in the DumpClassName and
00188     // DumpServer routines.
00189
00190      WCHAR wName[256];
00191      for(DWORD uKeyIx = 0; uKeyIx < uNumKey ; uKeyIx++)
00192      {
00193         ULONG uKeyType;
00194         DWORD dwSize = 256;
00195
00196         VARIANT var, var2;
00197         VariantInit(&var);
00198         VariantInit(&var2);
00199         hr = pKeyList->GetKey2(uKeyIx, 0, &dwSize, wName, &var, &uKeyType);
00200         if(FAILED(hr))
00201         {
00202             printf("\nGetKey2 failed, index = %d, hr = 0x%x", uKeyIx, hr);
00203         }
00204         else
00205         {
00206             // here we use Variant change type as a convenient string conversion routine.
00207
00208             hr = VariantChangeType(&var2, &var, 0, VT_BSTR);
00209             if(SUCCEEDED(hr))
00210             {
00211                 printf("\nKey %d, has name <%S>, type %d, value <%S>", uKeyIx, wName, uKeyType, var2.bstrVal);
00212                 VariantClear(&var2);
00213             }
00214             else
00215                 printf("\nVariantChangeType failed, hr = 0x%x", hr);
00216         VariantClear(&var);
00217         }
00218      }
00219 }
00220
00221 //***************************************************************************
00222 //
00223 // ParseAndDump
00224 //
00225 // Purpose: Does the actual parse, and dumps information
00226 //
00227 //***************************************************************************
00228
00229 void ParseAndDump(IWbemPath * pParser, WCHAR * pwcPath)
00230 {
00231     HRESULT hr;
00232     printf("\nAttempting to parse string <%S>", pwcPath);
00233     hr = pParser->SetText(WBEMPATH_CREATE_ACCEPT_ALL, pwcPath);
00234     if(FAILED(hr))
00235     {
00236         printf("\nParse failed, return code is 0x%x", hr);
00237         return;
00238     }
00239     DumpServerName(pParser);
00240     DumpNamespaces(pParser);
00241     DumpClassName(pParser);
00242     DumpKeyList(pParser);
00243 }
00244
00245 //***************************************************************************
00246 //
00247 // main
00248 //
00249 // Purpose: Program entry point.  It checks the argument, converts it to unicode,
00250 //               initializes Com, and creates the parser.
00251 //
00252 //***************************************************************************
00253
00254 int main(int iArgCnt, char ** argv)
00255 {
00256
00257     // First argument is the is the path.  If not present, dump out a usage message.
00258
00259     if(iArgCnt < 2)
00260     {
00261         printf("\nUsage:  PathParser <PathToBeParsed>"
00262                  "\nExample:  PathParser \\\\MyServer\\root\\default:stdregprov=@"
00263                  "\nor        PathParser \\\\MyServer\\root\\default:stdregprov.key=\\\"hello\\\""
00264                  "\nor        PathParser \\\\MyServer\\root\\default:stdregprov.key=23"
00265                  );
00266         return 1;
00267     }
00268
00269     // Convert to unicode
00270
00271     int iLen = (int)strlen(argv[1]);
00272     WCHAR * pwcPath = new WCHAR[iLen+1];
00273     if(pwcPath == NULL)
00274     {
00275         printf("\nFailed due to lack of memory");
00276         return 1;
00277     }
00278     mbstowcs(pwcPath, argv[1], iLen + 1);
00279
00280     // Initialize COM and create the path parser object
00281
00282     HRESULT hr = CoInitializeEx(0, COINIT_MULTITHREADED);
00283     if(SUCCEEDED(hr))
00284     {
00285         IWbemPath *pParser = NULL;
00286         hr = CoCreateInstance(CLSID_WbemDefPath, 0, CLSCTX_INPROC_SERVER,
00287                                                                      IID_IWbemPath, (LPVOID *) &pParser);
00288         if(SUCCEEDED(hr))
00289         {
00290             ParseAndDump(pParser, pwcPath);
00291             pParser->Release();
00292         }
00293         else
00294             printf("\nCoCreateInstance of CLSID_WbemDefPath, return is 0x%x", hr);
00295         CoUninitialize();
00296     }
00297     delete [] pwcPath;
00298     printf("\nTerminating normally");
00299     return 0;
00300 }
00301
Generated on Wed Nov 13 2024 16:52:40 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMFT/clUtil.Cpp Source File

  • Web
  • NetMeeting
  • NMFT

clUtil.Cpp

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMFT.EXE
00003 //  File:       CLUTIL.CPP
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1997-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016 #include "precomp.h"
00017
00018 //****************************************************************************
00019 //
00020 // CLASS RefCount
00021 //
00022 //****************************************************************************
00023
00024
00025 //****************************************************************************
00026 //
00027 // Constructor
00028 //
00029 //****************************************************************************
00030
00031 RefCount::RefCount(void)
00032 {
00033   m_cRef = 1;
00034 }
00035
00036
00037 //****************************************************************************
00038 //
00039 // Destructor
00040 //
00041 //****************************************************************************
00042
00043 RefCount::~RefCount(void)
00044 {
00045 }
00046
00047
00048 //****************************************************************************
00049 //
00050 // Methods from IUnknown
00051 //
00052 //****************************************************************************
00053
00054 ULONG STDMETHODCALLTYPE RefCount::AddRef(void)
00055 {
00056    ASSERT(m_cRef >= 0);
00057
00058    InterlockedIncrement(&m_cRef);
00059
00060    return (ULONG) m_cRef;
00061 }
00062
00063
00064 ULONG STDMETHODCALLTYPE RefCount::Release(void)
00065 {
00066   if (0 == InterlockedDecrement(&m_cRef))
00067   {
00068     delete this;
00069     return 0;
00070   }
00071
00072   ASSERT(m_cRef > 0);
00073   return (ULONG) m_cRef;
00074 }
00075
00076
00077 //****************************************************************************
00078 //
00079 // CLASS CNotify
00080 //
00081 //****************************************************************************
00082
00083
00084 //****************************************************************************
00085 //
00086 // Constructor
00087 //
00088 //****************************************************************************
00089
00090 CNotify::CNotify() :
00091   m_pcnpcnt(NULL),
00092     m_pcnp(NULL),
00093     m_dwCookie(0),
00094     m_pUnk(NULL)
00095 {
00096 }
00097
00098
00099 //****************************************************************************
00100 //
00101 // Destructor
00102 //
00103 //****************************************************************************
00104
00105 CNotify::~CNotify()
00106 {
00107   Disconnect(); // Make sure we're disconnected
00108 }
00109
00110
00111 //****************************************************************************
00112 //
00113 // HRESULT CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN)
00114 //
00115 //****************************************************************************
00116
00117 HRESULT CNotify::Connect(IUnknown *pUnk, REFIID riid, IUnknown *pUnkN)
00118 {
00119   if  (NULL == pUnk)
00120   {
00121     return E_POINTER;
00122   }
00123
00124   HRESULT hr  = NO_ERROR;
00125
00126   ASSERT(0 == m_dwCookie);
00127   if  (0 != m_dwCookie)
00128   {
00129     Disconnect();
00130   }
00131
00132   // Get the connection container
00133   hr = pUnk->QueryInterface(IID_IConnectionPointContainer, (void **)&m_pcnpcnt);
00134   if (SUCCEEDED(hr))
00135   {
00136     if  (NULL == m_pcnpcnt)
00137     {
00138       return E_FAIL;
00139     }
00140
00141     // Find an appropriate connection point
00142     hr = m_pcnpcnt->FindConnectionPoint(riid, &m_pcnp);
00143     if (SUCCEEDED(hr))
00144     {
00145       ASSERT(NULL != m_pcnp);
00146
00147       hr  = E_FAIL;
00148       if  (NULL != m_pcnp)
00149       {
00150         // Connect the sink object
00151         hr = m_pcnp->Advise((IUnknown *)pUnkN, &m_dwCookie);
00152       }
00153     }
00154   }
00155
00156   if (FAILED(hr))
00157   {
00158     Disconnect();
00159   }
00160   else
00161   {
00162       m_pUnk = pUnk; // keep around for caller
00163     m_pUnk->AddRef();
00164     }
00165
00166   return hr;
00167 }
00168
00169
00170 //****************************************************************************
00171 //
00172 // HRESULT CNotify::Disconnect (void)
00173 //
00174 //****************************************************************************
00175
00176 HRESULT CNotify::Disconnect (void)
00177 {
00178   if  (NULL != m_pcnp)
00179   {
00180     if  (0 != m_dwCookie)
00181     {
00182       m_pcnp->Unadvise(m_dwCookie);
00183       m_dwCookie = 0;
00184     }
00185
00186     m_pcnp->Release();
00187     m_pcnp = NULL;
00188   }
00189
00190   if  (NULL != m_pcnpcnt)
00191   {
00192     m_pcnpcnt->Release();
00193     m_pcnpcnt = NULL;
00194   }
00195
00196   if  (NULL != m_pUnk)
00197   {
00198     m_pUnk->Release();
00199     m_pUnk = NULL;
00200   }
00201
00202   m_dwCookie = 0;
00203
00204     return S_OK;
00205 }
00206
00207
00208 //****************************************************************************
00209 //
00210 // CLASS COBLIST
00211 //
00212 //****************************************************************************
00213
00214
00215 //****************************************************************************
00216 //
00217 // Destructor
00218 //
00219 //****************************************************************************
00220
00221 COBLIST::~COBLIST()
00222 {
00223     ASSERT(IsEmpty());
00224 }
00225
00226
00227 #ifdef DEBUG
00228 VOID* COBLIST::GetHead()
00229 {
00230   ASSERT(m_pHead);
00231   if  (NULL == m_pHead)
00232     return NULL;
00233
00234   return m_pHead->pItem;
00235 }
00236
00237 VOID* COBLIST::GetTail()
00238 {
00239   ASSERT(m_pTail);
00240   if  (NULL == m_pTail)
00241     return NULL;
00242
00243   return m_pTail->pItem;
00244 }
00245 #endif /* DEBUG */
00246
00247
00248 //****************************************************************************
00249 //
00250 // VOID* COBLIST::GetNext(POSITION& rPos)
00251 //
00252 //****************************************************************************
00253
00254 VOID* COBLIST::GetNext(POSITION& rPos)
00255 {
00256   ASSERT(rPos);
00257   if  (NULL == rPos)
00258     return NULL;
00259
00260   VOID* pReturn = rPos->pItem;
00261   rPos = rPos->pNext;
00262
00263   return pReturn;
00264 }
00265
00266
00267 //****************************************************************************
00268 //
00269 // VOID* COBLIST::RemoveAt(POSITION Pos)
00270 //
00271 //****************************************************************************
00272
00273 VOID* COBLIST::RemoveAt(POSITION Pos)
00274 {
00275   if  (NULL == Pos)
00276     return NULL;
00277
00278   VOID* pReturn = NULL;
00279
00280   if (m_pHead)
00281   {
00282     if (m_pHead == Pos)
00283     {
00284       // Removing the first element in the list
00285
00286       m_pHead = Pos->pNext;
00287       pReturn = Pos->pItem;
00288       delete Pos;
00289       m_cItem--;
00290       ASSERT(0 <= m_cItem);
00291
00292       if (NULL == m_pHead)
00293       {
00294         // Removing the only element!
00295         m_pTail = NULL;
00296       }
00297     }
00298     else
00299     {
00300       POSITION pCur = m_pHead;
00301
00302       while (pCur && pCur->pNext)
00303       {
00304         if (pCur->pNext == Pos)
00305         {
00306           // Removing
00307
00308           pCur->pNext = Pos->pNext;
00309           if (m_pTail == Pos)
00310           {
00311             m_pTail = pCur;
00312           }
00313           pReturn = Pos->pItem;
00314           delete Pos;
00315
00316           m_cItem--;
00317           ASSERT(0 <= m_cItem);
00318         }
00319
00320         pCur = pCur->pNext;
00321       }
00322     }
00323   }
00324
00325   return pReturn;
00326 }
00327
00328
00329 //****************************************************************************
00330 //
00331 // POSITION COBLIST::AddTail(VOID* pItem)
00332 //
00333 //****************************************************************************
00334
00335 POSITION COBLIST::AddTail(VOID* pItem)
00336 {
00337   POSITION posRet = NULL;
00338
00339   if (m_pTail)
00340   {
00341     if (m_pTail->pNext = new COBNODE)
00342     {
00343       m_pTail = m_pTail->pNext;
00344       m_pTail->pItem = pItem;
00345       m_pTail->pNext = NULL;
00346       m_cItem++;
00347     }
00348     else
00349     {
00350       return NULL;
00351     }
00352   }
00353   else
00354   {
00355     ASSERT(!m_pHead);
00356     if (m_pHead = new COBNODE)
00357     {
00358       m_pTail = m_pHead;
00359       m_pTail->pItem = pItem;
00360       m_pTail->pNext = NULL;
00361       m_cItem++;
00362     }
00363   }
00364
00365   return m_pTail;
00366 }
00367
00368
00369 //****************************************************************************
00370 //
00371 // void COBLIST::EmptyList()
00372 //
00373 //****************************************************************************
00374
00375 void COBLIST::EmptyList()
00376 {
00377     while (!IsEmpty())
00378   {
00379         RemoveAt(GetHeadPosition());
00380     }
00381 }
00382
00383
00384 #ifdef DEBUG
00385 VOID* COBLIST::RemoveTail()
00386 {
00387   ASSERT(m_pHead);
00388   ASSERT(m_pTail);
00389
00390   return RemoveAt(m_pTail);
00391 }
00392
00393 VOID* COBLIST::RemoveHead()
00394 {
00395   ASSERT(m_pHead);
00396   ASSERT(m_pTail);
00397
00398   return RemoveAt(m_pHead);
00399 }
00400
00401 void * COBLIST::GetFromPosition(POSITION Pos)
00402 {
00403     void * Result = SafeGetFromPosition(Pos);
00404   ASSERT(Result);
00405   return Result;
00406 }
00407 #endif /* DEBUG */
00408
00409
00410 //****************************************************************************
00411 //
00412 // POSITION COBLIST::GetPosition(void* _pItem)
00413 //
00414 //****************************************************************************
00415
00416 POSITION COBLIST::GetPosition(void* _pItem)
00417 {
00418     POSITION    Position = m_pHead;
00419
00420     while (Position)
00421   {
00422         if (Position->pItem == _pItem)
00423     {
00424             break;
00425         }
00426     GetNext(Position);
00427     }
00428     return Position;
00429 }
00430
00431
00432 //****************************************************************************
00433 //
00434 // POSITION COBLIST::Lookup(void* pComparator)
00435 //
00436 //****************************************************************************
00437
00438 POSITION COBLIST::Lookup(void* pComparator)
00439 {
00440     POSITION    Position = m_pHead;
00441
00442     while (Position)
00443   {
00444         if (Compare(Position->pItem, pComparator))
00445     {
00446             break;
00447         }
00448     GetNext(Position);
00449     }
00450     return Position;
00451 }
00452
00453
00454 //****************************************************************************
00455 //
00456 // void * COBLIST::SafeGetFromPosition(POSITION Pos)
00457 //
00458 //****************************************************************************
00459
00460 void * COBLIST::SafeGetFromPosition(POSITION Pos)
00461 {
00462   if  (NULL == Pos)
00463   {
00464     return NULL;
00465   }
00466
00467   // Safe way to validate that an entry is still in the list,
00468   // which ensures bugs that would reference deleted memory,
00469   // reference a NULL pointer instead
00470   // (e.g. an event handler fires late/twice).
00471   // Note that versioning on entries would provide an additional
00472   // safeguard against re-use of a position.
00473   // Walk list to find entry.
00474
00475   POSITION PosWork = m_pHead;
00476
00477   while (PosWork)
00478   {
00479     if (PosWork == Pos)
00480     {
00481       return Pos->pItem;
00482     }
00483     GetNext(PosWork);
00484   }
00485   return NULL;
00486 }
00487
00488 //****************************************************************************
00489 //
00490 // COBLIST Utility routines
00491 //
00492 //****************************************************************************
00493
00494
00495 //****************************************************************************
00496 //
00497 // POSITION AddNode(PVOID pv, COBLIST ** ppList)
00498 //
00499 // Add a node to a list.
00500 // Initializes the ObList, if necessary.
00501 // Returns the position in the list or NULL if there was a problem.
00502 //
00503 //****************************************************************************
00504
00505 POSITION AddNode(PVOID pv, COBLIST ** ppList)
00506 {
00507   ASSERT(NULL != ppList);
00508   if  (NULL == ppList)
00509     return NULL;
00510
00511   if (NULL == *ppList)
00512   {
00513     *ppList = new COBLIST();
00514     if (NULL == *ppList)
00515       return NULL;
00516   }
00517
00518   return (*ppList)->AddTail(pv);
00519 }
00520
00521
00522 //****************************************************************************
00523 //
00524 // PVOID RemoveNode(POSITION * pPos, COBLIST *pList)
00525 //
00526 // Remove a node from a list.
00527 // Sets pPos to NULL
00528 //
00529 //****************************************************************************
00530
00531 PVOID RemoveNode(POSITION * pPos, COBLIST *pList)
00532 {
00533   if ((NULL == pList) || (NULL == pPos))
00534     return NULL;
00535
00536   PVOID pv = pList->RemoveAt(*pPos);
00537   *pPos = NULL;
00538   return pv;
00539 }
00540
00541
00542 //****************************************************************************
00543 //
00544 // CLASS BSTRING
00545 //
00546 //****************************************************************************
00547
00548
00549 //****************************************************************************
00550 //
00551 // Constructor
00552 //
00553 // We don't support construction from an ANSI string in the Unicode build.
00554 //
00555 //****************************************************************************
00556
00557 #if !defined(UNICODE)
00558
00559 BSTRING::BSTRING(LPCSTR lpcString)
00560 {
00561   m_bstr = NULL;
00562
00563   // Compute the length of the required BSTR, including the null
00564   int cWC =  MultiByteToWideChar(CP_ACP, 0, lpcString, -1, NULL, 0);
00565   if (cWC <= 0)
00566     return;
00567
00568   // Allocate the BSTR, including the null
00569   m_bstr = SysAllocStringLen(NULL, cWC); // SysAllocStringLen adds another 1
00570
00571   ASSERT(NULL != m_bstr);
00572   if (NULL == m_bstr)
00573   {
00574     return;
00575   }
00576
00577   ZeroMemory(m_bstr, (cWC + 1) * sizeof(OLECHAR));
00578
00579   // Copy the string
00580   MultiByteToWideChar(CP_ACP, 0, lpcString, -1, (LPWSTR) m_bstr, cWC);
00581 }
00582
00583 #endif // !defined(UNICODE)
00584
00585
00586 //****************************************************************************
00587 //
00588 // CLASS BTSTR
00589 //
00590 //****************************************************************************
00591
00592 //****************************************************************************
00593 //
00594 // Constructor
00595 //
00596 //****************************************************************************
00597
00598 BTSTR::BTSTR(BSTR bstr)
00599 {
00600   m_psz = PszFromBstr(bstr);
00601 }
00602
00603
00604 //****************************************************************************
00605 //
00606 // Destructor
00607 //
00608 //****************************************************************************
00609
00610 BTSTR::~BTSTR()
00611 {
00612   if (NULL != m_psz)
00613     LocalFree(m_psz);
00614 }
00615
00616
00617 //****************************************************************************
00618 //
00619 // LPTSTR PszFromBstr(BSTR bstr)
00620 //
00621 // Converts a BSTR to a LPSTR
00622 //
00623 //****************************************************************************
00624
00625 LPTSTR PszFromBstr(BSTR bstr)
00626 {
00627   if (NULL == bstr)
00628     return NULL;
00629   int cch =  WideCharToMultiByte(CP_ACP, 0, (LPWSTR)bstr, -1, NULL, 0, NULL, NULL);
00630   if (cch <= 0)
00631     return NULL;
00632
00633   LPTSTR psz = PszAlloc(cch);
00634   if (NULL == psz)
00635     return NULL;
00636
00637   ZeroMemory(bstr, (cch + 1) * sizeof(TCHAR));
00638
00639   WideCharToMultiByte(CP_ACP, 0, (LPWSTR)bstr, -1, psz, cch, NULL, NULL);
00640   return psz;
00641 }
00642
Generated on Wed Nov 13 2024 16:52:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/activedir/createuser/vc/CreateUserHelpers.cpp Source File

  • NetDS
  • ADSI
  • samples
  • activedir
  • createuser
  • vc

CreateUserHelpers.cpp

Go to the documentation of this file.
00001 #define INC_OLE2
00002 #define UNICODE 1
00003 #define _WIN32_DCOM
00004
00005 #include <windows.h>
00006 #include <winuser.h>
00007
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include <string.h>
00011 #include <malloc.h>
00012 #include <winldap.h>
00013
00014 #include <activeds.h>
00015 #include <assert.h>
00016
00017 #include "CreateUserHelpers.h"
00018
00019
00020
00021
00022
00023 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy=1);
00024 bool SAFE_APPEND(int targetSize, LPWSTR szTarget, LPCWSTR szSource);
00025
00026
00027
00028
00029
00030
00031
00032
00033 ////////////////////////////////////////////////////////////////////////////////////////////////////
00034 /*
00035     PrintIADSObject()       -   Calls all the methods on a IADs object
00036                                 and prints them the console window
00037     Parameters
00038
00039         IADs * pIADs        - IADs Interface from which to retrieve attribute values
00040 */
00041 void PrintIADSObject(IADs * pIADs)
00042 {
00043   assert(pIADs);
00044
00045   BSTR bsResult;
00046
00047   pIADs->get_Name(&bsResult);
00048   wprintf(L" NAME: %s\n",(LPOLESTR) bsResult);
00049   SysFreeString(bsResult);
00050
00051   pIADs->get_Class(&bsResult);
00052   wprintf(L" CLASS: %s\n",(LPOLESTR) bsResult);
00053   SysFreeString(bsResult);
00054
00055   pIADs->get_GUID(&bsResult);
00056   wprintf(L" GUID: %s\n",(LPOLESTR) bsResult);
00057   SysFreeString(bsResult);
00058
00059   pIADs->get_ADsPath(&bsResult);
00060   wprintf(L" ADSPATH: %s\n",(LPOLESTR) bsResult);
00061   SysFreeString(bsResult);
00062
00063   pIADs->get_Parent(&bsResult);
00064   wprintf(L" PARENT: %s\n",(LPOLESTR) bsResult);
00065   SysFreeString(bsResult);
00066
00067   pIADs->get_Schema(&bsResult);
00068   wprintf(L" SCHEMA: %s\n",(LPOLESTR) bsResult);
00069   SysFreeString(bsResult);
00070
00071 }
00072
00073 ////////////////////////////////////////////////////////////////////////////////////////////////////
00074 ////////////////////////////////////////////////////////////////////////////////////////////////////
00075 ////////////////////////////////////////////////////////////////////////////////////////////////////
00076 ////////////////////////////////////////////////////////////////////////////////////////////////////
00077 ////////////////////////////////////////////////////////////////////////////////////////////////////
00078 // Error Handling routines
00079
00080 // Will display ADSI or COM error messages
00081 // when passed a BAD Hresult
00082
00083 void CheckADHRESULT(HRESULT passedhr,LPOLESTR pwReason)
00084 {
00085     if (SUCCEEDED(passedhr))
00086         return;
00087
00088     HRESULT hr;
00089     DWORD lError;
00090     WCHAR pwErrBuff[2048];
00091     WCHAR pwADErrBuff[512];
00092     WCHAR * pADErrCodeStr;
00093
00094     pwErrBuff[0] = NULL;
00095     pADErrCodeStr = CrackADError( passedhr);
00096
00097   int maxAlloc = sizeof(pwErrBuff)/sizeof(WCHAR);
00098
00099     // If an ADSI error code was returned, display it
00100     if (pADErrCodeStr[0] != NULL)
00101     {
00102     SAFE_APPEND(maxAlloc, pwErrBuff, L"<*> ADSI Error HRESULT Returns: <*> \n");
00103     SAFE_APPEND(maxAlloc, pwErrBuff, pADErrCodeStr);
00104     SAFE_APPEND(maxAlloc, pwErrBuff, L"\n");
00105     }
00106
00107     // Call ADsGetLastError() to retrieve the error text from ADSI
00108   SAFE_APPEND(maxAlloc, pwErrBuff, L"<*> ADSI Error: <*>\n");
00109
00110     hr = ADsGetLastError(
00111         &lError,
00112         pwADErrBuff,
00113         2047,
00114         L"",
00115         0
00116         );
00117
00118
00119     if (FAILED(hr))
00120     SAFE_APPEND(maxAlloc, pwErrBuff, L"<Unable to retrieve ADs Error>");
00121     else
00122     SAFE_APPEND(maxAlloc, pwErrBuff, pwADErrBuff);
00123
00124
00125
00126   SAFE_APPEND(maxAlloc, pwErrBuff, L"\n");
00127
00128     WCHAR sz[1024];
00129
00130   SAFE_APPEND(maxAlloc, pwErrBuff, L"<*> System Error: <*> \n");
00131
00132     // Check the standard system to crack the bad HRESULT into a string
00133     if (!FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, 0, passedhr, 0, sz, 1024, 0))
00134         wcscat(sz, L"Unknown HRESULT error");
00135     else
00136     SAFE_APPEND(maxAlloc, pwErrBuff, sz);
00137
00138
00139     // Display
00140     OutputDebugStringW(pwErrBuff);
00141     OutputDebugStringW(L"\r\n");
00142     _putws(L"\n**********");
00143     wprintf(L"\nERROR on %s\n\n",pwReason);
00144     _putws(pwErrBuff);
00145     _putws(L"\n**********");
00146
00147 }
00148
00149 WCHAR * CrackADError(HRESULT hResult)
00150 {
00151    static WCHAR szwText[ 128 ];
00152    szwText[0] = 0l;
00153
00154    switch( hResult )
00155    {
00156       case  E_ADS_BAD_PATHNAME:
00157          return L"E_ADS_BAD_PATHNAME";
00158          break;
00159
00160       case  E_ADS_INVALID_DOMAIN_OBJECT:
00161          return L"E_ADS_INVALID_DOMAIN_OBJECT";
00162          break;
00163
00164       case  E_ADS_INVALID_USER_OBJECT:
00165          return L"E_ADS_INVALID_USER_OBJECT";
00166          break;
00167
00168       case  E_ADS_INVALID_COMPUTER_OBJECT:
00169          return L"E_ADS_INVALID_COMPUTER_OBJECT";
00170          break;
00171
00172       case  E_ADS_UNKNOWN_OBJECT:
00173          return L"E_ADS_UNKNOWN_OBJECT";
00174          break;
00175
00176       case  E_ADS_PROPERTY_NOT_SET:
00177          return L"E_ADS_PROPERTY_NOT_SET";
00178          break;
00179
00180       case  E_ADS_PROPERTY_NOT_SUPPORTED:
00181          return L"E_ADS_PROPERTY_NOT_SUPPORTED";
00182          break;
00183
00184       case  E_ADS_PROPERTY_INVALID:
00185          return L"E_ADS_PROPERTY_INVALID";
00186          break;
00187
00188       case  E_ADS_BAD_PARAMETER:
00189          return L"E_ADS_BAD_PARAMETER";
00190          break;
00191
00192       case  E_ADS_OBJECT_UNBOUND:
00193          return L"E_ADS_OBJECT_UNBOUND";
00194          break;
00195
00196       case  E_ADS_PROPERTY_NOT_MODIFIED:
00197          return L"E_ADS_PROPERTY_NOT_MODIFIED";
00198          break;
00199
00200       case  E_ADS_PROPERTY_MODIFIED:
00201          return L"E_ADS_PROPERTY_MODIFIED";
00202          break;
00203
00204       case  E_ADS_CANT_CONVERT_DATATYPE:
00205          return L"E_ADS_CANT_CONVERT_DATATYPE";
00206          break;
00207
00208       case  E_ADS_PROPERTY_NOT_FOUND:
00209          return L"E_ADS_PROPERTY_NOTFOUND";
00210          break;
00211
00212       case  E_ADS_OBJECT_EXISTS:
00213          return L"E_ADS_OBJECT_EXISTS";
00214          break;
00215
00216       case  E_ADS_SCHEMA_VIOLATION:
00217          return L"E_ADS_SCHEMA_VIOLATION";
00218          break;
00219
00220       case  E_ADS_COLUMN_NOT_SET:
00221          return L"E_ADS_COLUMN_NOT_SET";
00222          break;
00223
00224       case  E_ADS_INVALID_FILTER:
00225          return L"E_ADS_INVALID_FILTER";
00226          break;
00227
00228       //case  E_ADS_LDAP_BASE:
00229       //   return L"E_ADS_LDAP_BASE";
00230       //   break;
00231
00232       case  HRESULT_FROM_WIN32(ERROR_DS_OPERATIONS_ERROR):
00233          return L"ERROR_DS_OPERATIONS_ERROR";
00234          break;
00235
00236       case  HRESULT_FROM_WIN32(ERROR_DS_PROTOCOL_ERROR):
00237          return L"ERROR_DS_PROTOCOL_ERROR";
00238          break;
00239
00240       case  HRESULT_FROM_WIN32(ERROR_DS_TIMELIMIT_EXCEEDED):
00241          return L"ERROR_DS_TIMELIMIT_EXCEEDED";
00242          break;
00243
00244       case  HRESULT_FROM_WIN32(ERROR_DS_SIZELIMIT_EXCEEDED):
00245          return L"ERROR_DS_SIZELIMIT_EXCEEDED";
00246          break;
00247
00248       case  HRESULT_FROM_WIN32(ERROR_DS_COMPARE_FALSE):
00249          return L"ERROR_DS_COMPARE_FALSE";
00250          break;
00251
00252
00253       case  HRESULT_FROM_WIN32(ERROR_DS_COMPARE_TRUE):
00254          return L"ERROR_DS_COMPARE_TRUE";
00255          break;
00256
00257
00258       case  HRESULT_FROM_WIN32(ERROR_DS_AUTH_METHOD_NOT_SUPPORTED):
00259          return L"ERROR_DS_AUTH_METHOD_NOT_SUPPORTED";
00260          break;
00261
00262
00263       case  HRESULT_FROM_WIN32(ERROR_DS_STRONG_AUTH_REQUIRED):
00264          return L"ERROR_DS_STRONG_AUTH_REQUIRED";
00265          break;
00266
00267
00268       case  HRESULT_FROM_WIN32(ERROR_MORE_DATA):
00269          return L"ERROR_MORE_DATA";
00270          break;
00271
00272       case  HRESULT_FROM_WIN32(ERROR_DS_REFERRAL):
00273          return L"(ERROR_DS_REFERRAL";
00274          break;
00275
00276       case  HRESULT_FROM_WIN32(ERROR_DS_ADMIN_LIMIT_EXCEEDED):
00277          return L"ERROR_DS_ADMIN_LIMIT_EXCEEDED";
00278          break;
00279
00280
00281       case  HRESULT_FROM_WIN32(ERROR_DS_UNAVAILABLE_CRIT_EXTENSION):
00282          return L"(ERROR_DS_UNAVAILABLE_CRIT_EXTENSION";
00283          break;
00284
00285       case  HRESULT_FROM_WIN32(ERROR_DS_CONFIDENTIALITY_REQUIRED):
00286          return L"HRESULT_FROM_WIN32(ERROR_DS_CONFIDENTIALITY_REQUIRED";
00287          break;
00288
00289       case  HRESULT_FROM_WIN32(ERROR_DS_NO_ATTRIBUTE_OR_VALUE):
00290          return L"ERROR_DS_NO_ATTRIBUTE_OR_VALUE";
00291          break;
00292
00293       case  HRESULT_FROM_WIN32(ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED):
00294          return L"(ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED";
00295          break;
00296
00297       case  HRESULT_FROM_WIN32(ERROR_DS_INAPPROPRIATE_MATCHING):
00298          return L"(ERROR_DS_INAPPROPRIATE_MATCHING";
00299          break;
00300
00301       case  HRESULT_FROM_WIN32(ERROR_DS_CONSTRAINT_VIOLATION):
00302          return L"ERROR_DS_CONSTRAINT_VIOLATION";
00303          break;
00304
00305       case  HRESULT_FROM_WIN32(ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS):
00306          return L"ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS";
00307          break;
00308
00309       case  HRESULT_FROM_WIN32(ERROR_DS_INVALID_ATTRIBUTE_SYNTAX):
00310          return L"ERROR_DS_INVALID_ATTRIBUTE_SYNTAX";
00311          break;
00312
00313       case  HRESULT_FROM_WIN32(ERROR_DS_NO_SUCH_OBJECT):
00314          return L"ERROR_DS_NO_SUCH_OBJECT";
00315          break;
00316
00317       // case  HRESULT_FROM_WIN32(E_ADS_LDAP_ALIAS_PROBLEM:
00318          // return L"HRESULT_FROM_WIN32(E_ADS_LDAP_ALIAS_PROBLEM";
00319          // break;
00320
00321       case  HRESULT_FROM_WIN32(ERROR_DS_INVALID_DN_SYNTAX):
00322          return L"ERROR_DS_INVALID_DN_SYNTAX";
00323          break;
00324
00325       case  HRESULT_FROM_WIN32(ERROR_DS_IS_LEAF):
00326          return L"ERROR_DS_IS_LEAF";
00327          break;
00328
00329       case  HRESULT_FROM_WIN32(ERROR_DS_ALIAS_DEREF_PROBLEM):
00330          return L"ERROR_DS_ALIAS_DEREF_PROBLEM";
00331          break;
00332
00333       case  HRESULT_FROM_WIN32(ERROR_DS_INAPPROPRIATE_AUTH):
00334          return L"ERROR_DS_INAPPROPRIATE_AUTH";
00335          break;
00336
00337       case  HRESULT_FROM_WIN32(ERROR_INVALID_PASSWORD):
00338          return L"ERROR_INVALID_PASSWORD";
00339          break;
00340
00341       case  HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED):
00342          return L"ERROR_ACCESS_DENIED";
00343          break;
00344
00345       case  HRESULT_FROM_WIN32(ERROR_DS_BUSY):
00346          return L"ERROR_DS_BUSY";
00347          break;
00348
00349       case  HRESULT_FROM_WIN32(ERROR_DS_UNAVAILABLE):
00350          return L"ERROR_DS_UNAVAILABLE";
00351          break;
00352
00353       case  HRESULT_FROM_WIN32(ERROR_DS_UNWILLING_TO_PERFORM):
00354          return L"ERROR_DS_UNWILLING_TO_PERFORM";
00355          break;
00356
00357       case  HRESULT_FROM_WIN32(ERROR_DS_LOOP_DETECT):
00358          return L"ERROR_DS_LOOP_DETECT";
00359          break;
00360
00361       case  HRESULT_FROM_WIN32(ERROR_DS_NAMING_VIOLATION):
00362          return L"ERROR_DS_NAMING_VIOLATION";
00363          break;
00364
00365       case  HRESULT_FROM_WIN32(ERROR_DS_OBJ_CLASS_VIOLATION):
00366          return L"ERROR_DS_OBJ_CLASS_VIOLATION";
00367          break;
00368
00369       case  HRESULT_FROM_WIN32(ERROR_DS_CANT_ON_NON_LEAF):
00370          return L"ERROR_DS_CANT_ON_NONLEAF";
00371          break;
00372
00373       case  HRESULT_FROM_WIN32(ERROR_DS_CANT_ON_RDN):
00374          return L"ERROR_DS_CANT_ON_RDN";
00375          break;
00376
00377       case  HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS):
00378          return L"ERROR_ALREADY_EXISTS";
00379          break;
00380
00381       case  HRESULT_FROM_WIN32(ERROR_DS_CANT_MOD_OBJ_CLASS):
00382          return L"ERROR_DS_CANT_MOD_OBJ_CLASS";
00383          break;
00384
00385       case  HRESULT_FROM_WIN32(ERROR_DS_OBJECT_RESULTS_TOO_LARGE):
00386          return L"ERROR_DS_OBJECT_RESULTS_TOO_LARGE";
00387          break;
00388
00389       case  HRESULT_FROM_WIN32(ERROR_DS_AFFECTS_MULTIPLE_DSAS):
00390          return L"ERROR_DS_AFFECTS_MULTIPLE_DSAS";
00391          break;
00392
00393       case  HRESULT_FROM_WIN32(ERROR_GEN_FAILURE):
00394          return L"(ERROR_GEN_FAILURE";
00395          break;
00396
00397       case  HRESULT_FROM_WIN32(ERROR_DS_SERVER_DOWN):
00398          return L"ERROR_DS_SERVER_DOWN";
00399          break;
00400
00401       case  HRESULT_FROM_WIN32(ERROR_DS_LOCAL_ERROR):
00402          return L"ERROR_DS_LOCAL_ERROR";
00403          break;
00404
00405       case  HRESULT_FROM_WIN32(ERROR_DS_ENCODING_ERROR):
00406          return L"ERROR_DS_ENCODING_ERROR";
00407          break;
00408
00409       case  HRESULT_FROM_WIN32(ERROR_DS_DECODING_ERROR):
00410          return L"(ERROR_DS_DECODING_ERROR";
00411          break;
00412
00413       case  HRESULT_FROM_WIN32(ERROR_TIMEOUT):
00414          return L"(ERROR_TIMEOUT";
00415          break;
00416
00417       case  HRESULT_FROM_WIN32(ERROR_DS_AUTH_UNKNOWN):
00418          return L"ERROR_DS_AUTH_UNKNOWN";
00419          break;
00420
00421       case  HRESULT_FROM_WIN32(ERROR_DS_FILTER_UNKNOWN):
00422          return L"(ERROR_DS_FILTER_UNKNOWN";
00423          break;
00424
00425       case  HRESULT_FROM_WIN32(ERROR_CANCELLED):
00426          return L"(ERROR_CANCELLED";
00427          break;
00428
00429       case  HRESULT_FROM_WIN32(ERROR_DS_PARAM_ERROR):
00430          return L"ERROR_DS_PARAM_ERROR";
00431          break;
00432
00433       case  HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY):
00434          return L"ERROR_NOT_ENOUGH_MEMORY";
00435          break;
00436
00437       case  HRESULT_FROM_WIN32(ERROR_CONNECTION_REFUSED):
00438          return L"ERROR_CONNECTION_REFUSED";
00439          break;
00440
00441       case  HRESULT_FROM_WIN32(ERROR_DS_NOT_SUPPORTED):
00442          return L"ERROR_DS_NOT_SUPPORTED";
00443          break;
00444
00445       case  HRESULT_FROM_WIN32(ERROR_DS_NO_RESULTS_RETURNED):
00446          return L"ERROR_DS_NO_RESULTS_RETURNED";
00447          break;
00448
00449       case  HRESULT_FROM_WIN32(ERROR_DS_CONTROL_NOT_FOUND):
00450          return L"ERROR_DS_CONTROL_NOT_FOUND";
00451          break;
00452
00453       // case  HRESULT_FROM_WIN32(E_ADS_LDAP_MORE_RESULTS_TO_RETURN:
00454          // return L"HRESULT_FROM_WIN32(E_ADS_LDAP_MORE_RESULTS_TO_RETURN";
00455          // break;
00456
00457       case  HRESULT_FROM_WIN32(ERROR_DS_CLIENT_LOOP):
00458          return L"(ERROR_DS_CLIENT_LOOP";
00459          break;
00460
00461       case  HRESULT_FROM_WIN32(ERROR_DS_REFERRAL_LIMIT_EXCEEDED):
00462          return L"ERROR_DS_REFERRAL_LIMIT_EXCEEDED";
00463          break;
00464
00465       // case  HRESULT_FROM_WIN32(E_ADS_LDAP_LAST:
00466          // return L"HRESULT_FROM_WIN32(E_ADS_LDAP_LAST";
00467          // break;
00468
00469       case  E_FAIL:
00470          return L"E_FAIL";
00471          break;
00472
00473       case  E_NOTIMPL:
00474          return L"E_NOIMPL";
00475          break;
00476
00477       case  S_OK:
00478          return L"OK";
00479          break;
00480
00481       case  0x800704b8:
00482       // we have an extended error
00483       {
00484          WCHAR szErrorBuff[ 1024 ];
00485          WCHAR szNameBuff[ 1024 ];
00486          DWORD dwError;
00487
00488          ADsGetLastError( &dwError,
00489                           szErrorBuff,
00490                           1023,
00491                           szNameBuff,
00492                           1023 );
00493      int errSize=sizeof(szErrorBuff)/sizeof(WCHAR);
00494      SAFE_APPEND(errSize, szNameBuff, L" : " );
00495          SAFE_APPEND(errSize, szNameBuff, szErrorBuff);
00496
00497      szwText[0]=0l;
00498      int textSize= sizeof(szwText)/sizeof(WCHAR);
00499      SAFE_APPEND(textSize,szwText, szNameBuff);
00500
00501
00502          return szwText;
00503       }
00504
00505    }
00506
00507     return szwText;
00508 }
00509
00510
00511
00512
00513 int IS_BUFFER_ENOUGH(UINT maxAlloc, LPWSTR pszTarget, LPCWSTR pszSource, int toCopy)
00514 {
00515
00516          if (toCopy == -1)
00517
00518           {
00519                toCopy = wcslen(pszSource);
00520           }
00521
00522       return maxAlloc - (wcslen(pszTarget) + toCopy + 1);
00523 }
00524
00525
00526
00527 bool SAFE_APPEND(int targetSize, LPWSTR szTarget, LPCWSTR szSource)
00528 {
00529   if ( IS_BUFFER_ENOUGH( targetSize, szTarget, szSource) > 0 )
00530   {
00531     wcscpy(szTarget, szSource);
00532     return true;
00533   }
00534
00535   return false;
00536 }
00537
00538
00539
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/PerClien/ListSINK.Cpp Source File

  • Com
  • Fundamentals
  • TutSamp
  • PerClien

ListSINK.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      LISTSINK.CPP
00003
00004   Summary:   Implementation file for the COPageListSink COM Object Class.
00005              Connectable object notifications of PageList events are
00006              handled by COPageListSink.
00007
00008              COPageListSink offers a main IUnknown standard interface and
00009              the IPageListSink custom interface (with the PageList related
00010              event features). This multiple interface COM Object Class is
00011              achieved via the technique of nested classes.  The
00012              implementation of the IPageListSink interface is nested
00013              inside the COPageListSink Class.
00014
00015              For a comprehensive tutorial code tour of this module's
00016              contents and offerings see the tutorial PERCLIEN.HTM
00017              file. For more specific technical details on the internal
00018              workings see the comments dispersed throughout the module's
00019              source code.
00020
00021   Classes:   COPageListSink.
00022
00023   Functions: none.
00024
00025   Origin:    5-20-97: atrent - Editor-inheritance from SINK.CPP in
00026              the STOCLIEN Tutorial Code Sample. [Revised]
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043
00044 /*---------------------------------------------------------------------------
00045   We include WINDOWS.H for all Win32 applications.
00046   We include OLE2.H because we will be calling the COM/OLE Libraries.
00047   We include OLECTL.H because it has definitions for connectable objects.
00048   We include APPUTIL.H because we will be building this application using
00049     the convenient Virtual Window and Dialog classes and other
00050     utility functions in the APPUTIL Library (ie, APPUTIL.LIB).
00051   We include IPAGES.H and PAGEGUID.H for the common Page-related
00052     Interface class, GUID, and CLSID specifications.
00053   We include PAGFILE.H because it has the C++ class used for compound file
00054     storage of PageList data.
00055   We include LISTWIN.H because CGuiList creates and uses a CListWin to
00056     encapsulate the standard list box control.
00057   We include GUILIST.H because it declares the class for the main C++
00058     object that can service the Sink events.
00059   We include LISTSINK.H because of the class COPageListSink declarations.
00060 ---------------------------------------------------------------------------*/
00061 #include <windows.h>
00062 #include <ole2.h>
00063 #include <olectl.h>
00064 #include <apputil.h>
00065 #include <ipages.h>
00066 #include <pageguid.h>
00067 #include "pagefile.h"
00068 #include "listwin.h"
00069 #include "guilist.h"
00070 #include "listsink.h"
00071
00072
00073 /*---------------------------------------------------------------------------
00074   COPageListSink's implementation of its main COM object class including
00075   Constructor, Destructor, QueryInterface, AddRef, and Release.
00076 ---------------------------------------------------------------------------*/
00077
00078 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00079   Method:   COPageListSink::COPageListSink
00080
00081   Summary:  COPageListSink Constructor. Note the member initializer:
00082             "m_ImpIPageListSink(this, pUnkOuter)" which is used to pass
00083             the 'this' and pUnkOuter pointers of this constructor function
00084             to the constructor in the instantiation of the implementation
00085             of the CImpIPageListSink interface (which is nested inside
00086             this present COPageListSink Object Class).
00087
00088   Args:     IUnknown* pUnkOuter,
00089               Pointer to the the outer Unknown.  NULL means this COM Object
00090               is not being Aggregated.  Non NULL means it is being created
00091               on behalf of an outside COM object that is reusing it via
00092               aggregation.
00093             CGuiList* pGuiList)
00094               Pointer to the main C++ object that can service the
00095               PageListSink events.
00096
00097   Modifies: m_cRefs, m_pUnkOuter, m_pGuiList.
00098
00099   Returns:  void
00100 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00101 COPageListSink::COPageListSink(
00102   IUnknown* pUnkOuter,
00103   CGuiList* pGuiList) :
00104   m_ImpIPageListSink(this, pUnkOuter)
00105 {
00106   // Zero the COM object's reference count.
00107   m_cRefs = 0;
00108
00109   // No AddRef necessary if non-NULL, as we're nested.
00110   m_pUnkOuter = pUnkOuter;
00111
00112   // Assign the pointer to the Sink service C++ object.
00113   m_pGuiList = pGuiList;
00114
00115   return;
00116 }
00117
00118
00119 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00120   Method:   COPageListSink::~COPageListSink
00121
00122   Summary:  COPageListSink Destructor.
00123
00124   Args:     void
00125
00126   Returns:  void
00127 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00128 COPageListSink::~COPageListSink(void)
00129 {
00130   return;
00131 }
00132
00133
00134 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00135   Method:   COPageListSink::QueryInterface
00136
00137   Summary:  QueryInterface of the COPageListSink non-delegating
00138             IUnknown implementation.
00139
00140   Args:     REFIID riid,
00141               [in] GUID of the Interface being requested.
00142             PPVOID ppv)
00143               [out] Address of the caller's pointer variable that will
00144               receive the requested interface pointer.
00145
00146   Returns:  HRESULT
00147 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00148 STDMETHODIMP COPageListSink::QueryInterface(
00149                REFIID riid,
00150                PPVOID ppv)
00151 {
00152   HRESULT hr = E_NOINTERFACE;
00153
00154   *ppv = NULL;
00155
00156   if (IID_IUnknown == riid)
00157     *ppv = this;
00158   else if (IID_IPageListSink == riid)
00159     *ppv = &m_ImpIPageListSink;
00160
00161   if (NULL != *ppv)
00162   {
00163     // We've handed out a pointer to the interface so obey the COM rules
00164     // and AddRef the reference count.
00165     ((LPUNKNOWN)*ppv)->AddRef();
00166     hr = NOERROR;
00167   }
00168
00169
00170   return (hr);
00171 }
00172
00173
00174 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00175   Method:   COPageListSink::AddRef
00176
00177   Summary:  AddRef of the COPageListSink non-delegating IUnknown
00178             implementation.
00179
00180   Args:     void
00181
00182   Modifies: m_cRefs.
00183
00184   Returns:  ULONG
00185               New value of m_cRefs (COM object's reference count).
00186 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00187 STDMETHODIMP_(ULONG) COPageListSink::AddRef(void)
00188 {
00189   ULONG cRefs;
00190
00191   cRefs = ++m_cRefs;
00192
00193   return cRefs;
00194 }
00195
00196
00197 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00198   Method:   COPageListSink::Release
00199
00200   Summary:  Release of the COPageListSink non-delegating IUnknown
00201             implementation.
00202
00203   Args:     void
00204
00205   Modifies: m_cRefs.
00206
00207   Returns:  ULONG
00208               New value of m_cRefs (COM object's reference count).
00209 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00210 STDMETHODIMP_(ULONG) COPageListSink::Release(void)
00211 {
00212   ULONG cRefs;
00213
00214   cRefs = --m_cRefs;
00215
00216   if (0 == cRefs)
00217   {
00218     // We artificially bump the main ref count to prevent reentrancy
00219     // via the main object destructor.  Not really needed in this
00220     // COPageListSink but a good practice because we are aggregatable and
00221     // may at some point in the future add something entertaining like
00222     // some Releases to the COPageListSink destructor.
00223     m_cRefs++;
00224     delete this;
00225   }
00226
00227   return cRefs;
00228 }
00229
00230
00231 /*---------------------------------------------------------------------------
00232   COPageListSink's nested implementation of the IPageListSink interface
00233   including Constructor, Destructor, QueryInterface, AddRef, Release,
00234   Loaded, Saved, Cleared, PageAdded, PageDeleted, and PageSet. Methods in
00235   this interface are called by COM objects on the server side to send
00236   event notifications to the client.
00237 ---------------------------------------------------------------------------*/
00238
00239 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00240   Method:   COPageListSink::CImpIPageListSink::CImpIPageListSink
00241
00242   Summary:  Constructor for the CImpIPageListSink interface instantiation.
00243
00244   Args:     COPageListSink* pCO,
00245               Back pointer to the parent outer object.
00246             IUnknown* pUnkOuter
00247               Pointer to the outer Unknown.  For delegation.
00248
00249   Modifies: m_pCO, m_pUnkOuter.
00250
00251   Returns:  void
00252 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00253 COPageListSink::CImpIPageListSink::CImpIPageListSink(
00254   COPageListSink* pCO,
00255   IUnknown* pUnkOuter)
00256 {
00257   // Init the main object Pointer to point to the parent object.
00258   m_pCO = pCO;
00259
00260   // Init the CImpIPageListSink interface's delegating Unknown pointer. We
00261   // use the main object pointer for IUnknown delegation here if we are
00262   // not being aggregated.  If we are being aggregated we use the supplied
00263   // pUnkOuter for IUnknown delegation.  In either case the pointer
00264   // assignment requires no AddRef because the CImpIPageListSink lifetime
00265   // is quaranteed by the lifetime of the parent object in which
00266   // CImpIPageListSink is nested.
00267   if (NULL == pUnkOuter)
00268     m_pUnkOuter = pCO;
00269   else
00270     m_pUnkOuter = pUnkOuter;
00271
00272   return;
00273 }
00274
00275
00276 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00277   Method:   COPageListSink::CImpIPageListSink::~CImpIPageListSink
00278
00279   Summary:  Destructor for the CImpIPageListSink interface instantiation.
00280
00281   Args:     void
00282
00283   Returns:  void
00284 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00285 COPageListSink::CImpIPageListSink::~CImpIPageListSink(void)
00286 {
00287   return;
00288 }
00289
00290
00291 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00292   Method:   COPageListSink::CImpIPageListSink::QueryInterface
00293
00294   Summary:  The QueryInterface IUnknown member of this IPageListSink
00295             interface implementation that delegates to m_pUnkOuter,
00296             whatever it is.
00297
00298   Args:     REFIID riid,
00299               [in] GUID of the Interface being requested.
00300             PPVOID ppv)
00301               [out] Address of the caller's pointer variable that will
00302               receive the requested interface pointer.
00303
00304   Returns:  HRESULT
00305               Returned by the delegated outer QueryInterface call.
00306 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00307 STDMETHODIMP COPageListSink::CImpIPageListSink::QueryInterface(
00308                REFIID riid,
00309                PPVOID ppv)
00310 {
00311   // Delegate this call to the outer object's QueryInterface.
00312   return m_pUnkOuter->QueryInterface(riid, ppv);
00313 }
00314
00315
00316 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00317   Method:   COPageListSink::CImpIPageListSink::AddRef
00318
00319   Summary:  The AddRef IUnknown member of this IPageListSink interface
00320             implementation that delegates to m_pUnkOuter, whatever it is.
00321
00322   Args:     void
00323
00324   Returns:  ULONG
00325               Returned by the delegated outer AddRef call.
00326 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00327 STDMETHODIMP_(ULONG) COPageListSink::CImpIPageListSink::AddRef(void)
00328 {
00329   // Delegate this call to the outer object's AddRef.
00330   return m_pUnkOuter->AddRef();
00331 }
00332
00333
00334 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00335   Method:   COPageListSink::CImpIPageListSink::Release
00336
00337   Summary:  The Release IUnknown member of this IPageListSink interface
00338             implementation that delegates to m_pUnkOuter, whatever it is.
00339
00340   Args:     void
00341
00342   Returns:  ULONG
00343               Returned by the delegated outer Release call.
00344 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00345 STDMETHODIMP_(ULONG) COPageListSink::CImpIPageListSink::Release(void)
00346 {
00347   // Delegate this call to the outer object's Release.
00348   return m_pUnkOuter->Release();
00349 }
00350
00351
00352 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00353   Method:   COPageListSink::CImpIPageListSink::Loaded
00354
00355   Summary:  The COPageList object's list data was loaded from a
00356             client's compound file.
00357
00358   Args:     void
00359
00360   Returns:  HRESULT
00361               Standard result code. NOERROR for success.
00362 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00363 STDMETHODIMP COPageListSink::CImpIPageListSink::Loaded(
00364                void)
00365 {
00366   HRESULT hr;
00367
00368   // We have been notified that a load was done. A whole new array of
00369   // PageList data must be displayed in the ListWin window of this client.
00370   hr = m_pCO->m_pGuiList->Show(0);
00371
00372   return hr;
00373 }
00374
00375
00376 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00377   Method:   COPageListSink::CImpIPageListSink::Saved
00378
00379   Summary:  The COPageList object's PageList data was saved to a
00380             client's compound file.
00381
00382   Args:     void
00383
00384   Returns:  HRESULT
00385               Standard result code. NOERROR for success.
00386 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00387 STDMETHODIMP COPageListSink::CImpIPageListSink::Saved(
00388                void)
00389 {
00390   HRESULT hr = E_NOTIMPL;
00391
00392   // For future evolution.
00393
00394   return hr;
00395 }
00396
00397
00398 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00399   Method:   COPageListSink::CImpIPageListSink::Cleared
00400
00401   Summary:  Another client has cleared the content of the PageList.
00402
00403   Args:     void
00404
00405   Returns:  HRESULT
00406               Standard result code. NOERROR for success.
00407 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00408 STDMETHODIMP COPageListSink::CImpIPageListSink::Cleared(
00409                void)
00410 {
00411   HRESULT hr;
00412
00413   // We have been notified that a clear was done. An empty array of
00414   // PageList data must be displayed in the ListWin window of this client.
00415   hr = m_pCO->m_pGuiList->Show(0);
00416
00417   return hr;
00418 }
00419
00420
00421 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00422   Method:   COPageListSink::CImpIPageListSink::PageAdded
00423
00424   Summary:  A page was added to the page list.
00425
00426   Args:     INT iPage
00427               The page number of the newly added page.
00428
00429   Returns:  HRESULT
00430               Standard result code. NOERROR for success.
00431 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00432 STDMETHODIMP COPageListSink::CImpIPageListSink::PageAdded(
00433                INT iPage)
00434 {
00435   HRESULT hr;
00436
00437   // We have been notified that a new page was added. In this simple
00438   // sample app the entire array is reshown. A more efficient action
00439   // would be to call CListWin::InsertFmt to insert/add only the
00440   // list item that was added to the list.
00441   hr = m_pCO->m_pGuiList->Show(iPage);
00442
00443   return hr;
00444 }
00445
00446
00447 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00448   Method:   COPageListSink::CImpIPageListSink::PageDeleted
00449
00450   Summary:  A page was deleted from the page list.
00451
00452   Args:     INT iPage
00453               Page number of the page that was deleted.
00454
00455   Returns:  HRESULT
00456               Standard result code. NOERROR for success.
00457 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00458 STDMETHODIMP COPageListSink::CImpIPageListSink::PageDeleted(
00459                INT iPage)
00460 {
00461   HRESULT hr;
00462
00463   // We have been notified that a page was deleted. In this simple
00464   // sample app the entire array is reshown. A more efficient action
00465   // would be to explicitly call CListWin (using the LB_DELETESTRING
00466   // message) to only the delete the display line for the item
00467   // that was deleted in COPageList.
00468   hr = m_pCO->m_pGuiList->Show(iPage);
00469
00470   return hr;
00471 }
00472
00473
00474 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00475   Method:   COPageListSink::CImpIPageListSink::PageSet
00476
00477   Summary:  An existing page was retitled.
00478
00479   Args:     INT iPage
00480               Page number of the page that was retitled.
00481
00482   Returns:  HRESULT
00483               Standard result code. NOERROR for success.
00484 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00485 STDMETHODIMP COPageListSink::CImpIPageListSink::PageSet(
00486                INT iPage)
00487 {
00488   HRESULT hr;
00489
00490   // We have been notified that the current page was retitled.
00491   // In this simple sample app the entire array is reshown. A more
00492   // efficient action would be to explicitly call CListWin (using the
00493   // iPage given) to only re-display the display line that was changed.
00494   hr = m_pCO->m_pGuiList->Show(iPage);
00495
00496   return hr;
00497 }
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp1/QCShip/QCShip.Idl Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp1
  • QCShip

QCShip.Idl

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      QCShip.idl
00003   Summary:   Interfaces for Queued Components Order Entry Sample 1
00004   Classes:   Declared: Ship
00005   Origin:    Implementation of case study in Queued Components specification.
00006 ----------------------------------------------------------------------------
00007
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995-1998 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020
00021 ==========================================================================+*/
00022
00023 #include "mtxattr.h"  // For TRANSACTION_REQUIRED
00024
00025 import "oaidl.idl";   // Automation data types
00026
00027 /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
00028   Interface: IShip
00029   Summary:   Represents an order and its line items to the shipping department
00030   Methods:   HRESULT CustomerId - sets Customer Identifier property
00031        HRESULT OrderId - sets Order Identifier property
00032        HRESULT LineItem - adds an item to an order
00033              HRESULT ProcessOrder - Completes order
00034 I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
00035
00036 [
00037   helpstring("IShip Interface"), uuid(CB34A1A4-28C2-11D2-B5B6-00C04FC340EE),
00038   object, dual, nonextensible, hidden, pointer_default(unique),
00039   QUEUEABLE
00040 ]
00041 interface IShip : IDispatch
00042 {
00043   [id(1), propput] HRESULT CustomerId([in] long lCustomerId);
00044   [id(2), propput] HRESULT OrderId([in] long lOrderId);
00045   [id(3)] HRESULT LineItem([in] long lItemId, [in] long lQuantity);
00046   [id(4)] HRESULT Process([in] long lFlags);
00047 }
00048
00049 [
00050   uuid(6DD1E6CF-28C1-11D2-B5B6-00C04FC340EE),
00051   version(1.0),
00052   helpstring("QCShip 1.0 Type Library")
00053 ]
00054
00055 // Library and classes
00056
00057 library QCSHIPLib
00058 {
00059   importlib("stdole2.tlb");
00060
00061 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00062   ObjectClass: Ship
00063   Summary:     presented order to shipping department, get shipping status
00064   Interfaces:  IUnknown     Standard COM object interface
00065                IShip      The order to be shipped
00066   Aggregation: Not supported
00067 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00068
00069   [
00070     helpstring("Ship Class"), uuid(CB34A1A5-28C2-11D2-B5B6-00C04FC340EE),
00071     TRANSACTION_REQUIRED
00072   ]
00073   coclass Ship { [default] interface IShip; };
00074 };
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpwizard/SCPWizard.cpp Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpwizard

SCPWizard.cpp

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       SCPWizard.cpp
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 // dscreate.cpp : Implementation of DLL Exports.
00012
00013 #include "stdafx.h"
00014
00015 // initguid.h requires this.
00016 //
00017 #include <objbase.h>
00018
00019 // this redefines the DEFINE_GUID() macro to do allocation.
00020 //
00021 #include <initguid.h>
00022
00023 //#include <dsshell.h>
00024
00025 #include <dsadmin.h>
00026
00027 #include "resource.h"
00028 #include "SCPWizard.h"
00029 #include "SCPWiz.h"
00030
00031 // {C03793D3-A7C8-11d1-B942-00A0C9A06D2D}
00032 static const GUID CLSID_SCPWizard =
00033 { 0xc03793d3, 0xa7c8, 0x11d1, { 0xb9, 0x42, 0x0, 0xa0, 0xc9, 0xa0, 0x6d, 0x2d } };
00034
00035 CSCPWizModule _Module;
00036
00037 BEGIN_OBJECT_MAP(ObjectMap)
00038   OBJECT_ENTRY(CLSID_SCPWizard,      CSCPWiz)
00039 END_OBJECT_MAP()
00040
00041 class CSCPWizApp : public CWinApp
00042 {
00043 public:
00044   virtual BOOL InitInstance();
00045   virtual int ExitInstance();
00046 };
00047
00048 CSCPWizApp theApp;
00049
00050 BOOL CSCPWizApp::InitInstance()
00051 {
00052   _Module.Init(ObjectMap, m_hInstance);
00053   return CWinApp::InitInstance();
00054 }
00055
00056 int CSCPWizApp::ExitInstance()
00057 {
00058   _Module.Term();
00059   return CWinApp::ExitInstance();
00060 }
00061
00062 /////////////////////////////////////////////////////////////////////////////
00063 // Used to determine whether the DLL can be unloaded by OLE
00064
00065 STDAPI DllCanUnloadNow(void)
00066 {
00067   AFX_MANAGE_STATE(AfxGetStaticModuleState());
00068   return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
00069 }
00070
00071 /////////////////////////////////////////////////////////////////////////////
00072 // Returns a class factory to create an object of the requested type
00073
00074 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00075 {
00076   return _Module.GetClassObject(rclsid, riid, ppv);
00077 }
00078
00079 /////////////////////////////////////////////////////////////////////////////
00080 // DllRegisterServer - Adds entries to the system registry
00081
00082 BOOL x = TRUE;
00083 STDAPI DllRegisterServer(void)
00084 {
00085     return _Module.RegisterServer(FALSE);
00086 }
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // DllUnregisterServer - Removes entries from the system registry
00090
00091 STDAPI DllUnregisterServer(void)
00092 {
00093   _Module.UnregisterServer();
00094   return S_OK;
00095 }
00096
00097
Generated on Wed Nov 13 2024 16:52:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Queue Member List

This is the complete list of members for Queue, including all inherited members.
lpCriticalSection | Queue
pFirst | Queue
pLast | Queue
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CPrintSDIView Member List

This is the complete list of members for CPrintSDIView, including all inherited members.
_iScale | CView | [protected]
_ptClient | CView | [protected]
_ptOrg | CView | [protected]
_ptScroll | CView | [protected]
_size | CView | [protected]
CPrintSDIView() | CPrintSDIView | [protected]
CView(int cx, int cy) | CView |
GetDocument() | CPrintSDIView | [inline]
Hittest(CCanvas &canvas, POINT pt, CModel *_pModel) | CView |
Invalidate(HWND hwnd, LPRECT lpRect=NULL) | CView |
OnBeginPrinting(CDC *pDC, CPrintInfo *pInfo) | CPrintSDIView | [protected, virtual]
OnDraw(CDC *pDC) | CPrintSDIView | [virtual]
OnEndPrinting(CDC *pDC, CPrintInfo *pInfo) | CPrintSDIView | [protected, virtual]
OnFileFax() | CPrintSDIView | [protected]
OnPreparePrinting(CPrintInfo *pInfo) | CPrintSDIView | [protected, virtual]
Paint(CCanvas &canvas, CModel *_pModel, RECT rc) | CView |
PreCreateWindow(CREATESTRUCT &cs) | CPrintSDIView | [virtual]
Scroll(CCanvas &canvas) | CView | [protected]
SetSize(int cx, int cy) | CView |
~CPrintSDIView() | CPrintSDIView | [virtual]
Generated on Wed Nov 13 2024 16:57:04 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/RPCssm/RPCssms.c Source File

  • NetDS
  • RPC
  • RPCssm

RPCssms.c

Go to the documentation of this file.
00001 /****************************************************************************
00002                    Microsoft RPC Version 2.0
00003            Copyright Microsoft Corp. 1992 - 2000
00004                         rpcssm Example
00005
00006     FILE:       rpcssms.c
00007
00008     USAGE:      rpcssms  -p protocol_sequence
00009                          -e endpoint
00010                          -m max calls
00011                          -n min calls
00012                          -f flag for RpcServerListen
00013
00014     PURPOSE:    Server side of RPC distributed application rpcssm
00015
00016     FUNCTIONS:  main() - registers server as RPC server
00017
00018     COMMENTS:   This distributed application uses a context handle.
00019
00020 ****************************************************************************/
00021
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <ctype.h>
00025 #include "rpcssm.h"    // header file generated by MIDL compiler
00026
00027 #define PURPOSE \
00028 "This Microsoft RPC Version 2.0 sample program demonstrates\n\
00029 the [context_handle] attribute. For more information\n\
00030 about this attribute and the RPC API functions, see the\n\
00031 RPC programming guide and reference.\n\n"
00032
00033 void Usage(char * pszProgramName)
00034 {
00035     fprintf(stderr, "%s", PURPOSE);
00036     fprintf(stderr, "Usage:  %s\n", pszProgramName);
00037     fprintf(stderr, " -p protocol_sequence\n");
00038     fprintf(stderr, " -e endpoint\n");
00039     fprintf(stderr, " -m maxcalls\n");
00040     fprintf(stderr, " -n mincalls\n");
00041     fprintf(stderr, " -f flag_wait_op\n");
00042     exit(1);
00043 }
00044
00045 void __cdecl main(int argc, char * argv[])
00046 {
00047     RPC_STATUS status;
00048     unsigned char * pszProtocolSequence = "ncacn_np";
00049     unsigned char * pszSecurity         = NULL;
00050     unsigned char * pszEndpoint         = "\\pipe\\rpcssm";
00051     unsigned int    cMinCalls           = 1;
00052     unsigned int    cMaxCalls           = 20;
00053     unsigned int    fDontWait           = TRUE;
00054     int i;
00055
00056     /* allow the user to override settings with command line switches */
00057     for (i = 1; i < argc; i++) {
00058         if ((*argv[i] == '-') || (*argv[i] == '/')) {
00059             switch (tolower(*(argv[i]+1))) {
00060             case 'p':  // protocol sequence
00061                 pszProtocolSequence = argv[++i];
00062                 break;
00063             case 'e':
00064                 pszEndpoint = argv[++i];
00065                 break;
00066             case 'm':
00067                 cMaxCalls = (unsigned int) atoi(argv[++i]);
00068                 break;
00069             case 'n':
00070                 cMinCalls = (unsigned int) atoi(argv[++i]);
00071                 break;
00072             case 'f':
00073                 fDontWait = (unsigned int) atoi(argv[++i]);
00074                 break;
00075             case 'h':
00076             case '?':
00077             default:
00078                 Usage(argv[0]);
00079             }
00080         }
00081         else
00082             Usage(argv[0]);
00083     }
00084
00085     status = RpcServerUseProtseqEp(pszProtocolSequence,
00086                                    cMaxCalls,
00087                                    pszEndpoint,
00088                                    pszSecurity);  // Security descriptor
00089     printf("RpcServerUseProtseqEp returned 0x%x\n", status);
00090     if (status) {
00091          exit(status);
00092     }
00093
00094     status = RpcServerRegisterIf(rpcssm_ServerIfHandle, // interface to register
00095                                  NULL,   // MgrTypeUuid
00096                                  NULL);  // MgrEpv; null means use default
00097     printf("RpcServerRegisterIf returned 0x%x\n", status);
00098     if (status) {
00099         exit(status);
00100     }
00101
00102     printf("Calling RpcServerListen\n");
00103     status = RpcServerListen(cMinCalls,
00104                              cMaxCalls,
00105                              fDontWait);
00106     printf("RpcServerListen returned: 0x%x\n", status);
00107     if (status) {
00108         exit(status);
00109     }
00110
00111     if (fDontWait) {
00112         printf("Calling RpcMgmtWaitServerListen\n");
00113         status = RpcMgmtWaitServerListen();  //  wait operation
00114         printf("RpcMgmtWaitServerListen returned: 0x%x\n", status);
00115         if (status) {
00116             exit(status);
00117         }
00118     }
00119
00120 } // end main()
00121
00122
00123 /*********************************************************************/
00124 /*                 MIDL allocate and free                            */
00125 /*********************************************************************/
00126
00127 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
00128 {
00129     return(malloc(len));
00130 }
00131
00132 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
00133 {
00134     free(ptr);
00135 }
00136
00137 /* end file rpcssms.c */
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/Authorization/SidCln/SidClean.c Source File

  • Security
  • Authorization
  • SidCln

SidClean.c

Go to the documentation of this file.
00001
00002 /******************************************************************************
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 sidclean.c
00011
00012                NT never deletes SIDs, so the name of this sample is most
00013                  accurately be intrepreted as "Clean up SID ownership and
00014                  ACE's that relate to SIDs that still (and always will)
00015                  exist, but for which the corresponding user account has been
00016                  deleted"
00017
00018
00019  PURPOSE:      Demonstrate some of the Win32 security api(s), and provide a
00020                  sample of how a utility could be written that recovers
00021                  on-disk resources remaining allocated to deleted user
00022                  accounts.  The on-disk resources recovered are 1) Files that
00023                  are still owned by accounts that have been deleted are
00024                  assigned ownership to the account logged on when this sample
00025                  is run, and 2) ACE's for deleted accounts are edited
00026                  (deleted) out of the ACLs of files to which the deleted
00027                  accounts had been granted authorizations (eg., Read access)
00028
00029                It may be that running this sample as a utility has no
00030                  practical value in many environments, as the number of files
00031                  belonging to deleted user accounts will often be quite
00032                  small, and the number of bytes recovered on disk by editing
00033                  out ACEs for deleted accounts may well not be worth the time
00034                  it takes to run this sample.  The time it takes to run this
00035                  sample may be quite significant when processing an entire
00036                  hard disk or partition
00037
00038                This sample is not a supported utility
00039
00040
00041  TO RUN:       You must log on using an account, such as Administrator, that
00042                  has the priviledges to take file ownership and edit ACls
00043
00044                The ACL editing part of this sample can only be excercised for
00045                  files on a partition that has ACLs NT processes:  NTFS
00046
00047                Typical test scenario:  Create a user account or two, log on
00048                  as each of these accounts in turn, while logged on for each
00049                  account, go to an NTFS partition, create a couple of files
00050                  so the test accounts each own a few files, use the file
00051                  manager to edit permissions for those files so that each
00052                  test user has some authorities (e.g., Read) explicitly
00053                  granted for those files.  Logon as Administrator, authorize
00054                  each test user to a few Administrator-owned files.  Delete
00055                  the test accounts.  Run the sample in the directories where
00056                  you put the files the test accounts owned or were authorized
00057                  to
00058
00059
00060  OVERALL APPROACH: The command line interface is kept inflexible to simplify
00061                  it's parsing in this sample.  The user must pass in a switch
00062                  argument, a directory spec, and a file search pattern
00063
00064                The sample positions the current directory (of the process the
00065                  sample runs in) to the dir spec, and uses FindFirstFile and
00066                  FindNextFile to walk through the directory specified looking
00067                  for files that match the file pattern specified
00068
00069                The switch argument can cause subdirectories to be searched
00070                  recursively
00071
00072                The switch argument lets the user choose only to take
00073                  ownerships, only to edit ACLs, do both, or do neither, in
00074                  which case the sample merely reports on what ownerships
00075                  would have been taken, and what ACE's would have been
00076                  deleted
00077
00078                As the directories are walked, each file that matches the
00079                  file pattern is processed right then
00080
00081                Note that we process files in a directory, and we also process
00082                  the directory itself that contains the files.  We process
00083                  directories because they can also be owned by deleted
00084                  accounts, or could have ACEs that will no longer be used
00085
00086                Note also that we process all directories that we check for
00087                  files, regardless of the spelling of the directory name
00088
00089                Counters are kept of file ownerships taken, ACEs deleted and
00090                  total files checked, to print a summary line at the end of
00091                  the run
00092
00093                The sample considers it perfectly acceptable if 0 files match
00094                  the file pattern for the entire run
00095
00096
00097  FUNCTIONS:  DoMatchingFilesInOneDir
00098
00099                Look in one dir or sub-dir for files that match the file
00100                  pattern.  For each match call DoOneFileOrDir
00101
00102              DoAllDirsInOneDir
00103
00104                For all the sub-dirs in a dir, set the current directory to be
00105                  that directory, check for files that match the file pattern,
00106                  and if any match, call DoMatchingFilesInOneDir to process
00107                  those.  Then reset the current directory
00108
00109              GetFullFileOrDirName
00110
00111                Get the full name of the file or dir for simplified processing
00112                  (and for display on the console)
00113
00114              DoOneFileOrDir
00115
00116                Get the file's SD (Security Descriptor), and call
00117                  TakeOwnershipIfAppropriate and/or DeleteACEsAsAppropriate as
00118                  needed
00119
00120              TakeOwnershipIfAppropriate
00121
00122                Get the owning SID of the file from the file's SD that
00123                  DoOneFileOrDir passed in, check that SID to see if the
00124                  account is deleted.  If so, edit into the file's SD a new
00125                  owning SID (the SID of the process running the sample).
00126                  Then write the modified file SD to disk
00127
00128              DeleteACEsAsAppropriate
00129
00130                Get the DACL of the file from the file's SD that
00131                  DoOneFileOrDir passed in.  Walk through the ACE list for
00132                  that DACL, checking each ACE to see what SID the ACE refers
00133                  to.  For the SID referred to, check to see if the account is
00134                  deleted.  If so, delete that ACE from the DACL.  When all
00135                  ACE's have been examined, write the new DACL into the file's
00136                  SD.  Then write the modified file SD to disk
00137
00138              GetProcessSid
00139
00140                Retrieve into a global variable the SID of the user account
00141                  logged on when this sample is run.  This is the SID used by
00142                  TakeOwnershipIfAppropriate
00143
00144                NOTE:  This routine has the notable side-effect on the access
00145                  token of the curent process of enabling two privileges:
00146                  SeTakeOwnershipPrivilege, and SeSecurityPrivilege.
00147                  SeTakeOwnershipPrivilege is needed to ensure we can take
00148                  ownership in spite of any DACL on the file.
00149                  SeSecurityPrivilege is needed to work with SACLs
00150
00151              CrackArgs
00152
00153                Process the command line, cracking (parsing/decoding) the
00154                  switch argument into boolean global variables (see below).
00155                  Call DisplayHelp if anything illegal is found in the command
00156                  line, or if the user asked for help
00157
00158              DisplayHelp
00159
00160                Display help text on the console
00161
00162
00163  GLOBAL VARS:
00164              BOOL  bTakeOwnership
00165              BOOL  bEditACLs
00166              BOOL  bRecurse
00167              BOOL  bJustCount
00168
00169                These store the values the user specified on the command
00170                  line's first argument (the switches argument).
00171                  Respectively, they record whether we are to do the
00172                  processing to Take Ownerships, Edit ACLs, whether we are to
00173                  recurse into all subdirectories, and whether we are just
00174                  counting up what would be processed (in which case we take
00175                  no ownerships and edit no ACLs)
00176
00177              DWORD dwFilesChecked
00178              DWORD dwFilesOwned
00179              DWORD dwACEsDeleted
00180
00181                These count, respecively, the total files we checked, the
00182                  number of files we took ownership of (or would have if we
00183                  had not been told only to count), and the number of ACEs we
00184                  deleted (or would have if we had not been told only to
00185                  count).  Note that the total number of files checked does
00186                  not include files in the directories we process that do not
00187                  match the file pattern
00188
00189                Note, however, that we process directories regardless of
00190                  whether they match the file pattern
00191
00192              UCHAR ucProcessSIDBuf
00193              PSID  psidProcessOwnerSID
00194
00195                These store the SID of the account logged on as this sample
00196                  runs, and a pointer to that SID
00197
00198 *****************************************************************************/
00199
00200
00201 /****************************************************************************\
00202 *  INCLUDES, DEFINES, TYPEDEFS
00203 \****************************************************************************/
00204 #define STRICT
00205 #include <windows.h>
00206 #include <stdio.h>
00207 #include <string.h>
00208 #include <stdlib.h>
00209
00210 #define PERR(api) printf("%s: Error %d from %s on line %d\n",  \
00211     __FILE__, GetLastError(), api, __LINE__);
00212 #define PMSG(msg) printf("%s line %d: %s\n",  \
00213     __FILE__, __LINE__, msg);
00214
00215 #define PrintAppStyleAPIError(ApiTxt,MsgTxt) {                     \
00216   DWORD dwLastError;                                               \
00217   dwLastError = GetLastError();                                    \
00218   switch (dwLastError)                                             \
00219   { case ERROR_FILE_NOT_FOUND :                                    \
00220       printf("\nFile not found (%s) line %d",MsgTxt,__LINE__);     \
00221       break;                                                       \
00222     case ERROR_INVALID_NAME   :                                    \
00223       printf("\nInvalid name (%s) line %d",MsgTxt,__LINE__);       \
00224       break;                                                       \
00225     case ERROR_PATH_NOT_FOUND :                                    \
00226       printf("\nError path not found (%s) line %d",MsgTxt,__LINE__); \
00227       break;                                                       \
00228     case ERROR_SHARING_VIOLATION :                                 \
00229       printf("\nSharing violation - shut down net and/or stop other sessions (%s) line %d",MsgTxt,__LINE__); \
00230       break;                                                       \
00231     case ERROR_ACCESS_DENIED  :                                    \
00232       printf("\nAccess denied (%s) line %d",MsgTxt,__LINE__);      \
00233       break;                                                       \
00234     default                   :                                    \
00235       printf("\n" #ApiTxt " - unexpected return code=%d (%s) line %d",dwLastError,MsgTxt,__LINE__); \
00236       break;                                                       \
00237   }                                                                \
00238   }
00239
00240 /****************************************************************************\
00241 * GLOBAL VARIABLES
00242 \****************************************************************************/
00243
00244 BOOL  bTakeOwnership  = FALSE;
00245 BOOL  bEditACLs       = FALSE;
00246 BOOL  bRecurse        = FALSE;
00247 BOOL  bJustCount      = FALSE;
00248
00249 DWORD dwFilesChecked  = 0;
00250 DWORD dwFilesOwned    = 0;
00251 DWORD dwACEsDeleted   = 0;
00252
00253 PSID  psidProcessOwnerSID;
00254
00255
00256 /****************************************************************************\
00257 * FUNCTION PROTOTYPES
00258 \****************************************************************************/
00259
00260 BOOL DoMatchingFilesInOneDir(HANDLE          hFound,
00261                              WIN32_FIND_DATA ffdFoundData);
00262 BOOL DoAllDirsInOneDir(char *FilePattern);
00263 BOOL GetFullFileOrDirName(LPTSTR lpszFileName);
00264 BOOL DoOneFileOrDir(LPTSTR lpszFullName);
00265 BOOL TakeOwnershipIfAppropriate(PSECURITY_DESCRIPTOR psdFileSD,
00266                                 LPTSTR  lpszFullName);
00267 BOOL DeleteACEsAsAppropriate   (PSECURITY_DESCRIPTOR psdFileSD,
00268                                 LPTSTR  lpszFullName);
00269 BOOL GetProcessSid(VOID);
00270 BOOL CrackArgs(UINT argc, char *argv[]);
00271 VOID DisplayHelp(VOID);
00272
00273
00274 /****************************************************************************\
00275 *
00276 * FUNCTION: Main
00277 *
00278 \****************************************************************************/
00279
00280 UINT main(UINT argc, char *argv[])
00281 {
00282    WIN32_FIND_DATA ffdFoundData;
00283    HANDLE          hFound;
00284   #define                   SZ_NAME_BUF MAX_PATH
00285    UCHAR           ucPathBuf[SZ_NAME_BUF];
00286    LPTSTR          lpszFullName = (LPTSTR)&ucPathBuf;
00287
00288    /**************************************************************************\
00289    *
00290    * Store the process's SID in a global variable for later use (in taking
00291    *   ownership).
00292    *
00293    \**************************************************************************/
00294
00295    if (!GetProcessSid())
00296    {
00297       PERR("Can't proceed without process SID - see earlier error messages");
00298       return (1);
00299    }
00300
00301    if (!CrackArgs(argc,argv))
00302       return (1);
00303
00304    /**************************************************************************\
00305    *
00306    * CrackArgs has set our global processing switches, and proven argv[2] and
00307    *   argv[3] are our non-blank dir-spec and file-pattern strings.  Now we
00308    *   must see that the file-spec is acceptable to the Win32 api's.  Argv[2]
00309    *   is the file-spec to pass to SetCurrentDirectory, and argv[3] is the
00310    *   file-pattern to pass to FindFirstFile
00311    *
00312    * First we have to expand the dir-spec in argv[2], because if we set the
00313    *   current directory to it before expansion,the expansion will have a
00314    *   different result if argv[2] is something like ..\..
00315    *
00316    \**************************************************************************/
00317
00318    strncpy(lpszFullName, argv[2], SZ_NAME_BUF);
00319
00320    if (!GetFullFileOrDirName(lpszFullName))
00321    {
00322       PERR("Failed to expand to full name the 2nd argument (directory specification)");
00323       return (1);
00324    }
00325
00326    /**************************************************************************\
00327    *
00328    * Now we pass the un-expanded argv[2] to SetCurrentDirectory for validity
00329    *   checking.  GetFullPathName (called by GetFullFileOrDirName) does not
00330    *   validity check
00331    *
00332    \**************************************************************************/
00333
00334    if (!SetCurrentDirectory(argv[2]))
00335    {
00336       PrintAppStyleAPIError(SetCurrentDirectory,"2nd argument (directory specification)");
00337       return (1);
00338    }
00339
00340    /**************************************************************************\
00341    *
00342    * We begin processing with the current directory, using the expanded form we
00343    *   got before.  We have to use the expanded form, because if we set to
00344    *   ..\.. and then try to process the string ..\.. as a dir name, instead of
00345    *   processing the dir two levels up from where we are we'll process the dir
00346    *   four levels up
00347    *
00348    \**************************************************************************/
00349
00350    if (!DoOneFileOrDir(lpszFullName))
00351       return (1);
00352
00353    /**************************************************************************\
00354    *
00355    * It's OK to get no hits.  The files-checked counter will show how many
00356    *   files we looked at, and it's OK to look at 0
00357    *
00358    * On the else branch, Argv[3] has been verified, and we have a good handle.
00359    *   We now pass to DoMatchingFilesInOneDir for processing the handle and
00360    *   found data we just got from FindFirstFile
00361    *
00362    \**************************************************************************/
00363
00364    hFound = FindFirstFile(argv[3],
00365                           (LPWIN32_FIND_DATA)&ffdFoundData);
00366    if ((HANDLE)(-1) == hFound)
00367    {
00368       if (GetLastError() != ERROR_FILE_NOT_FOUND)
00369       {
00370          PrintAppStyleAPIError(FindFirstFile,"3rd argument");
00371          return (1);
00372       }
00373    }
00374    else if (!DoMatchingFilesInOneDir(hFound,ffdFoundData))
00375       return (1);
00376
00377    /**************************************************************************\
00378    *
00379    * Pass the original file pattern for recursive calling to DoAllDirsInOneDir
00380    *
00381    \**************************************************************************/
00382
00383    if (!DoAllDirsInOneDir(argv[3]))
00384       return (1);
00385
00386    if (bJustCount)
00387       printf("\nChecked %d files, would have taken ownership of %d files, would have deleted %d ACEs\n",
00388              dwFilesChecked,dwFilesOwned,dwACEsDeleted);
00389    else
00390       printf("\nChecked %d files, took ownership of %d files, deleted %d ACEs\n",
00391              dwFilesChecked,dwFilesOwned,dwACEsDeleted);
00392
00393    free(psidProcessOwnerSID);
00394
00395    return (0);
00396 }
00397
00398
00399 /****************************************************************************\
00400 *
00401 * FUNCTION: DoMatchingFilesInOneDir
00402 *
00403 \****************************************************************************/
00404
00405 BOOL DoMatchingFilesInOneDir(HANDLE          hFound,
00406                              WIN32_FIND_DATA ffdFoundData)
00407 {
00408    BOOL bDoneWithHandle = FALSE;
00409
00410    /**************************************************************************\
00411    *
00412    * Process all files referred to by the handle, but not including
00413    *   directories, because directories are handled with separate calls to
00414    *   DoOneFileOrDir.  Such separate calls are made as we are setting the
00415    *   current directory to be the directory to be processed
00416    *
00417    \**************************************************************************/
00418
00419    while (!bDoneWithHandle)
00420    {
00421       if (!(FILE_ATTRIBUTE_DIRECTORY & ffdFoundData.dwFileAttributes))
00422       {
00423          if (!DoOneFileOrDir(ffdFoundData.cFileName))
00424             return (FALSE);
00425       }
00426
00427       if (!FindNextFile(hFound,
00428                         (LPWIN32_FIND_DATA)&ffdFoundData))
00429          if (GetLastError() == ERROR_NO_MORE_FILES)
00430             bDoneWithHandle = TRUE;
00431          else
00432          {
00433             PrintAppStyleAPIError(FindNextFile,"on FindNext");
00434             return (FALSE);
00435          }
00436    }
00437    return TRUE;
00438 }
00439
00440
00441 /****************************************************************************\
00442 *
00443 * FUNCTION: DoAllDirsInOneDir
00444 *
00445 \****************************************************************************/
00446 BOOL DoAllDirsInOneDir(char *FilePattern)
00447 {
00448    HANDLE          hFound;
00449    WIN32_FIND_DATA ffdFoundData;
00450    BOOL            bDoneWithHandle = FALSE;
00451
00452    /**************************************************************************\
00453    *
00454    * If not recursing into dirs, simply return
00455    *
00456    \**************************************************************************/
00457
00458    if (!bRecurse)
00459       return TRUE;
00460
00461    /**************************************************************************\
00462    *
00463    * Since we are recursing, get a handle that points to entire directory, and
00464    *   walk the handle picking off only directories to recurse into
00465    *
00466    \**************************************************************************/
00467
00468    hFound = FindFirstFile("*.*",
00469                           (LPWIN32_FIND_DATA)&ffdFoundData);
00470    if ((HANDLE)(-1) == hFound)
00471    {
00472       PrintAppStyleAPIError(FindFirstFile,"on dir *.* FindFirst");
00473       return (FALSE);
00474    }
00475
00476    while (!bDoneWithHandle)
00477    {
00478       /************************************************************************\
00479       *
00480       * We only do dirs here, and we only do directories with textual names
00481       *   (i.e., not "." and not "..")
00482       *
00483       \************************************************************************/
00484
00485       if (   (FILE_ATTRIBUTE_DIRECTORY & ffdFoundData.dwFileAttributes)
00486              && (0 != strcmp("." ,ffdFoundData.cFileName))
00487              && (0 != strcmp("..",ffdFoundData.cFileName)))
00488       {
00489          HANDLE          hFile2;
00490          WIN32_FIND_DATA ffdFound2;
00491
00492          /**********************************************************************\
00493          *
00494          * We begin processing the new current directory by processing it itself,
00495          *   then setting the current dir to be the dir itself
00496          *
00497          \**********************************************************************/
00498
00499          if (!DoOneFileOrDir(ffdFoundData.cFileName))
00500             return (FALSE);
00501
00502          if (!SetCurrentDirectory(ffdFoundData.cFileName))
00503          {
00504             PrintAppStyleAPIError(SetCurrentDirectory,"recursive set");
00505             return (FALSE);
00506          }
00507
00508          /**********************************************************************\
00509          *
00510          * It's OK to get no hits.  The files-checked counter will show how many
00511          *   files we looked at, and it's OK to look at 0
00512          *
00513          \**********************************************************************/
00514
00515          hFile2 = FindFirstFile(FilePattern,
00516                                 (LPWIN32_FIND_DATA)&ffdFound2);
00517          if ((HANDLE)(-1) == hFile2)
00518          {
00519             if (GetLastError() != ERROR_FILE_NOT_FOUND)
00520             {
00521                PrintAppStyleAPIError(FindFirstFile,"during recursion");
00522                return (FALSE);
00523             }
00524          }
00525          else if (!DoMatchingFilesInOneDir(hFile2,ffdFound2))
00526             return (FALSE);
00527
00528          if (!DoAllDirsInOneDir(FilePattern))
00529             return (FALSE);
00530
00531          if (!SetCurrentDirectory(".."))
00532          {
00533             PrintAppStyleAPIError(SetCurrentDirectory,"un-recursive set");
00534             return (FALSE);
00535          }
00536       }
00537
00538       /************************************************************************\
00539       *
00540       * Get next recursion candidate (file or dir at this point, however at loop
00541       *   top files are screened out)
00542       *
00543       \************************************************************************/
00544
00545       if (!FindNextFile(hFound,
00546                         (LPWIN32_FIND_DATA)&ffdFoundData))
00547          if (GetLastError() == ERROR_NO_MORE_FILES)
00548             bDoneWithHandle = TRUE;
00549          else
00550          {
00551             PrintAppStyleAPIError(FindNextFile,"on dir *.* FindNext");
00552             return (FALSE);
00553          }
00554    }
00555    return (TRUE);
00556 }
00557
00558
00559 /****************************************************************************\
00560 *
00561 * FUNCTION: GetFullFileOrDirName
00562 *
00563 \****************************************************************************/
00564
00565 BOOL GetFullFileOrDirName(LPTSTR lpszFileName)
00566 {
00567    UCHAR   ucPathBuf[SZ_NAME_BUF];
00568    DWORD   dwSzReturned;
00569    LPTSTR  lpszLastNamePart;
00570    LPTSTR  lpszFullName;
00571
00572    dwSzReturned = GetFullPathName
00573                   (lpszFileName,
00574                    (DWORD)SZ_NAME_BUF,
00575                    (LPTSTR)&ucPathBuf,
00576                    (LPTSTR *)&lpszLastNamePart);
00577    if (0 == dwSzReturned)
00578       switch (GetLastError())
00579       {
00580       case ERROR_INVALID_NAME   :
00581          printf("\nError invalid file full-name (on GetFullPathName)");
00582          return (FALSE);
00583       default                   :
00584          PERR("GetFullPathName - unexpected return code");
00585          return (FALSE);
00586       }
00587
00588    if (dwSzReturned > SZ_NAME_BUF)
00589    {
00590       PERR("GetFullPathName - buffer too small");
00591       return (FALSE);
00592    }
00593
00594    lpszFullName = CharLower((LPTSTR)&ucPathBuf);
00595
00596    if (!lpszFullName)
00597    {
00598       PERR("CharLower failure");
00599       return (FALSE);
00600    }
00601
00602    /**************************************************************************\
00603    *
00604    * Copy the expanded and upper-case-shifted name to the buffer pointed to by
00605    *   the input argument
00606    *
00607    \**************************************************************************/
00608
00609    strcpy(lpszFileName,lpszFullName);
00610
00611    return (TRUE);
00612 }
00613
00614
00615 /****************************************************************************\
00616 *
00617 * FUNCTION: DoOneFileOrDir
00618 *
00619 \****************************************************************************/
00620
00621 BOOL DoOneFileOrDir(LPTSTR lpszFullName)
00622 {
00623   #define                                 SZ_REL_SD_BUF 1000
00624   #define                                 SZ_ABS_SD_BUF  500
00625   #define                                 SZ_DACL_BUF    500
00626   #define                                 SZ_SACL_BUF    500
00627   #define                                 SZ_SID_OWN_BUF 500
00628   #define                                 SZ_SID_PG_BUF  500
00629    UCHAR                ucBuf             [SZ_REL_SD_BUF];
00630    UCHAR                ucBufAbs          [SZ_ABS_SD_BUF];
00631    UCHAR                ucBufDacl         [SZ_DACL_BUF];
00632    UCHAR                ucBufSacl         [SZ_SACL_BUF];
00633    UCHAR                ucBufCtrl         [sizeof(PSECURITY_DESCRIPTOR_CONTROL)];
00634    UCHAR                ucBufSidOwn       [SZ_SID_OWN_BUF];
00635    UCHAR                ucBufSidPG        [SZ_SID_PG_BUF];
00636    DWORD                dwSDLength       = SZ_REL_SD_BUF;
00637    DWORD                dwDACLLength     = SZ_DACL_BUF;
00638    DWORD                dwSACLLength     = SZ_SACL_BUF;
00639    DWORD                dwSidOwnLength   = SZ_SID_OWN_BUF;
00640    DWORD                dwSidPGLength    = SZ_SID_PG_BUF;
00641    DWORD                dwSDLengthNeeded;
00642    PSECURITY_DESCRIPTOR psdSrelFileSD    = (PSECURITY_DESCRIPTOR)&ucBuf;
00643    PSECURITY_DESCRIPTOR psdAbsFileSD     = (PSECURITY_DESCRIPTOR)&ucBufAbs;
00644    PSECURITY_DESCRIPTOR_CONTROL psdcCtrl = (PSECURITY_DESCRIPTOR_CONTROL)&ucBufCtrl;
00645    PACL                 paclDacl         = (PACL)&ucBufDacl;
00646    PACL                 paclSacl         = (PACL)&ucBufSacl;
00647    PSID                 psidSidOwn       = (PSID)&ucBufSidOwn;
00648    PSID                 psidSidPG        = (PSID)&ucBufSidPG;
00649    BOOL                 bDaclPresent;
00650    BOOL                 bDaclDefaulted;
00651    BOOL                 bSaclPresent;
00652    BOOL                 bSaclDefaulted;
00653    BOOL                 bOwnerDefaulted;
00654    BOOL                 bGroupDefaulted;
00655    BOOL                 bSDSelfRelative;
00656    DWORD                dwRevision;
00657
00658    if (!GetFullFileOrDirName(lpszFullName))
00659       return (FALSE);
00660
00661    /**************************************************************************\
00662    *
00663    * Now the input argument's name is accurate:  it is expanded and lower-case
00664    *
00665    \**************************************************************************/
00666
00667    printf("\nChecking %s",lpszFullName);
00668
00669    dwFilesChecked++;
00670
00671    if (!GetFileSecurity
00672        (lpszFullName,
00673         (SECURITY_INFORMATION)( OWNER_SECURITY_INFORMATION
00674                                 | GROUP_SECURITY_INFORMATION
00675                                 | DACL_SECURITY_INFORMATION
00676                                 | SACL_SECURITY_INFORMATION),
00677         psdSrelFileSD,
00678         dwSDLength,
00679         (LPDWORD)&dwSDLengthNeeded))
00680    {
00681       PERR("GetFileSecurity");
00682       return (FALSE);
00683    }
00684
00685    /**************************************************************************\
00686    *
00687    * This validity check is here for demonstration pruposes.  It's not likely a
00688    *   real app would need to check the validity of this returned SD.  The
00689    *   validity check APIs are more intended to check validity after app code
00690    *   has manipulated the structure and is about to hand it back to the system
00691    *
00692    \**************************************************************************/
00693
00694    if (!IsValidSecurityDescriptor(psdSrelFileSD))
00695    {
00696       PERR("IsValidSecurityDescriptor said bad SD");
00697       return (FALSE);
00698    }
00699
00700    /**************************************************************************\
00701    *
00702    *  Build File SD in absolute format for potential later modification
00703    *
00704    *  First Initialize a new SD, which is by definition in absolute format
00705    *
00706    *  Then Set in the fields from the relative format SD we just fetched
00707    *
00708    \**************************************************************************/
00709
00710    if (!InitializeSecurityDescriptor(psdAbsFileSD,
00711                                      SECURITY_DESCRIPTOR_REVISION))
00712    {
00713       PERR("InitializeSecurityDescriptor");
00714       return FALSE;
00715    }
00716
00717    /**************************************************************************\
00718    *
00719    * Get Control from relative format File SD
00720    *
00721    * This control info isn't much queried in the code that follows, as the
00722    *   Get/Set calls are more convienent in this case, but it does give us a
00723    *   change to verify that the SD is in relative format
00724    *
00725    \**************************************************************************/
00726
00727    if (!GetSecurityDescriptorControl(psdSrelFileSD,
00728                                      psdcCtrl,
00729                                      &dwRevision))
00730    {
00731       PERR("GetSecurityDescriptorControl");
00732       return FALSE;
00733    }
00734
00735    bSDSelfRelative = (SE_SELF_RELATIVE & *psdcCtrl);
00736
00737    /**************************************************************************\
00738    *
00739    * Set DACL into absolute format File SD
00740    *
00741    * Note that it is possible that a NULL DACL has been explictly specified.
00742    *   If so the Get/Set call pair will correctly map that into the absolute
00743    *   format SD
00744    *
00745    * The next if statement isn't necessary, it simply shows the relationship
00746    *   between SE_DACL_PRESENT and SE_DACL_DEFAULTED, and lets you trace
00747    *   through with the debugger
00748    *
00749    \**************************************************************************/
00750
00751    if (bDaclPresent = (SE_DACL_PRESENT   & *psdcCtrl))
00752    {                // SE_DACL_DEFAULTED ignored if SE_DACL_PRESENT not set
00753       bDaclDefaulted = (SE_DACL_DEFAULTED & *psdcCtrl);
00754    }
00755    else
00756    { // No DACL at all
00757
00758    }
00759
00760    if (!GetSecurityDescriptorDacl(psdSrelFileSD,
00761                                   &bDaclPresent,      // fDaclPresent flag
00762                                   &paclDacl,
00763                                   &bDaclDefaulted))   // is/is not a default DACL
00764    {
00765       PERR("GetSecurityDescriptorDacl");
00766       return FALSE;
00767    }
00768    if (!SetSecurityDescriptorDacl(psdAbsFileSD,
00769                                   bDaclPresent,       // fDaclPresent flag
00770                                   paclDacl,
00771                                   bDaclDefaulted))    // is/is not a default DACL
00772    {
00773       PERR("SetSecurityDescriptorDacl");
00774       return FALSE;
00775    }
00776
00777    /**************************************************************************\
00778    *
00779    * Set SACL into absolute format File SD
00780    *
00781    * Note that it is possible that a NULL SACL has been explictly specified.
00782    *   If so the Get/Set call pair will correctly map that into the absolute
00783    *   format SD
00784    *
00785    * The next if statement isn't necessary, it simply shows the relationship
00786    *   between SE_SACL_PRESENT and SE_SACL_DEFAULTED, and lets you trace
00787    *   through with the debugger
00788    *
00789    \**************************************************************************/
00790
00791    if (bSaclPresent = (SE_SACL_PRESENT   & *psdcCtrl))
00792    {                // SE_SACL_DEFAULTED ignored if SE_SACL_PRESENT not set
00793       bSaclDefaulted = (SE_SACL_DEFAULTED & *psdcCtrl);
00794    }
00795    else
00796    { // No SACL at all
00797
00798    }
00799
00800    if (!GetSecurityDescriptorSacl(psdSrelFileSD,
00801                                   &bSaclPresent,      // fSaclPresent flag
00802                                   &paclSacl,
00803                                   &bSaclDefaulted))   // is/is not a default SACL
00804    {
00805       PERR("GetSecurityDescriptorSacl");
00806       return FALSE;
00807    }
00808    if (!SetSecurityDescriptorSacl(psdAbsFileSD,
00809                                   bSaclPresent,       // fSaclPresent flag
00810                                   paclSacl,
00811                                   bSaclDefaulted))    // is/is not a default SACL
00812    {
00813       PERR("SetSecurityDescriptorSacl");
00814       return FALSE;
00815    }
00816
00817    /**************************************************************************\
00818    *
00819    * Set Owner into absolute format File SD
00820    *
00821    * The next if statement isn't necessary, it simply let's you trace through
00822    *   with the debugger
00823    *
00824    \**************************************************************************/
00825
00826    bOwnerDefaulted = (SE_OWNER_DEFAULTED & *psdcCtrl);
00827
00828    if (!GetSecurityDescriptorOwner(psdSrelFileSD,
00829                                    &psidSidOwn,
00830                                    &bOwnerDefaulted))   // is/is not a default Owner
00831    {
00832       PERR("GetSecurityDescriptorOwner");
00833       return FALSE;
00834    }
00835    if (!SetSecurityDescriptorOwner(psdAbsFileSD,
00836                                    psidSidOwn,
00837                                    bOwnerDefaulted))    // is/is not a default Owner
00838    {
00839       PERR("SetSecurityDescriptorOwner");
00840       return FALSE;
00841    }
00842
00843    /**************************************************************************\
00844    *
00845    * Set Group into absolute format File SD
00846    *
00847    * The next if statement isn't necessary, it simply let's you trace through
00848    *   with the debugger
00849    *
00850    \**************************************************************************/
00851
00852    bGroupDefaulted = (SE_GROUP_DEFAULTED & *psdcCtrl);
00853
00854    if (!GetSecurityDescriptorGroup(psdSrelFileSD,
00855                                    &psidSidOwn,
00856                                    &bGroupDefaulted))   // is/is not a default Group
00857    {
00858       PERR("GetSecurityDescriptorGroup");
00859       return FALSE;
00860    }
00861    if (!SetSecurityDescriptorGroup(psdAbsFileSD,
00862                                    psidSidOwn,
00863                                    bGroupDefaulted))    // is/is not a default Group
00864    {
00865       PERR("SetSecurityDescriptorGroup");
00866       return FALSE;
00867    }
00868
00869    /**************************************************************************\
00870    *
00871    * This validity check is here for demonstration pruposes.  It's not likely a
00872    *   real app would need to check the validity of the SD after it was just
00873    *   built into absolute format.  The validity check APIs are more intended
00874    *   to check validity after app code has manipulated the structure and is
00875    *   about to hand it back to the system
00876    *
00877    * One thing to notice is that IsValidSecurityDescriptor will succeed on both
00878    *   self-relative and absolute format SDs.  However, some other api's, such
00879    *   as SetSecurityDescriptorOwner, require the SD to be in a certain format,
00880    *   and will give a return code of Invalid SD if the SD passed to the api is
00881    *   valid, but in the wrong format.  In other words, when an api such as
00882    *   SetSecurityDescriptorOwner gives the retun code Invalid SD, this doesn't
00883    *   mean the SD passed in was necessarily invalid.  It might have been in
00884    *   the wrong format
00885    *
00886    \**************************************************************************/
00887
00888    if (!IsValidSecurityDescriptor(psdAbsFileSD))
00889    {
00890       PERR("IsValidSecurityDescriptor said bad SD");
00891       return (FALSE);
00892    }
00893
00894    if (bTakeOwnership)
00895       if (!TakeOwnershipIfAppropriate(psdAbsFileSD,lpszFullName))
00896          return (FALSE);
00897
00898    if (bEditACLs)
00899       if (!DeleteACEsAsAppropriate   (psdAbsFileSD,lpszFullName))
00900          return (FALSE);
00901
00902    return (TRUE);
00903 }
00904
00905
00906 /****************************************************************************\
00907 *
00908 * FUNCTION: TakeOwnershipIfAppropriate
00909 *
00910 \****************************************************************************/
00911
00912 BOOL TakeOwnershipIfAppropriate(PSECURITY_DESCRIPTOR psdFileSD,
00913                                 LPTSTR  lpszFullName)
00914 {
00915    PSID psidFileOwnerSID;
00916    {
00917       BOOL  bOwnerDefaulted;
00918
00919       if (!GetSecurityDescriptorOwner
00920           (psdFileSD,
00921            (PSID *)&psidFileOwnerSID,
00922            (LPBOOL)&bOwnerDefaulted))
00923       {
00924          PERR("GetSecurityDescriptorOwner");
00925          return (FALSE);
00926       }
00927
00928       /************************************************************************\
00929       *
00930       * This validity check is here for demonstration pruposes.  It's not likely
00931       *   a real app would need to check the validity of this returned SID.  The
00932       *   validity check APIs are more intended to check validity after app code
00933       *   has manipulated the structure and is about to hand it back to the
00934       *   system
00935       *
00936       \************************************************************************/
00937
00938       if (!IsValidSid(psidFileOwnerSID))
00939       {
00940          PERR("IsValidSid said bad SID!");
00941          return (FALSE);
00942       }
00943    }
00944
00945    {
00946       DWORD        dwLastError   = NO_ERROR;
00947     #define                      SZ_ACCT_NAME_BUF 1000
00948       UCHAR        ucNameBuf      [SZ_ACCT_NAME_BUF];
00949       DWORD        dwNameLength  = SZ_ACCT_NAME_BUF;
00950     #define                      SZ_DMN_NAME_BUF  1000
00951       UCHAR        ucDomainNmBuf  [SZ_DMN_NAME_BUF ];
00952       DWORD        dwDNameLength = SZ_DMN_NAME_BUF ;
00953       SID_NAME_USE peAcctNameUse;
00954
00955       if (!LookupAccountSid
00956           ((LPTSTR)"",             // Look on local machine
00957            psidFileOwnerSID,
00958            (LPTSTR)&ucNameBuf,
00959            (LPDWORD)&dwNameLength,
00960            (LPTSTR)&ucDomainNmBuf,
00961            (LPDWORD)&dwDNameLength,
00962            (PSID_NAME_USE)&peAcctNameUse))
00963       {
00964          dwLastError = GetLastError();
00965          if (ERROR_NONE_MAPPED != dwLastError)
00966          {
00967             PERR("LookupAccountSID");
00968             return (FALSE);
00969          }
00970       }
00971
00972       /************************************************************************\
00973       *
00974       * If deleted account, take ownership.  This routine's caller checked the
00975       *   global switches that said we are in take ownership mode
00976       *
00977       * In some cases, the account lookup will fail with ERROR_NONE_MAPPED,
00978       *   meaning there is no deleted account mapped to the SID, in which case
00979       *   we also take ownership
00980       *
00981       *   We check that first to avoid referencing peAcctNameUse, which in that
00982       *     case is not set
00983       *
00984       \************************************************************************/
00985
00986       if (  (ERROR_NONE_MAPPED == dwLastError)
00987             || (SidTypeDeletedAccount == peAcctNameUse))
00988       {
00989          dwFilesOwned++;
00990
00991          if (bJustCount)
00992          {
00993             printf(" - would have taken ownership");
00994             return (TRUE);
00995          }
00996          else
00997          {
00998             /********************************************************************\
00999             *
01000             * Modify the SD in virtual memory.  No check on the new owning SID
01001             *   here, because we validity checked it when we fetched it in
01002             *   GetProcessSid
01003             *
01004             \********************************************************************/
01005
01006             if (!SetSecurityDescriptorOwner
01007                 (psdFileSD,
01008                  psidProcessOwnerSID,
01009                  FALSE))               // New owner explicitly specified
01010             {
01011                PERR("SetSecurityDescriptorOwner");
01012                return (FALSE);
01013             }
01014
01015             /********************************************************************\
01016             *
01017             *  This validity check is something a real app might actually like to
01018             *    do.  We manupulated the SD, so before we write it back out to the
01019             *    file system, a check is worth considering.
01020             *
01021             \********************************************************************/
01022
01023             if (!IsValidSecurityDescriptor(psdFileSD))
01024             {
01025                PERR("IsValidSecurityDescriptor said bad SD");
01026                return (FALSE);
01027             }
01028
01029             /********************************************************************\
01030             *
01031             * Modify the SD on the hard disk
01032             *
01033             \********************************************************************/
01034
01035             if (!SetFileSecurity
01036                 (lpszFullName,
01037                  (SECURITY_INFORMATION)OWNER_SECURITY_INFORMATION,
01038                  psdFileSD))
01039             {
01040                PERR("SetFileSecurity");
01041                return (FALSE);
01042             }
01043
01044             printf(" - took ownership");
01045          }
01046       }
01047    }
01048
01049    return (TRUE);
01050
01051 }
01052
01053
01054 /****************************************************************************\
01055 *
01056 * FUNCTION: DeleteACEsAsAppropriate
01057 *
01058 \****************************************************************************/
01059
01060 BOOL DeleteACEsAsAppropriate(PSECURITY_DESCRIPTOR psdFileSD,
01061                              LPTSTR  lpszFullName)
01062 {
01063    PACL                 paclFile;
01064    BOOL                 bHasACL;
01065    BOOL                 bOwnerDefaulted;
01066    DWORD                dwAcl_i;
01067    DWORD                dwACEsDeletedBeforeNow;
01068
01069    ACL_SIZE_INFORMATION                      asiAclSize;
01070    DWORD                dwBufLength = sizeof(asiAclSize);
01071    ACCESS_ALLOWED_ACE   *paaAllowedAce;
01072
01073    if (!GetSecurityDescriptorDacl(psdFileSD,
01074                                   (LPBOOL)&bHasACL,
01075                                   (PACL *)&paclFile,
01076                                   (LPBOOL)&bOwnerDefaulted))
01077    {
01078       PERR("GetSecurityDescriptorDacl");
01079       return (FALSE);
01080    }
01081
01082    if (!bHasACL)  // No ACL to process, so OK, return
01083       return (TRUE);
01084
01085    /**************************************************************************\
01086    *
01087    * This validity check is here for demonstration pruposes.  It's not likely a
01088    *   real app would need to check the validity of this returned ACL.  The
01089    *   validity check APIs are more intended to check validity after app code
01090    *   has manipulated the structure and is about to hand it back to the system
01091    *
01092    \**************************************************************************/
01093
01094    if (!IsValidAcl(paclFile))
01095    {
01096       PERR("IsValidAcl said bad ACL!");
01097       return (FALSE);
01098    }
01099
01100    if (!GetAclInformation(paclFile,
01101                           (LPVOID)&asiAclSize,
01102                           (DWORD)dwBufLength,
01103                           (ACL_INFORMATION_CLASS)AclSizeInformation))
01104    {
01105       PERR("GetAclInformation");
01106       return (FALSE);
01107    }
01108
01109    dwACEsDeletedBeforeNow = dwACEsDeleted;
01110
01111    /**************************************************************************\
01112    *
01113    * We loop through in reverse order, because that's simpler, given that we
01114    *   potentially delete ACEs as we loop through.  If started at 0 and went
01115    *   up, if we deleted the 0th ACE, then the 1th ACE would become the 0th,
01116    *   and we'd have to check the 0th ACE again
01117    *
01118    \**************************************************************************/
01119
01120    for (dwAcl_i = asiAclSize.AceCount-1;  ((int)dwAcl_i) >= 0;  dwAcl_i--)
01121    {
01122       /************************************************************************\
01123       *
01124       * It doesn't matter for this sample that we don't yet know the ACE type,
01125       *   because they all start with the header field and that's what we need
01126       *
01127       \************************************************************************/
01128
01129       if (!GetAce(paclFile,
01130                   dwAcl_i,
01131                   (LPVOID *)&paaAllowedAce))
01132       {
01133          PERR("GetAce");
01134          return (FALSE);
01135       }
01136
01137       /************************************************************************\
01138       *
01139       * There are only four Ace Types pre-defined, so this next check is
01140       *   redundant in a real app, but useful as a sanity check and a
01141       *   demonstration in a sample
01142       *
01143       \************************************************************************/
01144
01145       if (!( (paaAllowedAce->Header.AceType == ACCESS_ALLOWED_ACE_TYPE)
01146              ||(paaAllowedAce->Header.AceType == ACCESS_DENIED_ACE_TYPE )
01147              ||(paaAllowedAce->Header.AceType == SYSTEM_AUDIT_ACE_TYPE  )
01148              ||(paaAllowedAce->Header.AceType == SYSTEM_ALARM_ACE_TYPE  )))
01149       {
01150          PERR("Invalid AceType");
01151          return (FALSE);
01152       }
01153
01154       { // Find SID of ACE, check if acct deleted
01155
01156          UCHAR        ucNameBuf      [SZ_ACCT_NAME_BUF];
01157          DWORD        dwNameLength  = SZ_ACCT_NAME_BUF;
01158          UCHAR        ucDomainNmBuf  [SZ_DMN_NAME_BUF];
01159          DWORD        dwDNameLength = SZ_DMN_NAME_BUF;
01160          SID_NAME_USE peAcctNameUse;
01161          DWORD        dwLastError   = NO_ERROR;
01162
01163          /**********************************************************************\
01164          *
01165          * This validity check is here for demonstration pruposes.  It's not
01166          *   likely a real app would need to check the validity of the SID
01167          *   contained in the returned ACL.  The validity check APIs are more
01168          *   intended to check validity after app code has manipulated the
01169          *   structure and is about to hand it back to the system
01170          *
01171          \**********************************************************************/
01172
01173          if (!IsValidSid((PSID)&(paaAllowedAce->SidStart)))
01174          {
01175             PERR("IsValidSid said bad SID!");
01176             return (FALSE);
01177          }
01178
01179          if (!LookupAccountSid
01180              ((LPTSTR)"",         // Look on local machine
01181               (PSID)&(paaAllowedAce->SidStart),
01182               (LPTSTR)&ucNameBuf,
01183               (LPDWORD)&dwNameLength,
01184               (LPTSTR)&ucDomainNmBuf,
01185               (LPDWORD)&dwDNameLength,
01186               (PSID_NAME_USE)&peAcctNameUse))
01187          {
01188             dwLastError = GetLastError();
01189             if (ERROR_NONE_MAPPED != dwLastError)
01190             {
01191                PERR("LookupAccountSID");
01192                return (FALSE);
01193             }
01194          }
01195
01196          if (  (ERROR_NONE_MAPPED == dwLastError)
01197                || (SidTypeDeletedAccount == peAcctNameUse))
01198          {
01199             dwACEsDeleted++;
01200
01201             if (bJustCount)
01202             {
01203                printf(" - would have edited ACL");
01204                return (TRUE);
01205             }
01206
01207             if (!DeleteAce(paclFile,dwAcl_i))
01208             {
01209                PERR("DeleteAce");
01210                return (FALSE);
01211             }
01212          }
01213       }
01214    }
01215
01216    if (dwACEsDeletedBeforeNow < dwACEsDeleted)
01217    {
01218       /************************************************************************\
01219       *
01220       * This validity check is something a real app might actually like to do.
01221       *   We manupulated the ACL, so before we write it back into an SD, a check
01222       *   is worth considering
01223       *
01224       \************************************************************************/
01225
01226       if (!IsValidAcl(paclFile))
01227       {
01228          PERR("IsValidAcl said bad ACL!");
01229          return (FALSE);
01230       }
01231
01232       /************************************************************************\
01233       *
01234       * Modify the SD in virtual memory
01235       *
01236       \************************************************************************/
01237
01238       if (!SetSecurityDescriptorDacl
01239           (psdFileSD,
01240            TRUE,                 // Yes, set the DACL
01241            paclFile,
01242            FALSE))               // New DACL explicitly specified
01243       {
01244          PERR("SetSecurityDescriptorDacl");
01245          return (FALSE);
01246       }
01247
01248       /************************************************************************\
01249       *
01250       * This validity check is something a real app might actually like to do.
01251       *   We manupulated the SD, so before we write it back out to the file
01252       *   system, a check is worth considering
01253       *
01254       \************************************************************************/
01255
01256       if (!IsValidSecurityDescriptor(psdFileSD))
01257       {
01258          PERR("IsValidSecurityDescriptor said bad SD");
01259          return (FALSE);
01260       }
01261
01262       /************************************************************************\
01263       *
01264       * Modify the SD on the hard disk
01265       *
01266       \************************************************************************/
01267
01268       if (!SetFileSecurity
01269           (lpszFullName,
01270            (SECURITY_INFORMATION)DACL_SECURITY_INFORMATION,
01271            psdFileSD))
01272       {
01273          PERR("SetFileSecurity");
01274          return (FALSE);
01275       }
01276
01277       printf(" - edited ACL");
01278    }
01279
01280    return (TRUE);
01281
01282 }
01283
01284
01285 /****************************************************************************\
01286 *
01287 * FUNCTION: GetProcessSid
01288 *
01289 \****************************************************************************/
01290
01291 BOOL GetProcessSid(VOID)
01292 {
01293    HANDLE               hProcess;
01294    PSECURITY_DESCRIPTOR psdProcessSD;
01295    PSID                 psidProcessOwnerSIDTemp;
01296
01297    UCHAR                ucBuf       [SZ_REL_SD_BUF];
01298    DWORD                dwSDLength = SZ_REL_SD_BUF;
01299    DWORD                dwSDLengthNeeded;
01300    BOOL                 bOwnerDefaulted;
01301
01302    hProcess = GetCurrentProcess();
01303
01304    if (!hProcess)
01305    {
01306       PERR("GetCurrentProcess");
01307       return (FALSE);
01308    }
01309
01310    psdProcessSD = (PSECURITY_DESCRIPTOR)ucBuf;
01311
01312    if (!GetKernelObjectSecurity
01313        (hProcess,
01314         (SECURITY_INFORMATION)(OWNER_SECURITY_INFORMATION),
01315         psdProcessSD,
01316         dwSDLength,
01317         (LPDWORD)&dwSDLengthNeeded))
01318    {
01319       PERR("GetKernelObjectSecurity on current process handle");
01320       return (FALSE);
01321    }
01322
01323    /**************************************************************************\
01324    *
01325    * This validity check is here for demonstration purposes.  It's not likely a
01326    *   real app would need to check the validity of this returned SD.  The
01327    *   validity check APIs are more intended to check validity after app code
01328    *   has manipulated the structure and is about to hand it back to the system
01329    *
01330    \**************************************************************************/
01331
01332    if (!IsValidSecurityDescriptor(psdProcessSD))
01333    {
01334       PERR("IsValidSecurityDescriptor said bad SD");
01335       return (FALSE);
01336    }
01337
01338    if (!GetSecurityDescriptorOwner
01339        (psdProcessSD,
01340         (PSID *)&psidProcessOwnerSIDTemp,
01341         (LPBOOL)&bOwnerDefaulted))
01342    {
01343       PERR("GetSecurityDescriptorOwner of current process");
01344       return (FALSE);
01345    }
01346
01347    /**************************************************************************\
01348    *
01349    * This validity check is here for demonstration pruposes.  It's not likely a
01350    *   real app would need to check the validity of this returned SID.  The
01351    *   validity check APIs are more intended to check validity after app code
01352    *   has manipulated the structure and is about to hand it back to the system
01353    *
01354    \**************************************************************************/
01355
01356    if (!IsValidSid(psidProcessOwnerSIDTemp))
01357    {
01358       PERR("IsValidSid said bad process SID!");
01359       return (FALSE);
01360    }
01361
01362    /**************************************************************************\
01363    *
01364    * On the other hand, we are about to call GetLengthSid on the returned SID,
01365    *   and calling GetLengthSid with an invalid SID is a bad idea, since then
01366    *   GetLengthSid's result is undefined, and an undefined result is hard to
01367    *   handle cleanly.  So, even in a real app, the above check on SID validity
01368    *   is a good idea to ensure the result GetLengthSid returns is valid
01369    *
01370    * It should be clear that the reason why the CopySid below is needed is that
01371    *   in the current routine the SID of the current process is on the stack
01372    *   (in the SD structure), so we have to copy the SID to static storage
01373    *   before the current routine returns
01374    *
01375    \**************************************************************************/
01376
01377    { DWORD dwSIDLengthNeeded;
01378
01379       dwSIDLengthNeeded = GetLengthSid(psidProcessOwnerSIDTemp);
01380
01381       psidProcessOwnerSID = malloc(dwSIDLengthNeeded);
01382
01383       if (NULL == psidProcessOwnerSID)
01384          PERR("GetProcessSid - ran out of heap space");
01385
01386       if (!CopySid(dwSIDLengthNeeded,
01387                    psidProcessOwnerSID,
01388                    psidProcessOwnerSIDTemp))
01389       {
01390          PERR("CopySid");
01391          free(psidProcessOwnerSID);
01392          return (FALSE);
01393       }
01394    }
01395
01396
01397    /**************************************************************************\
01398    *
01399    * This validity check is here for demonstration pruposes only (see above).
01400    *
01401    \**************************************************************************/
01402
01403    if (!IsValidSid(psidProcessOwnerSID))
01404    {
01405       PERR("IsValidSid said bad process SID!");
01406       free(psidProcessOwnerSID);
01407       return (FALSE);
01408    }
01409
01410
01411    /**************************************************************************\
01412    *
01413    * Now ensure that two privileges are enabled in the access token of the
01414    *   current process
01415    *
01416    \**************************************************************************/
01417
01418    { HANDLE           hAccessToken;
01419       LUID             luidPrivilegeLUID;
01420       TOKEN_PRIVILEGES tpTokenPrivilege;
01421
01422       if (!OpenProcessToken(hProcess,
01423                             TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
01424                             &hAccessToken))
01425       {
01426          PERR("OpenProcessToken");
01427          free(psidProcessOwnerSID);
01428          return (FALSE);
01429       }
01430
01431       /************************************************************************\
01432       *
01433       * Get LUID of SeTakeOwnershipPrivilege privilege
01434       *
01435       \************************************************************************/
01436
01437       if (!LookupPrivilegeValue(NULL,
01438                                 "SeTakeOwnershipPrivilege",
01439                                 &luidPrivilegeLUID))
01440       {
01441          PERR("LookupPrivilegeValue");
01442          printf("\nThe above error means you need to use User Manager (menu item");
01443          printf("\n  Policies\\UserRights) to turn on the 'Take ownership of...' ");
01444          printf("\n  privilege, log off, log back on");
01445          free(psidProcessOwnerSID);
01446          return (FALSE);
01447       }
01448
01449       /************************************************************************\
01450       *
01451       * Enable the SeTakeOwnershipPrivilege privilege using the LUID just
01452       *   obtained
01453       *
01454       \************************************************************************/
01455
01456       tpTokenPrivilege.PrivilegeCount = 1;
01457       tpTokenPrivilege.Privileges[0].Luid = luidPrivilegeLUID;
01458       tpTokenPrivilege.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
01459
01460       AdjustTokenPrivileges (hAccessToken,
01461                              FALSE,  // Do not disable all
01462                              &tpTokenPrivilege,
01463                              sizeof(TOKEN_PRIVILEGES),
01464                              NULL,   // Ignore previous info
01465                              NULL);  // Ignore previous info
01466
01467       if ( GetLastError() != NO_ERROR )
01468       {
01469          PERR("AdjustTokenPrivileges");
01470          free(psidProcessOwnerSID);
01471          return (FALSE);
01472       }
01473
01474       /************************************************************************\
01475       *
01476       * Get LUID of SeSecurityPrivilege privilege
01477       *
01478       \************************************************************************/
01479
01480       if (!LookupPrivilegeValue(NULL,
01481                                 "SeSecurityPrivilege",
01482                                 &luidPrivilegeLUID))
01483       {
01484          PERR("LookupPrivilegeValue");
01485          printf("\nThe above error means you need to log on as an Administrator");
01486          free(psidProcessOwnerSID);
01487          return (FALSE);
01488       }
01489
01490       /************************************************************************\
01491       *
01492       * Enable the SeSecurityPrivilege privilege using the LUID just
01493       *   obtained
01494       *
01495       \************************************************************************/
01496
01497       tpTokenPrivilege.PrivilegeCount = 1;
01498       tpTokenPrivilege.Privileges[0].Luid = luidPrivilegeLUID;
01499       tpTokenPrivilege.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
01500
01501       AdjustTokenPrivileges (hAccessToken,
01502                              FALSE,  // Do not disable all
01503                              &tpTokenPrivilege,
01504                              sizeof(TOKEN_PRIVILEGES),
01505                              NULL,   // Ignore previous info
01506                              NULL);  // Ignore previous info
01507
01508       if ( GetLastError() != NO_ERROR )
01509       {
01510          PERR("AdjustTokenPrivileges");
01511          free(psidProcessOwnerSID);
01512          return (FALSE);
01513       }
01514
01515    }
01516
01517    return (TRUE);
01518
01519 }
01520
01521
01522 /****************************************************************************\
01523 *
01524 * FUNCTION: CrackArgs
01525 *
01526 \****************************************************************************/
01527
01528 BOOL CrackArgs(UINT argc, char *argv[])
01529 {
01530    char *p;
01531
01532    /**************************************************************************\
01533    *
01534    * There must be three arguments
01535    *
01536    \**************************************************************************/
01537
01538    if (argc != 4)
01539    {
01540       DisplayHelp();
01541       return (FALSE);
01542    }
01543
01544    p=argv[1];
01545
01546    /**************************************************************************\
01547    *
01548    * The switch argument must be 2-5 chars long
01549    *
01550    \**************************************************************************/
01551
01552    if ((strlen(p) < 2) || (strlen(p) > 5))
01553    {
01554       DisplayHelp();
01555       return (FALSE);
01556    }
01557
01558    /**************************************************************************\
01559    *
01560    * The first char in the switch argument must be /
01561    *
01562    \**************************************************************************/
01563
01564    if ('/' != *p)
01565    {
01566       DisplayHelp();
01567       return (FALSE);
01568    }
01569
01570    /**************************************************************************\
01571    *
01572    * Chars 2-5 of the switch argument must be O or A or R or C
01573    *
01574    \**************************************************************************/
01575
01576    for (p=p+1; *p; p++)
01577       switch (*p)
01578       {
01579       case 'o':
01580       case 'O':
01581          bTakeOwnership = TRUE;
01582          break;
01583       case 'a':
01584       case 'A':
01585          bEditACLs      = TRUE;
01586          break;
01587       case 'r':
01588       case 'R':
01589          bRecurse       = TRUE;
01590          break;
01591       case 'c':
01592       case 'C':
01593          bJustCount     = TRUE;
01594          break;
01595       default :
01596          DisplayHelp();
01597          return (FALSE);
01598       }
01599
01600    /**************************************************************************\
01601    *
01602    * Have to say one of O or A
01603    *
01604    \**************************************************************************/
01605
01606    if (!(bTakeOwnership || bEditACLs))
01607    {
01608       DisplayHelp();
01609       return (FALSE);
01610    }
01611
01612    return (TRUE);
01613 }
01614
01615
01616 /****************************************************************************\
01617 *
01618 * FUNCTION: DisplayHelp
01619 *
01620 \****************************************************************************/
01621
01622 VOID DisplayHelp(VOID)
01623 {
01624    printf("\nTo run type SIDCLEAN and 3 parameters.  Syntax:");
01625    printf("\n  SIDCLEAN /roah dirspec filepattern");
01626    printf("\n           /r    Recursively process subdirectories");
01627    printf("\n           /o    For any files matching filepattern: Take ownership if");
01628    printf("\n                   file currently owned by any deleted SID");
01629    printf("\n           /a    For any files matching filepattern: Edit ACL, deleting");
01630    printf("\n                   ACEs associated with any deleted SID");
01631    printf("\n           /c    Overrides /o and /a, causes counts of /a or /o actions that");
01632    printf("\n                   would take place if /c not used.  Counts always displayed");
01633    printf("\n           /h    Override other switch values, just display this message\n");
01634    printf("\n                 . and .. syntax allowed in dirspec");
01635    printf("\n                 * and ? wildcards allowed in filepattern");
01636    printf("\n                 Switch letters can be in any order, upper or lower case");
01637    printf("\nExamples:");
01638    printf("\n  SIDCLEAN /o  .  *.*  Take ownership of all files (but not subdirs) in ");
01639    printf("\n                         current dir that are owned by any deleted SID");
01640    printf("\n  SIDCLEAN /a  .  *.*  For any file in current dir (but not subdirs), delete");
01641    printf("\n                         any ACL info that is associated with any deleted SID");
01642    printf("\n  SIDCLEAN /ro .  *.*  Same as first  example, but also recursively process");
01643    printf("\n                         subdirectories");
01644    printf("\n  SIDCLEAN /ar .  *.*  Same as second example, but also recursively process");
01645    printf("\n                         subdirectories");
01646    printf("\n  SIDCLEAN /O  \\  *.*  Same as first  example, but process files in root");
01647    printf("\n                         of current drive");
01648    printf("\n  SIDCLEAN /oC .. *.*  Same as first  example, but looks at files in dir");
01649    printf("\n                         containing current dir, processes nothing, just counts");
01650    printf("\n  SIDCLEAN /A d:\\ *.*  Same as second example, but process files in root");
01651    printf("\n                         of D: drive");
01652    printf("\n  SIDCLEAN             Displays this message");
01653    printf("\n  SIDCLEAN /h          Displays this message (so do ? -? /? -h -H /H)\n");
01654    printf("\nThis utility must be run while logged on as Administrator\n");
01655
01656    return;
01657 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_IID Member List

This is the complete list of members for _IID, including all inherited members.
c | _IID
s1 | _IID
s2 | _IID
x | _IID
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/HtmlScan.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

HtmlScan.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       htmlscan.hxx
00006 //
00007 //  Contents:   Html Scanner classes
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __HTMLSCAN_HXX__ )
00012 #define __HTMLSCAN_HXX__
00013
00014 #include <propspec.hxx>
00015 #include <serstrm.hxx>
00016
00017 class CHtmlIFilter;
00018
00019 const TAG_BUFFER_SIZE = 40;
00020
00021 //
00022 // Types of tokens found while scanning Html input
00023 //
00024 enum HtmlTokenType
00025 {
00026     StartOfFileToken,   // Start of file
00027     EofToken,           // End of file
00028     TextToken,          // Vanilla text
00029     BreakToken,         // Forced line break
00030     TitleToken,         // Title tag
00031     Heading1Token,      // H1 tag
00032     Heading2Token,      // H2 tag
00033     Heading3Token,      // H3 tag
00034     Heading4Token,      // H4 tag
00035     Heading5Token,      // H5 tag
00036     Heading6Token,      // H6 tag
00037     AnchorToken,        // Anchor tag
00038     InputToken,         // Input tag
00039     ImageToken,         // Image tag
00040     MetaToken,          // Meta tag
00041     ScriptToken,        // Script tag
00042     CommentToken,       // Comment tag, i.e. !-- tag
00043     GenericToken,       // All other tags
00044 };
00045
00046
00047 class CToken
00048 {
00049
00050 public:
00051     void        SetTokenType( HtmlTokenType eTokType )       { _eTokenType = eTokType; }
00052     HtmlTokenType GetTokenType()                             { return _eTokenType; }
00053
00054     void        SetStartTokenFlag( BOOL fStart )             { _fStartToken = fStart; }
00055     BOOL        IsStartToken()                               { return _fStartToken; }
00056
00057     void        SetPropset( GUID guidPropset )               { _guidPropset = guidPropset; }
00058     void        SetPropid( PROPID propid )                   { _propid = propid; }
00059
00060     BOOL        IsMatchProperty( CFullPropSpec& propSpec );
00061
00062 private:
00063     HtmlTokenType       _eTokenType;           // Token type
00064     BOOL                _fStartToken;          // Is this a start tag ?
00065     GUID                _guidPropset;          // Property set and id for pseudo
00066     PROPID              _propid;               // property corresponding to tag
00067 };
00068
00069
00070 //+-------------------------------------------------------------------------
00071 //
00072 //  Class:      CHtmlScanner
00073 //
00074 //  Purpose:    Scanner
00075 //
00076 //--------------------------------------------------------------------------
00077
00078 class CHtmlScanner
00079 {
00080
00081 public:
00082     CHtmlScanner( CHtmlIFilter& htmlIFilter,
00083                   CSerialStream& serialStream );
00084     ~CHtmlScanner();
00085
00086     void        GetBlockOfChars( ULONG cCharsNeeded,
00087                                  WCHAR *awcInputBuf,
00088                                  ULONG& cCharsScanned,
00089                                  CToken& token );
00090     void        SkipCharsUntilNextRelevantToken( CToken& token );
00091     void        ScanTag( CToken& token );
00092     void        ReadTagIntoBuffer();
00093     void        ScanTagBuffer( WCHAR *awcName,
00094                                WCHAR * & pwcValue,
00095                                unsigned& uLenValue );
00096     void        EatTag();
00097
00098 private:
00099     void        TagNameToToken( WCHAR *awcTagName, CToken& token );
00100     void        EatText();
00101     void        EatBlanks();
00102     void        GrowTagBuffer();
00103
00104     CHtmlIFilter&       _htmlIFilter;      // Reference to Html IFilter
00105     CSerialStream&      _serialStream;     // Reference to input stream
00106     WCHAR *             _pwcTagBuf;        // Buffer for Html tag
00107     unsigned            _uLenTagBuf;       // Length of tag buffer
00108     unsigned            _cTagCharsRead;    // # tag chars read
00109 };
00110
00111
00112 #endif // __HTMLSCAN_HXX__
00113
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::MoveRecordOptionsEnum Member List

This is the complete list of members for msado15::MoveRecordOptionsEnum, including all inherited members.
adMoveAllowEmulation | msado15::MoveRecordOptionsEnum | [static]
adMoveDontUpdateLinks | msado15::MoveRecordOptionsEnum | [static]
adMoveOverWrite | msado15::MoveRecordOptionsEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/compdata.Cpp Source File

  • SysMgmt
  • MMC
  • Openserv

compdata.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "CompData.h"
00021 #include "DataObj.h"
00022 #include "resource.h"
00023 #include <crtdbg.h>
00024
00025 CComponentData::CComponentData()
00026 : m_cref(0), m_ipConsoleNameSpace(NULL), m_ipConsole(NULL)
00027 {
00028     OBJECT_CREATED
00029
00030         m_pStaticNode = new CStaticNode;
00031 }
00032
00033 CComponentData::~CComponentData()
00034 {
00035     if (m_pStaticNode) {
00036         delete m_pStaticNode;
00037     }
00038
00039     OBJECT_DESTROYED
00040 }
00041
00042 ///////////////////////
00043 // IUnknown implementation
00044 ///////////////////////
00045
00046 STDMETHODIMP CComponentData::QueryInterface(REFIID riid, LPVOID *ppv)
00047 {
00048     if (!ppv)
00049         return E_FAIL;
00050
00051     *ppv = NULL;
00052
00053     if (IsEqualIID(riid, IID_IUnknown))
00054         *ppv = static_cast<IComponentData *>(this);
00055     else if (IsEqualIID(riid, IID_IComponentData))
00056         *ppv = static_cast<IComponentData *>(this);
00057     else if (IsEqualIID(riid, IID_IExtendPropertySheet) ||
00058         IsEqualIID(riid, IID_IExtendPropertySheet2))
00059         *ppv = static_cast<IExtendPropertySheet2 *>(this);
00060     //else if (IsEqualIID(riid, IID_IExtendPropertySheet))
00061     //    *ppv = static_cast<IExtendPropertySheet *>(this);
00062     else if (IsEqualIID(riid, IID_IPersistStream))
00063         *ppv = static_cast<IPersistStream *>(this);
00064
00065     if (*ppv)
00066     {
00067         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00068         return S_OK;
00069     }
00070
00071     return E_NOINTERFACE;
00072 }
00073
00074 STDMETHODIMP_(ULONG) CComponentData::AddRef()
00075 {
00076     return InterlockedIncrement((LONG *)&m_cref);
00077 }
00078
00079 STDMETHODIMP_(ULONG) CComponentData::Release()
00080 {
00081     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00082     {
00083         // we need to decrement our object count in the DLL
00084         delete this;
00085         return 0;
00086     }
00087
00088     return m_cref;
00089 }
00090
00091 ///////////////////////////////
00092 // Interface IComponentData
00093 ///////////////////////////////
00094 HRESULT CComponentData::Initialize(
00095                                    /* [in] */ LPUNKNOWN pUnknown)
00096 {
00097     HRESULT      hr;
00098
00099     //
00100     // Get pointer to name space interface
00101     //
00102     hr = pUnknown->QueryInterface(IID_IConsoleNameSpace, (void **)&m_ipConsoleNameSpace);
00103     _ASSERT( S_OK == hr );
00104
00105     //
00106     // Get pointer to console interface
00107     //
00108     hr = pUnknown->QueryInterface(IID_IConsole, (void **)&m_ipConsole);
00109     _ASSERT( S_OK == hr );
00110
00111     IImageList *pImageList;
00112     m_ipConsole->QueryScopeImageList(&pImageList);
00113     _ASSERT( S_OK == hr );
00114
00115     hr = pImageList->ImageListSetStrip( (long *)m_pStaticNode->m_pBMapSm, // pointer to a handle
00116         (long *)m_pStaticNode->m_pBMapLg, // pointer to a handle
00117         0, // index of the first image in the strip
00118         RGB(0, 128, 128)  // color of the icon mask
00119         );
00120
00121     pImageList->Release();
00122
00123     return S_OK;
00124 }
00125
00126 HRESULT CComponentData::CreateComponent(
00127                                         /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent)
00128 {
00129     *ppComponent = NULL;
00130
00131     CComponent *pComponent = new CComponent(this);
00132
00133     if (NULL == pComponent)
00134         return E_OUTOFMEMORY;
00135
00136     return pComponent->QueryInterface(IID_IComponent, (void **)ppComponent);
00137 }
00138
00139 HRESULT CComponentData::Notify(
00140                                /* [in] */ LPDATAOBJECT lpDataObject,
00141                                /* [in] */ MMC_NOTIFY_TYPE event,
00142                                /* [in] */ LPARAM arg,
00143                                /* [in] */ LPARAM param)
00144 {
00145     MMCN_Crack(TRUE, lpDataObject, this, NULL, event, arg, param);
00146
00147     HRESULT hr = S_FALSE;
00148
00149   //Get our data object. If it is NULL, we return with S_FALSE.
00150   //See implementation of GetOurDataObject() to see how to
00151   //handle special data objects.
00152   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00153   if (NULL == pDataObject)
00154     return S_FALSE;
00155
00156   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00157
00158     switch (event)
00159     {
00160     case MMCN_EXPAND:
00161         hr = base->OnExpand(m_ipConsoleNameSpace, m_ipConsole, (HSCOPEITEM)param);
00162         break;
00163     }
00164
00165     return hr;
00166 }
00167
00168 HRESULT CComponentData::Destroy( void)
00169 {
00170     // Free interfaces
00171     if (m_ipConsoleNameSpace) {
00172         m_ipConsoleNameSpace->Release();
00173         m_ipConsoleNameSpace = NULL;
00174     }
00175
00176     if (m_ipConsole) {
00177         m_ipConsole->Release();
00178         m_ipConsole = NULL;
00179     }
00180
00181     return S_OK;
00182 }
00183
00184 HRESULT CComponentData::QueryDataObject(
00185                                         /* [in] */ MMC_COOKIE cookie,
00186                                         /* [in] */ DATA_OBJECT_TYPES type,
00187                                         /* [out] */ LPDATAOBJECT *ppDataObject)
00188 {
00189     CDataObject *pObj = NULL;
00190
00191     if (cookie == 0)
00192         pObj = new CDataObject((MMC_COOKIE)m_pStaticNode, type);
00193     else
00194         pObj = new CDataObject(cookie, type);
00195
00196     if (!pObj)
00197         return E_OUTOFMEMORY;
00198
00199     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00200
00201     return S_OK;
00202 }
00203
00204 HRESULT CComponentData::GetDisplayInfo(
00205                                        /* [out][in] */ SCOPEDATAITEM *pScopeDataItem)
00206 {
00207     HRESULT hr = S_FALSE;
00208
00209     // if they are asking for the SDI_STR we have one of those to give
00210     if (pScopeDataItem->lParam) {
00211         CDelegationBase *base = (CDelegationBase *)pScopeDataItem->lParam;
00212         if (pScopeDataItem->mask & SDI_STR) {
00213                         LPCTSTR pszT = base->GetDisplayName();
00214                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00215             pScopeDataItem->displayname = pszW;
00216         }
00217
00218         if (pScopeDataItem->mask & SDI_IMAGE) {
00219             pScopeDataItem->nImage = base->GetBitmapIndex();
00220         }
00221     }
00222
00223     return hr;
00224 }
00225
00226 HRESULT CComponentData::CompareObjects(
00227                                        /* [in] */ LPDATAOBJECT lpDataObjectA,
00228                                        /* [in] */ LPDATAOBJECT lpDataObjectB)
00229 {
00230     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00231     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00232
00233     // compare the object pointers
00234     if (baseA->GetCookie() == baseB->GetCookie())
00235         return S_OK;
00236
00237     return S_FALSE;
00238 }
00239
00240 ///////////////////////////////////
00241 // Interface IExtendPropertySheet2
00242 ///////////////////////////////////
00243 HRESULT CComponentData::CreatePropertyPages(
00244                                             /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
00245                                             /* [in] */ LONG_PTR handle,
00246                                             /* [in] */ LPDATAOBJECT lpIDataObject)
00247 {
00248     return m_pStaticNode->CreatePropertyPages(lpProvider, handle);
00249 }
00250
00251 HRESULT CComponentData::QueryPagesFor(
00252                                       /* [in] */ LPDATAOBJECT lpDataObject)
00253 {
00254     return m_pStaticNode->HasPropertySheets();
00255 }
00256
00257 HRESULT CComponentData::GetWatermarks(
00258                                       /* [in] */ LPDATAOBJECT lpIDataObject,
00259                                       /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
00260                                       /* [out] */ HBITMAP __RPC_FAR *lphHeader,
00261                                       /* [out] */ HPALETTE __RPC_FAR *lphPalette,
00262                                       /* [out] */ BOOL __RPC_FAR *bStretch)
00263 {
00264     return m_pStaticNode->GetWatermarks(lphWatermark, lphHeader, lphPalette, bStretch);
00265 }
00266
00267 ///////////////////////////////
00268 // Interface IPersistStream
00269 ///////////////////////////////
00270 HRESULT CComponentData::GetClassID(
00271                                    /* [out] */ CLSID __RPC_FAR *pClassID)
00272 {
00273     *pClassID = m_pStaticNode->getNodeType();
00274
00275     return S_OK;
00276 }
00277
00278 HRESULT CComponentData::IsDirty( void)
00279 {
00280     return m_pStaticNode->isDirty() == true ? S_OK : S_FALSE;
00281 }
00282
00283 HRESULT CComponentData::Load(
00284                              /* [unique][in] */ IStream __RPC_FAR *pStm)
00285 {
00286     void *snapInData = m_pStaticNode->getData();
00287     ULONG dataSize = m_pStaticNode->getDataSize();
00288
00289     return pStm->Read(snapInData, dataSize, NULL);
00290 }
00291
00292 HRESULT CComponentData::Save(
00293                              /* [unique][in] */ IStream __RPC_FAR *pStm,
00294                              /* [in] */ BOOL fClearDirty)
00295 {
00296     void *snapInData = m_pStaticNode->getData();
00297     ULONG dataSize = m_pStaticNode->getDataSize();
00298
00299     if (fClearDirty)
00300         m_pStaticNode->clearDirty();
00301
00302     return pStm->Write(snapInData, dataSize, NULL);
00303 }
00304
00305 HRESULT CComponentData::GetSizeMax(
00306                                    /* [out] */ ULARGE_INTEGER __RPC_FAR *pcbSize)
00307 {
00308     return m_pStaticNode->getDataSize();
00309 }
Generated on Wed Nov 13 2024 16:52:33 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/ScripTag.Cxx Source File

  • WinBase
  • Indexing
  • IFilter

ScripTag.Cxx

Go to the documentation of this file.
00001 //+---------------------------------------------------------------------------
00002 //
00003 //  Copyright 1992 - 2000 Microsoft Corporation.
00004 //
00005 //  File:       scripttag.cxx
00006 //
00007 //  Contents:   Parsing algorithm for script tag in Html
00008 //
00009 //  Classes:    CScriptTag
00010 //
00011 //----------------------------------------------------------------------------
00012
00013 #include <pch.cxx>
00014 #pragma hdrstop
00015
00016 #include <scriptag.hxx>
00017 #include <htmlguid.hxx>
00018
00019 //+-------------------------------------------------------------------------
00020 //
00021 //  Method:     CScriptTag::CScriptTag
00022 //
00023 //  Synopsis:   Constructor
00024 //
00025 //  Arguments:  [htmlIFilter]    -- Html IFilter
00026 //              [serialStream]   -- Input stream
00027 //              [clsidScriptInfo]  -- Clsid for script chunk
00028 //
00029 //--------------------------------------------------------------------------
00030
00031 CScriptTag::CScriptTag( CHtmlIFilter& htmlIFilter,
00032                     CSerialStream& serialStream,
00033                     GUID clsidScriptInfo )
00034     : CHtmlElement(htmlIFilter, serialStream),
00035       _clsidScriptInfo(clsidScriptInfo),
00036       _eState(NoMoreContent)
00037 {
00038     _awszPropSpec[0] = 0;
00039 }
00040
00041
00042
00043 //+-------------------------------------------------------------------------
00044 //
00045 //  Method:     CScriptTag::GetChunk
00046 //
00047 //  Synopsis:   Gets the next chunk and returns chunk information in pStat
00048 //
00049 //  Arguments:  [pStat] -- chunk information returned here
00050 //
00051 //--------------------------------------------------------------------------
00052
00053 SCODE CScriptTag::GetChunk( STAT_CHUNK * pStat )
00054 {
00055     switch ( _eState )
00056     {
00057
00058     case  FilteringContent:
00059     {
00060         SCODE sc = SkipRemainingTextAndGotoNextChunk( pStat );
00061
00062         return sc;
00063     }
00064
00065     case NoMoreContent:
00066     {
00067             SCODE sc = SwitchToNextHtmlElement( pStat );
00068
00069             return sc;
00070     }
00071
00072     default:
00073         Win4Assert( !"Unknown _eState in CScriptTag::GetChunk" );
00074         htmlDebugOut(( DEB_ERROR, "CScriptTag::GetChunk, unkown tag state: %d\n", _eState ));
00075
00076         return S_OK;
00077     }
00078 }
00079
00080
00081
00082 //+-------------------------------------------------------------------------
00083 //
00084 //  Method:     CScriptTag::GetText
00085 //
00086 //  Synopsis:   Retrieves text from current chunk
00087 //
00088 //  Arguments:  [pcwcOutput] -- count of UniCode characters in buffer
00089 //              [awcBuffer]  -- buffer for text
00090 //
00091 //--------------------------------------------------------------------------
00092
00093 SCODE CScriptTag::GetText( ULONG *pcwcOutput, WCHAR *awcBuffer )
00094 {
00095     switch( _eState )
00096     {
00097     case NoMoreContent:
00098         return FILTER_E_NO_MORE_TEXT;
00099
00100     case FilteringContent:
00101     {
00102         ULONG cCharsRead = 0;
00103         while ( cCharsRead < *pcwcOutput )
00104         {
00105             ULONG cCharsScanned;
00106             ULONG cCharsNeeded = *pcwcOutput - cCharsRead;
00107             CToken token;
00108             _scanner.GetBlockOfChars( cCharsNeeded,
00109                                       awcBuffer + cCharsRead,
00110                                       cCharsScanned,
00111                                       token );
00112
00113             cCharsRead += cCharsScanned;
00114             if ( cCharsScanned == cCharsNeeded )
00115             {
00116                 //
00117                 // We've read the #chars requested by user
00118                 //
00119                 break;
00120             }
00121
00122             HtmlTokenType eTokType = token.GetTokenType();
00123             if ( eTokType == EofToken || eTokType == ScriptToken )
00124             {
00125                 //
00126                 // End of file or end script tag
00127                 //
00128                 _eState = NoMoreContent;
00129
00130                 break;
00131             }
00132             else if ( eTokType == BreakToken )
00133             {
00134                 //
00135                 // Insert a newline char
00136                 //
00137                 Win4Assert( cCharsRead < *pcwcOutput );
00138                 awcBuffer[cCharsRead++] = L'\n';
00139                 _scanner.EatTag();
00140             }
00141             else if ( eTokType == CommentToken )
00142             {
00143                 //
00144                 // Scripts are often enclosed in comments for backward
00145                 // compatibilty, so do nothing
00146                 //
00147             }
00148             else
00149             {
00150                 //
00151                 // Uninteresting tag, so skip over tag and continue processing
00152                 //
00153                 _scanner.EatTag();
00154             }
00155         }
00156
00157         *pcwcOutput = cCharsRead;
00158
00159         if ( _eState == NoMoreContent )
00160             return FILTER_S_LAST_TEXT;
00161         else
00162             return S_OK;
00163
00164         break;
00165     }
00166
00167     default:
00168         Win4Assert( !"Unknown value of _eState" );
00169         htmlDebugOut(( DEB_ERROR,
00170                        "CScriptTag::GetText, unknown value of _eState: %d\n",
00171                        _eState ));
00172         return S_OK;
00173     }
00174 }
00175
00176
00177 //+-------------------------------------------------------------------------
00178 //
00179 //  Method:     CScriptTag::GetValue
00180 //
00181 //  Synopsis:   Retrieves value from current chunk
00182 //
00183 //  Arguments:  [ppPropValue] -- Value returned here
00184 //
00185 //--------------------------------------------------------------------------
00186
00187 SCODE CScriptTag::GetValue( PROPVARIANT **ppPropValue )
00188 {
00189     return FILTER_E_NO_VALUES;
00190 }
00191
00192
00193 //+-------------------------------------------------------------------------
00194 //
00195 //  Method:     CScriptTag::InitStatChunk
00196 //
00197 //  Synopsis:   Initializes the STAT_CHUNK
00198 //
00199 //  Arguments:  [pStat] -- STAT_CHUNK to initialize
00200 //
00201 //--------------------------------------------------------------------------
00202
00203 void CScriptTag::InitStatChunk( STAT_CHUNK *pStat )
00204 {
00205     WCHAR *pwcLang;
00206     unsigned cwcLang;
00207
00208     //
00209     // Read the Language field
00210     //
00211     _scanner.ReadTagIntoBuffer();
00212     _scanner.ScanTagBuffer( L"language=\"", pwcLang, cwcLang );
00213
00214     if ( cwcLang == 0 )
00215     {
00216         //
00217         // Use whatever was specified in an earlier script tag, if none, the default is
00218         // Javascript
00219         //
00220         if ( _awszPropSpec[0] == 0 )
00221             RtlCopyMemory( _awszPropSpec, L"javascript", (wcslen(L"javascript") + 1) * sizeof( WCHAR) );
00222     }
00223     else
00224     {
00225         if ( cwcLang > MAX_PROPSPEC_STRING_LENGTH )
00226             cwcLang = MAX_PROPSPEC_STRING_LENGTH;     // Truncate to max length permitted
00227
00228         RtlCopyMemory( _awszPropSpec, pwcLang, cwcLang * sizeof(WCHAR) );
00229         _awszPropSpec[cwcLang] = 0;
00230     }
00231
00232     _eState = FilteringContent;
00233
00234     pStat->attribute.guidPropSet = _clsidScriptInfo;
00235     pStat->attribute.psProperty.ulKind = PRSPEC_LPWSTR;
00236     pStat->attribute.psProperty.lpwstr = _awszPropSpec;
00237
00238     pStat->idChunk = _htmlIFilter.GetNextChunkId();
00239     pStat->flags = CHUNK_TEXT;
00240     pStat->locale = _htmlIFilter.GetLocale();
00241     pStat->breakType = CHUNK_EOS;
00242     pStat->idChunkSource = pStat->idChunk;
00243     pStat->cwcStartSource = 0;
00244     pStat->cwcLenSource = 0;
00245 }
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/WinNT/PerfTool/PerfDllS/PerfGen/DataGen.h Source File

  • WinBase
  • WinNT
  • PerfTool
  • PerfDllS
  • PerfGen

DataGen.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1995 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007       DATAGEN.h
00008
00009 Abstract:
00010
00011     Header file for the signal generator performance counters.
00012
00013     This file contains definitions to construct the dynamic data
00014     which is returned by the Configuration Registry.  Data from
00015     various system API calls is placed into the structures shown
00016     here.
00017
00018 Author:
00019
00020     Bob Watson  28-Jul-1995
00021
00022 Revision History:
00023
00024
00025 --*/
00026
00027 #ifndef _DATAGEN_H_
00028 #define _DATAGEN_H_
00029
00030 //
00031 //  insure packing is done to the 8 byte align longlong data values. This
00032 //  will eliminate alignment faults on RISC platforms. The fields can be
00033 //  manually arranged to minimize or eliminate wasted space if necessary.
00034 //
00035 #pragma pack (8)
00036
00037 //
00038 //  Extensible Object definitions
00039 //
00040
00041 //  Update the following sort of define when adding an object type.
00042
00043 #define SIGGEN_NUM_PERF_OBJECT_TYPES 1
00044
00045 //----------------------------------------------------------------------------
00046
00047 //
00048 //  Perf Gen Resource object type counter definitions.
00049 //
00050 //  This is the counter structure presently returned by the generator
00051 //
00052
00053 typedef struct _SIGGEN_DATA_DEFINITION {
00054     PERF_OBJECT_TYPE    SigGenObjectType;
00055     PERF_COUNTER_DEFINITION SineWaveDef;
00056     PERF_COUNTER_DEFINITION TriangleWaveDef;
00057     PERF_COUNTER_DEFINITION SquareWaveDef;
00058     PERF_COUNTER_DEFINITION ConstantValueDef;
00059 } SIGGEN_DATA_DEFINITION;
00060
00061 //
00062 // This is the block of data that corresponds to each instance of the
00063 // object. This structure will immediately follow the instance definition
00064 // data structure
00065 //
00066
00067 typedef struct _SIGGEN_COUNTER {
00068     PERF_COUNTER_BLOCK      CounterBlock;
00069     DWORD                   dwReserved;         // for 8-byte alignment
00070     DWORD                   dwSineWaveValue;
00071     DWORD                   dwTriangleWaveValue;
00072     DWORD                   dwSquareWaveValue;
00073     DWORD                   dwConstantValue;
00074 } SIGGEN_COUNTER, *PSIGGEN_COUNTER;
00075
00076 #pragma pack ()
00077
00078 #endif //_DATAGEN_H_
00079 
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CBlackPen Member List

This is the complete list of members for CBlackPen, including all inherited members.
_canvas | CBlackPen | [protected]
_hPen | CBlackPen | [protected]
_hPenOld | CBlackPen | [protected]
CBlackPen(CCanvas &canvas, int iStyle, int iWidth) | CBlackPen | [inline]
~CBlackPen() | CBlackPen | [inline]
Generated on Wed Nov 13 2024 16:55:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/registry.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

registry.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include <ObjBase.h>
00016 #include "Registry.h"
00017 #include "Globals.h"
00018
00019
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("Registry")
00023
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // Internal helper functions prototypes
00027
00028
00029 // Set the given key and its value.
00030 HRESULT SetKeyAndValue( const TCHAR* pszPath, const TCHAR* szSubkey, const TCHAR* szValue);
00031
00032 // Set the given key and its value in the MMC Snapin location
00033 HRESULT SetSnapInKeyAndValue( const TCHAR* szKey, const TCHAR* szSubkey, const TCHAR* szName, const TCHAR* szValue );
00034
00035 // Set the given valuename under the key to value
00036 HRESULT SetValue( const TCHAR* szKey, const TCHAR* szValueName, const TCHAR* szValue);
00037
00038 // Delete szKeyChild and all of its descendents.
00039 HRESULT RecursiveDeleteKey( HKEY hKeyParent, const TCHAR* szKeyChild );
00040
00041 // VIEWEX:  New methods to register extensions
00042 //
00043 // Set key for nodes which we want to extend us
00044 HRESULT SetExtensionKey( TCHAR* szNode2Extend, TCHAR* szExtensionNode, TCHAR* szExtensionType, TCHAR* szDescription );
00045
00046 HRESULT SetNodeTypesKey( const TCHAR* szNodeGuid );
00047
00048 /////////////////////////////////////////////////////////////////////////////
00049 // Public function implementation
00050
00051
00052 //---------------------------------------------------------------------------
00053 //  Register the component in the registry.  This is the minimalist way
00054 //  to register a component, you may want to add keys for ProgID.
00055 //
00056 HRESULT RegisterServer
00057 (
00058   HMODULE        hModule,          //[in] DLL module handle
00059   const CLSID&   clsid,            //[in] Class ID
00060   const TCHAR*   szFriendlyName    //[in] Name string
00061 )
00062 {
00063   // Get server location.
00064   TCHAR    szModule[512] ;
00065   TCHAR*   pszCLSID = NULL;
00066   LPOLESTR wszCLSID = NULL ;
00067   HRESULT  hResult  = S_FALSE;
00068
00069   DWORD dwResult = ::GetModuleFileName( hModule,
00070                                         szModule,
00071                                         sizeof(szModule)/sizeof(TCHAR)
00072                                       );
00073   if( 0 == dwResult ) return HRESULT_FROM_WIN32( dwResult );
00074
00075   do                         // Fail unless we complete everything
00076   {
00077     // Get CLSID string in wide char
00078     hResult = StringFromCLSID( clsid, &wszCLSID ) ;
00079     if( S_OK != hResult )
00080     {
00081       CoTaskMemFree( wszCLSID );
00082       BREAK_ON_ERROR( hResult );
00083     }
00084
00085     W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00086     CoTaskMemFree( wszCLSID );           // Through with wide version
00087
00088     TCHAR szKey[64];                     // Build the CLSID key string CLSID\\{...}
00089     _tcscpy( szKey, _T("CLSID\\") );
00090     _tcscat( szKey, pszCLSID );
00091
00092     // Add the CLSID to the registry.
00093     hResult = SetKeyAndValue( szKey, NULL, szFriendlyName );
00094     BREAK_ON_ERROR( hResult );
00095
00096     // Add the server filename subkey under the CLSID key.
00097     hResult = SetKeyAndValue( szKey, _T("InprocServer32"), szModule );
00098     BREAK_ON_ERROR( hResult );
00099
00100     // Set the threading model
00101     _tcscat( szKey, _T("\\InprocServer32") );
00102     hResult = SetValue( szKey, _T("ThreadingModel"), _T("Apartment") );
00103     BREAK_ON_ERROR( hResult );
00104
00105   }while( 0 );
00106
00107   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00108
00109   return hResult;
00110 }
00111
00112
00113 //---------------------------------------------------------------------------
00114 // Remove the component from the registry.
00115 //
00116 LONG UnregisterServer
00117 (
00118   const CLSID& clsid         //[in] Class ID of component to remove
00119 )
00120 {
00121   HRESULT hResult = S_OK;
00122
00123   // Allocate the CLSID string
00124   LPOLESTR wszCLSID = NULL ;
00125   hResult = StringFromCLSID( clsid, &wszCLSID );
00126   if( S_OK != hResult )
00127   {
00128     CoTaskMemFree( wszCLSID );
00129     return hResult;
00130   }
00131
00132   // Build the key CLSID\\{...}
00133   TCHAR szKey[64];
00134   _tcscpy( szKey, _T("CLSID\\") );
00135
00136   TCHAR* pszCLSID = NULL;
00137   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00138   CoTaskMemFree( wszCLSID );           // Through with wide version
00139
00140   _tcscat( szKey, pszCLSID );
00141   CoTaskMemFree( pszCLSID );           // Through with TCHAR version
00142
00143   // Delete the CLSID Key - CLSID\{...}
00144   LONG lResult = RecursiveDeleteKey( HKEY_CLASSES_ROOT, szKey );
00145   if( ERROR_SUCCESS != lResult )
00146     hResult = HRESULT_FROM_WIN32( lResult );
00147
00148   return hResult;
00149 }
00150
00151 //---------------------------------------------------------------------------
00152 // Register the snap-in in the registry.
00153 //
00154 HRESULT RegisterSnapin
00155 (
00156   const  CLSID&  clsid,              //[in] Class ID
00157   const  TCHAR*  szNameString,       //[in] NameString
00158   const  CLSID&  clsidAbout,         //[in] Class Id for About Class
00159   const  BOOL    bSupportExtensions  //[in] TRUE if we support extensions
00160 )
00161 {
00162   HRESULT hResult = S_FALSE;
00163   TCHAR*  pszSnapCLSID = NULL;         // Needed for TCHAR version of the ClassID
00164
00165   // If any part of this process fails, jump out of the loop and return
00166   // the error code
00167   do
00168   {
00169     // Allocate the CLSID string
00170     LPOLESTR wszSnapCLSID  = NULL ;
00171     hResult = StringFromCLSID( clsid, &wszSnapCLSID ) ;
00172     if( S_OK != hResult )
00173     {
00174        CoTaskMemFree( wszSnapCLSID );
00175        continue;
00176     }
00177
00178     W2T( &pszSnapCLSID, wszSnapCLSID );  // W2T is defined in Globals.h
00179     CoTaskMemFree( wszSnapCLSID );       // Through with wide version
00180
00181     // Add the Snap-in's CLSID to the registry
00182     hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("NameString"), szNameString );
00183     BREAK_ON_ERROR( hResult );
00184
00185     hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("StandAlone"), NULL, NULL );
00186     BREAK_ON_ERROR( hResult );
00187
00188     // Add registry information for ISnapinAbout if we support it
00189     LPOLESTR wszAboutCLSID = NULL;
00190     TCHAR*   pszAboutCLSID = NULL;
00191     if( IID_NULL != clsidAbout )
00192     {
00193       hResult = StringFromCLSID( clsidAbout, &wszAboutCLSID );
00194       if( S_OK != hResult )
00195       {
00196         CoTaskMemFree( wszAboutCLSID ); // Free this memory before exiting
00197         continue;
00198       }
00199
00200       W2T( &pszAboutCLSID, wszAboutCLSID );
00201       hResult = SetSnapInKeyAndValue( pszSnapCLSID, NULL, _T("About"), pszAboutCLSID );
00202       CoTaskMemFree( wszAboutCLSID );
00203       CoTaskMemFree( pszAboutCLSID );
00204       BREAK_ON_ERROR( hResult );
00205     }
00206
00207     if( TRUE == bSupportExtensions )     // Build the NodeTypesKey
00208     {
00209       hResult = SetSnapInKeyAndValue( pszSnapCLSID, _T("NodeTypes"), NULL, NULL );
00210       BREAK_ON_ERROR( hResult );
00211       TCHAR szKey[64];
00212       _tcscpy( szKey, pszSnapCLSID );
00213       _tcscat(szKey, _T("\\NodeTypes"));
00214       hResult = SetSnapInKeyAndValue( szKey, pszSnapCLSID, NULL, NULL );
00215       BREAK_ON_ERROR( hResult );
00216
00217       // VIEWEX:  First set the values for the node which will be extended.
00218       hResult = SetSnapInKeyAndValue( szKey, gtszCLSID_FOLDERNODE, NULL, NULL );
00219       BREAK_ON_ERROR( hResult );
00220
00221       // Add the GUID for the node which will be extended under MMC/NodeTypes
00222       hResult = SetNodeTypesKey( gtszCLSID_FOLDERNODE );
00223       BREAK_ON_ERROR( hResult );
00224
00225       // VIEWEX:  Set MMC's View Extension to extend us
00226       hResult = SetExtensionKey( gtszCLSID_FOLDERNODE,
00227                                  gtszCLSID_MMCVIEWEX,
00228                                  _T("View"),
00229                                  _T("MMCViewExt 1.0 Object")
00230                                );
00231       BREAK_ON_ERROR( hResult );
00232     }
00233   }while( 0 );
00234
00235   CoTaskMemFree( pszSnapCLSID);
00236   return hResult;
00237 }
00238
00239
00240 //---------------------------------------------------------------------------
00241 // Unregister the snap-in in the registry.
00242 //
00243 HRESULT UnregisterSnapin
00244 (
00245   const CLSID& clsid         //[in] Class ID of object to unregister
00246 )
00247 {
00248   HRESULT hResult = S_OK;
00249
00250   TCHAR    szKeyBuf[1024];
00251   LPOLESTR wszCLSID = NULL;
00252   TCHAR*   pszCLSID = NULL;        // Needed for TCHAR version of the ClassID
00253
00254   // Get CLSID as a wide string
00255   hResult = StringFromCLSID( clsid, &wszCLSID );
00256   if( S_OK != hResult )
00257   {
00258     CoTaskMemFree( wszCLSID );
00259     return hResult;
00260   }
00261
00262   W2T( &pszCLSID, wszCLSID );          // W2T is defined in Globals.h
00263   CoTaskMemFree( wszCLSID );           // Through with wide version
00264
00265   // Load the buffer with the Snap-In Location
00266   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00267
00268   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00269   _tcscat( szKeyBuf, pszCLSID );
00270
00271   // Delete the CLSID Key - CLSID\{...}
00272   LONG lResult = RecursiveDeleteKey( HKEY_LOCAL_MACHINE, szKeyBuf );
00273   if( ERROR_SUCCESS != lResult )
00274     hResult = HRESULT_FROM_WIN32( lResult );
00275
00276   CoTaskMemFree( pszCLSID );
00277   return hResult;
00278 }
00279
00280 //---------------------------------------------------------------------------
00281 // Delete a key and all of its descendents.
00282 //
00283 HRESULT RecursiveDeleteKey
00284 (
00285   HKEY          hKeyParent,    //[in] Parent of key to delete
00286   const TCHAR*  lpszKeyChild   //[in] Key to delete
00287 )
00288 {
00289   // Open the child.
00290   HKEY hKeyChild = NULL;
00291   LONG lResult   = ERROR_SUCCESS;
00292
00293   do                     // We go to all this trouble to prevent any
00294   {                      // possibility of exiting while leaving a key open
00295
00296     lResult = RegOpenKeyEx( hKeyParent,
00297                             lpszKeyChild,
00298                             0,
00299                             KEY_ALL_ACCESS,
00300                             &hKeyChild
00301                           );
00302     if( ERROR_SUCCESS != lResult )
00303       continue;
00304
00305     // Enumerate all of the decendents of this child.
00306     FILETIME time;
00307     _TCHAR szBuffer[256];
00308     DWORD dwSize = 256;
00309     while( S_OK == RegEnumKeyEx(hKeyChild,0,szBuffer,&dwSize,NULL,NULL,NULL,&time) )
00310     {
00311       // Delete the decendents of this child.
00312       lResult = RecursiveDeleteKey( hKeyChild, szBuffer );
00313       if( ERROR_SUCCESS != lResult )
00314       {
00315         continue;
00316       }
00317       dwSize = 256;
00318     }
00319   }while( 0 );
00320
00321   RegCloseKey( hKeyChild );            // Always try to close the child
00322                                        // then delete this child.
00323   return RegDeleteKey( hKeyParent, lpszKeyChild );
00324 }
00325
00326 //---------------------------------------------------------------------------
00327 // Create a Registry Key and set its value.
00328 //   - This helper function was borrowed and modifed from
00329 //     Kraig Brockschmidt's book Inside OLE.
00330 //
00331 HRESULT SetKeyAndValue
00332 (
00333   const TCHAR*  szKey,       //[in] Parent key
00334   const TCHAR*  szSubkey,    //[in] Child key
00335   const TCHAR*  szValue      //[in] Value to set
00336 )
00337 {
00338   HKEY hKey = NULL;
00339   HRESULT hResult = S_FALSE;
00340   TCHAR szKeyBuf[1024];
00341
00342   // Copy keyname into buffer.
00343   _tcscpy( szKeyBuf, szKey );
00344
00345   // Add subkey name to buffer.
00346   if( NULL != szSubkey )
00347   {
00348     _tcscat( szKeyBuf, _T("\\") );
00349     _tcscat( szKeyBuf, szSubkey );
00350   }
00351
00352   do                     // We go to all this trouble to prevent any
00353   {                      // possibility of exiting while leaving a key open
00354
00355     // Create and open key and subkey.
00356     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT,
00357                                    szKeyBuf,
00358                                    0,
00359                                    NULL,
00360                                    REG_OPTION_NON_VOLATILE,
00361                                    KEY_ALL_ACCESS,
00362                                    NULL,
00363                                    &hKey,
00364                                    NULL
00365                                  );
00366     if( ERROR_SUCCESS != lResult )
00367     {
00368       hResult = HRESULT_FROM_WIN32( lResult );
00369       continue;
00370     }
00371
00372     if( NULL != szValue )    // Now set the value
00373     {
00374       hResult = RegSetValueEx( hKey,
00375                                NULL,
00376                                0,
00377                                REG_SZ,
00378                                (BYTE*)szValue,
00379                                BYTE_SIZE( szValue )    // BYTE_SIZE is in Globals.h
00380                              );
00381       BREAK_ON_ERROR( hResult );
00382     }
00383   }while( 0 );
00384
00385   RegCloseKey( hKey );       // Always try to close the key
00386   return hResult;
00387 }
00388
00389
00390 //---------------------------------------------------------------------------
00391 // Open a key value and set it
00392 //
00393 HRESULT SetValue
00394 (
00395   const TCHAR*  szKey,         //[in] Parent key
00396   const TCHAR*  szValueName,   //[in] Name of value
00397   const TCHAR*  szValue        //[in] Value in string format
00398 )
00399 {
00400   HKEY    hKey = NULL;
00401   HRESULT hResult = S_FALSE;
00402   TCHAR szKeyBuf[1024];
00403
00404   // Copy keyname into buffer.
00405   _tcscpy( szKeyBuf, szKey );
00406
00407   do                     // We go to all this trouble to prevent any
00408   {                      // possibility of exiting while leaving a key open
00409
00410     // Create and open key and subkey.
00411     long lResult = RegCreateKeyEx( HKEY_CLASSES_ROOT ,
00412                                    szKeyBuf,
00413                                    0,
00414                                    NULL,
00415                                    REG_OPTION_NON_VOLATILE,
00416                                    KEY_ALL_ACCESS,
00417                                    NULL,
00418                                    &hKey,
00419                                    NULL
00420                                  );
00421     if( ERROR_SUCCESS != lResult )
00422     {
00423       hResult = HRESULT_FROM_WIN32( lResult );
00424       continue;
00425     }
00426
00427     if( NULL != szValue )    // Now set the value
00428     {
00429       hResult = RegSetValueEx( hKey,
00430                                szValueName,
00431                                0,
00432                                REG_SZ,
00433                                (BYTE*)szValue,
00434                                BYTE_SIZE( szValue )
00435                              );
00436       BREAK_ON_ERROR( hResult );
00437     }
00438   }while( 0 );
00439
00440   RegCloseKey( hKey );       //Always attempt to close the key
00441   return hResult;
00442 }
00443
00444
00445 //---------------------------------------------------------------------------
00446 // Create a key and set its value.
00447 //   - This helper function was borrowed and modifed from
00448 //     Kraig Brockschmidt's book Inside OLE.
00449 //
00450 HRESULT SetSnapInKeyAndValue
00451 (
00452   const TCHAR*  szKey,       //[in] Parent key
00453   const TCHAR*  szSubkey,    //[in] Child key
00454   const TCHAR*  szName,      //[in] Value name
00455   const TCHAR*  szValue      //[in] Value in string format
00456 )
00457 {
00458   HKEY    hKey = NULL;
00459   HRESULT hResult = S_FALSE;
00460   TCHAR   szKeyBuf[1024];
00461
00462   // Load the buffer with the Snap-In Location
00463   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns") );
00464
00465   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00466   _tcscat( szKeyBuf, szKey );
00467
00468   if( NULL != szSubkey )               // Add subkey name to buffer.
00469   {
00470     _tcscat( szKeyBuf, _T("\\") );
00471     _tcscat( szKeyBuf, szSubkey );
00472   }
00473
00474   do                     // We go to all this trouble to prevent any
00475   {                      // possibility of exiting while leaving a key open
00476
00477     // Create and open key and subkey.
00478     long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00479                                    szKeyBuf,
00480                                    0,
00481                                    NULL,
00482                                    REG_OPTION_NON_VOLATILE,
00483                                    KEY_ALL_ACCESS,
00484                                    NULL,
00485                                    &hKey,
00486                                    NULL
00487                                  );
00488     if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00489       continue;
00490
00491     // Set the Value.
00492     if( szValue != NULL )
00493     {
00494       hResult = RegSetValueEx( hKey,
00495                                szName,
00496                                0,
00497                                REG_SZ,
00498                                (BYTE*)szValue,
00499                                BYTE_SIZE(szValue)
00500                              );
00501       BREAK_ON_ERROR( hResult );
00502     }
00503     else
00504     {                        // Got this far so everything is OK.
00505       hResult = S_OK;
00506     }
00507   }while( 0 );
00508
00509   RegCloseKey( hKey );       //Always attempt to close the key
00510   return hResult;
00511 }
00512
00513 //---------------------------------------------------------------------------
00514 //  VIEWEX:  Adds the keys under the MMC/NodeTypes key to register the
00515 //           GUID passed in as an extension.
00516 //
00517 HRESULT SetExtensionKey
00518 (
00519   TCHAR*  szNode2Extend,     //[in] GUID of node we are extending
00520   TCHAR*  szExtensionNode,   //[in] GUID of extension node
00521   TCHAR*  szExtensionType,   //[in] Type of extension
00522   TCHAR*  szDescription      //[in] Description string
00523 )
00524 {
00525   HKEY    hNodeKey = NULL;
00526   HRESULT hResult  = S_FALSE;
00527   TCHAR   szKeyBuf[1024];
00528
00529   // Load the buffer with the NodeTypes Location
00530   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes") );
00531
00532   _tcscat( szKeyBuf, _T("\\") );       // Copy NodeType GUID into buffer.
00533   _tcscat( szKeyBuf, szNode2Extend );
00534
00535                                        // Copy Subkeys into buffer
00536   _tcscat( szKeyBuf, _T("\\Extensions\\") );
00537   _tcscat( szKeyBuf, szExtensionType );
00538
00539   long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00540                                  szKeyBuf,
00541                                  0,
00542                                  NULL,
00543                                  REG_OPTION_NON_VOLATILE,
00544                                  KEY_ALL_ACCESS,
00545                                  NULL,
00546                                  &hNodeKey,
00547                                  NULL
00548                                );
00549
00550   if( ERROR_SUCCESS != lResult )     // Will return S_FALSE
00551   {
00552     RegCloseKey( hNodeKey );
00553     return S_FALSE;
00554   }
00555
00556   hResult = RegSetValueEx( hNodeKey,
00557                            szExtensionNode,
00558                            0,
00559                            REG_SZ,
00560                            (BYTE*)szDescription,
00561                            BYTE_SIZE(szDescription)
00562                          );
00563
00564   return hResult;
00565 }
00566
00567 //---------------------------------------------------------------------------
00568 //  VIEWEX:  New method which adds a key for a nodetype guid.  Need to
00569 //           do this for every nodetype which can be extended.
00570 //
00571 HRESULT SetNodeTypesKey
00572 (
00573   const TCHAR*  szNodeGuid       //[in] Parent key
00574 )
00575 {
00576   HKEY    hKey = NULL;
00577   TCHAR   szKeyBuf[1024];
00578
00579   // Load the buffer with the Snap-In Location
00580   _tcscpy( szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\NodeTypes") );
00581   _tcscat( szKeyBuf, _T("\\") );       // Copy keyname into buffer.
00582   _tcscat( szKeyBuf, szNodeGuid );
00583
00584   // Create and open key.
00585   long lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE,
00586                                  szKeyBuf,
00587                                  0,
00588                                  NULL,
00589                                  REG_OPTION_NON_VOLATILE,
00590                                  KEY_ALL_ACCESS,
00591                                  NULL,
00592                                  &hKey,
00593                                  NULL
00594                                );
00595
00596   RegCloseKey( hKey );       //Always close the key
00597   return (ERROR_SUCCESS == lResult) ? S_OK : S_FALSE;
00598
00599 }
00600
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMgdClusCfgInit Member List

This is the complete list of members for CMgdClusCfgInit, including all inherited members.
CMgdClusCfgInit(void) | CMgdClusCfgInit |
CMgdClusCfgInit(const CMgdClusCfgInit &rSrcIn) | CMgdClusCfgInit | [private]
CMgdClusCfgInit(void) | CMgdClusCfgInit |
CMgdClusCfgInit(const CMgdClusCfgInit &rSrcIn) | CMgdClusCfgInit | [private]
GetCallback(void) | CMgdClusCfgInit | [inline]
GetCallback(void) | CMgdClusCfgInit | [inline]
GetDisplayName(void) | CMgdClusCfgInit | [inline]
GetDisplayName(void) | CMgdClusCfgInit | [inline]
GetDllName(void) | CMgdClusCfgInit | [inline]
GetDllName(void) | CMgdClusCfgInit | [inline]
GetLCID(void) | CMgdClusCfgInit | [inline]
GetLCID(void) | CMgdClusCfgInit | [inline]
GetNodeName(void) | CMgdClusCfgInit | [inline]
GetNodeName(void) | CMgdClusCfgInit | [inline]
GetResTypeName(void) | CMgdClusCfgInit | [inline]
GetResTypeName(void) | CMgdClusCfgInit | [inline]
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, UINT idsDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
HrSendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, UINT idsDescriptionIn, UINT idsReferenceIn...) | CMgdClusCfgInit |
Initialize(IUnknown *punkCallbackIn, LCID lcidIn) | CMgdClusCfgInit |
Initialize(IUnknown *punkCallbackIn, LCID lcidIn) | CMgdClusCfgInit |
m_bstrDisplayName | CMgdClusCfgInit | [private]
m_bstrDllName | CMgdClusCfgInit | [private]
m_bstrNodeName | CMgdClusCfgInit | [private]
m_bstrResTypeName | CMgdClusCfgInit | [private]
m_lcid | CMgdClusCfgInit | [private]
m_picccCallback | CMgdClusCfgInit | [private]
operator=(const CMgdClusCfgInit &rSrcIn) | CMgdClusCfgInit | [private]
operator=(const CMgdClusCfgInit &rSrcIn) | CMgdClusCfgInit | [private]
SendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn) | CMgdClusCfgInit | [private]
SendStatusReport(CLSID clsidTaskMajorIn, CLSID clsidTaskMinorIn, ULONG ulMinIn, ULONG ulMaxIn, ULONG ulCurrentIn, HRESULT hrStatusIn, LPCWSTR pcszDescriptionIn, LPCWSTR pcszReferenceIn) | CMgdClusCfgInit | [private]
~CMgdClusCfgInit(void) | CMgdClusCfgInit | [virtual]
~CMgdClusCfgInit(void) | CMgdClusCfgInit | [virtual]
Generated on Wed Nov 13 2024 16:56:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CShutdownDlg Member List

This is the complete list of members for CShutdownDlg, including all inherited members.
CShutdownDlg(CWnd *pParent=NULL) | CShutdownDlg |
DoDataExchange(CDataExchange *pDX) | CShutdownDlg | [protected, virtual]
IDD enum value | CShutdownDlg |
m_serverName | CShutdownDlg |
m_shutdown | CShutdownDlg |
OnInitDialog() | CShutdownDlg | [protected, virtual]
OnShutdown() | CShutdownDlg | [protected]
serverHandle | CShutdownDlg | [private]
serverName | CShutdownDlg | [private]
Generated on Wed Nov 13 2024 16:57:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/LocServe/CRUCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • LocServe

CRUCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      CRUCAR.H
00003
00004   Summary:   Include file for the aggregatable COCruiseCar COM object class.
00005
00006              CRUCAR showcases the construction of the COCruiseCar COM
00007              object class with the IUnknown, ICar, and ICruise interfaces.
00008              This is done through Aggregation reuse of a COCar COM
00009              object (specifically providing its ICar interface features).
00010
00011              This multiple interface COM Object Class is achieved via
00012              the technique of nested classes: the implementation of the
00013              ICar and ICruise interfaces are nested inside of the
00014              COCruiseCar COM object class.
00015
00016              For a comprehensive tutorial code tour of this module's
00017              contents and offerings see the tutorial LOCSERVE.HTM file.
00018              For more specific technical details on the internal workings
00019              see the comments dispersed throughout the module's source code.
00020
00021   Classes:   COCruiseCar.
00022
00023   Functions: .
00024
00025   Origin:    11-14-95: atrent - Editor-inheritance from CRUCAR.H in
00026                the DLLSERVE Tutorial Code Sample.
00027
00028 ----------------------------------------------------------------------------
00029   This file is part of the Microsoft COM Tutorial Code Samples.
00030
00031   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00032
00033   This source code is intended only as a supplement to Microsoft
00034   Development Tools and/or on-line documentation.  See these other
00035   materials for detailed information regarding Microsoft code samples.
00036
00037   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00038   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00039   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00040   PARTICULAR PURPOSE.
00041 ==========================================================================+*/
00042
00043 #if !defined(CRUCAR_H)
00044 #define CRUCAR_H
00045
00046 #ifdef __cplusplus
00047
00048 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00049   ObjectClass: COCruiseCar
00050
00051   Summary:     COM Object Class for COCruiseCar COM Objects.  COM objects
00052                of this class augment COCar COM objects (which offer ICar
00053                interface features of Shift, Clutch, Speed, and Steer) with
00054                ICruise interface features (Engage and Adjust).  This
00055                COCruiseCar COM object class is constructed by aggregation
00056                reuse of the COCar COM object class.  The mulitple
00057                interfaces on this COM object class are constructed via
00058                the nested interface classes technique.
00059
00060   Interfaces:  IUnknown
00061                  Standard interface providing COM object features.
00062                ICar
00063                  Basic Car operation features.
00064                ICruise
00065                  Cruise control features.
00066
00067   Aggregation: Yes, COCruiseCar COM objects are aggregatable by passing
00068                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00069 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00070 class COCruiseCar : public IUnknown
00071 {
00072   public:
00073     // Main Object Constructor & Destructor.
00074     COCruiseCar(IUnknown* pUnkOuter, CServer* pServer);
00075     ~COCruiseCar(void);
00076
00077     // A general method for initializing a newly created COCruiseCar.
00078     HRESULT Init(void);
00079
00080     // IUnknown methods. Main object, non-delegating.
00081     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00082     STDMETHODIMP_(ULONG) AddRef(void);
00083     STDMETHODIMP_(ULONG) Release(void);
00084
00085   private:
00086     // We declare nested class interface implementations here.
00087
00088     // We implement the ICruise interface (of-course) in this COCruiseCar
00089     // COM object class.  This is the interface that we are using as an
00090     // augmentation to the existing COCar COM object class.
00091     class CImpICruise : public ICruise
00092     {
00093       public:
00094         // Interface Implementation Constructor & Destructor.
00095         CImpICruise(COCruiseCar* pBackObj, IUnknown* pUnkOuter);
00096         ~CImpICruise(void);
00097
00098         // IUnknown methods.
00099         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00100         STDMETHODIMP_(ULONG) AddRef(void);
00101         STDMETHODIMP_(ULONG) Release(void);
00102
00103         // ICruise methods.
00104         STDMETHODIMP Engage(BOOL bOnOff);
00105         STDMETHODIMP Adjust(BOOL bUpDown);
00106
00107       private:
00108         // Data private to this interface implementation of ICruise.
00109         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00110         COCruiseCar*  m_pBackObj;    // Parent Object back pointer.
00111         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00112     };
00113
00114     // Make the otherwise private and nested ICar interface implementation
00115     // a friend to COM object instantiations of this selfsame COCruiseCar
00116     // COM object class.
00117     friend CImpICruise;
00118
00119     // Private data of COCruiseCar COM objects.
00120
00121     // Nested ICruise implementation instantiation.  This ICruise interface
00122     // is implemented inside this COCruiseCar object as a native interface.
00123     CImpICruise     m_ImpICruise;
00124
00125     // Main Object reference count.
00126     ULONG           m_cRefs;
00127
00128     // Outer unknown (aggregation & delegation). Used when this COCruiseCar
00129     // object is being aggregated.  Otherwise it is used for delegation
00130     // if this object is reused via containment.
00131     IUnknown*       m_pUnkOuter;
00132
00133     // We need to save the IUnknown interface pointer on the COCar
00134     // object that we aggregate.  We use this when we need to delegate
00135     // IUnknown calls to this aggregated inner object.
00136     IUnknown*       m_pUnkCar;
00137
00138     // Pointer to this component server's control object.
00139     CServer*        m_pServer;
00140 };
00141
00142 typedef COCruiseCar* PCOCruiseCar;
00143
00144 #endif // __cplusplus
00145
00146
00147 #endif // CRUCAR_H
Generated on Wed Nov 13 2024 16:51:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/localres.h Source File

  • SysMgmt
  • MMC
  • Tbarext

localres.h

Go to the documentation of this file.
00001
00002 //==============================================================;
00003 //
00004 //  This source code is only intended as a supplement to existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef __LocalResource_H__
00021 #define __LocalResource_H__
00022
00023 #define INDEX_NONE          -1
00024 #define INDEX_SPACEICON     0
00025 #define INDEX_LANDICON      1
00026 #define INDEX_SKYICON       2
00027 #define INDEX_PEOPLEICON    3
00028 #define INDEX_CLOSEDFOLDER  4
00029 #define INDEX_OPENFOLDER    5
00030
00031 #define INDEX_SUN 6
00032 #define INDEX_SNOW 7
00033 #define INDEX_RAIN 8
00034 #define INDEX_CLOUD 9
00035 #define INDEX_WORLD 10
00036 #define INDEX_THUNDER 11
00037
00038
00039 #endif // __LocalResource_H__
00040
00041
00042
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSampleWordBreaker Member List

This is the complete list of members for CSampleWordBreaker, including all inherited members.
_cRefs | CSampleWordBreaker | [private]
_cwcMaxToken | CSampleWordBreaker | [private]
_EBufSize enum name | CSampleWordBreaker | [private]
AddRef() | CSampleWordBreaker | [inline]
BreakText(TEXT_SOURCE *pTextSource, IWordSink *pWordSink, IPhraseSink *pPhraseSink) | CSampleWordBreaker |
ComposePhrase(WCHAR const *pwcNoun, ULONG cwcNoun, WCHAR const *pwcModifier, ULONG cwcModifier, ULONG ulAttachmentType, WCHAR *pwcPhrase, ULONG *pcwcPhrase) | CSampleWordBreaker | [inline]
CSampleWordBreaker() | CSampleWordBreaker | [inline]
cwcAtATime enum value | CSampleWordBreaker | [private]
GetLicenseToUse(const WCHAR **ppwcsLicense) | CSampleWordBreaker | [inline]
Init(BOOL fQuery, ULONG cwcMaxToken, BOOL *pfLicense) | CSampleWordBreaker | [inline]
QueryInterface(REFIID riid, void **ppvObject) | CSampleWordBreaker | [inline]
Release() | CSampleWordBreaker | [inline]
Tokenize(TEXT_SOURCE *pTextSource, ULONG cwc, IWordSink *pWordSink, ULONG &cwcProcd) | CSampleWordBreaker | [private]
~CSampleWordBreaker() | CSampleWordBreaker | [inline, private]
Generated on Wed Nov 13 2024 16:57:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/CertEnc.Cpp Source File

  • Security
  • CertServices
  • Encode

CertEnc.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        certenc.cpp
00007 //
00008 // Contents:    Cert Server encode/decode support
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013
00014 #pragma hdrstop
00015
00016 #include "celib.h"
00017 #include "resource.h"
00018 #include "certenc.h"
00019 #include "adate.h"
00020 #include "along.h"
00021 #include "astring.h"
00022 #include "crldist.h"
00023 #include "altname.h"
00024 #include "bitstr.h"
00025
00026 CComModule _Module;
00027 HMODULE g_hModule;
00028
00029 BEGIN_OBJECT_MAP(ObjectMap)
00030     OBJECT_ENTRY(CLSID_CCertEncodeDateArray, CCertEncodeDateArray)
00031     OBJECT_ENTRY(CLSID_CCertEncodeLongArray, CCertEncodeLongArray)
00032     OBJECT_ENTRY(CLSID_CCertEncodeStringArray, CCertEncodeStringArray)
00033     OBJECT_ENTRY(CLSID_CCertEncodeCRLDistInfo, CCertEncodeCRLDistInfo)
00034     OBJECT_ENTRY(CLSID_CCertEncodeAltName, CCertEncodeAltName)
00035     OBJECT_ENTRY(CLSID_CCertEncodeBitString, CCertEncodeBitString)
00036 END_OBJECT_MAP()
00037
00038
00039 /////////////////////////////////////////////////////////////////////////////
00040 // DLL Entry Point
00041
00042 extern "C"
00043 BOOL WINAPI
00044 DllMain(
00045     HINSTANCE hInstance,
00046     DWORD dwReason,
00047     VOID * /* lpReserved */ )
00048 {
00049     g_hModule = hInstance;
00050     if (DLL_PROCESS_ATTACH == dwReason)
00051     {
00052   ceInitErrorMessageText(
00053       hInstance,
00054       IDS_E_UNEXPECTED,
00055       IDS_UNKNOWN_ERROR_CODE);
00056   _Module.Init(ObjectMap, hInstance);
00057   DisableThreadLibraryCalls(hInstance);
00058     }
00059     if (DLL_PROCESS_DETACH == dwReason)
00060     {
00061   _Module.Term();
00062     }
00063     return(TRUE);
00064 }
00065
00066
00067 /////////////////////////////////////////////////////////////////////////////
00068 // Used to determine whether the DLL can be unloaded by OLE
00069
00070 STDAPI
00071 DllCanUnloadNow(VOID)
00072 {
00073     HRESULT hr;
00074
00075     hr = 0 == _Module.GetLockCount()? S_OK : S_FALSE;
00076     return(hr);
00077 }
00078
00079
00080 /////////////////////////////////////////////////////////////////////////////
00081 // Returns a class factory to create an object of the requested type
00082
00083 STDAPI
00084 DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
00085 {
00086     HRESULT hr;
00087
00088     hr = _Module.GetClassObject(rclsid, riid, ppv);
00089     return(hr);
00090 }
00091
00092
00093 /////////////////////////////////////////////////////////////////////////////
00094 // DllRegisterServer - Adds entries to the system registry
00095
00096 STDAPI
00097 DllRegisterServer(VOID)
00098 {
00099     HRESULT hr;
00100
00101     // registers object, typelib and all interfaces in typelib
00102
00103     hr = _Module.RegisterServer(TRUE);
00104     return(hr);
00105 }
00106
00107
00108 /////////////////////////////////////////////////////////////////////////////
00109 // DllUnregisterServer - Removes entries from the system registry
00110
00111 STDAPI
00112 DllUnregisterServer(VOID)
00113 {
00114     _Module.UnregisterServer();
00115     return(S_OK);
00116 }
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step3/StdAfx.cpp Source File

  • NetDS
  • upnp
  • StepByStep
  • Step3

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 //  stdafx.pch will be the pre-compiled header
00003 //  stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 #ifdef _ATL_STATIC_REGISTRY
00008 #include <statreg.h>
00009 #include <statreg.cpp>
00010 #endif
00011
00012 #include <atlimpl.cpp>
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Service/Client.c Source File

  • WinBase
  • Service

Client.c

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00004 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 PARTICULAR PURPOSE.
00006
00007 Copyright (C) 1998 - 2000.  Microsoft Corporation.  All rights reserved.
00008
00009  MODULE:   client.c
00010
00011  PURPOSE:  This program is a command line oriented
00012            demonstration of the Simple service sample.
00013
00014 ----------------------------------------------------------------------------*/
00015
00016 #include <windows.h>
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <string.h>
00020
00021 VOID __cdecl main(int argc, char *argv[])
00022 {
00023    char    inbuf[80];
00024    char    outbuf[80];
00025    DWORD   bytesRead;
00026    BOOL    ret;
00027    LPSTR   lpszPipeName = "\\\\.\\pipe\\simple";
00028    LPSTR   lpszString = "World";
00029    int     ndx;
00030
00031    // allow user to define pipe name
00032    for ( ndx = 1; ndx < argc; ndx++ )
00033    {
00034       if ( (*argv[ndx] == '-') || (*argv[ndx] == '/') )
00035       {
00036          if ( !(stricmp( "pipe", argv[ndx]+1 )) && ( (ndx + 1) < argc))
00037          {
00038             lpszPipeName = argv[++ndx];
00039          }
00040          else if ( !(stricmp( "string", argv[ndx]+1 )) && ( (ndx + 1) < argc))
00041          {
00042             lpszString = argv[++ndx];
00043          }
00044          else
00045          {
00046             printf("usage: client [-pipe <pipename>] [-string <string>]\n");
00047             exit(1);
00048          }
00049       }
00050       else
00051       {
00052          printf("usage: client [-pipe <pipename>] [-string <string>]\n");
00053          exit(1);
00054       }
00055
00056    }
00057
00058    ret = CallNamedPipeA(lpszPipeName,
00059                         inbuf, sizeof(inbuf),
00060                         outbuf, sizeof(outbuf),
00061                         &bytesRead, NMPWAIT_WAIT_FOREVER);
00062
00063    if (!ret)
00064    {
00065       printf("client: CallNamedPipe failed, GetLastError = %d\n", GetLastError());
00066       exit(1);
00067    }
00068
00069    printf("client: received: %s\n", outbuf);
00070 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Concurrency/SyncComp/SyncComp.Cpp Source File

  • Com
  • Services
  • Concurrency
  • SyncComp

SyncComp.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: SyncComp.cpp
00004
00005 Summary: Implementation of WinMain
00006
00007 ----------------------------------------------------------------------------
00008 This file is part of the Microsoft COM+ Samples.
00009
00010 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00011
00012 This source code is intended only as a supplement to Microsoft
00013 Development Tools and/or on-line documentation. See these other
00014 materials for detailed information regarding Microsoft code samples.
00015
00016 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00017 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00019 PARTICULAR PURPOSE.
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #include "resource.h"
00024 #include "main.h"
00025
00026 CComModule _Module;
00027
00028 // a global intereface for getting our COM object between threads
00029 IGlobalInterfaceTable*      g_pGIT;
00030
00031 // dummy object map for ATL
00032 BEGIN_OBJECT_MAP(ObjectMap)
00033 END_OBJECT_MAP()
00034
00035
00036 /////////////////////////////////////////////////////////////////////////////
00037 //
00038 extern "C" int WINAPI _tWinMain(HINSTANCE hInstance,
00039     HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int /*nShowCmd*/)
00040 {
00041
00042     HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
00043     _ASSERTE(SUCCEEDED(hRes));
00044
00045     _Module.Init(NULL, hInstance);
00046
00047   // get the GIT
00048   hRes = CoCreateInstance(CLSID_StdGlobalInterfaceTable,
00049                             NULL,
00050                             CLSCTX_INPROC_SERVER,
00051                             IID_IGlobalInterfaceTable,
00052                             (void **)&g_pGIT);
00053     _ASSERTE(SUCCEEDED(hRes));
00054
00055   // show our dialog
00056   CMain dlg;
00057   dlg.DoModal();
00058
00059   // we are done with the GIT
00060   g_pGIT->Release();
00061
00062   CoUninitialize();
00063
00064     _Module.Term();
00065     return 0;
00066 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/service.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

service.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     System Service Procedures
00006
00007     FILE: Service.c
00008
00009     PURPOSE: Provides file replication service function definitions.
00010
00011     FUNCTIONS:
00012         ReportStatusToSCMgr - Changes the service's status and
00013             registers change with SCM.
00014         AddToMessageLog - Adds a string to the system message log.
00015
00016     COMMENTS: These funtions may be used by the main service routines
00017         as well as by the client and server file replication RPC routines.
00018
00019 */
00020
00021 #include <windows.h>
00022 #include <stdio.h>
00023 #include <tchar.h>
00024
00025 #include "common.h"
00026
00027 #include "Service.h"
00028
00029 /*
00030     FUNCTION: ReportStatusToSCMgr()
00031
00032     PURPOSE: Sets the current status of the service and
00033              reports it to the Service Control Manager
00034
00035     PARAMETERS:
00036         dwCurrentState - the state of the service
00037         dwWin32ExitCode - error code to report
00038         dwWaitHint - worst case estimate to next checkpoint
00039
00040     RETURN VALUE:
00041         TRUE - success
00042         FALSE - failure
00043
00044     COMMENTS:
00045 */
00046 BOOL ReportStatusToSCMgr(SERVICE_STATUS_HANDLE *sshStatusHandle,
00047        SERVICE_STATUS *ssStatus,
00048        DWORD dwCurrentState,
00049        DWORD dwWin32ExitCode,
00050        DWORD dwWaitHint){
00051
00052     static DWORD dwCheckPoint = 1;
00053     BOOL fResult = TRUE;
00054
00055     if (dwCurrentState == SERVICE_START_PENDING)
00056         ssStatus->dwControlsAccepted = 0;
00057     else
00058         ssStatus->dwControlsAccepted = SERVICE_ACCEPT_STOP;
00059
00060     ssStatus->dwCurrentState = dwCurrentState;
00061     ssStatus->dwWin32ExitCode = dwWin32ExitCode;
00062     ssStatus->dwWaitHint = dwWaitHint;
00063
00064     if ( ( dwCurrentState == SERVICE_RUNNING ) || ( dwCurrentState == SERVICE_STOPPED ) ) {
00065         ssStatus->dwCheckPoint = 0;
00066     }
00067     else {
00068         ssStatus->dwCheckPoint = dwCheckPoint++;
00069     }
00070
00071     // Report the status of the service to the service control manager.
00072     if (!(fResult = SetServiceStatus(*sshStatusHandle, ssStatus))) {
00073         AddToMessageLog(TEXT("SetServiceStatus failed"));
00074     }
00075     return fResult;
00076 }
00077
00078 /*
00079     FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
00080
00081     PURPOSE: Allows any thread to log an error message
00082
00083     PARAMETERS:
00084         lpszMsg - text for message
00085
00086     RETURN VALUE:
00087         none
00088
00089     COMMENTS:
00090 */
00091 VOID AddToMessageLog(LPTSTR lpszMsg){
00092     TCHAR szMsg[256];
00093     HANDLE hEventSource;
00094     LPTSTR lpszStrings[2];
00095     DWORD dwErr = 0;
00096
00097     dwErr = GetLastError();
00098
00099     // Use event logging to log the error.
00100     hEventSource = RegisterEventSource(NULL, TEXT(SERVICENAME));
00101
00102     _stprintf(szMsg, TEXT("%s error: %d"), TEXT(SERVICENAME), dwErr);
00103     lpszStrings[0] = szMsg;
00104     lpszStrings[1] = lpszMsg;
00105
00106     if (hEventSource != NULL) {
00107         ReportEvent(hEventSource, // handle of event source
00108         EVENTLOG_ERROR_TYPE, // event type
00109         0, // event category
00110         0, // event ID
00111         NULL, // current user's SID
00112         2, // strings in lpszStrings
00113         0, // no bytes of raw data
00114         (LPCTSTR *) lpszStrings, // array of error strings
00115         NULL); // no raw data
00116
00117         (VOID) DeregisterEventSource(hEventSource);
00118     }
00119 }
00120
00121 // Heap for use by midl_user_allocate and midl_user_free.
00122 HANDLE RpcHeap;
00123
00124 /*
00125     MIDL allocate() and free()
00126 */
00127
00128 VOID __RPC_FAR * __RPC_API midl_user_allocate(size_t len) {
00129     return(HeapAlloc(RpcHeap, 0, len));
00130 }
00131
00132 VOID __RPC_API midl_user_free(VOID __RPC_FAR * ptr) {
00133     if(ptr != NULL) {
00134         HeapFree(RpcHeap, 0, ptr);
00135     }
00136 }
00137
00138 // end Service.c
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Exit/C++/Windows2000/Exit.Cpp Source File

  • Security
  • CertServices
  • Exit
  • C++
  • Windows2000

Exit.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        exit.cpp
00007 //
00008 // Contents:    CCertExitSample implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013 #pragma hdrstop
00014
00015 #include <stdio.h>
00016 #include <assert.h>
00017 #include "celibw2k.h"
00018 #include "exit.h"
00019 #include "module.h"
00020
00021 #ifndef szOID_CERTTYPE_EXTENSION
00022 # define szOID_CERTTYPE_EXTENSION szOID_ENROLL_CERTTYPE_EXTENSION
00023 #endif
00024
00025 BOOL fDebug = DBG_CERTSRV;
00026
00027 #ifndef DBG_CERTSRV
00028 #error -- DBG_CERTSRV not defined!
00029 #endif
00030
00031 #define ceEXITEVENTS \
00032   EXITEVENT_CERTISSUED | \
00033   EXITEVENT_CERTPENDING | \
00034   EXITEVENT_CERTDENIED | \
00035   EXITEVENT_CERTREVOKED | \
00036   EXITEVENT_CERTRETRIEVEPENDING | \
00037   EXITEVENT_CRLISSUED | \
00038   EXITEVENT_SHUTDOWN
00039
00040 #define CERTTYPE_ATTR_NAME TEXT("CertificateTemplate")
00041 #define wszCertFile TEXT("CertFile")
00042 #define MAX_CRL_PROP (32 + 10)
00043
00044 extern HINSTANCE g_hInstance;
00045
00046
00047 // worker
00048 HRESULT
00049 GetServerCallbackInterface(
00050     OUT ICertServerExit** ppServer,
00051     IN LONG Context)
00052 {
00053     HRESULT hr;
00054
00055     if (NULL == ppServer)
00056     {
00057         hr = E_POINTER;
00058   _JumpError(hr, error, "Exit:NULL pointer");
00059     }
00060
00061     hr = CoCreateInstance(
00062                     CLSID_CCertServerExit,
00063                     NULL,               // pUnkOuter
00064                     CLSCTX_INPROC_SERVER,
00065                     IID_ICertServerExit,
00066                     (VOID **) ppServer);
00067     _JumpIfError(hr, error, "Exit:CoCreateInstance");
00068
00069     if (*ppServer == NULL)
00070     {
00071         hr = E_UNEXPECTED;
00072   _JumpError(hr, error, "Exit:NULL *ppServer");
00073     }
00074
00075     // only set context if nonzero
00076     if (0 != Context)
00077     {
00078         hr = (*ppServer)->SetContext(Context);
00079         _JumpIfError(hr, error, "Exit: SetContext");
00080     }
00081
00082 error:
00083     return hr;
00084 }
00085
00086
00087 //+--------------------------------------------------------------------------
00088 // CCertExitSample::~CCertExitSample -- destructor
00089 //
00090 // free memory associated with this instance
00091 //+--------------------------------------------------------------------------
00092
00093 CCertExitSample::~CCertExitSample()
00094 {
00095     if (NULL != m_strCAName)
00096     {
00097         SysFreeString(m_strCAName);
00098     }
00099     if (NULL != m_wszRegStorageLoc)
00100     {
00101         LocalFree(m_wszRegStorageLoc);
00102     }
00103     if (NULL != m_hExitKey)
00104     {
00105         RegCloseKey(m_hExitKey);
00106     }
00107     if (NULL != m_bstrDescription)
00108     {
00109         SysFreeString(m_bstrDescription);
00110     }
00111
00112 }
00113
00114
00115 //+--------------------------------------------------------------------------
00116 // CCertExitSample::Initialize -- initialize for a CA & return interesting Event Mask
00117 //
00118 // Returns S_OK on success.
00119 //+--------------------------------------------------------------------------
00120
00121 STDMETHODIMP
00122 CCertExitSample::Initialize(
00123     /* [in] */ BSTR const strConfig,
00124     /* [retval][out] */ LONG __RPC_FAR *pEventMask)
00125 {
00126     HRESULT hr = S_OK;
00127     HKEY        hkey = NULL;
00128     DWORD       cbbuf;
00129     DWORD       dwType;
00130     ENUM_CATYPES CAType;
00131     LPWSTR      pwszCLSIDCertExit = NULL;
00132     ICertServerExit* pServer = NULL;
00133     VARIANT varValue;
00134
00135     WCHAR sz[MAX_PATH];
00136
00137     assert(wcslen(wsz_SAMPLE_DESCRIPTION) < ARRAYSIZE(sz));
00138     wcscpy(sz, wsz_SAMPLE_DESCRIPTION);
00139
00140     m_bstrDescription = SysAllocString(sz);
00141     if (NULL == m_bstrDescription)
00142     {
00143         hr = E_OUTOFMEMORY;
00144         _JumpError(hr, error, "Exit:SysAllocString");
00145     }
00146
00147
00148     VariantInit(&varValue);
00149
00150     m_strCAName = SysAllocString(strConfig);
00151     if (NULL == m_strCAName)
00152     {
00153       hr = E_OUTOFMEMORY;
00154         _JumpError(hr, error, "Exit:SysAllocString");
00155     }
00156
00157     *pEventMask = ceEXITEVENTS;
00158     DBGPRINT((fDebug, "Exit:Initialize(%ws) ==> %x\n", m_strCAName, *pEventMask));
00159
00160
00161     // get server callbacks
00162     hr = GetServerCallbackInterface(&pServer, 0);
00163     _JumpIfError(hr, error, "Exit:GetServerCallbackInterface");
00164
00165     // get storage location
00166     hr = pServer->GetCertificateProperty(wszPROPMODULEREGLOC, PROPTYPE_STRING, &varValue);
00167     _JumpIfErrorStr(hr, error, "Exit:GetCertificateProperty", wszPROPMODULEREGLOC);
00168
00169     m_wszRegStorageLoc = (LPWSTR)LocalAlloc(LMEM_FIXED, (wcslen(varValue.bstrVal)+1) *sizeof(WCHAR));
00170     if (NULL == m_wszRegStorageLoc)
00171     {
00172         hr = E_OUTOFMEMORY;
00173         _JumpError(hr, error, "Exit:LocalAlloc");
00174     }
00175     wcscpy(m_wszRegStorageLoc, varValue.bstrVal);
00176     VariantClear(&varValue);
00177
00178     // get CA type
00179     hr = pServer->GetCertificateProperty(wszPROPCATYPE, PROPTYPE_LONG, &varValue);
00180     _JumpIfErrorStr(hr, error, "Exit:GetCertificateProperty", wszPROPCATYPE);
00181
00182     CAType = (ENUM_CATYPES)varValue.lVal;
00183     VariantClear(&varValue);
00184
00185     hr = RegOpenKeyEx(
00186                 HKEY_LOCAL_MACHINE,
00187                 m_wszRegStorageLoc,
00188                 0,              // dwReserved
00189                 KEY_ENUMERATE_SUB_KEYS | KEY_EXECUTE | KEY_QUERY_VALUE,
00190                 &m_hExitKey);
00191
00192     if (S_OK != hr)
00193     {
00194         if (ERROR_FILE_NOT_FOUND == hr)
00195         {
00196             hr = S_OK;
00197             goto error;
00198         }
00199         _JumpError(hr, error, "Exit:RegOpenKeyEx");
00200     }
00201
00202
00203     // Initialize the revocation information
00204
00205     hr = pServer->GetCertificateProperty(wszPROPCERTCOUNT, PROPTYPE_LONG, &varValue);
00206     _JumpIfErrorStr(hr, error, "Exit:GetCertificateProperty", wszPROPCERTCOUNT);
00207
00208     m_cCACert = varValue.lVal;
00209
00210
00211
00212     cbbuf = sizeof(m_cCRLPublishRetryCount);
00213     hr = RegQueryValueEx(
00214         m_hExitKey,
00215         wszCRLPUBLISHRETRYCOUNT,
00216         NULL,           // lpdwReserved
00217         &dwType,
00218         (BYTE *) &m_cCRLPublishRetryCount,
00219         &cbbuf);
00220     if (S_OK != hr)
00221     {
00222         m_cCRLPublishRetryCount = CRL_PUBLISH_RETRY_DEFAULT;
00223     }
00224
00225     cbbuf = sizeof(m_dwExitPublishFlags);
00226     hr = RegQueryValueEx(
00227         m_hExitKey,
00228         wszREGCERTPUBLISHFLAGS,
00229         NULL,           // lpdwReserved
00230         &dwType,
00231         (BYTE *) &m_dwExitPublishFlags,
00232         &cbbuf);
00233     if (S_OK != hr)
00234     {
00235         m_dwExitPublishFlags = 0;
00236     }
00237     hr = S_OK;
00238
00239 error:
00240     if (NULL != hkey)
00241     {
00242         RegCloseKey(hkey);
00243     }
00244     VariantClear(&varValue);
00245     if (NULL != pServer)
00246     {
00247         pServer->Release();
00248     }
00249     return(ceHError(hr));
00250 }
00251
00252
00253 //+--------------------------------------------------------------------------
00254 // CCertExitSample::_ExpandEnvironmentVariables -- Expand environment variables
00255 //
00256 //+--------------------------------------------------------------------------
00257
00258 HRESULT
00259 CCertExitSample::_ExpandEnvironmentVariables(
00260     IN WCHAR const *pwszIn,
00261     OUT WCHAR *pwszOut,
00262     IN DWORD cwcOut)
00263 {
00264     HRESULT hr = HRESULT_FROM_WIN32(ERROR_BUFFER_OVERFLOW);
00265     WCHAR awcVar[MAX_PATH];
00266     WCHAR const *pwszSrc;
00267     WCHAR *pwszDst;
00268     WCHAR *pwszDstEnd;
00269     WCHAR *pwszVar;
00270     DWORD cwc;
00271
00272     pwszSrc = pwszIn;
00273     pwszDst = pwszOut;
00274     pwszDstEnd = &pwszOut[cwcOut];
00275
00276     while (L'\0' != (*pwszDst = *pwszSrc++))
00277     {
00278   if ('%' == *pwszDst)
00279   {
00280       *pwszDst = L'\0';
00281       pwszVar = awcVar;
00282
00283       while (L'\0' != *pwszSrc)
00284       {
00285     if ('%' == *pwszSrc)
00286     {
00287         pwszSrc++;
00288         break;
00289     }
00290     *pwszVar++ = *pwszSrc++;
00291     if (pwszVar >= &awcVar[sizeof(awcVar)/sizeof(awcVar[0]) - 1])
00292     {
00293         _JumpError(hr, error, "Exit:overflow 1");
00294     }
00295       }
00296       *pwszVar = L'\0';
00297       cwc = (DWORD)GetEnvironmentVariable(awcVar, pwszDst, (DWORD)SAFE_SUBTRACT_POINTERS(pwszDstEnd, pwszDst));
00298       if (0 == cwc)
00299       {
00300     hr = ceHLastError();
00301     _JumpError(hr, error, "Exit:GetEnvironmentVariable");
00302       }
00303       if ((DWORD) (pwszDstEnd - pwszDst) <= cwc)
00304       {
00305     _JumpError(hr, error, "Exit:overflow 2");
00306       }
00307       pwszDst += cwc;
00308   }
00309   else
00310   {
00311       pwszDst++;
00312   }
00313   if (pwszDst >= pwszDstEnd)
00314   {
00315       _JumpError(hr, error, "Exit:overflow 3");
00316   }
00317     }
00318     hr = S_OK;
00319
00320 error:
00321     return(hr);
00322 }
00323
00324
00325 //+--------------------------------------------------------------------------
00326 // CCertExitSample::_WriteCertToFile -- write binary certificate to a file
00327 //
00328 //+--------------------------------------------------------------------------
00329
00330 HRESULT
00331 CCertExitSample::_WriteCertToFile(
00332     IN ICertServerExit *pServer,
00333     IN BYTE const *pbCert,
00334     IN DWORD cbCert)
00335 {
00336     HRESULT hr;
00337     BSTR strCertFile = NULL;
00338     DWORD cbWritten;
00339     HANDLE hFile = INVALID_HANDLE_VALUE;
00340     WCHAR wszPath[MAX_PATH];
00341     WCHAR const *pwszFile;
00342     WCHAR const *pwsz;
00343
00344
00345     hr = pServer->GetRequestAttribute(wszCertFile, &strCertFile);
00346     if (S_OK != hr)
00347     {
00348   DBGPRINT((
00349       fDebug,
00350       "Exit:GetRequestAttribute(%ws): %x%s\n",
00351       wszCertFile,
00352       hr,
00353       CERTSRV_E_PROPERTY_EMPTY == hr? " EMPTY VALUE" : ""));
00354   if (CERTSRV_E_PROPERTY_EMPTY == hr)
00355   {
00356       hr = S_OK;
00357   }
00358   goto error;
00359     }
00360
00361     pwszFile = wcsrchr(strCertFile, L'\\');
00362     if (NULL == pwszFile)
00363     {
00364   pwszFile = strCertFile;
00365     }
00366     else
00367     {
00368   pwszFile++;
00369     }
00370     pwsz = wcsrchr(pwszFile, L'/');
00371     if (NULL != pwsz)
00372     {
00373   pwszFile = &pwsz[1];
00374     }
00375
00376     hr = _ExpandEnvironmentVariables(
00377         L"%SystemRoot%\\System32\\" wszCERTENROLLSHAREPATH L"\\",
00378         wszPath,
00379         ARRAYSIZE(wszPath));
00380     _JumpIfError(hr, error, "_ExpandEnvironmentVariables");
00381
00382     if (ARRAYSIZE(wszPath) <= wcslen(wszPath) + wcslen(pwszFile))
00383     {
00384   hr = HRESULT_FROM_WIN32(ERROR_BUFFER_OVERFLOW);
00385   _JumpError(hr, error, "Exit:Path too long");
00386     }
00387     wcscat(wszPath, pwszFile);
00388
00389     // open file & write binary cert out.
00390
00391     hFile = CreateFile(
00392         wszPath,
00393         GENERIC_WRITE,
00394         0,      // dwShareMode
00395         NULL,   // lpSecurityAttributes
00396         CREATE_NEW,
00397         FILE_ATTRIBUTE_NORMAL,
00398         NULL);    // hTemplateFile
00399     if (INVALID_HANDLE_VALUE == hFile)
00400     {
00401   hr = ceHLastError();
00402   _JumpErrorStr(hr, error, "Exit:CreateFile", wszPath);
00403     }
00404     if (!WriteFile(hFile, pbCert, cbCert, &cbWritten, NULL))
00405     {
00406   hr = ceHLastError();
00407   _JumpErrorStr(hr, error, "Exit:WriteFile", wszPath);
00408     }
00409     if (cbWritten != cbCert)
00410     {
00411   hr = STG_E_WRITEFAULT;
00412   DBGPRINT((
00413       fDebug,
00414       "Exit:WriteFile(%ws): attempted %x, actual %x bytes: %x\n",
00415       wszPath,
00416       cbCert,
00417       cbWritten,
00418       hr));
00419   goto error;
00420     }
00421
00422 error:
00423
00424     if (INVALID_HANDLE_VALUE != hFile)
00425     {
00426   CloseHandle(hFile);
00427     }
00428     if (NULL != strCertFile)
00429     {
00430   SysFreeString(strCertFile);
00431     }
00432     return(hr);
00433 }
00434
00435
00436 //+--------------------------------------------------------------------------
00437 // CCertExitSample::_NotifyNewCert -- Notify the exit module of a new certificate
00438 //
00439 //+--------------------------------------------------------------------------
00440
00441 HRESULT
00442 CCertExitSample::_NotifyNewCert(
00443     /* [in] */ LONG Context)
00444 {
00445     HRESULT hr;
00446     HRESULT hr2;
00447     VARIANT varCert;
00448     VARIANT varExt;
00449     ICertServerExit *pServer = NULL;
00450     BSTR strCertType = NULL;
00451     CERT_NAME_VALUE *pName = NULL;
00452     DWORD cbType;
00453
00454     VariantInit(&varCert);
00455     VariantInit(&varExt);
00456     hr = CoCreateInstance(
00457         CLSID_CCertServerExit,
00458         NULL,               // pUnkOuter
00459         CLSCTX_INPROC_SERVER,
00460         IID_ICertServerExit,
00461         (VOID **) &pServer);
00462     _JumpIfError(hr, error, "Exit:CoCreateInstance");
00463
00464     hr = pServer->SetContext(Context);
00465     _JumpIfError(hr, error, "Exit:SetContext");
00466
00467     hr = pServer->GetCertificateProperty(
00468              wszPROPRAWCERTIFICATE,
00469              PROPTYPE_BINARY,
00470              &varCert);
00471     _JumpIfErrorStr(hr, error, "Exit:GetCertificateProperty", wszPROPRAWCERTIFICATE);
00472
00473     if (VT_BSTR != varCert.vt)
00474     {
00475   hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00476   _JumpError(hr, error, "Exit:BAD cert var type");
00477     }
00478
00479     hr = pServer->GetCertificateExtension(
00480                                     TEXT(szOID_CERTTYPE_EXTENSION),
00481                                     PROPTYPE_BINARY,
00482                                     &varExt);
00483     if (S_OK == hr)
00484     {
00485         // There was a cert type indicator.
00486         // varExt points to an encoded string
00487
00488         if (VT_BSTR != varExt.vt)
00489   {
00490       hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00491       _JumpError(hr, error, "Exit:BAD var type");
00492   }
00493         if (!ceDecodeObject(
00494       X509_ASN_ENCODING,
00495       X509_UNICODE_ANY_STRING,
00496       (BYTE *) varExt.bstrVal,
00497       SysStringByteLen(varExt.bstrVal),
00498       FALSE,
00499       (VOID **) &pName,
00500       &cbType))
00501         {
00502       hr = ceHLastError();
00503       _JumpError(hr, error, "Exit:ceDecodeObject");
00504         }
00505         strCertType = SysAllocStringByteLen(
00506         (char *) pName->Value.pbData,
00507         pName->Value.cbData);
00508         if (NULL == strCertType)
00509         {
00510             hr = E_OUTOFMEMORY;
00511       _JumpError(hr, error, "Exit:SysAllocStringByteLen");
00512         }
00513     }
00514     else
00515     {
00516         // see if there is a type name in the request attributes
00517
00518         hr = pServer->GetRequestAttribute(CERTTYPE_ATTR_NAME, &strCertType);
00519   _PrintIfError2(hr, "Exit:GetRequestAttribute", hr);
00520     }
00521     DBGPRINT((fDebug, "Exit:CertType = %ws\n", strCertType));
00522
00523     hr = S_OK;
00524
00525
00526     if (m_dwExitPublishFlags & EXITPUB_FILE)
00527     {
00528   hr2 = _WriteCertToFile(
00529       pServer,
00530       (BYTE const *) varCert.bstrVal,
00531       SysStringByteLen(varCert.bstrVal));
00532   _PrintIfError(hr2, "_WriteCertToFile");
00533   if (S_OK == hr)
00534   {
00535       hr = hr2;
00536   }
00537     }
00538
00539
00540 error:
00541     if (NULL != pName)
00542     {
00543         LocalFree(pName);
00544     }
00545     if (NULL != strCertType)
00546     {
00547   SysFreeString(strCertType);
00548     }
00549     VariantClear(&varCert);
00550     VariantClear(&varExt);
00551     if (NULL != pServer)
00552     {
00553   pServer->Release();
00554     }
00555     return(hr);
00556 }
00557
00558 //+--------------------------------------------------------------------------
00559 // CCertExitSample::_NotifyCRLIssued -- Notify the exit module of a new certificate
00560 //
00561 //+--------------------------------------------------------------------------
00562
00563 HRESULT
00564 CCertExitSample::_NotifyCRLIssued(
00565     /* [in] */ LONG Context)
00566 {
00567     HRESULT hr;
00568     ICertServerExit *pServer = NULL;
00569     DWORD i;
00570     VARIANT varCRL;
00571     DWORD cbbuf;
00572     DWORD err;
00573     DWORD dwType;
00574     BSTR bstrCRL = NULL;
00575
00576     VariantInit(&varCRL);
00577
00578
00579     hr = CoCreateInstance(
00580         CLSID_CCertServerExit,
00581         NULL,               // pUnkOuter
00582         CLSCTX_INPROC_SERVER,
00583         IID_ICertServerExit,
00584         (VOID **) &pServer);
00585     _JumpIfError(hr, error, "Exit:CoCreateInstance");
00586
00587     hr = pServer->SetContext(Context);
00588     _JumpIfError(hr, error, "Exit:SetContext");
00589
00590
00591     // How many CRL's are there?
00592
00593     // Loop for each CRL
00594     for (i = 0; i < m_cCACert; i++)
00595     {
00596         WCHAR wszCRLPROP[MAX_CRL_PROP];
00597
00598         // Verify the CRL State says we should update this CRL
00599
00600         wsprintf(wszCRLPROP, wszPROPCRLSTATE L".%u", i);
00601         hr = pServer->GetCertificateProperty(
00602                  wszCRLPROP,
00603                  PROPTYPE_LONG,
00604                  &varCRL);
00605         _JumpIfErrorStr(hr, error, "Exit:GetCertificateProperty", wszCRLPROP);
00606
00607   if (CA_DISP_VALID != varCRL.lVal)
00608   {
00609       continue;
00610   }
00611
00612
00613         // Grab the raw CRL
00614
00615         wsprintf(wszCRLPROP, wszPROPRAWCRL L".%u", i);
00616         hr = pServer->GetCertificateProperty(
00617                  wszCRLPROP,
00618                  PROPTYPE_BINARY,
00619                  &varCRL);
00620         _JumpIfErrorStr(hr, error, "Exit:GetCertificateProperty", wszCRLPROP);
00621
00622         // Publish the CRL
00623
00624     }
00625
00626     cbbuf = sizeof(m_cCRLPublishRetryCount);
00627     err = RegQueryValueEx(
00628         m_hExitKey,
00629         wszCRLPUBLISHRETRYCOUNT,
00630         NULL,           // lpdwReserved
00631         &dwType,
00632         (LPBYTE)&m_cCRLPublishRetryCount,
00633         &cbbuf);
00634     if(err == ERROR_FILE_NOT_FOUND)
00635     {
00636         m_cCRLPublishRetryCount = CRL_PUBLISH_RETRY_DEFAULT;
00637         err = ERROR_SUCCESS;
00638     }
00639     hr = HRESULT_FROM_WIN32(err);
00640     _JumpIfError(hr, error, "Exit:RegQueryValueEx");
00641
00642 error:
00643     if (NULL != bstrCRL)
00644     {
00645         SysFreeString(bstrCRL);
00646     }
00647     if (NULL != pServer)
00648     {
00649   pServer->Release();
00650     }
00651     VariantClear(&varCRL);
00652
00653
00654     return(hr);
00655 }
00656
00657
00658 //+--------------------------------------------------------------------------
00659 // CCertExitSample::Notify -- Notify the exit module of an event
00660 //
00661 // Returns S_OK.
00662 //+--------------------------------------------------------------------------
00663
00664 STDMETHODIMP
00665 CCertExitSample::Notify(
00666     /* [in] */ LONG ExitEvent,
00667     /* [in] */ LONG Context)
00668 {
00669     char *psz = "UNKNOWN EVENT";
00670     HRESULT hr = S_OK;
00671
00672     switch (ExitEvent)
00673     {
00674   case EXITEVENT_CERTISSUED:
00675       hr = _NotifyNewCert(Context);
00676       psz = "certissued";
00677       break;
00678
00679   case EXITEVENT_CERTPENDING:
00680       psz = "certpending";
00681       break;
00682
00683   case EXITEVENT_CERTDENIED:
00684       psz = "certdenied";
00685       break;
00686
00687   case EXITEVENT_CERTREVOKED:
00688       psz = "certrevoked";
00689       break;
00690
00691   case EXITEVENT_CERTRETRIEVEPENDING:
00692       psz = "retrievepending";
00693       break;
00694
00695   case EXITEVENT_CRLISSUED:
00696       hr = _NotifyCRLIssued(Context);
00697       psz = "crlissued";
00698       break;
00699
00700   case EXITEVENT_SHUTDOWN:
00701       psz = "shutdown";
00702       break;
00703     }
00704
00705     DBGPRINT((fDebug, "Exit:Notify(%s=%x, ctx=%u) rc=%x\n", psz, ExitEvent, Context, hr));
00706     return(hr);
00707 }
00708
00709
00710 STDMETHODIMP
00711 CCertExitSample::GetDescription(
00712     /* [retval][out] */ BSTR *pstrDescription)
00713 {
00714     HRESULT hr = S_OK;
00715     WCHAR sz[MAX_PATH];
00716
00717     assert(wcslen(wsz_SAMPLE_DESCRIPTION) < ARRAYSIZE(sz));
00718     wcscpy(sz, wsz_SAMPLE_DESCRIPTION);
00719
00720     *pstrDescription = SysAllocString(sz);
00721     if (NULL == *pstrDescription)
00722     {
00723   hr = E_OUTOFMEMORY;
00724   _JumpError(hr, error, "Exit:SysAllocString");
00725     }
00726
00727 error:
00728     return(hr);
00729 }
00730
00731
00732 /////////////////////////////////////////////////////////////////////////////
00733 //
00734
00735 STDMETHODIMP
00736 CCertExitSample::InterfaceSupportsErrorInfo(REFIID riid)
00737 {
00738     int i;
00739     static const IID *arr[] =
00740     {
00741   &IID_ICertExit,
00742     };
00743
00744     for (i = 0; i < sizeof(arr)/sizeof(arr[0]); i++)
00745     {
00746   if (IsEqualGUID(*arr[i],riid))
00747   {
00748       return(S_OK);
00749   }
00750     }
00751     return(S_FALSE);
00752 }
00753
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/GdiDemo/XForm.c Source File

  • Multimedia
  • Gdi
  • GdiDemo

XForm.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /*-------------------------------------------------------------------------*\
00013 | XFORM MODULE
00014 \*---------------------------------------------------------------------------*/
00015
00016 #include <windows.h>
00017 #include "gdidemo.h"
00018 #include "xform.h"
00019
00020 VOID ResetXForm(HWND);
00021 VOID DrawXForm(HWND);
00022
00023
00024 /*---------------------------------------------------------------------------*\
00025 | CREATE XFORM WINDOW PROCEDURE
00026 \*---------------------------------------------------------------------------*/
00027 HWND FAR CreateXFormWindow(HWND hWndClient, int nItem)
00028 {
00029     HANDLE          hInstance;
00030     MDICREATESTRUCT mcs;
00031     static char buffer[256];
00032
00033
00034     hInstance = GETINSTANCE(hWndClient);
00035     LoadString (hInstance, XFORMTITLE, buffer, 256);
00036
00037     /*
00038     ** Initialize the MDI create struct for creation of the
00039     ** test window.
00040     */
00041     mcs.szClass = XFORMCLASS;
00042     mcs.szTitle = buffer;
00043     mcs.hOwner  = hInstance;
00044     mcs.x       = CW_USEDEFAULT;
00045     mcs.y       = CW_USEDEFAULT;
00046     mcs.cx      = CW_USEDEFAULT;
00047     mcs.cy      = CW_USEDEFAULT;
00048     mcs.style   = 0l;
00049     mcs.lParam  = (LONG)nItem;
00050
00051     return((HWND)SendMessage(hWndClient,WM_MDICREATE,0,(LPARAM)(LPMDICREATESTRUCT)&mcs));
00052 }
00053
00054
00055 /*---------------------------------------------------------------------------*\
00056 | XFORM WINDOW PROCEDURE
00057 \*---------------------------------------------------------------------------*/
00058 LRESULT CALLBACK XFormProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
00059 {
00060     switch(wMsg)
00061     {
00062         case WM_CREATE:
00063             XFormCreateProc(hWnd);
00064             break;
00065
00066
00067         case WM_MOVE:
00068             ResetXForm(hWnd);
00069             break;
00070
00071
00072         case WM_TIMER:
00073             DrawXForm(hWnd);
00074             break;
00075
00076
00077         case WM_COMMAND:
00078             XFormCommandProc(hWnd,wParam,lParam);
00079             break;
00080
00081
00082         case WM_PAINT:
00083             XFormPaintProc(hWnd);
00084             break;
00085
00086
00087         case WM_DESTROY:
00088             XFormDestroyProc(hWnd);
00089             break;
00090
00091
00092         default:
00093             return(DefMDIChildProc(hWnd,wMsg,wParam,lParam));
00094     }
00095     return(0l);
00096 }
00097
00098
00099 /*---------------------------------------------------------------------------*\
00100 | XFORM CREATE PROCEDURE
00101 \*---------------------------------------------------------------------------*/
00102 BOOL XFormCreateProc(HWND hWnd)
00103 {
00104     PXFORMDATA pxd;
00105
00106 #ifndef NOT_IMPLEMENTED
00107
00108     RECT       rect;
00109     int        dx,dy;
00110
00111 #endif
00112
00113     if(AllocWindowInfo(hWnd,sizeof(XFORMDATA)))
00114     {
00115         if(pxd = (PXFORMDATA)LockWindowInfo(hWnd))
00116         {
00117
00118 #ifndef NOT_IMPLEMENTED
00119
00120             GetClientRect(hWnd,&rect);
00121
00122             dx = (rect.right + rect.left) >> 4;
00123             dy = (rect.bottom + rect.top) >> 4;
00124
00125             pxd->pObject[0].x = dx << 1;
00126             pxd->pObject[0].y = 0;
00127             pxd->pObject[1].x = dx;
00128             pxd->pObject[1].y = dy;
00129             pxd->pObject[2].x = 0;
00130             pxd->pObject[2].y = dy;
00131             pxd->pObject[3].x = dx << 1;
00132             pxd->pObject[3].y = 0;
00133             pxd->nObject      = 4;
00134
00135             pxd->xForm.eM11 = (float) 0.866;
00136             pxd->xForm.eM12 = (float) 0.5;
00137             pxd->xForm.eM21 = (float)-0.5;
00138             pxd->xForm.eM22 = (float) 0.866;
00139             pxd->xForm.eDx  = (float) 0;
00140             pxd->xForm.eDy  = (float) 0;
00141
00142 #endif
00143
00144             UnlockWindowInfo(hWnd);
00145
00146             SetTimer(hWnd,1,500,NULL);
00147
00148             return(TRUE);
00149         }
00150         FreeWindowInfo(hWnd);
00151     }
00152     return(FALSE);
00153 }
00154
00155
00156 /*---------------------------------------------------------------------------*\
00157 | XFORM COMMAND PROCEDURE
00158 \*---------------------------------------------------------------------------*/
00159 BOOL XFormCommandProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
00160 {
00161     hWnd   = hWnd;
00162     wParam = wParam;
00163     lParam = lParam;
00164
00165     return(TRUE);
00166 }
00167
00168
00169 /*---------------------------------------------------------------------------*\
00170 | XFORM PAINT PROCEDURE
00171 \*---------------------------------------------------------------------------*/
00172 VOID XFormPaintProc(HWND hWnd)
00173 {
00174     HDC         hDC;
00175     PAINTSTRUCT ps;
00176
00177
00178     if(hDC = BeginPaint(hWnd,&ps))
00179         EndPaint(hWnd,&ps);
00180
00181     ResetXForm(hWnd);
00182
00183     return;
00184 }
00185
00186
00187 /*---------------------------------------------------------------------------*\
00188 | XFORM DESTROY PROCEDURE
00189 \*---------------------------------------------------------------------------*/
00190 VOID XFormDestroyProc(HWND hWnd)
00191 {
00192     KillTimer(hWnd,1);
00193     FreeWindowInfo(hWnd);
00194     return;
00195 }
00196
00197
00198
00199 VOID ResetXForm(HWND hWnd)
00200 {
00201     PXFORMDATA pxd;
00202     HDC        hDC;
00203
00204 #ifndef NOT_IMPLEMENTED
00205
00206     RECT       rect;
00207
00208 #endif
00209
00210
00211     if(pxd = (PXFORMDATA)LockWindowInfo(hWnd))
00212     {
00213         if(hDC = GetDC(hWnd))
00214         {
00215
00216 #ifndef NOT_IMPLEMENTED
00217
00218             GetClientRect(hWnd,&rect);
00219             BitBlt(hDC,0,0,rect.right,rect.bottom,(HDC)0,0,0,0);
00220
00221             SetViewportOrgEx(hDC,rect.right >> 1,rect.bottom >> 1,NULL);
00222             SetWorldTransform(hDC,(LPXFORM)&pxd->xForm);
00223             Polyline(hDC,pxd->pObject,pxd->nObject);
00224             ModifyWorldTransform(hDC,(LPXFORM)&pxd->xForm,MWT_IDENTITY);
00225
00226
00227             // I have to put this in since GDI currently doesn't
00228             // reset the drawing attributes -- 5/24/91
00229             //
00230             SetViewportOrgEx(hDC,0,0,NULL);
00231
00232 #endif
00233
00234             ReleaseDC(hWnd,hDC);
00235         }
00236         UnlockWindowInfo(hWnd);
00237     }
00238     return;
00239 }
00240
00241
00242 VOID DrawXForm(HWND hWnd)
00243 {
00244     PXFORMDATA pxd;
00245     HDC        hDC;
00246 #ifndef NOT_IMPLEMENTED
00247     XFORM      xForm;
00248     RECT       rect;
00249 #endif
00250
00251
00252     if(pxd = (PXFORMDATA)LockWindowInfo(hWnd))
00253     {
00254         if(hDC = GetDC(hWnd))
00255         {
00256
00257 #ifndef NOT_IMPLEMENTED
00258
00259             GetClientRect(hWnd,&rect);
00260             SetViewportOrgEx(hDC,rect.right >> 1, rect.bottom >> 1,NULL);
00261
00262
00263             SetWorldTransform(hDC,(LPXFORM)&pxd->xForm);
00264             Polyline(hDC,pxd->pObject,pxd->nObject);
00265
00266             ModifyWorldTransform(hDC,(LPXFORM)&pxd->xForm,MWT_RIGHTMULTIPLY);
00267             Polyline(hDC,pxd->pObject,pxd->nObject);
00268
00269             GetWorldTransform(hDC,(LPXFORM)&xForm);
00270             pxd->xForm.eM11 = xForm.eM11;
00271             pxd->xForm.eM12 = xForm.eM12;
00272             pxd->xForm.eM21 = xForm.eM21;
00273             pxd->xForm.eM22 = xForm.eM22;
00274             pxd->xForm.eDx  = xForm.eDx;
00275             pxd->xForm.eDy  = xForm.eDy;
00276
00277             ModifyWorldTransform(hDC,(LPXFORM)&pxd->xForm,MWT_IDENTITY);
00278
00279
00280             // I have to put this in since GDI currently doesn't
00281             // reset the drawing attributes -- 5/24/91
00282             //
00283             SetViewportOrgEx(hDC,0,0,NULL);
00284
00285 #endif
00286             ReleaseDC(hWnd,hDC);
00287         }
00288         UnlockWindowInfo(hWnd);
00289     }
00290     return;
00291 }
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/DELQDlg.Cpp Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

DELQDlg.Cpp

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // DelQDlg.cpp : implementation file
00013 //
00014
00015
00016
00017 #include "stdafx.h"
00018 #include "MQApitst.h"
00019 #include "DelQDlg.h"
00020
00021 #ifdef _DEBUG
00022 #define new DEBUG_NEW
00023 #undef THIS_FILE
00024 static char THIS_FILE[] = __FILE__;
00025 #endif
00026
00027 /////////////////////////////////////////////////////////////////////////////
00028 // CDeleteQueueDialog dialog
00029
00030
00031 CDeleteQueueDialog::CDeleteQueueDialog(CArray<ARRAYQ*, ARRAYQ*>* pStrArray, CWnd* pParent /*=NULL*/)
00032   : CDialog(CDeleteQueueDialog::IDD, pParent)
00033 {
00034   m_pStrArray = pStrArray;
00035
00036   //{{AFX_DATA_INIT(CDeleteQueueDialog)
00037   m_szPathName = _T("");
00038   //}}AFX_DATA_INIT
00039 }
00040
00041
00042 void CDeleteQueueDialog::DoDataExchange(CDataExchange* pDX)
00043 {
00044   CDialog::DoDataExchange(pDX);
00045   //{{AFX_DATA_MAP(CDeleteQueueDialog)
00046   DDX_Control(pDX, IDC_DELETE_QUEUE_COMBO, m_PathNameCB);
00047   DDX_CBString(pDX, IDC_DELETE_QUEUE_COMBO, m_szPathName);
00048   DDV_MaxChars(pDX, m_szPathName, 4000);
00049   //}}AFX_DATA_MAP
00050 }
00051
00052
00053 BEGIN_MESSAGE_MAP(CDeleteQueueDialog, CDialog)
00054   //{{AFX_MSG_MAP(CDeleteQueueDialog)
00055   //}}AFX_MSG_MAP
00056 END_MESSAGE_MAP()
00057
00058 /////////////////////////////////////////////////////////////////////////////
00059 // CDeleteQueueDialog message handlers
00060
00061 BOOL CDeleteQueueDialog::OnInitDialog()
00062 {
00063   CDialog::OnInitDialog();
00064
00065   int i;
00066
00067 for  (i=0 ; i<m_pStrArray->GetSize() ; i++)
00068   VERIFY (m_PathNameCB.AddString((*m_pStrArray)[i]->szPathName) != CB_ERR);
00069
00070     if (m_PathNameCB.GetCount() > 0) m_PathNameCB.SetCurSel(0);
00071
00072     return TRUE;  // return TRUE unless you set the focus to a control
00073                 // EXCEPTION: OCX Property Pages should return FALSE
00074 }
00075
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/Msi/setup.exe/setup.h Source File

  • SysMgmt
  • Msi
  • setup.exe

setup.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved.
00004 //
00005 //  File:       setup.h
00006 //
00007 //--------------------------------------------------------------------------
00008
00009 #ifndef __SETUP_H_58FA8147_50A0_4FDC_BD83_17C3A2525E0A_
00010 #define __SETUP_H_58FA8147_50A0_4FDC_BD83_17C3A2525E0A_
00011
00012 #include "setupui.h"
00013
00014 #include <windows.h>
00015 #include <wincrypt.h>
00016
00017 /*--------------------------------------------------------------------------
00018  *
00019  * Constants
00020  *
00021  --------------------------------------------------------------------------*/
00022 #define MAX_STR_LENGTH 1024
00023 #define MINIMUM_SUPPORTED_MSI_VERSION 150
00024 #define MAX_LENGTH_GUID 40
00025
00026 const char szUrlPathSep[] = "/";
00027 const char szPathSep[] = "\\";
00028
00029 const char szDefaultOperation[] = "DEFAULT";
00030 const char szInstallOperation[] = "INSTALL";
00031 const char szMinPatchOperation[] = "MINPATCH";
00032 const char szMajPatchOperation[] = "MAJPATCH";
00033 const char szInstallUpdOperation[] = "INSTALLUPD";
00034
00035 const char szDefaultMinPatchCommandLine[] = "REINSTALL=ALL REINSTALLMODE=omus";
00036 const char szDefaultInstallUpdCommandLine[] = "REINSTALL=ALL REINSTALLMODE=vomus";
00037 const char szAdminInstallProperty[] = " ACTION=ADMIN";
00038
00039 const char sqlProductCode[] = "SELECT `Value` FROM `Property` WHERE `Property`='ProductCode'";
00040
00041 /*--------------------------------------------------------------------------
00042  *
00043  * Enums
00044  *
00045  --------------------------------------------------------------------------*/
00046 enum itvEnum
00047 {
00048     itvWintrustNotOnMachine = 0,
00049     itvTrusted = 1,
00050     itvUnTrusted = 2
00051 };
00052
00053 // Execution modes.
00054 enum emEnum
00055 {
00056     emPreset = 0,
00057     emHelp = 1,
00058     emVerify = 2,
00059     emAdminInstall = 3
00060 };
00061
00062 /*--------------------------------------------------------------------------
00063  *
00064  * Prototypes
00065  *
00066  --------------------------------------------------------------------------*/
00067
00068 DWORD VerifyFileSignature (LPCSTR lpszModule, LPSTR lpszCmdLine);
00069 emEnum GetExecutionMode (LPCSTR lpszCmdLine);
00070 DWORD GetNextArgument (LPCSTR pszCmdLine, LPCSTR *ppszArgStart, LPCSTR *ppszArgEnd, bool * pfQuoted);
00071 DWORD GetAdminInstallInfo (bool fPatch, LPSTR lpszCmdLine, LPCSTR * ppszAdminImagePath);
00072 bool AlreadyInProgress();
00073 void DisplayUsage (HINSTANCE hInst, HWND hwndOwner, LPCSTR szCaption);
00074 DWORD GetFileVersionNumber(LPSTR szFilename, DWORD *pdwMSVer, DWORD *pdwLSVer);
00075 bool IsAdmin();
00076 bool IsOSSupported();
00077 bool AcquireShutdownPrivilege();
00078
00079 /////////////////////////////////////////////////////////////////////////////
00080 //
00081 // WinVerifyTrust functions
00082 //
00083 /////////////////////////////////////////////////////////////////////////////
00084 itvEnum IsPackageTrusted(LPCSTR szSetupEXE, LPCSTR szPackage, HWND hwndParent);
00085 itvEnum IsFileTrusted(LPCWSTR szwFile, HWND hwndParent, DWORD dwUIChoice, bool *pfIsSigned, PCCERT_CONTEXT *ppcSigner);
00086
00087 /////////////////////////////////////////////////////////////////////////////
00088 //
00089 // Upgrade functions
00090 //
00091 /////////////////////////////////////////////////////////////////////////////
00092 bool IsMsiUpgradeNecessary(ULONG ulReqMsiMinVer);
00093 DWORD ExecuteUpgradeMsi(LPSTR szUpgradeMsi);
00094 DWORD ExecuteVerifyUpdate(LPCSTR szModuleFile, LPCSTR szUpdateCachePath);
00095 DWORD WaitForProcess(HANDLE handle);
00096 bool IsUpdateRequiredVersion(LPSTR szFilename, ULONG ulMinVer);
00097 UINT UpgradeMsi(HINSTANCE hInst, CDownloadUI *piDownloadUI, LPCSTR szAppTitle, LPCSTR szUpgdLocation, LPCSTR szUpgrade, ULONG ulMinVer);
00098 UINT DownloadAndUpgradeMsi(HINSTANCE hInst, CDownloadUI *piDownloadUI, LPCSTR szAppTitle, LPCSTR szBase, LPCSTR szUpdate, LPCSTR szModuleFile, ULONG ulMinVer);
00099 UINT ValidateUpdate(HINSTANCE hInst, CDownloadUI *piDownloadUI, LPCSTR szAppTitle, LPSTR szUpdatePath, LPCSTR szModuleFile, ULONG ulMinVer);
00100
00101 /////////////////////////////////////////////////////////////////////////////
00102 //
00103 // Error handling functions
00104 //
00105 /////////////////////////////////////////////////////////////////////////////
00106 void ReportErrorOutOfMemory(HINSTANCE hInst, HWND hwndOwner, LPCSTR szCaption);
00107 void PostResourceNotFoundError(HINSTANCE hInst, HWND hwndOwner, LPCSTR szTitle, LPCSTR szName);
00108 void ReportUserCancelled(HINSTANCE hInst, HWND hwndOwner, LPCSTR szTitle);
00109 void PostError(HINSTANCE hInst, HWND hwndOwner, LPCSTR szTitle, UINT uiErrorId);
00110 void PostError(HINSTANCE hInst, HWND hwndOwner, LPCSTR szTitle, UINT uiErrorId, int iValue);
00111 void PostError(HINSTANCE hInst, HWND hwndOwner, LPCSTR szTitle, UINT uiErrorId, LPCSTR szValue);
00112 void PostError(HINSTANCE hInst, HWND hwndOwner, LPCSTR szTitle, UINT uiErrorId, LPCSTR szValue, int iValue);
00113 void PostMsiError(HINSTANCE hInst, HINSTANCE hMsi, HWND hwndOwner, LPCSTR szTitle, UINT uiErrorId);
00114 void PostFormattedError(HINSTANCE hInst, HWND hwndOwner, LPCSTR szTitle, UINT uiErrorId, LPCSTR szValue);
00115
00116 /////////////////////////////////////////////////////////////////////////////
00117 //
00118 // Update command line options
00119 //
00120 //
00121 /////////////////////////////////////////////////////////////////////////////
00122 const char szDelayReboot[] = " /norestart";
00123 const char szDelayRebootQuiet[] = " /quiet /norestart";
00124
00125 /////////////////////////////////////////////////////////////////////////////
00126 //
00127 // Debugging Functions
00128 //
00129 //
00130 /////////////////////////////////////////////////////////////////////////////
00131 void DebugMsg(LPCSTR szFormat, ...);
00132 const char szDebugEnvVar[] = "_MSI_WEB_BOOTSTRAP_DEBUG";
00133
00134
00135 #endif //__SETUP_H_58FA8147_50A0_4FDC_BD83_17C3A2525E0A_
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCSamp2/QCNotify/Notify.h Source File

  • Com
  • Services
  • Queued_Components
  • QCSamp2
  • QCNotify

Notify.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      Notify.h
00003   Summary:   Declaration of CONotify class
00004   Classes:   Declared: CONotify
00005   Origin:    Implementation of case study in Queued Components specification
00006 ----------------------------------------------------------------------------
00007   Copyright 1992 - 2000 Microsoft Corporation, All rights reserved.
00008
00009     THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010     ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012     PARTICULAR PURPOSE
00013 ==========================================================================+*/
00014
00015 #ifndef __NOTIFY_H_
00016 #define __NOTIFY_H_
00017
00018 #include "resource.h"       // main symbols
00019
00020 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00021   ObjectClass: CONotify
00022   Summary:  Updates shipping status column of Order Entry database
00023   Interfaces:  IUnknown       Standard COM object feature interface
00024                IDispatch      Automation interface
00025              INotify        Represents an order
00026   Aggregation: Not supported
00027 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00028
00029 class ATL_NO_VTABLE CONotify :
00030   public CComObjectRootEx<CComSingleThreadModel>,
00031   public CComCoClass<CONotify, &CLSID_Notify>,
00032   public IDispatchImpl<INotify, &IID_INotify, &LIBID_QCNOTIFYLib>
00033 {
00034 public:
00035   CONotify() : m_lCustomerId(0), m_lOrderId(0)  // ctor
00036   {
00037   }
00038
00039 DECLARE_REGISTRY_RESOURCEID(IDR_NOTIFY)
00040 DECLARE_NOT_AGGREGATABLE(CONotify)
00041
00042 BEGIN_COM_MAP(CONotify)
00043   COM_INTERFACE_ENTRY(INotify)
00044   COM_INTERFACE_ENTRY(IDispatch)
00045 END_COM_MAP()
00046
00047 public: // IOrder interface
00048   STDMETHOD(Process)(long lFlags);
00049   STDMETHOD(LineItem)(long lItemId, long lQuantity, ShipStatus shipStatus);
00050   STDMETHOD(put_OrderId)(long lOrderId);
00051   STDMETHOD(put_CustomerId)(long lCustomerId);
00052
00053 private: // Member variables
00054   long          m_lCustomerId;
00055   long          m_lOrderId;
00056   std::vector<long>   m_veclItemId;
00057   std::vector<long>   m_veclQuantity;
00058   std::vector<ShipStatus> m_vecShipStatus;
00059 };
00060
00061 #endif //__NOTIFY_H_
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/NetMon/parsers/blrplate/blrplate.c Source File

  • NetDS
  • NetMon
  • parsers
  • blrplate

blrplate.c

Go to the documentation of this file.
00001 //============================================================================
00002 //  FILE: BLRPLATE.c
00003 //
00004 //  Description: BLRPLATE (BLRPLATE) Parser
00005 //
00006 //  Note: info for this parser was gleaned from:
00007 //  rfcXXXX (BLRPLATE)
00008 //
00009 //  Modification History
00010 //
00011 //  Your Name Here      01/01/70    Created
00012 //============================================================================
00013
00014 #include "BLRPLATE.h"
00015
00016 // Globals -------------------------------------------------------------------
00017 HPROTOCOL hBLRPLATE = NULL;
00018 DWORD     Attached = 0;
00019
00020 // Functions -----------------------------------------------------------------
00021 extern VOID   WINAPI BLRPLATE_Register( HPROTOCOL hBLRPLATE);
00022 extern VOID   WINAPI BLRPLATE_Deregister( HPROTOCOL hBLRPLATE);
00023 extern LPBYTE WINAPI BLRPLATE_RecognizeFrame( HFRAME hFrame,
00024                                               LPBYTE pMacFrame,
00025                                               LPBYTE pBLRPLATEFrame,
00026                                               DWORD MacType,
00027                                               DWORD BytesLeft,
00028                                               HPROTOCOL hPrevProtocol,
00029                                               DWORD nPrevProtOffset,
00030                                               LPDWORD pProtocolStatus,
00031                                               LPHPROTOCOL phNextProtocol,
00032                                               LPDWORD InstData);
00033 extern LPBYTE WINAPI BLRPLATE_AttachProperties( HFRAME hFrame,
00034                                                 LPBYTE pMacFrame,
00035                                                 LPBYTE pBLRPLATEFrame,
00036                                                 DWORD MacType,
00037                                                 DWORD BytesLeft,
00038                                                 HPROTOCOL hPrevProtocol,
00039                                                 DWORD nPrevProtOffset,
00040                                                 DWORD InstData);
00041 extern DWORD  WINAPI BLRPLATE_FormatProperties( HFRAME hFrame,
00042                                                 LPBYTE pMacFrame,
00043                                                 LPBYTE pBLRPLATEFrame,
00044                                                 DWORD nPropertyInsts,
00045                                                 LPPROPERTYINST p);
00046
00047 VOID WINAPIV BLRPLATE_FormatSummary( LPPROPERTYINST pPropertyInst);
00048
00049 // Define the entry points that we will pass back at dll entry time ----------
00050 ENTRYPOINTS BLRPLATEEntryPoints =
00051 {
00052     // BLRPLATE Entry Points
00053     BLRPLATE_Register,
00054     BLRPLATE_Deregister,
00055     BLRPLATE_RecognizeFrame,
00056     BLRPLATE_AttachProperties,
00057     BLRPLATE_FormatProperties
00058 };
00059
00060
00061 // Property Value Labels -----------------------------------------------------
00062
00063 // OpCodes
00064 LABELED_WORD BLRPLATEOpCodes[] =
00065 {
00066     { 1, "Premiere" },
00067     { 2, "Secondary" },
00068 };
00069 SET BLRPLATEOpCodesSET = {(sizeof(BLRPLATEOpCodes)/sizeof(LABELED_WORD)),
00070                           BLRPLATEOpCodes };
00071
00072
00073 // Flags
00074 LABELED_BIT BLRPLATEFlags[] =
00075 {
00076     // bit 0 = Are aardvarks allowed
00077     {   0,
00078       "No aardvarks",
00079       "Aardvarks welcome",
00080     },
00081
00082     // bit 1 = Does it include batteries
00083     {   1,
00084       "Batteries not included",
00085       "Batteries included",
00086     },
00087
00088     // bit 4 = Is this a subsidiary of ACME Spaceworks?
00089     {   4,
00090       "Not a subsidiary of ACME Spaceworks",
00091       "ACME Spaceworks subsidiary",
00092     },
00093
00094 };
00095 SET BLRPLATEFlagsSET = {sizeof(BLRPLATEFlags)/sizeof(LABELED_BIT),
00096                         BLRPLATEFlags};
00097
00098
00099
00100 // Properties ----------------------------------------------------------------
00101 PROPERTYINFO  BLRPLATEPropertyTable[] =
00102 {
00103     // BLRPLATE_SUMMARY (0)
00104     { 0, 0,
00105       "Summary",
00106       "Summary of the BLRPLATE Packet",
00107       PROP_TYPE_SUMMARY,
00108       PROP_QUAL_NONE,
00109       NULL,
00110       80,
00111       BLRPLATE_FormatSummary
00112     },
00113
00114     // BLRPLATE_SIGNATURE (1)
00115     { 0, 0,
00116       "Signature",
00117       "BLRPLATE Signature",
00118       PROP_TYPE_STRING,
00119       PROP_QUAL_NONE,
00120       NULL,
00121       80,
00122       FormatPropertyInstance
00123     },
00124
00125     // BLRPLATE_OPCODE (2)
00126     { 0, 0,
00127       "Opcode",
00128       "BLRPLATE Packet Type",
00129       PROP_TYPE_WORD,
00130       PROP_QUAL_LABELED_SET,
00131       &BLRPLATEOpCodesSET,
00132       80,
00133       FormatPropertyInstance
00134     },
00135
00136     // BLRPLATE_FLAGS_SUMMARY (3)
00137     { 0, 0,
00138       "Flags Summary",
00139       "BLRPLATE Flags Summary",
00140       PROP_TYPE_BYTE,
00141       PROP_QUAL_NONE,
00142       NULL,
00143       80,
00144       FormatPropertyInstance
00145     },
00146
00147     // BLRPLATE_FLAGS_FLAGS (4)
00148     { 0, 0,
00149       "Flags",
00150       "BLRPLATE Flags",
00151       PROP_TYPE_BYTE,
00152       PROP_QUAL_FLAGS,
00153       &BLRPLATEFlagsSET,
00154       3 * 80,
00155       FormatPropertyInstance
00156     },
00157
00158
00159 };
00160 DWORD nNumBLRPLATEProps = (sizeof(BLRPLATEPropertyTable)/sizeof(PROPERTYINFO));
00161
00162 //============================================================================
00163 //
00164 //  AutoInstall - return all of the information neede to install us
00165 //
00166 //  Modification history:
00167 //
00168 //============================================================================
00169 PPF_PARSERDLLINFO WINAPI ParserAutoInstallInfo()
00170 {
00171     PPF_PARSERDLLINFO pParserDllInfo;
00172     PPF_PARSERINFO    pParserInfo;
00173     DWORD NumProtocols;
00174     /*
00175     DWORD NumHandoffs;
00176     PPF_HANDOFFSET    pHandoffSet;
00177     PPF_HANDOFFENTRY  pHandoffEntry;
00178     */
00179
00180     /*
00181     DWORD NumFollows;
00182     PPF_FOLLOWSET     pFollowSet;
00183     PPF_FOLLOWENTRY   pFollowEntry;
00184     */
00185
00186     // Base structure ========================================================
00187
00188     // Allocate memory for parser info:
00189     NumProtocols = 1;
00190     pParserDllInfo = (PPF_PARSERDLLINFO)HeapAlloc( GetProcessHeap(),
00191                                                    HEAP_ZERO_MEMORY,
00192                                                    sizeof( PF_PARSERDLLINFO ) +
00193                                                    NumProtocols * sizeof( PF_PARSERINFO) );
00194     if( pParserDllInfo == NULL)
00195     {
00196         return NULL;
00197     }
00198
00199     // fill in the parser DLL info
00200     pParserDllInfo->nParsers = NumProtocols;
00201
00202     // fill in the individual parser infos...
00203
00204     // BLRPLATE ==============================================================
00205     pParserInfo = &(pParserDllInfo->ParserInfo[0]);
00206     wsprintf( pParserInfo->szProtocolName, "BLRPLATE" );
00207     wsprintf( pParserInfo->szComment,      "Boilerplate Protocol" );
00208     wsprintf( pParserInfo->szHelpFile,     "");
00209
00210     /*
00211     // the incoming handoff set ----------------------------------------------
00212     // allocate
00213     NumHandoffs = 1;
00214     pHandoffSet = (PPF_HANDOFFSET)HeapAlloc( GetProcessHeap(),
00215                                              HEAP_ZERO_MEMORY,
00216                                              sizeof( PF_HANDOFFSET ) +
00217                                              NumHandoffs * sizeof( PF_HANDOFFENTRY) );
00218     if( pHandoffSet == NULL )
00219     {
00220         // just return early
00221         return pParserDllInfo;
00222     }
00223
00224     // fill in the incoming handoff set
00225     pParserInfo->pWhoHandsOffToMe = pHandoffSet;
00226     pHandoffSet->nEntries = NumHandoffs;
00227
00228     // TCP PORT FFFF
00229     pHandoffEntry = &(pHandoffSet->Entry[0]);
00230     wsprintf( pHandoffEntry->szIniFile,    "TCPIP.INI" );
00231     wsprintf( pHandoffEntry->szIniSection, "TCP_HandoffSet" );
00232     wsprintf( pHandoffEntry->szProtocol,   "BLRPLATE" );
00233     pHandoffEntry->dwHandOffValue =        0xFFFF;
00234     pHandoffEntry->ValueFormatBase =       HANDOFF_VALUE_FORMAT_BASE_DECIMAL;
00235     */
00236
00237     /*
00238     // the outgoing follow set -----------------------------------------------
00239     // allocate
00240     NumFollows = 1;
00241     pFollowSet = (PPF_FOLLOWSET)HeapAlloc( GetProcessHeap(),
00242                                            HEAP_ZERO_MEMORY,
00243                                            sizeof( PF_FOLLOWSET ) +
00244                                            NumFollows * sizeof( PF_FOLLOWENTRY) );
00245     if( pFollowSet == NULL )
00246     {
00247         // just return early
00248         return pParserDllInfo;
00249     }
00250
00251     // fill in the outgoing follow set
00252     pParserInfo->pWhoCanFollowMe = pFollowSet;
00253     pFollowSet->nEntries = NumFollows;
00254
00255     // SMB
00256     pFollowEntry = &(pFollowSet->Entry[0]);
00257     wsprintf( pFollowEntry->szProtocol,   "SMB" );
00258     */
00259
00260     return pParserDllInfo;
00261 }
00262
00263
00264 //============================================================================
00265 //  Function: DllMain
00266 //
00267 //  Description: (Called by the OS) Tell the kernel about our entry points.
00268 //
00269 //  Modification History
00270 //
00271 //  Your Name Here      01/01/70    Created
00272 //=============================================================================
00273 BOOL WINAPI DllMain( HANDLE hInstance, ULONG Command, LPVOID Reserved)
00274 {
00275
00276     // what type of call is this
00277     switch( Command )
00278     {
00279         case DLL_PROCESS_ATTACH:
00280             // are we loading for the first time?
00281             if( Attached == 0 )
00282             {
00283                 // the first time in we need to tell the kernel
00284                 // about ourselves
00285                 hBLRPLATE = CreateProtocol( "BLRPLATE",
00286                                             &BLRPLATEEntryPoints,
00287                                             ENTRYPOINTS_SIZE);
00288             }
00289             Attached++;
00290             break;
00291
00292         case DLL_PROCESS_DETACH:
00293             // are we detaching our last instance?
00294             Attached--;
00295             if( Attached == 0 )
00296             {
00297                 // last guy out needs to clean up
00298                 DestroyProtocol( hBLRPLATE);
00299             }
00300             break;
00301     }
00302
00303     // Netmon parsers ALWAYS return TRUE.
00304     return TRUE;
00305 }
00306
00307 //============================================================================
00308 //  Function: BLRPLATE_Register
00309 //
00310 //  Description: Create our property database and handoff sets.
00311 //
00312 //  Modification History
00313 //
00314 //  Your Name Here      01/01/70    Created
00315 //============================================================================
00316 void BHAPI BLRPLATE_Register( HPROTOCOL hBLRPLATE)
00317 {
00318     WORD  i;
00319
00320     // tell the kernel to make reserve some space for our property table
00321     CreatePropertyDatabase( hBLRPLATE, nNumBLRPLATEProps);
00322
00323     // add our properties to the kernel's database
00324     for( i = 0; i < nNumBLRPLATEProps; i++)
00325     {
00326         AddProperty( hBLRPLATE, &BLRPLATEPropertyTable[i]);
00327     }
00328 }
00329
00330
00331 //============================================================================
00332 //  Function: BLRPLATE_Deregister
00333 //
00334 //  Description: Destroy our property database and handoff set
00335 //
00336 //  Modification History
00337 //
00338 //  Your Name Here      01/01/70    Created
00339 //============================================================================
00340 VOID WINAPI BLRPLATE_Deregister( HPROTOCOL hBLRPLATE)
00341 {
00342     // tell the kernel that it may now free our database
00343     DestroyPropertyDatabase( hBLRPLATE);
00344 }
00345
00346
00347 //============================================================================
00348 //  Function: BLRPLATE_RecognizeFrame
00349 //
00350 //  Description: Determine whether we exist in the frame at the spot
00351 //               indicated. We also indicate who (if anyone) follows us
00352 //               and how much of the frame we claim.
00353 //
00354 //  Modification History
00355 //
00356 //  Your Name Here      01/01/70    Created
00357 //============================================================================
00358 LPBYTE BHAPI BLRPLATE_RecognizeFrame( HFRAME      hFrame,
00359                                       LPBYTE      pMacFrame,
00360                                       LPBYTE      pBLRPLATEFrame,
00361                                       DWORD       MacType,
00362                                       DWORD       BytesLeft,
00363                                       HPROTOCOL   hPrevProtocol,
00364                                       DWORD       nPrevProtOffset,
00365                                       LPDWORD     pProtocolStatus,
00366                                       LPHPROTOCOL phNextProtocol,
00367                                       LPDWORD     InstData)
00368 {
00369     // For now, just assume that if we got called,
00370     // then the packet does contain us and we go to the end of the frame
00371     *pProtocolStatus = PROTOCOL_STATUS_CLAIMED;
00372     return NULL;
00373 }
00374
00375
00376 //============================================================================
00377 //  Function: BLRPLATE_AttachProperties
00378 //
00379 //  Description: Indicate where in the frame each of our properties live.
00380 //
00381 //  Modification History
00382 //
00383 //  Your Name Here      01/01/70    Created
00384 //============================================================================
00385 LPBYTE BHAPI BLRPLATE_AttachProperties( HFRAME      hFrame,
00386                                         LPBYTE      pMacFrame,
00387                                         LPBYTE      pBLRPLATEFrame,
00388                                         DWORD       MacType,
00389                                         DWORD       BytesLeft,
00390                                         HPROTOCOL   hPrevProtocol,
00391                                         DWORD       nPrevProtOffset,
00392                                         DWORD       InstData)
00393
00394 {
00395     // apply the header overlay in order to decode the protocol
00396     PBLRPLATEHDR pBLRPLATEHdr = (PBLRPLATEHDR)pBLRPLATEFrame;
00397
00398     //
00399     // Attach Properties...
00400     //
00401
00402     // summary line
00403     AttachPropertyInstance( hFrame,
00404                             BLRPLATEPropertyTable[BLRPLATE_SUMMARY].hProperty,
00405                             (WORD)BytesLeft,
00406                             (LPBYTE)pBLRPLATEFrame,
00407                             0, 0, 0);
00408
00409     // signature
00410     AttachPropertyInstance( hFrame,
00411                             BLRPLATEPropertyTable[BLRPLATE_SIGNATURE].hProperty,
00412                             sizeof(DWORD),
00413                             &(pBLRPLATEHdr->Signature),
00414                             0, 1, 0);
00415
00416     // opcode
00417     AttachPropertyInstance( hFrame,
00418                             BLRPLATEPropertyTable[BLRPLATE_OPCODE].hProperty,
00419                             sizeof(WORD),
00420                             &(pBLRPLATEHdr->Opcode),
00421                             0, 1, 0);
00422
00423     // flags summary
00424     AttachPropertyInstance( hFrame,
00425                             BLRPLATEPropertyTable[BLRPLATE_FLAGS_SUMMARY].hProperty,
00426                             sizeof(BYTE),
00427                             &(pBLRPLATEHdr->Flags),
00428                             0, 1, 0);
00429
00430     // flags decode
00431     AttachPropertyInstance( hFrame,
00432                             BLRPLATEPropertyTable[BLRPLATE_FLAGS_FLAGS].hProperty,
00433                             sizeof(BYTE),
00434                             &(pBLRPLATEHdr->Flags),
00435                             0, 2, 0);
00436
00437     return NULL;
00438 }
00439
00440
00441 //============================================================================
00442 //  Function: BLRPLATE_FormatProperties
00443 //
00444 //  Description: Format the given properties on the given frame.
00445 //
00446 //  Modification History
00447 //
00448 //  Your Name Here      01/01/70    Created
00449 //============================================================================
00450 DWORD BHAPI BLRPLATE_FormatProperties( HFRAME          hFrame,
00451                                        LPBYTE          pMacFrame,
00452                                        LPBYTE          pBLRPLATEFrame,
00453                                        DWORD           nPropertyInsts,
00454                                        LPPROPERTYINST  p)
00455 {
00456     // loop through the property instances
00457     while( nPropertyInsts-- > 0)
00458     {
00459         // and call the formatter for each
00460         ( (FORMAT)(p->lpPropertyInfo->InstanceData) )( p);
00461         p++;
00462     }
00463
00464     return NMERR_SUCCESS;
00465 }
00466
00467
00468 //============================================================================
00469 //  Function: BLRPLATE_FormatSummary
00470 //
00471 //  Description: The custom formatter for the summary property
00472 //
00473 //  Modification History
00474 //
00475 //  Your Name Here      01/01/70    Created
00476 //============================================================================
00477 VOID WINAPIV BLRPLATE_FormatSummary( LPPROPERTYINST pPropertyInst)
00478 {
00479     LPBYTE       pReturnedString = pPropertyInst->szPropertyText;
00480     PBLRPLATEHDR pBLRPLATE = (PBLRPLATEHDR)(pPropertyInst->lpData);
00481     char*        szTempString;
00482
00483     // fetch the Opcode name
00484     szTempString = LookupWordSetString( &BLRPLATEOpCodesSET,
00485                                         pBLRPLATE->Opcode );
00486     if( szTempString == NULL )
00487     {
00488         szTempString = "Unknown";
00489     }
00490
00491     // print "Opcode: <Opcode Name> (<Opcode number>)"
00492     wsprintf ( pReturnedString,
00493                "Opcode: %s (%d)",
00494                szTempString,
00495                pBLRPLATE->Opcode);
00496 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/CustomSurrogate/Surrog/cfWrap.h Source File

  • Com
  • Fundamentals
  • CustomSurrogate
  • Surrog

cfWrap.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 class CClassFactoryWrapper : public IClassFactory, public IMarshal
00019 {
00020   LONG m_cRef;
00021   CLSID m_clsid;
00022   DWORD m_dwReg;
00023 public:
00024   CClassFactoryWrapper(REFCLSID rclsid);
00025   virtual ~CClassFactoryWrapper();
00026
00027   // IUnknown
00028     STDMETHOD (QueryInterface)(REFIID iid, LPVOID* ppv);
00029     STDMETHOD_(ULONG,AddRef)();
00030     STDMETHOD_(ULONG,Release)();
00031
00032     // IClassFactory
00033     STDMETHOD (CreateInstance)(IUnknown* pUnkOuter, REFIID iid, void** ppv);
00034     STDMETHOD (LockServer)(BOOL fLock);
00035
00036     // IMarshal
00037     STDMETHOD (GetUnmarshalClass)(REFIID riid, void *pv, DWORD dwDestContext,
00038                 void *pvDestContext, DWORD mshlflags, CLSID *pCid);
00039     STDMETHOD (GetMarshalSizeMax)(REFIID riid, void *pv, DWORD dwDestContext,
00040                 void *pvDestContext, DWORD mshlflags, DWORD *pSize);
00041     STDMETHOD (MarshalInterface)(IStream *pStm, REFIID riid, void *pv,
00042                 DWORD dwDestContext, void *pvDestContext, DWORD mshlflags);
00043     STDMETHOD (UnmarshalInterface)(IStream *pStm,REFIID riid,void **ppv);
00044     STDMETHOD (ReleaseMarshalData)(IStream *pStm);
00045     STDMETHOD (DisconnectObject)(DWORD dwReserved);
00046
00047   friend class CSurrogate;
00048 };
00049
00050
00051
00052
00053
00054
00055
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAssoc< KEY, VALUE > Member List

This is the complete list of members for CAssoc< KEY, VALUE >, including all inherited members.
CAssoc() | CAssoc< KEY, VALUE > |
m_key | CAssoc< KEY, VALUE > |
m_value | CAssoc< KEY, VALUE > |
~CAssoc() | CAssoc< KEY, VALUE > | [virtual]
Generated on Wed Nov 13 2024 16:55:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CGenericUCPApp Member List

This is the complete list of members for CGenericUCPApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CGenericUCPApp() | CGenericUCPApp |
CWinApp() | CWinApp |
ExitInstance() | CGenericUCPApp | [virtual]
InitInstance() | CGenericUCPApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:56:36 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/MqApiTst/SendMDlg.h Source File

  • NetDS
  • MessageQueuing
  • MqApiTst

SendMDlg.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // SendMDlg.h : header file
00013 //
00014
00015
00016
00017 /////////////////////////////////////////////////////////////////////////////
00018 // CSendMessageDialog dialog
00019
00020 class CSendMessageDialog : public CDialog
00021 {
00022 // Construction
00023 public:
00024   CSendMessageDialog(CArray <ARRAYQ*, ARRAYQ*>*, CWnd* pParent = NULL);   // standard constructor
00025
00026 // Dialog Data
00027   //{{AFX_DATA(CSendMessageDialog)
00028   enum { IDD = IDD_SEND_MESSAGE_DIALOG };
00029   CComboBox m_AdminPathNameCB;
00030   CComboBox m_PathNameCB;
00031   CString m_strBody;
00032   CString m_strLabel;
00033   BYTE  m_bPriority;
00034   int   m_iAck;
00035   int   m_iDelivery;
00036   CString m_szPathName;
00037   CString m_szAdminPathName;
00038   BOOL  m_Journal;
00039   BOOL  m_DeadLetter;
00040   BOOL    m_Authenticated;
00041   BOOL    m_Encrypted;
00042   long  m_dwTimeToReachQueue;
00043   long    m_dwTimeToBeReceived;
00044   //}}AFX_DATA
00045
00046   /* pointer to the array with the strings for the combo box (Queues PathName). */
00047   CArray <ARRAYQ*, ARRAYQ*>* m_pStrArray ;
00048
00049 // Overrides
00050   // ClassWizard generated virtual function overrides
00051   //{{AFX_VIRTUAL(CSendMessageDialog)
00052   protected:
00053   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00054   //}}AFX_VIRTUAL
00055
00056 // Implementation
00057 protected:
00058
00059   // Generated message map functions
00060   //{{AFX_MSG(CSendMessageDialog)
00061   virtual BOOL OnInitDialog();
00062   virtual void OnOK();
00063   afx_msg void OnSelchangeTargetCombo();
00064   //}}AFX_MSG
00065   DECLARE_MESSAGE_MAP()
00066
00067 public:
00068   void GetPathName(TCHAR szPathName[BUFFERSIZE])
00069   {
00070     ASSERT(szPathName != NULL);
00071
00072     _tcsncpy (szPathName, m_szPathName, BUFFERSIZE-1);
00073     szPathName[BUFFERSIZE-1] = '\0';
00074
00075   }
00076
00077
00078   void GetAdminPathName(TCHAR szAdminPathName[BUFFERSIZE])
00079   {
00080     ASSERT(szAdminPathName != NULL);
00081
00082     _tcsncpy (szAdminPathName, m_szAdminPathName, BUFFERSIZE-1);
00083     szAdminPathName[BUFFERSIZE-1] = '\0';
00084
00085   }
00086
00087   unsigned char GetDelivery()
00088   {
00089     return (m_iDelivery);
00090   }
00091
00092     unsigned char GetJournal()
00093   {
00094     return (m_Journal);
00095   }
00096
00097     unsigned char GetDeadLetter()
00098   {
00099     return (m_DeadLetter);
00100   }
00101
00102   unsigned char GetAuthenticated()
00103   {
00104     return (m_Authenticated);
00105   }
00106
00107   unsigned char GetEncrypted()
00108   {
00109     return (m_Encrypted);
00110   }
00111
00112   unsigned char GetPriority()
00113   {
00114     return (m_bPriority);
00115   }
00116
00117   unsigned char GetAcknowledge()
00118   {
00119     switch (m_iAck)
00120     {
00121     case 1 : return MQMSG_ACKNOWLEDGMENT_FULL_REACH_QUEUE;
00122     case 2 : return MQMSG_ACKNOWLEDGMENT_FULL_RECEIVE;
00123     case 3 : return MQMSG_ACKNOWLEDGMENT_NACK_REACH_QUEUE;
00124     case 4 : return MQMSG_ACKNOWLEDGMENT_NACK_RECEIVE;
00125     default: return MQMSG_ACKNOWLEDGMENT_NONE;
00126     }
00127   }
00128
00129   void GetMessageBody(TCHAR* pszMessageBodyBuffer)
00130   {
00131     ASSERT(pszMessageBodyBuffer != NULL);
00132
00133     _tcsncpy (pszMessageBodyBuffer, m_strBody, BUFFERSIZE-1);
00134     pszMessageBodyBuffer[BUFFERSIZE-1] = '\0';
00135
00136   }
00137
00138   void GetMessageLabel(TCHAR szMessageLabelBuffer[BUFFERSIZE])
00139   {
00140     ASSERT(szMessageLabelBuffer != NULL);
00141
00142     _tcsncpy (szMessageLabelBuffer, m_strLabel, BUFFERSIZE-1);
00143     szMessageLabelBuffer[BUFFERSIZE-1] = '\0';
00144
00145   }
00146
00147   DWORD GetTimeToReachQueue()
00148   {
00149     return (m_dwTimeToReachQueue);
00150   }
00151
00152   DWORD GetTimeToBeReceived()
00153   {
00154     return (m_dwTimeToBeReceived);
00155   }
00156
00157 };
00158
00159 //
00160 // Two buffers to hold the last message label and body.
00161 //
00162 extern TCHAR szLastMessageLabel[BUFFERSIZE];
00163 extern TCHAR szLastMessageBody[BUFFERSIZE];
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::Connection Member List

This is the complete list of members for msado15::Connection, including all inherited members.
BeginTrans() | msado15::Connection |
Cancel() | msado15::Connection |
Close() | msado15::Connection |
clsid | msado15::Connection | [static]
CommitTrans() | msado15::Connection |
Execute(String CommandText, Variant RecordsAffected, int Options) | msado15::Connection |
getAttributes() | msado15::Connection |
getCommandTimeout() | msado15::Connection |
getConnectionString() | msado15::Connection |
getConnectionTimeout() | msado15::Connection |
getCursorLocation() | msado15::Connection |
getDefaultDatabase() | msado15::Connection |
getErrors() | msado15::Connection |
getIsolationLevel() | msado15::Connection |
getMode() | msado15::Connection |
getProperties() | msado15::Connection |
getProvider() | msado15::Connection |
getState() | msado15::Connection |
getVersion() | msado15::Connection |
iid | msado15::Connection | [static]
Open(String ConnectionString, String UserID, String Password, int Options) | msado15::Connection |
OpenSchema(int Schema, Variant Restrictions, Variant SchemaID) | msado15::Connection |
RollbackTrans() | msado15::Connection |
setAttributes(int plAttr) | msado15::Connection |
setCommandTimeout(int plTimeout) | msado15::Connection |
setConnectionString(String pbstr) | msado15::Connection |
setConnectionTimeout(int plTimeout) | msado15::Connection |
setCursorLocation(int plCursorLoc) | msado15::Connection |
setDefaultDatabase(String pbstr) | msado15::Connection |
setIsolationLevel(int Level) | msado15::Connection |
setMode(int plMode) | msado15::Connection |
setProvider(String pbstr) | msado15::Connection |
Generated on Wed Nov 13 2024 16:58:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Accept/main.cpp Source File

  • NetDS
  • WinSock
  • Accept

main.cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 2002  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module Name: main.cpp
00009 //
00010 // Description:
00011 //             This file contains the functions for parsing the command-line
00012 // arguments and the main function.
00013
00014 #include "common.h"
00015
00016 // g_AcceptContext will hold all the global variables used across all
00017 // the files.
00018 AcceptContext g_AcceptContext;
00019
00020
00021 /*
00022     This function converts a given address family into its corresponding string
00023     representation for display purposes.
00024 */
00025 const char *AFImage(BYTE addressFamily)
00026 {
00027     char *szRetVal;
00028
00029     // return the printable string equivalent of the corresponding
00030     // address family.
00031     switch (addressFamily)
00032     {
00033         case AF_UNSPEC : szRetVal = "AF_UNSPEC";
00034                          break;
00035         case AF_INET   : szRetVal = "AF_INET";
00036                          break;
00037         case AF_INET6  : szRetVal = "AF_INET6";
00038                          break;
00039         default        : szRetVal = "Unrecognized";
00040                          break;
00041     }
00042
00043     return szRetVal;
00044 }
00045
00046
00047
00048 /*
00049     This function converts a given type of accept into its corresponding string
00050     representation for display purposes.
00051 */
00052 const char *AcceptTypeImage(BYTE typeOfAccept)
00053 {
00054     char *szRetVal;
00055
00056     // return a string equivalent of the accept type for displaying
00057     // to the user of his choices.
00058     switch (typeOfAccept)
00059     {
00060         case NON_BLOCKING_ACCEPT : szRetVal = "NON_BLOCKING_ACCEPT";
00061                                    break;
00062         case ASYNC_SELECT_ACCEPT : szRetVal = "ASYNC_SELECT_ACCEPT";
00063                                    break;
00064         default                  : szRetVal = "Unrecognized";
00065                                    break;
00066     }
00067
00068     return szRetVal;
00069 }
00070
00071
00072
00073 /*
00074     This function prints the available command-line options, the arguments
00075     expected by each of them and the valid input values and the default
00076     values for each them.
00077 */
00078 void PrintUsage(char *szProgramName)
00079 {
00080     printf("\n\n"
00081            "Usage:\n"
00082            "------\n"
00083            "   %s <options> \n\n"
00084            "where <options> is one or more of the following: \n\n"
00085            "   -a <0|4|6>      Address Family: 0 for Either\n"
00086            "                                   4 for IPv4\n"
00087            "                                   6 for IPv6\n"
00088            "                   Default: %d\n\n"
00089            "   -i <interface>  Interface address\n"
00090            "                   Default: %s\n\n"
00091            "   -e <endpoint>   Port number\n"
00092            "                   Default: %s\n\n"
00093            "   -t <1|2>        Type of Accept: 1 for Non-blocking accept\n"
00094            "                                   2 for Accept with WSAAsyncSelect\n"
00095            "                   Default: %d\n\n"
00096            "\n",
00097            szProgramName,
00098            DEFAULT_ADDRESS_FAMILY,
00099           ( DEFAULT_INTERFACE == NULL ? "NULL" : DEFAULT_INTERFACE),
00100            DEFAULT_PORT,
00101            DEFAULT_TYPE_OF_ACCEPT
00102            );
00103
00104     return;
00105 }
00106
00107 /*
00108     This function parses the given input arguments and fills up the
00109     corresponding fields in the g_AcceptContext structure.
00110 */
00111 BOOL ParseArguments(int argc, char *argv[])
00112 {
00113     // holds the return value from this function.
00114     // TRUE indicates that all the supplied arguments are valid.
00115     // FALSE indicates incorrect or insufficient number of arguments.
00116     BOOL retVal = FALSE;
00117
00118     // loop index to go over the command-line arguments one by one.
00119     int i;
00120
00121     printf("Entering ParseArguments()\n");
00122
00123     // fill up the default arguments and let the user options override these.
00124     g_AcceptContext.addressFamily = DEFAULT_ADDRESS_FAMILY;
00125     g_AcceptContext.szInterface = DEFAULT_INTERFACE;
00126     g_AcceptContext.szPort = DEFAULT_PORT;
00127     g_AcceptContext.typeOfAccept = DEFAULT_TYPE_OF_ACCEPT;
00128
00129
00130     // process each argument in the argv list.
00131     for (i = 1; i < argc ; i++)
00132     {
00133         char firstChar = argv[i][0];
00134
00135         // make sure the option begins with a hyphen or a forward slash.
00136         if (!(firstChar == '-' || firstChar == '/'))
00137         {
00138             printf("ERROR: Option has to begin with - or / : %s\n", argv[i]);
00139             PrintUsage(argv[0]);
00140             goto CLEANUP;
00141         }
00142
00143         // process the option.
00144         switch(argv[i][1])
00145         {
00146             case 'a' :
00147
00148                 // Address Family.
00149                 // should be -a 0 or -a 4 or -a 6
00150
00151                 // first check if there's one more argument.
00152                 if (i + 1 >= argc)
00153                 {
00154                     printf("ERROR: Argument 0/4/6 needed for -a option\n");
00155                     PrintUsage(argv[0]);
00156                     goto CLEANUP;
00157                 }
00158
00159                 // extract and validate the AF number.
00160                 switch(atoi(argv[i+1]))
00161                 {
00162                     // Unspecified.
00163                     case 0:
00164                       g_AcceptContext.addressFamily = AF_UNSPEC;
00165                       break;
00166
00167                     // IPv4.
00168                     case 4:
00169                       g_AcceptContext.addressFamily = AF_INET;
00170                       break;
00171
00172                     // IPv6.
00173                     case 6:
00174                       g_AcceptContext.addressFamily = AF_INET6;
00175                       break;
00176
00177                     // Invalid value.
00178                     default:
00179                       printf("ERROR: Invalid address family. Must be 0/4/6\n");
00180                       PrintUsage(argv[0]);
00181                       goto CLEANUP;
00182                 }
00183
00184                 // indicate that we have processed the next argument as well.
00185                 i++;
00186
00187                 // AF was fine. continue.
00188                 break;
00189
00190             case 'i' :
00191
00192                 // Interface to listen on.
00193                 // should be -i <interface>
00194
00195                 // first check if there's one more argument.
00196                 if (i + 1 >= argc)
00197                 {
00198                     printf("ERROR: Interface needed for -i option\n");
00199                     PrintUsage(argv[0]);
00200                     goto CLEANUP;
00201                 }
00202
00203                 // make sure the input string length is less than
00204                 // the INET6_ADDRSTRLEN, the maximum valid IP address length.
00205                 if (FAILED(StringCchLength(argv[i+1],INET6_ADDRSTRLEN, NULL)))
00206                 {
00207                     printf("ERROR: Interface string too long. "
00208                            "can't exceed %d characters\n",
00209                            INET6_ADDRSTRLEN);
00210                     PrintUsage(argv[0]);
00211                     goto CLEANUP;
00212                 }
00213
00214                 // remember the interface string.
00215                 g_AcceptContext.szInterface = argv[i+1];
00216
00217                 // indicate that we have processed the next argument as well.
00218                 i++;
00219
00220                 // continue.
00221                 break;
00222
00223             case 'e' :
00224
00225                 // Endpoint or Port.
00226                 // should be -e <port number>
00227
00228                 // first check if there's one more argument.
00229                 if (i + 1 >= argc)
00230                 {
00231                     printf("ERROR: Port number needed for -e option\n");
00232                     PrintUsage(argv[0]);
00233                     goto CLEANUP;
00234                 }
00235
00236                 // make sure the input string length is less than
00237                 // the maximum length for a service name.
00238                 if (FAILED(StringCchLength(argv[i+1], NI_MAXSERV, NULL)))
00239                 {
00240                     printf("ERROR: Port number too long. "
00241                            "can't exceed %d characters\n",
00242                            NI_MAXSERV);
00243
00244                     PrintUsage(argv[0]);
00245                     goto CLEANUP;
00246                 }
00247
00248                 // remember the port number string.
00249                 g_AcceptContext.szPort = argv[i+1];
00250
00251                 // indicate that we have processed the next argument as well.
00252                 i++;
00253
00254                 // continue.
00255                 break;
00256
00257             case 't' :
00258
00259                 // Type of Accept.
00260                 // should be -t 1 or -t 2
00261
00262                 // first check if there's one more argument.
00263                 if (i + 1 >= argc)
00264                 {
00265                     printf("ERROR: Argument 1 or 2 needed for -t option\n");
00266                     PrintUsage(argv[0]);
00267                     goto CLEANUP;
00268                 }
00269
00270                 // extract the type value
00271                 g_AcceptContext.typeOfAccept = (BYTE) atoi(argv[i+1]);
00272
00273                 // indicate that we have processed the next argument as well.
00274                 i++;
00275
00276                 // validate the accept type.
00277                 if (!(g_AcceptContext.typeOfAccept == 1 ||
00278                       g_AcceptContext.typeOfAccept == 2))
00279                 {
00280                     printf("ERROR: Invalid accept type: %d. Must be 1 or 2\n",
00281                             g_AcceptContext.addressFamily);
00282                     PrintUsage(argv[0]);
00283                     goto CLEANUP;
00284                 }
00285
00286                 // Accept type was fine. continue.
00287                 break;
00288
00289             case 'h' : // help
00290             case '?' : // help
00291                         PrintUsage(argv[0]);
00292                         goto CLEANUP;
00293             default  :
00294                         printf("ERROR: Unrecognized option: %s\n", argv[i]);
00295                         PrintUsage(argv[0]);
00296                         goto CLEANUP;
00297         }
00298     }
00299
00300     // echo the final list of values that'll be used.
00301     // remember, these need not be the same as the input arguments.
00302     // rather, this is what we'll use inside our program.
00303     printf("Parsed input arguments. The following values will be used : \n");
00304     printf("\tAddress Family = %s\n", AFImage(g_AcceptContext.addressFamily));
00305     printf("\tInterface = %s\n",g_AcceptContext.szInterface);
00306     printf("\tPort = %s\n", g_AcceptContext.szPort);
00307     printf("\tType of Accept = %s\n",
00308                             AcceptTypeImage(g_AcceptContext.typeOfAccept));
00309
00310     // all went well, signal that we can proceed.
00311     retVal = TRUE;
00312
00313 CLEANUP:
00314
00315     printf("Exiting ParseArguments()\n");
00316     return retVal;
00317 }
00318
00319
00320 /*
00321     This function is the entry point for this program.
00322     Based on the command-line arguments, it invokes the suitable functions.
00323 */
00324 int _cdecl main(int argc, char *argv[])
00325 {
00326     // holds the return value from this function.
00327     // 0 indicates success, non-zero indicates failure.
00328     int retVal;
00329
00330     WSADATA wsaData;
00331
00332     printf("Entering main()\n");
00333
00334     // parse and validate the given arguments and determine if we should
00335     // continue the execution or return error.
00336     if (ParseArguments(argc, argv) == FALSE)
00337     {
00338         // error input. return a non-zero error code.
00339         retVal = 1;
00340         goto CLEANUP;
00341     }
00342
00343     // call WSAStartup before calling any of the Winsock API functions.
00344     retVal = WSAStartup(MAKEWORD(2,2), &wsaData);
00345     if (retVal != 0)
00346     {
00347         printf("WSAStartup failed. Error = %d\n", retVal);
00348         goto CLEANUP;
00349     }
00350
00351     // Depending on the command-line options given, create one or more
00352     // listening sockets on the requested interface(s).
00353     CreateListeningSockets();
00354
00355     // Depending on the type of accept requested, call the suitable function.
00356     switch(g_AcceptContext.typeOfAccept)
00357     {
00358         case NON_BLOCKING_ACCEPT:
00359             NonBlockingAcceptMain();
00360             break;
00361
00362         case ASYNC_SELECT_ACCEPT:
00363             AsyncSelectAcceptMain();
00364             break;
00365
00366         default:
00367             // some error. return a non-zero error code.
00368             retVal = 1;
00369             break;
00370     }
00371
00372     // we may not come here as per the current implementation since
00373     // the XXXAcceptMain functions themselves are waiting forever for
00374     // connections or data. But in case we add a timeout option in future
00375     // we might come here and so we'll cleanup everything properly.
00376
00377     // Close all the listening sockets and remove them from the global
00378     // list. In case there are some accepted sockets still in the list,
00379     // (due to some error), they'll also be closed as well.
00380     DestroyListeningSockets();
00381
00382     // Inform Winsock that we're done with all the Winsock APIs.
00383     WSACleanup();
00384
00385 CLEANUP:
00386
00387     printf("Exiting main()\n");
00388     return retVal;
00389 }
00390
00391
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/headers.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

headers.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module HEADERS.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _HEADERS_H_
00012 #define _HEADERS_H_
00013
00014 ///////////////////////////////////////////////////////////////
00015 // Defines
00016 //
00017 ///////////////////////////////////////////////////////////////
00018 #define STRICT      //Strict type checking for Window types
00019
00020
00021 ///////////////////////////////////////////////////////////////
00022 // Includes
00023 //
00024 ///////////////////////////////////////////////////////////////
00025 #include "oledb.h"    //OLE DB Header
00026 #include "oledberr.h" //OLE DB Errors
00027 #include "msdasc.h"   //OLE DB ServiceComponents
00028 #include "msdaguid.h" //CLSID_OLEDB_ENUMERATOR
00029 #include <msdadc.h>   //DataConversion library
00030
00031 #include <windows.h>
00032 #include <windowsx.h>
00033 #include <commctrl.h> //InitCommonControls
00034
00035 #include <stddef.h>
00036 #include <stdio.h>
00037 #include <limits.h>
00038 #include <wchar.h>
00039 #include <ocidl.h>    //IConnectionPoint
00040 #include <olectl.h>   //IConnectionPoints interface
00041 #include <cguid.h>    //GUID_NULL
00042 #include <locale.h>   //setLocale
00043 #include <richedit.h> //RichEdit Control Header
00044 #include <htmlhelp.h> //htmlhelp
00045 #include <atlbase.h>  //ATL
00046
00047 #include "resource.h" //Resources
00048
00049 #include "Common.h"
00050
00051
00052 #include "CWinApp.h"
00053 #include "CMainWindow.h"
00054 #include "Spy.h"
00055
00056
00057 #endif //_HEADERS_H_
Generated on Wed Nov 13 2024 16:52:08 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/rds/handler/vc/const.cpp Source File

  • Dataaccess
  • rds
  • handler
  • vc

const.cpp

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File:    const.cpp
00004 //
00005 // Copyright: Copyright (c) 1991-1999 Microsoft Corporation
00006 //
00007 // Contents:
00008 //
00009 // Comments:
00010 //
00011 //-----------------------------------------------------------------------------
00012
00013 #define INITGUID
00014 #include <objbase.h>
00015 #include <initguid.h>
00016 #include "adoid.h"
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/General/ADQI/ADsPropertyList.cpp Source File

  • NetDS
  • ADSI
  • samples
  • General
  • ADQI

ADsPropertyList.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 //  Microsoft Active Directory 2.5 Sample Code
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1996 - 2000
00006 //
00007 //  File:       ADsPropertyList.cpp
00008 //
00009 //  Contents:   IADsPropertyList, IADsPropertyEntry and IADsPropertyValue usage
00010 //
00011 //
00012 //----------------------------------------------------------------------------
00013
00014 #include "stdafx.h"
00015 #include "ADQI.h"
00016 #include "ADsPropertyList.h"
00017
00018 #ifdef _DEBUG
00019 #define new DEBUG_NEW
00020 #undef THIS_FILE
00021 static char THIS_FILE[] = __FILE__;
00022 #endif
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 // CDlgIADsPropertyList dialog
00026
00027
00028 CDlgIADsPropertyList::CDlgIADsPropertyList(LPUNKNOWN pUnk, CWnd* pParent /*=NULL*/)
00029   : CDialog(CDlgIADsPropertyList::IDD, pParent)
00030 {
00031   //{{AFX_DATA_INIT(CDlgIADsPropertyList)
00032   m_sAttribute = _T("");
00033   //}}AFX_DATA_INIT
00034
00035   HRESULT hr;
00036   m_pPropList = NULL;
00037   hr = pUnk->QueryInterface( IID_IADsPropertyList, (void **) &m_pPropList );
00038   if ( !SUCCEEDED(hr) )
00039   {
00040     AfxMessageBox(_T("Fatal Error! QI for IADsPropertyList failed"));
00041     return;
00042   }
00043   pUnk->Release();
00044
00045
00046   //////////////////////////////////////////
00047   // Retrieve the data to the cache
00048   ////////////////////////////////////////////
00049   IADs *pADs=NULL;
00050   hr = m_pPropList->QueryInterface( IID_IADs, (void**) &pADs );
00051   if ( SUCCEEDED(hr) )
00052   {
00053     hr = pADs->GetInfo();
00054     pADs->Release();
00055   }
00056
00057
00058
00059 }
00060
00061 CDlgIADsPropertyList::~CDlgIADsPropertyList()
00062 {
00063   if ( m_pPropList )
00064   {
00065      m_pPropList->Release();
00066   }
00067
00068 }
00069
00070 void CDlgIADsPropertyList::DoDataExchange(CDataExchange* pDX)
00071 {
00072   CDialog::DoDataExchange(pDX);
00073   //{{AFX_DATA_MAP(CDlgIADsPropertyList)
00074   DDX_Control(pDX, IDC_VALUELIST, m_cValueList);
00075   DDX_Control(pDX, IDC_ADSTYPE, m_cADsType);
00076   DDX_Text(pDX, IDC_ATTRIBUTE, m_sAttribute);
00077   //}}AFX_DATA_MAP
00078 }
00079
00080
00081 BEGIN_MESSAGE_MAP(CDlgIADsPropertyList, CDialog)
00082   //{{AFX_MSG_MAP(CDlgIADsPropertyList)
00083   ON_BN_CLICKED(IDC_GET, OnGet)
00084   ON_BN_CLICKED(IDC_PURGE, OnPurge)
00085   //}}AFX_MSG_MAP
00086 END_MESSAGE_MAP()
00087
00088 /////////////////////////////////////////////////////////////////////////////
00089 // CDlgIADsPropertyList message handlers
00090 //
00091 //
00092 //  IADsPropertyList->Next
00093 //  IADsPropertyEnty
00094 //
00095
00096
00097 BOOL CDlgIADsPropertyList::OnInitDialog()
00098 {
00099   CDialog::OnInitDialog();
00100   m_cADsType.SetCurSel(ADSTYPE_CASE_IGNORE_STRING-1); //Most attributes are string
00101   return TRUE;  // return TRUE unless you set the focus to a control
00102                 // EXCEPTION: OCX Property Pages should return FALSE
00103 }
00104
00105
00106
00107 /////////////////////////////////////////////////////////
00108 // Demonstrate:
00109 // IADsPropertyList::GetPropertyItem
00110 // IADsPropertyEntry
00111 //
00112 void CDlgIADsPropertyList::OnGet()
00113 {
00114
00115   HRESULT hr;
00116   CString s;
00117   BSTR    bstr;
00118   VARIANT var;
00119   IDispatch *pDispatch;
00120   IADsPropertyEntry *pEntry;
00121   IADsPropertyValue *pValue;
00122   LONG  lADsType;
00123
00124
00125   UpdateData(TRUE);
00126   m_cValueList.ResetContent();
00127
00128   bstr = m_sAttribute.AllocSysString();
00129   hr = m_pPropList->GetPropertyItem( bstr, m_cADsType.GetCurSel()+1, &var );
00130   SysFreeString( bstr );
00131
00132
00133   if ( SUCCEEDED(hr) )
00134   {
00135     pDispatch = V_DISPATCH( &var );
00136     hr = pDispatch->QueryInterface( IID_IADsPropertyEntry, (void**) &pEntry );
00137     VariantClear( &var );
00138
00139     // IADsPropertyEntry
00140     if ( SUCCEEDED(hr) )
00141     {
00142       CPtrList dList;
00143
00144       // get_Values return array of VT_DISPATH
00145        hr = pEntry->get_Values( &var );
00146
00147
00148        pEntry->get_ADsType( &lADsType);
00149
00150        hr = VariantToPtrList( var, dList );
00151
00152        pEntry->Release();
00153
00154        ////////////////////////////
00155        // IADsPropertyValue
00156        /////////////////////////////
00157        if ( SUCCEEDED(hr) )
00158        {
00159         POSITION pos;
00160         pos = dList.GetHeadPosition();
00161         while ( pos != NULL )
00162         {
00163           pDispatch = (IDispatch*) dList.GetAt(pos);
00164           hr = pDispatch->QueryInterface( IID_IADsPropertyValue, (void**) &pValue );
00165
00166           if ( SUCCEEDED(hr) )
00167           {
00168             pValue->AddRef();
00169             hr = PropertyValueToString( lADsType, pValue, s );
00170             m_cValueList.AddString( s );
00171             pValue->Release();
00172           }
00173           dList.GetNext(pos);
00174         }
00175
00176        }
00177
00178        dList.RemoveAll();
00179        VariantClear(&var);
00180
00181     }
00182
00183   }
00184 }
00185
00186 void CDlgIADsPropertyList::OnPurge()
00187 {
00188   HRESULT hr;
00189
00190   hr = m_pPropList->PurgePropertyList();
00191
00192   if ( !SUCCEEDED(hr) )
00193   {
00194     AfxMessageBox(GetErrorMessage(hr));
00195   }
00196 }
Generated on Wed Nov 13 2024 16:52:17 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CImpIDBProperties Member List

This is the complete list of members for CImpIDBProperties, including all inherited members.
DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CDataSource, CImpIDBProperties) | CImpIDBProperties
GetProperties(ULONG cPropertySets, const DBPROPIDSET rgPropertySets[], ULONG *pcProperties, DBPROPSET **prgProperties) | CImpIDBProperties
GetPropertyInfo(ULONG cPropertySets, const DBPROPIDSET rgPropertySets[], ULONG *pcPropertyInfoSets, DBPROPINFOSET **prgPropertyInfoSets, WCHAR **ppDescBuffer) | CImpIDBProperties
SetProperties(ULONG cPropertySets, DBPROPSET rgPropertySets[]) | CImpIDBProperties
Generated on Wed Nov 13 2024 16:56:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

Conf Member List

This is the complete list of members for Conf, including all inherited members.
AcceptCall() | Conf |
Call(CPluggableTransport *pPlugTrans) | Conf |
CallAccepted() | Conf |
CallCreated(INmCall *pCall) | Conf |
CallRejected() | Conf |
Conf(HWND) | Conf |
ConferenceCreated(INmConference *) | Conf |
GetNmManager() | Conf |
HangUp() | Conf |
InCall() | Conf |
Initialize(void) | Conf |
m_bInCall | Conf | [private]
m_hWnd | Conf | [private]
m_pCallNotify | Conf | [private]
m_pConfNotify | Conf | [private]
m_pINmCall | Conf | [private]
m_pINmConf | Conf | [private]
m_pINmMgr | Conf | [private]
m_pMgrNotify | Conf | [private]
RejectCall() | Conf |
RemoteHungup() | Conf |
Uninitialize(void) | Conf |
~Conf() | Conf | [virtual]
Generated on Wed Nov 13 2024 16:57:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/upnp/StepByStep/Step4/Dimmer.h Source File

  • NetDS
  • upnp
  • StepByStep
  • Step4

Dimmer.h

Go to the documentation of this file.
00001 // Dimmer.h : Declaration of the CDimmer
00002
00003 #ifndef __DIMMER_H_
00004 #define __DIMMER_H_
00005
00006 #include "resource.h"       // main symbols
00007 #import "C:\UPnPSample\SDKDimmer\DimmerDevice\StepByStep\Step2\Debug\upnphost.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
00008
00009 #define NUM_TEMPLATE_UDNS_IN_DESCDOC 1  //This is equal to the number of devices (root or embedded) in the description doc
00010 #define MAX_NOSERVICE_PER_DEVICE 1    //This  is equal to the maximum number of services in any device in the description doc
00011
00012 /////////////////////////////////////////////////////////////////////////////
00013 // CDimmer
00014 class ATL_NO_VTABLE CDimmer :
00015   public CComObjectRootEx<CComMultiThreadModel>,
00016   public CComCoClass<CDimmer, &CLSID_Dimmer>,
00017   //public IDispatchImpl<IDimmer, &IID_IDimmer, &LIBID_MYDEVICELib>,
00018   public IUPnPDeviceControl
00019 {
00020 private:
00021   //variables used internally are declared
00022
00023   // String that stores the description doc that is passed by the Device Host during Intialize
00024   BSTR descriptionDoc;
00025
00026   //table to hold mapping from template UDN's to the UDN's actually used by the DeviceHost when publishing the device
00027   BSTR UDNmapping[NUM_TEMPLATE_UDNS_IN_DESCDOC][2];
00028
00029   //now for each of the Template UDN's we maintain a list of services in it and the IDispatch interface pointers
00030   //the serviceIDDeviceMap table maps between devices (root or embedded) and the service Id's in the device
00031   BSTR serviceIDDeviceMap[NUM_TEMPLATE_UDNS_IN_DESCDOC][MAX_NOSERVICE_PER_DEVICE];
00032
00033   //this table maps between the services in the device (root or embedded) and the IDispatch pointers
00034   IDispatch* pDisPtrs[NUM_TEMPLATE_UDNS_IN_DESCDOC][MAX_NOSERVICE_PER_DEVICE];
00035
00036
00037 public:
00038   CDimmer();
00039   ~CDimmer();
00040   STDMETHODIMP CDimmer::Initialize(BSTR bstrXMLDesc,BSTR deviceID,BSTR bstrInitString);
00041   STDMETHODIMP CDimmer::GetServiceObject(BSTR bstrUDN,BSTR bstrServiceId,IDispatch **ppdispService);
00042
00043 DECLARE_REGISTRY_RESOURCEID(IDR_DIMMER)
00044
00045 DECLARE_PROTECT_FINAL_CONSTRUCT()
00046
00047 BEGIN_COM_MAP(CDimmer)
00048   //COM_INTERFACE_ENTRY(IDimmer)
00049   //COM_INTERFACE_ENTRY(IDispatch)
00050   COM_INTERFACE_ENTRY(IUPnPDeviceControl)
00051 END_COM_MAP()
00052
00053 };
00054
00055 #endif //__DIMMER_H_
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/CustomAuth/Redir401.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • CustomAuth

Redir401.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: Redir401.cpp
00006
00007 Abstract:
00008
00009   ISAPI filter to modify 401 responses so that they
00010     send a 302 redirect to another URL.
00011
00012 Author:
00013
00014   ISAPI developer (Microsoft employee), November 2002
00015
00016 --*/
00017
00018 //
00019 // We need to define _WIN32_WINNT to version
00020 // 5 so that LOGON32_LOGON_NETWORK_CLEARTEXT
00021 // gets defined.
00022 //
00023
00024 #ifndef _WIN32_WINNT
00025 #define _WIN32_WINNT 0x500
00026 #endif
00027
00028 #include <stdio.h>
00029 #include <windows.h>
00030 #include <httpfilt.h>
00031 #include <IsapiTools.h>
00032 #include "CustomAuth.h"
00033
00034 #define MAX_CONFIG_LINE 1024
00035
00036 ISAPI_STRING    g_strRedirectResponse;
00037
00038 //
00039 // Enumeration for filter state
00040 //
00041
00042 enum FILTER_STATE
00043 {
00044     IgnoreNotification = 0,
00045     ReplaceDataWithRedirectBlob,
00046     SuppressData
00047 };
00048
00049 //
00050 // Local prototypes
00051 //
00052
00053 DWORD
00054 DoPreprocHeaders(
00055     HTTP_FILTER_CONTEXT *           pfc,
00056     HTTP_FILTER_PREPROC_HEADERS *   pPreproc
00057     );
00058
00059 DWORD
00060 DoSendResponse(
00061     HTTP_FILTER_CONTEXT *       pfc,
00062     HTTP_FILTER_SEND_RESPONSE * pSendResponse
00063     );
00064
00065 DWORD
00066 DoSendRawData(
00067     HTTP_FILTER_CONTEXT *   pfc,
00068     HTTP_FILTER_RAW_DATA *  pRawData
00069     );
00070
00071 DWORD
00072 DoEndOfRequest(
00073     HTTP_FILTER_CONTEXT *       pfc
00074     );
00075
00076 VOID
00077 TrimCommentAndTrailingWhitespace(
00078     CHAR *  szString
00079     );
00080
00081 BOOL
00082 LoadModuleConfig(
00083     VOID
00084     );
00085
00086 BOOL
00087 GetStringFromConfig(
00088     CHAR *          szKey,
00089     CHAR *          szDefault,
00090     ISAPI_STRING *  pstrString
00091     );
00092
00093 INT
00094 GetIntFromConfig(
00095     CHAR *  szKey,
00096     INT     nDefault
00097     );
00098
00099 BOOL WINAPI GetFilterVersion(
00100   PHTTP_FILTER_VERSION pVer
00101   )
00102 /*++
00103
00104 Purpose:
00105
00106     Required entry point for ISAPI filters.  This function
00107     is called when the server initially loads this DLL.
00108
00109 Arguments:
00110
00111     pVer - Points to the filter version info structure
00112
00113 Returns:
00114
00115     TRUE on successful initialization
00116     FALSE on initialization failure
00117
00118 --*/
00119 {
00120   pVer->dwFilterVersion = HTTP_FILTER_REVISION;
00121   lstrcpy(pVer->lpszFilterDesc, "Redir401 ISAPI Filter");
00122   pVer->dwFlags =
00123     SF_NOTIFY_ORDER_DEFAULT |
00124         SF_NOTIFY_PREPROC_HEADERS |
00125         SF_NOTIFY_SEND_RESPONSE |
00126         SF_NOTIFY_SEND_RAW_DATA
00127     ;
00128
00129     //
00130     // Initialize IsapiTools
00131     //
00132
00133     InitializeIsapiTools( MODULE_NAME );
00134
00135     //
00136     // Initialize the global extension object.
00137     //
00138     // Normally, this would occur in GetExtensionVersion on
00139     // an extension, but since we want access to the data
00140     // here as well and the filter part is guaranteed to
00141     // be called before the extension, we'll do it here.
00142     //
00143
00144     if ( g_Extension.Initialize( MODULE_NAME ) == FALSE )
00145     {
00146         goto Failed;
00147     }
00148
00149     //
00150     // Get the config filename
00151     //
00152
00153     if ( g_strIniFile.Printf( "%s\\%s.ini",
00154                               g_Extension.QueryModulePath(),
00155                               MODULE_NAME ) == FALSE )
00156     {
00157         goto Failed;
00158     }
00159
00160     //
00161     // Read the config data
00162     //
00163
00164     if ( LoadModuleConfig() == FALSE )
00165     {
00166         goto Failed;
00167     }
00168
00169     g_fFilterInitialized = TRUE;
00170
00171   return TRUE;
00172
00173 Failed:
00174
00175     return FALSE;
00176 }
00177
00178 DWORD WINAPI HttpFilterProc(
00179   PHTTP_FILTER_CONTEXT pfc,
00180   DWORD dwNotificationType,
00181   LPVOID pvNotification
00182   )
00183 /*++
00184
00185 Purpose:
00186
00187     Required filter notification entry point.  This function is called
00188     whenever one of the events (as registered in GetFilterVersion) occurs.
00189
00190 Arguments:
00191
00192     pfc              - A pointer to the filter context for this notification
00193     NotificationType - The type of notification
00194     pvNotification   - A pointer to the notification data
00195
00196 Returns:
00197
00198     One of the following valid filter return codes:
00199     - SF_STATUS_REQ_FINISHED
00200     - SF_STATUS_REQ_FINISHED_KEEP_CONN
00201     - SF_STATUS_REQ_NEXT_NOTIFICATION
00202     - SF_STATUS_REQ_HANDLED_NOTIFICATION
00203     - SF_STATUS_REQ_ERROR
00204     - SF_STATUS_REQ_READ_NEXT
00205
00206 --*/
00207 {
00208     DWORD   status = SF_STATUS_REQ_NEXT_NOTIFICATION;
00209
00210     //
00211     // Route the notification to the proper handler function
00212     //
00213
00214     switch ( dwNotificationType )
00215     {
00216     case SF_NOTIFY_PREPROC_HEADERS:
00217
00218         status = DoPreprocHeaders( pfc,
00219                                    (HTTP_FILTER_PREPROC_HEADERS*)pvNotification );
00220
00221         break;
00222
00223     case SF_NOTIFY_SEND_RESPONSE:
00224
00225         status = DoSendResponse( pfc,
00226                                  (HTTP_FILTER_SEND_RESPONSE*)pvNotification );
00227
00228         break;
00229
00230     case SF_NOTIFY_SEND_RAW_DATA:
00231
00232         status = DoSendRawData( pfc,
00233                                 (HTTP_FILTER_RAW_DATA*)pvNotification );
00234
00235         break;
00236     }
00237
00238     return status;
00239 }
00240
00241 DWORD
00242 DoPreprocHeaders(
00243     HTTP_FILTER_CONTEXT *           pfc,
00244     HTTP_FILTER_PREPROC_HEADERS *   pPreproc
00245     )
00246 {
00247     ISAPI_STRING    strPFC;
00248     DWORD           status = SF_STATUS_REQ_NEXT_NOTIFICATION;
00249
00250     //
00251     // Initialize the filter state for this request
00252     //
00253
00254     pfc->pFilterContext = (VOID*)IgnoreNotification;
00255
00256     //
00257     // We are going to store a string version of pfc in
00258     // a custom request header.  This will allow the extension
00259     // part of this dll to call AddResponseHeaders.
00260     //
00261     // First, ensure that our string is big enough to store 8
00262     // characters, plus terminator.
00263     //
00264
00265     if ( strPFC.ResizeBuffer( 9 ) == FALSE )
00266     {
00267         goto Failed;
00268     }
00269
00270     //
00271     // Add a CustomAuth-Context header with a string
00272     // version of pfc.
00273     //
00274
00275     _snprintf( strPFC.QueryStr(),
00276                strPFC.QueryBufferSize() - 1,
00277                "%08x",
00278                pfc );
00279
00280     if ( pPreproc->AddHeader( pfc,
00281                               "CustomAuth-Context:",
00282                               strPFC.QueryStr() ) == FALSE )
00283     {
00284         goto Failed;
00285     }
00286
00287     return status;
00288
00289 Failed:
00290
00291     WriteDebug( "DoPreprocHeaders failed.  Error %d\r\n",
00292                 GetLastError() );
00293
00294     return SF_STATUS_REQ_ERROR;
00295 }
00296
00297 DWORD
00298 DoSendResponse(
00299     HTTP_FILTER_CONTEXT *       pfc,
00300     HTTP_FILTER_SEND_RESPONSE * pSendResponse
00301     )
00302 /*++
00303
00304 Purpose:
00305
00306     Handles SF_NOTIFY_SEND_RESPONSE.
00307
00308     If we detect that we are sending a 401 response, and that
00309     no built-in authentication schemes are in use for this request,
00310     we will set the filter context to replace the 401 with a
00311     302 redirect to the logon page.
00312
00313     If this is not a 401 response, we will disable further
00314     notifications for this request for performance reasons.
00315
00316 Arguments:
00317
00318     pfc           - A pointer to the filter context for this notification
00319     pSendResponse - The HTTP_FILTER_SEND_RESPONSE structure
00320
00321 Returns:
00322
00323     SF_STATUS_REQ_NEXT_NOTIFICATION on success
00324     SF_STATUS_REQ_ERROR on failure
00325
00326 --*/
00327 {
00328     CHAR    szWwwAuthenticate[256];
00329     DWORD   status = SF_STATUS_REQ_NEXT_NOTIFICATION;
00330     DWORD   cbWwwAuthenticate;
00331     BOOL    fResult;
00332
00333
00334     //
00335     // We care about 401 responses.  If this is not a
00336     // 401, then we should disable further notifications.
00337     //
00338
00339     if ( pSendResponse->HttpStatus != 401 )
00340     {
00341         goto DisableFurtherNotifications;
00342     }
00343
00344     //
00345     // Do one more check.  If this request has any www-authenticate
00346     // response headers, then we know that one or more authentication
00347     // schemes are supported.  In this case, we'll defer to the
00348     // built-in authentication schemes.
00349     //
00350
00351     cbWwwAuthenticate = 256;
00352
00353     fResult =  pSendResponse->GetHeader( pfc,
00354                                          "WWW-AUTHENTICATE:",
00355                                          szWwwAuthenticate,
00356                                          &cbWwwAuthenticate );
00357
00358     if ( fResult == TRUE ||
00359          GetLastError() != ERROR_INVALID_INDEX )
00360     {
00361         goto DisableFurtherNotifications;
00362     }
00363
00364     //
00365     // Set the filter state such that the send raw
00366     // handler replaces the first packet with the
00367     // redirect blob.
00368     //
00369
00370     pfc->pFilterContext = (VOID*)ReplaceDataWithRedirectBlob;
00371
00372     return status;
00373
00374 DisableFurtherNotifications:
00375
00376     pfc->ServerSupportFunction( pfc,
00377                                 SF_REQ_DISABLE_NOTIFICATIONS,
00378                                 NULL,
00379                                 SF_NOTIFY_SEND_RAW_DATA |
00380                                 SF_NOTIFY_END_OF_REQUEST,
00381                                 0 );
00382
00383     return status;
00384 }
00385
00386 DWORD
00387 DoSendRawData(
00388     HTTP_FILTER_CONTEXT *   pfc,
00389     HTTP_FILTER_RAW_DATA *  pRawData
00390     )
00391 /*++
00392
00393 Purpose:
00394
00395     Handles SF_NOTIFY_SEND_RAW_DATA.
00396
00397     Replaces the raw data going to the client with the redirect
00398     response data, or suppresses the data as directed by the
00399     request state.
00400
00401 Arguments:
00402
00403     pfc      - A pointer to the filter context for this notification
00404     pRawData - The HTTP_FILTER_RAW_DATA structure
00405
00406 Returns:
00407
00408     SF_STATUS_REQ_NEXT_NOTIFICATION
00409
00410 --*/
00411 {
00412     FILTER_STATE    state = (FILTER_STATE)((DWORD)pfc->pFilterContext);
00413     DWORD           status = SF_STATUS_REQ_NEXT_NOTIFICATION;
00414
00415     //
00416     // Do the right thing for the current state
00417     //
00418
00419     switch ( state )
00420     {
00421     case IgnoreNotification:
00422
00423         goto Done;
00424
00425     case ReplaceDataWithRedirectBlob:
00426
00427         pRawData->pvInData = g_strRedirectResponse.QueryStr();
00428         pRawData->cbInBuffer = g_strRedirectResponse.QueryBufferSize();
00429         pRawData->cbInData = g_strRedirectResponse.QueryCB();
00430
00431         //
00432         // Set the state to suppress data, so any further notifications
00433         // on this response won't reach the client.
00434         //
00435
00436         pfc->pFilterContext = (VOID*)SuppressData;
00437
00438         goto Done;
00439
00440     case SuppressData:
00441
00442         pRawData->cbInData = 0;
00443
00444         goto Done;
00445     }
00446
00447 Done:
00448
00449     return status;
00450 }
00451
00452 DWORD
00453 DoEndOfRequest(
00454     HTTP_FILTER_CONTEXT *       pfc
00455     )
00456 /*++
00457
00458 Purpose:
00459
00460     Handles SF_NOTIFY_END_OF_REQUEST
00461
00462     Resets the filter state for subsequent requests over
00463     this same client connection.
00464
00465 Arguments:
00466
00467     pfc      - A pointer to the filter context for this notification
00468
00469 Returns:
00470
00471     SF_STATUS_REQ_NEXT_NOTIFICATION
00472
00473 --*/
00474 {
00475     DWORD   status = SF_STATUS_REQ_NEXT_NOTIFICATION;
00476
00477     //
00478     // Reset the filter state
00479     //
00480
00481     pfc->pFilterContext = (VOID*)IgnoreNotification;
00482
00483     return status;
00484 }
00485
00486 BOOL
00487 LoadModuleConfig(
00488     VOID
00489     )
00490 /*++
00491
00492 Purpose:
00493
00494     Loads the configuration for this ISAPI from
00495     the ini file.
00496
00497 Arguments:
00498
00499     None
00500
00501 Returns:
00502
00503     TRUE on success, FALSE on failure
00504
00505 --*/
00506 {
00507     ISAPI_STRING    strLogonType;
00508     INT             nFlag;
00509
00510     //
00511     // Get LogonUrl as a string
00512     //
00513
00514     if ( GetStringFromConfig( "LogonUrl",
00515                               DEFAULT_LOGON_URL,
00516                               &g_strLogonUrl ) == FALSE )
00517     {
00518         goto Failed;
00519     }
00520
00521     //
00522     // Get LogoffUrl as a string
00523     //
00524
00525     if ( GetStringFromConfig( "LogoffUrl",
00526                               DEFAULT_LOGON_URL,
00527                               &g_strLogoffUrl ) == FALSE )
00528     {
00529         goto Failed;
00530     }
00531
00532     //
00533     // Get UseBuiltInLogonPage as a boolean
00534     //
00535
00536     nFlag = GetIntFromConfig( "UseBuiltInLogonPage",
00537                               DEFAULT_USE_BUILTIN_LOGON );
00538
00539     g_fUseBuiltInLogon = ( nFlag != 0 );
00540
00541     //
00542     // Get UseBuiltInLogoffPage as a boolean
00543     //
00544
00545     nFlag = GetIntFromConfig( "UseBuiltInLogoffPage",
00546                               DEFAULT_USE_BUILTIN_LOGOFF );
00547
00548     g_fUseBuiltInLogoff = ( nFlag != 0 );
00549
00550     //
00551     // Get UseSSLForFormSubmission as a boolean
00552     //
00553
00554     nFlag = GetIntFromConfig( "UseSSLForFormSubmission",
00555                               DEFAULT_USE_SSL );
00556
00557     g_fUseSSLForSubmission = ( nFlag != 0 );
00558
00559     //
00560     // Get UseClientIpForEncryption as a boolean
00561     //
00562
00563     nFlag = GetIntFromConfig( "UseClientIpForEncryption",
00564                               DEFAULT_USE_CLIENT_IP );
00565
00566     g_fUseClientIpForEncryption = ( nFlag != 0 );
00567
00568     //
00569     // Get LogonTimeout as an int
00570     //
00571
00572     g_LogonTimeoutSeconds = GetIntFromConfig( "LogonTimeout",
00573                                               DEFAULT_LOGON_TIMEOUT );
00574
00575     //
00576     // Get LogonSuccessUrl as a string
00577     //
00578
00579     if ( GetStringFromConfig( "LogonSuccessUrl",
00580                               DEFAULT_LOGON_SUCCESS_URL,
00581                               &g_strLogonSuccessUrl ) == FALSE )
00582     {
00583         goto Failed;
00584     }
00585
00586     //
00587     // Get LogonType as a string, and resolve it to a LOGON32_LOGON value
00588     //
00589
00590     if ( GetStringFromConfig( "LogonType",
00591                               DEFAULT_LOGON_TYPE,
00592                               &strLogonType ) == FALSE )
00593     {
00594         goto Failed;
00595     }
00596
00597     if ( stricmp( strLogonType.QueryStr(), "network_cleartext" ) == 0 )
00598     {
00599         g_LogonType = LOGON32_LOGON_NETWORK_CLEARTEXT;
00600     }
00601     else if ( stricmp( strLogonType.QueryStr(), "batch" ) == 0 )
00602     {
00603         g_LogonType = LOGON32_LOGON_BATCH;
00604     }
00605     else if ( stricmp( strLogonType.QueryStr(), "network" ) == 0 )
00606     {
00607         g_LogonType = LOGON32_LOGON_NETWORK;
00608     }
00609     else if ( stricmp( strLogonType.QueryStr(), "interactive" ) == 0 )
00610     {
00611         g_LogonType = LOGON32_LOGON_INTERACTIVE;
00612     }
00613     else
00614     {
00615         g_LogonType = LOGON32_LOGON_NETWORK_CLEARTEXT;
00616     }
00617
00618     //
00619     // Build up the redirect response
00620     //
00621
00622     if ( g_strRedirectResponse.Printf( "HTTP/1.1 302 Object Moved\r\n"
00623                                        "Location: %s\r\n"
00624                                        "Set-Cookie: %s\r\n"
00625                                        "\r\n"
00626                                        REDIRECT_ENTITY,
00627                                        g_strLogonUrl.QueryStr(),
00628                                        DELETE_COOKIE,
00629                                        g_strLogonUrl.QueryStr() ) == FALSE )
00630     {
00631         goto Failed;
00632     }
00633
00634     return TRUE;
00635
00636 Failed:
00637
00638     WriteDebug( "LoadModuleConfig failed.  Error %d.\r\n",
00639                 GetLastError() );
00640
00641     return FALSE;
00642 }
00643
00644 BOOL
00645 GetStringFromConfig(
00646     CHAR *          szKey,
00647     CHAR *          szDefault,
00648     ISAPI_STRING *  pstrString
00649     )
00650 /*++
00651
00652 Purpose:
00653
00654     Gets a string from the ini file
00655
00656 Arguments:
00657
00658     szKey      - The key to retrieve (from the [Options] section)
00659     szDefault  - Default value to use if the key is not found
00660     pstrString - On successful return, contains the value
00661
00662 Returns:
00663
00664     TRUE on success, FALSE on failure
00665
00666 --*/
00667 {
00668     CHAR    szValue[MAX_CONFIG_LINE];
00669     BOOL    fResult;
00670
00671     GetPrivateProfileString( "Options",
00672                              szKey,
00673                              "",
00674                              szValue,
00675                              MAX_CONFIG_LINE,
00676                              g_strIniFile.QueryStr() );
00677
00678     TrimCommentAndTrailingWhitespace( szValue );
00679
00680     if ( szValue[0] == '\0' )
00681     {
00682         WriteDebug( "GetStringFromConfig returning default value for %s.\r\n",
00683                     szDefault );
00684
00685         fResult = pstrString->Copy( szDefault );
00686     }
00687     else
00688     {
00689         fResult = pstrString->Copy( szValue );
00690     }
00691
00692     if ( !fResult )
00693     {
00694         WriteDebug( "GetStringFromConfig failed.  Error %d.\r\n",
00695                     GetLastError() );
00696     }
00697
00698     return fResult;
00699 }
00700
00701 INT
00702 GetIntFromConfig(
00703     CHAR *  szKey,
00704     INT     nDefault
00705     )
00706 /*++
00707
00708 Purpose:
00709
00710     Gets an integer value from the ini file
00711
00712 Arguments:
00713
00714     szKey    - The key to retrieve (from the [Options] section)
00715     nDefault - Default value to use if the key is not found
00716
00717 Returns:
00718
00719     The requested value, or the default if it wasn't found
00720
00721 --*/
00722 {
00723     return GetPrivateProfileInt( "Options",
00724                                  szKey,
00725                                  nDefault,
00726                                  g_strIniFile.QueryStr() );
00727 }
00728
00729 VOID
00730 TrimCommentAndTrailingWhitespace(
00731     CHAR *  szString
00732     )
00733 /*++
00734
00735 Purpose:
00736
00737     This function trims a text line from an INI file
00738     such that it's truncated at the first instance of
00739     a ';'. Any trailing whitespace is also removed.
00740
00741 Arguments:
00742
00743     szString - The string to trim
00744
00745 Returns:
00746
00747     None
00748
00749 --*/
00750 {
00751     LPSTR   pCursor = szString;
00752     LPSTR   pWhite = NULL;
00753
00754     while ( *pCursor )
00755     {
00756         if ( *pCursor == ';' )
00757         {
00758             *pCursor = '\0';
00759             break;
00760         }
00761
00762         if ( *pCursor == ' ' || *pCursor == '\t' )
00763         {
00764             if ( !pWhite )
00765             {
00766                 pWhite = pCursor;
00767             }
00768         }
00769         else
00770         {
00771             pWhite = NULL;
00772         }
00773
00774         pCursor++;
00775     }
00776
00777     if ( pWhite )
00778     {
00779         *pWhite = '\0';
00780     }
00781
00782     return;
00783 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

SIndexedDiskLessThan Member List

This is the complete list of members for SIndexedDiskLessThan, including all inherited members.
operator()(const SIndexedDisk &rLeftIn, const SIndexedDisk &rRightIn) const SIndexedDiskLessThan [inline]
Generated on Wed Nov 13 2024 16:57:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/NMUI/Global.h Source File

  • Web
  • NetMeeting
  • NMUI

Global.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     NMUI.EXE
00003 //  File:       GLOBAL.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015 #ifndef GLOBAL_H
00016 #define GLOBAL_H
00017
00018
00019 //-------------------------------------------------------
00020 // Useful macros
00021
00022 #define ARRAY_ELEMENTS(rg)      (sizeof(rg) / sizeof(rg[0]))
00023
00024 #ifdef DEBUG
00025 VOID FAR PASCAL AssertProc(LPTSTR lpszMsg, LPTSTR lpszAssert, LPTSTR lpszFile, UINT line);
00026
00027 #define DEBASSERT(exp,szMsg)  \
00028   if (!(exp))                                                      \
00029   {                                                                \
00030     static TCHAR _szAssert[] = TEXT(#exp) ;   \
00031     static TCHAR _szMsg[]    = szMsg;   \
00032     AssertProc(_szMsg,_szAssert,TEXT(__FILE__),__LINE__); \
00033   }
00034
00035 #define ASSERT(f)       DEBASSERT(f, TEXT("(") TEXT(#f) TEXT(")"))
00036 #define AssertSz(f,sz)  DEBASSERT(f, sz)
00037 #define NotReached()    DEBASSERT(FALSE, TEXT("NotReached declaration was reached!"))
00038 #else
00039 #define ASSERT(f)
00040 #define AssertSz(f, sz)
00041 #define NotReached()
00042 #endif
00043
00044
00045 VOID TraceMsg(LPTSTR ptszFormat,...);
00046 VOID ErrorMsg(LPTSTR ptszFormat,...);
00047 VOID WarnMsg(LPTSTR ptszFormat,...);
00048 #define WARN_MSG   ::WarnMsg
00049 #define ERROR_MSG  ::ErrorMsg
00050
00051 #define TRACE_MSG  (!gPref.fMsgTrace)   ? (void) 0 : ::TraceMsg
00052 #define OBJECT_MSG (!gPref.fMsgObjects) ? (void) 0 : ::TraceMsg
00053 #define NOTIFY_MSG (!gPref.fMsgNotify)  ? (void) 0 : ::TraceMsg
00054 #define STATE_MSG  (!gPref.fMsgState)   ? (void) 0 : ::TraceMsg
00055
00056 #define LOGOFF 0
00057 #define LOGON  1
00058
00059 VOID LogMsg(COLORREF cv, LPTSTR pszFormat,...);
00060 #define LOG_MSG ::LogMsg
00061
00062 // no debug messages:
00063 // inline void WINAPI Trace(LPCTSTR, ...) { }
00064 // #define TRACE_MSG     1 ? (void)0 : ::TraceMsg
00065 // #define WARN_MSG      1 ? (void)0 : ::TraceMsg
00066 // #define ERROR_MSG     1 ? (void)0 : ::TraceMsg
00067
00068 #ifndef NEEDDEBUG
00069 LPCTSTR GetHrSz(HRESULT hr);
00070 LPCTSTR GetConfnSz(CONFN confn);
00071 LPCTSTR GetNmchSz(ULONG uch);
00072 LPCTSTR GetCallStateSz(NM_CALL_STATE uState);
00073 LPCTSTR GetConferenceStateSz(NM_CONFERENCE_STATE uState);
00074 LPCTSTR GetCollaborationStateSz(NM_SHARE_STATE uState);
00075 VOID DumpCallInfo(INmCall * pCall);
00076 VOID DumpAllCalls(void);
00077 VOID DumpMemberInfo(INmMember * pMember);
00078 VOID DumpConferenceInfo(INmConference * pConference);
00079 VOID DumpChannelInfo(INmChannel * pChannel);
00080 #else
00081 #define GetHrSz(hr)       TEXT("")
00082 #define GetConfnSz(confn) TEXT("")
00083 #define GetNmchSz(uch)    TEXT("")
00084 #define GetCallStateSz(uState)  TEXT("")
00085 #define GetConferenceStateSz(uState) TEXT("")
00086 #define DumpCallInfo(pCall);
00087 #define DumpMemberInfo(pMember);
00088 #define DumpConferenceInfo(pConference);
00089 #define DumpChannelInfo(pChannel);
00090 #endif
00091
00092
00093
00094
00095
00096 //-------------------------------------------------------------------------
00097 // Functions for handling main window messages.  The message-dispatching
00098 // mechanism expects all message-handling functions to have the following
00099 // prototype:
00100 //
00101 // Function pointer prototype for message handling functions.
00102 //     LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM);
00103
00104 typedef LRESULT (*PFNMSG)(HWND, UINT, WPARAM, LPARAM);
00105
00106 // This structure maps messages to message handling functions.
00107 typedef struct _MSD
00108 {
00109   UINT   uMsg;
00110   PFNMSG pfnmsg;
00111 } MSD;                 // MeSsage Dispatch structure
00112 typedef MSD * LPMSD;
00113
00114
00115 //-------------------------------------------------------------------------
00116 // Functions for handling main window commands--ie. functions for
00117 // processing WM_COMMAND messages based on the wParam value.
00118 // The message-dispatching mechanism expects all command-handling
00119 // functions to have the following prototype:
00120
00121 typedef VOID (*PFNCMD)(VOID);
00122
00123 // This structure maps command IDs to command handling functions.
00124 typedef struct _CMD
00125 {
00126   UINT     wCmd;
00127   PFNCMD pfncmd;
00128 } CMD;                 // CoMmand Dispatch structure
00129 typedef CMD * LPCMD;
00130
00131 //-------------------------------------------------------------------------
00132 // Preferences
00133 typedef struct _PREF
00134 {
00135   BOOL    fConfirm;           // Confirm before receiving files
00136   BOOL    fSbar;              // Show status bar
00137   BOOL    fTbar;              // Show tool bar
00138   BOOL    fMsg;               // Show message window
00139   BOOL    fChat;              // Show Chat Window
00140
00141   LOGFONT lf;                 // Font to use for main message window
00142   WINDOWPLACEMENT wpMain;
00143   PTCHAR  pszAddr;            // Default Address information (machine name, ip addr)
00144   NM_ADDR_TYPE nmAddrType;    // Address Type (pszUserAddr)
00145
00146   DWORD   dwNmch;             // Allowable channel types
00147   PTCHAR  pszConferenceName;  // Conference Name
00148   PTCHAR  pszPassword;        // Conference password
00149   PTCHAR  pszFileName;        // File name
00150
00151   int     iInit;              // Initialize option (NM_INIT_NORMAL)
00152
00153   BOOL    fAutoMonitor;
00154   BOOL    fAutoHost;
00155   BOOL    fAutoCall;
00156   BOOL    fAutoChat;
00157
00158   BOOL    fMsgTrace;
00159   BOOL    fMsgObjects;
00160   BOOL    fMsgNotify;
00161   BOOL    fMsgState;
00162
00163
00164   NM_CALL_TYPE nmCallType;
00165 } PREF;
00166
00167
00168 // List column information
00169
00170 typedef struct _tagCol {
00171   UINT  dwWidth;
00172   LPTSTR lpsz;
00173 } COL;
00174 typedef COL * LPCOL;
00175
00176 // Generic int, string array
00177 typedef struct {
00178   DWORD  dw;
00179   LPTSTR psz;
00180 } DWSTR;
00181
00182
00183
00184 //-------------------------------------------------------------------------
00185 // Special resource constants
00186 #define IDW_MSG   100
00187 #define IDW_LVIEW 101
00188 #define IDW_SBAR  102
00189 #define IDW_TBAR  103
00190 #define IDW_CHAT  104
00191 #define IDW_SEND  105
00192
00193 // toolbar constants
00194 #define NUMIMAGES       29
00195 #define IMAGEWIDTH      16
00196 #define IMAGEHEIGHT     16
00197 #define BUTTONWIDTH     16
00198 #define BUTTONHEIGHT    16
00199
00200 #define STATUSICONSIZE  16
00201
00202 // status bar parts
00203 #define IDSBP_MSG        0
00204 #define IDSBP_USERCOUNT  1
00205 #define IDSBP_ICON       2
00206
00207 // See _rgColMember
00208 #define ILV_NAME    0
00209 #define ILV_VERSION 1
00210 #define ILV_CAPS    2
00211 #define ILV_AUDIO   3
00212 #define ILV_FT      4
00213 #define ILV_AS      5
00214 #define ILV_MCU     6
00215 #define ILV_LOCAL   7
00216 #define ILV_ADDR    8
00217 #define ILV_ID      9
00218
00219 #define DXP_SEND   60   // Width of the "Send" button
00220 #define DYP_SEND   25   // Height of the "Send" button
00221 #define DXP_ULIST  120  // Width of the chat user list
00222 #define DYP_ULIST  90   // Height of the list when dropped down
00223
00224
00225
00226 //-------------------------------------------------------------------------
00227 // Global Function Prototypes.
00228
00229
00230 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
00231
00232 VOID DlgExit(HWND, WORD, WORD, HWND);
00233
00234 // from util.cpp
00235 BOOL  GetIniBool(LPTSTR szEntry, BOOL f);
00236 DWORD GetIniInt(LPTSTR szEntry, DWORD dwDefault);
00237 LPTSTR GetIniStr(LPTSTR szEntry, LPTSTR szDefault);
00238 VOID GetIniHex(LPTSTR szEntry, LPVOID lpv, int cb);
00239 VOID WriteIniBool(LPTSTR szEntry, BOOL f);
00240 VOID WriteIniInt(LPTSTR szEntry, DWORD dw);
00241 VOID WriteIniStr(LPTSTR szEntry, LPTSTR sz);
00242 VOID WriteIniHex(LPTSTR szEntry, LPVOID lpv, int cb);
00243 VOID CenterWindow(HWND hwndChild, HWND hwndParent);
00244 LPVOID LpvAlloc(int cb);
00245 LPTSTR PszAlloc(int cch);
00246 VOID FreePlpv(LPVOID plpv);
00247 VOID UpdateHdlgIdText(HWND hdlg, int id, LPVOID lpv);
00248 VOID UpdateHdlgIdInt(HWND hdlg, int id, LPINT lpint);
00249 TCHAR ChFromHex(LPTSTR lpch);
00250 VOID GetDlgItemsRc(HWND hdlg, int id1, int id2, LPRECT prc);
00251 VOID HexToData(LPTSTR lpchSrc, LPVOID lpchDest, int cb);
00252 VOID DataToHex(LPTSTR lpchSrc, LPTSTR lpchDest, int cb);
00253 VOID SetMenuCheck(UINT idm, BOOL fCheck);
00254 VOID MaybeDeleteObject(HGDIOBJ * phgdi);
00255 int GetRadioButton(HWND hdlg, int idrFirst, int idrLast);
00256 VOID GetDlgItemPsz(HWND hdlg, UINT id, LPTSTR *ppsz);
00257
00258 VOID GuidToSz(GUID * pguid, LPTSTR sz);
00259 VOID SzToGuid(LPTSTR sz, GUID * pguid);
00260 LPTSTR SzFindLastCh(LPTSTR lpsz, TCHAR ch);
00261
00262
00263 // from rtns.cpp
00264 VOID SizeStatus(int dxClient, int dy);
00265 VOID SizeMsgWindow(int dx, int dy);
00266 VOID RecalcMsgWindow(void);
00267 VOID ShowHwnd(HWND hwnd, BOOL fShow, int idm);
00268
00269 // from dlg.cpp
00270 BOOL DlgNewConference(VOID);
00271 BOOL DlgNewCall(VOID);
00272 BOOL DlgCallConf(VOID);
00273 BOOL DlgSendFile(VOID);
00274 BOOL DlgOptions(VOID);
00275 BOOL DlgAudio(VOID);
00276 BOOL DlgShare(VOID);
00277 BOOL DlgLaunch(VOID);
00278 BOOL DlgEject(VOID);
00279 VOID InitializeUserList(HWND hwndCombo, BOOL fEveryone);
00280 VOID DrawUserItem(LPDRAWITEMSTRUCT lpdis);
00281 BOOL DlgLogOnOff(VOID);
00282 BOOL DlgShowLocal(VOID);
00283
00284
00285 // from init.cpp
00286 BOOL FInitApp(LPTSTR lpszCmd, int nCmdShow);
00287 VOID FreeAllComObjects(void);
00288 VOID ReadPref(void);
00289 VOID WritePref(void);
00290
00291 // from dlg.cpp
00292 VOID DisplayStatus(BOOL fShow);
00293 VOID DisplayDlg(BOOL fShow, HWND * phdlg, int id, int idm);
00294
00295
00296 // from sbar.cpp
00297 BOOL FCreateSbar(void);
00298 VOID UpdateStatusIcon(DWORD dwId);
00299 VOID UpdateStatusBar(LPTSTR lpsz, WORD wPart, WORD wFlags);
00300 VOID StatusMsg(LPTSTR sz);
00301 VOID WriteIniTbar(void);
00302 VOID SetToolbarCheck(int idm, BOOL fCheck);
00303
00304
00305 // from tbar.cpp
00306 BOOL FCreateTbar(void);
00307
00308 // from cmd.cpp
00309 VOID RecalcMsgWindow(void);
00310 VOID ShowHwnd(HWND hwnd, BOOL fShow, int idm);
00311 VOID OnStartup(void);
00312
00313 // from msg.cpp
00314 INT MsgBoxIMbd(int iMbd);
00315 INT MsgBoxIMbdDw(int iMbd, DWORD dw);
00316 INT MsgBoxIMbdSz(int iMbd, LPTSTR lpsz);
00317
00318 // from util.cpp
00319 VOID Log(COLORREF cv, LPTSTR lpsz);
00320 VOID ClearLog(void);
00321 VOID LogTestStart(LPTSTR sz);
00322 VOID LogTestStop(LPTSTR sz);
00323 VOID LogTestCancel(LPTSTR sz);
00324 VOID LogResult(LPTSTR sz, DWORD dwTest, DWORD dwResult);
00325 VOID InitDbg(void);
00326 LPTSTR ConfErrToSz(DWORD dwError, LPTSTR sz);
00327 BOOL FGetFileName(LPTSTR szFileName);
00328 BOOL FGetDirectory(LPTSTR szDir);
00329
00330 VOID DoEnumChannelMember(INmChannel * pChannel);
00331 VOID DoEnumConferenceMember(INmConference * pConference);
00332 VOID DoEnumAll(void);
00333 VOID DoEnumMemberLeak(void);
00334 VOID DoSharableAppLeak(void);
00335 VOID DoEnumApps(void);
00336
00337 BOOL IsSharingEnabled(VOID);
00338
00339
00340
00341 #define SetPropResult(hdlg, f)  SetWindowLong(GetParent(hdlg), DWL_MSGRESULT, f)
00342
00343 //-------------------------------------------------------------------------
00344 // Global Variables
00345
00346 extern HINSTANCE ghInst;          // The current instance handle
00347 extern HACCEL    ghAccelTable;    // Menu accelerators
00348 extern PREF      gPref;           // User preferences
00349 extern HWND      ghwndMain;       // Main Window
00350 extern HMENU     ghMenu;          // Main Menu
00351 extern HWND      ghdlgStatus;     // Modeless Status Dialog
00352 extern HWND      ghwndSbar;       // Status bar
00353 extern HWND      ghwndTbar;       // Toolbar
00354 extern HWND      ghwndMsg;        // Message Window
00355 extern HWND      ghwndLView;      // Main List View
00356 extern HWND      ghwndChat;       // Chat Edit control
00357 extern HWND      ghwndSend;       // Send Button
00358 extern HWND      ghwndUList;      // User List
00359 extern HFONT     ghfontEntry;     // Font for message Window
00360
00361 extern int       gdxWndMin;       // maximum width of window
00362 extern int       gdyWndMin;       // maximum width of window
00363
00364 extern TCHAR gszAppName[];
00365 extern TCHAR gszIniName[];
00366
00367
00368 #endif /* GLOBAL_H */
Generated on Wed Nov 13 2024 16:52:11 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Incoming/Callnot.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Incoming

Callnot.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation.  All Rights Reserved.
00004
00005 Module Name:
00006     callnot.h
00007
00008 Abstract:
00009
00010     Declaration of the CTAPIEventNotification object
00011
00012 --*/
00013
00014 #ifndef __TAPIEventNotification_H__
00015 #define __TAPIEventNotification_H__
00016
00017 #define WM_PRIVATETAPIEVENT   WM_USER+101
00018
00019 HRESULT
00020 OnTapiEvent(
00021             TAPI_EVENT TapiEvent,
00022             IDispatch * pEvent
00023            );
00024
00025 /////////////////////////////////////////////////////////////////////////////
00026 // CTAPIEventNotification
00027 class CTAPIEventNotification : public ITTAPIEventNotification
00028 {
00029 private:
00030
00031     LONG       m_dwRefCount;
00032
00033 public:
00034
00035     // CTAPIEventNotification implements ITTAPIEventNotification
00036     //  Declare ITTAPIEventNotification methods here
00037     HRESULT STDMETHODCALLTYPE Event(
00038                                     TAPI_EVENT TapiEvent,
00039                                     IDispatch * pEvent
00040                                    );
00041
00042 // other COM stuff:
00043 public:
00044
00045     //
00046     // constructor
00047     //
00048
00049     CTAPIEventNotification()
00050     {
00051         m_dwRefCount = 1;
00052     }
00053
00054
00055     //
00056     // destructor
00057     //
00058
00059     ~CTAPIEventNotification()
00060     {
00061     }
00062
00063     // IUnknown implementation
00064   HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
00065     {
00066         if (iid == IID_ITTAPIEventNotification)
00067         {
00068             AddRef();
00069             *ppvObject = (void *)this;
00070             return S_OK;
00071         }
00072
00073         if (iid == IID_IUnknown)
00074         {
00075             AddRef();
00076             *ppvObject = (void *)this;
00077             return S_OK;
00078         }
00079
00080         return E_NOINTERFACE;
00081     }
00082
00083     //
00084     // reference counting needs to be thread safe
00085     //
00086
00087     ULONG STDMETHODCALLTYPE AddRef()
00088     {
00089         ULONG l = InterlockedIncrement(&m_dwRefCount);
00090         return l;
00091     }
00092
00093   ULONG STDMETHODCALLTYPE Release()
00094     {
00095         ULONG l = InterlockedDecrement(&m_dwRefCount);
00096
00097         if ( 0 == l)
00098         {
00099             delete this;
00100         }
00101
00102         return l;
00103     }
00104
00105
00106 };
00107
00108 #endif //__TAPIEventNotification_H__
00109
00110
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/help/llistimpl.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • help

llistimpl.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //  This is a part of the MMC SDK.
00003 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  MMC SDK Reference and related
00008 //  electronic documentation provided with the library.
00009 //  See these sources for detailed information regarding the
00010 //  MMC Library product.
00011 //
00012 //  LListImple.cpp: implementation of CLListImpl helper functions
00013 //
00014
00015
00016 #include "LListImpl.h"
00017
00018
00019 //---------------------------------------------------------------------------
00020 CPlex* PASCAL CPlex::Create(CPlex*& pHead, UINT nMax, UINT cbElement)
00021 {
00022   _ASSERT( nMax > 0 && cbElement > 0 );
00023   CPlex* p = (CPlex*) new BYTE[sizeof(CPlex) + nMax * cbElement];
00024       // may throw exception
00025   p->pNext = pHead;
00026   pHead = p;  // change head (adds in reverse order for simplicity)
00027   return p;
00028
00029 } //end Create()
00030
00031 //---------------------------------------------------------------------------
00032 // Free this one and links
00033 //
00034 void CPlex::FreeDataChain()
00035 {
00036   CPlex* p = this;
00037   while (p != NULL)
00038   {
00039     BYTE* bytes = (BYTE*) p;
00040     CPlex* pNext = p->pNext;
00041     delete[] bytes;
00042     p = pNext;
00043   }
00044 } //end FreeDataChain()
00045
00046 //---------------------------------------------------------------------------
00047 // IsValidAddress() returns TRUE if the passed parameter points
00048 // to at least nBytes of accessible memory. If bReadWrite is TRUE,
00049 // the memory must be writeable; if bReadWrite is FALSE, the memory
00050 // may be const.
00051 //
00052 BOOL IsValidAddress
00053 (
00054   const void*  lp,
00055   UINT         nBytes,
00056   BOOL         bReadWrite /* TRUE */
00057 )
00058 {
00059   // Simple version using Win-32 APIs for pointer validation.
00060   return (lp != NULL && !IsBadReadPtr(lp, nBytes) &&
00061          (!bReadWrite || !IsBadWritePtr((LPVOID)lp, nBytes)));
00062
00063 } //end IsValidAddress()
00064
Generated on Wed Nov 13 2024 16:52:37 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/winhttp/WinHttpFormSubmitSample/WinHttpFormSubmitSample.cpp Source File

  • Web
  • winhttp
  • WinHttpFormSubmitSample

WinHttpFormSubmitSample.cpp

Go to the documentation of this file.
00001 // WinHttpFormSubmitSample.cpp : Defines the entry point for the console application.
00002 //
00003 // Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005
00006 #include "stdio.h"
00007 #include "tchar.h"
00008 #include "windows.h"
00009 #include "winhttp.h"
00010
00011 #ifndef UNICODE
00012 #error "This sample was written as a Unicode only application."
00013 #endif
00014
00015 BOOL WinHttpFormSubmitSample( LPCWSTR szServer, INTERNET_PORT dwPort, LPWSTR szPath,
00016                               BOOL fUseSSL, LPWSTR szPostFilename);
00017
00018 int _tmain(int argc, _TCHAR* argv[])
00019 {
00020     URL_COMPONENTS urlComponents;
00021     LPWSTR szUrl = argv[1];
00022     LPWSTR szFilename = argv[2];
00023     BOOL fShowHelp = FALSE;
00024     LPWSTR szAllocHost = NULL;
00025     LPWSTR szAllocPath = NULL;
00026
00027     if (argc != 3)
00028     {
00029         fShowHelp = TRUE;
00030         goto done;
00031     }
00032
00033     //  We call WinHttpCrackUrl to get the server, path, and scheme of the request.
00034     memset( &urlComponents, 0, sizeof(urlComponents));
00035     urlComponents.dwStructSize = sizeof(urlComponents);
00036     urlComponents.dwHostNameLength = 1;
00037     urlComponents.dwUrlPathLength = 1;
00038
00039     if (!WinHttpCrackUrl( szUrl, 0, NULL, &urlComponents))
00040     {
00041         printf("\n\nThere was a problem with the URL given, \"%S\".", szUrl);
00042         fShowHelp = TRUE;
00043         goto done;
00044     }
00045
00046     szAllocHost = new WCHAR[urlComponents.dwHostNameLength+1];
00047     szAllocPath = new WCHAR[urlComponents.dwUrlPathLength+1];
00048
00049     if (szAllocHost == NULL
00050         || szAllocPath == NULL)
00051     {
00052         SetLastError(ERROR_OUTOFMEMORY);
00053         goto done;
00054     }
00055
00056     memcpy(szAllocHost, urlComponents.lpszHostName,
00057            urlComponents.dwHostNameLength*sizeof(WCHAR));
00058     szAllocHost[urlComponents.dwHostNameLength] = L'\0';
00059     memcpy(szAllocPath, urlComponents.lpszUrlPath,
00060            urlComponents.dwUrlPathLength*sizeof(WCHAR));
00061     szAllocPath[urlComponents.dwUrlPathLength] = L'\0';
00062
00063     if ((DWORD)-1 == GetFileAttributes(szFilename))
00064     {
00065         printf("\n\nThe specified file, \"%S\", does not exist.", szFilename);
00066         fShowHelp = TRUE;
00067         goto done;
00068     }
00069
00070     if (!WinHttpFormSubmitSample(
00071           szAllocHost, urlComponents.nPort, szAllocPath,
00072           (urlComponents.nScheme == INTERNET_SCHEME_HTTPS) ? TRUE : FALSE, szFilename))
00073     {
00074         goto done;
00075     }
00076
00077     SetLastError(NO_ERROR);
00078 done:
00079     if (GetLastError() != NO_ERROR)
00080     {
00081         DWORD dwLastError = GetLastError();
00082         printf("\n\nFormSubmit failed with error code %i", dwLastError);
00083         fShowHelp = TRUE;
00084     }
00085
00086     if (fShowHelp)
00087     {
00088         printf(
00089             "\n\n  Proper usage of this example is \"FormSubmit <url> <filename>\",\n"
00090             "Where <url> is a target HTTP URL and <filename> is the name of a file\n"
00091             "with the form submit contents.  Please see Section 8.2.1 \"Forms Submission\"\n"
00092             "of RFC 1866 (http://www.ietf.org/rfc/rfc1866.txt) for a description of valid\n"
00093             "form submit contents.");
00094     }
00095
00096     if (szAllocPath != NULL)
00097         delete [] szAllocPath;
00098
00099     if (szAllocHost != NULL)
00100         delete [] szAllocHost;
00101
00102     printf("\n\n");
00103     return 0;
00104 }
00105
00106
00107
00108 BOOL GetFileHandleAndSize(LPWSTR szFilename, OUT HANDLE* pHandle, OUT DWORD* pdwSize)
00109 {
00110     BOOL returnValue = FALSE;
00111     HANDLE hFile = INVALID_HANDLE_VALUE;
00112     LARGE_INTEGER liSize;
00113     liSize.LowPart = 0;
00114     liSize.HighPart = 0;
00115
00116     hFile = CreateFile(szFilename, GENERIC_READ, FILE_SHARE_READ, NULL,
00117                        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
00118
00119     if (hFile == INVALID_HANDLE_VALUE)
00120         goto done;
00121
00122     if (!GetFileSizeEx(hFile, &liSize))
00123         goto done;
00124
00125     if (liSize.HighPart != 0
00126         || liSize.LowPart > 0x7FFFFFFF)
00127     {
00128         //  Lets not try to send anything larger than 2 gigs
00129         SetLastError(ERROR_OPEN_FAILED);
00130     }
00131
00132     returnValue = TRUE;
00133 done:
00134
00135     if (returnValue)
00136     {
00137         *pHandle = hFile;
00138         *pdwSize = liSize.LowPart;
00139         return TRUE;
00140     }
00141     else
00142     {
00143         if (hFile != INVALID_HANDLE_VALUE)
00144             CloseHandle(hFile);
00145
00146         return FALSE;
00147     }
00148 }
00149
00150
00151 BOOL WinHttpFormSubmitSample( LPCWSTR szServer, INTERNET_PORT dwPort, LPWSTR szPath,
00152                               BOOL fUseSSL, LPWSTR szPostFilename)
00153 {
00154     DWORD dwStatusCode = 0;
00155     DWORD dwSize = sizeof(DWORD);
00156     DWORD dwTemp, dwTemp2;
00157     BOOL  bResults = FALSE;
00158     BOOL returnValue = FALSE;
00159
00160     HANDLE hFile = INVALID_HANDLE_VALUE;
00161     DWORD dwFileSize = 0;
00162     BYTE byteBuffer[2048];
00163
00164     HINTERNET  hSession = NULL,
00165                hConnect = NULL,
00166                hRequest = NULL;
00167
00168     static const WCHAR szContentType[] = L"Content-Type: application/x-www-form-urlencoded\r\n";
00169
00170
00171     // First make sure the file we want to send is available.
00172     if (!GetFileHandleAndSize(szPostFilename, &hFile, &dwFileSize))
00173         goto done;
00174
00175     // Use WinHttpOpen to obtain a session handle.
00176     hSession = WinHttpOpen( L"WinHttpFormSubmitSample",
00177                             WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
00178                             WINHTTP_NO_PROXY_NAME,
00179                             WINHTTP_NO_PROXY_BYPASS, 0);
00180     if (hSession == NULL)
00181         goto done;
00182
00183     // Specify an HTTP server.
00184     hConnect = WinHttpConnect( hSession, szServer, dwPort, 0);
00185     if (hConnect == NULL)
00186         goto done;
00187
00188     // Create an HTTP request handle.
00189     hRequest = WinHttpOpenRequest( hConnect, L"POST", szPath,
00190                NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES,
00191                fUseSSL ? WINHTTP_FLAG_SECURE : 0);
00192     if (hRequest == NULL)
00193         goto done;
00194
00195     //  Add the "Content-Type" header
00196
00197     if (!WinHttpAddRequestHeaders(hRequest, szContentType, (DWORD)-1,
00198                WINHTTP_ADDREQ_FLAG_ADD & WINHTTP_ADDREQ_FLAG_REPLACE))
00199         goto done;
00200
00201     bResults = WinHttpSendRequest( hRequest,
00202                                    WINHTTP_NO_ADDITIONAL_HEADERS, 0,
00203                                    NULL, 0, dwFileSize, 0);
00204     if (!bResults)
00205         goto done;
00206
00207     while (dwFileSize > 0)
00208     {
00209         if (!ReadFile(hFile, byteBuffer, sizeof(byteBuffer), &dwTemp, NULL))
00210             goto done;
00211
00212         if (dwTemp == 0)
00213         {
00214             dwFileSize = 0;
00215             continue;
00216         }
00217         else if (dwTemp > dwFileSize)
00218         {
00219             // unexpectedly found more data in the file than we though was there, bail out
00220             goto done;
00221         }
00222         else
00223         {
00224             dwFileSize -= dwTemp;  // update the amount of file left to send..
00225         }
00226
00227         if (!WinHttpWriteData( hRequest, byteBuffer, dwTemp, &dwTemp2)
00228             || dwTemp != dwTemp2)
00229         {
00230             goto done;
00231         }
00232     }
00233
00234     //  ensure the whole file was successfully sent
00235     if (dwFileSize != 0)
00236         goto done;
00237
00238     // End the request.
00239     bResults = WinHttpReceiveResponse( hRequest, NULL);
00240     if (!bResults)
00241         goto done;
00242
00243     // Check the status code.
00244     bResults = WinHttpQueryHeaders( hRequest,
00245                                     WINHTTP_QUERY_STATUS_CODE|
00246                                     WINHTTP_QUERY_FLAG_NUMBER, NULL,
00247                                     &dwStatusCode, &dwSize, NULL);
00248     if (!bResults)
00249         goto done;
00250
00251     if (bResults)
00252     {
00253         switch (dwStatusCode)
00254         {
00255         case 200:
00256             //  The resource was successfully retrieved.
00257             //  You could use WinHttpReadData to read the contents of the server's response.
00258             printf("\nSuccessfuly posted to %S.", szServer);
00259             break;
00260         default:
00261             //  The status code does not indicate success.
00262             printf("\nThe server responded with a status code of %i.", dwStatusCode);
00263             break;
00264         }
00265     }
00266
00267     returnValue = TRUE;
00268
00269 done:
00270     dwTemp = GetLastError();
00271
00272     // Close any open handles.
00273     if (hRequest)
00274         WinHttpCloseHandle(hRequest);
00275
00276     if (hConnect)
00277         WinHttpCloseHandle(hConnect);
00278
00279     if (hSession)
00280         WinHttpCloseHandle(hSession);
00281
00282     if (hFile != INVALID_HANDLE_VALUE)
00283         CloseHandle(hFile);
00284
00285     SetLastError(dwTemp);
00286     return returnValue;
00287 }
Generated on Wed Nov 13 2024 16:52:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMyWizExtApp Member List

This is the complete list of members for CMyWizExtApp, including all inherited members.
AppInitialize(HINSTANCE hInstance, HINSTANCE hPrevInstance, CHAR *pszCmdLine, INT nCmdShow) | CAppLite |
CAppLite(UINT nAppID) | CAppLite |
CWinApp() | CWinApp |
ExitInstance() | CMyWizExtApp | [virtual]
InitInstance() | CMyWizExtApp | [virtual]
m_hInstance | CAppLite |
m_hPrevInstance | CAppLite |
m_hWndModeless | CAppLite | [static]
m_nAppID | CAppLite |
m_nCmdShow | CAppLite |
m_pCMainWindow | CAppLite | [static]
m_pCMallocSpy | CWinApp |
m_pszCmdLine | CAppLite |
Run() | CAppLite | [virtual]
~CAppLite() | CAppLite | [virtual]
~CWinApp() | CWinApp | [virtual]
Generated on Wed Nov 13 2024 16:56:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

TABLEINFO Member List

This is the complete list of members for TABLEINFO, including all inherited members.
wszCatalogName | TABLEINFO
wszSchemaName | TABLEINFO
wszTableName | TABLEINFO
wszType | TABLEINFO
Generated on Wed Nov 13 2024 16:57:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Printer/Enumprt.c Source File

  • Multimedia
  • Gdi
  • Printer

Enumprt.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 /******************************************************************************\
00013 *
00014 *  PROGRAM:     ENUMPRT.C
00015 *
00016 *  PURPOSE:     Handles display of information returned by calls to
00017 *               EnumPrinters, EnumPrinterDrivers. Info formatted and
00018 *               displayed in a dialog box.
00019 *
00020 *
00021 *  FUNTIONS:    EnumPrintersDlgProc      - handles messages for dialog
00022 *               DisplayEnumPrintersInfo  - retrieves printer info
00023 *               SetEnumPrintersDlgFields - formats & displays printer info
00024 *               ComplexEnumPrintersLine  - formats bitfield printer info
00025 *               EnumPrinterDriversDlgProc- handles messages for dialog
00026 *               DisplayPrinterDriversInfo- retrieves, formats, & displays
00027 *                                            printer info
00028 *
00029 \******************************************************************************/
00030
00031 #include <windows.h>
00032 #include <string.h>
00033 #include <drivinit.h>
00034 #include <stdio.h>
00035 #include <winspool.h>
00036 #include "common.h"
00037 #include "enumprt.h"
00038 #include "resource.h"
00039
00040
00041 /******************************************************************************\
00042 *
00043 *  FUNCTION:    EnumPrintersDlgProc (standard dialog procedure INPUTS/RETURNS)
00044 *
00045 *  COMMENTS:    Processes messages for EnumPrinters dialog box
00046 *
00047 \******************************************************************************/
00048
00049 LRESULT CALLBACK EnumPrintersDlgProc (HWND   hwnd, UINT msg, WPARAM wParam,
00050                                       LPARAM lParam)
00051 {
00052   switch (msg)
00053   {
00054     case WM_INITDIALOG:
00055     {
00056       BOOL bReturn;
00057
00058       //
00059       // prompt user for EnumPrinters flags...
00060       //
00061
00062       if (DialogBox (GetModuleHandle (NULL), (LPCTSTR) "EnumPrtOpt",
00063                      NULL, (DLGPROC) EnumPrintersOptionsDlgProc))
00064       {
00065         //
00066         // shove all the enum printer info in the list box
00067         //
00068
00069         SetCursor (LoadCursor (NULL, IDC_WAIT));
00070         bReturn = DisplayEnumPrintersInfo (hwnd);
00071         SetCursor (LoadCursor (NULL, IDC_ARROW));
00072
00073         if (!bReturn)
00074
00075           EndDialog (hwnd, TRUE);
00076
00077         else
00078
00079           SetWindowText (hwnd, (LPCTSTR)"EnumPrinters");
00080       }
00081       else
00082
00083           EndDialog (hwnd, TRUE);
00084
00085       break;
00086     }
00087
00088     case WM_COMMAND:
00089
00090       switch (LOWORD (wParam))
00091       {
00092         case DID_OK:
00093
00094           EndDialog (hwnd, TRUE);
00095           break;
00096       }
00097       break;
00098   }
00099   return 0;
00100 }
00101
00102
00103
00104 /******************************************************************************\
00105 *
00106 *  FUNCTION:    EnumPrintersOptionsDlgProc (standard dlg proc INPUTS/RETURNS)
00107 *
00108 *  COMMENTS:    Processes messages for EnumPrtOpt dialog box
00109 *
00110 \******************************************************************************/
00111
00112 LRESULT CALLBACK EnumPrintersOptionsDlgProc (HWND   hwnd,   UINT msg,
00113                                              WPARAM wParam, LPARAM lParam)
00114 {
00115   switch (msg)
00116   {
00117     case WM_INITDIALOG:
00118
00119       gdwEnumFlags = 0;
00120       gszEnumName[0] = 0;
00121       break;
00122
00123     case WM_COMMAND:
00124
00125       switch (LOWORD (wParam))
00126       {
00127         case DID_OK:
00128
00129           if (gdwEnumFlags)
00130           {
00131             if (gdwEnumFlags & PRINTER_ENUM_NAME)
00132             {
00133               GetDlgItemText (hwnd, DID_EDITTEXT, (LPTSTR)gszEnumName,
00134                               BUFSIZE);
00135
00136 #ifdef FORCE_VALID_NAME
00137               if (!strlen (gszEnumName))
00138               {
00139                 MessageBox (hwnd,
00140                             (LPCTSTR) GetStringRes(IDS_ASKDOMSRVNM),
00141                             (LPCTSTR) "", MB_OK);
00142                 SetFocus (GetDlgItem (hwnd, DID_EDITTEXT));
00143                 break;
00144               }
00145 #endif
00146
00147             }
00148
00149             EndDialog (hwnd, TRUE);
00150           }
00151
00152           else
00153
00154             EndDialog (hwnd, FALSE);
00155
00156           break;
00157
00158         case DID_CANCEL:
00159
00160           EndDialog (hwnd, FALSE);
00161           break;
00162
00163         default:
00164
00165           if (HIWORD(wParam) == BN_CLICKED)
00166           {
00167             DWORD dwControlId = (DWORD) LOWORD (wParam);
00168
00169             if (gdwEnumFlags & dwControlId)
00170             {
00171               //
00172               // remove that flag, if PRINTER_ENUM_NAME disable edittext
00173               //
00174
00175               gdwEnumFlags &= ~dwControlId;
00176
00177               if (dwControlId & PRINTER_ENUM_NAME)
00178               {
00179                 SetDlgItemText (hwnd, DID_EDITTEXT, (LPCTSTR)"");
00180                 EnableWindow   (GetDlgItem (hwnd, DID_EDITTEXT), FALSE);
00181               }
00182             }
00183
00184             else
00185             {
00186               //
00187               // add that flag, if PRINTER_ENUM_NAME enable edittext
00188               //
00189
00190               gdwEnumFlags |= dwControlId;
00191
00192               if (dwControlId & PRINTER_ENUM_NAME)
00193
00194                 EnableWindow (GetDlgItem (hwnd, DID_EDITTEXT), TRUE);
00195             }
00196           }
00197           break;
00198       }
00199   }
00200   return 0;
00201 }
00202
00203
00204
00205 /******************************************************************************\
00206 *
00207 *  FUNCTION:    DisplayEnumPrintersInfo
00208 *
00209 *  INPUTS:      hwnd - handle of the EnumPrinters dialog box
00210 *
00211 *  RETURNS:     TRUE if successful,
00212 *               FALSE otherwise
00213 *
00214 \******************************************************************************/
00215
00216 BOOL DisplayEnumPrintersInfo (HWND hwnd)
00217 {
00218     DWORD  dwBytesNeeded;
00219     DWORD  dwPrtRet1, dwPrtRet2;
00220     DWORD  dwMaxPrt;
00221     LPTSTR lpName = gdwEnumFlags & PRINTER_ENUM_NAME ? gszEnumName : NULL;
00222
00223     LPPRINTER_INFO_1 pPrtInfo1 = NULL;
00224     LPPRINTER_INFO_2 pPrtInfo2 = NULL;
00225
00226     BOOL   bReturn = TRUE;
00227
00228     //
00229     // get byte count needed for buffer, alloc buffer, the enum the printers
00230     //
00231     EnumPrinters (gdwEnumFlags,   // types of printer objects to enumerate
00232                   lpName,         // name of printer object
00233                   1,              // specifies type of printer info structure
00234                   NULL,           // use NULL to get buffer size
00235                   0,              // size, in bytes, of array
00236                   &dwBytesNeeded, // pointer to variable with no. of bytes
00237                                   // copied (or required)
00238                   &dwPrtRet1);    // pointer to variable with no. of printer
00239                                   // info. structures copied
00240     //
00241     // (simple error checking, if these work assume rest will too)
00242     //
00243
00244     // Allocate enough room for the returned data
00245     if (!(pPrtInfo1 = (LPPRINTER_INFO_1) LocalAlloc (LPTR, dwBytesNeeded)))
00246     {
00247         ErrMsgBox (GetStringRes(IDS_ENUMPRTLALLOCFAIL), GetStringRes2(ERR_MOD_NAME));
00248
00249         return FALSE;  // Bail
00250     }
00251
00252     if (!EnumPrinters(gdwEnumFlags,      // types of printer objects to enumerate
00253                       lpName,            // name of printer object
00254                       1,                 // specifies type of printer info structure
00255                       (LPBYTE)pPrtInfo1, // pointer to buffer to receive printer info
00256                                          // structures
00257                       dwBytesNeeded,     // size, in bytes, of array
00258                       &dwBytesNeeded,    // pointer to variable with no. of bytes
00259                                          // copied (or required)
00260                       &dwPrtRet1))       // pointer to variable with no. of printer
00261                                          // info. structures copied
00262     {
00263         TCHAR  tcBuffer[256];
00264
00265         // Create and display our error message
00266         wsprintf (tcBuffer, "%s, 1, GetLastError: %d", GetStringRes2(ERR_MOD_NAME), GetLastError());
00267         ErrMsgBox (GetStringRes(IDS_ENUMPRT1FAIL), tcBuffer);
00268
00269         // Free the buffer we allocated
00270         LocalFree(pPrtInfo1);
00271
00272         return FALSE;  // Bail
00273     }
00274
00275     //
00276     // If we don't get any printers from the Level == 1 call, there is
00277     //  no point in continuing... report it, free memory, and return.
00278     //
00279     if (dwPrtRet1 == 0) {
00280
00281         MessageBox (ghwndMain,
00282             (LPCTSTR) "EnumPrinters (Level == 1) returned 0 printers",
00283             GetStringRes2(ERR_MOD_NAME),
00284             MB_OK);
00285
00286         // Free the buffer we allocated
00287         LocalFree(pPrtInfo1);
00288
00289         return FALSE;  // Bail
00290     }
00291
00292
00293     //
00294     // Call EnumPrinters again, this time with Level == 2.
00295     //
00296     // get byte count needed for buffer, alloc buffer, the enum the printers
00297     //
00298     EnumPrinters (gdwEnumFlags,     // types of printer objects to enumerate
00299                   lpName,           // name of printer object
00300                   2,                // specifies type of printer info structure
00301                   NULL,             // use NULL to get buffer size
00302                   0,                // size, in bytes, of array
00303                   &dwBytesNeeded,   // pointer to variable with no. of bytes
00304                                     // copied (or required)
00305                   &dwPrtRet2);      // pointer to variable with no. of printer
00306                                     // info. structures copied
00307
00308     // Allocate enough room for the returned data
00309     if (!(pPrtInfo2 = (LPPRINTER_INFO_2) LocalAlloc (LPTR, dwBytesNeeded))) {
00310         ErrMsgBox (GetStringRes(IDS_ENUMPRTLALLOCFAIL), GetStringRes2(ERR_MOD_NAME));
00311     } else {
00312
00313     if (!EnumPrinters (gdwEnumFlags,      // types of printer objects to enumerate
00314                lpName,            // name of printer object
00315                2,                 // specifies type of printer info structure
00316                (LPBYTE)pPrtInfo2, // pointer to buffer to receive printer info
00317                         // structures
00318                dwBytesNeeded,     // size, in bytes, of array
00319                &dwBytesNeeded,    // pointer to variable with no. of bytes
00320                         // copied (or required)
00321                &dwPrtRet2))       // pointer to variable with no. of printer
00322                         // info. structures copied
00323         dwPrtRet2 = 0;
00324     }
00325
00326     //
00327     //  Calling EnumPrinters with Level == 2 frequently returns 0 printers.
00328     //  If so display only the PRINTER_INFO_1 structures we got before.
00329     //
00330
00331     if (dwPrtRet2 == 0)
00332     {
00333         dwMaxPrt = dwPrtRet1;
00334         LocalFree (pPrtInfo2);
00335         pPrtInfo2 = NULL;
00336     } else {
00337         dwMaxPrt = dwPrtRet1 > dwPrtRet2 ? dwPrtRet2 : dwPrtRet1;
00338     }
00339
00340
00341     SetEnumPrintersDlgFields (hwnd, dwMaxPrt, pPrtInfo1, pPrtInfo2);
00342
00343     if (pPrtInfo2)
00344         LocalFree (pPrtInfo2);
00345
00346   if (pPrtInfo1)
00347         LocalFree (pPrtInfo1);
00348
00349     return TRUE;
00350 }
00351
00352
00353 /******************************************************************************\
00354 *
00355 *  FUNCTION:    SetEnumPrintersDlgFields
00356 *
00357 *  INPUTS:      hwnd      - handle of the EnumPrinters dialog box
00358 *               dwMaxPrt  - number of elements in the following two arrays
00359 *               pdisplay_prts_info1 - ptr to an array of PRINTER_INFO_1 structs
00360 *               pdisplay_prts_info2 - ptr to an array of PRINTER_INFO_2 structs
00361 *
00362 *  COMMENTS:    This function formats the info returned by EnumPrinters()
00363 *               into readable strings and inserts them in the listbox.
00364 *
00365 \******************************************************************************/
00366
00367 void SetEnumPrintersDlgFields (HWND hwnd, DWORD dwMaxPrt,
00368                                LPPRINTER_INFO_1 pPrtInfo1,
00369                                LPPRINTER_INFO_2 pPrtInfo2)
00370 {
00371   char  buf[256];
00372   WORD  i;
00373   DWORD j;
00374
00375   SendDlgItemMessage (hwnd, DID_LISTBOX, LB_RESETCONTENT, 0, 0);
00376   SendDlgItemMessage (hwnd, DID_LISTBOX, WM_SETFONT, (WPARAM)GetStockObject(ANSI_FIXED_FONT), (LPARAM)0);
00377
00378   for (j = 0; j < dwMaxPrt; j++) {
00379     //
00380     // Stick PRINTER_INFO_1  data in listbox
00381     //
00382
00383     SendDlgItemMessage (hwnd, DID_LISTBOX, LB_INSERTSTRING, (UINT)-1,
00384       (LONG_PTR) gaEnumPrt[0]);
00385
00386     outstr (gaEnumPrt[1], (pPrtInfo1 + j)->pDescription);
00387     outstr (gaEnumPrt[2], (pPrtInfo1 + j)->pName);
00388     outstr (gaEnumPrt[3], (pPrtInfo1 + j)->pComment);
00389
00390     //
00391     // Stick PRINTER_INFO_2  data in listbox
00392     //
00393
00394     if (pPrtInfo2 != NULL) {
00395
00396       SendDlgItemMessage (hwnd, DID_LISTBOX, LB_INSERTSTRING, (UINT)-1,
00397                 (LONG_PTR) gaEnumPrt[4]);
00398
00399       outstr (gaEnumPrt[5],  (pPrtInfo2 + j)->pServerName);
00400       outstr (gaEnumPrt[6],  (pPrtInfo2 + j)->pPrinterName);
00401       outstr (gaEnumPrt[7],  (pPrtInfo2 + j)->pShareName);
00402       outstr (gaEnumPrt[8],  (pPrtInfo2 + j)->pPortName);
00403       outstr (gaEnumPrt[9],  (pPrtInfo2 + j)->pDriverName);
00404       outstr (gaEnumPrt[10], (pPrtInfo2 + j)->pComment);
00405       outstr (gaEnumPrt[11], (pPrtInfo2 + j)->pLocation);
00406
00407       if ((pPrtInfo2 + j)->pDevMode)
00408       {
00409         DWORD dwFields;
00410
00411         outstr (gaEnumPrt[12], "");
00412         outstr (gaEnumPrt[13], (pPrtInfo2 + j)->pDevMode->dmDeviceName);
00413         outnum (gaEnumPrt[14], (pPrtInfo2 + j)->pDevMode->dmSpecVersion);
00414         outnum (gaEnumPrt[15], (pPrtInfo2 + j)->pDevMode->dmDriverVersion);
00415         outnum (gaEnumPrt[16], (pPrtInfo2 + j)->pDevMode->dmSize);
00416         outnum (gaEnumPrt[17], (pPrtInfo2 + j)->pDevMode->dmDriverExtra);
00417
00418         dwFields = (pPrtInfo2 + j)->pDevMode->dmFields;
00419         ComplexEnumPrintersLine (hwnd, gaEnumPrt[18], gaFields,
00420                      MAX_FIELDS,
00421                      dwFields);
00422
00423         if (dwFields & DM_ORIENTATION) {
00424           ComplexEnumPrintersLine (hwnd, gaEnumPrt[19], gaOrientation,
00425                        MAX_ORIENTATION,
00426                        (DWORD)(pPrtInfo2 + j)->pDevMode->dmOrientation);
00427         }
00428
00429         if (dwFields & DM_PAPERSIZE) {
00430           ComplexEnumPrintersLine (hwnd, gaEnumPrt[20], gaPaperSize,
00431                        MAX_PAPERSIZE,
00432                        (DWORD)(pPrtInfo2 + j)->pDevMode->dmPaperSize);
00433         }
00434
00435         if (dwFields & DM_PAPERLENGTH)
00436           outnum (gaEnumPrt[21], (pPrtInfo2 + j)->pDevMode->dmPaperLength);
00437
00438         if (dwFields & DM_PAPERWIDTH)
00439           outnum (gaEnumPrt[22], (pPrtInfo2 + j)->pDevMode->dmPaperWidth);
00440
00441         if (dwFields & DM_SCALE)
00442           outnum (gaEnumPrt[23], (pPrtInfo2 + j)->pDevMode->dmScale);
00443
00444         if (dwFields & DM_COPIES)
00445           outnum (gaEnumPrt[24], (pPrtInfo2 + j)->pDevMode->dmCopies);
00446
00447         if (dwFields & DM_DEFAULTSOURCE) {
00448           ComplexEnumPrintersLine (hwnd, gaEnumPrt[25], gaDefaultSource,
00449                        MAX_DEFAULTSOURCE,
00450                        (DWORD)(pPrtInfo2 + j)->pDevMode->dmDefaultSource);
00451         }
00452
00453         if (dwFields & DM_PRINTQUALITY) {
00454           ComplexEnumPrintersLine (hwnd, gaEnumPrt[26], gaPrintQuality,
00455                        MAX_PRINTQUALITY,
00456                        (DWORD)(pPrtInfo2 + j)->pDevMode->dmPrintQuality);
00457         }
00458
00459         if (dwFields & DM_COLOR) {
00460           ComplexEnumPrintersLine (hwnd, gaEnumPrt[27], gaColor,
00461                        MAX_COLOR,
00462                        (DWORD)(pPrtInfo2 + j)->pDevMode->dmColor);
00463         }
00464
00465         if (dwFields & DM_DUPLEX) {
00466           ComplexEnumPrintersLine (hwnd, gaEnumPrt[28], gaDuplex,
00467                        MAX_DUPLEX,
00468                        (DWORD)(pPrtInfo2 + j)->pDevMode->dmDuplex);
00469         }
00470
00471         if (dwFields & DM_YRESOLUTION)
00472           outnum (gaEnumPrt[29], (DWORD)(pPrtInfo2 + j)->pDevMode->dmYResolution);
00473
00474         if (dwFields & DM_TTOPTION)
00475           outnum (gaEnumPrt[30], (DWORD)(pPrtInfo2 + j)->pDevMode->dmTTOption);
00476
00477         if (dwFields & DM_COLLATE)
00478           outnum (gaEnumPrt[31], (DWORD)(pPrtInfo2 + j)->pDevMode->dmCollate);
00479
00480         if (dwFields & DM_FORMNAME)
00481           outstr (gaEnumPrt[32], (pPrtInfo2 + j)->pDevMode->dmFormName);
00482       }
00483       else
00484       {
00485         outstr (gaEnumPrt[12], NULL);
00486       }
00487
00488       outstr (gaEnumPrt[33], (pPrtInfo2 + j)->pSepFile);
00489       outstr (gaEnumPrt[34], (pPrtInfo2 + j)->pPrintProcessor);
00490       outstr (gaEnumPrt[35], (pPrtInfo2 + j)->pDatatype);
00491       outstr (gaEnumPrt[36], (pPrtInfo2 + j)->pParameters);
00492
00493       ComplexEnumPrintersLine (hwnd, gaEnumPrt[37], gaAttributes,
00494                    MAX_ATTRIBUTES,
00495                    (DWORD)(pPrtInfo2 + j)->Attributes);
00496
00497       for (i = 0; i < MAX_PRIORITIES; i++) {
00498         if ((pPrtInfo2 + j)->Priority & gaPriorities[i].dwValue) {
00499           outstr (gaEnumPrt[38], gaPriorities[i].szValue);
00500           break;
00501         }
00502       }
00503
00504       if (i == MAX_PRIORITIES) {
00505         outnum (gaEnumPrt[39], (pPrtInfo2 + j)->Priority);
00506       }
00507
00508       outnum (gaEnumPrt[40], (pPrtInfo2 + j)->DefaultPriority);
00509       outnum (gaEnumPrt[41], (pPrtInfo2 + j)->StartTime);
00510       outnum (gaEnumPrt[42], (pPrtInfo2 + j)->UntilTime);
00511
00512       ComplexEnumPrintersLine (hwnd, gaEnumPrt[43], gaStatus,
00513                    MAX_STATUS,
00514                    (DWORD)(pPrtInfo2 + j)->Status);
00515
00516       outnum (gaEnumPrt[44], (pPrtInfo2 + j)->cJobs);
00517       outnum (gaEnumPrt[45], (pPrtInfo2 + j)->AveragePPM);
00518         }
00519     }
00520 }
00521
00522
00523
00524 /******************************************************************************\
00525 *
00526 *  FUNCTION:    ComplexEnumPrintersLine
00527 *
00528 *  INPUTS:      hwnd        - handle of the EnumPrinters dialog box
00529 *               pbuf        - pointer to buffer containing a cap-type
00530 *                              string
00531 *               pLkUp       - pointer to a CAPSLOOKUP table
00532 *               iMaxEntries - # of enries in table pointed at by pLkUp
00533 *               iValue      - an integer containing 1+ bit-value flags.
00534 *
00535 *  COMMENTS:    This function is used to expand an int containing
00536 *               multiple bit-values into a set of strings which are
00537 *               inserted into the DevCapsDlg listbox. The iValue
00538 *               parameter is checked against each iIndex entry in the
00539 *               CAPSLOOKUP table pointed at by pLkUp, and when matches
00540 *               are found the corresponding (lpszValue) string is
00541 *               inserted.
00542 *
00543 *               The buffer pointed to by pbuf will be destroyed.
00544 *
00545 \******************************************************************************/
00546
00547 void ComplexEnumPrintersLine (HWND hwnd, char  *pstr, ENUMPRTLOOKUP *pLkUp,
00548                               int iMaxEntries, DWORD  dwValue)
00549 {
00550   char buf [BUFSIZE];
00551   int  i;
00552   BOOL bNewLine = FALSE;
00553
00554   lstrcpyn  (buf, pstr, BUFSIZE);
00555
00556   for (i = 0; i < iMaxEntries; i++)
00557
00558     if (dwValue & (pLkUp + i)->dwValue)
00559     {
00560       if (bNewLine)
00561       {
00562         //
00563         // Keep the first symbolic constant on the same line as the
00564         //   cap type, eg:  "TECHNOLOGY:     DT_RASDISPLAY".
00565         //
00566         lstrcpyn (buf, BLANKS, BUFSIZE);
00567         strncat (buf, (pLkUp + i)->szValue, BUFSIZE - strlen(buf));
00568       }
00569       else
00570       {
00571         //
00572         // Put symbolic constant on new line, eg:
00573         //                  "                DT_RASPRINTER".
00574         //
00575     strncat (buf, (pLkUp + i)->szValue, BUFSIZE - strlen(buf));
00576         bNewLine = TRUE;
00577       }
00578       SendDlgItemMessage (hwnd, DID_LISTBOX, LB_INSERTSTRING,
00579                           (UINT)-1, (LONG_PTR) buf);
00580    }
00581 }
00582
00583
00584
00585 /******************************************************************************\
00586 *
00587 *  FUNCTION:    EnumPrinterDriversDlgProc (standard dlg proc INPUTS/RETURNS)
00588 *
00589 *  COMMENTS:    Processes messages for EnumPrinterDrivers dialog box
00590 *
00591 \******************************************************************************/
00592
00593 LRESULT CALLBACK EnumPrinterDriversDlgProc (HWND   hwnd,   UINT   msg,
00594                                             WPARAM wParam, LPARAM lParam)
00595 {
00596   switch (msg)
00597   {
00598     case WM_INITDIALOG:
00599     {
00600       BOOL bReturn;
00601
00602       SetCursor (LoadCursor (NULL, IDC_WAIT));
00603       bReturn = DisplayPrinterDriversInfo (hwnd);
00604       SetCursor (LoadCursor (NULL, IDC_ARROW));
00605
00606       if (!bReturn)
00607
00608         EndDialog (hwnd, TRUE);
00609
00610       else
00611
00612         SetWindowText (hwnd, (LPCTSTR) "EnumPrinterDrivers");
00613
00614       break;
00615     }
00616
00617     case WM_COMMAND:
00618
00619       switch (LOWORD (wParam))
00620       {
00621         case DID_OK:
00622
00623           EndDialog (hwnd, TRUE);
00624
00625           return 1;
00626       }
00627       break;
00628   }
00629   return 0;
00630 }
00631
00632
00633
00634 /******************************************************************************\
00635 *
00636 *  FUNCTION:    DisplayPrinterDriversInfo
00637 *
00638 *  INPUTS:      hwnd - handle of the EnumPrinterDrivers dialog box
00639 *
00640 *  RETURNS:     TRUE if successful,
00641 *               FALSE otherwise
00642 *
00643 *  COMMENTS:    Retrieves EnumPrinterDrivers info, formats, & inserts
00644 *               in listbox.
00645 *
00646 \******************************************************************************/
00647
00648 BOOL DisplayPrinterDriversInfo (HWND hwnd)
00649 {
00650   DWORD         dwBytesNeeded, dwDrvRet, i;
00651   DRIVER_INFO_1 *pDriverInfo1;
00652   DRIVER_INFO_2 *pDriverInfo2;
00653   char          buf[BUFSIZE];
00654   BOOL          bReturn = TRUE;
00655
00656   //
00657   // get byte count needed for buffer, alloc buffer, the enum the drivers
00658   //
00659
00660   EnumPrinterDrivers ((LPTSTR) NULL, (LPTSTR) NULL, 1, NULL,
00661                       0, &dwBytesNeeded, &dwDrvRet);
00662
00663   //
00664   // simple error checking, if these work assume rest will too
00665   //
00666
00667   if (!(pDriverInfo1 = (DRIVER_INFO_1 *) LocalAlloc (LPTR, dwBytesNeeded)))
00668   {
00669     ErrMsgBox (GetStringRes(IDS_LALLOCFAIL), GetStringRes2(ERR_MOD_NAME));
00670     bReturn = FALSE;
00671     goto display_prt_drvs_info_done1;
00672   }
00673
00674   if (!EnumPrinterDrivers ((LPTSTR) NULL, (LPTSTR) NULL, 1,
00675                            (LPBYTE) pDriverInfo1, dwBytesNeeded, &dwBytesNeeded,
00676                            &dwDrvRet))
00677   {
00678     ErrMsgBox (GetStringRes(IDS_ENUMPRTDRVRET0), GetStringRes2(ERR_MOD_NAME));
00679     bReturn = FALSE;
00680     goto display_prt_drvs_info_done2;
00681   }
00682
00683   EnumPrinterDrivers ((LPTSTR) NULL,(LPTSTR) NULL, 2, NULL,
00684                       0, &dwBytesNeeded, &dwDrvRet);
00685
00686   pDriverInfo2 = (DRIVER_INFO_2 *) LocalAlloc (LPTR, dwBytesNeeded);
00687
00688   EnumPrinterDrivers ((LPTSTR) NULL, (LPTSTR) NULL, 2,
00689                       (LPBYTE) pDriverInfo2, dwBytesNeeded, &dwBytesNeeded,
00690                       &dwDrvRet);
00691
00692   if (!dwDrvRet)
00693   {
00694     ErrMsgBox (GetStringRes(IDS_ENUMPRTDRVRET0), "");
00695     bReturn = FALSE;
00696     goto display_prt_drvs_info_done3;
00697   }
00698
00699   //
00700   // insert formatted info into listbox
00701   //
00702
00703   for (i = 0; i < dwDrvRet; i++)
00704   {
00705     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[0]) > 0 )
00706     outstr3();
00707
00708     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[1], (pDriverInfo1 + i)->pName) > 0)
00709     outstr3();
00710
00711     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[2]) > 0 )
00712     outstr3();
00713
00714     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[3], (pDriverInfo2 + i)->cVersion) > 0 )
00715     outstr3();
00716
00717     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[4], (pDriverInfo2 + i)->pName) > 0 )
00718     outstr3();
00719
00720     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[5], (pDriverInfo2 + i)->pEnvironment) > 0 )
00721     outstr3();
00722
00723     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[6], (pDriverInfo2 + i)->pDriverPath) > 0 )
00724     outstr3();
00725
00726     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[7], (pDriverInfo2 + i)->pDataFile) > 0 )
00727     outstr3();
00728
00729     if ( _snprintf (buf, BUFSIZE - 1, gaDriverInfo[8], (pDriverInfo2 + i)->pConfigFile) > 0 )
00730     outstr3();
00731
00732   }
00733
00734 display_prt_drvs_info_done3:
00735
00736   LocalFree (LocalHandle (pDriverInfo2));
00737
00738 display_prt_drvs_info_done2:
00739
00740   LocalFree (LocalHandle (pDriverInfo1));
00741
00742 display_prt_drvs_info_done1:
00743
00744   return bReturn;
00745 }
00746
Generated on Wed Nov 13 2024 16:52:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/rtc/Client/CPP/RTCIncoming/Utils.cpp Source File

  • NetDS
  • rtc
  • Client
  • CPP
  • RTCIncoming

Utils.cpp

Go to the documentation of this file.
00001
00002 /******************************************************>
00003  * Copyright (c) 2001 Microsoft Corporation.
00004  * All rights reserved.
00005  *
00006  *
00007  * @Abstract: Utils.cpp
00008  * ---------- [ Source Definition File]
00009  *
00010  * @Description:
00011  * -------------
00012  * Utilities for logging Error Messages in the debugger
00013  * or in a Popup message box
00014  *
00015  *
00016  *
00017  ******************************************************/
00018
00019 #include "Stdafx.h"
00020 #include "Utils.h"
00021
00022 /**********************************************************
00023 //@DBLOGGER
00024 //
00025 //@Description
00026 //
00027 //  Spews text output to the debugger
00028 //
00029 //@Args In:
00030 //
00031 //  LPCTSTR str   -> Formatted String
00032 //
00033 //
00034 //@Args Out:    None
00035 //
00036 //
00037 //*********************************************************/
00038 extern "C" int DBLOGGER(TCHAR *str, ...)
00039 {
00040
00041 #ifdef _DEBUG
00042
00043   _ASSERTE( str != NULL);
00044
00045   TCHAR buffer[512] = {_T('\0')};
00046
00047   va_list v;
00048   va_start(v,str);
00049   _vsntprintf(buffer,511,str,v);
00050   ::OutputDebugString(buffer);
00051
00052   va_end(v);
00053 #endif
00054
00055   return 1;
00056 }
00057
00058
00059 /**********************************************************
00060 //@LOGMSGERROR
00061 //
00062 //@Description
00063 //
00064 //  Reports an Error in a Message Box
00065 //
00066 //@Args In:
00067 //
00068 //  LPCTSTR str   ->  String
00069 //
00070 //
00071 //@Args Out:    None
00072 //
00073 //
00074 //*********************************************************/
00075 extern "C" void LOGMSGERROR(TCHAR *str, ...)
00076 {
00077
00078   _ASSERT(NULL != str);
00079
00080   TCHAR buffer[512] = {_T('\0')};
00081
00082   va_list v;
00083   va_start(v,str);
00084   _vsntprintf(buffer,511,str,v);
00085
00086   MessageBox(NULL, buffer, _T("RTCIn Error"), MB_OK);
00087
00088   va_end(v);
00089 }
Generated on Wed Nov 13 2024 16:51:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/Msp/SampleMSP/SampAddr.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • Msp
  • SampleMSP

SampAddr.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999 - 2000 Microsoft Corporation
00004
00005 Module Name:
00006
00007     sampaddr.h
00008
00009 Abstract:
00010
00011     Declaration of the CSampleMSP
00012 --*/
00013
00014 #ifndef __SAMPADDR_H_
00015 #define __SAMPADDR_H_
00016
00017 #if _MSC_VER >= 1000
00018 #pragma once
00019 #endif // _MSC_VER >= 1000
00020
00021 #include "resource.h"
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // CSampleMSP
00025 /////////////////////////////////////////////////////////////////////////////
00026 class CSampleMSP :
00027     public CMSPAddress,
00028     public CComCoClass<CSampleMSP, &CLSID_SampleMSP>
00029     //  if you want to allow your object to be used in scripting apps
00030     //  it has to expose IObjectSafety interface. if your object is safe for
00031     //  scripting on all of its interfaces, you can use the implementation
00032     //  of IObjectSafety from MSPUtils.h
00033     //, public CMSPObjectSafetyImpl
00034 {
00035 public:
00036     CSampleMSP();
00037     virtual ~CSampleMSP();
00038
00039     virtual ULONG MSPAddressAddRef(void);
00040     virtual ULONG MSPAddressRelease(void);
00041
00042 DECLARE_REGISTRY_RESOURCEID(IDR_SampleMSP)
00043 DECLARE_POLY_AGGREGATABLE(CSampleMSP)
00044
00045 // To add extra interfaces to this class, use the following:
00046 // BEGIN_COM_MAP(CSampleMSP)
00047 //     COM_INTERFACE_ENTRY( YOUR_INTERFACE_HERE )
00048 //     // if you want to allow your object to be used in scripting apps
00049 //     // it has to expose IObjectSafety interface
00050 //     // COM_INTERFACE_ENTRY( IObjectSafety )
00051 //     COM_INTERFACE_ENTRY_CHAIN(CMSPAddress)
00052 // END_COM_MAP()
00053
00054 public:
00055     STDMETHOD (CreateMSPCall) (
00056         IN      MSP_HANDLE     htCall,
00057         IN      DWORD          dwReserved,
00058         IN      DWORD          dwMediaType,
00059         IN      IUnknown    *  pOuterUnknown,
00060         OUT     IUnknown   **  ppMSPCall
00061         );
00062
00063     STDMETHOD (ShutdownMSPCall) (
00064         IN      IUnknown *          pMSPCall
00065         );
00066
00067 protected:
00068
00069     DWORD GetCallMediaTypes(void);
00070 };
00071
00072 #endif //__SAMPADDR_H_
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > Member List

This is the complete list of members for CMap< KEY, ARG_KEY, VALUE, ARG_VALUE >, including all inherited members.
AssocFromPos(POSITION) | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > | [protected]
CMap() | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
GetCount() | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
GetNextAssoc(POSITION &rNextPosition, KEY &rKey, VALUE &rValue) | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
GetPosition(ARG_KEY key) | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > | [protected]
GetStartPosition() | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
IsEmpty() | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
Lookup(ARG_KEY key, VALUE &rValue) | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
m_listValues | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > | [protected]
RemoveAll() | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
RemoveKey(ARG_KEY key) | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
SetAt(ARG_KEY key, ARG_VALUE newValue) | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > |
~CMap() | CMap< KEY, ARG_KEY, VALUE, ARG_VALUE > | [virtual]
Generated on Wed Nov 13 2024 16:56:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/ConClien/SINK.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • ConClien

SINK.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      SINK.H
00003
00004   Summary:   Include file for the COBallSink COM object class.
00005
00006              COBallSink offers a main IUnknown interface and the IBallSink
00007              interface (outgoing connection events from moving COBall
00008              objects). This multiple interface COM Object Class is
00009              achieved via the technique of nested classes.  The
00010              implementation of the IBallSink interface is nested inside of
00011              the COBallSink Class.
00012
00013              For a comprehensive tutorial code tour of this module's
00014              contents and offerings see the tutorial CONCLIEN.HTM file.
00015              For more specific technical details on the internal workings
00016              see the comments dispersed throughout the module's source code.
00017
00018   Functions:
00019
00020   Classes:   COBallSink.
00021
00022   Origin:    6-3-96: atrent - Editor-inheritance from BALL.H in the
00023              CONSERVE Tutorial Code Sample.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 #if !defined(SINK_H)
00041 #define SINK_H
00042
00043 #ifdef __cplusplus
00044
00045
00046 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00047   ObjectClass: COBallSink
00048
00049   Summary:     The main Sink COM object class for COBallSink COM objects.
00050                COM objects of this class offer the IBallSink sink
00051                interface supporting various ball bounce events. The
00052                mulitple interfaces on this COM object are constructed via
00053                the nested interface classes technique.
00054
00055   Interfaces:  IUnknown
00056                  Standard interface providing COM object features.
00057                IBallSink
00058                  Sink interface for Ball events.
00059
00060   Aggregation: Yes, COBall COM Objects are aggregatable by passing
00061                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00062 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00063 class COBallSink : public IUnknown
00064 {
00065   public:
00066     // Main Object Constructor & Destructor.
00067     COBallSink(IUnknown* pUnkOuter, CGuiBall* pGuiBall);
00068     ~COBallSink(void);
00069
00070     // IUnknown methods. Main object, non-delegating.
00071     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00072     STDMETHODIMP_(ULONG) AddRef(void);
00073     STDMETHODIMP_(ULONG) Release(void);
00074
00075   private:
00076     // We declare nested class interface implementations here.
00077
00078     class CImpIBallSink : public IBallSink
00079     {
00080       public:
00081         // Interface Implementation Constructor & Destructor.
00082         CImpIBallSink(COBallSink* pBackObj, IUnknown* pUnkOuter);
00083         ~CImpIBallSink(void);
00084
00085         // IUnknown methods.
00086         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00087         STDMETHODIMP_(ULONG) AddRef(void);
00088         STDMETHODIMP_(ULONG) Release(void);
00089
00090         // IBallSink methods.
00091         STDMETHODIMP         BounceBottom(void);
00092         STDMETHODIMP         BounceLeft(void);
00093         STDMETHODIMP         BounceRight(void);
00094         STDMETHODIMP         BounceTop(void);
00095
00096       private:
00097         // Data private to this interface implementation of IBallSink.
00098         COBallSink*  m_pBackObj;     // Parent Object back pointer.
00099         IUnknown*    m_pUnkOuter;    // Outer unknown for Delegation.
00100     };
00101
00102     // Make the otherwise private and nested IBallSink interface
00103     // implementation a friend to COM object instantiations of this
00104     // COBallSink COM object class.
00105     friend CImpIBallSink;
00106
00107     // Private data of COBallSink COM objects.
00108
00109     // Nested IBallSink implementation instantiation.  This IBallSink
00110     // interface is instantiated inside this COBallSink object as a
00111     // native interface.
00112     CImpIBallSink    m_ImpIBallSink;
00113
00114     // Main Object reference count.
00115     ULONG            m_cRefs;
00116
00117     // Outer unknown (aggregation delegation). Used when this COM object
00118     // is being aggregated.
00119     IUnknown*        m_pUnkOuter;
00120
00121     // Pointer to the main object that can service the Sink events.
00122     CGuiBall*        m_pGuiBall;
00123 };
00124
00125 typedef COBallSink* PCOBallSink;
00126
00127 #endif // __cplusplus
00128
00129
00130 #endif // SINK_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/GQos/QosEvent/GetQos.Cpp Source File

  • NetDS
  • GQos
  • QosEvent

GetQos.Cpp

Go to the documentation of this file.
00001 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00002 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00003 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00004 // PARTICULAR PURPOSE.
00005 //
00006 // Copyright (C) 1998 - 2000  Microsoft Corporation.  All Rights Reserved.
00007 //
00008 // Module:
00009 //      getqos.cpp
00010 //
00011 // Abstract:
00012 //      This file contains the functionality needed to retrieve a
00013 //      QOS structure.
00014 //
00015 // Entry Points:
00016 //      GetQos
00017 //
00018 // Author:
00019 //      Barry R. Butterklee
00020
00021 #include "qosevent.h"
00022
00023
00024
00025 // Abstract
00026 //      Use WSAIoctl(SIO_GET_QOS) to retrieve a QOS structure queued up in the
00027 //      QOSSP.  We potentially call WSAIoctl twice, the first time to retrieve
00028 //      the size of the entire QOS buffer we need to allocate in order to
00029 //      hold all the supplied QOS, RSVP, and POLICY objects.  Only Win2k and above
00030 //      currently supports querying the QOSSP for the needed buffer size, on Win98
00031 //      we  must supply a "large" buffer or risk not being able to retrieve all the
00032 //      objects.
00033 //
00034 BOOL GetQos(
00035     SOCKET  sd,
00036     BOOL    bQueryBufferSize,
00037     QOS     **pQos
00038     )
00039 {
00040     DWORD   dwBytesReturned=0;
00041     DWORD   status;
00042     DWORD   dwBufferLen;
00043     CHAR    *pBuf;
00044     QOS     *pTempQos;
00045
00046     // Figure out what size buffer we need.
00047     if (!bQueryBufferSize)
00048         dwBufferLen = 2048; //win98 platform
00049     else
00050     {
00051         // Try to get it dynamically.
00052         dwBufferLen = 0;
00053         status = WSAIoctl(sd, SIO_GET_QOS, NULL, 0,
00054                       &dwBufferLen, sizeof(dwBufferLen),
00055                       &dwBytesReturned, NULL, NULL);
00056
00057         // we have an error, anything except
00058         if (SOCKET_ERROR == status)
00059         {
00060             DWORD dwErr = WSAGetLastError();
00061
00062             if (WSAEWOULDBLOCK == dwErr)
00063                 return(FALSE);  // nothing to do
00064
00065             if (WSAENOBUFS != dwErr)
00066             {
00067                 // some sort of error not related to passing a large enough buffer
00068                 printf("GetQos: WSAIoctl(SIO_GET_QOS) - query: %d\n", dwErr);
00069                 return(FALSE);
00070             }
00071         }
00072     }
00073
00074     // for Windows 98 dwBufferLen has been set statically, for Windows 2000 we queried the OS
00075     // for the proper buffer size
00076     printf("GetQos: dwBufferlen for pQos = %d\n", dwBufferLen);
00077     pBuf = (CHAR *)malloc(dwBufferLen);
00078     if (!pBuf)
00079     {
00080         printf("GetQos: malloc: %d\n", GetLastError());
00081         return(FALSE);
00082     }
00083
00084     // Windows 98 workaround - not needed for Win2000, but doesn't hurt.  Windows 98
00085     // needs the provider specific buffer to point to valid memory, whereas Windows 2000
00086     // simply needs a contiguous block of memory.  Therefore we allocate a contiguous
00087     // block of memory cast it to a QOS structure and then set the provider specific
00088     // buffer pointer to just beyond the QOS structure proper.  Windows 98 needs this
00089     // whereas Windows 2000 ignores this.  Windows 98 should not care, because this
00090     // is strictly an output buffer, Windows 2000 corrects this problem.
00091     pTempQos = (QOS *)pBuf;
00092     pTempQos->ProviderSpecific.buf = pBuf + sizeof(QOS);
00093     pTempQos->ProviderSpecific.len = dwBufferLen - sizeof(QOS);
00094     // end Windows 98 workaround
00095
00096     // Make the real call
00097     status = WSAIoctl(sd, SIO_GET_QOS, NULL, 0,
00098                             pBuf, dwBufferLen, &dwBytesReturned,
00099                             NULL, NULL);
00100
00101     if (SOCKET_ERROR == status)
00102     {
00103         DWORD dwErr = WSAGetLastError();
00104         if (WSAEWOULDBLOCK != dwErr)
00105             printf("GetQos(2): WSAIoctl(SIO_GET_QOS) %d\n", dwErr);
00106
00107         free(pBuf);
00108         return(FALSE);
00109     }
00110
00111     // True means we need to free this memory later.
00112     *pQos = pTempQos;
00113     return(TRUE);
00114 }
00115
00116
00117
00118
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

msado15::PositionEnum Member List

This is the complete list of members for msado15::PositionEnum, including all inherited members.
adPosBOF | msado15::PositionEnum | [static]
adPosEOF | msado15::PositionEnum | [static]
adPosUnknown | msado15::PositionEnum | [static]
Generated on Wed Nov 13 2024 16:58:13 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Cluster/Win2003/MyStorageResource/PropList.h Source File

  • WinBase
  • Cluster
  • Win2003
  • MyStorageResource

PropList.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  Module Name:
00004 //      PropList.h
00005 //
00006 //  Implementation File:
00007 //      PropList.cpp
00008 //
00009 //  Description:
00010 //      Definition of the CClusPropList class.
00011 //
00012 /////////////////////////////////////////////////////////////////////////////
00013
00014 #pragma once
00015
00016 /////////////////////////////////////////////////////////////////////////////
00017 // Include Files
00018 /////////////////////////////////////////////////////////////////////////////
00019 #include <windows.h>
00020 #include <clusapi.h>
00021
00022 /////////////////////////////////////////////////////////////////////////////
00023 // Forward Class Declarations
00024 /////////////////////////////////////////////////////////////////////////////
00025
00026 class CObjectProperty;
00027 class CClusPropValueList;
00028 class CClusPropList;
00029
00030 /////////////////////////////////////////////////////////////////////////////
00031 // External Class Declarations
00032 /////////////////////////////////////////////////////////////////////////////
00033
00034 /////////////////////////////////////////////////////////////////////////////
00035 // Type Definitions
00036 /////////////////////////////////////////////////////////////////////////////
00037
00038 #if !defined( ASSERT )
00039 #include <crtdbg.h>
00040 #define ASSERT _ASSERTE
00041 #endif // !defined( ASSERT )
00042
00043 #pragma warning( push, 3 )
00044
00045 /////////////////////////////////////////////////////////////////////////////
00046 //++
00047 //
00048 //  class CObjectProperty
00049 //
00050 //  Description:
00051 //      Describes a property in a cluster property list.
00052 //
00053 //  Inheritance:
00054 //      CObjectProperty
00055 //
00056 //--
00057 /////////////////////////////////////////////////////////////////////////////
00058
00059 #if defined( __AFX_H__ ) || ( defined( __ATLTMP_H__ ) && !defined( _ATL_TMP_NO_CSTRING ) )
00060
00061 class CObjectProperty
00062 {
00063 public:
00064
00065     LPCWSTR                 m_pwszName;
00066     CLUSTER_PROPERTY_FORMAT m_propFormat;
00067
00068     union CValue
00069     {
00070         CString *   pstr;
00071         LONG *      pl;
00072         DWORD *     pdw;
00073         BOOL *      pb;
00074         struct
00075         {
00076             PBYTE * ppb;
00077             DWORD * pcb;
00078         };
00079     };
00080
00081     CValue  m_value;
00082     CValue  m_valuePrev;
00083     CValue  m_valueEx;      // expand_sz value (if any)
00084
00085     DWORD   m_dwFlags;
00086
00087     enum ObjPropFlags
00088     {
00089         opfNew = 1
00090     };
00091
00092     CObjectProperty::CObjectProperty( void )
00093     {
00094         m_value.pstr = NULL;
00095         m_value.pcb = NULL;
00096         m_valuePrev.pstr = NULL;
00097         m_valuePrev.pcb = NULL;
00098         m_valueEx.pstr = NULL;
00099         m_valueEx.pcb = NULL;
00100     };
00101
00102     void
00103     Set(
00104           LPCWSTR   pwszNameIn
00105         , CString & rstrValueInout
00106         , CString & rstrPrevValueInout
00107         , DWORD     dwFlagsIn = 0
00108         )
00109     {
00110         m_pwszName = pwszNameIn;
00111         m_propFormat = CLUSPROP_FORMAT_SZ;
00112         m_value.pstr = &rstrValueInout;
00113         m_value.pcb = NULL;
00114         m_valuePrev.pstr = &rstrPrevValueInout;
00115         m_valuePrev.pcb = NULL;
00116         m_valueEx.pstr = NULL;
00117         m_valueEx.pcb = NULL;
00118         m_dwFlags = dwFlagsIn;
00119
00120     } //*** Set( CString & )
00121
00122     void
00123     SetExpandSz(
00124           LPCWSTR   pwszNameIn
00125         , CString & rstrValueInout
00126         , CString & rstrPrevValueInout
00127         , DWORD     dwFlagsIn = 0
00128         )
00129     {
00130         m_pwszName = pwszNameIn;
00131         m_propFormat = CLUSPROP_FORMAT_EXPAND_SZ;
00132         m_value.pstr = &rstrValueInout;
00133         m_value.pcb = NULL;
00134         m_valuePrev.pstr = &rstrPrevValueInout;
00135         m_valuePrev.pcb = NULL;
00136         m_valueEx.pstr= NULL;
00137         m_valueEx.pcb = NULL;
00138         m_dwFlags = dwFlagsIn;
00139
00140     } //*** Set( CString & )
00141
00142     // Set() to get extra EXPANDED_SZ value
00143     void
00144     Set(
00145           LPCWSTR   pwszNameIn
00146         , CString & rstrValueInout
00147         , CString & rstrPrevValueInout
00148         , CString & rstrValueEx
00149         , DWORD     dwFlagsIn = 0
00150         )
00151     {
00152         m_pwszName = pwszNameIn;
00153         m_propFormat = CLUSPROP_FORMAT_SZ;
00154         m_value.pstr = &rstrValueInout;
00155         m_value.pcb = NULL;
00156         m_valuePrev.pstr = &rstrPrevValueInout;
00157         m_valuePrev.pcb = NULL;
00158         m_valueEx.pstr = &rstrValueEx;
00159         m_valueEx.pcb = NULL;
00160         m_dwFlags = dwFlagsIn;
00161
00162     } //*** Set( CString & )
00163
00164     // Set() to get extra EXPANDED_SZ value
00165     void
00166     SetExpandSz(
00167           LPCWSTR   pwszNameIn
00168         , CString & rstrValueInout
00169         , CString & rstrPrevValueInout
00170         , CString & rstrValueEx
00171         , DWORD     dwFlagsIn = 0
00172         )
00173     {
00174         m_pwszName = pwszNameIn;
00175         m_propFormat = CLUSPROP_FORMAT_EXPAND_SZ;
00176         m_value.pstr = &rstrValueInout;
00177         m_value.pcb = NULL;
00178         m_valuePrev.pstr = &rstrPrevValueInout;
00179         m_valuePrev.pcb = NULL;
00180         m_valueEx.pstr = &rstrValueEx;
00181         m_valueEx.pcb = NULL;
00182         m_dwFlags = dwFlagsIn;
00183
00184     } //*** Set( CString & )
00185
00186     void
00187     Set(
00188           LPCWSTR   pwszNameIn
00189         , LONG &    rnValueInout
00190         , LONG &    rnPrevValueInout
00191         , DWORD     dwFlagsIn = 0
00192         )
00193     {
00194         m_pwszName = pwszNameIn;
00195         m_propFormat = CLUSPROP_FORMAT_LONG;
00196         m_value.pl = &rnValueInout;
00197         m_value.pcb = NULL;
00198         m_valuePrev.pl = &rnPrevValueInout;
00199         m_valuePrev.pcb = NULL;
00200         m_valueEx.pstr = NULL;
00201         m_valueEx.pcb = NULL;
00202         m_dwFlags = dwFlagsIn;
00203
00204     } //*** Set( LONG & )
00205
00206     void
00207     Set(
00208           LPCWSTR   pwszNameIn
00209         , DWORD &   rdwValueInout
00210         , DWORD &   rdwPrevValueInout
00211         , DWORD     dwFlagsIn = 0
00212         )
00213     {
00214         m_pwszName = pwszNameIn;
00215         m_propFormat = CLUSPROP_FORMAT_DWORD;
00216         m_value.pdw = &rdwValueInout;
00217         m_value.pcb = NULL;
00218         m_valuePrev.pdw = &rdwPrevValueInout;
00219         m_valuePrev.pcb = NULL;
00220         m_valueEx.pstr = NULL;
00221         m_valueEx.pcb = NULL;
00222         m_dwFlags = dwFlagsIn;
00223
00224     } //*** Set( DWORD & )
00225
00226     void
00227     Set(
00228           LPCWSTR   pwszNameIn
00229         , BOOL &    rbValueInout
00230         , BOOL &    rbPrevValueInout
00231         , DWORD     dwFlagsIn = 0
00232         )
00233     {
00234         m_pwszName = pwszNameIn;
00235         m_propFormat = CLUSPROP_FORMAT_DWORD;
00236         m_value.pb = &rbValueInout;
00237         m_value.pcb = NULL;
00238         m_valuePrev.pb = &rbPrevValueInout;
00239         m_valuePrev.pcb = NULL;
00240         m_valueEx.pstr = NULL;
00241         m_valueEx.pcb = NULL;
00242         m_dwFlags = dwFlagsIn;
00243
00244     } //*** Set( BOOL & )
00245
00246     void
00247     Set(
00248           LPCWSTR   pwszNameIn
00249         , PBYTE &   rpbValueInoout
00250         , DWORD &   rcbValueInout
00251         , PBYTE &   rpbPrevValueInout
00252         , DWORD &   rcbPrevValueInout
00253         , DWORD     dwFlagsIn = 0
00254         )
00255     {
00256         m_pwszName = pwszNameIn;
00257         m_propFormat = CLUSPROP_FORMAT_BINARY;
00258         m_value.ppb = &rpbValueInoout;
00259         m_value.pcb = &rcbValueInout;
00260         m_valuePrev.ppb = &rpbPrevValueInout;
00261         m_valuePrev.pcb = &rcbPrevValueInout;
00262         m_valueEx.pstr = NULL;
00263         m_valueEx.pcb = NULL;
00264         m_dwFlags = dwFlagsIn;
00265
00266     } //*** Set( PBYTE & )
00267
00268     void
00269     Set(
00270           LPCWSTR   pwszNameIn
00271         , LPWSTR &  rpwszValue
00272         , DWORD &   rcbValueInout
00273         , LPWSTR &  rpwszPrevValue
00274         , DWORD &   rcbPrevValueInout
00275         , DWORD     dwFlagsIn = 0
00276         )
00277     {
00278         m_pwszName = pwszNameIn;
00279         m_propFormat = CLUSPROP_FORMAT_MULTI_SZ;
00280         m_value.ppb = reinterpret_cast< PBYTE * >( &rpwszValue );
00281         m_value.pcb = &rcbValueInout;
00282         m_valuePrev.ppb = reinterpret_cast< PBYTE * >( &rpwszPrevValue );
00283         m_valuePrev.pcb = &rcbPrevValueInout;
00284         m_valueEx.pstr = NULL;
00285         m_valueEx.pcb = NULL;
00286         m_dwFlags = dwFlagsIn;
00287
00288     } //*** Set( LPWSTR & )
00289
00290 }; //*** class CObjectProperty
00291
00292 #endif  // defined( __AFX_H__ ) || ( defined( __ATLTMP_H__ ) && !defined( _ATL_TMP_NO_CSTRING ) )
00293
00294 /////////////////////////////////////////////////////////////////////////////
00295 //++
00296 //
00297 //  class CClusPropValueList
00298 //
00299 //  Description:
00300 //      Describes a cluster property list.
00301 //
00302 //  Inheritance:
00303 //      CClusPropValueList
00304 //      CObject (MFC only)
00305 //
00306 //--
00307 /////////////////////////////////////////////////////////////////////////////
00308
00309 class CClusPropValueList
00310 #ifdef __AFX_H__
00311     : public CObject
00312 #endif // __AFX_H__
00313 {
00314 #ifdef __AFX_H__
00315     DECLARE_DYNAMIC( CClusPropValueList );
00316 #endif // __AFX_H__
00317
00318 public:
00319
00320     //
00321     // Construction.
00322     //
00323
00324     // Default constructor
00325     CClusPropValueList( void )
00326         : m_cbDataSize( 0 )
00327         , m_cbDataLeft( 0 )
00328         , m_cbBufferSize( 0 )
00329         , m_fAtEnd( FALSE )
00330     {
00331         m_cbhValueList.pb = NULL;
00332         m_cbhCurrentValue.pb = NULL;
00333
00334     } //*** CClusPropValueList
00335
00336     //  Copy constructor.
00337     CClusPropValueList(
00338         const CClusPropValueList & rcpvlInout
00339         )
00340         : m_cbBufferSize( 0 )
00341         , m_fAtEnd( FALSE )
00342     {
00343         Init( rcpvlInout );
00344
00345     } //*** CClusPropValueList
00346
00347     //  Buffer helper constructor.
00348     CClusPropValueList(
00349           CLUSPROP_BUFFER_HELPER    cbhValueListIn
00350         , size_t                    cbDataSizeIn
00351         )
00352         : m_cbBufferSize( 0 )
00353         , m_fAtEnd( FALSE )
00354     {
00355         Init( cbhValueListIn, cbDataSizeIn );
00356
00357     } //*** CClusPropValueList
00358
00359     //  Destructor
00360     ~CClusPropValueList( void )
00361     {
00362         DeleteValueList();
00363
00364     } //*** ~CClusPropValueList
00365
00366     //  Initialize the value list
00367     void
00368     Init(
00369         const CClusPropValueList & rcpvlInout
00370         )
00371     {
00372         ASSERT( m_cbBufferSize == 0 );
00373
00374         m_cbhValueList      = rcpvlInout.m_cbhValueList;
00375         m_cbhCurrentValue   = rcpvlInout.m_cbhCurrentValue;
00376         m_cbDataSize        = rcpvlInout.m_cbDataSize;
00377         m_cbDataLeft        = rcpvlInout.m_cbDataLeft;
00378         m_fAtEnd            = rcpvlInout.m_fAtEnd;
00379
00380     } //*** Init
00381
00382     //  Initialize the value list from a buffer helper
00383     void
00384     Init(
00385           const CLUSPROP_BUFFER_HELPER  cbhValueListIn
00386         , size_t                        cbDataSizeIn
00387         )
00388     {
00389         ASSERT( m_cbBufferSize == 0 );
00390
00391         m_cbhValueList      = cbhValueListIn;
00392         m_cbhCurrentValue   = cbhValueListIn;
00393         m_cbDataSize        = cbDataSizeIn;
00394         m_cbDataLeft        = cbDataSizeIn;
00395         m_fAtEnd            = FALSE;
00396
00397     } //*** Init
00398
00399     //  Assignment operator
00400     void operator=( const CClusPropValueList & rcpvlInout )
00401     {
00402         ASSERT( m_cbBufferSize == 0 );
00403
00404         m_cbhValueList      = rcpvlInout.m_cbhValueList;
00405         m_cbhCurrentValue   = rcpvlInout.m_cbhCurrentValue;
00406         m_cbDataSize        = rcpvlInout.m_cbDataSize;
00407         m_cbDataLeft        = rcpvlInout.m_cbDataLeft;
00408         m_fAtEnd            = rcpvlInout.m_fAtEnd;
00409
00410     } //*** operator=
00411
00412     //
00413     // Accessor methods.
00414     //
00415
00416     // Buffer helper cast operator to access the current value
00417     operator const CLUSPROP_BUFFER_HELPER( void ) const
00418     {
00419         return m_cbhCurrentValue;
00420
00421     } //*** operator CLUSPROP_BUFFER_HELPER
00422
00423     // Access the value list
00424     CLUSPROP_BUFFER_HELPER CbhValueList( void ) const
00425     {
00426         return m_cbhValueList;
00427
00428     } //*** CbhValueList
00429
00430     // Access the current value
00431     CLUSPROP_BUFFER_HELPER CbhCurrentValue( void ) const
00432     {
00433         return m_cbhCurrentValue;
00434
00435     } //*** CbhCurrentValue
00436
00437     // Access the format of the current value
00438     CLUSTER_PROPERTY_FORMAT CpfCurrentValueFormat( void ) const
00439     {
00440         return static_cast< CLUSTER_PROPERTY_FORMAT >( m_cbhCurrentValue.pValue->Syntax.wFormat );
00441
00442     } //*** CpfCurrentValueFormat
00443
00444     // Access the type of the current value
00445     CLUSTER_PROPERTY_TYPE CptCurrentValueType( void ) const
00446     {
00447         return static_cast< CLUSTER_PROPERTY_TYPE >( m_cbhCurrentValue.pValue->Syntax.wType );
00448
00449     } //*** CptCurrentValueType
00450
00451     // Access the syntax of the current value
00452     CLUSTER_PROPERTY_SYNTAX CpsCurrentValueSyntax( void ) const
00453     {
00454         return static_cast< CLUSTER_PROPERTY_SYNTAX >( m_cbhCurrentValue.pValue->Syntax.dw );
00455
00456     } //*** CpsCurrentValueSyntax
00457
00458     // Access the length of the data of the current value
00459     DWORD CbCurrentValueLength( void ) const
00460     {
00461         DWORD cbLength = 0;
00462
00463         if ( m_cbhCurrentValue.pb == NULL )
00464         {
00465             cbLength = 0;
00466         } // if: no value list allocated yet
00467         else
00468         {
00469             cbLength = m_cbhCurrentValue.pValue->cbLength;
00470         } // else: value list allocated
00471
00472         return cbLength;
00473
00474     } //*** CbCurrentValueLength
00475
00476     // Access size of the data in the buffer.
00477     DWORD CbDataSize( void ) const
00478     {
00479         return m_cbDataSize;
00480
00481     } //*** CbDataSize
00482
00483     // Access amount of data left in buffer after current value
00484     DWORD CbDataLeft( void ) const
00485     {
00486         return m_cbDataLeft;
00487
00488     } //*** CbDataLeft
00489
00490     //
00491     // Parsing methods.
00492     //
00493
00494     // Move to the first value in the list
00495     DWORD ScMoveToFirstValue( void );
00496
00497     // Move the value after the current one in the list
00498     DWORD ScMoveToNextValue( void );
00499
00500     // Query whether we are at the last value in the list or not
00501     DWORD ScCheckIfAtLastValue( void );
00502
00503     //
00504     // Methods for building a value list.
00505     //
00506
00507     DWORD ScAllocValueList( size_t cbMinimumIn );
00508
00509     // Delete the value list buffer and cleanup support variables
00510     void DeleteValueList( void )
00511     {
00512         //
00513         // If m_cbBufferSize is greater then 0 then we allocated the value list.
00514         // If it's zero then the value list is a part of the property list in
00515         // CClusPropList.
00516         //
00517
00518         if ( m_cbBufferSize > 0 )
00519         {
00520             delete [] m_cbhValueList.pb;
00521
00522             m_cbhValueList.pb = NULL;
00523             m_cbhCurrentValue.pb = NULL;
00524             m_cbBufferSize = 0;
00525             m_cbDataSize = 0;
00526             m_cbDataLeft = 0;
00527             m_fAtEnd = FALSE;
00528         } // if: we allocated anything
00529
00530     } //*** DeleteValueList
00531
00532     // Get a value list from a resource
00533     DWORD
00534     ScGetResourceValueList(
00535           HRESOURCE hResourceIn
00536         , DWORD     dwControlCodeIn
00537         , HNODE     hHostNodeIn = NULL
00538         , LPVOID    lpBufferIn = NULL
00539         , size_t    cbBufferIn = 0
00540         );
00541
00542     // Get a value list from a resource type
00543     DWORD ScGetResourceTypeValueList(
00544           HCLUSTER  hClusterIn
00545         , LPCWSTR   pwszResTypeNameIn
00546         , DWORD     dwControlCodeIn
00547         , HNODE     hHostNodeIn = NULL
00548         , LPVOID    lpBufferIn = NULL
00549         , size_t    cbBufferIn = 0
00550         );
00551
00552 private:
00553     CLUSPROP_BUFFER_HELPER  m_cbhValueList;     // Pointer to the value list for parsing.
00554     CLUSPROP_BUFFER_HELPER  m_cbhCurrentValue;  // Pointer to the current value for parsing.
00555     DWORD                   m_cbDataSize;       // Amount of data in the buffer.
00556     DWORD                   m_cbDataLeft;       // Amount of data left in buffer after current value.
00557     DWORD                   m_cbBufferSize;     // Size of the buffer if we allocated it.
00558     BOOL                    m_fAtEnd;           // Indicates whether at last value in list.
00559
00560 }; //*** class CClusPropValueList
00561
00562 /////////////////////////////////////////////////////////////////////////////
00563 //++
00564 //
00565 //  class CClusPropList
00566 //
00567 //  Description:
00568 //      Describes a cluster property list.
00569 //
00570 //  Inheritance:
00571 //      CClusPropList
00572 //      CObject (MFC only)
00573 //
00574 //--
00575 /////////////////////////////////////////////////////////////////////////////
00576 class CClusPropList
00577 #ifdef __AFX_H__
00578     : public CObject
00579 #endif // __AFX_H__
00580 {
00581 #ifdef __AFX_H__
00582     DECLARE_DYNAMIC( CClusPropList );
00583 #endif // __AFX_H__
00584
00585 public:
00586
00587     //
00588     // Construction.
00589     //
00590
00591     // Default constructor
00592     CClusPropList(
00593         BOOL bAlwaysAddPropIn = FALSE
00594         )
00595         : m_fAlwaysAddProp( bAlwaysAddPropIn )
00596         , m_cbBufferSize( 0 )
00597         , m_cbDataSize( 0 )
00598         , m_cbDataLeft( 0 )
00599         , m_nPropsRemaining( 0 )
00600     {
00601         m_cbhPropList.pList     = NULL;
00602         m_cbhCurrentProp.pb     = NULL;
00603         m_cbhCurrentPropName.pb = NULL;
00604
00605     } //*** CClusPropList
00606
00607     // Destructor
00608     ~CClusPropList( void )
00609     {
00610         DeletePropList();
00611
00612     } //*** ~CClusPropList
00613
00614     // Copy list into this list (like assignment operator)
00615     DWORD ScCopy( const PCLUSPROP_LIST pcplPropListIn, size_t cbListSizeIn );
00616
00617     // Append list into this list
00618     DWORD ScAppend( const CClusPropList & rclPropListIn );
00619
00620     // Delete the property list buffer and cleanup support variables
00621     void DeletePropList( void )
00622     {
00623         delete [] m_cbhPropList.pb;
00624
00625         m_cbhPropList.pb = NULL;
00626         m_cbhCurrentProp.pb = NULL;
00627         m_cbhCurrentPropName.pb = NULL;
00628         m_cbBufferSize = 0;
00629         m_cbDataSize = 0;
00630         m_cbDataLeft = 0;
00631
00632     } //*** DeletePropList
00633
00634 protected:
00635
00636     //
00637     // Attributes.
00638     //
00639
00640     BOOL                    m_fAlwaysAddProp;       // Indicate if properties should be added even if not different.
00641     CLUSPROP_BUFFER_HELPER  m_cbhPropList;          // Pointer to the beginning of the list.
00642     CLUSPROP_BUFFER_HELPER  m_cbhCurrentProp;       // Pointer to the current property.
00643     DWORD                   m_cbBufferSize;         // Allocated size of the buffer.
00644     DWORD                   m_cbDataSize;           // Amount of data in the buffer.
00645     DWORD                   m_cbDataLeft;           // Amount of data left in buffer after current value.
00646
00647 private:
00648     CLUSPROP_BUFFER_HELPER  m_cbhCurrentPropName;   // Pointer to the current name for parsing
00649     DWORD                   m_nPropsRemaining;      // Used by BMoveToNextProperty() to track end of list.
00650     CClusPropValueList      m_pvlValues;            // Helper class for value list of current property.
00651
00652 public:
00653
00654     //
00655     // Accessor methods.
00656     //
00657
00658     // Access the values of the current property
00659     const CClusPropValueList & RPvlPropertyValue( void )
00660     {
00661         return m_pvlValues;
00662
00663     } //*** RPvlPropertyValue
00664
00665     // Access the property list
00666     operator PCLUSPROP_LIST( void ) const
00667     {
00668         return m_cbhPropList.pList;
00669
00670     } //*** operator PCLUSPROP_LIST
00671
00672     // Access allocated size of the buffer
00673     DWORD CbBufferSize( void ) const
00674     {
00675         return m_cbBufferSize;
00676
00677     } //*** CbBufferSize
00678
00679     // Access the name of the current property
00680     LPCWSTR PszCurrentPropertyName( void ) const
00681     {
00682         return m_cbhCurrentPropName.pName->sz;
00683
00684     } //*** PszCurrentPropertyName
00685
00686     // Access the current property name as a buffer helper
00687     const CLUSPROP_BUFFER_HELPER CbhCurrentPropertyName( void )
00688     {
00689         return m_cbhCurrentPropName;
00690
00691     } //*** CbhCurrentPropertyName
00692
00693     // Access value list of the current property as a buffer helper
00694     const CLUSPROP_BUFFER_HELPER CbhCurrentValueList( void )
00695     {
00696         return m_pvlValues.CbhValueList();
00697
00698     } //*** CbhCurrentValueList
00699
00700     // Access current value of the current property as a buffer helper
00701     const CLUSPROP_BUFFER_HELPER CbhCurrentValue( void )
00702     {
00703         return m_pvlValues.CbhCurrentValue();
00704
00705     } //*** CbhCurrentValue
00706
00707     // Access the format of the current value of the current property
00708     CLUSTER_PROPERTY_FORMAT CpfCurrentValueFormat( void ) const
00709     {
00710         return m_pvlValues.CpfCurrentValueFormat();
00711
00712     } //*** CpfCurrentValueFormat
00713
00714     // Access the type of the current value of the current property
00715     CLUSTER_PROPERTY_TYPE CptCurrentValueType( void ) const
00716     {
00717         return m_pvlValues.CptCurrentValueType();
00718
00719     } //*** CptCurrentValueType
00720
00721     // Access the syntax of the current value of the current property
00722     CLUSTER_PROPERTY_SYNTAX CpsCurrentValueSyntax( void ) const
00723     {
00724         return m_pvlValues.CpsCurrentValueSyntax();
00725
00726     } //*** CpsCurrentValueSyntax
00727
00728     // Access the length of the current value of the current property
00729     DWORD CbCurrentValueLength( void ) const
00730     {
00731         return m_pvlValues.CbCurrentValueLength();
00732
00733     } //*** CbCurrentValueLength
00734
00735     PCLUSPROP_LIST Plist( void )
00736     {
00737         return m_cbhPropList.pList;
00738
00739     } //*** Plist
00740
00741     const CLUSPROP_BUFFER_HELPER CbhPropList( void ) const
00742     {
00743         return m_cbhPropList;
00744
00745     } //*** CbhPropList
00746
00747     PBYTE PbPropList( void ) const
00748     {
00749         return m_cbhPropList.pb;
00750
00751     } //*** PbPropList
00752
00753     DWORD CbPropList( void ) const
00754     {
00755         return m_cbDataSize + sizeof( CLUSPROP_SYNTAX ); /*endmark*/
00756
00757     } //*** CbPropList
00758
00759     // Access amount of data left in buffer after current value
00760     DWORD CbDataLeft( void ) const
00761     {
00762         return m_cbDataLeft;
00763
00764     } //*** CbDataLeft
00765
00766     DWORD Cprops( void ) const
00767     {
00768         if ( m_cbhPropList.pb == NULL )
00769         {
00770             return 0;
00771         } // if:  no buffer yet
00772
00773         return m_cbhPropList.pList->nPropertyCount;
00774
00775     } //*** Cprops
00776
00777 public:
00778     //
00779     // Parsing methods.
00780     //
00781
00782     // Initialize the size after getting properties from an external source
00783     void InitSize( size_t cbSizeIn )
00784     {
00785         ASSERT( m_cbhPropList.pb != NULL );
00786         ASSERT( m_cbBufferSize > 0 );
00787
00788         m_cbDataSize = cbSizeIn;
00789         m_cbDataLeft = cbSizeIn;
00790
00791     } //*** InitSize
00792
00793     // Move to the first property in the list
00794     DWORD ScMoveToFirstProperty( void );
00795
00796     // Move the property after the current one in the list
00797     DWORD ScMoveToNextProperty( void );
00798
00799     // Move to a property by specifying its name
00800     DWORD ScMoveToPropertyByName( LPCWSTR pwszPropNameIn );
00801
00802     // Move to the first value in the current property
00803     DWORD ScMoveToFirstPropertyValue( void )
00804     {
00805         return m_pvlValues.ScMoveToFirstValue();
00806
00807     } //*** ScMoveToFirstPropertyValue
00808
00809     // Move the the value after the current on in the current property
00810     DWORD ScMoveToNextPropertyValue( void )
00811     {
00812         return m_pvlValues.ScMoveToNextValue();
00813
00814     } //*** ScMoveToNextPropertyValue
00815
00816     // Query whether we are at the last property in the list or not
00817     DWORD ScCheckIfAtLastProperty( void ) const
00818     {
00819         DWORD sc;
00820
00821         if ( m_nPropsRemaining <= 1 )
00822         {
00823             sc = ERROR_NO_MORE_ITEMS;
00824         } // if:  at the last property
00825         else
00826         {
00827             sc = ERROR_SUCCESS;
00828         } // else:  not at the last property
00829
00830         return sc;
00831
00832     } //*** ScCheckIfAtLastProperty
00833
00834     // Query whether the list is empty or not
00835     BOOL BIsListEmpty( void ) const
00836     {
00837         ASSERT( m_cbhPropList.pb != NULL );
00838         ASSERT( m_cbDataSize >= sizeof( m_cbhPropList.pList->nPropertyCount ) );
00839
00840         return m_cbhPropList.pList->nPropertyCount == 0;
00841
00842     } //*** BIsListEmpty
00843
00844 public:
00845     //
00846     // Methods for building a property list.
00847     //
00848
00849     // Allocate a property list
00850     DWORD ScAllocPropList( size_t cbMinimumIn );
00851
00852     void ClearPropList( void )
00853     {
00854         m_cbDataSize = 0;
00855         m_cbDataLeft = 0;
00856
00857         if ( m_cbBufferSize != 0 )
00858         {
00859             ZeroMemory( m_cbhPropList.pb, m_cbBufferSize );
00860             m_cbhCurrentProp.pb = m_cbhPropList.pb + sizeof( m_cbhPropList.pList->nPropertyCount );
00861             m_cbhCurrentPropName = m_cbhCurrentProp;
00862         } // if:  buffer already allocated
00863
00864     } //*** ClearPropList
00865
00866     DWORD ScAddProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn );
00867
00868     DWORD ScAddExpandSzProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn );
00869
00870     DWORD ScAddMultiSzProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn, LPCWSTR pwszPrevValueIn );
00871
00872     DWORD ScAddProp( LPCWSTR pwszNameIn, DWORD nValueIn, DWORD nPrevValueIn );
00873
00874     DWORD ScAddProp( LPCWSTR pwszNameIn, LONG nValueIn, LONG nPrevValueIn );
00875
00876     DWORD ScAddProp( LPCWSTR pwszNameIn, ULONGLONG ullValueIn, ULONGLONG ullPrevValueIn );
00877
00878     DWORD ScAddProp( LPCWSTR pwszNameIn, LONGLONG llValueIn, LONGLONG llPrevValueIn );
00879
00880     DWORD ScSetPropToDefault( LPCWSTR pwszNameIn, CLUSTER_PROPERTY_FORMAT propFormatIn );
00881
00882     DWORD ScAddProp(
00883               LPCWSTR               pwszNameIn
00884             , const unsigned char * pbValueIn
00885             , size_t                cbValueIn
00886             , const unsigned char * pbPrevValueIn
00887             , size_t                cbPrevValueIn
00888             );
00889
00890     DWORD ScAddProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn )
00891     {
00892         return ScAddProp( pwszNameIn, pwszValueIn, NULL );
00893
00894     } //*** ScAddProp
00895
00896     DWORD ScAddExpandSzProp( LPCWSTR pwszNameIn, LPCWSTR pwszValueIn )
00897     {
00898         return ScAddExpandSzProp( pwszNameIn, pwszValueIn, NULL );
00899
00900     } //*** ScAddExpandSzProp
00901
00902 public:
00903
00904     //
00905     // Get Property methods.
00906     //
00907
00908     DWORD ScGetNodeProperties(
00909           HNODE     hNodeIn
00910         , DWORD     dwControlCodeIn
00911         , HNODE     hHostNodeIn = NULL
00912         , LPVOID    lpBufferIn = NULL
00913         , size_t    cbBufferIn = 0
00914         );
00915
00916     DWORD ScGetGroupProperties(
00917           HGROUP   hGroupIn
00918         , DWORD    dwControlCodeIn
00919         , HNODE    hHostNodeIn = NULL
00920         , LPVOID   lpBufferIn = NULL
00921         , size_t   cbBufferIn = 0
00922         );
00923
00924     DWORD ScGetResourceProperties(
00925           HRESOURCE    hResourceIn
00926         , DWORD        dwControlCodeIn
00927         , HNODE        hHostNodeIn = NULL
00928         , LPVOID       lpBufferIn = NULL
00929         , size_t       cbBufferIn = 0
00930         );
00931
00932     DWORD ScGetResourceTypeProperties(
00933           HCLUSTER hClusterIn
00934         , LPCWSTR  pwszResTypeNameIn
00935         , DWORD    dwControlCodeIn
00936         , HNODE    hHostNodeIn = NULL
00937         , LPVOID   lpBufferIn = NULL
00938         , size_t   cbBufferIn = 0
00939         );
00940
00941     DWORD ScGetNetworkProperties(
00942           HNETWORK hNetworkIn
00943         , DWORD    dwControlCodeIn
00944         , HNODE    hHostNodeIn = NULL
00945         , LPVOID   lpBufferIn = NULL
00946         , size_t   cbBufferIn = 0
00947         );
00948
00949     DWORD ScGetNetInterfaceProperties(
00950           HNETINTERFACE    hNetInterfaceIn
00951         , DWORD            dwControlCodeIn
00952         , HNODE            hHostNodeIn  = NULL
00953         , LPVOID           lpBufferIn = NULL
00954         , size_t           cbBufferIn = 0
00955         );
00956
00957     DWORD ScGetClusterProperties(
00958           HCLUSTER hClusterIn
00959         , DWORD    dwControlCodeIn
00960         , HNODE    hHostNodeIn = NULL
00961         , LPVOID   lpBufferIn = NULL
00962         , size_t   cbBufferIn = 0
00963         );
00964
00965 // Implementation
00966 protected:
00967     void CopyProp(
00968           PCLUSPROP_SZ             ppropIn
00969         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
00970         , LPCWSTR                  pszIn
00971         , size_t                   cbszIn = 0
00972         );
00973
00974     void CopyExpandSzProp(
00975           PCLUSPROP_SZ             ppropIn
00976         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
00977         , LPCWSTR                  pszIn
00978         , size_t                   cbszIn = 0
00979         );
00980
00981     void CopyMultiSzProp(
00982           PCLUSPROP_MULTI_SZ       ppropIn
00983         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
00984         , LPCWSTR                  pszIn
00985         , size_t                   cbszIn = 0
00986         );
00987
00988     void CopyProp(
00989           PCLUSPROP_DWORD          ppropIn
00990         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
00991         , DWORD                    nValueIn
00992         );
00993
00994     void CopyProp(
00995           PCLUSPROP_LONG           ppropIn
00996         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
00997         , LONG                     nValueIn
00998         );
00999
01000     void CopyProp(
01001           PCLUSPROP_ULARGE_INTEGER  ppropOut
01002         , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
01003         , ULONGLONG                 ullValueIn
01004         );
01005
01006     void CopyProp(
01007           PCLUSPROP_LARGE_INTEGER  ppropOut
01008         , CLUSTER_PROPERTY_TYPE    cptPropTypeIn
01009         , LONGLONG                 llValueIn
01010         );
01011
01012     void CopyProp(
01013           PCLUSPROP_ULARGE_INTEGER  ppropOut
01014         , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
01015         , LONGLONG                  llValueIn
01016         );
01017     void CopyProp(
01018           PCLUSPROP_BINARY      ppropOut
01019         , CLUSTER_PROPERTY_TYPE cptPropTypeIn
01020         , const unsigned char * pbValueIn
01021         , size_t                cbValueIn
01022         );
01023
01024     void CopyEmptyProp(
01025           PCLUSPROP_VALUE           ppropOut
01026         , CLUSTER_PROPERTY_TYPE     cptPropTypeIn
01027         , CLUSTER_PROPERTY_FORMAT   propFormatIn
01028         );
01029
01030 }; //*** class CClusPropList
01031
01032 #pragma warning( pop )
01033
Generated on Wed Nov 13 2024 16:52:48 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CEnumerator Member List

This is the complete list of members for CEnumerator, including all inherited members.
Abort(HCHAPTER hChapter, DBASYNCHOP eOperation) | CAsynchBase | [virtual]
AdviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
AutoQI(DWORD dwCreateOpts) | CEnumerator | [virtual]
AutoRelease() | CEnumerator | [virtual]
CAsynchBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CAsynchBase |
CBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CBase |
CContainerBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CContainerBase |
CEnumerator(CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CEnumerator |
CPropertiesBase(SOURCE eObjectType, CMainWindow *pCMainWindow, CMDIChild *pCMDIChild=NULL) | CPropertiesBase |
Create(REFCLSID clsid) | CEnumerator | [virtual]
CreateEnumInfo(REFCLSID clsid=GUID_NULL, BOOL fRefresh=FALSE) | CEnumerator | [virtual]
CreateInstance(CAggregate *pCAggregate, REFCLSID clsid, DWORD dwCLSCTX, REFIID riid, IUnknown **ppIUnknown, WCHAR *pwszRemoteServer=NULL) | CEnumerator | [virtual]
CreateObject(CBase *pCSource, REFIID riid, IUnknown *pIUnknown, DWORD dwCreateOpts=-1) | CBase | [virtual]
DisplayObject() | CBase | [virtual]
EnumerateInfo(ULONG *pcEnumInfo, ENUMINFO **prgEnumInfo) | CEnumerator | [virtual]
FindConnectionPoint(REFIID riid, IConnectionPoint **ppIConnectionPoint) | CContainerBase | [virtual]
GetBaseType() | CBase | [inline]
GetDefaultInterface() | CEnumerator | [inline, virtual]
GetInterface(REFIID riid) | CBase | [virtual]
GetInterfaceAddress(REFIID riid) | CEnumerator | [virtual]
GetObjectDesc() | CEnumerator | [virtual]
GetObjectImage() | CEnumerator | [inline, virtual]
GetObjectMenu() | CEnumerator | [inline, virtual]
GetObjectName() | CEnumerator | [inline, virtual]
GetObjectType() | CBase | [inline]
GetOptions() | CBase | [virtual]
GetParent(SOURCE eSource) | CBase | [virtual]
GetSourcesRowset(CAggregate *pCAggregate, REFIID riid, ULONG cPropSets, DBPROPSET *rgPropSets, IUnknown **ppIUnknown) | CEnumerator | [virtual]
GetStatus(HCHAPTER hChapter, DBASYNCHOP eOperation, DBCOUNTITEM *pulProgress, DBCOUNTITEM *pulProgressMax, DBASYNCHPHASE *peAsynchPhase, LPOLESTR *ppwszStatusText) | CAsynchBase | [virtual]
Initialize() | CAsynchBase | [virtual]
IsInitialized() | CAsynchBase | [inline, virtual]
IsSameObject(IUnknown *pIUnkObject) | CBase | [virtual]
m_cEnumInfo | CEnumerator |
m_cRef | CBase | [protected]
m_dwCLSCTX | CBase |
m_dwCookieAsynchNotify | CAsynchBase |
m_eBaseClass | CBase | [protected]
m_eObjectType | CBase | [protected]
m_fInitialized | CAsynchBase |
m_guidSource | CBase |
m_hTreeItem | CBase |
m_pCMainWindow | CBase |
m_pCMDIChild | CBase |
m_pCParent | CBase |
m_pIAggregate | CBase |
m_pIConnectionPointContainer | CContainerBase |
m_pIDBAsynchStatus | CAsynchBase |
m_pIDBInitialize | CAsynchBase |
m_pIDBProperties | CPropertiesBase |
m_pIParseDisplayName | CEnumerator |
m_pIService | CBase |
m_pISourcesRowset | CEnumerator |
m_pISupportErrorInfo | CBase |
m_pIUnknown | CBase |
m_rgEnumInfo | CEnumerator |
m_strObjectDesc | CBase | [protected]
ObjectAddRef() | CBase | [virtual]
ObjectQI(REFIID riid, IUnknown **ppIUnknown) | CBase | [virtual]
ObjectRelease() | CBase | [virtual]
OnDefOperation() | CEnumerator | [virtual]
ParseDisplayName(WCHAR *pwszParseName, DWORD dwCLSCTX, REFIID riid, IUnknown **ppIUnknown, CBase **ppCSource, DWORD dwConnectOpts=0, WCHAR *pwszRemoteServer=NULL) | CEnumerator | [virtual]
QueryInterface(REFIID riid, void **ppvObject) | CBase |
ReleaseChildren() | CBase | [virtual]
ReleaseObject(ULONG ulExpectedRefCount=0) | CBase | [virtual]
SetInterface(REFIID riid, IUnknown *pIUnknown) | CBase | [virtual]
SetObjectDesc(WCHAR *pwszDescription, BOOL fCopy=TRUE) | CBase | [virtual]
SetProperties(ULONG cPropSets, DBPROPSET *rgPropSets) | CPropertiesBase | [virtual]
STDMETHODIMP_(ULONG) AddRef() | CBase |
STDMETHODIMP_(ULONG) Release() | CBase |
UnadviseListener(REFIID riid, DWORD *pdwCookie) | CContainerBase | [virtual]
Uninitialize() | CAsynchBase | [virtual]
~CAsynchBase() | CAsynchBase | [virtual]
~CBase() | CBase | [virtual]
~CContainerBase() | CContainerBase | [virtual]
~CEnumerator() | CEnumerator | [virtual]
~CPropertiesBase() | CPropertiesBase | [virtual]
Generated on Wed Nov 13 2024 16:56:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

MYDEVICELib::IUPnPService_DimmingService_SCPD Member List

This is the complete list of members for MYDEVICELib::IUPnPService_DimmingService_SCPD, including all inherited members.
dimLevel([out, retval] long *pdimLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
dimLevel([out, retval] long *pdimLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
dimLevel([out, retval] long *pdimLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetConfigDetails([in, out] VARIANT_BOOL *ppowerVal,[in, out] long *pdLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetConfigDetails([in, out] VARIANT_BOOL *ppowerVal,[in, out] long *pdLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetConfigDetails([in, out] VARIANT_BOOL *ppowerVal,[in, out] long *pdLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetDimLevel([in, out] long *pdLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetDimLevel([in, out] long *pdLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetDimLevel([in, out] long *pdLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetPowerValue([in, out] VARIANT_BOOL *ppowerVall) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetPowerValue([in, out] VARIANT_BOOL *ppowerVall) | MYDEVICELib::IUPnPService_DimmingService_SCPD
GetPowerValue([in, out] VARIANT_BOOL *ppowerVall) | MYDEVICELib::IUPnPService_DimmingService_SCPD
Power([out, retval] VARIANT_BOOL *pPower) | MYDEVICELib::IUPnPService_DimmingService_SCPD
Power([out, retval] VARIANT_BOOL *pPower) | MYDEVICELib::IUPnPService_DimmingService_SCPD
Power([out, retval] VARIANT_BOOL *pPower) | MYDEVICELib::IUPnPService_DimmingService_SCPD
PowerOff() | MYDEVICELib::IUPnPService_DimmingService_SCPD
PowerOff() | MYDEVICELib::IUPnPService_DimmingService_SCPD
PowerOff() | MYDEVICELib::IUPnPService_DimmingService_SCPD
PowerOn() | MYDEVICELib::IUPnPService_DimmingService_SCPD
PowerOn() | MYDEVICELib::IUPnPService_DimmingService_SCPD
PowerOn() | MYDEVICELib::IUPnPService_DimmingService_SCPD
SetDimLevel([in] long dLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
SetDimLevel([in] long dLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
SetDimLevel([in] long dLevel) | MYDEVICELib::IUPnPService_DimmingService_SCPD
Generated on Wed Nov 13 2024 16:58:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/ADSI/samples/DSUI/scpext/scpwizard/util.h Source File

  • NetDS
  • ADSI
  • samples
  • DSUI
  • scpext
  • scpwizard

util.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1999 - 2000
00006 //
00007 //  File:       util.h
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #ifndef _UTIL_H
00012 #define _UTIL_H
00013
00014 #define BYTE_OFFSET(base, offset) (((LPBYTE)base)+offset)
00015
00016 HRESULT SetStringAttribute(IADs* pIADs, LPCWSTR lpszAttr, LPCWSTR lpszValue);
00017 HRESULT SetStringListAttribute(IADs* pIADs, LPCWSTR lpszAttr, CStringList& szValueList);
00018 HRESULT StringListToVariant( VARIANT& refvar, const CStringList& refstringlist);
00019
00020 /////////////////////////////////////////////////////////////////////////////////
00021 /////////////////////////////////////////////////////////////////////////////////
00022 /////////////////////////////////////////////////////////////////////////////////
00023
00024 //
00025 // Forward Declaration
00026 //
00027 class CMultiValuedAttributeEditor;
00028
00029
00030 class CAttributeValueEditor : public CEdit
00031 {
00032 public:
00033   CAttributeValueEditor(CMultiValuedAttributeEditor* pEditor)
00034   {
00035     ASSERT(pEditor != NULL);
00036     m_pEditor = pEditor;
00037   }
00038
00039   ~CAttributeValueEditor() {}
00040
00041   afx_msg BOOL OnChange();
00042
00043 protected:
00044   CMultiValuedAttributeEditor* m_pEditor;
00045
00046   DECLARE_MESSAGE_MAP()
00047 };
00048
00049 /////////////////////////////////////////////////////////////////////////////////
00050
00051 class CMultiValuedListBox : public CListBox
00052 {
00053 public:
00054   CMultiValuedListBox(CMultiValuedAttributeEditor* pEditor)
00055   {
00056     ASSERT(pEditor != NULL);
00057     m_pEditor = pEditor;
00058   }
00059
00060   ~CMultiValuedListBox() {}
00061
00062   afx_msg BOOL OnSelChange();
00063
00064 protected:
00065   CMultiValuedAttributeEditor* m_pEditor;
00066
00067   DECLARE_MESSAGE_MAP()
00068 };
00069
00070 /////////////////////////////////////////////////////////////////////////////////
00071
00072 class CAttributeValueAddButton : public CButton
00073 {
00074 public:
00075   CAttributeValueAddButton(CMultiValuedAttributeEditor* pEditor)
00076   {
00077     ASSERT(pEditor != NULL);
00078     m_pEditor = pEditor;
00079   }
00080
00081   ~CAttributeValueAddButton() {}
00082
00083   afx_msg BOOL OnAdd();
00084
00085 protected:
00086   CMultiValuedAttributeEditor* m_pEditor;
00087
00088   DECLARE_MESSAGE_MAP()
00089 };
00090
00091 /////////////////////////////////////////////////////////////////////////////////
00092
00093 class CAttributeValueDeleteButton : public CButton
00094 {
00095 public:
00096   CAttributeValueDeleteButton(CMultiValuedAttributeEditor* pEditor)
00097   {
00098     ASSERT(pEditor != NULL);
00099     m_pEditor = pEditor;
00100   }
00101
00102   ~CAttributeValueDeleteButton() {}
00103
00104   afx_msg BOOL OnDelete();
00105
00106 protected:
00107   CMultiValuedAttributeEditor* m_pEditor;
00108
00109   DECLARE_MESSAGE_MAP()
00110 };
00111
00112 /////////////////////////////////////////////////////////////////////////////////
00113
00114 class CMultiValuedAttributeEditor
00115 {
00116 public:
00117   CMultiValuedAttributeEditor(CStringList& strrefAttributeList);
00118   ~CMultiValuedAttributeEditor() {}
00119
00120   BOOL Initialize(UINT nEditBox,
00121                   UINT nListBox,
00122                   UINT nAddButton,
00123                   UINT nDeleteButton,
00124                   CWnd* pParentWnd);
00125
00126   void OnEditChange();
00127   void OnValueSelChange();
00128   void OnAddValue();
00129   void OnDeleteValue();
00130
00131 private:
00132   CStringList& m_strrefAttributeList;
00133
00134   CAttributeValueEditor       m_ValueEditor;
00135   CMultiValuedListBox         m_ValueList;
00136   CAttributeValueAddButton    m_AddButton;
00137   CAttributeValueDeleteButton m_DeleteButton;
00138 };
00139
00140 #endif // _UTIL_H
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/rowsetviewer/ccommand.h Source File

  • Dataaccess
  • oledb
  • rowsetviewer

ccommand.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Microsoft OLE DB RowsetViewer
00003 // Copyright (C) 1994 - 1999 By Microsoft Corporation.
00004 //
00005 // @doc
00006 //
00007 // @module CDATASOURCE.H
00008 //
00009 //-----------------------------------------------------------------------------------
00010
00011 #ifndef _CCOMMAND_H_
00012 #define _CCOMMAND_H_
00013
00014
00015 ///////////////////////////////////////////////////////////////
00016 // Includes
00017 //
00018 ///////////////////////////////////////////////////////////////
00019 #include "CRowset.h"  //CDataAccess
00020
00021
00022 /////////////////////////////////////////////////////////////////
00023 // CParameters class
00024 //
00025 //  NOTE: We don't directly inherit from DBPARAMS, since we want
00026 //  to ensure access to the members is protected.
00027 //
00028 /////////////////////////////////////////////////////////////////
00029 class CParameters
00030 {
00031 public:
00032   //Constructor
00033   CParameters()
00034   {
00035     memset(&m_Params, 0, sizeof(DBPARAMS));
00036     m_cbRowSize = 0;
00037   }
00038   ~CParameters()
00039   {
00040     RemoveAll();
00041   }
00042
00043   void    RemoveAll()
00044   {
00045     //Release everything else...
00046     m_Params.cParamSets = 0;
00047     SAFE_FREE(m_Params.pData);
00048     m_cbRowSize = 0;
00049
00050     //Bindings
00051     m_Bindings.RemoveAll();
00052   }
00053
00054   HRESULT   Attach(DB_UPARAMS cParamSets, HACCESSOR hAccessor, DBLENGTH cbRowSize)
00055   {
00056     HRESULT hr = S_OK;
00057     ASSERT(hAccessor != DB_NULL_HACCESSOR);
00058
00059     m_Params.cParamSets = cParamSets;
00060     m_Params.hAccessor    = hAccessor;
00061     m_cbRowSize       = cbRowSize;
00062
00063     //Also allocate memory
00064     SAFE_ALLOC(m_Params.pData, BYTE, cbRowSize * cParamSets);
00065
00066   CLEANUP:
00067     return hr;
00068   }
00069
00070   void*   GetData(DB_UPARAMS iParamSet)
00071   {
00072     ASSERT(iParamSet < m_Params.cParamSets);
00073
00074     //Simple case
00075     if(m_Params.cParamSets == 1)
00076       return m_Params.pData;
00077
00078     //Otherwise
00079     ASSERT(m_cbRowSize);
00080     return (BYTE*)m_Params.pData + (m_cbRowSize*iParamSet);
00081   }
00082
00083   inline    DBLENGTH    GetRowSize()  { return m_cbRowSize;       }
00084   inline    CBindings&    GetBindings() { return m_Bindings;        }
00085   inline    DBPARAMS&   GetParams()   { return m_Params;          }
00086
00087 protected:
00088   //Data
00089   DBLENGTH    m_cbRowSize;
00090   DBPARAMS    m_Params;
00091   CBindings   m_Bindings;
00092 };
00093
00094
00095 /////////////////////////////////////////////////////////////////
00096 // CCommand class
00097 //
00098 /////////////////////////////////////////////////////////////////
00099 class CCommand : public CDataAccess
00100 {
00101 public:
00102   //Constructors
00103   CCommand(CMainWindow* pCMainWindow, CMDIChild* pCMDIChild = NULL);
00104   virtual ~CCommand();
00105
00106   //IUnknown Helpers
00107   virtual HRESULT     AutoQI(DWORD dwCreateOpts);
00108   virtual HRESULT     AutoRelease();
00109   virtual IUnknown**    GetInterfaceAddress(REFIID riid);
00110
00111   //Pure Virtual
00112   virtual WCHAR*      GetObjectName()     { return L"Command";    }
00113   virtual UINT      GetObjectMenu()     { return IDM_COMMANDMENU; }
00114   virtual REFIID      GetDefaultInterface() { return IID_ICommand;    }
00115   virtual LONG      GetObjectImage()    { return IMAGE_COMMAND;   }
00116
00117   //Methods
00118   virtual HRESULT     Execute(CAggregate* pCAggregate, WCHAR* pwszCommandText, REFIID riid, BOOL fUseParams, DBROWCOUNT* pcRowsAffected, IUnknown** ppIUnknown, BOOL fCommandStream = FALSE);
00119   virtual HRESULT     SetCommandText(WCHAR* pwszText, GUID* pGuidDialect = NULL);
00120   virtual HRESULT     SetCommandStream(WCHAR* pwszText, REFIID riid = IID_ISequentialStream, GUID* pGuidDialect = NULL, BOOL fUnicode = TRUE);
00121   virtual HRESULT     Prepare(ULONG cExpectedRuns);
00122
00123   virtual HRESULT     SetProperties(ULONG cPropSets, DBPROPSET* rgPropSets);
00124   virtual HRESULT     GetCurrentCommand(DBID** ppCommandID);
00125
00126   //Helpers
00127   virtual HRESULT     CreateParamAccessor(DB_UPARAMS cParams, DBPARAMINFO* rgParamInfo, DB_UPARAMS cParamSets);
00128   virtual HRESULT     SetupBindings(DB_UPARAMS cParams, DBPARAMINFO* rgParamInfo, DBCOUNTITEM* cBindings, DBBINDING** prgBindings, DBLENGTH* pcRowSize = NULL);
00129   virtual HRESULT     GetParameterInfo(DB_UPARAMS* pcParams, DBPARAMINFO** prgParamInfo, OLECHAR** ppwszNamesBuffer);
00130
00131   //OLE DB Interfaces
00132
00133   //[MANDATORY]
00134 //  IAccessor*        m_pIAccessor;       //CDataAccess base class
00135 //  IColumnsInfo*     m_pIColumnsInfo;      //CDataAccess base class
00136 //  IConvertType*     m_pIConvertType;      //CDataAccess base class
00137   ICommand*       m_pICommand;        //Command interface
00138   ICommandProperties*   m_pICommandProperties;    //Command interface
00139   ICommandText*     m_pICommandText;      //Command interface
00140
00141   //[OPTIONAL]
00142   ICommandStream*     m_pICommandStream;      //Command interface
00143   ICommandPrepare*    m_pICommandPrepare;     //Command interface
00144   ICommandPersist*    m_pICommandPersist;     //Command interface
00145   ICommandWithParameters* m_pICommandWithParameters;  //Command interface
00146
00147   //Parameters
00148   CParameters       m_Parameters;
00149
00150   //Data
00151   GUID          m_guidDialect;
00152 };
00153
00154
00155
00156 #endif  //_CCOMMAND_H_
Generated on Wed Nov 13 2024 16:52:05 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/ActiveX/comp.Cpp Source File

  • SysMgmt
  • MMC
  • ActiveX

comp.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include "Comp.h"
00020 #include "DataObj.h"
00021 #include <commctrl.h>        // Needed for button styles...
00022 #include <crtdbg.h>
00023 #include "globals.h"
00024 #include "resource.h"
00025 #include "DeleBase.h"
00026 #include "CompData.h"
00027
00028 #define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
00029
00030 CComponent::CComponent(CComponentData *parent)
00031 : m_pComponentData(parent), m_cref(0), m_ipConsole(NULL)
00032 {
00033     OBJECT_CREATED
00034
00035         m_ipDisplayHelp = NULL;
00036     m_ipControlBar  = NULL;
00037 }
00038
00039 CComponent::~CComponent()
00040 {
00041     OBJECT_DESTROYED
00042 }
00043
00044 STDMETHODIMP CComponent::QueryInterface(REFIID riid, LPVOID *ppv)
00045 {
00046     if (!ppv)
00047         return E_FAIL;
00048
00049     *ppv = NULL;
00050
00051     if (IsEqualIID(riid, IID_IUnknown))
00052         *ppv = static_cast<IComponent *>(this);
00053     else if (IsEqualIID(riid, IID_IComponent))
00054         *ppv = static_cast<IComponent *>(this);
00055
00056     if (*ppv)
00057     {
00058         reinterpret_cast<IUnknown *>(*ppv)->AddRef();
00059         return S_OK;
00060     }
00061
00062     return E_NOINTERFACE;
00063 }
00064
00065 STDMETHODIMP_(ULONG) CComponent::AddRef()
00066 {
00067     return InterlockedIncrement((LONG *)&m_cref);
00068 }
00069
00070 STDMETHODIMP_(ULONG) CComponent::Release()
00071 {
00072     if (InterlockedDecrement((LONG *)&m_cref) == 0)
00073     {
00074         delete this;
00075         return 0;
00076     }
00077     return m_cref;
00078
00079 }
00080
00081 ///////////////////////////////
00082 // Interface IComponent
00083 ///////////////////////////////
00084 STDMETHODIMP CComponent::Initialize(
00085                                     /* [in] */ LPCONSOLE lpConsole)
00086 {
00087     HRESULT hr = S_OK;
00088
00089     // Save away all the interfaces we'll need.
00090     // Fail if we can't QI the required interfaces.
00091
00092     m_ipConsole = lpConsole;
00093     m_ipConsole->AddRef();
00094
00095     hr = m_ipConsole->QueryInterface(IID_IDisplayHelp, (void **)&m_ipDisplayHelp);
00096
00097     return hr;
00098 }
00099
00100 STDMETHODIMP CComponent::Notify(
00101                                 /* [in] */ LPDATAOBJECT lpDataObject,
00102                                 /* [in] */ MMC_NOTIFY_TYPE event,
00103                                 /* [in] */ LPARAM arg,
00104                                 /* [in] */ LPARAM param)
00105 {
00106     MMCN_Crack(FALSE, lpDataObject, NULL, this, event, arg, param);
00107
00108     HRESULT hr = S_FALSE;
00109
00110   //Get our data object. If it is NULL, we return with S_FALSE.
00111   //See implementation of GetOurDataObject() to see how to
00112   //handle special data objects.
00113   CDataObject *pDataObject = GetOurDataObject(lpDataObject);
00114   if (NULL == pDataObject)
00115     return S_FALSE;
00116
00117   CDelegationBase *base = pDataObject->GetBaseNodeObject();
00118
00119     switch (event)      {
00120     case MMCN_ADD_IMAGES:
00121         hr = base->AddImages((IImageList *)arg, (HSCOPEITEM)param);
00122         break;
00123
00124     case MMCN_SELECT:
00125         hr = base->Select(m_ipConsole, (BOOL) LOWORD(arg), (BOOL) HIWORD(arg));
00126         break;
00127
00128     case MMCN_SHOW:
00129         hr = base->Show(m_ipConsole, (BOOL)arg, (HSCOPEITEM)param);
00130         break;
00131
00132     case MMCN_INITOCX:
00133         hr = base->InitOCX(reinterpret_cast<IUnknown *>(param));
00134         break;
00135
00136     case MMCN_CONTEXTHELP:
00137         hr = base->ShowContextHelp(m_ipConsole, m_ipDisplayHelp, m_pComponentData->m_HelpFile);
00138         break;
00139     }
00140
00141     return hr;
00142 }
00143
00144 STDMETHODIMP CComponent::Destroy(
00145                                  /* [in] */ MMC_COOKIE cookie)
00146 {
00147     if (m_ipConsole) {
00148         m_ipConsole->Release();
00149         m_ipConsole = NULL;
00150     }
00151
00152     if (m_ipDisplayHelp) {
00153         m_ipDisplayHelp->Release();
00154         m_ipDisplayHelp = NULL;
00155     }
00156
00157     if (m_ipControlBar) {
00158         m_ipControlBar->Release();
00159         m_ipControlBar = NULL;
00160     }
00161
00162     return S_OK;
00163 }
00164
00165
00166 STDMETHODIMP CComponent::QueryDataObject(
00167                                          /* [in] */ MMC_COOKIE cookie,
00168                                          /* [in] */ DATA_OBJECT_TYPES type,
00169                                          /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject)
00170 {
00171     CDataObject *pObj = NULL;
00172
00173     if (cookie == 0)
00174         pObj = new CDataObject((MMC_COOKIE)m_pComponentData->m_pStaticNode, type);
00175     else
00176         pObj = new CDataObject(cookie, type);
00177
00178     if (!pObj)
00179         return E_OUTOFMEMORY;
00180
00181     pObj->QueryInterface(IID_IDataObject, (void **)ppDataObject);
00182
00183     return S_OK;
00184 }
00185
00186 STDMETHODIMP CComponent::GetResultViewType(
00187                                            /* [in] */ MMC_COOKIE cookie,
00188                                            /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
00189                                            /* [out] */ long __RPC_FAR *pViewOptions)
00190 {
00191     CDelegationBase *base = (CDelegationBase *)cookie;
00192
00193     //
00194     // Ask for default listview.
00195     //
00196     if (base == NULL)
00197     {
00198         *pViewOptions = MMC_VIEW_OPTIONS_NONE;
00199         *ppViewType = NULL;
00200     }
00201     else
00202         return base->GetResultViewType(ppViewType, pViewOptions);
00203
00204     return S_OK;
00205 }
00206
00207 STDMETHODIMP CComponent::GetDisplayInfo(
00208                                         /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem)
00209 {
00210     HRESULT hr = S_OK;
00211     CDelegationBase *base = NULL;
00212
00213     // if they are asking for the RDI_STR we have one of those to give
00214
00215     if (pResultDataItem->lParam) {
00216         base = (CDelegationBase *)pResultDataItem->lParam;
00217         if (pResultDataItem->mask & RDI_STR) {
00218                         LPCTSTR pszT = base->GetDisplayName(pResultDataItem->nCol);
00219                         MAKE_WIDEPTR_FROMTSTR_ALLOC(pszW, pszT);
00220             pResultDataItem->str = pszW;
00221         }
00222
00223         if (pResultDataItem->mask & RDI_IMAGE) {
00224             pResultDataItem->nImage = base->GetBitmapIndex();
00225         }
00226     }
00227
00228     return hr;
00229 }
00230
00231
00232 STDMETHODIMP CComponent::CompareObjects(
00233                                         /* [in] */ LPDATAOBJECT lpDataObjectA,
00234                                         /* [in] */ LPDATAOBJECT lpDataObjectB)
00235 {
00236     CDelegationBase *baseA = GetOurDataObject(lpDataObjectA)->GetBaseNodeObject();
00237     CDelegationBase *baseB = GetOurDataObject(lpDataObjectB)->GetBaseNodeObject();
00238
00239     // compare the object pointers
00240     if (baseA->GetCookie() == baseB->GetCookie())
00241         return S_OK;
00242
00243     return S_FALSE;
00244 }
Generated on Wed Nov 13 2024 16:52:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/CacheProxy/csharp/Class1.cs Source File

  • Multimedia
  • WindowsMediaServices9
  • CacheProxy
  • csharp

Class1.cs

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // Class1.cs
00007 //
00008 //------------------------------------------------------------------------------
00009 using System;
00010 using System.Runtime.InteropServices;
00011 using Microsoft.Win32;
00012 using System.Threading;
00013 using System.Data;
00014 using System.Xml;
00015 using System.Reflection;
00016 using System.Diagnostics;
00017 using System.Collections;
00018 using System.IO;
00019 using Microsoft.WindowsMediaServices.Interop;
00020
00021 using System.Xml.Serialization;
00022
00023 namespace CacheProxySamplePlugin
00024 {
00025     class PlaylistItem
00026     {
00027         public string CacheUrl;
00028         public string CDLData;
00029     public int    CacheID;
00030     };
00031     public class ContentInfo
00032     {
00033         public ContentInfo(string o, string c)
00034         {
00035             Debug.WriteLine("ContentInfo::ContentInfo entered");
00036             OriginUrl = o;
00037             CacheUrl = c;
00038             CacheFlags=0;
00039             ContentSize = 0;
00040             SubscriptionFlag=0;
00041             ContentType=0;
00042             EntityTags = new ArrayList();
00043             LastModified = System.DateTime.Now;
00044             ExpirationTime = System.DateTime.Now;
00045             CacheProxyCallback = null;
00046             varContext = null;
00047             lExpiration = 0;
00048             CDL = new ArrayList();
00049         }
00050         public string   OriginUrl, CacheUrl;
00051         public int      SubscriptionFlag;
00052         public int      ContentType;
00053         public DateTime LastModified;
00054         public DateTime ExpirationTime;
00055         public int      CacheFlags;
00056         public System.Int64 ContentSize;
00057         public ArrayList    EntityTags;
00058         public string   CDLData;
00059         public IWMSCacheProxyCallback   CacheProxyCallback;
00060         public object       varContext;
00061         public int          lExpiration; // needed for prestuffing
00062         public ArrayList    CDL; //array of strings for playlist
00063
00064     };
00065     public class INSSBufferImpl : INSSBuffer
00066     {
00067         public byte[]       Buffer;
00068         public uint         Length;
00069
00070         public INSSBufferImpl()
00071         {
00072       Debug.WriteLine("INSSBufferImpl::INSSBufferImpl entered");
00073       Length = 0;
00074         }
00075
00076         void INSSBuffer.GetBufferAndLength(out IntPtr ppbBuffer, out uint pdwLength)
00077         {
00078             Debug.WriteLine("INSSBufferImpl::GetBufferAndLength entered");
00079             pdwLength=Length;
00080             INSSBuffer pBuf = this as INSSBuffer;
00081             pBuf.GetBuffer(out ppbBuffer);
00082
00083         }
00084         void INSSBuffer.GetBuffer(out IntPtr ppbBuffer)
00085         {
00086             Debug.WriteLine("INSSBufferImpl::GetBuffer entered");
00087             ppbBuffer = Marshal.AllocCoTaskMem((int)Length);
00088             try
00089             {
00090                 Marshal.Copy(Buffer,0,ppbBuffer,(int)Length);
00091             }
00092             catch(Exception e)
00093             {
00094                 Debug.WriteLine(e);
00095             }
00096         }
00097
00098         void INSSBuffer.GetLength(out uint pdwLength)
00099         {
00100             Debug.WriteLine("INSSBufferImpl::GetLength entered");
00101             pdwLength=Length;
00102         }
00103
00104         void INSSBuffer.GetMaxLength(out uint pdwLength)
00105         {
00106             Debug.WriteLine("INSSBufferImpl::GetMaxLength entered");
00107             pdwLength=Length;
00108         }
00109
00110         void INSSBuffer.SetLength(uint dwLength)
00111         {
00112             Debug.WriteLine("INSSBufferImpl::SetLength entered");
00113             Length = dwLength;
00114         }
00115
00116         public void SetBuffer(string Buf)
00117         {
00118             Debug.WriteLine("INSSBufferImpl::SetBuffer entered");
00119             if(Buf!=null)
00120             {
00121                 try
00122                 {
00123                     Buffer = Convert.FromBase64String(Buf);
00124           Length = (uint)Buffer.Length;
00125                 }
00126                 catch(Exception e)
00127                 {
00128                     Debug.WriteLine(e);
00129                 }
00130
00131             }
00132       Debug.WriteLine("INSSBufferImpl::SetBuffer ended");
00133         }
00134
00135     }
00136
00137
00138   class IWMSCacheItemDescriptorImpl : IWMSCacheItemDescriptor
00139   {
00140     public IWMSCacheItemDescriptorImpl(IWMSCacheItemCollectionImpl collection,DataRow row)
00141     {
00142       Row = row;
00143       Collection = collection;
00144     }
00145
00146     void IWMSCacheItemDescriptor.GetCacheUrl(out string url)
00147     {
00148       url = null;
00149       try
00150       {
00151         url = Convert.ToString(Row["CacheUrl"]);
00152       }
00153       catch(Exception e)
00154       {
00155         Debug.WriteLine(e);
00156         throw new COMException("NO ERROR",1);
00157       }
00158     }
00159
00160     void IWMSCacheItemDescriptor.GetContentInformation(out IWMSContext contentinfo)
00161     {
00162       contentinfo=null;
00163       try
00164       {
00165         ContentInfo ci;
00166         Collection.Plugin.GetContentInfo(Convert.ToString(Row["OriginUrl"]),out ci);
00167         Collection.Plugin.GetContentInfoContext(ci,out contentinfo);
00168       }
00169       catch(Exception e)
00170       {
00171         Debug.WriteLine(e);
00172         throw new COMException("NO ERROR",1);
00173       }
00174     }
00175
00176     void IWMSCacheItemDescriptor.GetContentSize(out int sizeLow, out int sizeHigh)
00177     {
00178       sizeLow = sizeHigh = 0;
00179       try
00180       {
00181         sizeLow = sizeHigh = 0;
00182       }
00183       catch(Exception e)
00184       {
00185         Debug.WriteLine(e);
00186         throw new COMException("NO ERROR",1);
00187       }
00188     }
00189
00190     void IWMSCacheItemDescriptor.GetOriginUrl(out string url)
00191     {
00192       url = null;
00193       try
00194       {
00195         url = Convert.ToString(Row["OriginUrl"]);
00196       }
00197       catch(Exception e)
00198       {
00199         Debug.WriteLine(e);
00200         throw new COMException("NO ERROR",1);
00201       }
00202     }
00203
00204     DataRow Row;
00205     IWMSCacheItemCollectionImpl Collection;
00206   }
00207
00208   class IWMSCacheItemCollectionImpl : IWMSCacheItemCollection
00209   {
00210     static string strSel = "ContentType%2 = 0";
00211     public IWMSCacheItemCollectionImpl(CacheProxyPlugin plugin,DataTable dt)
00212     {
00213       Plugin = plugin;
00214       DT = dt;
00215     }
00216
00217     void IWMSCacheItemCollection.GetCount(out int count)
00218     {
00219       // return the count of the Cache Table entries
00220       // we have to return the count of only the Cache downloads and have to exclude the
00221       // Broadcast specific cache information
00222       try
00223       {
00224         DataRow[] rows = DT.Select(strSel);
00225         count = rows.Length;
00226       }
00227       catch(Exception e)
00228       {
00229         count = 0;
00230         Debug.WriteLine(e);
00231         throw new COMException("NO ERROR",1);
00232       }
00233     }
00234
00235     void IWMSCacheItemCollection.GetItem(int index, out IWMSCacheItemDescriptor cacheItem)
00236     {
00237       cacheItem = null;
00238       try
00239       {
00240         DataRow[] rows = DT.Select(strSel);
00241         if((index <0)||(index >= rows.Length))
00242         {
00243           throw new COMException("NO ERROR",1);
00244         }
00245         cacheItem = new IWMSCacheItemDescriptorImpl(this,rows[index]) as IWMSCacheItemDescriptor;
00246       }
00247       catch(Exception e)
00248       {
00249         Debug.WriteLine(e);
00250         throw new COMException("NO ERROR",1);
00251       }
00252     }
00253
00254     DataTable DT;
00255     public CacheProxyPlugin Plugin;
00256   }
00257
00258     [Guid("1976C73A-4B3A-4738-8B84-1C5545CE80EC")]
00259     /// <summary>
00260     /// Summary description for Class1.
00261     /// </summary>
00262
00263     public class CacheProxyPlugin : IWMSBasicPlugin, IWMSCacheProxy, IWMSCacheProxyServerCallback, IWMSProxyContext
00264     {
00265         static readonly string strGuid = "{1976C73A-4B3A-4738-8B84-1C5545CE80EC}";
00266         static readonly string strSubKey1 = "SOFTWARE\\Microsoft\\Windows Media\\Server\\RegisteredPlugins\\Cache Proxy\\" + strGuid;
00267         static readonly string strSubKey2 = "CLSID\\" + strGuid + "\\Properties";
00268         static readonly string strPluginName = "WMS SDK Sample C# Cache Proxy Plug-in";
00269
00270         IWMSClassObject         ClassObject;
00271         IWMSCacheProxyServer    CacheProxyServer;
00272
00273         // the xml that stores all the configuration details as well as the cache database
00274         string                  ConfigPath;
00275         string                  DatabasePath; // xml file that saves the cache database
00276
00277         CachePluginAdmin        AdminSettings;
00278         DataSet                 DS;
00279
00280         static string GetStringFromNSSBuffer( INSSBuffer NsBuffer)
00281         {
00282       Debug.WriteLine("CacheProxyPlugin::GetStringFromNSSBuffer entered");
00283             uint bufSize;
00284             IntPtr pBuf = IntPtr.Zero;
00285             NsBuffer.GetBufferAndLength( out pBuf, out bufSize );
00286             byte[] Buf = new byte[bufSize];
00287             Marshal.Copy(pBuf,Buf,0,(int)bufSize);
00288             /*
00289             string s = Marshal.PtrToStringUni( pBuf, (int) bufSize / 2 );
00290             return s;
00291             */
00292             return Convert.ToBase64String(Buf,0,(int)bufSize);
00293
00294         }
00295
00296         void CreateCacheTable()
00297         {
00298       Debug.WriteLine("CacheProxyPlugin::CreateCacheTable entered");
00299             // create a table and add columns for it under CacheDatabase Node
00300             DataTable dt = new DataTable("CachedItems");
00301       DataColumn col = dt.Columns.Add("OriginUrl",typeof(string));
00302       dt.Columns.Add("CacheUrl",typeof(string));
00303             dt.Columns.Add("ContentSize",typeof(System.Int64));
00304             dt.Columns.Add("ContentType",typeof(int));
00305             dt.Columns.Add("CacheFlags",typeof(int));
00306             dt.Columns.Add("ExpirationTime",typeof(System.DateTime));
00307             dt.Columns.Add("LastModified",typeof(System.DateTime));
00308             dt.Columns.Add("SubscriptionFlag",typeof(int));
00309             dt.Columns.Add("EntityTags",typeof(string));
00310             dt.Columns.Add("CDLData",typeof(string));
00311
00312       col.Unique = true;
00313       dt.PrimaryKey = new DataColumn[]{col};
00314
00315             DS = new DataSet("SampleCachePlugin");
00316             DS.Tables.Add(dt);
00317
00318       // we add a dummy row to this file so that
00319       // next inserts won't get confused by mismatched columns etc
00320       object[] obj = {"test","test",0,0,0,DateTime.Now,DateTime.Now,0,"test","test"};
00321       DataRow dr = dt.NewRow();
00322       dr.ItemArray = obj;
00323         }
00324
00325     void CreateReverseProxyTable()
00326     {
00327       Debug.WriteLine("CacheProxyPlugin::CreateReverseProxyTable entered");
00328       // create a table and add columns for it under CacheDatabase Node
00329       DataTable dt = new DataTable("ReverseProxyEntries");
00330       DataColumn col = dt.Columns.Add("OriginUrl",typeof(string));
00331       dt.Columns.Add("CacheUrl",typeof(string));
00332       dt.Columns.Add("ContentSize",typeof(System.Int64));
00333       dt.Columns.Add("ContentType",typeof(int));
00334       dt.Columns.Add("CacheFlags",typeof(int));
00335       dt.Columns.Add("ExpirationTime",typeof(System.DateTime));
00336       dt.Columns.Add("LastModified",typeof(System.DateTime));
00337       dt.Columns.Add("SubscriptionFlag",typeof(int));
00338       dt.Columns.Add("EntityTags",typeof(string));
00339       dt.Columns.Add("CDLData",typeof(string));
00340
00341       col.Unique = true;
00342       dt.PrimaryKey = new DataColumn[]{col};
00343
00344       DS = new DataSet("SampleCachePlugin");
00345       DS.Tables.Add(dt);
00346
00347       // we add a dummy row to this file so that
00348       // next inserts won't get confused by mismatched columns etc
00349       object[] obj = {"test","test",0,0,0,DateTime.Now,DateTime.Now,0,"test","test"};
00350       DataRow dr = dt.NewRow();
00351       dr.ItemArray = obj;
00352       dt.Rows.Add(dr);
00353     }
00354
00355         void CreatePlaylistTable()
00356         {
00357       Debug.WriteLine("CacheProxyPlugin::CreatePlaylistTable entered");
00358             DataTable dt2 = new DataTable("PlaylistEntries");
00359             DataColumn col2 = dt2.Columns.Add("OriginUrl",typeof(string));
00360             DataColumn col3 = dt2.Columns.Add("CacheID",typeof(string));
00361             dt2.Columns.Add("CDLData",typeof(string));
00362             dt2.Columns.Add("CacheUrl",typeof(string));
00363
00364       dt2.PrimaryKey = new DataColumn[] {col2,col3};
00365
00366             if(DS==null)
00367             {
00368                 DS = new DataSet("SampleCachePlugin");
00369             }
00370             DS.Tables.Add(dt2);
00371
00372       object[] obj = {"test","test","test","test"};
00373       DataRow dr = dt2.NewRow();
00374       dr.ItemArray = obj;
00375         }
00376
00377         // creates the config document if it doesn't exist
00378         // otherwise loads it from disk
00379         void LoadConfig()
00380         {
00381       Debug.WriteLine("CacheProxyPlugin::LoadConfig entered");
00382             Console.WriteLine( "LoadConfig entered" );
00383
00384             // get the module path and replace extension with xml
00385             string Path = Assembly.GetExecutingAssembly().Location;
00386             string Dir = Path.Substring(0,Path.LastIndexOf('.'));
00387             ConfigPath = Dir + ".xml";
00388             DatabasePath = Dir+"database"+".xml";
00389
00390             try
00391             {
00392                 Console.WriteLine( "Attempting to load config file {0}", ConfigPath );
00393
00394                 // Load configuration from file
00395
00396                 AdminSettings = new CachePluginAdmin();
00397
00398                 // Choose one or the other means of persistence
00399                 if( ! AdminSettings.LoadSettingsFromXmlFile( ConfigPath ) )
00400                 {
00401                     Console.WriteLine( "Failed to read XML file.  Reading from server namespace." );
00402                     AdminSettings.LoadSettingsFromServerNamespace();
00403                 }
00404
00405                 IWMSCacheAdmin cacheAdmin = ( IWMSCacheAdmin ) AdminSettings;
00406                 Console.WriteLine( "AdminSettings loaded: diskquota: " + cacheAdmin.DiskQuota );
00407
00408                 MyChangeEventHandler = new CachePluginAdmin.ModifySettingsEventHandler( PersistSettings );
00409                 AdminSettings.RegisterChangeHandler( MyChangeEventHandler );
00410             }
00411             catch(Exception e)
00412             {
00413                 Console.WriteLine( "ASSERT1: " + e.Message + e.StackTrace );
00414                 //load failed, we will treat this as a new file and save it
00415
00416             }
00417
00418             try
00419             {
00420                 DS = new DataSet("SampleCachePlugin");
00421                 DS.ReadXml(DatabasePath, XmlReadMode.ReadSchema);
00422             }
00423             catch(Exception e)
00424             {
00425                 Console.WriteLine( "ASSERT2: " + e.Message + e.StackTrace );
00426         CreateCacheTable();
00427         CreatePlaylistTable();
00428             }
00429       File.Delete(DatabasePath);
00430         }
00431
00432         public CacheProxyPlugin()
00433         {
00434       Debug.WriteLine("CacheProxyPlugin::CacheProxyPlugin entered");
00435         }
00436
00437         [ComRegisterFunctionAttribute]
00438         public static void RegisterFunction(Type t)
00439         {
00440             Debug.WriteLine("CacheProxyPlugin::RegisterFunction entered");
00441             try
00442             {
00443                 RegistryKey regHKLM = Registry.LocalMachine;
00444                 regHKLM = regHKLM.CreateSubKey( strSubKey1 );
00445                 regHKLM.SetValue(null, strPluginName);
00446
00447                 RegistryKey regHKCR = Registry.ClassesRoot;
00448                 regHKCR = regHKCR.CreateSubKey( strSubKey2 );
00449                 regHKCR.SetValue("Name", strPluginName);
00450                 regHKCR.SetValue("Author", "Microsoft Corporation");
00451                 regHKCR.SetValue("CopyRight", "Copyright (C) Microsoft Corporation. All rights reserved.");
00452         regHKCR.SetValue("Description", "Enables you to configure Cache/Proxy");
00453                 regHKCR.SetValue("UnsupportedLoadTypes", 0x02);
00454             }
00455             catch(Exception error)
00456             {
00457                 Console.WriteLine( "Error Registering DLL. Error " + error.Message );
00458             }
00459         }
00460
00461         [ComUnregisterFunctionAttribute]
00462         public static void UnRegisterFunction(Type t)
00463         {
00464       Debug.WriteLine("CacheProxyPlugin::UnRegisterFunction entered");
00465             try
00466             {
00467                 RegistryKey regHKLM = Registry.LocalMachine;
00468                 regHKLM.DeleteSubKey( strSubKey1 );
00469             }
00470             catch( Exception )
00471             {
00472                 // ignore error for deleting sub key
00473             }
00474
00475             try
00476             {
00477                 RegistryKey regHKCR = Registry.ClassesRoot;
00478                 regHKCR.DeleteSubKeyTree( strSubKey2 );
00479             }
00480             catch( Exception )
00481             {
00482                 // ignore error for deleting sub key
00483             }
00484         }
00485
00486         void IWMSBasicPlugin.InitializePlugin(IWMSContext pServerContext,
00487             WMSNamedValues pNamedValues,
00488             IWMSClassObject pClassFactory)
00489         {
00490       Debug.WriteLine("CacheProxyPlugin::InitializePlugin entered");
00491             Console.WriteLine( "IWMSBasicPlugin.InitializePlugin entered" );
00492             ClassObject = pClassFactory;
00493             Type t = typeof(IWMSCacheProxyServer);
00494             Guid guid = t.GUID;
00495             Object obj;
00496             pServerContext.GetAndQueryIUnknownValue(WMSDefines.WMS_SERVER_CACHE_MANAGER,WMSDefines.WMS_SERVER_CACHE_MANAGER_ID,
00497                 ref guid,out obj ,0);
00498             CacheProxyServer = (IWMSCacheProxyServer)obj;
00499
00500       //load config file
00501             LoadConfig();
00502             if( null != AdminSettings )
00503             {
00504                 AdminSettings.NamedValues = pNamedValues;
00505             }
00506         }
00507
00508         void IWMSBasicPlugin.EnablePlugin(ref int flags,ref int heartbeat )
00509         {
00510       Debug.WriteLine("WMSBasicPlugin.EnablePlugin entered");
00511         }
00512
00513         void IWMSBasicPlugin.DisablePlugin()
00514         {
00515       Debug.WriteLine("WMSBasicPlugin.DisablePlugin entered");
00516         }
00517
00518         CachePluginAdmin.ModifySettingsEventHandler MyChangeEventHandler;
00519
00520         public void PersistSettings( string strName, object objValue )
00521         {
00522             if( null != AdminSettings )
00523             {
00524                 AdminSettings.PersistNameValToServerNamespace( strName, objValue );
00525             }
00526         }
00527
00528         object IWMSBasicPlugin.GetCustomAdminInterface()
00529         {
00530             Debug.WriteLine("IWMSBasicPlugin.GetCustomAdminInterface entered");
00531             IWMSCacheAdmin CacheAdmin = null;
00532             try
00533             {
00534                 CacheAdmin = ( IWMSCacheAdmin ) AdminSettings;
00535             }
00536             catch( Exception e )
00537             {
00538                 Console.WriteLine( "EXCEPTION: " + e.Message + e.StackTrace );
00539                 AdminSettings = null;
00540             }
00541             finally
00542             {
00543                 CacheAdmin = null;
00544             }
00545             return( ( object ) AdminSettings );
00546         }
00547
00548         void IWMSBasicPlugin.OnHeartbeat()
00549         {
00550       Debug.WriteLine("IWMSBasicPlugin.OnHeartbeat entered");
00551         }
00552
00553         void IWMSBasicPlugin.ShutdownPlugin()
00554         {
00555       Debug.WriteLine("IWMSBasicPlugin.ShutdownPlugin entered");
00556       File.Delete(DatabasePath);
00557       DS.WriteXml(DatabasePath,XmlWriteMode.WriteSchema);
00558         }
00559
00560         //
00561         // IWMSCacheProxy
00562         //
00563         void IWMSCacheProxy.QueryCache(string bstrOriginUrl ,
00564             IWMSContext pUserContext ,
00565             IWMSCommandContext pCommandContext ,
00566             IWMSContext pPresentationContext ,
00567             int lQueryType ,
00568             IWMSCacheProxyCallback pCallback ,
00569             object varContext )
00570         {
00571       Debug.WriteLine("IWMSCacheProxy.QueryCache entered");
00572             // we simply return a hard coded URL for the request WMS_CACHE_QUERY_OPEN for now
00573             int nFlag = (int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_OPEN;
00574             int nOpen = lQueryType & nFlag;
00575             int nGCI = lQueryType & ((int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_GET_CONTENT_INFO);
00576       int nReverseProxy = lQueryType & ((int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_REVERSE_PROXY);
00577
00578             // either open or GCI is called
00579             // for GCI we don't care about CompareContentInformation
00580             // if not upto date, we treat as a miss
00581       if((nOpen!=0)||(nGCI!=0))
00582       {
00583         // allocate ContentInfoContext and DataContainerObject
00584         // stuff it with the information
00585         // and call back
00586         IWMSContext Context;
00587         WMS_CACHE_QUERY_RESPONSE Response = WMS_CACHE_QUERY_RESPONSE.WMS_CACHE_QUERY_MISS;
00588
00589         ContentInfo ci;
00590         //gets allocated here
00591         GetContentInfo(bstrOriginUrl,out ci);
00592         ci.CacheProxyCallback = pCallback;
00593         ci.varContext = varContext;
00594         GetContentInfoContext(ci,out Context);
00595
00596         bool bQueryCache = true;
00597         bool bOnDemand = true;
00598         if((ci.CacheUrl!=null) && (nReverseProxy==0)) // there is something in the cache
00599         {
00600           // if content is not expired, this is a hit
00601           DateTime now = DateTime.Now;
00602           Debug.WriteLine(string.Format("Current local time={0}",now));
00603           //covert to UTC time
00604           now = now.ToUniversalTime();
00605           Debug.WriteLine(string.Format("Current UTC time={0}",now));
00606
00607           Debug.WriteLine(string.Format("Expiration time={0}",ci.ExpirationTime));
00608           if(ci.ExpirationTime > now)
00609           {
00610             if((ci.ContentType & 1 )!=0) // it's a brodcast content
00611             {
00612               Response = WMS_CACHE_QUERY_RESPONSE.WMS_CACHE_QUERY_HIT_PLAY_BROADCAST;
00613               bOnDemand = false;
00614             }
00615             else
00616             {
00617               Response = WMS_CACHE_QUERY_RESPONSE.WMS_CACHE_QUERY_HIT_PLAY_ON_DEMAND;
00618               bOnDemand = true;
00619             }
00620           }
00621           else // content appears expired, we will have to call CompareContentInformation
00622           {
00623             if(nOpen!=0) // only for open queries
00624             {
00625               bQueryCache = false;
00626             }
00627           }
00628         }
00629
00630         if(bQueryCache)
00631         {
00632           string CacheUrl = ci.CacheUrl;
00633           if(bOnDemand)
00634           {
00635             CacheUrl = string.Format("file://{0}",ci.CacheUrl);
00636           }
00637           pCallback.OnQueryCache( 0,
00638             Response,
00639             CacheUrl,
00640             Context,
00641             null,
00642             varContext);
00643         }
00644         else
00645         {
00646           CacheProxyServer.CompareContentInformation(bstrOriginUrl,Context,pPresentationContext,
00647             this,null,this,(object)ci);
00648         }
00649       }
00650       else
00651       {
00652         // see of this is for event propagation
00653         int nCacheEvent = lQueryType & ((int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_CACHE_EVENT);
00654         int nLocalEvent = lQueryType & ((int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_LOCAL_EVENT);
00655         if((nCacheEvent | nLocalEvent)!=0)
00656         {
00657           // we declare it as a miss
00658           // and on QCP, we ask the cachemanager to forward it
00659           WMS_CACHE_QUERY_RESPONSE Response = WMS_CACHE_QUERY_RESPONSE.WMS_CACHE_QUERY_MISS;
00660           pCallback.OnQueryCache( 0,
00661             Response,
00662             bstrOriginUrl,
00663             null,
00664             null,
00665             varContext);
00666         }
00667
00668       }
00669
00670             return;
00671         }
00672
00673         void IWMSCacheProxy.QueryCacheMissPolicy ( string bstrOriginUrl ,
00674             IWMSContext pUserContext ,
00675             IWMSCommandContext pCommandContext ,
00676             IWMSContext pPresentationContext ,
00677             object pCachePluginContext ,
00678             int lQueryType ,
00679             IWMSCacheProxyCallback pCallback ,
00680             object varContext )
00681         {
00682       Debug.WriteLine("IWMSCacheProxy.QueryCacheMissPolicy entered");
00683             int nOpenFlag = (int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_OPEN;
00684             int nGCI = lQueryType & ((int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_GET_CONTENT_INFO);
00685       int nReverseProxy = lQueryType & ((int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_REVERSE_PROXY);
00686             ContentInfo ci = new ContentInfo(bstrOriginUrl,null);
00687             if((nOpenFlag & lQueryType)!=0) // open query
00688             {
00689         if(nReverseProxy==0) //normal mode
00690         {
00691           // get content information
00692           ci.CacheProxyCallback = pCallback;
00693           ci.varContext = varContext;
00694           CacheProxyServer.GetContentInformation(bstrOriginUrl,pPresentationContext,null,
00695             null,this,ci);
00696         }
00697         else // it's a reverse proxy mode
00698         {
00699           // we simply look up our table to see if there is a mapping between the requested
00700           //Url and the RP url and return it
00701           // we distinguish the table entry if it's a reverse proxy or not by
00702           // checking the CDL data
00703           // we store a special string "ReverseProxy" there for the distinction
00704           // one can simply add another entry in the table to be safer
00705           // as there might be some CDL data written as "ReverseProxy" !!
00706           ContentInfo ciRP = null;
00707           GetContentInfo(bstrOriginUrl,out ciRP);
00708           WMS_CACHE_QUERY_MISS_RESPONSE Response = WMS_CACHE_QUERY_MISS_RESPONSE.WMS_CACHE_QUERY_MISS_PLAY_ON_DEMAND;
00709           if((ciRP.ContentType & 1 )!=0) // it's a brodcast content
00710           {
00711             Response = WMS_CACHE_QUERY_MISS_RESPONSE.WMS_CACHE_QUERY_MISS_PLAY_BROADCAST;
00712           }
00713           else
00714           {
00715             Response = WMS_CACHE_QUERY_MISS_RESPONSE.WMS_CACHE_QUERY_MISS_PLAY_ON_DEMAND;
00716           }
00717
00718           IWMSContext ContentInfoContext = null;
00719           GetContentInfoContext(ci,out ContentInfoContext);
00720           pCallback.OnQueryCacheMissPolicy(0,Response,ciRP.CacheUrl,null,ContentInfoContext,varContext);
00721
00722         }
00723
00724             }
00725             if((nGCI & lQueryType)!=0) // GCI query from downstream server
00726             {
00727                 WMS_CACHE_QUERY_MISS_RESPONSE Response = WMS_CACHE_QUERY_MISS_RESPONSE.WMS_CACHE_QUERY_MISS_FORWARD_REQUEST;
00728                 IWMSContext ContentInfoContext = null;
00729                 GetContentInfoContext(ci,out ContentInfoContext);
00730                 pCallback.OnQueryCacheMissPolicy(0,Response,bstrOriginUrl,null,ContentInfoContext,varContext);
00731             }
00732
00733
00734             if((lQueryType & (int)WMS_CACHE_QUERY_TYPE_FLAGS.WMS_CACHE_QUERY_CACHE_EVENT)!=0)
00735             {
00736                 pCallback.OnQueryCacheMissPolicy(0,WMS_CACHE_QUERY_MISS_RESPONSE.WMS_CACHE_QUERY_MISS_FORWARD_REQUEST,
00737           null,this,null,varContext);
00738             }
00739
00740             return;
00741         }
00742
00743         void IWMSCacheProxy.RemoveCacheItem(
00744             string stringOriginUrl,
00745             IWMSCacheProxyCallback pCallback,
00746             object varContext
00747             )
00748         {
00749       Debug.WriteLine("IWMSCacheProxy.RemoveCacheItem entered");
00750             RemoveEntryFromDatabase(stringOriginUrl,true);
00751             pCallback.OnRemoveCacheItem(0,varContext);
00752             return;
00753         }
00754
00755         void IWMSCacheProxy.RemoveAllCacheItems(
00756             IWMSCacheProxyCallback pCallback,
00757             object varContext
00758             )
00759         {
00760       Debug.WriteLine("IWMSCacheProxy.RemoveAllCacheItems entered");
00761             DataTable dt = DS.Tables["CachedItems"];
00762             DataRow[] drows = dt.Select();
00763             foreach(DataRow row in drows)
00764             {
00765                 string File = Convert.ToString(row["OriginUrl"]);
00766                 RemoveEntryFromDatabase(File,true);
00767             }
00768             pCallback.OnRemoveAllCacheItems(0,varContext);
00769             return;
00770         }
00771
00772         void IWMSCacheProxy.AddCacheItem( string bstrOriginUrl ,
00773             string bstrPrestuffUrl ,
00774             int lExpiration ,
00775             int lBandwidth ,
00776             int lRemoteEventFlags ,
00777             IWMSCacheProxyCallback pCallback ,
00778             object varContext )
00779         {
00780       Debug.WriteLine("IWMSCacheProxy.AddCacheItem entered");
00781             //first remove the entry from database
00782             ContentInfo ci = new ContentInfo(bstrOriginUrl,bstrPrestuffUrl);
00783             ci.lExpiration = lExpiration;
00784
00785             IWMSContext pPresentationContext=null;
00786             Type t = typeof(IWMSContext);
00787             Guid guid = t.GUID;
00788             System.IntPtr punk;
00789             ClassObject.AllocIWMSContext(ref guid,WMS_CONTEXT_TYPE.WMS_PRESENTATION_CONTEXT_TYPE,null,
00790                 out punk);
00791             pPresentationContext = (IWMSContext)Marshal.GetObjectForIUnknown(punk);
00792
00793             CacheProxyServer.GetContentInformation(bstrOriginUrl,pPresentationContext,null,
00794                 null,this,ci);
00795
00796
00797             return;
00798         }
00799
00800         void IWMSCacheProxy.QuerySpaceForCacheItem( int lContentSizeLow ,
00801             int lContentSizeHigh ,
00802             out System.Boolean pvarfSpaceAvail )
00803         {
00804       Debug.WriteLine("IWMSCacheProxy.QuerySpaceForCacheItem entered");
00805             pvarfSpaceAvail = true;
00806             return;
00807         }
00808
00809         void IWMSCacheProxy.FindCacheItem( string bstrOriginUrl ,
00810             out IWMSCacheItemDescriptor ppCacheItemDescriptor )
00811         {
00812       Debug.WriteLine("IWMSCacheProxy.FindCacheItem entered");
00813             ppCacheItemDescriptor = null;
00814
00815             return;
00816         }
00817
00818         void IWMSCacheProxy.CreateCacheItemCollection( out IWMSCacheItemCollection ppCacheItemCollection )
00819         {
00820       Debug.WriteLine("IWMSCacheProxy.CreateCacheItemCollection entered");
00821             IWMSCacheItemCollectionImpl obj = new IWMSCacheItemCollectionImpl(this,DS.Tables["CachedItems"]);
00822       ppCacheItemCollection = obj as IWMSCacheItemCollection;
00823             return;
00824         }
00825
00826         void IWMSCacheProxy.OnCacheClientClose( int resultHr ,
00827             IWMSContext pUserContext ,
00828             IWMSContext pPresentationContext )
00829         {
00830       Debug.WriteLine("IWMSCacheProxy.OnCacheClientClose entered");
00831             return;
00832         }
00833
00834     void GetContentInfoFromContext(IWMSContext pContentInfo, ref ContentInfo ci)
00835         {
00836       Debug.WriteLine("CacheProxyPlugin::GetContentInfoFromContext entered");
00837             int nFlag=0;
00838             int lCacheFlags=0;
00839             IWMSDataContainerVersion DCV = null;
00840             Type t = typeof(IWMSDataContainerVersion);
00841             Guid guid = t.GUID;
00842             object odcv = (object)DCV;
00843             pContentInfo.GetAndQueryIUnknownValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION,
00844         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION_ID,ref guid,out odcv, 0);
00845             DCV = (IWMSDataContainerVersion)odcv;
00846             DCV.GetCacheFlags(out lCacheFlags);
00847             nFlag = lCacheFlags & (int)WMS_DATA_CONTAINER_VERSION_CACHE_FLAGS.WMS_DATA_CONTAINER_VERSION_ALLOW_PROXY_CACHING;
00848
00849             ci.CacheFlags = lCacheFlags;
00850             //content size
00851             int nLowVal=0, nHighVal=0;
00852             DCV.GetContentSize(out nLowVal,out nHighVal);
00853             ci.ContentSize = nLowVal;
00854
00855             //content type
00856             int nContentType = 0;
00857             pContentInfo.GetLongValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE,
00858         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE_ID,out nContentType,0);
00859             ci.ContentType = nContentType;
00860
00861             //expiration time
00862             DateTime time = new DateTime(0);
00863
00864       //last modified
00865       DCV.GetLastModifiedTime(out time);
00866       ci.LastModified = time;
00867
00868       //following call throws exception
00869       // when this is a bpp sourcing from encoder
00870       // so we don't call it based on the lastmodified time
00871
00872       if(((ci.ContentType &1)!=0) && time.Year==1899)
00873       {
00874       }
00875       else
00876       {
00877         DCV.GetExpirationTime(out time);
00878         try
00879         {
00880           ci.ExpirationTime = time;
00881         }
00882         catch(Exception e)
00883         {
00884           //if this call fails, we just ignore
00885           Debug.WriteLine(e);
00886         }
00887       }
00888             //Subscription flags
00889             int nSubFlag=0;
00890             pContentInfo.GetLongValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_EVENT_SUBSCRIPTIONS
00891         ,WMSDefines.WMS_CACHE_CONTENT_INFORMATION_EVENT_SUBSCRIPTIONS_ID,out nSubFlag,0);
00892             ci.SubscriptionFlag = nSubFlag;
00893
00894       //clear previous entries
00895       ci.EntityTags.Clear();
00896             int nTagCount = 0;
00897             DCV.GetEntityTagCount(out nTagCount);
00898             for(int i=0;i<nTagCount;i++)
00899             {
00900                 string tag;
00901                 DCV.GetEntityTag(i,out tag);
00902                 ci.EntityTags.Insert(i,tag);
00903             }
00904         }
00905
00906         //
00907         // IWMSCacheProxyServerCallback
00908         //
00909         void IWMSCacheProxyServerCallback.OnGetContentInformation(
00910             int lHr,
00911             IWMSContext pContentInfo,
00912             object varContext
00913             )
00914         {
00915       Debug.WriteLine("IWMSCacheProxyServerCallback::OnGetContentInformation entered");
00916             int nFlag=0;
00917             ContentInfo ci = (ContentInfo)varContext;
00918       bool bAddCacheItem = false;
00919       int nRetHr = lHr;
00920             // if we are called from the result of AddCacheItem, the lExpiration variable won't be 0
00921             // and we would simply call DownloadContent
00922             if(ci.lExpiration!=0) // Call result of AddCacheIrtem
00923             {
00924                 bAddCacheItem=true;
00925                 lHr=0;
00926             }
00927             // check the flags and if allowed
00928             // download the content and save it locally
00929       if(lHr==0) // would be E_ACCESSDENIED or something
00930         // if we didn't get content info
00931       {
00932         // if we are not allowed to cache the content
00933         // we simply set up proxy on demand datapath
00934         // else we store the information and ask cache manager
00935         // to download the content
00936         GetContentInfoFromContext(pContentInfo, ref ci);
00937         nFlag = ci.CacheFlags & (int)WMS_DATA_CONTAINER_VERSION_CACHE_FLAGS.WMS_DATA_CONTAINER_VERSION_ALLOW_PROXY_CACHING;
00938
00939         if((nFlag!=0)||(bAddCacheItem))
00940         {
00941           // proxying is allowed
00942           // let's get all the content information
00943           // and ask the cache manager to download the content
00944           if((!bAddCacheItem)||(bAddCacheItem && (ci.CacheUrl==null)))
00945           {
00946             ci.CacheUrl = "c:\\WMSCache\\test";
00947           }
00948
00949           //we check first from the database if the dowloading is already in progress
00950           // and cll for downloading the content only if there is no active
00951           // downloading going on
00952           if(!IsDownloadInProgress(ci))
00953           {
00954             // add to the database that we are downloading
00955             AddForDownload(ci);
00956             CacheProxyServer.DownloadContent(ci.OriginUrl,ci.CacheUrl,0,0,0,0,this,
00957               null,this,ci);
00958           }
00959           else
00960           {
00961             Debug.WriteLine("download arlready in progress");
00962           }
00963         }
00964         // if this is a broadcast content, we are not going to download it
00965         // so we simply store the content information in the database with
00966         // empty CacheUrl, so when next request comes, we get a hit so
00967         // we can reply accordingly
00968         if((ci.ContentType & 1)!=0)
00969         {
00970           UpdateTable(ci);
00971         }
00972       }
00973       else
00974       {
00975         Debug.WriteLine(string.Format("HRESULT for CacheProxyPlugin::IWMSCacheProxyServerCallback.OnGetContentInformation = {0}",
00976           lHr.ToString("X")));
00977         if(lHr==-2147024891)
00978           nRetHr=0;
00979       }
00980
00981             // check if stream splitting is allowed
00982             // if so we ask cache manager to set up a brodcast connection with the player
00983             // otherwise we go for OD
00984             WMS_CACHE_QUERY_MISS_RESPONSE MissResponse = WMS_CACHE_QUERY_MISS_RESPONSE.WMS_CACHE_QUERY_MISS_PLAY_ON_DEMAND;
00985             nFlag = ci.CacheFlags & (int)WMS_DATA_CONTAINER_VERSION_CACHE_FLAGS.WMS_DATA_CONTAINER_VERSION_ALLOW_STREAM_SPLITTING;
00986             if(nFlag!=0)
00987             {
00988                 MissResponse = WMS_CACHE_QUERY_MISS_RESPONSE.WMS_CACHE_QUERY_MISS_PLAY_BROADCAST;
00989             }
00990
00991             // ask the server to setup a proxy on-demand
00992             if(ci.CacheProxyCallback!=null)
00993             {
00994                 ci.CacheProxyCallback.OnQueryCacheMissPolicy((int)nRetHr,MissResponse
00995                     ,ci.OriginUrl,null,pContentInfo,ci.varContext);
00996             }
00997             return;
00998         }
00999
01000
01001     // query the database to see if there is any row matching the OriginUrl
01002     bool IsDownloadInProgress(ContentInfo ci)
01003     {
01004       Debug.WriteLine("CacheProxyPlugin::IsDownloadInProgress entered");
01005       try
01006       {
01007         DataTable dt = DS.Tables["CachedItems"];
01008         string filexpr = string.Format("OriginUrl = '{0}'",ci.OriginUrl);
01009         DataRow[] drows = dt.Select(filexpr);
01010         return (drows.Length!=0);
01011       }
01012       catch(Exception e)
01013       {
01014         Debug.WriteLine(e);
01015         return false;
01016       }
01017     }
01018
01019     void AddForDownload(ContentInfo ci)
01020     {
01021       Debug.WriteLine("CacheProxyPlugin::AddForDownload entered");
01022       // update the database
01023             object[] obj = {ci.OriginUrl,"Downloading",null,null,null,
01024                                null,null,null,null,null
01025                            };
01026       try
01027       {
01028         DataTable dt = DS.Tables["CachedItems"];
01029         DataRow dr = dt.NewRow();
01030         dr.ItemArray = obj;
01031         dt.Rows.Add(dr);
01032       }
01033       catch(Exception e)
01034       {
01035         Debug.WriteLine(e);
01036       }
01037     }
01038
01039         void RemoveEntryFromDatabase(ContentInfo ci,bool bDeleteFile)
01040         {
01041       Debug.WriteLine("CacheProxyPlugin::RemoveEntryFromDatabase entered");
01042       try
01043       {
01044         DataTable dt = DS.Tables["CachedItems"];
01045         string filexpr = string.Format("OriginUrl = '{0}'",ci.OriginUrl);
01046         DataRow[] drows = dt.Select(filexpr);
01047         if(drows.Length==0)
01048         {
01049           return;
01050         }
01051         // should ideally be only one row
01052         foreach(DataRow row in drows)
01053         {
01054           if(bDeleteFile)
01055           {
01056             string file = Convert.ToString(row["CacheUrl"]);
01057             File.Delete(file);
01058           }
01059           dt.Rows.Remove(row);
01060         }
01061
01062         // now delete all playlist entries if available
01063         DataTable dtPlaylist = DS.Tables["PlaylistEntries"];
01064         string filter = string.Format("OriginUrl='{0}'",ci.OriginUrl);
01065         DataRow[] rows = dtPlaylist.Select(filter);
01066         foreach(DataRow row in rows)
01067         {
01068           if(bDeleteFile)
01069           {
01070             string file = Convert.ToString(row["CacheUrl"]);
01071             File.Delete(file);
01072           }
01073           dt.Rows.Remove(row);
01074         }
01075       }
01076       catch(Exception e)
01077       {
01078         Debug.WriteLine(e);
01079       }
01080         }
01081         void RemoveEntryFromDatabase(string OriginUrl,bool bDeleteFile)
01082         {
01083       ContentInfo ci = new ContentInfo(OriginUrl,null);
01084       RemoveEntryFromDatabase(ci,bDeleteFile);
01085         }
01086
01087     void SavePlaylist(ContentInfo ci)
01088     {
01089       Debug.WriteLine("CacheProxyPlugin::SavePlaylist entered");
01090       //create a wsx file with filename same as first cache entry of the playlist file
01091       // create wsx with following format
01092       //<?wsx version="1.0"?>
01093       //<smil>
01094       //  <media src="{filename1}" />
01095       //  <media src="{filename2}" />
01096       //</smil>
01097       if(ci==null)
01098       {
01099         return;
01100       }
01101       if(ci.CDL.Count==0)
01102       {
01103         return;
01104       }
01105       string filename=string.Format("{0}.wsx",((PlaylistItem)ci.CDL[0]).CacheUrl);
01106       XmlDocument dom = new XmlDocument();
01107       //create an empty playlist
01108       dom.LoadXml("<?wsx version=\"1.0\"?><smil/>");
01109       //get the smil node
01110       XmlElement smilnode = dom.DocumentElement;
01111
01112       int i=0;
01113       foreach(Object obj in ci.CDL)
01114       {
01115         ((PlaylistItem)obj).CacheID = i;
01116         string file = ((PlaylistItem)obj).CacheUrl;
01117
01118         XmlElement elem = dom.CreateElement("media");
01119         XmlAttribute attr = dom.CreateAttribute("src");
01120         attr.Value = file;
01121         elem.Attributes.Append(attr);
01122
01123         attr = dom.CreateAttribute("CacheID");
01124         attr.Value = i.ToString();
01125         elem.Attributes.Append(attr);
01126
01127         smilnode.AppendChild(elem);
01128         i++;
01129       }
01130
01131       // now save the file
01132       string filesaved = string.Format("{0}.wsx",((PlaylistItem)ci.CDL[0]).CacheUrl);
01133       dom.Save(filesaved);
01134
01135       // set the cache URL to this file for cache hit
01136       ci.CacheUrl = filesaved;
01137     }
01138
01139     // based on the response
01140     // we reply as a hit or miss
01141     // and update database accordingly
01142
01143     void IWMSCacheProxyServerCallback.OnCompareContentInformation(
01144       int lHr,
01145       WMS_CACHE_VERSION_COMPARE_RESPONSE CompareResponse,
01146       IWMSContext pNewContentInfo,
01147       object varContext
01148       )
01149     {
01150       Debug.WriteLine("CacheProxyPlugin::IWMSCacheProxyServerCallback.OnCompareContentInformation entered");
01151       WMS_CACHE_QUERY_RESPONSE Response = WMS_CACHE_QUERY_RESPONSE.WMS_CACHE_QUERY_MISS;
01152       ContentInfo ci = (ContentInfo)varContext;
01153       // we use this content info  to call back by default
01154       // it changes if the CI in our database is valid
01155       IWMSContext pContenInfo = pNewContentInfo;
01156       // if the call failed, we have to go for protocol rollover etc
01157       if(lHr==0)
01158       {
01159         switch (CompareResponse)
01160         {
01161           case WMS_CACHE_VERSION_COMPARE_RESPONSE.WMS_CACHE_VERSION_CACHE_STALE:
01162           {
01163             RemoveEntryFromDatabase(ci,true);
01164           }
01165             break;
01166
01167           case WMS_CACHE_VERSION_COMPARE_RESPONSE.WMS_CACHE_VERSION_CACHE_UP_TO_DATE:
01168           {
01169             if((ci.ContentType & 1 )!=0) // it's a brodcast content
01170             {
01171               Response = WMS_CACHE_QUERY_RESPONSE.WMS_CACHE_QUERY_HIT_PLAY_BROADCAST;
01172             }
01173             else
01174             {
01175               Response = WMS_CACHE_QUERY_RESPONSE.WMS_CACHE_QUERY_HIT_PLAY_ON_DEMAND;
01176             }
01177             // update the database with the new information
01178             RemoveEntryFromDatabase(ci,false);
01179             GetContentInfoFromContext(pNewContentInfo,ref ci);
01180             UpdateTable(ci);
01181
01182             GetContentInfoContext(ci,out pContenInfo);
01183           }
01184             break;
01185           case WMS_CACHE_VERSION_COMPARE_RESPONSE.WMS_CACHE_VERSION_FAIL_TO_CHECK_VERSION:
01186           {
01187           }
01188             break;
01189
01190           default:
01191             break;
01192         }
01193
01194         Debug.WriteLine("CacheProxyPlugin::IWMSCacheProxyServerCallback.OnCompareContentInformation -> calling OnQueryCache");
01195
01196         // crude test...look up if we have :// embedded in the URL, if not prefix it with file://
01197         // otherwise just let it go
01198         int nIndex = ci.CacheUrl.IndexOf("://");
01199         string strCacheUrl = ci.CacheUrl;
01200         if(nIndex==-1)
01201         {
01202           strCacheUrl = string.Format("file://{0}",ci.CacheUrl);
01203         }
01204
01205         ci.CacheProxyCallback.OnQueryCache(0,Response,strCacheUrl,pContenInfo,
01206           null,ci.varContext);
01207
01208       }
01209
01210       return;
01211     }
01212
01213     void AddCDLToContext(IWMSContext pContentInfo,ContentInfo ci)
01214     {
01215       IWMSDataContainerVersion DCV = null;
01216       Type t = typeof(IWMSDataContainerVersion);
01217       Guid guid = t.GUID;
01218       object odcv = (object)DCV;
01219       /*
01220       pContentInfo.GetAndQueryIUnknownValue("WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION",
01221         3,ref guid,out odcv, 0);
01222       */
01223       pContentInfo.GetAndQueryIUnknownValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION,
01224         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION_ID,ref guid,out odcv, 0);
01225       DCV = (IWMSDataContainerVersion)odcv;
01226
01227       if(ci.EntityTags!=null)
01228       {
01229         foreach(string str in ci.EntityTags)
01230         {
01231           DCV.SetEntityTag(str);
01232         }
01233       }
01234     }
01235
01236     void IWMSCacheProxyServerCallback.OnDownloadContentProgress(
01237       int lHr,
01238       WMS_RECORD_PROGRESS_OPCODE opCode,
01239       IWMSContext pArchiveContext,
01240       object varContext
01241       )
01242     {
01243       Debug.WriteLine("CacheProxyPlugin::IWMSCacheProxyServerCallback.OnDownloadContentProgress entered");
01244       if(lHr==0)
01245       {
01246         if(opCode==WMS_RECORD_PROGRESS_OPCODE.WMS_RECORD_PROGRESS_ARCHIVE_STARTED)
01247         {
01248           INSSBuffer NSBuffer=null;
01249           Guid guid = typeof(INSSBuffer).GUID;
01250           Object obj;
01251           pArchiveContext.GetAndQueryIUnknownValue(WMSDefines.WMS_ARCHIVE_CONTENT_DESCRIPTION_LIST_BUFFER,
01252             WMSDefines.WMS_ARCHIVE_CONTENT_DESCRIPTION_LIST_BUFFER_ID,ref guid,out obj ,0);
01253           NSBuffer = (INSSBuffer)obj;
01254
01255           // get the file name
01256           string CacheFile;
01257           pArchiveContext.GetStringValue(WMSDefines.WMS_ARCHIVE_FILENAME,
01258             WMSDefines.WMS_ARCHIVE_FILENAME_ID,out CacheFile,0);
01259
01260           ContentInfo ci = (ContentInfo)varContext;
01261
01262           string s = GetStringFromNSSBuffer(NSBuffer);
01263           if((ci.ContentType & 2)==0) // not a playlist
01264           {
01265             ci.CDLData = s;
01266             ci.CacheUrl = CacheFile;
01267           }
01268           else
01269           {
01270             PlaylistItem Item = new PlaylistItem();
01271             Item.CacheUrl = CacheFile;
01272             Item.CDLData = s;
01273             ci.CDL.Add((object)Item);
01274           }
01275         }
01276       }
01277       return;
01278     }
01279
01280     void IWMSCacheProxyServerCallback.OnDownloadContentFinished(
01281       int lHr,
01282       object[] psaArchiveContexts,
01283       object varContext
01284       )
01285     {
01286       Debug.WriteLine("CacheProxyPlugin::IWMSCacheProxyServerCallback.OnDownloadContentFinished entered");
01287       if(lHr==0) // download succeeded
01288       {
01289         ContentInfo ci = (ContentInfo)varContext;
01290         // server might have renamed the specified file if there is a name collision
01291         // so we get the actual name of the file from archive context that we get
01292         if(psaArchiveContexts.Length!=0)
01293         {
01294           if((ci.ContentType & 2)==0) // it's not a playlist
01295           {
01296             IWMSContext ArchiveContext = (IWMSContext)psaArchiveContexts.GetValue(0);
01297             // get the file name
01298             string CacheFile;
01299             ArchiveContext.GetStringValue(WMSDefines.WMS_ARCHIVE_FILENAME,
01300               WMSDefines.WMS_ARCHIVE_FILENAME_ID,out CacheFile,0);
01301             ci.CacheUrl = CacheFile;
01302
01303           }
01304           else
01305           {
01306             SavePlaylist(ci);
01307           }
01308           UpdateTable(ci);
01309         }
01310
01311       }
01312       else
01313       {
01314         Debug.WriteLine(string.Format("HRESULT for CacheProxyPlugin::IWMSCacheProxyServerCallback.OnDownloadContentFinished = {0}",
01315           lHr.ToString("X")));
01316       }
01317       return;
01318     }
01319
01320         void UpdateTable(ContentInfo ci)
01321         {
01322       Debug.WriteLine("CacheProxyPlugin::UpdateTable entered");
01323             string strTags=null;
01324             for(int i=0;(ci.EntityTags!=null)&&(i<ci.EntityTags.Count);i++)
01325             {
01326                 strTags += ci.EntityTags[i];
01327                 strTags += "#";
01328             }
01329
01330             if(strTags==null)
01331             {
01332                 strTags="Test";
01333             }
01334             // update the database
01335             object[] obj = {ci.OriginUrl,ci.CacheUrl,ci.ContentSize,ci.ContentType,ci.CacheFlags,
01336                                ci.ExpirationTime,ci.LastModified,ci.SubscriptionFlag
01337                                ,strTags,ci.CDLData
01338                            };
01339             try
01340             {
01341                 DataTable dt = DS.Tables["CachedItems"];
01342         DataRow dr = dt.NewRow();
01343                 dr.ItemArray = obj;
01344
01345
01346         // we remove the previous entry which would most likely be due to the Add For Download call
01347         RemoveEntryFromDatabase(ci,false);
01348                 dt.Rows.Add(dr);
01349
01350                 // if this is a playlist file, we also need to persist the CDL information for the playlist
01351                 DataTable dt2 = DS.Tables["PlaylistEntries"];
01352
01353                 foreach(PlaylistItem Item in ci.CDL)
01354                 {
01355                     //add a row for each CDL data
01356                     DataRow dr2 = dt2.NewRow();
01357                     object[] objPlaylist =
01358                         {
01359                             ci.OriginUrl,Item.CacheID ,Item.CDLData,Item.CacheUrl
01360                         };
01361                     dr2.ItemArray = objPlaylist;
01362                     dt2.Rows.Add(dr2);
01363                 }
01364
01365             }
01366             catch(System.Exception e)
01367             {
01368                 Debug.WriteLine(e);
01369             }
01370         }
01371
01372         void IWMSCacheProxyServerCallback.OnCancelDownloadContent(
01373             int lHr,
01374             object varContext
01375             )
01376         {
01377       Debug.WriteLine("CacheProxyPlugin::IWMSCacheProxyServerCallback.OnCancelDownloadContent entered");
01378             return;
01379         }
01380
01381         //[PreserveSig] can be used as well
01382         void IWMSProxyContext.FindProxyForURL(IWMSContext pUserContext, string bstrUrl, out string pbstrProxyServer, out uint pdwProxyPort)
01383         {
01384       Debug.WriteLine("CacheProxyPlugin::IWMSProxyContext.FindProxyForURL entered");
01385             throw new COMException("NO ERROR",1);
01386         }
01387
01388         //[PreserveSig] can be used as well
01389         void IWMSProxyContext.GetCredentials(IWMSContext pUserContext, string bstrRealm, string bstrUrl, out string pbstrName, out string pbstrPassword)
01390         {
01391       Debug.WriteLine("CacheProxyPlugin::IWMSProxyContext.GetCredentials entered");
01392             pbstrName="";
01393             pbstrPassword="";
01394             throw new COMException("NO ERROR",1);
01395         }
01396
01397         // selects the row for OriginUrl
01398         // creates a ContentInfo structure based on it
01399         public void GetContentInfo(string OriginUrl, out ContentInfo ci)
01400         {
01401       Debug.WriteLine("CacheProxyPlugin::GetContentInfo entered");
01402       ci = new ContentInfo(OriginUrl,null);
01403       try
01404       {
01405         DataTable dt = DS.Tables["CachedItems"];
01406         if(dt==null)
01407         {
01408           return;
01409         }
01410
01411         string filexpr = string.Format("OriginUrl = '{0}'",OriginUrl);
01412
01413         DataRow[] drows = dt.Select(filexpr);
01414         if(drows.Length==0)
01415         {
01416           return;
01417         }
01418
01419         // FOR REVERSE PROXY DATA, WE HAVE TO HAVE THE TYPE OF CONTENT
01420         // STORED HERE AS WELL FOR THE APPROPRIATE RESPONSE
01421
01422         ci.ContentType = Convert.ToInt32(drows[0]["ContentType"]);
01423         if((ci.ContentType & 1)!=0)
01424         {
01425           ci.CacheUrl = OriginUrl;
01426         }
01427         else
01428         {
01429           ci.CacheUrl = Convert.ToString(drows[0]["CacheUrl"]);
01430         }
01431
01432         // if this string is ReverseProxy, then that means we are looking at a ReverseProxy
01433         // entry, so we should really return from here to force a cache miss
01434         ci.CDLData = Convert.ToString((drows[0]["CDLData"]));
01435         if(ci.CDLData=="ReverseProxy")
01436         {
01437           return;
01438         }
01439
01440         // we simply assume there will be only one row returned as we enforce
01441         // primary key constraint
01442
01443         ci.SubscriptionFlag = Convert.ToInt32((drows[0]["SubscriptionFlag"]));
01444         ci.LastModified = Convert.ToDateTime((drows[0]["LastModified"]));
01445         ci.ExpirationTime = Convert.ToDateTime(drows[0]["ExpirationTime"]);
01446         ci.ContentSize = Convert.ToInt64(drows[0]["ContentSize"]);
01447
01448         // get the entity tags
01449
01450         string strTags=Convert.ToString(drows[0]["EntityTags"]);
01451         int i=0, j=0;
01452         while(true)
01453         {
01454           int k = strTags.IndexOf('#',i);
01455           if(k<0)
01456           {
01457             break;
01458           }
01459           string str = strTags.Substring(i,k);
01460           ci.EntityTags.Insert(j,str);
01461           i=k+1;
01462           j++;
01463         }
01464       }
01465       catch(Exception e)
01466       {
01467         Debug.WriteLine(e);
01468
01469       }
01470         }
01471
01472
01473     public void GetContentInfoContext(ContentInfo ci, out IWMSContext Context)
01474         {
01475       Debug.WriteLine("CacheProxyPlugin::GetContentInfoContext entered");
01476             System.IntPtr punk;
01477             Type t = typeof(IWMSContext);
01478             System.Guid guid = t.GUID;
01479             ClassObject.AllocIWMSContext(ref guid,
01480                 WMS_CONTEXT_TYPE.WMS_CACHE_CONTENT_INFORMATION_CONTEXT_TYPE
01481                 ,null, out punk);
01482             Context = (IWMSContext)Marshal.GetObjectForIUnknown(punk);
01483
01484             t = typeof(IWMSDataContainerVersion);
01485             guid = t.GUID;
01486             ClassObject.CreateInstance(ref guid, out punk);
01487             IWMSDataContainerVersion DataContainer =
01488                 (IWMSDataContainerVersion)Marshal.GetObjectForIUnknown(punk);
01489             Context.SetIUnknownValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION,
01490         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION_ID,DataContainer,0);
01491
01492             Context.SetLongValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE,
01493         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE_ID,ci.ContentType,0);
01494             Context.SetLongValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_EVENT_SUBSCRIPTIONS,
01495         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_EVENT_SUBSCRIPTIONS_ID,ci.SubscriptionFlag,0);
01496             DataContainer.SetLastModifiedTime(ci.LastModified);
01497             DataContainer.SetExpirationTime(ci.ExpirationTime);
01498             DataContainer.SetCacheFlags(ci.CacheFlags);
01499             DataContainer.SetContentSize((int)ci.ContentSize,0);
01500
01501             if(ci.EntityTags!=null)
01502             {
01503                 foreach(string str in ci.EntityTags)
01504                 {
01505                     DataContainer.SetEntityTag(str);
01506                 }
01507             }
01508
01509       guid = typeof(IWMSContext).GUID;
01510       if((ci.ContentType & 2) == 0) // not a playlist
01511       {
01512         //create a CDL context and make it point to the INSSBuffer that we persisted
01513         ClassObject.AllocIWMSContext(ref guid,
01514           WMS_CONTEXT_TYPE.WMS_UNKNOWN_CONTEXT_TYPE
01515           ,null, out punk);
01516         IWMSContext CDLContext = (IWMSContext)Marshal.GetObjectForIUnknown(punk);
01517         INSSBufferImpl Buffer = new INSSBufferImpl();
01518         Buffer.SetBuffer(ci.CDLData);
01519         INSSBuffer pBuffer = Buffer as INSSBuffer;
01520         CDLContext.SetIUnknownValue("CDL",0,(object)pBuffer,2);
01521
01522         Context.SetIUnknownValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_DESCRIPTION_LISTS,
01523           WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_DESCRIPTION_LISTS_ID,(object)CDLContext,0);
01524       }
01525       else
01526       {
01527         // create CDL for each file of the playlist
01528         // get the list of entries from PlaylistItem table corresponding to this Origin URL
01529         // for each of the entry
01530         // create CDL data and stuff it with the Context
01531         // query would be like select * from PlaylistEntries where OriginUrl=ci.OriginUrl
01532         DataTable dtPlaylist = DS.Tables["PlaylistEntries"];
01533         string filter = string.Format("OriginUrl='{0}'",ci.OriginUrl);
01534         DataRow[] rows = dtPlaylist.Select(filter);
01535
01536         ClassObject.AllocIWMSContext(ref guid,
01537           WMS_CONTEXT_TYPE.WMS_UNKNOWN_CONTEXT_TYPE
01538           ,null, out punk);
01539         IWMSContext CDLContext = (IWMSContext)Marshal.GetObjectForIUnknown(punk);
01540         foreach( DataRow row in rows)
01541         {
01542
01543           INSSBufferImpl Buffer = new INSSBufferImpl();
01544           Buffer.SetBuffer(Convert.ToString(row["CDLData"]));
01545           INSSBuffer pBuffer = Buffer as INSSBuffer;
01546           CDLContext.SetIUnknownValue(Convert.ToString(row["CacheID"]),0,(object)pBuffer,2);
01547         }
01548         Context.SetIUnknownValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_DESCRIPTION_LISTS
01549           ,WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_DESCRIPTION_LISTS_ID
01550           ,(object)CDLContext,0);
01551
01552       }
01553         }
01554         bool IsContentCached(string Url, out string ReturnURL, out IWMSContext Context, out int ContentType)
01555         {
01556       Debug.WriteLine("CacheProxyPlugin::IsContentCached entered");
01557             ContentType=0;
01558             ReturnURL=null;
01559
01560             System.IntPtr punk;
01561             Type t = typeof(IWMSContext);
01562             System.Guid guid = t.GUID;
01563             ClassObject.AllocIWMSContext(ref guid,
01564                 WMS_CONTEXT_TYPE.WMS_CACHE_CONTENT_INFORMATION_CONTEXT_TYPE
01565                 ,null, out punk);
01566             Context = (IWMSContext)Marshal.GetObjectForIUnknown(punk);
01567
01568             t = typeof(IWMSDataContainerVersion);
01569             guid = t.GUID;
01570             ClassObject.CreateInstance(ref guid, out punk);
01571             IWMSDataContainerVersion DataContainer =
01572                 (IWMSDataContainerVersion)Marshal.GetObjectForIUnknown(punk);
01573
01574             Context.SetIUnknownValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION,
01575         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION_ID,DataContainer,0);
01576
01577             // search the database if the specified URL exists
01578             DataTable dt = DS.Tables["CachedItems"];
01579             if(dt==null)
01580             {
01581                 return false;
01582             }
01583
01584             string filexpr = string.Format("OriginUrl = '{0}'",Url);
01585
01586             DataRow[] drows = dt.Select(filexpr);
01587             if(drows.Length==0)
01588             {
01589                 return false;
01590             }
01591
01592             // we simply assume there will be only one row returned as we enforce
01593             // primary key constraint
01594
01595             object ob = (drows[0]["ContentType"]);
01596             int nVal = Convert.ToInt32(ob);
01597             Context.SetLongValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE,
01598         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE_ID,nVal,0);
01599             ContentType = nVal;
01600
01601
01602
01603             nVal = Convert.ToInt32((drows[0]["SubscriptionFlag"]));
01604             Context.SetLongValue(WMSDefines.WMS_CACHE_CONTENT_INFORMATION_EVENT_SUBSCRIPTIONS,
01605         WMSDefines.WMS_CACHE_CONTENT_INFORMATION_EVENT_SUBSCRIPTIONS_ID,nVal,0);
01606
01607             System.DateTime date = Convert.ToDateTime((drows[0]["LastModified"]));
01608             DataContainer.SetLastModifiedTime(date);
01609
01610             date = Convert.ToDateTime(drows[0]["ExpirationTime"]);
01611             DataContainer.SetExpirationTime(date);
01612
01613             nVal = Convert.ToInt32((drows[0]["SubscriptionFlag"]));
01614             DataContainer.SetCacheFlags(nVal);
01615
01616             System.Int64 n64Val = Convert.ToInt64(drows[0]["ContentSize"]);
01617             DataContainer.SetContentSize((int)n64Val,0);
01618             /*
01619                         string tag = Convert.ToString(drows[0]["EntityTags"]);
01620                         DataContainer.SetEntityTag(tag);
01621             */
01622
01623             string cacheurl=null;
01624             try
01625             {
01626                 cacheurl = Convert.ToString(drows[0]["CacheUrl"]);
01627             }
01628             catch(Exception e)
01629             {
01630         Debug.WriteLine(e);
01631             }
01632
01633             // there is no CacheUrl for broadcast content, so we should reply with
01634             // the OriginUrl
01635             if((ContentType & 1 )!=0) // it's a brodcast content
01636             {
01637                 ReturnURL = Url;
01638             }
01639             else
01640             {
01641                 ReturnURL = string.Format("file://{0}",cacheurl);
01642             }
01643
01644             return true;
01645
01646         }
01647
01648     }
01649 }
Generated on Wed Nov 13 2024 16:52:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: TabletPC/MultiReco/MultiReco.h Source File

  • TabletPC
  • MultiReco

MultiReco.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //  This is part of the Microsoft Tablet PC Platform SDK
00003 //  Copyright (C) 2002 Microsoft Corporation
00004 //  All rights reserved.
00005 //
00006 //  This source code is only intended as a supplement to the
00007 //  Microsoft Tablet PC Platform SDK Reference and related electronic
00008 //  documentation provided with the Software Development Kit.
00009 //  See these sources for more detailed information.
00010 //
00011 // Module:
00012 //      MultiRecoApp.h
00013 //
00014 // Description:
00015 //      The header file for the CMultiRecoApp class - the application window
00016 //      class of the MultiReco sample.
00017 //    The methods of the class are defined in the MultiReco.cpp file.
00018 //
00019 //--------------------------------------------------------------------------
00020
00021 #pragma once
00022
00023 /////////////////////////////////////////////////////////////////////////////
00024 // CMultiRecoApp
00025
00026 class CMultiRecoApp :
00027     public CWindowImpl<CMultiRecoApp>,
00028     public IInkCollectorEventsImpl<CMultiRecoApp>,
00029     public IInkRecognitionEventsImpl<CMultiRecoApp>
00030 {
00031 public:
00032     // Constants
00033     enum {
00034         // 'Recognizer' submenu index
00035         mc_iSubmenuRecognizers = 1,
00036         // child windows IDs
00037         mc_iInputWndId = 1,
00038         mc_iOutputWndId = 2,
00039         mc_iStatusWndId = 3,
00040         // recognition guide box data
00041         mc_iNumRowsCols = 100,
00042         mc_iGuideColWidth = 80,
00043         mc_iGuideRowHeight = 80,
00044         mc_cxBoxMargin = 4,
00045         mc_cyBoxMargin = 4,
00046         // pen width
00047         mc_iPenWidth = 5
00048     };
00049
00050     // Automation API interface pointers
00051     CComPtr<IInkCollector>          m_spIInkCollector;
00052     CComPtr<IInkDisp>               m_spIInkDisp;
00053     CComPtr<IInkStrokes>            m_spIInkStrokes;
00054     CComPtr<IInkCustomStrokes>      m_spIInkCustomStrokes;
00055     CComPtr<IInkRecognizerContext>  m_spIInkRecoContext;
00056     CComPtr<IInkRecognizers>        m_spIInkRecognizers;
00057     CComPtr<IInkRecognizerGuide>    m_spIInkRecoGuideLined;
00058     CComPtr<IInkRecognizerGuide>    m_spIInkRecoGuideBoxed;
00059
00060     // Child windows
00061     CInkInputWnd    m_wndInput;
00062     CRecoOutputWnd  m_wndResults;
00063     HWND            m_hwndStatusBar;
00064
00065     // Colors to be used with draw ink and output text
00066     // - different for each recognizer
00067     static const COLORREF  mc_crColors[];
00068
00069     // The name of the selected recognizer
00070     CComBSTR    m_bstrCurRecoName;
00071
00072     // The command id of the menu item corresponding to the selected recognizer
00073     UINT        m_nCmdRecognizer;
00074
00075   WCHAR   m_wchFile[MAX_PATH];        // The full path and name of the opened file
00076   WCHAR   m_wchFileTitle[MAX_PATH];   // The name and extension of the file
00077
00078     // The index of the current color in mc_crColors
00079     WORD        m_iColor;
00080
00081     // Static method that creates an object of the class
00082     static int Run(int nCmdShow);
00083
00084     // Constructor
00085     CMultiRecoApp() :
00086         m_hwndStatusBar(NULL),
00087         m_nCmdRecognizer(0),
00088         m_iColor(0)
00089     {
00090         m_wchFile[0] = m_wchFileTitle[0] = 0;
00091     }
00092
00093     // Helper methods
00094     HMENU   LoadMenu();
00095     bool    CreateChildWindows();
00096     void    CreateRecoGuides();
00097     bool    CreateRecoContext(IInkRecognizer* pIInkRecognizer);
00098     void    StartNewStrokeCollection();
00099   void  SaveStrokeCollection();
00100     void    UpdateLayout();
00101     void    UpdateStatusBar();
00102     void    UpdateFilename(WCHAR* pwsFile = NULL, WCHAR* pwsFileTitle = NULL);
00103   bool  DoOpen(bool bNew);
00104   bool  DoSave(bool bSaveAs, bool bAskUser);
00105     bool    LoadFile(IInkDisp* pInkDisp);
00106
00107
00108 // Declare the class objects' window class with NULL background.
00109 // There's no need to paint CMultiRecoApp window background because
00110 // the entire client area is covered by the child windows.
00111 DECLARE_WND_CLASS_EX(NULL, 0, -1)
00112
00113 // ATL macro's to declare which commands/messages the class is interested in.
00114 BEGIN_MSG_MAP(CMultiRecoApp)
00115     MESSAGE_HANDLER(WM_CREATE, OnCreate)
00116     MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
00117     MESSAGE_HANDLER(WM_SIZE, OnSize)
00118     MESSAGE_HANDLER(WM_CLOSE, OnClose)
00119     COMMAND_RANGE_HANDLER(ID_RECOGNIZER_FIRST, ID_RECOGNIZER_LAST, OnNewStrokes)
00120     COMMAND_ID_HANDLER(ID_CLEAR, OnClear)
00121     COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileOpen)
00122     COMMAND_ID_HANDLER(ID_FILE_OPEN, OnFileOpen)
00123     COMMAND_ID_HANDLER(ID_FILE_SAVE, OnFileSave)
00124     COMMAND_ID_HANDLER(ID_FILE_SAVEAS, OnFileSave)
00125     COMMAND_ID_HANDLER(ID_FILE_EXIT, OnExit)
00126 END_MSG_MAP()
00127
00128 public:
00129
00130     // Ink collector event handler
00131
00132     HRESULT OnStroke(
00133             IInkCursor* pIInkCursor,
00134             IInkStrokeDisp* pIInkStroke,
00135             VARIANT_BOOL* pbCancel
00136             );
00137
00138     // Recognition event handler
00139
00140     HRESULT OnRecognition(
00141             BSTR bstrRecognizedString,
00142             VARIANT vCustomParam,
00143             InkRecognitionStatus RecognitionStatus
00144             );
00145
00146     // Window message handlers
00147
00148     LRESULT OnCreate(
00149             UINT uMsg,
00150             WPARAM wParam,
00151             LPARAM lParam,
00152             BOOL& bHandled
00153             );
00154
00155     LRESULT OnDestroy(
00156             UINT uMsg,
00157             WPARAM wParam,
00158             LPARAM lParam,
00159             BOOL& bHandled
00160             );
00161
00162     LRESULT OnSize(
00163             UINT uMsg,
00164             WPARAM wParam,
00165             LPARAM lParam,
00166             BOOL& bHandled
00167             );
00168
00169     LRESULT OnClose(
00170             UINT /*uMsg*/,
00171             WPARAM /*wParam*/,
00172             LPARAM /*lParam*/,
00173             BOOL& bHandled
00174             )
00175     {
00176         // Ask user to save the last changes
00177         // Don't close if the user canceled it (DoSave returned false)
00178         bHandled = !DoSave(/*bSaveAs = */false, /*bAskUser = */ true);
00179         return 0;
00180     }
00181
00182     // Command handlers
00183
00184     LRESULT OnFileOpen(
00185             WORD /*wNotifyCode*/,
00186             WORD wID,
00187             HWND /*hWndCtl*/,
00188             BOOL& /*bHandled*/
00189             )
00190     {
00191         if (true == DoSave(/*bSaveAs = */false, /*bAskUser = */ true))
00192         {
00193             DoOpen(/*bNew = */ID_FILE_NEW == wID);
00194         }
00195         return 0;
00196     }
00197
00198     LRESULT OnFileSave(
00199             WORD /*wNotifyCode*/,
00200             WORD wID,
00201             HWND /*hWndCtl*/,
00202             BOOL& /*bHandled*/
00203             )
00204     {
00205       DoSave(/*bSaveAs = */ID_FILE_SAVEAS == wID, /*bAskUser = */ false);
00206         return 0;
00207     }
00208
00209     LRESULT OnClear(
00210             WORD /*wNotifyCode*/,
00211             WORD /*wID*/,
00212             HWND /*hWndCtl*/,
00213             BOOL& /*bHandled*/
00214             );
00215
00216     LRESULT OnExit(
00217             WORD /*wNotifyCode*/,
00218             WORD /*wID*/,
00219             HWND /*hWndCtl*/,
00220             BOOL& /*bHandled*/
00221             )
00222     {
00223         ::SendMessage(m_hWnd, WM_CLOSE, 0, 0);
00224         return 0;
00225     }
00226
00227     LRESULT OnNewStrokes(
00228             WORD wNotifyCode,
00229             WORD wID,
00230             HWND hWndCtl,
00231             BOOL& bHandled
00232             );
00233 };
00234
Generated on Wed Nov 13 2024 16:52:41 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/CapMFC/AcComm.h Source File

  • Web
  • MSAgent
  • c
  • CapMFC

AcComm.h

Go to the documentation of this file.
00001 #if !defined(AFX_AGENTCTLCOMMANDEX_H__AB8FEBA2_3841_11D2_8512_00C04FA34A14__INCLUDED_)
00002 #define AFX_AGENTCTLCOMMANDEX_H__AB8FEBA2_3841_11D2_8512_00C04FA34A14__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 // Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
00008
00009 // NOTE: Do not modify the contents of this file.  If this class is regenerated by
00010 //  Microsoft Visual C++, your modifications will be overwritten.
00011
00012 /////////////////////////////////////////////////////////////////////////////
00013 // CAgentCtlCommandEx wrapper class
00014
00015 class CAgentCtlCommandEx : public COleDispatchDriver
00016 {
00017 public:
00018   CAgentCtlCommandEx() {}   // Calls COleDispatchDriver default constructor
00019   CAgentCtlCommandEx(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
00020   CAgentCtlCommandEx(const CAgentCtlCommandEx& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
00021
00022 // Attributes
00023 public:
00024
00025 // Operations
00026 public:
00027   CString GetVoice();
00028   void SetVoice(LPCTSTR lpszNewValue);
00029   CString GetCaption();
00030   void SetCaption(LPCTSTR lpszNewValue);
00031   BOOL GetEnabled();
00032   void SetEnabled(BOOL bNewValue);
00033   BOOL GetVisible();
00034   void SetVisible(BOOL bNewValue);
00035   long GetConfidence();
00036   void SetConfidence(long nNewValue);
00037   CString GetConfidenceText();
00038   void SetConfidenceText(LPCTSTR lpszNewValue);
00039   void SetHelpContextID(long nNewValue);
00040   long GetHelpContextID();
00041   void SetVoiceCaption(LPCTSTR lpszNewValue);
00042   CString GetVoiceCaption();
00043 };
00044
00045 //{{AFX_INSERT_LOCATION}}
00046 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00047
00048 #endif // !defined(AFX_AGENTCTLCOMMANDEX_H__AB8FEBA2_3841_11D2_8512_00C04FA34A14__INCLUDED_)
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/AptServe/UtilCAR.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • AptServe

UtilCAR.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      UTILCAR.H
00003
00004   Summary:   Include file for the aggregatable COUtilityCar COM object class.
00005
00006              UTILCAR showcases the construction of the COUtilityCar COM
00007              object class with the IUnknown, ICar, and IUtility
00008              interfaces. This is done through Containment reuse of COCar's
00009              ICar interface features.
00010
00011              This multiple interface COM Object Class is achieved via the
00012              technique of nested classes: the implementation of the ICar
00013              and IUtility interfaces are nested inside of the COUtilityCar
00014              COM object class.
00015
00016              For a comprehensive tutorial code tour of this module's
00017              contents and offerings see the tutorial APTSERVE.HTM
00018              file. For more specific technical details on the internal
00019              workings see the comments dispersed throughout the module's
00020              source code.
00021
00022   Classes:   COUtilityCar
00023
00024   Functions: .
00025
00026   Origin:    3-20-96: atrent - Editor-inheritance from UTILCAR.H in
00027                the LOCSERVE Tutorial Code Sample.
00028
00029 ----------------------------------------------------------------------------
00030   This file is part of the Microsoft COM Tutorial Code Samples.
00031
00032   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00033
00034   This source code is intended only as a supplement to Microsoft
00035   Development Tools and/or on-line documentation.  See these other
00036   materials for detailed information regarding Microsoft code samples.
00037
00038   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00039   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00040   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00041   PARTICULAR PURPOSE.
00042 ==========================================================================+*/
00043
00044 #if !defined(UTILCAR_H)
00045 #define UTILCAR_H
00046
00047 #ifdef __cplusplus
00048
00049 /*O+O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O+++O
00050   ObjectClass: COUtilityCar
00051
00052   Summary:     COM Object Class for COUtilityCar COM Objects.  COM objects
00053                of this class augment COCar COM objects (which offer ICar
00054                interface features of Shift, Clutch, Speed, and Steer) with
00055                IUtility interface features (Offroad and Winch).  This
00056                COUtilityCar COM object class is constructed by containment
00057                reuse of the COCar COM object class.  The mulitple
00058                interfaces on this COM object class are constructed via
00059                the nested interface classes technique.
00060
00061   Interfaces:  IUnknown
00062                  Standard interface providing COM object features.
00063                ICar
00064                  Basic Car operation features.
00065                IUtility
00066                  Sport-utility vehicle offroad features.
00067
00068   Aggregation: Yes, COUtilityCar COM objects are aggregatable by passing
00069                a non-NULL pUnkOuter IUnknown pointer into the constructor.
00070 O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O---O-O*/
00071 class COUtilityCar : public IUnknown
00072 {
00073   public:
00074     // Main Object Constructor & Destructor.
00075     COUtilityCar(IUnknown* pUnkOuter, CServer* pServer);
00076     ~COUtilityCar(void);
00077
00078     // A general method for initializing a newly created COUtilityCar.
00079     HRESULT Init(void);
00080
00081     // IUnknown methods. Main object, non-delegating.
00082     STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00083     STDMETHODIMP_(ULONG) AddRef(void);
00084     STDMETHODIMP_(ULONG) Release(void);
00085
00086     // We get this ICar interface pointer via containment reuse of the
00087     // ICar interface in an instantiated COCar.
00088     ICar*           m_pICar;
00089
00090   private:
00091     // We show nested interface class implementations here.
00092
00093     // We implement the basic ICar interface in this COUtilityCar
00094     // COM object class.
00095     class CImpICar : public ICar
00096     {
00097       public:
00098         // Interface Implementation Constructor & Destructor.
00099         CImpICar(COUtilityCar* pBackObj, IUnknown* pUnkOuter);
00100         ~CImpICar(void);
00101
00102         // IUnknown methods.
00103         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00104         STDMETHODIMP_(ULONG) AddRef(void);
00105         STDMETHODIMP_(ULONG) Release(void);
00106
00107         // ICar methods.
00108         STDMETHODIMP Shift(short nGear);
00109         STDMETHODIMP Clutch(short nEngaged);
00110         STDMETHODIMP Speed(short nMph);
00111         STDMETHODIMP Steer(short nAngle);
00112
00113       private:
00114         // Data private to this COUtilityCar interface implementation of ICar.
00115         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00116         COUtilityCar* m_pBackObj;    // Parent Object back pointer.
00117         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00118     };
00119
00120     // We implement the IUtility interface (ofcourse) in this COUtilityCar
00121     // COM object class.  This is the native interface that we are using
00122     // as an augmentation to the existing COCar COM object class.
00123     class CImpIUtility : public IUtility
00124     {
00125       public:
00126         // Interface Implementation Constructor & Destructor.
00127         CImpIUtility(COUtilityCar* pBackObj, IUnknown* pUnkOuter);
00128         ~CImpIUtility(void);
00129
00130         // IUnknown methods.
00131         STDMETHODIMP         QueryInterface(REFIID, PPVOID);
00132         STDMETHODIMP_(ULONG) AddRef(void);
00133         STDMETHODIMP_(ULONG) Release(void);
00134
00135         // IUtility methods.
00136         STDMETHODIMP Offroad(short nGear);
00137         STDMETHODIMP Winch(short nRpm);
00138
00139       private:
00140         // Data private to this interface implementation of IUtility.
00141         ULONG         m_cRefI;       // Interface Ref Count (for debugging).
00142         COUtilityCar* m_pBackObj;    // Parent Object back pointer.
00143         IUnknown*     m_pUnkOuter;   // Outer unknown for Delegation.
00144     };
00145
00146     // Make the otherwise private and nested ICar and IUtility interface
00147     // implementations a friend to COM object instantiations of this
00148     // selfsame COUtilityCar COM object class.
00149     friend CImpICar;
00150     friend CImpIUtility;
00151
00152     // Private data of COUtilityCar COM objects.
00153
00154     // Nested ICar implementation instantiation.
00155     CImpICar        m_ImpICar;
00156
00157     // Nested IUtility implementation instantiation.  This IUtility interface
00158     // is implemented inside this COUtilityCar object as a native interface.
00159     CImpIUtility    m_ImpIUtility;
00160
00161     // Main Object reference count.
00162     ULONG           m_cRefs;
00163
00164     // Outer unknown (aggregation & delegation). Used when this COCruiseCar
00165     // object is being aggregated.  Otherwise it is used for delegation
00166     // if this object is reused via containment.
00167     IUnknown*       m_pUnkOuter;
00168
00169     // Pointer to this component server's control object.
00170     CServer*        m_pServer;
00171 };
00172
00173 typedef COUtilityCar* PCOUtilityCar;
00174
00175 #endif // __cplusplus
00176
00177
00178 #endif // UTILCAR_H
Generated on Wed Nov 13 2024 16:51:55 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/sampprov.h Source File

  • Dataaccess
  • oledb
  • sampprov

sampprov.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module SAMPPROV.H | Main include file
00008 //
00009 //
00010 #ifndef _SAMPPROV_H_
00011 #define _SAMPPROV_H_
00012
00013
00014
00015 // Defines -------------------------------------------------------------------
00016 #ifdef DBINITCONSTANTS
00017 #define GLOBAL_(type, name, val)  extern type name = val
00018 #else
00019 #define GLOBAL_(type, name, val)  extern type name
00020 #endif
00021
00022 #define OBJECT_CONSTRUCTED()    InterlockedIncrement(&g_cObj);
00023 #define OBJECT_DESTRUCTED()     InterlockedDecrement(&g_cObj);
00024
00025 #ifndef  MAX
00026 # define MIN(a,b)  ( (a) < (b) ? (a) : (b) )
00027 # define MAX(a,b)  ( (a) > (b) ? (a) : (b) )
00028 #endif
00029
00030 #define SAMPPROV_URL_PREFIX     L"sampprov"
00031
00032 ////////////////////////////////////////////////////////
00033 // Defines
00034 //
00035 ////////////////////////////////////////////////////////
00036 //IMalloc Wrappers
00037 #define CHECK_MEMORY(pv)      if(!(pv)) { hr = E_OUTOFMEMORY; goto CLEANUP; }
00038
00039 #define PROVIDER_ALLOC(cb)      CoTaskMemAlloc((ULONG)(cb));
00040 #define PROVIDER_REALLOC(pv, cb)    CoTaskMemRealloc(pv, (ULONG)(cb));
00041
00042 #define SAFE_ALLOC(pv, type, cb)  { pv = (type*)CoTaskMemAlloc((ULONG)(cb)*sizeof(type)); CHECK_MEMORY(pv); }
00043 #define SAFE_REALLOC(pv, type, cb)  { pv = (type*)CoTaskMemRealloc(pv, (ULONG)(cb)*sizeof(type)); CHECK_MEMORY(pv);}
00044 #define SAFE_SYSALLOC(pv, bstr)   { pv = SysAllocString(bstr); CHECK_MEMORY(pv); }
00045
00046 #define SAFE_FREE(pv)       { CoTaskMemFree(pv); pv = NULL; }
00047 #define SAFE_SYSFREE(bstr)      { SysFreeString(bstr); bstr = NULL;}
00048
00049 #define SAFE_DELETE(pv)       { if(pv) delete    (pv); pv = NULL; }
00050 #define SAFE_DELETE_ARRAY(pv)   { if(pv) delete [] (pv); pv = NULL; }
00051
00052 //IUnknown->Release Wrapper
00053 #define SAFE_RELEASE(pv)      if((pv)) { ((IUnknown*)pv)->Release(); (pv) = NULL; }
00054 #define SAFE_ADDREF(pv)       if((pv)) { ((IUnknown*)pv)->AddRef();       }
00055
00056 //Test macros
00057 #define TEST(exp)         { if(FAILED(exp)) { ASSERT(!#exp); } }
00058 #define TESTC(exp)          { if(FAILED(exp)) { goto CLEANUP;  } }
00059
00060 #define NUMELEM(x)          (sizeof(x)/sizeof(*x))
00061
00062
00063 #define MAX_HEAP_SIZE             128000
00064 #define MAX_TOTAL_ROWBUFF_SIZE    (10*1024*1024)        // Max for all row buffers.
00065 #define MAX_IBUFFER_SIZE          2000000
00066 #define MAX_BIND_LEN            (MAX_IBUFFER_SIZE/10)
00067
00068 #define MAX_QUERY_LEN       4096
00069 #define EOL             '\0'
00070 #define wEOL            L'\0'
00071 #define INT_DISPLAY_SIZE      80
00072
00073 #define STAT_ENDOFCURSOR            0x00000100  // for forward-only means fully materialized
00074
00075
00076 //-----------------------------------------------------------------------------
00077 // Memory alignment
00078 //-----------------------------------------------------------------------------
00079
00080 //++
00081 // Useful rounding macros.
00082 // Rounding amount is always a power of two.
00083 //--
00084 #define ROUND_DOWN( Size, Amount )  ((DBLENGTH)(Size) & ~((Amount) - 1))
00085 #define ROUND_UP(   Size, Amount ) (((DBLENGTH)(Size) +  ((Amount) - 1)) & ~((Amount) - 1))
00086
00087 //++
00088 // These macros are for aligment of ColumnData within the internal row buffer.
00089 // COLUMN_ALIGN takes a ptr where you think data ought to go,
00090 // and rounds up to the next appropriate address boundary.
00091 //
00092 // Rule of thumb is "natural" boundary, i.e. 4-byte member should be
00093 // aligned on address that is multiple of 4.
00094 //
00095 // Most everything should be aligned to 32-bit boundary.
00096 // But doubles should be aligned to 64-bit boundary, so let's play it safe.
00097 // Also have __int64.
00098 //--
00099
00100 # define COLUMN_ALIGNVAL 8    // venerable 80x86
00101
00102
00103 // Typedefs ------------------------------------------------------------------
00104 typedef VOID**  LPLPVOID;
00105
00106 typedef long int            SDWORD;
00107 typedef short int           SWORD;
00108 typedef unsigned long int   UDWORD;
00109 typedef unsigned short int  UWORD;
00110 typedef signed long     SLONG;
00111 typedef unsigned long   ULONG;
00112 typedef unsigned short    USHORT;
00113
00114
00115
00116 // Accessor Structure
00117 typedef struct tagACCESSOR
00118 {
00119     DBACCESSORFLAGS dwAccessorFlags;
00120   DBREFCOUNT    cRef;
00121   DBCOUNTITEM   cBindings;
00122   DBBINDING   rgBindings[1];
00123 } ACCESSOR, *PACCESSOR;
00124
00125
00126
00127
00128 //-----------------------------------------------------------------------------
00129 // Macros for interface classes -- IUnknown methods and constructor\destructor
00130 // Use these in the class definition for an interface.
00131 // The code is defined in the header (definition) part because
00132 // it is easier to do so here, and easier to use.
00133 //
00134 //
00135 // @func void | DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA |
00136 // Macro to define default IUnknown member data.
00137 //
00138 // @parm BaseClass | BaseClass | . | Class that is the OLE object.
00139 //
00140 // @ex Example usage|
00141 //
00142 //  class CImpISomething : public ISomething {
00143 //  private:
00144 //    DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(CSomethingBase)
00145 //  public:
00146 //    DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(CSomethingBase, CImpISomething)
00147 //    DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE
00148 //    ... implementation-specific methods ...
00149 //  };
00150 //
00151 #define DEFINE_DEFAULT_IUNKNOWN_MEMBER_DATA(BaseClass)            \
00152     DEBUGCODE(ULONG m_cRef);                      \
00153     BaseClass   *m_pObj;                      \
00154     LPUNKNOWN   m_pUnkOuter;
00155
00156 // @func void | DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR |
00157 // Macro to define default IUnknown Ctor/Dtor.
00158 //
00159 // @parm BaseClass | BaseClass      | . | Class that is the OLE object.
00160 //
00161 // @parm Any class | InterfaceClass | . | OLE interface class that this is part of.
00162
00163 #define DEFINE_DEFAULT_IUNKNOWN_CTOR_DTOR(BaseClass, InterfaceClass)    \
00164   InterfaceClass( BaseClass *pObj, IUnknown *pUnkOuter )          \
00165     {                                 \
00166       DEBUGCODE(m_cRef = 0L);                     \
00167       m_pObj    = pObj;                       \
00168       m_pUnkOuter = pUnkOuter;                    \
00169     }                                 \
00170   ~InterfaceClass()                           \
00171     {                                 \
00172     }
00173
00174
00175 // @func void | DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE |
00176 // Macro to define default IUnknown AddRef/Release.
00177
00178 #define DEFINE_DEFAULT_IUNKNOWN_ADDREF_RELEASE                \
00179   STDMETHODIMP_(ULONG)  AddRef(void)                  \
00180     {                                 \
00181       DEBUGCODE( ++m_cRef );                      \
00182       return m_pUnkOuter->AddRef();                 \
00183     }                                 \
00184   STDMETHODIMP_(ULONG)  Release(void)                 \
00185     {                                 \
00186       ASSERT( m_cRef > 0 );                     \
00187       DEBUGCODE( --m_cRef );                      \
00188       return m_pUnkOuter->Release();                  \
00189     }                                 \
00190   STDMETHODIMP      QueryInterface(REFIID riid, LPVOID *ppv)    \
00191     {                                 \
00192       return m_pUnkOuter->QueryInterface(riid, ppv);          \
00193     }
00194
00195
00196
00197 // @func void | DEFINE_ADDREF_RELEASE |
00198 // Macro to define default IUnknown AddRef/Release.
00199
00200 #define DEFINE_ADDREF_RELEASE                       \
00201   STDMETHODIMP_(ULONG)  AddRef(void)                  \
00202     {                                 \
00203       InterlockedIncrement((LONG*)&m_cRef);             \
00204       return m_cRef;                          \
00205     }                                 \
00206   STDMETHODIMP_(ULONG)  Release(void)                 \
00207     {                                 \
00208       if(InterlockedDecrement((LONG*)&m_cRef))            \
00209         return m_cRef;                        \
00210                                       \
00211       delete this;                          \
00212       return 0;                           \
00213     }
00214
00215
00216 // Globals -------------------------------------------------------------------
00217
00218 GLOBAL_(LONG, g_cObj, 0L);            // # of outstanding objects
00219 GLOBAL_(LONG, g_cLock, 0L);           // # of explicit locks set
00220 GLOBAL_(DWORD, g_cAttachedProcesses, 0L);   // # of attached processes
00221 GLOBAL_(DWORD, g_dwPageSize, 0L);       // System page size
00222 GLOBAL_(HINSTANCE, g_hInstance, 0L);      // Instance Handle
00223 GLOBAL_(IDataConvert *, g_pIDataConvert, NULL); // IDataConvert pointer
00224
00225 extern WCHAR g_wszDataSourceKeyword[];
00226 extern WCHAR g_wszFileKeyword[];
00227 extern WCHAR g_wszRowKeyword[];
00228
00229 #endif
00230
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/AdvQuery/DispTree.Cxx Source File

  • WinBase
  • Indexing
  • AdvQuery

DispTree.Cxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 // PARTICULAR PURPOSE.
00007 //
00008 // Copyright (c) Microsoft Corporation. All rights reserved.
00009 //
00010 // FILE:     disptree.cxx
00011 //
00012 // PURPOSE:  Displays a command tree, for debugging.
00013 //
00014 // PLATFORM: Windows 2000
00015 //
00016 //--------------------------------------------------------------------------
00017
00018 #define UNICODE
00019
00020 #include <stdio.h>
00021 #include <windows.h>
00022
00023 #include <oledberr.h>
00024 #include <oledb.h>
00025 #include <cmdtree.h>
00026
00027 //+-------------------------------------------------------------------------
00028 //
00029 //  Function:   PrintVectorItems
00030 //
00031 //  Synopsis:   Prints items in a PROPVARIANT vector
00032 //
00033 //  Arguments:  [pVal]  - The array of values
00034 //              [cVals] - The count of values
00035 //              [pcFmt] - The format string
00036 //
00037 //--------------------------------------------------------------------------
00038
00039 template<class T> void PrintVectorItems(
00040     T *     pVal,
00041     ULONG   cVals,
00042     char *  pcFmt )
00043 {
00044     printf( "{ " );
00045
00046     for( ULONG iVal = 0; iVal < cVals; iVal++ )
00047     {
00048         if ( 0 != iVal )
00049             printf( "," );
00050         printf( pcFmt, *pVal++ );
00051     }
00052
00053     printf( " }" );
00054 } //PrintVectorItems
00055
00056 //+-------------------------------------------------------------------------
00057 //
00058 //  Function:   DisplayVariant
00059 //
00060 //  Synopsis:   Displays a PROPVARIANT.  This is not a complete
00061 //              implementation; many VT_ types are not complete.
00062 //
00063 //  Arguments:  [pNode]  - The command tree node
00064 //              [iLevel] - The 0-based level in the tree
00065 //
00066 //--------------------------------------------------------------------------
00067
00068 void DisplayVariant( PROPVARIANT * pVar )
00069 {
00070     if ( 0 == pVar )
00071     {
00072         printf( "NULL" );
00073         return;
00074     }
00075
00076     PROPVARIANT & v = *pVar;
00077
00078     switch ( v.vt )
00079     {
00080         case VT_I4 : printf( "VT_I4 %d", v.lVal ); break;
00081         case VT_UI1 : printf( "VT_UI1 %d", v.bVal ); break;
00082         case VT_I2 : printf( "VT_I2 %d", v.iVal ); break;
00083         case VT_R4 : printf( "VT_R4 %f", v.fltVal ); break;
00084         case VT_R8 : printf( "VT_R8 %lf", v.dblVal ); break;
00085         case VT_BOOL : printf( "VT_BOOL %d", v.boolVal ); break;
00086         case VT_ERROR : printf( "VT_ERROR %#x", v.scode ); break;
00087         case VT_CY :
00088         {
00089             double dbl;
00090             HRESULT hr = VarR8FromCy( pVar->cyVal, &dbl );
00091
00092             if ( SUCCEEDED( hr ) )
00093                 printf( "VT_CY %lf", dbl );
00094             break;
00095         }
00096         case VT_DATE : printf( "VT_DATE " ); break;
00097         case VT_FILETIME : printf( "VT_FILETIME %#I64x ", v.filetime ); break;
00098         case VT_BSTR : printf( "VT_BSTR '%ws'", v.bstrVal ); break;
00099         case VT_UNKNOWN : printf( "VT_UNKNOWN " ); break;
00100         case VT_DISPATCH : printf( "VT_DISPATCH " ); break;
00101         case VT_BYREF|VT_UI1 : printf( "VT_BYREF|VT_UI1 " ); break;
00102         case VT_BYREF|VT_I2 : printf( "VT_BYREF|VT_I2 " ); break;
00103         case VT_BYREF|VT_I4 : printf( "VT_BYREF|VT_I4 " ); break;
00104         case VT_BYREF|VT_R4 : printf( "VT_BYREF|VT_R4 " ); break;
00105         case VT_BYREF|VT_R8 : printf( "VT_BYREF|VT_R8 " ); break;
00106         case VT_BYREF|VT_BOOL : printf( "VT_BYREF|VT_BOOL " ); break;
00107         case VT_BYREF|VT_ERROR : printf( "VT_BYREF|VT_ERROR " ); break;
00108         case VT_BYREF|VT_CY : printf( "VT_BYREF|VT_CY " ); break;
00109         case VT_BYREF|VT_DATE : printf( "VT_BYREF|VT_DATE " ); break;
00110         case VT_BYREF|VT_BSTR : printf( "VT_BYREF|VT_BSTR " ); break;
00111         case VT_BYREF|VT_UNKNOWN : printf( "VT_BYREF|VT_UNKNOWN " ); break;
00112         case VT_BYREF|VT_DISPATCH : printf( "VT_BYREF|VT_DISPATCH " ); break;
00113         case VT_BYREF|VT_ARRAY : printf( "VT_BYREF|VT_ARRAY " ); break;
00114         case VT_BYREF|VT_VARIANT : printf( "VT_BYREF|VT_VARIANT " ); break;
00115         case VT_I1 : printf( "VT_I1 %d", v.bVal ); break;
00116         case VT_UI2 : printf( "VT_UI2 %u", v.uiVal ); break;
00117         case VT_UI4 : printf( "VT_UI4 %u", v.ulVal ); break;
00118         case VT_INT : printf( "VT_INT %d", v.lVal ); break;
00119         case VT_UINT : printf( "VT_UINT %u", v.ulVal ); break;
00120         case VT_BYREF|VT_DECIMAL : printf( "VT_BYREF|VT_DECIMAL " ); break;
00121         case VT_BYREF|VT_I1 : printf( "VT_BYREF|VT_I1 " ); break;
00122         case VT_BYREF|VT_UI2 : printf( "VT_BYREF|VT_UI2 " ); break;
00123         case VT_BYREF|VT_UI4 : printf( "VT_BYREF|VT_UI4 " ); break;
00124         case VT_BYREF|VT_INT : printf( "VT_BYREF|VT_INT " ); break;
00125         case VT_BYREF|VT_UINT : printf( "VT_BYREF|VT_UINT " ); break;
00126         case VT_LPSTR : printf( "VT_LPSTR '%s'", v.pszVal ); break;
00127         case VT_LPWSTR : printf( "VT_LPWSTR '%ws'", v.pwszVal ); break;
00128         case VT_I8 : printf( "VT_I8 %I64d", v.hVal ); break;
00129         case VT_UI8 : printf( "VT_I8 %I64u", v.hVal ); break;
00130         case VT_VECTOR | VT_I1:
00131             printf( "VT_VECTOR | VT_I1 " );
00132             PrintVectorItems( v.caub.pElems, v.caub.cElems, "%d" );
00133             break;
00134         case VT_VECTOR | VT_I2:
00135             printf( "VT_VECTOR | VT_I2 " );
00136             PrintVectorItems( v.cai.pElems, v.cai.cElems, "%d" );
00137             break;
00138         case VT_VECTOR | VT_I4:
00139             printf( "VT_VECTOR | VT_I4 " );
00140             PrintVectorItems( v.cal.pElems, v.cal.cElems, "%d" );
00141             break;
00142         case VT_VECTOR | VT_I8:
00143             printf( "VT_VECTOR | VT_I8 " );
00144             PrintVectorItems( v.cah.pElems, v.cah.cElems, "%I64d" );
00145             break;
00146         case VT_VECTOR | VT_UI1:
00147             printf( "VT_VECTOR | VT_UI1 " );
00148             PrintVectorItems( v.caub.pElems, v.caub.cElems, "%u" );
00149             break;
00150         case VT_VECTOR | VT_UI2:
00151             printf( "VT_VECTOR | VT_UI2 " );
00152             PrintVectorItems( v.caui.pElems, v.caui.cElems, "%u" );
00153             break;
00154         case VT_VECTOR | VT_UI4:
00155             printf( "VT_VECTOR | VT_UI4 " );
00156             PrintVectorItems( v.caul.pElems, v.caul.cElems, "%u" );
00157             break;
00158         case VT_VECTOR | VT_UI8:
00159             printf( "VT_VECTOR | VT_UI8 " );
00160             PrintVectorItems( v.cauh.pElems, v.cauh.cElems, "%I64u" );
00161             break;
00162         case VT_VECTOR | VT_BSTR:
00163             printf( "VT_VECTOR | VT_BSTR " );
00164             PrintVectorItems( v.cabstr.pElems, v.cabstr.cElems, "%ws" );
00165             break;
00166         case VT_VECTOR | VT_LPSTR:
00167             printf( "VT_VECTOR | VT_LPSTR " );
00168             PrintVectorItems( v.calpstr.pElems, v.calpstr.cElems, "%s" );
00169             break;
00170         case VT_VECTOR | VT_LPWSTR:
00171             printf( "VT_VECTOR | VT_LPWSTR " );
00172             PrintVectorItems( v.calpwstr.pElems, v.calpwstr.cElems, "%ws" );
00173             break;
00174         case VT_VECTOR | VT_R4:
00175             printf( "VT_VECTOR | VT_R4 " );
00176             PrintVectorItems( v.caflt.pElems, v.caflt.cElems, "%f" );
00177             break;
00178         case VT_VECTOR | VT_R8:
00179             printf( "VT_VECTOR | VT_R8 " );
00180             PrintVectorItems( v.cadbl.pElems, v.cadbl.cElems, "%lf" );
00181             break;
00182         default : printf( "unknown vt %#x", v.vt );
00183     }
00184 } //DisplayVariant
00185
00186 //+-------------------------------------------------------------------------
00187 //
00188 //  Function:   PrintSpace
00189 //
00190 //  Synopsis:   Prints white space.
00191 //
00192 //  Arguments:  [cPlaces] - Number of levels to print
00193 //
00194 //--------------------------------------------------------------------------
00195
00196 void PrintSpace( ULONG cPlaces )
00197 {
00198     for( ULONG iPlace = 0; iPlace < cPlaces; iPlace++ )
00199         printf( "  " );
00200 } //PrintSpace
00201
00202 //+-------------------------------------------------------------------------
00203 //
00204 //  Function:   DisplayCommandTree
00205 //
00206 //  Synopsis:   Displays the command tree, useful for debugging.  This is
00207 //              not a complete implementation; many DBVALUEKINDs are not
00208 //              complete.
00209 //
00210 //  Arguments:  [pNode]  - The command tree node
00211 //              [iLevel] - The 0-based level in the tree
00212 //
00213 //--------------------------------------------------------------------------
00214
00215 void DisplayCommandTree(
00216     DBCOMMANDTREE * pNode,
00217     ULONG           iLevel )
00218 {
00219     PrintSpace( iLevel );
00220     printf( "op: (%d) ", pNode->op );
00221     switch ( pNode->op )
00222     {
00223         case DBOP_scalar_constant : printf( "DBOP_scalar_constant" ); break;
00224         case DBOP_DEFAULT : printf( "DBOP_DEFAULT" ); break;
00225         case DBOP_NULL : printf( "DBOP_NULL" ); break;
00226         case DBOP_bookmark_name : printf( "DBOP_bookmark_name" ); break;
00227         case DBOP_catalog_name : printf( "DBOP_catalog_name" ); break;
00228         case DBOP_column_name : printf( "DBOP_column_name" ); break;
00229         case DBOP_schema_name : printf( "DBOP_schema_name" ); break;
00230         case DBOP_outall_name : printf( "DBOP_outall_name" ); break;
00231         case DBOP_qualifier_name : printf( "DBOP_qualifier_name" ); break;
00232         case DBOP_qualified_column_name : printf( "DBOP_qualified_column_name" ); break;
00233         case DBOP_table_name : printf( "DBOP_table_name" ); break;
00234         case DBOP_nested_table_name : printf( "DBOP_nested_table_name" ); break;
00235         case DBOP_nested_column_name : printf( "DBOP_nested_column_name" ); break;
00236         case DBOP_row : printf( "DBOP_row" ); break;
00237         case DBOP_table : printf( "DBOP_table" ); break;
00238         case DBOP_sort : printf( "DBOP_sort" ); break;
00239         case DBOP_distinct : printf( "DBOP_distinct" ); break;
00240         case DBOP_distinct_order_preserving : printf( "DBOP_distinct_order_preserving" ); break;
00241         case DBOP_alias : printf( "DBOP_alias" ); break;
00242         case DBOP_cross_join : printf( "DBOP_cross_join" ); break;
00243         case DBOP_union_join : printf( "DBOP_union_join" ); break;
00244         case DBOP_inner_join : printf( "DBOP_inner_join" ); break;
00245         case DBOP_left_semi_join : printf( "DBOP_left_semi_join" ); break;
00246         case DBOP_right_semi_join : printf( "DBOP_right_semi_join" ); break;
00247         case DBOP_left_anti_semi_join : printf( "DBOP_left_anti_semi_join" ); break;
00248         case DBOP_right_anti_semi_join : printf( "DBOP_right_anti_semi_join" ); break;
00249         case DBOP_left_outer_join : printf( "DBOP_left_outer_join" ); break;
00250         case DBOP_right_outer_join : printf( "DBOP_right_outer_join" ); break;
00251         case DBOP_full_outer_join : printf( "DBOP_full_outer_join" ); break;
00252         case DBOP_natural_join : printf( "DBOP_natural_join" ); break;
00253         case DBOP_natural_left_outer_join : printf( "DBOP_natural_left_outer_join" ); break;
00254         case DBOP_natural_right_outer_join : printf( "DBOP_natural_right_outer_join" ); break;
00255         case DBOP_natural_full_outer_join : printf( "DBOP_natural_full_outer_join" ); break;
00256         case DBOP_set_intersection : printf( "DBOP_set_intersection" ); break;
00257         case DBOP_set_union : printf( "DBOP_set_union" ); break;
00258         case DBOP_set_left_difference : printf( "DBOP_set_left_difference" ); break;
00259         case DBOP_set_right_difference : printf( "DBOP_set_right_difference" ); break;
00260         case DBOP_set_anti_difference : printf( "DBOP_set_anti_difference" ); break;
00261         case DBOP_bag_intersection : printf( "DBOP_bag_intersection" ); break;
00262         case DBOP_bag_union : printf( "DBOP_bag_union" ); break;
00263         case DBOP_bag_left_difference : printf( "DBOP_bag_left_difference" ); break;
00264         case DBOP_bag_right_difference : printf( "DBOP_bag_right_difference" ); break;
00265         case DBOP_bag_anti_difference : printf( "DBOP_bag_anti_difference" ); break;
00266         case DBOP_division : printf( "DBOP_division" ); break;
00267         case DBOP_relative_sampling : printf( "DBOP_relative_sampling" ); break;
00268         case DBOP_absolute_sampling : printf( "DBOP_absolute_sampling" ); break;
00269         case DBOP_transitive_closure : printf( "DBOP_transitive_closure" ); break;
00270         case DBOP_recursive_union : printf( "DBOP_recursive_union" ); break;
00271         case DBOP_aggregate : printf( "DBOP_aggregate" ); break;
00272         case DBOP_remote_table : printf( "DBOP_remote_table" ); break;
00273         case DBOP_select : printf( "DBOP_select" ); break;
00274         case DBOP_order_preserving_select : printf( "DBOP_order_preserving_select" ); break;
00275         case DBOP_project : printf( "DBOP_project" ); break;
00276         case DBOP_project_order_preserving : printf( "DBOP_project_order_preserving" ); break;
00277         case DBOP_top : printf( "DBOP_top" ); break;
00278         case DBOP_top_percent : printf( "DBOP_top_percent" ); break;
00279         case DBOP_top_plus_ties : printf( "DBOP_top_plus_ties" ); break;
00280         case DBOP_top_percent_plus_ties : printf( "DBOP_top_percent_plus_ties" ); break;
00281         case DBOP_rank : printf( "DBOP_rank" ); break;
00282         case DBOP_rank_ties_equally : printf( "DBOP_rank_ties_equally" ); break;
00283         case DBOP_rank_ties_equally_and_skip : printf( "DBOP_rank_ties_equally_and_skip" ); break;
00284         case DBOP_navigate : printf( "DBOP_navigate" ); break;
00285         case DBOP_nesting : printf( "DBOP_nesting" ); break;
00286         case DBOP_unnesting : printf( "DBOP_unnesting" ); break;
00287         case DBOP_nested_apply : printf( "DBOP_nested_apply" ); break;
00288         case DBOP_cross_tab : printf( "DBOP_cross_tab" ); break;
00289         case DBOP_is_NULL : printf( "DBOP_is_NULL" ); break;
00290         case DBOP_is_NOT_NULL : printf( "DBOP_is_NOT_NULL" ); break;
00291         case DBOP_equal : printf( "DBOP_equal" ); break;
00292         case DBOP_not_equal : printf( "DBOP_not_equal" ); break;
00293         case DBOP_less : printf( "DBOP_less" ); break;
00294         case DBOP_less_equal : printf( "DBOP_less_equal" ); break;
00295         case DBOP_greater : printf( "DBOP_greater" ); break;
00296         case DBOP_greater_equal : printf( "DBOP_greater_equal" ); break;
00297         case DBOP_equal_all : printf( "DBOP_equal_all" ); break;
00298         case DBOP_not_equal_all : printf( "DBOP_not_equal_all" ); break;
00299         case DBOP_less_all : printf( "DBOP_less_all" ); break;
00300         case DBOP_less_equal_all : printf( "DBOP_less_equal_all" ); break;
00301         case DBOP_greater_all : printf( "DBOP_greater_all" ); break;
00302         case DBOP_greater_equal_all : printf( "DBOP_greater_equal_all" ); break;
00303         case DBOP_equal_any : printf( "DBOP_equal_any" ); break;
00304         case DBOP_not_equal_any : printf( "DBOP_not_equal_any" ); break;
00305         case DBOP_less_any : printf( "DBOP_less_any" ); break;
00306         case DBOP_less_equal_any : printf( "DBOP_less_equal_any" ); break;
00307         case DBOP_greater_any : printf( "DBOP_greater_any" ); break;
00308         case DBOP_greater_equal_any : printf( "DBOP_greater_equal_any" ); break;
00309         case DBOP_anybits : printf( "DBOP_anybits" ); break;
00310         case DBOP_allbits : printf( "DBOP_allbits" ); break;
00311         case DBOP_anybits_any : printf( "DBOP_anybits_any" ); break;
00312         case DBOP_allbits_any : printf( "DBOP_allbits_any" ); break;
00313         case DBOP_anybits_all : printf( "DBOP_anybits_all" ); break;
00314         case DBOP_allbits_all : printf( "DBOP_allbits_all" ); break;
00315         case DBOP_between : printf( "DBOP_between" ); break;
00316         case DBOP_between_unordered : printf( "DBOP_between_unordered" ); break;
00317         case DBOP_match : printf( "DBOP_match" ); break;
00318         case DBOP_match_unique : printf( "DBOP_match_unique" ); break;
00319         case DBOP_match_partial : printf( "DBOP_match_partial" ); break;
00320         case DBOP_match_partial_unique : printf( "DBOP_match_partial_unique" ); break;
00321         case DBOP_match_full : printf( "DBOP_match_full" ); break;
00322         case DBOP_match_full_unique : printf( "DBOP_match_full_unique" ); break;
00323         case DBOP_scalar_parameter : printf( "DBOP_scalar_parameter" ); break;
00324         case DBOP_scalar_function : printf( "DBOP_scalar_function" ); break;
00325         case DBOP_plus : printf( "DBOP_plus" ); break;
00326         case DBOP_minus : printf( "DBOP_minus" ); break;
00327         case DBOP_times : printf( "DBOP_times" ); break;
00328         case DBOP_over : printf( "DBOP_over" ); break;
00329         case DBOP_div : printf( "DBOP_div" ); break;
00330         case DBOP_modulo : printf( "DBOP_modulo" ); break;
00331         case DBOP_power : printf( "DBOP_power" ); break;
00332         case DBOP_like : printf( "DBOP_like" ); break;
00333         case DBOP_sounds_like : printf( "DBOP_sounds_like" ); break;
00334         case DBOP_like_any : printf( "DBOP_like_any" ); break;
00335         case DBOP_like_all : printf( "DBOP_like_all" ); break;
00336         case DBOP_is_INVALID : printf( "DBOP_is_INVALID" ); break;
00337         case DBOP_is_TRUE : printf( "DBOP_is_TRUE" ); break;
00338         case DBOP_is_FALSE : printf( "DBOP_is_FALSE" ); break;
00339         case DBOP_and : printf( "DBOP_and" ); break;
00340         case DBOP_or : printf( "DBOP_or" ); break;
00341         case DBOP_xor : printf( "DBOP_xor" ); break;
00342         case DBOP_equivalent : printf( "DBOP_equivalent" ); break;
00343         case DBOP_not : printf( "DBOP_not" ); break;
00344         case DBOP_implies : printf( "DBOP_implies" ); break;
00345         case DBOP_overlaps : printf( "DBOP_overlaps" ); break;
00346         case DBOP_case_condition : printf( "DBOP_case_condition" ); break;
00347         case DBOP_case_value : printf( "DBOP_case_value" ); break;
00348         case DBOP_nullif : printf( "DBOP_nullif" ); break;
00349         case DBOP_cast : printf( "DBOP_cast" ); break;
00350         case DBOP_coalesce : printf( "DBOP_coalesce" ); break;
00351         case DBOP_position : printf( "DBOP_position" ); break;
00352         case DBOP_extract : printf( "DBOP_extract" ); break;
00353         case DBOP_char_length : printf( "DBOP_char_length" ); break;
00354         case DBOP_octet_length : printf( "DBOP_octet_length" ); break;
00355         case DBOP_bit_length : printf( "DBOP_bit_length" ); break;
00356         case DBOP_substring : printf( "DBOP_substring" ); break;
00357         case DBOP_upper : printf( "DBOP_upper" ); break;
00358         case DBOP_lower : printf( "DBOP_lower" ); break;
00359         case DBOP_trim : printf( "DBOP_trim" ); break;
00360         case DBOP_translate : printf( "DBOP_translate" ); break;
00361         case DBOP_convert : printf( "DBOP_convert" ); break;
00362         case DBOP_string_concat : printf( "DBOP_string_concat" ); break;
00363         case DBOP_current_date : printf( "DBOP_current_date" ); break;
00364         case DBOP_current_time : printf( "DBOP_current_time" ); break;
00365         case DBOP_current_timestamp : printf( "DBOP_current_timestamp" ); break;
00366         case DBOP_content_select : printf( "DBOP_content_select" ); break;
00367         case DBOP_content : printf( "DBOP_content" ); break;
00368         case DBOP_content_freetext : printf( "DBOP_content_freetext" ); break;
00369         case DBOP_content_proximity : printf( "DBOP_content_proximity" ); break;
00370         case DBOP_content_vector_or : printf( "DBOP_content_vector_or" ); break;
00371         case DBOP_delete : printf( "DBOP_delete" ); break;
00372         case DBOP_update : printf( "DBOP_update" ); break;
00373         case DBOP_insert : printf( "DBOP_insert" ); break;
00374         case DBOP_min : printf( "DBOP_min" ); break;
00375         case DBOP_max : printf( "DBOP_max" ); break;
00376         case DBOP_count : printf( "DBOP_count" ); break;
00377         case DBOP_sum : printf( "DBOP_sum" ); break;
00378         case DBOP_avg : printf( "DBOP_avg" ); break;
00379         case DBOP_any_sample : printf( "DBOP_any_sample" ); break;
00380         case DBOP_stddev : printf( "DBOP_stddev" ); break;
00381         case DBOP_stddev_pop : printf( "DBOP_stddev_pop" ); break;
00382         case DBOP_var : printf( "DBOP_var" ); break;
00383         case DBOP_var_pop : printf( "DBOP_var_pop" ); break;
00384         case DBOP_first : printf( "DBOP_first" ); break;
00385         case DBOP_last : printf( "DBOP_last" ); break;
00386         case DBOP_in : printf( "DBOP_in" ); break;
00387         case DBOP_exists : printf( "DBOP_exists" ); break;
00388         case DBOP_unique : printf( "DBOP_unique" ); break;
00389         case DBOP_subset : printf( "DBOP_subset" ); break;
00390         case DBOP_proper_subset : printf( "DBOP_proper_subset" ); break;
00391         case DBOP_superset : printf( "DBOP_superset" ); break;
00392         case DBOP_proper_superset : printf( "DBOP_proper_superset" ); break;
00393         case DBOP_disjoint : printf( "DBOP_disjoint" ); break;
00394         case DBOP_pass_through : printf( "DBOP_pass_through" ); break;
00395         case DBOP_defined_by_GUID : printf( "DBOP_defined_by_GUID" ); break;
00396         case DBOP_text_command : printf( "DBOP_text_command" ); break;
00397         case DBOP_SQL_select : printf( "DBOP_SQL_select" ); break;
00398         case DBOP_prior_command_tree : printf( "DBOP_prior_command_tree" ); break;
00399         case DBOP_add_columns : printf( "DBOP_add_columns" ); break;
00400         case DBOP_column_list_anchor : printf( "DBOP_column_list_anchor" ); break;
00401         case DBOP_column_list_element : printf( "DBOP_column_list_element" ); break;
00402         case DBOP_command_list_anchor : printf( "DBOP_command_list_anchor" ); break;
00403         case DBOP_command_list_element : printf( "DBOP_command_list_element" ); break;
00404         case DBOP_from_list_anchor : printf( "DBOP_from_list_anchor" ); break;
00405         case DBOP_from_list_element : printf( "DBOP_from_list_element" ); break;
00406         case DBOP_project_list_anchor : printf( "DBOP_project_list_anchor" ); break;
00407         case DBOP_project_list_element : printf( "DBOP_project_list_element" ); break;
00408         case DBOP_row_list_anchor : printf( "DBOP_row_list_anchor" ); break;
00409         case DBOP_row_list_element : printf( "DBOP_row_list_element" ); break;
00410         case DBOP_scalar_list_anchor : printf( "DBOP_scalar_list_anchor" ); break;
00411         case DBOP_scalar_list_element : printf( "DBOP_scalar_list_element" ); break;
00412         case DBOP_set_list_anchor : printf( "DBOP_set_list_anchor" ); break;
00413         case DBOP_set_list_element : printf( "DBOP_set_list_element" ); break;
00414         case DBOP_sort_list_anchor : printf( "DBOP_sort_list_anchor" ); break;
00415         case DBOP_sort_list_element : printf( "DBOP_sort_list_element" ); break;
00416         case DBOP_alter_character_set : printf( "DBOP_alter_character_set" ); break;
00417         case DBOP_alter_collation : printf( "DBOP_alter_collation" ); break;
00418         case DBOP_alter_domain : printf( "DBOP_alter_domain" ); break;
00419         case DBOP_alter_index : printf( "DBOP_alter_index" ); break;
00420         case DBOP_alter_procedure : printf( "DBOP_alter_procedure" ); break;
00421         case DBOP_alter_schema : printf( "DBOP_alter_schema" ); break;
00422         case DBOP_alter_table : printf( "DBOP_alter_table" ); break;
00423         case DBOP_alter_trigger : printf( "DBOP_alter_trigger" ); break;
00424         case DBOP_alter_view : printf( "DBOP_alter_view" ); break;
00425         case DBOP_coldef_list_anchor : printf( "DBOP_coldef_list_anchor" ); break;
00426         case DBOP_coldef_list_element : printf( "DBOP_coldef_list_element" ); break;
00427         case DBOP_create_assertion : printf( "DBOP_create_assertion" ); break;
00428         case DBOP_create_character_set : printf( "DBOP_create_character_set" ); break;
00429         case DBOP_create_collation : printf( "DBOP_create_collation" ); break;
00430         case DBOP_create_domain : printf( "DBOP_create_domain" ); break;
00431         case DBOP_create_index : printf( "DBOP_create_index" ); break;
00432         case DBOP_create_procedure : printf( "DBOP_create_procedure" ); break;
00433         case DBOP_create_schema : printf( "DBOP_create_schema" ); break;
00434         case DBOP_create_synonym : printf( "DBOP_create_synonym" ); break;
00435         case DBOP_create_table : printf( "DBOP_create_table" ); break;
00436         case DBOP_create_temporary_table : printf( "DBOP_create_temporary_table" ); break;
00437         case DBOP_create_translation : printf( "DBOP_create_translation" ); break;
00438         case DBOP_create_trigger : printf( "DBOP_create_trigger" ); break;
00439         case DBOP_create_view : printf( "DBOP_create_view" ); break;
00440         case DBOP_drop_assertion : printf( "DBOP_drop_assertion" ); break;
00441         case DBOP_drop_character_set : printf( "DBOP_drop_character_set" ); break;
00442         case DBOP_drop_collation : printf( "DBOP_drop_collation" ); break;
00443         case DBOP_drop_domain : printf( "DBOP_drop_domain" ); break;
00444         case DBOP_drop_index : printf( "DBOP_drop_index" ); break;
00445         case DBOP_drop_procedure : printf( "DBOP_drop_procedure" ); break;
00446         case DBOP_drop_schema : printf( "DBOP_drop_schema" ); break;
00447         case DBOP_drop_synonym : printf( "DBOP_drop_synonym" ); break;
00448         case DBOP_drop_table : printf( "DBOP_drop_table" ); break;
00449         case DBOP_drop_translation : printf( "DBOP_drop_translation" ); break;
00450         case DBOP_drop_trigger : printf( "DBOP_drop_trigger" ); break;
00451         case DBOP_drop_view : printf( "DBOP_drop_view" ); break;
00452         case DBOP_foreign_key : printf( "DBOP_foreign_key" ); break;
00453         case DBOP_grant_privileges : printf( "DBOP_grant_privileges" ); break;
00454         case DBOP_index_list_anchor : printf( "DBOP_index_list_anchor" ); break;
00455         case DBOP_index_list_element : printf( "DBOP_index_list_element" ); break;
00456         case DBOP_primary_key : printf( "DBOP_primary_key" ); break;
00457         case DBOP_property_list_anchor : printf( "DBOP_property_list_anchor" ); break;
00458         case DBOP_property_list_element : printf( "DBOP_property_list_element" ); break;
00459         case DBOP_referenced_table : printf( "DBOP_referenced_table" ); break;
00460         case DBOP_rename_object : printf( "DBOP_rename_object" ); break;
00461         case DBOP_revoke_privileges : printf( "DBOP_revoke_privileges" ); break;
00462         case DBOP_schema_authorization : printf( "DBOP_schema_authorization" ); break;
00463         case DBOP_unique_key : printf( "DBOP_unique_key" ); break;
00464         case DBOP_scope_list_anchor : printf( "DBOP_scope_list_anchor" ); break;
00465         case DBOP_scope_list_element : printf( "DBOP_scope_list_element" ); break;
00466         case DBOP_content_table : printf( "DBOP_content_table" ); break;
00467
00468         default : printf( "unknown DBOP" ); break;
00469     }
00470
00471     printf( "\n" );
00472
00473     PrintSpace( iLevel );
00474     printf( "wKind: (%d) ", pNode->wKind );
00475     switch( pNode->wKind )
00476     {
00477         case DBVALUEKIND_BYGUID :
00478         {
00479             printf( "DBVALUEKIND_BYGUID " );
00480             break;
00481         }
00482         case DBVALUEKIND_COLDESC :
00483         {
00484             printf( "DBVALUEKIND_COLDESC " );
00485             break;
00486         }
00487         case DBVALUEKIND_ID :
00488         {
00489             printf( "DBVALUEKIND_ID: " );
00490             if ( 0 == pNode->value.pdbidValue )
00491                 printf( "NULL" );
00492             else
00493             {
00494                 DBKIND kind = pNode->value.pdbidValue->eKind;
00495
00496                 if ( DBKIND_GUID        == kind ||
00497                      DBKIND_GUID_NAME   == kind ||
00498                      DBKIND_GUID_PROPID == kind )
00499                 {
00500                     GUID &g = pNode->value.pdbidValue->uGuid.guid;
00501                     printf( "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-"
00502                             "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
00503                             g.Data1,g.Data2,g.Data3,g.Data4[0],
00504                             g.Data4[1],g.Data4[2],g.Data4[3],g.Data4[4],
00505                             g.Data4[5],g.Data4[6],g.Data4[7] );
00506                 }
00507                 if ( DBKIND_GUID_PROPID == kind ||
00508                      DBKIND_PROPID      == kind )
00509                     printf( " %d", pNode->value.pdbidValue->uName.ulPropid );
00510                 if ( DBKIND_GUID_NAME == kind ||
00511                      DBKIND_NAME      == kind )
00512                     printf( " '%ws'", pNode->value.pdbidValue->uName.pwszName );
00513             }
00514             break;
00515         }
00516         case DBVALUEKIND_CONTENT :
00517         {
00518             printf( "DBVALUEKIND_CONTENT: " );
00519             if ( 0 == pNode->value.pdbcntntValue )
00520                 printf( "NULL" );
00521             else
00522                 printf( "'%ws', method %d, weight %d, lcid %#x",
00523                         pNode->value.pdbcntntValue->pwszPhrase,
00524                         pNode->value.pdbcntntValue->dwGenerateMethod,
00525                         pNode->value.pdbcntntValue->lWeight,
00526                         pNode->value.pdbcntntValue->lcid );
00527             break;
00528         }
00529         case DBVALUEKIND_CONTENTVECTOR :
00530         {
00531             printf( "DBVALUEKIND_CONTENTVECTOR: " );
00532             DBCONTENTVECTOR *p = pNode->value.pdbcntntvcValue;
00533             if ( 0 == p )
00534                 printf( "NULL" );
00535             else
00536             {
00537                 printf( "method %d, weight %d ",
00538                          p->dwRankingMethod,
00539                          p->lWeight );
00540             }
00541             break;
00542         }
00543         case DBVALUEKIND_GROUPINFO :
00544         {
00545             printf( "DBVALUEKIND_GROUPINFO " );
00546             break;
00547         }
00548         case DBVALUEKIND_PARAMETER :
00549         {
00550             printf( "DBVALUEKIND_PARAMETER " );
00551             break;
00552         }
00553         case DBVALUEKIND_PROPERTY :
00554         {
00555             printf( "DBVALUEKIND_PROPERTY " );
00556             break;
00557         }
00558         case DBVALUEKIND_SETFUNC :
00559         {
00560             printf( "DBVALUEKIND_SETFUNC " );
00561             break;
00562         }
00563         case DBVALUEKIND_SORTINFO :
00564         {
00565             printf( "DBVALUEKIND_SORTINFO: " );
00566             if ( 0 == pNode->value.pdbsrtinfValue )
00567                 printf( "NULL" );
00568             else
00569                 printf( "fDesc %d, lcid %#x",
00570                         pNode->value.pdbsrtinfValue->fDesc,
00571                         pNode->value.pdbsrtinfValue->lcid );
00572             break;
00573         }
00574         case DBVALUEKIND_TEXT :
00575         {
00576             printf( "DBVALUEKIND_TEXT " );
00577             break;
00578         }
00579         case DBVALUEKIND_COMMAND :
00580         {
00581             printf( "DBVALUEKIND_COMMAND " );
00582             break;
00583         }
00584         case DBVALUEKIND_MONIKER :
00585         {
00586             printf( "DBVALUEKIND_MONIKER " );
00587             break;
00588         }
00589         case DBVALUEKIND_ROWSET :
00590         {
00591             printf( "DBVALUEKIND_ROWSET " );
00592             break;
00593         }
00594         case DBVALUEKIND_LIKE :
00595         {
00596             printf( "DBVALUEKIND_LIKE " );
00597             break;
00598         }
00599         case DBVALUEKIND_CONTENTPROXIMITY :
00600         {
00601             printf( "DBVALUEKIND_CONTENTPROXIMITY " );
00602             break;
00603         }
00604         case DBVALUEKIND_CONTENTSCOPE :
00605         {
00606             printf( "DBVALUEKIND_CONTENTSCOPE " );
00607             if ( 0 == pNode->value.pdbcntntscpValue )
00608                 printf( "NULL" );
00609             else
00610                 printf( "dwFlags %#x, pwszElementValue %ws",
00611                         pNode->value.pdbcntntscpValue->dwFlags,
00612                         pNode->value.pdbcntntscpValue->pwszElementValue );
00613             break;
00614         }
00615         case DBVALUEKIND_CONTENTTABLE :
00616         {
00617             printf( "DBVALUEKIND_CONTENTTABLE " );
00618             if ( 0 == pNode->value.pdbcntnttblValue )
00619                 printf( "NULL" );
00620             else
00621                 printf( "machine %ws, catalog %ws",
00622                         pNode->value.pdbcntnttblValue->pwszMachine,
00623                         pNode->value.pdbcntnttblValue->pwszCatalog );
00624             break;
00625         }
00626         case DBVALUEKIND_IDISPATCH :
00627         {
00628             printf( "DBVALUEKIND_IDISPATCH " );
00629             break;
00630         }
00631         case DBVALUEKIND_IUNKNOWN :
00632         {
00633             printf( "DBVALUEKIND_IUNKNOWN " );
00634             break;
00635         }
00636         case DBVALUEKIND_EMPTY :
00637         {
00638             printf( "DBVALUEKIND_EMPTY " );
00639             break;
00640         }
00641         case DBVALUEKIND_NULL :
00642         {
00643             printf( "DBVALUEKIND_NULL " );
00644             break;
00645         }
00646         case DBVALUEKIND_I2 :
00647         {
00648             printf( "DBVALUEKIND_I2: %d", pNode->value.sValue );
00649             break;
00650         }
00651         case DBVALUEKIND_I4 :
00652         {
00653             printf( "DBVALUEKIND_I4: %d", pNode->value.lValue );
00654             break;
00655         }
00656         case DBVALUEKIND_R4 :
00657         {
00658             printf( "DBVALUEKIND_R4: %f", pNode->value.flValue );
00659             break;
00660         }
00661         case DBVALUEKIND_R8 :
00662         {
00663             printf( "DBVALUEKIND_R8: %lf", pNode->value.dblValue );
00664             break;
00665         }
00666         case DBVALUEKIND_CY :
00667         {
00668             printf( "DBVALUEKIND_CY " );
00669             break;
00670         }
00671         case DBVALUEKIND_DATE :
00672         {
00673             printf( "DBVALUEKIND_DATE " );
00674             break;
00675         }
00676         case DBVALUEKIND_BSTR :
00677         {
00678             printf( "DBVALUEKIND_BSTR: '%ws'", pNode->value.pbstrValue );
00679             break;
00680         }
00681         case DBVALUEKIND_ERROR :
00682         {
00683             printf( "DBVALUEKIND_ERROR: %d", pNode->value.scodeValue );
00684             break;
00685         }
00686         case DBVALUEKIND_BOOL :
00687         {
00688             printf( "DBVALUEKIND_BOOL: %d", pNode->value.fValue );
00689             break;
00690         }
00691         case DBVALUEKIND_VARIANT :
00692         {
00693             printf( "DBVALUEKIND_VARIANT " );
00694
00695             // Indexing Service uses PROPVARIANTs (extended VARIANTs)
00696
00697             DisplayVariant( (PROPVARIANT *) pNode->value.pvarValue );
00698             break;
00699         }
00700         case DBVALUEKIND_I1 :
00701         {
00702             printf( "DBVALUEKIND_I1: %d", pNode->value.schValue );
00703             break;
00704         }
00705         case DBVALUEKIND_UI1 :
00706         {
00707             printf( "DBVALUEKIND_UI1: %u", pNode->value.uchValue );
00708             break;
00709         }
00710         case DBVALUEKIND_UI2 :
00711         {
00712             printf( "DBVALUEKIND_UI2: %u", pNode->value.usValue );
00713             break;
00714         }
00715         case DBVALUEKIND_UI4 :
00716         {
00717             printf( "DBVALUEKIND_UI4: %u", pNode->value.ulValue );
00718             break;
00719         }
00720         case DBVALUEKIND_I8 :
00721         {
00722             printf( "DBVALUEKIND_I8: %I64d", pNode->value.llValue );
00723             break;
00724         }
00725         case DBVALUEKIND_UI8 :
00726         {
00727             printf( "DBVALUEKIND_UI8: %I64u", pNode->value.llValue );
00728             break;
00729         }
00730         case DBVALUEKIND_GUID :
00731         {
00732             printf( "DBVALUEKIND_GUID " );
00733             break;
00734         }
00735         case DBVALUEKIND_BYTES :
00736         {
00737             printf( "DBVALUEKIND_BYTES " );
00738             break;
00739         }
00740         case DBVALUEKIND_STR :
00741         {
00742             printf( "DBVALUEKIND_STR: '%s'", pNode->value.pzValue );
00743             break;
00744         }
00745         case DBVALUEKIND_WSTR :
00746         {
00747             printf( "DBVALUEKIND_WSTR: '%ws'", pNode->value.pwszValue );
00748             break;
00749         }
00750         case DBVALUEKIND_NUMERIC :
00751         {
00752             printf( "DBVALUEKIND_NUMERIC " );
00753             break;
00754         }
00755         case DBVALUEKIND_DBDATE :
00756         {
00757             printf( "DBVALUEKIND_DBDATE " );
00758             break;
00759         }
00760         case DBVALUEKIND_DBTIME :
00761         {
00762             printf( "DBVALUEKIND_DBTIME " );
00763             break;
00764         }
00765         case DBVALUEKIND_DBTIMESTAMP :
00766         {
00767             printf( "DBVALUEKIND_DBTIMESTAMP " );
00768             break;
00769         }
00770         default :
00771         {
00772             printf( "unknown DBVALUEKIND " );
00773             break;
00774         }
00775     }
00776
00777     printf( "\n" );
00778
00779     if ( pNode->pctFirstChild )
00780     {
00781         PrintSpace( iLevel );
00782         printf( "first child:\n" );
00783         DisplayCommandTree( pNode->pctFirstChild, iLevel + 1 );
00784     }
00785
00786     if ( pNode->pctNextSibling )
00787     {
00788         PrintSpace( iLevel );
00789         printf( "next sibling:\n" );
00790         DisplayCommandTree( pNode->pctNextSibling, iLevel + 1 );
00791     }
00792
00793     if ( 0 == iLevel )
00794         printf( "\n" );
00795 } //DisplayCommandTree
00796
00797
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/VJQuery/Query.java Source File

  • WinBase
  • Indexing
  • VJQuery

Query.java

Go to the documentation of this file.
00001 //Query.java
00002
00003 //+-------------------------------------------------------------------------
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // Copyright 1998-1999, Microsoft Corporation.  All Rights Reserved.
00011 //
00012 // PROGRAM: VJQuery
00013 //
00014 // PURPOSE: Illustrates using Visual J++ and ADO to execute
00015 //      SQL queries with Indexing Service.
00016 //
00017 // PLATFORM: Windows 2000
00018 //
00019 //--------------------------------------------------------------------------
00020
00021 import java.io.*;
00022
00023 // NOTE: The com.ms.wfc imports will become just wfc imports for distribution.
00024
00025 import com.ms.wfc.*;
00026 import com.ms.wfc.core.*;
00027 import com.ms.wfc.data.*;
00028 import com.ms.com.*;
00029
00030 //+-------------------------------------------------------------------------
00031 //
00032 //  Class:      Query
00033 //
00034 //  Synopsis:   Encapsulates setting/executing/displaying a query.
00035 //
00036 //--------------------------------------------------------------------------
00037
00038 public class Query
00039 {
00040     Query()
00041     {
00042         this.m_SqlText = "";
00043     }
00044
00045     //+-------------------------------------------------------------------------
00046     //
00047     //  Method:     Query::SetRawSql
00048     //
00049     //  Synopsis:   Stores a complete SQL query  statement (SELECT, FROM, WHERE).
00050     //
00051     //  Arguments:  [RawSql] -- SQL Query.
00052     //
00053     //--------------------------------------------------------------------------
00054
00055     void SetRawSql( String RawSql )
00056     {
00057         this.m_SqlText = RawSql;
00058     }
00059
00060     //+-------------------------------------------------------------------------
00061     //
00062     //  Method:     Query::SetSqlWhere
00063     //
00064     //  Synopsis:   Stores an SQL WHERE clause.  Remainder of query is fixed.
00065     //
00066     //  Arguments:  [Where] -- SQL WHERE clause, sans WHERE keyword.
00067     //
00068     //--------------------------------------------------------------------------
00069
00070     void SetSqlWhere( String Where )
00071     {
00072         m_SqlText = "SELECT Filename, Size, Write, Path FROM SCOPE('DEEP TRAVERSAL OF \"\\\"') WHERE ";
00073         m_SqlText = m_SqlText + Where;
00074     }
00075
00076     //+-------------------------------------------------------------------------
00077     //
00078     //  Method:     Query::Execute
00079     //
00080     //  Synopsis:   Execute query.
00081     //
00082     //  Notes:      May throw ADO exceptions.
00083     //
00084     //--------------------------------------------------------------------------
00085
00086     void Execute()
00087     {
00088         m_RS = new Recordset();
00089         m_RS.open( m_SqlText,
00090                    "provider=MSIDXS",
00091                    AdoEnums.CursorType.STATIC,
00092                    AdoEnums.LockType.BATCHOPTIMISTIC,
00093                    AdoEnums.CommandType.TEXT );
00094     }
00095
00096     //+-------------------------------------------------------------------------
00097     //
00098     //  Method:     Query::Display
00099     //
00100     //  Synopsis:   Display query results
00101     //
00102     //  Arguments:  [PS] -- Results are written to here.
00103     //
00104     //  Notes:      May throw ADO exceptions.
00105     //
00106     //--------------------------------------------------------------------------
00107
00108     void Display( PrintStream PS )
00109     {
00110         try
00111         {
00112             int cFields = m_RS.getFields().getCount();
00113
00114             while ( !m_RS.getEOF() )
00115             {
00116                 for ( int j = 0; j < cFields; j++ )
00117                     PS.print( m_RS.getFields().getItem(j).getValue() + "\t" );
00118
00119                 PS.print( "\n" );
00120
00121                 m_RS.moveNext();
00122             }
00123         }
00124         catch( com.ms.wfc.data.AdoException e )
00125         {
00126             System.out.println( "Caught " + e.getErrorNumber() );
00127
00128             try
00129             {
00130                 int i = System.in.read();
00131             }
00132             catch( java.lang.Exception e2 )
00133             {
00134             }
00135         }
00136     }
00137
00138     // Members
00139
00140     private String    m_SqlText;
00141     private Recordset m_RS;
00142 }
Generated on Wed Nov 13 2024 16:52:52 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Events/EventNews/NewsEventClass/stdafx.h Source File

  • Com
  • Services
  • Events
  • EventNews
  • NewsEventClass

stdafx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //      or project specific include files that are used frequently,
00003 //      but are changed infrequently
00004
00005 #if !defined(AFX_STDAFX_H__F53B51C1_0F00_11D3_9257_0080C7C30D72__INCLUDED_)
00006 #define AFX_STDAFX_H__F53B51C1_0F00_11D3_9257_0080C7C30D72__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012 #define STRICT
00013 #ifndef _WIN32_WINNT
00014 #define _WIN32_WINNT 0x0400
00015 #endif
00016 #define _ATL_APARTMENT_THREADED
00017
00018 #include <atlbase.h>
00019 //You may derive a class from CComModule and use it if you want to override
00020 //something, but do not change the name of _Module
00021 extern CComModule _Module;
00022 #include <atlcom.h>
00023
00024 //{{AFX_INSERT_LOCATION}}
00025 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00026
00027 #endif // !defined(AFX_STDAFX_H__F53B51C1_0F00_11D3_9257_0080C7C30D72__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/getrec.Cpp Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

getrec.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      GetRec.cpp
00003   Summary:   Implementation of Object Pooled Account component (get receipt)
00004   Classes:   CGetReceipt
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #include "Account.h"
00024 #include <comsvcs.h>
00025 #include "GetRec.h"
00026 #include "UpdRec.h"
00027
00028
00029 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00030   Function: CGetReceipt::InterfaceSupportsErrorInfo
00031   Summary:  Confirms or denies that an error came from IGetReceipt interface
00032   Args:     REFIID riid     Interface ID returned in error
00033   Returns:  HRESULT
00034 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00035 STDMETHODIMP CGetReceipt::InterfaceSupportsErrorInfo(REFIID riid)
00036 {
00037   static const IID* arr[] =
00038   {
00039     &IID_IGetReceipt,
00040   };
00041
00042   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00043   {
00044     // refer to guiddef.h
00045     if (::InlineIsEqualGUID(*arr[i],riid))
00046       return S_OK;
00047   }
00048   return S_FALSE;
00049 }
00050
00051
00052 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00053   Function: CGetReceipt::GetNextReceipt
00054   Summary:  Returns the next available receipt number
00055   Args:     long* plReceiptNo
00056   Returns:  HRESULT       S_OK or E_FAIL
00057 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00058 STDMETHODIMP CGetReceipt::GetNextReceipt (OUT long* plReceiptNo) {
00059
00060   HRESULT hr = S_OK;
00061
00062   IObjectContext* pObjectContext = NULL;
00063
00064   ISharedPropertyGroupManager* spmMgr = NULL;
00065   ISharedPropertyGroup* spmGroup = NULL;
00066   ISharedProperty* spmPropNextReceipt = NULL;
00067   ISharedProperty* spmPropMaxNum = NULL;
00068
00069   IUpdateReceipt* pObjUpdateReceipt = NULL;
00070
00071   CComVariant vNextReceipt;
00072
00073   long lErrFlag = 0;
00074   BSTR sErr = NULL;
00075   LONG lIsolationMode = LockMethod;
00076   LONG lReleaseMode = Process;
00077   CComVariant vMaxNum;
00078   VARIANT_BOOL bExists = VARIANT_FALSE;
00079
00080
00081   hr = CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext);
00082   if (!pObjectContext)
00083   {
00084     sErr = SysAllocString(L"No Object Context in GetNextReceipt");
00085     goto end;
00086   }
00087
00088
00089   // Create the SharedPropertyGroupManager
00090   hr = CoCreateInstance (CLSID_SharedPropertyGroupManager, NULL, CLSCTX_ALL, IID_ISharedPropertyGroupManager, (void**)&spmMgr);
00091   if (FAILED(hr))
00092   {
00093     sErr = SysAllocString(L"Failed to create CLSID_SharedPropertyGroupManager");
00094     goto end;
00095   }
00096
00097
00098   // Create the SharedPropertyGroup
00099
00100   hr = spmMgr->CreatePropertyGroup (L"Receipt", &lIsolationMode, &lReleaseMode, &bExists, &spmGroup);
00101   if (FAILED(hr))
00102   {
00103     sErr = SysAllocString(L"Failed to create 'Receipt' group in SPM");
00104     goto end;
00105   }
00106
00107
00108   // Create the two shared properties
00109   hr = spmGroup->CreateProperty (L"Next", &bExists, &spmPropNextReceipt);
00110   if (FAILED(hr))
00111   {
00112     sErr = SysAllocString(L"Failed to create 'Next' property in SPM");
00113     goto end;
00114   }
00115
00116   hr = spmGroup->CreateProperty (L"MaxNum", &bExists, &spmPropMaxNum);
00117   if (FAILED(hr))
00118   {
00119     sErr = SysAllocString(L"Failed to create 'MaxNum' property in SPM");
00120     goto end;
00121   }
00122
00123
00124   // Obtain their current values
00125   hr = spmPropNextReceipt->get_Value (&vNextReceipt);
00126   _ASSERTE(hr==S_OK);
00127   hr = spmPropMaxNum->get_Value (&vMaxNum);
00128   _ASSERTE(hr==S_OK);
00129
00130   // Does MaxNum require an update?
00131   if (vNextReceipt.lVal >= vMaxNum.lVal)
00132   {
00133
00134     // Create an UpdateReceipt object
00135     hr = CoCreateInstance (CLSID_CUpdateReceipt, NULL, CLSCTX_ALL, IID_IUpdateReceipt,  (void**)&pObjUpdateReceipt);
00136     if (FAILED(hr))
00137     {
00138       sErr = SysAllocString(L"Failed to create UpdateReceipt object");
00139       goto end;
00140
00141     }
00142
00143     // Update NextReceipt
00144     hr = pObjUpdateReceipt->Update (&vNextReceipt.lVal);
00145     if (FAILED(hr))
00146       goto end; // ErrorInfo populated
00147
00148     // Update NextReceipt shared property
00149     hr = spmPropNextReceipt->put_Value (vNextReceipt);
00150     _ASSERTE(hr==S_OK);
00151
00152     // Update MaxNum shared property
00153     vMaxNum.lVal = vNextReceipt.lVal + 100;
00154     hr = spmPropMaxNum->put_Value (vMaxNum);
00155     _ASSERTE(hr == S_OK);
00156   }
00157
00158   // Increment NextReceipt shared property
00159   vNextReceipt.lVal ++;
00160   hr = spmPropNextReceipt->put_Value (vNextReceipt);
00161   _ASSERTE(hr==S_OK);
00162   *plReceiptNo = vNextReceipt.lVal;
00163 end:
00164
00165   if (sErr)
00166   {
00167
00168     AtlReportError( CLSID_CGetReceipt, sErr, IID_IGetReceipt, hr);
00169     if (pObjectContext)
00170       pObjectContext -> SetAbort();
00171     SysFreeString(sErr);
00172
00173   }
00174
00175   else
00176   {
00177     // We're finished and happy
00178     pObjectContext->SetComplete();
00179
00180   }
00181
00182
00183   // Resource cleanup
00184   if (pObjectContext)
00185     pObjectContext->Release();
00186
00187   if (spmMgr)
00188     spmMgr->Release();
00189
00190   if (spmGroup)
00191     spmGroup->Release();
00192
00193   if (spmPropNextReceipt)
00194     spmPropNextReceipt->Release();
00195
00196   if (spmPropMaxNum)
00197     spmPropMaxNum->Release();
00198
00199   if (pObjUpdateReceipt)
00200     pObjUpdateReceipt->Release();
00201
00202   return hr;
00203 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Debug/Deb/DebDebug.c Source File

  • WinBase
  • Debug
  • Deb

DebDebug.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 PARTICULAR PURPOSE.
00007
00008 Copyright (C) 1993 - 2000.  Microsoft Corporation.  All rights reserved.
00009
00010 *       This source code is only intended as a supplement to
00011 *       Microsoft Development Tools and/or WinHelp documentation.
00012 *       See these sources for detailed information regarding the
00013 *       Microsoft samples programs.
00014
00015 MODULE    : DEBDebug.C
00016 PURPOSE   : Debug support functions for the Debug Event Browser
00017 FUNCTIONS :
00018   DebugEventThread()         - debug event processing thread
00019 COMMENTS  :
00020
00021 ************************************************************************/
00022
00023 #define   STRICT               // enable strict typing
00024 #include <Windows.H>           // required for all Windows applications
00025 #include <StdDef.H>            // offsetof()
00026 #include <strsafe.h>           // Safe String Functions
00027
00028 #include "LinkList.H"          // include the linked list functions
00029 #include "DEBMisc.H"           // include the misc. support functions
00030 #include "DEBDebug.H"          // include the DEB debugging functions
00031
00032 // internal global data
00033 // ------------------------------------------------------------------------
00034 HANDLE hHeap;                  // local heap
00035 PLIST  pProcessList;           // pointer to the process list
00036 BOOL   fFinished = FALSE;      // set to TRUE if the DebugEventThread
00037                                //  is no longer needed (such as the
00038                                //  debuggee failed to load or the number
00039                                //  of debuggee threads goes to zero
00040                                //  indicating debug session termination
00041
00042 static TCHAR szSourceFileName[] = TEXT(__FILE__);
00043
00044 // internal function prototypes
00045 // ------------------------------------------------------------------------
00046
00047 //-- debug event handling functions
00048 BOOL HandleExceptionEvent( LPDEBUG_EVENT );
00049 BOOL HandleBreakPointException( LPDEBUG_EVENT );
00050 BOOL HandleCreateThreadEvent( LPDEBUG_EVENT );
00051 BOOL HandleCreateProcessEvent( LPDEBUG_EVENT );
00052 BOOL HandleExitThreadEvent( LPDEBUG_EVENT );
00053 BOOL HandleExitProcessEvent( LPDEBUG_EVENT );
00054 BOOL HandleLoadDllEvent( LPDEBUG_EVENT );
00055 BOOL HandleUnloadDllEvent( LPDEBUG_EVENT );
00056 BOOL HandleOutputDebugStringEvent( LPDEBUG_EVENT );
00057 BOOL HandleRipEvent( LPDEBUG_EVENT );
00058 BOOL HandleUnknownEvent( LPDEBUG_EVENT );
00059
00060 //-- misc debug event helper functions
00061 BOOL  DebugNewProcess( LPTSTR, LPTSTR );
00062 BOOL  GetDllFileName( LPDEBUG_EVENT, LPTSTR, DWORD );
00063 BOOL  GetDllFileNameFromList( LPDEBUG_EVENT, LPTSTR, DWORD );
00064 BOOL  GetOutputDebugString( LPDEBUG_EVENT, LPTSTR, DWORD, LPTSTR, DWORD );
00065 DWORD GetModuleFileNameFromHeader( HANDLE, HANDLE, DWORD_PTR, LPTSTR, DWORD );
00066 #if defined (_ALPHA_) || defined(_AXP64_)
00067  BOOL  SkipBreakPoint( HANDLE );
00068 #endif
00069
00070 //-- linked list wrapper functions
00071
00072 //-- process list and node specific linked list wrapper functions
00073 int  ProcessOrderFunction( PNODE, PNODE );
00074 BOOL CreateProcessList( PLIST* );
00075 BOOL DestroyProcessList( PLIST );
00076 BOOL AllocProcessNode( PNODE*, PDEB_PROCESS_NODE_INFO* );
00077 BOOL InitProcessNodeInfo( PDEB_PROCESS_NODE_INFO*, LPDEBUG_EVENT );
00078 BOOL InsertProcessNode( PLIST, PNODE );
00079 BOOL SetCurrentProcessNode( PLIST, PNODE );
00080 BOOL DeleteProcessNode( PLIST, PNODE );
00081 BOOL FreeProcessNodeInfo( PNODE );
00082 BOOL DestroyProcessNode( PNODE );
00083 BOOL DeleteCurrentProcessNode( PLIST );
00084
00085 //-- thread list and node specific linked list wrapper functions
00086 int  ThreadOrderFunction( PNODE, PNODE );
00087 BOOL CreateThreadList( PLIST* );
00088 BOOL DestroyThreadList( PLIST );
00089 BOOL AllocThreadNode( PNODE*, PDEB_THREAD_NODE_INFO* );
00090 BOOL InitThreadNodeInfo( PDEB_THREAD_NODE_INFO*, LPDEBUG_EVENT );
00091 BOOL InsertThreadNode( PLIST, PNODE );
00092 BOOL SetCurrentThreadNode( PLIST, PNODE );
00093 BOOL DeleteThreadNode( PLIST, PNODE );
00094 BOOL FreeThreadNodeInfo( PNODE );
00095 BOOL DestroyThreadNode( PNODE );
00096 BOOL DeleteCurrentThreadNode( PLIST );
00097
00098 //-- dll list and node specific linked list wrapper functions
00099 int  DllOrderFunction( PNODE, PNODE );
00100 BOOL CreateDllList( PLIST* );
00101 BOOL DestroyDllList( PLIST );
00102 BOOL AllocDllNode( PNODE*, PDEB_DLL_NODE_INFO* );
00103 BOOL InitDllNodeInfo( PDEB_DLL_NODE_INFO*, LPDEBUG_EVENT );
00104 BOOL InsertDllNode( PLIST, PNODE );
00105 BOOL SetCurrentDllNode( PLIST, PNODE );
00106 BOOL DeleteDllNode( PLIST, PNODE );
00107 BOOL FreeDllNodeInfo( PNODE );
00108 BOOL DestroyDllNode( PNODE );
00109 BOOL DeleteCurrentDllNode( PLIST );
00110
00111
00112 // ************************************************************************
00113 // FUNCTION : DebugEventThread( PDEB_STARTUP_INFO )
00114 // PURPOSE  : Main debug event processing loop
00115 // COMMENTS :
00116 //   A new debug event thread is created for each Debuggee process.
00117 //   Return TRUE (non 0) if success, else FALSE (0)
00118 // ************************************************************************
00119 DWORD WINAPI
00120 DebugEventThread( PDEB_STARTUP_INFO pDebStartupInfo )
00121 {
00122   #define BUFFER_SIZE 256
00123
00124   static BOOL  fFirstTime = TRUE;
00125   static TCHAR szDebuggeeTitle[128];
00126
00127   DEBUG_EVENT  DebugEvent;
00128
00129   LPTSTR lpszDebugEventBuffer;
00130   LPTSTR lpszTempBuffer;
00131   LPTSTR lpszRawBuffer;
00132
00133   //-- set the minimum error level for debugging events
00134   SetDebugErrorLevel( Profile.DebugErrorLevel );
00135
00136   if( fFirstTime ) {
00137     if( !LoadString( Global.hInstance, IDS_OFN_DEBUGGEE_TITLE, szDebuggeeTitle,
00138            sizeof(szDebuggeeTitle)/sizeof(TCHAR) ) )
00139       ErrorMessageBox( TEXT("LoadString()"),
00140         Global.szApiFailed, szSourceFileName, __LINE__ );
00141   }
00142
00143   //-- determine if 'attach to' or 'open new' debuggee
00144   if( pDebStartupInfo->fActive ) {
00145     if( !DebugActiveProcess( pDebStartupInfo->dwProcessId ) )
00146       ErrorMessageBox( TEXT("DebugActiveProcess()"),
00147         Global.szApiFailed, szSourceFileName, __LINE__ );
00148   }
00149   else {
00150     if( !DebugNewProcess( pDebStartupInfo->lpstrPathName, szDebuggeeTitle ) )
00151     ExitThread( FALSE );
00152   }
00153
00154   //-- increment active process count
00155   Global.dwActiveDebuggees++;
00156
00157   //-- create a local heap
00158   {
00159     SYSTEM_INFO SysInfo;
00160
00161     GetSystemInfo( &SysInfo );  // get the system memory page size
00162     hHeap = HeapCreate( 0L, SysInfo.dwPageSize, 1000*SysInfo.dwPageSize );
00163   }
00164
00165   //-- create and initialize the process list
00166   CreateProcessList( &pProcessList );
00167
00168   //-- alloc temporary (life of thread) string buffers
00169   lpszDebugEventBuffer = (LPTSTR) HeapAlloc( hHeap, 0L, BUFFER_SIZE * sizeof(TCHAR) );
00170   lpszTempBuffer = (LPTSTR) HeapAlloc( hHeap, 0L, BUFFER_SIZE * sizeof(TCHAR) );
00171   lpszRawBuffer = (LPTSTR) HeapAlloc( hHeap, 0L, BUFFER_SIZE * sizeof(TCHAR) );
00172
00173   // ----------------------------------------------------------------------
00174   // begin debug event processing loop
00175   // ----------------------------------------------------------------------
00176   for(;;) {
00177
00178     //-- wait for debug events
00179     if( !WaitForDebugEvent( &DebugEvent, INFINITE ) ) {
00180       ListBoxPrintF( pDebStartupInfo->hWndListBox, TEXT( "%s" ), TEXT( "Failed to attach to Debuggee..." ) );
00181       fFinished = TRUE;
00182       break;
00183     }
00184
00185     // --------------------------------------------------------------------
00186     // display each debug event as it occurs and handle minimal debug
00187     // event processing
00188     // --------------------------------------------------------------------
00189     MakeCommonDebugEventString( lpszDebugEventBuffer, BUFFER_SIZE, &DebugEvent );
00190
00191     switch( DebugEvent.dwDebugEventCode ) {
00192
00193       // ------------------------------------------------------------------
00194       // exception occured
00195       // ------------------------------------------------------------------
00196       case EXCEPTION_DEBUG_EVENT:
00197
00198         //-- figure out which type of exception
00199         switch( DebugEvent.u.Exception.ExceptionRecord.ExceptionCode ) {
00200
00201           //--standard exceptions
00202           case EXCEPTION_ACCESS_VIOLATION:
00203             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00204               TEXT( "Exception: " ), TEXT( "Access Violation" ) );
00205             break;
00206
00207           case EXCEPTION_DATATYPE_MISALIGNMENT:
00208             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00209               TEXT( "Exception: " ), TEXT( "Datatype Misalignment" ) );
00210             break;
00211
00212           case EXCEPTION_BREAKPOINT:
00213             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00214               TEXT( "Exception: " ), TEXT( "Breakpoint" ) );
00215             break;
00216
00217           case EXCEPTION_SINGLE_STEP:
00218             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00219               TEXT( "Exception: " ), TEXT( "Single Step" ) );
00220             break;
00221
00222           case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
00223             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00224               TEXT( "Exception: " ), TEXT( "Array Bound Exceeded" ) );
00225             break;
00226
00227           case EXCEPTION_FLT_DENORMAL_OPERAND:
00228             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00229               TEXT( "Exception: " ), TEXT( "Floating Point" ),
00230               TEXT( "Denormal Operand" ) );
00231             break;
00232
00233           case EXCEPTION_FLT_DIVIDE_BY_ZERO:
00234             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00235               TEXT( "Exception: " ), TEXT( "Floating Point" ),
00236               TEXT( "Divide By Zero" ) );
00237             break;
00238
00239           case EXCEPTION_FLT_INEXACT_RESULT:
00240             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00241               TEXT( "Exception: " ), TEXT( "Floating Point" ),
00242               TEXT( "Inexact Result" ) );
00243             break;
00244
00245           case EXCEPTION_FLT_INVALID_OPERATION:
00246             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00247               TEXT( "Exception: " ), TEXT( "Floating Point" ),
00248               TEXT( "Invalid Operation" ) );
00249             break;
00250
00251           case EXCEPTION_FLT_OVERFLOW:
00252             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00253               TEXT( "Exception: " ), TEXT( "Floating Point" ),
00254               TEXT( "Overflow" ) );
00255             break;
00256
00257           case EXCEPTION_FLT_STACK_CHECK:
00258             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00259               TEXT( "Exception: " ), TEXT( "Floating Point" ),
00260               TEXT( "Stack Check" ) );
00261             break;
00262
00263           case EXCEPTION_FLT_UNDERFLOW:
00264             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00265               TEXT( "Exception: " ), TEXT( "Floating Point" ),
00266               TEXT( "Underflow" ) );
00267             break;
00268
00269           case EXCEPTION_INT_DIVIDE_BY_ZERO:
00270             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00271               TEXT( "Exception: " ), TEXT( "Integer" ),
00272               TEXT( "Divide By Zero" ) );
00273             break;
00274
00275           case EXCEPTION_INT_OVERFLOW:
00276             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s %s" ),
00277               TEXT( "Exception: " ), TEXT( "Integer" ),
00278               TEXT( "Overflow" ) );
00279             break;
00280
00281           case EXCEPTION_PRIV_INSTRUCTION:
00282             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00283               TEXT( "Exception: " ), TEXT( "Privileged Instruction" ) );
00284             break;
00285
00286           case EXCEPTION_IN_PAGE_ERROR:
00287             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00288               TEXT( "Exception: " ), TEXT( "In Page Error" ) );
00289             break;
00290
00291           //-- Debug exceptions
00292           case DBG_TERMINATE_THREAD:
00293             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00294               TEXT( "Debug Exception: " ), TEXT( "Terminate Thread" ) );
00295             break;
00296
00297           case DBG_TERMINATE_PROCESS:
00298             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00299               TEXT( "Debug Exception: " ), TEXT( "Terminate Process" ) );
00300             break;
00301
00302           case DBG_CONTROL_C:
00303             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00304               TEXT( "Debug Exception: " ), TEXT( "Control+C" ) );
00305             break;
00306
00307           case DBG_CONTROL_BREAK:
00308             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00309               TEXT( "Debug Exception: " ), TEXT( "Control+Break" ) );
00310             break;
00311
00312           //-- RPC exceptions (some)
00313           case RPC_S_UNKNOWN_IF:
00314             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00315               TEXT( "RPC Exception: " ), TEXT( "Unknown Interface" ) );
00316             break;
00317
00318           case RPC_S_SERVER_UNAVAILABLE:
00319             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s" ),
00320               TEXT( "RPC Exception: " ), TEXT( "Server Unavailable" ) );
00321             break;
00322
00323           //-- VDM exceptions (minimal information)
00324           case EXCEPTION_VDM_EVENT:  // see DEBDebug.H for definition
00325             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00326               TEXT( "VDM Exception: " ) );
00327
00328           default:
00329             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%s%X%s" ),
00330               TEXT( "Exception: " ), TEXT( "Unknown [0x" ),
00331                DebugEvent.u.Exception.ExceptionRecord.ExceptionCode,
00332                TEXT( "]" ) );
00333             break;
00334
00335         }
00336         if( Profile.fVerbose ) {
00337           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "\n + %s%d" ),
00338             TEXT( "dwFirstChance: " ), DebugEvent.u.Exception.dwFirstChance );
00339         }
00340         else {
00341           if( DebugEvent.u.Exception.dwFirstChance != 0 )
00342             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00343               TEXT( " - First Chance" ) );
00344           else
00345             StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00346               TEXT( " - Second Chance" ) );
00347         }
00348         HandleExceptionEvent( &DebugEvent );
00349         break;
00350
00351       // ------------------------------------------------------------------
00352       // new thread started
00353       // ------------------------------------------------------------------
00354       case CREATE_THREAD_DEBUG_EVENT:
00355         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00356           TEXT( "Create Thread: " ) );
00357         if( Profile.fVerbose ) {
00358           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "\n + %s%d\n + %s%X\n + %s%d" ),
00359             TEXT( "hThread:0x" ), DebugEvent.u.CreateThread.hThread,
00360             TEXT( "lpThreadLocalBase:0x" ), DebugEvent.u.CreateThread.lpThreadLocalBase,
00361             TEXT( "lpStartAddress:0x" ), DebugEvent.u.CreateThread.lpStartAddress );
00362         }
00363         HandleCreateThreadEvent( &DebugEvent );
00364         break;
00365
00366       // ------------------------------------------------------------------
00367       // new process started
00368       // ------------------------------------------------------------------
00369       case CREATE_PROCESS_DEBUG_EVENT:
00370         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00371           TEXT( "Create Process: " ) );
00372         if( Profile.fVerbose ) {
00373           StringAppendF( lpszDebugEventBuffer,
00374 BUFFER_SIZE,             TEXT( "\n + %s%X\n + %s%X\n + %s%X\n + %s%X\n + %s%d" )
00375             TEXT( "\n + %s%d\n + %s%X\n + %s%X\n + %s%X\n + %s%d" ),
00376             TEXT( "hFile:0x" ), DebugEvent.u.CreateProcessInfo.hFile,
00377             TEXT( "hProcess:0x" ), DebugEvent.u.CreateProcessInfo.hProcess,
00378             TEXT( "hThread:0x" ), DebugEvent.u.CreateProcessInfo.hThread,
00379             TEXT( "lpBaseOfImage:0x" ), DebugEvent.u.CreateProcessInfo.lpBaseOfImage,
00380             TEXT( "dwDebugInfoFileOffset: " ), DebugEvent.u.CreateProcessInfo.dwDebugInfoFileOffset,
00381             TEXT( "nDebugInfoSize: " ), DebugEvent.u.CreateProcessInfo.nDebugInfoSize,
00382             TEXT( "lpThreadLocalBase:0x" ), DebugEvent.u.CreateProcessInfo.lpThreadLocalBase,
00383             TEXT( "lpStartAddress:0x" ), DebugEvent.u.CreateProcessInfo.lpStartAddress,
00384             TEXT( "lpImageName:0x" ), DebugEvent.u.CreateProcessInfo.lpImageName,
00385             TEXT( "fUnicode: " ), DebugEvent.u.CreateProcessInfo.fUnicode );
00386         }
00387         HandleCreateProcessEvent( &DebugEvent );
00388         break;
00389
00390       // ------------------------------------------------------------------
00391       // existing thread terminated
00392       // ------------------------------------------------------------------
00393       case EXIT_THREAD_DEBUG_EVENT:
00394         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00395           TEXT( "Exit Thread: " ) );
00396         if( Profile.fVerbose ) {
00397           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "\n + %s%d" ),
00398             TEXT( "dwExitCode: " ), DebugEvent.u.ExitThread.dwExitCode );
00399         }
00400         else {
00401           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%d" ),
00402             TEXT( "Returned " ), DebugEvent.u.ExitThread.dwExitCode );
00403         }
00404         HandleExitThreadEvent( &DebugEvent );
00405         break;
00406
00407       // ------------------------------------------------------------------
00408       // existing process terminated
00409       // ------------------------------------------------------------------
00410       case EXIT_PROCESS_DEBUG_EVENT:
00411         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00412           TEXT( "Exit Process: " ) );
00413         if( Profile.fVerbose ) {
00414           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "\n + %s%d" ),
00415             TEXT( "dwExitCode: " ), DebugEvent.u.ExitProcess.dwExitCode );
00416         }
00417         else {
00418           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%d" ),
00419             TEXT( "Returned " ), DebugEvent.u.ExitProcess.dwExitCode );
00420         }
00421         HandleExitProcessEvent( &DebugEvent );
00422         break;
00423
00424       // ------------------------------------------------------------------
00425       // new DLL loaded
00426       // ------------------------------------------------------------------
00427       case LOAD_DLL_DEBUG_EVENT:
00428         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00429           TEXT( "Load DLL: " ) );
00430         StringCbCopy( lpszTempBuffer, sizeof(lpszTempBuffer) , TEXT("Empty!") );
00431         GetDllFileName( &DebugEvent, lpszTempBuffer, BUFFER_SIZE );
00432         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ), lpszTempBuffer );
00433         if( Profile.fVerbose ) {
00434           StringAppendF( lpszDebugEventBuffer,
00435 BUFFER_SIZE,             TEXT( "\n + %s%X\n + %s%X\n + %s%d\n + %s%d\n + %s%X\n + %s%d" ),
00436             TEXT( "hFile:0x" ), DebugEvent.u.LoadDll.hFile,
00437             TEXT( "lpBaseOfDll:0x" ), DebugEvent.u.LoadDll.lpBaseOfDll,
00438             TEXT( "dwDebugInfoFileOffset: " ), DebugEvent.u.LoadDll.dwDebugInfoFileOffset,
00439             TEXT( "nDebugInfoSize: " ), DebugEvent.u.LoadDll.nDebugInfoSize,
00440             TEXT( "lpImageName:0x" ), DebugEvent.u.LoadDll.lpImageName,
00441             TEXT( "fUnicode: " ), DebugEvent.u.LoadDll.fUnicode );
00442         }
00443         HandleLoadDllEvent( &DebugEvent );
00444         break;
00445
00446       // ------------------------------------------------------------------
00447       // existing DLL explicitly unloaded
00448       // ------------------------------------------------------------------
00449       case UNLOAD_DLL_DEBUG_EVENT:
00450         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ), TEXT( "Unload DLL: " ) );
00451         GetDllFileNameFromList( &DebugEvent, lpszTempBuffer, BUFFER_SIZE );
00452         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ), lpszTempBuffer );
00453         if( Profile.fVerbose ) {
00454           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "\n + %s%X" ),
00455             TEXT( "lpBaseOfDLL:0x" ), DebugEvent.u.UnloadDll.lpBaseOfDll );
00456         }
00457         HandleUnloadDllEvent( &DebugEvent );
00458         break;
00459
00460       // ------------------------------------------------------------------
00461       // OutputDebugString() occured
00462       // ------------------------------------------------------------------
00463       case OUTPUT_DEBUG_STRING_EVENT:
00464         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00465           TEXT( "Output Debug String: " ) );
00466         GetOutputDebugString( &DebugEvent, lpszTempBuffer, BUFFER_SIZE,
00467                               lpszRawBuffer, BUFFER_SIZE );
00468         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ), lpszTempBuffer );
00469         if( Profile.fVerbose ) {
00470           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "\n + %s%X\n + %s%d\n + %s%d" ),
00471             TEXT( "lpDebugStringData:0x" ), DebugEvent.u.DebugString.lpDebugStringData,
00472             TEXT( "fUnicode: " ), DebugEvent.u.DebugString.fUnicode,
00473             TEXT( "nDebugStringLength: " ), DebugEvent.u.DebugString.nDebugStringLength );
00474         }
00475         HandleOutputDebugStringEvent( &DebugEvent );
00476         break;
00477
00478       // ------------------------------------------------------------------
00479       // RIP occured
00480       // ------------------------------------------------------------------
00481       case RIP_EVENT:
00482         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s" ),
00483           TEXT( "RIP" ) );
00484         if( Profile.fVerbose ) {
00485           StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "\n + %s%d\n + %s%d" ),
00486             TEXT( "dwError: " ), DebugEvent.u.RipInfo.dwError,
00487             TEXT( "dwType: " ), DebugEvent.u.RipInfo.dwType );
00488         }
00489         HandleRipEvent( &DebugEvent );
00490         break;
00491
00492       // ------------------------------------------------------------------
00493       // unknown debug event occured
00494       // ------------------------------------------------------------------
00495       default:
00496         StringAppendF( lpszDebugEventBuffer, BUFFER_SIZE, TEXT( "%s%X%s" ),
00497           TEXT( "Debug Event:Unknown [0x" ),
00498           DebugEvent.dwDebugEventCode, lpszTempBuffer,
00499           TEXT( "]" ) );
00500         HandleUnknownEvent( &DebugEvent );
00501         break;
00502     }
00503
00504     //-- insert the debug event string into the listbox
00505     ListBoxPrintF( pDebStartupInfo->hWndListBox, TEXT( "%s" ), lpszDebugEventBuffer );
00506
00507     //-- default action, just continue
00508     if( fFinished ) {
00509       fFinished = FALSE;   // reset the value
00510       break;
00511     }
00512     else
00513       ContinueDebugEvent( DebugEvent.dwProcessId, DebugEvent.dwThreadId,
00514         DBG_CONTINUE );
00515   }
00516
00517   //-- free temporary (life of thread) string buffers
00518   HeapFree( hHeap, 0L, (PVOID) lpszDebugEventBuffer );
00519   HeapFree( hHeap, 0L, (PVOID) lpszTempBuffer );
00520   HeapFree( hHeap, 0L, (PVOID) lpszRawBuffer );
00521
00522   //-- free list
00523   DestroyProcessList( pProcessList );
00524
00525   //-- free the heap
00526   HeapDestroy( hHeap );
00527
00528   //-- decrement active process count
00529   Global.dwActiveDebuggees--;
00530   ExitThread( TRUE );
00531
00532   return( TRUE );  // avoid the "no return value" warning
00533 }
00534
00535
00536 // ========================================================================
00537 // debug event handling functions
00538 // ========================================================================
00539
00540
00541 // ************************************************************************
00542 // FUNCTION : HandleExceptionEvent( LPDEBUG_EVENT lpDebugEvent )
00543 // PURPOSE  : handle EXCEPTION_DEBUG_EVENT
00544 // COMMENTS : except for the BreakPoint event, continue and let the
00545 //            application or system exception handlers to the work
00546 // ************************************************************************
00547 BOOL
00548 HandleExceptionEvent( LPDEBUG_EVENT lpDebugEvent )
00549 {
00550   switch( lpDebugEvent->u.Exception.ExceptionRecord.ExceptionCode ) {
00551
00552     case EXCEPTION_BREAKPOINT:
00553       HandleBreakPointException( lpDebugEvent );
00554       break;
00555
00556     default:
00557       ContinueDebugEvent( lpDebugEvent->dwProcessId, lpDebugEvent->dwThreadId,
00558         DBG_EXCEPTION_NOT_HANDLED );
00559
00560   }
00561
00562   return( TRUE );
00563 }
00564
00565
00566 // ************************************************************************
00567 // FUNCTION : HandleBreakPointException( LPDEBUG_EVENT lpDebugEvent )
00568 // PURPOSE  : handle the BREAKPOINT exception
00569 // COMMENTS : search process list, search thread list, skip over breakpoint
00570 // ************************************************************************
00571 BOOL
00572 HandleBreakPointException( LPDEBUG_EVENT lpDebugEvent )
00573 {
00574 #if defined(_ALPHA_) || defined(_AXP64_)
00575   PNODE                  pProcessNode, pSearchProcessNode;
00576   PNODE                  pThreadNode, pSearchThreadNode;
00577   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00578   PDEB_THREAD_NODE_INFO  pThreadNodeInfo, pSearchThreadNodeInfo;
00579   PDEB_THREAD_LIST_INFO  pThreadListInfo;
00580
00581   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00582   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00583   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00584   GetCurrentNode( pProcessList, &pProcessNode );
00585   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00586   pThreadListInfo = (PDEB_THREAD_LIST_INFO) pProcessNodeInfo->pThreadList->pListData;
00587   //-- if no thread nodes then hThread is stored in the process node
00588   if( !pThreadListInfo->dwActiveThreads ) {
00589     SkipBreakPoint( (pProcessNodeInfo->ProcessDebugInfo).hThread );
00590   }
00591   else {
00592     AllocThreadNode( &pSearchThreadNode, &pSearchThreadNodeInfo );
00593     pSearchThreadNodeInfo->dwThreadId = lpDebugEvent->dwThreadId;
00594     SetCurrentThreadNode( pProcessNodeInfo->pThreadList, pSearchThreadNode );
00595     GetCurrentNode( pProcessNodeInfo->pThreadList, &pThreadNode );
00596     pThreadNodeInfo = (PDEB_THREAD_NODE_INFO) pThreadNode->pNodeData;
00597     SkipBreakPoint( (pThreadNodeInfo->ThreadDebugInfo).hThread );
00598     DestroyThreadNode( pSearchThreadNode );
00599   }
00600   DestroyProcessNode( pSearchProcessNode );
00601  #else
00602
00603   ContinueDebugEvent( lpDebugEvent->dwProcessId, lpDebugEvent->dwThreadId,
00604     DBG_CONTINUE );
00605  #endif
00606
00607   return( TRUE );
00608 }
00609
00610
00611 // ************************************************************************
00612 // FUNCTION : HandleCreateThreadEvent( LPDEBUG_EVENT )
00613 // PURPOSE  : handle CREATE_THREAD_DEBUG_EVENT
00614 // COMMENTS : search process list, insert new thread node
00615 // ************************************************************************
00616 BOOL
00617 HandleCreateThreadEvent( LPDEBUG_EVENT lpDebugEvent )
00618 {
00619   PNODE                  pProcessNode, pSearchProcessNode;
00620   PNODE                  pThreadNode;
00621   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00622   PDEB_THREAD_NODE_INFO  pThreadNodeInfo;
00623
00624   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00625   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00626   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00627   GetCurrentNode( pProcessList, &pProcessNode );
00628   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00629   AllocThreadNode( &pThreadNode, &pThreadNodeInfo );
00630   InitThreadNodeInfo( &pThreadNodeInfo, lpDebugEvent );
00631   InsertThreadNode( pProcessNodeInfo->pThreadList, pThreadNode );
00632   DestroyProcessNode( pSearchProcessNode );
00633
00634   return( TRUE );
00635 }
00636
00637
00638 // ************************************************************************
00639 // FUNCTION : HandleCreateProcessEvent( LPDEBUG_EVENT )
00640 // PURPOSE  : handle CREATE_PROCESS_DEBUG_EVENT
00641 // COMMENTS : insert new process node
00642 // ************************************************************************
00643 BOOL
00644 HandleCreateProcessEvent( LPDEBUG_EVENT lpDebugEvent )
00645 {
00646   PNODE                  pProcessNode;
00647   PDEB_PROCESS_NODE_INFO pProcessNodeInfo;
00648
00649   AllocProcessNode( &pProcessNode, &pProcessNodeInfo );
00650   InitProcessNodeInfo( &pProcessNodeInfo, lpDebugEvent );
00651   InsertProcessNode( pProcessList, pProcessNode );
00652
00653   return( TRUE );
00654 }
00655
00656
00657 // ************************************************************************
00658 // FUNCTION : HandleExitThreadEvent( LPDEBUG_EVENT )
00659 // PURPOSE  : handle EXIT_THREAD_DEBUG_EVENT
00660 // COMMENTS : search process list, search thread list, delete existing
00661 //            thread node
00662 // ************************************************************************
00663 BOOL
00664 HandleExitThreadEvent( LPDEBUG_EVENT lpDebugEvent )
00665 {
00666   PNODE                  pProcessNode, pSearchProcessNode;
00667   PNODE                  pSearchThreadNode;
00668   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00669   PDEB_THREAD_NODE_INFO  pSearchThreadNodeInfo;
00670
00671   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00672   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00673   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00674   GetCurrentNode( pProcessList, &pProcessNode );
00675   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00676   AllocThreadNode( &pSearchThreadNode, &pSearchThreadNodeInfo );
00677   pSearchThreadNodeInfo->dwThreadId = lpDebugEvent->dwThreadId;
00678   DeleteThreadNode( pProcessNodeInfo->pThreadList, pSearchThreadNode );
00679   DestroyThreadNode( pSearchThreadNode );
00680   DestroyProcessNode( pSearchProcessNode );
00681
00682   return( TRUE );
00683 }
00684
00685
00686 // ************************************************************************
00687 // FUNCTION : HandleExitProcessEvent( LPDEBUG_EVENT )
00688 // PURPOSE  : handle EXIT_PROCESS_DEBUG_EVENT
00689 // COMMENTS : search process list, delete existing process node,
00690 // ************************************************************************
00691 BOOL
00692 HandleExitProcessEvent( LPDEBUG_EVENT lpDebugEvent )
00693 {
00694   PNODE                  pSearchProcessNode;
00695   PDEB_PROCESS_NODE_INFO pSearchProcessNodeInfo;
00696   PDEB_PROCESS_LIST_INFO pProcessListInfo;
00697
00698   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00699   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00700   DeleteProcessNode( pProcessList, pSearchProcessNode );
00701   //-- if last process? free all temporary memory, exit thread
00702   pProcessListInfo = (PDEB_PROCESS_LIST_INFO) pProcessList->pListData;
00703   if( !pProcessListInfo->dwActiveProcesses )
00704     fFinished = TRUE;
00705   DestroyProcessNode( pSearchProcessNode );
00706
00707   return( TRUE );
00708 }
00709
00710
00711 // ************************************************************************
00712 // FUNCTION : HandleLoadDllEvent( LPDEBUG_EVENT )
00713 // PURPOSE  : handle LOAD_DLL_DEBUG_EVENT
00714 // COMMENTS : search process list, insert new DLL node
00715 // ************************************************************************
00716 BOOL
00717 HandleLoadDllEvent( LPDEBUG_EVENT lpDebugEvent )
00718 {
00719   PNODE                  pProcessNode, pSearchProcessNode;
00720   PNODE                  pDllNode;
00721   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00722   PDEB_DLL_NODE_INFO     pDllNodeInfo;
00723
00724   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00725   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00726   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00727   GetCurrentNode( pProcessList, &pProcessNode );
00728   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00729   AllocDllNode( &pDllNode, &pDllNodeInfo );
00730   InitDllNodeInfo( &pDllNodeInfo, lpDebugEvent );
00731   InsertDllNode( pProcessNodeInfo->pDllList, pDllNode );
00732   DestroyProcessNode( pSearchProcessNode );
00733
00734   return( TRUE );
00735 }
00736
00737
00738 // ************************************************************************
00739 // FUNCTION : HandleUnloadDllEvent( LPDEBUG_EVENT )
00740 // PURPOSE  : handle UNLOAD_DLL_DEBUG_EVENT
00741 // COMMENTS : search process list, search DLL list, delete existing DLL
00742 //            node
00743 // ************************************************************************
00744 BOOL
00745 HandleUnloadDllEvent( LPDEBUG_EVENT lpDebugEvent )
00746 {
00747   PNODE                  pProcessNode, pSearchProcessNode;
00748   PNODE                  pSearchDllNode;
00749   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00750   PDEB_DLL_NODE_INFO     pSearchDllNodeInfo;
00751
00752   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00753   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00754   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00755   GetCurrentNode( pProcessList, &pProcessNode );
00756   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00757   AllocDllNode( &pSearchDllNode, &pSearchDllNodeInfo );
00758   pSearchDllNodeInfo->DllDebugInfo.lpBaseOfDll = lpDebugEvent->u.UnloadDll.lpBaseOfDll;
00759   DeleteDllNode( pProcessNodeInfo->pDllList, pSearchDllNode );
00760   DestroyDllNode( pSearchDllNode );
00761   DestroyProcessNode( pSearchProcessNode );
00762
00763   return( TRUE );
00764 }
00765
00766
00767 // ************************************************************************
00768 // FUNCTION : HandleOutputDebugStringEvent( LPDEBUG_EVENT )
00769 // PURPOSE  : handle OUTPUT_DEBUG_STRING_EVENT
00770 // COMMENTS : do nothing
00771 // ************************************************************************
00772 BOOL
00773 HandleOutputDebugStringEvent( LPDEBUG_EVENT lpDebugEvent )
00774 {
00775   return( TRUE );
00776 }
00777
00778
00779 // ************************************************************************
00780 // FUNCTION : HandleRipEvent( LPDEBUG_EVENT )
00781 // PURPOSE  : handle RIP_EVENT
00782 // COMMENTS : do nothing
00783 // ************************************************************************
00784 BOOL
00785 HandleRipEvent( LPDEBUG_EVENT lpDebugEvent )
00786 {
00787   return( TRUE );
00788 }
00789
00790
00791 // ************************************************************************
00792 // FUNCTION : HandleUnknownEvent( LPDEBUG_EVENT )
00793 // PURPOSE  : handle all unknown debug events
00794 // COMMENTS : do nothing
00795 // ************************************************************************
00796 BOOL
00797 HandleUnknownEvent( LPDEBUG_EVENT lpDebugEvent )
00798 {
00799   return( TRUE );
00800 }
00801
00802
00803 // ========================================================================
00804 // misc debug event helper functions
00805 // ========================================================================
00806
00807
00808 // ************************************************************************
00809 // FUNCTION : DebugNewProcess( LPTSTR, LPTSTR )
00810 // PURPOSE  : starts a new process as a debuggee
00811 // COMMENTS :
00812 // ************************************************************************
00813 BOOL
00814 DebugNewProcess( LPTSTR lpszFileName, LPTSTR lpszTitle )
00815 {
00816   static STARTUPINFO           StartupInfo;
00817   static LPSTARTUPINFO         lpStartupInfo = &StartupInfo;
00818   static PROCESS_INFORMATION   ProcessInfo;
00819   static LPPROCESS_INFORMATION lpProcessInfo = &ProcessInfo;
00820
00821   lpStartupInfo->cb          = sizeof( STARTUPINFO );
00822   lpStartupInfo->lpDesktop   = 0L;
00823   lpStartupInfo->lpTitle     = lpszTitle;
00824   lpStartupInfo->dwX         = 0;
00825   lpStartupInfo->dwY         = 0;
00826   lpStartupInfo->dwXSize     = 0;
00827   lpStartupInfo->dwYSize     = 0;
00828   lpStartupInfo->dwFlags     = 0L;
00829   lpStartupInfo->wShowWindow = SW_SHOWDEFAULT;
00830
00831   lpProcessInfo->hProcess = 0L;
00832
00833   //-- create the Debuggee process instead
00834   if( !CreateProcess(
00835          0L,
00836          lpszFileName,
00837          (LPSECURITY_ATTRIBUTES) 0L,
00838          (LPSECURITY_ATTRIBUTES) 0L,
00839          TRUE,
00840          Profile.DebugMode | Profile.DebuggeePriority | CREATE_NEW_CONSOLE,
00841          (LPVOID) 0L,
00842          (LPTSTR) 0L,
00843          lpStartupInfo, lpProcessInfo ) ) {
00844
00845     switch( GetLastError() ) {
00846
00847       case ERROR_FILE_NOT_FOUND:
00848         MessageBox( GetDesktopWindow(), TEXT( "This file does not exist." ),
00849           TEXT( "Open File Error" ), MB_OK | MB_APPLMODAL | MB_SETFOREGROUND );
00850         break;
00851       case ERROR_ACCESS_DENIED:
00852         MessageBox( GetDesktopWindow(), TEXT( "Access denied." ),
00853           TEXT( "Open File Error" ), MB_OK | MB_APPLMODAL | MB_SETFOREGROUND );
00854         break;
00855       case ERROR_FILE_INVALID:
00856         MessageBox( GetDesktopWindow(), TEXT( "Invalid file." ),
00857           TEXT( "Open File Error" ), MB_OK | MB_APPLMODAL | MB_SETFOREGROUND );
00858         break;
00859       case ERROR_FILE_CORRUPT:
00860         MessageBox( GetDesktopWindow(), TEXT( "The file is corrupt." ),
00861           TEXT( "Open File Error" ), MB_OK | MB_APPLMODAL | MB_SETFOREGROUND );
00862         break;
00863       case ERROR_BAD_EXE_FORMAT:
00864         MessageBox( GetDesktopWindow(), TEXT( "The file has a bad format." ),
00865           TEXT( "Open File Error" ), MB_OK | MB_APPLMODAL | MB_SETFOREGROUND );
00866         break;
00867       default:
00868         ErrorMessageBox( TEXT( "CreateProcess()" ),
00869           Global.szApiFailed, szSourceFileName, __LINE__ );
00870         break;
00871
00872     }
00873     return( FALSE );
00874
00875   }
00876   else {
00877     CloseHandle( ProcessInfo.hProcess );
00878     CloseHandle( ProcessInfo.hThread );
00879   }
00880
00881   return( TRUE
00882  );
00883 }
00884
00885
00886 // ************************************************************************
00887 // FUNCTION : GetDllFileName( LPDEBUG_EVENT, LPTSTR, DWORD )
00888 // PURPOSE  : get DLL filename when LOAD_DLL_DEBUG_EVENT occurs
00889 // COMMENTS : search process list, get DLL name from header
00890 // ************************************************************************
00891 BOOL
00892 GetDllFileName( LPDEBUG_EVENT lpDebugEvent, LPTSTR lpszBuffer,
00893   DWORD cchBuffer )
00894 {
00895   PNODE                  pProcessNode, pSearchProcessNode;
00896   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00897
00898   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00899   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00900   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00901   GetCurrentNode( pProcessList, &pProcessNode );
00902   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00903   GetModuleFileNameFromHeader(
00904     pProcessNodeInfo->ProcessDebugInfo.hProcess,
00905     lpDebugEvent->u.LoadDll.hFile,
00906     (DWORD_PTR)lpDebugEvent->u.LoadDll.lpBaseOfDll,
00907     lpszBuffer, cchBuffer);
00908   DestroyProcessNode( pSearchProcessNode );
00909
00910   return( TRUE );
00911 }
00912
00913
00914 // ************************************************************************
00915 // FUNCTION : GetDllFileNameFromList( LPDEBUG_EVENT, LPTSTR, DWORD )
00916 // PURPOSE  : get DLL filename when UNLOAD_DLL_DEBUG_EVENT occurs
00917 // COMMENTS : search process list, search DLL list, get DLL name
00918 // ************************************************************************
00919 BOOL
00920 GetDllFileNameFromList( LPDEBUG_EVENT lpDebugEvent, LPTSTR lpszBuffer,
00921   DWORD cchBuffer )
00922 {
00923   PNODE                  pProcessNode, pSearchProcessNode;
00924   PNODE                  pDllNode, pSearchDllNode;
00925   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00926   PDEB_DLL_NODE_INFO     pDllNodeInfo, pSearchDllNodeInfo;
00927
00928   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00929   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00930   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00931   GetCurrentNode( pProcessList, &pProcessNode );
00932   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00933   AllocDllNode( &pSearchDllNode, &pSearchDllNodeInfo );
00934   pSearchDllNodeInfo->DllDebugInfo.lpBaseOfDll = lpDebugEvent->u.UnloadDll.lpBaseOfDll;
00935   SetCurrentDllNode( pProcessNodeInfo->pDllList, pSearchDllNode );
00936   GetCurrentNode( pProcessNodeInfo->pDllList, &pDllNode );
00937   pDllNodeInfo = (PDEB_DLL_NODE_INFO) pDllNode->pNodeData;
00938   lstrcpyn( lpszBuffer, pDllNodeInfo->lpstrFileName, cchBuffer );
00939
00940   return( TRUE );
00941 }
00942
00943
00944 // ************************************************************************
00945 // FUNCTION : GetOutputDebugString( LPDEBUG_EVENT, LPTSTR, DWORD, LPTSTR, DWORD )
00946 // PURPOSE  : get the output debug string from the debuggee when
00947 //            OUTPUT_DEBUG_STRING_EVENT occurs
00948 // COMMENTS : search process list, read the string from the debuggee
00949 // ************************************************************************
00950 BOOL
00951 GetOutputDebugString( LPDEBUG_EVENT lpDebugEvent, LPTSTR lpszBuffer,
00952   DWORD cchBuffer, LPTSTR lpszTemp, DWORD cchTemp )
00953 {
00954   PNODE                  pProcessNode, pSearchProcessNode;
00955   PDEB_PROCESS_NODE_INFO pProcessNodeInfo, pSearchProcessNodeInfo;
00956   DWORD dwNumberOfBytesRead;
00957   DWORD cchToRead;
00958   BOOL fFailed;
00959
00960   AllocProcessNode( &pSearchProcessNode, &pSearchProcessNodeInfo );
00961   pSearchProcessNodeInfo->dwProcessId = lpDebugEvent->dwProcessId;
00962   SetCurrentProcessNode( pProcessList, pSearchProcessNode );
00963   GetCurrentNode( pProcessList, &pProcessNode );
00964   pProcessNode = (PNODE) pProcessList->pCurrentNode;
00965   pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
00966   cchToRead = lpDebugEvent->u.DebugString.nDebugStringLength;
00967   if (cchToRead > cchTemp)
00968   {
00969     cchToRead = cchTemp - sizeof(TCHAR);
00970   }
00971   fFailed = FALSE;
00972   if (!ReadProcessMemory(
00973          pProcessNodeInfo->ProcessDebugInfo.hProcess,
00974          lpDebugEvent->u.DebugString.lpDebugStringData,
00975          lpszTemp, cchToRead * sizeof(TCHAR),
00976          &dwNumberOfBytesRead ) ||
00977       dwNumberOfBytesRead < cchToRead * sizeof(TCHAR))
00978   {
00979       fFailed = TRUE;
00980   }
00981   lpszTemp[cchTemp - 1] = 0;
00982   if (!fFailed)
00983   {
00984 #ifdef _UNICODE
00985       if (!lpDebugEvent->u.DebugString.fUnicode)
00986       {
00987           if (!MultiByteToWideChar(CP_ACP, 0, lpszTemp, -1,
00988                                    lpszBuffer, cchBuffer))
00989           {
00990               fFailed = TRUE;
00991           }
00992       }
00993       else
00994       {
00995           lstrcpyn(lpszBuffer, lpszTemp, cchBuffer);
00996       }
00997 #else
00998       if (lpDebugEvent->u.DebugString.fUnicode)
00999       {
01000           if (!WideCharToMultiByte(CP_ACP, 0, lpszTemp, -1,
01001                                    lpszBuffer, cchBuffer, NULL, NULL))
01002           {
01003               fFailed = TRUE;
01004           }
01005       }
01006       else
01007       {
01008           lstrcpyn(lpszBuffer, lpszTemp, cchBuffer);
01009       }
01010 #endif
01011   }
01012   if (fFailed)
01013   {
01014       StringCbCopy(lpszBuffer, sizeof(lpszBuffer), TEXT("Unable to read output string!"));
01015   }
01016   DestroyProcessNode( pSearchProcessNode );
01017
01018   return( TRUE );
01019 }
01020
01021
01022 // ************************************************************************
01023 // FUNCTION : GetModuleFileNameFromHeader( HANDLE, HANDLE, DWORD, LPTSTR, DWORD )
01024 // PURPOSE  : Retrieves the DLL module name for a given file handle of a
01025 //            the module.  Reads the module name from the EXE header.
01026 // COMMENTS :
01027 //   Retrieves only the module name and not the pathname.  Returns the
01028 //   number of characters copies to the buffer, else returns 0.
01029 // ************************************************************************
01030 DWORD
01031 GetModuleFileNameFromHeader( HANDLE hProcess, HANDLE hFile, DWORD_PTR BaseOfDll,
01032   LPTSTR lpszPath, DWORD cchPath )
01033 {
01034   #define IMAGE_SECOND_HEADER_OFFSET    (15 * sizeof(ULONG)) // relative to file beginning
01035   #define IMAGE_BASE_OFFSET             (13 * sizeof(DWORD)) // relative to PE header base
01036   #define IMAGE_EXPORT_TABLE_RVA_OFFSET (30 * sizeof(DWORD)) // relative to PE header base
01037   #define IMAGE_NAME_RVA_OFFSET         offsetof(IMAGE_EXPORT_DIRECTORY, Name)
01038
01039   WORD   DosSignature;
01040   DWORD  NtSignature;
01041   DWORD  dwNumberOfBytesRead = 0;
01042   DWORD  PeHeader;
01043   DWORD_PTR ImageBase, ExportTableRVA, NameRVA;
01044
01045   //-- verify that the handle is not 0L
01046   if( !hFile ) {
01047     StringCbCopy( lpszPath, sizeof(lpszPath),TEXT("Invalid File Handle") );
01048     return( 0 );
01049   }
01050
01051   //-- verify that the handle is for a disk file
01052   if( GetFileType(hFile) != FILE_TYPE_DISK ) {
01053     StringCbCopy( lpszPath,sizeof(lpszPath) ,TEXT("Invalid File Type") );
01054     return( 0 );
01055   }
01056
01057   //-- Extract the filename from the EXE header
01058   SetFilePointer( hFile, 0L, 0L, FILE_BEGIN );
01059   ReadFile( hFile, &DosSignature, sizeof(DosSignature), &dwNumberOfBytesRead,
01060     (LPOVERLAPPED) 0L);
01061
01062   //-- verify DOS signature found
01063   if( DosSignature != IMAGE_DOS_SIGNATURE ) {
01064     StringCbPrintf( lpszPath, sizeof(lpszPath), TEXT( "Bad MZ Signature: 0x%x" ), DosSignature );
01065     return( 0 );
01066   }
01067
01068   SetFilePointer( hFile, IMAGE_SECOND_HEADER_OFFSET, (LPLONG) 0L,
01069     FILE_BEGIN );
01070   ReadFile( hFile, &PeHeader, sizeof(PeHeader), &dwNumberOfBytesRead,
01071     (LPOVERLAPPED) 0L );
01072   SetFilePointer( hFile, PeHeader, (LPLONG) 0L, FILE_BEGIN );
01073   ReadFile( hFile, &NtSignature, sizeof(NtSignature), &dwNumberOfBytesRead,
01074     (LPOVERLAPPED) 0L);
01075
01076   //-- verify Windows NT (PE) signature found
01077   if( NtSignature != IMAGE_NT_SIGNATURE ) {
01078     StringCbCopy( lpszPath, sizeof(lpszPath), TEXT( "Bad PE Signature: 0x%x" ), DosSignature );
01079     return( 0 );
01080   }
01081
01082   SetFilePointer( hFile, PeHeader + IMAGE_BASE_OFFSET, (LPLONG) 0L,
01083     FILE_BEGIN );
01084   ReadFile( hFile, &ImageBase, sizeof(ImageBase), &dwNumberOfBytesRead,
01085     (LPOVERLAPPED) 0L);
01086   SetFilePointer( hFile, PeHeader + IMAGE_EXPORT_TABLE_RVA_OFFSET,
01087     (LPLONG) 0L, FILE_BEGIN );
01088   ReadFile( hFile, &ExportTableRVA, sizeof(ExportTableRVA),
01089     &dwNumberOfBytesRead, (LPOVERLAPPED) 0L);
01090
01091   //-- now read from the virtual address space in the process
01092   if (!ReadProcessMemory( hProcess,
01093          (LPVOID) (BaseOfDll + ExportTableRVA + IMAGE_NAME_RVA_OFFSET),
01094          &NameRVA, sizeof(NameRVA), &dwNumberOfBytesRead ) ||
01095       dwNumberOfBytesRead != sizeof(NameRVA))
01096   {
01097       StringCbCopy( lpszPath,sizeof(lpszPath), TEXT("Access Denied!") );
01098       dwNumberOfBytesRead = 0;
01099   }
01100   else if( !ReadProcessMemory( hProcess,
01101               (LPVOID) (BaseOfDll + NameRVA),
01102               lpszPath, cchPath * sizeof(TCHAR),
01103               &dwNumberOfBytesRead ))
01104   {
01105      StringCbCopy( lpszPath, sizeof(lpszPath), TEXT("Access Denied!") );
01106   }
01107
01108   return( dwNumberOfBytesRead );
01109 }
01110
01111
01112 #if defined(_MIPS_) || defined(_ALPHA_) || defined(_PPC_)
01113 // ************************************************************************
01114 // FUNCTION : SkipThreadBreakPoint( HANDLE );
01115 // PURPOSE  : Skip over the break point instruction belonging to
01116 //            hThread.
01117 // COMMENTS :
01118 //   Only the MIPS R4x00 and DEC Alpha AXP require this.
01119 // ************************************************************************
01120 BOOL
01121 SkipBreakPoint( HANDLE hThread )
01122 {
01123   static CONTEXT Context;
01124
01125   Context.ContextFlags = CONTEXT_CONTROL;
01126   if( !GetThreadContext( hThread, &Context ) )
01127     return( FALSE );
01128 #if defined(_PPC_)
01129   Context.Iar += 4L;  // Iar is the PC (program counter)
01130 #else
01131   Context.Fir += 4L;  // Fir is the PC (program counter)
01132                       // BREAK (breakpoint instruction) occupies 4 bytes
01133 #endif
01134
01135   // -----------------------------------------------------------------------
01136   //  Below would be equivalent for the Intel 80x86 (if it were necessary)
01137   //  however the Intel x86 automatically increments ip past the 'int 3':
01138   //  Context.Eip += 1L;  // Eip is the PC (program counter)
01139   //                      // int 3 (breakpoint instruction) occupies 1 byte
01140   // -----------------------------------------------------------------------
01141
01142   if( !SetThreadContext( hThread, &Context ) )
01143     return( FALSE );
01144
01145   return( TRUE );
01146 }
01147 #endif
01148
01149
01150
01151 // ========================================================================
01152 // wrapper functions to the linked list services
01153 // ========================================================================
01154
01155 // ========================================================================
01156 // Debug Event Browser Data Structure Overview
01157 // -------------------------------------------
01158 //
01159 // The Debug Event Browser (DEB) maintains a rather involved data structure
01160 // to store various debug event and debuggee process information.  It
01161 // attempts to encapsulate the intricacies of what makes a process based on
01162 // the occuring events.  Much of this stored information is never utilized
01163 // by the Debug Event Browser but it is included to demonstrate what types
01164 // of debug event may be useful to a full blown debugger application.
01165 //
01166 // This data structure uses the generalized, sorted, double-linked list
01167 // package provided with the sample.  Each list can store list-specific
01168 // instance data, list-specific node data, and maintain various pointers
01169 // to these nodes.  The list is sorted via the insertion sort method where
01170 // the programmer defines the list-specific sort function whose purpose is
01171 // to compare two given nodes and return their relative sort location.  The
01172 // list package in generalized in the sense that the list and node-specific
01173 // data type is not known to this package at compile time or at runtime.
01174 // The application programmer is merely responsible for defining the list
01175 // and node-specific data structures and the sorting and optional searching
01176 // functions and the list package keeps track of these nodes and provides
01177 // easy access to them.
01178 //
01179 // DEB uses this list package to create three unique list types: process,
01180 // thread and DLL lists.
01181 //
01182 // The backbone of the data structure is the process list.  The nodes of
01183 // the process list are the individual debuggee processes.  DEB allows
01184 // debugging (or should I say debug event browsing) of other processes that
01185 // are spawned by the initial debuggee.  Thus each debug session may have
01186 // multiple debuggees and thus the process becomes the logical node unit.
01187 //
01188 // A visual diagram of the process list is as follows:
01189 //
01190 //                 (ProcessList)
01191 //                      |
01192 //                      |
01193 //                      v
01194 //                 +-----------------+           +----------------------+
01195 //                 | -ProcessList-   |           | -ListData-           |
01196 //                 |                 |           |                      |
01197 //                 | ListData--------+---------->| ActiveProcessCount=N |
01198 //           +-----+-FirstNode       |           +----------------------+
01199 //           |   +-+ CurrentNode     |
01200 //           |   | | LastNode--------+-----------------------+
01201 //           |   | | OrderFunction=& |                       |
01202 //           |   | | ListError=0     |                       |
01203 //           |   | +-----------------+                       |
01204 //           |   |                                           |
01205 //           |   +-------------------+                       |
01206 //           |                       |                       |
01207 //           v                       v                       v
01208 //         +------------+     +------------+             +------------+
01209 // 0L <- |ProcessNode1| <=> |ProcessNode2| <=> ... <=> |ProcessNodeN| -> 0L
01210 //         +------------+     +------------+             +------------+
01211 //
01212 // Each process node also contains two lists: the thread list and the DLL list.
01213 // This node also stores some of the relevent debug event information
01214 // particular to the create process event.  Visually it is as follows:
01215 //
01216 //    +------------------+         +--------------+
01217 //    | -ProcessNode-    | +------>| -ThreadList- |
01218 //    |                  | |       +--------------+
01219 //    | ProcessID=0      | |
01220 //    | ThreadID=0       | |       +-----------+
01221 //    | FileName=""      | |   +-->| -DllList- |
01222 //    | PathName=""      | |   |   +-----------+
01223 //    | ThreadList-------+-+   |
01224 //    | DllList----------+-----+   +-------------------+
01225 //    | ProcessDebugInfo-+-------->|-ProcessDebugInfo- |
01226 //    +------------------+         +-------------------+
01227 //
01228 // Much like the process list, the visual diagram of the thread list is as
01229 // follows:
01230 //
01231 //                 +-----------------+           +---------------------+
01232 //                 | -ThreadList-    |           | -ListData-          |
01233 //                 |                 |           |                     |
01234 //                 | ListData--------+---------->| ActiveThreadCount=N |
01235 //           +-----+-FirstNode       |           +---------------------+
01236 //           |   +-+ CurrentNode     |
01237 //           |   | | LastNode--------+-----------------------+
01238 //           |   | | OrderFunction=& |                       |
01239 //           |   | | ListError=0     |                       |
01240 //           |   | +-----------------+                       |
01241 //           |   |                                           |
01242 //           |   +-------------------+                       |
01243 //           |                       |                       |
01244 //           v                       v                       v
01245 //          +-----------+     +-----------+             +-----------+
01246 //  0L <- |ThreadNode1| <=> |ThreadNode2| <=> ... <=> |ThreadNodeN| -> 0L
01247 //          +-----------+     +-----------+             +-----------+
01248 //
01249 // The thread nodes store some of the relevent debug event information
01250 // particular to the create thread event.  Visually it is as follows:
01251 //
01252 //    +--------------------+
01253 //    | -ThreadNode-       |
01254 //    |                    |
01255 //    | ProcessID=0        |
01256 //    | ThreadID=0         |
01257 //    | ThreadDebugInfo={} |
01258 //    +--------------------+
01259 //
01260 // Much like the process and thread lists, the visual diagram of the Dll list
01261 // is as follows:
01262 //
01263 //                 +-----------------+           +------------------+
01264 //                 | -DllList-       |           | -ListData-       |
01265 //                 |                 |           |                  |
01266 //                 | ListData--------+---------->| ActiveDllCount=N |
01267 //           +-----+-FirstNode       |           +------------------+
01268 //           |   +-+ CurrentNode     |
01269 //           |   | | LastNode--------+-----------------+
01270 //           |   | | OrderFunction=& |                 |
01271 //           |   | | ListError=0     |                 |
01272 //           |   | +-----------------+                 |
01273 //           |   |                                     |
01274 //           |   +-------------+                       |
01275 //           |                 |                       |
01276 //           v                 v                       v
01277 //          +--------+     +--------+             +--------+
01278 //  0L <- |DllNode1| <=> |DllNode2| <=> ... <=> |DllNodeN| -> 0L
01279 //          +--------+     +--------+             +--------+
01280 //
01281 // The Dll nodes store some of the relevent debug event information particular
01282 // to the Dll load event.  Visually it is as follows:
01283 //
01284 //    +----------------+
01285 //    | -DllNode-      |
01286 //    |                |
01287 //    | FileName=""    |
01288 //    | PathName=""    |
01289 //    | DllDebugInfo={}|
01290 //    +----------------+
01291 //
01292 // ========================================================================
01293
01294 // ------------------------------------------------------------------------
01295 // Process list and node specific linked list wrapper functions
01296 // ------------------------------------------------------------------------
01297
01298
01299 // ************************************************************************
01300 // FUNCTION : ProcessOrderFunction( PNODE, PNODE );
01301 // PURPOSE  : Provides the sorting/search logic for the double linked
01302 //            list package.
01303 // COMMENTS :
01304 //   Sorted by process ID value
01305 // ************************************************************************
01306 int
01307 ProcessOrderFunction( PNODE pNode1, PNODE pNode2 )
01308 {
01309   PDEB_PROCESS_NODE_INFO pProcessNodeInfo1 = pNode1->pNodeData;
01310   PDEB_PROCESS_NODE_INFO pProcessNodeInfo2 = pNode2->pNodeData;
01311
01312   if( pProcessNodeInfo1->dwProcessId < pProcessNodeInfo2->dwProcessId )
01313     return( LIST_LEFT_OF );
01314
01315   if( pProcessNodeInfo1->dwProcessId > pProcessNodeInfo2->dwProcessId )
01316     return( LIST_RIGHT_OF );
01317
01318   return( LIST_MATCH );
01319 }
01320
01321
01322 // ************************************************************************
01323 // FUNCTION : CreateProcessList( PLIST* )
01324 // PURPOSE  :
01325 // COMMENTS :
01326 //
01327 // ************************************************************************
01328 BOOL
01329 CreateProcessList( PLIST* ppProcessList )
01330 {
01331   PDEB_PROCESS_LIST_INFO pProcessListInfo;
01332
01333   //-- create list
01334   CreateList( ppProcessList, ProcessOrderFunction );
01335
01336   //-- alloc info data
01337   pProcessListInfo = (PDEB_PROCESS_LIST_INFO) HeapAlloc( hHeap, 0L,
01338                                                 sizeof( DEB_PROCESS_LIST_INFO ) );
01339   (*ppProcessList)->pListData = pProcessListInfo;
01340
01341   //-- init info data
01342   pProcessListInfo->dwActiveProcesses = 0;
01343
01344   return( TRUE );
01345 }
01346
01347
01348 // ************************************************************************
01349 // FUNCTION : DestroyProcessList( PLIST )
01350 // PURPOSE  :
01351 // COMMENTS :
01352 //
01353 // ************************************************************************
01354 BOOL
01355 DestroyProcessList( PLIST pProcessList )
01356 {
01357   PDEB_PROCESS_LIST_INFO pProcessListInfo = pProcessList->pListData;
01358   PNODE                  pDeleteNode;
01359
01360   //-- make sure all nodes are removed first
01361   while( pProcessListInfo->dwActiveProcesses ) {
01362     GetCurrentNode( pProcessList, &pDeleteNode );
01363     DeleteCurrentProcessNode( pProcessList );
01364   }
01365
01366   //-- free info data
01367   HeapFree( hHeap, 0L, (PVOID) pProcessListInfo );
01368
01369   //-- destroy list
01370   DestroyList( pProcessList );
01371
01372   return( TRUE );
01373 }
01374
01375
01376 // ************************************************************************
01377 // FUNCTION : AllocProcessNode( PNODE*, PDEB_PROCESS_NODE_INFO* )
01378 // PURPOSE  :
01379 // COMMENTS :
01380 //
01381 // ************************************************************************
01382 BOOL
01383 AllocProcessNode( PNODE* ppProcessNode, PDEB_PROCESS_NODE_INFO* ppProcessNodeInfo )
01384 {
01385   //-- create node
01386   CreateNode( ppProcessNode );
01387
01388   //-- alloc info data
01389   *ppProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) HeapAlloc( hHeap, 0L,
01390                                               sizeof( DEB_PROCESS_NODE_INFO ) );
01391   (*ppProcessNode)->pNodeData = *(ppProcessNodeInfo);
01392
01393   (*ppProcessNodeInfo)->lpstrFileName = (LPTSTR) HeapAlloc( hHeap, 0L,
01394                                                (DWORD) MAX_PATH );
01395   (*ppProcessNodeInfo)->lpstrPathName = (LPTSTR) HeapAlloc( hHeap, 0L,
01396                                                (DWORD) MAX_PATH );
01397   CreateThreadList( &((*ppProcessNodeInfo)->pThreadList) );
01398   CreateDllList( &((*ppProcessNodeInfo)->pDllList) );
01399
01400   return( TRUE );
01401 }
01402
01403
01404 // ************************************************************************
01405 // FUNCTION : InitProcessNodeInfo( PDEB_PROCESS_NODE_INFO*, LPDEBUG_EVENT )
01406 // PURPOSE  :
01407 // COMMENTS :
01408 //
01409 // ************************************************************************
01410 BOOL
01411 InitProcessNodeInfo( PDEB_PROCESS_NODE_INFO* ppProcessNodeInfo, LPDEBUG_EVENT lpDebugEvent )
01412 {
01413   //-- init info data
01414   (*ppProcessNodeInfo)->dwProcessId = lpDebugEvent->dwProcessId;
01415   (*ppProcessNodeInfo)->dwThreadId  = lpDebugEvent->dwThreadId;
01416   // Note:pThreadList initialized via previous CreateThreadList() call
01417   // Note:pDllList initialized via previous CreateDllList() call
01418   (*ppProcessNodeInfo)->ProcessDebugInfo = lpDebugEvent->u.CreateProcessInfo;
01419
01420   return( TRUE );
01421 }
01422
01423
01424 // ************************************************************************
01425 // FUNCTION : InsertProcessNode( PLIST, PNODE )
01426 // PURPOSE  :
01427 // COMMENTS :
01428 //
01429 // ************************************************************************
01430 BOOL
01431 InsertProcessNode( PLIST pProcessList, PNODE pProcessNode )
01432 {
01433   PDEB_PROCESS_LIST_INFO pProcessListInfo = pProcessList->pListData;
01434
01435   //-- insert the node
01436   InsertNode( pProcessList, pProcessNode );
01437
01438   //-- increment dwActiveProcesss
01439   pProcessListInfo->dwActiveProcesses++;
01440
01441   return( TRUE );
01442 }
01443
01444
01445 // ************************************************************************
01446 // FUNCTION : SetCurrentProcessNode( PLIST, PNODE )
01447 // PURPOSE  :
01448 // COMMENTS :
01449 //
01450 // ************************************************************************
01451 BOOL
01452 SetCurrentProcessNode( PLIST pProcessList, PNODE pProcessNode )
01453 {
01454   SetCurrentNode( pProcessList, pProcessNode, pProcessList->OrderFunction );
01455
01456   return( TRUE );
01457 }
01458
01459
01460 // ************************************************************************
01461 // FUNCTION : DeleteProcessNode( PLIST, PNODE )
01462 // PURPOSE  :
01463 // COMMENTS :
01464 //
01465 // ************************************************************************
01466 BOOL
01467 DeleteProcessNode( PLIST pProcessList, PNODE pProcessNode )
01468 {
01469   PNODE pDeleteNode;
01470
01471   SetCurrentNode( pProcessList, pProcessNode, pProcessList->OrderFunction );
01472   GetCurrentNode( pProcessList, &pDeleteNode );
01473   DeleteCurrentProcessNode( pProcessList );
01474
01475   return( TRUE );
01476 }
01477
01478
01479 // ************************************************************************
01480 // FUNCTION : FreeProcessNodeInfo( PNODE )
01481 // PURPOSE  :
01482 // COMMENTS :
01483 //
01484 // ************************************************************************
01485 BOOL
01486 FreeProcessNodeInfo( PNODE pProcessNode )
01487 {
01488   PDEB_PROCESS_NODE_INFO pProcessNodeInfo = (PDEB_PROCESS_NODE_INFO) pProcessNode->pNodeData;
01489
01490   //-- free info data
01491   DestroyDllList( pProcessNodeInfo->pDllList );
01492   DestroyThreadList( pProcessNodeInfo->pThreadList );
01493   HeapFree( hHeap, 0L, (PVOID) pProcessNodeInfo->lpstrPathName );
01494   HeapFree( hHeap, 0L, (PVOID) pProcessNodeInfo->lpstrFileName );
01495   HeapFree( hHeap, 0L, (PVOID) pProcessNodeInfo );
01496
01497   return( TRUE );
01498 }
01499
01500
01501 // ************************************************************************
01502 // FUNCTION : DestroyProcessNode( PNODE )
01503 // PURPOSE  :
01504 // COMMENTS : Frees all memory associated with the node.
01505 // ************************************************************************
01506 BOOL
01507 DestroyProcessNode( PNODE pProcessNode )
01508 {
01509   //-- free info data
01510   FreeProcessNodeInfo( pProcessNode );
01511
01512   //-- destroy node
01513   DestroyNode( pProcessNode );
01514
01515   return( TRUE );
01516 }
01517
01518
01519 // ************************************************************************
01520 // FUNCTION : DeleteCurrentProcessNode( PLIST )
01521 // PURPOSE  :
01522 // COMMENTS :
01523 //
01524 // ************************************************************************
01525 BOOL
01526 DeleteCurrentProcessNode( PLIST pProcessList )
01527 {
01528   PDEB_PROCESS_LIST_INFO pProcessListInfo = pProcessList->pListData;
01529   PNODE                  pProcessNode = (PNODE) pProcessList->pCurrentNode;
01530
01531   //-- free info data
01532   FreeProcessNodeInfo( pProcessNode );
01533
01534   //-- delete and destroy node
01535   DeleteCurrentNode( pProcessList );
01536
01537   //-- decrement dwActiveProcesss
01538   pProcessListInfo->dwActiveProcesses--;
01539
01540   return( TRUE );
01541 }
01542
01543
01544 // ------------------------------------------------------------------------
01545 // Thread list and node specific linked list wrapper functions
01546 // ------------------------------------------------------------------------
01547
01548
01549 // ************************************************************************
01550 // FUNCTION : ThreadOrderFunction( PNODE, PNODE );
01551 // PURPOSE  : Provides the sorting/search logic for the double linked
01552 //            list package.
01553 // COMMENTS :
01554 //   Sorted by thread ID value
01555 // ************************************************************************
01556 int
01557 ThreadOrderFunction( PNODE pNode1, PNODE pNode2 )
01558 {
01559   PDEB_THREAD_NODE_INFO pThreadNodeInfo1 = pNode1->pNodeData;
01560   PDEB_THREAD_NODE_INFO pThreadNodeInfo2 = pNode2->pNodeData;
01561
01562   if( pThreadNodeInfo1->dwThreadId < pThreadNodeInfo2->dwThreadId )
01563     return( LIST_LEFT_OF );
01564
01565   if( pThreadNodeInfo1->dwThreadId > pThreadNodeInfo2->dwThreadId )
01566     return( LIST_RIGHT_OF );
01567
01568   return( LIST_MATCH );
01569 }
01570
01571
01572 // ************************************************************************
01573 // FUNCTION : CreateThreadList( PLIST* )
01574 // PURPOSE  :
01575 // COMMENTS :
01576 //
01577 // ************************************************************************
01578 BOOL
01579 CreateThreadList( PLIST* ppThreadList )
01580 {
01581   PDEB_THREAD_LIST_INFO pThreadListInfo;
01582
01583   //-- create list
01584   CreateList( ppThreadList, ThreadOrderFunction );
01585
01586   //-- alloc info data
01587   pThreadListInfo = (PDEB_THREAD_LIST_INFO) HeapAlloc( hHeap, 0L,
01588                                                 sizeof( DEB_THREAD_LIST_INFO ) );
01589   (*ppThreadList)->pListData = pThreadListInfo;
01590
01591   //-- init info data
01592   pThreadListInfo->dwActiveThreads = 0;
01593
01594   return( TRUE );
01595 }
01596
01597
01598 // ************************************************************************
01599 // FUNCTION : DestroyThreadList( PLIST )
01600 // PURPOSE  :
01601 // COMMENTS :
01602 //
01603 // ************************************************************************
01604 BOOL
01605 DestroyThreadList( PLIST pThreadList )
01606 {
01607   PDEB_THREAD_LIST_INFO pThreadListInfo = pThreadList->pListData;
01608   PNODE                 pDeleteNode;
01609
01610   //-- make sure all nodes are removed first
01611   while( pThreadListInfo->dwActiveThreads ) {
01612     GetCurrentNode( pThreadList, &pDeleteNode );
01613     DeleteCurrentThreadNode( pThreadList );
01614   }
01615
01616   //-- free info data
01617   HeapFree( hHeap, 0L, (PVOID) pThreadListInfo );
01618
01619   //-- destroy list
01620   DestroyList( pThreadList );
01621
01622   return( TRUE );
01623 }
01624
01625
01626 // ************************************************************************
01627 // FUNCTION : AllocThreadNode( PNODE*, PDEB_THREAD_NODE_INFO* )
01628 // PURPOSE  :
01629 // COMMENTS :
01630 //
01631 // ************************************************************************
01632 BOOL
01633 AllocThreadNode( PNODE* ppThreadNode, PDEB_THREAD_NODE_INFO* ppThreadNodeInfo )
01634 {
01635   //-- create node
01636   CreateNode( ppThreadNode );
01637
01638   //-- alloc info data
01639   *ppThreadNodeInfo = (PDEB_THREAD_NODE_INFO) HeapAlloc( hHeap, 0L,
01640                                             (DWORD) sizeof( DEB_THREAD_NODE_INFO ) );
01641   (*ppThreadNode)->pNodeData = *(ppThreadNodeInfo);
01642
01643   return( TRUE );
01644 }
01645
01646
01647 // ************************************************************************
01648 // FUNCTION : InitThreadNodeInfo( PDEB_THREAD_NODE_INFO*, LPDEBUG_EVENT )
01649 // PURPOSE  :
01650 // COMMENTS :
01651 //
01652 // ************************************************************************
01653 BOOL
01654 InitThreadNodeInfo( PDEB_THREAD_NODE_INFO* ppThreadNodeInfo,
01655   LPDEBUG_EVENT lpDebugEvent )
01656 {
01657   //-- init info data
01658   (*ppThreadNodeInfo)->dwProcessId     = lpDebugEvent->dwProcessId;
01659   (*ppThreadNodeInfo)->dwThreadId      = lpDebugEvent->dwThreadId;
01660   (*ppThreadNodeInfo)->ThreadDebugInfo = lpDebugEvent->u.CreateThread;
01661
01662   return( TRUE );
01663 }
01664
01665
01666 // ************************************************************************
01667 // FUNCTION : InsertThreadNode( PLIST, PNODE )
01668 // PURPOSE  :
01669 // COMMENTS :
01670 //
01671 // ************************************************************************
01672 BOOL
01673 InsertThreadNode( PLIST pThreadList, PNODE pThreadNode )
01674 {
01675   PDEB_THREAD_LIST_INFO pThreadListInfo = (PDEB_THREAD_LIST_INFO) pThreadList->pListData;
01676
01677   //-- insert the thread node
01678   InsertNode( pThreadList, pThreadNode );
01679
01680   //-- increment dwActiveThreads
01681   pThreadListInfo->dwActiveThreads++;
01682
01683   return( TRUE );
01684 }
01685
01686
01687 // ************************************************************************
01688 // FUNCTION : SetCurrentThreadNode( PLIST, PNODE )
01689 // PURPOSE  :
01690 // COMMENTS :
01691 //
01692 // ************************************************************************
01693 BOOL
01694 SetCurrentThreadNode( PLIST pThreadList, PNODE pThreadNode )
01695 {
01696   SetCurrentNode( pThreadList, pThreadNode, pThreadList->OrderFunction );
01697
01698   return( TRUE );
01699 }
01700
01701
01702 // ************************************************************************
01703 // FUNCTION : DeleteThreadNode( PLIST, PNODE )
01704 // PURPOSE  :
01705 // COMMENTS :
01706 //
01707 // ************************************************************************
01708 BOOL
01709 DeleteThreadNode( PLIST pThreadList, PNODE pThreadNode )
01710 {
01711   PNODE pDeleteNode;
01712
01713   SetCurrentNode( pThreadList, pThreadNode, pThreadList->OrderFunction );
01714   GetCurrentNode( pThreadList, &pDeleteNode );
01715   DeleteCurrentThreadNode( pThreadList );
01716
01717   return( TRUE );
01718 }
01719
01720
01721 // ************************************************************************
01722 // FUNCTION : FreeThreadNodeInfo( PNODE )
01723 // PURPOSE  :
01724 // COMMENTS :
01725 //
01726 // ************************************************************************
01727 BOOL
01728 FreeThreadNodeInfo( PNODE pThreadNode )
01729 {
01730   PDEB_THREAD_NODE_INFO pThreadNodeInfo = (PDEB_THREAD_NODE_INFO) pThreadNode->pNodeData;
01731
01732   //-- free info data
01733   HeapFree( hHeap, 0L, (PVOID) pThreadNodeInfo );
01734
01735   return( TRUE );
01736 }
01737
01738
01739 // ************************************************************************
01740 // FUNCTION : DestroyThreadNode( PNODE )
01741 // PURPOSE  :
01742 // COMMENTS : Frees all memory associated with the node.
01743 // ************************************************************************
01744 BOOL
01745 DestroyThreadNode( PNODE pThreadNode )
01746 {
01747   //-- free info data
01748   FreeThreadNodeInfo( pThreadNode );
01749
01750   //-- destroy node
01751   DestroyNode( pThreadNode );
01752
01753   return( TRUE );
01754 }
01755
01756
01757 // ************************************************************************
01758 // FUNCTION : DeleteCurrentThreadNode( PLIST )
01759 // PURPOSE  :
01760 // COMMENTS :
01761 //
01762 // ************************************************************************
01763 BOOL
01764 DeleteCurrentThreadNode( PLIST pThreadList )
01765 {
01766   PDEB_THREAD_LIST_INFO pThreadListInfo = pThreadList->pListData;
01767   PNODE                 pThreadNode = (PNODE) pThreadList->pCurrentNode;
01768
01769   //-- free info data
01770   FreeThreadNodeInfo( pThreadNode );
01771
01772   //-- delete and destroy node
01773   DeleteCurrentNode( pThreadList );
01774
01775   //-- decrement dwActiveThreads
01776   pThreadListInfo->dwActiveThreads--;
01777
01778   return( TRUE );
01779 }
01780
01781
01782 // ------------------------------------------------------------------------
01783 // DLL list and node specific linked list wrapper functions
01784 // ------------------------------------------------------------------------
01785
01786
01787 // ************************************************************************
01788 // FUNCTION : DllOrderFunction( PNODE, PNODE );
01789 // PURPOSE  : Provides the sorting/search logic for the double linked
01790 //            list package.
01791 // COMMENTS :
01792 //   Sorted by base address of the DLL
01793 // ************************************************************************
01794 int
01795 DllOrderFunction( PNODE pNode1, PNODE pNode2 )
01796 {
01797   PDEB_DLL_NODE_INFO pDllNodeInfo1 = pNode1->pNodeData;
01798   PDEB_DLL_NODE_INFO pDllNodeInfo2 = pNode2->pNodeData;
01799
01800   if( pDllNodeInfo1->DllDebugInfo.lpBaseOfDll < pDllNodeInfo2->DllDebugInfo.lpBaseOfDll )
01801     return( LIST_LEFT_OF );
01802
01803   if( pDllNodeInfo1->DllDebugInfo.lpBaseOfDll > pDllNodeInfo2->DllDebugInfo.lpBaseOfDll )
01804     return( LIST_RIGHT_OF );
01805
01806   return( LIST_MATCH );
01807 }
01808
01809
01810 // ************************************************************************
01811 // FUNCTION : CreateDllList( PLIST* )
01812 // PURPOSE  :
01813 // COMMENTS :
01814 //
01815 // ************************************************************************
01816 BOOL
01817 CreateDllList( PLIST* ppDllList )
01818 {
01819   PDEB_DLL_LIST_INFO pDllListInfo;
01820
01821   //-- create list
01822   CreateList( ppDllList, DllOrderFunction );
01823
01824   //-- alloc info data
01825   pDllListInfo = (PDEB_DLL_LIST_INFO) HeapAlloc( hHeap, 0L,
01826                                                 sizeof( DEB_DLL_LIST_INFO ) );
01827   (*ppDllList)->pListData = pDllListInfo;
01828
01829   //-- init info data
01830   pDllListInfo->dwActiveDlls = 0;
01831
01832   return( TRUE );
01833 }
01834
01835
01836 // ************************************************************************
01837 // FUNCTION : DestroyDllList( PLIST )
01838 // PURPOSE  :
01839 // COMMENTS :
01840 //
01841 // ************************************************************************
01842 BOOL
01843 DestroyDllList( PLIST pDllList )
01844 {
01845   PDEB_DLL_LIST_INFO pDllListInfo = pDllList->pListData;
01846   PNODE              pDeleteNode;
01847
01848   //-- make sure all nodes are removed first
01849   while( pDllListInfo->dwActiveDlls ) {
01850     GetCurrentNode( pDllList, &pDeleteNode );
01851     DeleteCurrentDllNode( pDllList );
01852   }
01853
01854   //-- free list data and destroy the list
01855   HeapFree( hHeap, 0L, (PVOID) pDllListInfo );
01856   DestroyList( pDllList );
01857
01858   return( TRUE );
01859 }
01860
01861
01862 // ************************************************************************
01863 // FUNCTION : AllocDllNode( PNODE*, PDEB_DLL_NODE_INFO* )
01864 // PURPOSE  :
01865 // COMMENTS :
01866 //
01867 // ************************************************************************
01868 BOOL
01869 AllocDllNode( PNODE* ppDllNode, PDEB_DLL_NODE_INFO* ppDllNodeInfo )
01870 {
01871   //-- create node
01872   CreateNode( ppDllNode );
01873
01874   //-- alloc info data
01875   *ppDllNodeInfo = (PDEB_DLL_NODE_INFO) HeapAlloc( hHeap, 0L,
01876                                       sizeof( DEB_DLL_NODE_INFO ) );
01877   (*ppDllNode)->pNodeData = *(ppDllNodeInfo);
01878   (*ppDllNodeInfo)->lpstrFileName = (LPTSTR) HeapAlloc( hHeap, 0L, (DWORD) MAX_PATH );
01879
01880   return( TRUE );
01881 }
01882
01883
01884 // ************************************************************************
01885 // FUNCTION : InitDllNodeInfo( PDEB_DLL_NODE_INFO*, LPDEBUG_EVENT )
01886 // PURPOSE  :
01887 // COMMENTS :
01888 //
01889 // ************************************************************************
01890 BOOL
01891 InitDllNodeInfo( PDEB_DLL_NODE_INFO* ppDllNodeInfo,
01892   LPDEBUG_EVENT lpDebugEvent )
01893 {
01894   //-- init info data
01895   GetDllFileName( lpDebugEvent, (*ppDllNodeInfo)->lpstrFileName, MAX_PATH );
01896   (*ppDllNodeInfo)->DllDebugInfo = lpDebugEvent->u.LoadDll;
01897
01898   return( TRUE );
01899 }
01900
01901
01902 // ************************************************************************
01903 // FUNCTION : InsertDllNode( PLIST, PNODE )
01904 // PURPOSE  :
01905 // COMMENTS :
01906 //
01907 // ************************************************************************
01908 BOOL
01909 InsertDllNode( PLIST pDllList, PNODE pDllNode )
01910 {
01911   PDEB_DLL_LIST_INFO pDllListInfo = pDllList->pListData;
01912
01913   // insert the node
01914   InsertNode( pDllList, pDllNode );
01915
01916   //-- increment dwActiveDlls
01917   pDllListInfo->dwActiveDlls++;
01918
01919   return( TRUE );
01920 }
01921
01922
01923 // ************************************************************************
01924 // FUNCTION : SetCurrentDllNode( PLIST, PNODE )
01925 // PURPOSE  :
01926 // COMMENTS :
01927 //
01928 // ************************************************************************
01929 BOOL
01930 SetCurrentDllNode( PLIST pDllList, PNODE pDllNode )
01931 {
01932   SetCurrentNode( pDllList, pDllNode, pDllList->OrderFunction );
01933
01934   return( TRUE );
01935 }
01936
01937
01938 // ************************************************************************
01939 // FUNCTION : DeleteDllNode( PLIST, PNODE )
01940 // PURPOSE  :
01941 // COMMENTS :
01942 //
01943 // ************************************************************************
01944 BOOL
01945 DeleteDllNode( PLIST pDllList, PNODE pDllNode )
01946 {
01947   PNODE pDeleteNode;
01948
01949   SetCurrentNode( pDllList, pDllNode, pDllList->OrderFunction );
01950   GetCurrentNode( pDllList, &pDeleteNode );
01951   DeleteCurrentDllNode( pDllList );
01952
01953   return( TRUE );
01954 }
01955
01956
01957 // ************************************************************************
01958 // FUNCTION : FreeDllNodeInfo( PNODE )
01959 // PURPOSE  :
01960 // COMMENTS :
01961 //
01962 // ************************************************************************
01963 BOOL
01964 FreeDllNodeInfo( PNODE pDllNode )
01965 {
01966   PDEB_DLL_NODE_INFO pDllNodeInfo = (PDEB_DLL_NODE_INFO) pDllNode->pNodeData;
01967
01968   //-- free info data
01969   HeapFree( hHeap, 0L, (PVOID) pDllNodeInfo->lpstrFileName );
01970   HeapFree( hHeap, 0L, (PVOID) pDllNodeInfo );
01971
01972   return( TRUE );
01973 }
01974
01975
01976 // ************************************************************************
01977 // FUNCTION : DestroyDllNode( PNODE )
01978 // PURPOSE  :
01979 // COMMENTS : Frees all memory associated with the node.
01980 // ************************************************************************
01981 BOOL
01982 DestroyDllNode( PNODE pDllNode )
01983 {
01984   //-- free info data
01985   FreeDllNodeInfo( pDllNode );
01986
01987   //-- destroy node
01988   DestroyNode( pDllNode );
01989
01990   return( TRUE );
01991 }
01992
01993
01994 // ************************************************************************
01995 // FUNCTION : DeleteCurrentDllNode( PLIST )
01996 // PURPOSE  :
01997 // COMMENTS : Deletes the current DLL node from the list and frees all
01998 //            memory associated with it.
01999 // ************************************************************************
02000 BOOL
02001 DeleteCurrentDllNode( PLIST pDllList )
02002 {
02003   PDEB_DLL_LIST_INFO pDllListInfo = pDllList->pListData;
02004   PNODE              pDllNode = (PNODE) pDllList->pCurrentNode;
02005
02006   //-- free info data
02007   FreeDllNodeInfo( pDllNode );
02008
02009   //-- delete and destroy node
02010   DeleteCurrentNode( pDllList );
02011
02012   //-- decrement dwActiveDlls
02013   pDllListInfo->dwActiveDlls--;
02014
02015   return( TRUE );
02016 }
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/EventTrace/TraceDmp/tracewmi.cpp Source File

  • WinBase
  • EventTrace
  • TraceDmp

tracewmi.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) Microsoft Corporation. All rights reserved.
00004
00005 Module Name:
00006
00007     tracewmi.cpp
00008
00009 Abstract:
00010
00011     Sample trace consumer helper routines. The functions in this file will fetch
00012     event layout data given the GUID, version, and level.
00013
00014     Functions in this file deals with WMI to retrieve the event layout information.
00015     GetMofInfoHead() and RemoveMofInfo() are the only two exported APIs from
00016     this file. GetMofInfoHead() returns MOF_INFO structure to the caller.
00017
00018     For each GUID, search takes place once. Once found, the information will be
00019     placed as MOF_INFO in a global list (EventListHead). This list is searched
00020     first before WMI is attempted to avoid repetitive WMI access.
00021
00022 --*/
00023 #include "tracedmp.h"
00024
00025 extern
00026 void
00027 GuidToString(
00028     PTCHAR s,
00029     LPGUID piid
00030 );
00031
00032 // cached Wbem pointer
00033 IWbemServices *pWbemServices = NULL;
00034
00035 // Global head for event layout linked list
00036 extern PLIST_ENTRY EventListHead;
00037
00038 PMOF_INFO
00039 GetMofInfoHead(
00040     GUID Guid,
00041     SHORT  nType,
00042     SHORT nVersion,
00043     CHAR  nLevel
00044 );
00045
00046 HRESULT
00047 WbemConnect(
00048     IWbemServices** pWbemServices
00049 );
00050
00051 ULONG GetArraySize(
00052     IN IWbemQualifierSet *pQualSet
00053 );
00054
00055 ITEM_TYPE
00056 GetItemType(
00057     IN CIMTYPE_ENUMERATION CimType,
00058     IN IWbemQualifierSet *pQualSet
00059 );
00060
00061 PMOF_INFO
00062 GetPropertiesFromWBEM(
00063     IWbemClassObject *pTraceSubClasses,
00064     GUID Guid,
00065     SHORT nVersion,
00066     CHAR nLevel,
00067     SHORT nType
00068 );
00069
00070 PMOF_INFO
00071 GetGuids(
00072     GUID Guid,
00073     SHORT nVersion,
00074     CHAR nLevel,
00075     SHORT nType
00076 );
00077
00078 PMOF_INFO
00079 GetNewMofInfo(
00080     GUID guid,
00081     SHORT nType,
00082     SHORT nVersion,
00083     CHAR nLevel
00084 );
00085
00086 void
00087 RemoveMofInfo(
00088     PLIST_ENTRY pMofInfo
00089 );
00090
00091 PMOF_INFO
00092 GetMofInfoHead(
00093     GUID    Guid,
00094     SHORT   nType,
00095     SHORT   nVersion,
00096     CHAR    nLevel
00097     )
00098 /*++
00099
00100 Routine Description:
00101
00102     Find a matching event layout in the global linked list. If it
00103     is not found in the list, it calls GetGuids() to examine the WBEM
00104     namespace.
00105     If the global list is empty, it first creates a header.
00106
00107 Arguments:
00108
00109     Guid - GUID for the event under consideration.
00110     nType - Event Type
00111     nVersion - Event Version
00112     nLevel - Event Level (not supported in this program)
00113
00114 Return Value:
00115
00116     Pointer to MOF_INFO for the current event. If the layout
00117     information is not found anywhere, GetMofInfoHead() creates
00118     a dummy and returns it.
00119
00120 --*/
00121 {
00122     PLIST_ENTRY Head, Next;
00123     PMOF_INFO pMofInfo;
00124     PMOF_INFO pBestMatch = NULL;
00125     SHORT nMatchLevel = 0;
00126     SHORT nMatchCheck;
00127
00128     // Search the eventList for this Guid and find the head
00129
00130     if (EventListHead == NULL) {
00131         // Initialize the MOF List and add the global header guid to it
00132         EventListHead = (PLIST_ENTRY) malloc(sizeof(LIST_ENTRY));
00133         if (EventListHead == NULL)
00134             return NULL;
00135         InitializeListHead(EventListHead);
00136
00137         pMofInfo = GetNewMofInfo( EventTraceGuid, EVENT_TYPE_DEFAULT, 0, 0 );
00138         if( pMofInfo != NULL ){
00139             InsertTailList( EventListHead, &pMofInfo->Entry );
00140             pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(GUID_TYPE_EVENTTRACE)+1)*sizeof(TCHAR));
00141             if( pMofInfo->strDescription != NULL ){
00142                 _tcscpy( pMofInfo->strDescription, GUID_TYPE_EVENTTRACE );
00143             }
00144             pMofInfo->strType = (LPTSTR)malloc((_tcslen(GUID_TYPE_HEADER)+1)*sizeof(TCHAR));
00145             if( pMofInfo->strType != NULL ){
00146                 _tcscpy( pMofInfo->strType, GUID_TYPE_HEADER );
00147             }
00148         }
00149     }
00150
00151     // Traverse the list and look for the Mof info head for this Guid.
00152
00153     Head = EventListHead;
00154     Next = Head->Flink;
00155
00156     while (Head != Next) {
00157
00158         nMatchCheck = 0;
00159
00160         pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
00161         Next = Next->Flink;
00162
00163         if( IsEqualGUID(&pMofInfo->Guid, &Guid) ){
00164
00165             if( pMofInfo->TypeIndex == nType ){
00166                 nMatchCheck++;
00167             }
00168             if( pMofInfo->Version == nVersion ){
00169                 nMatchCheck++;
00170             }
00171             if( nMatchCheck == 2 ){ // Exact Match
00172                 return  pMofInfo;
00173             }
00174
00175             if( nMatchCheck > nMatchLevel ){ // Close Match
00176                 nMatchLevel = nMatchCheck;
00177                 pBestMatch = pMofInfo;
00178             }
00179
00180             if( pMofInfo->TypeIndex == EVENT_TYPE_DEFAULT && // Total Guess
00181                 pBestMatch == NULL ){
00182                 pBestMatch = pMofInfo;
00183             }
00184         }
00185
00186     }
00187
00188     if(pBestMatch != NULL){
00189         return pBestMatch;
00190     }
00191
00192     // If one does not exist in the list, look it up in the file.
00193     pMofInfo = GetGuids( Guid, nVersion, nLevel, nType );
00194
00195     // If still not found, create a unknown place holder
00196     if( NULL == pMofInfo ){
00197         pMofInfo = GetNewMofInfo( Guid, nType, nVersion, nLevel );
00198         if( pMofInfo != NULL ){
00199             pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(GUID_TYPE_UNKNOWN)+1)*sizeof(TCHAR));
00200             if( pMofInfo->strDescription != NULL ){
00201                 _tcscpy( pMofInfo->strDescription, GUID_TYPE_UNKNOWN );
00202             }
00203             InsertTailList( EventListHead, &pMofInfo->Entry );
00204         }
00205     }
00206
00207     return pMofInfo;
00208 }
00209
00210 void
00211 AddMofInfo(
00212         PLIST_ENTRY List,
00213         LPTSTR  strType,
00214         ITEM_TYPE  nType,
00215         UINT   ArraySize
00216 )
00217 /*++
00218
00219 Routine Description:
00220
00221     Creates a data item information struct (ITEM_DESC) and appends
00222     it to all MOF_INFOs in the given list.
00223     GetPropertiesFromWBEM() creates a list of MOF_INFOs for multiple
00224     types, stores them in a temporary list and calls this function for
00225     each data item information it encounters.
00226
00227 Arguments:
00228
00229     List - List of MOF_INFOs.
00230     strType - Item description in string.
00231     nType - ITEM_TYPE defined at the beginning of this file.
00232     ArraySize - Size of array of this type of items, if applicable.
00233
00234 Return Value:
00235
00236     None.
00237
00238 --*/
00239 {
00240     PITEM_DESC pItem;
00241     PMOF_INFO pMofInfo;
00242
00243     PLIST_ENTRY Head = List;
00244     PLIST_ENTRY Next = Head->Flink;
00245     while (Head != Next) {
00246
00247         pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
00248         Next = Next->Flink;
00249
00250         if( NULL != pMofInfo ){
00251
00252             pItem = (PITEM_DESC) malloc(sizeof(ITEM_DESC));
00253             if( NULL == pItem ){
00254                 return;
00255             }
00256             ZeroMemory( pItem, sizeof(ITEM_DESC) );
00257             pItem->ItemType = nType;
00258             pItem->ArraySize = ArraySize;
00259
00260             pItem->strDescription = (LPTSTR) malloc( (_tcslen(strType)+1)*sizeof(TCHAR));
00261
00262             if( NULL == pItem->strDescription ){
00263                 free( pItem );
00264                 return;
00265             }
00266             _tcscpy(pItem->strDescription, strType);
00267
00268             InsertTailList( (pMofInfo->ItemHeader), &pItem->Entry);
00269         }
00270
00271     }
00272 }
00273
00274
00275 PMOF_INFO
00276 GetNewMofInfo(
00277     GUID guid,
00278     SHORT nType,
00279     SHORT nVersion,
00280     CHAR nLevel
00281 )
00282 /*++
00283
00284 Routine Description:
00285
00286     Creates a new MOF_INFO with given data.
00287
00288 Arguments:
00289
00290     guid - Event GUID.
00291     nType - Event type.
00292     nVersion - Event version.
00293     nLevel - Event level (not supported in this program).
00294
00295 Return Value:
00296
00297     Pointer to the created MOF_INFO. NULL if malloc failed.
00298
00299 --*/
00300 {
00301     PMOF_INFO pMofInfo;
00302
00303     pMofInfo = (PMOF_INFO)malloc(sizeof(MOF_INFO));
00304
00305     if( NULL == pMofInfo ){
00306         return NULL;
00307     }
00308
00309     RtlZeroMemory(pMofInfo, sizeof(MOF_INFO));
00310
00311     RtlCopyMemory(&pMofInfo->Guid, &guid, sizeof(GUID) );
00312
00313     pMofInfo->ItemHeader = (PLIST_ENTRY)malloc(sizeof(LIST_ENTRY));
00314
00315     if( NULL == pMofInfo->ItemHeader ){
00316         free( pMofInfo );
00317         return NULL;
00318     }
00319
00320     InitializeListHead(pMofInfo->ItemHeader);
00321
00322     pMofInfo->TypeIndex = nType;
00323     pMofInfo->Level = nLevel;
00324     pMofInfo->Version = nVersion;
00325
00326     return pMofInfo;
00327 }
00328
00329 void
00330 FlushMofList(
00331     PLIST_ENTRY ListHead
00332 )
00333 /*++
00334
00335 Routine Description:
00336
00337     Flushes MOF_INFOs in a temporary list into the global list.
00338
00339 Arguments:
00340
00341     ListHead - Pointer to the head of a temporary list.
00342
00343 Return Value:
00344
00345     None.
00346
00347 --*/
00348 {
00349     PMOF_INFO pMofInfo;
00350     PLIST_ENTRY Head = ListHead;
00351     PLIST_ENTRY Next = Head->Flink;
00352
00353     while( Head != Next ){
00354         pMofInfo = CONTAINING_RECORD(Next, MOF_INFO, Entry);
00355         Next = Next->Flink;
00356
00357         RemoveEntryList(&pMofInfo->Entry);
00358         InsertTailList( EventListHead, &pMofInfo->Entry);
00359     }
00360 }
00361
00362 HRESULT
00363 WbemConnect(
00364     IWbemServices** pWbemServices
00365 )
00366 /*++
00367
00368 Routine Description:
00369
00370     Connects to WBEM and returns a pointer to WbemServices.
00371
00372 Arguments:
00373
00374     pWbemServices - Pointer to the connected WbemServices.
00375
00376 Return Value:
00377
00378     ERROR_SUCCESS if successful. Error flag otherwise.
00379
00380 --*/
00381 {
00382     IWbemLocator     *pLocator = NULL;
00383
00384     BSTR bszNamespace = SysAllocString( L"root\\wmi" );
00385
00386     HRESULT hr = CoInitialize(0);
00387
00388     hr = CoCreateInstance(
00389                 CLSID_WbemLocator,
00390                 0,
00391                 CLSCTX_INPROC_SERVER,
00392                 IID_IWbemLocator,
00393                 (LPVOID *) &pLocator
00394             );
00395     if ( ERROR_SUCCESS != hr )
00396         goto cleanup;
00397
00398     hr = pLocator->ConnectServer(
00399                 bszNamespace,
00400                 NULL,
00401                 NULL,
00402                 NULL,
00403                 0L,
00404                 NULL,
00405                 NULL,
00406                 pWbemServices
00407             );
00408     if ( ERROR_SUCCESS != hr )
00409         goto cleanup;
00410
00411     hr = CoSetProxyBlanket(
00412             *pWbemServices,
00413             RPC_C_AUTHN_WINNT,
00414             RPC_C_AUTHZ_NONE,
00415             NULL,
00416             RPC_C_AUTHN_LEVEL_PKT,
00417             RPC_C_IMP_LEVEL_IMPERSONATE,
00418             NULL,
00419             EOAC_NONE
00420         );
00421
00422 cleanup:
00423     SysFreeString( bszNamespace );
00424
00425     if( pLocator ){
00426         pLocator->Release();
00427         pLocator = NULL;
00428     }
00429
00430     return hr;
00431 }
00432
00433 ULONG GetArraySize(
00434     IN IWbemQualifierSet *pQualSet
00435 )
00436 /*++
00437
00438 Routine Description:
00439
00440     Examines a given qualifier set and returns the array size.
00441
00442     NOTE: WBEM stores the size of an array in "MAX" qualifier.
00443
00444 Arguments:
00445
00446     pQualSet - Pointer to a qualifier set.
00447
00448 Return Value:
00449
00450     The size of the array. The default is 1.
00451
00452 --*/
00453 {
00454     ULONG ArraySize = 1;
00455     VARIANT pVal;
00456     BSTR bszMaxLen;
00457     HRESULT hRes;
00458
00459     if (pQualSet == NULL){
00460         return ArraySize;
00461     }
00462
00463     bszMaxLen = SysAllocString(L"MAX");
00464     VariantInit(&pVal);
00465     hRes = pQualSet->Get(bszMaxLen,
00466                             0,
00467                             &pVal,
00468                             0);
00469     SysFreeString(bszMaxLen);
00470     if (ERROR_SUCCESS == hRes && pVal.vt == VT_I4 ){
00471         ArraySize = pVal.lVal;
00472     }
00473     VariantClear(&pVal);
00474     return ArraySize;
00475 }
00476
00477 ITEM_TYPE
00478 GetItemType(
00479     IN CIMTYPE_ENUMERATION CimType,
00480     IN IWbemQualifierSet *pQualSet
00481 )
00482 /*++
00483
00484 Routine Description:
00485
00486     Examines a given qualifier set for a property and returns the type.
00487
00488 Arguments:
00489
00490     CimType - WBEM type (different from ITEM_TYPE) of a property.
00491     pQualSet - Pointer to a qualifier set for a property under consideration.
00492
00493 Return Value:
00494
00495     The type (in ITEM_TYPE) of a property.
00496
00497 --*/
00498 {
00499     ITEM_TYPE Type;
00500     VARIANT pVal;
00501     HRESULT hRes;
00502     BSTR bszQualName;
00503     WCHAR strFormat[10];
00504     WCHAR strTermination[30];
00505     WCHAR strTemp[30];
00506     BOOLEAN IsPointer = FALSE;
00507
00508     strFormat[0] = '\0';
00509     strTermination[0] = '\0';
00510     strTemp[0] = '\0';
00511
00512     if (pQualSet == NULL)
00513         return ItemUnknown;
00514
00515     bszQualName = SysAllocString(L"format");
00516     VariantInit(&pVal);
00517     hRes = pQualSet->Get(bszQualName,
00518                             0,
00519                             &pVal,
00520                             0);
00521     SysFreeString(bszQualName);
00522     if (ERROR_SUCCESS == hRes && NULL != pVal.bstrVal)
00523         wcscpy(strFormat, pVal.bstrVal);
00524
00525     bszQualName = SysAllocString(L"StringTermination");
00526     VariantClear(&pVal);
00527     hRes = pQualSet->Get(bszQualName,
00528                             0,
00529                             &pVal,
00530                             0);
00531     SysFreeString(bszQualName);
00532     if (ERROR_SUCCESS == hRes && NULL != pVal.bstrVal)
00533         wcscpy(strTermination, pVal.bstrVal);
00534
00535     bszQualName = SysAllocString(L"pointer");
00536     VariantClear(&pVal);
00537     hRes = pQualSet->Get(bszQualName,
00538                             0,
00539                             &pVal,
00540                             0);
00541     SysFreeString(bszQualName);
00542     if (ERROR_SUCCESS == hRes)
00543         IsPointer = TRUE;
00544     // Major fix required to get rid of temp
00545     bszQualName = SysAllocString(L"extension");
00546     VariantClear(&pVal);
00547     hRes = pQualSet->Get(bszQualName,
00548                             0,
00549                             &pVal,
00550                             0);
00551     SysFreeString(bszQualName);
00552     if (ERROR_SUCCESS == hRes && NULL != pVal.bstrVal)
00553         wcscpy(strTemp, pVal.bstrVal);
00554
00555     VariantClear(&pVal);
00556
00557     CimType = (CIMTYPE_ENUMERATION)(CimType & (~CIM_FLAG_ARRAY));
00558
00559     switch (CimType) {
00560         case CIM_EMPTY:
00561             Type = ItemUnknown;
00562             break;
00563         case CIM_SINT8:
00564             Type = ItemCharShort;
00565             if (!_wcsicmp(strFormat, L"c")){
00566                 Type = ItemChar;
00567             }
00568             break;
00569         case CIM_UINT8:
00570             Type = ItemUChar;
00571             break;
00572         case CIM_SINT16:
00573             Type = ItemShort;
00574             break;
00575         case CIM_UINT16:
00576             Type = ItemUShort;
00577             break;
00578         case CIM_SINT32:
00579             Type = ItemLong;
00580             break;
00581         case CIM_UINT32:
00582             Type = ItemULong;
00583             if (!_wcsicmp(strFormat, L"x")){
00584                 Type = ItemULongX;
00585             }
00586             break;
00587         case CIM_SINT64:
00588             Type = ItemLongLong;
00589             break;
00590         case CIM_UINT64:
00591             Type = ItemULongLong;
00592             break;
00593         case CIM_REAL32:
00594             Type = ItemFloat;
00595             break;
00596         case CIM_REAL64:
00597             Type = ItemDouble;
00598             break;
00599         case CIM_BOOLEAN:
00600             // ItemBool
00601             Type = ItemBool;
00602             break;
00603         case CIM_STRING:
00604
00605             if (!_wcsicmp(strTermination, L"NullTerminated")) {
00606                 if (!_wcsicmp(strFormat, L"w"))
00607                     Type = ItemWString;
00608                 else
00609                     Type = ItemString;
00610             }
00611             else if (!_wcsicmp(strTermination, L"Counted")) {
00612                 if (!_wcsicmp(strFormat, L"w"))
00613                     Type = ItemPWString;
00614                 else
00615                     Type = ItemPString;
00616             }
00617             else if (!_wcsicmp(strTermination, L"ReverseCounted")) {
00618                 if (!_wcsicmp(strFormat, L"w"))
00619                     Type = ItemDSWString;
00620                 else
00621                     Type = ItemDSString;
00622             }
00623             else if (!_wcsicmp(strTermination, L"NotCounted")) {
00624                 Type = ItemNWString;
00625             }else{
00626                 Type = ItemString;
00627             }
00628             break;
00629         case CIM_CHAR16:
00630             // ItemWChar
00631             Type = ItemWChar;
00632             break;
00633
00634         case CIM_OBJECT :
00635             if (!_wcsicmp(strTemp, L"Port"))
00636                 Type = ItemPort;
00637             else if (!_wcsicmp(strTemp, L"IPAddr"))
00638                 Type = ItemIPAddr;
00639             else if (!_wcsicmp(strTemp, L"Sid"))
00640                 Type = ItemSid;
00641             else if (!_wcsicmp(strTemp, L"Guid"))
00642                 Type = ItemGuid;
00643             break;
00644
00645         case CIM_DATETIME:
00646         case CIM_REFERENCE:
00647         case CIM_ILLEGAL:
00648         default:
00649             Type = ItemUnknown;
00650             break;
00651     }
00652
00653     if (IsPointer)
00654         Type = ItemPtr;
00655     return Type;
00656 }
00657
00658 PMOF_INFO
00659 GetPropertiesFromWBEM(
00660     IWbemClassObject *pTraceSubClasses,
00661     GUID Guid,
00662     SHORT nVersion,
00663     CHAR nLevel,
00664     SHORT nType
00665 )
00666 /*++
00667
00668 Routine Description:
00669
00670     Constructs a linked list with the information read from the WBEM
00671     namespace, given the WBEM pointer to the version subtree. It enumerates
00672     through all type classes in WBEM, and constructs MOF_INFOs for all of
00673     them (for caching purpose). Meanwhile, it looks for the event layout
00674     that mathces the passed event, and returns the pointer to the matching
00675     MOF_INFO at the end.
00676
00677 Arguments:
00678
00679     pTraceSubClasses - WBEM pointer to the version subtree.
00680     Guid - GUID of the passed event.
00681     nVersion - version of the passed event.
00682     nLevel - level of the passed event.
00683     nType - type of the passed event.
00684
00685 Return Value:
00686
00687     Pointer to MOF_INFO corresponding to the passed event.
00688     If the right type is not found, it returns the pointer to
00689     the generic MOF_INFO for the event version.
00690
00691 --*/
00692 {
00693     IEnumWbemClassObject    *pEnumTraceSubSubClasses = NULL;
00694     IWbemClassObject        *pTraceSubSubClasses = NULL;
00695     IWbemQualifierSet       *pQualSet = NULL;
00696
00697     PMOF_INFO pMofInfo = NULL, pMofLookup = NULL, pMofTemplate = NULL;
00698
00699     BSTR bszClassName = NULL;
00700     BSTR bszSubClassName = NULL;
00701     BSTR bszWmiDataId = NULL;
00702     BSTR bszEventType = NULL;
00703     BSTR bszEventTypeName = NULL;
00704     BSTR bszFriendlyName = NULL;
00705     BSTR bszPropName = NULL;
00706
00707     TCHAR strClassName[MAXSTR];
00708     TCHAR strType[MAXSTR];
00709 #ifndef UNICODE
00710     CHAR TempString[MAXSTR];
00711 #endif
00712     LONG pVarType;
00713     SHORT nEventType = EVENT_TYPE_DEFAULT;
00714
00715     LIST_ENTRY ListHead;
00716     HRESULT hRes;
00717
00718     VARIANT pVal;
00719     VARIANT pTypeVal;
00720     VARIANT pTypeNameVal;
00721     VARIANT pClassName;
00722     ULONG lEventTypeWbem;
00723     ULONG HUGEP *pTypeData;
00724     BSTR HUGEP *pTypeNameData;
00725
00726     SAFEARRAY *PropArray = NULL;
00727     SAFEARRAY *TypeArray = NULL;
00728     SAFEARRAY *TypeNameArray = NULL;
00729
00730     long lLower, lUpper, lCount, IdIndex;
00731     long lTypeLower, lTypeUpper;
00732     long lTypeNameLower, lTypeNameUpper;
00733
00734     ULONG ArraySize;
00735
00736     ITEM_TYPE ItemType;
00737
00738     InitializeListHead(&ListHead);
00739
00740     VariantInit(&pVal);
00741     VariantInit(&pTypeVal);
00742     VariantInit(&pTypeNameVal);
00743     VariantInit(&pClassName);
00744
00745     bszClassName = SysAllocString(L"__CLASS");
00746     bszWmiDataId = SysAllocString(L"WmiDataId");
00747     bszEventType = SysAllocString(L"EventType");
00748     bszEventTypeName = SysAllocString(L"EventTypeName");
00749     bszFriendlyName = SysAllocString(L"DisplayName");
00750
00751     hRes = pTraceSubClasses->Get(bszClassName,          // property name
00752                                         0L,
00753                                         &pVal,          // output to this variant
00754                                         NULL,
00755                                         NULL);
00756
00757     if (ERROR_SUCCESS == hRes){
00758         if (pQualSet) {
00759             pQualSet->Release();
00760             pQualSet = NULL;
00761         }
00762         // Get Qualifier Set to obtain the friendly name.
00763         pTraceSubClasses->GetQualifierSet(&pQualSet);
00764         hRes = pQualSet->Get(bszFriendlyName,
00765                                 0,
00766                                 &pClassName,
00767                                 0);
00768         if (ERROR_SUCCESS == hRes && pClassName.bstrVal != NULL) {
00769 #ifdef UNICODE
00770             wcscpy(strClassName, pClassName.bstrVal);
00771 #else
00772             WideCharToMultiByte(CP_ACP,
00773                                 0,
00774                                 pClassName.bstrVal,
00775                                 wcslen(pClassName.bstrVal),
00776                                 TempString,
00777                                 (MAXSTR * sizeof(CHAR)),
00778                                 NULL,
00779                                 NULL
00780                                 );
00781             strcpy(strClassName, TempString);
00782             strClassName[wcslen(pClassName.bstrVal)] = '\0';
00783 #endif
00784         }
00785         else {
00786 #ifdef UNICODE
00787             strClassName[0] = L'\0';
00788 #else
00789             strClassName[0] = '\0';
00790 #endif
00791         }
00792         // Put Event Header
00793         pMofInfo = GetNewMofInfo(Guid,
00794                                     EVENT_TYPE_DEFAULT,
00795                                     EVENT_VERSION_DEFAULT,
00796                                     EVENT_LEVEL_DEFAULT
00797                                     );
00798         if (pMofInfo != NULL) {
00799             pMofTemplate = pMofInfo;
00800             pMofLookup = pMofInfo;
00801             InsertTailList(&ListHead, &pMofInfo->Entry);
00802             pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(strClassName) + 1) * sizeof(TCHAR));
00803             if (NULL != pMofInfo->strDescription) {
00804                 _tcscpy(pMofInfo->strDescription, strClassName);
00805             }
00806         }
00807         else{
00808             goto cleanup;
00809         }
00810
00811         // Create an enumerator to find derived classes.
00812         bszSubClassName = SysAllocString(pVal.bstrVal);
00813         hRes = pWbemServices->CreateClassEnum (
00814                                     bszSubClassName,                                                // class name
00815                                     WBEM_FLAG_SHALLOW | WBEM_FLAG_USE_AMENDED_QUALIFIERS,           // shallow search
00816                                     NULL,
00817                                     &pEnumTraceSubSubClasses
00818                                     );
00819         SysFreeString ( bszSubClassName );
00820         if (ERROR_SUCCESS == hRes) {
00821             ULONG uReturnedSub = 1;
00822
00823             while(uReturnedSub == 1){
00824                 // For each event in the subclass
00825                 pTraceSubSubClasses = NULL;
00826                 hRes = pEnumTraceSubSubClasses->Next(5000,                  // timeout in five seconds
00827                                                     1,                      // return just one instance
00828                                                     &pTraceSubSubClasses,   // pointer to a Sub class
00829                                                     &uReturnedSub);         // number obtained: one
00830                 if (ERROR_SUCCESS == hRes && uReturnedSub == 1) {
00831                     if (pQualSet) {
00832                         pQualSet->Release();
00833                         pQualSet = NULL;
00834                     }
00835                     // Get Qualifier Set.
00836                     pTraceSubSubClasses->GetQualifierSet(&pQualSet);
00837                     // Get Type number among Qualifiers
00838                     VariantClear(&pTypeVal);
00839                     hRes = pQualSet->Get(bszEventType,
00840                                             0,
00841                                             &pTypeVal,
00842                                             0);
00843
00844                     if (ERROR_SUCCESS == hRes) {
00845                         TypeArray = NULL;
00846                         TypeNameArray = NULL;
00847                         if (pTypeVal.vt & VT_ARRAY) {   // EventType is an array
00848                             TypeArray = pTypeVal.parray;
00849                             VariantClear(&pTypeNameVal);
00850                             hRes = pQualSet->Get(bszEventTypeName,
00851                                                     0,
00852                                                     &pTypeNameVal,
00853                                                     0);
00854                             if ((ERROR_SUCCESS == hRes) && (pTypeNameVal.vt & VT_ARRAY)) {
00855                                 TypeNameArray = pTypeNameVal.parray;
00856                             }
00857                             if (TypeArray != NULL) {
00858                                 hRes = SafeArrayGetLBound(TypeArray, 1, &lTypeLower);
00859                                 if (ERROR_SUCCESS != hRes) {
00860                                     break;
00861                                 }
00862                                 hRes = SafeArrayGetUBound(TypeArray, 1, &lTypeUpper);
00863                                 if (ERROR_SUCCESS != hRes) {
00864                                     break;
00865                                 }
00866                                 if (lTypeUpper < 0) {
00867                                     break;
00868                                 }
00869                                 SafeArrayAccessData(TypeArray, (void HUGEP **)&pTypeData );
00870
00871                                 if (TypeNameArray != NULL) {
00872                                     hRes = SafeArrayGetLBound(TypeNameArray, 1, &lTypeNameLower);
00873                                     if (ERROR_SUCCESS != hRes) {
00874                                         break;
00875                                     }
00876                                     hRes = SafeArrayGetUBound(TypeNameArray, 1, &lTypeNameUpper);
00877                                     if (ERROR_SUCCESS != hRes) {
00878                                         break;
00879                                     }
00880                                     if (lTypeNameUpper < 0)
00881                                         break;
00882                                     SafeArrayAccessData(TypeNameArray, (void HUGEP **)&pTypeNameData );
00883                                 }
00884
00885                                 for (lCount = lTypeLower; lCount <= lTypeUpper; lCount++) {
00886                                     lEventTypeWbem = pTypeData[lCount];
00887                                     nEventType = (SHORT)lEventTypeWbem;
00888                                     pMofInfo = GetNewMofInfo(Guid, nEventType, nVersion, nLevel);
00889                                     if (pMofInfo != NULL) {
00890                                         InsertTailList(&ListHead, &pMofInfo->Entry);
00891                                         if (pMofTemplate != NULL && pMofTemplate->strDescription != NULL) {
00892                                             pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(pMofTemplate->strDescription) + 1) * sizeof(TCHAR));
00893                                             if (pMofInfo->strDescription != NULL) {
00894                                                 _tcscpy(pMofInfo->strDescription, pMofTemplate->strDescription);
00895                                             }
00896                                         }
00897                                         if (nType == nEventType) {
00898                                             // Type matched
00899                                             pMofLookup = pMofInfo;
00900                                         }
00901                                         if (TypeNameArray != NULL) {
00902                                             if ((lCount >= lTypeNameLower) && (lCount <= lTypeNameUpper)) {
00903                                                 pMofInfo->strType = (LPTSTR)malloc((wcslen((LPWSTR)pTypeNameData[lCount]) + 1) * sizeof(TCHAR));
00904                                                 if (pMofInfo->strType != NULL){
00905 #ifdef UNICODE
00906                                                     wcscpy(pMofInfo->strType, (LPWSTR)(pTypeNameData[lCount]));
00907 #else
00908                                                     WideCharToMultiByte(CP_ACP,
00909                                                                         0,
00910                                                                         (LPWSTR)(pTypeNameData[lCount]),
00911                                                                         wcslen((LPWSTR)(pTypeNameData[lCount])),
00912                                                                         TempString,
00913                                                                         (MAXSTR * sizeof(CHAR)),
00914                                                                         NULL,
00915                                                                         NULL
00916                                                                         );
00917                                                     TempString[wcslen((LPWSTR)(pTypeNameData[lCount]))] = '\0';
00918                                                     strcpy(pMofInfo->strType, TempString);
00919 #endif
00920                                                 }
00921                                             }
00922                                         }
00923                                     }
00924                                 }
00925                                 SafeArrayUnaccessData(TypeArray);
00926                                 SafeArrayDestroy(TypeArray);
00927                                 VariantInit(&pTypeVal);
00928                                 if (TypeNameArray != NULL) {
00929                                     SafeArrayUnaccessData(TypeNameArray);
00930                                     SafeArrayDestroy(TypeNameArray);
00931                                     VariantInit(&pTypeNameVal);
00932                                 }
00933                             }
00934                             else {
00935                                 // If the Types are not found, then bail
00936                                 break;
00937                             }
00938                         }
00939                         else {                          // EventType is scalar
00940                             hRes = VariantChangeType(&pTypeVal, &pTypeVal, 0, VT_I2);
00941                             if (ERROR_SUCCESS == hRes)
00942                                 nEventType = (SHORT)V_I2(&pTypeVal);
00943                             else
00944                                 nEventType = (SHORT)V_I4(&pTypeVal);
00945
00946                             VariantClear(&pTypeNameVal);
00947                             hRes = pQualSet->Get(bszEventTypeName,
00948                                                     0,
00949                                                     &pTypeNameVal,
00950                                                     0);
00951                             if (ERROR_SUCCESS == hRes) {
00952 #ifdef UNICODE
00953                                 wcscpy(strType, pTypeNameVal.bstrVal);
00954 #else
00955                                 WideCharToMultiByte(CP_ACP,
00956                                                     0,
00957                                                     pTypeNameVal.bstrVal,
00958                                                     wcslen(pTypeNameVal.bstrVal),
00959                                                     TempString,
00960                                                     (MAXSTR * sizeof(CHAR)),
00961                                                     NULL,
00962                                                     NULL
00963                                                     );
00964                                 strcpy(strType, TempString);
00965                                 strType[wcslen(pTypeNameVal.bstrVal)] = '\0';
00966 #endif
00967                             }
00968                             else{
00969 #ifdef UNICODE
00970                                 strType[0] = L'\0';
00971 #else
00972                                 strType[0] = '\0';
00973 #endif
00974                             }
00975
00976                             pMofInfo = GetNewMofInfo(Guid, nEventType, nVersion, nLevel);
00977                             if (pMofInfo != NULL) {
00978                                 InsertTailList(&ListHead, &pMofInfo->Entry);
00979                                 if (pMofTemplate != NULL && pMofTemplate->strDescription != NULL) {
00980                                     pMofInfo->strDescription = (LPTSTR)malloc((_tcslen(pMofTemplate->strDescription) + 1) * sizeof(TCHAR));
00981                                     if (pMofInfo->strDescription != NULL) {
00982                                         _tcscpy(pMofInfo->strDescription, pMofTemplate->strDescription);
00983                                     }
00984                                 }
00985                                 if (nType == nEventType) {
00986                                     // Type matched
00987                                     pMofLookup = pMofInfo;
00988                                 }
00989                                 pMofInfo->strType = (LPTSTR)malloc((_tcslen(strType) + 1) * sizeof(TCHAR));
00990                                 if (pMofInfo->strType != NULL){
00991                                     _tcscpy(pMofInfo->strType, strType);
00992                                 }
00993                             }
00994                         }
00995
00996                         // Get event layout
00997                         VariantClear(&pVal);
00998                         IdIndex = 1;
00999                         V_VT(&pVal) = VT_I4;
01000                         V_I4(&pVal) = IdIndex;
01001                         // For each property
01002                         PropArray = NULL;
01003                         while (pTraceSubSubClasses->GetNames(bszWmiDataId,                  // only properties with WmiDataId qualifier
01004                                                             WBEM_FLAG_ONLY_IF_IDENTICAL,
01005                                                             &pVal,                          // WmiDataId number starting from 1
01006                                                             &PropArray) == WBEM_NO_ERROR) {
01007
01008                             hRes = SafeArrayGetLBound(PropArray, 1, &lLower);
01009                             if (ERROR_SUCCESS != hRes) {
01010                                 break;
01011                             }
01012                             hRes = SafeArrayGetUBound(PropArray, 1, &lUpper);
01013                             if (ERROR_SUCCESS != hRes) {
01014                                 break;
01015                             }
01016                             if (lUpper < 0)
01017                                 break;
01018                             // This loop will iterate just once.
01019                             for (lCount = lLower; lCount <= lUpper; lCount++) {
01020                                 hRes = SafeArrayGetElement(PropArray, &lCount, &bszPropName);
01021                                 if (ERROR_SUCCESS != hRes) {
01022                                     break;
01023                                 }
01024                                 hRes = pTraceSubSubClasses->Get(bszPropName,    // Property name
01025                                                                 0L,
01026                                                                 NULL,
01027                                                                 &pVarType,      // CIMTYPE of the property
01028                                                                 NULL);
01029                                 if (ERROR_SUCCESS != hRes) {
01030                                     break;
01031                                 }
01032
01033                                 // Get the Qualifier set for the property
01034                                 if (pQualSet) {
01035                                     pQualSet->Release();
01036                                     pQualSet = NULL;
01037                                 }
01038                                 hRes = pTraceSubSubClasses->GetPropertyQualifierSet(bszPropName,
01039                                                                         &pQualSet);
01040
01041                                 if (ERROR_SUCCESS != hRes) {
01042                                     break;
01043                                 }
01044
01045                                 ItemType = GetItemType((CIMTYPE_ENUMERATION)pVarType, pQualSet);
01046
01047                                 if( pVarType & CIM_FLAG_ARRAY ){
01048                                     ArraySize = GetArraySize(pQualSet);
01049                                 }else{
01050                                     ArraySize = 1;
01051                                 }
01052 #ifdef UNICODE
01053                                 AddMofInfo(&ListHead,
01054                                             bszPropName,
01055                                             ItemType,
01056                                             ArraySize);
01057 #else
01058                                 WideCharToMultiByte(CP_ACP,
01059                                                     0,
01060                                                     bszPropName,
01061                                                     wcslen(bszPropName),
01062                                                     TempString,
01063                                                     (MAXSTR * sizeof(CHAR)),
01064                                                     NULL,
01065                                                     NULL
01066                                                     );
01067                                 TempString[wcslen(bszPropName)] = '\0';
01068                                 AddMofInfo(&ListHead,
01069                                             TempString,
01070                                             ItemType,
01071                                             ArraySize);
01072 #endif
01073                             }
01074                             SafeArrayDestroy(PropArray);
01075                             PropArray = NULL;
01076                             V_I4(&pVal) = ++IdIndex;
01077                         }   // end enumerating through WmiDataId
01078                         FlushMofList(&ListHead);
01079                     }   // if getting event type was successful
01080                 }   // if enumeration returned a subclass successfully
01081             }   // end enumerating subclasses
01082         }   // if enumeration was created successfully
01083     }   // if getting class name was successful
01084 cleanup:
01085     VariantClear(&pVal);
01086     VariantClear(&pTypeVal);
01087     VariantClear(&pClassName);
01088
01089     SysFreeString(bszClassName);
01090     SysFreeString(bszWmiDataId);
01091     SysFreeString(bszEventType);
01092     SysFreeString(bszEventTypeName);
01093     SysFreeString(bszFriendlyName);
01094     // Should not free bszPropName becuase it is already freed by SafeArrayDestroy
01095
01096     FlushMofList(&ListHead);
01097
01098     return pMofLookup;
01099 }
01100
01101 PMOF_INFO
01102 GetGuids (GUID Guid,
01103         SHORT nVersion,
01104         CHAR nLevel,
01105         SHORT nType
01106         )
01107 /*++
01108
01109 Routine Description:
01110
01111     Aceesses the MOF data information from WBEM, creates a linked list,
01112     and returns a pointer that matches the passed event.
01113     This function finds the right subtree within the WBEM namespace,
01114     and calls GetPropertiesFromWBEM() to create the list.
01115
01116 Arguments:
01117
01118     Guid - GUID of the passed event.
01119     nVersion - version of the passed event.
01120     nLevel - level of the passed event.
01121     nType - type of the passed event.
01122
01123 Return Value:
01124
01125     PMOF_INFO to MOF_INFO structure that matches the passed event.
01126     NULL if no match is found.
01127
01128 --*/
01129 {
01130     IEnumWbemClassObject    *pEnumTraceSubClasses = NULL, *pEnumTraceSubSubClasses = NULL;
01131     IWbemClassObject        *pTraceSubClasses = NULL, *pTraceSubSubClasses = NULL;
01132     IWbemQualifierSet       *pQualSet = NULL;
01133
01134     BSTR bszInstance = NULL;
01135     BSTR bszPropertyName = NULL;
01136     BSTR bszSubClassName = NULL;
01137     BSTR bszGuid = NULL;
01138     BSTR bszVersion = NULL;
01139
01140     WCHAR strGuid[MAXSTR], strTargetGuid[MAXSTR];
01141
01142     HRESULT hRes;
01143
01144     VARIANT pVal;
01145     VARIANT pGuidVal;
01146     VARIANT pVersionVal;
01147
01148     UINT nCounter=0;
01149     BOOLEAN MatchFound;
01150     SHORT nEventVersion = EVENT_VERSION_DEFAULT;
01151
01152     PMOF_INFO pMofLookup = NULL;
01153
01154     VariantInit(&pVal);
01155     VariantInit(&pGuidVal);
01156     VariantInit(&pVersionVal);
01157
01158     if (NULL == pWbemServices) {
01159         hRes = WbemConnect( &pWbemServices );
01160         if ( ERROR_SUCCESS != hRes ) {
01161             goto cleanup;
01162         }
01163     }
01164
01165     // Convert traget GUID to string for later comparison
01166 #ifdef UNICODE
01167     GuidToString(strTargetGuid, &Guid);
01168 #else
01169     CHAR TempString[MAXSTR];
01170     GuidToString(TempString, &Guid);
01171     MultiByteToWideChar(CP_ACP, 0, TempString, -1, strTargetGuid, MAXSTR);
01172 #endif
01173
01174     bszInstance = SysAllocString(L"EventTrace");
01175     bszPropertyName = SysAllocString(L"__CLASS");
01176     bszGuid = SysAllocString(L"Guid");
01177     bszVersion = SysAllocString(L"EventVersion");
01178     pEnumTraceSubClasses = NULL;
01179
01180     // Get an enumerator for all classes under "EventTace".
01181     hRes = pWbemServices->CreateClassEnum (
01182                 bszInstance,
01183                 WBEM_FLAG_SHALLOW | WBEM_FLAG_USE_AMENDED_QUALIFIERS,
01184                 NULL,
01185                 &pEnumTraceSubClasses );
01186     SysFreeString (bszInstance);
01187
01188     if (ERROR_SUCCESS == hRes) {
01189         ULONG uReturned = 1;
01190         MatchFound = FALSE;
01191         while (uReturned == 1) {
01192             pTraceSubClasses = NULL;
01193             // Get the next ClassObject.
01194             hRes = pEnumTraceSubClasses->Next(5000,             // timeout in five seconds
01195                                             1,                  // return just one instance
01196                                             &pTraceSubClasses,  // pointer to Event Trace Sub Class
01197                                             &uReturned);        // number obtained: one or zero
01198             if (ERROR_SUCCESS == hRes && (uReturned == 1)) {
01199                 // Get the class name
01200                 hRes = pTraceSubClasses->Get(bszPropertyName,   // property name
01201                                                 0L,
01202                                                 &pVal,          // output to this variant
01203                                                 NULL,
01204                                                 NULL);
01205                 if (ERROR_SUCCESS == hRes){
01206                     bszSubClassName = SysAllocString(pVal.bstrVal);
01207                     // Create an enumerator to find derived classes.
01208                     hRes = pWbemServices->CreateClassEnum (
01209                                             bszSubClassName,
01210                                             WBEM_FLAG_SHALLOW | WBEM_FLAG_USE_AMENDED_QUALIFIERS,
01211                                             NULL,
01212                                             &pEnumTraceSubSubClasses
01213                                             );
01214                     SysFreeString ( bszSubClassName );
01215                     bszSubClassName = NULL;
01216                     VariantClear(&pVal);
01217
01218                     if (ERROR_SUCCESS == hRes) {
01219
01220                         ULONG uReturnedSub = 1;
01221                         while(uReturnedSub == 1){
01222
01223                             pTraceSubSubClasses = NULL;
01224                             // enumerate through the resultset.
01225                             hRes = pEnumTraceSubSubClasses->Next(5000,              // timeout in five seconds
01226                                                             1,                      // return just one instance
01227                                                             &pTraceSubSubClasses,   // pointer to a Sub class
01228                                                             &uReturnedSub);         // number obtained: one or zero
01229                             if (ERROR_SUCCESS == hRes && uReturnedSub == 1) {
01230                                 // Get the subclass name
01231                                 hRes = pTraceSubSubClasses->Get(bszPropertyName,    // Class name
01232                                                                 0L,
01233                                                                 &pVal,              // output to this variant
01234                                                                 NULL,
01235                                                                 NULL);
01236                                 VariantClear(&pVal);
01237
01238                                 if (ERROR_SUCCESS == hRes){
01239                                     // Get Qualifier Set.
01240                                     if (pQualSet) {
01241                                         pQualSet->Release();
01242                                         pQualSet = NULL;
01243                                     }
01244                                     pTraceSubSubClasses->GetQualifierSet (&pQualSet );
01245
01246                                     // Get GUID among Qualifiers
01247                                     hRes = pQualSet->Get(bszGuid,
01248                                                             0,
01249                                                             &pGuidVal,
01250                                                             0);
01251                                     if (ERROR_SUCCESS == hRes) {
01252                                         wcscpy(strGuid, (LPWSTR)V_BSTR(&pGuidVal));
01253                                         VariantClear ( &pGuidVal  );
01254
01255                                         if (!wcsstr(strGuid, L"{"))
01256                                             swprintf(strGuid , L"{%s}", strGuid);
01257
01258                                         if (!_wcsicmp(strTargetGuid, strGuid)) {
01259                                             hRes = pQualSet->Get(bszVersion,
01260                                                                     0,
01261                                                                     &pVersionVal,
01262                                                                     0);
01263                                             if (ERROR_SUCCESS == hRes) {
01264                                                 hRes = VariantChangeType(&pVersionVal, &pVersionVal, 0, VT_I2);
01265                                                 if (ERROR_SUCCESS == hRes)
01266                                                     nEventVersion = (SHORT)V_I2(&pVersionVal);
01267                                                 else
01268                                                     nEventVersion = (SHORT)V_I4(&pVersionVal);
01269                                                 VariantClear(&pVersionVal);
01270
01271                                                 if (nVersion == nEventVersion) {
01272                                                     // Match is found.
01273                                                     // Now put all events in this subtree into the list
01274                                                     MatchFound = TRUE;
01275                                                     pMofLookup = GetPropertiesFromWBEM( pTraceSubSubClasses,
01276                                                                                         Guid,
01277                                                                                         nVersion,
01278                                                                                         nLevel,
01279                                                                                         nType
01280                                                                                         );
01281                                                     break;
01282                                                 }
01283                                             }
01284                                             else {
01285                                                 // if there is no version number for this event,
01286                                                 // the current one is the only one
01287                                                 // Now put all events in this subtree into the list
01288                                                 MatchFound = TRUE;
01289                                                 pMofLookup = GetPropertiesFromWBEM( pTraceSubSubClasses,
01290                                                                                     Guid,
01291                                                                                     EVENT_VERSION_DEFAULT,
01292                                                                                     nLevel,
01293                                                                                     nType
01294                                                                                     );
01295                                                 break;
01296                                             }
01297                                         }
01298                                     }
01299                                 }
01300                             }
01301                         } // end while enumerating sub classes
01302                         if (MatchFound) {
01303                             break;
01304                         }
01305                         if (pEnumTraceSubSubClasses) {
01306                             pEnumTraceSubSubClasses->Release();
01307                             pEnumTraceSubSubClasses = NULL;
01308                         }
01309                     }   // if creating enumeration was successful
01310                     else {
01311                         pEnumTraceSubSubClasses = NULL;
01312                     }
01313                 }   // if getting class name was successful
01314             }
01315             nCounter++;
01316             // if match is found, break out of the top level search
01317             if (MatchFound)
01318                 break;
01319         }   // end while enumerating top classes
01320         if( pEnumTraceSubClasses ){
01321             pEnumTraceSubClasses->Release();
01322             pEnumTraceSubClasses = NULL;
01323         }
01324     }   // if creating enumeration for top level is successful
01325
01326 cleanup:
01327
01328     VariantClear(&pGuidVal);
01329     VariantClear(&pVersionVal);
01330
01331     SysFreeString(bszGuid);
01332     SysFreeString(bszPropertyName);
01333     SysFreeString(bszVersion);
01334
01335     if( pEnumTraceSubClasses ){
01336         pEnumTraceSubClasses->Release();
01337         pEnumTraceSubClasses = NULL;
01338     }
01339     if (pEnumTraceSubSubClasses){
01340         pEnumTraceSubSubClasses->Release();
01341         pEnumTraceSubSubClasses = NULL;
01342     }
01343     if (pQualSet) {
01344         pQualSet->Release();
01345         pQualSet = NULL;
01346     }
01347
01348     return pMofLookup;
01349 }
01350
01351 void
01352 RemoveMofInfo(
01353     PLIST_ENTRY pMofInfo
01354 )
01355 /*++
01356
01357 Routine Description:
01358
01359     Removes and frees data item structs from a given list.
01360
01361 Arguments:
01362
01363     pMofInfo - Pointer to the MOF_INFO to be purged of data item structs.
01364
01365 Return Value:
01366
01367     None.
01368
01369 --*/
01370 {
01371     PLIST_ENTRY Head, Next;
01372     PITEM_DESC pItem;
01373
01374     Head = pMofInfo;
01375     Next = Head->Flink;
01376     while (Head != Next) {
01377         pItem = CONTAINING_RECORD(Next, ITEM_DESC, Entry);
01378         Next = Next->Flink;
01379         RemoveEntryList(&pItem->Entry);
01380         free(pItem);
01381     }
01382 }
01383
Generated on Wed Nov 13 2024 16:52:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/osp/vc/common.h Source File

  • Dataaccess
  • osp
  • vc

common.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Test OLEDB Simple Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation.  All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module COMMON.H | Assertion Routines
00008 //
00009 //
00010
00011 ////////////////////////////////////////////////////////
00012 // Includes
00013 //
00014 ////////////////////////////////////////////////////////
00015
00016 //  OLE DB headers
00017 #include "oledb.h"
00018 #include "oledberr.h"
00019
00020 #include "msdaosp.h"    //OLEDBSimpleProvider
00021 #include <ocidl.h>      //IConnectionPointContainer
00022
00023
00024 ////////////////////////////////////////////////////////
00025 // Defines
00026 //
00027 ////////////////////////////////////////////////////////
00028 //IMalloc Wrappers
00029 #define CHECK_MEMORY(pv)      if(!(pv)) goto CLEANUP
00030
00031 #define SAFE_ALLOC(pv, type, cb)  { pv = (type*)CoTaskMemAlloc((cb)*sizeof(type)); CHECK_MEMORY(pv); }
00032 #define SAFE_REALLOC(pv, type, cb)  { pv = (type*)CoTaskMemRealloc(pv, (cb)*sizeof(type)); CHECK_MEMORY(pv);}
00033 #define SAFE_SYSALLOC(pv, bstr)   { pv = SysAllocString(bstr); CHECK_MEMORY(pv); }
00034
00035 #define SAFE_FREE(pv)       { CoTaskMemFree(pv); pv = NULL; }
00036 #define SAFE_SYSFREE(bstr)      { SysFreeString(bstr); bstr = NULL;}
00037
00038 //IUnknown->Release Wrapper
00039 #define SAFE_RELEASE(pv)      if((pv)) { (pv)->Release(); (pv) = NULL; }
00040 #define SAFE_ADDREF(pv)       if((pv)) { (pv)->AddRef();        }
00041
00042 //Test macros
00043 #define TEST(exp)         { if(FAILED(exp)) { ASSERT(!#exp); } }
00044 #define TESTC(exp)          { if(FAILED(exp)) { goto CLEANUP;  } }
00045
00046 #define NUMELEM(x)    (sizeof(x)/sizeof(*x))
00047
00048 #define MAX_NAME_LEN   256
00049 #define MAX_BLOCK_SIZE    50
00050
00051 #define EQUAL    (0)
00052 #define LESSTHAN  (-1)
00053 #define GREATERTHAN  (1)
00054 #define NOTEQUAL  (-2)
00055
00056 ////////////////////////////////////////////////////////
00057 // General
00058 //
00059 ////////////////////////////////////////////////////////
00060 BOOL CompareVariant(VARIANT* pVar1, VARIANT* pVar2, BOOL fCaseSensitive);
00061
00062
00063 ////////////////////////////////////////////////////////
00064 // RegEntry
00065 //
00066 ////////////////////////////////////////////////////////
00067 struct REGENTRY
00068 {
00069   HKEY  hRootKey;
00070     CHAR* szKeyName;
00071     CHAR* szValueName;
00072     CHAR* szValue;
00073 };
00074
00075 HRESULT GetRegEntry(REGENTRY* pRegEntry, CHAR* pszData, ULONG cBytes);
00076 HRESULT GetRegEntry(HKEY hRootKey, CHAR* pszKeyName, CHAR* pszValueName, CHAR* pszValue, ULONG cBytes);
00077
00078 HRESULT SetRegEntry(REGENTRY* pRegEntry);
00079 HRESULT SetRegEntry(HKEY hRootKey, CHAR* pszKeyName, CHAR* pszValueName, CHAR* pszValue);
00080
00081 HRESULT DelRegEntry(REGENTRY* pRegEntry);
00082 HRESULT DelRegEntry(HKEY hRootKey, CHAR* pszKeyName);
00083
00084 HRESULT ConvertToMBCS(WCHAR* pwsz, CHAR* psz, ULONG cbStrLen);
00085 HRESULT ConvertToWCHAR(CHAR* psz, WCHAR* pwsz, ULONG cbStrLen);
00086
00087 extern const IID IID_DataSourceListener;
00088
00089 //extern const IID IID_DataSource;
00090
00091 extern const IID IID_OLEDBSimpleProviderListener;
00092
00093 extern const IID IID_OLEDBSimpleProvider;
00094
Generated on Wed Nov 13 2024 16:51:50 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Taskpads/localres.h Source File

  • SysMgmt
  • MMC
  • Taskpads

localres.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #ifndef __LocalResource_H__
00020 #define __LocalResource_H__
00021
00022 #define INDEX_NONE          -1
00023 #define INDEX_SPACEICON     0
00024 #define INDEX_LANDICON      1
00025 #define INDEX_SKYICON       2
00026 #define INDEX_PEOPLEICON    3
00027 #define INDEX_CLOSEDFOLDER  4
00028 #define INDEX_OPENFOLDER    5
00029
00030 #endif // __LocalResource_H__
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_FILESHARESAMPLE_PROPS Member List

This is the complete list of members for _FILESHARESAMPLE_PROPS, including all inherited members.
nMaxUsers | _FILESHARESAMPLE_PROPS
pwszPath | _FILESHARESAMPLE_PROPS
pwszRemark | _FILESHARESAMPLE_PROPS
pwszShareName | _FILESHARESAMPLE_PROPS
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Hello/Hello.Cpp Source File

  • Web
  • MSAgent
  • c
  • Hello

Hello.Cpp

Go to the documentation of this file.
00001 #ifndef STRICT
00002 #define STRICT
00003 #endif
00004
00005
00006 //==========================================================================
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1997 - 2000 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //--------------------------------------------------------------------------
00016 //
00017 // This sample demonstrates the simplest Microsoft Agent application
00018 //
00019 //==========================================================================
00020
00021
00022 #include <windows.h>
00023 #include <tchar.h>
00024 #include "AgtSvr.h"
00025 #include "AgtSvr_i.c"
00026
00027
00028 static const LPWSTR kpwzCharacterOld = L"\\program files\\microsoft agent\\characters\\genie.acs";
00029 static const LPTSTR kpszAppTitle = _T("Microsoft Agent Samples");
00030
00031
00032 extern "C" int PASCAL WinMain(HINSTANCE hInst,
00033                 HINSTANCE hInstPrev,
00034                 LPSTR lpCmdLine,
00035                 int nCmdShow) {
00036
00037   HRESULT       hRes;
00038   _TCHAR        szError[256];
00039   VARIANT       vPath;
00040   BSTR        bszSpeak;
00041   long        lCharID;
00042   long        lRequestID;
00043   IAgentEx       *pAgentEx;
00044   IAgentCharacterEx  *pCharacterEx = NULL;
00045
00046   // Initialize COM
00047
00048     if (FAILED(CoInitialize(NULL))) {
00049     MessageBox(NULL,
00050            _T("There was an error initializing COM."),
00051            kpszAppTitle,
00052            MB_OK | MB_ICONERROR);
00053         return -1;
00054   }
00055
00056   // Create an instance of the Agent 2.0 server. NOTE: by
00057   // asking for an IAgentEx interface we know we will get
00058   // at least Agent 2.0. The CLSID also changed between
00059   // 1.5 and 2.0 so we know we won't get the 1.5 server.
00060
00061   hRes = CoCreateInstance(CLSID_AgentServer,
00062               NULL,
00063               CLSCTX_SERVER,
00064               IID_IAgentEx,
00065               (LPVOID *)&pAgentEx);
00066   if (FAILED(hRes)) {
00067
00068     wsprintf(szError, _T("There was an error initializing Microsoft Agent, code = 0x%x"), hRes);
00069
00070     MessageBox(NULL,
00071            szError,
00072            kpszAppTitle,
00073            MB_OK | MB_ICONERROR | MB_TOPMOST);
00074
00075     CoUninitialize();
00076
00077     return -1;
00078   }
00079
00080   __try {
00081
00082     // First try to load the default character
00083
00084     VariantInit(&vPath);
00085     vPath.vt = VT_EMPTY;
00086
00087     hRes = pAgentEx->Load(vPath, &lCharID, &lRequestID);
00088
00089     if (FAILED(hRes)) {
00090
00091       // There's no default character. See if we can load the
00092       // character from the directory used in most version 1.5
00093       // applications.
00094
00095       vPath.vt = VT_BSTR;
00096       vPath.bstrVal = SysAllocString(kpwzCharacterOld);
00097
00098       if (vPath.bstrVal == NULL) {
00099         hRes = E_OUTOFMEMORY;
00100         __leave;
00101       }
00102
00103       hRes = pAgentEx->Load(vPath, &lCharID, &lRequestID);
00104
00105       // Did we successfully load a character?
00106
00107       if (FAILED(hRes))
00108         __leave;
00109     }
00110
00111     // Get the IAgentCharacterEx interface
00112
00113     hRes = pAgentEx->GetCharacterEx(lCharID, &pCharacterEx);
00114
00115     if (FAILED(hRes))
00116       __leave;
00117
00118     // Set the language of the character
00119
00120     hRes = pCharacterEx->SetLanguageID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
00121
00122     if (FAILED(hRes))
00123       __leave;
00124
00125     // Show the character.  The first parameter tells Microsoft
00126     // Agent to show the character by playing an animation.
00127
00128     hRes = pCharacterEx->Show(FALSE, &lRequestID);
00129
00130     if (FAILED(hRes))
00131       __leave;
00132
00133     // Make the character speak
00134
00135     bszSpeak = SysAllocString(L"Hello World!");
00136
00137     hRes = pCharacterEx->Speak(bszSpeak, NULL, &lRequestID);
00138
00139     SysFreeString(bszSpeak);
00140
00141     if (FAILED(hRes))
00142       __leave;
00143
00144     // This is a very simplistic sample.  Sleep for 10 seconds
00145     // and then die.
00146
00147     Sleep(10000);
00148
00149   }
00150   __finally {
00151
00152     if (FAILED(hRes)) {
00153
00154       wsprintf(szError, _T("An error occurred in Microsoft Agent, code = 0x%x"), hRes);
00155
00156       MessageBox(NULL,
00157              szError,
00158              kpszAppTitle,
00159              MB_OK | MB_ICONERROR | MB_TOPMOST);
00160     }
00161   }
00162
00163   // Clean up
00164
00165   if (pCharacterEx) {
00166
00167     // Release the character interface
00168
00169     pCharacterEx->Release();
00170
00171     // Unload the character.  NOTE:  releasing the character
00172     // interface does NOT make the character go away.  You must
00173     // call Unload.
00174
00175     pAgentEx->Unload(lCharID);
00176   }
00177
00178   // Release the Agent
00179
00180   pAgentEx->Release();
00181
00182   VariantClear(&vPath);
00183
00184   CoUninitialize();
00185
00186   return 0;
00187 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

qcship::Ship Member List

This is the complete list of members for qcship::Ship, including all inherited members.
customerID | qcship::Ship | [private]
iid | qcship::IShipDefault | [static]
InvokeNotify() | qcship::Ship | [inline, private]
itemVect | qcship::Ship | [private]
LineItem(int itemID, int quantity) | qcship::Ship | [inline]
orderID | qcship::Ship | [private]
Process(int lFlags) | qcship::Ship | [inline]
quantityVect | qcship::Ship | [private]
randomShipStatus() | qcship::Ship | [inline, private]
setCustomerId(int customerID) | qcship::Ship | [inline]
setOrderId(int orderID) | qcship::Ship | [inline]
Ship() | qcship::Ship | [inline]
shipStatusValue(String shipStatus) | qcship::Ship | [inline, private]
shipStatusVect | qcship::Ship | [private]
WriteShipDB() | qcship::Ship | [inline, private]
Generated on Wed Nov 13 2024 16:58:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Policy/C++/Windows2000/CeLibW2k.h Source File

  • Security
  • CertServices
  • Policy
  • C++
  • Windows2000

CeLibW2k.h

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Microsoft Windows
00004 //
00005 //  Copyright (C) Microsoft Corporation, 1995 - 1999
00006 //
00007 //  File:       celib.h
00008 //
00009 //  Contents:   helper functions
00010 //
00011 //--------------------------------------------------------------------------
00012
00013 #ifndef __CELIB_H__
00014 #define __CELIB_H__
00015
00016
00017 #define CENCODEMAX  (64 * 1024)
00018
00019 // Bitmap manipulation routines.  Fetch or set a bit, given a base and index.
00020 #define GETBIT(pb, i) ((pb)[(i) / 8] & (1 << ((i) % 8)))
00021 #define SETBIT(pb, i) ((pb)[(i) / 8] |= (1 << ((i) % 8)))
00022 #define CLEARBIT(pb, i) ((pb)[(i) / 8] &= ~(1 << ((i) % 8)))
00023
00024 #define BITSTOBYTES(b)  ((int)(((b) + 7) / 8))
00025
00026 // Size of a fixed array:
00027 #define ARRAYSIZE(a)    (sizeof(a)/sizeof((a)[0]))
00028
00029 #define wszCERTENROLLSHAREPATH  L"CertSrv\\CertEnroll"
00030
00031 #define cwcHRESULTSTRING  40
00032
00033 #define SAFE_SUBTRACT_POINTERS(p1, p2) \
00034     (assert(sizeof((*p1)) == sizeof(*(p2))), ((p1) - (p2)))
00035
00036 #define _PrintErrorStr(hr, pszMessage, pwsz) \
00037     _PrintError((hr), (pszMessage))
00038
00039 #define _PrintErrorStr2(hr, pszMessage, pwsz, hr2) \
00040     _PrintError((hr), (pszMessage))
00041
00042 #define _PrintError2(hr, pszMessage, hr2) \
00043     _PrintError((hr), (pszMessage))
00044
00045 #define _PrintError(hr, pszMessage) \
00046       ceERRORPRINTLINE((pszMessage), (hr))
00047
00048
00049 #define _PrintIfErrorStr(hr, pszMessage, pwsz) \
00050     _PrintIfError((hr), (pszMessage))
00051
00052 #define _PrintIfErrorStr2(hr, pszMessage, pwsz, hr2) \
00053     _PrintIfError((hr), (pszMessage))
00054
00055 #define _PrintIfError2(hr, pszMessage, hr2) \
00056     _PrintIfError((hr), (pszMessage))
00057
00058 #define _PrintIfError(hr, pszMessage) \
00059     { \
00060   if (S_OK != (hr)) \
00061   { \
00062       ceERRORPRINTLINE((pszMessage), (hr)); \
00063   } \
00064     }
00065
00066
00067 #define _JumpErrorStr(hr, label, pszMessage, pwsz) \
00068     _JumpError((hr), label, (pszMessage))
00069
00070 #define _JumpError(hr, label, pszMessage) \
00071     { \
00072   ceERRORPRINTLINE((pszMessage), (hr)); \
00073   goto label; \
00074     }
00075
00076
00077 #define _JumpIfErrorStr(hr, label, pszMessage, pwsz) \
00078     _JumpIfError((hr), label, (pszMessage))
00079
00080 #define _JumpIfErrorStr2(hr, label, pszMessage, pwsz, hr2) \
00081     _JumpIfError((hr), label, (pszMessage))
00082
00083 #define _JumpIfError2(hr, label, pszMessage, hr2) \
00084     _JumpIfError((hr), label, (pszMessage))
00085
00086 #define _JumpIfError(hr, label, pszMessage) \
00087     { \
00088   if (S_OK != (hr)) \
00089   { \
00090       ceERRORPRINTLINE((pszMessage), (hr)); \
00091       goto label; \
00092   } \
00093     }
00094
00095
00096 #define ceERRORPRINTLINE(pszMessage, hr) \
00097       ceErrorPrintLine(__FILE__, __LINE__, (pszMessage), (hr))
00098
00099 #define DBGPRINT(a) ceDbgPrintf a
00100
00101 int WINAPIV ceDbgPrintf(BOOL fDebug, char const *pszfmt, ...);
00102
00103
00104 VOID
00105 ceErrorPrintLine(
00106     IN char const *pszFile,
00107     IN DWORD line,
00108     IN char const *pszMessage,
00109     IN HRESULT hr);
00110
00111 HRESULT
00112 ceHLastError(VOID);
00113
00114 HRESULT
00115 ceHError(
00116     IN HRESULT hr);
00117
00118
00119 // Constants chosen to avoid DWORD overflow:
00120
00121 #define CVT_WEEKS (7 * CVT_DAYS)
00122 #define CVT_DAYS  (24 * CVT_HOURS)
00123 #define CVT_HOURS (60 * CVT_MINUTES)
00124 #define CVT_MINUTES (60 * CVT_SECONDS)
00125 #define CVT_SECONDS (1)
00126 #define CVT_BASE  (1000 * 1000 * 10)
00127
00128
00129 enum ENUM_PERIOD
00130 {
00131     ENUM_PERIOD_INVALID = -1,
00132     ENUM_PERIOD_SECONDS = 0,
00133     ENUM_PERIOD_MINUTES,
00134     ENUM_PERIOD_HOURS,
00135     ENUM_PERIOD_DAYS,
00136     ENUM_PERIOD_WEEKS,
00137     ENUM_PERIOD_MONTHS,
00138     ENUM_PERIOD_YEARS
00139 };
00140
00141 HRESULT
00142 ceMakeExprDate(
00143     IN OUT DATE *pDate,
00144     IN LONG lDelta,
00145     IN enum ENUM_PERIOD enumPeriod);
00146
00147 HRESULT
00148 ceTranslatePeriodUnits(
00149     IN WCHAR const *pwszPeriod,
00150     IN LONG lCount,
00151     OUT enum ENUM_PERIOD *penumPeriod,
00152     OUT LONG *plCount);
00153
00154 WCHAR const *
00155 ceGetOIDNameA(
00156     IN char const *pszObjId);
00157
00158 WCHAR const *
00159 ceGetOIDName(
00160     IN WCHAR const *pwszObjId);
00161
00162 BOOL
00163 ceDecodeObject(
00164     IN DWORD dwEncodingType,
00165     IN LPCSTR lpszStructType,
00166     IN BYTE const *pbEncoded,
00167     IN DWORD cbEncoded,
00168     IN BOOL fCoTaskMemAlloc,
00169     OUT VOID **ppvStructInfo,
00170     OUT DWORD *pcbStructInfo);
00171
00172 BOOL
00173 ceEncodeObject(
00174     DWORD dwEncodingType,
00175     IN LPCSTR lpszStructType,
00176     IN VOID const *pvStructInfo,
00177     IN DWORD dwFlags,
00178     IN BOOL fCoTaskMemAlloc,
00179     OUT BYTE **ppbEncoded,
00180     OUT DWORD *pcbEncoded);
00181
00182 WCHAR *
00183 ceDuplicateString(
00184     IN WCHAR const *pwsz);
00185
00186 BOOL
00187 ceConvertWszToSz(
00188     OUT char **ppsz,
00189     IN WCHAR const *pwc,
00190     IN LONG cb);
00191
00192 BOOL
00193 ceConvertWszToBstr(
00194     OUT BSTR *pbstr,
00195     IN WCHAR const *pwc,
00196     IN LONG cb);
00197
00198 BOOL
00199 ceConvertSzToWsz(
00200     OUT WCHAR **ppwsz,
00201     IN char const *pch,
00202     IN LONG cch);
00203
00204 BOOL
00205 ceConvertSzToBstr(
00206     OUT BSTR *pbstr,
00207     IN CHAR const *pch,
00208     IN LONG cch);
00209
00210 VOID
00211 ceFreeBstr(
00212     IN OUT BSTR *pstr);
00213
00214 HRESULT
00215 ceDateToFileTime(
00216     IN DATE const *pDate,
00217     OUT FILETIME *pft);
00218
00219 HRESULT
00220 ceFileTimeToDate(
00221     IN FILETIME const *pft,
00222     OUT DATE *pDate);
00223
00224 HRESULT
00225 ceVerifyObjId(
00226     IN WCHAR const *pwszObjId);
00227
00228 HRESULT
00229 ceVerifyAltNameString(
00230     IN LONG NameChoice,
00231     IN WCHAR const *pwszName);
00232
00233 HRESULT
00234 ceDispatchSetErrorInfo(
00235     IN HRESULT hrError,
00236     IN WCHAR const *pwszDescription,
00237     OPTIONAL IN WCHAR const *pwszProgId,
00238     OPTIONAL IN IID const *piid);
00239
00240 VOID
00241 ceInitErrorMessageText(
00242     IN DWORD idsUnexpected,
00243     IN DWORD idsUnknownErrorCode);  // L"Error %ws %ws"
00244
00245 WCHAR *
00246 ceGetErrorMessageText(
00247     IN HRESULT hr,
00248     IN BOOL fHResultString);
00249
00250 WCHAR const *
00251 ceHResultToString(
00252     IN OUT WCHAR *awchr,
00253     IN HRESULT hr);
00254
00255
00256 #define cwcFILENAMESUFFIXMAX    20
00257 #define cwcSUFFIXMAX  (1 + 5 + 1) // five decimal digits plus parentheses
00258
00259 #define wszFCSAPARM_SERVERDNSNAME L"%1"
00260 #define wszFCSAPARM_SERVERSHORTNAME L"%2"
00261 #define wszFCSAPARM_SANITIZEDCANAME L"%3"
00262 #define wszFCSAPARM_CERTFILENAMESUFFIX  L"%4"
00263 #define wszFCSAPARM_DOMAINDN    L"%5"
00264 #define wszFCSAPARM_CONFIGDN    L"%6"
00265 #define wszFCSAPARM_SANITIZEDCANAMEHASH L"%7"
00266 #define wszFCSAPARM_CRLFILENAMESUFFIX L"%8"
00267 #define wszFCSAPARM_CRLDELTAFILENAMESUFFIX L"%9"
00268 #define wszFCSAPARM_DSCRLATTRIBUTE  L"%10"
00269 #define wszFCSAPARM_DSCACERTATTRIBUTE L"%11"
00270
00271
00272 HRESULT
00273 ceFormatCertsrvStringArray(
00274     IN BOOL fURL,
00275     IN LPCWSTR pwszServerName_p1_2,
00276     IN LPCWSTR pwszSanitizedName_p3_7,
00277     IN DWORD   iCert_p4,
00278     IN LPCWSTR pwszDomainDN_p5,
00279     IN LPCWSTR pwszConfigDN_p6,
00280     IN DWORD   iCRL_p8,
00281     IN BOOL    fDeltaCRL_p9,
00282     IN BOOL    fDSAttrib_p10_11,
00283     IN DWORD   cStrings,
00284     IN LPCWSTR *apwszStringsIn,
00285     OUT LPWSTR *apwszStringsOut);
00286
00287 HRESULT
00288 ceInternetCanonicalizeUrl(
00289     IN WCHAR const *pwszIn,
00290     OUT WCHAR **ppwszOut);
00291
00292 int
00293 ceWtoI(
00294     IN WCHAR const *pwszDigitString,
00295     OUT BOOL *pfValid);
00296
00297 #endif // __CELIB_H__
Generated on Wed Nov 13 2024 16:52:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/DCom/TimeOuts/Server/MonitorServer.Cpp Source File

  • Com
  • Fundamentals
  • DCom
  • TimeOuts
  • Server

MonitorServer.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: MonitorServer.cpp
00004
00005 Summary:  Implements CMonitorServer methods.
00006
00007
00008 ----------------------------------------------------------------------------
00009
00010 This file is part of the Microsoft COM+ Samples.
00011
00012 Copyright (C) 1995 - 2000 Microsoft Corporation. All rights reserved.
00013
00014 This source code is intended only as a supplement to Microsoft
00015 Development Tools and/or on-line documentation. See these other
00016 materials for detailed information regarding Microsoft code samples.
00017
00018 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00019 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00021 PARTICULAR PURPOSE.
00022
00023 ==========================================================================+*/
00024 // MonitorServer.cpp : Implementation of CServerApp and DLL registration.
00025
00026 #include "stdafx.h"
00027 #include "server.h"
00028 #include "MonitorServer.h"
00029
00030 #include "PingResp_i.c"
00031 /////////////////////////////////////////////////////////////////////////////
00032 //
00033
00034 // Normal Distribution Median=2000, max = 4000, 10 buckets
00035 int arDelay[10] = {0,1,5,91,635,2000,3365,3909,3995,4000};
00036
00037
00038 HRESULT STDMETHODCALLTYPE CMonitorServer::GetData(LONG *pData){
00039   // Delay Call completion by randomizing response time
00040   int index = rand()*10/RAND_MAX;  // Range 0-9
00041   int iSleep = arDelay[index];
00042   *pData = iSleep;
00043   if (iSleep) Sleep(iSleep);
00044   return S_OK;
00045 }
00046
00047
00048 HRESULT STDMETHODCALLTYPE CMonitorServer::GetPingResponder(IPingResponder **ppPing){
00049   return CoCreateInstance(CLSID_PingResponder,NULL,CLSCTX_INPROC_SERVER,IID_IPingResponder, (LPVOID*) ppPing);
00050 }
Generated on Wed Nov 13 2024 16:51:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Toolbar/delebase.h Source File

  • SysMgmt
  • MMC
  • Toolbar

delebase.h

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020 #ifndef _BRANCHES_H
00021 #define _BRANCHES_H
00022
00023 #include <mmc.h>
00024 #include <crtdbg.h>
00025 #include "globals.h"
00026 #include "resource.h"
00027 #include "LocalRes.h"
00028
00029 class CComponent;
00030 class CComponentData;
00031
00032 class CDelegationBase {
00033 public:
00034     CDelegationBase();
00035     virtual ~CDelegationBase();
00036
00037     virtual const _TCHAR *GetDisplayName(int nCol = 0) = 0;
00038     virtual const GUID & getNodeType() { _ASSERT(FALSE); return IID_NULL; }
00039
00040     virtual const LPARAM GetCookie() { return reinterpret_cast<LPARAM>(this); }
00041     virtual const int GetBitmapIndex() = 0;
00042
00043     virtual HRESULT GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions) { return S_FALSE; }
00044
00045 public:
00046     // virtual functions go here (for MMCN_*)
00047     virtual HRESULT OnAddImages(IImageList *pImageList, HSCOPEITEM hsi);
00048     virtual HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent) { return S_FALSE; }
00049     virtual HRESULT OnSelect(CComponent *pComponent, BOOL bScope, BOOL bSelect) { return S_FALSE; }
00050     virtual HRESULT OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem) { return S_FALSE; }
00051     virtual HRESULT OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile);
00052     virtual HRESULT OnToolbarCommand(CComponent *pComponent, IConsole *pConsole, MMC_CONSOLE_VERB verb) { return S_FALSE; }
00053     virtual HRESULT OnSetToolbar(CComponent *pComponent, IControlbar *pControlbar, IToolbar *pToolbar, BOOL bScope, BOOL bSelect) { return S_FALSE; }
00054     virtual HRESULT OnButtonClicked(CComponent *pComponent) { return S_FALSE;}
00055
00056 public:
00057     void SetComponentData(CComponentData *pComponentData) { m_pComponentData = pComponentData; }
00058
00059 public:
00060     static HBITMAP m_pBMapSm;
00061     static HBITMAP m_pBMapLg;
00062
00063 protected:
00064     static void LoadBitmaps() {
00065         m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
00066         m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
00067     }
00068
00069     BOOL bExpanded;
00070
00071 private:
00072     // {2974380B-4C4B-11d2-89D8-000021473128}
00073     static const GUID thisGuid;
00074
00075 public:
00076     CComponentData *m_pComponentData;
00077 };
00078
00079 #endif // _BRANCHES_H
Generated on Wed Nov 13 2024 16:52:34 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/MSAgent/c/Cap/MainDlg.Cpp Source File

  • Web
  • MSAgent
  • c
  • Cap

MainDlg.Cpp

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 1998 by Microsoft Corporation
00003
00004   THE INFORMATION AND CODE PROVIDED HEREUNDER (COLLECTIVELY REFERRED TO
00005   AS "SOFTWARE") IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
00006   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
00007   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
00008   NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
00009   ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
00010   CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
00011   MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
00012   POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR
00013   LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE
00014   FOREGOING LIMITATION MAY NOT APPLY.
00015
00016   This software may be copied and distributed royalty-free subject to
00017   the following conditions:
00018
00019   1. You must copy all software without modification and must include
00020      all pages, if the software is distributed without inclusion in your
00021      software product. If you are incorporating the software in
00022      conjunction with and as a part of your software product which adds
00023      substantial value, you may modify and include portions of the
00024      software.
00025
00026   2. You must place all copyright notices and other protective
00027      disclaimers and notices contained on the software on all copies of
00028      the software and your software product.
00029
00030   3. Unless the software is incorporated in your software product which
00031      adds substantial value, you may not distribute this software for
00032      profit.
00033
00034   4. You may not use Microsoft's name, logo, or trademarks to market
00035      your software product.
00036
00037   5. You agree to indemnify, hold harmless, and defend Microsoft and its
00038      suppliers from and against any claims or lawsuits, including
00039      attorneys' fees, that arise or result from the use or distribution
00040      of your software product and any modifications to the software.
00041 */
00042
00043
00044 #include "stdafx.h"
00045 #include "MainDlg.h"
00046 #include "About.h"
00047 #include "Error.h"
00048 #include "StrConv.h"
00049 #include "resource.h"
00050 #include "Notify.h"
00051
00052
00053 // Registry
00054
00055 #define MAX_RECENT_FILES    4
00056 #define MAX_RECENT_FILENAME   32
00057 #define ID_RECENT_FILE_0    900
00058
00059 extern  LPCTSTR kpszRegRoot = _T("Software\\Microsoft\\Microsoft Agent\\Tools\\Character Previewer");
00060 static  LPCTSTR kpszRecentFilesSubkey = _T("Software\\Microsoft\\Microsoft Agent\\Tools\\Character Previewer\\Recent Files");
00061 static  LPCTSTR kpszRecentFilesItem = _T("File");
00062
00063 // Static strings
00064
00065 static  LPCTSTR kpszFileTypes = _T("Agent Character Storage (*.acs)\0*.acs\0Agent Character File (*.acf)\0*.acf\0\0");
00066 static  LPCTSTR kpszAgentCharacterTitle = _T("Microsoft Agent");
00067 static  LPCTSTR kpszAgentCharacterOptions = _T("Advanced Character Options");
00068 static  LPCTSTR kpszWindowClass = _T("CAP");
00069
00070 // Globals
00071
00072 extern HINSTANCE g_hInst;
00073 extern MainDlg  *g_pMainDlg;
00074 extern const LPTSTR kpszAppTitle;
00075
00076
00077 // Main Dialog Class
00078
00079 MainDlg::MainDlg() {
00080
00081   m_hWnd = NULL;
00082   m_hAccel = NULL;
00083   m_pAgent = NULL;
00084   m_pSink = NULL;
00085   m_pCharacter = NULL;
00086   m_pBalloon = NULL;
00087   m_lCharacterID = -1;
00088   m_lSinkID = -1;
00089   m_lCmdPropertiesID = -1;
00090   m_bHasMRUSeparator = FALSE;
00091   m_bAddedCommands = FALSE;
00092 }
00093
00094
00095 HRESULT MainDlg::Init() {
00096
00097   // We should only call this once
00098
00099   _ASSERT(m_pAgent == NULL);
00100
00101   WNDCLASS wndClass;
00102   HRESULT hRes;
00103
00104   // Initialize the Microsoft Agent server
00105
00106   hRes = CoCreateInstance(CLSID_AgentServer,
00107               NULL,
00108               CLSCTX_SERVER,
00109               IID_IAgentEx,
00110               (LPVOID *)&m_pAgent);
00111
00112   // Uh oh!!!
00113
00114   if (FAILED(hRes))
00115     return hRes;
00116
00117   // Create a notify sink object. NOTE: we want to
00118   // control it's lifetime so we AddRef it.
00119
00120   m_pSink = new AgentNotifySink(this);
00121
00122   if (m_pSink == NULL)
00123     return E_OUTOFMEMORY;
00124
00125   m_pSink->AddRef();
00126
00127   // And register it with Microsoft Agent
00128
00129   hRes = m_pAgent->Register(m_pSink, &m_lSinkID);
00130
00131   if (FAILED(hRes))
00132     return hRes;
00133
00134   // Create/register a window class
00135
00136   ZeroMemory(&wndClass, sizeof(WNDCLASS));
00137
00138   wndClass.lpfnWndProc = WndProc;
00139   wndClass.cbWndExtra = DLGWINDOWEXTRA;
00140   wndClass.hInstance = g_hInst;
00141   wndClass.hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_APP));
00142   wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
00143   wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
00144   wndClass.lpszClassName = kpszWindowClass;
00145
00146   RegisterClass(&wndClass);
00147
00148   // Create the Main dialog window. NOTE: specifying a NULL
00149   // DlgProc tells the system to use the DlgProc specified
00150   // by the class assigned to the dialog in the dialog's
00151   // resource.
00152
00153   m_hWnd = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_CAP), NULL, NULL);
00154
00155   if (m_hWnd == NULL)
00156     return HRESULT_FROM_WIN32(GetLastError());
00157
00158   // Stuff the C++ class into window long data
00159
00160   SetWindowLongPtr(m_hWnd, GWLP_USERDATA, (LONG_PTR)this);
00161
00162   // Initialize the dialog
00163
00164   OnInitDialog();
00165
00166   return NOERROR;
00167 }
00168
00169
00170 BOOL MainDlg::OnInitDialog() {
00171
00172   // Subclass controls (as necessary). This allows us
00173   // to control the default button state.
00174
00175   m_wpListBox = (WNDPROC)SetWindowLongPtr(GetDlgItem(m_hWnd, IDC_ANIMATIONS),
00176                      GWLP_WNDPROC,
00177                      (LONG_PTR)ListBoxWndProc);
00178
00179   m_wpSpeakText = (WNDPROC)SetWindowLongPtr(GetDlgItem(m_hWnd, IDC_SPEAKTEXT),
00180                        GWLP_WNDPROC,
00181                        (LONG_PTR)SpeakTextWndProc);
00182
00183   m_wpMoveX = (WNDPROC)SetWindowLongPtr(GetDlgItem(m_hWnd, IDC_MOVE_X),
00184                      GWLP_WNDPROC,
00185                      (LONG_PTR)MoveXWndProc);
00186
00187   m_wpMoveY = (WNDPROC)SetWindowLongPtr(GetDlgItem(m_hWnd, IDC_MOVE_Y),
00188                      GWLP_WNDPROC,
00189                      (LONG_PTR)MoveYWndProc);
00190
00191   // Load the accelerator table
00192
00193   m_hAccel = LoadAccelerators(g_hInst, MAKEINTRESOURCE(IDR_ACCELERATORS));
00194
00195   // Initialize the MRU menu
00196
00197   UpdateRecentFiles(NULL);
00198
00199   // Set the focus to the empty list box
00200
00201   SetFocus(GetDlgItem(m_hWnd, IDC_ANIMATIONS));
00202
00203   return TRUE;
00204 }
00205
00206
00207 void MainDlg::OnDestroy() {
00208
00209   // Release the balloon interface
00210
00211   if (m_pBalloon) {
00212     m_pBalloon->Release();
00213     m_pBalloon = NULL;
00214   }
00215
00216   // Unload/Release the character
00217
00218   if (m_pCharacter) {
00219
00220     _ASSERT(m_pAgent);
00221     _ASSERT(m_lCharacterID != -1);
00222
00223     m_pAgent->Unload(m_lCharacterID);
00224     m_pCharacter->Release();
00225     m_pCharacter = NULL;
00226   }
00227
00228   // Release our Agent interface
00229
00230   if (m_pAgent) {
00231
00232     if (m_pSink) {
00233
00234       _ASSERT(m_lSinkID != -1);
00235
00236       m_pAgent->Unregister(m_lSinkID);
00237       m_pSink->Release();
00238       m_pSink = NULL;
00239     }
00240
00241     m_pAgent->Release();
00242     m_pAgent = NULL;
00243   }
00244 }
00245
00246
00247 BOOL MainDlg::OnInitMenuPopup(HMENU hMenu, UINT uPos, BOOL bSysMenu) {
00248
00249   // We're not going to allow the dialog to be sized or
00250   // maximized, so disable those menu items on the context
00251   // menu.
00252
00253   if (bSysMenu) {
00254     EnableMenuItem(hMenu, SC_MAXIMIZE, MF_GRAYED);
00255     EnableMenuItem(hMenu, SC_MINIMIZE, IsIconic(m_hWnd) ? MF_GRAYED : MF_ENABLED);
00256     EnableMenuItem(hMenu, SC_RESTORE, IsIconic(m_hWnd) ? MF_ENABLED : MF_GRAYED);
00257     EnableMenuItem(hMenu, SC_SIZE, MF_GRAYED);
00258     return TRUE;
00259   }
00260   else
00261     return FALSE;
00262 }
00263
00264
00265 void MainDlg::LoadCharacter(LPCTSTR pszFilename) {
00266
00267   _ASSERT(m_pAgent);
00268
00269   HRESULT       hRes;
00270   OPENFILENAME    ofn;
00271   _TCHAR        szFilename[_MAX_PATH];
00272   _TCHAR        szTemp[256];
00273   _TCHAR         *pchFilename;
00274   VARIANT       vFilename;
00275   VARIANT       vAnimName;
00276   DWORD       dwRetrieved;
00277   BOOL        bHasAnims;
00278   BOOL        bUseSfx;
00279   UINT        uBalloonStyle;
00280   BSTR        bszName;
00281   long        lReqID;
00282   long        lCharID;
00283   long        lVisibilityCause;
00284   IAgentCharacterEx  *pCharacter;
00285   IUnknown       *punkAnimNames;
00286   IEnumVARIANT     *pevAnimNames;
00287
00288   USES_CONVERSION;
00289
00290   // If no filename was specified, bring up the common
00291   // open dialog to get one from the user.
00292
00293   if (pszFilename == NULL) {
00294
00295     ZeroMemory(&ofn, sizeof(OPENFILENAME));
00296     szFilename[0] = 0;
00297
00298     ofn.lStructSize = sizeof(OPENFILENAME);
00299     ofn.hwndOwner = m_hWnd;
00300     ofn.lpstrDefExt = _T(".acs");
00301     ofn.Flags = OFN_HIDEREADONLY;
00302     ofn.lpstrFilter = kpszFileTypes;
00303     ofn.lpstrFile = szFilename;
00304     ofn.nMaxFile = _MAX_PATH;
00305
00306     if (!GetOpenFileName(&ofn))
00307       return;
00308
00309     pszFilename = szFilename;
00310   }
00311
00312   SetCursor(LoadCursor(NULL, IDC_WAIT));
00313
00314   // Construct a VARIANT to hold the filename
00315
00316   VariantInit(&vFilename);
00317   vFilename.bstrVal = SysAllocString(T2W(pszFilename));
00318   vFilename.vt = VT_BSTR;
00319
00320   // Load the new character. NOTE: we don't release the
00321   // existing character until we're sure we've successfully
00322   // loaded the new one.
00323
00324   hRes = m_pAgent->Load(vFilename, &lCharID, &lReqID);
00325
00326   // Clean up the VARIANT
00327
00328   VariantClear(&vFilename);
00329
00330   // Did we successfully load the character? NOTE: if it's the
00331   // same character as we already have loaded we'll get the
00332   // error code AGENTERR_CHARACTERALREADYLOADED.
00333
00334   if (SUCCEEDED(hRes)) {
00335
00336     // Get the IAgentCharacterEx interface
00337
00338     hRes = m_pAgent->GetCharacterEx(lCharID, &pCharacter);
00339   }
00340
00341   if (FAILED(hRes)) {
00342     SetCursor(LoadCursor(NULL, IDC_ARROW));
00343     return;
00344   }
00345
00346   // Release the previous balloon interface
00347
00348   if (m_pBalloon) {
00349     m_pBalloon->Release();
00350     m_pBalloon = NULL;
00351   }
00352
00353   // Unload the previous character if we have one
00354
00355   if (m_pCharacter) {
00356     m_pAgent->Unload(m_lCharacterID);
00357     m_pCharacter->Release();
00358   }
00359
00360   // We'll need to reload our commands. We do this only
00361   // on a right click for better character load performance.
00362
00363   m_bAddedCommands = FALSE;
00364
00365   // Assign our member variables
00366
00367   m_lCharacterID = lCharID;
00368   m_pCharacter = pCharacter;
00369
00370   // Query for the balloon interface
00371
00372   m_pCharacter->QueryInterface(IID_IAgentBalloonEx, (LPVOID *)&m_pBalloon);
00373
00374   // Reset the contents of the animation list box
00375
00376   SendDlgItemMessage(m_hWnd, IDC_ANIMATIONS, LB_RESETCONTENT, 0, 0);
00377
00378   // Add it to the MRU menu
00379
00380   UpdateRecentFiles(pszFilename);
00381
00382   // Turn off the Auto-Popup menu. Then we'll add our commands
00383   // the first time the user right clicks the character.
00384
00385   m_pCharacter->SetAutoPopupMenu(FALSE);
00386
00387   // Get the last visibility cause of the character. If
00388   // it's never been shown we'll position it. Otherwise,
00389   // we'll leave it alone and assume it's where the user
00390   // or another app wants it.
00391
00392   if (SUCCEEDED(m_pCharacter->GetVisibilityCause(&lVisibilityCause))) {
00393
00394     if (lVisibilityCause == NeverShown) {
00395
00396       RECT rcWindow;
00397       long lWidth;
00398       long lHeight;
00399
00400       // Get the window rect
00401
00402       GetWindowRect(m_hWnd, &rcWindow);
00403
00404       // And the size of the character
00405
00406       if (SUCCEEDED(m_pCharacter->GetSize(&lWidth, &lHeight))) {
00407
00408         // Make sure we'll fit to the right (NOTE: a production
00409         // quality app would handle multi-monitor!!!)
00410
00411         if ((rcWindow.right + lWidth) > GetSystemMetrics(SM_CXSCREEN))
00412           rcWindow.right = rcWindow.left - lWidth;
00413       }
00414
00415       // Move it (non-animated)
00416
00417       m_pCharacter->MoveTo((short)rcWindow.right, (short)rcWindow.top, 0, &lReqID);
00418     }
00419   }
00420
00421   // Show the character
00422
00423   m_pCharacter->Show(FALSE, &lReqID);
00424
00425   // Get the IUnknown for the animation name enumerator
00426
00427   if (SUCCEEDED(m_pCharacter->GetAnimationNames(&punkAnimNames))) {
00428
00429     // Then query for IEnumVARIANT
00430
00431     if (SUCCEEDED(punkAnimNames->QueryInterface(IID_IEnumVARIANT, (LPVOID *)&pevAnimNames))) {
00432
00433       while (TRUE) {
00434
00435         // Get the next animation name
00436
00437         hRes = pevAnimNames->Next(1, &vAnimName, &dwRetrieved);
00438
00439         // Was there one?
00440
00441         if (hRes != NOERROR)
00442           break;
00443
00444         // Hmmmm
00445
00446         _ASSERT(dwRetrieved > 0);
00447         _ASSERT(vAnimName.vt == VT_BSTR);
00448         _ASSERT(vAnimName.bstrVal != NULL);
00449
00450         // Add it to the list box
00451
00452         SendDlgItemMessage(m_hWnd, IDC_ANIMATIONS, LB_ADDSTRING, 0, (LPARAM)W2T(vAnimName.bstrVal));
00453
00454         // And clean up
00455
00456         VariantClear(&vAnimName);
00457       }
00458
00459       pevAnimNames->Release();
00460     }
00461
00462     punkAnimNames->Release();
00463   }
00464
00465   // Do we have any animations?
00466
00467   bHasAnims = (SendDlgItemMessage(m_hWnd, IDC_ANIMATIONS, LB_GETCOUNT, 0, 0) > 0);
00468
00469   if (bHasAnims)
00470     SendDlgItemMessage(m_hWnd, IDC_ANIMATIONS, LB_SETCURSEL, 0, 0);
00471
00472   // Enable/Disable controls
00473
00474   EnableWindow(GetDlgItem(m_hWnd, IDC_PLAY), bHasAnims);
00475   EnableWindow(GetDlgItem(m_hWnd, IDC_STOP), bHasAnims);
00476   EnableWindow(GetDlgItem(m_hWnd, IDC_SFX), bHasAnims);
00477   EnableWindow(GetDlgItem(m_hWnd, IDC_STOPBEFOREPLAY), bHasAnims);
00478   EnableWindow(GetDlgItem(m_hWnd, IDC_SPEAK), bHasAnims && (GetWindowTextLength(GetDlgItem(m_hWnd, IDC_SPEAKTEXT)) > 0));
00479   EnableWindow(GetDlgItem(m_hWnd, IDC_SPEAKTEXT), bHasAnims);
00480
00481   EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_USE), bHasAnims);
00482
00483   EnableWindow(GetDlgItem(m_hWnd, IDC_MOVE_X), bHasAnims);
00484   EnableWindow(GetDlgItem(m_hWnd, IDC_MOVE_Y), bHasAnims);
00485   EnableWindow(GetDlgItem(m_hWnd, IDC_MOVE), bHasAnims);
00486
00487   EnableWindow(GetDlgItem(m_hWnd, IDC_ANIMATIONS_LABEL), bHasAnims);
00488   EnableWindow(GetDlgItem(m_hWnd, IDC_SPEECHOUTPUT_LABEL), bHasAnims);
00489   EnableWindow(GetDlgItem(m_hWnd, IDC_POSITION_LABEL), bHasAnims);
00490   EnableWindow(GetDlgItem(m_hWnd, IDC_X_LABEL), bHasAnims);
00491   EnableWindow(GetDlgItem(m_hWnd, IDC_Y_LABEL), bHasAnims);
00492
00493   // Sound Effects
00494
00495   if (SUCCEEDED(m_pCharacter->GetSoundEffectsOn((long *)&bUseSfx)))
00496     CheckDlgButton(m_hWnd, IDC_SFX, bUseSfx);
00497   else
00498     CheckDlgButton(m_hWnd, IDC_SFX, FALSE);
00499
00500   // Update the balloon buttons
00501
00502   uBalloonStyle = 0;
00503
00504   if (m_pBalloon && bHasAnims) {
00505
00506     if (SUCCEEDED(m_pBalloon->GetStyle((long *)&uBalloonStyle))) {
00507
00508       CheckDlgButton(m_hWnd, IDC_BALLOON_USE, uBalloonStyle & BALLOON_STYLE_BALLOON_ON);
00509       CheckDlgButton(m_hWnd, IDC_BALLOON_SIZETOTEXT, uBalloonStyle & BALLOON_STYLE_SIZETOTEXT);
00510       CheckDlgButton(m_hWnd, IDC_BALLOON_AUTOPACE, uBalloonStyle & BALLOON_STYLE_AUTOPACE);
00511       CheckDlgButton(m_hWnd, IDC_BALLOON_AUTOHIDE, uBalloonStyle & BALLOON_STYLE_AUTOHIDE);
00512     }
00513   }
00514
00515   EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_SIZETOTEXT), bHasAnims && (uBalloonStyle & BALLOON_STYLE_BALLOON_ON));
00516   EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_AUTOPACE), bHasAnims && (uBalloonStyle & BALLOON_STYLE_BALLOON_ON));
00517   EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_AUTOHIDE), bHasAnims && (uBalloonStyle & BALLOON_STYLE_BALLOON_ON));
00518
00519   // Call our OnPropertyChange function. This will sync
00520   // our dialog with Agent properties.
00521
00522   OnPropertyChange();
00523
00524   // Force a WM_SETFOCUS to the animation list box. The
00525   // subclassed listbox correctly sets the play button's
00526   // highlight state.
00527
00528   SetFocus(NULL);
00529   SetFocus(GetDlgItem(m_hWnd, IDC_ANIMATIONS));
00530
00531   // Set the text of the title bar
00532
00533   pchFilename = _tcsrchr(pszFilename, '\\');
00534
00535   if (pchFilename)
00536     pchFilename = _tcsinc(pchFilename);
00537   else
00538     pchFilename = (LPTSTR)pszFilename;
00539
00540     ZeroMemory(szTemp, sizeof(szTemp));
00541     _tcsncpy(szTemp, pchFilename, (sizeof(szTemp) / sizeof(szTemp[0])) - (_tcslen(kpszAppTitle) + 4));
00542     _tcscat(szTemp, _T(" - "));
00543     _tcscat(szTemp, kpszAppTitle);
00544
00545   SetWindowText(m_hWnd, szTemp);
00546
00547   // Update the "Animations" group box text with the character's
00548   // name.
00549
00550   if (SUCCEEDED(m_pCharacter->GetName(&bszName))) {
00551
00552     _TCHAR szTemplate[64];
00553     _TCHAR szLabel[256];
00554
00555     LoadString(GetModuleHandle(NULL), IDS_ANIMATIONS_LABEL, szTemplate, 64);
00556
00557     _ASSERT(_tcslen(W2T(bszName)) < 192);
00558
00559     wsprintf(szLabel, szTemplate, W2T(bszName));
00560
00561     SetWindowText(GetDlgItem(m_hWnd, IDC_ANIMATIONS_LABEL), szLabel);
00562
00563     SysFreeString(bszName);
00564   }
00565
00566   SetCursor(LoadCursor(NULL, IDC_ARROW));
00567 }
00568
00569
00570 void MainDlg::MakeEllipsisPath(LPCTSTR pszPath, LPTSTR pszEllipsisPath, UINT cchMaxEllipsisPath) {
00571
00572   // This function takes a full path and truncates to a fixed
00573   // specified size using ellipses as necessary. It's main goal
00574   // is to keep the first directory in the path and the filename
00575   // intact and use ellipsis in the middle.
00576   //
00577   // NOTE: cchMaxEllipsisPath is NOT the size of the pszEllipsisPath
00578   // buffer (in characters). It is simply the maximum number of
00579   // characters to allow in the path so we'd better have room for at
00580   // least that many.
00581
00582   _ASSERT(!IsBadWritePtr(pszEllipsisPath, (cchMaxEllipsisPath+1) * sizeof(_TCHAR)));
00583   _ASSERT(cchMaxEllipsisPath <= _MAX_PATH);
00584
00585   _TCHAR  szPathCopy[_MAX_PATH];
00586   _TCHAR *pchEndDir;
00587   LPCTSTR pchFilename;
00588   UINT  uPathPartLen;
00589   UINT  uFilenameLen;
00590
00591   // If the specified path fits, then just copy it and return
00592
00593   if ((UINT)lstrlen(pszPath) < cchMaxEllipsisPath) {
00594     lstrcpy(pszEllipsisPath, pszPath);
00595     return;
00596   }
00597
00598   // See if the filename alone is too big
00599
00600   pchFilename = _tcsrchr(pszPath, '\\');
00601
00602   if (pchFilename != NULL)
00603     pchFilename = _tcsinc(pchFilename);
00604   else
00605     pchFilename = pszPath;
00606
00607   _ASSERT(pchFilename);
00608
00609   uFilenameLen = lstrlen(pchFilename);
00610
00611   if (uFilenameLen >= cchMaxEllipsisPath) {
00612     lstrcpyn(pszEllipsisPath, pchFilename, cchMaxEllipsisPath-2);
00613     lstrcat(pszEllipsisPath, _T("..."));
00614     return;
00615   }
00616
00617   // Save a local copy of the specified path
00618
00619   lstrcpy(szPathCopy, pszPath);
00620
00621   pchEndDir = szPathCopy;
00622
00623   // See if it's a UNC name
00624
00625   if (_tcsncmp(pchEndDir, _T("\\\\"), 2) == 0) {
00626     pchEndDir = _tcsinc(pchEndDir);
00627     pchEndDir = _tcsinc(pchEndDir);
00628     pchEndDir = _tcschr(pchEndDir, '\\');
00629   }
00630   else {
00631     pchEndDir = _tcschr(pchEndDir, '\\');
00632     if (pchEndDir) {
00633       pchEndDir = _tcsinc(pchEndDir);
00634       pchEndDir = _tcschr(pchEndDir, '\\');
00635     }
00636   }
00637
00638   if (pchEndDir != NULL)
00639     pchEndDir = _tcsinc(pchEndDir);
00640
00641   // If we couldn't find the first directory component, give up
00642   // and just return the filename only.
00643
00644   if (pchEndDir == NULL) {
00645     lstrcpy(pszEllipsisPath, pchFilename);
00646     return;
00647   }
00648
00649   *pchEndDir = 0;
00650
00651   uPathPartLen = min((UINT)lstrlen(szPathCopy), cchMaxEllipsisPath - uFilenameLen - 4);
00652
00653   lstrcpyn(pszEllipsisPath, szPathCopy, uPathPartLen+1);
00654   lstrcat(pszEllipsisPath, _T("...\\"));
00655   lstrcat(pszEllipsisPath, pchFilename);
00656 }
00657
00658
00659 void MainDlg::UpdateRecentFiles(LPCTSTR pszFilename) {
00660
00661   // This function updates our recent file list if a filename
00662   // is specified or initializes the file menu with existing
00663   // filenames from the registry.
00664
00665   LONG  lRes;
00666   HKEY  hKeyMRU;
00667   HMENU hMenuFile;
00668   DWORD dwSize;
00669   DWORD dwDisposition;
00670   DWORD dwRetType;
00671   int   iNumExisting = 0;
00672   int   iFind = -1;
00673   int   iCount;
00674   int   iFileExitPos;
00675   _TCHAR  szValueName[256];
00676   _TCHAR  rgszExisting[MAX_RECENT_FILES][_MAX_PATH];
00677   _TCHAR  szEllipsisText[_MAX_PATH];
00678   _TCHAR  szMenuItemText[_MAX_PATH];
00679
00680   // Open/Create the registry key
00681
00682   lRes = RegCreateKeyEx(HKEY_CURRENT_USER,
00683               kpszRecentFilesSubkey,
00684                 0,
00685                 _T(""),
00686                 REG_OPTION_NON_VOLATILE,
00687                 KEY_ALL_ACCESS,
00688                 NULL,
00689                 &hKeyMRU,
00690                 &dwDisposition);
00691
00692   if (lRes != ERROR_SUCCESS)
00693     return;
00694
00695   // Get all of the current entries
00696
00697   for (int i=0; i < MAX_RECENT_FILES; i++) {
00698
00699     // Format the value string
00700
00701     wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, i+1);
00702
00703     // Get the next value
00704
00705     dwSize = _MAX_PATH;
00706
00707     lRes = RegQueryValueEx(hKeyMRU,
00708                  szValueName,
00709                  NULL,
00710                  &dwRetType,
00711                  (LPBYTE)rgszExisting[iNumExisting],
00712                  &dwSize);
00713
00714     // Was it there?
00715
00716     if (lRes == ERROR_SUCCESS) {
00717
00718       // If a filename was specified, see if it matches this one
00719
00720       if (pszFilename) {
00721
00722         if (lstrcmpi(pszFilename, rgszExisting[iNumExisting]) == 0) {
00723
00724           // If the specified file is the first file we find,
00725           // then we're done.
00726
00727           if (iNumExisting == 0) {
00728             RegCloseKey(hKeyMRU);
00729             return;
00730           }
00731
00732           iFind = iNumExisting;
00733         }
00734       }
00735
00736       ++iNumExisting;
00737     }
00738   }
00739
00740   // If no filename was specified, and we don't have any
00741   // existing files, we're done.
00742
00743   if ((pszFilename == NULL) && (iNumExisting == 0))
00744     return;
00745
00746   // If a file was specified, we have to update the registry
00747
00748   if (pszFilename) {
00749
00750     // Write the new filename to the registry
00751
00752     wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, 1);
00753     dwSize = (_tcslen(pszFilename)+1) * sizeof(_TCHAR);
00754     RegSetValueEx(hKeyMRU, szValueName, 0, REG_SZ, (LPBYTE)pszFilename, dwSize);
00755
00756     // If we previously had the maximum number of files, and
00757     // the new one is not one of them, we disregard the last
00758     // one.
00759
00760     if ((iNumExisting == MAX_RECENT_FILES) && (iFind < 0))
00761       --iNumExisting;
00762
00763     // Now, write the remaining items
00764
00765     iCount = 1;
00766
00767     for (i=0; i < iNumExisting; i++) {
00768       if (i != iFind) {
00769         wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, ++iCount);
00770         dwSize = (_tcslen(rgszExisting[i])+1) * sizeof(_TCHAR);
00771         RegSetValueEx(hKeyMRU, szValueName, 0, REG_SZ, (LPBYTE)rgszExisting[i], dwSize);
00772       }
00773     }
00774   }
00775
00776   // Get the File submenu
00777
00778   hMenuFile = GetSubMenu(GetMenu(m_hWnd), 0);
00779
00780   // Delete any existing recent file entries
00781
00782   for (i=0; i < MAX_RECENT_FILES; i++)
00783     DeleteMenu(hMenuFile, ID_RECENT_FILE_0+i, MF_BYCOMMAND);
00784
00785   // Where's the Exit item?
00786
00787   iFileExitPos = GetMenuItemCount(hMenuFile) - 1;
00788
00789   // Create an ellipsis path from the specified filename and
00790   // insert it into the menu.
00791
00792   if (pszFilename) {
00793     MakeEllipsisPath(pszFilename, szEllipsisText, MAX_RECENT_FILENAME);
00794     wsprintf(szMenuItemText, _T("&%d %s"), 1, szEllipsisText);
00795     InsertMenu(hMenuFile, iFileExitPos-1, MF_BYPOSITION, ID_RECENT_FILE_0, szMenuItemText);
00796     iCount = 1;
00797   }
00798   else {
00799     iCount = 0;
00800   }
00801
00802   // Then do the same for the remaining items
00803
00804   for (i=0; i < iNumExisting; i++) {
00805     if (i != iFind) {
00806       MakeEllipsisPath(rgszExisting[i], szEllipsisText, MAX_RECENT_FILENAME);
00807       wsprintf(szMenuItemText, _T("&%d %s"), iCount+1, szEllipsisText);
00808       InsertMenu(hMenuFile, iFileExitPos-1+iCount, MF_BYPOSITION, ID_RECENT_FILE_0+iCount, szMenuItemText);
00809       ++iCount;
00810     }
00811   }
00812
00813   // Delete/Insert the separator as appropriate
00814
00815   if ((iNumExisting == 0) && (pszFilename == NULL)) {
00816     if (m_bHasMRUSeparator) {
00817       DeleteMenu(hMenuFile, iFileExitPos-2, MF_BYPOSITION);
00818       m_bHasMRUSeparator = FALSE;
00819     }
00820   }
00821   else {
00822     if (!m_bHasMRUSeparator) {
00823       InsertMenu(hMenuFile, ID_RECENT_FILE_0, MF_BYCOMMAND | MF_SEPARATOR, 0, NULL);
00824       m_bHasMRUSeparator = TRUE;
00825     }
00826   }
00827
00828   // We're done with the registry
00829
00830   RegCloseKey(hKeyMRU);
00831 }
00832
00833
00834 void MainDlg::OnRecentFile(UINT uFile) {
00835
00836   // Hmmm
00837
00838   _ASSERT((uFile >= 1) && (uFile <= MAX_RECENT_FILES));
00839
00840   LONG  lRes;
00841   DWORD dwRetType;
00842   DWORD dwSize;
00843   _TCHAR  szValueName[256];
00844   _TCHAR  szFile[_MAX_PATH];
00845   HKEY  hKeyMRU;
00846
00847   // Open the Recent Files subkey
00848
00849   lRes = RegOpenKeyEx(HKEY_CURRENT_USER,
00850             kpszRecentFilesSubkey,
00851             0,
00852             KEY_ALL_ACCESS,
00853             &hKeyMRU);
00854
00855   if (lRes != ERROR_SUCCESS) {
00856     SystemError(m_hWnd, (HRESULT)HRESULT_FROM_WIN32(lRes), TRUE);
00857     return;
00858   }
00859
00860   // Query the value for the specified item
00861
00862   wsprintf(szValueName, _T("%s%d"), kpszRecentFilesItem, uFile);
00863
00864   dwSize = _MAX_PATH;
00865
00866   lRes = RegQueryValueEx(hKeyMRU,
00867                szValueName,
00868                NULL,
00869                &dwRetType,
00870                (LPBYTE)szFile,
00871                &dwSize);
00872
00873   // If we found it, Load the character.
00874
00875   if ((lRes == ERROR_SUCCESS) && (dwRetType == REG_SZ))
00876     LoadCharacter(szFile);
00877
00878   RegCloseKey(hKeyMRU);
00879 }
00880
00881
00882 BOOL MainDlg::OnSysCommand(WPARAM wParam) {
00883
00884   UINT uCmdType;
00885   long lReqID;
00886
00887   uCmdType = wParam & 0xFFF0;
00888
00889   switch (uCmdType) {
00890     case SC_CLOSE:
00891       ShowWindow(m_hWnd, SW_HIDE);
00892       PostQuitMessage(0);
00893       return TRUE;
00894
00895     case SC_MINIMIZE:
00896       if (m_pCharacter)
00897         m_pCharacter->Hide(TRUE, &lReqID);
00898       return FALSE;
00899
00900     case SC_RESTORE:
00901       if (m_pCharacter)
00902         m_pCharacter->Show(TRUE, &lReqID);
00903       return FALSE;
00904   }
00905
00906   return FALSE;
00907 }
00908
00909
00910 void MainDlg::OnDropFiles(HDROP hDrop) {
00911
00912   _TCHAR szFilename[_MAX_PATH];
00913
00914   // Make sure only one file was dropped
00915
00916   if (DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0) > 1)
00917     return;
00918
00919   // Get the dropped filename
00920
00921   DragQueryFile(hDrop, 0, szFilename, _MAX_PATH);
00922
00923   // And load it
00924
00925   LoadCharacter(szFilename);
00926 }
00927
00928
00929 void MainDlg::OnSpeak() {
00930
00931   _ASSERT(m_pCharacter);
00932
00933   int       iLen;
00934   long      lReqID;
00935   LPTSTR      pszTemp;
00936   BSTR      bszTemp;
00937   UINT      uBalloonFlags;
00938
00939   USES_CONVERSION;
00940
00941   // Get the length of the text to speak
00942
00943   iLen = GetWindowTextLength(GetDlgItem(m_hWnd, IDC_SPEAKTEXT));
00944
00945   // We should never be in here if there's no text
00946
00947   _ASSERT(iLen > 0);
00948
00949   // Set the balloon style if we have the interface
00950
00951   if (m_pBalloon) {
00952
00953     uBalloonFlags = 0;
00954
00955     if (IsDlgButtonChecked(m_hWnd, IDC_BALLOON_USE))
00956       uBalloonFlags |= BALLOON_STYLE_BALLOON_ON;
00957
00958     if (IsDlgButtonChecked(m_hWnd, IDC_BALLOON_SIZETOTEXT))
00959       uBalloonFlags |= BALLOON_STYLE_SIZETOTEXT;
00960
00961     if (IsDlgButtonChecked(m_hWnd, IDC_BALLOON_AUTOPACE))
00962       uBalloonFlags |= BALLOON_STYLE_AUTOPACE;
00963
00964     if (IsDlgButtonChecked(m_hWnd, IDC_BALLOON_AUTOHIDE))
00965       uBalloonFlags |= BALLOON_STYLE_AUTOHIDE;
00966
00967     m_pBalloon->SetStyle((long)uBalloonFlags);
00968   }
00969
00970   // Allocate a buffer on the stack
00971
00972   pszTemp = (LPTSTR)_alloca((iLen + 1) * sizeof(_TCHAR));
00973
00974   // No need to check for NULL. It wouldn't do us any good
00975   // anyway since _alloca raises an exception if it fails.
00976   // Production quality code would wrap this in a __try/__except
00977   // block.
00978
00979   GetDlgItemText(m_hWnd, IDC_SPEAKTEXT, pszTemp, iLen + 1);
00980
00981   // Speak the text
00982
00983   bszTemp = SysAllocString(T2W(pszTemp));
00984
00985   if (bszTemp) {
00986
00987     // Stop the character if the button is checked
00988
00989     if (IsDlgButtonChecked(m_hWnd, IDC_STOPBEFOREPLAY))
00990       m_pCharacter->StopAll(STOP_TYPE_ALL);
00991
00992     m_pCharacter->Speak(bszTemp, NULL, &lReqID);
00993
00994     SysFreeString(bszTemp);
00995   }
00996 }
00997
00998
00999 void MainDlg::OnCharacterMove(long x, long y) {
01000
01001   // Update the position fields
01002
01003   SetDlgItemInt(m_hWnd, IDC_MOVE_X, x, TRUE);
01004   SetDlgItemInt(m_hWnd, IDC_MOVE_Y, y, TRUE);
01005 }
01006
01007
01008 void MainDlg::OnCharacterRightClick(long x, long y) {
01009
01010   _ASSERT(m_pCharacter);
01011
01012   _TCHAR      szCommand[256];
01013   BSTR      bszCommand;
01014   IAgentCommands *pCommands;
01015
01016   USES_CONVERSION;
01017
01018   // If we've already added them, the AutoPopup feature will
01019   // do everything for us.
01020
01021   if (m_bAddedCommands)
01022     return;
01023
01024   m_bAddedCommands = TRUE;
01025
01026   // Turn AutoPopup back on
01027
01028   m_pCharacter->SetAutoPopupMenu(TRUE);
01029
01030   // Query for the IAgentCommands interface
01031
01032   if (SUCCEEDED(m_pCharacter->QueryInterface(IID_IAgentCommands, (LPVOID *)&pCommands))) {
01033
01034     // Load our command strings and add them
01035
01036     LoadString(GetModuleHandle(NULL), IDS_COMMAND_PROPERTIES, szCommand, 256);
01037
01038     bszCommand = SysAllocString(T2W(szCommand));
01039
01040     if (bszCommand) {
01041
01042       pCommands->Add(bszCommand, NULL, TRUE, TRUE, &m_lCmdPropertiesID);
01043
01044       SysFreeString(bszCommand);
01045     }
01046
01047     // The AutoPopup menu feature was previously off. So we have
01048     // to show the popup menu ourself.
01049
01050     m_pCharacter->ShowPopupMenu((short)x, (short)y);
01051
01052     // We're done with the IAgentCommands interface
01053
01054     pCommands->Release();
01055   }
01056 }
01057
01058
01059 void MainDlg::OnCharacterCommand(long lID) {
01060
01061   _ASSERT(m_pAgent);
01062   _ASSERT(m_pCharacter);
01063
01064   if (lID == m_lCmdPropertiesID) {
01065
01066     IAgentPropertySheet *pPropSheet;
01067     RECT rc;
01068     long lReqID;
01069
01070     // Query for the IAgentPropertySheet interface
01071
01072     if (SUCCEEDED(m_pAgent->QueryInterface(IID_IAgentPropertySheet, (LPVOID *)&pPropSheet))) {
01073
01074       // Show the property sheet
01075
01076       pPropSheet->SetVisible(TRUE);
01077
01078       // Get it's rect
01079
01080       if (SUCCEEDED(pPropSheet->GetPosition(&rc.left, &rc.top)) &&
01081         SUCCEEDED(pPropSheet->GetSize(&rc.right, &rc.bottom))) {
01082
01083         rc.right += rc.left;
01084         rc.bottom += rc.top;
01085
01086         // Stop the character
01087
01088         m_pCharacter->StopAll(STOP_TYPE_ALL);
01089
01090         // And gesture at the property sheet
01091
01092         m_pCharacter->GestureAt((short)(rc.left + (rc.right - rc.left) / 2),
01093                     (short)(rc.top + (rc.bottom - rc.top) / 2),
01094                     &lReqID);
01095       }
01096
01097       pPropSheet->Release();
01098     }
01099   }
01100 }
01101
01102
01103 void MainDlg::OnPropertyChange() {
01104
01105   _ASSERT(m_pAgent);
01106   _ASSERT(m_pBalloon);
01107
01108   // The user has changed an Agent property via the
01109   // Advanced Characters Property Sheet. Update any
01110   // of our own fields to reflect the change.
01111
01112   IAgentAudioOutputPropertiesEx *pAudio;
01113   BOOL bTemp;
01114   BOOL bUseBalloon;
01115
01116   if (SUCCEEDED(m_pAgent->QueryInterface(IID_IAgentAudioOutputPropertiesEx, (LPVOID *)&pAudio))) {
01117
01118     if (SUCCEEDED(pAudio->GetUsingSoundEffects((long *)&bTemp)))
01119       EnableWindow(GetDlgItem(m_hWnd, IDC_SFX), bTemp);
01120
01121     pAudio->Release();
01122   }
01123
01124   if (SUCCEEDED(m_pBalloon->GetEnabled((long *)&bTemp))) {
01125
01126     EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_USE), bTemp);
01127
01128     bUseBalloon = IsWindowEnabled(GetDlgItem(m_hWnd, IDC_BALLOON_USE)) &&
01129             IsDlgButtonChecked(m_hWnd, IDC_BALLOON_USE);
01130
01131     EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_SIZETOTEXT), bUseBalloon);
01132     EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_AUTOPACE), bUseBalloon);
01133     EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_AUTOHIDE), bUseBalloon);
01134   }
01135 }
01136
01137
01138 BOOL MainDlg::OnCommand(WPARAM wParam, LPARAM lParam) {
01139
01140   WORD wID;
01141
01142   wID = LOWORD(wParam);
01143
01144   // First check for a recent file command
01145
01146   if ((wID >= ID_RECENT_FILE_0) && (wID < ID_RECENT_FILE_0+MAX_RECENT_FILES)) {
01147     OnRecentFile(wID - ID_RECENT_FILE_0 + 1);
01148     return TRUE;
01149   }
01150
01151   switch (wID) {
01152     case ID_FILE_OPENCHARACTER:
01153       LoadCharacter(NULL);
01154       return TRUE;
01155
01156     case ID_FILE_EXIT:
01157       ShowWindow(m_hWnd, SW_HIDE);
01158       PostQuitMessage(0);
01159       return TRUE;
01160
01161     case ID_HELP_ABOUT:
01162
01163       _ASSERT(m_pAgent);
01164
01165       short sMajor;
01166       short sMinor;
01167       AboutDlg about;
01168
01169       m_pAgent->GetVersion(&sMajor, &sMinor);
01170
01171       about.DoModal(m_hWnd, sMajor, sMinor);
01172
01173       return TRUE;
01174   }
01175
01176   return FALSE;
01177 }
01178
01179
01180 void MainDlg::OnButtonClick(UINT uID) {
01181
01182   // We'd better have a character
01183
01184   _ASSERT(m_pCharacter);
01185
01186   int   iCurSel;
01187   int   iLen;
01188   LPTSTR  pszTemp;
01189   BSTR  bszTemp;
01190   long  lReqID;
01191   BOOL  bCheck;
01192   BOOL  bConvert;
01193   int   iX;
01194   int   iY;
01195
01196   USES_CONVERSION;
01197
01198   switch (uID) {
01199     case IDC_PLAY:
01200
01201       // Get the current selection
01202
01203       iCurSel = (int)SendDlgItemMessage(m_hWnd, IDC_ANIMATIONS, LB_GETCURSEL, 0, 0);
01204
01205       if (iCurSel == LB_ERR)
01206         return;
01207
01208       // Get the length of the text
01209
01210       iLen = (int)SendDlgItemMessage(m_hWnd, IDC_ANIMATIONS, LB_GETTEXTLEN, (WPARAM)iCurSel, 0);
01211
01212       if (iLen == LB_ERR)
01213         return;
01214
01215       // Allocate a buffer on the stack
01216
01217       pszTemp = (LPTSTR)_alloca((iLen + 1) * sizeof(_TCHAR));
01218
01219       // No need to check for NULL. It wouldn't do us any good
01220       // anyway since _alloca raises an exception if it fails.
01221       // Production quality code would wrap this in a __try/__except
01222       // block.
01223
01224       SendDlgItemMessage(m_hWnd, IDC_ANIMATIONS, LB_GETTEXT, (WPARAM)iCurSel, (LPARAM)pszTemp);
01225
01226       // Stop the character if the button is checked
01227
01228       if (IsDlgButtonChecked(m_hWnd, IDC_STOPBEFOREPLAY))
01229         m_pCharacter->StopAll(STOP_TYPE_ALL);
01230
01231       // Play the animation
01232
01233       bszTemp = SysAllocString(T2W(pszTemp));
01234
01235       if (bszTemp) {
01236
01237         m_pCharacter->Play(bszTemp, &lReqID);
01238
01239         SysFreeString(bszTemp);
01240       }
01241
01242       SetFocus(GetDlgItem(m_hWnd, IDC_ANIMATIONS));
01243
01244       break;
01245
01246
01247     case IDC_SPEAK:
01248
01249       OnSpeak();
01250
01251       SendDlgItemMessage(m_hWnd, IDC_SPEAKTEXT, EM_SETSEL, 0, (LPARAM)-1);
01252       SetFocus(GetDlgItem(m_hWnd, IDC_SPEAKTEXT));
01253
01254       break;
01255
01256
01257     case IDC_MOVE:
01258
01259       iX = GetDlgItemInt(m_hWnd, IDC_MOVE_X, &bConvert, TRUE);
01260
01261       if (!bConvert || (iX > 32767) || (iX < -32767))
01262         break;
01263
01264       iY = GetDlgItemInt(m_hWnd, IDC_MOVE_Y, &bConvert, TRUE);
01265
01266       if (!bConvert || (iY > 32767) || (iY < -32767))
01267         break;
01268
01269       if (IsDlgButtonChecked(m_hWnd, IDC_STOPBEFOREPLAY))
01270         m_pCharacter->StopAll(STOP_TYPE_ALL);
01271
01272       m_pCharacter->MoveTo((short)iX, (short)iY, 1000, &lReqID);
01273
01274       break;
01275
01276
01277     case IDC_STOP:
01278
01279       m_pCharacter->StopAll(STOP_TYPE_ALL);
01280
01281       break;
01282
01283
01284     case IDC_SFX:
01285
01286       m_pCharacter->SetSoundEffectsOn(IsDlgButtonChecked(m_hWnd, IDC_SFX));
01287       break;
01288
01289
01290     case IDC_BALLOON_USE:
01291
01292       bCheck = IsDlgButtonChecked(m_hWnd, IDC_BALLOON_USE);
01293
01294       EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_SIZETOTEXT), bCheck);
01295       EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_AUTOPACE), bCheck);
01296       EnableWindow(GetDlgItem(m_hWnd, IDC_BALLOON_AUTOHIDE), bCheck);
01297
01298       break;
01299   }
01300 }
01301
01302
01303 void MainDlg::OnActivateApp(BOOL bActive) {
01304
01305   _TCHAR  szText[256];
01306   long  lOtherClients;
01307   long  lReqID;
01308   long  lVisibilityCause;
01309
01310   // If we don't have a character loaded, we're done
01311
01312   if (m_pCharacter == NULL)
01313     return;
01314
01315   // If we're being deactivated, and the foreground
01316   // window is an Agent character, we don't want to
01317   // hide the character.
01318
01319   if (!bActive) {
01320
01321     // Get the window title text for the foreground window.
01322     // NOTE: Microsoft Agent character's window titles are
01323     // always "Microsoft Agent"
01324
01325     if (GetWindowText(GetForegroundWindow(), szText, 256) > 0) {
01326
01327       if (lstrcmpi(szText, kpszAgentCharacterTitle) == 0)
01328         return;
01329
01330       // Check to see if it's the Agent Character Property
01331       // Sheet. NOTE: this currently only works on English
01332       // systems. A more robust way to do this would be to
01333       // use the process id of the window that is getting
01334       // focus, and make sure that it's not AgentSvr.exe.
01335
01336       if (lstrcmpi(szText, kpszAgentCharacterOptions) == 0)
01337         return;
01338     }
01339
01340     // If the character has other clients, we're not going
01341     // to hide it.
01342
01343     if (FAILED(m_pCharacter->HasOtherClients(&lOtherClients)))
01344       lOtherClients = FALSE;
01345
01346     if (!lOtherClients)
01347       m_pCharacter->Hide(TRUE, &lReqID);
01348   }
01349   else {
01350
01351     // Is the window minimized?
01352
01353     if (!IsIconic(m_hWnd)) {
01354
01355       // We want to show the character on activation but there's
01356       // a special case. If the user hid the character we could get
01357       // a WM_ACTIVATEAPP message after the character window hides.
01358       // In that case, we sure don't want to show the character. So
01359       // check the visibility cause of the character. If the user hid
01360       // it, we won't show it.
01361
01362       if (SUCCEEDED(m_pCharacter->GetVisibilityCause(&lVisibilityCause))) {
01363         if (lVisibilityCause == UserHid)
01364           return;
01365       }
01366
01367       m_pCharacter->Show(TRUE, &lReqID);
01368     }
01369   }
01370 }
01371
01372
01373 LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
01374
01375   MainDlg *pDlg;
01376
01377   pDlg = (MainDlg *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
01378
01379   switch (uMsg) {
01380     case WM_ACTIVATEAPP:
01381       pDlg->OnActivateApp((BOOL)wParam);
01382       break;
01383
01384     case WM_COMMAND:
01385       switch (HIWORD(wParam)) {
01386
01387         // First check for 0.  This is BN_CLICKED.  If lParam is 0
01388         // then it's a menu item selection.  If lParam is 1, it's
01389         // an accelerator key.  Otherwise, assume it's a button click.
01390
01391         case 0:
01392           if ((lParam == 0) || (lParam == 1)) {
01393             if (!pDlg->OnCommand(wParam, lParam))
01394               return DefDlgProc(hWnd, uMsg, wParam, lParam);
01395           }
01396           else
01397             pDlg->OnButtonClick(LOWORD(wParam));
01398
01399           break;
01400
01401         case 1:
01402           if (!pDlg->OnCommand(wParam, lParam))
01403             return DefDlgProc(hWnd, uMsg, wParam, lParam);
01404
01405           break;
01406
01407         case EN_CHANGE:
01408
01409           if (LOWORD(wParam) == IDC_SPEAKTEXT) {
01410
01411             BOOL bEnable;
01412
01413             // Enable the Speak button if there are animations and text
01414             // in the speak text edit field.
01415
01416             bEnable = (SendDlgItemMessage(pDlg->m_hWnd, IDC_ANIMATIONS, LB_GETCOUNT, 0, 0) > 0) &&
01417                   (GetWindowTextLength(GetDlgItem(pDlg->m_hWnd, IDC_SPEAKTEXT)) > 0);
01418
01419             // If we're enabling and the button isn't already enabled,
01420             // enable it and make it the default button. If we're disabling
01421             // and the button is enabled, disable it and turn off it's
01422             // default button status.
01423
01424             if (bEnable && !IsWindowEnabled(GetDlgItem(pDlg->m_hWnd, IDC_SPEAK))) {
01425               EnableWindow(GetDlgItem(pDlg->m_hWnd, IDC_SPEAK), TRUE);
01426               SendMessage(pDlg->m_hWnd, DM_SETDEFID, IDC_SPEAK, 0);
01427             }
01428             else if (!bEnable && IsWindowEnabled(GetDlgItem(pDlg->m_hWnd, IDC_SPEAK))) {
01429               EnableWindow(GetDlgItem(pDlg->m_hWnd, IDC_SPEAK), FALSE);
01430               SendMessage(pDlg->m_hWnd, DM_SETDEFID, 0, 0);
01431             }
01432           }
01433
01434           break;
01435       }
01436       break;
01437
01438     case WM_DESTROY:
01439       pDlg->OnDestroy();
01440       break;
01441
01442     case WM_DROPFILES:
01443       pDlg->OnDropFiles((HDROP)wParam);
01444       break;
01445
01446     case WM_INITMENUPOPUP:
01447       if (!pDlg->OnInitMenuPopup((HMENU)wParam, (UINT)LOWORD(lParam), (BOOL)HIWORD(lParam)))
01448         return DefDlgProc(hWnd, uMsg, wParam, lParam);
01449       break;
01450
01451     case WM_SYSCOMMAND:
01452       if (!pDlg->OnSysCommand(wParam))
01453         DefDlgProc(hWnd, uMsg, wParam, lParam);
01454       break;
01455
01456     default:
01457       return DefDlgProc(hWnd, uMsg, wParam, lParam);
01458   }
01459
01460   return 0;
01461 }
01462
01463
01464 LRESULT CALLBACK ListBoxWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
01465
01466   _ASSERT(g_pMainDlg);
01467
01468   switch (uMsg) {
01469     case WM_SETFOCUS:
01470       if (g_pMainDlg->m_pCharacter)
01471         SendMessage(GetParent(hWnd), DM_SETDEFID, IDC_PLAY, 0);
01472       break;
01473
01474     case WM_LBUTTONDBLCLK:
01475       if (g_pMainDlg->m_pCharacter)
01476         g_pMainDlg->OnButtonClick(IDC_PLAY);
01477       return 0;
01478   }
01479
01480   return CallWindowProc(g_pMainDlg->m_wpListBox, hWnd, uMsg, wParam, lParam);
01481 }
01482
01483
01484 LRESULT CALLBACK SpeakTextWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
01485
01486   _ASSERT(g_pMainDlg);
01487
01488   switch (uMsg) {
01489     case WM_SETFOCUS:
01490       _ASSERT(g_pMainDlg->m_pCharacter);
01491       if (GetWindowTextLength(hWnd) > 0)
01492         SendMessage(GetParent(hWnd), DM_SETDEFID, IDC_SPEAK, 0);
01493       break;
01494   }
01495
01496   return CallWindowProc(g_pMainDlg->m_wpSpeakText, hWnd, uMsg, wParam, lParam);
01497 }
01498
01499
01500 LRESULT CALLBACK MoveXWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
01501
01502   _ASSERT(g_pMainDlg);
01503
01504   switch (uMsg) {
01505     case WM_SETFOCUS:
01506       _ASSERT(g_pMainDlg->m_pCharacter);
01507       SendMessage(GetParent(hWnd), DM_SETDEFID, IDC_MOVE, 0);
01508       break;
01509   }
01510
01511   return CallWindowProc(g_pMainDlg->m_wpMoveX, hWnd, uMsg, wParam, lParam);
01512 }
01513
01514
01515 LRESULT CALLBACK MoveYWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
01516
01517   _ASSERT(g_pMainDlg);
01518
01519   switch (uMsg) {
01520     case WM_SETFOCUS:
01521       _ASSERT(g_pMainDlg->m_pCharacter);
01522       SendMessage(GetParent(hWnd), DM_SETDEFID, IDC_MOVE, 0);
01523       break;
01524   }
01525
01526   return CallWindowProc(g_pMainDlg->m_wpMoveY, hWnd, uMsg, wParam, lParam);
01527 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/ViewDIB/OpenDIB.h Source File

  • Multimedia
  • Gdi
  • ViewDIB

OpenDIB.h

Go to the documentation of this file.
00001 BOOL GetDIBFilename(LPSTR, LPSTR, BOOL);
Generated on Wed Nov 13 2024 16:52:14 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/MarshalOptionsEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

MarshalOptionsEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: MarshalOptionsEnum
00019
00020 public class MarshalOptionsEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adMarshalAll = 0;
00023   public static final short adMarshalModifiedOnly = 1;
00024 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/filerepsimple/filerepserver.cpp Source File

  • NetDS
  • RPC
  • FileRep
  • filerepsimple

filerepserver.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     File Replication Sample
00005     Server
00006
00007     FILE: FileRepServer.c
00008
00009     PURPOSE: Provides file replication server.  The server
00010         lives in the executable and is not a system service
00011
00012     COMMENTS:
00013
00014 */
00015
00016 #include <windows.h>
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <process.h>
00020 #include <tchar.h>
00021 #include <rpc.h>
00022
00023 // Generated by the MIDL compiler
00024 #include "FileRepServer.h"
00025 #include "FileRepClient.h"
00026
00027 // Contains declarations for system service functions.
00028 #include "Service.h"
00029
00030 // Common definitions
00031 #include "common.h"
00032
00033 /*
00034     RPC configuration.
00035 */
00036
00037 // The service listens to all the protseqs listed in this array.
00038 // It listens for replication utilities on local RPC and for
00039 // remote requests on TCP/IP
00040 LPTSTR ServerProtocolArray[] = { TEXT("ncacn_ip_tcp"),
00041          TEXT("ncalrpc") };
00042
00043 // Used in RpcServerUseProtseq.
00044 // Specifies the maximum number of concurrent remote
00045 // procedure call requests the server wants to handle.
00046 ULONG cMaxCallsListen = RPC_C_PROTSEQ_MAX_REQS_DEFAULT;
00047
00048 // Similarly, but for RpcServerListen.
00049 ULONG cMaxCallsExecute = RPC_C_LISTEN_MAX_CALLS_DEFAULT;
00050
00051 // Used in RpcServerListen().  The minnimum number of threads listening.
00052 ULONG cMinimumThreads = 2;
00053
00054 RPC_BINDING_VECTOR * pBindingVector = NULL;
00055
00056 // Status variable for the RPC calls.
00057 RPC_STATUS status;
00058
00059 /*
00060     FUNCTION: main()
00061
00062     PURPOSE: Performs RPC initialization and listens for calls.
00063
00064     PARAMETERS:
00065         dwArgc - number of command line arguments
00066         lpszArgv - array of command line arguments
00067
00068     RETURN VALUE:
00069         none
00070
00071     COMMENTS:
00072
00073 */
00074 INT _cdecl main(int argc, char **argv) {
00075
00076     unsigned int i;
00077
00078     // Register the service interfaces.
00079     status = RpcServerRegisterIf(s_FileRepServer_v1_0_s_ifspec, NULL, NULL);
00080     if (status != RPC_S_OK){
00081         AddToMessageLog(TEXT("ServiceStart: RpcServerRegisterIf(s_FileRepServer_v1_0_s_ifspec, ...) failed\n"));
00082         exit(status);
00083     }
00084     status = RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, NULL, NULL);
00085     if (status != RPC_S_OK){
00086         AddToMessageLog(TEXT("ServiceStart: RpcServerRegisterIf(FileRepClient_v1_0_s_ifspec, ...) failed\n"));
00087         exit(status);
00088     }
00089
00090     for (i = 0; i < sizeof(ServerProtocolArray)/sizeof(unsigned char *); i++) {
00091
00092         // Use the protocol sequences specified in ProtocolArray
00093         // for receiving RPCs.
00094         status = RpcServerUseProtseq((_TUCHAR *)ServerProtocolArray[i], cMaxCallsListen, NULL);
00095
00096         if (status != RPC_S_OK){
00097             AddToMessageLog(TEXT("ServiceStart: RpcServerUseProtseq failed\n"));
00098             exit(status);
00099         }
00100     }
00101
00102     // Obtain a binding vector for the server.
00103     status = RpcServerInqBindings(&pBindingVector);
00104     if (status != RPC_S_OK) {
00105         AddToMessageLog(TEXT("ServiceStart: RpcServerInqBindings failed\n"));
00106         exit(status);
00107     }
00108
00109     // Register the client and the server services in the endpoint map
00110     // of the host computer.
00111     status = RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00112     if (status != RPC_S_OK){
00113         AddToMessageLog(TEXT("ServiceStart: RpcEpRegister(s_FileRepServer_v1_0_s_ifspec, ...) failed\n"));
00114         exit(status);
00115     }
00116     status = RpcEpRegister(FileRepClient_v1_0_s_ifspec, pBindingVector, NULL, NULL);
00117     if (status != RPC_S_OK){
00118         AddToMessageLog(TEXT("ServiceStart: RpcEpRegister(FileRepClient_v1_0_s_ifspec, ...) failed\n"));
00119         exit(status);
00120     }
00121
00122     // Create the heap to be used by midl_user_allocate and midl_user_free
00123     RpcHeap = HeapCreate(0, RPC_HEAP_SIZE_INIT, RPC_HEAP_SIZE_MAX);
00124
00125 #ifdef PROF
00126     ProfOpenLog(TEXT("FileRepService.prof"));
00127 #endif
00128
00129     // Start accepting client calls.
00130     // The last argument's being 1 indicates that RpcServerListen
00131     // should return immediately after completing function processing.
00132     status = RpcServerListen(cMinimumThreads, cMaxCallsExecute, 1);
00133     if (status != RPC_S_OK){
00134         AddToMessageLog(TEXT("ServiceStart: RpcServerListen failed\n"));
00135         exit(status);
00136     }
00137
00138     // End of initialization
00139
00140     // RpcMgmtWaitServerListen() will block until the server has
00141     // stopped listening.
00142     status = RpcMgmtWaitServerListen();
00143     if (status != RPC_S_OK){
00144         AddToMessageLog(TEXT("ServiceStart: RpcMgmtWaitServerListen failed"));
00145         exit(status);
00146     }
00147
00148     // Cleanup
00149
00150     // Delete the binding vector.
00151     status = RpcServerUnregisterIf(NULL, NULL, FALSE);
00152     if(status != RPC_S_OK){
00153         AddToMessageLog(TEXT("ServiceStart: RpcServerUnregisterIf failed"));
00154         exit(status);
00155     }
00156
00157     return 0;
00158 } // end main()
00159
00160 // end FileRepServer.cpp
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/AltName.Cpp Source File

  • Security
  • CertServices
  • Encode

AltName.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        crldist.cpp
00007 //
00008 // Contents:    Cert Server Extension Encoding/Decoding implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013
00014 #pragma hdrstop
00015
00016 #include <assert.h>
00017 #include "resource.h"
00018 #include "altname.h"
00019 #include "celib.h"
00020
00021 #ifndef EAN_NAMEOBJECTID
00022 #define EAN_NAMEOBJECTID        ( 0x80000000 )
00023 #endif EAN_NAMEOBJECTID
00024
00025
00026 //+--------------------------------------------------------------------------
00027 // CCertEncodeAltName::CCertEncodeAltName -- constructor
00028 //
00029 // initialize class
00030 //+--------------------------------------------------------------------------
00031
00032 CCertEncodeAltName::CCertEncodeAltName()
00033 {
00034     m_aValue = NULL;
00035     m_DecodeInfo = NULL;
00036     m_fConstructing = FALSE;
00037 }
00038
00039
00040 //+--------------------------------------------------------------------------
00041 // CCertEncodeAltName::~CCertEncodeAltName -- destructor
00042 //
00043 // free memory associated with this instance
00044 //+--------------------------------------------------------------------------
00045
00046 CCertEncodeAltName::~CCertEncodeAltName()
00047 {
00048     _Cleanup();
00049 }
00050
00051
00052 //+--------------------------------------------------------------------------
00053 // CCertEncodeAltName::_NameType -- determine name type tag
00054 //
00055 //+--------------------------------------------------------------------------
00056
00057 CCertEncodeAltName::enumNameType
00058 CCertEncodeAltName::_NameType(
00059     IN DWORD NameChoice)
00060 {
00061     enumNameType Type = enumUnknown;
00062
00063     switch (NameChoice)
00064     {
00065   case CERT_ALT_NAME_RFC822_NAME:
00066   case CERT_ALT_NAME_DNS_NAME:
00067   case CERT_ALT_NAME_URL:
00068       Type = enumUnicode;
00069       break;
00070
00071   case CERT_ALT_NAME_REGISTERED_ID:
00072       Type = enumAnsi;
00073       break;
00074
00075   case CERT_ALT_NAME_DIRECTORY_NAME:
00076   case CERT_ALT_NAME_IP_ADDRESS:
00077       Type = enumBlob;
00078       break;
00079
00080   case CERT_ALT_NAME_OTHER_NAME:
00081       Type = enumOther;
00082       break;
00083
00084   //case CERT_ALT_NAME_X400_ADDRESS:
00085   //case CERT_ALT_NAME_EDI_PARTY_NAME:
00086     }
00087     return(Type);
00088 }
00089
00090
00091 //+--------------------------------------------------------------------------
00092 // CCertEncodeAltName::_Cleanup -- release all resources
00093 //
00094 // free memory associated with this instance
00095 //+--------------------------------------------------------------------------
00096
00097 VOID
00098 CCertEncodeAltName::_Cleanup()
00099 {
00100     if (NULL != m_aValue)
00101     {
00102   if (!m_fConstructing)
00103   {
00104       if (NULL != m_DecodeInfo)
00105       {
00106     LocalFree(m_DecodeInfo);
00107     m_DecodeInfo = NULL;
00108       }
00109   }
00110   else
00111   {
00112       CERT_ALT_NAME_ENTRY *pName;
00113       CERT_ALT_NAME_ENTRY *pNameEnd;
00114
00115       for (pName = m_aValue, pNameEnd = &m_aValue[m_cValue];
00116      pName < pNameEnd;
00117      pName++)
00118       {
00119     BYTE **ppb;
00120
00121     ppb = NULL;
00122
00123     switch (_NameType(pName->dwAltNameChoice))
00124     {
00125         case enumUnicode:
00126         case enumAnsi:
00127       ppb = (BYTE **) &pName->pwszURL;
00128       break;
00129
00130         case enumBlob:
00131       ppb = (BYTE **) &pName->DirectoryName.pbData;
00132       break;
00133
00134         case enumOther:
00135         {
00136       CERT_OTHER_NAME *pOther = pName->pOtherName;
00137       if (NULL != pOther)
00138       {
00139           if (NULL != pOther->pszObjId)
00140           {
00141         LocalFree(pOther->pszObjId);
00142           }
00143           if (NULL != pOther->Value.pbData)
00144           {
00145         LocalFree(pOther->Value.pbData);
00146           }
00147       }
00148       ppb = (BYTE **) &pName->pOtherName;
00149       break;
00150         }
00151     }
00152     if (NULL != ppb && NULL != *ppb)
00153     {
00154         LocalFree(*ppb);
00155     }
00156       }
00157       LocalFree(m_aValue);
00158   }
00159   m_aValue = NULL;
00160     }
00161     assert(NULL == m_DecodeInfo);
00162     m_fConstructing = FALSE;
00163 }
00164
00165
00166 //+--------------------------------------------------------------------------
00167 // CCertEncodeAltName::_MapName -- map a distribution point
00168 //
00169 //+--------------------------------------------------------------------------
00170
00171 HRESULT
00172 CCertEncodeAltName::_MapName(
00173     IN BOOL fEncode,
00174     IN LONG NameIndex,      // NameIndex | EAN_*
00175     OUT CERT_ALT_NAME_ENTRY **ppName)
00176 {
00177     HRESULT hr = S_OK;
00178     CERT_ALT_NAME_ENTRY *pName;
00179
00180     if (fEncode)
00181     {
00182   pName = m_fConstructing? m_aValue : NULL;
00183     }
00184     else
00185     {
00186   pName = m_aValue;
00187     }
00188
00189     if (NULL == pName)
00190     {
00191   hr = E_INVALIDARG;
00192   ceERRORPRINTLINE("bad parameter", hr);
00193   goto error;
00194     }
00195
00196     NameIndex &= ~EAN_NAMEOBJECTID;
00197     if (m_cValue <= NameIndex)
00198     {
00199   ceERRORPRINTLINE("bad NameIndex parameter", hr);
00200   hr = E_INVALIDARG;
00201   goto error;
00202     }
00203     *ppName = &pName[NameIndex];
00204
00205 error:
00206     return(hr);
00207 }
00208
00209
00210 //+--------------------------------------------------------------------------
00211 // CCertEncodeAltName::Decode -- Decode AltName
00212 //
00213 // Returns S_OK on success.
00214 //+--------------------------------------------------------------------------
00215
00216 STDMETHODIMP
00217 CCertEncodeAltName::Decode(
00218     /* [in] */ BSTR const strBinary)
00219 {
00220     HRESULT hr = S_OK;
00221
00222     _Cleanup();
00223
00224     if (NULL == strBinary)
00225     {
00226   hr = E_POINTER;
00227   ceERRORPRINTLINE("NULL parm", hr);
00228   goto error;
00229     }
00230
00231     // Decode CERT_ALT_NAME_INFO:
00232
00233     if (!ceDecodeObject(
00234         X509_ASN_ENCODING,
00235         X509_ALTERNATE_NAME,
00236         (BYTE *) strBinary,
00237         SysStringByteLen(strBinary),
00238         FALSE,
00239         (VOID **) &m_DecodeInfo,
00240         &m_DecodeLength))
00241     {
00242   hr = ceHLastError();
00243   ceERRORPRINTLINE("ceDecodeObject", hr);
00244   goto error;
00245     }
00246
00247     m_aValue = m_DecodeInfo->rgAltEntry;
00248     m_cValue = m_DecodeInfo->cAltEntry;
00249
00250 error:
00251     if (S_OK != hr)
00252     {
00253   _Cleanup();
00254     }
00255     return(_SetErrorInfo(hr, L"CCertEncodeAltName::Decode"));
00256 }
00257
00258
00259 //+--------------------------------------------------------------------------
00260 // CCertEncodeAltName::GetNameCount -- Get the Distribution Name Count
00261 //
00262 // Returns S_OK on success.
00263 //+--------------------------------------------------------------------------
00264
00265 STDMETHODIMP
00266 CCertEncodeAltName::GetNameCount(
00267     /* [out, retval] */ LONG __RPC_FAR *pNameCount)
00268 {
00269     HRESULT hr = E_INVALIDARG;
00270
00271     if (NULL == pNameCount)
00272     {
00273   hr = E_POINTER;
00274   ceERRORPRINTLINE("NULL parm", hr);
00275   goto error;
00276     }
00277     if (NULL == m_aValue)
00278     {
00279   ceERRORPRINTLINE("bad parameter", hr);
00280   goto error;
00281     }
00282     *pNameCount = m_cValue;
00283     hr = S_OK;
00284
00285 error:
00286     return(_SetErrorInfo(hr, L"CCertEncodeAltName::GetNameCount"));
00287 }
00288
00289
00290 //+--------------------------------------------------------------------------
00291 // CCertEncodeAltName::GetNameChoice -- Get a Name Choice
00292 //
00293 // Returns S_OK on success.
00294 //+--------------------------------------------------------------------------
00295
00296 STDMETHODIMP
00297 CCertEncodeAltName::GetNameChoice(
00298     /* [in] */ LONG NameIndex,
00299     /* [out, retval] */ LONG __RPC_FAR *pNameChoice)
00300 {
00301     HRESULT hr;
00302     CERT_ALT_NAME_ENTRY *pName;
00303
00304     if (NULL == pNameChoice)
00305     {
00306   hr = E_POINTER;
00307   ceERRORPRINTLINE("NULL parm", hr);
00308   goto error;
00309     }
00310     hr = _MapName(FALSE, NameIndex, &pName);
00311     if (S_OK != hr)
00312     {
00313   ceERRORPRINTLINE("_MapName", hr);
00314   goto error;
00315     }
00316     if (enumUnknown == _NameType(pName->dwAltNameChoice))
00317     {
00318   hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
00319   ceERRORPRINTLINE("uninitialized", hr);
00320   goto error;
00321     }
00322     *pNameChoice = pName->dwAltNameChoice;
00323
00324 error:
00325     return(_SetErrorInfo(hr, L"CCertEncodeAltName::GetNameChoice"));
00326 }
00327
00328
00329 //+--------------------------------------------------------------------------
00330 // CCertEncodeAltName::GetName -- Get a Name
00331 //
00332 // Returns S_OK on success.
00333 //+--------------------------------------------------------------------------
00334
00335 STDMETHODIMP
00336 CCertEncodeAltName::GetName(
00337     /* [in] */ LONG NameIndex,      // NameIndex | EAN_*
00338     /* [out, retval] */ BSTR __RPC_FAR *pstrName)
00339 {
00340     HRESULT hr;
00341     CERT_ALT_NAME_ENTRY *pName;
00342
00343     if (NULL == pstrName)
00344     {
00345   hr = E_POINTER;
00346   ceERRORPRINTLINE("NULL parm", hr);
00347   goto error;
00348     }
00349     ceFreeBstr(pstrName);
00350     hr = _MapName(FALSE, NameIndex, &pName);
00351     if (S_OK != hr)
00352     {
00353   ceERRORPRINTLINE("_MapName", hr);
00354   goto error;
00355     }
00356
00357     hr = E_OUTOFMEMORY;
00358     switch (_NameType(pName->dwAltNameChoice))
00359     {
00360   case enumUnicode:
00361       if (!ceConvertWszToBstr(pstrName, pName->pwszURL, -1))
00362       {
00363     ceERRORPRINTLINE("no memory", hr);
00364     goto error;
00365       }
00366       break;
00367
00368   case enumAnsi:
00369       if (!ceConvertSzToBstr(pstrName, pName->pszRegisteredID, -1))
00370       {
00371     ceERRORPRINTLINE("no memory", hr);
00372     goto error;
00373       }
00374       break;
00375
00376   case enumBlob:
00377       if (!ceConvertWszToBstr(
00378         pstrName,
00379         (WCHAR const *) pName->DirectoryName.pbData,
00380         pName->DirectoryName.cbData))
00381       {
00382     ceERRORPRINTLINE("no memory", hr);
00383     goto error;
00384       }
00385       break;
00386
00387   case enumOther:
00388       if (EAN_NAMEOBJECTID & NameIndex)
00389       {
00390     if (!ceConvertSzToBstr(
00391         pstrName,
00392         pName->pOtherName->pszObjId,
00393         -1))
00394     {
00395         ceERRORPRINTLINE("no memory", hr);
00396         goto error;
00397     }
00398       }
00399       else
00400       {
00401     if (!ceConvertWszToBstr(
00402         pstrName,
00403         (WCHAR const *) pName->pOtherName->Value.pbData,
00404         pName->pOtherName->Value.cbData))
00405     {
00406         ceERRORPRINTLINE("no memory", hr);
00407         goto error;
00408     }
00409       }
00410       break;
00411
00412   default:
00413       assert(enumUnknown == _NameType(pName->dwAltNameChoice));
00414       hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
00415       ceERRORPRINTLINE("uninitialized", hr);
00416       goto error;
00417     }
00418     hr = S_OK;
00419
00420 error:
00421     return(_SetErrorInfo(hr, L"CCertEncodeAltName::GetName"));
00422 }
00423
00424
00425 //+--------------------------------------------------------------------------
00426 // CCertEncodeAltName::Reset -- clear out data
00427 //
00428 // Returns S_OK on success.
00429 //+--------------------------------------------------------------------------
00430
00431 STDMETHODIMP
00432 CCertEncodeAltName::Reset(
00433     /* [in] */ LONG NameCount)
00434 {
00435     HRESULT hr = S_OK;
00436
00437     _Cleanup();
00438     m_fConstructing = TRUE;
00439     if (CENCODEMAX < NameCount || 0 > NameCount)
00440     {
00441   hr = E_INVALIDARG;
00442   ceERRORPRINTLINE("bad count parameter", hr);
00443   goto error;
00444     }
00445
00446     m_aValue = (CERT_ALT_NAME_ENTRY *) LocalAlloc(
00447         LMEM_FIXED | LMEM_ZEROINIT,
00448         NameCount * sizeof(m_aValue[0]));
00449     if (NULL == m_aValue)
00450     {
00451   hr = E_OUTOFMEMORY;
00452   ceERRORPRINTLINE("LocalAlloc", hr);
00453   goto error;
00454     }
00455     m_cValue = NameCount;
00456
00457 error:
00458     if (S_OK != hr)
00459     {
00460   _Cleanup();
00461     }
00462     return(_SetErrorInfo(hr, L"CCertEncodeAltName::Reset"));
00463 }
00464
00465
00466 //+--------------------------------------------------------------------------
00467 // CCertEncodeAltName::SetNameEntry -- Set a Name Netry
00468 //
00469 // Returns S_OK on success.
00470 //+--------------------------------------------------------------------------
00471
00472 STDMETHODIMP
00473 CCertEncodeAltName::SetNameEntry(
00474     /* [in] */ LONG NameIndex,      // NameIndex | EAN_*
00475     /* [in] */ LONG NameChoice,
00476     /* [in] */ BSTR const strName)
00477 {
00478     HRESULT hr;
00479     CERT_ALT_NAME_ENTRY *pName;
00480     DATA_BLOB *pBlob = NULL;
00481     CCertEncodeAltName::enumNameType enumT;
00482
00483     if (NULL == strName)
00484     {
00485   hr = E_POINTER;
00486   ceERRORPRINTLINE("NULL parm", hr);
00487   goto error;
00488     }
00489     if (!m_fConstructing)
00490     {
00491   hr = E_INVALIDARG;
00492   ceERRORPRINTLINE("bad parameter", hr);
00493   goto error;
00494     }
00495
00496     hr = _MapName(TRUE, NameIndex, &pName);
00497     if (S_OK != hr)
00498     {
00499   ceERRORPRINTLINE("_MapName", hr);
00500   goto error;
00501     }
00502
00503     enumT = enumUnknown;
00504     if (CERT_ALT_NAME_OTHER_NAME == pName->dwAltNameChoice &&
00505   0 == (EAN_NAMEOBJECTID & NameIndex))
00506     {
00507   enumT = enumOther;
00508     }
00509     if (_NameType(pName->dwAltNameChoice) != enumT)
00510     {
00511   hr = E_INVALIDARG;
00512   ceERRORPRINTLINE("bad parameter", hr);
00513   goto error;
00514     }
00515     if (CERT_ALT_NAME_OTHER_NAME != pName->dwAltNameChoice ||
00516   0 == (EAN_NAMEOBJECTID & NameIndex))
00517     {
00518   hr = ceVerifyAltNameString(NameChoice, strName);
00519   if (S_OK != hr)
00520   {
00521       ceERRORPRINTLINE("ceVerifyAltNameString", hr);
00522       goto error;
00523   }
00524     }
00525
00526     switch (_NameType(NameChoice))
00527     {
00528   case enumUnicode:
00529       pName->pwszURL = ceDuplicateString(strName);
00530       if (NULL == pName->pwszURL)
00531       {
00532     hr = E_OUTOFMEMORY;
00533     ceERRORPRINTLINE("ceDuplicateString", hr);
00534     goto error;
00535       }
00536       break;
00537
00538   case enumAnsi:
00539       if (CERT_ALT_NAME_REGISTERED_ID == NameChoice)
00540       {
00541     hr = ceVerifyObjId(strName);
00542     if (S_OK != hr)
00543     {
00544         ceERRORPRINTLINE("ceVerifyObjId", hr);
00545         goto error;
00546     }
00547       }
00548       if (!ceConvertWszToSz(&pName->pszRegisteredID, strName, -1))
00549       {
00550     hr = E_OUTOFMEMORY;
00551     ceERRORPRINTLINE("ceConvertWszToSz", hr);
00552     goto error;
00553       }
00554       break;
00555
00556   case enumBlob:
00557       pBlob = &pName->DirectoryName;
00558       break;
00559
00560   case enumOther:
00561       if (NULL == pName->pOtherName)
00562       {
00563     pName->pOtherName = (CERT_OTHER_NAME *) LocalAlloc(
00564           LMEM_FIXED | LMEM_ZEROINIT,
00565           sizeof(*pName->pOtherName));
00566     if (NULL == pName->pOtherName)
00567     {
00568         hr = E_OUTOFMEMORY;
00569         _JumpError(hr, error, "LocalAlloc");
00570     }
00571       }
00572       else if (CERT_ALT_NAME_OTHER_NAME != pName->dwAltNameChoice)
00573       {
00574     hr = E_INVALIDARG;
00575     _JumpError(hr, error, "NameChoice conflict");
00576       }
00577       if (EAN_NAMEOBJECTID & NameIndex)
00578       {
00579     if (NULL != pName->pOtherName->pszObjId)
00580     {
00581         hr = E_INVALIDARG;
00582         _JumpError(hr, error, "pszObjId already set");
00583     }
00584     hr = ceVerifyObjId(strName);
00585     if (S_OK != hr)
00586     {
00587         ceERRORPRINTLINE("ceVerifyObjId", hr);
00588         goto error;
00589     }
00590     if (!ceConvertWszToSz(&pName->pOtherName->pszObjId, strName, -1))
00591     {
00592         hr = E_OUTOFMEMORY;
00593         _JumpError(hr, error, "ceConvertWszToSz");
00594     }
00595       }
00596       else
00597       {
00598     pBlob = &pName->pOtherName->Value;
00599       }
00600       break;
00601
00602   default:
00603       hr = E_INVALIDARG;
00604       ceERRORPRINTLINE("bad NameChoice parameter", hr);
00605       goto error;
00606       break;
00607     }
00608
00609     if (NULL != pBlob)
00610     {
00611   if (NULL != pBlob->pbData)
00612   {
00613       hr = E_INVALIDARG;
00614       _JumpError(hr, error, "pbData already set");
00615   }
00616   pBlob->cbData = SysStringByteLen(strName);
00617   pBlob->pbData = (BYTE *) LocalAlloc(LMEM_FIXED, pBlob->cbData);
00618   if (NULL == pBlob->pbData)
00619   {
00620       hr = E_OUTOFMEMORY;
00621       _JumpError(hr, error, "LocalAlloc");
00622   }
00623   CopyMemory(pBlob->pbData, strName, pBlob->cbData);
00624     }
00625     pName->dwAltNameChoice = NameChoice;
00626
00627 error:
00628     return(_SetErrorInfo(hr, L"CCertEncodeAltName::SetNameEntry"));
00629 }
00630
00631
00632 //+--------------------------------------------------------------------------
00633 // CCertEncodeAltName::_VerifyName -- Verify name
00634 //
00635 // Returns S_OK on success.
00636 //+--------------------------------------------------------------------------
00637
00638 BOOL
00639 CCertEncodeAltName::_VerifyName(
00640     IN LONG NameIndex)
00641 {
00642     HRESULT hr;
00643     BOOL fOk = FALSE;
00644     CERT_ALT_NAME_ENTRY *pName;
00645
00646     assert(m_fConstructing);
00647
00648     hr = _MapName(TRUE, NameIndex, &pName);
00649     if (S_OK != hr)
00650     {
00651   ceERRORPRINTLINE("_MapName", hr);
00652   goto error;
00653     }
00654     assert(NULL != pName);
00655     switch (_NameType(pName->dwAltNameChoice))
00656     {
00657   case enumOther:
00658       if (NULL != pName->pOtherName &&
00659     NULL != pName->pOtherName->pszObjId &&
00660     NULL != pName->pOtherName->Value.pbData)
00661       {
00662     break;
00663       }
00664       // FALLTHROUGH
00665
00666   case enumUnknown:
00667       hr = E_INVALIDARG;
00668       ceERRORPRINTLINE("uninitialized name", hr);
00669       goto error;
00670     }
00671     fOk = TRUE;
00672
00673 error:
00674     return(fOk);
00675 }
00676
00677
00678 //+--------------------------------------------------------------------------
00679 // CCertEncodeAltName::Encode -- Encode AltName
00680 //
00681 // Returns S_OK on success.
00682 //+--------------------------------------------------------------------------
00683
00684 STDMETHODIMP
00685 CCertEncodeAltName::Encode(
00686     /* [out, retval] */ BSTR __RPC_FAR *pstrBinary)
00687 {
00688     HRESULT hr = S_OK;
00689     CERT_ALT_NAME_INFO AltName;
00690     BYTE *pbEncoded = NULL;
00691     DWORD cbEncoded;
00692     LONG i;
00693
00694     if (NULL == pstrBinary)
00695     {
00696   hr = E_POINTER;
00697   ceERRORPRINTLINE("NULL parm", hr);
00698   goto error;
00699     }
00700
00701     AltName.cAltEntry = m_cValue;
00702     AltName.rgAltEntry = m_aValue;
00703
00704     ceFreeBstr(pstrBinary);
00705     if (!m_fConstructing || NULL == m_aValue)
00706     {
00707   hr = E_INVALIDARG;
00708   ceERRORPRINTLINE("bad parameter", hr);
00709   goto error;
00710     }
00711
00712     for (i = 0; i < m_cValue; i++)
00713     {
00714   // Verify all entries are initialized:
00715
00716   if (!_VerifyName(i))
00717   {
00718       hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00719       ceERRORPRINTLINE("uninitialized name", hr);
00720       goto error;
00721   }
00722     }
00723
00724     // Encode CERT_ALT_NAME_INFO:
00725
00726     if (!ceEncodeObject(
00727         X509_ASN_ENCODING,
00728         X509_ALTERNATE_NAME,
00729         &AltName,
00730         0,
00731         FALSE,
00732         &pbEncoded,
00733         &cbEncoded))
00734     {
00735   hr = ceHLastError();
00736   ceERRORPRINTLINE("ceEncodeObject", hr);
00737   goto error;
00738     }
00739     if (!ceConvertWszToBstr(pstrBinary, (WCHAR const *) pbEncoded, cbEncoded))
00740     {
00741   hr = E_OUTOFMEMORY;
00742   ceERRORPRINTLINE("ceConvertWszToBstr", hr);
00743   goto error;
00744     }
00745
00746 error:
00747     if (NULL != pbEncoded)
00748     {
00749   LocalFree(pbEncoded);
00750     }
00751     return(_SetErrorInfo(hr, L"CCertEncodeAltName::Encode"));
00752 }
00753
00754
00755 //+--------------------------------------------------------------------------
00756 // CCertEncodeAltName::_SetErrorInfo -- set error object information
00757 //
00758 // Returns passed HRESULT
00759 //+--------------------------------------------------------------------------
00760
00761 HRESULT
00762 CCertEncodeAltName::_SetErrorInfo(
00763     IN HRESULT hrError,
00764     IN WCHAR const *pwszDescription)
00765 {
00766     assert(FAILED(hrError) || S_OK == hrError || S_FALSE == hrError);
00767     if (FAILED(hrError))
00768     {
00769   HRESULT hr;
00770
00771   hr = ceDispatchSetErrorInfo(
00772           hrError,
00773           pwszDescription,
00774           wszCLASS_CERTENCODEALTNAME,
00775           &IID_ICertEncodeAltName);
00776   assert(hr == hrError);
00777     }
00778     return(hrError);
00779 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CDropTarget Member List

This is the complete list of members for CDropTarget, including all inherited members.
AllocPidlTable(DWORD) | CDropTarget | [private]
CDropTarget() | CDropTarget |
CDropTarget(void) | CDropTarget |
CDropTarget(CShellFolder *) | CDropTarget |
DisplayFileNames(HWND, HGLOBAL) | CDropTarget | [private]
DoDrop(HGLOBAL, BOOL) | CDropTarget | [private]
DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) | CDropTarget |
DragEnter(LPDATAOBJECT, DWORD, POINTL, LPDWORD) | CDropTarget |
DragEnter(LPDATAOBJECT, DWORD, POINTL, LPDWORD) | CDropTarget |
DragLeave() | CDropTarget |
DragLeave(void) | CDropTarget |
DragLeave(VOID) | CDropTarget |
DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) | CDropTarget |
DragOver(DWORD, POINTL, LPDWORD) | CDropTarget |
DragOver(DWORD, POINTL, LPDWORD) | CDropTarget |
Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) | CDropTarget |
Drop(LPDATAOBJECT, DWORD, POINTL, LPDWORD) | CDropTarget |
Drop(LPDATAOBJECT, DWORD, POINTL, LPDWORD) | CDropTarget |
FreePidlTable(LPITEMIDLIST *) | CDropTarget | [private]
GetDropEffectFromKeyState(DWORD) | CDropTarget | [private]
m_cfPrivateData | CDropTarget | [private]
m_cRef | CDropTarget | [private]
m_cRefCount | CDropTarget | [private]
m_fAcceptFmt | CDropTarget | [private]
m_ObjRefCount | CDropTarget | [private]
m_pDropTargetHelper | CDropTarget | [private]
m_pMalloc | CDropTarget | [private]
m_pPidlMgr | CDropTarget | [private]
m_psfParent | CDropTarget | [private]
QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect) | CDropTarget | [private]
QueryDrop(DWORD, LPDWORD) | CDropTarget | [private]
QueryInterface(REFIID riid, void **ppvObject) | CDropTarget |
QueryInterface(REFIID, LPVOID *) | CDropTarget |
QueryInterface(REFIID, LPVOID *) | CDropTarget |
STDMETHOD_(ULONG, AddRef)(void) | CDropTarget |
STDMETHOD_(ULONG, Release)(void) | CDropTarget |
STDMETHOD_(ULONG, AddRef)(void) | CDropTarget |
STDMETHOD_(ULONG, Release)(void) | CDropTarget |
STDMETHODIMP_(ULONG) AddRef() | CDropTarget |
STDMETHODIMP_(ULONG) Release() | CDropTarget |
~CDropTarget() | CDropTarget | [virtual]
~CDropTarget(void) | CDropTarget |
~CDropTarget() | CDropTarget |
Generated on Wed Nov 13 2024 16:56:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

ICreateTable Member List

This is the complete list of members for ICreateTable, including all inherited members.
CreateAccount() ICreateTable
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

IDBAuthAdmin Member List

This is the complete list of members for IDBAuthAdmin, including all inherited members.
AddUser(BSTR bstrUserName) | IDBAuthAdmin
GetUsers([out, retval] BSTR *pbstrUserNames) | IDBAuthAdmin
RemoveUser(BSTR bstrUserName) | IDBAuthAdmin
VerifyUser(BSTR bstrUserName,[out, retval] VARIANT_BOOL *bFound) | IDBAuthAdmin
Generated on Wed Nov 13 2024 16:57:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

PickleControlBlock Member List

This is the complete list of members for PickleControlBlock, including all inherited members.
LastSize | PickleControlBlock
pBufferStart | PickleControlBlock
pMemBuffer | PickleControlBlock
Generated on Wed Nov 13 2024 16:57:56 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Tbarext/guids.h Source File

  • SysMgmt
  • MMC
  • Tbarext

guids.h

Go to the documentation of this file.
00001
00002 //==============================================================;
00003 //
00004 //  This source code is only intended as a supplement to existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019
00020
00021 // {20E42DD2-5CCF-11d3-9147-00C04F65B3F9}
00022 DEFINE_GUID(CLSID_CToolBarExtension,
00023 0x20e42dd2, 0x5ccf, 0x11d3, 0x91, 0x47, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9);
00024
00025
00026 // {3E66FCD0-5CCF-11d3-9147-00C04F65B3F9}
00027 DEFINE_GUID(CLSID_CSnapinAbout,
00028 0x3e66fcd0, 0x5ccf, 0x11d3, 0x91, 0x47, 0x0, 0xc0, 0x4f, 0x65, 0xb3, 0xf9);
00029
00030
00031
00032
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/opnrowst.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

opnrowst.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module OPNROWST.CPP | IOpenRowset interface implementation
00008 //
00009
00010 // Includes ------------------------------------------------------------------
00011
00012 #include "headers.h"
00013
00014
00015 // Code ----------------------------------------------------------------------
00016
00017
00018
00019 // CImpIOpenRowset::OpenRowset ------------------------------------------------
00020 //
00021 // @mfunc Opens and returns a rowset that includes all rows from a single base table
00022 //
00023 // @rdesc HRESULT
00024 //      @flag S_OK                  | The method succeeded
00025 //      @flag E_INVALIDARG          | pTableID was NULL
00026 //      @flag E_FAIL                | Provider-specific error
00027 //      @flag DB_E_NOTABLE          | Specified table does not exist in current Data
00028 //                                  | Data Source object
00029 //      @flag E_OUTOFMEMORY         | Out of memory
00030 //      @flag E_NOINTERFACE         | The requested interface was not available
00031
00032 STDMETHODIMP CImpIOpenRowset::OpenRowset
00033     (
00034     IUnknown*                   pUnkOuter,          //@parm IN    | Controlling unknown, if any
00035     DBID*                       pTableID,           //@parm IN    | table to open
00036   DBID*           pIndexID,     //@parm IN    | DBID of the index
00037     REFIID                      riid,               //@parm IN    | interface to return
00038     ULONG                       cPropertySets,      //@parm IN    | count of properties
00039     DBPROPSET         rgPropertySets[],   //@parm INOUT | array of property values
00040     IUnknown**                  ppRowset            //@parm OUT   | where to return interface
00041     )
00042 {
00043   CCommand*       pCCommand = NULL;
00044   ICommandText*     pICmdText = NULL;
00045   ICommandProperties*   pICmdProp = NULL;
00046     CRowset*    pRowset = NULL;
00047
00048     HRESULT     hr;
00049   HRESULT   hrProp  = ResultFromScode( S_OK );
00050   ULONG   ul,ul2;
00051
00052     assert( m_pObj );
00053   assert( m_pObj->m_pUtilProp );
00054
00055     // NULL out-params in case of error
00056     if( ppRowset )
00057       *ppRowset = NULL;
00058
00059     // Check Arguments
00060   if ( !pTableID && !pIndexID )
00061         return ResultFromScode( E_INVALIDARG );
00062
00063   if ( riid == IID_NULL)
00064         return ResultFromScode( E_NOINTERFACE );
00065
00066   // Check Arguments for use by properties
00067   if( cPropertySets )
00068   {
00069     hr = m_pObj->m_pUtilProp->SetPropertiesArgChk(cPropertySets,
00070                             rgPropertySets);
00071     if( FAILED(hr) )
00072       return hr;
00073   }
00074
00075   // We only accept NULL for pIndexID
00076   if( pIndexID )
00077     return ResultFromScode( DB_E_NOINDEX );
00078
00079   // If the eKind is not known to use, basically it
00080   // means we have no table identifier
00081   if ( (!pTableID ) || ( pTableID->eKind != DBKIND_NAME ) ||
00082      ( (pTableID->eKind == DBKIND_NAME) && (!(pTableID->uName.pwszName)) ) ||
00083      ( wcslen(pTableID->uName.pwszName) == 0 ) ||
00084      ( wcslen(pTableID->uName.pwszName) > _MAX_FNAME ) )
00085     return ResultFromScode( DB_E_NOTABLE );
00086
00087   // We do not allow the riid to be anything other than IID_IUnknown for aggregation
00088   if ( (pUnkOuter) && (riid != IID_IUnknown) )
00089     return ResultFromScode( DB_E_NOAGGREGATION );
00090
00091   // Create a Command Object
00092   // This is the outer unknown from the user, for the new Command,
00093   // not to be confused with the outer unknown of this DBSession object.
00094   pCCommand = new CCommand(m_pObj, NULL);
00095   if (pCCommand)
00096   {
00097     hr = pCCommand->FInit();
00098     if( FAILED(hr) )
00099     {
00100       delete pCCommand; // clean up.
00101       pCCommand = NULL;
00102     }
00103   }
00104   else
00105   {
00106     // Since Ctor failed, it cannot know to Release pUnkOuter,
00107     // so we must do it here since we are owner.
00108     if (pUnkOuter)
00109       pUnkOuter->Release();
00110     hr = E_OUTOFMEMORY;
00111   }
00112
00113   if( pCCommand )
00114   {
00115     // Since we are using the command objects interfaces to impersonate
00116     // doing IOpenRowset, we need to tell the command object to post errors
00117     // as IID_IOpenRowset
00118     pCCommand->SetImpersonateIID(&IID_IOpenRowset);
00119
00120
00121     // Allocate buffer for Table Name.
00122     if( FAILED(hr = pCCommand->QueryInterface(IID_ICommandText, (LPVOID*)&pICmdText)) )
00123     {
00124       assert(!"QI for ICmdText failed");
00125       goto EXIT;
00126     }
00127     assert( pICmdText );
00128     if( FAILED(hr = pICmdText->SetCommandText(DBGUID_DEFAULT, pTableID->uName.pwszName)) )
00129     {
00130       // Process Errors
00131       goto EXIT;
00132     }
00133
00134     // Process Properties
00135     if( cPropertySets > 0 )
00136     {
00137       if( FAILED(hr = pCCommand->QueryInterface(IID_ICommandProperties, (LPVOID*)&pICmdProp)) )
00138       {
00139         assert(!"QI for ICmdProp failed");
00140         goto EXIT;
00141       }
00142       assert( pICmdProp );
00143       hr = (pICmdProp->SetProperties(cPropertySets, rgPropertySets));
00144       if( (hr == DB_E_ERRORSOCCURRED) ||
00145         (hr == DB_S_ERRORSOCCURRED) )
00146       {
00147         // If all the properties set were SETIFCHEAP then we can set
00148         // our status to DB_S_ERRORSOCCURRED and continue.
00149         for(ul=0;ul<cPropertySets; ul++)
00150         {
00151           for(ul2=0;ul2<rgPropertySets[ul].cProperties; ul2++)
00152           {
00153             // Check for a required property that failed, if found, we must return
00154             // DB_E_ERRORSOCCURRED
00155             if( (rgPropertySets[ul].rgProperties[ul2].dwStatus != DBPROPSTATUS_OK) &&
00156               (rgPropertySets[ul].rgProperties[ul2].dwOptions != DBPROPOPTIONS_SETIFCHEAP) )
00157             {
00158               hr = ResultFromScode(DB_E_ERRORSOCCURRED);
00159               goto EXIT;
00160             }
00161           }
00162         }
00163         hrProp = DB_S_ERRORSOCCURRED;
00164       }
00165       else if( FAILED(hr) )
00166       {
00167         goto EXIT;
00168       }
00169     }
00170
00171     // Open the rowset using ::Execute
00172     // ppRowset buffer.
00173     if( ppRowset )
00174     {
00175       hr = pICmdText->Execute(pUnkOuter, riid, NULL, NULL, ppRowset);
00176
00177       // Sample Provider's property handling is simplistic.
00178       // All property errors should have been caught by the previous
00179       // call to ::SetProperties.
00180       // Assume that a failure was caused by something other
00181       // than bad properties.
00182       // So, no need for property post-processing
00183     }
00184   }
00185
00186 EXIT:
00187   if( pICmdText )
00188     pICmdText->Release();
00189   if( pICmdProp )
00190     pICmdProp->Release();
00191
00192   // DB_S_ERRORSOCCURRED must take precedence over DB_S_NOTSINGLETON
00193   return (hr == S_OK || hr == DB_S_NOTSINGLETON) ? hrProp : hr;
00194 }
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenuex/contextmenuex.cpp Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenuex

contextmenuex.cpp

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014
00015 #include "Globals.h"
00016 #include "ContextMenuEx.h"
00017 #include "Resource.h"
00018
00019                              // Tracing stuff
00020 #include "TraceMacro.h"
00021 #undef  MODULESTRING
00022 #define MODULESTRING  _T("CExtendContextMenuEx")
00023
00024 /////////////////////////////////////////////////////////////////////////////
00025 //  Implementation of IUnknown
00026
00027 //---------------------------------------------------------------------------
00028 // MMC will only QI for IExtendContextMenu in an extension.
00029 //
00030 STDMETHODIMP CExtendContextMenuEx::QueryInterface
00031 (
00032   REFIID   riid,       //[in] Identifier of the requested interface
00033   LPVOID   *ppv        //[out] Address of requested interface
00034 )
00035 {
00036   if( !ppv )
00037     return E_FAIL;
00038
00039   *ppv = NULL;
00040
00041   if( IsEqualIID(riid, IID_IUnknown) )
00042     *ppv = static_cast<IExtendContextMenu*>(this);
00043   else if( IsEqualIID(riid, IID_IExtendContextMenu) )
00044     *ppv = static_cast<IExtendContextMenu*>(this);
00045
00046
00047   if( *ppv )
00048   {
00049     reinterpret_cast<IUnknown*>(*ppv)->AddRef();
00050     return S_OK;
00051   }
00052
00053   return E_NOINTERFACE;
00054 }
00055
00056 //---------------------------------------------------------------------------
00057 STDMETHODIMP_(ULONG) CExtendContextMenuEx::AddRef()
00058 {
00059   return InterlockedIncrement((LONG*)&m_cRef);
00060 }
00061
00062 //---------------------------------------------------------------------------
00063 STDMETHODIMP_(ULONG) CExtendContextMenuEx::Release()
00064 {
00065   if( InterlockedDecrement((LONG*)&m_cRef) == 0 )
00066   {
00067     delete this;
00068     return 0;
00069   }
00070   return m_cRef;
00071 }
00072
00073 /////////////////////////////////////////////////////////////////////////////
00074 //  Construction-Destruction
00075
00076 //---------------------------------------------------------------------------
00077 CExtendContextMenuEx::CExtendContextMenuEx()
00078 {
00079   InterlockedIncrement((long*)&g_uObjectCount);
00080
00081   m_cRef = 0;
00082
00083   TRACE_START(_T("New instance of CExtendContextMenuEx") );
00084 }
00085
00086 //---------------------------------------------------------------------------
00087 CExtendContextMenuEx::~CExtendContextMenuEx()
00088 {
00089   InterlockedDecrement((long*)&g_uObjectCount);
00090 }
00091
00092
00093 /////////////////////////////////////////////////////////////////////////////
00094 //  IExtendContextMenu
00095
00096 //---------------------------------------------------------------------------
00097 //  Devices can only add a folder
00098 //
00099 HRESULT CExtendContextMenuEx::AddMenuItems
00100 (
00101   LPDATAOBJECT ipDataObject,         //[in] Data object
00102   LPCONTEXTMENUCALLBACK ipCallback,  //[in] Pointer to an IContextMenuCallback
00103   long __RPC_FAR* pInsertionAllowed  //[in-out] Insertion flags
00104 )
00105 {
00106   _ASSERT( NULL != ipCallback );
00107   HRESULT hResult = S_FALSE;
00108
00109   static CONTEXTMENUITEM ctxMenu;
00110     ctxMenu.lCommandID        = IDM_QUERY_ATTRIBS;
00111     ctxMenu.lInsertionPointID = CCM_INSERTIONPOINTID_3RDPARTY_TASK;
00112     ctxMenu.fFlags            = 0;
00113     ctxMenu.fSpecialFlags     = 0;
00114     ctxMenu.strName           = L"Query Attributes";
00115     ctxMenu.strStatusBarText  = L"Query Device Attributes";
00116
00117
00118   // Add the Query item to the Task menu if allowed...
00119   if( CCM_INSERTIONALLOWED_TASK & *pInsertionAllowed )
00120   {
00121     hResult = ipCallback->AddItem( &ctxMenu );
00122   }
00123
00124   return hResult;
00125 }
00126
00127 //---------------------------------------------------------------------------
00128 HRESULT CExtendContextMenuEx::Command
00129 (
00130   long lCommandID,          //[in] Indentifier for menu ID
00131   LPDATAOBJECT ipDataObject
00132 )
00133 {
00134   HRESULT hResult = S_OK;
00135
00136   switch( lCommandID )
00137   {
00138     case IDM_QUERY_ATTRIBS:
00139     {
00140       MsgBox( _T("New Queries not supported"), _T("Test") );
00141       break;
00142     }
00143     default:
00144       hResult = S_FALSE;
00145       break;
00146
00147   }
00148   return hResult;
00149 }
00150
00151
00152 /////////////////////////////////////////////////////////////////////////////
00153 //  Private methods
00154
00155
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Input/Ime/MultiUI/Data.C Source File

  • WinUI
  • Input
  • Ime
  • MultiUI

Data.C

Go to the documentation of this file.
00001 /**********************************************************************/
00002 /*                                                                    */
00003 /*      DATA.C                                                        */
00004 /*                                                                    */
00005 /*      Copyright (c) 1995 - 2000  Microsoft Corporation              */
00006 /*                                                                    */
00007 /**********************************************************************/
00008
00009 #include <windows.h>
00010 #include <imm.h>
00011 #include "resource.h"
00012
00013 HANDLE hInst;
00014 HWND hWndMain;
00015
00016 HWND hWndDef1;
00017 HWND hWndDef2;
00018 HWND hWndIMC1;
00019 HWND hWndIMC2;
00020 HWND hWndIMCUI1;
00021 HWND hWndIMCUI2;
00022
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAgentCtlBalloonEx Member List

This is the complete list of members for CAgentCtlBalloonEx, including all inherited members.
CAgentCtlBalloonEx() | CAgentCtlBalloonEx | [inline]
CAgentCtlBalloonEx(LPDISPATCH pDispatch) | CAgentCtlBalloonEx | [inline]
CAgentCtlBalloonEx(const CAgentCtlBalloonEx &dispatchSrc) | CAgentCtlBalloonEx | [inline]
GetBackColor() | CAgentCtlBalloonEx |
GetBorderColor() | CAgentCtlBalloonEx |
GetCharsPerLine() | CAgentCtlBalloonEx |
GetEnabled() | CAgentCtlBalloonEx |
GetFontBold() | CAgentCtlBalloonEx |
GetFontCharSet() | CAgentCtlBalloonEx |
GetFontItalic() | CAgentCtlBalloonEx |
GetFontName() | CAgentCtlBalloonEx |
GetFontSize() | CAgentCtlBalloonEx |
GetFontStrikethru() | CAgentCtlBalloonEx |
GetFontUnderline() | CAgentCtlBalloonEx |
GetForeColor() | CAgentCtlBalloonEx |
GetNumberOfLines() | CAgentCtlBalloonEx |
GetStyle() | CAgentCtlBalloonEx |
GetVisible() | CAgentCtlBalloonEx |
SetFontCharSet(short nNewValue) | CAgentCtlBalloonEx |
SetFontName(LPCTSTR lpszNewValue) | CAgentCtlBalloonEx |
SetFontSize(long nNewValue) | CAgentCtlBalloonEx |
SetStyle(long nNewValue) | CAgentCtlBalloonEx |
SetVisible(BOOL bNewValue) | CAgentCtlBalloonEx |
Generated on Wed Nov 13 2024 16:55:31 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/CertServices/Encode/ADate.Cpp Source File

  • Security
  • CertServices
  • Encode

ADate.Cpp

Go to the documentation of this file.
00001 //+--------------------------------------------------------------------------
00002 //
00003 // Microsoft Windows
00004 // Copyright (C) Microsoft Corporation, 1996 - 2000
00005 //
00006 // File:        adate.cpp
00007 //
00008 // Contents:    Cert Server Extension Encoding/Decoding implementation
00009 //
00010 //---------------------------------------------------------------------------
00011
00012 #include "pch.cpp"
00013
00014 #pragma hdrstop
00015
00016 #include <assert.h>
00017 #include "resource.h"
00018 #include "adate.h"
00019 #include "celib.h"
00020
00021
00022 //+--------------------------------------------------------------------------
00023 // CCertEncodeDateArray::~CCertEncodeDateArray -- destructor
00024 //
00025 // free memory associated with this instance
00026 //+--------------------------------------------------------------------------
00027
00028 CCertEncodeDateArray::~CCertEncodeDateArray()
00029 {
00030     _Cleanup();
00031 }
00032
00033
00034 //+--------------------------------------------------------------------------
00035 // CCertEncodeDateArray::_Cleanup -- release all resources
00036 //
00037 // free memory associated with this instance
00038 //+--------------------------------------------------------------------------
00039
00040 VOID
00041 CCertEncodeDateArray::_Cleanup()
00042 {
00043     if (NULL != m_aValue)
00044     {
00045   LocalFree(m_aValue);
00046   m_aValue = NULL;
00047     }
00048     m_cValue = 0;
00049     m_cValuesSet = 0;
00050     m_fConstructing = FALSE;
00051 }
00052
00053
00054 //+--------------------------------------------------------------------------
00055 // CCertEncodeDateArray::Decode -- Decode DateArray
00056 //
00057 // Returns S_OK on success.
00058 //+--------------------------------------------------------------------------
00059
00060 STDMETHODIMP
00061 CCertEncodeDateArray::Decode(
00062     /* [in] */ BSTR const strBinary)
00063 {
00064     HRESULT hr = S_OK;
00065     CRYPT_SEQUENCE_OF_ANY *pSequence = NULL;
00066     DWORD cbSequence;
00067     LONG i;
00068
00069     _Cleanup();
00070
00071     if (NULL == strBinary)
00072     {
00073   hr = E_POINTER;
00074   ceERRORPRINTLINE("NULL parm", hr);
00075   goto error;
00076     }
00077
00078     // Decode to an array of ASN blobs:
00079
00080     if (!ceDecodeObject(
00081         X509_ASN_ENCODING,
00082         X509_SEQUENCE_OF_ANY,
00083         (BYTE *) strBinary,
00084         SysStringByteLen(strBinary),
00085         FALSE,
00086         (VOID **) &pSequence,
00087         &cbSequence))
00088     {
00089   hr = ceHLastError();
00090   ceERRORPRINTLINE("ceDecodeObject", hr);
00091   goto error;
00092     }
00093
00094     m_cValue = pSequence->cValue;
00095     m_aValue = (DATE *) LocalAlloc(LMEM_FIXED, m_cValue * sizeof(m_aValue[0]));
00096     if (NULL == m_aValue)
00097     {
00098   hr = E_OUTOFMEMORY;
00099   ceERRORPRINTLINE("LocalAlloc", hr);
00100   goto error;
00101     }
00102     for (i = 0; i < m_cValue; i++)
00103     {
00104   DWORD cb;
00105   FILETIME ft;
00106
00107   // Decode each ASN blob to a FILETIME:
00108
00109   cb = sizeof(ft);
00110   if (!CryptDecodeObject(
00111       X509_ASN_ENCODING,
00112       X509_CHOICE_OF_TIME,
00113       pSequence->rgValue[i].pbData,
00114       pSequence->rgValue[i].cbData,
00115       0,                  // dwFlags
00116       &ft,
00117       &cb))
00118   {
00119       hr = ceHLastError();
00120       ceERRORPRINTLINE("CryptDecodeObject", hr);
00121       goto error;
00122   }
00123   assert(sizeof(ft) == cb);
00124
00125   // Convert each FILETIME into a DATE:
00126
00127   hr = ceFileTimeToDate(&ft, &m_aValue[i]);
00128   if (S_OK != hr)
00129   {
00130       ceERRORPRINTLINE("ceFileTimeToDate", hr);
00131       _Cleanup();
00132       goto error;
00133   }
00134     }
00135
00136 error:
00137     if (NULL != pSequence)
00138     {
00139   LocalFree(pSequence);
00140     }
00141     if (S_OK != hr)
00142     {
00143   _Cleanup();
00144     }
00145     return(_SetErrorInfo(hr, L"CCertEncodeDateArray::Decode"));
00146 }
00147
00148
00149 //+--------------------------------------------------------------------------
00150 // CCertEncodeDateArray::GetCount -- Get Array count
00151 //
00152 // Returns S_OK on success.
00153 //+--------------------------------------------------------------------------
00154
00155 STDMETHODIMP
00156 CCertEncodeDateArray::GetCount(
00157     /* [out, retval] */ LONG __RPC_FAR *pCount)
00158 {
00159     HRESULT hr = S_OK;
00160
00161     if (NULL == pCount)
00162     {
00163   hr = E_POINTER;
00164   ceERRORPRINTLINE("NULL parm", hr);
00165   goto error;
00166     }
00167     if (NULL == m_aValue)
00168     {
00169   hr = E_INVALIDARG;
00170   ceERRORPRINTLINE("bad parameter", hr);
00171   goto error;
00172     }
00173     *pCount = m_cValue;
00174 error:
00175     return(_SetErrorInfo(hr, L"CCertEncodeDateArray::GetCount"));
00176 }
00177
00178
00179 //+--------------------------------------------------------------------------
00180 // CCertEncodeDateArray::GetValue -- Fetch the indexed date
00181 //
00182 // Returns S_OK on success.
00183 //+--------------------------------------------------------------------------
00184
00185 STDMETHODIMP
00186 CCertEncodeDateArray::GetValue(
00187     /* [in] */ LONG Index,
00188     /* [out, retval] */ DATE __RPC_FAR *pValue)
00189 {
00190     HRESULT hr = S_OK;
00191
00192     if (NULL == pValue)
00193     {
00194   hr = E_POINTER;
00195   ceERRORPRINTLINE("NULL parm", hr);
00196   goto error;
00197     }
00198     if (NULL == m_aValue || Index >= m_cValue)
00199     {
00200   hr = E_INVALIDARG;
00201   ceERRORPRINTLINE("bad parameter", hr);
00202   goto error;
00203     }
00204     if (0 == m_aValue[Index])
00205     {
00206   hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
00207   ceERRORPRINTLINE("uninitialized", hr);
00208   goto error;
00209     }
00210     *pValue = m_aValue[Index];
00211
00212 error:
00213     return(_SetErrorInfo(hr, L"CCertEncodeDateArray::GetValue"));
00214 }
00215
00216
00217 //+--------------------------------------------------------------------------
00218 // CCertEncodeDateArray::Reset -- clear out data, and set up to encode new data
00219 //
00220 // Returns S_OK on success.
00221 //+--------------------------------------------------------------------------
00222
00223 STDMETHODIMP
00224 CCertEncodeDateArray::Reset(
00225     /* [in] */ LONG Count)
00226 {
00227     HRESULT hr = S_OK;
00228
00229     _Cleanup();
00230     m_fConstructing = TRUE;
00231     if (CENCODEMAX < Count || 0 > Count)
00232     {
00233   hr = E_INVALIDARG;
00234   ceERRORPRINTLINE("bad count parameter", hr);
00235   goto error;
00236     }
00237     m_aValue = (DATE *) LocalAlloc(
00238         LMEM_FIXED | LMEM_ZEROINIT,
00239         Count * sizeof(m_aValue[0]));
00240     if (NULL == m_aValue)
00241     {
00242   hr = E_OUTOFMEMORY;
00243   ceERRORPRINTLINE("LocalAlloc", hr);
00244   goto error;
00245     }
00246     m_cValue = Count;
00247
00248 error:
00249     return(_SetErrorInfo(hr, L"CCertEncodeDateArray::Reset"));
00250 }
00251
00252
00253 //+--------------------------------------------------------------------------
00254 // CCertEncodeDateArray::SetValue -- Set an array date
00255 //
00256 // Returns S_OK on success.
00257 //+--------------------------------------------------------------------------
00258
00259 STDMETHODIMP
00260 CCertEncodeDateArray::SetValue(
00261     /* [in] */ LONG Index,
00262     /* [in] */ DATE Value)
00263 {
00264     HRESULT hr = S_OK;
00265
00266     if (!m_fConstructing ||
00267   NULL == m_aValue ||
00268   Index >= m_cValue ||
00269   m_cValuesSet >= m_cValue ||
00270   0 != m_aValue[Index] ||
00271   0 == Value)
00272     {
00273   hr = E_INVALIDARG;
00274   ceERRORPRINTLINE("bad parameter", hr);
00275   goto error;
00276     }
00277     m_aValue[Index] = Value;
00278     m_cValuesSet++;
00279
00280 error:
00281     return(_SetErrorInfo(hr, L"CCertEncodeDateArray::SetValue"));
00282 }
00283
00284
00285 //+--------------------------------------------------------------------------
00286 // CCertEncodeDateArray::Encode -- Encode DateArray
00287 //
00288 // Returns S_OK on success.
00289 //+--------------------------------------------------------------------------
00290
00291 STDMETHODIMP
00292 CCertEncodeDateArray::Encode(
00293     /* [out, retval] */ BSTR __RPC_FAR *pstrBinary)
00294 {
00295     HRESULT hr = S_OK;
00296     LONG i;
00297     CRYPT_SEQUENCE_OF_ANY Sequence;
00298     BYTE *pbEncoded = NULL;
00299     DWORD cbEncoded;
00300
00301     Sequence.cValue = 0;
00302     Sequence.rgValue = NULL;
00303
00304     if (NULL == pstrBinary)
00305     {
00306   hr = E_POINTER;
00307   ceERRORPRINTLINE("NULL parm", hr);
00308   goto error;
00309     }
00310     ceFreeBstr(pstrBinary);
00311     if (!m_fConstructing || NULL == m_aValue)
00312     {
00313   hr = E_INVALIDARG;
00314   ceERRORPRINTLINE("bad parameter", hr);
00315   goto error;
00316     }
00317     if (m_cValuesSet != m_cValue)
00318     {
00319   hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
00320   ceERRORPRINTLINE("m_cValuesSet", hr);
00321   goto error;
00322     }
00323
00324     Sequence.rgValue = (CRYPT_DER_BLOB *) LocalAlloc(
00325             LMEM_FIXED,
00326             m_cValue * sizeof(Sequence.rgValue[0]));
00327     if (NULL == Sequence.rgValue)
00328     {
00329   hr = E_OUTOFMEMORY;
00330   ceERRORPRINTLINE("LocalAlloc", hr);
00331   goto error;
00332     }
00333
00334     for (i = 0; i < m_cValue; i++)
00335     {
00336   FILETIME ft;
00337
00338   // Convert each DATE into a FILETIME:
00339
00340   assert(0 != m_aValue[i]);
00341   hr = ceDateToFileTime(&m_aValue[i], &ft);
00342   if (S_OK != hr)
00343   {
00344       ceERRORPRINTLINE("ceDateToFileTime", hr);
00345       goto error;
00346   }
00347
00348   // Encode each FILETIME into an ASN blob:
00349
00350   if (!ceEncodeObject(
00351       X509_ASN_ENCODING,
00352       X509_CHOICE_OF_TIME,
00353       &ft,
00354       0,
00355       FALSE,
00356       &Sequence.rgValue[i].pbData,
00357       &Sequence.rgValue[i].cbData))
00358   {
00359       hr = ceHLastError();
00360       ceERRORPRINTLINE("ceEncodeObject", hr);
00361       goto error;
00362   }
00363   Sequence.cValue++;
00364     }
00365     assert((LONG) Sequence.cValue == m_cValue);
00366
00367     // Encode the array of ASN blob:
00368
00369     if (!ceEncodeObject(
00370         X509_ASN_ENCODING,
00371         X509_SEQUENCE_OF_ANY,
00372         &Sequence,
00373         0,
00374         FALSE,
00375         &pbEncoded,
00376         &cbEncoded))
00377     {
00378   hr = ceHLastError();
00379   ceERRORPRINTLINE("ceEncodeObject", hr);
00380   goto error;
00381     }
00382     if (!ceConvertWszToBstr(
00383       pstrBinary,
00384       (WCHAR const *) pbEncoded,
00385       cbEncoded))
00386     {
00387   hr = E_OUTOFMEMORY;
00388   ceERRORPRINTLINE("ceConvertWszToBstr", hr);
00389   goto error;
00390     }
00391
00392 error:
00393     if (NULL != pbEncoded)
00394     {
00395   LocalFree(pbEncoded);
00396     }
00397     if (NULL != Sequence.rgValue)
00398     {
00399   assert((LONG) Sequence.cValue <= m_cValue);
00400   for (i = 0; i < (LONG) Sequence.cValue; i++)
00401   {
00402       assert(NULL != Sequence.rgValue[i].pbData);
00403       LocalFree(Sequence.rgValue[i].pbData);
00404   }
00405   LocalFree(Sequence.rgValue);
00406     }
00407     return(_SetErrorInfo(hr, L"CCertEncodeDateArray::Encode"));
00408 }
00409
00410
00411 //+--------------------------------------------------------------------------
00412 // CCertEncodeDateArray::_SetErrorInfo -- set error object information
00413 //
00414 // Returns passed HRESULT
00415 //+--------------------------------------------------------------------------
00416
00417 HRESULT
00418 CCertEncodeDateArray::_SetErrorInfo(
00419     IN HRESULT hrError,
00420     IN WCHAR const *pwszDescription)
00421 {
00422     assert(FAILED(hrError) || S_OK == hrError || S_FALSE == hrError);
00423     if (FAILED(hrError))
00424     {
00425   HRESULT hr;
00426
00427   hr = ceDispatchSetErrorInfo(
00428           hrError,
00429           pwszDescription,
00430           wszCLASS_CERTENCODEDATEARRAY,
00431           &IID_ICertEncodeDateArray);
00432   assert(hr == hrError);
00433     }
00434     return(hrError);
00435 }
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/RPC/FileRep/FileRepAsyncPipe/Resources.h Source File

  • NetDS
  • RPC
  • FileRep
  • FileRepAsyncPipe

Resources.h

Go to the documentation of this file.
00001 /*
00002     Copyright Microsoft Corp. 1992 - 2001
00003
00004     FILE: Resources.h
00005
00006     PURPOSE: Declarations for resource management routines and
00007         data structures.
00008
00009 */
00010 #pragma once
00011
00012 typedef struct {
00013     LONG Value;
00014     LONG Bound;
00015 } Counter;
00016
00017 /*
00018     FUNCTION: CounterCreate
00019
00020     PURPOSE: Creates a counter.
00021
00022 */
00023 Counter * CounterCreate(UINT Bound);
00024
00025 /*
00026     FUNCTION: CounterDelete
00027
00028     PURPOSE: Deletes a counter.
00029
00030 */
00031 VOID CounterDelete(Counter * pCounter);
00032
00033 /*
00034     FUNCTION: CounterIncrement
00035
00036     PURPOSE: Attempts to increment a counter.  If the
00037         incremented value is aboove the corresponding bound, does not
00038         increment and returns FALSE, otherwise increments and returns
00039         TRUE.
00040
00041     RETURN VALUE:
00042         TRUE - icremented
00043         FALSE - not incremented, bound exceeded
00044
00045     COMMENTS:
00046
00047 */
00048 BOOL CounterIncrement(Counter *pCounter);
00049
00050 /*
00051     FUNCTION: CounterDecrement
00052
00053     PURPOSE: Decrements a couner.
00054
00055     RETURN VALUE: none
00056
00057     COMMENTS:
00058
00059 */
00060 VOID CounterDecrement(Counter *pCounter);
00061
00062 /*
00063     FUNCTION: CountersCreate
00064
00065     PURPOSE: Creates nCounters counters that can be used to keep track of
00066         the resource use by several users or user groups and returns a
00067         pointer to the structure containing them.
00068
00069     PARAMETERS:
00070         Counters - Array of pointers to counters.  It
00071       is allocate dwithin this call and needs to be freed
00072       with the call to CountersDelete.
00073         nCounters - number of counters to create.
00074         Bounds - array of bound values.
00075
00076     RETURN VALUE:
00077         Pointer to the Counterst structure.
00078
00079     COMMENTS:
00080
00081 */
00082 BOOL CountersCreate(Counter *Counters[], UINT nCounters, UINT * Bounds);
00083
00084 /*
00085     FUNCTION: CountersDelete
00086
00087     PURPOSE: Deallocates an array of counter pointers
00088       and all the counters in it.
00089
00090     RETURN VALUE:
00091       TRUE - success
00092       FALSE - failure
00093
00094     COMMENTS:
00095
00096 */
00097 VOID CountersDelete(Counter *pCounters[], UINT n);
00098
00099 /*
00100     FUNCTION: CountersCheckForNonzero
00101
00102     PURPOSE: Checks if any counter in the array
00103       is nonzero.
00104
00105     PARAMETERS: none
00106
00107     RETURN VALUE:
00108       TRUE - some counter is nonzero
00109       FALSE - otherwise
00110
00111     COMMENTS: This function is not thread-safe.
00112
00113 */
00114 BOOL CountersCheckForNonzero(Counter *pCounters[], UINT n);
00115
00116 typedef struct _QueueNode {
00117     VOID *pData;
00118     _QueueNode *pNext;
00119 } QueueNode;
00120
00121 typedef struct {
00122     QueueNode *pFirst;
00123     QueueNode *pLast;
00124     LPCRITICAL_SECTION lpCriticalSection;
00125 } Queue;
00126
00127 /*
00128     FUNCTION: QueueCreate
00129
00130     PURPOSE: Creates a queue.
00131
00132 */
00133 Queue * QueueCreate(BOOL NoCritSec);
00134
00135 /*
00136     FUNCTION: QueueDelete
00137
00138     PURPOSE: Deletes a queue.
00139
00140     NOTE: It will deallocate all node data and all nodes if the
00141     queue is not empty.  No error checks are performed.
00142 */
00143 VOID QueueDelete(Queue * pQueue);
00144
00145 /*
00146     FUNCTION: QueueisEmpty
00147
00148     PURPOSE: Returns TRUE if a queue has an elt. in it and false
00149     otherwise.
00150
00151 */
00152 BOOL QueueIsEmpty(Queue * pQueue);
00153
00154 /*
00155     FUNCTION: QueueAdd
00156
00157     PURPOSE: Adds an element to the queue.
00158
00159 */
00160 VOID QueueAdd(Queue *pQueue, VOID *pData, BOOL EnterCritSec);
00161
00162 /*
00163     FUNCTION: QueueRemove
00164
00165     PURPOSE: Removes an element from the queue.
00166
00167 */
00168 VOID * QueueRemove(Queue *pQueue);
00169
00170 /*
00171     FUNCTION: QueueRemoveData
00172
00173     PURPOSE: Removes an element from the queue with a given data filed.
00174
00175 */
00176 VOID * QueueRemoveData(Queue *pQueue, VOID *pData);
00177
00178 /*
00179     FUNCTION: QueueMoveToBackNoLock
00180
00181     PURPOSE: Moves an element to the back of the queue.
00182
00183     COMMENTS:
00184
00185 */
00186 VOID QueueMoveToBack(Queue *pQueue, QueueNode *pNode, QueueNode *pPrevNode);
00187
00188 /*
00189     FUNCTION: QueuesCreate
00190
00191     PURPOSE: Creates new queues for an array of pointers to queues.
00192
00193     RETURN VALUE:
00194       TRUE - success
00195       FALSE - failure
00196
00197     COMMENTS:
00198
00199 */
00200 BOOL QueuesCreate(Queue *Queues[], UINT n, BOOL NoCritSec);
00201
00202 /*
00203     FUNCTION: QueuesDelete
00204
00205     PURPOSE: Deletes all queues with addresses in an array of pointers
00206     to queues.
00207
00208 */
00209 VOID QueuesDelete(Queue *Queues[], UINT n);
00210
00211 typedef struct _QueueHashNode {
00212     VOID *pKey;
00213     VOID *pValue;
00214 } QueueHashNode;
00215
00216 /*
00217     FUNCTION: QueueHashAdd
00218
00219     PURPOSE: Adds an element to the hash.
00220
00221     PARAMETERS:
00222       pQueue - The queue of QueuehashNodes
00223       Sid - Sid for the user for whom we create a node
00224       pValue - Value associated with the Sid
00225
00226 */
00227 VOID QueueHashAdd(Queue *pQueue, PSID Sid, VOID *pValue, BOOL EnterCritSec);
00228
00229 /*
00230     FUNCTION: QueueHashLookup
00231
00232     PURPOSE: Returns the element of the hash queue that
00233     corresponds to a given Sid.
00234
00235 */
00236 VOID * QueueHashLookup(Queue *pQueue, PSID Sid, BOOL EnterCritSec);
00237
00238 /*
00239     FUNCTION: QueueHashAddToSubqueue
00240
00241     PURPOSE: The function assumes that values in the
00242     hash are queues.  It checks if a queue for SID pSID
00243     already exists, and if necessary creates a new queue
00244     for the SID.  It then adds the Data to the queue
00245     corresponding to a SID.
00246
00247 */
00248 VOID QueueHashAddToSubqueue(Queue *pHashQueue, PSID pSID, VOID * pData);
00249
00250 /*
00251     FUNCTION: QueueHashRemoveFromSubqueue
00252
00253     PURPOSE: The function assumes that values in the
00254     hash are queues.  It removes an element from the
00255     first nonempty queue that it can find and puts
00256     that queue into the end of the hash queue.
00257
00258 */
00259 VOID * QueueHashRemoveFromSubqueue(Queue *pQueue);
00260
00261 /*
00262     FUNCTION: QueueHashIncrementCounter
00263
00264     PURPOSE: The function assumes that values in the
00265     hash are counters.  It checks if a counter for SID pSID
00266     already exists, and if necessary creates a new counter
00267     for the SID.  It then attempts to increment that counter.
00268
00269 */
00270 BOOL QueueHashIncrementCounter(Queue *pHashQueue, PSID pSID);
00271
00272 /*
00273     FUNCTION: QueueHashDecrementCounter
00274
00275     PURPOSE: The function assumes that values in the
00276     hash are counters.  It checks if a counter for SID pSID
00277     already exists, and if necessary creates a new counter
00278     for the SID.  It then decrements that counter.
00279
00280 */
00281 VOID QueueHashDecrementCounter(Queue *pQueue, PSID pSID);
00282
00283 // end Resources.h
Generated on Wed Nov 13 2024 16:52:20 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/ActiveDocument/DoServer/OLEDocVw.Cpp Source File

  • Com
  • Fundamentals
  • ActiveDocument
  • DoServer

OLEDocVw.Cpp

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017
00018 /**************************************************************************
00019
00020   File:          OleDocVw.cpp
00021
00022   Description:   COleDocumentView implementation.
00023
00024 **************************************************************************/
00025
00026 /**************************************************************************
00027 #include statements
00028 **************************************************************************/
00029
00030 #include "OleDocVw.h"
00031 #include <windowsx.h>
00032
00033 /**************************************************************************
00034
00035   COleDocumentView::COleDocumentView()
00036
00037 **************************************************************************/
00038
00039 COleDocumentView::COleDocumentView(COleDocument *pOleDoc)
00040 {
00041   OutputDebugString(TEXT("COleDocumentView's constructor\n"));
00042
00043   m_fInPlaceActive = FALSE;
00044   m_fUIActive = FALSE;
00045   m_hOleMenu = NULL;
00046   m_hSharedMenu = NULL;
00047   m_hwndView = NULL;
00048   m_pInPlaceFrame = NULL;
00049   m_pInPlaceSite = NULL;
00050   m_pInPlaceUIWindow = NULL;
00051
00052   m_pOleDoc = pOleDoc;
00053
00054   CreateViewWindow();
00055 }
00056
00057 /**************************************************************************
00058
00059   COleDocumentView::~COleDocumentView()
00060
00061 **************************************************************************/
00062
00063 COleDocumentView::~COleDocumentView()
00064 {
00065   OutputDebugString(TEXT("COleDocumentView's destructor\n"));
00066
00067   if(m_pInPlaceFrame)
00068     m_pInPlaceFrame->Release();
00069
00070   if(m_pInPlaceUIWindow)
00071     m_pInPlaceUIWindow->Release();
00072
00073   if(m_pInPlaceSite)
00074     m_pInPlaceSite->Release();
00075 }
00076
00077 ///////////////////////////////////////////////////////////////////////////
00078 //
00079 // IUnknown Implementation
00080 //
00081
00082 /**************************************************************************
00083
00084   COleDocumentView::QueryInterface
00085
00086 **************************************************************************/
00087
00088 STDMETHODIMP COleDocumentView::QueryInterface(  REFIID riid,
00089                         LPVOID *ppReturn)
00090 {
00091   OutputDebugString(TEXT("COleDocumentView::QueryInterface\n"));
00092
00093   return m_pOleDoc->QueryInterface(riid, ppReturn);
00094 }
00095
00096 /**************************************************************************
00097
00098   COleDocumentView::AddRef
00099
00100 **************************************************************************/
00101
00102 STDMETHODIMP_(DWORD) COleDocumentView::AddRef()
00103 {
00104   OutputDebugString(TEXT("COleDocumentView::AddRef\n"));
00105
00106   return m_pOleDoc->AddRef();
00107 }
00108
00109
00110 /**************************************************************************
00111
00112   COleDocumentView::Release
00113
00114 **************************************************************************/
00115
00116 STDMETHODIMP_(DWORD) COleDocumentView::Release()
00117 {
00118   OutputDebugString(TEXT("COleDocumentView::Release\n"));
00119
00120   return m_pOleDoc->Release();
00121 }
00122
00123 /**************************************************************************
00124
00125   COleDocumentView::SetInPlaceSite()
00126
00127 **************************************************************************/
00128
00129 STDMETHODIMP COleDocumentView::SetInPlaceSite(IOleInPlaceSite *pNewSite)
00130 {
00131   OutputDebugString(TEXT("COleDocumentView::SetInPlaceSite\n"));
00132
00133   //clean up previous site if it exists
00134   if(m_pInPlaceSite)
00135   {
00136     if(m_fUIActive)
00137     {
00138       DeactivateUI();
00139     }
00140
00141     if(m_fInPlaceActive)
00142     {
00143       DeactivateInPlace();
00144     }
00145
00146     if(m_pInPlaceFrame)
00147     {
00148       m_pInPlaceFrame->Release();
00149       m_pInPlaceFrame = NULL;
00150     }
00151
00152     if(m_pInPlaceUIWindow)
00153     {
00154       m_pInPlaceUIWindow->Release();
00155       m_pInPlaceUIWindow = NULL;
00156     }
00157
00158     m_pInPlaceSite->Release();
00159     m_pInPlaceSite = NULL;
00160   }
00161
00162   m_pInPlaceSite = pNewSite;
00163
00164   if(m_pInPlaceSite)
00165   {
00166     m_pInPlaceSite->AddRef();
00167
00168     RECT  rcClip;
00169
00170     m_FrameInfo.cb = sizeof(m_FrameInfo);
00171
00172     m_pInPlaceSite->GetWindowContext(   &m_pInPlaceFrame,
00173       &m_pInPlaceUIWindow,
00174       &m_Rect,
00175       &rcClip,
00176       &m_FrameInfo);
00177   }
00178
00179   return S_OK;
00180 }
00181
00182 /**************************************************************************
00183
00184   COleDocumentView::GetInPlaceSite()
00185
00186 **************************************************************************/
00187
00188 STDMETHODIMP COleDocumentView::GetInPlaceSite(IOleInPlaceSite **ppInPlaceSite)
00189 {
00190   OutputDebugString(TEXT("COleDocumentView::GetInPlaceSite\n"));
00191
00192   HRESULT  hr = E_FAIL;
00193
00194   *ppInPlaceSite = m_pInPlaceSite;
00195
00196   if(*ppInPlaceSite)
00197   {
00198     (*ppInPlaceSite)->AddRef();
00199     hr = S_OK;
00200   }
00201
00202   return hr;
00203 }
00204
00205 /**************************************************************************
00206
00207   COleDocumentView::GetDocument()
00208
00209 **************************************************************************/
00210
00211 STDMETHODIMP COleDocumentView::GetDocument(IUnknown **ppUnk)
00212 {
00213   OutputDebugString(TEXT("COleDocumentView::GetDocument\n"));
00214
00215   *ppUnk = m_pOleDoc;
00216
00217   if(*ppUnk)
00218     (*ppUnk)->AddRef();
00219
00220   return S_OK;
00221 }
00222
00223 /**************************************************************************
00224
00225   COleDocumentView::SetRect()
00226
00227 **************************************************************************/
00228
00229 STDMETHODIMP COleDocumentView::SetRect(LPRECT pRect)
00230 {
00231   OutputDebugString(TEXT("COleDocumentView::SetRect - "));
00232
00233   if(!pRect)
00234     return E_INVALIDARG;
00235
00236   m_Rect = *pRect;
00237
00238   TCHAR szText[MAX_PATH];
00239   wsprintf(szText, TEXT("%d, %d, %d, %d\n"), m_Rect.left, m_Rect.top, m_Rect.right, m_Rect.bottom);
00240   OutputDebugString(szText);
00241
00242   MoveWindow(m_hwndView, m_Rect.left, m_Rect.top, m_Rect.right, m_Rect.bottom, TRUE);
00243
00244   return S_OK;
00245 }
00246
00247 /**************************************************************************
00248
00249   COleDocumentView::GetRect()
00250
00251 **************************************************************************/
00252
00253 STDMETHODIMP COleDocumentView::GetRect(LPRECT pRect)
00254 {
00255   OutputDebugString(TEXT("COleDocumentView::GetRect\n"));
00256
00257   if(!pRect)
00258     return E_INVALIDARG;
00259
00260   *pRect = m_Rect;
00261
00262   return S_OK;
00263 }
00264
00265 /**************************************************************************
00266
00267   COleDocumentView::SetRectComplex()
00268
00269 **************************************************************************/
00270
00271 STDMETHODIMP COleDocumentView::SetRectComplex(  LPRECT prcView,
00272                         LPRECT prcHScroll,
00273                         LPRECT prcVScroll,
00274                         LPRECT prcSizeBox)
00275 {
00276   UNREFERENCED_PARAMETER(prcSizeBox);
00277   UNREFERENCED_PARAMETER(prcVScroll);
00278   UNREFERENCED_PARAMETER(prcHScroll);
00279   UNREFERENCED_PARAMETER(prcView);
00280
00281   OutputDebugString(TEXT("COleDocumentView::SetRectComplex\n"));
00282
00283   return E_NOTIMPL;
00284 }
00285
00286 /**************************************************************************
00287
00288   COleDocumentView::Show()
00289
00290 **************************************************************************/
00291
00292 STDMETHODIMP COleDocumentView::Show(BOOL bShow)
00293 {
00294   OutputDebugString(TEXT("COleDocumentView::Show\n"));
00295
00296   if(bShow)
00297   {
00298     //if the object is not in-place active, make it that way
00299     if(!m_fInPlaceActive)
00300       ActivateInPlace();
00301
00302     //show the window
00303     BringWindowToTop(m_hwndView);
00304     ShowWindow(m_hwndView, SW_SHOW);
00305     UpdateWindow(m_hwndView);
00306   }
00307   else
00308   {
00309     //if the object is UI active, make remove that state
00310     if(m_fUIActive)
00311       DeactivateUI();
00312
00313     //hide the window
00314     ShowWindow(m_hwndView, SW_HIDE);
00315   }
00316
00317   return S_OK;
00318 }
00319
00320 /**************************************************************************
00321
00322   COleDocumentView::UIActivate()
00323
00324 **************************************************************************/
00325
00326 STDMETHODIMP COleDocumentView::UIActivate(BOOL bActivate)
00327 {
00328   OutputDebugString(TEXT("COleDocumentView::UIActivate\n"));
00329
00330   if(bActivate)
00331   {
00332     return ActivateUI();
00333   }
00334
00335   return DeactivateUI();
00336 }
00337
00338 /**************************************************************************
00339
00340   COleDocumentView::ActivateUI()
00341
00342 **************************************************************************/
00343
00344 STDMETHODIMP COleDocumentView::ActivateUI()
00345 {
00346   OutputDebugString(TEXT("COleDocumentView::ActivateUI\n"));
00347
00348   //set the active object
00349   //either one of these could be good
00350   if(m_pInPlaceFrame)
00351   {
00352     m_pInPlaceFrame->SetActiveObject(m_pOleDoc->m_pOleInPlaceActiveObject, NULL);
00353   }
00354
00355   if(m_pInPlaceUIWindow)
00356   {
00357     m_pInPlaceUIWindow->SetActiveObject(m_pOleDoc->m_pOleInPlaceActiveObject, NULL);
00358   }
00359
00360   if(m_pInPlaceSite)
00361   {
00362     m_fUIActive = TRUE;
00363
00364     ActivateInPlace();
00365
00366     m_pInPlaceSite->OnUIActivate();
00367
00368     MergeMenus();
00369
00370     SetFocus(m_hwndView);
00371   }
00372
00373   return S_OK;
00374 }
00375
00376 /**************************************************************************
00377
00378   COleDocumentView::DeactivateUI()
00379
00380 **************************************************************************/
00381
00382 STDMETHODIMP COleDocumentView::DeactivateUI()
00383 {
00384   OutputDebugString(TEXT("COleDocumentView::DeactivateUI\n"));
00385
00386   m_fUIActive = FALSE;
00387
00388   RemoveMenus();
00389
00390   //remove the active object
00391   //either one of these could be good
00392   if(m_pInPlaceFrame)
00393   {
00394     m_pInPlaceFrame->SetActiveObject(NULL, NULL);
00395   }
00396
00397   if(m_pInPlaceUIWindow)
00398   {
00399     m_pInPlaceUIWindow->SetActiveObject(NULL, NULL);
00400   }
00401
00402   if(m_pInPlaceSite)
00403   {
00404     m_pInPlaceSite->OnUIDeactivate(FALSE);
00405   }
00406
00407   return S_OK;
00408 }
00409
00410 /**************************************************************************
00411
00412   COleDocumentView::Open()
00413
00414 **************************************************************************/
00415
00416 STDMETHODIMP COleDocumentView::Open(void)
00417 {
00418   OutputDebugString(TEXT("COleDocumentView::Open\n"));
00419
00420   return S_OK;
00421 }
00422
00423 /**************************************************************************
00424
00425   COleDocumentView::CloseView()
00426
00427 **************************************************************************/
00428
00429 STDMETHODIMP COleDocumentView::CloseView(DWORD dwReserved)
00430 {
00431   UNREFERENCED_PARAMETER(dwReserved);
00432   OutputDebugString(TEXT("COleDocumentView::CloseView\n"));
00433
00434   SetInPlaceSite(NULL);
00435
00436   return S_OK;
00437 }
00438
00439 /**************************************************************************
00440
00441   COleDocumentView::SaveViewState()
00442
00443 **************************************************************************/
00444
00445 STDMETHODIMP COleDocumentView::SaveViewState(IStream *pStream)
00446 {
00447   UNREFERENCED_PARAMETER(pStream);
00448   OutputDebugString(TEXT("COleDocumentView::SaveViewState\n"));
00449
00450   return E_NOTIMPL;
00451 }
00452
00453 /**************************************************************************
00454
00455   COleDocumentView::ApplyViewState()
00456
00457 **************************************************************************/
00458
00459 STDMETHODIMP COleDocumentView::ApplyViewState(IStream *pStream)
00460 {
00461   UNREFERENCED_PARAMETER(pStream);
00462   OutputDebugString(TEXT("COleDocumentView::ApplyViewState\n"));
00463
00464   return E_NOTIMPL;
00465 }
00466
00467 /**************************************************************************
00468
00469   COleDocumentView::Clone()
00470
00471 **************************************************************************/
00472
00473 STDMETHODIMP COleDocumentView::Clone(IOleInPlaceSite *pIPSite, IOleDocumentView **ppView)
00474 {
00475   UNREFERENCED_PARAMETER(pIPSite);
00476   OutputDebugString(TEXT("COleDocumentView::Clone\n"));
00477
00478   *ppView = NULL;
00479
00480   return E_NOTIMPL;
00481 }
00482
00483 /**************************************************************************
00484
00485   COleDocumentView::ActivateInPlace()
00486
00487 **************************************************************************/
00488
00489 STDMETHODIMP COleDocumentView::ActivateInPlace()
00490 {
00491   OutputDebugString(TEXT("COleDocumentView::ActivateInPlace\n"));
00492
00493   m_fInPlaceActive = TRUE;
00494
00495   if(m_pInPlaceSite)
00496   {
00497     // tell the site we are in-place activating
00498     m_pInPlaceSite->OnInPlaceActivate();
00499
00500     HWND  hwndParent;
00501     m_pInPlaceSite->GetWindow(&hwndParent);
00502     SetParent(m_hwndView, hwndParent);
00503
00504     //show the view
00505     Show(TRUE);
00506   }
00507
00508   return S_OK;
00509 }
00510
00511 /**************************************************************************
00512
00513   COleDocumentView::DeactivateInPlace()
00514
00515 **************************************************************************/
00516
00517 STDMETHODIMP COleDocumentView::DeactivateInPlace()
00518 {
00519   OutputDebugString(TEXT("COleDocumentView::InPlaceDeactivate\n"));
00520
00521   //UI deactivate, if necessary and hide the view window
00522   Show(FALSE);
00523
00524   m_fInPlaceActive = FALSE;
00525
00526   if(m_pInPlaceSite)
00527   {
00528     // tell the site we are in-place deactivating
00529     m_pInPlaceSite->OnInPlaceDeactivate();
00530   }
00531
00532   //set the parent to NULL
00533   SetParent(m_hwndView, GetDesktopWindow());
00534
00535   return S_OK;
00536 }
00537
00538 /**************************************************************************
00539
00540   COleDocumentView::CreateDocWindow()
00541
00542 **************************************************************************/
00543
00544 STDMETHODIMP COleDocumentView::CreateViewWindow()
00545 {
00546   OutputDebugString(TEXT("COleDocumentView::CreateViewWindow\n"));
00547
00548   WNDCLASS wc;
00549
00550   //if our window class has not been registered, then do so
00551   if(!GetClassInfo(g_hInst, VIEW_CLASS_NAME, &wc))
00552   {
00553     ZeroMemory(&wc, sizeof(wc));
00554     wc.style          = CS_HREDRAW | CS_VREDRAW;
00555     wc.lpfnWndProc    = (WNDPROC)ViewWndProc;
00556     wc.cbClsExtra     = 0;
00557     wc.cbWndExtra     = 0;
00558     wc.hInstance      = g_hInst;
00559     wc.hIcon          = NULL;
00560     wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
00561     wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW + 1);
00562     wc.lpszMenuName   = NULL;
00563     wc.lpszClassName  = VIEW_CLASS_NAME;
00564
00565     if(!RegisterClass(&wc))
00566       return E_FAIL;
00567   }
00568
00569   m_hwndView = CreateWindowEx(  WS_EX_CLIENTEDGE,
00570     VIEW_CLASS_NAME,
00571     NULL,
00572     WS_CHILD | WS_CLIPSIBLINGS,
00573     0,
00574     0,
00575     0,
00576     0,
00577     GetDesktopWindow(),
00578     NULL,
00579     g_hInst,
00580     (LPVOID)this);
00581
00582   if(!m_hwndView)
00583   {
00584     return E_FAIL;
00585   }
00586
00587   return S_OK;
00588 }
00589
00590 /**************************************************************************
00591
00592   COleDocumentView::ViewWndProc()
00593
00594 **************************************************************************/
00595
00596 LRESULT CALLBACK COleDocumentView::ViewWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
00597 {
00598   COleDocumentView  *pThis = (COleDocumentView*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
00599
00600   switch (uMessage)
00601   {
00602   case WM_NCCREATE:
00603     {
00604       LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00605       pThis = (COleDocumentView*)(lpcs->lpCreateParams);
00606       SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pThis);
00607     }
00608     break;
00609
00610   case WM_CREATE:
00611     return pThis->OnCreate();
00612
00613   case WM_COMMAND:
00614     return pThis->OnCommand(   GET_WM_COMMAND_ID(wParam, lParam),
00615       GET_WM_COMMAND_CMD(wParam, lParam),
00616       GET_WM_COMMAND_HWND(wParam, lParam));
00617
00618   case WM_PAINT:
00619     return pThis->OnPaint();
00620
00621   case WM_INITMENUPOPUP:
00622     return pThis->UpdateMenu((HMENU)wParam);
00623
00624   }
00625
00626   return DefWindowProc(hWnd, uMessage, wParam, lParam);
00627 }
00628
00629 /**************************************************************************
00630
00631   COleDocumentView::OnCreate()
00632
00633 **************************************************************************/
00634
00635 LRESULT COleDocumentView::OnCreate(void)
00636 {
00637   return 0;
00638 }
00639
00640 /**************************************************************************
00641
00642   COleDocumentView::OnCommand()
00643
00644 **************************************************************************/
00645
00646 LRESULT COleDocumentView::OnCommand(UINT uID, UINT uCmd, HWND hwndCmd)
00647 {
00648   UNREFERENCED_PARAMETER(uCmd);
00649   UNREFERENCED_PARAMETER(hwndCmd);
00650   switch(uID)
00651   {
00652   case IDM_RED:
00653     m_pOleDoc->m_Color = RED_COLOR;
00654     InvalidateRect(m_hwndView, NULL, TRUE);
00655     UpdateWindow(m_hwndView);
00656     m_pOleDoc->m_fDirty = TRUE;
00657     break;
00658
00659   case IDM_GREEN:
00660     m_pOleDoc->m_Color = GREEN_COLOR;
00661     InvalidateRect(m_hwndView, NULL, TRUE);
00662     UpdateWindow(m_hwndView);
00663     m_pOleDoc->m_fDirty = TRUE;
00664     break;
00665
00666   case IDM_BLUE:
00667     m_pOleDoc->m_Color = BLUE_COLOR;
00668     InvalidateRect(m_hwndView, NULL, TRUE);
00669     UpdateWindow(m_hwndView);
00670     m_pOleDoc->m_fDirty = TRUE;
00671     break;
00672
00673   }
00674
00675   return 0;
00676 }
00677
00678 /**************************************************************************
00679
00680   COleDocumentView::OnPaint()
00681
00682 **************************************************************************/
00683
00684 LRESULT COleDocumentView::OnPaint(void)
00685 {
00686   PAINTSTRUCT ps;
00687
00688   BeginPaint(m_hwndView, &ps);
00689
00690   RECT  rc;
00691   HBRUSH hBrush = CreateSolidBrush(m_pOleDoc->m_Color);
00692   GetClientRect(m_hwndView, &rc);
00693
00694   FillRect(ps.hdc, &rc, hBrush);
00695
00696   DeleteObject(hBrush);
00697
00698   EndPaint(m_hwndView, &ps);
00699
00700   return 0;
00701 }
00702
00703 /**************************************************************************
00704
00705   COleDocumentView::MergeMenus()
00706
00707 **************************************************************************/
00708
00709 BOOL COleDocumentView::MergeMenus(void)
00710 {
00711   if(!m_hSharedMenu)
00712   {
00713     //  Create the menu resource
00714     m_hSharedMenu = CreateMenu();
00715
00716     ZeroMemory(&m_mgw, sizeof(m_mgw));
00717
00718     // have the contaner insert its menus
00719     if(SUCCEEDED(m_pInPlaceFrame->InsertMenus(m_hSharedMenu, &m_mgw)))
00720     {
00721       int   nFirstGroup = (int) m_mgw.width[0];
00722       HMENU hMenu,
00723         hSubMenu;
00724       TCHAR szText[MAX_PATH];
00725
00726       hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_COLOR_MENU));
00727       hSubMenu = GetSubMenu(hMenu, 0);
00728
00729       //get the menu item's text
00730       GetMenuString(hMenu, 0, szText, ARRAYSIZE(szText), MF_BYPOSITION);
00731
00732       // insert the server menus
00733       InsertMenu( m_hSharedMenu,
00734         nFirstGroup,
00735         MF_BYPOSITION | MF_POPUP,
00736         (UINT_PTR)hSubMenu,
00737         szText);
00738
00739       //update the OLEMENUGROUPWIDTHS structure
00740       m_mgw.width[1] += 1;
00741       m_mgw.width[3] += 0;
00742       m_mgw.width[5] += 0;
00743     }
00744     else
00745     {
00746       // Destroy the menu resource
00747       DestroyMenu(m_hSharedMenu);
00748       m_hSharedMenu = NULL;
00749     }
00750   }
00751
00752   if(!m_hOleMenu)
00753   {
00754     // tell OLE to create the menu descriptor
00755     m_hOleMenu = OleCreateMenuDescriptor(m_hSharedMenu, &m_mgw);
00756   }
00757
00758   m_pInPlaceFrame->SetMenu(m_hSharedMenu, m_hOleMenu, m_hwndView);
00759
00760   return TRUE;
00761 }
00762
00763 /**************************************************************************
00764
00765   COleDocumentView::RemoveMenus()
00766
00767 **************************************************************************/
00768
00769 BOOL COleDocumentView::RemoveMenus(void)
00770 {
00771   if(m_hSharedMenu)
00772   {
00773     int   nFirstGroup = (int) m_mgw.width[0];
00774
00775     m_pInPlaceFrame->SetMenu(NULL, NULL, NULL);
00776
00777     // remove the menus that we added
00778     RemoveMenu(m_hSharedMenu, nFirstGroup, MF_BYPOSITION);
00779
00780     // have the container remove its menus
00781     m_pInPlaceFrame->RemoveMenus(m_hSharedMenu);
00782
00783     // Destroy the menu resource
00784     DestroyMenu(m_hSharedMenu);
00785
00786     m_hSharedMenu = NULL;
00787   }
00788
00789   if(m_hOleMenu)
00790   {
00791     // destroy the menu descriptor
00792     OleDestroyMenuDescriptor(m_hOleMenu);
00793
00794     m_hOleMenu = NULL;
00795   }
00796
00797   return TRUE;
00798 }
00799
00800 /**************************************************************************
00801
00802   COleDocumentView::UpdateMenu()
00803
00804 **************************************************************************/
00805
00806 BOOL COleDocumentView::UpdateMenu(HMENU hMenu)
00807 {
00808   UINT  uCheck;
00809
00810   switch(m_pOleDoc->m_Color)
00811   {
00812   case RED_COLOR:
00813     uCheck = IDM_RED;
00814     break;
00815
00816   case GREEN_COLOR:
00817     uCheck = IDM_GREEN;
00818     break;
00819
00820   case BLUE_COLOR:
00821     uCheck = IDM_BLUE;
00822     break;
00823
00824   default:
00825     uCheck = 0;
00826     break;
00827   }
00828
00829   return CheckMenuRadioItem( hMenu,
00830     IDM_RED,
00831     IDM_BLUE,
00832     uCheck,
00833     MF_BYCOMMAND);
00834 }
00835
Generated on Wed Nov 13 2024 16:51:49 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/contextmenu/guids.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • contextmenu

guids.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  Note that the GUIDs for CComponentData and CSnapinAbout are different
00014 //  from the ScopeNode project.  The Node GUIDs can stay the same since
00015 //  they are not really COM objects.
00016
00017
00018 #ifndef _CONTEXTMENU_PROJECT_GUIDS_
00019 #define _CONTEXTMENU_PROJECT_GUIDS_
00020
00021 // {6812e2cf-47dd-4294-a155-5ff2bec2fea2}
00022 DEFINE_GUID( CLSID_CComponentData,
00023              0x6812e2cf, 0x47dd, 0x4294, 0xa1, 0x55, 0x5f, 0xf2, 0xbe, 0xc2, 0xfe, 0xa2);
00024
00025 // {9eee41e0-e990-4160-8fde-271514eb2240}
00026 DEFINE_GUID( CLSID_CSnapinAbout,
00027              0x9eee41e0, 0xe990, 0x4160, 0x8f, 0xde, 0x27, 0x15, 0x14, 0xeb, 0x22, 0x40);
00028
00029 // {520F23F9-775D-4015-B437-98A24B9D085E}
00030 DEFINE_GUID( CLSID_DeviceNode,
00031              0x520F23f9, 0x775D, 0x4015, 0xB4, 0x37, 0x98, 0xA2, 0x4B, 0x9D, 0x8, 0x5E);
00032
00033 // {520F23FA-775D-4015-B437-98A24B9D085E}
00034 DEFINE_GUID( CLSID_CFolderNode,
00035              0x520F23fA, 0x775D, 0x4015, 0xb4, 0x37, 0x98, 0xA2, 0x4B, 0x9D, 0x8, 0x5E);
00036
00037
00038
00039
00040 #endif //_CONTEXTMENU_PROJECT_GUIDS_
Generated on Wed Nov 13 2024 16:52:10 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

_CUSTOM_DIAL_DLG_SAMPLE_ Member List

This is the complete list of members for _CUSTOM_DIAL_DLG_SAMPLE_, including all inherited members.
tDialDlg | _CUSTOM_DIAL_DLG_SAMPLE_
tDialParams | _CUSTOM_DIAL_DLG_SAMPLE_
Generated on Wed Nov 13 2024 16:55:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/Tapi/Tapi3/Cpp/pluggable/plgtermpin.h Source File

  • NetDS
  • Tapi
  • Tapi3
  • Cpp
  • pluggable

plgtermpin.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1999-2001 Microsoft Corporation
00004
00005 Module Name:
00006
00007     PlgTermPin.h
00008
00009 Abstract:
00010
00011     Declaration of the Input pin
00012
00013
00014 --*/
00015
00016 #ifndef __PLGPIN__
00017 #define __PLGPIN__
00018
00019 #if _MSC_VER > 1000
00020 #pragma once
00021 #endif // _MSC_VER > 100
00022
00023 #include "PlgTermFilter.h"
00024 #include <source.h>
00025
00026
00027 class CPlgPin :
00028     public CBaseInputPin
00029 {
00030 public:
00031     // -- Constructor / Destructor
00032   CPlgPin(
00033         CPlgFilter*  pFilter,
00034         HRESULT*    phr,
00035         LPCWSTR     pPinName
00036         );
00037
00038   virtual ~CPlgPin();
00039
00040     // --- IUnknown ---
00041     DECLARE_IUNKNOWN;
00042
00043     // --- CBasePin ---
00044     HRESULT GetMediaType(CMediaType *pmt);
00045     HRESULT CheckMediaType(const CMediaType *pmt);
00046     HRESULT SetMediaType(const CMediaType *pmt);
00047
00048     // --- Worker Thread fn's ---
00049     HRESULT Active(void);
00050     HRESULT Inactive(void);
00051
00052     // Receive data
00053     STDMETHODIMP Receive(IMediaSample *pSample);
00054
00055
00056 private:
00057     // --- Helper functions ---
00058
00059     // Initialize MediaType
00060     HRESULT InitMediaType();
00061
00062 private:
00063     WAVEFORMATEX            m_wfxFormat;
00064
00065 };
00066
00067 #endif // __PLGPIN__
Generated on Wed Nov 13 2024 16:52:23 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/TaskSched/sa.Cpp Source File

  • SysMgmt
  • TaskSched

sa.Cpp

Go to the documentation of this file.
00001 // ===========================================================================
00002 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00003 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005 // PARTICULAR PURPOSE.
00006 //
00007 // Copyright 1998 - 2002 Microsoft Corporation.  All Rights Reserved.
00008 // ===========================================================================
00009 //
00010 //+--------------------------------------------------------------------------
00011 //
00012 // File:        sa.cpp
00013 //
00014 // Contents:    All code needed to build the simple job submission tool
00015 //
00016 // Purpose:     Demonstration of calls to methods of the following new
00017 //              interfaces:
00018 //                  1. ITaskScheduler
00019 //                  2. ITask
00020 //                  3. ITaskTrigger
00021 //                  4. IEnumWorkItems
00022 //
00023 // Comments:    This application is similar in functionality to
00024 //              the "AT" command provided with Windows NT.  However,
00025 //              the AT command functions through the NetSchedule APIs,
00026 //              as opposed to the COM interfaces demonstrated here.
00027 //
00028 //              The Task Scheduler replaces ATSVC.EXE and implements
00029 //              those APIs as a restricted subset of the new ones
00030 //              demonstrated here.
00031 //
00032 //              On Win9x systems, the Task Scheduler replaces
00033 //              the System Agent, providing more flexible and reliable
00034 //              scheduling options than previously available.
00035 //              However, although the SAGE jobs are converted
00036 //              to Task Scheduler work items, the actual
00037 //              SAGE API has been abandoned and is not implemented.
00038 //
00039 //              The Task Scheduler APIs provide a greater degree of
00040 //              freedom and robustness than those APIs.  This code
00041 //              demonstrates a stripped version of AT rewritten to
00042 //              use the new APIs.
00043 //
00044 // Additional:  The Task Scheduler service must be running.  It is easily
00045 //              started by the command "net start schedule" if it is not
00046 //              running.  It is also trivial to start it through
00047 //              the service control manager APIs. Doing it in the code
00048 //              directly makes a good enhancement to the program below.
00049 //              Note that only administrators may start the service.
00050 //              Users of systems that expect non-administrators to
00051 //              schedule tasks should use the System Services snapin
00052 //              in Windows NT 5.0 to set the service to AutoStart,
00053 //              if it is not already.
00054 //
00055 //              Since there is not a service controller on Win9x,
00056 //              the user may start the service by executing the
00057 //              binary directly from the command line (mstask.exe).
00058 //              Win9x users will see a system tray icon if the service
00059 //              is running.
00060 //
00061 //              The service may also be started from the folder UI available
00062 //              directly by opening "My Computer" and then opening the
00063 //              "Scheduled Tasks" folder.  The start command appears on the
00064 //              "Advanced" menu.
00065 //
00066 //              Sample code to start and stop the service, on both
00067 //              Windows NT and Win9x based systems appears in the
00068 //              documentation.
00069 //
00070 //              If the Task Scheduler service is not running, most
00071 //              of this program will fail to execute.  If there are
00072 //              tasks waiting to execute after login, the service
00073 //              will have been started by default.
00074 //
00075 //---------------------------------------------------------------------------
00076
00077 #include <stdio.h>
00078 #include <wchar.h>
00079 #include <windows.h>
00080 #include <mbctype.h>
00081 #include <initguid.h>
00082 #include <mstask.h>
00083 #include <msterr.h>
00084
00085 //+--------------------------------------------------------------------------
00086 // Global variables
00087 //---------------------------------------------------------------------------
00088
00089 ITaskScheduler *g_pITaskScheduler = NULL;
00090
00091 //+--------------------------------------------------------------------------
00092 // Function Prototypes
00093 //---------------------------------------------------------------------------
00094
00095 HRESULT Init(void);
00096 void Cleanup(void);
00097 void DisplayHelp(LPWSTR);
00098 HRESULT EnumerateJobs(void);
00099 HRESULT DeleteJob(LPWSTR);
00100 HRESULT AddJob(LPWSTR, LPSYSTEMTIME, LPWSTR, LPWSTR, LPWSTR);
00101 HRESULT ConvertToSystemTime(LPWSTR, LPSYSTEMTIME);
00102
00103 //+--------------------------------------------------------------------------
00104 // Defining some constants for better readability
00105 //---------------------------------------------------------------------------
00106
00107 const int MAX_COMMAND_LENGTH = 255;
00108 const int MAX_ACCOUNT_LENGTH = 127;
00109 const int MAX_PASSWORD_LENGTH = 127;
00110 const int MAX_TIME_LENGTH = 6;
00111
00112 //+--------------------------------------------------------------------------
00113 //
00114 // Function:        main
00115 //
00116 // Synopsis:        Entry point for code.  Parses command line,
00117 //                  and calls appropriate subfunction as a result.
00118 //
00119 //  Arguments:      See DisplayHelp().  Uses argv, argc to get
00120 //                  command line args.
00121 //
00122 //  Returns:        S_OK for success or the failure code for failure.
00123 //
00124 //---------------------------------------------------------------------------
00125
00126 LONG _CRTAPI1 main (int argc, char **argv)
00127 {
00128     HRESULT hr = S_OK;
00129     UINT uCodePage;
00130     char *lpcszDeleteFlag = "/DELETE";
00131     WCHAR lpwszProgName[MAX_COMMAND_LENGTH];
00132     WCHAR lpwszJobName[MAX_COMMAND_LENGTH];
00133     WCHAR lpwszCommand[MAX_COMMAND_LENGTH];
00134     WCHAR lpwszUserName[MAX_ACCOUNT_LENGTH];
00135     WCHAR lpwszPassword[MAX_PASSWORD_LENGTH];
00136     WCHAR lpwszTime[MAX_TIME_LENGTH];
00137     SYSTEMTIME tTime;
00138
00139     // For protection
00140
00141     g_pITaskScheduler = NULL;
00142
00143     // It is good practice to check lengths on all input params prior to using as a safety precaution against attack
00144     // strlen() is OK to use for this as the command line arguments will be NULL terminated
00145
00146     if (strlen(argv[0]) > MAX_COMMAND_LENGTH -1)
00147     {
00148         wprintf(L"Error:  Program name too long\n");
00149         return E_FAIL;
00150     }
00151
00152     // String conversion initialization
00153
00154     uCodePage = _getmbcp();
00155
00156     // Convert the string; be sure to check return value
00157
00158     if (!MultiByteToWideChar(uCodePage, 0, argv[0], -1, lpwszProgName, MAX_COMMAND_LENGTH))
00159     {
00160         hr = HRESULT_FROM_WIN32(GetLastError());
00161         wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00162         return hr;
00163     }
00164
00165     // Check number of command line arguments.
00166     //      1 argument      =   enumerate work items
00167     //      2 args          =   display help (don't init OLE)
00168     //      3 args          =   delete work item
00169     //      4, 5 or 6 args  =   add a work item
00170     //      all others      =   error, display help
00171
00172     if ((argc == 2) || (argc > 6))
00173     {
00174         DisplayHelp(lpwszProgName);
00175         return hr;
00176     }
00177
00178     // Attempt to initialize OLE and fill in the global g_pITaskScheduler
00179
00180     hr = Init();
00181     if (FAILED(hr))
00182     {
00183         wprintf(L"Error:  OLE initialization and instantiation failed with 0x%x\n", hr);
00184         return hr;
00185     }
00186
00187     switch(argc)
00188     {
00189         case 1:
00190             // User would like to enumerate work items
00191
00192             hr = EnumerateJobs();
00193             if (FAILED(hr))
00194             {
00195                 wprintf(L"Error:  Job enumeration failed with 0x%x\n", hr);
00196             }
00197             break;
00198
00199         case 3:
00200             if (! lstrcmpiA(argv[2], lpcszDeleteFlag))
00201             {
00202                 // User would like to delete work item in argv[1]
00203
00204                 // It is good practice to check lengths on all input params prior to using as a safety precaution against attack
00205                 // strlen() is OK to use for this as the command line arguments will be NULL terminated
00206
00207                 if (strlen(argv[1]) > MAX_COMMAND_LENGTH -1)
00208                 {
00209                     wprintf(L"Error:  Job name too long\n");
00210                     hr = E_FAIL;
00211                     break;
00212                 }
00213
00214                 // Convert the string; be sure to check return value
00215
00216                 if (!MultiByteToWideChar(uCodePage, 0, argv[1], -1, lpwszJobName, MAX_COMMAND_LENGTH))
00217                 {
00218                     hr = HRESULT_FROM_WIN32(GetLastError());
00219                     wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00220                     break;
00221                 }
00222
00223                 hr = DeleteJob(lpwszJobName);
00224                 if (FAILED(hr))
00225                 {
00226                     wprintf(L"Error:  Job deletion failed with 0x%x\n", hr);
00227                 }
00228             }
00229             else
00230             {
00231                 // User has made an error in command line args
00232
00233                 //  Note that it is usually not safe to have a user-supplied value output via a %s format in a printf statement;
00234                 //  however, we have already verified the length of lpwszProgName, so we can be confident that these calls are safe.
00235
00236                 wprintf(L"Error:  Must be %s taskname.job /DELETE\n\n", lpwszProgName);
00237                 wprintf(L"%s /?  for more help.\n", lpwszProgName);
00238                 hr = E_FAIL;
00239             }
00240             break;
00241
00242         case 4:
00243         case 5:
00244         case 6:
00245             // User would like to add a work item.  The following
00246             // argument cases apply:
00247             //      4 - User has specified work item name, but not given
00248             //          username or password.  Will prompt later.
00249             //      5 - User has specified work item name and username,
00250             //          but no password.  Will prompt later.
00251             //      6 - User has specified all information.
00252
00253             // It is good practice to check lengths on all input params prior to using as a safety precaution against attack
00254             // strlen() is OK to use for this as the command line arguments will be NULL terminated
00255
00256             if (strlen(argv[1]) > MAX_COMMAND_LENGTH -1)
00257             {
00258                 wprintf(L"Error:  Job name too long\n");
00259                 hr = E_FAIL;
00260                 break;
00261             }
00262
00263             if (strlen(argv[2]) > MAX_TIME_LENGTH -1)
00264             {
00265                 wprintf(L"Error:  Time too long\n");
00266                 hr = E_FAIL;
00267                 break;
00268             }
00269
00270             if (strlen(argv[3]) > MAX_COMMAND_LENGTH -1)
00271             {
00272                 wprintf(L"Error:  Command too long\n");
00273                 hr = E_FAIL;
00274                 break;
00275             }
00276
00277             // Convert the strings; be sure to check return values
00278
00279             if (!MultiByteToWideChar(uCodePage, 0, argv[1], -1, lpwszJobName, MAX_COMMAND_LENGTH))
00280             {
00281                 hr = HRESULT_FROM_WIN32(GetLastError());
00282                 wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00283                 break;
00284             }
00285
00286             if (!MultiByteToWideChar(uCodePage, 0, argv[2], -1, lpwszTime, MAX_TIME_LENGTH))
00287             {
00288                 hr = HRESULT_FROM_WIN32(GetLastError());
00289                 wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00290                 break;
00291             }
00292
00293             hr = ConvertToSystemTime(lpwszTime, &tTime);
00294             if (FAILED(hr))
00295             {
00296                 wprintf(L"Error:  Conversion of command line time to system time failed with 0x%x\n", hr);
00297                 break;
00298             }
00299
00300             if (!MultiByteToWideChar(uCodePage, 0, argv[3], -1, lpwszCommand, MAX_COMMAND_LENGTH))
00301             {
00302                 hr = HRESULT_FROM_WIN32(GetLastError());
00303                 wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00304                 break;
00305             }
00306
00307             *lpwszUserName = L'\0';
00308             *lpwszPassword = L'\0';
00309
00310             if (argc > 4)
00311             {
00312                 // It is good practice to check lengths on all input params prior to using as a safety precaution against attack
00313                 // strlen() is OK to use for this as the command line arguments will be NULL terminated
00314
00315                 if (strlen(argv[4]) > MAX_ACCOUNT_LENGTH -1)
00316                 {
00317                     wprintf(L"Error:  User name too long\n");
00318                     hr = E_FAIL;
00319                     break;
00320                 }
00321
00322                 // Convert the string; be sure to check return value
00323
00324                 if (!MultiByteToWideChar(uCodePage, 0, argv[4], -1, lpwszUserName, MAX_ACCOUNT_LENGTH))
00325                 {
00326                     hr = HRESULT_FROM_WIN32(GetLastError());
00327                     wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00328                     break;
00329                 }
00330             }
00331
00332             if (argc == 6)
00333             {
00334                 // It is good practice to check lengths on all input params prior to using as a safety precaution against attack
00335                 // strlen() is OK to use for this as the command line arguments will be NULL terminated
00336
00337                 if (strlen(argv[5]) > MAX_PASSWORD_LENGTH -1)
00338                 {
00339                     wprintf(L"Error:  User name too long\n");
00340                     hr = E_FAIL;
00341                     break;
00342                 }
00343
00344                 // Convert the string; be sure to check return value
00345
00346                 if (!MultiByteToWideChar(uCodePage, 0, argv[5], -1, lpwszPassword, MAX_PASSWORD_LENGTH))
00347                 {
00348                     hr = HRESULT_FROM_WIN32(GetLastError());
00349                     wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00350                     break;
00351                 }
00352             }
00353
00354             hr = AddJob(lpwszJobName, &tTime, lpwszCommand, lpwszUserName, lpwszPassword);
00355             if (FAILED(hr))
00356             {
00357                 wprintf(L"Error:  Job creation failed with 0x%x\n", hr);
00358             }
00359
00360             break;
00361
00362         default:
00363             hr = E_FAIL;
00364             DisplayHelp(lpwszProgName);
00365     }
00366
00367     Cleanup();
00368     return hr;
00369 }
00370
00371
00372 //+--------------------------------------------------------------------------
00373 //
00374 // Function:        Init()
00375 //
00376 // Synopsis:        Called to initialize and instantiate a task
00377 //                  scheduler object.
00378 //
00379 // Arguments:       none (void)
00380 //
00381 // Returns:         HRESULT indicating success or failure.  S_OK on success.
00382 //
00383 // Side effect:     Sets global pointer g_pITaskScheduler, for use in other
00384 //                  functions.
00385 //
00386 //---------------------------------------------------------------------------
00387
00388 HRESULT Init()
00389 {
00390     HRESULT hr = S_OK;
00391
00392     // Bring in the library
00393
00394     hr = CoInitialize(NULL);
00395     if (FAILED(hr))
00396     {
00397         wprintf(L"Error:  Failed to initialize COM with 0x%x\n", hr);
00398         return hr;
00399     }
00400
00401     // Create the pointer to Task Scheduler object
00402     // CLSID from the header file mstask.h
00403
00404     hr = CoCreateInstance(
00405         CLSID_CTaskScheduler,
00406         NULL,
00407         CLSCTX_INPROC_SERVER,
00408         IID_ITaskScheduler,
00409         (void **) &g_pITaskScheduler);
00410
00411     // Should we fail, unload the library
00412
00413     if (FAILED(hr))
00414     {
00415         wprintf(L"Error:  Failed CoCreateInstance with 0x%x\n", hr);
00416         CoUninitialize();
00417     }
00418
00419     return hr;
00420 }
00421
00422
00423 //+--------------------------------------------------------------------------
00424 //
00425 // Function:    Cleanup()
00426 //
00427 // Synopsis:    Called to clean up OLE, memory, etc. before termination
00428 //
00429 // Arguments:   none (void)
00430 //
00431 // Returns:     nothing (void)
00432 //
00433 // Side effect: Cancels the global pointer g_pITaskScheduler.
00434 //
00435 //---------------------------------------------------------------------------
00436
00437 void Cleanup()
00438 {
00439     if (g_pITaskScheduler)
00440     {
00441         g_pITaskScheduler->Release();
00442         g_pITaskScheduler = NULL;
00443     }
00444
00445     // Unload the library, now that our pointer is freed.
00446
00447     CoUninitialize();
00448     return;
00449 }
00450
00451
00452 //+--------------------------------------------------------------------------
00453 //
00454 // Function:    DisplayHelp()
00455 //
00456 // Synopsis:    Prints out help and usage information
00457 //
00458 // Arguments:   lpwszProgName - a pointer to a WSTR containing argv[0]
00459 //
00460 // Returns:     nothing (void)
00461 //
00462 //---------------------------------------------------------------------------
00463
00464 void DisplayHelp(LPWSTR lpwszProgName)
00465 {
00466     //  Note that it is usually not safe to have a user-supplied value output via a %s format in a printf statement;
00467     //  however, we have already verified the length of lpwszProgName, so we can be confident that these calls will not overflow.
00468
00469     wprintf(L"%s -- a small program to replicate some\n", lpwszProgName);
00470     wprintf(L"\tfunctionality of the AT command, using the\n");
00471     wprintf(L"\tnew Task Scheduler interfaces.\n\n");
00472
00473     wprintf(L"Usage:\n");
00474     wprintf(L"\t%s /?\n\t\t\t\t\t\t- Display this help\n",lpwszProgName);
00475     wprintf(L"\t%s\n\t\t\t\t\t\t- Show all work items\n",lpwszProgName);
00476     wprintf(L"\t%s TaskName.job /DELETE \n\t\t\t\t\t\t- delete work item\n",lpwszProgName);
00477     wprintf(L"\t%s TaskName.job Time Command [UserName [Password]]\n\t\t\t\t\t\t- submit a new work item\n\n",lpwszProgName);
00478
00479     wprintf(L"TaskName.job is the name of the work item object on disk.\n");
00480     wprintf(L"The work item will appear in the Scheduled Tasks folder as TaskName\n");
00481     wprintf(L"but must be given the extension \".job\" for the service \n");
00482     wprintf(L"to recognize and run it.\n\n");
00483
00484     wprintf(L"Task Time is in 24 hour format (such as 15:30) and is the\n");
00485     wprintf(L"next instance of this time within 24 hours.\n\n");
00486
00487     wprintf(L"The Command should contain the name of the executable to run.\n");
00488     wprintf(L"Note that the pathname may NOT contain spaces.  If the\n");
00489     wprintf(L"program requires command line parameters, enclose the entire\n");
00490     wprintf(L"command string in quotation marks.\n\n");
00491
00492     wprintf(L"Username and password are required to run the specified work item under Windows NT.\n");
00493     wprintf(L"Under Windows NT, if not specified, you will be prompted.\n");
00494     wprintf(L"Under Windows 95, both fields are ignored.  If not specified\n");
00495     wprintf(L"on the command line, you will not be prompted.\n\n");
00496
00497     return;
00498 }
00499
00500
00501 //+--------------------------------------------------------------------------
00502 //
00503 // Function:    EnumerateJobs()
00504 //
00505 // Synopsis:    Goes through all scheduled work items on a system and
00506 //              lists them, along with a short trigger string.
00507 //
00508 // Arguments:   none (void).  Requires g_pITaskScheduler.
00509 //
00510 // Returns:     HRESULT indicating success (S_OK) or other.
00511 //
00512 //---------------------------------------------------------------------------
00513
00514 HRESULT EnumerateJobs()
00515 {
00516     HRESULT hr = S_OK, hrLoop = S_OK;
00517     IEnumWorkItems *pIEnumWorkItems;
00518     IUnknown *pIU;
00519     ITask *pITask;
00520     ULONG ulTasksToGet = 1, ulActualTasksRetrieved = 0;
00521     LPWSTR *rgpwszNames, pwszTrigger;
00522     WORD wTrigCount = 0;
00523     WORD wTemp;
00524
00525
00526     //
00527     // Get an enumeration pointer, using ITaskScheduler::Enum
00528     //
00529
00530     hr = g_pITaskScheduler->Enum(&pIEnumWorkItems);
00531     if (FAILED(hr))
00532     {
00533         wprintf(L"Failed to get enumerator with 0x%x\n", hr);
00534         return hr;
00535     }
00536
00537     do
00538     {
00539         // Get a single work item, using IEnumWorkItems::Next
00540
00541         hrLoop = pIEnumWorkItems->Next(ulTasksToGet, &rgpwszNames, &ulActualTasksRetrieved);
00542         if (hrLoop == S_FALSE)
00543         {
00544             // There are no more waiting tasks to look at
00545             break;
00546         }
00547
00548         // Attach to the work item, using ITaskScheduler::Activate
00549
00550         hr = g_pITaskScheduler->Activate(rgpwszNames[0], IID_ITask, &pIU);
00551         if (FAILED(hr))
00552         {
00553             wprintf(L"Error:  Activate failed with 0x%x\n", hr);
00554             break;
00555         }
00556
00557         // QI pIU for pITask
00558
00559         hr = pIU->QueryInterface(IID_ITask, (void **) &pITask);
00560         pIU->Release();
00561         pIU = NULL;
00562         if (FAILED(hr))
00563         {
00564             wprintf(L"Error:  QI for ITask failed in Activate with 0x%x\n", hr);
00565             break;
00566         }
00567
00568         // Display task name
00569
00570         // rgpwszNames[0] is the value returned by the Task Scheduler API
00571         // and should be appropriately bounded and therefore safe to pass into %s
00572
00573         wprintf(L"Task: %s\n",rgpwszNames[0]);
00574
00575         // Use ITask::GetTriggerCount to get count of triggers
00576
00577         hr = pITask->GetTriggerCount(&wTrigCount);
00578         if (FAILED(hr))
00579         {
00580             wprintf(L"Error:  Failed to count triggers with 0x%x\n", hr);
00581             pITask->Release();
00582             break;
00583         }
00584
00585         for (wTemp = 0; wTemp < wTrigCount; wTemp++)
00586         {
00587             // Dump Triggers using ITask::GetTriggerString
00588
00589             hr = pITask->GetTriggerString(wTemp, &pwszTrigger);
00590             if (FAILED(hr))
00591             {
00592                 wprintf(L"Error:  Failed to get trigger string with 0x%x\n", hr);
00593                 pITask->Release();
00594                 break;
00595             }
00596
00597             // pwszTrigger is the value returned by the Task Scheduler API
00598             // and should be appropriately bounded and therefore safe to pass into %s
00599
00600             wprintf(L"\tTrigger: %s\n",pwszTrigger);
00601
00602             // Clean up the memory we were allocated for trig string
00603
00604             CoTaskMemFree(pwszTrigger);
00605         }
00606
00607         // Clean up each element in the array of job names, then
00608         // clean up the final array.
00609
00610         CoTaskMemFree(rgpwszNames[0]);
00611         CoTaskMemFree(rgpwszNames);
00612
00613         // Free the ITask pointer
00614
00615         pITask->Release();
00616
00617     } while(1);
00618
00619     // Release the enumeration pointer
00620
00621     pITask = NULL;
00622
00623     pIEnumWorkItems->Release();
00624     pIEnumWorkItems = NULL;
00625
00626     return hr;
00627 }
00628
00629
00630 //+--------------------------------------------------------------------------
00631 //
00632 // Function:        DeleteJob()
00633 //
00634 // Synopsis:        Deletes a work item from the Scheduled Tasks folder.
00635 //
00636 // Arguments:       lpwszJobName - the name of the work item to delete
00637 //
00638 // Returns:         HRESULT indicating success (S_OK) or failure.
00639 //
00640 //---------------------------------------------------------------------------
00641
00642 HRESULT DeleteJob(LPWSTR lpwszJobName)
00643 {
00644     HRESULT hr = S_OK;
00645
00646     hr = g_pITaskScheduler->Delete(lpwszJobName);
00647
00648     return hr;
00649 }
00650
00651
00652 //+--------------------------------------------------------------------------
00653 //
00654 // Function:        AddJob()
00655 //
00656 // Synopsis:        Adds a new work item to the Scheduled Tasks folder.
00657 //
00658 // Arguments:       lpwszJobName - name of the task file
00659 //                  lptTime      - pointer to SYSTEMTIME struct containing
00660 //                                      the time the job should run.
00661 //                  lpwszCommand - name of application (command) to run.
00662 //                  lpwszUserName- user name to run job under
00663 //                  lpwszPassword- password for that user
00664 //
00665 // Returns:         HRESULT indicating success (S_OK) or failure.
00666 //
00667 // Notes:           The password or BOTH the username and password
00668 //                  may be passed in as '\0' strings, in which case
00669 //                  this function will prompt on stdout for password
00670 //                  and username
00671 //
00672 //---------------------------------------------------------------------------
00673
00674 HRESULT AddJob(LPWSTR lpwszJobName, LPSYSTEMTIME lptTime,
00675                 LPWSTR lpwszCommand, LPWSTR lpwszUserName,
00676                 LPWSTR lpwszPassword)
00677 {
00678     HRESULT hr = S_OK;
00679     IUnknown *pIU;
00680     IScheduledWorkItem *pISWI;
00681     IPersistFile *pIPF;
00682     ITask *pITask;
00683     ITaskTrigger *pITaskTrig;
00684     DWORD dwTaskFlags, dwTrigFlags;
00685     WORD wTrigNumber;
00686     TASK_TRIGGER TaskTrig;
00687     WCHAR lpwszAppName[MAX_COMMAND_LENGTH];
00688     int i;
00689
00690     //
00691     // Initialize the pointers to NULL, so that the fail-out routine works
00692     // All pointer cleanup will be done at the end of the routine.
00693     //
00694
00695     pITask = NULL;
00696     pITaskTrig = NULL;
00697     pISWI = NULL;
00698     pIU = NULL;
00699     pIPF = NULL;
00700
00701     // Add the task.  Most likely failure is that work item already exists.
00702     // Uses ITaskScheduler::NewWorkItem
00703
00704     hr = g_pITaskScheduler->NewWorkItem(lpwszJobName,
00705                                         CLSID_CTask,
00706                                         IID_ITask,
00707                                         &pIU);
00708     if (FAILED(hr))
00709     {
00710         wprintf(L"Error:  Create New Task failed with 0x%x\n", hr);
00711         goto finish;
00712     }
00713
00714     // We now have an IUnknown pointer.  This is queried for an ITask
00715     // pointer on the work item we just added.
00716
00717     hr = pIU->QueryInterface(IID_ITask, (void **) &pITask);
00718     if (FAILED(hr))
00719     {
00720         wprintf(L"Error:  IUnknown failed to yield ITask with 0x%x\n", hr);
00721         goto finish;
00722     }
00723
00724     //
00725     // In order for security to work and be set, later we need to
00726     // attach the task object to a file on disk.  Therefore,
00727     // we must use IPersistFile to save the task object.  This
00728     // also will confirm that the object on disk doesn't already
00729     // exist - which could be a potential source of later errors.
00730     //
00731     // The task scheduler does not normally commit jobs to disk
00732     // immediately upon creation because disk access is slow compared
00733     // to the in-memory operation of creating a task.  Therefore,
00734     // you can rapidly create lots of task objects (for instance,
00735     // in response to incoming net events) and commit when things
00736     // slow down.
00737     //
00738     // Here, we don't care about speed.
00739     //
00740
00741     hr = pITask->QueryInterface(IID_IPersistFile, (void **) &pIPF);
00742     if (FAILED(hr))
00743     {
00744         wprintf(L"Error:  QI for IPersistFile failed with 0x%x\n", hr);
00745         goto finish;
00746     }
00747
00748     hr = pIPF->Save(NULL, FALSE);
00749     if (FAILED(hr))
00750     {
00751         wprintf(L"Error:  Save object failed with 0x%x\n", hr);
00752         goto finish;
00753     }
00754
00755     // Extract parameters from the application name
00756     // Note that there might not be any parameters at all.
00757     // We butcher a path like C:\Program Files\foo.exe, because
00758     // we break on space, but this is ok, because user could say
00759     // C:\progra~1\foo.exe instead.
00760
00761     i = 0;
00762     while ((*lpwszCommand != L' ') && (*lpwszCommand != '\0'))
00763     {
00764         lpwszAppName[i] = *lpwszCommand;
00765         i++;
00766
00767         // we've already verified the length of lpwszCommand (including NULL terminator) is <= MAX_COMMAND_LENGTH,
00768         // but it doesn't hurt to be extra paranoid regarding buffer overflows in case the code changes elsewhere
00769
00770         if (i > MAX_COMMAND_LENGTH - 1)
00771         {
00772             wprintf(L"Error:  Attempted to exceed buffer size while copying application name\n");
00773             hr = E_FAIL;
00774             goto finish;
00775         }
00776
00777         lpwszCommand++;
00778     }
00779     lpwszAppName[i] = L'\0';
00780     if (*lpwszCommand == L' ')
00781     {
00782         lpwszCommand++;
00783     }
00784
00785     // Set command name with ITask::SetApplicationName
00786
00787     hr = pITask->SetApplicationName(lpwszAppName);
00788     if (FAILED(hr))
00789     {
00790         wprintf(L"Error:  Failed to set command name (with parms) with 0x%x\n", hr);
00791         goto finish;
00792     }
00793
00794     // Set task parameters with ITask::SetParameters
00795
00796     hr = pITask->SetParameters(lpwszCommand);
00797     if (FAILED(hr))
00798     {
00799         wprintf(L"Error:  Failed to set parameters with 0x%x\n", hr);
00800         goto finish;
00801     }
00802
00803     // Set the comment, so we know how this job got there
00804     // Uses ITask::SetComment
00805
00806     hr = pITask->SetComment(L"This scheduled task created by command line SDK sample tool");
00807     if (FAILED(hr))
00808     {
00809         wprintf(L"Error:  Failed to set task comment with 0x%x\n", hr);
00810         goto finish;
00811     }
00812
00813     // Set the flags on the task object
00814     // Use the base class member to do this - IScheduledWorkItem::SetFlags()
00815
00816     hr = pITask->QueryInterface(IID_IScheduledWorkItem, (void **) &pISWI);
00817     if (FAILED(hr))
00818     {
00819         wprintf(L"Error:  Failed to get base class interface to set flags with 0x%x\n", hr);
00820         goto finish;
00821     }
00822
00823     dwTaskFlags = TASK_FLAG_DELETE_WHEN_DONE;
00824     hr = pISWI->SetFlags(dwTaskFlags);
00825
00826     // Release pISWI, since we no longer need it.
00827
00828     pISWI->Release();
00829     pISWI = NULL;
00830
00831     // Check for failure to set flags.  This really does not need
00832     // to be fatal.
00833
00834     if (FAILED(hr))
00835     {
00836         wprintf(L"Error:  Failed to set task flags with 0x%x\n", hr);
00837         goto finish;
00838     }
00839
00840     // Now, create a trigger to run the task at our specified time.
00841     // Uses ITask::CreateTrigger()
00842
00843     hr = pITask->CreateTrigger(&wTrigNumber, &pITaskTrig);
00844     if (FAILED(hr))
00845     {
00846         wprintf(L"Error:  Failed to create a new trigger with 0x%x\n", hr);
00847         goto finish;
00848     }
00849
00850     // Now, fill in the trigger as necessary.
00851
00852     dwTrigFlags = 0;
00853
00854     ZeroMemory((void*) &TaskTrig, sizeof(TASK_TRIGGER));
00855
00856     TaskTrig.cbTriggerSize = sizeof(TASK_TRIGGER);
00857     TaskTrig.wBeginYear = lptTime->wYear;
00858     TaskTrig.wBeginMonth = lptTime->wMonth;
00859     TaskTrig.wBeginDay = lptTime->wDay;
00860     TaskTrig.wStartHour = lptTime->wHour;
00861     TaskTrig.wStartMinute = lptTime->wMinute;
00862     TaskTrig.rgFlags = dwTrigFlags;
00863     TaskTrig.TriggerType = TASK_TIME_TRIGGER_ONCE;
00864
00865     // Add this trigger to the task using ITaskTrigger::SetTrigger
00866
00867     hr = pITaskTrig->SetTrigger(&TaskTrig);
00868     if (FAILED(hr))
00869     {
00870         wprintf(L"Error:  Failed to set trigger to desired values with 0x%x\n", hr);
00871         goto finish;
00872     }
00873
00874     //
00875     // We need to see if we support security, and we
00876     // do this by calling ITask::SetAccountInformation
00877     // and checking if the failure code is SCHED_E_NO_SECURITY_SERVICES
00878     // We could also use GetVersionEx() to find out if we
00879     // were running on Windows NT or not, but this is even easier.
00880     //
00881
00882     hr = pITask->SetAccountInformation(lpwszUserName, lpwszPassword);
00883     if (hr != SCHED_E_NO_SECURITY_SERVICES)
00884     {
00885
00886         // Check to see if username is null
00887
00888         if (*lpwszPassword == L'\0')
00889         {
00890             // String conversion initialization
00891
00892             UINT uCodePage = _getmbcp();
00893
00894             // If password was null, chance username is, too.
00895
00896             if (*lpwszUserName == L'\0')
00897             {
00898                 wprintf(L"Enter username to run job %s as: ",lpwszJobName);
00899
00900                 // never use scanf() or wscanf(), as it is all too easy for a user to overflow the buffer
00901                 // fgets() and fgetws() allow us to specify a maximum number of characters to read
00902
00903                 char lpszUserName[MAX_ACCOUNT_LENGTH];
00904                 if (!fgets(lpszUserName, MAX_ACCOUNT_LENGTH, stdin))
00905                 {
00906                     wprintf(L"Error:  User name input failed\n");
00907                     goto finish;
00908                 }
00909
00910                 // eliminate the new line character if it was read
00911                 // this will always be the case if the input is less than MAX_ACCOUNT_LENGTH - 1
00912
00913                 if (char* pNewLine = strchr(lpszUserName, '\n'))
00914                 {
00915                     *pNewLine = '\0';
00916                 }
00917
00918                 // Convert the string; be sure to check return value
00919
00920                 if (!MultiByteToWideChar(uCodePage, 0, lpszUserName, -1, lpwszUserName, MAX_ACCOUNT_LENGTH))
00921                 {
00922                     hr = HRESULT_FROM_WIN32(GetLastError());
00923                     wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00924                     goto finish;
00925                 }
00926
00927                 wprintf(L"\n");
00928             }
00929
00930             wprintf(L"Enter password to user %s: ",lpwszUserName);
00931
00932             // never use scanf() or wscanf(), as it is all too easy for a user to overflow the buffer
00933             // fgets() and fgetws() allow us to specify a maximum number of characters to read
00934
00935             char lpszPassword[MAX_PASSWORD_LENGTH];
00936             if (!fgets(lpszPassword, MAX_PASSWORD_LENGTH, stdin))
00937             {
00938                 wprintf(L"Error:  Password input failed\n");
00939                 goto finish;
00940             }
00941
00942             // eliminate the new line character if it was read
00943             // this will always be the case if the input is less than MAX_ACCOUNT_LENGTH - 1
00944
00945             if (char* pNewLine = strchr(lpszPassword, '\n'))
00946             {
00947                 *pNewLine = '\0';
00948             }
00949
00950             // Convert the string; be sure to check return value
00951
00952             if (!MultiByteToWideChar(uCodePage, 0, lpszPassword, -1, lpwszPassword, MAX_PASSWORD_LENGTH))
00953             {
00954                 hr = HRESULT_FROM_WIN32(GetLastError());
00955                 wprintf(L"Error:  Multibyte to wide character conversion failed with 0x%x\n", hr);
00956                 goto finish;
00957             }
00958
00959             wprintf(L"\n");
00960         }
00961     }
00962
00963     // Set the account information using ITask::SetAccountInformation
00964     // This fails for Win9x, but we ignore the failure.
00965     //
00966     // Note that setting security is the LAST THING WE DO BEFORE SAVING
00967     // THE TASK.
00968     //
00969
00970     hr = pITask->SetAccountInformation(lpwszUserName, lpwszPassword);
00971     if ((FAILED(hr)) && (hr != SCHED_E_NO_SECURITY_SERVICES))
00972     {
00973         wprintf(L"Error:  Failed to set credentials on task object with 0x%x\n",hr);
00974         goto finish;
00975     }
00976
00977     // Make the changes permanent
00978     // Requires using IPersistFile::Save()
00979
00980     if (! pIPF)
00981     {
00982         // Should not be in here if you got this far.
00983
00984         wprintf(L"You failed to get an IPersistFile interface, cannot save\n");
00985         hr = E_FAIL;
00986         goto finish;
00987     }
00988
00989     hr = pIPF->Save(NULL, FALSE);
00990     if (FAILED(hr))
00991     {
00992         wprintf(L"Error:  Failed to save object with 0x%x\n", hr);
00993         goto finish;
00994     }
00995
00996 finish:
00997
00998     // We no longer need ITask
00999
01000     if (pITask)
01001     {
01002         pITask->Release();
01003         pITask = NULL;
01004     }
01005
01006     // Done with ITaskTrigger pointer
01007
01008     if (pITaskTrig)
01009     {
01010         pITaskTrig->Release();
01011         pITaskTrig = NULL;
01012     }
01013
01014     // Done with IPersistFile
01015
01016     if (pIPF)
01017     {
01018         pIPF->Release();
01019         pIPF = NULL;
01020     }
01021
01022     // If we have an IUnknown
01023
01024     if (pIU)
01025     {
01026        pIU->Release();
01027        pIU = NULL;
01028     }
01029
01030     // And if we have a IScheduledWorkItem
01031
01032     if (pISWI)
01033     {
01034        pISWI->Release();
01035        pISWI = NULL;
01036     }
01037
01038     return hr;
01039 }
01040
01041
01042 //+--------------------------------------------------------------------------
01043 //
01044 // Function:        ConvertToSystemTime()
01045 //
01046 // Synopsis:        Given a text string from the command line of the form
01047 //                  HH:MM where HH = 0 - 23, and MM = 00 - 59,
01048 //                  obtain the next instance in 24 hours of said time
01049 //                  and return this time in a SYSTEMTIME structure
01050 //                  so that it can be used to set triggers
01051 //
01052 // Arguments:       lpwszTime    -   The text string of time
01053 //                  lptTime     -   The SYSTEMTIME pointer
01054 //
01055 // Returns:         HRESULT of success (S_OK) or failure
01056 //
01057 //---------------------------------------------------------------------------
01058
01059 HRESULT ConvertToSystemTime(LPWSTR lpwszTime, LPSYSTEMTIME lptTime)
01060 {
01061     WORD wMin = 0, wHr = 0, wMaxFeb = 28;
01062     WCHAR szTemp[3], *szEnd1, *szEnd2;
01063     SYSTEMTIME tNow;
01064     int i, j;
01065
01066     // Extract minutes and hour from string
01067     // Note that both h:mm and hh:mm are valid, but nothing else
01068     // It is safe to call wcslen() on lpwszTime because we already know it is NULL terminated
01069
01070     if ((wcslen(lpwszTime) > MAX_TIME_LENGTH - 1) || (wcslen(lpwszTime) < MAX_TIME_LENGTH - 2))
01071     {
01072         wprintf(L"Error:  Invalid time string given\n");
01073         return E_FAIL;
01074     }
01075
01076     // Hours first.
01077
01078     i = 0;
01079     while (*lpwszTime != ':')
01080     {
01081         szTemp[i] = *lpwszTime;
01082         i++;
01083         if (i > 2)
01084         {
01085             // User gave a bad time string
01086             wprintf(L"Error:  Bad hours in time string (need 0 - 23)\n");
01087             return E_FAIL;
01088         }
01089         lpwszTime++;
01090     }
01091     szTemp[i] = L'\0';
01092     lpwszTime++;
01093
01094     // Convert to value
01095
01096     wHr = (WORD) wcstoul(szTemp, &szEnd1, 10);
01097
01098     // Now do minutes
01099     // It is safe to call wcslen() on lpwszTime because we already know it is NULL terminated
01100
01101     i = wcslen(lpwszTime);
01102     if (i != 2)
01103     {
01104         // User gave a bad time string
01105         wprintf(L"Error:  Bad minutes in time string (need 00 - 59)\n");
01106         return E_FAIL;
01107     }
01108
01109     j = 0;
01110     while (i)
01111     {
01112         szTemp[j] = *lpwszTime;
01113         j++;
01114         i--;
01115         lpwszTime++;
01116     }
01117     szTemp[j] = L'\0';
01118
01119     wMin = (WORD) wcstoul(szTemp, &szEnd2, 10);
01120
01121     // Now figure out if we are running today or tomorrow
01122
01123     GetLocalTime(&tNow);
01124     if ((wHr < tNow.wHour) ||
01125        ((wHr == tNow.wHour) && (wMin < tNow.wMinute)))
01126     {
01127         // Job is tomorrow - we must figure out what tomorrow is
01128
01129         switch(tNow.wMonth)
01130         {
01131             case 4:
01132             case 6:
01133             case 9:
01134             case 11:
01135                 // Thirty day months
01136
01137                 if ((tNow.wDay + 1) > 30)
01138                 {
01139                     tNow.wDay = 1;
01140                     tNow.wMonth++;
01141                 }
01142                 else
01143                 {
01144                     tNow.wDay++;
01145                 }
01146                 break;
01147
01148             case 2:
01149                 // February
01150                 // Leap Year?
01151
01152                 if ((tNow.wYear % 4) == 0)
01153                 {
01154                     wMaxFeb = 29;
01155                 }
01156                 if (((tNow.wYear % 100) == 0) &&
01157                     ((tNow.wYear % 400) != 0))
01158                 {
01159                     wMaxFeb = 28;
01160                 }
01161
01162                 if ((tNow.wDay + 1) > wMaxFeb)
01163                 {
01164                     tNow.wDay = 1;
01165                     tNow.wMonth++;
01166                 }
01167                 else
01168                 {
01169                     tNow.wDay++;
01170                 }
01171                 break;
01172
01173             default:
01174                 // 31 day months.  Handle Dec. later
01175
01176                 if ((tNow.wDay + 1) > 31)
01177                 {
01178                     tNow.wDay = 1;
01179                     tNow.wMonth++;
01180                 }
01181                 else
01182                 {
01183                     tNow.wDay++;
01184                 }
01185
01186                 if (tNow.wMonth > 12)
01187                 {
01188                     tNow.wMonth = 1;
01189                     tNow.wYear++;
01190                 }
01191         }
01192     }
01193
01194     if ((wMin < 0) || (wMin > 59))
01195     {
01196         wprintf(L"Error:  Invalid minutes (need 00 - 59)\n");
01197         return E_FAIL;
01198     }
01199     else
01200     {
01201         tNow.wMinute = wMin;
01202     }
01203     if ((wHr < 0) || (wHr > 23))
01204     {
01205         wprintf(L"Error:  Invalid hours (need 0 - 23)\n");
01206         return E_FAIL;
01207     }
01208     else
01209     {
01210         tNow.wHour = wHr;
01211     }
01212
01213     lptTime->wHour = tNow.wHour;
01214     lptTime->wMinute = tNow.wMinute;
01215     lptTime->wYear = tNow.wYear;
01216     lptTime->wMonth = tNow.wMonth;
01217     lptTime->wDay = tNow.wDay;
01218     lptTime->wDayOfWeek = 0;
01219     lptTime->wSecond = 0;
01220     lptTime->wMilliseconds = 0;
01221     return S_OK;
01222 }
Generated on Wed Nov 13 2024 16:52:39 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinBase/Indexing/IFilter/MetaTag.Hxx Source File

  • WinBase
  • Indexing
  • IFilter

MetaTag.Hxx

Go to the documentation of this file.
00001 //+-------------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation. All rights reserved.
00004 //
00005 //  File:       metatag.hxx
00006 //
00007 //  Contents:   Parsing algorithm for image tags
00008 //
00009 //--------------------------------------------------------------------------
00010
00011 #if !defined( __METATAG_HXX__ )
00012 #define __METATAG_HXX__
00013
00014 #include <htmlelem.hxx>
00015
00016 enum MetaTagState
00017 {
00018     FilteringValue,
00019     NoMoreValue,
00020 };
00021
00022
00023 //+-------------------------------------------------------------------------
00024 //
00025 //  Class:      CMetaTag
00026 //
00027 //  Purpose:    Parsing algorithm for meta tag in Html
00028 //
00029 //--------------------------------------------------------------------------
00030
00031 class CMetaTag : public CHtmlElement
00032 {
00033
00034 public:
00035     CMetaTag( CHtmlIFilter& htmlIFilter,
00036               CSerialStream& serialStream,
00037               GUID ClsidMetaInfo );
00038
00039     virtual SCODE    GetChunk( STAT_CHUNK *pStat );
00040     virtual SCODE    GetText( ULONG *pcwcOutput, WCHAR *awcBuffer );
00041     virtual SCODE    GetValue( PROPVARIANT ** ppPropValue );
00042
00043     virtual void     InitStatChunk( STAT_CHUNK *pStat );
00044
00045 private:
00046
00047     MetaTagState     _eState;                 // Current state of tag
00048     WCHAR *          _pwcValueBuf;            // Buffer for value field
00049     unsigned         _cValueChars;            // # chars in value buffer
00050
00051     GUID             _clsidMetaInfo;
00052     WCHAR            _awszPropSpec[MAX_PROPSPEC_STRING_LENGTH+1];   // Prop spec string in attribute
00053 };
00054
00055
00056 #endif // __METATAG_HXX__
00057
Generated on Wed Nov 13 2024 16:52:51 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/Imp_Draw/StdAfx.h Source File

  • NetDS
  • MessageQueuing
  • Imp_Draw

StdAfx.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011 //
00012 // stdafx.h : include file for standard system include files,
00013 //  or project specific include files that are used frequently, but
00014 //      are changed infrequently
00015 //
00016
00017 #if !defined(AFX_STDAFX_H__02EE003A_FC6D_11D0_A14D_00C04FB9D5DF__INCLUDED_)
00018 #define AFX_STDAFX_H__02EE003A_FC6D_11D0_A14D_00C04FB9D5DF__INCLUDED_
00019
00020 #if _MSC_VER >= 1000
00021 #pragma once
00022 #endif // _MSC_VER >= 1000
00023
00024 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00025
00026 #include <afxwin.h>         // MFC core and standard components
00027 #include <afxext.h>         // MFC extensions
00028 #ifndef _AFX_NO_AFXCMN_SUPPORT
00029 #include <afxcmn.h>     // MFC support for Windows Common Controls
00030 #endif // _AFX_NO_AFXCMN_SUPPORT
00031
00032
00033 //{{AFX_INSERT_LOCATION}}
00034 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00035
00036 #endif // !defined(AFX_STDAFX_H__02EE003A_FC6D_11D0_A14D_00C04FB9D5DF__INCLUDED_)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/MessageQueuing/mqf_draw/stdafx.h Source File

  • NetDS
  • MessageQueuing
  • mqf_draw

stdafx.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------
00002 //
00003 //  Copyright (c) Microsoft Corporation.  All rights reserved
00004 //
00005 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00006 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00007 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00008 // PARTICULAR PURPOSE.
00009 //
00010 // --------------------------------------------------------------------
00011
00012 // stdafx.h : include file for standard system include files,
00013 //  or project specific include files that are used frequently, but
00014 //      are changed infrequently
00015 //
00016
00017 #define VC_EXTRALEAN    // Exclude rarely-used stuff from Windows headers
00018
00019 #include <afxwin.h>         // MFC core and standard components
00020 #include <afxext.h>         // MFC extensions
00021 #ifndef _AFX_NO_AFXCMN_SUPPORT
00022 #include <afxcmn.h>     // MFC support for Windows 95 Common Controls
00023 #endif // _AFX_NO_AFXCMN_SUPPORT
00024
00025 #include <afxtempl.h>   // MFC collection classes
00026 #include <afxole.h>     // MFC OLE support
00027
00028 #include "mq.h"       // MSMQ
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/SimpDnd/idt.h Source File

  • Com
  • Fundamentals
  • SimpDnd

idt.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 // File name: idt.h
00003 //
00004 //      Definition of CDropTarget
00005 //
00006 // Copyright 1992 - 2000 Microsoft Corporation. All rights reserved.
00007 //**********************************************************************
00008 #if !defined( _IDT_H_ )
00009 #define _IDT_H_
00010
00011 #include <assert.h>
00012
00013 class CSimpleDoc;
00014
00015 /* Flags to control direction for drag scrolling */
00016 typedef enum tagSCROLLDIR {
00017   SCROLLDIR_NULL          = 0,
00018   SCROLLDIR_UP            = 1,
00019   SCROLLDIR_DOWN          = 2,
00020   SCROLLDIR_RIGHT         = 3,
00021   SCROLLDIR_LEFT          = 4
00022 } SCROLLDIR;
00023
00024 interface CDropTarget : public IDropTarget
00025 {
00026   int   m_nCount;                 // reference count
00027   CSimpleDoc FAR * m_pDoc;
00028   BOOL  m_fCanDropCopy;
00029   BOOL  m_fCanDropLink;
00030   DWORD m_dwSrcAspect;
00031   RECT  m_rcDragRect;
00032   POINT m_ptLast;
00033   BOOL  m_fDragFeedbackDrawn;
00034   DWORD m_dwTimeEnterScrollArea;  // time of entering scroll border region
00035   DWORD m_dwLastScrollDir;        // current dir for drag scroll
00036   DWORD m_dwNextScrollTime;       // time for next scroll
00037
00038   CDropTarget(CSimpleDoc FAR * pDoc) {
00039     OutputDebugString("In IDT's constructor\r\n");
00040     m_pDoc = pDoc;
00041     m_nCount = 0;
00042     m_fCanDropCopy = FALSE;
00043     m_fCanDropLink = FALSE;
00044     m_fDragFeedbackDrawn = FALSE;
00045     m_dwTimeEnterScrollArea = 0L;
00046     m_dwNextScrollTime = 0L;
00047     m_dwLastScrollDir = SCROLLDIR_NULL;
00048     };
00049
00050   ~CDropTarget() {
00051     OutputDebugString("In IDT's destructor\r\n");
00052     assert(m_nCount == 0);
00053     } ;
00054
00055   STDMETHODIMP QueryInterface (REFIID riid, LPVOID FAR* ppv);
00056   STDMETHODIMP_(ULONG) AddRef ();
00057   STDMETHODIMP_(ULONG) Release ();
00058
00059      // *** IDropTarget methods ***
00060   STDMETHODIMP DragEnter (LPDATAOBJECT pDataObj, DWORD grfKeyState,
00061       POINTL pt, LPDWORD pdwEffect);
00062   STDMETHODIMP DragOver  (DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect);
00063   STDMETHODIMP DragLeave ();
00064   STDMETHODIMP Drop (LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt,
00065       LPDWORD pdwEffect);
00066
00067 private:
00068   // Drag/Drop support methods
00069   BOOL QueryDrop (DWORD grfKeyState, POINTL pointl, BOOL fDragScroll,
00070       LPDWORD lpdwEffect);
00071   BOOL DoDragScroll( POINTL pointl );
00072   void InitDragFeedback(LPDATAOBJECT pDataObj, POINTL pointl);
00073   void DrawDragFeedback( POINTL pointl );
00074   void UndrawDragFeedback( void );
00075 };
00076
00077 #endif  // _IDT_H_
Generated on Wed Nov 13 2024 16:51:53 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Transaction/SampleBank/vjAcct/MsAdo15/EventReasonEnum.java Source File

  • Com
  • Services
  • Transaction
  • SampleBank
  • vjAcct
  • MsAdo15

EventReasonEnum.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("D:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /wfc  /w /xi /X:rkc /l "D:\DOCUME~1\erica\LOCALS~1\Temp\jvc22.tmp" /nologo /d "D:\mssdk\samples\Com\Services\Transaction\SampleBank\vjacct" "D:\Program Files\Common Files\System\ado\msado15.dll")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package msado15;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Enum: EventReasonEnum
00019
00020 public class EventReasonEnum extends com.ms.wfc.core.Enum
00021 {
00022   public static final short adRsnAddNew = 1;
00023   public static final short adRsnDelete = 2;
00024   public static final short adRsnUpdate = 3;
00025   public static final short adRsnUndoUpdate = 4;
00026   public static final short adRsnUndoAddNew = 5;
00027   public static final short adRsnUndoDelete = 6;
00028   public static final short adRsnRequery = 7;
00029   public static final short adRsnResynch = 8;
00030   public static final short adRsnClose = 9;
00031   public static final short adRsnMove = 10;
00032   public static final short adRsnFirstChange = 11;
00033   public static final short adRsnMoveFirst = 12;
00034   public static final short adRsnMoveNext = 13;
00035   public static final short adRsnMovePrevious = 14;
00036   public static final short adRsnMoveLast = 15;
00037 }
Generated on Wed Nov 13 2024 16:52:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/http/serviceconfig/ssl.c Source File

  • NetDS
  • http
  • serviceconfig

ssl.c

Go to the documentation of this file.
00001 /*++
00002  Copyright (c) 2002 - 2002 Microsoft Corporation.  All Rights Reserved.
00003
00004  THIS CODE AND INFORMATION IS PROVIDED "AS-IS" WITHOUT WARRANTY OF
00005  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007  PARTICULAR PURPOSE.
00008
00009  THIS CODE IS NOT SUPPORTED BY MICROSOFT.
00010
00011 --*/
00012
00013 #include "precomp.h"
00014 #pragma hdrstop
00015
00016 //
00017 // Macros
00018 //
00019 #define MAX_HASH 20
00020
00021 #define CONVERT_WCHAR(ch, n)                                            \
00022     if(iswdigit((ch)))                                                  \
00023     {                                                                   \
00024         (n) = (UCHAR)((ch) - L'0');                                     \
00025     }                                                                   \
00026     else if(iswxdigit((ch)))                                            \
00027     {                                                                   \
00028         (n) = (UCHAR) ((ch) + 10 - (iswlower((ch))?L'a':L'A'));         \
00029     }                                                                   \
00030     else                                                                \
00031     {                                                                   \
00032         NlsPutMsg(HTTPCFG_INVALID_HASH, pHash);                         \
00033         return ERROR_INVALID_PARAMETER;                                 \
00034     }
00035
00036 //
00037 // Private functions.
00038 //
00039
00040 /***************************************************************************++
00041
00042 Routine Description:
00043     Prints a record in the SSL store.
00044
00045 Arguments:
00046     pOutput - A pointer to HTTP_SERVICE_CONFIG_SSL_SET
00047
00048 Return Value:
00049     None.
00050
00051 --***************************************************************************/
00052 void
00053 PrintSslRecord(
00054     IN PUCHAR pOutput
00055     )
00056 {
00057     DWORD                        i;
00058     UNICODE_STRING               GuidString;
00059     WCHAR                        IpAddr[INET6_ADDRSTRLEN];
00060     DWORD                        dwIpAddrLen = INET6_ADDRSTRLEN;
00061     DWORD                        dwSockAddrLength;
00062     PUCHAR                       pStr;
00063     PSOCKADDR_IN                 pSockAddrIn;
00064     PHTTP_SERVICE_CONFIG_SSL_SET pSsl;
00065     DWORD                        Status;
00066
00067     pSsl = (PHTTP_SERVICE_CONFIG_SSL_SET) pOutput;
00068
00069
00070     // Convert address to string.
00071     //
00072
00073     pSockAddrIn = (PSOCKADDR_IN)  pSsl->KeyDesc.pIpPort;
00074     if(pSockAddrIn->sin_family == AF_INET)
00075     {
00076         dwSockAddrLength = sizeof(SOCKADDR_IN);
00077     }
00078     else if(pSockAddrIn->sin_family == AF_INET6)
00079     {
00080         dwSockAddrLength = sizeof(SOCKADDR_IN6);
00081     }
00082     else
00083     {
00084         // Status = ERROR_REGISTRY_CORRUPT;
00085         return;
00086     }
00087
00088     Status = WSAAddressToString(pSsl->KeyDesc.pIpPort,
00089                        dwSockAddrLength,
00090                        NULL,
00091                        IpAddr,
00092                        &dwIpAddrLen
00093                        );
00094
00095     if(NO_ERROR != Status)
00096     {
00097         return;
00098     }
00099
00100     // Print the Key.
00101     NlsPutMsg(HTTPCFG_SSL_IP,   IpAddr);
00102
00103     NlsPutMsg(HTTPCFG_SSL_HASH);
00104
00105
00106     pStr = (PUCHAR) pSsl->ParamDesc.pSslHash;
00107     for(i=0; i<pSsl->ParamDesc.SslHashLength; i++)
00108     {
00109         NlsPutMsg(HTTPCFG_CHAR,  pStr[i]);
00110     }
00111
00112     NlsPutMsg(HTTPCFG_NEWLINE);
00113
00114     Status = RtlStringFromGUID(&pSsl->ParamDesc.AppId, &GuidString);
00115
00116     if(NO_ERROR != Status)
00117     {
00118         return;
00119     }
00120
00121     NlsPutMsg(HTTPCFG_SSL_GUID, GuidString.Buffer);
00122
00123     RtlFreeUnicodeString(&GuidString);
00124
00125     NlsPutMsg(HTTPCFG_SSL_CERTSTORENAME,
00126               pSsl->ParamDesc.pSslCertStoreName
00127               );
00128
00129     NlsPutMsg(
00130               HTTPCFG_SSL_CERTCHECKMODE,
00131               pSsl->ParamDesc.DefaultCertCheckMode
00132               );
00133
00134     NlsPutMsg(
00135               HTTPCFG_SSL_REVOCATIONFRESHNESSTIME,
00136               pSsl->ParamDesc.DefaultRevocationFreshnessTime
00137               );
00138
00139     NlsPutMsg(
00140               HTTPCFG_SSL_REVOCATIONURLRETRIEVAL_TIMEOUT,
00141               pSsl->ParamDesc.DefaultRevocationUrlRetrievalTimeout
00142               );
00143
00144     NlsPutMsg(
00145               HTTPCFG_SSL_SSLCTLIDENTIFIER,
00146               pSsl->ParamDesc.pDefaultSslCtlIdentifier
00147               );
00148
00149     NlsPutMsg(
00150               HTTPCFG_SSL_SSLCTLSTORENAME,
00151               pSsl->ParamDesc.pDefaultSslCtlStoreName
00152               );
00153
00154     NlsPutMsg(
00155               HTTPCFG_SSL_FLAGS,
00156               pSsl->ParamDesc.DefaultFlags
00157               );
00158
00159     NlsPutMsg(
00160               HTTPCFG_RECORD_SEPARATOR
00161               );
00162 }
00163
00164 /***************************************************************************++
00165
00166 Routine Description:
00167     Sets a SSL entry.
00168
00169 Arguments:
00170     pIP            - The IP address.
00171     pGuid          - The GUID
00172     pHash          - Hash of the certificate.
00173     CertCheckMode  - CertCheckMode (Bit Field).
00174     Freshness      - DefaultRevocationFreshnessTime (seconds)
00175     Timeout        - DefaultRevocationUrlRetrievalTimeout
00176     Flags          - DefaultFlags.
00177     pCtlIdentifier - List of issuers that we want to trust.
00178     pCtlStoreName  - Store name under LOCAL_MACHINE where pCtlIdentifier
00179                      can be found.
00180     pCertStoreName - Store name under LOCAL_MACHINE where certificate
00181                      can be found.
00182 Return Value:
00183     Success/Failure.
00184
00185 --***************************************************************************/
00186 int
00187 DoSslSet(
00188     IN  PWCHAR pIp,
00189     IN  PWCHAR pGuid,
00190     IN  PWCHAR pHash,
00191     IN  DWORD  CertCheckMode,
00192     IN  DWORD  Freshness,
00193     IN  DWORD  Timeout,
00194     IN  DWORD  Flags,
00195     IN  PWCHAR pCtlIdentifier,
00196     IN  PWCHAR pCtlStoreName,
00197     IN  PWCHAR pCertStoreName
00198     )
00199 {
00200     HTTP_SERVICE_CONFIG_SSL_SET SetParam;
00201     UNICODE_STRING              GuidString;
00202     DWORD                       Status;
00203     SOCKADDR_STORAGE            TempSockAddr;
00204     USHORT                      HashLength;
00205     UCHAR                       BinaryHash[MAX_HASH];
00206     DWORD                       i, j;
00207     UCHAR                       n1, n2;
00208
00209     ZeroMemory(&SetParam, sizeof(SetParam));
00210
00211     SetParam.KeyDesc.pIpPort = (LPSOCKADDR)&TempSockAddr;
00212
00213     //
00214     // Convert the string based IP into a SOCKADDR
00215     //
00216     if((Status = GetAddress(pIp,
00217                             SetParam.KeyDesc.pIpPort,
00218                             sizeof(TempSockAddr)
00219                             )) != NO_ERROR)
00220     {
00221         NlsPutMsg(HTTPCFG_INVALID_IP, pIp);
00222         return Status;
00223     }
00224
00225     //
00226     // Convert the string to a GUID.
00227     //
00228     if(pGuid)
00229     {
00230         GuidString.Length        = (USHORT)wcslen(pGuid) * sizeof(WCHAR);
00231         GuidString.MaximumLength = (USHORT)GuidString.Length+1;
00232         GuidString.Buffer        = pGuid;
00233         Status = RtlGUIDFromString(&GuidString, &SetParam.ParamDesc.AppId);
00234
00235         if(Status != NO_ERROR)
00236         {
00237             NlsPutMsg(HTTPCFG_INVALID_GUID, pGuid);
00238             return Status;
00239         }
00240     }
00241
00242     if(pHash)
00243     {
00244         HashLength = (USHORT) wcslen(pHash);
00245
00246         for(i=0, j=0; i<MAX_HASH && HashLength >= 2; )
00247         {
00248             CONVERT_WCHAR(pHash[j], n1);
00249             CONVERT_WCHAR(pHash[j+1], n2);
00250
00251             BinaryHash[i] = ((n1<<4) & 0xF0) | (n2 & 0x0F);
00252
00253             // We've consumed 2 WCHARs
00254             HashLength -= 2;
00255             j += 2;
00256
00257             // and used up one byte in BinaryHash
00258             i ++;
00259         }
00260
00261         if(HashLength != 0 || i != MAX_HASH)
00262         {
00263             NlsPutMsg(HTTPCFG_INVALID_HASH, pHash);
00264             return ERROR_INVALID_PARAMETER;
00265         }
00266
00267         SetParam.ParamDesc.SslHashLength = i;
00268         SetParam.ParamDesc.pSslHash      = BinaryHash;
00269     }
00270
00271     SetParam.ParamDesc.pSslCertStoreName                    = pCertStoreName;
00272     SetParam.ParamDesc.pDefaultSslCtlIdentifier             = pCtlIdentifier;
00273     SetParam.ParamDesc.pDefaultSslCtlStoreName              = pCtlStoreName;
00274     SetParam.ParamDesc.DefaultCertCheckMode                 = CertCheckMode;
00275     SetParam.ParamDesc.DefaultRevocationFreshnessTime       = Freshness;
00276     SetParam.ParamDesc.DefaultRevocationUrlRetrievalTimeout = Timeout;
00277     SetParam.ParamDesc.DefaultFlags                         = Flags;
00278
00279     Status = HttpSetServiceConfiguration(
00280                 NULL,
00281                 HttpServiceConfigSSLCertInfo,
00282                 &SetParam,
00283                 sizeof(SetParam),
00284                 NULL
00285                 );
00286
00287     NlsPutMsg(HTTPCFG_SETSERVICE_STATUS, Status);
00288
00289     return Status;
00290 }
00291
00292 /***************************************************************************++
00293
00294 Routine Description:
00295     Queries for a SSL entry.
00296
00297 Arguments:
00298     pIp - The IP address (if NULL, then enumerate the store).
00299
00300 Return Value:
00301     Success/Failure.
00302
00303 --***************************************************************************/
00304 int DoSslQuery(
00305     IN PWCHAR pIp
00306     )
00307 {
00308     DWORD                          Status;
00309     PUCHAR                         pOutput = NULL;
00310     DWORD                          OutputLength = 0;
00311     DWORD                          ReturnLength = 0;
00312     HTTP_SERVICE_CONFIG_SSL_QUERY  QueryParam;
00313     SOCKADDR_STORAGE               TempSockAddr;
00314
00315     ZeroMemory(&QueryParam, sizeof(QueryParam));
00316
00317     if(pIp)
00318     {
00319         // if an IP address is specified, we'll covert it to a SOCKADDR
00320         // and do an exact query.
00321
00322         QueryParam.QueryDesc = HttpServiceConfigQueryExact;
00323         QueryParam.KeyDesc.pIpPort = (LPSOCKADDR)&TempSockAddr;
00324
00325         if((Status = GetAddress(pIp,
00326                                 QueryParam.KeyDesc.pIpPort,
00327                                 sizeof(TempSockAddr)
00328                                 )) != NO_ERROR)
00329         {
00330             NlsPutMsg(HTTPCFG_INVALID_IP, pIp);
00331             return Status;
00332         }
00333     }
00334     else
00335     {
00336         // We are enumerating all the records in the SSL store.
00337         QueryParam.QueryDesc = HttpServiceConfigQueryNext;
00338     }
00339
00340     for(;;)
00341     {
00342         //
00343         // First, compute the bytes required to enumerate an entry.
00344         //
00345         Status = HttpQueryServiceConfiguration(
00346                     NULL,
00347                     HttpServiceConfigSSLCertInfo,
00348                     &QueryParam,
00349                     sizeof(QueryParam),
00350                     pOutput,
00351                     OutputLength,
00352                     &ReturnLength,
00353                     NULL
00354                     );
00355
00356         if(Status == ERROR_INSUFFICIENT_BUFFER)
00357         {
00358             // If the API completes with ERROR_INSUFFICIENT_BUFFER, we'll
00359             // allocate memory for it & continue with the loop where we'll
00360             // call it again.
00361
00362             if(pOutput)
00363             {
00364                 // If there was an existing buffer, free it.
00365                 LocalFree(pOutput);
00366             }
00367
00368             // Allocate a new buffer
00369
00370             pOutput = LocalAlloc(LMEM_FIXED, ReturnLength);
00371             if(!pOutput)
00372             {
00373                 return ERROR_NOT_ENOUGH_MEMORY;
00374             }
00375
00376             OutputLength = ReturnLength;
00377         }
00378         else if(Status == NO_ERROR)
00379         {
00380             // The query succeeded! We'll print the record that we just
00381             // queried.
00382             //
00383             PrintSslRecord(pOutput);
00384
00385             if(pIp != NULL)
00386             {
00387                 //
00388                 // If we are not enumerating, we are done.
00389                 //
00390                 break;
00391             }
00392             else
00393             {
00394                 //
00395                 // Since we are enumerating, we'll move on to the next
00396                 // record. This is done by incrementing the cursor, till
00397                 // we get ERROR_NO_MORE_ITEMS.
00398                 //
00399                 QueryParam.dwToken ++;
00400             }
00401         }
00402         else if(ERROR_NO_MORE_ITEMS == Status && !pIp)
00403         {
00404             // We are enumerating and we have reached the end. This is
00405             // indicated by a ERROR_NO_MORE_ITEMS error code.
00406
00407             // This is not a real error, since it is used to indicate that
00408             // we've finished enumeration.
00409
00410             Status = NO_ERROR;
00411             break;
00412         }
00413         else
00414         {
00415             //
00416             // Some other error, so we are done
00417             //
00418             NlsPutMsg(HTTPCFG_QUERYSERVICE_STATUS, Status);
00419             break;
00420         }
00421     }
00422
00423     if(pOutput)
00424     {
00425         LocalFree(pOutput);
00426     }
00427
00428     return Status;
00429 }
00430
00431
00432 /***************************************************************************++
00433
00434 Routine Description:
00435     Deletes a SSL entry.
00436
00437 Arguments:
00438     pIP - The IP address of entry to be deleted.
00439
00440 Return Value:
00441     Success/Failure.
00442
00443 --***************************************************************************/
00444 int DoSslDelete(
00445     IN PWCHAR pIp
00446     )
00447 {
00448     HTTP_SERVICE_CONFIG_SSL_SET SetParam;
00449     DWORD                       Status;
00450     SOCKADDR_STORAGE            TempSockAddr;
00451
00452     SetParam.KeyDesc.pIpPort = (LPSOCKADDR)&TempSockAddr;
00453
00454     // Convert string IP address to a SOCKADDR structure
00455     Status = GetAddress(pIp,
00456                         SetParam.KeyDesc.pIpPort,
00457                         sizeof(TempSockAddr)
00458                         );
00459
00460     if(Status != NO_ERROR)
00461     {
00462         NlsPutMsg(HTTPCFG_INVALID_IP, pIp);
00463         return Status;
00464     }
00465
00466     // Call the API.
00467     Status = HttpDeleteServiceConfiguration(
00468                 NULL,
00469                 HttpServiceConfigSSLCertInfo,
00470                 &SetParam,
00471                 sizeof(SetParam),
00472                 NULL
00473                 );
00474
00475     NlsPutMsg(HTTPCFG_DELETESERVICE_STATUS, Status);
00476     return Status;
00477 }
00478
00479 //
00480 // Public functions.
00481 //
00482
00483 /***************************************************************************++
00484
00485 Routine Description:
00486     The function that parses parameters specific to SSL
00487     calls Set, Query or Delete.
00488
00489 Arguments:
00490     argc - Count of arguments.
00491     argv - Pointer to command line arguments.
00492     Type - Type of operation to be performed.
00493
00494 Return Value:
00495     Success/Failure.
00496
00497 --***************************************************************************/
00498 int DoSsl(
00499     int argc,
00500     WCHAR **argv,
00501     HTTPCFG_TYPE type
00502     )
00503 {
00504     PWCHAR   pGuid             = NULL;
00505     PWCHAR   pHash             = NULL;
00506     PWCHAR   pCertStoreName    = NULL;
00507     PWCHAR   pCtlIdentifier    = NULL;
00508     PWCHAR   pCtlStoreName     = NULL;
00509     DWORD    CertCheckMode     = 0;
00510     DWORD    Freshness         = 0;
00511     DWORD    Timeout           = 0;
00512     DWORD    Flags             = 0;
00513     PWCHAR   pIp               = NULL;
00514
00515     while(argc >= 2 && (argv[0][0] == L'-' || argv[0][0] == L'/'))
00516     {
00517         switch(toupper(argv[0][1]))
00518         {
00519             case 'I':
00520                 pIp = argv[1];
00521                 break;
00522
00523             case 'C':
00524                 pCertStoreName = argv[1];
00525                 break;
00526
00527             case 'N':
00528                 pCtlStoreName = argv[1];
00529                 break;
00530
00531             case 'T':
00532                 pCtlIdentifier = argv[1];
00533                 break;
00534
00535             case 'M':
00536                 CertCheckMode = _wtoi(argv[1]);
00537                 break;
00538
00539             case 'R':
00540                 Freshness = _wtoi(argv[1]);
00541                 break;
00542
00543             case 'X':
00544                 Timeout = _wtoi(argv[1]);
00545                 break;
00546
00547             case 'F':
00548                 Flags = _wtoi(argv[1]);
00549                 break;
00550
00551             case 'G':
00552                 pGuid = argv[1];
00553                 break;
00554
00555             case 'H':
00556                 pHash = argv[1];
00557                 break;
00558
00559             default:
00560                 NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00561                 return ERROR_INVALID_PARAMETER;
00562         }
00563
00564         argc -=2;
00565         argv +=2;
00566     }
00567
00568     switch(type)
00569     {
00570         case HttpCfgTypeSet:
00571             return DoSslSet(
00572                         pIp,
00573                         pGuid,
00574                         pHash,
00575                         CertCheckMode,
00576                         Freshness,
00577                         Timeout,
00578                         Flags,
00579                         pCtlIdentifier,
00580                         pCtlStoreName,
00581                         pCertStoreName
00582                         );
00583
00584         case HttpCfgTypeQuery:
00585             return DoSslQuery(pIp);
00586
00587         case HttpCfgTypeDelete:
00588             return DoSslDelete(pIp);
00589
00590         default:
00591             NlsPutMsg(HTTPCFG_INVALID_SWITCH, argv[0]);
00592             return ERROR_INVALID_PARAMETER;
00593             break;
00594     }
00595 }
Generated on Wed Nov 13 2024 16:52:18 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/proppage/globals.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • proppage

globals.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013
00014 #ifndef _MMC_GLOBALS_H
00015 #define _MMC_GLOBALS_H
00016
00017 #include <TChar.h>
00018 #include <Mmc.h>
00019 #include <CrtDbg.h>
00020 #include "Guids.h"
00021
00022
00023 class CBaseNode;                       // References
00024 class CDataObject;
00025
00026
00027 //---------------------------------------------------------------------------
00028 extern HINSTANCE g_hInst;              // Global instance handle
00029 extern ULONG     g_uObjectCount;       // Instance count for this object
00030 extern ULONG     g_uServerLocks;       // Server lock count for this object
00031
00032 //---------------------------------------------------------------------------
00033 // Clipformats requiered by MMC
00034
00035 extern UINT g_cfDisplayName;      // DisplayName for our SnapIn node
00036 extern UINT g_cfNodeType;         // GUID of the selected node
00037 extern UINT g_cfSnapinClsid;      // Class ID of this SnapIn
00038 extern UINT g_cfszNodeType;       // String version of namespace GUID
00039
00040 //---------------------------------------------------------------------------
00041 // Custom clipformats
00042
00043 extern UINT g_cfBaseNodePtr;      // Retrieves BaseNode pointer
00044 extern UINT g_cfDataObjPtr;       // Retrieves pointer to CDataObject
00045
00046 //---------------------------------------------------------------------------
00047 //  XPROPPAGE: New clipformat for PropertyPage extensions
00048
00049 extern UINT g_cfNodeAttrPtr;      // Support for PropertyPage extensions
00050
00051 //---------------------------------------------------------------------------
00052 //  Global function prototypes
00053
00054 void _fastcall Unicode2Ansi( CHAR** pszAnsi, WCHAR* szWide );
00055 void _fastcall CopyT2W( LPWSTR strDest, LPCTSTR strSource, size_t count);
00056
00057 void InitClipboardFormats();
00058
00059 HRESULT ExtractFromDataObject( LPDATAOBJECT ipDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal );
00060
00061 CBaseNode* ExtractBaseNodePtr( LPDATAOBJECT ipDataObject );
00062 CDataObject* ExtractDataObjPtr( LPDATAOBJECT ipDataObject );
00063
00064 //---------------------------------------------------------------------------
00065 //  Global Strings
00066
00067
00068 static TCHAR*  gtszSNAPIN_NAME       = _T("Sample G (MMC 2.0) - Property Pages");
00069 static TCHAR*  gtszABOUT_NAME        = _T("Sample G (MMC 2.0) - ISnapinAbout");
00070
00071 static WCHAR*  gwszROOT_NODE_NAME    = L"Property Pages Sample";
00072 static WCHAR*  gwszABOUT_DESCRIPTION = L"MMC SDK Property Pages Sample";
00073 static WCHAR*  gwszABOUT_PROVIDER    = L"Copyright © 1999 - 2001 Microsoft Corporation";
00074 static WCHAR*  gwszABOUT_VERSION     = L"1.2";
00075
00076 //XPROPPAGE:  GUID strings for nodes which we will allow to be extended.
00077 static TCHAR*  gtszVFILE_GUID        = _T("{F0091C49-C869-4941-A81C-C719AD8174CC}");
00078
00079 // We need to do this to get around MMC.IDL - it explicitly defines
00080 // the clipboard formats as WCHAR types...
00081 #define T_CCF_DISPLAY_NAME    _T("CCF_DISPLAY_NAME")
00082 #define T_CCF_NODETYPE        _T("CCF_NODETYPE")
00083 #define T_CCF_SZNODETYPE      _T("CCF_SZNODETYPE")
00084 #define T_CCF_SNAPIN_CLASSID  _T("CCF_SNAPIN_CLASSID")
00085
00086 #define T_CCF_BASENODE_PTR    _T("CCF_BASENODE_PTR")
00087 #define T_CCF_DATAOBJ_PTR     _T("CCF_DATAOBJ_PTR")
00088
00089 // XPROPPAGE:  Define the new clipformat
00090 #define T_CCF_ATTRIB_PTR      _T("CCF_ATTRIB_PTR")
00091
00092 #define MAX_OBJECT_PATH        255
00093
00094 // XPROPPAGE:  This is the clipboard format
00095 typedef struct _tag_NODE_ATTRIB_
00096 {
00097   WCHAR    szObjectPath[MAX_OBJECT_PATH];
00098
00099 } NODE_ATTRIBS;
00100
00101
00102 //---------------------------------------------------------------------------
00103 // Constants
00104
00105 #define NODETYPE_STATIC                100   // Node Types
00106 #define NODETYPE_DEVICE                200
00107 #define NODETYPE_FOLDER                300
00108 #define NODETYPE_VFILE                 400
00109
00110
00111 #define ATTRIBUTE_DATA_ARCHIVE         2     // Node Attributes
00112 #define ATTRIBUTE_DATA_HIDDEN          4
00113 #define ATTRIBUTE_DATA_LOCKED          8
00114 #define ATTRIBUTE_DATA_READONLY        16
00115 #define ATTRIBUTE_BACKUP_DEVICE        32
00116
00117
00118 #define IMG_DEVICE_DEFAULT             0     // Image Indexes
00119 #define IMG_DEVICE_OFFLINE             1
00120 #define IMG_DATA_FILE                  2
00121 #define IMG_DRIVE_DEFAULT              3
00122 #define IMG_DRIVE_OFFLINE              4
00123 #define IMG_FOLDER_DEFAULT             5
00124 #define IMG_CDROM_DEFAULT              6
00125 #define IMG_REMOVABLE_MEDIA            7
00126
00127 #define IDM_NEW_DEVICE                 100
00128 #define IDM_NEW_FOLDER                 200
00129 #define IDM_TOGGLE_STATUS              300
00130 #define IDM_NEW_VIRTFILE               400   // RESULTITEM:  New menu
00131
00132 #define STATUS_ONLINE                  1
00133 #define STATUS_OFFLINE                 0
00134
00135 // Define some custom window messages so that objects running in
00136 // different threads can send us commands.
00137 //
00138 #define WM_DEL_DEVICENODES             (WM_USER + 100)
00139 #define WM_ADD_DEVICENODE              (WM_USER + 101)
00140 #define WM_DEVICENODE_CLOSED           (WM_USER + 102)
00141 #define WM_ADD_VIRTUALFILE             (WM_USER + 103)
00142 #define WM_VIRTUALFILE_CLOSED          (WM_USER + 104)
00143
00144
00145 // Defines interfaces which can be requested from IComponentData
00146 // or IComponet's ::GetInterface method
00147 //
00148 #define REQUEST_ICONSOLENAMESPACE2     1000
00149 #define REQUEST_ICONSOLE               1001
00150 #define REQUEST_ICONSOLEVERB           1002
00151 #define REQUEST_IRESULTDATA            1003
00152 #define REQUEST_IHEADERCTRL            1004
00153
00154
00155 /////////////////////////////////////////////////////////////////////////////
00156 // Helper classes and macros
00157
00158 #define BYTE_SIZE(string)          ((_tcslen(string)+1) * sizeof(TCHAR))
00159
00160 #define BREAK_ON_ERROR( hResult )  if( S_OK != hResult ) continue
00161
00162 // Useful only for debugging.  Never use modal dialogs in release builds!!
00163 #define MsgBox(wszMsg, wszTitle) ::MessageBox(NULL, wszMsg, wszTitle, MB_OK)
00164
00165
00166 //---------------------------------------------------------------------------
00167 template<class TYPE>
00168 inline void SAFE_RELEASE( TYPE*& pObj )
00169 {
00170   if( NULL != pObj )
00171   {
00172     pObj->Release();
00173     pObj = NULL;
00174   }
00175   else
00176   {
00177     OutputDebugString(_T("Attempted to release NULL Com pointer.\n"));
00178   }
00179 }
00180
00181 //---------------------------------------------------------------------------
00182 template<class TYPE>
00183 inline void SAFE_FREE_BITMAP( TYPE*& pObj )
00184 {
00185   if( NULL != pObj )
00186   {
00187     BOOL bStatus = DeleteObject( pObj );
00188     pObj = NULL;
00189   }
00190   else
00191   {
00192     OutputDebugString(_T("Attempted to delete NULL Bitmap handle.\n"));
00193   }
00194 }
00195
00196 //---------------------------------------------------------------------------
00197 template<class TYPE>
00198 inline void SAFE_FREE_ICON( TYPE*& pObj )
00199 {
00200   if( NULL != pObj )
00201   {
00202     BOOL bStatus = DestroyIcon( pObj );
00203     pObj = NULL;
00204   }
00205   else
00206   {
00207     OutputDebugString(_T("Attempted to delete NULL Icon handle.\n"));
00208   }
00209 }
00210
00211
00212
00213 //---------------------------------------------------------------------------
00214 //  W2T converts a wide character string to unicode if _UNICODE is not
00215 //  defined.  If it is defined then the sting is copied to another buffer.
00216 //
00217 #ifndef _UNICODE
00218 #define W2T( szAnsiPtr, szWide )   Unicode2Ansi( szAnsiPtr, szWide )
00219 #else
00220 #define W2T( szAnsiPtr, szWide )                                 \
00221         *szAnsiPtr = (WCHAR*)CoTaskMemAlloc(BYTE_SIZE(szWide) ); \
00222         CopyMemory( *szAnsiPtr, szWide, BYTE_SIZE(szWide) )
00223
00224 #endif //_UNICODE
00225
00226
00227 #endif //_MMC_GLOBALS_H
Generated on Wed Nov 13 2024 16:52:22 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Security/capicom/cpp/isapiCertPolicy/ErrorTxt.h Source File

  • Security
  • capicom
  • cpp
  • isapiCertPolicy

ErrorTxt.h

Go to the documentation of this file.
00001 // ErrorTxt.h
00002
00003 const char g_szHttpError403_16[] =
00004     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\r\n"
00005     "<html dir=\"ltr\">\r\n"
00006     "<head>\r\n"
00007     "<title>The page requires a valid client certificate</title>\r\n"
00008     "<style> a:link {font:8pt/11pt verdana; color:FF0000}\r\n"
00009     "a:visited {font:8pt/11pt verdana; color:#4e4e4e}\r\n"
00010     "</style>\r\n"
00011     "<META NAME=\"ROBOTS\" CONTENT=\"NOINDEX\">\r\n"
00012     "<META HTTP-EQUIV=\"Content-Type\" Content=\"text-html; charset=Windows-1252\">\r\n"
00013     "<script>\r\n"
00014     "function Homepage(){\r\n"
00015     "<!--\r\n"
00016     "// in real bits, urls get returned to our script like this:\r\n"
00017     "// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm\r\n"
00018
00019     "//For testing use DocURL = \"res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm\"\r\n"
00020     "DocURL=document.URL;\r\n"
00021
00022     "//this is where the http or https will be, as found by searching for :// but skipping the res://\r\n"
00023     "protocolIndex=DocURL.indexOf(\"://\",4);\r\n"
00024
00025     "//this finds the ending slash for the domain server\r\n"
00026     "serverIndex=DocURL.indexOf(\"/\",protocolIndex + 3);\r\n"
00027
00028     "//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining\r\n"
00029     "//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.\r\n"
00030     "//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);\r\n"
00031     "BeginURL=DocURL.indexOf(\"#\",1) + 1;\r\n"
00032     "urlresult=DocURL.substring(BeginURL,serverIndex);\r\n"
00033
00034     "//for display, we need to skip after http://, and go to the next slash\r\n"
00035     "displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);\r\n"
00036     "document.write('<A HREF=\"' + urlresult + '\">' + displayresult + \"</a>\");\r\n"
00037     "}\r\n"
00038     "//-->\r\n"
00039     "</script>\r\n"
00040     "</head>\r\n"
00041     "<body bgcolor=\"#ffffff\">\r\n"
00042     "<table width=\"410\" cellpadding=\"3\" cellspacing=\"5\">\r\n"
00043     "<tr>\r\n"
00044     "<td align=\"left\" valign=\"center\">\r\n"
00045     "<h1 style=\"FONT:13pt/15pt verdana; COLOR:#000000\"><!--Problem--> The page requires\r\n"
00046     "an ITG issued certificate</h1>\r\n"
00047     "</td>\r\n"
00048     "</tr>\r\n"
00049     "<tr>\r\n"
00050     "<td width=\"400\" colspan=\"2\">\r\n"
00051     "<font style=\"FONT:8pt/11pt verdana; COLOR:#000000\">The page you are trying to view\r\n"
00052     "requires the use of a&nbsp;client certificate and key pair&nbsp;certified by\r\n"
00053     "specific issuer and managed on a <A href=\"http://smartcards\">smartcard</A>. You presented a\r\n"
00054     "client certificate but it did not meet these requirements.</font></td>\r\n"
00055     "</tr>\r\n"
00056     "<tr>\r\n"
00057     "<td width=\"400\" colspan=\"2\">\r\n"
00058     "<font style=\"FONT:8pt/11pt verdana; COLOR:#000000\">\r\n"
00059     "<hr color=\"#c0c0c0\" noshade>\r\n"
00060     "<p>Please try the following:</p>\r\n"
00061     "<ul>\r\n"
00062     "<li>\r\n"
00063     "To present a different certificate, close this window and try to\r\n"
00064     "access this resource again.\r\n"
00065     "<li>\r\n"
00066     "If you need to access this resource and have not been issued a client\r\n"
00067     "certificate please contact the websites administrator to request one.\r\n"
00068     "<li>\r\n"
00069     "If you continue havin problems accessing this resource please\r\n"
00070     "contact the website administrator.</li>\r\n"
00071     "</ul>\r\n"
00072     "<h2 style=\"FONT:8pt/11pt verdana; COLOR:#000000\">HTTP 403.16a - Forbidden: Client\r\n"
00073     "certificate&nbsp;presented does not satisfy&nbsp;the sites security\r\n"
00074     "policies.&nbsp;&nbsp;<br>\r\n"
00075     "Internet Information Services</h2>\r\n"
00076     "<hr color=\"#c0c0c0\" noshade>\r\n"
00077     "<p>Technical Information (for support personnel)</p>\r\n"
00078     "<ul>\r\n"
00079     "<li>\r\n"
00080     "More information:<br>\r\n"
00081     "<a href=\"http://www.microsoft.com/ContentRedirect.asp?prd=iis&amp;sbp=&amp;pver=5.0&amp;pid=&amp;ID=403.16&amp;cat=web&amp;os=&amp;over=&amp;hrd=&amp;Opt1=&amp;Opt2=&amp;Opt3=\" target=\"_blank\">\r\n"
00082     "Microsoft Support</a>\r\n"
00083     "</li>\r\n"
00084     "</ul>\r\n"
00085     "</font>\r\n"
00086     "</td>\r\n"
00087     "</tr>\r\n"
00088     "</table>\r\n"
00089     "</body>\r\n"
00090     "</html>\r\n";
00091
00092 const char g_szHttpError500[] =
00093     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\r\n"
00094     "<html dir=ltr>\r\n"
00095     "<head>\r\n"
00096     "<style>\r\n"
00097     "a:link          {font:8pt/11pt verdana; color:FF0000}\r\n"
00098     "a:visited       {font:8pt/11pt verdana; color:#4e4e4e}\r\n"
00099     "</style>\r\n"
00100     "<META NAME=\"ROBOTS\" CONTENT=\"NOINDEX\">\r\n"
00101     "<title>The page cannot be displayed</title>\r\n"
00102     "<META HTTP-EQUIV=\"Content-Type\" Content=\"text-html; charset=Windows-1252\">\r\n"
00103     "</head>\r\n"
00104     "<script>\r\n"
00105     "function Homepage(){\r\n"
00106     "<!--\r\n"
00107     "// in real bits, urls get returned to our script like this:\r\n"
00108     "// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm\r\n"
00109     "    //For testing use DocURL = \"res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm\"\r\n"
00110     "    DocURL=document.URL;\r\n"
00111     "    //this is where the http or https will be, as found by searching for :// but skipping the res://\r\n"
00112     "    protocolIndex=DocURL.indexOf(\"://\",4);\r\n"
00113     "    //this finds the ending slash for the domain server\r\n"
00114     "    serverIndex=DocURL.indexOf(\"/\",protocolIndex + 3);\r\n"
00115     "    //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining\r\n"
00116     "    //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.\r\n"
00117     "    //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);\r\n"
00118     "    BeginURL=DocURL.indexOf(\"#\",1) + 1;\r\n"
00119     "    urlresult=DocURL.substring(BeginURL,serverIndex);\r\n"
00120     "    //for display, we need to skip after http://, and go to the next slash\r\n"
00121     "    displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);\r\n"
00122     "    document.write( '<A HREF=\"' + escape(urlresult) + '\">' + displayresult + \"</a>\");\r\n"
00123     "}\r\n"
00124     "//-->\r\n"
00125     "</script>\r\n"
00126     "<body bgcolor=\"FFFFFF\">\r\n"
00127     "<table width=\"410\" cellpadding=\"3\" cellspacing=\"5\">\r\n"
00128     "  <tr>\r\n"
00129     "    <td align=\"left\" valign=\"middle\" width=\"360\">\r\n"
00130     "    <h1 style=\"COLOR:000000; FONT: 13pt/15pt verdana\"><!--Problem-->The page cannot be displayed</h1>\r\n"
00131     "    </td>\r\n"
00132     "  </tr>\r\n"
00133     "  <tr>\r\n"
00134     "    <td width=\"400\" colspan=\"2\">\r\n"
00135     "    <font style=\"COLOR:000000; FONT: 8pt/11pt verdana\">There is a problem with the page you are trying to reach and it cannot be displayed.</font></td>\r\n"
00136     "  </tr>\r\n"
00137     "  <tr>\r\n"
00138     "    <td width=\"400\" colspan=\"2\">\r\n"
00139     "    <font style=\"COLOR:000000; FONT: 8pt/11pt verdana\">\r\n"
00140     "    <hr color=\"#C0C0C0\" noshade>\r\n"
00141     "    <p>Please try the following:</p>\r\n"
00142     "    <ul>\r\n"
00143     "      <li>Open the\r\n"
00144     "      <script>\r\n"
00145     "      <!--\r\n"
00146     "      if (!((window.navigator.userAgent.indexOf(\"MSIE\") > 0) && (window.navigator.appVersion.charAt(0) == \"2\")))\r\n"
00147     "      {\r\n"
00148     "            Homepage();\r\n"
00149     "      }\r\n"
00150     "      //-->\r\n"
00151     "      </script>\r\n"
00152     "      home page, and then look for links to the information you want.</li>\r\n"
00153     "      <li>Click the <a href=\"javascript:location.reload()\">\r\n"
00154     "      Refresh</a> button, or try again later.<br>\r\n"
00155     "      </li>\r\n"
00156     "    </ul>\r\n"
00157     "    <h2 style=\"font:8pt/11pt verdana; color:000000\">HTTP 500 - Internal server\r\n"
00158     "    error <br>\r\n"
00159     "    Internet Information Services</h2>\r\n"
00160     "    <hr color=\"#C0C0C0\" noshade>\r\n"
00161     "    <p>Technical Information (for support personnel)</p>\r\n"
00162     "<ul>\r\n"
00163     "<li>More information:<br>\r\n"
00164     "<a href=\"http://www.microsoft.com/ContentRedirect.asp?prd=iis&sbp=&pver=5.0&pid=&ID=500&cat=web&os=&over=&hrd=&Opt1=&Opt2=&Opt3=\" target=\"_blank\">Microsoft Support</a>\r\n"
00165     "</li>\r\n"
00166     "</ul>\r\n"
00167     "    </font></td>\r\n"
00168     "  </tr>\r\n"
00169     "</table>\r\n"
00170     "</body>\r\n"
00171     "</html>\r\n";
Generated on Wed Nov 13 2024 16:52:27 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

COleInPlaceObject Member List

This is the complete list of members for COleInPlaceObject, including all inherited members.
COleInPlaceObject(COleDocument *) | COleInPlaceObject |
ContextSensitiveHelp(BOOL) | COleInPlaceObject |
GetWindow(HWND *) | COleInPlaceObject |
InPlaceDeactivate() | COleInPlaceObject |
m_pOleDoc | COleInPlaceObject | [private]
QueryInterface(REFIID, LPVOID *) | COleInPlaceObject |
ReactivateAndUndo() | COleInPlaceObject |
SetObjectRects(LPCRECT, LPCRECT) | COleInPlaceObject |
STDMETHODIMP_(ULONG) AddRef() | COleInPlaceObject |
STDMETHODIMP_(ULONG) Release() | COleInPlaceObject |
UIDeactivate() | COleInPlaceObject |
~COleInPlaceObject() | COleInPlaceObject |
Generated on Wed Nov 13 2024 16:57:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

tagOleStdEnumStatData Member List

This is the complete list of members for tagOleStdEnumStatData, including all inherited members.
lpVtbl | tagOleStdEnumStatData
m_dwRefs | tagOleStdEnumStatData
m_lpStat | tagOleStdEnumStatData
m_nCount | tagOleStdEnumStatData
m_nIndex | tagOleStdEnumStatData
Generated on Wed Nov 13 2024 16:58:00 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/WMI/VC/decoupled/Instance_Provider/PreComp.h Source File

  • SysMgmt
  • WMI
  • VC
  • decoupled
  • Instance_Provider

PreComp.h

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (C)  Microsoft Corporation
00004
00005 Module Name:
00006
00007   Precomp.h
00008
00009 Abstract:
00010
00011
00012 History:
00013
00014 --*/
00015
00016 #define _WIN32_WINNT 0x0500
00017
00018 #include <windows.h>
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include <string.h>
00022 #include <tchar.h>
Generated on Wed Nov 13 2024 16:51:43 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/WindowsMediaServices9/Authorization/stdafx.cpp Source File

  • Multimedia
  • WindowsMediaServices9
  • Authorization

stdafx.cpp

Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 // Microsoft Windows Media
00004 // Copyright (C) Microsoft Corporation. All rights reserved.
00005 //
00006 // FileName: StdAfx.cpp
00007 //
00008 // Abstract:
00009 //
00010 //*****************************************************************************
00011 #include "stdafx.h"
00012
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CAccount Member List

This is the complete list of members for CAccount, including all inherited members.
Activate() | CAccount |
CAccount() | CAccount | [inline]
CAccount() | CAccount | [inline]
CAccount() | CAccount | [inline]
CAccount() | CAccount | [inline]
Construct(IDispatch *pUnk) | CAccount |
d_acctBalance | CAccount | [private]
DoWork(long lAccount, long lAmount, BSTR *pbstrResult) | CAccount |
Enlist() | CAccount |
FinalConstruct() | CAccount | [inline]
FinalRelease() | CAccount |
InterfaceSupportsErrorInfo(REFIID riid) | CAccount |
InterfaceSupportsErrorInfo(REFIID riid) | CAccount |
InterfaceSupportsErrorInfo(REFIID riid) | CAccount |
InterfaceSupportsErrorInfo(REFIID riid) | CAccount |
m_bConstructed | CAccount | [private]
m_bObjectPooled | CAccount | [private]
m_bShouldEnlist | CAccount | [private]
m_hdbc | CAccount | [private]
m_henv | CAccount | [private]
m_hstmt | CAccount | [private]
m_sDSN | CAccount | [private]
m_txuow | CAccount | [private]
Post(IN long lAccount, IN long lAmount, OUT BSTR *pbstrResult) | CAccount |
Post(IN long lAccount, IN long lAmount, OUT BSTR *pbstrResult) | CAccount |
Post(IN long lAccount, IN long lAmount, OUT BSTR *pbstrResult) | CAccount |
Post(long lngAccntNum, long lngAmount, BSTR *pVal) | CAccount |
STDMETHODIMP_(BOOL) CanBePooled() | CAccount | [inline]
STDMETHODIMP_(void) Deactivate() | CAccount | [inline]
~CAccount() | CAccount | [inline]
Generated on Wed Nov 13 2024 16:55:28 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Administration/Spy/ComSpyAudit/StdAfx.h Source File

  • Com
  • Administration
  • Spy
  • ComSpyAudit

StdAfx.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // This file is part of the Microsoft COM+ Samples.
00004 //
00005 // Copyright (C) 1995-2000 Microsoft Corporation. All rights reserved.
00006 //
00007 // This source code is intended only as a supplement to Microsoft
00008 // Development Tools and/or on-line documentation. See these other
00009 // materials for detailed information regarding Microsoft code samples.
00010 //
00011 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00012 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00013 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00014 // PARTICULAR PURPOSE.
00015 //
00016 // ----------------------------------------------------------------------------
00017 #if !defined(AFX_STDAFX_H__AFCF0619_1429_11D1_B1B8_00AA00BA3258__INCLUDED_)
00018 #define AFX_STDAFX_H__AFCF0619_1429_11D1_B1B8_00AA00BA3258__INCLUDED_
00019
00020 #if _MSC_VER >= 1000
00021 #pragma once
00022 #endif // _MSC_VER >= 1000
00023
00024 #define STRICT
00025
00026
00027 #if !defined(_WIN32_WINNT)
00028 #define _WIN32_WINNT 0x0500
00029 #endif // !defined(_WIN32_WINNT)
00030
00031 #define _ATL_APARTMENT_THREADED
00032
00033
00034 #include <atlbase.h>
00035 //You may derive a class from CComModule and use it if you want to override
00036 //something, but do not change the name of _Module
00037 extern CComModule _Module;
00038 #include <atlcom.h>
00039
00040 //{{AFX_INSERT_LOCATION}}
00041 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00042
00043 #endif // !defined(AFX_STDAFX_H__AFCF0619_1429_11D1_B1B8_00AA00BA3258__INCLUDED)
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/TutSamp/RemClien/RemClien.h Source File

  • Com
  • Fundamentals
  • TutSamp
  • RemClien

RemClien.h

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      REMCLIEN.H
00003
00004   Summary:   Main include file for the REMCLIEN executable. In addition to
00005              class definitions, this REMCLIEN.H file contains definitions
00006              of the application's menu, string, and other resource IDs.
00007
00008              Based largely on the APTCLIEN.EXE source code, this include
00009              file adds resource IDs for the set of menus for exercising
00010              the several COM Components manipulated in this code sample
00011              as a COM Client of those components housed in the APTSERVE
00012              remote server.
00013
00014              For a comprehensive tutorial code tour of REMCLIEN's
00015              contents and offerings see the tutoorial REMCLIEN.HTM file.
00016              For more specific technical details on the internal workings
00017              see the comments dispersed throughout the REMCLIEN source code.
00018
00019   Classes:   CMainWindow
00020
00021   Functions: WinMain
00022
00023   Origin:    12-28-96: atrent - Editor-inheritance from the APTCLIEN source.
00024
00025 ----------------------------------------------------------------------------
00026   This file is part of the Microsoft COM Tutorial Code Samples.
00027
00028   Copyright (C) 1995 - 2000 Microsoft Corporation.  All rights reserved.
00029
00030   This source code is intended only as a supplement to Microsoft
00031   Development Tools and/or on-line documentation.  See these other
00032   materials for detailed information regarding Microsoft code samples.
00033
00034   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00035   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00036   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00037   PARTICULAR PURPOSE.
00038 ==========================================================================+*/
00039
00040 #if !defined(REMCLIEN_H)
00041 #define REMCLIEN_H
00042
00043 #ifdef __cplusplus
00044
00045 extern CMsgLog* g_pMsgLog;
00046 extern COSERVERINFO g_ServerInfo;
00047
00048 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00049   Class:    CMainWindow
00050
00051   Summary:  Class to encapsulate the application's main window, menu, and
00052             message dispatching behavior.
00053
00054   Methods:  CMainWindow
00055               Constructor.
00056             InitInstance
00057               Creates a new instance of the main window.
00058 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00059 class CMainWindow: public CVirWindow
00060 {
00061 public:
00062   CMainWindow();
00063   ~CMainWindow();
00064   BOOL InitInstance(HINSTANCE, int);
00065
00066   TCHAR m_szFileName[MAX_PATH];
00067   CMsgBox*  m_pMsgBox;
00068   CMsgLog*  m_pMsgLog;
00069
00070   // A method for getting an interface on a COM object.
00071   BOOL GetInterface(IUnknown* pObj, REFIID riid, PPVOID ppv);
00072   // Some member variables to store pointers to Car-like COM Objects.
00073   // We save pointers to each COM objects controlling IUnknown.
00074   IUnknown* m_pCar;
00075   IUnknown* m_pUtilityCar;
00076   IUnknown* m_pCruiseCar;
00077   IUnknown* m_pUtilityCruiseCar;
00078
00079 protected:
00080   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00081
00082 private:
00083   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
00084
00085   WORD m_wWidth;
00086   WORD m_wHeight;
00087   TCHAR m_szHelpFile[MAX_PATH];
00088   TCHAR m_szFileTitle[MAX_PATH];
00089   TEXTMETRIC m_tm;
00090   OPENFILENAME m_ofnFile;
00091 };
00092
00093 /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
00094   Class:    CDlgRemoteInfo
00095
00096   Summary:  Class to encapsulate the Remote Info Dialog.
00097
00098   Methods:  DialogProc
00099               Dialog procedure
00100 C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
00101 class CDlgRemoteInfo: public CVirDialog
00102 {
00103 public:
00104   BOOL DialogProc(
00105          HWND hWndDlg,
00106          UINT uMsg,
00107          WPARAM wParam,
00108          LPARAM lParam);
00109 };
00110
00111 #endif // __cplusplus
00112
00113 // Window Class String Macros.
00114 #define MAIN_WINDOW_TITLE_STR       "REMCLIEN: Tutorial Code Sample"
00115 #define MAIN_WINDOW_CLASS_NAME_STR  "REMCLIENWindow"
00116 #define MAIN_WINDOW_CLASS_MENU_STR  "REMCLIENMenu"
00117
00118 // File Name String Macros.
00119 #define SERVER_TUTFILE_STR          "aptserve.htm"
00120 #define MARSHAL_TUTFILE_STR         "marshal.htm"
00121
00122 // OpenFile-related String Macros.
00123 #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
00124 #define OFN_DEFAULTTITLE_STR "Open File"
00125
00126 // File Menu Command Identifiers.
00127 #define IDM_FILE_MACHINE            1000
00128 #define IDM_FILE_EXIT               1001
00129
00130 // Car Menu Command Identifiers.
00131 #define IDM_CAR_CREATE              1100
00132 #define IDM_CAR_RELEASE             1101
00133 #define IDM_CAR_SHIFT               1102
00134 #define IDM_CAR_CLUTCH              1103
00135 #define IDM_CAR_SPEED               1104
00136 #define IDM_CAR_STEER               1105
00137
00138 // UtilityCar Menu Command Identifiers.
00139 #define IDM_UCAR_CREATE             1200
00140 #define IDM_UCAR_RELEASE            1201
00141 #define IDM_UCAR_SHIFT              1202
00142 #define IDM_UCAR_CLUTCH             1203
00143 #define IDM_UCAR_SPEED              1204
00144 #define IDM_UCAR_STEER              1205
00145 #define IDM_UCAR_OFFROAD            1206
00146 #define IDM_UCAR_WINCH              1207
00147
00148 // CruiseCar Menu Command Identifiers.
00149 #define IDM_CCAR_CREATE             1300
00150 #define IDM_CCAR_RELEASE            1301
00151 #define IDM_CCAR_SHIFT              1302
00152 #define IDM_CCAR_CLUTCH             1303
00153 #define IDM_CCAR_SPEED              1304
00154 #define IDM_CCAR_STEER              1305
00155 #define IDM_CCAR_ENGAGE             1306
00156 #define IDM_CCAR_ADJUST             1307
00157
00158 // UtilityCruiseCar Menu Command Identifiers.
00159 #define IDM_UCRU_CREATE             1400
00160 #define IDM_UCRU_RELEASE            1401
00161 #define IDM_UCRU_SHIFT              1402
00162 #define IDM_UCRU_CLUTCH             1403
00163 #define IDM_UCRU_SPEED              1404
00164 #define IDM_UCRU_STEER              1405
00165 #define IDM_UCRU_ENGAGE             1406
00166 #define IDM_UCRU_ADJUST             1407
00167 #define IDM_UCRU_OFFROAD            1408
00168 #define IDM_UCRU_WINCH              1409
00169
00170 // Log Menu Command Identifiers.
00171 #define IDM_LOG_LOGCLEAR            1890
00172 #define IDM_LOG_LOGGING             1891
00173 #define IDM_LOG_COPYCLIP            1892
00174
00175 // Help Menu Command Identifiers.
00176 #define IDM_HELP_CONTENTS           1900
00177 #define IDM_HELP_TUTORIAL           1901
00178 #define IDM_HELP_TUTSERVER          1902
00179 #define IDM_HELP_TUTMARSHAL         1903
00180 #define IDM_HELP_READSOURCE         1904
00181 #define IDM_HELP_ABOUT              1905
00182
00183 // Error-related String Identifiers.
00184 #define IDS_COMINITFAILED           2000
00185 #define IDS_APPINITFAILED           2001
00186 #define IDS_OUTOFMEMORY             2002
00187 #define IDS_NOUNICODE               2003
00188 #define IDS_NODCOM                  2004
00189 #define IDS_NOSERVER                2005
00190
00191 #define IDS_ASSERT_FAIL             2200
00192
00193 // Notice-related String Identifiers.
00194 #define IDS_NOTIMPLEMENTED          2301
00195
00196 // Log Message String Identifiers.
00197 #define IDS_START_MESSAGE_LOG       2400
00198
00199 // Dialog IDs.
00200 #define IDD_REMOTE_INFO             2500
00201 #define IDC_STATIC_MACHINE          2501
00202 #define IDC_EDIT_MACHINE            2502
00203
00204 #endif
Generated on Wed Nov 13 2024 16:51:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Multimedia/Gdi/Fonts/FontView/Status.c Source File

  • Multimedia
  • Gdi
  • Fonts
  • FontView

Status.c

Go to the documentation of this file.
00001
00002 /******************************************************************************\
00003 *       This is a part of the Microsoft Source Code Samples.
00004 *       Copyright 1993 - 2000 Microsoft Corporation.
00005 *       All rights reserved.
00006 *       This source code is only intended as a supplement to
00007 *       Microsoft Development Tools and/or WinHelp documentation.
00008 *       See these sources for detailed information regarding the
00009 *       Microsoft samples programs.
00010 \******************************************************************************/
00011
00012 #define NOMINMAX
00013 #include <windows.h>
00014
00015 #include <stdlib.h> // For 'abs'
00016
00017 #if !defined (APIENTRY)
00018 #define APIENTRY FAR PASCAL
00019 #endif
00020
00021 #define MAXSTATUS 10
00022 typedef struct _tagStatus {
00023     HWND    hwnd;
00024     int     iMaxWidth, iMinWidth, iGiveWidth;
00025 } Status;
00026 Status  statusField[MAXSTATUS];
00027
00028 HWND    hwndStatus;
00029 int    cntStatusField = 0;
00030 int    dyStatus, cxStatusBorder, cyStatusBorder, cxFrame, cyFrame, dyField;
00031 HFONT   hfontStatus;
00032 TEXTMETRIC tmStatusFont;
00033 HBRUSH hbrBtnFace;
00034
00035 LONG_PTR APIENTRY StatusProc      (HWND, UINT, WPARAM, LPARAM);
00036 LONG_PTR APIENTRY StatusFieldProc (HWND, UINT, WPARAM, LPARAM);
00037
00038 BOOL InitStatusBar (HANDLE hInstance)
00039 {
00040     WNDCLASS    wndclass;
00041
00042     hbrBtnFace = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
00043
00044     wndclass.style         = CS_HREDRAW | CS_VREDRAW;
00045     wndclass.lpfnWndProc   = (WNDPROC)StatusProc;
00046     wndclass.cbClsExtra    = 0;
00047     wndclass.cbWndExtra    = 0;
00048     wndclass.hInstance      = hInstance;
00049     wndclass.hIcon     = NULL;
00050     wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW);
00051     wndclass.hbrBackground = hbrBtnFace;
00052     wndclass.lpszMenuName  = NULL;
00053     wndclass.lpszClassName = "SamplerStatus";
00054
00055     if (!RegisterClass (&wndclass))
00056         return FALSE;
00057
00058     wndclass.style         = CS_HREDRAW | CS_VREDRAW;
00059     wndclass.lpfnWndProc   = (WNDPROC)StatusFieldProc;
00060     wndclass.cbClsExtra    = 0;
00061     wndclass.cbWndExtra    = 0;
00062     wndclass.hInstance      = hInstance;
00063     wndclass.hIcon     = NULL;
00064     wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW);
00065     wndclass.hbrBackground = hbrBtnFace;
00066     wndclass.lpszMenuName  = NULL;
00067     wndclass.lpszClassName = "StatusField";
00068
00069     if (!RegisterClass (&wndclass))
00070         return FALSE;
00071
00072   return TRUE;
00073 }
00074
00075 BOOL CreateStatusBar (HWND hwnd, HANDLE hInst, int iId)
00076 {
00077     cxStatusBorder = GetSystemMetrics (SM_CXBORDER);
00078     cyStatusBorder = GetSystemMetrics (SM_CYBORDER);
00079
00080     hwndStatus = CreateWindow ("SamplerStatus", "SamplerStatus",
00081         WS_CHILD | WS_BORDER | WS_VISIBLE,
00082         0, 0, 0, 0,
00083         hwnd, (HMENU)(INT_PTR)iId, hInst, NULL);
00084
00085     if (!hwndStatus) {
00086         return FALSE;
00087     }
00088     return TRUE;
00089 }
00090
00091 int StatusBarHeight (HWND hwnd)
00092 {
00093     RECT rect;
00094     GetClientRect (hwndStatus, &rect);
00095     return rect.bottom-rect.top;
00096
00097     hwnd; // unreferenced formal parameter
00098 }
00099
00100 BOOL AdjustStatusBar (HWND hwnd)
00101 {
00102     RECT rect;
00103     GetClientRect (hwnd, &rect);
00104     MoveWindow (hwndStatus,
00105         rect.left-cxStatusBorder,
00106         rect.bottom - dyStatus + cyStatusBorder,
00107         rect.right - rect.left + (cxStatusBorder*2),
00108         dyStatus,
00109     TRUE);
00110     return TRUE;
00111 }
00112
00113 HWND AddStatusField (HANDLE hInst, int iId, int iMin, int iMax, BOOL bNewGroup)
00114 {
00115     LONG lStyle;
00116
00117     if (cntStatusField >= MAXSTATUS) return (HWND)0; // No room left in our fixed array
00118
00119     statusField[cntStatusField].hwnd = CreateWindow ("StatusField", "",
00120         WS_CHILD | WS_VISIBLE,
00121         0, 0, 0, 0,
00122         hwndStatus, (HMENU)(INT_PTR)iId, hInst, NULL);
00123
00124     if (!statusField[cntStatusField].hwnd) return (HWND)0; // CreateWindow failed for some reason
00125
00126     if (iMin < 0) {
00127     statusField[cntStatusField].iMinWidth = tmStatusFont.tmAveCharWidth*abs(iMin);
00128     } else {
00129     statusField[cntStatusField].iMinWidth = iMin;
00130     }
00131
00132     if (iMax < 0) {
00133     statusField[cntStatusField].iMaxWidth = tmStatusFont.tmAveCharWidth*abs(iMax);
00134     } else {
00135     statusField[cntStatusField].iMaxWidth = iMax;
00136     }
00137
00138     if (bNewGroup) {
00139         lStyle = (LONG)GetWindowLongPtr (statusField[cntStatusField].hwnd, GWL_STYLE);
00140         lStyle |= WS_GROUP;
00141         SetWindowLongPtr (statusField[cntStatusField].hwnd, GWL_STYLE, lStyle);
00142     }
00143
00144     return statusField[cntStatusField++].hwnd;
00145 }
00146
00147 BOOL DestroyStatusBar (void)
00148 {
00149     return DeleteObject (hbrBtnFace);
00150 }
00151
00152 LONG_PTR APIENTRY StatusProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00153 {
00154     HDC hdc;
00155     PAINTSTRUCT ps;
00156     int x, y, i;
00157     int wAvailWidth, wFlexWidth, cntFlexWidth, wNeedWidth, cntNeedWidth;
00158     RECT    rect, border;
00159     HBRUSH  hBrush;
00160     LOGFONT lfTmp;
00161
00162     switch (msg) {
00163         case WM_CREATE:
00164             hfontStatus = CreateFont(14, 0, 0, 0, 0, 0, 0, 0,
00165                 0, 0, 0, 0,
00166                 VARIABLE_PITCH | FF_SWISS, "");
00167
00168                         if (GetObject (hfontStatus, sizeof(LOGFONT), &lfTmp)) {
00169                                 if ((lfTmp.lfPitchAndFamily & VARIABLE_PITCH) &&
00170                                    (lfTmp.lfPitchAndFamily & FF_SWISS)) {
00171                                 } else {
00172                                         MessageBox (GetFocus(),
00173                                                 "Unable to get an unnamed variable pitch swiss font",
00174                                                 "Status Bar CreateFont Error",
00175                                                 MB_OK);
00176
00177                                         hfontStatus = CreateFont(14, 0, 0, 0, 0, 0, 0, 0,
00178                                                                         0, 0, 0, 0,
00179                                                                         VARIABLE_PITCH | FF_SWISS, "Arial");
00180                                 }
00181                         }
00182
00183
00184             if (!hfontStatus) {
00185                 MessageBox (GetFocus(), "Failed To Create Font", "StatusProc", MB_OK);
00186             }
00187             hdc = GetDC (hwnd);
00188             SelectObject (hdc, hfontStatus);
00189             GetTextMetrics (hdc, &tmStatusFont);
00190             cxStatusBorder = GetSystemMetrics (SM_CXBORDER);
00191             cyStatusBorder = GetSystemMetrics (SM_CYBORDER);
00192             cxFrame = 3*cxStatusBorder;
00193             cyFrame = 3*cyStatusBorder;
00194             dyField = tmStatusFont.tmHeight + (2*cyStatusBorder);
00195             dyStatus = dyField + (2*cyFrame);
00196             ReleaseDC (hwnd, hdc);
00197             return DefWindowProc (hwnd, msg, wParam, lParam);
00198
00199         case WM_DESTROY:
00200             if (hfontStatus) {
00201                 DeleteObject (hfontStatus);
00202             }
00203             break;
00204
00205         case WM_SIZE:
00206         if (cntStatusField) {
00207                 GetClientRect (hwnd, &rect);
00208                 wAvailWidth = rect.right - rect.left - (cxStatusBorder*8);
00209                 wNeedWidth = 0;
00210                 cntNeedWidth = 0;
00211                 cntFlexWidth = 0;
00212
00213                 /* First Pass: Dole out to fields that have a minimum need */
00214                 for (i=0; i<cntStatusField; i++) {
00215                     statusField[i].iGiveWidth = 0; // Make sure all are initialized to 0
00216                     if (statusField[i].iMinWidth) {
00217                         /* (n, ?) */
00218                         statusField[i].iGiveWidth = statusField[i].iMinWidth;
00219                         wAvailWidth -= (statusField[i].iGiveWidth + cxStatusBorder*2);
00220                         if (GetWindowLongPtr(statusField[i].hwnd, GWL_STYLE) & WS_GROUP) {
00221                             wAvailWidth -= cxStatusBorder*4;
00222                         }
00223                     } else {
00224                         /* They didn't specify a minimum... don't give them anything yet */
00225                         /* (0, ?) */
00226                         statusField[i].iGiveWidth = 0;
00227                     }
00228
00229                     /* For those that have a minimum, but can grow to be as large as possible...*/
00230                     /* (n, 0) */
00231                     if ((statusField[i].iMinWidth >0) && (statusField[i].iMaxWidth ==0)) {
00232                         ++cntFlexWidth;
00233                     }
00234
00235                     /* For those that have a max that is greater then their min... */
00236                     /* Includes (0,n) and (n,>n) */
00237                     if (statusField[i].iMaxWidth > statusField[i].iGiveWidth) {
00238                         wNeedWidth += (statusField[i].iMaxWidth - statusField[i].iGiveWidth);
00239                         ++cntNeedWidth;
00240                     }
00241                 }
00242
00243                 /* Second Pass: Dole out to fields that have a stated maximum need */
00244                 /* This will also hit those who had no minimum, but did have a maximum */
00245                 /* It will still not give anything to those with no min, no max */
00246                 if ((cntNeedWidth > 0) && (wAvailWidth > 0)) {
00247                     if (wNeedWidth > wAvailWidth) {
00248                         wNeedWidth = wAvailWidth;
00249                     }
00250                     wNeedWidth = wNeedWidth / cntNeedWidth;
00251                     for (i=0; i<cntStatusField; i++) {
00252                         if (statusField[i].iMaxWidth > statusField[i].iGiveWidth) {
00253                             statusField[i].iGiveWidth += wNeedWidth;
00254                             wAvailWidth -= (statusField[i].iGiveWidth + cxStatusBorder*2);
00255                             if (GetWindowLongPtr(statusField[i].hwnd, GWL_STYLE) & WS_GROUP) {
00256                                 wAvailWidth -= cxStatusBorder*4;
00257                             }
00258                         }
00259                     }
00260                 }
00261
00262                 /* Third Pass: Dole out the remaining to fields that want all they can get */
00263                 /* This includes those who had a minimum, but no maximum */
00264                 if ((cntFlexWidth > 0) && (wAvailWidth > 0)) {
00265                     wFlexWidth = wAvailWidth / cntFlexWidth;
00266                     for (i=0; i<cntStatusField; i++) {
00267                         if (statusField[i].iMaxWidth==0) {
00268                             statusField[i].iGiveWidth += wFlexWidth;
00269                             wAvailWidth -= ((wFlexWidth - statusField[i].iMinWidth) + cxStatusBorder*2);
00270                             if (GetWindowLongPtr(statusField[i].hwnd, GWL_STYLE) & WS_GROUP) {
00271                                 wAvailWidth -= cxStatusBorder*4;
00272                             }
00273                         }
00274                     }
00275                 }
00276
00277                 x = cxStatusBorder*4;
00278                 y = rect.top + (2*cyStatusBorder);
00279                 for (i=0; i<cntStatusField; i++) {
00280                     if (GetWindowLongPtr (statusField[i].hwnd, GWL_STYLE) & WS_GROUP) {
00281                         x += (cxStatusBorder*4);
00282                     }
00283                     MoveWindow (statusField[i].hwnd, x, y, statusField[i].iGiveWidth, dyField, TRUE);
00284                     x += statusField[i].iGiveWidth + (cxStatusBorder*2);
00285                 }
00286             }
00287             break;
00288
00289         case WM_PAINT:
00290             hdc = BeginPaint (hwnd, &ps);
00291             GetClientRect (hwnd, &rect);
00292
00293             hBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
00294             border = rect;
00295             border.bottom = border.top + cyStatusBorder;
00296             FillRect (hdc, &border, hBrush);
00297             DeleteObject (hBrush);
00298
00299             hBrush = CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW));
00300             border = rect;
00301             border.top = border.bottom - cyStatusBorder;
00302             FillRect (hdc, &border, hBrush);
00303             DeleteObject (hBrush);
00304
00305             EndPaint (hwnd, &ps);
00306
00307             return DefWindowProc (hwnd, msg, wParam, lParam);
00308
00309         default:
00310             return DefWindowProc (hwnd, msg, wParam, lParam);
00311     }
00312     return 0L;
00313 }
00314
00315
00316
00317 LONG_PTR APIENTRY StatusFieldProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
00318 {
00319     HDC     hdc;
00320     PAINTSTRUCT ps;
00321     RECT    rect, border;
00322     HBRUSH  hBrush;
00323     HFONT   hTmp;
00324     char szText[80];
00325     int len;
00326
00327     switch (msg) {
00328         case WM_PAINT:
00329             hdc = BeginPaint (hwnd, &ps);
00330             GetClientRect (hwnd, &rect);
00331
00332             hBrush = CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW));
00333             border = rect;
00334             border.bottom = border.top + cyStatusBorder;
00335             FillRect (hdc, &border, hBrush);
00336             border = rect;
00337             border.right = border.left + cxStatusBorder;
00338             FillRect (hdc, &border, hBrush);
00339             DeleteObject (hBrush);
00340
00341             hBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
00342             border = rect;
00343             border.top = border.bottom - cyStatusBorder;
00344             FillRect (hdc, &border, hBrush);
00345             border = rect;
00346             border.left = border.right - cxStatusBorder;
00347             FillRect (hdc, &border, hBrush);
00348             DeleteObject (hBrush);
00349
00350             len = GetWindowText(hwnd, szText, sizeof (szText));
00351             if (len) {
00352                 hTmp = SelectObject(hdc, hfontStatus);
00353
00354                 SetTextColor(hdc, GetSysColor(COLOR_BTNTEXT));
00355                 SetBkColor(hdc, GetSysColor(COLOR_BTNFACE));
00356
00357                 InflateRect (&rect, -(cxStatusBorder*2), -cyStatusBorder);
00358                 ExtTextOut(hdc, rect.left, rect.top,
00359                     ETO_OPAQUE | ETO_CLIPPED,
00360                     &rect,
00361                     (LPSTR)szText,
00362                     len, NULL);
00363
00364                 SelectObject (hdc, hTmp);
00365             }
00366
00367             EndPaint (hwnd, &ps);
00368             break;
00369
00370         case WM_SETTEXT:
00371             InvalidateRect (hwnd, NULL, TRUE);
00372             return DefWindowProc (hwnd, msg, wParam, lParam);
00373
00374         default:
00375             return DefWindowProc (hwnd, msg, wParam, lParam);
00376     }
00377     return 0L;
00378 }
Generated on Wed Nov 13 2024 16:52:12 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/src/IsapiBuffer.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • src

IsapiBuffer.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: IsapiBuffer.cpp
00006
00007 Abstract:
00008
00009     A simple buffer class
00010
00011 Author:
00012
00013     ISAPI developer (Microsoft employee), November 2002
00014
00015 --*/
00016
00017 #include <IsapiTools.h>
00018
00019 #define SIZE_ENCODED_CHUNK      4
00020 #define SIZE_UNENCODED_CHUNK    3
00021
00022 //
00023 // Local prototypes
00024 //
00025
00026 BOOL
00027 Base64DecodeChunk(
00028     CHAR *  szChunk,
00029     BYTE *  pData,
00030     DWORD * pcbData
00031     );
00032
00033 //
00034 // Method implementations
00035 //
00036
00037 ISAPI_BUFFER::ISAPI_BUFFER(
00038     DWORD dwMaxAlloc
00039     ) : _pData( _InlineData ),
00040         _cbData( 0 ),
00041         _cbBuffer( INLINE_BUFFER_SIZE ),
00042         _dwMaxAlloc( dwMaxAlloc ? dwMaxAlloc : DEFAULT_MAX_ALLOC_SIZE )
00043 /*++
00044
00045 Purpose:
00046
00047     Constructor for the ISAPI_BUFFER object
00048
00049 Arguments:
00050
00051     dwMaxAlloc - Initial value of max allocation size
00052
00053 Returns:
00054
00055     None
00056
00057 --*/
00058 {
00059     return;
00060 }
00061
00062 ISAPI_BUFFER::~ISAPI_BUFFER()
00063 /*++
00064
00065 Purpose:
00066
00067     Destructory for the ISAPI_BUFFER object
00068
00069 Arguments:
00070
00071     None
00072
00073 Returns:
00074
00075     None
00076
00077 --*/
00078 {
00079     //
00080     // Reset the object.  Ensure that we
00081     // deallocate any associated heap.
00082     //
00083
00084     Reset( TRUE );
00085 }
00086
00087 BOOL
00088 ISAPI_BUFFER::SetData(
00089     VOID *  pData,
00090     DWORD   cbData
00091     )
00092 /*++
00093
00094 Purpose:
00095
00096     Sets the specified data into the ISAPI_BUFFER object
00097
00098 Arguments:
00099
00100     pData  - Pointer to the data to set
00101     cbData - Size of the data to set
00102
00103 Returns:
00104
00105     TRUE on success, FALSE on failure
00106
00107 --*/
00108 {
00109     //
00110     // Ensure that the buffer is sufficient to
00111     // store the data.
00112     //
00113
00114     if ( cbData > _cbBuffer &&
00115          !Resize( cbData ) )
00116     {
00117         return FALSE;
00118     }
00119
00120     //
00121     // Copy the data into the buffer and
00122     // set the new size
00123     //
00124
00125     CopyMemory( _pData, pData, cbData );
00126
00127     _cbData = cbData;
00128
00129     return TRUE;
00130 }
00131
00132 BOOL
00133 ISAPI_BUFFER::AppendData(
00134     VOID *  pData,
00135     DWORD   cbData
00136     )
00137 /*++
00138
00139 Purpose:
00140
00141     Appends data to the ISAPI_BUFFER object
00142
00143 Arguments:
00144
00145     pData  - Pointer to the data to append
00146     cbData - Size of the data to append
00147
00148 Returns:
00149
00150     TRUE on success, FALSE on failure
00151
00152 --*/
00153 {
00154     DWORD   cbNewSize;
00155
00156     //
00157     // Ensure that the buffer is sufficient to
00158     // store the data.
00159     //
00160
00161     cbNewSize = _cbData + cbData;
00162
00163     if ( cbNewSize > _cbBuffer &&
00164          !Resize( cbNewSize ) )
00165     {
00166         return FALSE;
00167     }
00168
00169     //
00170     // Copy the data into the buffer, beginning
00171     // at the specified offset, and set the new size.
00172     //
00173
00174     CopyMemory( (BYTE*)_pData + _cbData, pData, cbData );
00175
00176     _cbData = cbNewSize;
00177
00178     return TRUE;
00179 }
00180
00181 BOOL
00182 ISAPI_BUFFER::Resize(
00183     DWORD   cbNewSize
00184     )
00185 /*++
00186
00187 Purpose:
00188
00189     Ensures that the storage for ISAPI_BUFFER is sufficient to
00190     contain the specified number of bytes
00191
00192 Arguments:
00193
00194     cbNewSize - The target size
00195
00196 Returns:
00197
00198     TRUE on success, FALSE on failure
00199
00200 --*/
00201 {
00202     HANDLE  hNew;
00203     DWORD   cbAdjustedNewSize;
00204
00205     //
00206     // If the buffer is already large enough, then
00207     // just return TRUE.
00208     //
00209
00210     if ( cbNewSize <= _cbBuffer )
00211     {
00212         return TRUE;
00213     }
00214
00215     //
00216     // If the new requested size is larger than the
00217     // maximum we will allocate, then fail the call
00218     //
00219
00220     if ( cbNewSize > _dwMaxAlloc )
00221     {
00222         SetLastError( ERROR_NOT_ENOUGH_MEMORY );
00223
00224         goto Failed;
00225     }
00226
00227     //
00228     // Adjust the new size so that we allocate blocks
00229     // using a granularity of ISAPILIB_BUFFER_INLINE_SIZE.
00230     // Also, make sure that this adjustment does not
00231     // exceed _dwMaxAlloc.
00232     //
00233
00234     cbAdjustedNewSize = cbNewSize / INLINE_BUFFER_SIZE * INLINE_BUFFER_SIZE;
00235
00236     if ( cbAdjustedNewSize < cbNewSize )
00237     {
00238         cbAdjustedNewSize += INLINE_BUFFER_SIZE;
00239     }
00240
00241     if ( cbAdjustedNewSize > _dwMaxAlloc )
00242     {
00243         cbAdjustedNewSize = _dwMaxAlloc;
00244     }
00245
00246     //
00247     // Allocate the new storage.
00248     //
00249
00250     if ( _pData == _InlineData )
00251     {
00252         //
00253         // If _pData is currently pointed at the new buffer,
00254         // then we need to allocate some heap storage.
00255         //
00256
00257         hNew = LocalAlloc( NONZEROLPTR, cbAdjustedNewSize );
00258
00259         if ( hNew == NULL )
00260         {
00261             SetLastError( ERROR_NOT_ENOUGH_MEMORY );
00262
00263             goto Failed;
00264         }
00265
00266         //
00267         // If there was data in the old buffer, copy
00268         // it to the new buffer.
00269         //
00270
00271         if ( _cbData )
00272         {
00273             CopyMemory( (BYTE*)hNew, _pData, _cbData );
00274         }
00275     }
00276     else
00277     {
00278         //
00279         // If _pData is already on the heap, then reallocate it.
00280         //
00281
00282         hNew = LocalReAlloc( _pData, cbAdjustedNewSize, LMEM_MOVEABLE );
00283
00284         if ( hNew == NULL )
00285         {
00286             goto Failed;
00287         }
00288     }
00289
00290     //
00291     // Adjust the pointer and size of the new buffer
00292     //
00293
00294     _pData = (BYTE*)hNew;
00295     _cbBuffer = cbAdjustedNewSize;
00296
00297     return TRUE;
00298
00299 Failed:
00300
00301     //
00302     // No special cleanup to be done
00303     //
00304
00305     return FALSE;
00306 }
00307
00308 VOID
00309 ISAPI_BUFFER::Reset(
00310     BOOL    fDealloc
00311     )
00312 /*++
00313
00314 Purpose:
00315
00316     Resets the ISAPI_BUFFER object
00317
00318 Arguments:
00319
00320     fDealloc - If TRUE, then any heap associated with the
00321                object is freed.
00322
00323 Returns:
00324
00325     None
00326
00327 --*/
00328 {
00329     //
00330     // If we are supposed to dealloc some
00331     // heap memory, do so now.
00332     //
00333
00334     if ( fDealloc &&
00335          _pData != _InlineData )
00336     {
00337         LocalFree( _pData );
00338         _pData = _InlineData;
00339         _cbBuffer = INLINE_BUFFER_SIZE;
00340     }
00341
00342     //
00343     // Reset the data size
00344     //
00345
00346     _cbData = 0;
00347 }
00348
00349 BOOL
00350 ISAPI_BUFFER::SetDataSize(
00351     DWORD   cbNewSize
00352     )
00353 /*++
00354
00355 Purpose:
00356
00357     Resets the size member ISAPI_BUFFER object.
00358
00359 Arguments:
00360
00361     cbNewSize - The new size to set
00362
00363 Returns:
00364
00365     TRUE on success, FALSE on failure
00366
00367 --*/
00368 {
00369     //
00370     // Don't allow it to be set to something bigger
00371     // than the buffer
00372     //
00373
00374     if ( cbNewSize > _cbBuffer )
00375     {
00376         return FALSE;
00377     }
00378
00379     _cbData = cbNewSize;
00380
00381     return TRUE;
00382 }
00383
00384 VOID
00385 ISAPI_BUFFER::SetMaxAlloc(
00386     DWORD   dwMaxAlloc
00387     )
00388 /*++
00389
00390 Purpose:
00391
00392     Sets the max alloc size of the ISAPI_BUFFER object.
00393
00394 Arguments:
00395
00396     dwMaxAlloc - The new size to set
00397
00398 Returns:
00399
00400     None
00401
00402 --*/
00403 {
00404     _dwMaxAlloc = dwMaxAlloc ? dwMaxAlloc : DEFAULT_MAX_ALLOC_SIZE;
00405 }
00406
00407 DWORD
00408 ISAPI_BUFFER::QueryMaxAlloc(
00409     VOID
00410     )
00411 /*++
00412
00413 Purpose:
00414
00415     Returns the max alloc size of the ISAPI_BUFFER object.
00416
00417 Arguments:
00418
00419     None
00420
00421 Returns:
00422
00423     The max alloc size
00424
00425 --*/
00426 {
00427     return _dwMaxAlloc;
00428 }
00429
00430 VOID *
00431 ISAPI_BUFFER::QueryPtr(
00432     VOID
00433     )
00434 /*++
00435
00436 Purpose:
00437
00438     returns a pointer to the data member ISAPI_BUFFER object.
00439
00440 Arguments:
00441
00442     None
00443
00444 Returns:
00445
00446     A pointer to the data member
00447
00448 --*/
00449 {
00450     return _pData;
00451 }
00452
00453 DWORD
00454 ISAPI_BUFFER::QueryDataSize(
00455     VOID
00456     )
00457 /*++
00458
00459 Purpose:
00460
00461     returns the data size of the ISAPI_BUFFER object.
00462
00463 Arguments:
00464
00465     None
00466
00467 Returns:
00468
00469     The data size
00470
00471 --*/
00472 {
00473     return _cbData;
00474 }
00475
00476 DWORD
00477 ISAPI_BUFFER::QueryBufferSize(
00478     VOID
00479     )
00480 /*++
00481
00482 Purpose:
00483
00484     Returns the buffer size of the ISAPI_BUFFER object.
00485
00486 Arguments:
00487
00488     None
00489
00490 Returns:
00491
00492     The size of the buffer
00493
00494 --*/
00495 {
00496     return _cbBuffer;
00497 }
00498
00499 BOOL
00500 ISAPI_BUFFER::Base64Decode(
00501     CHAR *  szString
00502     )
00503 /*++
00504
00505 Purpose:
00506
00507     Base64 decodes a string into ISAPI_BUFFER object.
00508
00509 Arguments:
00510
00511     szString - The string to decode
00512
00513 Returns:
00514
00515     TRUE on success, FALSE on failure
00516
00517 --*/
00518 {
00519     BYTE    pData[SIZE_UNENCODED_CHUNK];
00520     CHAR *  pCursor;
00521     DWORD   cchRemaining;
00522     DWORD   cchString;
00523     DWORD   cbData;
00524     BOOL    fResult;
00525
00526     //
00527     // Validate the input.  Make sure that size the input data
00528     // is evenly divisible by 4
00529     //
00530
00531     cchString = strlen( szString );
00532
00533     if ( cchString % 4 )
00534     {
00535         SetLastError( ERROR_INVALID_PARAMETER );
00536         goto Failed;
00537     }
00538
00539     //
00540     // Decode the data in 4 byte chunks
00541     //
00542
00543     pCursor = szString;
00544     cchRemaining = cchString;
00545
00546     while ( cchRemaining )
00547     {
00548         fResult = Base64DecodeChunk( pCursor,
00549                                      pData,
00550                                      &cbData );
00551
00552         if ( !fResult )
00553         {
00554             goto Failed;
00555         }
00556
00557         fResult = AppendData( pData, cbData );
00558
00559         if ( !fResult )
00560         {
00561             goto Failed;
00562         }
00563
00564         cchRemaining -= SIZE_ENCODED_CHUNK;
00565         pCursor += SIZE_ENCODED_CHUNK;
00566     }
00567
00568     return TRUE;
00569
00570 Failed:
00571
00572     //
00573     // No special cleanup required
00574     //
00575
00576     return FALSE;
00577 }
00578
00579 VOID
00580 ISAPI_BUFFER::ZeroBuffer(
00581     VOID
00582     )
00583 /*++
00584
00585 Purpose:
00586
00587     Fills the ISAPI_BUFFER data buffer with zeros.
00588
00589 Arguments:
00590
00591     None
00592
00593 Returns:
00594
00595     None
00596
00597 --*/
00598 {
00599     ZeroMemory( _pData, _cbBuffer );
00600 }
00601
00602 BOOL
00603 Base64DecodeChunk(
00604     CHAR *  szChunk,
00605     BYTE *  pData,
00606     DWORD * pcbData
00607     )
00608 /*++
00609
00610 Purpose:
00611
00612     Decodes a 4 byte base64 encoded chunk into 3 decoded bytes
00613
00614 Arguments:
00615
00616     szChunk - The chunk to decode
00617     pData   - The buffer to store the chunk
00618     pcbData - Upon return, the number of bytes in the return buffer
00619
00620 Returns:
00621
00622     TRUE on success, FALSE on failure
00623
00624 --*/
00625 {
00626     DWORD   x;
00627     DWORD   cbChunk;
00628
00629     BYTE szReverseTable[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00630                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00631                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00632                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00633                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00634                               0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f,
00635                               0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
00636                               0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00637                               0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
00638                               0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
00639                               0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
00640                               0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff,
00641                               0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
00642                               0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
00643                               0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
00644                               0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff,
00645                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00646                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00647                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00648                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00649                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00650                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00651                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00652                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00653                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00654                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00655                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00656                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00657                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00658                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00659                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
00660                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
00661
00662     //
00663     // Clear only the necessary output bytes.
00664     //
00665     // *** WARNING ***
00666     // We are making two assumptions here.  First, we assume
00667     // that pData is big enough to do this.  Second, we assume
00668     // that szChunk is always 4 bytes.  If either of these
00669     // assumptions are bad, we'll fail in a bad way.
00670     //
00671
00672     if ( szChunk[2] == '=' )
00673     {
00674         *pcbData = 1;
00675         cbChunk = 2;
00676     }
00677     else if ( szChunk[3] == '=' )
00678     {
00679         *pcbData = 2;
00680         cbChunk = 3;
00681     }
00682     else
00683     {
00684         *pcbData = 3;
00685         cbChunk = 4;
00686     }
00687
00688     ZeroMemory( pData, *pcbData );
00689
00690     //
00691     // Reverse lookup the character mappings
00692     //
00693
00694     for ( x = 0; x < cbChunk; x++ )
00695     {
00696         szChunk[x] = szReverseTable[szChunk[x]];
00697
00698         if ( szChunk[x] == 0xff )
00699         {
00700             //
00701             // Hmmm.  This isn't a valid character
00702             // for a base64 encoded buffer.
00703             //
00704
00705             SetLastError( ERROR_INVALID_PARAMETER );
00706
00707             return FALSE;
00708         }
00709     }
00710
00711     //
00712     // Shift bits per Base64 rules (originally defined in
00713     // RFC 1341, section 5.2)
00714     //
00715
00716     for ( x = 0; x < cbChunk; x++ )
00717     {
00718         switch ( x )
00719         {
00720         case 0:
00721
00722             pData[0] = szChunk[0] << 2;
00723             break;
00724
00725         case 1:
00726
00727             pData[0] |= ( szChunk[1] & 0x30 ) >> 4;
00728             pData[1] = ( szChunk[1] & 0xf ) << 4;
00729             break;
00730
00731         case 2:
00732
00733             pData[1] |= ( szChunk[2] & 0x3c ) >> 2;
00734             pData[2] = ( szChunk[2] & 0x3 ) << 6;
00735             break;
00736
00737         case 3:
00738
00739             pData[2] |= szChunk[3];
00740             break;
00741         }
00742     }
00743
00744     return TRUE;
00745 }
00746
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Fundamentals/AsyncCalls/ScaleDemo/stdafx.Cpp Source File

  • Com
  • Fundamentals
  • AsyncCalls
  • ScaleDemo

stdafx.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002
00003 File: StdAfx.cpp
00004 ----------------------------------------------------------------------------
00005
00006 This file is part of the Microsoft COM+ Samples.
00007
00008 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00009
00010 This source code is intended only as a supplement to Microsoft
00011 Development Tools and/or on-line documentation. See these other
00012 materials for detailed information regarding Microsoft code samples.
00013
00014 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00015 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00016 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 PARTICULAR PURPOSE.
00018
00019 ==========================================================================+*/
00020 // stdafx.cpp : source file that includes just the standard includes
00021 //  scaleDemo.pch will be the pre-compiled header
00022 //  stdafx.obj will contain the pre-compiled type information
00023
00024 #include "stdafx.h"
00025
00026 // TODO: reference any additional headers you need in STDAFX.H
00027 // and not in this file
Generated on Wed Nov 13 2024 16:51:45 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinSock/Dt_Dll/HuError.Cpp Source File

  • NetDS
  • WinSock
  • Dt_Dll

HuError.Cpp

Go to the documentation of this file.
00001 /*++
00002
00003   Copyright (c) 1995 Intel Corp
00004
00005   File Name:
00006
00007     huerror.cpp
00008
00009   Abstract:
00010
00011     Error functions.
00012
00013 --*/
00014
00015 #include "nowarn.h"  /* turn off benign warnings */
00016 #include <stdio.h>
00017 #include "huerror.h"
00018
00019 static ErrorCode_e HULastError  = ENONE;
00020
00021 void HUSetLastError(ErrorCode_e ErrorCode)
00022 {
00023   HULastError = ErrorCode;
00024 }
00025
00026 ErrorCode_e HUGetLastError()
00027 {
00028   return HULastError;
00029 }
00030
00031 void HUPrintError(char *func,ErrorCode_e ErrorCode)
00032 {
00033   if(func == NULL){
00034     printf("Error: - - ");
00035   }else{
00036     printf("Error: %s - - ",func);
00037   }
00038   switch(ErrorCode){
00039     case ENONE:
00040   printf("No error\n");
00041   break;
00042     case ALLOCERROR:
00043   printf("Allocation error\n");
00044   break;
00045     case INVALIDARG:
00046   printf("Invalid arguement passed in\n");
00047   break;
00048     case OBJNOTINIT:
00049   printf("Object not initialized\n");
00050   break;
00051     case OBJEFFERROR:
00052   printf("Object becoming ineffecient. Trying making it large\n");
00053   break;
00054     case ALREADYCONN:
00055   printf("Already connected\n");
00056   break;
00057     default:
00058       printf("ErrorCode not defined\n");
00059   }
00060 }
00061 
Generated on Wed Nov 13 2024 16:52:25 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CString Member List

This is the complete list of members for CString, including all inherited members.
AllocBeforeWrite(int nLen) | CString | [inline, protected]
AllocBuffer(int nLen) | CString | [protected]
AllocCopy(CString &dest, int nCopyLen, int nCopyIndex, int nExtraLen) const | CString | [protected]
AssignCopy(int nSrcLen, LPCWSTR lpszSrcData) | CString | [inline]
Compare(LPCWSTR lpsz) const | CString | [inline]
ConcatCopy(int nSrc1Len, LPCWSTR lpszSrc1Data, int nSrc2Len, LPCWSTR lpszSrc2Data) | CString | [protected]
ConcatInPlace(int nSrcLen, LPCWSTR lpszSrcData) | CString | [protected]
CopyBeforeWrite() | CString | [protected]
CString() | CString | [inline]
CString(const CString &stringSrc) | CString |
CString(WCHAR ch, int nRepeat=1) | CString |
CString(LPCSTR lpsz) | CString |
CString(LPCWSTR lpsz) | CString |
CString(LPCSTR lpch, int nLength) | CString |
CString(LPCWSTR lpch, int nLength) | CString |
CString(const unsigned char *psz) | CString |
DECLARE_FIXED_ALLOC(CString) | CString | [private]
Empty() | CString |
FreeData(CStringData *pData) | CString | [protected, static]
FreeExtra() | CString |
GetAllocLength() const | CString | [inline]
GetAt(int nIndex) const | CString | [inline]
GetBuffer(int nMinBufLength) | CString |
GetBufferSetLength(int nNewLength) | CString |
GetData() const | CString | [inline, protected]
GetLength() const | CString | [inline]
Init() | CString | [inline, protected]
IsEmpty() const | CString | [inline]
LockBuffer() | CString |
m_pchData | CString |
operator LPCWSTR() const | CString | [inline]
operator+(const CString &string1, const CString &string2) | CString | [friend]
operator+(const CString &string, WCHAR ch) | CString | [friend]
operator+(WCHAR ch, const CString &string) | CString | [friend]
operator+(const CString &string, LPCWSTR lpsz) | CString | [friend]
operator+(LPCWSTR lpsz, const CString &string) | CString | [friend]
operator+=(const CString &string) | CString |
operator+=(WCHAR ch) | CString |
operator+=(LPCWSTR lpsz) | CString |
operator=(const CString &stringSrc) | CString |
operator=(WCHAR ch) | CString |
operator=(LPCSTR lpsz) | CString |
operator=(LPCWSTR lpsz) | CString | [inline]
operator=(const unsigned char *psz) | CString |
operator[](int nIndex) const | CString | [inline]
Release() | CString | [protected]
Release(CStringData *pData) | CString | [protected, static]
ReleaseBuffer(int nNewLength=-1) | CString |
SafeStrlen(LPCWSTR lpsz) | CString | [inline, protected, static]
SetAt(int nIndex, WCHAR ch) | CString |
UnlockBuffer() | CString |
~CString() | CString | [inline]
Generated on Wed Nov 13 2024 16:57:32 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/CMenu/registry.Cpp Source File

  • SysMgmt
  • MMC
  • CMenu

registry.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //  This source code is only intended as a supplement to existing Microsoft documentation.
00004 //
00005 //
00006 //
00007 //
00008 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00009 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00010 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00011 //  PURPOSE.
00012 //
00013 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00014 //
00015 //
00016 //
00017 //==============================================================;
00018
00019 #include <objbase.h>
00020 #include <assert.h>
00021
00022 #include "Registry.h"
00023
00024 #define STRINGS_ONLY
00025 #include "globals.h"
00026
00027 ////////////////////////////////////////////////////////
00028 //
00029 // Internal helper functions prototypes
00030 //
00031
00032 // Set the given key and its value.
00033 BOOL setKeyAndValue(const _TCHAR* pszPath,
00034                     const _TCHAR* szSubkey,
00035                     const _TCHAR* szValue) ;
00036
00037 // Set the given key and its value in the MMC Snapin location
00038 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00039                           const _TCHAR* szSubkey,
00040                           const _TCHAR* szName,
00041                           const _TCHAR* szValue);
00042
00043 // Set the given valuename under the key to value
00044 BOOL setValue(const _TCHAR* szKey,
00045               const _TCHAR* szValueName,
00046               const _TCHAR* szValue);
00047
00048 // Delete szKeyChild and all of its descendents.
00049 LONG recursiveDeleteKey(HKEY hKeyParent, const _TCHAR* szKeyChild) ;
00050
00051 ////////////////////////////////////////////////////////
00052 //
00053 // Constants
00054 //
00055
00056 // Size of a CLSID as a string
00057 //const int CLSID_STRING_SIZE = 39 ;
00058
00059 /////////////////////////////////////////////////////////
00060 //
00061 // Public function implementation
00062 //
00063
00064 //
00065 // Register the component in the registry.
00066 //
00067 HRESULT RegisterServer(HMODULE hModule,            // DLL module handle
00068                        const CLSID& clsid,         // Class ID
00069                        const _TCHAR* szFriendlyName)       //   IDs
00070 {
00071     // Get server location.
00072     _TCHAR szModule[512] ;
00073     DWORD dwResult =
00074         ::GetModuleFileName(hModule,
00075         szModule,
00076         sizeof(szModule)/sizeof(_TCHAR)) ;
00077
00078     assert(dwResult != 0) ;
00079
00080     // Get CLSID
00081     LPOLESTR wszCLSID = NULL ;
00082     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00083
00084     assert(SUCCEEDED(hr)) ;
00085
00086   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00087
00088     // Build the key CLSID\\{...}
00089     _TCHAR szKey[64] ;
00090     _tcscpy(szKey, _T("CLSID\\")) ;
00091   _tcscat(szKey, pszCLSID) ;
00092
00093     // Add the CLSID to the registry.
00094     setKeyAndValue(szKey, NULL, szFriendlyName) ;
00095
00096     // Add the server filename subkey under the CLSID key.
00097     setKeyAndValue(szKey, _T("InprocServer32"), szModule) ;
00098
00099     // set the threading model
00100     _tcscat(szKey, _T("\\InprocServer32"));
00101     setValue(szKey, _T("ThreadingModel"), _T("Apartment"));
00102
00103     // Free memory.
00104     CoTaskMemFree(wszCLSID) ;
00105
00106     return S_OK ;
00107 }
00108
00109 //
00110 // Remove the component from the registry.
00111 //
00112 LONG UnregisterServer(const CLSID& clsid)       //   IDs
00113 {
00114     // Get CLSID
00115     LPOLESTR wszCLSID = NULL ;
00116     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00117
00118
00119     // Build the key CLSID\\{...}
00120     _TCHAR szKey[64] ;
00121     _tcscpy(szKey, _T("CLSID\\")) ;
00122
00123   MAKE_TSTRPTR_FROMWIDE(pszT, wszCLSID);
00124   _tcscat(szKey, pszT) ;
00125
00126     // Delete the CLSID Key - CLSID\{...}
00127     LONG lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szKey) ;
00128     assert((lResult == ERROR_SUCCESS) ||
00129          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00130
00131     // Free memory.
00132     CoTaskMemFree(wszCLSID) ;
00133
00134     return S_OK ;
00135 }
00136
00137 //
00138 // Register the snap-in in the registry.
00139 //
00140 HRESULT RegisterSnapin(const CLSID& clsid,         // Class ID
00141                        const _TCHAR* szNameString,   // NameString
00142                        const CLSID& clsidAbout,   // Class Id for About Class
00143                        const BOOL fSupportExtensions)
00144 {
00145     // Get CLSID
00146     LPOLESTR wszCLSID = NULL ;
00147     LPOLESTR wszAboutCLSID = NULL;
00148     HRESULT hr = StringFromCLSID(clsid, &wszCLSID) ;
00149
00150     if (IID_NULL != clsidAbout)
00151         hr = StringFromCLSID(clsidAbout, &wszAboutCLSID);
00152
00153   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00154   MAKE_TSTRPTR_FROMWIDE(pszAboutCLSID, wszAboutCLSID);
00155
00156
00157     // Add the CLSID to the registry.
00158     setSnapInKeyAndValue(pszCLSID, NULL, _T("NameString"), szNameString) ;
00159     setSnapInKeyAndValue(pszCLSID, _T("StandAlone"), NULL, NULL);
00160     if (IID_NULL != clsidAbout)
00161         setSnapInKeyAndValue(pszCLSID, NULL, _T("About"), pszAboutCLSID);
00162
00163     if (fSupportExtensions) {
00164         // Build the key NodeType
00165         setSnapInKeyAndValue(pszCLSID, _T("NodeTypes"), NULL, NULL);
00166
00167         _TCHAR szKey[64] ;
00168         _tcscpy(szKey, pszCLSID) ;
00169         _tcscat(szKey, _T("\\NodeTypes")) ;
00170         setSnapInKeyAndValue(szKey, pszCLSID, NULL, NULL);
00171     }
00172
00173     // Free memory.
00174     CoTaskMemFree(wszCLSID) ;
00175     if (IID_NULL != clsidAbout)
00176         CoTaskMemFree(wszAboutCLSID);
00177
00178     return S_OK ;
00179 }
00180
00181 //
00182 // Unregister the snap-in in the registry.
00183 //
00184 HRESULT UnregisterSnapin(const CLSID& clsid)         // Class ID
00185 {
00186     _TCHAR szKeyBuf[1024];
00187     LPOLESTR wszCLSID = NULL;
00188
00189     // Get CLSID
00190     HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
00191   MAKE_TSTRPTR_FROMWIDE(pszCLSID, wszCLSID);
00192
00193     // Load the buffer with the Snap-In Location
00194     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00195
00196     // Copy keyname into buffer.
00197     _tcscat(szKeyBuf, _T("\\"));
00198     _tcscat(szKeyBuf, pszCLSID);
00199
00200     // Delete the CLSID Key - CLSID\{...}
00201     LONG lResult = recursiveDeleteKey(HKEY_LOCAL_MACHINE, szKeyBuf);
00202     assert((lResult == ERROR_SUCCESS) ||
00203          (lResult == ERROR_FILE_NOT_FOUND)) ; // Subkey may not exist.
00204
00205     // free the memory
00206     CoTaskMemFree(wszCLSID);
00207
00208     return S_OK;
00209 }
00210
00211 //
00212 // Delete a key and all of its descendents.
00213 //
00214 LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
00215                         const _TCHAR* lpszKeyChild)  // Key to delete
00216 {
00217     // Open the child.
00218     HKEY hKeyChild ;
00219     LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
00220         KEY_ALL_ACCESS, &hKeyChild) ;
00221     if (lRes != ERROR_SUCCESS)
00222     {
00223         return lRes ;
00224     }
00225
00226     // Enumerate all of the decendents of this child.
00227     FILETIME time ;
00228     _TCHAR szBuffer[256] ;
00229     DWORD dwSize = 256 ;
00230     while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
00231         NULL, NULL, &time) == S_OK)
00232     {
00233         // Delete the decendents of this child.
00234         lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
00235         if (lRes != ERROR_SUCCESS)
00236         {
00237             // Cleanup before exiting.
00238             RegCloseKey(hKeyChild) ;
00239             return lRes;
00240         }
00241         dwSize = 256 ;
00242     }
00243
00244     // Close the child.
00245     RegCloseKey(hKeyChild) ;
00246
00247     // Delete this child.
00248     return RegDeleteKey(hKeyParent, lpszKeyChild) ;
00249 }
00250
00251 //
00252 // Create a key and set its value.
00253 //   - This helper function was borrowed and modifed from
00254 //     Kraig Brockschmidt's book Inside OLE.
00255 //
00256 BOOL setKeyAndValue(const _TCHAR* szKey,
00257                     const _TCHAR* szSubkey,
00258                     const _TCHAR* szValue)
00259 {
00260     HKEY hKey;
00261     _TCHAR szKeyBuf[1024] ;
00262
00263     // Copy keyname into buffer.
00264     _tcscpy(szKeyBuf, szKey) ;
00265
00266     // Add subkey name to buffer.
00267     if (szSubkey != NULL)
00268     {
00269         _tcscat(szKeyBuf, _T("\\")) ;
00270         _tcscat(szKeyBuf, szSubkey ) ;
00271     }
00272
00273     // Create and open key and subkey.
00274     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00275         szKeyBuf,
00276         0, NULL, REG_OPTION_NON_VOLATILE,
00277         KEY_ALL_ACCESS, NULL,
00278         &hKey, NULL) ;
00279     if (lResult != ERROR_SUCCESS)
00280     {
00281         return FALSE ;
00282     }
00283
00284     // Set the Value.
00285     if (szValue != NULL)
00286     {
00287         RegSetValueEx(hKey, NULL, 0, REG_SZ,
00288             (BYTE *)szValue,
00289             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00290     }
00291
00292     RegCloseKey(hKey) ;
00293     return TRUE ;
00294 }
00295
00296 //
00297 // Open a key value and set it
00298 //
00299 BOOL setValue(const _TCHAR* szKey,
00300               const _TCHAR* szValueName,
00301               const _TCHAR* szValue)
00302 {
00303     HKEY hKey;
00304     _TCHAR szKeyBuf[1024] ;
00305
00306     // Copy keyname into buffer.
00307     _tcscpy(szKeyBuf, szKey) ;
00308
00309     // Create and open key and subkey.
00310     long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT ,
00311         szKeyBuf,
00312         0, NULL, REG_OPTION_NON_VOLATILE,
00313         KEY_ALL_ACCESS, NULL,
00314         &hKey, NULL) ;
00315     if (lResult != ERROR_SUCCESS)
00316     {
00317         return FALSE ;
00318     }
00319
00320     // Set the Value.
00321     if (szValue != NULL)
00322     {
00323         RegSetValueEx(hKey, szValueName, 0, REG_SZ,
00324             (BYTE *)szValue,
00325             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00326     }
00327
00328     RegCloseKey(hKey) ;
00329     return TRUE ;
00330 }
00331
00332 //
00333 // Create a key and set its value.
00334 //   - This helper function was borrowed and modifed from
00335 //     Kraig Brockschmidt's book Inside OLE.
00336 //
00337 BOOL setSnapInKeyAndValue(const _TCHAR* szKey,
00338                           const _TCHAR* szSubkey,
00339                           const _TCHAR* szName,
00340                           const _TCHAR* szValue)
00341 {
00342     HKEY hKey;
00343     _TCHAR szKeyBuf[1024] ;
00344
00345     // Load the buffer with the Snap-In Location
00346     _tcscpy(szKeyBuf, _T("SOFTWARE\\Microsoft\\MMC\\SnapIns"));
00347
00348     // Copy keyname into buffer.
00349     _tcscat(szKeyBuf, _T("\\")) ;
00350     _tcscat(szKeyBuf, szKey) ;
00351
00352     // Add subkey name to buffer.
00353     if (szSubkey != NULL)
00354     {
00355         _tcscat(szKeyBuf, _T("\\")) ;
00356         _tcscat(szKeyBuf, szSubkey ) ;
00357     }
00358
00359     // Create and open key and subkey.
00360     long lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE ,
00361         szKeyBuf,
00362         0, NULL, REG_OPTION_NON_VOLATILE,
00363         KEY_ALL_ACCESS, NULL,
00364         &hKey, NULL) ;
00365     if (lResult != ERROR_SUCCESS)
00366     {
00367         return FALSE ;
00368     }
00369
00370     // Set the Value.
00371     if (szValue != NULL)
00372     {
00373         RegSetValueEx(hKey, szName, 0, REG_SZ,
00374             (BYTE *)szValue,
00375             (_tcslen(szValue)+1)*sizeof(_TCHAR)) ;
00376     }
00377
00378     RegCloseKey(hKey) ;
00379     return TRUE ;
00380 }
00381
Generated on Wed Nov 13 2024 16:51:47 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/iis/ISAPI_6.0/src/IsapiModule.cpp Source File

  • Web
  • iis
  • ISAPI_6.0
  • src

IsapiModule.cpp

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 2003  Microsoft Corporation
00004
00005 Module Name: IsapiModule.cpp
00006
00007 Abstract:
00008
00009     Module functions for ISAPI tools library
00010
00011 Author:
00012
00013     ISAPI developer (Microsoft employee), October 2002
00014
00015 --*/
00016
00017 #include <IsapiTools.h>
00018
00019 //
00020 // Implement the project global module name
00021 //
00022
00023 CHAR    g_szModuleName[MAX_PATH+1] = "*UnknownIsapi*";
00024
00025 VOID
00026 InitializeIsapiTools(
00027     CHAR *  szModuleName
00028     )
00029 /*++
00030
00031 Purpose:
00032
00033     Initializes IsapiTools so that time function work
00034     correctly, and so that debug output contains the
00035     module name.
00036
00037 Arguments:
00038
00039     szModuleName - The name of the dll (ie. "MyIsapi", without ".dll")
00040
00041 Returns:
00042
00043     None
00044
00045 --*/
00046 {
00047     //
00048     // Set the module name
00049     //
00050
00051     if ( szModuleName != NULL )
00052     {
00053         strncpy( g_szModuleName, szModuleName, MAX_PATH );
00054
00055         g_szModuleName[MAX_PATH] = '\0';
00056     }
00057
00058     //
00059     // Initialize the time tools
00060     //
00061
00062     InitializeIsapiTime();
00063
00064     return;
00065 }
Generated on Wed Nov 13 2024 16:52:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/mmc2.0/viewex/addvfiledlg.h Source File

  • SysMgmt
  • MMC
  • mmc2.0
  • viewex

addvfiledlg.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This source code is only intended as a supplement to existing
00004 //  Microsoft documentation.
00005 //
00006 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00007 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00008 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00009 //  PURPOSE.
00010 //
00011 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00012 //
00013 //  AddVFileDlg.h:   Header for the CAddVFileDlg class.  This is a
00014 //                   modeless dialog class used to add Virtual Files.
00015 //
00016
00017
00018 #ifndef _CLASS_ADDVFILEDLG_
00019 #define _CLASS_ADDVFILEDLG_
00020
00021
00022 #if _MSC_VER > 1000
00023 #pragma once
00024 #endif // _MSC_VER > 1000
00025
00026
00027 #include "BaseDialog.h"
00028
00029
00030 //---------------------------------------------------------------------------
00031 class CAddVFileDlg : public CBaseDialog
00032 {
00033   public:
00034     CAddVFileDlg( ULONG nTemplate, HWND hParentWnd );
00035     ~CAddVFileDlg();
00036
00037
00038   public:
00039     BOOL ProcessMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
00040
00041
00042   // Messages we will be handling
00043   private:
00044     LRESULT OnInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam );
00045     LRESULT OnOK( HWND hDlg, WPARAM wParam, LPARAM lParam );
00046
00047   private:
00048     HWND    m_hParentWnd;
00049
00050
00051 };
00052
00053 #endif //_CLASS_ADDVFILEDLG_
Generated on Wed Nov 13 2024 16:52:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CContextMenuExtension Member List

This is the complete list of members for CContextMenuExtension, including all inherited members.
AddMenuItems(LPDATAOBJECT piDataObject, LPCONTEXTMENUCALLBACK piCallback, long __RPC_FAR *pInsertionAllowed) | CContextMenuExtension | [virtual]
CContextMenuExtension() | CContextMenuExtension |
Command(long lCommandID, LPDATAOBJECT piDataObject) | CContextMenuExtension | [virtual]
ExtractData(IDataObject *piDataObject, CLIPFORMAT cfClipFormat, BYTE *pbData, DWORD cbData) | CContextMenuExtension | [private]
ExtractObjectTypeGUID(IDataObject *piDataObject, GUID *pguidObjectType) | CContextMenuExtension | [private]
ExtractSnapInCLSID(IDataObject *piDataObject, CLSID *pclsidSnapin) | CContextMenuExtension | [private]
ExtractString(IDataObject *piDataObject, CLIPFORMAT cfClipFormat, WCHAR *pstr, DWORD cchMaxLength) | CContextMenuExtension | [private]
m_cref | CContextMenuExtension | [private]
QueryInterface(REFIID riid, LPVOID *ppv) | CContextMenuExtension |
s_cfDisplayName | CContextMenuExtension | [private, static]
s_cfNodeType | CContextMenuExtension | [private, static]
s_cfSnapInCLSID | CContextMenuExtension | [private, static]
STDMETHODIMP_(ULONG) AddRef() | CContextMenuExtension |
STDMETHODIMP_(ULONG) Release() | CContextMenuExtension |
~CContextMenuExtension() | CContextMenuExtension |
Generated on Wed Nov 13 2024 16:55:57 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Object_Pooling/OPBankSample/Account.VC/mvmoney.Cpp Source File

  • Com
  • Services
  • Object_Pooling
  • OPBankSample
  • Account.VC

mvmoney.Cpp

Go to the documentation of this file.
00001 /*+==========================================================================
00002   File:      mvmoney.cpp
00003   Summary:   Implementation of Move Money component
00004   Classes:   CMoveMoney
00005 -----------------------------------------------------------------------------
00006
00007 This file is part of the Microsoft COM+ Samples.
00008
00009 Copyright (C) 1995-1999 Microsoft Corporation. All rights reserved.
00010
00011 This source code is intended only as a supplement to Microsoft
00012 Development Tools and/or on-line documentation. See these other
00013 materials for detailed information regarding Microsoft code samples.
00014
00015 THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00016 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00017 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00018 PARTICULAR PURPOSE.
00019
00020 ==========================================================================+*/
00021
00022 #include "stdafx.h"
00023 #include "Account.h"
00024 #include "MvMoney.h"
00025 #include "GetRec.h"
00026
00027 #include <comsvcs.h>
00028
00029 extern HRESULT CheckAmount (IObjectContext * pObjectContext, long lAmount, BSTR * s);
00030
00031
00032 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00033   Function: CMoveMoney::InterfaceSupportsErrorInfo
00034   Summary:  Confirms or denies that an error came from IMoveMoney interface
00035   Args:     REFIID riid     Interface ID returned in error
00036   Returns:  HRESULT
00037 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00038 STDMETHODIMP CMoveMoney::InterfaceSupportsErrorInfo(REFIID riid)
00039 {
00040   static const IID* arr[] =
00041   {
00042     &IID_IMoveMoney,
00043   };
00044
00045   for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
00046   {
00047     // refer to guiddef.h
00048     if (::InlineIsEqualGUID(*arr[i],riid))
00049       return S_OK;
00050   }
00051   return S_FALSE;
00052 }
00053
00054 /*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
00055   Function: CMoveMoney::Perform
00056   Summary:  Moves money from one account to another
00057   Args:     long lPrimeAccount    The primary account
00058       long lSecondAccount   The secondary account
00059       long lAmount      Amount to transfer
00060       long lTranType      Transaction type (debit or credit)
00061       BSTR* pbstrResult   Informational string (NULL if error)
00062   Returns:  HRESULT         S_OK or E_FAIL
00063 M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
00064 //  Perform: modifies the specified account by the specified amount
00065 //
00066 //  pvResult: a BSTR giving information.  NOTE: this is set to NULL when an error occurs
00067 //
00068 //  returns:  S_OK or E_FAIL
00069
00070 STDMETHODIMP CMoveMoney::Perform (IN long lPrimeAccount, IN long lSecondAccount, IN long lAmount,
00071                   IN long lTranType, OUT BSTR* pbstrResult) {
00072
00073   if (!pbstrResult)
00074     return E_POINTER;
00075
00076
00077   HRESULT hr = S_OK;
00078   IObjectContext* pObjectContext = NULL;
00079
00080   *pbstrResult = NULL;
00081   hr = CoGetObjectContext(IID_IObjectContext, (void**)&pObjectContext);
00082   if (!pObjectContext)
00083   {
00084     AtlReportError( CLSID_CMoveMoney, L"No Object Context", IID_IAccount, hr);
00085     return hr;
00086   }
00087
00088 /*---------------------------------------------------------------------------------------------
00089 *
00090 * This check in the original MoveMoney is kind of silly -- we merely delegate to the Accont
00091 * object, which is going to make exactly the same check...
00092 *
00093 *
00094 * hr = CheckAmount(pObjectContext, lAmount, pbstrResult);
00095 * if (FAILED(hr))
00096 * {
00097 *   pObjectContext -> SetAbort();
00098 *   SafeRelease(pObjectContext);
00099 *   AtlReportError( CLSID_CMoveMoney, *pbstrResult, IID_IAccount, hr);
00100 *   if (pbstrResult)
00101 *     SysFreeString(*pbstrResult);
00102 *   return hr;
00103 * }
00104 *-----------------------------------------------------------------------------------------*/
00105
00106   IAccount* pObjAccount = NULL;
00107
00108   IGetReceipt* pObjGetReceipt = NULL;
00109
00110
00111   if (m_bUseComPlus)
00112   {
00113
00114     hr = CoCreateInstance(CLSID_CAccount, NULL, m_clsctxAccount, IID_IAccount, (void**)&pObjAccount);
00115   }
00116   else
00117   {
00118     // Create the account object using our context
00119     hr =  CoCreateInstance(CLSID_CAccount, NULL, CLSCTX_ALL, IID_IAccount, (void**)&pObjAccount);
00120   }
00121
00122   if (FAILED(hr))
00123   {
00124
00125     pObjectContext -> SetAbort();
00126     SafeRelease(pObjectContext);
00127     AtlReportError(CLSID_CMoveMoney, L"Unable to create account instance", IID_IAccount, hr);
00128     return hr;
00129   }
00130
00131   // Call the post function based on the transaction type
00132   switch ( lTranType )
00133   {
00134     case (1): // debit
00135       hr =  pObjAccount->Post (lPrimeAccount, 0 - lAmount, pbstrResult) ;
00136       break;
00137     case (2): // credit
00138       hr = pObjAccount->Post (lPrimeAccount, lAmount, pbstrResult);
00139       break;
00140     case (3): // transfer
00141     {
00142
00143       BSTR s1 = 0;
00144       BSTR s2 = 0;
00145       WCHAR szBuf [512];
00146       ZeroMemory(szBuf, 512 * sizeof(WCHAR));
00147
00148       // Do the credit
00149       hr = pObjAccount->Post (lSecondAccount, lAmount, &s1);
00150       if (SUCCEEDED(hr))
00151       {
00152         // Then do the debit
00153         hr = pObjAccount->Post (lPrimeAccount, 0 - lAmount, &s2);
00154         if (SUCCEEDED(hr))
00155         {
00156           wsprintf(szBuf, L"%s;%s", s1, s2);
00157         }
00158         else
00159         {
00160           wsprintf(szBuf, L"Post to account %ld failed.  Error: %s", lPrimeAccount, s2);
00161         }
00162       }
00163       else
00164       {
00165         wsprintf(szBuf, L"Post to account %ld failed.  Error: %s", lSecondAccount, s1);
00166
00167       }
00168       ::SysFreeString(s1);
00169       ::SysFreeString(s2);
00170
00171       _ASSERTE(*szBuf);
00172       *pbstrResult = SysAllocString(szBuf);
00173       break;
00174     }
00175     default:
00176       *pbstrResult = SysAllocString(L"Invalid Transaction Type");
00177       hr = E_FAIL;
00178   }
00179
00180
00181   if (hr == S_OK) // all go up to here -- get a receipt
00182   {
00183
00184     WCHAR szBuffer [512];
00185     // Get Receipt Number for the transaction
00186     hr = CoCreateInstance (CLSID_CGetReceipt, NULL, CLSCTX_ALL, IID_IGetReceipt, (void**)&pObjGetReceipt);
00187     if (pObjGetReceipt)
00188     {
00189       long lngReceiptNo;
00190       hr = pObjGetReceipt->GetNextReceipt(&lngReceiptNo);
00191       if (hr == S_OK)
00192       {
00193
00194         // Tag receipt information onto return string
00195         wsprintf (szBuffer, _T("; Receipt No:  %li"), lngReceiptNo);
00196         BSTR bstrTemp = SysAllocString(szBuffer);
00197         TCHAR szBuffer2 [512];
00198         lstrcpyn(szBuffer2, *pbstrResult, lstrlen(*pbstrResult) );
00199         wcsncat(szBuffer2, bstrTemp, lstrlen(bstrTemp));
00200         ::SysFreeString (bstrTemp);
00201         ::SysFreeString (*pbstrResult);
00202         *pbstrResult = SysAllocString(szBuffer2);
00203       }
00204
00205       pObjGetReceipt -> Release();
00206       pObjGetReceipt = NULL;
00207     }
00208     else
00209     {
00210       wsprintf(szBuffer, L"Failed to create the receipt object.  hr = %hX", hr);
00211       ::SysFreeString (*pbstrResult);
00212       *pbstrResult = SysAllocString(L"Invalid Transaction Type");
00213     }
00214   }
00215
00216
00217   if (FAILED(hr))
00218   {
00219     pObjectContext -> SetAbort();
00220     AtlReportError(CLSID_CMoveMoney, *pbstrResult, IID_IAccount, hr);
00221     ::SysFreeString(*pbstrResult);
00222     *pbstrResult = NULL;
00223   }
00224   else
00225   {
00226     // We are finished and happy
00227     pObjectContext->SetComplete();
00228   }
00229
00230
00231   // Release resources
00232   if (pObjAccount)
00233     pObjAccount->Release();
00234
00235   if (pObjectContext)
00236     pObjectContext->Release();
00237
00238   return hr;
00239 }
Generated on Wed Nov 13 2024 16:51:58 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Com/Services/Queued_Components/QCJAVA/Components/qcShip/IShip.java Source File

  • Com
  • Services
  • Queued_Components
  • QCJAVA
  • Components
  • qcShip

IShip.java

Go to the documentation of this file.
00001 //
00002 // Auto-generated using JActiveX.EXE 5.00.2918
00003 //   ("C:\Program Files\Microsoft Visual Studio\VJ98\jactivex.exe" /javatlb /c2j /creg /xh /wfc  /w /xi /X:rkc /l "C:\DOCUME~1\a-sunilc\LOCALS~1\Temp\jvc1E6.tmp" /nologo /d "D:\ComPlusSamples\Source\QCSample1" "D:\ComPlusSamples\Source\QCSample1\QCShip.tlb")
00004 //
00005 // WARNING: Do not remove the comments that include "@com" directives.
00006 // This source file must be compiled by a @com-aware compiler.
00007 // If you are using the Microsoft Visual J++ compiler, you must use
00008 // version 1.02.3920 or later. Previous versions will not issue an error
00009 // but will not generate COM-enabled class files.
00010 //
00011
00012 package qcship;
00013
00014 import com.ms.com.*;
00015 import com.ms.com.IUnknown;
00016 import com.ms.com.Variant;
00017
00018 // Dual interface IShip
00019 /** @com.interface(iid=CB34A1A4-28C2-11D2-B5B6-00C04FC340EE, thread=AUTO, type=DUAL) */
00020 public interface IShip extends IUnknown
00021 {
00022   /** @com.method(vtoffset=4, dispid=1, type=PROPPUT, name="CustomerId", name2="putCustomerId", addFlagsVtable=4)
00023       @com.parameters([in,type=I4] _jcomparam_0) */
00024   public void setCustomerId(int _jcomparam_0);
00025
00026   /** @com.method(vtoffset=5, dispid=2, type=PROPPUT, name="OrderId", name2="putOrderId", addFlagsVtable=4)
00027       @com.parameters([in,type=I4] _jcomparam_0) */
00028   public void setOrderId(int _jcomparam_0);
00029
00030   /** @com.method(vtoffset=6, dispid=3, type=METHOD, name="LineItem", addFlagsVtable=4)
00031       @com.parameters([in,type=I4] lItemId, [in,type=I4] lQuantity) */
00032   public void LineItem(int lItemId, int lQuantity);
00033
00034   /** @com.method(vtoffset=7, dispid=4, type=METHOD, name="Process", addFlagsVtable=4)
00035       @com.parameters([in,type=I4] lFlags) */
00036   public void Process(int lFlags);
00037
00038
00039   public static final com.ms.com._Guid iid = new com.ms.com._Guid((int)0xcb34a1a4, (short)0x28c2, (short)0x11d2, (byte)0xb5, (byte)0xb6, (byte)0x0, (byte)0xc0, (byte)0x4f, (byte)0xc3, (byte)0x40, (byte)0xee);
00040 }
Generated on Wed Nov 13 2024 16:51:59 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CVariant Member List

This is the complete list of members for CVariant, including all inherited members.
Attach(VARIANT *pSrc) | CVariant
ChangeType(VARTYPE vt, VARIANT *pSrc=NULL) | CVariant
Clear() | CVariant
Copy(VARIANT *pSrc) | CVariant
CVariant() | CVariant
Detach(VARIANT *pDest) | CVariant
Init() | CVariant
~CVariant() | CVariant
Generated on Wed Nov 13 2024 16:57:38 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CLine Member List

This is the complete list of members for CLine, including all inherited members.
CLine() | CLine | [inline]
get_x1(long *pVal) | CLine |
get_x2(long *pVal) | CLine |
get_y1(long *pVal) | CLine |
get_y2(long *pVal) | CLine |
GetClassID(CLSID *pClassID) | IMyPersistStreamImpl< CLine > | [inline]
GetSizeMax(ULARGE_INTEGER FAR *pcbSize) | IMyPersistStreamImpl< CLine > | [inline]
IMyPersistStreamImpl_GetSizeMax(ULARGE_INTEGER FAR *pcbSize) | CLine |
IMyPersistStreamImpl_Load(LPSTREAM pStm) | CLine |
IMyPersistStreamImpl_Save(LPSTREAM pStm, BOOL fClearDirty) | CLine |
InterfaceSupportsErrorInfo(REFIID riid) | CLine |
IsDirty() | IMyPersistStreamImpl< CLine > | [inline]
Load(LPSTREAM pStm) | IMyPersistStreamImpl< CLine > | [inline]
m_bRequiresSave | CLine |
m_Line | CLine | [private]
put_x1(long newVal) | CLine |
put_x2(long newVal) | CLine |
put_y1(long newVal) | CLine |
put_y2(long newVal) | CLine |
QueryInterface(REFIID riid, void **ppvObject)=0 | IMyPersistStreamImpl< CLine > | [pure virtual]
Save(LPSTREAM pStm, BOOL fClearDirty) | IMyPersistStreamImpl< CLine > | [inline]
Generated on Wed Nov 13 2024 16:56:44 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CSampleDataSource Member List

This is the complete list of members for CSampleDataSource, including all inherited members.
CSampleDataSource() | CSampleDataSource |
Initialize(IWbemClassObject *pSampleClass) | CSampleDataSource |
m_aInstance | CSampleDataSource | [private]
m_alHandle | CSampleDataSource | [private]
m_hQuit | CSampleDataSource | [private]
m_hThread | CSampleDataSource | [private]
SetHandles(IWbemClassObject *pSampleClass) | CSampleDataSource | [private]
Simulate() | CSampleDataSource | [private]
ThreadEntry(void *pArgs) | CSampleDataSource | [private, static]
UpdateInstance(IWbemObjectAccess *pObj) | CSampleDataSource |
~CSampleDataSource() | CSampleDataSource | [virtual]
Generated on Wed Nov 13 2024 16:57:16 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: SysMgmt/MMC/Openserv/people.Cpp Source File

  • SysMgmt
  • MMC
  • Openserv

people.Cpp

Go to the documentation of this file.
00001 //==============================================================;
00002 //
00003 //      This source code is only intended as a supplement to
00004 //  existing Microsoft documentation.
00005 //
00006 //
00007 //
00008 //
00009 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00010 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00011 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00012 //  PURPOSE.
00013 //
00014 //  Copyright (C) 1999 - 2001 Microsoft Corporation.  All Rights Reserved.
00015 //
00016 //
00017 //
00018 //==============================================================;
00019 #include <stdio.h>
00020 #include "People.h"
00021
00022 const GUID CPeoplePoweredVehicle::thisGuid = { 0x2974380d, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
00023
00024 const GUID CBicycleFolder::thisGuid = { 0xef163732, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00025 const GUID CSkateboardFolder::thisGuid = { 0xef163733, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00026 const GUID CIceSkateFolder::thisGuid = { 0xf6c660b0, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00027
00028 const GUID CBicycle::thisGuid = { 0xef163734, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00029 const GUID CSkateboard::thisGuid = { 0xef163735, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00030 const GUID CIceSkate::thisGuid = { 0xf6c660b1, 0x9353, 0x11d2, { 0x99, 0x67, 0x0, 0x80, 0xc7, 0xdc, 0xb3, 0xdc } };
00031
00032
00033 //==============================================================
00034 //
00035 // CPeoplePoweredVehicle implementation
00036 //
00037 //
00038 CPeoplePoweredVehicle::CPeoplePoweredVehicle()
00039 {
00040     children[0] = new CBicycleFolder;
00041     children[1] = new CSkateboardFolder;
00042     children[2] = new CIceSkateFolder;
00043 }
00044
00045 CPeoplePoweredVehicle::~CPeoplePoweredVehicle()
00046 {
00047     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00048         delete children[n];
00049 }
00050
00051 HRESULT CPeoplePoweredVehicle::OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent)
00052 {
00053     SCOPEDATAITEM sdi;
00054
00055     if (!bExpanded) {
00056         // create the child nodes, then expand them
00057         for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00058             ZeroMemory(&sdi, sizeof(SCOPEDATAITEM) );
00059             sdi.mask = SDI_STR       |   // Displayname is valid
00060                 SDI_PARAM     |   // lParam is valid
00061                 SDI_IMAGE     |   // nImage is valid
00062                 SDI_OPENIMAGE |   // nOpenImage is valid
00063                 SDI_PARENT    |   // relativeID is valid
00064                 SDI_CHILDREN;     // cChildren is valid
00065
00066             sdi.relativeID  = (HSCOPEITEM)parent;
00067             sdi.nImage      = children[n]->GetBitmapIndex();
00068             sdi.nOpenImage  = INDEX_OPENFOLDER;
00069             sdi.displayname = MMC_CALLBACK;
00070             sdi.lParam      = (LPARAM)children[n];       // The cookie
00071             sdi.cChildren   = 0;
00072
00073             HRESULT hr = pConsoleNameSpace->InsertItem( &sdi );
00074
00075             children[n]->SetHandle((HANDLE)sdi.ID);
00076
00077             _ASSERT( SUCCEEDED(hr) );
00078         }
00079     }
00080
00081     return S_OK;
00082 }
00083
00084 CBicycleFolder::CBicycleFolder()
00085 {
00086     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00087         children[n] = new CBicycle(n + 1);
00088     }
00089 }
00090
00091 CBicycleFolder::~CBicycleFolder()
00092 {
00093     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00094         if (children[n]) {
00095             delete children[n];
00096         }
00097 }
00098
00099 HRESULT CBicycleFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00100 {
00101     HRESULT      hr = S_OK;
00102
00103     IHeaderCtrl *pHeaderCtrl = NULL;
00104     IResultData *pResultData = NULL;
00105
00106     if (bShow) {
00107         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00108         _ASSERT( SUCCEEDED(hr) );
00109
00110         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00111         _ASSERT( SUCCEEDED(hr) );
00112
00113         // Set the column headers in the results pane
00114         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00115         _ASSERT( S_OK == hr );
00116
00117         // insert items here
00118         RESULTDATAITEM rdi;
00119
00120         hr = pResultData->DeleteAllRsltItems();
00121         _ASSERT( SUCCEEDED(hr) );
00122
00123         if (!bExpanded) {
00124             // create the child nodes, then expand them
00125             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00126                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00127                 rdi.mask       = RDI_STR       |   // Displayname is valid
00128                     RDI_IMAGE     |
00129                     RDI_PARAM;        // nImage is valid
00130
00131                 rdi.nImage      = children[n]->GetBitmapIndex();
00132                 rdi.str         = MMC_CALLBACK;
00133                 rdi.nCol        = 0;
00134                 rdi.lParam      = (LPARAM)children[n];
00135
00136                 hr = pResultData->InsertItem( &rdi );
00137
00138                 children[n]->SetHandle((HANDLE)rdi.itemID);
00139
00140                 _ASSERT( SUCCEEDED(hr) );
00141             }
00142         }
00143
00144         pHeaderCtrl->Release();
00145         pResultData->Release();
00146     }
00147
00148     return hr;
00149 }
00150
00151 CIceSkateFolder::CIceSkateFolder()
00152 {
00153     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00154         children[n] = new CIceSkate(n + 1);
00155     }
00156 }
00157
00158 CIceSkateFolder::~CIceSkateFolder()
00159 {
00160     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00161         if (children[n]) {
00162             delete children[n];
00163         }
00164 }
00165
00166 HRESULT CIceSkateFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00167 {
00168     HRESULT      hr = S_OK;
00169
00170     IHeaderCtrl *pHeaderCtrl = NULL;
00171     IResultData *pResultData = NULL;
00172
00173     if (bShow) {
00174         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00175         _ASSERT( SUCCEEDED(hr) );
00176
00177         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00178         _ASSERT( SUCCEEDED(hr) );
00179
00180         // Set the column headers in the results pane
00181         hr = pHeaderCtrl->InsertColumn( 0, L"Name                ", 0, MMCLV_AUTO );
00182         _ASSERT( S_OK == hr );
00183
00184         // insert items here
00185         RESULTDATAITEM rdi;
00186
00187         hr = pResultData->DeleteAllRsltItems();
00188         _ASSERT( SUCCEEDED(hr) );
00189
00190         if (!bExpanded) {
00191             // create the child nodes, then expand them
00192             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00193                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00194                 rdi.mask       = RDI_STR       |   // Displayname is valid
00195                     RDI_IMAGE     |
00196                     RDI_PARAM;        // nImage is valid
00197
00198                 rdi.nImage      = children[n]->GetBitmapIndex();
00199                 rdi.str         = MMC_CALLBACK;
00200                 rdi.nCol        = 0;
00201                 rdi.lParam      = (LPARAM)children[n];
00202
00203                 hr = pResultData->InsertItem( &rdi );
00204
00205                 children[n]->SetHandle((HANDLE)rdi.itemID);
00206
00207                 _ASSERT( SUCCEEDED(hr) );
00208             }
00209         }
00210
00211         pHeaderCtrl->Release();
00212         pResultData->Release();
00213     }
00214
00215     return hr;
00216 }
00217
00218 CSkateboardFolder::CSkateboardFolder()
00219 {
00220     for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00221         children[n] = new CSkateboard(n + 1);
00222     }
00223 }
00224
00225 CSkateboardFolder::~CSkateboardFolder()
00226 {
00227     for (int n = 0; n < NUMBER_OF_CHILDREN; n++)
00228         if (children[n]) {
00229             delete children[n];
00230         }
00231 }
00232
00233 HRESULT CSkateboardFolder::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
00234 {
00235     HRESULT      hr = S_OK;
00236
00237     IHeaderCtrl *pHeaderCtrl = NULL;
00238     IResultData *pResultData = NULL;
00239
00240     if (bShow) {
00241         hr = pConsole->QueryInterface(IID_IHeaderCtrl, (void **)&pHeaderCtrl);
00242         _ASSERT( SUCCEEDED(hr) );
00243
00244         hr = pConsole->QueryInterface(IID_IResultData, (void **)&pResultData);
00245         _ASSERT( SUCCEEDED(hr) );
00246
00247         // Set the column headers in the results pane
00248         hr = pHeaderCtrl->InsertColumn( 0, L"Name                      ", 0, MMCLV_AUTO );
00249         _ASSERT( S_OK == hr );
00250
00251         // insert items here
00252         RESULTDATAITEM rdi;
00253
00254         hr = pResultData->DeleteAllRsltItems();
00255         _ASSERT( SUCCEEDED(hr) );
00256
00257         if (!bExpanded) {
00258             // create the child nodes, then expand them
00259             for (int n = 0; n < NUMBER_OF_CHILDREN; n++) {
00260                 ZeroMemory(&rdi, sizeof(RESULTDATAITEM) );
00261                 rdi.mask       = RDI_STR       |   // Displayname is valid
00262                     RDI_IMAGE     |
00263                     RDI_PARAM;        // nImage is valid
00264
00265                 rdi.nImage      = children[n]->GetBitmapIndex();
00266                 rdi.str         = MMC_CALLBACK;
00267                 rdi.nCol        = 0;
00268                 rdi.lParam      = (LPARAM)children[n];
00269
00270                 hr = pResultData->InsertItem( &rdi );
00271
00272                 children[n]->SetHandle((HANDLE)rdi.itemID);
00273
00274                 _ASSERT( SUCCEEDED(hr) );
00275             }
00276         }
00277
00278         pHeaderCtrl->Release();
00279         pResultData->Release();
00280     }
00281
00282     return hr;
00283 }
00284
00285 const _TCHAR *CBicycle::GetDisplayName(int nCol)
00286 {
00287     static _TCHAR buf[128];
00288
00289     _stprintf(buf, _T("Bicycle #%d"), id);
00290
00291     return buf;
00292 }
00293
00294 const _TCHAR *CSkateboard::GetDisplayName(int nCol)
00295 {
00296     static _TCHAR buf[128];
00297
00298     _stprintf(buf, _T("Skateboard #%d"), id);
00299
00300     return buf;
00301 }
00302
00303 const _TCHAR *CIceSkate::GetDisplayName(int nCol)
00304 {
00305     static _TCHAR buf[128];
00306
00307     _stprintf(buf, _T("Ice Skate #%d"), id);
00308
00309     return buf;
00310 }
Generated on Wed Nov 13 2024 16:52:35 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Dataaccess/oledb/sampprov/colinfo.cpp Source File

  • Dataaccess
  • oledb
  • sampprov

colinfo.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------
00002 // Microsoft OLE DB Sample Provider
00003 // (C) Copyright 1991 - 1999 Microsoft Corporation. All Rights Reserved.
00004 //
00005 // @doc
00006 //
00007 // @module COLINFO.CPP | IColumnsInfo interface implementation
00008 //
00009
00010 // Includes ------------------------------------------------------------------
00011
00012 #include "headers.h"
00013
00014 // Code ----------------------------------------------------------------------
00015
00016 //  IColumnsInfo specific methods
00017
00018 // CImpIColumnsInfo::GetColumnInfo -------------------------------------------
00019 //
00020 // @mfunc Returns the column metadata needed by most consumers.
00021 //
00022 // @rdesc HRESULT
00023 //      @flag S_OK              | The method succeeded
00024 //      @flag E_OUTOFMEMORY     | Out of memory
00025 //      @flag E_INVALIDARG      | pcColumns or prginfo or ppStringsbuffer was NULL
00026 //
00027 STDMETHODIMP CImpIColumnsInfo::GetColumnInfo
00028 (
00029     DBORDINAL*      pcColumns,      //@parm OUT | Number of columns in rowset
00030     DBCOLUMNINFO**  prgInfo,        //@parm OUT | Array of DBCOLUMNINFO Structures
00031     WCHAR**         ppStringsBuffer //@parm OUT | Storage for all string values
00032 )
00033 {
00034   HRESULT     hr = S_OK;
00035   DBORDINAL   cCols = 0;
00036   DBORDINAL   cExtraCols = 0;
00037   DBORDINAL   cbHeapUsed = 0;
00038   DBORDINAL   cIter = 0;
00039   BYTE *      pbHeap = NULL;
00040   WCHAR *     pwstrBuffer = NULL;
00041   DBCOLUMNINFO *  rgdbcolinfo = NULL;
00042     DBCOLUMNINFO *  rgdbInternalcolinfo = NULL;
00043   DBCOLUMNINFO *  rgdbExtracolinfo = NULL;
00044   CRowset *   pCRowset = NULL;
00045   CFileIO *   pFileio = NULL;
00046
00047   //
00048   // Asserts
00049     //
00050   assert(m_pObj);
00051
00052     //
00053     // Check in-params and NULL out-params in case of error
00054     //
00055   if( pcColumns )
00056     *pcColumns = 0;
00057
00058   if( prgInfo )
00059     *prgInfo = NULL;
00060
00061   if( ppStringsBuffer )
00062     *ppStringsBuffer = NULL;
00063
00064     if( !pcColumns || !prgInfo || !ppStringsBuffer )
00065         return E_INVALIDARG;
00066
00067   //
00068   // Get the Column Information off of the Command or Rowset
00069   //
00070   if( m_pObj->GetBaseObjectType() == BOT_COMMAND )
00071   {
00072     //
00073     // Asserts
00074     //
00075     assert(((CCommand *) m_pObj)->m_pCSession);
00076     assert(((CCommand *) m_pObj)->m_pCSession->m_pCDataSource);
00077
00078     //
00079     // Check that a command has been set
00080     //
00081     if( !((CCommand *) m_pObj)->IsCommandSet() )
00082       return DB_E_NOCOMMAND;
00083
00084     //
00085     // Try to open the file...
00086     //
00087     hr = ((CCommand *) m_pObj)->m_pCSession->m_pCDataSource->OpenFile(
00088                ((CCommand *) m_pObj)->GetCommandText(), &pFileio);
00089     if( FAILED(hr) )
00090       return hr;
00091   }
00092   else
00093   {
00094     if( m_pObj->GetBaseObjectType() == BOT_ROWSET )
00095       pFileio = ((CRowset *) m_pObj)->GetFileObj();
00096     else
00097     {
00098       pFileio = ((CRow *) m_pObj)->GetFileObj();
00099
00100       cExtraCols = ((CRow *) m_pObj)->GetExtraColCount();
00101       rgdbExtracolinfo = ((CRow *) m_pObj)->GetExtraColumnInfo();
00102     }
00103   }
00104
00105   //
00106   // Get the column count and delete unneeded info
00107   //
00108   cCols       = pFileio->GetColumnCnt();
00109   pbHeap        = pFileio->GetColNameHeap();
00110   cbHeapUsed      = pFileio->GetColNameHeapSize();
00111   rgdbInternalcolinfo = pFileio->GetColInfo();
00112
00113   //
00114   // Return the column information
00115   //
00116   SAFE_ALLOC(rgdbcolinfo, DBCOLUMNINFO, (cCols + cExtraCols) * sizeof(DBCOLUMNINFO));
00117   SAFE_ALLOC(pwstrBuffer, WCHAR, cbHeapUsed);
00118
00119   // 64 bit TODO
00120   memcpy(rgdbcolinfo, &(rgdbInternalcolinfo[1]), (ULONG)cCols*sizeof(DBCOLUMNINFO));
00121   memcpy(rgdbcolinfo+cCols, rgdbExtracolinfo, (ULONG)cExtraCols*sizeof(DBCOLUMNINFO));
00122
00123   //
00124   // Need to fix up column ordinals for extra columns
00125   //
00126   for (cIter=cCols; cIter < cCols+cExtraCols; cIter++)
00127     rgdbcolinfo[cIter].iOrdinal = cIter+1;
00128
00129   //
00130   // Copy the heap for column names.
00131   //
00132   if( cbHeapUsed )
00133   {
00134     ptrdiff_t dp;
00135
00136     // 64 bit TODO
00137     memcpy(pwstrBuffer, pbHeap, (DBORDINAL)cbHeapUsed);
00138     dp = (DBBYTEOFFSET)pwstrBuffer - (DBBYTEOFFSET)(pbHeap);
00139     dp >>= 1;
00140
00141     // Loop through columns and adjust pointers to column names.
00142     for (ULONG icol=0; icol < cCols; icol++)
00143     {
00144       if( rgdbcolinfo[icol].pwszName )
00145         rgdbcolinfo[icol].pwszName += dp;
00146     }
00147   }
00148
00149     //
00150   // Assign in the values
00151   //
00152     *pcColumns       = cCols + cExtraCols;
00153   *prgInfo         = rgdbcolinfo;
00154     *ppStringsBuffer = pwstrBuffer;
00155
00156 CLEANUP:
00157
00158   //
00159   // Cleanup the File Information
00160   //
00161   if( m_pObj->GetBaseObjectType() == BOT_COMMAND )
00162     SAFE_DELETE(pFileio);
00163
00164   if( FAILED(hr) )
00165   {
00166     SAFE_DELETE(rgdbcolinfo);
00167     SAFE_DELETE(pwstrBuffer);
00168   }
00169
00170     return hr;
00171 }
00172
00173 // CImpIColumnsInfo::MapColumnIDs --------------------------------------------
00174 //
00175 // @mfunc Returns an array of ordinals of the columns in a rowset that are
00176 // identified by the specified column IDs.
00177 //
00178 // @rdesc HRESULT
00179 //      @flag S_OK                      | The method succeeded
00180 //      @flag E_INVALIDARG              | cColumnIDs was not 0 and rgColumnIDs was NULL,
00181 //                                        rgColumns was NULL
00182 //      @flag DB_E_COLUMNUNAVAILABLE    | An element of rgColumnIDs was invalid
00183 //
00184 STDMETHODIMP CImpIColumnsInfo::MapColumnIDs
00185 (
00186     DBORDINAL   cColumnIDs,     //@parm IN | Number of Column IDs to map
00187     const DBID  rgColumnIDs[],  //@parm IN | Column IDs to map
00188     DBORDINAL   rgColumns[]     //@parm OUT | Ordinal values
00189 )
00190 {
00191   DBORDINAL cCols = 0;
00192   ULONG   ulError = 0;
00193
00194   //
00195   // Asserts
00196     //
00197   assert(m_pObj);
00198
00199     //
00200   // NO-OP if cColumnIds is 0
00201   //
00202   if( cColumnIDs == 0 )
00203         return S_OK;
00204
00205     //
00206     // Check in-params and NULL out-params in case of error
00207     //
00208     if( !rgColumnIDs || !rgColumns )
00209         return E_INVALIDARG;
00210
00211   //
00212   // Get the Column count
00213   //
00214   if( m_pObj->GetBaseObjectType() == BOT_COMMAND )
00215   {
00216     HRESULT hr = E_FAIL;
00217     CFileIO * pFileio = NULL;
00218
00219     //
00220     // Asserts
00221     //
00222     assert(((CCommand *) m_pObj)->m_pCSession);
00223     assert(((CCommand *) m_pObj)->m_pCSession->m_pCDataSource);
00224
00225     //
00226     // Check that a command has been set
00227     //
00228     if( !((CCommand *) m_pObj)->IsCommandSet() )
00229       return DB_E_NOCOMMAND;
00230
00231     //
00232     // Open the File and get the column count
00233     //
00234     hr = ((CCommand *) m_pObj)->m_pCSession->m_pCDataSource->OpenFile(
00235               ((CCommand *) m_pObj)->GetCommandText(), &pFileio);
00236     if( FAILED(hr) )
00237       return hr;
00238
00239     cCols = pFileio->GetColumnCnt();
00240     SAFE_DELETE(pFileio);
00241   }
00242   else
00243   {
00244     if( m_pObj->GetBaseObjectType() == BOT_ROWSET )
00245       cCols = ((CRowset *) m_pObj)->m_cCols;
00246     else
00247       cCols = ((CRow *) m_pObj)->GetFileObj()->GetColumnCnt();
00248   }
00249
00250     //
00251   // Walk the Column ID structs and determine the ordinal value
00252   //
00253     for (ULONG i=0; i < cColumnIDs; i++)
00254     {
00255     if( m_pObj->GetBaseObjectType() == BOT_ROW &&
00256       IsEqualDBID(&rgColumnIDs[i], &DBROWCOL_DEFAULTSTREAM) )
00257     {
00258       rgColumns[i] = cCols + DEFAULT_STREAM_ORDINAL;
00259     }
00260         else if( (rgColumnIDs[i].eKind != DBKIND_GUID_PROPID) ||
00261          (rgColumnIDs[i].uGuid.guid != GUID_NULL)     ||
00262          (rgColumnIDs[i].uName.ulPropid < 1)          ||
00263          (rgColumnIDs[i].uName.ulPropid > cCols) )
00264         {
00265             rgColumns[i] = DB_INVALIDCOLUMN;
00266             ulError++;
00267         }
00268     else
00269             rgColumns[i] = rgColumnIDs[i].uName.ulPropid;
00270     }
00271
00272   //
00273   // Return the correct HResult
00274   //
00275   return ulError ? (ulError < cColumnIDs) ?
00276       DB_S_ERRORSOCCURRED : DB_E_ERRORSOCCURRED : S_OK;
00277 }
Generated on Wed Nov 13 2024 16:52:09 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: NetDS/WinNT/NetApi/ChngPass/ChngPass.c Source File

  • NetDS
  • WinNT
  • NetApi
  • ChngPass

ChngPass.c

Go to the documentation of this file.
00001 /*++
00002
00003 Copyright (c) 1995 - 2000  Microsoft Corporation
00004
00005 Module Name:
00006
00007     chngpass.c
00008
00009 Abstract:
00010
00011     This sample changes the password for an arbitrary user on an arbitrary
00012     target machine.
00013
00014     When targetting a domain controller for account update operations,
00015     be sure to target the primary domain controller for the domain.
00016     The account settings are replicated by the primary domain controller
00017     to each backup domain controller as appropriate.  The NetGetDCName()
00018     Lan Manager API call can be used to get the primary domain controller
00019     computer name from a domain name.
00020
00021
00022     Username is argv[1]
00023     new password is argv[2]
00024     optional target machine (or domain name) is argv[3]
00025     optional old password is argv[4].  This allows non-admin password
00026      changes.
00027
00028     Note that admin or account operator privilege is required on the
00029     target machine unless argv[4] is present and represents the correct
00030     current password.
00031
00032     NetUserSetInfo() at info-level 1003 is appropriate for administrative
00033     over-ride of an existing password.
00034
00035     NetUserChangePassword() allows for an arbitrary user to over-ride
00036     an existing password providing that the current password is confirmed.
00037
00038     Link with netapi32.lib
00039
00040 Author:
00041
00042     Scott Field (sfield)    21-Dec-95
00043
00044 --*/
00045
00046 #include <windows.h>
00047 #include <stdio.h>
00048
00049 #include <lm.h>
00050
00051 #define RTN_OK 0
00052 #define RTN_USAGE 1
00053 #define RTN_ERROR 13
00054
00055 void
00056 DisplayErrorText(
00057     DWORD dwLastError
00058     );
00059
00060 //
00061 // Unicode entry point and argv
00062 //
00063
00064 int
00065 __cdecl
00066 wmain(
00067     int argc,
00068     wchar_t *argv[]
00069     )
00070 {
00071     LPWSTR          wUserName;
00072     LPWSTR          wComputerName = NULL; // default to local machine
00073     LPWSTR          wOldPassword;
00074     LPWSTR          wNewPassword;
00075     USER_INFO_1003  pi1003;
00076     NET_API_STATUS  nas;
00077
00078
00079
00080     if( argc < 3 ) {
00081         fprintf(stderr, "Usage: %ls <user> <new_password> "
00082                         "[\\\\machine | domain] [old_password]\n",
00083                         argv[0]);
00084         return RTN_USAGE;
00085     }
00086
00087     //
00088     // process command line arguments
00089     //
00090
00091     wUserName = argv[1];
00092     wNewPassword = argv[2];
00093
00094     if( argc >= 4 && *argv[3] != L'\0' ) {
00095
00096         //
00097         // obtain target machine name, if appropriate
00098         // always in Unicode, as that is what the API takes
00099         //
00100
00101         if(argv[3][0] == L'\\' && argv[3][1] == L'\\') {
00102
00103             //
00104             // target specified machine name
00105             //
00106
00107             wComputerName = argv[3];
00108         }
00109         else {
00110
00111             //
00112             // the user specified a domain name.  Lookup the PDC
00113             //
00114
00115             nas = NetGetDCName(
00116                 NULL,
00117                 argv[3],
00118                 (LPBYTE *)&wComputerName
00119                 );
00120
00121             if(nas != NERR_Success) {
00122                 DisplayErrorText( nas );
00123                 return RTN_ERROR;
00124             }
00125         }
00126     }
00127
00128     if(argc == 5) {
00129         wOldPassword = argv[4];
00130     } else {
00131         wOldPassword = NULL;
00132     }
00133
00134     if(wOldPassword == NULL) {
00135
00136         //
00137         // administrative over-ride of existing password
00138         //
00139
00140         pi1003.usri1003_password = wNewPassword;
00141
00142         nas = NetUserSetInfo(
00143                 wComputerName,  // computer name
00144                 wUserName,      // username
00145                 1003,           // info level
00146                 (LPBYTE)&pi1003,     // new info
00147                 NULL
00148                 );
00149     } else {
00150
00151         //
00152         // allows user to change their own password
00153         //
00154
00155         nas = NetUserChangePassword(
00156                 wComputerName,
00157                 wUserName,
00158                 wOldPassword,
00159                 wNewPassword
00160                 );
00161     }
00162
00163     if(wComputerName != NULL && wComputerName != argv[3]) {
00164
00165         //
00166         // a buffer was allocated for the PDC name, free it
00167         //
00168
00169         NetApiBufferFree(wComputerName);
00170     }
00171
00172     if(nas != NERR_Success) {
00173         DisplayErrorText( nas );
00174         return RTN_ERROR;
00175     }
00176
00177     return RTN_OK;
00178 }
00179
00180 void
00181 DisplayErrorText(
00182     DWORD dwLastError
00183     )
00184 {
00185     HMODULE hModule = NULL; // default to system source
00186     LPSTR MessageBuffer;
00187     DWORD dwBufferLength;
00188     DWORD dwFormatFlags;
00189
00190     dwFormatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER |
00191                     FORMAT_MESSAGE_IGNORE_INSERTS |
00192                     FORMAT_MESSAGE_FROM_SYSTEM ;
00193
00194     //
00195     // if dwLastError is in the network range, load the message source
00196     //
00197     if (dwLastError >= NERR_BASE && dwLastError <= MAX_NERR)
00198     {
00199
00200         TCHAR tcharPath[MAX_PATH+1];  // Space for the System32 path, the DLL, and the Null termination
00201         UINT  uiRet;                  // Length of the System32 Path returned by GetSystemDirectory
00202
00203         // We know our DLL lives in the System32 directory, get the path and build the correct path
00204         // To make sure everything fits within our buffer, pass in the size of MAX_PATH minus the size of
00205         // our dll string.
00206         uiRet = GetSystemDirectory(tcharPath, MAX_PATH - 10 );
00207
00208         // Make sure the call succeeded
00209         if ( (MAX_PATH - 10 > uiRet) && (0 != uiRet) )
00210         {
00211             // Concatenate the dll to our string
00212             lstrcat(tcharPath, TEXT("\\netmsg.dll") );
00213
00214             // Call LoadLibraryEX with the complete path
00215             hModule = LoadLibraryEx(
00216                                    tcharPath,       // the complete path to the netmsg.dll
00217                                    NULL,
00218                                    LOAD_LIBRARY_AS_DATAFILE
00219                                    );
00220
00221         }
00222         // Did the LoadLibrary Succeed
00223         if (hModule != NULL)
00224             dwFormatFlags |= FORMAT_MESSAGE_FROM_HMODULE;
00225
00226     }
00227
00228     //
00229     // call FormatMessage() to allow for message text to be acquired
00230     // from the system or the supplied module handle
00231     //
00232     if(dwBufferLength = FormatMessageA(
00233         dwFormatFlags,
00234         hModule, // module to get message from (NULL == system)
00235         dwLastError,
00236         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // default language
00237         (LPSTR) &MessageBuffer,
00238         0,
00239         NULL
00240         ))
00241     {
00242         DWORD dwBytesWritten;
00243
00244         //
00245         // Output message string on stderr
00246         //
00247         WriteFile(
00248             GetStdHandle(STD_ERROR_HANDLE),
00249             MessageBuffer,
00250             dwBufferLength,
00251             &dwBytesWritten,
00252             NULL
00253             );
00254
00255         //
00256         // free the buffer allocated by the system
00257         //
00258         LocalFree(MessageBuffer);
00259     }
00260
00261     //
00262     // if we loaded a message source, unload it
00263     //
00264     if(hModule != NULL)
00265         FreeLibrary(hModule);
00266 }
Generated on Wed Nov 13 2024 16:52:24 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Web/NetMeeting/PlugTransport/nullmdm.h Source File

  • Web
  • NetMeeting
  • PlugTransport

nullmdm.h

Go to the documentation of this file.
00001 //****************************************************************************
00002 //  Module:     PLUGTRANSPORT.EXE
00003 //  File:       NULLMDM.H
00004 //  Content:
00005 //
00006 //
00007 //  Copyright (c) Microsoft Corporation 1995-2002
00008 //
00009 // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00010 // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00011 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00012 // PARTICULAR PURPOSE.
00013 //****************************************************************************
00014
00015
00016
00017 #ifndef _NULL_MODEM_H_
00018 #define _NULL_MODEM_H_
00019
00020 #define COMPORTNAMEMAXLENGTH   64
00021
00022
00023 typedef enum tagTPhysicalError
00024 {
00025     TPHYS_SUCCESS                       =   0,
00026     TPHYS_RESULT_INUSE                  = 100,
00027     TPHYS_RESULT_FAIL                   = 101,
00028     TPHYS_RESULT_NOT_INITIALIZED        = 102,
00029     TPHYS_RESULT_CONNECT_FAILED         = 103,
00030     TPHYS_CONNECT_RESPONSE_FAILED       = 104,
00031     TPHYS_RESULT_NOT_LISTENING          = 105,
00032     TPHYS_RESULT_INVALID_CONNECTION     = 106,
00033     TPHYS_RESULT_INVALID_ADDRESS        = 107,
00034     TPHYS_RESULT_CONNECT_REJECTED       = 108,
00035     TPHYS_RESULT_SUCCESS_ALTERNATE      = 109,
00036     TPHYS_RESULT_COMM_PORT_BUSY         = 110,
00037     TPHYS_RESULT_WAITING_FOR_CONNECTION = 111,
00038 }
00039     TPhysicalError;
00040
00041
00042 typedef struct tphys_connect_info
00043 {
00044     UINT       connectionID;
00045     UINT       resultCode;
00046 }
00047     TPHYS_CONNECT_INFO, * PTPHYS_CONNECT_INFO;
00048
00049 typedef UINT        PHYSICAL_HANDLE;
00050
00051
00052 ///////////////////////////////////////////////////////////////////////////////
00053 // Structure containing state information for each NULLMODEM line
00054 ///////////////////////////////////////////////////////////////////////////////
00055 typedef enum tagCALL_STATE
00056 {
00057     CALL_STATE_IDLE         = 0,    // Call is idle
00058     CALL_STATE_MAKE         = 1,    // Establishing phone connection
00059     CALL_STATE_ANSWER       = 2,    // Answering a new call
00060     CALL_STATE_DROP         = 3,    // Dropping the phone connection
00061     CALL_STATE_CONNECTED    = 4,    // Phone connection established and passed onto TDD.
00062 }
00063     CALL_STATE;
00064
00065 typedef struct tagLINE_INFO
00066 {
00067     HANDLE              hevtCall;       // handle to the call
00068     HANDLE              hCommLink;      // handle to COM device - call
00069     BOOL                fCaller;        // FALSE = incoming call
00070     CALL_STATE          eCallState;     // one of the following states
00071     PHYSICAL_HANDLE     pstnHandle;
00072     TPHYS_CONNECT_INFO  connInfo;
00073 }
00074     LINE_INFO;
00075
00076
00077 class CNullModem
00078 {
00079 public:
00080
00081     CNullModem(void);
00082     ~CNullModem(void);
00083
00084     TPhysicalError TPhysInitialize(UINT transport_id);
00085     TPhysicalError TPhysTerminate(void);
00086     TPhysicalError TPhysConnectRequest(LPTSTR pszComPort);
00087     TPhysicalError TPhysDisconnect(void);
00088
00089     HANDLE GetCommLink(void) { return m_Line.hCommLink; }
00090
00091 private:
00092
00093     DWORD DoConnect(void);
00094
00095     void SetBuffers(void);
00096     void SetTimeouts(void);
00097
00098     void DropCall(void);
00099     BOOL WaitForConnection(void);
00100     void SetConnectedPort(void);
00101     void SetComPortState(void);
00102
00103 private:
00104
00105     BOOL            m_fInitialized;
00106     UINT            m_nTransportID;          // ID required by RNC
00107     UINT            m_nConnectionID;         // next conn ID to allocate
00108     LINE_INFO       m_Line;
00109
00110     HANDLE          m_hevtOverlapped;
00111     DWORD           m_dwEventMask;
00112     BOOL            m_fCommPortInUse;
00113     OVERLAPPED      m_Overlapped;
00114
00115     COMMTIMEOUTS    m_DefaultTimeouts;
00116 };
00117
00118 class CPSTN
00119 {
00120 public:
00121  CPSTN(void);
00122  ~CPSTN(void);
00123  HRESULT CreateComPort(UINT nTransportID, LPTSTR pszComPort);
00124  HRESULT CloseComPort();
00125  HANDLE GetCommLink(void);
00126
00127 private:
00128  CNullModem*  m_pNullModem;
00129  TCHAR      m_szComPortName[COMPORTNAMEMAXLENGTH];
00130 };
00131
00132
00133 #define COMM_PORT_TIMEOUT       60000    //  60 seconds
00134 #define COMM_PORT_BAUD_RATE     19200    // or 57600 or others
00135 #define COMM_PORT_STOP_BITS     ONESTOPBIT
00136 #define COMM_PORT_DATA_BITS     8
00137
00138 #endif // _NULL_MODEM_H_
00139
Generated on Wed Nov 13 2024 16:52:46 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: Member List

  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members

CRTCSession Member List

This is the complete list of members for CRTCSession, including all inherited members.
CRTCSession() | CRTCSession |
CRTCWin class | CRTCSession | [friend]
DeliverClient(RTC_CLIENT_EVENT_TYPE enEventType) | CRTCSession | [protected, virtual]
DeliverIntensity(RTC_AUDIO_DEVICE enDevice, long lLevel) | CRTCSession | [protected, virtual]
DeliverMedia(long lMediaType, RTC_MEDIA_EVENT_TYPE enType, RTC_MEDIA_EVENT_REASON enReason) | CRTCSession | [protected, virtual]
DeliverMessage(IRTCParticipant *pParticipant, BSTR bstrContentType, BSTR bstrMessage) | CRTCSession | [protected, virtual]
DeliverParticipantState(IRTCParticipant *pParticipant, RTC_PARTICIPANT_STATE enState) | CRTCSession | [protected, virtual]
DeliverSessionState(RTC_SESSION_STATE enState) | CRTCSession | [protected, virtual]
DeliverUserStatus(IRTCParticipant *pParticipant, RTC_MESSAGING_USER_STATUS enStatus) | CRTCSession | [protected, virtual]
m_enState | CRTCSession | [protected]
m_hStatusBar | CRTCSession | [protected]
m_hWnd | CRTCSession | [protected]
m_pSession | CRTCSession | [protected]
m_pWin | CRTCSession | [protected]
OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCSession | [protected, virtual]
OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCSession | [protected, virtual]
OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCSession | [protected, virtual]
OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam) | CRTCSession | [protected, virtual]
SetStatusText(PWSTR szText) | CRTCSession | [protected]
ShowMessageBox(PWSTR szText) | CRTCSession | [protected]
~CRTCSession() | CRTCSession |
Generated on Wed Nov 13 2024 16:57:15 for WinXP-Examples by doxygen 1.7.1


WinXP-Examples: WinUI/Shell/ColumnProvider/ShortName.Cpp Source File

  • WinUI
  • Shell
  • ColumnProvider

ShortName.Cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
00004 //  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
00005 //  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006 //  PARTICULAR PURPOSE.
00007 //
00008 //  Copyright (C) 1999 - 2000  Microsoft Corporation.  All rights reserved.
00009 //
00010 //  ShortName.cpp
00011 //
00012 //      Implements DLL entry-point (DllMain), DllGetClassObject and
00013 //      DllCanUnloadNow functions.
00014 //
00015 //////////////////////////////////////////////////////////////////////
00016
00017 #include "ShortName.h"
00018 #include "ClassFactory.h"
00019
00020 HINSTANCE hDllInstance = NULL;
00021 ULONG nDllRefCount = 0;
00022
00023 CLSID CLSID_ShortNameColumnProvider = {0};
00024
00025 BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
00026 {
00027     switch (dwReason)
00028     {
00029         case DLL_PROCESS_ATTACH:
00030             hDllInstance = hInstance;
00031             nDllRefCount = 0;
00032
00033             //
00034             //  Initialize CLSID_ShortNameColumnProvider
00035             //
00036             GetObjectClsid (&CLSID_ShortNameColumnProvider);
00037             break;
00038
00039         case DLL_THREAD_ATTACH:
00040             break;
00041
00042         case DLL_THREAD_DETACH:
00043             break;
00044
00045         case DLL_PROCESS_DETACH:
00046             break;
00047
00048         default:
00049             break;
00050     }
00051     return TRUE;
00052 }
00053
00054
00055 STDAPI DllCanUnloadNow (VOID)
00056 {
00057     if (nDllRefCount > 0)
00058         return S_FALSE;
00059     return S_OK;
00060 }
00061
00062
00063 STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
00064 {
00065     if (ppv == NULL)
00066         return E_INVALIDARG;
00067
00068     *ppv = NULL;
00069
00070     if (!IsEqualIID(rclsid, CLSID_ShortNameColumnProvider))
00071         return CLASS_E_CLASSNOTAVAILABLE;
00072
00073     CClassFactory *pFactory = new CClassFactory;
00074     if (!pFactory)
00075         return E_OUTOFMEMORY;
00076
00077     HRESULT hResult = NOERROR;
00078     hResult = pFactory->QueryInterface (riid, ppv);
00079
00080     return hResult;
00081 }
Generated on Wed Nov 13 2024 16:52:54 for WinXP-Examples by doxygen 1.7.1